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/mkii/anch-bar.mkii194
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/anch-pgr.mkii1684
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/anch-pos.mkii883
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/anch-snc.mkii177
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/bibl-tra.mkii1781
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/buff-ini.mkii348
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/buff-ver.mkii1339
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/catc-act.mkii65
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/catc-ctx.mkii76
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/catc-def.mkii142
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/catc-ini.mkii269
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/catc-sym.mkii187
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/catc-xml.mkii114
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/colo-ema.mkii590
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/colo-ext.mkii59
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/colo-hex.mkii125
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/colo-ini.mkii2794
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/colo-rgb.mkii530
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/colo-run.mkii257
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/colo-x11.mkii677
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/colo-xwi.mkii143
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/cont-cs.mkii21
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/cont-de.mkii21
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/cont-en.mkii21
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/cont-err.mkii18
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/cont-fil.mkii131
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/cont-fr.mkii21
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/cont-gb.mkii21
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/cont-it.mkii21
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/cont-log.mkii304
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/cont-new.mkii943
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/cont-nl.mkii21
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/cont-ro.mkii22
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/cont-sys.ori186
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/context.mkii436
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/core-con.mkii969
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/core-ctx.mkii203
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/core-def.mkii105
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/core-env.mkii543
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/core-fil.mkii357
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/core-fnt.mkii726
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/core-gen.mkii166
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/core-ini.mkii67
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/core-job.mkii419
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/core-mis.mkii2745
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/core-par.mkii300
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/core-stg.mkii72
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/core-sys.mkii396
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/core-two.mkii206
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/core-uti.mkii349
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/core-var.mkii286
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-032.mkii82
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-037.mkii276
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-acc.mkii139
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-agr.mkii367
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-ans.mkii237
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-cas.mkii143
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-chi.mkii371
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-com.mkii37
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-cyr.mkii1037
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-def.mkii923
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-ec.mkii295
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-ecm.mkii33
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-el.mkii272
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-fde.mkii126
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-ffr.mkii55
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-fpl.mkii98
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-fro.mkii35
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-fsl.mkii32
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-grk.mkii190
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-heb.mkii16
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-ibm.mkii7
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-il2.mkii157
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-ini.mkii1137
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-l7x.mkii236
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-lat.mkii7
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-mis.mkii188
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-pdf.mkii278
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-pfr.mkii305
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-pol.mkii276
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-qx.mkii268
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-raw.mkii119
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-run.mkii149
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-t5.mkii248
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-tbo.mkii222
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-uc.mkii1093
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-vis.mkii3
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-vna.mkii145
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-win.mkii7
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/enco-x5.mkii222
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/filt-bas.mkii63
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/filt-ini.mkii121
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/font-arb.mkii5
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/font-bfm.mkii196
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/font-chi.mkii1156
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/font-heb.mkii5
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/font-ini.mkii4452
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/font-jap.mkii83
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/font-run.mkii326
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/font-uni.mkii444
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/font-unk.mkii187
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/font-xtx.mkii465
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/grph-fig.mkii559
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/grph-inc.mkii1243
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/grph-trf.mkii579
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/hand-def.mkii577
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/hand-ini.mkii483
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/java-ans.mkii28
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/java-exa.mkii395
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/java-fil.mkii48
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/java-fld.mkii475
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/java-ini.mkii693
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/java-stp.mkii121
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/lang-alt.mkii152
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/lang-ana.mkii24
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/lang-art.mkii26
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/lang-bal.mkii118
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/lang-cel.mkii26
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/lang-chi.mkii305
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/lang-ctx.mkii53
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/lang-cyr.mkii371
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/lang-dis.mkii59
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/lang-frd.mkii140
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/lang-frq.mkii207
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/lang-ger.mkii744
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/lang-grk.mkii99
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/lang-ind.mkii26
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/lang-ini.mkii696
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/lang-ita.mkii518
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/lang-jap.mkii234
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/lang-lab.mkii295
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/lang-mis.mkii683
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/lang-run.mkii36
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/lang-sla.mkii485
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/lang-spa.mkii74
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/lang-spe.mkii244
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/lang-ura.mkii158
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/lang-url.mkii306
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/lang-vn.mkii92
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/math-ams.mkii336
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/math-arr.mkii391
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/math-cow.mkii31
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/math-eul.mkii277
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/math-fou.mkii196
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/math-frc.mkii253
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/math-ini.mkii684
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/math-lbr.mkii481
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/math-pln.mkii360
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/math-run.mkii105
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/math-tex.mkii720
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/math-tim.mkii371
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/math-uni.mkii237
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/meta-clp.mkii164
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/meta-dum.mkii123
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/meta-fig.mkii89
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/meta-ini.mkii1054
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/meta-mis.mkii54
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/meta-nav.mkii65
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/meta-pag.mkii226
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/meta-pdf.mkii2761
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/meta-pre.mkii68
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/meta-tex.mkii350
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/meta-txt.mkii304
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/meta-xml.mkii29
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/mult-aux.mkii152
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/mult-chk.mkii29
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/mult-com.mkii31
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/mult-con.mkii53
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/mult-cs.mkii2224
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/mult-de.mkii2224
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/mult-def.mkii31
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/mult-en.mkii2221
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/mult-fr.mkii2224
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/mult-fst.mkii36
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/mult-ini.mkii935
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/mult-it.mkii2224
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/mult-mcs.mkii210
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/mult-mde.mkii210
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/mult-men.mkii210
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/mult-mfr.mkii210
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/mult-mit.mkii210
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/mult-mnl.mkii210
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/mult-mno.mkii210
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/mult-mpe.mkii210
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/mult-mro.mkii210
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/mult-nl.mkii2221
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/mult-pe.mkii2224
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/mult-ro.mkii2224
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/mult-sys.mkii892
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/norm-alo.mkii36
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/norm-ctx.mkii16
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/norm-etx.mkii79
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/norm-ltx.mkii177
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/norm-ptx.mkii132
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/norm-tex.mkii351
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/norm-xtx.mkii18
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/pack-box.mkii956
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/pack-lyr.mkii755
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/pack-obj.mkii371
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/pack-rul.mkii3650
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/page-app.mkii225
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/page-bck.mkii593
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/page-flw.mkii107
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/page-imp.mkii1662
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/page-ini.mkii1558
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/page-ins.mkii103
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/page-lay.mkii1439
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/page-lin.mkii312
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/page-log.mkii202
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/page-mak.mkii230
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/page-mar.mkii867
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/page-mis.mkii268
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/page-mul.mkii1773
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/page-not.mkii72
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/page-one.mkii659
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/page-par.mkii58
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/page-plg.mkii202
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/page-run.mkii382
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/page-set.mkii2781
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/page-sid.mkii931
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/page-spr.mkii104
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/page-str.mkii331
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/page-txt.mkii784
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/pdfr-def.mkii843
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/pdfr-ec.mkii145
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/pdfr-il2.mkii233
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/prop-ini.mkii150
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/prop-lay.mkii143
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/prop-mis.mkii189
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/regi-8859-1.mkii154
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/regi-8859-10.mkii152
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/regi-8859-13.mkii152
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/regi-8859-15.mkii154
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/regi-8859-16.mkii151
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/regi-8859-2.mkii152
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/regi-8859-3.mkii145
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/regi-8859-4.mkii152
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/regi-8859-5.mkii152
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/regi-8859-7.mkii153
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/regi-8859-9.mkii152
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/regi-cp1250.mkii153
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/regi-cp1251.mkii152
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/regi-cp1252.mkii156
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/regi-cp1253.mkii153
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/regi-cp1254.mkii153
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/regi-cp1257.mkii153
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/regi-cyp.mkii1169
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/regi-cyr.mkii722
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/regi-def.mkii21
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/regi-ibm.mkii73
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/regi-ini.mkii248
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/regi-mac.mkii147
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/regi-syn.mkii73
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/regi-uni.mkii24
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/regi-utf.mkii52
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/regi-vis.mkii158
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/scrn-fld.mkii1247
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/scrn-hlp.mkii171
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/scrn-int.mkii2312
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/scrn-nav.mkii379
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/sort-def.mkii450
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/sort-ini.mkii161
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/sort-lan.mkii217
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/spac-gen.mkii4667
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/spac-grd.mkii1074
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/spec-def.mkii1016
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/spec-dpm.mkii444
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/spec-dpx.mkii792
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/spec-dvi.mkii116
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/spec-fdf.mkii3532
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/spec-ini.mkii559
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/spec-mis.mkii288
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/spec-pdf.mkii482
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/spec-ps.mkii229
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/spec-tpd.mkii1334
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/spec-tr.mkii107
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/spec-tst.mkii48
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/spec-var.mkii83
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/spec-win.mkii97
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/spec-xet.mkii66
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/spec-xtx.mkii85
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/spec-yy.mkii90
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/strc-blk.mkii548
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/strc-des.mkii921
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/strc-flt.mkii2173
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/strc-itm.mkii1335
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/strc-lnt.mkii197
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/strc-lst.mkii1150
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/strc-mar.mkii318
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/strc-mat.mkii2925
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/strc-not.mkii1470
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/strc-num.mkii151
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/strc-pag.mkii534
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/strc-ref.mkii3025
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/strc-reg.mkii1243
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/strc-sec.mkii2591
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/strc-swd.mkii127
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/strc-syn.mkii438
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/supp-ali.mkii173
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/supp-box.mkii3126
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/supp-dir.mkii41
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/supp-emp.mkii398
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/supp-eps.mkii202
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/supp-fil.mkii722
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/supp-fun.mkii746
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/supp-lat.mkii59
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/supp-mat.mkii293
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/supp-mis.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/supp-mpe.tex4
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/supp-mps.mkii2134
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/supp-mrk.mkii591
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/supp-num.mkii422
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/supp-pat.mkii175
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/supp-pdf.tex1
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/supp-ran.mkii122
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/supp-spe.mkii164
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/supp-tpi.mkii353
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/supp-vis.mkii1907
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/symb-cow.mkii132
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/symb-eur.mkii64
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/symb-glm.mkii79
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/symb-ini.mkii282
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/symb-jmn.mkii199
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/symb-mis.mkii139
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/symb-mvs.mkii217
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/symb-nav.mkii122
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/symb-run.mkii54
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/symb-uni.mkii1123
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/symb-was.mkii207
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/syst-con.mkii243
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/syst-ext.mkii5025
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/syst-fnt.mkii46
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/syst-gen.mkii4459
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/syst-ini.mkii1067
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/syst-new.mkii886
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/syst-pln.mkii118
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/syst-rtp.mkii18
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/syst-str.mkii124
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/tabl-ltb.mkii866
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/tabl-ntb.mkii1611
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/tabl-nte.mkii107
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/tabl-pln.mkii91
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/tabl-tab.mkii2515
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/tabl-tbl.mkii1440
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/tabl-tsp.mkii427
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/thrd-pic.mkii3694
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/thrd-ran.mkii168
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/thrd-tab.mkii2006
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/thrd-trg.mkii127
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/trac-vis.mkii748
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/type-def.mkii86
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/type-ini.mkii726
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/type-one.mkii2917
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/type-otf.mkii1734
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/type-run.mkii51
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/type-set.mkii81
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/type-siz.mkii748
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/type-tmf.mkii14
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/typo-ini.mkii40
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/unic-000.mkii135
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/unic-001.mkii220
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/unic-002.mkii104
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/unic-003.mkii147
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/unic-004.mkii291
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/unic-005.mkii50
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/unic-030.mkii113
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/unic-031.mkii274
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/unic-032.mkii278
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/unic-033.mkii275
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/unic-034.mkii274
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/unic-035.mkii32
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/unic-037.mkii278
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/unic-039.mkii68
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/unic-251.mkii34
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/unic-cjk.mkii22
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/unic-exp.mkii82
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/unic-ini.mkii777
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/unic-run.mkii130
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/verb-c.mkii484
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/verb-eif.mkii211
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/verb-ini.mkii1789
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/verb-js.mkii171
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/verb-jv.mkii222
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/verb-mp.mkii364
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/verb-pas.mkii266
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/verb-pl.mkii547
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/verb-raw.mkii7
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/verb-sql.mkii230
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/verb-tex.mkii294
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/verb-xml.mkii441
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xetx-chr.mkii1154
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xetx-cls.mkii511
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xetx-ini.mkii132
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xetx-utf.mkii2414
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-cml.mkii228
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-ent.mkii117
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-exp.mkii90
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-ext.mkii439
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-hyp.mkii69
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-ini.mkii3026
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-map.mkii746
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-mea.mkii152
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-meb.mkii124
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-mec.mkii28
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-meh.mkii166
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-men.mkii98
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-meo.mkii58
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-mer.mkii185
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-mmc.mkii1265
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-mml.mkii515
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-mmp.mkii553
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-mxa.mkii101
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-mxb.mkii55
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-mxc.mkii10
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-mxh.mkii67
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-mxn.mkii84
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-mxo.mkii14
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-mxr.mkii112
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-pml.mkii85
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-pmu.mkii188
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-pre.mkii448
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-prs.mkii42
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-raw.mkii37
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-rng.mkii28
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-run.mkii319
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-stk.mkii230
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-utf.mkii21
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-xsd.mkii28
-rw-r--r--Master/texmf-dist/tex/context/base/mkii/xtag-xsl.mkii224
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/anch-pgr.lua45
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/anch-pos.lua15
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/anch-pos.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/anch-snc.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/attr-ini.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/attr-ini.mkiv16
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/back-exp.lua16
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/back-ini.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/back-pdp.lua56
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/blob-ini.lua56
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/buff-ini.lua52
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/buff-ini.mkiv55
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/buff-ver.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/char-def.lua9693
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/char-fio.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/char-ini.lua832
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/char-ini.mkiv1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/char-scr.lua161
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/char-utf.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cldf-bas.lua1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cldf-ini.lua54
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cldf-ver.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/colo-ini.lua81
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cont-fil.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cont-log.mkiv1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cont-new.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cont-run.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/context-error.lmx4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/context-todo.tex5
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/context.mkiv6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/core-con.lua199
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/core-dat.lua35
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/data-bin.lua14
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/data-con.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/data-dec.lua56
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/data-env.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/data-inp.lua3
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/data-out.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/data-pre.lua33
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/data-tar.lua236
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/data-tex.lua5
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/data-tmp.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/data-use.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/data-vir.lua5
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/data-zip.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/export-example.css378
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/file-job.lua5
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/file-lib.lua30
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/file-res.lua10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-cff.lua365
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-cft.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-chk.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-col.lua1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-con.lua23
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-ctx.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-dsp.lua88
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-enc.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-hsh.lua22
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-imp-dimensions.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-imp-effects.lua172
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-imp-italics.lua49
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-imp-ligatures.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-imp-math.lua77
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-imp-properties.lua8
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-imp-reorder.lua3
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-imp-tweaks.lua115
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-imp-unicode.lua26
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-ini.mkvi53
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-lib.mkvi6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-lig.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-map.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-mis.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-mps.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-nod.lua20
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-ocl.lua27
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-ocm.lua93
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-onr.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-osd.lua714
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-ota.lua10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-otc.lua408
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-otj.lua115
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-otl.lua78
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-oto.lua80
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-otr.lua131
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-ots.lua1182
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-ott.lua70
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-oup.lua543
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-phb-imp-binary.lua119
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-phb-imp-library.lua498
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-phb.lua728
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-pre.mkiv15
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-prv.lua18
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-sel.lua38
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-shp.lua17
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-sol.lua38
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-syn.lua21
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-ttf.lua325
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/font-txt.lua553
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/good-gen.lua12
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/good-ini.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/good-mth.lua516
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/grph-con.lua24
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/grph-fil.lua164
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/grph-img.lua25
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/grph-inc.lua42
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/grph-inc.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/grph-pat.lua3
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/grph-raw.lua7
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/l-dir.lua12
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/l-file.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/l-gzip.lua174
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/l-io.lua10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/l-lpeg.lua14
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/l-macro-imp-optimize.lua3
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/l-math.lua16
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/l-number.lua52
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/l-os.lua748
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/l-string.lua24
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/l-url.lua100
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-def.mkiv69
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-dis.lua13
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-exp.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-hyp.lua32
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-imp-indic.lua2282
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-imp-serbian.lua111
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-ini.lua45
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-ini.mkiv8
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-rep.lua20
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-tra.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lang-txt.lua858
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/libs-ini.lua11
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lpdf-ano.lua24
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lpdf-fld.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lpdf-ini.lua3
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lpdf-mov.lua45
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lpdf-nod.lua25
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lpdf-pda.xml18
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lpdf-pdx.xml25
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lpdf-pua.xml29
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lpdf-wid.lua78
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lpdf-xmp.lua7
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/luat-cnf.lua53
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/luat-cod.lua56
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/luat-lib.mkiv7
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/luat-mac.lua24
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/luat-run.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/luat-sto.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lxml-aux.lua31
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lxml-css.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lxml-ctx.mkiv14
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lxml-ini.lua73
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lxml-lpt.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lxml-tab.lua30
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lxml-tex.lua34
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/m-fonts-plugins.mkiv69
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-act.lua514
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-dim.lua1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-dir.lua9
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-ext.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-fbk.lua51
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-frc.lua38
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-ini.lua531
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-ini.mkiv54
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-int.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-map.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-noa.lua46
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-ren.lua7
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-tag.lua7
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-ttv.lua10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/math-vfu.lua11
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/meta-blb.lua8
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/meta-grd.mkiv22
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/meta-imp-dum.mkiv6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/meta-imp-mat.mkiv21
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/meta-imp-txt.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mlib-mpf.lua44
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mlib-pdf.lua21
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mlib-pps.lua13
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mtx-context-compare.tex5
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mtx-context-hashed.tex136
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mtx-context-setters.tex35
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mult-aux.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mult-def.lua241
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mult-fmt.lua18
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mult-fun.lua57
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mult-low.lua249
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mult-mps.lua28
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mult-prm.lua425
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mult-prm.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/mult-sys.mkiv9
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-acc.lua10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-aux.lua90
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-bck.lua13
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-bwc.lua92
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-fin.lua164
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-fnt.lua16
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-gcm.lua66
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-ini.lua14
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-ini.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-ltp.lua82
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-met.lua275
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-mig.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-nut.lua285
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-ppt.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-pro.lua10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-ref.lua9
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-res.lua85
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-rul.lua44
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-rul.mkiv7
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-scn.lua14
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-ser.lua9
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-shp.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-syn.lua36
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-tra.lua102
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-tsk.lua1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-tst.lua44
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/node-typ.lua26
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/pack-cut.mkiv8
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/pack-rul.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-app.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-cst.lua5
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-flt.lua20
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-imp.mkiv9
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-ini.lua171
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-ini.mkiv26
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-inj.mkvi10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-lin.lua1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-lin.mkvi4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-mix.lua56
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-mix.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-one.mkiv32
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-pcl.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-sid.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/page-str.lua18
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/phys-dim.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/phys-dim.mkiv15
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/publ-aut.lua19
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/publ-dat.lua39
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/publ-fnd.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/publ-imp-apa.mkvi6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/publ-imp-aps-prb.mkvi40
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/publ-imp-author.mkvi16
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/publ-imp-cite.mkvi3
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/publ-ini.lua100
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/publ-ini.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/publ-sor.lua20
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/regi-ini.lua1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/scrn-hlp.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/scrn-ini.lua10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/scrn-ini.mkvi4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/scrn-wid.lua19
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/scrn-wid.mkvi1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/scrp-cjk.lua225
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/scrp-ini.lua280
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/scrp-ini.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/spac-ali.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/spac-ali.mkiv3
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/spac-chr.lua83
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/spac-chr.mkiv3
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/spac-hor.mkiv3
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/spac-ver.lua113
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/status-files.pdfbin25384 -> 24604 bytes
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/status-lua.pdfbin257025 -> 265851 bytes
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-blk.lua41
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-blk.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-doc.lua191
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-enu.mkvi14
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-flt.mkvi41
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-lst.lua113
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-mar.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-mat.mkiv21
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-not.mkvi10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-num.lua37
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-pag.lua8
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-ref.lua31
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-ref.mkvi2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-ren.mkiv1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-syn.lua95
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-syn.mkiv32
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/strc-usr.mkiv55
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/supp-box.lua74
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/symb-imp-was.mkiv206
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/syst-aux.mkiv23
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/syst-con.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/syst-ini.mkiv23
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/syst-lua.lua51
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/syst-lua.mkiv4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/tabl-xtb.lua20
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/tabl-xtb.mkvi21
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/task-ini.lua15
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/toks-ini.lua225
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/trac-ctx.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/trac-deb.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/trac-fil.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/trac-jus.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/trac-set.lua64
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/trac-vis.lua66
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/type-set.mkiv162
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-bld.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-brk.lua32
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-cap.lua18
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-chr.lua10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-cln.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-del.mkiv9
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-dha.lua35
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-dig.lua13
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-drp.lua24
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-dua.lua19
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-dub.lua19
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-duc.lua19
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-fkr.lua6
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-fln.lua30
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-inj.lua37
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-itc.lua34
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-krn.lua25
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-lin.lua30
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-mar.lua22
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-pag.lua8
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-pnc.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-rep.lua1
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-rub.lua3
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-spa.lua16
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-sus.lua20
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-tal.lua22
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-wrp.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-wrp.mkiv2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-deb.lua22
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-evo-imp-server.lua7
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-evo.lua22
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-fil.lua18
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-jsn.lua17
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-lib-imp-gm.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-lib-imp-gs.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-lib.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-prs.lua67
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-rnd.lua116
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-sac.lua63
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-sbx.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-sci.lua19
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-sql-imp-ffi.lua3
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-sql-imp-sqlite.lua14
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-sql-imp-swiglib.lua4
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-sql-tickets.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-sql-tracers.lua2
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-sql.lua10
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-str.lua59
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-tab.lua56
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-tar.lua359
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-tbs.lua131
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/util-zip.lua253
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/anch-bar.mkxl52
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/anch-bck.mklx119
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/anch-box.mkxl250
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/anch-loc.lmt520
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/anch-loc.mkxl115
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/anch-pgr.lmt116
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/anch-pgr.mkxl46
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/anch-pos.lmt1495
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/anch-pos.mkxl119
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/anch-snc.lmt217
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/anch-snc.mkxl235
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/anch-tab.mkxl16
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/attr-col.lmt48
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/attr-ini.lmt361
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/attr-ini.mkxl8
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/attr-lay.mkxl12
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/back-exp-imp-mth.lmt169
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/back-exp.lmt420
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/back-exp.mkxl115
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/back-imp-lua.lmt (renamed from Master/texmf-dist/tex/context/base/mkxl/back-lua.lmt)70
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/back-imp-lua.mkxl (renamed from Master/texmf-dist/tex/context/base/mkxl/back-lua.mkxl)4
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/back-imp-mps.lmt (renamed from Master/texmf-dist/tex/context/base/mkxl/back-mps.lmt)21
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/back-imp-mps.mkxl (renamed from Master/texmf-dist/tex/context/base/mkxl/back-mps.mkxl)4
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/back-imp-pdf.lmt49
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/back-imp-pdf.mkxl160
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/back-imp-pdp.lmt (renamed from Master/texmf-dist/tex/context/base/mkxl/back-pdp.lmt)134
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/back-imp-u3d.mkxl (renamed from Master/texmf-dist/tex/context/base/mkxl/back-u3d.mkxl)4
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/back-ini.lmt48
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/back-ini.mkxl7
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/back-pdf.lmt55
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/back-pdf.mkxl157
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/back-res.lmt146
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/back-res.mkxl6
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/bibl-bib.mkxl19
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/bibl-tra.mkxl77
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/blob-ini.lmt50
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/blob-ini.mkxl2
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/bndr-ini.lmt52
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/bndr-ini.mkxl39
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/buff-ini.lmt494
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/buff-ini.mkxl202
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/buff-par.mklx10
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/buff-ver.mkxl107
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/catc-def.mkxl22
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/catc-ini.mkxl239
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/catc-sym.mkxl11
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/char-brl.lmt405
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/char-ini.mkxl2
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/char-prv.lmt15
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/char-tex.lmt37
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/chem-str.mkxl51
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/cldf-bas.lmt262
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/cldf-bas.mkxl14
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/cldf-ini.mkxl2
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/cldf-lmt.lmt119
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/colo-ext.mkxl10
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/colo-grp.mkxl12
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/colo-ini.mkxl191
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/cont-fil.mkxl7
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/cont-log.mkxl57
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/cont-new.mkxl2
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/cont-run.lmt53
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/cont-run.mkxl24
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/context.mkxl259
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/core-con.mkxl61
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/core-dat.mkxl25
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/core-def.mkxl1
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/core-env.lmt53
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/core-env.mkxl97
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/core-ini.mkxl10
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/core-sys.lmt27
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/core-sys.mkxl46
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/core-two.mkxl5
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/core-uti.lmt (renamed from Master/texmf-dist/tex/context/base/mkxl/core-uti.lua)259
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/data-fil.lmt144
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/data-hsh.lmt382
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/data-vir.lmt104
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/driv-ini.lmt138
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/driv-shp.lmt1634
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/driv-shp.mkxl3
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/driv-usr.lmt585
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/enco-ini.mkxl9
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/file-ini.mklx35
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/file-job.lmt133
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/file-job.mklx51
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/file-mod.lmt6
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/file-mod.mklx47
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/file-res.mklx2
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-cff.lmt2788
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-chk.lmt144
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-col.lmt131
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-col.mklx26
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-con.lmt320
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-ctx.lmt270
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-def.lmt2
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-dsp.lmt4668
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-emp.mklx86
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-fbk.lmt75
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-fea.mklx18
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-fil.mklx30
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-fmp.lmt14
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-hsh.lmt397
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-imp-braille.lmt135
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-imp-checks.lmt40
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-imp-digits.lmt62
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-imp-effects.lmt348
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-imp-ligatures.lmt158
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-imp-math.lmt271
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-imp-quality.lmt676
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-imp-sanitize.lmt197
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-imp-scripts.lmt188
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-imp-text.lmt30
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-imp-tracing.lmt166
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-ini.lmt63
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-ini.mklx472
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-lib.mklx100
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-lig.lmt41
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-map.lmt518
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-mat.mklx380
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-mpf.lmt52
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-ogr.lmt221
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-one.lmt847
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-onr.lmt614
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-ota.lmt16
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-otd.lmt284
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-otj.lmt234
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-otl.lmt912
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-ots.lmt1577
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-phb-imp-binary.lmt114
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-phb-imp-internal.lmt160
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-phb.lmt560
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-pre.mkxl187
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-sel.mklx2
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-set.mklx14
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-sol.mklx4
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-sty.mklx44
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-sym.mklx44
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-tex.lmt82
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-tfm.lmt682
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-tpk.lmt1397
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-ttf.lmt1496
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-txt.lmt570
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-unk.mkxl37
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-var.mklx8
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-vfc.lmt87
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/font-vir.lmt6
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/good-gen.lmt220
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/good-mth.lmt286
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/grph-epd.lmt58
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/grph-epd.lua (renamed from Master/texmf-dist/tex/context/base/mkiv/grph-epd.lua)0
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/grph-epd.mkxl4
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/grph-fig.mkxl114
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/grph-inc.lmt263
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/grph-inc.mkxl52
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/grph-pat.mkxl2
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/grph-raw.mkxl2
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/grph-rul.lmt52
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/grph-rul.mkxl2
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/grph-trf.lmt11
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/grph-trf.mkxl107
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/hand-ini.mkxl6
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/java-ini.mkxl6
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/l-number.lmt105
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/l-unicode.lmt808
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lang-def.mkxl133
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lang-dis.lmt35
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lang-frq.mkxl2
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lang-hup.lmt264
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lang-hup.mkxl34
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lang-hyp.lmt39
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lang-hyp.mkxl49
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lang-ini.lmt1075
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lang-ini.mkxl213
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lang-lab.lmt195
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lang-lab.mkxl33
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lang-mis.mkxl175
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lang-rep.lmt467
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lang-rep.mkxl2
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lang-tra.lmt372
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lang-tra.mkxl62
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lang-url.lmt259
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lang-url.mkxl12
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/layo-ini.lmt23
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/layo-ini.mkxl4
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/libs-imp-curl.lmt15
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/libs-imp-foreign.lmt65
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/libs-imp-foreign.mkxl204
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/libs-imp-graphicsmagick.lmt12
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/libs-imp-imagemagick.lmt94
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/libs-imp-lz4.lmt46
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/libs-imp-lzma.lmt54
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/libs-imp-lzo.lmt37
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/libs-imp-mujs.mkxl1
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/libs-imp-zint.lmt78
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/libs-imp-zint.mkxl99
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/libs-imp-zstd.lmt98
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/libs-ini.lmt206
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/libs-ini.mkxl17
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lpdf-ano.lmt102
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lpdf-aux.lmt5
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lpdf-col.lmt114
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lpdf-emb.lmt563
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lpdf-epa.lmt58
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lpdf-fld.lmt33
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lpdf-fmt.lmt20
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lpdf-fnt.lmt7
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lpdf-grp.lmt246
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lpdf-img.lmt1102
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lpdf-ini.lmt361
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lpdf-lmt.lmt1529
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lpdf-mis.lmt107
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lpdf-mov.lmt68
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lpdf-pde.lmt248
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lpdf-ren.lmt31
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lpdf-res.lmt41
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lpdf-rul.lmt522
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lpdf-tag.lmt175
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lpdf-u3d.lmt15
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lpdf-wid.lmt302
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lpdf-xmp.lmt277
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/luat-bas.mkxl6
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/luat-cnf.lmt227
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/luat-cod.lmt117
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/luat-fio.lmt11
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/luat-ini.lmt14
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/luat-ini.mkxl55
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/luat-lib.mkxl19
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/luat-log.lmt111
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/luat-run.lmt306
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/luat-usr.mkxl1
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lxml-ctx.mkxl14
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/lxml-ini.mkxl31
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-acc.mklx183
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-act.lmt3929
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-ali.lmt292
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-ali.mkxl2174
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-brl.lmt526
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-com.mkxl89
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-def.mkxl159
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-del.mkxl19
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-dif.mkxl48
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-dim.lmt251
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-dld.mklx265
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-ext.lmt109
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-fbk.lmt791
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-fen.mkxl1181
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-fnt.lmt151
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-frc.lmt74
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-frc.mkxl797
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-inc.lmt94
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-inc.mkxl2
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-ini.lmt1170
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-ini.mkxl3091
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-int.mkxl108
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-lop.mkxl190
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-map.lmt932
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-noa.lmt2365
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-pln.mkxl98
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-pre.lmt189
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-rad.mklx198
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-ren.lmt74
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-scr.mkxl2
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-spa.lmt204
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-stc.mklx355
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-tag.lmt415
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-toy.mkxl8
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-ttv.lmt584
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-twk.mkxl99
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/math-vfu.lmt1652
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/meta-fig.mkxl5
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/meta-grd.mkxl40
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/meta-imp-bitmaps.mkxl338
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/meta-imp-functions.lmt260
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/meta-imp-functions.mkxl342
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/meta-imp-gamesymbols.mkxl160
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/meta-imp-glyphs.mkxl65
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/meta-imp-kindergarten.mkxl118
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/meta-imp-magick.mkxl108
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/meta-imp-placeholders.mkxl83
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/meta-imp-txt.lmt116
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/meta-ini.lmt125
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/meta-ini.mkxl523
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/meta-nod.mkxl63
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/meta-pdf.mkxl4
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/meta-pdh.mkxl15
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/meta-tex.mkxl238
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/mlib-cnt.lmt72
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/mlib-ctx.lmt45
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/mlib-ctx.mkxl17
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/mlib-fio.lmt153
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/mlib-fnt.lmt (renamed from Master/texmf-dist/tex/context/base/mkxl/font-mps.lmt)290
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/mlib-int.lmt333
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/mlib-lmp.lmt638
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/mlib-lmt.lmt65
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/mlib-lua.lmt210
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/mlib-mat.lmt130
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/mlib-mpf.lmt542
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/mlib-pdf.lmt578
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/mlib-pdf.mkxl29
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/mlib-pos.lmt63
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/mlib-pps.lmt212
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/mlib-pps.mkxl114
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/mlib-run.lmt407
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/mlib-scn.lmt498
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/mlib-snc.lmt36
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/mlib-svg.lmt1514
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/mult-aux.mkxl221
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/mult-def.mkxl16
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/mult-ini.lmt2
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/mult-ini.mkxl124
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/mult-prm.mkxl2
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/mult-sys.mkxl52
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-acc.lmt9
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-ali.lmt949
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-aux.lmt218
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-bck.lmt38
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-bck.mkxl6
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-bwc.lmt13
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-cmp.lmt132
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-dir.lmt (renamed from Master/texmf-dist/tex/context/base/mkiv/node-dir.lua)77
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-ext.lmt21
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-ext.mkxl (renamed from Master/texmf-dist/tex/context/base/mkxl/back-ext.mkxl)40
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-fin.lmt550
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-fin.mkxl115
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-fnt.lmt778
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-gcm.lmt40
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-ini.lmt196
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-ini.mkxl14
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-met.lmt229
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-mig.lmt5
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-nut.lmt262
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-par.lmt27
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-pro.lmt240
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-ref.lmt68
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-res.lmt106
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-rul.lmt960
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-rul.mkxl277
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-scn.lmt165
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-ser.lmt61
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-shp.lmt96
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-syn.lmt157
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-syn.mkxl (renamed from Master/texmf-dist/tex/context/base/mkii/tabl-com.mkii)13
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-tex.lmt6
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-tra.lmt146
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-tsk.lmt1137
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-tst.lmt97
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/node-typ.lmt135
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/norm-ctx.mkxl71
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/pack-bck.mklx2
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/pack-box.mkxl316
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/pack-com.mkxl225
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/pack-cut.mkxl32
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/pack-lyr.mkxl108
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/pack-mat.mkxl384
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/pack-mrl.mkxl103
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/pack-obj.lmt76
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/pack-obj.mkxl90
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/pack-ori.lmt4
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/pack-ori.mkxl16
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/pack-pos.mkxl30
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/pack-rul.lmt79
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/pack-rul.mkxl890
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-app.mkxl15
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-bck.mkxl31
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-blk.lmt100
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-blk.mkxl192
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-box.mklx70
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-brk.mkxl28
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-col.mkxl18
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-com.mkxl30
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-cst.mkxl47
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-ffl.mkxl239
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-flt.mkxl47
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-flw.mkxl2
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-imp.mkxl89
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-inf.mkxl24
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-ini.lmt374
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-ini.mkxl113
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-inj.mklx14
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-ins.mkxl137
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-lay.mkxl533
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-lin.mklx55
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-mak.mklx4
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-mbk.mklx200
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-mcl.mkxl45
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-mix.mkxl103
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-mrk.mkxl81
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-not.mkxl2
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-one.mkxl251
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-otr.mklx47
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-par.mkxl12
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-pcl.mkxl127
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-plg.mkxl10
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-pst.mkxl8
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-sel.lmt77
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-sel.mklx118
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-sid.mkxl419
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-smp.mkxl9
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-spr.mkxl1
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-str.lmt320
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-str.mkxl4
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/page-txt.mklx101
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/phys-dim.mkxl52
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/publ-ini.mkxl286
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/regi-ini.lmt367
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/regi-ini.mkxl23
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/scrn-bar.mklx45
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/scrn-but.mklx92
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/scrn-fld.mklx66
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/scrn-hlp.mklx12
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/scrn-ini.lmt62
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/scrn-ini.mklx59
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/scrn-pag.mklx50
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/scrn-ref.lmt57
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/scrn-ref.mklx14
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/scrn-wid.lmt317
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/scrn-wid.mklx194
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/scrp-ini.lmt918
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/scrp-ini.mkxl2
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/spac-ali.lmt7
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/spac-ali.mkxl202
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/spac-chr.lmt126
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/spac-chr.mkxl9
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/spac-def.mkxl5
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/spac-flr.mkxl18
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/spac-grd.mkxl10
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/spac-hor.lmt46
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/spac-hor.mkxl282
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/spac-lin.mkxl12
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/spac-pag.mkxl12
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/spac-par.mkxl133
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/spac-prf.lmt570
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/spac-prf.mklx97
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/spac-ver.lmt1331
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/spac-ver.mkxl616
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-bkm.mkxl6
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-blk.mkxl42
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-con.mklx136
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-des.mklx25
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-doc.mkxl76
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-enu.mklx65
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-flt.mklx365
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-ind.mkxl17
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-itm.mklx466
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-lab.mkxl20
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-lnt.mklx23
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-lst.lmt1544
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-lst.mklx182
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-mar-old.lmt759
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-mar-old.mkxl142
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-mar.lmt171
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-mar.mkxl188
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-mat.mkxl1469
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-not.lmt530
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-not.mklx406
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-num.mkxl29
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-pag.mkxl52
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-ref.lmt2974
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-ref.mklx210
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-reg.lmt1698
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-reg.mkxl431
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-ren.mkxl78
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-rsc.lmt180
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-sbe.mkxl13
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-sec.mkxl166
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-syn.mkxl77
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-tag.lmt51
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-tag.mkxl28
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/strc-usr.mkxl55
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/supp-box.lmt656
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/supp-box.mkxl388
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/supp-mat.mkxl107
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/supp-ran.lmt245
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/supp-ran.mkxl39
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/symb-ini.mkxl12
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/syst-aux.lmt62
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/syst-aux.mkxl870
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/syst-fnt.mkxl26
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/syst-ini.mkxl655
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/syst-lua.lmt43
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/syst-lua.mkxl13
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/syst-mac.lmt36
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/syst-pln.mkxl4
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/tabl-com.mkxl154
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/tabl-frm.mkxl29
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/tabl-ltb.mkxl125
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/tabl-mis.mkxl22
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/tabl-ntb.mkxl819
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/tabl-tab.mkxl287
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/tabl-tbl.lmt60
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/tabl-tbl.mkxl849
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/tabl-tsp.mkxl59
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/tabl-xtb.lmt1325
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/tabl-xtb.mklx101
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/task-ini.lmt228
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/toks-aux.lmt152
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/toks-aux.mkxl2
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/toks-ini.lmt421
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/toks-scn.lmt72
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/trac-ctx.mkxl14
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/trac-deb.lmt48
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/trac-inf.lmt150
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/trac-jus.lmt122
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/trac-jus.mkxl2
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/trac-set.lmt453
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/trac-tex.mkxl6
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/trac-vis.lmt1477
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/trac-vis.mkxl51
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/type-imp-bengali.mkxl73
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/type-imp-braille.mkxl88
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/type-imp-devanagari.mkxl244
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/type-imp-euler.mkxl71
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/type-imp-gujarati.mkxl77
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/type-imp-indic.mkxl800
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/type-imp-kannada.mkxl73
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/type-imp-malayalam.mkxl224
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/type-imp-tamil.mkxl53
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/type-imp-telugu.mkxl74
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/type-ini.mklx44
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/type-set.mkxl200
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-ada.lmt172
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-ada.mkxl218
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-adj.lmt93
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-adj.mkxl65
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-bld.lmt88
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-bld.mkxl22
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-brk.lmt42
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-brk.mkxl4
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-cap.lmt311
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-cap.mkxl10
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-chr.lmt18
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-chr.mkxl4
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-del.mkxl93
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-dig.lmt21
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-dir.lmt212
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-dir.mkxl8
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-drp.lmt49
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-drp.mkxl99
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-duc.lmt63
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-fln.lmt34
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-fln.mkxl4
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-hid.lmt74
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-hid.mkxl38
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-inj.mkxl8
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-itc.lmt332
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-itm.mkxl36
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-krn.lmt99
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-lan.lmt89
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-lan.mkxl72
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-lbx.lmt251
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-lbx.mkxl378
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-lin.lmt33
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-mar.lmt39
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-mar.mkxl28
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-ovl.mkxl2
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-pag.lmt10
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-par.lmt2
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-par.mkxl2
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-pnc.lmt170
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-pnc.mkxl2
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-rub.lmt206
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-rub.mkxl11
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-shp.lmt4
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-shp.mkxl162
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-spa.lmt47
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-sus.lmt20
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-syn.lmt668
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-syn.mkxl261
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-tal.lmt22
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-tal.mkxl7
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-wrp.lmt81
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/typo-wrp.mkxl22
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/util-deb.lmt391
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/util-fil.lmt172
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/util-pck.lmt176
-rw-r--r--Master/texmf-dist/tex/context/base/mkxl/util-sac.lmt312
1355 files changed, 129933 insertions, 255601 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkii/anch-bar.mkii b/Master/texmf-dist/tex/context/base/mkii/anch-bar.mkii
deleted file mode 100644
index 39d5c7f77e7..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/anch-bar.mkii
+++ /dev/null
@@ -1,194 +0,0 @@
-%D \module
-%D [ file=anch-bar,
-%D version=2003.03.16,
-%D title=\CONTEXT\ Anchoring Macros,
-%D subtitle=Margin Bars and alike,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Anchoring Macros / Margin Bars}
-
-\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
-
-\newcount\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
- \global\advance\currentsidebar\plusone
- \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:\the\currentsidebar}%
- {e:side:\the\currentsidebar}%
- {mpos:bar}%
- {self=side:\the\currentsidebar,
- linewidth=\getvalue{\??br#1\c!rulethickness},
- linecolor=\getvalue{\??br#1\c!rulecolor},
- distance=\the\sidebardistance}}%
- \stoppositionoverlay
- \bpos{side:\the\currentsidebar}\ignorespaces}
-
-% \def\dostopsidebar#1%
-% {\removelastspace\tpos{side:#1}\carryoverpar\egroup}
-
-\def\stopsidebar
- {\removelastspace\tpos{side:\the\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/mkii/anch-pgr.mkii b/Master/texmf-dist/tex/context/base/mkii/anch-pgr.mkii
deleted file mode 100644
index 4ceea844c1f..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/anch-pgr.mkii
+++ /dev/null
@@ -1,1684 +0,0 @@
-%D \module
-%D [ file=anch-pgr, % split off core-pos
-%D version=1999.08.01,
-%D title=\CONTEXT\ Anchoring Macros,
-%D subtitle=Positioning Graphics,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Anchoring Macros / 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
-
-\ifx\textheight\undefined \def\textheight{\vsize} \fi
-
-%D The next macros so some housekeeping.
-
-\def\pageanchor{page:0} % for the moment only one pagesize
-\def\textanchor{text:\realfolio}
-\def\headanchor{head:\realfolio} % virtual position
-\def\tailanchor{tail:\realfolio} % virtual position
-
-%D Anchors:
-
-\def\dopresetpositionanchors % also mkii
- {\bgroup
- \!!dimena\ifdim\topskip>\strutht\topskip\else\strutht\fi
- \!!dimenb\dimexpr\MPy\textanchor+\MPh\textanchor-\!!dimena\relax
- \!!dimenc\dimexpr\MPy\textanchor+\strutdp\relax
- \!!dimend\MPx\textanchor
- \!!dimene\MPw\textanchor
- \replacepospxywhd\headanchor\realfolio\!!dimend\!!dimenb\!!dimene\!!dimena\strutdp
- \replacepospxywhd\tailanchor\realfolio\!!dimend\!!dimenc\!!dimene\strutht \strutdp
- \egroup}
-
-\def\presetpositionanchors% compatibility hack (still needed?)
- {\ifpositioning
- \dopresetpositionanchors
- \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\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
-
-% todo: change with each page size change
-
-\def\registerpageposition#1% this one is flushed first !
- {\ifpositioning\ifcase\realpageno\or
- \ifdim\printpaperheight=\paperheight
- \ifdim\printpaperwidth=\paperwidth
- % not needed,
- \else
- \setbox#1\hbox{\hpos\pageanchor{\box#1}}%
- \fi
- \else
- \setbox#1\ruledhbox{\hpos\pageanchor{\box#1}}%
- \fi
- \fi\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 \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
- {\ifcsname\POSactionprefix#1++\endcsname % \ifundefined{\POSactionprefix#1++}\else
- \the\everycleanpositionaction
- \iflocalpositioning
- \letgvalue{\POSactionprefix#1++}\empty
- \else
- \setxvalue{\POSactionprefix#1++}{\getvalue{\POSactionprefix#1++}}%
- \fi
- \fi}
-
-% \def\cleanuppositionaction#1% not in trialtypesetting
-% {\ifcsname\POSactionprefix#1++\endcsname
-% \the\everycleanpositionaction
-% \iflocalpositioning
-% \global\expandafter\let\csname\POSactionprefix#1++\endcsname\empty
-% \else
-% \global\expandafter\let\csname\POSactionprefix#1++\expandafter\endcsname\csname\POSactionprefix#1++\endcsname
-% \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 % can be sped up
- \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}}}
-
-\let\stopMPpositiongraphic\relax
-
-% \def\prepareMPpositionvariables
-% {\ifundefined{\@@meta self}\setvalue{\@@meta self}{\currentposition}\fi
-% \ifundefined{\@@meta from}\setvalue{\@@meta from}{\currentposition}\fi}
-
-\def\prepareMPpositionvariables
- {\ifcsname\@@meta self\endcsname\else\setvalue{\@@meta self}{\currentposition}\fi
- \ifcsname\@@meta from\endcsname\else\setvalue{\@@meta from}{\currentposition}\fi}
-
-\newif\ifcollectMPpositiongraphics \collectMPpositiongraphicstrue
-
-\long\def\useMPpositiongraphic#1#2#3%
- {\bgroup
- \prepareMPvariables{#2}%
- \prepareMPpositionvariables
- \enableincludeMPgraphics
- \ifcollectMPpositiongraphics % no longer needed in mkiv
- \expanded{\startMPdrawing#3\noexpand\stopMPdrawing}%
- \global\MPdrawingdonetrue
- \else\ifx\startMPgraphic\undefined
- \startMPcode#3\stopMPcode
- \else
- \startMPgraphic#3\stopMPgraphic
- \loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{}%
- \deallocateMPslot\currentMPgraphic
- \placeMPgraphic
- \fi\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
-
-\let\stopMPpositionmethod\relax
-
-%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 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,
- dashtype=0, % 1 = dashed, 2 = dashed with background
- %snaptops=true, % not that nice: true/false
- gridcolor=red,
- linecolor=blue,
- fillcolor=lightgray,
- filloffset=\!!zeropoint,
- linewidth=\linewidth,
- gridwidth=\linewidth,
- gridshift=\!!zeropoint,
- lineradius=.5\bodyfontsize,
- dashtype=1]
-
-\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} ;
- boxdashtype := \MPvar{dashtype} ;
- boxgridcolor := \MPvar{gridcolor} ;
- boxlinecolor := \MPvar{linecolor} ;
- boxfillcolor := \MPvar{fillcolor} ;
- boxfilloffset := \MPvar{filloffset} ;
- boxlinewidth := \MPvar{linewidth} ;
- boxgridwidth := \MPvar{gridwidth} ;
- boxgridshift := \MPvar{gridshift} ;
- boxlineradius := \MPvar{lineradius} ;
- %snap_multi_par_tops := \MPvar{snaptops} ;
-\stopuseMPgraphic
-
-\startuseMPgraphic{mpos:par:extra}
- % user stuff, like:
- % snap_multi_par_tops := false ;
-\stopuseMPgraphic
-
-\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,gridshift,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,gridshift,lineradius}
- initialize_par(\MPpos\MPbself,
- \MPpos\MPeself,
- \MPpos\textanchor,
- \MPpos\MPparanchor,
- \MPvv \MPparanchor{0pt,0pt,0pt,0pt,0,0pt}) ;
- \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
-
-\startuseMPgraphic{mpos:par:sideline}{linecolor,lineoffset}
- for i=1 upto nofmultipars :
- fill leftboundary multipars[i]
- shifted (-\MPvar{lineoffset},0)
- rightenlarged 1mm withcolor \MPvar{linecolor} ;
- endfor ;
-\stopuseMPgraphic
-
-\startMPpositionmethod{mpos:par:columnset}
- \edef\MPparcounter{\MPv\MPbself{1}{0}}%
- \startMPpositiongraphic{mpos:par}{fillcolor,filloffset,linecolor,gridcolor,linewidth,gridwidth,gridshift,lineradius}
- \includeMPgraphic{mpos:par:setup} ;
- \includeMPgraphic{mpos:par:extra} ;
- prepare_multi_pars(\MPpos\MPbself,\MPpos\MPeself,\MPpos\MPwself,
- \MPpos\MPparanchor,\MPvv\MPparanchor{0pt,0pt,0pt,0pt,0,0pt}) ;
- 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 method=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.
-
-\newcount\textbackgrounddepth
-
-\appendtoks
- \expanded{\savecurrentvalue\noexpand\totalnofparbackgrounds{\number\nofparbackgrounds}}%
-\to \everybye
-
-\appendtoks
- \initializeparbackgrounds
-\to \everystarttext
-
-\ifx\totalnofparbackgrounds\undefined \newcounter\totalnofparbackgrounds \fi
-\ifx\nofparbackgrounds \undefined \newcount \nofparbackgrounds \fi
-
-\def\initializeparbackgrounds
- {\ifcase\totalnofparbackgrounds\else
- \enableparpositions
- \fi}
-
-\unexpanded\def\starttextbackground
- {\bgroup
- \advance\textbackgrounddepth\plusone
- \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\textbackgroundparameter#1%
- {\csname\??td\currenttextbackground#1\endcsname}
-
-\let\backgroundvariable\textbackgroundparameter % will become obsolete
-
-% \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}%
- \global\advance\nofparbackgrounds\plusone
- \edef\currentparbackground{pbg:\number\nofparbackgrounds}%
-% \bgroup
-% \advance\nofparbackgrounds\plusone
-% \xdef\nextparbackground{pbg:\number\nofparbackgrounds}%
-% \egroup
- \xdef\nextparbackground{pbg:\number\numexpr\nofparbackgrounds+\plusone\relax}% still xdef ?
- % todo : \synchonizepositionpage{b:\currentparbackground}{s:\currentparbackground}%
- \setuptextbackground[#1][#2]%
- \let\dodostarttextbackground\relax
- \let\dodostoptextbackground \relax
- \doif{\textbackgroundparameter\c!state}\v!start{\dopresettextbackground{#1}}%
- \dodostarttextbackground}
-
-% todo \backgroundvariable\c!variant
-
-\def\dopresettextbackground#1% todo: \backgroundparameter
- {\ExpandFirstAfter\processaction % \EFA niet echt nodig
- [\textbackgroundparameter\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
- \doifelse{\textbackgroundparameter\c!frame}\v!on
- {\doifelse{\textbackgroundparameter\c!corner}\v!round
- {\setvalue{\??td#1\c!frame}{2}}
- {\setvalue{\??td#1\c!frame}{1}}}
- {\setvalue{\??td#1\c!frame}{0}}%
- \doifelse{\textbackgroundparameter\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{\textbackgroundparameter\c!level}}%
- \expanded
- {\setMPpositiongraphicrange % moet veel efficienter
- {\btbanchor}% {b:\currentparbackground}%
- {\etbanchor}% {e:\currentparbackground}%
- {\textbackgroundparameter\c!method}%
- {self=\currentparbackground,
- mp=\textbackgroundparameter\c!mp,
- gridtype=\textbackgroundparameter\c!alternative,
- filltype=\textbackgroundparameter\c!background,
- linetype=\textbackgroundparameter\c!frame,
- dashtype=\textbackgroundparameter{dash}, % to be internationalized
- gridcolor=\textbackgroundparameter\c!framecolor,
- linecolor=\textbackgroundparameter\c!framecolor,
- lineoffset=\textbackgroundparameter\c!frameoffset,
- fillcolor=\textbackgroundparameter\c!backgroundcolor,
- filloffset=\textbackgroundparameter\c!backgroundoffset,
- gridwidth=\textbackgroundparameter\c!rulethickness,
- gridshift=\textbackgroundparameter\c!voffset,
- linewidth=\textbackgroundparameter\c!rulethickness,
- lineradius=\textbackgroundparameter\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 \dontleavehmode \fi % was leavevmode, brrr
- \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}}
-
-\newskip\textbackgroundskip
-
-\def\dostarttextbackgroundpar
- {\endgraf % new
- \textbackgroundparameter\c!before
- \noindent
- \ifgridsnapping
- \doassignsomeskip\textbackgroundparameter\c!topoffset\to\textbackgroundskip
- \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
- \ifgridsnapping \else
- \doassignsomeskip\textbackgroundparameter\c!topoffset\to\textbackgroundskip
- \ifdim\textbackgroundskip>\zeropoint
- \kern\textbackgroundskip\nobreak
- \fi
- \fi
- \dosetleftskipadaption{\textbackgroundparameter\c!leftoffset}%
- \advance\leftskip\leftskipadaption
- \dosetleftskipadaption{\textbackgroundparameter\c!rightoffset}%
- \advance\rightskip\leftskipadaption
- % new
- \dosetraggedcommand{\textbackgroundparameter\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\textbackgroundparameter\c!bottomoffset\to\textbackgroundskip
- \ifdim\lastskip>\zeropoint
- \advance\textbackgroundskip-\lastskip
- \fi
- \ifgridsnapping \else \ifdim\textbackgroundskip>\zeropoint
- \kern\textbackgroundskip\nobreak
- \fi \fi
- \nobreak \vskip-\lineheight \nobreak
- \nowhitespace
- \egroup
-\bgroup \forgeteverypar % NOT REALLY NEEDED, SAVES HASH/MEM
- \nobreak \noindent \strut \hfill \kern\zeropoint
- \doassignsomeskip\textbackgroundparameter\c!bottomoffset\to\textbackgroundskip
- \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
- \textbackgroundparameter\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% todo: dimexpr
- {\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 % - and then + ?
- \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,dash, % dash not yet internationalized
- \c!radius,\c!frame,\c!framecolor,\c!rulethickness,\c!voffset,\c!frameoffset,
- \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=\textbackgroundparameter\c!leftoffset,
- \c!topoffset=\!!zeropoint, % \v!medium,
- \c!bottomoffset=\textbackgroundparameter\c!topoffset,
- \c!level=-1,
- \c!alternative=0,
- \c!align=,
- dash=0, % to be internationalized
- \c!background=\v!color,
- \c!backgroundcolor=lightgray,
- \c!backgroundoffset=\!!zeropoint,
- \c!corner=\v!rectangular,
- \c!radius=.5\bodyfontsize,
- \c!voffset=\!!zeropoint,
- \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}
-
-\newcount\currentautopos
-\newcount\previousautopos
-
-\def\POSstackprefix{stack:}
-
-\def\dostackposbox#1#2%
- {\dowithnextbox
- {#2{\previousautopos\currentautopos
- \global\advance\currentautopos\plusone
- \edef\currentposition {\POSstackprefix\number\currentautopos}%
- \edef\previousposition{\POSstackprefix\number\previousautopos}%
- \hpos\currentposition{\doifoverlappingelse\currentposition\previousposition{#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.
-
-% 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 % use \scratchdimenone instead of skip
-
-\def\stackeddown
- {\bgroup
- % this macro assumes a few things and is meant to work for margin notes
- \dowithnextbox
- {\global\advance\currentautopos\plusone
- \global\laststackvmove\zeropoint
- \hpos{\POSstackprefix\number\currentautopos}
- {\edef\next
- {\nextboxht\the\nextboxht
- \nextboxdp\the\nextboxdp
- \nextboxwd\the\nextboxwd}%
- \previousautopos\currentautopos
- \scratchdimen\zeropoint
- \scratchcounter\zerocount
- \doloop
- {\advance\previousautopos\minusone
- \edef\currentposition {\POSstackprefix\number\currentautopos}%
- \edef\previousposition{\POSstackprefix\number\previousautopos}%
- \ifnum\MPp\currentposition=\MPp\previousposition\relax
- %\registerstatus{doing \number\currentautopos/\number\previousautopos}%
- \doifoverlappingelse\currentposition\previousposition
- {\scratchskip\dimexpr
- \MPy\currentposition
- -\MPy\previousposition
- -\MPd\currentposition % untested
- +\MPd\previousposition % untested
- +\MPh\currentposition
- \relax\relax % second relax realy needed, forgotten while dimexpressing
- % todo: also take depth into account
- \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\number\currentautopos}%
- \scratchskip\scratchdimen
- \advance\scratchskip\MPh\currentposition
- \scratchdimen-\scratchdimen
- \advance\scratchdimen\MPy\currentposition
- %\registerstatus{old \number\currentautopos: \MPy\currentposition/\MPh\currentposition}%
- \expanded{\replacepospxywhd
- {\currentposition}{\MPp\currentposition}{\MPx\currentposition}{\the\scratchdimen}%
- {\MPw\currentposition}{\the\scratchskip}{\MPd\currentposition}}%
- %\registerstatus{new \number\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
-
-\newcount\currentmarginpos
-
-\def\dopositionmarginbox#1%
- {\bgroup
- \ifrepositionmarginbox
- \global\advance\currentmarginpos\plusone
- %\setposition{\s!margin:\number\currentmarginpos}% not always
- \ifcase\marginrepositionmethod
- % nothing
- \or
- % nothing
- \or
- % stack / page check yet untested
- \setposition{\s!margin:\number\currentmarginpos}%
- \scratchdimen\MPy{\s!margin:\number\currentmarginpos}%
- \global\advance\currentmarginpos\plusone
- \advance\scratchdimen -\MPy{\s!margin:\number\currentmarginpos}%
- \advance\scratchdimen -\strutdp
- % new but bugged
- % \setbox#1\hbox
- % {\hskip-\MPx{\s!margin:\number\currentmarginpos}%
- % \hskip\MPx{head:\realfolio}%
- % \box#1}%
- % so far
- \setbox#1\hbox
- {\setposition{\s!margin:\number\currentmarginpos}%
- \raise\scratchdimen\box#1}%
- \or
- % move up
- \setposition{\s!margin:\number\currentmarginpos}%
- \ifnum\MPp{p:\number\parposcounter}=\MPp{\s!margin:\number\currentmarginpos}\relax
- \scratchdimen\dimexpr\MPy{p:\number\parposcounter}-\MPy{\s!margin:\number\currentmarginpos}\relax
- \expanded{\setbox#1\hbox{\raise\scratchdimen\box#1}\ht#1\the\ht#1\dp#1\the\dp#1}%
- \fi
- \or
- % move up, assume end of par
- \setposition{\s!margin:\number\currentmarginpos}%
- \ifnum\MPp{p:\number\parposcounter}=\MPp{\s!margin:\number\currentmarginpos}\relax
- \getnoflines\margincontentheight
- \advance\noflines\minusone
- \scratchdimen\noflines\lineheight
- \else
- \scratchdimen\dimexpr\MPy{p:\number\parposcounter}-\MPy{\s!margin:\number\currentmarginpos}\relax
- \fi
- \expanded{\setbox#1\hbox{\raise\scratchdimen\box#1}\ht#1\the\ht#1\dp#1\the\dp#1}%
- \fi
- \dp#1\zeropoint
- \ht#1\zeropoint
- \fi
- \graphicvadjust{\box#1}%
- \egroup}
-
-\chardef\marginrepositionmethod\plusone % sidemethod
-\chardef\margincontentmethod \plusthree % textmethod % beware: 1 = old method
-\chardef\marginpagecheckmethod \plusone % splitmethod
-
-%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,\MPpos{#1:\currentamposition}) ;
- \to \MPmenutoks}%
- \hpos{#1:\currentamposition}{#3}}
- {#3}}
-
-\def\do@@ammenuposition#1%
- {\ifnum\currentamposition>0
- \dowithnextbox{\hpos{menu:#1:\realfolio}{\flushnextbox}}\hbox
- % \hpos{menu:#1:\realfolio} % also ok if we skip over fi
- \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.
-
-\newcount\noftabpositions
-\newtoks \posXCtoks
-
-\def\tbPOSprefix
- {tbp:\number\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\docommand##1{\dododoGSC[##1:##1]}%
- \processcommalist[#1]\docommand}
-
-\def\dodododoGFC[#1:#2:#3]%
- {\remappositionframed{#2}{\tbPOSprefix#1}%
- \bpos{\tbPOSprefix#1}}
-
-\def\dododoGFC[#1]%
- {\def\docommand##1{\dodododoGFC[##1:##1]}%
- \processcommalist[#1]\docommand}
-
-\def\dodoGFC[#1]%
- {\doglobal\appendtoks\dododoGFC[#1]\to\posXCtoks\NC}
-
-\def\dododododoGTC[#1:#2]%
- {\epos{\tbPOSprefix#1}}
-
-\def\dodododoGTC[#1]%
- {\def\docommand##1{\dododododoGTC[##1:##1]}%
- \processcommalist[#1]\docommand}
-
-\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
- \global\advance\noftabpositions\plusone
-\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
- \global\advance\noftabpositions\plusone
-\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]
-
-\definetextbackground
- [sideline]
- [mp=mpos:par:sideline,
- location=paragraph,
- framecolor=red,
- frameoffset=5mm]
-
-\definestartstop [sideline]
- [before={\starttextbackground[sideline]},
- after=\stoptextbackground]
-
-\starttext
- \startunderline \input tufte \stopunderline \blank
- \startoverstrike \input tufte \stopoverstrike \blank
- \startexlines \input tufte \stopexlines \blank
- \startstrikethrough \input tufte \stopstrikethrough \blank
- \startsideline \input tufte \stopsideline \blank
-\stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkii/anch-pos.mkii b/Master/texmf-dist/tex/context/base/mkii/anch-pos.mkii
deleted file mode 100644
index b86cee5cc03..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/anch-pos.mkii
+++ /dev/null
@@ -1,883 +0,0 @@
-%D \module
-%D [ file=anch-pos,
-%D version=1999.08.01,
-%D title=\CONTEXT\ Anchoring Macros,
-%D subtitle=Positioning Support,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% 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
-
-% dubbele text- * pos's eruit
-
-% class pos -> als gelijk aan vorige, dan niet niet definieren
-% en erven, maw:
-%
-% 1 -> opslaan
-% 2 -> undef, dus == prev
-% 3 -> undef, dus == prev
-% 4 -> opslaan
-
-\writestatus{loading}{ConTeXt Anchoring Macros / Positioning}
-
-% todo: topskip als optie voor eerste regel achtergrond
-% todo: build pos layers on top of layers
-% todo: positionlayer pos van text-1 etc delen
-
-%D Although \TEX\ has a rather powerful channel to the outside
-%D world, called \type {\special}, real communication with
-%D other programs is complicated by the fact that no positional
-%D information is available. Mid 1999, I discussed this with
-%D \THANH, the author of \PDFTEX, and after some experiments,
-%D \PDFTEX\ was extended with a simple but effective mechanism,
-%D that provided positional information. The interesting
-%D thought is that, although \TEX\ is frozen, similar
-%D functionality could have been achieved with \type
-%D {\specials} and an additional \DVI\ postprocessor.
-%D
-%D Since we want to be as compatible as can be, \CONTEXT\ will
-%D support both methods, although the development is primarily
-%D driven by the \PDFTEX\ way of doing things. Since the
-%D mechanism is basically not limited to one application, for
-%D the moment we stick to building the functionality around one
-%D \CONTEXT\ special command, but at the same time we keep our
-%D eyes open for extensions in other directions.
-%D
-%D A question that may arise when one reads this module, is to
-%D what extend these macros are generic, in the sense that they
-%D could be collected in a support module instead of a core
-%D module. Since the mechanism described here will closely
-%D cooperate with the \METAPOST\ support built in \CONTEXT,
-%D which in turn will be tightly integrated with the \CONTEXT\
-%D overlay mechanisms, I decided to write a core module instead
-%D of a support one. This makes even more sense, when one takes
-%D into account that this kind of support depends on special
-%D drivers.
-
-\unprotect
-
-%D The first application of positional information was embedded
-%D graphics. Since we are interacting with text, it made sense
-%D to take the current line height and depth into account too.
-%D This is why we have two basic position macros: one for
-%D simple positions, and one for boxes.
-%D
-%D We could have sticked to one special, and actually did so in
-%D earlier experiments, but for convenience, as well for
-%D clearness, we now have two alternatives. This approach will
-%D save us quite some bytes when storing large quantities of
-%D positional information. We save as less information as
-%D needed, that is, we save no dimensions, in a \METAPOST\
-%D friendly way.
-%D
-%D The three specials involved are:
-%D
-%D \starttyping
-%D \dosetposition {identifier}
-%D \dosetpositionwhd {identifier} {width} {height} {depth}
-%D \dosetpositionplus {identifier} {width} {height} {depth} {list}
-%D \dosetpositionpapersize {width} {height}
-%D \stoptyping
-
-\newbox\positionbox
-\newif \ifpositioning
-
-\def\POSprefix{POS::}
-
-\def\setpospxy#1#2#3#4%
- {\@EA\xdef\csname\POSprefix#1\endcsname
- {\number#2,%
- \the\dimexpr#3\ifnum\positionanchormode=\plusone-\MPx\pageanchor\fi\relax,%
- \the\dimexpr#4\ifnum\positionanchormode=\plusone-\MPy\pageanchor\fi\relax}}
-
-\def\setpospxywhd#1#2#3#4#5#6#7%
- {\@EA\xdef\csname\POSprefix#1\endcsname
- {\number#2,%
- \the\dimexpr#3\ifnum\positionanchormode=\plusone-\MPx\pageanchor\fi\relax,%
- \the\dimexpr#4\ifnum\positionanchormode=\plusone-\MPy\pageanchor\fi\relax,%
- \the\dimexpr#5\relax,%
- \the\dimexpr#6\relax,%
- \the\dimexpr#7\relax}}
-
-\def\setpospxyplus#1#2#3#4#5#6#7#8%
- {\@EA\xdef\csname\POSprefix#1\endcsname
- {\number#2,%
- \the\dimexpr#3\ifnum\positionanchormode=\plusone-\MPx\pageanchor\fi\relax,%
- \the\dimexpr#4\ifnum\positionanchormode=\plusone-\MPy\pageanchor\fi\relax,%
- \the\dimexpr#5\relax,%
- \the\dimexpr#6\relax,%
- \the\dimexpr#7\relax,%
- #8}}
-
-%D This is real tricky! The page anchor is applied to the
-%D page box and therefore flushed first. So, when present, it
-%D is applied to all positions except itself.
-
-\chardef\positionanchormode=0 % don't relocate page origin
-\chardef\positionanchormode=1 % relocate page origin once
-
-%D The core set macros.
-
-\def\pxypos {\pospxy} % obsolete
-\def\pxyposwhd {\pospxywhd} % obsolete
-\def\pxyposplus{\pospxyplus} % obsolete
-
-\def\resetpositions
- {\let\pospxy \gobblefourarguments
- \let\pospxywhd \gobblesevenarguments
- \let\pospxyplus\gobbleeightarguments}
-
-\def\setpositions
- {\let\pospxy \setpospxy
- \let\pospxywhd \setpospxywhd
- \let\pospxyplus\setpospxyplus}
-
-%D We need to initialize.
-
-\resetpositions
-
-\addutilityreset{positions}
-
-%D Sometimes we want to trick the position handler a bit:
-
-\def\replacepospxywhd#1#2#3#4#5#6#7%
- {\@EA\xdef\csname\POSprefix#1\endcsname
- {\number#2,%
- \the\dimexpr#3\relax,%
- \the\dimexpr#4\relax,%
- \the\dimexpr#5\relax,%
- \the\dimexpr#6\relax,%
- \the\dimexpr#7\relax}}
-
-%D For postprocessing purposes, we save the number of
-%D positions.
-
-\newcount\currentpositions % current number of positions
-\newcounter\totalnofpositions % total from previous run
-
-\appendtoks
- \expanded{\savecurrentvalue\noexpand\totalnofpositions{\the\currentpositions}}%
-\to \everybye
-
-%D The next switch can be used to communicate a special
-%D situation. Positioning and associated actions can be
-%D executed any time. However, in for instance backgrounds
-%D they can be collected in a layer, for instance the text
-%D layer (especially the hidden text layer). In the case of
-%D floats, we run into problems, since the page information is
-%D not applicable when the content floats indeed. In such
-%D situations one can treat positions and graphics local.
-
-\newif\iflocalpositioning
-
-%D Watch out: sometimes a pagebreak occurs inside a float
-%D placement, so there we need to disable local mode.
-
-\appendtoks
- \localpositioningtrue
-\to \everyinsidefloat
-
-\appendtoks
- \localpositioningfalse
-\to \everypagebody
-
-\def\checkpositions
- {\startnointerference
- \protectlabels
- \doutilities{positions}\jobname\empty\relax\relax
- \global\let\checkpositions\relax
- \stopnointerference}
-
-%D Since the positional values are to be fully expandable, we
-%D need to preload them as soon as possible, which is why we
-%D load the data when we start a text.
-
-\appendtoks \checkpositions \to \everystarttext
-
-%D Positions are either generated at a delayed write time
-%D (in \PDFTEX), or derived from the dvi file. The actual
-%D method is implemented in a special driver. If needed, the
-%D driver can fall back on the following macros.
-
-\def\dolazysaveposition#1#2#3#4% tag page x y
- {\expanded{\writeutilitycommand{\noexpand\pospxy
- {#1}{#2}{#3}{#4}}}}
-
-\def\dolazysavepositionwhd#1#2#3#4#5#6#7% tag page x y w h d
- {\expanded{\writeutilitycommand{\noexpand\pospxywhd
- {#1}{#2}{#3}{#4}{#5}{#6}{#7}}}}
-
-\def\dolazysavepositionplus#1#2#3#4#5#6#7#8% tag page x y w h d list
- {\expanded{\writeutilitycommand{\noexpand\pospxyplus
- {#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}}}
-
-\def\dosaveposition#1#2#3#4% tag page x y
- {\expanded{\immediatewriteutilitycommand{\noexpand\pospxy
- {#1}{#2}{#3}{#4}}}}
-
-\def\dosavepositionwhd#1#2#3#4#5#6#7% tag page x y w h d
- {\expanded{\immediatewriteutilitycommand{\noexpand\pospxywhd
- {#1}{#2}{#3}{#4}{#5}{#6}{#7}}}}
-
-\def\dosavepositionplus#1#2#3#4#5#6#7#8% tag page x y w h d list
- {\expanded{\immediatewriteutilitycommand{\noexpand\pospxyplus
- {#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}}}
-
-%D \macros
-%D {MPp, MPx, MPy, MPw, MPh, MPd,
-%D MPxy, MPll, MPlr, MPur, MPul, MPpos}
-%D
-%D Access to the positional information is provided by macros
-%D with short names that are clearly meant for \METAPOST.
-
-\def\MPp {\doMPxyhdwlr\doMPp }
-\def\MPx {\doMPxyhdwlr\doMPx }
-\def\MPy {\doMPxyhdwlr\doMPy }
-\def\MPw {\doMPxyhdwlr\doMPw }
-\def\MPh {\doMPxyhdwlr\doMPh }
-\def\MPd {\doMPxyhdwlr\doMPd }
-\def\MPxy {\doMPxyhdwlr\doMPxy }
-\def\MPll {\doMPxyhdwlr\doMPll }
-\def\MPlr {\doMPxyhdwlr\doMPlr }
-\def\MPur {\doMPxyhdwlr\doMPur }
-\def\MPul {\doMPxyhdwlr\doMPul }
-\def\MPpos{\doMPxyhdwlr\doMPpos}
-
-\def\doMPp #1,#2,#3,#4,#5,#6,#7\relax{#1}
-\def\doMPx #1,#2,#3,#4,#5,#6,#7\relax{#2}
-\def\doMPy #1,#2,#3,#4,#5,#6,#7\relax{#3}
-\def\doMPw #1,#2,#3,#4,#5,#6,#7\relax{#4}
-\def\doMPh #1,#2,#3,#4,#5,#6,#7\relax{#5}
-\def\doMPd #1,#2,#3,#4,#5,#6,#7\relax{#6}
-\def\doMPxy #1,#2,#3,#4,#5,#6,#7\relax{(#2,#3)}
-\def\doMPll #1,#2,#3,#4,#5,#6,#7\relax{(#2,#3-#6)}
-\def\doMPlr #1,#2,#3,#4,#5,#6,#7\relax{(#2+#4,#3-#6)}
-\def\doMPur #1,#2,#3,#4,#5,#6,#7\relax{(#2+#4,#3+#5)}
-\def\doMPul #1,#2,#3,#4,#5,#6,#7\relax{(#2,#3+#5)}
-\def\doMPpos#1,#2,#3,#4,#5,#6,#7\relax{#1,#2,#3,#4,#5,#6}
-
-\def\doMPxyhdwlr#1#2%
- {\ifcsname\POSprefix#2\endcsname
- \@EA\@EA\@EA#1\csname\POSprefix#2\endcsname,0pt,0pt,0pt,0pt\relax
- \else
- #10,0pt,0pt,0pt,0pt,0pt,0pt\relax
- \fi}
-
-%D \macros
-%D {MPplus, MPrest, MPv, MPvv}
-%D
-%D Since we will probably keep on extending, we provide a
-%D general extension macro. The plus alternative takes an
-%D extra argument, denoting what additional parameter to pick
-%D up. So, the third extra is fetched with,
-%D
-%D \starttyping
-%D \MPplus{identifier}{3}{default}
-%D \stoptyping
-%D
-%D All extras (comma separated) are fetched with:
-%D
-%D \starttyping
-%D \MPrest{identifier}
-%D \stoptyping
-%D
-%D The extra parameters are not treated.
-
-\def\MPplus {\MPdoplus\doMPplus}
-\def\MPrest#1{\MPdoplus\doMPrest{#1}{}}
-
-\def\MPdoplus#1#2#3#4%
- {\ifcsname\POSprefix#2\endcsname
- \@EA\@EA\@EA#1\csname\POSprefix#2\endcsname,,,,,,,,,\relax{#3}%
- \else
- #4%
- \fi}
-
-\def\doMPplus#1,#2,#3,#4,#5,#6,%
- {\dodoMPplus}
-
-\def\dodoMPplus#1,#2,#3,#4,#5,#6,#7,#8\relax#9%
- {\ifcase#9\or#1\or#2\or#3\or#4\or#5\or#6\or#7\else\dododoMPplus#8\relax{#9}\fi}
-
-\def\dododoMPplus#1,#2,#3,#4,#5,#6,#7,#8\relax#9%
- {\ifcase#9\or\or\or\or\or\or\or\or#1\or#2\or#3\or#4\or#5\or#6\or#7\fi}
-
-\def\doMPrest#1,#2,#3,#4,#5,#6,#7,,#8\relax#9%
- {#7}
-
-%D \macros
-%D {MPanchor}
-%D
-%D For readability we define a few synonyms:
-
-\def\MPanchor{\MPpos}
-
-%D \macros
-%D {POSp, POSx, POSy, POSh, POSd, POSw}
-%D
-%D and:
-
-\def\POSp{\MPp} \def\POSx{\MPx} \def\POSy{\MPy}
-\def\POSh{\MPh} \def\POSd{\MPd} \def\POSw{\MPw}
-
-%D There are two low level positioning macros. Both store the
-%D position as well as execute an action associated with that
-%D position.
-
-\def\initializenextposition
- {\ifpositioning \else
- \global\positioningtrue
- \dosetpositionpapersize
- {\printpaperwidth }%
- {\printpaperheight}%
- \fi
- \global\advance\currentpositions\plusone}
-
-\def\setpositiononly#1%
- {\iftrialtypesetting
- % nothing
- \else
- \initializenextposition
- \def\currentposition{#1}%
- \dosetposition\currentposition
- \fi}
-
-\def\setposition#1%
- {\iftrialtypesetting
- % nothing
- \else
- \initializenextposition
- \def\currentposition{#1}%
- \dosetposition\currentposition
- \traceposstring\llap\green{\currentposition>}%
- \dopositionaction\currentposition
- \fi}
-
-\def\setpositiondata#1#2#3#4%
- {\iftrialtypesetting \else
- \initializenextposition
- \hbox
- {\def\currentposition{#1}%
- \dosetpositionwhd\currentposition
- {\the\dimexpr#2\relax}%
- {\the\dimexpr#3\relax}%
- {\the\dimexpr#4\relax}%
- \traceposstring\llap\green{\currentposition>}%
- \dopositionaction\currentposition
- \hss}%
- \fi}
-
-\def\setpositionbox#1%
- {\dowithnextbox
- {\iftrialtypesetting
- \flushnextbox
- \else
- \initializenextposition
- \hbox to \nextboxwd
- {\edef\currentposition{#1}%
- \dosetpositionwhd\currentposition
- {\the\nextboxwd}%
- {\the\nextboxht}%
- {\the\nextboxdp}%
- \traceposstring\llap\green{\currentposition>}%
- \setbox\positionbox\flushnextbox
- \dopositionaction\currentposition
- \box\positionbox
- \hss}%
- \fi}}
-
-\def\setpositiondataplus#1#2#3#4#5%
- {\iftrialtypesetting \else
- \initializenextposition
- \hbox % bug: to \nextboxwd
- {\edef\currentposition{#1}%
- \dosetpositionplus\currentposition
- {\the\dimexpr#2\relax}%
- {\the\dimexpr#3\relax}%
- {\the\dimexpr#4\relax}%
- {#5}%
- \traceposstring\rlap\magenta{<\currentposition}%
- \dopositionaction\currentposition
- \hss}%
- \fi}
-
-\def\setpositionplus#1#2%
- {\dowithnextbox
- {\iftrialtypesetting
- \flushnextbox
- \else
- \initializenextposition
- \hbox to \nextboxwd
- {\edef\currentposition{#1}%
- \dosetpositionplus\currentposition
- {\the\nextboxwd}%
- {\the\nextboxht}%
- {\the\nextboxdp}%
- {#2}%
- \traceposstring\rlap\magenta{<\currentposition}%
- \setbox\positionbox\flushnextbox
- \dopositionaction\currentposition
- \box\positionbox
- \hss}%
- \fi}}
-
-\let\currentposition\s!unknown
-
-%D A few more low level macros take care of defining and
-%D recalling actions. We could save this information in the
-%D position containers themselves, this would save hash
-%D entries, but at the cost of much more time consuming
-%D expansion. Actions are saved globally!
-
-\newtoks\everypositionaction
-
-\let\POSactionprefix\POSprefix
-
-\def\dosetpositionaction#1%
- {\setgvalue{\POSactionprefix#1::}}
-
-%D The lists can become quite long (also because there can
-%D be lots of parameters passed on) so we provide a hook
-%D to clean up the list afterwards.
-
-\let\cleanuppositionaction\gobbleoneargument
-
-\def\doifpositionaction#1%
- {\ifcsname\POSactionprefix#1::\endcsname
- \@EA\firstofoneargument
- \else
- \@EA\gobbleoneargument
- \fi}
-
-\def\doifpositionactionelse#1%
- {\ifcsname\POSactionprefix#1::\endcsname
- \@EA\firstoftwoarguments
- \else
- \@EA\secondoftwoarguments
- \fi}
-
-%D We can copy a position with:
-%D
-%D \starttyping
-%D \copyposition {to} {from}
-%D \stoptyping
-%D
-%D Again, this is a global action.
-
-\def\copyposition#1#2%
- {\ifcsname\POSprefix#2\endcsname
- \global\@EA\let\csname\POSprefix#1\@EA\endcsname\csname\POSprefix#2\endcsname
- \fi}
-
-%D The fact that handling positions is a two pass operation, is
-%D one of the reasons why we need to be able to test for
-%D existence, using:
-%D
-%D \starttyping
-%D \doifpositionelse {identifier} {found action} {not found action}
-%D \stoptyping
-
-\def\doifpositionelse#1%
- {\ifcsname\POSprefix#1\endcsname
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-%D We have now arrived at a few macros that would make sense as
-%D support macros, but ended up in the core.
-
-%D \macros
-%D {xypos}
-%D
-%D We have several macros available to save positions. Later
-%D we will see applications.
-%D
-%D \starttabulate[|l|l||]
-%D \NC \type {\xypos} \NC \NC simple position with no dimensions \NC \NR
-%D \NC \type {\hpos} \NC \NC position and characteristics of a \type {\hbox} \NC \NR
-%D \NC \type {\vpos} \NC \NC position and characteristics of a \type {\vbox} \NC \NR
-%D \NC \type {\bpos} \NC b: \NC begin point in a line \NC \NR
-%D \NC \type {\epos} \NC e: \NC end point in a line \NC \NR
-%D \NC \type {\fpos} \NC f: \NC begin point in a paragraph \NC \NR
-%D \NC \type {\tpos} \NC t: \NC end point in a paragraph \NC \NR
-%D \stoptabulate
-%D
-%D Each macro takes an identifier as argument, and the \type
-%D {\hpos} and \type {\vpos} also expect box content.
-
-% \def\xypos{\initializenextposition\dosetposition}
-
-\let\xypos\setpositiononly
-
-\def\hpos#1{\dontleavehmode\setpositionbox{#1}\hbox}
-\def\vpos#1{\setpositionbox{#1}\vbox}
-
-\def\bpos#1{\hpos{b:#1}{\strut}\ignorespaces}
-\def\epos#1{\removelastspace\hpos{e:#1}{\strut}}
-
-\def\fpos#1%
- {\setpositionplus{b:#1}{\number\parposcounter}\horizontalstrut
- \ignorespaces}
-
-\def\tpos#1%
- {\removelastspace
- \setpositionplus{e:#1}{\number\parposcounter}\horizontalstrut}
-
-\def\ffpos#1%
- {\setpositionplus{b:#1}{\number\parposcounter}\horizontalstrut\wpos{#1}%
- \ignorespaces}
-
-\def\ttpos#1%
- {\removelastspace
- \setpositionplus{e:#1}{\number\parposcounter}\horizontalstrut}
-
-\def\wpos#1%
- {\dontleavehmode\vadjust % may disappear if buried
- {\setbox0\hbox{\raise\strutdp\hbox{\rawwpos{#1}}}%
- \rlap{\smashedbox0}}}
-
-\def\wwpos#1% \hsmashed{\llap{\rawwpos{#1}}}
- {\rlap
- {\setbox0\hbox{\rawwpos{#1}}%
- \smashedbox0}}
-
-\def\rawwpos#1%
- {\hpos{w:#1}
- {\strut
- \hskip-\leftskip
- \hskip\hsize
- \hskip-\rightskip}}
-
-% the next macro disables par positions (in inner boxes) and
-% only registers the width
-
-\def\setinnerparpositions
- {\let\fpos\ffpos
- \let\tpos\ttpos
- \let\wpos\wwpos}
-
-% example of usage: (see for application "techniek")
-%
-% \appendtoks
-% \setinnerparpositions
-% \to \everytabulate
-
-%D When we want to calculate more complex backgrounds, we
-%D need to know what the current indentation scheme is. At
-%D the cost of many positions and memory, we can keep track
-%D of them. This mechanism is activated automatically
-%D based on information collected in the previous pass.
-
-\newcount\parposcounter
-
-\newif\ifpositioningpar
-
-% we can check for used entries, and if not, then not add one
-
-\def\enableparpositions % global
- {\global\positioningtrue
- \global\positioningpartrue}
-
-\def\disableparpositions % local
- {\positioningparfalse}
-
-\def\registerparoptions
- {\ifpositioningpar \ifpositioning \iftrialtypesetting \else
- \ifinpagebody \else \ifmmode \else \ifinformula \else
- \ifprocessingverbatim
- \iflinepar \doregisterparoptions \fi
- \else
- \doregisterparoptions
- \fi
- \fi \fi \fi
- \fi \fi \fi}
-
-\chardef\parposstrut=1 % 0 => no strut data, so fall backs used
-
-\newif\iftracepositions
-
-% \def\doregisterparoptions
-% {\global\advance\parposcounter\plusone
-% \begingroup
-% \leftskip 1\leftskip
-% \rightskip1\rightskip
-% \setpositiondataplus
-% {p:\number\parposcounter}% identifier
-% {\the\zeropoint}%
-% {\the\strutht}%
-% {\the\strutdp}%
-% {\the\hsize ,% 1
-% \the\leftskip ,% 2
-% \the\rightskip ,% 3
-% \the\hangindent,% 4
-% \the\hangafter ,% 5 (num)
-% \the\parindent }% 6
-% %\normalhbox{\registerparsymbol}%
-% \registerparsymbol
-% \endgroup}
-
-\def\doregisterparoptions
- {\global\advance\parposcounter\plusone
- \setpositiondataplus
- {p:\number\parposcounter}% identifier
- {\the\zeropoint}%
- {\the\strutht}%
- {\the\strutdp}%
- {\the\hsize,\the\dimexpr\leftskip\relax,\the\dimexpr\rightskip\relax,\the\hangindent,\the\hangafter,\the\parindent}%
- %\normalhbox{\registerparsymbol}%
- \iftracepositions\registerparsymbol\fi}
-
-\def\traceposstring#1#2#3%
- {\iftracepositions
- \smashedhbox
- {#1{\infofont#2#3}%
- \scratchdimen.5\points
- \kern-2\scratchdimen
- \vrule\!!width4\scratchdimen\!!height\scratchdimen\!!depth\scratchdimen}%
- \fi}
-
-\def\registerparsymbol
- {\iftracepositions
- \smashedhbox to \zeropoint
- {\hss
- \startcolor[blue]%
- \llap{\infofont\number\parposcounter}%
- \scratchdimen\onepoint
- \vrule
- \!!width 4\scratchdimen
- \!!height2\scratchdimen
- \!!depth 2\scratchdimen
- \stopcolor
- \hss}%
- \fi}
-
-% \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\doifelsenodelocation#1%
- {\ifcsname\@@noden#1\endcsname
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\def\nextnodelocation#1%
- {\ifcsname\@@noden#1\endcsname\pluscounter{\@@noden#1}\fi}
-
-\def\newnodelocation#1%
- {\ifcsname\@@noden#1\endcsname
- \setcounter{\@@noden#1}\zerocount
- \letgvalue {\@@nodeo#1}\!!zerocount
- \fi}
-
-\def\tagnodelocation#1%
- {\ifcsname\@@noden#1\endcsname\xypos{\@@nodep#1:\countervalue{\@@noden#1}}\fi}
-
-\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%
- {\ifcsname\@@noden#1\endcsname
- \doanalyzenodelocation{#1}{\getnodelocationn{#1}}\zerocount
- \fi}
-
-\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%
- {\ifcsname\@@noden#1\endcsname
- \analyzenodelocation{#1}%
- (#1,%
- n:\getnodelocationn{#1},%
- p:\getnodelocationp{#1},%
- x:\getnodelocationx{#1},%
- y:\getnodelocationy{#1},%
- o:\getnodelocationo{#1})%
- \fi}
-
-%D \macros
-%D {doifoverlappingelse}
-%D
-%D A first application of positional information, is to
-%D determine if two boxes do overlap:
-%D
-%D \starttyping
-%D \doifoverlappingelse{point a}{point b}
-%D {action when overlapping}
-%D {action when not overlapping}
-%D \stoptyping
-
-\def\overlappingmargin{-2\scaledpoint}
-
-\def\doifoverlappingelse#1#2%
- {\begingroup
- \donefalse
- \edef\!!stringa{#1}\edef\!!stringb{#2}%
- \ifnum\MPp\!!stringa=\MPp\!!stringb\relax
- \!!dimena\MPx\!!stringa
- \!!dimenb\dimexpr\MPx\!!stringa+\MPw\!!stringa\relax
- \!!dimenc\dimexpr\MPy\!!stringa-\MPd\!!stringa\relax
- \!!dimend\dimexpr\MPy\!!stringa+\MPh\!!stringa\relax
- \!!dimene\MPx\!!stringb
- \!!dimenf\dimexpr\MPx\!!stringb+\MPw\!!stringb\relax
- \!!dimeng\dimexpr\MPy\!!stringb-\MPd\!!stringb\relax
- \!!dimenh\dimexpr\MPy\!!stringb+\MPh\!!stringb\relax
- \ifdim\overlappingmargin=\zeropoint\else
- \advance\!!dimena-\overlappingmargin
- \advance\!!dimenb+\overlappingmargin
- \advance\!!dimenc-\overlappingmargin
- \advance\!!dimend+\overlappingmargin
- \advance\!!dimene-\overlappingmargin
- \advance\!!dimenf+\overlappingmargin
- \advance\!!dimeng-\overlappingmargin
- \advance\!!dimenh+\overlappingmargin
- \fi
- % more often eh fb eg fg
- \def\checkone##1##2%
- {\ifdim##1<\!!dimena \else \ifdim##1>\!!dimenb \else
- \ifdim##2<\!!dimenc \else \ifdim##2>\!!dimend \else
- \donetrue
- \fi\fi
- \fi\fi}%
- \def\checktwo##1##2%
- {\ifdim##1<\!!dimene \else \ifdim##1>\!!dimenf \else
- \ifdim##2<\!!dimeng \else \ifdim##2>\!!dimenh \else
- \donetrue
- \fi\fi
- \fi\fi}%
- \checkone\!!dimene\!!dimeng \ifdone \else
- \checkone\!!dimene\!!dimenh \ifdone \else
- \checkone\!!dimenf\!!dimeng \ifdone \else
- \checkone\!!dimenf\!!dimenh \ifdone \else
- \checktwo\!!dimena\!!dimenc \ifdone \else
- \checktwo\!!dimena\!!dimend \ifdone \else
- \checktwo\!!dimenb\!!dimene \ifdone \else
- \checktwo\!!dimenb\!!dimenc \fi \fi \fi \fi \fi \fi \fi
- \fi
- \ifdone
- \endgroup\expandafter\firstoftwoarguments
- \else
- \endgroup\expandafter\secondoftwoarguments
- \fi}
-
-%D \macros
-%D {doifpositionsonsamepageelse,
-%D doifpositionsonthispageelse}
-%D
-%D Instead of letting the user handle fuzzy expansion, we
-%D provide a simple test on positione being on the same page.
-%D
-%D \starttyping
-%D \doifpositionsonsamepageelse{point a}{point b}
-%D {action when on same page}
-%D {action when not on same page}
-%D \doifpositionsonthispageelse{point a}{point b}
-%D {action when on this page}
-%D {action when not on this page}
-%D \stoptyping
-
-\def\dodoifpositionsonsamepageelse#1#2#3#4%
- {\bgroup
- \scratchcounter#1\donefalse
- \def\docommand##1%
- {\ifcase\scratchcounter
- \scratchcounter\MPp{##1}\donetrue
- \else
- \ifnum\scratchcounter=\MPp{##1}\relax\else\donefalse\fi
- \fi}%
- \rawprocesscommalist[#2]\docommand
- \ifdone\egroup#3\else\egroup#4\fi}
-
-\def\doifpositionsonsamepageelse{\dodoifpositionsonsamepageelse\!!zerocount}
-\def\doifpositionsonthispageelse{\dodoifpositionsonsamepageelse\realfolio }
-
-%D Plugins:
-
-\let\MPv \MPplus
-\let\MPvv\MPrest
-
-\let\MPanchor\MPpos
-
-\let\POSp\MPp \let\POSx\MPx \let\POSy\MPy
-\let\POSh\MPh \let\POSd\MPd \let\POSw\MPw
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/anch-snc.mkii b/Master/texmf-dist/tex/context/base/mkii/anch-snc.mkii
deleted file mode 100644
index 01704e0c8e6..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/anch-snc.mkii
+++ /dev/null
@@ -1,177 +0,0 @@
-%D \module
-%D [ file=anch-snc,
-%D version=2003.12.01,
-%D title=\CONTEXT\ Anchoring Macros,
-%D subtitle=Synchronization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Anchoring Macros / Synchronization}
-
-\unprotect
-
-\ifx\s!set \undefined \def\s!set {set} \fi
-\ifx\s!reset \undefined \def\s!reset {reset} \fi
-\ifx\s!preset \undefined \def\s!preset {preset} \fi
-\ifx\s!syncpos\undefined \def\s!syncpos{syncpos} \fi
-
-\def\definesyncpositions[#1]%
- {\setcounter{\s!num:\s!syncpos:#1}{0}%
- \doglobal\appendtoksonce\getvalue {\s!reset:\s!syncpos:#1}\to\resetsyncpositions
- \doglobal\appendtoksonce\getvalue{\s!preset:\s!syncpos:#1}\to\presetsyncpositions
- \setgvalue{\s!syncpos:#1}{sync_n[#1] := 0 ;}%
- \setgvalue{\s!set:\s!syncpos:#1}{\dosetsyncpositions{#1}}}
-
-\def\syncposition
- {\dodoubleempty\dosyncposition}
-
-\def\dosyncposition[#1][#2]%
- {\letgvalue{\s!reset:\s!syncpos:#1}\relax
- \letgvalue{\s!preset:\s!syncpos:#1}\relax
- \dontleavehmode
- \dodosyncposition{#1}{#2}\s!set
- \ignorespaces}
-
-\def\doifelselastsyncposition#1#2%
- {\doifelse{\lastsyncclass\lastsyncposition}{#1#2}}
-
-\def\dodosyncposition#1#2#3%
- {\letgvalue{\s!reset:\s!syncpos:#1}\relax
- \letgvalue{\s!preset:\s!syncpos:#1}\relax
- \ifundefined{\s!syncpos:#1}%
- \strut
- \else
- \pluscounter{\s!num:\s!syncpos:#1}%
- \setsyncpositions{#1}%
- % option: geen w/h, alleen p 0 0 0 data
- \setpositionplus
- {\s!syncpos:#1:\countervalue{\s!num:\s!syncpos:#1}}%
- {#2}%
- \hbox{\strut\traceposstring\llap\green{#3/\countervalue{\s!num:\s!syncpos:#1}/#1/#2>>}}%
- \fi}
-
-\def\setsyncpositions#1%
- {\enabletextarearegistration
- \getvalue {\s!set:\s!syncpos:#1}%
- \letgvalue{\s!set:\s!syncpos:#1}\relax}
-
-\def\dosetsyncpositions#1%
- {\startnointerference % removing out of sync can best be done in mp
- \!!dimena\maxdimen
- \!!counta\zerocount
- \!!countc\zerocount
- \doloop
- {\doifpositionelse{\s!syncpos:#1:\recurselevel}
- {\!!dimenb\MPy{\s!syncpos:#1:\recurselevel}\relax
- \!!countb\MPp{\s!syncpos:#1:\recurselevel}\relax
- \ifnum\!!countb=\!!counta % same page
- \ifdim\!!dimenb>\!!dimena
- \donefalse % out of order nodes
- \else
- \donetrue % nodes in order
- \fi
- \else
- \donetrue % different page
- \fi
- \ifdone
- \!!counta\!!countb
- \!!dimena\!!dimenb
- \advance\!!countc\plusone
- \edef\!!stringa{[#1][\the\!!countc]:=}%
- \edef\!!stringc{\s!syncpos:#1:\the\!!countc}%
- \edef\!!stringd{\MPplus\!!stringc{1}{0}}%
- \setxvalue{\s!syncpos:#1}%
- {\getsyncpositions{#1}%
- sync_p \!!stringa \MPp \!!stringc ;
- sync_xy\!!stringa \MPxy\!!stringc ;
- sync_w \!!stringa \MPw \!!stringc ;
- sync_h \!!stringa \MPh \!!stringc ;
- sync_d \!!stringa \MPd \!!stringc ;
- \ifx\!!stringd\empty \else sync_t \!!stringa \MPplus\!!stringc{1}{0} ; \fi}%
- \fi}
- {\setxvalue{\s!syncpos:#1}%
- {\getsyncpositions{#1}%
- sync_n[#1] := \the\!!countc ;}
- \exitloop}}%
- \stopnointerference}
-
-\def\getsyncpositions#1%
- {\getvalue{\s!syncpos:#1}}
-
-\newtoks\resetsyncpositions
-\newtoks\presetsyncpositions
-
-\def\resyncposition {\dodoubleargument\doresyncposition}
-\def\presyncposition{\dodoubleargument\dopresyncposition}
-
-\def\dodoresyncposition #1#2{\dodosyncposition{#1}{#2}\s!reset}
-\def\dodopresyncposition#1#2{\dodosyncposition{#1}{#2}\s!preset}
-
-\def\doresyncposition [#1][#2]{\setxvalue{\s!reset :\s!syncpos:#1}{\noexpand\dodoresyncposition{#1}{#2}}}
-\def\dopresyncposition[#1][#2]{\setxvalue{\s!preset:\s!syncpos:#1}{\noexpand\dodopresyncposition{#1}{#2}}}
-
-\def\flushsyncpositions % this order !
- {\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
-
-% \explicitneverypar -> in grid snapper, eerst testen
-%
-% \appendtoks \flushsyncpositions \to \neverypar
-
-\protect \endinput
-
-\starttext
-
-\definesyncpositions[1]
-
-\startuseMPgraphic{sync}
- StartPage ;
- \getsyncpositions{1} ;
- SyncThreshold := 2LineHeight ;
- SyncLeftOffset := -.5LeftMarginDistance ;
- % SetSyncThreshold(1,3,3LineHeight) ;
- SyncWidth := - (BackSpace + SyncLeftOffset) ;
- SetSyncColor(1,1,\MPcolor{red}) ;
- SetSyncColor(1,2,\MPcolor{green}) ;
- SetSyncColor(1,3,\MPcolor{blue}) ;
- SetSyncColor(1,4,\MPcolor{yellow}) ;
- PrepareSyncTasks(1,true,true,false) ;
- for i = 1 upto NOfSyncPaths :
- fill SyncPaths[i]
- withcolor TheSyncColor(CurrentSyncClass,sync_t[CurrentSyncClass][SyncTasks[i]]) ;
- endfor ;
- setbounds currentpicture to Page ;
- StopPage ;
-\stopuseMPgraphic
-
-\defineoverlay[tempoverlay][\useMPgraphic{sync}]
-
-\setupbackgrounds[page][background=tempoverlay]
-
-\syncposition[1][1] \input ward \endgraf
-\syncposition[1][2] \input ward \endgraf
-\syncposition[1][3] \input ward \endgraf
-\syncposition[1][4] \input ward \endgraf
-
-\stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkii/bibl-tra.mkii b/Master/texmf-dist/tex/context/base/mkii/bibl-tra.mkii
deleted file mode 100644
index a6388465f80..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/bibl-tra.mkii
+++ /dev/null
@@ -1,1781 +0,0 @@
-%D \module
-%D [ file=bibl-tra,
-%D version=2009.08.13,
-%D title=\CONTEXT\ Publication Module,
-%D subtitle=Publications,
-%D author=Taco Hoekwater,
-%D date=\currentdate,
-%D copyright={Public Domain}]
-%C
-%C Donated to the public domain.
-
-%D This used to be module \type {t-bib} but due to the number of differences
-%D in handling structure between \MKII\ and \MKIV\ we now have \BIBTEX\ support
-%D in the kernel. The only patches concerns some namespace issues. Also,
-%D constants and variables are now predefined. When the \MKIV\ code is well
-%D tested I might backport a couple of adaptions to this \MKII\ variant.
-
-\writestatus{loading}{ConTeXt Bibliography Support / BibTeX}
-
-\definefilesynonym[bib][obsolete]
-
-% here starts t-bib.tex
-
-%D The original was developed independantly by Taco Hoekwater while still working for Kluwer
-%D Academic publishers (it still used the dutch interface then). Development continued after
-%D he left Kluwer, and in Januari 2005, the then already internationalized file was merged
-%D with the core distribution by Hans Hagen. The current version is once again by Taco.
-%D
-%D More documentation and additional resources can be found on the contextgarden:
-%D \hyphenatedurl{http://wiki.contextgarden.net//Bibliography}.
-
-%D \subject{DONE (dd/mm/yyyy)}
-%D
-%D \startitemize
-%D \item add author definition (and associated system variable) (26/05/2005)
-%D \item add finalnamesep support for Oxford comma (17/09/2005)
-%D \item add \type{\insert...} for: doi, eprint, howpublished (19/09/2005)
-%D \item allow a defaulted \type{\setupcite} (19/11/2005)
-%D \item renamed citation type 'number' to 'serial' (19/11/2005)
-%D \item better definition of \type{\inverted...author} (19/11/2005)
-%D \item don't reset [numbercommand] in \type {\setuppublication} by default (20/11/2005)
-%D \item don't disable other \type {\setuppublication} keys if alternative is present (20/11/2005)
-%D \item drop \type{\sanitizeaccents} (20/11/2005)
-%D \item added \type{\nocite} and \type{\cite[none]} (21/11/2005)
-%D \item added headtext for it (23/11/2005)
-%D \item make \type{\cite[url]} and \type{\cite[doi]} interactive (23/11/2005)
-%D \item make right-aligned labels in the list work even when autohang=no
-%D \item use 'et al.' instead of 'et.al.'. Pointed out by Peter M�nster (30/12/2005)
-%D \item added headtext for cz (31/12/2005)
-%D \item Keep whitespace after \type{\cite} with single argument (31/12/2005)
-%D \item Fix broken \type{\cite{}} support (31/12/2005)
-%D \item Use \type{\readfile} inside \type{\usepublications} instead of \type{\readsysfile} (12/01/2006)
-%D \item Use \type{\currentbibyear} and \type{\currentbibauthor} instead of \type{\YR} and \type{\AU} (05/02/2006)
-%D \item Fix compressed version of authoryear style (05/02/2006)
-%D \item Rename the clashing data fields \type{\url} and \type{\type} to \type{\biburl} and \type{\bibtype} (05/02/2006)
-%D \item Added two french bibl files from Renaud Aubin (06/02/2006)
-%D \item Five new bib class and eight extra bib fields, for IEEEtran (07/02/2006)
-%D \item French keyword translation, provided by Renaud (08/02/2006)
-%D \item fix underscores in undefined keys (22/02/2006)
-%D \item Destroy interactivity in labels of the publication list (13/03/2006)
-%D \item fix multi-cite list compression (11/4/2006)
-%D \item fix \type{\getcitedata} (11/4/2006)
-%D \item magic for chapter bibs (18-25/4/2006)
-%D \item language setting (25/4/2006)
-%D \item use \type{\hyphenatedurl} for \type{\inserturl} (25/4/2006)
-%D \item Add \type{\docitation} to \type{\nocite}(26/4/2006)
-%D \item patents can have numbers, added to bst files (26/4/2006)
-%D \item \type{\docitation} needs a \type{\iftrialtypesetting} (27/4/2006)
-%D \item \type{\filllocalpublist}'s loop is bound by definedness, not resolvedness (27/4/2006)
-%D \item \type{\setuppublications[monthconversion=]} added (15/5/2006)
-%D \item use \type{\undefinedreference} instead of bare question marks (15/5/2006)
-%D \item add grouping around \type{\placepublications} commands (16/5/2006)
-%D \item fix a bug in \type{\cite{<item>}} (17/5/2006)
-%D \item support \type{\cite[authornum]} (18/5/2006)
-%D \item make \type{\cite} unexpandable (20/6/2006)
-%D \item allow hyperlinks in author\&year combo's
-%D (cite list compression has to be off) (20/6/2006)
-%D \item fix duplicate labels for per-chapter style (20/6/2006)
-%D \item allow \type{\setupcite[interaction=(start|stop)]}
-%D \item fix the item number in the publication list with 'numbering=yes' (22/6/2006)
-%D \item make the default criterium for \type{\placepublications} be \type{previous} (23/6/2006)
-%D \item fix \type{\normalauthor} and \type{\normalshortauthor} spacing (29/6/2006)
-%D \item do not typeset empty arguments to \type{\typesetapublication} (29/6/2006)
-%D \item add \type{symbol=none} to \type{\setuplist} in unnumbered
-%D mode to prevent typesetting of bare numbers (29/6/2006)
-%D \item remove two incorrect spaces from bibl-num.tex (1/7/2006)
-%D \item reset font styles within \type{\cite}, so that font switches
-%D in \type{left} stay in effect (12/7/2006)
-%D \item guard added against loading bbl files multiple times (13/7/2006)
-%D \item fix \type{\cite[num]} with compression is on. (14/7/2006)
-%D \item test \type{\iflocation} before deciding to use the
-%D interactive version of cite (18/7/2006)
-%D \item support \type{\setupcite[authoretallimit=1]} (18/7/2006)
-%D \item support use of \type{\cite} within titles and captions by
-%D saveguarding the list item extraction and reference placement
-%D code (19/7/2006)
-%D \item support \type{\setuppublicationlist[title=\chapter]} (4/8/2006)
-%D \item use the expansion of \type{\headtext{pubs}} (4/8/2006)
-%D \item hook added for repeated authors in publication list
-%D \type{\setuppublicationlist[artauthorcommand=\mythreeargscommand]}
-%D (4/8/2006)
-%D \item make the bracketed arguments of \type{\artauthor}, \type{\author}
-%D and \type{\editor} (bbl commands) optional (4/8/2006)
-%D \item the constants \type{sorttype}, \type{compress} and
-%D \type{autohang} have moved to the core (8/8/2006)
-%D \item bibtex is now registered as a program to be run by texexec (8/8/2006)
-%D \item fix a bug in \type{\setupcite[authoretallimit=1]} (9/8/2006)
-%D \item fix a bug inside citations that prevented lastpubsep from ever being
-%D used due to a volatile \type{\commalistsize} (25/8/2006).
-%D \item added the possibility of \type{\placepublications[option=continue]}
-%D (6/9/2006)
-%D \item Mojca translated Master's Thesis to Masterarbeit (bibl-apa-de.tex)
-%D (12/9/2006)
-%D \item Added \type{\setuppublicationlist[maybeyear=off]} by request from
-%D Thomas Schmitz (15/9/2006)
-%D \item Removed some spurious spaces pointed out by willi egger (19/9/2006)
-%D \item Add configuration of bibtex executable name (4/11/2006)
-%D \item Fix numbering=short and numbering=bib (spotted by Matthias W�chter) (4/11/2006)
-%D \item third attempt to get a correct release (5/11/2006)
-%D \item fix a few missing dots in bibl-num.tex (7/12/2006)
-%D \item Patch for DOI's by Tobias Burnus (17/4/2007)
-%D \item Patch for \type{\insertbiburl} and \type{\insertdoi} for Tobias Burnus (18/4/2007)
-%D \item Added a missing \type{\relax} in \type{\dospecialbibinsert},
-%D that made the space before the {\it et al.} text disappear. (18/4/2007)
-%D \item Attempt to fix percent signs in bbl files. As a side-effect,
-%D this prohibits comments in \tex{startpublication} blocks! (17/4/2008)
-%D \item Patch from Matthias W\"achter that allows arbitrary .bst
-%D files to be used with \tex{setupbibtex} (25/9/2008)
-%D \item Extended for the new multilingual setups for the Oct 2008 current of ConTeXt (23/10/2008)
-%D \item Multilingual setups needed another fix (27/10/2008)
-%D \item Two fixes for bibl-apa by Michael Green (27/10/2008)
-%D \item Catalan translation of 'References' (10/11/2008)
-%D \item 'chapter' -> 'chapitre' in bibl-apa-fr (27/11/2008)
-%D \item Run bibtex via os.execute in mkiv modee (01/12/2008)
-%D \item Small correction in bibl-apa's placement of volume
-%D information in articles (05/01/2009)
-%D \item Handle multi-author (more than two) cases in \type{\cite}
-%D (02/03/2009)
-%D \item Suppress a syntax error in \type{cont-xp} mode. The output is
-%D probably not right, though (02/03/2009)
-%D \item Added a \tex{loadmarkfile} at the end, and two new files
-%D from Hans. The \type{t-bib.mkiv} is needed to make the module
-%D work with the new structure code (17/04/2009)
-%D \item Added a patch to \type{t-bib.mkiv} from Hans to make the
-%D cross referencing between multiple citations an
-%D bibliographies work (27/04/2009)
-%D \item Remove a superfluous \type{\unprotect} in t-bib.mkiv (11/05/2009).
-%D \item Patch of incollection in bibl-ams.tex from Xan (08/06/2009).
-%D \item Patch of unpublished in bibl-ams.tex from Xan (22/07/2009).
-%D \item Modified \type{\bibdogetupsometextprefix} so it works for undefined
-%D language labels, from Hans (13/08/2009).
-%D \item Removed some \MKIV\ hacks as well as some things that are in the
-%D core like variables, constants and messages (HH:22/08/2009).
-%D \item Added \type{bib} in front of \type {insert} macros and initialize
-%D then later on (HH:22/08/2009).
-%D \item Removed test for type {\currentlocationreference} plus associated
-%D code (HH:22/08/2009).
-%D \stopitemize
-%D
-%D \subject{WISHLIST}
-%D
-%D \startitemize
-%D \item link back from publication list to citation
-%D \item export \type {\citation{<cited item>}}
-%D \item support mlbibtex
-%D \item don't load the whole lot, but filter entries instead
-%D \stopitemize
-
-\unprotect
-
-%D Variables, constants and messages are removed as they are now in the
-%D multilingual interface modules.
-
-\def\biblistname{pubs} % for compatibility
-
-% \newif\ifeditedbook
-
-%D how to load the references. There is some new stuff here
-%D to support Idris' (incorrect :-)) use of projects
-
-% \let\preloadbiblist\relax
-%
-% \ifx\currentcomponent\v!text
-% % single file
-% \edef\temp{\the\everystarttext}%
-% \ifx\temp\empty
-% % post-starttext
-% \def\preloadbiblist{\dousepublications\jobname }%
-% \else
-% % pre-starttext
-% \appendtoks \dousepublications\jobname \to \everystarttext
-% \fi
-% %
-% \else \ifx\currentcomponent\v!project
-% % a project file, have to set up the partial products!
-% \def\startproduct #1 %
-% {\doateverystarttext
-% \dousepublications{#1}%
-% \donextlevel\v!product\currentproduct
-% \doexecutefileonce\doexecutefileonce
-% \donotexecutefile\doexecutefile#1\\}%
-% %
-% \else \ifx\currentcomponent\v!product
-% % a product file
-% \def\preloadbiblist{\dousepublications\jobname }%
-% %
-% \else
-% % a component? not sure what to do
-% \def\preloadbiblist{\dousepublications\jobname }%
-% %
-% \fi \fi \fi
-
-\def\preloadbiblist
- {\globallet\preloadbiblist\relax
- \dousepublications\jobname}
-
-\definelist[pubs]
-\setuplist[pubs][\c!width=]
-
-%D \macros{bibdoif,bibdoifnot,bibdoifelse}
-%D
-%D Here are a few small helpers that are used a lot
-%D in all the typesetting commands
-%D (\type{\insert...}) we will encounter later.
-
-\long\def\bibdoifelse#1%
- {\@EA\def\@EA\!!stringa\@EA{#1}%
- \ifx\!!stringa\empty
- \expandafter\secondoftwoarguments
- \else
- \expandafter\firstoftwoarguments
- \fi}
-
-\long\def\bibdoifnot#1%
- {\@EA\def\@EA\!!stringa\@EA{#1}%
- \ifx\!!stringa\empty
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\long\def\bibdoif#1%
- {\@EA\def\@EA\!!stringa\@EA{#1}%
- \ifx\!!stringa\empty
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-%D Bibtex settings separated out
-
-%D No point in writing the aux file if there is no database...
-
-\def\setupbibtex{\dosingleempty\dosetupbibtex}
-
-\def\dosetupbibtex[#1]%
- {\let\@@pbdatabase\empty
- \getparameters[\??pb][\c!sort=\s!default,#1]%
- \expanded{\processaction[\@@pbsort]}
- [ \v!no=>\def\bibstyle{cont-no},
- \v!author=>\def\bibstyle{cont-au},
- \v!title=>\def\bibstyle{cont-ti},
- \v!short=>\def\bibstyle{cont-ab},
- \s!default=>\def\bibstyle{cont-no},
- \s!unknown=>\def\bibstyle{\@@pbsort}]%
- \ifx\@@pbdatabase\empty\else \writeauxfile \fi}
-
-\dosetupbibtex[bibtex=bibtex]
-
-%D \macros{writeauxfile}
-%D
-%D Unfortunately, \BIBTEX\ is not the best configurable program
-%D around. The names of the commands it parses as well as the \type{.aux}
-%D extension to the file name are both hardwired.
-%D
-%D This means \CONTEXT\ has to write a \LATEX-style auxiliary file, yuk!
-%D The good news is that it can be rather short. We'll just ask
-%D \BIBTEX\ to output the entire database(s) into the \type{bbl} file.
-%D
-%D The \type{\bibstyle} command controls how the \type{bbl} file will
-%D be sorted. The possibilities are:
-%D
-%D \startitemize[packed]
-%D \item by author (+year, title): cont-au.bst
-%D \item by title (+author, year): cont-ti.bst
-%D \item by short key as in abbrev.bst: cont-ab.bst
-%D \item not sorted at all: cont-no.bst
-%D \stopitemize
-
-\def\writeauxfile
- {\doifmode{*\v!first}
- {\openout \scratchwrite \jobname.aux
- \write \scratchwrite {\string\citation{*}}%
- \write \scratchwrite {\string\bibstyle{\bibstyle}}%
- \write \scratchwrite {\string\bibdata{\@@pbdatabase}}%
- \closeout\scratchwrite
- \showmessage\m!publications{3}{}%
- \expanded{\installprogram{\@@pbbibtex\space\jobname}}}}
-
-%D \macros{ifsortbycite,iftypesetall,ifautohang,ifbibcitecompress}
-%D
-%D The module needs some new \type{\if} statements.
-
-%D Default sort order of the reference list is by citation.
-
-\newif\ifsortbycite \sortbycitetrue
-
-%D By default, only referenced publications are typeset
-
-\newif\iftypesetall \typesetallfalse
-
-%D Hanging indentation of the publication list
-%D will not adjust itself according to the width of the label.
-
-\newif\ifautohang \autohangfalse
-
-%D Cite lists are compressed, if possible.
-
-\newif\ifbibcitecompress \bibcitecompresstrue
-
-\def\setuppublications
- {\dosingleargument\dosetuppublications}
-
-\def\bibleftnumber#1%
- {#1\hfill~}
-
-\def\dosetuppublications[#1]%
- {\getparameters
- [\??pb]
- [\c!alternative=,#1]%
- \doifsomething\@@pbalternative
- {\readsysfile
- {bibl-\@@pbalternative.tex}
- {\showmessage\m!publications{6}{bibl-\@@pbalternative}\let\@@pbalternative\empty}
- {\showmessage\m!publications{1}{bibl-\@@pbalternative}\let\@@pbalternative\empty}}%
- \getparameters
- [\??pb]
- [#1]%
- \processaction
- [\@@pbcriterium]
- [ \v!all=>\typesetalltrue,
- \s!unknown=>\typesetallfalse]%
- \processaction
- [\@@pbautohang]
- [ \v!yes=>\autohangtrue,
- \s!unknown=>\autohangfalse]%
- \processaction
- [\@@pbsorttype]
- [ \v!cite=>\sortbycitetrue,
- \v!bbl=>\sortbycitefalse,
- \s!default=>\sortbycitetrue,
- \s!unknown=>\sortbycitefalse]%
- \processaction
- [\@@pbnumbering]
- [ \v!yes=>\let\@@pbinumbercommand\firstofoneargument,
- \v!no=>\let\@@pbinumbercommand\gobbleoneargument,
- \v!short=>\def\@@pbinumbercommand##1{\getvalue{pbds-\@@pbk}},
- \v!bib=>\def\@@pbinumbercommand##1{\getvalue{pbdn-\@@pbk}},
- \s!unknown=>\let\@@pbinumbercommand\firstofoneargument]%
- \processaction
- [\@@pbrefcommand]
- [\s!default=>\edef\@@citedefault{\@@pbrefcommand},
- \s!unknown=>\edef\@@citedefault{\@@pbrefcommand}]}
-
-% initialize
-
-\def\@@pbrefcommand{num}
-\def\@@pbnumbercommand{\bibleftnumber}
-
-%D \macros{usepublications}
-%D
-%D We need \type{\usereferences} so that it is possible to
-%D refer to page and/or appearance number for publications
-%D in the other document.
-
-\def\usepublications[#1]%
- {\usereferences[#1]\processcommalist[#1]\dousepublications}
-
-\def\dousepublications#1%
- {\doonlyonce
- {#1.\f!bibextension}
- {\readfile{#1.\f!bibextension}
- {\showmessage\m!publications{4}{#1.\f!bibextension}}
- {\showmessage\m!publications{2}{#1.\f!bibextension}}}}
-
-%D \macros{setuppublicationlist}
-%D
-%D This will be the first command in (\BIBTEX-generated) \type{bbl}
-%D files. `samplesize' is a sample value (in case of \BIBTEX-generated
-%D files, this will be the longest `short' key). `totalnumber'
-%D is the total number of entries that will follow in this
-%D file.
-
-%D Both values are only needed for the label calculation
-%D if `autohang' is `true', so by default the command is
-%D not even needed, and therefore I saw no need to give
-%D it it's own system variable and it just re-uses \type{pb}.
-
-\def\setuppublicationlist
- {\dosingleempty\dosetuppublicationlist}
-
-\def\dosetuppublicationlist[#1]%
- {\getparameters[\??pv data][#1]%
- \setuplist
- [pubs]
- [\c!samplesize={AA99},\c!totalnumber={99},
- \c!alternative=a,\c!interaction=,\c!pagenumber=\v!no,#1]}
-
-\def\setuppublicationlayout[#1]#2%
- {\setvalue{\??pv data#1}{#2\unskip}}
-
-%D \macros{bibalternative}
-%D
-%D A nice little shorthand that will be used so we don't have to
-%D key in the weird \type{\@@pv} parameter names all the time.
-
-\def\bibalternative#1%
- {\getvalue{\??pv\@@currentalternative#1}}
-
-%D \macros{simplebibdef,bibcommandlist}
-%D
-%D \type{\simplebibdef} defines \type{bib@#1}, which in turn will
-%D use one argument that is stored in \type{@@pb@#1}.
-%D
-%D \type{\simplebibdef} also defines \type{insert#1}, which can be
-%D used in the argument of \type{\setuppublicationlayout} to fetch
-%D one of the \type{@@pb@} data entries. \type{insert#1} then has
-%D three arguments: \type{#1} are commands to be executed before the
-%D data, \type{#2} are commands to be executed after the data, and
-%D \type{#3} are commands to be executed if the data is not found.
-
-%D \type{\bibcommandlist} is the list of commands that is affected
-%D by this approach. Later on, it will be used to do a series
-%D of assignments from \type{#1} to \type{bib@#1}: e.g
-%D \type{\title} becomes \type{\bib@title} when used within
-%D a publication.
-
-\newtoks\initializebibdefinitions % we need to prevent clashes (HH)
-
-% \def\simplebibdef#1% hh: funny expansion ?
-% {\@EA\long\@EA\def\csname bib@#1\endcsname##1%
-% {\setvalue{\??pb @#1}{##1}%
-% \ignorespaces}%
-% \@EA\def\csname insert#1\endcsname##1##2##3%
-% {\@EA\bibdoifelse
-% \@EA{\csname @@pb@#1\endcsname}%
-% {##1\csname @@pb@#1\endcsname##2}%
-% {##3}%
-% }}
-
-\def\simplebibdef#1% hh: funny expansion ?
- {\@EA\long\@EA\def\csname bib@#1\endcsname##1%
- {\setvalue{\??pb @#1}{##1}\ignorespaces}%
- \expandafter \appendtoks
- \expandafter\let\csname insert#1\expandafter\endcsname\csname bibinsert#1\endcsname
- \to \initializebibdefinitions
- \@EA\unexpanded\@EA\def\csname bibinsert#1\endcsname##1##2##3%
- {\@EA\bibdoifelse\@EA{\csname\??pb @#1\endcsname}{##1\csname\??pb @#1\endcsname##2}{##3}}}
-
-\def\bibcommandlist
- {abstract, annotate, arttitle, assignee, bibnumber, bibtype, biburl, chapter, city,
- comment, country, day, dayfiled, doi, edition, eprint, howpublished, isbn, issn,
- issue, journal, keyword, keywords, lastchecked, month, monthfiled, names, nationality,
- note, notes, organization, pages, pubname, pubyear, revision, series, size, thekey,
- title, volume, yearfiled}
-
-\processcommacommand[\bibcommandlist]\simplebibdef
-
-\def\bibinsertdoi#1#2#3%
- {{\bibdoifelse{\@@pb@doi}%
- {\edef\ascii{\@EA\detokenize\@EA{\@@pb@doi}}%
- #1\expanded{\gotoDOI{\@@pb@thekey}{\ascii}}#2}{#3}}}
-
-\def\bibinsertbiburl#1#2#3%
- {{\bibdoifelse{\@@pb@biburl}%
- {\edef\ascii{\@EA\detokenize\@EA{\@@pb@biburl}}%
- #1\expanded{\gotoURL{\@@pb@thekey}{\ascii}}#2}{#3}}}
-
-\def\bibinsertmonth#1#2#3%
- {\bibdoifelse{\@@pb@month}%
- {#1\doifnumberelse{\@@pb@month}%
- {\doifconversiondefinedelse\@@pbmonthconversion
- {\convertnumber\@@pbmonthconversion{\@@pb@month}}{\@@pb@month}}%
- {\@@pb@month}#2}{#3}}
-
-\appendtoks
- \let\inserturl \bibinsertbiburl % for backward compat.
- \let\inserttype\bibinsertbibtype % for backward compat.
-\to\initializebibdefinitions
-
-\def\newbibfield[#1]%
- {\simplebibdef{#1}%
- \edef\bibcommandlist{\bibcommandlist,#1}}
-
-%D \macros{bib@crossref}
-%D
-%D \type{\crossref} is used in database files to point to another
-%D entry. Because of this special situation, it has to be defined
-%D separately. Since this command will not be seen until at
-%D \type{\placepublications}, it may force extra runs. The same is
-%D true for \type{\cite} commands inside of publications.
-
-\def\bib@crossref#1%
- {\setvalue{\??pb @crossref}{#1}\ignorespaces}
-
-\def\bibinsertcrossref#1#2#3%
- {\bibdoifelse{\@@pb@crossref}
- {#1\@EA\cite\@EA[\@@pb@crossref]#2}
- {#3}}
-
-\let\insertcrossref\gobblethreearguments
-
-\appendtoks\let\insertcrossref\bibinsertcrossref\to\initializebibdefinitions
-
-%D \macros{complexbibdef,specialbibinsert}
-%D
-%D The commands \type{\artauthor}, \type{\author} and
-%D \type{\editor} are more complex than the other commands.
-%D Their argument lists have this form:
-%D
-%D \type{\author[junior]{firstnames}[inits]{von}{surname}}
-%D
-%D (bracketed stuff is optional)
-%D
-%D And not only that, but there also might be more than one of each of
-%D these commands. This is why a special command is needed to insert
-%D them, as well as one extra counter for each command.
-
-%D All of these \type{\@EA}'s and \type{\csnames} make this code
-%D look far more complex than it really is. For example, the argument
-%D \type{author} defines the macro \type{\bib@author} to do two
-%D things: increment the counter \type{\author@num} (let's say to 2)
-%D and next store it's arguments in the macro \type{\@@pb@author2}.
-%D And it defines \type{\insertauthors} to expand into
-%D \starttyping
-%D \specialbibinsert{author}{\author@num}{<before>}{<after>}{<not>}
-%D \stoptyping
-
-\def\docomplexbibdef#1%
- {\def\currentype{#1}%
- \dosingleempty\dodocomplexbibdef}
-
-\def\dodocomplexbibdef[#1]#2%
- {\def\firstarg{#1}\def\secondarg{#2}%
- \dosingleempty\dododocomplexbibdef}
-
-\def\dododocomplexbibdef[#1]#2#3%
- {\@EA\increment\csname \currentype @num\endcsname
- \setevalue{\??pb @\currentype\csname \currentype @num\endcsname}%
- {{\secondarg}{#2}{#3}{#1}{\firstarg}}\ignorespaces}%
-
-% \def\complexbibdef#1%
-% {\@EA\newcounter\csname #1@num\endcsname
-% \@EA\def\csname bib@#1\endcsname{\docomplexbibdef{#1}}%
-% \@EA\def\csname insert#1s\endcsname##1##2##3%
-% {\specialbibinsert{#1}{\csname #1@num\endcsname}{##1}{\unskip ##2}{##3}}}
-
-\def\complexbibdef#1%
- {\@EA\newcounter\csname #1@num\endcsname
- \@EA\def\csname bib@#1\endcsname{\docomplexbibdef{#1}}%
- \expandafter \appendtoks
- \expandafter\let\csname insert#1s\expandafter\endcsname\csname bibinsert#1s\endcsname
- \to \initializebibdefinitions
- \@EA\def\csname bibinsert#1s\endcsname##1##2##3{\specialbibinsert{#1}{\csname #1@num\endcsname}{##1}{\unskip ##2}{##3}}}
-
-\processcommalist[author,artauthor,editor]\complexbibdef
-
-%D Another level of indirection is needed to control the
-%D typesetting of all of these arguments.
-
-%D Btw, there is a conflict between `author' and the predefined interface
-%D variable `auteur'. The old version is overruled `auteur' is
-%D overruled by the systemconstant definition at the top of this file!
-
-\newcount\etallimitcounter
-\newcount\etaldisplaycounter
-\newcount\todocounter
-
-\def\specialbibinsert#1#2#3#4#5%
- {\bgroup
- \ifnum#2>\zerocount
- \etallimitcounter =0\bibalternative{#1etallimit}\relax
- \etaldisplaycounter=0\bibalternative{#1etaldisplay}\relax
- \ifnum #2>\etallimitcounter
- \todocounter\etaldisplaycounter
- % just in case ...
- \ifnum\todocounter>\etallimitcounter
- \todocounter\etallimitcounter
- \fi
- \else
- \todocounter#2\relax
- \fi
- \ifnum\todocounter>\zerocount
- % find the current author list
- \let\templist\empty
- \dorecurse{#2}
- {\toks0=\@EA\@EA\@EA{\csname @@pb@#1\recurselevel\endcsname}%
- \ifx\templist\empty \edef\templist{\the\toks0}%
- \else \edef\templist{\templist,\the\toks0}\fi }%
- \doifdefinedelse
- {\??pv data#1\c!command}
- {\doifemptyelsevalue
- {\??pv data#1\c!command}
- {#3\dospecialbibinsert{#1}{\todocounter}{\templist}#4}%
- {#3\getvalue{\??pv data#1\c!command}{#1}{\todocounter}{\templist}#4}}%
- {#3\dospecialbibinsert{#1}{\todocounter}{\templist}#4}%
- \else
- #5%
- \fi
- \else
- #5%
- \fi
- \egroup}
-
-%D This macro does the hard work of inserting a list of people in the
-%D output, with proper regard of all the inbetween strings that can
-%D arise depending on length of the list of people.
-
-%D \#1 = type
-%D \#2 = number of items to be typeset
-%D \#3 = commacommand containing authors
-
-\def\dospecialbibinsert#1#2#3%
- {\getcommacommandsize[#3]%
- \scratchcounter 0
- \def\processauthoritem##1%
- {\advance\scratchcounter1
- \ifnum \numexpr\scratchcounter-1\relax<#2\relax
- \getvalue{\??pv data#1}##1%
- \ifnum \scratchcounter=#2\relax
- \ifnum\etallimitcounter<\commalistsize\relax \bibalternative{#1etaltext}\fi
- \else \ifnum\numexpr\scratchcounter+1 = #2\relax
- \ifnum \commalistsize > \plustwo \bibalternative\c!finalnamesep
- \else \bibalternative\c!lastnamesep \fi
- \else
- \bibalternative\c!namesep
- \fi \fi
- \fi}%
- \processcommacommand[#3]\processauthoritem }
-
-%D \macros{invertedauthor,normalauthor,invertedshortauthor,normalshortauthor}
-%D
-%D Just some commands that can be used in \type{\setuppublicationparameters}
-%D If you want to write an extension to the styles, you might
-%D as well define some of these commands yourself.
-%D
-%D The argument list has been reordered here, and the meanings are:
-%D
-%D {\obeylines\parskip0pt
-%D \type{#1} firstnames
-%D \type{#2} von
-%D \type{#3} surname
-%D \type{#4} inits
-%D \type{#5} junior
-%D }
-%D
-
-\def\normalauthor#1#2#3#4#5%
- {\bibdoif{#1}{#1\bibalternative\c!firstnamesep}%
- \bibdoif{#2}{#2\bibalternative\c!vonsep}%
- #3%
- \bibdoif{#5}{\bibalternative\c!surnamesep#5\unskip}}
-
-\def\normalshortauthor#1#2#3#4#5%
- {\bibdoif{#4}{#4\bibalternative\c!firstnamesep}%
- \bibdoif{#2}{#2\bibalternative\c!vonsep}%
- #3%
- \bibdoif{#5}{\bibalternative\c!surnamesep#5\unskip}}
-
-\def\invertedauthor#1#2#3#4#5%
- {\bibdoif{#2}{#2\bibalternative\c!vonsep}%
- #3%
- \bibdoif{#5}{\bibalternative\c!juniorsep #5}%
- \bibdoif{#1}{\bibalternative\c!surnamesep #1\unskip}}
-
-\def\invertedshortauthor#1#2#3#4#5%
- {\bibdoif{#2}{#2\bibalternative\c!vonsep}%
- #3%
- \bibdoif{#5}{\bibalternative\c!juniorsep #5}%
- \bibdoif{#4}{\bibalternative\c!surnamesep #4\unskip}}
-
-%D \macros{clearbibitem,clearbibitemtwo,bibitemdefs}
-%D
-%D These are used in \type{\typesetapublication} to do
-%D initializations and cleanups.
-
-\def\clearbibitem#1{\setvalue{\??pb @#1}{}}%
-
-\def\clearbibitemtwo#1%
- {\letvalue{#1@num}\!!zerocount
- \scratchcounter\plusone
- \doloop
- {\doifdefinedelse{\??pb @#1\the\scratchcounter}
- {\letvalue{\??pb @#1\the\scratchcounter}\empty
- \advance\scratchcounter\plusone}%
- {\exitloop}}}
-
-\def\bibitemdefs#1%
- {\@EA\let\@EA\tempa \csname bib@#1\endcsname
- \@EA\let\csname #1\endcsname \tempa }
-
-%D \macros{startpublication}
-%D
-%D We are coming to the end of this module, to the macros that
-%D do typesetting and read the \type{bbl} file.
-
-\newcounter\bibcounter
-
-%D Just a \type{\dosingleempty} is the most friendly
-%D of doing this: there need not even be an argument
-%D to \type{\startpublication}. Of course, then there
-%D is no key either, and it had better be an
-%D article (otherwise the layout will be all screwed up).
-%D
-%D Now prohibits comments, so % can be used for urls
-
-\def\startpublication
- {\edef\bibmodsavedpercent{\the\catcode`\%}%
- \catcode`\%=12
- \dosingleempty\dostartpublication}
-
-\def\stoppublication
- {} % the \catcode of % is reset below
-
-%D Only specifying the key in the argument is also
-%D legal. In storing this stuff into macros, some trickery with
-%D token registers is needed to fix the expansion problems. Even so,
-%D this appears to not always be 100\% safe, so people are
-%D urgently advised to use \ETEX\ instead of traditional \TEX.
-%D
-%D In \ETEX, all expansion problems are conviniently solved by
-%D the primitive \type{\protected}. To put that another way:
-%D
-%D It's not a bug in this module if it does not appear in \ETEX!
-
-\long\def\dostartpublication[#1]#2\stoppublication%
- {\increment\bibcounter
- \bgroup
- \doifassignmentelse{#1}%
- {\getparameters[\??pb][k=,t=article,n=,s=,a=,y=,o=,u=,#1]}%
- {\getparameters[\??pb][k=#1,t=article,n=,s=,a=,y=,o=,u=]}%
- \@EA\toks\@EA2\@EA{\@@pba}%
- \@EA\toks\@EA4\@EA{\@@pbs}%
- \toks0={\ignorespaces #2}%
- \setxvalue{pbdk-\@@pbk}{\@@pbk}
- \setxvalue{pbda-\@@pbk}{\the\toks2}
- \setxvalue{pbdy-\@@pbk}{\@@pby}
- \setxvalue{pbds-\@@pbk}{\the\toks4}
- \setxvalue{pbdn-\@@pbk}{\@@pbn}
- \setxvalue{pbdt-\@@pbk}{\@@pbt}
- \setxvalue{pbdo-\@@pbk}{\@@pbo}
- \setxvalue{pbdu-\@@pbk}{\@@pbu}
- \setxvalue{pbdd-\@@pbk}{\the\toks0}
- \xdef\allrefs{\allrefs,\@@pbk}%
- \egroup
- \catcode`\%=\bibmodsavedpercent\relax }
-
-% intialization of the order-list:
-
-\let\allrefs\empty
-
-%D The next macro is needed because the number command of the
-%D publist sometimes needs to fetch something from the current
-%D item (like the 'short' key). For this, the ID of the current
-%D item is passed in the implict parameter \type{\@@pbk}
-
-\def\makepbkvalue#1{\def\@@pbk{#1}}
-
-\newif\ifinpublist
-
-% from Hans
-
-\def\ignoresectionconversion
- {\let\@@sectionconversion\secondoftwoarguments}
-
-\let\normaldosetfilterlevel\dosetfilterlevel
-
-\def\patcheddosetfilterlevel#1#2% beware: this one is \let
- {\bgroup
- \ignoresectionconversion
- \edef\askedlevel{#1}%
- \edef\askedfilter{#2}%
-% \message{ASKD: \meaning\askedlevel}%
-% \message{PREV: \meaning\v!previous}%
- \ifx\askedlevel\v!current
- \dosetcurrentlevel\askedlevel
- \else\ifx\askedlevel\v!previous
- \dosetpreviouslevel\askedlevel
- \else\ifx\askedlevel\v!all
- \global\chardef\alltoclevels\plusone
- \else\ifx\askedlevel\v!text
- \global\chardef\alltoclevels\plusone
- \else
- \edef\byaskedlevel{\csname\??by\askedlevel\endcsname}%
- \ifx\byaskedlevel\v!text
- \dosettextlevel\askedlevel
- \else
- \dosetotherlevel\askedlevel
- \fi
- \fi\fi\fi\fi
- % experiment
- \ifx\askedfilter\empty \else
- \xdef\currentlevel{\currentlevel\sectionseparator\askedfilter}%
- \fi
- \egroup}
-
-\def\filllocalpublist%
- {\doifdefinedelse{\alltoclevels}
- {\let\dosetfilterlevel\patcheddosetfilterlevel
- \dosettoclevel\??li{pubs}%
- \let\dosetfilterlevel\normaldosetfilterlevel }%
- {\dosettoclevel\??li{pubs}}%
- \global\let\glocalpublist\empty
- \doloop
- {\doifdefinedelse
- {\r!cross cite-\jobname-\recurselevel}
- {\doifreferencefoundelse
- {cite-\jobname-\recurselevel}
- {\@EA\doifreglevelelse\@EA[\currentlocationreference]
- {\@EA\doglobal\@EA\addtocommalist\@EA
- {\currenttextreference}\glocalpublist}{}}
- {}}%
- {\exitloop}}%
- \let\localpublist\glocalpublist}
-
-\def\typesetpubslist
- {\dobeginoflist
-% \the\initializebibdefinitions
- \edef\askedlevel{\csname \??li pubs\c!criterium\endcsname}%
- \ifx\askedlevel\v!all
- \def\bibrefprefix{}%
- \else %
- \preparebibrefprefix
- \fi
- \ifsortbycite
- \filllocalpublist
- \iftypesetall
- \let\localallrefs\allrefs
- \processcommacommand[\localpublist]\typesetapublication
- \def\removefromallrefs##1%
- {\removefromcommalist{##1}\localallrefs }%
- \processcommacommand[\localpublist]\removefromallrefs
- \processcommacommand[\localallrefs]\typesetapublication
- \else
- \processcommacommand[\localpublist]\typesetapublication
- \fi
- \else
- \iftypesetall
- \processcommacommand[\allrefs]\typesetapublication
- \else
- %
- \filllocalpublist
- \processcommacommand[\allrefs]\maybetypesetapublication
- \fi
- \fi
- \doendoflist}
-
-\newif\ifinpublist
-
-\def\maybetypesetapublication#1%
- {\global\inpublistfalse
- \def\test{#1}%
- \def\runtest##1%
- {\def\tempa{##1}\ifx \test\tempa \global\inpublisttrue \fi}%
- \processcommacommand[\localpublist]\runtest
- \ifinpublist \typesetapublication{#1}\fi}
-
-\def\initializepubslist
- {\edef\@@pbnumbering{\@@pbnumbering}%
- \ifautohang
- \ifx\@@pbnumbering\v!short
- \setbox\scratchbox\hbox{\@@pbnumbercommand{\getvalue{\??li pubs\c!samplesize}}}%
- \else\iftypesetall
- \setbox\scratchbox\hbox{\@@pbnumbercommand{\getvalue{\??li pubs\c!totalnumber}}}%
- \else
- \setbox\scratchbox\hbox{\@@pbnumbercommand{\numreferred}}%
- \fi\fi
- \edef\samplewidth{\the\wd\scratchbox}%
- \setuplist[pubs][\c!width=\samplewidth,\c!distance=0pt]%
- \ifx\@@pbnumbering\v!short
- \def\@@pblimitednumber##1{\hbox to \samplewidth
- {\@@pbnumbercommand{\getvalue{pbds-\@@pbk}}}}%
- \else \ifx \@@pbnumbering\v!bib
- \def\@@pblimitednumber##1{\hbox to \samplewidth
- {\@@pbnumbercommand{\getvalue{pbdn-\@@pbk}}}}%
- \else
- \def\@@pblimitednumber##1{\hbox to \samplewidth{\@@pbnumbercommand{##1}}}%
- \fi \fi
- \else
- \ifx\@@pbnumbering\v!short
- \doifemptyelse
- {\getvalue{\??li pubs\c!width}}
- {\def\@@pblimitednumber##1{\hbox
- {\@@pbnumbercommand{\getvalue{pbds-\@@pbk}}}}}%
- {\def\@@pblimitednumber##1{\hbox to \getvalue{\??li pubs\c!width}%
- {\@@pbnumbercommand{\getvalue{pbds-\@@pbk}}}}}%
- \else \ifx \@@pbnumbering\v!bib
- \doifemptyelse
- {\getvalue{\??li pubs\c!width}}
- {\def\@@pblimitednumber##1{\hbox
- {\@@pbnumbercommand{\getvalue{pbdn-\@@pbk}}}}}%
- {\def\@@pblimitednumber##1{\hbox to \getvalue{\??li pubs\c!width}%
- {\@@pbnumbercommand{\getvalue{pbdn-\@@pbk}}}}}%
- \else
- \doifemptyelse
- {\getvalue{\??li pubs\c!width}}
- {\def\@@pblimitednumber##1{\hbox{\@@pbnumbercommand{##1}}}}%
- {\def\@@pblimitednumber##1{\hbox to \getvalue{\??li pubs\c!width}{\@@pbnumbercommand{##1}}}}%
- \fi
- \fi
- \fi
- \ifx\@@pbnumbering\v!no
- \setuplist[pubs][\c!numbercommand=,\c!symbol=\v!none,\c!textcommand=\outdented]%
- \else
- \setuplist[pubs][\c!numbercommand=\@@pblimitednumber]%
- \fi
- \doifelsevalue
- {\??pv data\c!maybeyear}{\v!off}{\def\maybeyear##1{}}{\def\maybeyear##1{##1}}%
- \forgetall} % bugfix 2005/03/18
-
-\def\outdented#1% move to supp-box ?
- {\hskip -\hangindent #1}
-
-%D The full list of publications
-
-\def\completepublications
- {\dosingleempty\docompletepublications}
-
-\def\bibdogetupsometextprefix#1#2#3%
- {\ifcsname#2#1#3\endcsname
- \csname#2#1#3\endcsname
- \else\ifcsname\??la#1\c!default\endcsname
- \@EA\ifx\csname\??la#1\c!default\endcsname\empty
- \ifcsname#2#3\endcsname
- \csname#2#3\endcsname
- \else\ifcsname#2\s!en#3\endcsname
- \csname#2\s!en#3\endcsname
- \fi\fi
- \else
- \expandafter\bibdogetupsometextprefix
- \csname\??la#1\c!default\endcsname{#2}{#3}%
- \fi
- \else
- \ifcsname#2#3\endcsname
- \csname#2#3\endcsname
- \else\ifcsname#2\s!en#3\endcsname
- \csname#2\s!en#3\endcsname
- \fi\fi
- \fi\fi}
-
-\def\docompletepublications[#1]%
- {\begingroup
- \setuplist[pubs][\c!criterium=\v!previous,#1]
- \begingroup
- \let\handletextprefix\firstoftwoarguments
- \edef\headtextpubs{\bibdogetupsometextprefix\headlanguage\c!title{pubs}}%
- \doifdefinedelse
- {\??pv data\v!title}
- {\doifemptyelsevalue
- {\??pv data\v!title}
- {\expanded{\systemsuppliedtitle[pubs]{\headtextpubs}}}%
- {\expanded{\getvalue{\??pv data\v!title}{\headtextpubs}}}%
- }%
- {\expanded{\systemsuppliedtitle[pubs]{\headtextpubs}}}%
- \endgroup
- \dodoplacepublications }
-
-%D And the portion with the entries only.
-
-\def\placepublications
- {\dosingleempty\doplacepublications}
-
-\def\doplacepublications[#1]%
- {%\getparameters[\??pv data][#1]
- \begingroup
- \setuplist[pubs][\c!criterium=\v!previous,#1]%
- \dodoplacepublications }%
-
-\def\dodoplacepublications%
- {\initializepubslist
- \doifelsevalue
- {\??li pubs\c!option}{\v!continue}%
- {}%
- {\global\let\bibcounter\!!zerocount }%
- \inpublisttrue
- \typesetpubslist
- \inpublistfalse
- \endgroup}
-
-%D \subsubject{What's in a publication}
-
-\unexpanded\def\typesetapublication#1%
- {\doifsomething{#1}
- {\doglobal\increment\bibcounter
- \bgroup
- \the\initializebibdefinitions
- \makepbkvalue{#1}%
- \ifgridsnapping
- \snaptogrid\vbox{\dodolistelement{pubs}{}{\bibcounter}%
- {\expanded{\reference[\bibrefprefix#1]{\bibcounter}}%
- \strut \dotypesetapublication{#1}\strut }{}{}}%
- \else
- \dodolistelement{pubs}{}{\bibcounter}%
- {\expanded{\reference[\bibrefprefix#1]{\bibcounter}}%
- \strut \dotypesetapublication{#1}\strut }{}{}%
- \fi
- \egroup}}
-
-\def\dotypesetapublication#1%
- {\bgroup
- \def\@@currentalternative{data}%
- \processcommacommand[\bibcommandlist,crossref]\clearbibitem
- \processcommalist [artauthor,author,editor]\clearbibitemtwo
- \processcommacommand[\bibcommandlist]\bibitemdefs
- \processcommalist [artauthor,author,editor,crossref]\bibitemdefs
- \let\biblanguage\empty
- \getvalue{pbdd-#1}%
- \ifcsname pbdt-#1\endcsname \bibalternative{\getvalue{pbdt-#1}}\fi
- \egroup }
-
-%D An afterthought:
-
-\def\maybeyear#1{}
-
-%D An another:
-
-\def\noopsort#1{}
-
-%D This is the result of bibtex's `language' field.
-
-\def\setbiblanguage#1#2{\setvalue{\??pb @lang@#1}{#2}}
-
-\def\lang#1%
- {\def\biblanguage{#1}%
- \ifcsname \??pb @lang@#1\endcsname
- \expanded{\language[\getvalue{\??pb @lang@#1}]}%
- \fi \ignorespaces}
-
-%D \subject{Citations}
-%D
-%D \macros{cite,bibref}
-%D
-%D The indirection with \type{\dobibref} allows \LATEX\ style
-%D \type{\cite} commands with a braced argument (these might appear
-%D in included data from the \type{.bib} file).
-
-% \unexpanded\def\cite
-% {\doifnextcharelse{[}
-% {\dodocite}
-% {\dobibref}}
-% \def\dobibref#1%
-% {\docite[#1][]}
-% \def\dodocite[#1]%
-% {\startstrictinspectnextcharacter
-% \dodoubleempty\dododocite[#1]}
-% \def\dododocite[#1][#2]{%
-% \stopstrictinspectnextcharacter
-% \docite[#1][#2]}
-
-\unexpanded\def\cite
- {\strictdoifnextoptionalelse\dodocite\dobibref}
-
-\def\dobibref#1%
- {\docite[#1][]}
-
-\def\dodocite[#1]%
- {\strictdoifnextoptionalelse{\docite[#1]}{\docite[#1][]}}
-
-\def\docite[#1][#2]%
- {\begingroup
- \setupinteraction[\c!style=]%
- \edef\temp{#2}%
- \ifx\empty\temp \secondargumentfalse
- \else \secondargumenttrue \fi
- \ifsecondargument
- \processcommalist[#2]\docitation
- \doifassignmentelse
- {#1}%
- {\getparameters[LO][\c!alternative=,\c!extras=,#1]%
- \edef\@@currentalternative{\LOalternative}%
- \ifx\@@currentalternative\empty
- \edef\@@currentalternative{\@@citedefault}%
- \fi
- \ifx\LOextras\empty
- \setupcite[\@@currentalternative][#1]%
- \else
- \expandafter\ifx\csname LOright\endcsname \relax
- \edef\LOextras{{\LOextras\bibalternative\c!right}}%
- \else
- \edef\LOextras{{\LOextras\LOright}}%
- \fi
- \expanded{\setupcite[\@@currentalternative][#1,\c!right=\LOextras]}%
- \fi
- }%
- {\def\@@currentalternative{#1}}%
- \expanded{%
- \processaction[\csname @@pv\@@currentalternative \c!compress\endcsname]}
- [ \v!yes=>\bibcitecompresstrue,
- \v!no=>\bibcitecompressfalse,
- \s!default=>\bibcitecompresstrue,
- \s!unknown=>\bibcitecompresstrue]%
- \getvalue{bib\@@currentalternative ref}[#2]%
- \else
- \processcommalist[#1]\docitation
- \expanded{\processaction[\csname @@pv\@@citedefault \c!compress\endcsname]}
- [ \v!yes=>\bibcitecompresstrue,
- \v!no=>\bibcitecompressfalse,
- \s!default=>\bibcitecompresstrue,
- \s!unknown=>\bibcitecompresstrue]%
- \edef\@@currentalternative{\@@citedefault}%
- \getvalue{bib\@@citedefault ref}[#1]%
- \fi
- \endgroup}
-
-%D \macros{nocite}
-
-\def\nocite[#1]%
- {\processcommalist[#1]\addthisref
- \processcommalist[#1]\docitation }
-
-%D \macros{setupcite}
-
-\def\setupcite{\dodoubleempty\dosetupcite}
-
-\def\dosetupcite[#1][#2]%
- {\ifsecondargument
- \def\dodosetupcite##1{\getparameters[\??pv##1][#2]}%
- \processcommalist[#1]\dodosetupcite
- \else % default case
- \getparameters[\??pv\@@citedefault][#1]%
- \fi }
-
-%D Low-level stuff
-
-\def\getcitedata#1[#2]#3[#4]#5to#6%
- {\bgroup
- \addthisref{#4}%
- \dofetchapublication{#4}%
- \doifdefinedelse{@@pb@bib#2}%
- {\xdef#6{\getvalue{@@pb@bib#2}}}%
- {\xdef#6{\getvalue{@@pb@#2}}}%
- \egroup}
-
-\def\dofetchapublication#1%
- {\makepbkvalue{#1}%
- \processcommacommand[\bibcommandlist,crossref]\clearbibitem
- \processcommalist [artauthor,author,editor]\clearbibitemtwo
- \processcommacommand[\bibcommandlist]\bibitemdefs
- \processcommalist [artauthor,author,editor,crossref]\bibitemdefs
- \getvalue{pbdd-#1}}
-
-%D This new version writes a reference out to the tui file for every
-%D \type{\cite}. This will allow backlinking.
-%D
-%D Some special care is needed so that references are not added from
-%D weird locations like in the TOC or within a \type{\setbox} command.
-
-\newcounter\citationnumber
-
-\def\docitation#1{%
- \iftrialtypesetting \else
- \ifdoinpututilities\else
- \doglobal\increment\citationnumber
- \expanded{\rawreference{}{cite-\jobname-\citationnumber}{#1}}%
- \fi \fi }
-
-%D \macros{numreferred,doifreferredelse,addthisref,publist}
-%D
-%D The interesting command here is \type{\addthisref}, which maintains
-%D the global list of references.
-%D
-%D \type{\numreferred} is needed to do automatic calculations on
-%D the label width, and \type{\doifreferredelse} will be used
-%D to implement \type{criterium=cite}.
-
-\newcounter\numreferred
-
-\long\def\doifreferredelse#1{\doifdefinedelse{pbr-#1}}
-
-\def\addthisref#1%
- {\doifundefinedelse{pbr-#1}
- {\setxvalue{pbr-#1}{\citationnumber}%
- \doglobal\increment\numreferred
- \ifx\publist\empty \gdef\publist{#1}\else\appended\gdef\publist{,#1}\fi}
- {\setxvalue{pbr-#1}{\getvalue{pbr-#1},\citationnumber}}}
-
-\let\publist\empty
-
-%D \macros{doifbibreferencefoundelse}
-%D
-%D Some macros to fetch the information provided by
-%D \type{\startpublication}.
-
-\def\doifbibreferencefoundelse#1%
- {\preloadbiblist
- \doifdefinedelse{pbdk-#1}
- {\firstoftwoarguments}
- {\showmessage\m!publications{5}{#1 is unknown}%
- \secondoftwoarguments}}
-
-%D \macros{ixbibauthoryear,thebibauthors,thebibyears}
-%D
-%D If compression of \type{\cite}'s argument expansion is on,
-%D the macros that deal with authors and years call this internal
-%D command to do the actual typesetting.
-%D
-%D Two entries with same author but with different years may
-%D be condensed into ``Author (year1,year2)''. This is about the
-%D only optimization that makes sense for the (author,year)
-%D style of citations (years within one author have to be unique
-%D anyway so no need to test for that, and ``Author1, Author2 (year)''
-%D creates more confusion than it does good).
-%D
-%D In the code below,
-%D the macro \type{\thebibauthors} holds the names of the alternative
-%D author info fields for the current list. This is a commalist,
-%D and \type{\thebibyears} holds the (collection of) year(s) that go with
-%D this author (possibly as a nested commalist).
-%D
-%D There had better be an author for all cases, but there
-%D does not have to be year info always. \type{\thebibyears} is
-%D pre-initialized because this makes the insertion macros simpler.
-%D
-%D In `normal' \TeX, of course there are expansion problems again.
-
-\def\ixbibauthoryear#1#2#3#4%
- {\bgroup
- \gdef\ixlastcommand {#4}%
- \gdef\ixsecondcommand{#3}%
- \gdef\ixfirstcommand {#2}%
- \glet\thebibauthors \empty
- \glet\thebibyears \empty
- \getcommalistsize[#1]%
- \ifbibcitecompress
- \dorecurse\commalistsize{\xdef\thebibyears{\thebibyears,}}%
- \processcommalist[#1]\docompressbibauthoryear
- \else
- \processcommalist[#1]\donormalbibauthoryear
- \fi
- \egroup
- \dobibauthoryear}
-
-%D \macros{dodobibauthoryear}
-%D
-%D This macro only has to make sure that the lists
-%D \type{\thebibauthors} and \type{\thebibyears} are printed.
-
-\def\dobibauthoryear
- {\scratchcounter\zerocount
- \getcommacommandsize[\thebibauthors]%
- \edef\authorcount{\commalistsize}%
- \@EA\processcommalist\@EA[\thebibauthors]\dodobibauthoryear}
-
-\def\dodobibauthoryear#1%
- {\advance\scratchcounter\plusone
- \edef\wantednumber{\the\scratchcounter}%
- \getfromcommacommand[\thebibyears][\wantednumber]%
- \@EA\def\@EA\currentbibyear\@EA{\commalistelement}%
- \setcurrentbibauthor{#1}%
- \ifnum\scratchcounter=\plusone
- \ixfirstcommand
- \else\ifnum \scratchcounter=\authorcount\relax
- \ixlastcommand
- \else
- \ixsecondcommand
- \fi\fi}
-
-\def\setcurrentbibauthor#1%
- {\getcommacommandsize[#1]%
- \ifcase\commalistsize
- % anonymous?
- \def\currentbibauthor{}%
- \or
- \def\currentbibauthor{#1}%
- \or
- \expanded{\docurrentbibauthor#1}%
- \else
- \handlemultiplebibauthors{\commalistsize}{#1}%
- \fi }
-
-\newcount\citescratchcounter
-
-\def\handlemultiplebibauthors#1#2%
- {\citescratchcounter 0
- \def\currentbibauthor{}%
- \def\bibprocessauthoritem##1%
- {\advance\citescratchcounter1
- \ifnum \citescratchcounter=#1\relax
- \edef\currentbibauthor{\currentbibauthor##1}%
- \else \ifnum\numexpr\citescratchcounter+1 = #1\relax
- \edef\currentbibauthor{\currentbibauthor ##1\bibalternative{andtext}}%
- \else
- \edef\currentbibauthor{\currentbibauthor ##1\bibalternative{namesep}}%
- \fi
- \fi }%
- \processcommalist[#2]\bibprocessauthoritem }
-
-\setupcite
- [author,authoryear,authoryears]
- [\c!namesep={, }]
-
-%D This discovery of authoretallimit is not the best one,
-%D but it will do for now.
-
-\def\docurrentbibauthor#1,#2%
- {\doifemptyelse{#2}
- {\def\currentbibauthor{#1\bibalternative{otherstext}}}
- {\@EA
- \ifx\csname \??pv\@@currentalternative authoretallimit\endcsname\relax
- \edef\currentbibauthor{#1\bibalternative{andtext}#2}%
- \else
- \edef\currentbibauthor{#1%
- \ifcase0\bibalternative{authoretallimit}\relax\or
- \bibalternative{otherstext}\else\bibalternative{andtext}#2\fi}%
- \fi}}
-
-%D This is not the one Hans made for me, because I need a global
-%D edef, and the \type{\robustdoifinsetelse} doesn't listen to
-%D \type{\doglobal }
-
-\def\robustaddtocommalist#1#2% {item} \cs
- {\robustdoifinsetelse{#1}#2\resetglobal
- {\dodoglobal\xdef#2{\ifx#2\empty\else#2,\fi#1}}}
-
-%D \macros{donormalbibauthoryear}
-%D
-%D Now we get to the macros that fill the two lists.
-%D The `simple' one really is quite simple.
-
-\def\donormalbibauthoryear#1%
- {\addthisref{#1}%
- \def\myauthor{Xxxxxxxxxx}%
- \def\myyear{0000}%
- \doifbibreferencefoundelse{#1}
- {\def\myauthor{{\getvalue{pbda-#1}}}%
- \def\myyear {\getvalue{pbdy-#1}}}%
- {}%
- \@EA\doglobal\@EA\appendtocommalist\@EA{\myauthor}\thebibauthors
- \@EA\doglobal\@EA\appendtocommalist\@EA{\myyear }\thebibyears}
-
-%D \macros{docompressbibauthoryear}
-%D
-%D So much for the easy parts. Nothing at all will be done if
-%D the reference is not found or the reference does not contain
-%D author data. No questions marks o.s.s. (to be fixed later)
-
-\def\docompressbibauthoryear#1%
- {\addthisref{#1}%
- \def\myauthor{Xxxxxxxxxx}%
- \def\myyear {0000}%
- \doifbibreferencefoundelse{#1}
- {\xdef\myauthor{\csname pbda-#1\endcsname }%
- \xdef\myyear {\csname pbdy-#1\endcsname }}
- {}%
- \ifx\myauthor\empty\else
- \checkifmyauthoralreadyexists
- \findmatchingyear
- \fi}
-
-%D two temporary counters. One of these two can possibly be replaced
-%D by \type{\scratchcounter}.
-
-\newcount\bibitemcounter
-\newcount\bibitemwanted
-
-%D The first portion is simple enough: if this is the very first author
-%D it is quite straightforward to add it. \type{\bibitemcounter} and
-%D \type{\bibitemwanted} are needed later to insert the year
-%D information in the correct item of \type{\thebibyears}
-
-\def\checkifmyauthoralreadyexists
- {\doifemptyelsevalue{thebibauthors}
- {\global\bibitemwanted \plusone
- \global\bibitemcounter \plusone
- \xdef\thebibauthors{{\myauthor}}}
- {% the next weirdness is because according to \getcommalistsize,
- % the length of \type{[{{},{}}]} is 2.
- \@EA\getcommalistsize\@EA[\thebibauthors,]%
- \global\bibitemcounter\commalistsize
- \global\advance\bibitemcounter\minusone
- \global\bibitemwanted \zerocount
- \processcommacommand[\thebibauthors]\docomparemyauthor}}
-
-%D The outer \type{\ifnum} accomplishes the addition of
-%D a new author to \type{\thebibauthors}. The messing about with
-%D the two counters is again to make sure that \type{\thebibyears}
-%D will be updated correctly.If the author {\it was} found,
-%D the counters will stay at their present values and everything
-%D will be setup properly to insert the year info.
-
-\def\docomparemyauthor#1%
- {\global\advance\bibitemwanted \plusone
- \def\mytempc{#1}%
-% \message{authors: \myauthor <=>\mytempc \ifx\mytempc\myauthor :Y \else :N
-% \meaning \myauthor, \meaning\mytempc\fi (\the\bibitemwanted = \the\bibitemcounter)}%
- \ifx\mytempc\myauthor
- \quitcommalist
- \else
- \ifnum\bibitemwanted = \bibitemcounter\relax
- \global\advance\bibitemwanted \plusone
- \global\bibitemcounter\bibitemwanted\relax
- \@EA\doglobal\@EA\robustaddtocommalist\@EA{{\myauthor}}\thebibauthors
- \fi
- \fi}
-
-%D This macro should be clear now.
-
-\def\findmatchingyear
- {\edef\wantednumber{\the\bibitemwanted}%
- \getfromcommacommand[\thebibyears][\wantednumber]%
- \ifx\commalistelement\empty
- \edef\myyear{{\myyear}}%
- \else
- \edef\myyear{{\commalistelement, \myyear}}%
- \fi
- \edef\newcommalistelement{\myyear}%
- \doglobal\replaceincommalist \thebibyears \wantednumber}
-
-%D \macros{preparebibrefprefix}
-%D
-%D The reference list only writes bare references when the criterium
-%D is `all'. Otherwise, a prefix is added to make sure that pdfTeX
-%D does not encounter duplicate named references. On the generation
-%D side, this is not a big problem. \type{\preparebibrefprefix}
-%D creates a suitable string to prepend if a prefix is needed.
-%D
-%D Because this macro is used within \type{\cite } that itself
-%D can be used within lists like the table of contents, it needs
-%D to save and restore \type{\savedalltoclevels} and
-%D \type{\currentlevel} (\type{\dosetfilterlevel} needs to change
-%D their values globally).
-
-\def\preparebibrefprefix
- {\chardef\savedalltoclevels \alltoclevels
- \let\savedcurrentlevel\currentlevel
- \let\dosetfilterlevel\patcheddosetfilterlevel
- \dosettoclevel\??li{pubs}%
- \edef\bibrefprefix{\@@sectiontype\currentlevel\sectionseparator}%
- \let\dosetfilterlevel\normaldosetfilterlevel
- \global\let\currentlevel\savedcurrentlevel
- \global\chardef\alltoclevels \savedalltoclevels }
-
-%D \macros{preparebibreflist}
-%D
-%D But this optional prefixing is a bit of a problem on the
-%D other side. We would like to do \type{\goto{}[article-full]}
-%D but can't do it like that, because the actual label may be
-%D \type{1:2:0:3:4:article-full]} or so. The problem is solved
-%D by building a commalist that looks like this:
-%D \starttyping
-%D \def\bibreflist%
-%D {1:2:0:3:4:article-full,
-%D 1:2:0:3:article-full,
-%D 1:2:0:article-full,
-%D 1:2:article-full,
-%D 1:article-full,
-%D article-full}
-%D \stoptyping
-
-\def\preparebibreflist#1%
- {\let\bibreflist\empty
- \def\storeitem##1%
- {\ifx\bibreflist\empty
- \edef\prefix{##1\sectionseparator}%
- \edef\bibreflist{\prefix#1,#1}%
- \else
- \edef\prefix{\prefix##1\sectionseparator}%
- \edef\bibreflist{\prefix#1,\bibreflist}%
- \fi}%
- \expanded{\processseparatedlist[\bibrefprefix][\sectionseparator]}\storeitem }
-
-%D \macros{gotobiblink,inbiblink,atbiblink}
-%D
-%D The final task is looping over that list until a match is found.
-
-\newif\ifbibreffound
-
-\def\gotobiblink#1[#2]%
- {\bgroup
- \preparebibrefprefix
- \preparebibreflist{#2}%
- \global\bibreffoundfalse
- \def\setuplink##1%
- {\ifbibreffound\else
- \doifreferencefoundelse
- {##1}
- {\global\bibreffoundtrue \goto{#1}[##1]}%
- {}\fi}%
- \processcommacommand[\bibreflist]\setuplink
- \ifbibreffound \else \unknownreference{#2}\fi
- \egroup }
-
-\def\atbiblink[#1]%
- {\bgroup
- \preparebibrefprefix
- \preparebibreflist{#1}%
- \global\bibreffoundfalse
- \def\setuplink##1%
- {\ifbibreffound\else
- \doifreferencefoundelse
- {##1}
- {\global\bibreffoundtrue \at[##1]}%
- {}\fi}%
- \processcommacommand[\bibreflist]\setuplink
- \ifbibreffound \else \unknownreference{#1}\fi
- \egroup }
-
-\def\inbiblink[#1]%
- {\bgroup
- \preparebibrefprefix
- \preparebibreflist{#1}%
- \global\bibreffoundfalse
- \def\setuplink##1%
- {\ifbibreffound\else
- \doifreferencefoundelse
- {##1}
- {\global\bibreffoundtrue \in[##1]}%
- {}\fi}%
- \processcommacommand[\bibreflist]\setuplink
- \ifbibreffound \else \unknownreference{#1}\fi
- \egroup }
-
-%D \macros{bibauthoryearref,bibauthoryearsref,bibauthorref,bibyearref}
-%D
-%D Now that all the hard work has been done, these are simple.
-%D \type{\ixbibauthoryearref} stores the data in the macros
-%D \type{\currentbibauthor} and \type{\currentbibyear}.
-
-\def\ifbibinteractionelse%
- {\iflocation
- \edef\test{\bibalternative\c!interaction}%
- \ifx\test\v!stop
- \@EA\@EA\@EA\secondoftwoarguments
- \else
- \@EA\@EA\@EA\firstoftwoarguments
- \fi
- \else
- \@EA\secondoftwoarguments
- \fi
- }
-
-\def\bibmaybeinteractive#1#2%
- {\ifbibcitecompress #2\else
- \ifbibinteractionelse{\gotobiblink{#2}[#1]}{#2}\fi }
-
-\def\bibauthoryearref[#1]%
- {\ixbibauthoryear{#1}%
- {\bibmaybeinteractive{#1}{{\currentbibauthor}\bibalternative\c!inbetween
- \bibalternative\v!left{\currentbibyear}\bibalternative\v!right}}
- {\bibalternative\c!pubsep
- \bibmaybeinteractive{#1}{{\currentbibauthor}\bibalternative\c!inbetween
- \bibalternative\v!left {\currentbibyear}\bibalternative\v!right}}
- {\bibalternative\c!lastpubsep
- \bibmaybeinteractive{#1}{{\currentbibauthor}\bibalternative\c!inbetween
- \bibalternative\v!left {\currentbibyear}\bibalternative\v!right}}}
-
-\def\bibauthoryearsref[#1]%
- {\bibalternative\v!left
- \ixbibauthoryear{#1}
- {\bibmaybeinteractive{#1}{{\currentbibauthor}\bibalternative\c!inbetween{\currentbibyear}}}
- {\bibalternative\c!pubsep
- \bibmaybeinteractive{#1}{{\currentbibauthor}\bibalternative\c!inbetween{\currentbibyear}}}
- {\bibalternative\c!lastpubsep
- \bibmaybeinteractive{#1}{{\currentbibauthor}\bibalternative\c!inbetween{\currentbibyear}}}%
- \bibalternative\v!right}
-
-\def\bibauthorref[#1]%
- {\bibalternative\v!left
- \ixbibauthoryear{#1}%
- {\bibmaybeinteractive{#1}{{\currentbibauthor}}}
- {\bibalternative\c!pubsep \bibmaybeinteractive{#1}{{\currentbibauthor}}}
- {\bibalternative\c!lastpubsep\bibmaybeinteractive{#1}{{\currentbibauthor}}}%
- \bibalternative\v!right}
-
-\def\bibyearref[#1]%
- {\bibalternative\v!left
- \ixbibauthoryear{#1}%
- {\bibmaybeinteractive{#1}{{\currentbibyear}}}
- {\bibalternative\c!pubsep \bibmaybeinteractive{#1}{{\currentbibyear}}}
- {\bibalternative\c!lastpubsep\bibmaybeinteractive{#1}{{\currentbibyear}}}%
- \bibalternative\v!right}
-
-%D ML problems:
-
-%D \macros{bibshortref,bibkeyref,bibpageref,bibtyperef,bibserialref}
-%D
-%D There is hardly any point in trying to compress these. The only
-%D thing that needs to be done is making sure that
-%D the separations are inserted correctly. And that is
-%D what \type{\refsep} does.
-
-\newif\iffirstref
-
-\def\refsep{\iffirstref\firstreffalse\else\bibalternative\c!pubsep\fi}
-
-\def\bibshortref[#1]%
- {\bibalternative\v!left
- \firstreftrue\processcommalist[#1]\dobibshortref
- \bibalternative\v!right}
-
-\def\dobibshortref#1%
- {\addthisref{#1}\refsep
- \doifbibreferencefoundelse{#1}{\gotobiblink{\getvalue{pbds-#1}}[#1]}
- {\unknownreference{#1}}}
-
-
-\def\bibserialref[#1]%
- {\bibalternative\v!left
- \firstreftrue\processcommalist[#1]\dobibserialref
- \bibalternative\v!right}
-
-\def\dobibserialref#1%
- {\addthisref{#1}\refsep
- \doifbibreferencefoundelse{#1}{\gotobiblink{\getvalue{pbdn-#1}}[#1]}
- {\unknownreference{#1}}}
-
-\def\bibkeyref[#1]%
- {\bibalternative\v!left
- \firstreftrue\processcommalist[#1]\dobibkeyref
- \bibalternative\v!right}
-
-\def\dobibkeyref#1%
- {\addthisref{#1}\refsep\gotobiblink{#1}[#1]}
-
-\def\gotoDOI#1#2%
- {\ifbibinteractionelse
- {\useURL[bibfooDoi#1][#2]%
- \useURL[bibfoo#1][http://dx.doi.org/#2]%
- \goto{\url[bibfooDoi#1]}[url(bibfoo#1)]}
- {\hyphenatedurl{#2}}}
-
-\def\bibdoiref[#1]%
- {\bibalternative\v!left
- \firstreftrue\processcommalist[#1]\dobibdoiref
- \bibalternative\v!right}
-
-\def\dobibdoiref#1%
- {\addthisref{#1}\refsep
- \doifbibreferencefoundelse{#1}{\expanded{\gotoDOI{#1}{\getvalue{pbdo-#1}}}}
- {\unknownreference{#1}}}
-
-\def\biburlref[#1]%
- {\bibalternative\v!left
- \firstreftrue\processcommalist[#1]\dobiburlref
- \bibalternative\v!right}
-
-\def\gotoURL#1#2%
- {\ifbibinteractionelse
- {\useURL[bibfoo#1][#2]\goto{\url[bibfoo#1]}[url(bibfoo#1)]}
- {\hyphenatedurl{#2}}}
-
-\def\dobiburlref#1%
- {\addthisref{#1}\refsep
- \doifbibreferencefoundelse{#1}{\expanded{\gotoURL{#1}{\getvalue{pbdu-#1}}}}
- {\unknownreference{#1}}}
-
-\def\bibtyperef[#1]%
- {\bibalternative\v!left
- \firstreftrue\processcommalist[#1]\dobibtyperef
- \bibalternative\v!right}
-
-\def\dobibtyperef#1%
- {\addthisref{#1}\refsep
- \doifbibreferencefoundelse{#1}{\gotobiblink{\getvalue{pbdt-#1}}[#1]}
- {\unknownreference{#1}}}
-
-\def\bibpageref[#1]%
- {\bibalternative\v!left
- \firstreftrue\processcommalist[#1]\dobibpageref
- \bibalternative\v!right}
-
-\def\dobibpageref#1%
- {\addthisref{#1}\refsep
- \ifbibinteractionelse{\atbiblink[#1]}{{\referencingfalse\at[#1]}}}
-
-\def\bibdataref[#1]%
- {\bibalternative\v!left
- \firstreftrue\processcommalist[#1]\dobibdata
- \bibalternative\v!right}
-
-\def\dobibdata#1%
- {\addthisref{#1}\refsep
- \doifbibreferencefoundelse{#1}{\dotypesetapublication{#1}}
- {\unknownreference{#1}}}
-
-\let\bibnoneref\nocite
-
-%D \macros{bibnumref}
-%D
-%D It makes sense to try and compress the argument list of
-%D \type{\bibnumref}. There are two things involved: the actual
-%D compression, and a sort routine. The idea is to store the
-%D found values in a new commalist called \type{\therefs}.
-
-%D But that is not too straight-forward, because \type{\in} is
-%D not expandable,
-%D so that the macro \type{\expandrefs} is needed.
-
-\def\expandrefs#1%
- {\bgroup
- \preparebibrefprefix
- \preparebibreflist{#1}%
- \global\bibreffoundfalse
- \def\setuplink##1%
- {\ifbibreffound\else
- \doifreferencefoundelse
- {##1}
- {\global\bibreffoundtrue
- \@EA\doglobal\@EA\addtocommalist\@EA{\reftypet}\therefs }%
- {}\fi}%
- \processcommacommand[\bibreflist]\setuplink
- \ifbibreffound \else \showmessage\m!publications{5}{#1 unknown}%
- \doglobal\addtocommalist{0}\therefs\fi
- \egroup }
-
-%D But at least the actual sorting code is simple (note that sorting
-%D a list with exactly one entry fails to return anything, which
-%D is why the \type{\ifx} is needed).
-
-\def\bibnumref[#1]%
- {\bibalternative\v!left
- \penalty\!!tenthousand
- \processcommalist[#1]\addthisref
- \firstreftrue
- \ifbibcitecompress
- \glet\therefs\empty
- \processcommalist[#1]\expandrefs
- \sortcommacommand[\therefs]\donumericcompare
- \ifx\empty\sortedcommalist\else
- \let\therefs\sortedcommalist
- \fi
- \compresscommacommandnrs[\therefs]%
- \processcommacommand[\compressedlist]\verysimplebibnumref
- \else
- \processcommalist[#1]\dosimplebibnumref
- \fi
- \bibalternative\v!right}
-
-\def\dosimplebibnumref #1%
- {\refsep\ifbibinteractionelse
- {\inbiblink[#1]}{{\referencingfalse\inbiblink[#1]}}}
-
-\def\verysimplebibnumref#1{\doverysimplebibnumref#1}
-
-\def\doverysimplebibnumref#1#2%
- {\refsep
- \ifcase#1\relax \unknownreference{#1}\else
- \def\tempa{#2}\ifx\empty\tempa#1\else#1\bibalternative\c!inbetween#2\fi
- \fi}
-
-%D By request from Sanjoy. This makes it easier to implement
-%D \type{\citeasnoun}.
-
-\def\bibauthornumref[#1]%
- {\getcommalistsize[#1]%
- \global\bibitemcounter\commalistsize
- \firstreftrue
- \processcommalist[#1]\dobibauthornumref }
-
-\def\dobibauthornumref#1%
- {\addthisref{#1}\refsep
- \doifbibreferencefoundelse{#1}
- {\getvalue{pbda-#1}%
- \bibalternative\c!inbetween
- \bibalternative\v!left
- \ifbibinteractionelse{\inbiblink[#1]}
- {{\referencingfalse\inbiblink[#1]}}%
- \bibalternative\v!right}
- {\unknownreference{#1}}}
-
-%D And some defaults are loaded from bibl-apa:
-
-\setuppublications
- [\v!month\v!conversion=,
- \c!alternative=apa]
-
-\appendtoks
- \preloadbiblist
-\to \everystarttext
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/buff-ini.mkii b/Master/texmf-dist/tex/context/base/mkii/buff-ini.mkii
deleted file mode 100644
index 7fdb89e45cd..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/buff-ini.mkii
+++ /dev/null
@@ -1,348 +0,0 @@
-%D \module
-%D [ file=buff-ini, % was core-buf % blocks are moved to core-blk
-%D version=2000.01.05,
-%D title=\CONTEXT\ Buffer Macros,
-%D subtitle=Buffers,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Buffer Macros / Buffers}
-
-\unprotect
-
-% Helpers:
-
-\chardef\buffernestmode\plusone % 0: not nested, 1: startbuffer nested, 2: all buffers nested
-
-\edefconvertedargument\emptybufferline{ }
-
-\ifx\tmpblocks\undefined \newwrite\tmpblocks \fi
-
-\newif\iftmpblockstarted
-
-\long\def\flushbufferline#1%
- {\iftmpblockstarted
- \ifsegmentatebuffer
- \ifemptybufferline
- \immediate\write\tmpblocks{\string\stopbufferparagraph }%
- \immediate\write\tmpblocks{\string\startbufferparagraph}%
- \else
- \immediate\write\tmpblocks{#1}%
- \fi
- \else
- \immediate\write\tmpblocks{#1}%
- \fi
- \else
- \doifsomething{#1}
- {\tmpblockstartedtrue
- \immediate\write\tmpblocks{\string#1}}%
- \fi}
-
-\long\def\processnextbufferlineA#1%
- {\relax % checken waarom eerdere macro dit nodig heeft / supp-mps run
- \defconvertedargument\next{#1 }%
- \doifinstringelse{\delcharacter\letterpercent}{\delcharacter\next}
- {\secondoftwoarguments}
- {\doifincsnameelse\endofblock\next
- {\ifnum\nestedbufferlevel=\zerocount
- \expandafter\firstoftwoarguments
- \else
- \decrement\nestedbufferlevel\relax
- \expandafter\secondoftwoarguments
- \fi}
- {\doifincsnameelse\beginofblock\next
- {\increment\nestedbufferlevel\relax
- \secondoftwoarguments}
- {\secondoftwoarguments}}}}
-
-\long\def\processnextbufferlineB#1% #2#3%
- {\defconvertedargument\next{#1 }%
- \ifx\next\emptybufferline
- \ifsegmentatebuffer \emptybufferlinetrue \fi
- \expandafter\secondoftwoarguments% #3%
- \else
- \emptybufferlinefalse
- \doifinstringelse\endofblock\next
- {\expandafter\firstoftwoarguments }% #2}
- {\expandafter\secondoftwoarguments}% #3}%
- \fi}
-
-\bgroup
-\obeylines
-\long\gdef\copybufferline#1
- {\processnextbufferline{#1}\closebufferfile{\flushbufferline{#1}\copybufferline}}
-\egroup
-
-\newif\ifsegmentatebuffer
-\newif\ifemptybufferline
-
-\def\currentbuffer{\jobname}
-
-\def\setcurrentbuffer#1%
- {\doifelsenothing{#1}{\edef\currentbuffer{\jobname}}{\edef\currentbuffer{#1}}}
-
-\def\resetbuffer
- {\dosingleempty\doresetbuffer}
-
-\def\doresetbuffer[#1]%
- {\begingroup
- \setcurrentbuffer{#1}%
- \unlinkfile{\TEXbufferfile\currentbuffer}%
- \endgroup}
-
-\def\dostartbuffer
- {\bgroup
- \obeylines % nodig, anders gaat 't fout als direct \starttable (bv)
- \doquadrupleempty\dodostartbuffer}
-
-\def\dodostartbuffer[#1][#2][#3][#4]% upward compatible
- {\iffourthargument
- \def\next{\dododostartbuffer{#1}{#2}{#3}{#4}}%
- \else
- \def\next{\dododostartbuffer {}{#1}{#2}{#3}}%
- \fi
- \next}
-
-\def\dododostartbuffer#1#2#3#4%
- {%\showmessage\m!systems{15}{#2}%
- \doifelsevalue{\??bu#1\c!paragraph}\v!yes
- {\segmentatebuffertrue} % todo in mkiv
- {\doifnumberelse{\getvalue{\??bu#1\c!paragraph}}\segmentatebuffertrue\segmentatebufferfalse}%
- \doifvalue{\??bu#1\c!local}\v!yes
- {\chardef\buffernestmode\plustwo}% permit nesting
- \setcurrentbuffer{#2}%
- \doifelsenothing{#4}
- {\letbeundefined{\e!stop\v!buffer}% % \let\stopbuffer=\relax % \undefined
- \edefconvertedargument\beginofblock{\e!start\v!buffer}%
- \edefconvertedargument\endofblock {\e!stop \v!buffer}%
- \ifcase\buffernestmode
- \let\processnextbufferline\processnextbufferlineB
- \else
- \let\processnextbufferline\processnextbufferlineA
- \fi}
- {\letbeundefined{#4}% \letvalue{#4}=\relax % \undefined
- \expandafter\defconvertedargument\expandafter\beginofblock\expandafter{\csname#3\endcsname}% we could use defconvertedcommand here (no \expandafter)
- \expandafter\defconvertedargument\expandafter\endofblock \expandafter{\csname#4\endcsname}% we could use defconvertedcommand here (no \expandafter)
- \ifcase\buffernestmode
- \let\processnextbufferline\processnextbufferlineB
- \or
- \let\processnextbufferline\processnextbufferlineB
- \else
- \let\processnextbufferline\processnextbufferlineA
- \fi}%
- \def\closebufferfile
- {\ifsegmentatebuffer
- \immediate\write\tmpblocks{\string\stopbufferparagraph}%
- \fi
- \immediate\closeout\tmpblocks
- \egroup
- \getvalue{#4}}%
- \doifelsenothing{#2}
- {\edef\bufferfilename{\TEXbufferfile\jobname}}%
- {\edef\bufferfilename{\TEXbufferfile{#2}}}%
- \immediate\openout\tmpblocks\bufferfilename
- \ifsegmentatebuffer
- \immediate\write\tmpblocks{\string\startbufferparagraph}%
- \fi
- \newcounter\nestedbufferlevel
- \recatcodeuppercharacterstrue
- \setcatcodetable\vrbcatcodes
- \obeylines
- \copybufferline}
-
-\letvalue{\e!start\v!buffer}\dostartbuffer
-
-\let\endbuffer\undefined % to please the dep parser
-
-\def\setbuffer
- {\dosingleempty\dosetbuffer}
-
-\long\def\dosetbuffer[#1]#2\endbuffer % seldom used so we just pass #2
- {\begingroup
- \setcurrentbuffer{#1}%
- \edef\bufferfilename{\TEXbufferfile{\currentbuffer}}%
- \immediate\openout\tmpblocks\bufferfilename
- \defconvertedargument\ascii{#2}%
- \immediate\write\tmpblocks{\ascii}%
- \immediate\closeout\tmpblocks
- \endgroup}
-
-\def\setupbuffer
- {\dodoubleempty\dosetupbuffer}
-
-\def\dosetupbuffer[#1][#2]%
- {\ifsecondargument
- \getparameters[\??bu#1][#2]%
- \else
- \getparameters[\??bu][#1]%
- \fi}
-
-\def\dodefinebuffer[#1][#2]%
- {\iffirstargument % else problems
- \doglobal\increment\nofdefinedbuffers
- \letvalue{\??bu#1\c!number }\nofdefinedbuffers
- \letvalue{\??bu#1\c!paragraph}\v!no
- \setevalue{\e!start#1}{\noexpand\dostartbuffer[#1][def-\nofdefinedbuffers][\e!start#1][\e!stop#1]}%
- \unexpanded\setevalue{\e!get #1}{\noexpand\dogetbuffer [#1][def-\nofdefinedbuffers]}%
- \unexpanded\setevalue{\e!type #1}{\noexpand\dotypebuffer [#1][def-\nofdefinedbuffers]}%
- \getparameters[\??bu#1][#2]%
- \fi}
-
-\def\definebuffer
- {\dodoubleempty\dodefinebuffer}
-
-\unexpanded\def\getbuffer
- {\dodoubleempty\dogetbuffer}
-
-\def\dogetbuffer[#1][#2]%
- {\ifsecondargument
- \dodogetbuffer[#1][#2]%
- \else
- \dodogetbuffer[][#1]%
- \fi}
-
-\def\dogetbufferasis{\readjobfile{\TEXbufferfile{\currentbuffer}}\donothing\donothing}%
-
-\def\dodogetbuffer[#1][#2]%
- {\getvalue{\??bu#1\c!before}%
- \dobuffer{16}{#2}\dogetbufferasis
- \getvalue{\??bu#1\c!after}}
-
-\unexpanded\def\typebuffer
- {\dodoubleempty\dotypebuffer}
-
-\def\dogetfilebuffer{\typefile{\TEXbufferfile{\currentbuffer}}}
-
-\def\dotypebuffer[#1][#2]%
- {\iffirstargument
- \dobuffer{17}{#1}\dogetfilebuffer
- \else
- \dobuffer{17}{#2}\dogetfilebuffer
- \fi}
-
-\def\dobuffer#1#2#3%
- {\doifelsenothing{#2}
- {\dodobuffer#3\jobname}
- {\processcommalist[#2]{\dodobuffer#3}}}
-
-\def\dodobuffer#1#2% command name
- {\pushmacro\currentbuffer
- \edef\currentbuffer{\ifcsname\??bu#2\c!number\endcsname def-\csname\??bu#2\c!number\endcsname\else#2\fi}%
- \beginrestorecatcodes
- #1%
- \endrestorecatcodes
- \popmacro\currentbuffer}
-
-\def\processTEXbuffer{\getbuffer} % handy
-
-% seldom used, only in a few projects that demanded more speed
-
-\def\dostartmemorybuffer
- {\dosingleempty\dostartmemorybuffer}
-
-\long\def\dostartmemorybuffer[#1]#2\stopbuffer
- {\setbuffer[#1]#2\endbuffer}
-
-\let\dostartfilebuffer\startbuffer
-
-\def\usememorybuffers{\let\startbuffer\dostartmemorybuffer}
-\def\usefilebuffers {\let\startbuffer\dostartfilebuffer}
-
-% this features is soldom used (complex examns where we need to fetch
-% special parts of a text
-%
-% this is not yet supported in mkiv (relatively easy to do but there
-% we don't have the par tags but need to grab 'm
-
-\def\skippedbufferparagraphs{0}
-
-\let\startbufferparagraph\relax
-\let\stopbufferparagraph \par % \relax
-
-\newcount\currentbufferparagraph
-
-\def\getbufferparagraphs
- {\dodoubleempty\dogetbufferparagraphs}
-
-\def\dosetbufferoffset#1%
- {\doifnumberelse{\getvalue{\??bu#1\c!paragraph}}
- {\currentbufferparagraph-\getvalue{\??bu#1\c!paragraph}}
- {\currentbufferparagraph \zerocount}%
- \relax}
-
-\def\dogetbufferparagraphs[#1][#2]%
- {\iffirstargument
- \ifsecondargument
- \dosetbufferoffset{#1}%
- \doifelse{#2}\v!all
- {\def\startbufferparagraph{\normalbufferparagraph{#1}}}
- {\def\startbufferparagraph{\filterbufferparagraph{#1}{#2}}}%
- \def\stopbufferparagraph{\dostopbufferparagraph{#1}}%
- \def\next{\getparagraphedbuffer[#1]}%
- \else
- \dosetbufferoffset\empty
- \def\startbufferparagraph{\filterbufferparagraph{}{#1}}%
- \def\stopbufferparagraph{\dostopbufferparagraph{}}%
- \def\next{\getparagraphedbuffer[]}%
- \fi
- \else
- \dosetbufferoffset\empty
- \def\startbufferparagraph{\normalbufferparagraph{}}%
- \def\stopbufferparagraph{\dostopbufferparagraph{}}%
- \def\next{\getparagraphedbuffer[]}%
- \fi
- \next}
-
-\def\dogetparagraphbuffer{\readjobfile{\TEXbufferfile{\currentbuffer}}\donothing\donothing}
-
-\def\getparagraphedbuffer[#1]%
- {\dobuffer{16}{#1}\dogetparagraphbuffer}
-
-\def\dostopbufferparagraph#1%
- {\getvalue{\??bu#1\c!after}\par}
-
-\def\dostartbufferparagraph#1%
- {\par\getvalue{\??bu#1\c!before}}
-
-\def\normalbufferparagraph
- {\advance\currentbufferparagraph \plusone
- \ifnum\currentbufferparagraph>\zerocount
- \expandafter\dostartbufferparagraph
- \else
- \expandafter\gobblebufferparagraph
- \fi}
-
-\def\filterbufferparagraph#1#2%
- {\advance\currentbufferparagraph \plusone
- \ifcase\currentbufferparagraph
- \expandafter\gobblebufferparagraph
- \else
- \doifinsetelse{\the\currentbufferparagraph}{#2}
- {\expandafter\dostartbufferparagraph}
- {\expandafter\fakebufferparagraph}%
- \fi
- {#1}}
-
-\long\def\gobblebufferparagraph#1#2\stopbufferparagraph
- {}
-
-\def\fakebufferparagraph#1%
- {\bgroup
- \def\stopbufferparagraph{\dostopbufferparagraph{#1}\egroup\egroup}%
- \setbox\scratchbox\vbox\bgroup\dostartbufferparagraph{#1}}
-
-% definitions
-
-\definebuffer[\v!hiding] \setupbuffer[\v!hiding][\c!local=\v!yes]
-
-\setupbuffer
- [\c!paragraph=\v!no,
- \c!before=,
- \c!after=]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/buff-ver.mkii b/Master/texmf-dist/tex/context/base/mkii/buff-ver.mkii
deleted file mode 100644
index fbe56892ea1..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/buff-ver.mkii
+++ /dev/null
@@ -1,1339 +0,0 @@
-%D \module
-%D [ file=buff-ver, % was core-ver
-%D version=2000.05.09,
-%D title=\CONTEXT\ Buffer Macros,
-%D subtitle=Verbatim,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Buffer Macros / Verbatim}
-
-\unprotect
-
-\ifx\startlinenumbering\undefined \let\startlinenumbering\relax \fi
-\ifx\stoplinenumbering \undefined \let\stoplinenumbering\relax \fi
-\ifx\setuplinenumbering\undefined \def\setuplinenumbering[#1]{} \fi
-
-% \type{ <crlf> char} geeft bagger
-
-%D We are going to embed the general verbatim support macros in
-%D a proper environment. First we show the common setup
-%D macro, so we know what features are supported. The options
-%D are hooked into the support macros via the \type{\obey}
-%D macros.
-
-\newif\ifslantedtypeactivated
-\newif\ifslantedtypepermitted
-
-\def\switchslantedtype
- {\ifslantedtypepermitted
- \ifslantedtypeactivated
- \slantedtypeactivatedfalse\tttf
- \else
- \slantedtypeactivatedtrue\ttsl
- \fi
- \fi}
-
-\newprettytrue % movet to here from cont-sys.tex
-
-\def\prettyidentifier {TEX}
-\def\prettypalet {}
-
-\def\installprettytype
- {\dodoubleargument\doinstallprettytype}
-
-\def\doinstallprettytype[#1][#2]% map #1 onto #2
- {\uppercasestring#1\to\asciia
- \uppercasestring#2\to\asciib
- \setevalue{\??ty\??ty\asciia}{\asciib}}
-
-\def\setupprettiesintype#1%
- {\uppercasestring#1\to\ascii
- \edef\prettyidentifier{\executeifdefined{\??ty\??ty\ascii}{TEX}}%
- \doifundefined{setuppretty\prettyidentifier type}%
- {\startnointerference
- \restorecatcodes % also needed when loading during \newpretty
- \startreadingfile % restore < and > if needed
- \lowercasestring verb-\prettyidentifier\to\filename
- \readsysfile{\filename.mkii}\donothing\donothing
- \stopreadingfile
- \stopnointerference}%
- \doifdefinedelse{setuppretty\prettyidentifier type}%
- {\let\uncatcodecharacters\uncatcodeallcharacters % ugly, should be switch / todo
- \def\dosetupprettytype{\getvalue{setuppretty\prettyidentifier type}}}
- {\let\dosetupprettytype\relax}}
-
-\def\setupprettytype{\dosetupprettytype}
-
-% \def\setupcommonverbatim
-% {\recatcodeuppercharactersfalse % obey regime / encoding
-% %
-% \let\prettyidentifier\s!default
-% %
-% \doifelse{\typingparameter\c!text}\v!yes
-% \naturaltextexttrue
-% \naturaltextextfalse
-% \def\prettyidentifierfont{\typingparameter\c!icommand}%
-% \def\prettyvariablefont {\typingparameter\c!vcommand}%
-% \def\prettynaturalfont {\typingparameter\c!ccommand}%
-% %
-% \doif{\typingparameter\c!space}\v!on
-% {\def\obeyspaces{\setcontrolspaces}}%
-% \doif{\typingparameter\c!page }\v!no
-% {\def\obeypages {\ignorepages}}%
-% %
-% \doifelse{\typingparameter\c!tab}\v!yes
-% {\def\obeytabs{\settabskips}}%
-% {\doif{\typingparameter\c!tab}\s!ascii
-% {\chardef\tabskipmode\plustwo % quit on >127
-% \def\obeytabs{\settabskips}}}%
-% %
-% \ignorehyphens % default
-% \ExpandFirstAfter\processaction
-% [\typingparameter\c!lines]
-% [ \v!yes=>\obeybreakpoints,
-% \v!hyphenated=>\obeyhyphens]%
-% \processaction
-% [\typingparameter\c!empty]
-% [\v!yes=>\obeyemptylines,
-% \v!all=>\obeyallemptylines]%
-% %
-% \ExpandFirstAfter\processaction
-% [\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}% \let
-% \let\obeytabs\ignoretabs,
-% \v!slanted=>\let\obeycharacters\setupslantedtype
-% \let\obeytabs\ignoretabs,
-% \s!unknown=>\setupprettiesintype{\typingparameter\c!option}%
-% \let\obeycharacters\setupprettytype
-% \let\obeytabs\ignoretabs]%
-% \doifnumberelse{\typingparameter\c!tab}
-% {\def\obeytabs{\setfixedtabskips{\typingparameter\c!tab}}}%
-% \donothing
-% %\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}
-
-\setvalue{\??tp:\c!lines:\v!yes }{\obeybreakpoints}
-\setvalue{\??tp:\c!lines:\v!hyphenated}{\obeyhyphens}
-
-\setvalue{\??tp:\c!empty:\v!yes }{\obeyemptylines}
-\setvalue{\??tp:\c!empty:\v!all }{\obeyallemptylines}
-
-\setvalue{\??tp:\c!option:\v!none }{\let\obeycharacters\relax}
-\setvalue{\??tp:\c!option:\v!color }{\setupprettiesintype{TEX}%
- \let\obeycharacters\setupprettytype
- \let\obeytabs\ignoretabs}
-\setvalue{\??tp:\c!option:\v!normal }{\let\obeycharacters\setupgroupedtype}
-\setvalue{\??tp:\c!option:\v!commands }{\def\obeycharacters{\setupcommandsintype}%
- \let\obeytabs\ignoretabs}
-\setvalue{\??tp:\c!option:\v!slanted }{\let\obeycharacters\setupslantedtype
- \let\obeytabs\ignoretabs}
-\setvalue{\??tp:\c!option:\s!unknown }{\setupprettiesintype{\typingparameter\c!option}%
- \let\obeycharacters\setupprettytype
- \let\obeytabs\ignoretabs}
-
-\def\setupcommonverbatim
- {\recatcodeuppercharactersfalse % obey regime / encoding
- %
- \let\prettyidentifier\s!default
- %
- \doifelse{\typingparameter\c!text}\v!yes
- \naturaltextexttrue
- \naturaltextextfalse
- \def\prettyidentifierfont{\typingparameter\c!icommand}%
- \def\prettyvariablefont {\typingparameter\c!vcommand}%
- \def\prettynaturalfont {\typingparameter\c!ccommand}%
- %
- \doif{\typingparameter\c!space}\v!on
- {\def\obeyspaces{\setcontrolspaces}}%
- \doif{\typingparameter\c!page }\v!no
- {\def\obeypages {\ignorepages}}%
- %
- \doifelse{\typingparameter\c!tab}\v!yes
- {\def\obeytabs{\settabskips}}%
- {\doif{\typingparameter\c!tab}\s!ascii % not needed in mkiv
- {\chardef\tabskipmode\plustwo % quit on >127
- \def\obeytabs{\settabskips}}}%
- %
- \ignorehyphens % default
- \getvalue{\??tp:\c!lines:\typingparameter\c!lines}%
- \getvalue{\??tp:\c!empty:\typingparameter\c!empty}%
- \getvalue{\??tp:\c!option:\ifcsname\??tp:\c!option:\typingparameter\c!option\endcsname\typingparameter\c!option\else\s!unknown\fi}%
- \doifnumberelse{\typingparameter\c!tab}
- {\def\obeytabs{\setfixedtabskips{\typingparameter\c!tab}}}%
- \donothing
- %\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}
-
-% BEWARE: the noligatures will globally change the verbatim font's behaviour
-
-% test case:
-%
-% \definetype[typeTEX][option=tex]
-%
-% \typeTEX|\example---oeps|. this---ligates---again.
-% \typeTEX{\example---oeps}. this---ligates---again.
-% \type {\example---oeps}. this---ligates---again.
-
-\def\setupcommandsintype % can also be \string\
- {\setupgroupedtype
- \edef\\{\typingparameter\c!escape}%
- \letvalue{\\}=\\% for instance \/=/
- \@EA\catcode\@EA`\\=\@@escape
- \def\BTEX##1\ETEX##2% ##2 gobbles active space
- {\naturaltextext##1\unskip\relax}}
-
-\def\setupslantedtype
- {\slantedtypepermittedtrue\setupgroupedtype}
-
-\ifx\setupprettytype \undefined \let\setupprettytype \relax \fi
-\ifx\setupslantedtype \undefined \let\setupslantedtype \relax \fi
-\ifx\setupgroupedtype \undefined \let\setupgroupedtype \relax \fi
-\ifx\normalnoligatures\undefined \let\normalnoligatures\gobbleoneargument \fi
-
-%D The verbatim commands have a rather long and turbulent
-%D history. Most users of \CONTEXT\ probably will never use
-%D some of the features, but I've kept in mind that when one is
-%D writing a users manual, about everything can and undoubtly
-%D will be subject to a verbatim treatment.
-%D
-%D Verbatim command are very sensitive to argument processing,
-%D which is a direct result of the \CATCODES\ being fixed at
-%D reading time. With our growing understanding of \TEX,
-%D especially of the mechanism that can be used for looking
-%D ahead and manipulating \CATCODES, the verbatim support
-%D became more and more advanced and natural.
-%D
-%D Typesetting inline verbatim can be accomplished by
-%D \type{\type}, which in this sentence was typeset by saying
-%D just \type{\type{\type}}, which in turn was typeset by
-%D \unknown. Using the normal grouping characters \type{{}} is
-%D the most natural way of using this command.
-%D
-%D A second, more or less redundant, alternative is delimiting
-%D the argument with an own character. This method was
-%D implemented in the context of a publication in the \MAPS,
-%D where this way of delimiting is recognized by \LATEX\ users.
-%D
-%D The third, more original alternative, is the one using
-%D \type{<<} and \type{>>} as delimiters. This alternative can
-%D be used in situations where slanted typeseting is needed.
-
-% todo: we can use \letter... here:
-
-\def\lesscharacter {<}
-\def\morecharacter {>}
-
-\chardef\texescape = `\\
-\chardef\leftargument = `\{
-\chardef\rightargument = `\}
-
-%D \macros
-%D {type}
-%D
-%D We define \type{\type} as a protected command. This command
-%D has several invocations: grouped, wirt boundary characters,
-%D and with font switches.
-
-% \starttyping
-% normal: \par \type{xx<<..xx..<<xx <<xx>> >>..>>xx} \par \type<<....>> \par \type<<..<<xx>>..>> \par
-% normal: \par \type{xx<..xx..<xx <slanted> >..>xx} \par \type{<....>} \par \type{<..<xx>..>}
-% \setuptype[option=slanted]
-% slanted: \par \type{xx<<..sl..<<xx <<sl>> xx>>..sl..>>xx} \par \type<<..xx..>> \par \type<<..<<sl>>..>> \par
-% slanted: \par \type{xx<<..sl..<xx <sl> xx>..sl..>>xx} \par \type<<..xx..>> \par \type<<..<sl>..>> \par
-% \setuptype[option=none]
-% none: \par \type{xx<<..xx..<<xx <<xx>> >>..>>xx} \par \type<<....>> \par \type<<..<<xx>>..>> \par
-% \stoptyping
-
-%D When writing the manual to \CONTEXT\ and documenting this
-%D source we needed to typeset \type{<<} and \type{>>}. Because
-%D we wanted to do this in the natural way, we've adapted the
-%D original definition a bit. This implementation went through
-%D several live cycles. The final implementation looks a bit
-%D further and treats the lone \type{<<} and \type{>>} a bit
-%D different. The \type {\null} prevents ligatures, which
-%D unfortunately turn up in Lucida fonts.
-
-%D The following lines show what happens when we set
-%D \type {option=commands}.
-%D
-%D \startbuffer
-%D \starttyping
-%D test//test test/BTEX \footnote{test test test}/ETEX test
-%D test//test test/BTEX \footnote{test test test}/ETEX test
-%D test test test/BTEX \bf(nota bene)/ETEX test
-%D test test test /BTEX \bf(nota bene)/ETEX test
-%D \stoptyping
-%D \stopbuffer
-%D
-%D % \bgroup\setuptyping[option=commands]\getbuffer\egroup
-%D
-%D this was keyed in as:
-%D
-%D \typebuffer
-
-\unexpanded\def\type{\dotype\empty}
-
-% not that fast but catches \type{\command} % nothing more after \command
-%
-% \setupcolors[state=start]
-% \setuptype[option=TEX]
-% \setupcolors[textcolor=red]
-%
-% The options \type{before=\startsolutionbackground } and
-% \type{after=\stopsolutionbackground} take care of putting a frame,
-% which can
-%
-% {\blue The options \type{before=\startsolutionbackground } and
-% \type{after=\stopsolutionbackground} take care of putting a frame,
-% which} can
-
-\def\resumecoloraftergroup
- {\localstartcolor[\s!black]%
- \localstartcolor[\maintextcolor]%
- \aftergroup\localstopcolor
- \aftergroup\localstopcolor}
-
-% the rather messy \type command
-
-\def\dotype#1% was \dotype
- {\bgroup
- \resumecoloraftergroup % a problem is that we can still be in color mode, tricky hack
- \begstrut % new, enables leading space in \type { abc } at par start / begstrut else no hyphenation
- \let\currenttypingclass\??ty
- \edef\currenttyping{#1}%
- \catcode`\<=\@@other
- \catcode`\>=\@@other
- \futurelet\next\dodotype}
-
-\def\dodotypeA
- {\initializetype
- \initializetypegrouping
- \verbatimfont
- \verbatimcolor
- \afterassignment\protectfirsttype\let\next=}
-
-\def\dodotypeB
- {\initializetype
- \setupnotypegrouping
- \verbatimfont
- \verbatimcolor
- \let\next=}
-
-\def\dodotypeC<#1%
- {\initializetype
- \verbatimfont
- \verbatimcolor
- \if#1<%
- \@EA\setupalternativetypegrouping
- \else
- \@EA#1%
- \fi}
-
-\def\dodotypeD#1%
- {\initializetype
- \verbatimfont
- \verbatimcolor
- \catcode`#1=\@@endgroup}
-
-\def\dodotype
- {\ifx\next\bgroup
- \@EA\dodotypeA
- \else\if\next<%
- \doifelse{\typingparameter\c!option}\v!none
- {\@EAEAEA\dodotypeB}{\@EAEAEA\dodotypeC}%
- \else
- \@EAEAEA\dodotypeD
- \fi\fi}
-
-% The next one is safe for: \def\xx#1{\type{#1}} \xx{\ifx}
-
-\let\protectedfirsttype\string % \relax for special cases
-
-\bgroup
-\catcode`\<=\active
-\catcode`\>=\active
-\gdef\doprotectfirsttype
- {\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
- {\beginrobusttest
- \futurelet\next\doprotectfirsttype}
-
-% 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
- \verbatimfont
- \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\defconvertedargument\expandafter\ascii\expandafter{\the\globalscratchtoks}% == \edefconvertedargument\ascii{\the\globalscratchtoks}%
- \ifx\scantokens\undefined\ascii\else\everyeof{\hskip-\spaceskip}\scantokens\expandafter{\ascii}\fi
- \egroup}
-
-\bgroup
-\catcode`\[=\@@begingroup
-\catcode`\]=\@@endgroup
-\catcode`\{=\@@active
-\catcode`\}=\@@active
-\gdef\initializetypegrouping
- [\ifnum\catcode`\{=\@@active
- \let\normalactivebgroup{%
- \let\normalactiveegroup}%
- \else
- \catcode`\{=\@@active
- \catcode`\}=\@@active
- \let\normalactivebgroup\leftargument
- \let\normalactiveegroup\rightargument
- \fi
- \def\activeleftargument
- [\bgroup
- \catcode`\}=\@@active
- \let}\activerightargument
- \normalactivebgroup]%
- \def\activerightargument
- [\normalactiveegroup
- \egroup]%
- \let{=\activeleftargument
- % not \let}=\egroup, otherwise things go wrong in alignments (???)
- \catcode`\}=\@@endgroup]
-\egroup
-
-\bgroup
-\catcode`\<=\@@active
-\catcode`\>=\@@active
-\gdef\setupalternativetypegrouping
- {\catcode`\<=\@@active
- \catcode`\>=\@@active
- \def\doless
- {\ifx<\next
- \def\next
- {\bgroup\switchslantedtype
- \let\next=}%
- \else
- \let\next\lesscharacter
- \fi
- \next}%
- \def\domore
- {\ifx>\next
- \def\next
- {\egroup
- \let\next=}%
- \else
- \let\next\morecharacter
- \fi
- \next}%
- \def<{\futurelet\next\doless}%
- \def>{\futurelet\next\domore}}
-\egroup
-
-\def\setupnotypegrouping
- {\catcode`\<=\@@begingroup
- \catcode`\>=\@@endgroup}
-
-\def\doenterdoublelesstype
- {\ifx\next\egroup
- \lesscharacter\null\lesscharacter
- \else
- \bgroup\switchslantedtype
- \let\doenterdoublemoretype\egroup
- \fi}
-
-\def\doenterdoublemoretype
- {\def\doenterdoubletype
- {\ifx\next\egroup
- \morecharacter\null\morecharacter
- \fi}}
-
-\bgroup
-\catcode`\<=\@@active
-\catcode`\>=\@@active
-\gdef\setupgroupedtype
- {\catcode`\<=\@@active
- \catcode`\>=\@@active
- \def\doless
- {\ifx<\next
- \def\next
- {\def\enterdoubletype{\futurelet\next\doenterdoublelesstype}%
- \afterassignment\enterdoubletype
- \let\next=}%
- \else
- \let\next\lesscharacter
- \fi
- \next}%
- \def\domore
- {\ifx>\next
- \def\next
- {\def\enterdoubletype{\futurelet\next\doenterdoublemoretype}%
- \afterassignment\enterdoubletype
- \let\next=}%
- \else
- \let\next\morecharacter
- \fi
- \next}%
- \def<{\futurelet\next\doless}%
- \def>{\futurelet\next\domore}}
-\egroup
-
-%D The neccessary initializations are done by calling
-%D \type{\initializetype} which in return calls for the support
-%D macro \type{\setupinlineverbatim}.
-
-\def\initializetype
- {\let\obeylines\ignorelines
- \setupcommonverbatim
- \setupinlineverbatim}
-
-%D \macros
-%D {setuptype}
-%D
-%D Some characteristics of \type{\type} can be set up by:
-
-\def\setuptype
- {\dodoubleempty\dosetuptype}
-
-\def\dosetuptype[#1][#2]%
- {\ifsecondargument
- \getparameters[\??ty#1][#2]%
- \else
- \getparameters[\??ty][#1]%
- \fi}
-
-%D \macros
-%D {typ,obeyhyphens,obeybreakpoints}
-%D
-%D Although it's not clear from the macros, one character
-%D trait of this macros, which are build on top of the support
-%D module, is that they don't hyphenate. We therefore offer
-%D the alternative \type{\typ}. The current implementation
-%D works all right, but a decent hyphenation support of
-%D \type{\tt} text will be implemented soon.
-
-\def\obeyhyphens
- {\def\obeyedspace {\hskip\interwordspace\relax}% better than spaceskip
- \def\controlspace{\hskip\zeropoint\hbox{\normalcontrolspace}\hskip\zeropoint\relax}%
- \spaceskip.25em\relax} % hm a bit of stretch !
-
-\def\obeybreakpoints
- {\ignorehyphens
- \veryraggedright}
-
-\def\ignorehyphens
- {% \nohyphens % forgotten when no \par
- \normallanguage\minusone % fails as the font redoes the language
- \def\obeyedspace {\hskip\interwordspace\relax}% better than spaceskip
- \def\controlspace{\hskip\zeropoint\hbox{\normalcontrolspace}\hskip\zeropoint\relax}%
- \spaceskip.5em\relax}
-
-
-\unexpanded\def\typ
- {\bgroup
- \let\@@tylines\v!hyphenated
- \futurelet\next\dodotype}
-
-%D \macros
-%D {tex,arg,mat,dis}
-%D
-%D Sometimes, for instance when we pass verbatim text as an
-%D argument, the fixed \CATCODES\ interfere with our wishes. An
-%D experimental implementation of character by character
-%D processing of verbatim text did overcome this limitation,
-%D but we've decided not to use that slow and sometimes
-%D troublesome solution. Instead we stick to some 'old'
-%D \CONTEXT\ macros for typesetting typical \TEX\ characters.
-%D
-%D The next implementation is more clear but less versatile,
-%D so we treated it for a beter one.
-%D
-%D \starttyping
-%D \def\dospecialtype#1#2%
-%D {\bgroup
-%D \initializetype
-%D \catcode`\{=\@@begingroup
-%D \catcode`\}=\@@endgroup
-%D \def\dospecialtype%
-%D {\def\dospecialtype{#2\egroup}%
-%D \bgroup
-%D \aftergroup\dospecialtype
-%D #1}%
-%D \afterassignment\dospecialtype
-%D \let\next=}
-%D
-%D \unexpanded\def\tex{\dospecialtype\texescape\relax}
-%D \unexpanded\def\arg{\dospecialtype\leftargument\rightargument}
-%D \unexpanded\def\mat{\dospecialtype\$\$}
-%D \unexpanded\def\dis{\dospecialtype{\$\$}{\$\$}}
-%D \stoptyping
-
-\def\setgroupedtype
- {\let\currenttypingclass\??ty
- \initializetype
- \verbatimcolor
- \catcode`\{=\@@begingroup
- \catcode`\}=\@@endgroup}
-
-\unexpanded\def\tex{\groupedcommand{\setgroupedtype\texescape}{\relax}}
-\unexpanded\def\arg{\groupedcommand{\setgroupedtype\leftargument}{\rightargument}}
-\unexpanded\def\mat{\groupedcommand{\setgroupedtype\$}{\$}}
-\unexpanded\def\dis{\groupedcommand{\setgroupedtype\$\$}{\$\$}}
-
-\let\normaltexttex\tex
-\let\normaltextarg\arg
-\let\normaltextmat\mat
-\let\normaltextdis\dis
-
-%D \macros
-%D {starttyping}
-%D
-%D Display verbatim is realized far more easy, which is mostly
-%D due to the fact that we use \type{\stop...} as delimiter.
-%D The implementation inherits some features, for instance the
-%D support of linenumbering, which can best be studied in the
-%D documented support module.
-
-\let\currenttyping \empty
-\let\currenttypingclass\??ty % saveguard
-
-% \def\typingparameter#1%
-% {\executeifdefined
-% {\currenttypingclass\currenttyping#1}%
-% {\executeifdefined{\currenttypingclass#1}\empty}}
-
-\def\typingparameter#1%
- {\ifcsname\currenttypingclass\currenttyping#1\endcsname
- \csname\currenttypingclass\currenttyping#1\endcsname
- \else\ifcsname\currenttypingclass#1\endcsname
- \csname\currenttypingclass#1\endcsname
- \fi\fi}
-
-\def\settypingparameter#1#2%
- {\setvalue{\currenttypingclass\currenttyping#1}{#2}}
-
-\def\setxtypingparameter#1#2%
- {\setxvalue{\currenttypingclass\currenttyping#1}{#2}}
-
-% \def\initializetyping
-% {%\donefalse
-% \switchtobodyfont[\typingparameter\c!bodyfont]%
-% \donefalse
-% \scratchskip\typingparameter\c!oddmargin\relax
-% \ifzeropt\scratchskip\else\donetrue\fi
-% \scratchskip\typingparameter\c!evenmargin\relax
-% \ifzeropt\scratchskip\else\donetrue\fi
-% \ifdone
-% \def\doopenupverbatimline
-% {\getpagestatus
-% \ifrightpage
-% \hskip\typingparameter\c!oddmargin\relax
-% \else
-% \hskip\typingparameter\c!evenmargin\relax
-% \fi}%
-% \else
-% \doadaptleftskip{\typingparameter\c!margin}%
-% \fi
-% \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!small=>\scratchskip\blankokleinmaat,
-% \v!medium=>\scratchskip\blankomiddelmaat,
-% \v!big=>\scratchskip\blankogrootmaat,
-% \v!halfline=>\scratchskip.5\baselineskip,
-% \v!line=>\scratchskip\baselineskip,
-% \v!none=>\scratchskip\zeropoint,
-% \s!unknown=>\scratchskip\commalistelement]%
-% \ifgridsnapping
-% \ifdim\scratchskip=.5\baselineskip\relax
-% \edef\verbatimbaselineskip{\the\scratchskip}% new
-% \else
-% \edef\verbatimbaselineskip{\the\baselineskip}%
-% \fi
-% \else
-% \edef\verbatimbaselineskip{\the\scratchskip}%
-% \fi
-% \setupcommonverbatim}
-
-\setvalue{\??tp:\c!blank:\v!standard}{\ctxparskip}
-\setvalue{\??tp:\c!blank:\v!small }{\blankokleinmaat}
-\setvalue{\??tp:\c!blank:\v!medium }{\blankomiddelmaat}
-\setvalue{\??tp:\c!blank:\v!big }{\blankogrootmaat}
-\setvalue{\??tp:\c!blank:\v!halfline}{.5\baselineskip}
-\setvalue{\??tp:\c!blank:\v!line }{\baselineskip}
-\setvalue{\??tp:\c!blank:\v!none }{\zeropoint}
-
-\def\initializetyping
- {%\donefalse
- \switchtobodyfont[\typingparameter\c!bodyfont]%
- \donefalse
- \scratchskip\typingparameter\c!oddmargin\relax
- \ifzeropt\scratchskip\else\donetrue\fi
- \scratchskip\typingparameter\c!evenmargin\relax
- \ifzeropt\scratchskip\else\donetrue\fi
- \ifdone
- \def\doopenupverbatimline
- {\getpagestatus
- \ifrightpage
- \hskip\typingparameter\c!oddmargin\relax
- \else
- \hskip\typingparameter\c!evenmargin\relax
- \fi}%
- \else
- \doadaptleftskip{\typingparameter\c!margin}%
- \fi
- \edef\!!stringa{\executeifdefined{\??bo\typingparameter\c!blank}{\typingparameter\c!blank}}%
- \scratchskip\executeifdefined{\??tp:\c!blank:\!!stringa}\!!stringa\relax
- \ifgridsnapping
- \ifdim\scratchskip=.5\baselineskip\relax
- \edef\verbatimbaselineskip{\the\scratchskip}% new
- \else
- \edef\verbatimbaselineskip{\the\baselineskip}%
- \fi
- \else
- \edef\verbatimbaselineskip{\the\scratchskip}%
- \fi
- \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.
-
-% 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
- \dosetuptypelinenumbering{#1}%
- \initializetyping
- \startverbatimcolor
- \expanded{\processdisplayverbatim{\s!stop\currenttyping}}}
-
-\def\dostoptyping#1% hm, currenttyping
- {\stopverbatimcolor
- \stoppacked % includes \egroup
- \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}
-%D
-%D The setup of typing accepts two arguments. The optional
-%D first one identifies the user defined ones. If only one
-%D argument is given, the values apply to both the standard
-%D command \type{\starttyping} and \type{\typefile}.
-
-\def\dosetuptyping[#1][#2]%
- {\ifsecondargument
- \getparameters[\??tp#1][#2]%
- \else
- \getparameters[\??tp][#1]%
- \fi}
-
-\def\setuptyping
- {\dodoubleempty\dosetuptyping}
-
-%D \macros
-%D {definetype}
-%D
-%D Specific inline verbatim commands can be defined with the
-%D following command.
-
-\def\definetype
- {\dodoubleempty\dodefinetype}
-
-\def\dodefinetype[#1][#2]%
- {\unexpanded\setvalue{#1}{\dotype{#1}}%
- \getparameters[\??ty#1][#2]}
-
-%D \macros
-%D {definetyping}
-%D
-%D For most users the standard \type{\start}||\type{\stop}||pair
-%D will suffice, but for documentation purposes the next
-%D definition command can be of use:
-%D
-%D \starttyping
-%D \definetyping[extratyping][margin=3em]
-%D
-%D \startextratyping
-%D these extra ones are indented by 1 em
-%D \stopextratyping
-%D \stoptyping
-%D
-%D The definitions default to the standard typing values.
-
-\def\presettyping[#1][#2]%
- {\copyparameters[\??tp#1][\??tp][\c!color,\c!style]%
- \getparameters [\??tp#1][#2]}
-
-\def\dodefinetyping[#1][#2]%
- {\setvalue{\e!start#1}{\dostarttyping{#1}}%
- \setvalue{\e!stop #1}{\dostoptyping {#1}}%
- \presettyping[#1][#2]}
-
-\def\definetyping
- {\dodoubleempty\dodefinetyping}
-
-%D We can use some core color commands. These are faster than
-%D the standard color switching ones and work ok on a line by
-%D line basis.
-%D
-%D \starttyping
-%D \def\setupverbatimcolor%
-%D {\edef\prettypalet{\prettyidentifier\typingparameter\c!palet}%
-%D \def\beginofpretty[##1]{\startcolormode{\prettypalet:##1}}%
-%D \def\endofpretty {\stopcolormode}}
-%D \stoptyping
-%D
-%D Since we support a global color too, the folowing
-%D definition is better:
-
-% \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
-% \let\stopverbatimcolor \relax
-% \let\verbatimcolor \relax}
-% {\def\beginofpretty[##1]{\startcolor[\prettypalet:##1]}%
-% \let\endofpretty \stopcolor
-% \def\startverbatimcolor{\startcolor[\typingparameter\c!color]}%
-% \let\stopverbatimcolor \stopcolor
-% \def\verbatimcolor {\getvalue{\typingparameter\c!color}}}% command !
-% \doifelsenothing{\typingparameter\c!palet}
-% {\let\prettypalet\empty
-% \let\endofpretty\relax
-% \def\beginofpretty[##1]{}}
-% {\edef\prettypalet{\prettyidentifier\typingparameter\c!palet}}}
-%
-% let's forget about this optimization not that we have mkiv
-
-\def\setupverbatimcolor
- {\def\beginofpretty[##1]{\startcolor[\prettypalet:##1]}%
- \let\endofpretty \stopcolor
- \def\startverbatimcolor{\startcolor[\typingparameter\c!color]}%
- \let\stopverbatimcolor \stopcolor
- \def\verbatimcolor {\getvalue{\typingparameter\c!color}}% command !
- \doifelsenothing{\typingparameter\c!palet}
- {\let\prettypalet\empty
- \let\endofpretty\relax
- \def\beginofpretty[##1]{}}
- {\edef\prettypalet{\prettyidentifier\typingparameter\c!palet}}}
-
-\let\prettypalet \empty
-\let\startverbatimcolor\relax
-\let\stopverbatimcolor \relax
-\let\verbatimcolor \relax
-
-%D In the verbatim module, there are some examples given of
-%D the more obscure features of the verbatim environments.
-%D
-%D \startbuffer
-%D \startTEX
-%D \def\mathematics#1% % usage: \type {\mathematics{x^2}}
-%D {\ifmmode#1\else$#1$\fi} % becomes: \mathematics{x^2}
-%D \stopTEX
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D This gives, as can be expected:
-%D
-%D \getbuffer
-%D
-%D When we want to see some typeset \TEX\ too, we can say:
-%D
-%D \startbuffer
-%D \startTEX
-%D \def\mathematics#1% %%\ N usage: \type {\mathematics{x^2}}
-%D {\ifmmode#1\else$#1$\fi} %%\ N becomes: \mathematics{x^2}
-%D \stopTEX
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D or:
-%D
-%D \getbuffer
-%D
-%D In a similar way:
-%D
-%D \startbuffer
-%D \startSQL
-%D select * -- indeed, here we {\em do} select
-%D from tableA
-%D where 1 = 2
-%D \stopSQL
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D gives:
-%D
-%D \getbuffer
-%D
-%D The next examples sow how we can directly call for natural
-%D \TEX\ comments:
-%D
-%D \startbuffer
-%D \setuptyping
-%D [TEX]
-%D [text=yes]
-%D
-%D \startTEX
-%D \def\mathematics#1% % usage: \type {\mathematics{x^2}}
-%D {\ifmmode#1\else$#1$\fi} % becomes: \mathematics{x^2}
-%D \stopTEX
-%D
-%D \setuptyping
-%D [SQL]
-%D [text=yes,palet=,icommand=\bf,vcommand=,ccommand=\it]
-%D
-%D \startSQL
-%D select * -- indeed, here we {\em do} select
-%D from tableA
-%D where 1 = 2
-%D \stopSQL
-%D
-%D \setuptyping
-%D [SQL]
-%D [ccommand=\tf\underbar]
-%D
-%D \startSQL
-%D select * -- indeed, here we {\em do} select
-%D from tableA
-%D where 1 = 2
-%D \stopSQL
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D Now watch:
-%D
-%D \getbuffer
-%D
-%D The natural \TEX\ typesetting was introduced when Tobias
-%D and Berend started using verbatim \JAVASCRIPT\ and \SQL.
-
-%D \macros
-%D {EveryPar, EveryLine, iflinepar}
-%D
-%D One of the features of these commands is the support of
-%D \type{\EveryPar}, \type{\EveryLine} and \type{\iflinepar}.
-%D In the documentation of the verbatim support module we give
-%D some examples of line- and paragraph numbering using these
-%D macros.
-
-%D \macros
-%D {typefile}
-%D
-%D Typesetting files verbatim (for the moment) only supports
-%D colorization of \TEX\ sources as valid option. The other
-%D setup values are inherited from display verbatim.
-%D The implementation of \type{\typefile} is straightforward:
-
-% new feature (not yet 100\% ok)
-%
-% \setuptyping[file][numbering=file]
-%
-% \typefile[start=2,nlines=3]{zapf}
-% \typefile[start=continue,nlines=13]{zapf}
-% \typefile{zapf}
-%
-% \setuptyping[file][numbering=line]
-%
-% \typefile[start=4,step=3]{zapf}
-% \typefile{zapf}
-
-\def\typefile
- {\dodoubleempty\dotypefile}
-
-\def\dotypefile[#1][#2]#3%
- {\ifsecondargument
- \dodotypefile[#1][#2]{#3}%
- \else\iffirstargument
- \doifassignmentelse{#1}
- {\dodotypefile[\v!file][#1]{#3}}
- {\dodotypefile[#1][]{#3}}%
- \else
- \dodotypefile[\v!file][]{#3}%
- \fi\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}
- {\doifelse{\typingparameter\c!numbering}\v!line
- {% \setuplinenumbering defaults start/step to 1/1, so we need
- \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=\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\setxtypingparameter\c!n{\number\linenumber}}%
- \fi}
-
-\def\reporttypingerror#1% temp hack
- {\blank
- \dontleavehmode\hbox\bgroup
- \expanded{\defconvertedargument\noexpand\ascii{#1}}%
- \tttf[\makemessage\m!verbatims1\ascii]%
- \showmessage\m!verbatims1\ascii
- \egroup
- \blank}
-
-\def\dosometyping#1#2#3#4#5%
- {\bgroup
- \let\currenttypingclass\??tp
- \edef\currenttyping{#1}%
- \typingparameter\c!before
- \startpacked % includes \bgroup
- \dosetuptypelinenumbering{#2}%
- \doifinset{\typingparameter\c!option}{\v!commands,\v!slanted,\v!normal}
- {\setuptyping[#1][\c!option=\v!none]}%
- \doif{\typingparameter\c!option}\v!color
- {\expandafter\aftersplitstring#3\at.\to\prettyidentifier
- \settypingparameter\c!option{\prettyidentifier}}%
- \initializetyping
- \startverbatimcolor
- \doifundefinedelse{\currenttypingclass#3\v!global\c!start}
- {\scratchcounter\zerocount}
- {\scratchcounter\getvalue{\currenttypingclass#3\v!global\c!start}}%
- \advance\scratchcounter\plusone
- \setxvalue{\currenttypingclass#3\v!global\c!start}{\the\scratchcounter}%
- \doifelsenothing{\typingparameter\c!start}
- {#4}
- {\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}
- {#4}
- {\setxvalue{\currenttypingclass#3\v!global\c!start}%
- {\the\numexpr\typingparameter\c!start+\typingparameter\c!nlines+\minusone\relax}%
- #5{\typingparameter\c!start}{\getvalue{\currenttypingclass#3\v!global\c!start}}}}%
- {#5{\typingparameter\c!start}{\typingparameter\c!stop}}}%
- \stopverbatimcolor
- \stoppacked
- \typingparameter\c!after
- \egroup}
-
-\def\doifelsetypingfile#1% sets \readfilename (we will make this proper mkiv i.e. less messy)
- {\doiflocfileelse{#1}
- {\firstoftwoarguments}
- {\doifinputfileelse{#1}
- {\def\readfilename{\pathplusfile\filepath{#1}}\firstoftwoarguments} % messy, looks wrong too
- {\secondoftwoarguments}}}
-
-\def\dodotypefile[#1][#2]#3%
- {\doifelsetypingfile{#3}
- {\dosometyping{#1}{#2}{#3}{\processfileverbatim\readfilename}{\processfilelinesverbatim\readfilename}}
- {\reporttypingerror{#3}}}
-
-%D \macros
-%D {filename}
-%D
-%D Typesetting filenames in monospaced fonts is possible with
-%D
-%D \starttyping
-%D \filename{here/there/filename.suffix}
-%D \stoptyping
-%D
-%D The definition is not that spectacular.
-
-\unexpanded\def\filename#1{{\tttf\hyphenatedfilename{#1}}}
-
-%D This leaves some settings:
-
-\permitshiftedendofverbatim
-\optimizeverbatimtrue
-
-%D And a bonus macro:
-
-\def\verbatim#1{\defconvertedargument\ascii{#1}\ascii}
-
-%D The setups for display verbatim and file verbatim are
-%D shared. One can adapt the extra defined typing environments,
-%D but they also default to the values below. Watch the
-%D alternative escape character.
-
-\setuptyping
- [ \c!before=\blank,
- \c!after=\blank,
- \c!bodyfont=,
- \c!color=,
- \c!space=\v!off,
- \c!page=\v!no,
- \c!tab=\s!ascii,
- \c!option=\v!none,
- \c!palet=colorpretty,
- \c!text=\v!no,
- \c!style=\tttf,
- \c!icommand=\ttsl,
- \c!vcommand=,
- \c!ccommand=\tttf,
- \c!indentnext=\v!yes,
- \c!margin=\!!zeropoint,
- \c!evenmargin=\!!zeropoint,
- \c!oddmargin=\!!zeropoint,
- \c!blank=\v!line,
- \c!escape=/, % beware \string\ , should also be accepted
- \c!numbering=\v!no,
- \c!lines=,
- \c!empty=,
- \c!start=1,
- \c!stop=,
- \c!step=1,
- \c!continue=,
- \c!nlines=]
-
-\definetyping[\v!typing]
-
-\presettyping[\v!file][]
-
-% \setuptyping % not needed
-% [\v!file]
-% [\c!start=1,
-% \c!stop=,
-% \c!step=1,
-% \c!continue=,
-% \c!nlines=]
-
-%D The setups for inline verbatim default to:
-
-\setuptype
- [ \c!space=\v!off,
- \c!color=,
- \c!style=\tt\tf, % \tttf gives problems with {\tx \type...}
- \c!page=\v!no,
- \c!tab=\v!yes,
- \c!palet=colorpretty,
- \c!option=\v!normal]
-
-\definetyping[RAW] [\c!option=RAW]
-\definetyping[MP] [\c!option=MP]
-\definetyping[PL] [\c!option=PL]
-\definetyping[PM] [\c!option=PL]
-\definetyping[JS] [\c!option=JS]
-\definetyping[JV] [\c!option=JV]
-\definetyping[SQL] [\c!option=SQL]
-\definetyping[TEX] [\c!option=TEX]
-\definetyping[PAS] [\c!option=PAS]
-\definetyping[PASCAL][\c!option=PAS]
-\definetyping[MOD] [\c!option=PAS]
-\definetyping[MODULA][\c!option=PAS]
-\definetyping[DELPHI][\c!option=PAS]
-\definetyping[EIFFEL][\c!option=EIF]
-\definetyping[XML] [\c!option=XML]
-\definetyping[LUA] [\c!option=LUA]
-
-\installprettytype [RAW] [RAW]
-
-\installprettytype [TEX] [TEX]
-
-\installprettytype [PERL] [PL]
-\installprettytype [PL] [PL]
-\installprettytype [PM] [PL]
-
-\installprettytype [METAPOST] [MP]
-\installprettytype [METAFONT] [MP]
-\installprettytype [MP] [MP]
-\installprettytype [MF] [MP]
-
-\installprettytype [JAVASCRIPT] [JS]
-\installprettytype [JAVA] [JV]
-\installprettytype [JS] [JS]
-\installprettytype [JV] [JV]
-
-\installprettytype [SQL] [SQL]
-
-\installprettytype [PASCAL] [PAS]
-\installprettytype [PAS] [PAS]
-\installprettytype [MODULA] [PAS]
-\installprettytype [MOD] [PAS]
-
-\installprettytype [EIFFEL] [EIF]
-\installprettytype [EIF] [EIF]
-\installprettytype [E] [EIF]
-
-\installprettytype [XML] [XML]
-
-\installprettytype [LUA] [LUA]
-
-\installnewpretty M {\setupprettiesintype {MP}\setupprettytype}
-\installnewpretty P {\setupprettiesintype {PL}\setupprettytype}
-\installnewpretty T {\setupprettiesintype{TEX}\setupprettytype}
-\installnewpretty J {\setupprettiesintype {JV}\setupprettytype}
-\installnewpretty S {\setupprettiesintype{SQL}\setupprettytype}
-\installnewpretty W {\setupprettiesintype{PAS}\setupprettytype} % Wirth
-\installnewpretty I {\setupprettiesintype{EIF}\setupprettytype} % E taken
-\installnewpretty X {\setupprettiesintype{XML}\setupprettytype}
-
-%D We use the \CONTEXT\ color system for switching to and from
-%D color mode. We can always redefine these colors afterwards.
-
-\definecolor [colorprettyone] [r=.9, g=.0, b=.0] % red
-\definecolor [colorprettytwo] [r=.0, g=.8, b=.0] % green
-\definecolor [colorprettythree] [r=.0, g=.0, b=.9] % blue
-\definecolor [colorprettyfour] [r=.8, g=.8, b=.6] % yellow
-
-\definecolor [grayprettyone] [s=.30]
-\definecolor [grayprettytwo] [s=.45]
-\definecolor [grayprettythree] [s=.60]
-\definecolor [grayprettyfour] [s=.75]
-
-\definepalet
- [colorpretty]
- [ prettyone=colorprettyone,
- prettytwo=colorprettytwo,
- prettythree=colorprettythree,
- prettyfour=colorprettyfour]
-
-\definepalet
- [graypretty]
- [ prettyone=grayprettyone,
- prettytwo=grayprettytwo,
- prettythree=grayprettythree,
- prettyfour=grayprettyfour]
-
-\definepalet [TEXcolorpretty] [colorpretty]
-\definepalet [TEXgraypretty] [graypretty]
-\definepalet [PLcolorpretty] [colorpretty]
-\definepalet [PLgraypretty] [graypretty]
-\definepalet [PMcolorpretty] [colorpretty]
-\definepalet [PMgraypretty] [graypretty]
-\definepalet [MPcolorpretty] [colorpretty]
-\definepalet [MPgraypretty] [graypretty]
-\definepalet [JVcolorpretty] [colorpretty]
-\definepalet [JVgraypretty] [graypretty]
-\definepalet [JScolorpretty] [colorpretty]
-\definepalet [JSgraypretty] [graypretty]
-\definepalet [SQLcolorpretty] [colorpretty]
-\definepalet [SQLgraypretty] [graypretty]
-\definepalet [PAScolorpretty] [colorpretty]
-\definepalet [PASgraypretty] [graypretty]
-\definepalet [EIFcolorpretty] [colorpretty]
-\definepalet [EIFgraypretty] [graypretty]
-\definepalet [XMLcolorpretty] [colorpretty]
-\definepalet [XMLgraypretty] [graypretty]
-\definepalet [LUAcolorpretty] [colorpretty]
-\definepalet [LUAgraypretty] [graypretty]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/catc-act.mkii b/Master/texmf-dist/tex/context/base/mkii/catc-act.mkii
deleted file mode 100644
index 6535afc56b8..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/catc-act.mkii
+++ /dev/null
@@ -1,65 +0,0 @@
-%D \module
-%D [ file=catc-act,
-%D version=2006.09.18,
-%D title=\CONTEXT\ Catcode Macros,
-%D subtitle=Default Catcode Tables,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 module deals with some active character handling. Use
-%D with care.
-
-%D \macros
-%D {installactivecharacter}
-
-\def\installactivecharacter#1 %
- {\edef\temp{\detokenize{#1}}%
- \cctcounterc\expandafter`\temp\relax % relax needed
- \expandafter\startextendcatcodetable
- \expandafter\ctxcatcodes\expandafter\catcode\the\cctcounterc\activecatcode
- \stopextendcatcodetable
- \letcatcodecommand \ctxcatcodes \cctcounterc \temp \relax
- \ifnum\currentcatcodetable=\ctxcatcodes \setcatcodetable\ctxcatcodes \fi}
-
-%D \macros
-%D {defineactivecharacter}
-%D
-%D Use this one with care, esp in combination with catcode
-%D vectors. There are better ways now.
-
-\chardef\activehackcode=`~
-
-\def\defineactivecharacter #1#2 #3%
- {\cctcounterc\uccode\activehackcode
- \if#1"\uccode\activehackcode\expandafter\doifnumberelse\expandafter{\string#1#2}\empty #1#2\else
- \uccode\activehackcode\expandafter\doifnumberelse\expandafter{\string#1#2}\empty`#1#2\fi
- \catcode\uccode\activehackcode\activecatcode
- \uppercase{\def\next{~}}%
- \uccode\activehackcode\cctcounterc
- \expandafter\expandafter\expandafter\def\expandafter\next\expandafter
- {\expandafter\dohandleactivecharacter\next{#3}}}
-
-\chardef\activecharactermode\plusone % overloading still backward compatible
-
-\def\dodohandleactivecharacter#1#2{#2}
-\def\donthandleactivecharacter#1#2{\noexpand#1}
-
-\def\dohandleactivecharacter
- {\ifcase\activecharactermode
- \expandafter\donthandleactivecharacter
- \else
- \expandafter\dodohandleactivecharacter
- \fi}
-
-\def\makecharacteractive #1 {\catcode`#1\active}
-
-% \def\installanddefineactivecharacter #1 % #2%
-% {\normalexpanded{\noexpand\installactivecharacter \utfchar{#1} }% wrong
-% \defineactivecharacter #1 }% {#2}}
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/catc-ctx.mkii b/Master/texmf-dist/tex/context/base/mkii/catc-ctx.mkii
deleted file mode 100644
index 8bb43c1f92c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/catc-ctx.mkii
+++ /dev/null
@@ -1,76 +0,0 @@
-%D \module
-%D [ file=catc-cys,
-%D version=2006.09.18,
-%D title=\CONTEXT\ Catcode Macros,
-%D subtitle=Extra Tables,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 We prefer to define relevant catcode tables in this file instead
-%D of everywhere around.
-
-\ifdefined \ctxcatcodes \else \newcatcodetable \ctxcatcodes \fi
-\ifdefined \prtcatcodes \else \newcatcodetable \prtcatcodes \fi
-
-\startcatcodetable \ctxcatcodes
- \catcode\tabasciicode \spacecatcode
- \catcode\endoflineasciicode \endoflinecatcode
- \catcode\formfeedasciicode \endoflinecatcode
- \catcode\spaceasciicode \spacecatcode
- \catcode\endoffileasciicode \ignorecatcode
- \catcode\circumflexasciicode\superscriptcatcode
- \catcode\underscoreasciicode\subscriptcatcode
- \catcode\ampersandasciicode \alignmentcatcode
- \catcode\backslashasciicode \escapecatcode
- \catcode\leftbraceasciicode \begingroupcatcode
- \catcode\rightbraceasciicode\endgroupcatcode
- \catcode\dollarasciicode \mathshiftcatcode
- \catcode\hashasciicode \parametercatcode
- \catcode\commentasciicode \commentcatcode
- \catcode\tildeasciicode \activecatcode
- \catcode\barasciicode \activecatcode
-\stopcatcodetable
-
-\startcatcodetable \prtcatcodes
- \catcode\tabasciicode \spacecatcode
- \catcode\endoflineasciicode \endoflinecatcode
- \catcode\formfeedasciicode \endoflinecatcode
- \catcode\spaceasciicode \spacecatcode
- \catcode\endoffileasciicode \ignorecatcode
- \catcode\circumflexasciicode\superscriptcatcode
- \catcode\underscoreasciicode\subscriptcatcode
- \catcode\ampersandasciicode \alignmentcatcode
- \catcode\backslashasciicode \escapecatcode
- \catcode\leftbraceasciicode \begingroupcatcode
- \catcode\rightbraceasciicode\endgroupcatcode
- \catcode\dollarasciicode \mathshiftcatcode
- \catcode\hashasciicode \parametercatcode
- \catcode\commentasciicode \commentcatcode
- \catcode`\@ \lettercatcode
- \catcode`\! \lettercatcode
- \catcode`\? \lettercatcode
- \catcode\tildeasciicode \activecatcode
- \catcode\barasciicode \activecatcode
-\stopcatcodetable
-
-\letcatcodecommand \ctxcatcodes \barasciicode \relax
-\letcatcodecommand \ctxcatcodes \tildeasciicode \relax
-
- \catcodetable \ctxcatcodes
-\let \defaultcatcodetable \ctxcatcodes
-
-% for the moment here:
-
-\def\starttexcode
- {\pushcatcodetable
- \catcodetable\prtcatcodes}
-
-\def\stoptexcode
- {\popcatcodetable}
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/catc-def.mkii b/Master/texmf-dist/tex/context/base/mkii/catc-def.mkii
deleted file mode 100644
index 25044bdf056..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/catc-def.mkii
+++ /dev/null
@@ -1,142 +0,0 @@
-%D \module
-%D [ file=catc-def,
-%D version=2006.09.18,
-%D title=\CONTEXT\ Catcode Macros,
-%D subtitle=Default Tables,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 following catcode tables are rather \CONTEXT\ independent.
-
-\ifdefined\nilcatcodes \else \newcatcodetable \nilcatcodes \fi
-\ifdefined\texcatcodes \else \newcatcodetable \texcatcodes \fi
-\ifdefined\luacatcodes \else \newcatcodetable \luacatcodes \fi
-\ifdefined\notcatcodes \else \newcatcodetable \notcatcodes \fi
-\ifdefined\vrbcatcodes \else \newcatcodetable \vrbcatcodes \fi
-\ifdefined\prtcatcodes \else \newcatcodetable \prtcatcodes \fi
-
-\startcatcodetable \nilcatcodes
- \catcode\tabasciicode \spacecatcode
- \catcode\endoflineasciicode\endoflinecatcode
- \catcode\formfeedasciicode \endoflinecatcode
- \catcode\spaceasciicode \spacecatcode
- \catcode\endoffileasciicode\ignorecatcode
-\stopcatcodetable
-
-\startcatcodetable \texcatcodes
- \catcode\tabasciicode \spacecatcode
- \catcode\endoflineasciicode \endoflinecatcode
- \catcode\formfeedasciicode \endoflinecatcode
- \catcode\spaceasciicode \spacecatcode
- \catcode\endoffileasciicode \ignorecatcode
- \catcode\circumflexasciicode\superscriptcatcode
- \catcode\underscoreasciicode\subscriptcatcode
- \catcode\ampersandasciicode \alignmentcatcode
- \catcode\backslashasciicode \escapecatcode
- \catcode\leftbraceasciicode \begingroupcatcode
- \catcode\rightbraceasciicode\endgroupcatcode
- \catcode\dollarasciicode \mathshiftcatcode
- \catcode\hashasciicode \parametercatcode
- \catcode\commentasciicode \commentcatcode
-\stopcatcodetable
-
-\startcatcodetable \luacatcodes
- \catcode\tabasciicode \othercatcode
- \catcode\endoflineasciicode \othercatcode
- \catcode\formfeedasciicode \othercatcode
- \catcode\spaceasciicode \othercatcode
- \catcode\endoffileasciicode \ignorecatcode
- \catcode\circumflexasciicode\othercatcode
- \catcode\underscoreasciicode\othercatcode
- \catcode\ampersandasciicode \othercatcode
- \catcode\backslashasciicode \escapecatcode
- \catcode\commentasciicode \othercatcode
- \catcode\hashasciicode \othercatcode
- \catcode\barasciicode \othercatcode
- \catcode\leftbraceasciicode \othercatcode
- \catcode\rightbraceasciicode\othercatcode
- \catcode\tildeasciicode \othercatcode
- \catcode\dollarasciicode \othercatcode
-\stopcatcodetable
-
-\startcatcodetable \notcatcodes % probably less needed
- \catcode\tabasciicode \spacecatcode
- \catcode\endoflineasciicode \endoflinecatcode
- \catcode\formfeedasciicode \endoflinecatcode
- \catcode\spaceasciicode \spacecatcode
- \catcode\endoffileasciicode \ignorecatcode
- \catcode\circumflexasciicode\othercatcode
- \catcode\underscoreasciicode\othercatcode
- \catcode\ampersandasciicode \othercatcode
- \catcode\tildeasciicode \othercatcode
- \catcode\hashasciicode \othercatcode
- \catcode\dollarasciicode \othercatcode
- \catcode\commentasciicode \othercatcode
- \catcode`\< \othercatcode
- \catcode`\> \othercatcode
- \catcode\leftbraceasciicode \othercatcode
- \catcode\rightbraceasciicode\othercatcode
- \catcode`\" \othercatcode
- \catcode`\' \othercatcode
- \catcode`\/ \othercatcode
- \catcode\backslashasciicode \othercatcode
- \catcode\barasciicode \othercatcode
-\stopcatcodetable
-
-\startcatcodetable \vrbcatcodes % probably less needed
- \catcode\tabasciicode \othercatcode
- \catcode\endoflineasciicode\othercatcode
- \catcode\formfeedasciicode \othercatcode
- \catcode\spaceasciicode \othercatcode
- \catcode\endoffileasciicode\othercatcode
-\stopcatcodetable
-
-\startcatcodetable \prtcatcodes
- \catcode\tabasciicode \spacecatcode
- \catcode\endoflineasciicode \endoflinecatcode
- \catcode\formfeedasciicode \endoflinecatcode
- \catcode\spaceasciicode \spacecatcode
- \catcode\endoffileasciicode \ignorecatcode
- \catcode\circumflexasciicode\superscriptcatcode
- \catcode\underscoreasciicode\subscriptcatcode
- \catcode\ampersandasciicode \alignmentcatcode
- \catcode\backslashasciicode \escapecatcode
- \catcode\leftbraceasciicode \begingroupcatcode
- \catcode\rightbraceasciicode\endgroupcatcode
- \catcode\dollarasciicode \mathshiftcatcode
- \catcode\hashasciicode \parametercatcode
- \catcode\commentasciicode \commentcatcode
- \catcode`\@ \lettercatcode
- \catcode`\! \lettercatcode
- \catcode`\? \lettercatcode
- \catcode\tildeasciicode \activecatcode
- \catcode\barasciicode \activecatcode
-\stopcatcodetable
-
-%D Because some characters have a special meaning, we provide
-%D shortcuts to their character representation.
-
-\chardef\^=\circumflexasciicode
-\chardef\_=\underscoreasciicode % but way too wide in lm, so ... until that's fixed:
-\chardef\&=\ampersandasciicode
-\chardef\%=\commentasciicode
-\chardef\#=\hashasciicode
-\chardef\$=\dollarasciicode
-\chardef\{=\leftbraceasciicode
-\chardef\}=\rightbraceasciicode
-\chardef\\=\backslashasciicode
-
-%def\_{\leavevmode \kern.06em \vbox{\hrule width.3em}}
-\def\_{\dontleavehmode \kern.06em \vbox{\hrule width.3em}}
-
-%D From now on we can use the protection mechanisms.
-
-\def\unprotect {\pushcatcodetable\setcatcodetable\prtcatcodes}
-\def\protect {\popcatcodetable}
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/catc-ini.mkii b/Master/texmf-dist/tex/context/base/mkii/catc-ini.mkii
deleted file mode 100644
index 7527466e103..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/catc-ini.mkii
+++ /dev/null
@@ -1,269 +0,0 @@
-%D \module
-%D [ file=catc-ini,
-%D version=2006.09.18,
-%D title=\CONTEXT\ System Macros,
-%D subtitle=Catcode Handling,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 We've split the functionality of syst-cat.* over more files
-%D now so that we can load more selectively.
-
-%D A long standing wish has been the availability of catcode
-%D arrays. Because traditional \TEX\ does ot provide this we
-%D implement a fake method in the Mark II file.
-
-\ifx\zerocount\undefined \chardef \zerocount= 0 \fi
-\ifx\plusone \undefined \chardef \plusone = 1 \fi
-\ifx\minusone \undefined \newcount\minusone \minusone =-1 \fi
-
-\chardef\escapecatcode = 0
-\chardef\begingroupcatcode = 1
-\chardef\endgroupcatcode = 2
-\chardef\mathshiftcatcode = 3
-\chardef\alignmentcatcode = 4
-\chardef\endoflinecatcode = 5
-\chardef\parametercatcode = 6
-\chardef\superscriptcatcode = 7
-\chardef\subscriptcatcode = 8
-\chardef\ignorecatcode = 9
-\chardef\spacecatcode = 10
-\chardef\lettercatcode = 11
-\chardef\othercatcode = 12 \chardef\other = 12
-\chardef\activecatcode = 13 \chardef\active = 13
-\chardef\commentcatcode = 14
-\chardef\invalidcatcode = 15
-
-\chardef\tabasciicode = 9 % ^^I
-\chardef\newlineasciicode = 10 % ^^J don't confuse this one with \endoflineasciicode
-\chardef\formfeedasciicode = 12 % ^^L
-\chardef\endoflineasciicode = 13 % ^^M somewhat messy but this can be the active \par
-\chardef\endoffileasciicode = 26 % ^^Z
-\chardef\spaceasciicode = 32
-\chardef\hashasciicode = 35
-\chardef\dollarasciicode = 36
-\chardef\commentasciicode = 37
-\chardef\ampersandasciicode = 38
-\chardef\backslashasciicode = 92 % `\\
-\chardef\circumflexasciicode = 94
-\chardef\underscoreasciicode = 95
-\chardef\leftbraceasciicode = 123 % `\{
-\chardef\barasciicode = 124 % `\|
-\chardef\rightbraceasciicode = 125 % `\}
-\chardef\tildeasciicode = 126 % `\~
-\chardef\delasciicode = 127
-
-\newif \ifrecatcodeuppercharacters % only used in good old tex
-
-% \newcount\cctdefcounter \cctdefcounter\plusone % 0 = signal
-\newcount\cctdefcounter \cctdefcounter\zerocount % 0 = signal, so advance before allocate
-
-\newcount\cctcountera
-\newcount\cctcounterb
-\newcount\cctcounterc
-
-\def\newcatcodetable#1%
- {\global\advance\cctdefcounter\plusone
- \global\mathchardef#1\cctdefcounter
- \expandafter\xdef\csname @@ccn:\number\cctdefcounter\endcsname{\string#1}% logging
- \expandafter\newtoks\csname @@cct:\number\cctdefcounter\endcsname}
-
-\mathchardef\currentcatcodetable\zerocount
-
-\newtoks \setdefaultlowercatcodes
-\newtoks \setdefaultuppercatcodes
-
-\def\next#1% we don't have a proper loop defined yet
- {\edef\nextnext{#1{\the#1\catcode\the\cctcountera\space
- \ifnum\catcode\cctcountera=\lettercatcode \lettercatcode\else\othercatcode\fi}}%
- \nextnext\ifnum\cctcountera<\cctcounterb \advance\cctcountera\plusone \expandafter\next\expandafter#1\fi}
-
-\cctcountera 0 \cctcounterb 127 \next\setdefaultlowercatcodes
-\cctcountera 128 \cctcounterb 255 \next\setdefaultuppercatcodes
-
-\recatcodeuppercharactersfalse
-
-\def\catcodetable#1%
- {\mathchardef\currentcatcodetable#1%
- \the\setdefaultlowercatcodes
- \ifrecatcodeuppercharacters\the\setdefaultuppercatcodes\fi
- \the\csname @@cct:\number#1\endcsname}
-
-\long\def\startcatcodetable#1#2\stopcatcodetable
- {\global\csname @@cct:\number#1\endcsname{#2}}
-
-\long\def\startextendcatcodetable#1#2\stopextendcatcodetable
- {\global\csname @@cct:\number#1\endcsname\expandafter{\the\csname @@cct:\number#1\endcsname#2}}
-
-%D The next command can be defined in a cleaner way in the
-%D Mk IV file but we want to have a fast one with a minimal
-%D chance for interference.
-
-\chardef\activehackcode=`\~
-
-%D Once a catcode is assigned, the next assignments will happen faster.
-
-% (expandable) let
-
-\def\letcatcodecommand {\afterassignment\letcatcodecommanda\cctcountera}
-\def\letcatcodecommanda{\afterassignment\letcatcodecommandb\cctcounterb}
-
-\def\letcatcodecommandb % each time
- {\ifcsname CCL:\number\cctcountera:\number\cctcounterb\endcsname
- \csname CCL:\number\cctcountera:\number\cctcounterb\expandafter\endcsname
- \else
- \expandafter\letcatcodecommandc
- \fi}
-
-\def\letcatcodecommandc % only first time
- {\expandafter\gdef\csname CCL:\number\cctcountera:\number\cctcounterb\expandafter\endcsname\expandafter
- {\expandafter\let\csname CCC:\number\cctcountera:\number\cctcounterb\endcsname}%
- \reinstatecatcodecommanda
- \csname CCL:\number\cctcountera:\number\cctcounterb\endcsname}
-
-% expandable def
-
-\def\defcatcodecommand {\afterassignment\defcatcodecommanda\cctcountera}
-\def\defcatcodecommanda{\afterassignment\defcatcodecommandb\cctcounterb}
-
-\def\defcatcodecommandb % each time
- {\ifcsname CCD:\number\cctcountera:\number\cctcounterb\endcsname
- \csname CCD:\number\cctcountera:\number\cctcounterb\expandafter\endcsname
- \else
- \expandafter\defcatcodecommandc
- \fi}
-
-\def\defcatcodecommandc % only first time
- {\expandafter\gdef\csname CCD:\number\cctcountera:\number\cctcounterb\expandafter\endcsname
- \expandafter##\expandafter1\expandafter
- {\expandafter\def\csname CCC:\number\cctcountera:\number\cctcounterb\endcsname{##1}}%
- \reinstatecatcodecommanda
- \csname CCD:\number\cctcountera:\number\cctcounterb\endcsname}
-
-% un expandable def (e.g. used for discretionaries)
-
-\def\uedcatcodecommand {\afterassignment\uedcatcodecommanda\cctcountera}
-\def\uedcatcodecommanda{\afterassignment\uedcatcodecommandb\cctcounterb}
-
-\def\uedcatcodecommandb % each time
- {\ifcsname CCU:\number\cctcountera:\number\cctcounterb\endcsname
- \csname CCU:\number\cctcountera:\number\cctcounterb\expandafter\endcsname
- \else
- \expandafter\uedcatcodecommandc
- \fi}
-
-\def\uedcatcodecommandc % only first time
- {\expandafter\gdef\csname CCU:\number\cctcountera:\number\cctcounterb\expandafter\endcsname
- \expandafter##\expandafter1\expandafter
- {\expandafter\unexpanded\expandafter\def\csname CCC:\number\cctcountera:\number\cctcounterb\endcsname{##1}}%
- \reinstatecatcodecommanda
- \csname CCU:\number\cctcountera:\number\cctcounterb\endcsname}
-
-\def\reinstatecatcodecommand{\afterassignment\reinstatecatcodecommanda\cctcounterb}
-
-\def\reinstatecatcodecommanda % can be used when a direct definition has been done
- {\bgroup % and the selector has been lost
- \uccode\activehackcode\cctcounterb
- \catcode\uccode\activehackcode\activecatcode
- \uppercase{\xdef~{\noexpand\catcodecommand{\number\cctcounterb}}}%
- \egroup}
-
-\chardef\defaultcatcodetable\zerocount
-
-\def\catcodecommand#1%
- {\csname CCC:\number
- \ifcsname CCC:\number\currentcatcodetable:\number#1\endcsname
- \currentcatcodetable \else \defaultcatcodetable
- \fi
- :\number#1\endcsname}
-
-%D \macros
-%D {restorecatcodes,
-%D beginrestorecatcodes,endrestorecatcodes}
-%D
-%D We're not finished dealing \CATCODES\ yet. In \CONTEXT\ we
-%D use only one auxiliary file, which deals with tables of
-%D contents, registers, two pass tracking, references etc. This
-%D file, as well as files concerning graphics, is processed when
-%D needed, which can be in the mid of typesetting verbatim.
-%D However, when reading in data in verbatim mode, we should
-%D temporary restore the normal \CATCODES, and that's exactly
-%D what the next macros do. Saving the catcodes can be
-%D disabled by saying \type{\localcatcodestrue}.
-
-\let\savedcatcodetable\relax
-
-\newcount\catcoderestorelevel
-
-\def\pushcatcodetable
- {\advance\catcoderestorelevel\plusone
- \tracepushcatcodetable
- \expandafter\mathchardef\csname scct:\number\catcoderestorelevel\endcsname\currentcatcodetable}
-
-\def\popcatcodetable
- {\ifcase\catcoderestorelevel
- \showcatcodenestingerror
- \else
- \expandafter\catcodetable\csname scct:\number\catcoderestorelevel\endcsname
- \tracepopcatcodetable
- \advance\catcoderestorelevel\minusone
- \fi}
-
-\def\showcatcodenestingerror % can be overloaded
- {\immediate\write16{}%
- \immediate\write16{Fatal error: catcode push/pop mismatch. Fix this!}\wait\end
- \immediate\write16{}}
-
-\def\restorecatcodes % takes previous level
- {\ifnum\catcoderestorelevel>\plusone
- \expandafter\catcodetable\csname scct:\number\numexpr\catcoderestorelevel-1\relax\endcsname
- \fi}
-
-\newtoks\everycatcodetable
-
-\def\setcatcodetable#1%
- {\catcodetable#1%
- \the\everycatcodetable
- \tracesetcatcodetable}
-
-\def\dotracecatcodetable#1{\immediate\write16{[#1]}}
-
-\def\tracecatcodetables
- {\def\tracesetcatcodetable {\dotracecatcodetable{set \catcodetablename\space at \number\catcoderestorelevel}}%
- \def\tracepushcatcodetable{\dotracecatcodetable{push \catcodetablename\space from \catcodetableprev\space at \number\catcoderestorelevel}}%
- \def\tracepopcatcodetable {\dotracecatcodetable{pop \catcodetablename\space to \catcodetableprev\space at \number\catcoderestorelevel}}}
-
-\def\catcodetableprev
- {\ifnum\numexpr\catcoderestorelevel-1\relax>\zerocount
- \csname @@ccn:\number\csname scct:\number\numexpr\catcoderestorelevel-1\relax\endcsname\endcsname
- \else
- -%
- \fi}
-
-\def\catcodetablename
- {\ifnum\currentcatcodetable>\zerocount
- \csname @@ccn:\number\currentcatcodetable\endcsname
- \else
- -%
- \fi}
-
-\ifx\empty\undefined \def\empty{} \fi
-
-\let\tracesetcatcodetable \empty
-\let\tracepushcatcodetable\empty
-\let\tracepopcatcodetable \empty
-
-\def\beginrestorecatcodes{\pushcatcodetable}
-\def\endrestorecatcodes {\popcatcodetable}
-
-%D Handy for debugging:
-
-% \tracecatcodetables
-
-\endinput
-
diff --git a/Master/texmf-dist/tex/context/base/mkii/catc-sym.mkii b/Master/texmf-dist/tex/context/base/mkii/catc-sym.mkii
deleted file mode 100644
index 55782f11ed2..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/catc-sym.mkii
+++ /dev/null
@@ -1,187 +0,0 @@
-%D \module
-%D [ file=catc-sym,
-%D version=1997.01.03, % moved code
-%D title=\CONTEXT\ Catcode Macros,
-%D subtitle=Some Handy Constants,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% we now have loaded syst-* so we have all @@catcode constants
-
-%D We want to have access to the raw alternatives of the
-%D special characters. We use a \type {\xdef} instead of
-%D \type {\let} because we need an expandable token in a
-%D \type {\write}.
-
-\bgroup
-
-\catcode`B=\begingroupcatcode
-\catcode`E=\endgroupcatcode
-\catcode`.=\escapecatcode
-
-.catcode `.{ 12 .xdef .letteropenbrace B.string{E
-.catcode `.} 12 .xdef .letterclosebrace B.string}E
-.catcode `.& 12 .xdef .letterampersand B.string&E
-.catcode `.< 12 .xdef .letterless B.string<E
-.catcode `.> 12 .xdef .lettermore B.string>E
-.catcode `.# 12 .xdef .letterhash B.string#E
-.catcode `." 12 .xdef .letterdoublequote B.string"E
-.catcode `.' 12 .xdef .lettersinglequote B.string'E
-.catcode `.$ 12 .xdef .letterdollar B.string$E
-.catcode `.% 12 .xdef .letterpercent B.string%E
-.catcode `.^ 12 .xdef .letterhat B.string^E
-.catcode `._ 12 .xdef .letterunderscore B.string_E
-.catcode `.| 12 .xdef .letterbar B.string|E
-.catcode `.~ 12 .xdef .lettertilde B.string~E
-.catcode `.\ 12 .xdef .letterbackslash B.string\E
-.catcode `./ 12 .xdef .letterslash B.string/E
-.catcode `.? 12 .xdef .letterquestionmark B.string?E
-.catcode `.! 12 .xdef .letterexclamationmark B.string!E
-.catcode `.@ 12 .xdef .letterat B.string@E
-.catcode `.: 12 .xdef .lettercolon B.string:E
-
- .global .let .letterescape .letterbackslash
- .global .let .letterbgroup .letteropenbrace
- .global .let .letteregroup .letterclosebrace
- .global .let .letterleftbrace .letteropenbrace
- .global .let .letterrightbrace .letterclosebrace
-
-.egroup
-
-%D \macros
-%D {uncatcodespecials,setnaturalcatcodes,setnormalcatcodes,
-%D uncatcodecharacters,uncatcodeallcharacters,
-%D uncatcodespacetokens}
-%D
-%D The following macros are more or less replaced by switching
-%D to a catcode table (which we simulate in \MKII) but we keep
-%D them for convenience and compatibility. Some old engine code
-%D has been removed.
-
-\def\uncatcodespecials {\setcatcodetable\nilcatcodes \uncatcodespacetokens}
-\def\setnaturalcatcodes {\setcatcodetable\nilcatcodes}
-\def\setnormalcatcodes {\setcatcodetable\ctxcatcodes} % maybe \texcatcodes
-\def\uncatcodecharacters {\setcatcodetable\nilcatcodes} % was fast version, gone now
-\def\uncatcodeallcharacters{\setcatcodetable\nilcatcodes} % was slow one, with restore
-
-\def\uncatcodespacetokens
- {\catcode\spaceasciicode \spacecatcode
- \catcode\formfeedasciicode \ignorecatcode
- \catcode\endoflineasciicode\endoflinecatcode
- \catcode\delasciicode \ignorecatcode}
-
-%D \macros
-%D {setverbosecharacter,setverbosecscharacters}
-%D
-%D Next follows a definition that lets some shortcuts expand to
-%D themselves. This macro is meant for \POSTSCRIPT\ and \PDF\
-%D code passed on to the backend.
-
-\newtoks\everyverbosechacters
-
-\def\setverbosecscharacter#1%
- {\edef#1{\string#1}}
-
-\def\setverbosecscharacters
- {\the\everyverbosechacters}
-
-\bgroup
-
- % if used often we can move the code inline
-
- \catcode\barasciicode \activecatcode
- \catcode\tildeasciicode\activecatcode
-
- \global \everyverbosechacters =
- {\setverbosecscharacter |\setverbosecscharacter ~% context specific
- \setverbosecscharacter\|\setverbosecscharacter\~%
- \setverbosecscharacter\:\setverbosecscharacter\;%
- \setverbosecscharacter\+\setverbosecscharacter\-%
- \setverbosecscharacter\[\setverbosecscharacter\]%
- \setverbosecscharacter\.\setverbosecscharacter\\%
- \setverbosecscharacter\)\setverbosecscharacter\(%
- \setverbosecscharacter\0\setverbosecscharacter\1%
- \setverbosecscharacter\2\setverbosecscharacter\3%
- \setverbosecscharacter\4\setverbosecscharacter\5%
- \setverbosecscharacter\6\setverbosecscharacter\7%
- \setverbosecscharacter\8\setverbosecscharacter\9%
- \setverbosecscharacter\n\setverbosecscharacter\s%
- \setverbosecscharacter\/}
-
-\egroup
-
-%D (Inspired by a discussion on the \CONTEXT\ mailing list)
-%D
-%D In \TEX\ each character can have one of 16 catcodes. This way the
-%D backslash, dollar, ampersand, hash and some more characters get
-%D their special meaning. If you want to process tokens under a
-%D certain catcode regime, passing arguments can interfere badly.
-%D
-%D \startbuffer[a]
-%D \def\whatever#1{[#1]}
-%D \whatever{whatever \type {\whatever{you want}} $or$ not!}
-%D \stopbuffer
-%D
-%D \typebuffer[a]
-%D
-%D Here we pass an argument to \type {\whatever} but part of that
-%D argument is to be processed under a different catcode regime, i.e.\
-%D all characters that need to be typeset verbatim need to get
-%D the catcode that makes it a letter. This is what we get when we typeset
-%D the text verbatim:
-%D
-%D \starttyping
-%D whatever \type {\whatever{you want}} $or$ not!
-%D \stoptyping
-%D
-%D However, when passed to \type {\whatever} we get:
-%D
-%D \getbuffer[a]
-%D
-%D In \ETEX\ one can use \type {\scantokens} to circumvent this problem.
-%D
-%D \startbuffer[b]
-%D \def\rescan#1{\scantokens{#1}}
-%D \def\whatever#1{[\rescan{#1}]}
-%D \whatever{whatever \type {\whatever{you want}} $or$ not!}
-%D \stopbuffer
-%D
-%D \getbuffer[b] \typebuffer[b]
-%D
-%D This time the \type {\whatever} call gives:
-%D
-%D \getbuffer[b]
-%D
-%D In this example, two spaces have crept in. The first one, after the
-%D macro name, is inserted by \TEX\ and cannot be avoided. The last space
-%D is inserted by \type {\scantokens}, and is the consequence of the fact
-%D that this macro mimics reading from a file. You can avoid the last
-%D space by a slightly different definition:
-%D
-%D \startbuffer[c]
-%D \def\rescan#1{\scantokens{#1\ignorespaces}}
-%D \def\whatever#1{[\rescan{#1}]}
-%D \whatever{whatever \type {\whatever{you want}} $or$ not!}
-%D \stopbuffer
-%D
-%D \typebuffer[c]
-%D
-%D Unfortunately we still keep the first space, but at least it's better than
-%D a failure:
-%D
-%D \getbuffer[c]
-
-\long\def\rescan#1{\scantokens{#1\ignorespaces}}
-\long\def\rescanwithsetup#1#2{\begingroup\directsetup{#1}\scantokens{#2\ignorespaces}\endgroup}
-
-\ifx\scantextokens\undefined \else
- \long\def\rescan#1{\scantextokens{#1}}
- \long\def\rescanwithsetup#1#2{\begingroup\directsetup{#1}\scantextokens{#2}\endgroup}
-\fi
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/catc-xml.mkii b/Master/texmf-dist/tex/context/base/mkii/catc-xml.mkii
deleted file mode 100644
index 45eb5a421a1..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/catc-xml.mkii
+++ /dev/null
@@ -1,114 +0,0 @@
-%D \module
-%D [ file=catc-xml,
-%D version=2006.09.18,
-%D title=\CONTEXT\ Catcode Macros,
-%D subtitle=\XML\ Catcode Tables,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Catcode Regimes / XML}
-
-\ifdefined \xmlcatcodesn \else \newcatcodetable \xmlcatcodesn \fi % normal
-\ifdefined \xmlcatcodese \else \newcatcodetable \xmlcatcodese \fi % entitle
-\ifdefined \xmlcatcodesr \else \newcatcodetable \xmlcatcodesr \fi % reduce
-
-\startcatcodetable \xmlcatcodesn
- \catcode\tabasciicode \spacecatcode
- \catcode\endoflineasciicode \endoflinecatcode
- \catcode\formfeedasciicode \endoflinecatcode
- \catcode\spaceasciicode \spacecatcode
- \catcode\endoffileasciicode \ignorecatcode
- \catcode\ampersandasciicode \activecatcode
- \catcode`\< \activecatcode
- \catcode`\> \othercatcode
- \catcode`\" \othercatcode % probably not needed any more
- \catcode`\/ \othercatcode % probably not needed any more
- \catcode`\' \othercatcode % probably not needed any more
- \catcode\tildeasciicode \othercatcode % probably not needed any more
- \catcode\hashasciicode \othercatcode % probably not needed any more
- \catcode\backslashasciicode \othercatcode % probably not needed any more
-\stopcatcodetable
-
-\startcatcodetable \xmlcatcodese
- \catcode\tabasciicode \spacecatcode
- \catcode\endoflineasciicode \endoflinecatcode
- \catcode\formfeedasciicode \endoflinecatcode
- \catcode\spaceasciicode \spacecatcode
- \catcode\endoffileasciicode \ignorecatcode
- \catcode\ampersandasciicode \activecatcode
- \catcode`\< \activecatcode
- \catcode`\> \activecatcode
- \catcode\hashasciicode \activecatcode
- \catcode\dollarasciicode \activecatcode
- \catcode\commentasciicode \activecatcode
- \catcode\backslashasciicode \activecatcode
- \catcode\circumflexasciicode\activecatcode
- \catcode\underscoreasciicode\activecatcode
- \catcode\leftbraceasciicode \activecatcode
- \catcode\rightbraceasciicode\activecatcode
- \catcode\barasciicode \activecatcode
- \catcode\tildeasciicode \activecatcode
-\stopcatcodetable
-
-\startcatcodetable \xmlcatcodesr
- \catcode\tabasciicode \spacecatcode
- \catcode\endoflineasciicode \endoflinecatcode
- \catcode\formfeedasciicode \endoflinecatcode
- \catcode\spaceasciicode \spacecatcode
- \catcode\endoffileasciicode \ignorecatcode
- \catcode\ampersandasciicode \activecatcode
- \catcode`\< \activecatcode
- \catcode`\> \activecatcode
- \catcode\hashasciicode \activecatcode
- \catcode\dollarasciicode \activecatcode
- \catcode\commentasciicode \activecatcode
- \catcode\backslashasciicode \activecatcode
- \catcode\circumflexasciicode\activecatcode
- \catcode\underscoreasciicode\activecatcode
- \catcode\leftbraceasciicode \activecatcode
- \catcode\rightbraceasciicode\activecatcode
- \catcode\barasciicode \activecatcode
- \catcode\tildeasciicode \activecatcode
-\stopcatcodetable
-
-%D Next we hook in some active character definitions.
-
-\letcatcodecommand \xmlcatcodesn \ampersandasciicode \relax
-\letcatcodecommand \xmlcatcodesn `\< \relax
-
-\letcatcodecommand \xmlcatcodese \ampersandasciicode \relax
-\letcatcodecommand \xmlcatcodese `\< \relax
-
-\letcatcodecommand \xmlcatcodesr \ampersandasciicode \relax
-\letcatcodecommand \xmlcatcodesr `\< \relax
-
-\letcatcodecommand \xmlcatcodese \hashasciicode \relax
-\letcatcodecommand \xmlcatcodese \dollarasciicode \relax
-\letcatcodecommand \xmlcatcodese \commentasciicode \relax
-\letcatcodecommand \xmlcatcodese \backslashasciicode \relax
-\letcatcodecommand \xmlcatcodese \circumflexasciicode \relax
-\letcatcodecommand \xmlcatcodese \underscoreasciicode \relax
-\letcatcodecommand \xmlcatcodese \leftbraceasciicode \relax
-\letcatcodecommand \xmlcatcodese \rightbraceasciicode \relax
-\letcatcodecommand \xmlcatcodese \barasciicode \relax
-\letcatcodecommand \xmlcatcodese \tildeasciicode \relax
-
-\letcatcodecommand \xmlcatcodesr \hashasciicode \relax
-\letcatcodecommand \xmlcatcodesr \dollarasciicode \relax
-\letcatcodecommand \xmlcatcodesr \commentasciicode \relax
-\letcatcodecommand \xmlcatcodesr \backslashasciicode \relax
-\letcatcodecommand \xmlcatcodesr \circumflexasciicode \relax
-\letcatcodecommand \xmlcatcodesr \underscoreasciicode \relax
-\letcatcodecommand \xmlcatcodesr \leftbraceasciicode \relax
-\letcatcodecommand \xmlcatcodesr \rightbraceasciicode \relax
-\letcatcodecommand \xmlcatcodesr \barasciicode \relax
-\letcatcodecommand \xmlcatcodesr \tildeasciicode \relax
-
-\let\xmlcatcodes \xmlcatcodesn % beware, in mkiv we use \notcatcodes
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/colo-ema.mkii b/Master/texmf-dist/tex/context/base/mkii/colo-ema.mkii
deleted file mode 100644
index 11d76f34209..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/colo-ema.mkii
+++ /dev/null
@@ -1,590 +0,0 @@
-%D \module
-%D [ file=colo-ema,
-%D version=2003.03.20,
-%D title=\CONTEXT\ Color Macros,
-%D subtitle=Emacs Colors,
-%D author=Peter Rolf,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% author : Peter Rolf <peter.rolf@arcor.de>
-% last change : 17 march 2003
-% origin : /emacs/etc/rgb.txt
-%
-% USAGE:
-%
-% - select emacs menu: Edit -> Text Properties -> Display
-% Colors, if you don't know what I'm talking about
-% - copy this file to your /texmf/tex/context/user directory
-% and add "\input colo-emacs" to your tex-file
-%
-% IMPORTANT NOTES:
-%
-% - all color names are written as ONE word in lowercase
-% letters (no redundancy as in rgb.txt) so if you want to
-% use the color "Light Sky Blue"/"light sky blue" it's new
-% name is lightskyblue
-% - the grayX values [X=0..100] can only be used with \color
-% [grayX]
-% - use it at your own risk :)
-%
-% HINT:
-%
-% I only include this file (\showcolor [ema]) until I've
-% found the colors I want. Copy and paste the color
-% definitions to a seperate file, to decrease compilation
-% time (540 color definitions).
-
-\definecolor [snow] [r=1,g=.980392,b=.980392]
-\definecolor [ghostwhite] [r=.972549,g=.972549,b=1]
-\definecolor [whitesmoke] [s=.960784]
-\definecolor [gainsboro] [s=.862745]
-\definecolor [floralwhite] [r=1,g=.980392,b=.941176]
-\definecolor [oldlace] [r=.992157,g=.960784,b=.901961]
-\definecolor [linen] [r=.980392,g=.941176,b=.901961]
-\definecolor [antiquewhite] [r=.980392,g=.921569,b=.843137]
-\definecolor [papayawhip] [r=1,g=.937255,b=.835294]
-\definecolor [blanchedalmond] [r=1,g=.921569,b=.803922]
-\definecolor [bisque] [r=1,g=.894118,b=.768627]
-\definecolor [peachpuff] [r=1,g=.854902,b=.72549]
-\definecolor [navajowhite] [r=1,g=.870588,b=.678431]
-\definecolor [moccasin] [r=1,g=.894118,b=.709804]
-\definecolor [cornsilk] [r=1,g=.972549,b=.862745]
-\definecolor [ivory] [r=1,g=1,b=.941176]
-\definecolor [lemonchiffon] [r=1,g=.980392,b=.803922]
-\definecolor [seashell] [r=1,g=.960784,b=.933333]
-\definecolor [honeydew] [r=.941176,g=1,b=.941176]
-\definecolor [mintcream] [r=.960784,g=1,b=.980392]
-\definecolor [azure] [r=.941176,g=1,b=1]
-\definecolor [aliceblue] [r=.941176,g=.972549,b=1]
-\definecolor [lavender] [r=.901961,g=.901961,b=.980392]
-\definecolor [lavenderblush] [r=1,g=.941176,b=.960784]
-\definecolor [mistyrose] [r=1,g=.894118,b=.882353]
-%definecolor[white] [s=1]
-%definecolor[black] [s=0]
-\definecolor [darkslategray] [r=.184314,g=.309804,b=.309804]
-\definecolor [dimgray] [s=.411765]
-\definecolor [slategray] [r=.439216,g=.501961,b=.564706]
-\definecolor [lightslategray] [r=.466667,g=.533333,b=.6]
-\definecolor [gray] [s=.745098]
-\definecolor [lightgray] [s=.827451]
-\definecolor [midnightblue] [r=.098039,g=.098039,b=.439216]
-\definecolor [navy] [b=.501961]
-\definecolor [navyblue] [navy]
-\definecolor [cornflowerblue] [r=.392157,g=.584314,b=.929412]
-\definecolor [darkslateblue] [r=.282353,g=.239216,b=.545098]
-\definecolor [slateblue] [r=.415686,g=.352941,b=.803922]
-\definecolor [mediumslateblue] [r=.482353,g=.407843,b=.933333]
-\definecolor [lightslateblue] [r=.517647,g=.439216,b=1]
-\definecolor [mediumblue] [b=.803922]
-\definecolor [royalblue] [r=.254902,g=.411765,b=.882353]
-%definecolor[blue] [b=1]
-\definecolor [dodgerblue] [r=.117647,g=.564706,b=1]
-\definecolor [deepskyblue] [g=.74902,b=1]
-\definecolor [skyblue] [r=.529412,g=.807843,b=.921569]
-\definecolor [lightskyblue] [r=.529412,g=.807843,b=.980392]
-\definecolor [steelblue] [r=.27451,g=.509804,b=.705882]
-\definecolor [lightsteelblue] [r=.690196,g=.768627,b=.870588]
-\definecolor [lightblue] [r=.678431,g=.847059,b=.901961]
-\definecolor [powderblue] [r=.690196,g=.878431,b=.901961]
-\definecolor [paleturquoise] [r=.686275,g=.933333,b=.933333]
-\definecolor [darkturquoise] [g=.807843,b=.819608]
-\definecolor [mediumturquoise] [r=.282353,g=.819608,b=.8]
-\definecolor [turquoise] [r=.25098,g=.878431,b=.815686]
-%definecolor[cyan] [g=1,b=1]
-\definecolor [lightcyan] [r=.878431,g=1,b=1]
-\definecolor [cadetblue] [r=.372549,g=.619608,b=.627451]
-\definecolor [mediumaquamarine] [r=.4,g=.803922,b=.666667]
-\definecolor [aquamarine] [r=.498039,g=1,b=.831373]
-\definecolor [darkgreen] [g=.392157]
-\definecolor [darkolivegreen] [r=.333333,g=.419608,b=.184314]
-\definecolor [darkseagreen] [r=.560784,g=.737255,b=.560784]
-\definecolor [seagreen] [r=.180392,g=.545098,b=.341176]
-\definecolor [mediumseagreen] [r=.235294,g=.701961,b=.443137]
-\definecolor [lightseagreen] [r=.12549,g=.698039,b=.666667]
-\definecolor [palegreen] [r=.596078,g=.984314,b=.596078]
-\definecolor [springgreen] [g=1,b=.498039]
-\definecolor [lawngreen] [r=.486275,g=.988235]
-%definecolor[green] [g=1]
-\definecolor [chartreuse] [r=.498039,g=1]
-\definecolor [mediumspringgreen] [g=.980392,b=.603922]
-\definecolor [greenyellow] [r=.678431,g=1,b=.184314]
-\definecolor [limegreen] [r=.196078,g=.803922,b=.196078]
-\definecolor [yellowgreen] [r=.603922,g=.803922,b=.196078]
-\definecolor [forestgreen] [r=.133333,g=.545098,b=.133333]
-\definecolor [olivedrab] [r=.419608,g=.556863,b=.137255]
-\definecolor [darkkhaki] [r=.741176,g=.717647,b=.419608]
-\definecolor [khaki] [r=.941176,g=.901961,b=.54902]
-\definecolor [palegoldenrod] [r=.933333,g=.909804,b=.666667]
-\definecolor [lightgoldenrodyellow] [r=.980392,g=.980392,b=.823529]
-\definecolor [lightyellow] [r=1,g=1,b=.878431]
-%definecolor[yellow] [r=1,g=1]
-\definecolor [gold] [r=1,g=.843137]
-\definecolor [lightgoldenrod] [r=.933333,g=.866667,b=.509804]
-\definecolor [goldenrod] [r=.854902,g=.647059,b=.12549]
-\definecolor [darkgoldenrod] [r=.721569,g=.52549,b=.043137]
-\definecolor [rosybrown] [r=.737255,g=.560784,b=.560784]
-\definecolor [indianred] [r=.803922,g=.360784,b=.360784]
-\definecolor [saddlebrown] [r=.545098,g=.270588,b=.07451]
-\definecolor [sienna] [r=.627451,g=.321569,b=.176471]
-\definecolor [peru] [r=.803922,g=.521569,b=.247059]
-\definecolor [burlywood] [r=.870588,g=.721569,b=.529412]
-\definecolor [beige] [r=.960784,g=.960784,b=.862745]
-\definecolor [wheat] [r=.960784,g=.870588,b=.701961]
-\definecolor [sandybrown] [r=.956863,g=.643137,b=.376471]
-\definecolor [tan] [r=.823529,g=.705882,b=.54902]
-\definecolor [chocolate] [r=.823529,g=.411765,b=.117647]
-\definecolor [firebrick] [r=.698039,g=.133333,b=.133333]
-\definecolor [brown] [r=.647059,g=.164706,b=.164706]
-\definecolor [darksalmon] [r=.913725,g=.588235,b=.478431]
-\definecolor [salmon] [r=.980392,g=.501961,b=.447059]
-\definecolor [lightsalmon] [r=1,g=.627451,b=.478431]
-\definecolor [orange] [r=1,g=.647059]
-\definecolor [darkorange] [r=1,g=.54902]
-\definecolor [coral] [r=1,g=.498039,b=.313725]
-\definecolor [lightcoral] [r=.941176,g=.501961,b=.501961]
-\definecolor [tomato] [r=1,g=.388235,b=.278431]
-\definecolor [orangered] [r=1,g=.270588]
-%definecolor[red] [r=1]
-\definecolor [hotpink] [r=1,g=.411765,b=.705882]
-\definecolor [deeppink] [r=1,g=.078431,b=.576471]
-\definecolor [pink] [r=1,g=.752941,b=.796078]
-\definecolor [lightpink] [r=1,g=.713725,b=.756863]
-\definecolor [palevioletred] [r=.858824,g=.439216,b=.576471]
-\definecolor [maroon] [r=.690196,g=.188235,b=.376471]
-\definecolor [mediumvioletred] [r=.780392,g=.082353,b=.521569]
-\definecolor [violetred] [r=.815686,g=.12549,b=.564706]
-%definecolor[magenta] [r=1,b=1]
-\definecolor [violet] [r=.933333,g=.509804,b=.933333]
-\definecolor [plum] [r=.866667,g=.627451,b=.866667]
-\definecolor [orchid] [r=.854902,g=.439216,b=.839216]
-\definecolor [mediumorchid] [r=.729412,g=.333333,b=.827451]
-\definecolor [darkorchid] [r=.6,g=.196078,b=.8]
-\definecolor [darkviolet] [r=.580392,b=.827451]
-\definecolor [blueviolet] [r=.541176,g=.168627,b=.886275]
-\definecolor [purple] [r=.627451,g=.12549,b=.941176]
-\definecolor [mediumpurple] [r=.576471,g=.439216,b=.858824]
-\definecolor [thistle] [r=.847059,g=.74902,b=.847059]
-\definecolor [snow1] [r=1,g=.980392,b=.980392]
-\definecolor [snow2] [r=.933333,g=.913725,b=.913725]
-\definecolor [snow3] [r=.803922,g=.788235,b=.788235]
-\definecolor [snow4] [r=.545098,g=.537255,b=.537255]
-\definecolor [seashell1] [r=1,g=.960784,b=.933333]
-\definecolor [seashell2] [r=.933333,g=.898039,b=.870588]
-\definecolor [seashell3] [r=.803922,g=.772549,b=.74902]
-\definecolor [seashell4] [r=.545098,g=.52549,b=.509804]
-\definecolor [antiquewhite1] [r=1,g=.937255,b=.858824]
-\definecolor [antiquewhite2] [r=.933333,g=.87451,b=.8]
-\definecolor [antiquewhite3] [r=.803922,g=.752941,b=.690196]
-\definecolor [antiquewhite4] [r=.545098,g=.513725,b=.470588]
-\definecolor [bisque1] [r=1,g=.894118,b=.768627]
-\definecolor [bisque2] [r=.933333,g=.835294,b=.717647]
-\definecolor [bisque3] [r=.803922,g=.717647,b=.619608]
-\definecolor [bisque4] [r=.545098,g=.490196,b=.419608]
-\definecolor [peachpuff1] [r=1,g=.854902,b=.72549]
-\definecolor [peachpuff2] [r=.933333,g=.796078,b=.678431]
-\definecolor [peachpuff3] [r=.803922,g=.686275,b=.584314]
-\definecolor [peachpuff4] [r=.545098,g=.466667,b=.396078]
-\definecolor [navajowhite1] [r=1,g=.870588,b=.678431]
-\definecolor [navajowhite2] [r=.933333,g=.811765,b=.631373]
-\definecolor [navajowhite3] [r=.803922,g=.701961,b=.545098]
-\definecolor [navajowhite4] [r=.545098,g=.47451,b=.368627]
-\definecolor [lemonchiffon1] [r=1,g=.980392,b=.803922]
-\definecolor [lemonchiffon2] [r=.933333,g=.913725,b=.74902]
-\definecolor [lemonchiffon3] [r=.803922,g=.788235,b=.647059]
-\definecolor [lemonchiffon4] [r=.545098,g=.537255,b=.439216]
-\definecolor [cornsilk1] [r=1,g=.972549,b=.862745]
-\definecolor [cornsilk2] [r=.933333,g=.909804,b=.803922]
-\definecolor [cornsilk3] [r=.803922,g=.784314,b=.694118]
-\definecolor [cornsilk4] [r=.545098,g=.533333,b=.470588]
-\definecolor [ivory1] [r=1,g=1,b=.941176]
-\definecolor [ivory2] [r=.933333,g=.933333,b=.878431]
-\definecolor [ivory3] [r=.803922,g=.803922,b=.756863]
-\definecolor [ivory4] [r=.545098,g=.545098,b=.513725]
-\definecolor [honeydew1] [r=.941176,g=1,b=.941176]
-\definecolor [honeydew2] [r=.878431,g=.933333,b=.878431]
-\definecolor [honeydew3] [r=.756863,g=.803922,b=.756863]
-\definecolor [honeydew4] [r=.513725,g=.545098,b=.513725]
-\definecolor [lavenderblush1] [r=1,g=.941176,b=.960784]
-\definecolor [lavenderblush2] [r=.933333,g=.878431,b=.898039]
-\definecolor [lavenderblush3] [r=.803922,g=.756863,b=.772549]
-\definecolor [lavenderblush4] [r=.545098,g=.513725,b=.52549]
-\definecolor [mistyrose1] [r=1,g=.894118,b=.882353]
-\definecolor [mistyrose2] [r=.933333,g=.835294,b=.823529]
-\definecolor [mistyrose3] [r=.803922,g=.717647,b=.709804]
-\definecolor [mistyrose4] [r=.545098,g=.490196,b=.482353]
-\definecolor [azure1] [r=.941176,g=1,b=1]
-\definecolor [azure2] [r=.878431,g=.933333,b=.933333]
-\definecolor [azure3] [r=.756863,g=.803922,b=.803922]
-\definecolor [azure4] [r=.513725,g=.545098,b=.545098]
-\definecolor [slateblue1] [r=.513725,g=.435294,b=1]
-\definecolor [slateblue2] [r=.478431,g=.403922,b=.933333]
-\definecolor [slateblue3] [r=.411765,g=.34902,b=.803922]
-\definecolor [slateblue4] [r=.278431,g=.235294,b=.545098]
-\definecolor [royalblue1] [r=.282353,g=.462745,b=1]
-\definecolor [royalblue2] [r=.262745,g=.431373,b=.933333]
-\definecolor [royalblue3] [r=.227451,g=.372549,b=.803922]
-\definecolor [royalblue4] [r=.152941,g=.25098,b=.545098]
-\definecolor [blue1] [blue]
-\definecolor [blue2] [b=.933333]
-\definecolor [blue3] [b=.803922]
-\definecolor [blue4] [b=.545098]
-\definecolor [dodgerblue1] [r=.117647,g=.564706,b=1]
-\definecolor [dodgerblue2] [r=.109804,g=.52549,b=.933333]
-\definecolor [dodgerblue3] [r=.094118,g=.454902,b=.803922]
-\definecolor [dodgerblue4] [r=.062745,g=.305882,b=.545098]
-\definecolor [steelblue1] [r=.388235,g=.721569,b=1]
-\definecolor [steelblue2] [r=.360784,g=.67451,b=.933333]
-\definecolor [steelblue3] [r=.309804,g=.580392,b=.803922]
-\definecolor [steelblue4] [r=.211765,g=.392157,b=.545098]
-\definecolor [deepskyblue1] [g=.74902,b=1]
-\definecolor [deepskyblue2] [g=.698039,b=.933333]
-\definecolor [deepskyblue3] [g=.603922,b=.803922]
-\definecolor [deepskyblue4] [g=.407843,b=.545098]
-\definecolor [skyblue1] [r=.529412,g=.807843,b=1]
-\definecolor [skyblue2] [r=.494118,g=.752941,b=.933333]
-\definecolor [skyblue3] [r=.423529,g=.65098,b=.803922]
-\definecolor [skyblue4] [r=.290196,g=.439216,b=.545098]
-\definecolor [lightskyblue1] [r=.690196,g=.886275,b=1]
-\definecolor [lightskyblue2] [r=.643137,g=.827451,b=.933333]
-\definecolor [lightskyblue3] [r=.552941,g=.713725,b=.803922]
-\definecolor [lightskyblue4] [r=.376471,g=.482353,b=.545098]
-\definecolor [slategray1] [r=.776471,g=.886275,b=1]
-\definecolor [slategray2] [r=.72549,g=.827451,b=.933333]
-\definecolor [slategray3] [r=.623529,g=.713725,b=.803922]
-\definecolor [slategray4] [r=.423529,g=.482353,b=.545098]
-\definecolor [lightsteelblue1] [r=.792157,g=.882353,b=1]
-\definecolor [lightsteelblue2] [r=.737255,g=.823529,b=.933333]
-\definecolor [lightsteelblue3] [r=.635294,g=.709804,b=.803922]
-\definecolor [lightsteelblue4] [r=.431373,g=.482353,b=.545098]
-\definecolor [lightblue1] [r=.74902,g=.937255,b=1]
-\definecolor [lightblue2] [r=.698039,g=.87451,b=.933333]
-\definecolor [lightblue3] [r=.603922,g=.752941,b=.803922]
-\definecolor [lightblue4] [r=.407843,g=.513725,b=.545098]
-\definecolor [lightcyan1] [r=.878431,g=1,b=1]
-\definecolor [lightcyan2] [r=.819608,g=.933333,b=.933333]
-\definecolor [lightcyan3] [r=.705882,g=.803922,b=.803922]
-\definecolor [lightcyan4] [r=.478431,g=.545098,b=.545098]
-\definecolor [paleturquoise1] [r=.733333,g=1,b=1]
-\definecolor [paleturquoise2] [r=.682353,g=.933333,b=.933333]
-\definecolor [paleturquoise3] [r=.588235,g=.803922,b=.803922]
-\definecolor [paleturquoise4] [r=.4,g=.545098,b=.545098]
-\definecolor [cadetblue1] [r=.596078,g=.960784,b=1]
-\definecolor [cadetblue2] [r=.556863,g=.898039,b=.933333]
-\definecolor [cadetblue3] [r=.478431,g=.772549,b=.803922]
-\definecolor [cadetblue4] [r=.32549,g=.52549,b=.545098]
-\definecolor [turquoise1] [g=.960784,b=1]
-\definecolor [turquoise2] [g=.898039,b=.933333]
-\definecolor [turquoise3] [g=.772549,b=.803922]
-\definecolor [turquoise4] [g=.52549,b=.545098]
-\definecolor [cyan1] [cyan]
-\definecolor [cyan2] [g=.933333,b=.933333]
-\definecolor [cyan3] [g=.803922,b=.803922]
-\definecolor [cyan4] [g=.545098,b=.545098]
-\definecolor [darkslategray1] [r=.592157,g=1,b=1]
-\definecolor [darkslategray2] [r=.552941,g=.933333,b=.933333]
-\definecolor [darkslategray3] [r=.47451,g=.803922,b=.803922]
-\definecolor [darkslategray4] [r=.321569,g=.545098,b=.545098]
-\definecolor [aquamarine1] [r=.498039,g=1,b=.831373]
-\definecolor [aquamarine2] [r=.462745,g=.933333,b=.776471]
-\definecolor [aquamarine3] [r=.4,g=.803922,b=.666667]
-\definecolor [aquamarine4] [r=.270588,g=.545098,b=.454902]
-\definecolor [darkseagreen1] [r=.756863,g=1,b=.756863]
-\definecolor [darkseagreen2] [r=.705882,g=.933333,b=.705882]
-\definecolor [darkseagreen3] [r=.607843,g=.803922,b=.607843]
-\definecolor [darkseagreen4] [r=.411765,g=.545098,b=.411765]
-\definecolor [seagreen1] [r=.329412,g=1,b=.623529]
-\definecolor [seagreen2] [r=.305882,g=.933333,b=.580392]
-\definecolor [seagreen3] [r=.262745,g=.803922,b=.501961]
-\definecolor [seagreen4] [r=.180392,g=.545098,b=.341176]
-\definecolor [palegreen1] [r=.603922,g=1,b=.603922]
-\definecolor [palegreen2] [r=.564706,g=.933333,b=.564706]
-\definecolor [palegreen3] [r=.486275,g=.803922,b=.486275]
-\definecolor [palegreen4] [r=.329412,g=.545098,b=.329412]
-\definecolor [springgreen1] [g=1,b=.498039]
-\definecolor [springgreen2] [g=.933333,b=.462745]
-\definecolor [springgreen3] [g=.803922,b=.4]
-\definecolor [springgreen4] [g=.545098,b=.270588]
-\definecolor [green1] [green]
-\definecolor [green2] [g=.933333]
-\definecolor [green3] [g=.803922]
-\definecolor [green4] [g=.545098]
-\definecolor [chartreuse1] [r=.498039,g=1]
-\definecolor [chartreuse2] [r=.462745,g=.933333]
-\definecolor [chartreuse3] [r=.4,g=.803922]
-\definecolor [chartreuse4] [r=.270588,g=.545098]
-\definecolor [olivedrab1] [r=.752941,g=1,b=.243137]
-\definecolor [olivedrab2] [r=.701961,g=.933333,b=.227451]
-\definecolor [olivedrab3] [r=.603922,g=.803922,b=.196078]
-\definecolor [olivedrab4] [r=.411765,g=.545098,b=.133333]
-\definecolor [darkolivegreen1] [r=.792157,g=1,b=.439216]
-\definecolor [darkolivegreen2] [r=.737255,g=.933333,b=.407843]
-\definecolor [darkolivegreen3] [r=.635294,g=.803922,b=.352941]
-\definecolor [darkolivegreen4] [r=.431373,g=.545098,b=.239216]
-\definecolor [khaki1] [r=1,g=.964706,b=.560784]
-\definecolor [khaki2] [r=.933333,g=.901961,b=.521569]
-\definecolor [khaki3] [r=.803922,g=.776471,b=.45098]
-\definecolor [khaki4] [r=.545098,g=.52549,b=.305882]
-\definecolor [lightgoldenrod1] [r=1,g=.92549,b=.545098]
-\definecolor [lightgoldenrod2] [r=.933333,g=.862745,b=.509804]
-\definecolor [lightgoldenrod3] [r=.803922,g=.745098,b=.439216]
-\definecolor [lightgoldenrod4] [r=.545098,g=.505882,b=.298039]
-\definecolor [lightyellow1] [r=1,g=1,b=.878431]
-\definecolor [lightyellow2] [r=.933333,g=.933333,b=.819608]
-\definecolor [lightyellow3] [r=.803922,g=.803922,b=.705882]
-\definecolor [lightyellow4] [r=.545098,g=.545098,b=.478431]
-\definecolor [yellow1] [yellow]
-\definecolor [yellow2] [r=.933333,g=.933333]
-\definecolor [yellow3] [r=.803922,g=.803922]
-\definecolor [yellow4] [r=.545098,g=.545098]
-\definecolor [gold1] [r=1,g=.843137]
-\definecolor [gold2] [r=.933333,g=.788235]
-\definecolor [gold3] [r=.803922,g=.678431]
-\definecolor [gold4] [r=.545098,g=.458824]
-\definecolor [goldenrod1] [r=1,g=.756863,b=.145098]
-\definecolor [goldenrod2] [r=.933333,g=.705882,b=.133333]
-\definecolor [goldenrod3] [r=.803922,g=.607843,b=.113725]
-\definecolor [goldenrod4] [r=.545098,g=.411765,b=.078431]
-\definecolor [darkgoldenrod1] [r=1,g=.72549,b=.058824]
-\definecolor [darkgoldenrod2] [r=.933333,g=.678431,b=.054902]
-\definecolor [darkgoldenrod3] [r=.803922,g=.584314,b=.047059]
-\definecolor [darkgoldenrod4] [r=.545098,g=.396078,b=.031373]
-\definecolor [rosybrown1] [r=1,g=.756863,b=.756863]
-\definecolor [rosybrown2] [r=.933333,g=.705882,b=.705882]
-\definecolor [rosybrown3] [r=.803922,g=.607843,b=.607843]
-\definecolor [rosybrown4] [r=.545098,g=.411765,b=.411765]
-\definecolor [indianred1] [r=1,g=.415686,b=.415686]
-\definecolor [indianred2] [r=.933333,g=.388235,b=.388235]
-\definecolor [indianred3] [r=.803922,g=.333333,b=.333333]
-\definecolor [indianred4] [r=.545098,g=.227451,b=.227451]
-\definecolor [sienna1] [r=1,g=.509804,b=.278431]
-\definecolor [sienna2] [r=.933333,g=.47451,b=.258824]
-\definecolor [sienna3] [r=.803922,g=.407843,b=.223529]
-\definecolor [sienna4] [r=.545098,g=.278431,b=.14902]
-\definecolor [burlywood1] [r=1,g=.827451,b=.607843]
-\definecolor [burlywood2] [r=.933333,g=.772549,b=.568627]
-\definecolor [burlywood3] [r=.803922,g=.666667,b=.490196]
-\definecolor [burlywood4] [r=.545098,g=.45098,b=.333333]
-\definecolor [wheat1] [r=1,g=.905882,b=.729412]
-\definecolor [wheat2] [r=.933333,g=.847059,b=.682353]
-\definecolor [wheat3] [r=.803922,g=.729412,b=.588235]
-\definecolor [wheat4] [r=.545098,g=.494118,b=.4]
-\definecolor [tan1] [r=1,g=.647059,b=.309804]
-\definecolor [tan2] [r=.933333,g=.603922,b=.286275]
-\definecolor [tan3] [r=.803922,g=.521569,b=.247059]
-\definecolor [tan4] [r=.545098,g=.352941,b=.168627]
-\definecolor [chocolate1] [r=1,g=.498039,b=.141176]
-\definecolor [chocolate2] [r=.933333,g=.462745,b=.129412]
-\definecolor [chocolate3] [r=.803922,g=.4,b=.113725]
-\definecolor [chocolate4] [r=.545098,g=.270588,b=.07451]
-\definecolor [firebrick1] [r=1,g=.188235,b=.188235]
-\definecolor [firebrick2] [r=.933333,g=.172549,b=.172549]
-\definecolor [firebrick3] [r=.803922,g=.14902,b=.14902]
-\definecolor [firebrick4] [r=.545098,g=.101961,b=.101961]
-\definecolor [brown1] [r=1,g=.25098,b=.25098]
-\definecolor [brown2] [r=.933333,g=.231373,b=.231373]
-\definecolor [brown3] [r=.803922,g=.2,b=.2]
-\definecolor [brown4] [r=.545098,g=.137255,b=.137255]
-\definecolor [salmon1] [r=1,g=.54902,b=.411765]
-\definecolor [salmon2] [r=.933333,g=.509804,b=.384314]
-\definecolor [salmon3] [r=.803922,g=.439216,b=.329412]
-\definecolor [salmon4] [r=.545098,g=.298039,b=.223529]
-\definecolor [lightsalmon1] [r=1,g=.627451,b=.478431]
-\definecolor [lightsalmon2] [r=.933333,g=.584314,b=.447059]
-\definecolor [lightsalmon3] [r=.803922,g=.505882,b=.384314]
-\definecolor [lightsalmon4] [r=.545098,g=.341176,b=.258824]
-\definecolor [orange1] [r=1,g=.647059]
-\definecolor [orange2] [r=.933333,g=.603922]
-\definecolor [orange3] [r=.803922,g=.521569]
-\definecolor [orange4] [r=.545098,g=.352941]
-\definecolor [darkorange1] [r=1,g=.498039]
-\definecolor [darkorange2] [r=.933333,g=.462745]
-\definecolor [darkorange3] [r=.803922,g=.4]
-\definecolor [darkorange4] [r=.545098,g=.270588]
-\definecolor [coral1] [r=1,g=.447059,b=.337255]
-\definecolor [coral2] [r=.933333,g=.415686,b=.313725]
-\definecolor [coral3] [r=.803922,g=.356863,b=.270588]
-\definecolor [coral4] [r=.545098,g=.243137,b=.184314]
-\definecolor [tomato1] [r=1,g=.388235,b=.278431]
-\definecolor [tomato2] [r=.933333,g=.360784,b=.258824]
-\definecolor [tomato3] [r=.803922,g=.309804,b=.223529]
-\definecolor [tomato4] [r=.545098,g=.211765,b=.14902]
-\definecolor [orangered1] [r=1,g=.270588]
-\definecolor [orangered2] [r=.933333,g=.25098]
-\definecolor [orangered3] [r=.803922,g=.215686]
-\definecolor [orangered4] [r=.545098,g=.145098]
-\definecolor [red1] [red]
-\definecolor [red2] [r=.933333]
-\definecolor [red3] [r=.803922]
-\definecolor [red4] [r=.545098]
-\definecolor [deeppink1] [r=1,g=.078431,b=.576471]
-\definecolor [deeppink2] [r=.933333,g=.070588,b=.537255]
-\definecolor [deeppink3] [r=.803922,g=.062745,b=.462745]
-\definecolor [deeppink4] [r=.545098,g=.039216,b=.313725]
-\definecolor [hotpink1] [r=1,g=.431373,b=.705882]
-\definecolor [hotpink2] [r=.933333,g=.415686,b=.654902]
-\definecolor [hotpink3] [r=.803922,g=.376471,b=.564706]
-\definecolor [hotpink4] [r=.545098,g=.227451,b=.384314]
-\definecolor [pink1] [r=1,g=.709804,b=.772549]
-\definecolor [pink2] [r=.933333,g=.662745,b=.721569]
-\definecolor [pink3] [r=.803922,g=.568627,b=.619608]
-\definecolor [pink4] [r=.545098,g=.388235,b=.423529]
-\definecolor [lightpink1] [r=1,g=.682353,b=.72549]
-\definecolor [lightpink2] [r=.933333,g=.635294,b=.678431]
-\definecolor [lightpink3] [r=.803922,g=.54902,b=.584314]
-\definecolor [lightpink4] [r=.545098,g=.372549,b=.396078]
-\definecolor [palevioletred1] [r=1,g=.509804,b=.670588]
-\definecolor [palevioletred2] [r=.933333,g=.47451,b=.623529]
-\definecolor [palevioletred3] [r=.803922,g=.407843,b=.537255]
-\definecolor [palevioletred4] [r=.545098,g=.278431,b=.364706]
-\definecolor [maroon1] [r=1,g=.203922,b=.701961]
-\definecolor [maroon2] [r=.933333,g=.188235,b=.654902]
-\definecolor [maroon3] [r=.803922,g=.160784,b=.564706]
-\definecolor [maroon4] [r=.545098,g=.109804,b=.384314]
-\definecolor [violetred1] [r=1,g=.243137,b=.588235]
-\definecolor [violetred2] [r=.933333,g=.227451,b=.54902]
-\definecolor [violetred3] [r=.803922,g=.196078,b=.470588]
-\definecolor [violetred4] [r=.545098,g=.133333,b=.321569]
-\definecolor [magenta1] [magenta]
-\definecolor [magenta2] [r=.933333,b=.933333]
-\definecolor [magenta3] [r=.803922,b=.803922]
-\definecolor [magenta4] [r=.545098,b=.545098]
-\definecolor [orchid1] [r=1,g=.513725,b=.980392]
-\definecolor [orchid2] [r=.933333,g=.478431,b=.913725]
-\definecolor [orchid3] [r=.803922,g=.411765,b=.788235]
-\definecolor [orchid4] [r=.545098,g=.278431,b=.537255]
-\definecolor [plum1] [r=1,g=.733333,b=1]
-\definecolor [plum2] [r=.933333,g=.682353,b=.933333]
-\definecolor [plum3] [r=.803922,g=.588235,b=.803922]
-\definecolor [plum4] [r=.545098,g=.4,b=.545098]
-\definecolor [mediumorchid1] [r=.878431,g=.4,b=1]
-\definecolor [mediumorchid2] [r=.819608,g=.372549,b=.933333]
-\definecolor [mediumorchid3] [r=.705882,g=.321569,b=.803922]
-\definecolor [mediumorchid4] [r=.478431,g=.215686,b=.545098]
-\definecolor [darkorchid1] [r=.74902,g=.243137,b=1]
-\definecolor [darkorchid2] [r=.698039,g=.227451,b=.933333]
-\definecolor [darkorchid3] [r=.603922,g=.196078,b=.803922]
-\definecolor [darkorchid4] [r=.407843,g=.133333,b=.545098]
-\definecolor [purple1] [r=.607843,g=.188235,b=1]
-\definecolor [purple2] [r=.568627,g=.172549,b=.933333]
-\definecolor [purple3] [r=.490196,g=.14902,b=.803922]
-\definecolor [purple4] [r=.333333,g=.101961,b=.545098]
-\definecolor [mediumpurple1] [r=.670588,g=.509804,b=1]
-\definecolor [mediumpurple2] [r=.623529,g=.47451,b=.933333]
-\definecolor [mediumpurple3] [r=.537255,g=.407843,b=.803922]
-\definecolor [mediumpurple4] [r=.364706,g=.278431,b=.545098]
-\definecolor [thistle1] [r=1,g=.882353,b=1]
-\definecolor [thistle2] [r=.933333,g=.823529,b=.933333]
-\definecolor [thistle3] [r=.803922,g=.709804,b=.803922]
-\definecolor [thistle4] [r=.545098,g=.482353,b=.545098]
-\definecolor [gray0] [black]
-\definecolor [gray1] [s=.01]
-\definecolor [gray2] [s=.02]
-\definecolor [gray3] [s=.03]
-\definecolor [gray4] [s=.04]
-\definecolor [gray5] [s=.05]
-\definecolor [gray6] [s=.06]
-\definecolor [gray7] [s=.07]
-\definecolor [gray8] [s=.08]
-\definecolor [gray9] [s=.09]
-\definecolor [gray10] [s=.1]
-\definecolor [gray11] [s=.11]
-\definecolor [gray12] [s=.12]
-\definecolor [gray13] [s=.13]
-\definecolor [gray14] [s=.14]
-\definecolor [gray15] [s=.15]
-\definecolor [gray16] [s=.16]
-\definecolor [gray17] [s=.17]
-\definecolor [gray18] [s=.18]
-\definecolor [gray19] [s=.19]
-\definecolor [gray20] [s=.2]
-\definecolor [gray21] [s=.21]
-\definecolor [gray22] [s=.22]
-\definecolor [gray23] [s=.23]
-\definecolor [gray24] [s=.24]
-\definecolor [gray25] [s=.25]
-\definecolor [gray26] [s=.26]
-\definecolor [gray27] [s=.27]
-\definecolor [gray28] [s=.28]
-\definecolor [gray29] [s=.29]
-\definecolor [gray30] [s=.3]
-\definecolor [gray31] [s=.31]
-\definecolor [gray32] [s=.32]
-\definecolor [gray33] [s=.33]
-\definecolor [gray34] [s=.34]
-\definecolor [gray35] [s=.35]
-\definecolor [gray36] [s=.36]
-\definecolor [gray37] [s=.37]
-\definecolor [gray38] [s=.38]
-\definecolor [gray39] [s=.39]
-\definecolor [gray40] [s=.4]
-\definecolor [gray41] [s=.41]
-\definecolor [gray42] [s=.42]
-\definecolor [gray43] [s=.43]
-\definecolor [gray44] [s=.44]
-\definecolor [gray45] [s=.45]
-\definecolor [gray46] [s=.46]
-\definecolor [gray47] [s=.47]
-\definecolor [gray48] [s=.48]
-\definecolor [gray49] [s=.49]
-\definecolor [gray50] [s=.5]
-\definecolor [gray51] [s=.51]
-\definecolor [gray52] [s=.52]
-\definecolor [gray53] [s=.53]
-\definecolor [gray54] [s=.54]
-\definecolor [gray55] [s=.55]
-\definecolor [gray56] [s=.56]
-\definecolor [gray57] [s=.57]
-\definecolor [gray58] [s=.58]
-\definecolor [gray59] [s=.59]
-\definecolor [gray60] [s=.6]
-\definecolor [gray61] [s=.61]
-\definecolor [gray62] [s=.62]
-\definecolor [gray63] [s=.63]
-\definecolor [gray64] [s=.64]
-\definecolor [gray65] [s=.65]
-\definecolor [gray66] [s=.66]
-\definecolor [gray67] [s=.67]
-\definecolor [gray68] [s=.68]
-\definecolor [gray69] [s=.69]
-\definecolor [gray70] [s=.7]
-\definecolor [gray71] [s=.71]
-\definecolor [gray72] [s=.72]
-\definecolor [gray73] [s=.73]
-\definecolor [gray74] [s=.74]
-\definecolor [gray75] [s=.75]
-\definecolor [gray76] [s=.76]
-\definecolor [gray77] [s=.77]
-\definecolor [gray78] [s=.78]
-\definecolor [gray79] [s=.79]
-\definecolor [gray80] [s=.8]
-\definecolor [gray81] [s=.81]
-\definecolor [gray82] [s=.82]
-\definecolor [gray83] [s=.83]
-\definecolor [gray84] [s=.84]
-\definecolor [gray85] [s=.85]
-\definecolor [gray86] [s=.86]
-\definecolor [gray87] [s=.87]
-\definecolor [gray88] [s=.88]
-\definecolor [gray89] [s=.89]
-\definecolor [gray90] [s=.9]
-\definecolor [gray91] [s=.91]
-\definecolor [gray92] [s=.92]
-\definecolor [gray93] [s=.93]
-\definecolor [gray94] [s=.94]
-\definecolor [gray95] [s=.95]
-\definecolor [gray96] [s=.96]
-\definecolor [gray97] [s=.97]
-\definecolor [gray98] [s=.98]
-\definecolor [gray99] [s=.99]
-\definecolor [gray100] [white]
-\definecolor [darkgray] [s=.662745]
-\definecolor [darkblue] [b=.545098]
-\definecolor [darkcyan] [g=.545098,b=.545098]
-\definecolor [darkmagenta] [r=.545098,b=.545098]
-\definecolor [darkred] [r=.545098]
-\definecolor [lightgreen] [r=.564706,g=.933333,b=.564706]
diff --git a/Master/texmf-dist/tex/context/base/mkii/colo-ext.mkii b/Master/texmf-dist/tex/context/base/mkii/colo-ext.mkii
deleted file mode 100644
index 5b39a8e85dd..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/colo-ext.mkii
+++ /dev/null
@@ -1,59 +0,0 @@
-%D \module
-%D [ file=colo-ext, % mostof thsi code used to be in colo-ini.tex
-%D version=1997.04.01,
-%D title=\CONTEXT\ Color Macros,
-%D subtitle=Extras,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Color Macros / Extras}
-
-\unprotect
-
-%D \macros
-%D {negatecolorcomponent, negativecolorbox}
-%D
-%D Sometimes, especially when we deal with typesetting
-%D devices, we want to reverse the color scheme. Instead of
-%D recalculating all those colors, we use a quick and dirty
-%D approach:
-%D
-%D \starttyping
-%D \negativecolorbox0
-%D \stoptyping
-%D
-%D will negate the colors in box zero.
-
-\def\negatecolorbox#1%
- {\setbox#1\hbox
- {\dostartnegative
- \localstartcolor[white]\vrule\!!height\ht#1\!!depth\dp#1\!!width\wd#1\localstopcolor
- \hskip-\wd#1%
- \box#1%
- \dostopnegative}}
-
-%D There are in principle two ways to handle overprint: bound to colors
-%D or independent. For the moment we only support independent overprint
-%D handling. Here we deal with a per-document setting.
-
-\setupcolors
- [\c!intent=\v!none]
-
-\def\starttextoverprint
- {\doifelse\@@clintent\v!overprint
- {\glet\stoptextoverprint \dostopoverprint
- \glet\starttextoverprint\dostartoverprint
- \dostartoverprint}
- {\glet\stoptextoverprint\donothing}}
-
-\let\stoptextoverprint\donothing
-
-\appendtoks \starttextoverprint \to \everystarttextproperties
-\appendtoks \stoptextoverprint \to \everystoptextproperties
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/colo-hex.mkii b/Master/texmf-dist/tex/context/base/mkii/colo-hex.mkii
deleted file mode 100644
index ddf2d47065d..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/colo-hex.mkii
+++ /dev/null
@@ -1,125 +0,0 @@
-%D \module
-%D [ file=colo-hex,
-%D version=2004.06.23,
-%D title=\CONTEXT\ Color Macros,
-%D subtitle=Hex Colors,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\ifdefined \hexcolorprefix
- \expandafter \endinput
-\fi
-
-\writestatus{loading}{ConTeXt Color Macros / Hexadecimal}
-
-% \edef\testcolor{\string#FFC0C0}
-% \edef\testcolor{\string#55}
-%
-% \setupcolors[state=start]
-%
-% \expanded{\definecolor[thehexcolor][\hexcolorspec\testcolor]}
-%
-% \checkhexcolor[\testcolor]
-%
-% \definecolor[thehexcolor][\testcolor]
-%
-% \starttext
-%
-% test \color[thehexcolor]{rood}
-% test \color[red]{rood}
-% test \color[\testcolor]{rood}
-%
-% \stoptext
-
-\unprotect
-
-% \definecolor[rgbtestcolor] [r=0.87843,g=0.87451,b=0.89020] % RGB(224,223,227)
-% \definecolor[hextestcolor] [h=E0DFE3]
-%
-% \startMPpage
-% path p ; % example by Peter Rolf
-% p := unitsquare xyscaled(5cm,5cm) ;
-% fill (point 0 of p -- point 1 of p -- point 2 of p --cycle) withcolor \MPcolor{rgbtestcolor} ; % bottom right part of the square
-% fill (point 0 of p -- point 3 of p -- point 2 of p --cycle) withcolor \MPcolor{hextestcolor} ; % top left part
-% \stopMPpage
-
-\newdimen\hexcolorfraction \hexcolorfraction=\dimexpr1pt/255\relax
-
-\chardef\hexcolorprefix=`#
-
-\def\hexcolorspec #1{\expandafter\dohexcolorspec #1\empty\empty\empty\empty\relax}
-\def\hexcolorpattern#1{\expandafter\dohexcolorpattern#1\empty\empty\empty\empty\relax}
-
-\ifx\dohexstringtonumber\undefined \def\dohexstringtonumber{"} \fi
-
-\def\hexcolorcomponent#1#2%
- {\ifnum\dohexstringtonumber#1#2=\zerocount0\else\ifnum\dohexstringtonumber#1#2=\plusone1\else
- \expandafter\withoutpt\the\dimexpr\dohexstringtonumber#1#2\hexcolorfraction\relax
- \fi\fi}
-
-\def\dohexcolorspec#1#2#3#4#5#6#7#8\relax
- {\ifx#4\empty
- s=\hexcolorcomponent#2#3%
- \else
- r=\hexcolorcomponent#2#3,g=\hexcolorcomponent#4#5,b=\hexcolorcomponent#6#7%
- \fi}
-
-\def\dohexcolorpattern#1#2#3#4#5#6#7#8\relax
- {0\ifx#4\empty
- S:\hexcolorcomponent#2#3%
- \else
- R:\hexcolorcomponent#2#3:\hexcolorcomponent#4#5:\hexcolorcomponent#6#7%
- \fi:0:0}
-
-\def\doifhexcolorelse#1%
- {\expandafter\dodoifhexcolorelse#10\od} % 0 is a dirty trick to catch an empty #1
-
-\def\dodoifhexcolorelse#1#2\od
- {\ifnum`#1=\hexcolorprefix
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\def\docheckhexcolor#1%
- {\doifhexcolorelse{#1}{\doifundefined{#1}{\setxvalue{\??cr#1}{\hexcolorpattern{#1}}}}\donothing}
-
-\def\checkhexcolor[#1]%
- {\expanded{\docheckhexcolor{#1}}}
-
-\def\colorHpattern{\@EA\hexcolorpattern\@EA{\@EA*\@@cl@@h}} % * == dummy placeholder
-
-\let\dodododefinecolor\dododefinecolor % we will overload this one
-
-\def\dododefinecolor#1#2#3#4[#5][#6]%
- {\doifhexcolorelse{#6}
- {\setxvalue{\??cr#5}{\hexcolorpattern{#6}}}
- {\dodododefinecolor#1#2#3#4[#5][#6]}}
-
-%D For Adam Lindsay and his XeTeX special driver:
-
-% because we intercept the zero condition, the .23pt in 1.23pt will disappear in the
-% ifcase zero part branch
-
-\def\colorhexcomponent#1%
- {\ifdim#1\points<.005\points
- 00\else\lchexnumbers{\the\dimexpr255\dimexpr#1\points\relax+.5\points\relax}%
- \fi}
-
-% the faster one
-
-\newdimen\hex@color@a \hex@color@a=.005pt
-\newdimen\hex@color@b \hex@color@b=.5pt
-\chardef \hex@color@c =255
-
-\def\colorhexcomponent#1%
- {\ifdim#1\points<\hex@color@a
- 00\else\lchexnumbers{\the\dimexpr#1\points*\hex@color@c+\hex@color@b\relax}%
- \fi}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/colo-ini.mkii b/Master/texmf-dist/tex/context/base/mkii/colo-ini.mkii
deleted file mode 100644
index 56b9d14da80..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/colo-ini.mkii
+++ /dev/null
@@ -1,2794 +0,0 @@
-%D \module
-%D [ file=colo-ini,
-%D version=2007.08.08,
-%D title=\CONTEXT\ Color Macros,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 We need to clean this up further but first we hav eto make sure that mkiv
-%D code works ok.
-
-\writestatus{loading}{ConTeXt Color Macros / Initialization}
-
-%D This module implements color. Since \MKII\ and \MKIV\ use a completely
-%D different approach, this module only implements a few generic mechanisms.
-
-\unprotect
-
-\chardef\colorversion=1 % temp, needed for tracing purposes, mkiv transition
-
-%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
-%D switches on a 1G machine, but the macros will become rather
-%D ugly then. To mention one such improvement: no colon
-%D after the key character (.25 sec).
-
-\newdimen\colordimen
-\newcount\colorcount
-
-%D When typesetting for paper, we prefer using the \cap{CMYK}
-%D color space, but for on||screen viewing we prefer \cap{RGB}
-%D (the previous implementation supported only this scheme).
-%D Independant of such specifications, we support some automatic
-%D conversions:
-%D
-%D \startitemize[packed]
-%D \item convert all colors to \cap{RGB}
-%D \item convert all colors to \cap{CMYK}
-%D \item convert all colors to gray scales
-%D \stopitemize
-%D
-%D We also support optimization of colors to gray scales.
-%D
-%D \startitemize[continue]
-%D \item reduce gray colors to gray scales
-%D \item reduce \cap{CMY} components to \cap{K}
-%D \stopitemize
-%D
-%D These options are communicated by means of:
-
-\newif\ifRGBsupported
-\newif\ifCMYKsupported
-\newif\ifSPOTsupported
-\newif\ifpreferGRAY
-\newif\ifGRAYprefered
-\newif\ifreduceCMYK
-\newif\ifconverttoGRAY
-\newif\ifweightGRAY \weightGRAYtrue
-
-\newif\ifconvertMPcolors
-\newif\ifreduceMPcolors
-\newif\ifforcegrayMPcolors
-
-%D The last boolean controls reduction of \cap{CMYK} to
-%D \cap{CMY} colors. When set to true, the black component
-%D is added to the other ones.
-%D
-%D Prefering gray is not the same as converting to gray.
-%D Conversion treats each color components in a different way,
-%D while prefering is just a reduction and thus a
-%D space||saving option.
-
-\newif\iffreezecolors \freezecolorsfalse
-\newif\ifincolor % true if colors enabled
-\newif\iflocalcolor
-
-\let\colorlist \empty
-\let\currentspotcolor \empty
-\let\allspotcolors \empty
-\let\usedspotcolors \empty
-\let\usedcolorchannels\empty
-\let\currentpalet \empty
-
-%D \macros
-%D {definecolor,defineglobalcolor,definenamedcolor,definespotcolor,definemultitonecolor}
-%D
-%D \startbuffer
-%D \definecolor [blue] [c=1,m=.38,y=0,k=.64] % pantone pms 2965 uncoated m
-%D \definecolor [yellow] [c=0,m=.28,y=1,k=.06] % pantone pms 124 uncoated m
-%D
-%D \definespotcolor [blue-100] [blue] [p=1]
-%D \definespotcolor [yellow-100] [yellow] [p=1]
-%D
-%D \definemultitonecolor [pdftoolscolor] [blue=.12,yellow=.28] [c=.1,m=.1,y=.3,k=.1]
-%D
-%D \useexternalfigure[demofig][mill.png][object=no]
-%D
-%D \startcombination[4*1]
-%D {\externalfigure[demofig]} {no color}
-%D {\externalfigure[demofig][color=pdftoolscolor]} {indexed duotone}
-%D {\externalfigure[demofig][color=blue-100]} {spot color}
-%D {\externalfigure[demofig][color=yellow-100]} {spot color}
-%D \stopcombination
-%D \stopbuffer
-%D
-%D \getbuffer \typebuffer
-
-\def\definecolor {\dodoubleargument\dodefinecolor}
-\def\defineglobalcolor {\dodoubleargument\dodefineglobalcolor}
-\def\definenamedcolor {\dodoubleargument\dodefinenamedcolor}
-\def\definespotcolor {\dotripleargument\dodefinespotcolor}
-\def\definemultitonecolor{\doquadrupleempty\dodefinemultitonecolor}
-
-% check: registerusedspotcolors
-% check: registerusedcolorchannels
-
-%D \macros
-%D {doifcolorelse, doifcolor}
-%D
-%D Switching to a color is done by means of the following
-%D command. Later on we will explain the use of palets. We
-%D define ourselves a color conditional first.
-
-\ifx\doifcolorelse\undefined
- \let\doifcolorelse\secondoftwoarguments
- \let\doifcolor \gobbleoneargument
-\fi
-
-%D \macros
-%D {localstartcolor,localstopcolor}
-%D
-%D Simple color support, that is without nesting, is provided
-%D by:
-
-\ifx\localstartcolor\undefined
- \let\localstartcolor\undefined
- \let\localstopcolor \undefined
-\fi
-
-%D \macros
-%D {faststartcolor,faststopcolor}
-%D
-%D No checking for arguments and such:
-
-\ifx\faststartcolor\undefined
- \def\faststartcolor[#1]{}
- \def\faststopcolor {}
-\fi
-
-%D These local ones may go away in future versions.
-
-%D \macros
-%D {startcolor,stopcolor}
-%D
-%D The more save method, the one that saves the current color
-%D state and returns to this state afterward, is activated by:
-%D
-%D \showsetup{startcolor}
-
-\ifx\startcolor\undefined
- \let\startcolor\undefined
- \let\stopcolor \undefined
-\fi
-
-%D \macros
-%D {startcurrentcolor,stopcurrentcolor}
-
-\def\startcurrentcolor{\startcolor[\outercolorname]}
-\def\stopcurrentcolor {\stopcolor}
-
-%D \macros
-%D {color,graycolor}
-%D
-%D This leaves the simple color command:
-%D
-%D \showsetup{color}
-%D \showsetup{graycolor}
-
-\ifx\color\undefined
- \def\color [#1]{}
- \def\graycolor[#1]{}
- \def\gray {\graycolor}
-\fi
-
-%D \macros
-%D {localstartraster,localstopraster,
-%D startraster,stopraster,raster}
-%D
-%D The previous conversions are not linear and treat each color
-%D component according to human perception curves. Pure gray
-%D (we call them rasters) has equal color components. In
-%D \CONTEXT\ rasters are only used as backgrounds and these
-%D don't cross page boundaries in the way color does. Therefore
-%D we don't need stacks and marks. Just to be compatible with
-%D color support we offer both 'global' and 'local' commands.
-
-\ifx\startraster\undefined
- \def\startraster [#1]{}
- \def\stopraster {}
- \def\raster [#1]{}
- \def\localstartraster[#1]{}
- \def\localstopraster {}
-\fi
-
-%D \macros
-%D {colorvalue, grayvalue}
-%D
-%D We can typeset the color components using \type{\colorvalue} and
-%D \type{\grayvalue}. The commands:
-%D
-%D \startbuffer
-%D color value of SomeKindOfRed: \colorvalue{SomeKindOfRed} \crlf
-%D gray value of SomeKindOfRed: \grayvalue{SomeKindOfRed}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D show us:
-%D
-%D \startvoorbeeld
-%D \getbuffer
-%D \stopvoorbeeld
-
-\def\colorformatseparator{ }
-
-\ifx\colorvalue\undefined
- \let\colorvalue\gobbleoneargument
- \let\grayvalue \gobbleoneargument
-\fi
-
-% check: \currentcolorname
-% check: \outercolorname
-
-%D \macros
-%D {setupcolor}
-%D
-%D Color definitions can be grouped in files with the name:
-%D
-%D \starttyping
-%D \f!colorprefix-identifier.tex
-%D \stoptyping
-%D
-%D where \type{\f!colorprefix} is \unprotect {\tttf \f!colorprefix}.
-%D Loading such a file is done by \protect
-%D
-%D \showsetup{setupcolor}
-%D
-%D Some default colors are specified in \type{colo-rgb.tex},
-%D which is loaded into the format by:
-%D
-%D \starttyping
-%D \setupcolor[rgb]
-%D \stoptyping
-
-\let\colorstyle\empty
-
-\def\setupcolor
- {\dosingleargument\dosetupcolor}
-
-\def\dosetupcolor[#1]%
- {\doifnot{#1}\colorstyle
- {\def\colorstyle{#1}%
- \processcommalist[#1]\dodosetupcolor}}
-
-\def\dodosetupcolor#1%
- {\makeshortfilename[\truefilename{\f!colorprefix#1}]%
- \startreadingfile
- \readsysfile{\shortfilename.\mksuffix}
- {\showmessage\m!colors4\colorstyle}
- {\readsysfile{\shortfilename.tex}
- {\showmessage\m!colors4\colorstyle}
- {\showmessage\m!colors5\colorstyle}}%
- \stopreadingfile}
-
-\let\usecolors\setupcolor
-
-% check: \chardef\currentcolorchannel=0
-% check: \startcolormode
-% check: \newif\iffilterspotcolor \filterspotcolorfalse
-% check: \newif\ifdoingspotcolor \doingspotcolorfalse
-% check: \registercolorchannel
-
-%D \macros
-%D {definetransparency}
-%D
-%D This command numbers to names:
-
-\def\definetransparency
- {\dodoubleargument\dodefinetransparency}
-
-\def\setupcolors
- {\dosingleargument\dosetupcolors}
-
-\def\resetcolorsplitting
- {\chardef\currentcolorchannel\zerocount
- \let\currentspotcolor\empty
- \filterspotcolorfalse}
-
-\def\colorsplitsuffix{\ifcase\currentcolorchannel\else-\@@clsplit\fi}
-\def\colorsplitprefix{\ifcase\currentcolorchannel\else\@@clsplit-\fi}
-
-\def\setcolorsplitting
- {\resetsystemmode{\v!color\colorsplitsuffix}%
- \resetcolorsplitting
- \processaction
- [\@@clsplit]
- [ c=>\chardef\currentcolorchannel1,%
- m=>\chardef\currentcolorchannel2,%
- y=>\chardef\currentcolorchannel3,%
- k=>\chardef\currentcolorchannel4,%
- r=>\chardef\currentcolorchannel5,%
- g=>\chardef\currentcolorchannel6,%
- b=>\chardef\currentcolorchannel7,%
- s=>\chardef\currentcolorchannel8,%
- \v!no=>,% \currentcolorchannel0,% all colors
- \s!default=>,% \currentcolorchannel0,% all colors
- \s!unknown=>\filterspotcolortrue
- \edef\currentspotcolor{\commalistelement}]%
- \setsystemmode{\v!color\colorsplitsuffix}%
- \iffilterspotcolor \let\@@clrgb\v!no \fi}
-
-\ifx\dosetupcolormodel\undefined
- \let\dosetupcolormodel\relax
-\fi
-
-\def\dosetupcolors[#1]% some no longer make sense in MkIV
- {\getparameters[\??cl][#1]%
- \doifelse\@@clspot\v!yes
- \SPOTsupportedtrue
- \SPOTsupportedfalse
- \doifelsenothing\@@clsplit
- \resetcolorsplitting
- \setcolorsplitting
- \doifelse\@@clreduction\v!yes
- \reduceCMYKtrue
- \reduceCMYKfalse
- \doifelse\@@clexpansion\v!yes
- \freezecolorstrue
- \freezecolorsfalse
- \doifelse\@@clcriterium\v!all
- \hidesplitcolortrue
- \hidesplitcolorfalse
- \doifelse\@@clrgb\v!no
- {\ifRGBsupported \ifproductionrun\showmessage\m!colors {9}\v!rgb \fi\RGBsupportedfalse \fi}
- {\ifRGBsupported \else\ifproductionrun\showmessage\m!colors{10}\v!rgb \fi\RGBsupportedtrue \fi}%
- \doifelse\@@clcmyk\v!no
- {\ifCMYKsupported \ifproductionrun\showmessage\m!colors {9}\v!cmyk \fi\CMYKsupportedfalse\fi}
- {\ifCMYKsupported\else\ifproductionrun\showmessage\m!colors{10}\v!cmyk \fi\CMYKsupportedtrue \fi}%
- \doifelse\@@clmpcmyk\v!no
- {\ifMPcmykcolors \ifproductionrun\showmessage\m!colors {9}{\v!mp\v!cmyk}\fi\MPcmykcolorsfalse \fi}
- {\ifMPcmykcolors \else\ifproductionrun\showmessage\m!colors{10}{\v!mp\v!cmyk}\fi\MPcmykcolorstrue \fi}%
- \doifelse\@@clmpspot\v!no
- {\ifMPspotcolors \ifproductionrun\showmessage\m!colors {9}{\v!mp\v!spot}\fi\MPspotcolorsfalse \fi}
- {\ifMPspotcolors \else\ifproductionrun\showmessage\m!colors{10}{\v!mp\v!spot}\fi\MPspotcolorstrue \fi}%
- \preferGRAYfalse
- \processaction
- [\@@clconversion]
- [ \v!yes=>\preferGRAYtrue,
- \v!always=>\preferGRAYtrue\RGBsupportedfalse\CMYKsupportedfalse]%
- \ifRGBsupported
- \converttoGRAYfalse
- \forcegrayMPcolorsfalse
- \else\ifCMYKsupported
- \converttoGRAYfalse
- \forcegrayMPcolorsfalse
- \convertMPcolorstrue
- \ifreduceCMYK
- \reduceMPcolorstrue
- \fi
- \else
- \ifconverttoGRAY\else\showmessage\m!colors{11}\empty\fi
- \converttoGRAYtrue
- \forcegrayMPcolorstrue
- \convertMPcolorsfalse
- \reduceMPcolorsfalse
- \fi\fi
- \processaction
- [\@@clstate]
- [ \v!global=>\ifincolor\else\showmessage\m!colors1\colorstyle\fi
- \incolortrue\localcolorfalse,
- \v!local=>\ifincolor\else\showmessage\m!colors2\colorstyle\fi
- \incolortrue\localcolortrue,
- \v!start=>\ifincolor\else\showmessage\m!colors1\colorstyle\fi
- \incolortrue\localcolorfalse
- \let\@@clstate\v!global,
- \v!stop=>\incolorfalse\localcolorfalse
- \forcegrayMPcolorstrue]%
- \dosetupcolormodel
- \initializemaintextcolor}
-
-%D \macros
-%D {startregistercolor,stopregistercolor,permitcolormode}
-%D
-%D If you only want to register a color, the switch \type
-%D {\ifpermitcolormode} can be used. That way the nested
-%D colors know where to go back to.
-
-\ifx\startregistercolor\undefined
- \def\startregistercolor[#1]{}
- \def\stopregistercolor {}
-\fi
-
-%D We use these macros for implementing text colors
-%D (actually, the first application was in foreground
-%D colors).
-%D
-%D \starttyping
-%D \starttextcolor[red]
-%D \dorecurse{10}{\input tufte \color[green]{oeps} \par}
-%D \stoptextcolor
-%D \stoptyping
-%D
-%D This is more efficient than the alternative:
-%D
-%D \starttyping
-%D \setupbackgrounds[text][foregroundcolor=red]
-%D \startregistercolor[red]
-%D \dorecurse{10}{\input tufte \color[green]{oeps} \par}
-%D \stopregistercolor
-%D \stoptyping
-
-\def\maintextcolor {}
-\def\defaulttextcolor {black}
-\def\@@themaintextcolor{themaintextcolor}
-
-\ifx\initializemaintextcolor\undefined
- \def\starttextcolor [#1]{}
- \def\stoptextcolor {}
- \def\initializemaintextcolor {}
-\fi
-
-\ifx\restoretextcolor\undefined % to be redone
- \let\restoretextcolor \firstofoneargument
- \let\localstarttextcolor\relax
- \let\localstoptextcolor \relax
-\fi
-
-%D In this documentation we will not go into too much details
-%D on palets. Curious users can find more information on this
-%D topic in \from[use of color].
-%D
-%D At the moment we implemented color in \CONTEXT\ color
-%D printing was not yet on the desktop. In spite of this lack our
-%D graphics designer made colorfull illustrations. When printed
-%D on a black and white printer, distinctive colors can come
-%D out equally gray. We therefore decided to use only colors
-%D that were distinctive in colors as well as in black and
-%D white print.
-%D
-%D Although none of the graphic packages we used supported
-%D logical colors and global color redefition, we build this
-%D support into \CONTEXT. This enabled us to experiment and
-%D also prepared us for the future.
-
-%D \macros
-%D {definepalet}
-%D
-%D Colors are grouped in palets. The colors in such a palet can
-%D have colorful names, but best is to use names that specify
-%D their use, like {\em important} or {\em danger}. As a sort
-%D of example \CONTEXT\ has some palets predefined,
-%D like:\footnote{At the time I wrote the palet support, I was
-%D reading 'A hort history of time' of S.~Hawkins, so that's
-%D why we stuck to quarks.}
-%D
-%D \starttyping
-%D \definepalet
-%D [alfa]
-%D [ top=rood:7,
-%D bottom=groen:6,
-%D up=blauw:5,
-%D down=cyaan:4,
-%D strange=magenta:3,
-%D charm=geel:2]
-%D \stoptyping
-%D
-%D It's formal definition is:
-%D
-%D \showsetup{definepalet}
-%D
-%D Visualized, such a palet looks like:
-%D
-%D \startbuffer[palet]
-%D \showpalet [alfa] [horizontal,name,number,value]
-%D \stopbuffer
-%D
-%D \startlinecorrection
-%D \getbuffer[palet]
-%D \stoplinecorrection
-%D
-%D This bar shows both the color and gray alternatives of the
-%D palet components (not visible in black and white print).
-%D
-%D When needed, one can copy a palet by saying:
-%D
-%D \starttyping
-%D \definepalet [TEXcolorpretty] [colorpretty]
-%D \stoptyping
-%D
-%D This saves us some typing in for instance the modules that
-%D deal with pretty verbatim typesetting.
-
-\def\definepalet
- {\dodoubleargument\dodefinepalet}
-
-\def\dodefinepalet[#1][#2]%
- {\doifassignmentelse{#2}
- {%\showmessage\m!colors6{#1}%
- \letvalue{\??pa#1}\empty
- \setevalue{\??pa\??pa#1}{#2}%
- \def\dodododefinepalet[##1=##2]%
- {\doifvaluesomething{\??pa#1}
- {\setevalue{\??pa#1}{\csname\??pa#1\endcsname,}}%
- \setevalue{\??pa#1}{\csname\??pa#1\endcsname##1}%
- \dodefinepaletcolor{#1}{##1}{##2}}%
- \def\dododefinepalet##1%
- {\dodododefinepalet[##1]}%
- \processcommalist[#2]\dododefinepalet}
- {\doifdefined{\??pa#2}
- {\expanded{\dodefinepalet[#1][\csname\??pa\??pa#2\endcsname]}}}}
-
-\ifx\dodefinepaletcolor\undefined
- \let\dodefinepaletcolor\gobblethreearguments
-\fi
-
-\let\paletsize\!!zerocount
-
-\def\getpaletsize[#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
-%D Colors are taken from the current palet, if defined.
-%D Setting the current palet is done by:
-%D
-%D \showsetup{setuppalet}
-
-\let\currentpalet\empty
-
-\def\setuppalet
- {\dosingleempty\dosetuppalet}
-
-\def\dosetuppalet[#1]%
- {\edef\currentpalet{#1}%
- \ifx\currentpalet\empty
- % seems to be a reset
- \else\ifcsname\??pa\currentpalet\endcsname
- \edef\currentpalet{#1:}%
- \else
- \showmessage\m!colors7\currentpalet
- \let\currentpalet\empty
- \fi\fi}
-
-%D \macros
-%D {showpalet}
-%D
-%D The previous visualization was typeset with:
-%D
-%D \typebuffer[palet]
-%D
-%D This commands is defined as:
-%D
-%D \showsetup{showpalet}
-
-\fetchruntimecommand \showpalet {\f!colorprefix\s!run}
-
-%D \macros
-%D {showcolorcomponents}
-%D
-%D \starttyping
-%D \showcolorcomponents[color-1,color-2]
-%D \stoptyping
-
-\fetchruntimecommand \showcolorcomponents {\f!colorprefix\s!run}
-
-%D \macros
-%D {definecolorgroup}
-%D
-%D The naming of the colors in this palet suggests some
-%D ordening, which in turn is suported by color grouping.
-%D
-%D \starttyping
-%D \definecolorgroup
-%D [red]
-%D [1.00:0.90:0.90,
-%D 1.00:0.80:0.80,
-%D 1.00:0.70:0.70,
-%D 1.00:0.55:0.55,
-%D 1.00:0.40:0.40,
-%D 1.00:0.25:0.25,
-%D 1.00:0.15:0.15,
-%D 0.90:0.00:0.00]
-%D \stoptyping
-%D
-%D In such a color group colors are numbered from~$1$ to~$n$.
-%D
-%D \showsetup{definecolorgroup}
-%D
-%D This kind of specification is not only more compact than
-%D defining each color separate, it also loads faster and takes
-%D less bytes.
-
-\def\definecolorgroup
- {\dotripleempty\dodefinecolorgroup}
-
-\def\dododefinecolorgroupgray [#1][#2:#3]{\definecolor [#1:\the\colorcount][s=#2]}
-\def\dododefinecolorgrouprgb [#1][#2:#3:#4:#5]{\definecolor [#1:\the\colorcount][r=#2,g=#3,b=#4]}
-\def\dododefinecolorgroupcmyk[#1][#2:#3:#4:#5:#6]{\definecolor [#1:\the\colorcount][c=#2,m=#3=,y=#4,k=#5]}
-\def\dododefinecolorgroupspot [#1][#2:#3:#4]{\definespotcolor[#1:\the\colorcount][#2][p=#3]}
-
-\def\dododefinecolorgroup#1#2%
- {\advance\colorcount\plusone
- \getvalue{dododefinecolorgroup\currentcolorspace}[#1][#2:0:0:0:0]}
-
-\def\dodefinecolorgroup[#1][#2][#3]% obsolete, just use palets
- {\ifthirdargument
- \doifelsenothing{#2}{\let\currentcolorspace\v!rgb}{\def\currentcolorspace{#2}}%
- \colorcount\zerocount
- \processcommalist[#3]{\dododefinecolorgroup{#1}}%
- \else
- \doifinstringelse{:}{#2}
- {\definecolorgroup[#1][\v!rgb][#2]}
- {\doloop
- {\doifdefinedelse{\??cr#2:\recurselevel}
- {\setevalue{\??cr#1:\recurselevel}{\csname\??cr#2:\recurselevel\endcsname}}
- {\exitloop}}}%
- \fi}
-
-%D \macros
-%D {showcolorgroup}
-%D
-%D We can show the group by:
-%D
-%D \startbuffer
-%D \showcolorgroup [blue] [horizontal,name,number,value]
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D or in color:
-%D
-%D \startlinecorrection
-%D \getbuffer
-%D \stoplinecorrection
-%D
-%D which uses:
-%D
-%D \showsetup{showcolorgroup}
-
-\fetchruntimecommand \showcolorgroup {\f!colorprefix\s!run}
-
-%D There are ten predefined color groups, like
-%D \color[green]{\em groen}, \color[red]{\em rood},
-%D \color[blue]{\em blauw}, \color[cyan]{\em cyaan},
-%D \color[magenta]{\em magenta} and \color[yellow]{\em geel}.
-%D
-%D \startlinecorrection
-%D \hbox to \hsize
-%D {\hss
-%D \showcolorgroup [red] [vertical,name,number]\hss
-%D \showcolorgroup [green] [vertical,name]\hss
-%D \showcolorgroup [blue] [vertical,name]\hss
-%D \showcolorgroup [cyan] [vertical,name]\hss
-%D \showcolorgroup [magenta][vertical,name]\hss
-%D \showcolorgroup [yellow] [vertical,name]\hss}
-%D \stoplinecorrection
-%D
-%D These groups are used to define palets {\em alfa} upto {\em
-%D zeta}. As long as we don't use colors from the same row, we
-%D get ourselves distinctive palets. By activating such a palet
-%D one gains access to its members {\em top} to {\em charm} (of
-%D course one should use more suitable names than these).
-%D
-%D \startlinecorrection
-%D \hbox to \hsize
-%D {\showpalet [alfa] [vertical,name,number]\hss
-%D \showpalet [beta] [vertical,name]\hss
-%D \showpalet [gamma] [vertical,name]\hss
-%D \showpalet [delta] [vertical,name]\hss
-%D \showpalet [epsilon] [vertical,name]\hss
-%D \showpalet [zeta] [vertical,name]}
-%D \stoplinecorrection
-%D
-%D By using the keyword \type {value} the individual color
-%D components are shown too. When printed in color, these
-%D showcases show both the colors and the gray value.
-
-%D \macros
-%D {comparepalet}
-%D
-%D There are some more testing macros available:
-%D
-%D \startbuffer
-%D \comparepalet [alfa]
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D shows the palet colors against a background:
-%D
-%D \startlinecorrection
-%D \getbuffer
-%D \stoplinecorrection
-%D
-%D The formal definition is:
-%D
-%D \showsetup{comparepalet}
-
-\fetchruntimecommand \comparepalet {\f!colorprefix\s!run}
-
-%D \macros
-%D {comparecolorgroup}
-%D
-%D The similar command:
-%D
-%D \startbuffer
-%D \comparecolorgroup [blue]
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D shows color groups:
-%D
-%D \startlinecorrection
-%D \getbuffer
-%D \stoplinecorrection
-%D
-%D this commands are defined as:
-%D
-%D \showsetup{comparecolorgroup}
-
-\fetchruntimecommand \comparecolorgroup {\f!colorprefix\s!run}
-
-%D \macros
-%D {showcolor}
-%D
-%D But let's not forget that we also have the more traditional
-%D non||related colors. These show up after:
-%D
-%D \starttyping
-%D \showcolor [name]
-%D \stoptyping
-%D
-%D Where \type{name} for instance can be \type{rgb}.
-%D
-%D \showsetup{showcolor}
-
-\fetchruntimecommand \showcolor {\f!colorprefix\s!run}
-
-%D It would make sense to put the following code in \type
-%D {colo-mps}, but it it rather low level.
-
-%D \macros
-%D {negatecolorcomponent,negatedcolorcomponent}
-%D
-%D These speak for themselves. See \type {colo-ext} for usage.
-
-\def\negatecolorcomponent#1% #1 = \macro
- {\scratchdimen\onepoint\advance\scratchdimen-#1\onepoint
- \ifdim\scratchdimen<\zeropoint\scratchdimen\zeropoint\fi
- \edef#1{\withoutpt\the\scratchdimen}}
-
-\let\negatedcolorcomponent\firstofoneargument
-
-\def\negatedcolorcomponent#1%
- {\ifdim\dimexpr\onepoint-#1\onepoint\relax<\zeropoint
- \!!zerocount
- \else
- \expandafter\withoutpt\the\dimexpr\onepoint-#1\onepoint\relax
- \fi}
-
-\def\negatecolorcomponent#1% #1 = \macro
- {\edef#1{\negatedcolorcomponent{#1}}}
-
-%D \macros
-%D {ifMPgraphics, ifMPcmykcolors, MPcolor}
-%D
-%D A very special macro is \type{\MPcolor}. This one can be
-%D used to pass a \CONTEXT\ color to \METAPOST.
-%D
-%D \starttyping
-%D \MPcolor{my own red}
-%D \stoptyping
-%D
-%D This macro returns a \METAPOST\ triplet \type{(R,G,B)}.
-%D Unless \CMYK\ color support is turned on with \type
-%D {MPcmyk}, only \cap{RGB} colors and gray scales are
-%D supported.
-
-\newif\ifMPcmykcolors % \MPcmykcolorsfalse
-\newif\ifMPspotcolors % \MPspotcolorsfalse
-
-\ifx\MPcolor\undefined
- \def\MPcolor#1{(0,0,0)}
-\fi
-
-%D \macros
-%D {PDFcolor,FDFcolor}
-%D
-%D Similar alternatives are avaliable for \PDF:
-
-%D For the moment we keep the next downward compatibility
-%D switch, i.e.\ expanded colors. However, predefined colors
-%D and palets are no longer expanded (which is what I wanted
-%D in the first place).
-%D
-%D Well, in case we want to do color separation and use CMYK
-%D colors only, this is dangerous since unwanted remapping may
-%D take place. Especially when we redefine already defined
-%D colors in another color space (e.g. darkgreen is
-%D predefined in RGB color space, so a redefinition in CMYK
-%D coordinates before RGB mode is disabled, would give
-%D unexpected results due to the already frozen color spec.)
-%D
-%D So, from now on, colors are not frozen any more!
-
-\chardef\currentcolorchannel=0
-
-\newif\iffilterspotcolor \filterspotcolorfalse
-\newif\ifdoingspotcolor \doingspotcolorfalse
-
-\def\registercolorchannel#1%
- {\ifdoingspotcolor \else
- \global\expandafter\chardef\csname\??cs#1\endcsname\zerocount
- \fi}
-
-\newif\ifhidesplitcolor \hidesplitcolortrue
-
-%D The next macro is for instance used in figure splitting:
-
-\def\doifseparatingcolorselse
- {\iffilterspotcolor
- \@EA\firstoftwoarguments
- \else\ifcase\currentcolorchannel
- \@EAEAEA\secondoftwoarguments
- \else
- \@EAEAEA\firstoftwoarguments
- \fi\fi}
-
-\def\doifcolorchannelelse#1%
- {\doifseparatingcolorselse
- {\doifelsenothing{#1}
- \secondoftwoarguments
- {\doifelse{#1}\@@clsplit
- \firstoftwoarguments
- \secondoftwoarguments}}
- \secondoftwoarguments}
-
-\def\resetcolorseparation
- {\filterspotcolorfalse
- \chardef\currentcolorchannel\zerocount}
-
-%D These can be used in selecting specific files (like
-%D figuredatabases).
-
-% we already have:
-%
-% \def\colorsplitsuffix{\ifcase\currentcolorchannel\else-\@@clsplitsen\fi}
-% \def\colorsplitprefix{\ifcase\currentcolorchannel\else\@@clsplitsen-\fi}
-
-\def\colorchannelprefix{\doifseparatingcolorselse\@@clsplit\empty-}
-\def\colorchannelsuffix{-\doifseparatingcolorselse\@@clsplit\empty}
-
-%D We now define the low level macros:
-
-\chardef\colorversion=1
-
-%D Color support is not present in \TEX. Colorful output can
-%D however be accomplished by using specials. This also means
-%D that this support depends on the \DVI\ driver used. At the
-%D moment this module was written, still no decent standard on
-%D color specials has been agreed upon. We therefore decided to
-%D implement a mechanism that is as independant as possible of
-%D drivers.
-%D
-%D Color support shares with fonts that is must be implemented
-%D in a way that permits processing of individual \DVI\ pages.
-%D Furthermore it should honour grouping. The first condition
-%D forces us to use a scheme that keeps track of colors at
-%D page boundaries. This can be done by means of \TEX's
-%D marking mechanism (\type{\mark}).
-%D
-%D When building pages, \TEX\ periodically looks at the
-%D accumulated typeset contents and breaks the page when
-%D suitable. At that moment, control is transfered to the
-%D output routine. This routine takes care of building the
-%D pagebody and for instance adds headers and footers. The page
-%D can be broken in the middle of some colored text, but
-%D headers and footers are often in black upon white or
-%D background. If colors are applied there, they definitely
-%D are used local, which means that they don't cross page
-%D borders.
-%D
-%D Boxes are handled as a whole, which means that when we
-%D apply colors inside a box, those colors don't cross page
-%D boundaries, unless of course boxes are split or unboxed.
-%D Especially in interactive texts, colors are often used in
-%D such a local way: in boxes (buttons and navigational tools)
-%D or in the pagebody (backgrounds).
-%D
-%D So we can distinguish local colors, that don't cross
-%D pages from global colors, of which we can end many pages
-%D later. The color macros will treat both types in a different
-%D way, thus gaining some speed.
-%D
-%D This module also deals with gray scales. Because similar
-%D colors can end up in the same gray scale when printed in
-%D black and white, we also implement a palet system that deals
-%D with these matters. Because of fundamental differences
-%D between color and gray scale printing, in \CONTEXT\ we also
-%D differ between these. For historic reasons |<|we first
-%D implemented gray scales using patterns of tiny periods|>|
-%D and therefore called them {\em rasters}. So don't be
-%D surprised if this term shows up.
-
-%D \macros
-%D {definecolor}
-%D
-%D We will enable users to specify colors in \cap{RGB} and
-%D \cap{CMYK} color spaces or gray scales using
-%D
-%D \showsetup{definecolor}
-%D
-%D For example:
-%D
-%D \starttyping
-%D \definecolor [SomeKindOfRed] [r=.8,g=.05,b=.05]
-%D \stoptyping
-%D
-%D Such color specifications are saved in a macro in the
-%D following way:
-%D
-%D \starttyping
-%D \setvalue{\??cr name}{R:r:g:b}
-%D \setvalue{\??cr name}{C:c:m:y:k}
-%D \setvalue{\??cr name}{S:s}
-%D \stoptyping
-%D
-%D Gray scales are specified with the \type{s} parameter,
-%D where the \type {s} is derived from {\em screen}.
-%D
-%D Starting with \PDF\ 1.4 (2001) \CONTEXT\ supports
-%D transparent colors. The transparency factor is represented
-%D by a \type {t} and the transparency method by an \type {a}
-%D (alternative). Later we will implement more control
-%D (probably by symbolic methods. So, currently the data is
-%D stored as follows:
-%D
-%D \starttyping
-%D \setvalue{\??cr name}{R:r:g:b:a:t}
-%D \setvalue{\??cr name}{C:c:m:y:k:a:t}
-%D \setvalue{\??cr name}{S:s:a:t}
-%D \stoptyping
-
-% r g b : rbg
-% c m y k : cmyk
-% s : gray
-% p n d f : spot
-% h : hexadecimal
-% t a : transparency
-% e : equivalent (spotcolors)
-
-\def\@@cl@@z{0}
-\def\@@cl@@o{1}
-
-\def\@@resetcolorparameters
- {\let\@@cl@@r\@@cl@@z \let\@@cl@@g\@@cl@@z \let\@@cl@@b\@@cl@@z
- \let\@@cl@@c\@@cl@@z \let\@@cl@@m\@@cl@@z \let\@@cl@@y\@@cl@@z \let\@@cl@@k\@@cl@@z
- \let\@@cl@@s\@@cl@@z
- \let\@@cl@@p\@@cl@@o \let\@@cl@@n\empty \let\@@cl@@d\empty \let\@@cl@@f\@@cl@@o
- \let\@@cl@@h\empty
- \let\@@cl@@e\empty
- \let\@@cl@@t\@@cl@@z \let\@@cl@@a\@@cl@@z}
-
-\@@resetcolorparameters
-
-\def\@@cl@@A{\@@cl@@a} % a hook for symbolic conversion, see below
-
-%D Handling a few nested \type{\cs}'s is no problem (\type
-%D {\@EA\@EAEAEA\@EA}) but we need a full expansion, so I
-%D tried one of the fully expandable primitives using a sort
-%D of delimited thing. I tried \type {\number} first, but this
-%D does not work, but \type {\romannumeral} does. Actually,
-%D \type{\romannumeral0} returns nothing, so it's a perfect
-%D candidate for this kind of hackery. This reminds me that I
-%D have to look into David Kastrup's Euro\TeX\ 2002 article
-%D because he is using \type {\romannumeral} for loops
-%D (repetitive \quote {m} stuff).
-
-% \def\x{\y}\def\y{\z}\def\z{0:1:1:1}
-%
-% \def\bla #1:#2:#3\end{}
-%
-% \@EA\bla\romannumeral\x\end
-
-\def\colorXpattern{0S:\@@cl@@z:\@@cl@@z:\@@cl@@z}
-\def\colorZpattern{0S:\@@cl@@z:\@@cl@@A:\@@cl@@t}
-\def\colorSpattern{0S:\@@cl@@s:\@@cl@@A:\@@cl@@t}
-\def\colorCpattern{0C:\@@cl@@c:\@@cl@@m:\@@cl@@y:\@@cl@@k:\@@cl@@A:\@@cl@@t}
-\def\colorRpattern{0R:\@@cl@@r:\@@cl@@g:\@@cl@@b:\@@cl@@A:\@@cl@@t}
-
-%def\colorPpattern{0P:\@@cl@@n:\@@cl@@p:\@@cl@@A:\@@cl@@t}
-
-\def\colorPpattern{0P:\@@cl@@n:\@@cl@@f:\@@cl@@d:\@@cl@@p:\@@cl@@A:\@@cl@@t}
-
-%D The extra 0 catches empty colors specs (needed for the
-%D \type {\MPcolor} and \type {\PDFcolor} conversion (\type
-%D {\@@cr} equals \type {\relax}!).
-
-\def\handlecolorwith#1{\@EA#1\romannumeral0}
-
-%D Next comes the main definition macro.
-
-\def\dodefinecolor {\dododefinecolor\relax \setvalue \setevalue1}
-\def\dodefineglobalcolor{\dododefinecolor\doglobal\setgvalue\setxvalue1}
-\def\dodefinenamedcolor {\dododefinecolor\doglobal\setvalue \setevalue0}
-
-\let\colorlist\empty % not really used, only for colo-run
-\setfalse\collectcolorsinlist
-\def\collectcolorinlist#1{\doglobal\addtocommalist{#1}\colorlist}
-
-\def\dododefinecolor#1#2#3#4[#5][#6]% #2==set(g)value #3==set[e|x]value
- {\ifconditional\collectcolorsinlist\collectcolorinlist{#5}\fi
- \doifassignmentelse{#6}
- {\@@resetcolorparameters
- \getparameters[\??cl @@][#6]%
- \ifx\@@cl@@h\empty
- \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{{[#6]},#5}%
- #3{\??cr#5}{\colorZpattern}}
- {#3{\??cr#5}{\colorSpattern}}}
- {#3{\??cr#5}{\colorCpattern}}}
- {#3{\??cr#5}{\colorRpattern}}%
- \else
- \setxvalue{\??cr#5}{\colorHpattern}%
- \fi
- % new: e=external spot color name
- \ifx\@@cl@@e\empty \else
- \doregisterspotcolorname{#5}\@@cl@@e
- \fi}
- {\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%
- {\csname\??cr\currentpalet#1\endcsname}
-
-%D Hex color support is not enabled by default. You need to say \type
-%D {\setupcolor [hex]} to get this working.
-
-\ifx\colorHpattern\undefined \let\colorHpattern\colorZpattern \fi
-
-%D New and experimental.
-
-\def\dodefinespotcolor[#1][#2][#3]% todo: always global
- {\doifnot{#1}{#2}
- {\@@resetcolorparameters
- \ifconditional\collectcolorsinlist\collectcolorinlist{#1}\fi
- \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
-
-\def\registerusedspotcolors
- {\ifx\allspotcolors\empty \else
- \bgroup
- \let\usedspotcolors\empty
- \def\docommand##1%
- {\doifdefined{\??cs##1}{\addtocommalist{##1}\usedspotcolors}}%
- \processcommacommand[\allspotcolors]\docommand
- \savecurrentvalue\usedspotcolors\usedspotcolors
- \egroup
- \fi}
-
-\def\registerusedcolorchannels
- {\bgroup
- \doifdefinedelse{\??cs c}
- {\def\usedcolorchannels{c,m,y,k}}%
- {\let\usedcolorchannels\empty}%
- \doifdefined{\??cs r}
- {\addtocommalist{r,g,b}\usedcolorchannels}%
- \doifdefined{\??cs s}
- {\ExpandBothAfter\doifnotinset{k}\usedcolorchannels
- {\addtocommalist{s}\usedcolorchannels}}%
- \savecurrentvalue\usedcolorchannels\usedcolorchannels
- \egroup}
-
-\prependtoks
- \registerusedspotcolors
- \registerusedcolorchannels
-\to \everylastshipout
-
-\def\registerusedspotcolor#1%
- {\global\@EA\chardef\csname\??cs#1\endcsname\zerocount}
-
-%D On top of spotcolors, we define multitone colors. You'd better know
-%D what you're doing because invalid definitions will lead to invalid
-%D documents (i.e.\ resources).
-
-% \definecolor [darkblue] [c=.5,m=.5]
-% \definecolor [darkyellow] [y=.5]
-%
-% \definemultitonecolor [whatever] [darkblue=.5,darkyellow=.5] [c=.25,m=.25,y=.25] [a=1,t=.5]
-% \definemultitonecolor [another] [darkblue=.5,darkyellow=.5] [c=.25,m=.25,y=.25]
-
-\def\dodefinemultitonecolor[#1][#2][#3][#4]%
- {\let\@@cl@@cl@@D\empty % n's
- \let\@@cl@@cl@@P\empty % p's
- \let\@@cl@@cl@@N\empty % name
- \scratchcounter\zerocount
- \processcommacommand[#2]\dododefinemultitonecolor
- \bgroup
- \lccode`\.=`\_%
- \lccode`\,=`\_%
- \lccode`\:=`\_%
- \lccode`\;=`\_%
- \lccode`\+=`\_%
- \lccode`\-=`\_%
- \lccode`\*=`\_%
- \lccode`\/=`\_%
-% \lccode`\_=`\_%
- % not needed, other attribute in driver:
- %
- % \@@resetcolorparameters
- % \getparameters[#4]%
- % \ifx\@@cl@@t\@@cl@@z\else
- % \edef\@@cl@@cl@@N{\@@cl@@cl@@N_\@@cl@@t_\@@cl@@a}%
- % \fi
- \lowercase\@EA{\@EA\xdef\@EA\@@cleancolor\@EA{\@@cl@@cl@@N}}%
- \egroup
- \setxvalue{\??cl\@@cleancolor\s!check}{\noexpand\docheckmultitonecolor{\@@cl@@cl@@D}}%
- \expanded{\defineglobalcolor[\@@cleancolor][#3,#4]}%
- \expanded{\definespotcolor[#1][\@@cleancolor][#4,f=\the\scratchcounter,p={\@@cl@@cl@@P},d={\@@cl@@cl@@D}]}}
-
-\def\docheckmultitonecolor#1%
- {\flushatshipout
- {\let\checkmultitonecolor\gobbleoneargument
- \def\docommand##1{\hbox{\definecolor[\s!dummy-100][##1][p=1]\color[\s!dummy-100]}}%
- \processcommalist[#1]\docommand}}
-
-\def\checkmultitonecolor#1%
- {\csname\??cl#1\s!check\endcsname\letgvalue{\??cl#1\s!check}\relax}
-
-\def\dodefinespotcolor[#1][#2][#3]% todo: always global (REDEFINED)
- {\doifnot{#1}{#2}
- {\@@resetcolorparameters
- \ifconditional\collectcolorsinlist\collectcolorinlist{#1}\fi
- \edef\@@cl@@n{#2}%
- \getparameters[\??cl @@][#3]%
- \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
-
-\def\dododefinemultitonecolor#1%
- {\advance\scratchcounter\plusone
- \splitstring#1\at=\to\!!stringa\and\!!stringb
- \ifx\@@cl@@cl@@D\empty
- \let\@@cl@@cl@@D\!!stringa
- \let\@@cl@@cl@@P\!!stringb
- \normalizecolor\!!stringb
- \edef\@@cl@@cl@@N{\!!stringa_\!!stringb}%
- \else
- \edef\@@cl@@cl@@D{\@@cl@@cl@@D,\!!stringa}%
- \edef\@@cl@@cl@@P{\@@cl@@cl@@P,\!!stringb}%
- \normalizecolor\!!stringb
- \edef\@@cl@@cl@@N{\@@cl@@cl@@N_\!!stringa_\!!stringb}%
- \fi}
-
-% \def\dododefinemultitonecolor#1% a/b safe
-% {\advance\scratchcounter\plusone
-% \splitstring#1\at=\to\@@cl@@one\and\@@cl@@two
-% \ifx\@@cl@@cl@@D\empty
-% \let\@@cl@@cl@@D\@@cl@@one
-% \let\@@cl@@cl@@P\@@cl@@two
-% \normalizecolor\@@cl@@two
-% \edef\@@cl@@cl@@N{\@@cl@@one_\@@cl@@two}%
-% \else
-% \edef\@@cl@@cl@@D{\@@cl@@cl@@D,\@@cl@@one}%
-% \edef\@@cl@@cl@@P{\@@cl@@cl@@P,\@@cl@@two}%
-% \normalizecolor\@@cl@@two
-% \edef\@@cl@@cl@@N{\@@cl@@cl@@N_\@@cl@@one_\@@cl@@two}%
-% \fi}
-
-%D The names of colors are stored in a comma separated list
-%D only for the purpose of showing them with \type {\showcolor}.
-%D
-%D \startbuffer
-%D \definecolor [SomeKindOfRed] [r=.8,g=.05,b=.05]
-%D \stopbuffer
-%D
-%D \typebuffer
-%D \getbuffer
-%D
-%D This color shows up as \color [SomeKindOfRed] {some kind
-%D of red}.
-%D
-%D \starttyping
-%D \setupcolors[state=start]
-%D
-%D \definecolor[mygreen][green]
-%D \definecolor[green][g=.5]
-%D
-%D \startcolor[mygreen]test\stopcolor
-%D
-%D \setupcolors[expansion=no]
-%D
-%D \definecolor[mygreen][green]
-%D \definecolor[green][g=.5]
-%D
-%D \startcolor[mygreen]test\stopcolor
-%D \stoptyping
-
-%D \macros
-%D {startcolormode,stopcolormode,permitcolormode}
-%D
-%D We use \type{\stopcolormode} to reset the color in
-%D whatever color space and do so by calling the corresponding
-%D special. Both commands can be used for fast color
-%D switching, like in colored verbatim,
-
-\newif\ifpermitcolormode \permitcolormodetrue
-
-\def\dowithcolor#1#2% #1=\action #2=color
- {\ifincolor\ifpermitcolormode
- \ifcsname\??cr\currentpalet#2\endcsname
- \handlecolorwith#1\csname\??cr\currentpalet#2\endcsname\od
- \else\ifcsname\??cr#2\endcsname
- \handlecolorwith#1\csname\??cr#2\endcsname\od
- \fi\fi
- \fi\fi}
-
-\def\startcolormode % includes \ifincolor\ifpermitcolormode
- {%\dostoptransparency % needed for: {test \trans test \notrans test}
- \conditionalstoptransparency
- \dowithcolor\execcolorRCSP}
-
-\def\stopcolormode
- {\ifincolor\ifpermitcolormode
- \supportedstoptransparency
- \dostopcolormode
- \fi\fi}
-
-\def\restorecolormode
- {\ifincolor\ifpermitcolormode
- \supportedstoptransparency
- \dostopcolormode
- \ifx\maintextcolor\empty \else
- \startcolormode\maintextcolor
- \fi
- \fi\fi}
-
-%D Color modes are entered using the next set of commands.
-%D The \type{\stop} alternatives are implemented in a way
-%D that permits non||grouped use.
-%D
-%D The, for this module redundant, check if we are in color
-%D mode is needed when we use these macros in other modules.
-
-\def\execcolorRCSP#1:%
- {\csname execcolor#1\endcsname}
-
-\def\execcolorR
- {\iffilterspotcolor
- \@EA\noexeccolorR
- \else
- \@EA\doexeccolorR
- \fi}
-
-\def\execcolorC
- {\iffilterspotcolor
- \@EA\noexeccolorC
- \else
- \@EA\doexeccolorC
- \fi}
-
-\def\execcolorS
- {\iffilterspotcolor
- \@EA\noexeccolorS
- \else
- \@EA\doexeccolorS
- \fi}
-
-\def\execcolorP
- {\iffilterspotcolor
- \@EA\doexeccolorPP
- \else\ifcase\currentcolorchannel
- \@EAEAEA\doexeccolorP
- \else
- \@EAEAEA\noexeccolorP
- \fi\fi}
-
-\def\doexeccolorR#1:#2:#3:%
- {\edef\@@cl@@r{#1}\edef\@@cl@@g{#2}\edef\@@cl@@b{#3}%
- \ifpreferGRAY\ifx\@@cl@@r\@@cr@@g\ifx\@@cl@@r\@@cl@@b
- \GRAYpreferedtrue
- \fi\fi\fi
- \ifincolor\else\RGBsupportedfalse\CMYKsupportedfalse\fi
- \ifGRAYprefered
- \registercolorchannel\c!s
- \let\@@cl@@s\@@cl@@r
- \normalizeGRAY
- \doexeccolorgray
- \else\ifRGBsupported
- \registercolorchannel\c!r
- \normalizeRGB
- \doexeccolorrgb
- \else\ifCMYKsupported
- \registercolorchannel\c!c
- \convertRGBtoCMYK\@@cl@@r\@@cl@@g\@@cl@@b
- \normalizeCMYK
- \doexeccolorcmyk
- \else
- \registercolorchannel\c!s
- \convertRGBtoGRAY\@@cl@@r\@@cl@@g\@@cl@@b
- \normalizeGRAY
- \doexeccolorgray
- \fi\fi\fi
- \exectransparency}
-
-\def\doexeccolorC#1:#2:#3:#4:%
- {\edef\@@cl@@c{#1}\edef\@@cl@@m{#2}\edef\@@cl@@y{#3}\edef\@@cl@@k{#4}%
- \ifpreferGRAY\ifx\@@cl@@k\@@cl@@z\ifx\@@cl@@c\@@cr@@m\ifx\@@cl@@c\@@cl@@y
- \GRAYpreferedtrue
- \fi\fi\fi\fi
- \ifincolor\else\RGBsupportedfalse\CMYKsupportedfalse\fi
- \ifGRAYprefered
- \registercolorchannel\c!s
- \let\@@cl@@s\@@cl@@c
- \normalizeGRAY
- \doexeccolorgray
- \else\ifCMYKsupported
- \registercolorchannel\c!c
- \ifreduceCMYK
- \convertCMYKtoCMY\@@cl@@c\@@cl@@m\@@cl@@y\@@cl@@k
- \fi
- \normalizeCMYK
- \doexeccolorcmyk
- \else\ifRGBsupported
- \registercolorchannel\c!r
- \convertCMYKtoRGB\@@cl@@c\@@cl@@m\@@cl@@y\@@cl@@k
- \normalizeRGB
- \doexeccolorrgb
- \else
- \registercolorchannel\c!s
- \convertCMYKtoGRAY\@@cl@@c\@@cl@@m\@@cl@@y\@@cl@@k
- \normalizeGRAY
- \doexeccolorgray
- \fi\fi\fi
- \exectransparency}
-
-\def\doexeccolorS#1:%
- {\edef\@@cl@@s{#1}%
- \registercolorchannel\c!s
- \normalizeGRAY
- \doexeccolorgray
- \exectransparency}
-
-% \def\doexeccolorP#1:#2:%
-% {\edef\@@cl@@n{#1}%
-% \edef\@@cl@@p{#2}%
-% \registerusedspotcolor\@@cl@@n
-% \ifSPOTsupported
-% \dowithcolor\registerspotcolor\@@cl@@n
-% \dostartspotcolormode\@@cl@@n\@@cl@@p
-% \else
-% \doingspotcolortrue
-% \let\spotcolorfactor\@@cl@@p
-% \factorizecolortrue % using counter and array
-% \dowithcolor\execcolorRCSP\@@cl@@n
-% \factorizecolorfalse
-% \let\spotcolorfactor\@@cl@@o
-% \doingspotcolorfalse
-% \fi
-% \exectransparency}
-
-\def\doexeccolorP#1:#2:#3:#4:%
- {\edef\@@cl@@n{#1}% name
- \edef\@@cl@@f{#2}% fractions
- \edef\@@cl@@d{#3}% definitions
- \edef\@@cl@@p{#4}%
- \ifx\@@cl@@d\empty
- \let\@@cl@@d\@@cl@@n
- \fi
- \registerusedspotcolor\@@cl@@n
- \ifSPOTsupported
- \checkmultitonecolor\@@cl@@n
- \dowithcolor\registerspotcolor\@@cl@@n
- \dostartspotcolormode\@@cl@@n\@@cl@@p
- \else
- \doingspotcolortrue
- \normalizespotcolor\@@cl@@p
- \let\spotcolorfactor\@@cl@@p
- \factorizecolortrue % using counter and array
- \dowithcolor\execcolorRCSP\@@cl@@n
- \factorizecolorfalse
- \let\spotcolorfactor\@@cl@@o
- \doingspotcolorfalse
- \fi
- \exectransparency}
-
-\def\doexeccolorPindex#1:#2:#3:#4:%
- {\edef\@@cl@@n{#1}%
- \edef\@@cl@@f{#2}%
- \edef\@@cl@@d{#3}%
- \edef\@@cl@@p{#4}%
- \ifx\@@cl@@d\empty
- \let\@@cl@@d\@@cl@@n
- \fi
- \ifSPOTsupported
- \checkmultitonecolor\@@cl@@n
- \dowithcolor\registerindexcolor\@@cl@@n
- \fi
- \noexectransparency}
-
-\def\doexeccolorPP#1:#2:%
- {\edef\@@cl@@n{#1}%
- \edef\@@cl@@p{#2}%
- \registerusedspotcolor\@@cl@@n
- \ifx\@@cl@@n\currentspotcolor
- \normalizeSPOT
- \dostartgraycolormode\@@cl@@p % was spotcolormode
- \else
- \dovidecolor\@@cl@@p\@@cl@@o
- \fi
- \exectransparency}
-
-\def\doexeccolorrgb
- {\ifcase\currentcolorchannel
- \dostartrgbcolormode\@@cl@@r\@@cl@@g\@@cl@@b
- \or \or \or \or
- \or \dostartgraycolormode\@@cl@@r
- \or \dostartgraycolormode\@@cl@@g
- \or \dostartgraycolormode\@@cl@@b
- \fi}
-
-\def\doexeccolorcmyk
- {\ifcase\currentcolorchannel
- \dostartcmykcolormode\@@cl@@c\@@cl@@m\@@cl@@y\@@cl@@k
- \or \negatecolorcomponent\@@cl@@c\dostartgraycolormode\@@cl@@c
- \or \negatecolorcomponent\@@cl@@m\dostartgraycolormode\@@cl@@m
- \or \negatecolorcomponent\@@cl@@y\dostartgraycolormode\@@cl@@y
- \or \negatecolorcomponent\@@cl@@k\dostartgraycolormode\@@cl@@k
- \fi}
-
-\def\doexeccolorgray
- {\ifcase\currentcolorchannel
- \dostartgraycolormode\@@cl@@s
- \or \or \or
- \or \dostartgraycolormode\@@cl@@s
- \or \or \or
- \or \dostartgraycolormode\@@cl@@s
- \fi}
-
-%D When filtering colors, we need to either erase
-%D the background, or ignore the foreground.
-
-% \newif\ifhidesplitcolor \hidesplitcolortrue
-%
-% \def\noexeccolor#1\od
-% {\dostartgraycolormode\@@cl@@o}
-%
-% \let\noexeccolorS\noexeccolor
-% \let\noexeccolorP\noexeccolor
-
-%D Well, here comes some real trickery. When we have the 100\%
-%D spot color or black color, we don't want to erase the
-%D background. So, instead we hide the content by giving it
-%D zero transparency.
-
-% todo : #1#2#3 met #2 > of < and #3 een threshold
-
-\def\dohidecolor#1#2%
- {\ifhidesplitcolor
- \ifx#1#2%
- \dostartgraycolormode\@@cl@@o
- \else
- \doregisternonecolor
- \dostartnonecolormode
- \fi
- \else
- \dostartgraycolormode\@@cl@@o
- \fi}
-
-\def\dovidecolor#1#2%
- {\ifhidesplitcolor
- \ifx#1#2%
- \doregisternonecolor
- \dostartnonecolormode
- \else
- \dostartgraycolormode\@@cl@@o
- \fi
- \else
- \dostartgraycolormode\@@cl@@o
- \fi}
-
-% \def\fullytransparentcolor % fails on floats
-% {\dostartgraycolormode\@@cl@@o % better than z
-% %\global\@EA\chardef\csname\@@currenttransparent\endcsname\plusone
-% %\global\intransparenttrue
-% \dostarttransparency10}
-
-\def\noexeccolorR#1:#2:#3:#4\od
- {\edef\@@cl@@r{#1}\edef\@@cl@@g{#2}\edef\@@cl@@b{#3}%
- \dohidecolor\@@cl@@s\@@cl@@o}
-
-\def\noexeccolorC#1:#2:#3:#4:#5\od
- {\edef\@@cl@@c{#1}\edef\@@cl@@m{#2}\edef\@@cl@@y{#3}\edef\@@cl@@k{#4}%
- \dohidecolor\@@cl@@s\@@cl@@o}
-
-\def\noexeccolorS#1:#2\od
- {\edef\@@cl@@s{#1}%
- \dohidecolor\@@cl@@s\@@cl@@o}
-
-\def\noexeccolorP#1:#2:#3:#4:#5\od
- {\edef\@@cl@@p{#4}%
- \dohidecolor\@@cl@@p\@@cl@@z}
-
-%D For the sake of postprocessing (i.e.\ color separation)
-%D we can normalize colors, which comes down to giving equal
-%D values an equal accuracy and format. This feature is
-%D turned off by default due to a speed penalty. This macro
-%D also handles spot color percentages.
-
-\newif\iffactorizecolor
-\newif\ifnormalizecolor
-
-\def\spotcolorfactor{1}
-
-% \def\normalizecolor#1%
-% {\colordimen#1\thousandpoint
-% \colordimen\spotcolorfactor\colordimen
-% \colorcount\colordimen
-% \advance\colorcount \medcard
-% \divide\colorcount \maxcard
-% \edef#1{\realcolorvalue\colorcount}}
-
-\def\normalizecolor#1%
- {\colorcount\numexpr(\dimexpr\spotcolorfactor\dimexpr#1\thousandpoint\relax\relax+\medcard)/\maxcard\relax
- \edef#1{\realcolorvalue\colorcount}}
-
-% \def\normalizespotcolor#1%
-% {\colordimen-#1\thousandpoint
-% \advance\colordimen\thousandpoint
-% \colorcount\colordimen
-% \advance\colorcount \medcard
-% \divide\colorcount \maxcard
-% \edef#1{\realcolorvalue\colorcount}}
-
-\def\normalizespotcolor#1%
- {\colorcount\numexpr(\dimexpr\thousandpoint-#1\thousandpoint\relax+\medcard)/\maxcard\relax
- \edef#1{\realcolorvalue\colorcount}}
-
-\def\donormalizeRGB
- {\normalizecolor\@@cl@@r
- \normalizecolor\@@cl@@g
- \normalizecolor\@@cl@@b}
-
-\def\normalizeRGB
- {\ifnormalizecolor
- \donormalizeRGB
- \else\iffactorizecolor
- \donormalizeRGB
- \fi\fi}
-
-\def\donormalizeCMYK
- {\normalizecolor\@@cl@@c
- \normalizecolor\@@cl@@m
- \normalizecolor\@@cl@@y
- \normalizecolor\@@cl@@k}
-
-\def\normalizeCMYK
- {\ifnormalizecolor
- \donormalizeCMYK
- \else\iffactorizecolor
- \donormalizeCMYK
- \fi\fi}
-
-\def\donormalizeGRAY
- {\normalizecolor\@@cl@@s}
-
-\def\normalizeGRAY
- {\ifnormalizecolor
- \donormalizeGRAY
- \else\iffactorizecolor
- \donormalizeGRAY
- \fi\fi}
-
-\def\normalizeSPOT
- {\normalizespotcolor\@@cl@@p}
-
-%D We need to register spot colors (i.e.\ resources need to
-%D be created.
-
-\def\registerspotcolor#1:%
- {\ifcsname\??cl:\c!p:\@@cl@@n\endcsname
- \@EA\dontregisterspotcolor
- \else
- \letgvalue{\??cl:\c!p:\@@cl@@n}\empty
- %\@EA\@EA\csname registerspotcolor#1\endcsname
- \csname registerspotcolor#1\@EA\endcsname
- \fi}
-
-% todo: convert to rgb if needed, will will do this in mkiv
-
-\def\dontregisterspotcolor #1\od{}
-\def\registerspotcolorR #1:#2:#3:#4\od{\doregisterrgbspotcolor \@@cl@@n\@@cl@@f\@@cl@@d\@@cl@@p{#1}{#2}{#3}}
-\def\registerspotcolorC#1:#2:#3:#4:#5\od{\doregistercmykspotcolor\@@cl@@n\@@cl@@f\@@cl@@d\@@cl@@p{#1}{#2}{#3}{#4}}
-\def\registerspotcolorS #1:#2\od{\doregistergrayspotcolor\@@cl@@n\@@cl@@f\@@cl@@d\@@cl@@p{#1}}
-\def\registerspotcolorP #1:#2:#3\od{\doregistergrayspotcolor\@@cl@@n\@@cl@@f\@@cl@@d\@@cl@@p{#2}}
-
-%D Experimental feature:
-
-% \definecolor [darkblue] [c=1,m=.38,y=0,k=.64] % pantone pms 2965 uncoated m
-% \definecolor [darkyellow] [c=0,m=.28,y=1,k=.06] % pantone pms 124 uncoated m
-%
-% \definecolor [darkblue-50] [darkblue] [p=.5]
-% \definecolor [darkyellow-50] [darkyellow] [p=.5]
-% \definecolor [darkblue-80] [darkblue] [p=.8]
-% \definecolor [darkyellow-80] [darkyellow] [p=.8]
-%
-% \definecolor [darkblue,darkyellow] [r=.8]
-% \definecolor [darkdull-5030] [darkblue,darkyellow] [p={.5,.3}]
-%
-% \setupcolors[state=start]
-%
-% \blackrule[width=4cm,height=3cm,color=darkblue-50]
-% \blackrule[width=4cm,height=3cm,color=darkblue-80]
-% \blackrule[width=4cm,height=3cm,color=darkyellow-50]
-% \blackrule[width=4cm,height=3cm,color=darkyellow-80]
-% \blackrule[width=4cm,height=3cm,color=darkdull-5030]
-
-%D Experimental too (special purpose code).
-
-\def\registerindexcolor#1:%
- {\ifcsname\??cl:i:\@@cl@@n\endcsname
- \@EA\dontregisterindexcolor
- \else
- \letgvalue{\??cl:i:\@@cl@@n}\empty % signal
- \showmessage\m!colors{12}\@@cl@@n
- \@EA\@EA\csname registerindexcolor#1\endcsname
- \fi}
-
-\let\dontregisterindexcolor\dontregisterspotcolor
-
-\def\registerindexcolorR #1:#2:#3:#4\od{\doregisterrgbindexcolor \@@cl@@n\@@cl@@f\@@cl@@d\@@cl@@p{#1}{#2}{#3}}
-\def\registerindexcolorC#1:#2:#3:#4:#5\od{\doregistercmykindexcolor\@@cl@@n\@@cl@@f\@@cl@@d\@@cl@@p{#1}{#2}{#3}{#4}}
-\def\registerindexcolorS #1:#2\od{\doregistergrayindexcolor\@@cl@@n\@@cl@@f\@@cl@@d\@@cl@@p{#1}}
-\def\registerindexcolorP #1:#2:#3\od{\doregistergrayindexcolor\@@cl@@n\@@cl@@f\@@cl@@d\@@cl@@p{#2}}
-
-\def\predefinecolor[#1]%
- {\bgroup
- \flushatshipout{\hbox{\localcolortrue\color[#1]{}}}% real ones
- \egroup}
-
-\def\predefineindexcolor[#1]%
- {\bgroup
- \flushatshipout{\hbox{\localcolortrue\color[#1]{}}}% real ones
- \let\doexeccolorP\doexeccolorPindex
- \flushatshipout{\hbox{\localcolortrue\color[#1]{}}}% index one
- \egroup}
-
-% \def\checkpredefinedcolor[#1]%
-% {\ifcase\internalspotcolorsize{#1}\relax
-% \@EA\predefinecolor\or\@EA\predefinecolor\else\@EA\predefineindexcolor
-% \fi[#1]}
-
-\let\checkpredefinedcolor\predefineindexcolor % we need an index in order to negate bitmaps
-
-%D Transparency is handled similar for all three color modes. We
-%D can turn transparency off with the following switch:
-
-\newif\iftransparencysupported \transparencysupportedtrue % only mkii
-
-\def\exectransparency
- {\iftransparencysupported
- \expandafter\doexectransparency
- \else
- \expandafter\noexectransparency
- \fi}
-
-\def\doexectransparency#1:#2\od
- {\ifcase#1\space
- \global\intransparentfalse
- \else
- \global\intransparentfalse
- %\dostarttransparency{#1}{#2}%
- \supportedstarttransparency{#1}{#2}%
- \global\intransparenttrue
- \fi}
-
-\def\noexectransparency#1\od
- {}
-
-%D Experimental: minimize transparency resets.
-
-\newif\ifintransparent
-\newif\ifoptimizetransparency \optimizetransparencytrue % under test
-
-\let\supportedstoptransparency\relax
-
-\def\conditionalstoptransparency
- {\ifoptimizetransparency
- \ifintransparent
- \global\intransparentfalse
- \supportedstoptransparency
- \fi
- \else
- \supportedstoptransparency
- \fi}
-
-\def\supportedstarttransparency
- {\iftransparencysupported
- \globallet\supportedstoptransparency\dostoptransparency
- \expandafter\dostarttransparency
- \else
- \expandafter\gobbletwoarguments
- \fi}
-
-%D We now use the \type {\@@cl@@A} hook to implement
-%D symbolic names. These are converted into numbers
-%D at definition time (which saves runtime).
-
-\def\dodefinetransparency[#1][#2]%
- {\@EA\chardef\csname\??cl-#1\endcsname#2\relax}
-
-\def\transparencynumber#1%
- {\number\executeifdefined{\??cl-#1}{#1}}
-
-%D Now we hook 'm into the patterns:
-
-\def\@@cl@@A{\transparencynumber\@@cl@@a}
-
-%D The next macro can be used to return to the (normal)
-%D page color. This macro is used in the same way as
-%D \type {\color}.
-
-\def\startregistercolor[#1]%
- {\permitcolormodefalse\startcolor[#1]\permitcolormodetrue}
-
-\def\stopregistercolor
- {\permitcolormodefalse\stopcolor\permitcolormodetrue}
-
-\def\starttextcolor[#1]%
- {\doifsomething{#1}
- {\bgroup
- \def\stoptextcolor % also goes ok with \page after
- {\let\maintextcolor\empty % this one because the top of
- \stopregistercolor % page sets the color right (side
- \egroup}% % effect)
- \def\starttextcolor[##1]%
- {\bgroup
- % \@@themaintextcolor==##1 is catched in \definecolor
- \definecolor[\@@themaintextcolor][##1]%
- \let\stoptextcolor\egroup}%
- \startregistercolor[\@@themaintextcolor]%
- \definecolor[\@@themaintextcolor][#1]%
- \let\maintextcolor\@@themaintextcolor}}
-
-\let\stoptextcolor\relax
-
-%D The following hook permits proper support at the text
-%D level. This definition actually belongs in another
-%D module. (May need a different \MKIV\ implementation.)
-
-% \ifx\initializemaintextcolor\undefined
-
- \let\@@clprevcolor\empty
-
- \def\initializemaintextcolor
- {% 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}
- {\edef\@@clprevcolor{\@@cltextcolor}%
- \let\maintextcolor\@@themaintextcolor
- \doifelsenothing\@@cltextcolor % another saveguard
- {\definecolor[\@@themaintextcolor][\defaulttextcolor]}%
- {\definecolor[\@@themaintextcolor][\@@cltextcolor]}%
- \doinitializemaintextcolor}}
-
- \def\doinitializemaintextcolor
- {\appendtoks\starttextcolor[\@@themaintextcolor]\to\everystarttext
- \appendtoks\stoptextcolor \to\everystoptext
- \let\doinitializemaintextcolor\relax}
-
-% \fi
-
-\def\localstarttextcolor
- {\ifx\maintextcolor\empty
- \startcolormode\defaulttextcolor
- \else
- \startcolormode\maintextcolor
- \fi}
-
-% \def\localstoptextcolor
-% {\stopcolormode}
-%
-% better:
-
-\def\localstoptextcolor
- {\restorecolormode}
-
-\def\restoretextcolor
- {\ifx\maintextcolor\empty
- \expandafter\dorestoretextcolor
- \else
- % obey main text color
- \fi}
-
-\def\dorestoretextcolor
- {\color[\defaulttextcolor]}
-
-%D We use some reserved names for local color components.
-%D Consistent use of these scratch variables saves us
-%D unneccessary hash entries.
-%D
-%D \starttyping
-%D \@@cl@@r \@@cl@@g \@@cl@@b
-%D \@@cl@@c \@@cl@@m \@@cl@@y \@@cl@@k
-%D \@@cl@@s
-%D \stoptyping
-%D
-%D We implement several conversion routines.
-%D
-%D \starttyping
-%D \convertRGBtoCMYK {r} {g} {b}
-%D \convertRGBtoGRAY {r} {g} {b}
-%D \convertCMYKtoRGB {c} {m} {y} {k}
-%D \convertCMYKtoGRAY {c} {m} {y} {k}
-%D \convertCMYKtoCMY {c} {m} {y} {k}
-%D \stoptyping
-%D
-%D The relation between \cap{Gray}, \cap{RGB} and \cap{CMYK}
-%D is:
-%D
-%D \placeformula[-]
-%D \startformula
-%D G = .30r + .59g + .11b
-%D = 1.0 - \min(1.0,\ .30c + .59m + .11y + k)
-%D \stopformula
-%D
-%D When converting from \cap{CMYK} to \cap{RGB} we use the
-%D formula:
-%D
-%D \placeformula[-]
-%D \startformula
-%D \eqalign
-%D {r &= 1.0 - \min(1.0,\ c+k) \cr
-%D g &= 1.0 - \min(1.0,\ m+k) \cr
-%D b &= 1.0 - \min(1.0,\ y+k)}
-%D \stopformula
-%D
-%D In the conversion routine the color components are calculated
-%D in three digits precision.
-
-\def\realcolorvalue#1%
- {\ifnum#1>\zerocount % important, first encountered in --modu supp-mpe
- \ifnum#1<\plusten 0.00\the#1\else
- \ifnum#1<\plushundred 0.0\the#1\else
- \ifnum#1<\plusthousand 0.\the#1\else
- 1\fi\fi\fi
- \else 0\fi}
-
-% \def\doconvertCMYKtoRGB#1\k#2\to#3%
-% {\ifdim#2\points>#1\points% >= problem, repaired 2/12/2002
-% \let#3\@@cl@@z % k >= color
-% \else
-% \colordimen\onepoint
-% \advance\colordimen -#1\points
-% \advance\colordimen -#2\points
-% \multiply\colordimen \plusthousand
-% \colorcount\colordimen
-% \advance\colorcount \medcard
-% \divide\colorcount \maxcard
-% \edef#3{\realcolorvalue\colorcount}%
-% \fi}
-
-\def\doconvertCMYKtoRGB#1\k#2\to#3%
- {\colorcount\numexpr(\dimexpr\plusthousand\dimexpr\onepoint-#1\points-#2\points\relax\relax+\medcard)/\maxcard\relax
- \ifnum\colorcount>\zeropoint
- \edef#3{\realcolorvalue\colorcount}%
- \else
- \let#3\@@cl@@z
- \fi}
-
-\def\convertCMYKtoRGB#1#2#3#4%
- {\doconvertCMYKtoRGB#1\k#4\to\@@cl@@r
- \doconvertCMYKtoRGB#2\k#4\to\@@cl@@g
- \doconvertCMYKtoRGB#3\k#4\to\@@cl@@b}
-
-% \def\doconvertRGBtoCMYK#1\to#2%
-% {\colordimen#1\points
-% \multiply\colordimen \plusthousand
-% \colorcount\colordimen
-% \advance\colorcount \medcard
-% \divide\colorcount \maxcard
-% \colorcount-\colorcount
-% \advance\colorcount \plusthousand
-% \edef#2{\realcolorvalue\colorcount}}
-
-\def\doconvertRGBtoCMYK#1\to#2%
- {\colorcount\numexpr\plusthousand-(\dimexpr\plusthousand\dimexpr#1\points\relax\relax+\medcard)/\maxcard\relax
- \edef#2{\realcolorvalue\colorcount}}
-
-\def\convertRGBtoCMYK#1#2#3%
- {\doconvertRGBtoCMYK#1\to\@@cl@@c
- \doconvertRGBtoCMYK#2\to\@@cl@@m
- \doconvertRGBtoCMYK#3\to\@@cl@@y
- \let\@@cl@@k\@@cl@@z}
-
-%D The following switch is mainly meant for (hidden)
-%D documentation purposes.
-
-\def\nGRAYfactor{333.333}
-\def\rGRAYfactor{\ifweightGRAY300\else\nGRAYfactor\fi}
-\def\gGRAYfactor{\ifweightGRAY590\else\nGRAYfactor\fi}
-\def\bGRAYfactor{\ifweightGRAY110\else\nGRAYfactor\fi}
-
-% \def\convertRGBtoGRAY#1#2#3%
-% {\colordimen#1\points
-% \colordimen\rGRAYfactor\colordimen
-% \colorcount\colordimen
-% \colordimen#2\points
-% \colordimen\gGRAYfactor\colordimen
-% \advance\colorcount \colordimen
-% \colordimen#3\points
-% \colordimen\bGRAYfactor\colordimen
-% \advance\colorcount \colordimen
-% \advance\colorcount \medcard
-% \divide\colorcount \maxcard
-% \edef\@@cl@@s{\realcolorvalue\colorcount}}
-
-\def\convertRGBtoGRAY#1#2#3%
- {\colorcount\numexpr
- (\dimexpr\rGRAYfactor\dimexpr#1\points\relax\relax+
- \dimexpr\gGRAYfactor\dimexpr#2\points\relax\relax+
- \dimexpr\bGRAYfactor\dimexpr#3\points\relax\relax+
- \medcard)/\maxcard
- \relax
- \edef\@@cl@@s{\realcolorvalue\colorcount}}
-
-\def\convertCMYKtoGRAY#1#2#3#4%
- {\convertCMYKtoRGB{#1}{#2}{#3}{#4}%
- \convertRGBtoGRAY\@@cl@@r\@@cl@@g\@@cl@@b}
-
-% \def\doconvertCMYKtoCMY#1\k#2\to#3%
-% {\colordimen#1\points
-% \advance\colordimen #2\points\relax
-% \ifdim\colordimen>\onepoint
-% \colordimen\onepoint
-% %\else
-% % \colordimen\colordimen
-% \fi
-% \multiply\colordimen \plusthousand
-% \colorcount\colordimen
-% \advance\colorcount \medcard
-% \divide\colorcount \maxcard
-% \edef#3{\realcolorvalue\colorcount}}
-
-\def\doconvertCMYKtoCMY#1\k#2\to#3%
- {\colorcount\numexpr(\dimexpr\plusthousand\dimexpr#1\points+#2\points\relax\relax+\medcard)/\maxcard\relax
- \ifnum\colorcount>\plusthousand
- \let#3\@@cl@@o
- \else
- \edef#3{\realcolorvalue\colorcount}%
- \fi}
-
-\def\convertCMYKtoCMY#1#2#3#4%
- {\doconvertCMYKtoCMY#1\k#4\to\@@cl@@c
- \doconvertCMYKtoCMY#2\k#4\to\@@cl@@m
- \doconvertCMYKtoCMY#3\k#4\to\@@cl@@y
- \let\@@cl@@k\@@cl@@z}
-
-%D Before we present the color macros, we first define the
-%D setup command. This command takes care of setting up the
-%D booleans that control local and global behavior (more on
-%D that later) and conversion to other color spaces.
-
-\let\currentspotcolor \empty
-\let\previousspotcolor\empty
-
-%D The tests depend on the use of constants. If we use the \MKIV\
-%D method we can share more.
-
-\def\doifcolorelse#1%
- {\ifcsname\??cr\ifcsname\??cr\currentpalet#1\endcsname\currentpalet\fi#1\endcsname
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\def\doifcolor#1%
- {\ifcsname\??cr\ifcsname\??cr\currentpalet#1\endcsname\currentpalet\fi#1\endcsname
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-%D There are a couple of different color switching macros,
-%D the local ones can be used to speed up things (only in \MKII).
-
-\def\localstartcolor
- {\ifincolor
- \localcolortrue
- \expandafter\doglobalstartcolor
- \else
- \expandafter\noglobalstartcolor
- \fi}
-
-\def\localstopcolor
- {\ifincolor
- \doglobalstopcolor
- \else
- \noglobalstopcolor
- \fi}
-
-\unexpanded\def\startcolor
- {\ifincolor
- \expandafter\doglobalstartcolor
- \else
- \expandafter\noglobalstartcolor
- \fi}
-
-\unexpanded\def\stopcolor
- {\ifincolor
- \doglobalstopcolor
- \else
- \noglobalstopcolor
- \fi}
-
-%D This macros call the global color switching ones. Starting
-%D a global, i.e. a possible page boundary crossing, color
-%D mode also sets a \type{\mark} in \TEX's internal list.
-
-\newcount\colorlevel
-
-\letvalue{\??cl0C}\empty % saved color
-\letvalue{\??cl0S}\empty % stop command
-
-%D We keep a positive color stack for foreground colors, and
-%D a negative one for backgrounds. Not that brilliant a
-%D solution, but it suits. The signs are swapped when the
-%D page ornaments are typeset.
-
-\let\@@colorplus \plusone
-\let\@@colorminus\minusone
-
-\def\@@currentcolorname {\??cl\the\colorlevel C}
-\def\@@currentcolorstop {\??cl\the\colorlevel S}
-%def\@@currenttransparent{\??cl\the\colorlevel T}
-
-\letvalue{\??cl*\s!black}\s!black
-
-\def\currentcolorname
- {\csname
- \ifcsname\@@currentcolorname\endcsname
- \expandafter\ifx\csname\@@currentcolorname\endcsname\empty
- \??cl*\s!black
- \else
- \@@currentcolorname
- \fi
- \else
- \??cl*\s!black
- \fi
- \endcsname}
-
-\def\outercolorname
- {\ifcsname\@@currentcolorname\endcsname
- \expandafter\ifx\csname\@@currentcolorname\endcsname\empty
- \s!black
- \else
- currentcolor%
- \fi
- \else
- \s!black
- \fi}
-
-% not the following, because we need a different tag in order to trick the stack
-%
-% \def\outercolorname{\executeifdefined\@@currentcolorname\s!black}
-%
-% \def\startcurrentcolor{\expanded{\startcolor[\s!black]\noexpand\startcolor[\outercolorname]}}
-% \def\stopcurrentcolor {\stopcolor\stopcolor}
-%
-% test case:
-%
-% \setupcolors[state=start,textcolor=red]
-% \starttext
-% red
-% \color[green]{green
-% \startMPcode
-% label(\sometxt{green\color[blue]{blue}green}, origin) withcolor red;
-% draw fullcircle scaled 1cm xscaled 2;
-% \stopMPcode
-% green}
-% red
-% \stoptext
-
-\def\dodoglobalstartcolor
- {\global\@EA\let\@EA\@@currentcolor\csname\@@currentcolorname\endcsname
- \global\advance\colorlevel \@@colorplus
- \global\@EA\let\csname\@@currentcolorname\endcsname\@@askedcolor
- %\debuggerinfo\m!colors
- % {start \@@askedcolor\space at level \the\colorlevel}%
- \ifx\@@askedcolor\empty
- \global\@EA\let\csname\@@currentcolorname\endcsname\@@currentcolor
- \global\@EA\let\csname\@@currentcolorstop\endcsname\donoglobalstopcolor
- \else\ifx\@@askedcolor\@@currentcolor
- \global\@EA\let\csname\@@currentcolorstop\endcsname\donoglobalstopcolor
- \else
- \doifcolorelse\@@askedcolor
- {%\docolormark\@@askedcolor
- \ifpermitcolormode\docolormark\@@askedcolor\fi
- \global\@EA\let\csname\@@currentcolorstop\endcsname\dodoglobalstopcolor
- \startcolormode\@@askedcolor}
- {\global\@EA\let\csname\@@currentcolorstop\endcsname\donoglobalstopcolor
- \showmessage\m!colors3\@@askedcolor\empty}%
- \fi\fi}
-
-\def\doglobalstartcolor[#1]%
- {\edef\@@askedcolor{#1}%
- \ifcase\colorlevel\relax
- \ifx\@@askedcolor\empty
- \global\@EA\let\csname\@@currentcolorstop\endcsname\empty
- \else
- \dodoglobalstartcolor
- \fi
- \else
- \dodoglobalstartcolor
- \fi
- \ignorespaces}
-
-\def\noglobalstartcolor[#1]%
- {}
-
-\def\dodoglobalstopcolor
- {\ifcase\colorlevel \else
- \donoglobalstopcolor
- \global\@EA\let\@EA\@@previouscolor\csname\@@currentcolorname\endcsname
- \ifcase\colorlevel\relax
- \ifpermitcolormode
- \docolormark\empty
- \conditionalstoptransparency
- \dostopcolormode
- \fi
- \else % let's do a bit redundant testing here
- \docolormark\@@previouscolor
- \ifx\@@previouscolor\empty
- \ifpermitcolormode
- \conditionalstoptransparency
- \dostopcolormode
- \fi
- \else
- \doifcolorelse\@@previouscolor
- {\ifx\@@currentcolor\@@previouscolor\else
- % alternatively we could let \startcolormode handle this
- \ifpermitcolormode
- \conditionalstoptransparency % really needed
- % more safe but less efficient: \dostopcolormode
- \fi
- \startcolormode\@@previouscolor
- \fi}
- {\ifpermitcolormode
- \conditionalstoptransparency
- \dostopcolormode
- \fi}%
- \fi
- \fi
- \fi}
-
-\def\donoglobalstopcolor
- {\ifcase\colorlevel \else
- \global\@EA\let\@EA\@@currentcolor\csname\@@currentcolorname\endcsname
- %\debuggerinfo{\m!colors}
- % {stop \@@currentcolor\normalspace at level \the\colorlevel}%
- \global\advance\colorlevel \@@colorminus
- \fi}
-
-\def\doglobalstopcolor
- {\csname\@@currentcolorstop\endcsname}
-
-\let\noglobalstopcolor\relax
-
-\let\faststartcolor\doglobalstartcolor
-\let\faststopcolor \doglobalstopcolor
-
-%D We don't use grouping and save each stop alternative. This
-%D permits be especially useful in for instance local color
-%D support in verbatim. Using \type{\bgroup}||\type{\egroup}
-%D pairs could interfere with calling commands
-
-%D This color mechanism takes care of nested colors, like in:
-%D
-%D \startbuffer
-%D \color[green]{groen \color[green]{groen \color[red]{rood}} groen}
-%D \color[green]{groen \color[]{groen \color[red]{rood}} groen}
-%D \color[green]{groen \color[red]{rood \color[red]{rood}} groen}
-%D \color[green]{groen \color[green]{groen \color[]{groen}} groen}
-%D \color[green]{groen \color[red]{rood} groen}
-%D \color[green]{groen \color[]{groen} groen}
-%D \color[]{zwart \color[red]{rood} zwart}
-%D \color[]{zwart}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D or
-%D
-%D \startvoorbeeld
-%D \startlines
-%D \getbuffer
-%D \stoplines
-%D \stopvoorbeeld
-%D
-%D Crossing page boundaries is of course also handled.
-%D Undefined or empty color specifications are treated as
-%D efficient as possible.
-%D
-%D \startbuffer
-%D \startcolor[green]
-%D [green] \input tufte [green] \par
-%D \startcolor[]
-%D [green] \input knuth [green] \par
-%D \startcolor[red]
-%D [red] \input tufte [red] \par
-%D \startcolor[yellow]
-%D [yellow] \input knuth [yellow] \par
-%D \stopcolor
-%D [red] \input tufte [red] \par
-%D \stopcolor
-%D [green] \input knuth [green] \par
-%D \stopcolor
-%D [green] \input tufte [green] \par
-%D \stopcolor
-%D \stopbuffer
-%D
-%D \startpacked
-%D \getbuffer
-%D \stoppacked
-%D
-%D These quotes are typeset by saying:
-%D
-%D \typebuffer
-
-%D We already mentioned that colors interfere with building
-%D the pagebody. This means that when the page is composed,
-%D the colors temporary have to be reset. After the page is
-%D shipped out, we have to revive the current color.
-%D
-%D We use \type{\mark}s to keep track of colors across page
-%D boundaries. Unfortunately standard \TEX\ supports only one mark,
-%D and using this one for color support only would be a waste.
-%D We therefore use an adapted version of J.~Fox's multiple mark
-%D mechanism as (re|)|implemented in \module{supp-mrk}.
-
-\doifdefinedelse{rawnewmark}
- {\rawnewmark\colormark}
- {\let\colormark\gobbleoneargument}
-
-%D Using this mark mechanism with lots of colors has one
-%D major drawback: \TEX's memory tends to overflow when
-%D very colorful text is stored in a global box. Even worse is that
-%D the processing time grows considerably. We therefore support
-%D local as well as global color switching.
-%D
-%D Of the next macros, \type {\popcolor} is to be used after
-%D the actual \type {\shipout} and \type {\startcolorpage} and
-%D \type {\stopcolorpage} are called when entering and leaving
-%D the \type {\pagebody} builder. In case of emergencies
-%D \type {\pushcolor} can be used to undo the current color,
-%D for instance when insertions are appended to the page.
-%D
-%D Out of efficiency we only use marks when needed. The next
-%D macro tries to find out if indeed a mark should be set.
-%D This macro uses the boolean \type {\ifinpagebody}, which can
-%D be defined and set in the module that handles the pagebody.
-
-\def\docolormark#1%
- {\iflocalcolor \else \ifinpagebody \else \ifinframed \else
- \dodocolormark{#1}%
- \fi \fi \fi}
-
-\let\lastcolormark=\empty
-
-\def\dodocolormark#1%
- {\edef\newcolormark{#1}%
- \ifx\newcolormark\lastcolormark\else
- \global\let\lastcolormark\newcolormark
- \@EA\rawsetmark\@EA\colormark\@EA{\lastcolormark}%
- \fi}
-
-%D \macros
-%D {pushcolor, popcolor}
-%D
-%D Pushing the current state in the output routine simply comes
-%D to resetting the color to black, while popping restores the
-%D color state to that of before the break.
-
-\def\topofpagecolor{\rawgetbotmark\colormark} % see postponing
-
-\def\pushcolor
- {\stopcolormode}
-
-\def\popcolor
- {\doifsomething{\rawgetbotmark\colormark}
- {%\debuggerinfo\m!colors{popping \getbotmark\colormark}%
- \startcolormode{\rawgetbotmark\colormark}}}
-
-\def\popsplitcolor
- {\getsplitmarks\colormark % hier wel
- \doifsomething{\rawgetsplitbotmark\colormark}
- {%\debuggerinfo\m!colors{split popping \getsplitbotmark\colormark}%
- \startcolormode{\rawgetsplitbotmark\colormark}}}
-
-\appendtoks\pushcolor \to\everypushproperties
-\appendtoks\popcolor \to\everypopproperties
-\appendtoks\popsplitcolor\to\everypopsplitproperties
-
-% Private macro: only needed in test cases (like multiple
-% seperations in one file); no user command!
-
-\def\resynccolor
- {\ifcase\pagetotal % \ifdim\pagetotal=\zeropoint
- \popcolor
- \else\ifx\@@currentcolor\empty
- \ifx\maintextcolor\empty\else
- \startcolormode\maintextcolor
- \fi
- \else
- \startcolormode\@@currentcolor
- \fi\fi}
-
-% weird stuff
-
-\def\pushpostponedpagecolor
- {\edef\savedtopofpagecolor{\topofpagecolor}%
- \doifsomething\savedtopofpagecolor\restorecolormode} % \stopcolormode
-
-\def\poppostponedpagecolor
- {\doifsomething\savedtopofpagecolor\startcolormode\savedtopofpagecolor}
-
-%D \macros
-%D {startcolorpage, stopcolorpage}
-%D
-%D Local use can be forced with the next two macros. Nesting
-%D is still supported but colors are no longer marked.
-%D
-%D The next implementation makes (simple) color separation more
-%D easy. It also supports nested colors in page backgrounds
-%D and texts.
-
-\def\startcolorpage
- {\bgroup
- \let\@@colorplus \minusone
- \let\@@colorminus\plusone
- \let\docolormark\gobbleoneargument
- \edef\savedcolorlevel{\the\colorlevel}%
- \global\colorlevel\zerocount % before \localstartcolor of
- \ifx\maintextcolor\empty % course, ugly bug removed
- \localstartcolor[\defaulttextcolor]%
- \else
- \localstartcolor[\maintextcolor]%
- \fi}
-
-\def\stopcolorpage
- {\localstopcolor
- \global\colorlevel\savedcolorlevel
- \egroup}
-
-\appendtoks \startcolorpage\to\everystarttextproperties
-\prependtoks\stopcolorpage \to\everystoptextproperties
-
-%D We want color support to be similar to font support and
-%D therefore implement \type{\color} using grouping.
-%D
-%D When \type {\somecolor} is issued, we can savely assume
-%D grouping. Using \type {\groupedcommand} here (i.e.\ the
-%D definition of \type {\color}) is unsafe because in
-%D interferes with for instance switching attributes.
-
-\unexpanded\def\color[#1]%
- {\groupedcommand{\startcolor[#1]}\stopcolor}
-
-%D This implementation enables use of defined colors like:
-%D
-%D \starttyping
-%D Look at the {\brightgreen bright} side of life and get
-%D yourself no \red{red} head!
-%D \stoptyping
-
-%D Also wrong, test in combinations: \type{...{}{\red test}}
-%D
-%D \def\switchtocolor[#1]%
-%D {\startcolor[#1]\aftergroup\stopcolor}
-
-\def\switchtocolor[#1]% grouping is realy needed, else migration
- {\bgroup\startcolor[#1]\aftergroup\stopcolor\aftergroup\egroup}
-
-\unexpanded\def\color[#1]%
- {\groupedcommand{\startcolor[#1]}\stopcolor}
-
-\unexpanded\def\graycolor[#1]% not \gray because this is a color
- {\groupedcommand{\RGBsupportedfalse\CMYKsupportedfalse\SPOTsupportedfalse\startcolor[#1]}\stopcolor}
-
-\unexpanded\def\colored[#1]%
- {\groupedcommand{\definecolor[@colored@][#1]\startcolor[@colored@]}\stopcolor}
-
-%D We can speed the following macros a bit up, but this
-%D hardly pays off; they are only used in the manual.
-
-\def\realcolorformat#1%
- {\ifnum#1<\plusten 0.00\the#1\else
- \ifnum#1<\plushundred 0.0\the#1\else
- \ifnum#1<\plusthousand 0.\the#1\else
- 1.000\fi\fi\fi}
-
-\def\dodoformatcolor#1%
- {\colordimen#1\points\relax
- \ifdim\colordimen>\onepoint
- \colordimen\onepoint
- \fi
- \multiply\colordimen \plusthousand
- \colorcount\colordimen
- \advance\colorcount \medcard
- \divide\colorcount \maxcard \relax
- \realcolorformat\colorcount}
-
-\def\doformatcolorR#1:#2:#3:#4:#5\od
- {\dodoformatcolor{#1}\colorformatseparator
- \dodoformatcolor{#2}\colorformatseparator
- \dodoformatcolor{#3}}
-
-\def\doformatcolorC#1:#2:#3:#4:#5:#6\od
- {\dodoformatcolor{#1}\colorformatseparator
- \dodoformatcolor{#2}\colorformatseparator
- \dodoformatcolor{#3}\colorformatseparator
- \dodoformatcolor{#4}}
-
-\def\doformatcolorS#1:#2:#3\od
- {\dodoformatcolor{#1}}
-
-\def\doformatcolorP#1:#2:#3:#4:#5:#6\od
- {#1\colorformatseparator
- \dodoformatcolor{#2}\colorformatseparator
- \dodoformatcolor{#3}\colorformatseparator
- \dodoformatcolor{#4}\colorformatseparator}
-
-\def\doformatcolor#1:%
- {\csname doformatcolor#1\endcsname}
-
-\def\colorvalue
- {\dowithcolor\doformatcolor}
-
-\def\doformatgrayR#1:#2:#3:#4:#5\od
- {\convertRGBtoGRAY{#1}{#2}{#3}%
- \dodoformatcolor\@@cl@@s}
-
-\def\doformatgrayC#1:#2:#3:#4:#5:#6\od
- {\convertCMYKtoGRAY{#1}{#2}{#3}{#4}%
- \dodoformatcolor\@@cl@@s}
-
-\def\doformatgrayS#1:#2:#3\od
- {\dodoformatcolor{#1}}
-
-% \def\doformatgrayP#1:#2:#3:#4:#5:#6\od
-% {\convertSPOTtoGRAY{#1}{#2}{#3}{#4}%
-% \dodoformatcolor\@@cl@@s}
-
-\def\doformatgrayP#1:#2:#3:#4:#5:#6\od
- {todo}
-
-\def\doformatgray#1:%
- {\csname doformatgray#1\endcsname}
-
-\def\grayvalue
- {\dowithcolor\doformatgray}
-
-%D \macros
-%D {localstartraster,localstopraster,
-%D startraster,stopraster}
-%D
-%D The previous conversions are not linear and treat each color
-%D component according to human perception curves. Pure gray
-%D (we call them rasters) has equal color components. In
-%D \CONTEXT\ rasters are only used as backgrounds and these
-%D don't cross page boundaries in the way color does. Therefore
-%D we don't need stacks and marks. Just to be compatible with
-%D color support we offer both 'global' and 'local' commands.
-%D
-%D \starttyping
-%D \def\localstartraster[#1]%
-%D {\doifelsenothing{#1}
-%D {\dostartgraymode\@@rsscreen}
-%D {\dostartgraymode{#1}}}
-%D
-%D \def\localstopraster
-%D {\dostopgraymode}
-%D
-%D \let\startraster\localstartraster
-%D \let\stopraster \localstopraster
-%D \stoptyping
-%D
-%D The next alternative is slower, since it works on top of the
-%D color (stack) mechanism, but it does provide nesting.
-
-\def\dosetrastercolor#1%
- {\edef\@@cl@@s{#1}%
- \ifx\@@cl@@s\empty
- \let\@@cl@@s\@@rsscreen
- \fi
- \let\@@cl@@t\@@cl@@z % else we get rogue
- \let\@@cl@@a\@@cl@@z % transpancies
- \setevalue{\??cr\??rs}{\colorSpattern}}
-
-% beware, don't add extra grouping, else color in tables
-% fails
-
-\def\localstartraster[#1]%
- {\ifincolor\dosetrastercolor{#1}\localstartcolor[\??rs]\fi}
-
-\def\startraster[#1]%
- {\ifincolor\dosetrastercolor{#1}\startcolor[\??rs]\fi}
-
-\def\localstopraster{\ifincolor\localstopcolor\fi}
-\def\stopraster {\ifincolor\stopcolor\fi}
-
-\def\raster[#1]{\groupedcommand{\startraster[#1]}{\stopraster}}
-
-%D Palets use an auxiliary macro:
-
-\def\dodefinepaletcolor#1#2#3%
- {\doifassignmentelse{#3}
- {% == \definepalet[test][xx={y=.4}]
- \definecolor[\??pa#1:#2][#3]%
- \iffreezecolors\@EA\setevalue\else\@EA\setvalue\fi{\??cr#1:#2}{\csname\??cr\??pa#1:#2\endcsname}}
- {% == \definepalet[test][xx=green]
- \doifdefinedelse{\??cr#3}
- {\iffreezecolors\@EA\setevalue\else\@EA\setvalue\fi{\??cr#1:#2}{\csname\??cr#3\endcsname}}
- {\letvalue{\??cr#1:#2}\colorXpattern}}}
-
-%D \MP\ related conversions:
-
-\def\scaledMPcolor#1#2%
- {\ifMPgraphics
- \handlecolorwith\doMPcolor
- \csname\??cr
- \ifcsname\??cr\currentpalet#2\endcsname\currentpalet\fi
- #2\endcsname
- :::::::\end#1\end
- \else
- #2%
- \fi}
-
-\def\MPcolor{\scaledMPcolor1}
-
-%D Before we had transparency available, the following
-%D conversion macro was available:
-%D
-%D \starttyping
-%D \def\doMPcolor#1:#2:#3:#4:#5:#6:#7:#8\end
-%D {\if #1R(#2,#3,#4)%
-%D \else\if#1C\ifMPcmykcolors cmyk(#2,#3,#4,#5)\else(1-#2-#5,1-#3-#5,1-#4-#5)\fi
-%D \else\if#1S(#2,#2,#2)%
-%D \else (0,0,0)%
-%D \fi\fi\fi}
-%D \stoptyping
-%D
-%D In order to be useful, this macro is to be fully
-%D expandabele.
-
-\def\doMPcolor#1:% #1 can be \relax ! ! ! i.e. an empty color
- {\csname MPc\@EA\ifx\csname MPc\string#1\endcsname\relax B\else#1\fi\endcsname}
-
-\def\MPcR{\doMPrgb}
-\def\MPcC{\ifMPcmykcolors\@EA\doMPcmykY\else\@EA\doMPcmykN\fi}
-\def\MPcS{\doMPgray}
-\def\MPcP{\ifMPspotcolors\@EA\doMPspotY\else\@EA\doMPspotN\fi}
-\def\MPcB{\doMPblack}
-
-\def\transparentMP {transparent}
-\def\cmykMP {scaledcmyk}
-\def\cmykASrgbMP {scaledcmykasrgb} % not really needed any more
-\def\rgbMP {scaledrgb}
-\def\grayMP {scaledgray}
-\def\spotMP {spotcolor}
-
-\def\doMPtransparent#1#2:#3:#4\end
- {\ifcase#2\space(#1)\else\transparentMP(#2,#3,(#1))\fi}
-
-\def\doMPgray#1:#2\end#3\end
- {\doMPtransparent{\grayMP(#1,#3)}#2\end}
-
-\def\doMPrgb#1:#2:#3:#4\end#5\end
- {\doMPtransparent{\rgbMP(#1,#2,#3,#5)}#4\end}
-
-\def\doMPcmykY#1:#2:#3:#4:#5\end#6\end
- {\doMPtransparent{\cmykMP(#1,#2,#3,#4,#6)}#5\end}
-
-\def\doMPcmykN#1:#2:#3:#4:#5\end#6\end
- {\doMPtransparent{\cmykASrgbMP(#1,#2,#3,#4,#6)}#5\end}
-
-\def\doMPspotY#1:#2:#3:#4:#5\end#6\end % best make #3 same as #1 when empty
- {\doMPtransparent{multitonecolor("#1",#2,"#3","#4")}#5\end}
-
-\def\doMPspotN#1:#2:#3:#4:#5\end#6\end
- {\scaledMPcolor{#4}{#1}}
-
-\def\doMPblack#1\end#2\end
- {\unknownMPcolor}
-
-\def\unknownMPcolor
- {(0,0,0)}
-
-\let\processMP\spotMP % for some time, will become obsolete, brrr
-
-%D \PDF\ related conversions:
-
-\def\PDFcolor #1{\handlecolorwith\doPDFcolor \csname\??cr#1\endcsname:::::::\end}
-\def\PDFcolorvalue#1{\handlecolorwith\doPDFcolorvalue\csname\??cr#1\endcsname:::::::\end}
-\def\FDFcolor #1{\handlecolorwith\doFDFcolor \csname\??cr#1\endcsname:::::::\end}
-
-\def\doPDFcolor#1:#2:#3:#4:#5:#6:#7:#8\end
- {\if #1R#2 #3 #4 rg%
- \else\if#1C#2 #3 #4 #5 k%
- \else\if#1S#2 g%
- \else\if#1P#5 g%
- \else 0 g%
- \fi\fi\fi\fi}
-
-\def\doPDFcolorvalue#1:#2:#3:#4:#5:#6:#7:#8\end
- {\if #1R#2 #3 #4%
- \else\if#1C#2 #3 #4 #5%
- \else\if#1S#2%
- \else\if#1P#5%
- \else 0%
- \fi\fi\fi\fi}
-
-\def\doFDFcolor#1:#2:#3:#4:#5:#6:#7:#8\end
- {[\if #1R#2 #3 #4%
- \else\if#1C#2 #3 #4 #5%
- \else\if#1S#2%
- \else\if#1P#5%
- \else 0%
- \fi\fi\fi\fi]}
-
-\def\internalspotcolorname#1{\handlecolorwith\dointernalspotcolorname\csname\??cr#1\endcsname:::::::\end}
-\def\internalspotcolorsize#1{\handlecolorwith\dointernalspotcolorsize\csname\??cr#1\endcsname:::::::\end}
-
-\def\dointernalspotcolorname#1:#2:#3:#4:#5:#6:#7:#8\end{\if#1P\ifcase0#3 #1\else#2\fi\else#1\fi}
-\def\dointernalspotcolorsize#1:#2:#3:#4:#5:#6:#7:#8\end{\if#1P\ifcase0#3 0\else#3\fi\else 0\fi}
-
-%D Because it's a persitent issue, we also provide
-
-\def\pgf@context@registercolor#1%
- {\handlecolorwith\pgf@context@registercolor@indeed\csname\??cr#1\endcsname:::::::>#1\end}
-
-\def\pgf@context@registercolor@indeed#1:#2:#3:#4:#5:#6>#7\end
- {\setevalue{\string\color@#7}{\noexpand\xcolor@{}{}%
- \if#1R{rgb}{#2,#3,#4}\else
- \if#1C{cmyk}{#2,#3,#4,#5}\else
- \if#1S{gray}{#2}\else
- {gray}{0}\fi\fi\fi}}
-
-%D Slow but ok \unknown
-
-\def\colorcomponents#1% might be broken
- {\startnointerference
- \localcolortrue
- \globallet\thecolorcomponents\empty
- \def\doexeccolorR ##1:##2:##3:##4:##5\od{\gdef\thecolorcomponents{r=\twodigitrounding{##1} g=\twodigitrounding{##2} b=\twodigitrounding{##3}}}%
- \def\doexeccolorC##1:##2:##3:##4:##5:##6\od{\gdef\thecolorcomponents{c=\twodigitrounding{##1} m=\twodigitrounding{##2} y=\twodigitrounding{##3} k=\twodigitrounding{##4}}}%
- \def\doexeccolorS ##1:##2:##3\od{\gdef\thecolorcomponents{s=\twodigitrounding{##1}}}%
- \def\doexeccolorP##1:##2:##3:##4:##5:##6\od{\gdef\thecolorcomponents{p=\twodigitrounding{##4} n=##1}}%
- \let\doexeccolorPindex\doexeccolorP
- \backgroundline[#1]{}%
- \stopnointerference
- \thecolorcomponents}
-
-\def\transparencycomponents#1%
- {\startnointerference
- \localcolortrue
- \globallet\thetransparencycomponents\empty
- \def\doexeccolorR ##1:##2:##3:##4:##5\od{\gdef\thetransparencycomponents{a=\twodigitrounding{##4} t=\twodigitrounding{##5}}}%
- \def\doexeccolorC##1:##2:##3:##4:##5:##6\od{\gdef\thetransparencycomponents{a=\twodigitrounding{##5} t=\twodigitrounding{##6}}}%
- \def\doexeccolorS ##1:##2:##3\od{\gdef\thetransparencycomponents{a=\twodigitrounding{##2} t=\twodigitrounding{##3}}}%
- \def\doexeccolorP##1:##2:##3:##4:##5:##6\od{\gdef\thetransparencycomponents{a=\twodigitrounding{##5} t=\twodigitrounding{##6}}}%
- \let\doexeccolorPindex\doexeccolorP
- \backgroundline[#1]{}%
- \stopnointerference
- \thetransparencycomponents}
-
-%D \macros
-%D {everyshapebox}
-%D
-%D A terrible hack, needed because we cannot have marks in
-%D shape boxes.
-
-\appendtoks \localcolortrue \to \everyshapebox
-
-%D \macros
-%D {forcecolorhack}
-%D
-%D Awful \unknown
-
-\let\forcecolorhack\relax
-
-%D We default to the colors defined in \module{colo-rgb} and
-%D support both \cap{RGB} and \cap{CMYK} output. As you can
-%D see, color support is turned off by default. Reduction of
-%D gray colors to gray scales is turned on.
-
-\definecolor[black][s=0]
-\definecolor[white][s=1]
-
-\definetransparency [none] [0]
-\definetransparency [normal] [1]
-\definetransparency [multiply] [2]
-\definetransparency [screen] [3]
-\definetransparency [overlay] [4]
-\definetransparency [softlight] [5]
-\definetransparency [hardlight] [6]
-\definetransparency [colordodge] [7]
-\definetransparency [colorburn] [8]
-\definetransparency [darken] [9]
-\definetransparency [lighten] [10]
-\definetransparency [difference] [11]
-\definetransparency [exclusion] [12]
-\definetransparency [hue] [13]
-\definetransparency [saturation] [14]
-\definetransparency [color] [15]
-\definetransparency [luminosity] [16]
-
-\setupcolors
- [\c!state=\v!stop,
- \c!conversion=\v!yes,
- \c!reduction=\v!no,
- \c!rgb=\v!yes,
- \c!cmyk=\v!yes,
- \c!spot=\v!yes,
- \c!mp\c!cmyk=\@@clcmyk,
- \c!mp\c!spot=\@@clspot,
- \c!expansion=\v!no,
- \c!textcolor=,
- \c!split=\v!no,
- \c!criterium=\v!all]
-
-\setupcolor
- [\v!rgb]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/colo-rgb.mkii b/Master/texmf-dist/tex/context/base/mkii/colo-rgb.mkii
deleted file mode 100644
index f734c7a014c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/colo-rgb.mkii
+++ /dev/null
@@ -1,530 +0,0 @@
-%D \module
-%D [ file=colo-rgb,
-%D version=1995.01.01,
-%D title=\CONTEXT\ Color Macros,
-%D subtitle=RGB,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Just to give users a start we define some colors. While
-%D switching fonts is as international as can be, thanks to the
-%D mnemonics, naming colors is very interface dependant. To
-%D support international setups, we define both english and
-%D interface dependant colors. We use the color inheritance
-%D mechanisms to implement the interface dependant ones.
-
-%D First we define some simple primary \cap{RGB} and \cap{CMYK}
-%D colors. All colors are defined in \cap{RGB} color space.
-
-\definecolor [red] [r=1, g=0, b=0]
-\definecolor [green] [r=0, g=1, b=0]
-\definecolor [blue] [r=0, g=0, b=1]
-
-\definecolor [cyan] [r=0, g=1, b=1]
-\definecolor [magenta] [r=1, g=0, b=1]
-\definecolor [yellow] [r=1, g=1, b=0]
-
-\definecolor [white] [s=1] % [r=1, g=1, b=1]
-\definecolor [black] [s=0]
-\definecolor [gray] [s=.9]
-
-\definecolor [darkred] [r=.8, g=0, b=0]
-\definecolor [middlered] [r=.9, g=0, b=0]
-\definecolor [lightred] [r=1, g=0, b=0]
-
-\definecolor [darkgreen] [r=0, g=.6, b=0]
-\definecolor [middlegreen] [r=0, g=.8, b=0]
-\definecolor [lightgreen] [r=0, g=1, b=0]
-
-\definecolor [darkblue] [r=0, g=0, b=.8]
-\definecolor [middleblue] [r=0, g=0, b=.9]
-\definecolor [lightblue] [r=0, g=0, b=1]
-
-\definecolor [darkcyan] [r=.6, g=.8, b=.8]
-\definecolor [middlecyan] [r=0, g=.8, b=.8]
-
-\definecolor [darkmagenta] [r=.8, g=.6, b=.8]
-\definecolor [middlemagenta] [r=1, g=0, b=.6]
-
-\definecolor [darkyellow] [r=.8, g=.8, b=.6]
-\definecolor [middleyellow] [r=1, g=1, b=.2]
-
-\definecolor [darkgray] [s=.5]
-\definecolor [middlegray] [s=.7]
-\definecolor [lightgray] [s=.9]
-
-%D These colors are mapped to interface dependant colornames.
-
-\startinterface dutch
-
- \definecolor [rood] [red]
- \definecolor [groen] [green]
- \definecolor [blauw] [blue]
-
- \definecolor [cyaan] [cyan]
- \definecolor [magenta] [magenta]
- \definecolor [geel] [yellow]
-
- \definecolor [wit] [white]
- \definecolor [grijs] [gray]
- \definecolor [zwart] [black]
-
- \definecolor [donkerrood] [darkred]
- \definecolor [middelrood] [middlered]
- \definecolor [lichtrood] [lightred]
-
- \definecolor [donkergroen] [darkgreen]
- \definecolor [middelgroen] [middlegreen]
- \definecolor [lichtgroen] [lightgreen]
-
- \definecolor [donkerblauw] [darkblue]
- \definecolor [middelblauw] [middleblue]
- \definecolor [lichtblauw] [lightblue]
-
- \definecolor [donkercyaan] [darkcyan]
- \definecolor [middelcyaan] [middlecyan]
-
- \definecolor [donkermagenta] [darkmagenta]
- \definecolor [middelmagenta] [middlemagenta]
-
- \definecolor [donkergeel] [darkyellow]
- \definecolor [middelgeel] [middleyellow]
-
- \definecolor [donkergrijs] [darkgray]
- \definecolor [middengrijs] [middlegray]
- \definecolor [lichtgrijs] [lightgray]
-
-\stopinterface
-
-\startinterface german
-
- \definecolor [rot] [red]
- \definecolor [gruen] [green]
- \definecolor [blau] [blue]
-
- \definecolor [cyan] [cyan]
- \definecolor [magenta] [magenta]
- \definecolor [gelb] [yellow]
-
- \definecolor [weiss] [white]
- \definecolor [grau] [gray]
- \definecolor [schwarz] [black]
-
- \definecolor [dunkelrot] [darkred]
- \definecolor [mittelrot] [middlered]
- \definecolor [hellrot] [lightred]
-
- \definecolor [dunkelgruen] [darkgreen]
- \definecolor [mittelgruen] [middlegreen]
- \definecolor [hellgruen] [lightgreen]
-
- \definecolor [dunkelblau] [darkblue]
- \definecolor [mittelblau] [middleblue]
- \definecolor [hellblau] [lightblue]
-
- \definecolor [dunkelcyan] [darkcyan]
- \definecolor [mittelcyan] [middlecyan]
-
- \definecolor [dunkelmagenta] [darkmagenta]
- \definecolor [mittelmagenta] [middlemagenta]
-
- \definecolor [dunkelgelb] [darkyellow]
- \definecolor [mittelgelb] [middleyellow]
-
- \definecolor [dunkelgrau] [darkgray]
- \definecolor [mittelgrau] [middlegray]
- \definecolor [hellgrau] [lightgray]
-
-\stopinterface
-
-\startinterface czech
-
- \definecolor [cervena] [red]
- \definecolor [zelena] [green]
- \definecolor [modra] [blue]
-
- \definecolor [azurova] [cyan]
- \definecolor [fialova] [magenta]
- \definecolor [zluta] [yellow]
-
- \definecolor [bila] [white]
- \definecolor [cerna] [black]
-
- \definecolor [tmavecervena] [darkred]
- \definecolor [strednecervena] [middlered]
- \definecolor [svetlecervena] [lightred]
-
- \definecolor [tmavezelena] [darkgreen]
- \definecolor [strednezelena] [middlegreen]
- \definecolor [svetlezelena] [lightgreen]
-
- \definecolor [tmavemodra] [darkblue]
- \definecolor [strednemodra] [middleblue]
- \definecolor [svetlemodra] [lightblue]
-
- \definecolor [tmaveazurova] [darkcyan]
- \definecolor [stredneazurova] [middlecyan]
-
- \definecolor [tmavefialova] [darkmagenta]
- \definecolor [strednefialova] [middlemagenta]
-
- \definecolor [tmavezluta] [darkyellow]
- \definecolor [strednezluta] [middleyellow]
-
- \definecolor [tmaveseda] [darkgray]
- \definecolor [stredneseda] [middlegray]
- \definecolor [svetleseda] [lightgray]
-
-\stopinterface
-
-\startinterface italian
-
- \definecolor [rosso] [red]
- \definecolor [verde] [green]
- \definecolor [blu] [blue]
-
- \definecolor [azzurro] [cyan]
- \definecolor [turchino] [cyan]
- \definecolor [ciano] [cyan]
- \definecolor [cremisi] [magenta]
- \definecolor [giallo] [yellow]
-
- \definecolor [bianco] [white]
- \definecolor [grigio] [gray]
- \definecolor [nero] [black]
-
- \definecolor [rossoscuro] [darkred]
- \definecolor [rossomedio] [middlered]
- \definecolor [rossochiaro] [lightred]
-
- \definecolor [verdescuro] [darkgreen]
- \definecolor [verdemedio] [middlegreen]
- \definecolor [verdechiaro] [lightgreen]
-
- \definecolor [bluscuro] [darkblue]
- \definecolor [blumedio] [middleblue]
- \definecolor [bluchiaro] [lightblue]
-
- \definecolor [azzurroscuro] [darkcyan]
- \definecolor [azzurrochiaro] [middlecyan]
-
- \definecolor [cremisiscuro] [darkmagenta]
- \definecolor [cremisichiaro] [middlemagenta]
-
-
- \definecolor [gialloscuro] [darkyellow]
- \definecolor [giallomedio] [middleyellow]
-
- \definecolor [grigioscuro] [darkgray]
- \definecolor [grigiomedio] [middlegray]
- \definecolor [grigiochiaro] [lightgray]
-
-\stopinterface
-
-\startinterface romanian
-
- \definecolor [rosu] [red]
- \definecolor [verde] [green]
- \definecolor [albastru] [blue]
-
- \definecolor [cian] [cyan]
- \definecolor [magenta] [magenta]
- \definecolor [galben] [yellow]
-
- \definecolor [alb] [white]
- \definecolor [gri] [gray]
- \definecolor [negru] [black]
-
- \definecolor [rosuinchis] [darkred]
- \definecolor [rosumediu] [middlered]
- \definecolor [rosudeschis] [lightred]
-
- \definecolor [verdeinchis] [darkgreen]
- \definecolor [verdemediu] [middlegreen]
- \definecolor [verdedeschis] [lightgreen]
-
- \definecolor [albastruinchis] [darkblue]
- \definecolor [albastrumediu] [middleblue]
- \definecolor [albastrudeschis] [lightblue]
-
- \definecolor [cianinchis] [darkcyan]
- \definecolor [cianmediu] [middlecyan]
-
- \definecolor [magentainchis] [darkmagenta]
- \definecolor [magentamediu] [middlemagenta]
-
- \definecolor [galbeninchis] [darkyellow]
- \definecolor [galbenmediu] [middleyellow]
-
- \definecolor [griinchis] [darkgray]
- \definecolor [grimediu] [middlegray]
- \definecolor [grideschis] [lightgray]
-
-\stopinterface
-
-%D Like colors, we first define the english colorgroups. These
-%D colorgroups are tuned for distinctive gray scale printing.
-
-% todo : more efficient and real gray
-
-\definecolorgroup
- [gray]
- [0.95:0.95:0.95,
- 0.90:0.90:0.90,
- 0.80:0.80:0.80,
- 0.70:0.70:0.70,
- 0.60:0.60:0.60,
- 0.50:0.50:0.50,
- 0.40:0.40:0.40,
- 0.30:0.30:0.30,
- 0.20:0.20:0.20,
- 0.10:0.10:0.10,
- 0.00:0.00:0.00]
-
-\definecolorgroup
- [red]
- [1.00:0.90:0.90,
- 1.00:0.80:0.80,
- 1.00:0.70:0.70,
- 1.00:0.55:0.55,
- 1.00:0.40:0.40,
- 1.00:0.25:0.25,
- 1.00:0.15:0.15,
- 0.90:0.00:0.00]
-
-\definecolorgroup
- [green]
- [0.90:1.00:0.90,
- 0.70:1.00:0.70,
- 0.50:1.00:0.50,
- 0.30:1.00:0.30,
- 0.15:0.90:0.15,
- 0.00:0.80:0.00,
- 0.00:0.65:0.00,
- 0.00:0.50:0.00]
-
-\definecolorgroup
- [blue]
- [0.90:0.95:1.00,
- 0.80:0.90:1.00,
- 0.55:0.85:1.00,
- 0.30:0.80:1.00,
- 0.15:0.75:1.00,
- 0.00:0.70:1.00,
- 0.00:0.55:1.00,
- 0.00:0.40:1.00]
-
-\definecolorgroup
- [cyan]
- [0.80:1.00:1.00,
- 0.60:1.00:1.00,
- 0.30:1.00:1.00,
- 0.00:0.95:0.95,
- 0.00:0.85:0.85,
- 0.00:0.75:0.75,
- 0.00:0.60:0.60,
- 0.00:0.50:0.50]
-
-\definecolorgroup
- [magenta]
- [1.00:0.90:1.00,
- 1.00:0.80:1.00,
- 1.00:0.65:1.00,
- 1.00:0.50:1.00,
- 1.00:0.35:1.00,
- 1.00:0.15:1.00,
- 0.90:0.05:0.90,
- 0.80:0.00:0.80]
-
-\definecolorgroup
- [yellow]
- [1.00:1.00:0.70,
- 1.00:1.00:0.00,
- 1.00:0.85:0.05,
- 1.00:0.70:0.00,
- 1.00:0.55:0.00,
- 0.95:0.40:0.00,
- 0.80:0.30:0.00,
- 0.60:0.30:0.00]
-
-\definecolorgroup
- [red*]
- [1.00:0.95:0.95,
- 1.00:0.90:0.90,
- 1.00:0.80:0.80,
- 1.00:0.70:0.70,
- 1.00:0.60:0.60,
- 1.00:0.50:0.50,
- 1.00:0.40:0.40,
- 1.00:0.30:0.30]
-
-\definecolorgroup
- [green*]
- [0.95:1.00:0.95,
- 0.90:1.00:0.90,
- 0.80:1.00:0.80,
- 0.70:1.00:0.70,
- 0.60:1.00:0.60,
- 0.50:1.00:0.50,
- 0.40:1.00:0.40,
- 0.30:1.00:0.30]
-
-\definecolorgroup
- [blue*]
- [0.95:0.95:1.00,
- 0.90:0.90:1.00,
- 0.80:0.80:1.00,
- 0.70:0.70:1.00,
- 0.60:0.60:1.00,
- 0.50:0.50:1.00,
- 0.40:0.40:1.00,
- 0.30:0.30:1.00]
-
-\definecolorgroup
- [yellow*]
- [1.00:1.00:0.10,
- 1.00:1.00:0.00,
- 0.90:0.90:0.00,
- 0.80:0.80:0.00,
- 0.70:0.70:0.00,
- 0.60:0.60:0.00,
- 0.50:0.50:0.00,
- 0.40:0.40:0.00]
-
-%D For the sake of implementing interface dependant color
-%D groups we support colorgroup duplication.
-
-\startinterface dutch
- \definecolorgroup [grijs] [gray]
- \definecolorgroup [rood] [red]
- \definecolorgroup [groen] [green]
- \definecolorgroup [blauw] [blue]
- \definecolorgroup [cyaan] [cyan]
- \definecolorgroup [magenta] [magenta]
- \definecolorgroup [geel] [yellow]
- \definecolorgroup [rood*] [red*]
- \definecolorgroup [groen*] [green*]
- \definecolorgroup [blauw*] [blue*]
- \definecolorgroup [geel*] [yellow*]
-\stopinterface
-
-\startinterface german
- \definecolorgroup [grau] [gray]
- \definecolorgroup [rot] [red]
- \definecolorgroup [gruen] [green]
- \definecolorgroup [blau] [blue]
- \definecolorgroup [cyan] [cyan]
- \definecolorgroup [magenta] [magenta]
- \definecolorgroup [gelb] [yellow]
- \definecolorgroup [rot*] [red*]
- \definecolorgroup [gruen*] [green*]
- \definecolorgroup [blau*] [blue*]
- \definecolorgroup [gelb*] [yellow*]
-\stopinterface
-
-\startinterface czech
- \definecolorgroup [seda] [gray]
- \definecolorgroup [cervena] [red]
- \definecolorgroup [zelena] [green]
- \definecolorgroup [modra] [blue]
- \definecolorgroup [azurova] [cyan]
- \definecolorgroup [fialova] [magenta]
- \definecolorgroup [zluta] [yellow]
- \definecolorgroup [cervena*] [red*]
- \definecolorgroup [zelena*] [green*]
- \definecolorgroup [modra*] [blue*]
- \definecolorgroup [zluta*] [yellow*]
-\stopinterface
-
-\startinterface italian
- \definecolorgroup [grigio] [gray]
- \definecolorgroup [rosso] [red]
- \definecolorgroup [verde] [green]
- \definecolorgroup [blu] [blue]
- \definecolorgroup [ciano] [cyan]
- \definecolorgroup [azzurro] [cyan]
- \definecolorgroup [turchino][cyan]
- \definecolorgroup [magenta] [magenta]
- \definecolorgroup [cremisi] [magenta]
- \definecolorgroup [giallo] [yellow]
- \definecolorgroup [rosso*] [red*]
- \definecolorgroup [verde*] [green*]
- \definecolorgroup [blu*] [blue*]
- \definecolorgroup [giallo*] [yellow*]
-\stopinterface
-
-%D The next set of color palets is quite language independant.
-%D These palets are meant as examples.
-
-\definepalet
- [alfa]
- [ top=red:7,
- bottom=green:6,
- up=blue:5,
- down=cyan:4,
- strange=magenta:3,
- charm=yellow:2]
-
-\definepalet
- [beta]
- [ top=red:7,
- bottom=green:5,
- up=blue:3,
- down=cyan:6,
- strange=magenta:2,
- charm=yellow:1]
-
-\definepalet
- [gamma]
- [ top=red:2,
- bottom=green:5,
- up=blue:3,
- down=cyan:6,
- strange=magenta:7,
- charm=yellow:4]
-
-\definepalet
- [delta]
- [ top=yellow*:5,
- bottom=yellow*:3,
- up=yellow*:2,
- down=magenta:6,
- strange=blue:4,
- charm=blue:1]
-
-\definepalet
- [epsilon]
- [ top=cyan:7,
- bottom=cyan:5,
- up=blue:3,
- down=yellow:6,
- strange=yellow:4,
- charm=yellow:2]
-
-\definepalet
- [zeta]
- [ top=red:6,
- bottom=green:5,
- up=blue:7,
- down=cyan:4,
- strange=magenta:3,
- charm=yellow:2]
-
-%D The next four colors are used for typesetting verbatim \TEX\
-%D in color.
-
-\definecolor [texcolorone] [middlered]
-\definecolor [texcolortwo] [middlegreen]
-\definecolor [texcolorthree] [middleblue]
-\definecolor [texcolorfour] [darkyellow]
-
-%D Bonus (needed for FO test):
-
-\definecolor [orange] [r=1,g=.5]
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/colo-run.mkii b/Master/texmf-dist/tex/context/base/mkii/colo-run.mkii
deleted file mode 100644
index 02da462d385..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/colo-run.mkii
+++ /dev/null
@@ -1,257 +0,0 @@
-%D \module
-%D [ file=colo-run,
-%D version=1997.04.01,
-%D title=\CONTEXT\ Color Macros,
-%D subtitle=Runtime loaded commands,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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
-
-% temp hack (not do be documented)
-
-% \gdef\doformatcolorP#1:#2:#3:#4:#5:#6\od % was undefined in colo-ini
-% {#1\colorformatseparator
-% \dodoformatcolor{#2}\colorformatseparator
-% \dodoformatcolor{#3}\colorformatseparator
-% \dodoformatcolor{#4}\colorformatseparator}
-
-% \gdef\doformatgrayP#1:#2:#3:#4:#5:#6\od
-% {todo}
-
-% so far
-
-\gdef\showpalet
- {\dodoubleargument\doshowpalet}
-
-\gdef\doshowpalet[#1][#2]%
- {\doifdefined{\??pa#1}
- {\doifinsetelse\v!vertical{#2}
- {\showverticalpalet[#1][#2]}
- {\showhorizontalpalet[#1][#2]}}}
-
-\gdef\showverticalpalet[#1][#2]%
- {\localvbox
- {\offinterlineskip
- \setuppalet[#1]
- \def\rule
- {\vrule\!!width3em\!!height\strutht\!!depth\strutdp}
- \tabskip\zeropoint
- \def\doshowpalet##1%
- {\doifinsetelse\v!number{#2}{##1\hskip.5em}{}&
- \color[##1]{\rule}\graycolor[##1]{\rule}&
- \doifinset\v!value{#2}{\hskip.5em\colorvalue{##1}}\crcr}
- \halign
- {\hss##&\hss##\hss&##\cr
- &\doifinset{\v!name}{#2}{\strut#1}&\cr%
- \processpalet[#1]\doshowpalet\crcr}}}
-
-\gdef\showhorizontalpalet[#1][#2]%
- {\localvbox
- {\offinterlineskip
- \setuppalet[#1]
- \tabskip\zeropoint
- \!!widtha\zeropoint
- \doifinset\v!number{#2}
- {\def\doshowpalet##1%
- {\setbox0\hbox{##1}%
- \ifdim\!!widtha<\wd0\!!widtha\wd0\fi}%
- \processpalet[#1]\doshowpalet}%
- \advance\!!widtha 1em
- \ifdim\!!widtha<5em
- \!!widtha5em
- \fi
- \halign
- {##&&\hbox to \!!widtha{\hss##\hss}\cr
- \doifinset\v!number{#2}
- {\def\doshowpalet##1{&\strut##1}%
- \processpalet[#1]\doshowpalet}\cr
- \doifinset\v!name{#2}{#1\hskip.5em}%
- \def\doshowpalet##1%
- {&\strut\color[##1]{\vrule\!!width\!!widtha\!!height\strutht\!!depth\zeropoint}}%
- \processpalet[#1]\doshowpalet\crcr
- \noalign{\vskip-\strutdepth}%
- \def\doshowpalet##1%
- {&\graycolor[##1]{\vrule\!!width\!!widtha\!!height\zeropoint\!!depth\strutdp}}%
- \processpalet[#1]\doshowpalet\crcr
- \doifinset\v!value{#2}
- {\def\doshowpalet##1%
- {&\vbox
- {\hsize\!!widtha
- \vskip.25ex
- \everypar{\strut}
- \veryraggedcenter
- \let\colorformatseparator=\endgraf
- \colorvalue{##1}}}%
- \processpalet[#1]\doshowpalet}%
- \crcr}}}
-
-\gdef\processpalet[#1]%
- {\expanded{\globalprocesscommalist[\getvalue{\??pa#1}]}}
-
-\gdef\showcolorgroup
- {\dodoubleargument\doshowcolorgroup}
-
-\gdef\doshowcolorgroup[#1][#2]%
- {\doifcolor{#1:1}
- {\doifinsetelse\v!vertical{#2}
- {\showverticalcolorgroup[#1][#2]}
- {\showhorizontalcolorgroup[#1][#2]}}}
-
-\gdef\showhorizontalcolorgroup[#1][#2]%
- {\localvbox
- {\offinterlineskip
- \setuppalet
- \tabskip\zeropoint
- \def\rule
- {\vrule\!!width4em\!!height\strutht\!!depth\strutdp}
- \def\colorformatseparator{\strut\cr}
- \def\dodoshowgroup##1%
- {\halign
- {\hss####\hss\cr
- \doifinset\v!number{#2}{\strut##1}\cr
- \color[#1:##1]{\vrule\!!width4em\!!height\strutht\!!depth\zeropoint}\cr
- \graycolor[#1:##1]{\vrule\!!width4em\!!height\zeropoint\!!depth\strutdp}\cr
- \doifinset\v!value{#2}{\colorvalue{#1:##1}\strut}\crcr}}
- \def\doshowgroup##1%
- {\doifcolor{#1:##1}
- {\vbox{\dodoshowgroup{##1}}}}%
- \hbox
- {\doifinset\v!name{#2}
- {\strut
- \doifinsetelse\v!value{#2}
- {\raise3\lineheight\hbox{#1\hskip.5em}}
- {#1}%
- \hskip.5em}%
- \doshowgroup1\doshowgroup2\doshowgroup3\doshowgroup4%
- \doshowgroup5\doshowgroup6\doshowgroup7\doshowgroup8}}}
-
-\gdef\showverticalcolorgroup[#1][#2]%
- {\localvbox
- {\offinterlineskip
- \setuppalet
- \tabskip\zeropoint
- \def\rule
- {\vrule\!!width2.5em\!!height\strutht\!!depth\strutdp}%
- \def\doshowgroup##1%
- {\doifcolor{#1:##1}
- {\doifinset\v!number{#2}{##1\hskip.5em}&
- \color[#1:##1]{\rule}\graycolor[#1:##1]{\rule}&
- \doifinset\v!value{#2}{\hskip.5em\colorvalue{#1:##1}}\crcr}}%
- \halign
- {\hss##&\hss##\hss&##\hss\cr
- &\doifinset\v!name{#2}{\strut#1}&\crcr
- \doshowgroup1\doshowgroup2\doshowgroup3\doshowgroup4%
- \doshowgroup5\doshowgroup6\doshowgroup7\doshowgroup8}}}
-
-\gdef\showcolor
- {\dosingleempty\doshowcolor}
-
-\gdef\doshowcolor[#1]%
- {\bgroup
- \iffirstargument
- \let\colorlist\empty % not really used, only for colo-run
- \let\colorstyle\empty
- \settrue\collectcolorsinlist
- \setupcolor[#1]%
- \fi
- \def\rule
- {\vrule\!!width4em\!!height\strutht\!!depth\strutdp}%
- \def\docommand##1%
- {\NC\graycolor[##1]{\rule}\NC\color[##1]{\rule}\NC\grayvalue{##1}\NC\colorvalue{##1}\NC##1\NC\NR}%
- \starttabulate[|l|l|l|l|l|l|l|]
- \expanded{\globalprocesscommalist[\colorlist]}\docommand
- \stoptabulate
- \egroup}
-
-\gdef\comparepalet
- {\dosingleargument\docomparepalet}
-
-\gdef\docomparepalet[#1]%
- {\doifdefined{\??pa#1}
- {\hbox
- {\dodocomparepalet\color[#1]%
- \quad
- \dodocomparepalet\graycolor[#1]}}}
-
-\gdef\dodocomparepalet#1[#2]%
- {\localvbox
- {\offinterlineskip
- \setuppalet[#2]
- \getcommacommandsize[\getvalue{\??pa#2}]
- \!!widtha2em\relax
- \hsize\commalistsize\!!widtha
- \def\rule%
- {\vrule\!!width.5\!!widtha\!!height2.25ex\!!depth-.75ex}
- \def\dododocomparepalet##1%
- {\hbox
- {\setbox0\hbox
- {#1[##1]{\vrule\!!width\hsize\!!height3ex}}%
- \wd0\zeropoint
- \box0
- \hbox to \hsize
- {\def\dododocomparepalet####1%
- {\hbox to \!!widtha
- {\hss#1[####1]{\rule}\hss}}%
- \processcommacommand[\getvalue{\??pa#2}]\dododocomparepalet}}
- \endgraf}
- \processcommacommand[\getvalue{\??pa#2}]\dododocomparepalet}}
-
-\gdef\comparecolorgroup
- {\dosingleargument\docomparecolorgroup}
-
-\gdef\docomparecolorgroup[#1]%
- {\doifcolor{#1:1}
- {\hbox
- {\dodocomparecolorgroup\color[#1]%
- \quad
- \dodocomparecolorgroup\graycolor[#1]}}}
-
-\gdef\dodocomparecolorgroup#1[#2]%
- {\localvbox
- {\!!counta\zerocount
- \dorecurse{15}
- {\doifcolor{#2:\recurselevel}{\advance\!!counta\plusone}}
- \!!widtha2em\relax
- \hsize\!!counta\!!widtha
- \def\rule
- {\vrule\!!width.5\!!widtha\!!height2.25ex\!!depth-.75ex}
- \def\dododocomparecolorgroup##1%
- {\hbox to \hsize
- {\setbox0\hbox
- {#1[#2:##1]{\vrule\!!width\hsize\!!height3ex}}%
- \wd0\zeropoint
- \box0
- \hbox to \hsize
- {\hss\dorecurse\!!counta{#1[#2:\recurselevel]{\rule}\hss}}}
- \endgraf}
- \dorecurse\!!counta{\dododocomparecolorgroup\recurselevel}}}
-
-\gdef\dogetcolorcomponents#1%
- {\doifelsenothing{#1}
- {\appendtoks
- \TB
- \to \scratchtoks}
- {\appendtoks
- \NC\showcolorbar[#1]\NC#1\NC\transparencycomponents{#1}\NC\colorcomponents{#1}\NC \NR
- \to \scratchtoks}}
-
-\gdef\showcolorbar[#1]%
- {\backgroundline[#1]{\strut\enspace\color[white]{white}\enspace\color[black]{black}\enspace}}
-
-\gdef\showcolorcomponents[#1]%
- {\begingroup
- \scratchtoks{\TB}%
- \processcommacommand[#1]\dogetcolorcomponents
- \starttabulate[|lT|lT|lT|lT|]
- \NC color \NC name \NC transparency \NC specification \NC\NR
- \the\scratchtoks
- \stoptabulate
- \endgroup}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/colo-x11.mkii b/Master/texmf-dist/tex/context/base/mkii/colo-x11.mkii
deleted file mode 100644
index 45d3aac6248..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/colo-x11.mkii
+++ /dev/null
@@ -1,677 +0,0 @@
-%D \module
-%D [ file=colo-x11,
-%D version=2009.11.13,
-%D title=\CONTEXT\ Color Macros,
-%D subtitle=X11,
-%D author=Alan Braslau]
-%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 Standard X11 rgb colors (from \type {/usr/share/X11/rgb.txt}):
-
-\doifnotmode{mkiv} {
- \input colo-hex.mkii
-}
-
-\definecolor [snow] [h=fffafa]
-\definecolor [ghostwhite] [h=f8f8ff]
-\definecolor [whitesmoke] [s=0.96]
-\definecolor [gainsboro] [s=0.86]
-\definecolor [floralwhite] [h=fffaf0]
-\definecolor [oldlace] [h=fdf5e6]
-\definecolor [linen] [h=faf0e6]
-\definecolor [antiquewhite] [h=faebd7]
-\definecolor [papayawhip] [h=ffefd5]
-\definecolor [blanchedalmond] [h=ffebcd]
-\definecolor [bisque] [h=ffe4c4]
-\definecolor [peachpuff] [h=ffdab9]
-\definecolor [navajowhite] [h=ffdead]
-\definecolor [moccasin] [h=ffe4b5]
-\definecolor [cornsilk] [h=fff8dc]
-\definecolor [ivory] [h=fffff0]
-\definecolor [lemonchiffon] [h=fffacd]
-\definecolor [seashell] [h=fff5ee]
-\definecolor [honeydew] [h=f0fff0]
-\definecolor [mintcream] [h=f5fffa]
-\definecolor [azure] [h=f0ffff]
-\definecolor [aliceblue] [h=f0f8ff]
-\definecolor [lavender] [h=e6e6fa]
-\definecolor [lavenderblush] [h=fff0f5]
-\definecolor [mistyrose] [h=ffe4e1]
-\definecolor [white] [s=1]
-\definecolor [black] [s=0]
-\definecolor [darkslategray] [h=2f4f4f]
-\definecolor [darkslategrey] [darkslategray]
-\definecolor [dimgray] [s=0.41]
-\definecolor [dimgrey] [dimgray]
-\definecolor [slategray] [h=708090]
-\definecolor [slategrey] [slategray]
-\definecolor [lightslategray] [h=778899]
-\definecolor [lightslategrey] [lightslategray]
-\definecolor [gray] [s=0.75]
-\definecolor [grey] [gray]
-\definecolor [lightgrey] [s=0.83]
-\definecolor [lightgray] [lightgrey]
-\definecolor [midnightblue] [h=191970]
-\definecolor [navy] [h=000080]
-\definecolor [navyblue] [navy]
-\definecolor [cornflowerblue] [h=6495ed]
-\definecolor [darkslateblue] [h=483d8b]
-\definecolor [slateblue] [h=6a5acd]
-\definecolor [mediumslateblue] [h=7b68ee]
-\definecolor [lightslateblue] [h=8470ff]
-\definecolor [mediumblue] [h=0000cd]
-\definecolor [royalblue] [h=4169e1]
-\definecolor [blue] [h=0000ff]
-\definecolor [dodgerblue] [h=1e90ff]
-\definecolor [deepskyblue] [h=00bfff]
-\definecolor [skyblue] [h=87ceeb]
-\definecolor [lightskyblue] [h=87cefa]
-\definecolor [steelblue] [h=4682b4]
-\definecolor [lightsteelblue] [h=b0c4de]
-\definecolor [lightblue] [h=add8e6]
-\definecolor [powderblue] [h=b0e0e6]
-\definecolor [paleturquoise] [h=afeeee]
-\definecolor [darkturquoise] [h=00ced1]
-\definecolor [mediumturquoise] [h=48d1cc]
-\definecolor [turquoise] [h=40e0d0]
-\definecolor [cyan] [h=00ffff]
-\definecolor [lightcyan] [h=e0ffff]
-\definecolor [cadetblue] [h=5f9ea0]
-\definecolor [mediumaquamarine] [h=66cdaa]
-\definecolor [aquamarine] [h=7fffd4]
-\definecolor [darkgreen] [h=006400]
-\definecolor [darkolivegreen] [h=556b2f]
-\definecolor [darkseagreen] [h=8fbc8f]
-\definecolor [seagreen] [h=2e8b57]
-\definecolor [mediumseagreen] [h=3cb371]
-\definecolor [lightseagreen] [h=20b2aa]
-\definecolor [palegreen] [h=98fb98]
-\definecolor [springgreen] [h=00ff7f]
-\definecolor [lawngreen] [h=7cfc00]
-\definecolor [green] [h=00ff00]
-\definecolor [chartreuse] [h=7fff00]
-\definecolor [mediumspringgreen] [h=00fa9a]
-\definecolor [greenyellow] [h=adff2f]
-\definecolor [limegreen] [h=32cd32]
-\definecolor [yellowgreen] [h=9acd32]
-\definecolor [forestgreen] [h=228b22]
-\definecolor [olivedrab] [h=6b8e23]
-\definecolor [darkkhaki] [h=bdb76b]
-\definecolor [khaki] [h=f0e68c]
-\definecolor [palegoldenrod] [h=eee8aa]
-\definecolor [lightgoldenrodyellow] [h=fafad2]
-\definecolor [lightyellow] [h=ffffe0]
-\definecolor [yellow] [h=ffff00]
-\definecolor [gold] [h=ffd700]
-\definecolor [lightgoldenrod] [h=eedd82]
-\definecolor [goldenrod] [h=daa520]
-\definecolor [darkgoldenrod] [h=b8860b]
-\definecolor [rosybrown] [h=bc8f8f]
-\definecolor [indianred] [h=cd5c5c]
-\definecolor [saddlebrown] [h=8b4513]
-\definecolor [sienna] [h=a0522d]
-\definecolor [peru] [h=cd853f]
-\definecolor [burlywood] [h=deb887]
-\definecolor [beige] [h=f5f5dc]
-\definecolor [wheat] [h=f5deb3]
-\definecolor [sandybrown] [h=f4a460]
-\definecolor [tan] [h=d2b48c]
-\definecolor [chocolate] [h=d2691e]
-\definecolor [firebrick] [h=b22222]
-\definecolor [brown] [h=a52a2a]
-\definecolor [darksalmon] [h=e9967a]
-\definecolor [salmon] [h=fa8072]
-\definecolor [lightsalmon] [h=ffa07a]
-\definecolor [orange] [h=ffa500]
-\definecolor [darkorange] [h=ff8c00]
-\definecolor [coral] [h=ff7f50]
-\definecolor [lightcoral] [h=f08080]
-\definecolor [tomato] [h=ff6347]
-\definecolor [orangered] [h=ff4500]
-\definecolor [red] [h=ff0000]
-\definecolor [hotpink] [h=ff69b4]
-\definecolor [deeppink] [h=ff1493]
-\definecolor [pink] [h=ffc0cb]
-\definecolor [lightpink] [h=ffb6c1]
-\definecolor [palevioletred] [h=db7093]
-\definecolor [maroon] [h=b03060]
-\definecolor [mediumvioletred] [h=c71585]
-\definecolor [violetred] [h=d02090]
-\definecolor [magenta] [h=ff00ff]
-\definecolor [violet] [h=ee82ee]
-\definecolor [plum] [h=dda0dd]
-\definecolor [orchid] [h=da70d6]
-\definecolor [mediumorchid] [h=ba55d3]
-\definecolor [darkorchid] [h=9932cc]
-\definecolor [darkviolet] [h=9400d3]
-\definecolor [blueviolet] [h=8a2be2]
-\definecolor [purple] [h=a020f0]
-\definecolor [mediumpurple] [h=9370db]
-\definecolor [thistle] [h=d8bfd8]
-\definecolor [snow1] [h=fffafa]
-\definecolor [snow2] [h=eee9e9]
-\definecolor [snow3] [h=cdc9c9]
-\definecolor [snow4] [h=8b8989]
-\definecolor [seashell1] [h=fff5ee]
-\definecolor [seashell2] [h=eee5de]
-\definecolor [seashell3] [h=cdc5bf]
-\definecolor [seashell4] [h=8b8682]
-\definecolor [antiquewhite1] [h=ffefdb]
-\definecolor [antiquewhite2] [h=eedfcc]
-\definecolor [antiquewhite3] [h=cdc0b0]
-\definecolor [antiquewhite4] [h=8b8378]
-\definecolor [bisque1] [h=ffe4c4]
-\definecolor [bisque2] [h=eed5b7]
-\definecolor [bisque3] [h=cdb79e]
-\definecolor [bisque4] [h=8b7d6b]
-\definecolor [peachpuff1] [h=ffdab9]
-\definecolor [peachpuff2] [h=eecbad]
-\definecolor [peachpuff3] [h=cdaf95]
-\definecolor [peachpuff4] [h=8b7765]
-\definecolor [navajowhite1] [h=ffdead]
-\definecolor [navajowhite2] [h=eecfa1]
-\definecolor [navajowhite3] [h=cdb38b]
-\definecolor [navajowhite4] [h=8b795e]
-\definecolor [lemonchiffon1] [h=fffacd]
-\definecolor [lemonchiffon2] [h=eee9bf]
-\definecolor [lemonchiffon3] [h=cdc9a5]
-\definecolor [lemonchiffon4] [h=8b8970]
-\definecolor [cornsilk1] [h=fff8dc]
-\definecolor [cornsilk2] [h=eee8cd]
-\definecolor [cornsilk3] [h=cdc8b1]
-\definecolor [cornsilk4] [h=8b8878]
-\definecolor [ivory1] [h=fffff0]
-\definecolor [ivory2] [h=eeeee0]
-\definecolor [ivory3] [h=cdcdc1]
-\definecolor [ivory4] [h=8b8b83]
-\definecolor [honeydew1] [h=f0fff0]
-\definecolor [honeydew2] [h=e0eee0]
-\definecolor [honeydew3] [h=c1cdc1]
-\definecolor [honeydew4] [h=838b83]
-\definecolor [lavenderblush1] [h=fff0f5]
-\definecolor [lavenderblush2] [h=eee0e5]
-\definecolor [lavenderblush3] [h=cdc1c5]
-\definecolor [lavenderblush4] [h=8b8386]
-\definecolor [mistyrose1] [h=ffe4e1]
-\definecolor [mistyrose2] [h=eed5d2]
-\definecolor [mistyrose3] [h=cdb7b5]
-\definecolor [mistyrose4] [h=8b7d7b]
-\definecolor [azure1] [h=f0ffff]
-\definecolor [azure2] [h=e0eeee]
-\definecolor [azure3] [h=c1cdcd]
-\definecolor [azure4] [h=838b8b]
-\definecolor [slateblue1] [h=836fff]
-\definecolor [slateblue2] [h=7a67ee]
-\definecolor [slateblue3] [h=6959cd]
-\definecolor [slateblue4] [h=473c8b]
-\definecolor [royalblue1] [h=4876ff]
-\definecolor [royalblue2] [h=436eee]
-\definecolor [royalblue3] [h=3a5fcd]
-\definecolor [royalblue4] [h=27408b]
-\definecolor [blue1] [h=0000ff]
-\definecolor [blue2] [h=0000ee]
-\definecolor [blue3] [h=0000cd]
-\definecolor [blue4] [h=00008b]
-\definecolor [dodgerblue1] [h=1e90ff]
-\definecolor [dodgerblue2] [h=1c86ee]
-\definecolor [dodgerblue3] [h=1874cd]
-\definecolor [dodgerblue4] [h=104e8b]
-\definecolor [steelblue1] [h=63b8ff]
-\definecolor [steelblue2] [h=5cacee]
-\definecolor [steelblue3] [h=4f94cd]
-\definecolor [steelblue4] [h=36648b]
-\definecolor [deepskyblue1] [h=00bfff]
-\definecolor [deepskyblue2] [h=00b2ee]
-\definecolor [deepskyblue3] [h=009acd]
-\definecolor [deepskyblue4] [h=00688b]
-\definecolor [skyblue1] [h=87ceff]
-\definecolor [skyblue2] [h=7ec0ee]
-\definecolor [skyblue3] [h=6ca6cd]
-\definecolor [skyblue4] [h=4a708b]
-\definecolor [lightskyblue1] [h=b0e2ff]
-\definecolor [lightskyblue2] [h=a4d3ee]
-\definecolor [lightskyblue3] [h=8db6cd]
-\definecolor [lightskyblue4] [h=607b8b]
-\definecolor [slategray1] [h=c6e2ff]
-\definecolor [slategray2] [h=b9d3ee]
-\definecolor [slategray3] [h=9fb6cd]
-\definecolor [slategray4] [h=6c7b8b]
-\definecolor [lightsteelblue1] [h=cae1ff]
-\definecolor [lightsteelblue2] [h=bcd2ee]
-\definecolor [lightsteelblue3] [h=a2b5cd]
-\definecolor [lightsteelblue4] [h=6e7b8b]
-\definecolor [lightblue1] [h=bfefff]
-\definecolor [lightblue2] [h=b2dfee]
-\definecolor [lightblue3] [h=9ac0cd]
-\definecolor [lightblue4] [h=68838b]
-\definecolor [lightcyan1] [h=e0ffff]
-\definecolor [lightcyan2] [h=d1eeee]
-\definecolor [lightcyan3] [h=b4cdcd]
-\definecolor [lightcyan4] [h=7a8b8b]
-\definecolor [paleturquoise1] [h=bbffff]
-\definecolor [paleturquoise2] [h=aeeeee]
-\definecolor [paleturquoise3] [h=96cdcd]
-\definecolor [paleturquoise4] [h=668b8b]
-\definecolor [cadetblue1] [h=98f5ff]
-\definecolor [cadetblue2] [h=8ee5ee]
-\definecolor [cadetblue3] [h=7ac5cd]
-\definecolor [cadetblue4] [h=53868b]
-\definecolor [turquoise1] [h=00f5ff]
-\definecolor [turquoise2] [h=00e5ee]
-\definecolor [turquoise3] [h=00c5cd]
-\definecolor [turquoise4] [h=00868b]
-\definecolor [cyan1] [h=00ffff]
-\definecolor [cyan2] [h=00eeee]
-\definecolor [cyan3] [h=00cdcd]
-\definecolor [cyan4] [h=008b8b]
-\definecolor [darkslategray1] [h=97ffff]
-\definecolor [darkslategray2] [h=8deeee]
-\definecolor [darkslategray3] [h=79cdcd]
-\definecolor [darkslategray4] [h=528b8b]
-\definecolor [aquamarine1] [h=7fffd4]
-\definecolor [aquamarine2] [h=76eec6]
-\definecolor [aquamarine3] [h=66cdaa]
-\definecolor [aquamarine4] [h=458b74]
-\definecolor [darkseagreen1] [h=c1ffc1]
-\definecolor [darkseagreen2] [h=b4eeb4]
-\definecolor [darkseagreen3] [h=9bcd9b]
-\definecolor [darkseagreen4] [h=698b69]
-\definecolor [seagreen1] [h=54ff9f]
-\definecolor [seagreen2] [h=4eee94]
-\definecolor [seagreen3] [h=43cd80]
-\definecolor [seagreen4] [h=2e8b57]
-\definecolor [palegreen1] [h=9aff9a]
-\definecolor [palegreen2] [h=90ee90]
-\definecolor [palegreen3] [h=7ccd7c]
-\definecolor [palegreen4] [h=548b54]
-\definecolor [springgreen1] [h=00ff7f]
-\definecolor [springgreen2] [h=00ee76]
-\definecolor [springgreen3] [h=00cd66]
-\definecolor [springgreen4] [h=008b45]
-\definecolor [green1] [h=00ff00]
-\definecolor [green2] [h=00ee00]
-\definecolor [green3] [h=00cd00]
-\definecolor [green4] [h=008b00]
-\definecolor [chartreuse1] [h=7fff00]
-\definecolor [chartreuse2] [h=76ee00]
-\definecolor [chartreuse3] [h=66cd00]
-\definecolor [chartreuse4] [h=458b00]
-\definecolor [olivedrab1] [h=c0ff3e]
-\definecolor [olivedrab2] [h=b3ee3a]
-\definecolor [olivedrab3] [h=9acd32]
-\definecolor [olivedrab4] [h=698b22]
-\definecolor [darkolivegreen1] [h=caff70]
-\definecolor [darkolivegreen2] [h=bcee68]
-\definecolor [darkolivegreen3] [h=a2cd5a]
-\definecolor [darkolivegreen4] [h=6e8b3d]
-\definecolor [khaki1] [h=fff68f]
-\definecolor [khaki2] [h=eee685]
-\definecolor [khaki3] [h=cdc673]
-\definecolor [khaki4] [h=8b864e]
-\definecolor [lightgoldenrod1] [h=ffec8b]
-\definecolor [lightgoldenrod2] [h=eedc82]
-\definecolor [lightgoldenrod3] [h=cdbe70]
-\definecolor [lightgoldenrod4] [h=8b814c]
-\definecolor [lightyellow1] [h=ffffe0]
-\definecolor [lightyellow2] [h=eeeed1]
-\definecolor [lightyellow3] [h=cdcdb4]
-\definecolor [lightyellow4] [h=8b8b7a]
-\definecolor [yellow1] [h=ffff00]
-\definecolor [yellow2] [h=eeee00]
-\definecolor [yellow3] [h=cdcd00]
-\definecolor [yellow4] [h=8b8b00]
-\definecolor [gold1] [h=ffd700]
-\definecolor [gold2] [h=eec900]
-\definecolor [gold3] [h=cdad00]
-\definecolor [gold4] [h=8b7500]
-\definecolor [goldenrod1] [h=ffc125]
-\definecolor [goldenrod2] [h=eeb422]
-\definecolor [goldenrod3] [h=cd9b1d]
-\definecolor [goldenrod4] [h=8b6914]
-\definecolor [darkgoldenrod1] [h=ffb90f]
-\definecolor [darkgoldenrod2] [h=eead0e]
-\definecolor [darkgoldenrod3] [h=cd950c]
-\definecolor [darkgoldenrod4] [h=8b6508]
-\definecolor [rosybrown1] [h=ffc1c1]
-\definecolor [rosybrown2] [h=eeb4b4]
-\definecolor [rosybrown3] [h=cd9b9b]
-\definecolor [rosybrown4] [h=8b6969]
-\definecolor [indianred1] [h=ff6a6a]
-\definecolor [indianred2] [h=ee6363]
-\definecolor [indianred3] [h=cd5555]
-\definecolor [indianred4] [h=8b3a3a]
-\definecolor [sienna1] [h=ff8247]
-\definecolor [sienna2] [h=ee7942]
-\definecolor [sienna3] [h=cd6839]
-\definecolor [sienna4] [h=8b4726]
-\definecolor [burlywood1] [h=ffd39b]
-\definecolor [burlywood2] [h=eec591]
-\definecolor [burlywood3] [h=cdaa7d]
-\definecolor [burlywood4] [h=8b7355]
-\definecolor [wheat1] [h=ffe7ba]
-\definecolor [wheat2] [h=eed8ae]
-\definecolor [wheat3] [h=cdba96]
-\definecolor [wheat4] [h=8b7e66]
-\definecolor [tan1] [h=ffa54f]
-\definecolor [tan2] [h=ee9a49]
-\definecolor [tan3] [h=cd853f]
-\definecolor [tan4] [h=8b5a2b]
-\definecolor [chocolate1] [h=ff7f24]
-\definecolor [chocolate2] [h=ee7621]
-\definecolor [chocolate3] [h=cd661d]
-\definecolor [chocolate4] [h=8b4513]
-\definecolor [firebrick1] [h=ff3030]
-\definecolor [firebrick2] [h=ee2c2c]
-\definecolor [firebrick3] [h=cd2626]
-\definecolor [firebrick4] [h=8b1a1a]
-\definecolor [brown1] [h=ff4040]
-\definecolor [brown2] [h=ee3b3b]
-\definecolor [brown3] [h=cd3333]
-\definecolor [brown4] [h=8b2323]
-\definecolor [salmon1] [h=ff8c69]
-\definecolor [salmon2] [h=ee8262]
-\definecolor [salmon3] [h=cd7054]
-\definecolor [salmon4] [h=8b4c39]
-\definecolor [lightsalmon1] [h=ffa07a]
-\definecolor [lightsalmon2] [h=ee9572]
-\definecolor [lightsalmon3] [h=cd8162]
-\definecolor [lightsalmon4] [h=8b5742]
-\definecolor [orange1] [h=ffa500]
-\definecolor [orange2] [h=ee9a00]
-\definecolor [orange3] [h=cd8500]
-\definecolor [orange4] [h=8b5a00]
-\definecolor [darkorange1] [h=ff7f00]
-\definecolor [darkorange2] [h=ee7600]
-\definecolor [darkorange3] [h=cd6600]
-\definecolor [darkorange4] [h=8b4500]
-\definecolor [coral1] [h=ff7256]
-\definecolor [coral2] [h=ee6a50]
-\definecolor [coral3] [h=cd5b45]
-\definecolor [coral4] [h=8b3e2f]
-\definecolor [tomato1] [h=ff6347]
-\definecolor [tomato2] [h=ee5c42]
-\definecolor [tomato3] [h=cd4f39]
-\definecolor [tomato4] [h=8b3626]
-\definecolor [orangered1] [h=ff4500]
-\definecolor [orangered2] [h=ee4000]
-\definecolor [orangered3] [h=cd3700]
-\definecolor [orangered4] [h=8b2500]
-\definecolor [red1] [h=ff0000]
-\definecolor [red2] [h=ee0000]
-\definecolor [red3] [h=cd0000]
-\definecolor [red4] [h=8b0000]
-\definecolor [debianred] [h=d70751]
-\definecolor [deeppink1] [h=ff1493]
-\definecolor [deeppink2] [h=ee1289]
-\definecolor [deeppink3] [h=cd1076]
-\definecolor [deeppink4] [h=8b0a50]
-\definecolor [hotpink1] [h=ff6eb4]
-\definecolor [hotpink2] [h=ee6aa7]
-\definecolor [hotpink3] [h=cd6090]
-\definecolor [hotpink4] [h=8b3a62]
-\definecolor [pink1] [h=ffb5c5]
-\definecolor [pink2] [h=eea9b8]
-\definecolor [pink3] [h=cd919e]
-\definecolor [pink4] [h=8b636c]
-\definecolor [lightpink1] [h=ffaeb9]
-\definecolor [lightpink2] [h=eea2ad]
-\definecolor [lightpink3] [h=cd8c95]
-\definecolor [lightpink4] [h=8b5f65]
-\definecolor [palevioletred1] [h=ff82ab]
-\definecolor [palevioletred2] [h=ee799f]
-\definecolor [palevioletred3] [h=cd6889]
-\definecolor [palevioletred4] [h=8b475d]
-\definecolor [maroon1] [h=ff34b3]
-\definecolor [maroon2] [h=ee30a7]
-\definecolor [maroon3] [h=cd2990]
-\definecolor [maroon4] [h=8b1c62]
-\definecolor [violetred1] [h=ff3e96]
-\definecolor [violetred2] [h=ee3a8c]
-\definecolor [violetred3] [h=cd3278]
-\definecolor [violetred4] [h=8b2252]
-\definecolor [magenta1] [h=ff00ff]
-\definecolor [magenta2] [h=ee00ee]
-\definecolor [magenta3] [h=cd00cd]
-\definecolor [magenta4] [h=8b008b]
-\definecolor [orchid1] [h=ff83fa]
-\definecolor [orchid2] [h=ee7ae9]
-\definecolor [orchid3] [h=cd69c9]
-\definecolor [orchid4] [h=8b4789]
-\definecolor [plum1] [h=ffbbff]
-\definecolor [plum2] [h=eeaeee]
-\definecolor [plum3] [h=cd96cd]
-\definecolor [plum4] [h=8b668b]
-\definecolor [mediumorchid1] [h=e066ff]
-\definecolor [mediumorchid2] [h=d15fee]
-\definecolor [mediumorchid3] [h=b452cd]
-\definecolor [mediumorchid4] [h=7a378b]
-\definecolor [darkorchid1] [h=bf3eff]
-\definecolor [darkorchid2] [h=b23aee]
-\definecolor [darkorchid3] [h=9a32cd]
-\definecolor [darkorchid4] [h=68228b]
-\definecolor [purple1] [h=9b30ff]
-\definecolor [purple2] [h=912cee]
-\definecolor [purple3] [h=7d26cd]
-\definecolor [purple4] [h=551a8b]
-\definecolor [mediumpurple1] [h=ab82ff]
-\definecolor [mediumpurple2] [h=9f79ee]
-\definecolor [mediumpurple3] [h=8968cd]
-\definecolor [mediumpurple4] [h=5d478b]
-\definecolor [thistle1] [h=ffe1ff]
-\definecolor [thistle2] [h=eed2ee]
-\definecolor [thistle3] [h=cdb5cd]
-\definecolor [thistle4] [h=8b7b8b]
-\definecolor [gray0] [s=0.00]
-\definecolor [grey0] [gray0]
-\definecolor [gray1] [s=0.01]
-\definecolor [grey1] [gray1]
-\definecolor [gray2] [s=0.02]
-\definecolor [grey2] [gray2]
-\definecolor [gray3] [s=0.03]
-\definecolor [grey3] [gray3]
-\definecolor [gray4] [s=0.04]
-\definecolor [grey4] [gray4]
-\definecolor [gray5] [s=0.05]
-\definecolor [grey5] [gray5]
-\definecolor [gray6] [s=0.06]
-\definecolor [grey6] [gray6]
-\definecolor [gray7] [s=0.07]
-\definecolor [grey7] [gray7]
-\definecolor [gray8] [s=0.08]
-\definecolor [grey8] [gray8]
-\definecolor [gray9] [s=0.09]
-\definecolor [grey9] [gray9]
-\definecolor [gray10] [s=0.10]
-\definecolor [grey10] [gray10]
-\definecolor [gray11] [s=0.11]
-\definecolor [grey11] [gray11]
-\definecolor [gray12] [s=0.12]
-\definecolor [grey12] [gray12]
-\definecolor [gray13] [s=0.13]
-\definecolor [grey13] [gray13]
-\definecolor [gray14] [s=0.14]
-\definecolor [grey14] [gray14]
-\definecolor [gray15] [s=0.15]
-\definecolor [grey15] [gray15]
-\definecolor [gray16] [s=0.16]
-\definecolor [grey16] [gray16]
-\definecolor [gray17] [s=0.17]
-\definecolor [grey17] [gray17]
-\definecolor [gray18] [s=0.18]
-\definecolor [grey18] [gray18]
-\definecolor [gray19] [s=0.19]
-\definecolor [grey19] [gray19]
-\definecolor [gray20] [s=0.20]
-\definecolor [grey20] [gray20]
-\definecolor [gray21] [s=0.21]
-\definecolor [grey21] [gray21]
-\definecolor [gray22] [s=0.22]
-\definecolor [grey22] [gray22]
-\definecolor [gray23] [s=0.23]
-\definecolor [grey23] [gray23]
-\definecolor [gray24] [s=0.24]
-\definecolor [grey24] [gray24]
-\definecolor [gray25] [s=0.25]
-\definecolor [grey25] [gray25]
-\definecolor [gray26] [s=0.26]
-\definecolor [grey26] [gray26]
-\definecolor [gray27] [s=0.27]
-\definecolor [grey27] [gray27]
-\definecolor [gray28] [s=0.28]
-\definecolor [grey28] [gray28]
-\definecolor [gray29] [s=0.29]
-\definecolor [grey29] [gray29]
-\definecolor [gray30] [s=0.30]
-\definecolor [grey30] [gray30]
-\definecolor [gray31] [s=0.31]
-\definecolor [grey31] [gray31]
-\definecolor [gray32] [s=0.32]
-\definecolor [grey32] [gray32]
-\definecolor [gray33] [s=0.33]
-\definecolor [grey33] [gray33]
-\definecolor [gray34] [s=0.34]
-\definecolor [grey34] [gray34]
-\definecolor [gray35] [s=0.35]
-\definecolor [grey35] [gray35]
-\definecolor [gray36] [s=0.36]
-\definecolor [grey36] [gray36]
-\definecolor [gray37] [s=0.37]
-\definecolor [grey37] [gray37]
-\definecolor [gray38] [s=0.38]
-\definecolor [grey38] [gray38]
-\definecolor [gray39] [s=0.39]
-\definecolor [grey39] [gray39]
-\definecolor [gray40] [s=0.40]
-\definecolor [grey40] [gray40]
-\definecolor [gray41] [s=0.41]
-\definecolor [grey41] [gray41]
-\definecolor [gray42] [s=0.42]
-\definecolor [grey42] [gray42]
-\definecolor [gray43] [s=0.43]
-\definecolor [grey43] [gray43]
-\definecolor [gray44] [s=0.44]
-\definecolor [grey44] [gray44]
-\definecolor [gray45] [s=0.45]
-\definecolor [grey45] [gray45]
-\definecolor [gray46] [s=0.46]
-\definecolor [grey46] [gray46]
-\definecolor [gray47] [s=0.47]
-\definecolor [grey47] [gray47]
-\definecolor [gray48] [s=0.48]
-\definecolor [grey48] [gray48]
-\definecolor [gray49] [s=0.49]
-\definecolor [grey49] [gray49]
-\definecolor [gray50] [s=0.50]
-\definecolor [grey50] [gray50]
-\definecolor [gray51] [s=0.51]
-\definecolor [grey51] [gray51]
-\definecolor [gray52] [s=0.52]
-\definecolor [grey52] [gray52]
-\definecolor [gray53] [s=0.53]
-\definecolor [grey53] [gray53]
-\definecolor [gray54] [s=0.54]
-\definecolor [grey54] [gray54]
-\definecolor [gray55] [s=0.55]
-\definecolor [grey55] [gray55]
-\definecolor [gray56] [s=0.56]
-\definecolor [grey56] [gray56]
-\definecolor [gray57] [s=0.57]
-\definecolor [grey57] [gray57]
-\definecolor [gray58] [s=0.58]
-\definecolor [grey58] [gray58]
-\definecolor [gray59] [s=0.59]
-\definecolor [grey59] [gray59]
-\definecolor [gray60] [s=0.60]
-\definecolor [grey60] [gray60]
-\definecolor [gray61] [s=0.61]
-\definecolor [grey61] [gray61]
-\definecolor [gray62] [s=0.62]
-\definecolor [grey62] [gray62]
-\definecolor [gray63] [s=0.63]
-\definecolor [grey63] [gray63]
-\definecolor [gray64] [s=0.64]
-\definecolor [grey64] [gray64]
-\definecolor [gray65] [s=0.65]
-\definecolor [grey65] [gray65]
-\definecolor [gray66] [s=0.66]
-\definecolor [grey66] [gray66]
-\definecolor [gray67] [s=0.67]
-\definecolor [grey67] [gray67]
-\definecolor [gray68] [s=0.68]
-\definecolor [grey68] [gray68]
-\definecolor [gray69] [s=0.69]
-\definecolor [grey69] [gray69]
-\definecolor [gray70] [s=0.70]
-\definecolor [grey70] [gray70]
-\definecolor [gray71] [s=0.71]
-\definecolor [grey71] [gray71]
-\definecolor [gray72] [s=0.72]
-\definecolor [grey72] [gray72]
-\definecolor [gray73] [s=0.73]
-\definecolor [grey73] [gray73]
-\definecolor [gray74] [s=0.74]
-\definecolor [grey74] [gray74]
-\definecolor [gray75] [s=0.75]
-\definecolor [grey75] [gray75]
-\definecolor [gray76] [s=0.76]
-\definecolor [grey76] [gray76]
-\definecolor [gray77] [s=0.77]
-\definecolor [grey77] [gray77]
-\definecolor [gray78] [s=0.78]
-\definecolor [grey78] [gray78]
-\definecolor [gray79] [s=0.79]
-\definecolor [grey79] [gray79]
-\definecolor [gray80] [s=0.80]
-\definecolor [grey80] [gray80]
-\definecolor [gray81] [s=0.81]
-\definecolor [grey81] [gray81]
-\definecolor [gray82] [s=0.82]
-\definecolor [grey82] [gray82]
-\definecolor [gray83] [s=0.83]
-\definecolor [grey83] [gray83]
-\definecolor [gray84] [s=0.84]
-\definecolor [grey84] [gray84]
-\definecolor [gray85] [s=0.85]
-\definecolor [grey85] [gray85]
-\definecolor [gray86] [s=0.86]
-\definecolor [grey86] [gray86]
-\definecolor [gray87] [s=0.87]
-\definecolor [grey87] [gray87]
-\definecolor [gray88] [s=0.88]
-\definecolor [grey88] [gray88]
-\definecolor [gray89] [s=0.89]
-\definecolor [grey89] [gray89]
-\definecolor [gray90] [s=0.90]
-\definecolor [grey90] [gray90]
-\definecolor [gray91] [s=0.91]
-\definecolor [grey91] [gray91]
-\definecolor [gray92] [s=0.92]
-\definecolor [grey92] [gray92]
-\definecolor [gray93] [s=0.93]
-\definecolor [grey93] [gray93]
-\definecolor [gray94] [s=0.94]
-\definecolor [grey94] [gray94]
-\definecolor [gray95] [s=0.95]
-\definecolor [grey95] [gray95]
-\definecolor [gray96] [s=0.96]
-\definecolor [grey96] [gray96]
-\definecolor [gray97] [s=0.97]
-\definecolor [grey97] [gray97]
-\definecolor [gray98] [s=0.98]
-\definecolor [grey98] [gray98]
-\definecolor [gray99] [s=0.99]
-\definecolor [grey99] [gray99]
-\definecolor [gray100] [s=1.00]
-\definecolor [grey100] [gray100]
-\definecolor [darkgrey] [s=0.66]
-\definecolor [darkgray] [darkgrey]
-\definecolor [darkblue] [h=00008b]
-\definecolor [darkcyan] [h=008b8b]
-\definecolor [darkmagenta] [h=8b008b]
-\definecolor [darkred] [h=8b0000]
-\definecolor [lightgreen] [h=90ee90]
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/colo-xwi.mkii b/Master/texmf-dist/tex/context/base/mkii/colo-xwi.mkii
deleted file mode 100644
index 48ffe234eff..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/colo-xwi.mkii
+++ /dev/null
@@ -1,143 +0,0 @@
-%D \module
-%D [ file=colo-xwi,
-%D version=1995.01.01,
-%D title=\CONTEXT\ Color Macros,
-%D subtitle=X Windows,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-%D I've forgotten where I got these definitions from, but maybe
-%D they can be of use. Watch out, these colors are in the rgb
-%D color space, so cyan is not defined in cmyk!
-
-\definecolor [aliceblue] [r=0.94,g=0.97,b=1.00]
-\definecolor [antiquewhite] [r=0.98,g=0.92,b=0.84]
-\definecolor [aquamarine] [r=0.50,g=1.00,b=0.83]
-\definecolor [azure] [r=0.94,g=1.00,b=1.00]
-\definecolor [beige] [r=0.96,g=0.96,b=0.86]
-\definecolor [bisque] [r=1.00,g=0.89,b=0.77]
-\definecolor [black] [s=0] % [r=0.00,g=0.00,b=0.00]
-\definecolor [blanchedalmond] [r=1.00,g=0.92,b=0.80]
-\definecolor [blue] [r=0.00,g=0.00,b=1.00]
-\definecolor [blueviolet] [r=0.54,g=0.17,b=0.89]
-\definecolor [brown] [r=0.65,g=0.16,b=0.16]
-\definecolor [burlywood] [r=0.87,g=0.72,b=0.53]
-\definecolor [cadetblue] [r=0.37,g=0.62,b=0.63]
-\definecolor [chartreuse] [r=0.50,g=1.00,b=0.00]
-\definecolor [chocolate] [r=0.82,g=0.41,b=0.12]
-\definecolor [coral] [r=1.00,g=0.50,b=0.31]
-\definecolor [cornflowerblue] [r=0.39,g=0.58,b=0.93]
-\definecolor [cornsilk] [r=1.00,g=0.97,b=0.86]
-\definecolor [cyan] [r=0.00,g=1.00,b=1.00]
-\definecolor [darkgoldenrod] [r=0.72,g=0.53,b=0.04]
-\definecolor [darkgreen] [r=0.00,g=0.39,b=0.00]
-\definecolor [darkkhaki] [r=0.74,g=0.72,b=0.42]
-\definecolor [darkolivegreen] [r=0.33,g=0.42,b=0.18]
-\definecolor [darkorange] [r=1.00,g=0.55,b=0.00]
-\definecolor [darkorchid] [r=0.60,g=0.20,b=0.80]
-\definecolor [darksalmon] [r=0.91,g=0.59,b=0.48]
-\definecolor [darkseagreen] [r=0.56,g=0.74,b=0.56]
-\definecolor [darkslateblue] [r=0.28,g=0.24,b=0.55]
-\definecolor [darkturquoise] [r=0.00,g=0.81,b=0.82]
-\definecolor [darkviolet] [r=0.58,g=0.00,b=0.83]
-\definecolor [deeppink] [r=1.00,g=0.08,b=0.58]
-\definecolor [deepskyblue] [r=0.00,g=0.75,b=1.00]
-\definecolor [dodgerblue] [r=0.12,g=0.56,b=1.00]
-\definecolor [firebrick] [r=0.70,g=0.13,b=0.13]
-\definecolor [floralwhite] [r=1.00,g=0.98,b=0.94]
-\definecolor [forestgreen] [r=0.13,g=0.55,b=0.13]
-\definecolor [gainsboro] [r=0.86,g=0.86,b=0.86]
-\definecolor [ghostwhite] [r=0.97,g=0.97,b=1.00]
-\definecolor [gold] [r=1.00,g=0.84,b=0.00]
-\definecolor [goldenrod] [r=0.85,g=0.65,b=0.13]
-\definecolor [green] [r=0.00,g=1.00,b=0.00]
-\definecolor [greenyellow] [r=0.68,g=1.00,b=0.18]
-\definecolor [honeydew] [r=0.94,g=1.00,b=0.94]
-\definecolor [hotpink] [r=1.00,g=0.41,b=0.71]
-\definecolor [indianred] [r=0.80,g=0.36,b=0.36]
-\definecolor [ivory] [r=1.00,g=1.00,b=0.94]
-\definecolor [khaki] [r=0.94,g=0.90,b=0.55]
-\definecolor [lavender] [r=0.90,g=0.90,b=0.98]
-\definecolor [lavenderblush] [r=1.00,g=0.94,b=0.96]
-\definecolor [lawngreen] [r=0.49,g=0.99,b=0.00]
-\definecolor [lemonchiffon] [r=1.00,g=0.98,b=0.80]
-\definecolor [lightblue] [r=0.68,g=0.85,b=0.90]
-\definecolor [lightcoral] [r=0.94,g=0.50,b=0.50]
-\definecolor [lightcyan] [r=0.88,g=1.00,b=1.00]
-\definecolor [lightgoldenrod] [r=0.93,g=0.87,b=0.51]
-\definecolor [lightgoldenrodyellow] [r=0.98,g=0.98,b=0.82]
-\definecolor [lightpink] [r=1.00,g=0.71,b=0.76]
-\definecolor [lightsalmon] [r=1.00,g=0.63,b=0.48]
-\definecolor [lightseagreen] [r=0.13,g=0.70,b=0.67]
-\definecolor [lightskyblue] [r=0.53,g=0.81,b=0.98]
-\definecolor [lightslateblue] [r=0.52,g=0.44,b=1.00]
-\definecolor [lightsteelblue] [r=0.69,g=0.77,b=0.87]
-\definecolor [lightyellow] [r=1.00,g=1.00,b=0.88]
-\definecolor [limegreen] [r=0.20,g=0.80,b=0.20]
-\definecolor [linen] [r=0.98,g=0.94,b=0.90]
-\definecolor [magenta] [r=1.00,g=0.00,b=1.00]
-\definecolor [maroon] [r=0.69,g=0.19,b=0.38]
-\definecolor [mediumaquamarine] [r=0.40,g=0.80,b=0.67]
-\definecolor [mediumblue] [r=0.00,g=0.00,b=0.80]
-\definecolor [mediumorchid] [r=0.73,g=0.33,b=0.83]
-\definecolor [mediumpurple] [r=0.58,g=0.44,b=0.86]
-\definecolor [mediumseagreen] [r=0.24,g=0.70,b=0.44]
-\definecolor [mediumslateblue] [r=0.48,g=0.41,b=0.93]
-\definecolor [mediumspringgreen] [r=0.00,g=0.98,b=0.60]
-\definecolor [mediumturquoise] [r=0.28,g=0.82,b=0.80]
-\definecolor [mediumvioletred] [r=0.78,g=0.08,b=0.52]
-\definecolor [midnightblue] [r=0.10,g=0.10,b=0.44]
-\definecolor [mintcream] [r=0.96,g=1.00,b=0.98]
-\definecolor [mistyrose] [r=1.00,g=0.89,b=0.88]
-\definecolor [moccasin] [r=1.00,g=0.89,b=0.71]
-\definecolor [navajowhite] [r=1.00,g=0.87,b=0.68]
-\definecolor [navy] [r=0.00,g=0.00,b=0.50]
-\definecolor [navyblue] [r=0.00,g=0.00,b=0.50]
-\definecolor [oldlace] [r=0.99,g=0.96,b=0.90]
-\definecolor [olivedrab] [r=0.42,g=0.56,b=0.14]
-\definecolor [orange] [r=1.00,g=0.65,b=0.00]
-\definecolor [orangered] [r=1.00,g=0.27,b=0.00]
-\definecolor [orchid] [r=0.85,g=0.44,b=0.84]
-\definecolor [palegoldenrod] [r=0.93,g=0.91,b=0.67]
-\definecolor [palegreen] [r=0.60,g=0.98,b=0.60]
-\definecolor [paleturquoise] [r=0.69,g=0.93,b=0.93]
-\definecolor [palevioletred] [r=0.86,g=0.44,b=0.58]
-\definecolor [papayawhip] [r=1.00,g=0.94,b=0.84]
-\definecolor [peachpuff] [r=1.00,g=0.85,b=0.73]
-\definecolor [peru] [r=0.80,g=0.52,b=0.25]
-\definecolor [pink] [r=1.00,g=0.75,b=0.80]
-\definecolor [plum] [r=0.87,g=0.63,b=0.87]
-\definecolor [powderblue] [r=0.69,g=0.88,b=0.90]
-\definecolor [purple] [r=0.63,g=0.13,b=0.94]
-\definecolor [red ] [r=1.00,g=0.00,b=0.00]
-\definecolor [rosybrown] [r=0.74,g=0.56,b=0.56]
-\definecolor [royalblue] [r=0.25,g=0.41,b=0.88]
-\definecolor [saddlebrown] [r=0.55,g=0.27,b=0.07]
-\definecolor [salmon] [r=0.98,g=0.50,b=0.45]
-\definecolor [sandybrown] [r=0.96,g=0.64,b=0.38]
-\definecolor [seagreen] [r=0.18,g=0.55,b=0.34]
-\definecolor [seashell] [r=1.00,g=0.96,b=0.93]
-\definecolor [sienna] [r=0.63,g=0.32,b=0.18]
-\definecolor [skyblue] [r=0.53,g=0.81,b=0.92]
-\definecolor [slateblue] [r=0.42,g=0.35,b=0.80]
-\definecolor [snow] [r=1.00,g=0.98,b=0.98]
-\definecolor [springgreen] [r=0.00,g=1.00,b=0.50]
-\definecolor [steelblue] [r=0.27,g=0.51,b=0.71]
-\definecolor [tancolor] [r=0.82,g=0.71,b=0.55] % we don't want it to clash
-\definecolor [thistle] [r=0.85,g=0.75,b=0.85]
-\definecolor [tomato] [r=1.00,g=0.39,b=0.28]
-\definecolor [turquoise] [r=0.25,g=0.88,b=0.82]
-\definecolor [violet] [r=0.93,g=0.51,b=0.93]
-\definecolor [violetred] [r=0.82,g=0.13,b=0.56]
-\definecolor [wheat] [r=0.96,g=0.87,b=0.70]
-\definecolor [white] [r=1.00,g=1.00,b=1.00]
-\definecolor [whitesmoke] [s=0.96] % [r=0.96,g=0.96,b=0.96]
-\definecolor [yellow] [r=1.00,g=1.00,b=0.00]
-\definecolor [yellowgreen] [r=0.60,g=0.80,b=0.20]
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/cont-cs.mkii b/Master/texmf-dist/tex/context/base/mkii/cont-cs.mkii
deleted file mode 100644
index 89b781c37a1..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/cont-cs.mkii
+++ /dev/null
@@ -1,21 +0,0 @@
-%D \module
-%D [ file=cont-cs,
-%D version=1998.12.02,
-%D title=\CONTEXT,
-%D subtitle=\CONTEXT\ Czech Format Generation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 {czech}
-\def\defaultlanguagetag{cs}
-
-\input context.mkii
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/cont-de.mkii b/Master/texmf-dist/tex/context/base/mkii/cont-de.mkii
deleted file mode 100644
index 5badc59d00b..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/cont-de.mkii
+++ /dev/null
@@ -1,21 +0,0 @@
-%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 ADE \& \CONTEXT\ Development Team}]
-%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 {german}
-\def\defaultlanguagetag{de}
-
-\input context.mkii
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/cont-en.mkii b/Master/texmf-dist/tex/context/base/mkii/cont-en.mkii
deleted file mode 100644
index 9d0d4de2e33..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/cont-en.mkii
+++ /dev/null
@@ -1,21 +0,0 @@
-%D \module
-%D [ file=cont-en,
-%D version=1997.08.19,
-%D title=\CONTEXT,
-%D subtitle=\CONTEXT\ English Format Generation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 {english}
-\def\defaultlanguagetag{en}
-
-\input context.mkii
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/cont-err.mkii b/Master/texmf-dist/tex/context/base/mkii/cont-err.mkii
deleted file mode 100644
index 00118f6ccec..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/cont-err.mkii
+++ /dev/null
@@ -1,18 +0,0 @@
-%D \module
-%D [ file=cont-err,
-%D version=2003.08.12,
-%D title=\CONTEXT\ System Files,
-%D subtitle=Just A warning,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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
-
-\writestatus\m!systems{no file 'cont-sys.tex', using 'cont-sys.rme' instead}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/cont-fil.mkii b/Master/texmf-dist/tex/context/base/mkii/cont-fil.mkii
deleted file mode 100644
index 1f2923a6944..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/cont-fil.mkii
+++ /dev/null
@@ -1,131 +0,0 @@
-%D \module
-%D [ file=cont-fil,
-%D version=1997.11.15,
-%D title=\CONTEXT\ Miscellaneous Macros,
-%D subtitle=File Synonyms,
-%D author=J. Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 File Synonyms}
-
-\definefilesynonym [chemie] [chemic]
-\definefilesynonym [chemics] [chemic]
-
-\definefilesynonym [unit] [units]
-\definefilesynonym [eenheid] [units]
-\definefilesynonym [einheit] [units]
-
-\definefilesynonym [pstric] [pstricks]
-\definefilesynonym [pstrick] [pstricks]
-
-\definefilesynonym [finance] [financ]
-
-\definefilesynonym [con-01] [contml] % will go away
-
-%definefilesynonym [sch-base] [sch-00]
-%definefilesynonym [sch-make] [sch-01]
-
-\definefilesynonym [dir-make] [dir-01]
-\definefilesynonym [dir-identify] [dir-05]
-
-\definefilesynonym [xml-format] [xml-01]
-\definefilesynonym [xml-pretty] [xml-02]
-\definefilesynonym [xml-analyze] [xml-11]
-
-\definefilesynonym [int-load] [set-11]
-\definefilesynonym [int-make] [set-12]
-
-\definefilesynonym [fig-base] [fig-00]
-\definefilesynonym [fig-make] [fig-01]
-\definefilesynonym [fig-fake] [fig-02]
-\definefilesynonym [fig-missing] [fig-06]
-
-\definefilesynonym [exi-interface] [exi-21]
-
-\definefilesynonym [res-make] [res-01]
-\definefilesynonym [res-base] [res-04]
-\definefilesynonym [res-crop] [res-07]
-\definefilesynonym [res-trace] [res-08]
-\definefilesynonym [res-log] [res-09]
-\definefilesynonym [res-identify] [res-12]
-
-\definefilesynonym [med-show] [res-50]
-
-\definefilesynonym [pre-general] [pre-00]
-
-\definefilesynonym [pre-original] [pre-01]
-\definefilesynonym [pre-green] [pre-02]
-\definefilesynonym [pre-funny] [pre-03]
-\definefilesynonym [pre-colorful] [pre-04]
-\definefilesynonym [pre-fuzzy] [pre-05]
-\definefilesynonym [pre-polish] [pre-06]
-\definefilesynonym [pre-spider] [pre-07]
-\definefilesynonym [pre-wonder] [pre-08]
-\definefilesynonym [pre-windows] [pre-09]
-\definefilesynonym [pre-grow] [pre-10]
-\definefilesynonym [pre-stack] [pre-11]
-\definefilesynonym [pre-arrows] [pre-12]
-\definefilesynonym [pre-writing] [pre-13]
-\definefilesynonym [pre-split] [pre-14]
-\definefilesynonym [pre-balls] [pre-15]
-\definefilesynonym [pre-knot] [pre-16]
-\definefilesynonym [pre-weird] [pre-17]
-\definefilesynonym [pre-shade] [pre-18]
-\definefilesynonym [pre-organic] [pre-19]
-\definefilesynonym [pre-speckle] [pre-20]
-\definefilesynonym [pre-zoom] [pre-21]
-\definefilesynonym [pre-cycle] [pre-22]
-\definefilesynonym [pre-super] [pre-23]
-
-%definefilesynonym [pre-more] [pre-24]
-%definefilesynonym [pre-more] [pre-25]
-
-\definefilesynonym [pre-more] [pre-26]
-
-%definefilesynonym [pre-more] [pre-27]
-%definefilesynonym [pre-more] [pre-28]
-%definefilesynonym [pre-more] [pre-29]
-%definefilesynonym [pre-more] [pre-30]
-
-\definefilesynonym [pre-stepwise] [pre-60]
-\definefilesynonym [pre-stepper] [pre-61]
-
-\definefilesynonym [pre-punk] [pre-70]
-\definefilesynonym [pre-random] [pre-71]
-
-\definefilesynonym [abr-pseudocaps] [abr-01]
-\definefilesynonym [abr-smallcaps] [abr-02]
-\definefilesynonym [abr-03] [abr-01]
-\definefilesynonym [abr-04] [abr-01]
-
-\definefilesynonym [chinese] [chi-00]
-\definefilesynonym [japanese] [jap-00]
-
-%definefilesynonym [chi-simplified] [chi-01]
-%definefilesynonym [chi-traditional] [chi-02]
-
-\definefilesynonym [greek] [grk-00]
-
-\definefilesynonym [unic-chi] [unic-cjk]
-\definefilesynonym [unic-jap] [unic-cjk]
-
-%definefilesynonym [practexjournal] [ptj-01]
-\definefilesynonym [pracjourn] [ptj-01]
-
-\definefilesynonym [maps] [map-10]
-\definefilesynonym [map-se] [map-10] % for some time
-
-\definefilesynonym [mml] [mathml]
-\definefilesynonym [cml] [chemml]
-
-\definefilesynonym [letter] [cor-01]
-\definefilesynonym [memo] [cor-02]
-
-\definefilesynonym [syn-01] [syntax]
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/cont-fr.mkii b/Master/texmf-dist/tex/context/base/mkii/cont-fr.mkii
deleted file mode 100644
index e70cfe65eec..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/cont-fr.mkii
+++ /dev/null
@@ -1,21 +0,0 @@
-%D \module
-%D [ file=cont-de,
-%D version=1997.08.19,
-%D title=\CONTEXT,
-%D subtitle=\CONTEXT\ French Format Generation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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}
-\def\defaultlanguagetag{fr}
-
-\input context.mkii
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/cont-gb.mkii b/Master/texmf-dist/tex/context/base/mkii/cont-gb.mkii
deleted file mode 100644
index 5cd0a9635b0..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/cont-gb.mkii
+++ /dev/null
@@ -1,21 +0,0 @@
-%D \module
-%D [ file=cont-uk,
-%D version=1997.08.19,
-%D title=\CONTEXT,
-%D subtitle=\CONTEXT\ English Format Generation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 {english}
-\def\defaultlanguagetag{gb}
-
-\input context.mkii
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/cont-it.mkii b/Master/texmf-dist/tex/context/base/mkii/cont-it.mkii
deleted file mode 100644
index f15171403b3..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/cont-it.mkii
+++ /dev/null
@@ -1,21 +0,0 @@
-%D \module
-%D [ file=cont-it,
-%D version=1997.08.19,
-%D title=\CONTEXT,
-%D subtitle=\CONTEXT\ Italian Format Generation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 {italian}
-\def\defaultlanguagetag{it}
-
-\input context.mkii
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/cont-log.mkii b/Master/texmf-dist/tex/context/base/mkii/cont-log.mkii
deleted file mode 100644
index 6a7a707952d..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/cont-log.mkii
+++ /dev/null
@@ -1,304 +0,0 @@
-%D \module
-%D [ file=cont-log,
-%D version=1995.10.10,
-%D title=\CONTEXT\ Miscellaneous Macros,
-%D subtitle=\TEX\ Logos,
-%D author=J. Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 TeX Logos}
-
-%D The system that is used to typeset this text is called \TEX,
-%D typeset with an lowered~E. From te beginning of \TEX,
-%D authors of macro packages adapted this raising and lowering
-%D style. In this module we define some of those logos.
-
-%D The Computer Modern detection hack is gone as we now have Latin
-%D Modern which has more kerning pairs.
-
-\unprotect
-
-\def\Mkern#1%
- {{\setbox\scratchbox\hbox{M}\kern#1\wd\scratchbox}}
-
-\unexpanded\def\TeX
- {T%
- \Mkern{-.1667}\lower.5ex\hbox{E}%
- \Mkern{-.125}X}
-
-\unexpanded\def\ConTeXt{Con\TeX t}
-\unexpanded\def\PPCHTeX{ppch\TeX}
-\unexpanded\def\PRAGMA {Pragma ADE}
-
-\unexpanded\def\LaTeX % requested by erik frambach
- {{\setbox\scratchbox\hbox{L}%
- \scratchdimen\ht\scratchbox
- \setbox\scratchbox\hbox{\txx A}%
- L\kern-.55\wd\scratchbox
- \raise\scratchdimen\hbox{\lower\ht\scratchbox\copy\scratchbox}%
- \kern-.2\wd\scratchbox\TeX}}
-
-\unexpanded\def\TaBlE
- {T%
- \kern-.27em\lower.5ex\hbox{A}%
- \kern-.18emB%
- \kern-.1em\lower.5ex\hbox{L}%
- \kern-.075emE}
-
-\unexpanded\def\PiCTeX
- {P%
- \kern-.12em\lower.5ex\hbox{I}%
- \kern-.075em C%
- \kern-.11em\TeX}
-
-\def\AMSswitch#1%
- {$\cal\ifdim\bodyfontsize>1.1em\scriptstyle\fi#1$}
-
-\unexpanded\def\AmSTeX
- {\AMSswitch A%
- \kern-.1667em\lower.5ex\hbox{\AMSswitch M}%
- \kern-.125em\AMSswitch S%
- -\TeX}
-
-\unexpanded\def\LamSTeX
- {L%
- \kern-.4em\raise.3ex\hbox{\AMSswitch A}%
- \kern-.25em\lower.4ex\hbox{\AMSswitch M}%
- \kern-.1em{\AMSswitch S}%
- -\TeX}
-
-\unexpanded\def\AmSLaTeX
- {\AMSswitch A%
- \kern-.1667em\lower.5ex\hbox{\AMSswitch M}%
- \kern-.125em\AMSswitch S%
- -\LaTeX}
-
-%D Alternative \CONTEXT\ logo, first Idris S.~Hamid's version:
-%D
-%D \def\Context
-%D {{\sc C\kern -.0667emo\kern -.0667emn\kern -.0549emt\kern
-%D -.1667em\lower.5ex\hbox {e}\kern -.125emx\kern -.0549emt}}
-%D
-%D I changed this into one that adapts itself:
-
-\unexpanded\def\Context
- {{C\kern -.0667em\getscaledglyph{.8}\empty{O\kern -.0667emN\kern
- -.0549emT\doifitalicelse{\kern-.1em}{\kern-.1667em}\lower.5ex\hbox
- {E}\doifitalicelse\empty{\kern-.11em}X\kern-.055emT}}}
-
-%D The \METAFONT\ and \METAPOST\ logos adapt themselves to the
-%D current fontsize, an ugly but usefull hack.
-
-% rather hard coded
-%
-% \loadmapfile[original-base.map] % \loadmapfile[original-vogel-symbol]
-%
-% \unexpanded\def\setMFPfont
-% {\font\logofont=logo%
-% \ifnum\fam=\bffam\c!bf\else
-% \ifnum\fam=\slfam\c!sl\else
-% \ifnum\fam=\itfam\c!sl\else
-% \ifnum\fam=\bsfam\c!bf\else
-% \ifnum\fam=\bifam\c!bf\else
-% \fi\fi\fi\fi\fi
-% 10 at \currentfontscale\bodyfontsize
-% \logofont}
-%
-% or:
-%
-% \definefontsynonym [MetaLogo] [logo10]
-% \definefontsynonym [MetaLogoBold] [logobf10]
-% \definefontsynonym [MetaLogoSlanted] [logosl10]
-% \definefontsynonym [MetaLogoItalic] [logosl10]
-% \definefontsynonym [MetaLogoBoldSlanted] [logobf10]
-% \definefontsynonym [MetaLogoBoldtalic] [logobf10]
-%
-% \loadmapfile[original-base.map] % \loadmapfile[original-vogel-symbol]
-%
-% \def\setMFPfont{\symbolicfont{MetaLogo}}
-
-\let\logofont\nullfont
-
-\loadmapfile[original-base.map]
-
-\unexpanded\def\setMFPfont% more sensitive for low level changes
- {\font\logofont=logo%
- \ifx\fontalternative\c!bf\else
- \ifx\fontalternative\c!it\else
- \ifx\fontalternative\c!sl\else
- \ifx\fontalternative\c!bi\else
- \ifx\fontalternative\c!bs\else
- \fi\fi\fi\fi\fi
- 10 at \currentfontscale\bodyfontsize
- \logofont}
-
-%\unexpanded\def\MetaFont%
-% {\hbox{\setMFPfont METAFONT}}
-%
-%\unexpanded\def\MetaPost%
-% {\hbox{\setMFPfont METAPOST}}
-
-\def\MetaHyphen% there is no hyphenchar in this font
- {\discretionary{\vrule\!!height.33em\!!depth-.27em\!!width.33em}{}{}}
-
-\unexpanded\def\MetaFont
- {{\setMFPfont META\MetaHyphen FONT}}
-
-\unexpanded\def\MetaPost
- {{\setMFPfont META\MetaHyphen POST}}
-
-\unexpanded\def\MetaFun
- {MetaFun}
-
-%D \macros
-%D {TEX, METAFONT, METAPOST, METAFUN,
-%D PICTEX, TABLE,
-%D CONTEXT, PPCHTEX,
-%D AMSTEX, LATEX, LAMSTEX}
-%D
-%D We define the funny written ones as well as the less
-%D error prone upper case names (in \CONTEXT\ we tend to
-%D write all user defined commands, like abbreviations, in
-%D uppercase.)
-
-\unexpanded\def\METAFONT {\MetaFont}
-\unexpanded\def\METAPOST {\MetaPost}
-\unexpanded\def\PPCHTEX {\PPCHTeX}
-\unexpanded\def\CONTEXT {\ConTeXt}
-\unexpanded\def\METAFUN {\MetaFun}
-
-\unexpanded\def\TEX {\TeX}
-\unexpanded\def\LATEX {\LaTeX}
-\unexpanded\def\PICTEX {\PiCTeX}
-\unexpanded\def\TABLE {\TaBlE}
-\unexpanded\def\AMSTEX {\AmSTeX}
-\unexpanded\def\LAMSTEX {\LamSTeX}
-\unexpanded\def\INRSTEX {inrs\TeX}
-
-%D And this is how they show up: \TeX, \MetaFont, \MetaPost,
-%D \PiCTeX, \TaBlE, \ConTeXt, \PPCHTeX, \AmSTeX, \LaTeX,
-%D \LamSTeX.
-
-%D Some placeholders:
-
-\unexpanded\def\eTeX {\mathematics{\varepsilon}-\TeX}
-\unexpanded\def\pdfTeX {pdf\TeX}
-\unexpanded\def\pdfeTeX{pdfe-\TeX}
-\unexpanded\def\luaTeX {lua\TeX}
-\unexpanded\def\metaTeX{meta\TeX}
-\unexpanded\def\XeTeX {X\lower.5ex\hbox{\kern-.15em\mirror{E}}\kern-.1667em\TeX}
-
-% Adapted from a patch by Mojca:
-
-\def\@XeTeX@
- {\setbox\scratchbox\hbox{E}%
- \raise\dimexpr\ht\scratchbox+\dp\scratchbox\relax\hbox{\rotate[\c!rotation=180]{\box\scratchbox}}}
-
-\ifnum\texengine=\pdftexengine
-
- \unexpanded\def\XeTeX
- {X\lower.5ex
- \hbox
- {\kern-.15em
- \ifx\fontalternative\c!bf\mirror{E}\else
- \ifx\fontalternative\c!it \@XeTeX@\else
- \ifx\fontalternative\c!sl \@XeTeX@\else
- \ifx\fontalternative\c!bi \@XeTeX@\else
- \ifx\fontalternative\c!bs \@XeTeX@\else
- \mirror{E}\fi\fi\fi\fi\fi}%
- \kern-.1667em \TeX}
-
-\else
-
- \unexpanded\def\XeTeX
- {X\lower.5ex
- \hbox
- {\kern-.15em
- \iffontchar\font"018E\relax
- \char"018E%
- \else
- \ifx\fontalternative\c!bf\mirror{E}\else
- \ifx\fontalternative\c!it \@XeTeX@\else
- \ifx\fontalternative\c!sl \@XeTeX@\else
- \ifx\fontalternative\c!bi \@XeTeX@\else
- \ifx\fontalternative\c!bs \@XeTeX@\else
- \mirror{E}\fi\fi\fi\fi\fi
- \fi}%
- \kern-.1667em \TeX}
-
-\fi
-
-\let\ETEX \eTeX
-\let\PDFTEX \pdfTeX
-\let\PDFETEX\pdfeTeX
-\let\LUATEX \luaTeX
-\let\LuaTeX \luaTeX
-\let\XETEX \XeTeX
-
-\unexpanded\def\MkApproved % joke, not used so it might move
- {\dontleavehmode\rotate
- [\c!rotation={\ifnum\texengine=\luatexengine\ctxlua{tex.write(45-45*\the\luatexversion/100)}\else0\fi},
- \c!align=\v!middle,
- \c!foregroundstyle=\v!type,
- \c!foregroundcolor=darkred,
- \c!frame=\v!on,
- \c!offset=1ex,
- \c!background=\v!color,
- \c!backgroundcolor=lightgray,
- \c!framecolor=darkred,
- \c!rulethickness=2pt]
- {Mk\ifnum\texengine=\luatexengine IV\else II\fi\\approved}}
-
-% \unexpanded\def\luaTeX
-% {\dontleavehmode\begingroup
-% Lua%
-% \setbox0\hbox{oT}%
-% \setbox2\hbox{o\kern0ptT}%
-% \ifdim\wd0=\wd2
-% \setbox0\hbox dir TRT{To}%
-% \setbox2\hbox{T\kern0pto}%
-% \hskip\dimexpr\wd0-\wd2\relax
-% \fi
-% \TeX
-% \endgroup}
-%
-% a further iteration from the list, patched again
-
-% \ifx\fontalternative\c!it -\else
-% \ifx\fontalternative\c!sl -\else
-% \ifx\fontalternative\c!bi -\else
-% \ifx\fontalternative\c!bs -\fi\fi\fi\fi
-
-\def\LuaTeX
- {\dontleavehmode
- \begingroup
- Lua%
- % hope for kerning, try aT
- \setbox0\hbox{aT}%
- \setbox2\hbox{a\kern\zeropoint T}%
- \ifdim\wd0=\wd2 % kerns can go two ways
- % no aT kerning, try oT as a is not symmetrical
- \setbox0\hbox{oT}%
- \setbox2\hbox{o\kern\zeropoint T}%
- \ifdim\wd0=\wd2 % kerns can go two ways
- % no aT and oT kerning, try To
- \setbox0\hbox{To}%
- \setbox2\hbox{T\kern\zeropoint o}%
- % maybe we need to compensate for the angle (sl/it/bs/bi)
- \fi
- \ifdim\wd0=\wd2\else
- \kern\dimexpr\wd0-\wd2\relax
- \fi
- \fi
- \TeX
- \endgroup}
-
-\let\luaTeX \LuaTeX
-\let\LUATEX \LuaTeX
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/cont-new.mkii b/Master/texmf-dist/tex/context/base/mkii/cont-new.mkii
deleted file mode 100644
index ca8b992be29..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/cont-new.mkii
+++ /dev/null
@@ -1,943 +0,0 @@
-%D \module
-%D [ file=cont-new,
-%D version=1995.10.10,
-%D title=\CONTEXT\ Miscellaneous Macros,
-%D subtitle=New Macros,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\newcontextversion{2021.03.05 19:11}
-
-%D This file is loaded at runtime, thereby providing an
-%D excellent place for hacks, patches, extensions and new
-%D features.
-
-\unprotect
-
-% it's about time to clean up this file ...
-
-\writestatus\m!systems{beware: some patches loaded from cont-new.mkii}
-
-% \ifx\pdfmapfile \undefined \else \pdfmapfile{ } \fi
-
-% \font\f=dummyfont \rpcode\f0=500 \hbox{..}\char0
-% todo: mp-new
-% caption: grid=top|bottom in xml defs
-
-\def\fastscale#1%
- {\begingroup
- \ifnum#1=1000\relax
- \setfalse\scaleboxdone
- \else
- \settrue\scaleboxdone
- \edef\finalscaleboxxscale{\withoutpt\the\dimexpr#1pt/1000\relax}%
- \let\finalscaleboxyscale\finalscaleboxxscale
- \fi
- \dowithnextbox{\doscaleboxindeed\flushnextbox\endgroup}\hbox}
-
-% \setupcaption [figure] [align=flushleft]
-% \setupcaption [figure-1] [align=flushleft,leftmargin=10mm]
-% \setupcaption [figure-2] [align=flushleft,leftmargin=10mm,rightmargin=-10mm,width=\textwidth]
-%
-% \startsetups somefigure
-% \ifdim\floatsetupwidth>\textwidth
-% \placesetupfloat[figure-2]
-% \else
-% \placesetupfloat[figure-1]
-% \fi
-% \stopsetups
-%
-% \placefloatwithsetups[somefigure]{}{\externalfigure[dummy][width=5cm,height=2cm]}
-
-\def\placefloatwithsetups
- {\dotripleempty\doplacefloatwithsetups}
-
-\long\def\doplacefloatwithsetups[#1][#2][#3]#4%
- {\def\floatsetupcaption {#4}%
- \def\floatsetupcontent {\copy\nextbox}%
- \def\floatsetupwidth {\wd\nextbox}%
- \def\floatsetupheight {\ht\nextbox}%
- \def\placesetupfloat[##1]{\placefloat[##1][#2][#3]{#4}{\floatsetupcontent}}% #4 and not \floatsetupcaption (unexpanded)
- \dowithnextbox{\setups[#1]}\vbox}
-
-\def\dividedsize#1#2#3% size gap n
- {\dimexpr
- \ifnum\dimexpr#1\relax>\plusone
- (\dimexpr#1\relax-\numexpr#3-1\relax\dimexpr#2\relax)/#3\else#1%
- \fi
- \relax}
-
-% \setuplabeltext[\s!itemcount1={{I(},{)}}]
-% \def\labeledcountervalue#1{\labeltexts{#1}{\countervalue{#1}}}
-
-\def\singlewidened #1{\hbox spread 1em{\hss#1\hss}}
-\def\complexwidened[#1]#2{\hbox spread #1{\hss#2\hss}}
-
-\definecomplexorsimple\widened
-
-% todo
-%
-% \def\definelocation{\dodoubleargument\dodefinelocation}
-% \def\dodefinelocation[#1][#2]{\setvalue{loc:#1}{#2}}
-%
-% \definelocation[lt] [\v!left\v!top]
-% \definelocation[tl] [\v!left\v!top]
-% \definelocation[\v!top\v!left][\v!left\v!top]
-%
-% \def\getlocation#1{\executeifdefined{loc:#1}{#1}}
-
-% just in case we load something from a file (pdfr-ec for instance)
-
-\prependtoks \restoreendofline \to \everybeforeshipout
-
-% \let\cs\getvalue % no, we want \cs to be czech
-
-% experimental so this may change
-
-\def\startdescriptions
- {\dosingleempty\dostartdescriptions}
-
-\def\dostartdescriptions[#1]%
- {\begingroup
- \def\item{\getvalue{#1}}%
- \let\dostoppairdescription \donothing
- \let\@@description \dostartpairdescription
- \let\@@startsomedescription\dostartsomedescription}
-
-\def\stopdescriptions
- {\dostoppairdescription
- \endgroup}
-
-\def\dostartpairdescription[#1][#2]%
- {\dostoppairdescription
- \def\dostoppairdescription{\@@stopdescription{#1}}%
- \bgroup
- \def\currentdescription{#1}%
- \doifelse{\descriptionparameter{\s!do\c!state}}\v!start
- {\@@makedescription{#1}[#2]{}}
- {\@@makedescription{#1}[#2]}}
-
-\def\dostartsomedescription% #1[#2]#3%
- {\bgroup
- \@@makedescription} % {#1}[#2]{#3}}
-
-% \starttext
-%
-% \definedescription[test]
-%
-% \startdescriptions
-% \test{Foo} Bar bar bar
-% \test{Foo} Bar bar bar
-% \test{Foo} Bar bar bar
-% \stopdescriptions
-%
-% \startdescriptions[test]
-% \item{Foo} Bar bar bar
-% \item{Foo} Bar bar bar
-% \item{Foo} Bar bar bar
-% \stopdescriptions
-%
-% \startdescriptions
-% \starttest{Foo} Bar bar bar \stoptest
-% \starttest{Foo} Bar bar bar \stoptest
-% \starttest{Foo} Bar bar bar \stoptest
-% \stopdescriptions
-%
-% \startdescriptions[test]
-% \item{Foo} Bar bar bar
-% \item{Foo} Bar bar bar
-% \item{Foo} Bar bar bar
-% \stopdescriptions
-%
-% \stoptext
-
-% to do:
-%
-% \def\defineshapesynonym
-% {\dodoubleargument\dodefineshapesynonym}
-%
-% \def\dodefineshapesynonym[#1][#2]%
-% {\setvalue{shsy:#1}{#2}}
-%
-% \def\shapesynonym#1%
-% {\ifcsname shsy:#1\endcsname
-% \expandafter\shapesynonym\csname shsy:#1\endcsname\else#1%
-% \fi}
-%
-%\defineshapesynonym[eacute] [e]
-%\defineshapesynonym[egrave] [e]
-%\defineshapesynonym[eumlaut [e]
-%\defineshapesynonym[eogonek][e]
-%
-% more reduction
-%
-%\defineshapesynonym[e][o]
-%\defineshapesynonym[w][v]
-%\defineshapesynonym[m][n]
-%
-% \shapesynonym{eacute}
-
-% this will be activated when
-
-% \newinsert\thispageinsert % <- installinsertion
-
-% \def\flushatthispage
-% {\bgroup
-% \dowithnextbox{\insert\thispageinsert{\box\nextbox}\egroup}%
-% \hbox}
-
-% \appendtoks
-% \ifvoid\thispageinsert\else\hbox{\smashedbox\thispageinsert}\fi
-% \to \everyshipout
-
-% \definemarkedpage[nobackgrounds]
-% \markpage[nobackgrounds]
-% \doifmarkedpageelse{nobackgrounds}
-
-\newcounter\nofmarkedpages
-
-\def\definemarkedpage[#1]%
- {\definetwopasslist{\v!page:#1}}
-
-\def\markpage[#1]% looks very much like domarginreference
- {\iftrialtypesetting\else
- \doglobal\increment\nofmarkedpages\relax
- \lazysavetwopassdata{\v!page:#1}{\nofmarkedpages}{\noexpand\realfolio}%
- \fi}
-
-\def\doifmarkedpageelse#1%
- {\gettwopassdatalist{\v!page:#1}%
- \expanded{\doifinsetelse{\realfolio}{\twopassdatalist}}}
-
-% Just a simple and fast hanger, for usage in macros.
-
-\def\setuphanging
- {\dodoubleempty\getparameters[\??ha]}
-
-\setuphanging
- [\c!distance=.5em]
-
-\def\starthanging
- {\noindent\bgroup
- \dowithnextbox
- {\setbox\nextbox\hbox{\flushnextbox\hskip\@@hadistance}%
- \hangindent\nextboxwd
- \hangafter\plusone
- \flushnextbox\ignorespaces}
- \hbox}
-
-\def\stophanging
- {\endgraf
- \egroup}
-
-% experimental
-
-\def\stophangaround
- {\endgraf
- \egroup}
-
-\def\starthangaround
- {\noindent\bgroup
- \dowithnextbox
- {\ifdim\nextboxht>\strutht\setbox\nextbox\tbox{\flushnextbox}\fi
- \setbox\nextbox\hbox{\flushnextbox\hskip\@@hadistance}%
- \getboxheight\scratchdimen\of\box\nextbox
- \getnoflines\scratchdimen
- \nextboxht\strutht
- \nextboxdp\strutdp
- \hangindent\nextboxwd
- \hangafter-\noflines
- \llap{\flushnextbox}\ignorespaces}
- \hbox}
-
-\def\modevalue#1#2#3%
- {\@EA\ifx\csname\@mode@\systemmodeprefix#1\endcsname\endcsname\enabledmode#2\else#2\fi}
-
-\def\systemmodevalue#1%
- {\modevalue{\systemmodeprefix#1}}
-
-% \getmulticolumnlines -> now in cont-loc, to be tested and really needed
-
-% \tracefonthandlingtrue
-
-% new, still to be improved
-%
-% \dorecurse{10}
-% {\input thuan
-% \placefigure{}{\framed[height=1.5cm]{test}}
-% \placefloatplaceholder}
-
-\def\placefloatplaceholder
- {\ifroomforfloat \else
- \scratchdimen\pagegoal
- \advance\scratchdimen-\pagetotal
- \advance\scratchdimen-3\lineheight
- \ifdim\scratchdimen>\zeropoint
- \startlinecorrection[blank]
- \mhbox{\inframed{\labeltexts{placeholder}{\lastcaptiontag}}}%
- \stoplinecorrection
- \else
- \allowbreak
- \fi
- \fi}
-
-\setuplabeltext
- [placeholder={, moved}]
-
-% etex only, of course we could just parse (scan for \% in string)
-
-\newif\ifpercentdimendone
-
-\bgroup % usage: \setpercentdimen\somedimen{% or dimen} todo: pct
-\catcode124=\@@comment
-\catcode 37=\@@active
-\gdef\setpercentdimen#1#2|
- {\xdef\@@expanded{#2}|
- \ifx\@@expanded\empty\else
- \bgroup
- \global\percentdimendonefalse
- \def\%{\dimexpr#1/100\relax\global\percentdimendonetrue\ignorespaces}| scantokens add's a space
- \catcode`%=\@@active
- \catcode`\\=\@@escape
- \let%\%|
- \scratchdimen#1|
- \xdef\@@expanded{\@@expanded\scratchdimen\!!zeropoint}| trick: when 1.2 => .2\scratchdimen and 0pt typeset
- \startnointerference
- \global\globalscratchdimen\scantokens\@EA{\@@expanded}| i'm lazy and use etex
- \stopnointerference
- \egroup
- #1\globalscratchdimen
- \fi}
-\egroup
-
-% TEX alternative, in principle accurate enough and also a bit faster
-
-% \bgroup
-%
-% \catcode`\%=\@@other
-% \catcode`\|=\@@comment
-%
-% \gdef\setpercentdimen#1#2|
-% {\beforesplitstring#2\at%\to\ascii
-% \doifelse\ascii{#2}
-% {#1=#2}
-% {\divide#1by100\relax#1=\ascii#1\relax}} | or: {#1=\ascii#1\divide#1by100\relax}}
-%
-% \egroup
-%
-% \dimen0=1000pt \setpercentdimen{\dimen0}{10%} \the\dimen0
-% \dimen0= 100pt \setpercentdimen{\dimen0}{10%} \the\dimen0
-% \dimen0= 95pt \setpercentdimen{\dimen0}{10%} \the\dimen0
-% \dimen0= 10pt \setpercentdimen{\dimen0}{10%} \the\dimen0
-% \dimen0= 1pt \setpercentdimen{\dimen0}{10%} \the\dimen0
-
-\bgroup
-
-\obeylines % don't remove %'s !
-
-\gdef\collapsedspace#1%
- {\ifx#1^^M%
- \expandafter\collapsedspace
- \else
- \space
- \expandafter#1%
- \fi}
-
-\gdef\collapsespaces
- {\prependtoksonce\relax\to\everyeof%
- \ignorelines%
- \ignoretabs%
- \let\obeyedspace\collapsedspace%
- \obeyspaces}
-
-\egroup
-
-\def\inlinedbox
- {\bgroup
- \dowithnextbox
- {\scratchdimen\nextboxht
- \advance\scratchdimen\nextboxdp
- \advance\scratchdimen-\lineheight
- \divide\scratchdimen\plustwo
- \advance\scratchdimen\strutdepth
- \setbox\nextbox\hbox{\lower\scratchdimen\flushnextbox}%
- \nextboxht\strutht
- \nextboxdp\strutdp
- \flushnextbox
- \egroup}%
- \hbox}
-
-% \readfile{cont-exp}\donothing\donothing % speed up (5-20%)
-
-\def\dimenratio#1#2% etex only
- {\withoutpt\the\dimexpr2\dimexpr(#1)/\dimexpr(#2)/32768\relax\relax}
-
-\def\doxprecurse#1#2%
- {\ifnum#1=\zerocount % no \ifcase
- \expandafter\gobblethreearguments
- \else
- #2\expandafter\expandafter\expandafter\doxprecurse\expandafter
- \fi\expandafter{\the\numexpr#1-1\relax}{#2}}
-
-\def\buttonframed{\dodoubleempty\localframed[\??bt]} % goodie
-
-\unexpanded\def\asciistr#1{\dontleavehmode{\defconvertedargument\ascii{#1}\verbatimfont\ascii}}
-
-\def\shapefill{\vskip\zeropoint\!!plus\lineheight\!!minus\lineheight\relax}
-
-\let\normaltype\type
-
-\ifx\scantextokens\undefined
- \ifx\scantokens\undefined
- \unexpanded\def\retype#1{\dontleavehmode{\defconvertedargument\ascii{#1}\@EA\normaltype\@EA{\ascii}}}
- \else
- \unexpanded\def\retype#1{\dontleavehmode\scantokens{\normaltype{#1}\ignorespaces}\relax}
- \fi
-\else
- \unexpanded\def\retype#1{\dontleavehmode\scantextokens{\normaltype{#1}}}
-\fi
-
-\def\simplifytype{\let\type\retype}
-
-% \ruledhbox
-% {\startignorespaces
-% \def\oeps{a}
-% \startignorespaces
-% \def\oeps{a}
-% \stopignorespaces
-% \def\oeps{a}
-% \stopignorespaces
-% \oeps}
-
-\newsignal\boissignal
-\newcount \boislevel
-
-\long\def\startignorespaces
- {\advance\boislevel\plusone
- \ifcase\boislevel\or \ifhmode
- \hskip\boissignal
- \fi \fi
- \ignorespaces}
-
-\long\def\stopignorespaces
- {\ifcase\boislevel\or \ifhmode
- \doloop
- {\ifdim\lastskip=\zeropoint
- \exitloop
- \else\ifdim\lastskip=\boissignal
- \unskip
- \exitloop
- \else
- \unskip
- \fi\fi}%
- \fi \fi
- \advance\boislevel\minusone}
-
-\def\minimalhbox#1#%
- {\dowithnextbox
- {\bgroup
- \setbox\scratchbox\hbox#1{\hss}%
- \ifdim\nextboxwd<\wd\scratchbox\nextboxwd\wd\scratchbox\fi
- \flushnextbox
- \egroup}
- \hbox}
-
-% \def\dodimchoice#1#2#3%
-% {\ifx#3\relax
-% #1\@EA\gobbleuntilrelax
-% \else\ifdim#1#2%
-% #3\@EAEAEA\gobbleuntilrelax
-% \else
-% \@EAEAEA\dodimchoice
-% \fi\fi{#1}}
-
-% \def\donumchoice#1#2#3%
-% {\ifx#3\relax
-% #1\@EA\gobbleuntilrelax
-% \else\ifnum#1#2%
-% #3\@EAEAEA\gobbleuntilrelax
-% \else
-% \@EAEAEA\dodimchoice
-% \fi\fi{#1}}
-
-% \def\dimchoice#1#2{\dodimchoice{#1}#2\empty\relax}
-% \def\numchoice#1#2{\donumchoice{#1}#2\empty\relax}
-
-\def\gobbleuntilempty#1\empty{}
-
-\def\dodimchoice#1#2#3%
- {\ifdim#1#2%
- #3\@EA\gobbleuntilempty
- \else
- \@EA\dodimchoice
- \fi{#1}}
-
-\def\donumchoice#1#2#3%
- {\ifnum#1#2%
- #3\@EA\gobbleuntilempty
- \else
- \@EA\dodimchoice
- \fi{#1}}
-
-\def\dimchoice#1#2{\dodimchoice{#1}#2{=#1}{#1}\empty}
-\def\numchoice#1#2{\donumchoice{#1}#2{=#1}{#1}\empty}
-
-% \the\dimexpr(\dimchoice {7pt}{{<10pt}{8pt}{<12pt}{9pt}{<15pt}{10pt}{=11pt}{12pt}})
-% \the\dimexpr(\dimchoice{11pt}{{<10pt}{8pt}{<12pt}{9pt}{<15pt}{10pt}{=11pt}{12pt}})
-% \the\dimexpr(\dimchoice{14pt}{{<10pt}{8pt}{<12pt}{9pt}{<15pt}{10pt}{=11pt}{12pt}})
-
-\def\showsetupsdefinition[#1]{\showvalue{\??su:#1}} % temp hack for debugging
-
-% will be a MyWay
-%
-% \setuplayout[grid=yes] \setupcaption[figure][inbetween=] \useMPlibrary[dum] \setupcolors[state=start]
-%
-% \starttext \showgrid \showstruts
-%
-% \input ward \placefigure{}{\externalfigure[dummy][width=.5\hsize,lines=1.4,grid=yes]}
-% \input ward \placefigure{}{\externalfigure[dummy][width=.5\hsize,lines=1.4,grid=fit]}
-% \input ward \placefigure{}{\externalfigure[dummy][width=.5\hsize,lines=1.4,grid=height]}
-% \input ward
-% \page
-% \input ward \placefigure{}{\externalfigure[dummy][width=.5\hsize,lines=1.5,grid=yes]}
-% \input ward \placefigure{}{\externalfigure[dummy][width=.5\hsize,lines=1.5,grid=fit]}
-% \input ward \placefigure{}{\externalfigure[dummy][width=.5\hsize,lines=1.5,grid=height]}
-% \input ward
-% \page
-% \input ward \placefigure{}{\externalfigure[dummy][width=.5\hsize,lines=1.6,grid=yes]}
-% \input ward \placefigure{}{\externalfigure[dummy][width=.5\hsize,lines=1.6,grid=fit]}
-% \input ward \placefigure{}{\externalfigure[dummy][width=.5\hsize,lines=1.6,grid=height]}
-% \input ward
-% \page
-% \input ward \placefigure[none]{}{\externalfigure[dummy][width=.5\hsize,lines=1.4,grid=yes]}
-% \input ward \placefigure[none]{}{\externalfigure[dummy][width=.5\hsize,lines=1.4,grid=fit]}
-% \input ward \placefigure[none]{}{\externalfigure[dummy][width=.5\hsize,lines=1.4,grid=height]}
-% \input ward
-% \page
-% \input ward \placefigure[none]{}{\externalfigure[dummy][width=.5\hsize,lines=1.5,grid=yes]}
-% \input ward \placefigure[none]{}{\externalfigure[dummy][width=.5\hsize,lines=1.5,grid=fit]}
-% \input ward \placefigure[none]{}{\externalfigure[dummy][width=.5\hsize,lines=1.5,grid=height]}
-% \input ward
-% \page
-% \input ward \placefigure[none]{}{\externalfigure[dummy][width=.5\hsize,lines=1.6,grid=yes]}
-% \input ward \placefigure[none]{}{\externalfigure[dummy][width=.5\hsize,lines=1.6,grid=fit]}
-% \input ward \placefigure[none]{}{\externalfigure[dummy][width=.5\hsize,lines=1.6,grid=height]}
-% \input ward
-%
-% \stoptext
-
-% funny, as field action with e.g. dissolve ... only the field dissolves, bug?
-
-\setglobalsystemreference\rt!exec{Transition}{transition}
-
-%def\PDFexecutetransition {/Trans /Trans <</Type /Trans \executeifdefined{PDFpage\argumentA}\PDFpagereplace>>}
-\def\PDFexecutetransition {/Trans /Trans <<\executeifdefined{PDFpage\argumentA}\PDFpagereplace>>}
-
-% new, continuous blocks, \som \par \startdoorlopendblok ...
-
-% \startitemize
-% \item bagger
-% \item bagger
-% \item \startdoorlopendblok bagger \stopdoorlopendblok
-% \item \endgraf \startdoorlopendblok bagger \stopdoorlopendblok
-% \item \endgraf \startdoorlopendblok \strut bagger \stopdoorlopendblok
-% \item \startdoorlopendblok
-% \starttabulate
-% \NC test \NC test \NC \NR
-% \NC test \NC test \NC \NR
-% \NC test \NC test \NC \NR
-% \stoptabulate
-% \stopdoorlopendblok
-% \item test
-% \stopitemize
-
-\def\startdoorlopendblok % for special cases, don't change it too much and don't rely on it
- {\ifhmode\endgraf\nobreak\fi % don't remove the \nobreak
- \dowithnextboxcontent
- {\setlocalhsize \hsize\localhsize \forgetall}
- {\bgroup
- \forgeteverypar
- \forgetparskip
- \scratchdimen\nextboxht
- \advance\scratchdimen\nextboxdp
- \getnoflines\scratchdimen
- \advance\scratchdimen-\strutheight
- \setbox\nextbox\hbox{\lower\scratchdimen\box\nextbox}%
- \ht\nextbox\strutheight
- \dp\nextbox\strutdepth
- \setbox\nextbox\vbox
- {\indent\box\nextbox
- \endgraf
- \nobreak
- \advance\noflines\minusone
- \dorecurse\noflines{\crlf\nobreak}}%
- \verticalstrut
- \endgraf
- \nobreak
- \offinterlineskip
- \kern-2\lineheight % 2\lineheight when no vertical struts in main \vbox
- \nobreak
- \unvbox\nextbox
- \prevdepth\strutdepth
- % evt (eerst testen) een signal zodat een direct volgend blok goed gaat)
- \egroup}
- \vbox\bgroup
- \vskip-\lineheight \verticalstrut\endgraf
- \insidefloattrue
- \doinhibitblank} % beware, no \inhibitblank ! ! ! ! ! !
-
-\def\stopdoorlopendblok
- {\endgraf\verticalstrut\endgraf\kern-2\lineheight
- \egroup}
-
-\def\tabulaterule % to be redone, not correct
- {\dotabulaterule
- {\hrule\!!height.5\scratchdimen\!!depth.5\scratchdimen\relax
- \doifvalue{\??tt\currenttabulate\c!distance}\v!grid
- {\kern-\scratchdimen}}} % experimental tm-prikkels
-
-% experimental: \synchronizegrid bla bla bla
-
-\newcounter\currentgridsync
-
-\def\gridsynctag{grs:\currentgridsync}
-
-\def\synchronizegrid
- {\doglobal\increment\currentgridsync
- \par\prevdepth\zeropoint
- \nointerlineskip
- \hpos\gridsynctag{\strut}\par
- \vskip-\lineheight
- \nointerlineskip
- % top of text
- \scratchdimen\MPy{\v!text:\MPp\gridsynctag}%
- \advance\scratchdimen\MPh{\v!text:\MPp\gridsynctag}%
- % move to first baseline
- \advance\scratchdimen-\topskip
- % subtract wrong baseline
- \advance\scratchdimen-\MPy\gridsynctag
- % get minimal number of lines
- \advance\scratchdimen\lineheight
- \getnoflines\scratchdimen
- % calculate difference
- \advance\scratchdimen-\noflines\lineheight\relax
- \scratchdimen-\scratchdimen\relax
- \ifdim\scratchdimen>\zeropoint
- \nointerlineskip
- \advance\scratchdimen-\lineheight
- \vskip\scratchdimen \dontleavehmode \quad \strut
- \par
- %\else
- % \message{no grid correction: \the\scratchdimen}\wait
- \fi}
-
-% between alignment lines certain rules apply, and even a
-% simple test can mess up a table, which is why we have a
-% special test facility
-%
-% \ruledvbox
-% {\starttabulate[|l|p|]
-% \NC 1test \NC test \NC \NR
-% \tableifelse{\doifelse{a}{a}}{\NC Xtest \NC test \NC \NR}{}%
-% \stoptabulate}
-
-\long\def\tableifelse#1%
- {\tablenoalign
- {#1%
- {\aftergroup \firstoftwoarguments}%
- {\aftergroup\secondoftwoarguments}}}
-
-\long \def\tableiftextelse#1{\tableifelse{\doiftextelse{#1}}}
-
-% experiment, not yet to be used
-
-\def\displaybreak
- {\ifhmode
- \removeunwantedspaces
- \ifcase\raggedstatus\hfill\fi
- \strut\penalty-9999 % \break fails on case (3)
- \fi}
-
-\def\startdisplay{\displaybreak\ignorespaces\startpacked}
-\def\stopdisplay {\stoppacked\displaybreak\ignorespaces}
-
-\def\tightvbox{\dowithnextbox{\nextboxdp\zeropoint\flushnextbox}\vbox}
-\def\tightvtop{\dowithnextbox{\nextboxht\zeropoint\flushnextbox}\vtop}
-
-% what is this stupid macro meant for:
-
-\def\hyphenationpoint
- {\hskip\zeropoint}
-
-\def\hyphenated#1%
- {\bgroup
- \!!counta\zerocount
- \def\hyphenated##1{\advance\!!counta\plusone}%
- \handletokens#1\with\hyphenated
- \!!countb\plusone
- \def\hyphenated##1%
- {##1%
- \advance\!!countb\plusone\relax
- \ifnum\!!countb>2 \ifnum\!!countb<\!!counta
- \hyphenationpoint
- \fi\fi}%
- \handletokens#1\with\hyphenated
- \egroup}
-
-\def\obeysupersubletters
- {\let\super\normalsuper
- \let\suber\normalsuber
- \let\normalsuper\letterhat
- \let\normalsuber\letterunderscore
- \enablesupersub}
-
-\def\obeysupersubmath
- {\let\normalsuper\letterhat
- \let\normalsuber\letterunderscore
- \enablesupersub}
-
-%\let\normaltype\type
-%
-%\def\type#1%
-% {\expanded{\normaltype{\detokenize{#1}}}}
-
-% {x123 \os x123} {\tfa x123 \os x123} {x123 \tx x123 \os x123}
-% \definefontsynonym[OldStyle][Serif]
-% {x123 \os x123} {\tfa x123 \os x123} {x123 \tx x123 \os x123}
-
-% testen :
-%
-% \appendtoks
-% \let\registerparoptions\relax
-% \to \everyforgetall
-
-\def\startgridcorrection
- {\dosingleempty\dostartgridcorrection}
-
-\def\dostartgridcorrection[#1]%
- {\ifgridsnapping
- \iffirstargument\doifsomething{#1}{\moveongrid[#1]}\fi
- \snaptogrid\vbox\bgroup
- \else
- \startbaselinecorrection
- \fi}
-
-\def\stopgridcorrection
- {\ifgridsnapping
- \egroup
- \else
- \stopbaselinecorrection
- \fi}
-
-\def\checkgridsnapping
- {\lineskip\ifgridsnapping\zeropoint\else\normallineskip\fi}
-
-\def\startplaatsen
- {\dosingleempty\dostartplaatsen}
-
-\def\dostartplaatsen[#1]% tzt n*links etc
- {\endgraf
- \noindent\bgroup
- \setlocalhsize
- \hbox to \localhsize\bgroup
- \doifnot{#1}\v!left\hss
- \def\stopplaatsen
- {\unskip\unskip\unskip
- \doifnot{#1}\v!right\hss
- \egroup
- \egroup
- \endgraf}%
- \gobblespacetokens}
-
-% \startplaatsen[links] bla \stopplaatsen
-
-% we don't register the paragraph characteristics, only the
-% width
-
-\appendtoks
- \setinnerparpositions % see "techniek" for application
-\to \everytabulate
-
-\def\fontclassname#1#2%
- {\ifcsname\??ff#1#2\endcsname
- \fontclassname{#1}{\csname\??ff#1#2\endcsname}%
- \else\ifcsname\??ff#2\endcsname
- \fontclassname{#1}{\csname\??ff#2\endcsname}%
- \else
- #2%
- \fi\fi}
-
-\def\defineclassfontsynonym
- {\dotripleargument\dodefineclassfontsynonym}
-
-\def\dodefineclassfontsynonym[#1][#2][#3]%
- {\definefontsynonym[#1][\fontclassname{#2}{#3}]}
-
-%\definefontsynonym [KopFont] [\fontclassname{officina}{SerifBold}]
-%
-%\defineclassfontsynonym [KopFont] [officina] [SerifBold]
-
-\def\startcolumnmakeup % don't change
- {\bgroup
- \getrawnoflines\textheight % teksthoogte kan topskip hebben, dus raw
- \scratchdimen\noflines\lineheight
- \advance\scratchdimen-\lineheight
- \advance\scratchdimen\topskip
- \setbox\scratchbox
- \ifcase\showgridstate\vbox\else\ruledvbox\fi to \scratchdimen\bgroup
- \forgetall} % ! don't change
-
-\def\stopcolumnmakeup
- {\egroup
- \dp\scratchbox\zeropoint
- \wd\scratchbox\textwidth
- \box\scratchbox
- \egroup
- \synchronizehsize}
-
-\long\def\startexternalfigure
- {\dotripleempty\dostartexternalfigure}
-
-\long\def\dostartexternalfigure[#1][#2][#3]#4\stopexternalfigure
- {\gdef\figuredescription{#4}%
- \externalfigure[#1][#2][#3]%
- \globallet\figuredescription\empty}
-
-\let\figuredescription\empty
-
-%% where does this come from, old code probably
-%%
-%%
-%% \newif\ifpagechanged \let\lastchangedpage\empty
-%%
-%% \def\checkpagechange#1%
-%% {\gettwopassdata\s!paragraph
-%% \pagechangedfalse
-%% \iftwopassdatafound
-%% \ifnum\twopassdata>0\getvalue{\s!paragraph:p:#1}\relax
-%% \pagechangedtrue
-%% \fi
-%% \fi
-%% \ifpagechanged
-%% \letgvalue{\s!paragraph:p:#1}\twopassdata
-%% \globallet\lastchangedpage\twopassdata
-%% \else
-%% \globallet\lastchangedpage\realfolio
-%% \fi
-%% \doparagraphreference}
-%%
-%% \def\changedpage#1%
-%% {\getvalue{\s!paragraph:p:#1}}
-
-\newcount\nofprofiled
-
-\def\profilemacro#1%
- {\nofprofiled\zerocount
- \letvalue{\string#1\string#1}#1%
- \appendtoks
- \normalwritestatus\m!systems{profile \string#1: \number\nofprofiled}%
- \to \everystoptext
- \unexpanded\def#1%
- {\global\advance\nofprofiled\plusone
- \csname\string#1\string#1\endcsname}}
-
-% incomplete, will be a special case of float placement
-
-\def\startfixed{\dosingleempty\dostartfixed}
-
-\def\dostartfixed[#1]%
- {\expanded{\dowithnextbox{\noexpand\dodofixed{\ifhmode0\else1\fi}{#1}}}%
- \vbox\bgroup
- \setlocalhsize}
-
-\def\stopfixed
- {\egroup}
-
-\def\dodofixed#1#2%
- {\ifcase#1\relax
- \processaction
- [#2]
- [ \v!high=>\bbox {\flushnextbox},
- \v!low=>\tbox {\flushnextbox},
- \v!middle=>\vcenter{\flushnextbox},
- \v!lohi=>\vcenter{\flushnextbox},
- \s!unknown=>\tbox {\flushnextbox},
- \s!default=>\tbox {\flushnextbox}]%
- \else
- \startbaselinecorrection
- \noindent\flushnextbox
- \stopbaselinecorrection
- \fi}
-
-% \startitemize
-%
-% \item \externalfigure[koe][height=2cm]
-% \item \externalfigure[koe][height=2cm]
-% \item \externalfigure[koe][height=2cm]
-% \item \externalfigure[koe][height=2cm]
-%
-% \page
-%
-% \item \startfixed \externalfigure[koe][height=2cm]\stopfixed
-% \item \startfixed[high]\externalfigure[koe][height=2cm]\stopfixed
-% \item \startfixed[low] \externalfigure[koe][height=2cm]\stopfixed
-% \item \startfixed[lohi]\externalfigure[koe][height=2cm]\stopfixed
-%
-% \page
-%
-% \item test \startfixed \externalfigure[koe][height=2cm]\stopfixed
-% \item test \startfixed[high]\externalfigure[koe][height=2cm]\stopfixed
-% \item test \startfixed[low] \externalfigure[koe][height=2cm]\stopfixed
-% \item test \startfixed[lohi]\externalfigure[koe][height=2cm]\stopfixed
-%
-% \page
-%
-% \item test \par \startfixed \externalfigure[koe][height=2cm]\stopfixed
-% \item test \par \startfixed[high]\externalfigure[koe][height=2cm]\stopfixed
-% \item test \par \startfixed[low] \externalfigure[koe][height=2cm]\stopfixed
-% \item test \par \startfixed[lohi]\externalfigure[koe][height=2cm]\stopfixed
-%
-% \stopitemize
-
-\def\obeyfollowingtoken{{}} % end \cs scanning
-
-% \def\comparedimension#1#2%
-% {\chardef\compresult
-% \ifdim#1<#2%
-% \zerocount
-% \else\ifdim#1<#2%
-% \plusone
-% \else
-% \plustwo
-% \fi\fi}
-% \newdimen\roundingeps \roundingeps=10sp
-% \def\comparedimensioneps#1#2%
-% {\chardef\compresult
-% \ifdim\dimexpr(#1-#2)<\roudingeps
-% \zerocount
-% \else\ifdim\dimexpr(#2-#1)<\roudingeps
-% \zerocount
-% \else\ifdim#1<#2%
-% \plusone
-% \else
-% \plustwo
-% \fi\fi\fi}
-
-%D Next we load a few local optimizations and new features. They
-%D live on on my machine and are not distributed, but they may end
-%D up in the distributed files.
-
-\enablemode[mkii] \enablemode[*mkii]
-
-\long\def\startluacode#1\stopluacode{}
-\long\def\ctxlua #1{}
-
-\def\enabletrackers [#1]{}
-\def\disabletrackers[#1]{}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/cont-nl.mkii b/Master/texmf-dist/tex/context/base/mkii/cont-nl.mkii
deleted file mode 100644
index f9cefaaac06..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/cont-nl.mkii
+++ /dev/null
@@ -1,21 +0,0 @@
-%D \module
-%D [ file=cont-nl,
-%D version=1997.08.19,
-%D title=\CONTEXT,
-%D subtitle=\CONTEXT\ Dutch Format Generation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 {dutch}
-\def\defaultlanguagetag{nl}
-
-\input context.mkii
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/cont-ro.mkii b/Master/texmf-dist/tex/context/base/mkii/cont-ro.mkii
deleted file mode 100644
index d68cf5a4558..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/cont-ro.mkii
+++ /dev/null
@@ -1,22 +0,0 @@
-%D \module
-%D [ file=cont-ro,
-%D version=2000.01.09,
-%D title=\CONTEXT,
-%D subtitle=\CONTEXT\ Romanian Format Generation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 {romanian}
-\def\defaultlanguagetag{ro}
-
-\input context.mkii
-
-\endinput
-
diff --git a/Master/texmf-dist/tex/context/base/mkii/cont-sys.ori b/Master/texmf-dist/tex/context/base/mkii/cont-sys.ori
deleted file mode 100644
index fa438a78d4f..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/cont-sys.ori
+++ /dev/null
@@ -1,186 +0,0 @@
-%D \module
-%D [ file=cont-sys,
-%D version=1995.10.10,
-%D title=\CONTEXT\ Miscellaneous Macros,
-%D subtitle=System Specific Setups,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-%D Beware, this is a MkII specific file. In MkIV we only load
-%D cont-sys.mkiv but in MkII we load the first found of
-%D cont-sys.mkii, cont-sys.tex, cont-sys.rme.
-
-\unprotect
-
-% Speed up typescript loading, but at the cost of much memory:
-
-\preloadtypescripts
-
-% If you want another default font:
-%
-% \let\preloadfonts\relax
-% \usetypescript[palatino][\defaultencoding]
-% \setupbodyfont[palatino,rm,12pt]
-%
-% Please make sure that this defines rm, ss, tt and mm.
-
-% Occasionally we will support both A4 and letter in
-% styles. If you want letter size paper to be the default,
-% uncomment:
-%
-% \enablemode[\systemmodeprefix letter]
-%
-% If you always want to default to letter, you may uncomment
-% the following line, but beware: it makes your documents less
-% portable:
-%
-% \setuppapersize[letter][letter]
-
-% If you want some extras, just uncomment the following
-% line:
-%
-% \usemodule[plus] % experimental code
-%
-% Here you can take care of overloading some (style)
-% defaults. What goes here, depends on your local system.
-
-% The following commands sets the default font encoding:
-%
-% \setupencoding [\s!default=texnansi]
-%
-% or:
-
-\setupencoding [\s!default=ec]
-
-% If you want the default berry names:
-%
-% \usetypescript [berry] [\defaultencoding]
-%
-% or, if you also want other encodings:
-
-\usetypescript [berry] [ec,t5,8r] % texnansi is never present
-
-% If you run into missing font metrics kind of problems,
-% you may want to uncomment:
-%
-% \usetypescript[adobekb] [\defaultencoding]
-
-% You can let \CONTEXT\ load the map files for \PDFTEX.
-
-\autoloadmapfilestrue
-
-% (1) you can prevent loading with:
-%
-% \preloadmapfile[<...somename...>.map]
-%
-% (2) otherwise, use this if you have a fast machine
-%
-% \resetmapfiles \usetypescript [map] [base] [all]
-%
-% (3) or this if it's a slow one:
-
-\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
-
- \loadmapfile[original-base.map]
- \loadmapfile[texnansi-base.map]
- \loadmapfile[ec-base.map]
- \loadmapfile[qx-base.map]
- \loadmapfile[t5-base.map]
- %loadmapfile[il2-base.map]
- %loadmapfile[pl0-base.map]
- \loadmapfile[8r-base.map]
-
- \loadmapfile[original-ams-base.map]
- \loadmapfile[original-ams-euler.map]
-
- \loadmapfile[original-public-lm.map]
-
- %loadmapfile[texnansi-public-lm.map]
- %loadmapfile[ec-public-lm.map]
- %loadmapfile[qx-public-lm.map]
- %loadmapfile[t5-public-lm.map]
- %loadmapfile[pl0-public-lm.map]
- %loadmapfile[il2-public-lm.map]
-
-\fi
-
-% When you have your own fonts installed, you may want to predefine:
-%
-% \usetypescriptfile[type-buy]
-
-% Some styles default to Lucida Bright. You can overload
-% Lucida by Times cum suis. Watch out, the pos collection
-% is not scaled relatively.
-%
-% \definetypescriptsynonym [lbr] [pos]
-
-% Compensate for missing files:
-%
-% \definefontsynonym [gbhei] [gbsong]
-% \definefontsynonym [gbheisl] [gbsong]
-% \definefontsynonym [gbheisl] [gbsong]
-
-% Setting up a global figure path
-%
-% \setupexternalfigures [\c!directory={e:/fig/eps,t:/mine/figs}]
-%
-% Loading a specific special driver:
-%
-% \setupoutput [dviwindo]
-
-% Changing language defaults
-%
-% \setuplanguage
-% [nl]
-% [\c!leftquote=\upperleftsinglesixquote,
-% \c!leftquotation=\upperleftdoublesixquote]
-
-% Loading local preferences, for example
-%
-% \input prag-gen % company styles
-% \input prag-log % more company styles
-%
-% Enabling run time \METAPOST\ (also enable \write18 in
-% texmf.cnf):
-
-\runMPgraphicstrue
-\runMPTEXgraphicstrue
-
-% This saves some runtime, but needs a format, which you can
-% make with 'texexec --make --alone metafun'. Make sure that
-% the mem files are moved to the used web2c path (locate with
-% 'kpsewhich plain.mem').
-
-\useMETAFUNformattrue
-
-% This can be a way to get things working on system with
-% name clashes. (Some \TeX's tend do search system wide.)
-
-\protectbufferstrue
-
-% You can enable a more extensive figure searching, but
-% normally this is not really needed and even annoying.
-%
-% \runutilityfiletrue
-
-% So far.
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/context.mkii b/Master/texmf-dist/tex/context/base/mkii/context.mkii
deleted file mode 100644
index 33f8c3aba5a..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/context.mkii
+++ /dev/null
@@ -1,436 +0,0 @@
- %D \module
-%D [ file=context,
-%D version=2008.28.10, % 1995.10.10,
-%D title=\CONTEXT,
-%D subtitle=\CONTEXT\ Format Generation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 \catcode`\#=6
-
-%D From the next string (which is set by the script that assembles the
-%D distribution) later on we will calculate a number that can be used
-%D by use modules to identify the feature level. Starting with version
-%D 2004.8.30 the low level interface is english. Watch out and adapt
-%D your styles an modules.
-
-\edef\contextformat {\jobname}
-\edef\contextversion{2021.03.05 19:11}
-
-%D For those who want to use this:
-
-\let\fmtname \contextformat
-\let\fmtversion\contextversion
-
-%D Loading:
-
-\edef\mksuffix {mkii}
-\edef\contextmark{MKII}
-
-\ifx\normalinput\undefined \let\normalinput\input \fi
-
-\def\loadmarkfile#1{\normalinput#1.\mksuffix\relax}
-
-%D First we load the system modules. These implement a lot of
-%D manipulation macros. The first one loads \PLAIN\ \TEX, as
-%D minimal as possible.
-
-\loadmarkfile{syst-ini}
-
-%D Some checking (more primitives are now defined):
-
-\ifdefined\defaultinterface \else \def\defaultinterface {english} \fi
-%ifdefined\messageinterface \else \let\messageinterface \defaultinterface \fi
-\ifdefined\defaultlanguagetag \else \def\defaultlanguagetag{en} \fi
-
-%D More core code.
-
-\loadmarkfile{syst-pln}
-
-\loadmarkfile{norm-tex}
-\loadmarkfile{norm-etx}
-\loadmarkfile{norm-ptx}
-\loadmarkfile{norm-xtx}
-\loadmarkfile{norm-ctx}
-
-\loadmarkfile{catc-ini}
-\loadmarkfile{catc-act}
-\loadmarkfile{catc-def}
-\loadmarkfile{catc-ctx}
-\loadmarkfile{catc-sym}
-\loadmarkfile{catc-xml}
-
-\loadmarkfile{syst-gen}
-\loadmarkfile{syst-ext}
-\loadmarkfile{syst-new}
-\loadmarkfile{syst-con}
-\loadmarkfile{thrd-trg} % based on: David Carlisle
-
-\loadmarkfile{syst-fnt}
-\loadmarkfile{syst-str}
-\loadmarkfile{syst-rtp}
-
-\ifnum\texengine=\xetexengine
- \loadmarkfile{xetx-ini}
- \loadmarkfile{xetx-utf}
- \loadmarkfile{xetx-chr}
- \loadmarkfile{xetx-cls}
-\fi
-
-
-%D To enable selective loading, we say:
-
-\newif\ifCONTEXT \CONTEXTtrue % will disappear
-
-%D In order to conveniently load files, we need a few
-%D support modules.
-
-\loadmarkfile{supp-fil}
-\loadmarkfile{supp-dir}
-
-%D This is for mkii bibtex users who expect \LATEX\ commands.
-
-\loadmarkfile{supp-lat}
-
-%D After this we're ready for the multi||lingual interface
-%D modules.
-
-\loadmarkfile{mult-ini}
-\loadmarkfile{mult-fst}
-\loadmarkfile{mult-sys}
-\loadmarkfile{mult-def}
-\loadmarkfile{mult-chk}
-\loadmarkfile{mult-aux}
-
-%D Now we're ready for some general support modules. These
-%D modules implement some basic typesetting functionality.
-
-\loadmarkfile{core-var}
-\loadmarkfile{core-env}
-
-\loadmarkfile{supp-box}
-\loadmarkfile{supp-mrk}
-\loadmarkfile{supp-vis}
-\loadmarkfile{supp-fun}
-%loadmarkfile{supp-eps}
-\loadmarkfile{supp-spe}
-\loadmarkfile{supp-ran}
-\loadmarkfile{supp-mps}
-\loadmarkfile{supp-tpi}
-\loadmarkfile{supp-mat}
-\loadmarkfile{supp-ali}
-\loadmarkfile{supp-num}
-
-%D Verbatim typesetting is implemented in a separate class of
-%D modules. The pretty typesetting modules are loaded at run
-%D time.
-
-\loadmarkfile{verb-ini}
-
-%D The following modules are not sequentially dependent,
-%D i.e. they have ugly dependencies, which will be cleaned
-%D up by adding more overloading.
-
-%D When loading the font, color and special modules, we need a
-%D bit more advanced file handling as well as some general
-%D variables, and features, so next we load:
-
-\loadmarkfile{page-ins}
-\loadmarkfile{core-fil}
-\loadmarkfile{core-con}
-
-%D We already need some synonyms (patterns).
-
-\loadmarkfile{cont-fil}
-
-%D \CONTEXT\ does not implement its own table handling. We
-%D just go for the best there is and load \TABLE. Just to be
-%D sure we do it here, before we redefine \type{|}.
-
-\loadmarkfile{thrd-tab} % based on: Michael Wichura's TaBlE
-
-%D Here comes the last support modules. They take care of
-%D some language specific things.
-
-\loadmarkfile{supp-pat}
-
-%D The next few modules do what their names state. They
-%D load additional definition modules when needed.
-
-\loadmarkfile{regi-ini}
-\loadmarkfile{regi-syn}
-\loadmarkfile{enco-ini}
-%loadmarkfile{filt-ini}
-\loadmarkfile{hand-ini}
-
-\loadmarkfile{lang-ini}
-\loadmarkfile{lang-spe}
-\loadmarkfile{lang-lab}
-
-\loadmarkfile{unic-ini}
-
-\loadmarkfile{core-gen}
-\loadmarkfile{core-uti}
-\loadmarkfile{core-two}
-\loadmarkfile{core-stg}
-
-\loadmarkfile{spec-ini}
-\loadmarkfile{spec-mis}
-\loadmarkfile{spec-def}
-\loadmarkfile{spec-var}
-
-\loadmarkfile{colo-ini}
-\loadmarkfile{colo-ext}
-
-%D For the moment we load a lot of languages. In the future
-%D we'll have to be more space conservative.
-
-\loadmarkfile{lang-mis}
-\loadmarkfile{lang-url}
-
-\loadmarkfile{lang-ger}
-\loadmarkfile{lang-ita}
-\loadmarkfile{lang-sla}
-\loadmarkfile{lang-alt}
-\loadmarkfile{lang-ana}
-\loadmarkfile{lang-art}
-\loadmarkfile{lang-bal}
-\loadmarkfile{lang-cel}
-\loadmarkfile{lang-grk}
-\loadmarkfile{lang-ind}
-\loadmarkfile{lang-ura}
-\loadmarkfile{lang-vn}
-\loadmarkfile{lang-cyr}
-
-\loadmarkfile{typo-ini}
-
-%D All kind of symbols are handled in:
-
-\loadmarkfile{symb-ini}
-
-%D Sorting:
-
-\loadmarkfile{sort-ini}
-
-%D Next we load some core macro's. These implement the
-%D macros' that are seen by the users. The order of loading
-%D is important, due to dependancies.
-
-\loadmarkfile{spac-gen}
-\loadmarkfile{spac-grd}
-
-\loadmarkfile{strc-mar}
-\loadmarkfile{anch-pos}
-
-\loadmarkfile{buff-ver}
-\loadmarkfile{buff-ini}
-
-\loadmarkfile{pack-rul}
-\loadmarkfile{trac-vis}
-\loadmarkfile{strc-num}
-\loadmarkfile{tabl-com}
-\loadmarkfile{tabl-pln}
-\loadmarkfile{tabl-tab}
-\loadmarkfile{tabl-tsp}
-\loadmarkfile{scrn-nav}
-\loadmarkfile{strc-ref}
-\loadmarkfile{pack-obj}
-\loadmarkfile{strc-lst}
-\loadmarkfile{strc-itm}
-\loadmarkfile{strc-des}
-\loadmarkfile{strc-mat} % should come after math-pln etc
-\loadmarkfile{strc-syn}
-\loadmarkfile{core-sys}
-
-\loadmarkfile{page-ini}
-\loadmarkfile{page-bck}
-\loadmarkfile{page-not}
-\loadmarkfile{page-one}
-\loadmarkfile{page-lay}
-\loadmarkfile{page-log}
-\loadmarkfile{page-txt}
-\loadmarkfile{page-sid}
-\loadmarkfile{strc-flt}
-\loadmarkfile{page-mis}
-\loadmarkfile{page-mul}
-\loadmarkfile{page-set}
-\loadmarkfile{pack-lyr}
-\loadmarkfile{page-mak}
-\loadmarkfile{strc-pag}
-\loadmarkfile{page-lin}
-\loadmarkfile{page-par}
-\loadmarkfile{page-mar}
-
-\loadmarkfile{core-job} % why so late?
-
-% so far
-
-\loadmarkfile{strc-sec}
-\loadmarkfile{strc-swd}
-\loadmarkfile{strc-blk}
-
-\loadmarkfile{page-imp}
-\loadmarkfile{tabl-tbl}
-\loadmarkfile{scrn-int}
-\loadmarkfile{tabl-ntb}
-\loadmarkfile{tabl-nte}
-\loadmarkfile{tabl-ltb}
-
-%D A few more languages, that have specifics using core
-%D functionality:
-
-%loadmarkfile{lang-ara} % undefined
-\loadmarkfile{lang-chi}
-\loadmarkfile{lang-jap}
-
-%D How about fill||in fields and related stuff?
-
-\loadmarkfile{java-ini}
-\loadmarkfile{scrn-fld}
-\loadmarkfile{scrn-hlp}
-
-%D Registers can depend on fields, so we load that now.
-
-\loadmarkfile{strc-reg}
-
-%D Of course we do need fonts. There are no \TFM\ files
-%D loaded yet, so the format file is independant of their
-%D content. Here we also redefine \type{\it} as {\it italic}
-%D instead of italian.
-
-\loadmarkfile{font-ini}
-
-\ifnum\texengine=\xetexengine
- \loadmarkfile{font-xtx}
-\fi
-
-\loadmarkfile{font-unk}
-\loadmarkfile{font-uni}
-\loadmarkfile{font-bfm}
-
-\loadmarkfile{enco-pfr}
-
-\loadmarkfile{type-ini}
-\loadmarkfile{type-set}
-\loadmarkfile{type-def}
-
-%D Properties. Don't ask.
-
-\loadmarkfile{prop-ini}
-\loadmarkfile{prop-lay}
-\loadmarkfile{prop-mis}
-
-%D Like languages, fonts, encodings and symbols, \METAPOST\
-%D support is also organized in its own class of modules.
-
-\loadmarkfile{meta-ini}
-\loadmarkfile{meta-tex}
-\loadmarkfile{meta-pdf}
-
-\loadmarkfile{meta-pag}
-
-%D Special page handling (maybe even later)
-
-\loadmarkfile{page-flw}
-\loadmarkfile{page-spr}
-\loadmarkfile{page-plg}
-\loadmarkfile{page-str}
-
-%D Anchoring graphics:
-
-\loadmarkfile{anch-pgr}
-\loadmarkfile{anch-bar}
-\loadmarkfile{anch-snc}
-
-%D Math.
-
-\loadmarkfile{math-pln}
-\loadmarkfile{math-ini}
-\loadmarkfile{math-arr}
-\loadmarkfile{math-frc}
-
-%D Now we're ready for more core modules.
-
-\loadmarkfile{core-fnt}
-\loadmarkfile{strc-not}
-\loadmarkfile{strc-lnt}
-
-\loadmarkfile{core-mis}
-
-\loadmarkfile{grph-trf}
-\loadmarkfile{grph-inc}
-\loadmarkfile{grph-fig}
-
-\loadmarkfile{core-par}
-
-\loadmarkfile{pack-box}
-\loadmarkfile{page-app}
-\loadmarkfile{meta-fig}
-
-%D Language specific spacing.
-
-\loadmarkfile{lang-spa}
-
-%D Bibliographies:
-
-\loadmarkfile{bibl-tra}
-
-%D Only the basic XML parser and remapper are part of the core.
-%D These macros are loaded last since they overload and|/|or
-%D extend previously defined ones.
-
-\loadmarkfile{xtag-ini}
-\loadmarkfile{xtag-ext}
-\loadmarkfile{xtag-exp}
-\loadmarkfile{xtag-pre}
-\loadmarkfile{xtag-xsd}
-\loadmarkfile{xtag-rng}
-
-%D How about this:
-
-\loadmarkfile{meta-xml}
-
-%D \TEX\ related logo's are always typeset in a special way.
-%D Here they come:
-
-\loadmarkfile{cont-log}
-
-%D This one overloads af few things:
-
-\loadmarkfile{core-ctx}
-
-%D Defaults go here (more will be moved to this module
-%D later):
-
-\loadmarkfile{core-ini}
-\loadmarkfile{core-def}
-
-%D Preloaded modules (some need xml support):
-
-%usemodule[x][res-04] % xml resource libraries
-%usemodule[x][res-08] % rlx runtime conversion
-\usemodule[x][res-12] % rli external indentification
-
-%D At run time, a few more files are loaded, like:
-%D
-%D \startitemize[packed]
-%D \item \type{cont-sys}: local (system dependant) defaults
-%D \item \type{cont-old}: substitutes for old (obsolete) macros
-%D \item \type{cont-new}: new macro implementations (for testing)
-%D \item \type{cont-fil}: filename and module synonyms
-%D \stopitemize
-
-\setupcurrentlanguage[\defaultlanguagetag]
-
-\setupencoding[default=ec]
-
-\usetypescript[fallback][\defaultencoding]
-
-\setupbodyfont[rm,12pt]
-
-\errorstopmode \dump \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/core-con.mkii b/Master/texmf-dist/tex/context/base/mkii/core-con.mkii
deleted file mode 100644
index 46fbe9b9ee6..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/core-con.mkii
+++ /dev/null
@@ -1,969 +0,0 @@
-%D \module
-%D [ file=core-con,
-%D version=1997.26.08,
-%D title=\CONTEXT\ Core Macros,
-%D subtitle=Conversion,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Core Macros / Conversion}
-
-\unprotect
-
-\ifx\currentlanguage\undefined \let\currentlanguage\empty \fi
-\ifx\labeltext \undefined \let\labeltext\firstofoneargument \fi
-
-%D This module deals with all kind of conversions from numbers
-%D and dates. I considered splitting this module in a support
-%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
-%D First we deal with the dummy conversion of numbers using the
-%D \TEX\ primitive \type{\number}. The uppercase alternative is
-%D only there for compatibility with the other conversion
-%D macros. We could do without \type{#1} but this way we get
-%D rid of unwanted braces. For the savety we also define a
-%D non||sence uppercase alternative.
-%D
-%D \showsetup{numbers}
-%D
-%D \starttyping
-%D \def\numbers#1{\number#1}
-%D \def\Numbers#1{\number#1}
-%D \stoptyping
-%D
-%D Due to read ahead, as in \type{[\pagenumber\space]} the space will
-%D disappear, unless we use:
-
-\def\numbers#1{\purenumber{#1}}
-\def\Numbers#1{\purenumber{#1}}
-
-%D \macros
-%D {romannumerals,Romannumerals}
-%D
-%D \TEX\ the program uses a rather tricky conversion from
-%D numbers to their roman counterparts. This conversion could
-%D of course be programmed in \TEX\ itself, but I guess Knuth
-%D found the programming trick worth presenting.
-%D
-%D \showsetup{romannumerals}
-%D \showsetup{Romannumerals}
-
-%D When upcasing the result, we just follow the text book rules
-%D of expansion. Later on we'll see some more uppercase tricks.
-
-\def\romannumerals#1%
- {\romannumeral#1}
-
-%D For some years we had \unknown
-%D
-%D \starttyping
-%D \def\Romannumerals#1%
-%D {\uppercase\expandafter{\romannumeral#1}}
-%D \stoptyping
-%D
-%D \unknown but we need to be fully expandable in order to get
-%D the utility output file right, so now we have the following
-%D solution. It was Patrick Gundlach who first noticed this
-%D ommision.
-
-\def\Romannumerals#1%
- {\expandafter\doRomannumerals\number#1\relax}
-
-\def\doRomannumerals#1#2\relax % spaces after ifcase prevent \relax
- {\ifnum#1#2<10
- \ifcase0#1#2 \or I\or II\or III\or IV\or V\or VI\or VII\or VIII\or IX\fi
- \else\ifnum#1#2<100
- \ifcase0#1 \or X\or XX\or XXX\or XL\or L\or LX\or LXX\or LXXX\or XC\fi
- \doRomannumerals#2\relax
- \else\ifnum#1#2<1000
- \ifcase0#1 \or C\or CC\or CCC\or CD\or D\or DC\or DCC\or DCCC\or CM\fi
- \doRomannumerals#2\relax
- \else\ifnum#1#2<4000
- \ifcase0#1 \or M\or MM\or MMM\fi
- \doRomannumerals#2\relax
- \else
- \uppercase\expandafter{\romannumeral#1#2}%
- \fi\fi\fi\fi}
-
-%D \macros
-%D {character,Character}
-%D
-%D Converting a number into a character can of course only
-%D be done with numbers less or equal to~26. At the cost of
-%D much more macros a faster conversion is possible, using:
-%D
-%D \starttyping
-%D \setvalue{char1}{a} \def\character#1{\getvalue{char#1}}
-%D \stoptyping
-%D
-%D But we prefer a simpel \type{\case}.
-%D
-%D \showsetup{character}
-%D \showsetup{Character}
-
-\def\unknowncharacter{-} % else in lists \relax
-
-%D Big case statements but pretty fast:
-
-\def\character#1%
- {\ifcase#1\unknowncharacter
- \or a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or k\or l\or m%
- \or n\or o\or p\or q\or r\or s\or t\or u\or v\or w\or x\or y\or z%
- \else
- \unknowncharacter
- \fi}
-
-\def\Character#1%
- {\ifcase#1\unknowncharacter
- \or A\or B\or C\or D\or E\or F\or G\or H\or I\or J\or K\or L\or M%
- \or N\or O\or P\or Q\or R\or S\or T\or U\or V\or W\or X\or Y\or Z%
- \else
- \unknowncharacter
- \fi}
-
-%D \macros
-%D {characters,Characters}
-%D
-%D Converting large numbers is supported by the next two
-%D macros. This time we just count on: $\cdots$~x, y, z, aa,
-%D ab, ac~$\cdots$.
-%D
-%D \showsetup{characters}
-%D \showsetup{Characters}
-
-%D The fully expandable alternative:
-
-\def\dodoconvertcharacters#1#2#3%
- {\ifcase#3\else
- \ifnum#3>#1
- \expandafter\doconvertcharacters\expandafter#2\expandafter{\the\numexpr(#3+12)/#1-1\relax}%
- \expandafter#2\expandafter{\the\numexpr#3-((#3+12)/#1-1)*#1\relax}%
- \else
- \expandafter#2\expandafter{\number#3}%
- \fi
- \fi}
-
-\def\doconvertcharacters{\dodoconvertcharacters{26}}
-
-\def\characters{\doconvertcharacters\character}
-\def\Characters{\doconvertcharacters\Character}
-
-%D \macros
-%D {greeknumerals,Greeknumerals}
-%D
-%D Why should we only honour the romans, and not the greek?
-
-\def\greeknumerals#1%
- {% no longer needed: \mathematics
- {\ifcase#1\unknowncharacter\or
- \alpha \or \beta \or \gamma \or \delta \or
- \varepsilon \or \zeta \or \eta \or \theta \or
- \iota \or \kappa \or \lambda \or \mu \or
- \nu \or \xi \or \omicron \or \pi \or
- \varrho \or \sigma \or \tau \or \upsilon \or
- \phi \or \chi \or \psi \or \omega
- \else
- \unknowncharacter
- \fi}}
-
-\def\Greeknumerals#1%
- {% no longer needed: \mathematics
- {\ifcase#1\unknowncharacter \or
- \Alpha \or \Beta \or \Gamma \or \Delta \or
- \Epsilon \or \Zeta \or \Eta \or \Theta \or
- \Iota \or \Kappa \or \Lambda \or \Mu \or
- \Nu \or \Xi \or \Omicron \or \Pi \or
- \Rho \or \Sigma \or \Tau \or \Upsilon \or
- \Phi \or \Xi \or \Psi \or \Omega
- \else
- \unknowncharacter
- \fi}}
-
-%D \macros
-%D {oldstylenumerals,oldstyleromannumerals}
-%D
-%D These conversions are dedicated to Frans Goddijn.
-
-\unexpanded\def\oldstylenumerals#1%
- {{\os\number#1}}
-
-\unexpanded\def\oldstyleromannumerals#1%
- {{\leftrulefalse\rightrulefalse\ss\txx\boxrulewidth.15ex
- \ruledhbox spread .15em{\hss\uppercased{\romannumerals{#1}}\hss}}}
-
-%D \macros
-%D {protectconversion}
-%D
-%D The previous two commands are not robust enough to be
-%D passed to \type{\write} en \type{\message}. That's why we
-%D introduce:
-
-\def\protectconversion
- {\def\doconvertcharacters##1{##1}} % was \relax
- %{\def\doconvertcharacters##1{\ifcase0##1 0\else##1\fi}} more save
-
-%D \macros
-%D {normaltime,normalyear,normalmonth,normalday}
-%D
-%D The last part of this module is dedicated to converting
-%D dates. Because we want to use as meaningful commands as
-%D possible, and because \TEX\ already uses up some of those,
-%D we save the original meanings.
-
-\savenormalmeaning\time
-\savenormalmeaning\year
-\savenormalmeaning\month
-\savenormalmeaning\day
-
-%D \macros
-%D {month,MONTH}
-%D
-%D Converting the month number into a month name is done
-%D using a case statement, abstact values and the label
-%D mechanism. This way users can easily redefine a label from
-%D for instance german into austrian.
-%D
-%D \starttyping
-%D \setuplabeltext [de] [january=J\"anner]
-%D \stoptyping
-%D
-%D Anyhow, the conversion looks like:
-
-\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\monthlong {\doconvertmonthlong}
-\def\monthshort{\doconvertmonthshort}
-\def\month {\doconvertmonth}
-
-\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
-%D week. In doing so, we have to calculate the total number of
-%D days, taking leapyears into account. For those who are
-%D curious:
-%D
-%D \startitemize[packed]
-%D \item years that can be divided by 4 are leapyears
-%D \item exept years that can be divided by 100
-%D \item unless years can be divided by 400
-%D \stopitemize
-%D
-%D This makes the year 1900 into a normal year and 1996 and
-%D 2000 into leap years, right? Well, converting to string
-%D looks familiar:
-
-\def\doconvertday#1%
- {\labeltext
- {\ifcase#1
- \or \v!sunday \or \v!monday \or \v!tuesday \or \v!wednesday
- \or \v!thursday \or \v!friday \or \v!saturday \fi}}
-
-%D \macros
-%D {getdayoftheweek, dayoftheweek}
-%D
-%D The conversion algoritm is an old one and a translation from
-%D a procedure written in MODULA~2 back in the 80's. I finaly
-%D found the 4--100-400 rules in some enclopedia. Look at this
-%D messy low level routine that takes the day, month and year
-%D as arguments:
-
-\newcount\normalweekday
-
-\def\getdayoftheweek#1#2#3%
- {\bgroup
- \!!counta#3\relax
- \advance\!!counta \minusone
- \!!countb\!!counta
- \multiply\!!countb 365
- \advance\!!countb \ifcase#2\relax
- 0 \or 0 \or 31 \or 59 \or 90 \or120 \or151 \or
- 181 \or212 \or243 \or273 \or304 \or334 \or365 \fi
- \advance\!!countb #1\relax
- \ifnum#2>2
- \doifleapyearelse{#3}{\advance\!!countb 1}{}\relax
- \fi
- \!!countc\!!counta
- \dosetdivision\!!countc4\!!countc
- \advance\!!countb \!!countc
- \!!countc\!!counta
- \dosetdivision\!!countc{100}\!!countc
- \advance\!!countb -\!!countc
- \!!countc\!!counta
- \dosetdivision\!!countc{400}\!!countc
- \advance\!!countb \!!countc
- \dosetmodulo\!!countb7\!!countb
- \advance\!!countb \plusone
- \@EA\egroup\@EA\normalweekday\the\!!countb\relax}
-
-\def\dayoftheweek#1#2#3%
- {\getdayoftheweek{#1}{#2}{#3}\doconvertday{\normalweekday}}
-
-%D Using this macro in
-%D
-%D \startbuffer
-%D monday: \dayoftheweek {4} {5} {1992}
-%D friday: \dayoftheweek {16} {6} {1995}
-%D monday: \dayoftheweek {25} {8} {1997}
-%D saturday: \dayoftheweek {30} {8} {1997}
-%D tuesday: \dayoftheweek {2} {1} {1996}
-%D tuesday: \dayoftheweek {7} {1} {1997}
-%D tuesday: \dayoftheweek {13} {1} {1998}
-%D friday: \dayoftheweek {1} {1} {2000}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D gives
-%D
-%D \startvoorbeeld
-%D \startlines
-%D \getbuffer
-%D \stoplines
-%D \stopvoorbeeld
-%D
-%D The macro \type {\getdayoftheweek} can be used to calculate
-%D the number \type {\normalweekday}.
-
-%D \macros
-%D {weekday,WEEKDAY}
-%D
-%D The first one is sort of redundant. It takes the day
-%D number argument.
-%D
-%D \showsetup{weekday}
-%D \showsetup{WEEKDAY}
-
-\def\weekday
- {\doconvertday}
-
-\def\WEEKDAY#1%
- {{\let\labeltext\LABELTEXT\doconvertday{#1}}}
-
-%D \macros
-%D {weekoftheday}
-%D
-%D {\em not yet implemented:}
-%D
-%D \starttyping
-%D \def\weekoftheday#1#2#3%
-%D {}
-%D \stoptyping
-
-%D \macros
-%D {doifleapyearelse,
-%D getdayspermonth}
-%D
-%D Sometimes we need to know if we're dealing with a
-%D leapyear, so here is a testmacro:
-%D
-%D \starttyping
-%D \doifleapyearelse{year}{yes}{no}
-%D \stoptyping
-%D
-%D An example of its use can be seen in the macro
-%D
-%D \starttyping
-%D \getdayspermonth{year}{month}
-%D \stoptyping
-%D
-%D The number of days is available in the macro \type
-%D {\numberofdays}.
-
-\def\doifleapyearelse#1% #2#3%
- {\bgroup
- \!!doneafalse
- \!!counta#1%
- \dosetmodulo\!!counta4\!!countb
- \ifcase\!!countb
- \dosetmodulo\!!counta{100}\!!countb
- \ifcase\!!countb \else \!!doneatrue \fi
- \dosetmodulo\!!counta{400}\!!countb
- \ifcase\!!countb \!!doneatrue \fi
- \fi
- \if!!donea
- \egroup\@EA\firstoftwoarguments % \def\next{#2}%
- \else
- \egroup\@EA\secondoftwoarguments % \def\next{#3}%
- \fi} % \next}
-
-% untested but cleaner:
-%
-% \def\doifleapyearelse#1% #2#3%
-% {\bgroup
-% \dosetmodulo{#1}{400}\scratchcounter
-% \ifcase\scratchcounter
-% \else
-% \dosetmodulo{#1}{100}\scratchcounter
-% \ifcase\scratchcounter
-% \scratchcounter\plusone
-% \else
-% \dosetmodulo{#1}4\scratchcounter
-% \fi
-% \fi
-% \ifcase\scratchcounter
-% \egroup\@EA\firstoftwoarguments
-% \else
-% \egroup\@EA\secondoftwoarguments
-% \fi}
-
-\def\getdayspermonth#1#2%
- {\doifleapyearelse{#1}
- {\def\numberofdays{29}}
- {\def\numberofdays{28}}%
- \edef\numberofdays
- {\ifcase#2 \or31\or\numberofdays\or31\or30\or
- 31\or30\or31\or31\or30\or31\or30\or31\fi}}
-
-%D \macros
-%D {currentdate, date}
-%D
-%D We use these conversion macros in the date formatting
-%D macro:
-%D
-%D \showsetup{currentdate}
-%D
-%D This macro takes care of proper spacing and delivers for
-%D instance:
-%D
-%D \startbuffer
-%D \currentdate[weekday,day,month,year] % still dutch example
-%D \currentdate[WEEKDAY,day,MONTH,year] % still dutch example
-%D \stopbuffer
-%D
-%D \startvoorbeeld
-%D \startlines
-%D \getbuffer
-%D \stoplines
-%D \stopvoorbeeld
-%D
-%D depending of course on the keywords. Here we gave:
-%D
-%D \typebuffer
-%D
-%D If needed one can also add non||keywords, like in
-%D
-%D \startbuffer
-%D \currentdate[dd,--,mm,--,yy]
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D or typeset: \getbuffer.
-%D
-%D When no argument is passed, the current date is given as
-%D specified per language (using \type{\installlanguage}).
-%D
-%D \showsetup{currentdate}
-%D
-%D \startbuffer
-%D \date
-%D \date[d=12,m=12,y=1998][weekday]
-%D \date[d=12,m=12,y=1998]
-%D \stopbuffer
-%D
-%D We can also typeset arbitrary dates, using the previous
-%D command.
-%D
-%D \typebuffer
-%D
-%D The date is specified by one character keys. When no date
-%D is given, we get the current date.
-%D
-%D \startlines
-%D \getbuffer
-%D \stoplines
-
-\def\kenmerkdatumpatroon{j,mm,dd} % jj,mm,dd changed at januari 1-1-2000
-
-\newsignal\datesignal
-
-\def\dobetweendates
- {\ifdim\lastskip=\datesignal\relax\else
- \unskip\space
- \hskip\datesignal\relax
- \fi}
-
-\newtoks \everycurrentdate
-
-\def\complexcurrentdate[#1]%
- {\bgroup
- \the\everycurrentdate
- \def\betweendates{\let\betweendates\dobetweendates}%
- % was \processcommacommandp[#1]\docomplexcurrentdate
- \safeedef\ascii{\empty#1}% keep encoded chars
- \@EA\processcommalist\@EA[\ascii]\docomplexcurrentdate
- \ifdim\lastskip=\datesignal\relax
- \unskip
- \fi
- \egroup}
-
-\def\docomplexcurrentdate#1%
- {\lowercase{\edef\!!stringa{#1}}% permits usage in \smallcapped
- \expanded{\processaction[\!!stringa]}% [#1]
- [ \v!day=>\betweendates\the\normalday,
- %\v!day+=>\betweendates\ordinaldaynumber\normalday,
- \v!day+=>\betweendates\convertnumber{\v!day+}\normalday,
- \v!month=>\betweendates\month\normalmonth,
- \v!year=>\betweendates\the\normalyear,
- \v!space=>\unskip\ \hskip\datesignal,% optimization -)
- \ =>\unskip\ \hskip\datesignal,% optimization -)
- d=>\convertnumber\v!day\normalday,
- %d+=>\ordinaldaynumber\normalday,
- d+=>\convertnumber{\v!day+}\normalday,
- m=>\convertnumber\v!month\normalmonth,
- j=>\convertnumber\v!year\normalyear,
- y=>\convertnumber\v!year\normalyear,
- w=>\betweendates\dayoftheweek\normalday\normalmonth\normalyear,
- dd=>\ifnum\normalday >9 \else0\fi\the\normalday,
- %dd+=>\ordinaldaynumber{\ifnum\normalday >9 \else0\fi\the\normalday},
- dd+=>\convertnumber{\v!day+}{\ifnum\normalday >9 \else0\fi\the\normalday},
- mm=>\ifnum\normalmonth>9 \else0\fi\the\normalmonth,
- jj=>\expandafter\gobbletwoarguments\the\normalyear,
- yy=>\expandafter\gobbletwoarguments\the\normalyear,
- \v!weekday=>\betweendates\dayoftheweek\normalday\normalmonth\normalyear,
- \v!referral=>\expanded{\complexcurrentdate[\kenmerkdatumpatroon]},
- \s!unknown=>\unskip
- % #1 and not the lowercased \commalistelement, vietnamese has text
- % {} because #1 can have comma, like: {\ ,}
- {#1}%
- \hskip\datesignal
- \def\betweendates{\let\betweendates\dobetweendates}]}
-
-\def\simplecurrentdate
- {\expanded{\complexcurrentdate[\currentdatespecification]}}
-
-\definecomplexorsimple\currentdate
-
-\def\dodate[#1][#2]%
- {\bgroup
- \iffirstargument
- \getparameters[\??da][d=\normalday,m=\normalmonth,y=\normalyear,#1]%
- \normalday \@@dad\relax
- \normalmonth\@@dam\relax
- \normalyear \@@day\relax
- \ifsecondargument
- \currentdate[#2]%
- \else
- \currentdate
- \fi
- \else
- \currentdate
- \fi
- \egroup}
-
-\def\date
- {\dodoubleempty\dodate}
-
-%D \macros
-%D {currenttime}
-%D
-%D The currenttime is actually the jobtime. You can specify
-%D a pattern similar to the previous date macro using the
-%D keys \type {h}, \type {m} and a separator.
-
-\def\calculatecurrenttime
- {\dosetdivision\time{60}\scratchcounter
- \edef\currenthour {\ifnum\scratchcounter<10 0\fi \the\scratchcounter}%
- \dosetmodulo \time{60}\scratchcounter
- \edef\currentminute{\ifnum\scratchcounter<10 0\fi \the\scratchcounter}}
-
-\let\currenthour \!!plusone
-\let\currentminute\!!plusone
-
-\def\currenttimespecification{h,:,m}
-
-\def\complexcurrenttime[#1]%
- {\calculatecurrenttime
- \processallactionsinset[#1]
- [h=>\currenthour,m=>\currentminute,\s!unknown=>\commalistelement]}
-
-\def\simplecurrenttime
- {\expanded{\complexcurrenttime[\currenttimespecification]}}
-
-\definecomplexorsimple\currenttime
-
-%D Because we're dealing with dates, we also introduce a few
-%D day loops:
-%D
-%D \starttyping
-%D \processmonth{year}{month}{command}
-%D \processyear{year}{command}{before}{after}
-%D \stoptyping
-%D
-%D The counters \type {\normalyear}, \type {\normalmonth} and
-%D \type{\normalday} can be used for for date manipulations.
-
-\long\def\processmonth#1#2#3% year month command
- {\bgroup
- \getdayspermonth{#1}{#2}%
- \dostepwiserecurse1\numberofdays1%
- {\normalyear #1\relax
- \normalmonth#2\relax
- \normalday \recurselevel\relax
- #3}%
- \egroup}
-
-\def\lastmonth{12} % can be set to e.g. 1 when testing
-
-\long\def\processyear#1#2#3#4% year command before after
- {\bgroup
- \dorecurse\lastmonth
- {\normalyear #1\relax
- \normalmonth\recurselevel\relax
- #3\processmonth\normalyear\normalmonth{#2}#4}%
- \egroup}
-
-%D \macros
-%D {defineconversion, convertnumber}
-%D
-%D Conversion involves the macros that we implemented earlier
-%D in this module.
-%D
-%D \showsetup{defineconversion}
-%D \showsetup{convertnumber}
-%D
-%D We can feed this command with conversion macros as well as
-%D a set of conversion symbols. Both need a bit different
-%D treatment.
-%D
-%D \starttyping
-%D \defineconversion [roman] [\romannumerals]
-%D \defineconversion [set 1] [$\star$,$\bullet$,$\ast$]
-%D \stoptyping
-%D
-%D You can define a language dependent conversion with:
-%D
-%D \starttyping
-%D \defineconversion [en] [whatever] [\something]
-%D \stoptyping
-
-% \def\dodefineconversion[#1][#2]%
-% {\ConvertConstantAfter\doifinstringelse{,}{#2}
-% {\scratchcounter=0
-% \def\docommand##1%
-% {\advance\scratchcounter 1
-% \setvalue{\??cv#1\the\scratchcounter}{##1}}%
-% \processcommalist[#2]\docommand
-% \setvalue{\??cv#1}##1{\csname\??cv#1##1\endcsname}}
-% {\setvalue{\??cv#1}{#2}}}
-%
-% \def\defineconversion%
-% {\dodoubleargument\dodefineconversion}
-
-\def\defineconversion
- {\dotripleempty\dodefineconversion}
-
-\def\dodefineconversion[#1][#2][#3]%
- {\ifthirdargument
- \dododefineconversion[#1][#2][#3]%
- \else
- \dododefineconversion[][#1][#2]%
- \fi}
-
-%D \starttyping
-%D \def\dododefineconversion[#1][#2][#3]%
-%D {\ConvertConstantAfter\doifinstringelse{,}{#3}
-%D {\scratchcounter\zerocount
-%D \def\docommand##1%
-%D {\advance\scratchcounter \plusone
-%D \setvalue{\??cv#1#2\the\scratchcounter}{##1}}%
-%D \processcommalist[#3]\docommand
-%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
- \def\docommand##1%
- {\advance\scratchcounter \plusone
- \setvalue{\??cv#1#2\the\scratchcounter}{##1}}%
- \processcommalist[#3]\docommand
- \setevalue{\??cv#1#2}##1%
- {\noexpand\docheckedconversion{#1#2}{\the\scratchcounter}{##1}}}
- {\setvalue{\??cv#1#2}{#3}}}
-
-\def\docheckedconversion#1#2#3% class maxnumber number
- {\executeifdefined{\??cv#1#3}\unknown}
-
-%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\docheckedconversion#1#2#3% class maxnumber number
- {\executeifdefined{\??cv#1\modulatednumber{#2}{#3}}\unknown}
-
-%D Taco's modulo code is implemented in the system module
-%D \type {syst-con}.
-
-%D If a conversion is just a font switch then we need to make sure
-%D that the number is indeed end up as number in the input, so we
-%D need to handle the second argument.
-
-\def\convertnumber#1#2%
- {\csname\??cv
- \ifcsname\??cv\currentlanguage#1\endcsname
- \currentlanguage#1%
- \else\ifcsname\??cv#1\endcsname
- #1%
- \else
- \s!default
- \fi\fi
- \endcsname{\number#2}}
-
-\def\doifconversiondefinedelse#1%
- {\ifcsname\??cv\currentlanguage#1\endcsname
- \@EA\firstoftwoarguments
- \else\ifcsname\??cv#1\endcsname
- \@EAEAEA\firstoftwoarguments
- \else
- \@EAEAEA\secondoftwoarguments
- \fi\fi}
-
-\def\doifelseconversionnumber#1#2% slow but seldom used
- {\doifdefinedelse{\??cv#1#2}}
-
-%D Handy.
-
-\setvalue{\??cv:\c!n:\v!one }{1}
-\setvalue{\??cv:\c!n:\v!two }{2}
-\setvalue{\??cv:\c!n:\v!three}{3}
-\setvalue{\??cv:\c!n:\v!four }{4}
-\setvalue{\??cv:\c!n:\v!five }{5}
-
-\def\wordtonumber#1#2{\ifcsname\??cv:\c!n:#1\endcsname\csname\??cv:\c!n:#1\endcsname\else#2\fi}
-
-% \defineconversion[ctx][c,o,n,t,e,x,t]
-%
-% \doloop{\doifelseconversionnumber{ctx}{\recurselevel}{[\recurselevel]}{\exitloop}}
-
-\defineconversion [\s!default] [\numbers]
-
-%D As longs as symbols are linked to levels or numbers, we can
-%D also use the conversion mechanism, but in for instance the
-%D itemization macros, we prefer symbols because they can more
-%D easier be (partially) redefined. Symbols are implemented
-%D in another module.
-
-\defineconversion [] [\numbers] % the default conversion
-
-\defineconversion [a] [\characters]
-\defineconversion [A] [\Characters]
-\defineconversion [AK] [\smallcapped\characters]
-\defineconversion [KA] [\smallcapped\characters]
-
-\defineconversion [n] [\numbers]
-\defineconversion [N] [\Numbers]
-\defineconversion [m] [\mediaeval]
-
-\defineconversion [i] [\romannumerals]
-\defineconversion [I] [\Romannumerals]
-\defineconversion [r] [\romannumerals]
-\defineconversion [R] [\Romannumerals]
-\defineconversion [KR] [\smallcapped\romannumerals]
-\defineconversion [RK] [\smallcapped\romannumerals]
-
-\defineconversion [g] [\greeknumerals]
-\defineconversion [G] [\Greeknumerals]
-
-\defineconversion [o] [\oldstylenumerals]
-\defineconversion [O] [\oldstylenumerals]
-\defineconversion [or] [\oldstyleromannumerals]
-
-\defineconversion [\v!character] [\character]
-\defineconversion [\v!Character] [\Character]
-
-\defineconversion [\v!characters] [\characters]
-\defineconversion [\v!Characters] [\Characters]
-
-\defineconversion [\v!numbers] [\numbers]
-\defineconversion [\v!Numbers] [\Numbers]
-\defineconversion [\v!mediaeval] [\mediaeval]
-
-\defineconversion [\v!romannumerals] [\romannumerals]
-\defineconversion [\v!Romannumerals] [\Romannumerals]
-
-\defineconversion [\v!greek] [\greeknumerals]
-\defineconversion [\v!Greek] [\Greeknumerals]
-
-\defineconversion [arabicnumerals] [\arabicnumerals]
-\defineconversion [persiannumerals] [\arabicnumerals]
-
-\defineconversion [month] [\doconvertmonthlong]
-\defineconversion [month:mnem] [\doconvertmonthshort]
-
-% Some bonus ones:
-
-\defineconversion [\v!empty] [\gobbleoneargument]
-\defineconversion [\v!none] [\numbers]
-
-\ifx\symbol\undefined \def\symbol[#1]{#1} \fi % todo
-
-\defineconversion
- [set 0]
- [{\symbol[bullet]},
- {\symbol[dash]},
- {\symbol[star]},
- {\symbol[triangle]},
- {\symbol[circle]},
- {\symbol[medcircle]},
- {\symbol[bigcircle]},
- {\symbol[square]}]
-
-\defineconversion
- [set 1]
- [\mathematics{\star},
- \mathematics{\star\star},
- \mathematics{\star\star\star},
- \mathematics{\ddagger},
- \mathematics{\ddagger\ddagger},
- \mathematics{\ddagger\ddagger\ddagger},
- \mathematics{\ast},
- \mathematics{\ast\ast},
- \mathematics{\ast\ast\ast}]
-
-\defineconversion
- [set 2]
- [\mathematics{*},
- \mathematics{\dag},
- \mathematics{\ddag},
- \mathematics{**},
- \mathematics{\dag\dag},
- \mathematics{\ddag\ddag},
- \mathematics{***},
- \mathematics{\dag\dag\dag},
- \mathematics{\ddag\ddag\ddag},
- \mathematics{****},
- \mathematics{\dag\dag\dag\dag},
- \mathematics{\ddag\ddag\ddag\ddag}]
-
-\defineconversion
- [set 3]
- [\mathematics{\star},
- \mathematics{\star\star},
- \mathematics{\star\star\star},
- \mathematics{\ddagger},
- \mathematics{\ddagger\ddagger},
- \mathematics{\ddagger\ddagger\ddagger},
- \mathematics{\P},
- \mathematics{\P\P},
- \mathematics{\P\P\P},
- \mathematics{\S},
- \mathematics{\S\S},
- \mathematics{\S\S\S},
- \mathematics{\ast},
- \mathematics{\ast\ast},
- \mathematics{\ast\ast\ast}]
-
-%D \macros
-%D {defineconversionvector,conversionnumber} % bad names so no danger for clash
-%D
-%D For Adam and friends \unknown
-%D
-%D \startitemize[persiannummerals]
-%D \item test \item test \item test \item test
-%D \stopitemize
-
-\def\defineconversionvector#1#2% name base
- {\bgroup
- % dirty trick
- \uccode`\*=`\1
- % plain:
- % \uccode`\0=\numexpr#2+0\relax \uccode`\1=\numexpr#2+1\relax
- % \uccode`\2=\numexpr#2+2\relax \uccode`\3=\numexpr#2+3\relax
- % \uccode`\4=\numexpr#2+4\relax \uccode`\5=\numexpr#2+5\relax
- % \uccode`\6=\numexpr#2+6\relax \uccode`\7=\numexpr#2+7\relax
- % \uccode`\8=\numexpr#2+8\relax \uccode`\9=\numexpr#2+9\relax
- % context:
- \dostepwiserecurse091{\expandafter\uccode\expandafter`\recurselevel=\numexpr#2+\recurselevel}%
- % prepared macro
- \uppercase\expandafter{\expandafter\gdef\csname::cvn::#1::\endcsname##*%
- {\ifcase##* 0\or1\or2\or3\or4\or5\or6\or7\or8\or9\fi}}%
- \egroup}
-
-\def\conversionnumber#1#2%
- {\ifcsname::cvn::#1::\endcsname
- \expandafter\doconversionnumber\csname::cvn::#1::\expandafter\endcsname\number#2\relax
- \else
- \number#2%
- \fi}
-
-\def\doconversionnumber#1#2%
- {\ifx#2\relax
- \expandafter\gobbleoneargument
- \else
- #1{#2}%
- \expandafter\doconversionnumber
- \fi#1}
-
-% actually mkiii code
-
-\ifnum\texengine=\xetexengine
-
- \defineconversionvector{arabicnumerals} {"0660}
- \defineconversionvector{persiannumerals} {"06F0}
- \defineconversionvector{thainumerals} {"0E50}
- \defineconversionvector{devanagarinumerals}{"0966}
- \defineconversionvector{gurmurkhinumerals} {"0A66}
- \defineconversionvector{gujaratinumerals} {"0AE6}
- \defineconversionvector{tibetannumerals} {"0F20} % also "half numerals?"
-
- \defineconversion[arabicnumerals] [\conversionnumber{arabicnumerals}]
- \defineconversion[persiannumerals] [\conversionnumber{persiannumerals}]
- \defineconversion[thainumerals] [\conversionnumber{thainumerals}]
- \defineconversion[devanagarinumerals][\conversionnumber{devanagarinumerals}]
- \defineconversion[gurmurkhinumerals] [\conversionnumber{gurmurkhinumerals}]
- \defineconversion[gujaratinumerals] [\conversionnumber{gujaratinumerals}]
- \defineconversion[tibetannumerals] [\conversionnumber{tibetannumerals}]
-
-\fi
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/core-ctx.mkii b/Master/texmf-dist/tex/context/base/mkii/core-ctx.mkii
deleted file mode 100644
index c693d10db6f..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/core-ctx.mkii
+++ /dev/null
@@ -1,203 +0,0 @@
-%D \module
-%D [ file=core-ctx,
-%D version=2006.08.16, % old stuff
-%D title=\CONTEXT\ Core Macros,
-%D subtitle=Job Control,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Core Macros / Job Control}
-
-\unprotect
-
-\chardef\preprocessmethod 2 % 0=no check 1=present_check 2=log_check
-\chardef\preprocessstate 0 % 1=found 2=not_present (skip)
-\chardef\preprocesslocal 0 % 0=no 1=yes
-\def \preprocesssuffix {.prep}
-
-\def\loadctxpreplist
- {\begingroup
- \chardef\XMLtokensreduction\plusone
- \ifcase\preprocessmethod
- % no checking
- \or
- % simple checking
- \or
- \doiffileexistselse{./\jobname.ctl}
- {\bgroup
- \defineXMLenvironment[ctx:preplist][local=no]
- {\doifelse{\XMLop{local}}{yes}
- {\global\chardef\preprocesslocal\plusone
- \writestatus\m!systems{loading ctx log file (local)}}%
- {\writestatus\m!systems{loading ctx log file (specified)}}}
- \donothing
- \defineXMLenvironmentsave[ctx:prepfile][done=no]
- \donothing
- {\edef\readfilename{\XMLflush{ctx:prepfile}}%
- \ifcase\preprocesslocal\else
- \splitfilename\readfilename
- \let\readfilename\splitoffbase
- \fi
- \writestatus\m!systems{registering \readfilename\space -> \XMLop{done}}%
- \setxvalue{fp..\readfilename}{\XMLop{done}}}%
- \processXMLfile{./\jobname.ctl}%
- \egroup}%
- {\global\chardef\preprocessmode\plusone}%
- \fi
- \global\let\loadctxpreplist\relax
- \endgroup}
-
-\appendtoks\loadctxpreplist\to\everystarttext % will become: \prependtoks\loadctxpreplist\to\everyjob
-
-\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 existence of \readfilename\preprocesssuffix}\fi
- \doiffileexistselse{\readfilename\preprocesssuffix}
- {\chardef\preprocessstate\plusone}
- \donothing
- \or
- % check when in list, otherwise assume normal file
- \bgroup
- \splitfilename\readfilename
- \ifx\splitofftype\empty
- % saveguard and speed up
- \iftracefiles\writestatus\m!systems{preprocessing - no suffix}\fi
- \egroup
- \else\ifcase\preprocesslocal
- % also ./ strippen
- \iftracefiles\writestatus\m!systems{preprocessing - check presence of \readfilename\preprocesssuffix}\fi
- \doifdefinedelse{fp..\readfilename}
- {\egroup
- \doiffileexistselse{\readfilename\preprocesssuffix}
- {\chardef\preprocessstate\plusone}
- {\chardef\preprocessstate\plustwo}}%
- {\doifdefinedelse{fp.../\readfilename}
- {\egroup
- \edef\readfilename{./\readfilename}%
- \doiffileexistselse{\readfilename\preprocesssuffix}
- {\chardef\preprocessstate\plusone}
- {\chardef\preprocessstate\plustwo}}%
- {\doifdefinedelse{fp..\splitoffbase}%
- {\egroup
- \doiffileexistselse{\readfilename\preprocesssuffix}
- {\chardef\preprocessstate\plusone}
- {\chardef\preprocessstate\plustwo}}%
- {\egroup}}}%
- \else
- % maybe just filecheck, why ctl
- \iftracefiles\writestatus\m!systems{preprocessing - check local presence of \readfilename\preprocesssuffix}\fi
- \doifdefinedelse{fp..\readfilename}
- {\egroup
- \doiffileexistselse{\readfilename\preprocesssuffix}
- {\chardef\preprocessstate\plusone}
- {\chardef\preprocessstate\plustwo}}%
- {\egroup}%
- \fi
- \fi\fi}
-
-% beware, \readfilename keeps the original one, but we load and store the
-% suffixed with .prep file (if present)
-
-\def\doreadfile#1#2#3#4% beware, this one already works at format generation time!
- {\sanitizefilename#2\to\readfilename
- \ifx\readfilename\empty
- % silently ignore
- \else
- \let\trackedfilename\readfilename
- \chardef\preprocessstate\zerocount
- \ifconditional\trackfilenames
- \doifundefinedelse{fn..\trackedfilename}\donetrue\donefalse
- \else
- \donetrue
- \fi
- \ifdone
- \checkfilename\readfilename
- \ifcase\kindoffile
- % not a full path or url, check for existence
- \doifelsenothing{#1}
- {\iftracefiles\writestatus\m!systems{searching for \readfilename\space on tex path}\fi
- \def\next{\redoreadfile\readfilename{#3}{#4}}}%
- {\iftracefiles\writestatus\m!systems{searching for \readfilename\space on #1}\fi
- \def\next{\redoreadfile{\pathplusfile{#1}{\readfilename}}{#3}{#4}}}%
- \else
- % a full path or url, no further checking done
- \docheckprepfile
- \ifcase\preprocessstate
- \doiffileexistselse\readfilename
- {\iftracefiles\writestatus\m!systems{located \readfilename}\fi
- \def\next{#3\dodoreadfile}}%
- {\iftracefiles\writestatus\m!systems{not found \readfilename}\fi
- \def\next{#4}}%
- \or
- \iftracefiles\writestatus\m!systems{located \readfilename\preprocesssuffix}\fi
- \def\next{#3\dodoreadfile}%
- \or
- \iftracefiles\writestatus\m!systems{not found \readfilename\preprocesssuffix}\fi
- \def\next{#4}%
- \fi
- \fi
- \else
- \edef\readfilename{\getvalue{fn..\readfilename}}% ??? is done !
- \iftracefiles\writestatus\m!systems{already located \readfilename}\fi
- \def\next{#3\dodoreadfile}%
- \fi
- \expandafter\next
- \fi}
-
-\def\redoreadfile#1#2#3%
- {\docheckprepfile
- \ifcase\preprocessstate
- \doiffileexistselse{#1}%
- {\edef\readfilename{#1}%
- \iftracefiles\writestatus\m!systems{#1 located}\fi
- \def\next{#2\dodoreadfile}}%
- {\iftracefiles\writestatus\m!systems{cannot locate #1}\fi
- \advance\readlevel\minusone
- \ifnum\readlevel>\zerocount
- \edef\readfilename{\pathplusfile{\f!parentpath}{\readfilename}}%
- \def\next{\redoreadfile\readfilename{#2}{#3}}%
- \else
- \def\next{#3}%
- \fi}%
- \or
- \ifcase\preprocesslocal
- \edef\readfilename{#1}% nor found
- \else
- % no path prepending
- \fi
- \iftracefiles\writestatus\m!systems{#1\preprocesssuffix\space located}\fi
- \def\next{#2\dodoreadfile}%
- \or
- \def\next{#3}%
- \fi
- \next}
-
-\def\dodoreadfile % we provide hooks, for instance for \enableXML
- {\ifconditional\trackfilenames
- \setxvalue{fn..\trackedfilename}{\readfilename\ifcase\preprocessstate\or\preprocesssuffix\fi}%
- \fi
- \the\everybeforereadfile
- \ifcase\preprocessstate
- % no checking or not found when using method 1
- \def\dodoreadfileindeed{\inputgivenfile\readfilename}%
- \or
- % found when using method 1 or 2
- \def\dodoreadfileindeed{\inputgivenfile{\readfilename\preprocesssuffix}}%
- \or
- % not found when using method 2
- \let\dodoreadfileindeed\relax
- \fi
- \dodoreadfileindeed
- \relax
- \the\everyafterreadfile}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/core-def.mkii b/Master/texmf-dist/tex/context/base/mkii/core-def.mkii
deleted file mode 100644
index 971e8953d99..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/core-def.mkii
+++ /dev/null
@@ -1,105 +0,0 @@
-%D \module
-%D [ file=core-def,
-%D version=2002.05.07,
-%D title=\CONTEXT\ Core Macros,
-%D subtitle=Defaults,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Core Macros / Defaults}
-
-%D Here we collect settings that cannot be done earlier due to
-%D depedencies. More code will moved to this module later.
-
-\unprotect
-
-\usesymbols[mis,mvs] % 'glm' no longer needed due to lm
-
-\usesymbols[nav] \setupsymbolset[navigation 1]
-
-\setupinteraction[\c!symbolset=navigation 1]
-
-% initialization order:
-
-%appendtoks \initializeluainstances \to \everyjob
-\appendtoks \showcontextbanner \to \everyjob
-\appendtoks \initializenewlinechar \to \everyjob
-\appendtoks \checksystemcommandmode \to \everyjob
-\appendtoks \calculatecurrenttime \to \everyjob
-\appendtoks \loadsystemfiles \to \everyjob
-
-\appendtoks \loadoptionfile \to \everyjob % can load files !
-
-\appendtoks \preloadfonts \to \everyjob
-\appendtoks \settopskip \to \everyjob
-\appendtoks \preloadlanguages \to \everyjob
-\appendtoks \preloadspecials \to \everyjob
-\appendtoks \openspecialfile \to \everyjob
-\appendtoks \openutilities \to \everyjob
-\appendtoks \splitjobfilename \to \everyjob
-\appendtoks \checknotes \to \everyjob % depends on bodyfont
-\appendtoks \initializeMPgraphics \to \everyjob % after loading system files
-\appendtoks \reportsystemcommandmode \to \everyjob
-\appendtoks \initializemainlanguage \to \everyjob
-\appendtoks \settrue\trackfilenames \to \everyjob
-\appendtoks \newbackgroundfalse \to \everyjob % global
-
-\ifdefined\initializepagecounters
- \appendtoks \initializepagecounters \to \everyjob
-\fi
-
-\appendtoks \directsetup{*runtime:options} \to \everyjob % we could erase them afterwards % order can change
-\appendtoks \directsetup{*runtime:modules} \to \everyjob % we could erase them afterwards % order can change
-
-\appendtoks \checkpreprocessor \to \everyjob
-
-%appendtoks \page[\v!last] \page \to \everybye % moved to core-job, we need to do this cleaner
-\appendtoks \ifarrangingpages\poparrangedpages\fi \to \everybye
-\appendtoks \registerfileinfo[end]\jobname \to \everybye
-\appendtoks \savenofpages \to \everybye
-\appendtoks \savenofsubpages \to \everybye
-
-\appendtoks \closeutilities \to \everygoodbye
-\appendtoks \stopcopyingblocks \to \everygoodbye
-\appendtoks \closespecialfile \to \everygoodbye
-
-\prependtoks \resetutilities \to \everystarttext % moved 28-02-2002
-\prependtoks \loadtwopassdata \to \everystarttext % moved 28-02-2002
-\appendtoks \checkreferences \to \everystarttext % new 04-12-1999
-
-% \appendtoks\everyjob\expandafter{\the\everyjob\checkpreprocessor}\to\everydump
-
-% temporary here:
-
-% \in \at \about \from \over
-
-\unexpanded\def\arg{\mathortext\normalmatharg\normaltextarg}
-
-% brrr
-% normally one does not want this to happen nested, maybe there
-% is more; non public vars btw, will become conditionals
-
-\ifx\writetoregisterfalse\undefined \else \appendtoks \writetoregisterfalse \to \everybeforeutilityread \fi
-\ifx\writetolistfalse \undefined \else \appendtoks \writetolistfalse \to \everybeforeutilityread \fi
-\ifx\notesenabledfalse \undefined \else \appendtoks \notesenabledfalse \to \everybeforeutilityread \fi
-
-\def\synctexwarning
- {\ifdefined\synctex \ifnum\synctex=\zerocount \else
- \writeline
- \writestatus\m!systems{BEWARE: synctex functionality is enabled!}%
- \writeline
- \globallet\synctexwarning\relax
- \fi \fi}
-
-\prependtoks \synctexwarning \to \everyjob
-\prependtoks \synctexwarning \to \everystarttext
-\appendtoks \synctexwarning \to \everystoptext
-
-% last minute hacks
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/core-env.mkii b/Master/texmf-dist/tex/context/base/mkii/core-env.mkii
deleted file mode 100644
index 6058c4c9fa8..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/core-env.mkii
+++ /dev/null
@@ -1,543 +0,0 @@
-%D \module
-%D [ file=core-env, % was core-new
-%D version=1995.01.01, % wrong
-%D title=\CONTEXT\ Core Macros,
-%D subtitle=New ones,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Core Macros / Environments}
-
-\unprotect
-
-% Clean labels:
-
-\bgroup % some day this will go away / we could use detokenize as well
-
-% actually we should handle all discretionaries here
-
-\catcode`:=\@@active
-
-\gdef\cleanuplabel#1%
- {\begingroup
- \let:\lettercolon
- \xdef\cleanlabel{#1}%
- \endgroup}
-
-\gdef\cleanupprefixedlabel#1#2%
- {\begingroup
- \let:\lettercolon
- \xdef\cleanprefix{#1}%
- \xdef\cleanlabel {#2}%
- \endgroup}
-
-\gdef\protectlabels
- {\let:\lettercolon}
-
-\global\def\blabelgroup {\begingroup \let:\lettercolon}
-\global\let\elabelgroup \endgroup
-
-\gdef\labelcsname
- {\begingroup\let:\lettercolon
- \expandafter\endgroup\csname}
-
-\gdef\labelvalue#1%
- {\labelcsname#1\endcsname}
-
-\egroup
-
-%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\@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\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% mode can be relax
- {\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}
-
-% handy for mp
-
-\def\booleanmodevalue#1% can be \relax
- {\expandafter\ifx\csname\@mode@#1\endcsname\relax
- fals%
- \else\ifnum0\csname\@mode@#1\endcsname=0
- fals%
- \else
- tru%
- \fi\fi e}
-
-% 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
- {\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
- {\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\dodoifallmodeselse
- {\docheckforallmodes\firstoftwoarguments\secondoftwoarguments}
-
-\def\dodoifallmodes
- {\docheckforallmodes\firstofoneargument\gobbleoneargument}
-
-\def\dodoifnotallmodes
- {\docheckforallmodes\gobbleoneargument\firstofoneargument}
-
-\long\def\dostartallmodes[#1]%
- {\docheckforallmodes\donothing\dostopallmodes{#1}}
-
-\long\def\dostartnotallmodes[#1]%
- {\docheckforallmodes\dostopnotallmodes\donothing{#1}}
-
-\let\stopallmodes \donothing
-\let\stopnotallmodes\donothing
-
-\long\def\dostopallmodes #1\stopallmodes {}
-\long\def\dostopnotallmodes#1\stopnotallmodes{}
-
-% Setups
-
-\let\startsetups\relax % to please dep checker
-\let\stopsetups \relax % to please dep checker
-
-\expanded
- {\long\def\@EA\noexpand\csname\e!start\v!setups\endcsname
- {\begingroup\noexpand\doifnextoptionalelse
- {\noexpand\startsetupsA\@EA\noexpand\csname\e!stop\v!setups\endcsname}
- {\noexpand\startsetupsB\@EA\noexpand\csname\e!stop\v!setups\endcsname}}}
-
-\letvalue{\e!stop\v!setups}\relax
-
-\unexpanded \def\setups{\doifnextbgroupelse\dosetupsA\dosetupsB} % {..} or [..]
-\unexpanded \def\setup {\doifnextbgroupelse\dosetups \dosetupsC} % {..} or [..]
-
-\def\dosetupsA #1{\cleanuplabel{#1}\processcommacommand[\cleanlabel]\dosetups} % {..}
-\def\dosetupsB[#1]{\cleanuplabel{#1}\processcommacommand[\cleanlabel]\dosetups} % [..]
-\def\dosetupsC[#1]{\cleanuplabel{#1}\dosetups\cleanlabel} % [..]
-
-% \def\dosetups#1% the grid option will be extended to other main modes
-% {\executeifdefined{\??su\ifgridsnapping\v!grid\fi:#1}
-% {\executeifdefined{\??su :#1}\gobbleoneargument}\empty} % takes one argument
-%
-% \def\setupwithargument#1% the grid option will be extended to other main modes
-% {\executeifdefined{\??su:#1}\gobbleoneargument}
-
-% better:
-
-% \def\dosetups#1% the grid option will be extended to other main modes
-% {\executeifdefined{\??su\ifgridsnapping\v!grid\fi:#1}
-% {\executeifdefined{\??su :#1}\gobbleoneargument}\empty} % takes one argument
-%
-% \def\setupwithargument#1% the grid option will be extended to other main modes
-% {\executeifdefined{\??su:#1}\gobbleoneargument}
-
-% faster:
-
-\letvalue{\??su:\letterpercent}\gobbleoneargument
-
-\def\dosetups#1% the grid option will be extended to other main modes
- {\csname\??su
- \ifgridsnapping
- \ifcsname\??su\v!grid:#1\endcsname\v!grid:#1\else\ifcsname\??su:#1\endcsname:#1\else:\letterpercent\fi\fi
- \else
- \ifcsname\??su:#1\endcsname:#1\else:\letterpercent\fi
- \fi
- \endcsname\empty} % takes one argument
-
-\def\setupwithargument#1% the grid option will be extended to other main modes
- {\csname\??su:\ifcsname\??su:#1\endcsname#1\else\letterpercent\fi\endcsname}
-
-\let\directsetup\dosetups
-
-% somehow fails ...
-%
-% \letvalue{\??su:..}\gobbleoneargument
-%
-% \def\dosetups#1% the grid option will be extended to other main modes
-% {\csname \??su
-% \ifcsname\??su\ifgridsnapping\v!grid\fi:#1\endcsname\v!grid:#1\else
-% \ifcsname\??su :#1\endcsname :#1\else
-% :..\fi\fi
-% \endcsname\empty} % takes one argument
-%
-% \def\setupwithargument#1% the grid option will be extended to other main modes
-% {\csname\??su:\ifcsname\??su:#1\endcsname#1\else..\fi\endcsname}
-
-\let\directsetup\dosetups
-
-\def\doifsetupselse#1% to be done: grid
- {\doifdefinedelse{\??su:#1}}
-
-\chardef\setupseolmode\plusone
-
-\def\startsetups {\xxstartsetups\plusone \stopsetups } \let\stopsetups \relax
-\def\startlocalsetups{\xxstartsetups\plusone \stoplocalsetups} \let\stoplocalsetups\relax
-\def\startrawsetups {\xxstartsetups\zerocount\stoprawsetups } \let\stoprawsetups \relax
-\def\startxmlsetups {\xxstartsetups\plustwo \stopxmlsetups } \let\stopxmlsetups \relax
-
-\def\xxstartsetups#1#2%
- {\begingroup\chardef\setupseolmode#1\doifnextoptionalelse{\startsetupsA#2}{\startsetupsB#2}}
-
-\def\startsetupsA#1% [ ] delimited
- {\ifcase\setupseolmode\or\catcode`\^^M\@@ignore\or\catcode`\^^M\@@ignore\catcode`\|\@@other\fi
- \dotripleempty\dostartsetups[#1]}
-
-\def\startsetupsB#1#2 % space delimited
- {\ifcase\setupseolmode\or\catcode`\^^M\@@ignore\or\catcode`\^^M\@@ignore\catcode`\|\@@other\fi
- \dodostartsetups#1\empty{#2}}
-
-\def\startsetupsC[#1][#2][#3]{\dodostartsetups#1{#2}{#3}} % [..] [..]
-\def\startsetupsD[#1][#2][#3]{\dodostartsetups#1\empty{#2}} % [..]
-
-\def\dostartsetups
- {\ifthirdargument\@EA\startsetupsC\else\@EA\startsetupsD\fi}
-
-% \long\def\dodostartsetups#1#2#3% watch out: not \grabuntil
-% {\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{\endgroup\dodoglobal\long\setvalue\cleanlabel}} % \doglobal
-
-% \long\def\dodostartsetups#1#2#3%
-% {\cleanuplabel{\??su#2:#3}%
-% \long\def\dododostartsetups##1#1{\endgroup\dodoglobal\long\setvalue\cleanlabel####1{##1}}\dododostartsetups}
-
-\long\def\dodostartsetups#1#2#3%
- {\cleanuplabel{\??su#2:#3}%
- \long\def\dododostartsetups##1#1%
- {\endgroup
- \dodoglobal % bah
- \long\expandafter\setvalue\expandafter\cleanlabel\expandafter####\expandafter1\expandafter{##1}}%
- \dododostartsetups\empty} % the empty trick prevents the { } in {arg} from being eaten up
-
-\def\systemsetupsprefix{*}
-
-\def\systemsetups#1{\dosetups{\systemsetupsprefix#1}}
-
-\def\resetsetups[#1]% see x-fo for usage
- {\ifundefined{\??su\ifgridsnapping\v!grid\fi:#1}%
- \dodoglobal\letbeundefined{\??su:#1}%
- \else
- \dodoglobal\letbeundefined{\??su\ifgridsnapping\v!grid\fi:#1}%
- \fi}
-
-% or
-%
-% \def\resetsetups[#1]%
-% {\letbeundefined
-% {\??su:%
-% \ifundefined{\??su\ifgridsnapping\v!grid\fi:#1}#1\else\ifgridsnapping\v!grid\fi%
-% #1}}
-
-%D new and beta and will become a module instead
-
-\def\defineshortcut
- {\dotripleargument\dodefineshortcut}
-
-\def\dodefineshortcut[#1][#2][#3]%
- {\ifthirdargument
- \doifelsenothing{#1}
- {\dododefineshortcut[<>][#2][#3]}
- {\dododefineshortcut[#1][#2][#3]}%
- \else\ifsecondargument
- \dododefineshortcut[<>][#1][#2]%
- \else
- \dododefineshortcut[<>][][#1]%
- \fi\fi}
-
-\def\dododefineshortcut[#1#2][#3][#4]% #1 is the trigger, #2 the delimiter/tag
- {\doifundefined{\??te\??te\string#2}{\letvalue{\??te\??te\string#2}=#1}%
- \defineactivecharacter #1 {\@EA\doshortcut\string#2} %
- \getparameters
- [\??te\string#2#3]
- [\c!commands=,\c!command=,\c!style=,\c!color=,#4]}
-
-\def\doshortcut#1%
- {\ifmmode
- \getvalue{\??te\??te#1}%
- \else
- \bgroup
- \catcode`#1=\@@other
- \def\dodoshortcut##1#1%
- {\def\shorttag{\??te#1}%
- \def\shortcut{##1}%
- \dododoshortcut##1:\end}%
- \@EA\dodoshortcut
- \fi}
-
-\def\dododoshortcut#1:#2\end
- {\doifelsenothing{#2}
- {\doifundefinedelse{\shorttag\c!commands}
- {\shortcut}
- {\@EA\dodododoshortcut\@EA\shorttag\@EA:\shortcut:\end}}
- {\doifundefinedelse{\shorttag#1\c!commands}
- {\shortcut}
- {\dodododoshortcut\shorttag#1:#2\end}}%
- \egroup}
-
-\def\dodododoshortcut#1:#2:\end
- {\getvalue{#1\c!commands}%
- \doattributes{#1}\c!style\c!color{\getvalue{#1\c!command}{#2}}}
-
-%D \defineshortcut [style=type]
-%D \defineshortcut [b] [style=bold]
-%D \defineshortcut [e] [style=\em]
-%D \defineshortcut [t] [style=type]
-%D \defineshortcut [c] [style=cap]
-%D \defineshortcut [k] [style=cap]
-%D \defineshortcut [u] [style=type,command=\hyphenatedurl]
-%D
-%D \startlines
-%D test <ziezo> test
-%D test test <t:ziezo>
-%D test test <b:ziezo>
-%D test test <w:ziezo>
-%D zus<>zo zus<:>zo zus<::>zo
-%D test test <t:ziezo> dat (ziezo)
-%D test test <t::ziezo> dat (:ziezo)
-%D test test <t:ziezo:> dat (ziezo:)
-%D test test <t:zi:ezo:> dat (zi:ezo:)
-%D well, <u:http://www.pragma-ade.nl> looks fuzzy
-%D $10<20$
-%D \stoplines
-%D
-%D \defineshortcut [<>] [i] [style=\it]
-%D \defineshortcut [()] [b] [style=\bf]
-%D \defineshortcut [++] [s] [style=\sl]
-%D \defineshortcut [//] [u] [style=\underbars]
-%D \defineshortcut [--] [a] [style=\overstrike]
-%D
-%D \startlines
-%D it seems <i:to work> well
-%D it seems (b:to work) well
-%D it seems +s:to work+ well
-%D it seems /u:to work/ well
-%D it seems -a:to work- well
-%D \stoplines
-
-%D \macros
-%D {setvariables,getvariable,getvariabledefault}
-%D
-%D \starttyping
-%D \setvariables[xx][title=]
-%D \setvariables[xx][title=test test]
-%D \setvariables[xx][title=test $x=1$ test] % fatal error reported
-%D \setvariables[xx][title=test {$x=1$} test]
-%D \setvariables[xx][title] % fatal error reported
-%D \setvariables[xx][titletitel=e]
-%D \stoptyping
-
-\def\??vars{@@vars}
-
-\def\setvariables {\dotripleargument\dosetvariables[\getrawparameters ]}
-\def\setevariables{\dotripleargument\dosetvariables[\getraweparameters]}
-\def\setgvariables{\dotripleargument\dosetvariables[\getrawgparameters]}
-\def\setxvariables{\dotripleargument\dosetvariables[\getrawxparameters]}
-
-\def\globalsetvariables % obsolete
- {\dotripleargument\dosetvariables[\globalgetrawparameters]}
-
-\long\def\dosetvariables[#1][#2][#3]% tricky, test on s-pre-60
- {\errorisfataltrue
- \doifelse{#2}\currentvariableclass
- {#1[\??vars:#2:][#3]}%
- {\pushmacro\currentvariableclass
- \def\currentvariableclass{#2}%
- \getvariable{#2}\s!reset
- #1[\??vars:#2:][#3]%
- \getvariable{#2}\s!set
- \popmacro\currentvariableclass}%
- \errorisfatalfalse}
-
-\long\def\setvariable #1#2#3{\long\setvalue {\??vars:#1:#2}{#3}}
-\long\def\setevariable#1#2#3{\long\setevalue{\??vars:#1:#2}{#3}}
-\long\def\setgvariable#1#2#3{\long\setgvalue{\??vars:#1:#2}{#3}}
-\long\def\setxvariable#1#2#3{\long\setxvalue{\??vars:#1:#2}{#3}}
-
-\def\getvariable#1#2% to be sped up
- {\csname
- \ifcsname\??vars:#1:#2\endcsname\??vars:#1:#2\else\s!empty\fi
- \endcsname}
-
-\def\showvariable#1#2%
- {\showvalue{\ifcsname\??vars:#1:#2\endcsname\??vars:#1:#2\else\s!empty\fi}}
-
-\let\currentvariableclass\empty
-
-%D \macros
-%D {doifelsevariable,doifvariable,doifnotvariable}
-%D
-%D A few trivial macros:
-
-\def\doifelsevariable#1#2%
- {\ifcsname\??vars:#1:#2\endcsname
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\def\doifvariable#1#2%
- {\ifcsname\??vars:#1:#2\endcsname
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\def\doifnotvariable#1#2%
- {\ifcsname\??vars:#1:#2\endcsname
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-\def\getvariabledefault#1#2% #3% can be command, so no ifcsname here
- {\executeifdefined{\??vars:#1:#2}}% {#3}
-
-%D \macros
-%D {checkvariables}
-%D
-%D I'll probably forget that this on exists.
-
-\def\checkvariables
- {\dodoubleargument\docheckvariables}
-
-\def\docheckvariables
- {\dogetparameters\docheckrawvalue}
-
-\def\docheckrawvalue#1#2#3%
- {\doifundefined {\??vars:#1:#2}{\setvalue{\??vars:#1:#2}{#3}}
- {\doifvaluenothing{\??vars:#1:#2}{\setvalue{\??vars:#1:#2}{#3}}}}
-
-% \def\setupenv{\dodoubleargument\rawgetparameters[\??en]}
-%
-% \def\doifenvelse#1{\doifdefinedelse{\??en#1}} % speed up
-% \def\doifenv #1{\doifdefined {\??en#1}} % speed up
-% \def\doifnotenv #1{\doifundefined {\??en#1}} % speed up
-%
-% \def\env#1{\csname\??en#1\endcsname}
-%
-% \def\envvar#1#2%
-% {\ifcsname\??en#1\endcsname
-% \csname\??en#1\endcsname\else#2%
-% \fi}
-
-% low level change, now also accessible as \getvariable{environment}{...}; the
-% next macros will become obsolete some day in favor of normal variables
-
-\def\s!environment{environment}
-
-\def\setupenv {\dotripleargument\dosetvariables[\getrawparameters][\s!environment]}
-\def\doifenvelse{\doifelsevariable \s!environment}
-\def\doifenv {\doifvariable \s!environment}
-\def\doifnotenv {\doifnotvariable \s!environment}
-\def\env {\getvariable \s!environment}
-\def\envvar {\getvariabledefault\s!environment}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/core-fil.mkii b/Master/texmf-dist/tex/context/base/mkii/core-fil.mkii
deleted file mode 100644
index 16daf7bf60f..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/core-fil.mkii
+++ /dev/null
@@ -1,357 +0,0 @@
-%D \module
-%D [ file=core-fil,
-%D version=1997.11.15,
-%D title=\CONTEXT\ Core Macros,
-%D subtitle=File Support,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Core Macros / File Support}
-
-\unprotect
-
-%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
-%D One of the problems with loading files is that their names
-%D can depend on the interface language. We therefore need a
-%D method to define filesynonyms. The actual synonyms are
-%D defined elsewhere, but look like:
-%D
-%D \starttyping
-%D \definefilesynonym [chemic] [chemie]
-%D \definefilesynonym [einheit] [unit]
-%D \definefilesynonym [unit] [unit]
-%D \stoptyping
-%D
-%D So we can say in english:
-%D
-%D \starttyping
-%D \usemodules[pictex,chemic,unit]
-%D \stoptyping
-%D
-%D and in dutch:
-%D
-%D \starttyping
-%D \usemodules[pictex,chemie,unit]
-%D \stoptyping
-
-% will be redone in mkiv
-
-\def\definefilesynonym
- {\dodoubleempty\dodefinefilesynonym}
-
-\def\dodefinefilesynonym[#1][#2]%
- {\ifundefined{\??fs#1}\else
- \doifnotvalue{\??fs#1}{#2}{\showmessage\m!files1{#1 (#2),\getvalue{\??fs#1}}}%
- \fi
- \doifelse{#1}{#2}{\letbeundefined{\??fs#1}{#2}}{\setevalue{\??fs#1}{#2}}}
-
-%D \macros
-%D {definefilefallback}
-
-\def\definefilefallback
- {\dodoubleargument\dodefinefilefallback}
-
-\def\dodefinefilefallback[#1][#2]%
- {\doifnotfile{#1}
- {\def\docommand##1{\doiffile{##1}{\definefilesynonym[#1][##1]\quitcommalist}}%
- \processcommalist[#2]\docommand}}
-
-%D \macros
-%D {truefilename}
-%D
-%D At the system level such a filename can be called upon by
-%D saying:
-%D
-%D \starttyping
-%D \truefilename{filename/filesynonym}
-%D \stoptyping
-%D
-%D The implementation shows that nesting is supported.
-
-\def\truefilename#1%
- {\ifundefined{\??fs#1}#1\else\truefilename{\csname\??fs#1\endcsname}\fi}
-
-%D \macros
-%D {makeshortfilename}
-%D
-%D To prevent cross platform problems with filenames, we
-%D lowercase them as well as only use the first 8~characters.
-%D
-%D \starttyping
-%D \def\domakeshortfilename[#1#2#3#4#5#6#7#8#9]%
-%D {\lowercase{\edef\shortfilename{#1#2#3#4#5#6#7#8.}}%
-%D \expandafter\beforesplitstring\shortfilename\at.\to\shortfilename}
-%D
-%D \def\makeshortfilename[#1]%
-%D {\edef\fullfilename{#1.........}%
-%D \expanded{\domakeshortfilename[\fullfilename]}}
-%D \stoptyping
-%D
-%D In 2005 there is no need for the 8~character limit any more, so:
-
-\def\makeshortfilename[#1]% no need for further cleanup and shortening
- {\lowercase{\edef\shortfilename{#1.}}%
- \expandafter\beforesplitstring\shortfilename\at.\to\shortfilename}
-
-%D \macros
-%D {usemodule}
-%D
-%D Most of \CONTEXT is preloaded in the format file. Some very
-%D domain specific typesetting topics are however dealt with in
-%D separate modules, e.g. typesetting of chemical structure
-%D formulas. These modules are loaded by:
-%D
-%D \showsetup{usemodule}
-%D
-%D More information on the specific modules can be found in
-%D their dedicated manuals. We use \type {\next} so that we
-%D can \type {\end} in modules.
-%D
-%D In \MKIV\ we load the \type {mkiv} file when there is a \type
-%D {tex} file on the same path but in \MKII\ we start with the \type
-%D {tex} file as in many cases a \type {mkii} will be the same as an
-%D (old) \type {tex} one simply because we don't update drastically
-%D (or load a mark file indirectly).
-
-\newconditional\moduleisloaded
-
-\def\dododousemodules#1#2% no \unprotect/\protect when loading,
- {\relax % since we need to use ? ! unprotected
- \ifconditional\moduleisloaded % sometimes (see xtag-map)
- \let\next\relax % or: \expandafter\gobbleoneargument
- \else
- \makeshortfilename[#1\truefilename{#2}]% beware: *- is not part of syn
- \doifelseflagged\shortfilename
- {\showmessage\m!systems7{#2 (line \number\inputlineno)}%
- \settrue\moduleisloaded
- \let\next\relax}
- {\doglobal\setflag\shortfilename
- \def\next
- {\startreadingfile
- \readsysfile\shortfilename
- {\showmessage\m!systems5{#2}\settrue\moduleisloaded}
- {\readsysfile{\shortfilename.\mksuffix} % new
- {\showmessage\m!systems5{#2 (\mksuffix)}\settrue\moduleisloaded}
- \donothing}%
- \stopreadingfile}}%
- \fi
- \next}
-
-\def\dodousemodules#1#2%
- {\setfalse\moduleisloaded
- \doifelsenothing{#1}
- {\dododousemodules\f!moduleprefix {#2}%
- \dododousemodules\f!privateprefix{#2}%
- \dododousemodules\f!styleprefix {#2}%
- \dododousemodules\f!xstyleprefix {#2}%
- \dododousemodules\f!thirdprefix {#2}%
- \dododousemodules\empty {#2}}% new, fall back on raw name
- {\dododousemodules{#1-}{#2}}%
- \ifconditional\moduleisloaded\else
- \showmessage\m!systems6{#2}%
- \appendtoks\showmessage\m!systems6{#2}\to\everynotabene
- \fi}
-
-% \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}
- {\doifassignmentelse{#2}
- {\def\currentmoduleparameters{#2}%
- \def\next{\processcommalist[#1]{\dodousemodules{}}}}
- {\def\next{\processcommalist[#2]{\dodousemodules{#1}}}}}%
- \else
- \def\next{\processcommalist[#1]{\dodousemodules{}}}%
- \fi\fi
- \next
- \popmacro\currentmoduleparameters
- \popmacro\currentmodule}
-
-\let\currentmoduleparameters\empty
-\let\currentmodule \s!unknown
-
-\def\startmodule
- {\doifnextoptionalelse\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
- \let\currentmoduleparameters\empty}
-
-\def\moduleparameter #1#2{\executeifdefined{\??md:#1:#2}\s!empty}
-\def\currentmoduleparameter#1{\executeifdefined{\??md:\currentmodule:#1}\s!empty}
-
-% \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
-
-% 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.
-
-\let\usemodule=\usemodules
-
-% %D The definition shows that the language specific settings
-% %D are activated after loading all the modules specified.
-
-%D \macros
-%D {ifprotectbuffers, bufferprefix,
-%D TEXbufferfile, MPgraphicfile}
-%D
-%D The next switch enables protection of temporary filenames,
-%D which is needed when we process more files on one path at
-%D the same time.
-
-\newif\ifprotectbuffers
-
-\def\bufferprefix{\ifprotectbuffers\jobname-\fi}
-
-% The following filenames are defined here:
-
-\def\TEXbufferfile #1{\bufferprefix#1.\f!temporaryextension}
-\def\MPgraphicfile {\bufferprefix mp\ifMPrun run\else graph\fi} % not needed in luatex
-\def\convertMPcolorfile{\bufferprefix metacmyk.tmp}
-
-%D To save memory, we implement some seldomly used commands
-%D in a lazy way. Nota bene: such runtime definitions are
-%D global.
-%D
-%D \starttyping
-%D \fetchruntimecommand\showaccents{\f!encodingprefix ...}
-%D \stoptyping
-
-\def\fetchruntimecommand#1#2%
- {\def#1{\dofetchruntimecommand#1{#2}}}
-
-\def\dofetchruntimecommand#1#2%
- {\doifnotflagged{#2}
- {\let#1\undefined
- \startreadingfile
- \startnointerference % \bgroup
- \cleanupfeatures % better \setnormalcatcodes / test first
- \readfile{#2.\mksuffix}\donothing\donothing
- \stopnointerference % \egroup
- \stopreadingfile
- \doglobal\setflag{#2}}%
- \ifx#1\undefined
- \writestatus\m!systems{command \string#1 not found in file #2}%
- \def#1{{\infofont[unknown command \string#1]}}%
- \fi
- #1}
-
-%D Experimental:
-
-\let\checkpreprocessor\relax
-
-%D To be documented and probably moved
-
-\def\documentresources{\@@erurl}
-
-\def\setupexternalresources
- {\dodoubleargument\getparameters[\??er]}
-
-\setupexternalresources
- [url=]
-
-%D Goodie:
-
-\unexpanded\def\continueifinputfile#1{\doifnotfile{#1}{\endinput}}
-
-%D This module will be perfected / changed / weeded.
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/core-fnt.mkii b/Master/texmf-dist/tex/context/base/mkii/core-fnt.mkii
deleted file mode 100644
index 542ca062a68..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/core-fnt.mkii
+++ /dev/null
@@ -1,726 +0,0 @@
-%D \module
-%D [ file=core-fnt,
-%D version=1995.10.10,
-%D title=\CONTEXT\ Core Macros,
-%D subtitle=Fonts,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Core Macros / Fonts}
-
-\unprotect
-
-%D \macros
-%D {compound}
-%D
-%D We will overload the already active \type {|} so we have
-%D to save its meaning in order to be able to use this handy
-%D macro.
-%D
-%D \starttyping
-%D so test\compound{}test can be used instead of test||test
-%D \stoptyping
-
-\bgroup \catcode`\|=\@@active \gdef\compound#1{|#1|} \egroup
-
-%D Here we hook some code into the clean up mechanism needed
-%D for verbatim data.
-
-\appendtoks
- \disablecompoundcharacters
- \disablediscretionaries
-\to \everycleanupfeatures
-
-%D \macros
-%D {kap,KAP,Kap,Kaps,nokap,userealcaps,usepseudocaps}
-%D
-%D We already introduced \type{\cap} as way to capitalize
-%D words. This command comes in several versions:
-%D
-%D \startbuffer
-%D \cap {let's put on a \cap{cap}}
-%D \cap {let's put on a \nocap{cap}}
-%D \CAP {let's put on a \\{cap}}
-%D \Cap {let's put on a \\{cap}}
-%D \Caps{let's put on a cap}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D Note the use of \type{\nocap}, \type{\\} and the nested
-%D \type{\cap}.
-%D
-%D \startvoorbeeld
-%D \startlines
-%D \getbuffer
-%D \stoplines
-%D \stopvoorbeeld
-%D
-%D These macros show te main reason why we introduced the
-%D smaller \type{\tx} and \type{\txx}.
-%D
-%D \starttyping
-%D \cap\romannumerals{1995}
-%D \stoptyping
-%D
-%D This at first sight unusual capitilization is completely
-%D legal.
-%D
-%D \showsetup{smallcapped}
-%D \showsetup{notsmallcapped}
-%D \showsetup{CAPPED}
-%D \showsetup{SmallCapped}
-%D \showsetup{SmallCaps}
-%D
-%D The difference between pseudo and real caps is demonstrated
-%D below:
-%D
-%D \startbuffer
-%D \usepseudocaps \cap{Hans Hagen}
-%D \userealcaps \cap{Hans Hagen}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \getbuffer
-%D
-%D The \type {\bgroup} trickery below is needed because of
-%D \type {\groupedcommand}.
-
-\def\usepseudocaps
- {\def\cap@@uppercase{\the\everyuppercase\uppercased}%
- \def\cap@@lowercase{\the\everylowercase\lowercased}%
- \def\cap@@visualize{\tx}}
-
-\def\userealcaps
- {\let\cap@@uppercase\relax
- %\let\cap@@lowercase\relax % Definitely not!
- \def\cap@@visualize{\sc}}
-
-\usepseudocaps
-
-\unexpanded\def\smallcapped % else conflict with math
- {\futurelet\next\dosmallcapped}
-
-\def\disablepseudocaps
- {\let\smallcapped\donothing}
-
-\def\dosmallcapped
- {\ifx\next\bgroup
- \expandafter\dodosmallcapped\expandafter\relax
- \else
- \expandafter\dodosmallcapped
- \fi}
-
-\def\dodosmallcapped#1#2%
- {\ifmmode\hbox\fi
- \bgroup
- \cap@@visualize
- \cap@@uppercase{#1{#2}}%
- \egroup}
-
-\unexpanded\def\notsmallcapped#1%
- {\cap@@lowercase{#1}}
-
-\unexpanded\def\CAPPED#1%
- {{\def\\##1{\smallcapped{##1}}#1}}
-
-\unexpanded\def\SmallCapped#1%
- {\CAPPED{\\#1}}
-
-\unexpanded\def\SmallCaps
- {\let\processword\SmallCapped
- \processwords}
-
-%D Sure:
-
-\def\kap{\smallcapped} % for old times sake
-
-%D Some precautions for a \PLAIN\ \TEX\ definition.
-
-\unexpanded\def\normalcap{\dohandlemathtoken{cap}}
-\unexpanded\def\normalCap{\dohandlemathtoken{Cap}}
-
-\def\cap{\mathortext\normalcap\smallcapped}
-\def\Cap{\mathortext\normalCap\SmallCapped}
-
-\appendtoks
- \let\cap\firstofoneargument
- \let\Cap\firstofoneargument
-\to \simplifiedcommands
-
-%D \macros
-%D {setupcapitals}
-%D
-%D By default we use pseudo small caps in titles. This can be
-%D set up with:
-%D
-%D \showsetup{setupcapitals}
-
-\let\normalsmallcapped\smallcapped
-
-\def\setupcapitals
- {\dosingleempty\dosetupcapitals}
-
-\def\dosetupcapitals[#1]%
- {\getparameters[\??kk][#1]%
- \doifelse\@@kktitle\v!yes
- {\definealternativestyle[\v!capital][\normalsmallcapped][\normalsmallcapped]%
- \definealternativestyle[\v!smallcaps][\sc][\sc]%
- \unexpanded\def\smallcapped{\normalsmallcapped}}
- {\definealternativestyle[\v!capital][\normalsmallcapped][\uppercased]%
- \definealternativestyle[\v!smallcaps][\sc][\uppercased]%
- \unexpanded\def\smallcapped{\doconvertfont\v!capital}}%
- \doifelse\@@kksc\v!yes
- \userealcaps
- \usepseudocaps}
-
-\ifx\uppercased\undefined \let\uppercased\uppercase \fi
-\ifx\lowercased\undefined \let\lowercased\lowercase \fi
-
-% pretty tricky stuff:
-%
-% \usemodule[abr-01] \TEX \METAPOST \PPCHTEX \LATEX
-% \usemodule[abr-02] \TEX \METAPOST \PPCHTEX \LATEX
-
-%def\uppercased#1{{\forceunexpanded\xdef\@@globalcrap{\uppercase{#1}}}\@@globalcrap}
-%def\lowercased#1{{\forceunexpanded\xdef\@@globalcrap{\lowercase{#1}}}\@@globalcrap}
-
-\def\uppercased#1{{\forceunexpanded\xdef\@@expanded{\uppercase{#1}}}\@@expanded}
-\def\lowercased#1{{\forceunexpanded\xdef\@@expanded{\lowercase{#1}}}\@@expanded}
-
-\setupcapitals
- [\c!title=\v!yes,
- \c!sc=\v!no]
-
-%D \macros
-%D {Word, Words, WORD, WORDS, doprocesswords}
-%D
-%D This is probably not the right place to present the next set
-%D of macros.
-%D
-%D \starttyping
-%D \Word {far too many words}
-%D \Words{far too many words}
-%D \WORD {far too many words}
-%D \WORDS{far too many words}
-%D \stoptyping
-%D
-%D \typebuffer
-%D
-%D This calls result in:
-%D
-%D \startvoorbeeld
-%D \startlines
-%D \getbuffer
-%D \stoplines
-%D \stopvoorbeeld
-%D
-%D \showsetup{Word}
-%D \showsetup{Words}
-%D \showsetup{WORD}
-%D \showsetup{WORDS}
-
-\def\doWord#1%
- {\bgroup
- \the\everyuppercase
- \uppercase{#1}%
- \egroup}
-
-\unexpanded\def\Word#1%
- {\doWord#1}
-
-\def\doprocesswords#1 #2\od
- {\ConvertToConstant\doifnot{#1}{}
- {\processword{#1} %
- \doprocesswords#2 \od}}
-
-\def\processwords#1%
- {\doprocesswords#1 \od\unskip}
-
-\let\processword\relax
-
-\unexpanded\def\Words
- {\let\processword\Word
- \processwords}
-
-\unexpanded\def\WORD#1%
- {\bgroup
- \let\smallcapped\firstofoneargument
- \let\WORD\firstofoneargument
- \douppercase{#1}%
- \egroup}
-
-\unexpanded\def\WORDS#1%
- {\WORD{#1}}
-
-%D \macros
-%D {stretched}
-%D
-%D Stretching characters in a word is a sort of typographical
-%D murder. Nevertheless we support this manipulation for use in
-%D for instance titles.
-%D
-%D \starttyping
-%D \hbox to 5cm{\stretched{murder}}
-%D \stoptyping
-%D
-%D \typebuffer
-%D
-%D or
-%D
-%D \startvoorbeeld
-%D \getbuffer
-%D \stopvoorbeeld
-%D
-%D \showsetup{stretched}
-
-\def\stretched#1%
- {\ifvmode\hbox to \hsize\else\ifinner\else\hbox\fi\fi
- \bgroup\processtokens\relax\hss\relax{\hss\hss}{#1}\egroup}
-
-%D \startbuffer
-%D \stretched{Unknown Box}
-%D \hbox to .5\hsize{\stretched{A Horizontal Box}}
-%D \vbox to 2cm{\stretched{A Vertical Box}}
-%D \hbox to 3cm{\stretched{sp{\'e}c{\`\i}{\"a}l}}
-%D \stopbuffer
-%D
-%D \getbuffer
-%D
-%D The first line of this macros takes care of boxing. Normally
-%D one will use an \type{\hbox} specification. The last line
-%D shows how special characters should be passed.
-%D
-%D \typebuffer
-
-%D \macros
-%D {stretchednormalcase, stretcheduppercase, stretchedlowercase}
-%D
-%D A convenient alternative is:
-%D
-%D \starttyping
-%D \stretcheduppercase{Is this what you like?}
-%D \stoptyping
-%D
-%D \typebuffer
-%D
-%D this one uses fixed skips and kerns.
-%D
-%D \startvoorbeeld
-%D \getbuffer
-%D \stopvoorbeeld
-%D
-%D The default skip can be set with:
-
-% \def\stretchedspacefactor{4}
-% \def\stretchedspaceamount{.25em}
-%
-% \unexpanded\def\stretcheduppercase#1%
-% {\bgroup
-% \the\everyuppercase
-% \uppercase{\def\textstring{#1}}%
-% \ifdim\stretchedspaceamount>\zeropoint
-% \def\textkern%
-% {\kern\stretchedspaceamount}%
-% \def\textskip%
-% {\scratchdimen=\stretchedspaceamount
-% \hskip\stretchedspacefactor\scratchdimen}%
-% \@EA\processtokens\@EA\relax\@EA\textkern\@EA\relax\@EA
-% \textskip\@EA{\textstring}%
-% \else
-% \textstring
-% \fi
-% \egroup}
-
-%D Given the following settings, the space is 1em by default:
-
-\def\stretchedspacefactor{4}
-\def\stretchedspaceamount{.25em}
-\def\stretchedbreaktokens{.@/}
-
-\unexpanded\def\stretchednormalcase
- {\stretchedsomecase\firstofoneargument}
-
-\unexpanded\def\stretcheduppercase
- {\stretchedsomecase{\the\everyuppercase\uppercase}}
-
-\unexpanded\def\stretchedlowercase
- {\stretchedsomecase{\the\everylowercase\lowercase}}
-
-\def\stretchedsomecase#1#2%
- {\bgroup
- #1{\def\textstring{#2}}%
- \ifdim\stretchedspaceamount=\zeropoint
- \textstring
- \else
- \def\textkern##1%
- {% beware: ##1 may not be \box\somebox -)
- \determinemidwordbreak{##1}{\stretchedbreaktokens}%
- \kern\stretchedspaceamount##1\domidwordbreak}%
- \def\textskip
- {\scratchdimen\stretchedspaceamount
- \hskip\stretchedspacefactor\scratchdimen}%
- \@EA\processtokens\@EA\relax\@EA\textkern\@EA\relax\@EA
- \textskip\@EA{\textstring}%
- \fi
- \egroup}
-
-%D An auxiliary macro, see for usage \type {\stretcheduppercase}.
-
-\let\domidwordbreak\relax
-
-\def\setmidwordbreaktoken#1%
- {\sfcode`#1=5000\relax}
-
-\def\determinemidwordbreak#1#2%
- {\edef\midwordbreaktokens{#2}%
- \ifx\midwordbreaktokens\empty
- \global\let\domidwordbreak\relax
- \else
- \setbox\scratchbox\hbox
- {\expandafter\handletokens\midwordbreaktokens\with\setmidwordbreaktoken
- a\space \!!dimena\lastskip
- #1\space\!!dimenb\lastskip \relax % needed
- \ifdim\!!dimena=\!!dimenb
- \globallet\domidwordbreak\relax
- \else
- \globallet\domidwordbreak\allowbreak
- \fi}%
- \fi}
-
-%D \macros
-%D {underbar,underbars,
-%D overbar,overbars,
-%D overstrike,overstrikes,
-%D setupunderbar}
-%D
-%D In the rare case that we need undelined words, for instance
-%D because all font alternatives are already in use, one can
-%D use \type{\underbar} and \type{\overstrike} and their plural
-%D forms.
-%D
-%D \startbuffer
-%D \underbars{drawing \underbar{bars} under words is a typewriter leftover}
-%D \overstrikes{striking words makes them \overstrike{unreadable} but
-%D sometimes even \overbar{top lines} come into view.}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \startvoorbeeld
-%D \startlines
-%D \getbuffer
-%D \stoplines
-%D \stopvoorbeeld
-%D
-%D The next macros are derived from the \PLAIN\ \TEX\ one, but
-%D also supports nesting. The \type{$} keeps us in horizontal
-%D mode and at the same time applies grouping.
-%D
-%D \showsetup{underbar}
-%D \showsetup{underbars}
-%D \showsetup{overbar}
-%D \showsetup{overbars}
-%D \showsetup{overstrike}
-%D \showsetup{overstrikes}
-%D
-%D Although underlining is ill advised, we permit some
-%D alternatives, that can be set up by:
-%D
-%D \showsetup{setupunderbar}
-%D
-%D The alternatives show up as
-%D {\setupunderbar [alternative=a]\underbar{alternative a}},
-%D {\setupunderbar [alternative=b]\underbar{alternative b}},
-%D {\setupunderbar [alternative=c]\underbar{alternative c}}
-%D and
-%D {\setupunderbar [rulethickness=1pt]\underbar{1pt width}},
-%D {\setupunderbar [rulethickness=2pt]\underbar{2pt width}},
-%D or whatever. Because \type{\overstrike} uses the same
-%D method, the settings also apply to that macro.
-
-\newcount\underbarlevel
-
-\def\underbarmethoda#1#2#3% RULE
- {\hbox to #1{\vrule\!!width#1\!!height#2\!!depth#3}}
-
-\def\underbarmethodb#1#2#3% DASH
- {\hbox to #1
- {\hskip-.25em
- \xleaders
- \hbox{\hskip.25em\vrule\!!width.25em\!!height#2\!!depth#3}
- \hfil}}
-
-\def\underbarmethodc#1#2#3% PERIOD
- {\hbox to #1
- {\dimen4=#3
- \advance\dimen4 .2ex
- \hskip-.25em
- \xleaders
- \hbox{\hskip.25em\lower\dimen4\hbox{.}}
- \hfil}}
-
-\def\dododounderbar#1#2#3%
- {\startmathmode
- \setbox0\hbox{#3}%
- \setbox2\hbox{\color[\@@onrulecolor]{\getvalue{underbarmethod\@@onalternative}{\wd0}{#1}{#2}}}%
- \wd0\zeropoint
- \ht2\ht0
- \dp2\dp0
- \box0\box2
- \stopmathmode}
-
-\unexpanded\def\dodounderbar#1%
- {\bgroup
- \dimen0=\@@onbottomoffset
- \dimen0=\underbarlevel\dimen0
- \ifdone \else
- \advance\dimen0 -\strutht
- \fi
- \dimen2\dimen0
- \advance\dimen2 \@@onrulethickness
- \dododounderbar{-\dimen0}{\dimen2}{#1}%
- \egroup}
-
-\def\betweenunderbarwords
- {\bgroup
- \setbox0\hbox{\dodounderbar{\hskip\interwordspace}}%
- \nobreak
- \hskip\zeropoint\!!minus\interwordshrink
- \discretionary{}{}{\box0}%
- \egroup}
-
-\def\betweenunderbarspaces
- {\hskip\currentspaceskip}
-
-% \unexpanded\def\dounderbar#1#2%
-% {\let\betweenisolatedwords#1%
-% \processisolatedwords{#2}\dodounderbar
-% \egroup}
-
-\unexpanded\def\underbar
- {\bgroup
- \advance\underbarlevel\plusone
- \donetrue
- \dounderbar\betweenunderbarwords}
-
-\unexpanded\def\dounderbar#1%
- {\let\betweenisolatedwords#1%
- \dosingleempty\redounderbar}
-
-\unexpanded\def\redounderbar[#1]#2%
- {\iffirstargument\setupunderbar[#1]\fi
- \processisolatedwords{#2}\dodounderbar
- \egroup}
-
-\unexpanded\def\underbars
- {\bgroup
- \advance\underbarlevel\plusone
- \donetrue
- \dounderbar\betweenunderbarspaces}
-
-\unexpanded\def\overbar
- {\bgroup
- \advance\underbarlevel\minusone
- \donefalse
- \dounderbar\betweenunderbarwords}
-
-\unexpanded\def\overbars
- {\bgroup
- \advance\underbarlevel\minusone
- \donefalse
- \dounderbar\betweenunderbarspaces}
-
-\def\dooverstrike#1%
- {\bgroup
- \dimen0=\@@ontopoffset
- \dimen2=\dimen0
- \advance\dimen2 \@@onrulethickness
- \dododounderbar{\dimen2}{-\dimen0}{#1}%
- \egroup}
-
-\def\betweenoverstrikewords
- {\bgroup
- \setbox0\hbox{\dooverstrike{\hskip\interwordspace}}%
- \nobreak
- \hskip\zeropoint\!!minus\interwordshrink
- \discretionary{}{}{\box0}%
- \egroup}
-
-\unexpanded\def\overstrike#1%
- {\bgroup
- \let\betweenisolatedwords\betweenoverstrikewords
- \processisolatedwords{#1}\dooverstrike
- \egroup}
-
-\unexpanded\def\overstrikes#1%
- {\bgroup
- \processisolatedwords{#1}\dooverstrike
- \egroup}
-
-\def\underbarparameter#1{\csname\??on#1\csname}
-
-\def\setupunderbar
- {\dodoubleargument\getparameters[\??on]}
-
-%D \macros
-%D {shiftedword, shiftedwords}
-%D
-%D Used as \type {\shiftedwords {10pt} {some text}} this macro will
-%D move
-
-% \def\shiftedword#1% #2%
-% {\raise#1\hbox} % {#2}} % officially: {\ifdim#1>\zeropoint\raise\else\lower\fi#1\hbox{#2}}
-
-% \def\shiftedwords#1#2%
-% {\processisolatedwords{#2}{\shiftedword{#1}}}
-
-%D \macros
-%D {low, high, lohi}
-%D
-%D Although \TEX\ is pretty well aware of super- and
-%D subscripts, its mechanism is mainly tuned for math mode.
-%D The next few commands take care of script texts both modes.
-%D
-%D \startbuffer
-%D The higher\high{one goes} the lower\low{one drops}, or\lohi{yes}{no}?
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \getbuffer
-%D
-%D Note the different placement of \type {\lohi}, where we
-%D need a bit more space. The implementation looks a bit
-%D fuzzy, since some \type {\fontdimen}'s are involved to
-%D determine the optimal placement.
-
-\def\dodohighlow
- {\ifx\fontsize\empty
- \ifmmode
- \ifnum\fam<0 \tx \else \holamathfont \fi
- \else
- \tx
- \fi
- \else
- \tx
- \fi}
-
-\def\dohighlow#1#2#3#4#5% todo, named fontdimens
- {\dontleavehmode
- \bgroup
- \scratchdimen\ifdim\fontexheight\textfont2=1ex #2\textfont2\else #3ex\fi
- \advance\scratchdimen #4ex
- \kern.1ex
- \setbox\scratchbox\hbox{#1\scratchdimen\hbox{\dodohighlow#5}}%
- \ht\scratchbox\strutheight
- \dp\scratchbox\strutdepth
- \box\scratchbox
- \egroup}
-
-\unexpanded\def\high{\dohighlow\raise\mathsupnormal{.86}{0}}
-\unexpanded\def\low {\dohighlow\lower\mathsubnormal{.48}{0}}
-
-% \unexpanded\def\lohi#1#2%
-% {\dontleavehmode
-% \hbox
-% {\setbox4=\hbox{\dohighlow\lower\mathsubnormal{.48}{.1}{#1}}%
-% \setbox6=\hbox{\dohighlow\raise\mathsupnormal{.86}{.1}{#2}}%
-% \ifdim\wd4<\wd6
-% \wd4=\zeropoint\box4\box6
-% \else
-% \wd6=\zeropoint\box6\box4
-% \fi}}
-
-\unexpanded\def\lohi
- {\dosingleempty\dolohi}
-
-\def\dolohi[#1]#2#3%
- {\dontleavehmode
- \hbox
- {\setbox4\hbox{\dohighlow\lower\mathsubnormal{.48}{.1}{#2}}%
- \setbox6\hbox{\dohighlow\raise\mathsupnormal{.86}{.1}{#3}}%
- \doif{#1}{\v!left}
- {\ifdim\wd4<\wd6
- \setbox4\hbox to \wd6{\hss\box4}%
- \else
- \setbox6\hbox to \wd4{\hss\box6}%
- \fi}%
- \ifdim\wd4<\wd6
- \wd4=\zeropoint\box4\box6
- \else
- \wd6=\zeropoint\box6\box4
- \fi}}
-
-%D You can provide an optional keyword \type {left}, in which
-%D case the super and subscripts will be aligned in a way that
-%D permits placement at the left of a word (which means that
-%D it will be right aligned).
-%D
-%D \startbuffer
-%D \lohi{aha}{ah} test \lohi{aha}{ah} test
-%D \lohi[left]{aha}{ah} test \lohi[left]{aha}{ah} test
-%D \lohi{aha}{ah} test\lohi{aha}{ah} test
-%D \lohi[left]{aha}{ah}test \lohi[left]{aha}{ah}test
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \getbuffer
-
-%D \macros
-%D {setupinitial,placeinitial,checkinitial}
-%D
-%D {\em To be documented.}
-%D
-%D \starttyping
-%D \setupinitial[state=start] \placeinitial \input tufte
-%D \stoptyping
-%D
-%D and
-%D
-%D \starttyping
-%D \def\bpar{\ifvmode\checkinitial\fi}
-%D \def\epar{\ifhmode\par\fi\checkinitial}
-%D \stoptyping
-
-% to do: more fine tuning
-
-\def\setupinitial
- {\dodoubleempty\getparameters[\??dc]}
-
-\definefontsynonym[Initial][Regular] % prefered initial identifier
-\definefontsynonym[initial][Initial] % internal but accepted too
-
-\setupinitial
- [\c!state=\v!stop,
- \c!location=\v!text,
- \c!n=3,
- \c!distance=.125em,
- \c!command=,
- \s!font=initial]
-
-\def\AutoDroppedCapsCommand{\NiceDroppedCaps\@@dccommand\@@dcfont\@@dcdistance\@@dcn}%
-
-\def\placeinitial
- {\doifelse\@@dclocation\v!margin{\chardef\DropMode\plusone}{\chardef\DropMode\zerocount}%
- \doif \@@dcstate\v!start{\ifcase\@@dcn\else\AutoDroppedCaps\fi}}
-
-\let\checkinitial\CheckDroppedCaps
-
-%D This module has only a few setups:
-
-\setupunderbar
- [\c!alternative=a,
- \c!rulethickness=\linewidth,
- \c!bottomoffset=1.5pt,
- \c!topoffset=2.5pt,
- \c!rulecolor=]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/core-gen.mkii b/Master/texmf-dist/tex/context/base/mkii/core-gen.mkii
deleted file mode 100644
index 0d7fcebe00c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/core-gen.mkii
+++ /dev/null
@@ -1,166 +0,0 @@
-%D \module
-%D [ file=core-gen,
-%D version=1995.10.10,
-%D title=\CONTEXT\ Core Macros,
-%D subtitle=General,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Core Macros / General}
-
-\unprotect
-
-%D \macros
-%D {assigndimension,assignalfadimension}
-%D
-%D Hieronder worden enkele commando's gedefinieerd rond
-%D toekenningen. Allereerst een commando om waarden aan
-%D een \DIMENSION\ toe te kennen:
-%D
-%D \starttyping
-%D \assigndimension
-%D {<waarde>|klein|middel|groot|-klein|-middel|-groot|geen}
-%D {\dimension}
-%D {waarde klein}
-%D {waarde middel}
-%D {waarde groot}
-%D \stoptyping
-%D
-%D Hierbij krijgt de \DIMENSION\ \type{\dimension} een waarde
-%D afhankelijk van het meegegeven trefwoord.
-%D
-%D \startnarrower
-%D \startlines
-%D \type{(-)klein }\qquad (--) waarde klein
-%D \type{(-)middel}\qquad (--) waarde middel
-%D \type{(-)groot }\qquad (--) waarde groot
-%D \type{geen }\qquad 0pt
-%D \type{waarde }\qquad waarde
-%D \stoplines
-%D \stopnarrower
-%D
-%D Een trefwoord mag worden voorafgegaan door een \type{-}.
-%D Deze macro toont een voorbeeld van het gebruik van
-%D \type{\processaction} en constanten.
-%D
-%D Analoog aan het bovenstaande commando kennen we een
-%D commando om waarden toe te kennen aan een macro:
-%D
-%D \starttyping
-%D \assignalfadimension
-%D {<waarde>|klein|middel|groot|geen}
-%D {\macro}
-%D {waarde klein}
-%D {waarde middel}
-%D {waarde groot}
-%D \stoptyping
-
-% The third (optimized) version:
-
-\def\@ad@{@ad@}
-
-\setvalue{\@ad@ \v!none }{\zeropoint\gobblethreearguments}
-\setvalue{\@ad@ \v!big }{\thirdofthreearguments}
-\setvalue{\@ad@ \v!medium}{\secondofthreearguments}
-\setvalue{\@ad@ \v!small }{\firstofthreearguments}
-\setvalue{\@ad@-\v!big }{-\thirdofthreearguments}
-\setvalue{\@ad@-\v!medium}{-\secondofthreearguments}
-\setvalue{\@ad@-\v!small }{-\firstofthreearguments}
-
-\def\assigndimension#1#2% #3 #4 #5
- {#2=\ifcsname\@ad@#1\endcsname
- \csname\@ad@#1\expandafter\endcsname
- \else
- #1\expandafter\gobblethreearguments
- \fi}
-
-\def\@aa@{@aa@}
-
-\setvalue{\@aa@\v!none }{0\gobblethreearguments}
-\setvalue{\@aa@\v!big }{\thirdofthreearguments}
-\setvalue{\@aa@\v!medium}{\secondofthreearguments}
-\setvalue{\@aa@\v!small }{\firstofthreearguments}
-
-\def\assignalfadimension#1#2#3#4#5% #3#4#5 are single digits
- {\edef#2{\ifcsname\@aa@#1\endcsname
- \csname\@aa@#1\expandafter\endcsname
- \else
- #1\expandafter\gobblethreearguments
- \fi#3#4#5}}
-
-%D \macros
-%D {assignvalue}
-%D
-%D Een variant hierop is het commando:
-%D
-%D \starttyping
-%D \assignvalue
-%D {<waarde>|klein|middel|groot}
-%D {\macro}
-%D {waarde klein }
-%D {waarde middel}
-%D {waarde groot}
-%D \stoptyping
-%D
-%D Hierbij krijgt \type{\macro} een waarde afhankelijk van
-%D het meegegeven trefwoord:
-%D
-%D \startnarrower
-%D \startlines
-%D \type{klein }\qquad waarde klein
-%D \type{middel}\qquad waarde middel
-%D \type{groot }\qquad waarde groot
-%D \type{waarde}\qquad waarde
-%D \stoplines
-%D \stopnarrower
-%D
-%D Hier doet \type{geen} dus niet mee.
-
-\def\@av@{@av@}
-
-\letvalue{\@av@\v!big }\thirdofthreearguments
-\letvalue{\@av@\v!medium}\secondofthreearguments
-\letvalue{\@av@\v!small }\firstofthreearguments
-
-\def\assignvalue#1#2#3#4#5%
- {\edef#2{\ifcsname\@av@#1\endcsname
- \csname\@av@#1\expandafter\endcsname
- \else
- #1\expandafter\gobblethreearguments
- \fi{#3}{#4}{#5}}}
-
-%D \macros
-%D {assignwidth}
-%D
-%D Een breedte van een opgegeven tekst kan worden berekend en
-%D toegekend aan een \DIMENSION\ met:
-%D
-%D \starttyping
-%D \assignwidth
-%D {\dimension}
-%D {<waarde>|passend|ruim}
-%D {tekst}
-%D \stoptyping
-%D
-%D Dit commando sluit, evenals de bovenstaande
-%D \type{\assign}||commando's, aan op de wijze waarop
-%D in de andere \CONTEXT||modules toekenningen
-%D plaatsvinden. Bij \type{ruim} wordt de gemeten breedte
-%D met 1~em vermeerderd.
-
-\def\assignwidth#1#2#3#4%
- {\doifelsenothing{#2}
- {\setbox\scratchbox\hbox{#3}%
- #1\wd\scratchbox}
- {\doifinsetelse{#2}{\v!fit,\v!broad}
- {\setbox\scratchbox\hbox{#3}%
- #1\wd\scratchbox
- \doif{#2}\v!broad{\advance#1 #4}}%
- {#1=#2}}}%
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/core-ini.mkii b/Master/texmf-dist/tex/context/base/mkii/core-ini.mkii
deleted file mode 100644
index 04535bec6f6..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/core-ini.mkii
+++ /dev/null
@@ -1,67 +0,0 @@
-%D \module
-%D [ file=core-ini,
-%D version=2003.12.01,
-%D title=\CONTEXT\ Core Macros,
-%D subtitle=Additional Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Core Macros / Additional Initialization}
-
-%D We will move more code to here, so that we become less dependent of the
-%D orde in which modules are loaded.
-
-\unprotect
-
-\everypar \emptytoks
-\neverypar \emptytoks
-
-\appendtoks \flushnotes \to \everypar
-\appendtoks \synchronizesidefloats \to \everypar
-
-\appendtoks \checkinlinedirection \to \everypar
-
-\appendtoks \checkindentation \to \everypar
-\appendtoks \showparagraphnumber \to \everypar
-\appendtoks \flushmargincontents \to \everypar
-\appendtoks \flushcommentanchors \to \everypar
-\appendtoks \synchronizenotes \to \everypar
-\appendtoks \OTRSETshowstatus \to \everypar
-\appendtoks \flushpostponedbookmark \to \everypar
-\appendtoks \registerparoptions \to \everypar
-\appendtoks \flushsyncpositions \to \everypar
-\appendtoks \flushpostponednodedata \to \everypar
-\appendtoks \dohandlerepeatdelimitedtext \to \everypar
-\appendtoks \insertparagraphintro \to \everypar
-
-\appendtoks \flushpostponedbookmark \to \neverypar
-\appendtoks \flushpostponedbookmark \to \everylistentry
-
-\appendtoks \flushnotes \to \everydisplay
-\appendtoks \adjustsidefloatdisplaylines \to \everydisplay
-
-\appendtoks \flushsyncpositions \to \everyheadstart
-
-\appendtoks \flushsyncresets \to \everyendoftextbody
-
-\appendtoks \ignorespaces \to \everybeginofpar
-
-\appendtoks \removeunwantedspaces \to \everyendofpar
-%appendtoks \strut \to \everyendofpar % option ?
-\appendtoks \flushsyncresets \to \everyendofpar
-\appendtoks \setlastlinewidth \to \everyendofpar % must happen before endgraf
-\appendtoks \endgraf \to \everyendofpar
-
-% Todo: verbatim, xml, tex, move code to here
-
-\ifx\normalcompound\undefined \let\normalcompound=| \fi
-
-\appendtoks \catcode`|=\@@active \let|\normalcompound \to \everyTEXinputmode
-\appendtoks \catcode`|=\@@letter \to \everyXMLinputmode
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/core-job.mkii b/Master/texmf-dist/tex/context/base/mkii/core-job.mkii
deleted file mode 100644
index e2dc16031ff..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/core-job.mkii
+++ /dev/null
@@ -1,419 +0,0 @@
-%D \module
-%D [ file=core-job, % copied from main-001,
-%D version=1997.03.31,
-%D title=\CONTEXT\ Core Macros,
-%D subtitle=Job Handling,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 module is still to be split and documented.
-
-\writestatus{loading}{ConTeXt Core Macros / Job Handling}
-
-\unprotect
-
-\let \currentproject \empty
-\let \currentproduct \empty
-\let \currentenvironment \empty
-\let \currentcomponent \empty
-
-\let \loadedfiles \empty
-\let \processedfiles \empty
-
-\let \nomorefiles \relax
-
-\let \allinputpaths \empty
-\let \locatedfilepath \empty
-
-\newcount\textlevel
-\newcount\fileprocesslevel
-
-\setvalue{\c!file::0}{\jobname}
-
-\def\processedfile % is used in styles, don't change !
- {\getvalue{\c!file::\number\fileprocesslevel}}
-
-\def\dostarttextfile#1%
- {\global\advance\fileprocesslevel\plusone
- \setxvalue{\c!file::\number\fileprocesslevel}{#1}%
- \@EA\doglobal\@EA\addtocommalist\@EA{#1}\processedfiles}
-
-\def\dostoptextfile
- {\global\advance\fileprocesslevel\minusone}
-
-\def\processlocalfile#1#2%
- {#1{#2}\donothing{\readfile{#2}\donothing\donothing}}
-
-\def\processfile#1%
- {\ifx\allinputpaths\empty
- \def\next{\processlocalfile\readlocfile}%
- \else
- \let\filepath\empty
- \def\docommand##1%
- {\doiffileelse{\pathplusfile{##1}{#1}}{\donetrue\def\filepath{##1}}\donefalse
- \ifdone\expandafter\quitcommalist\fi}%
- \doifparentfileelse{#1} % new
- {\processcommacommand [\allinputpaths]\docommand}
- {\processcommacommand[.,\allinputpaths]\docommand}%
- \ifx\filepath\empty
- \def\next{\processlocalfile\readlocfile}% fall back ../../..
- \else
- \def\next{\processlocalfile{\readsetfile\filepath}}% file found
- \fi
- \fi
- \next{#1}}
-
-\def\doifinputfileelse#1% rarely used
- {\ifx\allinputpaths\empty
- \@EA\secondoftwoarguments
- \else
- \let\filepath\empty
- \def\docommand##1%
- {\doiffileelse{\pathplusfile{##1}{#1}}{\donetrue\def\filepath{##1}}\donefalse
- \ifdone\expandafter\quitcommalist\fi}%
- \processcommacommand[.,\allinputpaths]\docommand
- \ifx\filepath\empty
- \@EAEAEA\secondoftwoarguments
- \else
- \@EAEAEA\firstoftwoarguments
- \fi
- \fi}
-
-\let\locatedfilepath\empty
-
-\def\locatefilepath#1%
- {\let\locatedfilepath\empty
- \ifx\allinputpaths\empty \else
- \def\docommand##1%
- {\doiffileelse{\pathplusfile{##1}{#1}}{\donetrue\def\locatedfilepath{##1}}\donefalse
- \ifdone\expandafter\quitcommalist\fi}%
- \doifparentfileelse{#1} % new
- {\processcommacommand [\allinputpaths]\docommand}
- {\processcommacommand[.,\allinputpaths]\docommand}%
- \fi}
-
-\def\usepath[#1]%
- {\def\docommand##1%
- {\doifelse{##1}\v!reset
- {\let\allinputpaths\empty}
- {\sanitizefilename#1\to\ascii
- \defconvertedcommand\ascii\ascii
- \addtocommalist\ascii\allinputpaths}}%
- \processcommalist[#1]\docommand}
-
-\def\usesubpath[#1]% test for a real long time, permits ../{name} i.e. braces
- {\ifx\allinputpaths\empty
- \sanitizefilename#1\to\allinputpaths
- \else
- \def\docommand##1%
- {\def\dodocommand####1%
- {\sanitizefilename####1\to\ascii
- \defconvertedcommand\ascii\ascii
- \addtocommalist{##1/\ascii}\allinputpaths}%
- \processcommalist[#1]\dodocommand}%
- \processcommacommand[\allinputpaths]\docommand
- \fi}
-
-\def\registerfileinfo[#1#2]#3% geen \showmessage ?
- {\writestatus\m!systems{#1#2 file #3 at line \the\inputlineno}%
- \immediatewriteutility{f #1 {#3}}}
-
-\ifx\preloadfonts \undefined \let\preloadfonts \relax \fi
-\ifx\preloadspecials\undefined \let\preloadspecials\relax \fi
-
-\ifx\disableXML\undefined \let\disableXML\relax \fi
-
-\def\doloadsystemfile#1% mkii with fallback to tex
- {\readsysfile{#1.\mksuffix}
- {\showmessage\m!systems2{#1.\mksuffix}}
- {\readsysfile{#1.tex}{\showmessage\m!systems2{#1.tex}}\donothing}}
-
-\def\loadsystemfiles
- {\reportprotectionstate
- \doloadsystemfile\f!newfilename
- \doloadsystemfile\f!locfilename
- \doloadsystemfile\f!expfilename
- \readsysfile{\f!sysfilename.\mksuffix}
- {\showmessage\m!systems2{\f!sysfilename.\mksuffix}}
- {\readsysfile{\f!sysfilename.tex}
- {\showmessage\m!systems2{\f!sysfilename.tex}}
- {\readsysfile{\f!sysfilename.rme}
- {\showmessage\m!systems2{\f!sysfilename.rme}%
- \doglobal\appendtoks % brrr better \setcatcodetable\ctxcatcodes
- \bgroup
- \disableXML
- \readsysfile{\f!errfilename.\mksuffix}\donothing\donothing
- \egroup
- \to\everygoodbye}%
- \donothing}}}
-
-%D Loading of \type {cont-usr.tex} (edited by the user)
-%D and \type {cont-fmt.tex} (generated by texexec). This is
-%S obsolete now that we have enough memory for patterns.
-
-% \def\loaduserspecifications
-% {% this used to be the file where users can tune their system, especially patterns
-% \readsysfile\f!usrfilename{\showmessage\m!systems2\f!usrfilename}\donothing
-% % this one took care of user preferences (fonts, messages) but lm made this obsolete
-% \readjobfile\f!fmtfilename{\showmessage\m!systems2\f!fmtfilename}\donothing
-% % from now on we preload all patterns (only in mkii)
-% \preloadallpatterns}
-
-\let\loaduserspecifications\relax
-
-%D We don't want multiple jobfiles to interfere.
-
-\def\loadoptionfile
- {\readjobfile{\jobname.\f!optionextension}
- {\showmessage\m!systems2{\jobname.\f!optionextension}}%
- {\writestatus\m!systems {no \jobname.\f!optionextension}}}
-
-% Most natural ...
-%
-% \def\doateverystarttext
-% {\the\everystarttext
-% \global\let\doateverystarttext\relax}
-%
-% ... most practical, since we can load env's in a
-% something.run file (nested \starttext's; see for
-% instance x-res-08, where we definitely want to
-% open the file!).
-
-\def\doateverystarttext
- {\the\everystarttext
- \global\everystarttext\emptytoks}
-
-\def\starttext
- {\doateverystarttext
- \ifcase\textlevel
- \registerfileinfo[begin]\jobname
- \expandafter\startcopyingblocks
- \fi
- \global\advance\textlevel\plusone}
-
-\def\stoptext
- {\global\advance\textlevel\minusone
- \ifnum\textlevel>\zerocount \else
- \page[\v!last]\page % new, moved from everybye to here; flushes headers, colors etc etc etc
- \the\everystoptext
- %\the\everybye %
- %\the\everygoodbye % == \end (new)
- %\expandafter\normalend %
- \expandafter\finalend
- \fi}
-
-\def\forcequitjob#1%
- {\writestatus\m!systems{forcing quit: #1}%
- \batchmode
- \dorecurse\textlevel\stoptext
- \normalend}
-
-\let\autostoptext\relax
-
-\def\autostarttext
- {\ifcase\textlevel
- \starttext
- \writestatus\m!systems{auto \string\starttext..\string\stoptext}%
- \let\autostoptext\stoptext
- \fi}
-
-\def\finalend
- {\ifnum\textlevel>\zerocount \else
- \the\everybye
- \the\everygoodbye
- \doifsometokselse\everynotabene{\writeline\the\everynotabene\writeline}\donothing
- \global\everybye \emptytoks % rather unneeded
- \global\everygoodbye\emptytoks % but for sure
- \expandafter\normalend
- \fi}
-
-\let\end\finalend
-
-\def\emergencyend
- {\writestatus\m!systems{invalid \@EA\string\csname\e!start\v!text\endcsname...\@EA\string\csname\e!stop\v!text\endcsname\space structure}%
- \stoptext}
-
-\def\currentfile{\inputfilename}
-
-\def\doexecutefileonce#1%
- {\beforesplitstring#1\at.\to\currentfile
- \fullexpandtwoargsafter\doifnotinset\currentfile\loadedfiles
- {\fullexpandoneargafter\addtocommalist\currentfile\loadedfiles
- \doexecutefile{#1}}}
-
-\def\doexecutefile#1%
- {\registerfileinfo[begin]{#1}%
- \dostarttextfile{#1}%
- \processfile{#1}%
- \dostoptextfile
- \registerfileinfo[end]{#1}}
-
-\def\donotexecutefile#1%
- {}
-
-\def\verwerkfile#1 %
- {\doexecutefile{#1}}
-
-\def\useenvironment[#1]% maybe commalist
- {\environment #1 \relax}
-
-\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\stopenvironment
- \popmacro\startenvironment}
-
-\def\component #1 % at outermost level only
- {\dostarttextfile{#1}%
- \processfile{#1}%
- \dostoptextfile}
-
-\newcount\filelevel
-
-\let\currentcomponent \v!text
-\let\currentcomponentpath\f!currentpath
-
-\def\donextlevel#1#2#3#4#5#6#7\\%
- {\pushmacro\currentcomponent
- \pushmacro\currentcomponentpath
- \let\currentcomponent#1%
- \setsystemmode\currentcomponent
- \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}}%
- \def\environment ##1 {#4{##1}}%
- \def\product ##1 {#5{##1}}%
- \def\component ##1 {#6{##1}}%
- \fi
- \advance\filelevel\plusone
- \fullexpandoneargafter\addtocommalist{#1}\loadedfiles}
-
-\def\doprevlevel
- {\popmacro\currentcomponentpath
- \popmacro\currentcomponent
- \setsystemmode\currentcomponent
- \ifnum\filelevel=\plusone
- \expandafter\stoptext
- \else
- \advance\filelevel\minusone
- \expandafter\endinput
- \fi}
-
-\def\startproject #1 %
- {\donextlevel\v!project\currentproject
- \donotexecutefile\doexecutefileonce
- \doexecutefileonce\doexecutefile#1\\}
-
-\def\startproduct #1 %
- {\doateverystarttext
- \donextlevel\v!product\currentproduct
- \doexecutefileonce\doexecutefileonce
- \donotexecutefile\doexecutefile#1\\}
-
-\def\startcomponent #1 %
- {\doateverystarttext
- \donextlevel\v!component\currentcomponent
- \doexecutefileonce\doexecutefileonce
- \donotexecutefile\doexecutefile#1\\}
-
-\def\startenvironment #1 %
- {\donextlevel\v!environment\currentenvironment
- \donotexecutefile\doexecutefileonce
- \donotexecutefile\donotexecutefile#1\\}
-
-% \startproject test
-% 1: \startmode[*project] project \stopmode \endgraf
-% 2: \startmode[*product] product \stopmode \endgraf
-% \stopproject
-
-\def\stopproject {\doprevlevel}
-\def\stopproduct {\doprevlevel}
-\def\stopcomponent {\doprevlevel}
-\def\stopenvironment{\doprevlevel}
-
-% more or less replaced by modes
-
-\setvalue{\e!start\v!localenvironment}[#1]%
- {\let\loadedlocalenvironments\empty
- \def\docommand##1%
- {\beforesplitstring##1\at.\to\someevironment
- \fullexpandoneargafter\addtocommalist\someevironment\loadedlocalenvironments}%
- \processcommalist[#1]\docommand
- \fullexpandtwoargsafter\doifcommonelse % no longer next needed
- {\currentproject,\currentproduct,%
- \currentcomponent,\currentenvironment}
- {\loadedlocalenvironments}
- {\letvalue{\e!stop\v!localenvironment}\relax}
- {\grabuntil{\e!stop\v!localenvironment}\gobbleoneargument}} % TH: fixed, was \relax
-
-\setvalue{\v!localenvironment}#1 {\doexecutefileonce{#1}}
-
-% NOT TOEVOEGEN: \the\everytrace
-
-\neverypar=\emptytoks
-
-% \appendtoks \flushnotes \to \everypar
-% \appendtoks \synchronizesidefloats \to \everypar
-% \appendtoks \checkindentation \to \everypar
-% \appendtoks \showparagraphnumber \to \everypar
-% \appendtoks \flushmargincontents \to \everypar
-% \appendtoks \flushcommentanchors \to \everypar
-% \appendtoks \synchronizenotes \to \everypar
-
-% \appendtoks \flushnotes \to \everydisplay
-% \appendtoks \adjustsidefloatdisplaylines \to \everydisplay
-
-% soon, when pdftex 1.22 is out in the field:
-
-\chardef\systemcommandmode\zerocount % 0=unknown 1=disabled 2=enabled
-
-\def\checksystemcommandmode
- {\ifx\pdfshellescape\undefined \else
- \chardef\systemcommandmode \ifcase\pdfshellescape \plusone \else \plustwo \fi
- \fi
- \global\let\checksystemcommandmode\relax}
-
-\def\reportsystemcommandmode
- {\ifcase\systemcommandmode
- \or
- \writestatus\m!systems{system commands are disabled}%
- \or
- \writestatus\m!systems{system commands are enabled}%
- \fi}
-
-% \ifx\etexversion\undefined \else \ifnum\etexversion<202
-% \prependtoks
-% \writestatus\m!systems{eTeX version \number\etexversion\space -> too old (bugs)}%
-% \writeline
-% \to \everyjob
-% \fi \fi
-
-% \ifx\pdftexversion\undefined \else \ifnum\number\pdftexversion<120
-% \prependtoks
-% \writestatus\m!systems{pdfTeX version \number\pdftexversion\space -> please update}%
-% \writeline
-% \to \everyjob
-% \fi \fi
-
-% Default-instellingen (verborgen)
-
-\resetutilities
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/core-mis.mkii b/Master/texmf-dist/tex/context/base/mkii/core-mis.mkii
deleted file mode 100644
index c44d61cbc3e..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/core-mis.mkii
+++ /dev/null
@@ -1,2745 +0,0 @@
-%D \module
-%D [ file=core-mis,
-%D version=1998.01.29,
-%D title=\CONTEXT\ Core Macros,
-%D subtitle=Miscelaneous,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Core Macros / Misc Commands}
-
-% todo: kleur in legenda + letter
-
-% %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.
-% %D
-% %D Obsolete now:
-% %
-% % \def\documentstyle{\showmessage\m!systems3\empty\stoptekst}
-% %
-% % \let\documentclass=\documentstyle
-% %D \macros
-% %D {simplifiedcommands, simplifycommands}
-% %D
-% %D I first needed this simplification in bookmarks. Users can
-% %D add their own if needed.
-
-\unprotect
-
-%D Sometimes (for instance in bookmarks) we need to simplify macro
-%D behaviour, so here is the hook.
-
-\ifx\simplifiedcommands\undefined \newtoks\simplifiedcommands \fi
-
-\def\simplifycommands{\the\simplifiedcommands}
-
-%D A possibly growing list:
-
-%appendtoks \def\executesynonym#1#2#3#4{#3}\to\simplifiedcommands
-%appendtoks \def\executesort#1#2#3{#3}\to\simplifiedcommands
-
-\appendtoks \def\ { }\to\simplifiedcommands
-\appendtoks \def\type#1{\letterbackslash\strippedcsname#1}\to\simplifiedcommands
-\appendtoks \def\tex#1{\letterbackslash#1}\to\simplifiedcommands
-\appendtoks \def\TeX{TeX}\to\simplifiedcommands
-\appendtoks \def\ConTeXt{ConTeXt}\to\simplifiedcommands
-\appendtoks \def\MetaPost{MetaPost}\to\simplifiedcommands
-\appendtoks \def\MetaFont{MetaFont}\to\simplifiedcommands
-\appendtoks \def\MetaFun{MetaFun}\to\simplifiedcommands
-%appendtoks \def||{-}\to\simplifiedcommands
-\appendtoks \def|#1|{\ifx#1\empty\empty-\else#1\fi}\to\simplifiedcommands
-\appendtoks \let\crlf\space\to\simplifiedcommands
-\appendtoks \let\\\space\to\simplifiedcommands
-
-\appendtoks\let\buildtextaccent\secondoftwoarguments\to\simplifiedcommands
-
-% THIS WAS MAIN-002.TEX
-
-%\def\checkinterlineskip
-% {\ifvmode
-% \ifdim\lastskip>\zeropoint
-% \nointerlineskip
-% \else\ifdim\lastkern>\zeropoint
-% \nointerlineskip
-% \fi\fi
-% \fi}
-
-\def\horitems#1#2% #1=breedte #2=commandos
- {\scratchdimen#1%
- \divide\scratchdimen \nofitems
- \!!counta\zerocount
- \def\docommand##1%
- {\advance\!!counta \plusone
- \processaction
- [\@@isalign]
- [ \v!left=>\hbox to \scratchdimen{\strut##1\hss},
- \v!right=>\hbox to \scratchdimen{\hss\strut##1},
- \v!middle=>\hbox to \scratchdimen{\hss\strut##1\hss},
- \v!margin=>\ifnum\!!counta=\plusone\hss\else\hfill\fi
- \strut##1%
- \ifnum\!!counta=\nofitems\hss\else\hfill\fi,
- \s!default=>\hbox to \scratchdimen{\hss\strut##1\hss}, % midden
- \s!unknown=>\hbox to \scratchdimen{\strut##1\hss}]}% % links
- \hbox to #1{\hss#2\hss}}
-
-\def\veritems#1#2% #1=breedte #2=commandos
- {\scratchdimen#1%
- \def\docommand##1%
- {\ifdim\scratchdimen<\zeropoint % the - was a signal
- \hbox to -\scratchdimen{\hss\strut##1}%
- \else\ifdim\scratchdimen>\zeropoint
- \hbox to \scratchdimen{\strut##1\hss}%
- \else
- \hbox{\strut##1}%
- \fi\fi}%
- \vbox{#2}}
-
-\def\dosetupitems[#1]%
- {\getparameters[\??is][#1]%
- \doif\@@iswidth\v!unknown
- {\def\@@iswidth{\hsize}}%
- \doifconversiondefinedelse\@@issymbol
- {\def\doitembullet##1{\convertnumber{\@@issymbol}{##1}}}
- {\doifsymboldefinedelse\@@issymbol
- {\def\doitembullet##1{\symbol[\@@issymbol]}}{}}}
-
-\def\makeitemsandbullets#1%
- {\doifelse\@@isn\v!unknown
- {\getcommalistsize[#1]%
- \edef\nofitems{\commalistsize}}
- {\edef\nofitems{\@@isn}}%
- \setbox0\hbox
- {\doitems \@@iswidth
- {\processcommalist[#1]\docommand}}%
- \setbox2\hbox
- {\doitems \@@isbulletbreedte
- {\dorecurse\nofitems
- {\docommand{\strut\doitembullet\recurselevel}}}}}
-
-\def\dostartitems#1#2#3%
- {\let\doitems#2%
- \def\@@isbulletbreedte{#3}%
- \makeitemsandbullets{#1}%
- \@@isbefore}
-
-\def\dostopitems
- {\@@isafter
- \egroup}
-
-\setvalue{doitems\v!top}#1%
- {\dostartitems{#1}\horitems\@@iswidth
- \noindent\vbox
- {\forgetall
- \doifsomething\@@issymbol
- {\doifnot\@@issymbol\v!none
- {\box2
- \@@isinbetween
- \nointerlineskip}}%
- \box0}%
- \dostopitems}
-
-\setvalue{doitems\v!bottom}#1%
- {\dostartitems{#1}\horitems\@@iswidth
- \noindent\vbox
- {\forgetall
- \box0
- \doifsomething\@@issymbol
- {\@@isinbetween
- \nointerlineskip
- \box2}}%
- \dostopitems}
-
-\setvalue{doitems\v!inmargin}#1%
- {\dostartitems{#1}\veritems{-1.5em}% - is a signal
- \noindent\hbox{\llap{\box2\hskip\leftmargindistance}\box0}%
- \dostopitems}
-
-\setvalue{doitems\v!left}#1%
- {\advance\hsize -1.5em%
- \dostartitems{#1}\veritems{1.5em}%
- \noindent\hbox{\box2\box0}%
- \dostopitems}
-
-\setvalue{doitems\v!right}#1%
- {\dostartitems{#1}\veritems{0em}%
- \noindent\hbox{\box0\hskip-\wd2\box2}%
- \dostopitems}
-
-\def\setupitems
- {\dosingleargument\dosetupitems}
-
-\def\complexitems[#1]%
- {\bgroup
- \setupitems[#1]%
- \parindent\zeropoint
- \setlocalhsize
- \hsize\localhsize
- \dontcomplain
- %\doifundefined{doitems\@@islocation}%
- % {\let\@@islocation\v!left}%
- %\getvalue{doitems\@@islocation}}
- \executeifdefined{doitems\@@islocation}{\let\@@islocation\v!left}}
-
-\definecomplexorsimpleempty\items
-
-\setupitems
- [\c!location=\v!left,
- \c!symbol=5,
- \c!width=\hsize,
- \c!align=\v!middle,
- \c!n=\v!unknown,
- \c!before=\blank,
- \c!inbetween={\blank[\v!medium]},
- \c!after=\blank]
-
-% \definieerplaats[naam][instellingen]
-% \stelplaatsin[naam][instellingen]
-% \plaats<naam>[[instellingen]]
-%
-% - still undocumented and also not in setupb yet
-% - kan ook intern/direct (scheelt duplicatie), zie \framedtext
-
-\def\dodefineplacement[#1][#2]%
- {\getparameters
- [\??pl#1]
- [\c!left=\hss,
- \c!right=\hss,
- \c!linecorrection=\v!off,
- \c!depthcorrection=\v!off,
- \c!margin=\v!standard,
- \c!grid=\v!middle,
- %\c!before=,
- %\c!after=,
- #2]%
- \setvalue{\e!place#1}{\doplacement[\??pl#1]}}
-
-\def\defineplacement
- {\dodoubleempty\dodefineplacement}
-
-\def\setupplacement
- {\dodoubleempty\dosetupplacement}
-
-\def\dosetupplacement[#1]%
- {\dodoubleempty\getparameters[\??pl#1]}
-
-\def\doplacement
- {\dodoubleempty\dodoplacement}
-
-\def\dodoplacement[#1][#2]% correctie moet mooier
- {\bgroup
- \dowithnextboxcontent
- {\forgetall}
- {\setlocalhsize
- \getparameters[#1][#2]%
- \getvalue{#1\c!before}%
- \begingroup
- \disableparpositions
- \setbox\nextbox\hbox to \localhsize
- {\getvalue{#1\c!left}%
- \flushnextbox
- \getvalue{#1\c!right}}%
- \ifinsidefloat \else
- \addlocalbackgroundtobox\nextbox
- \fi
- \ifgridsnapping
- \doifundefined{#1\c!grid}{\letvalue{#1\c!grid}\v!middle}%
- % unchecked
- \doifinset{\getvalue{#1\c!margin}}{\v!standard,\v!yes}\noindent
- \snaptogrid[\getvalue{#1\c!grid}]\hbox{\flushnextbox}%
- \else
- \doifvalue{#1\c!linecorrection}\v!on \startbaselinecorrection
- \doifinset{\getvalue{#1\c!margin}}{\v!standard,\v!yes}\noindent
- \flushnextbox
- \doifvalue{#1\c!depthcorrection}\v!on\baselinecorrection
- \doifvalue{#1\c!linecorrection }\v!on\stopbaselinecorrection
- \fi
- \endgroup
- \getvalue{#1\c!after}%
- \egroup}
- \vbox}
-
-% Te zijner tijd [plaats=boven,onder,midden] implementeren,
-% in dat geval moet eerst de maximale hoogte worden bepaald.
-%
-% Overigens kan een en ander mooier met \halign.
-
-% 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]%
- {\edef\currentparagraph{#1}%
- \setvalue{\s!do\s!next\currentparagraph}%
- {\def\\{\getvalue\currentparagraph}}%
- \setvalue\currentparagraph
- {\getvalue{\s!do\s!next#1}%
- \dostartparagraphs{#1}}%
- \setvalue{\e!next\currentparagraph}%
- {\getvalue{#1}}%
- \setvalue{\e!start\currentparagraph}%
- {\bgroup
- \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
- {\paragraphparameter\c!n}
- {\setupparagraphs
- [\currentparagraph]
- [\recurselevel]
- [\c!width=,
- %\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]%
- {\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}
-
-\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\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
- \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
- %
- % 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}%
- %
- \nospace % remove + ignore
- \paragraphcellmeter\alcounter\c!command}
-
-\def\dostopparagraph
- {\ifvmode
- \removelastskip
- \else
- \unskip\endstrut\endgraf
- \fi
- \paragraphcellmeter\alcounter\c!bottom
- \egroup
- \ifdim\wd\scratchbox=\zeropoint % no data
- \wd\scratchbox\!!widtha
- \fi
- \box\scratchbox
- \dostopattributes
- \ifnum\alcounter<\paragraphparameter\c!n\relax
- \@EA\doparagraphcell
- \else
- \@EA\dostopparagraphs
- \fi}
-
-\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\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 -\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\dostopparagraphs
- {\egroup
- \egroup
- \iftrue
- \hbox{\raise\strutheight\box\scratchbox}% new
- \else
- \box\scratchbox % old
- \fi
- \par
- \paragraphparameter\c!after
- \egroup}
-
-\def\dosetuptab[#1]%
- {\getparameters[\??ta]
- [\c!headstyle=\v!normal,
- \c!headcolor=,
- \c!style=\v!normal,
- \c!color=,
- \c!width=\v!broad,
- \c!sample={\hskip4em},
- \c!before=,
- \c!after=,
- #1]%
- \definedescription
- [tab]
- [\c!headstyle=\@@taheadstyle,
- \c!headcolor=\@@tacolor,
- \c!sample=\@@tasample,
- \c!width=\@@tawidth,
- \c!before=\@@tabefore,
- \c!after=\@@taafter]}
-
-\def\setuptab
- {\dosingleargument\dosetuptab}
-
-\setuptab
- [\c!location=\v!left]
-
-% The following macro's are derived from PPCHTEX and
-% therefore take some LaTeX font-switching into account.
-
-\newif\ifloweredsubscripts
-
-% Due to some upward incompatibality of LaTeX to LaTeX2.09
-% and/or LaTeX2e we had to force \@@chemieletter. Otherwise
-% some weird \nullfont error comes up.
-
-\doifundefined{@@chemieletter}{\def\@@chemieletter{\rm}}
-
-\def\beginlatexmathmodehack
- {\ifmmode
- \let\endlatexmathmodehack\relax
- \else
- \def\endlatexmathmodehack{$}$\@@chemieletter
- \fi}
-
-\def\setsubscripts
- {\beginlatexmathmodehack
- \def\dosetsubscript##1##2##3%
- {\dimen0=##3\fontexheight##2%
- \setxvalue{@@\string##1\string##2}{\the##1##2\relax}%
- ##1##2=\dimen0\relax}%
- \def\dodosetsubscript##1##2%
- {\dosetsubscript{##1}{\textfont2}{##2}%
- \dosetsubscript{##1}{\scriptfont2}{##2}%
- \dosetsubscript{##1}{\scriptscriptfont2}{##2}}%
- %dodosetsubscript\mathsupnormal {?}%
- \dodosetsubscript\mathsubnormal {.7}%
- \dodosetsubscript\mathsubcombined{.7}%
- \global\loweredsubscriptstrue
- \endlatexmathmodehack}
-
-\def\resetsubscripts
- {\ifloweredsubscripts
- \beginlatexmathmodehack
- \def\doresetsubscript##1##2%
- {\dimen0=\getvalue{@@\string##1\string##2}\relax
- ##1##2=\dimen0}%
- \def\dodoresetsubscript##1%
- {\doresetsubscript{##1}{\textfont2}%
- \doresetsubscript{##1}{\scriptfont2}%
- \doresetsubscript{##1}{\scriptscriptfont2}}%
- %dodoresetsubscript\mathsupnormal
- \dodoresetsubscript\mathsubnormal
- \dodoresetsubscript\mathsubcombined
- \global\loweredsubscriptsfalse
- \endlatexmathmodehack
- \fi}
-
-\let\beginlatexmathmodehack = \relax
-\let\endlatexmathmodehack = \relax
-
-\def\chem#1#2#3%
- {\bgroup
- \setsubscripts
- \mathematics{\hbox{#1}_{#2}^{#3}}%
- \resetsubscripts
- \egroup}
-
-\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 {}
-\def\bedragempty {\euro}
-
-\unexpanded\def\bedrag#1%
- {\strut\hbox\bgroup
- \let\normalfixedspace\nonbreakablespace
- \doifelsenothing{#1}
- {\bedragempty}
- {\bedragprefix\digits{#1}\bedragsuffix}%
- \egroup}
-
-% \definieeralineas[test][n=3]
-%
-% \stelalineasin[test][3][breedte=4cm,uitlijnen=links]
-%
-% \startopelkaar
-% \test hans \\ ton \\ \bedrag{1.000,--} \\
-% \test hans \\ ton \\ \bedrag{~.~~1,--} \\
-% \test hans \\ ton \\ \bedrag{~.~~1,~~} \\
-% \test hans \\ ton \\ \bedrag{~.100,--} \\
-% \test hans \\ ton \\ \subtot{1.000,--} \\
-% \test hans \\ ton \\ \bedrag{1.000,--} \\
-% \test hans \\ ton \\ \bedrag{1.000,--} \\
-% \test hans \\ ton \\ \totaal{1.000,--} \\
-% \test hans \\ ton \\ \bedrag{nihil,--} \\
-% \test hans \\ ton \\ \totaal{nihil,--} \\
-% \test hans \\ ton \\ \subtot{nihil,--} \\
-% \stopopelkaar
-
-\def\periodswidth {.5em}
-\def\periodsdefault{3} % was 5, but now it's like \unknown
-
-\unexpanded\def\periods
- {\dosingleempty\doperiods}
-
-\def\doperiods[#1]%
- {\dontleavehmode
- \begingroup
- \scratchdimen\periodswidth
- \hbox to \iffirstargument#1\else\periodsdefault\fi \scratchdimen
- {\leaders\hbox to \scratchdimen{\hss.\hss}\hss}%
- \endgroup}
-
-\unexpanded\def\unknown
- {\periods\relax} % relax prevents lookahead for []
-
-% compatibility macros
-
-\def\doorsnede
- {\hbox{\rlap/$\circ$} }
-
-\unexpanded\def\ongeveer
- {\mathematics\pm}
-
-\chardef\boundarycharactermode\plusone
-
-\def\midboundarycharacter#1#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%
- {\ifcase\boundarycharactermode
- \or
- \languageparameter#1%
- \nobreak
- \hskip\hspaceamount\currentlanguage{#2}%
- \or
- \languageparameter#1%
- \fi
- \chardef\boundarycharactermode\plusone}
-
-\def\rightboundarycharacter#1#2%
- {\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
-%
-% obsolete:
-
-\def\setuphyphenmark
- {\dodoubleargument\getparameters[\??kp]}
-
-\def\setuphyphenmark[#1]% sign=normal|wide
- {\dodoubleargument\getparameters[\??kp][#1]%
- \doifinsetelse\@@kpsign {\v!normal}
- {\let\textmodehyphen\normalhyphen \let\textmodehyphendiscretionary\normalhyphendiscretionary}
- {\let\textmodehyphen\composedhyphen\let\textmodehyphendiscretionary\composedhyphendiscretionary}}
-
-\setuphyphenmark[\c!sign=\v!wide]
-% % \setuphyphenmark[\c!sign=\v!normal]
-
-\definesymbol[\c!lefthyphen] [\languageparameter\c!lefthyphen]
-\definesymbol[\c!righthyphen] [\languageparameter\c!righthyphen]
-\definesymbol[\c!hyphen] [\languageparameter\c!hyphen]
-
-\def\normalhyphen
- {\hbox{\directsymbol\empty\c!hyphen}}
-
-\def\composedhyphen
- {\hbox{\directsymbol\empty\c!compoundhyphen}}
-
-\def\normalhyphendiscretionary
- {\discretionary
- {\hbox{\directsymbol\empty\c!lefthyphen}}
- {\hbox{\directsymbol\empty\c!righthyphen}}
- {\hbox{\directsymbol\empty\c!hyphen}}}
-
-\def\composedhyphendiscretionary
- {\discretionary
- {\hbox{\directsymbol\empty\c!leftcompoundhyphen}}
- {\hbox{\directsymbol\empty\c!rightcompoundhyphen}}
- {\hbox{\directsymbol\empty\c!compoundhyphen}}}
-
-\let\textmodehyphen \composedhyphen
-\let\textmodehyphendiscretionary\composedhyphendiscretionary
-
-\definesymbol[\c!leftcompoundhyphen] [\languageparameter\c!leftcompoundhyphen]
-\definesymbol[\c!rightcompoundhyphen] [\languageparameter\c!rightcompoundhyphen]
-\definesymbol[\c!compoundhyphen] [\languageparameter\c!compoundhyphen]
-
-\definehspace [sentence] [\zeropoint]
-\definehspace [intersentence] [.250em]
-
-\definesymbol
- [\c!midsentence]
- [\midboundarycharacter\c!midsentence{sentence}]
-
-\definesymbol
- [\c!leftsentence]
- [\leftboundarycharacter\c!leftsentence{sentence}]
-
-\definesymbol
- [\c!rightsentence]
- [\rightboundarycharacter\c!rightsentence{sentence}]
-
-\definesymbol
- [\c!leftsubsentence]
- [\leftboundarycharacter\c!leftsubsentence{sentence}]
-
-\definesymbol
- [\c!rightsubsentence]
- [\rightboundarycharacter\c!rightsubsentence{sentence}]
-
-\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
- {\beforesubsentence
- \ifdim\lastkern=\subsentencesignal
- \unskip
- \kern\hspaceamount\currentlanguage{intersentence}%
- \fi
- \doglobal\increment\subsentencelevel
- \ifnum\subsentencelevel=\plusone
- \dontleavehmode % was \leaveoutervmode
- \fi
- \symbol[\ifodd\subsentencelevel\c!leftsentence\else\c!leftsubsentence\fi]%
- }% \ignorespaces}
-
-\def\endofsubsentence % relax prevents space gobbling
- {\symbol[\ifodd\subsentencelevel\c!rightsentence\else\c!rightsubsentence\fi]%
- \doglobal\decrement\subsentencelevel
- \unskip
- \kern\subsentencesignal\relax
- \aftersubsentence}
-
-\def\beginofsubsentencespacing % relax prevents space gobbling
- {\kern\subsentencesignal\relax}% \ignorespaces}
-
-\def\endofsubsentencespacing
- {\ifdim\lastkern=\subsentencesignal
- \unskip
- \hskip\hspaceamount\currentlanguage{intersentence}%
- % no good, actually language dependent:
-% \ignorespaces
- \else
- \unskip
- \fi}
-
-%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
-
-\definehspace [quotation] [\zeropoint]
-\definehspace [interquotation] [.125em]
-
-%definehspace [quote] [\zeropoint]
-%definehspace [speech] [\zeropoint]
-
-\definehspace [quote] [\hspaceamount\currentlanguage{quotation}]
-\definehspace [speech] [\hspaceamount\currentlanguage{quotation}]
-
-\definesymbol
- [\c!leftquotation]
- [\leftboundarycharacter\c!leftquotation{quotation}]
-
-\definesymbol
- [\c!rightquotation]
- [\rightboundarycharacter\c!rightquotation{quotation}]
-
-\definesymbol
- [\c!leftquote]
- [\leftboundarycharacter\c!leftquote{quote}]
-
-\definesymbol
- [\c!rightquote]
- [\rightboundarycharacter\c!rightquote{quote}]
-
-\definesymbol
- [\c!leftspeech]
- [\leftboundarycharacter\c!leftspeech{speech}]
-
-\definesymbol
- [\c!rightspeech]
- [\rightboundarycharacter\c!rightspeech{speech}]
-
-\definesymbol
- [\c!middlespeech]
- [\leftboundarycharacter\c!middlespeech{speech}]
-
-\appendtoks\def\quotation#1{"#1"}\to\simplifiedcommands
-\appendtoks\def\quote #1{'#1'}\to\simplifiedcommands
-
-%D The next features was so desperately needed by Giuseppe
-%D Bilotta that he made a module for it. Since this is a
-%D typical example of core functionality, I decided to extend
-%D the low level quotation macros in such a way that a speech
-%D feature could be build on top of it. The speech opening and
-%D closing symbols are defined per language. Italian is an
-%D example of a language that has them set.
-
-% this will replace the quotation and speed definitions
-
-\newsignal\delimitedtextsignal
-
-\let\currentdelimitedtext\s!unknown
-
-\def\delimitedtextparameter#1% will be sped up
- {\executeifdefined{\??ci\currentdelimitedtext:\csname\??ci\currentdelimitedtext\c!level\endcsname#1}%
- {\executeifdefined{\??ci\currentdelimitedtext#1}%
- {\executeifdefined{\??ci#1}\empty}}}
-
-\def\definedelimitedtext
- {\dodoubleempty\dodefinedelimitedtext}
-
-\def\dodefinedelimitedtext[#1][#2]%
- {\doifassignmentelse{#2}
- {\getparameters
- [\??ci#1]
- [\c!location=\v!margin, % \v!text \v!paragraph
- \c!spacebefore=,
- \c!spaceafter=\delimitedtextparameter\c!spacebefore,
- \c!style=\v!normal,
- \c!color=,
- \c!leftmargin=\zeropoint,
- \c!rightmargin=\delimitedtextparameter\c!leftmargin,
- \c!indentnext=\v!yes,
- \c!before=,
- \c!after=,
- \c!left=,
- \c!right=,
- \c!level=0,
- \c!repeat=\v!no,
- \c!method=,
- #2]}%
- {\doifdefined{#2}
- {\copyparameters[\??ci#1][\??ci#2]
- [\c!location,\c!spacebefore,\c!spaceafter,\c!style,\c!color,
- \c!leftmargin,\c!rightmargin,\c!indentnext,
- \c!before,\c!after,\c!left,\c!right]}}%
- \doifsomething{#1}
- {\unexpanded\setvalue{#1}{\delimitedtext[#1]}%
- \setvalue{\e!start#1}{\startdelimitedtext[#1]}%
- \setvalue{\e!stop #1}{\stopdelimitedtext}}}
-
-\def\setupdelimitedtext
- {\dotripleargument\dosetupdelimitedtext}
-
-\def\dosetupdelimitedtext[#1][#2][#3]% #2 = optional level
- {\ifthirdargument
- \getparameters[\??ci#1:#2][#3]%
- \else\ifsecondargument
- \getparameters[\??ci#1][#2]%
- \else
- \getparameters[\??ci][#1]%
- \fi\fi}
-
-\def\dorepeatdelimitedtext
- {\relax\ifcase\delimitedtextparameter\c!level\else
- \dohandledelimitedtext\c!middle % maybe better \dohandleleftdelimitedtext
- \fi}
-
-\let\dohandlerepeatdelimitedtext\relax
-
-\def\startdelimitedtext[#1]%
- {\bgroup
- \pushdelimitedtext{#1}%
- \doifelse{\delimitedtextparameter\c!method}\s!font
- {\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
- \doifsomething{\delimitedtextparameter\c!spacebefore}
- {\blank[\delimitedtextparameter\c!spacebefore]}%
- \delimitedtextparameter\c!before
- % nicer:
- % \doadaptleftskip {\delimitedtextparameter\c!leftmargin}%
- % \doadaptrightskip{\delimitedtextparameter\c!rightmargin}%
- % backward compatible:
- \doifelsenothing{#1}
- {\endgraf
- \doadaptleftskip {\delimitedtextparameter\c!leftmargin}%
- \doadaptrightskip{\delimitedtextparameter\c!rightmargin}%
- \let\dodostopdelimitedtextpar\endgraf}
- {\startnarrower[#1]\let\dodostopdelimitedtextpar\stopnarrower}%
- % so far
- % \dochecknextindentation{\??ci\currentdelimitedtext}% AM: not here
- \dostartattributes{\??ci\currentdelimitedtext}\c!style\c!color\empty
- \leftdelimitedtextmark
- \ignorespaces}
-
-\def\dostopdelimitedtextpar
- {\removeunwantedspaces
- \removelastskip
- \rightdelimitedtextmark
- \dostopattributes
- \dodostopdelimitedtextpar
- \delimitedtextparameter\c!after
- \doifsomething{\delimitedtextparameter\c!spaceafter}
- {\blank[\delimitedtextparameter\c!spaceafter]}%
- \dochecknextindentation{\??ci\currentdelimitedtext}% AM: here
- \dorechecknextindentation}% AM: This was missing!
-
-\def\dostartdelimitedtexttxt
- {\let\dostopdelimitedtext\dostopdelimitedtexttxt
- \dostartattributes{\??ci\currentdelimitedtext}\c!style\c!color\empty
- \dohandleleftdelimitedtext\c!left
- \ignorespaces}
-
-\def\dostopdelimitedtexttxt
- {\removeunwantedspaces
- \dohandlerightdelimitedtext\c!right
- \dostopattributes}
-
-\def\stopdelimitedtext
- {\dostopdelimitedtext
- \popdelimitedtext
- \egroup}
-
-\def\pushdelimitedtext#1%
- {\globalpushmacro\currentdelimitedtext
- \def\currentdelimitedtext{#1}%
- \doglobal\incrementvalue{\??ci\currentdelimitedtext\c!level}}
-
-\def\popdelimitedtext
- {\doglobal\decrementvalue{\??ci\currentdelimitedtext\c!level}%
- \globalpopmacro\currentdelimitedtext}
-
-\def\delimitedtext[#1]%
- {\pushdelimitedtext{#1}%
- \doifelse{\delimitedtextparameter\c!method}\s!font
- {\dofontdrivendelimited}
- {\doifinsetelse{\delimitedtextparameter\c!location}{\v!paragraph,\v!margin}%
- \dodelimitedtextpar\dodelimitedtexttxt}}
-
-% shortcuts
-
-\def\startdelimited{\startdelimitedtext}
-\def\stopdelimited {\stopdelimitedtext} % no let, dynamically assigned
-\def\delimited {\delimitedtext}
-
-\def\leftdelimitedtextmark
- {\doifsomething{\delimitedtextparameter\c!left}
- {\setbox\scratchbox\hbox{\delimitedtextparameter\c!left}%
- \dontleavehmode
- \doif{\delimitedtextparameter\c!location}\v!margin{\hskip-\wd\scratchbox}%
- \box\scratchbox}}
-
-\def\rightdelimitedtextmark
- {\doifsomething{\delimitedtextparameter\c!right}
- {\hsmash{\delimitedtextparameter\c!right}}}
-
-% \starttext
-% \hyphenatedword{groepsvrijstellingsverordeningen}\par
-% \hyphenatedword{\quote{groepsvrijstellingsverordeningen}}\par
-% \dorecurse{100}{\hskip300pt\hskip\recurselevel pt test \quote{xxx xxxx}.\par}
-% \page \setuppapersize[A5][A4]
-% \quotation {overly beautiful pusillanimous sesquipedalian
-% longwinded} test test test test test test test test test test test
-% test test test test test test test test test test test test test
-% test test test test test test test test test test test test test
-% test test test test test test test test test test test test test
-% test test test
-% \stoptext
-
-\def\dohandledelimitedtext#1#2%
- {\begingroup
- \setbox\scratchbox\hbox{\delimitedtextparameter#1}%
- \ifdim\wd\scratchbox>\zeropoint
-% \ifdim\lastskip=\delimitedtextsignal
-% \unskip
- \ifdim\lastkern=\delimitedtextsignal
- \unkern
- \hskip\hspaceamount\currentlanguage{interquotation}%
- \else
- #2%
- \fi
- \ifhmode % else funny pagebeaks
- \penalty\!!tenthousand
- \hskip\zeropoint % == \prewordbreak
- \fi
- \strut % new, needed below
- \delimitedtextparameter#1% unhbox\scratchbox
-% \penalty\!!tenthousand % else overfull boxes, but that's better than dangling periods
- \kern\delimitedtextsignal % +- \prewordbreak
- \fi
- \endgroup}
-
-\def\dohandleleftdelimitedtext#1#2%
- {\begingroup
- \setbox\scratchbox\hbox{\delimitedtextparameter#1}%
- \ifdim\wd\scratchbox>\zeropoint
- \ifdim\lastkern=\delimitedtextsignal
- \unkern
- \hskip\hspaceamount\currentlanguage{interquotation}%
- \else\ifdim\lastskip=\delimitedtextsignal
- \unskip
- \hskip\hspaceamount\currentlanguage{interquotation}%
- \else
- #2%
- \fi\fi
- \strut % new, needed below
- \ifhmode % else funny pagebeaks
- \penalty\!!tenthousand
- \hskip\zeropoint % == \prewordbreak
- \fi
- \strut % new, needed below
- \delimitedtextparameter#1% unhbox\scratchbox
- \hskip\delimitedtextsignal % +- \prewordbreak
- \fi
- \endgroup}
-
-\def\dohandlerightdelimitedtext#1#2%
- {\begingroup
- \setbox\scratchbox\hbox{\delimitedtextparameter#1}%
- \ifdim\wd\scratchbox>\zeropoint
- \ifdim\lastkern=\delimitedtextsignal
- \unkern
- \hskip\hspaceamount\currentlanguage{interquotation}%
- \else\ifdim\lastskip=\delimitedtextsignal
- \unskip
- \hskip\hspaceamount\currentlanguage{interquotation}%
- \else
- #2%
- \fi\fi
- \ifhmode % else funny pagebeaks
- \penalty\!!tenthousand
- \hskip\zeropoint % == \prewordbreak
- \fi
- \strut % new, needed below
- \delimitedtextparameter#1% unhbox\scratchbox
- \kern\delimitedtextsignal % +- \prewordbreak
- \fi
- \endgroup}
-
-\def\ignoredelimitedtext#1%
- {\delimitedtextparameter#1}
-
-\def\handledelimitedtext#1%
- {\dohandledelimitedtext{#1}\relax}
-
-\def\handleleftdelimitedtext#1%
- {\dohandleleftdelimitedtext{#1}\relax}
-
-\def\handlerightdelimitedtext#1%
- {\dohandlerightdelimitedtext{#1}\relax}
-
-\unexpanded\def\dodelimitedtextpar
- {\dohandleleftdelimitedtext\c!left\relax
- \groupedcommand
- \donothing
- {\dohandlerightdelimitedtext\c!right\removelastskip
- \popdelimitedtext}}
-
-\unexpanded\def\dodelimitedtexttxt
- {\doifelse{\delimitedtextparameter\c!style}\v!normal
- \doquoteddelimited\doattributeddelimited}
-
-\def\doquoteddelimited
- {\dohandleleftdelimitedtext\c!left\relax
- \groupedcommand
- \donothing
- {\dohandlerightdelimitedtext\c!right
- \removelastskip
- \popdelimitedtext}}
-
-\def\doattributeddelimited
- {\groupedcommand
- {\dostartattributes{\??ci\currentdelimitedtext}\c!style\c!color}
- {\dostopattributes
- \popdelimitedtext}}
-
-\def\dofontdrivendelimited
- {\simplegroupedcommand
- {\languageparameter{\c!left\currentdelimitedtext}}
- {\languageparameter{\c!right\currentdelimitedtext}%
- \popdelimitedtext}}
-
-% testcase for nesting:
-%
-% \quotation{... \quotation{...} ...}
-% \startquotation ... \startquotation... \quotation{...} \stopquotation\space ...\stopquotation
-% \setupdelimitedtext[quotation][1][left=(,right=)]
-% \setupdelimitedtext[quotation][2][left={[},right={]}]
-% \setupdelimitedtext[quotation][3][left=\{,right=\}]
-% \quotation{... \quotation{...} ...}
-% \startquotation ... \startquotation... \quotation{...} \stopquotation\space ...\stopquotation
-
-\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!blockquote][\v!quotation]
-
-\setupdelimitedtext
- [\v!blockquote]
- [\c!left=,
- \c!right=]
-
-\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
-% [\v!quotation][\v!quotation]
-%
-% \setupdelimitedtext
-% [\v!quotation]
-% [\c!indentnext=\v!no,
-% \c!spacebefore=\v!nowhite]
-
-\def\setupquotation{\setupdelimitedtext[\v!quotation]}
-\def\setupquote {\setupdelimitedtext[\v!quote]}
-
-% seldom used, move from kernel to run time module
-
-\ifx\tfx\undefined \let\tfx\relax \fi
-
-\def\basegrid
- {\dosingleempty\dobasegrid}
-
-\def\dobasegrid[#1]%
- {\begingroup
- \getparameters[\??rt]
- [\c!x=0,\c!y=0,
- \c!nx=10,\c!ny=10,
- \c!dx=.5,\c!dy=.5,
- \c!xstep=0,\c!ystep=0,
- \c!unit=\s!cm,
- \c!scale=1,
- \c!factor=1,
- \c!offset=\v!yes,
- \c!location=\v!left,
- #1]%
- \startpositioning
- \dimen0=\@@rtdx\@@rtunit\relax
- \dimen0=\@@rtscale\dimen0\relax
- \dimen0=\@@rtfactor\dimen0\relax
- \multiply\dimen0 \@@rtnx\relax
- \dimen2=\@@rtdy\@@rtunit\relax
- \dimen2=\@@rtscale\dimen2\relax
- \dimen2=\@@rtfactor\dimen2\relax
- \multiply\dimen2 \@@rtny\relax
- \def\horline
- {\vbox
- {\hrule
- \!!width \dimen0
- \!!height \linewidth
- \!!depth \!!zeropoint}}%
- \def\verline%
- {\vrule
- \!!width \linewidth
- \!!height \dimen2
- \!!depth \!!zeropoint}%
- \doglobal\newcounter\@@gridc
- \doglobal\newcounter\@@gridd
- \doglobal\newcounter\@@gride
- \def\setlegend##1##2##3%
- {\gdef\@@gridc{0}%
- \dimen0=2em\relax
- \dimen2=##2\@@rtunit\relax
- \dimen2=\@@rtscale\dimen2\relax
- \dimen2=\@@rtfactor\dimen2\relax
- \divide\dimen0 \dimen2\relax
- \xdef\@@gride{\number\dimen0}%
- \ifnum\@@gride>50
- \gdef\@@gride{100}%
- \else\ifnum\@@gride>10
- \gdef\@@gride{50}%
- \else\ifnum\@@gride>5
- \gdef\@@gride{10}%
- \else\ifnum\@@gride>1
- \gdef\@@gride{5}%
- \else
- \gdef\@@gride{1}%
- \fi\fi\fi\fi
- \gdef\@@gridd{0}%
- \def\legend
- {\ifnum\@@gridd=\zerocount
- \vbox
- {\increment(\@@gridc,##1)%
- \hbox to 2em{\hss\@@gridc\hss}}%
- \global\let\@@gridd=\@@gride
- \fi
- \doglobal\decrement\@@gridd
- \doglobal\increment(\@@gridc,##1)}}%
- \def\draw##1##2##3##4##5##6##7##8##9%
- {\setuppositioning
- [\c!state=##8,
- \c!xstep=\v!absolute,
- \c!ystep=\v!absolute,
- \c!unit=\@@rtunit,
- \c!scale=\@@rtscale,
- \c!factor=\@@rtfactor,
- \c!offset=\@@rtoffset,
- \c!xoffset=##6,
- \c!yoffset=##7]%
- \doifelse{##9}\v!middle
- {\scratchdimen##3pt\scratchdimen.5\scratchdimen
- \edef\@@psxx{\withoutpt\the\scratchdimen}%
- \scratchdimen##4pt\scratchdimen.5\scratchdimen
- \edef\@@psyy{\withoutpt\the\scratchdimen}%
- \scratchcounter##2\advance\scratchcounter -1
- \edef\@@pszz{\the\scratchcounter}}
- {\edef\@@psxx{0}\edef\@@psyy{0}\edef\@@pszz{##2}}%
- \position(\@@psxx,\@@psyy){##1}%
- \setuppositioning
- [\c!state=##8,
- \c!xstep=\v!relative,
- \c!ystep=\v!relative,
- \c!scale=\@@rtscale,
- \c!factor=\@@rtfactor,
- \c!offset=\@@rtoffset,
- \c!unit=\@@rtunit]%
- \dorecurse\@@pszz{\position(##3,##4){##5}}}%
- \draw
- \verline\@@rtnx\@@rtdx0\verline\!!zeropoint\!!zeropoint\v!start\empty
- \draw
- \horline\@@rtny0\@@rtdy\horline\!!zeropoint\!!zeropoint\v!start\empty
- \tfx
- \doifnot\@@rtxstep{0}
- {\setlegend\@@rtxstep\@@rtdx\@@rtx
- \draw\legend\@@rtnx\@@rtdx0\legend{-1em}{-1.5em}\v!overlay\@@rtlocation}%
- \doifnot\@@rtystep{0}
- {\setlegend\@@rtystep\@@rtdy\@@rty
- \draw\legend\@@rtny0\@@rtdy\legend{-2em}{-.75ex}\v!overlay\@@rtlocation}%
- \stoppositioning
- \endgroup}
-
-\let\grid\basegrid
-
-% Dit wordt:
-%
-% \doorverwijzen[naam][instellingen] enz.
-%
-% waarbij <naam> bijvoorbeeld publicatie is. Dit levert:
-%
-% \start<naam>
-% \stop<naam>
-%
-% \beginvan<naam>
-% \eindvan<naam>
-%
-% \publicatie
-%
-% \volledigelijstmetpublicaties
-%
-% eigenlijk kan ook door... zo worden uitgebreid!
-
-% old, will become obsolete or module, replace by bib module
-
-% \defineenumeration
-% [@publicatie]
-% [\c!location=\v!left,
-% \c!width=\@@pbwidth,\c!hang=,\c!sample=,
-% \c!before=\@@pbbefore,\c!after=\@@pbafter,\c!inbetween=,
-% \c!headstyle=\@@pbheadstyle,\c!style=,
-% \c!headcolor=\@@pbheadcolor,\c!color=,
-% \c!way=\@@pbway,\c!blockway=\@@pbblockway,
-% \c!text=,\c!left=\@@pbleft,\c!right=\@@pbright]
-
-% \def\dosetuppublications[#1]%
-% {\getparameters[\??pb][#1]}
-%
-% \def\setuppublications%
-% {\dosingleargument\dosetuppublications}
-%
-% \def\apa@publicatie
-% {\doifsomething\@@pb@naam {\@@pb@naam,\space}%
-% \doifsomething\@@pb@titel {{\sl\@@pb@titel}.\space}%
-% \doifsomething\@@pb@jaar {(\@@pb@jaar).\space}%
-% \doifsomething\@@pb@plaats {\@@pb@plaats\doifelsenothing\@@pb@uitgever{.}{:\space}}%
-% \doifsomething\@@pb@uitgever{\@@pb@uitgever.}}
-%
-% \def\normaal@publicatie
-% {\@@pb@naam, \@@pb@titel, \@@pb@jaar, \@@pb@pagina, \@@pb@plaats, \@@pb@uitgever.}
-%
-% \def\complexstartpublicatie[#1]#2\stoppublicatie
-% {\bgroup
-% \def\dosetpublicatie
-% {\processcommalist
-% [naam,titel,jaar,plaats,pagina,uitgever]
-% \setpublicatie
-% \ignorespaces}%
-% \def\setpublicatie##1%
-% {\letvalue{\??pb @##1}\empty
-% \setvalue{##1}####1{\setvalue{\??pb @##1}{####1}\ignorespaces}}%
-% \def\getpublicatie%
-% {\doifsomething\@@pbalternative{\getvalue{\@@pbalternative @publicatie}}}%
-% \doifelse\@@pbnumbering\v!yes
-% {\@publicatie[#1]\dosetpublicatie#2\getpublicatie\par}%
-% {\@@pbbefore
-% \dosetpublicatie\ignorespaces#2\getpublicatie
-% \@@pbafter}%
-% \egroup}
-%
-% \definecomplexorsimpleempty\startpublicatie
-%
-% \def\publication#1[#2]%
-% {\@@pbleft\in{#1}[#2]\@@pbright}
-%
-% \setuppublications
-% [\c!numbering=\v!yes,
-% \c!alternative=\c!apa,
-% \c!width=2em,
-% \c!hang=,
-% \c!sample=,
-% \c!before=,
-% \c!after=,
-% \c!inbetween=,
-% \c!headstyle=,
-% \c!headcolor=,
-% \c!style=,
-% \c!color=,
-% \c!blockway=\v!by\v!text,
-% \c!way=\v!by\v!text,
-% \c!text=,
-% \c!left={[},
-% \c!right={]}]
-
-% only used at pragma, move from kernel to run time module
-
-\def\referraldate
- {\currentdate[\v!referral]}
-
-\def\doreferral[#1]%
- {\noheaderandfooterlines
- \bgroup
- \getparameters
- [\??km]
- [\c!bet=\unknown,\c!dat=\unknown,\c!ken=\unknown,
- \c!from=,\c!to=,\c!ref=,#1]%
- % moet anders, hoort niet in 01b
- \assigntranslation[\s!nl=referentie,\s!en=reference,\s!de=Referenz,\s!hr=referenca,\s!sp=referencia]\to\@@@kmref
- \assigntranslation[\s!nl=van,\s!en=from,\s!de=Von,\s!hr=od,\s!sp=de]\to\@@@kmvan
- \assigntranslation[\s!nl=aan,\s!en=to,\s!de=An,\s!hr=za,\s!sp=a]\to\@@@kmaan
- \assigntranslation[\s!nl=betreft,\s!en=concerns,\s!de=Betreff,\s!hr=predmet,\s!sp=]\to\@@@kmbet
- \assigntranslation[\s!nl=datum,\s!en=date,\s!de=Datum,\s!hr=datum,\s!sp=fecha]\to\@@@kmdat
- \assigntranslation[\s!nl=kenmerk,\s!en=mark,\s!de=Kennzeichen,\s!hr=oznaka,\s!sp=]\to\@@@kmken
- %
- \definetabulate[\s!dummy][|l|p|]
- \startdummy
- \NC\@@@kmbet\EQ\@@kmbet\NC\NR
- \NC\@@@kmdat\EQ\@@kmdat\NC\NR
- \NC\@@@kmken\EQ\expanded{\smallcapped{\@@kmken}}\NC\NR
- \doifsomething{\@@kmfrom\@@kmto}{\NC\NC\NC\NR}%
- \doifsomething \@@kmfrom {\NC\@@@kmvan\EQ\@@kmfrom\NC\NR}%
- \doifsomething \@@kmto {\NC\@@@kmaan\EQ\@@kmto\NC\NR}%
- \doifsomething \@@kmref {\NC\NC\NC\NR\NC\@@@kmref\EQ\@@kmref\NC\NR}%
- \stopdummy
- \egroup}
-
-\def\referral
- {\dosingleargument\doreferral}
-
-% FUZZY OLD STUFF: will be removed when not used in some manual;
-% rows instead of columns, i'd forgotten that this code exist
-%
-% \definesystemvariable{ri}
-%
-% \def\setuprows
-% {\dodoubleargument\getparameters[\??ri]}
-%
-% \definecomplexorsimpleempty\startrows
-%
-% \def\complexstartrows[#1]%
-% {\bgroup
-% \setuprows[#1]%
-% \let\do@@ribottom\relax
-% \def\row
-% {\do@@ribottom
-% \egroup
-% \dimen0\vsize
-% \divide\dimen0 \@@rin
-% \advance\dimen0 -\lineskip
-% \vbox to \dimen0
-% \bgroup
-% \@@ritop
-% \let\do@@ribottom\@@ribottom
-% \ignorespaces}%
-% \bgroup
-% \row}
-%
-% \def\stoprows
-% {\do@@ribottom
-% \egroup
-% \egroup}
-%
-% \setuprows
-% [\c!n=2,
-% \c!top=,
-% \c!bottom=\vfill]
-
-% THIS WAS MAIN-003.TEX
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-\definetabulate
- [\v!legend]
- [|emj1|i1|mR|]
-
-\setuptabulate
- [\v!legend]
- [\c!unit=.75em,\c!inner=\setquicktabulate\leg,EQ={=}]
-
-\definetabulate
- [\v!legend][\v!two]
- [|emj1|emk1|i1|mR|]
-
-\definetabulate
- [\v!fact]
- [|R|ecmj1|i1mR|]
-
-\setuptabulate
- [\v!fact]
- [\c!unit=.75em,\c!inner=\setquicktabulate\fact,EQ={=}]
-
-\unexpanded\def\xbox
- {\bgroup\aftergroup\egroup\hbox\bgroup\tx\let\next=}
-
-\unexpanded\def\xxbox
- {\bgroup\aftergroup\egroup\hbox\bgroup\txx\let\next=}
-
-% \def\mrm#1%
-% {$\rm#1$}
-
-%D \macros
-%D {definepairedbox, setuppairedbox, placepairedbox}
-%D
-%D Paired boxes, formally called legends, but from now on a
-%D legend is just an instance, are primarily meant for
-%D typesetting some text alongside an illustration. Although
-%D there is quite some variation possible, the functionality is
-%D kept simple, if only because in most cases such pairs are
-%D typeset sober.
-%D
-%D The location specification accepts a pair, where the first
-%D keyword specifies the arrangement, and the second one the
-%D alignment. The first key of the location pair is one of
-%D \type {left}, \type {right}, \type {top} or \type {bottom},
-%D while the second key can also be \type {middle}.
-%D
-%D The first box is just collected in an horizontal box, but
-%D the second one is a vertical box that gets passed the
-%D bodyfont and alignment settings.
-
-%D Today we would implement this using layers .... but for the
-%D moment we keep it this way.
-
-% \startbuffer[test]
-% \test left \test left,top \test left,bottom \test left,middle
-% \test right \test right,top \test right,bottom \test right,middle
-% \test top \test top,left \test top,right \test top,middle
-% \test bottom \test bottom,left \test bottom,right \test bottom,middle
-% \stopbuffer
-%
-% \def\showtest#1%
-% {\pagina
-% \typebuffer[demo]
-% \def\test##1
-% {\startlinecorrection[blank]
-% \getbuffer[demo]%
-% \ruledhbox\placelegend
-% [bodyfont=6pt,location={##1}]
-% {\framed[width=.25\textwidth]{\tttf##1}}
-% {#1}
-% \stoplinecorrection}
-% \getbuffer[test]}
-%
-% \startbuffer[demo]
-% \setuplegend
-% [width=\hsize,maxwidth=\makeupwidth,
-% height=\vsize,maxheight=\makeupheight]
-% \stopbuffer
-%
-% \showtest{These examples demonstrate the default settings.}
-%
-% \startbuffer[demo]
-% \setuplegend
-% [width=\textwidth,
-% maxwidth=\textwidth]
-% \stopbuffer
-%
-% \showtest{\input tufte }
-%
-% \startbuffer[demo]
-% \setuplegend
-% [width=.65\textwidth]
-% \stopbuffer
-%
-% \showtest{\input knuth }
-%
-% \startbuffer[demo]
-% \setuplegend
-% [height=2cm]
-% \stopbuffer
-%
-% \showtest{These examples demonstrate some other settings.}
-%
-% \startbuffer[demo]
-% \setuplegend
-% [width=.65\textwidth,
-% height=2cm]
-% \stopbuffer
-%
-% \showtest{These examples demonstrate some other settings.}
-%
-% \startbuffer[demo]
-% \setuplegend
-% [n=2,align=right,width=.5\textwidth]
-% \stopbuffer
-%
-% \showtest{\input zapf }
-
-%D \macros
-%D {setuplegend, placelegend}
-%D
-%D It makes sense to typeset a legend to a figure in \TEX\
-%D and not in a drawing package. The macro \type {\placelegend}
-%D combines a figure (or something else) and its legend. This
-%D command is just a paired box.
-%D
-%D The legend is placed according to \type {location}, being
-%D \type {bottom} or \type {right}. The macro macro is used as
-%D follows.
-%D
-%D \starttyping
-%D \placefigure
-%D {whow}
-%D {\placelegend
-%D {\externalfigure[cow]}
-%D {\starttabulation
-%D \NC 1 \NC head \NC \NR
-%D \NC 2 \NC legs \NC \NR
-%D \NC 3 \NC tail \NC \NR
-%D \stoptabulation}}
-%D
-%D \placefigure
-%D {whow}
-%D {\placelegend
-%D {\externalfigure[cow]}
-%D {\starttabulation[|l|l|l|l|]
-%D \NC 1 \NC head \NC 3 \NC tail \NC \NR
-%D \NC 2 \NC legs \NC \NC \NC \NR
-%D \stoptabulation}}
-%D
-%D \placefigure
-%D {whow}
-%D {\placelegend[n=2]
-%D {\externalfigure[cow]}
-%D {\starttabulation
-%D \NC 1 \NC head \NC \NR
-%D \NC 2 \NC legs \NC \NR
-%D \NC 3 \NC tail \NC \NR
-%D \stoptabulation}}
-%D
-%D \placefigure
-%D {whow}
-%D {\placelegend[n=2]
-%D {\externalfigure[cow]}
-%D {head \par legs \par tail}}
-%D
-%D \placefigure
-%D {whow}
-%D {\placelegend[n=2]
-%D {\externalfigure[cow]}
-%D {\startitemize[packed]
-%D \item head \item legs \item tail \item belly \item horns
-%D \stopitemize}}
-%D
-%D \placefigure
-%D {whow}
-%D {\placelegend[n=2,width=.8\hsize]
-%D {\externalfigure[cow]}
-%D {\startitemize[packed]
-%D \item head \item legs \item tail \item belly \item horns
-%D \stopitemize}}
-%D \stoptyping
-
-\newbox\firstpairedbox
-\newbox\secondpairedbox
-
-\def\definepairedbox
- {\dodoubleempty\dodefinepairedbox}
-
-\def\dodefinepairedbox[#1][#2]%
- {\getparameters
- [\??ld#1]
- [\c!n=1,
- \c!distance=\bodyfontsize,
- \c!before=,
- \c!after=,
- \c!color=,
- \c!style=,
- \c!inbetween={\blank[\v!medium]},
- \c!width=\hsize,
- \c!height=\vsize,
- \c!maxwidth=\textwidth, % \makeupwidth,
- \c!maxheight=\textheight, % \makeupheight,
- \c!bodyfont=,
- \c!align=,
- \c!location=\v!bottom,
- #2]%
- \setvalue{\e!setup#1\e!endsetup}{\setuppairedbox[#1]}%
- \setvalue{\e!place#1}{\placepairedbox[#1]}}
-
-\def\setuppairedbox
- {\dodoubleempty\dosetuppairedbox}
-
-\def\dosetuppairedbox[#1]%
- {\getparameters[\??ld#1]}
-
-\def\placepairedbox
- {\bgroup\dodoubleempty\doplacepairedbox}
-
-\def\doplacepairedbox[#1][#2]% watch the hsize/vsize tricks
- {\setuppairedbox[#1][#2]% % and don't change them
- \copyparameters % brrr
- [\??ld][\??ld#1]
- [\c!n,\c!distance,\c!inbetween,\c!before,\c!after,
- \c!width,\c!height,\c!maxwidth,\c!maxheight,
- \c!color,\c!style,\c!bodyfont,\c!align,\c!location]%
- \@@ldbefore\bgroup
- \global\setsystemmode{pairedbox}%
- \beforefirstpairedbox
- \dowithnextbox
- {\betweenbothpairedboxes
- \dowithnextbox
- {\afterbothpairedboxes
- \egroup\@@ldafter
- \egroup}
- \vbox\bgroup
- \insidesecondpairedbox
- \let\next=}
- \hbox}
-
-\def\beforefirstpairedbox
- {\chardef\pairedlocationa1 % left
- \chardef\pairedlocationb4 % middle
- \getfromcommacommand[\@@ldlocation][1]%
- \processaction
- [\commalistelement]
- [ \v!left=>\chardef\pairedlocationa0,
- \v!right=>\chardef\pairedlocationa1,
- \v!top=>\chardef\pairedlocationa2,
- \v!bottom=>\chardef\pairedlocationa3]%
- \getfromcommacommand[\@@ldlocation][2]%
- \processaction
- [\commalistelement]
- [ \v!left=>\chardef\pairedlocationb0,
- \v!right=>\chardef\pairedlocationb1,
- \v!high=>\chardef\pairedlocationb2,
- \v!top=>\chardef\pairedlocationb2,
- \v!low=>\chardef\pairedlocationb3,
- \v!bottom=>\chardef\pairedlocationb3,
- \v!middle=>\chardef\pairedlocationb4]}
-
-\def\betweenbothpairedboxes
- {\switchtobodyfont[\@@ldbodyfont]% split under same regime
- \setbox\firstpairedbox\flushnextbox
- \ifnum\pairedlocationa<2
- \hsize\wd\firstpairedbox % trick
- \hsize\@@ldwidth
- \scratchdimen\wd\firstpairedbox
- \advance\scratchdimen \@@lddistance
- \bgroup\advance\scratchdimen \hsize
- \ifdim\scratchdimen>\@@ldmaxwidth\relax
- \egroup
- \hsize\@@ldmaxwidth
- \advance\hsize -\scratchdimen
- \else
- \egroup
- \fi
- \else
- \hsize\wd\firstpairedbox
- \hsize\@@ldwidth % can be \hsize
- \ifdim\hsize>\@@ldmaxwidth\relax \hsize\@@ldmaxwidth \fi % can be \hsize
- \fi
- \ifnum\@@ldn>\plusone
- \setrigidcolumnhsize\hsize\@@lddistance\@@ldn
- \fi}
-
-\def\afterbothpairedboxes
- {\setbox\secondpairedbox\vbox
- {% \localstartcolor[\@@ldcolor]% does not work yet
- \ifnum\@@ldn>1
- \rigidcolumnbalance\nextbox
- \else
- \flushnextbox
- \fi
- }% \localstopcolor}%
- \ifnum\pairedlocationa<2\hbox\else\vbox\fi\bgroup % hide vsize
- \forgetall
- \ifnum\pairedlocationa<2
- \scratchdimen\maxoftwoboxdimens\ht\firstpairedbox\secondpairedbox
- \vsize\scratchdimen
- \ifdim\scratchdimen<\@@ldheight\relax % can be \vsize
- \scratchdimen\@@ldheight
- \fi
- \ifdim\scratchdimen>\@@ldmaxheight\relax
- \scratchdimen\@@ldmaxheight
- \fi
- \valignpairedbox\firstpairedbox \scratchdimen
- \valignpairedbox\secondpairedbox\scratchdimen
- \else
- \scratchdimen\maxoftwoboxdimens\wd\firstpairedbox\secondpairedbox
- \halignpairedbox\firstpairedbox \scratchdimen
- \halignpairedbox\secondpairedbox\scratchdimen
- \scratchdimen\ht\secondpairedbox
- \vsize\scratchdimen
- \ifdim\ht\secondpairedbox<\@@ldheight\relax % can be \vsize
- \scratchdimen\@@ldheight\relax % \relax needed
- \fi
- \ifdim\scratchdimen>\@@ldmaxheight\relax % todo: totale hoogte
- \scratchdimen\@@ldmaxheight\relax % \relax needed
- \fi
- \ifdim\scratchdimen>\ht\secondpairedbox
- \setbox\secondpairedbox\vbox to \scratchdimen
- {\ifnum\pairedlocationa=3 \vss\fi %
- \box\secondpairedbox
- \ifnum\pairedlocationa=2 \vss\fi}% \kern\zeropoint
- \fi
- \fi
- \ifcase\pairedlocationa
- \box\secondpairedbox\hskip\@@lddistance\box\firstpairedbox \or
- \box\firstpairedbox \hskip\@@lddistance\box\secondpairedbox\or
- \box\secondpairedbox\endgraf \nointerlineskip \@@ldinbetween \box\firstpairedbox \or
- \box\firstpairedbox \endgraf \nointerlineskip \@@ldinbetween \box\secondpairedbox\else
- \fi
- \egroup}
-
-\def\insidesecondpairedbox
- {\forgetall
- \setupalign[\@@ldalign]%
- \tolerantTABLEbreaktrue % hm.
- \blank[\v!disable]%
- \everypar{\begstrut}}
-
-\def\maxoftwoboxdimens#1#2#3%
- {#1\ifdim#1#2>#1#3 #2\else#3\fi}
-
-\def\valignpairedbox#1#2%
- {\setbox#1\vbox to #2
- {\ifcase\pairedlocationb\or\or\or\vss\or\vss\fi
- \box#1\relax
- \ifcase\pairedlocationb\or\or\vss\or\or\vss\fi}}
-
-\def\halignpairedbox#1#2%
- {\setbox#1\hbox to #2
- {\ifcase\pairedlocationb\or\hss\or\or\or\hss\fi
- \box#1\relax
- \ifcase\pairedlocationb\hss\or\or\or\or\hss\fi}}
-
-\definepairedbox[\v!legend]
-
-%D Goody:
-
-\appendtoks
- \global\resetsystemmode{combination}%
- \global\resetsystemmode{pairedbox}%
-\to \everyinsidefloat
-
-% todo: \startcombination \startcomb \stopcomb ...
-
-\newcount\horcombination % counter
-\newcount\totcombination
-
-\def\definecombination
- {\dodoubleempty\dodefinecombination}
-
-\def\dodefinecombination[#1][#2]%
- {\copyparameters
- [\??co#1][\??co]
- [\c!width,\c!height,\c!distance,\c!location,%
- \c!before,\c!inbetween,\c!after,\c!align,%
- \c!style,\c!color]%
- \getparameters
- [\??co#1][#2]}
-
-\def\setupcombinations
- {\dodoubleempty\dosetupcombinations}
-
-\def\dosetupcombinations[#1][#2]%
- {\ifsecondargument
- \getparameters[\??co#1][#2]%
- \else
- \getparameters[\??co][#1]%
- \fi}
-
-\def\combinationparameter#1%
- {\csname\??co\currentcombination#1\endcsname}%
-
-\def\startcombination
- {\bgroup % so we can grab a group
- \dodoubleempty\dostartcombination}
-
-% \startcombination {alpha} {a} {beta} {b} \stopcombination
-% \startcombination[2*1] {alpha} {a} {beta} {b} \stopcombination
-% \startcombination[1*2] {alpha} {a} {beta} {b} \stopcombination
-% \startcombination[2] {alpha} {a} {beta} {b} \stopcombination
-
-\def\dostartcombination[#1][#2]%
- {\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 % better : \doifcombinationelse ... \??co#1\c!location
- \doifinstringelse{*}{#1}
- {\let\currentcombination\empty
- \edef\currentcombinationspec{#1*1*}}
- {\doifnumberelse{#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
- \expanded{\dodostartcombination[\currentcombinationspec]}}
-
-\long\def\dodostartcombination[#1*#2*#3]%
- {\setuphorizontaldivision
- [\c!n=\v!fit,\c!distance=\combinationparameter\c!distance]%
- \global\horcombination#1%
- \global\totcombination#2%
- \global\setbox\combinationstack\emptybox
- \xdef\maxhorcombination{\the\horcombination}%
- \multiply\totcombination\horcombination
- \tabskip\zeropoint
- \doifelse{\combinationparameter\c!width}\v!fit
- {\halign}{\halign to \combinationparameter\c!width}%
- \bgroup&%
- %\hfil##\hfil% now : location={left,top}
- \expanded{\doifnotinset{\v!left}{\combinationparameter\c!location}}\hfil
- ##%
- \expanded{\doifnotinset{\v!right}{\combinationparameter\c!location}}\hfil
- &\tabskip\zeropoint \!!plus 1fill##\cr
- \docombination}
-
-\def\docombination % we want to add struts but still ignore an empty box
- {\dowithnextbox
- {\setbox0\flushnextbox
- \dowithnextbox
- {\setbox2\flushnextbox
- \dodocombination}%
- \vtop\bgroup
- \def\next
- {\futurelet\nexttoken\nextnext}%
- \def\nextnext
- {\ifx\nexttoken\egroup \else % the next box is empty
- \hsize\wd0
- \setupalign[\combinationparameter\c!align]%
- \dostartattributes{\??co\currentcombination}\c!style\c!color\empty
- \bgroup
- \aftergroup\endstrut
- \aftergroup\dostopattributes
- \aftergroup\egroup
- \begstrut
- \fi}%
- \afterassignment\next\let\nexttoken=}
- \hbox}
-
-% stupid version, does not align top stuff when captions,
-% keep as example
-%
-% \def\dodocombination
-% {\vbox
-% {\forgetall % \setupwhitespace[\v!none]%
-% \let\next\vbox
-% \ExpandFirstAfter\processallactionsinset
-% [\combinationparameter\c!location]
-% [ \v!top=>\let\next\tbox,
-% \v!middle=>\let\next\halfwaybox]%
-% \next{\copy0}%
-% \ifdim\ht2>\zeropoint % beter dan \wd2, nu \strut mogelijk
-% \combinationparameter\c!inbetween
-% %\vtop % wrong code
-% % {\nointerlineskip % recently added
-% % \hsize\wd0
-% % \setupalign[\combinationparameter\c!align]% % \raggedcenter
-% % \begstrut\unhbox2\endstrut}%
-% \box2
-% \fi}%
-% \ifnum\totcombination>\plusone
-% \global\advance\totcombination\minusone
-% \global\advance\horcombination\minusone
-% \ifnum\horcombination=\zerocount
-% \def\next
-% {\cr\noalign
-% {\forgetall % \setupwhitespace[\v!geen]% no
-% \nointerlineskip
-% \combinationparameter\c!before
-% \combinationparameter\c!after
-% \vss
-% \nointerlineskip}%
-% \global\horcombination\maxhorcombination\relax
-% \docombination}%
-% \else
-% \def\next
-% {&&&\hskip\combinationparameter\c!distance&\docombination}%
-% \fi
-% \else
-% \def\next
-% {\cr\egroup}%
-% \fi
-% \next}
-
-% \def\dodocombination
-% {\vbox
-% {\forgetall % \setupwhitespace[\v!none]%
-% \let\next\vbox
-% \ExpandFirstAfter\processallactionsinset
-% [\combinationparameter\c!plaats]
-% [ \v!top=>\let\next\tbox,
-% \v!middle=>\let\next\halfwaybox]%
-% \next{\copy0}%
-% % we need to save the caption for a next alignment line
-% \saveoncombinationstack2}%
-% \ifnum\totcombination>\plusone
-% \global\advance\totcombination\minusone
-% \global\advance\horcombination\minusone
-% \ifnum\horcombination=\zerocount
-% \def\next
-% {\cr
-% \flushcombinationstack
-% \noalign
-% {\forgetall % \setupwhitespace[\v!none]% no
-% \global\setbox\combinationstack\emptybox
-% \nointerlineskip
-% \combinationparameter\c!after
-% \combinationparameter\c!before
-% \vss
-% \nointerlineskip}%
-% \global\horcombination\maxhorcombination\relax
-% \docombination}%
-% \else
-% \def\next
-% {&&&\hskip\combinationparameter\c!distance&\docombination}%
-% \fi
-% \else
-% \def\next
-% {\cr
-% \flushcombinationstack
-% \egroup}%
-% \fi
-% \next}
-
-\def\depthonlybox
- {\dowithnextbox{\vtop{\hsize\wd\nextbox\kern\zeropoint\box\nextbox}}\vbox}
-
-% \def\boxwithstrutheight
-% {\dowithnextbox
-% {\scratchdimen\strutheight
-% \advance\scratchdimen-\nextboxht
-% \hbox{\raise\scratchdimen\box\nextbox}}%
-% \vbox}
-
-\def\dodocombination
- {\vbox
- {\forgetall % \setupwhitespace[\v!none]%
- \let\next\vbox
- \expanded{\processallactionsinset[\combinationparameter\c!location]}
- [ \v!top=>\let\next\depthonlybox, % \tbox,
- \v!middle=>\let\next\halfwaybox]%
- \next{\copy0}%
- % we need to save the caption for a next alignment line
- \saveoncombinationstack2}%
- \ifnum\totcombination>\plusone
- \global\advance\totcombination\minusone
- \global\advance\horcombination\minusone
- \ifnum\horcombination=\zerocount
- \def\next
- {\cr
- \flushcombinationstack
- \noalign
- {\forgetall % \setupwhitespace[\v!none]% no
- \global\setbox\combinationstack\emptybox
- \nointerlineskip
- \combinationparameter\c!after
- \combinationparameter\c!before
- \vss
- \nointerlineskip}%
- \global\horcombination\maxhorcombination\relax
- \docombination}%
- \else
- \def\next
- {&&&\hskip\combinationparameter\c!distance&\docombination}%
- \fi
- \else
- \def\next
- {\cr
- \flushcombinationstack
- \egroup}%
- \fi
- \next}
-
-% formally ok:
-%
-% \def\stopcombination
-% {\egroup
-% \egroup}
-%
-% more robust:
-%
-% \def\stopcombination
-% {{}{}{}{}{}{}{}{}% catches (at most 4) missing entries
-% \egroup
-% \egroup}
-%
-% even better:
-
-\def\stopcombination
- {{\scratchtoks{{}{}{}}\dorecurse\totcombination{\appendtoks{}{}{}{}\to\scratchtoks}\expandafter}\the\scratchtoks
- \egroup
- \egroup}
-
-\newbox\combinationstack
-
-\def\saveoncombinationstack#1%
- {\global\setbox\combinationstack\hbox
- {\hbox{\box#1}\unhbox\combinationstack}}
-
-\def\flushcombinationstack
- {\noalign
- {\ifdim\ht\combinationstack>\zeropoint
-\nointerlineskip % nieuw
- \combinationparameter\c!inbetween
- \global\horcombination\maxhorcombination
- \globallet\doflushcombinationstack\dodoflushcombinationstack
- \else
- \global\setbox\combinationstack\emptybox
- \globallet\doflushcombinationstack\donothing
- \fi}%
- \doflushcombinationstack\crcr}
-
-\gdef\dodoflushcombinationstack
- {\global\setbox\combinationstack\hbox
- {\unhbox\combinationstack
- \global\setbox1\lastbox}%
- \box1% \ruledhbox{\box1}%
- \global\advance\horcombination\minusone\relax
- \ifnum\horcombination>\zerocount
- \def\next{&&&&\doflushcombinationstack}%
- \else
- \global\setbox\combinationstack\emptybox
- %\let\next\relax
- \@EA\gobbleoneargument
- \fi
- \next}
-
-\setupcombinations
- [\c!width=\v!fit,
- \c!height=\v!fit,
- \c!distance=1em,
- \c!location=\v!bottom, % can be something {top,left}
- \c!before=\blank,
- \c!inbetween={\blank[\v!medium]},
- \c!style=,
- \c!color=,
- \c!after=,
- \c!align=\v!middle]
-
-%D \macros
-%D {startfloatcombination}
-%D
-%D \setupexternalfigures[directory={../sample}]
-%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}}
-
-\def\placerelativetoeachother#1#2%
- {\bgroup
- \dowithnextbox
- {\bgroup
- \setbox0\box\nextbox
- \dowithnextbox
- {\setbox2\box\nextbox
- #1{#2#########2\cr\box0\cr\box2\cr}
- \egroup
- \egroup}
- \hbox}
- \hbox}
-
-\def\placeontopofeachother{\placerelativetoeachother\halign\hss}
-\def\placesidebyside {\placerelativetoeachother\valign\vss}
-
-% this will be replaced or go away, never used
-
-\def\douseexternalfiles[#1][#2]%
- {\getparameters
- [\??fi#1]
- [\c!file=,
- \c!bodyfont=,
- \c!option=,
- #2]}
-
-\def\useexternalfiles
- {\dodoubleargument\douseexternalfiles}
-
-\def\dostelexternefilesin[#1][#2]%
- {\doifundefinedelse{\??fi#1\c!file}
- {\useexternalfiles[#1][#2]}
- {\getparameters[\??fi#1][#2]}}
-
-\def\stelexternefilesin
- {\dodoubleargument\dostelexternefilesin}
-
-\def\verwerkexternefile#1#2#3%
- {\bgroup
- \getparameters[\??fi#1][\c!file=,#3]%
- \doinputonce{\getvalue{\??fi#1\c!file}}%
- \ExpandFirstAfter\switchtobodyfont[\getvalue{\??fi#1\c!bodyfont}]%
- \readsysfile{#2} % beter: loc of fix gebied
- \donothing
- {\showmessage\m!systems{41}{#2,#1}}%
- \egroup}
-
-\def\douseexternalfile[#1][#2][#3][#4]%
- {\stelexternefilesin[#1][]%
- \doinputonce{\getvalue{\??fi#1\c!file}}%
- \doifelsenothing{#2}
- {\setvalue{#3}{\verwerkexternefile{#1}{#3}{#4}}}
- {\setvalue{#2}{\verwerkexternefile{#1}{#3}{#4}}}}
-
-\def\useexternalfile
- {\doquadrupleargument\douseexternalfile}
-
-\useexternalfiles
- [pictex]
- [\c!bodyfont=\v!small,
- \c!file=pictex]
-
-\useexternalfiles
- [table]
- [\c!file=table]
-
-%D A couple of examples, demonstrating how the depth is
-%D taken care of:
-%D
-%D \startbuffer
-%D test\rotate[frame=on, rotation=0] {gans}%
-%D test\rotate[frame=on, rotation=90] {gans}%
-%D test\rotate[frame=on, rotation=180]{gans}%
-%D test\rotate[frame=on, rotation=270]{gans}%
-%D test
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-
-% When we rotate over arbitrary angles, we need to relocate the
-% resulting box because rotation brings that box onto the negative
-% axis. The calculations (mostly sin and cosine) need to be tuned for
-% the way a box is packages (i.e. the refence point). A typical example
-% of drawing, scribbling, and going back to the days of school math.
-%
-% We do a bit more calculations than needed, simply because that way
-% it's easier to debug the code.
-
-\def\dododorotatenextbox
- {\setbox\nextbox\vbox to \@@layerysiz
- {\vfill
- \hbox to \@@layerxsiz
- {\dostartrotation\@@rorotation
- \nextboxwd\zeropoint
- \nextboxht\zeropoint
- \flushnextbox
- \dostoprotation
- \hfill}%
- \kern\@@layerypos}%
- \setbox\nextbox\hbox
- {\kern\@@layerxpos
- \kern\@@layerxoff
- \lower\@@layeryoff\flushnextbox}}
-
-\def\dodorotatenextbox#1#2% quite some trial and error -)
- {\dontshowcomposition
- \dontcomplain
- \ifnum#2=\plusfour
- % new, location=middle
- \!!widthb \nextboxwd
- \!!heightb\nextboxht
- \!!depthb \nextboxdp
- \setbox\nextbox\vbox{\vskip.5\nextboxht\hskip-.5\nextboxwd\flushnextbox}%
- \smashbox\nextbox
- \fi
- \!!widtha \nextboxwd
- \!!heighta\nextboxht
- \!!deptha \nextboxdp
- \!!doneafalse
- \!!donebfalse
- \ifcase#2\or
- % 1: fit
- \or
- % 2: depth, not fit
- \!!doneatrue
- \!!donebtrue
- \or
- % 3: depth, fit
- \!!donebtrue
- \fi
- \setbox\nextbox\vbox{\hbox{\raise\nextboxdp\flushnextbox}}%
- \!!dimena \nextboxht
- \setcalculatedcos\cos\@@rorotation
- \setcalculatedsin\sin\@@rorotation
- \@@layerxpos\zeropoint
- \@@layerypos\zeropoint
- \@@layerxoff\zeropoint
- \@@layeryoff\zeropoint
- \ifdim\sin\points>\zeropoint
- \ifdim\cos\points>\zeropoint
- \@@layerxsiz \cos\!!widtha
- \@@layerysiz \sin\!!widtha
- \advance\@@layerxsiz \sin\!!dimena
- \advance\@@layerysiz \cos\!!dimena
- \@@layerypos \cos\!!dimena
- \if!!donea
- \@@layerxoff \negated\sin\!!dimena
- \advance\@@layerxoff \sin\!!deptha
- \fi
- \if!!doneb
- \@@layeryoff \cos\!!deptha
- \fi
- \dododorotatenextbox
- \else
- \@@layerxsiz \negated\cos\!!widtha
- \@@layerysiz \sin\!!widtha
- \advance\@@layerxsiz \sin\!!dimena
- \advance\@@layerysiz \negated\cos\!!dimena
- \@@layerxpos \negated\cos\!!widtha
- \if!!donea
- \@@layerxoff -\@@layerxsiz
- \advance\@@layerxoff \sin\!!deptha
- \fi
- \if!!doneb
- \@@layeryoff \negated\cos\!!heighta
- \fi
- \dododorotatenextbox
- \wd\nextbox\if!!donea\sin\!!deptha\else\@@layerxsiz\fi
- \fi
- \else
- \ifdim\cos\points<\zeropoint
- \@@layerxsiz \negated\cos\!!widtha
- \@@layerysiz \negated\sin\!!widtha
- \advance\@@layerxsiz \negated\sin\!!dimena
- \advance\@@layerysiz \negated\cos\!!dimena
- \@@layerxpos \@@layerxsiz
- \@@layerypos \negated\sin\!!widtha
- \if!!donea
- \@@layerxoff -\@@layerxsiz
- \advance\@@layerxoff \negated\sin\!!heighta
- \fi
- \if!!doneb
- \@@layeryoff \@@layerysiz
- \advance\@@layeryoff \cos\!!deptha
- \fi
- \dododorotatenextbox
- \wd\nextbox\if!!donea\negated\sin\!!heighta\else\@@layerxsiz\fi
- \else
- \@@layerxsiz \cos\!!widtha
- \@@layerysiz \negated\sin\!!widtha
- \advance\@@layerxsiz \negated\sin\!!dimena
- \advance\@@layerysiz \cos\!!dimena
- \ifdim\sin\points=\zeropoint
- \@@layerxpos \zeropoint
- \@@layerxoff \zeropoint
- \@@layerypos \@@layerysiz
- \if!!doneb
- \@@layeryoff \!!deptha
- \fi
- \else
- \@@layerypos \@@layerysiz
- \@@layerxpos \negated\sin\!!dimena
- \if!!donea
- \@@layerxoff -\@@layerxsiz
- \advance\@@layerxoff \negated\sin\!!heighta
- \fi
- \if!!doneb
- \@@layeryoff \negated\sin\!!deptha
- \fi
- \fi
- \dododorotatenextbox
- \ifdim\sin\points=\zeropoint
- \else
- \wd\nextbox\if!!donea\negated\sin\!!heighta\else\@@layerxsiz\fi
- \fi
- \fi
- \fi
- % new, location=middle
- \ifnum#2=\plusfour
- \setbox\nextbox\vbox{\vskip-.5\!!heightb\hskip.5\!!heightb\flushnextbox}%
- \nextboxwd\!!widthb
- \nextboxht\!!heightb
- \nextboxdp\!!depthb
- \fi}
-
-\def\dorotatenextbox#1#2%
- {\doifsomething{#1}
- {\edef\@@rorotation{\realnumber{#1}}% get rid of leading zeros and spaces
- \setbox\nextbox\vbox{\flushnextbox}% not really needed
- \dodorotatenextbox\@@rorotation#2}%
- \hbox{\boxcursor\flushnextbox}}
-
-\def\dodorotatebox#1% {angle} \hbox/\vbox/\vtop
- {\bgroup\hbox\bgroup % compatibility hack
- \dowithnextbox
- {\dorotatenextbox{#1}\plusone
- \egroup\egroup}}
-
-\def\dorotatebox#1% {angle} \hbox/\vbox/\vtop
- {\ifcase#1\relax
- \expandafter\gobbleoneargument
- \else
- \expandafter\dodorotatebox
- \fi{#1}}
-
-\unexpanded\def\rotate % \bgroup: \rotate kan argument zijn
- {\bgroup\complexorsimpleempty\rotate}
-
-% \def\complexrotate[#1]% framed met diepte !
-% {\getparameters[\??ro][#1]%
-% \processaction
-% [\@@rolocation]
-% [ \v!depth=>\!!counta\plusthree\donefalse,% depth fit - raw box
-% \v!fit=>\!!counta\plustwo \donefalse,% depth tight - raw box
-% \v!broad=>\!!counta\plusone \donefalse,% nodepth fit - raw box
-% \v!high=>\!!counta\plusone \donetrue ,% nodepth fit - framed
-% \v!middle=>\!!counta\plusfour \donefalse,% centered, keep dimensions
-% \s!default=>\!!counta\plusthree\donetrue ,% depth fit - framed
-% \s!unknown=>\!!counta\plusthree\donetrue ]% depth fit - framed
-% \ifdone
-% \def\docommand{\localframed[\??ro][#1,\c!location=]}%
-% \else
-% \let\docommand\relax
-% \fi
-% \dowithnextbox{\dorotatenextbox\@@rorotation\!!counta\egroup}\vbox\docommand}
-
-\setvalue{\??ro::\c!location::\v!depth }{\!!counta\plusthree\donefalse} % depth fit - raw box
-\setvalue{\??ro::\c!location::\v!fit }{\!!counta\plustwo \donefalse} % depth tight - raw box
-\setvalue{\??ro::\c!location::\v!broad }{\!!counta\plusone \donefalse} % nodepth fit - raw box
-\setvalue{\??ro::\c!location::\v!high }{\!!counta\plusone \donetrue } % nodepth fit - framed
-\setvalue{\??ro::\c!location::\v!middle }{\!!counta\plusfour \donefalse} % centered, keep dimensions
-\setvalue{\??ro::\c!location::\v!default}{\!!counta\plusthree\donetrue } % depth fit - framed
-
-\def\complexrotate[#1]% framed met diepte !
- {\getparameters[\??ro][#1]%
- \executeifdefined{\??ro::\c!location::\@@rolocation}{\!!counta\plusthree\donetrue}%
- \ifdone
- \def\docommand{\localframed[\??ro][#1,\c!location=]}%
- \else
- \let\docommand\relax
- \fi
- \dowithnextbox{\dorotatenextbox\@@rorotation\!!counta\egroup}\vbox\docommand}
-
-\presetlocalframed[\??ro]
-
-\def\setuprotate
- {\dodoubleargument\getparameters[\??ro]}
-
-\setuprotate
- [\c!rotation=90,
- \c!location=\v!normal,
- \c!width=\v!fit,
- \c!height=\v!fit,
- \c!offset=\v!overlay,
- \c!frame=\v!off]
-
-% \dostepwiserecurse{0}{360}{10}
-% {\startlinecorrection[blank]
-% \hbox
-% {\expanded{\setuprotate[rotation=\recurselevel]}%
-% \traceboxplacementtrue
-% \hbox to .2\hsize{\hss\ruledhbox{\rotate[location=depth] {\ruledhbox{\bfb (depth)}}}}%
-% \hbox to .2\hsize{\hss\ruledhbox{\rotate[location=fit] {\ruledhbox{\bfb (fit)}}}}%
-% \hbox to .2\hsize{\hss\ruledhbox{\rotate[location=broad] {\ruledhbox{\bfb (broad)}}}}%
-% \hbox to .2\hsize{\hss\ruledhbox{\rotate[location=normal]{\ruledhbox{\bfb (normal)}}}}%
-% \hbox to .2\hsize{\hss\ruledhbox{\rotate[location=high] {\ruledhbox{\bfb (high)}}}}}
-% \stoplinecorrection}
-
-% to be used in some other places! todo!
-%
-% divides \hsize in fractions, will be made a bit more
-% clever and advanced when needed
-%
-% \horizontaldivision[n/m,elements,distance]
-%
-% \horizontaldivision[2/5,3,1em]
-% \horizontaldivision[2/5,3,1em]
-% \horizontaldivision[1/5,3,1em]
-%
-% \setuphorizontaldivision[afstand=,aantal=] (passend,passend)
-
-\def\??fr{@@fr}
-
-\def\setuphorizontaldivision
- {\dodoubleargument\getparameters[\??fr]}
-
-\def\horizontaldivision
- {\dosingleargument\dohorizontaldivision}
-
-\def\dohorizontaldivision[#1]%
- {\dodohorizontaldivision[#1,,,,,,]}
-
-\def\dodohorizontaldivision[#1/#2,#3,#4,#5]%
- {\doifelsenothing{#3}
- {\doifelse\@@frn\v!fit
- {\!!counta#2\relax}
- {\!!counta\@@frn\relax}}
- {\!!counta#3\relax}%
- \doifelsenothing{#4}
- {\doifelse\@@frdistance\v!fit
- {\!!widtha\zeropoint}
- {\!!widtha\@@frdistance}}
- {\!!widtha#4}%
- \advance\!!counta \minusone
- \multiply\!!widtha \!!counta
- \advance\hsize -\!!widtha
- \divide\hsize #2\relax
- \hsize#1\hsize}
-
-\setuphorizontaldivision
- [\c!distance=\tfskipsize,
- \c!n=\v!fit]
-
-%D This one is for Daniel Pittman, who wanted tight
-%D fractions. We show three versions. First the simple
-%D one using \type {\low} and \type {high}:
-%D
-%D \startbuffer
-%D \def\vfrac#1#2%
-%D {\hbox{\high{\tx#1\kern-.25em}/\low{\kern-.25em\tx#2}}}
-%D
-%D test \vfrac{1}{2} test \vfrac{123}{456} test
-%D \stopbuffer
-%D
-%D \typebuffer {\showmakeup\getbuffer}
-%D
-%D A better way to handle the kerning is the following, here
-%D we kind of assume that tye slash is symmetrical and has
-%D nearly zero width.
-%D
-%D \startbuffer
-%D \def\vfract#1#2%
-%D {\hbox{\high{\tx#1}\hbox to \zeropoint{\hss/\hss}\low{\tx#2}}}
-%D \stopbuffer
-%D
-%D \typebuffer {\showmakeup\getbuffer}
-%D
-%D The third and best alternative is the following:
-%D
-%D {\showmakeup\getbuffer}\crlf\getbuffer
-%D
-%D This time we measure the height of the \type {/} and
-%D shift over the maximum height and depths of this
-%D character and the fractional digits (we use 57 as
-%D sample). Here we combine all methods in one macros.
-
-\chardef\vulgarfractionmethod=3
-
-\definehspace[vulgarfraction][.25em] % [.15em]
-\definesymbol[vulgarfraction][/] % [\raise.2ex\hbox{/}]
-
-\unexpanded\def\vulgarfraction#1#2%
- {\dontleavehmode
- \hbox
- {\def\vulgarfraction{vulgarfraction}%
- \ifcase\vulgarfractionmethod
- #1\symbol[\vulgarfraction]#2%
- \or
- \high{\tx#1\kern-\hspaceamount\empty\vulgarfraction}%
- \symbol[\vulgarfraction]%
- \low {\kern-\hspaceamount\empty\vulgarfraction\tx#2}%
- \or
- \high{\tx#1}%
- \hbox to \zeropoint{\hss\symbol[\vulgarfraction]\hss}%
- \low{\tx#2}%
- \or
- \setbox0\hbox{\symbol[\vulgarfraction]}%
- \setbox2\hbox{\txx57}%
- \raise\ht0\hbox{\lower\ht2\hbox{\txx#1}}%
- \hbox to \zeropoint{\hss\symbol[\vulgarfraction]\hss}%
- \lower\dp0\hbox{\raise\dp2\hbox{\txx#2}}%
- \fi}}
-
-\ifx\vfrac\undefined \let\vfrac\vulgarfraction \fi
-
-%D \starttabulate
-%D \HL
-%D \NC \bf method \NC \bf visualization \NC\NR
-%D \HL
-%D \NC 0 \NC \chardef\vulgarfractionmethod0\vulgarfraction{1}{2} \NC\NR
-%D \NC 1 \NC \chardef\vulgarfractionmethod1\vulgarfraction{1}{2} \NC\NR
-%D \NC 2 \NC \chardef\vulgarfractionmethod2\vulgarfraction{1}{2} \NC\NR
-%D \NC 3 \NC \chardef\vulgarfractionmethod3\vulgarfraction{1}{2} \NC\NR
-%D \HL
-%D \stoptabulate
-
-%D Under construction:
-%D
-%D \starttyping
-%D \commalistsentence[aap,noot,mies]
-%D \commalistsentence[aap,noot]
-%D \commalistsentence[aap]
-%D \commalistsentence[a,b,c]
-%D \commalistsentence[a,b,c][{ \& },{ and }]
-%D \commalistsentence[a,b,c][+,-]
-%D \stoptyping
-
-\let\handlecommalistsentence\firstofoneargument
-
-\def\commalistsentenceone{and-1}
-\def\commalistsentencetwo{and-2}
-
-\def\commalistsentence
- {\dodoubleempty\docommalistsentence}
-
-\def\docommalistsentence[#1][#2]%
- {\bgroup
- \getfromcommalist[#2][1]%
- \ifx\commalistelement\empty
- \def\@@commalistsentenceone{\labeltext\commalistsentenceone}%
- \else
- \let\@@commalistsentenceone\commalistelement
- \fi
- \getfromcommalist[#2][2]%
- \ifx\commalistelement\empty
- \def\@@commalistsentencetwo{\labeltext\commalistsentencetwo}%
- \else
- \let\@@commalistsentencetwo\commalistelement
- \fi
- \getcommalistsize[#1]%
- \ifcase\commalistsize\relax
- \def\serializedcommalist{#1}%
- \else
- \let\serializedcommalist\empty
- \scratchcounter\zerocount
- \def\docommand##1%
- {\advance\scratchcounter \plusone
- \ifnum\scratchcounter=\plusone
- \scratchtoks{\handlecommalistsentence{##1}}%
- \else
- \ifnum\scratchcounter=\commalistsize
- \appendtoks\@@commalistsentencetwo\handlecommalistsentence{##1}\to\scratchtoks
- \else
- \appendtoks\@@commalistsentenceone\handlecommalistsentence{##1}\to\scratchtoks
- \fi
- \fi}%
- \processcommacommand[#1]\docommand
- \edef\serializedcommalist{\the\scratchtoks}%
- \fi
- \serializedcommalist
- \egroup}
-
-\def\commacommandsentence[#1]{\@EA\commalistsentence\@EA[#1]}
-
-\ifx\textcomma\undefined \def\textcomma{,} \fi
-
-\setuplabeltext [\s!nl] [and-1=\textcomma\ , and-2= en ]
-\setuplabeltext [\s!en] [and-1=\textcomma\ , and-2=\textcomma\ and ]
-\setuplabeltext [\s!de] [and-1=\textcomma\ , and-2= und ]
-\setuplabeltext [\s!hr] [and-1=\textcomma\ , and-2= i ]
-
-%D \macros
-%D {somekindoftab}
-%D
-%D This macro can be used to create tabs:
-%D
-%D \starttyping
-%D \setupheadertexts[{\somekindoftab[alternative=horizontal]{\framed{\realfolio}}}]
-%D \setuptexttexts [{\somekindoftab[alternative=vertical] {\framed{\realfolio}}}]
-%D
-%D \starttext
-%D \showframe \dorecurse{10}{test\page}
-%D \stoptext
-%D \stoptyping
-
-\def\somekindoftab
- {\dosingleempty\dosomekindoftab}
-
-\def\dosomekindoftab[#1]%
- {\bgroup
- \getparameters[xx]
- [\c!alternative=\v!vertical,
- \c!width=\textwidth,\c!height=\textheight,
- \c!n=\lastpage,\c!m=\realpageno,
- #1]%
- \doifelse\xxalternative\v!vertical
- {\dodosomekindoftab\vbox\vskip\xxheight}
- {\dodosomekindoftab\hbox\hskip\xxwidth }}
-
-\def\dodosomekindoftab#1#2#3#4%
- {#1 to #3 \bgroup
- \forgetall
- \ifnum\xxm>\plusone
- #2\zeropoint \!!plus \the\numexpr\xxm -1\relax fill\relax
- \fi
- #4%
- \ifnum\xxm<\xxn\relax
- #2\zeropoint \!!plus \the\numexpr\xxn-\xxm\relax fill\relax
- \fi
- \egroup
- \egroup}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/core-par.mkii b/Master/texmf-dist/tex/context/base/mkii/core-par.mkii
deleted file mode 100644
index 69e2976d1f3..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/core-par.mkii
+++ /dev/null
@@ -1,300 +0,0 @@
-%D \module
-%D [ file=core-par,
-%D version=1997.03.31,
-%D title=\CONTEXT\ Core Macros,
-%D subtitle=Paragraph Tricks,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Core Macros / Pararaph Tricks}
-
-\unprotect
-
-% \ifprocesspreviousparagraphs
-%
-% \nofskippedparagraphs
-% \paragraphnumber
-% \nofparagraphs
-%
-% \dosetparagraph
-% \doresetparagraph
-% \dobeforeparagraph
-% \doafterparagraph
-% \dobeforeskipparagraph
-% \doafterskipparagraph
-%
-% \pushparagraphs\endcommand alle alineas tot \endcommand laden
-% \pushmoreparagraphs\endcommand alle alineas tot \endcommand toevoegen
-% \popparagraphs alle alineas oproepen
-% \popparagraphs[a,b,c] enkele alineas oproepen [geen]
-%
-% tzt een optionele prefix:
-%
-% \pushparagraphs[xxx]\endcommand alle alineas tot \endcommand laden
-% \popparagraphs[xxx] alle alineas oproepen
-% \popparagraphs[xxx][a,b,c] enkele alineas oproepen
-%
-% \numberparagraphs
-% \numberparagraphlines
-% \resetparagraphlines
-
-\newif\ifprocesspreviousparagraphs % public
-\newif\ifprocessallparagraphs % private
-
-\newcounter\totalnofparagraphs % private
-\newcounter\globalparagraphnumber % private
-\newcounter\discardedparagraphs % private
-\newcounter\mostrecentparagraphtotal % public
-
-\let\dosetparagraph = \relax % public
-\let\doresetparagraph = \relax % public
-\let\dobeforeparagraph = \relax % public
-\let\doafterparagraph = \relax % public
-\let\dobeforeskipparagraph = \relax % public
-\let\doafterskipparagraph = \relax % public
-
-\def\paragraphnumber {} % public
-\def\nofparagraphs {} % public
-\def\nofskippedparagraphs {} % public
-
-\def\paragraphprefix {paragraph} % private
-
-% voorlopig, wordt nog class
-
-\def\resetparagraphlines
- {\global\linenumber\plusone}
-
-\def\numberparagraphs % instelbaar maken en slimmer ivm breedte regelnummer !!!!!
- {\processpreviousparagraphstrue
- \def\dosetparagraph
- {\bgroup
- \resetparagraphlines
- \EveryPar
- {\strut\inleftmargin{\tf{\tx\paragraphnumber}\kern2em}%
- \ignorespaces}}%
- \def\doresetparagraph
- {\resetparagraphlines
- \egroup}}
-
-\def\numberparagraphlines
- {\processpreviousparagraphstrue
- \def\dosetparagraph
- {\resetparagraphlines}%
- \def\doresetparagraph
- {\resetparagraphlines}%
- \def\dobeforeparagraph
- {\startlinenumbering[\v!continue]}%
- \def\doafterparagraph
- {\stoplinenumbering}%
- \def\dobeforeskipparagraph
- {\stoplinenumbering
- \let\paragraphnumber\relax}%
- \def\doafterskipparagraph
- {\startlinenumbering[\v!continue]}}
-
-\long\def\directpushparagraph#1%
- {\doglobal\increment\totalnofparagraphs
- \ifnum\totalnofparagraphs>0\nofskippedparagraphs\relax
- \setgvalue{\paragraphprefix\totalnofparagraphs}{#1}%
- \else
- \setgvalue{\paragraphprefix\totalnofparagraphs}{\skipparagraph#1\par}%
- \fi}
-
-\long\def\directskipparagraph#1%
- {\doglobal\increment\totalnofparagraphs
- \setgvalue{\paragraphprefix\totalnofparagraphs}{\skipparagraph#1\par}}
-
-\def\dopushparagraphs#1%
- {\global\let\mostrecentparagraphtotal\totalnofparagraphs
- \ifx#1\undefined
- \let#1\relax
- \fi
- \defconvertedargument\asciia{#1}%
- \defconvertedargument\asciib{ }% % lege regel
- \def\dopushparagraph##1\par
- {\defconvertedargument\asciic{##1}%
- \doifelse\asciic\asciia
- {#1}
- {\doifsomething\asciic % lege paragraaf
- {\doifnot\asciic\asciib
- {\directpushparagraph{#1}}}%
- \dopushparagraph}}%
- \dopushparagraph}
-
-\def\pushparagraphs
- {\doglobal\newcounter\totalnofparagraphs
- \dopushparagraphs}
-
-\def\pushmoreparagraphs
- {\dopushparagraphs}
-
-\def\dododopopparagraph#1% no grouping, i.v.m. sidefloats
- {\ifnum#1>\totalnofparagraphs\relax
- \else
- \let\paragraphnumber\globalparagraphnumber
- \decrement(\paragraphnumber,\discardedparagraphs)%
- \dobeforeparagraph
- \ifhmode\indentation\fi\getvalue{\paragraphprefix#1}\par
- \doafterparagraph
- \fi}
-
-\long\def\skipparagraph#1\par
- {\doglobal\increment\discardedparagraphs
- \ifprocessallparagraphs
- \dobeforeskipparagraph
- \ifhmode\indentation\fi#1\par
- \doafterskipparagraph
- \fi}
-
-\def\dodopopparagraph
- {\dododopopparagraph}
-
-\def\dodoprocessparagraph#1%
- {\ifprocesspreviousparagraphs
- \bgroup
- \setbox0\vbox{\dododopopparagraph{#1}}%
- \egroup
- \fi}
-
-\def\processpreviousparagraphs[#1]% process previous ones
- {\ifprocesspreviousparagraphs
- \bgroup
- \getfromcommacommand[#1][1]% tzt snelle \..command.. testen
- \let\totalnofparagraphs\commalistelement
- \decrement\totalnofparagraphs
- \let\dodopopparagraph\dodoprocessparagraph
- \popparagraphs
- \egroup
- \fi}
-
-\def\dopopparagraphs[#1]%
- {\doifnotinset{#1}{\v!none,0}
- {\dosetparagraph
- \doglobal\newcounter\globalparagraphnumber
- \doglobal\newcounter\discardedparagraphs
- \doifelse{#1}{}
- {\processallparagraphstrue}
- {\processallparagraphsfalse}%
- \def\dopopparagraph
- {\doglobal\increment\globalparagraphnumber
- \ifnum\globalparagraphnumber>\totalnofparagraphs\relax
- \let\dopopparagraph\relax
- \else\ifprocessallparagraphs
- \ifnum\globalparagraphnumber>\mostrecentparagraphtotal\relax
- \dodopopparagraph\globalparagraphnumber
- \else
- \dodoprocessparagraph\globalparagraphnumber
- \fi
- \else
- \let\paragraphnumber\globalparagraphnumber
- \decrement(\paragraphnumber,\discardedparagraphs)%
- \ExpandBothAfter\doifinsetelse{\paragraphnumber}{#1}
- {\dodopopparagraph\globalparagraphnumber}
- {\dodoprocessparagraph\globalparagraphnumber}%
- \fi\fi
- \dopopparagraph}%
- \dopopparagraph
- \doresetparagraph}}
-
-\def\popparagraphs
- {\dosingleempty\dopopparagraphs}
-
-\def\countparagraphs
- {\popparagraphs[\!!maxcard]%
- \global\let\nofparagraphs\totalnofparagraphs
- \doglobal\decrement(\nofparagraphs,\discardedparagraphs)}
-
-% \showframe
-%
-% \numberparagraphlines
-% \numberparagraphs
-%
-% \def\nofskippedparagraphs{1}
-%
-% \pushparagraphs\ThatsIt
-%
-% \ruledbaseline eerste eerste eerste eerste eerste eerste
-% eerste eerste eerste eerste eerste eerste eerste eerste
-% eerste eerste eerste eerste eerste eerste eerste eerste
-% eerste eerste eerste eerste eerste eerste eerste eerste
-% eerste eerste eerste eerste eerste eerste eerste eerste
-% eerste eerste eerste eerste eerste
-%
-% \ruledbaseline eerste eerste eerste eerste eerste eerste
-% eerste eerste eerste eerste eerste eerste eerste eerste
-% eerste eerste eerste eerste eerste eerste eerste eerste
-% eerste eerste eerste eerste eerste eerste eerste eerste
-% eerste eerste eerste eerste eerste eerste eerste eerste
-% eerste eerste eerste eerste eerste
-%
-% \ruledbaseline tweede tweede tweede tweede tweede tweede
-% tweede tweede tweede tweede tweede tweede tweede tweede
-% tweede tweede tweede tweede tweede tweede tweede tweede
-% tweede tweede tweede tweede tweede tweede tweede tweede
-% tweede tweede tweede tweede tweede tweede tweede tweede
-% tweede tweede tweede tweede tweede tweede tweede tweede
-% tweede tweede tweede tweede tweede
-%
-% \skipparagraph \ruledbaseline skipped skipped skipped
-% skipped skipped skipped skipped skipped skipped skipped
-% skipped skipped skipped skipped skipped skipped skipped
-% skipped skipped
-%
-% \ruledbaseline derde derde derde derde derde derde derde
-% derde derde derde derde derde derde derde derde derde derde
-% derde derde derde derde derde derde derde derde derde derde
-% derde derde derde derde derde derde derde derde derde derde
-% derde derde derde derde derde derde derde derde derde derde
-% derde derde derde derde derde derde derde derde derde derde
-%
-% \skipparagraph \ruledbaseline skipped skipped skipped
-% skipped skipped skipped skipped skipped skipped skipped
-% skipped skipped skipped skipped skipped skipped skipped
-% skipped skipped skipped
-%
-% \ruledbaseline vierde vierde vierde vierde vierde vierde
-% vierde vierde vierde vierde vierde vierde vierde vierde
-% vierde vierde vierde vierde vierde vierde vierde vierde
-% vierde vierde vierde vierde
-%
-% \ruledbaseline vijfde vijfde vijfde vijfde vijfde vijfde
-% vijfde vijfde vijfde vijfde vijfde vijfde vijfde vijfde
-% vijfde vijfde vijfde vijfde vijfde vijfde vijfde vijfde
-% vijfde vijfde vijfde vijfde vijfde vijfde vijfde vijfde
-% vijfde vijfde vijfde
-%
-% \skipparagraph \ruledbaseline skipped skipped skipped
-% skipped skipped skipped skipped skipped skipped skipped
-% skipped skipped skipped skipped skipped skipped skipped
-% skipped skipped skipped
-%
-% \ThatsIt
-%
-% \popparagraphs
-%
-% \countparagraphs
-%
-% \blanko[2*groot]
-%
-% nofparagraphs:~\nofparagraphs
-%
-% \pagina
-%
-% \popparagraphs[1]
-% \popparagraphs[2]
-% \popparagraphs[3]
-% \popparagraphs[4]
-% \popparagraphs[5]
-%
-% \pagina
-%
-% \ruledvbox{\popparagraphs[1,2,3,4,5]}
-%
-% \pagina
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/core-stg.mkii b/Master/texmf-dist/tex/context/base/mkii/core-stg.mkii
deleted file mode 100644
index 0d98da851d3..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/core-stg.mkii
+++ /dev/null
@@ -1,72 +0,0 @@
-%D \module
-%D [ file=core-stg,
-%D version=2006.08.16,
-%D title=\CONTEXT\ Core Macros,
-%D subtitle=Strategies,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 a prelude to strategies. It is rather old code
-%D used in a project many years ago. Use with care since I
-%D will pick up this thread. (moved from cont-new)
-
-\unprotect
-
-\def\s!strategy{strategy}
-
-\def\currentstrategypass {1}
-\def\currentstrategyvariable{0}
-\def\maximumstrategypass {8}
-
-\newconditional\strategypassneeded
-\newconditional\strategypassforced
-
-\definetwopasslist{\s!strategy}
-
-\def\registerstrategypass
- {\ifnum\currentstrategypass>\maximumstrategypass \else
- \ifconditional\strategypassforced
- \doglobal\increment\currentstrategypass
- \else%\ifconditional\strategypassneeded
- %\doglobal\increment\currentstrategypass
- \fi%\fi
- \fi
- \savecurrentvalue\currentstrategypass{\currentstrategypass}}
-
-\appendtoks \registerstrategypass \to \everybye % \everylastshipout
-
-\def\setstrategyvariable#1#2% key value
- {%\doifnotstrategyvariable{#1}{\global\settrue\strategypassneeded}%
- \doglobal\increment\currentstrategyvariable
- \savetaggedtwopassdata{\s!strategy}{\currentstrategyvariable}{#1}{#2}}
-
-\def\doifstrategyvariableelse#1#2#3%
- {\getstrategyvariable{#1}\iftwopassdatafound#2\else#3\fi}
-
-\def\getstrategyvariable#1% key
- {\findtwopassdata{\s!strategy}{#1}%
- \setxvalue{\s!strategy:#1}{\twopassdata}}
-
-\def\retainstrategyvariable#1% key
- {\expanded{\setstrategyvariable{#1}{\strategyvariable{#1}}}}
-
-\def\strategyvariable#1% key
- {\csname\s!strategy:#1\endcsname}
-
-\let\stratvar\strategyvariable
-
-\def\forcestrategy{\global\settrue \strategypassforced}
-\def\abortstrategy{\global\setfalse\strategypassforced}
-
-\def\doifstrategyvariableelse#1#2#3%
- {\getstrategyvariable{#1}\iftwopassdatafound#2\else#3\fi}
-
-\def\doifstrategyvariable #1#2{\doifstrategyvariableelse{#1}{#2}{}}
-\def\doifnotstrategyvariable#1#2{\doifstrategyvariableelse{#1}{}{#2}}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/core-sys.mkii b/Master/texmf-dist/tex/context/base/mkii/core-sys.mkii
deleted file mode 100644
index 5aa669d2c1e..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/core-sys.mkii
+++ /dev/null
@@ -1,396 +0,0 @@
-%D \module
-%D [ file=core-sys, % moved from main-001
-%D version=1997.03.31,
-%D title=\CONTEXT\ Core Macros,
-%D subtitle=System,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Core Macros / System}
-
-\unprotect
-
-%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\space\contextmark}%
- \writestatus{Files Version}{#1}%
- \batchmode
- \normalend}}
-
-%D End of lines to the output. \TEX\ will map this onto the platform specific
-%D line ending. I hate this mess.
-
-%newlinechar=10 \def\outputnewlinechar{\rawcharacter{10}}
-\newlinechar=10 \edef\outputnewlinechar{^^J}
-
-% in case formats are shared:
-
-\def\initializenewlinechar
- {\bgroup\newlinechar=10\xdef\outputnewlinechar{^^J}\egroup}
-
-%D Job names.
-
-\def\outputfilename {\@@svfile}
-\def\inputfilename {\@@svinputfile}
-\def\operatingsystem{\@@svtype}
-
-\let\jobfilename \jobname
-\let\jobfilesuffix\c!tex
-
-\def\splitjobfilename % todo: mkiv
- {\resetsystemmode{suffix-\jobfilesuffix}%
- \edef\ascii{\inputfilename}\defconvertedcommand\ascii\ascii
- \splitstring\ascii\at.\to\jobfilename\and\jobfilesuffix
- \lowercasestring\jobfilesuffix\to\jobfilesuffix
- \doifnothing\jobfilename {\let\jobfilename \jobname}%
- % todo and totest: \defconvertedcommand\jobfilename\jobfilename
- \doifnothing\jobfilesuffix{\let\jobfilesuffix\c!tex}%
- \setsystemmode{suffix-\jobfilesuffix}}
-
-% Some mechanisms (see x-res-01) use either \jobfilename or
-% \jobfilename.somesuffix, in which case we need to use the
-% full name if given or a default (like \jobfilename.xml);
-% this comes down to replacing the default tex suffix.
-
-\def\jobfullname{\jobfilename.\jobfilesuffix}
-
-\def\setjobfullname#1% #1 = default if not given
- {\doifelsenothing\jobfilename
- {\let\jobfullname\empty}
- {\doif\jobfilesuffix\c!tex{\edef\jobfullname{\jobfilename.#1}}}}
-
-% ...
-
-\def\dosetupsystem[#1]%
- {\getparameters[\??sv][#1]%
- \setuprandomize[\@@svrandom]%
- \beforesplitstring\@@svresolution\at dpi\to\@@svresolution
- \let\outputresolution\@@svresolution
- \ifcase\@@svn
- % % 0 : unknown
- \or
- \setsystemmode\v!first % 1 : first run
- \or
- % % 2 : successive run
- \or
- \setsystemmode\v!first % 3 : first and only run
- \or
- \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
-
-\let\systemendofline\outputnewlinechar % will become obsolete
-
-\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
-%D \starttyping
-%D \startmode[*first]
-%D \executesystemcommand{cleanupxml text.xml clean-text.xml}
-%D \stopmode
-%D
-%D \starttext
-%D \typefile{clean-text.xml}
-%D \stoptext
-%D \stoptyping
-
-\def\setuprandomize[#1]%
- {\doifsomething{#1}
- {\bgroup
- % tex's time is in minutes
- \scratchcounter\normaltime
- \processaction
- [#1]
- [ \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}}%
-% \writestatus\m!systems{randomseed: \the\scratchcounter}%
- \egroup}}
-
-
-\setupsystem
- [\c!directory=,
- \c!n=0, % 0:unknown 1: one run 2: first 3: successive 4: final run
- \c!resolution=600dpi,
- \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.
-
-\def\dostartglobaldefs#1#2%
- {\edef\!!stringa{\the\globaldefs}%
- \ifnum\globaldefs#10
- \globaldefs-\globaldefs
- \fi
- \advance\globaldefs #21
- \setevalue{@gd@\the\globaldefs}{\!!stringa}}
-
-\def\dostopglobaldefs
- {\doifdefinedelse{@gd@\the\globaldefs}
- {\globaldefs\getvalue{@gd@\the\globaldefs}\relax}
- {\globaldefs\zerocount}}
-
-\def\startlocal {\dostartglobaldefs>-}
-\def\stoplocal {\dostopglobaldefs}
-\def\startglobal {\dostartglobaldefs<+}
-\def\stopglobal {\dostopglobaldefs}
-
-\def\complexstart[#1]{\bgroup\getvalue{\e!start#1}}
-\def\complexstop [#1]{\getvalue{\e!stop #1}\egroup}
-
-\let\simplestart\bgroup
-\let\simplestop \egroup
-
-\definecomplexorsimple\start
-\definecomplexorsimple\stop
-
-\def\dododefinestartstop[#1][#2]% todo: use indirect commands
- {\getparameters
- [\??be#1]
- [\c!before=,
- \c!after=,
- \c!inbetween=,
- \c!commands=,
- \c!style=,
- #2]%
- \unexpanded\setvalue{#1}%
- {\groupedcommand
- {\getvalue{\??be#1\c!commands}%
- \dostartattributes{\??be#1}\c!style\c!color}
- {\dostopattributes
- \getvalue{\??be#1\c!inbetween}}}%
- \setvalue{\e!start#1}%
- {\getvalue{\??be#1\c!before}%
- \bgroup
- \getvalue{\??be#1\c!commands}%
- \dostartattributes{\??be#1}\c!style\c!color\empty}%
- \setvalue{\e!stop#1}%
- {\dostopattributes
- \egroup
- \getvalue{\??be#1\c!after}}}
-
-\def\dodefinestartstop[#1][#2]%
- {\def\docommand##1{\dododefinestartstop[##1][#2]}%
- \processcommalist[#1]\docommand}
-
-\def\definestartstop
- {\dodoubleargument\dodefinestartstop}
-
-\def\dosetupstartstop[#1][#2]%
- {\def\docommand##1{\getparameters[\??be##1][#2]}%
- \processcommalist[#1]\docommand}
-
-\def\setupstartstop
- {\dodoubleargument\dosetupstartstop}
-
-% \docommand kan niet worden gebruikt omdat deze macro
-% soms lokaal wordt gebruikt
-
-% te zijner tijd:
-%
-% \definevariable {pc} % ProtectedCommand
-%
-% \def\executeprotected#1%
-% {\csname\??pc\string#1\endcsname}
-%
-% \def\defineprotected#1#2%
-% {\expandafter\def\csname\??pc\string#2\endcsname}
-%
-% \def\defineunprotected#1%
-% {\def#1}
-%
-% \def\doprotected%
-% {\ifx\next\define
-% \let\next=\defineprotected
-% \else
-% \let\next=\executeprotected
-% \fi
-% \next}
-%
-% \def\unexpanded%
-% {\futurelet\next\doprotected}
-%
-% \unexpanded\define\ziezo{ziezo}
-%
-% \unexpanded\ziezo
-
-\def\complexdefine[#1]#2#3%
- {\ifx#2\undefined
- \else
- \showmessage\m!systems4{\string#2}%
- \fi
- \ifcase0#1\def#2{#3}%
- \or\def#2##1{#3}%
- \or\def#2##1##2{#3}%
- \or\def#2##1##2##3{#3}%
- \or\def#2##1##2##3##4{#3}%
- \or\def#2##1##2##3##4##5{#3}%
- \or\def#2##1##2##3##4##5##6{#3}%
- \or\def#2##1##2##3##4##5##6##7{#3}%
- \or\def#2##1##2##3##4##5##6##7##8{#3}%
- \or\def#2##1##2##3##4##5##6##7##8##9{#3}%
- \else\def#2{#3}%
- \fi}
-
-\definecomplexorsimpleempty\define
-
-\unexpanded\def\macroname#1% brrr
- {\executeifdefined{#1}\empty}
-
-\def\usecommands#1%
- {\bgroup
- \def\docommand##1{\setbox0\hbox{\getvalue{\string##1}##1}}%
- \processcommalist[#1]\docommand
- \egroup}
-
-\newif\ifforcefileexpansion % handy for document level overload
-
-%D The next implementation is about 4 times as faster than a
-%D processaction alternative on an string of average length.
-%D Since this feature is used in XML processing, it made sense
-%D to support this faster alternative. It's installable as well.
-
-\def\installexpander#1#2#3% changed, no longer \convert..\to...
- {\setvalue{\s!do\c!expansion#1l}{#2}%
- \setvalue{\s!do\c!expansion#1g}{#3}}%
-
-% \convertexpanded is obsolete
-
-\long\def\doconvertexpanded#1#2#3% #4 % [l|g] \cs {kind} {data}
- {\csname % that we assign all exp a value
- \s!do\c!expansion
- \ifforcefileexpansion
- \v!yes
- \else\ifcsname\s!do\c!expansion#3#1\endcsname
- #3%
- \else
- \s!default
- \fi\fi
- #1%
- \endcsname#2}% #3
-
-\long\def\defconvertexpanded {\doconvertexpanded l}
-\long\def\gdefconvertexpanded{\doconvertexpanded g}
-
-\installexpander\v!command \defconvertedcommand \gdefconvertedcommand
-\installexpander\s!default \defconvertedargument \gdefconvertedargument
-\installexpander\empty \defconvertedargument \gdefconvertedargument
-\installexpander\v!no \defconvertedargument \gdefconvertedargument
-\installexpander\v!yes \defconvertedmeaning \gdefconvertedmeaning
-\installexpander\v!yes \defconvertedmeaning \gdefconvertedmeaning
-\installexpander\v!strict \defreducedargument \gdefreducedargument
-\installexpander {utf} \defreducedtoutf \gdefreducedtoutf
-
-%installexpander {xml} {see xtag-ext}
-
-\def\dodefconvertedmeaning#1#2#3% watch the double expansion !
- {\bgroup
- \honorunexpanded
- \convertencodedtokens % can be overloaded
- \xdef\@@globalexpanded{#3}%
- \xdef\@@globalexpanded{\@@globalexpanded}%
- \egroup
- #1#2\@@globalexpanded}
-
-\def\defconvertedmeaning {\dodefconvertedmeaning\defconvertedcommand}
-\def\gdefconvertedmeaning{\dodefconvertedmeaning\gdefconvertedcommand}
-
-\def\dodefreducedargument#1#2#3%
- {\begingroup
- \reducetocoding[raw]%
- \edef\ascii{#3}%
- \expandafter\endgroup\expandafter#1\expandafter#2\expandafter{\ascii}}
-
-\def\defreducedargument {\dodefreducedargument\edef}
-\def\gdefreducedargument{\dodefreducedargument\xdef}
-
-% \setupindex[expansion=utf]\index{\eacute}
-
-\def\dodefreducedtoutf#1#2#3%
- {\begingroup
- \reducetocoding[uc]%
- \let\uchar\uchartoutf
- \let\unicodechar\numbertoutf
- \edef\ascii{#3}%
- \expandafter\endgroup\expandafter#1\expandafter#2\expandafter{\ascii}}
-
-\def\defreducedtoutf {\dodefreducedtoutf\edef}
-\def\gdefreducedtoutf{\dodefreducedtoutf\xdef}
-
-% old syntax:
-
-\def\convertmeaning#1\to#2% watch the double expansion !
- {\bgroup
- \honorunexpanded
- \convertencodedtokens % can be overloaded
- \xdef\@@globalexpanded{#1}%
- \xdef\@@globalexpanded{\@@globalexpanded}%
- \egroup
- \defconvertedcommand#2\@@globalexpanded}
-
-\def\reduceargument#1\to#2%
- {\begingroup
- \reducetocoding[raw]%
- \edef\ascii{#1}%
- \expandafter\endgroup\expandafter\edef\expandafter#2\expandafter{\ascii}}
-
-\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}
-% \setvalue{statevalue\v!normaal}{2}
-% \setvalue{statevalue\v!leeg }{3}
-% \setvalue{statevalue\v!geen }{4}
-%
-% \def\setcurrentstate#1%
-% {\chardef\currentstate=0\getvalue{statevalue\getvalue{#1\c!state}\relax}
-%
-% \ifcase\currentstate ...
-
-\def\redo{\dorepeat} % [n*10], kind of obsolete
-
-% obsolete, use \dorecurse instead
-%
-% \def\herhaler {\repeater}
-% \def\herhaalmetcommando {\dorepeatwithcommand}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/core-two.mkii b/Master/texmf-dist/tex/context/base/mkii/core-two.mkii
deleted file mode 100644
index 235be988edc..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/core-two.mkii
+++ /dev/null
@@ -1,206 +0,0 @@
-%D \module
-%D [ file=core-two, % moved from core-uti
-%D version=1997.03.31,
-%D title=\CONTEXT\ Core Macros,
-%D subtitle=Two Pass Data,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Core Macros / Two Pass Data}
-
-%D This is a rather old mechanism which has not changed much over
-%D time, apart from adding a few more selectors. This code used
-%D to be part of \type {core-uti}. The following examples demonstrate
-%D the interface.
-%D
-%D \startbuffer
-%D \definetwopasslist{test-1}
-%D
-%D \gettwopassdatalist{test-1} [\twopassdatalist=]
-%D \checktwopassdata {test-1} [\twopassdata=]
-%D \checktwopassdata {test-1} [\twopassdata=]
-%D \gettwopassdata {test-1} [\twopassdata=]
-%D \gettwopassdata {test-1} [\twopassdata=]
-%D
-%D \definetwopasslist{test-2}
-%D
-%D \lazysavetwopassdata{test-2}{1}{x}
-%D \lazysavetwopassdata{test-2}{2}{y}
-%D \lazysavetwopassdata{test-2}{3}{z}
-%D
-%D \gettwopassdatalist{test-2} [\twopassdatalist=x,y,z]
-%D \checktwopassdata {test-2} [\twopassdata=x]
-%D \checktwopassdata {test-2} [\twopassdata=x]
-%D \gettwopassdata {test-2} [\twopassdata=x]
-%D \gettwopassdata {test-2} [\twopassdata=y]
-%D \gettwopassdata {test-2} [\twopassdata=z]
-%D \gettwopassdata {test-2} [\twopassdata=]
-%D
-%D \definetwopasslist{test-3}
-%D
-%D \lazysavetaggedtwopassdata{test-3}{1}{x}{a}
-%D \lazysavetaggedtwopassdata{test-3}{2}{y}{b}
-%D \lazysavetaggedtwopassdata{test-3}{3}{z}{c}
-%D
-%D \findtwopassdata{test-3}{x} [\twopassdata=a]
-%D \findtwopassdata{test-3}{y} [\twopassdata=b]
-%D \findtwopassdata{test-3}{z} [\twopassdata=c]
-%D \findtwopassdata{test-3}{w} [\twopassdata=]
-%D
-%D \definetwopasslist{test-4}
-%D
-%D \lazysavetwopassdata{test-4}{1}{A}
-%D \lazysavetwopassdata{test-4}{2}{B}
-%D \lazysavetwopassdata{test-4}{3}{C}
-%D
-%D \getfirsttwopassdata{test-4} [\twopassdata=A]
-%D \getlasttwopassdata {test-4} [\twopassdata=C]
-%D \getfirsttwopassdata{test-4} [\twopassdata=A]
-%D \getlasttwopassdata {test-4} [\twopassdata=C]
-%D \getfromtwopassdata {test-4}{1} [\twopassdata=A]
-%D \getfromtwopassdata {test-4}{3} [\twopassdata=C]
-%D \getfromtwopassdata {test-4}{2} [\twopassdata=B]
-%D \stopbuffer
-%D
-%D \getbuffer \typebuffer
-
-\unprotect
-
-\let\alltwopasslists\empty
-\let\twopassentry \gobblethreearguments % permits loading a MK II file
-\let\twopassdata \empty
-\let\twopassdatalist\empty
-
-\newif\iftwopassdatafound
-
-\addutilityreset{twopassentries}
-
-\def\immediatesavetwopassdata #1#2#3{\immediatewriteutilitycommand{\twopassentry{#1}{#2}{#3}}}
-\def\savetwopassdata #1#2#3{\writeutilitycommand{\twopassentry{#1}{#2}{#3}}}
-\def\lazysavetwopassdata #1#2#3{\expanded{\writeutilitycommand{\noexpand\twopassentry{#1}{#2}{#3}}}} % expanded !
-\def\savetaggedtwopassdata #1#2#3#4{\immediatewriteutilitycommand{\twopassentry{#1}{#2}{#3::#4}}}
-\def\lazysavetaggedtwopassdata#1#2#3#4{\expanded{\writeutilitycommand{\noexpand\twopassentry{#1}{#2}{#3::#4}}}} % expanded !
-
-\def\resettwopassentries
- {\let\twopassentry\gobblethreearguments}
-
-\def\settwopassentries
- {\def\twopassentry##1{\executeifdefined{@@##1\s!pass}\gobbletwoarguments}}
-
-\resettwopassentries
-
-\def\appendtwopasselement#1#2#3% can sometimes become a large list
- {%\debuggerinfo{\m!systems}{twopass data #1 - #2 = #3}%
- \expandafter\xdef\csname#1:\s!list\endcsname
- {\@EA\ifx\csname#1:\s!list\endcsname\empty \else
- \csname#1:\s!list\endcsname,\fi#3}}
-
-\def\dodefinetwopasslist#1%
- {\doifundefined{#1:\s!list}
- {%\debuggerinfo\m!systems{defining twopass class #1}%
- \doglobal\addutilityreset{#1\s!pass}%
- \setgvalue{\s!set #1\s!pass}{\dosettwopasslist {#1}}%
- \setgvalue{\s!reset#1\s!pass}{\doresettwopasslist{#1}}%
- \getvalue {\s!reset#1\s!pass}}}
-
-\def\definetwopasslist#1%
- {\expanded{\dodefinetwopasslist{#1}}%
- \doglobal\addtocommalist{#1}\alltwopasslists}
-
-\def\dosettwopasslist#1%
- {\letgvalue{\s!set#1\s!pass}\gobbletwoarguments
- \setgvalue{@@#1\s!pass}{\appendtwopasselement{#1}}}
-
-\def\doresettwopasslist#1%
- {\letgvalue{@@#1\s!pass}\gobbletwoarguments}
-
-\def\doloadtwopassdata#1%
- {\doifundefined{#1:\s!list}
- {\startnointerference
- \letgvalueempty{#1:\s!list}%
- \protectlabels
- \doutilities{twopassentries,#1\s!pass}\jobname\empty\relax\relax
- \stopnointerference}}
-
-\def\loadtwopassdata
- {\ifx\alltwopasslists\empty\else
- \processcommacommand[\alltwopasslists]\doloadtwopassdata
- \globallet\alltwopasslists\empty
- \fi}
-
-\def\dogettwopassdata[#1,#2]#3#4%
- {\edef\twopassdata{#1}%
- \ifx\twopassdata\empty
- \twopassdatafoundfalse
- \let\twopassdata\empty
- \else
- \twopassdatafoundtrue
- \ifcase#4\or\setxvalue{#3:\s!list}{#2}\fi
- \fi}
-
-\def\gettwopassdata#1%
- {\loadtwopassdata \@EAEAEA\dogettwopassdata\@EA\@EA\@EA[\csname#1:\s!list\endcsname,]{#1}\plusone}
-
-\def\checktwopassdata#1%
- {\loadtwopassdata \@EAEAEA\dogettwopassdata\@EA\@EA\@EA[\csname#1:\s!list\endcsname,]{#1}\zerocount}
-
-\def\findtwopassdata#1#2%
- {\loadtwopassdata \expanded{\dofindtwopassdata{#1}{#2}}}
-
-\def\dofindtwopassdata#1#2%
- {\def\dodofindtwopassdata[##1,##2#2::##3,##4]{\edef\twopassdata{##3}}%
- \@EAEAEA\dodofindtwopassdata\@EA\@EA\@EA[\@EA\@EA\@EA,\csname#1:\s!list\endcsname,#2,#2::,]%
- \ifx\twopassdata\empty
- \twopassdatafoundfalse
- \else
- \twopassdatafoundtrue
- \fi}
-
-\let\getfirsttwopassdata\checktwopassdata
-
-\def\getlasttwopassdata#1%
- {\loadtwopassdata
- \scratchcounter\zerocount
- \@EAEAEA\rawprocesscommalist\@EA\@EA\@EA[\csname#1:\s!list\endcsname]\dogetlasttwopassdata
- \edef\noftwopassitems{\the\scratchcounter}%
- \iftwopassdatafound\else
- \let\twopassdata\empty
- \fi}
-
-\def\dogetlasttwopassdata#1%
- {\edef\nexttwopassdata{#1}%
- \ifx\nexttwopassdata\empty \else
- \let\twopassdata\nexttwopassdata
- \advance\scratchcounter \plusone
- \twopassdatafoundtrue
- \fi}
-
-\def\getfromtwopassdata#1#2%
- {\loadtwopassdata
- \@EAEAEA\getfromcommalist\@EA\@EA\@EA[\csname#1:\s!list\endcsname][#2]%
- \ifx\commalistelement\empty
- \twopassdatafoundfalse
- \let\twopassdata\empty
- \else
- \twopassdatafoundtrue
- \let\twopassdata\commalistelement
- \fi}
-
-\def\gettwopassdatalist#1%
- {\loadtwopassdata
- \letcscsname\twopassdatalist\csname#1:\s!list\endcsname
- \ifx\twopassdatalist\relax\let\twopassdatalist\empty\fi}
-
-\def\gettwopassdatalist
- {\getnamedtwopassdatalist\twopassdatalist}
-
-\def\doifelseintwopassdata#1#2% tag dat
- {\gettwopassdatalist{#1}%
- \expanded{\doifinsetelse{#2}{\twopassdatalist}}}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/core-uti.mkii b/Master/texmf-dist/tex/context/base/mkii/core-uti.mkii
deleted file mode 100644
index bd2fa46a0ff..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/core-uti.mkii
+++ /dev/null
@@ -1,349 +0,0 @@
-%D \module
-%D [ file=core-uti,
-%D version=1997.03.31,
-%D title=\CONTEXT\ Core Macros,
-%D subtitle=Utility File Handling,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Core Macros / Utility File Handling}
-
-\unprotect
-
-% todo : safe lan etc too
-% todo : load all commands at once (tok)
-% todo : merge status info patch into tui file (language, encoding, etc),
-
-% Utility-file
-%
-% De onderstaande macro's ondersteunen het gebruik van de
-% zogeheten utility-file. Alle extern onder te brengen
-% informatie wordt opgeslagen in de file \jobname.tui, tenzij
-% er selectief pagina's worden gezet. In dat geval wordt de
-% file \jobname.tmp gebruikt. Informatie wordt ingelezen uit
-% de file \jobname.tuo, welke door TeXUtil wordt aangemaakt.
-
-\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 :
-\edef\utilityversion{2006.09.21} % pt in pos
-\edef\utilityversion{2008.10.14} % moved more to lua in mkiv
-
-% Bepaalde commando's worden als string weggeschreven. Deze
-% zijn aan het eind van deze file gedefinieerd.
-
-% Om een opbouw van spaties te voorkomen (???) moet ^^M een
-% andere betekenis krijgen:
-%
-% \catcode`\^^M=14 (comment)
-%
-% read file
-%
-% \catcode`\^^M=5 (end of line)
-
-\newwrite\utility@tui
-\newif\ifutilitydone
-
-\ifx\sectionseparator\undefined \def\sectionseparator{-} \fi
-
-\def\@@utilityerrormessage
- {\showmessage\m!systems8\empty
- \globallet\@@utilityerrormessage\relax}
-
-\def\thisisutilityversion#1%
- {\doifelse\utilityversion{#1}%
- {\checksectionseparator}
- {\@@utilityerrormessage\resetutilities\endinput}}
-
-\def\checksectionseparator % catches backward compatibility conflict
- {}% \doifnot\sectionseparator:\endinput} % this dependency may go in a few years
-
-\def\dosplitofffoliopart[#1--#2--#3]{#3}
-
-\def\thisissectionseparator#1%
- {\bgroup
- \globallet\checksectionseparator\relax
- \defconvertedcommand \asciia\sectionseparator
- \defconvertedargument\asciib{#1}%
- \expanded{\gdef\noexpand\dosplitofffoliopart[####1\sectionseparator
- \sectionseparator####2\sectionseparator\sectionseparator####3]{####3}}%
- \ifx\asciia\asciib
- \egroup
- \else
- \egroup
- % todo \@@utilityerrormessage
- \resetutilities
- \endinput
- \fi}
-
-\def\writeutility {\write\utility@tui}
-\def\writeutilitycommand#1{\write\utility@tui{c \string#1}}
-
-% less tokens
-%
-% \def\immediatewriteutility {\immediate\writeutility}
-% \def\immediatewriteutilitycommand{\immediate\writeutilitycommand}
-%
-% more flexible (for overloading)
-
-\def\immediatewriteutility {\immediate\write\utility@tui}
-\def\immediatewriteutilitycommand#1{\immediate\write\utility@tui{c \string#1}}
-
-% as in:
-
-\def\cwriteutility#1%
- {\write\utility@tui{\noexpand\checkedutility{\number\nofshipouts}{#1}}}
-
-\def\cwriteutilitycommand#1%
- {\write\utility@tui{\noexpand\checkedutility{\number\nofshipouts}{c \string#1}}}
-
-\let\checkedutility\secondoftwoarguments
-
-\def\docheckedutility#1#2{\ifnum#1=\nofshipouts#2\else\letterpercent\fi}
-
-\prependtoks
- \let\checkedutility\docheckedutility
-\to \everybeforeshipout
-
-% Better use marks.
-
-\newtoks \everyopenutilities
-\newtoks \everycloseutilities
-\newtoks \everycheckutilities
-
-\def\openutilities {\the\everyopenutilities } % \global\everyopenutilities\emptytoks
-\def\closeutilities{\the\everycloseutilities}
-\def\checkutilities{\the\everycheckutilities}
-
-\appendtoks
- \let\writeutility \cwriteutility
- \let\writeutilitycommand \cwriteutilitycommand
- %\let\immediatewriteutility \cimmediatewriteutility
- %\let\immediatewriteutilitycommand\cimmediatewriteutilitycommand
- \let\checkutilities \relax
-\to \everycheckutilities
-
-\appendtoks
- \immediate\openout\utility@tui\jobname.\f!inputextension
- \immediatewriteutilitycommand{\thisissectionseparator{\sectionseparator}}% for the moment
- \immediatewriteutilitycommand{\thisisutilityversion {\utilityversion }}% in this order
-\to \everyopenutilities
-
-\appendtoks
-% \immediate\closeout\utility@tui % niet echt nodig
- \reportutilityproblems
- % should be a message :
- \let\writeutilitycommand \gobbleoneargument
- \let\writeutility \gobbleoneargument
- \let\immediatewriteutilitycommand\gobbleoneargument
- \let\immediatewriteutility \gobbleoneargument
-\to \everycloseutilities
-
-% \def\reopenutilities
-% {\immediate\closeout\utility@tui
-% \openutilities}
-
-\def\abortutilitygeneration
- {\immediatewriteutilitycommand\utilitygenerationaborted
- \immediatewriteutility{q {quit}}}
-
-\def\utilitygenerationaborted
- {\showmessage\m!systems{21}\empty
- \globallet\utilitygenerationaborted\endinput
- \gdef\reportutilityproblems{\showmessage\m!systems{22}\empty}%
- \endinput}
-
-\def\savecurrentvalue#1#2%
- {\immediatewriteutilitycommand{\initializevariable\string#1{#2}}}
-
-\let\initializevariable\gdef
-
-\appendtoks
- \globallet\initializevariable\gobbletwoarguments
-\to \everyafterutilityread
-
-\let\reportutilityproblems\relax
-
-\newtoks\utilityresetlist
-
-\def\addutilityreset#1%
- {\@EA\appendtoks\csname\s!reset#1\endcsname\to\utilityresetlist}
-
-\def\resetutilities
- {\the\utilityresetlist}
-
-% #1=type #2=file #3=melding #4=voor #5=na
-%
-% Er wordt gegroepeerd. Als binnen een lijst (bijvoorbeeld) de
-% \leftskip is aangepast, maar nog geen \par is gegeven, dan
-% geldt buiten de groep de oude \leftskip. Aan #5 kan dan
-% ook \par worden meegegeven om de paragraaf af te sluiten.
-
-\newif\ifdoinpututilities
-\newif\ifunprotectutilities % voor't geval er \v!xxxxxx's zijn
-
-\def\currentutilityfilename{\jobname}
-
-% we need to pop and push, else problems with reading
-% utility files (toc) in xml mode and (e.g.) in a toc
-% entry doing a doifmode
-%
-% the following is not ok because we have no way to signal
-% xml content (yet), so for the moment we use this:
-
-\appendtoks
- \ifprocessingXML
- \processingXMLfalse
- \enableXML
- \catcode`\\=\@@escape
- \catcode`\{=\@@begingroup
- \catcode`\}=\@@endgroup
- \catcode`\%=\@@comment\relax
- \fi
-\to \everybeforeutilityread
-
-% \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
-% \defconvertedcommand\testbytesequence\testbytesequence
-% \defconvertedargument\ascii{#1}%
-% \ifx\testbytesequence\ascii \else
-% \writestatus\m!systems{possible problem with 8 bit output}%
-% \fi
-% \fi
-% \global\let\thisisbytesequence\gobbleoneargument}
-%
-% \ifnum\texengine=\xetexengine
-% \let\testbytesequence\empty
-% \fi
-%
-% \appendtoks
-% \immediatewriteutilitycommand{\thisisbytesequence{\testbytesequence}}%
-% \to \everyopenutilities
-
-\let\testbytesequence \empty % keep this
-\let\thisisbytesequence\gobbleoneargument % keep this
-
-\long\def\doutilities#1#2#3#4#5% % introduceren in utility file
- {\resetutilities
- % more than one utility thing can be handled in one pass,
- % for instance lists, so we process ##1 as list
- \def\douticommand##1{\csname\s!set##1\endcsname}%
- \processcommacommand[#1]\douticommand
- \begingroup
- \def\currentutilityfilename{#2}%
- \notesenabledfalse
- \doinpututilitiestrue
- \global\utilitydonefalse
- \pushendofline % geeft problemen zodra andere file wordt ingelezen
- \pushcatcodetable
- \setcatcodetable\ctxcatcodes
- \ifunprotectutilities % nog nodig ?
- \unprotect
- \fi
- #4%
- \the\everybeforeutilityread
- \readjobfile{#2.\f!outputextension}\donothing\donothing
- \the\everyafterutilityread
- \popcatcodetable
- #5%
- \relax
- \ifunprotectutilities
- \protect
- \fi
- \popendofline
- \ifutilitydone\else
- \doifsomething{#3}
- {\showmessage\m!systems9{{#3}}%
- \doifconcepttracing
- {\blank
- \setmessagetext\m!systems9{{#3}}%
- \type{[\currentmessagetext]}%
- \blank}}%
- \fi
- \endgroup}
-
-% Default-instellingen (verborgen)
-
-\prependtoks \resetutilities \to \everyjob
-
-% Experiment
-%
-% \installprogram{Hello World}
-% \installprogram[hw]{Hello World}
-% \installedprogram[hw]
-
-\def\installprogram
- {\dosingleempty\doinstallprogram}
-
-\def\doinstallprogram[#1]#2%
- {\doifelsenothing{#1}
- {\dodoinstallprogram{#2}}
- {\setvalue{\??up#1}{\dodoinstallprogram{#2}}}}
-
-\def\dodoinstallprogram#1%
- {\immediatewriteutility{e p {#1}}}
-
-\def\installedprogram[#1]%
- {\getvalue{\??up#1}}
-
-% \writeplugindata{texutil}{{alpha}}
-% \writeplugindata{texutil}{{beta}}
-% \writeplugindata{texutil}{{gamma}}
-% \writeplugindata{texutil}{{delta}}
-%
-% \loadplugindata {plugintest}
-
-\def\immediatewriteplugindata#1#2%
- {\immediatewriteutility{p u {#1} #2}}
-
-\def\writeplugindata#1#2%
- {\writeutility{p u {#1} #2}}
-
-\def\loadplugindata#1%
- {\doutilities{#1}\jobname\empty\relax\relax}
-
-% \plugincommand{\command{}{}{}}
-%
-% this way we can catch undefined commands
-
-\long\def\plugincommand#1%
- {\doplugincommand#1\relax}
-
-\long\def\doplugincommand#1%
- {\ifx#1\undefined
- \expandafter\noplugincommand
- \else
- \expandafter#1%
- \fi}
-
-\long\def\noplugincommand#1\relax
- {}
-
-% \addutilityreset{plugintest}
-%
-% \def\resetplugintest{\let\plugintest\gobbletwoarguments}
-% \def\setplugintest {\let\plugintest\writestatus}
-%
-% \installplugin
-% {plugintest}
-% {\let\plugintest\gobbletwoarguments}
-% {\let\plugintest\writestatus}
-
-\long\def\installplugin#1#2#3%
- {\addutilityreset {#1}%
- \long\setvalue{\s!reset#1}{#2}%
- \long\setvalue{\s!set #1}{#3}}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/core-var.mkii b/Master/texmf-dist/tex/context/base/mkii/core-var.mkii
deleted file mode 100644
index 55c587fbfaf..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/core-var.mkii
+++ /dev/null
@@ -1,286 +0,0 @@
-%D \module
-%D [ file=core-var,
-%D version=1998.02.21,
-%D title=\CONTEXT\ Core Macros,
-%D subtitle=Variables,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Core Macros / Variables}
-
-\unprotect
-
-%D We introduce a couple of variables that are used all over
-%D \CONTEXT. Alternatively we could define them in each module
-%D but as they are part of the bigger picture we prefer to do
-%D it here.
-
-%D \macros
-%D {every...}
-%D
-%D A few every's. Some are only used in \MKII\ or \MKIV.
-
-%D Output routine:
-
-\newtoks \everybeforeoutput
-\newtoks \everyafteroutput
-
-%D Shipout:
-
-\newtoks \everyshipout
-\newtoks \everybeforeshipout
-\newtoks \everyaftershipout
-\newtoks \everyfirstshipout
-\newtoks \everylastshipout
-
-%D End of run:
-
-\newtoks \everybye
-\newtoks \everygoodbye
-\newtoks \everynotabene
-
-%D Document
-
-\newtoks \everysetupdocument
-\newtoks \everyendoftextbody
-
-\newtoks \everystarttext
-\newtoks \everystoptext
-
-%D Purity:
-
-\newtoks \everyforgetall
-\newtoks \everycleanupfeatures
-
-\def\cleanupfeatures{\the\everycleanupfeatures}
-\def\forgetall {\the\everyforgetall}
-
-%D Page building:
-
-\newtoks \everybeforepagebody
-\newtoks \everyafterpagebody
-
-\let \everypagebody \everybeforepagebody % backward compatible
-
-%D Multipass:
-
-\newtoks \everybeforeutilityread
-\newtoks \everyafterutilityread
-
-%D Floats:
-
-\newtoks \everyinsidefloat
-
-%D Sectioning:
-
-\newtoks \everyheadstart
-
-%D Par building (experimental, used in xml <p> .. </p>)
-
-\newtoks \everybeginofpar
-\newtoks \everyendofpar
-%newtoks \everyparflush
-
-\def\bpar{\the\everybeginofpar\ignorespaces} % may interfere with \everypar
-\def\epar{\ifhmode\removeunwantedspaces\the\everyendofpar\fi} % test prevents problems with \bpar\epar
-
-%D Lists:
-
-\newtoks \everylistentry
-\newtoks \everysavesortkeys
-
-%D Marks:
-
-\newtoks \everymarking
-
-%D Fonts:
-
-\newtoks \everyfont
-\newtoks \everyglobalbodyfont
-\newtoks \everydefinedfont
-
-\newevery \everybodyfont \EveryBodyFont
-\newevery \everyfontswitch \EveryFontSwitch
-
-%D Math:
-
-\newtoks \everybeforedisplayformula
-\newtoks \everymathematics
-
-\prependtoks \the\everymathematics \to \everymath
-\prependtoks \the\everymathematics \to \everydisplay
-
-%D Tables
-
-\newtoks \everytable
-
-%D State mess:
-
-\newtoks \everypushsomestate
-\newtoks \everypopsomestate
-
-\def\pushsomestates{\the\everypushsomestate}
-\def\popsomestates {\the\everypopsomestate }
-
-%D More generic (used to be pushcolor etc)
-
-\newtoks\everypushproperties
-\newtoks\everypopproperties
-\newtoks\everypopsplitproperties
-
-\newtoks\everystarttextproperties
-\newtoks\everystoptextproperties
-
-\def\pushproperties {\the\everypushproperties}
-\def\popproperties {\the\everypopproperties}
-\def\popsplitproperties {\the\everypopsplitproperties}
-
-\def\starttextproperties{\the\everystarttextproperties}
-\def\stoptextproperties {\the\everystoptextproperties}
-
-%D This is pretty important (esp since we now ignore shipouts).
-%D Actually we should nil all writes, marks, specials.
-
-\appendtoks \globallet\popproperties \relax \to \everylastshipout
-\appendtoks \globallet\popsplitproperties\relax \to \everylastshipout
-
-%D \macros
-%D {defineinputmode,setinputmode}
-%D
-%D New. Some work needs to be done.
-
-% not in mkiv
-
-\def\defineinputmode[#1]{\@EA\newtoks\csname every#1inputmode\endcsname}
-\def\setinputmode [#1]{\the\executeifdefined{every#1inputmode}\emptytoks}
-
-\defineinputmode [TEX]
-\defineinputmode [XML]
-
-\setinputmode [TEX]
-
-%D \macros
-%D {trialtypesetting}
-%D
-%D We disable trial typesetting in the output routine,
-%D just to be sure.
-
-\newif\iftrialtypesetting
-
-\prependtoks \trialtypesettingfalse \to \everybeforepagebody
-
-%D \macros
-%D {ifinpagebody,ifinsidecolumns,ifdoublesided,ifsinglesided}
-
-\newif \ifinpagebody
-\newif \ifinsidecolumns
-\newif \ifdoublesided \doublesidedfalse
-\newif \ifsinglesided \singlesidedtrue
-\newif \ifinsidefloat
-\newif \ifdoingblocks
-\newif \ifgridsnapping
-
-%D \macros
-%D {ifprocessingXML}
-%D
-%D We need this one even if no \XML\ is supported.
-
-\newif\ifprocessingXML % old way
-
-%D \macros
-%D {ifproductionrun}
-%D
-%D This boolean can be used to bypass certain
-%D initializations.
-
-\ifx\protectionlevel\undefined \newcount\protectionlevel \fi
-
-\newif\ifproductionrun
-
-\appendtoks \productionruntrue \to \everydump
-
-\appendtoks \ifcase\protectionlevel\else\reportunprotection\fi \to \everydump
-
-%D \macros
-%D {everyboxedcontent, ifboxedcontent,
-%D startboxedcontent, stopboxedcontent}
-%D
-%D This one is relatively new and will be used as a more
-%D robust test for inner situations.
-
-\newif \ifboxedcontent
-\newtoks\everyboxedcontent
-
-\appendtoks \boxedcontenttrue \to \everyboxedcontent
-
-\def\startboxedcontent{\bgroup\the\everyboxedcontent}
-\let\stopboxedcontent \egroup
-
-%D \macros
-%D {fastmode,silentmode}
-%D
-%D These commands are obsolete.
-
-\let\fastmode \relax
-\let\silentmode\relax
-
-%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 We store some original meanings, maybe in \type
-%D {math-ini}.
-
-\let\normalat \at
-\let\normalin \in
-\let\normalfrom \from
-%let\normalover \over
-\let\normalabout\about
-
-%D Add-ons:
-
-\let\startlayoutcomponent\gobbletwoarguments
-\let\stoplayoutcomponent \relax
-
-%D Concepts:
-
-\chardef\conceptmode\zerocount
-
-\def\doifconcepttracing
- {\ifnum\conceptmode>\plustwo
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-032.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-032.mkii
deleted file mode 100644
index e3c24271e55..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-032.mkii
+++ /dev/null
@@ -1,82 +0,0 @@
-%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 ADE \& \CONTEXT\ Development Team}]
-%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
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-037.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-037.mkii
deleted file mode 100644
index a2aad46a575..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-037.mkii
+++ /dev/null
@@ -1,276 +0,0 @@
-%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 ADE \& \CONTEXT\ Development Team}]
-%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/mkii/enco-acc.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-acc.mkii
deleted file mode 100644
index 7484fd50ee2..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-acc.mkii
+++ /dev/null
@@ -1,139 +0,0 @@
-%D \module
-%D [ file=enco-acc,
-%D version=2000.20.12, % split from base file
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=Composed Characters Commands,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Although it is technically possible to redefine the commands
-%D that are responsible for building composed characters, this
-%D is seldom needed, since they map onto named glyphs. The
-%D meaning of these names glyphs may change, although their
-%D visual appearance seldom will.
-
-\startencoding[default]
-
-\defineaccent ^ A {\Acircumflex} \defineaccent ^ a {\acircumflex}
-\defineaccent ^ C {\Ccircumflex} \defineaccent ^ c {\ccircumflex}
-\defineaccent ^ E {\Ecircumflex} \defineaccent ^ e {\ecircumflex}
-\defineaccent ^ G {\Gcircumflex} \defineaccent ^ g {\gcircumflex}
-\defineaccent ^ H {\Hcircumflex} \defineaccent ^ h {\hcircumflex}
-\defineaccent ^ I {\Icircumflex} \defineaccent ^ i {\icircumflex} \defineaccent ^ {\i} {\icircumflex}
-\defineaccent ^ J {\Jcircumflex} \defineaccent ^ j {\jcircumflex} \defineaccent ^ {\j} {\jcircumflex}
-\defineaccent ^ O {\Ocircumflex} \defineaccent ^ o {\ocircumflex}
-\defineaccent ^ S {\Scircumflex} \defineaccent ^ s {\scircumflex}
-\defineaccent ^ U {\Ucircumflex} \defineaccent ^ u {\ucircumflex}
-\defineaccent ^ W {\Wcircumflex} \defineaccent ^ w {\wcircumflex}
-\defineaccent ^ Y {\Ycircumflex} \defineaccent ^ y {\ycircumflex}
-
-\defineaccent ` A {\Agrave} \defineaccent ` a {\agrave}
-\defineaccent ` E {\Egrave} \defineaccent ` e {\egrave}
-\defineaccent ` I {\Igrave} \defineaccent ` i {\igrave} \defineaccent ` {\i} {\igrave}
-\defineaccent ` O {\Ograve} \defineaccent ` o {\ograve}
-\defineaccent ` U {\Ugrave} \defineaccent ` u {\ugrave}
-\defineaccent ` Y {\Ygrave} \defineaccent ` y {\ygrave}
-
-\defineaccent ~ A {\Atilde} \defineaccent ~ a {\atilde}
-\defineaccent ~ I {\Itilde} \defineaccent ~ i {\itilde} \defineaccent ~ {\i} {\itilde}
-\defineaccent ~ O {\Otilde} \defineaccent ~ o {\otilde}
-\defineaccent ~ U {\Utilde} \defineaccent ~ u {\utilde}
-
-\defineaccent " A {\Adiaeresis} \defineaccent " a {\adiaeresis}
-\defineaccent " E {\Ediaeresis} \defineaccent " e {\ediaeresis}
-\defineaccent " I {\Idiaeresis} \defineaccent " i {\idiaeresis} \defineaccent " {\i} {\idiaeresis}
-\defineaccent " O {\Odiaeresis} \defineaccent " o {\odiaeresis}
-\defineaccent " U {\Udiaeresis} \defineaccent " u {\udiaeresis}
-\defineaccent " Y {\Ydiaeresis} \defineaccent " y {\ydiaeresis}
-
-\defineaccent ' A {\Aacute} \defineaccent ' a {\aacute}
-\defineaccent ' C {\Cacute} \defineaccent ' c {\cacute}
-\defineaccent ' E {\Eacute} \defineaccent ' e {\eacute}
-\defineaccent ' I {\Iacute} \defineaccent ' i {\iacute} \defineaccent ' {\i} {\iacute}
-\defineaccent ' L {\Lacute} \defineaccent ' l {\lacute}
-\defineaccent ' N {\Nacute} \defineaccent ' n {\nacute}
-\defineaccent ' O {\Oacute} \defineaccent ' o {\oacute}
-\defineaccent ' R {\Racute} \defineaccent ' r {\racute}
-\defineaccent ' S {\Sacute} \defineaccent ' s {\sacute}
-\defineaccent ' U {\Uacute} \defineaccent ' u {\uacute}
-\defineaccent ' Y {\Yacute} \defineaccent ' y {\yacute}
-\defineaccent ' Z {\Zacute} \defineaccent ' z {\zacute}
-
-\defineaccent . C {\Cdotaccent} \defineaccent . c {\cdotaccent}
-\defineaccent . E {\Edotaccent} \defineaccent . e {\edotaccent}
-\defineaccent . G {\Gdotaccent} \defineaccent . g {\gdotaccent}
-\defineaccent . I {\Idotaccent} \defineaccent . i {\idotaccent} \defineaccent . {\i} {\idotaccent}
-\defineaccent . Z {\Zdotaccent} \defineaccent . z {\zdotaccent}
-
-\defineaccent = A {\Amacron} \defineaccent = a {\amacron}
-\defineaccent = E {\Emacron} \defineaccent = e {\emacron}
-\defineaccent = I {\Imacron} \defineaccent = i {\imacron} \defineaccent = {\i} {\imacron}
-\defineaccent = O {\Omacron} \defineaccent = o {\omacron}
-\defineaccent = U {\Umacron} \defineaccent = u {\umacron}
-
-\defineaccent c C {\Ccedilla} \defineaccent c c {\ccedilla}
-\defineaccent c K {\Kcedilla} \defineaccent c k {\kcedilla}
-\defineaccent c L {\Lcedilla} \defineaccent c l {\lcedilla}
-\defineaccent c N {\Ncedilla} \defineaccent c n {\ncedilla}
-\defineaccent c R {\Rcedilla} \defineaccent c r {\rcedilla}
-\defineaccent c S {\Scedilla} \defineaccent c s {\scedilla}
-\defineaccent c T {\Tcedilla} \defineaccent c t {\tcedilla}
-
-\defineaccent H O {\Ohungarumlaut} \defineaccent H o {\ohungarumlaut}
-\defineaccent H u {\uhungarumlaut} \defineaccent H U {\Uhungarumlaut}
-
-\defineaccent k A {\Aogonek} \defineaccent k a {\aogonek}
-\defineaccent k E {\Eogonek} \defineaccent k e {\eogonek}
-\defineaccent k I {\Iogonek} \defineaccent k i {\iogonek}
-\defineaccent k U {\Uogonek} \defineaccent k u {\uogonek}
-
-\defineaccent r A {\Aring} \defineaccent r a {\aring}
-\defineaccent r U {\Uring} \defineaccent r u {\uring}
-
-\defineaccent u A {\Abreve} \defineaccent u a {\abreve}
-\defineaccent u E {\Ebreve} \defineaccent u e {\ebreve}
-\defineaccent u G {\Gbreve} \defineaccent u g {\gbreve}
-\defineaccent u I {\Ibreve} \defineaccent u i {\ibreve} \defineaccent u {\i} {\ibreve}
-\defineaccent u O {\Obreve} \defineaccent u o {\obreve}
-\defineaccent u U {\Ubreve} \defineaccent u u {\ubreve}
-
-\defineaccent v C {\Ccaron} \defineaccent v c {\ccaron}
-\defineaccent v D {\Dcaron} \defineaccent v d {\dcaron}
-\defineaccent v E {\Ecaron} \defineaccent v e {\ecaron}
-\defineaccent v L {\Lcaron} \defineaccent v l {\lcaron}
-\defineaccent v N {\Ncaron} \defineaccent v n {\ncaron}
-\defineaccent v R {\Rcaron} \defineaccent v r {\rcaron}
-\defineaccent v S {\Scaron} \defineaccent v s {\scaron}
-\defineaccent v T {\Tcaron} \defineaccent v t {\tcaron}
-\defineaccent v Z {\Zcaron} \defineaccent v z {\zcaron}
-
-\stopencoding
-
-\startencoding[default]
-
-% vietnamese: if needed, \useencoding[enco-vna]
-
-\stopencoding
-
-% For Tobias Burnus, who wants:
-%
-% \starttypen
-% \setupinteraction[state=start]
-% \setupinteractionscreen[option=bookmark]
-% \placebookmarks[chapter]
-%
-% \starttext \chapter{F\"ur Na\"ive und Na\"\i ve} \stoptext
-% \stoptypen
-
-\startencoding[default]
-
- \defineaccent " {\i} {\idiaeresis}
-
-\stopencoding
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-agr.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-agr.mkii
deleted file mode 100644
index 9d821cca1c6..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-agr.mkii
+++ /dev/null
@@ -1,367 +0,0 @@
-%D \module
-%D [ file=enco-agr,
-%D version=2005.02.20,
-%D title=\CONTEXT\ \UNICODE\ Macros,
-%D subtitle=Ancient Greek,
-%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
-
- \definecaseself 4 % apostrofe
- \definecaseself 5 % greekbetaalt
-
-\stopmapping
-
-\startencoding[agr]
-
-\definecharacter greeksigmalunate 1
-\definecharacter endash 2
-\definecharacter emdash 3
-\definecharacter apostrophe 4
-\definecharacter greekbetaalt 5
-\definecharacter epih 6
-
-\definecharacter textbraceleft 8
-\definecharacter textbraceright 9
-\definecharacter textbreve 10
-
-\definecharacter greekSigmalunate 13
-\definecharacter greekIotadialytika 14
-\definecharacter greekUpsilondialytika 15
-
-\definecharacter greekepsilonperispomeni 18
-\definecharacter greekomicronperispomeni 19
-\definecharacter greekepsilondasiaperispomeni 20
-\definecharacter greekomicrondasiaperispomeni 21
-\definecharacter greekepsilonpsiliperispomeni 22
-\definecharacter greekomicronpsiliperispomeni 23
-\definecharacter greekiotadialytikaperispomeni 24
-\definecharacter greekupsilondialytikaperispomeni 25
-\definecharacter greekdialytikaperispomeni 26
-
-\definecharacter textbottomdot 33
-\definecharacter greeksampi 34
-\definecharacter greekdigamma 35
-\definecharacter greekstigma 36
-\definecharacter greeknumkoppa 37
-\definecharacter greekkoppa 38
-\definecharacter guilsingleright 39
-
-\definecharacter textdag 43
-
-\definecharacter greekoxia 47
-
-\definecharacter greekanoteleia 59
-\definecharacter greekdasia 60
-
-\definecharacter greekpsili 62
-\definecharacter greekquestionmark 63
-\definecharacter dialytika 64
-\definecharacter greekAlpha 65
-\definecharacter greekBeta 66
-\definecharacter greekomegaiotasub 67
-\definecharacter greekDelta 68
-\definecharacter greekEpsilon 69
-\definecharacter greekPhi 70
-\definecharacter greekGamma 71
-\definecharacter greekEta 72
-\definecharacter greekIota 73
-\definecharacter greekTheta 74
-\definecharacter greekKappa 75
-\definecharacter greekLambda 76
-\definecharacter greekMu 77
-\definecharacter greekNu 78
-\definecharacter greekOmicron 79
-\definecharacter greekPi 80
-\definecharacter greekChi 81
-\definecharacter greekRho 82
-\definecharacter greekSigma 83
-\definecharacter greekTau 84
-\definecharacter greekUpsilon 85
-\definecharacter greeketaiotasub 86
-\definecharacter greekOmega 87
-\definecharacter greekXi 88
-\definecharacter greekPsi 89
-\definecharacter greekZeta 90
-\definecharacter bracketleft 91
-\definecharacter greekvaria 92
-\definecharacter bracketright 93
-\definecharacter greekperispomeni 94
-
-\definecharacter guilsingleleft 96
-
-% the above is a quote character
-\definecharacter greekalpha 97
-\definecharacter greekbeta 98
-\definecharacter greekfinalsigma 99
-\definecharacter greekdelta 100
-\definecharacter greekepsilon 101
-\definecharacter greekphi 102
-\definecharacter greekgamma 103
-\definecharacter greeketa 104
-\definecharacter greekiota 105
-\definecharacter greektheta 106
-\definecharacter greekkappa 107
-\definecharacter greeklambda 108
-\definecharacter greekmu 109
-\definecharacter greeknu 110
-\definecharacter greekomicron 111
-\definecharacter greekpi 112
-\definecharacter greekchi 113
-\definecharacter greekrho 114
-\definecharacter greeksigma 115
-\definecharacter greektau 116
-\definecharacter greekupsilon 117
-\definecharacter greekalphaiotasub 118
-\definecharacter greekomega 119
-\definecharacter greekxi 120
-\definecharacter greekpsi 121
-\definecharacter greekzeta 122
-\definecharacter floorleft 123
-\definecharacter textbar 124
-\definecharacter floorright 125
-\definecharacter greekperispomeni 126
-
-\definecharacter quotedblleft 128
-\definecharacter quotedblright 129
-\definecharacter exclam 130
-\definecharacter greekiotadasia 131
-\definecharacter greekiotapsili 132
-\definecharacter greekiotaoxia 133
-\definecharacter greekiotadasiatonos 134
-\definecharacter greekiotapsilitonos 135
-\definecharacter greekiotavaria 136
-\definecharacter greekiotadasiavaria 137
-\definecharacter greekiotapsilivaria 138
-\definecharacter greekiotaperispomeni 139
-\definecharacter greekiotadasiaperispomeni 140
-\definecharacter greekiotapsiliperispomeni 141
-\definecharacter greekiotadialytika 142
-\definecharacter greekiotadialytikatonos 143
-\definecharacter greekiotadialytikavaria 144
-\definecharacter greekdasiaperispomeni 145
-\definecharacter greekpsiliperispomeni 146
-\definecharacter greekdasiatonos 147
-\definecharacter greekpsilitonos 148
-\definecharacter greekdasiavaria 149
-\definecharacter greekpsilivaria 150
-\definecharacter greekdialytikatonos 151
-\definecharacter greekepsilondasia 152
-\definecharacter greekepsilonpsili 153
-\definecharacter greekepsilonoxia 154
-\definecharacter greekepsilondasiatonos 155
-\definecharacter greekepsilonpsilitonos 156
-\definecharacter greekepsilonvaria 157
-\definecharacter greekepsilondasiavaria 158
-\definecharacter greekepsilonpsilivaria 159
-\definecharacter greekdialytikavaria 160
-\definecharacter greekalphadasia 161
-\definecharacter greekalphapsili 162
-\definecharacter greekalphaoxia 163
-\definecharacter greekalphadasiatonos 164
-\definecharacter greekalphapsilitonos 165
-\definecharacter greekalphavaria 166
-\definecharacter greekalphadasiavaria 167
-\definecharacter greekalphapsilivaria 168
-\definecharacter greekalphaperispomeni 169
-\definecharacter greekalphadasiaperispomeni 170
-\definecharacter greekalphapsiliperispomeni 171
-\definecharacter greekalphaiotasubdasia 172
-\definecharacter greekalphaiotasubpsili 173
-\definecharacter greekalphaiotasubtonos 174
-\definecharacter greekalphaiotasubdasiatonos 175
-\definecharacter greekalphaiotasubpsilitonos 176
-\definecharacter greekalphaiotasubvaria 177
-\definecharacter greekalphaiotasubdasiavaria 178
-\definecharacter greekalphaiotasubpsilivaria 179
-\definecharacter greekalphaiotasubperispomeni 180
-\definecharacter greekalphaiotasubdasiaperispomeni 181
-\definecharacter greekalphaiotasubpsiliperispomeni 182
-\definecharacter greekrhodasia 183
-\definecharacter greekrhopsili 184
-\definecharacter greeketadasia 185
-\definecharacter greeketapsili 186
-\definecharacter greeketaoxia 187
-\definecharacter greeketadasiatonos 188
-\definecharacter greeketapsilitonos 189
-\definecharacter greeketavaria 190
-\definecharacter greeketadasiavaria 191
-\definecharacter greeketapsilivaria 192
-\definecharacter greeketaperispomeni 193
-\definecharacter greeketadasiaperispomeni 194
-\definecharacter greeketapsiliperispomeni 195
-\definecharacter textslash 196
-\definecharacter greeketaiotasubdasia 197
-\definecharacter greeketaiotasubpsili 198
-\definecharacter greeketaiotasubtonos 199
-\definecharacter greeketaiotasubdasiatonos 200
-\definecharacter greeketaiotasubpsilitonos 201
-\definecharacter greeketaiotasubvaria 202
-\definecharacter greeketaiotasubdasiavaria 203
-\definecharacter greeketaiotasubpsilivaria 204
-\definecharacter greeketaiotasubperispomeni 205
-\definecharacter greeketaiotasubdasiaperispomeni 206
-\definecharacter greeketaiotasubpsiliperispomeni 207
-\definecharacter greekomicrondasia 208
-\definecharacter greekomicronpsili 209
-\definecharacter greekomicronoxia 210
-\definecharacter greekomicrondasiatonos 211
-\definecharacter greekomicronpsilitonos 212
-\definecharacter greekomicronvaria 213
-\definecharacter greekomicrondasiavaria 214
-\definecharacter greekomicronpsilivaria 215
-\definecharacter greekupsilondasia 216
-\definecharacter greekupsilonpsili 217
-\definecharacter greekupsilonoxia 218
-\definecharacter greekupsilondasiatonos 219
-\definecharacter greekupsilonpsilitonos 220
-\definecharacter greekupsilonvaria 221
-\definecharacter greekupsilondasiavaria 222
-\definecharacter greekupsilonpsilivaria 223
-\definecharacter greekupsilonperispomeni 224
-\definecharacter greekupsilondasiaperispomeni 225
-\definecharacter greekupsilonpsiliperispomeni 226
-\definecharacter greekupsilondiaeresis 227
-\definecharacter greekupsilondialytikatonos 228
-\definecharacter greekupsilondialytikavaria 229
-\definecharacter greekomegadasia 230
-\definecharacter greekomegapsili 231
-\definecharacter greekomegaoxia 232
-\definecharacter greekomegadasiatonos 233
-\definecharacter greekomegapsilitonos 234
-\definecharacter greekomegavaria 235
-\definecharacter greekomegadasiavaria 236
-\definecharacter greekomegapsilivaria 237
-\definecharacter greekomegaperispomeni 238
-\definecharacter greekomegadasiaperispomeni 239
-\definecharacter greekomegapsiliperispomeni 240
-\definecharacter greekomegaiotasubdasia 241
-\definecharacter greekomegaiotasubpsili 242
-\definecharacter greekomegaiotasubtonos 243
-\definecharacter greekomegaiotasubdasiatonos 244
-\definecharacter greekomegaiotasubpsilitonos 245
-\definecharacter greekomegaiotasubvaria 246
-\definecharacter greekomegaiotasubdasiavaria 247
-\definecharacter greekomegaiotasubpsilivaria 248
-\definecharacter greekomegaiotasubperispomeni 249
-\definecharacter greekomegaiotasubdasiaperispomeni 250
-\definecharacter greekomegaiotasubpsiliperispomeni 251
-\definecharacter greeknumeralsign 254
-\definecharacter greeknumeralsignlower 255
-
-\stopencoding
-
-\startencoding[default]
-
-\definecharacter greekAlphapsili {\greekpsili \greekAlpha}
-\definecharacter greekAlphadasia {\greekdasia \greekAlpha}
-\definecharacter greekAlphapsilivaria {\greekpsilivaria \greekAlpha}
-\definecharacter greekAlphadasiavaria {\greekdasiavaria \greekAlpha}
-\definecharacter greekAlphapsilitonos {\greekpsilitonos \greekAlpha}
-\definecharacter greekAlphadasiatonos {\greekdasiatonos \greekAlpha}
-\definecharacter greekAlphapsiliperispomeni {\greekpsiliperispomeni \greekAlpha}
-\definecharacter greekAlphadasiaperispomeni {\greekdasiaperispomeni \greekAlpha}
-\definecharacter greekEpsilonpsili {\greekpsili \greekEpsilon}
-\definecharacter greekEpsilondasia {\greekdasia \greekEpsilon}
-\definecharacter greekEpsilonpsilivaria {\greekpsilivaria \greekEpsilon}
-\definecharacter greekEpsilondasiavaria {\greekdasiavaria \greekEpsilon}
-\definecharacter greekEpsilonpsilitonos {\greekpsilitonos \greekEpsilon}
-\definecharacter greekEpsilondasiatonos {\greekdasiatonos \greekEpsilon}
-\definecharacter greekEtapsili {\greekpsili \greekEta}
-\definecharacter greekEtadasia {\greekdasia \greekEta}
-\definecharacter greekEtapsilivaria {\greekpsilivaria \greekEta}
-\definecharacter greekEtadasiavaria {\greekdasiavaria \greekEta}
-\definecharacter greekEtapsilitonos {\greekpsilitonos \greekEta}
-\definecharacter greekEtadasiatonos {\greekdasiatonos \greekEta}
-\definecharacter greekEtapsiliperispomeni {\greekpsiliperispomeni \greekEta}
-\definecharacter greekEtadasiaperispomeni {\greekdasiaperispomeni \greekEta}
-\definecharacter greekIotapsili {\greekpsili \greekIota}
-\definecharacter greekIotadasia {\greekdasia \greekIota}
-\definecharacter greekIotapsilivaria {\greekpsilivaria \greekIota}
-\definecharacter greekIotadasiavaria {\greekdasiavaria \greekIota}
-\definecharacter greekIotapsilitonos {\greekpsilitonos \greekIota}
-\definecharacter greekIotadasiatonos {\greekdasiatonos \greekIota}
-\definecharacter greekIotapsiliperispomeni {\greekpsiliperispomeni \greekIota}
-\definecharacter greekIotadasiaperispomeni {\greekdasiaperispomeni \greekIota}
-\definecharacter greekOmicronpsili {\greekpsili \greekOmicron}
-\definecharacter greekOmicrondasia {\greekdasia \greekOmicron}
-\definecharacter greekOmicronpsilivaria {\greekpsilivaria \greekOmicron}
-\definecharacter greekOmicrondasiavaria {\greekdasiavaria \greekOmicron}
-\definecharacter greekOmicronpsilitonos {\greekpsilitonos \greekOmicron}
-\definecharacter greekOmicrondasiatonos {\greekdasiatonos \greekOmicron}
-\definecharacter greekUpsilondasia {\greekdasia \greekUpsilon}
-\definecharacter greekUpsilondasiavaria {\greekdasiavaria \greekUpsilon}
-\definecharacter greekUpsilondasiatonos {\greekdasiatonos \greekUpsilon}
-\definecharacter greekUpsilondasiaperispomeni {\greekdasiaperispomeni \greekUpsilon}
-\definecharacter greekOmegapsili {\greekpsili \greekOmega}
-\definecharacter greekOmegadasia {\greekdasia \greekOmega}
-\definecharacter greekOmegapsilivaria {\greekpsilivaria \greekOmega}
-\definecharacter greekOmegadasiavaria {\greekdasiavaria \greekOmega}
-\definecharacter greekOmegapsilitonos {\greekpsilitonos \greekOmega}
-\definecharacter greekOmegadasiatonos {\greekdasiatonos \greekOmega}
-\definecharacter greekOmegapsiliperispomeni {\greekpsiliperispomeni \greekOmega}
-\definecharacter greekOmegadasiaperispomeni {\greekdasiaperispomeni \greekOmega}
-\definecharacter greekAlphaiotasubpsili {\greekpsili \greekAlpha \greekiota}
-\definecharacter greekAlphaiotasubdasia {\greekdasia \greekAlpha \greekiota}
-\definecharacter greekAlphaiotasubpsilivaria {\greekpsilivaria \greekAlpha \greekiota}
-\definecharacter greekAlphaiotasubdasiavaria {\greekdasiavaria \greekAlpha \greekiota}
-\definecharacter greekAlphaiotasubpsilitonos {\greekpsilitonos \greekAlpha \greekiota}
-\definecharacter greekAlphaiotasubdasiatonos {\greekdasiatonos \greekAlpha \greekiota}
-\definecharacter greekAlphaiotasubpsiliperispomeni {\greekpsiliperispomeni \greekAlpha \greekiota}
-\definecharacter greekAlphaiotasubdasiaperispomeni {\greekdasiaperispomeni \greekAlpha \greekiota}
-\definecharacter greekEtaiotasubpsili {\greekpsili \greekEta \greekiota}
-\definecharacter greekEtaiotasubdasia {\greekdasia \greekEta \greekiota}
-\definecharacter greekEtaiotasubpsilivaria {\greekpsilivaria \greekEta \greekiota}
-\definecharacter greekEtaiotasubdasiavaria {\greekdasiavaria \greekEta \greekiota}
-\definecharacter greekEtaiotasubpsilitonos {\greekpsilitonos \greekEta \greekiota}
-\definecharacter greekEtaiotasubdasiatonos {\greekdasiatonos \greekEta \greekiota}
-\definecharacter greekEtaiotasubpsiliperispomeni {\greekpsiliperispomeni \greekEta \greekiota}
-\definecharacter greekEtaiotasubdasiaperispomeni {\greekdasiaperispomeni \greekEta \greekiota}
-\definecharacter greekOmegaiotasubpsili {\greekpsili \greekOmega \greekiota}
-\definecharacter greekOmegaiotasubdasia {\greekdasia \greekOmega \greekiota}
-\definecharacter greekOmegaiotasubpsilivaria {\greekpsilivaria \greekOmega \greekiota}
-\definecharacter greekOmegaiotasubdasiavaria {\greekdasiavaria \greekOmega \greekiota}
-\definecharacter greekOmegaiotasubpsilitonos {\greekpsilitonos \greekOmega \greekiota}
-\definecharacter greekOmegaiotasubdasiatonos {\greekdasiatonos \greekOmega \greekiota}
-\definecharacter greekOmegaiotasubpsiliperispomeni {\greekpsiliperispomeni \greekOmega \greekiota}
-\definecharacter greekOmegaiotasubdasiaperispomeni {\greekdasiaperispomeni \greekOmega \greekiota}
-\definecharacter greekAlphavaria {\greekvaria \greekAlpha}
-\definecharacter greekAlphaoxia {\greekoxia \greekAlpha}
-\definecharacter greekAlphaiotasub {\greekAlpha \greekiota}
-\definecharacter greekEpsilonvaria {\greekvaria \greekEpsilon}
-\definecharacter greekEpsilonoxia {\greekoxia \greekEpsilon}
-\definecharacter greekEtavaria {\greekvaria \greekEta}
-\definecharacter greekEtaoxia {\greekoxia \greekEta}
-\definecharacter greekEtaiotasub {\greekEta \greekiota}
-\definecharacter greekIotavaria {\greekvaria \greekIota}
-\definecharacter greekIotaoxia {\greekoxia \greekIota}
-\definecharacter greekUpsilonvaria {\greekvaria \greekUpsilon}
-\definecharacter greekUpsilonoxia {\greekoxia \greekUpsilon}
-\definecharacter greekOmicronvaria {\greekvaria \greekOmicron}
-\definecharacter greekOmicronoxia {\greekoxia \greekOmicron}
-\definecharacter greekOmegavaria {\greekvaria \greekOmega}
-\definecharacter greekOmegaoxia {\greekoxia \greekOmega}
-\definecharacter greekOmegaiotasub {\greekOmega \greekiota}
-\definecharacter greekRhodasia {\greekdasia \greekRho}
-\definecharacter digamma {\greekdigamma}
-\definecharacter sampi {\greeksampi}
-\definecharacter stigma {\greekstigma}
-\definecharacter koppa {\greeknumkoppa}
-\definecharacter lunars {\greeksigmalunate}
-\definecharacter lunarS {\greekSigmalunate}
-\definecharacter halfbraceleft {\floorleft}
-\definecharacter halfbraceright {\floorright}
-\definecharacter crux {\textdag}
-
-\stopencoding
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-ans.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-ans.mkii
deleted file mode 100644
index c71b2451a60..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-ans.mkii
+++ /dev/null
@@ -1,237 +0,0 @@
-%D \module
-%D [ file=enco-ans,
-%D version=2000.05.07, % 1995.01.01,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=\YandY\ texnansi Encoding,
-%D author={Patrick Gundlach, Hans Hagen},
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 \YandY's texnansi encoding vector, which combines
-%D the best of the ansi encoding vector (prebuilt accented
-%D characters etc.) and some of \TEX's vectors.
-
-\startmapping[texnansi]
-
-\resetcaserange 128 to 158
-\resetcaserange 160 to 191
-\resetcaserange 215 to 215
-\resetcaserange 247 to 247
-
-\definecasemaps 192 to 214 lc +32 uc 0
-\definecasemaps 224 to 246 lc 0 uc -32
-\definecasemaps 216 to 222 lc +32 uc 0
-\definecasemaps 248 to 254 lc 0 uc -32
-
-\definecaseself 223
-\definecaseswap 156 140
-\definecaseswap 255 159
-
-% needed by some patterns:
-
-% \definecaseself 34 % quotedbl
-% \definecaseself 132 % quotedblbase
-% \definecaseself 147 % quotedblleft
-% \definecaseself 148 % quotedblright
-% \definecaseself 129 % quotesingle
-% \definecaseself 130 % quotesinglebase
-% \definecaseself 145 % quoteleft
-\definecaseself 146 % quoteright
-
-\stopmapping
-
-\startencoding[texnansi]
-
-\definecharacter textacute 19
-\definecharacter textbreve 21
-\definecharacter textcaron 20
-\definecharacter textcedilla 184
-\definecharacter textcircumflex 94 % 136
-\definecharacter textdiaeresis 168
-\definecharacter textdotaccent 5
-\definecharacter textgrave 18
-\definecharacter texthungarumlaut 6
-\definecharacter textmacron 175
-\definecharacter textogonek 7
-\definecharacter textring 23
-\definecharacter texttilde 152
-
-\definecharacter dotlessi 16 % 105
-\definecharacter dotlessj 17
-
-\definecharacter endash 150 % lig
-\definecharacter emdash 151 % lig
-
-\definecharacter aeligature 230
-\definecharacter AEligature 198
-\definecharacter oeligature 156
-\definecharacter OEligature 140
-
-\definecharacter ssharp 223
-
-\definecharacter thorn 254
-\definecharacter Thorn 222
-
-\definecharacter Dstroke 208 % also Eth, mapped in enco-def
-\definecharacter eth 240
-
-\definecharacter exclamdown 161
-\definecharacter questiondown 191
-
-\definecharacter copyright 169
-\definecharacter registered 174
-\definecharacter trademark 153
-
-\definecharacter sectionmark 167
-\definecharacter paragraphmark 182
-
-\definecharacter onequarter 188
-\definecharacter onehalf 189
-\definecharacter threequarter 190
-
-\definecharacter onesuperior 185
-\definecharacter twosuperior 178
-\definecharacter threesuperior 179
-
-\definecharacter textcent 162 % ?
-\definecharacter textcurrency 164
-\definecharacter texteuro 1
-\definecharacter textflorin 131
-\definecharacter textsterling 163
-\definecharacter textyen 165
-
-\definecharacter percent 37
-\definecharacter perthousand 137
-
-\definecharacter softhyphen 45
-\definecharacter periodcentered 183
-
-\definecharacter textasciicircum 142
-\definecharacter textasciitilde 158
-\definecharacter textbackslash 92
-\definecharacter textbraceleft 123
-\definecharacter textbar 124
-\definecharacter textbraceright 125
-\definecharacter textunderscore 95
-
-\definecharacter textbrokenbar 166
-\definecharacter textbullet 149
-\definecharacter textdag 134
-\definecharacter textddag 135
-\definecharacter textdegree 176
-\definecharacter textdiv 247
-\definecharacter textellipsis 133
-\definecharacter textfraction 4
-\definecharacter textlognot 172
-\definecharacter textminus 143
-\definecharacter textmu 181
-\definecharacter textmultiply 215
-\definecharacter textpm 177
-
-\definecharacter quotedbl 34
-\definecharacter quotedblbase 132
-\definecharacter quotedblleft 147
-\definecharacter quotedblright 148
-
-\definecharacter quotesingle 129
-\definecharacter quotesinglebase 130
-
-\definecharacter quoteleft 145
-\definecharacter quoteright 146
-
-\definecharacter guilsingleleft 139
-\definecharacter guilsingleright 155
-\definecharacter leftguillemot 171
-\definecharacter rightguillemot 187
-
-\definecharacter aacute 225
-\definecharacter Aacute 193
-\definecharacter eacute 233
-\definecharacter Eacute 201
-\definecharacter iacute 237
-\definecharacter Iacute 205
-\definecharacter oacute 243
-\definecharacter Oacute 211
-\definecharacter uacute 250
-\definecharacter Uacute 218
-\definecharacter yacute 253
-\definecharacter Yacute 221
-
-\definecharacter scaron 154
-\definecharacter Scaron 138
-\definecharacter zcaron 157
-\definecharacter Zcaron 141
-
-\definecharacter ccedilla 231
-\definecharacter Ccedilla 199
-
-\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 255
-\definecharacter Ydiaeresis 159
-
-\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 aring 229
-\definecharacter Aring 197
-
-\definecharacter Lstroke 128
-\definecharacter lstroke 144
-\definecharacter ostroke 248
-\definecharacter Ostoke 216
-
-\definecharacter atilde 227
-\definecharacter Atilde 195
-\definecharacter ntilde 241
-\definecharacter Ntilde 209
-\definecharacter otilde 245
-\definecharacter Otilde 213
-
-\stopencoding
-
-% will be replaced by math collection, fails anyway
-
-\startencoding[texnansi]
-
-\definecharacter mathgrave "7060
-\definecharacter mathacute "70B4
-\definecharacter mathhat "7088
-\definecharacter mathtilde "7098
-\definecharacter mathddot "70A8
-\definecharacter mathbar "70AF
-
-\stopencoding
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-cas.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-cas.mkii
deleted file mode 100644
index 6ac35eb325c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-cas.mkii
+++ /dev/null
@@ -1,143 +0,0 @@
-%D \module
-%D [ file=enco-cas,
-%D version=2005.08.23,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=Named Glyph Case Mapping,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 For quite some years \CONTEXT\ used a rather compact way of
-%D defining encoded characters as well as case maps. When late
-%D 2000 more advanced remapping features were needed (like pdf
-%D unicode remapping), named glyphs were introduced to keep the
-%D coding tables more readable. At the same time, we introduced
-%D named glyph case mapping.
-
-\defineULcharacter Acircumflex acircumflex
-\defineULcharacter Ccircumflex ccircumflex
-\defineULcharacter Ecircumflex ecircumflex
-\defineULcharacter Gcircumflex gcircumflex
-\defineULcharacter Hcircumflex hcircumflex
-\defineULcharacter Icircumflex icircumflex
-\defineULcharacter Jcircumflex jcircumflex
-\defineULcharacter Ocircumflex ocircumflex
-\defineULcharacter Scircumflex scircumflex
-\defineULcharacter Ucircumflex ucircumflex
-\defineULcharacter Wcircumflex wcircumflex
-\defineULcharacter Ycircumflex ycircumflex
-
-\defineULcharacter Agrave agrave
-\defineULcharacter Egrave egrave
-\defineULcharacter Igrave igrave
-\defineULcharacter Ograve ograve
-\defineULcharacter Ugrave ugrave
-\defineULcharacter Ygrave ygrave
-
-\defineULcharacter Atilde atilde
-\defineULcharacter Itilde itilde
-\defineULcharacter Otilde otilde
-\defineULcharacter Ntilde ntilde
-\defineULcharacter Utilde utilde
-
-\defineULcharacter Adiaeresis adiaeresis
-\defineULcharacter Ediaeresis ediaeresis
-\defineULcharacter Idiaeresis idiaeresis
-\defineULcharacter Odiaeresis odiaeresis
-\defineULcharacter Udiaeresis udiaeresis
-\defineULcharacter Ydiaeresis ydiaeresis
-
-\defineULcharacter Aacute aacute
-\defineULcharacter Cacute cacute
-\defineULcharacter Eacute eacute
-\defineULcharacter Iacute iacute
-\defineULcharacter Lacute lacute
-\defineULcharacter Nacute nacute
-\defineULcharacter Oacute oacute
-\defineULcharacter Racute racute
-\defineULcharacter Sacute sacute
-\defineULcharacter Uacute uacute
-\defineULcharacter Yacute yacute
-\defineULcharacter Zacute zacute
-
-\defineULcharacter Dstroke dstroke
-\defineULcharacter Hstroke hstroke
-\defineULcharacter Lstroke lstroke
-\defineULcharacter Lslash lslash
-\defineULcharacter Ostroke ostroke
-\defineULcharacter Tstroke tstroke
-
-\defineULcharacter Cdotaccent cdotaccent
-\defineULcharacter Edotaccent edotaccent
-\defineULcharacter Gdotaccent gdotaccent
-\defineULcharacter Idotaccent idotaccent
-\defineULcharacter Zdotaccent zdotaccent
-
-\defineULcharacter Amacron amacron
-\defineULcharacter Emacron emacron
-\defineULcharacter Imacron imacron
-\defineULcharacter Omacron omacron
-\defineULcharacter Umacron umacron
-
-\defineULcharacter Ccedilla ccedilla
-\defineULcharacter Gcedilla gcedilla
-\defineULcharacter Kcedilla kcedilla
-\defineULcharacter Lcedilla lcedilla
-\defineULcharacter Ncedilla ncedilla
-\defineULcharacter Rcedilla rcedilla
-\defineULcharacter Scedilla scedilla
-\defineULcharacter Tcedilla tcedilla
-
-\defineULcharacter Ccommaaccent ccommaaccent
-\defineULcharacter Gcommaaccent gcommaaccent
-\defineULcharacter Kcommaaccent kcommaaccent
-\defineULcharacter Lcommaaccent lcommaaccent
-\defineULcharacter Ncommaaccent ncommaaccent
-\defineULcharacter Rcommaaccent rcommaaccent
-\defineULcharacter Scommaaccent scommaaccent
-\defineULcharacter Tcommaaccent tcommaaccent
-
-\defineULcharacter Ohungarumlaut ohungarumlaut
-\defineULcharacter Uhungarumlaut uhungarumlaut
-
-\defineULcharacter Aogonek aogonek
-\defineULcharacter Eogonek eogonek
-\defineULcharacter Iogonek iogonek
-\defineULcharacter Uogonek uogonek
-
-\defineULcharacter Aring aring
-\defineULcharacter Uring uring
-
-\defineULcharacter Abreve abreve
-\defineULcharacter Ebreve ebreve
-\defineULcharacter Gbreve gbreve
-\defineULcharacter Ibreve ibreve
-\defineULcharacter Obreve obreve
-\defineULcharacter Ubreve ubreve
-
-\defineULcharacter Ccaron ccaron
-\defineULcharacter Dcaron dcaron
-\defineULcharacter Ecaron ecaron
-\defineULcharacter Lcaron lcaron
-\defineULcharacter Ncaron ncaron
-\defineULcharacter Rcaron rcaron
-\defineULcharacter Scaron scaron
-\defineULcharacter Tcaron tcaron
-\defineULcharacter Zcaron zcaron
-
-\defineULcharacter dotlessI dotlessi
-\defineULcharacter dotlessJ dotlessj
-
-\defineULcharacter AEligature aeligature
-\defineULcharacter OEligature oeligature
-\defineULcharacter Ssharp ssharp
-\defineULcharacter IJligature ijligature
-
-\defineULcharacter Eth eth
-\defineULcharacter Thorn thorn
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-chi.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-chi.mkii
deleted file mode 100644
index 727720565fd..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-chi.mkii
+++ /dev/null
@@ -1,371 +0,0 @@
-%D \module
-%D [ file=enco-chi,
-%D version=1999.12.02,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=Traditional and Simplified Chinese,
-%D author={Wang Lei \& Hans Hagen},
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% 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.
-
-% 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
-\defineuclass 1 161 95
-\defineuclass 1 161 97
-\defineuclass 1 161 99
-\defineuclass 1 161 101
-\defineuclass 1 161 103
-\defineuclass 1 161 105
-\defineuclass 1 161 107
-\defineuclass 1 161 111
-\defineuclass 1 161 111
-\defineuclass 1 161 113
-\defineuclass 1 161 115
-\defineuclass 1 161 117
-\defineuclass 1 161 119
-\defineuclass 1 161 121
-\defineuclass 1 161 123
-\defineuclass 1 161 125
-\defineuclass 1 161 161
-\defineuclass 1 161 163
-\defineuclass 1 161 165
-\defineuclass 1 161 167
-\defineuclass 1 161 169
-\defineuclass 1 161 171
-
-\defineuclass 3 161 69
-\defineuclass 3 161 75
-\defineuclass 3 161 76
-
-\defineuclass 2 161 65
-\defineuclass 2 161 66
-\defineuclass 2 161 67
-\defineuclass 2 161 68
-\defineuclass 2 161 70
-\defineuclass 2 161 71
-\defineuclass 2 161 72
-\defineuclass 2 161 73
-\defineuclass 2 161 74
-\defineuclass 2 161 77
-\defineuclass 2 161 78
-\defineuclass 2 161 79
-\defineuclass 2 161 80
-\defineuclass 2 161 81
-\defineuclass 2 161 82
-\defineuclass 2 161 83
-\defineuclass 2 161 84
-\defineuclass 2 161 88
-\defineuclass 2 161 94
-\defineuclass 2 161 96
-\defineuclass 2 161 98
-\defineuclass 2 161 100
-\defineuclass 2 161 102
-\defineuclass 2 161 104
-\defineuclass 2 161 106
-\defineuclass 2 161 108
-\defineuclass 2 161 110
-\defineuclass 2 161 112
-\defineuclass 2 161 114
-\defineuclass 2 161 116
-\defineuclass 2 161 118
-\defineuclass 2 161 120
-\defineuclass 2 161 122
-\defineuclass 2 161 124
-\defineuclass 2 161 126
-\defineuclass 2 161 162
-\defineuclass 2 161 164
-\defineuclass 2 161 166
-\defineuclass 2 161 168
-\defineuclass 2 161 170
-\defineuclass 2 161 172
-\defineuclass 2 161 196
-\defineuclass 2 161 227
-\defineuclass 2 162 88
-\defineuclass 2 163 223
-
-\defineudigit 0 162 179
-\defineudigit 1 164 64
-\defineudigit 2 164 71
-\defineudigit 3 164 84
-\defineudigit 4 165 124
-\defineudigit 5 164 173
-\defineudigit 6 164 187
-\defineudigit 7 164 67
-\defineudigit 8 164 75
-\defineudigit 9 164 69
-\defineudigit 10 164 81
-\defineudigit 100 166 202
-\defineudigit 1000 164 100
-\defineudigit 10000 201 69
-\defineudigit 100000000 187 245
-
-\defineudigit 0* 185 115
-\defineudigit 1* 179 252
-\defineudigit 2* 182 76
-\defineudigit 3* 176 209
-\defineudigit 4* 184 118
-\defineudigit 5* 165 238
-\defineudigit 6* 179 176
-\defineudigit 7* 172 110
-\defineudigit 8* 174 195
-\defineudigit 9* 168 104
-\defineudigit 10* 172 66
-\defineudigit 100* 168 213
-\defineudigit 1000* 165 97
-\defineudigit 10000* 184 85
-\defineudigit 100000000* 187 245
-
-\defineudigit 20 164 220
-\defineudigit 21 164 64
-\defineudigit 22 164 71
-\defineudigit 23 164 84
-\defineudigit 24 165 124
-\defineudigit 25 164 173
-\defineudigit 26 164 187
-\defineudigit 27 164 67
-\defineudigit 28 164 75
-\defineudigit 29 164 69
-
-\defineudigit 30 164 202
-\defineudigit 31 164 64
-\defineudigit 32 164 71
-\defineudigit 33 164 84
-\defineudigit 34 165 124
-\defineudigit 35 164 173
-\defineudigit 36 164 187
-\defineudigit 37 164 67
-\defineudigit 38 164 75
-\defineudigit 39 164 69
-
-\stopencoding
-
-\startencoding[gbk]
-
-\defineuclass 1 161 174
-\defineuclass 1 161 176
-\defineuclass 1 161 178
-\defineuclass 1 161 180
-\defineuclass 1 161 182
-\defineuclass 1 161 184
-\defineuclass 1 161 186
-\defineuclass 1 161 188
-\defineuclass 1 161 190
-\defineuclass 1 163 168
-\defineuclass 1 163 219
-\defineuclass 1 163 224
-\defineuclass 1 163 251
-
-\defineuclass 3 161 164
-\defineuclass 3 161 167
-\defineuclass 3 161 173
-\defineuclass 3 163 190
-
-\defineuclass 2 161 162
-\defineuclass 2 161 163
-\defineuclass 2 161 170
-\defineuclass 2 161 171
-\defineuclass 2 161 175
-\defineuclass 2 161 177
-\defineuclass 2 161 179
-\defineuclass 2 161 181
-\defineuclass 2 161 183
-\defineuclass 2 161 185
-\defineuclass 2 161 187
-\defineuclass 2 161 189
-\defineuclass 2 161 191
-\defineuclass 2 161 203
-\defineuclass 2 161 227
-\defineuclass 2 161 228
-\defineuclass 2 161 229
-\defineuclass 2 163 161
-\defineuclass 2 163 162
-\defineuclass 2 163 167
-\defineuclass 2 163 169
-\defineuclass 2 163 172
-\defineuclass 2 163 174
-\defineuclass 2 163 186
-\defineuclass 2 163 187
-\defineuclass 2 163 191
-\defineuclass 2 163 221
-\defineuclass 2 163 253
-
-\defineudigit 0 161 240
-\defineudigit 1 210 187
-\defineudigit 2 182 254
-\defineudigit 3 200 253
-\defineudigit 4 203 196
-\defineudigit 5 206 229
-\defineudigit 6 193 249
-\defineudigit 7 198 223
-\defineudigit 8 176 203
-\defineudigit 9 190 197
-\defineudigit 10 202 174
-\defineudigit 100 176 217
-\defineudigit 1000 199 167
-\defineudigit 10000 205 242
-\defineudigit 100000000 210 218
-
-\defineudigit 0* 193 227
-\defineudigit 1* 210 188
-\defineudigit 2* 183 161
-\defineudigit 3* 200 254
-\defineudigit 4* 203 193
-\defineudigit 5* 206 233
-\defineudigit 6* 194 189
-\defineudigit 7* 198 226
-\defineudigit 8* 176 198
-\defineudigit 9* 190 193
-\defineudigit 10* 202 176
-\defineudigit 100* 176 219
-\defineudigit 1000* 199 170
-\defineudigit 10000* 200 102
-\defineudigit 100000000* 210 218
-
-\defineudigit 20 216 165
-\defineudigit 21 210 187
-\defineudigit 22 182 254
-\defineudigit 23 200 253
-\defineudigit 24 203 196
-\defineudigit 25 206 229
-\defineudigit 26 193 249
-\defineudigit 27 198 223
-\defineudigit 28 176 203
-\defineudigit 29 190 197
-
-\defineudigit 30 216 166
-\defineudigit 31 210 187
-\defineudigit 32 182 254
-\defineudigit 33 200 253
-\defineudigit 34 203 196
-\defineudigit 35 206 229
-\defineudigit 36 193 249
-\defineudigit 37 198 223
-\defineudigit 38 176 203
-\defineudigit 39 190 197
-
-\stopencoding
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-com.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-com.mkii
deleted file mode 100644
index 620ac0c96ee..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-com.mkii
+++ /dev/null
@@ -1,37 +0,0 @@
-%D \module
-%D [ file=enco-com,
-%D version=2000.20.12, % split from base file
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=Composed Characters Commands,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Here we map some \quote {short} names onto the more
-%D verbose glyph names.
-
-\def\AA{\Aring}
-\def\aa{\aring}
-\def\AE{\AEligature}
-\def\ae{\aeligature}
-\def\CC{\Ccedilla}
-\def\cc{\ccedilla}
-\def \L{\Lstroke}
-\def \l{\lstroke}
-\def \O{\Ostroke}
-\def \o{\ostroke}
-\def\OE{\OEligature}
-\def\oe{\oeligature}
-\def\SZ{\Ssharp}
-\def\sz{\ssharp}
-\def\SS{\ssharp}
-\def\IJ{\IJligature}
-\def\ij{\ijligature}
-\def \i{\dotlessi}
-\def \j{\dotlessj}
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-cyr.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-cyr.mkii
deleted file mode 100644
index aa412d8d3a4..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-cyr.mkii
+++ /dev/null
@@ -1,1037 +0,0 @@
-%D \module
-%D [ file=enco-cyr,
-%D version=2003.01.24,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=Cyrillic,
-%D author=...,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 following kerning test is inspired by a test file
-%D provided by Victor Figurnov. I hope he still recognizes
-%D some bit and pieces.
-%D
-%D \starttyping
-%D \setupoutput[pdftex]
-%D
-%D \startMPenvironment[global]
-%D \useregime[cyr]
-%D \useencoding[cyr]
-%D \mainlanguage[ru]
-%D \enableregime[cp1251]
-%D \setupbodyfont[cyr]
-%D \stopMPenvironment
-%D
-%D \startbuffer
-%D \starttabulate[|l|l|l|]
-%D \NC \ruledhbox{Ãäå} \NC \ruledhbox{AV} \NC with kerning \NC \NR
-%D \NC \ruledhbox{Ã{}ä{}å} \NC \ruledhbox{A{}V} \NC without kerning \NC \NR
-%D \NC \ruledhbox{\tfd Ãäå} \NC \ruledhbox{\tfd AV} \NC with kerning \NC \NR
-%D \NC \ruledhbox{\tfd Ã{}ä{}å} \NC \ruledhbox{\tfd A{}V} \NC without kerning \NC \NR
-%D \stoptabulate
-%D
-%D \showkerning{Êàê ñäåëàòü äîêóìåíò}
-%D \stopbuffer
-%D
-%D \starttext
-%D
-%D \title{Kerning test}
-%D
-%D \typebuffer
-%D
-%D \rm \subject{Serif font} \getbuffer
-%D \ss \subject{SansSerif font} \getbuffer
-%D \tt \subject{MonoSpacec font} \getbuffer
-%D
-%D \stoptext
-%D \stoptyping
-
-%D We start with a fallback, define by HH, who assumes that
-%D this is phonetic.
-
-\startmapping[t2a]
-
-\resetcaserange 128 to 255
-
-\definecasemaps 192 to 223 lc +32 uc 0 % base letters (russian)
-\definecasemaps 224 to 255 lc 0 uc -32
-
-\definecasemaps 128 to 156 lc +32 uc 0 % extra letters (cyrillic and old-slav)
-\definecasemaps 160 to 188 lc 0 uc -32
-
-\definecasemap 73 105 73 \definecasemap 105 105 73 % cyrillicII
-\definecasemap 74 106 74 \definecasemap 106 106 74 % cyrillicJE
-\definecasemap 81 113 81 \definecasemap 113 113 81 % cyrillicQ
-\definecasemap 87 119 87 \definecasemap 119 119 87 % cyrillicW
-
-\stopmapping
-
-\startencoding[t2a]
-
-\definecharacter textgrave 0
-\definecharacter textacute 1
-\definecharacter textcircumflex 2
-\definecharacter texttilde 3
-\definecharacter textdiaeresis 4
-\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 textcyrillicflex 18
-\definecharacter textdblgrave 19
-\definecharacter textcyrillicbreve 20
-
-\definecharacter endash 21
-\definecharacter emdash 22
-
-\definecharacter textcompwordmark 23
-\definecharacter textbackslash 92
-\definecharacter textasciicircum 94
-\definecharacter textunderscore 95
-\definecharacter textbraceleft 123
-\definecharacter textbraceright 125
-\definecharacter textasciitilde 126
-\definecharacter textnumero 157
-\definecharacter textcurrency 158
-\definecharacter sectionmark 159
-
-\definecharacter quotedbl 34
-\definecharacter quoteleft 96
-\definecharacter upperleftsingleninequote 39
-\definecharacter quotedblleft 16
-\definecharacter quotedblright 17
-\definecharacter lowerleftdoubleninequote 189
-\definecharacter upperrightdoublesixquote 16
-\definecharacter upperrightdoubleninequote 17
-\definecharacter quotedblbase 189
-
-\definecharacter cyrillicpalochka 13
-\definecharacter cyrilliclangle 14
-\definecharacter cyrillicrangle 15
-
-\definecharacter leftguillemot 190
-\definecharacter rightguillemot 191
-\definecharacter dotlessi 25
-
-\definecharacter cyrillicA 192
-\definecharacter cyrillica 224
-\definecharacter cyrillicB 193
-\definecharacter cyrillicb 225
-\definecharacter cyrillicV 194
-\definecharacter cyrillicv 226
-\definecharacter cyrillicG 195
-\definecharacter cyrillicg 227
-\definecharacter cyrillicD 196
-\definecharacter cyrillicd 228
-\definecharacter cyrillicE 197
-\definecharacter cyrillice 229
-\definecharacter cyrillicZH 198
-\definecharacter cyrilliczh 230
-\definecharacter cyrillicZ 199
-\definecharacter cyrillicz 231
-\definecharacter cyrillicI 200
-\definecharacter cyrillici 232
-\definecharacter cyrillicISHRT 201
-\definecharacter cyrillicishrt 233
-\definecharacter cyrillicK 202
-\definecharacter cyrillick 234
-\definecharacter cyrillicL 203
-\definecharacter cyrillicl 235
-\definecharacter cyrillicM 204
-\definecharacter cyrillicm 236
-\definecharacter cyrillicN 205
-\definecharacter cyrillicn 237
-\definecharacter cyrillicO 206
-\definecharacter cyrillico 238
-\definecharacter cyrillicP 207
-\definecharacter cyrillicp 239
-\definecharacter cyrillicR 208
-\definecharacter cyrillicr 240
-\definecharacter cyrillicS 209
-\definecharacter cyrillics 241
-\definecharacter cyrillicT 210
-\definecharacter cyrillict 242
-\definecharacter cyrillicU 211
-\definecharacter cyrillicu 243
-\definecharacter cyrillicF 212
-\definecharacter cyrillicf 244
-\definecharacter cyrillicH 213
-\definecharacter cyrillich 245
-\definecharacter cyrillicC 214
-\definecharacter cyrillicc 246
-\definecharacter cyrillicCH 215
-\definecharacter cyrillicch 247
-\definecharacter cyrillicSH 216
-\definecharacter cyrillicsh 248
-\definecharacter cyrillicSHCH 217
-\definecharacter cyrillicshch 249
-\definecharacter cyrillicHRDSN 218
-\definecharacter cyrillichrdsn 250
-\definecharacter cyrillicERY 219
-\definecharacter cyrillicery 251
-\definecharacter cyrillicSFTSN 220
-\definecharacter cyrillicsftsn 252
-\definecharacter cyrillicEREV 221
-\definecharacter cyrillicerev 253
-\definecharacter cyrillicYU 222
-\definecharacter cyrillicyu 254
-\definecharacter cyrillicYA 223
-\definecharacter cyrillicya 255
-\definecharacter cyrillicGUP 128
-\definecharacter cyrillicgup 160
-\definecharacter cyrillicGHCRS 129
-\definecharacter cyrillicghcrs 161
-\definecharacter cyrillicDJE 130
-\definecharacter cyrillicdje 162
-\definecharacter cyrillicTSHE 131
-\definecharacter cyrillictshe 163
-\definecharacter cyrillicSHHA 132
-\definecharacter cyrillicshha 164
-\definecharacter cyrillicZHDSC 133
-\definecharacter cyrilliczhdsc 165
-\definecharacter cyrillicZDSC 134
-\definecharacter cyrilliczdsc 166
-\definecharacter cyrillicLJE 135
-\definecharacter cyrilliclje 167
-\definecharacter cyrillicYI 136
-\definecharacter cyrillicyi 168
-\definecharacter cyrillicKDSC 137
-\definecharacter cyrillickdsc 169
-\definecharacter cyrillicKBEAK 138
-\definecharacter cyrillickbeak 170
-\definecharacter cyrillicKVCRS 139
-\definecharacter cyrillickvcrs 171
-\definecharacter cyrillicAE 140
-\definecharacter cyrillicae 172
-\definecharacter cyrillicNDSC 141
-\definecharacter cyrillicndsc 173
-\definecharacter cyrillicNG 142
-\definecharacter cyrillicng 174
-\definecharacter cyrillicDZE 143
-\definecharacter cyrillicdze 175
-\definecharacter cyrillicOTLD 144
-\definecharacter cyrillicotld 176
-\definecharacter cyrillicSDSC 145
-\definecharacter cyrillicsdsc 177
-\definecharacter cyrillicUSHRT 146
-\definecharacter cyrillicushrt 178
-\definecharacter cyrillicY 147
-\definecharacter cyrillicy 179
-\definecharacter cyrillicYHCRS 148
-\definecharacter cyrillicyhcrs 180
-\definecharacter cyrillicHDSC 149
-\definecharacter cyrillichdsc 181
-\definecharacter cyrillicDZHE 150
-\definecharacter cyrillicdzhe 182
-\definecharacter cyrillicCHVCRS 151
-\definecharacter cyrillicchvcrs 183
-\definecharacter cyrillicCHRDSC 152
-\definecharacter cyrillicchrdsc 184
-\definecharacter cyrillicIE 153
-\definecharacter cyrillicie 185
-\definecharacter cyrillicSCHWA 154
-\definecharacter cyrillicschwa 186
-\definecharacter cyrillicNJE 155
-\definecharacter cyrillicnje 187
-\definecharacter cyrillicYO 156
-\definecharacter cyrillicyo 188
-\definecharacter cyrillicII 73
-\definecharacter cyrillicii 105
-\definecharacter cyrillicJE 74
-\definecharacter cyrillicje 106
-\definecharacter cyrillicQ 81
-\definecharacter cyrillicq 113
-\definecharacter cyrillicW 87
-\definecharacter cyrillicw 119
-
-% \definecharacter textperthousand {\%\char 24 }
-% \definecharacter textpertenthousand {\%\char 24\char 24 }
-
-\definecharacter cyrillicgheupturn 160 % to satisfy the patterns
-
-\stopencoding
-
-\startmapping[t2b]
-
-\resetcaserange 128 to 255
-
-\definecasemaps 192 to 223 lc +32 uc 0 % base letters (russian)
-\definecasemaps 224 to 255 lc 0 uc -32
-
-\definecasemaps 128 to 156 lc +32 uc 0 % extra letters (cyrillic and old-slav)
-\definecasemaps 160 to 188 lc 0 uc -32
-
-\definecasemap 73 105 73 \definecasemap 105 105 73 % cyrillicII
-\definecasemap 74 106 74 \definecasemap 106 106 74 % cyrillicJE
-\definecasemap 81 113 81 \definecasemap 113 113 81 % cyrillicQ
-\definecasemap 83 115 83 \definecasemap 115 115 83 % cyrillicDZE
-\definecasemap 87 119 87 \definecasemap 119 119 87 % cyrillicW
-
-\stopmapping
-
-\startencoding[t2b]
-
-\definecharacter textgrave 0
-\definecharacter textacute 1
-\definecharacter textcircumflex 2
-\definecharacter texttilde 3
-\definecharacter textdiaeresis 4
-\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 textcyrillicflex 18
-\definecharacter textdblgrave 19
-\definecharacter textcyrillicbreve 20
-
-\definecharacter endash 21
-\definecharacter emdash 22
-
-\definecharacter textcompwordmark 23
-\definecharacter textbackslash 92
-\definecharacter textasciicircum 94
-\definecharacter textunderscore 95
-\definecharacter textbraceleft 123
-\definecharacter textbraceright 125
-\definecharacter textasciitilde 126
-\definecharacter textnumero 157
-\definecharacter textcurrency 158
-\definecharacter sectionmark 159
-\definecharacter quotedbl 34
-\definecharacter quoteleft 96
-\definecharacter upperleftsingleninequote 39
-\definecharacter quotedblleft 16
-\definecharacter quotedblright 17
-\definecharacter lowerleftdoubleninequote 189
-
-\definecharacter upperrightdoublesixquote 16
-\definecharacter upperrightdoubleninequote 17
-\definecharacter quotedblbase 189
-
-\definecharacter cyrillicpalochka 13
-\definecharacter cyrilliclangle 14
-\definecharacter cyrillicrangle 15
-
-\definecharacter leftguillemot 190
-\definecharacter rightguillemot 191
-\definecharacter dotlessi 25
-
-\definecharacter cyrillicA 192
-\definecharacter cyrillica 224
-\definecharacter cyrillicB 193
-\definecharacter cyrillicb 225
-\definecharacter cyrillicV 194
-\definecharacter cyrillicv 226
-\definecharacter cyrillicG 195
-\definecharacter cyrillicg 227
-\definecharacter cyrillicD 196
-\definecharacter cyrillicd 228
-\definecharacter cyrillicE 197
-\definecharacter cyrillice 229
-\definecharacter cyrillicZH 198
-\definecharacter cyrilliczh 230
-\definecharacter cyrillicZ 199
-\definecharacter cyrillicz 231
-\definecharacter cyrillicI 200
-\definecharacter cyrillici 232
-\definecharacter cyrillicISHRT 201
-\definecharacter cyrillicishrt 233
-\definecharacter cyrillicK 202
-\definecharacter cyrillick 234
-\definecharacter cyrillicL 203
-\definecharacter cyrillicl 235
-\definecharacter cyrillicM 204
-\definecharacter cyrillicm 236
-\definecharacter cyrillicN 205
-\definecharacter cyrillicn 237
-\definecharacter cyrillicO 206
-\definecharacter cyrillico 238
-\definecharacter cyrillicP 207
-\definecharacter cyrillicp 239
-\definecharacter cyrillicR 208
-\definecharacter cyrillicr 240
-\definecharacter cyrillicS 209
-\definecharacter cyrillics 241
-\definecharacter cyrillicT 210
-\definecharacter cyrillict 242
-\definecharacter cyrillicU 211
-\definecharacter cyrillicu 243
-\definecharacter cyrillicF 212
-\definecharacter cyrillicf 244
-\definecharacter cyrillicH 213
-\definecharacter cyrillich 245
-\definecharacter cyrillicC 214
-\definecharacter cyrillicc 246
-\definecharacter cyrillicCH 215
-\definecharacter cyrillicch 247
-\definecharacter cyrillicSH 216
-\definecharacter cyrillicsh 248
-\definecharacter cyrillicSHCH 217
-\definecharacter cyrillicshch 249
-\definecharacter cyrillicHRDSN 218
-\definecharacter cyrillichrdsn 250
-\definecharacter cyrillicERY 219
-\definecharacter cyrillicery 251
-\definecharacter cyrillicSFTSN 220
-\definecharacter cyrillicsftsn 252
-\definecharacter cyrillicEREV 221
-\definecharacter cyrillicerev 253
-\definecharacter cyrillicYU 222
-\definecharacter cyrillicyu 254
-\definecharacter cyrillicYA 223
-\definecharacter cyrillicya 255
-\definecharacter cyrillicGDSCHCRS 128
-\definecharacter cyrillicgdschcrs 160
-\definecharacter cyrillicGHCRS 129
-\definecharacter cyrillicghcrs 161
-\definecharacter cyrillicGDSC 130
-\definecharacter cyrillicgdsc 162
-\definecharacter cyrillicGHK 131
-\definecharacter cyrillicghk 163
-\definecharacter cyrillicSHHA 132
-\definecharacter cyrillicshha 164
-\definecharacter cyrillicZHDSC 133
-\definecharacter cyrilliczhdsc 165
-\definecharacter cyrillicDELTA 134
-\definecharacter cyrillicdelta 166
-\definecharacter cyrillicABHDZE 135
-\definecharacter cyrillicabhdze 167
-\definecharacter cyrillicLJE 136
-\definecharacter cyrilliclje 168
-\definecharacter cyrillicKDSC 137
-\definecharacter cyrillickdsc 169
-\definecharacter cyrillicLDSC 138
-\definecharacter cyrillicldsc 170
-\definecharacter cyrillicKHK 139
-\definecharacter cyrillickhk 171
-\definecharacter cyrillicLHK 140
-\definecharacter cyrilliclhk 172
-\definecharacter cyrillicNDSC 141
-\definecharacter cyrillicndsc 173
-\definecharacter cyrillicNG 142
-\definecharacter cyrillicng 174
-\definecharacter cyrillicNHK 143
-\definecharacter cyrillicnhk 175
-\definecharacter cyrillicOTLD 144
-\definecharacter cyrillicotld 176
-\definecharacter cyrillicSACRS 145
-\definecharacter cyrillicsacrs 177
-\definecharacter cyrillicUSHRT 146
-\definecharacter cyrillicushrt 178
-\definecharacter cyrillicY 147
-\definecharacter cyrillicy 179
-\definecharacter cyrillicHHCRS 148
-\definecharacter cyrillichhcrs 180
-\definecharacter cyrillicHDSC 149
-\definecharacter cyrillichdsc 181
-\definecharacter cyrillicHHK 150
-\definecharacter cyrillichhk 182
-\definecharacter cyrillicCHLDSC 151
-\definecharacter cyrillicchldsc 183
-\definecharacter cyrillicCHRDSC 152
-\definecharacter cyrillicchrdsc 184
-\definecharacter cyrillicNJE 153
-\definecharacter cyrillicnje 185
-\definecharacter cyrillicSCHWA 154
-\definecharacter cyrillicschwa 186
-\definecharacter cyrillicEPS 155
-\definecharacter cyrilliceps 187
-\definecharacter cyrillicYO 156
-\definecharacter cyrillicyo 188
-\definecharacter cyrillicII 73
-\definecharacter cyrillicii 105
-\definecharacter cyrillicJE 74
-\definecharacter cyrillicje 106
-\definecharacter cyrillicQ 81
-\definecharacter cyrillicq 113
-\definecharacter cyrillicDZE 83
-\definecharacter cyrillicdze 115
-\definecharacter cyrillicW 87
-\definecharacter cyrillicw 119
-
-\stopencoding
-
-\startmapping[t2c]
-
-\resetcaserange 128 to 255
-
-\definecasemaps 192 to 223 lc +32 uc 0 % base letters (russian)
-\definecasemaps 224 to 255 lc 0 uc -32
-
-\definecasemaps 128 to 156 lc +32 uc 0 % extra letters (cyrillic and old-slav)
-\definecasemaps 160 to 188 lc 0 uc -32
-
-\definecasemap 73 105 73 \definecasemap 105 105 73 % cyrillicII
-\definecasemap 74 106 74 \definecasemap 106 106 74 % cyrillicJE
-\definecasemap 81 113 81 \definecasemap 113 113 81 % cyrillicQ
-\definecasemap 83 115 83 \definecasemap 115 115 83 % cyrillicDZE
-\definecasemap 87 119 87 \definecasemap 119 119 87 % cyrillicW
-
-\stopmapping
-
-\startencoding[t2c]
-
-\definecharacter textgrave 0
-\definecharacter textacute 1
-\definecharacter textcircumflex 2
-\definecharacter texttilde 3
-\definecharacter textdiaeresis 4
-\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 textcyrillicflex 18
-\definecharacter textdblgrave 19
-\definecharacter textcyrillicbreve 20
-
-\definecharacter endash 21
-\definecharacter emdash 22
-
-\definecharacter textcompwordmark 23
-\definecharacter textbackslash 92
-\definecharacter textasciicircum 94
-\definecharacter textunderscore 95
-\definecharacter textbraceleft 123
-\definecharacter textbraceright 125
-\definecharacter textasciitilde 126
-\definecharacter textnumero 157
-\definecharacter textcurrency 158
-\definecharacter sectionmark 159
-\definecharacter quotedbl 34
-\definecharacter quoteleft 96
-\definecharacter upperleftsingleninequote 39
-\definecharacter quotedblleft 16
-\definecharacter quotedblright 17
-\definecharacter lowerleftdoubleninequote 189
-\definecharacter upperrightdoublesixquote 16
-\definecharacter upperrightdoubleninequote 17
-\definecharacter quotedblbase 189
-
-\definecharacter cyrillicpalochka 13
-\definecharacter cyrilliclangle 14
-\definecharacter cyrillicrangle 15
-
-\definecharacter leftguillemot 190
-\definecharacter rightguillemot 191
-
-\definecharacter dotlessi 25
-
-\definecharacter cyrillicA 192
-\definecharacter cyrillica 224
-\definecharacter cyrillicB 193
-\definecharacter cyrillicb 225
-\definecharacter cyrillicV 194
-\definecharacter cyrillicv 226
-\definecharacter cyrillicG 195
-\definecharacter cyrillicg 227
-\definecharacter cyrillicD 196
-\definecharacter cyrillicd 228
-\definecharacter cyrillicE 197
-\definecharacter cyrillice 229
-\definecharacter cyrillicZH 198
-\definecharacter cyrilliczh 230
-\definecharacter cyrillicZ 199
-\definecharacter cyrillicz 231
-\definecharacter cyrillicI 200
-\definecharacter cyrillici 232
-\definecharacter cyrillicISHRT 201
-\definecharacter cyrillicishrt 233
-\definecharacter cyrillicK 202
-\definecharacter cyrillick 234
-\definecharacter cyrillicL 203
-\definecharacter cyrillicl 235
-\definecharacter cyrillicM 204
-\definecharacter cyrillicm 236
-\definecharacter cyrillicN 205
-\definecharacter cyrillicn 237
-\definecharacter cyrillicO 206
-\definecharacter cyrillico 238
-\definecharacter cyrillicP 207
-\definecharacter cyrillicp 239
-\definecharacter cyrillicR 208
-\definecharacter cyrillicr 240
-\definecharacter cyrillicS 209
-\definecharacter cyrillics 241
-\definecharacter cyrillicT 210
-\definecharacter cyrillict 242
-\definecharacter cyrillicU 211
-\definecharacter cyrillicu 243
-\definecharacter cyrillicF 212
-\definecharacter cyrillicf 244
-\definecharacter cyrillicH 213
-\definecharacter cyrillich 245
-\definecharacter cyrillicC 214
-\definecharacter cyrillicc 246
-\definecharacter cyrillicCH 215
-\definecharacter cyrillicch 247
-\definecharacter cyrillicSH 216
-\definecharacter cyrillicsh 248
-\definecharacter cyrillicSHCH 217
-\definecharacter cyrillicshch 249
-\definecharacter cyrillicHRDSN 218
-\definecharacter cyrillichrdsn 250
-\definecharacter cyrillicERY 219
-\definecharacter cyrillicery 251
-\definecharacter cyrillicSFTSN 220
-\definecharacter cyrillicsftsn 252
-\definecharacter cyrillicEREV 221
-\definecharacter cyrillicerev 253
-\definecharacter cyrillicYU 222
-\definecharacter cyrillicyu 254
-\definecharacter cyrillicYA 223
-\definecharacter cyrillicya 255
-\definecharacter cyrillicPHK 128
-\definecharacter cyrillicphk 160
-\definecharacter cyrillicTETSE 129
-\definecharacter cyrillictetse 161
-\definecharacter cyrillicTDSC 130
-\definecharacter cyrillictdsc 162
-\definecharacter cyrillicGHK 131
-\definecharacter cyrillicghk 163
-\definecharacter cyrillicSHHA 132
-\definecharacter cyrillicshha 164
-\definecharacter cyrillicRDSC 133
-\definecharacter cyrillicrdsc 165
-\definecharacter cyrillicRTICK 134
-\definecharacter cyrillicrtick 166
-\definecharacter cyrillicABHDZE 135
-\definecharacter cyrillicabhdze 167
-\definecharacter cyrillicMDSC 136
-\definecharacter cyrillicmdsc 168
-\definecharacter cyrillicKDSC 137
-\definecharacter cyrillickdsc 169
-\definecharacter cyrillicLDSC 138
-\definecharacter cyrillicldsc 170
-\definecharacter cyrillicKHCRS 139
-\definecharacter cyrillickhcrs 171
-\definecharacter cyrillicLHK 140
-\definecharacter cyrilliclhk 172
-\definecharacter cyrillicNDSC 141
-\definecharacter cyrillicndsc 173
-\definecharacter cyrillicMHK 142
-\definecharacter cyrillicmhk 174
-\definecharacter cyrillicNHK 143
-\definecharacter cyrillicnhk 175
-\definecharacter cyrillicOTLD 144
-\definecharacter cyrillicotld 176
-\definecharacter cyrillicABHCH 145
-\definecharacter cyrillicabhch 177
-\definecharacter cyrillicABHCHDSC 146
-\definecharacter cyrillicabhchdsc 178
-\definecharacter cyrillicSEMISFTSN 147
-\definecharacter cyrillicsemisftsn 179
-\definecharacter cyrillicISHRTDSC 148
-\definecharacter cyrillicishrtdsc 180
-\definecharacter cyrillicHDSC 149
-\definecharacter cyrillichdsc 181
-\definecharacter cyrillicDZHE 150
-\definecharacter cyrillicdzhe 182
-\definecharacter cyrillicABHHA 151
-\definecharacter cyrillicabhha 183
-\definecharacter cyrillicCHRDSC 152
-\definecharacter cyrillicchrdsc 184
-\definecharacter cyrillicNLHK 153
-\definecharacter cyrillicnlhk 185
-\definecharacter cyrillicSCHWA 154
-\definecharacter cyrillicschwa 186
-\definecharacter cyrillicRHK 155
-\definecharacter cyrillicrhk 187
-\definecharacter cyrillicYO 156
-\definecharacter cyrillicyo 188
-\definecharacter cyrillicII 73
-\definecharacter cyrillicii 105
-\definecharacter cyrillicJE 74
-\definecharacter cyrillicje 106
-\definecharacter cyrillicQ 81
-\definecharacter cyrillicq 113
-\definecharacter cyrillicDZE 83
-\definecharacter cyrillicdze 115
-\definecharacter cyrillicW 87
-\definecharacter cyrillicw 119
-
-\stopencoding
-
-\startmapping[x2]
-
-\resetcaserange 128 to 255
-
-\definecasemaps 192 to 223 lc +32 uc 0 % base letters (russian)
-\definecasemaps 224 to 255 lc 0 uc -32
-
-\definecasemaps 128 to 156 lc +32 uc 0 % extra letters (cyrillic and old-slav)
-\definecasemaps 160 to 188 lc 0 uc -32
-
-\definecasemaps 65 to 90 lc +32 uc 0 % more extra letters (cyrillic and old-slav)
-\definecasemaps 97 to 122 lc 0 uc -32
-
-\definecasemap 28 29 28 \definecasemap 29 29 28 % cyrillicNLHK
-\definecasemap 30 31 30 \definecasemap 31 31 30 % cyrillicDELTA
-
-\stopmapping
-
-\startencoding[x2]
-
-\definecharacter textgrave 0
-\definecharacter textacute 1
-\definecharacter textcircumflex 2
-\definecharacter texttilde 3
-\definecharacter textdiaeresis 4
-\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 endash 21
-\definecharacter emdash 22
-
-\definecharacter textcompwordmark 23
-\definecharacter textvisiblespace 32
-\definecharacter textdollar 36
-\definecharacter textless 60
-\definecharacter textgreater 62
-\definecharacter textbackslash 92
-\definecharacter textasciicircum 94
-\definecharacter textunderscore 95
-\definecharacter textbraceleft 123
-\definecharacter textbar 124
-\definecharacter textbraceright 125
-\definecharacter textasciitilde 126
-\definecharacter textnumero 157
-\definecharacter textcurrency 158
-\definecharacter textsection 159
-\definecharacter sectionmark 159
-\definecharacter textquotedbl 34
-
-\definecharacter cyrillicpalochka 13
-\definecharacter cyrilliclangle 14
-\definecharacter cyrillicrangle 15
-
-\definecharacter leftguillemot 190
-\definecharacter rightguillemot 191
-
-\definecharacter upperleftsinglesixquote 96
-\definecharacter upperleftsingleninequote 39
-\definecharacter upperleftdoublesixquote 16
-\definecharacter upperleftdoubleninequote 17
-\definecharacter lowerleftdoubleninequote 189
-
-\definecharacter upperrightsinglesixquote 96
-\definecharacter upperrightsingleninequote 39
-\definecharacter upperrightdoublesixquote 16
-\definecharacter upperrightdoubleninequote 17
-\definecharacter lowerrightdoubleninequote 189
-
-\definecharacter cyrillicA 192
-\definecharacter cyrillica 224
-\definecharacter cyrillicB 193
-\definecharacter cyrillicb 225
-\definecharacter cyrillicV 194
-\definecharacter cyrillicv 226
-\definecharacter cyrillicG 195
-\definecharacter cyrillicg 227
-\definecharacter cyrillicD 196
-\definecharacter cyrillicd 228
-\definecharacter cyrillicE 197
-\definecharacter cyrillice 229
-\definecharacter cyrillicZH 198
-\definecharacter cyrilliczh 230
-\definecharacter cyrillicZ 199
-\definecharacter cyrillicz 231
-\definecharacter cyrillicI 200
-\definecharacter cyrillici 232
-\definecharacter cyrillicISHRT 201
-\definecharacter cyrillicishrt 233
-\definecharacter cyrillicK 202
-\definecharacter cyrillick 234
-\definecharacter cyrillicL 203
-\definecharacter cyrillicl 235
-\definecharacter cyrillicM 204
-\definecharacter cyrillicm 236
-\definecharacter cyrillicN 205
-\definecharacter cyrillicn 237
-\definecharacter cyrillicO 206
-\definecharacter cyrillico 238
-\definecharacter cyrillicP 207
-\definecharacter cyrillicp 239
-\definecharacter cyrillicR 208
-\definecharacter cyrillicr 240
-\definecharacter cyrillicS 209
-\definecharacter cyrillics 241
-\definecharacter cyrillicT 210
-\definecharacter cyrillict 242
-\definecharacter cyrillicU 211
-\definecharacter cyrillicu 243
-\definecharacter cyrillicF 212
-\definecharacter cyrillicf 244
-\definecharacter cyrillicH 213
-\definecharacter cyrillich 245
-\definecharacter cyrillicC 214
-\definecharacter cyrillicc 246
-\definecharacter cyrillicCH 215
-\definecharacter cyrillicch 247
-\definecharacter cyrillicSH 216
-\definecharacter cyrillicsh 248
-\definecharacter cyrillicSHCH 217
-\definecharacter cyrillicshch 249
-\definecharacter cyrillicHRDSN 218
-\definecharacter cyrillichrdsn 250
-\definecharacter cyrillicERY 219
-\definecharacter cyrillicery 251
-\definecharacter cyrillicSFTSN 220
-\definecharacter cyrillicsftsn 252
-\definecharacter cyrillicEREV 221
-\definecharacter cyrillicerev 253
-\definecharacter cyrillicYU 222
-\definecharacter cyrillicyu 254
-\definecharacter cyrillicYA 223
-\definecharacter cyrillicya 255
-\definecharacter cyrillicGUP 128
-\definecharacter cyrillicgup 160
-\definecharacter cyrillicGHCRS 129
-\definecharacter cyrillicghcrs 161
-\definecharacter cyrillicGDSC 130
-\definecharacter cyrillicgdsc 162
-\definecharacter cyrillicGHK 131
-\definecharacter cyrillicghk 163
-\definecharacter cyrillicSHHA 132
-\definecharacter cyrillicshha 164
-\definecharacter cyrillicZHDSC 133
-\definecharacter cyrilliczhdsc 165
-\definecharacter cyrillicZDSC 134
-\definecharacter cyrilliczdsc 166
-\definecharacter cyrillicABHDZE 135
-\definecharacter cyrillicabhdze 167
-\definecharacter cyrillicYI 136
-\definecharacter cyrillicyi 168
-\definecharacter cyrillicKDSC 137
-\definecharacter cyrillickdsc 169
-\definecharacter cyrillicKBEAK 138
-\definecharacter cyrillickbeak 170
-\definecharacter cyrillicKHK 139
-\definecharacter cyrillickhk 171
-\definecharacter cyrillicLHK 140
-\definecharacter cyrilliclhk 172
-\definecharacter cyrillicNDSC 141
-\definecharacter cyrillicndsc 173
-\definecharacter cyrillicNG 142
-\definecharacter cyrillicng 174
-\definecharacter cyrillicNHK 143
-\definecharacter cyrillicnhk 175
-\definecharacter cyrillicOTLD 144
-\definecharacter cyrillicotld 176
-\definecharacter cyrillicSDSC 145
-\definecharacter cyrillicsdsc 177
-\definecharacter cyrillicUSHRT 146
-\definecharacter cyrillicushrt 178
-\definecharacter cyrillicY 147
-\definecharacter cyrillicy 179
-\definecharacter cyrillicYHCRS 148
-\definecharacter cyrillicyhcrs 180
-\definecharacter cyrillicHDSC 149
-\definecharacter cyrillichdsc 181
-\definecharacter cyrillicHHK 150
-\definecharacter cyrillichhk 182
-\definecharacter cyrillicCHLDSC 151
-\definecharacter cyrillicchldsc 183
-\definecharacter cyrillicCHRDSC 152
-\definecharacter cyrillicchrdsc 184
-\definecharacter cyrillicIE 153
-\definecharacter cyrillicie 185
-\definecharacter cyrillicSCHWA 154
-\definecharacter cyrillicschwa 186
-\definecharacter cyrillicEPS 155
-\definecharacter cyrilliceps 187
-\definecharacter cyrillicYO 156
-\definecharacter cyrillicyo 188
-\definecharacter cyrillicAE 65
-\definecharacter cyrillicae 97
-\definecharacter cyrillicDJE 66
-\definecharacter cyrillicdje 98
-\definecharacter cyrillicTSHE 67
-\definecharacter cyrillictshe 99
-\definecharacter cyrillicABHCH 68
-\definecharacter cyrillicabhch 100
-\definecharacter cyrillicABHCHDSC 69
-\definecharacter cyrillicabhchdsc 101
-\definecharacter cyrillicKVCRS 70
-\definecharacter cyrillickvcrs 102
-\definecharacter cyrillicKHCRS 71
-\definecharacter cyrillickhcrs 103
-\definecharacter cyrillicLDSC 72
-\definecharacter cyrillicldsc 104
-\definecharacter cyrillicII 73
-\definecharacter cyrillicii 105
-\definecharacter cyrillicJE 74
-\definecharacter cyrillicje 106
-\definecharacter cyrillicLJE 75
-\definecharacter cyrilliclje 107
-\definecharacter cyrillicMDSC 76
-\definecharacter cyrillicmdsc 108
-\definecharacter cyrillicNJE 77
-\definecharacter cyrillicnje 109
-\definecharacter cyrillicABHHA 78
-\definecharacter cyrillicabhha 110
-\definecharacter cyrillicPHK 79
-\definecharacter cyrillicphk 111
-\definecharacter cyrillicRDSC 80
-\definecharacter cyrillicrdsc 112
-\definecharacter cyrillicQ 81
-\definecharacter cyrillicq 113
-\definecharacter cyrillicTDSC 82
-\definecharacter cyrillictdsc 114
-\definecharacter cyrillicDZE 83
-\definecharacter cyrillicdze 115
-\definecharacter cyrillicTETSE 84
-\definecharacter cyrillictetse 116
-\definecharacter cyrillicDZHE 85
-\definecharacter cyrillicdzhe 117
-\definecharacter cyrillicCHVCRS 86
-\definecharacter cyrillicchvcrs 118
-\definecharacter cyrillicW 87
-\definecharacter cyrillicw 119
-\definecharacter cyrillicYAT 88
-\definecharacter cyrillicyat 120
-\definecharacter cyrillicBYUS 89
-\definecharacter cyrillicbyus 121
-\definecharacter cyrillicIZH 90
-\definecharacter cyrillicizh 122
-\definecharacter cyrillicNLHK 28
-\definecharacter cyrillicnlhk 29
-\definecharacter cyrillicDELTA 30
-\definecharacter cyrillicdelta 31
-
-\stopencoding
-
-\startmapping[lcy]
-
-\resetcaserange 128 to 255
-
-\definecasemaps 128 to 143 lc +32 uc 0
-\definecasemaps 160 to 175 lc 0 uc -32
-
-\definecasemaps 144 to 159 lc +80 uc 0
-\definecasemaps 224 to 239 lc 0 uc -80
-
-\definecasemap 240 241 240 \definecasemap 241 241 240 % cyrillicYO
-\definecasemap 242 243 242 \definecasemap 243 243 242 % cyrillicGUP
-\definecasemap 244 245 244 \definecasemap 245 245 244 % cyrillicIE
-\definecasemap 244 247 244 \definecasemap 247 247 244 % cyrillicII
-\definecasemap 248 249 248 \definecasemap 249 249 248 % cyrillicYI
-\definecasemap 250 251 240 \definecasemap 241 241 240 % cyrillicUSHRT
-
-\stopmapping
-
-\startencoding[lcy]
-
-%D Characters 0 to 127 are as in normal cmr slots
-
-\definecharacter cyrillicA 128
-\definecharacter cyrillicB 129
-\definecharacter cyrillicV 130
-\definecharacter cyrillicG 131
-\definecharacter cyrillicD 132
-\definecharacter cyrillicE 133
-\definecharacter cyrillicZH 134
-\definecharacter cyrillicZ 135
-\definecharacter cyrillicI 136
-\definecharacter cyrillicISHRT 137
-\definecharacter cyrillicK 138
-\definecharacter cyrillicL 139
-\definecharacter cyrillicM 140
-\definecharacter cyrillicN 141
-\definecharacter cyrillicO 142
-\definecharacter cyrillicP 143
-\definecharacter cyrillicR 144
-\definecharacter cyrillicS 145
-\definecharacter cyrillicT 146
-\definecharacter cyrillicU 147
-\definecharacter cyrillicF 148
-\definecharacter cyrillicH 149
-\definecharacter cyrillicC 150
-\definecharacter cyrillicCH 151
-\definecharacter cyrillicSH 152
-\definecharacter cyrillicSHCH 153
-\definecharacter cyrillicHRDSN 154
-\definecharacter cyrillicERY 155
-\definecharacter cyrillicSFTSN 156
-\definecharacter cyrillicEREV 157
-\definecharacter cyrillicYU 158
-\definecharacter cyrillicYA 159
-\definecharacter cyrillica 160
-\definecharacter cyrillicb 161
-\definecharacter cyrillicv 162
-\definecharacter cyrillicg 163
-\definecharacter cyrillicd 164
-\definecharacter cyrillice 165
-\definecharacter cyrilliczh 166
-\definecharacter cyrillicz 167
-\definecharacter cyrillici 168
-\definecharacter cyrillicishrt 169
-\definecharacter cyrillick 170
-\definecharacter cyrillicl 171
-\definecharacter cyrillicm 172
-\definecharacter cyrillicn 173
-\definecharacter cyrillico 174
-\definecharacter cyrillicp 175
-\definecharacter cyrillicr 224
-\definecharacter cyrillics 225
-\definecharacter cyrillict 226
-\definecharacter cyrillicu 227
-\definecharacter cyrillicf 228
-\definecharacter cyrillich 229
-\definecharacter cyrillicc 230
-\definecharacter cyrillicch 231
-\definecharacter cyrillicsh 232
-\definecharacter cyrillicshch 233
-\definecharacter cyrillichrdsn 234
-\definecharacter cyrillicery 235
-\definecharacter cyrillicsftsn 236
-\definecharacter cyrillicerev 237
-\definecharacter cyrillicyu 238
-\definecharacter cyrillicya 239
-\definecharacter cyrillicYO 240
-\definecharacter cyrillicyo 241
-\definecharacter cyrillicGUP 242
-\definecharacter cyrillicgup 243
-\definecharacter cyrillicIE 244
-\definecharacter cyrillicie 245
-\definecharacter cyrillicII 246
-\definecharacter cyrillicii 247
-\definecharacter cyrillicYI 248
-\definecharacter cyrillicyi 249
-\definecharacter cyrillicUSHRT 250
-\definecharacter cyrillicushrt 251
-
-\definecharacter emdash 196
-\definecharacter textcurrency 197
-\definecharacter textnumero 252
-\definecharacter leftguillemot 253
-\definecharacter rightguillemot 254
-\definecharacter quotedblbase 255
-
-\stopencoding
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-def.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-def.mkii
deleted file mode 100644
index 53a3e9a981b..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-def.mkii
+++ /dev/null
@@ -1,923 +0,0 @@
-%D \module
-%D [ file=enco-def,
-%D version=2000.05.07, % 2000.20.12, % split from less verbose base file
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=Default Character Definitions,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Instead of overloading plain \TEX\ macros (and keeping them
-%D available as an escape), we now use the more verbose
-%D definitions in this file. Since memory is less a problem
-%D these days, this verbosity has only a small price, but we
-%D gain readability. The following definitions are based on
-%D usage of the the original \TEX\ fonts, where composed
-%D characters were not part of the design. So, occasionally
-%D we have to revert to hacks. Thanks to all those users who
-%D helped me to fill in the details.
-
-\startencoding[default]
-
-\definecharacter textcomma ,
-\definecharacter textperiod .
-
-\definecharacter textacute 19
-\definecharacter textbottomdot 46
-\definecharacter textbreve 21
-\definecharacter textcaron 20
-\definecharacter textcedilla 24
-\definecharacter textcircumflex 94
-\definecharacter textdiaeresis 127
-\definecharacter textdotaccent 95
-\definecharacter textgrave 18
-\definecharacter texthungarumlaut 125
-\definecharacter textmacron 22
-\definecharacter textogonek 24 % fake
-\definecharacter textring 23
-\definecharacter texttilde 126
-
-\definecharacter textat 64 % for mojca
-
-\definecharacter textbottomcomma {\hbox{\lower.35ex\hbox{\tx,}}} % for mojca
-
-\definecharacter dotlessi {\char"10 }
-\definecharacter dotlessj {\char"11 }
-\definecharacter dotlessI {I}
-\definecharacter dotlessJ {J}
-
-\definecharacter endash 123
-\definecharacter emdash 124
-
-\definecharacter aeligature {\char26 } % "1A
-\definecharacter AEligature {\char29 } % "1D
-\definecharacter ijligature {ij}
-\definecharacter IJligature {IJ}
-\definecharacter oeligature {\char27 } % "1B
-\definecharacter OEligature {\char30 } % "1E
-
-\definecharacter ssharp {\char25 } % "19
-\definecharacter Ssharp {SS}
-
-\definecharacter thorn {\unknownchar}
-\definecharacter Thorn {\unknownchar}
-
-\definecharacter eth {\unknownchar} % mojca prefers this (was \dstroke)
-%definecharacter Eth {\unknownchar}
-\definecharacter Eth {\Dstroke} % mojca prefers this too
-
-\definecharacter exclamdown 60
-\definecharacter questiondown 62
-
-\definecharacter copyright {\encircled{\txx C}}
-\definecharacter registered {\encircled{\txx R}}
-\definecharacter trademark {\high{\txx TM}}
-
-\definecharacter sectionmark {\mathematics{\mathhexbox278}}
-\definecharacter paragraphmark {\mathematics{\mathhexbox27B}}
-
-\definecharacter onequarter {\vulgarfraction{1}{4}}
-\definecharacter onehalf {\vulgarfraction{1}{2}}
-\definecharacter threequarter {\vulgarfraction{3}{4}}
-
-\definecharacter onesuperior {\high{1}}
-\definecharacter twosuperior {\high{2}}
-\definecharacter threesuperior {\high{3}}
-
-\definecharacter textcent {c}
-\definecharacter textcurrency {\unknownchar}
-\definecharacter textdollar {\fakedollar}
-\definecharacter texteuro {E}
-\definecharacter textflorin {\fakeflorin}
-\definecharacter textsterling {\fakesterling}
-\definecharacter textyen {Y}
-
-\definecharacter ordfeminine {\high{\txx a}}
-\definecharacter ordmasculine {\high{\txx o}}
-
-\definecharacter percent {\fakepercent}
-\definecharacter perthousand {\fakeperthousand}
-
-\definecharacter softhyphen 45
-\definecharacter periodcentered {\hbox{\mathematics\cdot}}
-\definecharacter compoundwordmark 23
-
-\definecharacter textasciicircum 94
-\definecharacter textasciitilde 126
-\definecharacter textslash 47
-\definecharacter textbackslash {\tex{}} % todo
-\definecharacter textbraceleft {\mathematics\{}
-\definecharacter textbraceright {\mathematics\}}
-\definecharacter textunderscore {\fakeunderscore}
-\definecharacter textvisiblespace {\fakevisiblespace}
-
-\definecharacter textbrokenbar {\mathematics\vert}
-\definecharacter textbullet {\mathematics\bullet}
-\definecharacter textdag {\mathematics\dag}
-\definecharacter textddag {\mathematics\ddag}
-\definecharacter textdegree {\mathematics{{}^{\circ}}}
-\definecharacter textdiv {\mathematics\div}
-\definecharacter textellipsis {\mathematics\cdots}
-\definecharacter textfraction {\mathematics/}
-\definecharacter textlognot {\mathematics\neg}
-\definecharacter textminus {\mathematics-}
-\definecharacter textmu {\mathematics\mu}
-\definecharacter textmultiply {\mathematics\times}
-\definecharacter textpm {\mathematics\pm}
-
-\definecharacter quotedbl {"}
-\definecharacter quotedblbase {,,}
-\definecharacter quotedblleft {``}
-\definecharacter quotedblright {''}
-
-\definecharacter quotesingle {`}
-\definecharacter quotesinglebase {,}
-
-\definecharacter quoteleft {`}
-\definecharacter quoteright {'}
-
-\definecharacter guilsingleleft {\fakeleftsubguillemot }
-\definecharacter guilsingleright {\fakerightsubguillemot}
-
-\definecharacter leftguillemot {\fakeleftguillemot }
-\definecharacter rightguillemot {\fakerightguillemot}
-
-\definecharacter Acircumflex {\buildtextaccent\textcircumflex A}
-\definecharacter acircumflex {\buildtextaccent\textcircumflex a}
-\definecharacter Ccircumflex {\buildtextaccent\textcircumflex C}
-\definecharacter ccircumflex {\buildtextaccent\textcircumflex c}
-\definecharacter Ecircumflex {\buildtextaccent\textcircumflex E}
-\definecharacter ecircumflex {\buildtextaccent\textcircumflex e}
-\definecharacter Gcircumflex {\buildtextaccent\textcircumflex G}
-\definecharacter gcircumflex {\buildtextaccent\textcircumflex g}
-\definecharacter Hcircumflex {\buildtextaccent\textcircumflex H}
-\definecharacter hcircumflex {\buildtextaccent\textcircumflex h}
-\definecharacter Icircumflex {\buildtextaccent\textcircumflex \dotlessI}
-\definecharacter icircumflex {\buildtextaccent\textcircumflex \dotlessi}
-\definecharacter Jcircumflex {\buildtextaccent\textcircumflex \dotlessJ}
-\definecharacter jcircumflex {\buildtextaccent\textcircumflex \dotlessj}
-\definecharacter Ocircumflex {\buildtextaccent\textcircumflex O}
-\definecharacter ocircumflex {\buildtextaccent\textcircumflex o}
-\definecharacter Scircumflex {\buildtextaccent\textcircumflex S}
-\definecharacter scircumflex {\buildtextaccent\textcircumflex s}
-\definecharacter Ucircumflex {\buildtextaccent\textcircumflex U}
-\definecharacter ucircumflex {\buildtextaccent\textcircumflex u}
-\definecharacter Wcircumflex {\buildtextaccent\textcircumflex W}
-\definecharacter wcircumflex {\buildtextaccent\textcircumflex w}
-\definecharacter Ycircumflex {\buildtextaccent\textcircumflex Y}
-\definecharacter ycircumflex {\buildtextaccent\textcircumflex y}
-
-\definecharacter Agrave {\buildtextaccent\textgrave A}
-\definecharacter agrave {\buildtextaccent\textgrave a}
-\definecharacter Egrave {\buildtextaccent\textgrave E}
-\definecharacter egrave {\buildtextaccent\textgrave e}
-\definecharacter Igrave {\buildtextaccent\textgrave \dotlessI}
-\definecharacter igrave {\buildtextaccent\textgrave \dotlessi}
-\definecharacter Ograve {\buildtextaccent\textgrave O}
-\definecharacter ograve {\buildtextaccent\textgrave o}
-\definecharacter Ugrave {\buildtextaccent\textgrave U}
-\definecharacter ugrave {\buildtextaccent\textgrave u}
-\definecharacter Ygrave {\buildtextaccent\textgrave Y}
-\definecharacter ygrave {\buildtextaccent\textgrave y}
-
-\definecharacter Atilde {\buildtextaccent\texttilde A}
-\definecharacter atilde {\buildtextaccent\texttilde a}
-\definecharacter Itilde {\buildtextaccent\texttilde \dotlessI}
-\definecharacter itilde {\buildtextaccent\texttilde \dotlessi}
-\definecharacter Ntilde {\buildtextaccent\texttilde N}
-\definecharacter ntilde {\buildtextaccent\texttilde n}
-\definecharacter Otilde {\buildtextaccent\texttilde O}
-\definecharacter otilde {\buildtextaccent\texttilde o}
-\definecharacter Utilde {\buildtextaccent\texttilde U}
-\definecharacter utilde {\buildtextaccent\texttilde u}
-\definecharacter Ytilde {\buildtextaccent\texttilde Y}
-\definecharacter ytilde {\buildtextaccent\texttilde y}
-
-\definecharacter Adiaeresis {\buildtextaccent\textdiaeresis A}
-\definecharacter adiaeresis {\buildtextaccent\textdiaeresis a}
-\definecharacter Ediaeresis {\buildtextaccent\textdiaeresis E}
-\definecharacter ediaeresis {\buildtextaccent\textdiaeresis e}
-\definecharacter Idiaeresis {\buildtextaccent\textdiaeresis \dotlessI}
-\definecharacter idiaeresis {\buildtextaccent\textdiaeresis \dotlessi}
-\definecharacter Odiaeresis {\buildtextaccent\textdiaeresis O}
-\definecharacter odiaeresis {\buildtextaccent\textdiaeresis o}
-\definecharacter Udiaeresis {\buildtextaccent\textdiaeresis U}
-\definecharacter udiaeresis {\buildtextaccent\textdiaeresis u}
-\definecharacter Ydiaeresis {\buildtextaccent\textdiaeresis Y}
-\definecharacter ydiaeresis {\buildtextaccent\textdiaeresis y}
-
-\definecharacter Aacute {\buildtextaccent\textacute A}
-\definecharacter aacute {\buildtextaccent\textacute a}
-\definecharacter Cacute {\buildtextaccent\textacute C}
-\definecharacter cacute {\buildtextaccent\textacute c}
-\definecharacter Eacute {\buildtextaccent\textacute E}
-\definecharacter eacute {\buildtextaccent\textacute e}
-\definecharacter Iacute {\buildtextaccent\textacute \dotlessI}
-\definecharacter iacute {\buildtextaccent\textacute \dotlessi}
-\definecharacter Lacute {\buildtextaccent\textacute L}
-\definecharacter lacute {\buildtextaccent\textacute l}
-\definecharacter Nacute {\buildtextaccent\textacute N}
-\definecharacter nacute {\buildtextaccent\textacute n}
-\definecharacter Oacute {\buildtextaccent\textacute O}
-\definecharacter oacute {\buildtextaccent\textacute o}
-\definecharacter Racute {\buildtextaccent\textacute R}
-\definecharacter racute {\buildtextaccent\textacute r}
-\definecharacter Sacute {\buildtextaccent\textacute S}
-\definecharacter sacute {\buildtextaccent\textacute s}
-\definecharacter Uacute {\buildtextaccent\textacute U}
-\definecharacter uacute {\buildtextaccent\textacute u}
-\definecharacter Yacute {\buildtextaccent\textacute Y}
-\definecharacter yacute {\buildtextaccent\textacute y}
-\definecharacter Zacute {\buildtextaccent\textacute Z}
-\definecharacter zacute {\buildtextaccent\textacute z}
-
-%definecharacter Dstroke {D}
-%definecharacter dstroke {d}
-
-\definecharacter dstroke {\pseudoencodeddj}
-\definecharacter Dstroke {\pseudoencodedDJ}
-\definecharacter Hstroke {H}
-\definecharacter hstroke {h}
-\definecharacter Tstroke {T}
-\definecharacter tstroke {t}
-
-\definecharacter Cdotaccent {\buildtextaccent\textdotaccent C}
-\definecharacter cdotaccent {\buildtextaccent\textdotaccent c}
-\definecharacter Edotaccent {\buildtextaccent\textdotaccent E}
-\definecharacter edotaccent {\buildtextaccent\textdotaccent e}
-\definecharacter Gdotaccent {\buildtextaccent\textdotaccent G}
-\definecharacter gdotaccent {\buildtextaccent\textdotaccent g}
-\definecharacter Idotaccent {\buildtextaccent\textdotaccent \dotlessI}
-\definecharacter idotaccent {\buildtextaccent\textdotaccent \dotlessi}
-\definecharacter Zdotaccent {\buildtextaccent\textdotaccent Z}
-\definecharacter zdotaccent {\buildtextaccent\textdotaccent z}
-
-\definecharacter Amacron {\buildtextaccent\textmacron A}
-\definecharacter amacron {\buildtextaccent\textmacron a}
-\definecharacter Emacron {\buildtextaccent\textmacron E}
-\definecharacter emacron {\buildtextaccent\textmacron e}
-\definecharacter Imacron {\buildtextaccent\textmacron \dotlessI}
-\definecharacter imacron {\buildtextaccent\textmacron \dotlessi}
-\definecharacter Omacron {\buildtextaccent\textmacron O}
-\definecharacter omacron {\buildtextaccent\textmacron o}
-\definecharacter Umacron {\buildtextaccent\textmacron U}
-\definecharacter umacron {\buildtextaccent\textmacron u}
-
-\definecharacter Ccedilla {\buildtextcedilla C}
-\definecharacter ccedilla {\buildtextcedilla c}
-\definecharacter Kcedilla {\buildtextcedilla K}
-\definecharacter kcedilla {\buildtextcedilla k}
-\definecharacter Lcedilla {\buildtextcedilla L}
-\definecharacter lcedilla {\buildtextcedilla l}
-\definecharacter Ncedilla {\buildtextcedilla N}
-\definecharacter ncedilla {\buildtextcedilla n}
-\definecharacter Rcedilla {\buildtextcedilla R}
-\definecharacter rcedilla {\buildtextcedilla r}
-\definecharacter Scedilla {\buildtextcedilla S}
-\definecharacter scedilla {\buildtextcedilla s}
-\definecharacter Tcedilla {\buildtextcedilla T}
-\definecharacter tcedilla {\buildtextcedilla t}
-
-\definecharacter Ohungarumlaut {\buildtextaccent\texthungarumlaut O}
-\definecharacter ohungarumlaut {\buildtextaccent\texthungarumlaut o}
-\definecharacter Uhungarumlaut {\buildtextaccent\texthungarumlaut U}
-\definecharacter uhungarumlaut {\buildtextaccent\texthungarumlaut u}
-
-\definecharacter Aogonek {\buildtextogonek A}
-\definecharacter aogonek {\buildtextogonek a}
-\definecharacter Eogonek {\buildtextogonek E}
-\definecharacter eogonek {\buildtextogonek e}
-\definecharacter Iogonek {\buildtextogonek I}
-\definecharacter iogonek {\buildtextogonek i}
-\definecharacter Uogonek {\buildtextogonek U}
-\definecharacter uogonek {\buildtextogonek u}
-
-\definecharacter Aring {\buildtextaccent\textring A}
-\definecharacter aring {\buildtextaccent\textring a}
-\definecharacter Uring {\buildtextaccent\textring U}
-\definecharacter uring {\buildtextaccent\textring u}
-
-\definecharacter Abreve {\buildtextaccent\textbreve A}
-\definecharacter abreve {\buildtextaccent\textbreve a}
-\definecharacter Ebreve {\buildtextaccent\textbreve E}
-\definecharacter ebreve {\buildtextaccent\textbreve e}
-\definecharacter Gbreve {\buildtextaccent\textbreve G}
-\definecharacter gbreve {\buildtextaccent\textbreve g}
-\definecharacter Ibreve {\buildtextaccent\textbreve \dotlessI}
-\definecharacter ibreve {\buildtextaccent\textbreve \dotlessi}
-\definecharacter Obreve {\buildtextaccent\textbreve O}
-\definecharacter obreve {\buildtextaccent\textbreve o}
-\definecharacter Ubreve {\buildtextaccent\textbreve U}
-\definecharacter ubreve {\buildtextaccent\textbreve u}
-
-\definecharacter Ccaron {\buildtextaccent\textcaron C}
-\definecharacter ccaron {\buildtextaccent\textcaron c}
-\definecharacter Dcaron {\buildtextaccent\textcaron D}
-\definecharacter dcaron {\buildtextaccent\textcaron d}
-\definecharacter Ecaron {\buildtextaccent\textcaron E}
-\definecharacter ecaron {\buildtextaccent\textcaron e}
-\definecharacter Lcaron {\buildtextaccent\textcaron L}
-\definecharacter lcaron {\buildtextaccent\textcaron l}
-\definecharacter Ncaron {\buildtextaccent\textcaron N}
-\definecharacter ncaron {\buildtextaccent\textcaron n}
-\definecharacter Rcaron {\buildtextaccent\textcaron R}
-\definecharacter rcaron {\buildtextaccent\textcaron r}
-\definecharacter Scaron {\buildtextaccent\textcaron S}
-\definecharacter scaron {\buildtextaccent\textcaron s}
-\definecharacter Tcaron {\buildtextaccent\textcaron T}
-\definecharacter tcaron {\buildtextaccent\textcaron t}
-\definecharacter Ycaron {\buildtextaccent\textcaron Y}
-\definecharacter ycaron {\buildtextaccent\textcaron y}
-\definecharacter Zcaron {\buildtextaccent\textcaron Z}
-\definecharacter zcaron {\buildtextaccent\textcaron z}
-
-\definecharacter Lstroke {\hsmash{\char32}L}
-\definecharacter lstroke {\hsmash{\char32}l}
-\definecharacter Ostroke {\char31 } % "1F
-\definecharacter ostroke {\char28 } % "1C
-
-\definecharacter aumlaut {\moveaccent{-.1ex}\adiaeresis}
-\definecharacter eumlaut {\moveaccent{-.1ex}\ediaeresis}
-\definecharacter iumlaut {\moveaccent{-.1ex}\idiaeresis}
-\definecharacter oumlaut {\moveaccent{-.1ex}\odiaeresis}
-\definecharacter uumlaut {\moveaccent{-.1ex}\udiaeresis}
-
-\definecharacter Aumlaut {\smashaccent\Adiaeresis}
-\definecharacter Eumlaut {\smashaccent\Ediaeresis}
-\definecharacter Iumlaut {\smashaccent\Idiaeresis}
-\definecharacter Oumlaut {\smashaccent\Odiaeresis}
-\definecharacter Uumlaut {\smashaccent\Udiaeresis}
-
-\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}
-
-\definecharacter Ahook {A}
-\definecharacter ahook {a}
-\definecharacter Ehook {E}
-\definecharacter ehook {e}
-\definecharacter Ihook {I}
-\definecharacter ihook {i}
-\definecharacter Ohook {O}
-\definecharacter ohook {o}
-\definecharacter Uhook {U}
-\definecharacter uhook {u}
-\definecharacter Yhook {Y}
-\definecharacter yhook {y}
-
-\definecharacter Acircumflexgrave {\Acircumflex}
-\definecharacter Acircumflexacute {\Acircumflex}
-\definecharacter Acircumflextilde {\Acircumflex}
-\definecharacter Acircumflexhook {\Acircumflex}
-\definecharacter acircumflexgrave {\acircumflex}
-\definecharacter acircumflexacute {\acircumflex}
-\definecharacter acircumflextilde {\acircumflex}
-\definecharacter acircumflexhook {\acircumflex}
-\definecharacter Ecircumflexgrave {\Ecircumflex}
-\definecharacter Ecircumflexacute {\Ecircumflex}
-\definecharacter Ecircumflextilde {\Ecircumflex}
-\definecharacter Ecircumflexhook {\Ecircumflex}
-\definecharacter ecircumflexgrave {\ecircumflex}
-\definecharacter ecircumflexacute {\ecircumflex}
-\definecharacter ecircumflextilde {\ecircumflex}
-\definecharacter ecircumflexhook {\ecircumflex}
-\definecharacter Ocircumflexgrave {\Ocircumflex}
-\definecharacter Ocircumflexacute {\Ocircumflex}
-\definecharacter Ocircumflextilde {\Ocircumflex}
-\definecharacter Ocircumflexhook {\Ocircumflex}
-\definecharacter ocircumflexgrave {\ocircumflex}
-\definecharacter ocircumflexacute {\ocircumflex}
-\definecharacter ocircumflextilde {\ocircumflex}
-\definecharacter ocircumflexhook {\ocircumflex}
-
-\definecharacter Abrevegrave {\Abreve}
-\definecharacter Abreveacute {\Abreve}
-\definecharacter Abrevetilde {\Abreve}
-\definecharacter Abrevehook {\Abreve}
-\definecharacter abrevegrave {\abreve}
-\definecharacter abreveacute {\abreve}
-\definecharacter abrevetilde {\abreve}
-\definecharacter abrevehook {\abreve}
-
-\definecharacter Adotbelow {\buildtextbottomdot A}
-\definecharacter adotbelow {\buildtextbottomdot a}
-\definecharacter Edotbelow {\buildtextbottomdot E}
-\definecharacter edotbelow {\buildtextbottomdot e}
-\definecharacter Idotbelow {\buildtextbottomdot I}
-\definecharacter idotbelow {\buildtextbottomdot i}
-\definecharacter Odotbelow {\buildtextbottomdot O}
-\definecharacter odotbelow {\buildtextbottomdot o}
-\definecharacter Udotbelow {\buildtextbottomdot U}
-\definecharacter udotbelow {\buildtextbottomdot u}
-\definecharacter Ydotbelow {\buildtextbottomdot Y}
-\definecharacter ydotbelow {\buildtextbottomdot y}
-
-\definecharacter Ohorndotbelow {\buildtextbottomdot\Ohorn}
-\definecharacter ohorndotbelow {\buildtextbottomdot\ohorn}
-\definecharacter Uhorndotbelow {\buildtextbottomdot\Uhorn}
-\definecharacter uhorndotbelow {\buildtextbottomdot\uhorn}
-
-\definecharacter Acircumflexdotbelow {\buildtextbottomdot\Acircumflex}
-\definecharacter acircumflexdotbelow {\buildtextbottomdot\acircumflex}
-\definecharacter Ecircumflexdotbelow {\buildtextbottomdot\Ecircumflex}
-\definecharacter ecircumflexdotbelow {\buildtextbottomdot\ecircumflex}
-\definecharacter Ocircumflexdotbelow {\buildtextbottomdot\Ocircumflex}
-\definecharacter ocircumflexdotbelow {\buildtextbottomdot\ocircumflex}
-\definecharacter Abrevedotbelow {\buildtextbottomdot\Abreve}
-\definecharacter abrevedotbelow {\buildtextbottomdot\abreve}
-
-\definecharacter Ohorn {O}
-\definecharacter Ohorngrave {\Ograve}
-\definecharacter Ohornacute {\Oacute}
-\definecharacter Ohorntilde {\Otilde}
-\definecharacter Ohornhook {O}
-\definecharacter ohorn {o}
-\definecharacter ohorngrave {\ograve}
-\definecharacter ohornacute {\oacute}
-\definecharacter ohorntilde {\otilde}
-\definecharacter ohornhook {o}
-\definecharacter Uhorn {U}
-\definecharacter Uhorngrave {\Ugrave}
-\definecharacter Uhornacute {\Uacute}
-\definecharacter Uhorntilde {\Utilde}
-\definecharacter Uhornhook {U}
-\definecharacter uhorn {u}
-\definecharacter uhorngrave {\ugrave}
-\definecharacter uhornacute {\uacute}
-\definecharacter uhorntilde {\utilde}
-\definecharacter uhornhook {u}
-
-\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]
-
-% Uppercase Greek letters
-
-\definecharacter greekAlpha {\Alpha}
-\definecharacter greekBeta {\Beta}
-\definecharacter greekGamma {\Gamma}
-\definecharacter greekDelta {\Delta}
-\definecharacter greekEpsilon {\Epsilon}
-\definecharacter greekZeta {\Zeta}
-\definecharacter greekEta {\Eta}
-\definecharacter greekTheta {\Theta}
-\definecharacter greekIota {\Iota}
-\definecharacter greekKappa {\Kappa}
-\definecharacter greekLambda {\Lambda}
-\definecharacter greekMu {\Mu}
-\definecharacter greekNu {\Nu}
-\definecharacter greekXi {\Xi}
-\definecharacter greekOmicron {\Omicron}
-\definecharacter greekPi {\Pi}
-\definecharacter greekRho {\Rho}
-\definecharacter greekSigma {\Sigma}
-\definecharacter greekTau {\Tau}
-\definecharacter greekUpsilon {\Upsilon}
-\definecharacter greekPhi {\Phi}
-\definecharacter greekChi {\Chi}
-\definecharacter greekPsi {\Psi}
-\definecharacter greekOmega {\Omega}
-
-% Lowercase Greek letters
-
-\definecharacter greekalpha {\alpha}
-\definecharacter greekbeta {\beta}
-\definecharacter greekbetaalt {\beta}
-\definecharacter greekgamma {\gamma}
-\definecharacter greekdelta {\delta}
-\definecharacter greekepsilon {\varepsilon}
-\definecharacter greekepsilonalt {\epsilon}
-\definecharacter greekzeta {\zeta}
-\definecharacter greeketa {\eta}
-\definecharacter greektheta {\theta}
-\definecharacter greekthetaalt {\vartheta}
-\definecharacter greekiota {\iota}
-\definecharacter greekkappa {\kappa}
-\definecharacter greeklambda {\lambda}
-\definecharacter greekmu {\mu}
-\definecharacter greeknu {\nu}
-\definecharacter greekxi {\xi}
-\definecharacter greekomicron {\omicron}
-\definecharacter greekpi {\pi}
-\definecharacter greekrho {\rho}
-\definecharacter greeksigma {\sigma}
-\definecharacter greekfinalsigma {\varsigma}
-\definecharacter greektau {\tau}
-\definecharacter greekupsilon {\upsilon}
-\definecharacter greekphi {\varphi}
-\definecharacter greekphialt {\phi}
-\definecharacter greekchi {\chi}
-\definecharacter greekpsi {\psi}
-\definecharacter greekomega {\omega}
-
-% Accented Uppercase Greek letters
-
-\definecharacter greekAlphatonos {'A}
-\definecharacter greekEpsilontonos {'E}
-\definecharacter greekEtatonos {'H}
-\definecharacter greekIotatonos {'I}
-\definecharacter greekOmicrontonos {'O}
-\definecharacter greekUpsilontonos {'U}
-\definecharacter greekOmegatonos {'W}
-\definecharacter greekIotadialytika {"I}
-\definecharacter greekUpsilondialytika {"U}
-
-% Accented Lowercase Greek letters
-
-\definecharacter greekalphatonos {'a}
-\definecharacter greekepsilontonos {'e}
-\definecharacter greeketatonos {'h}
-\definecharacter greekiotatonos {'i}
-\definecharacter greekomicrontonos {'o}
-\definecharacter greekupsilontonos {'u}
-\definecharacter greekomegatonos {'w}
-\definecharacter greekiotadialytika {"i}
-\definecharacter greekupsilondialytika {"u}
-\definecharacter greekiotadialytikatonos {'"i}
-\definecharacter greekupsilondialytikatonos {'"u}
-
-% Miscellaneous Greek symbols
-
-\definecharacter greekleftquot {((}
-\definecharacter greekrightquot {))}
-\definecharacter greektonos {'}
-\definecharacter greekdialytikatonos {'"}
-\definecharacter greekapostrophos {''}
-
-\stopencoding
-
-%D Cyrillic (moved to here):
-
-\startencoding[default]
-
-\definecharacter cyrillicA {A}
-\definecharacter cyrillicB {B}
-\definecharacter cyrillicV {V}
-\definecharacter cyrillicG {G}
-\definecharacter cyrillicD {D}
-\definecharacter cyrillicE {E}
-\definecharacter cyrillicZH {ZH}
-\definecharacter cyrillicZ {Z}
-\definecharacter cyrillicI {I}
-\definecharacter cyrillicISHRT {ISHRT}
-\definecharacter cyrillicK {K}
-\definecharacter cyrillicL {L}
-\definecharacter cyrillicM {M}
-\definecharacter cyrillicN {N}
-\definecharacter cyrillicO {O}
-\definecharacter cyrillicP {P}
-\definecharacter cyrillicR {R}
-\definecharacter cyrillicS {S}
-\definecharacter cyrillicT {T}
-\definecharacter cyrillicU {U}
-\definecharacter cyrillicF {F}
-\definecharacter cyrillicH {H}
-\definecharacter cyrillicC {C}
-\definecharacter cyrillicCH {CH}
-\definecharacter cyrillicSH {SH}
-\definecharacter cyrillicSHCH {SHCH}
-\definecharacter cyrillicHRDSN {HRDSN}
-\definecharacter cyrillicERY {ERY}
-\definecharacter cyrillicSFTSN {SFTSN}
-\definecharacter cyrillicEREV {EREV}
-\definecharacter cyrillicYU {YU}
-\definecharacter cyrillicYA {YA}
-\definecharacter cyrillicGUP {GUP}
-\definecharacter cyrillicGHCRS {GHCRS}
-\definecharacter cyrillicDJE {DJE}
-\definecharacter cyrillicTSHE {TSHE}
-\definecharacter cyrillicSHHA {SHHA}
-\definecharacter cyrillicZHDSC {ZHDSC}
-\definecharacter cyrillicZDSC {ZDSC}
-\definecharacter cyrillicLJE {LJE}
-\definecharacter cyrillicYI {YI}
-\definecharacter cyrillicKDSC {KDSC}
-\definecharacter cyrillicKBEAK {KBEAK}
-\definecharacter cyrillicKVCRS {KVCRS}
-\definecharacter cyrillicAE {AE}
-\definecharacter cyrillicNDSC {NDSC}
-\definecharacter cyrillicNG {NG}
-\definecharacter cyrillicDZE {DZE}
-\definecharacter cyrillicOTLD {OTLD}
-\definecharacter cyrillicSDSC {SDSC}
-\definecharacter cyrillicUSHRT {USHRT}
-\definecharacter cyrillicY {Y}
-\definecharacter cyrillicYHCRS {YHCRS}
-\definecharacter cyrillicHDSC {HDSC}
-\definecharacter cyrillicDZHE {DZHE}
-\definecharacter cyrillicCHVCRS {CHVCRS}
-\definecharacter cyrillicCHRDSC {CHRDSC}
-\definecharacter cyrillicIE {IE}
-\definecharacter cyrillicSCHWA {SCHWA}
-\definecharacter cyrillicNJE {NJE}
-\definecharacter cyrillicYO {YO}
-\definecharacter cyrillicII {II}
-\definecharacter cyrillicJE {JE}
-\definecharacter cyrillicQ {Q}
-\definecharacter cyrillicW {W}
-
-\definecharacter cyrillica {a}
-\definecharacter cyrillicb {b}
-\definecharacter cyrillicv {v}
-\definecharacter cyrillicg {g}
-\definecharacter cyrillicd {d}
-\definecharacter cyrillice {e}
-\definecharacter cyrilliczh {zh}
-\definecharacter cyrillicz {z}
-\definecharacter cyrillici {i}
-\definecharacter cyrillicishrt {ishrt}
-\definecharacter cyrillick {k}
-\definecharacter cyrillicl {l}
-\definecharacter cyrillicm {m}
-\definecharacter cyrillicn {n}
-\definecharacter cyrillico {o}
-\definecharacter cyrillicp {p}
-\definecharacter cyrillicr {r}
-\definecharacter cyrillics {s}
-\definecharacter cyrillict {t}
-\definecharacter cyrillicu {u}
-\definecharacter cyrillicf {f}
-\definecharacter cyrillich {h}
-\definecharacter cyrillicc {c}
-\definecharacter cyrillicch {ch}
-\definecharacter cyrillicsh {sh}
-\definecharacter cyrillicshch {shch}
-\definecharacter cyrillichrdsn {hrdsn}
-\definecharacter cyrillicery {ery}
-\definecharacter cyrillicsftsn {sftsn}
-\definecharacter cyrillicerev {erev}
-\definecharacter cyrillicyu {yu}
-\definecharacter cyrillicya {ya}
-\definecharacter cyrillicgup {gup}
-\definecharacter cyrillicghcrs {ghcrs}
-\definecharacter cyrillicdje {dje}
-\definecharacter cyrillictshe {tshe}
-\definecharacter cyrillicshha {shha}
-\definecharacter cyrilliczhdsc {zhdsc}
-\definecharacter cyrilliczdsc {zdsc}
-\definecharacter cyrilliclje {lje}
-\definecharacter cyrillicyi {yi}
-\definecharacter cyrillickdsc {kdsc}
-\definecharacter cyrillickbeak {kbeak}
-\definecharacter cyrillickvcrs {kvcrs}
-\definecharacter cyrillicae {ae}
-\definecharacter cyrillicndsc {ndsc}
-\definecharacter cyrillicng {ng}
-\definecharacter cyrillicdze {dze}
-\definecharacter cyrillicotld {otld}
-\definecharacter cyrillicsdsc {sdsc}
-\definecharacter cyrillicushrt {ushrt}
-\definecharacter cyrillicy {y}
-\definecharacter cyrillicyhcrs {yhcrs}
-\definecharacter cyrillichdsc {hdsc}
-\definecharacter cyrillicdzhe {dzhe}
-\definecharacter cyrillicchvcrs {chvcrs}
-\definecharacter cyrillicchrdsc {chrdsc}
-\definecharacter cyrillicie {ie}
-\definecharacter cyrillicschwa {schwa}
-\definecharacter cyrillicnje {nje}
-\definecharacter cyrillicyo {yo}
-\definecharacter cyrillicii {ii}
-\definecharacter cyrillicje {je}
-\definecharacter cyrillicq {q}
-\definecharacter cyrillicw {w}
-
-\definecharacter cyrillicGJE {\'\cyrillicG}
-\definecharacter cyrillicgje {\'\cyrillicg}
-\definecharacter cyrillicKJE {\'\cyrillicK}
-\definecharacter cyrillickje {\'\cyrillick}
-
-\stopencoding
-
-\def\cyrillicio{\cyrillicyo}
-\def\cyrillicIO{\cyrillicYO}
-
-%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}
-
-\stopencoding
-
-%D A few goodies:
-
-\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\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
-
-\def\S {\sectionmark }
-\def\P {\paragraphmark}
-
-% for latex users sake
-
-\def\textS {\sectionmark }
-\def\textP {\paragraphmark}
-
-% for old times sake
-
-\def\florin {\textflorin } \def\florijn{\textflorin}
-\def\dollar {\textdollar }
-\def\pound {\textsterling}
-\def\sterling{\textsterling}
-
-% idem
-
-\def\promille{\perthousand}
-\def\permille{\perthousand}
-\def\procent {\percent }
-\def\permine {\fakepermine}
-
-% some more
-
-\def\hyphen {\softhyphen}
-\def\cwm {\compoundwordmark}
-\def\nonbreakinghyphen {\hyphen}
-\def\breakinghyphen {\hyphen\prewordbreak}
-
-% quotes
-
-\def\lowerleftsingleninequote {\quotesinglebase}
-\def\lowerleftdoubleninequote {\quotedblbase}
-\def\lowerrightsingleninequote {\quotesinglebase}
-\def\lowerrightdoubleninequote {\quotedblbase}
-
-\def\upperleftsingleninequote {\quoteright}
-\def\upperleftdoubleninequote {\quotedblright}
-\def\upperrightsingleninequote {\quoteright}
-\def\upperrightdoubleninequote {\quotedblright}
-
-\def\upperleftsinglesixquote {\quoteleft}
-\def\upperleftdoublesixquote {\quotedblleft}
-\def\upperrightsinglesixquote {\quoteleft}
-\def\upperrightdoublesixquote {\quotedblleft}
-
-\def\leftsubguillemot {\guilsingleleft}
-\def\rightsubguillemot {\guilsingleright}
-
-%D A couple of fallbacks suggestion by users, slightly
-%D adapted and obscured by memory saving hacks.
-
-\unprotect
-
-\startencoding[default]
-
-\definecharacter textcent {c\rlap{\hskip-.2\s!em
- \vrule\!!width.2\s!pt\!!height1.2\s!ex\!!depth.2\s!ex}}
-
-\definecharacter texteuro {C\rlap{\hskip-.75\s!em
- \vrule\!!width.4\s!em\!!height.85\s!ex\!!depth-.8\s!ex}}
-
-\definecharacter textblacksquare {\dontleavehmode\hbox{%
- \vrule\!!width.3\s!em\!!height.4\s!em\!!depth-.1\s!em}}
-
-\definecharacter textbrokenbar {\dontleavehmode\hbox{\kern.05\s!em
- \vrule\!!width.4\s!pt\!!height1.8\s!ex\!!depth-.85\s!ex
- \llap{%
- \vrule\!!width.4\s!pt\!!height.35\s!ex\!!depth.6\s!ex}%
- \kern.05\s!em}}
-
-\stopencoding
-
-\protect
-
-%D We also use symbolic names for math accents.
-
-\startencoding[default]
-
-\definecharacter mathacute "7013
-\definecharacter mathgrave "7012
-\definecharacter mathddot "707F
-\definecharacter mathtilde "707E
-\definecharacter mathbar "7016
-\definecharacter mathbreve "7015
-\definecharacter mathcheck "7014
-\definecharacter mathhat "705E
-\definecharacter mathvec "017E
-\definecharacter mathdot "705F
-\definecharacter mathwidetilde "0365
-\definecharacter mathwidehat "0362
-
-\stopencoding
-
-% \startencoding [default]
-
-% \definecommand prime {\mathematics{'}}
-% \definecommand doubleprime {\mathematics{''}}
-% \definecommand tripleprime {\mathematics{'''}}
-
-% \stopencoding
-
-\ifx\zdot\undefined \def\zdot{\zdotaccent} \fi
-\ifx\Zdot\undefined \def\Zdot{\Zdotaccent} \fi
-
-\ifx\greeklamda\undefined \def\greeklamda{\greeklambda} \fi
-\ifx\greekLamda\undefined \def\greekLamda{\greekLambda} \fi
-
-\ifx\leftguillemet \undefined \def\leftguillemet {\leftguillemot } \fi
-\ifx\rightguillemet\undefined \def\rightguillemet{\rightguillemot} \fi
-
-%D New:
-
-\startencoding[\s!default]
-
-\definecharacter schwa {\hbox{\rotate[\c!rotation=180,\c!location=\v!high]{\hbox{e}}}}
-\definecharacter schwagrave {\buildtextgrave\schwa}
-
-\stopencoding
-
-%D Also new, from Taco, for Mojca, who wanted another 8~regimes.
-
-\startencoding[\s!default]
-
-\definecharacter texthorizontalbar {{\endash\kern\zeropoint\endash}}
-\definecharacter textdong {\underbar{\dstroke}}
-
-\stopencoding
-
-%D Goodie (makes more sense):
-
-\def\normalcontrolspace
- {\getglyph{ComputerModernMono}{\char32}}
-
-\def\fakedcontrolspace % can be virtual in luatex
- {\dontleavehmode\hbox
- {\scratchdimen.1ex%
- \kern\scratchdimen
- \vrule \!!width\scratchdimen \!!height5.5\scratchdimen \!!depth3\scratchdimen
- \vrule \!!width\dimexpr.5em-4\scratchdimen\relax \!!height-2\scratchdimen \!!depth3\scratchdimen
- \vrule \!!width\scratchdimen \!!height5.5\scratchdimen \!!depth3\scratchdimen
- \kern\scratchdimen}}
-
-\def\fakecontrolspace{\let\normalcontrolspace\fakedcontrolspace}
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-ec.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-ec.mkii
deleted file mode 100644
index 918c85e1261..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-ec.mkii
+++ /dev/null
@@ -1,295 +0,0 @@
-%D \module
-%D [ file=enco-ec,
-%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, Mojca Miklavec},
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 \LATEX2e's T1 encoding vector. All standard \LATEX\
-%D accents will work, including \type{\k}. The only accent that
-%D does not work is \type{\t} (there is no tie in T1 encoding).
-%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. 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]
-
-% 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
-\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 25 `I % dotless i
-
-% 156 vs. 188 IJligature
-
-%D Some languages need this:
-
-% \definecaseself 34 % quotedbl
-% \definecaseself 18 % quotedblbase
-% \definecaseself 16 % quotedblleft
-% \definecaseself 17 % quotedblright
-% \definecaseself 39 % quotesingle
-% \definecaseself 13 % quotesinglebase
-% \definecaseself 96 % quoteleft
-\definecaseself 39 % quoteright
-
-%D So far for the mapping.
-
-%D The following characters are kind of dangerous,
-%D that is, they are normally not part of fonts, unless
-%D explicitly constructed.
-%D
-%D \startitemize[columns,two]
-%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}
-% \item \type{\textvisiblespace}
-%D \stopitemize
-
-%D So, for the moment we nil them; we can always create
-%D another vector if needed.
-
-\stopmapping
-
-\startencoding[ec][ec] % second arg defines auto regime, needed here ?
-
-\definecharacter textgrave 0
-\definecharacter textacute 1
-\definecharacter textcircumflex 2
-\definecharacter texttilde 3
-\definecharacter textdiaeresis 4
-\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 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 compoundwordmark 23
-%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
-% numbersign # 35
-% dollar $ 36
-\definecharacter percent 37
-% ampersand & 38
-%definecharacter quotesingle 39 % fake 'm TODO:enco-def!!!!
-\definecharacter quoteright 39
-% 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 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
-
-\stopencoding
-
-\startencoding[ec]
-
-\definecharacter Scommaaccent {\Scedilla}
-\definecharacter scommaaccent {\scedilla}
-\definecharacter Tcommaaccent {\Tcedilla}
-\definecharacter tcommaaccent {\tcedilla}
-
-\stopencoding
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-ecm.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-ecm.mkii
deleted file mode 100644
index 8a97065747a..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-ecm.mkii
+++ /dev/null
@@ -1,33 +0,0 @@
-%D \module
-%D [ file=enco-ec,
-%D version=2000.05.07,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=Glyphs that may not be present in EC,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 next typescript removes a few problematic characters
-%D from the ec encoding vector. So, in case of troubles, say
-%D
-%D \starttyping
-%D \useencoding[ecm] % ec minus
-%D \stoptyping
-
-\startencoding[ec][ec]
-
-\definecharacter ijligature {ij}
-\definecharacter IJligature {IJ}
-\definecharacter Ssharp {SS}
-\definecharacter tcaron {\buildtextaccent\textcaron t}
-\definecharacter Tcedilla {\buildtextcedilla T}
-\definecharacter tcedilla {\buildtextcedilla t}
-\definecharacter ydiaeresis {\buildtextaccent\textdiaeresis y}
-
-\stopencoding
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-el.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-el.mkii
deleted file mode 100644
index f268dcb3c24..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-el.mkii
+++ /dev/null
@@ -1,272 +0,0 @@
-%D \module
-%D [ file=enco-el,
-%D version=2005.08.24,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=EuroLetter,
-%D author={Several Users},
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 EuroLetter encoding vector, also known as Dense Encoding is
-%D the result of discussion among users, most noticably Adam Lindsay,
-%D Mojka Miklavec, Patrick Gundlach, Taco Hoekwater and \unknown.
-%D It was a follow up of a thread started long ago where we
-%D discussed an encoding without the weird, never used symbols, but
-%D with as many characters as possible in order to support the utf-8
-%D input regime.
-
-\startencoding[el]
-
-\definecasemaps 1 to 15 lc +16 uc 0
-\definecasemaps 17 to 31 lc 0 uc -16
-
-\definecasemaps 128 to 159 lc +32 uc 0
-\definecasemaps 160 to 191 lc 0 uc -32
-
-\definecasemaps 192 to 223 lc +32 uc 0
-\definecasemaps 224 to 255 lc 0 uc -32
-
-\definecasemap 92 92 124
-\definecasemap 92 124 92
-
-\definecharacter dotlessi 160
-\definecharacter endash 32
-\definecharacter emdash 16
-
-\definecharacter aeligature 230
-\definecharacter AEligature 198
-\definecharacter oeligature 247
-\definecharacter OEligature 215
-
-\definecharacter ssharp 38
-
-\definecharacter thorn 254
-\definecharacter Thorn 222
-
-\definecharacter eth 240
-\definecharacter Eth 208
-
-\definecharacter exclamdown 42
-\definecharacter questiondown 43
-
-\definecharacter quotedbl 35
-\definecharacter quotedblbase 36
-\definecharacter quotedblleft 34
-\definecharacter quotedblright 35
-
-\definecharacter quotesingle 39
-\definecharacter quotesinglebase 0
-
-\definecharacter quoteleft 96
-\definecharacter quoteright 39
-
-\definecharacter guilsingleleft 60
-\definecharacter guilsingleright 62
-
-\definecharacter leftguillemot 123
-\definecharacter rightguillemot 125
-
-\definecharacter Acircumflex 194
-\definecharacter acircumflex 226
-%definecharacter Ccircumflex {\buildtextaccent\textcircumflex C}
-%definecharacter ccircumflex {\buildtextaccent\textcircumflex c}
-\definecharacter Ecircumflex 202
-\definecharacter ecircumflex 234
-%definecharacter Gcircumflex {\buildtextaccent\textcircumflex G}
-%definecharacter gcircumflex {\buildtextaccent\textcircumflex g}
-%definecharacter Hcircumflex {\buildtextaccent\textcircumflex H}
-%definecharacter hcircumflex {\buildtextaccent\textcircumflex h}
-\definecharacter Icircumflex 206
-\definecharacter icircumflex 238
-%definecharacter Jcircumflex {\buildtextaccent\textcircumflex \dotlessJ}
-%definecharacter jcircumflex {\buildtextaccent\textcircumflex \dotlessj}
-\definecharacter Ocircumflex 212
-\definecharacter ocircumflex 244
-%definecharacter Scircumflex {\buildtextaccent\textcircumflex S}
-%definecharacter scircumflex {\buildtextaccent\textcircumflex s}
-\definecharacter Ucircumflex 219
-\definecharacter ucircumflex 251
-\definecharacter Wcircumflex 154
-\definecharacter wcircumflex 186
-\definecharacter Ycircumflex 156
-\definecharacter ycircumflex 188
-
-\definecharacter Agrave 192
-\definecharacter agrave 224
-\definecharacter Egrave 200
-\definecharacter egrave 232
-\definecharacter Igrave 204
-\definecharacter igrave 236
-\definecharacter Ograve 210
-\definecharacter ograve 242
-\definecharacter Ugrave 217
-\definecharacter ugrave 249
-\definecharacter Ygrave 155
-\definecharacter ygrave 187
-
-\definecharacter Atilde 195
-\definecharacter atilde 227
-%definecharacter Itilde {\buildtextaccent\texttilde \dotlessI}
-%definecharacter itilde {\buildtextaccent\texttilde \dotlessi}
-\definecharacter Ntilde 209
-\definecharacter ntilde 241
-\definecharacter Otilde 213
-\definecharacter otilde 245
-%definecharacter Utilde {\buildtextaccent\texttilde U}
-%definecharacter utilde {\buildtextaccent\texttilde u}
-%definecharacter Ytilde {\buildtextaccent\texttilde Y}
-%definecharacter ytilde {\buildtextaccent\texttilde y}
-
-\definecharacter Adiaeresis 196
-\definecharacter adiaeresis 228
-\definecharacter Ediaeresis 203
-\definecharacter ediaeresis 235
-\definecharacter Idiaeresis 207
-\definecharacter idiaeresis 239
-\definecharacter Odiaeresis 214
-\definecharacter odiaeresis 246
-\definecharacter Udiaeresis 220
-\definecharacter udiaeresis 252
-\definecharacter Ydiaeresis 223
-\definecharacter ydiaeresis 255
-
-\definecharacter Aacute 193
-\definecharacter aacute 225
-\definecharacter Cacute 4
-\definecharacter cacute 20
-\definecharacter Eacute 201
-\definecharacter eacute 233
-\definecharacter Iacute 205
-\definecharacter iacute 237
-\definecharacter Lacute 132
-\definecharacter lacute 164
-\definecharacter Nacute 136
-\definecharacter nacute 168
-\definecharacter Oacute 211
-\definecharacter oacute 243
-\definecharacter Racute 141
-\definecharacter racute 173
-\definecharacter Sacute 144
-\definecharacter sacute 176
-\definecharacter Uacute 218
-\definecharacter uacute 250
-\definecharacter Yacute 221
-\definecharacter yacute 253
-\definecharacter Zacute 157
-\definecharacter zacute 189
-
-\definecharacter Dstroke 8
-\definecharacter dstroke 24
-\definecharacter Hstroke 92
-\definecharacter hstroke 124
-%definecharacter Tstroke {T}
-%definecharacter tstroke {t}
-
-\definecharacter Cdotaccent 6
-\definecharacter cdotaccent 22
-\definecharacter Edotaccent 10
-\definecharacter edotaccent 26
-\definecharacter Gdotaccent 15
-\definecharacter gdotaccent 31
-\definecharacter Idotaccent 128
-%definecharacter idotaccent {\buildtextaccent\textdotaccent \dotlessi}
-\definecharacter Zdotaccent 159
-\definecharacter zdotaccent 191
-
-\definecharacter Amacron 2
-\definecharacter amacron 18
-\definecharacter Emacron 11
-\definecharacter emacron 27
-\definecharacter Imacron 129
-\definecharacter imacron 161
-\definecharacter Omacron 140
-\definecharacter omacron 172
-\definecharacter Umacron 152
-\definecharacter umacron 184
-
-\definecharacter Ccedilla 199
-\definecharacter ccedilla 231
-\definecharacter Scedilla 146
-\definecharacter scedilla 178
-
-\definecharacter Gcommaaccent 14
-\definecharacter gcommaaccent 30
-\definecharacter Kcommaaccent 131
-\definecharacter kcommaaccent 163
-\definecharacter Lcommaaccent 135
-\definecharacter lcommaaccent 167
-\definecharacter Ncommaaccent 138
-\definecharacter ncommaaccent 170
-\definecharacter Rcommaaccent 143
-\definecharacter rcommaaccent 175
-%definecharacter Tcedilla 149 % there is no tcedilla in encoding
-%definecharacter tcedilla 181
-
-\definecharacter Scommaaccent 147
-\definecharacter scommaaccent 179
-\definecharacter Tcommaaccent 149
-\definecharacter tcommaaccent 181
-
-\definecharacter Ohungarumlaut 139
-\definecharacter ohungarumlaut 171
-\definecharacter Uhungarumlaut 150
-\definecharacter uhungarumlaut 182
-
-\definecharacter Aogonek 3
-\definecharacter aogonek 19
-\definecharacter Eogonek 12
-\definecharacter eogonek 28
-\definecharacter Iogonek 130
-\definecharacter iogonek 162
-\definecharacter Uogonek 153
-\definecharacter uogonek 185
-
-\definecharacter Aring 197
-\definecharacter aring 229
-\definecharacter Uring 151
-\definecharacter uring 183
-
-\definecharacter Abreve 1
-\definecharacter abreve 17
-%definecharacter Ebreve {\buildtextaccent\textbreve E}
-%definecharacter ebreve {\buildtextaccent\textbreve e}
-\definecharacter Gbreve 13
-\definecharacter gbreve 29
-%definecharacter Ibreve {\buildtextaccent\textbreve \dotlessI}
-%definecharacter ibreve {\buildtextaccent\textbreve \dotlessi}
-%definecharacter Obreve {\buildtextaccent\textbreve O}
-%definecharacter obreve {\buildtextaccent\textbreve o}
-%definecharacter Ubreve {\buildtextaccent\textbreve U}
-%definecharacter ubreve {\buildtextaccent\textbreve u}
-
-\definecharacter Ccaron 5
-\definecharacter ccaron 21
-\definecharacter Dcaron 7
-\definecharacter dcaron 23
-\definecharacter Ecaron 9
-\definecharacter ecaron 25
-\definecharacter Lcaron 133
-\definecharacter lcaron 165
-\definecharacter Ncaron 137
-\definecharacter ncaron 169
-\definecharacter Rcaron 142
-\definecharacter rcaron 174
-\definecharacter Scaron 145
-\definecharacter scaron 177
-\definecharacter Tcaron 148
-\definecharacter tcaron 180
-%definecharacter Ycaron {\buildtextaccent\textcaron Y}
-%definecharacter ycaron {\buildtextaccent\textcaron y}
-\definecharacter Zcaron 158
-\definecharacter zcaron 190
-
-\definecharacter Lstroke 134
-\definecharacter lstroke 166
-\definecharacter Ostroke 216
-\definecharacter ostroke 248
-
-\stopencoding
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-fde.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-fde.mkii
deleted file mode 100644
index 57e572c04f4..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-fde.mkii
+++ /dev/null
@@ -1,126 +0,0 @@
-%D \module
-%D [ file=enco-fde,
-%D version=2000.08.20,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=German Input Filter,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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
-
-\installactivecharacter "
-
-\startlanguagespecifics[\s!de]
-
- \installcompoundcharacter "a {\aumlaut\midworddiscretionary}
- \installcompoundcharacter "e {\eumlaut\midworddiscretionary}
- \installcompoundcharacter "i {\iumlaut\midworddiscretionary}
- \installcompoundcharacter "o {\oumlaut\midworddiscretionary}
- \installcompoundcharacter "u {\uumlaut\midworddiscretionary}
- \installcompoundcharacter "s {\ssharp}
- \installcompoundcharacter "z {\ssharp}
-
- \installcompoundcharacter "A {\Aumlaut}
- \installcompoundcharacter "E {\Eumlaut}
- \installcompoundcharacter "I {\Iumlaut}
- \installcompoundcharacter "O {\Oumlaut}
- \installcompoundcharacter "U {\Uumlaut}
- \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 "` {\startdelimitedtext[\v!quotation]}
- \installcompoundcharacter "' {\stopdelimitedtext}
- \installcompoundcharacter ". {\kern.1em\ignorespaces}
-
- %installcompoundcharacter "` {\languageparameter\c!leftquotation }
- %installcompoundcharacter "' {\languageparameter\c!rightquotation}
-
- \def\setupDElanguage
- {\setuplanguage
- [\s!de]
- [\c!leftsentence=\leftguillemot,
- \c!rightsentence=\rightguillemot,
- \c!leftsubsentence=\leftsubguillemot,
- \c!rightsubsentence=\rightsubguillemot]}
-
- \installcompoundcharacter "< {{\setupDElanguage|<|}}
- \installcompoundcharacter "> {{\setupDElanguage|>|}}
- \installcompoundcharacter "| {|*|}
-
-\stoplanguagespecifics
-
-% \hyphenatedword{hinauff|*|liegen}
-% \hyphenatedword{hinauff"|liegen}
-
-%D An experimental hack:
-
-% no {\simplifiedcompoundcharacter"}
-
-% \startencoding[pdfdoc]
-% \startlanguagespecifics[\s!de]% hm, a % is needed
-% \defineactivecharacter " {\"}
-% \stoplanguagespecifics
-% \stopencoding
-
-\startencoding[ec]
- \startlanguagespecifics[\s!de]%
- \installcompoundcharacter "a {\adiaeresis}
- \installcompoundcharacter "e {\ediaeresis}
- \installcompoundcharacter "i {\idiaeresis}
- \installcompoundcharacter "o {\odiaeresis}
- \installcompoundcharacter "u {\udiaeresis}
- \installcompoundcharacter "A {\Adiaeresis}
- \installcompoundcharacter "E {\Ediaeresis}
- \installcompoundcharacter "I {\Idiaeresis}
- \installcompoundcharacter "O {\Odiaeresis}
- \installcompoundcharacter "U {\Udiaeresis}
- \stoplanguagespecifics
-\stopencoding
-
-\startencoding[texnansi]
- \startlanguagespecifics[\s!de]%
- \installcompoundcharacter "a {\adiaeresis}
- \installcompoundcharacter "e {\ediaeresis}
- \installcompoundcharacter "i {\idiaeresis}
- \installcompoundcharacter "o {\odiaeresis}
- \installcompoundcharacter "u {\udiaeresis}
- \installcompoundcharacter "A {\Adiaeresis}
- \installcompoundcharacter "E {\Ediaeresis}
- \installcompoundcharacter "I {\Idiaeresis}
- \installcompoundcharacter "O {\Odiaeresis}
- \installcompoundcharacter "U {\Udiaeresis}
- \stoplanguagespecifics
-\stopencoding
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-ffr.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-ffr.mkii
deleted file mode 100644
index 7e605bb052c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-ffr.mkii
+++ /dev/null
@@ -1,55 +0,0 @@
-%D \module
-%D [ file=enco-ffr,
-%D version=2002.05.07,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=French Input Filter,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% \definehspace[fr][:][.25em]
-% \definehspace[fr][;][.25em]
-% \definehspace[fr][!][.25em]
-% \definehspace[fr][?][.25em]
-
-\enablemode[activecolon] \usemodule[tryout] % for the moment
-
-\installactivecharacter :
-\installactivecharacter ;
-\installactivecharacter ?
-\installactivecharacter !
-
-\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
-
-\appendtoks % maybe everywhere
- \chardef\activecharactermode\zerocount
-\to\everyMPgraphic
-
-% maybe tricky due to possible name clashes:
-%
-% \def\ieme {\highordinalstr{e}}
-% \def\iemes{\highordinalstr{es}}
-% \def\ier {\highordinalstr{er}}
-% \def\iers {\highordinalstr{ers}}
-% \def\iere {\highordinalstr{re}}
-% \def\ieres{\highordinalstr{res}}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-fpl.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-fpl.mkii
deleted file mode 100644
index ddf86569838..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-fpl.mkii
+++ /dev/null
@@ -1,98 +0,0 @@
-%D \module
-%D [ file=enco-fpl,
-%D version=2000.08.20,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=Polish Input Filter,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 definitions used to be part of lang-sla.tex.
-
-\unprotect
-
-% todo : named glyphs
-
-\installactivecharacter /
-
-\startlanguagespecifics[\s!pl]
-
-% \appendtoks \makecharacteractive / \to \everynormalcatcodes % obsolete
-
- \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
-
-\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
-
-% 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
- \defineactivecharacter / {\simplifiedcompoundcharacter/}
- \stoplanguagespecifics
-\stopencoding
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-fro.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-fro.mkii
deleted file mode 100644
index af127216383..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-fro.mkii
+++ /dev/null
@@ -1,35 +0,0 @@
-%D \module
-%D [ file=enco-fro,
-%D version=2000.08.20,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=Romanian Input Filter,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 definitions used to be part of lang-ita.tex.
-
-\unprotect
-
-\installactivecharacter "
-
-\startlanguagespecifics[\s!ro]
-
- \installcompoundcharacter "a {\acircumflex}
- \installcompoundcharacter "i {\icircumflex}
- \installcompoundcharacter "s {\scedilla}
- \installcompoundcharacter "t {\tcedilla}
- \installcompoundcharacter "A {\Acircumflex}
- \installcompoundcharacter "I {\Icircumflex}
- \installcompoundcharacter "S {\Scedilla}
- \installcompoundcharacter "T {\Tcedilla}
- \installcompoundcharacter "` {\startdelimitedtext[\v!quotation]}
- \installcompoundcharacter "' {\stopdelimitedtext}
-
-\stoplanguagespecifics
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-fsl.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-fsl.mkii
deleted file mode 100644
index 8fbca98cafc..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-fsl.mkii
+++ /dev/null
@@ -1,32 +0,0 @@
-%D \module
-%D [ file=enco-fsl,
-%D version=2005.08.17,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=Slovenian Specialities,
-%D author={Hans Hagen, Mojka Miklavec},
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Usage:
-%D
-%D \starttyping
-%D \useencoding[fsl]
-%D
-%D \starttext
-%D \dstroke \language[sl] \dstroke
-%D \stoptext
-%D \stoptyping
-
-\unprotect
-
-\startlanguagespecifics[\s!sl]
- \startencoding[\s!default]
- \definecharacter dstroke {d\zcaron} % hm, expects a space delimiter
- \stopencoding
-\stoplanguagespecifics
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-grk.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-grk.mkii
deleted file mode 100644
index 6264f362e88..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-grk.mkii
+++ /dev/null
@@ -1,190 +0,0 @@
-%D \module
-%D [ file=enco-grk,
-%D version=2003.03.01,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=Greek,
-%D author=Apostolos Syropoulos,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\startmapping[iso-8859-7]
-
-% Uppercase Greek letters
-
-\definecasemap 193 193 225 % greekAlpha
-\definecasemap 194 194 226 % greekBeta
-\definecasemap 195 195 227 % greekGamma
-\definecasemap 196 196 228 % greekDelta
-\definecasemap 197 197 229 % greekEpsilon
-\definecasemap 198 198 230 % greekZeta
-\definecasemap 199 199 213 % greekEta
-\definecasemap 200 200 232 % greekTheta
-\definecasemap 201 201 233 % greekIota
-\definecasemap 202 202 234 % greekKappa
-\definecasemap 203 203 235 % greekLambda
-\definecasemap 204 204 236 % greekMu
-\definecasemap 205 205 237 % greekNu
-\definecasemap 206 206 238 % greekXi
-\definecasemap 207 207 239 % greekOmicron
-\definecasemap 208 208 240 % greekPi
-\definecasemap 209 209 241 % greekRho
-\definecasemap 211 211 243 % greekSigma
-\definecasemap 212 212 244 % greekTau
-\definecasemap 213 213 245 % greekUpsilon
-\definecasemap 214 214 246 % greekPhi
-\definecasemap 215 215 247 % greekChi
-\definecasemap 216 216 248 % greekPsi
-\definecasemap 217 217 249 % greekOmega
-
-% Lowercase Greek letters
-
-\definecasemap 225 193 225 % greekalpha
-\definecasemap 226 194 226 % greekbeta
-\definecasemap 227 195 227 % greekgamma
-\definecasemap 228 196 228 % greekdelta
-\definecasemap 229 197 229 % greekepsilon
-\definecasemap 230 198 230 % greekzeta
-\definecasemap 213 199 213 % greeketa
-\definecasemap 232 200 232 % greektheta
-\definecasemap 233 201 233 % greekiota
-\definecasemap 234 202 234 % greekkappa
-\definecasemap 235 203 235 % greeklambda
-\definecasemap 236 204 236 % greekmu
-\definecasemap 237 205 237 % greeknu
-\definecasemap 238 206 238 % greekxi
-\definecasemap 239 207 239 % greekomicron
-\definecasemap 240 208 240 % greekpi
-\definecasemap 241 209 241 % greekrho
-\definecasemap 242 211 242 % greekfinalsigma
-\definecasemap 243 211 243 % greekSigma
-\definecasemap 244 212 244 % greekTau
-\definecasemap 245 213 245 % greekUpsilon
-\definecasemap 246 214 246 % greekPhi
-\definecasemap 247 215 247 % greekChi
-\definecasemap 248 216 248 % greekPsi
-\definecasemap 249 217 249 % greekOmega
-
-% Accented Uppercase Greek letters
-
-\definecasemap 182 193 220 % greekAlphatonos
-\definecasemap 184 197 221 % greekEpsilontonos
-\definecasemap 185 199 222 % greekEtatonos
-\definecasemap 186 201 223 % greekIotatonos
-\definecasemap 188 207 252 % greekOmicrontonos
-\definecasemap 190 213 253 % greekUpsilontonos
-\definecasemap 191 217 254 % greekOmegatonos
-\definecasemap 218 218 250 % greekIotadialytika
-\definecasemap 219 219 251 % greekUpsilondialytika
-
-% Accented Lowercase Greek letters
-
-\definecasemap 220 193 220 % greekalphatonos
-\definecasemap 221 197 221 % greekepsilontonos
-\definecasemap 222 199 222 % greeketatonos
-\definecasemap 223 201 223 % greekiotatonos
-\definecasemap 252 207 252 % greekomicrontonos
-\definecasemap 253 213 253 % greekupsilontonos
-\definecasemap 254 217 254 % greekomegatonos
-\definecasemap 250 218 250 % greekiotadialytika
-\definecasemap 251 219 251 % greekupsilondialytika
-\definecasemap 192 218 192 % greekiotadialytikatonos
-\definecasemap 224 219 224 % greekupsilondialytikatonos
-
-\stopmapping
-
-\startencoding[iso-8859-7]
-
-% Uppercase Greek letters
-
-\definecharacter greekAlpha 193
-\definecharacter greekBeta 194
-\definecharacter greekGamma 195
-\definecharacter greekDelta 196
-\definecharacter greekEpsilon 197
-\definecharacter greekZeta 198
-\definecharacter greekEta 199
-\definecharacter greekTheta 200
-\definecharacter greekIota 201
-\definecharacter greekKappa 202
-\definecharacter greekLambda 203
-\definecharacter greekMu 204
-\definecharacter greekNu 205
-\definecharacter greekXi 206
-\definecharacter greekOmicron 207
-\definecharacter greekPi 208
-\definecharacter greekRho 209
-\definecharacter greekSigma 211
-\definecharacter greekTau 212
-\definecharacter greekUpsilon 213
-\definecharacter greekPhi 214
-\definecharacter greekChi 215
-\definecharacter greekPsi 216
-\definecharacter greekOmega 217
-
-% Lowercase Greek letters
-
-\definecharacter greekalpha 225
-\definecharacter greekbeta 226
-\definecharacter greekgamma 227
-\definecharacter greekdelta 228
-\definecharacter greekepsilon 229
-\definecharacter greekzeta 230
-\definecharacter greeketa 231
-\definecharacter greektheta 232
-\definecharacter greekiota 233
-\definecharacter greekkappa 234
-\definecharacter greeklambda 235
-\definecharacter greekmu 236
-\definecharacter greeknu 237
-\definecharacter greekxi 238
-\definecharacter greekomicron 239
-\definecharacter greekpi 240
-\definecharacter greekrho 241
-\definecharacter greekfinalsigma 242
-\definecharacter greeksigma 243
-\definecharacter greektau 244
-\definecharacter greekupsilon 245
-\definecharacter greekphi 246
-\definecharacter greekchi 247
-\definecharacter greekpsi 248
-\definecharacter greekomega 249
-
-% Accented Uppercase Greek letters
-
-\definecharacter greekAlphatonos 182
-\definecharacter greekEpsilontonos 184
-\definecharacter greekEtatonos 185
-\definecharacter greekIotatonos 186
-\definecharacter greekOmicrontonos 188
-\definecharacter greekUpsilontonos 190
-\definecharacter greekOmegatonos 191
-\definecharacter greekIotadialytika 218
-\definecharacter greekUpsilondialytika 219
-
-% Accented Lowercase Greek letters
-
-\definecharacter greekalphatonos 220
-\definecharacter greekepsilontonos 221
-\definecharacter greeketatonos 222
-\definecharacter greekiotatonos 223
-\definecharacter greekomicrontonos 252
-\definecharacter greekupsilontonos 253
-\definecharacter greekomegatonos 254
-\definecharacter greekiotadialytika 250
-\definecharacter greekupsilondialytika 251
-\definecharacter greekiotadialytikatonos 192
-\definecharacter greekupsilondialytikatonos 224
-
-% Miscellaneous Greek symbols
-
-\definecharacter greekleftquot 171
-\definecharacter greekrightquot 187
-\definecharacter greektonos 180
-\definecharacter greekdialytikatonos 181
-\definecharacter greekapostrophos 162
-
-\stopencoding
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-heb.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-heb.mkii
deleted file mode 100644
index a4ef2cd2c11..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-heb.mkii
+++ /dev/null
@@ -1,16 +0,0 @@
-%D \module
-%D [ file=enco-heb,
-%D version=2005.01.27,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=Hebrew,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 To be done.
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-ibm.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-ibm.mkii
deleted file mode 100644
index 48695ca5298..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-ibm.mkii
+++ /dev/null
@@ -1,7 +0,0 @@
-% temporary module, needed for downward compatibility
-
-%\input regi-ibm.tex
-
-\enableregime[ibm]
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-il2.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-il2.mkii
deleted file mode 100644
index 9b08dc8972f..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-il2.mkii
+++ /dev/null
@@ -1,157 +0,0 @@
-%D \module
-%D [ file=enco-il2,
-%D version=2000.05.07, % 1998.12.01,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=Czech and Slovak ISO Latin 2 Encoding,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% This encoding will go but the regime will remain.
-
-%D This Czech/Slovak encoding is dedicated to Han The Thanh.
-%D The numbers are derived from some files he sent me. This
-%D definition file is (still) sort of beta.
-
-\startmapping[il2]
-
-\resetcaserange 127 to 255 % we map them all to themselves
-
-\definecaseswap 184 152
-\definecaseswap 181 165
-\definecaseswap 185 169
-\definecaseswap 187 171
-\definecaseswap 190 174
-\definecaseswap 224 192
-\definecaseswap 225 193
-\definecaseswap 228 196
-\definecaseswap 229 197
-\definecaseswap 232 200
-\definecaseswap 233 201
-\definecaseswap 236 204
-\definecaseswap 237 205
-\definecaseswap 239 207
-\definecaseswap 242 210
-\definecaseswap 243 211
-\definecaseswap 244 212
-\definecaseswap 246 214
-\definecaseswap 248 216
-\definecaseswap 249 217
-\definecaseswap 250 218
-\definecaseswap 252 220
-\definecaseswap 253 221
-
-\stopmapping
-
-\startencoding[il2][il2]
-
-\definecharacter textgrave 18
-\definecharacter textacute 19
-\definecharacter textcaron 20
-\definecharacter textbreve 21
-\definecharacter textmacron 22
-\definecharacter textring 23
-\definecharacter textcedilla 24
-\definecharacter textcircumflex 94
-\definecharacter textdotaccent 95
-\definecharacter texthungarumlaut 125
-\definecharacter texttilde 126
-\definecharacter textdiaeresis 127
-
-\definecharacter dotlessi 16
-\definecharacter dotlessj 17
-
-\definecharacter aeligature 26
-\definecharacter AEligature 29
-\definecharacter oeligature 27
-\definecharacter OEligature 30
-
-\definecharacter ssharp 25
-
-\definecharacter Racute 192
-\definecharacter Aacute 193
-\definecharacter Lacute 197
-\definecharacter Eacute 201
-\definecharacter Iacute 205
-\definecharacter Oacute 211
-\definecharacter Uacute 218
-\definecharacter Yacute 221
-\definecharacter racute 224
-\definecharacter aacute 225
-\definecharacter lacute 229
-\definecharacter eacute 233
-\definecharacter iacute 237
-\definecharacter oacute 243
-\definecharacter uacute 250
-\definecharacter yacute 253
-
-\definecharacter Lcaron 165
-\definecharacter Scaron 169
-\definecharacter Tcaron 171
-\definecharacter Zcaron 174
-\definecharacter lcaron 181
-\definecharacter scaron 185
-\definecharacter tcaron 187
-\definecharacter zcaron 190
-\definecharacter Ccaron 200
-\definecharacter Ecaron 204
-\definecharacter Dcaron 207
-\definecharacter Ncaron 210
-\definecharacter Rcaron 216
-\definecharacter ccaron 232
-\definecharacter ecaron 236
-\definecharacter dcaron 239
-\definecharacter ncaron 242
-\definecharacter rcaron 248
-
-\definecharacter Ocircumflex 212
-\definecharacter ocircumflex 244
-
-\definecharacter Adiaeresis 196
-\definecharacter Odiaeresis 214
-\definecharacter Udiaeresis 220
-\definecharacter adiaeresis 228
-\definecharacter odiaeresis 246
-\definecharacter udiaeresis 252
-
-\definecharacter Agrave 152
-\definecharacter agrave 184
-
-\definecharacter Ohungarumlaut 213
-\definecharacter Uhungarumlaut 219
-\definecharacter ohungarumlaut 245
-\definecharacter uhungarumlaut 251
-
-\definecharacter Uring 217
-\definecharacter uring 249
-\definecharacter Aring {\ilencodedrA}
-
-\definecharacter ostroke 28
-\definecharacter Ostroke 31
-\definecharacter Lstroke {\ilencodedL}
-\definecharacter lstroke {\ilencodedl}
-
-\def\ilencodedrA
- {\dontleavehmode\hbox\bgroup
- \setbox0\hbox{h}%
- \dimen0=\ht0
- \advance\dimen0 by -1ex
- \rlap{\raise.67\dimen0\hbox{\char'27}}A%
- \egroup}
-
-\def\ilencodedl
- {\dontleavehmode{\char32l}}
-
-\def\ilencodedL
- {\dontleavehmode\hbox\bgroup
- \setbox0\hbox{L}%
- \hbox to\wd0{\hss\char32L}%
- \egroup}
-
-\stopencoding
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-ini.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-ini.mkii
deleted file mode 100644
index 8603f2420e1..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-ini.mkii
+++ /dev/null
@@ -1,1137 +0,0 @@
-%D \module
-%D [ file=enco-ini,
-%D version=2007.02.19, % 2000.12.27, % 1998.12.03,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Quite some code will be moved to the mk files once we're ready
-%D for it.
-
-%D This module is a reimplementation of the module that handled
-%D composed characters and non \ASCII\ characters. The changed
-%D are not that fundamental, and mainly concerns moving
-%D definitions of specific glyphs and accents to other files as
-%D well as moving plain handling of accents to this module
-%D instead of overloading plain \TEX\ commands.
-
-%D Patterns are kind of mixed with font encodings and
-%D mappings. Alas.
-
-\ifx\synchronizepatterns\undefined \let\synchronizepatterns\relax \fi
-
-%D While dealing with input (the text source) and output (the
-%D glyphs), encoding comes into view. To summarize a few:
-%D
-%D \startitemize
-%D \item Bytes in the input file are mapped to an internal
-%D representation. An~\type {a} often stays an~\type {a},
-%D but~\type {\"e} can become either one code or become
-%D two codes (ending in overlapping glyphs).
-%D \item Characters can be made active and mapped onto another
-%D character.
-%D \item When changing case, characters are mapped onto
-%D themselves, their case||counterpart or a reasonable
-%D alternative, like~\"e onto~e.
-%D \item Single character representations in a \DVI\ file can
-%D be mapped onto one or more characters, either of not
-%D in more than one font file (virtual fonts).
-%D \item In the final format, fonts collections can be
-%D partially embedded, thereby losing the one||to||one
-%D relation between several instances of one font.
-%D \item For special purposes, individual characters should be
-%D mapped onto a dedicated encoding vector, for instance
-%D \PDF\ document encoding.
-%D \stopitemize
-%D
-%D These and other kind of mappings are to be dealt with, and
-%D the exact way of dealing often depends on the language to be
-%D typeset.
-
-\writestatus{loading}{ConTeXt Encoding Macros / Initialization}
-
-\unprotect
-
-%D First we define a few local or not yet initialized constants.
-
-\def\@map@{@m@ap@} % mapping prefix
-\def\@fha@{@f@ha@} % font prefix
-\def\@cas@{@c@as@} % casecom prefix
-
-\ifx\currentlanguage\undefined \let\currentlanguage\s!en \fi
-
-%D \macros
-%D {setupencoding}
-%D
-%D The following setup command is used to tune encoding
-%D handling.
-
-\def\setupencoding
- {\dosingleargument\dosetupencoding}
-
-\def\dosetupencoding[#1]%
- {\getparameters[\??ec][#1]%
- \edef\defaultencoding
- {\ifx\@@ecdefault\empty\s!default\else\@@ecdefault\fi}}
-
-%D \macros
-%D {useencoding}
-%D
-%D Encodings things are defined in separate files and are
-%D loaded only once, using:
-%D
-%D \showsetup{useencoding}
-
-\def\douseencoding#1%
- {\doifundefined{\c!file\f!encodingprefix#1}%
- {\letvalue{\c!file\f!encodingprefix#1}\empty
- \makeshortfilename[\truefilename{\f!encodingprefix#1}]%
- \startreadingfile
- \readsysfile{\shortfilename.mkii}
- {\showmessage\m!encodings2{#1}}
- {\showmessage\m!encodings3{#1}}%
- \stopreadingfile}}
-
-\def\useencoding[#1]%
- {\processcommalist[#1]\douseencoding}
-
-%D \macros
-%D {startmapping,enablemapping}
-%D
-%D In order to process patterns, convert from lower to
-%D uppercase and vise versa and some more, we provide a
-%D mechanism to define mappings. The first real application
-%D of this command was:
-%D
-%D \starttyping
-%D \startmapping [something]
-%D \definecasemap 165 181 165
-%D \definecasemap 171 187 171
-%D ...
-%D \defineuppercasecom \i {I}
-%D \defineuppercasecom \l \L
-%D \definelowercasecom \AE \ae
-%D ...
-%D \stopmapping
-%D \stoptyping
-%D
-%D So, character 165 becomes 181 in uppercase and 165 in
-%D lowercase. A mapping is activated with \type {\enablemapping}.
-
-\def\startsavingmappingtoks#1%
- {\bgroup
- \edef\charactermapping{@#1@}%
- \checkmappingtoks
- \setmappingtoks
- \the\mappingtoks}
-
-\def\stopsavingmappingtoks
- {\global\mappingtoks\emptytoks
- \dostepwiserecurse{0}{255}\plusone
- {\edef\@@expanded
- {\the\mappingtoks
- \ifnum\recurselevel>127
- \noexpand\settoletterunlessactive{\recurselevel}%
- \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
- }%
- \global\mappingtoks\expandafter{\@@expanded}}%
- \egroup
- \let\enabledmapping\empty
- \enablemapping[\currentmapping]}
-
-\def\startmapping[#1]%
- {\startsavingmappingtoks{#1}}
-
-\def\stopmapping
- {\stopsavingmappingtoks}
-
-\def\optimizemapping[#1]%
- {\startsavingmappingtoks{#1}%
- % nothing, just an automatic cleanup
- \stopsavingmappingtoks
- % we need to resync
- %\let\enabledmapping\relax
- }%\enablemapping[\currentmapping]}
-
-\def\setmappingtoks
- {\@EA\let\@EA\mappingtoks\csname\@map@\charactermapping\endcsname
- \@EA\let\@EA\casecomtoks\csname\@cas@\charactermapping\endcsname}
-
-\def\checkmappingtoks
- {\ifundefined{\@map@\charactermapping}%
- \expandafter\newtoks\csname\@map@\charactermapping\endcsname
- \fi
- \ifundefined{\@cas@\charactermapping}%
- \expandafter\newtoks\csname\@cas@\charactermapping\endcsname
- \fi}
-
-\def\definecasemap #1 #2 #3 % code lower upper
- {\doifelse{#2}{to}
- {\presetcaserange{#1}{#3}}
- {\lccode#1=#2\relax
- \uccode#1=#3\relax}%
- \ignorespaces}
-
-%D Saves a few tokens
-
-\def\definecaseswap #1 #2 % lower upper
- {\lccode#1=#1\relax
- \uccode#2=#2\relax
- \lccode#2=#1\relax
- \uccode#1=#2\relax
- \ignorespaces}
-
-\def\definecaseself #1 % lower=upper=self
- {\lccode#1=#1\relax
- \uccode#1=#1\relax
- \ignorespaces}
-
-%D Watch the \type {\definecasemap 127 to 255} option!
-%D Dedicated to Taco there is also:
-
-\def\definecasemaps #1 to #2 lc #3 uc #4 % from to lc+ uc+
- {\dostepwiserecurse{#1}{#2}\plusone
- {\scratchcounter\recurselevel\advance\scratchcounter#3\lccode\recurselevel=\scratchcounter
- \scratchcounter\recurselevel\advance\scratchcounter#4\uccode\recurselevel=\scratchcounter}%
- \ignorespaces}
-
-%D This can be used like:
-%D
-%D \starttyping
-%D \definecasemaps 128 to 156 lc 32 uc 0
-%D \definecasemaps 160 to 188 lc -32 uc 0
-%D \definecasemaps 160 to 188 lc -32 uc 0
-%D \definecasemaps 192 to 255 lc 32 uc 0
-%D \stoptyping
-%D
-%D and saves a lot of typing (copying).
-
-\def\resetcaserange #1 to #2
- {\dostepwiserecurse{#1}{#2}\plusone
- {\lccode\recurselevel\zerocount
- \uccode\recurselevel\zerocount}%
- \ignorespaces}
-
-\def\presetcaserange#1#2% could be pre-expanded
- {\dostepwiserecurse{#1}{#2}\plusone
- {\lccode\recurselevel=\recurselevel
- \uccode\recurselevel=\recurselevel}%
- \ignorespaces}
-
-\def\setcasemap #1 #2 #3 %
- {\settoletterunlessactive{#1}%
- \lccode #1=#2
- \uccode #1=#3 }
-
-\def\setcaseswap #1 #2 %
- {\settoletterunlessactive{#1}%
- \settoletterunlessactive{#2}%
- \lccode #1=#1
- \uccode #2=#2
- \lccode #2=#1
- \uccode #1=#2 }
-
-\def\setcaseself #1 %
- {\settoletterunlessactive{#1}%
- \lccode #1=#1
- \uccode #1=#1 }
-
-\def\definespacemap #1 #2 % code sfcode
- {\sfcode#1=#2%
- \ignorespaces}
-
-\def\setspacemap #1 #2 %
- {\settootherunlessactive{#1}%
- %\lccode #1=\zerocount
- %\uccode #1=\zerocount
- \sfcode #1=#2 }
-
-\def\defineuppercasecom#1#2%
- {\global\casecomtoks\expandafter{\the\casecomtoks\setuppercasecom#1{#2}}%
- \ignorespaces}
-
-\def\definelowercasecom#1#2%
- {\global\casecomtoks\expandafter{\the\casecomtoks\setlowercasecom#1{#2}}%
- \ignorespaces}
-
-\let\setuppercasecom\gobbletwoarguments
-\let\setlowercasecom\gobbletwoarguments
-
-\def\setcasecom#1#2{\def#1{#2}}
-
-\let\enabledmapping\empty % indirect, needed to handle default too
-
-\def\enablemapping[#1]%
- {\edef\charactermapping{@#1@}%
- \ifx\enabledmapping\charactermapping \else
- \doifdefined{\@map@\charactermapping}
- {%\expandafter\showthe\csname\@map@\charactermapping\endcsname\endcsname
- \the\csname\@map@\charactermapping\endcsname}%
- % == \the\executeifdefined{\@map@\charactermapping}\emptytoks
- \edef\enabledmapping{\charactermapping}%
- \enablelanguagespecifics[\currentlanguage]% new
- % \edef\enabledmapping{\charactermapping\currentlanguage}% can be comma list
- \fi
- \synchronizepatterns}
-
-% on behalf of font switching:
-
-\def\fastenablemapping#1%
- {\edef\charactermapping{@#1@}%
- \ifx\enabledmapping\charactermapping \else
- \@EA\ifx\csname\@map@\charactermapping\endcsname\relax\else
- \the\csname\@map@\charactermapping\endcsname
- \fi
- % == \the\executeifdefined{\@map@\charactermapping}\emptytoks
- \let\enabledmapping\charactermapping
- \enablelanguagespecifics[\currentlanguage]% to faster
- \fi}
-
-%D This macro wil be implemented in \type {lang-ini.tex}.
-
-\ifx\enablelanguagespecifics\undefined
- \def\enablelanguagespecifics[#1]{}
-\fi
-
-%D Further on we have to take some precautions when dealing
-%D with special characters like~\type{~}, \type{_}
-%D and~\type{^}, so let us define ourselve some handy macros
-%D first.
-
-\def\protectfontcharacters
- {\edef\unprotectfontcharacters
- {\catcode`\noexpand ~=\the\catcode`~\relax
- \catcode`\noexpand _=\the\catcode`_\relax
- \catcode`\noexpand ^=\the\catcode`^\relax}%
- \catcode`~=\@@letter
- \catcode`_=\@@letter
- \catcode`^=\@@letter\relax}
-
-%D The completeness of the Computer Modern Roman typefaces
-%D makes clear how incomplete other faces are. To honour 7~bit
-%D \ASCII, these fonts were designed using only the first 127
-%D values of the 256 ones that can be presented by one byte.
-%D Nowadays 8~bit character codings are more common, mainly
-%D because they permit us to predefine some composed
-%D characters, which are needed in most european languages.
-%D
-%D Supporting more than the standard \TEX\ encoding vector
-%D |<|which in itself is far from standard and differs per
-%D font|>| puts a burden on the fonts mechanism. The \CONTEXT\
-%D mechanism is far from complete, but can handle several
-%D schemes at once. The main problem lays in the accented
-%D characters and ligatures like~ff, although handling
-%D ligatures is not the responsibility of this module.
-%D
-%D By default, we use \PLAIN\ \TEX's approach of placing
-%D accents. All other schemes sooner or later give problems
-%D when we distribute \DVI||files are distributed across
-%D machines and platforms. Nevertheless, we have to take care
-%D of different encoding vectors, which tell us where to find
-%D the characters we need. This means that all kind of
-%D character placement macro's like \type{\"} and \type{\ae}
-%D have to be implemented and adapted in a way that suits
-%D these vectors.
-%D
-%D The main difference between different vector is the way
-%D accents are ordered and/or the availability of prebuilt
-%D accented characters. Accented characters can for instance be
-%D called for by sequences like \type{\"e}. Here the \type{\"}
-%D is defined as:
-%D
-%D \starttyping
-%D \def\"#1{{\accent"7F #1}}
-%D \stoptyping
-%D
-%D This macro places the accent \accent"7F {} on top of an~e
-%D gives \"e. Some fonts however can have prebuild accents and
-%D use a more direct approach like
-%D
-%D \starttyping
-%D \def\"#1{\if#1e\char 235\else ... \fi}
-%D \stoptyping
-%D
-%D The latter approach is not used in \CONTEXT, because we
-%D store relevant combinations of accents and characters in
-%D individual macros.
-
-%D We define character substitutes and commands with definition
-%D commands like:
-%D
-%D \starttyping
-%D \startcoding[texnansi]
-%D
-%D \defineaccent " a 228
-%D \defineaccent ^ e 234
-%D \defineaccent ' {\dotlessi} 237
-%D
-%D \definecharacter ae 230
-%D \definecharacter oe 156
-%D
-%D \definecommand b \texnansiencodedb
-%D \definecommand c \texnansiencodedc
-%D
-%D \stopcoding
-%D \stoptyping
-%D
-%D The last argument of \type{\defineaccent} and
-%D \type{\definecharacter} tells \TEX\ the position of the
-%D accented character in the encoding vector. In order to
-%D complish this, we tag each implementation with the character
-%D coding identifier. We therefore need two auxiliary variables
-%D \type{\characterencoding} and \type{\nocharacterencoding}. These
-%D contain the current and default encoding vectors and both
-%D default to the \PLAIN\ one.
-
-\edef\characterencoding {@\s!default @}
-\edef\nocharacterencoding {@\s!default @}
-\edef\charactermapping {@\s!default @}
-
-% todo, else \d j == \dj, print file and check
-
-\def\accentprefix {}%{*}
-\def\commandprefix {}%{=}
-\def\characterprefix{}%{-}
-
-%D \macros
-%D {startcoding, reducetocoding}
-%D
-%D Before we can redefine accents and special characters, we
-%D have to tell \CONTEXT\ what encoding is in force. The next
-%D command is responsible for doing this and also takes care of
-%D the definition of the recoding commands. We use the \type
-%D {\start}||\type {\stop}||commands for definitions and the
-%D \type {\reduceto}||command for local switching to
-%D simplified commands.
-
-% etex : \ifcsname
-
-\def\justhandleaccent#1#2% \empty makes #2={} save % no \unexpanded
- {\ifundefined{\accentprefix\characterencoding#1\string#2\empty}%
- #2%
- \else
- \csname\accentprefix\characterencoding#1\string#2\empty\endcsname
- \fi}
-
-\def\justhandlecommand#1% % no \unexpanded, otherwise pdfdoc will fail
- {\ifundefined{\commandprefix\characterencoding#1}% as well as hyph patterns
- #1%
- \else
- \csname\commandprefix\characterencoding#1\endcsname
- \fi}
-
-\def\enableencoding
- {\dodoubleempty\doenableencoding}
-
-\def\doenableencoding[#1][#2]% main fallback
- {\iffirstargument\edef\characterencoding{@#1@}\fi
- \edef\nocharacterencoding{@\ifsecondargument#2\else\s!default\fi @}%
- \synchronizepatterns}
-
-\edef\xnocharacterencoding{@\s!default @}
-
-\def\fastenableencoding#1%
- {\edef\characterencoding{@#1@}%
- \let\nocharacterencoding\xnocharacterencoding}
-
-\def\startencoding
- {\dodoubleempty\dostartencoding}
-
-\def\dostartencoding[#1][#2]% encoding regime
- {%\showmessage\m!encodings1{#1}%
- \pushmacro\characterencoding
- \pushmacro\currentregime
- \pushmacro\dohandleaccent % still needed?
- \pushmacro\dohandlecommand % still needed?
- \pushmacro\doautosetregime
- \let\dohandleaccent\donthandleaccent % still needed?
- \let\dohandlecommand\donthandlecommand % still needed?
- %let\definesortkey\savesortkey
- \edef\characterencoding{@#1@}%
- \doifelsenothing{#2}%
- {\let\doautosetregime\gobbletwoarguments}
- {\def\currentregime{#2}}}
-
-\def\stopencoding
- {\popmacro\doautosetregime
- \popmacro\dohandlecommand % still needed?
- \popmacro\dohandleaccent % still needed?
- \popmacro\currentregime
- \popmacro\characterencoding}
-
-% probably obsolete (hm, not yet)
-
-\def\reducetocoding[#1]% use grouped!
- {\doifsomething{#1}
- {\let\dohandleaccent \justhandleaccent
- \let\dohandlecommand\justhandlecommand
- \enableencoding[#1]%
- \enablelanguagespecifics[\currentlanguage]}}
-
-\let\startcoding \startencoding
-\def\stopcoding {\stopencoding}
-\let\enablecoding \enableencoding
-
-%D The use of these macros are not limited to font
-%D definition files, but may also be used when loading
-%D patterns.
-
-%D \macros
-%D {definesortkey,flushsortkeys,flushsortkey}
-%D
-%D Yet another definition concerns sorting of indexes and
-%D lists.
-%D
-%D \starttyping
-%D \definesortkey {\'e} {e} {a} {\'e}
-%D \stoptyping
-%D
-%D The first argument denotes the string to be treated. The
-%D second argument is the raw replacement, while the third
-%D argument determines the sort order given the replacement.
-%D The last argument is used as entry in the index (a, b, etc).
-%D
-%D The keys can be flushed using \type {\flushsortkeys}
-%D which in turn results in a sequence of calls to \type
-%D {\flushsortkey}, a macro taking 4~arguments.
-%D
-%D This mechanism is currently being tested and subjected to
-%D changes! Obsolete:
-
-\let\definesortkey\gobblefourarguments
-\let\savesortkey \gobblefourarguments
-\let\flushsortkeys\relax
-\let\flushsortkey \relax
-
-%D \macros
-%D {defineaccent, definecharacter, definecommand}
-%D
-%D The actual definition of accents, special characters and
-%D commands is done with the next three commands.
-
-\def\defineaccent
- {\protectfontcharacters
- \dodefineaccent}
-
-\def\dodefineaccent#1 #2 %
- {\unprotectfontcharacters
- \dododefineaccent#1 #2 }
-
-\def\dododefineaccent#1 #2 #3 %
- {\setvalue{#1}{\dohandleaccent{#1}}%
- \doifnumberelse{\string#3}
- {\setvalue{\accentprefix\characterencoding#1\string#2}{\char#3 }} % space added
- {\setvalue{\accentprefix\characterencoding#1\string#2}{#3}}}
-
-\def\dohandleaccent#1#2%
- {\ifcsname\accentprefix\characterencoding#1\string#2\empty\endcsname
- \csname\accentprefix\characterencoding#1\string#2\empty\endcsname
- \else\ifcsname\accentprefix\nocharacterencoding#1\string#2\empty\endcsname
- \csname\accentprefix\nocharacterencoding#1\string#2\empty\endcsname
- \else\ifcsname\accentprefix\characterencoding#1\endcsname
- \csname\accentprefix\characterencoding#1\endcsname{#2}%
- \else%\ifcsname\accentprefix\nocharacterencoding#1\endcsname
- \csname\accentprefix\nocharacterencoding#1\endcsname{#2}%
-% \else
-% \donormaltextaccent{#1}{#2}%
- \fi\fi\fi}%\fi}
-
-\def\patternchar#1 {\rawcharacter{#1}} % space is part of character definition !
-
-% \ifx \enablepatterntokens\undefined
-% \def\handlepatterntoken#1]{\csname#1\endcsname}
-% \fi
-
-% we need to postpone catcode changes, e.g. hr patterns
-% have \catcode" -> which fails when " is letter
-
-\def\pathypsettings
- {\ifx \enablepatterntokens\undefined
- \defineactivecharacter [ {\handlepatterntoken}%
- \else
- \enablepatterntokens
- \fi
- \let\dochar\thechr
- \lccode16=16 % brrr, extra quote in ec (turkish)
- \lccode17=17 % brrr, extra quote in ec (turkish)
- \lccode`\-=`\-
- \lccode`\'=`\'
- \lccode`\"=`\"
- \relax}
-
-\def\patterns {\pathypsettings\normalpatterns }
-\def\hyphenation{\pathypsettings\normalhyphenation}
-
-%D Because we don't want to use the second command grouped, we
-%D (re)define it as follows:
-
-\def\hyphenation
- {\begingroup\def\hyphenation{\normalhyphenation{\the\scratchtoks}\endgroup}%
- \pathypsettings\afterassignment\hyphenation\scratchtoks=}
-
-%D This is not needed for patterns because they are loaded grouped
-%D anyway and it saves us an assignment. Can go ... no longer
-%D shared patterns.
-
-\def\startpatternloading#1#2#3% % we should use \everypatternloading
- {\startreadingfile
- \bgroup
- % let's get rid of interfering stuff
- \let\everyjob\scratchtoks
- \let\message \gobbleoneargument
- % we want direct characters
- \let\char\patternchar
- \doifelsenothing{#2}{\enableencoding[ec]}{\enableencoding[#2]}%
- \doifelsenothing{#3}{\enablemapping [ec]}{\enablemapping [#3]}%
- \expanded{\doifinstring{\f!languageprefix}{#1}}
- {\ifx \enablepatternxml\undefined \else
- \enablepatternxml
- \fi}%
- \let\dohandleaccent\normaldohandleaccent}
-
-\def\stoppatternloading
- {\egroup
- \stopreadingfile}
-
- \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}
- {\setvalue{\characterprefix\characterencoding\string#1}{\dochar{#2}}%
- \doautosetregime{#1}{#2}}
- {\setvalue{\characterprefix\characterencoding\string#1}{#2}}}
-
-\def\dohandlecharacter#1%
- {\csname\characterprefix\ifcsname\characterprefix\characterencoding#1\endcsname
- \characterencoding\else\nocharacterencoding\fi#1\endcsname}
-
-% \def\fallbackpatternchar{x} % makes no sense, duplicate patterns
-
-\def\defaultcharacter#1%
- {\csname\characterprefix\nocharacterencoding\strippedcsname#1\endcsname}
-
-%D Instead of numbers, a command may be entered.
-
-\def\definecommand#1 #2 %
- {\setvalue{\string#1}{\dohandlecommand{#1}}%
- %\redefinecommand #1 % just to be sure
- \setvalue{\commandprefix\characterencoding\string#1}{#2}}
-
-%D Here we see that redefining accents is characters is more
-%D or less the same as redefining commands. We also could have
-%D said:
-%D
-%D \starttyping
-%D \def\defineaccent#1 #2 {\definecommand#1\string#2 \char}
-%D \def\definecharacter#1 {\definecommand#1 \char}
-%D \stoptyping
-
-%D \macros
-%D {defineaccentcommand}
-%D
-%D When needed, one can overload the default positions of the
-%D accents. The \PLAIN\ \TEX\ defaults are:
-%D
-%D \starttyping
-%D \defineaccentcommand ` 18
-%D \defineaccentcommand ' 19
-%D \defineaccentcommand v 20
-%D \defineaccentcommand u 21
-%D \defineaccentcommand = 22
-%D \defineaccentcommand ^ 94
-%D \defineaccentcommand . 95
-%D \defineaccentcommand H 125 % "7D
-%D \defineaccentcommand ~ 126 % "7E
-%D \defineaccentcommand " 127 % "7F
-%D \stoptyping
-
-\def\defineaccentcommand
- {\protectfontcharacters
- \dodefineaccentcommand}
-
-\def\dodefineaccentcommand#1 #2 % \string toegevoegd
- {\doifnumberelse{\string#2}
- {\setvalue{\accentprefix\characterencoding\string#1}##1{{\accent#2 ##1}}}
- {\setvalue{\accentprefix\characterencoding\string#1}##1{{#2##1}}}%
- \unprotectfontcharacters}
-
-%D We don't have to define them for the default \PLAIN\ case.
-%D Commands may be used instead of character codes.
-
-%D \macros
-%D {redefinecommand}
-%D
-%D Redefinition of encoding dependant commands like \type{\b}
-%D and \type{\c} can be triggered by:
-%D
-%D \starttyping
-%D \redefinecommand b % something math
-%D \redefinecommand c % something math
-%D \stoptyping
-%D
-%D Handling of characters is easier than handling accents
-%D because here we don't have to take care of arguments. We
-%D just call for the right glyph in the right place.
-%D
-%D The \type{\next} construction permits handling of commands
-%D that take arguments. This means that we can use this
-%D command to redefine accent handling commands too
-%D (although today the next is not needed any longer in test
-%D macros).
-
-\def\redefinecommand#1 %
- {% no \unexpanded, else pdfdoc fails
- \setvalue{\string#1}{\dohandlecommand{#1}}}%
-
-\def\dohandlecommand#1%
- {\csname\commandprefix
- \ifcsname\commandprefix\characterencoding#1\endcsname
- \characterencoding
- \else
- \nocharacterencoding
- \fi
- #1\endcsname}
-
-%D \macros
-%D {currentencoding, currentmapping}
-%D
-%D When we show 'm, we don't want to see the protection
-%D measures.
-
-\def\currentencoding{\@EA\dopureencodingname\characterencoding}
-\def\currentmapping {\@EA\dopureencodingname\charactermapping }
-
-\def\dopureencodingname @#1@{#1}
-
-\def\pureencodingname#1{\@EA\dopureencodingname#1}
-
-%D \macros
-%D {showaccents, showcharacters,
-%D showcharacterbounds, showhyphenations}
-%D
-%D Encoding is a tricky business. Therefore we provide a
-%D a few macros that show most of the characters involved. The
-%D next two tables show the result of \type {\showaccents}.
-%D
-%D \placetable
-%D {The special glyphs in default encoding.}
-%D {\showaccents}
-%D
-%D \placetable
-%D {The special glyphs in texnansi encoding.}
-%D {\switchtobodyfont[lbr]\showaccents}
-%D
-%D The command
-%D
-%D \starttyping
-%D \showhyphenations{doordefini\"eren}
-%D \stoptyping
-%D
-%D can be used to check the correct loading of hyphenation
-%D patterns.
-
-\fetchruntimecommand \showaccents {\f!encodingprefix\s!run}
-\fetchruntimecommand \showcharacters {\f!encodingprefix\s!run}
-\fetchruntimecommand \showcharacterbounds {\f!encodingprefix\s!run}
-\fetchruntimecommand \showhyphenations {\f!encodingprefix\s!run}
-\fetchruntimecommand \showmapping {\f!encodingprefix\s!run}
-
-%D \macros
-%D {everyuppercase, EveryUppercase,
-%D everyuppercase, EveryUppercase}
-%D
-%D When we want to uppercase strings of characters, we have to
-%D take care of those characters that have a special meaning or
-%D are only accessible by means of macros. The next hack was
-%D introduced when Tobias Burnus started translating head and
-%D label texts into spanish and italian. The first application
-%D of this token register therefore can be found in the module
-%D that deals with these texts.
-
-\newevery \everyuppercase \EveryUppercase
-\newevery \everylowercase \EveryLowercase
-
-%D This magic trick maps takes care of mapping from lower to
-%D upper case and reverse.
-
-\def\reloadmapping{\the\executeifdefined{\@cas@\charactermapping}\emptytoks}
-
-\appendtoks\let\setuppercasecom\setcasecom\to\everyuppercase
-\appendtoks\let\setlowercasecom\setcasecom\to\everylowercase
-
-\appendtoks\reloadmapping\to\everyuppercase % slow, will be sped up
-\appendtoks\reloadmapping\to\everylowercase % slow, will be sped up
-
-\newtoks\everyULmap
-
-\appendtoks\let\remapcase\remapuppercase\the\everyULmap\to\everyuppercase
-\appendtoks\let\remapcase\remaplowercase\the\everyULmap\to\everylowercase
-
-\let\remapcase\gobbletwoarguments
-
-\def\remapuppercase#1#2{\let#2#1} % more efficient:
-\def\remaplowercase#1#2{\let#1#2} \let\remaplowercase\let
-
-\def\defineLCcharacter #1 #2 %
- {\appendtoks\let\to\everylowercase
- \@EA\appendtoks\csname#1\endcsname\to\everylowercase
- \@EA\appendtoks\csname#2\endcsname\to\everylowercase}
-
-\def\defineUCcharacter #1 #2 %
- {\appendtoks\let\to\everyuppercase
- \@EA\appendtoks\csname#1\endcsname\to\everyuppercase
- \@EA\appendtoks\csname#2\endcsname\to\everyuppercase}
-
-\def\defineULcharacter #1 #2 %
- {\appendtoks\remapcase\to\everyULmap
- \@EA\appendtoks\csname#1\endcsname\to\everyULmap
- \@EA\appendtoks\csname#2\endcsname\to\everyULmap}
-
-% slightly faster with \smallcapped's but far more hash and stringspace
-%
-% \newif\ifuppercase \appendtoks\uppercasetrue\to\everyuppercase
-% \newif\iflowercase \appendtoks\lowercasetrue\to\everylowercase
-%
-% \def\defineULcharacter #1 #2 %
-% {\def\!!stringa{@#1}\@EA\letvalue\@EA\!!stringa\csname#1\endcsname
-% \def\!!stringa{@#2}\@EA\letvalue\@EA\!!stringa\csname#2\endcsname
-% \setvalue{#1}{\getvalue{@\ifuppercase#2\else#1\fi}}%
-% \setvalue{#2}{\getvalue{@\iflowercase#1\else#2\fi}}}
-
-% 2 = tricky, since expanding \definedfont[lowcasename] ... goes wrong
-
-\chardef\uppercasemode\plusthree % 0=ignore 1=normal 2=expand 3=auto
-\chardef\casecommode \plusone % 0=noexpand 1=expand
-
-\def\setcasecom #1#2{\def#1{\ifcase\casecommode\noexpand#1\else#2\fi}}
-
-% \def\OEPS{whatever}
-%
-% \startmapping[ec]
-% \defineuppercasecom \oeps {\getvalue{OEPS}}
-% \stopmapping
-%
-% \WORD{xx \oeps}
-
-\def\douppercase#1%
- {\bgroup
- \let\douppercase\firstofoneargument
- \the\everyuppercase % currently also checks uppercasemode
- \let\dochar\rawcharacter
- \ifcase\uppercasemode
- #1%
- \or % No expansion here, otherwise \getvalue problems! Default!!!
- %\edef\next{#1}% keep this to prevent roll back
- %\uppercase\expandafter{\next}% keep this to prevent roll back
- \uppercase{#1}%
- \or
- \chardef\casecommode\zerocount
- \let\docasecom\firstoftwoarguments
- \edef\ascii{#1}%
- \edef\ascii{\expandafter\uppercase\expandafter{\ascii}}% needed when in regime
- \chardef\casecommode\plusone
- \ascii
- \else
- % mode three may trigger setting 2 elsewhere (e.g. regime test)
- \uppercase{#1}%
- \fi
- \egroup}
-
-\prependtoksonce
- \doifnot\currentregime\s!default
- {\ifnum\uppercasemode=\plusthree \chardef\uppercasemode\plustwo \fi}%
-\to \everyuppercase
-
-%D \macros
-%D {everysanitize, EverySanitize}
-%D
-%D Whenever we are sanitizing strings, like we sometimes do
-%D when we deal with specials, the next token register can be
-%D called.
-
-\newevery \everysanitize \EverySanitize
-
-%D \macros
-%D {defineuclass,defineudigit,udigit}
-%D
-%D The next few macros are experimental and needed for unicoded
-%D chinese characters.
-
-\def\defineuclass #1 #2 #3 %
- {\setvalue{uc\the\numexpr#2*256+#3\relax}{#1}}
-
-\def\defineudigit #1 #2 #3 {\setvalue{\characterencoding uc#1}{\uchar{#2}{#3}}}
-
-%D It may look strange, but for the moment, we want the encoding
-%D to be part of the digit specification. This may change!
-
-\unexpanded\def\udigit#1#2{\getvalue{@#1@uc\number#2}}
-
-%D \macros
-%D {uchar, octuchar, hexuchar}
-
-\ifx\uchar\undefined \def\uchar#1#2{(\number#1,\number#2)} \fi
-
-\def\octuchar#1#2{\uchar{`#1}{`#2}}
-\def\hexuchar#1#2{\uchar{"#1}{"#2}}
-
-%D Basics and fallbacks.
-
-\newif\ifignoreaccent
-
-\let\textaccent \accent
-\let\normaltextaccent\textaccent
-
-% ** we will explicitly embrace the two arguments, since in definitions
-% this may not be the case, and we don't want faulty expansions like
-% "\dobuildtextaccent \char 18 a" but "\dobuildtextaccent {\char 18}{a}"
-% instead
-
-\def\buildmathaccent#1%
- {\mathaccent#1 }
-
-\def\buildtextaccent#1#2% **
- {\ifignoreaccent
- \expandafter\nobuildtextaccent
- \else
- \expandafter\dobuildtextaccent
- \fi{#1}{#2}}
-
-\unexpanded\def\nobuildtextaccent#1#2%
- {#2}
-
-\unexpanded\def\dobuildtextaccent#1#2%
- {{\let\char\normalaccent#1\let\char\normalchar#2}}
-
-% some fake ones, name will change into build
-
-\unexpanded\def\bottomaccent#1#2#3#4#5% down right slantcorrection accent char
- {\dontleavehmode % why this align mess
- \vtop
- {\forgetall
- \baselineskip\zeropoint
- \lineskip#1%
- \everycr\emptytoks
- \tabskip\zeropoint
- \lineskiplimit\zeropoint
- \setbox0\hbox{#4}%
- \halign
- {##\crcr\hbox{#5}\crcr
- \hidewidth
- \hskip#2\wd0
- \hskip-#3\slantperpoint % in plain 1ex * dimenless value
- \vbox to .2ex{\box0\vss}\hidewidth
- \crcr}}}
-
-\def\buildtextmacron {\bottomaccent{.25ex}{0}{15}{\textmacron}}
-\def\buildtextbottomdot{\bottomaccent{.25ex}{0}{5}{\textbottomdot}}
-\def\buildtextcedilla {\bottomaccent{0ex}{0}{5}{\textcedilla}}
-\def\buildtextogonek {\bottomaccent{-.1ex}{.5}{0}{\textogonek}}
-
-%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
- {\dontleavehmode
- \bgroup
- \setbox0\hbox{#4}%
- \setbox2\hbox{#5}%
- \hbox to \wd2 \bgroup
- \hss\copy2\hss
- \hskip-\wd2
- \hss\hskip#2\wd0\hskip-#3\slantperpoint\raise#1\hbox{#4}\hss
- \egroup
- \egroup}
-
-\def\buildtextgrave{\topaccent{0pt}{0}{15}{\textgrave}} % e.g.
-
-% \definecharacter schwa {\hbox{\rotate[rotation=180,location=high]{\hbox{e}}}}
-% \definecharacter schwagrave {\buildtextgrave\schwa}
-
-% math stuff, will change
-
-\def\definemathaccent#1 #2%
- {\setvalue{\string#1}{#2}%
- \setvalue{normalmathaccent\string#1}{#2}}
-
-\def\donormalmathaccent#1%
- {\getvalue{normalmathaccent\string#1}}
-
-%D Some precautions:
-
-\ifx\usepdffontresource\undefined
- \def\usepdffontresource #1 {} % this will be defined elsewhere
-\fi
-
-\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\keepencodedtokens
- {\let\dohandleaccent \keephandleaccent
- \let\dohandlecommand \keephandlecommand
- \let\dohandlecharacter\keephandlecharacter}
-
-\def\literateencodedtokens
- {% \let\dohandleaccent \keephandleaccent
- % \let\dohandlecommand \keephandlecommand
- \let\dohandlecharacter\keephandlecharacter}
-
-\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}
-\unexpanded\def\uhandlecharacter#1{\csname#1\endcsname}
-
-\def\dontexpandencodedtokens
- {\def\dohandleaccent {\uhandleaccent}%
- \def\dohandlecommand {\uhandlecommand}%
- \def\dohandlecharacter{\uhandlecharacter}}
-
-% no longer: \def\convertencodedtokens{\dontexpandencoding} but:
-
-\def\convertencodedtokens{\stringifyencodedtokens}
-
-% test case:
-%
-% \enableregime[cp1250]
-% \mainlanguage[cz]
-%
-% \starttext
-%
-% \title{ϬuÞ¯u餭 kon졺pî½
-% \placelist[chapter][criterium=all]
-%
-% \startbuffer
-% <chapter>
-% <title>Ϭuޯu餭 kon졺p󛱴itle>
-% </chapter>
-% \stopbuffer
-%
-% \defineXMLenvironment
-% [chapter]
-% {\defineXMLsave[title]}
-% {\expanded{\chapter{\XMLflush{title}}}}
-% \processXMLbuffer
-%
-% \setuphead[chapter][expansion=yes]
-% \defineXMLenvironment
-% [chapter]
-% {\defineXMLsave[title]}
-% {\chapter{\XMLflush{title}}}
-% \processXMLbuffer
-%
-% \stoptext
-
-%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}
-
-\appendtoks
- \ignoreencoding
-\to \everycleanupfeatures
-
-\appendtoks
- \keepencodedtokens
-\to \everysafeexpanded
-
-%D Now we will not redefine any more, so:
-
-\let\normaldohandleaccent \dohandleaccent
-\let\normaldohandlecharacter\dohandlecharacter
-
-\definecommand ` {\buildtextaccent\textgrave}
-\definecommand ' {\buildtextaccent\textacute}
-\definecommand r {\buildtextaccent\textring}
-\definecommand v {\buildtextaccent\textcaron}
-\definecommand u {\buildtextaccent\textbreve}
-\definecommand = {\buildtextaccent\textmacron}
-\definecommand ^ {\buildtextaccent\textcircumflex}
-\definecommand . {\buildtextaccent\textdotaccent}
-\definecommand H {\buildtextaccent\texthungarumlaut}
-\definecommand ~ {\buildtextaccent\texttilde}
-\definecommand " {\buildtextaccent\textdiaeresis}
-
-\definecommand c {\buildtextcedilla}
-\definecommand b {\buildtextmacron}
-\definecommand d {\buildtextbottomdot}
-\definecommand k {\buildtextogonek}
-
-\definemathaccent acute {\buildmathaccent\mathacute}
-\definemathaccent grave {\buildmathaccent\mathgrave}
-\definemathaccent ddot {\buildmathaccent\mathddot}
-\definemathaccent tilde {\buildmathaccent\mathtilde}
-\definemathaccent bar {\buildmathaccent\mathbar}
-\definemathaccent breve {\buildmathaccent\mathbreve}
-\definemathaccent check {\buildmathaccent\mathcheck}
-\definemathaccent hat {\buildmathaccent\mathhat}
-\definemathaccent vec {\buildmathaccent\mathvec}
-\definemathaccent dot {\buildmathaccent\mathdot}
-\definemathaccent widetilde {\buildmathaccent\mathwidetilde}
-\definemathaccent widehat {\buildmathaccent\mathwidehat}
-
-\useencoding[def] % defaults (partly simplified)
-\useencoding[acc] % accent commands
-\useencoding[raw] % simplified (incomplete)
-\useencoding[com] % a few commands
-\useencoding[cas] % case mapping, not needed in mkiv
-\useencoding[mis] % a few commands
-
-%D We preload several encodings:
-
-\ifnum\texengine=\xetexengine
- \setupencoding[\s!default=\s!default]
-\else
- \useencoding[ans,il2,ec,tbo,pdf,pol,qx,t5,l7x,cyr,agr] % pol and il2 will go away, not needed in mkiv, uc removed
- \useencoding[032,033,037] % fallbacks for some unicode chars
- \setupencoding[\s!default=ec] % was: [\s!default=\s!default]
-\fi
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-l7x.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-l7x.mkii
deleted file mode 100644
index 2a0d12c9f57..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-l7x.mkii
+++ /dev/null
@@ -1,236 +0,0 @@
-%D \module
-%D [ file=enco-l7x,
-%D version=2010.01.22,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=\LATEX\ L7x Encoding,
-%D author={Hans Hagen \& Mojca Miklavec},
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Encoding vector to support Latvian and Lithuanian. The first
-%D part is taken from EC encoding, the rest has not been tested
-%D extensively.
-
-\startmapping[l7x]
-
-\definecaseswap 25 `I % dotless i (TODO - probably wrong; maybe use \defineuppercasecom)
-\definecaseswap 156 140 % oeligature
-\definecaseswap 184 168 % ostroke
-\definecaseswap 186 170 % rcommaaccent
-\definecaseswap 191 175 % aeligature
-\definecaseself 223 % ssharp (this is wrong, but no better way)
-
-\definecasemaps 192 to 222 lc +32 uc 0
-\definecasemaps 224 to 254 lc 0 uc -32
-\resetcaserange 215 to 215 % textmultiply
-\resetcaserange 247 to 247 % textdiv
-
-\stopmapping
-
-\startencoding[l7x]
-
-\definecharacter textgrave 0
-\definecharacter textacute 1
-\definecharacter textcircumflex 2
-\definecharacter texttilde 3
-\definecharacter textdiaeresis 4
-\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 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 compoundwordmark 23
-%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
-% numbersign # 35
-% dollar $ 36
-\definecharacter percent 37
-% ampersand & 38
-%definecharacter quotesingle 39 % fake 'm TODO:enco-def!!!!
-\definecharacter quoteright 39
-% 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
-% .notdef 127
-\definecharacter texteuro 128
-% .notdef 129
-\definecharacter quotesinglebase 130
-\definecharacter textflorin 131 \definecharacter fhook 131
-\definecharacter quotedblbase 132
-\definecharacter textellipsis 133
-\definecharacter textdag 134
-\definecharacter textddag 135
-% .notdef 136
-\definecharacter perthousand 137
-% .notdef 138
-\definecharacter guilsingleleft 139
-\definecharacter OEligature 140 % TODO: also \OE???
-\definecharacter textdiaeresis 141
-\definecharacter textcaron 142
-\definecharacter textcedilla 143
-% .notdef 144
-\definecharacter quoteleft 145
-\definecharacter quoteright 146
-\definecharacter quotedblleft 147
-\definecharacter quotedblright 148
-\definecharacter textbullet 149
-\definecharacter endash 150
-\definecharacter emdash 151
-% .notdef 152
-\definecharacter trademark 153
-% .notdef 154
-\definecharacter guilsingleright 155
-\definecharacter oeligature 156
-\definecharacter textmacron 157
-\definecharacter textogonek 158
-% .notdef 159
-%definecharacter space 160 % TODO!!!
-\definecharacter quotedblright 161
-\definecharacter textcent 162
-\definecharacter textsterling 163
-\definecharacter textcurrency 164
-\definecharacter quotedblbase 165
-\definecharacter textbrokenbar 166
-\definecharacter sectionmark 167
-\definecharacter Ostroke 168
-\definecharacter copyright 169
-\definecharacter Rcommaaccent 170
-\definecharacter leftguillemot 171
-\definecharacter textlognot 172
-%definecharacter softhyphen 173 % -> 45 (TODO!!!)
-\definecharacter registered 174
-\definecharacter AEligature 175
-\definecharacter textdegree 176
-\definecharacter textpm 177
-\definecharacter twosuperior 178
-\definecharacter threesuperior 179
-\definecharacter quotedblleft 180
-\definecharacter textmu 181
-\definecharacter paragraphmark 182
-\definecharacter periodcentered 183
-\definecharacter ostroke 184
-\definecharacter onesuperior 185
-\definecharacter rcommaaccent 186
-\definecharacter rightguillemot 187
-\definecharacter onequarter 188
-\definecharacter onehalf 189
-\definecharacter threequarter 190
-\definecharacter aeligature 191
-\definecharacter Aogonek 192
-\definecharacter Iogonek 193
-\definecharacter Amacron 194
-\definecharacter Cacute 195
-\definecharacter Adiaeresis 196
-\definecharacter Aring 197
-\definecharacter Eogonek 198
-\definecharacter Emacron 199
-\definecharacter Ccaron 200
-\definecharacter Eacute 201
-\definecharacter Zacute 202
-\definecharacter Edotaccent 203
-\definecharacter Gcommaaccent 204
-\definecharacter Kcommaaccent 205
-\definecharacter Imacron 206
-\definecharacter Lcommaaccent 207
-\definecharacter Scaron 208
-\definecharacter Nacute 209
-\definecharacter Ncommaaccent 210
-\definecharacter Oacute 211
-\definecharacter Omacron 212
-\definecharacter Otilde 213
-\definecharacter Odiaeresis 214
-\definecharacter textmultiply 215
-\definecharacter Uogonek 216
-\definecharacter Lstroke 217
-\definecharacter Sacute 218
-\definecharacter Umacron 219
-\definecharacter Udiaeresis 220
-\definecharacter Zdotaccent 221
-\definecharacter Zcaron 222
-\definecharacter ssharp 223
-\definecharacter aogonek 224
-\definecharacter iogonek 225
-\definecharacter amacron 226
-\definecharacter cacute 227
-\definecharacter adiaeresis 228
-\definecharacter aring 229
-\definecharacter eogonek 230
-\definecharacter emacron 231
-\definecharacter ccaron 232
-\definecharacter eacute 233
-\definecharacter zacute 234
-\definecharacter edotaccent 235
-\definecharacter gcommaaccent 236
-\definecharacter kcommaaccent 237
-\definecharacter imacron 238
-\definecharacter lcommaaccent 239
-\definecharacter scaron 240
-\definecharacter nacute 241
-\definecharacter ncommaaccent 242
-\definecharacter oacute 243
-\definecharacter omacron 244
-\definecharacter otilde 245
-\definecharacter odiaeresis 246
-\definecharacter textdiv 247
-\definecharacter uogonek 248
-\definecharacter lstroke 249
-\definecharacter sacute 250
-\definecharacter umacron 251
-\definecharacter udiaeresis 252
-\definecharacter zdotaccent 253
-\definecharacter zcaron 254
-\definecharacter quoteright 255
-
-\stopencoding
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-lat.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-lat.mkii
deleted file mode 100644
index 2623aae8d7d..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-lat.mkii
+++ /dev/null
@@ -1,7 +0,0 @@
-% temporary module, needed for downward compatibility
-
-\input regi-lat.tex
-
-\enableregime[latin2]
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-mis.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-mis.mkii
deleted file mode 100644
index 28523685e4e..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-mis.mkii
+++ /dev/null
@@ -1,188 +0,0 @@
-%D \module
-%D [ file=enco-mis,
-%D version=2000.05.07, % 1999.11.11,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=Missing Glyphs,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-%D In this file we collect some definitions that construct
-%D pseudo characters. Some day we will move some definitions
-%D from \type {plain.tex} to this file. Some definitions are
-%D derived from definitions in the \LATEX\ distribution,
-%D especially Johannes Braams' Babel system.
-
-\startmapping[\s!default]
-
-\defineuppercasecom \dj \DJ
-\defineuppercasecom \Dj \dj
-\defineuppercasecom \DJ \dj
-
-\definecharacter dstroke {\pseudoencodeddj}
-\definecharacter Dstroke {\pseudoencodedDJ}
-
-\stopmapping
-
-%D We need proper names like in enco-com.tex!
-
-\definecharacter dj {\dstroke} % {\pseudoencodeddj}
-\definecharacter Dj {\Dstroke} % {\pseudoencodedDJ}
-\definecharacter DJ {\Dstroke} % {\pseudoencodedDJ}
-
-\unprotect
-
-\def\pseudoencodeddj % like in babel, but safer
- {\dontleavehmode\hbox\bgroup
- \setbox\scratchbox\hbox{d}%
- \scratchdimen\ht\scratchbox
- \advance\scratchdimen 1ex
- \scratchdimen.45\scratchdimen
- \dimen2=\withoutpt\the\slantperpoint\dimen0
- \advance\dimen2 .5ex
- \hbox to \wd\scratchbox
- {\box\scratchbox\hss
- \raise\scratchdimen\hbox{\kern\dimen2\vbox{\hrule\!!height0.1ex\!!width0.3em}}}%
- \egroup}
-
-\def\pseudoencodedDJ % design: taco; quality assurance: mojca; cleanup: hans
- {\dontleavehmode
- \hbox\bgroup
- \setbox\scratchbox\hbox{D}%
- \dimen2=1.1ex
- \dimen2=\withoutpt\the\slantperpoint\dimen2
- \hbox to \wd\scratchbox
- {\rlap
- {\raise.52\ht\scratchbox
- \hbox
- {\kern\dimen2
- \vbox{\hrule\!!height.04ex\!!depth.04ex\!!width.4\wd\scratchbox}}}%
- \box\scratchbox}%
- \egroup}
-
-% currency
-
-\def\fakedollar % pretty cmr dependent
- {\bgroup
- \ifnum\fam=\itfam
- \sl
- \else\ifnum\fam=\bifam
- \bs
- \fi\fi
- \$%
- \egroup}
-
-\def\fakesterling % pretty cmr dependent
- {\bgroup
- \ifnum\fam=\bffam
- \bi
- \else\ifnum\fam=\bifam
- \bi
- \else\ifnum\fam=\bsfam
- \bi
- \else
- \it
- \fi\fi\fi
- \$%
- \egroup}
-
-\def\fakeflorin
- {\bgroup
- \ifnum\fam=\bffam
- \bi
- \else\ifnum\fam=\bifam
- \bi
- \else\ifnum\fam=\bsfam
- \bi
- \else
- \it
- \fi\fi\fi
- f%
- \egroup}
-
-% perthings
-
-\def\fakepercent
- {\mathematics{^{\scriptscriptstyle0}\kern-.25em/\kern-.2em_{\scriptscriptstyle0}}}
-
-\def\fakeperthousand
- {\mathematics{^{\scriptscriptstyle0}\kern-.25em/\kern-.2em_{\scriptscriptstyle00}}}
-
-\def\fakepermine
- {\dontleavehmode
- \bgroup
- \setbox\scratchbox\hbox
- {\mathematics{+}}%
- \hbox to \wd\scratchbox
- {\hss
- \mathematics{^{\scriptscriptstyle-}\kern-.4em/\kern-.3em_{\scriptscriptstyle-}}%
- \hss}%
- \egroup}
-
-% guillemots
-
-%D Yes I know, they are ugly:
-
-\def\fakeleftguillemot
- {\dontleavehmode\hbox{\raise.25ex\hbox{$\scriptscriptstyle\ll$}}}
-
-\def\fakerightguillemot
- {\hbox{\raise.25ex\hbox{$\scriptscriptstyle\gg$}}}
-
-\def\fakeleftsubguillemot
- {\dontleavehmode\hbox{\raise.25ex\hbox{$\scriptscriptstyle<$}}}
-
-\def\fakerightsubguillemot
- {\hbox{\raise.25ex\hbox{$\scriptscriptstyle>$}}}
-
-%D Needed:
-
-\def\fakevisiblespace
- {\leavevmode\hbox
- {\setbox\scratchbox\hbox{(}%
- \scratchdimen.1\dp\scratchbox
- \setbox\scratchbox\hbox{\space}%
- \hbox to \wd\scratchbox
- {\vrule
- \!!depth 5\scratchdimen
- \!!width \scratchdimen
- \!!height \zeropoint
- \hss
- \vrule
- \!!depth 5\scratchdimen
- \!!width \wd\scratchbox
- \!!height-4\scratchdimen
- \hss
- \vrule
- \!!depth 5\scratchdimen
- \!!width \scratchdimen
- \!!height \zeropoint}}}
-
-%\def\fakeunderscore{\leavevmode\kern.06em\vbox{\hrule\!!width.3em}}
-
-\def\fakeunderscore
- {\leavevmode\hbox
- {\setbox\scratchbox\hbox{(}%
- \scratchdimen.2\dp\scratchbox
- \setbox\scratchbox\hbox{\space}%
- \vrule
- \!!depth \scratchdimen
- \!!width \wd\scratchbox
- \!!height\zeropoint}}
-
-\ifx\mathunderscore\undefined \let\mathunderscore\fakeunderscore \fi
-\ifx\textunderscore\undefined \let\textunderscore\fakeunderscore \fi
-
-\unexpanded\def\normalunderscore{\ifmmode\mathunderscore\else\textunderscore\fi}
-
-\let\_\normalunderscore
-
-% Handy but obsolete, replaced by \unknownchar:
-%
-% \def\missingglyph{\ruledhbox{?}}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-pdf.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-pdf.mkii
deleted file mode 100644
index 28e96067361..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-pdf.mkii
+++ /dev/null
@@ -1,278 +0,0 @@
-%D \module
-%D [ file=enco-pdf,
-%D version=1995.01.01,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=\YandY\ texnansi Encoding,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 the \PDF\ document encoding.
-
-\startencoding[pdfdoc] % \rawcharacter{number}
-
-\definecharacter oeligature ^^9c
-
-\definecharacter leftguillemot ^^ab
-\definecharacter rightguillemot ^^bb
-
-\definecharacter Agrave ^^c0
-\definecharacter Aacute ^^c1
-\definecharacter Acircumflex ^^c2
-\definecharacter Atilde ^^c3
-\definecharacter Adiaeresis ^^c4
-\definecharacter OAligature ^^c5
-\definecharacter AEligature ^^c6
-\definecharacter Ccedilla ^^c7
-\definecharacter Egrave ^^c8
-\definecharacter Eacute ^^c9
-\definecharacter Ecircumflex ^^ca
-\definecharacter Ediaeresis ^^cb
-\definecharacter Igrave ^^cc
-\definecharacter Iacute ^^cd
-\definecharacter Icircumflex ^^ce
-\definecharacter Idiaeresis ^^cf
-
-\definecharacter Ntilde ^^d1
-\definecharacter Ograve ^^d2
-\definecharacter Oacute ^^d3
-\definecharacter Ocircumflex ^^d4
-\definecharacter Otilde ^^d5
-\definecharacter Odiaeresis ^^d6
-
-\definecharacter Ugrave ^^d9
-\definecharacter Uacute ^^da
-\definecharacter Ucircumflex ^^db
-\definecharacter Udiaeresis ^^dc
-\definecharacter Yacute ^^dd
-
-\definecharacter ssharp ^^df
-\definecharacter agrave ^^e0
-\definecharacter aacute ^^e1
-\definecharacter acircumflex ^^e2
-\definecharacter atilde ^^e3
-\definecharacter adiaeresis ^^e4
-\definecharacter oaligature ^^e5
-\definecharacter aeligature ^^e6
-\definecharacter ccedilla ^^e7
-\definecharacter egrave ^^e8
-\definecharacter eacute ^^e9
-\definecharacter ecircumflex ^^ea
-\definecharacter ediaeresis ^^eb
-\definecharacter igrave ^^ec
-\definecharacter iacute ^^ed
-\definecharacter icircumflex ^^ee
-\definecharacter idiaeresis ^^ef
-
-\definecharacter ntilde ^^f1
-\definecharacter ograve ^^f2
-\definecharacter oacute ^^f3
-\definecharacter ocircumflex ^^f4
-\definecharacter otilde ^^f5
-\definecharacter odiaeresis ^^f6
-
-\definecharacter ugrave ^^f9
-\definecharacter uacute ^^fa
-\definecharacter ucircumflex ^^fb
-\definecharacter udiaeresis ^^fc
-\definecharacter yacute ^^fd
-
-\definecharacter ydiaeresis ^^ff
-
-\definecharacter leftsubguillemot {\leftguillemot}
-\definecharacter rightsubguillemot {\rightguillemot}
-
-\definecharacter Uhungarumlaut {\Ucircumflex}
-\definecharacter uhungarumlaut {\ucircumflex}
-\definecharacter Ohungarumlaut {\Ocircumflex}
-\definecharacter ohungarumlaut {\ocircumflex}
-
-\definecharacter Aogonek {A}
-\definecharacter aogonek {a}
-\definecharacter Eogonek {E}
-\definecharacter eogonek {e}
-\definecharacter Iogonek {I}
-\definecharacter iogonek {i}
-\definecharacter Uogonek {U}
-\definecharacter uogonek {u}
-
-\definecharacter Aring {A}
-\definecharacter aring {a}
-\definecharacter Uring {U}
-\definecharacter uring {u}
-
-\definecharacter Abreve {A}
-\definecharacter abreve {a}
-\definecharacter Ebreve {E}
-\definecharacter ebreve {e}
-\definecharacter Gbreve {G}
-\definecharacter gbreve {g}
-\definecharacter Ibreve {I}
-\definecharacter ibreve {i}
-\definecharacter Obreve {O}
-\definecharacter obreve {o}
-\definecharacter Ubreve {U}
-\definecharacter ubreve {u}
-
-\definecharacter Ccaron {C}
-\definecharacter ccaron {c}
-\definecharacter Dcaron {D}
-\definecharacter dcaron {d}
-\definecharacter Ecaron {E}
-\definecharacter ecaron {e}
-\definecharacter Lcaron {L}
-\definecharacter lcaron {l}
-\definecharacter Ncaron {N}
-\definecharacter ncaron {n}
-\definecharacter Rcaron {R}
-\definecharacter rcaron {r}
-\definecharacter Scaron {S}
-\definecharacter scaron {s}
-\definecharacter Tcaron {T}
-\definecharacter tcaron {t}
-\definecharacter Ycaron {Y}
-\definecharacter ycaron {y}
-\definecharacter Zcaron {Z}
-\definecharacter zcaron {z}
-
-\definecharacter Lstroke {L}
-\definecharacter lstroke {l}
-\definecharacter Ostroke {O}
-\definecharacter ostroke {o}
-
-\definecharacter aumlaut {\adiaeresis}
-\definecharacter eumlaut {\ediaeresis}
-\definecharacter iumlaut {\idiaeresis}
-\definecharacter oumlaut {\odiaeresis}
-\definecharacter uumlaut {\udiaeresis}
-
-\definecharacter Aumlaut {\Adiaeresis}
-\definecharacter Eumlaut {\Ediaeresis}
-\definecharacter Iumlaut {\Idiaeresis}
-\definecharacter Oumlaut {\Odiaeresis}
-\definecharacter Uumlaut {\Udiaeresis}
-
-\definecharacter scommaaccent {s}
-\definecharacter Scommaaccent {S}
-\definecharacter tcommaaccent {t}
-\definecharacter Tcommaaccent {T}
-
-\definecharacter Etilde {E}
-\definecharacter etilde {e}
-
-\definecharacter Ahook {A}
-\definecharacter ahook {a}
-\definecharacter Ehook {E}
-\definecharacter ehook {e}
-\definecharacter Ihook {I}
-\definecharacter ihook {i}
-\definecharacter Ohook {O}
-\definecharacter ohook {o}
-\definecharacter Uhook {U}
-\definecharacter uhook {u}
-\definecharacter Yhook {Y}
-\definecharacter yhook {y}
-
-\definecharacter Acircumflexgrave {\Acircumflex}
-\definecharacter Acircumflexacute {\Acircumflex}
-\definecharacter Acircumflextilde {\Acircumflex}
-\definecharacter Acircumflexhook {\Acircumflex}
-\definecharacter acircumflexgrave {\acircumflex}
-\definecharacter acircumflexacute {\acircumflex}
-\definecharacter acircumflextilde {\acircumflex}
-\definecharacter acircumflexhook {\acircumflex}
-\definecharacter Ecircumflexgrave {\Ecircumflex}
-\definecharacter Ecircumflexacute {\Ecircumflex}
-\definecharacter Ecircumflextilde {\Ecircumflex}
-\definecharacter Ecircumflexhook {\Ecircumflex}
-\definecharacter ecircumflexgrave {\ecircumflex}
-\definecharacter ecircumflexacute {\ecircumflex}
-\definecharacter ecircumflextilde {\ecircumflex}
-\definecharacter ecircumflexhook {\ecircumflex}
-\definecharacter Ocircumflexgrave {\Ocircumflex}
-\definecharacter Ocircumflexacute {\Ocircumflex}
-\definecharacter Ocircumflextilde {\Ocircumflex}
-\definecharacter Ocircumflexhook {\Ocircumflex}
-\definecharacter ocircumflexgrave {\ocircumflex}
-\definecharacter ocircumflexacute {\ocircumflex}
-\definecharacter ocircumflextilde {\ocircumflex}
-\definecharacter ocircumflexhook {\ocircumflex}
-
-\definecharacter Abrevegrave {A}
-\definecharacter Abreveacute {A}
-\definecharacter Abrevetilde {A}
-\definecharacter Abrevehook {A}
-\definecharacter abrevegrave {a}
-\definecharacter abreveacute {a}
-\definecharacter abrevetilde {a}
-\definecharacter abrevehook {a}
-
-\definecharacter Adotbelow {A}
-\definecharacter adotbelow {a}
-\definecharacter Edotbelow {E}
-\definecharacter edotbelow {e}
-\definecharacter Idotbelow {I}
-\definecharacter idotbelow {i}
-\definecharacter Odotbelow {O}
-\definecharacter odotbelow {o}
-\definecharacter Udotbelow {U}
-\definecharacter udotbelow {u}
-\definecharacter Ydotbelow {Y}
-\definecharacter ydotbelow {y}
-\definecharacter Ohorndotbelow {O}
-\definecharacter ohorndotbelow {o}
-\definecharacter Uhorndotbelow {U}
-\definecharacter uhorndotbelow {u}
-
-\definecharacter Acircumflexdotbelow {\Acircumflex}
-\definecharacter acircumflexdotbelow {\acircumflex}
-\definecharacter Ecircumflexdotbelow {\Ecircumflex}
-\definecharacter ecircumflexdotbelow {\ecircumflex}
-\definecharacter Ocircumflexdotbelow {\Ocircumflex}
-\definecharacter ocircumflexdotbelow {\ocircumflex}
-\definecharacter Abrevedotbelow {\Abreve}
-\definecharacter abrevedotbelow {\abreve}
-
-\definecharacter Ohorn {O}
-\definecharacter Ohorngrave {O}
-\definecharacter Ohornacute {O}
-\definecharacter Ohorntilde {O}
-\definecharacter Ohornhook {O}
-
-\definecharacter ohorn {o}
-\definecharacter ohorngrave {o}
-\definecharacter ohornacute {o}
-\definecharacter ohorntilde {o}
-\definecharacter ohornhook {o}
-
-\definecharacter Uhorn {U}
-\definecharacter Uhorngrave {U}
-\definecharacter Uhornacute {U}
-\definecharacter Uhorntilde {U}
-\definecharacter Uhornhook {U}
-
-\definecharacter uhorn {u}
-\definecharacter uhorngrave {u}
-\definecharacter uhornacute {u}
-\definecharacter uhorntilde {u}
-\definecharacter uhornhook {u}
-
-\definecharacter Utilde {U}
-\definecharacter utilde {u}
-\definecharacter Itilde {I}
-\definecharacter itilde {i}
-\definecharacter Ygrave {Y}
-\definecharacter ygrave {y}
-\definecharacter Ytilde {Y}
-\definecharacter ytilde {y}
-
-\definecharacter dstroke {d}
-\definecharacter Dstroke {D}
-
-\stopencoding
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-pfr.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-pfr.mkii
deleted file mode 100644
index aca2436c130..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-pfr.mkii
+++ /dev/null
@@ -1,305 +0,0 @@
-%D \module
-%D [ file=enco-pfr,
-%D version=2000.12.10, % adapted 2005.08.14 to more delayed loading
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=PDF Resources,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\ifnum\texengine>\pdftexengine
- \expandafter \endinput
-\fi
-
-\ifdefined\pdffontresource \else
- \expandafter \endinput
-\fi
-
-\writestatus{loading}{ConTeXt Encoding Macros / PDF Resources}
-
-%D This is an experimental module in which we implement
-%D font resource inclusion in \PDF. One reason to include
-%D font resources is that it enables a search engine to
-%D perform a search (I'm told). This feature ws requested by
-%D Petr Ferdus from Czech.
-
-%D A simple test file may look like this (watch how we first
-%D load the encoding and then the font; previous font
-%D definitions are left untouched.)
-%D
-%D \starttyping
-%D % output=pdftex interface=en
-%D
-%D \useencoding[pfr]
-%D \setupbodyfont[csr]
-%D
-%D \starttext
-%D test \`z \'z \bf test \sl test \bs quite funny \`z \page
-%D test \`z \'z \bf test \sl test \bs quite funny \`z \page
-%D \stoptext
-%D \stoptyping
-%D
-%D We do our best to include a (often large) font resources
-%D only once. The current implementation is not that
-%D general which is also due to the fact that \type
-%D {\pdffontattr} is expanded instantly and persistent. A
-%D more versatile (but also slower) approach is to keep track
-%D of the fonts and either flush the information at shipout
-%D time, or at the end of the document.
-
-%D \macros
-%D {ifincludepdffontresources}
-%D
-%D You can turn of this feature using the following switch.
-
-\newif\ifincludepdffontresources \includepdffontresourcestrue
-
-\ifx\pdfglyphtounicode\undefined \else
- \appendtoks
- \doif\jobsuffix{pdf}{\readfile{pdfr-def.mkii}\donothing\donothing}%
- \to \everystarttext
-\fi
-
-% somehow we cannot preload this beast; also, it's mk dependent
-%
-% \appendtoks
-% \doifelse{\jobsuffix}{pdf}{\loadmkiifile{pdfr-def.mkii}}%
-% \to \everystarttext
-
-% ugly, this should go to the driver spec-tpd
-
-\ifx\pdfgentounicode\undefined \else
- \ifcase\pdfgentounicode \else
- \expandafter \expandafter \expandafter \endinput
- \fi
-\fi
-
-\unprotect
-
-% a problem is that there is always an ec vector added even when
-% we switch to texnansi early; this has to do with the fact that
-% we need to setup fonts at startup; this a pain when we have
-% textless documents, so we should have a way around, i.e. an
-% extension to pdftex where we can tag numbers inside user specs
-% and attributes.
-%
-% currently we need to use immediate so we end up with entries
-
-%D The name of the resource is stored in a macro, as is its
-%D object reference. A resource is only processed once. When
-%D done, the resource name is erased, and we use this fact to
-%D prevent redefinition as well as well as reloading. So, a
-%D macro defined with \type {\pdffontfileresource} can have
-%D three states:
-%D
-%D \startitemize[packed]
-%D \item undefined: not yet loaded, and not yet included
-%D \item some value: loaded, but not yet included
-%D \item empty: loaded, and already included
-%D \stopitemize
-
-\def\pdffontresource {pdfr:\currentencoding}
-\def\pdffontfileresource{pdff:\pdffontresource}
-
-%D A resource is defined in a file prefixed by \type {pdfr-}.
-%D The following \PDF\ code is composed by Ondrej Koala Vacha (I
-%D probably mispelled this name).
-%D
-%D \starttyping
-%D \startpdffontresource[il2]
-%D /CIDInit /ProcSet findresource begin
-%D 12 dict begin
-%D begincmap
-%D /CIDSystemInfo
-%D << /Registry (Adobe)
-%D /Ordering (T1UV)
-%D /Supplement 0
-%D >> def
-%D /CMapName /Adobe-Identity-UCS def
-%D /CMapType 1 def
-%D 1 begincodespacerange
-%D <00> <FF>
-%D endcodespacerange
-%D %%FontSpecificEncoding
-%D 191 beginbfrange
-%D <20> <20> <0020> % space dec: 32 oct:040 hex:20
-%D .... .... ...... . ........ .... .. ....... ......
-%D <ff> <ff> <00ff> % dotaccent dec:255 oct:377 hex:ff
-%D endbfrange
-%D endcmap
-%D CMapName currentdict /CMap defineresource pop end
-%D end
-%D \stoppdffontresource
-%D \stoptyping
-%D
-%D We don't preload such huge definitions, and process them
-%D run||time to save memory. Therefore, in the encoding
-%D vector, we only add an entry like:
-%D
-%D \starttyping
-%D \startencoding [il2]
-%D \usepdffontresource il2
-%D \stopencoding
-%D \stoptyping
-%D
-%D This macro is defined as follows.
-
-\def\usepdffontresource #1 %
- {\doifundefinedelse\pdffontfileresource % okay, undefined, so either
- {\setxvalue\pdffontfileresource{#1}} % brand new, or not yet loaded
- {\doifvaluesomething\pdffontfileresource % only if not loaded in which
- {\setxvalue\pdffontfileresource{#1}}}} % case it's made empty
-
-%D Watch how we check for duplicated loading. The resource
-%D itself, when asked for, is included immediately, after which
-%D we save its reference. Normally a document will have one
-%D such a resource.
-
-% \long\def\startpdffontresource[#1]#2\stoppdffontresource
-% {\doif{#1}\currentencoding
-% {\immediate\pdfobj useobjnum \getvalue{\pdffontresource} stream {#2}}}
-
-% alternatively we can use object references
-
-% fails when we switch back and forward between dvi/pdf mode
-%
-% \long\def\startpdffontresource[#1]#2\stoppdffontresource
-% {\doif{#1}\currentencoding{\doifdefined\pdffontresource
-% {\immediate\pdfobj useobjnum \getvalue{\pdffontresource} stream {#2}}}}
-
-\long\def\startpdffontresource[#1]#2\stoppdffontresource
- {\doif{#1}\currentencoding{\doifdefined\pdffontresource
- {\expanded{\doshipoutpdffontresource{\getvalue{\pdffontresource}}{#2}}}}}
-
-\def\doshipoutpdffontresource#1#2%
- {\ifnum\realpageno<\plustwo
- \doglobal\appendtoks
- \ifcase\pdfoutput\else\immediate\pdfobj useobjnum #1 stream {#2}\fi
- \to\everyfirstshipout
- \else
- \ifcase\pdfoutput\else\immediate\pdfobj useobjnum #1 stream {#2}\fi
- \fi}
-
-% cleaner but not better:
-%
-% \newtoks \collectedpdffontresources
-%
-% \def\doshipoutpdffontresource#1#2%
-% {\doglobal\appendtoks
-% \ifcase\pdfoutput\else\immediate\pdfobj useobjnum #1 stream {#2}\fi
-% \to \collectedpdffontresources}
-%
-% \def\dofluspdffontresources
-% {\the\collectedpdffontresources
-% \global\collectedpdffontresources\emptytoks}
-%
-% \appendtoks \dofluspdffontresources \to \everybeforeshipout
-
-%D The reference to such a vector is to be handled at font
-%D definition time, which is why we hook it into the font
-%D loading routine. A little bit of indirectness speeds up
-%D the process when this feature is disabled and keeps the
-%D macros readable.
-
-% \newevery \everyfont \relax
-
-\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
- {\ifx\pdfgentounicode\undefined
- \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
- \else\ifcase\pdfgentounicode
- \ifincludepdffontresources
- \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
- \or
- \global\let\includepdffontresource\relax % automatic, built in
- \fi\fi}
-
-\def\dododoincludepdffontresource#1% encoding
- {\bgroup
- \edef\currentencoding{#1}%
- \doifvaluesomething\pdffontfileresource
- {\startreadingfile
- \ignorelines % just in case \par is redefined; this thing can get called anywhere
- \readsysfile{pdfr-\getvalue\pdffontfileresource.mkii}\donothing\donothing
- \stopreadingfile
- \letgvalue\pdffontfileresource\empty}%
- \egroup}
-
-\def\doincludepdffontresource
- {\ifcsname\s!ucmap\fontfile\endcsname\else
- \dodoincludepdffontresource
- \fi}
-
-\def\dodoincludepdffontresource
- {% does this font has an encoding specified vector
- \doifsomething\currentencoding % no \ifx
- {% is there a pdf font encoding resource file defined
- \ifcsname\pdffontresource\endcsname
- % (fake) object defined
- \else\ifcsname\pdffontfileresource\endcsname
- % is there a resource already included
- \doifsomething\pdffontfileresource
- {\pdfobj reserveobjnum {}%
- \setxvalue\pdffontresource{\the\pdflastobj}%
- \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}}%
- % do it only once for each font
- \letgvalue{\s!ucmap\fontfile}\empty
- \fi}}
-
-%D For the moment, we keep this definition here, if only
-%D because \type {\usepdffontencoding} is not defined in the
-%D core. In the end, this will go to \type {enco-*.tex}.
-%D
-%D Test:
-%D
-%D \starttyping
-%D \useencoding[pfr] \usetypescript[palatino][ec] \setupbodyfont[palatino]
-%D
-%D \starttext
-%D fi ff ffi
-%D \stoptext
-%D \stoptyping
-
-\startencoding [il2] \usepdffontresource il2 \stopencoding
-\startencoding [ec] \usepdffontresource ec \stopencoding
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-pol.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-pol.mkii
deleted file mode 100644
index ec49c6e1d37..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-pol.mkii
+++ /dev/null
@@ -1,276 +0,0 @@
-%D \module
-%D [ file=enco-pol,
-%D version=2000.05.07, % 1999.28.8,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=Polish Mixed Encoding,
-%D author={Taco Hoekwater \& Hans Hagen},
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% This encoding will go but the regime will remain.
-
-%D Polish native encoding; normally polish users will use
-%D translate=cp1250pl in combination with ec encoding.
-
-\startmapping[pl0]
-
-\resetcaserange 128 to 255
-
-\definecaseswap 161 129 % a ogonek
-\definecaseswap 162 130 % c acute
-\definecaseswap 166 134 % e ogonek
-\definecaseswap 170 138 % l crossed
-\definecaseswap 171 139 % n acute
-\definecaseswap 177 145 % s acute
-\definecaseswap 185 153 % z acute
-\definecaseswap 187 155 % z dotaccent
-\definecaseswap 243 211 % o acute
-
-% \definecasemap 161 161 129 % a ogonek
-% \definecasemap 162 162 130 % c acute
-% \definecasemap 166 166 134 % e ogonek
-% \definecasemap 170 170 138 % l crossed
-% \definecasemap 171 171 139 % n acute
-% \definecasemap 177 177 145 % s acute
-% \definecasemap 185 185 153 % z acute
-% \definecasemap 187 187 155 % z dotaccent
-% \definecasemap 243 243 211 % o acute
-
-% \definecasemap 129 161 129 % A ogonek
-% \definecasemap 130 162 130 % C acute
-% \definecasemap 134 166 134 % E ogonek
-% \definecasemap 138 170 138 % L crossed
-% \definecasemap 139 171 139 % N acute
-% \definecasemap 145 177 145 % S acute
-% \definecasemap 153 185 153 % Z acute
-% \definecasemap 155 187 155 % Z dotaccent
-% \definecasemap 211 243 211 % O acute
-
-\stopmapping
-
-\startmapping[pl0]
-
-\definespacemap 129 999 % A ogonek
-\definespacemap 130 999 % C acute
-\definespacemap 134 999 % E ogonek
-\definespacemap 138 999 % L crossed
-\definespacemap 139 999 % N acute
-\definespacemap 211 999 % O acute
-\definespacemap 145 999 % S acute
-\definespacemap 153 999 % Z acute
-\definespacemap 155 999 % Z dot
-
-\stopmapping
-
-\startencoding[pl0][pl0]
-
-\definecharacter Aogonek 129
-\definecharacter Cacute 130
-\definecharacter Eogonek 134
-\definecharacter Lstroke 138
-\definecharacter Nacute 139
-\definecharacter Sacute 145
-\definecharacter Zacute 153
-\definecharacter Zdotaccent 155
-\definecharacter aogonek 161
-\definecharacter cacute 162
-\definecharacter eogonek 166
-\definecharacter lstroke 170
-\definecharacter nacute 171
-\definecharacter sacute 177
-\definecharacter zacute 185
-\definecharacter zdotaccent 187
-\definecharacter Oacute 211
-\definecharacter oacute 243
-
-\stopencoding
-
-\startencoding[pl0][pl0]
-
-\definecharacter leftguillemot 174
-\definecharacter rightguillemot 175
-\definecharacter guilsingleleft 174
-\definecharacter guilsingleright 175
-
-\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.
-
-% \startmapping[pl1]
-%
-%
-% \resetcaserange 128 to 255
-%
-% \definecasemap 185 185 165 % a ogonek
-% \definecasemap 230 230 198 % c acute
-% \definecasemap 234 234 202 % e ogonek
-% \definecasemap 179 179 163 % l crossed
-% \definecasemap 241 241 209 % n acute
-% \definecasemap 243 243 211 % o acute
-% \definecasemap 156 156 140 % s acute
-% \definecasemap 159 159 143 % z acute
-% \definecasemap 191 191 175 % z dot
-%
-% \definecasemap 165 165 185 % A ogonek
-% \definecasemap 198 198 230 % C acute
-% \definecasemap 202 202 234 % E ogonek
-% \definecasemap 163 163 179 % L crossed
-% \definecasemap 209 209 241 % N acute
-% \definecasemap 211 211 243 % O acute
-% \definecasemap 140 140 156 % S acute
-% \definecasemap 143 143 159 % Z acute
-% \definecasemap 175 175 191 % Z dot
-%
-% \stopmapping
-%
-% \startmapping[pl1]
-%
-% \definespacemap 165 999 % A ogonek
-% \definespacemap 198 999 % C acute
-% \definespacemap 202 999 % E ogonek
-% \definespacemap 163 999 % L crossed
-% \definespacemap 209 999 % N acute
-% \definespacemap 211 999 % O acute
-% \definespacemap 140 999 % S acute
-% \definespacemap 143 999 % Z acute
-% \definespacemap 175 999 % Z dot
-%
-% \stopmapping
-%
-% \startencoding[pl1]
-%
-% \definecharacter Sacute 140
-% \definecharacter Zacute 143
-% \definecharacter sacute 156
-% \definecharacter zacute 159
-% \definecharacter Lstroke 163
-% \definecharacter Aogonek 165
-% \definecharacter Zdotaccent 175
-% \definecharacter lstroke 179
-% \definecharacter aogonek 185
-% \definecharacter zdotaccent 191
-% \definecharacter Cacute 198
-% \definecharacter Eogonek 202
-% \definecharacter Nacute 209
-% \definecharacter Oacute 211
-% \definecharacter cacute 230
-% \definecharacter eogonek 234
-% \definecharacter nacute 241
-% \definecharacter oacute 243
-%
-% \stopencoding
-%
-% \startencoding[pl1]
-%
-% \definecharacter leftguillemot 174
-% \definecharacter rightguillemot 175
-% \definecharacter guilsingleleft 174
-% \definecharacter guilsingleright 175
-%
-% \stopencoding
-
-%D Polish ISO-8859-2 encoding.
-
-% \startmapping[pl2]
-%
-% \resetcaserange 128 to 255
-%
-% \definecasemap 177 177 161 % a ogonek
-% \definecasemap 230 230 198 % c acute
-% \definecasemap 234 234 202 % e ogonek
-% \definecasemap 179 179 163 % l crossed
-% \definecasemap 241 241 209 % n acute
-% \definecasemap 243 243 211 % o acute
-% \definecasemap 182 182 166 % s acute
-% \definecasemap 188 188 172 % z acute
-% \definecasemap 191 191 175 % z dotaccent
-%
-% \definecasemap 161 161 177 % A ogonek
-% \definecasemap 198 198 230 % C acute
-% \definecasemap 202 202 234 % E ogonek
-% \definecasemap 163 163 179 % L crossed
-% \definecasemap 209 209 241 % N acute
-% \definecasemap 211 211 243 % O acute
-% \definecasemap 166 166 182 % S acute
-% \definecasemap 172 172 188 % Z acute
-% \definecasemap 175 175 191 % Z dotaccent
-%
-% \stopmapping
-%
-% \startmapping[pl2]
-%
-% \definespacemap 161 999 % A ogonek
-% \definespacemap 198 999 % C acute
-% \definespacemap 202 999 % E ogonek
-% \definespacemap 163 999 % L crossed
-% \definespacemap 209 999 % N acute
-% \definespacemap 211 999 % O acute
-% \definespacemap 166 999 % S acute
-% \definespacemap 172 999 % Z acute
-% \definespacemap 175 999 % Z dot
-%
-% \stopmapping
-%
-% \startencoding[pl2]
-%
-% \definecharacter Aogonek 161
-% \definecharacter Lstroke 163
-% \definecharacter Sacute 166
-% \definecharacter Zacute 172
-% \definecharacter Zdotaccent 175
-% \definecharacter aogonek 177
-% \definecharacter lstroke 179
-% \definecharacter sacute 182
-% \definecharacter zacute 188
-% \definecharacter zdotaccent 191
-% \definecharacter Cacute 198
-% \definecharacter Eogonek 202
-% \definecharacter Nacute 209
-% \definecharacter Oacute 211
-% \definecharacter cacute 230
-% \definecharacter eogonek 234
-% \definecharacter nacute 241
-% \definecharacter oacute 243
-%
-% \stopencoding
-%
-% \startencoding[pl2]
-%
-% \definecharacter leftguillemot 174
-% \definecharacter rightguillemot 175
-% \definecharacter guilsingleleft 174
-% \definecharacter guilsingleright 175
-%
-% \stopencoding
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-qx.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-qx.mkii
deleted file mode 100644
index b184fe0ac0c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-qx.mkii
+++ /dev/null
@@ -1,268 +0,0 @@
-%D \module
-%D [ file=enco-qx,
-%D version=2004.04.03,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=Polish QX Encoding,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% to be done
-
-% 35 numbersign
-% 95 dotaccent
-% 132 greaterequal
-% 133 approxequal
-% 137 lessequal
-% 142 ell
-% 156 IJ
-% 173 infinity
-% 182 threequartersemdash
-% 188 ij
-% 247 anglearc
-% 248 diameter
-
-\startmapping[qx] % to be done
-
-\resetcaserange 128 to 128
-\resetcaserange 131 to 133
-\resetcaserange 136 to 137
-\resetcaserange 140 to 144
-\resetcaserange 148 to 148
-\resetcaserange 150 to 150
-\resetcaserange 157 to 160
-\resetcaserange 163 to 165
-\resetcaserange 168 to 169
-\resetcaserange 172 to 176
-\resetcaserange 180 to 180
-\resetcaserange 182 to 182
-\resetcaserange 189 to 191
-\resetcaserange 198 to 198
-\resetcaserange 215 to 216
-\resetcaserange 223 to 223
-\resetcaserange 230 to 230
-\resetcaserange 247 to 248
-\resetcaserange 255 to 255
-
-\definecaseswap 161 129
-\definecaseswap 162 130
-
-\definecaseswap 166 134
-\definecaseswap 167 135
-
-\definecaseswap 170 138
-\definecaseswap 171 139
-
-\definecaseswap 177 145
-\definecaseswap 178 146
-\definecaseswap 179 147
-
-\definecaseswap 181 149
-
-\definecasemaps 151 to 156 lc +32 uc 0
-\definecasemaps 183 to 188 lc 0 uc -32
-
-\definecasemaps 192 to 197 lc +32 uc 0
-\definecasemaps 224 to 229 lc 0 uc -32
-
-\definecasemaps 199 to 214 lc +32 uc 0
-\definecasemaps 231 to 246 lc 0 uc -32
-
-\definecasemaps 217 to 222 lc +32 uc 0
-\definecasemaps 249 to 254 lc 0 uc -32
-
-\definecaseself 39 % quoteright
-
-\stopmapping
-
-\startencoding[qx]
-
-\definecharacter textacute 19
-\definecharacter textbreve 21
-\definecharacter textcaron 20
-\definecharacter textcedilla 24
-\definecharacter textcircumflex 94
-\definecharacter textdiaeresis 127
-\definecharacter textdotaccent 94
-\definecharacter textgrave 18
-\definecharacter texthungarumlaut 125
-\definecharacter textmacron 22
-\definecharacter textogonek 150
-\definecharacter textring 23
-\definecharacter texttilde 126
-
-\definecharacter dotlessi 16
-\definecharacter dotlessj 17
-
-\definecharacter endash 123
-\definecharacter emdash 124
-
-\definecharacter aeligature 26
-\definecharacter AEligature 29
-\definecharacter oeligature 27
-\definecharacter OEligature 30
-
-\definecharacter ssharp 25
-%definecharacter Ssharp 25
-
-\definecharacter thorn 254
-\definecharacter Thorn 222
-
-\definecharacter Dstroke 208 % also Eth, mapped into enco-def
-\definecharacter eth 240
-
-\definecharacter exclamdown 60
-\definecharacter questiondown 62
-
-\definecharacter sectionmark 159
-
-\definecharacter percent 37
-\definecharacter perthousand 216
-
-\definecharacter textasciicircum 141
-\definecharacter textasciitilde 140
-\definecharacter textbackslash 198
-\definecharacter textbraceleft 157
-\definecharacter textbraceright 158
-\definecharacter textunderscore 230
-
-\definecharacter textcurrency 215
-\definecharacter textdollar 36
-\definecharacter texteuro 128
-
-\definecharacter periodcentered 189
-\definecharacter textdag 143
-\definecharacter textddag 144
-\definecharacter textdegree 148
-\definecharacter textbullet 180
-
-\definecharacter paragraphmark 176
-
-\definecharacter copyright 164
-\definecharacter registered 163
-
-\definecharacter textbrokenbar 223
-\definecharacter textellipsis 8
-\definecharacter textslash 47
-\definecharacter textpm 172
-\definecharacter textdiv 165
-\definecharacter textminus 168
-\definecharacter textmultiply 169
-\definecharacter textmu 7
-
-\definecharacter quotedbl 190
-\definecharacter quotedblbase 255
-\definecharacter quotedblleft 92
-\definecharacter quotedblright 34
-
-\definecharacter quotesingle 191
-
-\definecharacter quoteleft 96
-\definecharacter quoteright 39
-
-\definecharacter leftguillemot 174
-\definecharacter rightguillemot 175
-
-\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 Nacute 139
-\definecharacter Oacute 211
-\definecharacter nacute 171
-\definecharacter oacute 243
-\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 scaron 178
-\definecharacter Scaron 146
-\definecharacter zcaron 186
-\definecharacter Zcaron 154
-
-\definecharacter ccedilla 231
-\definecharacter Ccedilla 199
-
-\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
-
-\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 aogonek 161
-\definecharacter Aogonek 129
-\definecharacter eogonek 166
-\definecharacter Eogonek 134
-\definecharacter iogonek 167
-\definecharacter Iogonek 135
-\definecharacter uogonek 183
-\definecharacter Uogonek 151
-
-\definecharacter aring 229
-\definecharacter Aring 197
-
-\definecharacter lstroke 170
-\definecharacter Lstroke 138
-\definecharacter ostroke 28
-\definecharacter Ostroke 31
-
-\definecharacter atilde 227
-\definecharacter Atilde 195
-\definecharacter ntilde 241
-\definecharacter Ntilde 209
-\definecharacter otilde 245
-\definecharacter Otilde 213
-
-\definecharacter scommaaccent 179
-\definecharacter Scommaaccent 147
-\definecharacter tcommaaccent 181
-\definecharacter Tcommaaccent 149
-
-\stopencoding
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-raw.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-raw.mkii
deleted file mode 100644
index e3a46e3d768..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-raw.mkii
+++ /dev/null
@@ -1,119 +0,0 @@
-% default instelbaar maken: \enableencoding[main][fallback]
-
-\startencoding[raw]
-
-\definecharacter Acircumflex {A} \definecharacter acircumflex {a}
-\definecharacter Ccircumflex {C} \definecharacter ccircumflex {c}
-\definecharacter Ecircumflex {E} \definecharacter ecircumflex {e}
-\definecharacter Gcircumflex {G} \definecharacter gcircumflex {g}
-\definecharacter Hcircumflex {H} \definecharacter hcircumflex {h}
-\definecharacter Icircumflex {I} \definecharacter icircumflex {i}
-\definecharacter Jcircumflex {J} \definecharacter jcircumflex {j}
-\definecharacter Ocircumflex {O} \definecharacter ocircumflex {o}
-\definecharacter Scircumflex {S} \definecharacter scircumflex {s}
-\definecharacter Ucircumflex {U} \definecharacter ucircumflex {u}
-\definecharacter Wcircumflex {W} \definecharacter wcircumflex {w}
-\definecharacter Ycircumflex {Y} \definecharacter ycircumflex {y}
-
-\definecharacter Agrave {A} \definecharacter agrave {a}
-\definecharacter Egrave {E} \definecharacter egrave {e}
-\definecharacter Igrave {I} \definecharacter igrave {i}
-\definecharacter Ograve {O} \definecharacter ograve {o}
-\definecharacter Ugrave {U} \definecharacter ugrave {u}
-\definecharacter Ygrave {Y} \definecharacter ygrave {y}
-
-\definecharacter Atilde {A} \definecharacter atilde {a}
-\definecharacter Itilde {I} \definecharacter itilde {i}
-\definecharacter Otilde {O} \definecharacter otilde {o}
-\definecharacter Utilde {U} \definecharacter utilde {u}
-\definecharacter Utilde {N} \definecharacter utilde {n}
-
-\definecharacter Adiaeresis {A} \definecharacter adiaeresis {a}
-\definecharacter Ediaeresis {E} \definecharacter ediaeresis {e}
-\definecharacter Idiaeresis {I} \definecharacter idiaeresis {i}
-\definecharacter Odiaeresis {O} \definecharacter odiaeresis {o}
-\definecharacter Udiaeresis {U} \definecharacter udiaeresis {u}
-\definecharacter Ydiaeresis {Y} \definecharacter ydiaeresis {y}
-
-\definecharacter Aacute {A} \definecharacter aacute {a}
-\definecharacter Cacute {C} \definecharacter cacute {c}
-\definecharacter Eacute {E} \definecharacter eacute {e}
-\definecharacter Iacute {I} \definecharacter iacute {i}
-\definecharacter Lacute {L} \definecharacter lacute {l}
-\definecharacter Nacute {N} \definecharacter nacute {n}
-\definecharacter Oacute {O} \definecharacter oacute {o}
-\definecharacter Racute {R} \definecharacter racute {r}
-\definecharacter Sacute {S} \definecharacter sacute {s}
-\definecharacter Uacute {U} \definecharacter uacute {u}
-\definecharacter Yacute {Y} \definecharacter yacute {y}
-\definecharacter Zacute {Z} \definecharacter zacute {z}
-
-\definecharacter Dstroke {D} \definecharacter dstroke {d}
-\definecharacter Hstroke {H} \definecharacter hstroke {h}
-\definecharacter Tstroke {T} \definecharacter tstroke {t}
-
-\definecharacter Cdotaccent {C} \definecharacter cdotaccent {c}
-\definecharacter Edotaccent {E} \definecharacter edotaccent {e}
-\definecharacter Gdotaccent {G} \definecharacter gdotaccent {g}
-\definecharacter Idotaccent {I} \definecharacter idotaccent {i}
-\definecharacter Zdotaccent {Z} \definecharacter zdotaccent {z}
-
-\definecharacter Amacron {A} \definecharacter amacron {a}
-\definecharacter Emacron {E} \definecharacter emacron {e}
-\definecharacter Imacron {I} \definecharacter imacron {i}
-\definecharacter Omacron {O} \definecharacter omacron {o}
-\definecharacter Umacron {U} \definecharacter umacron {u}
-
-\definecharacter Ccedilla {C} \definecharacter ccedilla {c}
-\definecharacter Kcedilla {K} \definecharacter kcedilla {k}
-\definecharacter Lcedilla {L} \definecharacter lcedilla {l}
-\definecharacter Ncedilla {N} \definecharacter ncedilla {n}
-\definecharacter Rcedilla {R} \definecharacter rcedilla {r}
-\definecharacter Scedilla {S} \definecharacter scedilla {s}
-\definecharacter Tcedilla {T} \definecharacter tcedilla {t}
-
-\definecharacter Ohungarumlaut {O} \definecharacter ohungarumlaut {o}
-\definecharacter Uhungarumlaut {U} \definecharacter uhungarumlaut {u}
-
-\definecharacter Aogonek {A} \definecharacter aogonek {a}
-\definecharacter Eogonek {E} \definecharacter eogonek {e}
-\definecharacter Iogonek {I} \definecharacter iogonek {i}
-\definecharacter Uogonek {U} \definecharacter uogonek {u}
-
-\definecharacter Aring {A} \definecharacter aring {a}
-\definecharacter Uring {U} \definecharacter uring {u}
-
-\definecharacter Abreve {A} \definecharacter abreve {a}
-\definecharacter Ebreve {E} \definecharacter ebreve {e}
-\definecharacter Gbreve {G} \definecharacter gbreve {g}
-\definecharacter Ibreve {I} \definecharacter ibreve {i}
-\definecharacter Obreve {O} \definecharacter obreve {o}
-\definecharacter Ubreve {U} \definecharacter ubreve {u}
-
-\definecharacter Ccaron {C} \definecharacter ccaron {c}
-\definecharacter Dcaron {D} \definecharacter dcaron {d}
-\definecharacter Ecaron {E} \definecharacter ecaron {e}
-\definecharacter Lcaron {L} \definecharacter lcaron {l}
-\definecharacter Ncaron {N} \definecharacter ncaron {n}
-\definecharacter Rcaron {R} \definecharacter rcaron {r}
-\definecharacter Scaron {S} \definecharacter scaron {s}
-\definecharacter Tcaron {T} \definecharacter tcaron {t}
-\definecharacter Zcaron {Z} \definecharacter zcaron {z}
-
-\definecharacter dotlessI {I} \definecharacter dotlessi {i}
-\definecharacter dotlessJ {J} \definecharacter dotlessj {j}
-
-\definecharacter AEligature {AE} \definecharacter aeligature {ae}
-\definecharacter Lstroke {L} \definecharacter lstroke {l}
-\definecharacter Ostroke {O} \definecharacter ostroke {o}
-\definecharacter OEligature {OE} \definecharacter oeligature {oe}
-\definecharacter Ssharp {SS} \definecharacter ssharp {ss}
-\definecharacter IJligature {IJ} \definecharacter ijligature {ij}
-
-\definecharacter Aumlaut {A} \definecharacter aumlaut {a}
-\definecharacter Eumlaut {E} \definecharacter eumlaut {e}
-\definecharacter Iumlaut {I} \definecharacter iumlaut {i}
-\definecharacter Oumlaut {O} \definecharacter oumlaut {o}
-\definecharacter Uumlaut {U} \definecharacter uumlaut {u}
-
-\stopencoding
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-run.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-run.mkii
deleted file mode 100644
index 2f60a35b874..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-run.mkii
+++ /dev/null
@@ -1,149 +0,0 @@
-%D \module
-%D [ file=enco-run,
-%D version=2000.27.12, % moved to runtime module
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=Runtime Macros,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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
-
-\gdef\visualizecharacters% {}'s needed
- {\def\uchar##1##2{\hbox to 2.5em
- {\ifcase##1\relax\red\or\blue\else\green\fi##1\hss##2}}%
- \let\normalbuildtextaccent\buildtextaccent
- \let\normalbottomaccent \bottomaccent
- %\def\char{\green\normalchar}%
- \def\char % can be used in \oalign
- {\bgroup\def\char{\green\normalchar\scratchcounter\egroup}%
- \afterassignment\char\scratchcounter}%
- \def\buildtextaccent{\let\green\empty\blue\normalbuildtextaccent}%
- \def\bottomaccent{\let\green\empty\red\normalbottomaccent}}
-
-\unexpanded\gdef\visualizecharacterslegend
- {\hbox
- {\edef\banner{\currentencoding\space\fontname\font}%
- \tttf\banner:\space
- {\blue composed}\space{\red bottom}\space{\green char}\space raw}}
-
-\gdef\showaccents
- {\bgroup
- \savefont
- \setuptextrules[\c!bodyfont=,\c!style=]
- \starttextrule{\visualizecharacterslegend}
- \whitespace
- \restorefont\setupinterlinespace
- \visualizecharacters
- \def\do##1%
- {{\def\dodo####1%
- {\hss\hbox to 1em{\hss\expanded{##1####1\recurselevel}\hss}}%
- \hbox to \hsize
- {\strut
- \localcolortrue
- \hbox to 2em{\tttf\string##1\hss}%
- \dorecurse{26}{\dodo\character}}%
- \hbox to \hsize
- {\strut
- \localcolortrue
- \hskip2em
- \dorecurse{26}{\dodo\Character}}}%
- \par}
- \do\'\do\`\do\^\do\~\do\"
- \do\H\do\r\do\v\do\u\do\=
- \do\.\do\b\do\d\do\k\do\c
- \stoptextrule
- \egroup}
-
-\gdef\showcharacters
- {\bgroup
- \savefont
- \setuptextrules[\c!bodyfont=,\c!style=]
- \starttextrule{\visualizecharacterslegend}
- \whitespace
- \dontcomplain
- \forgetall
- \def\startencoding[##1]{}
- \def\stopencoding{\endinput}
- \dimen0=\zeropoint
- \dimen2=\zeropoint
- \def\definecharacter ##1 ##2 %
- {\setbox0=\hbox spread 1em{\getvalue{##1}}%
- \ifdim\wd0>\dimen0 \dimen0=\wd0 \fi
- \setbox2=\hbox spread 1em{\box0 \tttf##1}
- \ifdim\wd2>\dimen2 \dimen2=\wd2 \fi}%
- \readsysfile{\f!encodingprefix def}{}{}
- \edef\encwidth{\the\dimen0}
- \dimen0=\hsize
- \advance\dimen0 2em
- \advance\dimen2 2em
- \divide \dimen0 by \dimen2 \advance\dimen0 1sp
- \edef\enccols{\number\dimen0}
- \visualizecharacters
- \startcolumns[\c!n=\enccols,\c!distance=2em]
- \restorefont\setupinterlinespace
- \def\definecharacter ##1 ##2 %
- {\setbox0=\hbox to \hsize{\localcolortrue\hbox to \encwidth{\getvalue{##1}\hss}\tttf##1}%
- \ht0\strutheight \dp0\strutdepth \box0 \allowbreak}
- \readsysfile{\f!encodingprefix def}{}{}
- \stopcolumns
- \stoptextrule
- \egroup}
-
-% \hbox
-% {\font\test=uplr8t \test \ruledhbox{t}
-% \font\test=uplr8r \test \ruledhbox{t}}
-
-\ifnum\texengine=\pdftexengine
-
- \gdef\showhyphenations#1%
- {\starttabulate[|le|l|]
- \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
- {\dostepwiserecurse{128}{255}{1}
- {\hbox\bgroup
- \hbox to 2em{\hss\recurselevel}%
- \hbox to 2em{\hss\char\recurselevel\hss}%
- \hbox to 3em{\hss\ifcase\lccode\recurselevel\else\the \lccode\recurselevel\fi}%
- \hbox to 2em{\hss\ifcase\lccode\recurselevel\else\char\lccode\recurselevel\fi\hss}%
- \hbox to 3em{\hss\ifcase\lccode\recurselevel\else\the \uccode\recurselevel\fi}%
- \hbox to 2em{\hss\ifcase\uccode\recurselevel\else\char\uccode\recurselevel\fi\hss}%
- \egroup
- \endgraf}}
-
- \gdef\showcharacterbounds
- {\bgroup
- \localcolortrue
- \dorecurse{255}
- {\ifdim\fontcharwd\font\recurselevel>\zeropoint
- \noindent\ruledhbox{\darkgray\char\recurselevel}\space
- \fi}\unskip
- \egroup}
-
-\else
-
- \gdef\showhyphenations#1%
- {\starttabulate[|le|l|]
- \NC language \NC \currentlanguage\ (internal code:\the\normallanguage) \NC \NR
- \NC font \NC \fontname\font \NC \NR
- \NC sample \NC \hyphenatedword{#1} \NC \NR
- \stoptabulate}
-
- \globallet\showmapping\relax
-
- \globallet\showcharacterbounds\relax
-
-\fi
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-t5.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-t5.mkii
deleted file mode 100644
index 3f51b85855b..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-t5.mkii
+++ /dev/null
@@ -1,248 +0,0 @@
-%D \module
-%D [ file=enco-t5,
-%D version=2004.11.16,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=New Vietnamese Encoding,
-%D author=Hans Hagen \& Adam Lindsay,
-%D date=\currentdate,
-%D copyright={Adam Lindsay \& Hans Hagen}]
-%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 module is derived from the enco-x5 encoding, but now
-%D approaches the world with named glyphs.
-
-\startencoding[t5]
-
-\definecasemaps 128 to 159 lc +32 uc 0
-
-\definecasemaps 160 to 191 lc 0 uc -32
-
-\definecasemaps 192 to 223 lc +32 uc 0
-
-\definecasemaps 224 to 225 lc 0 uc -32
-
-\definecasemap 26 26 27 \definecasemap 27 26 27
-\definecasemap 28 28 29 \definecasemap 29 28 29
-\definecasemap 30 30 31 \definecasemap 31 30 31
-
-\definecharacter textgrave 0
-\definecharacter textacute 1
-\definecharacter textcircumflex 2
-\definecharacter texttilde 3
-\definecharacter textdiaeresis 4
-\definecharacter textbottomdot 5
-\definecharacter textring 6
-\definecharacter textcaron 7
-\definecharacter textbreve 8
-\definecharacter textmacron 9
-\definecharacter textdotaccent 10
-\definecharacter textcedilla 11
-\definecharacter texthookabove 12
-\definecharacter textogonek {}
-
-\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 cwm 23
-\definecharacter zeroinferior 24
-\definecharacter Yhook 26
-\definecharacter yhook 27
-\definecharacter Ydotbelow 28
-\definecharacter ydotbelow 29
-\definecharacter Dstroke 30
-\definecharacter dstroke 31
-\definecharacter textvisiblespace 32
-
-\definecharacter dotlessi 25
-%definecharacter DJ 30
-%definecharacter dj 31
-\definecharacter Agrave 128
-\definecharacter Aacute 129
-\definecharacter Atilde 130
-\definecharacter Ahook 131
-\definecharacter Adotbelow 132
-\definecharacter Acircumflex 133
-\definecharacter Acircumflexgrave 134
-\definecharacter Acircumflexacute 135
-\definecharacter Acircumflextilde 136
-\definecharacter Acircumflexhook 137
-\definecharacter Acircumflexdotbelow 138
-\definecharacter Abreve 139
-\definecharacter Abrevegrave 140
-\definecharacter Abreveacute 141
-\definecharacter Abrevetilde 142
-\definecharacter Abrevehook 143
-\definecharacter Abrevedotbelow 144
-\definecharacter Egrave 145
-\definecharacter Eacute 146
-\definecharacter Etilde 147
-\definecharacter Ehook 148
-\definecharacter Edotbelow 149
-\definecharacter Ecircumflex 150
-\definecharacter Ecircumflexgrave 151
-\definecharacter Ecircumflexacute 152
-\definecharacter Ecircumflextilde 153
-\definecharacter Ecircumflexhook 154
-\definecharacter Ecircumflexdotbelow 155
-\definecharacter Igrave 156
-\definecharacter Iacute 157
-\definecharacter Itilde 158
-\definecharacter Ihook 159
-\definecharacter agrave 160
-\definecharacter aacute 161
-\definecharacter atilde 162
-\definecharacter ahook 163
-\definecharacter adotbelow 164
-\definecharacter acircumflex 165
-\definecharacter acircumflexgrave 166
-\definecharacter acircumflexacute 167
-\definecharacter acircumflextilde 168
-\definecharacter acircumflexhook 169
-\definecharacter acircumflexdotbelow 170
-\definecharacter abreve 171
-\definecharacter abrevegrave 172
-\definecharacter abreveacute 173
-\definecharacter abrevetilde 174
-\definecharacter abrevehook 175
-\definecharacter abrevedotbelow 176
-\definecharacter egrave 177
-\definecharacter eacute 178
-\definecharacter etilde 179
-\definecharacter ehook 180
-\definecharacter edotbelow 181
-\definecharacter ecircumflex 182
-\definecharacter ecircumflexgrave 183
-\definecharacter ecircumflexacute 184
-\definecharacter ecircumflextilde 185
-\definecharacter ecircumflexhook 186
-\definecharacter ecircumflexdotbelow 187
-\definecharacter igrave 188
-\definecharacter iacute 189
-\definecharacter itilde 190
-\definecharacter ihook 191
-\definecharacter Idotbelow 192
-\definecharacter Ograve 193
-\definecharacter Oacute 194
-\definecharacter Otilde 195
-\definecharacter Ohook 196
-\definecharacter Odotbelow 197
-\definecharacter Ocircumflex 198
-\definecharacter Ocircumflexgrave 199
-\definecharacter Ocircumflexacute 200
-\definecharacter Ocircumflextilde 201
-\definecharacter Ocircumflexhook 202
-\definecharacter Ocircumflexdotbelow 203
-\definecharacter Ohorn 204
-\definecharacter Ohorngrave 205
-\definecharacter Ohornacute 206
-\definecharacter Ohorntilde 207
-\definecharacter Ohornhook 208
-\definecharacter Ohorndotbelow 209
-\definecharacter Ugrave 210
-\definecharacter Uacute 211
-\definecharacter Utilde 212
-\definecharacter Uhook 213
-\definecharacter Udotbelow 214
-\definecharacter Uhorn 215
-\definecharacter Uhorngrave 216
-\definecharacter Uhornacute 217
-\definecharacter Uhorntilde 218
-\definecharacter Uhornhook 219
-\definecharacter Uhorndotbelow 220
-\definecharacter Ytilde 223
-\definecharacter idotbelow 224
-\definecharacter ograve 225
-\definecharacter oacute 226
-\definecharacter otilde 227
-\definecharacter ohook 228
-\definecharacter odotbelow 229
-\definecharacter ocircumflex 230
-\definecharacter ocircumflexgrave 231
-\definecharacter ocircumflexacute 232
-\definecharacter ocircumflextilde 233
-\definecharacter ocircumflexhook 234
-\definecharacter ocircumflexdotbelow 235
-\definecharacter ohorn 236
-\definecharacter ohorngrave 237
-\definecharacter ohornacute 238
-\definecharacter ohorntilde 239
-\definecharacter ohornhook 240
-\definecharacter ohorndotbelow 241
-\definecharacter ugrave 242
-\definecharacter uacute 243
-\definecharacter utilde 244
-\definecharacter uhook 245
-\definecharacter udotbelow 246
-\definecharacter uhorn 247
-\definecharacter uhorngrave 248
-\definecharacter uhornacute 249
-\definecharacter uhorntilde 250
-\definecharacter uhornhook 251
-\definecharacter uhorndotbelow 252
-\definecharacter ygrave 253
-\definecharacter yacute 254
-\definecharacter ytilde 255
-
-\stopencoding
-
-\endinput
-
-% \startencoding [x5]
-%
-% \definecharacter aa {\xfiveencodedaa}
-% \definecharacter AA {\xfiveencodedAA}
-%
-% \stopencoding
-%
-% \unprotect
-%
-% \def\xfiveencodedaa%
-% {\accent23a}
-%
-% \def\xfiveencodedAA%
-% {\leavevmode
-% \setbox\zerocount\hbox{h}%
-% \dimen@\ht\zerocount
-% \advance\dimen@ -1ex
-% \rlap{\raise.67\dimen@\hbox{\char23}}A}
-%
-% \protect
-%
-% \quotesinglbase 13
-% \guilsinglleft 14
-% \guilsinglright 15
-% \textquotedblleft 16
-% \textquotedblright 17
-% \quotedblbase 18
-% \guillemotleft 19
-% \guillemotright 20
-% \textendash 21
-% \textemdash 22
-% \textcompwordmark 23
-% \textperthousand \% \char 24
-% \textpertenthousand \%\char 24\char 24
-% \textvisiblespace 32
-% \textquotedbl `\"
-% \textdollar `\$
-% \textquoteright `\'
-% \textless `\<
-% \textgreater `\>
-% \textbackslash `\
-% \textasciicircum `\^
-% \textunderscore 95
-% \textquoteleft `\`
-% \textbraceleft `\{
-% \textbar `\|
-% \textbraceright `\}
-% \textasciitilde `\~
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-tbo.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-tbo.mkii
deleted file mode 100644
index 5733acd32e0..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-tbo.mkii
+++ /dev/null
@@ -1,222 +0,0 @@
-%D \module
-%D [ file=enco-tbo,
-%D version=2000.05.07, % 2001.8.4,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=TeXBaseOne Encoding,
-%D author={Patrick Gundlach, Hans Hagen},
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\startmapping[8r]
-
-\resetcaserange 128 to 255
-
-\definecasemap 228 228 196 \definecasemap 196 228 196
-\definecasemap 235 235 203 \definecasemap 203 235 203
-\definecasemap 239 239 207 \definecasemap 207 239 207
-\definecasemap 246 246 214 \definecasemap 214 246 214
-\definecasemap 252 252 220 \definecasemap 220 252 220
-\definecasemap 255 255 159 \definecasemap 159 255 159
-
-\definecasemap 225 225 193 \definecasemap 193 225 193
-\definecasemap 233 233 201 \definecasemap 201 233 201
-\definecasemap 237 237 205 \definecasemap 205 237 205
-\definecasemap 243 243 211 \definecasemap 211 243 211
-\definecasemap 250 250 218 \definecasemap 218 250 218
-\definecasemap 253 253 221 \definecasemap 221 253 221
-
-\definecasemap 224 224 192 \definecasemap 192 224 192
-\definecasemap 232 232 200 \definecasemap 200 232 200
-\definecasemap 236 236 204 \definecasemap 204 236 204
-\definecasemap 242 242 210 \definecasemap 210 242 210
-\definecasemap 249 249 217 \definecasemap 217 249 217
-
-\definecasemap 226 226 194 \definecasemap 194 226 194
-\definecasemap 234 234 202 \definecasemap 202 234 202
-\definecasemap 238 238 206 \definecasemap 206 238 206
-\definecasemap 244 244 212 \definecasemap 212 244 212
-\definecasemap 251 251 219 \definecasemap 219 251 219
-
-\definecasemap 227 227 195 \definecasemap 195 227 195
-\definecasemap 241 241 209 \definecasemap 209 241 209
-\definecasemap 245 245 213 \definecasemap 213 245 213
-
-\stopmapping
-
-\startencoding[8r]
-
-\definecharacter textacute 180
-\definecharacter textbreve 11
-\definecharacter textcaron 16
-\definecharacter textcedilla 184
-\definecharacter textcircumflex 136
-\definecharacter textdiaeresis 168
-\definecharacter textdotaccent 1
-\definecharacter textgrave 30
-\definecharacter texthungarumlaut 5
-\definecharacter textmacron 175
-\definecharacter textogonek 8
-\definecharacter textring 9
-\definecharacter texttilde 152
-
-\definecharacter dotlessi 17
-%definecharacter dotlessj 18
-
-\definecharacter endash 150
-\definecharacter emdash 151
-
-\definecharacter oeligature 156
-\definecharacter OEligature 140
-\definecharacter aeligature 230
-\definecharacter AEligature 198
-
-\definecharacter ssharp 223
-
-\definecharacter thorn 254
-\definecharacter Thorn 222
-
-\definecharacter exclamdown 161
-\definecharacter questiondown 191
-
-\definecharacter copyright 169
-\definecharacter registered 174
-\definecharacter trademark 153
-
-\definecharacter sectionmark 167
-\definecharacter paragraphmark 182
-
-\definecharacter onequarter 188
-\definecharacter onehalf 189
-\definecharacter threequarter 190
-\definecharacter onesuperior 185
-\definecharacter twosuperior 178
-\definecharacter threesuperior 179
-
-\definecharacter textcent 162
-\definecharacter textcurrency 164
-\definecharacter texteuro 128
-\definecharacter textflorin 131
-\definecharacter textsterling 163
-\definecharacter textyen 165
-
-\definecharacter percent 37
-\definecharacter perthousand 137
-
-\definecharacter periodcentered 183
-\definecharacter softhyphen 173
-
-\definecharacter textasciicircum 94
-\definecharacter textasciitilde 126
-\definecharacter textslash 47
-\definecharacter textbackslash 92
-\definecharacter textbraceleft 123
-\definecharacter textbraceright 125
-\definecharacter textunderscore 95
-
-\definecharacter textbrokenbar 166
-\definecharacter textbullet 149
-\definecharacter textdag 134
-\definecharacter textddag 135
-\definecharacter textdegree 176
-\definecharacter textdiv 247
-\definecharacter textellipsis 133
-\definecharacter textfraction 4
-\definecharacter textlognot 172
-\definecharacter textminus 12
-\definecharacter textmu 181
-\definecharacter textmultiply 215
-\definecharacter textpm 177
-
-\definecharacter quotedbl 34
-\definecharacter quotedblbase 132
-\definecharacter quotedblleft 147
-\definecharacter quotedblright 148
-
-\definecharacter quotesingle 31
-\definecharacter quotesinglebase 130
-
-\definecharacter quoteleft 96
-\definecharacter quoteright 39
-
-\definecharacter guilsingleleft 139
-\definecharacter guilsingleright 155
-\definecharacter leftguillemot 171
-\definecharacter rightguillemot 187
-
-\definecharacter aacute 225
-\definecharacter Aacute 193
-\definecharacter eacute 233
-\definecharacter Eacute 201
-\definecharacter iacute 237
-\definecharacter Iacute 205
-\definecharacter oacute 243
-\definecharacter Oacute 211
-\definecharacter uacute 250
-\definecharacter Uacute 218
-\definecharacter Yacute 221
-\definecharacter yacute 253
-
-\definecharacter scaron 154
-\definecharacter Scaron 138
-%definecharacter Zcaron 141
-
-\definecharacter ccedilla 231
-\definecharacter Ccedilla 199
-
-\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 255
-\definecharacter Ydiaeresis 159
-
-\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 aring 229
-\definecharacter Aring 197
-
-\definecharacter lstroke 7
-\definecharacter Lstroke 6
-\definecharacter ostroke 248
-\definecharacter Ostroke 216
-
-\definecharacter atilde 227
-\definecharacter Atilde 195
-\definecharacter ntilde 241
-\definecharacter Ntilde 209
-\definecharacter otilde 245
-\definecharacter Otilde 213
-
-\stopencoding
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-uc.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-uc.mkii
deleted file mode 100644
index f39260b16d0..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-uc.mkii
+++ /dev/null
@@ -1,1093 +0,0 @@
-%D \module
-%D [ file=enco-uc,
-%D version=2000.xx.xx, % and later
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=Unicode (backwards mapping),
-%D author={Adam Lindsay \& Hans Hagen},
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 An alternative approach would be to misuse the utf vectors, but they
-%D don't carry enough info around.
-
-% todo : \defineucharacter hebrewAlef 5 "D0
-
-\startencoding[uc]
-
-\definecharacter Agrave {\uchar0{192}}
-\definecharacter Aacute {\uchar0{193}}
-\definecharacter Acircumflex {\uchar0{194}}
-\definecharacter Atilde {\uchar0{195}}
-\definecharacter Adiaeresis {\uchar0{196}}
-\definecharacter Aring {\uchar0{197}}
-\definecharacter AEligature {\uchar0{198}}
-\definecharacter Ccedilla {\uchar0{199}}
-\definecharacter Egrave {\uchar0{200}}
-\definecharacter Eacute {\uchar0{201}}
-\definecharacter Ediaeresis {\uchar0{203}}
-\definecharacter Igrave {\uchar0{204}}
-\definecharacter Iacute {\uchar0{205}}
-\definecharacter Icircumflex {\uchar0{206}}
-\definecharacter Idiaeresis {\uchar0{207}}
-\definecharacter Eth {\uchar0{208}}
-\definecharacter Ntilde {\uchar0{209}}
-\definecharacter Ograve {\uchar0{210}}
-\definecharacter Oacute {\uchar0{211}}
-\definecharacter Ocircumflex {\uchar0{212}}
-\definecharacter Otilde {\uchar0{213}}
-\definecharacter Odiaeresis {\uchar0{214}}
-
-\definecharacter Ostroke {\uchar0{216}}
-\definecharacter Ugrave {\uchar0{217}}
-\definecharacter Uacute {\uchar0{218}}
-\definecharacter Uhungarumlaut {\uchar0{219}}
-\definecharacter Udiaeresis {\uchar0{220}}
-\definecharacter Yacute {\uchar0{221}}
-\definecharacter Thorn {\uchar0{222}}
-\definecharacter ssharp {\uchar0{223}}
-\definecharacter agrave {\uchar0{224}}
-\definecharacter aacute {\uchar0{225}}
-\definecharacter acircumflex {\uchar0{226}}
-\definecharacter atilde {\uchar0{227}}
-\definecharacter adiaeresis {\uchar0{228}}
-\definecharacter aring {\uchar0{229}}
-\definecharacter aeligature {\uchar0{230}}
-\definecharacter ccedilla {\uchar0{231}}
-\definecharacter egrave {\uchar0{232}}
-\definecharacter eacute {\uchar0{233}}
-\definecharacter ecircumflex {\uchar0{234}}
-\definecharacter ediaeresis {\uchar0{235}}
-\definecharacter igrave {\uchar0{236}}
-\definecharacter iacute {\uchar0{237}}
-\definecharacter icircumflex {\uchar0{238}}
-\definecharacter idiaeresis {\uchar0{239}}
-\definecharacter eth {\uchar0{240}}
-\definecharacter ntilde {\uchar0{241}}
-\definecharacter ograve {\uchar0{242}}
-\definecharacter oacute {\uchar0{243}}
-\definecharacter ocircumflex {\uchar0{244}}
-\definecharacter otilde {\uchar0{245}}
-\definecharacter odiaeresis {\uchar0{246}}
-
-\definecharacter ostroke {\uchar0{248}}
-\definecharacter ugrave {\uchar0{249}}
-\definecharacter uacute {\uchar0{250}}
-\definecharacter ucircumflex {\uchar0{251}}
-\definecharacter udiaeresis {\uchar0{252}}
-\definecharacter yacute {\uchar0{253}}
-\definecharacter thorn {\uchar0{254}}
-\definecharacter ydiaeresis {\uchar0{255}}
-
-\definecharacter Amacron {\uchar1{0}}
-\definecharacter amacron {\uchar1{1}}
-\definecharacter Abreve {\uchar1{2}}
-\definecharacter abreve {\uchar1{3}}
-\definecharacter Aogonek {\uchar1{4}}
-\definecharacter aogonek {\uchar1{5}}
-\definecharacter Cacute {\uchar1{6}}
-\definecharacter cacute {\uchar1{7}}
-\definecharacter Ccircumflex {\uchar1{8}}
-\definecharacter ccircumflex {\uchar1{9}}
-\definecharacter Cdotaccent {\uchar1{10}}
-\definecharacter cdotaccent {\uchar1{11}}
-\definecharacter Ccaron {\uchar1{12}}
-\definecharacter ccaron {\uchar1{13}}
-\definecharacter Dcaron {\uchar1{14}}
-\definecharacter dcaron {\uchar1{15}}
-\definecharacter Dstroke {\uchar1{16}}
-\definecharacter dstroke {\uchar1{17}}
-\definecharacter Emacron {\uchar1{18}}
-\definecharacter emacron {\uchar1{19}}
-\definecharacter Ebreve {\uchar1{20}}
-\definecharacter ebreve {\uchar1{21}}
-\definecharacter Edotaccent {\uchar1{22}}
-\definecharacter edotaccent {\uchar1{23}}
-\definecharacter Eogonek {\uchar1{24}}
-\definecharacter eogonek {\uchar1{25}}
-\definecharacter Ecaron {\uchar1{26}}
-\definecharacter ecaron {\uchar1{27}}
-\definecharacter Gcircumflex {\uchar1{28}}
-\definecharacter gcircumflex {\uchar1{29}}
-\definecharacter Gbreve {\uchar1{30}}
-\definecharacter gbreve {\uchar1{31}}
-\definecharacter Gdotaccent {\uchar1{32}}
-\definecharacter gdotaccent {\uchar1{33}}
-\definecharacter Gcommaaccent {\uchar1{34}}
-\definecharacter gcommaaccent {\uchar1{35}}
-\definecharacter Hcircumflex {\uchar1{36}}
-\definecharacter hcircumflex {\uchar1{37}}
-\definecharacter Hstroke {\uchar1{38}}
-\definecharacter hstroke {\uchar1{39}}
-\definecharacter Itilde {\uchar1{40}}
-\definecharacter itilde {\uchar1{41}}
-\definecharacter Imacron {\uchar1{42}}
-\definecharacter imacron {\uchar1{43}}
-\definecharacter Ibreve {\uchar1{44}}
-\definecharacter ibreve {\uchar1{45}}
-\definecharacter Iogonek {\uchar1{46}}
-\definecharacter iogonek {\uchar1{47}}
-\definecharacter Idotaccent {\uchar1{48}}
-\definecharacter dotlessi {\uchar1{49}}
-\definecharacter IJligature {\uchar1{50}}
-\definecharacter ijligature {\uchar1{51}}
-\definecharacter Jcircumflex {\uchar1{52}}
-\definecharacter jcircumflex {\uchar1{53}}
-\definecharacter Kcommaaccent {\uchar1{54}}
-\definecharacter kcommaaccent {\uchar1{55}}
-\definecharacter kkra {\uchar1{56}}
-\definecharacter Lacute {\uchar1{57}}
-\definecharacter lacute {\uchar1{58}}
-\definecharacter Lcommaaccent {\uchar1{59}}
-\definecharacter lcommaaccent {\uchar1{60}}
-\definecharacter Lcaron {\uchar1{61}}
-\definecharacter lcaron {\uchar1{62}}
-\definecharacter Ldotmiddle {\uchar1{63}}
-\definecharacter ldotmiddle {\uchar1{64}}
-\definecharacter Lstroke {\uchar1{65}}
-\definecharacter lstroke {\uchar1{66}}
-\definecharacter Nacute {\uchar1{67}}
-\definecharacter nacute {\uchar1{68}}
-\definecharacter Ncommaaccent {\uchar1{69}}
-\definecharacter ncommaaccent {\uchar1{70}}
-\definecharacter Ncaron {\uchar1{71}}
-\definecharacter ncaron {\uchar1{72}}
-\definecharacter napostrophe {\uchar1{73}}
-\definecharacter Neng {\uchar1{74}}
-\definecharacter neng {\uchar1{75}}
-\definecharacter Omacron {\uchar1{76}}
-\definecharacter omacron {\uchar1{77}}
-\definecharacter Obreve {\uchar1{78}}
-\definecharacter obreve {\uchar1{79}}
-\definecharacter Ohungarumlaut {\uchar1{80}}
-\definecharacter ohungarumlaut {\uchar1{81}}
-\definecharacter OEligature {\uchar1{82}}
-\definecharacter oeligature {\uchar1{83}}
-\definecharacter Racute {\uchar1{84}}
-\definecharacter racute {\uchar1{85}}
-\definecharacter Rcommaaccent {\uchar1{86}}
-\definecharacter rcommaaccent {\uchar1{87}}
-\definecharacter Rcaron {\uchar1{88}}
-\definecharacter rcaron {\uchar1{89}}
-\definecharacter Sacute {\uchar1{90}}
-\definecharacter sacute {\uchar1{91}}
-\definecharacter Scircumflex {\uchar1{92}}
-\definecharacter scircumflex {\uchar1{93}}
-\definecharacter Scedilla {\uchar1{94}}
-\definecharacter scedilla {\uchar1{95}}
-\definecharacter Scaron {\uchar1{96}}
-\definecharacter scaron {\uchar1{97}}
-\definecharacter Tcedilla {\uchar1{98}}
-\definecharacter tcedilla {\uchar1{99}}
-\definecharacter Tcaron {\uchar1{100}}
-\definecharacter tcaron {\uchar1{101}}
-\definecharacter Tstroke {\uchar1{102}}
-\definecharacter tstroke {\uchar1{103}}
-\definecharacter Utilde {\uchar1{104}}
-\definecharacter utilde {\uchar1{105}}
-\definecharacter Umacron {\uchar1{106}}
-\definecharacter umacron {\uchar1{107}}
-\definecharacter Ubreve {\uchar1{108}}
-\definecharacter ubreve {\uchar1{109}}
-\definecharacter Uring {\uchar1{110}}
-\definecharacter uring {\uchar1{111}}
-\definecharacter Uhungarumlaut {\uchar1{112}}
-\definecharacter uhungarumlaut {\uchar1{113}}
-\definecharacter Uogonek {\uchar1{114}}
-\definecharacter uogonek {\uchar1{115}}
-\definecharacter Wcircumflex {\uchar1{116}}
-\definecharacter wcircumflex {\uchar1{117}}
-\definecharacter Ycircumflex {\uchar1{118}}
-\definecharacter ycircumflex {\uchar1{119}}
-\definecharacter Ydiaeresis {\uchar1{120}}
-\definecharacter Zacute {\uchar1{121}}
-\definecharacter zacute {\uchar1{122}}
-\definecharacter Zdotaccent {\uchar1{123}}
-\definecharacter zdotaccent {\uchar1{124}}
-\definecharacter Zcaron {\uchar1{125}}
-\definecharacter zcaron {\uchar1{126}}
-\definecharacter slong {\uchar1{127}}
-
-\stopencoding
-
-\startencoding[uc]
-
-\definecharacter endash {\uchar{32}{19}}
-\definecharacter emdash {\uchar{32}{20}}
-\definecharacter quoteleft {\uchar{32}{24}}
-\definecharacter quoteright {\uchar{32}{25}}
-\definecharacter quotesinglebase {\uchar{32}{26}}
-
-\definecharacter quotedblleft {\uchar{32}{28}}
-\definecharacter quotedblright {\uchar{32}{29}}
-\definecharacter quotedblbase {\uchar{32}{30}}
-
-\definecharacter leftguillemot {\uchar0{171}}
-\definecharacter rightguillemot {\uchar0{187}}
-
-\definecharacter guilsingleleft {\uchar{32}{57}}
-\definecharacter guilsingleright {\uchar{32}{58}}
-
-\stopencoding
-
-%D Adam Lindsay's additions
-
-\startencoding[uc]
-
-\definecharacter exclamdown {\uchar0{161}}
-\definecharacter textcent {\uchar0{162}}
-\definecharacter textsterling {\uchar0{163}}
-\definecharacter textcurrency {\uchar0{164}}
-\definecharacter textyen {\uchar0{165}}
-\definecharacter textbrokenbar {\uchar0{166}}
-\definecharacter sectionmark {\uchar0{167}}
-\definecharacter textdiaresis {\uchar0{168}}
-\definecharacter copyright {\uchar0{169}}
-
-\definecharacter textlognot {\uchar0{172}}
-\definecharacter softhyphen {\uchar0{173}}
-\definecharacter registered {\uchar0{174}}
-\definecharacter textmacron {\uchar0{175}}
-\definecharacter textdegree {\uchar0{176}}
-\definecharacter textpm {\uchar0{177}}
-\definecharacter twosuperior {\uchar0{178}}
-\definecharacter threesuperior {\uchar0{179}}
-\definecharacter textacute {\uchar0{180}}
-\definecharacter textmu {\uchar0{181}}
-\definecharacter paragraphmark {\uchar0{182}}
-\definecharacter periodcentered {\uchar0{183}}
-\definecharacter textcedilla {\uchar0{184}}
-\definecharacter onesuperior {\uchar0{185}}
-
-\definecharacter textgrave {\uchar3{0}}
-\definecharacter textacute {\uchar3{1}}
-\definecharacter textcircumflex {\uchar3{2}}
-\definecharacter texttilde {\uchar3{3}}
-\definecharacter textmacron {\uchar3{4}}
-\definecharacter textbreve {\uchar3{6}}
-\definecharacter textdotaccent {\uchar3{7}}
-\definecharacter textdiaeresis {\uchar3{8}}
-\definecharacter textring {\uchar3{10}}
-\definecharacter texthungarumlaut {\uchar3{11}}
-\definecharacter textcaron {\uchar3{12}}
-\definecharacter textogonek {\uchar3{40}}
-
-\definecharacter percent {\uchar0{37}}
-\definecharacter textunderscore {\uchar0{95}}
-
-\definecharacter ordfeminine {\uchar0{170}}
-\definecharacter ordmasculine {\uchar0{186}}
-\definecharacter onequarter {\uchar0{188}}
-\definecharacter onehalf {\uchar0{189}}
-\definecharacter threequarter {\uchar0{190}}
-\definecharacter questiondown {\uchar0{191}}
-
-\definecharacter textmultiply {\uchar0{215}}
-\definecharacter textdiv {\uchar0{247}}
-
-\definecharacter textminus {\uchar{32}{18}}
-\definecharacter textdag {\uchar{32}{32}}
-\definecharacter textddag {\uchar{32}{33}}
-\definecharacter textbullet {\uchar{32}{34}}
-\definecharacter textellipsis {\uchar{32}{38}}
-\definecharacter perthousand {\uchar{32}{48}}
-
-%new:
-\definecharacter Scommaaccent {\uchar2{24}}
-\definecharacter scommaaccent {\uchar2{25}}
-\definecharacter Tcommaaccent {\uchar2{26}}
-\definecharacter tcommaaccent {\uchar2{27}}
-
-\stopencoding
-
-%D Mojca's and Taco's additions:
-
-\startencoding[uc]
-
-\definecharacter textasciicircum {\uchar{0}{94}} % 5e
-\definecharacter textgrave {\uchar{0}{96}} % 60
-\definecharacter textdiaeresis {\uchar{0}{168}} % a8
-%definecharacter textmacron {\uchar{0}{175}} % af
-%definecharacter textacute {\uchar{0}{180}} % b4
-%definecharacter textcedilla {\uchar{0}{184}} % b8
-\definecharacter textcircumflex {\uchar{2}{198}} % c6
-\definecharacter textcaron {\uchar{2}{199}} % c7
-\definecharacter textbreve {\uchar{2}{216}} % d8
-\definecharacter textdotaccent {\uchar{2}{217}} % d9
-\definecharacter textring {\uchar{2}{218}} % da
-\definecharacter textogonek {\uchar{2}{219}} % db
-\definecharacter texttilde {\uchar{2}{220}} % dc
-\definecharacter texthungarumlaut {\uchar{2}{221}} % dd
-
-\stopencoding
-
-%D Vietnamese:
-
-\startencoding[uc]
-
-\definecharacter Ohorn {\uchar1{160}}
-\definecharacter ohorn {\uchar1{161}}
-\definecharacter Uhorn {\uchar1{175}}
-\definecharacter uhorn {\uchar1{176}}
-
-\definecharacter Yhook {\uchar{30}{246}}
-\definecharacter yhook {\uchar{30}{247}}
-\definecharacter Ydotbelow {\uchar{30}{244}}
-\definecharacter ydotbelow {\uchar{30}{245}}
-\definecharacter Ahook {\uchar{30}{162}}
-\definecharacter Adotbelow {\uchar{30}{160}}
-\definecharacter Acircumflexgrave {\uchar{30}{166}}
-\definecharacter Acircumflexacute {\uchar{30}{164}}
-\definecharacter Acircumflextilde {\uchar{30}{170}}
-\definecharacter Acircumflexhook {\uchar{30}{168}}
-\definecharacter Acircumflexdotbelow {\uchar{30}{172}}
-\definecharacter Abrevegrave {\uchar{30}{176}}
-\definecharacter Abreveacute {\uchar{30}{174}}
-\definecharacter Abrevetilde {\uchar{30}{180}}
-\definecharacter Abrevehook {\uchar{30}{178}}
-\definecharacter Abrevedotbelow {\uchar{30}{182}}
-\definecharacter Ehook {\uchar{30}{186}}
-\definecharacter Edotbelow {\uchar{30}{184}}
-\definecharacter Ecircumflexgrave {\uchar{30}{192}}
-\definecharacter Ecircumflexacute {\uchar{30}{190}}
-\definecharacter Ecircumflextilde {\uchar{30}{196}}
-\definecharacter Ecircumflexhook {\uchar{30}{194}}
-\definecharacter Ecircumflexdotbelow {\uchar{30}{198}}
-\definecharacter Ihook {\uchar{30}{200}}
-\definecharacter ahook {\uchar{30}{163}}
-\definecharacter adotbelow {\uchar{30}{161}}
-\definecharacter acircumflexgrave {\uchar{30}{167}}
-\definecharacter acircumflexacute {\uchar{30}{165}}
-\definecharacter acircumflextilde {\uchar{30}{171}}
-\definecharacter acircumflexhook {\uchar{30}{169}}
-\definecharacter acircumflexdotbelow {\uchar{30}{173}}
-\definecharacter abrevegrave {\uchar{30}{177}}
-\definecharacter abreveacute {\uchar{30}{175}}
-\definecharacter abrevetilde {\uchar{30}{181}}
-\definecharacter abrevehook {\uchar{30}{179}}
-\definecharacter abrevedotbelow {\uchar{30}{183}}
-\definecharacter ehook {\uchar{30}{187}}
-\definecharacter edotbelow {\uchar{30}{185}}
-\definecharacter ecircumflexgrave {\uchar{30}{193}}
-\definecharacter ecircumflexacute {\uchar{30}{191}}
-\definecharacter ecircumflextilde {\uchar{30}{197}}
-\definecharacter ecircumflexhook {\uchar{30}{195}}
-\definecharacter ecircumflexdotbelow {\uchar{30}{199}}
-\definecharacter ihook {\uchar{30}{201}}
-\definecharacter Idotbelow {\uchar{30}{202}}
-\definecharacter Ohook {\uchar{30}{206}}
-\definecharacter Odotbelow {\uchar{30}{204}}
-\definecharacter Ocircumflexgrave {\uchar{30}{210}}
-\definecharacter Ocircumflexacute {\uchar{30}{208}}
-\definecharacter Ocircumflextilde {\uchar{30}{214}}
-\definecharacter Ocircumflexhook {\uchar{30}{212}}
-\definecharacter Ocircumflexdotbelow {\uchar{30}{216}}
-\definecharacter Ohorngrave {\uchar{30}{220}}
-\definecharacter Ohornacute {\uchar{30}{218}}
-\definecharacter Ohorntilde {\uchar{30}{224}}
-\definecharacter Ohornhook {\uchar{30}{222}}
-\definecharacter Ohorndotbelow {\uchar{30}{226}}
-\definecharacter Uhook {\uchar{30}{230}}
-\definecharacter Udotbelow {\uchar{30}{228}}
-\definecharacter Uhorngrave {\uchar{30}{234}}
-\definecharacter Uhornacute {\uchar{30}{232}}
-\definecharacter Uhorntilde {\uchar{30}{238}}
-\definecharacter Uhornhook {\uchar{30}{236}}
-\definecharacter Uhorndotbelow {\uchar{30}{240}}
-\definecharacter Ytilde {\uchar{30}{248}}
-\definecharacter idotbelow {\uchar{30}{203}}
-\definecharacter ohook {\uchar{30}{207}}
-\definecharacter odotbelow {\uchar{30}{205}}
-\definecharacter ocircumflexgrave {\uchar{30}{211}}
-\definecharacter ocircumflexacute {\uchar{30}{209}}
-\definecharacter ocircumflextilde {\uchar{30}{215}}
-\definecharacter ocircumflexhook {\uchar{30}{213}}
-\definecharacter ocircumflexdotbelow {\uchar{30}{217}}
-\definecharacter ohorngrave {\uchar{30}{221}}
-\definecharacter ohornacute {\uchar{30}{219}}
-\definecharacter ohorntilde {\uchar{30}{225}}
-\definecharacter ohornhook {\uchar{30}{223}}
-\definecharacter ohorndotbelow {\uchar{30}{227}}
-\definecharacter uhook {\uchar{30}{231}}
-\definecharacter udotbelow {\uchar{30}{229}}
-\definecharacter uhorngrave {\uchar{30}{235}}
-\definecharacter uhornacute {\uchar{30}{233}}
-\definecharacter uhorntilde {\uchar{30}{239}}
-\definecharacter uhornhook {\uchar{30}{237}}
-\definecharacter uhorndotbelow {\uchar{30}{241}}
-\definecharacter ytilde {\uchar{30}{249}}
-
-\definecharacter Etilde {\uchar{30}{188}}
-\definecharacter etilde {\uchar{30}{189}}
-\definecharacter Ygrave {\uchar{30}{242}}
-\definecharacter ygrave {\uchar{30}{243}}
-
-\stopencoding
-
-% Greek:
-
-\startencoding[uc]
-
-\definecharacter greekAlphatonos {\uchar3{134}}
-\definecharacter greekEpsilontonos {\uchar3{136}}
-\definecharacter greekEtatonos {\uchar3{137}}
-\definecharacter greekIotatonos {\uchar3{138}}
-\definecharacter greekOmicrontonos {\uchar3{140}}
-\definecharacter greekUpsilontonos {\uchar3{142}}
-\definecharacter greekOmegatonos {\uchar3{143}}
-\definecharacter greekiotadialytikatonos {\uchar3{144}}
-\definecharacter greekAlpha {\uchar3{145}}
-\definecharacter greekBeta {\uchar3{146}}
-\definecharacter greekGamma {\uchar3{147}}
-\definecharacter greekDelta {\uchar3{148}}
-\definecharacter greekEpsilon {\uchar3{149}}
-\definecharacter greekZeta {\uchar3{150}}
-\definecharacter greekEta {\uchar3{151}}
-\definecharacter greekTheta {\uchar3{152}}
-\definecharacter greekIota {\uchar3{153}}
-\definecharacter greekKappa {\uchar3{154}}
-\definecharacter greekLambda {\uchar3{155}}
-\definecharacter greekMu {\uchar3{156}}
-\definecharacter greekNu {\uchar3{157}}
-\definecharacter greekXi {\uchar3{158}}
-\definecharacter greekOmicron {\uchar3{159}}
-\definecharacter greekPi {\uchar3{160}}
-\definecharacter greekRho {\uchar3{161}}
-\definecharacter greekSigma {\uchar3{163}}
-\definecharacter greekTau {\uchar3{164}}
-\definecharacter greekUpsilon {\uchar3{165}}
-\definecharacter greekPhi {\uchar3{166}}
-\definecharacter greekChi {\uchar3{167}}
-\definecharacter greekPsi {\uchar3{168}}
-\definecharacter greekOmega {\uchar3{169}}
-
-\definecharacter greekalpha {\uchar3{177}}
-\definecharacter greekbeta {\uchar3{178}}
-\definecharacter greekgamma {\uchar3{179}}
-\definecharacter greekdelta {\uchar3{180}}
-\definecharacter greekepsilon {\uchar3{181}}
-\definecharacter greekzeta {\uchar3{182}}
-\definecharacter greeketa {\uchar3{183}}
-\definecharacter greektheta {\uchar3{184}}
-\definecharacter greekiota {\uchar3{185}}
-\definecharacter greekkappa {\uchar3{186}}
-\definecharacter greeklambda {\uchar3{187}}
-\definecharacter greekmu {\uchar3{188}}
-\definecharacter greeknu {\uchar3{189}}
-\definecharacter greekxi {\uchar3{190}}
-\definecharacter greekomicron {\uchar3{191}}
-\definecharacter greekpi {\uchar3{192}}
-\definecharacter greekrho {\uchar3{193}}
-\definecharacter greekfinalsigma {\uchar3{194}}
-\definecharacter greeksigma {\uchar3{195}}
-\definecharacter greektau {\uchar3{196}}
-\definecharacter greekupsilon {\uchar3{197}}
-\definecharacter greekphi {\uchar3{198}}
-\definecharacter greekchi {\uchar3{199}}
-\definecharacter greekpsi {\uchar3{200}}
-\definecharacter greekomega {\uchar3{201}}
-\definecharacter greekiotadialytika {\uchar3{202}}
-\definecharacter greekupsilondialytika {\uchar3{203}}
-\definecharacter greekomicrontonos {\uchar3{204}}
-\definecharacter greekupsilontonos {\uchar3{205}}
-\definecharacter greekomegatonos {\uchar3{206}}
-
-\definecharacter greekIotadialytika {\uchar3{170}}
-\definecharacter greekUpsilondialytika {\uchar3{171}}
-
-\definecharacter greekalphatonos {\uchar3{172}}
-\definecharacter greekepsilontonos {\uchar3{173}}
-\definecharacter greeketatonos {\uchar3{174}}
-\definecharacter greekiotatonos {\uchar3{175}}
-\definecharacter greekupsilondialytikatonos {\uchar3{176}}
-
-% new:
-
-\definecharacter greekbetaalt {\uchar3{208}}
-\definecharacter greekthetaalt {\uchar3{209}}
-\definecharacter greekphialt {\uchar3{213}}
-\definecharacter greekpialt {\uchar3{214}}
-\definecharacter greekrhoalt {\uchar3{241}}
-\definecharacter greekepsilonalt {\uchar3{245}}
-
-\stopencoding
-
-% Cyrillic:
-
-\startencoding[uc]
-
-\definecharacter cyrillicA {\uchar4{16}}
-\definecharacter cyrillicB {\uchar4{17}}
-\definecharacter cyrillicV {\uchar4{18}}
-\definecharacter cyrillicG {\uchar4{19}}
-\definecharacter cyrillicD {\uchar4{20}}
-\definecharacter cyrillicE {\uchar4{21}}
-\definecharacter cyrillicZH {\uchar4{22}}
-\definecharacter cyrillicZ {\uchar4{23}}
-\definecharacter cyrillicI {\uchar4{24}}
-\definecharacter cyrillicISHRT {\uchar4{25}}
-\definecharacter cyrillicK {\uchar4{26}}
-\definecharacter cyrillicL {\uchar4{27}}
-\definecharacter cyrillicM {\uchar4{28}}
-\definecharacter cyrillicN {\uchar4{29}}
-\definecharacter cyrillicO {\uchar4{30}}
-\definecharacter cyrillicP {\uchar4{31}}
-\definecharacter cyrillicR {\uchar4{32}}
-\definecharacter cyrillicS {\uchar4{33}}
-\definecharacter cyrillicT {\uchar4{34}}
-\definecharacter cyrillicU {\uchar4{35}}
-\definecharacter cyrillicF {\uchar4{36}}
-\definecharacter cyrillicH {\uchar4{37}}
-\definecharacter cyrillicC {\uchar4{38}}
-\definecharacter cyrillicCH {\uchar4{39}}
-\definecharacter cyrillicSH {\uchar4{40}}
-\definecharacter cyrillicSHCH {\uchar4{41}}
-\definecharacter cyrillicHRDSN {\uchar4{42}}
-\definecharacter cyrillicERY {\uchar4{43}}
-\definecharacter cyrillicSFTSN {\uchar4{44}}
-\definecharacter cyrillicEREV {\uchar4{45}}
-\definecharacter cyrillicYU {\uchar4{46}}
-\definecharacter cyrillicYA {\uchar4{47}}
-
-\definecharacter cyrillica {\uchar4{48}}
-\definecharacter cyrillicb {\uchar4{49}}
-\definecharacter cyrillicv {\uchar4{50}}
-\definecharacter cyrillicg {\uchar4{51}}
-\definecharacter cyrillicd {\uchar4{52}}
-\definecharacter cyrillice {\uchar4{53}}
-\definecharacter cyrilliczh {\uchar4{54}}
-\definecharacter cyrillicz {\uchar4{55}}
-\definecharacter cyrillici {\uchar4{56}}
-\definecharacter cyrillicishrt {\uchar4{57}}
-\definecharacter cyrillick {\uchar4{58}}
-\definecharacter cyrillicl {\uchar4{59}}
-\definecharacter cyrillicm {\uchar4{60}}
-\definecharacter cyrillicn {\uchar4{61}}
-\definecharacter cyrillico {\uchar4{62}}
-\definecharacter cyrillicp {\uchar4{63}}
-\definecharacter cyrillicr {\uchar4{64}}
-\definecharacter cyrillics {\uchar4{65}}
-\definecharacter cyrillict {\uchar4{66}}
-\definecharacter cyrillicu {\uchar4{67}}
-\definecharacter cyrillicf {\uchar4{68}}
-\definecharacter cyrillich {\uchar4{69}}
-\definecharacter cyrillicc {\uchar4{70}}
-\definecharacter cyrillicch {\uchar4{71}}
-\definecharacter cyrillicsh {\uchar4{72}}
-\definecharacter cyrillicshch {\uchar4{73}}
-\definecharacter cyrillichrdsn {\uchar4{74}}
-\definecharacter cyrillicery {\uchar4{75}}
-\definecharacter cyrillicsftsn {\uchar4{76}}
-\definecharacter cyrillicerev {\uchar4{77}}
-\definecharacter cyrillicyu {\uchar4{78}}
-\definecharacter cyrillicya {\uchar4{79}}
-
-%D I tried to figure out what these were, but the unicode
-%D tables suggested they were the same as cyrillici, which was
-%D already defined! So, a temporary definition:
-
-% \def\cyrillicII{\cyrillicI}
-% \def\cyrillicii{\cyrillici}
-
-%D a guess derived from looking at enco-cyr suggests that this is
-%D identical to the Roman I/i pair. To me, that sounds like
-%D CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I in the UC tables!
-
-\definecharacter cyrillicII {\uchar4{6}}
-\definecharacter cyrillicii {\uchar4{86}}
-
-%D Guessing that tlir6a corresponds with t2a encoding as advertised,
-%D here are some more, cos I had some spare time: (AL)
-
-\definecharacter cyrillicDJE {\uchar4{2}}
-\definecharacter cyrillicTSHE {\uchar4{11}}
-%definecharacter cyrillicSHHA 132
-%definecharacter cyrillicZHDSC 133
-\definecharacter cyrillicZDSC {\uchar4{152}}
-\definecharacter cyrillicLJE {\uchar4{9}}
-\definecharacter cyrillicYI {\uchar4{7}}
-\definecharacter cyrillicAE {\uchar4{212}}
-%definecharacter cyrillicNDSC 141
-%definecharacter cyrillicNG 142
-\definecharacter cyrillicDZE {\uchar4{5}}
-%definecharacter cyrillicOTLD 144
-\definecharacter cyrillicSDSC {\uchar4{170}}
-\definecharacter cyrillicUSHRT {\uchar4{14}}
-%definecharacter cyrillicY 147
-%definecharacter cyrillicYHCRS 148
-%definecharacter cyrillicHDSC 149
-\definecharacter cyrillicDZHE {\uchar4{15}}
-\definecharacter cyrillicIE {\uchar4{4}}
-\definecharacter cyrillicNJE {\uchar4{10}}
-\definecharacter cyrillicYO {\uchar4{1}}
-
-\definecharacter cyrillicdje {\uchar4{82}}
-\definecharacter cyrillictshe {\uchar4{91}}
-%definecharacter cyrillicshha 164
-%definecharacter cyrilliczhdsc 165
-\definecharacter cyrilliczdsc {\uchar4{153}}
-\definecharacter cyrilliclje {\uchar4{89}}
-\definecharacter cyrillicyi {\uchar4{87}}
-\definecharacter cyrillicae {\uchar4{213}}
-%definecharacter cyrillicndsc 173
-%definecharacter cyrillicng 174
-\definecharacter cyrillicdze {\uchar4{85}}
-%definecharacter cyrillicotld 176
-\definecharacter cyrillicsdsc {\uchar4{171}}
-\definecharacter cyrillicushrt {\uchar4{94}}
-%definecharacter cyrillicy 179
-%definecharacter cyrillicyhcrs 180
-%definecharacter cyrillichdsc 181
-\definecharacter cyrillicdzhe {\uchar4{95}}
-\definecharacter cyrillicie {\uchar4{84}}
-\definecharacter cyrillicnje {\uchar4{90}}
-\definecharacter cyrillicyo {\uchar4{81}}
-
-% is there overlap with the above definitions
-
-\definecharacter cyrillicEgrave {\uchar4{0}}
-\definecharacter cyrillicGJE {\uchar4{3}}
-\definecharacter cyrillicJE {\uchar4{8}}
-\definecharacter cyrillicKJE {\uchar4{12}}
-\definecharacter cyrillicIgrave {\uchar4{13}}
-\definecharacter cyrillicegrave {\uchar4{80}}
-\definecharacter cyrillicgje {\uchar4{83}}
-\definecharacter cyrillicje {\uchar4{88}}
-\definecharacter cyrillickje {\uchar4{92}}
-\definecharacter cyrillicigrave {\uchar4{93}}
-\definecharacter cyrillicOMEGA {\uchar4{96}}
-\definecharacter cyrillicomega {\uchar4{97}}
-\definecharacter cyrillicYAT {\uchar4{98}}
-\definecharacter cyrillicyat {\uchar4{99}}
-\definecharacter cyrillicEiotified {\uchar4{100}}
-\definecharacter cyrilliceiotified {\uchar4{101}}
-\definecharacter cyrillicLITTLEYUS {\uchar4{102}}
-\definecharacter cyrilliclittleyus {\uchar4{103}}
-\definecharacter cyrillicLITTLEYUSiotified {\uchar4{104}}
-\definecharacter cyrilliclittleyusiotified {\uchar4{105}}
-\definecharacter cyrillicBIGYUS {\uchar4{106}}
-\definecharacter cyrillicbigyus {\uchar4{107}}
-\definecharacter cyrillicBIGYUSiotified {\uchar4{108}}
-\definecharacter cyrillicbigyusiotified {\uchar4{109}}
-\definecharacter cyrillicKSI {\uchar4{110}}
-\definecharacter cyrillicksi {\uchar4{111}}
-\definecharacter cyrillicPSI {\uchar4{112}}
-\definecharacter cyrillicpsi {\uchar4{113}}
-\definecharacter cyrillicFITA {\uchar4{114}}
-\definecharacter cyrillicfita {\uchar4{115}}
-\definecharacter cyrillicIZHITSA {\uchar4{116}}
-\definecharacter cyrillicizhitsa {\uchar4{117}}
-\definecharacter cyrillicIZHITSAdoublegrave {\uchar4{118}}
-\definecharacter cyrillicizhitsadoublegrave {\uchar4{119}}
-\definecharacter cyrillicUK {\uchar4{120}}
-\definecharacter cyrillicuk {\uchar4{121}}
-\definecharacter cyrillicOMEGAround {\uchar4{122}}
-\definecharacter cyrillicomegaround {\uchar4{123}}
-\definecharacter cyrillicOMEGAtitlo {\uchar4{124}}
-\definecharacter cyrillicomegatitlo {\uchar4{125}}
-\definecharacter cyrillicOT {\uchar4{126}}
-\definecharacter cyrillicot {\uchar4{127}}
-\definecharacter cyrillicKOPPA {\uchar4{128}}
-\definecharacter cyrillickoppa {\uchar4{129}}
-\definecharacter cyrillicTITLO {\uchar4{131}}
-\definecharacter cyrillicPALATALIZATION {\uchar4{132}}
-\definecharacter cyrillicDASIAPNEUMATA {\uchar4{133}}
-\definecharacter cyrillicPSILIPNEUMATA {\uchar4{134}}
-\definecharacter cyrillicISHRTtail {\uchar4{138}}
-\definecharacter cyrillicishrttail {\uchar4{139}}
-\definecharacter cyrillicSEMISOFT {\uchar4{140}}
-\definecharacter cyrillicsemisoft {\uchar4{141}}
-\definecharacter cyrillicERtick {\uchar4{142}}
-\definecharacter cyrillicertick {\uchar4{143}}
-\definecharacter cyrillicGHEupturn {\uchar4{144}}
-\definecharacter cyrillicgheupturn {\uchar4{145}}
-\definecharacter cyrillicGHEstroke {\uchar4{146}}
-\definecharacter cyrillicghestroke {\uchar4{147}}
-\definecharacter cyrillicGHEmidhook {\uchar4{148}}
-\definecharacter cyrillicghemidhook {\uchar4{149}}
-\definecharacter cyrillicZHEdescender {\uchar4{150}}
-\definecharacter cyrilliczhedescender {\uchar4{151}}
-\definecharacter cyrillicZDSC {\uchar4{152}}
-\definecharacter cyrilliczdsc {\uchar4{153}}
-\definecharacter cyrillicKADC {\uchar4{154}}
-\definecharacter cyrillickadc {\uchar4{155}}
-\definecharacter cyrillicKAvertstroke {\uchar4{156}}
-\definecharacter cyrillickavertstroke {\uchar4{157}}
-\definecharacter cyrillicKAstroke {\uchar4{158}}
-\definecharacter cyrillickastroke {\uchar4{159}}
-\definecharacter cyrillicKAbashkir {\uchar4{160}}
-\definecharacter cyrillickabashkir {\uchar4{161}}
-\definecharacter cyrillicENDC {\uchar4{162}}
-\definecharacter cyrillicendc {\uchar4{163}}
-\definecharacter cyrillicENGHE {\uchar4{164}}
-\definecharacter cyrillicenghe {\uchar4{165}}
-\definecharacter cyrillicPEmidhook {\uchar4{166}}
-\definecharacter cyrillicpemidhook {\uchar4{167}}
-\definecharacter cyrillicHA {\uchar4{168}}
-\definecharacter cyrillicha {\uchar4{169}}
-%definecharacter cyrillicSDSC {\uchar4{170}} % already defined
-%definecharacter cyrilliccdsc {\uchar4{171}} % already defined
-\definecharacter cyrillicTEDC {\uchar4{172}}
-\definecharacter cyrillictedc {\uchar4{173}}
-\definecharacter cyrillicYstr {\uchar4{174}}
-\definecharacter cyrillicystr {\uchar4{175}}
-\definecharacter cyrillicYstrstroke {\uchar4{176}}
-\definecharacter cyrillicystrstroke {\uchar4{177}}
-\definecharacter cyrillicHADC {\uchar4{178}}
-\definecharacter cyrillichadc {\uchar4{179}}
-\definecharacter cyrillicTETSE {\uchar4{180}}
-\definecharacter cyrillictetse {\uchar4{181}}
-\definecharacter cyrillicCHEDC {\uchar4{182}}
-\definecharacter cyrillicchedc {\uchar4{183}}
-\definecharacter cyrillicCHEvertstroke {\uchar4{184}}
-\definecharacter cyrillicchevertstroke {\uchar4{185}}
-\definecharacter cyrillicSHHA {\uchar4{186}}
-\definecharacter cyrillicshha {\uchar4{187}}
-\definecharacter cyrillicCHEabkhasian {\uchar4{188}}
-\definecharacter cyrilliccheabkhasian {\uchar4{189}}
-\definecharacter cyrillicCHEDCabkhasian {\uchar4{190}}
-\definecharacter cyrillicchedcabkhasian {\uchar4{191}}
-\definecharacter cyrillicPALOCHKA {\uchar4{192}}
-\definecharacter cyrillicZHEbreve {\uchar4{193}}
-\definecharacter cyrilliczhebreve {\uchar4{194}}
-\definecharacter cyrillicKAhook {\uchar4{195}}
-\definecharacter cyrillickahook {\uchar4{196}}
-\definecharacter cyrillicELtail {\uchar4{197}}
-\definecharacter cyrilliceltail {\uchar4{198}}
-\definecharacter cyrillicENhook {\uchar4{199}}
-\definecharacter cyrillicenhook {\uchar4{200}}
-\definecharacter cyrillicENtail {\uchar4{201}}
-\definecharacter cyrillicentail {\uchar4{202}}
-\definecharacter cyrillicCHEkhakassian {\uchar4{203}}
-\definecharacter cyrillicchekhakassian {\uchar4{204}}
-\definecharacter cyrillicEMtail {\uchar4{205}}
-\definecharacter cyrillicemtail {\uchar4{206}}
-\definecharacter cyrillicAbreve {\uchar4{208}}
-\definecharacter cyrillicabreve {\uchar4{209}}
-\definecharacter cyrillicAdiaeresis {\uchar4{210}}
-\definecharacter cyrillicadiaeresis {\uchar4{211}}
-%definecharacter cyrillicAE {\uchar4{212}} % already defined
-%definecharacter cyrillicae {\uchar4{213}} % already defined
-\definecharacter cyrillicEbreve {\uchar4{214}}
-\definecharacter cyrillicebreve {\uchar4{215}}
-\definecharacter cyrillicSCHWA {\uchar4{216}}
-\definecharacter cyrillicschwa {\uchar4{217}}
-\definecharacter cyrillicSCHWAdiaeresis {\uchar4{218}}
-\definecharacter cyrillicschwadiaeresis {\uchar4{219}}
-\definecharacter cyrillicZHEdiaeresis {\uchar4{220}}
-\definecharacter cyrilliczhediaeresis {\uchar4{221}}
-\definecharacter cyrillicZEdiaeresis {\uchar4{222}}
-\definecharacter cyrilliczediaeresis {\uchar4{223}}
-\definecharacter cyrillicDZEabkhasian {\uchar4{224}}
-\definecharacter cyrillicdzeabkhasian {\uchar4{225}}
-\definecharacter cyrillicImacron {\uchar4{226}}
-\definecharacter cyrillicimacron {\uchar4{227}}
-\definecharacter cyrillicIdiaeresis {\uchar4{228}}
-\definecharacter cyrillicidiaeresis {\uchar4{229}}
-\definecharacter cyrillicOdiaeresis {\uchar4{230}}
-\definecharacter cyrillicodiaeresis {\uchar4{231}}
-\definecharacter cyrillicObarred {\uchar4{232}}
-\definecharacter cyrillicobarred {\uchar4{233}}
-\definecharacter cyrillicObarreddiaeresis {\uchar4{234}}
-\definecharacter cyrillicobarreddiaeresis {\uchar4{235}}
-\definecharacter cyrillicEdiaeresis {\uchar4{236}}
-\definecharacter cyrillicediaeresis {\uchar4{237}}
-\definecharacter cyrillicUmacron {\uchar4{238}}
-\definecharacter cyrillicumacron {\uchar4{239}}
-\definecharacter cyrillicUdiaeresis {\uchar4{240}}
-\definecharacter cyrillicudiaeresis {\uchar4{241}}
-\definecharacter cyrillicUdoubleacute {\uchar4{242}}
-\definecharacter cyrillicudoubleacute {\uchar4{243}}
-\definecharacter cyrillicCHEdiaeresis {\uchar4{244}}
-\definecharacter cyrillicchediaeresis {\uchar4{245}}
-\definecharacter cyrillicYERUdiaeresis {\uchar4{248}}
-\definecharacter cyrillicyerudiaeresis {\uchar4{249}}
-
-\stopencoding
-
-% Greek Extended
-
-\startencoding[uc]
-
-\definecharacter greekalphapsili {\uchar{31}{0}}
-\definecharacter greekalphadasia {\uchar{31}{1}}
-\definecharacter greekalphapsilivaria {\uchar{31}{2}}
-\definecharacter greekalphadasiavaria {\uchar{31}{3}}
-\definecharacter greekalphapsilitonos {\uchar{31}{4}}
-\definecharacter greekalphadasiatonos {\uchar{31}{5}}
-\definecharacter greekalphapsiliperispomeni {\uchar{31}{6}}
-\definecharacter greekalphadasiaperispomeni {\uchar{31}{7}}
-\definecharacter greekAlphapsili {\uchar{31}{8}}
-\definecharacter greekAlphadasia {\uchar{31}{9}}
-\definecharacter greekAlphapsilivaria {\uchar{31}{10}}
-\definecharacter greekAlphadasiavaria {\uchar{31}{11}}
-\definecharacter greekAlphapsilitonos {\uchar{31}{12}}
-\definecharacter greekAlphadasiatonos {\uchar{31}{13}}
-\definecharacter greekAlphapsiliperispomeni {\uchar{31}{14}}
-\definecharacter greekAlphadasiaperispomeni {\uchar{31}{15}}
-\definecharacter greekepsilonpsili {\uchar{31}{16}} % 1f10
-\definecharacter greekepsilondasia {\uchar{31}{17}}
-\definecharacter greekepsilonpsilivaria {\uchar{31}{18}}
-\definecharacter greekepsilondasiavaria {\uchar{31}{19}}
-\definecharacter greekepsilonpsilitonos {\uchar{31}{20}}
-\definecharacter greekepsilondasiatonos {\uchar{31}{21}}
-\definecharacter greekEpsilonpsili {\uchar{31}{24}}
-\definecharacter greekEpsilondasia {\uchar{31}{25}}
-\definecharacter greekEpsilonpsilivaria {\uchar{31}{26}}
-\definecharacter greekEpsilondasiavaria {\uchar{31}{27}}
-\definecharacter greekEpsilonpsilitonos {\uchar{31}{28}}
-\definecharacter greekEpsilondasiatonos {\uchar{31}{29}}
-\definecharacter greeketapsili {\uchar{31}{32}} % 1f20
-\definecharacter greeketadasia {\uchar{31}{33}}
-\definecharacter greeketapsilivaria {\uchar{31}{34}}
-\definecharacter greeketadasiavaria {\uchar{31}{35}}
-\definecharacter greeketapsilitonos {\uchar{31}{36}}
-\definecharacter greeketadasiatonos {\uchar{31}{37}}
-\definecharacter greeketapsiliperispomeni {\uchar{31}{38}}
-\definecharacter greeketadasiaperispomeni {\uchar{31}{39}}
-\definecharacter greekEtapsili {\uchar{31}{40}}
-\definecharacter greekEtadasia {\uchar{31}{41}}
-\definecharacter greekEtapsilivaria {\uchar{31}{42}}
-\definecharacter greekEtadasiavaria {\uchar{31}{43}}
-\definecharacter greekEtapsilitonos {\uchar{31}{44}}
-\definecharacter greekEtadasiatonos {\uchar{31}{45}}
-\definecharacter greekEtapsiliperispomeni {\uchar{31}{46}}
-\definecharacter greekEtadasiaperispomeni {\uchar{31}{47}}
-\definecharacter greekiotapsili {\uchar{31}{48}} % 1f30
-\definecharacter greekiotadasia {\uchar{31}{49}}
-\definecharacter greekiotapsilivaria {\uchar{31}{50}}
-\definecharacter greekiotadasiavaria {\uchar{31}{51}}
-\definecharacter greekiotapsilitonos {\uchar{31}{52}}
-\definecharacter greekiotadasiatonos {\uchar{31}{53}}
-\definecharacter greekiotapsiliperispomeni {\uchar{31}{54}}
-\definecharacter greekiotadasiaperispomeni {\uchar{31}{55}}
-\definecharacter greekIotapsili {\uchar{31}{56}}
-\definecharacter greekIotadasia {\uchar{31}{57}}
-\definecharacter greekIotapsilivaria {\uchar{31}{58}}
-\definecharacter greekIotadasiavaria {\uchar{31}{59}}
-\definecharacter greekIotapsilitonos {\uchar{31}{60}}
-\definecharacter greekIotadasiatonos {\uchar{31}{61}}
-\definecharacter greekIotapsiliperispomeni {\uchar{31}{62}}
-\definecharacter greekIotadasiaperispomeni {\uchar{31}{63}}
-\definecharacter greekomicronpsili {\uchar{31}{64}} % 1f40
-\definecharacter greekomicrondasia {\uchar{31}{65}}
-\definecharacter greekomicronpsilivaria {\uchar{31}{66}}
-\definecharacter greekomicrondasiavaria {\uchar{31}{67}}
-\definecharacter greekomicronpsilitonos {\uchar{31}{68}}
-\definecharacter greekomicrondasiatonos {\uchar{31}{69}}
-\definecharacter greekOmicronpsili {\uchar{31}{72}}
-\definecharacter greekOmicrondasia {\uchar{31}{73}}
-\definecharacter greekOmicronpsilivaria {\uchar{31}{74}}
-\definecharacter greekOmicrondasiavaria {\uchar{31}{75}}
-\definecharacter greekOmicronpsilitonos {\uchar{31}{76}}
-\definecharacter greekOmicrondasiatonos {\uchar{31}{77}}
-\definecharacter greekupsilonpsili {\uchar{31}{80}} % 1f50
-\definecharacter greekupsilondasia {\uchar{31}{81}}
-\definecharacter greekupsilonpsilivaria {\uchar{31}{82}}
-\definecharacter greekupsilondasiavaria {\uchar{31}{83}}
-\definecharacter greekupsilonpsilitonos {\uchar{31}{84}}
-\definecharacter greekupsilondasiatonos {\uchar{31}{85}}
-\definecharacter greekupsilonpsiliperispomeni {\uchar{31}{86}}
-\definecharacter greekupsilondasiaperispomeni {\uchar{31}{87}}
-\definecharacter greekUpsilondasia {\uchar{31}{89}}
-\definecharacter greekUpsilondasiavaria {\uchar{31}{91}}
-\definecharacter greekUpsilondasiatonos {\uchar{31}{93}}
-\definecharacter greekUpsilondasiaperispomeni {\uchar{31}{95}}
-\definecharacter greekomegapsili {\uchar{31}{96}} % 1f60
-\definecharacter greekomegadasia {\uchar{31}{97}}
-\definecharacter greekomegapsilivaria {\uchar{31}{98}}
-\definecharacter greekomegadasiavaria {\uchar{31}{99}}
-\definecharacter greekomegapsilitonos {\uchar{31}{100}}
-\definecharacter greekomegadasiatonos {\uchar{31}{101}}
-\definecharacter greekomegapsiliperispomeni {\uchar{31}{102}}
-\definecharacter greekomegadasiaperispomeni {\uchar{31}{103}}
-\definecharacter greekOmegapsili {\uchar{31}{104}}
-\definecharacter greekOmegadasia {\uchar{31}{105}}
-\definecharacter greekOmegapsilivaria {\uchar{31}{106}}
-\definecharacter greekOmegadasiavaria {\uchar{31}{107}}
-\definecharacter greekOmegapsilitonos {\uchar{31}{108}}
-\definecharacter greekOmegadasiatonos {\uchar{31}{109}}
-\definecharacter greekOmegapsiliperispomeni {\uchar{31}{110}}
-\definecharacter greekOmegadasiaperispomeni {\uchar{31}{111}}
-\definecharacter greekalphavaria {\uchar{31}{112}} % 1f70
-\definecharacter greekalphaoxia {\uchar{31}{113}}
-\definecharacter greekepsilonvaria {\uchar{31}{114}}
-\definecharacter greekepsilonoxia {\uchar{31}{115}}
-\definecharacter greeketavaria {\uchar{31}{116}}
-\definecharacter greeketaoxia {\uchar{31}{117}}
-\definecharacter greekiotavaria {\uchar{31}{118}}
-\definecharacter greekiotaoxia {\uchar{31}{119}}
-\definecharacter greekomicronvaria {\uchar{31}{120}}
-\definecharacter greekomicronoxia {\uchar{31}{121}}
-\definecharacter greekupsilonvaria {\uchar{31}{122}}
-\definecharacter greekupsilonoxia {\uchar{31}{123}}
-\definecharacter greekomegavaria {\uchar{31}{124}}
-\definecharacter greekomegaoxia {\uchar{31}{125}}
-\definecharacter greekalphaiotasubpsili {\uchar{31}{128}} % 1f80
-\definecharacter greekalphaiotasubdasia {\uchar{31}{129}}
-\definecharacter greekalphaiotasubpsilivaria {\uchar{31}{130}}
-\definecharacter greekalphaiotasubdasiavaria {\uchar{31}{131}}
-\definecharacter greekalphaiotasubpsilitonos {\uchar{31}{132}}
-\definecharacter greekalphaiotasubdasiatonos {\uchar{31}{133}}
-\definecharacter greekalphaiotasubpsiliperispomeni {\uchar{31}{134}}
-\definecharacter greekalphaiotasubdasiaperispomeni {\uchar{31}{135}}
-\definecharacter greekAlphaiotasubpsili {\uchar{31}{136}}
-\definecharacter greekAlphaiotasubdasia {\uchar{31}{137}}
-\definecharacter greekAlphaiotasubpsilivaria {\uchar{31}{138}}
-\definecharacter greekAlphaiotasubdasiavaria {\uchar{31}{139}}
-\definecharacter greekAlphaiotasubpsilitonos {\uchar{31}{140}}
-\definecharacter greekAlphaiotasubdasiatonos {\uchar{31}{141}}
-\definecharacter greekAlphaiotasubpsiliperispomeni {\uchar{31}{142}}
-\definecharacter greekAlphaiotasubdasiaperispomeni {\uchar{31}{143}}
-\definecharacter greeketaiotasubpsili {\uchar{31}{144}} % 1f90
-\definecharacter greeketaiotasubdasia {\uchar{31}{145}}
-\definecharacter greeketaiotasubpsilivaria {\uchar{31}{146}}
-\definecharacter greeketaiotasubdasiavaria {\uchar{31}{147}}
-\definecharacter greeketaiotasubpsilitonos {\uchar{31}{148}}
-\definecharacter greeketaiotasubdasiatonos {\uchar{31}{149}}
-\definecharacter greeketaiotasubpsiliperispomeni {\uchar{31}{150}}
-\definecharacter greeketaiotasubdasiaperispomeni {\uchar{31}{151}}
-\definecharacter greekEtaiotasubpsili {\uchar{31}{152}}
-\definecharacter greekEtaiotasubdasia {\uchar{31}{153}}
-\definecharacter greekEtaiotasubpsilivaria {\uchar{31}{154}}
-\definecharacter greekEtaiotasubdasiavaria {\uchar{31}{155}}
-\definecharacter greekEtaiotasubpsilitonos {\uchar{31}{156}}
-\definecharacter greekEtaiotasubdasiatonos {\uchar{31}{157}}
-\definecharacter greekEtaiotasubpsiliperispomeni {\uchar{31}{158}}
-\definecharacter greekEtaiotasubdasiaperispomeni {\uchar{31}{159}}
-\definecharacter greekomegaiotasubpsili {\uchar{31}{160}} % 1fa0
-\definecharacter greekomegaiotasubdasia {\uchar{31}{161}}
-\definecharacter greekomegaiotasubpsilivaria {\uchar{31}{162}}
-\definecharacter greekomegaiotasubdasiavaria {\uchar{31}{163}}
-\definecharacter greekomegaiotasubpsilitonos {\uchar{31}{164}}
-\definecharacter greekomegaiotasubdasiatonos {\uchar{31}{165}}
-\definecharacter greekomegaiotasubpsiliperispomeni {\uchar{31}{166}}
-\definecharacter greekomegaiotasubdasiaperispomeni {\uchar{31}{167}}
-\definecharacter greekOmegaiotasubpsili {\uchar{31}{168}}
-\definecharacter greekOmegaiotasubdasia {\uchar{31}{169}}
-\definecharacter greekOmegaiotasubpsilivaria {\uchar{31}{170}}
-\definecharacter greekOmegaiotasubdasiavaria {\uchar{31}{171}}
-\definecharacter greekOmegaiotasubpsilitonos {\uchar{31}{172}}
-\definecharacter greekOmegaiotasubdasiatonos {\uchar{31}{173}}
-\definecharacter greekOmegaiotasubpsiliperispomeni {\uchar{31}{174}}
-\definecharacter greekOmegaiotasubdasiaperispomeni {\uchar{31}{175}}
-\definecharacter greekalphavrachy {\uchar{31}{176}} % 1fb0
-\definecharacter greekalphamacron {\uchar{31}{177}}
-\definecharacter greekalphaiotasubvaria {\uchar{31}{178}}
-\definecharacter greekalphaiotasub {\uchar{31}{179}}
-\definecharacter greekalphaiotasubtonos {\uchar{31}{180}}
-\definecharacter greekalphaperispomeni {\uchar{31}{182}}
-\definecharacter greekalphaiotasubperispomeni {\uchar{31}{183}}
-\definecharacter greekAlphavrachy {\uchar{31}{184}}
-\definecharacter greekAlphamacron {\uchar{31}{185}}
-\definecharacter greekAlphavaria {\uchar{31}{186}}
-\definecharacter greekAlphatonos {\uchar{31}{187}}
-\definecharacter greekAlphaiotasub {\uchar{31}{188}}
-\definecharacter greekCoronis {\uchar{31}{189}}
-\definecharacter greekprosgegrammeni {\uchar{31}{190}}
-\definecharacter greekpsili {\uchar{31}{191}}
-\definecharacter greekperispomeni {\uchar{31}{192}} % 1fc0
-\definecharacter greekdialytikaperispomeni {\uchar{31}{193}}
-\definecharacter greeketaiotasubvaria {\uchar{31}{194}}
-\definecharacter greeketaiotasub {\uchar{31}{195}}
-\definecharacter greeketaiotasubtonos {\uchar{31}{196}}
-\definecharacter greeketaperispomeni {\uchar{31}{198}}
-\definecharacter greeketaiotasubperispomeni {\uchar{31}{199}}
-\definecharacter greekEpsilonvaria {\uchar{31}{200}}
-\definecharacter greekEpsilontonos {\uchar{31}{201}}
-\definecharacter greekEtavaria {\uchar{31}{202}}
-\definecharacter greekEtatonos {\uchar{31}{203}}
-\definecharacter greekEtaiotasub {\uchar{31}{204}}
-\definecharacter greekpsilivaria {\uchar{31}{205}}
-\definecharacter greekpsilitonos {\uchar{31}{206}}
-\definecharacter greekpsiliperispomeni {\uchar{31}{207}}
-\definecharacter greekiotavrachy {\uchar{31}{208}} % 1fd0
-\definecharacter greekiotamacron {\uchar{31}{209}}
-\definecharacter greekiotadialytikavaria {\uchar{31}{210}}
-\definecharacter greekiotadialytikatonos {\uchar{31}{211}}
-\definecharacter greekiotaperispomeni {\uchar{31}{214}}
-\definecharacter greekiotadialytikaperispomeni {\uchar{31}{215}}
-\definecharacter greekIotavrachy {\uchar{31}{216}}
-\definecharacter greekIotamacron {\uchar{31}{217}}
-\definecharacter greekIotavaria {\uchar{31}{218}}
-\definecharacter greekIotatonos {\uchar{31}{219}}
-\definecharacter greekdasiavaria {\uchar{31}{221}}
-\definecharacter greekdasiatonos {\uchar{31}{222}}
-\definecharacter greekdasiaperispomeni {\uchar{31}{223}}
-\definecharacter greekupsilonvrachy {\uchar{31}{224}} % 1fe0
-\definecharacter greekupsilonmacron {\uchar{31}{225}}
-\definecharacter greekupsilondialytikavaria {\uchar{31}{226}}
-\definecharacter greekupsilondialytikatonos {\uchar{31}{227}}
-\definecharacter greekrhopsili {\uchar{31}{228}}
-\definecharacter greekrhodasia {\uchar{31}{229}}
-\definecharacter greekupsilonperispomeni {\uchar{31}{230}}
-\definecharacter greekupsilondialytikaperispomeni {\uchar{31}{231}}
-\definecharacter greekUpsilonvrachy {\uchar{31}{232}}
-\definecharacter greekUpsilonmacron {\uchar{31}{233}}
-\definecharacter greekUpsilonvaria {\uchar{31}{234}}
-\definecharacter greekUpsilontonos {\uchar{31}{235}}
-\definecharacter greekRhodasia {\uchar{31}{236}}
-\definecharacter greekdialytikavaria {\uchar{31}{237}}
-\definecharacter greekdialytikatonos {\uchar{31}{238}}
-\definecharacter greekvaria {\uchar{31}{239}}
-\definecharacter greekomegaiotasubvaria {\uchar{31}{242}}
-\definecharacter greekomegaiotasub {\uchar{31}{243}}
-\definecharacter greekomegaiotasubtonos {\uchar{31}{244}}
-\definecharacter greekomegaperispomeni {\uchar{31}{246}}
-\definecharacter greekomegaiotasubperispomeni {\uchar{31}{247}}
-\definecharacter greekOmicronvaria {\uchar{31}{248}}
-\definecharacter greekOmicrontonos {\uchar{31}{249}}
-\definecharacter greekOmegavaria {\uchar{31}{250}}
-\definecharacter greekOmegatonos {\uchar{31}{251}}
-\definecharacter greekOmegaiotasub {\uchar{31}{252}}
-\definecharacter greekoxia {\uchar{31}{253}}
-\definecharacter greekdasia {\uchar{31}{254}}
-\definecharacter greeksigmalunate {\uchar3{242}}
-\definecharacter greekSigmalunate {\uchar3{249}}
-\definecharacter greeksampi {\uchar3{225}}
-\definecharacter greekdigamma {\uchar3{221}}
-\definecharacter greekstigma {\uchar3{219}}
-\definecharacter greeknumkoppa {\uchar3{223}}
-\definecharacter greekkoppa {\uchar3{217}}
-\definecharacter greekupsilondiaeresis {\uchar3{203}}
-
-\stopencoding
-
-% Hebrew:
-
-\startencoding[uc]
-
-\definecharacter hebrewAlef {\uchar5{208}} % 05D0
-\definecharacter hebrewBet {\uchar5{209}}
-\definecharacter hebrewGimel {\uchar5{210}}
-\definecharacter hebrewDalet {\uchar5{211}}
-\definecharacter hebrewHe {\uchar5{212}}
-\definecharacter hebrewVav {\uchar5{213}}
-\definecharacter hebrewZayin {\uchar5{214}}
-\definecharacter hebrewHet {\uchar5{215}}
-\definecharacter hebrewTet {\uchar5{216}}
-\definecharacter hebrewYod {\uchar5{217}}
-\definecharacter hebrewKaffinal {\uchar5{218}}
-\definecharacter hebrewKaf {\uchar5{219}}
-\definecharacter hebrewLamed {\uchar5{220}}
-\definecharacter hebrewMemfinal {\uchar5{221}}
-\definecharacter hebrewMem {\uchar5{222}}
-\definecharacter hebrewNunfinal {\uchar5{223}}
-\definecharacter hebrewNun {\uchar5{224}}
-\definecharacter hebrewSamekh {\uchar5{225}}
-\definecharacter hebrewAyin {\uchar5{226}}
-\definecharacter hebrewPefinal {\uchar5{227}}
-\definecharacter hebrewPe {\uchar5{228}}
-\definecharacter hebrewTsadifinal {\uchar5{229}}
-\definecharacter hebrewTsadi {\uchar5{230}}
-\definecharacter hebrewQof {\uchar5{231}}
-\definecharacter hebrewResh {\uchar5{232}}
-\definecharacter hebrewShin {\uchar5{233}}
-\definecharacter hebrewTav {\uchar5{234}} % 05EA
-
-\stopencoding
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-vis.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-vis.mkii
deleted file mode 100644
index 3c1fd776566..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-vis.mkii
+++ /dev/null
@@ -1,3 +0,0 @@
-% temporary module, needed for downward compatibility
-
-\input regi-vis.tex \enableregime[viscii] \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-vna.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-vna.mkii
deleted file mode 100644
index 42fee43417b..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-vna.mkii
+++ /dev/null
@@ -1,145 +0,0 @@
-%D \module
-%D [ file=enco-vna,
-%D version=1999.12.12,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=Vietnamese Accents,
-%D author=Han The Thanh & Adam Lindsay & Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 module is originally derived from the some files Han The Thanh
-%D prepared for \LATEX. The dual accent support is still preliminary,
-%D but works ok. It's now adapted to named glyphs, and is activated by
-%D \type {\useencoding[thisfile]}.
-
-%D This was apparently buggy from the start: there is nothing to
-%D disambiguate \type {\ohorn} from \type {\ohook}. Both are entered
-%D with \type {\h{o}} (AL)!
-
-%D Once stable, this code will move to \type {enco-acc.tex}.
-
-\startencoding[default]
-
-\defineaccent h A {\Ahook}
-\defineaccent d A {\Adotbelow}
-\defineaccent ` ^A {\Acircumflexgrave}
-\defineaccent ' ^A {\Acircumflexacute}
-\defineaccent ~ ^A {\Acircumflextilde}
-\defineaccent h ^A {\Acircumflexhook}
-\defineaccent d ^A {\Acircumflexdotbelow}
-\defineaccent ` uA {\Abrevegrave}
-\defineaccent ' uA {\Abreveacute}
-\defineaccent ~ uA {\Abrevetilde}
-\defineaccent h uA {\Abrevehook}
-\defineaccent d uA {\Abrevedotbelow}
-\defineaccent h E {\Ehook}
-\defineaccent d E {\Edotbelow}
-\defineaccent ` ^E {\Ecircumflexgrave}
-\defineaccent ' ^E {\Ecircumflexacute}
-\defineaccent ~ ^E {\Ecircumflextilde}
-\defineaccent h ^E {\Ecircumflexhook}
-\defineaccent d ^E {\Ecircumflexdotbelow}
-\defineaccent h I {\Ihook}
-\defineaccent d I {\Idotbelow}
-\defineaccent h O {\Ohook}
-\defineaccent d O {\Odotbelow}
-\defineaccent ` ^O {\Ocircumflexgrave}
-\defineaccent ' ^O {\Ocircumflexacute}
-\defineaccent ~ ^O {\Ocircumflextilde}
-\defineaccent h ^O {\Ocircumflexhook}
-\defineaccent d ^O {\Ocircumflexdotbelow}
-%defineaccent h O {\Ohorn} % !!! conflict with \Ohook!
-\defineaccent ` hO {\Ohorngrave}
-\defineaccent ` {\Ohorn} {\Ohorngrave}
-\defineaccent ' hO {\Ohornacute}
-\defineaccent ' {\Ohorn} {\Ohornacute}
-\defineaccent ~ hO {\Ohorntilde}
-\defineaccent ~ {\Ohorn} {\Ohorntilde}
-\defineaccent h hO {\Ohornhook}
-\defineaccent h {\Ohorn} {\Ohornhook}
-\defineaccent d hO {\Ohorndotbelow}
-\defineaccent d {\Ohorn} {\Ohorndotbelow}
-\defineaccent h U {\Uhook}
-\defineaccent d U {\Udotbelow}
-%defineaccent h U {\Uhorn} % !!! conflict with \Uhook! honestly, people!
-\defineaccent ` hU {\Uhorngrave}
-\defineaccent ` {\Uhorn} {\Uhorngrave}
-\defineaccent ' hU {\Uhornacute}
-\defineaccent ' {\Uhorn} {\Uhornacute}
-\defineaccent ~ hU {\Uhorntilde}
-\defineaccent ~ {\Uhorn} {\Uhorntilde}
-\defineaccent h hU {\Uhornhook}
-\defineaccent h {\Uhorn} {\Uhornhook}
-\defineaccent d hU {\Uhorndotbelow}
-\defineaccent d {\Uhorn} {\Uhorndotbelow}
-\defineaccent ` Y {\Ygrave}
-\defineaccent ' Y {\Yacute}
-\defineaccent ~ Y {\Ytilde}
-\defineaccent h Y {\Yhook}
-\defineaccent d Y {\Ydotbelow}
-\defineaccent h a {\ahook}
-\defineaccent d a {\adotbelow}
-\defineaccent ` ^a {\acircumflexgrave}
-\defineaccent ' ^a {\acircumflexacute}
-\defineaccent ~ ^a {\acircumflextilde}
-\defineaccent h ^a {\acircumflexhook}
-\defineaccent d ^a {\acircumflexdotbelow}
-\defineaccent ` ua {\abrevegrave}
-\defineaccent ' ua {\abreveacute}
-\defineaccent ~ ua {\abrevetilde}
-\defineaccent h ua {\abrevehook}
-\defineaccent d ua {\abrevedotbelow}
-\defineaccent h e {\ehook}
-\defineaccent d e {\edotbelow}
-\defineaccent ` ^e {\ecircumflexgrave}
-\defineaccent ' ^e {\ecircumflexacute}
-\defineaccent ~ ^e {\ecircumflextilde}
-\defineaccent h ^e {\ecircumflexhook}
-\defineaccent d ^e {\ecircumflexdotbelow}
-\defineaccent h i {\ihook}
-\defineaccent d i {\idotbelow}
-\defineaccent h o {\ohook}
-\defineaccent d o {\odotbelow}
-\defineaccent ^ o {\ocircumflex}
-\defineaccent ` ^o {\ocircumflexgrave}
-\defineaccent ' ^o {\ocircumflexacute}
-\defineaccent ~ ^o {\ocircumflextilde}
-\defineaccent h ^o {\ocircumflexhook}
-\defineaccent d ^o {\ocircumflexdotbelow}
-%defineaccent h o {\ohorn} % !!!
-\defineaccent ` ho {\ohorngrave}
-\defineaccent ' ho {\ohornacute}
-\defineaccent ~ ho {\ohorntilde}
-\defineaccent h ho {\ohornhook}
-\defineaccent d ho {\ohorndotbelow}
-\defineaccent ` {\ohorn} {\ohorngrave}
-\defineaccent ' {\ohorn} {\ohornacute}
-\defineaccent ~ {\ohorn} {\ohorntilde}
-\defineaccent h {\ohorn} {\ohornhook}
-\defineaccent d {\ohorn} {\ohorndotbelow}
-\defineaccent h u {\uhook}
-\defineaccent d u {\udotbelow}
-%defineaccent h u {\uhorn} % !!!
-\defineaccent ` hu {\uhorngrave}
-\defineaccent ' hu {\uhornacute}
-\defineaccent ~ hu {\uhorntilde}
-\defineaccent h hu {\uhornhook}
-\defineaccent d hu {\uhorndotbelow}
-\defineaccent ` {\uhorn} {\uhorngrave}
-\defineaccent ' {\uhorn} {\uhornacute}
-\defineaccent ~ {\uhorn} {\uhorntilde}
-\defineaccent h {\uhorn} {\uhornhook}
-\defineaccent d {\uhorn} {\uhorndotbelow}
-\defineaccent ` y {\ygrave}
-\defineaccent ' y {\yacute}
-\defineaccent ~ y {\ytilde}
-\defineaccent h y {\yhook}
-\defineaccent d y {\ydotbelow}
-
-\stopencoding
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-win.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-win.mkii
deleted file mode 100644
index 826371d8a68..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-win.mkii
+++ /dev/null
@@ -1,7 +0,0 @@
-% temporary module, needed for downward compatibility
-
-%\input regi-win.tex
-
-\enableregime[windows]
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/enco-x5.mkii b/Master/texmf-dist/tex/context/base/mkii/enco-x5.mkii
deleted file mode 100644
index cde394e294c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/enco-x5.mkii
+++ /dev/null
@@ -1,222 +0,0 @@
-%D \module
-%D [ file=enco-x5,
-%D version=1999.12.12,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=Vietnamese Encoding,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 module is derived from the some files Han The Thanh
-%D prepared for \LATEX. The dual accent support is still
-%D preliminary, but works ok.
-
-\startencoding[x5]
-
-\definecharacter textgrave 0
-\definecharacter textacute 1
-\definecharacter textcircumflex 2
-\definecharacter texttilde 3
-\definecharacter textdiaeresis 4
-\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 dotlessi 25
-\definecharacter DJ 30
-\definecharacter dj 31
-
-\defineaccent ` A 128
-\defineaccent ' A 129
-\defineaccent ~ A 130
-\defineaccent h A 131
-\defineaccent d A 132
-\defineaccent ^ A 133
-\defineaccent ` ^A 134
-\defineaccent ' ^A 135
-\defineaccent ~ ^A 136
-\defineaccent h ^A 137
-\defineaccent d ^A 138
-\defineaccent u A 139
-\defineaccent ` uA 140
-\defineaccent ' uA 141
-\defineaccent ~ uA 142
-\defineaccent h uA 143
-\defineaccent d uA 144
-\defineaccent ` E 145
-\defineaccent ' E 146
-\defineaccent ~ E 147
-\defineaccent h E 148
-\defineaccent d E 149
-\defineaccent ^ E 150
-\defineaccent ` ^E 151
-\defineaccent ' ^E 152
-\defineaccent ~ ^E 153
-\defineaccent h ^E 154
-\defineaccent d ^E 155
-\defineaccent ` I 156
-\defineaccent ' I 157
-\defineaccent ~ I 158
-\defineaccent h I 159
-\defineaccent d I 192
-\defineaccent ` O 193
-\defineaccent ' O 194
-\defineaccent ~ O 195
-\defineaccent h O 196
-\defineaccent d O 197
-\defineaccent ^ O 198
-\defineaccent ` ^O 199
-\defineaccent ' ^O 200
-\defineaccent ~ ^O 201
-\defineaccent h ^O 202
-\defineaccent d ^O 203
-\defineaccent h O 204
-\defineaccent ` hO 205
-\defineaccent ' hO 206
-\defineaccent ~ hO 207
-\defineaccent h hO 208
-\defineaccent d hO 209
-\defineaccent ` U 210
-\defineaccent ' U 211
-\defineaccent ~ U 212
-\defineaccent h U 213
-\defineaccent d U 214
-\defineaccent h U 215
-\defineaccent ` hU 216
-\defineaccent ' hU 217
-\defineaccent ~ hU 218
-\defineaccent h hU 219
-\defineaccent d hU 220
-\defineaccent ` Y 221
-\defineaccent ' Y 222
-\defineaccent ~ Y 223
-\defineaccent h Y 26
-\defineaccent d Y 28
-\defineaccent ` a 160
-\defineaccent ' a 161
-\defineaccent ~ a 162
-\defineaccent h a 163
-\defineaccent d a 164
-\defineaccent ^ a 165
-\defineaccent ` ^a 166
-\defineaccent ' ^a 167
-\defineaccent ~ ^a 168
-\defineaccent h ^a 169
-\defineaccent d ^a 170
-\defineaccent u a 171
-\defineaccent ` ua 172
-\defineaccent ' ua 173
-\defineaccent ~ ua 174
-\defineaccent h ua 175
-\defineaccent d ua 176
-\defineaccent ` e 177
-\defineaccent ' e 178
-\defineaccent ~ e 179
-\defineaccent h e 180
-\defineaccent d e 181
-\defineaccent ^ e 182
-\defineaccent ` ^e 183
-\defineaccent ' ^e 184
-\defineaccent ~ ^e 185
-\defineaccent h ^e 186
-\defineaccent d ^e 187
-\defineaccent ` i 188
-\defineaccent ' i 189
-\defineaccent ~ i 190
-\defineaccent h i 191
-\defineaccent d i 224
-\defineaccent ` o 225
-\defineaccent ' o 226
-\defineaccent ~ o 227
-\defineaccent h o 228
-\defineaccent d o 229
-\defineaccent ^ o 230
-\defineaccent ` ^o 231
-\defineaccent ' ^o 232
-\defineaccent ~ ^o 233
-\defineaccent h ^o 234
-\defineaccent d ^o 235
-\defineaccent h o 236
-\defineaccent ` ho 237
-\defineaccent ' ho 238
-\defineaccent ~ ho 239
-\defineaccent h ho 240
-\defineaccent d ho 241
-\defineaccent ` u 242
-\defineaccent ' u 243
-\defineaccent ~ u 244
-\defineaccent h u 245
-\defineaccent d u 246
-\defineaccent h u 247
-\defineaccent ` hu 248
-\defineaccent ' hu 249
-\defineaccent ~ hu 250
-\defineaccent h hu 251
-\defineaccent d hu 252
-\defineaccent ` y 253
-\defineaccent ' y 254
-\defineaccent ~ y 255
-\defineaccent h y 27
-\defineaccent d y 29
-
-\stopencoding
-
-\endinput
-
-% \startencoding [x5]
-%
-% \definecharacter aa {\xfiveencodedaa}
-% \definecharacter AA {\xfiveencodedAA}
-%
-% \stopencoding
-%
-% \unprotect
-%
-% \def\xfiveencodedaa%
-% {\accent23a}
-%
-% \def\xfiveencodedAA%
-% {\leavevmode
-% \setbox\zerocount\hbox{h}%
-% \dimen@\ht\zerocount
-% \advance\dimen@ -1ex
-% \rlap{\raise.67\dimen@\hbox{\char23}}A}
-%
-% \protect
-%
-% \quotesinglbase 13
-% \guilsinglleft 14
-% \guilsinglright 15
-% \textquotedblleft 16
-% \textquotedblright 17
-% \quotedblbase 18
-% \guillemotleft 19
-% \guillemotright 20
-% \textendash 21
-% \textemdash 22
-% \textcompwordmark 23
-% \textperthousand \% \char 24
-% \textpertenthousand \%\char 24\char 24
-% \textvisiblespace 32
-% \textquotedbl `\"
-% \textdollar `\$
-% \textquoteright `\'
-% \textless `\<
-% \textgreater `\>
-% \textbackslash `\
-% \textasciicircum `\^
-% \textunderscore 95
-% \textquoteleft `\`
-% \textbraceleft `\{
-% \textbar `\|
-% \textbraceright `\}
-% \textasciitilde `\~
diff --git a/Master/texmf-dist/tex/context/base/mkii/filt-bas.mkii b/Master/texmf-dist/tex/context/base/mkii/filt-bas.mkii
deleted file mode 100644
index fedeb694b19..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/filt-bas.mkii
+++ /dev/null
@@ -1,63 +0,0 @@
-%D \module
-%D [ file=filt-bas,
-%D version=2000.09.19,
-%D title=\CONTEXT\ Filter Macros,
-%D subtitle=A Base Collection,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% BEWARE: THIS IS A TEST MODULE, NAMES MAY CHANGE!
-
-\definefiltersynonym [utf8 to unicode16] [inutf8]
-
-\definefiltersynonym [persian fix] [FarsiToArabic]
-\definefiltersynonym [arabic analysis] [uni2cuni]
-\definefiltersynonym [arabic glyphs] [cuni2oar]
-
-\definefiltersequence
- [farsi]
- [utf8 to unicode16,
- persian fix,
- arabic analysis,
- arabic glyphs]
-
-\definefiltersynonym [basic context analysis step1] [bcaa-1]
-\definefiltersynonym [basic context analysis step2] [bcaa-2]
-\definefiltersynonym [basic context analysis step3] [bcaa-3]
-\definefiltersynonym [farsi processing for uomarab] [uomarab-farsi]
-
-\definefiltersynonym [basic presentation forms to sf] [bpftosf]
-
-\definefiltersynonym [omega persian fix] [FarsiToArabic]
-\definefiltersynonym [omega arabic analysis] [uni2cuni]
-\definefiltersynonym [omega arabic glyphs] [cuni2oar]
-
-\definefiltersequence
- [farsi-1]
- [utf8 to unicode16,
- omega persian fix,
- omega arabic analysis,
- omega arabic glyphs]
-
-\definefiltersequence
- [farsi-2]
- [utf8 to unicode16,
- basic context analysis step1,
- basic context analysis step2,
- basic context analysis step3,
- farsi processing for uomarab]
-
-\definefiltersequence
- [farsi-3]
- [utf8 to unicode16,
- basic context analysis step1,
- basic context analysis step2,
- basic context analysis step3,
- basic presentation forms to sf]
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/filt-ini.mkii b/Master/texmf-dist/tex/context/base/mkii/filt-ini.mkii
deleted file mode 100644
index f2f59349a51..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/filt-ini.mkii
+++ /dev/null
@@ -1,121 +0,0 @@
-%D \module
-%D [ file=filt-ini,
-%D version=2000.09.19,
-%D title=\CONTEXT\ Filter Macros,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Filter Macros / Initialization}
-
-% \ifx\OmegaVersion\undefined
-
-% \let\definefiltersynonym \gobbledoubleempty
-% \let\definefiltersequence \gobbledoubleempty
-% \unexpanded\def\usefiltersequence {\gobblesingleempty}
-% \let\usefilter \gobblesingleempty
-% \let\truefiltername \gobbleoneargument
-
-% \expandafter \endinput
-% \fi
-
-\unprotect
-
-%D The real work starts here.
-
-% We need the {\??ot::#1} check because otherwise aleph will crash. Taco's
-% torture test:
-%
-% \ocp\ArabicContext = contextual
-%
-% \dorecurse {5000} {
-% \message{[\recurselevel]}
-% \ocplist\Arabic=\addbeforeocplist 1 \ArabicContext \nullocplist
-% }
-
-%D \macros
-%D {definefiltersynonym}
-
-\def\definefiltersynonym
- {\dodoubleargument\dodefinefiltersynonym}
-
-\def\dodefinefiltersynonym[#1][#2]%
- {\setvalue{\??or#1}{#2}}
-
-%D \macros
-%D {truefiltername}
-
-\def\truefiltername#1%
- {\ifundefined{\??or#1}#1\else\truefiltername{\getvalue{\??or#1}}\fi}
-
-%D \macros
-%D {definefiltersequence}
-
-\def\definefiltersequence
- {\dodoubleargument\dodefinefiltersequence}
-
-% \def\dodefinefiltersequence[#1][#2]%
-% {\setvalue{\??ot#1}{#2}}
-
-\def\dodefinefiltersequence[#1][#2]%
- {\setxvalue{\??ot#1}{#2}%
- \letgvalue{\??ot::#1}\v!stop}
-
-%D \macros
-%D {usefiltersequence}
-%D
-
-\def\magicocpnumber{1}
-
-% one can do:
-%
-% \definefiltersequence
-% [farsi]
-% [utf8 to unicode16=>5,
-% persian fix,
-% arabic analysis=>3,
-% arabic glyphs]
-%
-% so, => is used to signal a priority
-
-\def\dodousefiltersequence#1%
- {\expandafter\ocp\csname\??or:#1\endcsname=\truefiltername{#1}\relax
- \splitstring#1\at=>\to\!!stringa\and\!!stringb
- \edef\!!stringb{\number\ifx\!!stringb\empty\magicocpnumber\else\!!stringb\fi}%
- \appendetoks
- \noexpand\addbeforeocplist
- \!!stringb\space
- \expandafter\noexpand\csname\??or:\!!stringa\endcsname
- \to \scratchtoks}
-
-\unexpanded\def\usefiltersequence[#1]%
- {\doifdefined{\??ot::#1}%
- {\doifvalue{\??ot::#1}\v!stop
- {\scratchtoks\emptytoks
- \expanded{\processcommalist[\getvalue{\??ot#1}]}\dodousefiltersequence
- \expanded{\global\ocplist\csname\??ot:#1\endcsname=\the\scratchtoks}\nullocplist
- \letgvalue{\??ot::#1}\v!start}%
- \expanded{\pushocplist\csname\??ot:#1\endcsname}\relax}}
-
-%D \macros
-%D {usefilter}
-
-\def\dousefilter#1%
- {\doifundefined{\c!file\f!filterprefix#1}%
- {\letvalue{\c!file\f!filterprefix#1}\empty
- \makeshortfilename[\truefilename{\f!filterprefix#1}]%
- \startreadingfile
- \readsysfile{\shortfilename.mkii}
- {\showmessage\m!filters1{#1}}
- {\showmessage\m!filters2{#1}}%
- \stopreadingfile}}
-
-\def\usefilter[#1]%
- {\processcommalist[#1]\dousefilter}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/font-arb.mkii b/Master/texmf-dist/tex/context/base/mkii/font-arb.mkii
deleted file mode 100644
index 3ec0395f32a..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/font-arb.mkii
+++ /dev/null
@@ -1,5 +0,0 @@
-\unprotected \writestatus\m!systems{load ARABTEX as a module instead}
-
-\usemodule[arabtex]
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/font-bfm.mkii b/Master/texmf-dist/tex/context/base/mkii/font-bfm.mkii
deleted file mode 100644
index 0a25ec7422f..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/font-bfm.mkii
+++ /dev/null
@@ -1,196 +0,0 @@
-%D \module
-%D [ file=font-bfm,
-%D version=2003.11.25,
-%D title=\CONTEXT\ Font Macros,
-%D subtitle=Mixed Normal and Bold Math,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Font Macros / Mixed Bold Math Support}
-
-%D The following example demonstrates how to use normal, bold, and mixed
-%D normal|/|bold math. Since not everyone has the Lucida on his|/|her
-%D machine we don't show the result.
-%D
-%D \starttyping
-%D \setupformulas
-%D [method=bold]
-%D
-%D \definetypeface [mainface] [rm] [serif] [lucida] [default] [encoding=texnansi]
-%D \definetypeface [mainface] [tt] [mono] [lucida] [default] [encoding=texnansi]
-%D \definetypeface [mainface] [ss] [sans] [lucida] [default] [encoding=texnansi]
-%D \definetypeface [mainface] [mm] [math] [lucida] [default] [encoding=texnansi]
-%D \definetypeface [mainface] [mm] [bfmath] [lucida] [default] [encoding=texnansi]
-%D
-%D \definetypeface [boldmath] [rm] [serif] [lucida] [default] [encoding=texnansi]
-%D \definetypeface [boldmath] [tt] [mono] [lucida] [default] [encoding=texnansi]
-%D \definetypeface [boldmath] [ss] [sans] [lucida] [default] [encoding=texnansi]
-%D \definetypeface [boldmath] [mm] [boldmath] [lucida] [default] [encoding=texnansi]
-%D
-%D \switchtobodyfont[mainface]
-%D
-%D \startlines
-%D $\mainface x=10 \Gamma \Delta \alpha \delta \zeta$
-%D $\boldmath x=10 \Gamma \Delta \alpha \delta \zeta$
-%D \stoplines
-%D
-%D \startformula
-%D x=12=\fontbody \Gamma \Delta \alpha \delta \zeta
-%D \stopformula
-%D
-%D \startformula[mainface]
-%D x=12=\fontbody \Gamma \Delta \alpha \delta \zeta
-%D \stopformula
-%D
-%D \startformula[boldmath]
-%D x=12=\fontbody \Gamma \Delta \alpha \delta \zeta
-%D \stopformula
-%D
-%D \startformula[boldmath,8pt]
-%D x=8=\fontbody \Gamma \Delta \alpha \delta \zeta
-%D \stopformula
-%D
-%D \startformula[boldmath,12pt,small]
-%D x=12s=\fontbody \Gamma \Delta \alpha \delta \zeta
-%D \stopformula
-%D
-%D \startformula[boldmath,small]
-%D x=s=\fontbody \Gamma \Delta \alpha \delta \zeta
-%D \stopformula
-%D
-%D \startformula[boldmath,10pt]
-%D x=10=\fontbody \Gamma \Delta \alpha \delta \zeta
-%D \stopformula
-%D
-%D \startformula[boldmath,11pt,small]
-%D x=11s=\fontbody \Gamma \Delta \alpha \delta \zeta
-%D \stopformula
-%D
-%D \startformula[boldmath,9pt]
-%D x=9=\fontbody \Gamma \Delta \alpha \delta \zeta
-%D \stopformula
-%D
-%D \startlines
-%D \formula{1=2x}
-%D \formula[boldmath]{1=2x}
-%D \formula[mainface]{1=2x}
-%D \formula[mainface]{1 \theta \Gamma = \bfm 1 \beta \hbox{\sl test}\Gamma \alpha ' x x}
-%D \formula[mainface]{1 \theta \Gamma = {\bfm 1 \beta \hbox{\sl test}\Gamma \alpha ' x} x}
-%D \stoplines
-%D \stoptyping
-
-\unprotect
-
-%D \TEX\ has some hard wired expectations about where to look for
-%D certain characters. This means that we cannot overload the families
-%D 0 upto~3. Also, since we use C upto~F for math as well, we are left
-%D with the range 4 upto~B.
-
-\chardef\mrbffam\itfam \edef\c!mrbf{\c!mr\c!bf} \let\hexmrbffam\hexitfam % 4 it
-\chardef\exbffam\slfam \edef\c!exbf{\c!ex\c!bf} \let\hexexbffam\hexslfam % 5 sl
-\chardef\mibffam\bffam \edef\c!mibf{\c!mi\c!bf} \let\hexmibffam\hexbffam % 6 bf
-\chardef\sybffam\nnfam \edef\c!sybf{\c!sy\c!bf} \let\hexsybffam\hexnnfam % 7 nn
-\chardef\mabffam\bsfam \edef\c!mabf{\c!ma\c!bf} \let\hexmabffam\hexbsfam % 8 bs
-\chardef\mbbffam\bifam \edef\c!mbbf{\c!mb\c!bf} \let\hexmbbffam\hexbifam % 9 bi
-\chardef\mcbffam\scfam \edef\c!mcbf{\c!mc\c!bf} \let\hexmcbffam\hexscfam % A sc
-\chardef\mdbffam\scfam \edef\c!mdbf{\c!mc\c!bf} \let\hexmdbffam\hexscfam % B tf % tricky
-
-%D The next bunch of code looks horrible and tricky but one has to keep in
-%D mind that because \TEX\ makes several passes over the math list we need to
-%D make sure that grouping is handled well. Later assignments to a family
-%D overload previous ones, the last one counts.
-
-\newtoks \boldmathstrategies
-\newtoks \boldsymbstrategies
-
-\appendtoks
- \dosetmathfamily\mrbffam\textface\scriptface\scriptscriptface\c!mrbf\mrfallback
- \dosetmathfamily\mibffam\textface\scriptface\scriptscriptface\c!mibf\empty
- \dosetmathfamily\sybffam\textface\scriptface\scriptscriptface\c!sybf\empty
- \dosetmathfamily\exbffam\textface\textface \textface \c!exbf\empty
- \dosetmathfamily\mabffam\textface\scriptface\scriptscriptface\c!mabf\empty
- \dosetmathfamily\mbbffam\textface\scriptface\scriptscriptface\c!mbbf\empty
- \dosetmathfamily\mcbffam\textface\scriptface\scriptscriptface\c!mcbf\empty
-\to \boldmathstrategies
-
-\appendtoks
- \dosetskewchar\mifam\defaultskewcharmi
- \dosetskewchar\syfam\defaultskewcharsy
-\to \boldmathstrategies
-
-\appendtoks
- \dosetsymbfamily\mrbffam\textface\scriptface\scriptscriptface\c!mrbf
- \dosetsymbfamily\mibffam\textface\scriptface\scriptscriptface\c!mibf
- \dosetsymbfamily\sybffam\textface\scriptface\scriptscriptface\c!sybf
- \dosetsymbfamily\exbffam\textface\textface \textface \c!exbf
- \dosetsymbfamily\mabffam\textface\scriptface\scriptscriptface\c!mabf
- \dosetsymbfamily\mbbffam\textface\scriptface\scriptscriptface\c!mbbf
- \dosetsymbfamily\mcbffam\textface\scriptface\scriptscriptface\c!mcbf
-\to \boldsymbstrategies
-
-%D Here comes the real mess (due to semi||global settings en multiple
-%D passes over the math list once the input is expanded.
-
-\newevery \everyboldfacemath \relax
-\chardef \boldfacemathmethod \zerocount
-
-\appendtoks
- \ifcase\boldfacemathmethod \else \the\boldmathstrategies \fi
-\to \mathstrategies
-
-\appendtoks
- \ifcase\boldfacemathmethod \else \the\boldsymbstrategies \fi
-\to \symbstrategies
-
-\appendtoks
- \let\mrfam\mrbffam \let\c!mr\c!mrbf \let\hexmrfam\hexmrbffam
- \let\mifam\mibffam \let\c!mi\c!mibf \let\hexmifam\hexmibffam
- \let\syfam\sybffam \let\c!sy\c!sybf \let\hexsyfam\hexsybffam
- \let\exfam\exbffam \let\c!ex\c!exbf \let\hexexfam\hexexbffam
- \let\mafam\mabffam \let\c!ma\c!mabf \let\hexmafam\hexmabffam
- \let\mbfam\mbbffam \let\c!mb\c!mbbf \let\hexmbfam\hexmbbffam
- \let\mcfam\mcbffam \let\c!mc\c!mcbf \let\hexmcfam\hexmcbffam
-\to \everyboldfacemath
-
-\appendtoks
- \let\mathsubfamily\c!bf
-\to \everyboldfacemath
-
-\appendtoks
- \synchronizemath \aftergroup\synchronizemath
-\to \everyboldfacemath
-
-%D \macros
-%D {boldfacemath, bfm, autoboldfacemath}
-%D
-%D These are the user commands, with \type {\bfm} being the most comfortable.
-
-\def\boldfacemath {\ifcase\boldfacemathmethod\else\the\everyboldfacemath\fi}
-\def\bfm {\boldfacemath} % no \let, so that we can redefine
-\def\autoboldfacemath{\appendtoks\ifcase\boldfacemathmethod\else\let\bf\boldfacemath\fi\to\everymathematics}
-
-%D We hook this feature into the formula mechanism.
-
-\setupformulas
- [\c!method=\v!normal]
-
-\appendtoks
- \doifelse{\formulaparameter\c!method}\v!bold
- {\chardef\boldfacemathmethod\plusone}
- {\chardef\boldfacemathmethod\zerocount}%
-\to \everysetupformulas
-
-%D Of course this only works when bfmath fonts are set up (see example at
-%D the top of this file) and bold math is enabled:
-%D
-%D \starttyping
-%D \setupformulas
-%D [method=bold]
-%D \stoptyping
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/font-chi.mkii b/Master/texmf-dist/tex/context/base/mkii/font-chi.mkii
deleted file mode 100644
index 5e545722735..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/font-chi.mkii
+++ /dev/null
@@ -1,1156 +0,0 @@
-%D \module
-%D [ file=font-chi,
-%D version=1999.10.10,
-%D title=\CONTEXT\ Font Macros,
-%D subtitle=Chinese,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D suggestions=Wang Lei,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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\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
-
-%D Still to be implemented:
-%D
-%D \startitemize
-%D \item columns left right touch
-%D \item distance = (hsize-n*bodyfontsize)/(n-1)
-%D \item char grids
-%D \item char tables
-%D \item all kind of rotated combinations
-%D \item hanging puctuation
-%D \item a few more encodings
-%D \item rotation list
-%D \stopitemize
-
-%M \setupbodyfont[chi]
-%M
-%M \def\WangLei{\purechinese{\uchar{205}{245}\uchar{192}{218}}}
-
-\useencoding[chi]
-
-%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
-%D yes. I knew that those languages, rich of glyphs, were
-%D typeset by \TEX, so in principle it should be possible. I
-%D asked or some more input and was told that there were
-%D \LATEX\ styles regarding those languages. When I unzipped
-%D the accompanying files, it became clear that I had to
-%D implement support for Chinese from scratch. There was a
-%D multitude of font, with rather unfamiliar encodings, a
-%D large collection of files with |<|at least for me|>|
-%D unknown purposes, and worse, the documentation was mainly
-%D in Chinese.
-%D
-%D So, \WangLei\ and I started exchanging some emails and it
-%D soon became clear that supporting Chinese was not that
-%D complicated at all. It mostly came to dealing with handling
-%D \UNICODE\ fonts. It also became clear that everything
-%D Chinese took place in the upper region of the eight bit
-%D character set. I wrote some macros that could process the
-%D small \type {Hello World} file \WangLei\ had send me, and
-%D after some bug fixes real Chinese came out. I started to
-%D like the look and fel of Chinese glyphs, so on we went.
-%D
-%D The first comments concerned spacing. The mix of English
-%D and Chinese demands some rather deliberate handling of
-%D spacing. Breaking lines was not so much a problem, and
-%D could be solved by adding some glue between Chinese glyphs.
-%D
-%D In the meantime had asked \WangLei\ for some language bound
-%D labels and texts, and implementing these was rather
-%D straightforward. But, there were still some issues to deal
-%D with: conversion of numbers, date handling and index
-%D sorting.
-%D
-%D I consider(ed) writing Chinese support to be a nice puzzle,
-%D since I have to act on chinese \CONTEXT\ code, where I only
-%D understand the \CONTEXT\ part. The drawings \WangLei\ made
-%D me (in drawing packages) were of great help. Since I write
-%D these modules from scratch, although I fall back on some
-%D basic encoding and font modules, I consider them to be
-%D rather clean. This cannot be said of all \CONTEXT\ font
-%D modules \type {-)}.
-
-\unprotect
-
-%D Because Chinese glyphs have more height than the average
-%D Latin glyph, and at the same time don't have much depth,
-%D we adapt the scale.
-%D
-%D Before and after the glyph we have to deal with Chinese
-%D spacing. Special attention is given to punctuation.
-%D
-%D \starttyping
-%D [some short nice chinese text with () and english]
-%D \stoptyping
-%D
-%D We insert a bit of stretch and introduce a signal to
-%D keep track of previous characters. We use a similar
-%D method in the units module, which may be a nice
-%D introduction to using signals.
-
-%D \macros
-%D {chineseunicodescale, chineseinterglyphskip,
-%D chineseunicodeheight, chineseunicodedepth, chinesespace}
-%D
-%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}
-
-%D We define a few signals. As said, another example of
-%D using signals can be found in the module \type {m-units}.
-
-\newsignal\chineseLsignal % left boundary character
-\newsignal\chineseRsignal % right boundary character
-\newsignal\chineseSsignal % any other character (symbol)
-
-\chardef\chineseBstatus=0 % 0=unknown 1=left 2=right 3=chinese 4=nospace
-\chardef\chineseAstatus=0 % 0=unknown 1=left 2=right 3=space
-\chardef\chineseSstatus=0 % 0=unknown 1=left 2=right
-
-\sfcode`(=2000 % a temporary hack
-
-\def\chinesenobreak
- {\relax
- \iftracechinese
- \nobreak
- \kern-.5pt\color[red]{\vrule\!!width1pt}\kern-.5pt
- \nobreak
- \else
- \nobreak
- \fi}
-
-\newif\ifcorrectchineseboundarychars
-
-\def\chineseunskip
- {\unskip\unskip\unskip\unskip}
-
-\def\insertchineseglyph
- {\iftracechinese\tracedchineseglyph\else\insertunicodeglyph\fi}
-
-\newif\ifverticalchinese
-
-\def\handlechineseunicodeglyph
- {\ifinpagebody
- \horizontalchineseunicodeglyph
- \else\ifverticalchinese
- \verticalchineseunicodeglyph
- \else
- \horizontalchineseunicodeglyph
- \fi\fi}
-
-% chinese classes: left=1|right=2|center=3
-
-\chardef\plusfour=4
-
-\def\analyzechineseunicodeglyph % beware, no zerocount !
- {\chardef\chineseSstatus0\getvalue{uc\number\unicodeposition}\relax}
-
-\def\analyzechineseunicodeenviroment
- {% left
- \ifx (\nextutoken \chardef\chineseAstatus\plusone \else
- \ifx [\nextutoken \chardef\chineseAstatus\plusone \else
- % right
- \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\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?
- \chardef\chineseBstatus\ifdim\lastskip=\zeropoint\plusfour\else\zerocount\fi
- \ifdim\lastskip=\chineseLsignal \chardef\chineseBstatus\plusone \else
- \ifdim\lastskip=\chineseRsignal \chardef\chineseBstatus\plustwo \else
- \ifdim\lastskip=\chineseSsignal \chardef\chineseBstatus\plusthree \else
- \scratchskip=\lastskip \unskip
- \ifdim\lastskip=\chineseLsignal \chardef\chineseBstatus\plusone \else
- \ifdim\lastskip=\chineseRsignal \chardef\chineseBstatus\plustwo \else
- \ifdim\lastskip=\chineseSsignal \chardef\chineseBstatus\plusthree \else
- \space\scratchskip=\lastskip \unskip
- \setbox\scratchbox=\hbox\bgroup
- (\space
- \ifdim\lastskip=\scratchskip
- \egroup \chardef\chineseBstatus\plusone
- \else
- \egroup
- \ifdim\scratchskip=\zeropoint \chardef\chineseBstatus\plusfour \fi
- \fi
- \fi\fi\fi
- \fi\fi\fi}
-
-\def\horizontalchineseunicodeglyph
- {\relax
- \ifhmode\else\dontleavehmode\fi % added
- \setunicodescale\chineseunicodescale % redundant
- \setunicodestrut\chineseunicodeheight\chineseunicodedepth % redundant
- \ifprocessingverbatim
- \iftracechinese
- \ruledhbox{\insertunicodeglyph}%
- \else
- \insertunicodeglyph
- \fi
- \else\ifx\nextutoken\relax
- \insertunicodeglyph
- \else
- \analyzechineseunicodeglyph
- \analyzechineseunicodeenviroment
- \ifcase\chineseSstatus\relax
- \ifcase\chineseBstatus\relax
- \chineseunskip
- \hskip\chinesesurroundskip % unknown
- \or
- \chineseunskip
- \chinesenobreak % left
- \or
- \ifcorrectchineseboundarychars\else\chineseunskip\fi
- \hskip\chineseinterglyphskip % right
- \or
- \chineseunskip
- \hskip\chineseinterglyphskip % chinese
- \or
- % whatever
- \fi
- \insertchineseglyph
- \ifcase\chineseAstatus\relax
- \hskip\chineseinterglyphskip % unknown
- \hskip\chinesesurroundskip
- \ifcase\chineseSstatus
- \hskip\chineseSsignal
- \or
- \hskip\chineseLsignal
- \else
- \hskip\chineseRsignal
- \fi
- \or
- \hskip\chineseinterglyphskip % left
- \chinesenobreak
- \hskip\chineseLsignal
- \or
- \chinesenobreak % right
- \hskip\chineseinterglyphskip
- \chinesenobreak
- \hskip\chineseRsignal
- \or
- \hskip\chineseinterglyphskip % space
- \hskip\chinesesurroundskip
- \hskip\chineseSsignal
- \fi
- \or % left
- \ifcorrectchineseboundarychars
- \let\unicodecharcommand\chineseleftcharcommand
- \fi
- \chineseunskip
- \insertchineseglyph
- \chinesenobreak
- \hskip\chineseLsignal
- \or % right
- \ifcorrectchineseboundarychars
- \let\unicodecharcommand\chineserightcharcommand
- \fi
- \chineseunskip
- \chinesenobreak
- \insertchineseglyph
- \hskip\chineseRsignal
- \else % center
- \chineseunskip
- \chinesenobreak
- \insertchineseglyph
- \hskip\chineseinterglyphskip
- \hskip\chineseRsignal
- \fi\fi
- \aftergroup\ignorespaces % watch this
- \fi}
-
-\def\verticalchineseunicodeglyph
- {\relax
- \ifprocessingverbatim % to do
- \horizontalchineseunicodeglyph
- \else
- \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
- \aftergroup\ignorespaces % watch this
- \fi}
-
-%D \macros
-%D {setupchinese,startvertical,nochinese}
-%D
-%D The previous macros implement horizontal as well as
-%D vertical typesetting. Vertical typesetting is implemented
-%D on top of the multi||column routines.
-
-\def\setupchinese
- {\dodoubleargument\getparameters[\??vt]}
-
-\def\startvertical
- {\dosingleempty\dostartvertical}
-
-\def\dostartvertical[#1]%
- {\bgroup
- \def\maxnofcolumns{25}%
- \verticalchinesetrue
- \global\chardef\prevchineseSstatus\zerocount
- \let\nochinese\nochineseinvertical
- \doif\@@vtn\v!fit
- {\dimen0=\textwidth \advance\dimen0 \@@vtdistance
- \dimen2=\bodyfontsize \advance\dimen2 \@@vtdistance
- \divide\dimen0 \number\dimen2
- \edef\@@vtn{\number\dimen0}}%
- \startcolumns
- [\c!direction=\@@vtdirection,
- \c!balance=\@@vtbalance,
- \c!distance=\@@vtdistance,
- \c!n=\@@vtn,
- #1]}
-
-\def\stopvertical
- {\stopcolumns
- \egroup}
-
-\setupchinese
- [\c!direction=\v!left,
- \c!balance=\v!no,
- \c!n=\v!fit,
- \c!distance=1.5\bodyfontsize]
-
-%D We can set up vertical typesetting with \type
-%D {\setupchinese}.
-
-%D \macros
-%D {nochineseinvertical}
-%D
-%D English (non chinese) text is typeset rotated:
-
-\def\nochineseinvertical#1%
- {\par
- \setbox\scratchbox\hbox{\strut#1}
- \getnoflines{\wd\scratchbox}
- \setbox\scratchbox\hbox to \noflines\openlineheight
- {\hss\box\scratchbox\hss}
- \hbox to \hsize
- {\hss
- \rotate
- [\c!rotation=270]
- {\vbox to \ht\scratchbox{\vss\box\scratchbox\vss}}%
- \hss}
- \par}
-
-%D \macros
-%D {correctchineseboundarychars}
-%D
-%D Careful reading of the previous macro learns that we
-%D treat left and right glyphs differently. When we say
-%D
-%D \starttyping
-%D \correctchineseboundarycharstrue
-%D \stoptyping
-%D
-%D For the moment correction in on by default.
-
-\correctchineseboundarycharstrue
-
-\def\chineserightcharcommand#1%
- {\iftracechinese\ruledhbox\else\hbox\fi \!!to .5em{#1\hss}%
- \hskip.25em\!!plus .25em\relax}%
-
-\def\chineseleftcharcommand#1%
- {\ifnum\chineseBstatus<4 \hskip.25em \!!plus .25em\relax\fi
- \iftracechinese\ruledhbox\else\hbox\fi \!!to .5em{\hss#1}}%
-
-% \def\chineserightcharcommand#1%
-% {\setbox\scratchbox=\hbox{#1}%
-% \scratchdimen=.5em
-% \ifdim\wd\scratchbox>\scratchdimen
-% \iftracechinese\ruledhbox\else\hbox\fi \!!to \scratchdimen
-% {\box\scratchbox\hss}%
-% \hskip.5\scratchdimen\!!plus.5\scratchdimen\relax
-% \else
-% \box\scratchbox
-% \fi}
-
-% \def\chineseleftcharcommand#1%
-% {\setbox\scratchbox=\hbox{#1}%
-% \scratchdimen=.5em
-% \ifdim\wd\scratchbox>\scratchdimen
-% \ifnum\chineseBstatus<4
-% \hskip.5\scratchdimen\!!plus.5\scratchdimen\relax
-% \fi
-% \iftracechinese\ruledhbox\else\hbox\fi \!!to \scratchdimen
-% {\hss\box\scratchbox}%
-% \else
-% \box\scratchbox
-% \fi}
-
-%D The long list of numbers in the previous macro identify the
-%D characters where special care is needed for breaking lines.
-%D A linebreak is not permitted before:
-%D
-%D \def\DoIt #1 #2 %
-%D {\hbox{\hbox to 2em{\uchar{#1}{#2}\hss}#1 #2}\par}
-%D
-%D \startcolumns[n=5]
-%D \DoIt 161 162 \DoIt 161 163 \DoIt 161 164 \DoIt 161 167 \DoIt 161 173
-%D \DoIt 161 175 \DoIt 161 177 \DoIt 161 179 \DoIt 161 181 \DoIt 161 183
-%D \DoIt 161 185 \DoIt 161 187 \DoIt 161 189 \DoIt 161 191 \DoIt 161 227
-%D \DoIt 161 228 \DoIt 161 229 \DoIt 163 161 \DoIt 163 162 \DoIt 163 167
-%D \DoIt 163 169 \DoIt 163 172 \DoIt 163 174 \DoIt 163 186 \DoIt 163 187
-%D \DoIt 163 190 \DoIt 163 191 \DoIt 163 221 \DoIt 163 253
-%D \stopcolumns
-%D
-%D A linebreak is not permitted after the following glyphs:
-%D
-%D \startcolumns[n=5]
-%D \DoIt 161 174 \DoIt 161 176 \DoIt 161 178 \DoIt 161 180 \DoIt 161 182
-%D \DoIt 161 184 \DoIt 161 186 \DoIt 161 188 \DoIt 161 190 \DoIt 163 168
-%D \DoIt 163 219 \DoIt 163 224 \DoIt 163 251
-%D \stopcolumns
-
-%D \macros
-%D {tracechinesetrue, showchinesetracelegend}
-%D
-%D When we say \type {\tracechinesetrue}, we get some
-%D insight in the way \CONTEXT\ handles the Chinese glyphs.
-%D The symbols and color used represent:
-%D
-%D \showchinesetracelegend
-
-\newif\iftracechinese
-
-\def\showchinesetracelegend
- {\definetabulate[\s!dummy][|c|l|l|l|]%
- \startdummy
- \HL
- \NC \bf key \NC \bf meaning \NC \bf glyph \NC \bf keys \NC\NR
- \HL
- \NC u \NC unknown character type \NC \color[green]{current} \NC u l r \NC\NR
- \NC l \NC left boundary character \NC \color[red]{previous} \NC u l r c n \NC\NR
- \NC r \NC right boundary character \NC \color[blue]{next} \NC u l r s \NC\NR
- \NC c \NC chinese character \NC \NC \NC\NR
- \NC s \NC following space \NC \NC \NC\NR
- \NC n \NC no preceding space \NC \NC \NC\NR
- \HL
- \stopdummy}
-
-\def\tracedchineseglyph
- {\dontleavehmode
- \ruledhbox
- {\setbox\scratchbox\hbox{\insertunicodeglyph}%
- \hbox to \wd\scratchbox
- {\localcolortrue
- \copy\scratchbox
- \infofont
- \hskip-\wd\scratchbox
- \hbox to \wd\scratchbox
- {\hss
- \color[green]{\ifcase\chineseSstatus\relax u\or l\or r\fi}%
- \hss}%
- \hskip-\wd\scratchbox
- \lower\dp\scratchbox\hbox to \wd\scratchbox
- {\hss
- \color[red]{\ifcase\chineseBstatus\relax u\or l\or r\or c\or n\fi}%
- \hss
- \color[blue]{\ifcase\chineseAstatus\relax u\or l\or r\or s\fi}%
- \hss}}}}
-
-%D The following example shows how tracing works.
-%D
-%D \start \tracechinesetrue
-%D ÔÚÕâÒ»´Î¸üÐÂÖÐÎÒÃǽ«½éÉܶÔÖÐÎĵÄÖ§³Ö¡£µ±±¾ÎĵÄÖÐÎÄÒëÕßÍõÀÚ
-%D ѯÎÊÎÒ \nochinese{\CONTEXT} ÊÇ·ñÄÜ´¦ÀíººÓïʱ£¬ËûÒѾ­³¢ÊÔ¹ý
-%D ÔËÐÐÏÖÓеĺ꼯£¬µ«ÊÇûÓеõ½½á¹û¡£ÕâÒâζ×ŶÔÖÐÎĵÄÖ§³Ö»¹Ã»
-%D ÓÐʵÏÖ¡£
-%D
-%D ÔÚÕâÒ»(´Î¸üÐÂ)ÖÐÎÒÃÇ (½«½é) ÉܶÔÖÐÎĵÄÖ§³Ö¡£µ±±¾ÎĵÄÖÐÎÄÒë,
-%D ÕßÍõÀÚѯÎÊÎÒ\nochinese{\CONTEXT}ÊÇ·ñÄÜ´¦ÀíººÓïʱ£¬ËûÒѾ­³¢
-%D ÊÔ¹ýÔËÐÐÏÖÓеĺ꼯£¬µ«ÊÇûÓеõ½½á¹û¡£ÕâÒâζ×ŶÔÖÐÎĵÄÖ§³Ö
-%D »¹Ã»ÓÐʵÏÖ¡£.
-%D \stop
-
-%D Because fonts are defined each time a \UNICODE\ is
-%D encountered |<|which is less inefficient than one would
-%D imagine, because \TEX\ is optimized quite well in this
-%D repect|>| we can define macros like this to take care of
-%D font switches. When available, one can add definitions
-%D for italic, slanted, bold fonts and combinations of these.
-
-%D \macros
-%D {chinesenumber}
-%D
-%D The chinese numbering systems rather straightforward. First
-%D there are the digits:
-%D
-%D \starttabulate[|c|c|c|c|c|c|c|c|c|c|]
-%D \NC 0 \NC 1 \NC 2 \NC 3 \NC 4 \NC 5 \NC 6 \NC 7 \NC 8 \NC 9 \NC\NR
-%D \NC \chinesenumber{0} \NC \chinesenumber{1} \NC \chinesenumber{2}
-%D \NC \chinesenumber{3} \NC \chinesenumber{4} \NC \chinesenumber{5}
-%D \NC \chinesenumber{6} \NC \chinesenumber{7} \NC \chinesenumber{8}
-%D \NC \chinesenumber{9} \NC\NR
-%D \stoptabulate
-%D
-%D Apart from these numbers, we have dedicated representations
-%D of some powers of~$10$.
-%D
-%D \starttabulate[|c|c|c|c|c|]
-%D \NC 10 \NC 100 \NC 1000 \NC 10000 \NC 100000000 \NC\NR
-%D \NC \chinesenumber{10} \NC \chinesenumber{100}
-%D \NC \chinesenumber{1000} \NC \chinesenumber{10000}
-%D \NC \chinesenumber{100000000} \NC\NR
-%D \stoptabulate
-%D
-%D The number~12 is a combination of $1\times10+2$, or:
-%D \chinesenumber {12}, while~22 becomes \chinesenumber {22}.
-%D The numbers below 20 are treated a bit different, just like
-%D numbers with series of $0$'s. So $2\times10$ comes out as
-%D two glyphs, but $1\times10$ as one, because in the latter
-%D case the~$1$ is redundant. The same is true for the powers
-%D of~10.
-%D
-%D \starttabulate[|r|r|r|r|r|r|]
-%D \NC 1 \NC \chinesenumber {1} \NC
-%D 9 \NC \chinesenumber {9} \NC
-%D 4 \NC \chinesenumber {4} \NC\NR
-%D \NC 11 \NC \chinesenumber {11} \NC
-%D 99 \NC \chinesenumber {99} \NC
-%D 16 \NC \chinesenumber {16} \NC\NR
-%D \NC 111 \NC \chinesenumber {111} \NC
-%D 999 \NC \chinesenumber {999} \NC
-%D 256 \NC \chinesenumber {256} \NC\NR
-%D \NC 1111 \NC \chinesenumber {1111} \NC
-%D 9999 \NC \chinesenumber {9999} \NC
-%D 65536 \NC \chinesenumber {65536} \NC\NR
-%D \stoptabulate
-%D
-%D The implementation is rather simple. For internal purposes,
-%D we let zero expand to~0. The digits $0-9$ and numbers $10$,
-%D $100$, $1000$, $10000$ and $100000000$ are hard coded.
-
-% This was the first implementation, before \WangLei\ asked
-% me to look into Big Five encoding, so, like everthing in
-% \TEX, things become a bit more complicated, but also more
-% versatile.
-%
-% \starttypen
-% \def\chinesedigit#1%
-% {\ifnum #1=100000000 \uchar{210}{218}% 100000000
-% \else\ifnum #1=10000 \uchar{205}{242}% 10000
-% \else\ifnum #1=1000 \uchar{199}{167}% 1000
-% \else\ifnum #1=100 \uchar{176}{217}% 100
-% \else\ifnum #1=10 \uchar{202}{174}% 10
-% \else\ifcase#1 \uchar{193}{227}% 0
-% \or \uchar{210}{187}% 1
-% \or \uchar{182}{254}% 2
-% \or \uchar{200}{253}% 3
-% \or \uchar{203}{196}% 4
-% \or \uchar{206}{229}% 5
-% \or \uchar{193}{249}% 6
-% \or \uchar{198}{223}% 7
-% \or \uchar{176}{203}% 8
-% \or \uchar{190}{197}% 9
-% \fi\fi\fi\fi\fi\fi}
-% \stoptypen
-
-%D We will implement four methods, the one described earlier,
-%D a derived one with capitalized characters, an extended
-%D version of the first method, and a rather Arabic method.
-%D
-%D \starttabulate[|l|l|]
-%D \HL
-%D \NC \bf command \NC \bf number 39 \NC\NR
-%D \HL
-%D \NC \type{\normalchinesenumber} \NC \normalchinesenumber {39} \NC\NR
-%D \NC \type{\capitalizedchinesenumber} \NC \capitalizedchinesenumber{39} \NC\NR
-%D \NC \type{\arabicchinesenumber} \NC \arabicchinesenumber {39} \NC\NR
-%D \NC \type{\extendedchinesenumber} \NC \extendedchinesenumber {39} \NC\NR
-%D \HL
-%D \stoptabulate
-%D
-%D We use a dirty trick to enable Chinese Capital Digits. In
-%D the encoding vectors, we define these by appending a suffix
-%D \type {*} to the digit, which in the following macro is
-%D appended or not (by passing \type {\empty}).
-
-\def\chinesedigit#1#2% #2: suffix, here * or \empty
- {\udigit{\chineseencoding}{\number#1#2}}
-
-% Normal Chinese Number
-
-\def\normalchinesenumber#1%
- {\expandafter\dochinesenumber\number#1\relax\empty}
-
-\def\dochinesenumber#1#2\relax#3%
- {\ifnum#1#2<10 % 1-10
- \chinesedigit{#1}#3%
- \else\ifnum#1#2<20 % 11-99
- \chinesedigit{10}#3%
- \dodochinesenumberA#2\relax#3%
- \else
- \dodochinesenumber#1#2\relax#3%
- \fi\fi}
-
-\def\dodochinesenumber#1#2\relax#3%
- {\ifnum#1=0
- \chinesedigit{0}#3%
- \dododochinesenumber0#2\relax#3%
- \else\ifnum#1#2<10 % 1-10
- \chinesedigit{#1#2}#3%
- \dodochinesenumberA#2\relax#3%
- \else\ifnum#1#2<100 % 11-99
- \dodochinesenumber#1\relax#3%
- \chinesedigit{10}#3%
- \dodochinesenumberA#2\relax#3%
- \else\ifnum#1#2<1000 % 100-999
- \dodochinesenumber#1\relax#3%
- \chinesedigit{100}#3%
- \dodochinesenumberA#2\relax#3%
- \else\ifnum#1#2<10000 % 1000-9999
- \dodochinesenumber#1\relax#3%
- \chinesedigit{1000}#3%
- \dodochinesenumberA#2\relax#3%
- \else\ifnum#1#2<100000 % 10000-99999
- \dodochinesenumber#1\relax#3%
- \chinesedigit{10000}#3%
- \dodochinesenumberA#2\relax#3%
- \else\ifnum#1#2<1000000 % 100000-999999
- \dodochinesenumberB#1#2\relax#3%
- \else\ifnum#1#2<10000000 % 1000000-9999999
- \dodochinesenumberC#1#2\relax#3%
- \else\ifnum#1#2<100000000 % 10000000-99999999
- \dodochinesenumberD#1#2\relax#3%
- \else\ifnum#1#2<1000000000 % 10000000-99999999
- \dochinesenumber#1\relax#3%
- \chinesedigit{100000000}#3%
- \dododochinesenumber#2\relax#3%
- \else
- \dodochinesenumberE#1#2\relax#3%
- \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
-
-\def\dododochinesenumber#1#2\relax#3%
- {\ifnum#1=0
- \ifnum0#2>0 \dododochinesenumber#2\relax#3\fi
- \else
- \dodochinesenumber#1#2\relax#3%
- \fi}
-
-\def\dodochinesenumberA#1\relax#2%
- {\ifcase0#1 \else\dodochinesenumber#1\relax#2\fi}
-
-\def\dodochinesenumberB#1#2#3\relax#4%
- {\dochinesenumber#1#2\relax#4%
- \chinesedigit{10000}#4%
- \dododochinesenumber#3\relax#4}
-
-\def\dodochinesenumberC#1#2#3#4\relax#5%
- {\dochinesenumber#1#2#3\relax#5%
- \chinesedigit{10000}#5%
- \dododochinesenumber#4\relax#5}
-
-\def\dodochinesenumberD#1#2#3#4#5\relax#6%
- {\dochinesenumber#1#2#3#4\relax#6%
- \chinesedigit{10000}#6%
- \dododochinesenumber#5\relax#6}
-
-\def\dodochinesenumberE#1#2#3\relax#4%
- {\dochinesenumber#1#2\relax#4%
- \chinesedigit{100000000}#4%
- \dododochinesenumber#3\relax#4}
-
-% Capitalized Chinese Number
-
-\def\capitalizedchinesenumber#1%
- {\expandafter\dochinesenumber\number#1\relax*}
-
-% Extended Chinese Number
-
-\def\extendedchinesenumber#1%
- {\expandafter\doextendedchinesenumber\number#1\relax}
-
-\def\doextendedchinesenumber#1#2\relax%
- {\ifnum #1#2<20 % 0-19
- \dochinesenumber#1#2\relax\empty
- \else\ifnum#1#2<30 % 20-29
- \chinesedigit{20}\empty
- \ifcase#2\else\chinesedigit{2#2}\fi
- \else\ifnum#1#2<40 % 30-39
- \chinesedigit{30}\empty
- \ifcase#2\else\chinesedigit{3#2}\fi
- \else
- \dochinesenumber#1#2\relax\empty
- \fi\fi\fi}
-
-% Arabic Chinese Number
-
-\def\arabicchinesenumber#1%
- {\expandafter\doarabicchinesenumber\number#1@\relax}
-
-\def\doarabicchinesenumber#1#2\relax
- {\if#1@\else
- \chinesedigit{#1}\empty
- \doarabicchinesenumber#2\relax
- \fi}
-
-% The short call:
-
-\def\chinesenumber{\normalchinesenumber}
-
-% \dorecurse{40}
-% {\hbox
-% {\processingverbatimtrue
-% \hbox to 1cm{\hss\recurselevel}\quad
-% \hbox to 3cm{\hss\strut\normalchinesenumber {\recurselevel}}\quad
-% \hbox to 3cm{\hss\strut\capitalizedchinesenumber{\recurselevel}}\quad
-% \hbox to 3cm{\hss\strut\arabicchinesenumber {\recurselevel}}\quad
-% \hbox to 3cm{\hss\strut\extendedchinesenumber {\recurselevel}}\crlf}}
-
-%D The next table demonstates the correctness of the
-%D conversion macro.
-%D
-%D \startbuffer
-%D \starttable[|l|l|l|l|l|l|]
-%D \HL
-%D \NC number \NC converter \NC hard coded \NC
-%D number \NC converter \NC hard coded\NC \SR
-%D \HL
-%D \NC 1 \NC \chinesenumber{1} \NC Ò» \NC
-%D 0 \NC \chinesenumber{0} \NC Áã \NC\FR
-%D \NC 11 \NC \chinesenumber{11} \NC ʮһ \NC
-%D 10 \NC \chinesenumber{10} \NC Ê® \NC\MR
-%D \NC 111 \NC \chinesenumber{111} \NC Ò»°Ùһʮһ \NC
-%D 100 \NC \chinesenumber{100} \NC Ò»°Ù \NC\MR
-%D \NC 101 \NC \chinesenumber{101} \NC Ò»°ÙÁãÒ» \NC
-%D 120 \NC \chinesenumber{120} \NC Ò»°Ù¶þÊ® \NC\MR
-%D \NC 1111 \NC \chinesenumber{1111} \NC һǧһ°Ùһʮһ \NC
-%D 1000 \NC \chinesenumber{1000} \NC һǧ \NC\MR
-%D \NC 1001 \NC \chinesenumber{1001} \NC һǧÁãÒ» \NC
-%D 1020 \NC \chinesenumber{1020} \NC һǧÁã¶þÊ® \NC\MR
-%D \NC 11111 \NC \chinesenumber{11111} \NC Ò»Íòһǧһ°Ùһʮһ \NC
-%D 10000 \NC \chinesenumber{10000} \NC Ò»Íò \NC\MR
-%D \NC 10001 \NC \chinesenumber{10001} \NC Ò»ÍòÁãÒ» \NC
-%D 10200 \NC \chinesenumber{10200} \NC Ò»ÍòÁã¶þ°Ù \NC\LR
-%D \HL
-%D \NC 111111 \NC \chinesenumber{111111} \NC ʮһÍòһǧһ°Ùһʮһ \NC
-%D 100000 \NC \chinesenumber{100000} \NC Ê®Íò \NC\FR
-%D \NC 1111111 \NC \chinesenumber{1111111} \NC Ò»°ÙһʮһÍòһǧһ°Ùһʮһ \NC
-%D 1000000 \NC \chinesenumber{1000000} \NC Ò»°ÙÍò \NC\MR
-%D \NC 11111111 \NC \chinesenumber{11111111} \NC һǧһ°ÙһʮһÍòһǧһ°Ùһʮһ \NC
-%D 10000000 \NC \chinesenumber{10000000} \NC һǧÍò \NC\MR
-%D \NC 111111111 \NC \chinesenumber{111111111} \NC Ò»ÒÚһǧһ°ÙһʮһÍòһǧһ°Ùһʮһ \NC
-%D 100000000 \NC \chinesenumber{100000000} \NC Ò»ÒÚ \NC\MR
-%D \NC 1111111111 \NC \chinesenumber{1111111111} \NC ʮһÒÚһǧһ°ÙһʮһÍòһǧһ°Ùһʮһ \NC
-%D 1000000000 \NC \chinesenumber{1000000000} \NC Ê®ÒÚ \NC\LR
-%D \HL
-%D \stoptable
-%D \stopbuffer
-%D
-%D \placetable{Some Chinese number examples.}{\getbuffer}
-
-%D Although the conversion can be hooked into most commands
-%D that deal with numbers |<|those familiar with \TEX\ macro
-%D programming will notice that the macro if fully
-%D expandable|>| in many cases Chinese documents use western
-%D digits. So, in practice, the change that the next example
-%D shows up, is minimal.
-%D
-%D \starttabulate[|r|r|c|]
-%D \NC 2546 \NC \chinesenumber {2546} \NC \NC\NR
-%D \NC 9258 \NC \chinesenumber {9258} \NC $+$ \NC\NR
-%D \HL
-%D \NC 11804 \NC \chinesenumber {11804} \NC \NC\NR
-%D \stoptabulate
-%D
-%D While in arabic arithmics addition leads to more digits, in
-%D Chinese the number of glyphs can (temporary) decrease.
-%D Given that the number of people dealing with Chinese is
-%D considerably larger than the number of latin speaking
-%D people, a successor of \TEX\ definitely must provide a
-%D \type {\chinesenumeral} primitive.
-
-\defineconversion [c] [\normalchinesenumber]
-\defineconversion [chinese] [\normalchinesenumber]
-\defineconversion [nc] [\normalchinesenumber]
-\defineconversion [normalchinese] [\normalchinesenumber]
-\defineconversion [cc] [\capitalizedchinesenumber]
-\defineconversion [capitalizedchinese] [\capitalizedchinesenumber]
-\defineconversion [ec] [\extendedchinesenumber]
-\defineconversion [extendedchinese] [\extendedchinesenumber]
-\defineconversion [ac] [\arabicchinesenumber]
-\defineconversion [arabicchinese] [\arabicchinesenumber]
-
-%D Date conversion:
-
-\defineconversion [cn] [\v!day] [\chinesenumber]
-\defineconversion [cn] [\v!month] [\chinesenumber]
-\defineconversion [cn] [\v!year] [\chinesenumber]
-
-%D \macros
-%D {SimChi, TraChi}
-%D
-%D These components enable us to construct dedicated Chinese
-%D font switches, like:
-
-\setupunicodefont
- [chinese]
- [ \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
-%D definition to the \type {\chineseencoding} macro.
-
-\let\chineseencoding\empty
-
-\def\setchineseencoding % normally SomeChineseRegular
- {\getfontfileparameters\unicodestyle
- \ifx\currentfontfileencoding\undefined \else
- \let\chineseencoding\currentfontfileencoding
- \fi}
-
-%D We could have said:
-%D
-%D \starttyping
-%D \defineunicodefont
-%D [SimChi]
-%D [SimplifiedChinese]
-%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 \stoptyping
-%D
-%D However, the former definitions is more general. Next we
-%D map a few fonts:
-
-\definefontsynonym [SimplifiedChineseRegular] [gbsong] [encoding=gbk]
-\definefontsynonym [SimplifiedChineseSlanted] [gbsongsl] [encoding=gbk]
-\definefontsynonym [SimplifiedChineseItalic] [gbsongsl] [encoding=gbk]
-\definefontsynonym [SimplifiedChineseBold] [gbhei] [encoding=gbk]
-\definefontsynonym [SimplifiedChineseBoldSlanted] [gbheisl] [encoding=gbk]
-\definefontsynonym [SimplifiedChineseBoldItalic] [gbheisl] [encoding=gbk]
-
-\definefontsynonym [TraditionalChineseRegular] [b5song] [encoding=big5]
-\definefontsynonym [TraditionalChineseSlanted] [b5songsl] [encoding=big5]
-\definefontsynonym [TraditionalChineseItalic] [b5songsl] [encoding=big5]
-\definefontsynonym [TraditionalChineseBold] [b5hei] [encoding=big5]
-\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]
-
-%D We default to these so called Simplified Chinese fonts.
-
-\SimChi
-
-%D In addition to these fonts, we (pre|)|define some commonly
-%D used fonts:
-
-\definefontsynonym [SimplifiedChineseSongTiRegular] [gbsong] [encoding=gbk]
-\definefontsynonym [SimplifiedChineseSongTiSlanted] [gbsongsl] [encoding=gbk]
-\definefontsynonym [SimplifiedChineseSongTiBold] [gbsong] [encoding=gbk]
-\definefontsynonym [SimplifiedChineseSongTiBoldSlanted] [gbsongsl] [encoding=gbk]
-
-\definefontsynonym [TraditionalChineseSongTiRegular] [b5song] [encoding=big5]
-\definefontsynonym [TraditionalChineseSongTiSlanted] [b5songsl] [encoding=big5]
-\definefontsynonym [TraditionalChineseSongTiBold] [b5song] [encoding=big5]
-\definefontsynonym [TraditionalChineseSongTiBoldSlanted] [b5songsl] [encoding=big5]
-
-\definefontsynonym [SimplifiedChineseHeiTiRegular] [gbhei] [encoding=gbk]
-\definefontsynonym [SimplifiedChineseHeiTiSlanted] [gbheisl] [encoding=gbk]
-\definefontsynonym [SimplifiedChineseHeiTiBold] [gbhei] [encoding=gbk]
-\definefontsynonym [SimplifiedChineseHeiTiBoldSlanted] [gbheisl] [encoding=gbk]
-
-\definefontsynonym [TraditionalChineseHeiTiRegular] [b5hei] [encoding=big5]
-\definefontsynonym [TraditionalChineseHeiTiSlanted] [b5heisl] [encoding=big5]
-\definefontsynonym [TraditionalChineseHeiTiBold] [b5hei] [encoding=big5]
-\definefontsynonym [TraditionalChineseHeiTiBoldSlanted] [b5heisl] [encoding=big5]
-
-\definefontsynonym [SimplifiedChineseKaiTiRegular] [gbkai] [encoding=gbk]
-\definefontsynonym [SimplifiedChineseKaiTiSlanted] [gbkaisl] [encoding=gbk]
-\definefontsynonym [SimplifiedChineseKaiTiBold] [gbkai] [encoding=gbk]
-\definefontsynonym [SimplifiedChineseKaiTiBoldSlanted] [gbkaisl] [encoding=gbk]
-
-\definefontsynonym [TraditionalChineseKaiTiRegular] [b5kai] [encoding=big5]
-\definefontsynonym [TraditionalChineseKaiTiSlanted] [b5kaisl] [encoding=big5]
-\definefontsynonym [TraditionalChineseKaiTiBold] [b5kai] [encoding=big5]
-\definefontsynonym [TraditionalChineseKaiTiBoldSlanted] [b5kaisl] [encoding=big5]
-
-\definefontsynonym [SimplifiedChineseFangSongRegular] [gbfs] [encoding=gbk]
-\definefontsynonym [SimplifiedChineseFangSongSlanted] [gbfssl] [encoding=gbk]
-\definefontsynonym [SimplifiedChineseFangSongBold] [gbfs] [encoding=gbk]
-\definefontsynonym [SimplifiedChineseFangSongBoldSlanted] [gbfssl] [encoding=gbk]
-
-\definefontsynonym [TraditionalChineseFangSongRegular] [b5fs] [encoding=big5]
-\definefontsynonym [TraditionalChineseFangSongSlanted] [b5fssl] [encoding=big5]
-\definefontsynonym [TraditionalChineseFangSongBold] [b5fs] [encoding=big5]
-\definefontsynonym [TraditionalChineseFangSongBoldSlanted] [b5fssl] [encoding=big5]
-
-\definefontsynonym [SimplifiedChineseLiShuRegular] [gbli] [encoding=gbk]
-\definefontsynonym [SimplifiedChineseLiShuSlanted] [gblisl] [encoding=gbk]
-\definefontsynonym [SimplifiedChineseLiShuBold] [gbli] [encoding=gbk]
-\definefontsynonym [SimplifiedChineseLiShuBoldSlanted] [gblisl] [encoding=gbk]
-
-\definefontsynonym [TraditionalChineseLiShuRegular] [b5li] [encoding=big5]
-\definefontsynonym [TraditionalChineseLiShuSlanted] [b5lisl] [encoding=big5]
-\definefontsynonym [TraditionalChineseLiShuBold] [b5li] [encoding=big5]
-\definefontsynonym [TraditionalChineseLiShuBoldSlanted] [b5lisl] [encoding=big5]
-
-%D The following definitions provide us the commands to switch
-%D to these fonts.
-
-\defineunicodefont [SimSongTi] [SimplifiedChineseSongTi] [chinese]
-\defineunicodefont [TraSongTi] [TraditionalChineseSongTi] [chinese]
-
-\defineunicodefont [SimHeiTi] [SimplifiedChineseHeiTi] [chinese]
-\defineunicodefont [TraHeiTi] [TraditionalChineseHeiTi] [chinese]
-
-\defineunicodefont [SimKaiTi] [SimplifiedChineseKaiTi] [chinese]
-\defineunicodefont [TraKaiTi] [TraditionalChineseKaiTi] [chinese]
-
-\defineunicodefont [SimFangSong] [SimplifiedChineseFangSong] [chinese]
-\defineunicodefont [TraFangSong] [TraditionalChineseFangSong] [chinese]
-
-\defineunicodefont [SimLiShu] [SimplifiedChineseLiShu] [chinese]
-\defineunicodefont [TraLiShu] [TraditionalChineseLiShu] [chinese]
-
-% \definealternativestyle [ChineseTitleFont] [\bfd\SimKaiTi] []
-
-%D \macros
-%D {purechinese}
-%D
-%D Use this macro to suppress spacing around Chinese text.
-
-\def\purechinese#1% evt geen rek
- {\hskip\chineseSsignal\relax
- #1\unskip\unskip\unskip
- \hskip\chineseSsignal\relax}
-
-%D \macros
-%D {stillchinese}
-%D
-%D Use the next macro when you want the next item to be put
-%D tight to the previous chinese character.
-
-\def\stillchinese
- {\hskip\chineseSsignal\relax}
-
-%D \macros
-%D {nochinese}
-%D
-%D When we want to be sure of non||Chinese inline text,
-%D we can package the for instance english text in \type
-%D {\nochinese}.
-
-\def\nochinese#1%
- {\unskip\unskip\unskip
- \hskip\chinesesurroundskip
- \hskip\chineseinterglyphskip\relax
- #1%
- \hskip\chineseinterglyphskip\relax
- \hskip\chinesesurroundskip
- \ignorespaces}
-
-%D \macros
-%D {chisize}
-%D
-%D Chinese font sizes are specified in a different way,
-%D using positive and negative numbers:
-
-\def\chisize#1%
- {\ifnum#11<0 % a trick to catch -0
- \ifcase#1\space36\or24\or18\or15\or12\or9\or\else6.5\fi
- \else
- \ifcase#1\space42\or26\or22\or16\or14\or10.5\or7.5\or5.5\else5\fi
- \fi pt}
-
-%D So:
-%D
-%D \startbuffer
-%D [\chisize{-1}] [\chisize{7}] [\chisize{+4}]
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D gives:
-%D
-%D \getbuffer
-%D
-%D The full range of sizes is:
-%D
-%D \starttabulate[|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|]
-%D \NC 8 \NC 7 \NC -6 \NC 6 \NC
-%D -5 \NC 5 \NC -4 \NC 4 \NC
-%D -3 \NC 3 \NC -2 \NC 2 \NC
-%D -1 \NC 1 \NC -0 \NC 0 \NC\NR
-%D \NC\chisize {8}\NC\chisize{7}\NC\chisize{-6}\NC\chisize{6}\NC
-%D \chisize{-5}\NC\chisize{5}\NC\chisize{-4}\NC\chisize{4}\NC
-%D \chisize{-3}\NC\chisize{3}\NC\chisize{-2}\NC\chisize{2}\NC
-%D \chisize{-1}\NC\chisize{1}\NC\chisize{-0}\NC\chisize{0}\NC\NR
-%D \stoptabulate
-
-%D Now it's time for some real Chinese. This example
-%D also shows that font switching is supported.
-%D
-%D \startnarrower
-%D \midaligned{\tfd Ë®µ÷¸èÍ·}
-%D \blank
-%D \midaligned{\tfb ±û³½ÖÐÇ»¶Òû´ïµ©£¬´ó×í×÷´Ëƪ£¬¼æ»³×ÓÓÉ¡£}
-%D \blank
-%D \midaligned{\tfb ËÕéø}
-%D \blank
-%D Ã÷Ô¼¸Ê±ÓУ¿°Ñ¾ÆÎÊÇàÌì¡£²»ÖªÌìÉϹ¬ãÚ£¬½ñϦÊǺÎÄꣿÎÒÓû³Ë·ç¹éÈ¥
-%D £¬ÓÖ¿ÖÇíÂ¥ÓñÓ¸ß´¦²»Ê¤º®¡£ÆðÎèŪÇåÓ°£¬ºÎËÆÔÚÈ˼䣿
-%D \blank
-%D תÖì¸ó£¬µÍ»§£¬ÕÕÎÞÃß¡£²»Ó¦Óкޣ¬ºÎÊÂÆ«Ïò±ðʱԲ£¿ÈËÓб¯»¶ÀëºÏ£¬
-%D ÔÂÓÐÒõÇçԲȱ£¬´ËʹÅÄÑÈ«¡£µ«Ô¸È˳¤¾Ã£¬Ç§Àﹲ濾ꡣ
-%D \stopnarrower
-%D
-%D The english translation is:
-%D
-%D \startnarrower
-%D \midaligned{\tfd Tune: Prelude to the Melody of Water}
-%D \blank
-%D \midaligned{\tfb On the night of the Mid||Autumn Festival of
-%D 1076, I drank happily till dawn and wrote this in my cups
-%D while thinking of Zi||you.}
-%D \blank
-%D \midaligned{\tfb Su Shi}
-%D \blank
-%D How long will the bright moon appear? Wine||cup in hand, I
-%D ask the sky. I do not know waht time of year it would be
-%D tonight in the palace on high. Riding the wind, there I
-%D would fly, yet I fear the crystal palace would be far too
-%D high and cold for me. I rise and dance, with my shadow I
-%D play. On high as on earth, would it be as gay?
-%D \blank
-%D The moon goes round the mansion red though gauze||draped
-%D windows soft to shed her light upon the sleepless bed.
-%D Against man she should have no spite. Why then when people
-%D part is she oft full and bright? Men have sorrow and joy,
-%D they part or meet again; The moon may be bright or dim, she
-%D may wax or wane. There has been nothing perfect since the
-%D olden days. So let us wish that man will live long as he
-%D can! Though miles apart, we'll share the beauty she
-%D displays.
-%D \stopnarrower
-
-%D This package is written in the city of Hasselt, a pretty
-%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
-%D be the same, since now I can at least pretend to know the
-%D glyphs all around the place. The numbers should pose me no
-%D problems, but I fear I will never manage to recognize those
-%D scribles they draw on their pads when thay take your order.
-
-%D To make our lives more easy, we put it here (too):
-
-\setuptyping[\c!tab=\v!no]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/font-heb.mkii b/Master/texmf-dist/tex/context/base/mkii/font-heb.mkii
deleted file mode 100644
index 3ec0395f32a..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/font-heb.mkii
+++ /dev/null
@@ -1,5 +0,0 @@
-\unprotected \writestatus\m!systems{load ARABTEX as a module instead}
-
-\usemodule[arabtex]
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/font-ini.mkii b/Master/texmf-dist/tex/context/base/mkii/font-ini.mkii
deleted file mode 100644
index 2bee006370f..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/font-ini.mkii
+++ /dev/null
@@ -1,4452 +0,0 @@
-%D \module
-%D [ file=font-ini,
-%D version=1998.09.11, % (second)
-%D version=2001.02.20, % (third)
-%D title=\CONTEXT\ Font Macros,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Font Macros / Initialization}
-
-\unprotect
-
-% \def\fontrange#1%
-% {\dofontrange{#1 =\bodyfontsize}}
-%
-% \def\dofontrange#1%
-% {\dodofontrange#1 \relax}% \fontstringA
-%
-% \def\dodofontrange#1 #2 %
-% {\ifdim\bodyfontsize#2%
-% #1\expandafter\gobbleuntilrelax
-% \else
-% \expandafter\dodofontrange
-% \fi}
-%
-% \definefont
-% [crap]
-% [\fontrange
-% {Regular <10pt
-% RegularBold <12pt
-% RegularSlanted <15pt
-% Regular} sa 1]
-%
-% may be better:
-%
-% \definefontrange
-% [crap]
-% [Regular <10pt
-% RegularBold <12pt
-% RegularSlanted <15pt]
-% [Regular sa 1]
-%
-%
-% \dostepwiserecurse{2}{15}{1}
-% {{\switchtobodyfont[\recurselevel pt]\crap test}\endgraf}
-
-% adapted, else wrong interlinespace
-
-\def\setfontparameters
- {\synchronizefontsfalse
- \the\everybodyfont
- \synchronizefontstrue}
-
-% handy
-
-\newcounter\pushedfont
-
-\def\savefont
- {\edef\savedfont{\the\font}%
- \pushmacro\savedfont
- \pushmacro\currentregime
- \pushmacro\charactermapping
- \pushmacro\characterencoding}
-
-\def\restorefont
- {\popmacro\characterencoding
- \popmacro\charactermapping
- \popmacro\currentregime
- \popmacro\savedfont
- \savedfont}
-
-\def\pushcurrentfont
- {\edef\popcurrentfont
- {\noexpand\def\noexpand\fontbody{\fontbody}%
- \noexpand\def\noexpand\fontstyle{\fontstyle}%
- \noexpand\dosetcurrentfontalternative{\fontalternative}%
- \noexpand\dosetcurrentfontsize{\fontsize}%
- \noexpand\synchronizefont}}
-
-% \definetypeface[one][rm][serif][computer-roman][default]
-% \definetypeface[two][rm][serif][computer-roman][default][rscale=.9]
-%
-% {\one \bf test \two test}
-% {\one \bf test \pushcurrentfont \two \popcurrentfont test}
-
-%D \macros
-%D {definedfont,startfont,doiffontcharelse}
-%D
-%D A couple of relatively new macros:
-
-\newevery \everydefinedfont \relax
-
-\def\dodefinedfont[#1]%
- {\iffirstargument\definefont[\string\thedefinedfont][#1]\fi
- \csname\string\thedefinedfont\endcsname % can be \relax
- \the\everydefinedfont} % hm, redundant
-
-\unexpanded\def\definedfont
- {\dosingleempty\dodefinedfont}
-
-\unexpanded\def\startfont
- {\bgroup\definedfont}
-
-\def\stopfont
- {\egroup}
-
-\def\doiffontcharelse#1#2%
- {\bgroup
- \definedfont[#1]%
- \iffontchar\font#2\relax
- \egroup\expandafter\firstoftwoarguments
- \else
- \egroup\expandafter\secondoftwoarguments
- \fi}
-
-%%% message 14 added
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-%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},
-%D \type{\bf}, etc). This module grew out of our needs. We
-%D started with the \PLAIN\ \TEX\ definitions, generalized the
-%D underlaying macros, and extended those to a level at which
-%D probably no one will ever recognize them.
-%D
-%D In 2001 we ran into a couple of projects where more than
-%D one combined set of fonts was involved in a document. To
-%D make definitions more readable, as well as to overcome the
-%D problem of ever growing file name lists, and also because
-%D we needed to scale fonts relative to each other, the low
-%D level implementation was partly rewritten. Global
-%D font assignments, relative scaling, font classes and alike
-%D were added then. At the same time some macros were made a
-%D bit more readable, and math support was extended to the
-%D larger sizes.
-%D
-%D One important characteristic of the font mechanism presented
-%D here is the postponing of font loading. This makes it
-%D possible to distribute \type{fmt} files without bothering
-%D about the specific breed of \type{tfm} files.
-%D
-%D Another feature implemented here is the massive switching
-%D from roman to {\ss sans serif}, {\tt teletype} or else. This
-%D means one doesn't have to take care of all kind of relations
-%D between fonts.
-%D
-%D \page[bigpreference]
-
-%D \macros
-%D {rm,ss,tt,hw,cg}
-%D
-%D Fonts are defined in separate files. When we define a font,
-%D we distinguish between several styles. In most cases we will
-%D use:
-%D
-%D \startlinecorrection
-%D \starttable[|l||]
-%D \HL
-%D \NC roman regular serif \NC \type{\rm} \NC\FR
-%D \NC sansserif sans support \NC \type{\ss} \NC\MR
-%D \NC type teletype mono \NC \type{\tt} \NC\LR
-%D \HL
-%D \stoptable
-%D \stoplinecorrection
-%D
-%D The number of styles is not limited to these three. When
-%D using Lucida Bright we can for instance also define:
-%D
-%D \startlinecorrection
-%D \starttable[|l||]
-%D \HL
-%D \NC handwritten \NC \type{\hw} \NC\FR
-%D \NC calligraphic \NC \type{\cg} \NC\LR
-%D \HL
-%D \stoptable
-%D \stoplinecorrection
-%D
-%D Anyone who feels the need, can define additional ones, like
-%D
-%D \startlinecorrection
-%D \starttable[|l||]
-%D \HL
-%D \NC faxfont \NC \type{\ff} \NC\FR
-%D \NC blackboard \NC \type{\bb} \NC\LR
-%D \HL
-%D \stoptable
-%D \stoplinecorrection
-%D
-%D Or even
-%D
-%D \startlinecorrection
-%D \starttable[|l||]
-%D \HL
-%D \NC hebrew \NC \type{\hb} \NC\SR
-%D \HL
-%D \stoptable
-%D \stoplinecorrection
-%D
-%D Styles are grouped in font sets. At the moment there are
-%D three main sets defined:
-%D
-%D \startlinecorrection
-%D \starttable[|l|l||]
-%D \HL
-%D \NC Computer Modern Roman \NC Knuth \NC \type{cmr} \NC\FR
-%D \NC Lucida Bright \NC Bigelow \& Holmes \NC \type{lbr} \NC\MR
-%D \NC Standard Postscript Fonts \NC Adobe \NC \type{pos} \NC\LR
-%D \HL
-%D \stoptable
-%D \stoplinecorrection
-%D
-%D There are also some Computer Modern Roman alternatives:
-%D
-%D \startlinecorrection
-%D \starttable[|l|l||]
-%D \HL
-%D \NC Computer Modern Roman \NC Knuth \& Sauter \NC \type{sau} \NC\FR
-%D \NC Euler fonts \NC Zapf \NC \type{eul} \NC\MR
-%D \NC Computer Modern Concrete \NC Knuth \& Zapf \NC \type{con} \NC\LR
-%D \HL
-%D \stoptable
-%D \stoplinecorrection
-%D
-%D All these definitions are ordered in files with names like
-%D \type{font-cmr} and \type{font-pos}, where the last three
-%D characters specify the name as known to \CONTEXT.
-%D
-%D Within such a font set (\type{cmr}) and style (\type{\rm})
-%D we can define a number of text font alternatives:
-%D
-%D \startlinecorrection
-%D \starttable[|l||]
-%D \HL
-%D \NC typeface \NC \type{\tf} \NC\FR
-%D \NC boldface \NC \type{\bf} \NC\MR
-%D \NC slanted \NC \type{\sl} \NC\MR
-%D \NC italic \NC \type{\it} \NC\MR
-%D \NC boldslanted \NC \type{\bs} \NC\MR
-%D \NC bolditalic \NC \type{\bi} \NC\MR
-%D \NC smallcaps \NC \type{\sc} \NC\LR
-%D \HL
-%D \stoptable
-%D \stoplinecorrection
-
-%D For old stylish Frans Goddijn we have:
-%D
-%D \startlinecorrection
-%D \starttable[|l||]
-%D \HL
-%D \NC oldstyle \NC \type{\os} \NC\SR
-%D \HL
-%D \stoptable
-%D \stoplinecorrection
-%D
-%D The availability of these alternatives depends on the
-%D completeness of a font family and of course the definitions
-%D in the font files.
-%D
-%D But let's not forget math. In addition to the previous \TEX\
-%D families (the mysterious \type{\fam}'s) we've got some more:
-%D
-%D \startlinecorrection
-%D \starttable[|l||]
-%D \HL
-%D \NC Math Roman \NC \type{\mr} \NC\FR
-%D \NC Math Italic \NC \type{\mi} \NC\MR
-%D \NC Math Symbol \NC \type{\sy} \NC\MR
-%D \NC Math Extra \NC \type{\ex} \NC\MR
-%D \NC Math A \NC \type{\ma} \NC\MR
-%D \NC Math B \NC \type{\mb} \NC\MR
-%D \NC Math C \NC \type{\mc} \NC\LR
-%D \HL
-%D \stoptable
-%D \stoplinecorrection
-%D
-%D Users can call for specific fonts in many ways. Switches to
-%D other typefaces, like the switch from normal to bold, are as
-%D intuitive as possible, which means that all dependant fonts
-%D also switch. One can imagine that this takes quite some
-%D processing time.
-%D
-%D Internally fonts are stored as combination of size, style
-%D and alternative, e.g. \type{12pt}+\type{\ss}+\type{\bf}.
-%D Users are not confronted with sizes, but use the style or
-%D style+alternative to activate them.
-%D
-%D During the definition of a bodyfont one can also declare the
-%D available larger alternatives:
-%D
-%D \starttyping
-%D \tf \tfa \tfb \tfc ...
-%D \bf \bfa \bfb \bfc ...
-%D \sl \sla \slb \slc ...
-%D \stoptyping
-%D
-%D The smaller ones are automatically supplied and derived from
-%D the the bodyfont environment.
-%D
-%D \starttyping
-%D \tfx \tfxx
-%D \bfx \bfxx
-%D \slx \slxx
-%D \stoptyping
-%D
-%D There are only two smaller alternatives per style. The
-%D larger alternatives on the other hand have no limitations.
-%D
-%D These larger alternatives are mostly used in chapter and
-%D section titles or on title pages. When one switches to a
-%D larger alternative, the bold an other ones automatically
-%D adapt themselves:
-%D
-%D \startbuffer
-%D \tfd Hi \bf there\sl, here \tfb I \bf am
-%D \stopbuffer
-%D
-%S \startnarrower
-%D \typebuffer
-%S \stopnarrower
-%D
-%D therefore becomes:
-%D
-%D \startvoorbeeld
-%D \getbuffer
-%D \stopvoorbeeld
-%D
-%D Maybe this mechanism isn't always as logic, but as said
-%D before, we tried to make it as intuitive as possible.
-%D
-%D So a specific kind of glyph can be characterized by:
-%D
-%D \startnarrower
-%D family (cmr) + bodyfont (12pt) + style (rm) + alternative (bf) + size (a)
-%D \stopnarrower
-%D
-%D The last component (the size) is optional.
-%D
-%D We introduced \type{\tf} as command to call for the current
-%D normally sized typeface. This commands results in roman,
-%D sans serif, teletype or whatever style is in charge. Such
-%D rather massive switches of style sometimes take more
-%D processing time than comfortable. Of course there is a
-%D workaround for this: we can call fonts directly by means of
-%D commands like:
-%D
-%D \starttyping
-%D \rmtf \sssl \tttf \rmbsa
-%D \stoptyping
-%D
-%D One should realize that this fast calls have limitations,
-%D they lack for instance automatic super- and subscript
-%D support.
-%D
-%D This leaves us two more commands: \type{\tx} and
-%D \type{\txx}. These activate a smaller and even more smaller
-%D font than the current one and adapt themselves to the
-%D current alternative, so when \type{\bf} is active,
-%D \type{\tx} gives a smaller boldface, which in turn can be
-%D called directly by \type{\bfx}.
-%D
-%D These two smaller alternatives are specified by the bodyfont
-%D environment and therefore not necessarily have similar sizes
-%D as \type{\scriptsize} and \type{\scriptscriptsize}. The main
-%D reason for this incompatibility (which can easily be undone)
-%D lays in the fact that we often want a bit bigger characters
-%D than in math mode. In \CONTEXT\ for instance the \type{\tx}
-%D and \type{\txx} commands are used for surrogate
-%D \cap{smallcaps} which support both nesting and alternatives,
-%D like in {\bf\cap{a \cap{small} world}}, which was typeset by
-%D
-%D \starttyping
-%D \bf\cap{a \cap{small} world}
-%D \stoptyping
-%D
-%D And compare $\rm \scriptstyle THIS$ with the slightly larger
-%D \cap{THIS}: \ruledhbox{$\rm \scriptstyle scriptstyle: THIS$}
-%D or \ruledhbox{\cap{x style: THIS}} makes a big difference.
-
-%D The \type{x..d} sizes should be used grouped. If you
-%D don't group them, i.e. call them in a row, \CONTEXT\ will
-%D not be able to sort out your intention (\type {x} inside
-%D \type {d} inside \type {x}. etc.). The following table
-%D demonstrates this:
-%D
-%D \def\FontState{\setstrut\ruledhbox{\strut Hello}}
-%D
-%D \starttabulate[|||||]
-%D \HL
-%D \NC \rlap{\quad\bf grouped} \NC \NC \type {\tx} \NC \type {\txx} \NC \NR
-%D \HL
-%D \NC \type{\tfx} \NC \tfx \FontState \NC \tfx \tx \FontState \NC \tfx \txx \FontState \NC \NR
-%D \NC \type{\tfxx} \NC \tfxx \FontState \NC \tfxx\tx \FontState \NC \tfxx\txx \FontState \NC \NR
-%D \NC \type{\tf} \NC \tf \FontState \NC \tf \tx \FontState \NC \tf \txx \FontState \NC \NR
-%D \NC \type{\tfa} \NC \tfa \FontState \NC \tfa \tx \FontState \NC \tfa \txx \FontState \NC \NR
-%D \NC \type{\tfb} \NC \tfb \FontState \NC \tfb \tx \FontState \NC \tfb \txx \FontState \NC \NR
-%D \NC \type{\tfc} \NC \tfc \FontState \NC \tfc \tx \FontState \NC \tfc \txx \FontState \NC \NR
-%D \NC \type{\tfd} \NC \tfd \FontState \NC \tfd \tx \FontState \NC \tfd \txx \FontState \NC \NR
-%D \NC \type{\tfx} \NC \tfx \FontState \NC \tfx \tx \FontState \NC \tfx \txx \FontState \NC \NR
-%D \NC \type{\tfxx} \NC \tfxx \FontState \NC \tfxx\tx \FontState \NC \tfxx\txx \FontState \NC \NR
-%D \HL
-%D \stoptabulate
-%D
-%D \blank
-%D
-%D \starttabulate[|||||]
-%D \HL
-%D \NC \rlap{\quad\bf stacked} \NC \NC \type {\tx} \NC \type {\txx} \NC \NR
-%D \HL
-%D \NC \type{\tfx}
-%D \NC \tfx \FontState
-%D \NC \tfx \tx \FontState
-%D \NC \tfx \txx \FontState
-%D \NC \NR
-%D \NC \type{\tfxx}
-%D \NC \tfx\tfxx \FontState
-%D \NC \tfx\tfxx \tx \FontState
-%D \NC \tfx\tfxx \txx \FontState
-%D \NC \NR
-%D \NC \type{\tf}
-%D \NC \tfx\tfxx\tf \FontState
-%D \NC \tfx\tfxx\tf \tx \FontState
-%D \NC \tfx\tfxx\tf \txx \FontState
-%D \NC \NR
-%D \NC \type{\tfa}
-%D \NC \tfx\tfxx\tf\tfa \FontState
-%D \NC \tfx\tfxx\tf\tfa \tx \FontState
-%D \NC \tfx\tfxx\tf\tfa \txx \FontState
-%D \NC \NR
-%D \NC \type{\tfb}
-%D \NC \tfx\tfxx\tf\tfa\tfb \FontState
-%D \NC \tfx\tfxx\tf\tfa\tfb \tx \FontState
-%D \NC \tfx\tfxx\tf\tfa\tfb \txx \FontState
-%D \NC \NR
-%D \NC \type{\tfc}
-%D \NC \tfx\tfxx\tf\tfa\tfb\tfc \FontState
-%D \NC \tfx\tfxx\tf\tfa\tfb\tfc \tx \FontState
-%D \NC \tfx\tfxx\tf\tfa\tfb\tfc \txx \FontState
-%D \NC \NR
-%D \NC \type{\tfd}
-%D \NC \tfx\tfxx\tf\tfa\tfb\tfd \FontState
-%D \NC \tfx\tfxx\tf\tfa\tfb\tfd \tx \FontState
-%D \NC \tfx\tfxx\tf\tfa\tfb\tfd \txx \FontState
-%D \NC \NR
-%D \NC \type{\tfx}
-%D \NC \tfx\tfxx\tf\tfa\tfb\tfc\tfx \FontState
-%D \NC \tfx\tfxx\tf\tfa\tfb\tfc\tfx \tx \FontState
-%D \NC \tfx\tfxx\tf\tfa\tfb\tfc\tfx \txx \FontState
-%D \NC \NR
-%D \NC \type{\tfxx}
-%D \NC \tfx\tfxx\tf\tfa\tfb\tfc\tfx\tfxx \FontState
-%D \NC \tfx\tfxx\tf\tfa\tfb\tfc\tfx\tfxx \tx \FontState
-%D \NC \tfx\tfxx\tf\tfa\tfb\tfc\tfx\tfxx \txx \FontState
-%D \NC \NR
-%D \HL
-%D \stoptabulate
-
-%D \macros
-%D {mf}
-%D
-%D Math fonts are a species in their own. They are tightly
-%D hooked into smaller and even smaller ones of similar breed
-%D to form a tight family. Let's first see how these are
-%D related:
-%D
-%D \startbuffer
-%D $\tf x^2+\bf x^2+\sl x^2+\it x^2+\bs x^2+ \bi x^2 =\rm 6x^2$
-%D $\tf x^2+\bf x^2+\sl x^2+\it x^2+\bs x^2+{\bi x^2}=\rm 6x^2$
-%D $\tf x^2+\bf x^2+\sl x^2+\it x^2+\bs x^2+ \bi x^2 =\tf 6x^2$
-%D $\tf x^2+\bf x^2+\sl x^2+\it x^2+\bs x^2+{\bi x^2}=\tf 6x^2$
-%D $\tf x^2+\bf x^2+\sl x^2+\it x^2+\bs x^2+ \bi x^2 =\bf 6x^2$
-%D $\tf x^2+\bf x^2+\sl x^2+\it x^2+\bs x^2+{\bi x^2}=\bf 6x^2$
-%D $\tf x^2+\bf x^2+\sl x^2+\it x^2+\bs x^2+ \bi x^2 =\sl 6x^2$
-%D $\tf x^2+\bf x^2+\sl x^2+\it x^2+\bs x^2+{\bi x^2}=\sl 6x^2$
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D Gives both an expected and unexpected result:
-%D
-%D \startvoorbeeld
-%D \startlines
-%D \getbuffer
-%D \stoplines
-%D \stopvoorbeeld
-%D
-%D We see here that the character shapes change accordingly to
-%D the current family, but that the symbols are always typeset
-%D in the font assigned to \type{\fam0}.
-%D
-%D \startbuffer
-%D $\tf\mf x^2 + x^2 + x^2 + x^2 + x^2 + x^2 = 6x^2$
-%D $\bf\mf x^2 + x^2 + x^2 + x^2 + x^2 + x^2 = 6x^2$
-%D $\sl\mf x^2 + x^2 + x^2 + x^2 + x^2 + x^2 = 6x^2$
-%D $\bs\mf x^2 + x^2 + x^2 + x^2 + x^2 + x^2 = 6x^2$
-%D $\it\mf x^2 + x^2 + x^2 + x^2 + x^2 + x^2 = 6x^2$
-%D $\bi\mf x^2 + x^2 + x^2 + x^2 + x^2 + x^2 = 6x^2$
-%D \stopbuffer
-%D
-%D \startvoorbeeld
-%D \startlines
-%D \getbuffer
-%D \stoplines
-%D \stopvoorbeeld
-%D
-%D In this example we see a new command \type{\mf} surface
-%D which means as much as {\em math font}. This commands
-%D reactivates the last font alternative and therefore equals
-%D \type{\bf}, \type{\sl} etc. but by default it equals
-%D \type{\tf}:
-
-\unexpanded\def\mf
- {\dodosetmathfont\fontalternative
- \csname\fontalternative\endcsname}
-
-%D The previous example was typeset saying:
-%D
-%D \typebuffer
-%D
-%D Beware: the exact location of \type{\mf} is not that
-%D important, we could as well has said
-%D
-%D \startbuffer
-%D $\bf x^2 + x^2 + x^2 + x^2 + x^2 + x^2 = \mf 6x^2$
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D This is due to the way \TEX\ handles fonts in math mode.
-%D
-%D Of course we'll have to redefine \type{\mf} every time we
-%D change the current \type{\fam}.
-
-%D \macros
-%D {mbox,enablembox,mathop}
-%D
-%D Now how can we put this to use? Will the next sequence
-%D give the desired result?
-%D
-%D \startbuffer
-%D $\bf x^2 + \hbox{\mf whatever} + \sin(2x)$
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D It won't!
-%D
-%D \startvoorbeeld
-%D \let\mathop=\normalmathop \getbuffer
-%D \stopvoorbeeld
-%D
-%D The reason for this is that \type{\sin} is defined as:
-%D
-%D \starttyping
-%D \def\sin{\mathop{\rm sin}\nolimits}
-%D \stoptyping
-%D
-%D We can fix this by defining
-
-\unexpanded\def\mathop
- {\normalmathop
- \bgroup
- \let\rm\mf
- \let\next=}
-
-%D We can fix arbitrary horizontal boxes by redefining the
-%D \TEX\ primitive \type{\hbox}:
-%D
-%D \starttyping
-%D \def\hbox{\ifmmode\mbox\else\normalhbox\fi}
-%D \stoptyping
-%D
-%D with
-%D
-%D \starttyping
-%D \def\mbox#1#%
-%D {\normalhbox#1\bgroup\mf\let\next=}
-%D \stoptyping
-%D
-%D or more robust, that is, also accepting \type{\hbox\bgroup}:
-%D
-%D \starttyping
-%D \def\mbox%
-%D {\normalhbox\bgroup\mf
-%D \dowithnextbox{\flushnextbox\egroup}%
-%D \normalhbox}
-%D \stoptyping
-%D
-%D And now:
-%D
-%D \startbuffer
-%D $\bf x^2 + \hbox{whatever} + \sin(2x)$
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D Indeed gives:
-%D
-%D \startvoorbeeld
-%D \enablembox\getbuffer
-%D \stopvoorbeeld
-%D
-%D But, do we want this kind of trickery to be activated? No,
-%D simply because we cannot be sure of incompatibilities,
-%D although for instance unboxing goes ok. Therefore we
-%D introduce:
-
-% best can go to math-ini and make \mf a hook then
-
-% better use \dowithnextboxcontent
-
-\def\normalmbox
- {\normalhbox\bgroup\mf
- \dowithnextbox{\flushnextbox\egroup}\normalhbox}
-
-% to test:
-%
-% \def\normalmbox
-% {\dowithnextboxcontent\mf\flushnextbox\normalhbox}
-
-\def\mbox % we cannot add \dontleavehmode ... else no \setbox0\mbox possible
- {\ifmmode\normalmbox\else\normalhbox\fi}
-
-\def\enablembox
- {\appendtoks
- \ifx\normalhbox\undefined\let\normalhbox\hbox\fi
- \let\hbox\mbox
- \to\everymathematics}
-
-%D So in fact one can enable this feature if needed. I would say:
-%D go along, but use grouping if needed!
-
-%D \macros
-%D {mrfam,mifam,syfam,exfam,
-%D bsfam,bifam,scfam,tffam,
-%D mafam,mbfam,msfam}
-%D
-%D After this short mathematical excursion, we enter the world
-%D of fonts and fontswitching. We start with something very
-%D \TEX: \type{\fam} specified font families. \TEX\ uses
-%D families for managing fonts in math mode. Such a family has
-%D three members: text, script and scriptscript: $x^{y^z}$. In
-%D \CONTEXT\ we take a bit different approach than \PLAIN\
-%D \TEX\ does. \PLAIN\ \TEX\ needs at least four families for
-%D typesetting math. We use those but give them symbolic names.
-
-\chardef\mrfam = 0 % (Plain TeX) Math Roman
-\chardef\mifam = 1 % (Plain TeX) Math Italic
-\chardef\syfam = 2 % (Plain TeX) Math Symbol
-\chardef\exfam = 3 % (Plain TeX) Math Extra
-
-%D \PLAIN\ \TEX\ also defines families for {\it italic}, {\sl
-%D slanted} and {\bf bold} typefaces, so we don't have to
-%D define them here.
-
-\ifx\itfam\undefined
-
-\chardef\itfam = 4 % (Plain TeX) Italic
-\chardef\slfam = 5 % (Plain TeX) Slanted
-\chardef\bffam = 6 % (Plain TeX) Boldface
-
-\fi
-
-%D Family~7 in \PLAIN\ \TEX\ is not used in \CONTEXT, because
-%D we do massive switches from roman to sans serif, teletype or
-%D other faces.
-
-\ifx\ttfam\undefined
-
-\chardef\ttfam = 7 % (Plain TeX) can be reused!
-
-\fi
-
-%D We define ourselves some more families for {\bs bold
-%D slanted}, {\bi bold italic} and {\sc Small Caps}, so
-%D we can use them in math mode too. Instead of separate
-%D families for {\ss sans serif} and \type{teletype} we use the
-%D more general \type{\tffam}, which stands for typeface.
-
-\chardef\bsfam = 8 % (ConTeXt) BoldSlanted
-\chardef\bifam = 9 % (ConTeXt) BoldItalic
-\chardef\scfam = 10 % (ConTeXt) SmallCaps
-\chardef\tffam = 11 % (ConTeXt) TypeFace
-
-%D Because Taco needs a few more math families, we reuse
-%D family~7 for all those typefaces that have no related
-%D family, and therefore are grouped into one.
-
-\chardef\nnfam = 7 % (ReUsed) NoName
-
-%D Normally \type{\mrfam} equals \type{\tffam}, but a more
-%D distinctive alternatives are possible, for instance the
-%D Euler and Concrete Typefaces.
-%D
-%D After having defined all those in nature non||mathematical
-%D families, we define ourselves some real math ones. These are
-%D needed for the \AMS\ Symbol Fonts and Extended Lucida
-%D Bright.
-
-\chardef\mafam = 12 % (ConTeXt) Math A Fam (AmsTeX A)
-\chardef\mbfam = 13 % (ConTeXt) Math B Fam (AmsTeX B)
-\chardef\mcfam = 14 % (ConTeXt) Math C Fam (MathTime)
-\chardef\mdfam = 15 % (ConTeXt) Math D Fam (MathTime)
-
-%D Because there are 16~families and because \type{\ttfam}
-%D is reused, at the moment we have no so many families
-%D left. By default, we map any newly defined family on the
-%D last one (F).
-
-\def\newfam#1{\chardef#1=15 }
-
-%D This hack is also needed because in \ETEX\ we are going
-%D to reuse the \type {\newfam} allocation counter.
-
-%D To ease the support of font packages, we als define
-%D shortcuts to these familynames. This is necessary because
-%D the family names are in fact \type{\chardef}'s, which means
-%D that we're dealing with numbers (one can check this by
-%D applying \type{\showthe} and \type{\show}). In the
-%D specification of math symbols however we need hexadecimal
-%D numbers, so we have to convert the \type{\fam}'s value.
-
-\edef\hexmrfam {\hexnumber\mrfam} \edef\hexbsfam {\hexnumber\bsfam}
-\edef\hexmifam {\hexnumber\mifam} \edef\hexbifam {\hexnumber\bifam}
-\edef\hexsyfam {\hexnumber\syfam} \edef\hexscfam {\hexnumber\scfam}
-\edef\hexexfam {\hexnumber\exfam} \edef\hextffam {\hexnumber\tffam}
-\edef\hexitfam {\hexnumber\itfam} \edef\hexmafam {\hexnumber\mafam}
-\edef\hexslfam {\hexnumber\slfam} \edef\hexmbfam {\hexnumber\mbfam}
-\edef\hexbffam {\hexnumber\bffam} \edef\hexmcfam {\hexnumber\mcfam}
-\edef\hexnnfam {\hexnumber\nnfam} \edef\hexmdfam {\hexnumber\mdfam}
-
-%D \macros
-%D {uchar}
-%D
-%D This macro prepares \CONTEXT\ for \UNICODE\ support. By
-%D defining it here, we have at least an safeguard for utility
-%D file reading.
-
-\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.
-
-\def\@size@ {@f@si@} % bodyfont size prefix (12pt etc)
-\def\@style@ {@f@st@} % full style prefix (roman etc)
-\def\@shortstyle@ {@f@sh@} % short style prefix (rm etc)
-\def\@letter@ {@f@le@} % first alternative typeface
-\def\@noletter@ {@f@no@} % second alternative typeface
-\def\@fontclass@ {@f@cl@} % fontclass
-
-%D The families can be grouped into math specific ones and
-%D more text related families, although text ones can be
-%D mapped onto the math ones to get for instance bold math.
-%D
-%D Both groups of families are handles by a couple of token
-%D list tagged as strategies. This implementation makes
-%D implementing extensions more comfortable.
-
-\newtoks \textstrategies
-\newtoks \mathstrategies
-\newtoks \symbstrategies
-
-\newif\ifsynchronizemathfonts \synchronizemathfontstrue
-
-\def\synchronizetext % stylish text in mmode
- {\ifsynchronizemathfonts\the\textstrategies\fi} % \if...\fam\minusone\fi}
-
-\def\synchronizemath % math stuff in mmode
- {\ifsynchronizemathfonts\the\mathstrategies\fi} % \if...\fam\minusone\fi}
-
-\def\synchronizesymb % stylish math stuff in mmode
- {\ifsynchronizemathfonts\the\symbstrategies\fi} % \if...\fam\minusone\fi}
-
-%D By not setting the family we can append a font switch to \type
-%D {\everymath}. On the other hand, one never knows in what family
-%D state the strategies brought us.
-%D
-%D \starttyping
-%D {\bfa $\the\fam$} {\bfa \everymath{} $\the\fam$}
-%D \stoptyping
-
-%D \macros
-%D {textonly}
-%D
-%D We can inhibit this slow||downer with:
-
-\def\textonly{\synchronizemathfontsfalse} % document this
-
-\appendtoks
- \dosettextfamily\c!tf
- \dosettextfamily\c!bf
- \dosettextfamily\c!sl
- \dosettextfamily\c!it
- \dosettextfamily\c!bs
- \dosettextfamily\c!bi
- \dosettextfamily\c!sc
-\to \textstrategies
-
-\def\dosettextfamily#1% better pass fontbody to dodoset
- {\let\savedfontbody\fontbody
- \let\fontfamily#1%
- \let\fontbody\scriptscriptface\dodosettextfamily\scriptscriptfont
- \let\fontbody\scriptface \dodosettextfamily \scriptfont
- \let\fontbody\textface \dodosettextfamily \textfont
- \let\fontbody\savedfontbody}
-
-% \def\s!nullfont{nullfont}
-
-\def\dodosettextfamily
- {\ifx\fontclass\empty
- \@EA\dodosettextfamilyA
- \else
- \@EA\dodosettextfamilyB
- \fi}
-
-\def\dodosettextfamilyA#1%
- {\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\c!rm\fontfamily\fontsize\endcsname \autofontsizefalse
- \csname \fontbody\c!rm\fontfamily\fontsize\endcsname \else
- \ifcsname \fontbody\c!rm\fontfamily\endcsname \autofontsizetrue
- \csname \fontbody\c!rm\fontfamily\endcsname \else
- \nullfont \autofontsizetrue
- \fi\fi\fi\fi
- #1\csname\fontfamily\s!fam\endcsname\font}
-
-\def\dodosettextfamilyB#1%
- {\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\c!rm\fontfamily\fontsize\endcsname \autofontsizefalse
- \csname\fontclass\fontbody\c!rm\fontfamily\fontsize\endcsname \else
- \ifcsname\fontclass\fontbody\c!rm\fontfamily\endcsname \autofontsizetrue
- \csname\fontclass\fontbody\c!rm\fontfamily\endcsname \else
- \dodosettextfamilyA#1%
- \fi\fi\fi\fi
- #1\csname\fontfamily\s!fam\endcsname\font}
-
-\def\mrfallback{\c!rm\c!tf}
-
-\appendtoks
- \dosetmathfamily\mrfam\textface\scriptface\scriptscriptface\c!mr\mrfallback
- \dosetmathfamily\mifam\textface\scriptface\scriptscriptface\c!mi\empty
- \dosetmathfamily\syfam\textface\scriptface\scriptscriptface\c!sy\empty
- \dosetmathfamily\exfam\textface\textface \textface \c!ex\empty
- \dosetmathfamily\mafam\textface\scriptface\scriptscriptface\c!ma\empty
- \dosetmathfamily\mbfam\textface\scriptface\scriptscriptface\c!mb\empty
- \dosetmathfamily\mcfam\textface\scriptface\scriptscriptface\c!mc\empty
-% \dosetmathfamily\mdfam\textface\scriptface\scriptscriptface\c!md\empty
- \dosetmathfamily\nnfam\textface\scriptface\scriptscriptface\c!nn\empty
-\to \mathstrategies
-
-\appendtoks
- \dosetskewchar\mifam\defaultskewcharmi % implemented later on
- \dosetskewchar\syfam\defaultskewcharsy % implemented later on
-\to \mathstrategies
-
-\def\dosetmathfamily#1#2#3#4#5#6%
- {\let\savedfontbody\fontbody % op hoger plan
- \let\fontfamily#5%
- \let\backfamily#6%
- \let\fontbody #4\dodosetmathfamily\scriptscriptfont#1%
- \let\fontbody #3\dodosetmathfamily \scriptfont#1%
- \let\fontbody #2\dodosetmathfamily \textfont#1%
- \let\fontbody\savedfontbody}
-
-\def\dodosetmathfamily
- {\ifx\fontclass\empty
- \@EA\dodosetmathfamilyA
- \else
- \@EA\dodosetmathfamilyB
- \fi}
-
-\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
- \nullfont \autofontsizetrue
- \fi\fi\fi\fi
- #1#2\font}
-
-\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
- \dodosetmathfamilyA#1#2%
- \fi\fi\fi\fi
- #1#2\font}
-
-\appendtoks
- \dosetsymbfamily\mrfam\textface\scriptface\scriptscriptface\c!mr
- \dosetsymbfamily\mifam\textface\scriptface\scriptscriptface\c!mi
- \dosetsymbfamily\syfam\textface\scriptface\scriptscriptface\c!sy
- \dosetsymbfamily\exfam\textface\textface \textface \c!ex
- \dosetsymbfamily\mafam\textface\scriptface\scriptscriptface\c!ma
- \dosetsymbfamily\mbfam\textface\scriptface\scriptscriptface\c!mb
- \dosetsymbfamily\mcfam\textface\scriptface\scriptscriptface\c!mc
-% \dosetsymbfamily\mdfam\textface\scriptface\scriptscriptface\c!md % also ?
-\to \symbstrategies
-
-\def\dosetsymbfamily#1#2#3#4#5%
- {\let\savedfontbody\fontbody
- \let\fontfamily#5%
- \let\fontbody #4\dodosetsymbfamily\scriptscriptfont#1%
- \let\fontbody #3\dodosetsymbfamily \scriptfont#1%
- \let\fontbody #2\dodosetsymbfamily \textfont#1%
- \let\fontbody\savedfontbody}
-
-\def\dodosetsymbfamily#1#2%
- {\ifcsname\fontclass\fontbody\c!mm\fontfamily\fontalternative\fontsize\endcsname
- \csname\fontclass\fontbody\c!mm\fontfamily\fontalternative\fontsize\endcsname
- #1#2\font
- \else\ifcsname\fontbody\c!mm\fontfamily\fontalternative\fontsize\endcsname
- \csname\fontbody\c!mm\fontfamily\fontalternative\fontsize\endcsname
- #1#2\font
- \fi\fi}
-
-%D All used styles, like rm, ss and tt, are saved in a comma
-%D separated list. Appart from practical limitations one can
-%D define as many styles as needed.
-
-\def\fontrelativesizelist{\s!text,\s!script,\s!scriptscript,\c!x,\c!xx,\c!big,\c!small}
-
-%D \macros
-%D {magfactor,magfactorhalf}
-%D
-%D There are several ways to specify a font. Three of them are
-%D pure \TeX\ ones, the fourth one is new:
-%D
-%D \starttyping
-%D \font\name=cmr12
-%D \font\name=cmr12 at 10pt
-%D \font\name=cmr12 scaled \magstep2
-%D \font\name=cmr12 sa 1.440
-%D \stoptyping
-%D
-%D The non||\TEX\ alternative \type{sa} stands for {\em scaled
-%D at}. This means as much as: scale the bodyfontsize with this
-%D factor. The value 1.440 in this example is derived
-%D from the \type{\magstep}'s as mentioned in
-%D \in{table}[tab:magstep]. We therefore introduce
-%D \type{\magfactor} as an alternative for \type{\magstep}.
-%D
-%D \placetable[here][tab:magstep]
-%D {Factors to be used with \type{sa.}}
-%D \starttable[|c|c|c|]
-%D \HL
-%D \NC \bf magstep \NC \bf equivalent \NC \bf factor \NC\SR
-%D \HL
-%D \NC 1 \NC \type{\magfactor1} \NC 1.200 \NC\FR
-%D \NC 2 \NC \type{\magfactor2} \NC 1.440 \NC\MR
-%D \NC 3 \NC \type{\magfactor3} \NC 1.728 \NC\MR
-%D \NC 4 \NC \type{\magfactor4} \NC 2.074 \NC\MR
-%D \NC 5 \NC \type{\magfactor5} \NC 2.488 \NC\LR
-%D \HL
-%D \stoptable
-
-\def\magstep#1% \relax removed, otherwise space after it sticks, else added
- {\ifcase#1 1000\or1200\or1440\or1728\or2074\or2488\or1000\fi}
-
-\def\magstephalf
- {1095}
-
-\def\magfactor#1%
- {\ifcase#1 1.000\or1.200\or1.440\or1.728\or2.074\or2.488\or1\fi}
-
-\def\magfactorhalf
- {1.095}
-
-%D These macros enable the use of definitions like \type{sa
-%D \magfactor3} which saves us both (mis|)|calculations and
-%D potential mistypings.
-%D
-%D Because \type {sa} (scaled at) and \type {mo} (mapped on)
-%D are not low level \TEX\ supported alternatives, we have to
-%D test for it ourselves. In doing so, we need an auxiliary
-%D \DIMENSION. We cannot use \type{\scratchdimen} because font
-%D loading can happen at any moment due to postponed loading.
-%D We could instead have used dirty grouping tricks, but this
-%D one works too.
-
-\let\defaultrelativefontsize \plusone
-\let\localrelativefontsize \plusone
-\def\localabsolutefontsize {\fontbody}
-
-\let\relativefontsize \defaultrelativefontsize
-
-\def\saverelativefontsize#1#2% #1=rm|ss|.. #2=waarde
- {\setxvalue{\fontclass#1\s!rscale}{#2}}
-
-\def\checkrelativefontsize#1%
- {\edef\relativefontsize
- {\ifcsname\fontclass#1\s!rscale\endcsname
- \csname\fontclass#1\s!rscale\endcsname
- \else
- \defaultrelativefontsize
- \fi}}
-
-%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
-
-\def\@fs@{@fs@}
-
-% \def\parsefontspec#1%
-% {\xdef\somefontspec{#1\space\relax}%
-% \@EA\doparsefontspec\somefontspec]% =>#1 \relax]
-% \donoparsefontspec}
-%
-% but, better:
-
-\let\somefontname\empty
-
-\def\parsefontspec#1%
- {\xdef\somefontspec{#1\space}%
- \@EA\doparsefontspec\somefontspec\relax]% =>#1 \relax]
- \donoparsefontspec}
-
-\def\doparsefontspec#1 #2%
- {\def\somefontname{#1}%
- \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\@fs@scaled
- {\afterassignment\do@fs@scaled\scratchcounter}
-
-\def\do@fs@scaled#1\relax
- {\scaledfont\number\scratchcounter\points
- \scaledfont\localrelativefontsize\scaledfont
- \ifautofontsize\scaledfont\currentfontbodyscale\scaledfont\fi
- \scratchcounter\scaledfont % \scaledfont is now pretty large
- \advance\scratchcounter \medcard
- \divide\scratchcounter \maxcard
- \xdef\somefontspec{ scaled \the\scratchcounter}}
-
-\def\@fs@at
- {\afterassignment\do@fs@at\scaledfont}
-
-\def\do@fs@at#1\relax
- {\scaledfont\localrelativefontsize\scaledfont
- \ifautofontsize\scaledfont\currentfontbodyscale\scaledfont\fi
- \xdef\somefontspec{ at \the\scaledfont}}
-
-\def\@fs@sa
- {\scaledfont\localabsolutefontsize
- \setsamofontspec}
-
-\def\@fs@mo
- {\scaledfont\setmappedfontsize\localabsolutefontsize
- \setsamofontspec}
-
-\def\setsamofontspec#1\relax
- {\checkfontscale#1\end\scaledfont
- \scaledfont\localrelativefontsize\scaledfont
- \ifautofontsize\scaledfont\currentfontbodyscale\scaledfont\fi
- \xdef\somefontspec{ at \the\scaledfont}}
-
-\def\getfontparameters
- {\expandafter\dogetfontparameter\@@fontdata,]=,}
-
-\def\getglobalfontparameters
- {\expandafter\dogetglobalfontparameter\@@fontdata,]=,}
-
-\def\dogetfontparameter#1=#2,%
- {\if]#1\else
- \expandafter\def\csname\??ff\@@fontfile#1\endcsname{#2}%
- \expandafter\dogetfontparameter
- \fi}
-
-\def\dogetglobalfontparameter#1=#2,%
- {\if]#1\else
- \expandafter\gdef\csname\??ff\@@fontfile#1\endcsname{#2}%
- \expandafter\dogetglobalfontparameter
- \fi}
-
-\let\@@fontencoding\empty
-\let\@@fontmapping \empty
-\let\@@fonthandling\empty
-\let\@@fontfeatures\empty
-\let\@@skewchar \empty
-\let\@@hyphenchar \empty % todo, will go to encoding
-
-%D This brings down maps processing from 466 to 309 seconds
-%D ($-33$\%) and mfonts from 42 to 34 seconds ($-15$\%).
-
-\newif\ifskipfontcharacteristics \skipfontcharacteristicstrue
-
-%D When fontclasses are used, we define the font global,
-%D since namespaces are used. Otherwise we parse the specs
-%D each time.
-
-% wrong: this way we cannot set encoding etc
-%
-% \def\donoparsefontspec#1%
-% {\edef\fontfile{\truefontname\somefontname}%
-% \ifx\fontfile\s!unknown \let\fontfile\defaultfontfile \fi
-% \edef\lastfontname{\fontfile\somefontspec}%
-% \ifx\fontclass\empty\else\global\fi
-% \expandafter\font\csname#1\endcsname\lastfontname\relax
-% \relax}
-
-\let\fontfile\s!unknown
-
-% \definefontsynonym
-% [blabla]
-% [name:Latin Modern Something]
-% \definefontsynonym
-% [blabla]
-% [file:texnansi-lmr10]
-% [encoding=texnansi]
-% \definedfont[blabla] test \currentencoding/\fontfile \par
-% \definefontsynonym
-% [blabla]
-% [texnansi-lmtt10]
-% [encoding=texnansi]
-% \definedfont[blabla] test \currentencoding/\fontfile \par
-% \definefontsynonym
-% [blabla]
-% [ec-lmtt10]
-% [encoding=ec]
-% \definedfont[blabla] test \currentencoding/\fontfile \par
-
-\def\checkfontfilename
- {\expandafter\docheckfontfilename\fontfile:\empty:\empty\relax}
-
-\def\docheckfontfilename#1:#2:#3#4\relax
- {\edef\!!stringa{#1}%
- \edef\!!stringb{#2}%
- \ifx\!!stringb\empty
- \edef\checkedfontfile{\!!stringa}%
- \else\ifx\!!stringa\v!file
- \edef\checkedfontfile{"\!!stringb"}%
- \else\ifx\!!stringa\v!name
- \edef\checkedfontfile{"\!!stringb"}%
- \else
- \edef\checkedfontfile{\!!stringb}%
- \fi\fi\fi}
-
-\let\doshowcheckedfontfeatures\relax
-
-\def\showcheckedfontfeatures
- {\def\doshowcheckedfontfeatures{\writestatus\m!fonts{checked: \checkedfontfile}}}
-
-\def\checkedfontfile{\fontfile} % default
-
-\newtoks\everydefinefont
-
-\def\donoparsefontspec % #1 == \cs
- {\edef\fontfile{\truefontname\somefontname}%
- \ifx\fontfile\s!unknown \let\fontfile\defaultfontfile \fi % can for instance happen with MathGamma
- \updatefontparameters
- \checkfontfilename
- \edef\lastfontname{\checkedfontfile\somefontspec}%
- \ifx\fontclass\empty
- \expandafter\definefontlocal
- \else
- \expandafter\definefontglobal
- \fi} % #1 == \cs
-
-\def\definefontlocal#1%
- {\expandafter\edef\csname#1\endcsname % ! ! ! ! not needed in luatex ! ! ! !
- {\noexpand\csname#1:\endcsname
- \noexpand\reactivatefont{\somefontname}{\fontfile}}%
- \expandafter\font\csname#1:\endcsname\lastfontname\relax
- \expandafter\let\expandafter\lastrawfontcall\csname#1:\endcsname
- \the\everydefinefont}
-
-\def\definefontglobal#1% stores \somefontname=Mono and \fontfile=cmtt10
- {\expandafter\xdef\csname#1\endcsname % ! ! ! ! not needed in luatex ! ! ! !
- {\noexpand\csname#1:\endcsname
- \noexpand\reactivatefont{\somefontname}{\fontfile}}%
- \global\expandafter\font\csname#1:\endcsname\lastfontname\relax
- \expandafter\let\expandafter\lastrawfontcall\csname#1:\endcsname
- \the\everydefinefont}
-
-\def\reactivatefont#1#2%
- {\def\somefontname{#1}%
- \def\fontfile {#2}%
- \updatefontparameters}
-
-% can be handy for tracing purposes
-%
-% \def\reportfontdefinition
-% {\bgroup
-% \expanded{\infofont
-% [\lastfontidentifier
-% ->\newfontidentifier
-% ->\fontname\csname\newfontidentifier\endcsname]}%
-% \endgraf
-% \egroup}
-
-%D An additional the second \type {\font} definition can
-%D prevent fuzzy font refs
-%D
-%D \starttyping
-%D \expandafter\font\csname\dummyfontname\endcsname\lastfontname
-%D \stoptyping
-%D
-%D but somehow they changed \TEX\ so that it does not matter
-%D any more.
-
-\def \defaultfontfile{\truefontname{Normal}} % was cmtt10, but that one is gone
-\edef\nullfontname {\fontname\nullfont}
-\edef\dummyfontname {font\strippedcsname\\}
-
-%D \macros
-%D {everyfont,everyfontswitch}
-%D
-%D For special purposes, we provide a hook.
-
-% \newevery \everyfont \relax
-% \newevery \everyfontswitch \relax
-
-% safer but sometimes introducing newlines in the log
-%
-% \batchmode
-% \font\lastloadedfont\fontfile\somefontspec\relax
-% \errorstopmode
-% \edef\lastfontname{\fontname\lastloadedfont}%
-% \ifx\lastfontname\nullfontname
-% \showmessage\m!fonts{10}{\fontfile}%
-% \expandafter\font\csname#1\endcsname=\defaultfontfile\somefontspec\relax
-% \else
-% \expandafter\let\csname#1\endcsname\lastloadedfont
-% \fi
-
-%D We also accept \type{sa a}||\type{sa d} as specification.
-
-\def\checkfontscale#1#2\end#3%
- {#3\ifcsname\??ft\s!default\noexpand#1\endcsname
- \csname\??ft\s!default\noexpand#1\endcsname\else#1#2%
- \fi#3}
-
-%D The duplicate font definition, using the ever the same dummy
-%D font name, results in less fuzzy error messages. In the log
-%D file, for instance when overfull boxes are reported, the
-%D simple keyword `font' replaces the \TEX\ ordinated name. The
-%D latter can be too misleading, due to the fact that \TEX\ has
-%D a rather optimized font memory management. Thanks to Taco
-%D for helping me sort this out.
-
-%D \macros
-%D {definefontsynonym, doifelsefontsynonym,
-%D expandfontsynonym, truefontname, truefontdata}
-%D
-%D While looking for fonts, fontsynonyms are used for accessing
-%D the files!
-%D
-%D \starttyping
-%D \definefontsynonym[Serif][Lucida-Bright]
-%D \definefontsynonym[Lucida-Bright][lbr][encoding=texnansi]
-%D \stoptyping
-%D
-%D The definitions can be accessed by:
-%D
-%D \startlines
-%D name: \type {\truefontname{Lucida-Bright}}
-%D data: \type {\truefontdata{\truefontname{Lucida-Bright}}}
-%D \stoplines
-
-% \def\definefontsynonym
-% {\dotripleempty\dodefinefontsynonym}
-%
-% \def\dodefinefontsynonym[#1][#2][#3]%
-% {\@EA\edef\csname\??ff\fontclass#1\endcsname{#2}%
-% \ifthirdargument
-% \edef\@@fontdata{#3}%
-% \ifx\@@fontdata\empty \else
-% \edef\@@fontfile{#2}%
-% \ifx\fontclass\empty
-% \getfontparameters
-% \else
-% \getglobalfontparameters
-% \fi
-% \fi
-% \fi}
-%
-% slightly faster, noticable when loading many typefaces,
-%
-% \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
- \doifnextoptionalelse\dodefinefontsynonym\donothing}
-
-\def\dodefinefontsynonym[#1]%
- {\edef\@@fontdata{#1}%
- \ifx\@@fontdata\empty \else \ifx\fontclass\empty
- \getfontparameters
- \else
- \getglobalfontparameters
- \fi \fi}
-
-\let\definefontfile\definefontsynonym % dedicated to Taco Hoekwater
-
-\def\setupfontsynonym
- {\dodoubleempty\dosetupfontsynonym}
-
-\def\dosetupfontsynonym[#1][#2]%
- {\edef\@@fontdata{#2}%
- \ifx\@@fontdata\empty \else
- \edef\@@fontfile{#1}%
- \ifx\fontclass\empty
- \getfontparameters
- \else
- \getglobalfontparameters
- \fi
- \fi}
-
-\def\truefontdata#1#2%
- {\ifcsname\??ff#1#2\endcsname
- % raw(Regular) raw(key)
- \csname\??ff#1#2\endcsname
- \else\ifcsname\??ff\fontclass#1\endcsname
- % exp(palatino Regular) raw(key)
- \expandafter\truefontdata\csname\??ff\fontclass#1\endcsname#2%
- \else\ifcsname\??ff#1\endcsname
- % exp(Regular) raw(key)
- \expandafter\truefontdata\csname\??ff#1\endcsname#2%
- \else\ifcsname\??ff#2\endcsname
- % raw(key)
- \csname\??ff#2\endcsname
- \fi\fi\fi\fi}
-
-\def\truefontname#1%
- {\ifcsname\??ff\fontclass#1\endcsname
- \@EA\truefontname\csname\??ff\fontclass#1\endcsname
- \else\ifcsname\??ff#1\endcsname
- \@EA\truefontname\csname\??ff#1\endcsname
- \else
- #1%
- \fi\fi}
-
-\def\expandfontsynonym#1#2% #2 := onelevelexpansion(#1)
- {\ifcsname\??ff\fontclass#2\endcsname
- \expandafter\def\expandafter#1\expandafter{\csname\??ff\fontclass#2\endcsname}%
- \fi}
-
-\def\doifelsefontsynonym#1%
- {\ifcsname\??ff\fontclass#1\endcsname
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-% \definetypeface[palatino][rm][serif][palatino,allbold][default]
-%
-% \startfontclass[palatino]
-% \definefontsynonym [Serif] [SerifBold]
-% \definefontsynonym [SerifItalic] [SerifBoldItalic]
-% \definefontsynonym [SerifSlanted] [SerifBoldSlanted]
-% \definefontsynonym [SerifCaps] [SerifBold]
-% \stopfontclass
-%
-% \setupbodyfont[palatino]
-
-\def\startfontclass
- {\dosingleempty\dostartfontclass}
-
-\def\dostartfontclass[#1]%
- {\pushmacro\fontclass
- \doifelse{#1}{\v!each}
- {\let\fontclass\empty}
- {\doifsomething{#1}{\def\fontclass{#1}}}}
-
-\def\stopfontclass
- {\popmacro\fontclass}
-
-%D \macros
-%D {tracedfontname}
-%D
-%D A goody:
-
-\def\tracedfontencoding#1%
- {\ifcsname\??ff#1\s!encoding\endcsname
- \space[\csname\??ff#1\s!encoding\endcsname]%
- \fi}
-
-\def\tracedfontname#1%
- {\ifcsname\??ff\fontclass#1\endcsname
- #1\tracedfontencoding{\fontclass#1}\space->\space
- \@EA\tracedfontname\csname\??ff\fontclass#1\endcsname
- \else\ifcsname\??ff#1\endcsname
- #1\tracedfontencoding{#1}\space->\space
- \@EA\tracedfontname\csname\??ff#1\endcsname
- \else
- #1%
- \fi\fi}
-
-%D \macros
-%D {getfontfileparameters}
-%D
-%D For special purposes, one can use the next macro to
-%D access font file characteristics, for instance:
-%D
-%D \starttyping
-%D \getfontfileparameters{Regular}
-%D \stoptyping
-%D
-%D can result in:
-%D
-%D \starttyping
-%D \def\currentfontfileencoding{texnansi}
-%D \stoptyping
-
-\def\getfontfileparameters#1% can be simpler for mkii (no features)
- {\edef\@@truefontname{\truefontname{#1}}%
- \edef\currentfontfileencoding{\truefontdata\@@truefontname\s!encoding}%
- \edef\currentfontfilemapping {\truefontdata\@@truefontname\s!mapping }%
- \edef\currentfontfilehandling{\truefontdata\@@truefontname\s!handling}}
-
-%D \macros
-%D {definefont}
-%D
-%D Before we implement the main definition macro, we first show
-%D one for local use:
-%D
-%D \starttyping
-%D \definefont[Some][LucidaBright at 100pt] \Some some
-%D \definefont[More][LucidaBright scaled 3000] \More more
-%D \definefont[Nice][LucidaBright mp 2] \Nice nice
-%D \definefont[Text][LucidaBright sa 5.4] \Text last
-%D \stoptyping
-%D
-%D The implementation looks as follows:
-
-\def\definefont
- {\dotripleempty\dodefinefont}
-
-\def\dodefinefont[#1][#2][#3]% [name][spec][1.6 | line=10pt | setup_id]
- {\doifinstringelse{ }{#2}
- {\ifthirdargument
- \unexpanded\setvalue{#1}{\redodefinefont{#1}{#2}{#3}}%
- \else
- \unexpanded\setvalue{#1}{\dododefinefont{#1}{#2}}%
- \fi}
- {\definefont[#1][#2 sa *][#3]}}
-
-\def\redodefinefont#1#2#3%
- {\dododefinefont{#1}{#2}%
- \doifsetupselse{#3}
- {\setups[#3]} % don't forget to document this !
- {\setuplocalinterlinespace[#3]%
- \setupspacing}} % needed ?
-
-\def\definefrozenfont
- {\dotripleempty\dodefinefrozenfont}
-
-\def\dodefinefrozenfont[#1][#2][#3]%
- {\dodefinefont[#1][#2][#3]%
- \expandafter\let\csname\lastfontidentifier\expandafter\endcsname\csname\rawfontidentifier\endcsname}
-
-% \def\defineclassfont
-% {\doquadrupleempty\dodefineclassfont}
-%
-% \def\dodefineclassfont[#1][#2][#3][#4]% #2 = class
-% {\iffourthargument
-% \definefont[#1][#2#3][#4]%
-% %\else\ifthirdargument
-% % \definefont[#1][#2#3]%
-% \else
-% \definefont[#1][#2]%
-% \fi}
-
-%D The \type {*} makes the switch local, so that we can redefine a
-%D logical name and/or change the size in between.
-
-\newif\ifautofontsize \autofontsizetrue
-
-\let\lastfontidentifier\empty
-
-\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
- \let\localabsolutefontsize\fontbody
- \parsefontspec{#2}\rawfontidentifier
- \let\localrelativefontsize\defaultrelativefontsize % not needed
- \csname\rawfontidentifier\endcsname
- \autofontsizefalse
- \setfontcharacteristics
- \the\everyfontswitch}
-
-\def\xxdododefinefont#1#2#3#4% \autofontsizetrue is set by calling routine
- {\edef\lastfontidentifier{#3}%
- \ifcsname\newfontidentifier\endcsname\else
- \def\localrelativefontsize{#1}%
- \def\localabsolutefontsize{#2}%
- \parsefontspec{#4}\newfontidentifier
- \let\localrelativefontsize\defaultrelativefontsize % not needed
- \fi
- \csname\newfontidentifier\endcsname
- \autofontsizefalse
- %\edef\lastfontidentifier{#3}%
- \ifskipfontcharacteristics \else
- \setfontcharacteristics
- \the\everyfontswitch
- \fi}
-
-%D I considered checking for mistakenly use of \PLAIN's
-%D \type{\magstep}'s but although it would take only a few
-%D lines of code, this would not add to consistent use. I
-%D therefore removed this check.
-
-%D \macros
-%D {mapfontsize}
-%D
-%D For special purposes, like in math, you may want to use
-%D slightly different sizes than the ones given. This happens
-%D for instance with the Math Times fonts. Mapped font sizes
-%D can be specified by using the \type {mo} key instead of
-%D \type {sa} in font definitions.
-%D
-%D \startbuffer
-%D \mapfontsize[10pt][11pt]
-%D \mapfontsize[11pt][12pt]
-%D \mapfontsize[12pt][13pt]
-%D
-%D \definefont[test][Serif]\test TEST \par
-%D \definefont[test][Serif sa 5]\test TEST \par
-%D \definefont[test][Serif mo 5]\test TEST \par
-%D \definefont[test][Serif sa d]\test TEST \par
-%D \definefont[test][Serif at 60pt]\test TEST \par
-%D \definefont[test][Serif scaled 6000]\test TEST \par
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \startpacked
-%D \getbuffer
-%D \stoppacked
-
-\def\mapfontsize
- {\dodoubleargument\domapfontsize}
-
-\def\domapfontsize[#1][#2]%
- {\scratchdimen#1\relax % \relax is really needed here
- \setvalue{\??ft*\the\scratchdimen}{#2}}
-
-\def\setmappedfontsize#1%
- {\ifcsname\??ft*#1\endcsname
- \csname\??ft*#1\endcsname
- \else
- #1%
- \fi}
-
-%D \macros
-%D {getfontname}
-%D
-%D The names of the fonts can be called with the rather simple
-%D macro \type{\getfontname}. When for instance we pass
-%D \type{12ptrmtf} as argument, we get \getfontname{12ptrmtf}.
-
-\def\getfontname#1%
- {\csname\??ft#1\endcsname}
-
-%D To be documented.
-
-\let\fontsizelist\empty
-\let\fontstylelist\empty
-
-\def\definefontsize[#1]% sneller met toks
- {\addtocommalist{#1}\fontsizelist
- \def\docommand##1%
- {\def\dodocommand####1%
- {\def\dododocommand########1%
- %{\checkbodyfont{}{########1}{####1}{##1}}%
- {\checkbodyfont{########1}{####1}{##1}}%
- \processcommacommand[\fontstylelist]\dododocommand}%
- \processcommacommand[\fontalternativelist]\dodocommand}%
- \processcommacommand[\fontsizelist]\docommand}
-
-\def\fontalternativetextlist{\c!tf,\c!bf,\c!it,\c!sl,\c!bs,\c!bi,\c!sc}
-\def\fontalternativemathlist{\c!mr,\c!mi,\c!sy,\c!ex,\c!ma,\c!mb}
-
-\let\fontalternativelist\fontalternativetextlist % upward compatible
-
-%D \macros
-%D {currentfontscale,currentfontbodyscale}
-%D
-%D Sometimes we need to have access to the font scale
-%D including the \type{a}||\type{d} sizes. The next macro
-%D returns the current scaling factor. Take a look at
-%D \type {cont-log.tex} for an example of its use.
-
-\def\currentfontscale
- {\csname\??ft\s!default
- \ifcsname\??ft\s!default\xfontsize\endcsname \xfontsize \else
- \ifcsname\??ft\s!default\s!text \endcsname \s!text \fi\fi
- \endcsname}
-
-\def\currentfontbodyscale
- {\csname\??ft\s!default
- \ifcsname\??ft\s!default\fontsize\endcsname \fontsize \else
- \ifcsname\??ft\s!default\s!text \endcsname \s!text \fi\fi
- \endcsname}
-
-\setvalue{\??ft\s!default}{1}
-
-%D Both alternatives use \type {\xfontsize}, a macro that
-%D expands to the current size in terms of \type {a} \unknown
-%D \type {d}, nothing, or \type {x} \unknown \type {xx}.
-
-\def\xfontsize{\ifcase\currentxfontsize\fontsize\or\c!x\else\c!xx\fi}
-
-%D A typical use of this command is in commands that switch
-%D to another font bypassing the font mechanism:
-%D
-%D \starttyping
-%D \font\myfont=\truefontname{MyFont} at \currentfontscale\bodyfontsize
-%D \stoptyping
-
-%D Now we enter the area of font switching. The switching
-%D mechanism has to take care of several situations, like:
-%D
-%D \startitemize[packed]
-%D \item changing the overal document fonts (including margins,
-%D headers and footers)
-%D \item changing local fonts (only the running text)
-%D \item smaller and even more smaller alternatives (super-
-%D and subscripts)
-%D \stopitemize
-%D
-%D \TEX\ offers a powerfull family mechanism for super- and
-%D subscripts in math mode. In text mode however, we don't use
-%D families for the smaller alternatives, and therefore have
-%D to take care of it otherwise.
-
-%D \macros
-%D {definebodyfontenvironment,setupbodyfontenvironment}
-%D
-%D The relationship between the several sizes of a font, is
-%D defined by:
-%D
-%D \showsetup{definebodyfontenvironment}
-%D
-%D Later on we will see how these parameters are used, so for
-%D the moment we stick with an example:
-%D
-%D \starttyping
-%D \definebodyfontenvironment
-%D [12pt]
-%D [ text=12pt,
-%D script=9pt,
-%D scriptscript=7pt,
-%D x=10pt,
-%D xx=8pt,
-%D big=12pt,
-%D small=10pt]
-%D \stoptyping
-%D
-%D The first argument specifies the bodyfont size to which the
-%D settings apply. All second parameters are specified in
-%D dimensions and tell us more about related sizes.
-%D
-%D Afterwards, one can change values with
-%D
-%D \showsetup{setupbodyfontenvironment}
-%D
-%D Due to the fact that \type{\c!text} and \type{\s!text} can
-%D have a similar meaning, and therefore can lead to an
-%D unwanted loop, we temporary redefine \type{\c!text}. For
-%D the moment this in only place that some trickery is needed
-%D to fool the multilingual interface.
-%D
-%D When instead of a size the keyword \type{unknown} is
-%D passed, fractions (relations) are used instead of fixed
-%D sizes.
-
-\let\bodyfontenvironmentlist\empty
-
-\newcount\@@fontdefhack
-
-\def\@@beginfontdef
- {\ifcase\@@fontdefhack
- \let\k!savedtext \k!text \let\k!text \s!text
- \let\k!k!savedtext \k!k!text \let\k!k!text \!!plusone
- \let\k!saveddefault \k!default \let\k!default \s!default
- \let\k!k!saveddefault\k!k!default \let\k!k!default \!!plusone
- \fi
- \advance\@@fontdefhack \plusone }
-
-\def\@@endfontdef
- {\advance\@@fontdefhack \minusone
- \ifcase\@@fontdefhack
- \let\k!k!default\k!k!saveddefault
- \let\k!default \k!saveddefault
- \let\k!k!text \k!k!savedtext
- \let\k!text \k!savedtext
- \fi}
-
-\def\definebodyfontenvironment
- {\dotripleempty\dodefinebodyfontenvironment}
-
-\def\dodefinebodyfontenvironment[#1][#2][#3]% class size settings
- {\ifthirdargument
- \@@beginfontdef
- \doifelse{#2}\s!default
- {\getparameters[\??ft\s!default][#3]}
- {\normalizebodyfontsize#2\to\tempbodyfontsize
- \addtocommalist\tempbodyfontsize\bodyfontenvironmentlist
- \@EA\dododefinebodyfontenvironment\@EA[\tempbodyfontsize][#1][#3]}%
- \@@endfontdef
- \else
- \definebodyfontenvironment[\fontclass][#1][#2]% change */*
- \fi}
-
-\def\dododefinebodyfontenvironment[#1][#2][#3]% size class settings
- {\@@beginfontdef
- \doifundefined{\??ft#2#1\c!em} % \s!text goes wrong in testing because
- {\def\docommand##1% % the 12pt alternative will called when
- {\scratchdimen#1\relax % typesetting the test (or so)
- \scratchdimen\csname\??ft\s!default##1\endcsname\scratchdimen
- \normalizebodyfontsize\scratchdimen\to\tempbodyfontsize
- \setevalue{\??ft#2#1##1}{\tempbodyfontsize}}%
- \processcommacommand[\fontrelativesizelist]\docommand
- \copyparameters
- [\??ft#2#1][\??ft\s!default]
- [\c!interlinespace,\c!em]}%
- \getparameters[\??ft#2#1][#3]%
- \@@endfontdef
- % new code, see remark
- \ifloadingfonts \else % only runtime
- \doifundefined{\@size@#1} % only once
- {\letvalue{\@size@#1}\empty % prevent loop
- \defineunknownfont{#1}}% % safeguard
- \fi
- % so far
- \setvalue{\@size@#1}{\docompletefontswitch[#1]}}
-
-%D {\bf Remark:} We need to cover the following cases,
-%D otherwise users can get confused:
-%D
-%D \starttyping
-%D \setupbodyfont[23pt]
-%D
-%D \definebodyfontenvironment[23pt]
-%D \setupbodyfont[23pt]
-%D
-%D \definebodyfontenvironment[23pt]
-%D \definebodyfont[23pt][rm,ss,tt][default]
-%D \setupbodyfont[23pt]
-%D \stoptyping
-
-%D Beware: while some font defs can be global, the bodyfont
-%D environment checks local. This means that multiple local
-%D checks resulting in definitions are not that efficient.
-%D So, apart from an occasional switch, one should define an
-%D environment at the outer level.
-
-\def\checkbodyfontenvironment[#1]%
- {\definebodyfontenvironment[\fontclass][#1][]}
-
-% original
-%
-% \def\setupbodyfontenvironment
-% {\dotripleempty\dosetupbodyfontenvironment}
-%
-% \def\dosetupbodyfontenvironment[#1][#2][#3]% class size settings
-% {\@@beginfontdef
-% \ifthirdargument
-% \getparameters[\??ft#1#2][#3]%
-% \else
-% \getparameters[\??ft#1][#2]%
-% \fi
-% \@@endfontdef}
-%
-% this one already catches both define/setup
-
-\def\setupbodyfontenvironment{\definebodyfontenvironment}
-
-% officially, but not needed (yet):
-%
-% \def\dosetupbodyfontenvironment[#1][#2][#3]% class size settings
-% {\ifthirdargument
-% \localbodyfontsize#2\relax
-% \normalizebodyfontsize\localbodyfontsize\to\normalizedbodyfontsize
-% \doifundefinedelse{\??ft#1\normalizedbodyfontsize\c!em}
-% {\definebodyfontenvironment[#1][#2][#3]}%
-% {\getparameters[\??ft#1\normalizedbodyfontsize][#3]}%
-% \else
-% \localbodyfontsize#1\relax
-% \normalizebodyfontsize\localbodyfontsize\to\normalizedbodyfontsize
-% \doifundefinedelse{\??ft\normalizedbodyfontsize\c!em}
-% {\definebodyfontenvironment[#1][#2]}%
-% {\getparameters[\??ft\normalizedbodyfontsize][#2]}%
-% \fi}
-
-%D Just a couple of interface macros:
-
-\def\bodyfontvariable#1%
- {\??ft\ifcsname\??ft\fontclass#1\endcsname\fontclass\fi#1}
-
-\def\bodyfontcsname
- {\csname\bodyfontvariable}
-
-\def\bodyfontinterlinespecs
- {\bodyfontvariable{\normalizedbodyfontsize\c!interlinespace}}
-
-\def\bodyfontinterlinespace
- {\csname\bodyfontinterlinespecs\endcsname}
-
-%D We default all parameters to the main bodyfont size (begin
-%D \type{#1}), so the next setup is valid too:
-%D
-%D \starttyping
-%D \definebodyfontenvironment[24pt]
-%D \stoptyping
-%D
-%D All parameters can be redefined when needed, so one does
-%D not have to stick to the default ones.
-
-%D \macros
-%D {definebodyfont}
-%D
-%D The next step in defining a bodyfont involves the actual font
-%D files, which can be recognized by their extension
-%D \type{tfm}. Installing those file is often beyond the
-%D scope of the user and up to the system administrator.
-%D
-%D \showsetup{definebodyfont}
-%D
-%D This commands takes three arguments: a (series of) bodyfont
-%D size(s), the style group to which the definitions belong,
-%D and an alternative, as specified by the \TEX\ (math) families,
-%D extended with~a, b~\unknown.
-%D
-%D We show two examples, that show all the alternative
-%D scaling options. The \type{\tfa} alternatives can be
-%D extended with \type{\bfa}, \type{\slb}, etc. or even
-%D \type{e} and higher alternatives.
-%D
-%D \starttyping
-%D \definebodyfont [12pt] [rm]
-%D [tf=cmr12,
-%D bf=cmbx12,
-%D it=cmti12,
-%D sl=cmsl12,
-%D bi=cmbxti10 at 12pt,
-%D bs=cmbxsl10 at 12pt,
-%D tfa=cmr12 scaled \magstep1,
-%D tfb=cmr12 scaled \magstep2,
-%D tfc=cmr12 scaled \magstep3,
-%D tfd=cmr12 scaled \magstep4,
-%D sc=cmcsc10 at 12pt]
-%D
-%D \definebodyfont [12pt,11pt,10pt,9pt,8pt] [rm]
-%D [tf=lbr sa 1,
-%D bf=lbd sa 1,
-%D it=lbi sa 1,
-%D sl=lbsl sa 1,
-%D bi=lbdi sa 1,
-%D bs=lbdi sa 1,
-%D tfa=lbr sa 1.200,
-%D tfb=lbr sa 1.440,
-%D tfc=lbr sa 1.728,
-%D tfd=lbr sa 2.074,
-%D sc=lbr sa 0.833]
-%D \stoptyping
-%D
-%D The second example shows that we can define more sizes at
-%D once. The main difference between these examples is that the
-%D Computer Modern Roman come in many design sizes. This means
-%D that there we cannot define them in bulk using \type{sa}.
-%D Instead of \type{rm} (roman) one can define \type{ss} (sans
-%D serif), \type{tt} (teletype), \type{hw} (hand written),
-%D \type{cg} (calygraphic) and whatever styles.
-%D
-%D The first argument may be a comma separated list. This,
-%D combined with specifications using \type{sa} can save a lot
-%D of typing. Although all arguments should be specified, we
-%D treat the second argument as optional.
-%D
-%D Defining a bodyfont involves two actions: defining the
-%D specific style related alternatives, like \type{\rma},
-%D \type{\bfa} and \type{\rmsla}, and storing the definitions
-%D of their bodyfont size related fonts. The first step is
-%D bodyfont independant but executed every time. This permits
-%D user definitions like \type{\tfw} or \type{\bfq} for real
-%D large alternatives.
-
-\def\definebodyfont
- {\doquadrupleempty\redefinebodyfont}
-
-\def\redefinebodyfont[#1][#2][#3][#4]%
- {\iffourthargument
- \processcommacommand[#1]{\reredefinebodyfont[#2][#3][#4]}%
- \else
- \dodefinebodyfont[#1][#2][#3]%
- \fi}
-
-\def\reredefinebodyfont[#1][#2][#3]#4%
- {\pushmacro\fontclass
- \doifelse{#4}\s!default
- {\let\fontclass\empty}
- {\def\fontclass{#4}}%
- \definebodyfont[#1][#2][#3]%
- \popmacro\fontclass}
-
-\def\dodefinebodyfont[#1][#2][#3]% body|identifier style defs|identifier
- {\ifthirdargument
- \doifnumberelse{#1}
- {\doifassignmentelse{#3}
- {% [12pt] [style] [settings]
- \doifundefined{#2}{\expanded{\definefontstyle[#2][#2]}}% new
- \processcommalist[#1]{\dododefinebodyfont{#2}{#3}}}
- {% [12pt] [style] [identifier]
- \dodefinedefaultbodyfont[#1][#2][#3]}} % body style identifier
- {% [identifier] [style] [settings] % see ***
- \setvalue{\s!default#1#2}##1##2{\expanded{\xdodefinebodyfont[##1][##2][#3]}}}%
- \else\ifsecondargument
- \definebodyfont[#1][\c!rm][#2]%
- \else
- \doifundefined{\@size@#1} % Maybe there are default dependancies
- {\defineunknownfont{#1}}% defined which we can use ([unknown])
- \doifundefined{\@size@#1} % and if not, then we have at least to
- {\definebodyfont[#1][\c!rm][]}% make sure some basics are set up.
- \fi\fi}
-
-\def\xdodefinebodyfont[#1][#2][#3]% body|identifier style defs|identifier
- {%\writestatus{[#1]}{[#2][#3]}%
- \checkrelativefontsize{#2}% rather new, inherit from other defs
- \ifundefined{#2}\expanded{\definefontstyle[#2][#2]}\fi % new
- \processcommalist[#1]{\dododefinebodyfont{#2}{#3}}%
- \let\relativefontsize\defaultrelativefontsize}
-
-\def\dododefinebodyfont#1#2#3% style defs body
- {\checkbodyfontenvironment[#3]% just to be sure.
- \processcommalist[#2]{\dodododefinebodyfont{#1}{#3}}}
-
-\def\dodododefinebodyfont#1#2#3% style body def
- {\dododododefinebodyfont{#1}{#2}[#3]}
-
-\newif \ifresolvefontfile % protected by fontclass anyway
-
-\def\resolvefontname#1 {\truefontname{#1} }
-
-\def\iflocalclassfonts{\ifx\fontclass\empty}
-
-\def\dododododefinebodyfont#1#2[#3#4#5=#6]% style body def
- {\ifundefined{#1#3#4#5}%
- %\checkbodyfont{#2}{#1}{#3#4}{#5}% not \definefontsize[#5]
- \checkbodyfont{#1}{#3#4}{#5}% not \definefontsize[#5]
- \fi
- \iflocalclassfonts
- \letbeundefined{*\fontclass#2#1#3#4#5*}%
- \scratchtoks{#6}%
- \expanded{\unexpanded\noexpand\setvalue{#2#1#3#4#5}%
- {\noexpand\xxdododefinefont{\relativefontsize}{#2}%
- {#2#1#3#4#5}{\the\scratchtoks}}}%
- \else
- %\expanded{\writestatus{defining}{[\fontclass][#2#1#3#4#5] \resolvefontname#6 }}%
- \global\letbeundefined{*\fontclass#2#1#3#4#5*}%
- \ifresolvefontfile
- \unexpanded\setxvalue{\fontclass#2#1#3#4#5}%
- {\noexpand\xxdododefinefont{\relativefontsize}{#2}%
- {#2#1#3#4#5}{\resolvefontname#6 }}%
- \else
- \scratchtoks{#6}%
- \expanded{\unexpanded\noexpand\setgvalue{\fontclass#2#1#3#4#5}%
- {\noexpand\xxdododefinefont{\relativefontsize}{#2}%
- {#2#1#3#4#5}{\the\scratchtoks}}}%
- \fi
- \fi}
-
-% \def\checkbodyfont#1#2#3#4% body style alt size / gdef % #4 can be empty
-% {\def\c!!mm{#2}%
-% \ifx\c!!mm\c!mm % prevents \max and alike (re)defs
-% \unexpanded\setgvalue {#2}{\setcurrentfontstyle {#2}}% \rm
-% \unexpanded\setgvalue {#3}{\setcurrentfontalternative {#3}}% \sl
-% \else
-% \unexpanded\setgvalue {#2#4}{\setcurrentfontstylesize {#2}{#4}}% \rma
-% \unexpanded\setgvalue {#3#4}{\setcurrentfontalternativesize {#3}{#4}}% \sla
-% \unexpanded\setgvalue {#2#3#4}{\setcurrentfontstylealternativesize{#2}{#3}{#4}}% \rmsla
-% \unexpanded\setgvalue {#2}{\setcurrentfontstyle {#2}}% \rm
-% \unexpanded\setgvalue {#3}{\setcurrentfontalternative {#3}}% \sl
-% \unexpanded\setgvalue {#2\c!x}{\setcurrentfontxstylealternative {#2}}% \rmx
-% \unexpanded\setgvalue{#2\c!xx}{\setcurrentfontxxstylealternative {#2}}% \rmxx
-% \unexpanded\setgvalue {#3\c!x}{\setcurrentfontxalternative {#3}}% \slx
-% \unexpanded\setgvalue{#3\c!xx}{\setcurrentfontxxalternative {#3}}% \slxx
-% \unexpanded\setgvalue {#2#3}{\setcurrentfontstylealternative {#2}{#3}}% \rmsl
-% \fi}
-%
-% leaner
-
-\def\checkbodyfont#1% tests for ttsl mmbf
- {\def\c!!mm{#1}%
- \ifx\c!!mm\c!mm % prevents \max and alike (re)defs
- \expandafter\checkmathbodyfont
- \else
- \expandafter\checktextbodyfont
- \fi{#1}} % no \c!!mm, not expanded later on
-
-\def\checkmathbodyfont#1#2#3% style alt size / gdef % #3 can be empty
- {%\message{!m #1 #2 #3!}%
- % #1 #2 #3 = signal
- \unexpanded\setgvalue {#1#2#3}{\setcurrentfontstylealternativesize{#1}{#2}{#3}}% \mmsla
- \unexpanded\setgvalue {#1}{\setcurrentfontstyle {#1}}% \mm
- \unexpanded\setgvalue {#2}{\setcurrentfontalternative {#2}}}% \sl
-
-\def\checktextbodyfont#1#2#3% style alt size / gdef % #3 can be empty
- {%\message{!t #1 #2 #3!}%
- \unexpanded\setgvalue {#1#3}{\setcurrentfontstylesize {#1}{#3}}% \rma
- \unexpanded\setgvalue {#2#3}{\setcurrentfontalternativesize {#2}{#3}}% \sla
- \unexpanded\setgvalue {#1#2#3}{\setcurrentfontstylealternativesize{#1}{#2}{#3}}% \rmsla
- \unexpanded\setgvalue {#1}{\setcurrentfontstyle {#1}}% \rm
- \unexpanded\setgvalue {#2}{\setcurrentfontalternative {#2}}% \sl
- \unexpanded\setgvalue {#1\c!x}{\setcurrentfontxstylealternative {#1}}% \rmx
- \unexpanded\setgvalue{#1\c!xx}{\setcurrentfontxxstylealternative {#1}}% \rmxx
- \unexpanded\setgvalue {#2\c!x}{\setcurrentfontxalternative {#2}}% \slx
- \unexpanded\setgvalue{#2\c!xx}{\setcurrentfontxxalternative {#2}}% \slxx
- \unexpanded\setgvalue {#1#2}{\setcurrentfontstylealternative {#1}{#2}}}% \rmsl
-
-\def\dodefinedefaultbodyfont[#1][#2][#3]% sizes styles identifier
- {\def\dododefinedefaultbodyfont##1%
- {\def\dodododefinedefaultbodyfont####1%
- {\def\dododododefinedefaultbodyfont########1%
- {\doifdefined{\s!default########1####1}
- {% [12pt] [style] [identifier]
- \getvalue{\s!default########1####1}{##1}{####1}}}%
- \processcommalist[#3]\dododododefinedefaultbodyfont}%
- \processcommalist[#2]\dodododefinedefaultbodyfont}%
- \processcommalist[#1]\dododefinedefaultbodyfont}
-
-%D Unknown families are added to the family list! For the
-%D moment we also set the direct calls here. Some day a better
-%D solution will be implemented. The good news is that unknown
-%D fonts are defined automatically.
-
-\newif\ifdefiningunknownfont
-
-% \def\defineunknownfont#1%
-% {\let\c!savedtext\c!text
-% \let\c!text\s!text
-% \donefalse
-% \def\docommand##1%
-% {\doifdefined{\??ft\s!default##1}
-% {\donetrue
-% \scratchdimen#1\relax
-% \scratchdimen\csname\??ft\s!default##1\endcsname\scratchdimen
-% \normalizebodyfontsize\scratchdimen\to\!!stringa
-% \letvalue{\??ft#1##1}\!!stringa}}%
-% \processcommacommand[\fontrelativesizelist]\docommand
-% \let\c!text\c!savedtext
-% \ifdone
-% \donefalse
-% \def\defineunknownbodyfont##1% see ***
-% %{\doifdefined{\s!default##1}
-% % {\donetrue\getvalue{\s!default##1}{#1}}}%
-% {\doifdefined{\s!default\s!default##1}
-% {\donetrue\getvalue{\s!default\s!default##1}{#1}{##1}}}%
-% \processcommacommand
-% [\fontstylelist]
-% \defineunknownbodyfont
-% \ifdone
-% \setvalue{\@size@#1}{\docompletefontswitch[#1]}%
-% \ifdefiningunknownfont \else
-% \definingunknownfonttrue
-% \def\defineunknownsubfont##1%
-% {\doifundefined{\@size@\getvalue{\??ft#1##1}}
-% {\defineunknownfont{\getvalue{\??ft#1##1}}}}%
-% \processcommacommand[\fontrelativesizelist]\defineunknownsubfont
-% \definingunknownfontfalse
-% \fi
-% \fi
-% \ifdone
-% \showmessage\m!fonts{14}{#1}%
-% \fi
-% \fi}
-
-\def\dodefineunknownfont#1#2%
- {\doifdefined{\??ft\s!default#2}
- {\donetrue
- \scratchdimen#1\relax
- \scratchdimen\csname\??ft\s!default#2\endcsname\scratchdimen
- \normalizebodyfontsize\scratchdimen\to\!!stringa
- \letvalue{\??ft#1#2}\!!stringa}}
-
-% \def\dodefineunknownbodyfont#1#2% see ***
-% {\doifdefined{\s!default\s!default#2}
-% {\donetrue
-% \getvalue{\s!default\s!default#2}{#1}{#2}}}
-%
-% but ... it needs to be as follows:
-%
-% \def\dodefineunknownbodyfont#1#2% see ***
-% {\doifdefined{\s!default\fontclass#2}% was \s!default\s!default (related to change */*)
-% {\donetrue
-% \getvalue{\s!default\fontclass#2}{#1}{#2}}}
-%
-% eh ... this does not work so we revert back to:
-
-\def\dodefineunknownbodyfont#1#2% see ***
- {\doifdefined{\s!default\s!default#2}% somehow related to */*
- {\donetrue
- \getvalue{\s!default\s!default#2}{#1}{#2}}}
-
-\def\dodefineunknownsubfont#1#2%
- {\doifundefined{\@size@\getvalue{\??ft#1#2}}
- {\donetrue
- \defineunknownfont{\getvalue{\??ft#1#2}}}}
-
-\def\defineunknownfont#1%
- {\let\c!savedtext\c!text
- \let\c!text\s!text
- \donefalse
- \processcommacommand[\fontrelativesizelist]{\dodefineunknownfont{#1}}%
- \let\c!text\c!savedtext
- \ifdone
- \donefalse
- \processcommacommand
- [\fontstylelist]
- {\dodefineunknownbodyfont{#1}}%
- \ifdone
- \donefalse
- \setvalue{\@size@#1}{\docompletefontswitch[#1]}%
- \ifdefiningunknownfont \else
- \definingunknownfonttrue
- \processcommacommand[\fontrelativesizelist]{\dodefineunknownsubfont{#1}}%
- \definingunknownfontfalse
- \fi
- \fi
- \ifdone
- \showmessage\m!fonts{14}{#1}%
- \fi
- \fi}
-
-% \def\defineunknownfontstyles#1%
-% {\def\defineunknownbodyfont##1% see ***
-% {\executeifdefined{\s!default\s!default##1}\gobbletwoarguments{#1}{##1}}%
-% \rawprocesscommacommand[\fontstylelist]\defineunknownbodyfont}
-
-%D These macros show that quite some definitions take place.
-%D Fonts are not loaded yet! This means that at format
-%D generation time, no font files are preloaded.
-
-%D A previous implementation used:
-%D
-%D \starttyping
-%D \type {\setvalue{name}{\donottest...}}
-%D \stoptyping
-%D
-%D instead of the more memory hungry:
-%D
-%D \starttyping
-%D \unexpanded\setvalue{name}{...}
-%D \stoptyping
-%D
-%D The first alternative saves about 500 hash entries (about
-%D 2.5\% of the total number of entries used. The second
-%D alternative is currently used, because that one can more
-%D easily be made \ETEX\ aware.
-
-%D \macros
-%D {everybodyfont,Everybodyfont,everyglobalbodyfont}
-%D
-%D Every change in bodyfont size has conseqences for the baseline
-%D distance and skips between paragraphs. These are initialized
-%D in other modules. Here we only provide the hooks that
-%D garantees their handling.
-
-% \ifx\everybodyfont\undefined % permits reloading
-% \newevery \everybodyfont \EveryBodyFont
-% \fi
-
-%D At the system level one can initialize thing like:
-%D
-%D \starttyping
-%D \appendtoks \setupspacing \to \everybodyfont
-%D \stoptyping
-%D
-%D While users can add their own non standard commands like:
-%D
-%D \starttyping
-%D \EveryBodyFont{\message{changing to bodyfont \the\bodyfontsize}}
-%D \stoptyping
-%D
-%D Personnaly I never felt the need for such extensions, but
-%D at least its possible.
-
-%D \macros
-%D {globalbodyfontsize,localbodyfontsize}
-%D
-%D Next we'll do the tough job of font switching. Here we
-%D have to distinguish between the global (overal) bodyfont
-%D size and the local (sometimes in the textflow) size. We
-%D store these dimensions in two \DIMENSION\ registers.
-
-\ifdefined\globalbodyfontsize\else \newdimen\globalbodyfontsize \fi \globalbodyfontsize=12pt
-\ifdefined\localbodyfontsize \else \newdimen\localbodyfontsize \fi \localbodyfontsize =\globalbodyfontsize
-
-%D \macros
-%D {bodyfontsize}
-%D
-%D These two registers are not to be misused in calculations.
-%D For this purpose we keep a copy:
-
-\newdimen\bodyfontsize \bodyfontsize=\globalbodyfontsize
-
-%D \macros
-%D {outputresolution}
-%D
-%D Sometimes (to be honest: not in this module) we need to
-%D take the system resolution into account. Therefore we also
-%D define a macro:
-
-\def\outputresolution {600}
-
-%D \macros
-%D {bodyfontfactor,bodyfontpoints}
-%D
-%D For multiplication purposes we keep an auxiliary counter
-%D and macro (here the expansion is not explicitly needed):
-
-\newcount\bodyfontpoints \dimensiontocount\bodyfontsize\bodyfontpoints
-
-\edef\bodyfontfactor{\withoutpt\the\bodyfontsize}
-
-%D When we assign for instance 12pt to a \DIMENSION\ register
-%D the \type{\the}'d value comes out as 12.0pt, which is
-%D often not the way users specify the bodyfont size. Therefore
-%D we also store the normalized value.
-
-\chardef\fontdigits=2 % was 1
-
-% \def\normalizebodyfontsize#1\to#2%
-% {\scratchdimen#1\relax
-% \ifcase\fontdigits\advance\scratchdimen.5\points\fi
-% \@EA\@EA\@EA\donormalizedbodyfontsize\@EA\WITHOUTPT\the\scratchdimen00\to#2}
-%
-% \def\donormalizedbodyfontsize#1.#2#3#4\to#5% \points ?
-% {\edef#5%
-% {#1%
-% \ifcase\fontdigits\or
-% \ifcase#2 \else.#2\fi % and not: \ifcase#2\else ...
-% \else
-% \ifcase#2#3 \else.#2\ifcase#3 \else#3\fi\fi % not: \ifcase#2#3\else ...
-% \fi
-% \s!pt}}
-
-\def\normalizebodyfontsize#1\to#2%
- {\scratchdimen\dimexpr#1+\ifcase\fontdigits.5\or.05\or.005\fi\points\relax
- \@EA\@EA\@EA\donormalizedbodyfontsize\@EA\WITHOUTPT\the\scratchdimen000\to#2}
-
-\def\donormalizedbodyfontsize#1.#2#3#4#5\to#6% \points ?
- {\edef#6% not \ifcase#2\else due to \relax adding
- {#1%
- \ifcase\fontdigits
- \or \ifcase#2 \else .#2\fi % 1
- \or \ifcase#2#3 \else .#2\ifcase#3 \else #3\fi\fi % 2
- \else \ifcase#2#3#4 \else .#2\ifcase#4 \ifcase#3 \else#3\fi \else#3#4\fi\fi % 3
- \fi
- \s!pt}}
-
-%D To be internationalized:
-
-\def\korpsgrootte {\bodyfontsize}
-\def\korpspunten {\bodyfontpoints}
-
-%D some day.
-
-%D \macros
-%D {fontstyle,fontalternative,fontsize}
-%D
-%D Within a bodyfont, fonts can come in different sizes. For
-%D instance \type{\tf} is accompanied by \type{\tfa},
-%D \type{\tfb} etc. The first two characters denote the
-%D alternative, while the third character in these sequences
-%D represents the size. The actual size is saved in a macro
-%D
-%D The style, being roman (\type{\rm}), sans serif (\type{\ss})
-%D etc. is also available in a macro in \type{rm}, \type{ss}
-%D etc. form:
-
-\let\defaultfontalternative = \c!tf
-\let\defaultfontstyle = \empty
-\let\defaultfontsize = \empty
-
-\let\fontalternative = \defaultfontalternative
-\let\fontstyle = \defaultfontstyle
-\let\fontsize = \defaultfontsize
-
-%D {\em The following approach is obsolete.}
-%D
-%D All things related to fonts are grouped into files with
-%D names like \type{font-cmr}. These files are loaded by:
-
-\def\resetfontdefinitionfile[#1]%
- {\letbeundefined{\c!file\f!fontprefix#1}}
-
-\newif\ifloadfontfileonce
-
-\def\doreadfontdefinitionfile#1#2% #1 = set/switch state
- {\doifundefined{\c!file\f!fontprefix#2}%
- {\ifloadfontfileonce
- \letvalue{\c!file\f!fontprefix#2}\empty
- \fi
- \makeshortfilename[\truefilename{\f!fontprefix#2}]%
- \startreadingfile
- \readsysfile{\shortfilename.mkii}
- {\showmessage\m!fonts2{#2}}
- {\showmessage\m!fonts3{#2}}%
- \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
-%D all kind of font, which of course is a kind of
-%D typographically sin. The \type{"} is made inactive if
-%D needed to prevent problems with loading files that use this
-%D character in numbers.
-
-\def\doswitchpoints[#1]%
- {\expanded{\dodoswitchpoints{#1}}}
-
-\def\dodoswitchpoints#1%
- {\doifundefined{\@size@#1}
- {\defineunknownfont{#1}}%
- %\defineunknownfontstyles{#1}%
- \doifdefinedelse{\@size@#1}
- {\getvalue{\@size@#1}%
- \localbodyfontsize#1\relax
- \normalizebodyfontsize\localbodyfontsize\to\normalizedbodyfontsize
- \checkbodyfontenvironment[\normalizedbodyfontsize]}
- {\showmessage\m!fonts4{#1}}}
-
-\unprotected \def\doswitchstyle[#1]%
- {\doifdefinedelse{\@style@#1}
- {\getvalue{\@style@#1}%
- \edef\fontstyle{#1}%
- \ifmmode\mr\fi % in order to be compatible with \rm in math mode
- }% \the\everybodyfont} % cleaner, in setting size as well as style
- {\showmessage\m!fonts5{#1}}}
-
-%D \TEX\ loads font metric files like \type{cmr10.tfm} and
-%D \type{tir.tfm} only once. In \PLAIN\ \TEX\ some font files
-%D are {\em preloaded}. This means that the font files are
-%D loaded, but not accessible yet by name. This is accomplished
-%D by saying:
-%D
-%D \starttyping
-%D \font\preloaded=cmr10 at 11pt
-%D \stoptyping
-%D
-%D and using the name \type{\preloaded} again and again, so
-%D fonts are indeed loaded, but unnamed, and therefore
-%D unaccessible. In \CONTEXT\ we don't preload fonts, not even
-%D the \PLAIN\ \TEX\ ones, although users can access them. Now
-%D why is this done?
-
-%D Defining fonts using \type{\definebodyfont} takes time, so we
-%D prefer to predefine at least the Computer Modern Roman
-%D fonts. However, loading all those fonts at definition time
-%D would take both time and space. But even worse, once fonts
-%D are loaded into memory, their encoding vector is fixed,
-%D which is a handicap when we want to distribute the compact
-%D \type{fmt} files. So what we want to do is defining fonts in
-%D a way that postpones the loading. We accomplish this by only
-%D loading the fonts when we switch to another bodyfont size.
-%D Among the other alternatives, such as loading the font at
-%D the moment of activation and redefining the activation
-%D macro afterwards, this proved to be the most efficient
-%D alternative.
-%D
-%D The next few macros take care of the one exeption on this
-%D scheme. When at format generation time we load the default
-%D font file, the one that defines the Computer Modern Fonts,
-%D we don't want the fonts metrics to end up in the format
-%D file, so we temporary prohibit loading. This means that at
-%D runtime we have to load the default bodyfont size just before
-%D we start typesetting.
-%D
-%D Therefore we have to signal the font switching macros that
-%D we are preloading fonts. As long as the next boolean is,
-%D true, no loading is done.
-
-\newif\ifloadingfonts \loadingfontstrue
-
-%D \macros
-%D {preloadfonts}
-%D
-%D Preloading is only called for once, during the startup
-%D sequence of a session. After the loading job is done, the
-%D macro relaxes itself and reset the signal.
-
-\def\preloadfonts % never called, needs a clean up
- {\showmessage\m!fonts6{\normalizedbodyfontsize\normalspace\fontstyle}%
- \global\loadingfontsfalse
- \doswitchpoints[\normalizedbodyfontsize]%
- \doswitchstyle[\fontstyle]%
- \the\everybodyfont
- \the\everyglobalbodyfont
- \saveinterlinespace
- \global\let\preloadfonts\relax}
-
-% \prependtoks \preloadfonts \to \everydump % saves .1 s on a DELL P60 - 2GHZ
-
-%D Here comes the main font switching macros. These macros
-%D handle changes in size as well as returning to the global
-%D bodyfont size.
-
-\def\dosetfont#1#2% #1 = set/switch state
- {\doifelse{#2}\v!global
- {\restoreglobalbodyfont}
- {\processcommacommand[#2]{\dodosetfont{#1}}% ##1 get also passed
- \ifloadingfonts\else
- \doswitchpoints[\normalizedbodyfontsize]%
- \doswitchstyle[\fontstyle]%
- \fi}%
- \chardef\currentxfontsize\zerocount}
-
-\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}
- {\dodododosetfont{#1}{#2}{#3}}
- {\doifdefinedelse{\??ft\normalizedbodyfontsize\interfaced{#2}}
- {\edef\fontstep{\bodyfontcsname\normalizedbodyfontsize\interfaced{#2}\endcsname}%
- \expanded{\dodododosetfont{#1}{\fontstep}}{#3}}
- {\doifelse{#2}\v!reset
- {\let\fontstyle\empty % new 31/7/2006
- \let\fontsize \empty}
- {\doifdefinedelse{\@style@#2}
- {\edef\fontstyle{#2}}
- {\doreadfontdefinitionfile{#1}{#2}}}}}}
-
-\def\dodododosetfont#1#2#3% #1 = set/switch state
- {\scratchdimen#2\relax
- \normalizebodyfontsize\scratchdimen\to\normalizedsetfont
- \doifundefined{\@size@\normalizedsetfont}
- {\defineunknownfont{#2}}%
- \doifdefinedelse{\@size@\normalizedsetfont}
- {\localbodyfontsize\normalizedsetfont
- \let\normalizedbodyfontsize\normalizedsetfont}
- {#3\dosetsubstitutefont{#1}{#2}}}
-
-%D In the previous macros we use \type{\currentxfontsize} to
-%D hold the current x||size of the font. This enables us to
-%D support for instance \type{\sl} inside a \type{\tx} switch.
-
-\chardef\currentxfontsize=0
-
-%D When users specify for instance a 13 point bodyfont while no
-%D such bodyfont is defined, the system automatically tries to
-%D find a best fit, that is the nearest smaller defined
-%D bodyfontzize. A smaller one is definitely better than a larger
-%D one, simply because otherwise a lot of overfull box messages
-%D are more probable to occur. By taking a value slightly
-%D smaller than half a point, we can use the next method.
-
-\def\dosetsubstitutefont#1#2% #1 = set/switch state
- {\scratchdimen#2\relax
- \advance\scratchdimen .499\points
- \dimensiontocount\scratchdimen\scratchcounter
- \advance\scratchcounter \minusone
- \ifnum\scratchcounter>\plusthree
- \dododosetfont{#1}{\the\scratchcounter\s!pt}{}%
- \fi}
-
-% The following bunch of macros deals with the (run time)
-% expansion of names onto the definitions made by \type
-% {\definebodyfont}.
-
-% \let\fontbody \empty % ... 10pt 11pt 12pt ...
-% \let\fontstyle \empty % rm ss tt mm hw cg ...
-% \let\fontalternative\empty % tf bf sl it bs bi sc ...
-% \let\fontsize \empty % xy-abcd ...
-
-\def\defaultfontbody{\normalizedbodyfontsize}
-
-\let\fontbody\defaultfontbody
-
-\let\fontclass\empty \let\globalfontclass\fontclass
-
-% \def\setcurrentfontclass#1%
-% {\edef\fontclass{#1}}
-
-\def\registerfontclass#1%
- {\letgvalue{\@fontclass@#1}\v!yes} % global ?
-
-\def\setcurrentfontclass#1%
- {\ifcsname\@fontclass@#1\endcsname
- \edef\fontclass{#1}%
- \fi}
-
-\let\defaultfontstyle \c!rm
-\let\defaultfontalternative \c!tf
-\let\defaultfontsize \empty
-
-%D \macros
-%D {bigmath,nobigmath}
-%D
-%D We can inhibit this slow||downer with:
-
-% these can best be combined
-
-% 0=never 1=everymath 2=always
-
-\chardef\synchronizebigmathflag=1
-
-\appendtoks
- \ifcase\synchronizebigmathflag
- % never
- \or
- \synchronizebigmath
- \or
- % always
- \fi
-\to \everymathematics
-
-\def\nobigmath{\chardef\synchronizebigmathflag 0 }
-\def\bigmath {\chardef\synchronizebigmathflag 2 \synchronizebigmath}
-
-\let\bigmathfontsize\empty
-
-\def\synchronizebigmath
- {\ifx\bigmathfontsize\fontsize
- % already in sync
- \else
- \let\bigmathfontsize\fontsize
- \synchronizemath \synchronizetext
- \fi}
-
-\def\checkbigmathsynchronization
- {\ifcase\synchronizebigmathflag
- % never
- \or
- \ifmmode \synchronizebigmath \fi
- \or
- \synchronizebigmath
- \fi}
-
-%D So far for synchronisation.
-
-\def\dosetcurrentfontsize#1%
- {\edef\fontsize{#1}%
- \checkbigmathsynchronization}
-
-\def\dosetcurrentfontalternative#1%
- {\edef\fontalternative{#1}%
- \ifmmode % maybe no test, or actually, an option
- \fam\csname\fontalternative\s!fam\endcsname
- \fi}
-
-\def\setcurrentfont#1#2#3#4%
- {%\message{[1 #1 #2 #3 #4]}%
- \edef\fontbody{#1}%
- \edef\fontstyle{#2}%
- \dosetcurrentfontalternative{#3}%
- \dosetcurrentfontsize{#4}%
- \synchronizefont}
-
-\def\setcurrentfontbody#1%
- {%\message{[2 #1]}%
- \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:
-
-\ifx\checkfontclass\undefined \let\checkfontclass\gobbleoneargument \fi % implemented in type-ini
-
-\def\setcurrentfontstyle#1%
- {%\message{[3 #1]}%
- \checkfontclass{#1}%
- \edef\fontstyle{#1}%
- \ifmmode\mr\fi % otherwise \rm not downward compatible
- \synchronizefont}
-
-\def\setcurrentfontbodyalternative#1#2%
- {%\message{[4 #1 #2]}%
- \edef\fontbody{#1}%
- \dosetcurrentfontalternative{#2}%
- \synchronizefont}
-
-\def\setcurrentfontalternative#1%
- {%\message{[5 #1]}%
- \dosetcurrentfontalternative{#1}%
- \synchronizefont}
-
-\def\setcurrentfontsize#1%
- {%\message{[6 #1]}%
- \dosetcurrentfontsize{#1}%
- \synchronizefont}
-
-\def\setcurrentfontstylealternative#1#2% \rmsl
- {%\message{[7 #1 #2]}%
- \edef\fontstyle{#1}%
- \dosetcurrentfontalternative{#2}%
- \synchronizefont}
-
-\def\setcurrentfontstylesize#1#2% \rmsla
- {%\message{[8 #1 #2]}%
- \edef\fontstyle{#1}%
- \dosetcurrentfontsize{#2}%
- \synchronizefont}
-
-\def\setcurrentfontalternativesize#1#2% \sla
- {%\message{[9 #1 #2]}%
- \dosetcurrentfontalternative{#1}%
- \dosetcurrentfontsize{#2}%
- \synchronizefont}
-
-\def\setcurrentfontstylealternativesize#1#2#3% \rmsla
- {%\message{[10 #1 #2 #3]}%
- \edef\fontstyle{#1}%
- \dosetcurrentfontalternative{#2}%
- \dosetcurrentfontsize{#3}%
- \synchronizefont}
-
-%D In principle one can assign alternative fallback routines.
-%D Some day we will.
-
-\newtoks\fontstrategies
-\newif\iftryingfont
-
-\let\fontstrategy\relax
-
-\def\synchronizefont
- {\tryingfonttrue
- \ifx\fontclass\empty\else
- \global\let\fontstrategy\dofontclassstrategy
- \the\fontstrategies \relax % \relax still needed ?
- \fi
- \iftryingfont
- \global\let\fontstrategy\dofontstrategy
- \the\fontstrategies \relax % \relax still needed ?
- \fi
- \ifskipfontcharacteristics
- \setfontcharacteristics
- \the\everyfontswitch
- \fi}
-
-\def\dofontstrategy#1#2#3#4#5%
- {\ifcsname#2#3#4#5\endcsname
- #1\csname#2#3#4#5\endcsname \tryingfontfalse
- \fi}
-
-\def\dofontclassstrategy#1#2#3#4#5%
- {\ifcsname\fontclass#2#3#4#5\endcsname
- #1\csname\fontclass#2#3#4#5\endcsname \tryingfontfalse
- \fi}
-
-\appendtoks \iftryingfont \fontstrategy \autofontsizefalse % --- --- --- --- % pt tt bf a
- \fontbody \fontstyle \fontalternative \fontsize
-\fi \to \fontstrategies
-
-\appendtoks \iftryingfont \fontstrategy \autofontsizetrue % --- --- --- def % pt tt bf
- \fontbody \fontstyle \fontalternative \defaultfontsize
-\fi \to \fontstrategies
-
-\appendtoks \iftryingfont \fontstrategy \autofontsizetrue % --- --- def --- % pt tt tf a
- \fontbody \fontstyle \defaultfontalternative \fontsize
-\fi \to \fontstrategies
-
-\appendtoks \iftryingfont \fontstrategy \autofontsizetrue % --- --- def def % pt tt tf
- \fontbody \fontstyle \defaultfontalternative \defaultfontsize
-\fi \to \fontstrategies
-
-\appendtoks \iftryingfont \fontstrategy \autofontsizefalse % --- def def def % pt rm tf
- \fontbody \defaultfontstyle \defaultfontalternative \defaultfontsize
-\fi \to \fontstrategies
-
-\appendtoks \iftryingfont \fontstrategy \autofontsizetrue % def def def def % rm tf
- \defaultfontbody \defaultfontstyle \defaultfontalternative \defaultfontsize
-\fi \to \fontstrategies
-
-%D Let's synchronize:
-
-\newif\ifsynchronizefonts \synchronizefontstrue
-
-\prependtoks
- \ifsynchronizefonts
- \synchronizemath
- \synchronizetext
- \synchronizefont % problem: syncs last font
- \fi
-\to \everybodyfont
-
-%D Setting the normal sized as well as the x and xx smaller
-%D sizes is accomplished by the next set of macros. When in
-%D math mode, the commands \type{\tx} and \type{\txx} are
-%D just a switch to the script and double script styles, but
-%D in text mode the values defined by the bodyfontenvironment are
-%D used. Here we also set \type{\currentxfontsize}.
-
-\def\dosetcurrentfontxxxalternative#1#2#3#4%
- {\chardef\currentxfontsize#2\relax
- \ifmmode
- #4%
- \else\ifcsname\bodyfontvariable{\normalizedbodyfontsize#3}\endcsname
- \setcurrentfontbodyalternative{\bodyfontcsname\normalizedbodyfontsize#3\endcsname}{#1}%
- \fi\fi}
-
-\def\setcurrentfontxalternative#1%
- {\dosetcurrentfontxxxalternative{#1}1\c!x\scriptstyle
- \let\tx\txx}
-
-\def\setcurrentfontxxalternative#1%
- {\dosetcurrentfontxxxalternative{#1}2\c!xx\scriptscriptstyle
- \let\tx\empty
- \let\txx\empty}
-
-\def\checknestedxfontsize % option
- {\ifcase\currentxfontsize\else\ifx\fontsize\empty\else
- \chardef\currentxfontsize\zeropoint
- \let\fontsize\empty
- \let\tx\normaltx
- \let\txx\normaltxx
- \fi\fi}
-
-\def\setcurrentfontxalternative#1%
- {\checknestedxfontsize
- \dosetcurrentfontxxxalternative{#1}1\c!x\scriptstyle
- \let\tx\txx}
-
-\def\setcurrentfontxxalternative#1%
- {\checknestedxfontsize
- \dosetcurrentfontxxxalternative{#1}2\c!xx\scriptscriptstyle
- \let\tx\empty
- \let\txx\empty}
-
-% This alterative is not really needed, but for old time's sake
-% we keep it there. We can speed it up when needed.
-
-% \def\setcurrentfontxstylealternative #1{\csname#1\endcsname\tfx}
-% \def\setcurrentfontxxstylealternative#1{\csname#1\endcsname\tfxx}
-
-\def\setcurrentfontxstylealternative #1{\csname#1\endcsname\tx}
-\def\setcurrentfontxxstylealternative#1{\csname#1\endcsname\txx}
-
-%D These macros also show us that when we call for \type{\tx},
-%D this macro is redefined to be \type{\txx}. Therefore calls
-%D like:
-%D
-%D \startbuffer
-%D {small \tx is \tx beautiful}
-%D {small \tx is \txx beautiful}
-%D {small \txx is \tx beautiful}
-%D {small \txx is \txx beautiful}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D result in:
-%D
-%D \startvoorbeeld
-%D \startlines
-%D \getbuffer
-%D \stoplines
-%D \stopvoorbeeld
-%D
-%D Setting the main size involves the style list and therefore
-%D takes a bit more time. Keep in mind that the fontsize is
-%D represented by a character or empty.
-
-\unexpanded\def\tx {\setcurrentfontxalternative \fontalternative}
-\unexpanded\def\txx{\setcurrentfontxxalternative\fontalternative}
-
-\let\normaltx \tx
-\let\normaltxx\txx
-
-%D \macros
-%D {definefontstyle}
-%D
-%D When setting of switching the overall style we can use the
-%D short identifier like rm and ss, but when defined we can
-%D also use more verbose names like roman or sansserif. Such
-%D names are defined by:
-%D
-%D \starttyping
-%D \definefontstyle [serif,rm] [rm]
-%D \definefontstyle [sansserif,ss] [ss]
-%D \stoptyping
-
-\def\dodefinefontstyle[#1][#2]%
- {\rawdoifinsetelse{#2}{\fontstylelist}
- {}%\debuggerinfo\m!fonts{unknown style #2}}
- {\addtocommalist{#2}\fontstylelist
- \showmessage\m!fonts8{#2\space (#1)}}%
- % check kan hier
- \def\docommand##1%
- {\setvalue{\@shortstyle@##1}{#2}%
- \setvalue{\@style@##1}{\csname#2\endcsname}}%
- \processcommalist[#1]\docommand}
-
-\def\definefontstyle
- {\dodoubleargument\dodefinefontstyle}
-
-\def\setfontstyle#1#2% #1:name (roman, romaan) #2:style (rm)
- {\edef\fontstyle{#1}%
- \setcurrentfontstyle\normalizedbodyfontsize}
-
-\chardef\defaultskewcharmi=127 % '177
-\chardef\defaultskewcharsy= 48 % '60
-
-% \def\dosetskewchar#1%
-% {\skewchar\font\ifx\@@fontskewchar\empty#1\else\@@fontskewchar\fi}
-
-\def\dosetskewchar#1#2%
- {\ifx\@@fontskewchar\empty
- \skewchar\textfont #1#2%
- \skewchar\scriptfont #1#2%
- \skewchar\scriptscriptfont#1#2%
- \else
- \skewchar\textfont #1\@@fontskewchar
- \skewchar\scriptfont #1\@@fontskewchar
- \skewchar\scriptscriptfont#1\@@fontskewchar
- \fi}
-
-%D The previous macros show that it's is not always
-%D neccessary to define the whole bunch of fonts, take for
-%D instance the sequence:
-%D
-%D \starttyping
-%D \setupbodyfont
-%D [ams]
-%D
-%D \definebodyfont [24pt] [mm]
-%D [ma=msam10 at 24pt,
-%D mb=msbm10 at 24pt]
-%D
-%D \switchtobodyfont
-%D [24pt]
-%D
-%D This is a 24pt $\blacktriangleleft$
-%D \stoptyping
-%D
-%D Here we didn't define the 24 point bodyfont environment, so
-%D it's defined automatically. Of course one can always use the
-%D \TEX\ primitive \type{\font} to switch to whatever font
-%D needed.
-
-%D When asking for a complete font switch, for instance from 10
-%D to 12~points, the next macro does the job. First we
-%D normalize the size, next we define the current range of
-%D text, script and scriptscript sizes, then we set the text
-%D fonts and the math families and finally we activate the
-%D default typeface and also set the font specific parameters
-%D assigned to \type{\everybodyfont}
-
-\def\dosetbodyfontface#1#2%
- {\edef#1{\bodyfontcsname\normalizedbodyfontsize#2\endcsname}}
-
-\def\docompletefontswitch[#1]%
- {\bodyfontsize#1\relax
- \dimensiontocount\bodyfontsize\bodyfontpoints
- \edef\bodyfontfactor{\withoutpt\the\bodyfontsize}%
- \normalizebodyfontsize\bodyfontsize\to\normalizedbodyfontsize
- \dosetbodyfontface \textface \s!text
- \dosetbodyfontface \scriptface \s!script
- \dosetbodyfontface \scriptscriptface \s!scriptscript}
-
-\docompletefontswitch[12pt] % init
-
-%D \macros
-%D {setupbodyfont,switchtobodyfont}
-%D
-%D The next two macros are user ones. With \type{\setupbodyfont}
-%D one can set the document bodyfont size, font family, style
-%D and/or options defined in files, for example:
-%D
-%D \starttyping
-%D \setupbodyfont[cmr,ams,12pt,roman]
-%D \stoptyping
-%D
-%D This command affects the document as a whole: text, headers
-%D and footers. The second macro however affects only the text:
-%D
-%D \starttyping
-%D \switchtobodyfont[10pt]
-%D \stoptyping
-%D
-%D So we've got:
-%D
-%D \showsetup{setupbodyfont}
-%D \showsetup{switchtobodyfont}
-%D
-%D Both macros look alike. The second one also has to take
-%D all kind of keywords into account.
-
-\ifx\saveinterlinespace \undefined \let\saveinterlinespace \relax \fi
-\ifx\restoreinterlinespace\undefined \let\restoreinterlinespace\relax \fi
-
-\chardef\bodyfontsetstate=0
-
-\definecomplexorsimple\setupbodyfont
-
-\def\simplesetupbodyfont
- {\restoreglobalbodyfont
- \saveinterlinespace}
-
-\def\complexsetupbodyfont[#1]%
- {\doifsomething{#1}
- {\dosetfont1{#1}%
- \globalbodyfontsize\localbodyfontsize
- \normalizebodyfontsize\globalbodyfontsize\to\normalizedglobalbodyfontsize
- \let\globalfontstyle\fontstyle
- \ifloadingfonts\else
- \the\everybodyfont
- \the\everyglobalbodyfont
- \saveinterlinespace
- \fi}}
-
-\unexpanded\def\switchtobodyfont[#1]%
- {\doifsomething{#1}
- {\doifdefinedelse{\??ft\normalizedbodyfontsize\interfaced{#1}}
- {\setbodyfontstep{#1}} % so we have a fast [small] switch
- {\dosetfont0{#1}}%
- \the\everybodyfont}} % indeed needed in case nothing is executed
-
-%D The following alternative is meant for math||to||text
-%D switching and will be optimized.
-
-\def\fastswitchtobodyfont#1%
- {\ifcsname\??ft\normalizedbodyfontsize#1\endcsname
- \edef\futurebodyfontsize
- {\csname\??ft\normalizedbodyfontsize#1\endcsname}%
- \ifcsname\@size@\futurebodyfontsize\endcsname
- \csname\@size@\futurebodyfontsize\endcsname
- \localbodyfontsize\futurebodyfontsize\relax
- \fi
- \fi
- \csname\@style@\fontstyle\endcsname
- \the\everybodyfont}
-
-%D Because the last macro can appear in arguments or be assigned
-%D to parameters, we protect this one for unwanted expansion.
-
-\def\dodosetmathfont#1%
- {\setcurrentfontalternative{#1}%
- % \doifdefinedelse{#1\s!fam} % adapted
- % {\edef\mffam{\getvalue{#1\s!fam}}}
- % {\edef\mffam{\getvalue{\c!nn\s!fam}}}%
- \textfont \mrfam\textfont \mffam
- \scriptfont \mrfam\scriptfont \mffam
- \scriptscriptfont\mrfam\scriptscriptfont\mffam}
-
-\def\domffam#1%
- {\csname\ifcsname#1\s!fam\endcsname#1\else\c!nn\fi\s!fam\endcsname}
-
-\def\mffam
- {\domffam\fontalternative}
-
-\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 \starttyping
-%D $\cases{& \ccaron}$ $x=\hbox{\ccaron $x=\hbox{\ccaron}$}$
-%D \stoptyping
-
-%D The font specific features are bound to the filename.
-
-\def\updatefontparameters
- {\edef\@@fontencoding{\truefontdata\fontfile \s!encoding}%
- \edef\@@fontmapping {\truefontdata\fontfile \s!mapping }%
- \edef\@@fonthandling{\truefontdata\somefontname\s!handling}%
- \edef\@@fontskewchar{\truefontdata\fontfile \s!skewchar}}
-
-\def\setfontcharacteristics
- {\updatefontparameters % redundant, will go away, faster too
- \fastenableencoding
- {\ifx\@@fontencoding\empty
- \s!default \else \@@fontencoding
- \fi}%
- \fastenablemapping
- {\ifx\@@fontmapping\empty
- \ifx\@@fontencoding\empty
- \s!default \else \@@fontencoding
- \fi
- \else
- \@@fontmapping
- \fi}%
- \fastenablehandling
- {\ifx\@@fonthandling\empty
- \s!default \else \@@fonthandling
- \fi}%
- {\lastfontidentifier}%
- \the\everyfont
- \synchronizepatternswithfont}
-
-\ifx\synchronizepatternswithfont\undefined
- \def\synchronizepatternswithfont{\synchronizepatterns}
-\fi
-
-%D Experimental: (should move to font-xtx)
-
-\ifdefined \definefontfeature \else
-
- \def\definefontfeature {\dotripleargument\dodefinefontfeature}
- \def\dodefinefontfeature[#1][#2][#3]{}
-
-\fi
-
-%D The next auxilliary macro is an alternative to \type
-%D {\fontname}.
-
-% \def\purefontname#1{\expandafter\splitoffpurefontname\fontname#1 \\}
-%
-% extra level is needed:
-
-\def\purefontname#1{\@EA\splitoffpurefontname\@EA{\@EA{\@EA\unstringed\fontname#1}} \\}
-
-\def\splitoffpurefontname#1 #2\\{#1}
-
-%D \macros
-%D {switchstyleonly}
-%D
-%D For switching a style but keeping the alternative, there
-%D is:
-%D
-%D \starttyping
-%D {\bf text \switchstyleonly\ss text}
-%D {\bf text \switchstyleonly[ss]text}
-%D {\sl text \switchstyleonly[sansserif]text}
-%D \stoptyping
-
-\definecomplexorsimple\switchstyleonly
-
-\def\simpleswitchstyleonly#1% stupid version
- {\complexswitchstyleonly[\strippedcsname#1]}
-
-\def\complexswitchstyleonly[#1]% todo : check
- {\setcurrentfontstyle{\getvalue{\@shortstyle@#1}}%
- \the\everybodyfont} % needed ?
-
-%D \macros
-%D {os,frak, goth, cal}
-%D
-%D Old style numerals can be typeset with \type{\os} and look
-%D like {\os 1234567890} instead of the more common looking
-%D 1234567890.
-%D
-%D On behalf of {\frac Tobias Burnus}, we define some more of
-%D these. Later we will link these names to real file names.
-
-% older
-%
-% \definefont [os] [OldStyle sa *]
-% \definefont [frak] [Fraktur sa *]
-% \definefont [goth] [Gothic sa *]
-% \definefont [cal] [Calligraphic sa *]
-% \definefont [bbd] [Blackboard sa *]
-%
-% newer
-
-\unexpanded\def\os {\mathortext{\fam\purefamily {oldstyle}}{\symbolicfont {OldStyle}}}
-\unexpanded\def\frak{\mathortext{\fam\purefamily {fraktur}}{\symbolicfont {Fraktur}}}
-\unexpanded\def\goth{\mathortext{\fam\purefamily {gothic}}{\symbolicfont {Gothic}}}
-\unexpanded\def\cal {\mathortext{\fam\purefamily{calligraphic}}{\symbolicfont{Calligraphic}}}
-\unexpanded\def\bbd {\mathortext{\fam\purefamily {blackboard}}{\symbolicfont {Blackboard}}}
-
-\definefontsynonym [OldStyle] [Serif]
-\definefontsynonym [Fraktur] [Serif]
-\definefontsynonym [Gothic] [Serif]
-\definefontsynonym [Calligraphic] [Serif]
-\definefontsynonym [Blackboard] [Serif]
-
-%D \macros
-%D {fraktur, gothic, calligraphic, blackboard}
-%D
-%D These macros assume that we use text fonts, and not math
-%D families.
-
-\ifx\mathtext\undefined \let\mathtext\hbox \fi
-
-\unexpanded\def\fraktur #1{\mathortext\domathtext\donothing{\frak#1}}
-\unexpanded\def\gothic #1{\mathortext\domathtext\donothing{\goth#1}}
-\unexpanded\def\calligraphic#1{\mathortext\domathtext\donothing{\cal #1}}
-\unexpanded\def\blackboard #1{\mathortext\domathtext\donothing{\bbd#1}}
-
-%D Torture test:
-%D
-%D \starttyping
-%D \usetypescript[modern] [texnansi]
-%D \usetypescript[lucida] [texnansi]
-%D \usetypescript[palatino][texnansi]
-%D \usetypescript[times] [texnansi]
-%D \usetypescript[fourier] [ec]
-%D
-%D \startbuffer
-%D \section{\blackboard{T\high{\blackboard{T}}} \blackboard{E}\high{\blackboard{E}} \blackboard{X}\high{\blackboard{X}}}
-%D
-%D {\fontclass: 123 \os123 \cal TEX $\os 123$}
-%D
-%D $\blackboard{T}^{\blackboard{T}} \blackboard{E}^{\blackboard{E}} \blackboard{X}^{\blackboard{X}}$
-%D \blackboard{T}\high{\blackboard{T}} \blackboard{E}\high{\blackboard{E}} \blackboard{X}\high{\blackboard{X}}
-%D \stopbuffer
-%D
-%D {\setupbodyfont[lucida] \getbuffer}
-%D {\setupbodyfont[modern] \getbuffer}
-%D {\setupbodyfont[palatino] \getbuffer}
-%D {\setupbodyfont[times] \getbuffer}
-%D {\setupbodyfont[fourier] \getbuffer}
-%D \stoptyping
-
-%D \macros
-%D {definebodyfontswitch}
-%D
-%D \PLAIN\ \TEX\ defines some macro's like \type{\tenpoint}
-%D to switch to a specific bodyfontsize. Just for the sake of
-%D compatibility we can define them like:
-%D
-%D \starttyping
-%D \definebodyfontswitch [twelvepoint] [12pt]
-%D \stoptyping
-%D
-%D We don't support language specific synonyms here, mainly
-%D because \PLAIN\ \TEX\ is english anyway.
-
-\def\dodefinebodyfontswitch[#1][#2]%
- {\def\docommand##1{\setvalue{##1}{\switchtobodyfont[#2]}}%
- \processcommalist[#1]\docommand}
-
-\def\definebodyfontswitch
- {\dodoubleargument\dodefinebodyfontswitch}
-
-%D \macros
-%D {setsmallbodyfont,setmainbodyfont,setbigbodyfont}
-%D
-%D When we're typesetting at for instance 10pt, we can call for
-%D the \type{small} as well as the \type{big} alternative,
-%D related to this main size, using \type{\switchtobodyfont[small]}.
-%D The three alternatives can be activated by the next three
-%D system calls and are defined by the bodyfontenvironment.
-
-\let\fontstep\empty % we can use \fontstep for tracing purposes
-
-\def\setbodyfontstep#1%
- {\edef\fontstep{\bodyfontcsname\normalizedbodyfontsize\interfaced{#1}\endcsname}%
- \doswitchpoints[\fontstep]%
- \doswitchstyle[\fontstyle]}
-
-\unexpanded\def\setsmallbodyfont{\setbodyfontstep\v!small\the\everybodyfont}
-\unexpanded\def\setbigbodyfont {\setbodyfontstep\v!big \the\everybodyfont}
-
-\unexpanded\def\setmainbodyfont
- {\doswitchpoints[\normalizedbodyfontsize]%
- \doswitchstyle[\fontstyle]%
- \the\everybodyfont
- \the\everyglobalbodyfont
- \saveinterlinespace}
-
-%D \macros
-%D {restoreglobalbodyfont}
-%D
-%D Users can set whatever font available while typesetting text.
-%D Pagenumbers, footers, headers etc. however must be typeset
-%D in the main bodyfont and style of the document. Returning to
-%D the global state can be done with the next macro:
-
-\let\mainfontclass\empty
-
-\def\fullrestoreglobalbodyfont
- {\let\fontsize\defaultfontsize
- \let\fontbody\defaultfontbody
- \chardef\currentxfontsize\zerocount
- \let\fontclass\globalfontclass
- \doswitchpoints[\normalizedglobalbodyfontsize]%
- \doswitchstyle[\globalfontstyle]%
- \redoconvertfont % just in case a pagebreak occurs
- \tf
- \the\everybodyfont
- \the\everyglobalbodyfont
- \saveinterlinespace}
-
-\def\partialrestoreglobalbodyfont
- {\let\fontsize\defaultfontsize
- \let\fontbody\defaultfontbody
- \chardef\currentxfontsize\zerocount
- \redoconvertfont
- \tf
- \saveinterlinespace}
-
-\def\restoreglobalbodyfont % ook style etc
- {\ifx\fontclass\globalfontclass
- \ifx\fontstyle\globalfontstyle
- \ifx\normalizedbodyfontsize\normalizedglobalbodyfontsize
- \partialrestoreglobalbodyfont
- \else
- \fullrestoreglobalbodyfont
- \fi
- \else
- \fullrestoreglobalbodyfont
- \fi
- \else
- \fullrestoreglobalbodyfont
- \fi}
-
-% in case of troubles: \let\restorebodyfont\fullrestoreglobalbodyfont
-
-%D This macro has to be called when entering the pagebody
-%D handling routine as well as the footnote insert routine.
-%D Users can access this feature |<|for instance when one wants
-%D to typeset tables and alike in the main bodyfont and style
-%D while the running text is temporary set to a smaller one|>|
-%D by saying \type{\switchtobodyfont[global]}.
-
-%D \macros
-%D {rasterfont}
-%D
-%D There are (at the moment) two situations in which we want to
-%D have fast access to a particular font. When we are using
-%D \TEX\ to typeset rasters, we use small {\rasterfont.}'s
-%D (a rather small period indeed), the same as \PICTEX\ uses
-%D for drawing purposes.
-
-\definefont [rasterfont] [Serif at 5pt]
-
-%D \macros
-%D {infofont}
-%D
-%D The second situation occurs when we enable the info mode,
-%D and put all kind of status information in the margin. We
-%D don't want huge switches to the main bodyfont and style, so
-%D here too we use a direct method.
-
-% old mechanism
-%
-% \def\infofont{\getvalue{\!!sixpoint\c!tt\c!tf}\the\everybodyfont}
-
-\let\infofont\relax % satisfy dep checker
-
-\definefont [infofont] [Mono at 6pt] % todo \the\everybodyfont
-
-%D \macros
-%D {definealternativestyle}
-%D
-%D In the main modules we are going to implement lots of
-%D parameterized commands and one of these parameters will
-%D concern the font to use. To suit consistent use of fonts we
-%D here implement a mechanism for defining the keywords that
-%D present a particular style or alternative.
-%D
-%D \starttyping
-%D \definealternativestyle [keywords] [\style] [\nostyle]
-%D \stoptyping
-%D
-%D The first command is used in the normal textflow, while the
-%D second command takes care of headings and alike. Consider
-%D the next two definitions:
-%D
-%D \starttyping
-%D \definealternativestyle [bold] [\bf] []
-%D \definealternativestyle [cap] [\cap] [\cap]
-%D \stoptyping
-%D
-%D A change \type{\bf} in a heading which is to be set in
-%D \type{\tfd} does not look that well, so therefore we leave
-%D the second argument of \type{\definealternativestyle} empty.
-%D When we capatalize characters using the pseudo small cap
-%D command \type{\cap}, we want this to take effect in both
-%D text and headings, which is accomplished by assigning both
-%D arguments.
-
-\def\dodefinealternativestyle[#1][#2][#3]%
- {\def\docommand##1%
- {\doifundefined{##1}{\setvalue{##1}{\groupedcommand{#2}{}}}%
- \setvalue{\@letter@ ##1}{#2}%
- \setvalue{\@noletter@##1}{#3}}%
- \processcommalist[#1]\docommand}
-
-\def\definealternativestyle
- {\dotripleempty\dodefinealternativestyle}
-
-\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:
-%D
-%D \startbuffer
-%D He's a \bold{bold} man with a {\bold head}.
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D or
-%D
-%D \startvoorbeeld
-%D \definealternativestyle[bold][\bf][]\getbuffer
-%D \stopvoorbeeld
-%D
-%D Such definitions are of course unwanted for \type{\cap}
-%D because this would result in an endless recursive call.
-%D Therefore we check on the existance of both the command and
-%D the substitution. The latter is needed because for instance
-%D \type{\type} is an entirely diferent command. That command
-%D handles verbatim, while the style command would just switch
-%D to teletype font. This is just an example of a tricky
-%D naming coincidence.
-
-%D \macros
-%D {doconvertfont,noconvertfont,
-%D dontconvertfont,redoconvertfont}
-%D
-%D After having defined such keywords, we can call for them by
-%D using
-%D
-%D \starttyping
-%D \doconvertfont{keyword}{text}
-%D \stoptyping
-%D
-%D We deliberately pass an argument. This enables us to
-%D assign converters that handle one agrument, like
-%D \type{\cap}.
-%D
-%D By default the first specification is used to set the style,
-%D exept when we say \type{\dontconvertfont}, after which the
-%D second specification is used. We can also directly call for
-%D \type{\noconvertfont}. In nested calls, we can restore the
-%D conversion by saying \type{\redoconvertfont}.
-
-\def\@@dodoconvertfont#1{\csname\@letter@ #1\endcsname}
-\def\@@donoconvertfont#1{\csname\@noletter@#1\endcsname}
-
-\unexpanded\def\dodoconvertfont#1% #2% we need the protection
- {\doifdefinedelse{\@letter@#1} % in testing
- {\doifelsenothing{#1}\gobbleoneargument\@@dodoconvertfont}
- {\doifdefinedelse{#1}\getvalue \firstofoneargument}%
- {#1}} % {#2}}
-
-\let\doconvertfont\dodoconvertfont
-
-\def\noconvertfont#1% #2%
- {\doifdefinedelse{\@noletter@#1}
- {\doifelsenothing{#1}\gobbleoneargument\@@donoconvertfont}\gobbleoneargument
- {#1}} % {#2}}
-
-%D Extras:
-
-\unexpanded\def\dontconvertfont
- {\let\doconvertfont\noconvertfont}
-
-\unexpanded\def\redoconvertfont
- {\let\doconvertfont\dodoconvertfont}
-
-%D These commands are not grouped! Grouping is most probably
-%D done by the calling macro's and would lead to unnecessary
-%D overhead.
-
-%D \macros
-%D {em,emphasistypeface,emphasisboldface}
-%D
-%D The next macro started as a copy of Donald Arseneau's
-%D \type{\em} (\TUGNEWS\ Vol.~3, no.~1, 1994). His
-%D implementation was a bit more sophisticated version of the
-%D standard \LATEX\ one. We furter enhanced the macro, so now
-%D it also adapts itself to boldface mode. Because we favor
-%D {\sl slanted} type over {\it italic}, we made the emphasis
-%D adaptable, for instance:
-%D
-%D \starttyping
-%D \def\emphasistypeface {\it}
-%D \def\emphasisboldface {\bi}
-%D \stoptyping
-%D
-%D But we prefer:
-
-\def\emphasistypeface {\sl}
-\def\emphasisboldface {\bs}
-
-%D or even better:
-
-% \def\doemphasistypeface#1#2%
-% {\doifelsevalue{\??ft\fontclass\normalizedbodyfontsize\c!em}\v!slanted#1%
-% {\doifelsevalue{\??ft\fontclass\normalizedbodyfontsize\c!em}\v!italic #2%
-% {\doifelsevalue{\??ft \normalizedbodyfontsize\c!em}\v!slanted#1%
-% {\doifvalue {\??ft \normalizedbodyfontsize\c!em}\v!italic #2}}}}
-
-\def\doemphasistypeface#1#2%
- {\doifelsevalue{\??ft\fontclass\normalizedbodyfontsize\c!em}\v!slanted
- {#1}%
- {\doifelsevalue{\??ft\fontclass\normalizedbodyfontsize\c!em}\v!italic
- {#2}%
- {\doifelsevaluenothing{\??ft\fontclass\normalizedbodyfontsize\c!em}
- {\doifelsevalue{\??ft\normalizedbodyfontsize\c!em}\v!slanted
- {#1}%
- {\doifelsevalue{\??ft\normalizedbodyfontsize\c!em}\v!italic
- {#2}%
- {\getvalue{\??ft\normalizedbodyfontsize\c!em}}}}
- {\getvalue{\??ft\fontclass\normalizedbodyfontsize\c!em}}}}}
-
-\def\emphasistypeface{\doemphasistypeface\sl\it}
-\def\emphasisboldface{\doemphasistypeface\bs\bi}
-
-%D To be set with the default body font environment: \type
-%D {em} being \type {slanted} or \type {italic}.
-
-\newconditional\emneeded
-
-\newtoks\everyemphasized
-
-\unexpanded\def\em
- {\relax
- \ifdim\slantperpoint>\zeropoint
- \settrue\emneeded
- \else
- \setfalse\emneeded
- \fi
- \setemphasisboldface % new
- \ifx\fontalternative\c!it % \ifnum\fam=\itfam
- \def\emphasistypeface{\it}\tf
- \else\ifx\fontalternative\c!sl % \ifnum\fam=\slfam
- \def\emphasistypeface{\sl}\tf
- \else\ifx\fontalternative\c!bf % \ifnum\fam=\bffam
- \emphasisboldface
- \else\ifx\fontalternative\c!bs % \ifnum\fam=\bsfam
- \def\emphasisboldface{\bs}\bf
- \else\ifx\fontalternative\c!bi % \ifnum\fam=\bifam
- \def\emphasisboldface{\bi}\bf
- \else
- \emphasistypeface
- \fi\fi\fi\fi\fi
- \the\everyemphasized
- \ifconditional\emneeded\relax
- \else
- \expandafter\aftergroup
- \fi
- \emphasiscorrection}
-
-% compare ...
-%
-% \appendtoks \red \to \everyemphasized
-% \setupbodyfontenvironment [default] [em={\italic\color[red]}]
-
-%D The next feature was not present in previous versions. It
-%D takes care of \type {\em \bf ...} sitiations.
-
-\def\setemphasisboldface
- {\let\normalbf\bf
- \let\setemphasisboldface\relax
- \unexpanded\def\bf
- {%\relax
- \let\bf\relax % new
- \ifx\fontalternative\c!it % \ifnum\fam=\itfam
- \bi
- \else\ifx\fontalternative\c!sl % \ifnum\fam=\slfam
- \bs
- \else
- \normalbf
- \fi\fi
- \let\bf\normalbf}}
-
-%D Donald's (adapted) macros take the next character into
-%D account when placing italic correction. As a bonus we also
-%D look for something that looks like a dash, in which case we
-%D don't correct.
-
-\let\italiccorrection=\/
-
-\def\emphasiscorrection
- {\ifhmode
- \expandafter\emphasislook
- \fi}
-
-\def\emphasislook
- {\begingroup
- \beginrobusttest
- \futurelet\next\emphasistest}
-
-\def\emphasistest
- {\normalifcat\noexpand\next,%
- \endrobusttest\expandafter\doemphasiscorrection
- \normalelse
- \endrobusttest\expandafter\dododoemphasiscorrection
- \normalfi}
-
-\def\doemphasiscorrection
- {\futurelet\next\dodoemphasiscorrection}
-
-\def\dodoemphasiscorrection
- {\setbox\scratchbox\hbox{\next}%
- \ifdim\ht\scratchbox=\zeropoint % probably a space
- \expandafter\dododoemphasiscorrection
- \else\ifdim\ht\scratchbox<.3ex
- \expandafter\expandafter\expandafter\endgroup
- \else
- \expandafter\expandafter\expandafter\dododoemphasiscorrection
- \fi\fi}
-
-\def\dododoemphasiscorrection
- {\scratchskip\lastskip
- \ifdim\scratchskip=\zeropoint\relax % == \ifzeropt\scratchskip
- \italiccorrection\relax
- \else
- \unskip\italiccorrection\hskip\scratchskip
- \fi
- \endgroup}
-
-%D We end with some examples which show the behavior when
-%D some punctuation is met. We also show how the mechanism
-%D adapts itself to bold, italic and slanted typing.
-%D
-%D \startbuffer
-%D test {test}test \par
-%D test {\sl test}test \par
-%D test {\em test}test \par
-%D test {\em test}--test \par
-%D
-%D test {test}, test \par
-%D test {\em test}, test \par
-%D
-%D test {\em test {\em test {\em test} test} test} test \par
-%D test {\bf test {\em test {\em test} test} test} test \par
-%D test {\sl test {\em test {\em test} test} test} test \par
-%D test {\it test {\em test {\em test} test} test} test \par
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D We get:
-%D
-%D \startvoorbeeld
-%D \startpacked
-%D \getbuffer
-%D \stoppacked
-%D \stopvoorbeeld
-
-%D \macros
-%D {emphbf,emphit,emphsl,emphtf}
-%D
-%D The next emphasis alternatives are for \THANH. They adapt
-%D their style as good as possible.
-
-\def\emphbf{\groupedcommand{\bf\def\emphit{\bi}\def\emphsl{\bs}}{}}
-\def\emphit{\groupedcommand{\it\def\emphbf{\bi}\def\emphsl{\sl}}{}}
-\def\emphsl{\groupedcommand{\sl\def\emphbf{\bs}\def\emphit{\it}}{}}
-\def\emphtf{\groupedcommand{\tf\def\emphbf{\bf}\def\emphit{\it}\def\emphsl{\sl}}{}}
-
-%D \startbuffer
-%D TEXT {\emphbf text \emphit text \emphtf text \emphsl text} TEXT
-%D TEXT \emphbf{text \emphit{text} \emphtf{text} \emphsl{text}} TEXT
-%D \stopbuffer
-%D
-%D \typebuffer
-%D \startlines
-%D \getbuffer
-%D \stoplines
-
-%D \macros
-%D {setfont}
-%D
-%D Every now and then we want to define a font directly, for
-%D instance when we typeset title pages. The next macro saves
-%D some typing:
-
-\def\setfont% geen \dosetfont mogelijk
- {\def\next{\nextfont\setupinterlinespace}%
- \afterassignment\next\font\nextfont=}
-
-%D One can call this macro as:
-%D
-%D \starttyping
-%D \setfont cmr10 at 60pt
-%D \stoptyping
-%D
-%D After which the font is active and the baselines and
-%D struts are set.
-
-%D \macros
-%D {showbodyfont}
-%D
-%D One can call for a rather simple overview of a bodyfont and the
-%D relations between its alternative fonts.
-%D
-%D \showsetup{showbodyfont}
-%D
-%D The current bodyfont (here we omitted the argument) looks like:
-%D
-%D \showbodyfont
-%D
-%D The implementation is rather straightforward in using
-%D \type{\halign}.
-
-\fetchruntimecommand \showbodyfont {\f!fontprefix\s!run}
-
-%D \macros
-%D {showfontstrip, testminimalbaseline, showminimalbaseline}
-%D
-%D The next command can come in handy when combining
-%D different fonts into a collection (typeface) and
-%D determining optimal baseline distances.
-%D
-%D \showfontstrip \blank \showminimalbaseline
-
-\fetchruntimecommand \showfontstrip {\f!fontprefix\s!run}
-\fetchruntimecommand \testminimalbaseline {\f!fontprefix\s!run}
-\fetchruntimecommand \showminimalbaseline {\f!fontprefix\s!run}
-
-%D \macros
-%D {showkerning}
-%D
-%D A goody is:
-%D
-%D \showkerning{Can you guess what kerning is?}
-
-\fetchruntimecommand \showkerning {\f!fontprefix\s!run}
-
-%D \macros
-%D {showbodyfontenvironment}
-%D
-%D The current bodyfontenvironment is:
-%D
-%D \showbodyfontenvironment
-%D
-%D This overview is generated using:
-%D
-%D \showsetup{showbodyfontenvironment}
-
-\fetchruntimecommand \showbodyfontenvironment {\f!fontprefix\s!run}
-
-%D \macros
-%D {showfont,showfontstyle,showligatures}
-%D
-%D The following command generates a fontmap:
-%D
-%D \startbuffer
-%D \showfont[SansBold at 12pt]
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D Below the table the name, encoding, mapping and handling are
-%D shown. Special characters like the \type {\skewchar} and
-%D \type {\hyphenchar} als marked.
-%D
-%D \getbuffer
-
-% to be internationalized
-
-\fetchruntimecommand \showfont {\f!fontprefix\s!run}
-\fetchruntimecommand \showfontstyle {\f!fontprefix\s!run}
-\fetchruntimecommand \showligature {\f!fontprefix\s!run}
-\fetchruntimecommand \showligatures {\f!fontprefix\s!run}
-\fetchruntimecommand \showcharratio {\f!fontprefix\s!run}
-
-%D \macros
-%D {getglyph, symbolicfont}
-%D
-%D Individual glyphs can be accessed by using
-%D
-%D \starttyping
-%D \getglyph{fontname}{character}
-%D \stoptyping
-%D
-%D This macro is used in for instance the symbol modules and
-%D as one can see, it does obey the small and even smaller
-%D sizes. The \type {\symbolicfont} macro can be used to
-%D switch to a font named \type {fontname} (see \type
-%D {cont-log} and \type {symb-eur} for examples of symbolic
-%D definitions.
-
-\def\fontstringA
- {\ifx\fontstyle\c!rm \s!Serif \else
- \ifx\fontstyle\c!ss \s!Sans \else
- \ifx\fontstyle\c!tt \s!Mono \else
- \s!Serif \fi\fi\fi}
-
-\def\fontstringB
- {\ifx\fontstyle\c!rm \s!Regular \else
- \ifx\fontstyle\c!ss \s!Support \else
- \ifx\fontstyle\c!tt \s!Type \else
- \s!Serif \fi\fi\fi}
-
-\def\fontstringC
- {\ifx\fontalternative\c!bf \s!Bold \else
- \ifx\fontalternative\c!sl \s!Slanted \else
- \ifx\fontalternative\c!it \s!Italic \else
- \ifx\fontalternative\c!bs \s!BoldSlanted \else
- \ifx\fontalternative\c!bi \s!BoldItalic \fi\fi\fi\fi\fi}
-
-\def\fontstringD % default fontstyle
- {\expandafter\ifx\csname\??tf\fontclass\s!default\endcsname\c!rm \s!Serif \else
- \expandafter\ifx\csname\??tf\fontclass\s!default\endcsname\c!ss \s!Sans \else
- \expandafter\ifx\csname\??tf\fontclass\s!default\endcsname\c!tt \s!Mono \else
- \s!Serif \fi\fi\fi}
-
-% potential generalization:
-
-% \letvalue{\??ff:t:\c!rm}\s!Serif
-% \letvalue{\??ff:t:\c!ss}\s!Sans
-% \letvalue{\??ff:t:\c!tt}\s!Mono
-%
-% \letvalue{\??ff:s:\c!bf}\s!Bold
-% \letvalue{\??ff:s:\c!sl}\s!Slanted
-% \letvalue{\??ff:s:\c!it}\s!Italic
-% \letvalue{\??ff:s:\c!bs}\s!BoldSlanted
-% \letvalue{\??ff:s:\c!bi}\s!BoldItalic
-%
-% \letvalue{\??ff:a:\c!rm}\s!Regular
-% \letvalue{\??ff:a:\c!ss}\s!Support
-% \letvalue{\??ff:a:\c!tt}\s!Type
-%
-% \def\fontstringA{\executeifdefined{\??ff:t:\fontstyle}\s!Serif}
-% \def\fontstringB{\executeifdefined{\??ff:a:\fontstyle}\s!Serif}
-% \def\fontstringC{\executeifdefined{\??ff:s:\fontstyle}\empty}
-% \def\fontstringD{\executeifdefined{\??ff:t:\csname\??tf\fontclass\s!default\endcsname}\s!Serif}
-
-\def\glyphfontfile#1%
- {#1%
- \ifcsname\??ff#1\fontstringA\fontstringC\endcsname
- \fontstringA\fontstringC
- \else\ifcsname\??ff#1\fontstringB\fontstringC\endcsname
- \fontstringB\fontstringC
- \else\ifcsname\??ff#1\fontstringA\endcsname
- \fontstringA
- \else\ifcsname\??ff#1\fontstringB\endcsname
- \fontstringB
- \else\ifcsname\??ff#1\fontstringC\endcsname
- \fontstringC
- \fi\fi\fi\fi\fi}
-
-%D The next macro can be used to make decisions based on the shape:
-
-\def\doifitalicelse#1#2%
- {\ifx\fontalternative\c!sl#1\else
- \ifx\fontalternative\c!it#1\else
- \ifx\fontalternative\c!bs#1\else
- \ifx\fontalternative\c!bi#1\else#2\fi\fi\fi\fi}
-
-%D For an example of usage of the following command,
-%D see \type {cont-log.tex}.
-%D
-%D \starttyping
-%D \def\symbolicfont#1%
-%D {\definedfont[\glyphfontfile{#1} sa *]}
-%D \stoptyping
-%D
-%D Since we know what scaling it to be applied, we can
-%D implement a much faster alternative:
-
-\let\thedefinedfont\relax
-
-% \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
- {\symbolicsizedfont\fontbody\plusone}
-
-\unexpanded\def\getglyph#1#2% slow, faster, much faster
- %{{\definefont[\s!dummy][\glyphfontfile{#1} sa \currentfontscale]\dummy#2}}
- %{{\definefont[\s!dummy][\glyphfontfile{#1} sa *]\dummy#2}}
- %{{\symbolicfont{#1}#2}}
- {{\symbolicfont{#1}\doifnumberelse{#2}\char\donothing#2}}
-
-\unexpanded\def\getscaledglyph#1#2#3%
- {{\symbolicscaledfont{#1}{#2}\doifnumberelse{#3}\char\donothing#3}}
-
-\unexpanded\def\getrawglyph#1#2% for simple symbols
- {{\scaledfont\fontbody
- \font\thedefinedfont=#1 at \currentfontbodyscale\scaledfont
- \thedefinedfont\doifnumberelse{#2}\char\donothing#2}}
-
-%D The last implementation of \type {\getglyph} permits
-%D definitions like:
-%D
-%D \starttyping
-%D \definefontsynonym [EuroSans] [eurose]
-%D \definefontsynonym [EuroSansBold] [euroseb]
-%D \definefontsynonym [EuroSansItalic] [eurosei]
-%D \definefontsynonym [EuroSansSlanted] [eurosei]
-%D \definefontsynonym [EuroSansBoldItalic] [eurosebi]
-%D \definefontsynonym [EuroSansBoldSlanted] [eurosebi]
-%D
-%D \definesymbol [euro] [\getglyph{Euro}{\char160}]
-%D
-%D \def\euro{\symbol[euro]}
-%D \stoptyping
-%D
-%D These definitions guarantee that the next calls work okay:
-%D
-%D \starttyping
-%D \ss \tf\euro \bf\euro \sla\euro \itd\euro \bs\euro \bic\euro
-%D \stoptyping
-%D
-%D The shape as well as the size is adapted to the current
-%D environment.
-
-%D Fonts can only be used when loaded. In \CONTEXT\ we
-%D postpone the loading of fonts, even when we load \PLAIN.
-%D This means that we have to redefine one of the \PLAIN\
-%D macros. Let's tell that to the user first:
-
-\writestatus{loading}{Postponed Plain TeX Font Definitions}
-
-%D \macros
-%D {bordermatrix}
-%D
-%D In \PLAIN\ \TEX\ the width of a parenthesis is stored in
-%D the \DIMENSION\ \type{\mathparentwd}. This value is derived from
-%D the width of \type{\tenrm B}, so let's take care of it now:
-
-\let\normalbordermatrix=\bordermatrix
-
-\def\bordermatrix%
- {\bgroup
- \setbox0\hbox{\getvalue{\textface\c!mm\c!ex}B}%
- \global\mathparentwd\wd0\relax
- \egroup
- \normalbordermatrix}
-
-%D Because we want to be as \PLAIN\ compatible as possible, we
-%D make most of \PLAIN's font mechanisme available to the
-%D \CONTEXT\ user.
-
-\def\setplainfonts#1#2%
- {\setvalue {ten#1}{\getvalue{\!!tenpoint #2}}%
- \setvalue{seven#1}{\getvalue{\!!sevenpoint#2}}%
- \setvalue {five#1}{\getvalue{\!!fivepoint #2}}}
-
-\setplainfonts {\c!rm} {\c!rm\c!tf}
-\setplainfonts {\c!bf} {\c!rm\c!bf}
-\setplainfonts {\c!sl} {\c!rm\c!sl}
-\setplainfonts {\c!it} {\c!rm\c!it}
-\setplainfonts {\c!tt} {\c!rm\c!tt}
-\setplainfonts {\c!sy} {\c!mm\c!sy}
-\setplainfonts {\c!ex} {\c!mm\c!ex}
-\setplainfonts {\c!i} {\c!mm\c!mi}
-
-\let\setplainfonts=\undefined
-
-%D \macros
-%D {ss, SS, sz}
-%D
-%D We are going to redefine \type{\ss} but for those wo still
-%D want to have access to the german \SS, we save it's value in
-%D \type{\SS}. Ok, I should have used \type{\sf} instead of
-%D \type{\ss} in the first place.
-
-\ifx\undefined\SS \let\SS=\ss \fi
-\ifx\undefined\sz \let\sz=\ss \fi
-
-%D \macros
-%D {xi}
-%D
-%D We are going to redefine \type{\xi}, but fortunately this
-%D is a math mode character, so we can just say:
-
-\let\normalxi=\xi
-
-%D \macros
-%D {smashaccent}
-%D
-%D When we let \TEX\ put an accent on top of a character, such
-%D composed characters can get more height that height of a
-%D standard \type{\strut}. The next macro takes care of such
-%D unwanted compositions.
-%D
-%D We need to reach over the number that specifies the accent,
-%D and in doing so we use \type{\scratchcounter} as a placeholder
-%D because it accepts 8 bit numbers in octal, decimal or
-%D hexadecimal format. Next we set the height of the accented
-%D character to the natural height of the character.
-
-\unexpanded\def\smashaccent#1%
- {\dontleavehmode
- \bgroup
- \setbox\scratchbox\hbox{#1}%
- \ifdim\ht\scratchbox>\strutheight\relax\ht\scratchbox\strutheight\fi
- \ifdim\dp\scratchbox>\strutdepth \relax\dp\scratchbox\strutdepth \fi
- \box\scratchbox
- \egroup}
-
-%D For instance we can say:
-%D
-%D \starttyping
-%D \smashaccent{\"Uberhaupt}
-%D \stoptyping
-%D
-%D But normally one will use it as a prefix in definitions.
-%D The difference is in the height:
-%D
-%D \leavevmode\ruledhbox
-%D {\ruledhbox{\smashaccent{\"U}berhaupt}\quad
-%D oder\quad
-%D \ruledhbox{\"Uberhaupt}}
-
-%D \macros
-%D {moveaccent}
-%D
-%D Exact positioning of accents can be realized by saying:
-%D
-%D \starttyping
-%D \moveaccent{-.1ex}{\"u}berhaupt
-%D \stoptyping
-%D
-%D Again, this one will mostly used as a prefix in definitions.
-%D Here the difference is in the position:
-%D
-%D \leavevmode\ruledhbox
-%D {\ruledhbox{\moveaccent{-.1ex}{\"}Uberhaupt}\quad
-%D oder\quad
-%D \ruledhbox{\"Uberhaupt}}
-
-\unexpanded\def\moveaccent#1#2%
- {\smashaccent
- {\dimen0\exheight
- \dimen2\dimen0
- \advance\dimen2 -#1%
- \exheight\dimen2
- #2\relax
- \exheight\dimen0}}
-
-%D Personally I think that using \TEX\ is complicated by the
-%D way fonts are handled. Apart from the many encodings, we
-%D also deal with different naming schemes. Confronted with
-%D this problem, I decided to change the definitions into:
-%D
-%D \starttyping
-%D \definebodyfont [12pt] [rm] [tf=Times-Roman at 12pt]
-%D \stoptyping
-%D
-%D combined with for instance:
-%D
-%D \starttyping
-%D \definefontsynonym [Times-Roman] [tir]
-%D \stoptyping
-
-%D Now we're up to some definitions.
-
-\definebodyfontenvironment
- [\s!default]
- [ \s!text=1.0,
- \s!script=0.7,
- \s!scriptscript=0.5,
- \c!a=1.200,
- \c!b=1.440,
- \c!c=1.728,
- \c!d=2.074,
- *=\currentfontscale, % wildcard
- \c!x=0.8,
- \c!xx=0.6,
- \c!big=1.2,
- \c!small=0.8,
- \c!interlinespace=,
- \c!em=\v!slanted]
-
-\definebodyfontenvironment
- [20.7pt]
- [ \s!text=20.7pt,
- \s!script=\!!fourteenpointfour,
- \s!scriptscript=\!!twelvepoint,
- \c!x=17.3pt,
- \c!xx=\!!fourteenpointfour,
- \c!big=20.7pt, % !!!!
- \c!small=17.3pt]
-
-\definebodyfontenvironment
- [17.3pt]
- [ \s!text=17.3pt,
- \s!script=\!!twelvepoint,
- \s!scriptscript=\!!tenpoint,
- \c!x=\!!fourteenpointfour,
- \c!xx=\!!twelvepoint,
- \c!big=20.7pt,
- \c!small=\!!fourteenpointfour]
-
-\definebodyfontenvironment
- [\!!fourteenpointfour]
- [ \s!text=\!!fourteenpointfour,
- \s!script=\!!elevenpoint,
- \s!scriptscript=\!!ninepoint,
- \c!x=\!!twelvepoint,
- \c!xx=\!!tenpoint,
- \c!big=17.3pt,
- \c!small=\!!twelvepoint]
-
-\definebodyfontenvironment
- [\!!twelvepoint]
- [ \s!text=\!!twelvepoint,
- \s!script=\!!ninepoint,
- \s!scriptscript=\!!sevenpoint,
- \c!x=\!!tenpoint,
- \c!xx=\!!eightpoint,
- \c!big=\!!fourteenpointfour,
- \c!small=\!!tenpoint]
-
-\definebodyfontenvironment
- [\!!elevenpoint]
- [ \s!text=\!!elevenpoint,
- \s!script=\!!eightpoint,
- \s!scriptscript=\!!sixpoint,
- \c!x=\!!ninepoint,
- \c!xx=\!!sevenpoint,
- \c!big=\!!twelvepoint,
- \c!small=\!!ninepoint]
-
-\definebodyfontenvironment
- [\!!tenpoint]
- [ \s!text=\!!tenpoint,
- \s!script=\!!sevenpoint,
- \s!scriptscript=\!!fivepoint,
- \c!x=\!!eightpoint,
- \c!xx=\!!sixpoint,
- \c!big=\!!twelvepoint,
- \c!small=\!!eightpoint]
-
-\definebodyfontenvironment
- [\!!ninepoint]
- [ \s!text=\!!ninepoint,
- \s!script=\!!sevenpoint,
- \s!scriptscript=\!!fivepoint,
- \c!x=\!!sevenpoint,
- \c!xx=\!!fivepoint,
- \c!big=\!!elevenpoint,
- \c!small=\!!sevenpoint]
-
-\definebodyfontenvironment
- [\!!eightpoint]
- [ \s!text=\!!eightpoint,
- \s!script=\!!sixpoint,
- \s!scriptscript=\!!fivepoint,
- \c!x=\!!sixpoint,
- \c!xx=\!!fivepoint,
- \c!big=\!!tenpoint,
- \c!small=\!!sixpoint]
-
-\definebodyfontenvironment
- [\!!sevenpoint]
- [ \s!text=\!!sevenpoint,
- \s!script=\!!sixpoint,
- \s!scriptscript=\!!fivepoint,
- \c!x=\!!sixpoint,
- \c!xx=\!!fivepoint,
- \c!big=\!!ninepoint,
- \c!small=\!!fivepoint]
-
-\definebodyfontenvironment
- [\!!sixpoint]
- [ \s!text=\!!sixpoint,
- \s!script=\!!fivepoint,
- \s!scriptscript=\!!fivepoint,
- \c!x=\!!fivepoint,
- \c!xx=\!!fivepoint,
- \c!big=\!!eightpoint,
- \c!small=\!!fivepoint]
-
-\definebodyfontenvironment
- [\!!fivepoint]
- [ \s!text=\!!fivepoint,
- \s!script=\!!fivepoint,
- \s!scriptscript=\!!fivepoint,
- \c!x=\!!fivepoint,
- \c!xx=\!!fivepoint,
- \c!big=\!!sevenpoint,
- \c!small=\!!fivepoint]
-
-\definebodyfontenvironment
- [\!!fourpoint]
- [ \s!text=\!!fourpoint,
- \s!script=\!!fourpoint,
- \s!scriptscript=\!!fourpoint,
- \c!x=\!!fourpoint,
- \c!xx=\!!fourpoint,
- \c!big=\!!sixpoint,
- \c!small=\!!fourpoint]
-
-\definebodyfontswitch [fourteenpointfour] [\!!fourteenpointfour]
-\definebodyfontswitch [twelvepoint] [\!!twelvepoint]
-\definebodyfontswitch [elevenpoint] [\!!elevenpoint]
-\definebodyfontswitch [tenpoint] [\!!tenpoint]
-\definebodyfontswitch [ninepoint] [\!!ninepoint]
-\definebodyfontswitch [eightpoint] [\!!eightpoint]
-\definebodyfontswitch [sevenpoint] [\!!sevenpoint]
-\definebodyfontswitch [sixpoint] [\!!sixpoint]
-\definebodyfontswitch [fivepoint] [\!!fivepoint]
-\definebodyfontswitch [fourpoint] [\!!fourpoint]
-
-\definebodyfontswitch [xii] [\!!twelvepoint]
-\definebodyfontswitch [xi] [\!!elevenpoint]
-\definebodyfontswitch [x] [\!!tenpoint]
-\definebodyfontswitch [ix] [\!!ninepoint]
-\definebodyfontswitch [viii] [\!!eightpoint]
-\definebodyfontswitch [vii] [\!!sevenpoint]
-\definebodyfontswitch [vi] [\!!sixpoint]
-
-%D So far.
-
-\definefontstyle [\c!mm] [\c!mm]
-\definefontstyle [\c!rm,\v!roman,\v!serif,\v!regular] [\c!rm]
-\definefontstyle [\c!ss,\v!sansserif,\v!sans,\v!support] [\c!ss]
-\definefontstyle [\c!tt,\v!teletype,\v!type,\v!mono] [\c!tt]
-\definefontstyle [\c!hw,\v!handwritten] [\c!hw]
-\definefontstyle [\c!cg,\v!calligraphic] [\c!cg]
-
-\definefontsize[\c!a] \definefontsize[\c!b]
-\definefontsize[\c!c] \definefontsize[\c!d]
-
-\definealternativestyle [\v!mediaeval] [\os] []
-\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] []
-\definealternativestyle [\v!bolditalic,\v!italicbold] [\bi] []
-\definealternativestyle [\v!small,\v!smallnormal] [\tfx] []
-\definealternativestyle [\v!smallbold] [\bfx] []
-\definealternativestyle [\v!smalltype] [\ttx] []
-\definealternativestyle [\v!smallslanted] [\slx] []
-\definealternativestyle [\v!smallboldslanted,\v!smallslantedbold] [\bsx] []
-\definealternativestyle [\v!smallbolditalic,\v!smallitalicbold] [\bix] []
-
-\definealternativestyle [\v!sans,\v!sansserif] [\ss] []
-\definealternativestyle [\v!sansbold] [\ss\bf] []
-
-%D Slow but handy:
-
-\definealternativestyle [\v!smallbodyfont] [\setsmallbodyfont] []
-\definealternativestyle [\v!bigbodyfont] [\setbigbodyfont] []
-
-%D We treat {\sc Small Caps} and \cap {Pseudo Caps} a bit
-%D different. We also provide an \WORD {uppercase} style.
-
-\definealternativestyle [\v!cap,\v!capital] [\smallcapped] [\smallcapped]
-\definealternativestyle [\v!smallcaps] [\sc] [\sc]
-\definealternativestyle [\v!WORD] [\WORD] [\WORD]
-
-%D \macros
-%D {...math}
-%D
-%D New or old?
-
-% tzt proper \define...
-%
-% watch out: \synchronizesymb resets the family so we need a second
-% \mf (or maybe \mr): messy and to be sorted out
-
-\def\tfmath{\tf\mf\synchronizesymb\mf}
-\def\bfmath{\bf\mf\synchronizesymb\mf}
-\def\slmath{\sl\mf\synchronizesymb\mf}
-\def\itmath{\it\mf\synchronizesymb\mf}
-\def\bsmath{\bs\mf\synchronizesymb\mf}
-\def\bimath{\bi\mf\synchronizesymb\mf}
-\def\scmath{\sc\mf\synchronizesymb\mf}
-\def\nnmath{\nn\mf\synchronizesymb\mf}
-
-\def\textmath {\synchronizesymb}
-
-%D \macros
-%D {fontstylesuffix}
-%D
-%D The next macro is used to map non latin fontnames on
-%D fonts. See \type {font-uni} for an example of its use.
-
-%\def\fontstylesuffix%
-% {\ifnum\fam=\tffam \s!Regular \else
-% \ifnum\fam=\bffam \s!Bold \else
-% \ifnum\fam=\slfam \s!Slanted \else
-% \ifnum\fam=\itfam \s!Italic \else
-% \ifnum\fam=\bsfam \s!BoldSlanted \else
-% \ifnum\fam=\bifam \s!BoldItalic \else
-% \s!Regular \fi\fi\fi\fi\fi\fi}%
-
-\def\fontstylesuffix% why the \s!Regular ? see \getglyph
- {\ifx\fontalternative\c!tf \s!Regular \else
- \ifx\fontalternative\c!bf \s!Bold \else
- \ifx\fontalternative\c!sl \s!Slanted \else
- \ifx\fontalternative\c!it \s!Italic \else
- \ifx\fontalternative\c!bs \s!BoldSlanted \else
- \ifx\fontalternative\c!bi \s!BoldItalic \else
- \ifx\fontalternative\c!sc \s!Caps \else
- \s!Regular \fi\fi\fi\fi\fi\fi\fi}%
-
-%D We still have to take care of \type{\xi}, so:
-
-\def\xi{\ifmmode\normalxi\else\elevenpoint\fi}
-
-%D \macros
-%D {definefontvariant,fontvariant,variant}
-%D
-%D A slightly adapted version of Adam Lindsays variant patches:
-%D
-%D \starttyping
-%D \usetypescriptfile[type-psc] \loadmapfile[texnansi-public-fpl]
-%D \usetypescript[palatino][texnansi] \setupbodyfont[palatino]
-%D
-%D \definefontvariant [Serif][osf] [OsF]
-%D
-%D \startlines
-%D {\sc abcdefgHIJKlmnop}
-%D 123{\Var[osf]456}789
-%D {\Var[osf] 123{\Var[reset]456}789}
-%D {\it 123{\Var[osf]456}789
-%D {\Var[osf]123{\Var[reset]456}789}}
-%D {\tfb\bf 123{\Var[osf]456}789
-%D {\Var[osf] 123{\Var[reset]456}789}}
-%D {\sc 123{\Var[osf]456}789
-%D {\Var[osf] 123{\Var[reset]456}789}}
-%D \stoplines
-%D \stoptyping
-
-\def\definefontvariant
- {\dotripleargument\dodefinefontvariant}
-
-\def\dodefinefontvariant[#1][#2][#3]%
- {\setvalue{\??fv#1#2}{#3}}
-
-\def\fontvariant#1#2{\executeifdefined{\??fv#1#2}\empty}
-
-\def\dosetscaledfont
- {\checkrelativefontsize\fontstyle
- \scaledfont\currentfontscale\bodyfontsize
- \scaledfont\relativefontsize\scaledfont}
-
-\unexpanded\def\variant[#1]% slow
- {\dosetscaledfont
- \expanded{\definedfont
- [\truefontname{\fontstringA\fontstylesuffix\fontvariant\fontstringA{#1}}
- at \scaledfont]}%
- \ignoreimplicitspaces}
-
-\ifx\Var\undefined \let\Var\variant \fi
-
-%D By default we load the Computer Modern Roman fonts (but
-%D not yet at this moment) and activate the 12pt roman
-%D bodyfont. Sans serif and teletype are also available and
-%D can be called for by \type{\ss} and \type{\tt}.
-
-% \setupbodyfont [unk, rm]
-
-%D Also needed is:
-
-\definefont[tinyfont][Mono at 1ex]
-
-%D \macros
-%D {doiffontpresentelse}
-%D
-%D Some unused left||overs:
-%D
-%D \starttyping
-%D \def\doiffontpresentelse#1#2#3%
-%D {\bgroup
-%D \batchmode\font\dummy=\truefontname{#1}\errorstopmode
-%D \edef\lastfontname{\fontname\dummy}%
-%D \ifx\lastfontname\nullfontname\egroup#3\else\egroup#2\fi}
-%D
-%D \def\abortiffontnotfound#1%
-%D {\doiffontpresentelse{#1}{}{\showmessage\m!fonts{10}{\truefontname{#1}}\endinput}}
-%D \stoptyping
-%D
-%D We now provide (slow, but sometimes handy):
-%D
-%D \starttyping
-%D \doiffontpresentelse{texnansi-lmr10}{YES}{NO}
-%D \doiffontpresentelse{adam-lindsay-modern-serif}{YES}{NO}
-%D \stoptyping
-
-\def\doiffontpresentelse#1%
- {\bgroup
- \scratchcounter\interactionmode
- \batchmode
- \font\dummy=\truefontname{#1}\relax
- \interactionmode\scratchcounter
- \edef\lastfontname{\fontname\dummy}%
- \ifx\lastfontname\nullfontname
- \egroup\expandafter\secondoftwoarguments
- \else
- \egroup\expandafter\firstoftwoarguments
- \fi}
-
-%D New commands (not yet interfaced):
-
-\def\style[#1]% for inline usage, like \color
- {\groupedcommand{\ifcsname#1\endcsname\csname#1\endcsname\else\definedfont[#1]\fi}{}}
-
-\def\startstyle[#1]%
- {\begingroup
- \ifcsname#1\endcsname\csname#1\endcsname\else\definedfont[#1]\fi}
-
-\def\stopstyle
- {\endgroup}
-
-%D Still experimental (might even go away).
-
-% \definestylecollection[mine]
-
-% \definestyleinstance[mine][default][sorry]
-% \definestyleinstance[mine][tt][bs][ttbs:\rm\sl]
-% \definestyleinstance[mine][tt][bf][ttbf:\rm\sl]
-% \definestyleinstance[mine][bf][\sl]
-% \definestyleinstance[mine][sl][\tt]
-
-% {\bf test \mine test \sl test \mine test \bs oeps \mine oeps {\tt test \mine \bf test}}
-
-\definesystemvariable{sx}
-
-\def\definestylecollection
- {\dosingleargument\dodefinestylecollection}
-
-\def\dodefinestylecollection[#1]%
- {\iffirstargument
- \unexpanded\setvalue{#1}{\styleinstance[#1]}%
- \def\docommand##1%
- {\def\dodocommand####1{\letbeundefined{\??sx##1:####1:\commalistelement}}%
- \processcommacommand[\fontalternativelist,\s!default]\dodocommand}%
- \processcommacommand[\fontstylelist,\s!default]\docommand
- \fi}
-
-\def\definestyleinstance
- {\doquadrupleargument\dodefinestyleinstance}
-
-\def\dodefinestyleinstance[#1][#2][#3][#4]% [name] [rm|ss|tt|..] [sl|bf|...] [whatever]
- {\iffirstargument
- \doifundefined{#1}{\definestylecollection[#1]}%
- \fi
- \iffourthargument
- \setvalue{\??sx#1:#2:#3}{#4}%
- \else\ifthirdargument
- \setvalue{\??sx#1::#2}{#3}%
- \else\ifsecondargument
- \letvalue{\??sx#1::#2}\empty
- \fi\fi\fi}
-
-\unexpanded\def\styleinstance[#1]% will be faster
- {%\begingroup\expanded{\infofont[#1:\fontstyle:\fontalternative]}\endgroup
- \executeifdefined{\??sx#1:\fontstyle:\fontalternative}%
- {\executeifdefined{\??sx#1:\fontstyle:\s!default}%
- {\executeifdefined{\??sx#1::\fontalternative}
- {\getvalue {\??sx#1::\s!default}}}}}
-
-% \unexpanded\def\styleinstance[#1]%
-% {\csname\??sx#1%
-% \ifcsname:\fontstyle:\fontalternative\endcsname
-% :\fontstyle:\fontalternative
-% \else\ifcsname:\fontstyle:\s!default\endcsname
-% :\fontstyle:\s!default
-% \else\ifcsname::\fontalternative\endcsname
-% ::\fontalternative
-% \else\ifcsname::\s!default\endcsname
-% ::\s!default
-% \else
-% % nothing, \relax
-% \fi\fi\fi\fi
-% \endcsname}
-
-%D \Compatibility with \MKIV:
-
-\def\somefontsize{\scaledfont}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/font-jap.mkii b/Master/texmf-dist/tex/context/base/mkii/font-jap.mkii
deleted file mode 100644
index b8aa3d8368d..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/font-jap.mkii
+++ /dev/null
@@ -1,83 +0,0 @@
-%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 ADE \& \CONTEXT\ Development Team}]
-%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/mkii/font-run.mkii b/Master/texmf-dist/tex/context/base/mkii/font-run.mkii
deleted file mode 100644
index 04fcd576a60..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/font-run.mkii
+++ /dev/null
@@ -1,326 +0,0 @@
-%D \module
-%D [ file=font-run,
-%D version=1998.09.11, % (second)
-%D version=2001.02.20, % (third)
-%D title=\CONTEXT\ Font Macros,
-%D subtitle=Runtime Macros,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 code is hooked into the core macros and saves some
-%D format space.]
-
-\unprotect
-
-\gdef\@@onlyenglish#1%
- {\blank{\tttf \type {#1} is only available in the english interface}\blank}
-
-\gdef\dosetshowfonttitle#1%
- {\tabskip\zeropoint
- \parindent\zeropoint
- \setlocalhsize
- \doifelsenothing{#1}
- {\def\title{[\the\bodyfontsize]}}
- {\switchtobodyfont[#1]\def\title{[#1]}}
- \doifsomething\fontclass
- {\doifnot{[\fontclass]}\title
- {\edef\title{[\fontclass]\space\title}}}}
-
-\gdef\showbodyfont
- {\dosingleempty\doshowbodyfont}
-
-\gdef\doshowbodyfont[#1]%
- {\ifinsidefloat\else\startbaselinecorrection\fi
- \vbox
- {\dosetshowfonttitle{#1}%
- \def\bigstrut##1##2%
- {\hbox{\vrule
- \!!height##1\strutht
- \!!depth ##2\strutdp
- \!!width \zeropoint}}
- \def\next##1##2##3%
- {&&##1&&##2\tf##3&&##2\sc##3%
- &&##2\sl##3&&##2\it##3&&##2\bf##3&&##2\bs##3&&##2\bi##3%
- &&##2\tfx##3&&##2\tfxx##3%
- &&##2\tfa##3&&##2\tfb##3&&##2\tfc##3&&##2\tfd##3&\cr}%
- \halign to \localhsize
- {\bigstrut{1.5}{2}##&\vrule##
- \tabskip=\!!zeropoint \!!plus 1fill
- &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule##
- &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule##
- &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule##
- &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule##
- &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule##
- &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule##
- &\hfil##\hfil&\vrule##&\hfil##\hfil&##\vrule
- \tabskip=\!!zeropoint\cr
- \noalign{\hrule}
- &\multispan{29}{\vrule\hfil\tttf\strut\title\hfil
- \llap{\string\mr\hbox to 1em{\hss:\hss}$\mr \languageparameter\c!text$\quad}\vrule}\cr
- \noalign{\hrule}\next{}{\tt\string}{}
- \noalign{\hrule}\next{\tt\string\rm}\rm{\languageparameter\c!text}
- \noalign{\hrule}\next{\tt\string\ss}\ss{\languageparameter\c!text}
- \noalign{\hrule}\next{\tt\string\tt}\tt{\languageparameter\c!text}
- \noalign{\hrule}}}
- \ifinsidefloat\else\stopbaselinecorrection\fi}
-
-\gdef\showbodyfontenvironment
- {\dosingleempty\doshowbodyfontenvironment}
-
-\gdef\doshowbodyfontenvironment[#1]%
- {\ifinsidefloat\else\startbaselinecorrection\fi
- \vbox
- {\dosetshowfonttitle{#1}%
- \def\next##1%
- {&&\getvalue{\bodyfontvariable{##1\s!text}}%
- &&\getvalue{\bodyfontvariable{##1\s!script}}%
- &&\getvalue{\bodyfontvariable{##1\s!scriptscript}}%
- &&\getvalue{\bodyfontvariable{##1\c!x}}%
- &&\getvalue{\bodyfontvariable{##1\c!xx}}%
- &&\getvalue{\bodyfontvariable{##1\interfaced\v!small}}%
- &&\getvalue{\bodyfontvariable{##1\interfaced\v!big}}%
- &&\edef\next{\getvalue{\bodyfontvariable{##1\c!interlinespace}}}\ifx\next\empty not set\else\next\fi&\cr
- \noalign{\hrule}}
- \halign to \localhsize
- {##&\vrule##\strut
- \tabskip=\!!zeropoint \!!plus 1fill
- &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule##
- &\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule##&\hfil##\hfil&\vrule##
- &\hfil##\hfil&\vrule##&\hfil##\hfil&##\vrule
- \tabskip\zeropoint\cr
- \noalign{\hrule}
- &\multispan{17}{\vrule\hfil\tttf\strut\title\hfil}\vrule\cr
- \noalign{\hrule}
- &&\tttf\tx\s!text&&\tttf\tx\s!script&&\tttf\tx\s!scriptscript
- &&\tttf\tx\c!x&&\tttf\tx\c!xx&&\tttf\tx\v!small&&\tttf\tx\v!big
- &&\tttf\tx\c!interlinespace&\cr
- \noalign{\hrule}
- \@EA\globalprocesscommalist\@EA[\bodyfontenvironmentlist]\next}}
- \ifinsidefloat\else\stopbaselinecorrection\fi}
-
-\gdef\showfont
- {\dodoubleempty\doshowfont}
-
-\gdef\doshowfont[#1][#2]%
- {\bgroup
- \boxrulewidth=.1pt
- \setupcolors[\c!state=\v!local]%
- \iffirstargument
- \definefont[\s!dummy][#1]\dummy
- \else\ifdim2.5em>.05\hsize \tx
- \ifdim2.5em>.05\hsize \txx
- \fi\fi\fi
- \ifinsidefloat\else\startbaselinecorrection\fi
- \vbox\bgroup
- \forgetall
- \startoverlay
- {\vbox
- {\tf \setstrut \dummy
- \localcolortrue \offinterlineskip
- \dostepwiserecurse{0}{15}{1}
- {\let\row\recurselevel
- \hbox
- {\red
- \dostepwiserecurse{0}{15}{1}
- {\let\col\recurselevel
- \@EA\scratchcounter\normaldblquote\hexnumber\row\hexnumber\col\relax
- \edef\rowcol{\the\scratchcounter}%
- \iffontchar\font\scratchcounter
- \setbox\scratchbox\ruledhbox{\black\char\scratchcounter}%
- \ifdim\wd\scratchbox>\zeropoint
- \donetrue \else \donefalse
- \fi
- \else
- \setbox\scratchbox\hbox{\gray\vrule\!!width1ex\!!height.5ex\!!depth.5ex}%
- \fi
- \startoverlay
- {\tf\vbox to 2.5em
- {\vss
- \hbox to 2.5em
- {\dummy\ifdim\interwordspace=\zeropoint
- \setbox\scratchbox\hbox
- {\raise.5\dp\scratchbox\hbox
- {\lower.5\ht\scratchbox\copy\scratchbox}}%
- \ht\scratchbox\zeropoint
- \dp\scratchbox\zeropoint
- \else
- \ht\scratchbox\strutht
- \dp\scratchbox\strutdp
- \strut
- \fi
- \hss\copy\scratchbox\hss}
- \vss}}
- {\tf\vbox to 2.3em
- {\ifdone
- \hsize2.4em
- \blue
- \edef\theshowfontspecs
- {\ifnum\hyphenchar\font=\rowcol hyph\else
- \ifnum\skewchar \font=\rowcol skew\fi\fi}%
- \tinyfont % after \edef, else wrong font analyzed
- \doifnot\v!unknown{#2}{{\red\theshowfontspecs}}\hfill\number\rowcol
- \vfill
- \octnumber\rowcol\hfill\lchexnumbers\rowcol
- \par
- \fi}}
- \stopoverlay}}}
- \par}}
- {\tf\basegrid[\c!nx=16,\c!ny=16,\c!dx=2.5,\c!dy=2.5,\c!unit=em]}
- \stopoverlay
- \nointerlineskip
- \vskip2pt
- % the \noexpand before \blank is needed for non etex
- \edef\ascii{name: {\noexpand\black\fontname\font}}
- \def\do##1##2{\ifx##1\undefined\else\ifx##1\empty\else##2\fi\fi}%
- \doifelse\v!unknown{#2}
- {\edef\theshowfontspecs
- {name: {\noexpand\black\fontname\font}}}
- {\edef\theshowfontspecs
- {name: {\noexpand\black\fontname\font}\noexpand\quad
- \do\currentencoding{encoding: {\noexpand\black\currentencoding\noexpand\quad}}%
- \do\currentmapping {mapping: {\noexpand\black\currentmapping \noexpand\quad}}%
- \do\fonthandling {handling: {\noexpand\black\fonthandling }}}}%
- \tf % also sets em
- \hbox to 40em{\blue\hfill\tinyfont\setstrut\strut\theshowfontspecs}
- \egroup
- \ifinsidefloat\else\stopbaselinecorrection\fi
- \egroup}
-
-\gdef\showfontstyle
- {\dotripleempty\doshowfontstyle}
-
-\gdef\doshowfontstyle[#1][#2][#3]%
- {\ifthirdargument
- \bgroup
- \raggedright
- \switchtobodyfont[#1]
- \def\dodocommand##1##2%
- {\starttextrule{\tttf #1 ##1 ##2}
- \nobreak \getvalue{##2}%
- \dorecurse{255}
- {\iffontchar\font\recurselevel\relax
- \char\recurselevel\relax\space
- \fi}
- \par \nobreak
- \stoptextrule}
- \def\docommand##1%
- {\getvalue{##1}\processcommacommand[#3]{\dodocommand{##1}}}
- \processcommalist[#2]\docommand
- \egroup
- \else\ifsecondargument
- \showfontstyle[#1][#2][\fontalternativelist]% math is gone
- \else
- \showfontstyle[#1][\c!rm]\showfontstyle[#1][\c!ss]
- \showfontstyle[#1][\c!tt]\showfontstyle[#1][\c!mm]
- \fi\fi}
-
-\gdef\showligature#1%
- {\hbox{\type{#1}\enspace\red\ruledhbox{\black#1}}}
-
-\gdef\showligatures[#1]%
- {\ifx\starttabulate\undefined
- \@@onlyenglish\showligatures
- \else
- \bgroup
- \setupcolors[\c!state=\v!local]%
- \def\show##1{\hbox{\red\ruledhbox{\black##1}}}%
- \definefont[\s!dummy][#1]\dummy
- \starttabulate[|*{9}{c|}]
- \NC\type{ff}\NC\type{fi}\NC\type{fl}\NC\type{ffi}\NC\type{ffl}\NC
- \type{``}\NC\type{''}\NC\type{--}\NC\type{---}\NC\NR
- \NC\show{ff}\NC\show{fi}\NC\show{fl}\NC\show{ffi}\NC\show{ffl}\NC
- \show{``}\NC\show{''}\NC\show{--}\NC\show{---}\NC\NR
- \stoptabulate
- \egroup
- \fi}
-
-\gdef\showfontstrip
- {\dosingleempty\doshowfontstrip}
-
-\gdef\doshowfontstrip[#1]%
- {\ifx\starttabulate\undefined
- \@@onlyenglish\showfontstrip
- \else
- \bgroup
- \def\dofontstripa##1##2%
- {\tttf\string##1}
- \def\dofontstripb##1##2%
- {\ruledhbox{\switchtobodyfont[#1]##1{##2}}}
- \def\dofontstripc##1##2%
- {\setbox\scratchbox\hbox{\switchtobodyfont[#1]##1{##2}}%
- \tt\tfx\the\ht\scratchbox}%
- \def\dofontstripd##1##2%
- {\setbox\scratchbox\hbox{\switchtobodyfont[#1]##1{##2}}%
- \tt\tfx\the\wd\scratchbox}%
- \def\fontstrip##1##2##3%
- {\NC##2\rm{##3}\NC
- ##2\ss{##3}\NC
- ##2\tt{##3}\NC
- ##2\mathematics{##3}\NC
- \tttf##1\NR}
- \starttabulate[|c|c|c|c|c|]
- \fontstrip\relax\dofontstripa\empty
- \TB
- \fontstrip\relax\dofontstripb{xxxx}
- \fontstrip\relax\dofontstripb{12345}
- \fontstrip\relax\dofontstripb{(Agw)}
- \TB
- \fontstrip{(x height)}\dofontstripc{x}
- \fontstrip{(m width)}\dofontstripd{m}
- \stoptabulate
- \egroup
- \fi}
-
-\ifx\databox\undefined \newbox\databox \fi
-
-\gdef\testminimalbaseline#1%
- {\setbox\databox\ruledhbox{#1}%
- \scratchdimen\ht\databox
- \advance\scratchdimen\dp\databox
- \scratchtoks{#1}%
- \expanded
- {\NC \ruledhbox{\the\scratchtoks}
- \noexpand \NC ->
- \noexpand \NC \the\scratchdimen
- \noexpand \NC =
- \noexpand \NC \the\ht\databox
- \noexpand \NC +
- \noexpand \NC \the\dp\databox
- \noexpand \NC \ifdim\scratchdimen<\baselineskip <
- \else\ifdim\scratchdimen=\baselineskip =
- \else > \fi\fi
- \noexpand \NC \the\baselineskip
- \noexpand \NC (\ifdim\scratchdimen>\baselineskip not \fi ok)
- \noexpand \NC \noexpand \NR }}
-
-\gdef\showminimalbaseline
- {\ifx\starttabulate\undefined
- \@@onlyenglish\showminimalbaseline
- \else
- \starttabulate[||T|T|T|T|T|T|T|T|T|]
- \testminimalbaseline{\hbox to 1em{\hss\showstruts\strut\hss}}%
- \testminimalbaseline{(/)}%
- \testminimalbaseline{$\frac{1}{2}x^2_3$}
- \stoptabulate
- \fi}
-
-\gdef\showkerning#1%
- {\bgroup
- \let\MPfshowcommand\ruledhbox
- \setMPtext\s!dummy{#1}%
- \startMPcode draw textext(\MPstring\s!dummy);\stopMPcode
- \egroup}
-
-\gdef\showcharratio
- {\dowithnextboxcontent
- {\switchtobodyfont[10pt]}%
- {(\expanded{\withoutpt\the\nextboxht},%
- \expanded{\withoutpt\the\nextboxdp})}%
- \hbox}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/font-uni.mkii b/Master/texmf-dist/tex/context/base/mkii/font-uni.mkii
deleted file mode 100644
index 77eb680e20f..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/font-uni.mkii
+++ /dev/null
@@ -1,444 +0,0 @@
-%D \module
-%D [ file=font-uni,
-%D version=1999.10.10,
-%D title=\CONTEXT\ Font Macros,
-%D subtitle=\UNICODE,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Font Macros / Unicode}
-
-%D In \XETEX, unicode support is straightforward, so we
-%D simply output a \type {\char} with a 16||bit number.
-
-\ifnum\texengine=\xetexengine
- \unexpanded\def\uchar#1#2{\char\numexpr#2+#1*\pluscclvi\relax}
- \let\uc\uchar
- \expandafter \endinput
-\fi
-
-%D Now comes the more traditional 8 bit \TEX\ hackery.
-
-%D I wrote this module when Wang Lei asked me how to use
-%D Chinese in \CONTEXT. From the samples he sent me, I deduced
-%D that some mixture of one and two byte encoding was used,
-%D which he confirmed. Since \TEX\ normally does not use the
-%D characters $>127$, so as long as the two byte characters
-%D have a first character with code $>127$, we can use active
-%D characters to handle them. In an optimistic mood, I called
-%D this module the \UNICODE\ font module. In the module that
-%D handles Chinese, we will see that some more interpretation
-%D is involved, which is why the macros handling those
-%D characters look ahead.
-
-\unprotect
-
-%D \macros
-%D {handleunicodeflowglyph, uchar,
-%D handleunicodeglyph, insertunicodeglyph,
-%D unicodeposition, unicodeone, unicodetwo}
-%D
-%D For the moment \UNICODE\ support is rather primitive but
-%D nevertheless effective. The reference to \UNICODE\ is not
-%D entirely correct, since in many cases one will use \quote
-%D {older} mappings, but in principle, \UNICODE\ can be
-%D supported.
-%D
-%D We expect each character to come as two eight bit
-%D characters. Those doubles are handled by making all
-%D characters in the range $>127$ active, so that they can
-%D pick up the next one, and act upon both their values.
-%D Internally only numbers are used. A first implementation
-%D simply internally prefixed the second part of the \UNICODE\
-%D pair with \type {\string} or \type {\char}, but this was
-%D not that handy when it came to testing those values.
-%D Because in principle we are dealing with an encoding, the
-%D making active is handled in \type {enco-uni}.
-%D
-%D There are two commands to handle unicode characters:
-%D
-%D \starttyping
-%D \handleunicodeflowglyph{number}{character}
-%D \uchar{number}{number}
-%D \stoptyping
-%D
-%D The first one can be assigned to an active character, the
-%D second one can be used to directly access a glyph. Both
-%D command call \type {\handleunicodeglyph} that in turn
-%D calls \type {\insertunicodeglyph}. Both can be overruled
-%D in specialized modules. The low level command \type
-%D {\unicodeglyph} can best be left untouched, which is not
-%D so much a problem because there is a hook into this macro:
-%D \type {\unicodecharcommand}.
-%D
-%D In most cases one will redefine \type {\handleunicodeglyph}
-%D in such a way that it identifies special situations first,
-%D takes some actions next, calls \type {\insertunicodeglyph},
-%D if needed with \type {\unicodecharcommand} changed, and
-%D finally does some finishing:
-%D
-%D \starttyping
-%D \def\handleunicodeglyph
-%D {take actions based on \unicodeone-two-position cq. \nextutoken
-%D redefine \unicodecharcommand if needed
-%D expand \insertunicodeglyph
-%D take some final actions}
-%D \stoptyping
-
-\newcount\unicodeposition
-
-%D The multistep approach is needed to pick up the second
-%D token, since this token can have any value and any
-%D catcode.
-
-% the \relax trick prevents eating up the space (needed for
-% korean
-
-\def\handleunicodeflowglyph#1#2%
- {\begingroup
- \edef\unicodeone{#1}%
- \@EA\afterassignment\@EA\dohandleunicodeflowglyph % two redundant ea's
- \@EA\chardef\@EA\nexttoken\@EA`\string#2\relax}
-
-\def\dohandleunicodeflowglyph\relax
- {\futurelet\nextutoken\dodohandleunicodeflowglyph}
-
-\def\dodohandleunicodeflowglyph % todo tex (or maybe no longer)
- {\edef\unicodetwo{\the\nexttoken}%
- \unicodeposition\numexpr\unicodeone*256+\unicodetwo\relax
- \handleunicodeglyph
- \endgroup}
-
-\unexpanded\def\uchar#1#2% use as standalone glyph
- {\begingroup
- \edef\unicodeone{#1}%
- \edef\unicodetwo{#2}%
- \unicodeposition\numexpr\unicodeone*256+\unicodetwo\relax
- \handleunicodeglyph
- \endgroup}
-
-\let\nextutoken\relax
-
-\unexpanded\def\lookaheaduchar#1#2%
- {\def\dolookaheaduchar{\uchar{#1}{#2}\let\nextutoken\relax}%
- \futurelet\nextutoken\dolookaheaduchar}
-
-\def\dohandleucflowglyph
- {\unicodeposition\numexpr\unicodeone*256+\unicodetwo\relax
- \handleunicodeglyph
- \endgroup}
-
-\unexpanded\def\uc#1#2% used in tricky situations
- {\begingroup
- \edef\unicodeone{#1}%
- \edef\unicodetwo{#2}%
- \futurelet\nextutoken\dohandleucflowglyph}
-
-\def\insertunicodeglyph
- {\unicodeglyph\unicodeone\unicodetwo}
-
-\let\handleunicodeglyph\insertunicodeglyph
-
-%D One can use the \type {\unicodeposition} in the macros
-%D that handle pre and post material.
-
-%D \macros
-%D {unicodestyle, unicodecharcommand}
-%D
-%D Each character pair will become one glyph. Because \TEX\
-%D cannot handle fonts with more that 256 characters, we use
-%D \TFM\ files for each range. The first character of the pair
-%D is appended to the name of a font, and the second is used to
-%D access the glyph in that font. This means that a particular
-%D font is split up in subfonts with names in the range:
-%D
-%D \starttyping
-%D <filename>80 ... <filename>ff
-%D \stoptyping
-%D
-%D The \type {<filename>} as well as the composed name are
-%D mapped ones. The next macros take care of this mapping.
-%D Let us assume that the next mapping has taken place,
-%D
-%D \starttyping
-%D \definefontsynonym [UnicodeRegular] [gbsong]
-%D \stoptyping
-%D
-%D Let us also assume that we are dealing with the range \type
-%D {b1}. Given that a font name results from:
-%D
-%D \starttyping
-%D \truefontname{\truefontname{UnicodeRegular}b1}
-%D \stoptyping
-%D
-%D we get \type {gbsongb1}. The outer \type {\truefontname}
-%D takes care of additional mapping, so when we say:
-%D
-%D \starttyping
-%D \definefontsynonym [gbsongb1] [gbsong-b1]
-%D \stoptyping
-%D
-%D the filename used will be \type {gbsong-b1}. From the next
-%D definition it will be clear that other fontshapes are also
-%D supported. The prefix \type {Unicode} is mapped!
-%D
-%D The command \type {\unicodecharcommand} can be used to
-%D handle special cases. At that moment \type {1em} is known.
-
-\def\unicodestyle
- {\truefontname\s!Unicode\fontstylesuffix}
-
-\let\unicodecharcommand\firstofoneargument
-
-\unexpanded\def\unicodeglyph#1#2% watch the double mapping
- {\begingroup
- \getvalue{@@\currentucharmapping\strippedcsname\uchar}{#1}{#2}% map to a to hex font range
- \bodyfontsize\unicodescale\bodyfontsize
- % 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}
-%D
-%D A (plane,char) pair can be remapped using a uchar mapping
-%D function. The default mapping is to convert the plane to a
-%D lowercase hexadecimal number, and leave the number
-%D untouched. The current remapping is kept in a macro.
-
-\let\currentucharmapping\s!default
-
-\def\defineucharmapping#1%
- {\setvalue{@@#1\strippedcsname\uchar}}
-
-\defineucharmapping{\s!default}#1#2%
- {\edef\unicodeone{\lchexnumbers{#1}}\edef\unicodetwo{#2}}
-
-%D An example of a remapping is the following:
-%D
-%D \starttyping
-%D \defineucharmapping{GBK}#1#2%
-%D {\unicodeposition=#1
-%D \advance\unicodeposition -129
-%D \multiply\unicodeposition 190
-%D \advance\unicodeposition #2
-%D \advance\unicodeposition-\ifnum#2>127 65\else64\fi
-%D \dorepositionunicode}
-%D \stoptyping
-%D
-%D This maps the GBK vector onto a compact GBK one. The
-%D auxiliary macro is defined here as a goody.
-
-\def\dorepositionunicode
- {\dosetdivision\unicodeposition{256}\scratchcounter
- \advance\scratchcounter \plusone
- \edef\unicodeone{\ifnum\scratchcounter<10 0\fi\the\scratchcounter}%
- \dosetmodulo\unicodeposition{256}\scratchcounter
- \edef\unicodetwo{\the\scratchcounter}}
-
-%D \macros
-%D {setunicodestrut, setunicodescale, nextutoken,
-%D handleunicodeglyph, insertunicodeglyph}
-%D
-%D A careful analysis of the previous macros, learns that the
-%D process of mapping comes down to:
-%D
-%D \startitemize[packed,n]
-%D \item taking care of preceding material (and spacing)
-%D \item defining the font at \type {\currentfontscale} $\times$
-%D \type {\unicodescale} $\times$ \type {\bodyfontsize}
-%D \item inserting a \type {\unicodestrut}
-%D \item inserting the character (glyph)
-%D \item executing some actions afterwards
-%D \stopitemize
-%D
-%D The actions before and after placing the glyph, is up to
-%D the user supplied handler. This handler (\type
-%D {\handleunicodeglpyh}) must, at a certain moment, insert
-%D the glyph using \type {\insertunicodeglyph}
-
-\def\setunicodescale#1%
- {\def\unicodescale{#1}}
-
-\def\dosetunicodestrut#1#2% height depth
- {\def\unicodestrut
- {\vrule
- \!!width \zeropoint
- \!!height#1\strutht
- \!!depth #2\strutdp
- \relax}}
-
-\def\setunicodestrut#1#2% height depth
- {\ifdim#1\strutht>\zeropoint
- \dosetunicodestrut{#1}{#2}%
- \else\ifdim#1\strutdp>\zeropoint
- \dosetunicodestrut{#1}{#2}%
- \else
- \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 {\nextutoken}.
-
-%D \macros
-%D {defineunicodefont, setupunicodefont}
-%D
-%D Apart from this rather low level implementation, we also
-%D provide a more user friendly alternative. Given that one
-%D has defined:
-%D
-%D \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!conversion=\chinesenumber,
-%D \c!command=\handlechineseunicodeglyph]
-%D \stoptyping
-%D
-%D Together with:
-%D
-%D \starttyping
-%D \definefontsynonym [SimplifiedChineseRegular] [gbsong]
-%D \definefontsynonym [SimplifiedChineseSlanted] [gbsongsl]
-%D \stoptyping
-%D
-%D we can now switch to Simplified Chinese by saying \type
-%D {SimChi}. Some values can be changed afterwards with
-%D
-%D \starttyping
-%D \setupunicodefont[SimChi][...=...]
-%D \stoptyping
-%D
-%D Specific initializations can be assigned to \type
-%D {commands}.
-
-\def\defineunicodefont
- {\dotripleempty\dodefineunicodefont}
-
-\def\dodefineunicodefont[#1][#2][#3]%
- {\doifassignmentelse{#3}
- {\setupunicodefont[#1][#3]}
- {\doifelsenothing{#3}
- {\setupunicodefont[#1][#3]}
- {\copyparameters
- [\??uc#1][\??uc#3]
- [\c!height,\c!depth,\c!scale,\c!commands,\c!strut,
- \c!interlinespace,\c!command,\c!conversion]}}%
- \doifelsenothing{#2}
- {\setvalue{#1}{[uc font #1 undefined]}}
- {\setvalue{\??uc#1\c!file}{#2}%
- \doifundefined{\??ff#2\s!Bold}
- {\definefontsynonym[#2\s!Bold] [#2\s!Regular]%
- \definefontsynonym[#2\s!Slanted] [#2\s!Regular]%
- \definefontsynonym[#2\s!Italic] [#2\s!Regular]%
- \definefontsynonym[#2\s!BoldSlanted][#2\s!Slanted]%
- \definefontsynonym[#2\s!BoldItalic] [#2\s!Italic]}%
- \unexpanded\setvalue{#1}{\enableunicodefont{#1}}}}
-
-\def\setupunicodefont
- {\dodoubleempty\dosetupunicodefont}
-
-\def\dosetupunicodefont[#1][#2]% also predefines
- {\doifundefined{\??uc#1\c!command}
- {\copyparameters
- [\??uc#1][\??uc\s!default]
- [\c!height,\c!depth,\c!scale,\c!commands,\v!strut,
- \c!interlinespace,\c!command,\c!conversion]}%
- \getparameters[\??uc#1][#2]}
-
-\def\enableunicodefont#1%
- {\definefontsynonym[\s!Unicode][\getvalue{\??uc#1\c!file}]%
- \def\unicodescale {\getvalue{\??uc#1\c!scale}}%
- \def\unicodeheight {\getvalue{\??uc#1\c!height}}%
- \def\unicodedepth {\getvalue{\??uc#1\c!depth}}%
- \def\unicodedigits {\getvalue{\??uc#1\c!conversion}}%
- \def\handleunicodeglyph {\getvalue{\??uc#1\c!command}}%
- \doifnot\currentregime{utf}{\enableregime[unicode]}%
- % the following \relax's are realy needed
- \doifvalue{\??uc#1\c!interlinespace}\v!yes
- \setupinterlinespace\relax
- \doifelsevalue{\??uc#1\c!strut}\v!yes
- {\setunicodestrut\unicodeheight\unicodedepth}
- {\resetunicodestrut}%
- \getvalue{\??uc#1\c!commands}\relax}
-
-%D \macros
-%D {unicodedigits}
-%D
-%D For convenience we also predefine a number conversion
-%D macro:
-
-\let\unicodedigits\number
-
-%D Because we cannot be sure of the pressence of all font
-%D styles, we remap some by default.
-
-\definefontsynonym [\s!Unicode\s!Bold] [\s!Unicode\s!Regular]
-\definefontsynonym [\s!Unicode\s!Slanted] [\s!Unicode\s!Regular]
-\definefontsynonym [\s!Unicode\s!Italic] [\s!Unicode\s!Regular]
-\definefontsynonym [\s!Unicode\s!BoldSlanted] [\s!Unicode\s!Slanted]
-\definefontsynonym [\s!Unicode\s!BoldItalic] [\s!Unicode\s!Italic]
-
-\setupunicodefont
- [\s!default]
- [\c!height=1,
- \c!depth=1,
- \c!scale=1,
- \c!strut=\v!no,
- \c!interlinespace=\v!no,
- \c!command=\insertunicodeglyph,
- \c!conversion=\number]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/font-unk.mkii b/Master/texmf-dist/tex/context/base/mkii/font-unk.mkii
deleted file mode 100644
index 241369f6812..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/font-unk.mkii
+++ /dev/null
@@ -1,187 +0,0 @@
-%D \module
-%D [ file=font-unk,
-%D version=1998.09.10,
-%D title=\CONTEXT\ Font Macros,
-%D subtitle=Unknown Defaults,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 module is rather important, because it enables us to
-%D define and call for not yet defined fonts in a way
-%D completely independant of real font names. First we map
-%D some meaningful names onto unknown filenames.
-
-\unprotect
-
-\definefontsynonym [Serif] [unknown]
-\definefontsynonym [SerifBold] [unknown]
-\definefontsynonym [SerifItalic] [unknown]
-\definefontsynonym [SerifSlanted] [unknown]
-\definefontsynonym [SerifBoldItalic] [unknown]
-\definefontsynonym [SerifBoldSlanted] [unknown]
-\definefontsynonym [SerifCaps] [unknown]
-
-\definefontsynonym [Sans] [unknown]
-\definefontsynonym [SansBold] [unknown]
-\definefontsynonym [SansItalic] [unknown]
-\definefontsynonym [SansSlanted] [unknown]
-\definefontsynonym [SansBoldItalic] [unknown]
-\definefontsynonym [SansBoldSlanted] [unknown]
-\definefontsynonym [SansCaps] [unknown]
-
-\definefontsynonym [Mono] [unknown]
-\definefontsynonym [MonoBold] [unknown]
-\definefontsynonym [MonoItalic] [unknown]
-\definefontsynonym [MonoSlanted] [unknown]
-\definefontsynonym [MonoBoldItalic] [unknown]
-\definefontsynonym [MonoBoldSlanted] [unknown]
-\definefontsynonym [MonoCaps] [unknown]
-
-\definefontsynonym [MathRoman] [unknown]
-\definefontsynonym [MathExtension] [unknown]
-\definefontsynonym [MathItalic] [unknown]
-\definefontsynonym [MathSymbol] [unknown]
-
-\definefontsynonym [MathNoName] [unknown]
-
-\definefontsynonym [MathAlpha] [unknown]
-\definefontsynonym [MathBeta] [unknown]
-\definefontsynonym [MathGamma] [unknown]
-\definefontsynonym [MathDelta] [unknown]
-
-\definefontsynonym [MathRomanBold] [MathRoman]
-\definefontsynonym [MathExtensionBold] [MathExtension]
-\definefontsynonym [MathItalicBold] [MathItalic]
-\definefontsynonym [MathSymbolBold] [MathSymbol]
-\definefontsynonym [MathAlphaBold] [MathAlpha]
-\definefontsynonym [MathBetaBold] [MathBeta]
-\definefontsynonym [MathGammaBold] [MathGamma]
-\definefontsynonym [MathDeltaBold] [MathDelta]
-
-\definefontsynonym [Handwriting] [unknown]
-\definefontsynonym [Calligraphic] [unknown]
-
-%D This permit us to define (use) fonts that refer to the default
-%D style (so, Bold may expand to SansBold or SerifBold, depending
-%D on the default style in the typeface).
-
-% \def\setfontsynonym[#1]#2[#3]{\setvalue{\??ff\fontclass#1}{#3}}
-%
-% \setfontsynonym[\s!Normal] [\fontstringD]
-% \setfontsynonym[\s!Bold] [\fontstringD\s!Bold]
-% \setfontsynonym[\s!Italic] [\fontstringD\s!Italic]
-% \setfontsynonym[\s!Slanted] [\fontstringD\s!Slanted]
-% \setfontsynonym[\s!BoldItalic] [\fontstringD\s!BoldItalic]
-% \setfontsynonym[\s!BoldSlanted][\fontstringD\s!BoldSlanted]
-% \setfontsynonym[\s!Caps] [\fontstringD\s!Caps]
-
-\definefontsynonym[\s!Normal] [\noexpand\fontstringD]
-\definefontsynonym[\s!Bold] [\noexpand\fontstringD\noexpand\s!Bold]
-\definefontsynonym[\s!Italic] [\noexpand\fontstringD\noexpand\s!Italic]
-\definefontsynonym[\s!Slanted] [\noexpand\fontstringD\noexpand\s!Slanted]
-\definefontsynonym[\s!BoldItalic] [\noexpand\fontstringD\noexpand\s!BoldItalic]
-\definefontsynonym[\s!BoldSlanted][\noexpand\fontstringD\noexpand\s!BoldSlanted]
-\definefontsynonym[\s!Caps] [\noexpand\fontstringD\noexpand\s!Caps]
-
-%D Also handy:
-
-\definefontsynonym [Regular] [Serif]
-\definefontsynonym [RegularBold] [SerifBold]
-\definefontsynonym [RegularItalic] [SerifItalic]
-\definefontsynonym [RegularSlanted] [SerifSlanted]
-\definefontsynonym [RegularBoldItalic] [SerifBoldItalic]
-\definefontsynonym [RegularBoldSlanted] [SerifBoldSlanted]
-\definefontsynonym [RegularCaps] [SerifCaps]
-
-\definefontsynonym [Support] [Sans]
-\definefontsynonym [SupportBold] [SansBold]
-\definefontsynonym [SupportItalic] [SansItalic]
-\definefontsynonym [SupportSlanted] [SansSlanted]
-\definefontsynonym [SupportBoldItalic] [SansBoldItalic]
-\definefontsynonym [SupportBoldSlanted] [SansBoldSlanted]
-\definefontsynonym [SupportCaps] [SansCaps]
-
-%D Well, not that good an idea:
-
-\definefontsynonym [Roman] [Serif]
-\definefontsynonym [RomanBold] [SerifBold]
-\definefontsynonym [RomanItalic] [SerifItalic]
-\definefontsynonym [RomanSlanted] [SerifSlanted]
-\definefontsynonym [RomanBoldItalic] [SerifBoldItalic]
-\definefontsynonym [RomanBoldSlanted] [SerifBoldSlanted]
-\definefontsynonym [RomanCaps] [SerifCaps]
-
-\definefontsynonym [Type] [Mono]
-\definefontsynonym [TypeBold] [MonoBold]
-\definefontsynonym [TypeItalic] [MonoItalic]
-\definefontsynonym [TypeSlanted] [MonoSlanted]
-\definefontsynonym [TypeBoldItalic] [MonoBoldItalic]
-\definefontsynonym [TypeBoldSlanted] [MonoBoldSlanted]
-\definefontsynonym [TypeCaps] [MonoCaps]
-
-%D Next we define roman, sans and monospaced font sets.
-
-\definebodyfont [default] [rm]
- [tf=Serif sa 1,
- bf=SerifBold sa 1,
- it=SerifItalic sa 1,
- sl=SerifSlanted sa 1,
- bi=SerifBoldItalic sa 1,
- bs=SerifBoldSlanted sa 1,
- sc=SerifCaps sa 1]
-
-\definebodyfont [default] [ss]
- [tf=Sans sa 1,
- bf=SansBold sa 1,
- it=SansItalic sa 1,
- sl=SansSlanted sa 1,
- bi=SansBoldItalic sa 1,
- bs=SansBoldSlanted sa 1,
- sc=SansCaps sa 1]
-
-\definebodyfont [default] [tt]
- [tf=Mono sa 1,
- bf=MonoBold sa 1,
- it=MonoItalic sa 1,
- sl=MonoSlanted sa 1,
- bi=MonoBoldItalic sa 1,
- bs=MonoBoldSlanted sa 1,
- sc=MonoCaps sa 1]
-
-\definebodyfont [default] [mm]
- [mr=MathRoman mo 1,
- ex=MathExtension mo 1,
- mi=MathItalic mo 1,
- sy=MathSymbol mo 1,
- nn=MathNoName mo 1,
- ma=MathAlpha mo 1,
- mb=MathBeta mo 1,
- mc=MathGamma mo 1,
- md=MathDelta mo 1]
-
-\definebodyfont [bfmath] [mm]
- [mrbf=MathRomanBold mo 1,
- exbf=MathExtensionBold mo 1,
- mibf=MathItalicBold mo 1,
- sybf=MathSymbolBold mo 1,
- mabf=MathAlphaBold mo 1,
- mbbf=MathBetaBold mo 1,
- mcbf=MathGammaBold mo 1,
- mdbf=MathDeltaBold mo 1]
-
-\definebodyfont [default] [hw]
- [tf=Handwriting sa 1]
-
-\definebodyfont [default] [cg]
- [tf=Calligraphy sa 1]
-
-%D These definitions come into action as soon as names are
-%D mapped onto real file names (or names that themselves are
-%D mapped).
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/font-xtx.mkii b/Master/texmf-dist/tex/context/base/mkii/font-xtx.mkii
deleted file mode 100644
index e7a6c8d80cc..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/font-xtx.mkii
+++ /dev/null
@@ -1,465 +0,0 @@
-%D \module
-%D [ file=font-xtx,
-%D version=2004.09.11,
-%D title=\CONTEXT\ Font Macros,
-%D subtitle=\XETEX\ Hacks,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\ifnum\texengine=\xetexengine
- \writestatus{loading}{ConTeXt Font Macros / XeTeX Hacks}
-\else
- \endinput
-\fi
-
-\unprotect
-
-%D Features:
-
-% \definefontfeature[default] [liga=yes,texligatures=yes,texquotes=yes]
-% \definefontfeature[default-caps][liga=yes,texligatures=yes,texquotes=yes,smcp=yes,script=latn]
-%
-% \starttypescript [serif] [palatino-nova-regular] [name]
-% \definefontsynonym[Serif] [palatinonova-regular][features=default]
-% \definefontsynonym[SerifCaps][palatinonova-regular][features=default-caps] % also sets Serif
-% \stoptypescript
-%
-% \starttypescript [serif] [palatino-nova-regular] [name]
-% \definefontsynonym[Serif] [palatinonova-regular*default]
-% \definefontsynonym[SerifCaps] [palatinonova-regular*default-caps]
-% \stoptypescript
-
-% \definetypeface[mainface][rm][serif][palatino-nova-regular][default] \setupbodyfont[mainface]
-%
-% \starttext
-% ``Test'' -- --- ff fi fl \sc ``Test'' -- --- ff fi fl
-% \stoptext
-
-% \starttext
-% \definefont
-% [blabla]
-% [name:Latin Modern Something]
-% \definefont
-% [blabla]
-% [file:texnansi-lmr10]
-% \blabla test
-% \definefont
-% [blabla]
-% [texnansi-lmtt10]
-% \blabla test
-% \stoptext
-
-\def\definefontfeature
- {\dotripleargument\dodefinefontfeature}
-
-\def\dododefinefontfeature#1%
- {\edef\!!stringa{\ifx\!!stringa\empty\else\!!stringa,\fi\executeifdefined{\??fa#1}\empty}}
-
-\def\dodefinefontfeature[#1][#2][#3]%
- {\doifassignmentelse{#2}
- {\setevalue{\??fa#1}{#2}}
- {\let\!!stringa\empty
- \processcommalist[#2]\dododefinefontfeature
- \setevalue{\??fa#1}{\ifx\!!stringa\empty\else\!!stringa,\fi#3}}}
-
-\definefontfeature
- [default]
- [liga=yes,kern=yes,tlig=yes,trep=yes] % texligatures=yes,texquotes=yes
-
-\definefontfeature
- [smallcaps]
- [liga=yes,kern=yes,tlig=yes,trep=yes,smcp=yes] % texligatures=yes,texquotes=yes
-
-\definefontfeature
- [oldstyle]
- [liga=yes,kern=yes,tlig=yes,trep=yes,onum=yes] % texligatures=yes,texquotes=yes
-
-\definefontfeature % no calt
- [arabic]
- [language=dflt,script=arab,
- init=yes,medi=yes,fina=yes,isol=yes,
- liga=yes,dlig=yes,rlig=yes,clig=yes,
- mark=yes,mkmk=yes,kern=yes,curs=yes]
-
-\definefontfeature
- [none]
- [features=no]
-
-%D Overloaded:
-
-\def\getfontfileparameters#1% can be simpler for mkii (no features)
- {\edef\@@truefontname{\truefontname{#1}}%
- \edef\currentfontfileencoding{\truefontdata\@@truefontname\s!encoding}%
- \edef\currentfontfilemapping {\truefontdata\@@truefontname\s!mapping }%
- \edef\currentfontfilehandling{\truefontdata\@@truefontname\s!handling}%
- \edef\currentfontfilefeatures{\truefontdata\@@truefontname\s!features}}
-
-\def\updatefontparameters
- {\edef\@@fontencoding{\truefontdata\fontfile \s!encoding}%
- \edef\@@fontmapping {\truefontdata\fontfile \s!mapping }%
- \edef\@@fonthandling{\truefontdata\somefontname\s!handling}%
- \edef\@@fontfeatures{\truefontdata\fontfile \s!features}%
- \edef\@@fontskewchar{\truefontdata\fontfile \s!skewchar}}
-
-%D Loading:
-%D
-%D for some reason xetex does not support [filename] for tfm files and
-%D quotes also behave kind of strange " vs ' vs [ vs ...
-%D
-%D \starttyping
-%D \font\myfont = msam7 % ok
-%D \font\myfont = "msam7" % also ok
-%D \font\myfont = "msam7" at 8pt % error
-%D \stoptyping
-
-\newconditional\tracexetexfonts
-
-%D Because \XETEX\ is not that fast on locating fonts we cache lookups so
-%D that we minimize the test. It saves a little bit of runtime, depending
-%D on the number of fonts loaded (which is normally not that much).
-
-\def\doiffoundXTXfontelse#1#2%
- {\ifcsname xtx@fnt@#2\somefontspec\endcsname
- \ifconditional\tracexetexfonts
- \writestatus\m!fonts{already checked #1: #2\somefontspec\space (state: \number\csname xtx@fnt@#2\somefontspec\endcsname)}%
- \fi
- \else
- \suppressfontnotfounderror\plusone
- \font\xetextempfont=#2\somefontspec\relax
- \suppressfontnotfounderror\zerocount
- \edef\xetextempfont{\fontname\xetextempfont}%
- \global\expandafter\chardef\csname xtx@fnt@#2\somefontspec\endcsname
- \ifx\xetextempfont\nullfontname
- \zerocount \ifconditional\tracexetexfonts
- \writestatus\m!fonts{not found #1: #2\somefontspec}%
- \fi
- \else
- \plusone \ifconditional\tracexetexfonts
- \writestatus\m!fonts{found #1: #2\somefontspec}%
- \fi
- \fi
- \fi
- \ifcase\csname xtx@fnt@#2\somefontspec\endcsname
- \expandafter\secondoftwoarguments
- \else
- \expandafter\firstoftwoarguments
- \fi}
-
-\def\docheckfontfilenameprefix#1:#2:#3#4\relax
- {\edef\!!stringa{#1}%
- \edef\!!stringb{#2}%
- \ifx\!!stringb\empty
- % no prefix
- \let\checkedfontfile\!!stringa
- \doiffoundXTXfontelse{1a}{\checkedfontfile\checkedfontfeatures}
- {\edef\checkedfontfile{\checkedfontfile\checkedfontfeatures}}
- {\doiffoundXTXfontelse{1b}{"\checkedfontfile\checkedfontfeatures"}
- {\edef\checkedfontfile{"\checkedfontfile\checkedfontfeatures"}}
- {\doiffoundXTXfontelse{1c}{"[\checkedfontfile]\checkedfontfeatures"}
- {\edef\checkedfontfile{"[\checkedfontfile]\checkedfontfeatures"}}
- {}}}%
- \else\ifx\!!stringa\v!file
- % force file, only file check when no spaces
- \let\checkedfontfile\!!stringb
- \doiffoundXTXfontelse{2a}{"[\checkedfontfile]\checkedfontfeatures"}
- {\edef\checkedfontfile{"[\checkedfontfile]\checkedfontfeatures"}}
- {\doiffoundXTXfontelse{2b}{"\checkedfontfile\checkedfontfeatures"}
- {\edef\checkedfontfile{"\checkedfontfile\checkedfontfeatures"}}
- {}}%
- \else\ifx\!!stringa\v!name
- % force name, always lookup by xetex itself, "" forces otf/ttf/type1
- \edef\checkedfontfile{"\!!stringb\checkedfontfeatures"}%
- \ifconditional\tracexetexfonts
- \writestatus\m!fonts{no checking 3a: \checkedfontfile}%
- \fi
- \else
- % whatever, maybe even xetex spec, forget about features
- \edef\checkedfontfile{"\!!stringa\!!stringb"}%
- \ifconditional\tracexetexfonts
- \writestatus\m!fonts{no checking 3b: \checkedfontfile}%
- \fi
- \fi\fi\fi}
-
-\newconditional\enabledfontfeatures
-
-\def\checkfontfilename% -- todo: integrate so that we call do.. directly
- {\expandafter\docheckfontfilename\fontfile*\empty*\relax}
-
-\def\docheckfontfilename#1*#2#3*#4\relax % class overrules file
- {\settrue\enabledfontfeatures
- \edef\checkedfontfeatures
- {\expandafter\ifx\csname\fontclass\s!features\endcsname\empty
- \ifx\@@fontfeatures\empty\ifx#2\empty\else#2#3\fi\else\@@fontfeatures\fi
- \else\expandafter\ifx\csname\fontclass\s!features\endcsname\relax % redundant, will go away
- \ifx\@@fontfeatures\empty\ifx#2\empty\else#2#3\fi\else\@@fontfeatures\fi
- \else
- \csname\fontclass\s!features\endcsname
- \fi\fi}%
- \ifx\checkedfontfeatures\empty
- % done
- \else
- \edef\checkedfontfeatures{\executeifdefined{\??fa\checkedfontfeatures}\empty}%
- \ifx\checkedfontfeatures\empty
- % done
- \else
- \let\convertedfontfeatures\empty
- \processcommacommand[\checkedfontfeatures]\doconvertfontfeatures % raw
- \ifx\convertedfontfeatures\empty
- \let\checkedfontfeatures\empty
- \else\ifconditional\enabledfontfeatures
- \edef\checkedfontfeatures{:\convertedfontfeatures}%
- \else
- \let\checkedfontfeatures\empty
- \fi\fi
- \fi
- \fi
- \docheckfontfilenameprefix#1:\empty:\empty\relax
- \doshowcheckedfontfeatures}
-
-\edef\@@fontfeaturesareno {features\v!no}
-\edef\@@fontfeaturesareoff{features\v!off}
-
-\def\dodoconvertfontfeatures#1=#2#3=#4\relax
- {\ifx#2\empty
- % invalid feature
- \else\ifcsname @xtx@#1@#2#3\endcsname
- \expandafter\ifx\csname @xtx@#1@#2#3\endcsname\empty\else
- \edef\convertedfontfeatures{\convertedfontfeatures\csname @xtx@#1@#2#3\endcsname;}%
- \fi
- \else
- \edef\!!stringa{#1}%
- \edef\!!stringb{#2#3}%
- \edef\!!stringc{#1#2#3}%
- \ifx\!!stringc\@@fontfeaturesareoff
- \setfalse\enabledfontfeatures
- \else\ifx\!!stringc\@@fontfeaturesareno
- \setfalse\enabledfontfeatures
- \else
- \edef\convertedfontfeatures
- {\convertedfontfeatures
- \ifx\!!stringb\v!yes
- +\!!stringa
- \else\ifx\!!stringb\v!on
- +\!!stringa
- \else\ifx\!!stringb\v!no
- -\!!stringa
- \else\ifx\!!stringb\v!off
- -\!!stringa
- \else
- \!!stringa=\!!stringb
- \fi\fi\fi\fi;}%
- \fi\fi
- \fi\fi}
-
-\def\doconvertfontfeatures#1%
- {\dodoconvertfontfeatures#1=\empty=\relax}
-
-\def\remapfontfeature #1 #2 #3 {\setevalue{@xtx@#1@#2}{#3}}
-
-% this may move to another file, maybe font-xtx
-
-\remapfontfeature tlig yes mapping=tlig
-%remapfontfeature tlig no mapping=
-\remapfontfeature trep yes {}
-\remapfontfeature trep no {}
-\remapfontfeature texligatures yes mapping=tlig
-%remapfontfeature texligatures no mapping=
-%remapfontfeature texquotes yes mapping=tex-text
-%remapfontfeature texquotes no mapping=
-
-%D Variants:
-
-\unexpanded\def\variant[#1]%
- {\dosetscaledfont
- \font\variantfont\truefontname{\fontstringA\fontstylesuffix\fontvariant\fontstringA{#1}} at \scaledfont
- \variantfont}
-
-%D Possible optimizations:
-
-% \def\updatefontparameters
-% {\edef\@@fontfeatures{\truefontdata\fontfile\s!features}%
-% \edef\@@fontskewchar{\truefontdata\fontfile\s!skewchar}}
-
-% \def\setfontcharacteristics
-% {\updatefontparameters % redundant, will go away, faster too
-% \the\everyfont}
-
-% \let\synchronizepatternswithfont\relax
-
-%D Names:
-
-% We need to move the feature into the filename else it may be
-% overloaded by another reference. For instance the definition of
-% a regular and caps variant can use the same font.
-
-% We could use an indirect method ... store in 'array' and refer to
-% slot.
-
-\def\definefontsynonym[#1]#2[#3]%
- {\edef\@@fontname{#1}%
- \edef\@@fontfile{#3}%
- \doifnextoptionalelse\dodefinefontsynonym\nodefinefontsynonym}
-
-\def\nodefinefontsynonym
- {\@EA\let\csname\??ff\fontclass\@@fontname\endcsname\@@fontfile
-% \@EA\let\csname\??ff\@@fontfile\s!features\endcsname\undefined
-}
-
-\def\dodefinefontsynonym[#1]%
- {\edef\@@fontdata{#1}%
- \ifx\@@fontdata\empty
- \nodefinefontsynonym
- \else
- \ifx\fontclass\empty
- \getfontparameters
- \else
- \getglobalfontparameters
- \fi
- \ifcsname\??ff\@@fontfile\s!features\endcsname
- \@EA\edef\csname\??ff\fontclass\@@fontname\endcsname{\@@fontfile*\csname\??ff\@@fontfile\s!features\endcsname}%
- \@EA\let\csname\??ff\@@fontfile\s!features\endcsname\undefined
- \else
- \nodefinefontsynonym
- \fi
- \fi}
-
-\let\definefontfile\definefontsynonym % dedicated to Taco Hoekwater
-
-% simple version
-%
-% \def\truefontname#1%
-% {\@EA\dotruefontname#1*\relax}
-%
-% \def\dotruefontname#1*#2\relax
-% {\ifcsname\??ff\fontclass#1\endcsname
-% \@EA\truefontname\csname\??ff\fontclass#1\endcsname
-% \else\ifcsname\??ff#1\endcsname
-% \@EA\truefontname\csname\??ff#1\endcsname
-% \else
-% #1%
-% \fi\fi}
-%
-% last counts
-%
-% \def\truefontname#1%
-% {\@EA\dotruefontname#1*\empty*\relax}
-%
-% \def\dotruefontname#1*#2#3*#4\relax
-% {\ifcsname\??ff\fontclass#1\endcsname
-% \ifx#2\empty
-% \@EA\truefontname\csname\??ff\fontclass#1\endcsname
-% \else
-% \@EA\truefontname\csname\??ff\fontclass#1\endcsname*#2#3%
-% \fi
-% \else\ifcsname\??ff#1\endcsname
-% \ifx#2\empty
-% \@EA\truefontname\csname\??ff#1\endcsname
-% \else
-% \@EA\truefontname\csname\??ff#1\endcsname*#2#3%
-% \fi
-% \else
-% \ifx#2\empty
-% #1%
-% \else
-% #1*#2#3%
-% \fi
-% \fi\fi}
-%
-% first counts
-
-\def\truefontname#1%
- {\@EA\dotruefontname#1*\empty*\relax}
-
-\def\dotruefontname#1*#2#3*#4\relax
- {\ifcsname\??ff\fontclass#1\endcsname
- \ifx#2\empty
- \@EA\truefontname\csname\??ff\fontclass#1\endcsname
- \else
- \@EA\redotruefontname\csname\??ff\fontclass#1\endcsname*#2#3%
- \fi
- \else\ifcsname\??ff#1\endcsname
- \ifx#2\empty
- \@EA\truefontname\csname\??ff#1\endcsname
- \else
- \@EA\redotruefontname\csname\??ff#1\endcsname*#2#3%
- \fi
- \else
- #1\ifx#2\empty\else*#2#3\fi
- \fi\fi}
-
-\def\redotruefontname#1%
- {\@EA\dodotruefontname#1*\relax}
-
-\def\dodotruefontname#1*#2\relax
- {\ifcsname\??ff\fontclass#1\endcsname
- \@EA\redotruefontname\csname\??ff\fontclass#1\endcsname
- \else\ifcsname\??ff#1\endcsname
- \@EA\redotruefontname\csname\??ff#1\endcsname
- \else
- #1%
- \fi\fi}
-
-%D Default:
-
-\def\defaultfontfile{file:lmmono10-regular}
-
-%D Maybe:
-
-% \def\updatefontparameters
-% {\edef\@@fontfeatures{\truefontdata\fontfile \s!features}%
-% \edef\@@fontskewchar{\truefontdata\fontfile \s!skewchar}}
-
-% \def\setfontcharacteristics
-% {%\updatefontparameters % redundant, will go away, faster too
-% \the\everyfont
-% \synchronizepatternswithfont}
-
-\protect \endinput
-
-% \starttypescript[serif] [myzhfont]
-% \definefontsynonym [Serif] [file:SimSun]
-% \definefontsynonym [SerifBold] [file:SimSun]
-% \definefontsynonym [SerifItalic] [file:SimSun]
-% \definefontsynonym [SerifBoldItalic] [file:SimSun]
-% \stoptypescript
-% \starttypescript[sans] [myzhfont]
-% \definefontsynonym [Sans] [file:SimSun]
-% \definefontsynonym [SansBold] [file:SimSun]
-% \definefontsynonym [SansItalic] [file:SimSun]
-% \definefontsynonym [SansBoldItalic] [file:SimSun]
-% \stoptypescript
-% \starttypescript[mono] [myzhfont]
-% \definefontsynonym [Mono] [file:SimSun]
-% \definefontsynonym [MonoBold] [file:SimSun]
-% \definefontsynonym [MonoItalic] [file:SimSun]
-% \definefontsynonym [MonoBoldItalic] [file:SimSun]
-% \stoptypescript
-% \definetypeface [myzhfont] [rm] [serif][myzhfont] [default]
-% \definetypeface [myzhfont] [ss] [sans] [myzhfont] [default]
-% \definetypeface [myzhfont] [tt] [mono] [myzhfont] [default]
-
-% \starttext
-% % on windows: make sure fonts.conf has no cache mentioned
-% %
-% % 64 sec xetex, 11 sec luatex (56 sec xetex when \nobigmath)
-% %
-% \setupbodyfont[myzhfont] \dorecurse{10000}{{hello {\switchtobodyfont[myzhfont] 你好}}\par}
-% %
-% % 67 sec xetex, 11.5 sec luatex
-% %
-% % \dorecurse{10000}{{hello {\switchtobodyfont[myzhfont] 你好}}\par}
-% %
-% % 5 sec xetex, 7 sec luatex
-% %
-% % \setupbodyfont[myzhfont] \dorecurse{10000}{{hello {你好}}\par}
-% %
-% % 5 sec xetex, 7 sec luatex
-% %
-% % \setupbodyfont[myzhfont] \dorecurse{10000}{{\bf hello {你好}}\par}
-% \stoptext
-
diff --git a/Master/texmf-dist/tex/context/base/mkii/grph-fig.mkii b/Master/texmf-dist/tex/context/base/mkii/grph-fig.mkii
deleted file mode 100644
index c488ccc4f6c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/grph-fig.mkii
+++ /dev/null
@@ -1,559 +0,0 @@
-%D \module
-%D [ file=grph-fig,
-%D version=2006.08.26, % overhaul of 1997.03.31
-%D title=\CONTEXT\ Graphic Macros,
-%D subtitle=Figure Inclusion,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Graphic Macros / Figure Handling}
-
-\unprotect
-
-\def\setupexternalfigures
- {\dosingleempty\dosetupexternalfigures}
-
-\def\dosetupexternalfigures[#1]%
- {\getparameters[\??ef][#1]% local settings
- \getparameters[\??ex][#1]% global settings
- \setfigurepathlist} % the path may be used elsewhere too (as in x-res-04)
-
-\presetlocalframed[\??ef]
-
-\newconditional\externalfigurelevel % true=background false=normal
-\newconditional\externalfigureflush % true=place false=ignore
-
-\setfalse\externalfigurelevel
-\settrue \externalfigureflush
-
-\def\doplaceexternalfigure[#1][#2][#3][#4][#5]%
- {\doifsomething{#2}% catches \defineexternalfigure dummies
- {\doifundefinedelse{\??ef\??ef#2}
- {\dodoplaceexternalfigure[#1][#2][#3][#4][#5]}
- {\doifelse{#1}{#2}
- {\dodoplaceexternalfigure[#1][#2][#3][#4][#5]}
- {\getvalue{\??ef\??ef#2}[#5]}}}}
-
-\def\dodoplaceexternalfigure[#1][#2][#3][#4][#5]%
- {\bgroup
- \pushmacro\textunderscore
- \edef\textunderscore{\string_}% brrr, temp hack, still needed?
- \calculateexternalfigure [][#1][#2][#3][#4][#5]% [] is dummy dwcomp
- \calculateexternalscreenfigure[][#1][#2][#3][#4][#5]% [] is dummy dwcomp
- \popmacro\textunderscore
- \box\foundexternalfigure
- \egroup}
-
-\def\externalfigurereplacement#1#2#3%
- {\setupcolors
- [\c!state=\v!local]%
- \expanded{\localframed
- [\??ef]
- [\c!width=\figurewidth,
- \c!height=\figureheight,
- \c!background=\v!screen,
- \c!backgroundscreen=.8,
- \c!frame=\@@efframe]}%
- {\tt\tfxx \nohyphens
- name: \expanded{\verbatimstring{#1}}\\%
- file: \expanded{\verbatimstring{#2}}\\%
- state: \expanded{\verbatimstring{#3}}}}
-
-\def\externalfigureplaceholder#1#2#3%
- {\localframed
- [\??ef]
- [\c!width=#2,
- \c!height=#3,
- \c!frame=\v!on]%
- {\tt\tfxx \nohyphens
- name: \expanded{\verbatimstring{#1}}\\%
- state: \expanded{\verbatimstring{placeholder}}}}
-
-% new: more convenient/efficient than
-%
-% \use..[a][a][setting] \externalfigure[b][a]
-%
-% is equivalent to:
-%
-% \def..[a][setting] \externalfigure[b][a]
-%
-% see x-res modules for usage:
-%
-% \defineexternalfigure[name][settings]
-
-\def\defineexternalfigure
- {\dodoubleargument\dodefineexternalfigure}
-
-\def\dodefineexternalfigure[#1][#2]%
- {\setvalue{\??ef\??ef#1}{\doplaceexternalfigure[#1][][][#2]}}
-
-\def\getexternalfigure#1% efef has 4 args already and take an 5th
- {\wait} % OBSOLETE
-
-% \useexternalfigure[alpha][koe]
-% \useexternalfigure[beta] [koe] [breedte=1cm]
-% \useexternalfigure[gamma][koe][alpha]
-% \useexternalfigure[delta][koe][alpha][breedte=2cm]
-%
-% volle breedte: \externalfigure[koe] \par
-% 3cm breed: \externalfigure[koe] [breedte=3cm] \par
-% volle breedte: \externalfigure[alpha] \par
-% 1cm breed: \externalfigure[beta] \par
-% volle breedte: \externalfigure[gamma] \par
-% 2cm breed: \externalfigure[delta] \par
-% 4cm breed: \externalfigure[beta] [breedte=4cm] \par
-% 5cm breed: \externalfigure[gamma][breedte=5cm] \par
-
-% \defineexternalfigure[a][width=10cm]
-% \defineexternalfigure[b][width=5cm]
-% \externalfigure[cow][a]
-% \externalfigure[cow][b][height=8cm]
-
-% \useexternalfigure[x][cow][width=10cm,height=1cm]
-% \externalfigure[x]
-% \externalfigure[x][width=3cm]
-
-\def\useexternalfigure
- {\doquadrupleempty\douseexternalfigure}
-
-% [label] [filename]
-% [label] [filename] [parent]
-% [label] [filename] [parent] [settings]
-% [label] [filename] [settings]
-
-\def\useexternalfigure
- {\doquadrupleempty\douseexternalfigure}
-
-\def\douseexternalfigure[#1][#2][#3][#4]%
- {\doifelsenothing{#1}
- {\doifsomething{#2}
- {\doifassignmentelse{#3}
- {\setvalue{\??ef\??ef#2}{\doplaceexternalfigure[#2][#2][#3][#4]}}
- {\setvalue{\??ef\??ef#2}{\doplaceexternalfigure[#2][#2][][#4]}}}}
- {\doifelsenothing{#2}
- {\doifassignmentelse{#3}
- {\setvalue{\??ef\??ef#1}{\doplaceexternalfigure[#1][#1][][#3]}}
- {\setvalue{\??ef\??ef#1}{\doplaceexternalfigure[#1][#1][#3][#4]}}}
- {\doifassignmentelse{#3}
- {\setvalue{\??ef\??ef#1}{\doplaceexternalfigure[#1][#2][][#3]}}
- {\setvalue{\??ef\??ef#1}{\doplaceexternalfigure[#1][#2][#3][#4]}}}}}
-
-\def\dosetefparameters#1#2#3% parent_id use_settings current_settings
- {\doifelsenothing{#1} % inherit from parent
- {\getparameters[\??ef][#2,#3]}
- {\doifdefinedelse{\??ef\??ef#1}
- {\pushmacro\doplaceexternalfigure
- \def\doplaceexternalfigure[##1][##2][##3][##4]{\getparameters[\??ef][##4,#2,#3]}%
- \getvalue{\??ef\??ef#1}%
- \popmacro\doplaceexternalfigure}
- {\getparameters[\??ef][#2,#3]}}}
-
-\unexpanded\def\externalfigure
- {\dotripleempty\doexternalfigure}
-
-\def\doexternalfigure[#1][#2][#3]% [label][file][settings] | [file][settings] | [file][parent][settings]
- {\bgroup
- \doifelsenothing{#1}
- {\framed[\c!width=\defaultfigurewidth,\c!height=\defaultfigureheight]{external\\figure\\no name}}
- {\doifundefinedelse{\??ef\??ef#1}
- {\useexternalfigure[\s!dummy][#1][#2][#3]%
- \getvalue{\??ef\??ef\s!dummy}[]} % [] is dummy arg 5
- {\doifassignmentelse{#2}
- {\getvalue{\??ef\??ef#1}[#2]}%
- {\getvalue{\??ef\??ef#1}[#3]}}}%
- \globallet\currentresourcecomment\empty
- \egroup}
-
-\long\def\resourcecomment#1%
- {\long\gdef\currentresourcecomment{#1}}
-
-\long\def\startresourcecomment#1\stopresourcecomment
- {\long\gdef\currentresourcecomment{#1}}
-
-\let\currentresourcecomment\empty
-
-\def\showexternalfigures % maybe run time command is better, but no core-run, unless figs-run ...
- {%\writestatus\m!systems{for \string\showexternalfigures\space see \truefilename{x-res-20}.tex}
- \usemodule[res-20]\showexternalfigures} % so for the moment we do it this way
-
-\def\overlayfigure#1%
- {\externalfigure[#1][\c!width=\overlaywidth,\c!height=\overlayheight]}
-
-%D Still undocumented! No one uses it I think, better be done with layers.
-
-\newcount\efreference
-\newdimen\efxsteps
-\newdimen\efysteps
-
-\def\calculateefsteps
- {\ifnum0\@@exxmax=\zerocount
- \ifnum0\@@exymax=\zerocount
- \def\@@exymax{24}%
- \fi
- \efysteps\figureheight \divide\efysteps \@@exymax
- \efxsteps\efysteps
- \dimen0=\figurewidth
- \advance\dimen0 \efysteps
- \divide \dimen0 \efysteps
- \edef\@@exxmax{\number\dimen0}%
- \else
- \efxsteps\figurewidth \divide\efxsteps \@@exxmax
- \efysteps\figureheight \divide\efysteps \@@exymax
- \fi}
-
-\def\efcomment#1(#2,#3)#4(#5,#6)% {kader}(x,y)(h,b)[...]{tekst}
- {\def\complexefdocomment[##1]##2%
- {\position(#2,#3)%
- {\setnostrut
- \framed
- [\c!width=#5\efxsteps,
- \c!height=#6\exysteps,
- \c!offset=\v!none,
- \c!frame=#1,
- ##1]%
- {##2}}}%
- \complexorsimpleempty\efdocomment}
-
-\def\efnocomment(#1,#2)#3(#4,#5)% (x,y)(h,b)[...]{tekst}
- {\def\complexefdonocomment[##1]##2{}%
- \complexorsimpleempty\efdonocomment}
-
-\def\efdomarker(#1,#2)#3#4% (h,b){kader}{tekst}
- {\framed
- [\c!width=#1\efxsteps,
- \c!height=#2\efysteps,
- \c!offset=\v!none,
- \c!frame=#3]%
- {#4}}
-
-\def\effigure#1%
- {\position(0,0){\getvalue{#1}}}
-
-\def\efdoarea(#1,#2)#3#4% (h,b){kader}{tekst}
- {\bgroup
- \setnostrut
- \framed
- [\c!width=#1\efxsteps,
- \c!height=#2\efysteps,
- \c!offset=\!!zeropoint,
- \c!frame=#3]
- {#4}%
- \egroup}
-
-\def\efgoto(#1,#2)#3[#4]% (h,b)kader[ref]
- {\setbox0=\vbox{\efdoarea(#1,#2)#3{}}%
- \gotobox{\copy0}[#4]}
-
-\def\efmark(#1,#2)#3(#4,#5)#6[#7]%
- {\advance\efreference \plusone
- \position(#1,#2)
- {\hbox{\the\efreference}}%
- \position(#1,#2)
- {\gotosomeinternal\s!vwb{#7}\realfolio
- {\efdomarker(#4,#5)\v!on{\thisissomeinternal\s!vwa{#7}}}}}
-
-\def\eftext#1(#2,#3)#4(#5,#6)#7[#8]%
- {\advance\efreference \plusone
- \hbox
- {\quad
- \thisissomeinternal\s!vwb{#8}%
- \gotosomeinternal \s!vwa{#8}\realfolio
- {\hbox to 1.5em{\the\efreference\presetgoto\hfill}}%
- \quad#1 (#2,#3) (#5,#6) [#8]\hfill}%
- \endgraf}
-
-\def\efthisis(#1,#2)#3[#4]%
- {\efdoarea(#1,#2){#3}{\pagereference[#4]}}
-
-\newbox\colorbarbox
-
-\def\makecolorbar[#1]%
- {\def\docommand##1%
- {\color[##1]
- {\blackrule
- [\c!width=2em,
- \c!height=1ex,
- \c!depth=\!!zeropoint]}%
- \endgraf}%
- \global\setbox\colorbarbox\vbox
- {\forgetall
- \processcommalist[#1]\docommand}%
- \global\setbox\colorbarbox\vbox
- {\hskip2em\box\colorbarbox}%
- \wd\colorbarbox\zeropoint}
-
-\def\placestartfigure[#1][#2][#3]#4\placestopfigure[#5]%
- {\hbox
- {\setbox0\hbox
- {\useexternalfigure[\s!dummy][#2][#3,#5]%
- \externalfigure[\s!dummy]}%
- \calculateefsteps
- \startpositioning
- \def\referring(##1,##2)##3(##4,##5)##6[##7]%
- {\position(##1,##2){\efgoto(##4,##5){\@@exframes}[##7]}}%
- \def\marking(##1,##2)##3(##4,##5)##6[##7]%
- {\position(##1,##2){\efthisis(##4,##5){\@@exframes}[##7]}}%
- \def\remark{\efnocomment}%
- \def\colorbar##1[##2]{}%
- \position(0,0){\box0}%
- \linewidth\onepoint
- \setuppositioning
- [\c!unit=pt,
- \c!xscale=\withoutpt\the\efxsteps,
- \c!yscale=\withoutpt\the\efysteps,
- \c!factor=1]%
- \ignorespaces#4%
- \def\referring(##1,##2)##3(##4,##5)##6[##7]%
- {}%
- \let\marking\referring
- \def\remark{\efcomment\v!no}%
- \def\colorbar##1[##2]{\makecolorbar[##2]}%
- \ignorespaces#4%
- \stoppositioning
- \box\colorbarbox}}
-
-\def\dodostartfigure[#1][#2][#3]#4\stopfigure
- {\doifelse\v!test\@@exoption
- {\teststartfigure[#1][#2][#3]#4\teststopfigure
- \let\@@exframes\v!on}
- {\let\@@exframes\v!off}%
- \setvalue{\??ef\??ef#1}%
- {\dosingleempty{\placestartfigure[#1][#2][#3]#4\placestopfigure}}%
- }% no longer \doifundefined{#1}{\setvalue{#1}{\getexternalfigure{#1}}}}
-
-% De onderstaande macro mag niet zondermeer worden aangepast
-% en is afgestemd op gebruik in de handleiding.
-
-\def\teststartfigure[#1][#2][#3]#4\teststopfigure%
- {\begingroup
- \setbox0\hbox
- {\useexternalfigure[\s!dummy][#2][\c!wfactor=\v!max]%
- \externalfigure[\s!dummy]}%
- \def\referring{\efmark}%
- \def\marking{\efmark}%
- \def\remark{\efcomment\v!yes}%
- \def\colorbar##1[##2]{}%
- \efreference\zerocount
- \setbox0\vbox
- {\hsize240pt
- \startpositioning
- \calculateefsteps
- \position(0,0)
- {\box0}%
- \position(0,0)
- {\basegrid
- [\c!nx=\@@exxmax,
- \c!dx=\withoutpt\the\efxsteps,
- \c!ny=\@@exymax,
- \c!dy=\withoutpt\the\efysteps,
- \c!xstep=1,
- \c!ystep=1,
- \c!scale=1,
- \c!offset=\v!no,
- \c!unit=pt]}%
- \setuppositioning
- [\c!unit=pt,
- \c!xscale=\withoutpt\the\efxsteps,
- \c!yscale=\withoutpt\the\efysteps,
- \c!factor=1]%
- \linewidth\onepoint
- \ignorespaces#4\relax
- \stoppositioning
- \vfill}%
- \efreference\zerocount
- \def\referring{\eftext{$\rightarrow$}}%
- \def\marking{\eftext{$\leftarrow$}}%
- \def\remark{\efnocomment}%
- \def\colorbar##1[##2]{}%
- \setbox2\vbox
- {{\tfa\doifelsenothing{#1}{#2}{#1}}
- \blank
- \tfxx#4
- \vfilll}%
- \ifdim\ht0>\ht2
- \ht2\ht0
- \else
- \ht0\ht2
- \fi
- \hbox
- {\hskip3em
- \vtop{\vskip12pt\box0\vskip6pt}%
- \vtop{\vskip12pt\box2\vskip6pt}}%
- \endgroup}
-
-\def\dodostartfigure[#1][#2][#3]#4\stopfigure
- {\doifelse\v!test\@@exoption
- {\teststartfigure[#1][#2][#3]#4\teststopfigure
- \let\@@exframe\v!on}
- {\let\@@exframe\v!off}%
- \setvalue{\??ef\??ef#1}%
- {\def\next{\placestartfigure[#1][#2][#3]#4\placestopfigure}%
- \dosingleempty\next}%
- }% no longer: \doifundefined{#1}{\setvalue{#1}{\getexternalfigure{#1}}}}
-
-\long\def\dostartfigure#1%
- {\dotripleargument\dodostartfigure#1\stopfigure}
-
-\def\startfigure
- {\grabuntil{\e!stop\v!figure}\dostartfigure}
-
-%D defining sound tracks:
-%D
-%D \starttyping
-%D \useexternalsoundtrack[label][file]
-%D \stoptyping
-%D
-%D associated actions: StartSound StopSound PauseSound ResumeSound
-%D
-%D Todo: like external figures, also search on path,
-%D although, they need to be present ar viewing time, so ...
-
-\def\useexternalsoundtrack
- {\dodoubleargument\douseexternalsoundtrack}
-
-\def\douseexternalsoundtrack[#1][#2]%
- {\setgvalue{\??sd:#1}{#2}}
-
-\def\checksoundtrack#1%
- {\iflocation
- \doifdefined{\??sd:#1}{\doifvaluesomething{\??sd:#1}
- {\doinsertsoundtrack{\getvalue{\??sd:#1}}{#1}\@@sdoption
- % brr, \..empty not really needed and maybe even wrong;
- % also, not here but in driver
- % well, no: sounds need to be reinitialize each time (i.e., be on page), so no
- }}% \letgvalueempty{\??sd:#1}}}%
- \fi}
-
-\setexecutecommandcheck {startsound} \checksoundtrack
-
-\def\setupexternalsoundtracks
- {\dodoubleargument\getparameters[\??sd]}
-
-\setupexternalsoundtracks
- [\c!option=]
-
-%D NEW: used in styledesign manual
-
-% \setbuffer[typeset-b]\endbuffer
-% \setbuffer[typeset-a]\endbuffer
-%
-% todo:
-%
-% \appendtoks \setbuffer[typeset-b]\endbuffer\to \everystarttext
-% \appendtoks \setbuffer[typeset-a]\endbuffer\to \everystarttext
-
-\def\typesetbuffer
- {\dodoubleempty\dotypesetbuffer}
-
-\newcounter\noftypesetbuffers % all loaded at the end
-
-\defineexternalfigure
- [typeset]
- [\c!background=\v!color,
- \c!backgroundcolor=\s!white]
-
-\def\dotypesetbuffer[#1][#2]% beware: this will mix up the mp graphics
- {\bgroup
- \def\TEXbufferfile##1{\bufferprefix##1.tex}%
- \expanded{\setbuffer[typeset]%
- \def\noexpand\bufferprefix{\ifprotectbuffers\jobname-\fi typeset-}}%
- \starttext
- \getbuffer[b,#1,a]%
- \stoptext
- \endbuffer
- \doglobal\increment\noftypesetbuffers
- % batch is needed
- \executesystemcommand{texmfstart texexec --batch --pdf --result=\bufferprefix typeset-\noftypesetbuffers\space \bufferprefix typeset.tex}%
- %\externalfigure[\bufferprefix typeset-\noftypesetbuffers.pdf][\c!object=\v!no,#2]%
- \externalfigure[\bufferprefix typeset-\noftypesetbuffers.pdf][#2]%
- \egroup}
-
-% for me only (manuals and such)
-
-\definesystemvariable{tz}
-
-\def\definetypesetting{\dotripleempty\dodefinetypesetting}
-\def\typesetfile {\dotripleempty\dotypesetfile}
-
-\def\dodefinetypesetting[#1][#2][#3]%
- {\doifsomething{#1}{\setvalue{\??tz#1}{\dodotypesetfile{#2}{#3}}}}
-
-\def\dotypesetfile[#1][#2][#3]%
- {\executeifdefined{\??tz#1}\gobbletwoarguments{#2}{#3}}
-
-\def\dodotypesetfile#1#2#3#4% args settings file settings
- {\doifmode{*\v!first}{\executesystemcommand{texmfstart texexec.pl --batch --pdf #1 #3}}%
- \doglobal\beforesplitstring#3\at.\to\typesetfilename
- \externalfigure[\typesetfilename.pdf][#2,#4]}
-
-\setupexternalfigures
- [\c!option=,
- \c!object=\v!yes, % we only check for no
- \c!reset=\v!no,
- \c!maxwidth=\@@efwidth,
- \c!maxheight=\@@efheight,
- \c!bodyfont=\bodyfontsize,
- \c!directory=,
- \c!file=\f!utilityfilename.\f!figureextension,
- \c!radius=.5\bodyfontsize,
- \c!corner=\v!rectangular,
- \c!frame=\v!off,
- \c!background=, % new
- \c!splitcolor=\s!white,
- \c!conversion=,
- \c!prefix=,
- \c!cache=,
-% \c!grid=,
- \c!equalwidth=,
- \c!equalheight=,
- \c!location={\v!local,\v!global}]
-
-\setupexternalfigures
- [\c!frames=\v!off,
- \c!ymax=24,
- \c!xmax=]
-
-\useexternalfigure
- [buffer] [\jobname] [\c!type=\v!buffer,\c!object=\v!no]
-
-\protect \endinput
-
-% alternative for positioning
-
-% \definelayer[figure][width=\overlaywidth,height=\overlayheight]
-% \defineoverlay[figure][{\directsetup{figure}\tightlayer[figure]}]
-
-% \setupcolors[state=start]
-
-% \starttext
-
-% \startsetups figure
-% \setlayerframed[figure][preset=rightbottom,x=.25\layerwidth,y=.25\layerheight]{HERE}
-% \setlayerframed[figure][preset=leftbottom, x=.15\layerwidth,y=.35\layerheight]{THERE}
-% \stopsetups
-
-% \externalfigure[cow][background={foreground,figure},width=4cm,height=8cm]
-
-% \startsetups figure
-% \setlayerframed[figure][preset=righttop,x=.25\layerwidth,y=.25\layerheight]{MORE}
-% \setlayerframed[figure][preset=middle,foregroundcolor=green]{EVEN MORE}
-% \stopsetups
-
-% \externalfigure[cow][background={foreground,figure},width=14cm,height=2cm]
-
-% \defineexternalfigure[whatever][background={foreground,figure}]
-
-% \startsetups figure
-% \setlayerframed[figure][preset=righttop,x=.25\layerwidth,y=.25\layerheight]{\red MORE}
-% \setlayerframed[figure][preset=middle,foregroundcolor=green]{EVEN MORE}
-% \stopsetups
-
-% \externalfigure[cow][whatever][width=14cm,height=4cm]
-
-% \stoptext
-
diff --git a/Master/texmf-dist/tex/context/base/mkii/grph-inc.mkii b/Master/texmf-dist/tex/context/base/mkii/grph-inc.mkii
deleted file mode 100644
index 33f11a2bc8f..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/grph-inc.mkii
+++ /dev/null
@@ -1,1243 +0,0 @@
-%D \module
-%D [ file=grph-inc, % moved from core-fig
-%D version=2006.08.26, % overhaul of 1997.03.31
-%D title=\CONTEXT\ Graphic Macros,
-%D subtitle=Figure Inclusion,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Graphic Macros / Figure Inclusion}
-
-% todo: directory : system -> \allinputpaths (so that we can \usesubpath)
-
-%D This is a reimplementation of the original module, which
-%D over time had evolved into a pretty complex whole. This
-%D was partly due to the fact that we needed to handle many
-%D formats, deal with substitute graphics, handle fallbacks
-%D and driver specifics (objects), etc. In the meantime we
-%D have more clever backends, moved away from texutil to
-%D rlxtools, can use runtime or betweentime runs etc. Also,
-%D more memory permits a cleaner implementation. Time to
-%D move on. We can now also assume that scaling is available.
-%D
-%D Another mess that can go is the llx/lly handling since
-%D drivers now automatically can determine such things.
-
-%D Messages 3 and 5 needs to be translated!
-
-\unprotect
-
-%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
-%D specify at the user level either width and|/|or height, scale,
-%D or a factor related to the current document bodyfont size.
-%D Even better: we can also specify isometric scaling and
-%D automatically let \CONTEXT\ calculate the maximum possible
-%D dimensions. Whatever we calculate, the results will come
-%D available in the next registers.
-
-\letempty \@@DriverImageBox
-\letempty \@@DriverImageOptions
-\letempty \@@DriverImageWidth
-\letempty \@@DriverImageHeight
-\letempty \@@DriverImageFile
-\letempty \@@DriverImageLabel
-\letempty \@@DriverImageType
-\letempty \@@DriverImageMethod
-\letempty \@@DriverImagePage
-
-%D Because looking for dimensions can take many steps (locating
-%D the figure, maybe on more directories, scanning the figure
-%D on dimension, or when not found, trying to find them in the
-%D utility file, and again when not found, trying to generate
-%D such a file, and, as a last resort, trying to use the
-%D dimensions. Now when things do not work out the way we want,
-%D we can set a switch and get some information on what takes
-%D place.
-
-\newif\iftraceexternalfigures
-
-\let\traceexternalfigures\traceexternalfigurestrue
-
-\def\doshowfigurestate
- {\iftraceexternalfigures
- \expandafter\writestatus\expandafter\m!figures
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\def\doshowfiguremessage
- {\iftraceexternalfigures
- \expandafter\gobbletwoarguments
- \else
- \expandafter\showmessage\expandafter\m!figures
- \fi}
-
-%D Another switch tells \CONTEXT\ to locate and calculate a
-%D figure, but does not actually insert it. Especially when we
-%D use \PDFTEX\ this saves a lot of time on trialruns. (Keep
-%D in mind that \PDFTEX\ is both a \TEX\ pre|| and postprocessor.)
-
-\newif\ifskipexternalfigures % can be set elsewhere
-
-% \newif\ifrunutilityfile
-% \newif\ifconsultutilityfile
-%
-% Let's save two hash entries:
-
-\let\runutilityfiletrue \relax \let\runutilityfilefalse \relax
-\let\consultutilityfiletrue\relax \let\consultutilityfilefalse\relax
-
-%D Intermediate, private.
-
-\newdimen\determinedfigurewidth
-\newdimen\determinedfigureheight
-
-\let\naturalfigureheight\!!zeropoint
-\let\naturalfigurewidth \!!zeropoint
-
-\def\defaultfigurewidth {8\lineheight}
-\def\defaultfigureheight{6\lineheight}
-
-\def\defaultfigurepathsignal{(\v!default)}
-
-\def\checknaturalfiguredimensions
- {\edef\naturalfigurewidth{\the\dimexpr\ifzeropt\determinedfigurewidth
- \defaultfigurewidth \else\determinedfigurewidth \fi\relax}%
- \edef\naturalfigureheight{\the\dimexpr\ifzeropt\determinedfigureheight
- \defaultfigureheight\else\determinedfigureheight\fi\relax}}
-
-%D Locating figures. Dilemma: we do support eps and svg parsing but drivers
-%D don't always support it.
-
-\def\figuretypes{\c!mps,\c!pdf,\c!eps,\c!svg,\c!svg z,\c!png,\c!tif,jb2,\c!jpg}
-
-\def\supportedfiguretypes{\figuretypes}
-
-\def\checksupportedfiguretypes
- {\begingroup
- \global\let\supportedfiguretypes\empty
- \def\docommand##1%
- {\doiffileinsertionsupportedelse{##1}
- {\doglobal\addtocommalist{##1}\supportedfiguretypes}
- \donothing}%
- \processcommacommand[\figuretypes]\docommand
- \gdef\checksupportedfiguretypes{\let\figuretypes\supportedfiguretypes}%
- \endgroup
- \checksupportedfiguretypes}
-
-%D The next box is used to store the graphic. It's globally assigned.
-
-\newbox\foundexternalfigure
-
-\chardef\figurestatus\zerocount % nothing found
-
-\def\noffigurepages{\nofinsertpages}
-
-%D Variables.
-
-\newtoks\everyexternalfigureresets
-
-\def\resetfigurevariables
- {\the\everyexternalfigureresets}
-
-%D Example usage:
-
-\appendtoks
- \global\let\externalfigurelog\empty
-\to\everyexternalfigureresets
-
-%D Intermediate, private
-
-\def\resetprivatefigurevariables
- {\let \wantedfigurefull \empty
- \let \wantedfigurepath \empty
- \let \wantedfigurename \empty
- \let \wantedfigurebase \empty
- \let \wantedfiguretype \empty
- \let \wantedfigurefullname \empty
- \let \wantedfiguretypespec \empty
- \let \wantedfiguremethod \empty
- \let \wantedfigurepage \empty
- \let \wantedfigureoptions \empty
- \let \wantedfigureconversion\empty
- \let \wantedfigureprefix \empty
- \let \wantedfiguretypelist \figuretypes
- \let \figurepathlist \empty
- \chardef \figurestatus \zerocount
- \let \expandedfigurename \empty
- \global\let \analyzedfigurewidth \!!zeropoint % set by indentifying code
- \global\let \analyzedfigureheight \!!zeropoint % set by indentifying code
- \global\setbox\foundexternalfigure \emptybox
- \def \frozenfigurestamp {\externalfigurestamp}} % no edef
-
-\resetprivatefigurevariables
-
-\appendtoks
- \resetprivatefigurevariables
-\to\everyexternalfigureresets
-
-%D Private/public.
-
-\def\resetpublicfigurevariables
- {\let\figurewidth \!!zeropoint
- \let\figureheight \!!zeropoint
- \let\figurenaturalwidth \!!zeropoint
- \let\figurenaturalheight \!!zeropoint
- \let\figurelabel \empty
- \let\figurefileoriginal \empty
- \let\figurefileoptions \empty
- \let\figurefilename \empty
- \let\figurefiletype \empty
- \let\figurefilepage \!!zerocount
- \let\figurefileconversion\empty
- \let\figurefileprefix \empty
- \let\figurefilepath \empty
- \let\figurefilecache \empty}
-
-\resetpublicfigurevariables
-
-\appendtoks
- \resetpublicfigurevariables
-\to\everyexternalfigureresets
-
-\newcounter\figurenestinglevel
-
-\def\pushpublicfigurevariables
- {\ifcase\figurenestinglevel\else
- \doshowfigurestate{variables : push}%
- \globalpushmacro\figurewidth
- \globalpushmacro\figureheight
- \globalpushmacro\figurenaturalwidth
- \globalpushmacro\figurenaturalheight
- \globalpushmacro\figurelabel
- \globalpushmacro\figurefileoriginal
- \globalpushmacro\figurefileoptions
- \globalpushmacro\figurefilename
- \globalpushmacro\figurefiletype
- \globalpushmacro\figurefilepage
- \globalpushmacro\figurefileconversion
- \globalpushmacro\figurefileprefix
- \globalpushmacro\figurefilepath
- \globalpushmacro\figurefilecache
- \fi}
-
-\def\poppublicfigurevariables
- {\ifcase\figurenestinglevel\else
- \doshowfigurestate{variables : pop}%
- \globalpopmacro\figurefilecache
- \globalpopmacro\figurefilepath
- \globalpopmacro\figurefileprefix
- \globalpopmacro\figurefileconversion
- \globalpopmacro\figurefilepage
- \globalpopmacro\figurefiletype
- \globalpopmacro\figurefilename
- \globalpopmacro\figurefileoptions
- \globalpopmacro\figurefileoriginal
- \globalpopmacro\figurelabel
- \globalpopmacro\figurenaturalheight
- \globalpopmacro\figurenaturalwidth
- \globalpopmacro\figureheight
- \globalpopmacro\figurewidth
- \fi}
-
-\def\setpublicfigurevariables % todo: type vs typespec
- {\xdef\figurewidth {\the\wd\foundexternalfigure}%
- \xdef\figureheight {\the\ht\foundexternalfigure}%
- \xdef\figurenaturalwidth {\naturalfigurewidth}%
- \xdef\figurenaturalheight {\naturalfigureheight}%
- \xdef\figurelabel {\wantedfigurelabel}%
- \xdef\figurefilepath {\wantedfigurepath}%
- \xdef\figurefilename {\wantedfigurename}%
- \xdef\figurefiletype {\wantedfiguretypespec}%
- \xdef\figurefilepage {\wantedfigurepage}%
- \xdef\figurefileoptions {\wantedfigureoptions}%
- \xdef\figurefileconversion{\wantedfigureconversion}%
- \xdef\figurefilecache {\wantedconversioncache}%
- \xdef\figurefileprefix {\wantedconversionprefix}%
- \xdef\figurefileoriginal {\wantedconversionname}%
- \xdef\figurefullname {\wantedfigurepath/\wantedfigurename.\wantedfiguretypespec}%
- \ifcase\figurestatus
- \let\figurefiletype\empty % ?
- \fi}
-
-\def\setpublicfigurescalevariables
- {\edef\figurescalewidth {\finalscaleboxwidth }%
- \edef\figurescaleheight {\finalscaleboxheight}%
- \edef\figurescalexscale {\finalscaleboxxscale}%
- \edef\figurescaleyscale {\finalscaleboxyscale}}
-
-\def\resetpublicfigurescalevariables
- {\let\figurescalewidth \!!zeropoint
- \let\figurescaleheight \!!zeropoint
- \let\figurescalexscale \!!plusone
- \let\figurescaleyscale \!!plusone}
-
-\resetpublicfigurescalevariables
-
-\appendtoks
- \resetpublicfigurescalevariables
-\to \everyexternalfigureresets
-
-%D The next one is for instance used in symbols. Since
-%D we only need to reset some parameters, we can
-%D better use the fast alternative:
-%D
-%D \starttyping
-%D \def\resetexternalfigures
-%D {\getparameters[\??ef]
-%D [\c!option=,\c!maxwidth=,\c!maxheight=,
-%D \c!foregroundcolor=,\c!color=,
-%D %\c!conversion=,\c!prefix=,\c!splitcolor=,
-%D \c!frame=\v!off,\c!background=]}
-%D \stoptyping
-%D
-%D This one dropped the runtime of the \MAPS\ bibliography
-%D from over 110 seconds down to less than 105 seconds. The
-%D tremendously faster (but uglier) implementation is:
-
-\def\resetexternalfigures
- {\let\@@efoption \empty % \let\@@efprefix\empty
- \let\@@efmaxwidth \empty % \let\@@efcache \empty
- \let\@@efmaxheight \empty % \let\@@efframe \v!off
- \let\@@efforegroundcolor\empty
- \let\@@efcolor \empty
- \let\@@efconversion \empty
- \let\@@efbackground \empty}
-
-%D The following code will move:
-
-\appendtoks \resetexternalfigures \to \everyoverlay
-\appendtoks \resetexternalfigures \to \everybeforepagebody % not really needed
-%appendtoks \resetexternalfigures \to \everysymbol
-
-%D We need this one for bookkeeping:
-
-\newcounter\forcedMPSobject % better something \every<type>
-
-%D Features:
-
-% converted -> prefix, suffix
-% alternative -> other suffix
-% buffer -> prefix
-
-%D Still messy:
-
-\newtoks\everyfiguretypepresets
-
-\def\presetfiguretypeprocessing
- {\the\everyfiguretypepresets}
-
-\def\presetspecialfigure#1%
- {\doif\wantedfiguretype{#1}%
- {\let\@@efobject\v!no
- \let\@@efpreset\v!no
- \ifx\@@efwidth \empty\def\@@efwidth {\defaultfigurewidth }\fi
- \ifx\@@efheight\empty\def\@@efheight{\defaultfigureheight}\fi}}
-
-\appendtoks
- \presetspecialfigure\c!mov
- \presetspecialfigure\c!avi
-\to \everyfiguretypepresets
-
-\def\checkformpsfigurefiles % to be checked
- {\doif\wantedfigurename{mprun}
- {\doshowfigurestate{type check : forcing mps (mprun)}%
- \doifnotinstring{^\bufferprefix}{^\wantedfigurename}
- {\edef\wantedfigurename{\bufferprefix\wantedfigurename}}%
- \let\wantedfiguremethod \c!mps
- \let\wantedfiguretypespec\c!mps}%
- \doifnumberelse\wantedfiguretype
- {\doshowfigurestate{type check : forcing mps (number)}%
- \let\wantedfiguremethod \c!mps
- \let\wantedfiguretypespec\c!mps}
- \donothing
- \doif\wantedfiguretypespec\c!mps
- {\let\wantedfiguretypelist\wantedfiguretypespec
- \ifcase\EPSspecial\else\ifinobject\else
- \doglobal\increment\forcedMPSobject
- \edef\externalfigurestamp{\c!mps::\forcedMPSobject}%
- \let\@@efobject\v!yes
- \fi\fi}}
-
-\appendtoks
- \checkformpsfigurefiles
-\to \everyfiguretypepresets
-
-\def\checkfortexfigurefiles % to be checked (brrr: c!) / brrr: eftype
- {\doifinset\wantedfiguretype{\c!tex,\c!tmp}
- {\let\wantedfiguretypespec \wantedfiguretype}%
- \doifinset\wantedfiguretypespec{\c!tex,\c!tmp,\v!buffer}
- {\doshowfigurestate{type check : forcing tex (\wantedfiguretypespec)}%
- \let\wantedfiguretypelist\wantedfiguretypespec
- \let\wantedfiguremethod \c!tex
- \let\@@efobject\v!no
- \doifnothing\wantedfiguretype{\let\wantedfiguretype\c!tmp}%
- % there can be a non buffer \jobname.tmp (made by texexec)
- \doifnotinstring{^\bufferprefix}{^\wantedfigurename}
- {\edef\wantedfigurename{\bufferprefix\wantedfigurename}}}}
-
-\appendtoks
- \checkfortexfigurefiles
-\to \everyfiguretypepresets
-
-\def\checkforunknownfigurefiles
- {\doifnothing\wantedfiguretype
- {\dogetcommacommandelement\plusone\from\@@eftype\to\commalistelement
- \edef\wantedfigurefullname{\wantedfigurename.\commalistelement}}}
-
-\appendtoks
- \checkforunknownfigurefiles
-\to \everyfiguretypepresets
-
-% note * : this is needed because reusable graphics
-% combined with funny page aspect aspect ratio's can lead to
-% strange side effects of preceding factor=max specs. This
-% surfaced in the metafun manual, where the two side by
-% side clipped cow heads [the second one was a reused object]
-% where the second one inherited some characteristics from
-% the factor=max one some 30 pages back. Sigh.
-
-\chardef\splitexternalfigure\zerocount % 0 nosplit 1 split/yes 2 split/no
-
-\def\checkfigurecolorsettings
- {% seperation, seldom used
- \doifseparatingcolorselse
- {\let\@@efforegroundcolor\empty
- \doifelsenothing\@@efsplit
- {\chardef\splitexternalfigure\zerocount}
- {\doifcolorchannelelse\@@efsplit
- {\let\@@efobject\v!no % why?
- \chardef\splitexternalfigure\plusone}
- {\chardef\splitexternalfigure\plustwo}}}
- {\chardef\splitexternalfigure\zerocount}%
- % fake color in gray bitmaps, assumes that
- % a transparent color is used
- \doifsomething\@@efforegroundcolor
- {\def\@@efbackground{\v!foreground,\v!color}%
- \def\@@efbackgroundcolor{\@@efforegroundcolor}}%
- \doifsomething\@@efcolor
- {\doifcolorelse\@@efcolor
- {\checkpredefinedcolor[\@@efcolor]%
- \doregisterfigurecolor\@@efcolor}}%
- \donothing}
-
-\def\setextrafiguredriveroptions
- {\let\@@DriverImageOptions\empty
- \doifsomething\@@efpage {\addtocommalist\@@efpage \@@DriverImageOptions}%
- \doif \@@efpreview \v!yes{\addtocommalist\v!preview \@@DriverImageOptions}%
- \doif \@@efcontrols\v!yes{\addtocommalist\v!controls\@@DriverImageOptions}%
- \doif \@@efrepeat \v!yes{\addtocommalist\v!repeat \@@DriverImageOptions}%
- \doifinsetelse\@@efsize{mediabox,cropbox,artbox,bleedbox,trimbox}
- {\let \@@DriverImageBox \@@efsize}%
- {\doifinsetelse\@@efsize{media,crop,art,bleed,trim}
- {\edef\@@DriverImageBox{\@@efsize box}}%
- {\let \@@DriverImageBox \empty}}%
- \let\wantedfigureoptions\@@DriverImageOptions}
-
-\def\checkiffigureobjectpresent
- {\doifnot\@@efobject\v!no
- {\doifobjectssupportedelse
- {\doifobjectfoundelse{FIG}\externalfigurestamp
- {\doshowfigurestate{object found : \externalfigurestamp}%
- \getobjectdimensions{FIG}\externalfigurestamp
- \edef\frozenfigurestamp{\externalfigurestamp}%
- \xdef\analyzedfigurewidth {\the\dimexpr\objectwidth \relax}%
- \xdef\analyzedfigureheight{\the\dimexpr\objectheight\relax}%
- \setanalyzedfiguredimensions\plusone}
- {\doshowfigurestate{unknown object: \externalfigurestamp}}}
- {}}}
-
-\def\checkifknownfigureobjectpresent
- {\ifx\wantedfiguretype\empty
- \let\savedwantedfiguretype\wantedfiguretype
- \def\docommand##1%
- {\ifcase\figurestatus
- \edef\wantedfiguretype{##1}%
- \checkiffigureobjectpresent
- \fi}%
- \processcommacommand[\figuretypes]\docommand
- \ifcase\figurestatus
- \let\wantedfiguretype\savedwantedfiguretype
- \fi
- \fi}
-
-\def\checkforfigurefile
- {\ifcase\figurestatus
- \ifconditional\externalfigureflush
- \analyzefigurefiles
- \fi
- \fi}
-
-\def\externalfigurestamp % needs \edef'd macros!
- {\ifx\wantedfigurepath\empty\else
- -\wantedfigurepath
- \fi
- \wantedfigurename
- \ifx\wantedfiguretype\empty\else
- \ifx\wantedfiguretype\s!unknown\else
- -\wantedfiguretype
- \fi
- \fi
- \ifx\wantedfiguretypespec\empty\else
- \ifx\wantedfiguretypespec\s!unknown\else
- \ifx\wantedfiguretypespec\wantedfiguretype\else
- -\wantedfiguretypespec
- \fi
- \fi
- \fi
- \ifnum\wantedfigurepage>\zeropoint
- -\wantedfigurepage
- \fi}
-
-\def\checkfigurerenderingoptions
- {\ifcase\figurestatus
- \let\@@efframe\v!on
- \fi
- \doif\@@exoption\v!frame
- {\let\@@efframe\v!on}%
- \doif\@@exoption\v!empty
- {\skipexternalfigurestrue
- \let\@@efframe\v!off}}
-
-\newtoks\externalfigurepostprocessors
-
-\def\resetfigureusersettings
- {\let\@@eftype \s!unknown \let\@@efmethod \empty \let\@@efpreset\v!yes
- \let\@@eflabel \empty \let\@@efsize \empty \let\@@efpage \!!zerocount
- \let\@@efobject \@@exobject \let\@@efdisplay \empty
- \let\@@efsplit \empty \let\@@efcolor \empty \let\@@efsymbol\v!no
- \let\@@efcontrols \v!no \let\@@efpreview \v!no \let\@@efrepeat\v!no
- \let\@@efhfactor \empty \let\@@efwfactor \empty \let\@@effactor\empty
- \let\@@efmaxwidth \@@exmaxwidth \let\@@efmaxheight\@@exmaxheight
- \let\@@efxscale \empty \let\@@efyscale \empty \let\@@efscale \empty
- \let\@@efsx \!!plusone \let\@@efsy \!!plusone
- \let\@@efwidth \empty \let\@@efheight \empty
- \let\@@eflines \empty \let\@@efgrid \empty
- \let\@@efconversion\@@exconversion \let\@@efprefix \@@exprefix \let\@@efcache \@@excache}
-
-%D Types and Methods are a bit history. Anyhow, user scan use the
-%D type to force the handler. So, what to do with the method. We can
-%D use that one to force a handler with a given suffix, so when no
-%D type is given, but a suffix is part of the name, the method will
-%D determine the handler.
-
-\def\checkfigureusersettings
- {\doif\@@efreset\v!yes\resetexternalfigures
- \doifelsenothing\@@eflabel
- {\doifnothing\wantedfigurelabel{\let\wantedfigurelabel\wantedfigurename}}%
- {\let\wantedfigurelabel\@@eflabel}%
- \doifsomething\@@eftype
- {\doifnot\@@eftype\s!unknown
- {\edef\wantedfiguretypespec{\@@eftype}%
- \let\wantedfiguremethod\wantedfiguretypespec}}%
- \doifnothing\wantedfigurepage % can be set by plug in
- {\let\wantedfigurepage\@@efpage}%
- \doif\wantedfigurepage\empty
- {\let\wantedfigurepage\!!zerocount}% 0 is signal !
- \doifsomething\@@efmethod % rather untested misusage of the remapper
- {\doifsomething\wantedfiguretype
- {\definegraphictypesynonym[\wantedfiguretype][\@@method]}}}
-
-% #1 is now obsolete
-
-\def\calculateexternalfigure[#1][#2][#3][#4][#5][#6]% \cmd label filename parent_id preset current
- {\doshowfigurestate{begin}%
- \dontcomplain
- % let's limit the search, which means that e.g. svg has to be given explicitly
- \checksupportedfiguretypes
- % recently added; we presume local use
- \restorecatcodes
- % collected resets (token list)
- \resetfigurevariables
-\resetwantedconversionvariables % new here
- % analyze filename and set wanted variables
- \analyzefigurefilename{#3}{#2}%
- \doanalyzefiguredimensionsfromfile
- % handle user settings
- \resetfigureusersettings
- \dosetefparameters{#4}{#5}{#6}%
- \checkfigureusersettings
- \checkfigurecolorsettings
- % adapt settings based on suffix and/or type
- \presetfiguretypeprocessing
- % now we really start
- \checkiffigureobjectpresent % first guess, we may not yet know the typespec
- \checkifknownfigureobjectpresent
- \checkforfigurefilepresence
- \checkiffigureobjectpresent % to be sure, in case we now know the typespec
- \checkfigurerenderingoptions % was later, moved here
- \checknaturalfiguredimensions % inherit from global values and/or fallbacks
- % by now we know what we're dealing with (put in box and scale)
- \setextrafiguredriveroptions
- \prepackageexternalfigureobject
- % set public variables in case postprocessing needs them
- \pushpublicfigurevariables
- \setpublicfigurevariables
- \setpublicfigureconversionvariables
- \setpublicfigurescalevariables
- % package final graphic, only now we can apply backgrounds and such
- \doglobal\increment\figurenestinglevel
- \finishexternalfigure
- \doglobal\decrement\figurenestinglevel
- % restore variables
- \poppublicfigurevariables
- \doshowfigurestate{end}}
-
-\def\checkforfigurefilepresence
- {\checkforconvertedfigure
- \checkforfigurefile}
-
-%D Figure objects.
-
-\def\setfigureobject
- {\doshowfigurestate{object set : \externalfigurestamp}%
- \setobject{FIG}\externalfigurestamp}
-
-% \def\getfigureobject
-% {\doshowfigurestate{object used : \externalfigurestamp}%
-% \getobject{FIG}\externalfigurestamp}
-
-\def\getfigureobject
- {\doshowfigurestate{object used : \frozenfigurestamp}%
- \getobject{FIG}\frozenfigurestamp}
-
-\def\prepackageexternalfigureobject
- {\ifcase\figurestatus
- \doshowfiguremessage1\expandedfigurename
- \doshowfigurestate{state : figure not found (\expandedfigurename)}%
- \global\setbox\foundexternalfigure\naturalvbox
- {\doscalebox\??ef{\blackrule[\c!width=\naturalfigurewidth,\c!height=\naturalfigureheight]}}%
- \xdef\noffigurepages{0}%
- \or
- \doshowfiguremessage8\expandedfigurename
- \doshowfigurestate{state : reusing existing figure}%
- \global\setbox\foundexternalfigure\naturalvbox
- {\doscalebox\??ef{\dowithfigure{\getfigureobject}}}%
- \xdef\noffigurepages{\number\getvalue{\externalfigurestamp\c!n}}%
- \or
- \doshowfiguremessage2\expandedfigurename
- \doshowfigurestate{state : using special figure}%
- \setbox\scratchbox\naturalvbox % make a dummy
- {\doscalebox\??ef{\blackrule[\c!width=\naturalfigurewidth,\c!height=\naturalfigureheight]}}%
- \global\setbox\foundexternalfigure\naturalvbox to \finalscaleboxheight
- {\vfill
- \hsize\finalscaleboxwidth
- \dowithfigure{\insertscaledfiguredriverdata}}%
- \xdef\noffigurepages{\number\nofinsertpages}%
- \else
- \ifdim\naturalfigurewidth>\zeropoint
- \ifnum\figurestatus>\!!ten\relax
- \doshowfiguremessage3\expandedfigurename
- \else
- \doshowfiguremessage4\expandedfigurename
- \fi
- \else
- \doshowfiguremessage5\expandedfigurename
- \fi
- \doshowfigurestate{state : using found figure}% 3=self 4=rlx
- \doifelse\@@efobject\v!no
- {\donefalse}
- {\doifobjectssupportedelse\donetrue\donefalse}%
- \ifdone
- % make an object and use it
- \packageexternalfigureobject
- \setfigureobject\vbox{\box\foundexternalfigure}%
- \setxvalue{\externalfigurestamp\c!n}{\number\nofinsertpages}%
- \global\setbox\foundexternalfigure\naturalvbox
- {\doscalebox\??ef{\dowithfigure{\getfigureobject}}}%
- \xdef\noffigurepages{\number\getvalue{\externalfigurestamp\c!n}}%
- \else
- % maybe a tex figure
- \global\setbox\foundexternalfigure\naturalvbox
- {\doscalebox\??ef{\dowithfigure{\box\foundexternalfigure}}}%
- \xdef\noffigurepages{\number\nofinsertpages}%
- \fi
- \fi
- \wd\foundexternalfigure\finalscaleboxwidth
- \ht\foundexternalfigure\finalscaleboxheight
- \global\let\lastfigureobjectname\externalfigurestamp
- \doresetobjects} % clean up driver left overs
-
-\def\packageexternalfigureobject
- {\global\setbox\foundexternalfigure\vbox to \naturalfigureheight
- {\vfill
- \ifdim\wd\foundexternalfigure=\zeropoint
- \setextrafiguredriveroptions
- \insertunscaledfiguredriverdata
- \else\ifskipexternalfigures
- \ruledhbox{\backgroundline[\@@efsplitcolor]{\fakebox\foundexternalfigure}}%
- \else
- \box\foundexternalfigure
- \fi\fi}%
- \wd\foundexternalfigure\naturalfigurewidth
- \ht\foundexternalfigure\naturalfigureheight}
-
-\def\finishexternalfigure % here we use \figurevariables
- {\global\setbox\foundexternalfigure\vbox
- {\forgetall
- \ifcase\figurestatus
- \resetsystemmode\v!figure % todo, also: \v!resource
- \else
- \setsystemmode \v!figure % todo, also: \v!resource
- \fi
- \ifconditional\externalfigureflush
- \ifconditional\externalfigurelevel % probably background
- \ifskipexternalfigures
- % nothing
- \fakebox\foundexternalfigure
- \else\ifcase\figurestatus
- % nothing
- \else\ifnum\splitexternalfigure=\plustwo\else
- \the\externalfigurepostprocessors
- \box\foundexternalfigure
- \fi\fi\fi
- \else
- \iftrialtypesetting \else \feedbackexternalfigure \fi
- \settrue\externalfigurelevel
- \ifskipexternalfigures
- \ifcase\figurestatus
- \externalfigurereplacement\figurelabel\figurefilename{unknown}%
- \else
- \externalfigurereplacement\figurelabel\figurefullname{skipped}%
- \fi
- \else\ifcase\figurestatus
- \externalfigurereplacement\figurelabel\figurefilename{unknown}%
- \else\ifnum\splitexternalfigure=\plustwo
- \backgroundline[\@@efsplitcolor]{\fakebox\foundexternalfigure}%
- \else
- \the\externalfigurepostprocessors
- \doifelse\@@efreset\v!yes
- {\wd\foundexternalfigure\figurewidth
- \ht\foundexternalfigure\figureheight
- \dp\foundexternalfigure\zeropoint
- \box\foundexternalfigure}
- {\localframed % should also be applied to high res !
- [\??ef]
- [\c!offset=\v!overlay,
- \c!width=\figurewidth,
- \c!height=\figureheight]
- {\vfilll
- \ifnum\splitexternalfigure=\plusone
- % hm, eigenlijk in dit geval achtergrondkleur
- \hidesplitcolorfalse % really needed
- \backgroundline[\@@efsplitcolor]{\box\foundexternalfigure}%
- \else % = 0, no split mode
- \box\foundexternalfigure
- \fi}}%
- \fi\fi\fi
- \fi
- \else
- % maybe also \the\externalfigurepostprocessors
- \iftrialtypesetting \else \feedbackexternalfigure \fi
- \fi}}
-
-\def\insertfiguredriverdata#1#2%
- {\lowercasestring\wantedfiguretypespec\to\lcwantedfiguretypespec
- \lowercasestring\wantedfiguremethod \to\lcwantedfiguremethod
- \edef\@@DriverImageWidth {\the\dimexpr#1\relax}%
- \edef\@@DriverImageHeight{\the\dimexpr#2\relax}%
- \let \@@DriverImageFile \wantedfigurefullname
- \let \@@DriverImageType \lcwantedfiguretypespec
- \let \@@DriverImageMethod \lcwantedfiguremethod
- \let \@@DriverImageLabel \wantedfigurelabel
- \let \@@DriverImagePage \wantedfigurepage
- \doinsertfile}
-
-\def\insertunscaledfiguredriverdata
- {\insertfiguredriverdata\naturalfigurewidth\naturalfigureheight}
-
-\def\insertscaledfiguredriverdata
- {\insertfiguredriverdata\finalscaleboxwidth\finalscaleboxheight}
-
-\ifx\externalfigurereplacement\undefined\let\externalfigurereplacement\gobblethreearguments\fi
-\ifx\externalfigureplaceholder\undefined\let\externalfigureplaceholder\gobblethreearguments\fi
-
-\def\registerexternalfigure % no placement, handy for preprocessing
- {\dotripleempty\doregisterexternalfigure}
-
-\def\doregisterexternalfigure[#1][#2][#3]%
- {\bgroup
- \setfalse\externalfigureflush
- \externalfigure[#1][#2][#3]% or \doexternalfigure
- \egroup}
-
-\let\feedbackexternalfigure\relax % \gobblefourarguments
-\let\dowithfigure \relax
-
-%D Conversion stuff:
-
-\newcount\nofconversionfigures
-
-\def\resetwantedconversionvariables
- {\let\wantedconversionpath \empty % these point to the to be converted graphic
- \let\wantedconversionname \empty
- \let\wantedconversiontype \empty
- \let\wantedconversioncache \empty
- \let\wantedconversionprefix\empty}
-
-\resetwantedconversionvariables
-
-\def\checkforconvertedfigure
- {\ifcase\figurestatus
- \resetwantedconversionvariables
- \doifsomething\@@efconversion
- {\global\advance\nofconversionfigures\plusone
- \doshowfigurestate{n-of-conversions : \number\nofconversionfigures}%
- \edef\wantedfigureconversion{\@@efconversion}%
- \edef\wantedconversioncache {\@@efcache}%
- \edef\wantedconversionprefix{\@@efprefix}%
- \doshowfigurestate{checking paths : \figurepathlist}%
- \processcommacommand[\figurepathlist]\dolocatefigureconversionfile
- \ifcase\figurestatus
- \doshowfigurestate{remark : no conversion file found}%
- \else
- \doshowfigurestate{remark : conversion file found}%
- \chardef\figurestatus\zerocount
- \fi
- \let\wantedconversionname\wantedfigurename
- \edef\wantedfigurename{\wantedconversionprefix\wantedfigurename}%
- \ifx\wantedconversioncache\empty
- \let \wantedfigurepath \wantedconversionpath
- \else
- \checkfilename\@@efcache
- \ifnum\kindoffile=\plusone
- \let\wantedfigurepath\@@efcache % root related path
- \else % brrr
- \edef\wantedfigurepath{\@@efcache,\wantedconversionpath/\@@efcache}% in case of explicit paths, what a mess
- \fi
- \fi
- \let\wantedfiguretype \empty
- \let\wantedfiguretypelist\figuretypes % hm, why needed
- \ifx\figurepathlist\empty
- \let\figurepathlist\wantedfigurepath
- \else
- \edef\figurepathlist{\wantedfigurepath,\figurepathlist}%
- \fi
- \doshowfigurestate{conversion path : \wantedconversionpath}%
- \doshowfigurestate{conversion name : \wantedconversionname}}%
- \doshowfigurestate{new figure path : \wantedfigurepath}%
- \fi}
-
-\def\dolocatefigureconversionfile#1%
- {\ifcase\figurestatus
- \setwantedfigurefullname{#1}\wantedfigurename\wantedfiguretype
- \doshowfigurestate{locating original : \wantedfigurefullname}%
- \doiffile\wantedfigurefullname
- {\def\wantedconversionpath{#1}%
- \let\wantedconversionname\wantedfigurename
- \let\wantedconversiontype\wantedfiguretype
- \chardef\figurestatus\plusfive}%
- \fi}
-
-\def\setpublicfigureconversionvariables % also prefix, cache
- {\doifsomething\@@efconversion
- {\doifmode{\systemmodeprefix\v!first}
- {\let\figurefilepath\wantedconversionpath
- \let\figurefilename\wantedconversionname
- \let\figurefiletype\wantedconversiontype
- \let\figurefileconversion\wantedfigureconversion
- \def\figurefullname
- {\ifx\wantedconversionpath\empty\else\wantedconversionpath/\fi
- \wantedconversionname
- \ifx\wantedconversiontype\empty\else.\wantedconversiontype\fi}}}}
-
-%D In \PDF\ one can specify an alternative graphic. This means
-%D that for instance a low resolution graphic can be used for
-%D viewing and a high res one for printing. Because this
-%D feature depends much on the driver, here we only take care
-%D of perparations. It is up to the special driver to handle
-%D the inclusion. The driver routines can change the content of
-%D box \type {\foundexternalfigure} if suitable.
-%D
-%D One complication is for instance that an alternative may
-%D not itself have an alternative, and these kind of situations
-%D are best handled by the driver.
-
-\let\lastfigureobjectname\empty
-
-%D The next macro does not work well with figure bases yet.
-
-\def\calculateexternalscreenfigure[#1][#2][#3][#4][#5][#6]%
- {\ifx\@@efdisplay\empty\else
- \doifnot\@@efobject\v!no
- {\doifobjectssupportedelse
- {\doifspecialavailableelse\doregisterfigure
- {\doshowfigurestate{screen alternative : start}%
- \bgroup
- \dosetefparameters{#4}{#5}{#6}%
- \doregisterfigure{FIG}{\lastfigureobjectname}%
- \let\@@ef@@scherm\@@efdisplay
- \calculateexternalfigure[#1][\@@ef@@scherm][\@@ef@@scherm][#4,\c!display=][#5][#6]%
- \doshowfigurestate{screen alternative : stop}%
- \egroup}
- {}}
- {}}%
- \fi}
-
-\def\getfiguredimensions
- {\dodoubleempty\dogetfiguredimensions}
-
-\def\dogetfiguredimensions[#1][#2]%
- {{\let\immediate\relax % very dirty but prevents flushing, will change
- \setbox0\hbox{\externalfigure[#1][#2,\c!display=,\c!object=\v!no]}}}
-
-% use the next one when the object must be forgotten (xobj
-% nums can migrate to the next object; maybe it should
-% always be done; todo ....
-
-\def\getfiguredimensionsonly
- {\dodoubleempty\dogetfiguredimensionsonly}
-
-\def\dogetfiguredimensionsonly[#1][#2]%
- {\dogetfiguredimensions[#1][#2]%
- \doresetobjects}
-
-\def\doiffigureelse#1%
- {\getfiguredimensions[#1]% so data is available !
- \ifdim\analyzedfigurewidth=\zeropoint % todo: \figurestatus
- \expandafter\secondoftwoarguments
- \else
- \expandafter\firstoftwoarguments
- \fi}
-
-%D Size determination.
-%D
-%D An analyzer must set the following dimensions (global macros):
-%D
-%D \starttyping
-%D \analyzedfigurewidth
-%D \analyzedfigureheight
-%D \stoptyping
-%D
-%D And afterwards, when succeeded, call:
-%D
-%D \starttyping
-%D \setanalyzedfiguredimensions{number>=10}
-%D \stoptyping
-%D
-%D Numbers upto 9 are reserved for special purposes:
-%D
-%D \starttabulate
-%D \NC 0 \NC not found \NC \NR
-%D \NC 1 \NC object (will be reused) \NC \NR
-%D \NC 2 \NC found but no dimensions (e.g. special annotation) \NC \NR
-%D \stoptabulate
-
-\let\doanalyzefiguredimensionsfromfile\relax % hook for figuredatabase
-\let\doanalyzefiguredimensionsinternal\relax
-\let\doanalyzefiguredimensionsexternal\relax % hook for rli support (see later)
-\let\doanalyzefiguredimensionsfallback\relax
-
-\def\doanalyzefiguredimensions
- {\lowercasestring\wantedfiguretypespec\to\lcwantedfiguretypespec
- \doiffileinsertionsupportedelse\lcwantedfiguretypespec
- {\doiffileelse\wantedfigurefullname
- {\doshowfigurestate{analyzing : \wantedfigurefullname}%
- \doanalyzefiguredimensionsinternal
- \doanalyzefiguredimensionsexternal
- \doanalyzefiguredimensionsfallback}
- {\doshowfigurestate{not found : \wantedfigurefullname}}}
- {}}
-
-\def\setanalyzedfiguredimensions#1%
- {\ifdim\analyzedfigurewidth>\zeropoint
- \ifdim\analyzedfigureheight>\zeropoint
- \determinedfigurewidth \analyzedfigurewidth
- \determinedfigureheight\analyzedfigureheight
- \chardef\figurestatus #1\relax
- \doshowfigurestate{dimensions :
- \the\dimexpr\analyzedfigurewidth\relax\space x\space
- \the\dimexpr\analyzedfigureheight\relax}%
- \else
- \determinedfigurewidth \zeropoint
- \determinedfigureheight\zeropoint
- \chardef\figurestatus \zerocount
- \fi
- \else
- \determinedfigurewidth \zeropoint
- \determinedfigureheight\zeropoint
- \chardef\figurestatus \zerocount
- \fi}
-
-%D We can remap types. This is to be dealt with in the driver files.
-
-\def\definegraphictypesynonym
- {\dodoubleargument\dodefinegraphictypesynonym}
-
-\def\dodefinegraphictypesynonym[#1][#2]%
- {\setvalue{\??ef:\??ex:#1}{#2}}
-
-\def\truegraphictype#1%
- {\ifcsname\??ef:\??ex:#1\endcsname
- \expandafter\truegraphictype\csname\??ef:\??ex:#1\endcsname\else#1%
- \fi}
-
-\definegraphictypesynonym[epdf] [pdf]
-\definegraphictypesynonym[jpeg] [jpg]
-\definegraphictypesynonym[jp2] [jpg]
-\definegraphictypesynonym[jbig] [jb2]
-\definegraphictypesynonym[jbig2][jb2]
-\definegraphictypesynonym[jbg] [jb2]
-
-%D The self method (mostly used) uses the driver.
-
-% todo: when zero width mps, ok
-%
-% analyzer must set the analyzed dimensions
-
-\def\doanalyzefiguredimensionsinternal
- {\ifcase\figurestatus
- \lowercasestring\wantedfiguretypespec\to\lcwantedfiguretypespec
- \let\@@DriverImageFile \wantedfigurefullname
- \let\@@DriverImagePage \wantedfigurepage
- \let\@@DriverImageType\lcwantedfiguretypespec
- % use internal when available, otherwise try driver (\dogetfiguresize)
- \executeifdefined{dogetfiguresize\@@DriverImageType}\dogetfiguresize
- \setanalyzedfiguredimensions\!!ten
- \fi}
-
-%D The tex method.
-
-\def\dogetfiguresizetex
- {\ifcase\figurestatus
- \global\setbox\foundexternalfigure\vbox
- {\insidefloattrue
- \forgetall
- \blank[\v!disable]% niet meer weg !
- \startreadingfile
- \readfile\wantedfigurefullname \donothing \donothing
- \stopreadingfile
- \endgraf
- \removelastskip}%
- \global\setbox\foundexternalfigure\hbox
- {\raise\dp\foundexternalfigure\box\foundexternalfigure}%
- \xdef\analyzedfigurewidth {\the\wd\foundexternalfigure}%
- \xdef\analyzedfigureheight{\the\ht\foundexternalfigure}%
- \fi}
-
-\let\dogetfiguresizetmp \dogetfiguresizetex
-\let\dogetfiguresizebuffer\dogetfiguresizetex
-
-%D The eps, mps and svg files are read directly.
-
-\def\dogetfiguresizeeps
- {\dogetEPSboundingbox\wantedfigurefullname\!!widtha\!!heighta\!!widthb\!!heightb
- \xdef\analyzedfigurewidth {\the\!!widthb}%
- \xdef\analyzedfigureheight{\the\!!heightb}}
-
-\let\dogetfiguresizemps\dogetfiguresizeeps
-
-\def\dogetfiguresizesvg
- {\doifinset\wantedfiguretypespec\c!svg
- {\startnointerference
- \startXMLignore
- \defineXMLcommand[svg][width=100,height=75]
- {\doifdimensionelse{\XMLop{width}}
- {\xdef\analyzedfigurewidth {\the\dimexpr\XMLop{width}\relax}}
- {\xdef\analyzedfigurewidth {\the\dimexpr\XMLop{width}\onebasepoint\relax}}%
- \doifdimensionelse{\XMLop{height}}
- {\xdef\analyzedfigurewidth {\the\dimexpr\XMLop{height}\relax}}
- {\xdef\analyzedfigurewidth {\the\dimexpr\XMLop{height}\onebasepoint\relax}}%
- \endinput}%
- \processXMLfilegrouped\wantedfigurefullname
- \stopXMLignore
- \stopnointerference}}
-
-%D Do some checking on the filename.
-
-\newconditional \figurefileisqualified
-
-\def\setfigurepathlist
- {\let\figurepathlist\empty
- \expanded{\doifinset{\v!global }{\@@exlocation}}
- {\let\figurepathlist\@@exdirectory}%
- \expanded{\doifinset{\v!local }{\@@exlocation}}
- {\prependtocommalist\f!currentpath\figurepathlist}%
- \expanded{\doifinset{\v!default}{\@@exlocation}}
- {\appendtocommalist\defaultfigurepathsignal\figurepathlist}}
-
-% The combined path and qualified path hack is dedicated to Onno Tomson,
-% our partner in fighting inconsistent and faulty image specifications in
-% user files.
-
-\def\analyzefigurefilename#1#2%
- {\sanitizefilename#1\to\expandedfigurename
- \expanded{\checkfilename{\expandedfigurename}}%
- \ifcase\kindoffile
- \splitfigurefilename
- \ifcase\splitoffkind
- \let\wantedfigurepath\empty % no . either
- \setfigurepathlist
- \setfalse\figurefileisqualified
- \else
- \splitfigurefilename
- % will become splitoffkind 3 ! ! ! !
- \setfalse\figurefileisqualified
- \doifinstring{$$/}{$$\wantedfigurepath}{\settrue\figurefileisqualified}%
- \doifinstring {:} {\wantedfigurepath}{\settrue\figurefileisqualified}%
- \ifconditional\figurefileisqualified
- \let\figurepathlist\wantedfigurepath
- \let\wantedfigurepath\empty
- \settrue\figurefileisqualified
- \else
- \let\figurepathlist\@@exdirectory
- \let\oldfigurepathlist\figurepathlist
- \let\figurepathlist\wantedfigurepath
- \def\docommand##1{\edef\figurepathlist{\figurepathlist,##1/\wantedfigurepath}}%
- \processcommacommand[\oldfigurepathlist]\docommand
- \fi
- \fi
- \else % fully qualified
- \splitfigurefilename
- \let\wantedfigurepath\empty
- \settrue\figurefileisqualified
- \fi
- \ifx\figurepathlist\empty
- \let\figurepathlist\defaultfigurepathsignal % will prepend no path
- \fi
- \doifelsenothing\wantedfiguretype
- {\doifparentfileelse\wantedfigurename
- {\@EA\removefromcommalist\@EA{\jobsuffix }\wantedfiguretypelist
- \@EA\removefromcommalist\@EA{\jobfilesuffix}\wantedfiguretypelist}
- {}}
- {\let\wantedfiguretypelist\empty
- \let\wantedfiguretypespec\wantedfiguretype}%
- \edef\wantedfigurelabel{#2}%
- \doshowfigurestate{type check : \ifx\wantedfiguretypelist\empty forced type \wantedfiguretypespec\else\wantedfiguretypelist\fi}%
- \doshowfigurestate{file specs : \wantedfigurefull\space [\wantedfigurepath] [\wantedfigurename] [\wantedfiguretype]}%
- \doshowfigurestate{file type : \ifconditional\figurefileisqualified qualified\else simple\fi}}
-
-\def\setwantedfigurefullname#1#2#3% path name spec
- {\ifx\wantedfiguremethod\empty
- % the either explicit or gambled typespec determines the method
- \edef\wantedfiguretypespec{#3}%
- \doifelse{#1}\defaultfigurepathsignal
- {\edef\wantedfigurefullname {#2.\wantedfiguretypespec}}
- {\edef\wantedfigurefullname{#1/#2.\wantedfiguretypespec}}%
- \else\ifx\wantedfiguretype\empty %
- % the typespec (probably the same as the method) determines the suffix
- \doifelse{#1}\defaultfigurepathsignal
- {\edef\wantedfigurefullname {#2.\wantedfiguretypespec}}
- {\edef\wantedfigurefullname{#1/#2.\wantedfiguretypespec}}%
- \let\wantedfiguretypespec\wantedfiguremethod
- \else
- % the given suffix is used
- \let\wantedfiguretypespec\wantedfiguremethod
- \doifelse{#1}\defaultfigurepathsignal
- {\edef\wantedfigurefullname {#2.\wantedfiguretype}}
- {\edef\wantedfigurefullname{#1/#2.\wantedfiguretype}}%
- \fi\fi}
-
-\def\splitfigurefilename
- {\splitfilename\expandedfigurename
- \let\wantedfigurefull\splitofffull
- \let\wantedfigurepath\splitoffpath
- \let\wantedfigurename\splitoffname
- \let\wantedfigurebase\splitoffbase
- \let\wantedfiguretype\splitofftype}
-
-\def\analyzefigurefiles
- {\ifconditional\figurefileisqualified
- \ifx\wantedfiguretype\empty
- \doshowfigurestate{locating : unknown type}%
- \doanalyzeunknownfiguretype
- \else
- % this file or none
- \doshowfigurestate{locating : known type}%
- \doanalyzequalifiedfigure
- \fi
- \else
- \ifx\wantedfiguretype\empty
- % locate best fit / check support
- \doshowfigurestate{locating : best fit}%
- \doanalyzeunknownfiguretype
- \else
- % only check on paths
- \doshowfigurestate{locating : known types}%
- \doanalyzeknownfiguretype
- \fi
- \fi}
-
-\def\doanalyzequalifiedfigure
- {\let\wantedfigurefullname\wantedfigurefull
- \let\wantedfiguretypespec\wantedfiguretype
- \doshowfigurestate{forced type : \wantedfiguretype}%
- \doshowfigurestate{identifying : \wantedfigurefullname}%
- \doanalyzefiguredimensions}
-
-\def\doanalyzeknownfiguretype
- {\doshowfigurestate{using paths : \figurepathlist}%
- \doshowfigurestate{known type : \wantedfiguretype}%
- \doshowfigurestate{identifying : \wantedfigurename}%
- \let\wantedfiguretypespec\wantedfiguretype
- \processcommacommand[\figurepathlist]\dodoanalyzeknownfiguretype}
-
-\def\dodoanalyzeknownfiguretype#1% path
- {\ifcase\figurestatus
- \setwantedfigurefullname{#1}\wantedfigurename\wantedfiguretype
- \doanalyzefiguredimensions
- \fi}
-
-\def\doanalyzeunknownfiguretype
- {\doshowfigurestate{using paths : \figurepathlist}%
- \doshowfigurestate{using types : \wantedfiguretypelist}%
- \doshowfigurestate{identifying : \wantedfigurename}%
- \processcommacommand[\wantedfiguretypelist]\dodoanalyzeunknownfiguretype}
-
-\def\dodoanalyzeunknownfiguretype#1%
- {\processcommacommand[\figurepathlist]{\dododoanalyzeunknownfiguretype{#1}}}
-
-\def\dododoanalyzeunknownfiguretype#1#2% type path
- {\ifcase\figurestatus
- \setwantedfigurefullname{#2}\wantedfigurename{#1}% path spec
- \doanalyzefiguredimensions
- \fi}
-
-%D Some files, take for instance movies, cannot easilly be
-%D parsed on dimensions, that is, not yet. Although the current
-%D mechanism has no problems with this, as long as the user
-%D specified width and height reflect the right aspect ratio.
-%D Nevertheless, when one does not want any scanning done, one
-%D can disable \type{preset}. When no preset is needed, we only
-%D locate the file.
-
-\def\doanalyzefiguredimensionsfallback
- {\ifcase\figurestatus
- \doshowfigurestate{warning : assuming adaptive figure}%
- \xdef\analyzedfigurewidth {\the\dimexpr\@@efwidth +\zeropoint\relax}%
- \xdef\analyzedfigureheight{\the\dimexpr\@@efheight+\zeropoint\relax}%
- \setanalyzedfiguredimensions\plustwo
- \fi}
-
-%D This is \MKII\ only and comes from cont-new (maybe used in a project).
-
-% maybe to be integrated (option=...)
-
-\def\directexternalfigure
- {\dodoubleempty\dodirectexternalfigure}
-
-\def\dodirectexternalfigure[#1][#2]%
- {\bgroup
- \getparameters[\??ef][\c!type=\splitofftype,\c!page=1,#2]%
- \sanitizefilename#1\to\expandedfigurename
- \splitfilename\expandedfigurename
- \let\@@DriverImageWidth \!!zeropoint
- \let\@@DriverImageHeight \!!zeropoint
- \let\@@DriverImageFile \splitofffull
- \let\@@DriverImageType \@@eftype
- \let\@@DriverImageMethod \@@eftype
- \let\@@DriverImageLabel \empty
- \let\@@DriverImagePage \@@efpage
- \doinsertfile
- \egroup}
-
-% \directexternalfigure[cow.pdf]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/grph-trf.mkii b/Master/texmf-dist/tex/context/base/mkii/grph-trf.mkii
deleted file mode 100644
index 68e53d3760b..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/grph-trf.mkii
+++ /dev/null
@@ -1,579 +0,0 @@
-%D \module
-%D [ file=grph-fig,
-%D version=2006.08.26, % overhaul/split of 1997.03.31 core-fig
-%D title=\CONTEXT\ Graphic Macros,
-%D subtitle=Transformations,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 It may be that some functionality got lost. If it concerns
-%D defined features, let me know and it will be sorted out.
-
-\writestatus{loading}{ConTeXt Graphic Macros / Transformations}
-
-\unprotect
-
-%D Scaling:
-
-\unexpanded\def\scale{\dodoubleempty\doscalenextbox[\??xy]}
-
-% probably too many dimens / the width calculations can go
-% since we may assume scaling is available (was not true
-% long ago which is why we also calculate the width)
-
-\newdimen\scaleboxwidth
-\newdimen\scaleboxheight
-\newdimen\scaleboxdepth
-
-\newdimen\scaleboxsizex
-\newdimen\scaleboxsizey
-\newdimen\scaleboxoffsetx
-\newdimen\scaleboxoffsety
-
-\newdimen\scaleboxhsize
-\newdimen\scaleboxvsize
-
-% global
-
-\newdimen\scaleboxdimx \let\figwid \scaleboxdimx
-\newdimen\scaleboxdimy \let\fighei \scaleboxdimy
-\newcount\scaleboxscax \let\figxsca\scaleboxscax
-\newcount\scaleboxscay \let\figysca\scaleboxscay
-
-\newdimen\scaleboxoutervsize % we cannot manipulate any global vsize !
-
-\let\finalscaleboxxscale \!!plusone
-\let\finalscaleboxyscale \!!plusone
-\let\finalscaleboxwidth \!!zeropoint
-\let\finalscaleboxheight \!!zeropoint
-\let\finalscaleboxxfactor\!!hundred
-\let\finalscaleboxyfactor\!!hundred
-
-\newconditional\scaleboxdone
-
-\def\doscalenextbox[#1][#2]%
- {\bgroup
- \getparameters
- [#1]
- [\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,
- \c!equalwidth=,\c!equalheight=,
- \c!maxwidth=\scaleparameter\c!width,\c!maxheight=\scaleparameter\c!height,
- #2]%
- \dowithnextbox{\dodoscalenextbox{#1}\egroup}\hbox}
-
-\def\doscalebox#1%
- {\bgroup\dowithnextbox{\dodoscalenextbox{#1}\egroup}\hbox}
-
-\let\currentscaletag\??xy
-
-\def\scaleparameter#1%
- {\csname\currentscaletag#1\endcsname}
-
-\def\setscaleparameter#1#2%
- {\setvalue{\currentscaletag#1}{#2}}
-
-\def\dodoscalenextbox#1%
- {\edef\currentscaletag{#1}%
- \doif{\scaleparameter\c!depth}\v!no{\setbox\nextbox\hbox{\raise\nextboxdp\box\nextbox}}% new
- \forgetall
- \dontshowcomposition
- \dontcomplain
- \doscaleboxcalculations
- \doscaleboxindeed
- \doscaleboxposition
- \flushnextbox}
-
-\def\doscaleboxindeed
- {\ifconditional\scaleboxdone
- \scaleboxwidth \finalscaleboxxscale\nextboxwd
- \scaleboxheight\finalscaleboxyscale\nextboxht
- \scaleboxdepth \finalscaleboxyscale\nextboxdp
- \setbox\nextbox\hbox
- {\dostartscaling \finalscaleboxxscale \finalscaleboxyscale
- \smashedbox\nextbox
- \dostopscaling}%
- \nextboxwd\scaleboxwidth
- \nextboxht\scaleboxheight
- \nextboxdp\scaleboxdepth
- \fi}
-
-\def\doscaleboxcalculations
- {\setfalse\scaleboxdone
- % initial final value
- \global\let\finalscaleboxxscale \!!plusone
- \global\let\finalscaleboxyscale \!!plusone
- \xdef \finalscaleboxwidth {\the\nextboxwd}%
- \xdef \finalscaleboxheight{\the\nextboxht}%
- \global\let\finalscaleboxxfactor\!!hundred
- \global\let\finalscaleboxyfactor\!!hundred
- \ifdim\nextboxht>\zeropoint \ifdim\nextboxwd>\zeropoint
- \edef\scaleboxstampa % slow way [can be combined]
- {\scaleparameter\c!scale \scaleparameter\c!xscale \scaleparameter\c!yscale
- \scaleparameter\c!factor\scaleparameter\c!wfactor\scaleparameter\c!hfactor
- \scaleparameter\c!lines \scaleparameter\c!width \scaleparameter\c!height}%
- \edef\scaleboxstampb % fast way [just sx/sy]
- {\scaleparameter\c!sx
- \scaleparameter\c!sy}%
- \edef\scaleboxstampc
- {11}%
- \ifx\scaleboxstampa\empty
- \ifx\scaleboxstampb\scaleboxstampc
- % no scaling, but still check; new, gone again
-% wrong: scaled proportionally as side effect
-% \doifsomething{\scaleparameter\c!maxwidth }{\letvalue{\currentscaletag\c!factor}\v!fit}%
-% \doifsomething{\scaleparameter\c!maxheight}{\letvalue{\currentscaletag\c!factor}\v!fit}%
- \insidefloattrue % trick
- \dodoscaleboxcalculations
- \else
- \dosetscalboxsxsy
- \nodoscaleboxcalculations
- \fi
- \else
- \ifx\scaleboxstampb\empty
- % no need to check further
- \else
- \dosetscalboxsxsy
- \fi
- \dodoscaleboxcalculations
- \fi
- \fi \fi}
-
-\def\dosetscalboxsxsy
- {\ifdim\scaleparameter\c!sx\onepoint=\onepoint\else
- \setevalue{\currentscaletag\c!width }{\the\dimexpr\scaleparameter\c!sx\wd\nextbox\relax}%
- \fi
- \ifdim\scaleparameter\c!sy\onepoint=\onepoint\else
- \setevalue{\currentscaletag\c!height}{\the\dimexpr\scaleparameter\c!sy\ht\nextbox\relax}%
- \fi}
-
-\def\doscaleboxrounding#1.#2\relax{#1}
-
-\def\scaleboxrounding#1%
- {\@EA\@EA\@EA\doscaleboxrounding\@EA\WITHOUTPT\the\dimexpr#1\points*100+32768sp\relax.\relax}
-
-\def\nodoscaleboxcalculations
- {\settrue\scaleboxdone
- \xdef\finalscaleboxwidth {\the\dimexpr\scaleparameter\c!sx\wd\nextbox\relax}%
- \xdef\finalscaleboxheight {\the\dimexpr\scaleparameter\c!sy\ht\nextbox\relax}%
- \xdef\finalscaleboxxscale {\scaleparameter\c!sx}%
- \xdef\finalscaleboxyscale {\scaleparameter\c!sy}%
- \ifx\finalscaleboxxscale\empty\let\finalscaleboxxscale\!!plusone\fi
- \ifx\finalscaleboxyscale\empty\let\finalscaleboxyscale\!!plusone\fi
- \xdef\finalscaleboxxfactor{\scaleboxrounding\finalscaleboxxscale}%
- \xdef\finalscaleboxyfactor{\scaleboxrounding\finalscaleboxyscale}}
-
-\def\dodoscaleboxcalculations
- {\settrue\scaleboxdone
- % initial values
- \scaleboxoffsetx\zeropoint
- \scaleboxoffsety\zeropoint
- \scaleboxsizex \nextboxwd
- \scaleboxsizey \nextboxht % alleen ht wordt geschaald!
- % final values
- \global\scaleboxdimx \zeropoint % see note * (core-fig)
- \global\scaleboxdimy \zeropoint % see note * (core-fig)
- \scaleboxscax \plusone % see note * (core-fig)
- \scaleboxscay \plusone % see note * (core-fig)
- % preparations
- \setfalse\scaleboxscalingdone
- \checkscaleboxsettings
- % calculators
- % beware, they operate in sequence, and calculate missing dimensions / messy
- %setscaleboxbynature % when? needed?
- \ifconditional\scaleboxscalingdone\else\setscaleboxbyfactor \fi
- \ifconditional\scaleboxscalingdone\else\setscaleboxbyscale \fi
- \ifconditional\scaleboxscalingdone\else\setscaleboxbydimension\fi
- % finalizers / to be done (no longer needed this way, clean up)
- \convertscaleboxinsertscale\scaleboxhsize\figx\scaleboxscax\scax
- \convertscaleboxinsertscale\scaleboxvsize\figy\scaleboxscay\scay
- % used in actual scaling
- \xdef\finalscaleboxwidth {\the\scaleboxdimx}%
- \xdef\finalscaleboxheight {\the\scaleboxdimy}%
- \xdef\finalscaleboxxfactor{\the\scaleboxscax}%
- \xdef\finalscaleboxyfactor{\the\scaleboxscay}%
- \xdef\finalscaleboxxscale {\withoutpt\the\dimexpr\scax\points/\plushundred\relax}%
- \xdef\finalscaleboxyscale {\withoutpt\the\dimexpr\scay\points/\plushundred\relax}}
-
-
-\setvalue{\??xy:\c!grid:\v!yes }{\getnoflines \fighei\setevalue{\currentscaletag\c!height}{\the\noflines\lineheight}}
-\setvalue{\??xy:\c!grid:\v!height }{\getrawnoflines\fighei\setevalue{\currentscaletag\c!height}{\the\dimexpr\noflines\lineheight+\strutdepth\relax}}
-\setvalue{\??xy:\c!grid:\v!depth }{\getrawnoflines\fighei\setevalue{\currentscaletag\c!height}{\the\dimexpr\noflines\lineheight-\strutdepth\relax}}
-\setvalue{\??xy:\c!grid:\v!halfline}{\getrawnoflines\fighei\setevalue{\currentscaletag\c!height}{\the\dimexpr\noflines\lineheight+.5\lineheight\relax}}
-\setvalue{\??xy:\c!grid:\v!fit }{\getrawnoflines\fighei\setevalue{\currentscaletag\c!height}{\the\noflines\lineheight}}
-\letvalue{\??xy:\c!grid:\empty }\donothing
-
-\def\checkscaleboxsettings
- {\doifsomething{\scaleparameter\c!maxwidth }% can be defined in itself
- {\setevalue{\currentscaletag\c!maxwidth }{\the\dimexpr\scaleparameter\c!maxwidth \relax}}%
- \doifsomething{\scaleparameter\c!maxheight}% can be defined in itself
- {\setevalue{\currentscaletag\c!maxheight}{\the\dimexpr\scaleparameter\c!maxheight\relax}}%
- \doifsomething{\scaleparameter\c!lines}
- {\setevalue{\currentscaletag\c!height}{\the\dimexpr\scaleparameter\c!lines\lineheight\relax}}%
- \getvalue{\??xy:\c!grid:\scaleparameter\c!grid}}
-
-\def\setscaleboxbynature % where ! ! ! ! !
- {\doifsomething{\scaleparameter\c!width }{\global\scaleboxdimx\scaleparameter\c!width }%
- \doifsomething{\scaleparameter\c!height}{\global\scaleboxdimy\scaleparameter\c!height}%
- \doifsomething{\scaleparameter\c!scale } {\scaleboxscax\scaleparameter\c!scale
- \scaleboxscay\scaleparameter\c!scale }%
- \doifsomething{\scaleparameter\c!xscale} {\scaleboxscax\scaleparameter\c!xscale}%
- \doifsomething{\scaleparameter\c!yscale} {\scaleboxscay\scaleparameter\c!yscale}} % oeps, was x
-
-% \defineexternalfigure[width-6][factor=auto,maxwidth=\textheight,maxheight=\textwidth]
-% \defineexternalfigure[width-7][factor=auto,maxwidth=\textwidth,maxheight=\textheight]
-% \placefigure{none}{\rotate[frame=on,offset=overlay]{\externalfigure[t:/sources/cow.pdf][width-6]}} \page
-% \placefigure{none}{\framed[frame=on,offset=overlay]{\externalfigure[t:/sources/cow.pdf][width-7]}}
-
-\def\setscaleboxbyfactor
- {\doifinsetelse{\scaleparameter\c!factor}{\v!max,\v!fit,\v!broad,\v!auto}
- {\doapplyscaleboxsize
- \ifdim\scaleboxsizex>\scaleboxsizey
- \docalculatescaleboxnorm \scaleboxdimx\c!factor\c!maxwidth\hsize\scaleboxhsize
- \docalculatescaleboxscales\scaleboxdimx\scaleboxsizex\scaleboxdimy\scaleboxsizey
- \else
- \docalculatescaleboxnorm \scaleboxdimy\c!factor\c!maxheight\scaleboxoutervsize\scaleboxvsize
- \docalculatescaleboxscales\scaleboxdimy\scaleboxsizey\scaleboxdimx\scaleboxsizex
- \fi
- \donetrue}
- {\doifinsetelse{\scaleparameter\c!hfactor}{\v!max,\v!fit,\v!broad,\v!auto}
- {\doapplyscaleboxsize
- \docalculatescaleboxnorm \scaleboxdimy\c!hfactor\c!maxheight\scaleboxoutervsize\scaleboxvsize
- \docalculatescaleboxscales\scaleboxdimy\scaleboxsizey\scaleboxdimx\scaleboxsizex
- \donetrue}
- {\doifinsetelse{\scaleparameter\c!wfactor}{\v!max,\v!fit,\v!broad,\v!auto}
- {\doapplyscaleboxsize
- \docalculatescaleboxnorm \scaleboxdimx\c!wfactor\c!maxwidth\hsize\scaleboxhsize
- \docalculatescaleboxscales\scaleboxdimx\scaleboxsizex\scaleboxdimy\scaleboxsizey
- \donetrue}
- {\docalculatescaleboxnorm\scaleboxdimy\c!factor \c!height \textheight\scaleboxvsize
- \docalculatescaleboxnorm\scaleboxdimy\c!hfactor\c!height \textheight\scaleboxvsize
- \docalculatescaleboxnorm\scaleboxdimx\c!wfactor\c!width \hsize \hsize
- \donefalse}}}%
- \ifdone
- \settrue\scaleboxscalingdone
- \ifdim\scaleboxdimx>\scaleboxhsize
- \global\scaleboxdimy\zeropoint \global\scaleboxdimx\scaleboxhsize
- \else\ifdim\scaleboxdimy>\scaleboxvsize
- \global\scaleboxdimx\zeropoint \global\scaleboxdimy\scaleboxvsize
- \fi\fi
- \setscaleboxbydimension
- \fi}
-
-\def\setscaleboxbyscale
- {\doifsomething{\scaleparameter\c!scale\scaleparameter\c!xscale\scaleparameter\c!yscale}
- {\doapplyscaleboxscale\scaleboxdimx\scaleboxsizex\scaleboxscax\c!xscale
- \doapplyscaleboxscale\scaleboxdimy\scaleboxsizey\scaleboxscay\c!yscale
- \global\scaleboxdimx\zeropoint
- \global\scaleboxdimy\zeropoint
- \doifelsenothing{\scaleparameter\c!maxwidth}
- {\doifsomething{\scaleparameter\c!maxheight}
- {\ifdim\scaleboxsizey>\scaleparameter\c!maxheight\relax
- \global\scaleboxdimy\scaleparameter\c!maxheight
- \fi}}
- {\ifdim\scaleboxsizex>\scaleparameter\c!maxwidth\relax
- \global\scaleboxdimx\scaleparameter\c!maxwidth
- \fi}}}
-
-\def\setscaleboxbydimension
- {\ifdim\scaleboxdimx>\zeropoint
- \ifdim\scaleboxdimy>\zeropoint
- \dosetdimensionscaleboxsize
- {\docalculatescaleboxscale\scaleboxdimy\scaleboxsizey\scaleboxscay
- \docalculatescaleboxscale\scaleboxdimx\scaleboxsizex\scaleboxscax}%
- {\docalculatescaleboxscale\scaleboxdimy\scaleboxsizey\scaleboxscay
- \docalculatescaleboxscale\scaleboxdimx\scaleboxsizex\scaleboxscax}%
- {\docalculatescaleboxscale\scaleboxdimy\scaleboxsizey\scaleboxscay
- \docalculatescaleboxscale\scaleboxdimx\scaleboxsizex\scaleboxscax}%
- \else
- \dosetdimensionscaleboxsize
- {\docalculatescaleboxscales\scaleboxdimx\scaleboxsizex\scaleboxdimy\scaleboxsizey}%
- {\docalculatescaleboxscales\scaleboxdimx\scaleboxsizex\scaleboxdimy\scaleboxsizey}%
- {\docalculatescaleboxscales\scaleboxdimx\scaleboxsizex\scaleboxdimy\scaleboxsizey}%
- \fi
- \else
- \ifdim\scaleboxdimy>\zeropoint
- \dosetdimensionscaleboxsize
- {\docalculatescaleboxscales\scaleboxdimy\scaleboxsizey\scaleboxdimx\scaleboxsizex}%
- {\docalculatescaleboxscales\scaleboxdimy\scaleboxsizey\scaleboxdimx\scaleboxsizex}%
- {\docalculatescaleboxscales\scaleboxdimy\scaleboxsizey\scaleboxdimx\scaleboxsizex}%
- \else
- \dosetdimensionscaleboxsize
- {\doapplyscaleboxscale\scaleboxdimx\scaleboxsizex\scaleboxscax\c!xscale
- \doapplyscaleboxscale\scaleboxdimy\scaleboxsizey\scaleboxscay\c!yscale}%
- {\docalculatescaleboxscales\scaleboxdimx\scaleboxsizex\scaleboxdimy\scaleboxsizey}%
- {\docalculatescaleboxscales\scaleboxdimy\scaleboxsizey\scaleboxdimx\scaleboxsizex}%
- \fi
- \fi}
-
-\def\dosetdimensionscaleboxsize#1#2#3%
- {#1\relax
- \doifsomething{\scaleparameter\c!maxwidth}
- {\ifdim\scaleboxdimx>\scaleparameter\c!maxwidth\relax
- \global\scaleboxdimx\scaleparameter\c!maxwidth
- #2\relax
- \fi}%
- \doifsomething{\scaleparameter\c!maxheight}
- {\ifdim\scaleboxdimy>\scaleparameter\c!maxheight\relax
- \global\scaleboxdimy\scaleparameter\c!maxheight
- #3\relax
- \fi}}
-
-\def\docalculatescaleboxnorm#1#2#3#4#5% 2 3 parameters (dodo:speedup)
- {\processaction
- [\scaleparameter#2]
- [ \v!max=>\global#1\dimexpr#4\relax,
- \v!fit=>\global#1\dimexpr#5\relax,
- \v!broad=>\global#1\dimexpr#5-4\@@exbodyfont\relax,
- \v!auto=>\doifsomething{\scaleparameter#3}{\global#1\dimexpr\scaleparameter#3\relax},
- \s!default=>\doifsomething{\scaleparameter#3}{\global#1\dimexpr\scaleparameter#3\relax},
- \s!unknown=>\global#1\dimexpr\scaleparameter#2\dimexpr\@@exbodyfont/10\relax\relax]}
-
-\def\docalculatescaleboxscales#1#2#3#4%
- {\scratchdimen\dimexpr#1/\dimexpr#2/\plusthousand\relax\relax
- \scaleboxscax\scratchdimen
- \scaleboxscay\scratchdimen
- #3\dimexpr\scaleboxscax\dimexpr#4/\plusthousand\relax\relax}
-
-\def\docalculatescaleboxscale#1#2#3%
- {#3\dimexpr#1/\dimexpr#2/\plusthousand\relax\relax}
-
-\def\doapplyscaleboxscale#1#2#3#4% $4 = parameter / scale can be empty
- {\ifcase0\scaleparameter#4\relax
- \ifcase0\scaleparameter\c!scale\relax
- #3=\plusthousand
- \else
- #3=\scaleparameter\c!scale
- \fi
- \else
- #3=\scaleparameter#4%
- \fi
- \relax % important ! still ?
- \global#1\ifnum#3=\plusthousand#2\else\dimexpr#3\dimexpr#2/\plusthousand\relax\relax\fi
- \relax}
-
-\def\doapplyscaleboxsize
- {\doifelsenothing{\scaleparameter\c!maxheight}
- {\scaleboxoutervsize\textheight
- \ifinner
- \scaleboxoutervsize \vsize % \textheight =\vsize
- \scratchdimen\vsize % \scratchdimen=\textheight
- \else\ifinsidefloat
- \scaleboxoutervsize \vsize % \textheight =\vsize
- \scratchdimen\vsize % \scratchdimen=\textheight
- \else\ifinpagebody
- \scaleboxoutervsize \vsize % \textheight =\vsize
- \scratchdimen\vsize % \scratchdimen=\textheight
- \else % hm, there should be an option to force this
- \ifdim\pagegoal<\maxdimen
- \ifdim\pagetotal<\pagegoal
- \scratchdimen\pagegoal
- \advance\scratchdimen -\pagetotal
- \else
- \scratchdimen\scaleboxoutervsize % \textheight
- \fi
- \else
- \scratchdimen\scaleboxoutervsize % \textheight
- \fi
- \fi\fi\fi}
- {\scratchdimen\scaleparameter\c!maxheight
- \scaleboxoutervsize\scratchdimen}%
- \doifelsenothing{\scaleparameter\c!height}
- {\scaleboxvsize\scratchdimen}
- {\scaleboxvsize\scaleparameter\c!height}%
- \doifelsenothing{\scaleparameter\c!width}
- {\scaleboxhsize\hsize}
- {\scaleboxhsize\scaleparameter\c!width}}
-
-\def\convertscaleboxinsertscale#1#2#3#4%
- {\scratchdimen#1\relax
- \ifnum#3=\plusthousand
- % == scale 1
- \else
- % better 1000 100 10 ranges, evt round 2sp
- \divide\scratchdimen \plusthousand
- \multiply\scratchdimen #3\relax
- \fi
- \scratchdimen-\scratchdimen % beter hier - dan in driver
- \edef#2{\the\scratchdimen}%
- \scratchcounter#3\relax
- \ifnum\scratchcounter>\plustenthousand
- \divide\scratchcounter\!!ten \scratchdimen\the\scratchcounter\points
- \else
- \scratchdimen\the\scratchcounter\points \divide\scratchdimen\!!ten
- \fi
- \edef#4{\withoutpt\the\scratchdimen}}
-
-% \startcombination
-% {\externalfigure[cow.pdf] [frame=on,height=3cm,equalwidth=6cm]} {}
-% {\externalfigure[mill.png][frame=on,height=3cm,equalwidth=6cm]} {}
-% \stopcombination
-
-\def\doscaleboxposition
- {\doifsomething{\scaleparameter\c!equalwidth}
- {\scratchdimen\scaleparameter\c!equalwidth\relax
- \ifdim\wd\nextbox<\scratchdimen
- \setbox\nextbox\hbox to \scratchdimen{\hss\box\nextbox\hss}%
- \fi}%
- \doifsomething{\scaleparameter\c!equalheight}
- {\scratchdimen\scaleparameter\c!equalheight\relax
- \ifdim\ht\nextbox<\scratchdimen
- \setbox\nextbox\vbox to \scratchdimen{\vss\box\nextbox\vss}%
- \fi}}
-
-%D \macros
-%D {clip, setupclipping}
-%D
-%D Although related to figures, clipping can be applied to
-%D arbitrary content. We can use \METAPOST\ to provide a non
-%D rectangular clipping path.
-%D
-%D \starttyping
-%D \startMPclip{fun}
-%D clip currentpicture to fullcircle
-%D shifted (.5,.5) xscaled \width yscaled \height ;
-%D \stopMPclip
-%D \stoptyping
-%D
-%D We get a rectangular piece of the figure when we say:
-%D
-%D \starttyping
-%D \clip[x=2,y=1]{\externalfigure[photo]}
-%D \stoptyping
-%D
-%D When we want to clip to the oval we defined a few lines ago,
-%D we say:
-%D
-%D \starttyping
-%D \clip[nx=1,ny=1,x=1,y=1,mp=fun]{\externalfigure[photo]}
-%D \stoptyping
-%D
-%D The general characteristics of clipping can be set up with
-%D
-%D \showsetup{setupclipping}
-
-\def\setupclipping
- {\dodoubleargument\getparameters[\??cp]}
-
-\def\clip
- {\dosingleempty\doclip}
-
-\def\doclip[#1]% nb top->bottom left->right
- {\bgroup
- \getparameters[\??cp][#1]%
- \doifelse\@@cpstate\v!start\dodoclip{\egroup\hbox}}
-
-\def\dodoclip
- {\dowithnextbox
- {\ifdim\@@cpwidth>\zeropoint
- \!!dimena\@@cpwidth
- \!!dimenc\@@cphoffset
- \else
- \!!dimena\nextboxwd
- \divide\!!dimena \@@cpnx
- \!!dimenc\@@cpx\!!dimena
- \advance\!!dimenc -\!!dimena
- \!!dimena\@@cpsx\!!dimena
- \fi
- \relax % sure
- \ifdim\@@cpheight>\zeropoint
- \!!dimenb\@@cpheight
- \!!dimend\nextboxht
- \advance\!!dimend -\@@cpvoffset
- \advance\!!dimend -\!!dimenb
- \else
- \!!dimenb\nextboxht
- \divide\!!dimenb \@@cpny
- \!!dimend-\@@cpy\!!dimenb
- \advance\!!dimend -\@@cpsy\!!dimenb
- \advance\!!dimend \!!dimenb
- \!!dimenb\@@cpsy\!!dimenb
- \advance\!!dimend \nextboxht % dimend !
- \fi
- \setbox\nextbox\hbox % old
- {\advance\!!dimenc -\@@cpleftoffset % new !
- \advance\!!dimend -\@@cpbottomoffset % new ! % - added
- \hskip-\!!dimenc\lower\!!dimend\flushnextbox}% old
- \nextboxwd\zeropoint
- \nextboxht\zeropoint
- \nextboxdp\zeropoint
- \setbox\nextbox\hbox
- {\advance\!!dimena \@@cpleftoffset % new !
- \advance\!!dimena \@@cprightoffset % new !
- \advance\!!dimenb \@@cpbottomoffset % new !
- \advance\!!dimenb \@@cptopoffset % new !
- \dostartclipping\@@cpmp\!!dimena\!!dimenb % old
- \flushnextbox
- \dostopclipping}%
- \setbox\nextbox\hbox % new !
- {\!!dimena-\@@cpleftoffset % new !
- \!!dimenb \@@cpbottomoffset % new ! % - removed
- \hskip\!!dimena\lower\!!dimenb\flushnextbox}% new !
- \nextboxwd\!!dimena
- \nextboxht\!!dimenb
- \nextboxdp\zeropoint
- \flushnextbox
- \egroup}%
- \hbox}
-
-\setupclipping
- [\c!state=\v!start,
- \c!n=1, % was 2
- \c!nx=\@@cpn,\c!x=1,\c!sx=1,
- \c!ny=\@@cpn,\c!y=1,\c!sy=1,
- \c!width=\!!zeropoint,
- \c!height=\!!zeropoint,
- \c!hoffset=\!!zeropoint,
- \c!voffset=\!!zeropoint,
- \c!offset=\zeropoint,
- \c!leftoffset=\@@cpoffset, % \zeropoint,
- \c!rightoffset=\@@cpoffset, % \zeropoint,
- \c!topoffset=\@@cpoffset, % \zeropoint,
- \c!bottomoffset=\@@cpoffset,% \zeropoint,
- \c!mp=]
-
-%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
-
-%D Mirroring.
-
-\def\domirrorbox % \hbox/\vbox/\vtop
- {\bgroup
- \dowithnextbox
- {\dontshowcomposition
- \scratchdimen\nextboxwd
- % better use an hbox (if no \forgetall, leftskip etc may creep in)
- %\setbox\nextbox\vbox{\forgetall\dostartmirroring\hskip-\nextboxwd\flushnextbox\dostopmirroring}%
- \setbox\nextbox\hbox{\dostartmirroring\hskip-\nextboxwd\flushnextbox\dostopmirroring}%
- \nextboxwd\scratchdimen
- \flushnextbox
- \egroup}}
-
-\unexpanded\def\mirror
- {\domirrorbox\hbox}
-
-% \setbox0=\hbox{gans}
-% \ruledhbox{\copy0 \schaal[sx=2,sy=2]{\copy0}}
-% \mirror{\ruledhbox{\copy0 \schaal{\box0}}}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/hand-def.mkii b/Master/texmf-dist/tex/context/base/mkii/hand-def.mkii
deleted file mode 100644
index ab0044a8eda..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/hand-def.mkii
+++ /dev/null
@@ -1,577 +0,0 @@
-%D \module
-%D [ file=hand-def, % was enco-pro
-%D version=2000.29.09,
-%D title=\CONTEXT\ Handling Macros,
-%D subtitle=Default Protruding Factors,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 an experimental definition file. The protruding
-%D values we use here are those found from \THANH's thesis.
-
-\startfonthandling [pure]
-
- \defineprotrudefactor , 0 1
- \defineprotrudefactor . 0 1
- \defineprotrudefactor : 0 1
- \defineprotrudefactor ; 0 1
- \defineprotrudefactor - 0 1
-
- \defineprotrudefactor hyphen 0 1
- \defineprotrudefactor endash 0 .5
- \defineprotrudefactor emdash 0 .33 % .5
-
-\stopfonthandling
-
-\startfonthandling [punctuation]
-
- \defineprotrudefactor ! 0 .2
- \defineprotrudefactor ' 0 .7
- \defineprotrudefactor ` .7 0
- \defineprotrudefactor ( .05 0
- \defineprotrudefactor ) 0 .05
- \defineprotrudefactor [ .05 0
- \defineprotrudefactor ] 0 .05
- \defineprotrudefactor , 0 .7
- \defineprotrudefactor - 0 .7
- \defineprotrudefactor . 0 .7
- \defineprotrudefactor : 0 .5
- \defineprotrudefactor ; 0 .5
-
- \defineprotrudefactor rightupperninequote 0 .5
- \defineprotrudefactor leftupperninequote .5 0
- \defineprotrudefactor endash 0 .3
- \defineprotrudefactor emdash 0 .2
-
- \defineprotrudefactor hyphen 0 .7
-
-\stopfonthandling
-
-\startfonthandling [alpha]
-
- \defineprotrudefactor A .05 .05
- \defineprotrudefactor F 0 .05
- \defineprotrudefactor J .05 0
- \defineprotrudefactor K 0 .05
- \defineprotrudefactor L 0 .05
- \defineprotrudefactor T .05 .05
- \defineprotrudefactor V .05 .05
- \defineprotrudefactor W .05 .05
- \defineprotrudefactor X .05 .05
- \defineprotrudefactor Y .05 .05
-
- \defineprotrudefactor k 0 .05
- \defineprotrudefactor r 0 .05
- \defineprotrudefactor t 0 .05
- \defineprotrudefactor v .05 .05
- \defineprotrudefactor w .05 .05
- \defineprotrudefactor x .05 .05
- \defineprotrudefactor y .05 .05
-
-\stopfonthandling
-
-% ogoneks may need another treatment
-
-\startfonthandling [extended]
-
- \inherithandling Acircumflex A
- \inherithandling acircumflex a
- \inherithandling Ccircumflex C
- \inherithandling ccircumflex c
- \inherithandling Ecircumflex E
- \inherithandling ecircumflex e
- \inherithandling Gcircumflex G
- \inherithandling gcircumflex g
- \inherithandling Hcircumflex H
- \inherithandling hcircumflex h
- \inherithandling Icircumflex I
- \inherithandling icircumflex i
- \inherithandling Jcircumflex J
- \inherithandling jcircumflex j
- \inherithandling Ocircumflex O
- \inherithandling ocircumflex o
- \inherithandling Scircumflex S
- \inherithandling scircumflex s
- \inherithandling Ucircumflex U
- \inherithandling ucircumflex u
- \inherithandling Wcircumflex W
- \inherithandling wcircumflex w
- \inherithandling Ycircumflex Y
- \inherithandling ycircumflex y
-
- \inherithandling Agrave A
- \inherithandling agrave a
- \inherithandling Egrave E
- \inherithandling egrave e
- \inherithandling Igrave I
- \inherithandling igrave i
- \inherithandling Ograve O
- \inherithandling ograve o
- \inherithandling Ugrave U
- \inherithandling ugrave u
- \inherithandling Ygrave Y
- \inherithandling ygrave y
-
- \inherithandling Atilde A
- \inherithandling atilde a
- \inherithandling Itilde I
- \inherithandling itilde i
- \inherithandling Ntilde N
- \inherithandling ntilde n
- \inherithandling Otilde O
- \inherithandling otilde o
- \inherithandling Utilde U
- \inherithandling utilde u
-
- \inherithandling Adiaeresis A
- \inherithandling adiaeresis a
- \inherithandling Ediaeresis E
- \inherithandling ediaeresis e
- \inherithandling Idiaeresis I
- \inherithandling idiaeresis i
- \inherithandling Odiaeresis O
- \inherithandling odiaeresis o
- \inherithandling Udiaeresis U
- \inherithandling udiaeresis u
- \inherithandling Ydiaeresis Y
- \inherithandling ydiaeresis y
-
- \inherithandling Aacute A
- \inherithandling aacute a
- \inherithandling Cacute C
- \inherithandling cacute c
- \inherithandling Eacute E
- \inherithandling eacute e
- \inherithandling Iacute I
- \inherithandling iacute i
- \inherithandling Lacute L
- \inherithandling lacute l
- \inherithandling Nacute N
- \inherithandling nacute n
- \inherithandling Oacute O
- \inherithandling oacute o
- \inherithandling Racute R
- \inherithandling racute r
- \inherithandling Sacute s
- \inherithandling sacute s
- \inherithandling Uacute U
- \inherithandling uacute u
- \inherithandling Yacute Y
- \inherithandling yacute y
- \inherithandling Zacute Z
- \inherithandling zacute z
-
- \inherithandling Dstroke D
- \inherithandling dstroke d
- \inherithandling Hstroke H
- \inherithandling hstroke h
- \inherithandling Tstroke T
- \inherithandling tstroke t
-
- \inherithandling Cdotaccent C
- \inherithandling cdotaccent c
- \inherithandling Edotaccent E
- \inherithandling edotaccent e
- \inherithandling Gdotaccent G
- \inherithandling gdotaccent g
- \inherithandling Idotaccent I
- \inherithandling idotaccent i
- \inherithandling Zdotaccent Z
- \inherithandling zdotaccent z
-
- \inherithandling Amacron A
- \inherithandling amacron a
- \inherithandling Emacron E
- \inherithandling emacron e
- \inherithandling Imacron I
- \inherithandling imacron i
- \inherithandling Omacron O
- \inherithandling omacron o
- \inherithandling Umacron U
- \inherithandling umacron u
-
- \inherithandling Ccedilla C
- \inherithandling ccedilla c
- \inherithandling Kcedilla K
- \inherithandling kcedilla k
- \inherithandling Lcedilla L
- \inherithandling lcedilla l
- \inherithandling Ncedilla N
- \inherithandling ncedilla n
- \inherithandling Rcedilla R
- \inherithandling rcedilla r
- \inherithandling Scedilla S
- \inherithandling scedilla s
- \inherithandling Tcedilla T
- \inherithandling tcedilla t
-
- \inherithandling Ohungarumlaut O
- \inherithandling ohungarumlaut o
- \inherithandling Uhungarumlaut U
- \inherithandling uhungarumlaut u
-
- \inherithandling Aogonek A
- \inherithandling aogonek a
- \inherithandling Eogonek E
- \inherithandling eogonek e
- \inherithandling Iogonek I
- \inherithandling iogonek i
- \inherithandling Uogonek U
- \inherithandling uogonek u
-
- \inherithandling Aring A
- \inherithandling aring a
- \inherithandling Uring U
- \inherithandling uring u
-
- \inherithandling Abreve A
- \inherithandling abreve a
- \inherithandling Ebreve E
- \inherithandling ebreve e
- \inherithandling Gbreve G
- \inherithandling gbreve g
- \inherithandling Ibreve I
- \inherithandling ibreve i
- \inherithandling Obreve O
- \inherithandling obreve o
- \inherithandling Ubreve U
- \inherithandling ubreve u
-
- \inherithandling Ccaron C
- \inherithandling ccaron c
- \inherithandling Dcaron D
- \inherithandling dcaron d
- \inherithandling Ecaron E
- \inherithandling ecaron e
- \inherithandling Lcaron L
- \inherithandling lcaron l
- \inherithandling Ncaron N
- \inherithandling ncaron n
- \inherithandling Rcaron R
- \inherithandling rcaron r
- \inherithandling Scaron S
- \inherithandling scaron s
- \inherithandling Tcaron T
- \inherithandling tcaron t
- \inherithandling Ycaron Y
- \inherithandling ycaron y
- \inherithandling Zcaron Z
- \inherithandling zcaron z
-
- \inherithandling AEligature E
- \inherithandling aeligature e
- \inherithandling Lstroke I
- \inherithandling lstroke o
- \inherithandling Ostroke O
- \inherithandling ostroke o
- \inherithandling OEligature O
- \inherithandling oeligature o
-
- \inherithandling Ssharp S
- \inherithandling ssharp s
- \inherithandling IJligature J
- \inherithandling ijligature j
-
- \inherithandling aumlaut a
- \inherithandling eumlaut e
- \inherithandling iumlaut i
- \inherithandling oumlaut o
- \inherithandling uumlaut u
-
- \inherithandling Aumlaut A
- \inherithandling Eumlaut E
- \inherithandling Iumlaut I
- \inherithandling Oumlaut O
- \inherithandling Uumlaut U
-
- \inherithandling Lslash L
- \inherithandling lslash l
- \inherithandling Dslash D
- \inherithandling dslash d
- \inherithandling Oslash O
- \inherithandling oslash o
-
- \inherithandling Eszett S
- \inherithandling eszett s
-
- \inherithandling Thorn P
- \inherithandling thorn p
-
- % vietnamese
-
- \inherithandling Ahook A
- \inherithandling ahook a
- \inherithandling Ehook E
- \inherithandling ehook e
- \inherithandling Ihook I
- \inherithandling ihook i
- \inherithandling Ohook O
- \inherithandling ohook o
- \inherithandling Uhook U
- \inherithandling uhook u
- \inherithandling Yhook Y
- \inherithandling yhook y
-
- \inherithandling Acircumflexgrave A
- \inherithandling Acircumflexacute A
- \inherithandling Acircumflextilde A
- \inherithandling Acircumflexhook A
- \inherithandling acircumflexgrave a
- \inherithandling acircumflexacute a
- \inherithandling acircumflextilde a
- \inherithandling acircumflexhook a
- \inherithandling Ecircumflexgrave E
- \inherithandling Ecircumflexacute E
- \inherithandling Ecircumflextilde E
- \inherithandling Ecircumflexhook E
- \inherithandling ecircumflexgrave e
- \inherithandling ecircumflexacute e
- \inherithandling ecircumflextilde e
- \inherithandling ecircumflexhook e
- \inherithandling Ocircumflexgrave O
- \inherithandling Ocircumflexacute O
- \inherithandling Ocircumflextilde O
- \inherithandling Ocircumflexhook O
- \inherithandling ocircumflexgrave o
- \inherithandling ocircumflexacute o
- \inherithandling ocircumflextilde o
- \inherithandling ocircumflexhook o
-
- \inherithandling Abrevegrave A
- \inherithandling Abreveacute A
- \inherithandling Abrevetilde A
- \inherithandling Abrevehook A
- \inherithandling abrevegrave a
- \inherithandling abreveacute a
- \inherithandling abrevetilde a
- \inherithandling abrevehook a
-
- \inherithandling Adotbelow A
- \inherithandling adotbelow a
- \inherithandling Edotbelow E
- \inherithandling edotbelow e
- \inherithandling Idotbelow I
- \inherithandling idotbelow i
- \inherithandling Odotbelow O
- \inherithandling odotbelow o
- \inherithandling Udotbelow U
- \inherithandling udotbelow u
- \inherithandling Ydotbelow Y
- \inherithandling ydotbelow y
-
- \inherithandling Ohorndotbelow O
- \inherithandling ohorndotbelow o
- \inherithandling Uhorndotbelow U
- \inherithandling uhorndotbelow u
-
- \inherithandling Acircumflexdotbelow A
- \inherithandling acircumflexdotbelow a
- \inherithandling Ecircumflexdotbelow E
- \inherithandling ecircumflexdotbelow e
- \inherithandling Ocircumflexdotbelow O
- \inherithandling ocircumflexdotbelow o
-
- \inherithandling Abrevedotbelow A
- \inherithandling abrevedotbelow a
-
- \inherithandling Ohorn O
- \inherithandling Ohorngrave O
- \inherithandling Ohornacute O
- \inherithandling Ohorntilde O
- \inherithandling Ohornhook O
- \inherithandling ohorn o
- \inherithandling ohorngrave o
- \inherithandling ohornacute o
- \inherithandling ohorntilde o
- \inherithandling ohornhook o
- \inherithandling Uhorn U
- \inherithandling Uhorngrave U
- \inherithandling Uhornacute U
- \inherithandling Uhorntilde U
- \inherithandling Uhornhook U
- \inherithandling uhorn u
- \inherithandling uhorngrave u
- \inherithandling uhornacute u
- \inherithandling uhorntilde u
- \inherithandling uhornhook u
-
- \inherithandling Ytilde Y
- \inherithandling ytilde y
- \inherithandling Etilde E
- \inherithandling etilde e
-
-\stopfonthandling
-
-\startfonthandling [hz]
-
- \defineadjustfactor A .5
- \defineadjustfactor B .7
- \defineadjustfactor C .7
- \defineadjustfactor D .5
- \defineadjustfactor E .7
- \defineadjustfactor F .7
- \defineadjustfactor G .5
- \defineadjustfactor H .7
- \defineadjustfactor K .7
- \defineadjustfactor M .7
- \defineadjustfactor N .7
- \defineadjustfactor O .5
- \defineadjustfactor P .7
- \defineadjustfactor Q .5
- \defineadjustfactor R .7
- \defineadjustfactor S .7
- \defineadjustfactor U .7
- \defineadjustfactor W .7
- \defineadjustfactor Z .7
-
- \defineadjustfactor a .7
- \defineadjustfactor b .7
- \defineadjustfactor c .7
- \defineadjustfactor d .7
- \defineadjustfactor e .7
- \defineadjustfactor g .7
- \defineadjustfactor h .7
- \defineadjustfactor k .7
- \defineadjustfactor m .7
- \defineadjustfactor n .7
- \defineadjustfactor o .7
- \defineadjustfactor p .7
- \defineadjustfactor q .7
- \defineadjustfactor s .7
- \defineadjustfactor u .7
- \defineadjustfactor w .7
- \defineadjustfactor z .7
-
- \defineadjustfactor 2 .7
- \defineadjustfactor 3 .7
- \defineadjustfactor 6 .7
- \defineadjustfactor 8 .7
- \defineadjustfactor 9 .7
-
-% \defineadjustfactor hyphen ?
-% \defineadjustfactor endash ?
-% \defineadjustfactor emdash ?
-
-\stopfonthandling
-
-% no ligs other than fi fl etc, no --- and ''
-
-\startfonthandling[noligs]
-
- \settagcode - {\notagcode}
- \settagcode ' {\notagcode}
- \settagcode ` {\notagcode}
- \settagcode ? {\notagcode}
- \settagcode ! {\notagcode}
-
-\stopfonthandling
-
-% \startfonthandling[noligs]
-% \dostepwiserecurse{0}{255}{1}{\expanded{\settagcode \recurselevel\space\notagcode\space}}
-% \stopfonthandling
-
-% \definefonthandling [noligs] [noligs] [type=tag]
- % \setupfontsynonym[Serif][handling=noligs]
-% \definefont[test][Serif at 12.34pt]
-%
-% {``fi--ffl---ffi'' \test ``fi--ffl---ffi''}
-
-\unprotect
-
-% beware: extended extends the preceding vector (both protruding and
-% adjusting) but as long as the normal ascii characters are not set
-% beforehand, they default to normal
-
-% protruding variants -- slanted/italic is yet incomplete
-
-\definefonthandling [pure] [pure] [\c!type=\v!hanging]
-\definefonthandling [purebold] [pure] [\c!type=\v!hanging]
-\definefonthandling [pureslanted] [pure] [\c!type=\v!hanging,\c!right=1.5]
-\definefonthandling [pureitalic] [pure] [\c!type=\v!hanging,\c!right=1.5]
-\definefonthandling [pureboldslanted] [pure] [\c!type=\v!hanging,\c!right=1.5]
-\definefonthandling [purebolditalic] [pure] [\c!type=\v!hanging,\c!right=1.5]
-
-\definefonthandling [normal] [punctuation,alpha,extended] [\c!type=\v!hanging]
-\definefonthandling [normalbold] [punctuation,alpha,extended] [\c!type=\v!hanging]
-\definefonthandling [normalslanted] [punctuation,alpha,extended] [\c!type=\v!hanging,\c!right=1.5]
-\definefonthandling [normalitalic] [punctuation,alpha,extended] [\c!type=\v!hanging,\c!right=1.5]
-\definefonthandling [normalboldslanted] [punctuation,alpha,extended] [\c!type=\v!hanging,\c!right=1.5]
-\definefonthandling [normalbolditalic] [punctuation,alpha,extended] [\c!type=\v!hanging,\c!right=1.5]
-
-% for old times sake
-
-\definefonthandling [bold] [punctuation,alpha,extended] [\c!type=\v!hanging]
-\definefonthandling [slanted] [punctuation,alpha,extended] [\c!type=\v!hanging,\c!right=1.5]
-\definefonthandling [italic] [punctuation,alpha,extended] [\c!type=\v!hanging,\c!right=1.5]
-\definefonthandling [boldslanted] [punctuation,alpha,extended] [\c!type=\v!hanging,\c!right=1.5]
-\definefonthandling [bolditalic] [punctuation,alpha,extended] [\c!type=\v!hanging,\c!right=1.5]
-
-% hz variants
-
-\definefonthandling [hz] [hz,extended] [\c!type=\v!hz] % min=20 max=20 step=5
-
-% combined variants
-
-\definefonthandling [quality] [hz,pure]
-\definefonthandling [highquality] [hz,normal]
-
-% noligs (xml) : \definefonthandling [default] [noligs]
-
-\definefonthandling [noligs] [noligs] [\c!type=tag]
-
-% experimental values !
-%
-% \definefontsynonym[myfont][Serif][handling=prespacing]
-% \definefont[whatever][myfont sa 1]
-% \setupalign[spacing]
-%
-% \whatever look at this: we now have a proper spacing feature and, hurray,
-% get rid of active punctuation!
-
-\startfonthandling [flexspacing]
-
- \definespacefactor : 0 1.25 .25 .25
-
- \definespacefactor , 0 1 .25 .25
- \inheritspacefactor ; ,
-
- \definespacefactor . 0 1.5 .25 .25
- \inheritspacefactor ! .
- \inheritspacefactor ? .
-
-\stopfonthandling
-
-\definefonthandling[flexspacing][flexspacing][\c!type=\v!spacing]
-
-\startfonthandling [prespacing] % better name needed
-
- \definespacefactor : .25 .25 0 0
- \inheritspacefactor ; :
- \inheritspacefactor ! :
- \inheritspacefactor ? :
-
-\stopfonthandling
-
-\definefonthandling[prespacing][prespacing][\c!type=\v!spacing] % factor=.5
-
-% A special case of guillemots, beware: when used ungrouped,
-% it overloads all successive (current) encoding vector
-% instances! Will be obsolete soon.
-
-\startfonthandling [glm]
-
- \overloadcharacter guilsingleleft {\defaultcharacter\guilsingleleft }
- \overloadcharacter guilsingleright {\defaultcharacter\guilsingleright}
- \overloadcharacter leftguillemot {\defaultcharacter\leftguillemot }
- \overloadcharacter rightguillemot {\defaultcharacter\rightguillemot }
-
-\stopfonthandling
-
-\definefonthandling [glm] [glm]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/hand-ini.mkii b/Master/texmf-dist/tex/context/base/mkii/hand-ini.mkii
deleted file mode 100644
index 1d41c3adab7..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/hand-ini.mkii
+++ /dev/null
@@ -1,483 +0,0 @@
-%D \module
-%D [ file=hand-ini, % moved from enco-ini / pro
-%D version=2000.12.27, % 1998.12.03,
-%D title=\CONTEXT\ Handling Macros,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 {\em This module is experimental and implements font
-%D specific features, like hanging punctuation.}
-
-\unprotect
-
-\newif\iftracefonthandling % \tracefonthandlingtrue
-
-\newif\ifskiphandlingdef \skiphandlingdeffalse
-
-\newtoks\everyenablefonthandling
-
-% much in common with hz/protruding defs
-% todo: fix others
-
-\def\dosetsomehandling#1#2#3 #4 % no define since directly set
- {\ifskiphandlingdef \else
- \doifnumberelse{\string#2}
- {#1{#2#3}{#4}}
- {\doifelsenothing{#3}
- {#1{`#2}{#4}}
- {\let\char\empty
- \doifnumberelse{\csname#2#3\endcsname}{#1{\csname#2#3\endcsname}{#4}}\donothing
- \let\char\normalchar}}%
- \fi}
-
-\def\dosetpairhandling#1#2#3 #4 #5 % no define since directly set
- {\ifskiphandlingdef \else
- \doifnumberelse{\string#2}
- {#1{#2#3}{#4}{#5}}
- {\doifelsenothing{#3}
- {#1{`#2}{#4}{#5}}
- {\let\char\empty
- \doifnumberelse{\csname#2#3\endcsname}{#1{\csname#2#3\endcsname}{#4}{#5}}\donothing
- \let\char\normalchar}}%
- \fi}
-
-\def\dosetquartethandling#1#2#3 #4 #5 #6 #7 % no define since directly set
- {\ifskiphandlingdef \else
- \doifnumberelse{\string#2}
- {#1{#2#3}{#4}{#5}{#6}{#7}}
- {\doifelsenothing{#3}
- {#1{`#2}{#4}{#5}{#6}{#7}}
- {\let\char\empty
- \doifnumberelse{\csname#2#3\endcsname}{#1{\csname#2#3\endcsname}{#4}{#5}{#6}{#7}}\donothing
- \let\char\normalchar}}%
- \fi}
-
-\def\doinhsomehandling#1#2#3 #4 % to be checked
- {\ifskiphandlingdef \else
- \if#3\relax\relax
- #1{`#2}{`#4}%
- \else
- \let\char\empty
- \doifnumberelse{\csname#2#3\endcsname}{#1{\csname#2#3\endcsname}{`#4}}\donothing
- \let\char\normalchar
- \fi
- \fi}
-
-% adjustspacing
-
-\newdimen\adjustdimen \let\handledfont\font
-
-\ifx\undefined\pdfadjustspacing % we don't use pdftex
-
- \let\enableadjusting \relax
- \let\disableadjusting \relax
- \let\setadjusting \gobbletwoarguments
-
- \def\defineadjustfactor #1 #2 {}
- \def\inheritadjustfactor #1 #2 {}
-
- \let\setfontadjusting \gobbleoneargument
-
-\else
-
- \def\enableadjusting {\pdfadjustspacing\plustwo}
- \def\disableadjusting {\pdfadjustspacing\zerocount}
-
- \appendtoks \disableadjusting \to \everyforgetall % Here or not here?
-
- \def\dododefineadjustfactor#1#2%
- {\efcode\handledfont#1\dimexpr#2\onepoint*\plusthousand/\maxcard\relax}
-
- \def\dodoinheritadjustfactor#1#2%
- {\efcode\handledfont#1\efcode\handledfont#2\relax}
-
- \def\defineadjustfactor#1 #2 %
- {\setfonttoks
- \let\inherithandling\inheritadjustfactor
- \appendtoks\dosetsomehandling\dododefineadjustfactor#1 #2 \to\fonttoks}
-
- \def\inheritadjustfactor#1 #2 %
- {\setfonttoks
- \appendtoks\doinhsomehandling\dodoinheritadjustfactor#1 #2 \to\fonttoks}
-
- \ifnum\pdftexversion<120
- \let\@@pdfexpandbonus\plusthousand
- \else
- \def\@@pdfexpandbonus{autoexpand}%
- \fi
-
- \def\setfontadjusting#1%
- {\doifvalue{\@fha@\@fha@#1\c!type}\v!hz{\dosetfontadjusting{#1}}}
-
- \def\dosetfontadjusting#1%
- {\iftracefonthandling\showfontadjusting{#1}\fi
- \pdffontexpand\handledfont
- \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!max \endcsname/%
- \csname\@fha@\@fha@#1\c!min \endcsname/%
- \csname\@fha@\@fha@#1\c!step\endcsname\space
- \fontname\handledfont}}
-\fi
-
-\ifx\setfontadjusting\gobbleoneargument \else
- \appendtoks
- \setfontadjusting\askedfonthandling
- \to \everyenablefonthandling
-\fi
-
-% protruding
-
-\newif\ifembasedprotruding \embasedprotrudingfalse
-
-\newdimen\lproddimen \newdimen\rproddimen \let\handledfont\font
-
-\ifx\undefined\pdfprotrudechars % we don't use pdftex
-
- \let\enableprotruding \relax
- \let\disableprotruding \relax
- \let\setprotrudingfactor \gobbleoneargument
-
- \def\defineprotrudefactor #1 #2 #3 {}
- \def\inheritprotrudefactor #1 #2 {}
-
-\else
-
- \def\enableprotruding {\pdfprotrudechars\plustwo}
- \def\disableprotruding{\pdfprotrudechars\zerocount}
-
- \appendtoks \disableprotruding \to \everyforgetall % Here or not here?
-
- \lproddimen1000\onepoint \divide\lproddimen\maxcard
- \rproddimen1000\onepoint \divide\rproddimen\maxcard
-
- \def\setprotrudingfactor#1%
- {\doifvalue{\@fha@\@fha@#1\c!type}\v!hanging{\dosetprotrudingfactor{#1}}}
-
- \def\dosetprotrudingfactor#1% no \onepoint instead of pt
- {\lproddimen\dimexpr\csname\@fha@\@fha@#1\c!left \endcsname\onepoint*\plusthousand/\maxcard\relax
- \rproddimen\dimexpr\csname\@fha@\@fha@#1\c!right\endcsname\onepoint*\plusthousand/\maxcard\relax
- \iftracefonthandling\showprotrudingfactor{#1}\fi}
-
- \def\showprotrudingfactor#1%
- {\writestatus\m!handlings{[protrude]\space#1\space
- \csname\@fha@\@fha@#1\c!left \endcsname\space
- \csname\@fha@\@fha@#1\c!right\endcsname\space
- \fontname\handledfont}}
-
- % division before multiplication, else overflow with "sa>5"
-
- \newdimen\protrudethreshold \protrudethreshold=36pt
-
- \def\dododefineprotrudefactor#1#2#3%
- {\lpcode\handledfont#1\dimexpr#2\lproddimen
- \ifembasedprotruding \else
- \ifdim\emwidth>\protrudethreshold
- /\emwidth*\fontcharwd\handledfont#1%
- \else
- *\fontcharwd\handledfont#1/\emwidth
- \fi
- \fi
- \relax
- \rpcode\handledfont#1\dimexpr#3\rproddimen
- \ifembasedprotruding \else
- \ifdim\emwidth>\protrudethreshold
- /\emwidth*\fontcharwd\handledfont#1%
- \else
- *\fontcharwd\handledfont#1/\emwidth
- \fi
- \fi
- \relax}
-
- \def\dodoinheritprotrudefactor#1#2%
- {\lpcode\handledfont#1\lpcode\handledfont#2\relax
- \rpcode\handledfont#1\rpcode\handledfont#2\relax}
-
- \def\defineprotrudefactor#1 #2 #3 %
- {\setfonttoks
- \let\inherithandling\inheritprotrudefactor
- \appendtoks\dosetpairhandling\dododefineprotrudefactor#1 #2 #3 \to\fonttoks}
-
- \def\inheritprotrudefactor#1 #2 %
- {\setfonttoks
- \appendtoks\doinhsomehandling\dodoinheritprotrudefactor#1 #2 \to\fonttoks}
-
-\fi
-
-\ifx\setprotrudingfactor\gobbleoneargument \else
- \appendtoks
- \setprotrudingfactor\askedfonthandling
- \to \everyenablefonthandling
-\fi
-
-% Basic support for a new pdftex feature: space factors
-%
-% \knbccode -- kern before char code
-% \knbscode -- kern before space code
-% \stbscode -- stretch before space code
-% \shbscode -- shrink before space code
-%
-% Setting \knsbcode\font`\.=200 means that if a period sits before
-% a interword space (glue), then the interword glue will be increased
-% by an amount of 1em*200/1000, i.e. the value is given in thousandths
-% of an em. (HTT)
-
-\newdimen\spfacdimen
-
-\ifx\undefined\pdfadjustinterwordglue % we don't use pdftex
-
- \let\enablespacehandling \relax
- \let\disablespacehandling \relax
- \let\enablekernhandling \relax
- \let\disablekernhandling \relax
-
- \let\setspacehandling \gobbleoneargument
-
- \def\definespacefactor #1 #2 #3 #4 #5 {}
- \def\inheritspacefactor #1 #2 {}
-
-\else
-
- \def\enablespacehandling {\pdfadjustinterwordglue\plusone }
- \def\disablespacehandling{\pdfadjustinterwordglue\minusone}
- \def\enablekernhandling {\pdfprependkern \plusone }
- \def\disablekernhandling {\pdfprependkern \minusone}
-
- \appendtoks \disablespacehandling \to \everyforgetall % Here or not here?
-
- \def\dosetspacehandling#1%
- {\spfacdimen\csname\@fha@\@fha@#1\c!factor\endcsname\s!pt
- \multiply\spfacdimen\plusthousand\divide\spfacdimen\maxcard\relax}
-
- \def\setspacehandling#1%
- {\doifvalue{\@fha@\@fha@#1\c!type}\v!spacing{\dosetspacehandling{#1}}}
-
- \def\dododefinespacefactor#1#2#3#4#5%
- {\sfcode#1\plusthousand
- \knbccode\handledfont#1\dimexpr#2\spfacdimen\relax
- \knbscode\handledfont#1\dimexpr#3\spfacdimen\relax
- \stbscode\handledfont#1\dimexpr#4\spfacdimen\relax
- \shbscode\handledfont#1\dimexpr#5\spfacdimen\relax}
-
- \def\dodoinheritspacefactor#1#2%
- {\sfcode#1\plusthousand
- \knbccode\handledfont#1\knbccode\handledfont#2\relax
- \knbscode\handledfont#1\knbscode\handledfont#2\relax
- \stbscode\handledfont#1\stbscode\handledfont#2\relax
- \shbscode\handledfont#1\shbscode\handledfont#2\relax}
-
- \def\definespacefactor#1 #2 #3 #4 #5 %
- {\setfonttoks
- \let\inherithandling\inheritspacefactor
- \appendtoks\dosetquartethandling\dododefinespacefactor#1 #2 #3 #4 #5 \to\fonttoks}
-
- \def\inheritspacefactor#1 #2 %
- {\setfonttoks
- \appendtoks\doinhsomehandling\dodoinheritspacefactor#1 #2 \to\fonttoks}
-
-\fi
-
-\ifx\setspacehandling\gobbleoneargument \else
- \appendtoks
- \setspacehandling\askedfonthandling
- \to \everyenablefonthandling
-\fi
-
-% font attributes
-
-\let\notagcode\minusone
-
-\ifx\tagcode\undefined
-
- \def\settagcode #1 #2 {}
-
-\else
-
- \def\dodosettagcode#1#2%
- {\tagcode\handledfont#1 #2\relax}
-
- \def\settagcode#1 #2 %
- {\setfonttoks
- \appendtoks\dosetsomehandling\dodosettagcode#1 #2 \to\fonttoks}
-
-\fi
-
-% hook into font mechanism
-
-\let\fonthandling\empty
-
-\def\startfonthandling[#1]%
- {\def\fonthandling{#1}%
- \ifcsname\@fha@\fonthandling\endcsname\else
- \expandafter\newtoks\csname\@fha@\fonthandling\endcsname
- \fi
- \setfonttoks}
-
-\def\stopfonthandling
- {\let\fonthandling\empty}
-
-\def\setfonttoks
- {\@EA\let\@EA\fonttoks\csname\@fha@\fonthandling\endcsname}
-
-\def\definefonthandling
- {\dotripleempty\dodefinefonthandling}
-
-\def\dodefinefonthandling[#1][#2][#3]%
- {\ifthirdargument
- \setvalue{\@fha@\@fha@#1}{#2}%
- \getparameters
- [\@fha@\@fha@#1]
- [\c!type=\v!hanging,%
- \c!left=1,\c!right=1,%
- \c!min=20,\c!max=20,\c!step=5,%
- \c!factor=1,%
- #3]%
- \else
- \setvalue{\@fha@\@fha@\@fha@#1}{#2}%
- \fi}
-
-\def\setupfonthandling
- {\dodoubleempty\dosetupfonthandling}
-
-\def\dosetupfonthandling[#1][#2]%
- {\getparameters[\@fha@\@fha@#1][#2]}
-
-\def\enablehandling
- {\dodoubleempty\doenablehandling}
-
-\def\doenablehandling[#1][#2]% handling / symbolic fontname
- {\fastenablehandling{#1}{#2}} % for the moment the same as:
-
-\def\fastenablehandling#1#2% also gets #2 passed
- {\edef\askedfonthandling{#1}%
- \edef\filoffonthandling{#2}%
- \ifcsname\@fha@\@fha@\@fha@\askedfonthandling\endcsname
- \@EA\redofastenablehandling
- \else\ifcsname\@fha@\@fha@\askedfonthandling\endcsname
- \@EAEAEA\dofastenablehandling
- \else
- \@EAEAEA\nofastenablehandling
- \fi\fi}
-
-\def\xfastenablehandling#1%
- {\edef\askedfonthandling{#1}%
- \ifcsname\@fha@\@fha@\askedfonthandling\endcsname
- \@EA\dofastenablehandling
- \else
- \@EA\nofastenablehandling
- \fi}
-
-\def\redofastenablehandling
- {\startdirectcharacters
- \edef\fonthandling{\csname\@fha@\@fha@\@fha@\askedfonthandling\endcsname}%
- \rawprocesscommacommand[\fonthandling]\xfastenablehandling
- \stopdirectcharacters}
-
-\def\dofastenablehandling
- {\startdirectcharacters
- \the\everyenablefonthandling
- \edef\fonthandling{\csname\@fha@\@fha@\askedfonthandling\endcsname}%
- \checkfonthandling\filoffonthandling
- \rawprocesscommacommand[\fonthandling]\dodoenablehandling
- \registerfonthandling\filoffonthandling
- \stopdirectcharacters}
-
-\def\nofastenablehandling
- {\the\everyenablefonthandling
- \let\fonthandling\askedfonthandling
- \dodoenablehandling\fonthandling}
-
-\def\dodoenablehandling#1%
- {\ifcsname\@fha@#1\endcsname
- \the\csname\@fha@#1\endcsname
- \fi}
-
-%D We must not use \type {\purefontname} here (was a bug)!
-
-% not robust as long as tex reuses definitions internally
-%
-% \def\checkfonthandling#1% we need a fast compare
-% {\doifelsevalue{#1\s!handling\c!file}{\fontname\font}
-% \skiphandlingdeftrue\skiphandlingdeffalse}
-%
-% \def\registerfonthandling#1%
-% {\@EA\xdef\csname#1\s!handling\c!file\endcsname{\fontname\font}}
-
-\def\checkfonthandling #1{\skiphandlingdeffalse}
-\let\registerfonthandling \gobbleoneargument
-
-%D This one makes live easier (less definitions):
-
-\def\inherithandling #1 #2 %
- {\inheritprotrudefactor #1 #2 %
- \inheritadjustfactor #1 #2 }
-
-%D \macros
-%D {usehandling}
-%D
-%D Handling definitions are collected in dedicated files and
-%D loaded only once:
-%D
-%D % \showsetup{usehandling}
-
-\def\dousehandling#1% is the same as encoding
- {\doifundefined{\c!file\f!handlingprefix#1}%
- {\letvalueempty{\c!file\f!handlingprefix#1}%
- \makeshortfilename[\truefilename{\f!handlingprefix#1}]%
- \startreadingfile
- \readsysfile{\shortfilename.mkii}
- {\showmessage\m!handlings2{#1}}
- {\showmessage\m!handlings3{#1}}%
- \stopreadingfile}}
-
-\def\usehandling[#1]%
- {\processcommalist[#1]\dousehandling}
-
-%D New:
-
-\def\overloadcharacter#1 #2 %
- {\setfonttoks
- \doifnumberelse{\string#2}
- {\appendtoks\dooverloadcharacter{#1}{\char#2 }\to\fonttoks}
- {\appendtoks\dooverloadcharacter{#1}{#2}\to\fonttoks}}
-
-\def\dooverloadcharacter#1%
- {\setvalue{\characterencoding\string#1}}
-
-%D Let's now see if this macro works:
-
-% \setupfonthandling
-% [\s!default]
-% [\c!links=1,\c!rechts=1,\c!min=20,\c!max=20,\c!stap=5]
-
-% Beware of fonttoks:
-%
-% \startfonthandling[morespacing]
-% \appendtoks
-% \fontdimen2\handledfont=.50em
-% \fontdimen3\handledfont=.25em
-% \fontdimen4\handledfont=.25em
-% \to \fonttoks
-% \stopfonthandling
-%
-% \definefonthandling [morespacing] [morespacing]
-%
-% \definefontsynonym[xtexnansi-lmr7][texnansi-lmr7][handling=morespacing]
-% \definefont[crap][texnansi-lmr7]
-%
-% \crap \the\fontdimen2\font, \the\fontdimen3\font, \the\fontdimen4\font
-
-\usehandling [def]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/java-ans.mkii b/Master/texmf-dist/tex/context/base/mkii/java-ans.mkii
deleted file mode 100644
index 7e310baa495..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/java-ans.mkii
+++ /dev/null
@@ -1,28 +0,0 @@
-%D \module
-%D [ file=java-ans,
-%D version=1998.06.01,
-%D title=\CONTEXT\ JavaScript Macros,
-%D subtitle=Answer Analization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\startJSpreamble{Do_Check_Answer} used later
-
- function Do_Check_Answer (field, value)
- { if (event.value.toLowerCase()==value.toLowerCase())
- { event.target.hidden = true }
- % { event.target.display = display.hidden }
- return("\040") } // funny, "" does not work
-
-\stopJSpreamble
-
-\startJScode{Check_Answer} uses {Do_Check_Answer}
- event.value = Do_Check_Answer(JS_S_1, JS_S_2) ;
-\stopJScode
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/java-exa.mkii b/Master/texmf-dist/tex/context/base/mkii/java-exa.mkii
deleted file mode 100644
index 584ee13512d..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/java-exa.mkii
+++ /dev/null
@@ -1,395 +0,0 @@
-%D \module
-%D [ file=java-exa,
-%D version=2002.??.??,
-%D title=\CONTEXT\ JavaScript Macros,
-%D subtitle=Example Support,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% XFDF versus HTML
-% localhost versus remote versus set
-
-% filename | filename-nr => name
-% fakename | fakename-nr => file upload, unless localhost
-%
-% we erase the list because otherwise we end up in browser remembering
-% problems; also, it is not possible to set upload fields 'manually'
-
-\startJSpreamble request_1 used now
-
- var example_method = "HTML" ;
- var example_host = "" ;
- var example_port = "" ;
- var example_url = "" ;
- var example_file = "" ;
-
- var example_log = true ; % false
-
- function stripped_exa_value( name ) {
- f = this.getField(name) ;
- if (f) {
- str = f.value ;
- if (str.indexOf(name+'-')==0) {
- str = str.substr(name.length+1) ;
- }
- return str ;
- } else {
- return "" ;
- }
- }
-
- function identify_example_url ( ) {
- if (example_log) {
- console.clear ;
- console.println("base url: "+this.baseURL) ;
- console.println("this url: "+this.URL) ;
- }
- if (this.baseURL != "") {
- example_url = this.baseURL ;
- } else {
- if (this.URL != "") {
- example_url = this.URL
- }
- }
- if (example_url.indexOf("file://")>=0) {
- example_url = "" ;
- }
- str = stripped_exa_value("examplehost") ;
- if (str != "auto") {
- example_host = str ;
- if (str == "localhost") {
- example_port = "8061"
- }
- }
- str = stripped_exa_value("exampleport") ;
- if (str != "auto") {
- example_port = str ;
- }
- if (example_log) {
- console.println("example_url: "+example_url) ;
- console.println("example_host: "+example_host) ;
- console.println("example_port: "+example_port) ;
- }
- }
-
- function check_example_url ( url ) {
- if (url.indexOf("file://")>=0) {
- url = "http://localhost:8061" ;
- console.println("file url replaced by: "+url) ;
- } else {
- if (url.indexOf("://")<0) {
- url = "http://" + url ;
- }
- if (example_log) {
- console.println("url before check: "+url) ;
- }
-% url = url.replace(/(http:\\\/\\\/.+)(\\\/.*$)/, "$1") ;
- url = url.replace(/(https*:\\\/\\\/.+?)(\\\/.*$)/, "$1/exarequest") ;
- if (example_log) {
- console.println("url after check: "+url) ;
- }
- }
- return url ;
- }
-
- function set_example_xfdf ( method ) {
- example_method = method ;
- }
-
- function set_example_file ( file ) {
- example_method = file ;
- }
-
- function set_example_host ( host ) {
- example_host = host ;
- }
-
- function set_example_port ( port ) {
- example_host = host ;
- }
-
- function do_erase_example_file(tag) {
- f = this.getField(tag) ;
- if (f) {
- f.value = "" ;
- }
- }
-
- function do_erase_example_list(tag) {
- for (i=1;i<=100;i++) {
- f = this.getField(tag+"-"+i) ;
- if (f) {
- f.value = "" ;
- } else {
- return
- }
- }
- }
-
- function do_submit_example_url ( url ) {
- if ((example_method == "XFDF" ) || (url.indexOf("localhost")>=0)) {
- do_erase_example_file("fakename") ;
- do_erase_example_list("fakename") ;
- }
- url = check_example_url(url) ;
- if (example_log) {
- console.println("submitting form to "+url+" using method "+example_method) ;
- }
- if (example_file != "") {
- url = url + "/" + example_file ;
- }
- % we need the bFDF for acrobat 5
- this.submitForm({cURL : url, bFDF : false, cSubmitAs : example_method}) ;
- }
-
- function submit_example_form ( ) {
- identify_example_url() ;
- if (example_host != "") {
- if (example_port != "") {
- do_submit_example_url(example_host+":"+example_port) ;
- } else {
- do_submit_example_url(example_host) ;
- }
- } else {
- if (example_url != "") {
- do_submit_example_url(example_url) ;
- } else {
- if (example_port != "") {
- do_submit_example_url("localhost"+":"+example_port) ;
- } else {
- do_submit_example_url("localhost:8061") ; % local exampler
- }
- }
- }
- resetfilename () ;
- }
-
- function submit_form ( host, port) {
- set_example_host(host) ;
- set_example_post(post) ;
- submit_example_form ;
- }
-
-\stopJSpreamble
-
-\startJSpreamble request_2 used now
-
- var exa_command = "" ;
- var exa_option = "" ;
- var exa_filename = "" ;
- var exa_filelist = "" ;
- var exa_registered = "" ;
-
- function set_request (command,option) {
- exa_command = command ;
- if (exa_command == "") {
- exa_option = option ;
- } else { if (option == "") {
- exa_option = "" ;
- } else { if (option.indexOf("--")<0) {
- exa_option = "--action=" + option ;
- } else {
- exa_option = option ;
- } } }
- }
-
- function assemble_request ( ) {
- v = this.getField('filename') ;
- if (v) {
- exa_filename = v.value ;
- }
- v = this.getField('filelist') ;
- if (v) {
- exa_filelist = v.value ;
- }
-% exa_filename = exa_filename.replace(/\\\\/g,'/') ;
-% exa_filelist = exa_filelist.replace(/\\\\/g,'/') ;
- str = "<?xml version='1.0' ?>\\n" ;
- str = str+"<exa:request xmlns:exa='http://www.pragma-ade.com/schemas/example.rng'><exa:application>" ;
- if (exa_filelist == "") {
- exa_filelist = exa_registered ;
- } else { if (exa_registered != "") {
- exa_filelist = exa_filelist + "\\n" + exa_registered ;
- } }
- if (exa_command != "") {
- str = str+"<exa:command>"+exa_command+"</exa:command>" ;
- }
- if (exa_option != "") {
- str = str+"<exa:option>"+exa_option+"</exa:option>" ;
- }
- if (exa_filename != "") {
- str = str+"<exa:filename>"+exa_filename+"</exa:filename>" ;
- }
- var fls = "" ;
- if (exa_filelist != "") {
- % old method, soon obsolete
- lst = exa_filelist.split(/\\s/) ;
- for (i=0;i<lst.length;i++) {
- fls = fls+"<exa:entry>"+lst[i]+"</exa:entry>" ;
- }
- } else { if (exa_multiple) {
- for (i=1;i<=100;i++) {
- % console.println("file field "+i) ;
- f = this.getField("filename-"+ i) ;
-% if (f) { if (f.value != "") {
-% if (g) { if (g.value == "") {
-% fls = fls+"<exa:entry>"+f.value+"</exa:entry>" ;
-% } else {
-% fls = fls+"<exa:entry label='" + g.value + "'>"+f.value+"</exa:entry>" ;
-% } } else {
-% fls = fls+"<exa:entry>"+f.value+"</exa:entry>" ;
-% }
-% } }
- if (f) { if (f.value != "") {
- fls = fls + "<exa:entry" ;
- g = this.getField("dataname-"+ i) ;
- if (g) { if (g.value == "") {
- % console.println("a") ;
- fls = fls + ">" ;
- } else {
- % console.println("b") ;
- fls = fls + " label='" + g.value + "'>" ;
- } } else {
- % console.println("c") ;
- fls = fls + ">" ;
- }
- fls = fls + f.value + "</exa:entry>" ;
- } }
- }
- } }
- if (fls != "") {
- str = str + "<exa:filelist>" + fls + "</exa:filelist>" ;
- }
- str = str + "</exa:application></exa:request>" ;
- v = this.getField('exa:request') ;
- if (v) {
- v.value = str ;
- }
- }
-
-\stopJSpreamble
-
-\startJSpreamble request_3 used now
-
- var exa_multiple = false ;
-
- function setfilename ( suffixes ) {
- if (event.targetName) {
- var name = event.targetName ;
- var fake = name.replace(/filename/,"fakename") ;
- } else {
- var name = 'filename' ;
- var fake = 'fakename' ;
- }
- f = this.getField(fake) ;
- if (f) {
- f.browseForFileToSubmit() ;
- if ((suffixes != "") && (f.value != "")) {
- %
- s = suffixes.replace(/,/g,"|") ;
- r = new RegExp() ;
- s = "\\\\.(" + s + ")$" ;
- r.compile(s, "i") ;
- if (f.value.search(r)<=0) {
- f.value = "" ;
- app.alert('This filetype is not permitted.') ;
- %
- % lst = suffixes.split(/,/) ;
- % ok = false ;
- % for (i=0;i<lst.length;i++) {
- % if (f.value == lst[i]) {
- % ok = true ;
- % }
- % }
- % if (! ok) {
- % f.value = "" ;
- % app.alert('This filetype is not permitted.') ;
- %
- }
- }
- g = this.getField(name) ;
- if (g) {
- g.value = f.value ;
- }
-% we need to set the value of the selector to empty else
-% we get some funny preloading of multimeg files in spite
-% of the specs that say that xml fields will not get sent
-% if (example_method == "XFDF" ) {
-% f.value = "" ;
-% } else {
-% identify_example_url ;
-% if (example_url.indexOf("localhost")>=0) {
-% f.value = "" ;
-% }
-% }
- }
- this.dirty = false ;
- }
-
- function addfilename () {
- if (exa_multiple) {
- h = this.getField("filelist") ;
- g = this.getField("filename") ;
- if ((g) && (h)) {
- str = g.value ;
- if (h.value == "") {
- h.value = str ;
- } else {
- h.value = h.value + "\\n" + str ;
- }
- g.value = "" ;
- this.value = "" ;
- }
- }
- this.dirty = false ;
- }
-
- % this only works with client that assembles request
-
- function registerfilename (str) {
- if (str!="") {
- h = this.getField("filelist") ;
- if (h) {
- if (h.value != "") {
- h.value = h.value + "\\n" ;
- }
- h.value = h.value + str ;
- } else {
- if (exa_registered != "") {
- exa_registered = exa_registered + "\\n" ;
- }
- exa_registered = exa_registered + str ;
- }
- }
- console.show ;
- console.println('registered files') ;
- console.println("file: "+str) ;
- console.println("list: "+exa_registered) ;
- this.dirty = false ;
- }
-
- function checkfilename () {
- }
-
- function getfilename ( suffixes ) {
- setfilename(suffixes) ;
- checkfilename() ;
- addfilename() ;
- }
-
- function resetfilename () {
- do_erase_example_file("fakename") ;
- do_erase_example_file("filename") ;
- do_erase_example_file("filelist") ;
- do_erase_example_list("filename") ;
- do_erase_example_list("fakename") ;
- }
-
-\stopJSpreamble
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/java-fil.mkii b/Master/texmf-dist/tex/context/base/mkii/java-fil.mkii
deleted file mode 100644
index 20376af44d6..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/java-fil.mkii
+++ /dev/null
@@ -1,48 +0,0 @@
-%D \module
-%D [ file=java-fil,
-%D version=1998.06.01,
-%D title=\CONTEXT\ JavaScript Macros,
-%D subtitle=Filing and Printing,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\startJSpreamble Auxiliary used now
-
- function DocumentFileName ()
- { var Paths = this.path.split("/") ;
- Paths = Paths[Paths.length-1].split(".") ;
- return(Paths[0]) }
-
- function Print_Page_Range(From, To) % gaat mis, nog geen args mogelijk
- { if ((Number(From)>0)&&(Number(To)>=Number(From)))
- { var myFrom = Number(From)-1 ;
- var myTo = Number(To)-1 ;
- this.print(false,myFrom,myTo,true) } }
-
- function Print_This_Page ()
- { this.print(false,this.pageNum,this.pageNum,true) }
-
-\stopJSpreamble
-
-\definereference
- [PrintSubPaginas]
- [JS(Print_Page_Range{\firstsubpage,\lastsubpage})]
-
-\definereference
- [PrintSubPages]
- [JS(Print_Page_Range{\firstsubpage,\lastsubpage})]
-
-\definereference
- [PrintDezePagina]
- [JS(Print_This_Page)]
-
-\definereference
- [PrintThisPage]
- [JS(Print_This_Page)]
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/java-fld.mkii b/Master/texmf-dist/tex/context/base/mkii/java-fld.mkii
deleted file mode 100644
index 0a76cc93c12..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/java-fld.mkii
+++ /dev/null
@@ -1,475 +0,0 @@
-%D \module
-%D [ file=java-fld,
-%D version=1998.05.20,
-%D title=\CONTEXT\ JavaScript Macros,
-%D subtitle=Field Support,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% will be simplified, since we now parse functions
-
-% nu nog alles geladen, moet dus anders
-
-\startJSpreamble {Sanitize_TeX_Input} used later
-
- function Sanitized_TeX_String (value)
- { var v = value ;
- v = v.replace( /\\\\oe/g,"\\234") ;
- v = v.replace( /\\\\<</g,"\\253") ;
- v = v.replace( /\\\\>>/g,"\\273") ;
- v = v.replace( /\\\\`A/g,"\\300") ;
- v = v.replace( /\\\\'A/g,"\\301") ;
- v = v.replace( /\\\\^A/g,"\\302") ;
- v = v.replace( /\\\\~A/g,"\\303") ;
- v = v.replace( /\\\\"A/g,"\\304") ;
- v = v.replace( /\\\\oA/g,"\\305") ;
- v = v.replace( /\\\\AE/g,"\\306") ;
- v = v.replace( /\\\\,C/g,"\\307") ;
- v = v.replace( /\\\\`E/g,"\\310") ;
- v = v.replace( /\\\\'E/g,"\\311") ;
- v = v.replace( /\\\\^E/g,"\\312") ;
- v = v.replace( /\\\\"E/g,"\\313") ;
- v = v.replace( /\\\\`I/g,"\\314") ;
- v = v.replace( /\\\\'I/g,"\\315") ;
- v = v.replace( /\\\\^I/g,"\\316") ;
- v = v.replace( /\\\\"I/g,"\\317") ;
- v = v.replace( /\\\\~N/g,"\\321") ;
- v = v.replace( /\\\\`O/g,"\\322") ;
- v = v.replace( /\\\\'O/g,"\\323") ;
- v = v.replace( /\\\\^O/g,"\\324") ;
- v = v.replace( /\\\\~O/g,"\\325") ;
- v = v.replace( /\\\\"O/g,"\\326") ;
- v = v.replace( /\\\\`U/g,"\\331") ;
- v = v.replace( /\\\\'U/g,"\\332") ;
- v = v.replace( /\\\\^U/g,"\\333") ;
- v = v.replace( /\\\\"U/g,"\\334") ;
- v = v.replace( /\\\\'Y/g,"\\335") ;
- v = v.replace( /\\\\ss/g,"\\337") ;
- v = v.replace( /\\\\`a/g,"\\340") ;
- v = v.replace( /\\\\'a/g,"\\341") ;
- v = v.replace( /\\\\^a/g,"\\342") ;
- v = v.replace( /\\\\~a/g,"\\343") ;
- v = v.replace( /\\\\"a/g,"\\344") ;
- v = v.replace( /\\\\oa/g,"\\345") ;
- v = v.replace( /\\\\ae/g,"\\346") ;
- v = v.replace( /\\\\,c/g,"\\347") ;
- v = v.replace( /\\\\`e/g,"\\350") ;
- v = v.replace( /\\\\'e/g,"\\351") ;
- v = v.replace( /\\\\^e/g,"\\352") ;
- v = v.replace( /\\\\"e/g,"\\353") ;
- v = v.replace( /\\\\`i/g,"\\354") ;
- v = v.replace( /\\\\'i/g,"\\355") ;
- v = v.replace( /\\\\^i/g,"\\356") ;
- v = v.replace( /\\\\"i/g,"\\357") ;
- v = v.replace( /\\\\~n/g,"\\361") ;
- v = v.replace( /\\\\`o/g,"\\362") ;
- v = v.replace( /\\\\'o/g,"\\363") ;
- v = v.replace( /\\\\^o/g,"\\364") ;
- v = v.replace( /\\\\~o/g,"\\365") ;
- v = v.replace( /\\\\"o/g,"\\366") ;
- v = v.replace( /\\\\`u/g,"\\371") ;
- v = v.replace( /\\\\'u/g,"\\372") ;
- v = v.replace( /\\\\^u/g,"\\373") ;
- v = v.replace( /\\\\"u/g,"\\374") ;
- v = v.replace( /\\\\'y/g,"\\375") ;
- v = v.replace( /\\\\"y/g,"\\377") ;
- return(v) }
-
- var TeX_Key_Mode = 0 ;
-
- function Initialize_TeX_Keystroke ()
- { TeX_Key_Char = "" ;
- TeX_Key_Mode = 0 }
-
- function Sanitized_TeX_Keystroke (change)
- { if (change=="\\\\")
- { TeX_Key_Mode = 1 ;
- return("") }
- else if (TeX_Key_Mode==1)
- { TeX_Key_Mode = 2 ;
- TeX_Key_Char = change ;
- return("") }
- else if (TeX_Key_Mode==2)
- { TeX_Key_Mode = 0 ;
- TeX_Key_Char = "\\\\"+TeX_Key_Char+change ;
- return(Sanitized_TeX_String(TeX_Key_Char)) }
- else
- { TeX_Key_Mode = 0 ;
- return(change) } }
-
-\stopJSpreamble
-
-\startJScode {Initialize_TeX_Key} uses {Sanitize_TeX_Input}
- Initialize_TeX_Keystroke() ;
-\stopJScode
-
-\startJScode {Convert_TeX_Key} uses {Sanitize_TeX_Input}
- if (!event.willCommit)
- { event.change = Sanitized_TeX_Keystroke(event.change) }
-\stopJScode
-
-\startJScode{Convert_TeX_String} uses {Sanitize_TeX_Input}
- event.value = Sanitized_TeX_String(event.value) ;
-\stopJScode
-
-\startJSpreamble fields_1 used now
-
-var visible_field = new Array() ;
-var visible_fields = 0 ;
-
-function PresetFields ( )
- { this.syncAnnotScan() }
-
-function Preset_Fields ( )
- { this.syncAnnotScan() }
-
-function Hide_When_Down ( )
- { event.target.hidden = true }
-
-function Hide_Field ( Name )
- { var v = this.getField(Name) ;
- if (v)
- { v.hidden = true ;
- v.readonly = true ;
- this.dirty = false } }
-
-function Do_Vide_Field ( Name, Closable )
- { var v = this.getField(Name) ;
- if (v)
- { ++visible_fields ;
- visible_field[visible_fields] = Name ;
- v.hidden = false ;
- if (Closable)
- { v.readonly = false ;
- v.value = "On" }
- this.dirty = false } }
-
-function Vide_Field ( Name )
- { Do_Vide_Field(Name,false) }
-
-function Vide_Hide_Field ( Name )
- { Do_Vide_Field(Name,true) }
-
-function Hide_Fields ()
- { while (visible_fields>0)
- { Hide_Field(visible_field[visible_fields]) ;
- --visible_fields } }
-
-function Vide_Fields ( Name )
- { Hide_Fields () ;
- Vide_Field ( Name) }
-
-function Vide_Hide_Fields ( Name )
- { Hide_Fields () ;
- Vide_Hide_Field ( Name) }
-
-function Toggle_Hide ( Name )
- { var v = this.getField(Name) ;
- if (v)
- { v.hidden = !v.hidden ;
- this.dirty = false } }
-
-function Field_On ( Name )
- { v = this.getField(Name) ;
- if (v) { v.value = "On" ; this.dirty = false } }
-
-function Field_Off ( Name )
- { var v = this.getField(Name) ;
- if (v) { v.value = "Off" ; this.dirty = false } }
-
-function Toggle_Value ( Name )
- { var v = this.getField(Name) ;
- if (v)
- { if (v.value=="On")
- { v.value = "Off" }
- else
- { v.value = "On" } }
- this.dirty = false }
-
-function Toggle_Read ( Name )
- { var v = this.getField(Name);
- if (v) { v.readonly = !v.readonly } }
-
-function Flip_Fields ( Name )
- { var Names = Name.split(",") ;
- for (var i=0;i<Names.length;i++)
- { v = this.getField(Names[i]) ;
- if (v)
- { v.hidden = !v.hidden ;
- v.value = "On" } } }
-
-function Forget_Changes ()
- { this.dirty = false }
-
-function ForgetChanges ()
- { this.dirty = false }
-\stopJSpreamble
-
-%\startJScode{Hide_When_Down} Hide_When_Down() \stopJScode
-%\startJScode{Hide_Field} Hide_Field(JS_S_1) \stopJScode
-%\startJScode{Vide_Field} Vide_Field(JS_S_1) \stopJScode
-%\startJScode{Toggle_Hide} Toggle_Hide(JS_S_1) \stopJScode
-%\startJScode{Field_On} Field_On(JS_S_1) \stopJScode
-%\startJScode{Field_Off} Field_Off(JS_S_1) \stopJScode
-%\startJScode{Toggle_Value} Toggle_Value(JS_S_1) \stopJScode
-%\startJScode{Toggle_Read} Toggle_Read(JS_S_1) \stopJScode
-%\startJScode{Flip_Fields} Flip_Fields(JS_S_1) \stopJScode
-%
-%\startJScode{Forget_Changes} this.dirty = false \stopJScode
-
-\definereference[ForgetChanges][JS(Forget_Changes)]
-
-% This can be done more efficient, by keeping track of the
-% current top of the stack.
-
-\startJSpreamble FieldStack used later
-
-function Reset_Fields ( FieldSet ) {
- var i = 1 ;
- while (true) {
- v = this.getField(FieldSet+":"+i) ;
- if (!v) {
- break ;
- } else {
- v.value = "Off" ;
- }
- i++ ;
- }
-}
-
-function Set_Fields ( FieldSet ) {
- var i = 1 ;
- while (true) {
- v = this.getField(FieldSet+":"+i) ;
- if (!v) {
- break ;
- } else {
- v.value = "On" ;
- }
- i++ ;
- }
-}
-
-function Set_Field ( FieldSet, FieldName ) {
- Reset_Fields(FieldSet) ;
- v = this.getField(FieldSet+":"+FieldName) ;
- if (v) {
- v.value = "On" ;
- }
-}
-
-function Reset_Field ( FieldSet, FieldName ) {
- Set_Fields(FieldSet) ;
- v = this.getField(FieldSet+":"+FieldName) ;
- if (v) {
- v.value = "Off" ;
- }
-}
-
-function Walk_Field ( FieldSet ) {
- var i = 1 ;
- while (true) {
- v = this.getField(FieldSet+":"+i) ;
- if (v) {
- if (v.value=="On") {
- v.value = "Off" ;
- var ii = i ;
- ii++ ;
- v = this.getField(FieldSet+":"+ii) ;
- if (!v) {
- v = this.getField(FieldSet+":"+1) ;
- }
- if (v) {
- v.value = "On" ;
- }
- break ;
- }
- i++ ;
- } else {
- break ;
- }
- }
-}
-
-var FieldSets = new Array() ;
-
-function Do_Get_Check_Walk_Field ( FieldSet ) {
- var f = FieldSets[FieldSet]
- if (! f) {
- f = new Array() ;
- f.number = 0 ;
- f.delay = 500 ;
- f.paused = false ;
- f.running = false ;
- f.name = FieldSet ;
- f.timeout = null ;
- FieldSets[FieldSet] = f ;
- }
- return f
-}
-
-function Do_Next_Auto_Walk_Field ( FieldSet ) {
- var fieldset = Do_Get_Check_Walk_Field(FieldSet) ;
- if (fieldset) {
- var v = this.getField(FieldSet + ":" + fieldset.number) ;
- if (v) {
- if (v.value == "On") {
- v.value = "Off" ;
- }
- }
- fieldset.number++ ;
- v = this.getField(FieldSet + ":" + fieldset.number) ;
- if (! v) {
- fieldset.number = 1 ;
- v = this.getField(FieldSet + ":" + fieldset.number) ;
- }
- if (v) {
- v.value = "On"
- }
- }
-}
-
-function Do_Stop_Auto_Walk_Field ( FieldSet ) {
- var fieldset = Do_Get_Check_Walk_Field(FieldSet) ;
- if (fieldset) {
- try {
- app.clearInterval(fieldset.timeout) ;
- app.clearTimeOut(fieldset.timeout) ;
- } catch (e) {
- }
- }
-}
-
-function Do_Start_Auto_Walk_Field ( FieldSet ) {
- var fieldset = Do_Get_Check_Walk_Field(FieldSet) ;
- if (fieldset) {
- Do_Stop_Auto_Walk_Field(FieldSet) ;
- fieldset.timeout = app.setInterval("Do_Next_Auto_Walk_Field('"+FieldSet+"')", fieldset.delay) ;
- }
-}
-
-function Start_Walk_Field ( FieldSet, Delay ) {
- var fieldset = Do_Get_Check_Walk_Field(FieldSet) ;
- if (fieldset) {
- fieldset.number = 0 ;
- if (Delay) {
- fieldset.delay = Delay ;
- }
- Reset_Fields(FieldSet) ;
- Do_Start_Auto_Walk_Field(FieldSet) ;
- fieldset.running = true ;
- fieldset.paused = false ;
- }
-}
-
-function Pause_Walk_Field ( FieldSet ) {
- var fieldset = Do_Get_Check_Walk_Field(FieldSet) ;
- if (fieldset) {
- if (fieldset.running) {
- if (fieldset.paused) {
- Do_Start_Auto_Walk_Field(FieldSet) ;
- fieldset.paused = false ;
- } else {
- Do_Stop_Auto_Walk_Field(FieldSet) ;
- fieldset.paused = true ;
- }
- }
- }
-}
-
-function Stop_Walk_Field ( FieldSet ) {
- var fieldset = Do_Get_Check_Walk_Field(FieldSet) ;
- if (fieldset) {
- Do_Stop_Auto_Walk_Field(FieldSet) ;
- fieldset.running = false ;
- fieldset.paused = false ;
- }
-}
-
-function Reset_Walk_Field ( FieldSet ) {
- var fieldset = Do_Get_Check_Walk_Field(FieldSet) ;
- if (fieldset) {
- Do_Stop_Auto_Walk_Field(FieldSet) ;
- fieldset.number = 0 ;
- fieldset.running = false ;
- fieldset.paused = false ;
- Reset_Fields(FieldSet) ;
- }
-}
-
-function Previous_Walk_Field ( FieldSet ) {
- var fieldset = Do_Get_Check_Walk_Field(FieldSet) ;
- if (fieldset) {
- Do_Stop_Auto_Walk_Field(FieldSet) ;
- fieldset.running = false ;
- fieldset.paused = false ;
- if (fieldset.number>0) {
- var v = this.getField(FieldSet + ":" + fieldset.number) ;
- if (v) {
- if (v.value == "On") {
- v.value = "Off" ;
- }
- }
- fieldset.number-- ;
- v = this.getField(FieldSet + ":" + fieldset.number) ;
- if (v) {
- v.value = "On" ;
- }
- }
- }
-}
-
-function Next_Walk_Field ( FieldSet ) {
- var fieldset = Do_Get_Check_Walk_Field(FieldSet) ;
- if (fieldset) {
- Do_Stop_Auto_Walk_Field(FieldSet) ;
- fieldset.running = false ;
- fieldset.paused = false ;
- var f = fieldset.number + 1 ;
- var v = this.getField(FieldSet + ":" + f) ;
- if (v) {
- var v = this.getField(FieldSet + ":" + fieldset.number) ;
- if (v) {
- if (v.value == "On") {
- v.value = "Off" ;
- }
- }
- fieldset.number++ ;
- v = this.getField(FieldSet + ":" + fieldset.number) ;
- if (v) {
- v.value = "On" ;
- }
- }
- }
-}
-
-function Set_Walk_Field_Delay ( FieldSet, Delay ) {
- var fieldset = Do_Get_Check_Walk_Field(FieldSet) ;
- if (fieldset) {
- if (Delay) {
- fieldset.delay = Delay ;
- if (fieldset.running) {
- Do_Stop_Auto_Walk_Field(FieldSet) ;
- Do_Start_Auto_Walk_Field(FieldSet) ;
- }
- }
- }
-}
-
-\stopJSpreamble
-
-\definereference[Walk] [JS(Walk_Field)]
-\definereference[StartWalk] [JS(Start_Walk_Field)]
-\definereference[StopWalk] [JS(Stop_Walk_Field)]
-\definereference[PauseWalk] [JS(Pause_Walk_Field)]
-\definereference[ResetWalk] [JS(Reset_Walk_Field)]
-\definereference[PreviousWalk][JS(Previous_Walk_Field)]
-\definereference[NextWalk] [JS(Next_Walk_Field)]
-\definereference[SetWalkDelay][JS(Set_Walk_Field_Delay)]
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/java-ini.mkii b/Master/texmf-dist/tex/context/base/mkii/java-ini.mkii
deleted file mode 100644
index 2e62ca166f4..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/java-ini.mkii
+++ /dev/null
@@ -1,693 +0,0 @@
-%D \module
-%D [ file=java-ini,
-%D version=1998.01.30,
-%D title=\CONTEXT\ JavaScript Macros,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 JavaScript Macros / Initialization}
-
-% BUG: preamble zonder used/used en split
-
-% todo: lua sanitizer
-
-% JavaScript support is under development. In the near future
-% a slightly different model will be used. The JScode stuff
-% will probably become just auto function inclusion and the
-% JS_* things will disappear. First I have to find a way to
-% deal with global variables so the 'uses' thing will remain.
-
-% ook p{ref}
-% documentation should be corrected to JS(
-
-% Also, obeylines will be supported.
-
-\unprotect
-
-%D \JAVA\ support is not implemented as a generic support
-%D module. The main reason for this is that passing system
-%D variables to a \JAVASCRIPT\ is closely related to other core
-%D macros.
-
-%D \TEX\ is not the right tool to check the \JAVA\ code; the
-%D most we can do is reporting some passed variables:
-
-\newif\iftraceJScode \traceJScodefalse
-
-\let\traceJScode\traceJScodetrue
-
-%D A bit out of place, but not dangerous:
-
-\bgroup
-\catcode127=\@@letter
-\gdef\delcharacter{^^7f}
-\egroup
-
-%D The number of passed variables is minimalized by setting the
-%D next switch.
-
-\newif\ifminimalizeJScode \minimalizeJScodetrue
-
-%D \macros
-%D {JS*}
-%D
-%D Because \JAVASCRIPT's are activated by the user, for
-%D instance by activating on a button, their support is closely
-%D related to the referencing mechanism. Integration takes
-%D place by
-%D
-%D \starttyping
-%D \goto{calculate total}[Sum()]
-%D \stoptyping
-%D
-%D The \type{()} classify this as a script. If they are absent,
-%D the keyword is treated as a normal reference.
-%D
-%D One can pass arguments to such a script by saying:
-%D
-%D \starttyping
-%D \goto{calculate total}[Sum(1.5,2.3)]
-%D \stoptyping
-%D
-%D References are passed by using the \type{R{}} classifier.
-%D
-%D \starttyping
-%D \goto{calculate total}[Sum(1.5,2.3,R{overflow})]
-%D \stoptyping
-%D
-%D The last call calls the script \type{Sum} and passes the
-%D next set of variables:
-%D
-%D \starttyping
-%D JS_S_1="1.5";
-%D JS_S_2="2.3";
-%D JS_R_3="overflow";
-%D JS_P_3=3;
-%D \stoptyping
-%D
-%D The first two parameters are just strings, the third one
-%D however is treated as a reference and results in passing the
-%D reference (if needed this references is prefixed) and the
-%D (real) page number. The alternative:
-%D
-%D \starttyping
-%D \goto{calculate total}[JS(Sum{V{1.5},V{2.3},R{overflow}})]
-%D \stoptyping
-%D
-%D does a verbose passing:
-%D
-%D \starttyping
-%D JS_V_1=1.5;
-%D JS_V_2=2.3;
-%D JS_R_3="overflow";
-%D JS_P_3=3;
-%D \stoptyping
-
-%D We will also support direct function calls. In that case
-%D no intermediate variables are used.
-
-%D \macros
-%D {startJScode}
-%D
-%D A piece of \JAVASCRIPT\ code is defined by saying:
-%D
-%D \starttyping
-%D \startJScode{SomeScript}
-%D var Item=this.getField("item");
-%D N=Item.getArray();
-%D Total=this.getField("total");
-%D Total.value=0;
-%D for (j=0; j<N.length; j++)
-%D { if (N[j].value!="")
-%D { Total.value += N[j].value } } ;
-%D if ((JS_N>0) && (JS_R_1!=""))
-%D { gotoNamedDest(JS_R_1) };
-%D \stopJScode
-%D \stoptyping
-%D
-%D Such a piece of code is closely related to the interpreter
-%D used. Watch the last two lines, here the script adapts
-%D itself to the presence of a reference.
-%D
-%D While
-%D
-%D \starttyping
-%D \startJScode{name}
-%D name = 4 ;
-%D \stopJScode
-%D \stoptyping
-%D
-%D assumes uses no preamble or presumes that the preamble is
-%D always loaded, the next definition also tells \CONTEXT\ to
-%D actually include the preamble needed.
-%D
-%D \starttyping
-%D \startJScode{uses} uses {later}
-%D uses = 6 ;
-%D \stopJScode
-%D \stoptyping
-
-\long\def\startJScode#1 #2
- {\doifelse{#2}{uses}
- {\dostartJScodeA{#1}}
- {\dostartJScodeB{#1} #2 }}
-
-\long\def\dostartJScodeA#1#2 #3\stopJScode
- {\long\setgvalue{\r!java#1}{\do{#2}{#3}}}
-
-\long\def\dostartJScodeB#1#2\stopJScode
- {\long\setgvalue{\r!java#1}{\do{}{#2}}}
-
-\let\stopJScode\relax
-
-%D \macros
-%D {presetJScode}
-%D
-%D The code can be retrieved by saying
-%D
-%D \starttyping
-%D \presetJScode{SomeScript}{template}
-%D \stoptyping
-%D
-%D Such a template is a comma separated list, where
-%D individual entries can optionally be transformed by
-%D \type{R{}} and \type{V{}}.
-%D
-%D After this call, the code is available in \type{\JScode}.
-
-\newif\ifdirectJScode
-
-\def\presetJScode#1#2% #1=operation #2=arguments
- {\setverbosecscharacters
- \def\par{\delcharacter}% was: { }
- \scratchcounter\zerocount
- \globallet\JScode\empty
- \def\do##1##2%
- {\doifelse{##2}{!}\directJScodetrue\directJScodefalse}%
- \getvalue{\r!java#1}%
- \edef\!!stringa{#2}%
- \ifx\!!stringa\empty \else
- \processcommacommand[\!!stringa]\dopresetJSvariables
- \fi
- \def\docommand##1%
- {\doifundefinedelse{\r!java\r!java##1}
- {\showmessage\m!javascript2{##1}}
- {\useJSpreamblenow{##1}}}%
-% {\doglobal\increment\currentJSpreamble
-% \doglobal\addtocommalist{##1}\allJSpreambles}}%
- \def\do##1##2%
- {\xdef\JScode{\ifdirectJScode#1(\JScode)\else\JScode##2\fi}%
- %\xdef\JScode{JS\string_N=\the\scratchcounter;\JScode}%
- \processcommalist[##1]\docommand}%
- \getvalue{\r!java#1}}
-
-\def\dopresetJSvariables#1%
- {\advance\scratchcounter \plusone
- \donefalse
- \dodopresetJSvariables#1\end}%
-
-\def\dodopresetJSvariables
- {\doifnextcharelse R\dodopresetJSrefvariables
- {\doifnextcharelse V\dodopresetJSvervariables
- {\doifnextcharelse S\dodopresetJSstrvariables
- \dodopresetJSrawvariables}}}
-
-\def\dodopresetJSrefvariables R#1\end
- {\doifreferencefoundelse{#1}
- {\donetrue \dododopresetJSvariables R{\referenceprefix#1}%
- \donefalse\dododopresetJSvariables P{\currentrealreference}}
- {\unknownreference{#1}}%
- \ifminimalizeJScode \else
- \donetrue\dododopresetJSvariables S{#1}%
- \fi}
-
-\def\dodopresetJSvervariables V#1\end
- {\donefalse\dododopresetJSvariables V{#1}%
- \ifminimalizeJScode \else
- \donetrue\dododopresetJSvariables S{#1}%
- \fi}
-
-\def\dodopresetJSstrvariables S#1\end
- {\donetrue\dododopresetJSvariables S{#1}}
-
-\def\dodopresetJSrawvariables #1\end
- {\donetrue\dododopresetJSvariables S{#1}}
-
-\def\JSprefix#1%
- {JS\string_#1\string_\the\scratchcounter}
-
-\def\dododopresetJSvariables#1#2%
- {\iftraceJScode
- \writestatus{JavaScript}{\JSprefix#1=#2}
- \xdef\JScode{\JScode console.println("\JSprefix#1=#2"); }%
- \fi
- \ifdirectJScode
- \xdef\JScode{\ifx\JScode\empty\else\JScode,\fi\ifdone"#2"\else#2\fi}%
- \else
- \xdef\JScode{\JScode\JSprefix#1=\ifdone"#2"\else#2\fi; }%
- \fi}
-
-%D \macros
-%D {startJSpreamble, flushJSpreamble}
-%D
-%D One can define insert \JAVASCRIPT\ code at the document level
-%D by using:
-%D
-%D \starttyping
-%D \startJSpreamble{oeps}
-%D oeps = 1 ;
-%D \stopJSpreamble
-%D \stoptyping
-%D
-%D which is the same as:
-%D
-%D \starttyping
-%D \startJSpreamble{now} used now
-%D now = 2 ;
-%D \stopJSpreamble
-%D \stoptyping
-%D
-%D while the next definition is only included when actually
-%D used.
-%D
-%D \starttyping
-%D \startJSpreamble{later} used later
-%D later = 3 ;
-%D \stopJSpreamble
-%D \stoptyping
-%D
-%D This command may be used more that once, but always before
-%D the first page is shipped out.
-
-\newif\ifoneJSpreamble \oneJSpreamblefalse
-
-\let\allJSpreambles\empty
-\newcounter\nofJSpreambles
-\newcounter\currentJSpreamble
-
-\long\def\startJSpreamble#1 #2 %
- {\bgroup % we need to restore the catcodes
- \restoreendofline % just in case it happens while reading lists
- \doifelse{#2}{used}
- {\dostartJSpreamble#1 }
- {\dostartJSpreamble#1 now #2 }}
-
-\long\def\dostartJSpreamble#1 #2 %
- {\processaction
- [#2]
- [ later=>\chardef\JSstatus\zerocount,%
- now=>\chardef\JSstatus\plusone ,%
- \s!default=>\chardef\JSstatus\plustwo ,%
- \s!unknown=>\chardef\JSstatus\plustwo ]%
- \ifaddJSlinebreaks
- \obeylines \let\obeyedline \normalpar
- \obeyspaces \let\obeyedspace\normalspace
- \fi
- \dodostartJSpreamble{#1}}
-
-\long\def\dodostartJSpreamble#1#2\stopJSpreamble
- {\presetJSfunctions #2function ()\end
- \long\setgvalue{\r!java\r!java#1}{#2}%
- \ifcase\JSstatus \else
- \useJSpreamblenow{#1}%
- \fi
- \egroup}
-
-%D \macros
-%D {setJSpreamble, addtoJSpreamble}
-%D
-%D In addition to the previous preamble definitions, we can
-%D set a preamble \quote {in||line} and add tokens to a
-%D preamble.
-
-\def\setJSpreamble#1#2%
- {\doifundefined{\r!java\r!java#1}
- {\setgvalue{\r!java\r!java#1}{#2;}%
- \doglobal\increment\currentJSpreamble
- \doglobal\addtocommalist{#1}\allJSpreambles}}
-
-\def\addtoJSpreamble#1#2%
- {\doifdefinedelse{\r!java\r!java#1}
- {\edef\!!stringa{\r!java\r!java#1}%
- \edef\!!stringb{\csname\!!stringa\endcsname}%
- \@EA\setgvalue\@EA\!!stringa\@EA{\!!stringb #2;}}
- {\setJSpreamble{#1}{#2}}}
-
-%D \macros
-%D {useJSpreamblenow}
-%D
-%D The next macro can be used to force inclusion of postponed
-%D \JAVASCRIPT\ preambles.
-
-\def\useJSpreamblenow#1%
- {\doglobal\increment\currentJSpreamble
- \doglobal\addtocommalist{#1}\allJSpreambles}
-
-%D Because we want to check for valid calls, we preload the
-%D functions. This means that we can call them directly as
-%D well as indirectly when defined by \type {\startJScode} etc.
-
-% \long\def\presetJSfunctions#1function #2(#3)%
-% {\doifelsenothing{#2}
-% {\long\def\presetJSfunctions##1\end{}}
-% {\stripspaces\from#2\to\ascii
-% \doifundefined{\r!java\ascii}{\setgvalue{\r!java\ascii}{\do{}{!}}}}%
-% \presetJSfunctions}
-
-\long\def\presetJSfunctions#1function#2(#3)%
- {\doifelse{#2}\space
- {\long\def\presetJSfunctions##1\end{}}
- {\stripspaces\from#2\to\ascii
- \doifundefined{\r!java\ascii}{\setgvalue{\r!java\ascii}{\do{}{!}}}}%
- \presetJSfunctions}
-
-\def\getJSpreamble#1%
- {\getvalue{\r!java\r!java#1}}
-
-\def\presetJSpreamble
- {\ifx\allJSpreambles\empty\else
- \bgroup
- \setverbosecscharacters
- \obeyspaces \let\obeyedspace\normalspace
- \def\par{\delcharacter}% was: { }
- \globallet\JSpreamble\empty
- \def\@@collectedJSpreamble{\r!java\r!java collected}%
- \letvalue{\@@collectedJSpreamble}=\empty
- \def\docommand##1%
- {\xdef\JScode{\getvalue{\r!java\r!java##1}}%
- \ifoneJSpreamble % \global\letcdcsname
- \@EA\setxvalue\@EA\@@collectedJSpreamble\@EA
- {\csname\@@collectedJSpreamble\endcsname\JScode}%
- \else
- \setxvalue{\r!java\r!java##1}{\JScode}%
- \fi}%
- \processcommacommand[\allJSpreambles]\docommand
- \ifoneJSpreamble
- \gdef\allJSpreambles{collected}%
- \fi
- \globallet\presetJSpreamble\relax
- \egroup
- \fi}
-
-\def\flushJSpreamble
- {\iflocation\ifx\allJSpreambles\empty\else
- \ifcase\nofJSpreambles\else\ifnum\nofJSpreambles=\currentJSpreamble
- \bgroup
- \presetJSpreamble
- \expanded{\doflushJSpreamble{\allJSpreambles}}%
- \globallet\flushJSpreamble\relax
- \globallet\allJSpreambles\empty
- \egroup
- \fi\fi
- \fi\fi}
-
-\def\finalflushJSpreamble
- {\iflocation
- \flushJSpreamble
- \ifcase\currentJSpreamble\relax\else
- \savecurrentvalue\nofJSpreambles\currentJSpreamble
- \globallet\currentJSpreamble\nofJSpreambles
- \fi
- \fi}
-
-\prependtoks \flushJSpreamble \to \everyshipout
-\prependtoks \finalflushJSpreamble \to \everylastshipout
-
-%D \macros
-%D {doPSsanitizeJScode}
-%D
-%D Before the code can be passed to the (\POSTSCRIPT\ or \PDF)
-%D output file, some precautions must be made concerning the
-%D use of \type{(} and~\type{)}. Here we use a beautiful
-%D \type{\aftergroup} trick I discovered in the \TABLE\ format.
-
-\def\doPSsanitizeJScode#1\to#2%
- {\begingroup
- \scratchcounter\zerocount % \aftergroup counter
- \aftergroup\xdef
- \aftergroup#2%
- \aftergroup{%
- \expanded{\defconvertedargument\noexpand\JScode{#1}}%
- \expandafter\handletokens\JScode\with\dodoPSsanitizeJScode
- \aftergroup}%
- \endgroup
- \iftraceJScode
- \writestatus{JS trace}{#2}%
- \fi}
-
-%D I started with:
-%D
-%D \starttyping
-%D \def\dodoPSsanitizeJScode#1%
-%D {\aftergroup\string
-%D \if#1(%
-%D \expandafter\aftergroup\csname#1\endcsname
-%D \else\if#1)%
-%D \expandafter\aftergroup\csname#1\endcsname
-%D \else\if#1;%
-%D \aftergroup;\aftergroup\string\expandafter\aftergroup\
-%D \else
-%D \expandafter\aftergroup#1%
-%D \fi\fi\fi
-%D \advance\scratchcounter by 1
-%D \ifnum\scratchcounter=500
-%D \expandafter\dododoPSsanitizeJScode
-%D \fi}
-%D \stoptyping
-%D
-%D For pretty printing purposes, we need some way to signal
-%D \TEX\ macros. Therefore we introduce a special keyword
-%D \type{TEX}. When followed by a space, this keyword is
-%D ignored, that is, filtered from the stream. Now we have:
-
-\chardef\JSisTEX \zerocount
-\chardef\JScomment\zerocount
-
-\newif\ifaddJSlinebreaks \addJSlinebreakstrue
-
-\def\flushJSisTEX
- {\ifcase\JSisTEX
- \or \aftergroup T%
- \or \aftergroup T\aftergroup E%
- \or \aftergroup T\aftergroup E\aftergroup X%
- \fi
- \chardef\JSisTEX\zerocount}
-
-% \def\doJSlinebreak
-% {\ifaddJSlinebreaks
-% \aftergroup\string\aftergroup\n%
-% \fi}
-%
-% \def\dodoPSsanitizeJScode#1% % input stack>500 & TEX check
-% {\if#1/%
-% \ifnum\JScomment=0
-% \chardef\JScomment\plusone
-% \else\ifnum\JScomment=1
-% \chardef\JScomment\plustwo
-% \fi\fi
-% \else
-% \ifnum\JScomment=1
-% \aftergroup/%
-% \chardef\JScomment\zerocount
-% \fi
-% \ifnum\JScomment=2
-% \if#1\delcharacter
-% \chardef\JScomment\zerocount
-% \fi
-% \else
-% \if#1\delcharacter
-% \flushJSisTEX\doJSlinebreak
-% \else\if#1(%
-% \flushJSisTEX\aftergroup\string\expandafter\aftergroup\csname#1\endcsname
-% \else\if#1)%
-% \flushJSisTEX\aftergroup\string\expandafter\aftergroup\csname#1\endcsname
-% \else\if#1;%
-% \flushJSisTEX\aftergroup;\doJSlinebreak
-% \else\if#1T%
-% \ifnum\JSisTEX=0 \chardef\JSisTEX\plusone \else\flushJSisTEX\aftergroup T\fi
-% \else\if#1E%
-% \ifnum\JSisTEX=1 \chardef\JSisTEX\plustwo \else\flushJSisTEX\aftergroup E\fi
-% \else\if#1X%
-% \ifnum\JSisTEX=2 \chardef\JSisTEX\plusthree \else\flushJSisTEX\aftergroup X\fi
-% \else\if#1\normalspace
-% \ifnum\JSisTEX=3 \chardef\JSisTEX\zerocount \else\flushJSisTEX\aftergroup#1\fi
-% \else
-% \flushJSisTEX\aftergroup\string\expandafter\aftergroup#1%
-% \fi\fi\fi\fi\fi\fi\fi\fi
-% \fi
-% \fi
-% \dododoPSsanitizeJScode}
-
-% todo: "http:\\" -> simple. maar wel \" afvangen
-%
-% use new pdftex escape mechanism or make fully expandable version, not used that often btw
-
-\chardef\JSstring\zerocount
-
-\def\doJSlinebreak
- {\chardef\JScomment\zerocount
- \chardef\JSstring\zerocount
- \ifaddJSlinebreaks
- \aftergroup\string\aftergroup\n%
- \fi}
-
-\def\dodoPSsanitizeJScode#1% % input stack>500 & TEX check
- {\if#1/%
- \ifnum\JSstring=0
- \ifnum\JScomment=0
- \chardef\JScomment\plusone
- \else\ifnum\JScomment=1
- \chardef\JScomment\plustwo
- \fi\fi
- \else
- \aftergroup/%
- \fi
- \else
- \ifnum\JScomment=1
- \aftergroup/%
- \chardef\JScomment\zerocount
- \fi
- % is the delchar trick still needed?
- \ifnum\JScomment=2
- \ifnum`#1=13 % brrr
- \doJSlinebreak
- \else\if#1\par
- \doJSlinebreak
- \else\if#1\delcharacter
- \doJSlinebreak
- \fi\fi\fi
- \else
- \ifnum`#1=13 % brrr
- \flushJSisTEX\doJSlinebreak
- \else\if#1\par
- \flushJSisTEX\doJSlinebreak
- \else\if#1\delcharacter
- \flushJSisTEX\doJSlinebreak
- \else\if#1(%
- \flushJSisTEX\aftergroup\string\expandafter\aftergroup\csname#1\endcsname
- \else\if#1)%
- \flushJSisTEX\aftergroup\string\expandafter\aftergroup\csname#1\endcsname
- %\else\if#1;%
- % \flushJSisTEX\aftergroup;\doJSlinebreak
- \else\if#1T%
- \ifnum\JSisTEX=0 \chardef\JSisTEX\plusone \else\flushJSisTEX\aftergroup T\fi
- \else\if#1E%
- \ifnum\JSisTEX=1 \chardef\JSisTEX\plustwo \else\flushJSisTEX\aftergroup E\fi
- \else\if#1X%
- \ifnum\JSisTEX=2 \chardef\JSisTEX\plusthree \else\flushJSisTEX\aftergroup X\fi
- \else\if#1\normalspace
- \ifnum\JSisTEX=3 \chardef\JSisTEX\zerocount \else\flushJSisTEX\aftergroup#1\fi
- \else
- % todo: "test\"test"
- \if#1"%
- \ifcase\JSstring
- \chardef\JSstring\plusone
- \else
- \chardef\JSstring\zerocount
- \fi
- \fi
- \flushJSisTEX\aftergroup\string\expandafter\aftergroup#1%
- \fi\fi\fi\fi\fi\fi\fi\fi\fi % \fi
- \fi
- \fi
- \dododoPSsanitizeJScode}
-
-%D Close reading learns that one line comments (\type{// ...})
-%D are removed from the stream. This permits switching in
-%D pretty printing \JAVASCRIPT\ sources as well as saves
-%D some bytes.
-
-%D The magic 500 in the next hack prevents the input stack from
-%D overflowing when large scripts are sanitized.
-
-\def\dododoPSsanitizeJScode
- {\ifcase\JSisTEX\ifcase\JScomment
- \advance\scratchcounter \plusone
- \fi\fi
- \ifnum\scratchcounter=500
- \expandafter\dodododoPSsanitizeJScode
- \fi}
-
-\def\dodododoPSsanitizeJScode
- {\let\next={%
- \aftergroup}%
- \endgroup
- \begingroup
- \aftergroup\xdef
- \aftergroup\sanitizedJScode
- \aftergroup{%
- \aftergroup\sanitizedJScode
- \let\next=}}
-
-%D The macro \type{\doPSsanitizeJScode} converts its argument
-%D into the macro \type{\sanitizedJScode}, thereby prefixing
-%D each \type{(} and \type{)} by a slash.
-
-%D Hooking this mechanism into the general \CONTEXT\ reference
-%D mechanism does not take much effort:
-
-\definespecialtest{JS}%
- {\doifdefinedelse{\r!java\currentreferenceoperation}}
-
-\definespeciallocation{JS}#1#2%
- {\iflocation
- \bgroup
- \bgroup
- \presetJScode
- \currentreferenceoperation
- \currentreferencearguments
- \egroup
- \dohandlegoto
- {#2}%
- {\dostartgotoJS\buttonwidth\buttonheight\JScode}%
- {\dostopgotoJS}%
- \egroup
- \else
- {#2}%
- \fi}
-
-%D \macros
-%D {useJSscripts}
-%D
-%D In due time, users will build their collections of scripts,
-%D which can be used (loaded) when applicable. Although not all
-%D public, we will provide some general purpose scripts,
-%D collected in files with names like \type{java-...}. One can
-%D load these scripts with \type{\useJSscripts}, like:
-%D
-%D \starttyping
-%D \useJSscripts[fld]
-%D \stoptyping
-%D
-%D The not so complicated implementation of this macro is:
-
-\def\dodouseJSscripts#1%
- {\doifelse{#1}\v!reset
- {\let\allJSpreambles\empty}
- {\doifundefined{\c!file\f!javascriptprefix#1}
- {\startnointerference
- \letgvalueempty{\c!file\f!javascriptprefix#1}%
- \makeshortfilename[\f!javascriptprefix#1]%
- \startreadingfile
- \readsysfile{\shortfilename.\mksuffix}
- {\showmessage\m!javascript1{#1}}
- {\readsysfile{\shortfilename.tex}
- {\showmessage\m!javascript1{#1}}
- \donothing}%
- \stopreadingfile
- \stopnointerference}}}
-
-\def\douseJSscripts[#1][#2]%
- {\processcommalist[#1]\dodouseJSscripts
- \processcommalist[#2]\useJSpreamblenow}
-
-\def\useJSscripts
- {\dodoubleempty\douseJSscripts}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/java-stp.mkii b/Master/texmf-dist/tex/context/base/mkii/java-stp.mkii
deleted file mode 100644
index 7283c8ceb3d..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/java-stp.mkii
+++ /dev/null
@@ -1,121 +0,0 @@
-%D \module
-%D [ file=java-stp,
-%D version=2004.03.15,
-%D title=\CONTEXT\ JavaScript Macros,
-%D subtitle=Stepping,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% we define ocglist global, otherwise we quickly run into a memory hog (even
-% out of memory in a 512 Meg machine)
-
-% we cannot use doc_visited[this.pageNum] instead of doc_currentstep because
-% of some funny side effect (i.e. dup or so)
-
-\startJSpreamble Steps used now
-
- var doc_ocglist = this.getOCGs() ;
- var doc_stepname = "step" ;
- var doc_currentstep = 0 ;
- var doc_maxstep = 50 ;
- var doc_visited = new Array() ;
- var doc_busy = new Array() ;
-
- function SetupStepper ( layername, laststep ) {
- doc_stepname = layername ;
- doc_maxstep = laststep ;
- for (var i=0; i<=this.numPages; i++) {
- doc_visited[i] = 0 ;
- doc_busy[i] = 0 ;
- }
- }
-
- for (var i=0; i<=this.numPages; i++) {
- doc_visited[i] = 0 ;
- doc_busy[i] = 0 ;
- }
-
- function GetOCG ( name ) {
- for (var i=0; i < doc_ocglist.length; i++) {
- if (doc_ocglist[i].name == name) {
- return doc_ocglist[i] ;
- }
- }
- return null ;
- }
-
- function CheckBusy ( ) {
- var ocg = GetOCG("step:busy") ;
- if (ocg != null) {
- if (doc_visited[this.pageNum]==0) {
- ocg.state = true ;
- } else {
- if (doc_visited[this.pageNum]<doc_busy[this.pageNum]) {
- ocg.state = true ;
- } else {
- ocg.state = false ;
- }
- }
- }
- }
-
- function SetStepper ( maxstep, state ) {
- for (var i=1; i<=maxstep; i++) {
- try {
- var ocg = GetOCG(doc_stepname + ':' + String(i)) ;
- if (ocg != null) {
- ocg.state = state ;
- }
- } catch (e) {
- return ;
- }
- }
- }
-
- function CheckStepper ( maxsteps ) {
- SetStepper(doc_visited[this.pageNum], true) ;
- doc_busy[this.pageNum] = Number(maxsteps) ;
- doc_currentstep = doc_visited[this.pageNum] ;
- CheckBusy() ;
- }
-
- function ResetStepper ( ) {
- SetStepper(doc_maxstep, false) ;
- doc_currentstep = 0 ;
- }
-
- function InvokeStepper ( ) {
- try {
- if (doc_currentstep<doc_busy[this.pageNum]) {
- doc_currentstep += 1 ;
- doc_visited[this.pageNum] = doc_currentstep ;
- var ocg = GetOCG(doc_stepname + ':' + String(doc_currentstep)) ;
- if (ocg != null) {
- ocg.state = true ;
- }
- } else {
- if (this.pageNum+1==this.numPages) {
- this.pageNum = 0 ;
- } else {
- this.pageNum += 1 ;
- }
- }
- CheckBusy() ;
- } catch (e) {
- return ;
- }
- }
-
-\stopJSpreamble
-
-% \definereference [SetupStepper] [JS(SetupStepper{step,50})]
-% \definereference [ResetStepper] [JS(ResetStepper)]
-% \definereference [CheckStepper] [JS(CheckStepper{\StepCounter})]
-% \definereference [InvokeStepper] [JS(InvokeStepper)]
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/lang-alt.mkii b/Master/texmf-dist/tex/context/base/mkii/lang-alt.mkii
deleted file mode 100644
index 1e49945d5fd..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/lang-alt.mkii
+++ /dev/null
@@ -1,152 +0,0 @@
-%D \module
-%D [ file=lang-alt,
-%D version=1997.09.03,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Altaic Languages,
-%D author=Hans Hagen / Tobias Burnus,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Language Macros / Altaic Languages}
-
-%D The framework of this module is set up by Hans Hagen while
-%D many of the first translations were done by Tobias. Later
-%D on, corrections were made by users. If you have suggestions,
-%D or feel that your name missing here, don't hesitate to send
-%D us an email.
-
-% Uigur, Uzbek
-% Azeri/Azerbaijani, Chuvash, Turkish, Turkmen
-% Kazakh, Kazar, Kireghiz, Noghay, Talar
-% Buryat, Kalmuck, Khalkha
-%
-% Turkmen translation by Nazar Annagurban <nazartm at gmail.com> 18. March 2010
-
-\unprotect
-
-\installlanguage
- [\s!tr]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\upperleftsinglesixquote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\upperleftdoublesixquote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!year,\ ,\v!month,\ ,\v!day}]
-
-\installlanguage
- [\s!tk]
- [\c!spacing=\v!broad,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\upperleftsinglesixquote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\upperleftdoublesixquote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!year,\ ,\v!month,\ ,\v!day}
- \s!patterns=\s!tk,
- \s!lefthyphenmin=1,
- \s!righthyphenmin=2]
-
-\installlanguage [turkish] [\s!tr]
-\installlanguage [turkmen] [\s!tk]
-
-\setupheadtext [\s!tr] [\v!content=Fihrist]
-\setupheadtext [\s!tk] [\v!content=Mazmuny]
-\setupheadtext [\s!tr] [\v!tables=Tablolar]
-\setupheadtext [\s!tk] [\v!tables=Tablisalar]
-\setupheadtext [\s!tr] [\v!figures=\Scedilla ekiller]
-\setupheadtext [\s!tk] [\v!figures=Suratlar]
-\setupheadtext [\s!tr] [\v!graphics=Grafikler]
-\setupheadtext [\s!tk] [\v!graphics=Grafikler]
-\setupheadtext [\s!tr] [\v!intermezzi=...]
-\setupheadtext [\s!tk] [\v!intermezzi=Arakesmeler]
-\setupheadtext [\s!tr] [\v!index=\Idotaccent ndex]
-\setupheadtext [\s!tk] [\v!index=Indeks]
-\setupheadtext [\s!tr] [\v!abbreviations=K\dotlessi saltmalar]
-\setupheadtext [\s!tk] [\v!abbreviations=Gysgaltmalar]
-\setupheadtext [\s!tr] [\v!logos=Logolar]
-\setupheadtext [\s!tk] [\v!logos=Logolar]
-\setupheadtext [\s!tr] [\v!units=Birimler]
-\setupheadtext [\s!tk] [\v!units=Birlikler]
-
-\setuplabeltext [\s!tr] [\v!table=Tablo ]
-\setuplabeltext [\s!tk] [\v!table=Tablisa]
-\setuplabeltext [\s!tr] [\v!figure=\Scedilla ekil ]
-\setuplabeltext [\s!tk] [\v!figure=Surat]
-\setuplabeltext [\s!tr] [\v!intermezzo=... ]
-\setuplabeltext [\s!tk] [\v!intermezzo=Arakesme]
-\setuplabeltext [\s!tr] [\v!graphic=Grafik]
-\setuplabeltext [\s!tk] [\v!graphic=Grafik]
-\setuplabeltext [\s!tr] [\v!chapter=]
-\setuplabeltext [\s!tk] [\v!chapter=Bap]
-\setuplabeltext [\s!tr] [\v!section=]
-\setuplabeltext [\s!tk] [\v!section=]
-\setuplabeltext [\s!tr] [\v!subsection=]
-\setuplabeltext [\s!tk] [\v!subsection=]
-\setuplabeltext [\s!tr] [\v!subsubsection=]
-\setuplabeltext [\s!tr] [\v!subsubsubsection=]
-\setuplabeltext [\s!tk] [\v!subsubsubsection=]
-\setuplabeltext [\s!tr] [\v!appendix=]
-\setuplabeltext [\s!tk] [\v!appendix=Go\scedilla ma\ccedilla a]
-\setuplabeltext [\s!tr] [\v!part=Cilt ]
-\setuplabeltext [\s!tk] [\v!part=B\odiaeresis l\udiaeresis m]
-\setuplabeltext [\s!tr] [\v!line=sat\dotlessi r ]
-\setuplabeltext [\s!tk] [\v!line=setir]
-\setuplabeltext [\s!tr] [\v!lines=sat\dotlessi rlar ]
-\setuplabeltext [\s!tk] [\v!lines=setirler]
-
-\setuplabeltext [\s!tk] [\v!january=\yacute anwar]
-\setuplabeltext [\s!tk] [\v!february=fewral]
-\setuplabeltext [\s!tk] [\v!march=mart]
-\setuplabeltext [\s!tk] [\v!april=aprel]
-\setuplabeltext [\s!tk] [\v!may=ma\yacute]
-\setuplabeltext [\s!tk] [\v!june=i\yacute un]
-\setuplabeltext [\s!tk] [\v!july=i\yacute ul]
-\setuplabeltext [\s!tk] [\v!august=awgust]
-\setuplabeltext [\s!tk] [\v!september=sent\yacute abr]
-\setuplabeltext [\s!tk] [\v!october=okt\yacute abr]
-\setuplabeltext [\s!tk] [\v!november=no\yacute abr]
-\setuplabeltext [\s!tk] [\v!december=dekabr]
-
-\setuplabeltext [\s!tr] [\v!january=ocak]
-\setuplabeltext [\s!tr] [\v!february=\Scedilla ubat]
-\setuplabeltext [\s!tr] [\v!march=mart]
-\setuplabeltext [\s!tr] [\v!april=nisan]
-\setuplabeltext [\s!tr] [\v!may=may\dotlessi s]
-\setuplabeltext [\s!tr] [\v!june=haziran]
-\setuplabeltext [\s!tr] [\v!july=temmuz]
-\setuplabeltext [\s!tr] [\v!august=a\gbreve ustos]
-\setuplabeltext [\s!tr] [\v!september=eyl\udiaeresis l]
-\setuplabeltext [\s!tr] [\v!october=ekim]
-\setuplabeltext [\s!tr] [\v!november=kas\dotlessi m]
-\setuplabeltext [\s!tr] [\v!december=aral\dotlessi k]
-
-\setuplabeltext [\s!tr] [\v!sunday=pazar]
-\setuplabeltext [\s!tr] [\v!monday=pazartesi]
-\setuplabeltext [\s!tr] [\v!tuesday=sal\dotlessi]
-\setuplabeltext [\s!tr] [\v!wednesday=\ccedilla ar\scedilla amba]
-\setuplabeltext [\s!tr] [\v!thursday=per\scedilla embe]
-\setuplabeltext [\s!tr] [\v!friday=cuma]
-\setuplabeltext [\s!tr] [\v!saturday=cumartesi]
-
-\setuplabeltext [\s!tk] [\v!sunday=dyn\ccedilla\ g\udiaeresis n]
-\setuplabeltext [\s!tk] [\v!monday=birinji g\udiaeresis n]
-\setuplabeltext [\s!tk] [\v!tuesday=ikinji g\udiaeresis n]
-\setuplabeltext [\s!tk] [\v!wednesday=\udiaeresis\ccedilla\udiaeresis nji]
-\setuplabeltext [\s!tk] [\v!thursday=d\odiaeresis rd\udiaeresis nji g\udiaeresis n]
-\setuplabeltext [\s!tk] [\v!friday=b\adiaeresis\scedilla inji g\udiaeresis n]
-\setuplabeltext [\s!tk] [\v!saturday=altynjy g\udiaeresis n]
-
-%D \ShowAllLanguageValues [\s!tr] [turkish] {Turkish} {delight} % turks fruit
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/lang-ana.mkii b/Master/texmf-dist/tex/context/base/mkii/lang-ana.mkii
deleted file mode 100644
index f2dc4a17c00..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/lang-ana.mkii
+++ /dev/null
@@ -1,24 +0,0 @@
-%D \module
-%D [ file=lang-ana,
-%D version=1997.09.03,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Anatolian Languages,
-%D author=Hans Hagen / Tobias Burnus,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Language Macros / Anatolian Languages}
-
-%D The framework of this module is set up by Hans Hagen while
-%D many of the first translations were done by Tobias. Later
-%D on, corrections were made by users. If you have suggestions,
-%D or feel that your name missing here, don't hesitate to send
-%D us an email.
-
-\unprotect
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/lang-art.mkii b/Master/texmf-dist/tex/context/base/mkii/lang-art.mkii
deleted file mode 100644
index 20216b571bf..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/lang-art.mkii
+++ /dev/null
@@ -1,26 +0,0 @@
-%D \module
-%D [ file=lang--art,
-%D version=1997.09.03,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Artificial Languages,
-%D author=Hans Hagen / Tobias Burnus,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Language Macros / Artificial Languages}
-
-%D The framework of this module is set up by Hans Hagen while
-%D many of the first translations were done by Tobias. Later
-%D on, corrections were made by users. If you have suggestions,
-%D or feel that your name missing here, don't hesitate to send
-%D us an email.
-
-% Esperanto
-
-\unprotect
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/lang-bal.mkii b/Master/texmf-dist/tex/context/base/mkii/lang-bal.mkii
deleted file mode 100644
index 4ab751a448d..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/lang-bal.mkii
+++ /dev/null
@@ -1,118 +0,0 @@
-%D \module
-%D [ file=lang-bal,
-%D version=2010.01.21,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Baltic Languages,
-%D author=Marius AlekneviÄius,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Language Macros / Baltic Languages}
-
-%D The framework of this module is set up by Hans Hagen while
-%D all the translations were done by Marius AlekneviÄius. If
-%D you have suggestions, don't hesitate to send us an email.
-
-%D This file is in \UTF\ encoding and is meant for \MKIV.
-
-% Lettish/Latvian, Lietuvių/Lithuanian
-
-\unprotect
-
-\installlanguage
- [\s!lt]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\lowerleftdoubleninequote,
- \c!rightquote=\upperrightdoublesixquote,
- \c!leftquotation=\lowerleftdoubleninequote,
- \c!rightquotation=\upperrightdoublesixquote,
- \c!date={\v!year,~m.,\ ,\v!month,\ ,\v!day,~d.},
- \s!patterns=\s!lt,
- \s!encoding=l7x,
- \s!mapping=l7x,
- \s!lefthyphenmin=2,
- \s!righthyphenmin=2]
-
-\installlanguage [lithuanian] [\s!lt]
-
-\setupheadtext [\s!lt] [\v!content=Turinys]
-\setupheadtext [\s!lt] [\v!tables=LentelÄ—s]
-\setupheadtext [\s!lt] [\v!figures=Iliustracijos]
-\setupheadtext [\s!lt] [\v!graphics=Graphics] % TODO what is the difference between the "graphics" and the "figures"?
-\setupheadtext [\s!lt] [\v!intermezzi=Intermezzos] % TODO what is the "intermezzi"?
-\setupheadtext [\s!lt] [\v!index=RodyklÄ—]
-\setupheadtext [\s!lt] [\v!abbreviations=Santrumpos]
-\setupheadtext [\s!lt] [\v!logos=Logos] % TODO where it is used?
-\setupheadtext [\s!lt] [\v!units=Units] % TODO where it is used?
-\setupheadtext [\s!lt] [pubs=Literatūra]
-
-\setuplabeltext [\s!lt] [\v!table={, lentelÄ—.}]
-\setuplabeltext [\s!lt] [\v!figure={, pav.}]
-\setuplabeltext [\s!lt] [\v!intermezzo=Intermezzo ] % TODO
-\setuplabeltext [\s!lt] [\v!graphic=Graphic ] % TODO
-
-%\startlanguagespecifics[\s!lt]
-% \setupheads[\c!sectionstopper=.] %TODO how do I set dots after section numbers?
-%\stoplanguagespecifics
-
-\setuplabeltext [\s!lt] [\v!chapter=] % Chapter
-\setuplabeltext [\s!lt] [\v!section=]
-\setuplabeltext [\s!lt] [\v!subsection=]
-\setuplabeltext [\s!lt] [\v!subsubsection=]
-\setuplabeltext [\s!lt] [\v!subsubsubsection=]
-\setuplabeltext [\s!lt] [\v!appendix=] % Appendix
-\setuplabeltext [\s!lt] [\v!part={, dalis}]
-\setuplabeltext [\s!lt] [\v!line=line ] % TODO where it is used?
-\setuplabeltext [\s!lt] [\v!lines=lines ] % TODO where it is used?
-
-\setuplabeltext [\s!lt] [\v!january=sausio]
-\setuplabeltext [\s!lt] [\v!february=vasario]
-\setuplabeltext [\s!lt] [\v!march=kovo]
-\setuplabeltext [\s!lt] [\v!april=balandžio]
-\setuplabeltext [\s!lt] [\v!may=gegužės]
-\setuplabeltext [\s!lt] [\v!june=birželio]
-\setuplabeltext [\s!lt] [\v!july=liepos]
-\setuplabeltext [\s!lt] [\v!august=rugpjÅ«Äio]
-\setuplabeltext [\s!lt] [\v!september=rugsÄ—jo]
-\setuplabeltext [\s!lt] [\v!october=spalio]
-\setuplabeltext [\s!lt] [\v!november=lapkriÄio]
-\setuplabeltext [\s!lt] [\v!december=gruodžio]
-
-\setuplabeltext [\s!lt] [\v!sunday=sekmadienis]
-\setuplabeltext [\s!lt] [\v!monday=pirmadienis]
-\setuplabeltext [\s!lt] [\v!tuesday=antradienis]
-\setuplabeltext [\s!lt] [\v!wednesday=treÄiadienis]
-\setuplabeltext [\s!lt] [\v!thursday=ketvirtadienis]
-\setuplabeltext [\s!lt] [\v!friday=penktadienis]
-\setuplabeltext [\s!lt] [\v!saturday=šeštadienis]
-
-\setuplabeltext [\s!lt] [\v!page=puslapis ] % TODO how to test?
-\setuplabeltext [\s!lt] [\v!atpage=puslapyje ] % TODO how to test?
-\setuplabeltext [\s!lt] [\v!hencefore=kaip parodyta aukÅ¡Äiau] % TODO how to test?
-\setuplabeltext [\s!lt] [\v!hereafter=kaip parodyta žemiau] % TODO how to test?
-\setuplabeltext [\s!lt] [\v!see=žiūrėti ] % TODO how to test?
-
-\setuplabeltext [\s!lt] [\v!january :\s!mnem=jan] % I think, there is no abbreviated versions of months in lithuanian
-\setuplabeltext [\s!lt] [\v!february :\s!mnem=feb]
-\setuplabeltext [\s!lt] [\v!march :\s!mnem=mar]
-\setuplabeltext [\s!lt] [\v!april :\s!mnem=apr]
-\setuplabeltext [\s!lt] [\v!may :\s!mnem=may]
-\setuplabeltext [\s!lt] [\v!june :\s!mnem=jun]
-\setuplabeltext [\s!lt] [\v!july :\s!mnem=jul]
-\setuplabeltext [\s!lt] [\v!august :\s!mnem=aug]
-\setuplabeltext [\s!lt] [\v!september:\s!mnem=sep]
-\setuplabeltext [\s!lt] [\v!october :\s!mnem=oct]
-\setuplabeltext [\s!lt] [\v!november :\s!mnem=nov]
-\setuplabeltext [\s!lt] [\v!december :\s!mnem=dec]
-
-%D \ShowAllLanguageValues [\s!lt] [lithuanian] {Lithuanian} {doll} % What does this mean? Do I need it?
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/lang-cel.mkii b/Master/texmf-dist/tex/context/base/mkii/lang-cel.mkii
deleted file mode 100644
index e6519497b3d..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/lang-cel.mkii
+++ /dev/null
@@ -1,26 +0,0 @@
-%D \module
-%D [ file=lang-cel,
-%D version=1997.09.03,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Celtic Languages,
-%D author=Hans Hagen / Tobias Burnus,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Language Macros / Celtic Languages}
-
-%D The framework of this module is set up by Hans Hagen while
-%D many of the first translations were done by Tobias. Later
-%D on, corrections were made by users. If you have suggestions,
-%D or feel that your name missing here, don't hesitate to send
-%D us an email.
-
-% Breton, Welsh, Irish, Manx, Scottish Gaelic
-
-\unprotect
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/lang-chi.mkii b/Master/texmf-dist/tex/context/base/mkii/lang-chi.mkii
deleted file mode 100644
index 5d61281b0a2..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/lang-chi.mkii
+++ /dev/null
@@ -1,305 +0,0 @@
-%D \module
-%D [ file=lang-chi,
-%D version=2002.06.25, % 1998.10.10,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Chinese,
-%D author={Hans Hagen \& Wang Lei},
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Language Macros / Chinese}
-
-%D This module is coded using the \UNICODE\ support built in
-%D \CONTEXT. Therefore, \type {\uchar} is used instead of latin
-%D characters.
-
-\unprotect
-
-\definesystemconstant {chinese} \definesystemconstant {cn}
-
-\installlanguage
- [\s!cn]
- [\c!leftsentence=\cnencoding\cnleftsentence,
- \c!rightsentence=\cnencoding\cnrightsentence,
- \c!leftsubsentence=\cnencoding\cnleftsubsentence,
- \c!rightsubsentence=\cnencoding\cnrightsubsentence,
- \c!leftquote=\cnencoding\cnupperleftsinglequote,
- \c!rightquote=\cnencoding\cnupperrightsinglequote,
- \c!leftquotation=\cnencoding\cnupperleftdoublequote,
- \c!rightquotation=\cnencoding\cnupperrightdoublequote,
- \c!date={\v!year,\cnyear,\ ,\v!month,\v!day,\cnday}]
-
-\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={\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}]
-\setupheadtext [\s!cn] [\v!units={\cnencoding\cnencodedunits}]
-
-\setuplabeltext [\s!cn] [\v!table={\cnencoding\cnencodedtable}]
-\setuplabeltext [\s!cn] [\v!figure={\cnencoding\cnencodedfigure}]
-\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={\cnencoding\cnencodedline}]% RG & XJF
-\setuplabeltext [\s!cn] [\v!lines={\cnencoding\cnencodedline}]% RG & XJF
-
-\setuplabeltext [\s!cn] [\v!subsection=]
-\setuplabeltext [\s!cn] [\v!subsubsection=]
-\setuplabeltext [\s!cn] [\v!subsubsubsection=]
-
-%D From this definition one can deduce that language, input
-%D encoding, font encoding, and glyph meaning form a pretty
-%D complex four dimensional space.
-
-\startlanguagespecifics[\s!cn]
-
-\setuplabeltext [\s!cn] [\v!january=\cnencoding\cnencodedjanuary ]
-\setuplabeltext [\s!cn] [\v!february=\cnencoding\cnencodedfebrary ]
-\setuplabeltext [\s!cn] [\v!march=\cnencoding\cnencodedmarch ]
-\setuplabeltext [\s!cn] [\v!april=\cnencoding\cnencodedapril ]
-\setuplabeltext [\s!cn] [\v!may=\cnencoding\cnencodedmay ]
-\setuplabeltext [\s!cn] [\v!june=\cnencoding\cnencodedjune ]
-\setuplabeltext [\s!cn] [\v!july=\cnencoding\cnencodedjuly ]
-\setuplabeltext [\s!cn] [\v!august=\cnencoding\cnencodedaugust ]
-\setuplabeltext [\s!cn] [\v!september=\cnencoding\cnencodedseptember]
-\setuplabeltext [\s!cn] [\v!october=\cnencoding\cnencodedoctober ]
-\setuplabeltext [\s!cn] [\v!november=\cnencoding\cnencodednovember ]
-\setuplabeltext [\s!cn] [\v!december=\cnencoding\cnencodeddecember ]
-
-\setuplabeltext [\s!cn] [\v!sunday=\cnencoding\cnencodedsunday ]
-\setuplabeltext [\s!cn] [\v!monday=\cnencoding\cnencodedmonday ]
-\setuplabeltext [\s!cn] [\v!tuesday=\cnencoding\cnencodedtuesday ]
-\setuplabeltext [\s!cn] [\v!wednesday=\cnencoding\cnencodedwednesday]
-\setuplabeltext [\s!cn] [\v!thursday=\cnencoding\cnencodedthursday ]
-\setuplabeltext [\s!cn] [\v!friday=\cnencoding\cnencodedfriday ]
-\setuplabeltext [\s!cn] [\v!saturday=\cnencoding\cnencodedsaturday ]
-
-\stoplanguagespecifics
-
-%D One can specify a split labeltext, as demonstrated in
-%D the definition of the \type {part} label. Unfortunately
-%D the glyphs of both part depend on the encoding. Therefore,
-%D we have an encoding section here.
-
-\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}}
- \definecommand cnrightsentence {\uchar{161}{170}\uchar{161}{170}}
- \definecommand cnleftsubsentence {\uchar{161}{170}\uchar{161}{170}}
- \definecommand cnrightsubsentence {\uchar{161}{170}\uchar{161}{170}}
- \definecommand cnupperleftsinglequote {\uchar{161}{174}}
- \definecommand cnupperrightsinglequote {\uchar{161}{175}}
- \definecommand cnupperleftdoublequote {\uchar{161}{176}}
- \definecommand cnupperrightdoublequote {\uchar{161}{177}}
- \definecommand cnupperleftsinglequote-v {\uchar{161}{184}}
- \definecommand cnupperrightsinglequote-v {\uchar{161}{185}}
- \definecommand cnupperleftdoublequote-v {\uchar{161}{186}}
- \definecommand cnupperrightdoublequote-v {\uchar{161}{187}}
- \definecommand cnencodedcontents {\uchar{196}{191}\uchar{194}{188}}
- \definecommand cnencodedtables {\uchar{177}{237}\uchar{184}{241}}
- \definecommand cnencodedfigures {\uchar{205}{188}\uchar{208}{206}}
- \definecommand cnencodedindex {\uchar{203}{247}\uchar{210}{253}}
- \definecommand cnencodedabbreviations {\uchar{203}{245}\uchar{194}{212}\uchar{211}{239}}
- \definecommand cnencodedlogos {\uchar{187}{213}\uchar{177}{225}}
- \definecommand cnencodedunits {\uchar{188}{198}\uchar{193}{191}\uchar{181}{165}\uchar{206}{187}}
- \definecommand cnencodedtable {\uchar{177}{237}}
- \definecommand cnencodedfigure {\uchar{205}{188}}
- \definecommand cnencodedintro {\uchar{181}{218}}
- \definecommand cnencodedpart {\uchar{178}{191}\uchar{183}{214}}
- \definecommand cnencodedchapter {\uchar{213}{194}}
- \definecommand cnencodedsection {\uchar{189}{218}}
- \definecommand cnencodedjanuary {\uchar{210}{187}\uchar{212}{194}}
- \definecommand cnencodedfebrary {\uchar{182}{254}\uchar{212}{194}}
- \definecommand cnencodedmarch {\uchar{200}{253}\uchar{212}{194}}
- \definecommand cnencodedapril {\uchar{203}{196}\uchar{212}{194}}
- \definecommand cnencodedmay {\uchar{206}{229}\uchar{212}{194}}
- \definecommand cnencodedjune {\uchar{193}{249}\uchar{212}{194}}
- \definecommand cnencodedjuly {\uchar{198}{223}\uchar{212}{194}}
- \definecommand cnencodedaugust {\uchar{176}{203}\uchar{212}{194}}
- \definecommand cnencodedseptember {\uchar{190}{197}\uchar{212}{194}}
- \definecommand cnencodedoctober {\uchar{202}{174}\uchar{212}{194}}
- \definecommand cnencodednovember {\uchar{202}{174}\uchar{210}{187}\uchar{212}{194}}
- \definecommand cnencodeddecember {\uchar{202}{174}\uchar{182}{254}\uchar{212}{194}}
- \definecommand cnencodedsunday {\uchar{208}{199}\uchar{198}{218}\uchar{200}{213}}
- \definecommand cnencodedmonday {\uchar{208}{199}\uchar{198}{218}\uchar{210}{187}}
- \definecommand cnencodedtuesday {\uchar{208}{199}\uchar{198}{218}\uchar{182}{254}}
- \definecommand cnencodedwednesday {\uchar{208}{199}\uchar{198}{218}\uchar{200}{253}}
- \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]
- \definecommand cnleftsentence {\uchar{162}{119}\uchar{162}{119}}
- \definecommand cnrightsentence {\uchar{162}{119}\uchar{162}{119}}
- \definecommand cnleftsubsentence {\uchar{162}{119}\uchar{162}{119}}
- \definecommand cnrightsubsentence {\uchar{162}{119}\uchar{162}{119}}
- \definecommand cnupperleftsinglequote {\uchar{161}{165}}
- \definecommand cnupperrightsinglequote {\uchar{161}{166}}
- \definecommand cnupperleftdoublequote {\uchar{161}{167}}
- \definecommand cnupperrightdoublequote {\uchar{161}{168}}
- \definecommand cnupperleftsinglequote-v {\uchar{161}{117}}
- \definecommand cnupperrightsinglequote-v {\uchar{161}{118}}
- \definecommand cnupperleftdoublequote-v {\uchar{161}{121}}
- \definecommand cnupperrightdoublequote-v {\uchar{161}{122}}
- \definecommand cnencodecontents {\uchar{165}{216}\uchar{191}{253}}
- \definecommand cnencodetables {\uchar{170}{237}\uchar{174}{230}}
- \definecommand cnencodefigures {\uchar{185}{207}\uchar{167}{206}}
- \definecommand cnencodeindex {\uchar{175}{193}\uchar{174}{222}}
- \definecommand cnencodeabbreviations {\uchar{191}{89}\uchar{178}{164}\uchar{187}{121}}
- \definecommand cnencodelogos {\uchar{192}{178}\uchar{188}{208}}
- \definecommand cnencodeunits {\uchar{173}{112}\uchar{182}{113}\uchar{179}{230}\uchar{166}{236}}
- \definecommand cnencodetable {\uchar{170}{237}}
- \definecommand cnencodefigure {\uchar{185}{207}}
- \definecommand cnencodedintro {\uchar{178}{196}}
- \definecommand cnencodedpart {\uchar{179}{161}\uchar{164}{192}}
- \definecommand cnencodedchapter {\uchar{179}{185}}
- \definecommand cnencodedsection {\uchar{184} {96}}
- \definecommand cnencodedjanuary {\uchar{164} {64}\uchar{164}{235}}
- \definecommand cnencodedfebrary {\uchar{164} {71}\uchar{164}{235}}
- \definecommand cnencodedmarch {\uchar{164} {84}\uchar{164}{235}}
- \definecommand cnencodedapril {\uchar{165}{124}\uchar{164}{235}}
- \definecommand cnencodedmay {\uchar{164}{173}\uchar{164}{235}}
- \definecommand cnencodedjune {\uchar{164}{187}\uchar{164}{235}}
- \definecommand cnencodedjuly {\uchar{164} {67}\uchar{164}{235}}
- \definecommand cnencodedaugust {\uchar{164} {75}\uchar{164}{235}}
- \definecommand cnencodedseptember {\uchar{164} {69}\uchar{164}{235}}
- \definecommand cnencodedoctober {\uchar{164} {81}\uchar{164}{235}}
- \definecommand cnencodednovember {\uchar{164} {81}\uchar{164} {64}\uchar{164}{235}}
- \definecommand cnencodeddecember {\uchar{164} {81}\uchar{164} {71}\uchar{164}{235}}
- \definecommand cnencodedsunday {\uchar{172} {80}\uchar{180}{193}\uchar{164}{233}}
- \definecommand cnencodedmonday {\uchar{172} {80}\uchar{180}{193}\uchar{164} {64}}
- \definecommand cnencodedtuesday {\uchar{172} {80}\uchar{180}{193}\uchar{164} {71}}
- \definecommand cnencodedwednesday {\uchar{172} {80}\uchar{180}{193}\uchar{164} {84}}
- \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/mkii/lang-ctx.mkii b/Master/texmf-dist/tex/context/base/mkii/lang-ctx.mkii
deleted file mode 100644
index 2aecb918ee2..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/lang-ctx.mkii
+++ /dev/null
@@ -1,53 +0,0 @@
-%D \module
-%D [ file=lang-ctx,
-%D version=2005.02.12,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Generic Patterns,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Language Macros / Generic Patterns}
-
-\unprotect
-
-%D The \CONTEXT\ specific patterns are more generic and
-%D are more or less encoding independent. They are generated
-%D from the ones shipped with distributions using:
-%D
-%D \starttyping
-%D ctxtools --pattern --all
-%D \stoptyping
-
-%D In order to get 8 bit characters hyphenated, we need to load
-%D patterns under the right circumstances. In some countries, more
-%D than one font encoding is in use. I can add more defaults here
-%D if users let me know what encoding they use.
-
-% \installlanguage [\s!nl] [\s!mapping={texnansi,ec},\s!encoding={texnansi,ec}]
-% \installlanguage [\s!fr] [\s!mapping={texnansi,ec},\s!encoding={texnansi,ec}]
-% \installlanguage [\s!de] [\s!mapping={texnansi,ec},\s!encoding={texnansi,ec}]
-% \installlanguage [\s!it] [\s!mapping={texnansi,ec},\s!encoding={texnansi,ec}]
-% \installlanguage [\s!pt] [\s!mapping={texnansi,ec},\s!encoding={texnansi,ec}]
-% \installlanguage [\s!hr] [\s!mapping=ec,\s!encoding=ec] % no il2, misses cacute characters
-% \installlanguage [\s!pl] [\s!mapping={pl0,ec,qx},\s!encoding={pl0,ec,qx}] % pl0 may go
-% \installlanguage [\s!cs] [\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=ec,\s!encoding=ec] % il2 has gone
-% \installlanguage [\s!vi] [\s!mapping=t5,\s!encoding=t5]
-% \installlanguage [\s!ru] [\s!mapping=t2a,\s!encoding=t2a]
-
-% beware, don't use \setuplanguage here
-
-% \installlanguage[\s!gb][\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/mkii/lang-cyr.mkii b/Master/texmf-dist/tex/context/base/mkii/lang-cyr.mkii
deleted file mode 100644
index eed3ec80e68..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/lang-cyr.mkii
+++ /dev/null
@@ -1,371 +0,0 @@
-%D \module
-%D [ file=lang-cyr,
-%D version=2003.01.24,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Cyrillic Languages,
-%D author=see below,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Language Macros / Cyrillic Languages}
-
-%D The cyrillic languages always use a dedicated input regime.
-%D Therefore we define the labels using symbolic names.
-%D Support for cyrillic is initiated by Olga Briginets who
-%D also layed the base for the language, encoding and font
-%D definition. Later Alexander Bokovoy and Victor Figurnov
-%D improved things. I (Hans Hagen) mainly cleaned things up
-%D a bit.
-
-\unprotect
-
-\installlanguage
- [\s!ru]
- [\s!lefthyphenmin=2,
- \s!righthyphenmin=2,
- \c!spacing=\v!packed,
- \c!leftsentence=\leftguillemot,
- \c!rightsentence=\rightguillemot,
- \c!leftsubsentence=\lowerleftdoubleninequote,
- \c!rightsubsentence=\upperrightdoubleninequote,
- \c!leftquote=\lowerleftdoubleninequote,
- \c!rightquote=\upperrightdoubleninequote,
- \c!leftquotation=\leftguillemot,
- \c!rightquotation=\rightguillemot,
- \c!date={\v!day,\ ,\v!month,\ ,\v!year},
- \s!mapping=t2a,
- \s!encoding=t2a]
-
-\installlanguage
- [\s!ua]
- [\s!lefthyphenmin=2,
- \s!righthyphenmin=2,
- \c!spacing=\v!packed,
- \c!leftsentence=\leftguillemot,
- \c!rightsentence=\rightguillemot,
- \c!leftsubsentence=\lowerleftdoubleninequote,
- \c!rightsubsentence=\upperrightdoubleninequote,
- \c!leftquote=\lowerleftdoubleninequote,
- \c!rightquote=\upperrightdoubleninequote,
- \c!leftquotation=\leftguillemot,
- \c!rightquotation=\rightguillemot,
- \c!date={\v!day,\ ,\v!month,\ ,\v!year},
- \s!patterns=\s!uk,
- \s!mapping=t2a,
- \s!encoding=t2a]
-
-\installlanguage [russian] [\s!ru]
-\installlanguage [ukrainian] [\s!ua]
-
-%D Labels and header texts.
-
-\setupheadtext [\s!ru] [ \v!content=\cyrillicS \cyrillico \cyrillicd
- \cyrillice \cyrillicr \cyrilliczh
- \cyrillica \cyrillicn \cyrillici
- \cyrillice]
-\setupheadtext [\s!ua] [\v!content=\cyrillicZ \cyrillicm \cyrillicii
- \cyrillics \cyrillict]
-
-\setupheadtext [\s!ru] [\v!tables=\cyrillicS \cyrillicp \cyrillici
- \cyrillics \cyrillico \cyrillick
- \space \cyrillict \cyrillica
- \cyrillicb \cyrillicl \cyrillici
- \cyrillicc]
-\setupheadtext [\s!ua] [\v!tables=\cyrillicP \cyrillice \cyrillicr
- \cyrillice \cyrillicl \cyrillicii
- \cyrillick \space \cyrillict
- \cyrillica \cyrillicb \cyrillicl
- \cyrillici \cyrillicc \cyrillicsftsn]
-
-\setupheadtext [\s!ru] [\v!figures=\cyrillicS \cyrillicp \cyrillici
- \cyrillics \cyrillico \cyrillick
- \space \cyrillici \cyrillicl
- \cyrillicl \cyrillicyu\cyrillics
- \cyrillict \cyrillicr \cyrillica
- \cyrillicc \cyrillici \cyrillicishrt]
-\setupheadtext [\s!ua] [\v!figures=\cyrillicP \cyrillice \cyrillicr
- \cyrillice \cyrillicl \cyrillicii
- \cyrillick \space \cyrillicii
- \cyrillicl \cyrillicyu\cyrillics
- \cyrillict \cyrillicr \cyrillica
- \cyrillicc \cyrillicii\cyrillicishrt]
-
-\setupheadtext [\s!ru] [\v!graphics=\cyrillicS \cyrillicp \cyrillici
- \cyrillics \cyrillico \cyrillick
- \space \cyrillicg \cyrillicr
- \cyrillica \cyrillicf \cyrillici
- \cyrillick \cyrillico \cyrillicv]
-\setupheadtext [\s!ua] [\v!graphics=\cyrillicP \cyrillice \cyrillicr
- \cyrillice \cyrillicl \cyrillicii
- \cyrillick \space \cyrillicg
- \cyrillicr \cyrillica \cyrillicf
- \cyrillicii\cyrillick \cyrillico
- \cyrillicv]
-
-\setupheadtext [\s!ru] [\v!intermezzi=\cyrillicS \cyrillicp \cyrillici
- \cyrillics \cyrillico \cyrillick
- \space \cyrillicv \cyrillics
- \cyrillict \cyrillica \cyrillicv
- \cyrillico \cyrillick]
-\setupheadtext [\s!ua] [\v!intermezzi=\cyrillicP \cyrillice \cyrillicr
- \cyrillice \cyrillicl \cyrillicii
- \cyrillick \space \cyrillicv
- \cyrillics \cyrillict \cyrillica
- \cyrillicv \cyrillico \cyrillick]
-
-\setupheadtext [\s!ru] [\v!index=\cyrillicA \cyrillicl \cyrillicf
- \cyrillica \cyrillicv \cyrillici
- \cyrillict \cyrillicn \cyrillicery
- \cyrillicishrt \space \cyrillicu
- \cyrillick \cyrillica \cyrillicz
- \cyrillica \cyrillict \cyrillice
- \cyrillicl \cyrillicsftsn]
-\setupheadtext [\s!ua] [\v!index=\cyrillicP \cyrillico \cyrillick
- \cyrillica \cyrilliczh\cyrillicch
- \cyrillici \cyrillick]
-
-\setupheadtext [\s!ru] [\v!abbreviations=\cyrillicS \cyrillicp \cyrillici
- \cyrillics \cyrillico \cyrillick
- \space \cyrillics \cyrillico
- \cyrillick \cyrillicr \cyrillica
- \cyrillicshch \cyrillice
- \cyrillicn
- \cyrillici \cyrillicishrt]
-\setupheadtext [\s!ua] [\v!abbreviations=\cyrillicP \cyrillice \cyrillicr
- \cyrillice \cyrillicl \cyrillicii
- \cyrillick \space \cyrillics
- \cyrillick \cyrillico \cyrillicr
- \cyrillico \cyrillicch\cyrillice
- \cyrillicn \cyrillicsftsn]
-
-\setupheadtext [\s!ru] [\v!logos=\cyrillicL \cyrillico \cyrillicg
- \cyrillico \cyrillict \cyrillici
- \cyrillicp \cyrillicery]
-\setupheadtext [\s!ua] [\v!logos=\cyrillicL \cyrillico \cyrillicg
- \cyrillico \cyrillict \cyrillici
- \cyrillicp \cyrillici]
-
-\setupheadtext [\s!ru] [\v!units=\cyrillicE \cyrillicd \cyrillici
- \cyrillicn \cyrillici \cyrillicc
- \cyrillicery \space \cyrillici
- \cyrillicz \cyrillicm \cyrillice
- \cyrillicr \cyrillice \cyrillicn
- \cyrillici \cyrillicya]
-\setupheadtext [\s!ua] [\v!units=\cyrillicO \cyrillicd \cyrillici
- \cyrillicn \cyrillici \cyrillicc
- \cyrillicii\space \cyrillicv
- \cyrillici \cyrillicm \cyrillicii
- \cyrillicr \cyrillicu]
-
-\setuplabeltext [\s!ru] [\v!table=\cyrillicT \cyrillica \cyrillicb
- \cyrillicl \cyrillici \cyrillicc
- \cyrillica \space]
-\setuplabeltext [\s!ua] [\v!table=\cyrillicT \cyrillica \cyrillicb
- \cyrillicl \cyrillici \cyrillicc
- \cyrillicya\space]
-
-\setuplabeltext [\s!ru] [\v!figure=\cyrillicR \cyrillici \cyrillics
- \cyrillicu \cyrillicn \cyrillico
- \cyrillick \space]
-\setuplabeltext [\s!ua] [\v!figure=\cyrillicM \cyrillica \cyrillicl
- \cyrillicyu\cyrillicn \cyrillico
- \cyrillick \space]
-
-\setuplabeltext [\s!ru] [\v!intermezzo=\cyrillicV \cyrillics \cyrillict
- \cyrillica \cyrillicv \cyrillick
- \cyrillica \space]
-\setuplabeltext [\s!ua] [\v!intermezzo=\cyrillicV \cyrillics \cyrillict
- \cyrillica \cyrillicv \cyrillick
- \cyrillica \space]
-
-\setuplabeltext [\s!ru] [\v!graphic=\cyrillicG \cyrillicr \cyrillica
- \cyrillicf \cyrillici \cyrillick
- \space]
-\setuplabeltext [\s!ua] [\v!graphic=\cyrillicG \cyrillicr \cyrillica
- \cyrillicf \cyrillici \cyrillick
- \space]
-
-\setuplabeltext [\s!ru] [\v!chapter=]
-\setuplabeltext [\s!ua] [\v!chapter=]
-
-\setuplabeltext [\s!ru] [\v!section=]
-\setuplabeltext [\s!ua] [\v!section=]
-
-\setuplabeltext [\s!ru] [\v!subsection=]
-\setuplabeltext [\s!ua] [\v!subsection=]
-
-\setuplabeltext [\s!ru] [\v!subsubsection=]
-\setuplabeltext [\s!ua] [\v!subsubsection=]
-
-\setuplabeltext [\s!ru] [\v!subsubsubsection=]
-\setuplabeltext [\s!ua] [\v!subsubsubsection=]
-
-\setuplabeltext [\s!ru] [\v!appendix=]
-\setuplabeltext [\s!ua] [\v!appendix=]
-
-\setuplabeltext [\s!ru] [\v!part=\cyrillicCH\cyrillica \cyrillics
- \cyrillict \cyrillicsftsn
- \space]
-\setuplabeltext [\s!ua] [\v!part=\cyrillicCH\cyrillica \cyrillics
- \cyrillict \cyrillici \cyrillicn
- \cyrillica \space]
-
-\setuplabeltext [\s!ru] [\v!line=\cyrillics \cyrillict \cyrillicr
- \cyrillico \cyrillick \cyrillica
- \space]
-\setuplabeltext [\s!ua] [\v!line=\cyrillicr \cyrillicya\cyrillicd
- \cyrillico \cyrillick \space]
-
-\setuplabeltext [\s!ru] [\v!lines=\cyrillics \cyrillict \cyrillicr
- \cyrillico \cyrillick \cyrillici
- \space]
-\setuplabeltext [\s!ua] [\v!lines=\cyrillicr \cyrillicya\cyrillicd
- \cyrillick \cyrillici \space]
-
-\setuplabeltext [\s!ru] [\v!page=\cyrillics \cyrillict \cyrillicr
- \cyrillica \cyrillicn \cyrillici
- \cyrillicc \cyrillica \space]
-\setuplabeltext [\s!ua] [\v!page=\cyrillics \cyrillict \cyrillico
- \cyrillicr \cyrillicii\cyrillicn
- \cyrillick \cyrillica \space ]
-
-\setuplabeltext [\s!ru] [\v!atpage=\cyrillicn \cyrillica \space
- \cyrillics \cyrillict \cyrillicr
- \cyrillica \cyrillicn \cyrillici
- \cyrillicc \cyrillice \space]
-\setuplabeltext [\s!ua] [\v!atpage=\cyrillicn \cyrillica \space
- \cyrillics \cyrillict \cyrillico
- \cyrillicr \cyrillicii\cyrillicn
- \cyrillicc \cyrillicii\space ]
-
-\setuplabeltext [\s!ru] [\v!hencefore=\cyrillics \cyrillicm.\space
- \cyrillicv \cyrillicery \cyrillicsh
- \cyrillice]
-\setuplabeltext [\s!ua] [\v!hencefore=\cyrillicya\cyrillick \space
- \cyrillicp \cyrillico \cyrillick
- \cyrillica \cyrillicz \cyrillica
- \cyrillicn \cyrillico \space
- \cyrillicv \cyrillici \cyrillicshch
- \cyrillice]
-
-\setuplabeltext [\s!ru] [\v!hereafter=\cyrillics \cyrillicm.\space
- \cyrillicn \cyrillici \cyrilliczh
- \cyrillice]
-\setuplabeltext [\s!ua] [\v!hereafter=\cyrillicya\cyrillick \space
- \cyrillicp \cyrillico \cyrillick
- \cyrillica \cyrillicz \cyrillica
- \cyrillicn \cyrillico \space
- \cyrillicn \cyrillici \cyrilliczh
- \cyrillicch\cyrillice]
-
-\setuplabeltext [\s!ru] [\v!see=\cyrillics \cyrillicm.\space]
-\setuplabeltext [\s!ua] [\v!see=\cyrillicd \cyrillici
- \cyrillicv.\space ]
-
-\setuplabeltext [\s!ru] [\v!january=\cyrillicya\cyrillicn \cyrillicv
- \cyrillica \cyrillicr \cyrillicya]
-\setuplabeltext [\s!ru] [\v!february=\cyrillicf \cyrillice \cyrillicv
- \cyrillicr \cyrillica \cyrillicl
- \cyrillicya]
-\setuplabeltext [\s!ru] [\v!march=\cyrillicm \cyrillica \cyrillicr
- \cyrillict \cyrillica]
-\setuplabeltext [\s!ru] [\v!april=\cyrillica \cyrillicp \cyrillicr
- \cyrillice \cyrillicl \cyrillicya]
-\setuplabeltext [\s!ru] [\v!may=\cyrillicm \cyrillica \cyrillicya]
-\setuplabeltext [\s!ru] [\v!june=\cyrillici \cyrillicyu\cyrillicn
- \cyrillicya]
-\setuplabeltext [\s!ru] [\v!july=\cyrillici \cyrillicyu\cyrillicl
- \cyrillicya]
-\setuplabeltext [\s!ru] [\v!august=\cyrillica \cyrillicv \cyrillicg
- \cyrillicu \cyrillics \cyrillict
- \cyrillica]
-\setuplabeltext [\s!ru] [\v!september=\cyrillics \cyrillice \cyrillicn
- \cyrillict \cyrillicya\cyrillicb
- \cyrillicr \cyrillicya]
-\setuplabeltext [\s!ru] [\v!october=\cyrillico \cyrillick \cyrillict
- \cyrillicya\cyrillicb \cyrillicr
- \cyrillicya]
-\setuplabeltext [\s!ru] [\v!november=\cyrillicn \cyrillico \cyrillicya
- \cyrillicb \cyrillicr \cyrillicya]
-\setuplabeltext [\s!ru] [\v!december=\cyrillicd \cyrillice \cyrillick
- \cyrillica \cyrillicb \cyrillicr
- \cyrillicya]
-
-\setuplabeltext [\s!ua] [\v!january=\cyrillics \cyrillicii\cyrillicch
- \cyrillicn \cyrillicya]
-\setuplabeltext [\s!ua] [\v!february=\cyrillicl \cyrillicyu\cyrillict
- \cyrillico \cyrillicg \cyrillico]
-\setuplabeltext [\s!ua] [\v!march=\cyrillicb \cyrillice \cyrillicr
- \cyrillice \cyrillicz \cyrillicn
- \cyrillicya]
-\setuplabeltext [\s!ua] [\v!april=\cyrillick \cyrillicv \cyrillicii
- \cyrillict \cyrillicn \cyrillicya]
-\setuplabeltext [\s!ua] [\v!may=\cyrillict \cyrillicr \cyrillica
- \cyrillicv \cyrillicn \cyrillicya]
-\setuplabeltext [\s!ua] [\v!june=\cyrillicch\cyrillice \cyrillicr
- \cyrillicv \cyrillicn \cyrillicya]
-\setuplabeltext [\s!ua] [\v!july=\cyrillicl \cyrillici \cyrillicp
- \cyrillicn \cyrillicya]
-\setuplabeltext [\s!ua] [\v!august=\cyrillics \cyrillice \cyrillicr
- \cyrillicp \cyrillicn \cyrillicya]
-\setuplabeltext [\s!ua] [\v!september=\cyrillicv \cyrillice \cyrillicr
- \cyrillice \cyrillics \cyrillicn
- \cyrillicya]
-\setuplabeltext [\s!ua] [\v!october=\cyrilliczh\cyrillico \cyrillicv
- \cyrillict \cyrillicn \cyrillicya]
-\setuplabeltext [\s!ua] [\v!november=\cyrillicl \cyrillici \cyrillics
- \cyrillict \cyrillico \cyrillicp
- \cyrillica \cyrillicd \cyrillica]
-\setuplabeltext [\s!ua] [\v!december=\cyrillicg \cyrillicr \cyrillicu
- \cyrillicd \cyrillicn \cyrillicya]
-
-\setuplabeltext [\s!ru] [\v!sunday=\cyrillicv \cyrillico \cyrillics
- \cyrillick \cyrillicr \cyrillice
- \cyrillics \cyrillice \cyrillicn
- \cyrillicsftsn \cyrillice]
-\setuplabeltext [\s!ru] [\v!monday=\cyrillicp \cyrillico \cyrillicn
- \cyrillice \cyrillicd \cyrillice
- \cyrillicl \cyrillicsftsn
- \cyrillicn \cyrillici \cyrillick]
-\setuplabeltext [\s!ru] [\v!tuesday=\cyrillicv \cyrillict \cyrillico
- \cyrillicr \cyrillicn \cyrillici
- \cyrillick]
-\setuplabeltext [\s!ru] [\v!wednesday=\cyrillics \cyrillicr \cyrillice
- \cyrillicd \cyrillica]
-\setuplabeltext [\s!ru] [\v!thursday=\cyrillicch\cyrillice \cyrillict
- \cyrillicv \cyrillice \cyrillicr
- \cyrillicg]
-\setuplabeltext [\s!ru] [\v!friday=\cyrillicp \cyrillicya\cyrillict
- \cyrillicn \cyrillici \cyrillicc
- \cyrillica]
-\setuplabeltext [\s!ru] [\v!saturday=\cyrillics \cyrillicu \cyrillicb
- \cyrillicb \cyrillico \cyrillict
- \cyrillica]
-
-\setuplabeltext [\s!ua] [\v!sunday=\cyrillicn \cyrillice \cyrillicd
- \cyrillicii\cyrillicl \cyrillicya]
-\setuplabeltext [\s!ua] [\v!monday=\cyrillicp \cyrillico \cyrillicn
- \cyrillice \cyrillicd \cyrillicii
- \cyrillicl \cyrillico \cyrillick]
-\setuplabeltext [\s!ua] [\v!tuesday=\cyrillicv \cyrillicii\cyrillicv
- \cyrillict \cyrillico \cyrillicr
- \cyrillico \cyrillick]
-\setuplabeltext [\s!ua] [\v!wednesday=\cyrillics \cyrillice \cyrillicr
- \cyrillice \cyrillicd \cyrillica]
-\setuplabeltext [\s!ua] [\v!thursday=\cyrillicch\cyrillice \cyrillict
- \cyrillicv \cyrillice \cyrillicr]
-\setuplabeltext [\s!ua] [\v!friday=\cyrillicp'\cyrillicya\cyrillict
- \cyrillicn \cyrillici \cyrillicc
- \cyrillicya]
-\setuplabeltext [\s!ua] [\v!saturday=\cyrillics \cyrillicu \cyrillicb
- \cyrillico \cyrillict \cyrillica]
-
-
-%D \ShowAllLanguageValues [\s!ru] [russian] {Russian} {doll}
-%D \ShowAllLanguageValues [\s!ua] [ukranian] {Ukranian} {dance}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/lang-dis.mkii b/Master/texmf-dist/tex/context/base/mkii/lang-dis.mkii
deleted file mode 100644
index 213c5110f57..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/lang-dis.mkii
+++ /dev/null
@@ -1,59 +0,0 @@
-%D \module
-%D [ file=lang-dis,
-%D version=2005.02.12,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Distribution Patterns,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 code used to be part of cont-usr.tex but now that we
-%D use more generic pattern files, we decided to isolate these
-%D mappings.
-
-\writestatus{loading}{ConTeXt Language Macros / Distribution Patterns}
-
-%D Hyphenation patterns are normally sought in filed named
-%D \type {lang-xx.pat}. When present on the system, those
-%D patterns take precedence. This list will be adapted to
-%D the actual situation, given that it's noticed.
-
-%D The us/uk hyph 1/2 files will go
-
-\unprotect
-
-% \definefilefallback [lang-ca.pat] [cahyph.tex]
-% \definefilefallback [lang-da.pat] [dkhyph.tex]
-% \definefilefallback [lang-de.pat] [dehyphn.tex]
-% \definefilefallback [lang-es.pat] [eshyph.tex]
-% \definefilefallback [lang-fi.pat] [fihyph.tex]
-% \definefilefallback [lang-fr.pat] [frhyph.tex]
-% \definefilefallback [lang-hr.pat] [hrhyph.tex]
-% \definefilefallback [lang-hu.pat] [huhyph.tex]
-% \definefilefallback [lang-it.pat] [ithyph.tex]
-% \definefilefallback [lang-la.pat] [lahyph7.tex]
-% \definefilefallback [lang-no.pat] [nohyph.tex]
-% \definefilefallback [lang-pl.pat] [plhyph.tex]
-% \definefilefallback [lang-pt.pat] [pthyph.tex]
-% \definefilefallback [lang-ro.pat] [rohyph.tex]
-% \definefilefallback [lang-ru.pat] [ruenhyph.tex]
-% \definefilefallback [lang-sl.pat] [sihyph.tex,slhyph.tex]
-% \definefilefallback [lang-sv.pat] [svhyph.tex,sehyph.tex]
-% \definefilefallback [lang-tr.pat] [tkhyph.tex,trhyph.tex]
-% \definefilefallback [lang-ua.pat] [ukrenhyp.tex]
-% \definefilefallback [lang-uk.pat] [ukhyphen.tex,ukhyph.tex]
-% \definefilefallback [lang-us.pat] [ushyphmax.tex,ushyph.tex,ushyph1.tex,ushyph2.tex,hyphen.tex]
-% \definefilefallback [lang-nl.pat] [nehyph96.tex,dutch96.pat,nehyph.tex]
-% \definefilefallback [lang-cz.pat] [czhyphen.tex,czhyph.pat]
-% \definefilefallback [lang-sk.pat] [skhyphen.tex,skhyph.pat]
-% \definefilefallback [lang-deo.pat] [dehypht.tex]
-
-% \definefilesynonym [lang-af.pat] [lang-nl.pat]
-% \definefilesynonym [lang-en.pat] [lang-us.pat]
-% \definefilesynonym [lang-en.hyp] [lang-us.hyp]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/lang-frd.mkii b/Master/texmf-dist/tex/context/base/mkii/lang-frd.mkii
deleted file mode 100644
index be4e07b75df..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/lang-frd.mkii
+++ /dev/null
@@ -1,140 +0,0 @@
-%D \module
-%D [ file=lang-frd,
-%D version=2004.01.15,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Language Frequency Table Data,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 expewrimental work!
-
-% http://www.onzetaal.nl/advies/letterfreq.html
-
-\startcharactertable[nl]
- \charfreq a 7.47
- \charfreq b 1.58
- \charfreq c 1.24
- \charfreq d 5.93
- \charfreq e 18.91
- \charfreq f .81
- \charfreq g 3.4
- \charfreq h 2.38
- \charfreq i 6.5
- \charfreq j 1.46
- \charfreq k 2.25
- \charfreq l 3.57
- \charfreq m 2.21
- \charfreq n 10.03
- \charfreq o 6.06
- \charfreq p 1.57
- \charfreq q .009
- \charfreq r 6.41
- \charfreq s 3.73
- \charfreq t 6.79
- \charfreq u 1.99
- \charfreq v 2.85
- \charfreq w 1.52
- \charfreq x .04
- \charfreq y .035
- \charfreq z 1.39
-\stopcharactertable
-
-% http://caislab.icu.ac.kr/course/2001/spring/ice605/down/010306.pdf
-
-% \startcharactertable[en]
-% \charfreq a 8.2
-% \charfreq b 1.5
-% \charfreq c 2.8
-% \charfreq d 4.3
-% \charfreq e 12.7
-% \charfreq f 2.2
-% \charfreq g 2
-% \charfreq h 6.1
-% \charfreq i 7
-% \charfreq j .2
-% \charfreq k .8
-% \charfreq l 4
-% \charfreq m 2.4
-% \charfreq n 6.7
-% \charfreq o 7.5
-% \charfreq p 1.9
-% \charfreq q .1
-% \charfreq r 6
-% \charfreq s 6.3
-% \charfreq t 9.1
-% \charfreq u 2.8
-% \charfreq v 1
-% \charfreq w 2.3
-% \charfreq x .1
-% \charfreq y 2
-% \charfreq z .1
-% \stopcharactertable
-
-% http://www.blankenburg.de/gat/pages/fach/info/analyse2.htm
-
-\startcharactertable[en]
- \charfreq a 8.04
- \charfreq b 1.54
- \charfreq c 3.06
- \charfreq d 3.99
- \charfreq e 12.51
- \charfreq f 2.3
- \charfreq g 1.96
- \charfreq h 5.49
- \charfreq i 7.26
- \charfreq j .16
- \charfreq k .67
- \charfreq l 4.14
- \charfreq m 2.53
- \charfreq n 7.09
- \charfreq o 7.6
- \charfreq p 2
- \charfreq q .11
- \charfreq r 6.12
- \charfreq s 6.54
- \charfreq t 9.25
- \charfreq u 2.71
- \charfreq v .99
- \charfreq w 1.92
- \charfreq x .19
- \charfreq y 1.73
- \charfreq z .09
-\stopcharactertable
-
-% http://www.blankenburg.de/gat/pages/fach/info/analyse2.htm
-
-\startcharactertable[de]
- \charfreq a 6.47
- \charfreq b 1.93
- \charfreq c 2.68
- \charfreq d 4.83
- \charfreq e 17.48
- \charfreq f 1.65
- \charfreq g 3.06
- \charfreq h 4.23
- \charfreq i 7.73
- \charfreq j .27
- \charfreq k 1.46
- \charfreq l 3.49
- \charfreq m 2.58
- \charfreq n 9.84
- \charfreq o 2.98
- \charfreq p .96
- \charfreq q .02
- \charfreq r 7.54
- \charfreq s 6.83
- \charfreq t 6.13
- \charfreq u 4.17
- \charfreq v .94
- \charfreq w 1.48
- \charfreq x .04
- \charfreq y .08
- \charfreq z 1.14
-\stopcharactertable
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/lang-frq.mkii b/Master/texmf-dist/tex/context/base/mkii/lang-frq.mkii
deleted file mode 100644
index afeb5329c64..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/lang-frq.mkii
+++ /dev/null
@@ -1,207 +0,0 @@
-%D \module
-%D [ file=lang-frq,
-%D version=2004.01.15,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Frequency Tables,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Language Macros / Frequency Tables}
-
-\unprotect
-
-\ifx\s!en\undefined \def\v!en{en} \fi
-\ifx\??lg\undefined \def\??lg{@@lg} \fi
-
-%M \usemodule[layout]
-
-%D \macros
-%D {charwidthmethod}
-%D
-%D This module implements a method for determining the width of an
-%D average character in a language. It uses the dimensions of the
-%D current fonts.
-%D
-%D \def\ShwChrWd#1#2#3%
-%D {\chardef\charwidthmethod#1\relax
-%D \mainlanguage[#2#3]\the\dimexpr(\averagecharwidth)}
-%D
-%D \starttabulate[|c|c|c|c|c|c|]
-%D \HL
-%D \NC \NC\bf0=amount\NC\bf1=.5em\NC2=ex\NC\bf3=frequency\NC\bf4=list\NC\NR
-%D \HL
-%D \NC\bf en\NC\ShwChrWd0en\NC\ShwChrWd1en\NC\ShwChrWd2en\NC\ShwChrWd3en\NC\ShwChrWd4en\NC\NR
-%D \NC\bf nl\NC\ShwChrWd0nl\NC\ShwChrWd1nl\NC\ShwChrWd2nl\NC\ShwChrWd3nl\NC\ShwChrWd4nl\NC\NR
-%D \NC\bf de\NC\ShwChrWd0de\NC\ShwChrWd1de\NC\ShwChrWd2de\NC\ShwChrWd3de\NC\ShwChrWd4de\NC\NR
-%D \HL
-%D \stoptabulate
-%D
-%D Method~1 ignores the widths and assumes that each character has a
-%D width of .5em, which is true for most monospaced fonts. Method~2
-%D takes the x as starting point, and assumes that it's height kind of
-%D matches its width. Method~3 is the best one, and determines the
-%D average width based on the language specific character table.
-%D Method~4 is a mixture between the first two methods: character
-%D specific widths applied to an equal distribution. Method~0 reports
-%D the total count, which normally is~100.
-
-\chardef\charwidthmethod=3 % 0=amount 1=em 2=ex 3=frequency 4=flattened >4=ex
-
-%D \macros
-%D {charwidthlanguage}
-%D
-%D The language used for the calculations is defined as:
-
-\def\charwidthlanguage{\currentmainlanguage}
-
-%D \macros
-%D {charfreq}
-%D
-%D This method comes into action in the following macro:
-
-\def\charfreq#1 #2 % character fraction
- {+(\ifcase\charwidthmethod
- #2\dimexpr100\onepoint\relax
- \or
- #2\dimexpr.5em\relax % \emwidth/2
- \or
- #2\dimexpr\exheight\relax
- \or
- #2\fontcharwd\font`#1%
- \or
- \dimexpr100\fontcharwd\font`#1/\charactertsize\charwidthlanguage\relax % ugly hack
- \else
- #2\dimexpr\exheight\relax
- \fi)}
-
-%D \macros
-%D {startcharactertable}
-%D
-%D A frequency table is defined with the following macro. The \type
-%D {charfreq} macro is used in this table.
-
-\def\startcharactertable[#1]#2\stopcharactertable % \dimexpr has fuzzy lookahead
- {\startnointerference
- \long\setgvalue{\??lg:w:#1}{#2}% the width vector
- \scratchcounter\zerocount \def\charfreq##1 ##2 {\advance\scratchcounter\plusone} #2%
- \long\setxvalue{\??lg:c:#1}{\the\scratchcounter}% the character count
- \stopnointerference}
-
-%D \macros
-%D {charactertable,charactertsize}
-%D
-%D The table content as well as the number of entries can be fetched with
-%D the following two macros. The architecture of the table and calling
-%D macro permits a fully expandable application.
-
-\def\charactertable#1%
- {\csname\??lg:w:\ifcsname\??lg:w:#1\endcsname#1\else\s!en\fi\endcsname}
-
-\def\charactertsize#1%
- {\csname\??lg:c:\ifcsname\??lg:c:#1\endcsname#1\else\s!en\fi\endcsname}
-
-%D Although it is of hardly any use, you can inherit a character table:
-%D
-%D \starttyping
-%D \startcharactertable[cz] \charactertable{en} \stopcharactertable
-%D \stoptyping
-%D
-%D We define a default vector with 100\% x's.
-
-\startcharactertable[en] 100 x \stopcharactertable % kind of default
-
-%D \macros
-%D {averagecharwidth}
-%D
-%D This macro reports the average width for the current main
-%D language (\the \dimexpr (\averagecharwidth)).
-
-\def\averagecharwidth{\dimexpr((\zeropoint\charactertable\charwidthlanguage)/100)}
-
-\def\showcharfreq
- {\hbox\bgroup
- \charwidthlanguage:%
- \dostepwiserecurse041%
- {\chardef\charwidthmethod\recurselevel\relax
- \enspace\recurselevel/\the\dimexpr(\averagecharwidth)}%
- \egroup}
-
-%D Just for fun, we show a few frequency tables as graphic (\in {figure}
-%D [fig:charfreq]).
-%D
-%D \startbuffer
-%D \definepalet [charfreq] [en=darkred, nl=darkgreen, de=darkblue]
-%D
-%D \def\charfreq#1 #2 %
-%D {\startMPdrawing
-%D interim linejoin := butt ;
-%D a := ASCII "#1" ;
-%D if (a >= (ASCII "a")) and (a <= (ASCII "z")) :
-%D draw ((0,#2*.25cm)--origin--(0,#2*.5cm))
-%D shifted (a*4mm+o,0)
-%D withpen pencircle scaled .5mm
-%D withcolor c;
-%D fi ;
-%D \stopMPdrawing}
-%D
-%D \resetMPdrawing
-%D \startMPdrawing
-%D numeric a, o ; a := o := 0 ;
-%D color c ; c := .5white ;
-%D string s ; s := "" ;
-%D \stopMPdrawing
-%D
-%D \startMPdrawing o := 0mm ; c := \MPcolor{charfreq:en} ; \stopMPdrawing
-%D \charactertable{en}
-%D
-%D \startMPdrawing o := 1mm ; c := \MPcolor{charfreq:nl} ; \stopMPdrawing
-%D \charactertable{nl}
-%D
-%D \startMPdrawing o := 2mm ; c := \MPcolor{charfreq:de} ; \stopMPdrawing
-%D \charactertable{de}
-%D
-%D \startMPdrawing
-%D for a := ASCII "a" upto ASCII "z" :
-%D draw textext.bot("\strut\tttf " & char a) shifted (a*4mm+1mm,-1mm) ;
-%D endfor ;
-%D \stopMPdrawing
-%D
-%D \MPdrawingdonetrue \getMPdrawing \resetMPdrawing
-%D \stopbuffer
-%D
-%D \placefigure
-%D [here]
-%D [fig:charfreq]
-%D {The character distributions for English, Dutch and German.}
-%D {\getbuffer}
-%D
-%D A few samples of usage of this mechanism are shown below:
-%D
-%D \startbuffer
-%D {\mainlanguage[en]\hsize65\averagecharwidth\mainlanguage[en]\input ward \blank}
-%D {\mainlanguage[nl]\hsize65\averagecharwidth\mainlanguage[en]\input ward \blank}
-%D {\mainlanguage[de]\hsize65\averagecharwidth\mainlanguage[en]\input ward \blank}
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-%D
-%D Although the widthts differ, the consequenes for breaking the paragraph
-%D into lines are minimal.
-
-%D \macros
-%D {freezeaveragecharacterwidth}
-%D
-%D This macro can be used to make sure that the width does not change during a
-%D page break when another font is used.
-
-\let\normalaveragecharacterwidth\averagecharacterwidth
-
-\def\freezeaveragecharacterwidth % global
- {\xdef\averagecharacterwidth{\dimexpr(\the\normalaveragecharacterwidth)}}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/lang-ger.mkii b/Master/texmf-dist/tex/context/base/mkii/lang-ger.mkii
deleted file mode 100644
index d33620cc7bc..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/lang-ger.mkii
+++ /dev/null
@@ -1,744 +0,0 @@
-%D \module
-%D [ file=lang-ger,
-%D version=1997.09.03,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Germanic Languages,
-%D author=Hans Hagen / Tobias Burnus,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Language Macros / Germanic Languages}
-
-%D The framework of this module is set up by Hans Hagen while
-%D many of the first translations were done by Tobias. Later
-%D on, corrections were made by users. If you have suggestions,
-%D or feel that your name missing here, don't hesitate to send
-%D us an email.
-%D
-%D \starttabulate[|lB|l|]
-%D \NC Norwegian \NC Hans Fredrik Nordhaug \NC \NR
-%D \NC Danish \NC Arne Jorgensen \NC \NR % check the o
-%D \NC Afrikaans \NC \NC \NR
-%D \stoptabulate
-
-% Danish, Faeroese, Icelandic, Norwegian, Swedish, German, Yiddish
-% Afrikaans, Dutch, English, Flemush, Frisian, Plattdeutsch
-
-\unprotect
-
-\installlanguage
- [\s!nl]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\lowerleftsingleninequote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\lowerleftdoubleninequote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!day,\ ,\v!month,\ ,\v!year},
- \s!mapping={texnansi,ec},
- \s!encoding={texnansi,ec}]
-
-\installlanguage
- [\s!en]
- [\c!spacing=\v!broad,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\upperleftsinglesixquote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\upperleftdoublesixquote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!month,\ ,\v!day,{,\ },\v!year},
- \s!patterns=\s!us,
- \s!lefthyphenmin=2,
- \s!righthyphenmin=3]
-
-\installlanguage
- [\s!de]
- [\c!spacing=\v!packed,
- \s!lefthyphenmin=3,
- \s!righthyphenmin=3,
- \c!leftsentence={\hbox{--~}},
- \c!rightsentence={\hbox{~--}},
- \c!leftsubsentence={--},
- \c!rightsubsentence={--},
- \c!leftquote=\lowerleftsingleninequote,
- \c!rightquote=\upperrightsinglesixquote,
- \c!leftquotation=\lowerleftdoubleninequote,
- \c!rightquotation=\upperrightdoublesixquote,
- \c!date={\v!day,{.},\ ,\v!month,\ ,\v!year},
- \s!mapping={texnansi,ec},
- \s!encoding={texnansi,ec}]
-
-\installlanguage
- [\s!da]
- [\c!spacing=\v!packed,
- \c!leftsentence={\hbox{--\hskip.5em}},
- \c!rightsentence={\hbox{\hskip.5em--}},
- \c!leftsubsentence={--},
- \c!rightsubsentence={--},
- \c!leftquote=\lowerleftsingleninequote,
- \c!rightquote=\upperrightsinglesixquote,
- \c!leftquotation=\lowerleftdoubleninequote,
- \c!rightquotation=\upperrightdoublesixquote,
- \c!date={\v!day,{.},\ ,\v!month,\ ,\v!year}]
-
-\installlanguage
- [\s!sv]
- [\c!spacing=\v!packed,
- \c!leftsentence={\hbox{--~}},
- \c!rightsentence={\hbox{~--}},
- \c!leftsubsentence={--},
- \c!rightsubsentence={--},
- \c!leftquote=\upperrightsingleninequote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\upperrightdoubleninequote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!day,\ ,\v!month,\ ,\v!year}]
-
-\installlanguage
- [\s!af]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\upperleftsinglesixquote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\upperleftdoublesixquote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!year,\ ,\v!month,\ ,\v!day},
- \s!patterns=\s!af] % was nl
-
-\installlanguage
- [\s!nb]
- [spacing=packed,
- lefthyphenmin=2,
- righthyphenmin=2,
- leftsentence=---,
- rightsentence=---,
- leftsubsentence=---,
- rightsubsentence=---,
- leftquote=\upperleftsinglesixquote,
- rightquote=\upperrightsingleninequote,
- leftquotation=\leftguillemot,
- rightquotation=\rightguillemot,
- date={day,{.},\ ,month,\ ,year},
- state=stop]
-
-\installlanguage
- [\s!nn]
- [spacing=packed,
- lefthyphenmin=2,
- righthyphenmin=2,
- leftsentence=---,
- rightsentence=---,
- leftsubsentence=---,
- rightsubsentence=---,
- leftquote=\upperleftsinglesixquote,
- rightquote=\upperrightsingleninequote,
- leftquotation=\leftguillemot,
- rightquotation=\rightguillemot,
- date={day,{.},\ ,month,\ ,year},
- state=stop]
-
-\installlanguage [\s!no] [\s!nb]
-\installlanguage [\s!norwegian] [\s!nb]
-\installlanguage [\s!bokmal] [\s!nb]
-\installlanguage [\s!nynorsk] [\s!nn]
-
-%D Extra:
-
-% \mainlanguage[en]
-% \mainlanguage[de]
-% \mainlanguage[deo]
-% \mainlanguage[de-de]
-% \mainlanguage[de-at]
-% \mainlanguage[de-ch]
-%
-% \starttext
-% Die Herren Meier\index{Meier}, Müller\index{Müller}, Huber\index{Huber}
-% und Schmidt\index{Schmidt} arbeiten in der gleichen Firma.
-%
-% \index{Mass}\index{Mas}\index{Maß}\index{Maße}\index{Masse}
-% \index{Muller}\index{Mûller}
-% \index{Hutte}\index{Hütte}\index{Huttf}
-% \index{paar}\index{Paar}
-% \index{a}\index{aa}\index{ä}\index{az}\index{aza}
-% \index{o}\index{oo}\index{ö}\index{oz}\index{oza}
-% \index{u}\index{uu}\index{ü}\index{uz}\index{uza}\index{üa}
-% \index{call}\index{chip}
-%
-% \subject{Index} \placeindex
-% \stoptext
-
-\installlanguage % old german
- [deo]
- [\c!spacing=\v!packed,
- \c!default=\s!de]
-
-\installlanguage
- [de-de]
- [\c!spacing=\v!packed,
- \c!default=\s!de]
-
-\installlanguage
- [de-at]
- [\c!spacing=\v!packed,
- \c!default=\s!de,
- \c!leftquote=\leftguillemot,
- \c!rightquote=\rightguillemot,
- \c!leftquotation=\leftguillemot,
- \c!rightquotation=\rightguillemot]
-
-\installlanguage
- [de-ch]
- [\c!spacing=\v!packed,
- \c!default=\s!de]
-
-%D And some alternative (but very real) english patterns:
-
-\installlanguage
- [en-gb]
- [\c!default=\s!en,
- \s!patterns=\s!gb,
- \s!lefthyphenmin=3,
- \s!righthyphenmin=3]
-
-\installlanguage
- [en-us]
- [\c!default=\s!en,
- \s!patterns=\s!us]
-
-\installlanguage [\s!uk] [\s!en-\s!gb]
-\installlanguage [\s!us] [\s!en-\s!us]
-
-%D For compatibility reasons we also define:
-
-%installlanguage [du] [\s!de] % old times context
-%installlanguage [sp] [\s!es] % old times context /lang-ita
-
-\installlanguage [usenglish] [\s!en-\s!us]
-\installlanguage [ukenglish] [\s!en-\s!gb]
-\installlanguage [english] [\s!en]
-\installlanguage [dutch] [\s!nl]
-\installlanguage [german] [\s!de]
-\installlanguage [danish] [\s!da]
-\installlanguage [swedish] [\s!sv]
-\installlanguage [afrikaans] [\s!af]
-
-\setupheadtext [\s!en] [\v!content=Contents]
-\setupheadtext [\s!nl] [\v!content=Inhoud]
-\setupheadtext [\s!de] [\v!content=Inhalt]
-\setupheadtext [\s!da] [\v!content=Indhold]
-\setupheadtext [\s!sv] [\v!content=Inneh\aring ll]
-\setupheadtext [\s!af] [\v!content=Inhoud]
-\setupheadtext [\s!nb] [\v!content=Innhold]
-\setupheadtext [\s!nn] [\v!content=Innhald]
-
-\setupheadtext [\s!en] [\v!tables=Tables]
-\setupheadtext [\s!nl] [\v!tables=Tabellen]
-\setupheadtext [\s!de] [\v!tables=Tabellen]
-\setupheadtext [\s!da] [\v!tables=Tabeller]
-\setupheadtext [\s!sv] [\v!tables=Tabeller]
-\setupheadtext [\s!af] [\v!tables=Tabelle]
-\setupheadtext [\s!nb] [\v!tables=Tabeller]
-\setupheadtext [\s!nn] [\v!tables=Tabellar]
-
-\setupheadtext [\s!en] [\v!figures=Figures]
-\setupheadtext [\s!nl] [\v!figures=Figuren]
-\setupheadtext [\s!de] [\v!figures=Abbildungen]
-\setupheadtext [\s!da] [\v!figures=Figurer]
-\setupheadtext [\s!sv] [\v!figures=Figurer]
-\setupheadtext [\s!af] [\v!figures=Figure]
-\setupheadtext [\s!nb] [\v!figures=Figurer]
-\setupheadtext [\s!nn] [\v!figures=Figurar]
-
-\setupheadtext [\s!en] [\v!graphics=Graphics]
-\setupheadtext [\s!nl] [\v!graphics=Grafieken]
-\setupheadtext [\s!de] [\v!graphics=Graphiken]
-\setupheadtext [\s!da] [\v!graphics=Grafik]
-\setupheadtext [\s!sv] [\v!graphics=Grafik]
-\setupheadtext [\s!af] [\v!graphics=Grafieke]
-\setupheadtext [\s!nb] [\v!graphics=Bilde]
-\setupheadtext [\s!nn] [\v!graphics=Bilete]
-
-\setupheadtext [\s!en] [\v!intermezzi=Intermezzos]
-\setupheadtext [\s!nl] [\v!intermezzi=Intermezzo's]
-\setupheadtext [\s!de] [\v!intermezzi=Intermezzi]
-\setupheadtext [\s!da] [\v!intermezzi=Intermezzoer]
-\setupheadtext [\s!sv] [\v!intermezzi=Intermezzon]
-\setupheadtext [\s!af] [\v!intermezzi=Intermezzos]
-\setupheadtext [\s!nb] [\v!intermezzi=Intermesso]
-\setupheadtext [\s!nn] [\v!intermezzi=Intermesso]
-
-\setupheadtext [\s!en] [\v!index=Index]
-\setupheadtext [\s!nl] [\v!index=Index]
-\setupheadtext [\s!de] [\v!index=Index]
-\setupheadtext [\s!da] [\v!index=Indeks]
-\setupheadtext [\s!sv] [\v!index=Sakregister]
-\setupheadtext [\s!af] [\v!index=Indeks]
-\setupheadtext [\s!nb] [\v!index=Register]
-\setupheadtext [\s!nn] [\v!index=Register]
-
-\setupheadtext [\s!en] [\v!abbreviations=Abbreviations]
-\setupheadtext [\s!nl] [\v!abbreviations=Afkortingen]
-\setupheadtext [\s!de] [\v!abbreviations=Abk\uumlaut rzungen]
-\setupheadtext [\s!da] [\v!abbreviations=Forkortelser]
-\setupheadtext [\s!sv] [\v!abbreviations=F\oumlaut rkortningar]
-\setupheadtext [\s!af] [\v!abbreviations=Afkortings]
-\setupheadtext [\s!nb] [\v!abbreviations=Forkortelser]
-\setupheadtext [\s!nn] [\v!abbreviations=Forkortingar]
-
-\setupheadtext [\s!en] [\v!logos=Logos]
-\setupheadtext [\s!nl] [\v!logos=Logo's]
-\setupheadtext [\s!de] [\v!logos=Logos]
-\setupheadtext [\s!da] [\v!logos=Logoer]
-\setupheadtext [\s!sv] [\v!logos=Loggor]
-\setupheadtext [\s!af] [\v!logos=Logos]
-\setupheadtext [\s!nb] [\v!logos=Logoer]
-\setupheadtext [\s!nn] [\v!logos=Logoar]
-
-\setupheadtext [\s!en] [\v!units=Units]
-\setupheadtext [\s!nl] [\v!units=Eenheden]
-\setupheadtext [\s!de] [\v!units=Einheiten]
-\setupheadtext [\s!da] [\v!units=Enheder]
-\setupheadtext [\s!sv] [\v!units=Enheter]
-\setupheadtext [\s!af] [\v!units=Eenhede]
-\setupheadtext [\s!nb] [\v!units=Enheter]
-\setupheadtext [\s!nn] [\v!units=Einingar]
-
-\setupheadtext [\s!en] [pubs=References]
-\setupheadtext [\s!nl] [pubs=Literatuur]
-\setupheadtext [\s!de] [pubs=Literatur]
-%setupheadtext [\s!da] [pubs=?]
-%setupheadtext [\s!sv] [pubs=?]
-%setupheadtext [\s!af] [pubs=?]
-%setupheadtext [\s!nb] [pubs=?]
-%setupheadtext [\s!nn] [pubs=?]
-
-\setuplabeltext [\s!en] [\v!table=Table ]
-\setuplabeltext [\s!nl] [\v!table=Tabel ]
-\setuplabeltext [\s!de] [\v!table=Tabelle ]
-\setuplabeltext [\s!da] [\v!table=Tabel ]
-\setuplabeltext [\s!sv] [\v!table=Tabell ]
-\setuplabeltext [\s!af] [\v!table=Tabel]
-\setuplabeltext [\s!nb] [\v!table=Tabell ]
-\setuplabeltext [\s!nn] [\v!table=Tabell ]
-
-\setuplabeltext [\s!en] [\v!figure=Figure ]
-\setuplabeltext [\s!nl] [\v!figure=Figuur ]
-\setuplabeltext [\s!de] [\v!figure=Abbildung ]
-\setuplabeltext [\s!da] [\v!figure=Figur ]
-\setuplabeltext [\s!sv] [\v!figure=Figur ]
-\setuplabeltext [\s!af] [\v!figure=Figuur ]
-\setuplabeltext [\s!nb] [\v!figure=Figur ]
-\setuplabeltext [\s!nn] [\v!figure=Figur ]
-
-\setuplabeltext [\s!en] [\v!intermezzo=Intermezzo ]
-\setuplabeltext [\s!nl] [\v!intermezzo=Intermezzo ]
-\setuplabeltext [\s!de] [\v!intermezzo=Intermezzo ]
-\setuplabeltext [\s!da] [\v!intermezzo=Intermezzo ]
-\setuplabeltext [\s!sv] [\v!intermezzo=Intermezzo ]
-\setuplabeltext [\s!af] [\v!intermezzo=Intermezzo ]
-\setuplabeltext [\s!nb] [\v!intermezzo=Intermesso ]
-\setuplabeltext [\s!nn] [\v!intermezzo=Intermesso ]
-
-\setuplabeltext [\s!en] [\v!graphic=Graphic ]
-\setuplabeltext [\s!nl] [\v!graphic=Grafiek ]
-\setuplabeltext [\s!de] [\v!graphic=Graphik ]
-\setuplabeltext [\s!da] [\v!graphic=Grafik ]
-\setuplabeltext [\s!sv] [\v!graphic=Grafik ]
-\setuplabeltext [\s!af] [\v!graphic=Grafiek ]
-\setuplabeltext [\s!nb] [\v!graphic=Bilde ]
-\setuplabeltext [\s!nn] [\v!graphic=Bilete ]
-
-%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=] % Kapitel
-\setuplabeltext [\s!da] [\v!chapter=]
-\setuplabeltext [\s!sv] [\v!chapter=]
-\setuplabeltext [\s!af] [\v!chapter=] % Hoofstuk
-\setuplabeltext [\s!nb] [\v!chapter=]
-\setuplabeltext [\s!nn] [\v!chapter=]
-
-\setuplabeltext [\s!en] [\v!section=]
-\setuplabeltext [\s!nl] [\v!section=]
-\setuplabeltext [\s!de] [\v!section=]
-\setuplabeltext [\s!da] [\v!section=]
-\setuplabeltext [\s!sv] [\v!section=]
-\setuplabeltext [\s!af] [\v!section=] % Paragraaf
-\setuplabeltext [\s!nb] [\v!section=]
-\setuplabeltext [\s!nn] [\v!section=]
-
-\setuplabeltext [\s!en] [\v!subsection=]
-\setuplabeltext [\s!nl] [\v!subsection=]
-\setuplabeltext [\s!de] [\v!subsection=]
-\setuplabeltext [\s!da] [\v!subsection=]
-\setuplabeltext [\s!sv] [\v!subsection=]
-\setuplabeltext [\s!af] [\v!subsection=]
-\setuplabeltext [\s!nb] [\v!subsection=]
-\setuplabeltext [\s!nn] [\v!subsection=]
-
-\setuplabeltext [\s!en] [\v!subsubsection=]
-\setuplabeltext [\s!nl] [\v!subsubsection=]
-\setuplabeltext [\s!de] [\v!subsubsection=]
-\setuplabeltext [\s!da] [\v!subsubsection=]
-\setuplabeltext [\s!sv] [\v!subsubsection=]
-\setuplabeltext [\s!af] [\v!subsubsection=]
-\setuplabeltext [\s!nb] [\v!subsubsection=]
-\setuplabeltext [\s!nn] [\v!subsubsection=]
-
-\setuplabeltext [\s!en] [\v!subsubsubsection=]
-\setuplabeltext [\s!nl] [\v!subsubsubsection=]
-\setuplabeltext [\s!de] [\v!subsubsubsection=]
-\setuplabeltext [\s!da] [\v!subsubsubsection=]
-\setuplabeltext [\s!sv] [\v!subsubsubsection=]
-\setuplabeltext [\s!af] [\v!subsubsubsection=]
-\setuplabeltext [\s!nb] [\v!subsubsubsection=]
-\setuplabeltext [\s!nn] [\v!subsubsubsection=]
-
-\setuplabeltext [\s!en] [\v!appendix=] % Appendix
-\setuplabeltext [\s!nl] [\v!appendix=]
-\setuplabeltext [\s!de] [\v!appendix=] % Anhang
-\setuplabeltext [\s!da] [\v!appendix=] % Bilag
-\setuplabeltext [\s!sv] [\v!appendix=]
-\setuplabeltext [\s!af] [\v!appendix=] % Bylae
-\setuplabeltext [\s!nb] [\v!appendix=] % Tillegg
-\setuplabeltext [\s!nn] [\v!appendix=] % Tillegg
-
-\setuplabeltext [\s!en] [\v!part=Part ]
-\setuplabeltext [\s!nl] [\v!part=Deel ]
-\setuplabeltext [\s!de] [\v!part=Teil ]
-\setuplabeltext [\s!da] [\v!part=Del ]
-\setuplabeltext [\s!sv] [\v!part=Del ]
-\setuplabeltext [\s!af] [\v!part=Deel ]
-\setuplabeltext [\s!nb] [\v!part=Del]
-\setuplabeltext [\s!nn] [\v!part=Del]
-
-\setuplabeltext [\s!en] [\v!line=line ]
-\setuplabeltext [\s!nl] [\v!line=regel ]
-\setuplabeltext [\s!de] [\v!line=Zeile ]
-\setuplabeltext [\s!da] [\v!line=linie ] % or linje
-\setuplabeltext [\s!sv] [\v!line=rad ]
-\setuplabeltext [\s!af] [\v!line=re\ediaeresis l ]
-\setuplabeltext [\s!nb] [\v!line=linje ]
-\setuplabeltext [\s!nn] [\v!line=linje ]
-
-\setuplabeltext [\s!en] [\v!lines=lines ]
-\setuplabeltext [\s!nl] [\v!lines=regels ]
-\setuplabeltext [\s!de] [\v!lines=Zeilen ]
-\setuplabeltext [\s!da] [\v!lines=linier ] % or linjer
-\setuplabeltext [\s!sv] [\v!lines=rader ]
-\setuplabeltext [\s!af] [\v!lines=re\ediaeresis ls ]
-\setuplabeltext [\s!nb] [\v!lines=linjer ]
-\setuplabeltext [\s!nn] [\v!lines=linjer ]
-
-\setuplabeltext [\s!en] [\v!january=January]
-\setuplabeltext [\s!en] [\v!february=February]
-\setuplabeltext [\s!en] [\v!march=March]
-\setuplabeltext [\s!en] [\v!april=April]
-\setuplabeltext [\s!en] [\v!may=May]
-\setuplabeltext [\s!en] [\v!june=June]
-\setuplabeltext [\s!en] [\v!july=July]
-\setuplabeltext [\s!en] [\v!august=August]
-\setuplabeltext [\s!en] [\v!september=September]
-\setuplabeltext [\s!en] [\v!october=October]
-\setuplabeltext [\s!en] [\v!november=November]
-\setuplabeltext [\s!en] [\v!december=December]
-
-\setuplabeltext [\s!nl] [\v!january=januari]
-\setuplabeltext [\s!nl] [\v!february=februari]
-\setuplabeltext [\s!nl] [\v!march=maart]
-\setuplabeltext [\s!nl] [\v!april=april]
-\setuplabeltext [\s!nl] [\v!may=mei]
-\setuplabeltext [\s!nl] [\v!june=juni]
-\setuplabeltext [\s!nl] [\v!july=juli]
-\setuplabeltext [\s!nl] [\v!august=augustus]
-\setuplabeltext [\s!nl] [\v!september=september]
-\setuplabeltext [\s!nl] [\v!october=oktober]
-\setuplabeltext [\s!nl] [\v!november=november]
-\setuplabeltext [\s!nl] [\v!december=december]
-
-\setuplabeltext [\s!de] [\v!january=Januar]
-\setuplabeltext [\s!de] [\v!february=Februar]
-\setuplabeltext [\s!de] [\v!march=M\aumlaut rz]
-\setuplabeltext [\s!de] [\v!april=April]
-\setuplabeltext [\s!de] [\v!may=Mai]
-\setuplabeltext [\s!de] [\v!june=Juni]
-\setuplabeltext [\s!de] [\v!july=Juli]
-\setuplabeltext [\s!de] [\v!august=August]
-\setuplabeltext [\s!de] [\v!september=September]
-\setuplabeltext [\s!de] [\v!october=Oktober]
-\setuplabeltext [\s!de] [\v!november=November]
-\setuplabeltext [\s!de] [\v!december=Dezember]
-
-\setuplabeltext [\s!da] [\v!january=januar]
-\setuplabeltext [\s!da] [\v!february=februar]
-\setuplabeltext [\s!da] [\v!march=marts]
-\setuplabeltext [\s!da] [\v!april=april]
-\setuplabeltext [\s!da] [\v!may=maj]
-\setuplabeltext [\s!da] [\v!june=juni]
-\setuplabeltext [\s!da] [\v!july=juli]
-\setuplabeltext [\s!da] [\v!august=august]
-\setuplabeltext [\s!da] [\v!september=september]
-\setuplabeltext [\s!da] [\v!october=oktober]
-\setuplabeltext [\s!da] [\v!november=november]
-\setuplabeltext [\s!da] [\v!december=december]
-
-\setuplabeltext [\s!sv] [\v!january=januari]
-\setuplabeltext [\s!sv] [\v!february=februari]
-\setuplabeltext [\s!sv] [\v!march=mars]
-\setuplabeltext [\s!sv] [\v!april=april]
-\setuplabeltext [\s!sv] [\v!may=maj]
-\setuplabeltext [\s!sv] [\v!june=juni]
-\setuplabeltext [\s!sv] [\v!july=juli]
-\setuplabeltext [\s!sv] [\v!august=augusti]
-\setuplabeltext [\s!sv] [\v!september=september]
-\setuplabeltext [\s!sv] [\v!october=oktober]
-\setuplabeltext [\s!sv] [\v!november=november]
-\setuplabeltext [\s!sv] [\v!december=december]
-
-\setuplabeltext [\s!af] [\v!january=januarie]
-\setuplabeltext [\s!af] [\v!february=februarie]
-\setuplabeltext [\s!af] [\v!march=maart]
-\setuplabeltext [\s!af] [\v!april=april]
-\setuplabeltext [\s!af] [\v!may=mei]
-\setuplabeltext [\s!af] [\v!june=junie]
-\setuplabeltext [\s!af] [\v!july=julie]
-\setuplabeltext [\s!af] [\v!august=augustus]
-\setuplabeltext [\s!af] [\v!september=september]
-\setuplabeltext [\s!af] [\v!october=oktober]
-\setuplabeltext [\s!af] [\v!november=november]
-\setuplabeltext [\s!af] [\v!december=desember]
-
-\setuplabeltext [\s!nb] [\v!january=januar]
-\setuplabeltext [\s!nb] [\v!february=februar]
-\setuplabeltext [\s!nb] [\v!march=mars]
-\setuplabeltext [\s!nb] [\v!april=april]
-\setuplabeltext [\s!nb] [\v!may=mai]
-\setuplabeltext [\s!nb] [\v!june=juni]
-\setuplabeltext [\s!nb] [\v!july=juli]
-\setuplabeltext [\s!nb] [\v!august=august]
-\setuplabeltext [\s!nb] [\v!september=september]
-\setuplabeltext [\s!nb] [\v!october=oktober]
-\setuplabeltext [\s!nb] [\v!november=november]
-\setuplabeltext [\s!nb] [\v!december=desember]
-
-\setuplabeltext [\s!nn] [\v!january=januar]
-\setuplabeltext [\s!nn] [\v!february=februar]
-\setuplabeltext [\s!nn] [\v!march=mars]
-\setuplabeltext [\s!nn] [\v!april=april]
-\setuplabeltext [\s!nn] [\v!may=mai]
-\setuplabeltext [\s!nn] [\v!june=juni]
-\setuplabeltext [\s!nn] [\v!july=juli]
-\setuplabeltext [\s!nn] [\v!august=august]
-\setuplabeltext [\s!nn] [\v!september=september]
-\setuplabeltext [\s!nn] [\v!october=oktober]
-\setuplabeltext [\s!nn] [\v!november=november]
-\setuplabeltext [\s!nn] [\v!december=desember]
-
-\setuplabeltext [\s!en] [\v!sunday=Sunday]
-\setuplabeltext [\s!en] [\v!monday=Monday]
-\setuplabeltext [\s!en] [\v!tuesday=Tuesday]
-\setuplabeltext [\s!en] [\v!wednesday=Wednesday]
-\setuplabeltext [\s!en] [\v!thursday=Thursday]
-\setuplabeltext [\s!en] [\v!friday=Friday]
-\setuplabeltext [\s!en] [\v!saturday=Saturday]
-
-\setuplabeltext [\s!nl] [\v!sunday=zondag]
-\setuplabeltext [\s!nl] [\v!monday=maandag]
-\setuplabeltext [\s!nl] [\v!tuesday=dinsdag]
-\setuplabeltext [\s!nl] [\v!wednesday=woensdag]
-\setuplabeltext [\s!nl] [\v!thursday=donderdag]
-\setuplabeltext [\s!nl] [\v!friday=vrijdag]
-\setuplabeltext [\s!nl] [\v!saturday=zaterdag]
-
-\setuplabeltext [\s!de] [\v!sunday=Sonntag]
-\setuplabeltext [\s!de] [\v!monday=Montag]
-\setuplabeltext [\s!de] [\v!tuesday=Dienstag]
-\setuplabeltext [\s!de] [\v!wednesday=Mittwoch]
-\setuplabeltext [\s!de] [\v!thursday=Donnerstag]
-\setuplabeltext [\s!de] [\v!friday=Freitag]
-\setuplabeltext [\s!de] [\v!saturday=Samstag]
-
-\setuplabeltext [\s!da] [\v!sunday=s\ostroke ndag]
-\setuplabeltext [\s!da] [\v!monday=mandag]
-\setuplabeltext [\s!da] [\v!tuesday=tirsdag]
-\setuplabeltext [\s!da] [\v!wednesday=onsdag]
-\setuplabeltext [\s!da] [\v!thursday=torsdag]
-\setuplabeltext [\s!da] [\v!friday=fredag]
-\setuplabeltext [\s!da] [\v!saturday=l\ostroke rdag]
-
-\setuplabeltext [\s!sv] [\v!sunday=s\oumlaut ndag]
-\setuplabeltext [\s!sv] [\v!monday=m\aring ndag]
-\setuplabeltext [\s!sv] [\v!tuesday=tisdag]
-\setuplabeltext [\s!sv] [\v!wednesday=onsdag]
-\setuplabeltext [\s!sv] [\v!thursday=torsdag]
-\setuplabeltext [\s!sv] [\v!friday=fredag]
-\setuplabeltext [\s!sv] [\v!saturday=l\oumlaut rdag]
-
-\setuplabeltext [\s!af] [\v!sunday=sondag]
-\setuplabeltext [\s!af] [\v!monday=maandag]
-\setuplabeltext [\s!af] [\v!tuesday=dinsdag]
-\setuplabeltext [\s!af] [\v!wednesday=woensdag]
-\setuplabeltext [\s!af] [\v!thursday=donderdag]
-\setuplabeltext [\s!af] [\v!friday=vrydag]
-\setuplabeltext [\s!af] [\v!saturday=saterdag]
-
-\setuplabeltext [\s!nb] [\v!sunday=s\ostroke ndag]
-\setuplabeltext [\s!nb] [\v!monday=mandag]
-\setuplabeltext [\s!nb] [\v!tuesday=tirsdag]
-\setuplabeltext [\s!nb] [\v!wednesday=onsdag]
-\setuplabeltext [\s!nb] [\v!thursday=torsdag]
-\setuplabeltext [\s!nb] [\v!friday=fredag]
-\setuplabeltext [\s!nb] [\v!saturday=l\ostroke rdag]
-
-\setuplabeltext [\s!nn] [\v!sunday=sundag]
-\setuplabeltext [\s!nn] [\v!monday=m\aring ndag]
-\setuplabeltext [\s!nn] [\v!tuesday=tysdag]
-\setuplabeltext [\s!nn] [\v!wednesday=onsdag]
-\setuplabeltext [\s!nn] [\v!thursday=torsdag]
-\setuplabeltext [\s!nn] [\v!friday=fredag]
-\setuplabeltext [\s!nn] [\v!saturday=laurdag]
-
-%D Rather new ...
-
-\setuplabeltext [\s!nl] [\v!page=pagina ]
-\setuplabeltext [\s!nl] [\v!atpage=op pagina ]
-\setuplabeltext [\s!nl] [\v!hencefore=hierboven]
-\setuplabeltext [\s!nl] [\v!hereafter=hieronder]
-\setuplabeltext [\s!nl] [\v!see=zie ]
-\setuplabeltext [\s!nl] [\v!and= en ]
-\setuplabeltext [\s!nl] [\v!continued={ (vervolged)}]
-
-\setuplabeltext [\s!en] [\v!page=page ]
-\setuplabeltext [\s!en] [\v!atpage=at page ]
-\setuplabeltext [\s!en] [\v!hencefore=as we show above]
-\setuplabeltext [\s!en] [\v!hereafter=as we show below]
-\setuplabeltext [\s!en] [\v!see=see ]
-\setuplabeltext [\s!en] [\v!and= and ]
-\setuplabeltext [\s!en] [\v!continued={ (continued)}]
-
-\setuplabeltext [\s!de] [\v!page=Seite ]
-\setuplabeltext [\s!de] [\v!atpage=auf Seite ]
-\setuplabeltext [\s!de] [\v!hencefore=siehe oben]
-\setuplabeltext [\s!de] [\v!hereafter=siehe unten]
-\setuplabeltext [\s!de] [\v!see=siehe ]
-\setuplabeltext [\s!de] [\v!and= und ]
-
-\setuplabeltext [\s!da] [\v!page=Side ]
-\setuplabeltext [\s!da] [\v!atpage=p\aring\ side ]
-\setuplabeltext [\s!da] [\v!hencefore=se foroven]
-\setuplabeltext [\s!da] [\v!hereafter=se forneden]
-\setuplabeltext [\s!da] [\v!see=se ]
-
-\setuplabeltext [\s!sv] [\v!page=Sida ]
-\setuplabeltext [\s!sv] [\v!atpage=p\aring\ sida ]
-\setuplabeltext [\s!sv] [\v!hencefore=se ovan]
-\setuplabeltext [\s!sv] [\v!hereafter=se nedan]
-\setuplabeltext [\s!sv] [\v!see=se ]
-
-\setuplabeltext [\s!nb] [\v!page=side ]
-\setuplabeltext [\s!nb] [\v!atpage=p\aring\ side ]
-\setuplabeltext [\s!nb] [\v!hencefore=som vist over]
-\setuplabeltext [\s!nb] [\v!hereafter=som vist under]
-\setuplabeltext [\s!nb] [\v!see=se ]
-
-\setuplabeltext [\s!nn] [\v!page=side ]
-\setuplabeltext [\s!nn] [\v!atpage=p\aring\ side ]
-\setuplabeltext [\s!nn] [\v!hencefore=som vist over]
-\setuplabeltext [\s!nn] [\v!hereafter=som vist under]
-\setuplabeltext [\s!nn] [\v!see=sj\aring\ ]
-
-%D ... and to be completed!
-
-%D Next we implement couple of ordinal mumber converters:
-
-\def\enordinaldaynumber#1%
- {#1\ifnum\lasttwodigits{#1}=11
- \highordinalstr{th}%
- \else\ifnum\lasttwodigits{#1}=12
- \highordinalstr{th}%
- \else\ifnum\lasttwodigits{#1}=13
- \highordinalstr{th}%
- \else\ifcase\lastdigit{#1}%
- \highordinalstr{th}%
- \or % 1
- \highordinalstr{st}%
- \or % 2
- \highordinalstr{nd}%
- \or % 3
- \highordinalstr{rd}%
- \else
- \highordinalstr{th}%
- \fi\fi\fi\fi}
-
-% \def\enordinaldaynumber#1%
-% {#1\ordinalstr{\ifnum\lasttwodigits{#1}=11 th\else\ifcase\lastdigit{#1}
-% th\or st\or nd\or rd\else th\fi\fi}}
-
-\def\nlordinaldaynumber#1%
- {#1\highordinalstr{e}}
-
-%D \ShowAllLanguageValues [\s!en] [english] {English} {horn} % engelse humor
-%D \ShowAllLanguageValues [\s!nl] [dutch] {Dutch} {treat} % nederlandse zuinigheid
-%D \ShowAllLanguageValues [\s!de] [german] {German} {beer} % duitse degelijkheid
-%D \ShowAllLanguageValues [\s!da] [danish] {Danish} {pastry}
-%D \ShowAllLanguageValues [\s!sv] [swedish] {Swedish} {design}
-%D \ShowAllLanguageValues [\s!af] [afrikaans] {Afrikaaner} {boer} % afrikaanse gasvryheid
-%D \ShowAllLanguageValues [\s!nb] [bokmal] {Norwegian} {wood}
-%D \ShowAllLanguageValues [\s!nn] [nynorsk] {Norwegian} {fish}
-
-%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]
-
-\setuplabeltext [\s!nb] [\v!january :\s!mnem=jan.]
-\setuplabeltext [\s!nb] [\v!february :\s!mnem=feb.]
-\setuplabeltext [\s!nb] [\v!march :\s!mnem=mars]
-\setuplabeltext [\s!nb] [\v!april :\s!mnem=april]
-\setuplabeltext [\s!nb] [\v!may :\s!mnem=mai]
-\setuplabeltext [\s!nb] [\v!june :\s!mnem=juni]
-\setuplabeltext [\s!nb] [\v!july :\s!mnem=juli]
-\setuplabeltext [\s!nb] [\v!august :\s!mnem=aug.]
-\setuplabeltext [\s!nb] [\v!september:\s!mnem=sep.]
-\setuplabeltext [\s!nb] [\v!october :\s!mnem=okt.]
-\setuplabeltext [\s!nb] [\v!november :\s!mnem=nov.]
-\setuplabeltext [\s!nb] [\v!december :\s!mnem=des.]
-
-\setuplabeltext [\s!nn] [\v!january :\s!mnem=jan.]
-\setuplabeltext [\s!nn] [\v!february :\s!mnem=feb.]
-\setuplabeltext [\s!nn] [\v!march :\s!mnem=mars]
-\setuplabeltext [\s!nn] [\v!april :\s!mnem=april]
-\setuplabeltext [\s!nn] [\v!may :\s!mnem=mai]
-\setuplabeltext [\s!nn] [\v!june :\s!mnem=juni]
-\setuplabeltext [\s!nn] [\v!july :\s!mnem=juli]
-\setuplabeltext [\s!nn] [\v!august :\s!mnem=aug.]
-\setuplabeltext [\s!nn] [\v!september:\s!mnem=sep.]
-\setuplabeltext [\s!nn] [\v!october :\s!mnem=okt.]
-\setuplabeltext [\s!nn] [\v!november :\s!mnem=nov.]
-\setuplabeltext [\s!nn] [\v!december :\s!mnem=des.]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/lang-grk.mkii b/Master/texmf-dist/tex/context/base/mkii/lang-grk.mkii
deleted file mode 100644
index 9fd59382a0c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/lang-grk.mkii
+++ /dev/null
@@ -1,99 +0,0 @@
-%D \module
-%D [ file=lang-grk,
-%D version=2003.04.01,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Uralic Languages,
-%D author=Apostolos Syropoulos
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Language Macros / Greek}
-
-%D The framework of this module is set up by Hans Hagen while
-%D all the translations have been done by Apostolos Syropoulos
-
-\unprotect
-
-\installlanguage
- [\s!gr]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\greekleftquot,
- \c!rightquote=\greekrightquot,
- \c!leftquotation=\greekleftquot,
- \c!rightquotation=\greekrightquot,
- \c!date={\v!day\ \v!month\ \v!year}]
-
-\installlanguage [greek] [\s!gr]
-
-\setupheadtext [\s!gr] [\v!content=\greekPi\greekepsilon\greekrho\greekiota\greekepsilon\greekchi\greekomicrontonos\greekmu\greekepsilon\greeknu\greekalpha]
-\setupheadtext [\s!gr] [\v!tables=\greekPi\greekiotatonos\greeknu\greekalpha\greekkappa\greekepsilon\greekfinalsigma]
-\setupheadtext [\s!gr] [\v!figures=\greekSigma\greekchi\greeketatonos\greekmu\greekalpha\greektau\greekalpha]
-\setupheadtext [\s!gr] [\v!graphics=\greekGamma\greekrho\greekalpha\greekphi\greekiota\greekkappa\greekalphatonos]
-\setupheadtext [\s!gr] [\v!intermezzi=\greekPi\greekalpha\greekupsilontonos\greeksigma\greekepsilon\greekiota\greekfinalsigma]
-\setupheadtext [\s!gr] [\v!index=\greekEpsilon\greekupsilon\greekrho\greekepsilon\greektau\greeketatonos\greekrho\greekiota\greekomicron]
-\setupheadtext [\s!gr] [\v!abbreviations=\greekSigma\greekupsilon\greeknu\greektau\greekomicron\greekmu\greekomicron\greekgamma\greekrho\greekalpha\greekphi\greekiotatonos\greekepsilon\greekfinalsigma]
-\setupheadtext [\s!gr] [\v!logos=\greekLambda\greekomicron\greekgamma\greekomicrontonos\greektau\greekupsilon\greekpi\greekalpha]
-\setupheadtext [\s!gr] [\v!units=\greekMu\greekomicron\greeknu\greekalphatonos\greekdelta\greekepsilon\greekfinalsigma]
-
-\setuplabeltext [\s!gr] [\v!table=\greekPi\greekiotatonos\greeknu\greekalpha\greekkappa\greekalpha\greekfinalsigma]
-\setuplabeltext [\s!gr] [\v!figure=\greekSigma\greekchi\greeketatonos\greekmu\greekalpha]
-\setuplabeltext [\s!gr] [\v!intermezzo=\greekPi\greekalpha\greekupsilontonos\greeksigma\greeketa]
-\setuplabeltext [\s!gr] [\v!graphic=\greekGamma\greekrho\greekalpha\greekphi\greekiota\greekkappa\greekomicrontonos]
-
-\setuplabeltext [\s!gr] [\v!chapter=\greekKappa\greekepsilon\greekphi\greekalphatonos\greeklambda\greekalpha\greekiota\greekomicron]
-\setuplabeltext [\s!gr] [\v!section=\greekEpsilon\greeknu\greekomicrontonos\greektau\greeketa\greektau\greekalpha]
-\setuplabeltext [\s!gr] [\v!subsection=\greekUpsilon\greekpi\greekomicrontonos\greekepsilon\greeknu\greekomicrontonos\greektau\greeketa\greektau\greekalpha]
-\setuplabeltext [\s!gr] [\v!subsubsection=]
-\setuplabeltext [\s!gr] [\v!subsubsubsection=]
-
-\setuplabeltext [\s!gr] [\v!appendix=\greekPi\greekalpha\greekrho\greekalphatonos\greekrho\greektau\greeketa\greekmu\greekalpha]
-\setuplabeltext [\s!gr] [\v!part=\greekMu\greekepsilontonos\greekrho\greekomicron\greekfinalsigma]
-\setuplabeltext [\s!gr] [\v!line=\greekGamma\greekrho\greekalpha\greekmu\greekmu\greeketatonos]
-\setuplabeltext [\s!gr] [\v!lines=\greekGamma\greekrho\greekalpha\greekmu\greekmu\greekepsilontonos\greekfinalsigma]
-
-\setuplabeltext [\s!gr] [\v!january=\greekIota\greekalpha\greeknu\greekomicron\greekupsilon\greekalphatonos\greekrho\greekiota\greekomicron\greekfinalsigma]
-\setuplabeltext [\s!gr] [\v!february=\greekPhi\greekepsilon\greekbeta\greekrho\greekomicron\greekupsilon\greekalphatonos\greekrho\greekiota\greekomicron\greekfinalsigma]
-\setuplabeltext [\s!gr] [\v!march=\greekMu\greekalphatonos\greekrho\greektau\greekiota\greekomicron\greekfinalsigma]
-\setuplabeltext [\s!gr] [\v!april=\greekAlpha\greekpi\greekrho\greekiotatonos\greeklambda\greekiota\greekomicron\greekfinalsigma]
-\setuplabeltext [\s!gr] [\v!may=\greekMu\greekalphatonos\greekiota\greekomicron\greekfinalsigma]
-\setuplabeltext [\s!gr] [\v!june=\greekIota\greekomicron\greekupsilontonos\greeknu\greekiota\greekomicron\greekfinalsigma]
-\setuplabeltext [\s!gr] [\v!july=\greekIota\greekomicron\greekupsilontonos\greeklambda\greekiota\greekomicron\greekfinalsigma]
-\setuplabeltext [\s!gr] [\v!august=\greekAlpha\greekupsilontonos\greekgamma\greekomicron\greekupsilon\greeksigma\greektau\greekomicron\greekfinalsigma]
-\setuplabeltext [\s!gr] [\v!september=\greekSigma\greekepsilon\greekpi\greektau\greekepsilontonos\greekmu\greekbeta\greekrho\greekiota\greekomicron\greekfinalsigma]
-\setuplabeltext [\s!gr] [\v!october=\greekOmicron\greekkappa\greektau\greekomegatonos\greekbeta\greekrho\greekiota\greekomicron\greekfinalsigma]
-\setuplabeltext [\s!gr] [\v!november=\greekNu\greekomicron\greekepsilontonos\greekmu\greekbeta\greekrho\greekiota\greekomicron\greekfinalsigma]
-\setuplabeltext [\s!gr] [\v!december=\greekDelta\greekepsilon\greekkappa\greekepsilontonos\greekmu\greekbeta\greekrho\greekiota\greekomicron\greekfinalsigma]
-
-\setuplabeltext [\s!gr] [\v!sunday=\greekKappa\greekupsilon\greekrho\greekiota\greekalpha\greekkappa\greeketatonos]
-\setuplabeltext [\s!gr] [\v!monday=\greekDelta\greekepsilon\greekupsilon\greektau\greekepsilontonos\greekrho\greekalpha]
-\setuplabeltext [\s!gr] [\v!tuesday=\greekTau\greekrho\greekiotatonos\greektau\greeketa]
-\setuplabeltext [\s!gr] [\v!wednesday=\greekTau\greekepsilon\greektau\greekalphatonos\greekrho\greektau\greeketa]
-\setuplabeltext [\s!gr] [\v!thursday=\greekPi\greekepsilontonos\greekmu\greekpi\greektau\greeketa]
-\setuplabeltext [\s!gr] [\v!friday=\greekPi\greekalpha\greekrho\greekalpha\greeksigma\greekkappa\greekepsilon\greekupsilon\greeketatonos]
-\setuplabeltext [\s!gr] [\v!saturday=\greekSigma\greekalphatonos\greekbeta\greekbeta\greekalpha\greektau\greekomicron]
-
-%D % \ShowAllLanguageValues [\s!gr] [\greekEpsilon\greeklambda\greeklambda\greeketa\greeknu\greekiota\greekkappa\greekalphatonos] {Greek} {love}
-
-\installlanguage
- [\s!agr]
- [\s!default=\s!gr,
- \c!leftquote=\upperleftsinglesixquote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\upperleftdoublesixquote,
- \c!rightquotation=\upperrightdoubleninequote,
- \s!patterns=\s!agr,
- \s!mapping=\s!agr, % not needed for mkiv
- \s!encoding=\s!agr] % not needed for mkiv
-
-\installlanguage [ancientgreek] [\s!agr]
-\installlanguage [grk] [\s!agr]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/lang-ind.mkii b/Master/texmf-dist/tex/context/base/mkii/lang-ind.mkii
deleted file mode 100644
index bb33dacfd24..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/lang-ind.mkii
+++ /dev/null
@@ -1,26 +0,0 @@
-%D \module
-%D [ file=lang--ind,
-%D version=1997.09.03,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Indo Iranian Languages,
-%D author=Hans Hagen / Tobias Burnus,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Language Macros / Indo-Iranian Languages}
-
-%D The framework of this module is set up by Hans Hagen while
-%D many of the first translations were done by Tobias. Later
-%D on, corrections were made by users. If you have suggestions,
-%D or feel that your name missing here, don't hesitate to send
-%D us an email.
-
-% 34 languages
-
-\unprotect
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/lang-ini.mkii b/Master/texmf-dist/tex/context/base/mkii/lang-ini.mkii
deleted file mode 100644
index 4561f4dd1f3..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/lang-ini.mkii
+++ /dev/null
@@ -1,696 +0,0 @@
-%D \module
-%D [ file=lang-ini,
-%D version=1996.01.25,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 module needs a further cleanup (real split between ii/iv).
-
-%D This module implements the (for the moment still simple)
-%D multi||language support of \CONTEXT, which should not be
-%D confused with the multi||lingual interface. This support
-%D will be extended when needed.
-
-\writestatus{loading}{ConTeXt Language Macros / Initialization}
-
-\unprotect
-
-\ifx\nonfrenchspacing\undefined \let\nonfrenchspacing\relax \fi
-\ifx\frenchspacing \undefined \let\frenchspacing \relax \fi
-
-%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
-%D predefined \COUNTER\ \type{\language}.
-
-%D We keep track of the last loaded patterns by means of a
-%D pseudo \COUNTER. This just one of those situations in which
-%D we don't want to spent a real one. Language zero has no
-%D patterns, first of all because I like to start numbering
-%D at one. It may come in handy for special purposes as well.
-
-\normallanguage\zerocount \def\loadedlanguage{1}
-
-%D \macros
-%D {currentlanguage, setupcurrentlanguage}
-%D
-%D Instead of numbers,we are going to use symbolic names for
-%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]{\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.
-
-%D \macros
-%D {installlanguage}
-%D
-%D Hyphenation patterns can only be loaded when the format file
-%D is prepared. The next macro takes care of this loading. A
-%D language is specified with
-%D
-%D \showsetup{installlanguage}
-%D
-%D When \type {state} equals \type {start}, both patterns
-%D and additional hyphenation specifications are loaded. These
-%D files are seached for on the system path and are to be
-%D named:
-%D
-%D \starttyping
-%D \f!languageprefix-identifier.\f!patternsextension
-%D \f!languageprefix-identifier.\f!hyhensextension
-%D \stoptyping
-%D
-%D The \type{spacing} variable specifies how the spaces after
-%D punctuation has to be handled. English is by tradition more
-%D tolerant to inter||sentence spacing than other languages.
-%D
-%D This macro also defines \type {\identifier} as a shortcut
-%D switch to the language. Furthermore the command defined as
-%D being language specific, are executed. With
-%D \type {default} we can default to another language
-%D (patterns) at format generation time. This default language
-%D is overruled when the appropriate patterns are loaded (some
-%D implementations support run time addition of patterns to a
-%D preloaded format).
-
-\def\dodoinstalllanguage#1#2% #2 added
- {\doifundefined{#1}{\setvalue{#1}{\complexlanguage[#2]}}%
- \expanded{\noexpand\uppercase{\noexpand\edef\noexpand\ascii{#1}}}%
- \doifundefined\ascii{\setvalue\ascii{\complexlanguage[#2]}}}
-
-%D \macros
-%D {preloadlanguages}
-%D
-%D We first try to load the files defined as file synonym
-%D for \type {lang-*.pat} and \type {lang-*.hyp}. After that we
-%D fall back on those files. The macro \type {\preloadpatterns}
-%D reports which patterns are loaded and what hyphenmin
-%D values are set.
-
-\let\installedlanguages\empty
-
-\def\doiflanguageelse#1{\doifdefinedelse{\??la#1\c!state}}
-
-\def\doloadlanguagefiles#1%
- {\doifelsevalue{\??la#1\c!state}\v!start
- {\edef\languagesuffix{\specificlanguageparameter{#1}\s!patterns}%
- \ifx\languagesuffix\empty
- \edef\languagesuffix{\defaultlanguage{#1}}%
- \else\ifx\languagesuffix\relax
- \edef\languagesuffix{\defaultlanguage{#1}}%
- \fi\fi
- \ifx\languagesuffix\empty
- \edef\languagesuffix{#1}%
- \fi
- \doifundefinedelse{\??la\??la:\currentencoding:\currentmapping:\languagesuffix}
- {\doloadpatterns{#1}\languagesuffix}
- {\bgroup
- \edef\loadedlanguage{\getvalue{\??la\??la:\currentencoding:\currentmapping:\languagesuffix}}%
- %\showmessage\m!linguals1{\languagesuffix,#1,\loadedlanguage,*,*}%
- %\showmessage\m!linguals3{\languagesuffix,#1,\loadedlanguage,*,*}%
- \egroup}}
- {\showmessage\m!linguals5{#1}}}
-
-\def\doinstalllanguage[#1][#2]%
- {\doifassignmentelse{#2}
- {\doiflanguageelse{#1}
- {\getparameters[\??la#1][#2]}
- {\setvalue{\l!prefix!#1}{#1}%
- \addtocommalist{#1}\installedlanguages
- \dodoinstalllanguage{#1}{#1}%
- \getparameters[\??la#1][\c!state=\v!start,#2]}%
- \doloadlanguagefiles{#1}}
- {\setvalue{\l!prefix!#1}{#2}%
- \getparameters[\??la#1][\s!default=#2]%
- \dodoinstalllanguage{#1}{#2}}}
-
-\def\reallanguagetag#1%
- {\ifcsname\l!prefix!#1\endcsname\csname\l!prefix!#1\endcsname\else#1\fi}
-
-\let\preloadedpatterns\empty
-\let\preloadedpmessage\empty
-
-\def\doshowpatterns#1#2#3#4% language number encoding mapping
- {#1->#3:#4->#2->\specificlanguageparameter{#1}\s!lefthyphenmin:\specificlanguageparameter{#1}\s!righthyphenmin\space}
-
-\def\preloadlanguages
- {\doifsomething\preloadedpmessage{\showmessage\m!linguals{10}\preloadedpmessage}}
-
-\def\preloadallpatterns
- {\gdef\preloadallpatterns##1{\installlanguage[##1][\c!state=\v!start]}%
- \processcommacommand[\installedlanguages]\preloadallpatterns
- \global\let\preloadallpatterns\relax}
-
-% ^^ \language[#1] gave unwanted side effect of loading language specifics
-
-\def\installlanguage
- {\dodoubleargument\doinstalllanguage}
-
-%D When the second argument is a language identifier, a
-%D synonym is created. This feature is present because we
-%D used dutch mnemonics in the dutch version, but nowadays
-%D conform a standard.
-
-\let \patternencoding \s!default
-\let \patternmapping \s!default
-
-\def\doifpatternselse#1%
- {\expanded{\doifinsetelse{#1}{\preloadedpatterns}}}
-
-\def\doloadpatterns#1#2%
- {\edef\askedlanguageencoding{\specificlanguageparameter{#1}\s!encoding}%
- \edef\askedlanguagemapping {\specificlanguageparameter{#1}\s!mapping}%
- \expanded{\getcommacommandsize[\askedlanguageencoding]}%
- % slightly faster: \let\unicodechar\utfunihashglyph
- \ifnum\commalistsize>0
- %\message{[nofpatterns #2: \commalistsize/\askedlanguageencoding]}%
- \dorecurse\commalistsize
- {\expanded{\getfromcommacommand[\askedlanguageencoding][\recurselevel]}%
- \let\patternencoding\commalistelement
- \expanded{\getfromcommacommand[\askedlanguagemapping][\recurselevel]}%
- \let\patternmapping \commalistelement
- %\message{[patterns: #1/#2/\patternencoding/\patternmapping]}%
- \dodoloadpatterns{#1}{#2}\patternencoding\patternmapping}%
- \else
- %\message{[patterns: #1/#2]}%
- \dodoloadpatterns{#1}{#2}{}{}%
- \fi}
-
-\ifnum\texengine=\xetexengine
-
- \def\doloadpatterns#1#2%
- {%\letvalue{\??la#2\s!encoding}\empty
- %\letvalue{\??la#2\s!mapping }\empty
- \dodoloadpatterns{#1}{#2}{}{}}
-
-\fi
-
-\def\setuphyppatencoding
- {\pathypsettings
- \enableregime[utf]}
-
-\def\dodoloadpatterns#1#2#3#4% beware, loaded language also incr
- {\normallanguage\loadedlanguage % when not really needed
- \bgroup
- \let\synchronizepatterns\relax % needed?
- \let\enabledmapping \empty % needed?
- \doifelsenothing{#3}{\enableencoding[\s!default]}{\enableencoding[#3]}%
- \doifelsenothing{#4}{\enablemapping [\s!default]}{\enablemapping [#4]}%
- \setuphyppatencoding
- \ifundefined{\??la\??la:\currentencoding:\currentmapping:#2}%
- \let\doshowpatterns\relax
- \edef\alreadyloadedlanguage
- {\executeifdefined{\??la\??la:\currentencoding:\currentmapping:\truefilename{\f!languageprefix#2.\f!patternsextension}}\empty}%
- \edef\alreadyloadedlanguage
- {\executeifdefined{\??la\??la:\currentencoding:\currentmapping:\f!languageprefix#2.\f!patternsextension}\alreadyloadedlanguage}%
- \ifx\alreadyloadedlanguage\empty
- \letgvalue{\??la\??la:\currentencoding:\currentmapping:#2}\loadedlanguage
- \doifundefined{\??la\??la:\s!default:\s!default:#2}{\letgvalue{\??la\??la:\s!default:\s!default:#2}\loadedlanguage}% fall back
- \startpatternloading{\truefilename{\f!languageprefix#2.\f!patternsextension}}{#3}{#4}%
- \readsysfile{\truefilename{\f!languageprefix#2.\f!patternsextension}}
- {\setxvalue{\??la#1\s!patterns}{#2}%
- \setxvalue{\??la\??la:\currentencoding:\currentmapping:\truefilename{\f!languageprefix#2.\f!patternsextension}}{\number\loadedlanguage}%
- \xdef\preloadedpmessage{\preloadedpmessage\doshowpatterns{#2}{\number\normallanguage}{\currentencoding}{\currentmapping}}%
- \doglobal\addtocommalist{#2}\preloadedpatterns
- \showmessage\m!linguals1{#2,#1,\loadedlanguage,\currentencoding,\currentmapping}}
- {\showmessage\m!linguals2{#2,#1,\loadedlanguage,\currentencoding,\currentmapping,\f!languageprefix#2.\f!patternsextension,\truefilename{\f!languageprefix#2.\f!patternsextension}}}%
- \stoppatternloading
- \startpatternloading{\truefilename{\f!languageprefix#2.\f!hyphensextension}}{#3}{#4}%
- \readsysfile{\truefilename{\f!languageprefix#2.\f!hyphensextension}}
- {\showmessage\m!linguals3{#2,#1,\loadedlanguage,\currentencoding,\currentmapping}}
- {\showmessage\m!linguals4{#2,#1,\loadedlanguage,\currentencoding,\currentmapping}}%
- \stoppatternloading
- \doglobal\increment\loadedlanguage
- % \stopencoding
- \else % optimization, introduced 2004.08.24, while sorting out changes in tl
- \letgvalue{\??la\??la:\currentencoding:\currentmapping:#2}\alreadyloadedlanguage
- \doifundefined{\??la\??la:\s!default:\s!default:#2}{\letgvalue{\??la\??la:\s!default:\s!default:#2}\loadedlanguage}% fall back
- \setxvalue{\??la#1\s!patterns}{#2}%
- \xdef\preloadedpmessage{\preloadedpmessage\doshowpatterns{#2}{[\number\alreadyloadedlanguage]}{\currentencoding}{\currentmapping}}%
- \doglobal\addtocommalist{#2}\preloadedpatterns
- \showmessage\m!linguals1{#2,#1,[\alreadyloadedlanguage],\currentencoding,\currentmapping}%
- \fi
- \fi
- \egroup}
-
-\fetchruntimecommand \showpatterns {\f!languageprefix\s!run}
-
-%D Since we can only load patterns in ini\TeX, we nil the
-%D loading before dumping (which saves a bit of memory, but
-%D strangely enough not in the format).
-
-\appendtoks
- \gdef\doloadpatterns{\doglobal\increment\loadedlanguage\gobbletwoarguments}%
- \globallet\dodoloadpatterns\gobblefourarguments
-\to \everydump
-
-%D \macros
-%D {setuplanguage}
-%D
-%D Quick and dirty, but useful:
-%D
-%D \showsetup{setuplanguage}
-%D
-%D Beware, this command can only be used when a language is installed.
-
-\unprotected \def\setuplanguage
- {\dodoubleempty\dosetuplanguage}
-
-\def\dosetuplanguage[#1][#2]% handy patch for testing
- {\ifsecondargument
- \getparameters[\??la#1][#2]%
- \doif{#1}\currentlanguage\docomplexlanguage
- \else
- \getparameters[\??la\currentlanguage][#1]%
- \docomplexlanguage
- \fi}
-
-\setuplanguage
- [\s!default]
- [\s!lefthyphenmin=2,
- \s!righthyphenmin=2,
- \s!patterns=,
- \c!spacing=\v!packed,
- \s!encoding=,
- \s!mapping=,
- \c!lefthyphen=,
- \c!righthyphen=-,
- \c!hyphen=-,
- \c!midsentence=---,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\upperleftsinglesixquote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\upperleftdoublesixquote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!leftspeech=\languageparameter\c!leftquotation,
- \c!middlespeech=,
- \c!rightspeech=\languageparameter\c!rightquotation,
- \c!limittext=\unknown,
- \c!date={\v!year,\ ,\v!month,\ ,\v!day},
- \c!text=Ag]
-
-% rather new, split and per language
-
-\setuplanguage
- [\s!default]
- [\c!compoundhyphen=\compoundhyphen,
- \c!leftcompoundhyphen=\compoundhyphen,
- \c!rightcompoundhyphen=]
-
-%D The values \type {leftsentence} and \type
-%D {rightsentence} can be (and are) used to implement
-%D automatic subsentence boundary glyphs, like in {\fr
-%D |<|french guillemots|>|} or {\de |<|german guillemots|>|} or
-%D {\nl |<|dutch dashes|>|} like situations. Furthermore \type
-%D {leftquotation} and \type {leftquote} come into view
-%D \quotation {when we quote} or \quote {quote} something.
-
-%D \macros
-%D {currentdatespecification}
-%D
-%D Just to make things easy we can ask for the current date
-%D specification by saying:
-
-\def\currentdatespecification{\languageparameter\c!date}
-
-%D This command is not meant for users.
-
-%D Carefull reading of these macros shows that it's legal to
-%D say
-%D
-%D \starttyping
-%D \installlanguage [du] [de]
-%D \stoptyping
-
-%D \macros
-%D {language,mainlanguage}
-%D
-%D Switching to another language (actually another hyphenation
-%D pattern) is done with:
-%D
-%D \starttyping
-%D \language[identifier]
-%D \stoptyping
-%D
-%D or with \type{\identifier}. Just to be compatible with
-%D \PLAIN\ \TEX, we still support the original meaning, so
-%D
-%D \starttyping
-%D \language=1
-%D \stoptyping
-%D
-%D is a valid operation, where the relation between number
-%D and language depends on the order in installing languages.
-%D
-%D \showsetup{language}
-%D \showsetup{mainlanguage}
-%D
-%D Both commands take a predefined language identifier as
-%D argument. We can use \type{\mainlanguage[identifier]} for
-%D setting the (indeed) main language. This is the language
-%D used for translating labels like {\em figure} and {\em
-%D table}. The main language defaults to the current language.
-%D
-%D We take care of local as well as standardized language
-%D switching (fr and fa, de and du, but nl and nl).
-
-\ifx\synchronizepatterns \undefined \let\synchronizepatterns\relax \fi
-\ifx\synchronizepatternswithfont\undefined \def\synchronizepatternswithfont{\synchronizepatterns} \fi
-
-\def\setnormallanguage#1#2% current default
- {% called quite often, so we use \csname
- % \def\synchronizepatterns{\setnormallanguage
- % {\csname\??la\currentlanguage\s!patterns\endcsname}}% called often
- % of even better pre-expand in an ugly way:
- \ifnum\normallanguage<\zerocount
- % we've blocked hyphenation (e.g. verbatim)
- \else
- \edef\synchronizepatterns{\noexpand\dosetnormallanguage{\languageparameter\s!patterns}}%
- \donefalse
- \synchronizepatterns
- \ifdone\else
- \def\synchronizepatterns{\dosetnormallanguage\currentlanguage}%
- \synchronizepatterns
- \ifdone\else
- \ifx\currentdefaultlanguage\empty\else
- \edef\synchronizepatterns{\noexpand\dosetnormallanguage{\specificlanguageparameter\currentdefaultlanguage\s!patterns}}%
- \synchronizepatterns
- \ifdone\else
- \dosetnormallanguage\currentdefaultlanguage
- \synchronizepatterns
- \fi
- \fi
- \fi
- \fi
- \fi}
-
-\normallanguage\zerocount
-
-\def\dosetnormallanguage#1% #1 == \cs (no longer)
- {\ifnum\normallanguage<\zerocount
- % we've blocked hyphenation (e.g. verbatim)
- \else
- \dodosetnormallanguage{:\currentencoding:\currentmapping:}{#1}{%
- \dodosetnormallanguage{:\currentencoding:\s!default :}{#1}{%
- \dodosetnormallanguage{:\s!default :\currentmapping:}{#1}{%
- \dodosetnormallanguage{:\s!default :\s!default :}{#1}\empty}}}%
- \fi}
-
-\def\dodosetnormallanguage#1#2%
- {\ifcsname\??la\??la#1#2\endcsname
- \edef\thenormallanguage{\csname\??la\??la#1#2\endcsname}% can be \chardef
- \ifx\thenormallanguage\empty
- \@EAEAEA\firstofoneargument
- \else
- \donetrue
- \@EA\xdef\csname\??la\currentlanguage\s!patterns\endcsname{#2}%
- \normallanguage\thenormallanguage\relax % \relax is needed for lookahead problems
- \@EAEAEA\gobbleoneargument
- \fi
- \else
- \@EA\firstofoneargument
- \fi}
-
-\newevery \everylanguage \relax
-
-\def\disablelanguagespecifics
- {\ignorecompoundcharacter}
-
-\def\sethyphenationvariables
- {\lefthyphenmin 0\languageparameter\s!lefthyphenmin \relax
- \righthyphenmin0\languageparameter\s!righthyphenmin\relax
- \lefthyphenmin \numexpr\lefthyphenmin +\hyphenminoffset\relax
- \righthyphenmin\numexpr\righthyphenmin+\hyphenminoffset\relax}
-
-\def\docomplexlanguage% assumes that \currentlanguage is set
- {\edef\currentdefaultlanguage{\defaultlanguage\currentlanguage}%
- \setnormallanguage\currentlanguage\currentdefaultlanguage
- \the\everylanguage
- \enablelanguagespecifics[\currentlanguage]%
- \sethyphenationvariables
- \relax
- % will be definable and move to core-spa !
- \doifelse{\languageparameter\c!spacing}\v!broad\nonfrenchspacing\frenchspacing}
-
-\ifx\enablelanguagespecifics\undefined \def\enablelanguagespecifics[#1]{} \fi
-
-% The following may be a solution for the fact that one cannot
-% change catcodes of characters like : and ; inside an environment.
-
-\appendtoks
- \enablelanguagespecifics[\currentlanguage]%
-\to \everystarttext
-
-\def\complexlanguage[#1]%
- {\edef\askedlanguage{#1}%
- \ifx\askedlanguage\empty \else
- \ifcsname\l!prefix!\askedlanguage\endcsname
- \edef\askedlanguage{\csname\l!prefix!\askedlanguage\endcsname}%
- \ifx\currentlanguage\askedlanguage \else
- \setcurrentlanguage\currentmainlanguage\askedlanguage
- \docomplexlanguage
- \fi
- \else
- \showmessage\m!linguals6{#1}%
- \fi
- \fi}
-
-\let\simplelanguage\normallanguage
-
-\definecomplexorsimple\language
-
-\def\mainlanguage[#1]%
- {\edef\askedlanguage{#1}%
- \ifx\askedlanguage\empty \else
- \ifcsname\l!prefix!\askedlanguage\endcsname
- \edef\askedlanguage{\csname\l!prefix!\askedlanguage\endcsname}%
- \ifx\currentlanguage\askedlanguage
- \ifx\currentmainlanguage\askedlanguage
- \else
- \setcurrentlanguage\askedlanguage\askedlanguage
- \docomplexlanguage
- \fi
- \else
- \setcurrentlanguage\askedlanguage\askedlanguage
- \docomplexlanguage
- \fi
- \fi
- \fi}
-
-%D \macros
-%D {defaultlanguage,languageparameter,specificlanguageparameter}
-
-\def\defaultlanguage#1%
- {\ifcsname\??la#1\s!default\endcsname
- \expandafter\defaultlanguage\csname\??la#1\s!default\endcsname
- \else
- #1%
- \fi}
-
-\def\languageparameter#1%
- {\ifcsname\??la\currentlanguage#1\endcsname
- \csname\??la\currentlanguage#1\endcsname
- \else\ifcsname\??la\currentlanguage\s!default\endcsname
- \expandafter\specificlanguageparameter\csname\??la\currentlanguage\s!default\endcsname{#1}%
- \else\ifcsname\??la\s!default#1\endcsname
- \csname\??la\s!default#1\endcsname
- \fi\fi\fi}
-
-\def\specificlanguageparameter#1#2%
- {\ifcsname\??la#1#2\endcsname
- \csname\??la#1#2\endcsname
- \else\ifcsname\??la#1\s!default\endcsname
- \expandafter\specificlanguageparameter\csname\??la#1\s!default\endcsname{#2}%
- \else\ifcsname\??la\s!default#2\endcsname
- \csname\??la\s!default#2\endcsname
- \fi\fi\fi}
-
-%D New (see nomarking and nolist):
-
-\def\splitsequence#1#2%
- {\doifelse{#1}\v!no{#2}{\doifelse{#1}\v!yes{\languageparameter\c!limittext}{#1}}}
-
-\def\splitsymbol#1%
- {\splitsequence{#1}{\languageparameter\c!limittext}}
-
-%D Just like with subsentence boundary symbols, quotes
-%D placement depends on the current language, therefore we show
-%D the defaults here.
-%D
-%D \def\ShowLanguageValues [#1] [#2] #3 #4
-%D {\blank
-%D \startlinecorrection
-%D \vbox\bgroup
-%D \language[#1]%
-%D \setbox0=\hbox to \hsize{\hss\bf#2 subsentence symbol and quotes\hss}
-%D \dp0=0pt
-%D \box0
-%D \vskip.5em
-%D \hrule
-%D \vskip.5em
-%D \let\normalbar=|
-%D \hbox to \hsize
-%D {\hfil\quotation{#3 #4}\hfil\quote{#2}\hfil
-%D \let|=\normalbar\strut|<||<|#3|>|#4|>|\hfil}
-%D \vskip.5em
-%D \hrule
-%D \egroup
-%D \stoplinecorrection
-%D \blank}
-%D
-%D \ShowLanguageValues [af] [afrikaans] afrikaanse ...
-%D \ShowLanguageValues [ca] [catalan] catalan ...
-%D \ShowLanguageValues [cs] [czech] tjechisch tex
-%D \ShowLanguageValues [cs] [slovak] slowaakse ...
-%D \ShowLanguageValues [da] [danish] deense ...
-%D \ShowLanguageValues [de] [german] duitse degelijkheid
-%D \ShowLanguageValues [en] [english] engelse humor
-%D \ShowLanguageValues [fi] [finnish] finse ...
-%D \ShowLanguageValues [fr] [french] franse slag
-%D \ShowLanguageValues [it] [italian] italiaanse ...
-%D \ShowLanguageValues [la] [latin] latijnse missen
-%D \ShowLanguageValues [nl] [dutch] nederlandse zuinigheid
-%D \ShowLanguageValues [nb] [bokmal] noorse zalm
-%D \ShowLanguageValues [nn] [nnynorsk] noorse zalm
-%D \ShowLanguageValues [pl] [polish] poolse vlag
-%D \ShowLanguageValues [pt] [portuguese] portugese ...
-%D \ShowLanguageValues [es] [spanish] spaans benauwd
-%D \ShowLanguageValues [sv] [swedish] zweedse ...
-%D \ShowLanguageValues [tr] [turkish] turks fruit
-
-%D We support a lot of languages. These are specified and
-%D loaded in separate files, according to their roots. Here
-%D we only take care of (postponed) setting of the current
-%D language.
-%D
-%D \unprotect
-%D \placetable{The germanic languages (\type{lang-ger})}
-%D \starttable[||||]
-%D \HL
-%D \NC \bf mnemonic \NC \bf language \NC \bf group \NC\SR
-%D \HL
-%D \NC \s!nl \NC dutch \NC germanic \NC\FR
-%D \NC \s!en \NC english \NC germanic \NC\MR
-%D \NC \s!de \NC german \NC germanic \NC\MR
-%D \NC \s!da \NC danish \NC germanic \NC\MR
-%D \NC \s!sv \NC swedish \NC germanic \NC\MR
-%D \NC \s!af \NC afrikaans \NC germanic \NC\MR
-%D \NC \s!nb \NC bokmal \NC germanic \NC\LR
-%D \NC \s!nn \NC nynorsk \NC germanic \NC\LR
-%D \HL
-%D \stoptable
-%D \protect
-%D
-%D \unprotect
-%D \placetable{The italic languages (\type{lang-ita})}
-%D \starttable[||||]
-%D \HL
-%D \NC \bf mnemonic \NC \bf language \NC \bf group \NC\SR
-%D \HL
-%D \NC \s!fr \NC french \NC italic \NC\FR
-%D \NC \s!ca \NC catalan \NC italic \NC\MR
-%D \NC \s!es \NC spanish \NC italic \NC\MR
-%D \NC \s!it \NC italian \NC italic \NC\MR
-%D \NC \s!la \NC latin \NC italic \NC\MR
-%D \NC \s!pt \NC portuguese \NC italic \NC\LR
-%D \HL
-%D \stoptable
-%D \protect
-%D
-%D \unprotect
-%D \placetable{The slavic languages (\type{lang-sla})}
-%D \starttable[||||]
-%D \HL
-%D \NC \bf mnemonic \NC \bf language \NC \bf group \NC\SR
-%D \HL
-%D \NC \s!pl \NC polish \NC slavic \NC\FR
-%D \NC \s!cs \NC czech \NC slavic \NC\MR
-%D \NC \s!sk \NC slavik \NC slavic \NC\LR
-%D \HL
-%D \stoptable
-%D \protect
-%D \unprotect
-%D
-%D \placetable{The altaic languages (\type{lang-alt})}
-%D \starttable[||||]
-%D \HL
-%D \NC \bf mnemonic \NC \bf language \NC \bf group \NC\SR
-%D \HL
-%D \NC \s!tr \NC turkish \NC altaic \NC\SR
-%D \HL
-%D \stoptable
-%D
-%D \placetable{The uralic languages (\type{lang-ura})}
-%D \starttable[||||]
-%D \HL
-%D \NC \bf mnemonic \NC \bf language \NC \bf group \NC\SR
-%D \HL
-%D \NC \s!fi \NC finnish \NC uralic \NC\SR
-%D \HL
-%D \stoptable
-%D \protect
-
-% \bgroup \normallanguage255 \patterns{} \egroup
-% \def\nopatterns{\normallanguage255 }
-
-\def\nopatterns{\normallanguage\minusone}
-
-%D \XETEX\ (and also \LUATEX) are \UNICODE:
-
-\ifnum\texengine>\pdftexengine
-
- \def\synchronizepatternswithfont{}
- \def\doloadpatterns #1#2{\dodoloadpatterns{#1}{#2}\s!default\s!default}
- \def\dosetnormallanguage #1{\dodosetnormallanguage{:\s!default:\s!default:}{#1}\empty}
- \def\setuphyppatencoding {\pathypsettings}
-
-\fi
-
-%D We default to the language belonging to the interface. This
-%D is one of the few places outside the interface modules where
-%D \type{\startinterface} is used.
-
-%D We default to english:
-
-\setupcurrentlanguage[\s!en]
-
-\def\initializemainlanguage
- {\mainlanguage[\currentlanguage]%
- \showmessage\m!linguals9\currentlanguage}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/lang-ita.mkii b/Master/texmf-dist/tex/context/base/mkii/lang-ita.mkii
deleted file mode 100644
index 04acf3265c2..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/lang-ita.mkii
+++ /dev/null
@@ -1,518 +0,0 @@
-%D \module
-%D [ file=lang-ita,
-%D version=1997.09.03,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Italic Languages,
-%D author=Hans Hagen / Tobias Burnus,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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: replace \'.. by \namedglyph
-
-\writestatus{loading}{ConTeXt Language Macros / Italic Languages}
-
-%D The framework of this module is set up by Hans Hagen while
-%D many of the first translations were done by Tobias. Later
-%D on, corrections were made by users. If you have suggestions,
-%D or feel that your name missing here, don't hesitate to send
-%D us an email.
-%D
-%D \starttabulate[|lB|l|]
-%D \NC Italian \NC Giuseppe Bilotta \NC \NR
-%D \NC Romanian \NC Dan Seracu \NC \NR
-%D \NC Portuguese \NC Pedro F. M. Mendon\c a \NC \NR
-%D \stoptabulate
-
-% Latin, Italian, Rhaeto-Romanic, Rumanian, Sardian
-% Catalan, French, Ladino, Portuguese, Proven\c{c}al, Spanish
-
-\unprotect
-
-\ifx\guillemotspace\undefined \let\guillemotspace\empty \fi
-\ifx\sentencespace \undefined \let\sentencespace \empty \fi
-
-\installlanguage
- [\s!fr]
- [\c!spacing=\v!packed,
- \c!leftsentence=\emdash,
- \c!rightsentence=\emdash,
- \c!leftsubsentence=\emdash,
- \c!rightsubsentence=\emdash,
- \c!leftquote=\leftguillemot,
- \c!rightquote=\rightguillemot,
- \c!leftquotation=\leftguillemot,
- \c!rightquotation=\rightguillemot,
- \c!date={\v!day+,\v!space,\v!month,\v!space,\v!year},
- \s!mapping={texnansi,ec},
- \s!encoding={texnansi,ec}]
-
-\installlanguage
- [\s!es]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\upperleftsinglesixquote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\upperleftdoublesixquote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!day,\ ,\v!month,\ ,\v!year}]
-
-\installlanguage [sp] [\s!es] % old times context
-
-\installlanguage
- [\s!ca]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\upperleftsinglesixquote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\upperleftdoublesixquote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!day,\ ,\v!month,\ ,\v!year}]
-
-% Note GB left|/|right (sub)sentences are for \quote {incisi}.
-
-\installlanguage
- [\s!it]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=--,
- \c!rightsubsentence=--,
- \c!leftquote=\upperleftsinglesixquote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\upperleftdoublesixquote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!leftspeech=\leftguillemot,
- \c!middlespeech=\leftguillemot,
- \c!rightspeech=\rightguillemot,
- \c!date={\v!day,\ ,\v!month,\ ,\v!year},
- \s!mapping={texnansi,ec},
- \s!encoding={texnansi,ec}]
-
-\installlanguage % the same as italian
- [\s!la]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\upperleftsinglesixquote,
- \c!rightquote=\lowerrightsingleninequote,
- \c!leftquotation=\upperleftdoublesixquote,
- \c!rightquotation=\lowerrightdoubleninequote,
- \c!date={\v!day,\ ,\v!month,\ ,\v!year}]
-
-\installlanguage
- [\s!pt]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\upperleftsinglesixquote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\upperleftdoublesixquote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!year,\ ,\v!month,\ ,\v!day},
- \s!mapping={texnansi,ec},
- \s!encoding={texnansi,ec}]
-
-\installlanguage
- [\s!ro]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\leftguillemot,
- \c!rightquote=\rightguillemot,
- \c!leftquotation=\lowerrightdoubleninequote,
- \c!rightquotation=\upperleftdoublesixquote,
- \c!date={\v!day,\ ,\v!month,\ ,\v!year}]
-
-%D For compatibility reasons we also define:
-
-\installlanguage [fa] [\s!fr] % for dutchies only
-
-\installlanguage [french] [\s!fr]
-\installlanguage [spanish] [\s!es]
-\installlanguage [catalan] [\s!ca]
-\installlanguage [italian] [\s!it]
-\installlanguage [latin] [\s!la]
-\installlanguage [portuguese] [\s!pt]
-\installlanguage [romanian] [\s!ro]
-
-%D Labels and header texts.
-
-\setupheadtext [\s!fr] [\v!content=Table des mati\`eres]
-\setupheadtext [\s!es] [\v!content=\'Indice]
-\setupheadtext [\s!ca] [\v!content=\'Index de continguts]
-\setupheadtext [\s!it] [\v!content=Indice]
-\setupheadtext [\s!la] [\v!content=Quod in libro continetur] %Argumentum
-\setupheadtext [\s!pt] [\v!content=Conte\'udo]
-\setupheadtext [\s!ro] [\v!content=Cuprins]
-
-\setupheadtext [\s!fr] [\v!tables=Tableaux]
-\setupheadtext [\s!es] [\v!tables=Tablas]
-\setupheadtext [\s!ca] [\v!tables=Taules]
-\setupheadtext [\s!it] [\v!tables=Tabelle]
-\setupheadtext [\s!la] [\v!tables=Tabulae]
-\setupheadtext [\s!pt] [\v!tables=Tabelas]
-\setupheadtext [\s!ro] [\v!tables=Tabele]
-
-\setupheadtext [\s!fr] [\v!figures=Figures]
-\setupheadtext [\s!es] [\v!figures=Ilustraciones]
-\setupheadtext [\s!ca] [\v!figures=Figures]
-\setupheadtext [\s!it] [\v!figures=Figure]
-\setupheadtext [\s!la] [\v!figures=Imagines]
-\setupheadtext [\s!pt] [\v!figures=Figuras]
-\setupheadtext [\s!ro] [\v!figures=Figuri]
-
-\setupheadtext [\s!fr] [\v!graphics=Graphiques]
-\setupheadtext [\s!es] [\v!graphics=Gr\'aficos]
-\setupheadtext [\s!it] [\v!graphics=Grafici]
-\setupheadtext [\s!ca] [\v!graphics=Gr\`afiques]
-\setupheadtext [\s!la] [\v!graphics=Typi]
-\setupheadtext [\s!pt] [\v!graphics=Gr\'aficos]
-\setupheadtext [\s!ro] [\v!graphics=Grafice]
-
-\setupheadtext [\s!fr] [\v!intermezzi=Interm\`edes]
-\setupheadtext [\s!es] [\v!intermezzi=Intermedios]
-\setupheadtext [\s!ca] [\v!intermezzi=Intermedis]
-\setupheadtext [\s!it] [\v!intermezzi=Intermezzi]
-\setupheadtext [\s!la] [\v!intermezzi=Intermissa]
-\setupheadtext [\s!pt] [\v!intermezzi=Interm\'edios]
-\setupheadtext [\s!ro] [\v!intermezzi=Intermzzo]
-
-\setupheadtext [\s!fr] [\v!index=Index]
-\setupheadtext [\s!es] [\v!index=\'Indice alfab\'etico]
-\setupheadtext [\s!ca] [\v!index=\'Index alfab\`etic]
-\setupheadtext [\s!it] [\v!index=Indice]
-\setupheadtext [\s!la] [\v!index=Indices]
-\setupheadtext [\s!pt] [\v!index=\'Indice]
-\setupheadtext [\s!ro] [\v!index=Index]
-
-\setupheadtext [\s!fr] [\v!abbreviations=Abr\'eviations]
-\setupheadtext [\s!es] [\v!abbreviations=Abreviaturas]
-\setupheadtext [\s!ca] [\v!abbreviations=Abreviacions]
-\setupheadtext [\s!it] [\v!abbreviations=Abbreviazioni]
-\setupheadtext [\s!la] [\v!abbreviations=Notae]
-\setupheadtext [\s!pt] [\v!abbreviations=Abreviaturas]
-\setupheadtext [\s!ro] [\v!abbreviations=Abrevieri]
-
-\setupheadtext [\s!fr] [\v!logos=Logos]
-\setupheadtext [\s!es] [\v!logos=Logotipos]
-\setupheadtext [\s!ca] [\v!logos=Logotips]
-\setupheadtext [\s!it] [\v!logos=Logotipi]
-\setupheadtext [\s!la] [\v!logos=Typi negotiales]
-\setupheadtext [\s!pt] [\v!logos=Logotipos]
-\setupheadtext [\s!ro] [\v!logos=Logo-uri]
-
-\setupheadtext [\s!fr] [\v!units=Unit\'es]
-\setupheadtext [\s!es] [\v!units=Unidades]
-\setupheadtext [\s!ca] [\v!units=Unitats]
-\setupheadtext [\s!it] [\v!units=Unit\`a]
-\setupheadtext [\s!la] [\v!units=Modi]
-\setupheadtext [\s!pt] [\v!units=Unidades]
-\setupheadtext [\s!ro] [\v!units=Unit\u{a}\c{t}i]
-
-\setupheadtext [\s!fr] [pubs=Bibliographie]
-\setupheadtext [\s!es] [pubs=Bibliograf\'\ia]
-\setupheadtext [\s!ca] [pubs=Referències]
-\setupheadtext [\s!it] [pubs=Bibliografia]
-%setupheadtext [\s!la] [pubs=?]
-%setupheadtext [\s!pt] [pubs=?]
-%setupheadtext [\s!ro] [pubs=?]
-
-\setuplabeltext [\s!fr] [\v!table=Tableau ]
-\setuplabeltext [\s!es] [\v!table=Tabla ]
-\setuplabeltext [\s!ca] [\v!table=Taula ]
-\setuplabeltext [\s!it] [\v!table=Tabella ]
-\setuplabeltext [\s!la] [\v!table=Tabula ]
-\setuplabeltext [\s!pt] [\v!table=Tabela ]
-\setuplabeltext [\s!ro] [\v!table=Tabelul ]
-
-\setuplabeltext [\s!fr] [\v!figure=Figure ]
-\setuplabeltext [\s!es] [\v!figure=Ilustraci\'on ]
-\setuplabeltext [\s!ca] [\v!figure=Figura ]
-\setuplabeltext [\s!it] [\v!figure=Fig. ]
-\setuplabeltext [\s!la] [\v!figure=Imago ]
-\setuplabeltext [\s!pt] [\v!figure=Figura ]
-\setuplabeltext [\s!ro] [\v!figure=Figura ]
-
-\setuplabeltext [\s!fr] [\v!intermezzo=Interm\`ede ]
-\setuplabeltext [\s!es] [\v!intermezzo=Intermedio ]
-\setuplabeltext [\s!ca] [\v!intermezzo=Intermedi ]
-\setuplabeltext [\s!it] [\v!intermezzo=Intermezzo ]
-\setuplabeltext [\s!la] [\v!intermezzo=Intermissum ]
-\setuplabeltext [\s!pt] [\v!intermezzo=Interm\'edio ]
-\setuplabeltext [\s!ro] [\v!intermezzo=Intermezzo ]
-
-\setuplabeltext [\s!fr] [\v!graphic=Illustration ]
-\setuplabeltext [\s!es] [\v!graphic=Gr\'afico ]
-\setuplabeltext [\s!ca] [\v!graphic=Gr\`afica ]
-\setuplabeltext [\s!it] [\v!graphic=Grafico ]
-\setuplabeltext [\s!la] [\v!graphic=Typus ]
-\setuplabeltext [\s!pt] [\v!graphic=Gr\'afico ]
-\setuplabeltext [\s!ro] [\v!graphic=Graficul ]
-
-\setuplabeltext [\s!fr] [\v!chapter=] % Chapitre
-\setuplabeltext [\s!es] [\v!chapter=] % Cap\'\i tulo
-\setuplabeltext [\s!ca] [\v!chapter=] % Cap\'\i tol
-\setuplabeltext [\s!it] [\v!chapter=]
-\setuplabeltext [\s!la] [\v!chapter=]
-\setuplabeltext [\s!pt] [\v!chapter=]
-\setuplabeltext [\s!ro] [\v!chapter=]
-
-\setuplabeltext [\s!fr] [\v!section=] % Section
-\setuplabeltext [\s!es] [\v!section=] % Secci\'on
-\setuplabeltext [\s!ca] [\v!section=] % Secci\'o
-\setuplabeltext [\s!it] [\v!section=]
-\setuplabeltext [\s!la] [\v!section=]
-\setuplabeltext [\s!pt] [\v!section=]
-\setuplabeltext [\s!ro] [\v!section=]
-
-\setuplabeltext [\s!fr] [\v!subsection=] % Soussection
-\setuplabeltext [\s!es] [\v!subsection=] % Subsecci\'on
-\setuplabeltext [\s!ca] [\v!subsection=] % Subsecci\'o
-\setuplabeltext [\s!it] [\v!subsection=]
-\setuplabeltext [\s!la] [\v!subsection=]
-\setuplabeltext [\s!pt] [\v!subsection=]
-\setuplabeltext [\s!ro] [\v!subsection=]
-
-\setuplabeltext [\s!fr] [\v!subsubsection=] % Soussoussection
-\setuplabeltext [\s!es] [\v!subsubsection=] % Subsubsecci\'on
-\setuplabeltext [\s!ca] [\v!subsubsection=] % Subsubsecci\'o
-\setuplabeltext [\s!it] [\v!subsubsection=]
-\setuplabeltext [\s!la] [\v!subsubsection=]
-\setuplabeltext [\s!pt] [\v!subsubsection=]
-\setuplabeltext [\s!ro] [\v!subsubsection=]
-
-\setuplabeltext [\s!fr] [\v!subsubsubsection=] % Soussoussoussection
-\setuplabeltext [\s!es] [\v!subsubsubsection=] % Subsubsubsecci\'on
-\setuplabeltext [\s!ca] [\v!subsubsubsection=] % Subsubsubsecci\'o
-\setuplabeltext [\s!it] [\v!subsubsubsection=]
-\setuplabeltext [\s!la] [\v!subsubsubsection=]
-\setuplabeltext [\s!pt] [\v!subsubsubsection=]
-\setuplabeltext [\s!ro] [\v!subsubsubsection=]
-
-\setuplabeltext [\s!fr] [\v!appendix=] % Annexe
-\setuplabeltext [\s!es] [\v!appendix=] % Ap\'endice
-\setuplabeltext [\s!ca] [\v!appendix=] % Ap\`endix
-\setuplabeltext [\s!it] [\v!appendix=]
-\setuplabeltext [\s!la] [\v!appendix=]
-\setuplabeltext [\s!pt] [\v!appendix=]
-\setuplabeltext [\s!ro] [\v!appendix=]
-
-\setuplabeltext [\s!fr] [\v!part=Partie ]
-\setuplabeltext [\s!es] [\v!part=Parte ]
-\setuplabeltext [\s!ca] [\v!part=Part ]
-\setuplabeltext [\s!it] [\v!part=Parte ]
-\setuplabeltext [\s!la] [\v!part=Pars ]
-\setuplabeltext [\s!pt] [\v!part=Parte ]
-\setuplabeltext [\s!ro] [\v!part=Partea ]
-
-\setuplabeltext [\s!fr] [\v!line=ligne ]
-\setuplabeltext [\s!es] [\v!line=l\'\i nea ]
-\setuplabeltext [\s!ca] [\v!line=l\'\i nia ]
-\setuplabeltext [\s!it] [\v!line=riga ]
-\setuplabeltext [\s!la] [\v!line=versus ]
-\setuplabeltext [\s!pt] [\v!line=linha ]
-\setuplabeltext [\s!ro] [\v!line=linia ]
-
-\setuplabeltext [\s!fr] [\v!lines=lignes ]
-\setuplabeltext [\s!es] [\v!lines=l\'\i neas ]
-\setuplabeltext [\s!ca] [\v!lines=l\'\i nies ]
-\setuplabeltext [\s!it] [\v!lines=righe ]
-\setuplabeltext [\s!la] [\v!lines=versus ]
-\setuplabeltext [\s!pt] [\v!lines=linhas ]
-\setuplabeltext [\s!ro] [\v!lines=liniile ]
-
-\setuplabeltext [\s!fr] [\v!january=janvier]
-\setuplabeltext [\s!fr] [\v!february=f\'evrier]
-\setuplabeltext [\s!fr] [\v!march=mars]
-\setuplabeltext [\s!fr] [\v!april=avril]
-\setuplabeltext [\s!fr] [\v!may=mai]
-\setuplabeltext [\s!fr] [\v!june=juin]
-\setuplabeltext [\s!fr] [\v!july=juillet]
-\setuplabeltext [\s!fr] [\v!august=ao\^ut]
-\setuplabeltext [\s!fr] [\v!september=septembre]
-\setuplabeltext [\s!fr] [\v!october=octobre]
-\setuplabeltext [\s!fr] [\v!november=novembre]
-\setuplabeltext [\s!fr] [\v!december=d\'ecembre]
-
-\setuplabeltext [\s!es] [\v!january=enero]
-\setuplabeltext [\s!es] [\v!february=febrero]
-\setuplabeltext [\s!es] [\v!march=marzo]
-\setuplabeltext [\s!es] [\v!april=abril]
-\setuplabeltext [\s!es] [\v!may=mayo]
-\setuplabeltext [\s!es] [\v!june=junio]
-\setuplabeltext [\s!es] [\v!july=julio]
-\setuplabeltext [\s!es] [\v!august=agosto]
-\setuplabeltext [\s!es] [\v!september=septiembre]
-\setuplabeltext [\s!es] [\v!october=octubre]
-\setuplabeltext [\s!es] [\v!november=noviembre]
-\setuplabeltext [\s!es] [\v!december=diciembre]
-
-\setuplabeltext [\s!ca] [\v!january=gener]
-\setuplabeltext [\s!ca] [\v!february=febrer]
-\setuplabeltext [\s!ca] [\v!march=mar\c{c}]
-\setuplabeltext [\s!ca] [\v!april=abril]
-\setuplabeltext [\s!ca] [\v!may=maig]
-\setuplabeltext [\s!ca] [\v!june=juny]
-\setuplabeltext [\s!ca] [\v!july=juliol]
-\setuplabeltext [\s!ca] [\v!august=agost]
-\setuplabeltext [\s!ca] [\v!september=setembre]
-\setuplabeltext [\s!ca] [\v!october=octubre]
-\setuplabeltext [\s!ca] [\v!november=novembre]
-\setuplabeltext [\s!ca] [\v!december=desembre]
-
-\setuplabeltext [\s!it] [\v!january=gennaio]
-\setuplabeltext [\s!it] [\v!february=febbraio]
-\setuplabeltext [\s!it] [\v!march=marzo]
-\setuplabeltext [\s!it] [\v!april=aprile]
-\setuplabeltext [\s!it] [\v!may=maggio]
-\setuplabeltext [\s!it] [\v!june=giugno]
-\setuplabeltext [\s!it] [\v!july=luglio]
-\setuplabeltext [\s!it] [\v!august=agosto]
-\setuplabeltext [\s!it] [\v!september=settembre]
-\setuplabeltext [\s!it] [\v!october=ottobre]
-\setuplabeltext [\s!it] [\v!november=novembre]
-\setuplabeltext [\s!it] [\v!december=dicembre]
-
-\setuplabeltext [\s!la] [\v!january=Ianuarius]
-\setuplabeltext [\s!la] [\v!february=Februarius]
-\setuplabeltext [\s!la] [\v!march=Martius]
-\setuplabeltext [\s!la] [\v!april=Aprilis]
-\setuplabeltext [\s!la] [\v!may=Maius]
-\setuplabeltext [\s!la] [\v!june=Iunius]
-\setuplabeltext [\s!la] [\v!july=Iulius] % formerly Quintilis
-\setuplabeltext [\s!la] [\v!august=Augustus] % formerly Sextilis
-\setuplabeltext [\s!la] [\v!september=September]
-\setuplabeltext [\s!la] [\v!october=October]
-\setuplabeltext [\s!la] [\v!november=November]
-\setuplabeltext [\s!la] [\v!december=December]
-
-\setuplabeltext [\s!pt] [\v!january=janeiro]
-\setuplabeltext [\s!pt] [\v!february=fevereiro]
-\setuplabeltext [\s!pt] [\v!march=mar\c{c}o]
-\setuplabeltext [\s!pt] [\v!april=abril]
-\setuplabeltext [\s!pt] [\v!may=maio]
-\setuplabeltext [\s!pt] [\v!june=junho]
-\setuplabeltext [\s!pt] [\v!july=julho]
-\setuplabeltext [\s!pt] [\v!august=agosto]
-\setuplabeltext [\s!pt] [\v!september=setembro]
-\setuplabeltext [\s!pt] [\v!october=outubro]
-\setuplabeltext [\s!pt] [\v!november=novembro]
-\setuplabeltext [\s!pt] [\v!december=dezembro]
-
-\setuplabeltext [\s!ro] [\v!january=ianuarie]
-\setuplabeltext [\s!ro] [\v!february=februarie]
-\setuplabeltext [\s!ro] [\v!march=martie]
-\setuplabeltext [\s!ro] [\v!april=aprilie]
-\setuplabeltext [\s!ro] [\v!may=mai]
-\setuplabeltext [\s!ro] [\v!june=iunie]
-\setuplabeltext [\s!ro] [\v!july=iulie]
-\setuplabeltext [\s!ro] [\v!august=august]
-\setuplabeltext [\s!ro] [\v!september=septembrie]
-\setuplabeltext [\s!ro] [\v!october=octombrie]
-\setuplabeltext [\s!ro] [\v!november=noiembrie]
-\setuplabeltext [\s!ro] [\v!december=decembrie]
-
-\setuplabeltext [\s!fr] [\v!sunday=dimanche]
-\setuplabeltext [\s!fr] [\v!monday=lundi]
-\setuplabeltext [\s!fr] [\v!tuesday=mardi]
-\setuplabeltext [\s!fr] [\v!wednesday=mercredi]
-\setuplabeltext [\s!fr] [\v!thursday=jeudi]
-\setuplabeltext [\s!fr] [\v!friday=vendredi]
-\setuplabeltext [\s!fr] [\v!saturday=samedi]
-
-\setuplabeltext [\s!es] [\v!sunday=domingo]
-\setuplabeltext [\s!es] [\v!monday=lunes]
-\setuplabeltext [\s!es] [\v!tuesday=martes]
-\setuplabeltext [\s!es] [\v!wednesday=mi\'ercoles]
-\setuplabeltext [\s!es] [\v!thursday=jueves]
-\setuplabeltext [\s!es] [\v!friday=viernes]
-\setuplabeltext [\s!es] [\v!saturday=s\'abado]
-
-\setuplabeltext [\s!ca] [\v!sunday=diumenge]
-\setuplabeltext [\s!ca] [\v!monday=dilluns]
-\setuplabeltext [\s!ca] [\v!tuesday=dimarts]
-\setuplabeltext [\s!ca] [\v!wednesday=dimecres]
-\setuplabeltext [\s!ca] [\v!thursday=dijous]
-\setuplabeltext [\s!ca] [\v!friday=divendres]
-\setuplabeltext [\s!ca] [\v!saturday=dissabte]
-
-\setuplabeltext [\s!it] [\v!sunday=domenica]
-\setuplabeltext [\s!it] [\v!monday=luned\`\i]
-\setuplabeltext [\s!it] [\v!tuesday=marted\`\i]
-\setuplabeltext [\s!it] [\v!wednesday=mercoled\`\i]
-\setuplabeltext [\s!it] [\v!thursday=gioved\`\i]
-\setuplabeltext [\s!it] [\v!friday=venerd\`\i]
-\setuplabeltext [\s!it] [\v!saturday=sabato]
-
-\setuplabeltext [\s!la] [\v!sunday=Dies Solis]
-\setuplabeltext [\s!la] [\v!monday=Dies Lunae]
-\setuplabeltext [\s!la] [\v!tuesday=Dies Martis]
-\setuplabeltext [\s!la] [\v!wednesday=Dies Mercuri]
-\setuplabeltext [\s!la] [\v!thursday=Dies Iovis]
-\setuplabeltext [\s!la] [\v!friday=Dies Veneris]
-\setuplabeltext [\s!la] [\v!saturday=Dies Saturni]
-
-\setuplabeltext [\s!pt] [\v!sunday=domingo]
-\setuplabeltext [\s!pt] [\v!monday=segunda-feira]
-\setuplabeltext [\s!pt] [\v!tuesday=ter\c{c}a-feira]
-\setuplabeltext [\s!pt] [\v!wednesday=quarta-feira]
-\setuplabeltext [\s!pt] [\v!thursday=quinta-feira]
-\setuplabeltext [\s!pt] [\v!friday=sexta-feira]
-\setuplabeltext [\s!pt] [\v!saturday=s\'abado]
-
-\setuplabeltext [\s!ro] [\v!sunday=duminic\u{a}]
-\setuplabeltext [\s!ro] [\v!monday=luni]
-\setuplabeltext [\s!ro] [\v!tuesday=mar\c{t}i]
-\setuplabeltext [\s!ro] [\v!wednesday=miercuri]
-\setuplabeltext [\s!ro] [\v!thursday=joi]
-\setuplabeltext [\s!ro] [\v!friday=vineri]
-\setuplabeltext [\s!ro] [\v!saturday=s\^{a}mb\u{a}t\u{a}]
-
-%D Rather new \unknown
-
-\setuplabeltext [\s!it] [\v!page=pagina ]
-\setuplabeltext [\s!it] [\v!atpage=a pagina ]
-\setuplabeltext [\s!it] [\v!hencefore=come mostrato sopra]
-\setuplabeltext [\s!it] [\v!hereafter=come mostrato sotto]
-\setuplabeltext [\s!it] [\v!see=cf. ]
-
-\setuplabeltext [\s!fr] [\v!page=page ]
-\setuplabeltext [\s!fr] [\v!atpage=à la page ]
-\setuplabeltext [\s!fr] [\v!hencefore=ci-dessus]
-\setuplabeltext [\s!fr] [\v!hereafter=ci-dessous]
-\setuplabeltext [\s!fr] [\v!see=cf. ]
-
-%D Ordinal converters:
-
-\def\frordinaldaynumber#1% date is masculine
- {\number#1\ifcase#1\or
- \highordinalstr{er}%
- \fi}
-
-\defineconversion [\s!fr] [\v!day+] [\frordinaldaynumber]
-
-%D \ShowAllLanguageValues [\s!fr] [french] {French} {kiss} % franse slag
-%D \ShowAllLanguageValues [\s!es] [spanish] {Spanish} {guitar} % spaans benauwd
-%D \ShowAllLanguageValues [\s!ca] [catalan] {Catalan} {cream}
-%D \ShowAllLanguageValues [\s!it] [italian] {Italian} {aria}
-%D \ShowAllLanguageValues [\s!la] [latin] {Latin} {lover} % latijnse missen
-%D \ShowAllLanguageValues [\s!pt] [portuguese] {Portuguese} {fisherman}
-%D \ShowAllLanguageValues [\s!ro] [romanian] {Romanian} {traveller}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/lang-jap.mkii b/Master/texmf-dist/tex/context/base/mkii/lang-jap.mkii
deleted file mode 100644
index 1417e8ec58c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/lang-jap.mkii
+++ /dev/null
@@ -1,234 +0,0 @@
-%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={Richard Gabriel \& Hans Hagen}]
-%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}]
-
-\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/mkii/lang-lab.mkii b/Master/texmf-dist/tex/context/base/mkii/lang-lab.mkii
deleted file mode 100644
index 1ff964615e0..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/lang-lab.mkii
+++ /dev/null
@@ -1,295 +0,0 @@
-%D \module
-%D [ file=lang-lab,
-%D version=1997.08.27,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Labels,
-%D author=Hans Hagen / Tobias Burnus,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 In this module we deal with language dependant labels and
-%D prefixes, like in {\em Figure~12} and {\em Chapter 1}. In
-%D this file we set the default values. Users can easily
-%D overrule these.
-%D
-%D This module is dedicated to the grandfather of Tobias
-%D Burnus, who's extensive languages oriented library helped us
-%D a lot in finding the right translations. All those labels
-%D are collected in files that reflect their common ancestor.
-%D
-%D Not all languages can be satisfied with the labeling
-%D mechanism as provided here. Chinese for instance put a label
-%D in front as well as after a part number. This is why the
-%D current implementation of labels supports two labels too.
-
-%D \macros
-%D {setupheadtext, setuplabeltext}
-%D
-%D First we present some macros that deal with what we will
-%D call head and label texts. Such texts are defines by:
-%D
-%D \showsetup{setupheadtext}
-%D \showsetup{setuplabeltext}
-%D
-%D In a few paragraphs we'll show quite a lot of examples
-%D of its use.
-
-\let\handletextprefix\relax
-
-\def\setupheadtext {\dosetupsometextprefix[\c!title]}
-\def\setuplabeltext{\dosetupsometextprefix[\c!label]}
-
-\def\dosetupsometextprefix
- {\let\dodocommand\xdosetupsometextprefix
- \dotripleempty\dodosetupsometextprefix}
-
-% \def\dodosetupsometextprefix[#1][#2][#3]%
-% {\ifthirdargument
-% \def\docommand##1{\dodocommand[#1#2][##1]}%
-% \processcommalist[#3]\docommand
-% \else
-% \def\docommand##1{\dodocommand[#1\currentmainlanguage][##1]}%
-% \processcommalist[#2]\docommand
-% \fi}
-
-\def\dodosetupsometextprefix[#1][#2][#3]%
- {\ifthirdargument
- \def\docommand##1{\expanded{\dodocommand[#1\reallanguagetag{#2}]}[##1]}%
- \processcommalist[#3]\docommand
- \else
- \def\docommand##1{\expanded{\dodocommand[#1\reallanguagetag\currentmainlanguage]}[##1]}%
- \processcommalist[#2]\docommand
- \fi}
-
-\def\doassignsometextprefix[#1][#2,#3,#4]%
- {\setvalue{#1}{\handletextprefix{#2}{#3}}}
-
-\def\xdosetupsometextprefix[#1][#2=#3]%
- {\doassignsometextprefix[#1#2][#3,,]}
-
-%D By changing the meaning of \type {\handletextprefix} we
-%D can filter the left and right labeltext as well as convert
-%D labels to uppercase.
-%D
-%D These commands accept all kind of inputs:
-%D
-%D \starttyping
-%D \setuplabeltext [language] [labellabel=text]
-%D \setuplabeltext [language] [labellabel=text,labellabel=text,...]
-%D \setuplabeltext [labellabel=text]
-%D \setuplabeltext [labellabel=text,labellabel=text,...]
-%D \stoptyping
-%D
-%D The last two cases concern the current language.
-
-%D \macros
-%D {headtext,
-%D labeltext, leftlabeltext, rightlabeltext, labeltexts,
-%D LABELTEXT, LEFTLABELTEXT, RIGHTLABELTEXT, LABELTEXTS}
-%D
-%D Once defined, head and label texts can be called upon using:
-%D
-%D \showsetup{headtext}
-%D \showsetup{labeltext}
-%D
-%D The latter one has an upcased alternative \type{\LABELTEXT}.
-
-% \def\labellanguage{\currentmainlanguage}
-% \def\headlanguage {\currentmainlanguage}
-
-% \def\labellanguage{\defaultlanguage\currentmainlanguage}
-% \def\headlanguage {\defaultlanguage\currentmainlanguage}
-
-\def\labellanguage{\reallanguagetag{\defaultlanguage\currentmainlanguage}}
-\def\headlanguage {\reallanguagetag{\defaultlanguage\currentmainlanguage}}
-
-\appendtoks \let\labellanguage\currentlanguage \to \everycurrentdate
-
-\unexpanded\def\headtext
- {\let\handletextprefix\firstoftwoarguments
- \let\reporttextprefixerror\doreporttextprefixerror
- \global\labeltextdonetrue
- \dogetupsometextprefix\headlanguage\c!title}
-
-\unexpanded\def\leftlabeltext
- {\let\handletextprefix\firstoftwoarguments
- \let\reporttextprefixerror\doreporttextprefixerror
- \global\labeltextdonetrue
- \dogetupsometextprefix\labellanguage\c!label}
-
-\unexpanded\def\rightlabeltext
- {\let\handletextprefix\secondoftwoarguments
- \let\reporttextprefixerror\doreporttextprefixerror
- \global\labeltextdonetrue
- \dogetupsometextprefix\labellanguage\c!label}
-
-\unexpanded\def\LEFTLABELTEXT
- {\def\handletextprefix##1##2{\uppercase{##1}}\DOLABELTEXT}
-
-\unexpanded\def\RIGHTLABELTEXT
- {\def\handletextprefix##1##2{\uppercase{##2}}\DOLABELTEXT}
-
-\def\DOLABELTEXT#1%
- {\bgroup
- \the\everyuppercase
- \let\reporttextprefixerror\doreporttextprefixerror
- \global\labeltextdonetrue
- \dogetupsometextprefix\labellanguage\c!label{#1}% not \labeltext (see \MONTH)
- \egroup}
-
-\let\labeltext \leftlabeltext
-\let\LABELTEXT \LEFTLABELTEXT
-
-\unexpanded\def\labeltexts#1#2{\leftlabeltext{#1}#2\rightlabeltext{#1}}
-\unexpanded\def\LABELTEXTS#1#2{\LEFTLABELTEXT{#1}#2\RIGHTLABELTEXT{#1}}
-
-\newif\iflabeltextdone % needs to be reset elsewhere
-\newif\iftracelabels % shows missing labels
-
-\def\doreporttextprefixerror#1#2#3%
- {\iftracelabels{\tttf[#2:~#3/#1]~}\fi}
-
-\def\dosetexpandedheadlabeltext#1#2#3%
- {\bgroup
- \let\handletextprefix\firstoftwoarguments
- \let\reporttextprefixerror\gobblethreearguments
- \keepencodedtokens % test on multilingual pascal, ok in stretched
- %\dontexpandencodedtokens % not usable in token handler
- \expanded
- {\egroup\noexpand\def\noexpand#2% watch out, no \edef
- {\dogetupsometextprefix{\headlanguage}{#1}{#3}}}}
-
-\def\setexpandedheadtext {\dosetexpandedheadlabeltext\c!title}
-\def\setexpandedlabeltext{\dosetexpandedheadlabeltext\c!label}
-
-% \def\dogetupsometextprefix#1#2#3%
-% {\ifcsname#2#1#3\endcsname
-% \csname#2#1#3\endcsname \else
-% \ifcsname#2#3\endcsname
-% \csname#2#3\endcsname \else
-% \ifcsname#2\defaultlanguage#1#3\endcsname
-% \csname#2\defaultlanguage#1#3\endcsname \else
-% \ifcsname#2\s!en#3\endcsname
-% \csname#2\s!en#3\endcsname \else
-% \ifcsname#2\s!nl#3\endcsname
-% \csname#2\s!nl#3\endcsname \else
-% \reporttextprefixerror{#1}{#2}{#3}%
-% \fi\fi\fi\fi\fi}
-%
-% \def\dogetupsometextprefix#1#2#3% must be expandable !
-% {\ifcsname#2#1#3\endcsname
-% \csname#2#1#3\endcsname
-% \else\@EA\ifx\csname\??la#1\c!default\endcsname\empty
-% \ifcsname#2#3\endcsname
-% \csname#2#3\endcsname
-% \else\ifcsname#2\s!en#3\endcsname
-% \csname#2\s!en#3\endcsname
-% \else
-% \reporttextprefixerror{#1}{#2}{#3}%
-% \fi\fi
-% \else
-% \dogetupsometextprefix{\csname\??la#1\c!default\endcsname}{#2}{#3}%
-% \fi\fi}
-
-\def\dogetupsometextprefix#1#2#3% must be expandable ! #1 == language
- {\ifcsname#2#1#3\endcsname
- \csname#2#1#3\endcsname
- \else\ifcsname\??la#1\s!default\endcsname
- \expandafter\dogetupsometextprefix\csname\??la#1\s!default\endcsname{#2}{#3}%
- \else\ifcsname#2#3\endcsname
- \csname#2#3\endcsname
- \else\ifcsname#1\s!en#3\endcsname
- \csname#2\s!en#3\endcsname
- \else
- \reporttextprefixerror{#1}{#2}{#3}%
- \fi\fi\fi\fi}
-
-\ifx\simplifiedcommands\undefined \newtoks\simplifiedcommands \fi
-
-\appendtoks
- \let \headtext \firstofoneargument
- \let \labeltext \firstofoneargument
- \let \leftlabeltext \firstofoneargument
- \let \rightlabeltext \firstofoneargument
- \let \HEADTEXT \firstofoneargument
- \let \LABELTEXT \firstofoneargument
- \let \LEFTLABELTEXT \firstofoneargument
- \let \RIGHTLABELTEXT \firstofoneargument
-\to \simplifiedcommands
-
-%D \macros
-%D {presetheadtext,presetlabeltext}
-%D
-%D The next two macros enable us to automatically define
-%D head and label texts without replacing predefined ones.
-%D These are internal macros.
-
-\def\xdopresetsometextprefix[#1][#2=#3]%
- {\ifundefined{#1#2}\doassignsometextprefix[#1\reallanguagetag{#2}][#3,,]\fi}
-
-\def\dopresetsometextprefix
- {\let\dodocommand\xdopresetsometextprefix
- \dotripleempty\dodosetupsometextprefix}
-
-\def\presetheadtext {\dopresetsometextprefix[\c!title]}
-\def\presetlabeltext{\dopresetsometextprefix[\c!label]}
-
-%D \macros
-%D {translate}
-%D
-%D Sometismes macros contain language specific words that are to
-%D be typeset. Such macros can be made (more) language
-%D independant by using:
-%D
-%D \showsetup{translate}
-%D
-%D like for instance:
-%D
-%D \starttyping
-%D \translate[en=something,nl=iets]
-%D \stoptyping
-%D
-%D which expands to {\em something} or {\em iets}, depending on
-%D de current language.
-
-\def\dotranslate[#1]%
- {\getparameters[\??lg][#1]%
- \ifcsname\??lg\currentlanguage\endcsname
- \csname\??lg\currentlanguage\endcsname
- \else\ifcsname\??lg\s!en\endcsname
- \csname\??lg\s!en\endcsname
- \else
- [translation #1]%
- \fi\fi}
-
-\unexpanded\def\translate
- {\dosingleempty\dotranslate}
-
-%D When used without argument, the last defined values are
-%D used. This enables repetitive use like
-%D
-%D \starttyping
-%D \en \translate\ means \nl \translate
-%D \stoptyping
-
-%D \macros
-%D {assigntranslation}
-%D
-%D This macro is a system macro, and can be used to assign a
-%D translation to a macro. Its form is:
-%D
-%D \starttyping
-%D \assigntranslation[en=something,nl=iets]\to\command
-%D \stoptyping
-
-\def\assigntranslation[#1]\to#2%
- {\getparameters[\??lg][#1]%
- \edef#2{\csname\??lg\currentlanguage\endcsname}}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/lang-mis.mkii b/Master/texmf-dist/tex/context/base/mkii/lang-mis.mkii
deleted file mode 100644
index 3923df3e8ae..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/lang-mis.mkii
+++ /dev/null
@@ -1,683 +0,0 @@
-%D \module
-%D [ file=lang-mis,
-%D version=1997.03.20, % used to be supp-lan.tex
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Compounds,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Language Macros / Compounds}
-
-%D \gdef\starttest
-%D {\blank
-%D \noindent
-%D \halign\bgroup\tt##\hskip2em&##\hskip2em&##\cr}
-%D
-%D \gdef\stoptest
-%D {\egroup
-%D \blank}
-%D
-%D \gdef\test#1%
-%D {\defconvertedargument\ascii{#1}\ascii&\hyphenatedword{#1}&#1\cr}
-
-\unprotect
-
-%D One of \TEX's strong points in building paragraphs is the way
-%D hyphenations are handled. Although for real good hyphenation
-%D of non||english languages some extensions to the program are
-%D needed, fairly good results can be reached with the standard
-%D mechanisms and an additional macro, at least in Dutch.
-
-%D \CONTEXT\ originates in the wish to typeset educational
-%D materials, especially in a technical environment. In
-%D production oriented environments, a lot of compound words
-%D are used. Because the Dutch language poses no limits on
-%D combining words, we often favor putting dashes between those
-%D words, because it facilitates reading, at least for those
-%D who are not that accustomed to it.
-%D
-%D In \TEX\ compound words, separated by a hyphen, are not
-%D hyphenated at all. In spite of the multiple pass paragraph
-%D typesetting this can lead to parts of words sticking into
-%D the margin. The solution lays in saying \type
-%D {spoelwater||terugwinunit} instead of \type
-%D {spoelwater-terugwinunit}. By using a one character command
-%D like \type {|}, delimited by the same character \type {|},
-%D we get ourselves both a decent visualization (in \TEXEDIT\
-%D and colored verbatim we color these commands yellow) and an
-%D efficient way of combining words.
-%D
-%D The sequence \type{||} simply leads to two words connected by
-%D a hyphen. Because we want to distinguish such a hyphen from
-%D the one inserted when \TEX\ hyphenates a word, we use a bit
-%D longer one.
-%D
-%D \hyphenation {spoel-wa-ter te-rug-win-unit}
-%D
-%D \starttest
-%D \test {spoelwater||terugwinunit}
-%D \stoptest
-%D
-%D As we already said, the \type{|} is a command. This commands
-%D accepts an optional argument before it's delimiter, which is
-%D also a \type{|}.
-%D
-%D \hyphenation {po-ly-meer che-mie}
-%D
-%D \starttest
-%D \test {polymeer|*|chemie}
-%D \stoptest
-%D
-%D Arguments like \type{*} are not interpreted and inserted
-%D directly, in contrary to arguments like:
-%D
-%D \starttest
-%D \test {polymeer|~|chemie}
-%D \test {|(|polymeer|)|chemie}
-%D \test {polymeer|(|chemie|)| }
-%D \stoptest
-%D
-%D Although such situations seldom occur |<|we typeset thousands
-%D of pages before we encountered one that forced us to enhance
-%D this mechanism|>| we also have to take care of comma's.
-%D
-%D \hyphenation {uit-stel-len}
-%D
-%D \starttest
-%D \test {op||, in|| en uitstellen}
-%D \stoptest
-%D
-%D The next special case (concerning quotes) was brought to my
-%D attention by Piet Tutelaers, one of the driving forces
-%D behind rebuilding hyphenation patterns for the dutch
-%D language.\footnote{In 1996 the spelling of the dutch
-%D language has been slightly reformed which made this topic
-%D actual again.} We'll also take care of this case.
-%D
-%D \starttest
-%D \test {AOW|'|er}
-%D \test {cd|'|tje}
-%D \test {ex|-|PTT|'|er}
-%D \test {rock|-|'n|-|roller}
-%D \stoptest
-%D
-%D Tobias Burnus pointed out that I should also support
-%D something like
-%D
-%D \starttest
-%D \test {well|_|known}
-%D \stoptest
-%D
-%D to stress the compoundness of hyphenated words.
-%D
-%D Of course we also have to take care of the special case:
-%D
-%D \starttest
-%D \test {text||color and ||font}
-%D \stoptest
-
-%D \macros
-%D {installdiscretionaries}
-%D
-%D The mechanism described here is one of the older inner parts
-%D of \CONTEXT. The most recent extensions concerns some
-%D special cases as well as the possibility to install other
-%D characters as delimiters. The prefered way of specifying
-%D compound words is using \type{||}, which is installed by:
-%D
-%D \starttyping
-%D \installdiscretionaries || -
-%D \stoptyping
-%D
-%D Some alternative definitions are:
-%D
-%D \startbuffer
-%D \installdiscretionaries ** -
-%D \installdiscretionaries ++ -
-%D \installdiscretionaries // -
-%D \installdiscretionaries ~~ -
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D after which we can say:
-%D
-%D \bgroup
-%D \getbuffer
-%D \starttest
-%D \test {test**test**test}
-%D \test {test++test++test}
-%D \test {test//test//test}
-%D \test {test~~test~~test}
-%D \stoptest
-%D \egroup
-
-%D \macros
-%D {compoundhyphen,
-%D beginofsubsentence,endofsubsentence}
-%D
-%D Now let's go to the macros. First we define some variables.
-%D In the main \CONTEXT\ modules these can be tuned by a setup
-%D command. Watch the (maybe) better looking compound hyphen.
-
-\ifx\compoundhyphen \undefined \def\compoundhyphen{\hbox{-\kern-.25ex-}} \fi
-
-\ifx\beginofsubsentence \undefined \def\beginofsubsentence{\hbox{---}} \fi
-\ifx\endofsubsentence \undefined \def\endofsubsentence {\hbox{---}} \fi
-
-%D The last two variables are needed for subsentences
-%D |<|like this one|>| which we did not yet mention.
-%D
-%D We want to enable breaking but at the same time don't want
-%D compound characters like |-| or || to be separated from the
-%D words. \TEX\ hackers will recognise the next two macro's:
-
-\ifx\prewordbreak \undefined \def\prewordbreak {\penalty\plustenthousand\hskip\zeropoint\relax} \fi
-%ifx\postwordbreak \undefined \def\postwordbreak{\penalty\zerocount \prewordbreak } \fi
-\ifx\postwordbreak \undefined \def\postwordbreak{\penalty\zerocount \hskip\zeropoint\relax} \fi
-
-\ifx\hspaceamount \undefined \def\hspaceamount#1#2{.16667em} \fi % language specific
-
-%D \macros
-%D {beginofsubsentencespacing,endofsubsentencespacing}
-%D
-%D In the previous macros we provided two hooks which can be
-%D used to support nested sub||sentences. In \CONTEXT\ these
-%D hooks are used to insert a small space when needed.
-
-\ifx\beginofsubsentencespacing\undefined \let\beginofsubsentencespacing\relax \fi
-\ifx\endofsubsentencespacing \undefined \let\endofsubsentencespacing \relax \fi
-
-%D The following piece of code is a torture test compound
-%D hndling. The \type {\relax} before the \type {\ifmmode} is
-%D needed because of the alignment scanner (in \ETEX\ this
-%D problem is not present because there a protected macro is
-%D not expanded. Thanks to Tobias Burnus for providing this
-%D example.
-%D
-%D \startformula
-%D \left|f(x_n)-{1\over2}\right| =
-%D {\cases{|{1\over2}-x_n| &for $0\le x_n < {1\over2}$\cr
-%D |x_n-{1\over2}| &for ${1\over2}<x_n\le1$ \cr}}
-%D \stopformula
-
-\def\@tmd@action@{@tmd@a@}
-\def\@tmd@text@ {@tmd@t@}
-\def\@tmd@math@ {@tmd@m@}
-\def\@tmd@both@ {@tmd@b@}
-
-\def\installdiscretionary#1#2%
- {\setevalue{\@tmd@math@\detokenize{#1}}{\detokenize{#1}}%
- \setvalue {\@tmd@text@\detokenize{#1}}{#2}%
- \setvalue {\@tmd@both@\detokenize{#1}}{\discretionarycommand#1}%
- \scratchcounter\expandafter`\detokenize{#1}%
- \@EA\uedcatcodecommand\@EA\ctxcatcodes\@EA\scratchcounter\csname\@tmd@both@\detokenize{#1}\endcsname}
-
-\def\handlemathmodediscretionary#1{\executeifdefined{\@tmd@math@\detokenize{#1}}\donothing}
-\def\handletextmodediscretionary#1{\executeifdefined{\@tmd@text@\detokenize{#1}}\donothing}
-
-\def\installdiscretionaries#1#2{\writestatus\m!systems{use \string \installdiscretionary}} % obsolete
-
-\chardef\discretionarymode\plusone
-
-\def\ignorediscretionaries
- {\chardef\discretionarymode\zerocount}
-
-\def\discretionarycommand
- {% if direct if, we need \relax for lookahead in math mode
- \csname
- \ifcase\discretionarymode
- \strippedcsname\dononemodediscretionary
- \else\ifmmode
- \strippedcsname\domathmodediscretionary
- \else
- \strippedcsname\dotextmodediscretionary
- \fi\fi
- \endcsname}
-
-\def\dononemodediscretionary#1%
- {\detokenize{#1}}
-
-%D The macro \type{\checkbeforediscretionary} takes care of
-%D loners like \type{||word}, while it counterpart
-%D \type{\checkafterdiscretionary} is responsible for handling
-%D the comma.
-
-\newsignal\compoundbreakpoint
-
-\newconditional\punctafterdiscretionary
-\newconditional\spaceafterdiscretionary
-
-\def\checkbeforediscretionary
- {\ifvmode\dontleavehmode\fi
- \ifhmode
- \begingroup
- \setbox\scratchbox\lastbox
- \ifzeropt\wd\scratchbox
- \let\postwordbreak\prewordbreak
- \fi
- \box\scratchbox\relax
- \endgroup
- \fi}
-
-\def\checkafterdiscretionary
- {\setfalse\punctafterdiscretionary
- \setfalse\spaceafterdiscretionary
- \ifx\blankspace\nextnext \settrue \spaceafterdiscretionary \else
- \ifx\space \nextnext \settrue \spaceafterdiscretionary \else
- \ifx .\nextnext \settrue \punctafterdiscretionary \else
- \ifx ,\nextnext \settrue \punctafterdiscretionary \else
- \ifx :\nextnext \settrue \punctafterdiscretionary \else
- \ifx ;\nextnext \settrue \punctafterdiscretionary \fi\fi\fi\fi\fi\fi}
-
-\let\domathmodediscretionary\handlemathmodediscretionary
-
-\def\dotextmodediscretionary#1%
- {\bgroup
- \let\nextnextnext\egroup
- \def\next##1#1%
- {\def\next{\activedododotextmodediscretionary#1{##1}}%
- \futurelet\nextnext\next}%
- \next}
-
-\def\activedododotextmodediscretionary#1#2%
- {\edef\discretionarytoken{\detokenize{#2}}%
- \def\textmodediscretionary{\handletextmodediscretionary{#1}}%
- \checkafterdiscretionary
- \ifx\discretionarytoken\empty
- \ifx#1\nextnext % takes care of ||| and +++ and ......
- \ifcsname\@tmd@action@\string#1\endcsname
- \csname\@tmd@action@\string#1\endcsname
- \else\ifconditional\spaceafterdiscretionary
- \prewordbreak\hbox{\string#1}\relax
- \else\ifconditional\punctafterdiscretionary
- \prewordbreak\hbox{\string#1}\relax
- \else
- \prewordbreak\hbox{\string#1}\prewordbreak
- \fi\fi\fi
- \def\nextnextnext{\afterassignment\egroup\let\next=}%
- \else
- \checkbeforediscretionary
- % the next line has been changed (20050203)
- % \prewordbreak\hbox{\textmodediscretionary\nextnext}\allowbreak\postwordbreak
- % but an hbox blocks a possible \discretionary
- \ifcsname\@tmd@action@\endcsname
- \csname\@tmd@action@\endcsname
- \else\ifconditional\spaceafterdiscretionary
- \prewordbreak\textmodediscretionary\relax
- \else\ifconditional\punctafterdiscretionary
- \prewordbreak\textmodediscretionary\relax
- \else
- \prewordbreak\textmodediscretionary\prewordbreak
- \fi\fi\fi
- % \prewordbreak\textmodediscretionary\nextnext\allowbreak\postwordbreak
- \fi
- \else\ifcsname\@tmd@action@\discretionarytoken\endcsname
- \csname\@tmd@action@\discretionarytoken\endcsname
- \else
- \checkbeforediscretionary
- \ifconditional\spaceafterdiscretionary
- \prewordbreak\hbox{#2}\relax
- \else\ifconditional\punctafterdiscretionary
- \prewordbreak\hbox{#2}\relax
- \else
- \prewordbreak\discretionary{\hbox{#2}}{}{\hbox{#2}}\allowbreak\postwordbreak
- \fi\fi
- \fi\fi
- \nextnextnext} % lookahead in commands
-
-%D \macros
-%D {directdiscretionary}
-%D
-%D In those situations where the nature of characters is
-%D less predictable, we can use the more direct approach:
-
-\def\directdiscretionary
- {\csname
- \ifcase\discretionarymode
- \strippedcsname\dononemodediscretionary
- \else
- \strippedcsname\dodirectdiscretionary
- \fi
- \endcsname}
-
-\def\indirectdiscretionary
- {\csname
- \ifcase\discretionarymode
- \strippedcsname\dononemodediscretionary
- \else
- \strippedcsname\doindirectdiscretionary
- \fi
- \endcsname}
-
-\unexpanded\def\dodirectdiscretionary#1%
- {\edef\discretionarytoken{\detokenize{#1}}%
- \let\textmodediscretionary\compoundhyphen
- \executeifdefined{\@tmd@action@\discretionarytoken}{\indirectdiscretionary{#1}}}
-
-\unexpanded\def\doindirectdiscretionary#1%
- {\prewordbreak\discretionary{\hbox{#1}}{}{\hbox{#1}}\allowbreak\postwordbreak}
-
-\def\definetextmodediscretionary #1
- {\setvalue{\@tmd@action@\detokenize{#1}}}
-
-% \start \hsize 1mm
-% test |||test test|||, test\blank
-% test test|-|, test|-| and test|-|test\blank
-% test test|_|, test|_| and test|_|test\blank
-% test cd|'|tje\blank
-% test |(|test test|)|, test\blank
-% test test test|x|, test\blank
-% test|~|test
-% test|^|test
-% \stop
-
-\def\hyphenliketextmodediscretionary#1#2%
- {\ifconditional\spaceafterdiscretionary
- \prewordbreak\hbox{#1}\relax
- \else\ifconditional\punctafterdiscretionary
- \prewordbreak\hbox{#1}\relax
- \else
- \prewordbreak#2\postwordbreak % was prewordbreak
- \fi\fi}
-
-\definetextmodediscretionary {}
- {\hyphenliketextmodediscretionary\textmodehyphen\textmodehyphendiscretionary}
-
-\definetextmodediscretionary -
- {\hyphenliketextmodediscretionary\normalhyphen\normalhyphendiscretionary}
-
-\definetextmodediscretionary _
- {\hyphenliketextmodediscretionary\composedhyphen\composedhyphendiscretionary}
-
-\definetextmodediscretionary )
- {\hyphenliketextmodediscretionary{)}{\discretionary{-)}{}{)}}}
-
-\definetextmodediscretionary (
- {\ifdim\lastskip>\zeropoint
- (\prewordbreak
- \else
- \prewordbreak\discretionary{}{(-}{(}\prewordbreak
- \fi}
-
-\definetextmodediscretionary ~
- {\prewordbreak\discretionary{-}{}{\thinspace}\postwordbreak}
-
-\definetextmodediscretionary '
- {\prewordbreak\discretionary{-}{}{'}\postwordbreak}
-
-\definetextmodediscretionary ^
- {\prewordbreak\discretionary{\hbox{$|$}}{}{\hbox{$|$}}%
- \allowbreak\postwordbreak} % bugged
-
-\definetextmodediscretionary <
- {\beginofsubsentence\prewordbreak\beginofsubsentencespacing}
-
-\definetextmodediscretionary >
- {\endofsubsentencespacing\prewordbreak\endofsubsentence}
-
-\definetextmodediscretionary =
- {\prewordbreak\midsentence\prewordbreak} % {\prewordbreak\compoundhyphen}
-
-% french
-
-\definetextmodediscretionary : {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{:}:}
-\definetextmodediscretionary ; {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{;};}
-\definetextmodediscretionary ? {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{?}?}
-\definetextmodediscretionary ! {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{!}!}
-
-\definetextmodediscretionary *
- {\prewordbreak\discretionary{-}{}{\kern.05em}\prewordbreak}
-
-% spanish
-
-\definetextmodediscretionary ?? {\prewordbreak\questiondown}
-\definetextmodediscretionary !! {\prewordbreak\exclamdown}
-
-% \ifx\normalcompound\undefined \let\normalcompound=| \fi
-
-%D \installdiscretionary | +
-%D \installdiscretionary + =
-
-\def\defaultdiscretionaryhyphen{\compoundhyphen}
-
-\installdiscretionary | \defaultdiscretionaryhyphen % installs in ctx and prt will fall back on it
-
-%D \macros
-%D {fakecompoundhyphen}
-%D
-%D In headers and footers as well as in active pieces of text
-%D we need a dirty hack. Try to imagine what is needed to
-%D savely break the next text across a line and at the same
-%D time make the words interactive.
-%D
-%D \starttyping
-%D \goto{Some||Long||Word}
-%D \stoptyping
-
-\def\fakecompoundhyphen
- {\def\|{\mathortext\vert\dofakecompoundhyphen}}
-
-\def\dofakecompoundhyphen
- {\def##1|%
- {\doifelsenothing{##1}\compoundhyphen{##1}%
- \kern\compoundbreakpoint\allowbreak}}
-
-%D \macros
-%D {midworddiscretionary}
-%D
-%D If needed, one can add a discretionary hyphen using \type
-%D {\midworddiscretionary}. This macro does the same as
-%D \PLAIN\ \TEX's \type {\-}, but, like the ones implemented
-%D earlier, this one also looks ahead for spaces and grouping
-%D tokens.
-
-\def\midworddiscretionary
- {\futurelet\next\domidworddiscretionary}
-
-\def\domidworddiscretionary
- {\ifx\next\blankspace\else
- \ifx\next\bgroup \else
- \ifx\next\egroup \else
- \discretionary{-}{}{}%
- \fi\fi\fi}
-
-%D \macros
-%D {installcompoundcharacter}
-%D
-%D When Tobias Burnus started translating the dutch manual of
-%D \PPCHTEX\ into german, he suggested to let \CONTEXT\ support
-%D the \type{german.sty} method of handling compound
-%D characters, especially the umlaut. This package is meant for
-%D use with \PLAIN\ \TEX\ as well as \LATEX.
-%D
-%D I decided to implement compound character support as
-%D versatile as possible. As a result one can define his own
-%D compound character support, like:
-%D
-%D \starttyping
-%D \installcompoundcharacter "a {\"a}
-%D \installcompoundcharacter "e {\"e}
-%D \installcompoundcharacter "i {\"i}
-%D \installcompoundcharacter "u {\"u}
-%D \installcompoundcharacter "o {\"o}
-%D \installcompoundcharacter "s {\SS}
-%D \stoptyping
-%D
-%D or even
-%D
-%D \starttyping
-%D \installcompoundcharacter "ck {\discretionary {k-}{k}{ck}}
-%D \installcompoundcharacter "ff {\discretionary{ff-}{f}{ff}}
-%D \stoptyping
-%D
-%D The support is not limited to alphabetic characters, so the
-%D next definition is also valid.
-%D
-%D \starttyping
-%D \installcompoundcharacter ". {.\doifnextcharelse{\spacetoken}{}{\kern.125em}}
-%D \stoptyping
-%D
-%D The implementation looks familiar and uses the same tricks as
-%D mentioned earlier in this module. We take care of two
-%D arguments, which complicates things a bit.
-
-\def\@nc@{@nc@} % normal character
-\def\@cc@{@cc@} % compound character
-\def\@cs@{@cs@} % compound characters
-\def\@cx@{@cx@} % compound definition
-
-%D When we started working on MK IV code, we needed a different
-%D approach for defining the active character itself. In MK II as
-%D well as in MK IV we now use the catcode vectors.
-
-\chardef\compoundcharactermode\plusone
-
-\def\installcompoundcharacter #1#2#3 #4% {#4} no grouping
- {\ifcase\compoundcharactermode
- % ignore mode
- \else
- \chardef\thecompoundcharacter`#1%
- \@EA\chardef\csname\@nc@\string#1\endcsname\thecompoundcharacter
- \def\!!stringa{#3}%
- \@EA\def\csname\ifx\!!stringa\empty\@cc@\else\@cs@\fi\detokenize{#1#2#3}\endcsname{#4}%
- \setevalue{\@cx@\detokenize{#1}}{\noexpand\handlecompoundcharacter{\detokenize{#1}}}% beter nr's
-% \@EA\letcatcodecommand\@EA\prtcatcodes\@EA\thecompoundcharacter\csname\@cx@\detokenize{#1}\endcsname
-% \@EA\letcatcodecommand\@EA\texcatcodes\@EA\thecompoundcharacter\csname\@cx@\detokenize{#1}\endcsname
- \@EA\letcatcodecommand\@EA\ctxcatcodes\@EA\thecompoundcharacter\csname\@cx@\detokenize{#1}\endcsname
- \fi}
-
-%D In order to serve the language specific well, we will introduce
-%D a namespace:
-
-% \ifx\currentlanguage\undefined
- \let\compoundcharacterclass\empty
-% \else
-% \def\compoundcharacterclass{\currentlanguage}
-% \fi
-
-\def\@cc@{@cc@\compoundcharacterclass} % compound character
-\def\@cs@{@cs@\compoundcharacterclass} % compound characters
-
-%D We can also ignore definitions (needed in for instance \XML). Beware,
-%D this macro is supposed to be used grouped!
-
-\def\ignorecompoundcharacter
- {\chardef\compoundcharactermode\zerocount}
-
-\let\restorecompoundcharacter \gobbleoneargument % obsolete
-\let\enableactivediscretionaries\relax % obsolete
-
-%D In handling the compound characters we have to take care of
-%D \type{\bgroup} and \type{\egroup} tokens, so we end up with
-%D a multi||step interpretation macro. We look ahead for a
-%D \type{\bgroup}, \type{\egroup} or \type{\blankspace}. Being
-%D no user of this mechanism, the credits for testing them goes
-%D to Tobias Burnus, the first german user of \CONTEXT.
-%D
-%D We define these macros as \type{\long} because we can
-%D expect \type{\par} tokens. We need to look into the future
-%D with \type{\futurelet} to prevent spaces from
-%D disappearing.
-
-\def\handlecompoundcharacter#1%
- {\def\xhandlecompoundcharacter{\dohandlecompoundcharacter{#1}}%
- \futurelet\next\xhandlecompoundcharacter}
-
-\def\dohandlecompoundcharacter
- {\ifx\next\bgroup
- %\@EA\dodohandlecompoundcharacter % handle "{ee} -> \"ee
- %\@EA\gobbleoneargument % forget "{ee} -> ee
- \@EA\handlecompoundcharacterone % ignore "{ee} -> "ee
- \else\ifx\next\egroup
- \@EAEAEA\donohandlecompoundcharacter
- \else\ifx\next\blankspace
- \@EA\@EAEAEA\@EA\donohandlecompoundcharacter
- \else
- \@EA\@EAEAEA\@EA\dodohandlecompoundcharacter
- \fi\fi\fi}
-
-\def\donohandlecompoundcharacter#1{\csname\@nc@\string#1\endcsname}
-
-\def\dododohandlecompoundcharacter
- {\ifx\next\bgroup
- \@EA\handlecompoundcharacterone
- \else\ifx\next\egroup
- \@EAEAEA\handlecompoundcharacterone
- \else\ifx\next\blankspace
- \@EA\@EAEAEA\@EA\handlecompoundcharacterone
- \else
- \@EA\@EAEAEA\@EA\handlecompoundcharactertwo
- \fi\fi\fi}
-
-\def\dodohandlecompoundcharacter#1#2% preserve space
- {\def\xdodohandlecompoundcharacter{\dododohandlecompoundcharacter#1#2}%
- \futurelet\next\xdodohandlecompoundcharacter}
-
-%D Besides taken care of the grouping and space tokens, we have
-%D to deal with three situations. First we look if the next
-%D character equals the first one, if so, then we just insert
-%D the original. Next we look if indeed a compound character is
-%D defined. We either execute the compound character or just
-%D insert the first. So we have
-%D
-%D \starttyping
-%D <key><key> <key><known> <key><unknown>
-%D \stoptyping
-%D
-%D In later modules we will see how these commands are used.
-
-\long\def\handlecompoundcharacterone#1#2%
- {\if\string#1\string#2% was: \ifx#1#2%
- \def\next{\csname\@nc@\string#1\endcsname}%
- \else\ifcsname\@cc@\string#1\string#2\endcsname
- \def\next{\csname\@cc@\string#1\string#2\endcsname}%
- \else
- \def\next{\csname\@nc@\string#1\endcsname#2}%
- \fi\fi
- \next}
-
-\long\def\handlecompoundcharactertwo#1#2#3%
- {\if\string#1\string#2%
- \def\next{\csname\@nc@\string#1\endcsname#3}%
- \else\ifcsname\@cs@\string#1\string#2\string#3\endcsname
- \def\next{\csname\@cs@\string#1\string#2\string#3\endcsname}%
- \else\ifcsname\@cc@\string#1\string#2\endcsname
- \def\next{\csname\@cc@\string#1\string#2\endcsname#3}%
- \else
- \def\next{\csname\@nc@\string#1\endcsname#2#3}%
- \fi\fi\fi
- \next}
-
-%D For very obscure applications (see for an application \type
-%D {lang-sla.tex}) we provide:
-
-\def\simplifiedcompoundcharacter#1#2%
- {\ifcsname\@cc@\string#1\string#2\endcsname
- \@EA\@EA\@EA\firstofoneargument\csname\@cc@\string#1\string#2\endcsname
- \else
- #2%
- \fi}
-
-%D \macros
-%D {disablediscretionaries,disablecompoundcharacter}
-%D
-%D Occasionally we need to disable this mechanism. For the
-%D moment we assume that \type {|} is used.
-
-\let\disablediscretionaries \ignorediscretionaries
-\let\disablecompoundcharacters\ignorecompoundcharacter
-
-%D \macros
-%D {normalcompound}
-%D
-%D Handy in for instance XML. (Kind of obsolete)
-
-\ifx\normalcompound\undefined \let\normalcompound=| \fi
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/lang-run.mkii b/Master/texmf-dist/tex/context/base/mkii/lang-run.mkii
deleted file mode 100644
index 320ee8dabf6..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/lang-run.mkii
+++ /dev/null
@@ -1,36 +0,0 @@
-%D \module
-%D [ file=lang-run,
-%D version=2005.09.08,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Runtime Macros,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 code is hooked into the core macros and saves some
-%D format space.]
-
-\unprotect
-
-\gdef\showpatterns
- {\bgroup
- \def\doshowpatterns##1##2##3##4% language number encoding mapping
- {\NC##1\NC##3\NC##4\NC##2\NC
- \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
- \HL
- \preloadedpmessage
- \HL
- \stoptabulate
- \egroup}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/lang-sla.mkii b/Master/texmf-dist/tex/context/base/mkii/lang-sla.mkii
deleted file mode 100644
index 81f9a9bf711..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/lang-sla.mkii
+++ /dev/null
@@ -1,485 +0,0 @@
-%D \module
-%D [ file=lang-sla,
-%D version=1999.09.13, % 1997.09.03
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Slavic Languages,
-%D author=Hans Hagen / Tobias Burnus,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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: replace \'.. by \namedglyph
-
-%D The framework of this module is set up by Hans Hagen while
-%D many of the first translations were done by Tobias. Later
-%D on, corrections were made by users. If you have suggestions,
-%D or feel that your name missing here, don't hesitate to send
-%D us an email.
-%D
-%D \starttabulate[|lB|l|]
-%D \NC Czech \NC Tom Hudec, Petr Sojka \NC \NR
-%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,
-% Serbian, Croatian, Slovenian, Czech, Kushubian,
-% Lusatian/Sorbian/Wendish, Polish, Slovak, Albanian,
-% Illyrian, Armenian
-
-\writestatus{loading}{ConTeXt Language Macros / Slavic Languages}
-
-\unprotect
-
-\installlanguage
- [\s!pl]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\lowerleftsingleninequote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\lowerleftdoubleninequote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!day,{.},\ ,\v!month,\ ,\v!year},
- \s!mapping={pl0,ec,qx},
- \s!encoding={pl0,ec,qx}]
-
-\installlanguage
- [\s!cs]
- [\c!spacing=\v!packed,
- \c!leftsentence=\thickglue--\thickglue\penalty-20\relax, % hh, \relax added
- \c!rightsentence=\thickglue--\thickglue\penalty-20\relax,
- \c!leftsubsentence=~---~\penalty-20\relax,
- \c!rightsubsentence=~---~\penalty-20\relax,
- \c!leftquote=\lowerleftsingleninequote,
- \c!rightquote=\upperrightsinglesixquote,
- \c!leftquotation=\lowerleftdoubleninequote,
- \c!rightquotation=\upperrightdoublesixquote,
- \c!date={\v!day,{.\,},\v!month,\ ,\v!year},
- \s!mapping={il2,ec},
- \s!encoding={il2,ec}]
-
-\installlanguage
- [\s!sk]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\upperleftsinglesixquote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\upperleftdoublesixquote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!day,{.\,},\v!month,\ ,\v!year},
- \s!mapping={il2,ec},
- \s!encoding={il2,ec}]
-
-\installlanguage
- [\s!hr]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\lowerleftsingleninequote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\lowerleftdoubleninequote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!day,{.},\ ,\v!month,\ ,\v!year},
- \s!mapping=ec,
- \s!encoding=ec]
-
-%D The default quotation marks for Slovenian were chosen as
-%D \lowerleftdoubleninequote these ones\upperrightdoublesixquote\
-%D which was probably due to the strong influence computers
-%D had on typesetting, but \rightguillemot these ones\leftguillemot\
-%D are \quotation{more correct}.
-%D
-%D If you still want the other quotation marks, use this:
-%D
-%D \starttyping
-%D \installlanguage
-%D [sl]
-%D [leftquote=\lowerleftsingleninequote,
-%D rightquote=\upperrightsinglesixquote,
-%D leftquotation=\lowerleftdoubleninequote,
-%D rightquotation=\upperrightdoublesixquote]
-%D \stoptyping
-%D
-%D If you disagree with the change, please send an email to Mojca, but
-%D best use some pretty strong arguments because she loves S{\sl love}nia
-%D too much to compromise on this.
-%D
-%D German faces approximately the same problem. I (MM) would prefer to
-%D have something like:
-%D
-%D \starttyping
-%D \mainlanguage[sl][quotationstyle=guillemot|doublequote] % better name needed
-%D \stoptyping
-%D
-%D but users are expected to respect the rules of nice and correct
-%D typography anyway.
-
-\installlanguage
- [\s!sl]
- [\c!spacing=\v!packed,
- \c!leftsentence={\hbox{--~}},
- \c!rightsentence={\hbox{~--}},
- \c!leftsubsentence={--},
- \c!rightsubsentence={--},
- %\c!leftquote=\lowerleftsingleninequote,
- %\c!rightquote=\upperrightsinglesixquote,
- %\c!leftquotation=\lowerleftdoubleninequote,
- %\c!rightquotation=\upperrightdoublesixquote,
- \c!leftquote=\guilsingleright,
- \c!rightquote=\guilsingleleft,
- \c!leftquotation=\rightguillemot,
- \c!rightquotation=\leftguillemot,
- \c!date={\v!day,{.},\ ,\v!month,\ ,\v!year},
- \s!mapping=ec,
- \s!encoding=ec]
-
-\installlanguage [polish] [\s!pl]
-\installlanguage [czech] [\s!cs]
-\installlanguage [slovak] [\s!sk]
-\installlanguage [croatian] [\s!hr]
-\installlanguage [slovenian] [\s!sl]
-\installlanguage [slovene] [\s!sl] % both possible (mojca: still needed?)
-
-\installlanguage [cz] [\s!cs]
-
-% labels
-
-\setupheadtext [\s!pl] [\v!content=Spis tre\sacute ci]
-\setupheadtext [\s!cs] [\v!content=Obsah]
-\setupheadtext [\s!sk] [\v!content=Obsah]
-\setupheadtext [\s!hr] [\v!content=Sadr\zcaron aj]
-\setupheadtext [\s!sl] [\v!content=Kazalo]
-
-\setupheadtext [\s!pl] [\v!tables=Tabele]
-\setupheadtext [\s!cs] [\v!tables=Tabulky]
-\setupheadtext [\s!sk] [\v!tables=Tabuliek]
-\setupheadtext [\s!hr] [\v!tables=Tablice]
-\setupheadtext [\s!sl] [\v!tables=Tabele]
-
-\setupheadtext [\s!pl] [\v!figures=Ilustracje]
-\setupheadtext [\s!cs] [\v!figures=Obr\aacute zky]
-\setupheadtext [\s!sk] [\v!figures=Obr\aacute zkov]
-\setupheadtext [\s!hr] [\v!figures=Slike]
-\setupheadtext [\s!sl] [\v!figures=Slike]
-
-\setupheadtext [\s!pl] [\v!graphics=Grafika]
-\setupheadtext [\s!cs] [\v!graphics=Grafy]
-\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!cs] [\v!intermezzi=Intermezza]
-\setupheadtext [\s!sk] [\v!intermezzi=Intermezz\aacute]
-\setupheadtext [\s!hr] [\v!intermezzi=Intermeci]
-\setupheadtext [\s!sl] [\v!intermezzi=Intermezzi]
-
-\setupheadtext [\s!pl] [\v!index=Indeks]
-\setupheadtext [\s!cs] [\v!index=Rejst\rcaron\iacute k]
-\setupheadtext [\s!sk] [\v!index=Zoznam]
-\setupheadtext [\s!hr] [\v!index=Indeks]
-\setupheadtext [\s!sl] [\v!index=Stvarno kazalo]
-
-\setupheadtext [\s!pl] [\v!abbreviations=Skr\oacute cenie]
-\setupheadtext [\s!cs] [\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!cs] [\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!cs] [\v!units=Jednotky]
-\setupheadtext [\s!sk] [\v!units=Jednotky]
-\setupheadtext [\s!hr] [\v!units=Jedinice]
-\setupheadtext [\s!sl] [\v!units=Enote]
-
-%setupheadtext [\s!pl] [pubs=?]
-\setupheadtext [\s!cs] [pubs=Literatura]
-%setupheadtext [\s!sk] [pubs=?]
-\setupheadtext [\s!hr] [pubs=Literatura]
-\setupheadtext [\s!sl] [pubs=Literatura]
-
-\setuplabeltext [\s!pl] [\v!table=Tabela ]
-\setuplabeltext [\s!cs] [\v!table=Tabulka ]
-\setuplabeltext [\s!sk] [\v!table=Tabu\lcaron ka ]
-\setuplabeltext [\s!hr] [\v!table=Tablica ]
-\setuplabeltext [\s!sl] [\v!table=Tabela ]
-
-\setuplabeltext [\s!pl] [\v!figure=Ilustracja ]
-\setuplabeltext [\s!cs] [\v!figure=Obr\aacute zek ]
-\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!cs] [\v!intermezzo=Intermezzo ]
-\setuplabeltext [\s!sk] [\v!intermezzo=Intermezzo ]
-\setuplabeltext [\s!hr] [\v!intermezzo=Intermeco ]
-\setuplabeltext [\s!sl] [\v!intermezzo=Intermezzo ]
-
-\setuplabeltext [\s!pl] [\v!graphic=Grafika ]
-\setuplabeltext [\s!cs] [\v!graphic=Graf ]
-\setuplabeltext [\s!sk] [\v!graphic=Graf ]
-\setuplabeltext [\s!hr] [\v!graphic=Slika ]
-\setuplabeltext [\s!sl] [\v!graphic=Slika ]
-
-\setuplabeltext [\s!pl] [\v!chapter=] % Rozdzia\l
-\setuplabeltext [\s!cs] [\v!chapter=] % Kapitola
-\setuplabeltext [\s!sk] [\v!chapter=] % Kapitola
-\setuplabeltext [\s!hr] [\v!chapter=] % Poglavlje
-\setuplabeltext [\s!sl] [\v!chapter=] % Poglavje
-
-\setuplabeltext [\s!pl] [\v!section=] % Podrozdzia\l
-\setuplabeltext [\s!cs] [\v!section=] % Sekce
-\setuplabeltext [\s!sk] [\v!section=] % Sekcia
-\setuplabeltext [\s!hr] [\v!section=] % Odjeljak
-\setuplabeltext [\s!sl] [\v!section=]
-
-\setuplabeltext [\s!pl] [\v!subsection=]
-\setuplabeltext [\s!cs] [\v!subsection=] % Podsekce
-\setuplabeltext [\s!sk] [\v!subsection=] % Podsekcia
-\setuplabeltext [\s!hr] [\v!subsection=] % Pododjeljak
-\setuplabeltext [\s!sl] [\v!subsection=]
-
-\setuplabeltext [\s!pl] [\v!subsubsection=]
-\setuplabeltext [\s!cs] [\v!subsubsection=] % Podpodsekce
-\setuplabeltext [\s!sk] [\v!subsubsection=] % Podpodsekcia
-\setuplabeltext [\s!hr] [\v!subsubsection=] % Podpododjeljak
-\setuplabeltext [\s!sl] [\v!subsubsection=]
-
-\setuplabeltext [\s!pl] [\v!subsubsubsection=]
-\setuplabeltext [\s!cs] [\v!subsubsubsection=] % Podpodpodsekce
-\setuplabeltext [\s!sk] [\v!subsubsubsection=] % Podpodpodsekcia
-\setuplabeltext [\s!hr] [\v!subsubsubsection=] % Podpodpododjeljak
-\setuplabeltext [\s!sl] [\v!subsubsubsection=]
-
-\setuplabeltext [\s!pl] [\v!appendix=] % Dodatek
-\setuplabeltext [\s!cs] [\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
-
-\setuplabeltext [\s!pl] [\v!part=Ust\eogonek p ]
-\setuplabeltext [\s!cs] [\v!part=\Ccaron \aacute st ]
-\setuplabeltext [\s!sk] [\v!part=\Ccaron as\tcaron{} ]
-\setuplabeltext [\s!hr] [\v!part=Dio ]
-\setuplabeltext [\s!sl] [\v!part=Del ]
-
-\setuplabeltext [\s!pl] [\v!line=wiersz ]
-\setuplabeltext [\s!cs] [\v!line=\rcaron\aacute dek ]
-\setuplabeltext [\s!sk] [\v!line=riadok ]
-\setuplabeltext [\s!hr] [\v!line=redak ]
-\setuplabeltext [\s!sl] [\v!line=vrstica ]
-
-\setuplabeltext [\s!pl] [\v!lines=wiersze ]
-\setuplabeltext [\s!cs] [\v!lines=\rcaron\aacute dky ]
-\setuplabeltext [\s!sk] [\v!lines=riadky ]
-\setuplabeltext [\s!hr] [\v!lines=retci ]
-\setuplabeltext [\s!sl] [\v!lines=vrstice ]
-
-\setuplabeltext [\s!pl] [\v!january=stycznia]
-\setuplabeltext [\s!pl] [\v!february=lutego]
-\setuplabeltext [\s!pl] [\v!march=marca]
-\setuplabeltext [\s!pl] [\v!april=kwietnia]
-\setuplabeltext [\s!pl] [\v!may=maja]
-\setuplabeltext [\s!pl] [\v!june=czerwca]
-\setuplabeltext [\s!pl] [\v!july=lipca]
-\setuplabeltext [\s!pl] [\v!august=sierpnia]
-\setuplabeltext [\s!pl] [\v!september=wrze\sacute nia]
-\setuplabeltext [\s!pl] [\v!october=pa\zacute dziernika]
-\setuplabeltext [\s!pl] [\v!november=listopada]
-\setuplabeltext [\s!pl] [\v!december=grudnia]
-
-\setuplabeltext [\s!cs] [\v!january=ledna]
-\setuplabeltext [\s!cs] [\v!february=\uacute nora]
-\setuplabeltext [\s!cs] [\v!march=b\rcaron ezna]
-\setuplabeltext [\s!cs] [\v!april=dubna]
-\setuplabeltext [\s!cs] [\v!may=kv\ecaron tna]
-\setuplabeltext [\s!cs] [\v!june=\ccaron ervna]
-\setuplabeltext [\s!cs] [\v!july=\ccaron ervence]
-\setuplabeltext [\s!cs] [\v!august=srpna]
-\setuplabeltext [\s!cs] [\v!september=z\aacute\rcaron\iacute{}]
-\setuplabeltext [\s!cs] [\v!october=\rcaron\iacute jna]
-\setuplabeltext [\s!cs] [\v!november=listopadu]
-\setuplabeltext [\s!cs] [\v!december=prosince]
-
-\setuplabeltext [\s!sk] [\v!january=janu\aacute ra]
-\setuplabeltext [\s!sk] [\v!february=febru\aacute ra]
-\setuplabeltext [\s!sk] [\v!march=marca]
-\setuplabeltext [\s!sk] [\v!april=apr\iacute la]
-\setuplabeltext [\s!sk] [\v!may=m\aacute ja]
-\setuplabeltext [\s!sk] [\v!june=j\uacute na]
-\setuplabeltext [\s!sk] [\v!july=j\uacute la]
-\setuplabeltext [\s!sk] [\v!august=augusta]
-\setuplabeltext [\s!sk] [\v!september=septembra]
-\setuplabeltext [\s!sk] [\v!october=okt\oacute bra]
-\setuplabeltext [\s!sk] [\v!november=novembra]
-\setuplabeltext [\s!sk] [\v!december=decembra]
-
-\setuplabeltext [\s!hr] [\v!january=sije\ccaron anj]
-\setuplabeltext [\s!hr] [\v!february=velja\ccaron a]
-\setuplabeltext [\s!hr] [\v!march=o\zcaron ujak]
-\setuplabeltext [\s!hr] [\v!april=travanj]
-\setuplabeltext [\s!hr] [\v!may=svibanj]
-\setuplabeltext [\s!hr] [\v!june=lipanj]
-\setuplabeltext [\s!hr] [\v!july=srpanj]
-\setuplabeltext [\s!hr] [\v!august=kolovoz]
-\setuplabeltext [\s!hr] [\v!september=rujan]
-\setuplabeltext [\s!hr] [\v!october=listopad]
-\setuplabeltext [\s!hr] [\v!november=studeni]
-\setuplabeltext [\s!hr] [\v!december=prosinac]
-
-\setuplabeltext [\s!sl] [\v!january=januar]
-\setuplabeltext [\s!sl] [\v!february=februar]
-\setuplabeltext [\s!sl] [\v!march=marec]
-\setuplabeltext [\s!sl] [\v!april=april]
-\setuplabeltext [\s!sl] [\v!may=maj]
-\setuplabeltext [\s!sl] [\v!june=junij]
-\setuplabeltext [\s!sl] [\v!july=julij]
-\setuplabeltext [\s!sl] [\v!august=avgust]
-\setuplabeltext [\s!sl] [\v!september=september]
-\setuplabeltext [\s!sl] [\v!october=oktober]
-\setuplabeltext [\s!sl] [\v!november=november]
-\setuplabeltext [\s!sl] [\v!december=december]
-
-\setuplabeltext [\s!pl] [\v!sunday=niedziela]
-\setuplabeltext [\s!pl] [\v!monday=poniedzia\lstroke ek]
-\setuplabeltext [\s!pl] [\v!tuesday=wtorek]
-\setuplabeltext [\s!pl] [\v!wednesday=\sacute roda]
-\setuplabeltext [\s!pl] [\v!thursday=czwartek]
-\setuplabeltext [\s!pl] [\v!friday=pi\aogonek tek]
-\setuplabeltext [\s!pl] [\v!saturday=sobota]
-
-\setuplabeltext [\s!cs] [\v!sunday=ned\ecaron le]
-\setuplabeltext [\s!cs] [\v!monday=pond\ecaron l\iacute]
-\setuplabeltext [\s!cs] [\v!tuesday=\uacute ter\yacute]
-\setuplabeltext [\s!cs] [\v!wednesday=st\rcaron eda]
-\setuplabeltext [\s!cs] [\v!thursday=\ccaron tvrtek]
-\setuplabeltext [\s!cs] [\v!friday=p\aacute tek]
-\setuplabeltext [\s!cs] [\v!saturday=sobota]
-
-% Slovakian missing
-
-\setuplabeltext [\s!hr] [\v!sunday=nedjelja]
-\setuplabeltext [\s!hr] [\v!monday=ponedjeljak]
-\setuplabeltext [\s!hr] [\v!tuesday=utorak]
-\setuplabeltext [\s!hr] [\v!wednesday=srijeda]
-\setuplabeltext [\s!hr] [\v!thursday=\ccaron etvrtak]
-\setuplabeltext [\s!hr] [\v!friday=petak]
-\setuplabeltext [\s!hr] [\v!saturday=subota]
-
-\setuplabeltext [\s!sl] [\v!sunday=nedelja]
-\setuplabeltext [\s!sl] [\v!monday=ponedeljek]
-\setuplabeltext [\s!sl] [\v!tuesday=torek]
-\setuplabeltext [\s!sl] [\v!wednesday=sreda]
-\setuplabeltext [\s!sl] [\v!thursday=\ccaron etrtek]
-\setuplabeltext [\s!sl] [\v!friday=petek]
-\setuplabeltext [\s!sl] [\v!saturday=sobota]
-
-%D Rather new ...
-%\installlanguage
-% [\s!cs]
-% [\c!spacing=\v!packed,
-% \c!leftsentence=---,
-% \c!rightsentence=---,
-% \c!leftsubsentence=---,
-% \c!rightsubsentence=---,
-% \c!leftquote=\lowerleftsingleninequote,
-% \c!rightquote=\upperrightsinglesixquote,
-% \c!leftquotation=\lowerleftdoubleninequote,
-% \c!rightquotation=\upperrightdoublesixquote,
-% \c!date={\v!day,\ ,\v!month,\ ,\v!year}]
-
-% Polish missing
-
-\setuplabeltext [\s!cs] [\v!page=strana ]
-\setuplabeltext [\s!cs] [\v!atpage=na stran\ecaron\ ]
-\setuplabeltext [\s!cs] [\v!hencefore=viz v\yacute\scaron e ]
-\setuplabeltext [\s!cs] [\v!hereafter=viz n\iacute\zcaron e ]
-\setuplabeltext [\s!cs] [\v!see=viz ]
-
-% Slovakian missing
-
-\setuplabeltext [\s!hr] [\v!page=stranica ]
-\setuplabeltext [\s!hr] [\v!atpage=na stranici ]
-\setuplabeltext [\s!hr] [\v!hencefore=vidi gore ]
-\setuplabeltext [\s!hr] [\v!hereafter=vidi ispod ]
-\setuplabeltext [\s!hr] [\v!see=vidi ]
-
-\setuplabeltext [\s!sl] [\v!page=stran ]
-\setuplabeltext [\s!sl] [\v!atpage=na strani ]
-\setuplabeltext [\s!sl] [\v!hencefore=glej zgoraj ]
-\setuplabeltext [\s!sl] [\v!hereafter=glej spodaj ]
-\setuplabeltext [\s!sl] [\v!see=glej ]
-
-%D \ShowAllLanguageValues [\s!pl] [polish] {Polish} {furniture}
-%D \ShowAllLanguageValues [\s!cs] [czech] {Czech} {mate}
-%D \ShowAllLanguageValues [\s!sk] [slovak] {Slovakian} {face}
-%D \ShowAllLanguageValues [\s!hr] [croatian] {Croatian} {heartthrob}
-%D \ShowAllLanguageValues [\s!sl] [slovenian] {Slovenian} {mountains}
-
-%D A present from Brooks Moses and Hans Hagen for Mojca Miklavec:
-
-\def\doconvertsloveniancharacters{\dodoconvertcharacters{25}}
-
-\def\sloveniancharacters{\doconvertsloveniancharacters\sloveniancharacter}
-\def\slovenianCharacters{\doconvertsloveniancharacters\slovenianCharacter}
-
-%D Define general-purpose macros for Slovenian character enumerations:
-
-\defineconversion [sloveniancharacter] [\sloveniancharacter]
-\defineconversion [slovenianCharacter] [\slovenianCharacter]
-
-\defineconversion [sloveniancharacters] [\sloveniancharacters]
-\defineconversion [slovenianCharacters] [\slovenianCharacters]
-
-%D Define these as the general character enumeration when
-%D language is Slovenian. If you feel uncomfortable with this,
-%D mail Mojca, since she promised to to take the heat.
-
-\defineconversion [sl] [character] [\sloveniancharacter]
-\defineconversion [sl] [Character] [\slovenianCharacter]
-
-\defineconversion [sl] [characters] [\sloveniancharacters]
-\defineconversion [sl] [Characters] [\slovenianCharacters]
-
-\defineconversion [sl] [a] [\sloveniancharacters]
-\defineconversion [sl] [A] [\slovenianCharacters]
-\defineconversion [sl] [AK] [\smallcapped\sloveniancharacters]
-\defineconversion [sl] [KA] [\smallcapped\sloveniancharacters]
-
-\def\sloveniancharacter#1%
- {\ifcase#1\unknowncharacter
- \or a\or b\or c\or \ccaron\or d\or e\or f\or g\or h\or i\or j\or k\or l\or m%
- \or n\or o\or p\or r\or s\or \scaron\or t\or u\or v\or z\or \zcaron
- \else
- \unknowncharacter
- \fi}
-
-\def\slovenianCharacter#1%
- {\ifcase#1\unknowncharacter
- \or A\or B\or C\or \Ccaron\or D\or E\or F\or G\or H\or I\or J\or K\or L\or M%
- \or N\or O\or P\or R\or S\or \Scaron\or T\or U\or V\or Z\or \Zcaron
- \else
- \unknowncharacter
- \fi}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/lang-spa.mkii b/Master/texmf-dist/tex/context/base/mkii/lang-spa.mkii
deleted file mode 100644
index 313e5f3e6e7..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/lang-spa.mkii
+++ /dev/null
@@ -1,74 +0,0 @@
-%D \module
-%D [ file=lang-spa,
-%D version=2002.04.17,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Spacing,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Language Macros / Spacing}
-
-%D This module was created in the process of enhancing
-%D support for French (with the help of Daniel Flipo).
-
-\unprotect
-
-\definehspace [\s!fr] [quotation] [\flexiblespaceamount{.8}{.3}{.8}]
-\definehspace [\s!fr] [sentence] [\fixedspaceamount{1}]
-
-%definehspace [\s!fr] [quote] [\flexiblespaceamount{.8}{.3}{.8}]
-%definehspace [\s!fr] [speech] [\flexiblespaceamount{.8}{.3}{.8}]
-
-\definehspace [\s!fr] [interquotation] [\zeropoint]
-\definehspace [\s!fr] [intersentence] [\zeropoint]
-
-\definehspace [\string :] [\zeropoint]
-\definehspace [\string ;] [\zeropoint]
-\definehspace [\string !] [\zeropoint]
-\definehspace [\string ?] [\zeropoint]
-
-\definehspace [\s!fr] [\string :] [\spaceamount]
-\definehspace [\s!fr] [\string ;] [.16667em]
-\definehspace [\s!fr] [\string !] [.16667em]
-\definehspace [\s!fr] [\string ?] [.16667em]
-
-%D Alternative discretionary handlers:
-
-\definetextmodediscretionary :
- {\removeunwantedspaces\prewordbreak\kern\hspaceamount\currentlanguage{:}:}
-
-\definetextmodediscretionary ;
- {\removeunwantedspaces\prewordbreak\kern\hspaceamount\currentlanguage{;};}
-
-\definetextmodediscretionary ?
- {\removeunwantedspaces\prewordbreak\kern\hspaceamount\currentlanguage{?}?}
-
-\definetextmodediscretionary !
- {\removeunwantedspaces\prewordbreak\kern\hspaceamount\currentlanguage{!}!}
-
-%D \startbuffer
-%D \mainlanguage[en] \quotation{test \quotation{test} test}\par
-%D \mainlanguage[nl] \quotation{test \quotation{test} test}\par
-%D \mainlanguage[fr] \quotation{test \quotation{test} test}\par
-%D
-%D \mainlanguage[en] \quotation{\quotation{test} test}\par
-%D \mainlanguage[nl] \quotation{\quotation{test} test}\par
-%D \mainlanguage[fr] \quotation{\quotation{test} test}\par
-%D
-%D \mainlanguage[en] |<|test |<|test|>| test|>| \par
-%D \mainlanguage[nl] |<|test |<|test|>| test|>| \par
-%D \mainlanguage[fr] |<|test |<|test|>| test|>| \par
-%D
-%D \mainlanguage[en] |<||<|test|>| test|>| \par
-%D \mainlanguage[nl] |<||<|test|>| test|>| \par
-%D \mainlanguage[fr] |<||<|test|>| test|>| \par
-%D \stopbuffer
-%D
-%D \typebuffer {\getbuffer}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/lang-spe.mkii b/Master/texmf-dist/tex/context/base/mkii/lang-spe.mkii
deleted file mode 100644
index 11c57af3f23..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/lang-spe.mkii
+++ /dev/null
@@ -1,244 +0,0 @@
-%D \module
-%D [ file=lang-spe,
-%D version=2002.05.07, % 1996.01.25,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Specifics,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 code was originally placed in the language
-%D initialization module, but isolating it is clearer. Language
-%D specifics evolved out of user demands for special features,
-%D like the german active quote. After a while I decided to
-%D associate them to languages in a more general way so that we
-%D could associate all kind of things with language switching.
-%D
-%D This is a typical example of functionality that occasionally
-%D gets improved based on user input and experience. Much of the
-%D code is pretty old and could probabbly be done in better ways.
-%D It's probably also the kind of code that has been and will be
-%D written over and over again by \TEX\ users around the world,
-%D so there are probably better implementations of similar
-%D functionality around. Therefore, users are invited to pop in
-%D their own handling as long as it does not interfere with
-%D existing code. Writing the more obscure macros that deal with
-%D this is a good learning experience (catcodes, lccodes, token
-%D lists, expansion, \unknown).
-
-\writestatus{loading}{ConTeXt Language Macros / Specifics}
-
-\unprotect
-
-%D \macros
-%D {everyresetlanguagespecifics,resetlanguagespecifics}
-%D
-%D Cleanup macros.
-
-\newevery \everyresetlanguagespecifics \relax
-
-\def\resetlanguagespecifics
- {\ifcase\protectionlevel
- \the\everyresetlanguagespecifics
- \else % to be translated
- % \writestatus\m!systems{don't change language in unprotected mode!}%
- \fi}
-
-\appendtoks
- \resetlanguagespecifics
-\to \everycleanupfeatures
-
-%D \macros
-%D {startlanguagespecifics,enablelanguagespecifics}
-%D
-%D Each language has its own typographic pecularities. Some of
-%D those can be influenced by parameters, others are handled by
-%D the interface, but as soon as specific commands come into
-%D view we need another mechanism. In the macro that activates
-%D a language, we call \type{\enablelanguagespecifics}. This
-%D macro in return calls for the setup of language specific
-%D macros. Such specifics are defined as:
-%D
-%D \starttyping
-%D \startlanguagespecifics[de]
-%D \installcompoundcharacter "a {\"a}
-%D \installcompoundcharacter "e {\"e}
-%D \installcompoundcharacter "s {\SS}
-%D \stoplanguagespecifics
-%D \stoptyping
-%D
-%D Instead of \type{[du]} we can pass a comma separated
-%D list, like \type{[du,nl]}. Next calls to this macro add the
-%D specifics to the current list.
-%D
-%D Before we actually read the specifics, we first take some
-%D precautions that will prevent spurious spaces to creep into
-%D the list.
-
-% We should use token registers, but alas, we run out of them and
-% \ETEX\ has a bug. Well, let's use a token register now (2006).
-
-\def\startlanguagespecifics% % we use double to
- {\bgroup
- \catcode`\^^I=\@@ignore
- \catcode`\^^M=\@@ignore
- \catcode`\^^L=\@@ignore
- \dodoubleempty\dostartlanguagespecifics} % get rid of spaces
-
-%D The main macro looks quite complicated but actually does
-%D nothing special. By embedding \type{\do} we can easily
-%D append to the lists and also execute them at will. Just to
-%D be sure, we check on spurious spaces. The second dummy
-%D argument gobbles spaces.
-
-\def\languageencoding
- {\ifx\characterencoding\nocharacterencoding \else
- \characterencoding-%
- \fi}
-
-\long\def\dostartlanguagespecifics[#1][#2]#3\stoplanguagespecifics
- {\egroup
- \processcommalist[#1]{\dosetlanguagespecifics{#3}}}
-
-% \long\def\dosetlanguagespecifics#1#2%
-% {\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]}%
-% \ifdim\wd\scratchbox>\zeropoint
-% \showmessage\m!linguals7{\currentencoding-#2,\the\wd\scratchbox\space}\wait
-% \else
-% \showmessage\m!linguals8{\currentencoding-#2}%
-% \fi
-% \egroup
-% \doif{#2}\currentmainlanguage{\enablelanguagespecifics[#2]}}
-
-\def\languagespectag#1{\??la\languageencoding#1\??la}
-
-\long\def\dosetlanguagespecifics#1#2%
- {\edef\askedlanguagespecificstag{\languagespectag{#2}}%
- \ifcsname\askedlanguagespecificstag\endcsname \else
- \expandafter\newtoks\csname\askedlanguagespecificstag\endcsname
- \fi
- \csname\askedlanguagespecificstag\endcsname\@EA{\the\csname\askedlanguagespecificstag\endcsname#1}%
- \bgroup
- \setbox\scratchbox\hbox{\enablelanguagespecifics[#2]}%
- \ifdim\wd\scratchbox>\zeropoint
- \showmessage\m!linguals7{\currentencoding-#2,\the\wd\scratchbox\space}\wait
- \else
- \showmessage\m!linguals8{\currentencoding-#2}%
- \fi
- \egroup
- \doif{#2}\currentmainlanguage{\enablelanguagespecifics[#2]}}
-
-\def\forgetlanguagespecifics[#1]%
- {\csname\languagespectag{#1}\endcsname\emptytoks}
-
-%D Enabling them is rather straightforward. We only have to
-%D define \type{\do} in such a way that \type{{ }} is removed
-%D and the language key is gobbled.
-
-% \def\enablelanguagespecifics[#1]%
-% {\the\executeifdefined{\??la
-% \@EA\ifx\csname\??la#1\c!default\endcsname\relax
-% \languageencoding
-% \else
-% \csname\??la#1\c!default\endcsname
-% \fi
-% \??la}\emptytoks
-% \the\executeifdefined{\??la#1\??la}\emptytoks
-% \the\executeifdefined{\??la\languageencoding#1\??la}\emptytoks} % dup ?
-
-\def\enablelanguagespecifics[#1]%
- {\edef\askedlanguagespecificslanguage{\defaultlanguage{#1}}%
- \ifcsname\??la\askedlanguagespecificslanguage\??la\endcsname
- \the\csname\??la\askedlanguagespecificslanguage\??la\endcsname
- \fi
- \ifx\languageencoding\empty\else
- \ifcsname\??la\languageencoding\askedlanguagespecificslanguage\??la\endcsname
- \the\csname\??la\languageencoding\askedlanguagespecificslanguage\??la\endcsname
- \fi
- \fi}
-
-%D \macros
-%D {deactivatelanguagespecific}
-%D
-%D The next code makes it possible to disable the specifics.
-
-% \def\deactivatelanguagespecific#1%
-% {\ifundefined{l g s \string#1}%
-% \letgvalueempty{l g s \string#1}% signal to prevent dup def
-% \bgroup
-% \catcode`#1=\@@active
-% \uccode`~=`#1
-% \uppercase{\doglobal\appendtoks\dodeactivatetoken{~}\to\everyresetlanguagespecifics}%
-% \egroup
-% \expanded{\doglobal\noexpand\appendtoks{#1}{\the\catcode`#1}}\to\everyresetlanguagespecifics
-% \fi}
-
-% \def\dodeactivatetoken#1#2#3% test needed to avoid clash with \unprotect
-% {\def#1{#2}\ifnum\catcode`#2=\@@active\catcode`#2=#3\relax\fi}
-
-%D We cannot hook this into the installer since language
-%D specifics can be anything. So far, we have the following
-%D potentially active characters.
-
-%D Beware, this should happen under an unprotected regime;
-%D thanks to Giuseppe Oblomov Bilotta, who first noticed
-%D that something was wrong.
-
-\protect
-
-% \deactivatelanguagespecific "
-% \deactivatelanguagespecific /
-% \deactivatelanguagespecific :
-% \deactivatelanguagespecific ;
-% \deactivatelanguagespecific ?
-% \deactivatelanguagespecific !
-
-\unprotect
-
-% yes or no (taco wins: no)
-
-% \startlanguagespecifics[nl,cs,sk,fr]
-% \lccode`\'=`\'
-% \stoplanguagespecifics
-
-%D \macros
-%D {ordinaldaynumber, highordinalstr, ordinalstr}
-%D
-%D Efficient general ordinal number converters are sometimes
-%D difficult to implement. Fortunately dates never exceed the
-%D number~31.
-
-\ifx\high \undefined \let\high \firstofoneargument \fi % todo
-\ifx\notsmallcapped\undefined \let\notsmallcapped\firstofoneargument \fi % todo
-
-\def\highordinalstr#1{\high{\notsmallcapped{#1}}}
-\def\ordinalstr #1{\notsmallcapped{#1}}
-
-\def\ordinaldaynumber#1% \strippedcsname\ordinaldaynumber
- {\expanded{\executeifdefined{\currentlanguage ordinaldaynumber}%
- \noexpand\firstofoneargument{\number#1}}}
-
-%D Language specific converters have definitions like:
-%D
-%D \starttyping
-%D \def\enordinaldaynumber#1{...}
-%D \stoptyping
-%D
-%D Examples can be found in the other \type {lang} modules.
-
-% \ifprocessingXML is a nasty dependency
-
-\appendtoks
- \ifprocessingXML \else \resetlanguagespecifics \fi
-\to \everylanguage
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/lang-ura.mkii b/Master/texmf-dist/tex/context/base/mkii/lang-ura.mkii
deleted file mode 100644
index 21bc8d94a74..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/lang-ura.mkii
+++ /dev/null
@@ -1,158 +0,0 @@
-%D \module
-%D [ file=lang-sla,
-%D version=1997.09.03,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Uralic Languages,
-%D author=Hans Hagen / Tobias Burnus,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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: replace \'.. by \namedglyph
-
-\writestatus{loading}{ConTeXt Language Macros / Uralic Languages}
-
-%D The framework of this module is set up by Hans Hagen while
-%D many of the first translations were done by Tobias. Later
-%D on, corrections were made by users. If you have suggestions,
-%D or feel that your name missing here, don't hesitate to send
-%D us an email.
-%D
-%D \starttabulate[|lB|l|]
-%D \NC Finnish \NC \NC \NR
-%D \NC Hungarian \NC Balazs Nagy \NC \NR
-%D \stoptabulate
-
-% Cheremiss, Estonian, Finnish, Karelian, Laap, Mordvinian,
-% Permian tongues, Hungarian, Ostyak, Vogul, Samoyed
-
-\unprotect
-
-\installlanguage
- [\s!fi]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\upperleftsinglesixquote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\upperleftdoublesixquote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!year,\ ,\v!month,\ ,\v!day}]
-
-\installlanguage
- [\s!hu]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\lowerleftsingleninequote,
- \c!rightquote=\upperrightsingleninequote,
- \c!leftquotation=\lowerleftdoubleninequote,
- \c!rightquotation=\upperrightdoubleninequote,
- \c!date={\v!year,.,\ ,\v!month,\ ,\v!day,.},
- \s!mapping=ec,
- \s!encoding=ec]
-
-\installlanguage [finish] [\s!fi]
-\installlanguage [hungarian] [\s!hu]
-
-\setupheadtext [\s!fi] [\v!content=Sis\"allys]
-\setupheadtext [\s!fi] [\v!tables=Taulukkoj]
-\setupheadtext [\s!fi] [\v!figures=Kuvi]
-\setupheadtext [\s!fi] [\v!graphics=Grafiikkaoi]
-\setupheadtext [\s!fi] [\v!intermezzi=Intermezzos]
-\setupheadtext [\s!fi] [\v!index=Indeksiluku]
-\setupheadtext [\s!fi] [\v!abbreviations=Lyhennyksi]
-\setupheadtext [\s!fi] [\v!logos=Vertauskuva]
-\setupheadtext [\s!fi] [\v!units=Yksik\"ot]
-
-\setupheadtext [\s!hu] [\v!content=Tartalom]
-\setupheadtext [\s!hu] [\v!tables=T\'abl\'azatok]
-\setupheadtext [\s!hu] [\v!figures=\'Abr\'ak]
-\setupheadtext [\s!hu] [\v!graphics=Grafik\'ak]
-\setupheadtext [\s!hu] [\v!intermezzi=Intermezzok]
-\setupheadtext [\s!hu] [\v!index=Index]
-\setupheadtext [\s!hu] [\v!abbreviations=R\"ovid\'it\'esek]
-\setupheadtext [\s!hu] [\v!logos=Fejl\'ecek]
-\setupheadtext [\s!hu] [\v!units=M\'ert\'ekegys\'egek]
-
-\setuplabeltext [\s!fi] [\v!table=Taulukko ]
-\setuplabeltext [\s!fi] [\v!figure=Kuva ]
-\setuplabeltext [\s!fi] [\v!intermezzo=Intermezzo ]
-\setuplabeltext [\s!fi] [\v!graphic=Grafiikka ]
-\setuplabeltext [\s!fi] [\v!chapter=]
-\setuplabeltext [\s!fi] [\v!section=]
-\setuplabeltext [\s!fi] [\v!subsection=]
-\setuplabeltext [\s!fi] [\v!subsubsection=]
-\setuplabeltext [\s!fi] [\v!subsubsubsection=]
-\setuplabeltext [\s!fi] [\v!appendix=]
-\setuplabeltext [\s!fi] [\v!part=Osa ]
-\setuplabeltext [\s!fi] [\v!line=rivi ]
-\setuplabeltext [\s!fi] [\v!lines=rivie ]
-
-\setuplabeltext [\s!hu] [\v!table={,.~t\'abl\'azat:}]
-\setuplabeltext [\s!hu] [\v!figure={,.~\'abra:}]
-\setuplabeltext [\s!hu] [\v!intermezzo={,.~intermezzo:}]
-\setuplabeltext [\s!hu] [\v!graphic={,.~k\'ep:}]
-\setuplabeltext [\s!hu] [\v!chapter={,.~fejezet:}]
-\setuplabeltext [\s!hu] [\v!section={,.}]
-\setuplabeltext [\s!hu] [\v!subsection={,.}]
-\setuplabeltext [\s!hu] [\v!subsubsection={,.}]
-\setuplabeltext [\s!hu] [\v!subsubsubsection={,.}]
-\setuplabeltext [\s!hu] [\v!appendix=]
-\setuplabeltext [\s!hu] [\v!part={,.~r\'esz:}]
-\setuplabeltext [\s!hu] [\v!line={,.~sor:}]
-\setuplabeltext [\s!hu] [\v!lines=sorok]
-
-\setuplabeltext [\s!fi] [\v!january=tammikuu]
-\setuplabeltext [\s!fi] [\v!february=helmikuu]
-\setuplabeltext [\s!fi] [\v!march=maaliskuu]
-\setuplabeltext [\s!fi] [\v!april=huhtikuu]
-\setuplabeltext [\s!fi] [\v!may=toukokuu]
-\setuplabeltext [\s!fi] [\v!june=kes\"akuu]
-\setuplabeltext [\s!fi] [\v!july=hein\"akuu]
-\setuplabeltext [\s!fi] [\v!august=elokuu]
-\setuplabeltext [\s!fi] [\v!september=syyskuu]
-\setuplabeltext [\s!fi] [\v!october=lokakuu]
-\setuplabeltext [\s!fi] [\v!november=marraskuu]
-\setuplabeltext [\s!fi] [\v!december=joulukuu]
-
-\setuplabeltext [\s!hu] [\v!january=janu\'ar]
-\setuplabeltext [\s!hu] [\v!february=febru\'ar]
-\setuplabeltext [\s!hu] [\v!march=m\'arcius]
-\setuplabeltext [\s!hu] [\v!april=\'aprilis]
-\setuplabeltext [\s!hu] [\v!may=m\'ajus]
-\setuplabeltext [\s!hu] [\v!june=j\'unius]
-\setuplabeltext [\s!hu] [\v!july=j\'ulius]
-\setuplabeltext [\s!hu] [\v!august=augusztus]
-\setuplabeltext [\s!hu] [\v!september=szeptember]
-\setuplabeltext [\s!hu] [\v!october=okt\'ober]
-\setuplabeltext [\s!hu] [\v!november=november]
-\setuplabeltext [\s!hu] [\v!december=december]
-
-\setuplabeltext [\s!fi] [\v!sunday=sunnuntai]
-\setuplabeltext [\s!fi] [\v!monday=maanantai]
-\setuplabeltext [\s!fi] [\v!tuesday=tiistai]
-\setuplabeltext [\s!fi] [\v!wednesday=keskiviikko]
-\setuplabeltext [\s!fi] [\v!thursday=torstai]
-\setuplabeltext [\s!fi] [\v!friday=perjantai]
-\setuplabeltext [\s!fi] [\v!saturday=lauantai]
-
-\setuplabeltext [\s!hu] [\v!sunday=vas\'arnap]
-\setuplabeltext [\s!hu] [\v!monday=h\'etf\H{o}]
-\setuplabeltext [\s!hu] [\v!tuesday=kedd]
-\setuplabeltext [\s!hu] [\v!wednesday=szerda]
-\setuplabeltext [\s!hu] [\v!thursday=cs\"ut\"ort\"ok]
-\setuplabeltext [\s!hu] [\v!friday=p\'entek]
-\setuplabeltext [\s!hu] [\v!saturday=szombat]
-
-%D \ShowAllLanguageValues [\s!fi] [finnish] {Finnish} {phone}
-%D \ShowAllLanguageValues [\s!hu] [hungarian] {Hungarian} {rhapsody}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/lang-url.mkii b/Master/texmf-dist/tex/context/base/mkii/lang-url.mkii
deleted file mode 100644
index 1f340ffb0e4..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/lang-url.mkii
+++ /dev/null
@@ -1,306 +0,0 @@
-%D \module
-%D [ file=lang-url,
-%D version=2008.01.22, % used to be lang-mis
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Language Options,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\unprotect
-
-%D This is rather old code. The following solution was used
-%D for a long time and is kind of built-up over the years.
-
-\ifx\\\undefined \let\\\crlf \fi
-
-%D \macros
-%D {hyphenatedurl}
-%D
-%D For those who want to put full \URL's in a text, we offer
-%D
-%D \startbuffer
-%D \hyphenatedurl{http://optimist.optimist/optimist/optimist.optimist#optimist}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D which breaks at the appropriate places. Watch the \type{#}
-%D hack.
-%D
-%D When passed as argument, like in \type {\goto}, one needs
-%D to substitute a \type {\\} for each \type{#}.
-%D
-%D \startbuffer
-%D \hyphenatedurl{http://this.is.a.rather/strange/reference#indeed}
-%D \stopbuffer
-%D
-%D \typebuffer
-
-\ifx\urlsplitmode\undefined \chardef\urlsplitmode\plusone \fi
-
-% 0 => don't split
-% 1 => . : na, rest voor
-% 2 => alles na
-% 3 => alles voor
-
-% \bgroup \catcode`\~=\active \catcode`\/=\active
-%
-% \unexpanded\gdef\hyphenatedurl#1% {}{} handles accents
-% {\bgroup
-% \ifnum\hyphenpenalty<10000 \else
-% \def\discretionary##1##2##3{##1\allowbreak##2}%
-% \fi
-% \obeyhyphens
-% \def\splitbefore##1%
-% {\setbox\scratchbox=\hbox{##1{}{}}%
-% \ifcase\urlsplitmode
-% \box\scratchbox
-% \or
-% \postwordbreak\box\scratchbox\prewordbreak
-% \or
-% \prewordbreak\discretionary{\box\scratchbox}{}{\box\scratchbox}\prewordbreak
-% \else
-% \postwordbreak\box\scratchbox\prewordbreak
-% \fi}%
-% \def\splitafter##1%
-% {\ifcase\urlsplitmode
-% ##1{}{}%
-% \or
-% \prewordbreak\discretionary{##1{}{}}{}{##1{}{}}\prewordbreak
-% \or
-% \prewordbreak\discretionary{##1{}{}}{}{##1{}{}}\prewordbreak
-% \else
-% \prewordbreak\discretionary{}{##1{}{}}{##1{}{}}\prewordbreak
-% \fi}%
-% \def\splitanyway##1%
-% {\prewordbreak##1\prewordbreak}%
-% \def\flushurl%
-% {\savedurl\let\savedurl\empty}%
-% \def\\%
-% {\spliturl\#}%
-% \let\~=\lettertilde\let~=\~%
-% \let\/=\letterslash\let/=\/%
-% \let\savedurl\empty
-% \scratchcounter\zerocount % used for hyphenmethod
-% \handletokens#1\with\scanurl\savedurl
-% \egroup}
-%
-% \egroup
-
-% \chardef\urlhyphenmethod=0
-
-% \def\scanurl#1%
-% {\advance\scratchcounter\plusone
-% \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\#%
-% \else\ifx#1\&%
-% \flushurl\splitbefore\&%
-% \else\ifx#1\%%
-% \flushurl\splitbefore\%%
-% \else\ifx#1\_%
-% \flushurl\splitbefore\_%
-% \else\if\noexpand#1\relax
-% #1%
-% \else\ifnum\catcode`#1=8
-% \flushurl\splitbefore\_%
-% \else\ifnum\catcode`#1=6
-% \flushurl\splitbefore\#%
-% \else\ifnum\catcode`#1=4
-% \flushurl\splitbefore\&%
-% \else\expandafter\if\string#1\lettertilde
-% \flushurl\splitbefore\~%
-% \else\expandafter\if\string#1\letterpercent
-% \flushurl\splitbefore\%%
-% \else\expandafter\if\string#1\letterunderscore
-% \flushurl\splitbefore\_%
-% \else\expandafter\if\string#1\letterquestionmark
-% \flushurl\splitafter\letterquestionmark
-% \else\expandafter\if\string#1\letterat
-% \flushurl\splitafter\letterat
-% \else\expandafter\if\string#1\letterslash
-% \edef\savedurl{\savedurl\letterslash}%
-% \else\expandafter\if\string#1+%
-% \flushurl\splitafter+%
-% \else\expandafter\if\string#1:%
-% \flushurl\splitafter:%
-% \else\expandafter\if\string#1.%
-% \flushurl\splitafter.%
-% \else\expandafter\if\string#1(%
-% \flushurl\splitbefore(%
-% \else\expandafter\if\string#1)%
-% \flushurl\splitafter)%
-% \else
-% \ifx\savedurl\empty\else
-% \splitbefore\savedurl
-% \let\savedurl\empty
-% \fi
-% \ifcase\urlhyphenmethod
-% \string#1%
-% \else
-% \ifnum\scratchcounter>\plusthree % so, \http: will not break
-% \edef\savedurl{\string#1}%
-% \else
-% \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}
-
-%D The following approach takes more resources but is cleaner (after all, we now
-%D have huge \TEX's. It's is basically a \TEX\ version of the \MKIV\ variant.
-
-\newtoks\everyhyphenatedurl
-
-\appendtoks
- \let\&\letterampersand
- \let\#\letterhash
- \let\~\lettertilde
- \let\\\letterbackslash
- \let\$\letterdollar
- \let\^\letterhat
- \let\_\letterunderscore
- \let\{\letterleftbrace
- \let\}\letterrightbrace
- \let\|\letterbar
- \let~=\lettertilde
- \let|=\letterbar
-\to \everyhyphenatedurl
-
-\def\hyphenatedurlseparator{} % \periodcentered
-
-\def\dohyphenatedurlnormal#1{\char#1\relax}%
-\def\dohyphenatedurlafter #1{\char#1\discretionary{}{\hyphenatedurlseparator}{}}%
-\def\dohyphenatedurlbefore#1{\discretionary{\hyphenatedurlseparator}{}{}\char#1\relax}%
-
-% 0=normal 1=before 2=after
-
-\def\sethyphenatedurlnormal#1{\expandafter\chardef\csname url @ #1\endcsname\zerocount}
-\def\sethyphenatedurlbefore#1{\expandafter\chardef\csname url @ #1\endcsname\plusone }
-\def\sethyphenatedurlafter #1{\expandafter\chardef\csname url @ #1\endcsname\plustwo }
-
-\sethyphenatedurlbefore !
-\sethyphenatedurlbefore "
-\sethyphenatedurlbefore \letterhash
-\sethyphenatedurlbefore \letterdollar
-\sethyphenatedurlbefore \letterpercent
-\sethyphenatedurlbefore \letterampersand
-\sethyphenatedurlbefore (
-\sethyphenatedurlbefore *
-\sethyphenatedurlbefore +
-\sethyphenatedurlbefore ,
-\sethyphenatedurlbefore -
-\sethyphenatedurlbefore .
-\sethyphenatedurlbefore /
-\sethyphenatedurlbefore :
-\sethyphenatedurlbefore ;
-\sethyphenatedurlbefore <
-\sethyphenatedurlbefore =
-\sethyphenatedurlbefore >
-\sethyphenatedurlbefore ?
-\sethyphenatedurlbefore @
-\sethyphenatedurlbefore [
-\sethyphenatedurlbefore \letterbackslash
-\sethyphenatedurlbefore ^
-\sethyphenatedurlbefore _
-\sethyphenatedurlbefore `
-\sethyphenatedurlbefore \letteropenbrace
-\sethyphenatedurlbefore \letterbar
-\sethyphenatedurlbefore \lettertilde
-
-\sethyphenatedurlafter '
-\sethyphenatedurlafter )
-\sethyphenatedurlafter ]
-\sethyphenatedurlafter \letterclosebrace
-
-\unexpanded \def\hyphenatedurl#1%
- {\dontleavehmode
- \begingroup
- \the\everyhyphenatedurl
- \edef\ascii{#1}%
- \expanded{\handletokens{\detokenize\expandafter{\ascii}}}\with\dohyphenatedurl
- \endgroup}
-
-\def\dohyphenatedurl#1%
- {\ifcase\executeifdefined{url @ #1}\zerocount\relax
- \expandafter\dohyphenatedurlnormal
- \or
- \expandafter\dohyphenatedurlbefore
- \or
- \expandafter\dohyphenatedurlafter
- \fi{\number`#1}}
-
-% maybe ... to be finished
-%
-% \def\hyphenatedstring#1%
-% {\bgroup
-% \nohyphens
-% \def\next##1{##1\doif{##1}{-}{\allowbreak}}%
-% \handletokens#1\with\next
-% \egroup}
-%
-% {\hsize1cm\hyphenatedstring{ABXXXXXXXXXXC-12345-12345}}
-
-%D \macros
-%D {hyphenatedfilename}
-%D
-%D For the moment we treat filenames in a similar way,
-%D
-%D \starttyping
-%D \hyphenatedfilename{here/there/filename.suffix}
-%D \stoptyping
-
-\ifx\hyphenatedfilename\undefined \let\hyphenatedfilename\hyphenatedurl \fi
-
-% \def\test#1%
-% {\dontleavehmode
-% \begingroup
-% \tttf
-% \hyphenatedurl {%
-% \letterampersand #1\letterampersand #1\letterampersand #1\letterampersand #1\letterampersand
-% \letterhash #1\letterhash #1\letterpercent #1\letterslash #1\letterampersand
-% }%
-% \endgroup}
-
-% \dorecurse{100}{\test{a} \test{ab} \test{abc} \test{abcd} \test{abcde} \test{abcdef}}
-
-\protect \endinput
-
-% \bgroup
-
-% \gdef\lettercolon{:}
-
-% \catcode`\:=\active
-% \catcode`\^=\active
-% \catcode`\/=\active
-% \catcode`\~=\active
-
-% \gdef\theurlcolon {\nobreak\hbox{\lettercolon}\allowbreak}
-% \gdef\theurlslash#1{\nobreak\hbox{\letterslash}\ifx#1\relax\else\ifnum`/=\expandafter`\string#1\else\allowbreak\fi#1\fi}
-% \gdef\theurlhat {\allowbreak\hbox{\letterhat}\nobreak}
-% \gdef\theurltilde {\allowbreak\hbox{\lettertilde}\nobreak}
-
-% \gdef\ForMojcaWhoLikesHacks#1%
-% {\dontleavehmode
-% \begingroup
-% \mathcode`\:="8000 \let:\theurlcolon
-% \mathcode`\^="8000 \let^\theurlhat
-% \mathcode`\/="8000 \let/\theurlslash
-% \mathcode`\~="8000 \let~\theurltilde
-% \everymath\emptytoks
-% \mathsurround\zeropoint$\tf#1\relax$%
-% \endgroup}
-% \egroup
-
-% \hsize 1mm \ForMojcaWhoLikesHacks{http://www.sil.org//silesr/}
diff --git a/Master/texmf-dist/tex/context/base/mkii/lang-vn.mkii b/Master/texmf-dist/tex/context/base/mkii/lang-vn.mkii
deleted file mode 100644
index e564d989c70..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/lang-vn.mkii
+++ /dev/null
@@ -1,92 +0,0 @@
-%D \module
-%D [ file=lang-vn,
-%D version=2004.11.22, % 1999.12.12,
-%D title=\CONTEXT\ Language Macros,
-%D subtitle=Vietnamese,
-%D author={Han The Thanh \& Adam Lindsay \& Hans Hagen},
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Language Macros / Vietnamese Language}
-
-%D The framework of this module is set up by Hans Hagen while
-%D many of the first translations were done by Tobias. Later
-%D on, corrections were made by users. If you have suggestions,
-%D or feel that your name missing here, don't hesitate to send
-%D us an email.
-%D
-%D \starttabulate[|lB|l|]
-%D \NC Vietnamese \NC \THANH\ \NC \NR
-%D \stoptabulate
-
-\unprotect
-
-\installlanguage
- [\s!vi]
- [\c!spacing=\v!packed,
- \c!leftsentence=---,
- \c!rightsentence=---,
- \c!leftsubsentence=---,
- \c!rightsubsentence=---,
- \c!leftquote=\quoteleft,
- \c!rightquote=\quoteright,
- \c!leftquotation=\quotedblleft,
- \c!rightquotation=\quotedblright,
- \c!date={{ },dd,{/},mm,{/},yy},
- \s!mapping=t5,
- \s!encoding=t5]
-
-\installlanguage [vietnamese] [\s!vi]
-
-\setupheadtext [\s!vi] [\v!content=M\udotbelow c l\udotbelow c]
-\setupheadtext [\s!vi] [\v!tables=Danh s\aacute ch b\ahook ng]
-\setupheadtext [\s!vi] [\v!figures=Danh s\aacute ch h\igrave nh v\etilde]
-\setupheadtext [\s!vi] [\v!graphics=\Dstroke\ocircumflexgrave\ th\idotbelow]
-\setupheadtext [\s!vi] [\v!intermezzi=Intermezzos]
-\setupheadtext [\s!vi] [\v!index=Ch\ihook\ s\ocircumflexacute]
-\setupheadtext [\s!vi] [\v!abbreviations=Ch\uhorntilde\ vi\ecircumflexacute t t\abreveacute t]
-\setupheadtext [\s!vi] [\v!logos=Bi\ecircumflexhook u t\uhorn \ohorndotbelow ng]
-\setupheadtext [\s!vi] [\v!units=\Dstroke\ohorn n v\idotbelow]
-
-\setuplabeltext [\s!vi] [\v!table=B\ahook ng ]
-\setuplabeltext [\s!vi] [\v!figure=H\igrave nh ]
-\setuplabeltext [\s!vi] [\v!intermezzo=intermezzo]
-\setuplabeltext [\s!vi] [\v!graphic=\Dstroke\ocircumflexgrave\ th\idotbelow]
-\setuplabeltext [\s!vi] [\v!chapter=Ch\uhorn \ohorn ng ]
-\setuplabeltext [\s!vi] [\v!section=] % not set
-\setuplabeltext [\s!vi] [\v!subsection=] % not set
-\setuplabeltext [\s!vi] [\v!subsubsection=] % not set
-\setuplabeltext [\s!vi] [\v!subsubsubsection=] % not set
-\setuplabeltext [\s!vi] [\v!appendix=] % not set
-\setuplabeltext [\s!vi] [\v!part=Ph\acircumflexgrave n ]
-\setuplabeltext [\s!vi] [\v!line=d\ograve ng ]
-\setuplabeltext [\s!vi] [\v!lines=d\ograve ng ]
-
-\setuplabeltext [\s!vi] [\v!sunday=ch\uhook\ nh\acircumflexdotbelow t]
-\setuplabeltext [\s!vi] [\v!monday=th\uhornacute\ hai]
-\setuplabeltext [\s!vi] [\v!tuesday=th\uhornacute\ ba]
-\setuplabeltext [\s!vi] [\v!wednesday=th\uhornacute\ t\uhorn]
-\setuplabeltext [\s!vi] [\v!thursday=th\uhornacute\ n\abreve m]
-\setuplabeltext [\s!vi] [\v!friday=th\uhornacute\ s\aacute u]
-\setuplabeltext [\s!vi] [\v!saturday=th\uhornacute\ b\ahook y]
-
-\setuplabeltext [\s!vi] [\v!january=th\aacute ng gi\ecircumflex ng]
-\setuplabeltext [\s!vi] [\v!february=th\aacute ng hai]
-\setuplabeltext [\s!vi] [\v!march=th\aacute ng ba]
-\setuplabeltext [\s!vi] [\v!april=th\aacute ng t\uhorn]
-\setuplabeltext [\s!vi] [\v!may=th\aacute ng n\abreve m]
-\setuplabeltext [\s!vi] [\v!june=th\aacute ng s\aacute u]
-\setuplabeltext [\s!vi] [\v!july=th\aacute ng b\ahook y]
-\setuplabeltext [\s!vi] [\v!august=th\aacute ng t\aacute m]
-\setuplabeltext [\s!vi] [\v!september=th\aacute ng ch\iacute n]
-\setuplabeltext [\s!vi] [\v!october=th\aacute ng m\uhorn\ohorngrave i]
-\setuplabeltext [\s!vi] [\v!november=th\aacute ng m\uhorn\ohorngrave i m\ocircumflexdotbelow t]
-\setuplabeltext [\s!vi] [\v!december=th\aacute ng m\uhorn\ohorngrave i hai]
-
-%D \ShowAllLanguageValues [\s!vi] [vietnamese] {Vietnamese} {water||puppets}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/math-ams.mkii b/Master/texmf-dist/tex/context/base/mkii/math-ams.mkii
deleted file mode 100644
index c73a890c02f..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/math-ams.mkii
+++ /dev/null
@@ -1,336 +0,0 @@
-%D \module
-%D [ file=math-ams,
-%D version=2001.04.12,
-%D title=\CONTEXT\ Math Macros,
-%D subtitle=AMS Specials,
-%D author={Hans Hagen \& Taco Hoekwater},
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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
-
-% maybe we should just include these into the default tex one
-
-\definefamilysynonym [default] [blackboard] [mb]
-
-\startmathcollection [default]
-
-\definemathsymbol [varGamma] [ord] [letters] ["00]
-\definemathsymbol [varDelta] [ord] [letters] ["01]
-\definemathsymbol [varTheta] [ord] [letters] ["02]
-\definemathsymbol [varLambda] [ord] [letters] ["03]
-\definemathsymbol [varXi] [ord] [letters] ["04]
-\definemathsymbol [varPi] [ord] [letters] ["05]
-\definemathsymbol [varSigma] [ord] [letters] ["06]
-\definemathsymbol [varUpsilon] [ord] [letters] ["07]
-\definemathsymbol [varPhi] [ord] [letters] ["08]
-\definemathsymbol [varPsi] [ord] [letters] ["09]
-\definemathsymbol [varOmega] [ord] [letters] ["0A]
-
-\stopmathcollection
-
-\startmathcollection[default]
-
-\definemathsymbol [internalAnd] [rel] [operators] ["26]
-
-\stopmathcollection
-
-\startmathcollection [default]
-
-\definemathsymbol [boxdot] [bin] [ma] ["00]
-\definemathsymbol [boxplus] [bin] [ma] ["01]
-\definemathsymbol [boxtimes] [bin] [ma] ["02]
-\definemathsymbol [square] [ord] [ma] ["03]
-\definemathsymbol [Box] [ord] [ma] ["03] % square
-\definemathsymbol [blacksquare] [ord] [ma] ["04]
-\definemathsymbol [centerdot] [bin] [ma] ["05]
-\definemathsymbol [Diamond] [ord] [ma] ["06]
-\definemathsymbol [lozenge] [ord] [ma] ["06] % Diamond
-\definemathsymbol [blacklozenge] [ord] [ma] ["07]
-\definemathsymbol [circlearrowright] [rel] [ma] ["08]
-\definemathsymbol [circlearrowleft] [rel] [ma] ["09]
-\definemathsymbol [rightleftharpoons] [rel] [ma] ["0A]
-\definemathsymbol [leftrightharpoons] [rel] [ma] ["0B]
-\definemathsymbol [boxminus] [bin] [ma] ["0C]
-\definemathsymbol [Vdash] [rel] [ma] ["0D]
-\definemathsymbol [Vvdash] [rel] [ma] ["0E]
-\definemathsymbol [vDash] [rel] [ma] ["0F]
-\definemathsymbol [twoheadrightarrow] [rel] [ma] ["10]
-\definemathsymbol [twoheadleftarrow] [rel] [ma] ["11]
-\definemathsymbol [leftleftarrows] [rel] [ma] ["12]
-\definemathsymbol [rightrightarrows] [rel] [ma] ["13]
-\definemathsymbol [upuparrows] [rel] [ma] ["14]
-\definemathsymbol [downdownarrows] [rel] [ma] ["15]
-\definemathsymbol [upharpoonright] [rel] [ma] ["16]
-\definemathsymbol [restriction] [rel] [ma] ["16]
-\definemathsymbol [downharpoonright] [rel] [ma] ["17]
-\definemathsymbol [upharpoonleft] [rel] [ma] ["18]
-\definemathsymbol [downharpoonleft] [rel] [ma] ["19]
-\definemathsymbol [rightarrowtail] [rel] [ma] ["1A]
-\definemathsymbol [leftarrowtail] [rel] [ma] ["1B]
-\definemathsymbol [leftrightarrows] [rel] [ma] ["1C]
-\definemathsymbol [rightleftarrows] [rel] [ma] ["1D]
-\definemathsymbol [Lsh] [rel] [ma] ["1E]
-\definemathsymbol [Rsh] [rel] [ma] ["1F]
-\definemathsymbol [rightsquigarrow] [rel] [ma] ["20]
-\definemathsymbol [leadsto] [rel] [ma] ["20] % rightsquigarrow
-\definemathsymbol [leftrightsquigarrow] [rel] [ma] ["21]
-\definemathsymbol [looparrowleft] [rel] [ma] ["22]
-\definemathsymbol [looparrowright] [rel] [ma] ["23]
-\definemathsymbol [circeq] [rel] [ma] ["24]
-\definemathsymbol [succsim] [rel] [ma] ["25]
-\definemathsymbol [gtrsim] [rel] [ma] ["26]
-\definemathsymbol [gtrapprox] [rel] [ma] ["27]
-\definemathsymbol [multimap] [rel] [ma] ["28]
-\definemathsymbol [therefore] [rel] [ma] ["29]
-\definemathsymbol [because] [rel] [ma] ["2A]
-\definemathsymbol [doteqdot] [rel] [ma] ["2B]
-\definemathsymbol [Doteq] [rel] [ma] ["2B] % doteqdot
-\definemathsymbol [triangleq] [rel] [ma] ["2C]
-\definemathsymbol [precsim] [rel] [ma] ["2D]
-\definemathsymbol [lesssim] [rel] [ma] ["2E]
-\definemathsymbol [lessapprox] [rel] [ma] ["2F]
-\definemathsymbol [eqslantless] [rel] [ma] ["30]
-\definemathsymbol [eqslantgtr] [rel] [ma] ["31]
-\definemathsymbol [curlyeqprec] [rel] [ma] ["32]
-\definemathsymbol [curlyeqsucc] [rel] [ma] ["33]
-\definemathsymbol [preccurlyeq] [rel] [ma] ["34]
-\definemathsymbol [leqq] [rel] [ma] ["35]
-\definemathsymbol [leqslant] [rel] [ma] ["36]
-\definemathsymbol [lessgtr] [rel] [ma] ["37]
-\definemathsymbol [backprime] [ord] [ma] ["38]
-\definemathsymbol [dabar@] [ord] [ma] ["39] % @
-\definemathsymbol [risingdotseq] [rel] [ma] ["3A]
-\definemathsymbol [fallingdotseq] [rel] [ma] ["3B]
-\definemathsymbol [succcurlyeq] [rel] [ma] ["3C]
-\definemathsymbol [geqq] [rel] [ma] ["3D]
-\definemathsymbol [geqslant] [rel] [ma] ["3E]
-\definemathsymbol [gtrless] [rel] [ma] ["3F]
-\definemathsymbol [sqsubset] [rel] [ma] ["40]
-\definemathsymbol [sqsupset] [rel] [ma] ["41]
-\definemathsymbol [vartriangleright] [rel] [ma] ["42]
-\definemathsymbol [rhd] [bin] [ma] ["42]
-\definemathsymbol [lhd] [bin] [ma] ["43]
-\definemathsymbol [vartriangleleft] [rel] [ma] ["43]
-\definemathsymbol [trianglerighteq] [rel] [ma] ["44]
-\definemathsymbol [unrhd] [bin] [ma] ["44] % trianglerighteq
-\definemathsymbol [trianglelefteq] [rel] [ma] ["45]
-\definemathsymbol [unlhd] [bin] [ma] ["45] % trianglelefteq
-\definemathsymbol [bigstar] [ord] [ma] ["46]
-\definemathsymbol [between] [rel] [ma] ["47]
-\definemathsymbol [blacktriangledown] [ord] [ma] ["48]
-\definemathsymbol [blacktriangleright] [rel] [ma] ["49]
-\definemathsymbol [blacktriangleleft] [rel] [ma] ["4A]
-\definemathsymbol [vartriangle] [rel] [ma] ["4D]
-\definemathsymbol [triangleup] [ord] [ma] ["4D] % vartriangle
-\definemathsymbol [blacktriangle] [ord] [ma] ["4E]
-\definemathsymbol [triangledown] [ord] [ma] ["4F]
-\definemathsymbol [eqcirc] [rel] [ma] ["50]
-\definemathsymbol [lesseqgtr] [rel] [ma] ["51]
-\definemathsymbol [gtreqless] [rel] [ma] ["52]
-\definemathsymbol [lesseqqgtr] [rel] [ma] ["53]
-\definemathsymbol [gtreqqless] [rel] [ma] ["54]
-\definemathsymbol [Rrightarrow] [rel] [ma] ["56]
-\definemathsymbol [Lleftarrow] [rel] [ma] ["57]
-\definemathsymbol [veebar] [bin] [ma] ["59]
-\definemathsymbol [barwedge] [bin] [ma] ["5A]
-\definemathsymbol [doublebarwedge] [bin] [ma] ["5B]
-\definemathsymbol [angle] [ord] [ma] ["5C]
-\definemathsymbol [measuredangle] [ord] [ma] ["5D]
-\definemathsymbol [sphericalangle] [ord] [ma] ["5E]
-\definemathsymbol [varpropto] [rel] [ma] ["5F]
-\definemathsymbol [smallsmile] [rel] [ma] ["60]
-\definemathsymbol [smallfrown] [rel] [ma] ["61]
-\definemathsymbol [Subset] [rel] [ma] ["62]
-\definemathsymbol [Supset] [rel] [ma] ["63]
-\definemathsymbol [Cup] [bin] [ma] ["64]
-\definemathsymbol [doublecup] [bin] [ma] ["64] % Cup
-\definemathsymbol [Cap] [bin] [ma] ["65]
-\definemathsymbol [doublecap] [bin] [ma] ["65]
-\definemathsymbol [curlywedge] [bin] [ma] ["66]
-\definemathsymbol [curlyvee] [bin] [ma] ["67]
-\definemathsymbol [leftthreetimes] [bin] [ma] ["68]
-\definemathsymbol [rightthreetimes] [bin] [ma] ["69]
-\definemathsymbol [subseteqq] [rel] [ma] ["6A]
-\definemathsymbol [supseteqq] [rel] [ma] ["6B]
-\definemathsymbol [bumpeq] [rel] [ma] ["6C]
-\definemathsymbol [Bumpeq] [rel] [ma] ["6D]
-\definemathsymbol [llless] [rel] [ma] ["6E]
-\definemathsymbol [lll] [rel] [ma] ["6E] % llless
-\definemathsymbol [gggtr] [rel] [ma] ["6F]
-\definemathsymbol [ggg] [rel] [ma] ["6F] % gggtr
-\definemathsymbol [ulcorner] [open] [ma] ["70] [ma] ["70]
-\definemathsymbol [urcorner] [close] [ma] ["71] [ma] ["71]
-\definemathsymbol [circledS] [ord] [ma] ["73]
-\definemathsymbol [pitchfork] [rel] [ma] ["74]
-\definemathsymbol [dotplus] [bin] [ma] ["75]
-\definemathsymbol [backsim] [rel] [ma] ["76]
-\definemathsymbol [backsimeq] [rel] [ma] ["77]
-\definemathsymbol [llcorner] [open] [ma] ["78] [ma] ["78]
-\definemathsymbol [lrcorner] [close] [ma] ["79] [ma] ["79]
-\definemathsymbol [complement] [ord] [ma] ["7B]
-\definemathsymbol [intercal] [bin] [ma] ["7C]
-\definemathsymbol [circledcirc] [bin] [ma] ["7D]
-\definemathsymbol [circledast] [bin] [ma] ["7E]
-\definemathsymbol [circleddash] [bin] [ma] ["7F]
-
-\stopmathcollection
-
-\startmathcollection [default]
-
-\definemathcommand [integers] {\blackboard{Z}}
-\definemathcommand [reals] {\blackboard{R}}
-\definemathcommand [rationals] {\blackboard{Q}}
-\definemathcommand [naturalnumbers] {\blackboard{N}}
-\definemathcommand [complexes] {\blackboard{C}}
-\definemathcommand [primes] {\blackboard{P}}
-
-\stopmathcollection
-
-\startmathcollection [default]
-
-\definemathsymbol [lvertneqq] [rel] [mb] ["00]
-\definemathsymbol [gvertneqq] [rel] [mb] ["01]
-\definemathsymbol [nleq] [rel] [mb] ["02]
-\definemathsymbol [ngeq] [rel] [mb] ["03]
-\definemathsymbol [nless] [rel] [mb] ["04]
-\definemathsymbol [ngtr] [rel] [mb] ["05]
-\definemathsymbol [nprec] [rel] [mb] ["06]
-\definemathsymbol [nsucc] [rel] [mb] ["07]
-\definemathsymbol [lneqq] [rel] [mb] ["08]
-\definemathsymbol [gneqq] [rel] [mb] ["09]
-\definemathsymbol [nleqslant] [rel] [mb] ["0A]
-\definemathsymbol [ngeqslant] [rel] [mb] ["0B]
-\definemathsymbol [lneq] [rel] [mb] ["0C]
-\definemathsymbol [gneq] [rel] [mb] ["0D]
-\definemathsymbol [npreceq] [rel] [mb] ["0E]
-\definemathsymbol [nsucceq] [rel] [mb] ["0F]
-\definemathsymbol [precnsim] [rel] [mb] ["10]
-\definemathsymbol [succnsim] [rel] [mb] ["11]
-\definemathsymbol [lnsim] [rel] [mb] ["12]
-\definemathsymbol [gnsim] [rel] [mb] ["13]
-\definemathsymbol [nleqq] [rel] [mb] ["14]
-\definemathsymbol [ngeqq] [rel] [mb] ["15]
-\definemathsymbol [precneqq] [rel] [mb] ["16]
-\definemathsymbol [succneqq] [rel] [mb] ["17]
-\definemathsymbol [precnapprox] [rel] [mb] ["18]
-\definemathsymbol [succnapprox] [rel] [mb] ["19]
-\definemathsymbol [lnapprox] [rel] [mb] ["1A]
-\definemathsymbol [gnapprox] [rel] [mb] ["1B]
-\definemathsymbol [nsim] [rel] [mb] ["1C]
-\definemathsymbol [ncong] [rel] [mb] ["1D]
-\definemathsymbol [diagup] [ord] [mb] ["1E]
-\definemathsymbol [diagdown] [ord] [mb] ["1F]
-\definemathsymbol [varsubsetneq] [rel] [mb] ["20]
-\definemathsymbol [varsupsetneq] [rel] [mb] ["21]
-\definemathsymbol [nsubseteqq] [rel] [mb] ["22]
-\definemathsymbol [nsupseteqq] [rel] [mb] ["23]
-\definemathsymbol [subsetneqq] [rel] [mb] ["24]
-\definemathsymbol [supsetneqq] [rel] [mb] ["25]
-\definemathsymbol [varsubsetneqq] [rel] [mb] ["26]
-\definemathsymbol [varsupsetneqq] [rel] [mb] ["27]
-\definemathsymbol [subsetneq] [rel] [mb] ["28]
-\definemathsymbol [supsetneq] [rel] [mb] ["29]
-\definemathsymbol [nsubseteq] [rel] [mb] ["2A]
-\definemathsymbol [nsupseteq] [rel] [mb] ["2B]
-\definemathsymbol [nparallel] [rel] [mb] ["2C]
-\definemathsymbol [nmid] [rel] [mb] ["2D]
-\definemathsymbol [nshortmid] [rel] [mb] ["2E]
-\definemathsymbol [nshortparallel] [rel] [mb] ["2F]
-\definemathsymbol [nvdash] [rel] [mb] ["30]
-\definemathsymbol [nVdash] [rel] [mb] ["31]
-\definemathsymbol [nvDash] [rel] [mb] ["32]
-\definemathsymbol [nVDash] [rel] [mb] ["33]
-\definemathsymbol [ntrianglerighteq] [rel] [mb] ["34]
-\definemathsymbol [ntrianglelefteq] [rel] [mb] ["35]
-\definemathsymbol [ntriangleleft] [rel] [mb] ["36]
-\definemathsymbol [ntriangleright] [rel] [mb] ["37]
-\definemathsymbol [nleftarrow] [rel] [mb] ["38]
-\definemathsymbol [nrightarrow] [rel] [mb] ["39]
-\definemathsymbol [nLeftarrow] [rel] [mb] ["3A]
-\definemathsymbol [nRightarrow] [rel] [mb] ["3B]
-\definemathsymbol [nLeftrightarrow] [rel] [mb] ["3C]
-\definemathsymbol [nleftrightarrow] [rel] [mb] ["3D]
-\definemathsymbol [divideontimes] [bin] [mb] ["3E]
-\definemathsymbol [varnothing] [ord] [mb] ["3F]
-\definemathsymbol [nexists] [ord] [mb] ["40]
-\definemathsymbol [Finv] [ord] [mb] ["60]
-\definemathsymbol [Game] [ord] [mb] ["61]
-\definemathsymbol [mho] [ord] [mb] ["66]
-\definemathsymbol [eth] [ord] [mb] ["67]
-\definemathsymbol [eqsim] [rel] [mb] ["68]
-\definemathsymbol [beth] [ord] [mb] ["69]
-\definemathsymbol [gimel] [ord] [mb] ["6A]
-\definemathsymbol [daleth] [ord] [mb] ["6B]
-\definemathsymbol [lessdot] [bin] [mb] ["6C]
-\definemathsymbol [gtrdot] [bin] [mb] ["6D]
-\definemathsymbol [ltimes] [bin] [mb] ["6E]
-\definemathsymbol [rtimes] [bin] [mb] ["6F]
-\definemathsymbol [shortmid] [rel] [mb] ["70]
-\definemathsymbol [shortparallel] [rel] [mb] ["71]
-\definemathsymbol [smallsetminus] [bin] [mb] ["72]
-\definemathsymbol [thicksim] [rel] [mb] ["73]
-\definemathsymbol [thickapprox] [rel] [mb] ["74]
-\definemathsymbol [approxeq] [rel] [mb] ["75]
-\definemathsymbol [succapprox] [rel] [mb] ["76]
-\definemathsymbol [precapprox] [rel] [mb] ["77]
-\definemathsymbol [curvearrowleft] [rel] [mb] ["78]
-\definemathsymbol [curvearrowright] [rel] [mb] ["79]
-\definemathsymbol [digamma] [ord] [mb] ["7A]
-\definemathsymbol [varkappa] [ord] [mb] ["7B]
-\definemathsymbol [Bbbk] [ord] [mb] ["7C]
-\definemathsymbol [hslash] [ord] [mb] ["7D]
-\definemathsymbol [hbar] [ord] [mb] ["7E]
-\definemathsymbol [backepsilon] [rel] [mb] ["7F]
-
-\stopmathcollection
-
-\startmathcollection [default]
-
-\definemathcommand [yen] [nothing] {\mathhexbox{\hexmafam}55}
-\definemathcommand [checkmark] [nothing] {\mathhexbox{\hexmafam}58}
-\definemathcommand [circledR] [nothing] {\mathhexbox{\hexmafam}72}
-\definemathcommand [maltese] [nothing] {\mathhexbox{\hexmafam}7A}
-
-\stopmathcollection
-
-\startmathcollection [default]
-
-\definemathcommand [dashrightarrow] [rel] {\dabar@\dabar@ \mathchar"0C4B}
-\definemathcommand [dashleftarrow] [rel] {\mathchar"0C4C\dabar@ \dabar@}
-\definemathcommand [dasharrow] [rel] {\dabar@\dabar@ \mathchar"0C4B}
-\definemathcommand [Join] [rel] {\mathchar"0D6F\mkern-13.8mu\mathchar"0D6E}
-\definemathcommand [implies] [rel] {\;\Longrightarrow\;}
-\definemathcommand [impliedby] [rel] {\;\Longleftarrow\;}
-\definemathcommand [And] [rel] {\;\internalAnd\;}
-
-\stopmathcollection
-
-\def\AMSwidehat#1%
- {\setbox\scratchbox\hbox{$\mathsurround\zeropoint#1$}%
- \ifdim\wd\scratchbox>2em
- \mathaccent"0\purefamilyhex{mb}5B{#1}%
- \else
- \mathaccent"0\purefamilyhex{ex}62{#1}%
- \fi}
-
-\def\AMSwidetilde#1%
- {\setbox\scratchbox\hbox{$\mathsurround\zeropoint#1$}%
- \ifdim\wd\scratchbox>2em
- \mathaccent"0\purefamilyhex{mb}5D{#1}%
- \else
- \mathaccent"0\purefamilyhex{ex}65{#1}%
- \fi}
-
-\startmathcollection [default]
-
-\definemathcommand [widehat] {\AMSwidehat}
-\definemathcommand [widetilde] {\AMSwidetilde}
-
-\stopmathcollection
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/math-arr.mkii b/Master/texmf-dist/tex/context/base/mkii/math-arr.mkii
deleted file mode 100644
index 71a833b8974..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/math-arr.mkii
+++ /dev/null
@@ -1,391 +0,0 @@
-%D \module
-%D [ file=math-ext,
-%D version=2007.07.19,
-%D title=\CONTEXT\ Math Macros,
-%D subtitle=Arrows,
-%D author={Hans Hagen \& Taco Hoekwater \& Aditya Mahajan},
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Math Macros / Arrows}
-
-\unprotect
-
-%D These will be generalized! Is it still needed in \MKIV?
-
-%D We next define extensible arrows. Extensible arrows are arrows that
-%D change their length according to the width of the text to be placed
-%D above and below the arrow. Since we need to define a lot of arrows,
-%D we first define some helper macros. The basic idea is to measure
-%D the width of the box to be placed above and below the arrow, and
-%D make the \quotation{body} of the arrow as long as the bigger of the
-%D two widths.
-
-\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\displaystyle}%
- \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\displaystyle}%
- \mathrel{\mathop{\hbox to \dimen0{\hss\copy4\hss}}\limits^{\box0}_{\box2}}
- \endgroup}
-
-\let\domthxarrsingle\domthxarr
-
-%D There are some arrows which are created by stacking two arrows. The next
-%D macro helps in defining such \quotation{double arrows}.
-
-\def\domthxarrdouble#1#2#3#4#5#6#7% opt l r sp rs top bot
- {\mathrel
- {\scratchdimen.32ex\relax % was .22, todo: make configurable
- \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}}
-
-%D \macros{definematharrow}
-%D
-%D Macro for defining new arrows. We can define two types of
-%D arrows|<|single arrows and double arrows. Single arrows are defined
-%D as
-%D
-%D \starttyping
-%D \definematharrow [xrightarrow] [0359] [\rightarrowfill]
-%D \stoptyping
-%D
-%D The first argument is the name of the arrow (\tex{xrightarrow} in
-%D this case.) The second argument consists of a set of 4 numbers and
-%D specify the spacing correction in math units~\type{mu}. These
-%D numbers define:
-%D
-%D \startlines
-%D 1st number: arrow||tip correction
-%D 2nd number: arrow||tip correction
-%D 3rd number: space (multiplied by \tex{matharrfactor} and advanced by \tex{matharrextra})
-%D 4th number: space (multiplied by \tex{matharrfactor} and advanced by \tex{matharrextra})
-%D \stoplines
-%D
-%D The third argument is the name of the extensible fill. The third
-%D argument is optional when the arrow is redefined later (this is
-%D useful for font specific tweaking of the skips.) For example,
-%D
-%D \startbuffer
-%D \math{\xrightarrow{above}}
-%D \definematharrow[xrightarrow][0000]
-%D \math{\xrightarrow{above}}
-%D \definematharrow[xrightarrow][55{50}{50}]
-%D \math{\xrightarrow{above}}
-%D \stopbuffer
-%D \typebuffer gives {\getbuffer}
-%D
-%D The double arrows are defined as follows
-%D
-%D \starttyping
-%D \definematharrow [xrightleftharpoons] [3095,0359]
-%D [\rightharpoonupfill,\leftharpoondownfill]
-%D \stoptyping
-%D
-%D The second and the third set of arguments consist of comma
-%D separated values. The first element of the second argument
-%D (\type{3095}) corresponds to the spacing correction of top arrow
-%D fill (\tex{rightarrowupfill}). Similarly, \type{0359} corresponds
-%D to bottom arrow fill \tex{leftharpoondownfill}). Stacking them on
-%D top of each other we get $\xrightleftharpoons[big]{above}{below}$.
-%D The following math arrows are defined
-%D
-%D \placetable[none]{}{\starttable[|l|m|]
-%D \NC \tex{xrightarrow } \NC \xrightarrow [big] \NC \NR
-%D \NC \tex{xleftarrow } \NC \xleftarrow [big] \NC \NR
-%D \NC \tex{xequal } \NC \xequal [big] \NC \NR
-%D \NC \tex{xRightarrow } \NC \xRightarrow [big] \NC \NR
-%D \NC \tex{xLeftarrow } \NC \xLeftarrow [big] \NC \NR
-%D \NC \tex{xLeftrightarrow } \NC \xLeftrightarrow [big] \NC \NR
-%D \NC \tex{xleftrightarrow } \NC \xleftrightarrow [big] \NC \NR
-%D \NC \tex{xmapsto } \NC \xmapsto [big] \NC \NR
-%D \NC \tex{xtwoheadrightarrow } \NC \xtwoheadrightarrow [big] \NC \NR
-%D \NC \tex{xtwoheadleftarrow } \NC \xtwoheadleftarrow [big] \NC \NR
-%D \NC \tex{xrightharpoondown } \NC \xrightharpoondown [big] \NC \NR
-%D \NC \tex{xrightharpoonup } \NC \xrightharpoonup [big] \NC \NR
-%D \NC \tex{xleftharpoondown } \NC \xleftharpoondown [big] \NC \NR
-%D \NC \tex{xleftharpoonup } \NC \xleftharpoonup [big] \NC \NR
-%D \NC \tex{xhookleftarrow } \NC \xhookleftarrow [big] \NC \NR
-%D \NC \tex{xhookrightarrow } \NC \xhookrightarrow [big] \NC \NR
-%D \NC \tex{xleftrightharpoons } \NC \xleftrightharpoons [big] \NC \NR
-%D \NC \tex{xrightleftharpoons } \NC \xrightleftharpoons [big] \NC \NR
-%D \stoptable}
-
-\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\dohandlemtharrow
- \def\dohandlemtharrow[##1][##2]{\setvalue{#1}{\dohandlemtharrow[#2][##2]}}%
- % == \def\dohandlemtharrow[##1][##2]{\dodefinebotharrow{#1}{#2}{##2}}%
- \getvalue{#1}%
- \popmacro\dohandlemtharrow}}
-
-\def\dodefinebotharrow#1#2#3%
- {\setvalue{#1}{\dohandlemtharrow[#2][#3]}}
-
-\def\dohandlemtharrow
- {\dotripleempty\doxmtharrow}
-
-\def\doxmtharrow[#1][#2][#3]% #3 == optional arg
- {\def\dodoxmtharrow{\dododoxmtharrow[#1,\empty,\empty][#2,\empty,\empty][#3]}% {##1}{##2}
- \dodoublegroupempty\dodoxmtharrow}
-
-\def\dododoxmtharrow[#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.
-
-%D \macros{mtharrowfill,defaultmtharrowfill}
-%D
-%D To extend the arrows we need to define a \quotation{math arrow
-%D fill}. This command takes 8 arguments: the first four correspond
-%D the second argument of \tex{definematharrow} explained above. The
-%D other three specify the tail, body and head of the arrow. The last
-%D argument specifies the math-mode in which the arrow is drawn.
-%D \tex{defaultmtharrowfill} has values tweaked to match Latin Modern
-%D fonts. For fonts that are significantly different (e.g. cows) a
-%D different set of values need to be determined.
-
-\def\mtharrowfill#1#2#3#4#5#6#7#8%
- {$\mathsurround 0pt
- \thickmuskip0mu\medmuskip\thickmuskip\thinmuskip\thickmuskip
- \relax#8#5%
- \mkern-#1mu
- \cleaders\hbox{$#8\mkern -#2mu#6\mkern -#3mu$}\hfill
- \mkern-#4mu#7$}
-
-\def\defaultmtharrowfill{\mtharrowfill 7227}
-
-%D We now define some arrow fills that will be used for defining the
-%D arrows. Plain \TEX\ already defines \tex{leftarrowfill} and
-%D \tex{rightarrowfill}. The \tex{defaultmtharrowfill} command defines an
-%D arrowfill that takes an argument (so that it can also be used
-%D with over and under arrows). However the Plain \TEX\ definitions of
-%D \tex{leftarrowfill} and \tex{rightarrowfill} do not take this extra
-%D argument. To be backward compatible with Plain \TEX, we define two
-%D arrowfills: \tex{specrightarrowfill} which takes an extra argument, and
-%D \tex{rightarrowfill} which does not.
-
-\def\specrightarrowfill {\defaultmtharrowfill \relbar \relbar \rightarrow}
-\def\specleftarrowfill {\defaultmtharrowfill \leftarrow \relbar \relbar}
-
-\def\rightarrowfill {\specrightarrowfill \textstyle}
-\def\leftarrowfill {\specleftarrowfill \textstyle}
-
-\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}
-\def\relfill {\defaultmtharrowfill \relbar \relbar \relbar}
-
-\def\triplerelbar {\mathrel\equiv}
-\def\triplerelfill{\defaultmtharrowfill\triplerelbar\triplerelbar\triplerelbar}
-
-\def\singlebond{{\xrel}} % or \def\singlebond{{\xrel[2]}}
-\def\doublebond{{\xequal}}
-\def\triplebond{{\xtriplerel}}
-
-%D Now we define most commonly used arrows. These include arrows
-%D defined in \filename{amsmath.sty}, \filename{extarrows.sty},
-%D \filename{extpfel.sty} and \filename{mathtools.sty} packages for
-%D \LATEX\ (plus a few more).
-
-\definematharrow [xrightarrow] [0359] [\specrightarrowfill]
-\definematharrow [xleftarrow] [3095] [\specleftarrowfill]
-\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 [xhookleftarrow] [3095] [\hookleftfill]
-\definematharrow [xhookrightarrow] [0395] [\hookrightfill]
-\definematharrow [xrel] [0099] [\relfill]
-\definematharrow [xtriplerel] [0099] [\triplerelfill]
-\definematharrow [xrightoverleftarrow] [0359,3095] [\specrightarrowfill,\specleftarrowfill]
-\definematharrow [xleftrightharpoons] [3399,3399] [\leftharpoonupfill,\rightharpoondownfill]
-\definematharrow [xrightleftharpoons] [3399,3399] [\rightharpoonupfill,\leftharpoondownfill]
-
-%D These arrows can be used as follows:
-%D
-%D \startbuffer
-%D \startformula \xrightarrow{stuff on top}\stopformula
-%D \startformula \xrightarrow{}{stuff on top}\stopformula
-%D \startformula \xrightarrow{stuff below}{}\stopformula
-%D \startformula \xrightarrow{stuff below}{stuff on top}\stopformula
-%D
-%D \startformula \xleftarrow [none]{stuff below}{stuff on top}\stopformula
-%D \startformula \xleftarrow [small]{stuff below}{stuff on top}\stopformula
-%D \startformula \xleftarrow [medium]{stuff below}{stuff on top}\stopformula
-%D \startformula \xleftarrow [big]{stuff below}{stuff on top}\stopformula
-%D \stopbuffer
-%D
-%D \typebuffer which gives \getbuffer
-
-%D \macros{definemathoverarrow,defineunderarrow}
-%D
-%D These macros for define math-overarrows are adapted from
-%D \filename{amsmath.sty}
-
-\def\definemathoverarrow
- {\dotripleargument\dodefinemathoverarrow}
-
-\def\dodefinemathoverarrow[#1][#2][#3]%
- {\ifthirdargument
- \setvalue{#1}{\dohandlemathoverarrow[#2][#3]}%
- \else
- \setvalue{#1}{\dohandlemathoverarrow[\zeropoint][#2]}%
- \fi}
-
-\def\dohandlemathoverarrow[#1][#2]%
- {\mathpalette{\dodohandlemathoverarrow{#1}{#2}}}
-
-%D Note: \filename{math-pln.tex} has \type{\kern-\onepoint} and
-%D \filename{amsmath.sty} does not. We keep the kern amount
-%D configurable. This is useful for harpoons.
-
-\def\dodohandlemathoverarrow#1#2#3#4%
- {\vbox{\ialign{##\crcr
- #2#3\crcr
- \noalign{\kern#1\nointerlineskip}%
- $\mathsurround\zeropoint\hfil#3#4\hfil$\crcr}}}
-
-%D Now the under arrows
-
-\def\definemathunderarrow
- {\dotripleargument\dodefinemathunderarrow}
-
-%D For underarrows the default kern is 0.3ex
-
-\def\dodefinemathunderarrow[#1][#2][#3]%
- {\ifthirdargument
- \setvalue{#1}{\dohandlemathunderarrow[#2][#3]}%
- \else
- \setvalue{#1}{\dohandlemathunderarrow[0.3ex][#2]}%
- \fi}
-
-\def\dohandlemathunderarrow[#1][#2]%
- {\mathpalette{\dodohandlemathunderarrow{#1}{#2}}}
-
-\def\dodohandlemathunderarrow#1#2#3#4%
- {\vtop{\ialign{##\crcr
- $\mathsurround\zeropoint\hfil#3#4\hfil$\crcr
- \noalign{\nointerlineskip\kern#1}%
- #2#3\crcr}}}
-
-%D Now we define the arrows
-
-\definemathoverarrow [overleftarrow] [\specleftarrowfill]
-\definemathoverarrow [overrightarrow] [\specrightarrowfill]
-\definemathoverarrow [overleftrightarrow] [\leftrightarrowfill]
-\definemathoverarrow [overtwoheadrightarrow] [\twoheadrightarrowfill]
-\definemathoverarrow [overtwoheadleftarrow] [\twoheadleftarrowfill]
-\definemathoverarrow [overrightharpoondown] [1pt] [\rightharpoondownfill]
-\definemathoverarrow [overrightharpoonup] [\rightharpoonupfill]
-\definemathoverarrow [overleftharpoondown] [1pt] [\leftharpoondownfill]
-\definemathoverarrow [overleftharpoonup] [\leftharpoonupfill]
-
-\definemathunderarrow [underleftarrow] [\specleftarrowfill]
-\definemathunderarrow [underrightarrow] [\specrightarrowfill]
-\definemathunderarrow [underleftrightarrow] [\leftrightarrowfill]
-\definemathunderarrow [undertwoheadrightarrow][\twoheadrightarrowfill]
-\definemathunderarrow [undertwoheadleftarrow] [\twoheadleftarrowfill]
-\definemathunderarrow [underrightharpoondown] [\rightharpoondownfill]
-\definemathunderarrow [underrightharpoonup] [\rightharpoonupfill]
-\definemathunderarrow [underleftharpoondown] [\leftharpoondownfill]
-\definemathunderarrow [underleftharpoonup] [\leftharpoonupfill]
-
-%D These can be used as follows:
-%D
-%D \startbuffer
-%D $\overleftarrow{A}$ $\overleftarrow{ABC}$
-%D $a_{\overleftarrow{A}}$ $b_{\overleftarrow{ABC}}$
-%D \stopbuffer
-%D \typebuffer which gives \getbuffer
-
-%D TODO: Possibly have a single arrow command define all the arrows.
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/math-cow.mkii b/Master/texmf-dist/tex/context/base/mkii/math-cow.mkii
deleted file mode 100644
index 04f659b4425..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/math-cow.mkii
+++ /dev/null
@@ -1,31 +0,0 @@
-%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 ADE \& \CONTEXT\ Development Team}]
-%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
-
-\def\COWsqrt {\mthsqrt{\char"7A}{\char"7B}}
-\def\COWfrac {\mthfrac{\char"7C}{\char"7A}{\char"7B}}
-\def\COWarrowfill{\mtharrowfill 1001}
-
-\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/mkii/math-eul.mkii b/Master/texmf-dist/tex/context/base/mkii/math-eul.mkii
deleted file mode 100644
index f502445259c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/math-eul.mkii
+++ /dev/null
@@ -1,277 +0,0 @@
-%D \module
-%D [ file=math-eul,
-%D version=2003.02.03,
-%D title=\CONTEXT\ Math Macros,
-%D subtitle=Virtual Euler Specials,
-%D author={Hans Hagen \& Taco Hoekwater \& Adam Lindsay},
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details. Further modified by Adam Lindsay.
-
-\unprotect
-
-%D We follow the following mappings from type-eul:
-%D
-%D mr [MathRoman] [Euler-Roman] [zeurm10]
-
-%D mi [MathItalic] [Euler-Italic] [eufm10]
-
-%D ex [MathExtension] [Euler-Extension] [zeuex10]
-%D sy [MathSymbol] [Euler-Symbol] [zeusm10]
-
-%D mb [MathBeta] [Charter-Roman] [bchr8r] XXX
-%D mc [MathGamma] [Euler-Fraktur] [eufm10] XXX
-%D
-%D The inclusion of Bitstream Charter was originally for the text accents.
-%D Obviously, it's not a proper ``MathBeta'' font.
-
-%D The varrho and varsigma characters don't exist in eulervm,
-%D so we point at the normal types.
-
-\definefamilysynonym [eul] [calligraphic] [sy]
-\definefamilysynonym [eul] [oldstyle] [mi]
-\definefamilysynonym [eul] [gothic] [mi]
-\definefamilysynonym [eul] [fraktur] [mi]
-
-\definefamilysynonym [eul] [lcgreek] [mr]
-\definefamilysynonym [eul] [ucgreek] [mr]
-\definefamilysynonym [eul] [vargreek] [mr]
-
-%% Well, you don't know until you try!
-%\definefamilysynonym [eul] [accents] [Serif]
-
-\startmathcollection [eul]
-
-\definemathsymbol [varrho] [nothing] [vargreek] ["1A]
-\definemathsymbol [varsigma] [nothing] [vargreek] ["1B]
-
-%D Changes necessitated by collapsing mr \& mi into one:
-\definemathsymbol [imath] [nothing] [mr] ["7B]
-\definemathsymbol [jmath] [nothing] [mr] ["7C]
-\definemathsymbol [ell] [nothing] [mr] ["60]
-\definemathsymbol [wp] [nothing] [mr] ["7D]
-\definemathsymbol [partial] [nothing] [mr] ["40]
-
-\definemathsymbol [flat] [ord] [mr] ["5B]
-\definemathsymbol [natural] [ord] [mr] ["5C]
-\definemathsymbol [sharp] [ord] [mr] ["5D]
-
-\definemathsymbol [triangleleft] [bin] [mr] ["2F]
-\definemathsymbol [triangleright][bin] [mr] ["2E]
-
-\definemathsymbol [star] [bin] [mr] ["3F]
-
-\definemathsymbol [smile] [rel] [mr] ["5E]
-\definemathsymbol [frown] [rel] [mr] ["5F]
-\definemathsymbol [leftharpoonup] [rel] [mr] ["28]
-\definemathsymbol [leftharpoondown] [rel] [mr] ["29]
-\definemathsymbol [rightharpoonup] [rel] [mr] ["2A]
-\definemathsymbol [rightharpoondown] [rel] [mr] ["2B]
-\definemathsymbol [lhook] [rel] [mr] ["2C]
-\definemathsymbol [rhook] [rel] [mr] ["2D]
-
-\definemathsymbol [mathperiod] [ord] [mr] ["3A]
-\definemathsymbol [textperiod] [punct] [mr] ["3A]
-
-\definemathsymbol [mathcomma] [ord] [mr] ["3B]
-\definemathsymbol [textcomma] [punct] [mr] ["3B]
-
-\definemathsymbol [ldotp] [punct] [mr] ["3A]
-
-% extras from AMS:
-\definemathsymbol [hslash] [ord] [mr] ["80] %beauty over truth
-
-\stopmathcollection
-
-\startmathcollection [eul]
-% Ugh. no way around this to keep it compact in the font defs.
-
-\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
-
-\startmathcollection [eul]
-
-\definemathcharacter [!] [close] [sy] ["A1]
-\definemathcharacter [(] [open] [sy] ["A8]
-\definemathcharacter [)] [close] [sy] ["A9]
-\definemathcharacter [+] [bin] [sy] ["AB]
-\definemathcharacter [:] [rel] [sy] ["BA]
-\definemathcharacter [;] [punct] [sy] ["BB]
-\definemathcharacter [=] [rel] [sy] ["BD]
-\definemathcharacter [?] [close] [sy] ["BF]
-\definemathcharacter [91] [open] [sy] ["DB] % [
-\definemathcharacter [93] [close] [sy] ["DD] % ]
-
-\definemathcharacter [,] [punct] [mr] ["3B]
-\definemathcharacter [.] [ord] [mr] ["3A]
-\definemathcharacter [/] [ord] [mr] ["3D]
-\definemathcharacter [<] [rel] [mr] ["3C]
-\definemathcharacter [>] [rel] [mr] ["3E]
-
-\stopmathcollection
-
-\startmathcollection [eul]
-
-\definemathcharacter [(] [nothing] [sy] ["A8] [ex] ["00]
-\definemathcharacter [)] [nothing] [sy] ["A9] [ex] ["01]
-\definemathcharacter [91] [nothing] [sy] ["DB] [ex] ["02] % [
-\definemathcharacter [93] [nothing] [sy] ["DD] [ex] ["03] % ]
-\definemathcharacter [/] [nothing] [mr] ["3D] [ex] ["0E]
-
-\stopmathcollection
-
-\startmathcollection [eul]
-
-\definemathsymbol [hbar] [nothing] [mr] ["80]
-
-\stopmathcollection
-
-\startmathcollection [eul]
-
-\definemathsymbol [ddagger] [bin] [sy] ["7A]
-\definemathsymbol [dagger] [bin] [sy] ["79]
-
-\stopmathcollection
-
-\startmathcollection [eul]
-
-\definemathsymbol [colon] [punct] [sy] ["BA]
-
-\stopmathcollection
-
-%D This used to be very hackish; it brought in text
-%D accents from the well-matched Bitstream Charter.
-
-%D But now, these characters don't exist. I would prefer to pull
-%D them from the text font, but I don't know how.
-%D Instead, I'm just pointing to null characters!
-
-\startmathcollection [eul]
-
-\definemathsymbol [acute] [accent] [mr] ["90]
-\definemathsymbol [grave] [accent] [mr] ["91]
-\definemathsymbol [ddot] [accent] [mr] ["92]
-\definemathsymbol [tilde] [accent] [mr] ["93]
-\definemathsymbol [bar] [accent] [mr] ["94]
-\definemathsymbol [breve] [accent] [mr] ["95]
-\definemathsymbol [check] [accent] [mr] ["96]
-\definemathsymbol [hat] [accent] [mr] ["97]
-\definemathsymbol [dot] [accent] [mr] ["98]
-%\definemathsymbol [acute] [accent] [accents] ["B4]
-%\definemathsymbol [grave] [accent] [accents] ["1E]
-%\definemathsymbol [ddot] [accent] [accents] ["A8]
-%\definemathsymbol [tilde] [accent] [accents] ["98]
-%\definemathsymbol [bar] [accent] [accents] ["AF]
-%\definemathsymbol [breve] [accent] [accents] ["0B]
-%\definemathsymbol [check] [accent] [accents] ["10]
-%\definemathsymbol [hat] [accent] [accents] ["5E]
-%\definemathsymbol [dot] [accent] [accents] ["01]
-
-\definemathsymbol [vec] [accent] [mr] ["7E] % [ord]
-\definemathsymbol [hat] [accent] [sy] ["DE]
-
-\stopmathcollection
-
-\startmathcollection [eul]
-
-\definemathsymbol [lgroup] [open] [sy] ["A8] [ex] ["3A] % ?
-\definemathsymbol [rgroup] [close] [sy] ["A9] [ex] ["3B] % ?
-
-\stopmathcollection
-
-\startmathcollection [eul]
-
-\definemathsymbol [dag] [box] [sy] ["79]
-\definemathsymbol [ddag] [box] [sy] ["7A]
-\definemathsymbol [S] [box] [sy] ["78]
-\definemathsymbol [P] [box] [sy] ["7B]
-
-\stopmathcollection
-
-%D Aditya's additionl definitions:
-
-\startmathcollection[eul:texnansi]
- \definemathsymbol [acute] [accent] [tf] ["13]
- \definemathsymbol [grave] [accent] [tf] ["12]
- \definemathsymbol [ddot] [accent] [tf] ["A8]
- \definemathsymbol [tilde] [accent] [tf] ["98]
- \definemathsymbol [bar] [accent] [tf] ["16]
- \definemathsymbol [breve] [accent] [tf] ["15]
- \definemathsymbol [check] [accent] [tf] ["14]
- \definemathsymbol [hat] [accent] [tf] ["88]
- \definemathsymbol [dot] [accent] [tf] ["5]
- % Why is mathring not defined??
- \definemathsymbol [mathring] [accent] [tf] ["17]
-\stopmathcollection
-
-\startmathcollection[eul:ec]
- \definemathsymbol [acute] [accent] [tf] ["1]
- \definemathsymbol [grave] [accent] [tf] ["0]
- \definemathsymbol [ddot] [accent] [tf] ["4]
- \definemathsymbol [tilde] [accent] [tf] ["3]
- \definemathsymbol [bar] [accent] [tf] ["9]
- \definemathsymbol [breve] [accent] [tf] ["8]
- \definemathsymbol [check] [accent] [tf] ["7]
- \definemathsymbol [hat] [accent] [tf] ["2]
- \definemathsymbol [dot] [accent] [tf] ["A]
- % Why is mathring not defined??
- \definemathsymbol [mathring] [accent] [tf] ["6]
-\stopmathcollection
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/math-fou.mkii b/Master/texmf-dist/tex/context/base/mkii/math-fou.mkii
deleted file mode 100644
index 26b03d73ec9..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/math-fou.mkii
+++ /dev/null
@@ -1,196 +0,0 @@
-%D \module
-%D [ file=math-fou,
-%D version=2001.04.12,
-%D title=\CONTEXT\ Math Macros,
-%D subtitle=Fourier Specials,
-%D author={Michel Biovani \& Hans Hagen},
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% see end of file for todo
-
-\unprotect
-
-\startmathcollection [fou]
-
- \definemathsymbol [Gamma] [alpha] [mi] ["00]
- \definemathsymbol [Delta] [alpha] [mi] ["01]
- \definemathsymbol [Theta] [alpha] [mi] ["02]
- \definemathsymbol [Lambda] [alpha] [mi] ["03]
- \definemathsymbol [Xi] [alpha] [mi] ["04]
- \definemathsymbol [Pi] [alpha] [mi] ["05]
- \definemathsymbol [Sigma] [alpha] [mi] ["06]
- \definemathsymbol [Upsilon] [alpha] [mi] ["07]
- \definemathsymbol [Phi] [alpha] [mi] ["08]
- \definemathsymbol [Psi] [alpha] [mi] ["09]
- \definemathsymbol [Omega] [alpha] [mi] ["0A]
-
-\stopmathcollection
-
-\startmathcollection [fou]
-
- \definemathcharacter [+] [bin] [sy] ["80]
- \definemathcharacter [=] [rel] [sy] ["81]
- \definemathcharacter [<] [rel] [sy] ["82]
- \definemathcharacter [>] [rel] [sy] ["83]
-
-\stopmathcollection
-
-\startmathcollection [fou]
-
- \definemathsymbol [leqslant] [rel] [sy] ["84]
- \definemathsymbol [geqslant] [rel] [sy] ["85]
- \definemathsymbol [parallelslant] [rel] [sy] ["86]
- \definemathsymbol [thething] [ord] [sy] ["87]
- \definemathsymbol [vDash] [rel] [sy] ["88]
- \definemathsymbol [blacktriangleleft] [rel] [sy] ["89]
- \definemathsymbol [blacktriangleright] [rel] [sy] ["8A]
- \definemathsymbol [nleqslant] [rel] [sy] ["8B]
- \definemathsymbol [ngeqslant] [rel] [sy] ["8C]
- \definemathsymbol [parallel] [rel] [sy] ["8D]
- \definemathsymbol [nparallel] [rel] [sy] ["8E]
- \definemathsymbol [nparallelslant] [rel] [sy] ["8F]
- \definemathsymbol [nvDash] [rel] [sy] ["90]
- \definemathsymbol [intercal] [bin] [sy] ["91]
- \definemathsymbol [hslash] [ord] [sy] ["92]
- \definemathsymbol [nexists] [ord] [sy] ["93]
- \definemathsymbol [varsubsetneq] [rel] [sy] ["93]
-
-\stopmathcollection
-
-\startmathcollection [fou]
-
- \definemathcharacter [(] [nothing] [mr] ["28] [ex] ["A1]
- \definemathcharacter [)] [nothing] [mr] ["29] [ex] ["A2]
- \definemathcharacter [91] [nothing] [mr] ["5B] [ex] ["A3] % [
- \definemathcharacter [93] [nothing] [mr] ["5D] [ex] ["A4] % ]
- \definemathcharacter [/] [nothing] [mr] ["2F] [ex] ["B1]
-
- \definemathcharacter [124] [nothing] [sy] ["6A] [ex] ["AF] % |
- \definemathcharacter [92] [nothing] [sy] ["6E] [ex] ["B2] % \
-
-\stopmathcollection
-
-\startmathcollection [fou]
-
- \definemathsymbol [Vert] [nothing] [sy] ["6B] [ex] ["B0]
- \definemathsymbol [vert] [nothing] [sy] ["6A] [ex] ["AF]
- \definemathsymbol [VERT] [nothing] [sy] ["98] [ex] ["93]
- \definemathsymbol [Downarrow] [rel] [sy] ["2B] [ex] ["C4]
- \definemathsymbol [backslash] [nothing] [sy] ["6E] [ex] ["B2]
- \definemathsymbol [rangle] [close] [sy] ["69] [ex] ["AE]
- \definemathsymbol [langle] [open] [sy] ["68] [ex] ["AD]
- \definemathsymbol [rbrace] [close] [sy] ["67] [ex] ["AA]
- \definemathsymbol [lbrace] [open] [sy] ["66] [ex] ["A9]
- \definemathsymbol [rceil] [close] [sy] ["65] [ex] ["A8]
- \definemathsymbol [lceil] [open] [sy] ["64] [ex] ["A7]
- \definemathsymbol [rfloor] [close] [sy] ["63] [ex] ["A6]
- \definemathsymbol [lfloor] [open] [sy] ["62] [ex] ["A5]
- \definemathsymbol [dblbrackleft] [open] [sy] ["99] [ex] ["85]
- \definemathsymbol [dblbrackright] [close] [sy] ["9A] [ex] ["86]
-
-\stopmathcollection
-
-\startmathcollection [fou]
-
- \definemathsymbol [varkappa] [ord] [mi] ["80] % check this
- \definemathsymbol [varvarrho] [ord] [mi] ["81] % check this
- \definemathsymbol [xswordsup] [ord] [sy] ["96]
- \definemathsymbol [xswordsdown] [ord] [sy] ["97]
- \definemathsymbol [notowns] [rel] [sy] ["9C]
- \definemathsymbol [hbar] [ord] [sy] ["9D]
- \definemathsymbol [smallsetminus] [bin] [sy] ["9E]
-
-\stopmathcollection
-
-\startmathcollection [fou]
-
- \definemathsymbol [notin] [rel] [sy] ["9B]
-
-\stopmathcollection
-
-\startmathcollection [fou]
-
- \definemathsymbol [iintop] [op] [ex] ["CE]
- \definemathsymbol [iiintop] [op] [ex] ["D0]
- \definemathsymbol [oiintop] [op] [ex] ["D2]
- \definemathsymbol [oiiintop] [op] [ex] ["D4]
- \definemathsymbol [slashintop] [op] [ex] ["D6]
-
-\stopmathcollection
-
-\startmathcollection [fou]
-
- \definemathcommand [iint] {\iintop \nolimits}
- \definemathcommand [iiint] {\iiintop \nolimits}
- \definemathcommand [oiint] {\oiintop \nolimits}
- \definemathcommand [oiiint] {\oiiintop \nolimits}
- \definemathcommand [slashint] {\slashintop\nolimits}
-
-\stopmathcollection
-
-\startmathcollection [fou]
-
- \definemathsymbol [acute] [accent] [mr] ["1]
- \definemathsymbol [grave] [accent] [mr] ["0]
- \definemathsymbol [ddot] [accent] [mr] ["4]
- \definemathsymbol [tilde] [accent] [mr] ["3]
- \definemathsymbol [bar] [accent] [mr] ["9]
- \definemathsymbol [breve] [accent] [mr] ["8]
- \definemathsymbol [check] [accent] [mr] ["7]
- \definemathsymbol [hat] [accent] [mr] ["2]
- \definemathsymbol [dot] [accent] [mr] ["A]
- \definemathsymbol [mathring] [accent] [mr] ["6]
-
-\stopmathcollection
-
-\startmathcollection [fou]
-
- \definemathsymbol [otheralpha] [ord] [mi] ["0B]
- \definemathsymbol [otherbeta] [ord] [mi] ["0C]
- \definemathsymbol [othergamma] [ord] [mi] ["0D]
- \definemathsymbol [otherdelta] [ord] [mi] ["0E]
- \definemathsymbol [otherepsilon] [ord] [mi] ["0F]
- \definemathsymbol [otherzeta] [ord] [mi] ["10]
-
-\stopmathcollection
-
-\protect \endinput
-
-% from a mail of Michel B / todo
-
-% \definemathsymbol [acute] [accent] [operators] ["1]
-% \definemathsymbol [grave] [accent] [operators] ["0]
-% \definemathsymbol [ddot] [accent] [operators] ["4]
-% \definemathsymbol [tilde] [accent] [operators] ["3]
-% \definemathsymbol [bar] [accent] [operators] ["9]
-% \definemathsymbol [breve] [accent] [operators] ["8]
-% \definemathsymbol [check] [accent] [operators] ["7]
-% \definemathsymbol [hat] [accent] [operators] ["2]
-% \definemathsymbol [dot] [accent] [operators] ["A]
-% \definemathsymbol [mathring] [accent] [operators] ["6]
-
-% \definemathsymbol [wideparen] [ord] [largesymbols] ["94]
-% \definemathsymbol [widearc] [accent] [largesymbols] ["D8]
-
-% check for definition of \overset (ams)
-
-% \def\FOUwidering#1%
-% {\overset{\smash{\vbox to .2ex{\hbox{$\mathring{}$}}}}{\wideparen{#1}}}
-
-% \startmathcollection [default] % [ams]
-%
-% \definemathcommand [widering] {\FOUwidering}
-%
-% \stopmathcollection
-
-% \definemathsymbol [otheralpha] [ord] [otherletters] ["0B]
-% \definemathsymbol [otherbeta] [ord] [otherletters] ["0C]
-% \definemathsymbol [othergamma] [ord] [otherletters] ["0D]
-% \definemathsymbol [otherdelta] [ord] [otherletters] ["0E]
-% \definemathsymbol [otherepsilon] [ord] [otherletters] ["0F]
-% \definemathsymbol [otherzeta] [ord] [otherletters] ["10]
diff --git a/Master/texmf-dist/tex/context/base/mkii/math-frc.mkii b/Master/texmf-dist/tex/context/base/mkii/math-frc.mkii
deleted file mode 100644
index b14c9377497..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/math-frc.mkii
+++ /dev/null
@@ -1,253 +0,0 @@
-%D \module
-%D [ file=math-frc,
-%D version=2007.07.19,
-%D title=\CONTEXT\ Math Macros,
-%D subtitle=Fractions,
-%D author={Hans Hagen \& Taco Hoekwater \& Aditya Mahajan},
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Math Macros / Fractions}
-
-\unprotect
-
-\unexpanded\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}
-
-\unexpanded\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}}}
-
-\unexpanded\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}}}
-
-%D Moved from math-new.tex (not that new anyway:
-
-%D \macros
-%D {genfrac}
-%D
-%D [TH] The definition of \type {\genfrac} \& co. is not
-%D trivial, because it allows some flexibility. This is
-%D supposed to be a user||level command, but will fail quite
-%D desparately if called outside math mode (\CONTEXT\ redefines
-%D \type {\over})
-%D
-%D [HH] We clean up this macro a bit and (try) to make it
-%D understandable. The expansion is needed for generating
-%D the second argument to \type {\dogenfrac}, which is to
-%D be a control sequence like \type {\over}.
-
-\unexpanded\def\genfrac#1#2#3#4%
- {\edef\!!stringa
- {#1#2}%
- \expanded
- {\dogenfrac{#4}%
- \csname
- \ifx @#3@%
- \ifx\!!stringa\empty
- \strippedcsname\normalover
- \else
- \strippedcsname\normaloverwithdelims
- \fi
- \else
- \ifx\!!stringa\empty
- \strippedcsname\normalabove
- \else
- \strippedcsname\normalabovewithdelims
- \fi
- \fi
- \endcsname}%
- {#1#2#3}}
-
-\def\dogenfrac#1#2#3#4#5%
- {{#1{\begingroup#4\endgroup#2#3\relax#5}}}
-
-%D \macros
-%D {dfrac, tfrac, frac, dbinom, tbinom, binom}
-%D
-%D \startbuffer
-%D $\dfrac {1}{2} \tfrac {1}{2} \frac {1}{2}$
-%D $\dbinom{1}{2} \tbinom{1}{2} \binom{1}{2}$
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \getbuffer
-
-\unexpanded\def\dfrac {\genfrac\empty\empty{}\displaystyle}
-\unexpanded\def\tfrac {\genfrac\empty\empty{}\textstyle}
-\unexpanded\def\frac {\genfrac\empty\empty{}\donothing}
-
-\unexpanded\def\dbinom{\genfrac()\zeropoint\displaystyle}
-\unexpanded\def\tbinom{\genfrac()\zeropoint\textstyle}
-\unexpanded\def\binom {\genfrac()\zeropoint\donothing}
-
-\unexpanded\def\xfrac {\genfrac\empty\empty{}\scriptstyle}
-\unexpanded\def\xxfrac{\genfrac\empty\empty{}\scriptscriptstyle}
-
-\unexpanded\def\frac#1#2{\mathematics{\genfrac\empty\empty{}\donothing{#1}{#2}}}
-
-%D \macros
-%D {cfrac}
-%D
-%D \startbuffer
-%D $\cfrac{12}{3} \cfrac[l]{12}{3} \cfrac[c]{12}{3} \cfrac[r]{12}{3}$
-%D $\cfrac{1}{23} \cfrac[l]{1}{23} \cfrac[c]{1}{23} \cfrac[r]{1}{23}$
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \getbuffer
-%D
-%D Now we can align every combination we want:
-%D
-%D \startbuffer
-%D $\cfrac{12}{3} \cfrac[l]{12}{3} \cfrac[c]{12}{3} \cfrac[r]{12}{3}$
-%D $\cfrac{1}{23} \cfrac[l]{1}{23} \cfrac[c]{1}{23} \cfrac[r]{1}{23}$
-%D $\cfrac[cl]{12}{3} \cfrac[cc]{12}{3} \cfrac[cr]{12}{3}$
-%D $\cfrac[lc]{1}{23} \cfrac[cc]{1}{23} \cfrac[rc]{1}{23}$
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \getbuffer
-
-\definecomplexorsimple\cfrac
-
-\def\simplecfrac {\docfrac[cc]}
-\def\complexcfrac[#1]{\docfrac[#1cc]}
-
-\def\docfrac[#1#2#3]#4#5%
- {{\displaystyle
- \frac
- {\strut
- \ifx r#1\hfill\fi#4\ifx l#1\hfill\fi}%
- {\ifx r#2\hfill\fi#5\ifx l#2\hfill\fi}%
- \kern-\nulldelimiterspace}}
-
-%D \macros
-%D {splitfrac, splitdfrac}
-%D
-%D Occasionally one needs to typeset multi||line fractions.
-%D These commands use \tex{genfrac} to create such fractions.
-%D
-%D \startbuffer
-%D \startformula
-%D a=\frac{
-%D \splitfrac{xy + xy + xy + xy + xy}
-%D {+ xy + xy + xy + xy}
-%D }
-%D {z}
-%D =\frac{
-%D \splitdfrac{xy + xy + xy + xy + xy}
-%D {+ xy + xy + xy + xy}
-%D }
-%D {z}
-%D \stopformula
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-%D
-%D These macros are based on Michael J.~Downes posting on
-%D comp.text.tex on 2001/12/06
-
-\unexpanded\def\splitfrac#1#2%
- {\genfrac\empty\empty\zeropoint\textstyle%
- {\textstyle#1\quad\hfill}%
- {\textstyle\hfill\quad\mathstrut#2}}
-
-\unexpanded\def\splitdfrac#1#2%
- {\genfrac\empty\empty\zeropoint\displaystyle%
- {#1\quad\hfill}
- {\hfill\quad\mathstrut #2}}
-
-%D For thee moment here, but it might move:
-
-%D \macros
-%D {qedsymbol}
-%D
-%D [HH] The general Quod Erat Domonstrandum symbol is defined
-%D in such a way that we can configure it. Because this symbol
-%D is also used in text mode, we make it a normal text symbol
-%D with special behavior.
-
-\unexpanded\def\qedsymbol#1%
- {\ifhmode
- \unskip~\hfill#1\par
- \else\ifmmode
- \eqno#1\relax % Do we really need the \eqno here?
- \else
- \leavevmode\hbox{}\hfill#1\par
- \fi\fi}
-
-\definesymbol [qed] [\qedsymbol{\mathematics{\square}}]
-
-%D \macros
-%D {QED}
-%D
-%D [HH] For compatbility reasons we also provide the \type
-%D {\QED} command. In case this command is overloaded, we still
-%D have the symbol available. \symbol[qed]
-
-\unexpanded\def\QED{\symbol[qed]}
-
-%D \macros
-%D {mathhexbox}
-%D
-%D [TH] \type {\mathhexbox} is also user||level (already
-%D defined in Plain \TEX). It allows to get a math character
-%D inserted as if it was a text character.
-
-\unexpanded\def\mathhexbox#1#2#3%
- {\mathtext{$\mathsurround\zeropoint\mathchar"#1#2#3$}}
-
-%D \macros
-%D {boxed}
-%D
-%D [HH] Another macro that users expect (slightly adapted):
-
-\unexpanded\def\boxed
- {\ifmmode\expandafter\mframed\else\expandafter\framed\fi}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/math-ini.mkii b/Master/texmf-dist/tex/context/base/mkii/math-ini.mkii
deleted file mode 100644
index d6d10feb323..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/math-ini.mkii
+++ /dev/null
@@ -1,684 +0,0 @@
-%D \module
-%D [ file=math-ini,
-%D version=2001.04.12,
-%D title=\CONTEXT\ Math Macros,
-%D subtitle=Initializations,
-%D author={Hans Hagen \& Taco Hoekwater},
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Math Macros / Initializations}
-
-% todo: make all definitions global since file loaded only once
-
-%D This module provides namespaces for math fonts, thereby
-%D permitting mixed usage of math fonts. Although not strictly
-%D needed, we also provide a family name mapping mechanism as
-%D used in the (original) AMS math definition files, but here
-%D these names can recursively be remapped and if needed,
-%D dynamically be changed. We've tried to minimize the number
-%D of definition commands and use plain \TEX\ definitions as
-%D fallback. We've tried to follow a couple of conventions
-%D from plain and AMS math in order to achieve backward
-%D compatinility. We also kept an eye on future usage of these
-%D modules in the perspective of MathML and unicode fonts.
-
-\unprotect
-
-\def\@ml@{@ml@} % math list (used for collection)
-\def\@mf@{@mf@} % math family
-%def\@mh@{@mh@} % math handler (not used)
-\def\@mt@{@mt@} % math token
-\def\@mc@{@mc@} % math collection
-
-\def\@@mathlimopcomm#1{\mathop{#1}} %no \limits
-\def\@@mathnolopcomm#1{\mathop{#1}\nolimits}
-\def\@@mathboxcomm #1{\dontleavehmode\hbox{$\mathsurround\zeropoint#1$}}
-
-\chardef\mathordcode = 0 \let\mathordcomm \mathord
-\chardef\mathopcode = 1 \let\mathopcomm \mathop
-\chardef\mathbincode = 2 \let\mathbincomm \mathbin
-\chardef\mathrelcode = 3 \let\mathrelcomm \mathrel
-\chardef\mathopencode = 4 \let\mathopencomm \mathopen
-\chardef\mathclosecode = 5 \let\mathclosecomm \mathclose
-\chardef\mathpunctcode = 6 \let\mathpunctcomm \mathpunct
-\chardef\mathalphacode = 7 \let\mathalphacomm \firstofoneargument
-\chardef\mathinnercode = 0 \let\mathinnercomm \mathinner
-\chardef\mathnothingcode= 0 \let\mathnothingcomm \firstofoneargument
-\chardef\mathlimopcode = 1 \let\mathlimopcomm \@@mathlimopcomm
-\chardef\mathnolopcode = 1 \let\mathnolopcomm \@@mathnolopcomm
-\chardef\mathchoicecode = 0 \let\mathchoicecomm \@@mathchoicecomm
-\chardef\mathboxcode = 0 \let\mathboxcomm \@@mathboxcomm
-
-\chardef\mathaccentcode = 8
-\chardef\mathradicalcode= 9
-
-\def\@@mathchoicecomm#1{[todo #1]}
-
-\def\puremathcode#1{\the\csname math#1code\endcsname}
-\def\puremathcomm#1{\csname math#1comm\endcsname}
-
-\newif\iftracemathcollection
-
-% Simple variant:
-%
-% \def\dohandlemathtoken#1%
-% {\csname\@mt@
-% \ifcsname\@mt@\mathcollection#1\endcsname
-% \mathcollection
-% \else\ifcsname\@mt@\nomathcollection#1\endcsname
-% \nomathcollection
-% \fi\fi
-% #1\endcsname}
-
-%D Because a command can have a different meaning in math
-%D and in text mode, we provide a selector. We also provide
-%D the pure alternatives as \type {\mathcharacter} and \type
-%D {\textcharacter}.
-
-% \ifx\dohandlecommand\undefined \wait \fi % troubles ! but not in mkiv so ...
-
-\let\mathcharacter\dohandlemathtoken
-\let\textcharacter\dohandlecommand % better \dohandletexttoken
-
-% More clever layout:
-%
-% \def\dohandlemathtoken#1%
-% {\csname
-% \ifmmode
-% \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
-% \else
-% \ifcsname\characterencoding#1\endcsname
-% \characterencoding
-% \else
-% \nocharacterencoding
-% \fi
-% \fi
-% #1\endcsname}
-%
-% fallback to math when in text mode (handy for unicode vectors)
-
-\def\dohandlemathtoken#1%
- {\csname
- \ifmmode
- \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
- \else
- \ifcsname\characterencoding#1\endcsname
- \characterencoding
- \else\ifcsname\nocharacterencoding#1\endcsname
- \nocharacterencoding
- \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
- #1\endcsname}
-
-%D Now we redefine the text encoding handler.
-
-%D A better fallback:
-
-% Just ETEX which is the default nowadays.
-
-\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
-
-\def\definefamilysynonym
- {\dotripleempty\dodefinefamilysynonym}
-
-\def\dodefinefamilysynonym[#1][#2][#3]% [mathcollection] [] []
- {\ifthirdargument
- \setvalue{\@mf@#1#2}{#3}%
- \else
- \setvalue{\@mf@ #1}{#2}%
- \fi}
-
-\let\mathsubfamily\empty
-
-\def\purefamily #1{\csname \truefamily{#1}\mathsubfamily\s!fam\endcsname}
-\def\purefamilyhex#1{\csname hex\truefamily{#1}\mathsubfamily\s!fam\endcsname}
-
-\def\truefamily#1%
- {\ifcsname\@mf@\mathcollection#1\endcsname
- \@EA\truefamily\csname\@mf@\mathcollection#1\endcsname
- \else\ifcsname\@mf@#1\endcsname
- \@EA\truefamily\csname\@mf@#1\endcsname
- \else\ifcsname\@mf@\nomathcollection#1\endcsname
- \@EA\truefamily\csname\@mf@\nomathcollection#1\endcsname
- \else
- #1%
- \fi\fi\fi}
-
-\newif\ifdynamicmathfamilies \dynamicmathfamiliestrue % true per 2003.11.25; needed for mixed bold math
-
-\let\normalpurefamilyhex\purefamilyhex
-
-% todo: reset collection (tok legen) en opnieuw laden met true
-
-\def\definemathsymbol
- {\dosixtupleempty\dodefinemathsymbol}
-
-\def\dodefinemathsymbol[#1][#2][#3][#4][#5][#6]%
- {\unexpanded\setgvalue{#1}{\dohandlemathtoken{#1}}%
- \ifdynamicmathfamilies \let\purefamilyhex\relax \fi
- \setevalue{\@mt@\mathcollection#1}%
- {\ifsixthargument
- \ifnum\puremathcode{#2}=\mathradicalcode
- \radical"%
- \else
- \delimiter"%
- \ifnum\puremathcode{#2}>7 0\else\puremathcode{#2}\fi
- \fi
- \purefamilyhex{#3}\uchexnumbers{#4}%
- \purefamilyhex{#5}\uchexnumbers{#6}\space
- \else\iffourthargument
- \ifnum\puremathcode{#2}=\mathaccentcode
- \mathaccent\else\mathchar
- \fi
- "\ifnum\puremathcode{#2}>7 0\else\puremathcode{#2}\fi
- \purefamilyhex{#3}\uchexnumbers{#4}\space
- \fi\fi}%
- \let\purefamilyhex\normalpurefamilyhex
- \tracemathsymbol{#1}}
-
-\def\tracemathsymbol#1%
- {\iftracemathcollection
- {\endgraf
- \hbox{\tex{#1}~:~{\mathematics{\getvalue{#1}{}}}}
- \endgraf}%
- \fi}
-
-\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]%
- {\ifcase\mathcharactermode
- \setmathtoks
- \or
- \let\mathtoks\mathscratchtoks \mathtoks\emptytoks
- \fi
- \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
- \ifcase\mathcharactermode
- \expandafter\tracemathcharacter
- \or
- \the\mathtoks
- \mathtoks\emptytoks
- \expandafter\gobbleoneargument
- \fi{#1}} % maybe lookahead
-
-\def\tracemathcharacter#1%
- {\iftracemathcollection
- {\endgraf
- \doifnumberelse{#1}
- {\hbox{\tttf\rawcharacter{#1}~:~{\mathematics{\rawcharacter{#1}}}}}
- {\hbox{\type{#1}~:~{\mathematics{#1}}}}
- \endgraf}%
- \fi}
-
-\def\definemathcommand
- {\dotripleempty\dodefinemathcommand}
-
-\def\dodefinemathcommand[#1][#2][#3]#4% command class args meaning
- {\unexpanded\setgvalue{#1}{\dohandlemathtoken{#1}}%
- \ifthirdargument
- \processaction
- [#3]
- [one=>\setvalue{\@mt@\mathcollection#1}##1{\puremathcomm{#2}{#4{##1}}},
- two=>\setvalue{\@mt@\mathcollection#1}##1##2{\puremathcomm{#2}{#4{##1}{##2}}}]%
- \else\ifsecondargument
- \setvalue{\@mt@\mathcollection#1}{\puremathcomm{#2}{#4}}%
- \else
- \setvalue{\@mt@\mathcollection#1}{\puremathcomm{nothing}{#4}}%
- \fi\fi
- \tracemathcommand{#1}}
-
-\def\tracemathcommand#1%
- {\iftracemathcollection
- \endgraf\hbox{\tex{#1}~:~{\mathematics{\getvalue{#1}{}}}}\endgraf
- \fi}
-
-\def\startmathcollection[#1]%
- {\pushmacro\mathcollection
- \setmathcollection{#1}}
-
-\def\setmathcollection#1%
- {\edef\mathcollection{#1}%
- \doifundefined{\@ml@\mathcollection}
- {\expandafter\newtoks\csname\@ml@\mathcollection\endcsname}}
-
-\def\stopmathcollection
- {\popmacro\mathcollection}
-
-\def\startrawmathcollection
- {\startmathcollection}
-
-\def\stoprawmathcollection
- {\stopmathcollection}
-
-\newtoks\mathtoks
-
-\def\setmathtoks
- {\@EA\let\@EA\mathtoks\csname\@ml@\mathcollection\endcsname}
-
-\def\currentmathcollection{\mathcollection}
-
-\let\nomathcollection\s!default
-
-\def\enablemathcollection[#1]%
- {\doifnot{#1}\s!default
- {\setmathcollection\s!default
- \the\csname\@ml@\mathcollection\endcsname}%
- \setmathcollection{#1}%
- \the\csname\@ml@\mathcollection\endcsname}
-
-% hook 'm into the font mechanism
-
-\definefilesynonym[\f!mathprefix\s!default][\f!mathprefix tex]
-
-\def\usemathcollection
- {\dodoubleempty\dousemathcollection}
-
-\def\dousemathcollection[#1][#2]%
- {\pushmacro\fontclass
- \pushmacro\mathclass
- \ifsecondargument
- \edef\fontclass{#1}%
- \edef\mathclass{#2}%
- \else
- \edef\mathclass{#1}%
- \fi
- \doinputonce{\truefilename{\f!mathprefix\mathclass}.mkii}%
- \doifsomething\fontclass{\setevalue{\@mc@\fontclass\@mc@}{\mathclass}}%
- \popmacro\mathclass
- \popmacro\fontclass}
-
-\let\mathclass\nomathcollection
-
-\letvalue{\@mc@\@mc@}\nomathcollection
-
-% \def\autoenablemathcollection
-% {\doifdefinedelse{\@mc@\fontclass\@mc@}
-% {\enablemathcollection[\getvalue{\@mc@\fontclass\@mc@}]}
-% {\enablemathcollection[\s!default]}} % ? ? ?
-
-\def\autoenablemathcollection
- {\expanded{\enablemathcollection[\executeifdefined{\@mc@\fontclass\@mc@}\nomathcollection]}}
-
-\appendtoks\autoenablemathcollection\to\mathstrategies
-
-\fetchruntimecommand \showmathcharacters {\f!mathprefix\s!run}
-\fetchruntimecommand \showmathtoken {\f!mathprefix\s!run}
-
-\def\resetmathcollection[#1]%
- {\def\mathcollection{#1}%
- \forgetdoingonce{\f!mathprefix\mathcollection.mkii}%
- \setmathtoks
- \ifx\mathtoks\relax\else\mathtoks\emptytoks\fi}
-
-%D \macros
-%D {ifmathpunctuation, enablemathpunctuation,
-%D definemathpunctuation}
-%D
-%D This will replace periods by comma's:
-%D
-%D \starttyping
-%D \definemathpunctuation . textcomma textperiod
-%D \definemathpunctuation , textcomma textcomma
-%D
-%D \appendtoks
-%D \redefinemathcharacter [.] [ord] [mi] ["3B]%
-%D \to \everymathpunctuation
-%D \stoptyping
-
-% \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 this 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 % can be called inside math, so after \everymathematics
- {\relax
- \ifmmode
- \the\everymathpunctuation
- \fi
- \appendtoksonce
- \the\everymathpunctuation
- \to\everymathematics}
-
-\def\definemathpunctuation #1 #2 #3 %
- {\appendtoks
- \initializemathpunctuation{#1}{#2}{#3}%
- \to\everymathpunctuation}
-
-\def\initializemathpunctuation#1#2#3% sloowww
- {\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}%
- \futurelet\nexttoken\next}
-
-%D \startbuffer
-%D \enablemathpunctuation$(1,2) (1, 2) (1{,}2) \hbox{foo, not bar}$
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \blank{\getbuffer}\blank
-
-%D needed for sin, cos etc
-
-\def\mfunction #1{{\mr#1}}
-
-% \def\mlimitsfunction #1{\mathlimopcomm{{\mr#1}}
-% \def\mnolimitsfunction#1{\mathnolopcomm{{\mr#1}}
-
-%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\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
-%D \starttyping
-%D \setmathfunctionstyle\fontstyle % or {rm} or {ss} or ..
-%D \rm test $\sin{(x^{\sin(x^{\sin(x)})})}$ test
-%D \ss test $\sin{(x^{\sin(x^{\sin(x)})})}$ test
-%D \tt test $\sin{(x^{\sin(x^{\sin(x)})})}$ test
-%D \stoptyping
-
-\edef\hexmrfam {0} \edef\hexbsfam {8}
-\edef\hexmifam {1} \edef\hexbifam {9}
-\edef\hexsyfam {2} \edef\hexscfam {A}
-\edef\hexexfam {3} \edef\hextffam {B}
-\edef\hexitfam {4} \edef\hexmafam {C}
-\edef\hexslfam {5} \edef\hexmbfam {D}
-\edef\hexbffam {6} \edef\hexmcfam {E}
-\edef\hexnnfam {7} \edef\hexmdfam {F}
-
-\definefamilysynonym [default] [letters] [mr]
-\definefamilysynonym [default] [operators] [sy]
-\definefamilysynonym [default] [lcgreek] [mi]
-\definefamilysynonym [default] [ucgreek] [mr]
-\definefamilysynonym [default] [vargreek] [mi]
-\definefamilysynonym [default] [mitfamily] [mi]
-\definefamilysynonym [default] [calfamily] [sy]
-
-\definefamilysynonym [default] [0] [mr]
-\definefamilysynonym [default] [1] [mi]
-\definefamilysynonym [default] [2] [sy]
-\definefamilysynonym [default] [3] [ex]
-
-\enablemathcollection[default]
-
-\usemathcollection [default] [tex]
-\usemathcollection [default] [ams]
-\usemathcollection [default] [uni]
-
-\enablemathcollection[default]
-
-%D Some goodies:
-
-\def\Angstrom{\nomathematics{\Aring}}
-
-%D Bold math:
-%D
-%D \starttyping
-%D \usetypescript [lucida] [texnansi]
-%D
-%D \definetypeface [boldmath] [rm] [serif]
-%D [lucida] [default] [encoding=texnansi]
-%D \definetypeface [boldmath] [tt] [mono]
-%D [lucida] [default] [encoding=texnansi]
-%D \definetypeface [boldmath] [ss] [sans]
-%D [lucida] [default] [encoding=texnansi]
-%D \definetypeface [boldmath] [mm] [boldmath]
-%D [lucida] [default] [encoding=texnansi]
-%D
-%D \switchtobodyfont[lucida,10pt]
-%D
-%D \showmathtoken{Gamma} $\Gamma \Delta \alpha \delta \zeta$
-%D
-%D \switchtobodyfont[boldmath,10pt]
-%D
-%D \showmathtoken{Gamma} $\Gamma \Delta \alpha \delta \zeta$
-%D \stoptyping
-
-%D \macros
-%D {nonknuthmode, donknuthmode}
-%D
-%D The underscore is frequently used in manuals but unfortunately \TEX\ prefers
-%D it to be a math specific character. And since computer modern fonts didn't
-%D have an underscore, one had to use commands to fake one. Nowadays we do
-%D have underscores in latin modern, and since all other fonts have them, we
-%D decided to get away from the restriction to use the underscore character in
-%D text mode.
-%D
-%D \starttyping
-%D \def\test#1{#1}
-%D
-%D \nonknuthmode $x_2$ x_2 \test{$x_2$} \test{x_2}
-%D
-%D \donknuthmode $x_2$ x_2 \test{$x_2$} \test{x_2}
-%D \stoptyping
-%D
-%D The result is as expected: the first line typesets ok, while the second
-%D one triggers an error message.
-
-\bgroup
-
- \ifx\normalsuber\undefined \def\normalsuber{_} \fi
- \ifx\normalsuper\undefined \def\normalsuper{^} \fi
-
- \catcode`_=\active
- \catcode`^=\active
-
- \gdef\nonknuthmode
- {\appendtoks\let_\normalsuber\let^\normalsuper\to\everymathematics
- \mathcode`_="8000
- \mathcode`^="8000
- \catcode`_=\@@other
- \catcode`^=\@@other
- \let\nonknuthmode\relax}
-
- \gdef\donknuthmode
- {\catcode`_=\@@subscript
- \catcode`^=\@@superscript}
-
-\egroup
-
-%D \macros
-%D {checkdelimiters, fakeleftdelimiter, fakerightdelimiter}
-%D
-%D Handy for non matching situations (as with mathml):
-%D
-%D \starttyping
-%D \checkdelimiters{... bla bla ...}
-%D \fakeleftdelimiter
-%D ... bla bla ...
-%D \fakerightdelimiter
-%D \stoptyping
-
-\newcount\delimitercount
-
-\def\leftfakedelimiter {\advance\delimitercount\minusone\gobbleoneargument}%
-\def\rightfakedelimiter{\advance\delimitercount\plusone \gobbleoneargument}%
-
-\def\checkdelimiters#1%
- {\delimitercount\zerocount
- \setbox\scratchbox\hbox\bgroup
- \let\left \leftfakedelimiter
- \let\right\rightfakedelimiter
- $#1\expandafter$\expandafter
- \egroup
- \expandafter\delimitercount\the\delimitercount\relax}
-
-\def\fakeleftdelimiter {\ifnum\delimitercount>\zerocount\left .\fi}
-\def\fakerightdelimiter{\ifnum\delimitercount<\zerocount\right.\fi}
-
-%D Needed for unicode:
-
-\def\nulloperator{\mathortext{\mathop{\null}}{\null}}
-
-%D To be dealt with ...
-
-\mathcode`\ ="8000 % \space
-\mathcode`\'="8000 % ^\prime
-\mathcode`\_="8000 % \_
-
-\protect \endinput
-
-\tracemathcollectiontrue
- \input math-tex \page
-\setupbodyfont[ams] \enablemathcollection[default] \input math-ams \page
-\setupbodyfont[lbr] \enablemathcollection[lbr] \input math-lbr \page
-\setupbodyfont[eul] \enablemathcollection[eul] \input math-eul \stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkii/math-lbr.mkii b/Master/texmf-dist/tex/context/base/mkii/math-lbr.mkii
deleted file mode 100644
index 0aa1df66514..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/math-lbr.mkii
+++ /dev/null
@@ -1,481 +0,0 @@
-%D \module
-%D [ file=math-lbr,
-%D version=2001.04.12,
-%D title=\CONTEXT\ Math Macros,
-%D subtitle=Lucida Specials,
-%D author={Hans Hagen \& Taco Hoekwater},
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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
-
-\definefamilysynonym [lbr] [calligraphy] [sy]
-\definefamilysynonym [lbr] [oldstyle] [mi]
-
-\definefamilysynonym [lbr] [blackboard] [ma]
-\definefamilysynonym [lbr] [ucgreek] [mb]
-\definefamilysynonym [lbr] [vargreek] [mi]
-
-\startmathcollection[lbr]
-
-\definemathsymbol [boxdot] [bin] [sy] ["ED]
-\definemathsymbol [boxplus] [bin] [sy] ["EA]
-\definemathsymbol [boxtimes] [bin] [sy] ["EC]
-\definemathsymbol [square] [ord] [ma] ["02]
-\definemathsymbol [Box] [ord] [ma] ["02] % square
-\definemathsymbol [blacksquare] [ord] [ma] ["03]
-\definemathsymbol [centerdot] [bin] [ma] ["E1] % [sy] ["01]
-\definemathsymbol [Diamond] [ord] [sy] ["05]
-\definemathsymbol [lozenge] [ord] [sy] ["05] % Diamond
-\definemathsymbol [blacklozenge] [ord] [ma] ["09]
-\definemathsymbol [circlearrowright] [rel] [ma] ["8C]
-\definemathsymbol [circlearrowleft] [rel] [ma] ["8B]
-\definemathsymbol [rightleftharpoons] [rel] [sy] ["8E]
-\definemathsymbol [leftrightharpoons] [rel] [sy] ["8D]
-\definemathsymbol [boxminus] [bin] [sy] ["EB]
-\definemathsymbol [Vdash] [rel] [sy] ["F0]
-\definemathsymbol [Vvdash] [rel] [mb] ["D3]
-\definemathsymbol [vDash] [rel] [mb] ["D6]
-\definemathsymbol [twoheadrightarrow] [rel] [ma] ["25]
-\definemathsymbol [twoheadleftarrow] [rel] [ma] ["23]
-\definemathsymbol [leftleftarrows] [rel] [ma] ["71]
-\definemathsymbol [rightrightarrows] [rel] [ma] ["73]
-\definemathsymbol [upuparrows] [rel] [ma] ["72]
-\definemathsymbol [downdownarrows] [rel] [ma] ["74]
-\definemathsymbol [upharpoonright] [rel] [ma] ["75]
-\definemathsymbol [restriction] [rel] [ma] ["77]
-\definemathsymbol [downharpoonright] [rel] [ma] ["77]
-\definemathsymbol [upharpoonleft] [rel] [ma] ["76]
-\definemathsymbol [downharpoonleft] [rel] [ma] ["78]
-\definemathsymbol [rightarrowtail] [rel] [ma] ["29]
-\definemathsymbol [leftarrowtail] [rel] [ma] ["28]
-\definemathsymbol [leftrightarrows] [rel] [ma] ["6E]
-\definemathsymbol [rightleftarrows] [rel] [ma] ["6D]
-\definemathsymbol [Lsh] [rel] [ma] ["7B]
-\definemathsymbol [Rsh] [rel] [ma] ["7D]
-\definemathsymbol [rightsquigarrow] [rel] [ma] ["8E]
-\definemathsymbol [leadsto] [rel] [ma] ["8E] % rightsquigarrow
-\definemathsymbol [leftrightsquigarrow] [rel] [ma] ["91]
-\definemathsymbol [looparrowleft] [rel] [ma] ["3F]
-\definemathsymbol [looparrowright] [rel] [ma] ["40]
-\definemathsymbol [circeq] [rel] [sy] ["D0]
-\definemathsymbol [succsim] [rel] [sy] ["E1]
-\definemathsymbol [gtrsim] [rel] [sy] ["DD]
-\definemathsymbol [gtrapprox] [rel] [mb] ["DB]
-\definemathsymbol [multimap] [rel] [mb] ["C7]
-\definemathsymbol [therefore] [rel] [sy] ["90]
-\definemathsymbol [because] [rel] [sy] ["91]
-\definemathsymbol [doteqdot] [rel] [sy] ["CA]
-\definemathsymbol [Doteq] [rel] [sy] ["CA] % doteqdot
-\definemathsymbol [triangleq] [rel] [sy] ["D5]
-\definemathsymbol [precsim] [rel] [sy] ["E0]
-\definemathsymbol [lesssim] [rel] [sy] ["DC]
-\definemathsymbol [lessapprox] [rel] [mb] ["DA]
-\definemathsymbol [eqslantless] [rel] [mb] ["E2]
-\definemathsymbol [eqslantgtr] [rel] [mb] ["E3]
-\definemathsymbol [curlyeqprec] [rel] [mb] ["E6]
-\definemathsymbol [curlyeqsucc] [rel] [mb] ["E7]
-\definemathsymbol [preccurlyeq] [rel] [mb] ["E4]
-\definemathsymbol [leqq] [rel] [sy] ["DA]
-\definemathsymbol [leqslant] [rel] [mb] ["E0]
-\definemathsymbol [lessgtr] [rel] [sy] ["DE]
-\definemathsymbol [backprime] [ord] [mb] ["C8]
-\definemathsymbol [dabar@] [ord] [ma] ["03] % !! @
-\definemathsymbol [risingdotseq] [rel] [sy] ["CC]
-\definemathsymbol [fallingdotseq] [rel] [sy] ["CB]
-\definemathsymbol [succcurlyeq] [rel] [mb] ["E5]
-\definemathsymbol [geqq] [rel] [sy] ["DB]
-\definemathsymbol [geqslant] [rel] [mb] ["E1]
-\definemathsymbol [gtrless] [rel] [sy] ["DF]
-\definemathsymbol [sqsubset] [rel] [sy] ["E4]
-\definemathsymbol [sqsupset] [rel] [sy] ["E5]
-\definemathsymbol [vartriangleright] [rel] [mb] ["2E]
-\definemathsymbol [rhd] [bin] [mb] ["2E]
-\definemathsymbol [lhd] [bin] [mb] ["2F]
-\definemathsymbol [vartriangleleft] [rel] [mb] ["2F]
-\definemathsymbol [trianglerighteq] [rel] [sy] ["F5]
-\definemathsymbol [unrhd] [bin] [sy] ["F5] % trianglerighteq
-\definemathsymbol [trianglelefteq] [rel] [sy] ["F4]
-\definemathsymbol [unlhd] [bin] [sy] ["F4] % trianglelefteq
-\definemathsymbol [bigstar] [ord] [ma] ["AB]
-\definemathsymbol [between] [rel] [mb] ["F2]
-\definemathsymbol [blacktriangledown] [ord] [ma] ["07]
-\definemathsymbol [blacktriangleright] [rel] [mb] ["F1]
-\definemathsymbol [blacktriangleleft] [rel] [mb] ["F0]
-\definemathsymbol [vartriangle] [rel] [ma] ["04]
-\definemathsymbol [triangleup] [ord] [ma] ["04] % vartriangle
-\definemathsymbol [blacktriangle] [ord] [ma] ["05]
-\definemathsymbol [triangledown] [ord] [ma] ["06]
-\definemathsymbol [eqcirc] [rel] [sy] ["CF]
-\definemathsymbol [lesseqgtr] [rel] [mb] ["E8]
-\definemathsymbol [gtreqless] [rel] [mb] ["E9]
-\definemathsymbol [lesseqqgtr] [rel] [mb] ["EA]
-\definemathsymbol [gtreqqless] [rel] [mb] ["EB]
-\definemathsymbol [Rrightarrow] [rel] [ma] ["6C]
-\definemathsymbol [Lleftarrow] [rel] [ma] ["6A]
-\definemathsymbol [veebar] [bin] [mb] ["D2]
-\definemathsymbol [barwedge] [bin] [sy] ["F6]
-\definemathsymbol [doublebarwedge] [bin] [sy] ["D4]
-\definemathsymbol [angle] [ord] [sy] ["8B]
-\definemathsymbol [measuredangle] [ord] [sy] ["8C]
-\definemathsymbol [sphericalangle] [ord] [sy] ["8D]
-\definemathsymbol [varpropto] [rel] [sy] ["2F]
-\definemathsymbol [smallsmile] [rel] [mb] ["5E]
-\definemathsymbol [smallfrown] [rel] [mb] ["5F]
-\definemathsymbol [Subset] [rel] [sy] ["F8]
-\definemathsymbol [Supset] [rel] [sy] ["F9]
-\definemathsymbol [Cup] [bin] [sy] ["FA]
-\definemathsymbol [doublecup] [bin] [sy] ["FA] % Cup
-\definemathsymbol [Cap] [bin] [sy] ["FB]
-\definemathsymbol [doublecap] [bin] [sy] ["FB]
-\definemathsymbol [curlywedge] [bin] [sy] ["84]
-\definemathsymbol [curlyvee] [bin] [sy] ["85]
-\definemathsymbol [leftthreetimes] [bin] [mb] ["D0]
-\definemathsymbol [rightthreetimes] [bin] [mb] ["D1]
-\definemathsymbol [subseteqq] [rel] [mb] ["EE]
-\definemathsymbol [supseteqq] [rel] [mb] ["EF]
-\definemathsymbol [bumpeq] [rel] [sy] ["C8]
-\definemathsymbol [Bumpeq] [rel] [sy] ["C7]
-\definemathsymbol [llless] [rel] [mb] ["DE]
-\definemathsymbol [lll] [rel] [mb] ["DE] % llless
-\definemathsymbol [gggtr] [rel] [mb] ["DF]
-\definemathsymbol [ggg] [rel] [mb] ["DF] % gggtr
-\definemathsymbol [ulcorner] [open] [ma] ["5B] [ma] ["5B]
-\definemathsymbol [urcorner] [close] [ma] ["5C] [ma] ["5C]
-\definemathsymbol [circledS] [ord] [mb] ["CA]
-\definemathsymbol [pitchfork] [rel] [ma] ["F3]
-\definemathsymbol [dotplus] [bin] [sy] ["89]
-\definemathsymbol [backsim] [rel] [sy] ["24]
-\definemathsymbol [backsimeq] [rel] [sy] ["27]
-\definemathsymbol [llcorner] [open] [ma] ["5D] [ma] ["5D]
-\definemathsymbol [lrcorner] [close] [ma] ["5E] [ma] ["5E]
-\definemathsymbol [complement] [ord] [mb] ["94]
-\definemathsymbol [intercal] [bin] [ma] ["03] % !!
-\definemathsymbol [circledcirc] [bin] [sy] ["E6]
-\definemathsymbol [circledast] [bin] [sy] ["E7]
-\definemathsymbol [circleddash] [bin] [mb] ["CC]
-
-\stopmathcollection
-
-\startmathcollection [lbr]
-
-\definemathsymbol [lvertneqq] [rel] [ma] ["DE]
-\definemathsymbol [gvertneqq] [rel] [ma] ["DE]
-\definemathsymbol [nleq] [rel] [ma] ["9C]
-\definemathsymbol [ngeq] [rel] [ma] ["9D]
-\definemathsymbol [nless] [rel] [ma] ["9A]
-\definemathsymbol [ngtr] [rel] [ma] ["9B]
-\definemathsymbol [nprec] [rel] [ma] ["E5]
-\definemathsymbol [nsucc] [rel] [ma] ["E6]
-\definemathsymbol [lneqq] [rel] [ma] ["DC]
-\definemathsymbol [gneqq] [rel] [ma] ["DE]
-\definemathsymbol [nleqslant] [rel] [ma] ["D6]
-\definemathsymbol [ngeqslant] [rel] [ma] ["D7]
-\definemathsymbol [lneq] [rel] [ma] ["DA]
-\definemathsymbol [gneq] [rel] [ma] ["DB]
-\definemathsymbol [npreceq] [rel] [ma] ["E7]
-\definemathsymbol [nsucceq] [rel] [ma] ["E8]
-\definemathsymbol [precnsim] [rel] [ma] ["EB]
-\definemathsymbol [succnsim] [rel] [ma] ["EC]
-\definemathsymbol [lnsim] [rel] [ma] ["E0]
-\definemathsymbol [gnsim] [rel] [ma] ["E2]
-\definemathsymbol [nleqq] [rel] [ma] ["D8]
-\definemathsymbol [ngeqq] [rel] [ma] ["D9]
-\definemathsymbol [precneqq] [rel] [ma] ["E9]
-\definemathsymbol [succneqq] [rel] [ma] ["EA]
-\definemathsymbol [precnapprox] [rel] [ma] ["ED]
-\definemathsymbol [succnapprox] [rel] [ma] ["EE]
-\definemathsymbol [lnapprox] [rel] [ma] ["E4]
-\definemathsymbol [gnapprox] [rel] [ma] ["E3]
-\definemathsymbol [nsim] [rel] [ma] ["96]
-\definemathsymbol [ncong] [rel] [ma] ["99]
-\definemathsymbol [diagup] [ord] [mb] ["CD]
-\definemathsymbol [diagdown] [ord] [mb] ["D8]
-\definemathsymbol [varsubsetneq] [rel] [ma] ["D0]
-\definemathsymbol [varsupsetneq] [rel] [ma] ["D1]
-\definemathsymbol [nsubseteqq] [rel] [ma] ["CA]
-\definemathsymbol [nsupseteqq] [rel] [ma] ["CB]
-\definemathsymbol [subsetneqq] [rel] [ma] ["CE]
-\definemathsymbol [supsetneqq] [rel] [ma] ["CF]
-\definemathsymbol [varsubsetneqq] [rel] [ma] ["D2]
-\definemathsymbol [varsupsetneqq] [rel] [ma] ["D3]
-\definemathsymbol [subsetneq] [rel] [ma] ["CC]
-\definemathsymbol [supsetneq] [rel] [ma] ["CD]
-\definemathsymbol [nsubseteq] [rel] [ma] ["C8]
-\definemathsymbol [nsupseteq] [rel] [ma] ["C9]
-\definemathsymbol [nparallel] [rel] [ma] ["F7]
-\definemathsymbol [nmid] [rel] [ma] ["F6]
-\definemathsymbol [nshortmid] [rel] [ma] ["F4]
-\definemathsymbol [nshortparallel] [rel] [ma] ["F5]
-\definemathsymbol [nvdash] [rel] [ma] ["F8]
-\definemathsymbol [nVdash] [rel] [ma] ["F9]
-\definemathsymbol [nvDash] [rel] [ma] ["FA]
-\definemathsymbol [nVDash] [rel] [ma] ["FB]
-\definemathsymbol [ntrianglerighteq] [rel] [ma] ["F2]
-\definemathsymbol [ntrianglelefteq] [rel] [ma] ["F1]
-\definemathsymbol [ntriangleleft] [rel] [ma] ["EF]
-\definemathsymbol [ntriangleright] [rel] [ma] ["F0]
-\definemathsymbol [nleftarrow] [rel] [ma] ["32]
-\definemathsymbol [nrightarrow] [rel] [ma] ["33]
-\definemathsymbol [nLeftarrow] [rel] [ma] ["66]
-\definemathsymbol [nRightarrow] [rel] [ma] ["68]
-\definemathsymbol [nLeftrightarrow] [rel] [ma] ["67]
-\definemathsymbol [nleftrightarrow] [rel] [ma] ["34]
-\definemathsymbol [divideontimes] [bin] [mb] ["F7]
-\definemathsymbol [varnothing] [ord] [sy] ["53]
-\definemathsymbol [nexists] [ord] [ma] ["20]
-\definemathsymbol [Finv] [ord] [mb] ["90]
-\definemathsymbol [Game] [ord] [mb] ["91]
-\definemathsymbol [mho] [ord] [mb] ["92]
-\definemathsymbol [eth] [ord] [ma] ["03] % !!
-\definemathsymbol [eqsim] [rel] [sy] ["99]
-\definemathsymbol [beth] [ord] [mb] ["95]
-\definemathsymbol [gimel] [ord] [mb] ["96]
-\definemathsymbol [daleth] [ord] [mb] ["97]
-\definemathsymbol [lessdot] [bin] [mb] ["DC]
-\definemathsymbol [gtrdot] [bin] [mb] ["DD]
-\definemathsymbol [ltimes] [bin] [mb] ["CF]
-\definemathsymbol [rtimes] [bin] [mb] ["CE]
-\definemathsymbol [shortmid] [rel] [mb] ["F4]
-\definemathsymbol [shortparallel] [rel] [mb] ["F5]
-\definemathsymbol [smallsetminus] [bin] [mb] ["D8]
-\definemathsymbol [thicksim] [rel] [sy] ["18] % not that thick
-\definemathsymbol [thickapprox] [rel] [sy] ["19] % not that thick
-\definemathsymbol [approxeq] [rel] [sy] ["9D]
-\definemathsymbol [succapprox] [rel] [mb] ["ED]
-\definemathsymbol [precapprox] [rel] [mb] ["EC]
-\definemathsymbol [curvearrowleft] [rel] [ma] ["87]
-\definemathsymbol [curvearrowright] [rel] [ma] ["88]
-\definemathsymbol [digamma] [ord] [ma] ["03] % !!
-\definemathsymbol [varkappa] [ord] [mb] ["9B]
-\definemathsymbol [Bbbk] [ord] [ma] ["6B]
-\definemathsymbol [hslash] [ord] [mb] ["9D]
-\definemathsymbol [hbar] [ord] [ma] ["1B]
-\definemathsymbol [backepsilon] [rel] [ma] ["03] % !!
-
-\stopmathcollection
-
-\startmathcollection [lbr]
-
-\definemathsymbol [yen] [nothing] [ma] ["03] % !!
-\definemathsymbol [checkmark] [nothing] [ma] ["AC]
-\definemathsymbol [circledR] [nothing] [mb] ["C9]
-\definemathsymbol [maltese] [nothing] [mb] ["CB]
-
-\stopmathcollection
-
-\startmathcollection [lbr]
-
-\definemathsymbol [dashrightarrow] [rel] [ma] ["3A]
-\definemathsymbol [dashleftarrow] [rel] [ma] ["38]
-\definemathcommand [dasharrow] [rel] {\dashleftarrow\mkern-15.8mu\dashrightarrow}
-%definemathcommand [Join] [rel] {\mathchar"0D6F\mkern-15.8mu\mathchar"0D6E} % !!
-
-\stopmathcollection
-
-\startmathcollection[lbr]
-
-\definemathcharacter [91] [open] [mi] ["86]
-\definemathcharacter [93] [close] [mi] ["87]
-\definemathcharacter [(] [open] [mi] ["84]
-\definemathcharacter [)] [close] [mi] ["85]
-\definemathcharacter [/] [nothing] [mi] ["3D]
-\definemathcharacter [=] [rel] [sy] ["83]
-\definemathcharacter [+] [bin] [sy] ["82]
-
-\definemathcharacter [91] [nothing] [mi] ["86] [ex] ["02]
-\definemathcharacter [93] [nothing] [mi] ["87] [ex] ["03]
-\definemathcharacter [(] [nothing] [mi] ["84] [ex] ["00]
-\definemathcharacter [)] [nothing] [mi] ["85] [ex] ["01]
-\definemathcharacter [/] [nothing] [mi] ["3D] [ex] ["0E]
-
-\stopmathcollection
-
-\startmathcollection[lbr]
-
-\definemathcharacter [:] [punct] [tf] ["3A] % unbelievable, but enabled again for Mojca
-\definemathcharacter [;] [punct] [tf] ["3B] % unbelievable, but enabled again for Mojca
-
-\stopmathcollection
-
-\startmathcollection[lbr]
-
-\definemathsymbol [ldbrack] [open] [mi] ["82] [ex] ["82]
-\definemathsymbol [rdbrack] [close] [mi] ["83] [ex] ["83]
-\definemathsymbol [surfintop] [op] [ex] ["90]
-\definemathsymbol [midintop] [op] [ex] ["92]
-\definemathsymbol [midointop] [op] [ex] ["93]
-\definemathsymbol [midsurfintop] [op] [ex] ["94]
-\definemathsymbol [largeint] [op] [ex] ["5A] [ex] ["95]
-
-% \definemathcommand [surfint] [nolop] {\surfintop}
-% \definemathcommand [midint] [nolop] {\midintop}
-% \definemathcommand [midoint] [nolop] {\midointop}
-% \definemathcommand [midsurfint] [nolop] {\midsurfintop}
-
-\definemathsymbol [surfint] [nolop] [ex] ["90]
-\definemathsymbol [midint] [nolop] [ex] ["92]
-\definemathsymbol [midoint] [nolop] [ex] ["93]
-\definemathsymbol [midsurfint] [nolop] [ex] ["94]
-
-\definemathsymbol [dblint] [ord] [mi] ["88]
-\definemathsymbol [trplint] [ord] [mi] ["89]
-\definemathsymbol [contint] [ord] [mi] ["8A]
-\definemathsymbol [surfint] [ord] [mi] ["8B]
-\definemathsymbol [volint] [ord] [mi] ["8C]
-\definemathsymbol [clwint] [ord] [mi] ["8D]
-\definemathsymbol [cclwcint] [ord] [mi] ["8E]
-\definemathsymbol [clwcint] [ord] [mi] ["8F]
-\definemathsymbol [bowtie] [rel] [mi] ["F6]
-\definemathsymbol [models] [rel] [sy] ["EE]
-\definemathsymbol [doteq] [rel] [sy] ["C9]
-\definemathsymbol [cong] [rel] [sy] ["9B]
-\definemathsymbol [hbar] [ord] [mi] ["9D]
-\definemathsymbol [neq] [rel] [ma] ["94]
-\definemathsymbol [rightleftharpoons] [rel] [ma] ["7A]
-\definemathsymbol [leftrightharpoons] [rel] [ma] ["79]
-\definemathsymbol [hookleftarrow] [rel] [ma] ["3C]
-\definemathsymbol [hookrightarrow] [rel] [ma] ["3E]
-\definemathsymbol [mapsto] [rel] [ma] ["2C]
-
-\definemathcommand [longmapsto] {\mapstochar\longrightarrow}
-
-\stopmathcollection
-
-\startmathcollection[lbr]
-
-\definemathsymbol [Gamma] [alpha] [ucgreek] ["00]
-\definemathsymbol [Delta] [alpha] [ucgreek] ["01]
-\definemathsymbol [Theta] [alpha] [ucgreek] ["02]
-\definemathsymbol [Lambda] [alpha] [ucgreek] ["03]
-\definemathsymbol [Xi] [alpha] [ucgreek] ["04]
-\definemathsymbol [Pi] [alpha] [ucgreek] ["05]
-\definemathsymbol [Sigma] [alpha] [ucgreek] ["06]
-\definemathsymbol [Upsilon] [alpha] [ucgreek] ["07]
-\definemathsymbol [Phi] [alpha] [ucgreek] ["08]
-\definemathsymbol [Psi] [alpha] [ucgreek] ["09]
-\definemathsymbol [Omega] [alpha] [ucgreek] ["0A]
-
-\definemathsymbol [varGamma] [ord] [vargreek] ["00]
-\definemathsymbol [varDelta] [ord] [vargreek] ["01]
-\definemathsymbol [varTheta] [ord] [vargreek] ["02]
-\definemathsymbol [varLambda] [ord] [vargreek] ["03]
-\definemathsymbol [varXi] [ord] [vargreek] ["04]
-\definemathsymbol [varPi] [ord] [vargreek] ["05]
-\definemathsymbol [varSigma] [ord] [vargreek] ["06]
-\definemathsymbol [varUpsilon] [ord] [vargreek] ["07]
-\definemathsymbol [varPhi] [ord] [vargreek] ["08]
-\definemathsymbol [varPsi] [ord] [vargreek] ["09]
-\definemathsymbol [varOmega] [ord] [vargreek] ["0A]
-
-\stopmathcollection
-
-% we define the whole lot, although only a few differ (esp dot)
-
-% \startmathcollection[lbr]
-%
-% \definemathsymbol [acute] [accent] [tf] ["13] % mr -> tf
-% \definemathsymbol [grave] [accent] [tf] ["12] % mr -> tf
-% \definemathsymbol [ddot] [accent] [tf] ["7F] % mr -> tf
-% \definemathsymbol [tilde] [accent] [tf] ["7E] % mr -> tf
-% \definemathsymbol [bar] [accent] [tf] ["16] % mr -> tf
-% \definemathsymbol [breve] [accent] [tf] ["15] % mr -> tf
-% \definemathsymbol [check] [accent] [tf] ["14] % mr -> tf
-% \definemathsymbol [hat] [accent] [tf] ["5E] % mr -> tf
-% \definemathsymbol [vec] [accent] [mi] ["7E] % [ord]
-% \definemathsymbol [dot] [accent] [tf] ["05] % mr -> tf, 5F -> 05
-% \definemathsymbol [widetilde] [accent] [ex] ["65] % [ord]
-% \definemathsymbol [widehat] [accent] [ex] ["62] % [ord]
-%
-% \stopmathcollection
-
-\startmathcollection[lbr:texnansi]
- \definemathsymbol [acute] [accent] [tf] ["13]
- \definemathsymbol [grave] [accent] [tf] ["12]
- \definemathsymbol [ddot] [accent] [tf] ["7F]
- %definemathsymbol [ddot] [accent] [tf] ["A8] % both is OK
- \definemathsymbol [tilde] [accent] [tf] ["7E]
- %definemathsymbol [tilde] [accent] [tf] ["98] % both is OK
- \definemathsymbol [bar] [accent] [tf] ["16]
- \definemathsymbol [breve] [accent] [tf] ["15]
- \definemathsymbol [check] [accent] [tf] ["14]
- \definemathsymbol [hat] [accent] [tf] ["5E]
- %definemathsymbol [hat] [accent] [tf] ["88] % both is OK
- \definemathsymbol [dot] [accent] [tf] ["05]
- % Why is mathring not defined??
- \definemathsymbol [mathring] [accent] [tf] ["17]
-\stopmathcollection
-
-\startmathcollection[lbr:ec]
- \definemathsymbol [acute] [accent] [tf] ["01]
- \definemathsymbol [grave] [accent] [tf] ["00]
- \definemathsymbol [ddot] [accent] [tf] ["04]
- \definemathsymbol [tilde] [accent] [tf] ["03]
- \definemathsymbol [bar] [accent] [tf] ["09]
- \definemathsymbol [breve] [accent] [tf] ["08]
- \definemathsymbol [check] [accent] [tf] ["07]
- \definemathsymbol [hat] [accent] [tf] ["02]
- \definemathsymbol [dot] [accent] [tf] ["0A]
- % Why is mathring not defined??
- \definemathsymbol [mathring] [accent] [tf] ["06]
-\stopmathcollection
-
-\def\LBRroot#1#2%
- {\setbox\zerocount\hbox{$\mathsurround\zeropoint#1\sqrt{#2}$}
- \dimen@\ht\zerocount \advance\dimen@-\dp\zerocount
- \mkern5mu\raise.6\dimen@\copy\rootbox \mkern-7.5mu \box\zerocount}
-
-\def\LBRmatrix#1%
- {\null\,\vcenter{\normalbaselines\mathsurround\zeropoint
- \ialign{\hfil$##$\hfil&&\quad\hfil$##$\hfil\crcr
- \mathstrut\crcr\noalign{\kern-0.9\baselineskip}
- #1\crcr\mathstrut\crcr\noalign{\kern-0.9\baselineskip}}}\,}
-
-\startrawmathcollection[lbr]
-
-\definemathcommand [mathstrut] {\vphantom{f}}
-\definemathcommand [joinrel] {\mathrel{\mkern-4mu}}
-\definemathcommand [r@@t] {\LBRroot}
-\definemathcommand [matrix] {\LBRmatrix}
-
-\stoprawmathcollection
-
-% \def\LBRbig {\@@dobig{8.20}}
-% \def\LBRBig {\@@dobig{10.80}}
-% \def\LBRbigg {\@@dobig{13.42}}
-% \def\LBRBigg {\@@dobig{16.03}}
-% \def\LBRbiggg{\@@dobig{17.72}}
-% \def\LBRBiggg{\@@dobig{21.25}}
-
-\def\LBRbig {\@@dobig{0.820}}
-\def\LBRBig {\@@dobig{1.080}}
-\def\LBRbigg {\@@dobig{1.342}}
-\def\LBRBigg {\@@dobig{1.603}}
-\def\LBRbiggg{\@@dobig{1.772}}
-\def\LBRBiggg{\@@dobig{2.125}}
-
-\startrawmathcollection[lbr]
-
-\definemathcommand [big] {\LBRbig}
-\definemathcommand [Big] {\LBRBig}
-\definemathcommand [bigg] {\LBRbigg}
-\definemathcommand [Bigg] {\LBRBigg}
-\definemathcommand [biggg] {\LBRbiggg}
-\definemathcommand [Biggg] {\LBRBiggg}
-
-\stoprawmathcollection
-
-\startrawmathcollection[lbr]
-
-\definemathcommand [bigggl] [open] {\biggg}
-\definemathcommand [bigggr] [close] {\biggg}
-\definemathcommand [Bigggl] [open] {\Biggg}
-\definemathcommand [Bigggr] [close] {\Biggg}
-
-\stoprawmathcollection
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/math-pln.mkii b/Master/texmf-dist/tex/context/base/mkii/math-pln.mkii
deleted file mode 100644
index 975869c702c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/math-pln.mkii
+++ /dev/null
@@ -1,360 +0,0 @@
-%D \module
-%D [ file=math-pln,
-%D version=2001.11.16,
-%D title=\CONTEXT\ Math Macros,
-%D subtitle=Plain Helpers,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% \points should become \bodyfontsize
-
-%D This is a temporary module, some of this code will move to
-%D the other math modules.
-
-\writestatus{loading}{ConTeXt Math Macros / Plain Helpers}
-
-\unprotect
-
-\ifx\displ@y\undefined \let\displ@y\relax\fi
-
-\newbox\rootbox
-
-\def\root#1\of
- {\setbox\rootbox\hbox{$\mathsurround\zeropoint\scriptscriptstyle{#1}$}%
- \mathpalette\r@@t}
-
-\def\r@@t#1#2% will be overloaded
- {\setbox\zerocount\hbox{$\mathsurround\zeropoint#1\sqrt{#2}$}\dimen@\ht\zerocount
- \advance\dimen@-\dp\zerocount
- \mkern5mu\raise.6\dimen@\copy\rootbox
- \mkern-10mu\box\zerocount}
-
-\def\mathhexbox#1#2#3%
- {\leavevmode
- \hbox{$\mathsurround\zeropoint\mathchar"#1#2#3$}}
-
-\def\oalign#1%
- {\leavevmode
- \vtop
- {\baselineskip\zeroskip \lineskip.25ex%
- \ialign{##\crcr#1\crcr}}}
-
-\def\o@lign
- {\lineskiplimit\zeropoint \oalign}
-
-\def\ooalign % chars over each other
- {\lineskiplimit-\maxdimen
- \oalign}
-
-\def\sh@ft#1% kern by #1 times the current slant
- {\dimen@#1%
- \kern\expandafter\withoutpt\the\slantperpoint
- \dimen@}
-
-\def\dots
- {\relax\ifmmode\ldots\else$\mathsurround\zeropoint\ldots\,$\fi}
-
-\def\hrulefill
- {\leaders\hrule\hfill}
-
-\def\dotfill
- {\cleaders\hbox{$\mathsurround\zeropoint \mkern1.5mu.\mkern1.5mu$}\hfill}
-
-\def\rightarrowfill
- {$\mathsurround\zeropoint\smash-\mkern-7mu%
- \cleaders\hbox{$\mkern-2mu\smash-\mkern-2mu$}\hfill
- \mkern-7mu\mathord\rightarrow$}
-
-\def\leftarrowfill
- {$\mathsurround\zeropoint\mathord\leftarrow\mkern-7mu%
- \cleaders\hbox{$\mkern-2mu\smash-\mkern-2mu$}\hfill
- \mkern-7mu\smash-$}
-
-% must go to math-tex
-
-\ifx\braceld\undefined
- % mkii values
- \mathchardef\braceld="37A
- \mathchardef\bracerd="37B
- \mathchardef\bracelu="37C
- \mathchardef\braceru="37D
-\fi
-
-\def\downbracefill
- {$\mathsurround\zeropoint\setbox\zerocount\hbox{$\braceld$}%
- \braceld\leaders\vrule\!!height\ht\zerocount\!!depth\zeropoint\hfill\braceru
- \bracelu\leaders\vrule\!!height\ht\zerocount\!!depth\zeropoint\hfill\bracerd$}
-
-\def\upbracefill
- {$\mathsurround\zeropoint\setbox\zerocount\hbox{$\braceld$}%
- \bracelu\leaders\vrule\!!height\ht\zerocount\!!depth\zeropoint\hfill\bracerd
- \braceld\leaders\vrule\!!height\ht\zerocount\!!depth\zeropoint\hfill\braceru$}
-
-% hm, shouldn't that be \kern3\bodyfontsize
-
-\def\overbrace#1%
- {\mathop{\vbox{\mathsurround\zeropoint\ialign{##\crcr\noalign{\kern3\points}
- \downbracefill\crcr\noalign{\kern3\points\nointerlineskip}
- $\hfil\displaystyle{#1}\hfil$\crcr}}}\limits}
-
-\def\underbrace#1%
- {\mathop{\vtop{\mathsurround\zeropoint\ialign{##\crcr
- $\hfil\displaystyle{#1}\hfil$\crcr\noalign{\kern3\points\nointerlineskip}
- \upbracefill\crcr\noalign{\kern3\points}}}}\limits}
-
-\let\sp=^ % will become obsolete
-\let\sb=_ % will become obsolete
-
-\ifx\,\undefined \def\,{\mskip \thinmuskip } \fi
-\ifx\>\undefined \def\>{\mskip \medmuskip } \fi
-\ifx\;\undefined \def\;{\mskip \thickmuskip} \fi
-\ifx\!\undefined \def\!{\mskip-\thinmuskip } \fi
-\ifx\*\undefined \def\*{\discretionary{\thinspace\the\textfont2\char2}{}{}} \fi
-
-% {\catcode`\'=\active \gdef'{^\bgroup\prim@s}}
-
-\def\activemathquote{^\bgroup\prim@s}
-
-\def\prim@s
- {\prime\futurelet\next\pr@m@s}
-
-\def\pr@m@s
- {\ifx'\next
- \@EA\pr@@@s
- \else\ifx^\next
- \@EAEAEA\pr@@@t
- \else
- \@EAEAEA\egroup
- \fi\fi}
-
-\def\pr@@@s#1%
- {\prim@s}
-
-\def\pr@@@t#1#2%
- {#2\egroup}
-
-% {\catcode`\_=\active \global\let_=\_} % _ in math is either subscript or \_
-
-\let\activemathunderscore\_
-
-\def\relbar {\mathrel{\smash-}} % - has the same height as +
-\def\Relbar {\mathrel=}
-
-\def\Longrightarrow {\Relbar\joinrel\Rightarrow}
-\def\longrightarrow {\relbar\joinrel\rightarrow}
-\def\longleftarrow {\leftarrow\joinrel\relbar}
-\def\Longleftarrow {\Leftarrow\joinrel\Relbar}
-\def\longmapsto {\mapstochar\longrightarrow}
-\def\longleftrightarrow{\leftarrow\joinrel\rightarrow}
-\def\Longleftrightarrow{\Leftarrow\joinrel\Rightarrow}
-
-\def\overrightarrow#1%
- {\vbox{\mathsurround\zeropoint\ialign{##\crcr
- \rightarrowfill\crcr\noalign{\kern-\onepoint\nointerlineskip}
- $\hfil\displaystyle{#1}\hfil$\crcr}}}
-
-\def\overleftarrow#1%
- {\vbox{\mathsurround\zeropoint\ialign{##\crcr
- \leftarrowfill\crcr\noalign{\kern-\onepoint\nointerlineskip}
- $\hfil\displaystyle{#1}\hfil$\crcr}}}
-
-\def\skew#1#2#3%
- {{\muskip\zerocount#1mu\divide\muskip\zerocount\plustwo \mkern\muskip\zerocount
- #2{\mkern-\muskip\zerocount{#3}\mkern\muskip\zerocount}\mkern-\muskip\zerocount}{}}
-
-\def\choose{\atopwithdelims()}
-\def\brack {\atopwithdelims[]}
-\def\brace {\atopwithdelims\{\}}
-
-\def\mathpalette#1#2%
- {\mathchoice
- {#1\displaystyle {#2}}%
- {#1\textstyle {#2}}%
- {#1\scriptstyle {#2}}%
- {#1\scriptscriptstyle{#2}}}
-
-\def\cong
- {\mathrel{\mathpalette\@vereq\sim}} % congruence sign
-
-\def\@vereq#1#2%
- {\lower.5\points\vbox{\lineskiplimit\maxdimen\lineskip-.5\points
- \ialign{$\mathsurround\zeropoint#1\hfil##\hfil$\crcr#2\crcr=\crcr}}}
-
-\def\notin% can be mkiv'd
- {\mathrel{\mathpalette\c@ncel\in}}
-
-\def\c@ncel#1#2%
- {\mathsurround\zeropoint\ooalign{$\hfil#1\mkern1mu/\hfil$\crcr$#1#2$}}
-
-\def\rightleftharpoons%
- {\mathrel{\mathpalette\rlh@{}}}
-
-\def\rlh@#1%
- {\vcenter
- {\mathsurround\zeropoint
- \hbox
- {\ooalign
- {\raise2pt\hbox{$#1\rightharpoonup$}\crcr
- $#1\leftharpoondown$}}}}
-
-\def\buildrel#1\over#2%
- {\mathrel{\mathop{\kern\zeropoint#2}\limits^{#1}}}
-
-\def\doteq
- {\buildrel\textstyle.\over=}
-
-\ifx\mfunction\undefined \def\mfunction#1{\mathbin{\rm#1}} \fi
-
-\def\bmod
- {\nonscript
- \mskip-\medmuskip
- \mkern5mu
- \mfunction{mod}%
- \penalty900
- \mkern5mu
- \nonscript
- \mskip-\medmuskip}
-
-\def\pmod#1%
- {\allowbreak
- \mkern18mu
- (\mfunction{mod}\,\,#1)}
-
-\def\cases#1%
- {\left\{%
- \,%
- \vcenter
- {\normalbaselines
- \mathsurround\zeropoint
- \ialign{$##\hfil$&\quad##\hfil\crcr#1\crcr}}%
- \right.}
-
-\def\matrix#1%
- {\null
- \,%
- \vcenter
- {\normalbaselines\mathsurround\zeropoint
- \ialign{\hfil$##$\hfil&&\quad\hfil$##$\hfil\crcr
- \mathstrut\crcr\noalign{\kern-\baselineskip}
- #1\crcr\mathstrut\crcr\noalign{\kern-\baselineskip}}}%
- \,}
-
-\def\pmatrix#1%
- {\left(\matrix{#1}\right)}
-
-\newdimen\mathparentwd
-
-% \setbox0=\hbox{\tenex B} \mathparentwd=\wd0 % width of the big left (
-
-\def\bordermatrix#1%
- {\begingroup
- \mathsurround\zeropoint
- \setbox\zerocount\vbox
- {\def\cr{\crcr\noalign{\kern2\points\global\let\cr\endline}}%
- \ialign{$##$\hfil\kern2\points\kern\mathparentwd&\thinspace\hfil$##$\hfil
- &&\quad\hfil$##$\hfil\crcr
- \omit\strut\hfil\crcr\noalign{\kern-\baselineskip}%
- #1\crcr\omit\strut\cr}}%
- \setbox\plustwo\vbox
- {\unvcopy\zerocount\global\setbox\plusone\lastbox}%
- \setbox\plustwo\hbox
- {\unhbox\plusone\unskip\global\setbox\plusone\lastbox}%
- \setbox\plustwo\hbox
- {$\kern\wd\plusone\kern-\mathparentwd\left(\kern-\wd\plusone
- \global\setbox\plusone\vbox{\box\plusone\kern2\points}%
- \vcenter{\kern-\ht\plusone\unvbox\zerocount\kern-\baselineskip}\,\right)$}%
- \null
- \;%
- \vbox{\kern\ht\plusone\box\plustwo}%
- \endgroup}
-
-% \def\openup{\afterassignment\@penup\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\displayopenupvalue % was \openup\jot
- \mathsurround\zeropoint
- \ialign
- {\strut\hfil$\displaystyle{##}$&$\displaystyle{{}##}$\hfil\crcr
- #1\crcr}}%
- \,}
-
-\def\@lign % restore inside \displ@y
- {\tabskip\zeroskip
- \everycr{}}
-
-\def\displaylines#1%
- {\displ@y
- \tabskip\zeroskip
- \halign
- {\hbox to \displaywidth{$\@lign\hfil\displaystyle##\hfil$}\crcr
- #1\crcr}}
-
-\def\eqalignno#1%
- {\displ@y
- \tabskip\centering
- \halign to \displaywidth
- {\hfil$\@lign\displaystyle{##}$\tabskip\zeroskip
- &$\@lign\displaystyle{{}##}$\hfil\tabskip\centering
- &\llap{$\@lign##$}\tabskip\zeroskip\crcr
- #1\crcr}}
-
-\def\leqalignno#1%
- {\displ@y
- \tabskip\centering
- \halign to \displaywidth
- {\hfil$\@lign\displaystyle{##}$\tabskip\zeroskip
- &$\@lign\displaystyle{{}##}$\hfil\tabskip\centering
- &\kern-\displaywidth\rlap{$\@lign##$}\tabskip\displaywidth\crcr
- #1\crcr}}
-
-% temporary here
-
-% \startcatcodetable \mthcatcodes
-% \setcatcodetable\ctxcatcodes
-% \catcode`\_ = 13
-% \catcode`\' = 13
-% \stopcatcodetable
-%
-% \letcatcodecommand \mthcatcodes `\_ \activemathunderscore
-% \letcatcodecommand \mthcatcodes `\' \activemathquote
-
-% \appendtoks \setcatcodetable\mthcatcodes \to \everymath : spoils xml
-
-% tricky, but some day we will reimplement math
-
-\bgroup
- \catcode`\_ = 13
- \catcode`\' = 13
- \doglobal\appendtoks
- \let_\activemathunderscore
- \let'\activemathquote
- \to \everymathematics
-\egroup
-
-% so far
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/math-run.mkii b/Master/texmf-dist/tex/context/base/mkii/math-run.mkii
deleted file mode 100644
index 79d08fbedb1..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/math-run.mkii
+++ /dev/null
@@ -1,105 +0,0 @@
-%D \module
-%D [ file=math-run,
-%D version=2001.23.04,
-%D title=\CONTEXT\ Math Macros,
-%D subtitle=Runtime Macros,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Math Macros / Runtime Macros}
-
-\unprotect
-
-\ifx\showmathmodern\undefined \global\chardef\showmathmodern\zerocount \fi
-
-\gdef\showmathcharacters% nearly \showcharacters
- {\par
- \bgroup
- \ifcase\showmathmodern\or\ifx\modern\undefined\chardef\showmathmodern\zerocount\fi\fi
- \setuptextrules[\c!bodyfont=,\c!style=]
- \starttextrule{math characters -- \currentmathcollection}
- \whitespace
- \dontcomplain
- \forgetall
- \def\startmathcollection[##1]{}
- \let\stopmathcollection\relax
- \dimen0\zeropoint
- \dimen2\zeropoint
- \def\definemathsymbol {\dosixtupleempty\dodefinemathsymbol}
- \def\definemathcharacter{\dosixtupleempty\dodefinemathcharacter}
- \def\definemathcommand {\dotripleempty \dodefinemathcommand}
- %\newcounter\mathcolor
- \def\dodefinemathsymbol[##1][##2][##3][##4][##5][##6]%
- {%\doifcolorelse{math \purefamilyhex{##3}}{}
- % {\increment\mathcolor
- % \definecolor[math \purefamilyhex{##3}][\mathcolor]}%
- \setbox0\hbox spread 1em{\mathematics{\getvalue{##1}{}{}{}}}%
- \ifdim\wd0>\dimen0 \dimen0=\wd0 \fi
- \setbox2\hbox spread 1em{\hbox to 1em{\tttf\purefamilyhex{##3}\hss}\box0 ##1}%
- \ifdim\wd2>\dimen2 \dimen2=\wd2 \fi}
- \def\dodefinemathcharacter[##1][##2][##3][##4][##5][##6]{}
- \def\dodefinemathcommand [##1][##2][##3]##4{}
- \readsysfile{\f!mathprefix tex.mkii}\!!doneatrue\!!doneafalse
- \readsysfile{\f!mathprefix ams.mkii}\!!donebtrue\!!donebfalse
- \if!!donea
- \if!!doneb
- \edef\encwidth{\the\dimen0}
- \dimen0=\hsize
- \advance\dimen0 2em
- \advance\dimen2 2em
- \ifcase\showmathmodern\or\advance\dimen2 4em\fi
- \divide \dimen0 by \dimen2 \advance\dimen0 1sp
- \edef\enccols{\number\dimen0}
- \startcolumns[\c!n=\enccols,\c!distance=2em]
- \def\dodefinemathsymbol[##1][##2][##3][##4][##5][##6]%
- {%\localcolortrue
- %\color
- % [math \purefamilyhex{##3}]
- {\hbox
- {\ifcase\showmathmodern\or
- \hbox to \encwidth{\modern\let\mathcollection\nomathcollection\mathematics{\getvalue{##1}{}{}{}}\hss}%
- \fi
- \hbox to \encwidth{\mathematics{\getvalue{##1}{}{}{}}\hss}%
- \hbox to 1em{\tttf\purefamilyhex{##3}\hss}##1}\par}}
- \readsysfile{\f!mathprefix tex.mkii}\donothing\donothing
- \readsysfile{\f!mathprefix ams.mkii}\donothing\donothing
- \stopcolumns
- \else
- \par \tttf no chars in \f!mathprefix ams\par
- \fi
- \else
- \par \tttf no chars in \f!mathprefix tex\par
- \fi
- \stoptextrule
- \egroup}
-
-% \definecolor[math \purefamilyhex{mr}] [darkred]
-% \definecolor[math \purefamilyhex{mi}] [darkgreen]
-% \definecolor[math \purefamilyhex{sy}] [darkblue]
-% \definecolor[math \purefamilyhex{ex}] [darkmagenta]
-% \definecolor[math \purefamilyhex{nn}] [darkyellow]
-% \definecolor[math \purefamilyhex{ma}] [lightred]
-% \definecolor[math \purefamilyhex{mb}] [lightgreen]
-% \definecolor[math \purefamilyhex{mc}] [lightblue]
-% \definecolor[math \purefamilyhex{md}] [lightmagenta]
-
-\gdef\showmathtoken#1%
- {\starttabulate[|lT|lT|lT|l|]
- \NC token \NC #1 \NC \NR
- \NC collection \NC \ifcsname\@mt@\mathcollection#1\endcsname
- \mathcollection
- \else\ifcsname\@mt@\nomathcollection#1\endcsname
- \nomathcollection
- \else
- ?%
- \fi\fi \NC \NR
- \NC visualization \NC \mathematics{\getvalue{#1}} \NC \NR
- \NC definition \NC \tttf \@EA\defconvertedcommand\@EA\ascii\csname\@mt@\mathcollection#1\endcsname \ascii \NC \NR
- \stoptabulate}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/math-tex.mkii b/Master/texmf-dist/tex/context/base/mkii/math-tex.mkii
deleted file mode 100644
index e3dd634e6ef..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/math-tex.mkii
+++ /dev/null
@@ -1,720 +0,0 @@
-%D \module
-%D [ file=math-tex,
-%D version=2001.04.12,
-%D subtitle=Plain Specials,
-%D author={Hans Hagen, Taco Hoekwater \& Aditya Mahajan},
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% beware: in mkiv we will do it differently
-
-\unprotect
-
-\mathcode`\ ="8000 \mathcode`\_="8000 \mathcode`\'="8000
-
-\definefamilysynonym [default] [calligraphic] [sy]
-\definefamilysynonym [default] [oldstyle] [mi]
-\definefamilysynonym [default] [blackboard] [mr]
-\definefamilysynonym [default] [gothic] [mr]
-\definefamilysynonym [default] [fraktur] [mr]
-
-\definefamilysynonym [default] [lcgreek] [mi]
-\definefamilysynonym [default] [ucgreek] [mr]
-\definefamilysynonym [default] [vargreek] [mi]
-
-
-%D \macros
-%D {\setupmathematics}
-%D
-%D Configuration for integrals. (If needed we can speed this up and make it
-%D installable; no processaction is needed then).
-
-\chardef\intlimitcode\zerocount % 0 nolimits 1 displaylimits 2 limits
-
-\def\intlimits
- {\ifcase\intlimitcode \nolimits \or \displaylimits \or \limits \fi}
-
-\def\setupmathematics
- {\dosingleargument\dosetupmathematics}
-
-\def\dosetupmathematics[#1]%
- {\getparameters[\??mo][#1]
- \processaction[\@@mointegral]
- [ nolimits=>\chardef\intlimitcode\zerocount,
- displaylimits=>\chardef\intlimitcode\plusone,
- limits=>\chardef\intlimitcode\plustwo]}
-
-%D \startbuffer
-%D $\int_a^b f(x) dx$ and also
-%D $\iint_a^b f(x,y) dxdy$, $\iiint_a^b f(x,y) dxdy$,
-%D $\iiiint_a^b f(x) dx$
-%D \startformula
-%D \int_a^b f(x) dx \quad
-%D \iint_a^b f(x) dx \quad
-%D \iiint_a^b f(x) dx \quad
-%D \iiiint_a^b f(x) dx \quad
-%D \stopformula
-%D \stopbuffer
-%D
-%D Default: \getbuffer
-%D
-%D Displaylimits: \setupmathematics[integral=displaylimits] \getbuffer
-%D
-%D Limits: \setupmathematics[integral=limits] \getbuffer
-
-\startmathcollection [default]
-
-\definemathsymbol [alpha] [nothing] [lcgreek] ["0B]
-\definemathsymbol [beta] [nothing] [lcgreek] ["0C]
-\definemathsymbol [gamma] [nothing] [lcgreek] ["0D]
-\definemathsymbol [delta] [nothing] [lcgreek] ["0E]
-\definemathsymbol [epsilon] [nothing] [lcgreek] ["0F]
-\definemathsymbol [zeta] [nothing] [lcgreek] ["10]
-\definemathsymbol [eta] [nothing] [lcgreek] ["11]
-\definemathsymbol [theta] [nothing] [lcgreek] ["12]
-\definemathsymbol [iota] [nothing] [lcgreek] ["13]
-\definemathsymbol [kappa] [nothing] [lcgreek] ["14]
-\definemathsymbol [lambda] [nothing] [lcgreek] ["15]
-\definemathsymbol [mu] [nothing] [lcgreek] ["16]
-\definemathsymbol [nu] [nothing] [lcgreek] ["17]
-\definemathsymbol [xi] [nothing] [lcgreek] ["18]
-\definemathsymbol [omicron] [nothing] [lcgreek] ["6F]
-\definemathsymbol [pi] [nothing] [lcgreek] ["19]
-\definemathsymbol [rho] [nothing] [lcgreek] ["1A]
-\definemathsymbol [sigma] [nothing] [lcgreek] ["1B]
-\definemathsymbol [tau] [nothing] [lcgreek] ["1C]
-\definemathsymbol [upsilon] [nothing] [lcgreek] ["1D]
-\definemathsymbol [phi] [nothing] [lcgreek] ["1E]
-\definemathsymbol [chi] [nothing] [lcgreek] ["1F]
-\definemathsymbol [psi] [nothing] [lcgreek] ["20]
-\definemathsymbol [omega] [nothing] [lcgreek] ["21]
-
-\stopmathcollection
-
-\startmathcollection [default]
-
-\definemathsymbol [varepsilon] [nothing] [vargreek] ["22]
-\definemathsymbol [vartheta] [nothing] [vargreek] ["23]
-\definemathsymbol [varpi] [nothing] [vargreek] ["24]
-\definemathsymbol [varrho] [nothing] [vargreek] ["25]
-\definemathsymbol [varsigma] [nothing] [vargreek] ["26]
-\definemathsymbol [varphi] [nothing] [vargreek] ["27]
-
-\stopmathcollection
-
-\startmathcollection [default]
-
-\definemathsymbol [Alpha] [alpha] [ucgreek] ["41] % A
-\definemathsymbol [Beta] [alpha] [ucgreek] ["42] % B
-\definemathsymbol [Gamma] [alpha] [ucgreek] ["00]
-\definemathsymbol [Delta] [alpha] [ucgreek] ["01]
-\definemathsymbol [Epsilon] [alpha] [ucgreek] ["45] % E
-\definemathsymbol [Zeta] [alpha] [ucgreek] ["5A] % Z
-\definemathsymbol [Eta] [alpha] [ucgreek] ["48] % H
-\definemathsymbol [Theta] [alpha] [ucgreek] ["02]
-\definemathsymbol [Iota] [alpha] [ucgreek] ["49] % I
-\definemathsymbol [Kappa] [alpha] [ucgreek] ["4B] % K
-\definemathsymbol [Lambda] [alpha] [ucgreek] ["03]
-\definemathsymbol [Mu] [alpha] [ucgreek] ["4D] % M
-\definemathsymbol [Nu] [alpha] [ucgreek] ["4E] % N
-\definemathsymbol [Xi] [alpha] [ucgreek] ["04]
-\definemathsymbol [Omicron] [alpha] [ucgreek] ["4F] % O
-\definemathsymbol [Pi] [alpha] [ucgreek] ["05]
-\definemathsymbol [Rho] [alpha] [ucgreek] ["52] % R
-\definemathsymbol [Sigma] [alpha] [ucgreek] ["06]
-\definemathsymbol [Tau] [alpha] [ucgreek] ["54] % T
-\definemathsymbol [Upsilon] [alpha] [ucgreek] ["07]
-\definemathsymbol [Phi] [alpha] [ucgreek] ["08]
-\definemathsymbol [Chi] [alpha] [ucgreek] ["58] % X
-\definemathsymbol [Psi] [alpha] [ucgreek] ["09]
-\definemathsymbol [Omega] [alpha] [ucgreek] ["0A]
-
-\stopmathcollection
-
-% The \mfunction macro is an alternative for \hbox with a
-% controlable font switch.
-
-\startmathcollection[default]
-
-\definemathcommand [arccos] [nolop] {\mfunction{arccos}}
-\definemathcommand [arcsin] [nolop] {\mfunction{arcsin}}
-\definemathcommand [arctan] [nolop] {\mfunction{arctan}}
-\definemathcommand [arg] [nolop] {\mfunction{arg}}
-\definemathcommand [cosh] [nolop] {\mfunction{cosh}}
-\definemathcommand [cos] [nolop] {\mfunction{cos}}
-\definemathcommand [coth] [nolop] {\mfunction{coth}}
-\definemathcommand [cot] [nolop] {\mfunction{cot}}
-\definemathcommand [csc] [nolop] {\mfunction{csc}}
-\definemathcommand [deg] [nolop] {\mfunction{deg}}
-\definemathcommand [det] [limop] {\mfunction{det}}
-\definemathcommand [dim] [nolop] {\mfunction{dim}}
-\definemathcommand [exp] [nolop] {\mfunction{exp}}
-\definemathcommand [gcd] [limop] {\mfunction{gcd}}
-\definemathcommand [hom] [nolop] {\mfunction{hom}}
-\definemathcommand [inf] [limop] {\mfunction{inf}}
-\definemathcommand [injlim] [limop] {\mfunction{inj\,lim}}
-\definemathcommand [ker] [nolop] {\mfunction{ker}}
-\definemathcommand [lg] [nolop] {\mfunction{lg}}
-\definemathcommand [liminf] [limop] {\mfunction{lim\,inf}}
-\definemathcommand [limsup] [limop] {\mfunction{lim\,sup}}
-\definemathcommand [lim] [limop] {\mfunction{lim}}
-\definemathcommand [ln] [nolop] {\mfunction{ln}}
-\definemathcommand [log] [nolop] {\mfunction{log}}
-\definemathcommand [median] [limop] {\mfunction{median}}
-\definemathcommand [max] [limop] {\mfunction{max}}
-\definemathcommand [min] [limop] {\mfunction{min}}
-\definemathcommand [mod] [limop] {\mfunction{mod}}
-\definemathcommand [div] [limop] {\mfunction{div}}
-\definemathcommand [projlim] [limop] {\mfunction{proj\,lim}}
-\definemathcommand [Pr] [limop] {\mfunction{Pr}}
-\definemathcommand [sec] [nolop] {\mfunction{sec}}
-\definemathcommand [sinh] [nolop] {\mfunction{sinh}}
-\definemathcommand [sin] [nolop] {\mfunction{sin}}
-\definemathcommand [sup] [limop] {\mfunction{sup}}
-\definemathcommand [tanh] [nolop] {\mfunction{tanh}}
-\definemathcommand [tan] [nolop] {\mfunction{tan}}
-
-\stopmathcollection
-
-\let\normalmatharg\arg % todo: maybe automatically
-
-\startmathcollection[default]
-
-\definemathcommand [integers] {\mfunction{Z}}
-\definemathcommand [reals] {\mfunction{R}}
-\definemathcommand [rationals] {\mfunction{Q}}
-\definemathcommand [naturalnumbers] {\mfunction{N}}
-\definemathcommand [complexes] {\mfunction{C}}
-\definemathcommand [primes] {\mfunction{P}}
-
-\stopmathcollection
-
-\startmathcollection[default]
-
-\definemathcharacter [!] [close] [mr] ["21]
-\definemathcharacter [(] [open] [mr] ["28]
-\definemathcharacter [)] [close] [mr] ["29]
-\definemathcharacter [*] [bin] [sy] ["03]
-\definemathcharacter [+] [bin] [mr] ["2B]
-\definemathcharacter [,] [punct] [mi] ["3B]
-\definemathcharacter [-] [bin] [sy] ["00]
-\definemathcharacter [.] [ord] [mi] ["3A]
-\definemathcharacter [/] [ord] [mi] ["3D]
-\definemathcharacter [:] [rel] [mr] ["3A]
-\definemathcharacter [;] [punct] [mr] ["3B]
-\definemathcharacter [<] [rel] [mi] ["3C]
-\definemathcharacter [=] [rel] [mr] ["3D]
-\definemathcharacter [>] [rel] [mi] ["3E]
-\definemathcharacter [?] [close] [mr] ["3F]
-\definemathcharacter [91] [open] [mr] ["5B] % [
-\definemathcharacter [92] [ord] [sy] ["6E] % \
-\definemathcharacter [93] [close] [mr] ["5D] % ]
-\definemathcharacter [123] [open] [sy] ["66] % {
-\definemathcharacter [124] [ord] [sy] ["6A] % |
-\definemathcharacter [125] [close] [sy] ["67] % }
-
-\stopmathcollection
-
-\startmathcollection[default]
-
-\definemathcharacter [(] [nothing] [mr] ["28] [ex] ["00]
-\definemathcharacter [)] [nothing] [mr] ["29] [ex] ["01]
-\definemathcharacter [91] [nothing] [mr] ["5B] [ex] ["02] % [
-\definemathcharacter [93] [nothing] [mr] ["5D] [ex] ["03] % ]
-\definemathcharacter [<] [nothing] [sy] ["68] [ex] ["0A]
-\definemathcharacter [>] [nothing] [sy] ["69] [ex] ["0B]
-\definemathcharacter [/] [nothing] [mr] ["2F] [ex] ["0E]
-\definemathcharacter [124] [nothing] [sy] ["6A] [ex] ["0C] % |
-\definemathcharacter [92] [nothing] [sy] ["6E] [ex] ["0F] % \
-
-\stopmathcollection
-
-\def\PLAINangle
- {{\vbox{\ialign{$\mathsurround\zeropoint\scriptstyle##$\crcr
- \not\mathrel{\mkern14mu}\crcr
- \noalign{\nointerlineskip}
- \mkern2.5mu\leaders\hrule height.34pt\hfill\mkern2.5mu\crcr}}}}
-
-\startmathcollection[default]
-
-\definemathsymbol [aleph] [nothing] [sy] ["40]
-\definemathsymbol [imath] [nothing] [mi] ["7B]
-\definemathsymbol [jmath] [nothing] [mi] ["7C]
-\definemathsymbol [ell] [nothing] [mi] ["60]
-\definemathsymbol [wp] [nothing] [mi] ["7D]
-\definemathsymbol [Re] [nothing] [sy] ["3C]
-\definemathsymbol [Im] [nothing] [sy] ["3D]
-\definemathsymbol [partial] [nothing] [mi] ["40]
-\definemathsymbol [infty] [nothing] [sy] ["31]
-\definemathsymbol [prime] [nothing] [sy] ["30]
-\definemathsymbol [emptyset] [nothing] [sy] ["3B]
-\definemathsymbol [nabla] [nothing] [sy] ["72]
-\definemathsymbol [top] [nothing] [sy] ["3E]
-\definemathsymbol [bot] [nothing] [sy] ["3F]
-
-\definemathcommand [hbar] {{\mathchar'26\mkern-9muh}}
-\definemathcommand [surd] {{\mathchar"1270}} % ?
-\definemathcommand [angle] {\PLAINangle}
-
-\stopmathcollection
-
-\startmathcollection[default]
-
-\definemathsymbol [triangle] [ord] [sy] ["34]
-\definemathsymbol [forall] [ord] [sy] ["38]
-\definemathsymbol [exists] [ord] [sy] ["39]
-\definemathsymbol [neg] [ord] [sy] ["3A]
-\definemathsymbol [flat] [ord] [mi] ["5B]
-\definemathsymbol [natural] [ord] [mi] ["5C]
-\definemathsymbol [sharp] [ord] [mi] ["5D]
-\definemathsymbol [clubsuit] [ord] [sy] ["7C]
-\definemathsymbol [diamondsuit] [ord] [sy] ["7D]
-\definemathsymbol [heartsuit] [ord] [sy] ["7E]
-\definemathsymbol [spadesuit] [ord] [sy] ["7F]
-
-\stopmathcollection
-
-\startmathcollection[default]
-
-\definemathcommand [square] {\hbox{\hsmash{$\sqcup$}$\sqcap$}}
-
-\stopmathcollection
-
-\startmathcollection[default]
-
-\definemathsymbol [coprod] [op] [ex] ["60]
-\definemathsymbol [bigvee] [op] [ex] ["57]
-\definemathsymbol [bigwedge] [op] [ex] ["56]
-\definemathsymbol [biguplus] [op] [ex] ["55]
-\definemathsymbol [bigcap] [op] [ex] ["54]
-\definemathsymbol [bigcup] [op] [ex] ["53]
-\definemathsymbol [intop] [op] [ex] ["52]
-\definemathsymbol [prod] [op] [ex] ["51]
-\definemathsymbol [sum] [op] [ex] ["50]
-\definemathsymbol [bigotimes] [op] [ex] ["4E]
-\definemathsymbol [bigoplus] [op] [ex] ["4C]
-\definemathsymbol [bigodot] [op] [ex] ["4A]
-\definemathsymbol [ointop] [op] [ex] ["48]
-\definemathsymbol [bigsqcup] [op] [ex] ["46]
-\definemathsymbol [smallint] [op] [sy] ["73]
-
-\stopmathcollection
-
-\startmathcollection[default]
-
-\definemathsymbol [triangleleft] [bin] [mi] ["2F]
-\definemathsymbol [triangleright] [bin] [mi] ["2E]
-\definemathsymbol [bigtriangleup] [bin] [sy] ["34]
-\definemathsymbol [bigtriangledown] [bin] [sy] ["35]
-\definemathsymbol [wedge] [bin] [sy] ["5E]
-\definemathsymbol [vee] [bin] [sy] ["5F]
-\definemathsymbol [cap] [bin] [sy] ["5C]
-\definemathsymbol [cup] [bin] [sy] ["5B]
-\definemathsymbol [ddagger] [bin] [sy] ["7A]
-\definemathsymbol [dagger] [bin] [sy] ["79]
-\definemathsymbol [sqcap] [bin] [sy] ["75]
-\definemathsymbol [sqcup] [bin] [sy] ["74]
-\definemathsymbol [uplus] [bin] [sy] ["5D]
-\definemathsymbol [amalg] [bin] [sy] ["71]
-\definemathsymbol [diamond] [bin] [sy] ["05]
-\definemathsymbol [bullet] [bin] [sy] ["0F]
-\definemathsymbol [wr] [bin] [sy] ["6F]
-\definemathsymbol [div] [bin] [sy] ["04]
-\definemathsymbol [odot] [bin] [sy] ["0C]
-\definemathsymbol [oslash] [bin] [sy] ["0B]
-\definemathsymbol [otimes] [bin] [sy] ["0A]
-\definemathsymbol [ominus] [bin] [sy] ["09]
-\definemathsymbol [oplus] [bin] [sy] ["08]
-\definemathsymbol [mp] [bin] [sy] ["07]
-\definemathsymbol [pm] [bin] [sy] ["06]
-\definemathsymbol [circ] [bin] [sy] ["0E]
-\definemathsymbol [bigcirc] [bin] [sy] ["0D]
-\definemathsymbol [setminus] [bin] [sy] ["6E]
-\definemathsymbol [cdot] [bin] [sy] ["01]
-\definemathsymbol [ast] [bin] [sy] ["03]
-\definemathsymbol [times] [bin] [sy] ["02]
-\definemathsymbol [star] [bin] [mi] ["3F]
-
-\stopmathcollection
-
-\startmathcollection[default]
-
-\definemathsymbol [propto] [rel] [sy] ["2F]
-\definemathsymbol [sqsubseteq] [rel] [sy] ["76]
-\definemathsymbol [sqsupseteq] [rel] [sy] ["77]
-\definemathsymbol [parallel] [rel] [sy] ["6B]
-\definemathsymbol [mid] [rel] [sy] ["6A]
-\definemathsymbol [dashv] [rel] [sy] ["61]
-\definemathsymbol [vdash] [rel] [sy] ["60]
-\definemathsymbol [nearrow] [rel] [sy] ["25]
-\definemathsymbol [searrow] [rel] [sy] ["26]
-\definemathsymbol [nwarrow] [rel] [sy] ["2D]
-\definemathsymbol [swarrow] [rel] [sy] ["2E]
-\definemathsymbol [Leftrightarrow] [rel] [sy] ["2C]
-\definemathsymbol [Leftarrow] [rel] [sy] ["28]
-\definemathsymbol [Rightarrow] [rel] [sy] ["29]
-
-\stopmathcollection
-
-\startmathcollection[default]
-
-\definemathcommand [lnot] {\neg}
-\definemathcommand [int] {\intop \intlimits}
-\definemathcommand [oint] {\ointop\intlimits}
-\definemathcommand [land] {\wedge}
-\definemathcommand [lor] {\vee}
-\definemathcommand [neq] {\not=}
-\definemathcommand [ne] {\neq}
-\definemathcommand [le] {\leq}
-\definemathcommand [ge] {\geq}
-\definemathcommand [eq] {=}
-\definemathcommand [gt] {>}
-\definemathcommand [lt] {<}
-\definemathcommand [gets] {\leftarrow}
-\definemathcommand [owns] {\ni}
-\definemathcommand [to] {\rightarrow}
-\definemathcommand [mapsto] {\mapstochar\rightarrow}
-
-\stopmathcollection
-
-\startmathcollection[default]
-
-\definemathsymbol [leq] [rel] [sy] ["14]
-\definemathsymbol [geq] [rel] [sy] ["15]
-\definemathsymbol [succ] [rel] [sy] ["1F]
-\definemathsymbol [prec] [rel] [sy] ["1E]
-\definemathsymbol [approx] [rel] [sy] ["19]
-\definemathsymbol [succeq] [rel] [sy] ["17]
-\definemathsymbol [preceq] [rel] [sy] ["16]
-\definemathsymbol [supset] [rel] [sy] ["1B]
-\definemathsymbol [subset] [rel] [sy] ["1A]
-\definemathsymbol [supseteq] [rel] [sy] ["13]
-\definemathsymbol [subseteq] [rel] [sy] ["12]
-\definemathsymbol [in] [rel] [sy] ["32]
-\definemathsymbol [ni] [rel] [sy] ["33]
-\definemathsymbol [gg] [rel] [sy] ["1D]
-\definemathsymbol [ll] [rel] [sy] ["1C]
-\definemathsymbol [not] [rel] [sy] ["36]
-\definemathsymbol [leftrightarrow] [rel] [sy] ["24]
-\definemathsymbol [leftarrow] [rel] [sy] ["20]
-\definemathsymbol [rightarrow] [rel] [sy] ["21]
-\definemathsymbol [mapstochar] [rel] [sy] ["37]
-\definemathsymbol [sim] [rel] [sy] ["18]
-\definemathsymbol [simeq] [rel] [sy] ["27]
-\definemathsymbol [perp] [rel] [sy] ["3F]
-\definemathsymbol [equiv] [rel] [sy] ["11]
-\definemathsymbol [asymp] [rel] [sy] ["10]
-\definemathsymbol [smile] [rel] [mi] ["5E]
-\definemathsymbol [frown] [rel] [mi] ["5F]
-\definemathsymbol [leftharpoonup] [rel] [mi] ["28]
-\definemathsymbol [leftharpoondown] [rel] [mi] ["29]
-\definemathsymbol [rightharpoonup] [rel] [mi] ["2A]
-\definemathsymbol [rightharpoondown] [rel] [mi] ["2B]
-\definemathsymbol [lhook] [rel] [mi] ["2C]
-\definemathsymbol [rhook] [rel] [mi] ["2D]
-
-\stopmathcollection
-
-\def\PLAINldots
- {\ldotp\ldotp\ldotp}
-
-\def\PLAINcdots
- {\cdotp\cdotp\cdotp}
-
-\def\PLAINvdots
- {\vbox{\baselineskip.4\bodyfontsize\lineskiplimit\zeropoint
- \kern.6\bodyfontsize\hbox{.}\hbox{.}\hbox{.}}}
-
-\def\PLAINddots
- {\mkern1mu\raise.7\bodyfontsize\vbox{\kern.7\bodyfontsize\hbox{.}}\mkern2mu
- \raise.4\bodyfontsize\hbox{.}\mkern2mu\raise.1\bodyfontsize\hbox{.}\mkern1mu}
-
-\startmathcollection[default]
-
-\definemathcommand [hookrightarrow] {\lhook\joinrel\rightarrow}
-\definemathcommand [hookleftarrow] {\leftarrow\joinrel\rhook}
-\definemathcommand [bowtie] {\mathrel\triangleright\joinrel\mathrel\triangleleft}
-\definemathcommand [models] {\mathrel|\joinrel=}
-\definemathcommand [iff] {\;\Longleftrightarrow\;}
-
-\definemathsymbol [ldotp] [punct] [mi] ["3A]
-\definemathsymbol [cdotp] [punct] [sy] ["01]
-\definemathsymbol [colon] [punct] [mr] ["3A]
-
-\definemathcommand [ldots] [inner] {\PLAINldots}
-\definemathcommand [cdots] [inner] {\PLAINcdots}
-\definemathcommand [vdots] [nothing] {\PLAINvdots}
-\definemathcommand [ddots] [inner] {\PLAINddots}
-
-\stopmathcollection
-
-\startmathcollection[default]
-
-\definemathsymbol [acute] [accent] [mr] ["13]
-\definemathsymbol [grave] [accent] [mr] ["12]
-\definemathsymbol [ddot] [accent] [mr] ["7F]
-\definemathsymbol [tilde] [accent] [mr] ["7E]
-\definemathsymbol [mathring] [accent] [mr] ["17]
-\definemathsymbol [bar] [accent] [mr] ["16]
-\definemathsymbol [breve] [accent] [mr] ["15]
-\definemathsymbol [check] [accent] [mr] ["14]
-\definemathsymbol [hat] [accent] [mr] ["5E]
-\definemathsymbol [vec] [accent] [mi] ["7E] % [ord]
-\definemathsymbol [dot] [accent] [mr] ["5F]
-\definemathsymbol [widetilde] [accent] [ex] ["65] % [ord]
-\definemathsymbol [widehat] [accent] [ex] ["62] % [ord]
-
-\stopmathcollection
-
-\startmathcollection[default]
-
-\definemathsymbol [lmoustache] [open] [ex] ["7A] [ex] ["40]
-\definemathsymbol [rmoustache] [close] [ex] ["7B] [ex] ["41]
-\definemathsymbol [lgroup] [open] [mr] ["28] [ex] ["3A] % ?
-\definemathsymbol [rgroup] [close] [mr] ["29] [ex] ["3B] % ?
-\definemathsymbol [arrowvert] [nothing] [sy] ["6A] [ex] ["3C]
-\definemathsymbol [Arrowvert] [nothing] [sy] ["6B] [ex] ["3D]
-\definemathsymbol [bracevert] [nothing] [ex] ["3E] % ?
-\definemathsymbol [Vert] [nothing] [sy] ["6B] [ex] ["0D]
-\definemathsymbol [vert] [nothing] [sy] ["6A] [ex] ["0C]
-\definemathsymbol [uparrow] [rel] [sy] ["22] [ex] ["78]
-\definemathsymbol [downarrow] [rel] [sy] ["23] [ex] ["79]
-\definemathsymbol [updownarrow] [rel] [sy] ["6C] [ex] ["3F]
-\definemathsymbol [Uparrow] [rel] [sy] ["2A] [ex] ["7E]
-\definemathsymbol [Downarrow] [rel] [sy] ["2B] [ex] ["7F]
-\definemathsymbol [Updownarrow] [rel] [sy] ["6D] [ex] ["77]
-\definemathsymbol [backslash] [nothing] [sy] ["6E] [ex] ["0F]
-\definemathsymbol [langle] [open] [sy] ["68] [ex] ["0A]
-\definemathsymbol [rangle] [close] [sy] ["69] [ex] ["0B]
-\definemathsymbol [lbrace] [open] [sy] ["66] [ex] ["08]
-\definemathsymbol [rbrace] [close] [sy] ["67] [ex] ["09]
-\definemathsymbol [lceil] [open] [sy] ["64] [ex] ["06]
-\definemathsymbol [rceil] [close] [sy] ["65] [ex] ["07]
-\definemathsymbol [lfloor] [open] [sy] ["62] [ex] ["04]
-\definemathsymbol [rfloor] [close] [sy] ["63] [ex] ["05]
-
-\definemathsymbol [sqrt] [radical] [sy] ["70] [ex] ["70]
-
-\stopmathcollection
-
-%D By request:
-
-\startmathcollection[default]
-
-\definemathsymbol [lvert] [open] [sy] ["6A] [ex] ["0C]
-\definemathsymbol [rvert] [close] [sy] ["6A] [ex] ["0C]
-
-\definemathsymbol [lVert] [open] [sy] ["6B] [ex] ["0D]
-\definemathsymbol [rVert] [close] [sy] ["6B] [ex] ["0D]
-
-\stopmathcollection
-
-%D For brooks:
-%D
-%D \starttyping
-%D $\sqrt[3]{10}$
-%D \stoptyping
-
-\ifx\normalsqrt\undefined \let\normalsqrt\sqrt \fi % just set to: \dohandlemathtoken {sqrt}
-
-\def\notsosqrt[#1]{\root#1\of}
-
-\unexpanded\def\sqrt{\doifnextoptionalelse\notsosqrt\normalsqrt}
-
-\def\PLAINbig {\@@dobig{0.85}}
-\def\PLAINBig {\@@dobig{1.15}}
-\def\PLAINbigg{\@@dobig{1.45}}
-\def\PLAINBigg{\@@dobig{1.75}}
-
-\startrawmathcollection [default]
-
-\definemathcommand [bigl] [open] [one] {\big}
-\definemathcommand [bigm] [rel] [one] {\big}
-\definemathcommand [bigr] [close] [one] {\big}
-\definemathcommand [Bigl] [open] [one] {\Big}
-\definemathcommand [Bigm] [rel] [one] {\Big}
-\definemathcommand [Bigr] [close] [one] {\Big}
-\definemathcommand [biggl] [open] [one] {\bigg}
-\definemathcommand [biggm] [rel] [one] {\bigg}
-\definemathcommand [biggr] [close] [one] {\bigg}
-\definemathcommand [Biggl] [open] [one] {\Bigg}
-\definemathcommand [Biggm] [rel] [one] {\Bigg}
-\definemathcommand [Biggr] [close] [one] {\Bigg}
-
-\definemathcommand [big] {\PLAINbig}
-\definemathcommand [Big] {\PLAINBig}
-\definemathcommand [bigg] {\PLAINbigg}
-\definemathcommand [Bigg] {\PLAINBigg}
-
-\stoprawmathcollection
-
-\startmathcollection[default]
-
-\definemathsymbol [dag] [box] [sy] ["79]
-\definemathsymbol [ddag] [box] [sy] ["7A]
-\definemathsymbol [S] [box] [sy] ["78]
-\definemathsymbol [P] [box] [sy] ["7B]
-\definemathsymbol [Orb] [box] [sy] ["0D]
-
-\stopmathcollection
-
-\def\PLAINroot#1#2%
- {\setbox\zerocount\hbox{$\mathsurround\zeropoint#1\sqrt{#2}$}\dimen@\ht\zerocount
- \advance\dimen@-\dp\zerocount
- \mkern5mu\raise.6\dimen@\copy\rootbox \mkern-10mu\box\zerocount}
-
-\def\PLAINmatrix#1%
- {\null\,\vcenter{\normalbaselines\mathsurround\zeropoint
- \ialign{\hfil$##$\hfil&&\quad\hfil$##$\hfil\crcr
- \mathstrut\crcr\noalign{\kern-\baselineskip}
- #1\crcr\mathstrut\crcr\noalign{\kern-\baselineskip}}}\,}
-
-\startrawmathcollection[default]
-
-\definemathcommand [mathstrut] {\vphantom{(}}
-\definemathcommand [joinrel] {\mathrel{\mkern-3mu}}
-\definemathcommand [r@@t] {\PLAINroot}
-\definemathcommand [matrix] {\PLAINmatrix}
-
-\definemathcommand [over] {\normalover} % hack, to do
-
-\stoprawmathcollection
-
-\def\{{\lbrace}
-\def\}{\rbrace}
-
-%def\bbd{\fam\purefamily{blackboard}}
-%def\cal{\fam\purefamily{calfamily}}
-
-\def\mit{\fam\purefamily{mitfamily}}
-
-\def\Bbb{\blackboard} % conforming amstex
-
-\startmathcollection[default]
-
- \definemathsymbol [mathperiod] [ord] [mi] ["3A]
- \definemathsymbol [textperiod] [punct] [mi] ["3A]
-
- \definemathsymbol [mathcomma] [ord] [mi] ["3B]
- \definemathsymbol [textcomma] [punct] [mi] ["3B]
-
-\stopmathcollection
-
-\definemathpunctuation . mathperiod textperiod
-\definemathpunctuation , mathcomma textcomma
-
-%D The following colon related definitions are provided by Aditya
-%D Mahajan who derived them from \type {mathtools.sty} and \type
-%D {colonequals.sty}.
-
-%D \macros
-%D {centercolon, colonminus, minuscolon, colonequals, equalscolon,
-%D colonapprox, approxcolon, colonsim, simcolon, coloncolon,
-%D coloncolonminus, minuscoloncolon, coloncolonequals,
-%D equalscoloncolon, coloncolonapprox, approxcoloncolon,
-%D colonsim, simcoloncolon}
-%D
-%D In $a := b$ the colon is not vertically centered with the equal
-%D to. Also the distance between colon and equal to is a bit large.
-%D So, we define a vertically centered colon \tex {centercolon} and
-%D a few macros for colon and double colon relation symbols.
-%D
-%D \startlines
-%D \formula {A \centercolon B}
-%D \formula {A \colonminus B}
-%D \formula {A \minuscolon B}
-%D \formula {A \colonequals B}
-%D \formula {A \equalscolon B}
-%D \formula {A \colonapprox B}
-%D \formula {A \approxcolon B}
-%D \formula {A \colonsim B}
-%D \formula {A \simcolon B}
-%D \formula {A \coloncolon B}
-%D \formula {A \coloncolonminus B}
-%D \formula {A \minuscoloncolon B}
-%D \formula {A \coloncolonequals B}
-%D \formula {A \equalscoloncolon B}
-%D \formula {A \coloncolonapprox B}
-%D \formula {A \approxcoloncolon B}
-%D \formula {A \colonsim B}
-%D \formula {A \simcoloncolon B}
-%D \stoplines
-
-%D The next macros take care of the space between the colon and the
-%D relation symbol.
-
-\definemathcommand [colonsep] {\mkern-1.2mu}
-\definemathcommand [doublecolonsep] {\mkern-0.9mu}
-
-%D The next macro vertically centeres its contents.
-
-\def\@center@math#1%
- {\vcenter{\hbox{$\mathsurround\zeropoint#1$}}}
-
-\def\@center@colon
- {\mathpalette\@center@math{\colon}}
-
-%D Now we define all the colon relations.
-
-\definemathcommand [centercolon] [rel] {\@center@colon}
-\definemathcommand [colonminus] [rel] {\centercolon\colonsep\mathrel{-}}
-\definemathcommand [minuscolon] [rel] {\mathrel{-}\colonsep\centercolon}
-\definemathcommand [colonequals] [rel] {\centercolon\colonsep=}
-\definemathcommand [equalscolon] [rel] {=\centercolon\colonsep}
-\definemathcommand [colonapprox] [rel] {\centercolon\colonsep\approx}
-\definemathcommand [approxcolon] [rel] {\approx\centercolon\colonsep}
-\definemathcommand [colonsim] [rel] {\centercolon\colonsep\sim}
-\definemathcommand [simcolon] [rel] {\sim\centercolon\colonsep}
-
-\definemathcommand [coloncolon] [rel] {\centercolon\doublecolonsep\centercolon}
-\definemathcommand [coloncolonminus] [rel] {\coloncolon\colonsep\mathrel{-}}
-\definemathcommand [minuscoloncolon] [rel] {\mathrel{-}\colonsep\coloncolon}
-\definemathcommand [coloncolonequals] [rel] {\coloncolon\colonsep=}
-\definemathcommand [equalscoloncolon] [rel] {=\coloncolon\colonsep}
-\definemathcommand [coloncolonapprox] [rel] {\coloncolon\colonsep\approx}
-\definemathcommand [approxcoloncolon] [rel] {\approx\coloncolon\colonsep}
-\definemathcommand [colonsim] [rel] {\coloncolon\colonsep\sim}
-\definemathcommand [simcoloncolon] [rel] {\sim\coloncolon\colonsep}
-
-%D More integrals (AM):
-
-\def\dointkern{\mkern-6mu\mathchoice{\mkern-3mu}{}{}{}}
-
-\definemathcommand [iint] {\repeatintegral\plusone }
-\definemathcommand [iiint] {\repeatintegral\plustwo }
-\definemathcommand [iiiint] {\repeatintegral\plusthree}
-
-\def\repeatintegral#1%
- {\scratchtoks\emptytoks
- \let\dointlimits\donothing
- \let\dodointlimits\intlimits
- \dorecurse{#1}{\appendtoks \intop \dointkern \to \scratchtoks}
- \appendtoks \intop \dointlimits \dodointlimits \to \scratchtoks
- \edef\dodorepeatintegral{\the\scratchtoks}%
- \futurelet\next\dorepeatintegral}
-
-%D If the \type{\limits} option is used after \type{\iint}, use
-%D \type{\mathop} and fudge the left hand space a bit to make the
-%D subscript visually centered.
-
-\def\dorepeatintegral
- {\ifx\next\limits \dointlimitcorrection \else
- \ifx\next\displaylimits \dointlimitcorrection \else
- \ifx\next\nolimits \donothing \else
- \ifcase\intlimitcode\else \dointlimitcorrection \fi\fi\fi\fi
- \dodorepeatintegral}
-
-\def\dointlimitcorrection
- {\mkern-7mu\mathchoice{\mkern-2mu}{}{}{}%
- \mathop\bgroup
- \mkern7mu\mathchoice{\mkern2mu}{}{}{}%
- \let\dointlimits\egroup}
-
-\setupmathematics
- [integral=nolimits]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/math-tim.mkii b/Master/texmf-dist/tex/context/base/mkii/math-tim.mkii
deleted file mode 100644
index da7d17e7ba6..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/math-tim.mkii
+++ /dev/null
@@ -1,371 +0,0 @@
-%D \module
-%D [ file=math-tim,
-%D version=2001.04.12,
-%D title=\CONTEXT\ Math Macros,
-%D subtitle=Mathtime Specials,
-%D author={Hans Hagen \& Taco Hoekwater},
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\endinput % i will clean this up after taco has gone over it
-
-%D With thanks to Berthold Horn from YandY for providing me
-%D evaluation copies of the MathTimePlus fonts.
-
-% version 0 : Michael Spivak
-% version 1 : Taco Hoekwater
-% version 2 : Hans Hagen
-% version 3 : etc etc etc
-
-\unprotect
-
-%D We use the predefined spare families \type {\mcfam} and
-%D \type {\mdfam}.
-
-\let\cafam\mcfam \let\hexcafam\hexmcfam
-\let\gbfam\mdfam \let\hexgbfam\hexmdfam
-\let\gkfam\mdfam \let\hexgkfam\hexmdfam
-
-% Why is this needed?
-
-% \font\tenmd =mtgu at 10pt
-% \font\sevenmd=mtgu at 7.6pt
-% \font\fivemd =mtgu at 6pt
-% \font\tenmc =mtms at 10pt
-% \font\sevenmc=mtms at 7.6pt
-% \font\fivemc =mtms at 6pt
-%
-% \textfont \mcfam\tenmc \textfont \mdfam\tenmd
-% \scriptfont \mcfam\sevenmc \scriptfont \mdfam\sevenmd
-% \scriptscriptfont\mcfam\fivemc \scriptscriptfont\mdfam\fivemd
-
-% \addtocommalist{gk}\familylist
-% \addtocommalist{gb}\familylist
-%
-% \defineinterfaceconstant {ca} {ca} % boohoo!
-% \defineinterfaceconstant {gk} {gk} % boohoo!
-% \defineinterfaceconstant {gb} {gb} % boohoo!
-
-% \definealternativestyle[script] [\ca][\ca]
-% \definealternativestyle[greek] [\gk][\gk]
-% \definealternativestyle[boldgreek][\gb][\gb]
-
-% \definebodyfont
-% [5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,14.4pt] [rm]
-% [ca=mtms sa 1,
-% gk=mtgu sa 1,
-% gb=mtgub sa 1]
-
-%D Since a font size is a rather fuzzy thing, it will be no
-%D surprise that the Math Times fonts have different specs
-%D than the Computer Modern Roman fonts.
-%D
-%D \starttabulate[|Bl|c|c|c|c|c|c|c|c|c|c|]
-%D \NC Computer Modern\NC
-%D 5 \NC6 \NC7 \NC8 \NC9 \NC10 \NC11 \NC12 \NC14 \NC18\NC\NR
-%D \NC Math Times \NC
-%D 6.0\NC6.8\NC7.6\NC8.4\NC9.2\NC10.0\NC10.8\NC11.6\NC13.2\NC--\NC\NR
-%D \stoptabulate
-%D
-%D The following definitions presume the existence of \type
-%D {tio} and \type {tibio} font alternatives. Definitions for
-%D \type {\tf.} etc and \type {\sc} are left as they are.
-
-%D moved code
-
-%D The next lines set up coding dependant versions of math
-%D accents (for \type {texnansi} of course). These are needed
-%D in commands like \type {\bf} and \type {\it} (which use the
-%D text font encoding) a opposed to \type {_no spec_} and
-%D \type {mi} that use the math font encoding. This stuff
-%D should be made more general!
-
-% \daghex, \ddaghex and \dothex were wrong in my version of mtmacs
-
-\def\daghex {86} % to do
-\def\ddaghex {87}
-\def\Shex {A7}
-\def\Phex {B6}
-\def\barhex {16}
-\def\gravehex{12}
-\def\acutehex{13}
-\def\checkhex{14}
-\def\brevehex{15}
-\def\hathex {5E}
-\def\dothex {05}
-\def\tildehex{7E}
-\def\ddothex {7F}
-
-%D The \type {mtex} fonts need a recalculation of \type
-%D {\p@renwd}, which in \CONTEXT\ is done automatically.
-
-%D The following definitions are mostly copied from the file
-%D \type {mtmacs.tex}, which banner said:
-%D
-%D \starttyping
-%D MTMACS.TEX VERSION 1.1.1 (1996 Dec 8)
-%D COPYRIGHT (C) 1992, 1993, 1996 BY THE TEXPLORATORS CORPORATION
-%D ALL RIGHTS RESERVED
-%D \stoptyping
-%D
-%D We reformatted the macros and changed a few bits and
-%D pieces. A further cleanup with regards to the scratch
-%D registers will be done later.
-
-\mathchardef\Gamma = "0130
-\mathchardef\Delta = "0131
-\mathchardef\Theta = "0132
-\mathchardef\Lambda = "0133
-\mathchardef\Xi = "0134
-\mathchardef\Pi = "0135
-\mathchardef\Sigma = "0136
-\mathchardef\Upsilon = "0137
-\mathchardef\Phi = "0138
-\mathchardef\Psi = "0139
-\mathchardef\Omega = "017F
-\mathchardef\varGamma = "0100
-\mathchardef\varDelta = "0101
-\mathchardef\varTheta = "0102
-\mathchardef\varLambda = "0103
-\mathchardef\varXi = "0104
-\mathchardef\varPi = "0105
-\mathchardef\varSigma = "0106
-\mathchardef\varUpsilon = "0107
-\mathchardef\varPhi = "0108
-\mathchardef\varPsi = "0109
-\mathchardef\varOmega = "010A
-\mathchardef\varkappa = "017E
-
-\mathchardef\ldotp = "613A
-
-\mathchardef\triangleleft = "2247
-\mathchardef\triangleright = "2246
-\mathchardef\comp = "2242
-
-\mathchardef\Relbar = "3248
-\mathchardef\dagger = "20\daghex % to do
-\mathchardef\ddagger = "20\ddaghex % to do
-\mathchardef\dotacc = "0250
-
-\mathcode`\( = "412E
-\mathcode`\) = "512F
-\mathcode`\. = "013A
-\mathcode`\, = "613B
-\mathcode`\+ = "2243
-\mathcode`\= = "3244
-\mathcode`\; = "6249
-
-\delcode `\( = "12E300
-\delcode `\) = "12F301
-
-\let\mit=\undefined % to do
-
-\def\vec{\mathaccent"0245 }
-\def\t#1{{\edef\next{\the\font}\the\textfont2\accent"41\next#1}}
-
-% fam equals -1 unless the user has said something
-% like \rm (cf. the texbook page 290)
-
-\def\ifdefaultfamelse#1#2%
- {\ifnum\fam=\minusone\mathaccent#1\else\mathaccent#2\fi}
-
-\let\noaccents@\relax
-
-\def\grave {\ifdefaultfamelse{"024A}{"70\gravehex}}
-\def\acute {\ifdefaultfamelse{"024B}{"70\acutehex}}
-\def\check {\ifdefaultfamelse{"024C}{"70\checkhex}}
-\def\breve {\ifdefaultfamelse{"024D}{"70\brevehex}}
-\def\bar {\ifdefaultfamelse{"024E}{"70\barhex }}
-\def\hat {\ifdefaultfamelse{"024F}{"70\hathex }}
-\def\dot {\ifdefaultfamelse{"0250}{"70\dothex }}
-\def\tilde {\ifdefaultfamelse{"0251}{"70\tildehex}}
-\def\ddot {\ifdefaultfamelse{"0252}{"70\ddothex }}
-
-\def\widebar{\mathaccent"0253 }
-
-\def\mathhexbox@#1#2#3%
- {\relax
- \ifmmode
- \mathpalette{}{\mathsurround\zeropoint\rm\mathchar"#1#2#3}%
- \else
- \leavevmode
- \hbox{$\mathsurround\zeropoint\rm\mathchar"#1#2#3$}%
- \fi}
-
-\def\dag {\edef\next@{0\daghex }\expandafter\mathhexbox@\next@}
-\def\ddag{\edef\next@{0\ddaghex}\expandafter\mathhexbox@\next@}
-
-\def\S{\edef\next@{0\Shex}\expandafter\mathhexbox@\next@}
-\def\P{\edef\next@{0\Phex}\expandafter\mathhexbox@\next@}
-
-\def\vdots%
- {\vbox
- {\baselineskip4\points
- \lineskiplimit\zeropoint
- \kern6\points\hbox{$\mathsurround\zeropoint.$}\hbox{$\mathsurround\zeropoint.$}\hbox{$\mathsurround\zeropoint.$}}}
-
-\def\ddots%
- {\mathinner
- {\mkern1mu
- \raise7\points\vbox{\kern 7\points\hbox{$\mathsurround\zeropoint.$}}\mkern2mu
- \raise4\points\hbox{$\mathsurround\zeropoint.$}\mkern2mu
- \raise \points\hbox{$\mathsurround\zeropoint.$}\mkern1mu}}
-
-\def\hbar
- {{\mathchoice
- {\hbox{\lower.07em \hbox{$\mathchar"\barhex$}}}
- {\hbox{\lower.07em \hbox{$\mathchar"\barhex$}}}
- {\hbox{\lower.049em\hbox{$\scriptstyle\mathchar"\barhex$}}}
- {\hbox{\lower.035em\hbox{$\scriptscriptstyle\mathchar"\barhex$}}}%
- \mkern-6.3muh}}
-
-\def\angle%
- {{\vbox{\ialign{$\mathsurround\zeropoint\scriptstyle##$\crcr
- \not\mathrel{\mkern14mu}\crcr
- \noalign{\nointerlineskip}
- \mkern2.5mu\leaders\hrule height.48\points\hfill\mkern2.5mu\crcr}}}}
-
-\newdimen\amstexex
-
-\amstexex = .2326ex
-
-\def\varinjlim%
- {\mathop{\vtop{\ialign{##\crcr
- \hfil\the\textfont\zerocount lim\hfil\crcr
- \noalign{\nointerlineskip}\rightarrowfill\crcr
- \noalign{\nointerlineskip\kern-\amstexex}\crcr}}}}
-
-\def\varprojlim%
- {\mathop{\vtop{\ialign{##\crcr
- \hfil\the\textfont\zerocount lim\hfil\crcr
- \noalign{\nointerlineskip}\leftarrowfill\crcr
- \noalign{\nointerlineskip\kern-\amstexex}\crcr}}}}
-
-\def\varliminf{\mathop{\underbar {lim}}} % context-ified
-\def\varlimsup{\mathop{\overstrike{lim}}} % context-ified
-
-\def\spdot {^{\hbox{\raise\amstexex\hbox{\the\textfont\zerocount .}}}}
-\def\spddot {^{\hbox{\raise\amstexex\hbox{\the\textfont\zerocount ..}}}}
-\def\spdddot {^{\hbox{\raise\amstexex\hbox{\the\textfont\zerocount ...}}}}
-\def\spddddot{^{\hbox{\raise\amstexex\hbox{\the\textfont\zerocount....}}}}
-
-%D Here some code is merged in order to save strings.
-
-\def\domultidot#1#2%
- {\setbox0\hbox{$#1#2$}%
- \setbox2\hbox{$#1\infty$}%
- \dimen0\ht2
- \ifdim\ht0<\dimen0 \dimen0\ht0 \fi
- \setbox2\hbox{$#1#2\mathchar"012D$}%
- \dimen2\wd2
- \advance\dimen2-\wd0
- \setbox0\hbox{$#1\rhook$}%
- \advance\dimen2-\wd0
- \vbox
- {\offinterlineskip
- \ialign{\hfil$#1##$\hfil\cr
- \kern\dimen2\dotacc\mkern-2.5mu\dotacc\mkern-2.5mu\dotacc\thirddot\cr
- \noalign{\vskip-\dimen0}%
- #2\cr}}}
-
-\def\dddot%
- {\def\thirddot{}%
- \mathpalette\domultidot}
-
-\def\ddddot%
- {\def\thirddot{\mkern-2.5mu\dotacc}%
- \mathpalette\domultidot}
-
-\newcount\uproot@
-\newcount\leftroot@
-
-\def\nonmatherr#1%
- {\errmessage{\noexpand#1allowed only in math mode}}
-
-\def\uproot#1%
- {\relax
- \ifmmode
- \uproot@#1\relax
- \else
- \nonmatherr\uproot
- \fi}
-
-\def\leftroot#1%
- {\relax
- \ifmmode
- \leftroot@#1\relax
- \else
- \nonmatherr\leftroot
- \fi}
-
-\def\root#1\of#2%
- {\setbox\rootbox=\hbox{$\mathsurround\zeropoint\scriptscriptstyle{#1}$}%
- \mathpalette\r@@t{#2}}
-
-\def\r@@t#1#2%
- {\setbox\zerocount\hbox{$\uproot@\zerocount\leftroot\zerocount\mathsurround\zeropoint#1\sqrt{#2}$}%
- \dimen@\ht\zerocount\advance\dimen@-\dp\zerocount
- \dimen@ii\dimen@
- \ifdim\dimen@>30\points \advance\dimen@ii-16\points \else
- \ifdim\dimen@>24\points \advance\dimen@ii -8\points \else
- \ifdim\dimen@>18\points \advance\dimen@ii -6\points \else
- \ifdim\dimen@>12\points \advance\dimen@ii -4\points \else
- \ifdim\dimen@>10\points \advance\dimen@ii -2\points \fi\fi\fi\fi\fi
- \setbox\plustwo=\hbox{$\mathsurround\zeropoint#1\mskip\uproot@ mu$}%
- \advance\dimen@ii by1.667\wd\plustwo
- \mkern-\leftroot@ mu\mkern5mu\raise.6\dimen@ii\copy\rootbox
- \mkern-8mu\mkern\leftroot@ mu\box\zerocount\leftroot\zerocount\uproot\zerocount}
-
-\def\space@.{\futurelet\space@\relax} \space@. % really needed ?
-
-\def\jadjust%
- {\mkern-\plustwo mu}
-
-%D For the moment the following code is left unchanged. It is
-%D not used anyway.
-
-\newif\ifsubscriptcorrection \subscriptcorrectionfalse
-
-\ifsubscriptcorrection
-
- \expandafter\let\csname subscript character \string_\endcsname_
-
- \catcode`\_=\active
-
- \def_%
- {\ifmmode
- \expandafter\sb@
- \else
- \expandafter\csname subscript character \string_\endcsname
- \fi}
-
- \let\sb_
-
- \ifnum\catcode`\^^A=8 \catcode`\^^A\active\let^^A_\fi
-
- \def\sb@#1%
- {\csname subscript character \string_\endcsname
- {\futurelet\next\sb@@#1}}
-
- \def\sb@@%
- {\ifx\next\space@
- \def\next@. %
- {\futurelet\next\sb@@}%
- \else
- \def\next@.%
- {\ifx\next j%
- \mkern-\plustwo mu\else
- \ifx\next f%
- \mkern-\plustwo mu\else
- \ifx\next p%
- \mkern-\plusone mu\fi\fi\fi}%
- \fi
- \next@.}
-
-\fi
-
-\protect
diff --git a/Master/texmf-dist/tex/context/base/mkii/math-uni.mkii b/Master/texmf-dist/tex/context/base/mkii/math-uni.mkii
deleted file mode 100644
index 5c75a9fb44b..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/math-uni.mkii
+++ /dev/null
@@ -1,237 +0,0 @@
-%D \module
-%D [ file=math-uni,
-%D version=2005.06.11,
-%D title=\CONTEXT\ Math Macros,
-%D subtitle=unicode support,
-%D author={Nikolai Weibull \& Taco Hoekwater},
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-
-\unprotect
-
-% needed for unic-032 % TH
-
-\startmathcollection[default]
-
- \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 % NW
-
-\startmathcollection[default]
-
- \definemathcommand [unic@in] {\in}
- \definemathcommand [unic@nin] {\not\in}
- \definemathcommand [unic@nni] {\not\ni}
- \definemathcommand [unic@minus] {-}
- \definemathcommand [unic@divisionslash] {/}
- \definemathcommand [unic@sqrt] {\sqrt{}}
- \definemathcommand [unic@cubesqrt] {\root 3 \of {}}
- \definemathcommand [unic@fourthsqrt] {\root 4 \of {}}
- \definemathcommand [unic@divides] [op] {|} % TODO
- \definemathcommand [unic@ndivides] [rel] {\mathop{\not|}} % TODO: horrible
- \definemathcommand [unic@cap] {\cap}
- \definemathcommand [unic@dblint] {\int\!\!\!\int}
- \definemathcommand [unic@triint] {\int\!\!\!\int\!\!\!\int}
- \definemathcommand [unic@ratio] [rel] {:}
- \definemathcommand [unic@proportion] [rel] {::}
- \definemathcommand [unic@excess] [op] {-\!\!:}
- \definemathcommand [unic@geomprop] [op] {:\!\!\!-\!\!\!:}
- \definemathcommand [unic@homothetic] [op] {\sim\!\!\!:}
- \definemathcommand [unic@nsimeq] {\not\simeq}
- \definemathcommand [unic@cong] {\cong}
- \definemathcommand [unic@napproxeq] {\not\approxeq}
- \definemathcommand [unic@napprox] {\not\approx}
- \definemathcommand [unic@doteq] {\doteq}
- \definemathcommand [unic@correspondsto] {\buildrel \frown \over =}
- \definemathcommand [unic@estimates] {\buildrel \wedge \over =}
- \definemathcommand [unic@equiangularto] {\buildrel \vee \over =}
- \definemathcommand [unic@stareq] {\buildrel \star \over =}
- \definemathcommand [unic@eqbydef] {\buildrel \rm def \over =}
- \definemathcommand [unic@measuredby] {\buildrel \rm m \over =}
- \definemathcommand [unic@questionedeq] {\buildrel \rm ? \over =}
- \definemathcommand [unic@nequiv] {\not\equiv}
- \definemathcommand [unic@nasymp] {\not\asymp}
- \definemathcommand [unic@nlesssim] {\not\lesssim}
- \definemathcommand [unic@ngtrsim] {\not\gtrsim}
- \definemathcommand [unic@nlessgtr] {\not\lessgtr}
- \definemathcommand [unic@ngtrless] {\not\gtrless}
- \definemathcommand [unic@nsubset] {\not\subset}
- \definemathcommand [unic@nsupset] {\not\supset}
- \definemathcommand [unic@nsqsubseteq] {\not\sqsubseteq}
- \definemathcommand [unic@nsqsupseteq] {\not\sqsupseteq}
-
-\stopmathcollection
-
-% needed for unic-039 % NW
-
-\startmathcollection[default]
-
- \definemathcommand [unic@Lbracket] [open] {[\![}
- \definemathcommand [unic@Rbracket] [close] {]\!]}
- \definemathcommand [unic@Langle] [open] {\langle\!\langle}
- \definemathcommand [unic@Rangle] [close] {\rangle\!\rangle}
-
-\stopmathcollection
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/meta-clp.mkii b/Master/texmf-dist/tex/context/base/mkii/meta-clp.mkii
deleted file mode 100644
index 5c9206deee9..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/meta-clp.mkii
+++ /dev/null
@@ -1,164 +0,0 @@
-%D \module
-%D [ file=meta-clp,
-%D version=2000.07.06,
-%D title=\METAPOST\ Graphics,
-%D subtitle=Clipping,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-%D In this library, we define a bunch of clipping paths that
-%D can be fed to \type {\clip}.
-
-\startMPclip{ellipse}
- clip currentpicture to unitcircle
- xscaled \width yscaled \height ;
-\stopMPclip
-
-\startMPclip{negellipse}
- clip currentpicture to (unitcircle peepholed unitsquare)
- xscaled \width yscaled \height ;
-\stopMPclip
-
-\startMPclip{urellipse}
- clip currentpicture to urcircle scaled 2
- xscaled \width yscaled \height ;
-\stopMPclip
-
-\startMPclip{ulellipse}
- clip currentpicture to ulcircle scaled 2 shifted (1,0)
- xscaled \width yscaled \height ;
-\stopMPclip
-
-\startMPclip{llellipse}
- clip currentpicture to llcircle scaled 2 shifted (1,1)
- xscaled \width yscaled \height ;
-\stopMPclip
-
-\startMPclip{lrellipse}
- clip currentpicture to lrcircle scaled 2 shifted (0,1)
- xscaled \width yscaled \height ;
-\stopMPclip
-
-\startMPclip{tellipse}
- clip currentpicture to tcircle shifted (.5,0) yscaled 2
- xscaled \width yscaled \height ;
-\stopMPclip
-
-\startMPclip{bellipse}
- clip currentpicture to bcircle shifted (.5,.5) yscaled 2
- xscaled \width yscaled \height ;
-\stopMPclip
-
-\startMPclip{lellipse}
- clip currentpicture to lcircle shifted (.5,.5) xscaled 2
- xscaled \width yscaled \height ;
-\stopMPclip
-
-\startMPclip{rellipse}
- clip currentpicture to rcircle shifted (0,.5) xscaled 2
- xscaled \width yscaled \height ;
-\stopMPclip
-
-\startMPclip{diamond}
- clip currentpicture to unitdiamond
- xscaled \width yscaled \height ;
-\stopMPclip
-
-\startMPclip{negdiamond}
- clip currentpicture to (unitdiamond peepholed unitsquare)
- xscaled \width yscaled \height ;
-\stopMPclip
-
-\startMPclip{urtriangle}
- clip currentpicture to urtriangle scaled 2
- xscaled \width yscaled \height ;
-\stopMPclip
-
-\startMPclip{ultriangle}
- clip currentpicture to ultriangle scaled 2 shifted (1,0)
- xscaled \width yscaled \height ;
-\stopMPclip
-
-\startMPclip{lltriangle}
- clip currentpicture to lltriangle scaled 2 shifted (1,1)
- xscaled \width yscaled \height ;
-\stopMPclip
-
-\startMPclip{lrtriangle}
- clip currentpicture to lrtriangle scaled 2 shifted (0,1)
- xscaled \width yscaled \height ;
-\stopMPclip
-
-% More efficient:
-%
-% \def\dosimpleMPclip#1
-% {clip currentpicture to (#1) xscaled \width yscaled \height ;}
-%
-% \def\simpleMPclip#1#2%
-% {\startMPclip{#1}\dosimpleMPclip{#2}\stopMPclip}
-%
-% \simpleMPclip {ellipse} {unitcircle}
-% \simpleMPclip {diamond} {unitdiamond}
-%
-% \simpleMPclip {negellipse} {unitcircle peepholed unitsquare}
-% \simpleMPclip {negdiamond} {unitdiamond peepholed unitsquare}
-%
-% \simpleMPclip {urellipse} {urcircle scaled 2 shifted (0,0)}
-% \simpleMPclip {ulellipse} {ulcircle scaled 2 shifted (1,0)}
-% \simpleMPclip {llellipse} {llcircle scaled 2 shifted (1,1)}
-% \simpleMPclip {lrellipse} {lrcircle scaled 2 shifted (0,1)}
-%
-% \simpleMPclip {tellipse} {tcircle shifted (.5,0) yscaled 2}
-% \simpleMPclip {bellipse} {bcircle shifted (.5,.5) yscaled 2}
-% \simpleMPclip {lellipse} {lcircle shifted (.5,.5) xscaled 2}
-% \simpleMPclip {rellipse} {rcircle shifted (0,.5) xscaled 2}
-%
-% \simpleMPclip {urtriangle} {urtriangle scaled 2 shifted (0,0)}
-% \simpleMPclip {ultriangle} {ultriangle scaled 2 shifted (1,0)}
-% \simpleMPclip {lltriangle} {lltriangle scaled 2 shifted (1,1)}
-% \simpleMPclip {lrtriangle} {lrtriangle scaled 2 shifted (0,1)}
-
-%D \in {Figure} [fig:clipping paths] shows which paths are
-%D predefined. When applied to a whole picture, their usage
-%D is:
-%D
-%D \starttyping
-%D \clip[nx=1,ny=1,mp=ellipse]{some clippable content}
-%D \stoptyping
-%D
-%D \startbuffer
-%D \setupclipping [nx=1,ny=1,x=1,y=1]
-%D \setupblackrules[width=2cm,height=1cm]
-%D \startcombination[6*3] % \startcombination[6*3]
-%D {\clip[mp=urellipse] {\blackrule}} {urellipse}
-%D {\clip[mp=ulellipse] {\blackrule}} {ulellipse}
-%D {\clip[mp=llellipse] {\blackrule}} {llellipse}
-%D {\clip[mp=lrellipse] {\blackrule}} {lrellipse}
-%D {\clip[mp=ellipse] {\blackrule}} {ellipse}
-%D {\clip[mp=negellipse]{\blackrule}} {negellipse}
-%D {\clip[mp=tellipse] {\blackrule}} {tellipse}
-%D {\clip[mp=bellipse] {\blackrule}} {bellipse}
-%D {\clip[mp=lellipse] {\blackrule}} {lellipse}
-%D {\clip[mp=rellipse] {\blackrule}} {rellipse}
-%D {} {}
-%D {} {}
-%D {\clip[mp=urtriangle]{\blackrule}} {urtriangle}
-%D {\clip[mp=ultriangle]{\blackrule}} {ultriangle}
-%D {\clip[mp=lltriangle]{\blackrule}} {lltriangle}
-%D {\clip[mp=lrtriangle]{\blackrule}} {lrtriangle}
-%D {\clip[mp=diamond] {\blackrule}} {diamond}
-%D {\clip[mp=negdiamond]{\blackrule}} {negdiamond}
-%D \stopcombination % \stopcombination
-%D \stopbuffer
-%D
-%D \placefigure % \placefigure
-%D [here][fig:clipping paths]
-%D {The predefined clipping paths.}
-%D {\getbuffer} % {\getbuffer}
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/meta-dum.mkii b/Master/texmf-dist/tex/context/base/mkii/meta-dum.mkii
deleted file mode 100644
index dae30ed695b..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/meta-dum.mkii
+++ /dev/null
@@ -1,123 +0,0 @@
-%D \module
-%D [ file=meta-dum,
-%D version=2003.03.21,
-%D title=\METAPOST\ Graphics,
-%D subtitle=Dummy (External) Graphics,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\unprotect
-
-%D This library overloads the normal external figure
-%D placeholder by a nicer one.
-%D
-%D \startbuffer
-%D \useMPlibrary[dum]
-%D
-%D \startlinecorrection
-%D \externalfigure[unknown-a][width=3cm,height=1cm]
-%D \stoplinecorrection
-%D
-%D \startlinecorrection
-%D \externalfigure[unknown-b][width=4cm,height=5cm]
-%D \stoplinecorrection
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-
-% currently preparempvariables is unable to resolve number
-% fractions like reduction
-
-% June 22, 2003, this definition was patched to adapt itself
-% to transparent colors
-
-\startuseMPgraphic{placeholder}{width,height,reduction,color}
- numeric w, h, d, r ; color c, b, cc ; path p ; boolean t ;
- t := is_transparent(\MPvar{color}) ;
- c := not_transparent(\MPvar{color}) ;
- b := not_transparent(white) ;
- w := \MPvar{width} ;
- h := \MPvar{height} ;
- r := \MPvar{reduction} ;
- d := max(w,h) ;
- p := unitsquare xyscaled (w,h) ;
- cc := r[.5c,b] ;
- fill p withcolor if t : transparent(1,.5,cc) else : cc fi ;
- for i := 1 upto 60 :
- cc := r[c randomized(.3,.9),b] ;
- fill fullcircle
- scaled (d/5 randomized (d/5))
- shifted (center p randomized (d))
- withcolor if t : transparent(1,.5,cc) else : cc fi ;
- endfor ;
- clip currentpicture to p ;
-\stopuseMPgraphic
-
-\definepalet
- [placeholder]
- [1=red,2=green,3=blue,4=cyan,5=magenta,6=yellow]
-
-% \newcounter \figurereplacementcycle
-
-\let\figurereplacementcycle\relax
-
-\setupexternalfigures
- [\c!reduction=0,
- \c!text=\v!yes]
-
-\let\normalexternalfigurereplacement\externalfigurereplacement
-
-\def\externalfigurereplacement#1#2#3%
- {\getpaletsize[placeholder]%
- \ifx\figurereplacementcycle\relax
- \getrandomnumber \figurereplacementcycle \!!plusone \paletsize
- \globallet \figurereplacementcycle \figurereplacementcycle
- \else
- \doglobal\increment\figurereplacementcycle
- \fi
- \ifnum\figurereplacementcycle>\paletsize
- \globallet\figurereplacementcycle\!!plusone
- \fi
- \weightGRAYfalse % monochrome anyway
- \MPcmykcolorsfalse
- \MPspotcolorsfalse
- \defineoverlay
- [\s!dummy]
- [\useMPgraphic
- {placeholder}%
- {width=\figurewidth,
- height=\figureheight,
- reduction=\@@efreduction,
- color=placeholder:\figurereplacementcycle}]%
- \expanded{\localframed
- [\??ef]
- [\c!width=\figurewidth,
- \c!height=\figureheight,
- \c!frame=\v!off,
- \c!strut=\v!no,
- \c!background=\s!dummy,
- \c!foregroundcolor=\s!white]}%
- {\doif\@@eftext\v!yes
- {\infofont \setupinterlinespace \dohyphens % \nohyphens
- \doifelse{#1}\s!dummy \!!doneafalse\!!doneatrue
- \doifelse{#2}\s!dummy \!!donebfalse\!!donebtrue
- \doifelse{#3}\s!unknown\!!donecfalse\!!donectrue
- \if!!donea
- name: \expanded{\verbatimstring{#1}}\strut\endgraf
- \fi
- \if!!doneb
- \if!!donea file: \else \if!!donec file: \fi \fi
- \expanded{\verbatimstring{#2}}\strut\endgraf
- \fi
- \if!!donec
- state: \expanded{\verbatimstring{#3}}\strut\endgraf
- \fi}}}
-
-\def\dummyfigure{\externalfigure[placeholder]}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/meta-fig.mkii b/Master/texmf-dist/tex/context/base/mkii/meta-fig.mkii
deleted file mode 100644
index 31fe5fc0c0e..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/meta-fig.mkii
+++ /dev/null
@@ -1,89 +0,0 @@
-%D \module
-%D [ file=meta-fig,
-%D version=2000.09.07,
-%D title=\METAPOST\ Graphics,
-%D subtitle=Stand Alone Graphics,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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}{MetaPost Graphics / Stand Alone Graphics}
-
-\unprotect
-
-%D This module implements a method for defining
-%D stand||alone||graphics, that is, each graphic gets is own
-%D page. Because graphics are wrapped in a \type {\framed},
-%D you can add overlays to the graphic directly, and since the
-%D whole \CONTEXT\ machinery is available, you can also add
-%D page backgrounds.
-%D
-%D \starttyping
-%D \setupMPpage
-%D [offset=1pt,
-%D background=color,
-%D backgroundcolor=green]
-%D
-%D \startMPpage
-%D fill fullcircle scaled 10cm withcolor red ;
-%D \stopMPpage
-%D
-%D \startMPpage
-%D fill fullsquare rotated 45 scaled 8cm withcolor blue ;
-%D \stopMPpage
-%D \stoptyping
-%D
-%D Although this is hardly of any use, you can mix these
-%D definitions with the text flow, since all settings are
-%D kept local. The page is clipped to the image size.
-
-\presetlocalframed[\??mg]
-
-\def\setupMPpage
- {\dodoubleargument\getparameters[\??mg]}
-
-\def\startMPpage
- {\dodoubleempty\dostartMPpage}
-
-\long\def\dostartMPpage[#1][#2]% second arg gobbles space
- {\dostartfittingpage[\??mg][#1]%
- \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,
- \c!align=,
- \c!offset=\v!overlay,
- \c!width=\v!fit,
- \c!height=\v!fit,
- \c!frame=\v!off]
-
-%D \macros
-%D {MPfigure}
-%D
-%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
- \startMPcode
- externalfigure "#1"
- xscaled \figurewidth\space
- yscaled \figureheight\space
- #2 ;
- \stopMPcode
- \egroup}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/meta-ini.mkii b/Master/texmf-dist/tex/context/base/mkii/meta-ini.mkii
deleted file mode 100644
index 9780fecfadf..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/meta-ini.mkii
+++ /dev/null
@@ -1,1054 +0,0 @@
-%D \module
-%D [ file=meta-ini,
-%D version=1999.07.10,
-%D title=\METAPOST\ Graphics,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% currently the running color influences the mp graphic in
-% pdftex, but this will change [i.e. become optional]; one
-% problem is that pdf has no grouping with regards to the
-% color
-
-\writestatus{loading}{MetaPost Graphics / Initializations}
-
-\unprotect
-
-%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
-%D extended. Since some support is depends on \METAPOST\
-%D macros. so let's first preload a few auxiliary \METAPOST\
-%D files.
-
-\maxnofMPgraphics = 4000 % metafun disables the 4K boundary
-
-\appendtoks \flushMPgraphics \to \everygoodbye % \everylastshipout
-
-\def\@@MPG{@MPG@}
-
-%D Since we want lables to follow the document settings, we
-%D also set the font related variables.
-
-\ifnum\texengine=\xetexengine
- \startMPinitializations % scale is not yet ok
- defaultfont:="rm-lmtt10";
- defaultscale:=\the\bodyfontsize/10pt;
- \stopMPinitializations
-\else
- \startMPinitializations % scale is not yet ok
- defaultfont:="\truefontname{Regular}";
- defaultscale:=\the\bodyfontsize/10pt;
- \stopMPinitializations
-\fi
-
-%D In order to support fancy text features (like outline
-%D fonts), we set:
-
-\startMPextensions
- graphictextformat:="context";
- graphictextdirective "\the\everyMPTEXgraphic";
-\stopMPextensions
-
-% \startMPextensions
-% textextdirective "\the\everyMPTEXgraphic";
-% \stopMPextensions
-
-%D A signal that we're in combines \CONTEXT||\METAFUN mode:
-
-\startMPextensions
- string contextversion;
- contextversion:="\contextversion";
-\stopMPextensions
-
-%D Some safeguards:
-%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:
-
-\prependtoks \MPstaticgraphictrue \to \everyoverlay
-\prependtoks \MPstaticgraphictrue \to \everypagebody
-
-%D We save the number of graphics for the sake of \TEXEXEC.
-
-\newcounter\totalnofMPgraphics
-
-\def\thenofMPgraphics{\the\nofMPgraphics} % from supp-mps
-
-\appendtoks
- \savecurrentvalue\totalnofMPgraphics\thenofMPgraphics
-\to \everybye
-
-%D \macros
-%D {setupMPvariables}
-%D
-%D When we build collections of \METAPOST\ graphics, like
-%D background and buttons, the need for passing settings
-%D arises. By (mis|)|using the local prefix that belongs to
-%D \type {\framed}, we get a rather natural interface to
-%D backgrounds. To prevent conflicts, we will use the \type
-%D {-} in \METAPOST\ specific variables, like:
-%D
-%D \starttyping
-%D \setupMPvariables[meta:button][size=20pt]
-%D \stoptyping
-
-\def\@@meta{meta:}
-
-\def\setupMPvariables
- {\dodoubleempty\dosetupMPvariables}
-
-\def\dosetupMPvariables[#1][#2]%
- {\ifsecondargument
- \getrawparameters[#1:][#2]% brr, todo: [\@@meta#1:]
- \else
- \getrawparameters[\@@meta][#1]%
- \fi}
-
-\let\@@framed\s!unknown
-
-\def\MPvariable#1%
- {\csname
- \ifcsname\@@framed\@@meta#1\endcsname\@@framed\fi\@@meta#1%
- \endcsname}
-
-\let\MPvar\MPvariable
-
-\let\setMPvariables\setupMPvariables
-
-\def\MPrawvar#1#2{\csname#1:#2\endcsname}
-
-\def\presetMPvariable
- {\dodoubleargument\dopresetMPvariable}
-
-\def\dopresetMPvariable[#1][#2=#3]%
- {\doifundefined{#1:#2}{\setvalue{#1:#2}{#3}}}
-
-\def\useMPvariables
- {\dodoubleargument\douseMPvariables}
-
-\def\douseMPvariables[#1][#2]%
- {\def\@@meta{#1:}%
- \prepareMPvariables{#2}}
-
-%D \macros
-%D {startuniqueMPgraphic, uniqueMPgraphic}
-%D
-%D This macros is probably of most use to myself, since I like
-%D to use graphics that adapt themselves. The next \METAPOST\
-%D kind of graphic is both unique and reused when possible.
-%D
-%D \starttyping
-%D \defineoverlay[example][\uniqueMPgraphic{test}]
-%D
-%D \startuniqueMPgraphic {test}
-%D draw unitsquare xscaled \overlaywidth yscaled \overlayheight ;
-%D \stopuniqueMPgraphic
-%D \stoptyping
-
-%D For educational purposes, we show the original version
-%D first. This one used a rather simple method for determining
-%D the uniqueness.
-%D
-%D \starttyping
-%D \long\def\startuniqueMPgraphic#1#2\stopuniqueMPgraphic%
-%D {\setvalue{\@@MPG#1}%
-%D {\startreusableMPgraphic{\overlaystamp:#1}#2\stopreusableMPgraphic
-%D \reuseMPgraphic{\overlaystamp:#1}}}
-%D
-%D \def\uniqueMPgraphic#1%
-%D {\getvalue{\@@MPG#1}}
-%D \stoptyping
-
-%\def\overlaystamp % watch the \MPcolor, since colors can be redefined
-% {\overlaywidth:\overlayheight:\overlaydepth
-% :\MPcolor{\overlaycolor}:\MPcolor{\overlaylinecolor}}
-
-\def\overlaystamp % watch the \MPcolor, since colors can be redefined
- {\overlaywidth:\overlayheight:\overlaydepth
- :\MPcolor\overlaycolor:\MPcolor\overlaylinecolor}
-
-%D A better approach is to let additional variables play a role
-%D in determining the uniqueness. In the next macro, the
-%D second, optional, argument is used to guarantee the
-%D uniqueness, as well as prepare variables for passing them to
-%D \METAPOST.
-%D
-%D \starttyping
-%D \startuniqueMPgraphic{meta:hash}{gap,angle,...}
-%D \stoptyping
-%D
-%D The calling macro also accepts a second argument. For
-%D convenient use in overlay definitions, we use \type {{}}
-%D instead of \type {[]}.
-%D
-%D \starttyping
-%D \uniqueMPgraphic{meta:hash}{gap=10pt,angle=30}
-%D \stoptyping
-
-\long\def\handleuniqueMPgraphic#1#2#3%
- {\blabelgroup
- \def\@@meta{#1:}%
- \extendMPoverlaystamp{#2}% incl prepare
- \ifundefined{\@@MPG\overlaystamp:#1}%
- \enableincludeMPgraphics
- \startMPgraphic#3\stopMPgraphic
- \doifobjectssupportedelse\donothing\useMPboxfalse
- \ifuseMPbox
- \@EA\douseMPbox
- \else
- \@EA\nouseMPbox
- \fi {\@@MPG\overlaystamp:#1}%
- \fi
- \getvalue{\@@MPG\overlaystamp:#1}%
- \elabelgroup}
-
-\long\def\startuniqueMPgraphic
- {\blabelgroup
- \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
- {\dodoublegroupempty\douniqueMPgraphic}
-
-\def\douniqueMPgraphic#1#2%
- {\blabelgroup
- \setupMPvariables[#1][#2]%
- \getvalue{\@@MPG#1}{}%
- \elabelgroup}
-
-\let\stopuniqueMPcode \relax % so that we can use it in \expanded
-
-\def\includeMPgraphic#1%
- {\executeifdefined{\@@MPG#1};} % ; if not found
-
-\long\def\handleuseMPgraphic#1#2#3%
- {\blabelgroup
- \def\@@meta{#1:}%
- \prepareMPvariables{#2}%
- \enableincludeMPgraphics
- \startMPgraphic#3\stopMPgraphic
- \ifMPrun \else % see mfun-004 : processing buffer
- \loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{}%
- \placeMPgraphic
- \fi
- \deallocateMPslot\currentMPgraphic
- \elabelgroup}
-
-\long\def\startuseMPgraphic
- {\blabelgroup
- \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
- {\blabelgroup
- \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%
- {\blabelgroup
- \def\@@meta{#1:}%
- \prepareMPvariables{#2}%
- \enableincludeMPgraphics
- \startMPgraphic#3\stopMPgraphic
- \doifobjectssupportedelse\donothing\useMPboxfalse
- \ifuseMPbox
- \@EA\douseMPbox
- \else
- \@EA\nouseMPbox
- \fi {\@@MPG#1}%
- \getvalue{\@@MPG#1}%
- \elabelgroup}
-
-\long\def\startreusableMPgraphic
- {\blabelgroup
- \dodoublegroupempty\dostartreusableMPgraphic}
-
-\def\dostartreusableMPgraphic
- {\obeyMPlines
- \dodostartreusableMPgraphic}
-
-\long\def\dodostartreusableMPgraphic#1#2#3\stopreusableMPgraphic
- {\long\setgvalue{\@@MPG#1}{\handlereusableMPgraphic{#1}{#2}{#3}}%
- \elabelgroup}
-
-\unexpanded\def\useMPgraphic
- {\dodoublegroupempty\douseMPgraphic}
-
-\def\douseMPgraphic#1#2%
- {\blabelgroup
- \setupMPvariables[#1][#2]%
- \getvalue{\@@MPG#1}{}%
- \elabelgroup}
-
-\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}
-
-% todo: each code/page/buffer a var class
-
-%D \macros
-%D {startuniqueMPpagegraphic,uniqueMPpagegraphic}
-%D
-%D Experimental.
-
-\def\MPpageprefix{\doifoddpageelse oe:}
-
-\def\overlaypagestamp
- {\MPpageprefix\overlaywidth:\overlayheight:\overlaydepth
- :\MPcolor\overlaycolor:\MPcolor\overlaylinecolor}
-
-\long\def\startuniqueMPpagegraphic
- {\blabelgroup
- \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}
-
-\unexpanded\def\uniqueMPpagegraphic
- {\dodoublegroupempty\douniqueMPpagegraphic}
-
-% \def\douniqueMPpagegraphic#1#2%
-% {\blabelgroup
-% \let\overlaystamp\overlaypagestamp
-% \setupMPvariables[#1][#2]%
-% \getvalue{\@@MPG\MPpageprefix#1}{}%
-% \elabelgroup}
-
-\def\douniqueMPpagegraphic#1#2%
- {\blabelgroup
- \let\overlaystamp\overlaypagestamp
- \setupMPvariables[\MPpageprefix#1][#2]% prefix is new here
- \getvalue{\@@MPG\MPpageprefix#1}{}%
- \elabelgroup}
-
-%D One way of defining a stamp is:
-%D
-%D \starttyping
-%D \def\extendMPoverlaystamp#1%
-%D {\def\docommand##1%
-%D {\edef\overlaystamp{\overlaystamp:\MPvariable{##1}}}%
-%D \processcommalist[#1]\docommand}
-%D \stoptyping
-
-%D Since we need to feed \METAPOST\ with expanded dimensions,
-%D we introduce a dedicated expansion engine.
-
-\def\prepareMPvariable#1%
- {\ifundefined{\@@framed\@@meta#1}%
- \doprepareMPvariable{\@@meta#1}%
- \else
- \doprepareMPvariable{\@@framed\@@meta#1}%
- \fi}
-
-% \startlines
-% \def\xxx{\lineheight} \doprepareMPvariable{xxx} \xxx
-% \def\xxx{2pt} \doprepareMPvariable{xxx} \xxx
-% \def\xxx{2} \doprepareMPvariable{xxx} \xxx
-% \def\xxx{\scratchcounter} \doprepareMPvariable{xxx} \xxx
-% \def\xxx{red} \doprepareMPvariable{xxx} \xxx
-% \def\xxx{0.4} \doprepareMPvariable{xxx} \xxx
-% \stoplines
-
-\def\doprepareMPvariable#1%
- {\edef\theMPvariable{\getvalue{#1}}%
- \doifelsenothing\theMPvariable
- {\setevalue{#1}{\MPcolor{black}}}
- {\defconvertedcommand\ascii\theMPvariable % otherwise problems
- \doifcolorelse \ascii % with 2\bodyfontsize
- {\setevalue{#1}{\MPcolor\theMPvariable}}
- {% can be aux macro
- \setbox\scratchbox\hbox{\scratchdimen\theMPvariable sp}%
- \ifdim\wd\scratchbox=\zeropoint
- % \scratchcounter\theMPvariable
- % \setevalue{#1}{\the\scratchcounter}%
- % also accepts 0.number :
- \setevalue{#1}{\number\theMPvariable}%
- \else
- \scratchdimen\theMPvariable
- \setevalue{#1}{\the\scratchdimen}%
- \fi}}}
-
-%D We redefine \type {\extendMPoverlaystamp} to preprocess
-%D variables using \type {\prepareMPvariable}.
-
-\def\doextendMPoverlaystamp#1%
- {\prepareMPvariable{#1}%
- \edef\overlaystamp{\overlaystamp:\MPvariable{#1}}}
-
-\def\extendMPoverlaystamp#1%
- {\processcommalist[#1]\doextendMPoverlaystamp}
-
-\def\prepareMPvariables#1%
- {\processcommalist[#1]\prepareMPvariable}
-
-%D \macros
-%D {MPdatafile}
-%D
-%D We redefine a macro from \type {supp-mps.tex}:
-
-\def\MPdatafile
- {\bufferprefix mpd-\the\currentMPgraphic.mpd}
-
-%D \macros
-%D {MPrunfile}
-%D
-%D This one is more abstract and does not assume knowledge
-%D of buffer prefixes.
-
-\def\MPrunfile#1%
- {\bufferprefix mprun.#1}
-
-%D \macros
-%D {getMPdata}
-%D
-%D When we collect graphics in one file, we run into
-%D troubles, since \METAPOST\ has a built in limit (of 4)
-%D on the number of files it can handle. It's therefore
-%D better to collect all data in one file and filter it.
-
-\def\MPdataMPDfile{\jobname-mpgraph.mpd}
-\def\MPdataMPOfile{\jobname-mpgraph.mpo}
-\def\MPdataMPYfile{\jobname-mpgraph.mpy}
-
-\startMPextensions
- boolean collapse_data; collapse_data:=true;
- def data_mpd_file="\MPdataMPDfile"; enddef ;
- def data_mpo_file="\MPdataMPOfile"; enddef ;
- def data_mpy_file="\MPdataMPYfile"; enddef ;
-\stopMPextensions
-
-\def\getMPdata
- {\long\def\MPdata##1##2{\ifnum##1=\currentMPgraphic\relax##2\fi}%
- \startreadingfile
- % \startnointerference % no, else we need to do all data global
- \readlocfile\MPdataMPDfile\donothing\donothing
- % \stopnointerference
- \stopreadingfile}
-
-%D We have to enable this mechanism with:
-
-\startMPextensions
-\stopMPextensions
-
-%D For the moment, the next one is a private macro:
-
-\def\processMPbuffer
- {\dosingleempty\doprocessMPbuffer}
-
-\def\doprocessMPbuffer[#1]%
- {\doifelsenothing{#1}
- {\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}%
- \def\dodoprocessMPbuffer##1%
- {\doprocessfile\scratchread{\TEXbufferfile{##1}}\copyMPbufferline}%
- \processcommalist[#1]\dodoprocessMPbuffer
- \@EA\startMPcode\the\!!toksa\stopMPcode % more efficient
- \egroup}}
-
-\def\runMPbuffer
- {\dosingleempty\dorunMPbuffer}
-
-\def\dorunMPbuffer[#1]% processing only
- {{\MPruntrue\doprocessMPbuffer[#1]}}
-
-%D \macros
-%D {startMPenvironment, resetMPenvironment}
-%D
-%D In order to synchronize the main \TEX\ run and the runs
-%D local to \METAPOST, environments can be passed.
-
-\ifx\everyMPTEXgraphic\undefined
- \newtoks\everyMPTEXgraphic
-\fi
-
-%D A more general way of passing environments is:
-
-\def\startMPenvironment % second arg gobbles spaces, so that reset gives \emptytoks
- {\bgroup
- \catcode`\^^M=\@@space
- \dodoubleempty\dostartMPenvironment}
-
-\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}+{#3}% % use in main doc too
- \defconvertedargument\ascii{#3}%
- \expandafter\appendtoks\ascii\to\everyMPTEXgraphic}
-
-\def\resetMPenvironment
- {\everyMPTEXgraphic\emptytoks % = is really needed !
- \startMPenvironment
- \global\loadfontfileoncetrue
- \stopMPenvironment}
-
-\resetMPenvironment
-
-\def\useMPenvironmentbuffer[#1]%
- {\expanded{\startMPenvironment\noexpand\readfile{\TEXbufferfile{\jobname}}{}{}}\stopMPenvironment}
-
-% \useMPenvironmentbuffer[mp] % what was this?
-
-%D This command takes \type {[reset]} as optional
-%D argument.
-%D
-%D \starttyping
-%D \startMPenvironment
-%D \setupbodyfont[pos,14.4pt]
-%D \stopMPenvironment
-%D
-%D \startMPcode
-%D draw btex \sl Hans Hagen etex scaled 5 ;
-%D \stopMPcode
-%D \stoptyping
-%D
-%D The \type {\resetMPenvironment} is a quick way to erase
-%D the token list.
-%D
-%D You should be aware of independencies. For instance, if you use a font
-%D in a graphic that is not used in the main document, you need to load the
-%D typescript at the outer level (either directly or by using the global
-%D option).
-%D
-%D \starttyping
-%D \usetypescript[palatino][texnansi]
-%D
-%D \startMPenvironment
-%D \usetypescript[palatino][texnansi]
-%D \enableregime[utf]
-%D \setupbodyfont[palatino]
-%D \stopMPenvironment
-%D
-%D \startMPpage
-%D draw btex aap‒noot coördinatie – één etex ;
-%D \stopMPpage
-%D \stoptyping
-
-%D We don't want spurious files, do we?
-
-%\def\initializeMPgraphics
-% {%\ifx\bufferprefix\empty \else
-% \immediate\openout\MPwrite\MPgraphicfile.mp
-% \immediate\write\MPwrite{end.}%
-% \immediate\closeout\MPwrite
-% }%\fi}
-
-% strange :
-
-% \def\initializeMPgraphicfile
-% {\bgroup
-% \doinitializeMPgraphicfile
-% \MPruntrue
-% \doinitializeMPgraphicfile
-% \egroup}
-
-% \def\doinitializeMPgraphicfile
-% {\immediate\openout\scratchwrite\MPgraphicfile.mp
-% \immediate\write\scratchwrite{end.}%
-% \immediate\closeout\scratchwrite}
-
-\def\initializeMPgraphicfile
- {\immediate\openout\scratchwrite\MPgraphicfile.mp
- \immediate\write\scratchwrite{end.}%
- \immediate\closeout\scratchwrite}
-
-\def\initializeMPgraphics
- {\bgroup
- \initializeMPgraphicfile
-% \ifx\bufferprefix\empty\else
-% \let\bufferprefix\empty
-% \initializeMPgraphicfile
-% \fi
- \egroup}
-
-%D Loading specific \METAPOST\ related definitions is
-%D accomplished by:
-
-\def\douseMPlibrary#1%
- {\ifundefined{\c!file\f!metapostprefix#1}%
- \letvalueempty{\c!file\f!metapostprefix#1}%
- \makeshortfilename[\truefilename{\f!metapostprefix#1}]%
- \startreadingfile
- \readsysfile{\shortfilename.\mksuffix}
- {\showmessage\m!metapost1{#1}}
- {\readsysfile{\shortfilename.tex}
- {\showmessage\m!metapost1{#1}}
- \donothing}%
- \stopreadingfile
- \fi}
-
-\def\useMPlibrary[#1]%
- {\processcommalist[#1]\douseMPlibrary}
-
-%D \macros
-%D {setMPtext, MPtext, MPstring, MPbetex}
-%D
-%D To be documented:
-%D
-%D \starttyping
-%D \setMPtext{identifier}{text}
-%D
-%D \MPtext {identifier}
-%D \MPstring{identifier}
-%D \MPbetex {identifier}
-%D \stoptyping
-
-\def\@@MPT{@MPT@}
-
-\def\forceMPTEXgraphic
- {\long\def\checkMPTEXgraphic##1{\global\MPTEXgraphictrue}}
-
-\def\setMPtext#1#2% todo : #1 must be made : safe
- {%\forceMPTEXgraphic
- \defconvertedargument\ascii{#2}%
- \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{\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
-%D information needed to handle them naturaly.
-
-\newif\ifMPcmykcolors \MPcmykcolorstrue
-\newif\ifMPspotcolors \MPspotcolorstrue
-
-\startMPinitializations
- cmykcolors:=\ifMPcmykcolors true\else false\fi;
- spotcolors:=\ifMPspotcolors true\else false\fi;
-\stopMPinitializations
-
-%D In order to communicate conveniently with the \TEX\
-%D engine, we introduce some typesetting variables.
-
-% todo : backgroundoffsets
-
-\startMPextensions
- color OverlayColor,OverlayLineColor;
-\stopMPextensions
-
-\startMPinitializations
- OverlayWidth:=\overlaywidth;
- OverlayHeight:=\overlayheight;
- OverlayDepth:=\overlayheight;
- OverlayColor:=\MPcolor{\overlaycolor};
- OverlayLineWidth:=\overlaylinewidth;
- OverlayLineColor:=\MPcolor{\overlaylinecolor};
- %
- BaseLineSkip:=\the\baselineskip;
- LineHeight:=\the\baselineskip;
- BodyFontSize:=\the\bodyfontsize;
- %
- TopSkip:=\the\topskip;
- StrutHeight:=\strutheight;
- StrutDepth:=\strutdepth;
- %
- CurrentWidth:=\the\hsize;
- CurrentHeight:=\the\vsize;
- %
- EmWidth:=\the\emwidth;
- ExHeight:=\the\exheight;
- %
- PageNumber:=\the\pageno;
- RealPageNumber:=\the\realpageno;
- LastPageNumber:= \lastpage;
-\stopMPinitializations
-
-\appendtoks
- \disablediscretionaries
- \disablecompoundcharacters
-\to\everyMPgraphic
-
-% New, experimental (if complaints than only in enco-ffr.mkii), well
-% Mojca complained that it does not work with utf-8 and textext, see
-% ** in meta-tex.
-
-\appendtoks
- \chardef\activecharactermode\zerocount
-\to\everyMPgraphic
-
-\appendtoks
- \expanded{\definecolor[currentcolor][\currentcolorname]}%
-\to \everyMPgraphic
-
-\appendtoks
- \baselineskip1\baselineskip
- \lineheight 1\lineheight
- \topskip 1\topskip
-\to \everyMPgraphic
-
-%D Alas, the prologue settings differ per driver.
-
-\ifx\undefined\MPprologues \def\MPprologues{0} \fi
-
-\startMPinitializations
- prologues:=\MPprologues;
- mpprocset:=1;
-\stopMPinitializations
-
-\appendtoks
- \def\MPprologues{0}%
- \def\MPOSTdriver{dvips}%
-\to \everyresetspecials
-
-%D \macros
-%D {PDFMPformoffset}
-%D
-%D In \PDF, forms are clipped and therefore we have to take
-%D precautions to get this right. Since this is related to
-%D objects, we use the same offset as used there.
-
-\def\PDFMPformoffset{\objectoffset}
-
-%D \macros
-%D {insertMPfile}
-%D
-%D Bypassing the special driver and figure mechanism is not
-%D that nice but saves upto 5\% time in embedding \METAPOST\
-%D graphics by using the low level \PDF\ converter directly,
-%D given of course that we use \PDFTEX. As a result we need to
-%D fool around with the object trigger.
-
-\newtoks\everyinsertMPfile
-
-%D First we present the reasonable fast alternative that we
-%D happily used for some time.
-%D
-%D \starttyping
-%D \def\insertMPfile#1#2%
-%D {\ifx\undefined\externalfigure
-%D \message{[insert file #1 here]}%
-%D \else
-%D \bgroup
-%D \the\everyinsertMPfile
-%D \externalfigure
-%D [#1]
-%D [\c!type=\c!mps,\c!object=\v!no,%
-%D \c!symbol=\v!yes,\c!reset=\v!yes,%
-%D \c!maxwidth=,\c!maxheight=,%
-%D \c!frame=\v!off,\c!background=,%
-%D #2]%
-%D \egroup
-%D \fi}
-%D \stoptyping
-%D
-%D However, on a 1 Gig Pentium, the next alternative saves
-%D us 20 seconds run time for the 300 page \METAFUN\ manual:
-
-\let\insertMPfileARG\insertMPfile
-
-\def\insertMPfile#1#2% in context #2 is empty
- {\doifelsenothing{#2}{\doinsertMPfile{#1}}{\insertMPfileARG{#1}{#2}}}
-
-\def\includeMPasEPS#1% untested !!
- {\bgroup
- \message{[MP as EPS #1]}%
- \the\everyinsertMPfile
- \dogetEPSboundingbox{#1}\!!widtha\!!heighta\!!widthb\!!heightb
- \setbox\scratchbox\vbox to \!!heightb
- {\vfill
- \let \@@DriverImageType \c!mps
- \def \@@DriverImageFile {#1}%
- \edef\@@DriverImageWidth {\the\!!widthb }%
- \edef\@@DriverImageHeight{\the\!!heightb}%
- \doinsertfile}%
- \wd\scratchbox\!!widthb
- \dp\scratchbox\zeropoint
- \box\scratchbox
- \egroup}
-
-\ifx\makeMPintoPDFobject\undefined \newcount\makeMPintoPDFobject \fi
-
-\def\includeMPasPDF#1%
- {\bgroup
- \the\everyinsertMPfile
- \ifinobject \else \makeMPintoPDFobject\plustwo \fi % when needed
- \convertMPtoPDF{#1}{1}{1}% no \plusone !
- \egroup}
-
-%D So, using a low level approach (thereby avoiding the slower
-%D figure analysis macros) pays off. This kind of
-%D optimizations are a bit tricky since we must make sure that
-%D special resources end up in the (PDF) files. Because the
-%D \METAPOST\ to \PDF\ can handle objects itself, it is not
-%D that complicated.
-
-%D We hook a couple of initializations into the graphic
-%D macros.
-
-\appendtoks
- \let\figuretypes\c!mps
- \runutilityfilefalse
- \consultutilityfilefalse
-\to \everyinsertMPfile
-
-%D One more: (still needed?)
-
-\startMPextensions
- def initialize_form_numbers =
- do_initialize_numbers;
- enddef;
-\stopMPextensions
-
-\startMPinitializations
- HSize:=\the\hsize ;
- VSize:=\the\vsize ;
-\stopMPinitializations
-
-\startMPextensions
- vardef ForegroundBox =
- unitsquare xysized(HSize,VSize)
- enddef ;
- vardef PageFraction =
- if \lastpage>1: (\realfolio-1)/(\lastpage-1) else: 1 fi
- enddef ;
-\stopMPextensions
-
-%D And some more. These are not really needed since we
-%D don't use the normal figure inclusion macros any longer.
-
-\appendtoks
- \externalfigurepostprocessors\emptytoks % safeguard
-\to \everyinsertMPfile
-
-%D We also take care of disabling fancy figure features, that
-%D can terribly interfere when dealing with symbols,
-%D background graphics and running (postponed) graphics.
-%D You won't believe me if I tell you what funny side effects
-%D can occur. One took me over a day to uncover when
-%D processing the screen version of the \METAFUN\ manual.
-
-%D For my eyes only:
-
-\def\doifelseMPgraphic#1{\doifdefinedelse{\@@MPG#1}}
-
-%D \macros
-%D {startMPcolor}
-%D
-%D The following time consuming method uses \METAPOST\ to
-%D calculate a color. This enables a match between colors
-%D resulting from a complex calculation (e.g. for a title
-%D page) and those in the text.
-
-% \startuseMPgraphic{somecolors}
-% color c[] ; c[1] := .7[red,green] ; c[2] := .7[blue,yellow] ;
-% \stopuseMPgraphic
-
-% \startMPcolor[shade-1][t=.2,a=1]
-% \includeMPgraphic{somecolors} ; fill fullcircle withcolor c[1] ;
-% \stopMPcolor
-
-% \startMPcolor[shade-2][t=.2,a=1]
-% \includeMPgraphic{somecolors} ; fill fullcircle withcolor c[2] ;
-% \stopMPcolor
-
-% \blackrule[width=\hsize,height=4cm,color=shade-1]
-% \blackrule[width=\hsize,height=4cm,color=shade-2]
-
-\def\startMPcolor
- {\dodoubleempty\dostartMPcolor}
-
-\long\def\dostartMPcolor[#1][#2]#3\stopMPcolor % slow but sometimes handy
- {\startnointerference
- \def\handleMPgraycolor{\expanded{\defineglobalcolor[#1][s=\!MPgMPa1,#2]}}%
- \def\handleMPrgbcolor {\expanded{\defineglobalcolor[#1][r=\!MPgMPa1,g=\!MPgMPa2,b=\!MPgMPa3,#2]}}%
- \def\handleMPcmykcolor{\expanded{\defineglobalcolor[#1][c=\!MPgMPa1,m=\!MPgMPa2,y=\!MPgMPa3,k=\!MPgMPa4,#2]}}%
- \startMPcode#3\stopMPcode
- \stopnointerference}
-
-%D New:
-
-\definelayerpreset % no dx,dy - else nasty non-mp placement
- [mp]
- [\c!y=-\MPury bp,
- \c!x=\MPllx bp,
- \c!method=\v!fit]
-
-\definelayer
- [mp]
- [\c!preset=mp]
-
-%D Usage:
-%D
-%D \starttyping
-%D \defineproperty[one][layer][state=start]
-%D \defineproperty[two][layer][state=stop]
-%D
-%D \startuseMPgraphic{step-1}
-%D fill fullcircle scaled 10cm withcolor red ;
-%D \stopuseMPgraphic
-%D
-%D \startuseMPgraphic{step-2}
-%D fill fullcircle scaled 5cm withcolor green ;
-%D \stopuseMPgraphic
-%D
-%D \setlayer[mp]{\property[one]{\useMPgraphic{step-1}}}
-%D \setlayer[mp]{\property[two]{\useMPgraphic{step-2}}}
-%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
-
-%D Goody for preventing overflows:
-
-\def\MPdivten[#1]{\withoutpt\the\dimexpr#1pt/10\relax}
-
-%D Done.
-
-\protect \endinput
-
-%D Experimental:
-
-\appendtoks
- \ifrunMPgraphics \ifcase\systemcommandmode \or
- \runMPgraphicsfalse
- \fi \fi
-\to \everyjob
-
-% also:
-%
-% linecap := rounded ;
-% linejoin := rounded ;
-% drawoptions () ;
diff --git a/Master/texmf-dist/tex/context/base/mkii/meta-mis.mkii b/Master/texmf-dist/tex/context/base/mkii/meta-mis.mkii
deleted file mode 100644
index e8282c381b8..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/meta-mis.mkii
+++ /dev/null
@@ -1,54 +0,0 @@
-%D \module
-%D [ file=meta-mis,
-%D version=2006.06.06,
-%D title=\METAPOST\ Graphics,
-%D subtitle=Misc Test Graphics,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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
-
-% p/s 1/false 1/true 2/false 2/true
-%
-% MKII 8.5 8.0 8.8 8.5
-% MKIV 16.1 7.2 16.3 7.4
-
-\startuseMPgraphic{mptopdf-test}
- prologues := 2;
- mpprocset := 1 ;
- fill fullcircle scaled 3cm withcolor red ;
- fill fullcircle scaled 2cm withcolor green ;
- fill fullcircle scaled 1cm withcolor blue ;
- currentpicture := currentpicture shifted (-4cm,0) ;
- fill fullcircle scaled 3cm withcolor cmyk(0,0,1,0) ;
- fill fullcircle scaled 2cm withcolor cmyk(0,1,0,0) ;
- fill fullcircle scaled 1cm withcolor cmyk(1,0,0,0) ;
- currentpicture := currentpicture shifted (-4cm,0) ;
- draw fullcircle scaled 3cm dashed evenly ;
- draw fullcircle scaled 2cm dashed withdots ;
- draw origin withpen pencircle scaled 3mm;
- currentpicture := currentpicture shifted (-4cm,0) ;
- fill fullcircle scaled 2cm shifted (-.5cm,+.5cm) withcolor transparent(1,.5,red);
- fill fullcircle scaled 2cm shifted (-.5cm,-.5cm) withcolor transparent(1,.5,red);
- fill fullcircle scaled 2cm shifted (+.5cm,+.5cm) withcolor transparent(1,.5,green);
- fill fullcircle scaled 2cm shifted (+.5cm,-.5cm) withcolor transparent(1,.5,cmyk(1,0,1,.5));
- currentpicture := currentpicture shifted (12cm,-4cm) ;
- draw "o e p s" infont defaultfont scaled 2 shifted (-1cm,0) ;
- currentpicture := currentpicture shifted (-4cm,0) ;
- % bug: shift
- draw fullcircle scaled 3cm withpen pencircle yscaled 3mm xscaled 2mm rotated 30 ;
- draw fullcircle scaled 2cm withpen pencircle yscaled 3mm xscaled 2mm rotated 20 withcolor red ;
- filldraw fullcircle scaled 1cm withpen pencircle yscaled 3mm xscaled 2mm rotated 10 withcolor green ;
- currentpicture := currentpicture shifted (-4cm,0) ;
- % shade cannot handle shift
- circular_shade(fullcircle scaled 3cm,0,.2red,.9green) ;
- circular_shade(fullcircle scaled 3cm shifted(+4cm,0),0,cmyk(1,0,0,0),cmyk(0,1,0,0)) ;
- filldraw boundingbox currentpicture enlarged (-bbheight(currentpicture)/2+2.5mm) withpen pencircle scaled 1pt withcolor .5white ;
-\stopuseMPgraphic
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/meta-nav.mkii b/Master/texmf-dist/tex/context/base/mkii/meta-nav.mkii
deleted file mode 100644
index 45a31ba5ecf..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/meta-nav.mkii
+++ /dev/null
@@ -1,65 +0,0 @@
-%D \module
-%D [ file=meta-nav,
-%D version=2003.03.28,
-%D title=\METAPOST\ Graphics,
-%D subtitle=Navigational Graphics,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\startuniqueMPgraphic{navplus}{size,color,type,mode}
- color c ; numeric s, t ; path p ;
- t := \MPvar{type} ; c := \MPvar{color} ; s := \MPvar{size} ;
- if \MPvar{mode} = 1 : c := .5[c,white] fi ;
- if t = 1 :
- p := ((0,0)--(1/2,0)--(1,1/3)--(1,1)--(0,1)--(0,0)--cycle)
- xyscaled (3,4) ;
- elseif t = 2 :
- p := ((0,0)--(1,0)--(1,1)--(0,1)--(1/2,2/5)--(1,1)--(0,1)--cycle)
- xyscaled (4,3) ;
- else :
- p := fullsquare xyscaled (3,3) ;
- fi ;
- draw p withpen pencircle scaled (1/2) withcolor .75white ;
- fill p withcolor c ;
- draw p withpen pencircle scaled (1/3) withcolor .5c ;
- currentpicture := currentpicture scaled s ;
- currentpicture := currentpicture shifted -center currentpicture ;
-\stopuniqueMPgraphic
-
-\setupMPvariables
- [navplus]
- [size=1ex,
- color=black,
- type=1,
- mode=0]
-
-\definepalet
- [navplus]
- [attach=darkred,
- comment=darkblue]
-
-\definesymbol
- [comment-normal]
- [\uniqueMPgraphic{navplus}{type=1,color=navplus:comment}]
-\definesymbol
- [comment-down]
- [\uniqueMPgraphic{navplus}{type=1,color=navplus:comment,mode=1}]
-
-\definesymbol
- [attach-normal]
- [\uniqueMPgraphic{navplus}{type=2,color=navplus:attach}]
-\definesymbol
- [attach-down]
- [\uniqueMPgraphic{navplus}{type=2,color=navplus:attach,mode=1}]
-
-\unprotect
-
-\setupcomment [\c!symbol={comment-normal,comment-down}]
-\setupattachments[\c!symbol={attach-normal,attach-down}]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/meta-pag.mkii b/Master/texmf-dist/tex/context/base/mkii/meta-pag.mkii
deleted file mode 100644
index 82a525a0820..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/meta-pag.mkii
+++ /dev/null
@@ -1,226 +0,0 @@
-%D \module
-%D [ file=meta-pag,
-%D version=1999.07.10,
-%D title=\METAPOST\ Graphics,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 definitions used to be part of the old \type
-%D {core-mps} file, later changed into \type {meta-ini}, but
-%D keeping them separate is cleaner.
-
-\writestatus{loading}{MetaPost Graphics / Page Data Management}
-
-\unprotect
-
-\startMPextensions
- if unknown context_page: input mp-page; fi;
-\stopMPextensions
-
-%D The next few macros tell \METAPOST\ how the \CONTEXT\
-%D pagebody looks.
-
-\startMPextensions
- boolean PageStateAvailable,OnRightPage,InPageBody;
- PageStateAvailable:=true;
-\stopMPextensions
-
-\startMPinitializations
- OnRightPage:=true;
- InPageBody:=\ifinpagebody true \else false \fi;
-\stopMPinitializations
-
-\startMPinitializations
- def LoadPageState =
- OnRightPage:=\MPonrightpage;
- OnOddPage:=\MPonoddpage;
- RealPageNumber:=\the\realpageno;
- PageNumber:=\the\pageno;
- NOfPages:=\lastpage;
- PaperHeight:=\the\paperheight;
- PaperWidth:=\the\paperwidth;
- PrintPaperHeight:=\the\printpaperheight;
- PrintPaperWidth:=\the\printpaperwidth;
- TopSpace:=\the\topspace;
- BottomSpace:=\the\bottomspace;
- BackSpace:=\the\backspace;
- CutSpace:=\the\cutspace;
- MakeupHeight:=\the\makeupheight;
- MakeupWidth:=\the\makeupwidth;
- TopHeight:=\the\topheight;
- TopDistance:=\the\topdistance;
- HeaderHeight:=\the\headerheight;
- HeaderDistance:=\the\headerdistance;
- TextHeight:=\the\textheight;
- FooterDistance:=\the\footerdistance;
- FooterHeight:=\the\footerheight;
- BottomDistance:=\the\bottomdistance;
- BottomHeight:=\the\bottomheight;
- LeftEdgeWidth:=\the\leftedgewidth;
- LeftEdgeDistance:=\the\leftedgedistance;
- LeftMarginWidth:=\the\leftmarginwidth;
- LeftMarginDistance:=\the\leftmargindistance;
- TextWidth:=\the\textwidth ;
- RightMarginDistance:=\the\rightmargindistance;
- RightMarginWidth:=\the\rightmarginwidth;
- RightEdgeDistance:=\the\rightedgedistance;
- RightEdgeWidth:=\the\rightedgewidth;
- InnerMarginDistance:=\the\innermargindistance;
- InnerMarginWidth:=\the\innermarginwidth;
- OuterMarginDistance:=\the\outermargindistance;
- OuterMarginWidth:=\the\outermarginwidth;
- InnerEdgeDistance:=\the\inneredgedistance;
- InnerEdgeWidth:=\the\inneredgewidth;
- OuterEdgeDistance:=\the\outeredgedistance;
- OuterEdgeWidth:=\the\outeredgewidth;
- PageOffset:=\the\pageoffset;
- PageDepth:=\the\pagedepth;
- LayoutColumns:=\the\layoutcolumns;
- LayoutColumnDistance:=\the\layoutcolumndistance;
- LayoutColumnWidth:=\the\layoutcolumnwidth;
- enddef;
-\stopMPinitializations
-
-\def\MPonrightpage{true}
-\def\MPonoddpage {true}
-
-\def\freezeMPpagelayout
- {\doifbothsides
- {\def\MPonrightpage{true}}
- {\def\MPonrightpage{true}}
- {\def\MPonrightpage{false}}%
- \edef\MPonoddpage{\doifoddpageelse{true}{false}}}
-
-\let\freezeMPlayout\relax % obsolete
-
-%D We need to freeze the pagelayout before the backgrounds
-%D are build, because the overlay will temporarily become
-%D zero (overlay).
-
-\appendtoks
- \freezeMPpagelayout
-\to \everybeforepagebody
-
-%D By freezing these value every graphic, we can use layout
-%D variables that change halfways a page, whatever use that
-%D has.
-
-\prependtoks
- \calculatereducedvsizes % this is really needed
- \freezeMPpagelayout
- \freezeMPlayout % to be used grouped
-\to \everyMPgraphic
-
-%D The next feature provides information about for instance
-%D column positions. This is an experimental feature,
-%D introduced when we needed backgrounds in columns (fill||in
-%D questions as implemented in a private module).
-%D
-%D See \type {mp-page.mp} for the definition of the macros:
-%D
-%D \starttabulate[|tl|l|p|]
-%D \NC ResetTextAreas \NC no arguments \NC
-%D reset areas on page \NC \NR
-%D \NC RegisterTextArea \NC x, y, w, h \NC
-%D adds area to the list \NC \NR
-%D \NC TextAreaX,Y,W,H,XY,WH \NC x and/or y \NC
-%D reports offsets and dimensions \NC \NR
-%D \stoptabulate
-%D
-%D The \type {TextArea*} macros can be used to determine
-%D overlap.
-
-\newcount\currentMPtextareadata
-
-\newtoks\MPsavedtextareadata
-\newtoks\MPtextareadata
-\newtoks\MPlocaltextareadata
-
-% optimaliseren voor herhaling
-
-\def\registerMPtextarea#1%
- {\ifpositioning
- \bgroup
- \global\advance\currentMPtextareadata\plusone
- %\hpos{gbd:\the\currentMPtextareadata}{#1}%
- \hpos{gbd:\the\currentMPtextareadata}%
- {\iftracetextareas\boxrulewidth1.5pt\ruledhbox\fi{#1}}%
- \edef\!!stringa{gbd:\the\currentMPtextareadata}%
- \edef\!!stringa{RegisterTextArea(%
- \MPx\!!stringa,\MPy\!!stringa,%
- \MPw\!!stringa,\MPh\!!stringa,\MPd\!!stringa);}%
- \@EA \doglobal \@EA \appendtoks \!!stringa \to \MPtextareadata
- \egroup
- \else
- \hbox{#1}%
- \fi}
-
-\def\registerMPlocaltextarea#1%
- {\ifpositioning
- \bgroup
- \global\advance\currentMPtextareadata\plusone
- %\hpos{gbd:\the\currentMPtextareadata}{#1}%
- \hpos{gbd:\the\currentMPtextareadata}%
- {\iftracetextareas\boxrulewidth3pt\ruledhbox\fi{#1}}%
- \edef\!!stringa{gbd:\the\currentMPtextareadata}%
- \edef\!!stringa{RegisterLocalTextArea(%
- \MPx\!!stringa,\MPy\!!stringa,%
- \MPw\!!stringa,\MPh\!!stringa,\MPd\!!stringa);}%
- \global\MPlocaltextareadata\@EA{\!!stringa}%
- \egroup
- \else
- \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
-% \global\advance\currentMPtextareadata\plusone
-% \edef\namedtextarea{gbd:\the\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}
-
-\startMPextensions
- path PlainTextArea;
-\stopMPextensions
-
-\startMPinitializations
- ResetTextAreas;
- \the\MPsavedtextareadata;
- SaveTextAreas;
- ResetTextAreas;
- \the\MPtextareadata;
- \the\MPlocaltextareadata;
- PlainTextArea:=boundingbox(\MPxy{text:\realfolio}--\MPxy{text:\realfolio}
- shifted (\MPw{text:\realfolio},\MPh{text:\realfolio}));
-\stopMPinitializations
-
-\appendtoks
- \global\MPsavedtextareadata\MPtextareadata
- \global\MPtextareadata \emptytoks
- \global\MPlocaltextareadata\emptytoks
-\to \everyshipout
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/meta-pdf.mkii b/Master/texmf-dist/tex/context/base/mkii/meta-pdf.mkii
deleted file mode 100644
index e1311339878..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/meta-pdf.mkii
+++ /dev/null
@@ -1,2761 +0,0 @@
-%D \module
-%D [ file=meta-pdf,
-%D version=2006.06.07,
-%D title=\METAPOST\ Graphics,
-%D subtitle=Conversion to \PDF,
-%D author=Hans Hagen \& others (see text),
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Formerly known as supp-pdf.tex and supp-mpe.tex.
-
-%D We will clean up the color mess later.
-
-%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 0pt here by defaukt since it may be
-% defined in the range \dimen 0 - 20 which we happen to use
-% as scratch registers; for this reason we start allocating
-% scratch registers > 20
-
-%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}{MetaPost Graphics / MPS to PDF}
-
-\unprotect
-
-\ifx\PDFcode \undefined \let\PDFcode \gobbleoneargument \fi
-\ifx\PDFcomment\undefined \def\PDFcomment#1{\PDFcode{\letterpercent\space#1}} \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 % still relevant?
-
- \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\dimexpr\wd\scratchbox-#3-#4\relax
- \vsize\dimexpr\ht\scratchbox-#5-#6\relax
- \setbox\scratchbox\vbox to \vsize
- {\vskip-#5\hbox to \hsize{\hskip-#3\box\scratchbox\hss}}%
- \pdfxform\scratchbox
- \pdfrefxform\pdflastxform
- \egroup}
-
-\fi \fi
-
-%D \macros
-%D {convertMPtoPDF}
-%D
-%D The next set of macros implements \METAPOST\ to \PDF\
-%D conversion. The traditional method is in the MkII file.
-
-%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 \newcount\makeMPintoPDFobject \fi
-\ifx\blackoutMPgraphic \undefined \chardef\blackoutMPgraphic\plusone \fi
-\ifx\everyMPtoPDFconversion\undefined \newtoks\everyMPtoPDFconversion \fi
-
-\let\lastPDFMPobject \!!zerocount
-\let\currentPDFresources\empty
-\let\setMPextensions \relax
-
-\def\PDFMPformoffset
- {\ifx\objectoffset\undefined\zeropoint\else\objectoffset\fi}
-
-\def\resetMPvariables#1#2#3%
- {\global\let\MPwidth \!!zeropoint
- \global\let\MPheight\!!zeropoint
- \global\let\MPllx \!!zerocount
- \global\let\MPlly \!!zerocount
- \global\let\MPurx \!!zerocount
- \global\let\MPury \!!zerocount
- \xdef\MPxscale {#2}\ifx\MPxscale\empty\let\MPxscale\!!plusone\fi
- \xdef\MPyscale {#3}\ifx\MPyscale\empty\let\MPyscale\!!plusone\fi
- \xdef\MPfilename {#1}}
-
-%D The main macro:
-
-\def\convertMPtoPDF#1#2#3%
- {\resetMPvariables{#1}{#2}{#3}%
- \vbox\bgroup
- \forgetall
- \offinterlineskip
- \ifx\pdfdecimaldigits\undefined\else \pdfdecimaldigits=5 \fi % new
- \global\let\MPheight\!!zeropoint
- \global\let\MPwidth \!!zeropoint
- \setbox\scratchbox\vbox\bgroup
- \message{[MP to PDF]}%
- \startMPresources
- \PDFcomment{mps begin}%
- \PDFcode{q}%
- \PDFcode{1 0 0 1 0 0 cm}%
- \ifcase\blackoutMPgraphic\or\PDFcode{0 g 0 G}\fi
- \doprocessMPtoPDFfile}
-
-\def\processMPtoPDFfile#1#2#3% obsolete
- {\resetMPvariables{#1}{#2}{#3}%
- \bgroup
- \let\finishMPgraphic\egroup
- \doprocessMPtoPDFfile}
-
-\def\doprocessMPtoPDFfile
- {\setMPspecials
- \setMPextensions
- \the\everyMPtoPDFconversion
- \catcode`\^^M=\@@endofline
- \startMPscanning
- \let\do\empty
- \donefalse
- \let\handleMPsequence\dohandleMPsequence
- \input\MPfilename\relax}
-
-\def\finishMPgraphic
- {\PDFcode{Q}%
- \PDFcomment{mps end}%
- \stopMPresources
- \egroup
- \setbox\scratchbox\hbox\bgroup
- \hskip-\MPllx\onebasepoint
- \raise-\MPlly\onebasepoint
- \box\scratchbox
- \egroup
- \setbox\scratchbox\vbox to \MPheight\bgroup
- \vfill
- \hsize\MPwidth
- \smashbox\scratchbox
- \box\scratchbox
- \egroup
- \wd\scratchbox\MPwidth
- \ht\scratchbox\MPheight
- \dopackageMPgraphic\scratchbox
- \egroup
- \endinput}
-
-%D A common hook.
-
-\let\MPfshowcommand\empty
-
-%D Objects.
-
-\def\dopackageMPgraphic#1% #1 = boxregister
- {\ifcase\makeMPintoPDFobject\or\or\ifx\currentPDFresources\empty\else
- % an existing value of 2 signals object support (set elsewhere)
- \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}
-
-\ifx\deleteMPgraphic\undefined
- \def\deleteMPgraphic#1{}
-\fi
-
-\ifx\startMPresources\undefined
- \let\startMPresources\relax
- \let\stopMPresources\relax
-\fi
-
-%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
-
-\newconditional\manyMPspecials \settrue\manyMPspecials
-
-%D In case of \PDF, we need to prepare resourcs.
-
-\newtoks\MPstartresources
-\newtoks\MPstopresources
-
-\def\startMPresources
- {\the\MPstartresources}
-
-\def\stopMPresources
- {\the\MPstopresources}
-
-%D Some day we may consider collecting local resources.
-
-\appendtoks
- \global\let\currentPDFresources\empty % kind of redundant
-\to \MPstartresources
-
-% \appendtoks
-% \collectPDFresources
-% \global\let\currentPDFresources\collectedPDFresources
-% \to \MPstopresources
-
-\appendtoksonce
- \the\everyPDFxform
-\to \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
-
-\def\dohandleMPrgb #1#2#3{\revokeMPtransparencyspecial\execcolorR #1:#2:#3:0:0\od}
-\def\dohandleMPcmyk#1#2#3#4{\revokeMPtransparencyspecial\execcolorC#1:#2:#3:#4:0:0\od}
-\def\dohandleMPgray #1{\revokeMPtransparencyspecial\execcolorS #1:0:0\od}
-\def\dohandleMPspot#1#2#3#4{\revokeMPtransparencyspecial\execcolorP#1:#2:#3:#4:0:0\od}
-
-%D Specials:
-
-\settrue \manyMPspecials \newcount\nofMParguments \let\extraMPpathcode\empty
-
-\def\@@MP {@@MP}
-\def\@@MPSK{@MPSK@}
-
-\def\MPspecial{\@@MPSK\@@MPSK\gMPs\nofMParguments}
-
-\def\defineMPspecial#1#2%
- {\setvalue{\@@MPSK\@@MPSK#1}{#2}}
-
-%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\gMPs6}{\noexpand\dohandleMPcmykcolor{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}}%
- \fi}
-
-\defineMPspecial{2}
- {\ifMPspotcolors
- \setxvalue{\@@MPSK\gMPs6}{\noexpand\dohandleMPspotcolor{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}}%
-% \checkMPspot{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}%
- \fi}
-
-% \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}
-
-\let\revokeMPtransparencyspecial\relax
-
-\def\dohandleMPrgbcolor #1#2#3{\revokeMPtransparencyspecial\execcolorR #1:#2:#3:0:0\od}
-\def\dohandleMPcmykcolor#1#2#3#4{\revokeMPtransparencyspecial\execcolorC#1:#2:#3:#4:0:0\od}
-\def\dohandleMPgraycolor #1{\revokeMPtransparencyspecial\execcolorS #1:0:0\od}
-\def\dohandleMPspotcolor#1#2#3#4{\revokeMPtransparencyspecial\execcolorP#1:#2:#3:#4:0:0\od}
-
-%D Transparency support used specials 60 (rgb) and 61
-%D (cmyk).
-%D
-%D \startbufferFshade
-
-%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\dohandleMPrgbtransparency #1#2#3#4#5{\execcolorR #1:#2:#3:#4:#5\od\let\revokeMPtransparencyspecial\dorevokeMPtransparencyspecial}
-\def\dohandleMPcmyktransparency#1#2#3#4#5#6{\execcolorC#1:#2:#3:#4:#5:#6\od\let\revokeMPtransparencyspecial\dorevokeMPtransparencyspecial}
-\def\dohandleMPgraytransparency #1#2#3{\execcolorS #1:#2:#3\od\let\revokeMPtransparencyspecial\dorevokeMPtransparencyspecial}
-\def\dohandleMPspottransparency#1#2#3#4#5#6{\execcolorP#1:#2:#3:#4:#5:#6\od\let\revokeMPtransparencyspecial\dorevokeMPtransparencyspecial}
-
-\def\dorevokeMPtransparencyspecial
- {\PDFcode{\PDFtransparencyresetidentifier\space gs}%
- \let\revokeMPtransparencyspecial\relax}
-
-\defineMPspecial{3} % rgb
- {\setxvalue{\@@MPSK\gMPs6}{\noexpand\dohandleMPrgbtransparency{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs1}{\gMPs2}}}
-
-\defineMPspecial{4} % cmyk
- {\setxvalue{\@@MPSK\gMPs7}{\noexpand\dohandleMPcmyktransparency{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs1}{\gMPs2}}}
-
-\defineMPspecial{5} % spot
- {\setxvalue{\@@MPSK\gMPs7}{\noexpand\dohandleMPspottransparency{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs1}{\gMPs2}}%
- }%\checkMPspot{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs6}}
-
-%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
-
-% \def\dosetMPsomePDFshade#1#2% generic but needs refs
-% {\global\advance\currentPDFshade \plusone
-% \doPDFdictionaryobject{FDF}{ftn:Sh:\the\currentPDFshade}
-% {/FunctionType 2
-% /Domain [\gMPs1 \gMPs2]
-% /C0 [\MPshadeA]
-% /C1 [\MPshadeB]
-% /N \gMPs3}%
-% \doPDFgetobjectreference{FDF}{ftn:Sh:\the\currentPDFshade}\PDFobjectreference
-% \doPDFdictionaryobject{FDF}{obj:Sh:\the\currentPDFshade}
-% {/ShadingType #1
-% /ColorSpace /\MPresolvedspace
-% /Function \PDFobjectreference\space
-% /Coords [\MPshadeC]
-% /Extend [true true]}%
-% \doPDFgetobjectreference{FDF}{obj:Sh:\the\currentPDFshade}\PDFobjectreference
-% \appendtoPDFdocumentshades{/Sh\the\currentPDFshade\space\PDFobjectreference}%
-% \setxvalue{\@@MPSK#2}{\noexpand\dohandleMPshade{\the\currentPDFshade}}}
-
-\def\dosetMPsomePDFshade#1#2%
- {\immediate\pdfobj
- {<</FunctionType 2
- /Domain [\gMPs1 \gMPs2]
- /C0 [\MPshadeA]
- /C1 [\MPshadeB]
- /N \gMPs3>>}%
- \immediate\pdfobj
- {<</ShadingType #1
- /ColorSpace /\MPresolvedspace
- /Function \the\pdflastobj\space 0 R
- /Coords [\MPshadeC]
- /Extend [true true]>>}%
- \global\advance\currentPDFshade \plusone
- \appendtoPDFdocumentshades{/Sh\the\currentPDFshade\space\the\pdflastobj\space0 R }%
- \setxvalue{\@@MPSK#2}{\noexpand\dohandleMPshade{\the\currentPDFshade}}}
-
-\def\dosetMPlinearshade {\dosetMPsomePDFshade2}% #1
-\def\dosetMPcircularshade{\dosetMPsomePDFshade3}% #1
-
-\defineMPspecial{30}
- {\expanded{\resolveMPrgbcolor{\gMPs4}{\gMPs5}{\gMPs6}}\to\MPshadeA
- \expanded{\resolveMPrgbcolor{\gMPs{9}}{\gMPs{10}}{\gMPs{11}}}\to\MPshadeB
- \edef\MPshadeC{\gMPs7 \gMPs8 \gMPs{12} \gMPs{13}}%
- \dosetMPlinearshade{\gMPs{14}}}
-
-\defineMPspecial{31}
- {\expanded{\resolveMPrgbcolor{\gMPs4}{\gMPs5}{\gMPs6}}\to\MPshadeA
- \expanded{\resolveMPrgbcolor{\gMPs{10}}{\gMPs{11}}{\gMPs{12}}}\to\MPshadeB
- \edef\MPshadeC{\gMPs7 \gMPs8 \gMPs9 \gMPs{13} \gMPs{14} \gMPs{15}}%
- \dosetMPcircularshade{\gMPs{16}}}
-
-\defineMPspecial{32}
- {\expanded{\resolveMPcmykcolor{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs7}}\to\MPshadeA
- \expanded{\resolveMPcmykcolor{\gMPs{10}}{\gMPs{11}}{\gMPs{12}}{\gMPs{13}}}\to\MPshadeB
- \edef\MPshadeC{\gMPs8 \gMPs9 \gMPs{14} \gMPs{15}}%
- \dosetMPlinearshade{\gMPs{16}}}
-
-\defineMPspecial{33}
- {\expanded{\resolveMPcmykcolor{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs7}}\to\MPshadeA
- \expanded{\resolveMPcmykcolor{\gMPs{11}}{\gMPs{12}}{\gMPs{13}}{\gMPs{14}}}\to\MPshadeB
- \edef\MPshadeC{\gMPs8 \gMPs9 \gMPs{10} \gMPs{15} \gMPs{16} \gMPs{17}}%
- \dosetMPcircularshade{\gMPs{18}}}
-
-\defineMPspecial{34}
- {\expanded{\resolveMPspotcolor{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs7}}\to\MPshadeA
- \expanded{\resolveMPspotcolor{\gMPs{10}}{\gMPs{11}}{\gMPs{12}}{\gMPs{13}}}\to\MPshadeB
- \edef\MPshadeC{\gMPs8 \gMPs9 \gMPs{14} \gMPs{15}}%
- \dosetMPlinearshade{\gMPs{16}}}
-
-\defineMPspecial{35}
- {\expanded{\resolveMPcmykcolor{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs7}}\to\MPshadeA
- \expanded{\resolveMPcmykcolor{\gMPs{11}}{\gMPs{12}}{\gMPs{13}}{\gMPs{14}}}\to\MPshadeB
- \edef\MPshadeC{\gMPs8 \gMPs9 \gMPs{10} \gMPs{15} \gMPs{16} \gMPs{17}}%
- \dosetMPcircularshade{\gMPs{18}}}
-
-
-\newconditional\ignoreMPpath
-
-\def\dohandleMPshade#1%
- {\revokeMPtransparencyspecial
- \settrue\ignoreMPpath
- \def\extraMPpathcode{/Sh#1 sh Q}%
- \chardef\finiMPpath\zerocount
- \PDFcode{q /Pattern cs}}
-
-%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.
-
-\defineMPspecial{10}
- {\setxvalue{\@@MPSK\gMPs8}%
- {\noexpand\handleMPfigurespecial{\gMPs1}{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs6}{\gMPs7}{\gMPs8}}}
-
-\def\handleMPfigurespecial#1#2#3#4#5#6#7#8% todo : combine with ext fig
- {\global\letvalue{\@@MPSK#8}\empty
- \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{\@@MPSK\gMPs6}%
- {\noexpand\handleMPhyperlink{\gMPs1}{\gMPs2}{\gMPs3}{\gMPs4}{\gMPs5}{\gMPs6}}}
-
-\def\handleMPhyperlink#1#2#3#4#5#6%
- {\global\letvalue{\@@MPSK#6}\empty
- \setbox\scratchbox\hbox
- {\setbox\scratchbox\null
- \wd\scratchbox\dimexpr-#1\onebasepoint+#3\onebasepoint\relax
- \ht\scratchbox\dimexpr-#2\onebasepoint+#4\onebasepoint\relax
- \incolorfalse
- \gotobox{\box\scratchbox}[#5]}%
- \setbox\scratchbox\hbox
- {\hskip\dimexpr\MPxoffset\onebasepoint+#1\onebasepoint\relax
- \raise\dimexpr\MPyoffset\onebasepoint+#2\onebasepoint\relax
- \box\scratchbox}%
- \smashbox\scratchbox
- \box\scratchbox}
-
-%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
-
-\defineMPspecial{50} % x y width height label
- {\dosavepositionwhd
- {\gMPs5}%
- {0}%
- {\the\dimexpr-\MPllx\onebasepoint+\gMPs1\onebasepoint\relax}
- {\the\dimexpr\gMPs2\onebasepoint-\scratchdimen+\MPury\onebasepoint\relax}%
- {\the\dimexpr\gMPs3\onebasepoint\relax}%
- {\the\dimexpr\gMPs4\onebasepoint\relax}%
- {0pt}}
-
-%D A few auxiliary macros. This will move to colo-ini.
-
-\def\MPgrayspace{DeviceGray}
-\def\MPrgbspace {DeviceRGB}
-\def\MPcmykspace{DeviceCMYK}
-\let\MPspotspace\MPgrayspace
-
-\def\MPcmykBlack{0 0 0 0}
-\def\MPcmykWhite{0 0 0 1}
-
-\def\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 % left over ?
- \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\to#4%
- {\startMPcolorresolve
- \execcolorR#1:#2:#3:0:0\od
- \stopMPcolorresolve
- \let#4\MPresolvedcolor}
-
-\def\resolveMPcmykcolor#1#2#3#4\to#5%
- {\startMPcolorresolve
- \execcolorC#1:#2:#3:#4:0:0\od
- \stopMPcolorresolve
- \let#5\MPresolvedcolor}
-
-\def\resolveMPgraycolor#1\end\to#2%
- {\startMPcolorresolve
- \execcolorS#1:0:0\od
- \stopMPcolorresolve
- \let#2\MPresolvedcolor}
-
-\def\resolveMPspotcolor#1#2#3#4\end\to#5%
- {\startMPcolorresolve
- \ifnum#2>\plusone
- \checkmultitonecolor{#1}%
- \fi
- \execcolorP#1:#2:#3:#4:0:0\od
- \stopMPcolorresolve
- \let#5\MPresolvedcolor}
-
-%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=#2\onebasepoint\dimen2=-\dimen2 % \dimen2=-#2\onebasepoint also works since tex handles --
- \dimen4=#3\onebasepoint\dimen4=-\dimen4 % \dimen4=-#3\onebasepoint also works since tex handles --
- \dimen6=#4\onebasepoint\advance\dimen6 \dimen2
- \dimen8=#5\onebasepoint\advance\dimen8 \dimen4
- \setPDFboundingbox{\dimen2}{\dimen4}{\dimen6}{\dimen8}\PDFxscale\PDFyscale}
-
-%D End of soon obsolete code.
-
-\startMPinitializations
- mp_shade_version := 2 ;
-\stopMPinitializations
-
-%D Here comes the traditional \MKII\ converter.
-%D
-%D Because we want to test as fast as possible, we first
-%D define the \POSTSCRIPT\ operators that \METAPOST\ uses.
-%D We don't define irrelevant ones, because these are
-%D skipped anyway.
-%D
-%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:}
-\edef \PSBeginProlog {\letterpercent\letterpercent BeginProlog}
-\edef \PSEndProlog {\letterpercent\letterpercent EndProlog}
-\edef \PSEof {\letterpercent\letterpercent EOF}
-
-%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
-
-%D We could use a catcodetable here.
-
-\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\dohandleMPsequence#1%
- {\ifdone
- \ifcase\lccode`#1\relax
- \@EAEAEA\dohandleMPsequenceA
- \else
- \@EAEAEA\dohandleMPsequenceB
- \fi
- \else
- \@EA\dohandleMPsequenceC
- \fi#1}
-
-\let\dohandleMPsequenceA\setMPsequence
-
-\def\installMPSkeywordN#1#2%
- {\expandafter\def\csname\@@MP:N:#1\endcsname{#2}}
-
-\def\installMPSshortcutN#1#2% todo: \let
- {\expandafter\let\csname\@@MP:N:#1\expandafter\endcsname\csname\@@MP:N:#2\endcsname}
-
-\def\dohandleMPsequenceB#1 %
- {\edef\somestring{#1}%
- \executeifdefined{\@@MP:N:\somestring}\handleMPgraphic
- \handleMPsequence}
-
-\installMPSkeywordN \PSmoveto
- {\edef\lastMPmoveX{\gMPa1}%
- \edef\lastMPmoveY{\gMPa2}%
- \resetMPstack}
-\installMPSkeywordN \PSnewpath
- {\let\handleMPsequence\handleMPpath}
-\installMPSkeywordN \PSgsave
- {\PDFcode{q}%
- \resetMPstack}
-\installMPSkeywordN \PSgrestore
- {\PDFcode{Q}%
- \resetMPstack}
-\installMPSkeywordN \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 ...
-\installMPSkeywordN \PSsetlinewidth
- {% already handled in dtransform
- \resetMPstack}
-\installMPSkeywordN \PSpop
- {% already handled in dtransform
- \resetMPstack}
-\installMPSkeywordN \PSconcat
- {\cleanupMPconcat
- \PDFcode{\gMPa1 \gMPa2 \gMPa3 \gMPa4 \gMPa5 \gMPa6 cm}%
- \resetMPstack}
-\installMPSkeywordN \PSsetrgbcolor
- {\handleMPrgbcolor
- \resetMPstack}
-\installMPSkeywordN \PSsetcmykcolor
- {\handleMPcmykcolor
- \resetMPstack}
-\installMPSkeywordN \PSsetgray
- {\handleMPgraycolor
- \resetMPstack}
-\installMPSkeywordN \PStranslate
- {\PDFcode{1 0 0 1 \gMPa1 \gMPa2 cm}%
- \resetMPstack}
-\installMPSkeywordN \PSsetdash
- {\handleMPsetdash
- \resetMPstack}
-\installMPSkeywordN \PSsetlinejoin
- {\PDFcode{\gMPa1 j}%
- \resetMPstack}
-\installMPSkeywordN \PSsetmiterlimit
- {\PDFcode{\gMPa1 M}%
- \resetMPstack}
-\installMPSkeywordN \PSfshow
- {%\PDFcode{n}% removed !
- \handleMPfshow
- \resetMPstack}
-\installMPSkeywordN \PSsetlinecap
- {\PDFcode{\gMPa1 J}%
- \resetMPstack}
-\installMPSkeywordN \PSrlineto
- {\flushMPmoveto
- \PDFcode{\!MP\lastMPmoveX\space\!MP\lastMPmoveY\space l S}%
- \resetMPmoveto
- \resetMPstack}
-\installMPSkeywordN \PSscale
- {\PDFcode{\gMPa1 0 0 \gMPa2 0 0 cm}%
- \resetMPstack}
-\installMPSkeywordN \PSspecial
- {\handleMPspecialcommand
- \resetMPstack}
-
-\installMPSshortcutN {n} \PSnewpath
-\installMPSshortcutN {p} \PSclosepath
-\installMPSshortcutN {l} \PSlineto
-\installMPSshortcutN {r} \PSrlineto
-\installMPSshortcutN {m} \PSmoveto
-\installMPSshortcutN {c} \PScurveto
-\installMPSshortcutN {C} \PSsetcmykcolor
-\installMPSshortcutN {G} \PSsetgray
-\installMPSshortcutN {R} \PSsetrgbcolor
-\installMPSshortcutN {lj} \PSsetlinejoin
-\installMPSshortcutN {ml} \PSsetmiterlimit
-\installMPSshortcutN {lc} \PSsetlinecap
-\installMPSshortcutN {sd} \PSsetdash
-\installMPSshortcutN {S} \PSstroke
-\installMPSshortcutN {F} \PSfill
-\installMPSshortcutN {W} \PSclip
-
-\installMPSshortcutN {q} \PSgsave
-\installMPSshortcutN {Q} \PSgrestore
-
-\installMPSshortcutN {s} \PSscale
-\installMPSshortcutN {t} \PSconcat
-\installMPSshortcutN {P} \PSshowpage
-
-\installMPSkeywordN {hlw} {\PDFcode{\gMPa1 w}\resetMPstack}
-\installMPSkeywordN {vlw} {\PDFcode{\gMPa1 w}\resetMPstack}
-\installMPSkeywordN {rd} {\PDFcode{[] 0 d}\resetMPstack}
-
-\def\dohandleMPsequenceC#1 %
- {\edef\somestring{#1}%
- \handleMPgraphic
- \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\ifx\somestring\PSEof
- \let\handleMPsequence\finishMPgraphic
- \else
- \letMPargument\somestring % {#1}%
- \fi\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\PSEof
- \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\ifx\somestring\PSBeginProlog
- \let\handleMPsequence\handleMPprolog
- \else
- \letMPargument\somestring % {#1}%
- \fi\fi\fi\fi\fi\fi\fi\fi\fi}
-
-\let\handleMPgraphic=\handleMPbegingraphic
-
-%D New: we can best filter the prolog because nowdays it can contain
-%D quite some code.
-
-% hm, catcode mess, so we need to tweak %'s catcode here
-% \long\expandafter\def\expandafter\handleMPprolog\expandafter#\expandafter1\PSEndProlog%
-% but today i'm not in the mood for ugly stuff
-
-\long\def\handleMPprolog#1EndProlog %
- {\doresetMPstack
- \let\handleMPsequence\dohandleMPsequence
- \handleMPsequence}
-
-%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
- \chardef\currentMPboundingbox#1\relax
- \xdef\MPllx {#2}%
- \xdef\MPlly {#3}%
- \xdef\MPurx {#4}%
- \xdef\MPury {#5}%
- \xdef\MPwidth {\the\dimexpr\MPurx\onebasepoint-\MPllx\onebasepoint\relax}%
- \xdef\MPheight{\the\dimexpr\MPury\onebasepoint-\MPlly\onebasepoint\relax}%
- \fi
- \doresetMPstack
- \let\handleMPsequence\dohandleMPsequence
- \let\next\handleMPsequence
- \ifskipemptyMPgraphic
- \ifdim\MPheight=\zeropoint\ifdim\MPwidth=\zeropoint
- \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.
-
-%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)}.
-
-% \startMPcode
-% draw btex Ga toch effe f\kern0ptietsen?{}` etex ;
-% \stopMPcode
-
-\newtoks \everyMPshowfont
-
-\def\setMPfshowfont#1#2%
- {\font\temp=#1\space at #2\relax\temp
- \the\everyMPshowfont}
-
-\let\MPfshowcommand\empty
-
-\def\dohandleMPfshow
- {\setbox\scratchbox\hbox
- {\obeyMPspecials
- \edef\MPtextsize{\gMPa\nofMParguments}%
- \def\do(##1){##1}% only works in latest mp
- \edef\MPtextdata{\dogMPa1}% beware, stack can have more
- \handleMPtext}%
- \setbox\scratchbox\hbox
- {\hskip\lastMPmoveX\onebasepoint
- \raise\lastMPmoveY\onebasepoint
- \box\scratchbox}%
- \smashbox\scratchbox
- \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
- \defconvertedcommand\MPtextdata\MPtextdata
- \expanded{\splitstring\MPtextdata}\at::::\to\MPtexttag\and\MPtextnumber
- \executeifdefined{handleMPtext\MPtexttag}\handleMPtextnormal
- \fi}
-
-% elsewhere we will implement \handleMPtextmptxt
-
-\def\doflushMPtext#1%
- {\edef\!!stringa{#1}%
- \@EA\dodoflushMPtext\!!stringa\relax}
-
-\def\dodoflushMPtext
- {\afterassignment\dododoflushMPtext\let\nexttoken=}
-
-\def\dododoflushMPtext
- {\ifx\nexttoken\relax
- % done
- \else\ifx\nexttoken\char
- \@EA\@EA\@EA\dodododoflushMPtext
- \else
- {\nexttoken}%
- \@EA\@EA\@EA\dodoflushMPtext
- \fi\fi}
-
-\def\dodododoflushMPtext
- {\afterassignment\dododododoflushMPtext\scratchcounter}
-
-\def\dododododoflushMPtext
- {{\char\scratchcounter}\let\next\dodoflushMPtext}
-
-\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
- \setMPfshowfont{\gMPa\nofMParguments}\MPtextsize
- \advance\nofMParguments \minusone
- \temp
- \MPfshowcommand
- {\ifnum\nofMParguments=\plusone
- \def\do(##1){##1}%
- \doflushMPtext{\dogMPa1}%
- \else % can't happen anymore in mp version 1+
- % 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
- \let\somestring\empty
- \scratchcounter\plusone
- \loop
- \ifnum\scratchcounter<\nofMParguments
- \edef\somestring{\somestring\space\gMPa\scratchcounter}%
- \advance\scratchcounter \plusone
- \repeat
- \edef\somestring{[\somestring]\space\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\finiMPpath\zerocount
- \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\resetMPmoveto
- {\let\lastMPmoveX\empty
- \let\lastMPmoveY\empty}
-
-\resetMPmoveto
-
-\def\flushMPmoveto
- {\ifx\lastMPmoveX\empty \else
- \PDFcode{\!MP\lastMPmoveX\space \!MP\lastMPmoveY\space m}%
- \fi}
-
-\def\flushnormalMPsegment
- {\ifcase\getMPkeyword\relax
- \flushMPmoveto
- \resetMPmoveto
- \PDFcode{\!MPgMPs1 \!MPgMPs2 l}%
- \or
- \flushMPmoveto
- \resetMPmoveto
- \PDFcode{\!MPgMPs1 \!MPgMPs2 \!MPgMPs3 \!MPgMPs4 \!MPgMPs5 \!MPgMPs6 c}%
- \or
- \ifx\lastMPmoveX\empty \else % we assume 0,0 rlineto
- \flushMPmoveto
- \PDFcode{\!MP\lastMPmoveX\space \!MP\lastMPmoveY\space l}%
- \resetMPmoveto
- \fi
- \or
- % \flushMPmoveto
- % \resetMPmoveto
- \fi}
-
-\def\flushMPconcatmoveto
- {\ifx\lastMPmoveX\empty\else
- \doMPconcat\lastMPmoveX\lastMPmoveX\lastMPmoveY\lastMPmoveY
- \flushMPmoveto
- \fi}
-
-\def\flushconcatMPsegment
- {\ifcase\getMPkeyword\relax
- \flushMPconcatmoveto
- \resetMPmoveto
- \doMPconcat{\gMPs1}\a{\gMPs2}\b%
- \PDFcode{\!MP\a\space\!MP\b\space l}%
- \or
- \flushMPconcatmoveto
- \resetMPmoveto
- \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 % rather mp specific ... rline always has 0,0
- \bgroup
- \noMPtranslate
- \flushMPconcatmoveto
- % next should be \lastMPmoveX+\a,\lastMPmoveY+\b but we know it's 0,0
- \PDFcode{\!MP\lastMPmoveX\space\!MP\lastMPmoveY\space l S}%
- \resetMPmoveto
- \egroup
- \or
-% \flushMPconcatmoveto
-% \resetMPmoveto
- \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\plustwo
- \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 \plusfour
- \or
- \multiply\scratchdimen \plustwo
- \else
- \expandafter\doMPreadjustdimen
- \fi}
-
-\def\doMPreadjustdimen
- {\ifnum\MPscratchCnt>\plustwo
- \divide \scratchdimen\plustwo
- \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>\onepoint % oeps, can be < 1pt too
-%D \ifdim\dimen16=\onepoint \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 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.
-
-% the original:
-%
-% \def\doMPconcat#1#2#3#4%
-% {\dimen12=#1\onepoint% p_x % #1\onepoint
-% \dimen14=#3\onepoint% 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<\plusthree % 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\installMPSkeywordP#1#2%
- {\expandafter\def\csname\@@MP:P:#1\endcsname{#2}}
-
-\def\installMPSshortcutP#1#2% todo: \let
- {\expandafter\let\csname\@@MP:P:#1\expandafter\endcsname\csname\@@MP:P:#2\endcsname}
-
-\def\dohandleMPpathB#1 %
- {\def\somestring{#1}%
- \executeifdefined{\@@MP:P:\somestring}\relax
- \handleMPsequence}
-
-\installMPSkeywordP \PSlineto
- {\setMPkeyword0 }
-\installMPSkeywordP \PScurveto
- {\setMPkeyword1 }
-\installMPSkeywordP \PSrlineto
- {\setMPkeyword2 }
-\installMPSkeywordP \PSmoveto
- {\edef\lastMPmoveX{\gMPs1}%
- \edef\lastMPmoveY{\gMPs2}%
- \resetMPstack
- \setMPkeyword3 }
-\installMPSkeywordP \PSclip
- {% \chardef\finiMPpath\zerocount % already
- \let\handleMPsequence\processMPpath}
-\installMPSkeywordP \PSgsave
- {\chardef\finiMPpath\plusthree}
-\installMPSkeywordP \PSgrestore
- {}
-\installMPSkeywordP \PSfill
- {\ifcase\finiMPpath
- \chardef\finiMPpath\plustwo
- \let\handleMPsequence\processMPpath
- \fi}
-\installMPSkeywordP \PSstroke
- {\ifcase\finiMPpath
- \chardef\finiMPpath\plusone
- \fi
- \let\handleMPsequence\processMPpath}
-\installMPSkeywordP \PSclosepath
- {\def\closeMPpath{\PDFcode{h}}}
-\installMPSkeywordP \PSconcat
- {\cleanupMPconcat
- \let\flushMPpath\flushconcatMPpath
- \handleMPpathconcat}
-\installMPSkeywordP \PSscale
- {\let\flushMPpath\flushconcatMPpath
- \handleMPpathscale}
-
-\installMPSshortcutP {l} \PSlineto
-\installMPSshortcutP {r} \PSrlineto
-\installMPSshortcutP {m} \PSmoveto
-\installMPSshortcutP {c} \PScurveto
-
-\installMPSshortcutP {q} \PSgsave
-\installMPSshortcutP {Q} \PSgrestore
-\installMPSshortcutP {S} \PSstroke
-\installMPSshortcutP {F} \PSfill
-\installMPSshortcutP {B} \PSgsave
-\installMPSshortcutP {W} \PSclip
-\installMPSshortcutP {p} \PSclosepath
-
-\installMPSshortcutP {s} \PSscale
-\installMPSshortcutP {t} \PSconcat
-
-%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 Here comes the special-specific code:
-
-\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}
-
-% \settrue\manyMPspecials \setMPextensions
-
-%D This macro handles the special definitions that are
-%D passed as comment.
-
-%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.
-
-%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.
-
-%D When defined inline, we use another macro to handle the
-%D definitions. Actually, this macro is called by the
-%D previous ones.
-
-\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
-
-\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 % beware, no real \if
- \message{[unknown \MPspecial]}%
- \else
- \csname\MPspecial\endcsname
- \fi
- \ifcase\inlineMPspecials
- \doresetMPstack % 0
- \else
- \resetMPstack % 1
- \fi}
-
-\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
- {\ifnum10000=0#1\relax
- \settrue \manyMPspecials
- \else
- \setfalse\manyMPspecials
- \fi
- \setMPextensions
- \handleMPsequence}
-
-\def\handleMPrgbcolor
- {\edef\lastMPrvalue{\csname\@@MP01\endcsname}%{\gMPs1}%
- \edef\lastMPgvalue{\csname\@@MP02\endcsname}%{\gMPs2}%
- \edef\lastMPbvalue{\csname\@@MP03\endcsname}%{\gMPs3}%
- \ifnum\MPrgbnumber\lastMPrvalue=123\relax
- \csname\@@MPSK\number\MPrgbnumber\lastMPbvalue\endcsname
- \else
- \dohandleMPrgb\lastMPrvalue\lastMPgvalue\lastMPbvalue
- \fi}
-
-\def\handleMPgraycolor{\dohandleMPgray{\gMPs1}}
-\def\handleMPcmykcolor{\dohandleMPcmyk{\gMPs1}{\gMPs2}{\gMPs3}{\gMPs4}}
-\def\handleMPspotcolor{\dohandleMPspot{\gMPs1}{\gMPs2}{\gMPs3}{\gMPs4}}
-
-% \newcontitional\ignoreMPpath
-
-\def\finishMPpath
- {\ifconditional\ignoreMPpath
- \PDFcode{W n\space}%
- \else
- \PDFcode{\ifcase\finiMPpath W n\or S\or f\or B\else W n\fi}%
- \fi
- \ifx\extraMPpathcode\empty\else
- \PDFcode{\extraMPpathcode}%
- \let\extraMPpathcode\empty
- \fi
- \setfalse\ignoreMPpath}
-
-\def\processMPpath
- {\checkMPpath % !
- \flushMPpath
- \closeMPpath
- \finishMPpath
- \let\handleMPsequence\dohandleMPsequence
- \resetMPstack
- \nofMPsegments\zerocount
- \handleMPsequence}
-
-\protect \endinput
-
-% When i'm bored ...
-
-% \newcatcodetable\mpscatcodes
-
-% \startcatcodetable \mpscatcodes
-% \catcode`\| \@@comment
-% \catcode`\% \@@active
-% \catcode`\[ \@@active
-% \catcode`\] \@@active
-% \catcode`\{ \@@active
-% \catcode`\} \@@active
-% \stopcatcodetable
-
-% \def\keepMPspecials
-% {\setcatcodecommand \mpscatcodes `\% \letterpercent
-% \setcatcodecommand \mpscatcodes `\[ \letterleftbracket
-% \setcatcodecommand \mpscatcodes `\] \letterrightbracket
-% \setcatcodecommand \mpscatcodes `\{ \letterleftbrace
-% \setcatcodecommand \mpscatcodes `\} \letterrightbrace}
-
-% \def\ignoreMPspecials
-% {\setcatcodecommand \mpscatcodes `\% \letterpercent
-% \setcatcodecommand \mpscatcodes `\[ \empty
-% \setcatcodecommand \mpscatcodes `\] \empty
-% \setcatcodecommand \mpscatcodes `\{ \empty
-% \setcatcodecommand \mpscatcodes `\} \empty}
-
-% \def\obeyMPspecials
-% {\setcatcodecommand \mpscatcodes `\% \letterpercent
-% \setcatcodecommand \mpscatcodes `\[ \letterleftbracket
-% \setcatcodecommand \mpscatcodes `\] \letterrightbracket
-% \setcatcodecommand \mpscatcodes `\{ \letterleftbrace
-% \setcatcodecommand \mpscatcodes `\} \letterrightbrace}
-
-% \gdef\setMPspecials|
-% {\setcatcodetable\mpscatcodes
-% \lccode`\-=\zerocount % to be sure, it could be a letter
-% \lccode`\%=`\%% % otherwise it's seen as a number
-% \def\({\char40\relax }%
-% \def\){\char41\relax }%
-% \def\\{\char92\relax }%
-% \def\0{\octalMPcharacter0}%
-% \def\1{\octalMPcharacter1}%
-% \def\2{\octalMPcharacter2}%
-% \def\3{\octalMPcharacter3}%
-% \def\4{\octalMPcharacter4}%
-% \def\5{\octalMPcharacter5}%
-% \def\6{\octalMPcharacter6}%
-% \def\7{\octalMPcharacter7}%
-% \def\8{\octalMPcharacter8}%
-% \def\9{\octalMPcharacter9}}
diff --git a/Master/texmf-dist/tex/context/base/mkii/meta-pre.mkii b/Master/texmf-dist/tex/context/base/mkii/meta-pre.mkii
deleted file mode 100644
index 098be030b19..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/meta-pre.mkii
+++ /dev/null
@@ -1,68 +0,0 @@
-%D \module
-%D [ file=meta-pre,
-%D version=2001.03.21,
-%D title=\METAPOST\ Graphics,
-%D subtitle=Predefined Goodies,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-%D In this library, we define a couple of handy graphics.
-
-% todo: use the predefine grid macros, mp code will move to
-% mp-* file
-
-\startuseMPgraphic{pagegrid}
- StartPage ;
- drawoptions(withcolor .8white) ;
- fill Field[Text][Text] ;
- drawoptions(withcolor .65white) ;
- fill Field[Footer][Text] ;
- fill Field[Header][Text] ;
- fill Field[LeftMargin][Text] ;
- fill Field[RightMargin][Text] ;
- drawoptions(withcolor .65yellow) ;
- fill Field[LeftEdge][Text] ;
- fill Field[RightEdge][Text] ;
- fill Field[Bottom][Text] ;
- fill Field[Top][Text] ;
- drawoptions(withpen pencircle scaled .3pt withcolor .65white) ;
- for i=-3cm step 1cm until PaperWidth+3cm :
- draw (i,-3cm)--(i,PaperHeight+3cm) ;
- endfor ;
- for i=PaperHeight+3cm step -1cm until -3cm :
- draw (-3cm,i)--(PaperWidth+3cm,i) ;
- endfor ;
- drawoptions(withpen pencircle scaled .15pt) ;
- for i=.5cm-3cm step 1cm until PaperWidth+3cm :
- draw (i,-3cm)--(i,PaperHeight+3cm) ;
- endfor ;
- for i=PaperHeight-.5cm+3cm step -1cm until -3cm :
- draw (-3cm,i)--(PaperWidth+3cm,i) ;
- endfor ;
- drawoptions(withpen pencircle scaled .3pt withcolor .65red) ;
- for i=0 step 1cm until PaperWidth :
- draw (i,0)--(i,PaperHeight) ;
- endfor ;
- for i=PaperHeight step -1cm until 0 :
- draw (0,i)--(PaperWidth,i) ;
- endfor ;
- drawoptions(withpen pencircle scaled .15pt withcolor .65red) ;
- for i=.5cm step 1cm until PaperWidth :
- draw (i,0)--(i,PaperHeight) ;
- endfor ;
- for i=PaperHeight-.5cm step -1cm until 0 :
- draw (0,i)--(PaperWidth,i) ;
- endfor ;
- drawoptions(withpen pencircle scaled 5pt withcolor .65red) ;
- draw ulcorner Page ;
- StopPage ;
-\stopuseMPgraphic
-
-\defineoverlay[pagegrid][\useMPgraphic{pagegrid}]
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/meta-tex.mkii b/Master/texmf-dist/tex/context/base/mkii/meta-tex.mkii
deleted file mode 100644
index ab0f244570f..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/meta-tex.mkii
+++ /dev/null
@@ -1,350 +0,0 @@
-%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 ADE \& \CONTEXT\ Development Team}]
-%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).
-
-% todo: testmacro for empty pic
-
-\unprotect
-
-\newwrite\TeXtextwrite
-
-\def\openTeXtexts {\immediate\openout \TeXtextwrite\currentTeXtext.mpb\relax}
-\def\closeTeXtexts{\immediate\closeout\TeXtextwrite}
-
-\def\currentTeXtext {\jobname-mpgraph}
-\def\currentTeXstack{mpgtxt}
-
-\initializeboxstack\currentTeXstack
-
-\newtoks\collectedmptexts
-\newtoks\everyTeXtexts
-
-\chardef\TeXtextsmode\zerocount % no inheritance
-
-\long\def\startTeXtexts#1\stopTeXtexts
- {\global\collectedmptexts\expandafter{\the\collectedmptexts#1}}
-
-\def\dostartTeXtexts
- {\global\setfalse\TeXtextdone
- \startnointerference
- \openTeXtexts
- \ifcase\TeXtextsmode
- % normally there is no need for this (faster anyway)
- \or
- \scantokens\expandafter{\the\everyMPTEXgraphic}% brr
- \or
- \the\everyTeXtexts
- \fi
- \ifrunMPgraphics
- \initializeboxstack\currentTeXstack
- \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\currentTeXstack{#1}{\box\nextbox}}
-% \hbox}
-
-\long\def\TeXtext
- {\dosingleempty\doTeXtext}
-
-% currently, colors in the converter don't use the color stack
-%
-% 0 = nothing, withcolor works ok, but nested colors fail
-% 1 = local color stack ok
-% 2 = obey color stack (not yet supported)
-
-\chardef\TeXtextcolormode\plusone
-
-\def\definetextext[#1]#2{\setvalue{textext@@#1}{#2}}
-
-% \definetextext[framed]{\framed}
-%
-% \startMPcode
-% draw \sometxt[framed]{black} rotated 45 ;
-% \stopMPcode
-
-\long\def\doTeXtext[#1]#2#3%
- {\begingroup
- \setnormalcatcodes
- \chardef\activecharactermode\plusone % compensates ** in meta-ini.mkii
- \endlinechar\minusone
- \everyeof\emptytoks
- %\def\ascii{#3}\scantokens\expandafter{\ascii}}%
- \setbox\nextbox\hbox
- {\ifcase\TeXtextcolormode
- \scantokens{\executeifdefined{textext@@#1}\firstofoneargument{#3}}%
- \else
- \localcolortrue
- \startcurrentcolor
- \scantokens{\executeifdefined{textext@@#1}\firstofoneargument{#3}}%
- \stopcurrentcolor
- \fi}%
- \global\settrue\TeXtextdone
- \edef\currenttextxt{\number#2}%
- \executeifdefined{textext::#1}{\getvalue{textext::depth}}%
- \savebox\currentTeXstack\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
-
-% \loadmapfile[lm-texnansi.map] % the font is not really used, i.e. nothing ends up in the file
-\definefontsynonym[MPtxtfont][texnansi-lmtt10]
-\definefont[localMPtxtfont][MPtxtfont at 10bp]
-
-\ifx\getTeXtext\undefined
-
- % this took a while to figure out
-
- \let\MPtextdata\empty
-
- \def\getTeXtext
- {\ifx\MPtextdata\empty\else
- \localMPtxtfont
- \setbox\mptextbox\hbox{\foundbox\currentTeXstack{\number\nofTeXtexts}}%
- \setbox\scratchbox\hbox{\MPtextdata}% set in meta-pdf.mkii/mkiv
- \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}
-
-\fi
-
-\let\nofTeXtexts\!!zerocount
-
-\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
-
-\newcount\metatxtcounter
-
-\long\def\dodofiltersometxt#1#2#3%
- {\ifx#2\empty
- \else
- \advance\metatxtcounter\plusone
- \TeXtext{\the\metatxtcounter}{#1}%
- \expandafter\filtersometxt
- \fi#2#3}
-
-\long\def\redofiltersometxt[#1]#2%
- {\advance\metatxtcounter\plusone
- \TeXtext[#1]{\the\metatxtcounter}{#2}%
- \filtersometxt}
-
-\long\def\filtersometxt#1\sometxt
- {\doifnextoptionalelse\redofiltersometxt\dodofiltersometxt}
-
-% cleaner in mkiv
-%
-% \filtersometxt abc\sometxt{def};hij\sometxt{klm};\sometxt{}\empty\relax
-
-\long\def\flushTeXtexts#1%
- {\metatxtcounter\zerocount
- \dostartTeXtexts
- \the\collectedmptexts
- \filtersometxt#1\sometxt{}\empty\relax
- \dostopTeXtexts
- \ifconditional\TeXtextdone
- \immediate\write\MPwrite{loadtxts ; txtnext := 0 ;}%
- \global\collectedmptexts\emptytoks
- \fi
- \metatxtcounter\zerocount}
-
-% \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}\defconvertedcommand\MPascii\ascii
- \the\MPTEXgraphicchecks\relax % \relax is end condition!
- \fi
- \flushMPTEXgraphic% % verbatimtex etc
- \flushTeXtexts{#1}% added
- \writeMPgraphic{#1}} % potential optimization: pass \ascii
-
-\protect \endinput
-
-% torture test (will move)
-
-\startMPpage
- numeric a_b_c ;
- picture p ; pickup pencircle scaled .1pt ;
- p := \sometxt{Just a \color[blue]{simple} example text.} ;
- p := image(draw p; draw boundingbox p withcolor red; ) ;
- p := p rotatedaround(center p, 360*(5/100)) ;
- draw p ; draw boundingbox p withcolor blue ;
- currentpicture := currentpicture scaled 20 ;
- draw boundingbox currentpicture withcolor .5white ;
- setbounds currentpicture to boundingbox currentpicture enlarged 10pt ;
-\stopMPpage
-
-\startMPpage
- picture p ;
- p := \sometxt{\framed[width=fit,align=middle]{\input tufte\relax}} ;
- draw p rotatedaround(center p, 30) ;
-\stopMPpage
-
-\startMPpage
- picture p ;
- p := \sometxt{\framed[width=fit,align=middle]{\input tufte\relax}} ;
- draw p slanted .5 ;
-\stopMPpage
-
-\dorecurse{10} {
- \startTeXtexts
- \TeXtext{\recurselevel}{\ruledhbox{I must be {\green crazy} to implement this}}
- \stopTeXtexts
- \startMPpage
- picture p ; pickup pencircle scaled .1pt ;
- numeric i ; i := \recurselevel ;
- p := sometxt(i) ;
- p := p rotatedaround(center p, 360*(i*5/100)) ;
- draw p ; draw boundingbox p withcolor blue ;
- currentpicture := currentpicture scaled 20 ;
- draw boundingbox currentpicture withcolor .5white ;
- \stopMPpage
-}
-
-\startTeXtexts
- \dorecurse{100}{\TeXtext{\recurselevel}{\ruledhbox{\strut interesting \recurselevel}}}
-\stopTeXtexts
-
-\startMPpage
- picture p ; pickup pencircle scaled .1pt ;
- for i = 1 upto 100:
- p := sometxt(i) ;
- p := p rotatedaround(center p, 360*(i*5/100)) ;
- draw p ; draw boundingbox p withcolor blue ;
- endfor ;
- currentpicture := currentpicture scaled 20 ;
- draw boundingbox currentpicture withcolor .5white ;
-\stopMPpage
-
-\startTeXtexts
- \dorecurse{100}{\TeXtext{\recurselevel}{\ruledhbox{\strut interesting \recurselevel}}}
-\stopTeXtexts
-
-\startMPpage
- picture p ; pickup pencircle scaled .1pt ;
- for i = 1 step 5 until 100 :
- p := sometxt(i) ;
- p := p rotatedaround(center p, 360*(i/100)) ;
- draw p ; draw boundingbox p withcolor blue ;
- endfor ;
- currentpicture := currentpicture scaled 20 ;
- draw boundingbox currentpicture withcolor .5white ;
-\stopMPpage
-
-\startTeXtexts
- \dorecurse{20}{\TeXtext{\recurselevel}{\externalfigure[t:/sources/cow.pdf][width=1cm]}}
-\stopTeXtexts
-
-\startMPpage
- picture p ; pickup pencircle scaled .1pt ;
- for i = 1 upto 20 :
- p := sometxt(i) ;
- p := p shifted (2.5cm,0) rotated (360*(i/20)) ;
- draw p ; draw boundingbox p withcolor blue ;
- endfor ;
- currentpicture := currentpicture scaled 10 ;
- draw boundingbox currentpicture withcolor .5white ;
-\stopMPpage
-
-\startTeXtexts
- \dorecurse{200}{\TeXtext{\recurselevel}{\ruledhbox{\strut I must be {\green crazy} \recurselevel}}}
-\stopTeXtexts
-
-\startMPpage
- picture p ; pickup pencircle scaled .1pt ;
- numeric i ; i := 100 ;
- p := sometxt(i) ;
- p := p rotatedaround(center p, 360*(i*36/100)) ;
- draw p ; draw boundingbox p withcolor blue ;
- currentpicture := currentpicture scaled 20 ;
- draw boundingbox currentpicture withcolor .5white ;
-\stopMPpage
-
-\dorecurse{10}{
- \startTeXtexts
- \dorecurse{200}{\TeXtext{\recurselevel}{\ruledhbox{\strut I must be {\green crazy} \recurselevel}}}
- \stopTeXtexts
- \startMPpage
- picture p ; pickup pencircle scaled .1pt ;
- j := 10*\recurselevel-9;
- k := 10*\recurselevel;
- for i = j upto k:
- p := sometxt(i) ;
- p := p rotatedaround(center p, 360*(i/100)) ;
- draw p ; draw boundingbox p withcolor blue ;
- endfor ;
- currentpicture := currentpicture scaled 20 ;
- draw boundingbox currentpicture withcolor red ;
- \stopMPpage
-}
diff --git a/Master/texmf-dist/tex/context/base/mkii/meta-txt.mkii b/Master/texmf-dist/tex/context/base/mkii/meta-txt.mkii
deleted file mode 100644
index dc8bb7ca83b..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/meta-txt.mkii
+++ /dev/null
@@ -1,304 +0,0 @@
-%D \module
-%D [ file=meta-txt,
-%D version=2000.07.06,
-%D title=\METAPOST\ Graphics,
-%D subtitle=Text Tricks,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-%D In this library some handy text manipulations are
-%D defined. Some can and will be improved as soon as the
-%D \TEX||\METAPOST\ interface is stable. Some of the
-%D solutions may look weird, which is entirely my fault,
-%D since I implemented them in the process of getting grip
-%D on this kind of manipulations. Undoubtly better
-%D \METAPOST\ code is possible, but my way of learning
-%D this kind of trickery happens to be by \quote {trial
-%D and error} and \quote {look and feel} (as well as
-%D identifying tricks in Hobby's code).
-
-% textext ipv btex ... etex
-
-% we need a proper prefix here
-
-\unprotect
-
-\startMPextensions
- if unknown context_text: input mp-text; fi;
-\stopMPextensions
-
-%%%%%%%
-
-% \def\newchar#1{\chardef#1=0 }
-
-\ifdefined\MPtoks \else \newtoks\MPtoks \fi
-\ifdefined\MPbox \else \newbox \MPbox \fi
-
-\ifdefined\parwidth \else \newdimen\parwidth \fi
-\ifdefined\parheight \else \newdimen\parheight \fi
-\ifdefined\parvoffset \else \newdimen\parvoffset \fi
-\ifdefined\parhoffset \else \newdimen\parhoffset \fi
-\ifdefined\parlines \else \newcount\parlines \fi
-\ifdefined\partoks \else \newtoks \partoks \fi
-\ifdefined\shapetextbox \else \newbox \shapetextbox \fi
- \newif \ifparseries
-\ifdefined\parfirst \else \chardef \parfirst=0 \fi
-
-\def\startshapetext[#1]%
- {\global\newcounter\currentshapetext
- \global\setbox\shapetextbox\vbox\bgroup
- \expanded{\switchtobodyfont[\@@shbodyfont]}%
- \dontcomplain
- \hsize\parwidth
- \setuptolerance[\v!verytolerant,\v!stretch]%
- \!!counta\zerocount
- \!!toksa\emptytoks
- \def\docommand##1%
- {\setbox\scratchbox\hbox{\useMPgraphic{##1}}%
- \global\chardef\parfirst\zerocount
- \getMPdata % \readlocfile{\MPdatafile}{}{}%
- \setshapecharacteristics
- \advance\!!counta by \parlines
- \expandafter\appendtoks\the\partoks\to\!!toksa}%
- \processcommalist[#1]\docommand
- \global\parseriestrue
- \xdef\totalparlines{\the\!!counta}%
- \global\partoks\!!toksa
- %\ifx\partoks\emptytoks\else % safeguard
- \expanded{\parshape \the\!!counta \the\!!toksa}%
- %\fi
- \setshapecharacteristics % extra dummy
- \ifparseries\def\par{\endgraf\adaptparshape}\fi
- \EveryPar{\begstrut}}
-
-\def\stopshapetext
- {\endstrut
- %\removebottomthings
- \egroup
- \global\newcounter\currentshapetext
- \getshapecharacteristics}
-
-\def\adaptparshape%
- {\def\docommand##1%
- {\ifcase\!!counta
- \expandafter\appendtoks\space##1 \to\!!toksa
- \else
- \advance\!!counta \minusone
- \fi}%
- \!!counta\prevgraf
- \doglobal\decrement(\totalparlines,\!!counta)%
- \multiply\!!counta \plustwo
- \!!toksa\emptytoks
- \expanded{\processseparatedlist[\the\partoks][\space]}\docommand
- \global\partoks\!!toksa
- %\ifx\partoks\emptytoks\else % safeguard
- \expanded{\parshape\totalparlines\the\partoks}%
- }%\fi}
-
-\def\getshapecharacteristics%
- {\doglobal\increment\currentshapetext
- \doifdefinedelse{parlines:\currentshapetext}
- {\global\parlines \getvalue{parlines:\currentshapetext}%
- \global\chardef\parfirst \getvalue{parfirst:\currentshapetext}%
- \global\parvoffset \getvalue{parvoffset:\currentshapetext}%
- \global\parhoffset \getvalue{parhoffset:\currentshapetext}%
- \global\parwidth \getvalue{parwidth:\currentshapetext}%
- \global\parheight \getvalue{parheight:\currentshapetext}}
- {\global\parlines \plusone
- \global\chardef\parfirst \zerocount
- \global\parvoffset \zeropoint
- \global\parhoffset \zeropoint
- \global\parwidth \hsize
- \global\parheight \vsize}}
-
-\def\setshapecharacteristics%
- {\doglobal\increment\currentshapetext
- \setxvalue{parlines:\currentshapetext }{\the\parlines}%
- \setxvalue{parfirst:\currentshapetext }{\the\parfirst}%
- \setxvalue{parvoffset:\currentshapetext}{\the\parvoffset}%
- \setxvalue{parhoffset:\currentshapetext}{\the\parhoffset}%
- \setxvalue{parwidth:\currentshapetext }{\the\parwidth}%
- \setxvalue{parheight:\currentshapetext }{\the\parheight}}
-
-\def\getshapetext% option: unvbox
- {\vbox\bgroup
- \forgetall
- \setbox\scratchbox\vbox to \parheight
- {\expanded{\switchtobodyfont[\@@shbodyfont]}% evt strutheight en
- \splittopskip\strutheight % lineheight opslaan
- \vskip\parvoffset % scheelt switch en
- \ifcase\parfirst\or\vskip\lineheight\fi % is ook veiliger
- \hskip\parhoffset
- \hbox{\vsplit\shapetextbox to \parlines\lineheight}}%
- \wd\scratchbox\parwidth
- \ht\scratchbox\parheight
- \dp\scratchbox\zeropoint
- \box\scratchbox
- \getshapecharacteristics
- \egroup}
-
-\def\setupshapetexts%
- {\dodoubleempty\getparameters[\??sh]}
-
-\setupshapetexts%
- [\c!bodyfont=]
-
-%%%%%%% rotfont nog definieren
-
-\doifundefined{RotFont}{\definefont[RotFont][RegularBold]}
-
-\def\processfollowingtoken#1% strut toegevoegd
- {\appendtoks#1\to\MPtoks
- \setbox\MPbox=\hbox{\RotFont\setstrut\strut\the\MPtoks}%
- \startMPdrawing
- n := n + 1 ; len[n] := \the\wd\MPbox ;
- \stopMPdrawing
- \startMPdrawing[-]
- % pic[n] := textext{\RotFont\setstrut\strut#1} ; % btex \RotFont\setstrut\strut#1 etex ;
- pic[n] := btex \RotFont\setstrut\strut#1 etex ;
- pic[n] := pic[n] shifted - llcorner pic[n] ;
- \stopMPdrawing}
-
-\startuseMPgraphic{followtokens}
- % we default to nothing
-\stopuseMPgraphic
-
-\def\followtokens#1%
- {\vbox\bgroup
- \forgetall
- \dontcomplain
- \startMPenvironment
- \doifundefined{RotFont}{\definefont[RotFont][RegularBold]}
- \stopMPenvironment
- \MPtoks\emptytoks
- \resetMPdrawing
- \startMPdrawing
- \includeMPgraphic{followtokens} ;
- picture pic[] ; numeric len[], n ; n := 0 ;
- \stopMPdrawing
- \handletokens#1\with\processfollowingtoken
- \startMPdrawing
- if unknown RotPath : path RotPath ; RotPath := origin ; fi ;
- if unknown RotColor : color RotColor ; RotColor := black ; fi ;
- if unknown TraceRot : boolean TraceRot ; TraceRot := false ; fi ;
- if unknown ExtraRot : numeric ExtraRot ; ExtraRot := 0 ; fi ;
- numeric al, at, pl, wid, pos ; pair ap, ad ;
- al := arclength RotPath ;
- if al=0 :
- al := len[n] + ExtraRot ;
- RotPath := origin -- (al,0) ;
- fi ;
- if al<len[n]:
- RotPath := RotPath scaled ((len[n]+ExtraRot)/al) ;
- al := arclength RotPath ;
- fi ;
- pl := (al-len[n])/(if n>1 : (n-1) else : 1 fi) ;
- if TraceRot :
- draw RotPath withpen pencircle scaled 1pt withcolor blue ;
- fi ;
- for i=1 upto n :
- wid := abs(xpart urcorner pic[i] - xpart llcorner pic[i]) ;
- pos := len[i]-wid/2 + (i-1)*pl ;
- at := arctime pos of RotPath ;
- ap := point at of RotPath ;
- ad := direction at of RotPath ;
- draw pic[i] shifted (-wid/2,0) rotated(angle(ad)) shifted ap
- withcolor RotColor ;
- if TraceRot :
- draw boundingbox
- pic[i] shifted (-wid/2,0) rotated(angle(ad)) shifted ap
- withpen pencircle scaled .25pt withcolor red ;
- draw ap
- withpen pencircle scaled .50pt withcolor green ;
- fi ;
- endfor ;
- \stopMPdrawing
- \MPdrawingdonetrue
- \getMPdrawing
- \resetMPdrawing
- \egroup}
-
-% \followtokens
-% {This is just a dummy text, kerned by T{\kern
-% -.1667em\lower .5ex\hbox {E}}{\kern -.125emX} and typeset
-% in a circle using {\setMFPfont M}{\setMFPfont
-% E}{\setMFPfont T}{\setMFPfont A}{\setMFPfont
-% P}{\setMFPfont O}{\setMFPfont S}{\setMFPfont T}.\quad}
-
-\startuseMPgraphic{fuzzycount}
- begingroup
- save height, span, drift, d, cp ;
- height := 3/ 5 * \baselinedistance ;
- span := 1/ 3 * height ;
- drift := 1/10 * height ;
- pickup pencircle scaled (1/12 * height) ;
- def d = (uniformdeviate drift) enddef ;
- for i := 1 upto \MPvar{n} :
- draw
- if (i mod 5)=0 : ((-d-4.5span,d)--(+d-0.5span,height-d))
- else : ((-d,+d)--(+d,height-d)) fi
- shifted (span*i,d-drift) ;
- endfor;
- picture cp ; cp := currentpicture ; % for readability
- setbounds currentpicture to
- (llcorner cp shifted (0,-ypart llcorner cp) --
- lrcorner cp shifted (0,-ypart lrcorner cp) --
- urcorner cp -- ulcorner cp -- cycle) ;
- endgroup ;
-\stopuseMPgraphic
-
-\setupMPvariables
- [fuzzycount]
- [n=10]
-
-\def\fuzzycount#1%
- {{\tx\useMPgraphic{fuzzycount}{n=#1}}}
-
-\defineconversion[fuzzy][\fuzzycount]
-
-%%%%%%%
-
-\setupMPvariables
- [EnglishRule]
- [height=1ex,
- width=\the\localhsize, % without \the, problems in non e-tex
- color=darkgray]
-
-\defineblank
- [EnglishRule]
- [medium]
-
-\startuniqueMPgraphic{EnglishRule}{height,width,color}
- height = \MPvar{height} ;
- x1 = 0 ; x3 = \MPvar{width} ; x2 = x4 = .5x3 ;
- y1 = y3 = 0 ; y2 = -y4 = height/2 ;
- fill z1..z2..z3 & z3..z4..z1 & cycle withcolor \MPvar{color} ;
-\stopuniqueMPgraphic
-
-\def\EnglishRule%
- {\startlinecorrection[EnglishRule]
- \setlocalhsize \noindent \reuseMPgraphic{EnglishRule}
- \stoplinecorrection}
-
-%D The following macro returns a tight bound character
-%D sequence.
-%D
-%D \useMPlibrary[txt]
-%D
-%D \startlinecorrection
-%D \TightText{\ss\bf 123}{0cm}{3cm}{red}
-%D \stoplinecorrection
-
-\def\TightText#1#2#3#4%
- {\hbox % \ruledhbox
- {\startMPcode
- picture p ; p := image (graphictext "#1" withfillcolor red) ;
- draw p xsized #2 ysized #3 withcolor \MPcolor{#4} ;
- \stopMPcode}}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/meta-xml.mkii b/Master/texmf-dist/tex/context/base/mkii/meta-xml.mkii
deleted file mode 100644
index 71708a0f9a5..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/meta-xml.mkii
+++ /dev/null
@@ -1,29 +0,0 @@
-%D \module
-%D [ file=meta-xml,
-%D version=2002.11.27,
-%D title=\METAPOST\ Graphics,
-%D subtitle=XML Hacks,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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}{MetaPost Graphics / XML Hacks}
-
-%D When we are dealing with XML, we need to make sure that
-%D \METAPOST\ knows about it. The next macro expands its
-%D argument (think of widget XFDF) into \type {\getXMLentity}
-%D calls.
-
-\unprotect
-
-\def\setMPtextXML#1#2%
- {\bgroup
- \enableXML
- \expanded{\defconvertedcommand\noexpand\ascii{#2}}%
- \expanded{\egroup\noexpand\dodoglobal\noexpand\setvalue{\@@MPT#1}{\ascii}}}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/mult-aux.mkii b/Master/texmf-dist/tex/context/base/mkii/mult-aux.mkii
deleted file mode 100644
index 3869a95db2e..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/mult-aux.mkii
+++ /dev/null
@@ -1,152 +0,0 @@
-%D \module
-%D [ file=mult-aux,
-%D version=2010.08.2,
-%D title=\CONTEXT\ Multilingual Macros,
-%D subtitle=helpers,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 a subset of the \MKIV\ variant which has more comments). There
-%D is no support for attributes (fonts and color). This code is mostly
-%D meant for usage in modules that are backported from \MKIV.
-
-\writestatus{loading}{ConTeXt Multilingual Macros / Helpers}
-
-\unprotect
-
-%D \starttyping
-%D \unprotect
-%D \def\????aa{@@@@aa}
-%D
-%D \installparameterhandler \????aa {whatever}
-%D \installsetuphandler \????aa {whatever}
-%D \installdefinehandler \????aa {whatever} \????aa % #3 == defaultroot
-%D
-%D % \installcommandhandler \????aa {whatever} \????aa
-%D \protect
-%D
-%D % \whateverparameter \c!test
-%D % \whateverparameterhash \c!test
-%D % \namedwhateverparameter \mycurrentwhatever \c!test
-%D % \everydefinewhatever (sets \currentwhatever)
-%D % \everypresetwhatever (can be used to reset parameters as we can redefine)
-%D % \everysetupwhatever (sets \currentwhatever)
-%D
-%D \starttext
-%D \definewhatever[first] \definewhatever[second][first]
-%D test: \def\currentwhatever{first} \whateverparameter{method} \par
-%D \setupwhatever [method=unset] test: \def\currentwhatever{first} \whateverparameter{method} \par
-%D \setupwhatever[first] [method=first] test: \def\currentwhatever{first} \whateverparameter{method} \par
-%D test: \def\currentwhatever{second} \whateverparameter{method} \par
-%D \setupwhatever[second][method=second] test: \def\currentwhatever{second} \whateverparameter{method} \par
-%D \stoptext
-%D \stoptyping
-
-\unexpanded\def\doinstallparameterhandler#1#2#3#4#5#6#7#8#9%
- {\def#3##1{\csname#4{#1#2}{##1}\endcsname}%
- \def#4##1##2{\ifcsname##1##2\endcsname##1##2\else\expandafter#5\csname##1\s!parent\endcsname{##2}\fi}%
- \def#5##1##2{\ifx##1\relax\s!empty\else#4{##1}{##2}\fi}%
- \def#6##1##2{\csname#4{#1##1}{##2}\endcsname}%
- \def#7##1{\detokenize\expandafter\expandafter\expandafter{\csname#1##1\endcsname}}% always root
- \def#8{\dosetvalue{#1}}% ##1 {##2} (braces are mandate)
- \def#9{\doletvalue{#1}}}% ##1 ##2
-
-\unexpanded\def\installparameterhandler#1#2%
- {%\message{\detokenize{#1}/\detokenize{#2}}%
- \normalexpanded
- {\doinstallparameterhandler
- {\noexpand#1}% \??aa
- \expandafter\noexpand\csname current#2\endcsname
- \expandafter\noexpand\csname #2parameter\endcsname
- \expandafter\noexpand\csname do#2parameter\endcsname
- \expandafter\noexpand\csname do#2parentparameter\endcsname
- \expandafter\noexpand\csname named#2parameter\endcsname
- \expandafter\noexpand\csname detokenized#2parameter\endcsname
- \expandafter\noexpand\csname doset#2parameter\endcsname
- \expandafter\noexpand\csname dolet#2parameter\endcsname}}
-
-\unexpanded\def\doinstallparameterhashhandler#1#2#3#4#5%
- {\def#3##1{#4{#1#2}{##1}}%
- \def#4##1##2{\ifcsname##1##2\endcsname##1\else\expandafter#5\csname##1\s!parent\endcsname{##2}\fi}%
- \def#5##1##2{\ifx##1\relax\else#4{##1}{##2}\fi}}
-
-\unexpanded\def\installparameterhashhandler#1#2%
- {\normalexpanded
- {\doinstallparameterhashhandler
- {\noexpand#1}% \??aa
- \expandafter\noexpand\csname current#2\endcsname
- \expandafter\noexpand\csname #2parameterhash\endcsname
- \expandafter\noexpand\csname do#2parameterhash\endcsname
- \expandafter\noexpand\csname do#2parentparameterhash\endcsname}}
-
-
-\unexpanded\def\doinstalldefinehandler#1#2#3#4#5#6#7%
- {\unexpanded\def#2{\dotripleempty#5}%
- \newtoks#6%
- \newtoks#7%
- \def#5[##1][##2][##3]% [child][parent][settings]
- {\edef#4{##1}% % [child] [settings]
- \the#6% predefine % [child][parent]
- \ifthirdargument % [child]
- \getparameters[#1#4][\s!parent=#1##2,##3]%
- \else\ifsecondargument
- \doifassignmentelse{##2}
- {\getparameters[#1#4][\s!parent=#3,##2]}
- {\getparameters[#1#4][\s!parent=#1##2]}%
- \else
- \getparameters[#1#4][\s!parent=#3]%
- \fi\fi
- \the#7}}
-
-\unexpanded\def\installdefinehandler#1#2#3%
- {\normalexpanded
- {\doinstalldefinehandler
- {\noexpand#1}% \??aa
- \expandafter\noexpand\csname define#2\endcsname
- {\noexpand#3}% root
- \expandafter\noexpand\csname current#2\endcsname
- \expandafter\noexpand\csname d@define#2\endcsname
- \expandafter\noexpand\csname everypreset#2\endcsname
- \expandafter\noexpand\csname everydefine#2\endcsname}}
-
-\unexpanded\def\doinstallsetuphandler#1#2#3#4#5%
- {\unexpanded\def#2{\dodoubleempty#4}%
- \newtoks#5%
- \def#4[##1][##2]% maybe helper
- {\ifsecondargument
- \def\docommand####1% we will have a simple one as well
- {\edef#3{####1}%
- \getparameters[#1#3][##2]%
- \the#5}%
- \processcommalist[##1]\docommand
- \else
- \let#3\empty
- \getparameters[#1][##1]%
- \the#5%
- \fi}}
-
-\unexpanded\def\installsetuphandler#1#2%
- {\normalexpanded
- {\doinstallsetuphandler
- {\noexpand#1}% \??aa
- \expandafter\noexpand\csname setup#2\endcsname
- \expandafter\noexpand\csname current#2\endcsname
- \expandafter\noexpand\csname d@setup#2\endcsname
- \expandafter\noexpand\csname everysetup#2\endcsname}}
-
-\unexpanded\def\installcommandhandler#1#2#3% \??self name \??parent (can be \??self)
- {\installparameterhandler {#1}{#2}%
- \installparameterhashhandler{#1}{#2}%
- \installdefinehandler {#1}{#2}{#3}%
- \installsetuphandler {#1}{#2}}
-
-\unexpanded\def\installnamespace#1%
- {\setvalue{????#1}{@@@@#1}}
-
-\protect
-
diff --git a/Master/texmf-dist/tex/context/base/mkii/mult-chk.mkii b/Master/texmf-dist/tex/context/base/mkii/mult-chk.mkii
deleted file mode 100644
index cde00fd44c4..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/mult-chk.mkii
+++ /dev/null
@@ -1,29 +0,0 @@
-%D \module
-%D [ file=mult-chk,
-%D version=2009.04.13,
-%D title=\CONTEXT\ Multilingual Macros,
-%D subtitle=Checking,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Multilingual Macros / Checking}
-
-%D No checking in \MKII.
-
-\def\gobbleparameters{\doquadrupleempty\dogobbleparameters} % todo: 1,2,3,4 case
-\def\dogobbleparameters[#1][#2][#3][#4]{}
-
-\def\setvalidparameterkeys{\gobbleparameters} % forward reference, so no \let
-\def\addvalidparameterkeys{\gobbleparameters} % forward reference, so no \let
-
-\let\enablecheckparameters \relax
-\let\disablecheckparameters\relax
-
-\def\getcheckedparameters[#1]{\getparameters} % just ignore the checking
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/mult-com.mkii b/Master/texmf-dist/tex/context/base/mkii/mult-com.mkii
deleted file mode 100644
index 600819b7ebc..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/mult-com.mkii
+++ /dev/null
@@ -1,31 +0,0 @@
-%D \module
-%D [ file=mult-com,
-%D version=1996.06.01,
-%D title=\CONTEXT\ Multilingual Macros,
-%D subtitle=Commands,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See licen-en.pdf for
-%C details.
-
-%D This file has been replaced by \type {mult-def.lua} from which we
-%D generate separate interface definition files.
-
-% obsolete:
-%
-% \startcommands dutch english
-% german czech
-% italian romanian
-% french
-%
-% language: taal language
-% sprache jazyk
-% lingua limba
-% langue
-%
-% \stopcommands
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/mult-con.mkii b/Master/texmf-dist/tex/context/base/mkii/mult-con.mkii
deleted file mode 100644
index 7d0a47bd0a6..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/mult-con.mkii
+++ /dev/null
@@ -1,53 +0,0 @@
-%D \module
-%D [ file=mult-con,
-%D version=2000.09.12,
-%D title=\CONTEXT\ Multilingual Macros,
-%D subtitle=Constants,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 file has been replaced by \type {mult-def.lua} from which we
-%D generate separate interface definition files.
-
-% obsolete:
-%
-%
-% \startvariables dutch english
-% german czech
-% italian romanian
-% french
-%
-% one: een one
-% eins jedna
-% uno unu
-% un
-% \stopvariables
-%
-% \startconstants dutch english
-% german czech
-% italian romanian
-% french
-%
-% sorttype: sortering sorttype
-% sorttype sorttype
-% sorttype sorttype
-% sorttype
-% \stopconstants
-%
-% \startelements dutch english
-% german czech
-% italian romanian
-% french
-%
-% begin: beginvan begin
-% anfang zacatek
-% inizio inceput
-% debut
-% \stopelements
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/mult-cs.mkii b/Master/texmf-dist/tex/context/base/mkii/mult-cs.mkii
deleted file mode 100644
index 0f2336d65ea..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/mult-cs.mkii
+++ /dev/null
@@ -1,2224 +0,0 @@
-% this file is auto-generated, don't edit this file
-%
-% definitions for interface variables for language cs
-%
-\setinterfacevariable{Addition}{Pridavek}
-\setinterfacevariable{Alphabetic}{Alphabetic}
-\setinterfacevariable{Balloon}{Bublinka}
-\setinterfacevariable{Cap}{Kap}
-\setinterfacevariable{Capital}{Kapitalky}
-\setinterfacevariable{Character}{Pismeno}
-\setinterfacevariable{Characters}{Pismena}
-\setinterfacevariable{CloseDocument}{ZavritDokument}
-\setinterfacevariable{ExitViewer}{UkoncitProhlizec}
-\setinterfacevariable{FirstPage}{PrvniStrana}
-\setinterfacevariable{FitHeight}{FitHeight}
-\setinterfacevariable{FitWidth}{FitWidth}
-\setinterfacevariable{GotoPage}{JdiNaStranku}
-\setinterfacevariable{Greek}{Recky}
-\setinterfacevariable{Help}{Napoveda}
-\setinterfacevariable{HideField}{SkryjPole}
-\setinterfacevariable{HideLayer}{HideLayer}
-\setinterfacevariable{Key}{Klavesa}
-\setinterfacevariable{LastPage}{PosledniStrana}
-\setinterfacevariable{LoadForm}{NacistFormular}
-\setinterfacevariable{MONTH}{MESIC}
-\setinterfacevariable{New}{Novy}
-\setinterfacevariable{NextJump}{NasledujiciSkok}
-\setinterfacevariable{NextPage}{DalsiStrana}
-\setinterfacevariable{Numbers}{Cisla}
-\setinterfacevariable{OpenNamedDocument}{OpenNamedDocument}
-\setinterfacevariable{Ordinal}{Ordinal}
-\setinterfacevariable{Paragraph}{Odstavec}
-\setinterfacevariable{PauseMovie}{PozastavitFilm}
-\setinterfacevariable{PauseRendering}{PauseRendering}
-\setinterfacevariable{PauseSound}{PozastavitZvuk}
-\setinterfacevariable{PreviousJump}{PredchoziSkok}
-\setinterfacevariable{PreviousPage}{PredchoziStrana}
-\setinterfacevariable{PrintDocument}{VytisknoutDokument}
-\setinterfacevariable{Query}{Query}
-\setinterfacevariable{QueryAgain}{QueryAgain}
-\setinterfacevariable{ResetForm}{ResetFormulare}
-\setinterfacevariable{ResumeMovie}{PokracovatFilm}
-\setinterfacevariable{ResumeRendering}{ResumeRendering}
-\setinterfacevariable{ResumeSound}{PokracovatZvuk}
-\setinterfacevariable{Romannumerals}{Rimskecislice}
-\setinterfacevariable{SaveDocument}{UlozitDokument}
-\setinterfacevariable{SaveForm}{UlozitFormular}
-\setinterfacevariable{SaveNamedDocument}{SaveNamedDocument}
-\setinterfacevariable{SearchAgain}{HledatZnovu}
-\setinterfacevariable{SearchDocument}{ProhledatDokument}
-\setinterfacevariable{ShowBookmarks}{UkazZalozky}
-\setinterfacevariable{ShowField}{UkazPole}
-\setinterfacevariable{ShowThumbs}{UkazNahledy}
-\setinterfacevariable{StartMovie}{SpustitFilm}
-\setinterfacevariable{StartRendering}{StartRendering}
-\setinterfacevariable{StartSound}{StartZvuk}
-\setinterfacevariable{StopMovie}{ZastavitFilm}
-\setinterfacevariable{StopRendering}{StopRendering}
-\setinterfacevariable{StopSound}{StopZvuk}
-\setinterfacevariable{SubmitForm}{PoslatFormular}
-\setinterfacevariable{ToggleLayer}{ToggleLayer}
-\setinterfacevariable{ToggleViewer}{ZmenitProhlizec}
-\setinterfacevariable{URL}{URL}
-\setinterfacevariable{VideLayer}{VideLayer}
-\setinterfacevariable{ViewerHelp}{NapovedaProhlizece}
-\setinterfacevariable{WEEKDAY}{VSEDNIDEN}
-\setinterfacevariable{WORD}{SLOVO}
-\setinterfacevariable{WORDS}{SLOVA}
-\setinterfacevariable{Word}{Slovo}
-\setinterfacevariable{Words}{Slova}
-\setinterfacevariable{abbreviation}{zkratka}
-\setinterfacevariable{abbreviations}{zkratky}
-\setinterfacevariable{absolute}{absolutni}
-\setinterfacevariable{action}{akce}
-\setinterfacevariable{after}{po}
-\setinterfacevariable{all}{vse}
-\setinterfacevariable{alphabetic}{alphabetic}
-\setinterfacevariable{always}{vzdy}
-\setinterfacevariable{anchor}{anchor}
-\setinterfacevariable{and}{and}
-\setinterfacevariable{answerarea}{answerarea}
-\setinterfacevariable{appendices}{dodatky}
-\setinterfacevariable{appendix}{dodatek}
-\setinterfacevariable{april}{duben}
-\setinterfacevariable{aside}{aside}
-\setinterfacevariable{atleftmargin}{atleftmargin}
-\setinterfacevariable{atmargin}{naokraji}
-\setinterfacevariable{atpage}{nastrance}
-\setinterfacevariable{atrightmargin}{atrightmargin}
-\setinterfacevariable{attachment}{attachment}
-\setinterfacevariable{august}{srpen}
-\setinterfacevariable{author}{autor}
-\setinterfacevariable{auto}{auto}
-\setinterfacevariable{autointro}{autouvod}
-\setinterfacevariable{autopunctuation}{autopunctuation}
-\setinterfacevariable{back}{zpet}
-\setinterfacevariable{background}{pozadi}
-\setinterfacevariable{backmatter}{epilogy}
-\setinterfacevariable{backpart}{epilog}
-\setinterfacevariable{backspace}{zpetnamezera}
-\setinterfacevariable{backward}{zpet}
-\setinterfacevariable{bbl}{bbl}
-\setinterfacevariable{before}{pred}
-\setinterfacevariable{begin}{begin}
-\setinterfacevariable{bib}{bib}
-\setinterfacevariable{big}{velke}
-\setinterfacevariable{bigbodyfont}{bigbodyfont}
-\setinterfacevariable{bigger}{bigger}
-\setinterfacevariable{bigpreference}{vysokapriorita}
-\setinterfacevariable{blank}{prazdny}
-\setinterfacevariable{block}{block}
-\setinterfacevariable{blockquote}{blockquote}
-\setinterfacevariable{bodymatter}{hlavnicasti}
-\setinterfacevariable{bodypart}{hlavnicast}
-\setinterfacevariable{bold}{tucne}
-\setinterfacevariable{bolditalic}{tucnekurzivni}
-\setinterfacevariable{boldslanted}{tucnesklonene}
-\setinterfacevariable{bookmark}{zalozka}
-\setinterfacevariable{both}{obe}
-\setinterfacevariable{bothtext}{bothtext}
-\setinterfacevariable{bottom}{spodek}
-\setinterfacevariable{box}{box}
-\setinterfacevariable{brief}{brief}
-\setinterfacevariable{broad}{siroky}
-\setinterfacevariable{buffer}{buffer}
-\setinterfacevariable{by}{skrz}
-\setinterfacevariable{calligraphic}{kaligraficke}
-\setinterfacevariable{camel}{camel}
-\setinterfacevariable{cap}{kap}
-\setinterfacevariable{capital}{kapitalky}
-\setinterfacevariable{category}{category}
-\setinterfacevariable{cd:character}{cd:character}
-\setinterfacevariable{cd:font}{cd:font}
-\setinterfacevariable{center}{center}
-\setinterfacevariable{centerlast}{centerlast}
-\setinterfacevariable{chapter}{kapitola}
-\setinterfacevariable{character}{pismeno}
-\setinterfacevariable{characters}{pismena}
-\setinterfacevariable{chemical}{chemical}
-\setinterfacevariable{chemicals}{chemicals}
-\setinterfacevariable{chemistry}{chemistry}
-\setinterfacevariable{cite}{cite}
-\setinterfacevariable{closed}{closed}
-\setinterfacevariable{color}{barevne}
-\setinterfacevariable{column}{column}
-\setinterfacevariable{columns}{sloupce}
-\setinterfacevariable{combination}{combination}
-\setinterfacevariable{command}{prikaz}
-\setinterfacevariable{commands}{prikazy}
-\setinterfacevariable{comment}{komentar}
-\setinterfacevariable{component}{komponenta}
-\setinterfacevariable{compressseparator}{compressseparator}
-\setinterfacevariable{compressstopper}{compressstopper}
-\setinterfacevariable{concept}{koncept}
-\setinterfacevariable{construction}{construction}
-\setinterfacevariable{content}{obsah}
-\setinterfacevariable{contents}{obsah}
-\setinterfacevariable{continue}{pokracovat}
-\setinterfacevariable{continued}{continued}
-\setinterfacevariable{controls}{controls}
-\setinterfacevariable{conversion}{konverze}
-\setinterfacevariable{current}{aktualni}
-\setinterfacevariable{cutspace}{cutspace}
-\setinterfacevariable{dataset}{dataset}
-\setinterfacevariable{date}{datum}
-\setinterfacevariable{day}{den}
-\setinterfacevariable{december}{prosinec}
-\setinterfacevariable{default}{implicitni}
-\setinterfacevariable{depth}{podlehloubky}
-\setinterfacevariable{description}{popis}
-\setinterfacevariable{disable}{zablokovat}
-\setinterfacevariable{display}{obrazovka}
-\setinterfacevariable{dot}{tecka}
-\setinterfacevariable{doublesided}{dvoustranny}
-\setinterfacevariable{down}{down}
-\setinterfacevariable{each}{kazdy}
-\setinterfacevariable{edge}{hrana}
-\setinterfacevariable{effective}{effective}
-\setinterfacevariable{eight}{eight}
-\setinterfacevariable{embed}{embed}
-\setinterfacevariable{empty}{prazdne}
-\setinterfacevariable{enable}{enable}
-\setinterfacevariable{end}{end}
-\setinterfacevariable{endnote}{endnote}
-\setinterfacevariable{enumeration}{vycet}
-\setinterfacevariable{environment}{prostredi}
-\setinterfacevariable{even}{sude}
-\setinterfacevariable{export}{export}
-\setinterfacevariable{external}{externi}
-\setinterfacevariable{extremestretch}{extremestretch}
-\setinterfacevariable{fact}{fakt}
-\setinterfacevariable{fallback}{fallback}
-\setinterfacevariable{february}{unor}
-\setinterfacevariable{field}{field}
-\setinterfacevariable{figure}{obrazek}
-\setinterfacevariable{figures}{obrazky}
-\setinterfacevariable{file}{soubor}
-\setinterfacevariable{final}{finalni}
-\setinterfacevariable{first}{prvni}
-\setinterfacevariable{firstcolumn}{firstcolumn}
-\setinterfacevariable{firstpage}{prvnistranka}
-\setinterfacevariable{firstsubpage}{prvnipodstranka}
-\setinterfacevariable{fit}{prizpusobive}
-\setinterfacevariable{five}{pet}
-\setinterfacevariable{fix}{fixuj}
-\setinterfacevariable{fixed}{fixne}
-\setinterfacevariable{flexible}{prizpusobive}
-\setinterfacevariable{float}{plvouciobjekt}
-\setinterfacevariable{flushinner}{flushinner}
-\setinterfacevariable{flushleft}{flushleft}
-\setinterfacevariable{flushouter}{flushouter}
-\setinterfacevariable{flushright}{flushright}
-\setinterfacevariable{followingpage}{followingpage}
-\setinterfacevariable{font}{font}
-\setinterfacevariable{footer}{upati}
-\setinterfacevariable{footnote}{poznamkapodcarou}
-\setinterfacevariable{force}{sila}
-\setinterfacevariable{foreground}{popredi}
-\setinterfacevariable{formula}{rovnice}
-\setinterfacevariable{formulas}{rovnice}
-\setinterfacevariable{forward}{vpred}
-\setinterfacevariable{four}{ctyri}
-\setinterfacevariable{fractions}{fractions}
-\setinterfacevariable{frame}{ramecek}
-\setinterfacevariable{framedtext}{oramovanytext}
-\setinterfacevariable{friday}{patek}
-\setinterfacevariable{frontmatter}{prednicasti}
-\setinterfacevariable{frontpart}{prednicast}
-\setinterfacevariable{fullhz}{fullhz}
-\setinterfacevariable{global}{globalne}
-\setinterfacevariable{graphic}{graf}
-\setinterfacevariable{graphics}{grafy}
-\setinterfacevariable{gray}{seda}
-\setinterfacevariable{greek}{recky}
-\setinterfacevariable{grid}{mrizka}
-\setinterfacevariable{halfline}{pulradku}
-\setinterfacevariable{handwritten}{rukopisne}
-\setinterfacevariable{hang}{zaveseni}
-\setinterfacevariable{hanging}{visici}
-\setinterfacevariable{hangingboth}{hangingboth}
-\setinterfacevariable{head}{hlavicka}
-\setinterfacevariable{header}{zahlavi}
-\setinterfacevariable{headintext}{headintext}
-\setinterfacevariable{height}{vyska}
-\setinterfacevariable{helptext}{textnapovedy}
-\setinterfacevariable{hencefore}{vyse}
-\setinterfacevariable{here}{zde}
-\setinterfacevariable{hereafter}{nize}
-\setinterfacevariable{hidden}{skryte}
-\setinterfacevariable{hiddenbar}{hiddenbar}
-\setinterfacevariable{hiding}{skryt}
-\setinterfacevariable{high}{vysoko}
-\setinterfacevariable{horizontal}{horizontalne}
-\setinterfacevariable{hyphenated}{hyphenated}
-\setinterfacevariable{hz}{hz}
-\setinterfacevariable{inbetween}{mezi}
-\setinterfacevariable{index}{rejstrik}
-\setinterfacevariable{indices}{rejstriky}
-\setinterfacevariable{inherit}{inherit}
-\setinterfacevariable{ininner}{ininner}
-\setinterfacevariable{ininneredge}{ininneredge}
-\setinterfacevariable{ininnermargin}{ininnermargin}
-\setinterfacevariable{inleft}{ivlevo}
-\setinterfacevariable{inleftedge}{nalevo}
-\setinterfacevariable{inleftmargin}{nalevyokraj}
-\setinterfacevariable{inline}{inline}
-\setinterfacevariable{inmargin}{naokraji}
-\setinterfacevariable{inner}{uvnitr}
-\setinterfacevariable{inneredge}{inneredge}
-\setinterfacevariable{innermargin}{innermargin}
-\setinterfacevariable{inother}{inother}
-\setinterfacevariable{inouter}{inouter}
-\setinterfacevariable{inouteredge}{inouteredge}
-\setinterfacevariable{inoutermargin}{inoutermargin}
-\setinterfacevariable{inright}{ivpravo}
-\setinterfacevariable{inrightedge}{napravo}
-\setinterfacevariable{inrightmargin}{napravyokraj}
-\setinterfacevariable{integral}{integral}
-\setinterfacevariable{interaction}{interakce}
-\setinterfacevariable{interactionmenu}{interaktivnimenu}
-\setinterfacevariable{interactive}{interactive}
-\setinterfacevariable{intermezzi}{intermezzi}
-\setinterfacevariable{intermezzo}{intermezzo}
-\setinterfacevariable{intext}{dotextu}
-\setinterfacevariable{intro}{uvod}
-\setinterfacevariable{invertedshort}{invertedshort}
-\setinterfacevariable{italic}{kurziva}
-\setinterfacevariable{italicbold}{kurzivnitucne}
-\setinterfacevariable{item}{polozka}
-\setinterfacevariable{itemize}{vycet}
-\setinterfacevariable{its}{pol}
-\setinterfacevariable{january}{leden}
-\setinterfacevariable{joinedup}{spojeno}
-\setinterfacevariable{july}{cervenec}
-\setinterfacevariable{june}{cerven}
-\setinterfacevariable{keep}{drzet}
-\setinterfacevariable{kerncharacters}{kerncharacters}
-\setinterfacevariable{knockout}{knockout}
-\setinterfacevariable{label}{popisek}
-\setinterfacevariable{landscape}{nasirku}
-\setinterfacevariable{last}{posledni}
-\setinterfacevariable{lastcolumn}{lastcolumn}
-\setinterfacevariable{lastpage}{poslednistrana}
-\setinterfacevariable{lastpagenumber}{lastpagenumber}
-\setinterfacevariable{lastsubpage}{poslaednipodstranka}
-\setinterfacevariable{layer}{layer}
-\setinterfacevariable{left}{vlevo}
-\setinterfacevariable{leftedge}{levahrana}
-\setinterfacevariable{lefthanging}{lefthanging}
-\setinterfacevariable{leftmargin}{levyokraj}
-\setinterfacevariable{leftpage}{levastranka}
-\setinterfacevariable{lefttoright}{lefttoright}
-\setinterfacevariable{legend}{legenda}
-\setinterfacevariable{less}{less}
-\setinterfacevariable{lesshyphenation}{lesshyphenation}
-\setinterfacevariable{letterspacing}{letterspacing}
-\setinterfacevariable{line}{radek}
-\setinterfacevariable{linenote}{linenote}
-\setinterfacevariable{lines}{radky}
-\setinterfacevariable{linked}{linked}
-\setinterfacevariable{list}{seznam}
-\setinterfacevariable{local}{lokalne}
-\setinterfacevariable{localenvironment}{lokalnihoprostredi}
-\setinterfacevariable{logo}{logo}
-\setinterfacevariable{logos}{loga}
-\setinterfacevariable{lohi}{nivy}
-\setinterfacevariable{long}{long}
-\setinterfacevariable{loose}{uvolnene}
-\setinterfacevariable{low}{nizko}
-\setinterfacevariable{ls}{ls}
-\setinterfacevariable{makeup}{zlom}
-\setinterfacevariable{mar}{mar}
-\setinterfacevariable{march}{brezen}
-\setinterfacevariable{margin}{marginalie}
-\setinterfacevariable{marginedge}{textovahrana}
-\setinterfacevariable{margintext}{marginalnitext}
-\setinterfacevariable{margintitle}{titulmarginalie}
-\setinterfacevariable{marking}{znaceni}
-\setinterfacevariable{math}{math}
-\setinterfacevariable{mathalignment}{mathalignment}
-\setinterfacevariable{mathcases}{mathcases}
-\setinterfacevariable{mathematics}{mathematika}
-\setinterfacevariable{mathmatrix}{mathmatrix}
-\setinterfacevariable{max}{max}
-\setinterfacevariable{maxdepth}{maxdepth}
-\setinterfacevariable{maxheight}{maxheight}
-\setinterfacevariable{maxwidth}{maxwidth}
-\setinterfacevariable{may}{kveten}
-\setinterfacevariable{mediaeval}{stredoveky}
-\setinterfacevariable{medium}{stredni}
-\setinterfacevariable{middle}{nastred}
-\setinterfacevariable{min}{min}
-\setinterfacevariable{mindepth}{mindepth}
-\setinterfacevariable{minheight}{minvyska}
-\setinterfacevariable{minwidth}{minsirka}
-\setinterfacevariable{mirrored}{zrcadleno}
-\setinterfacevariable{mixed}{mixed}
-\setinterfacevariable{monday}{pondeli}
-\setinterfacevariable{mono}{mono}
-\setinterfacevariable{monobold}{monotucne}
-\setinterfacevariable{mononormal}{mononormal}
-\setinterfacevariable{month}{mesic}
-\setinterfacevariable{more}{more}
-\setinterfacevariable{morehyphenation}{morehyphenation}
-\setinterfacevariable{name}{jmeno}
-\setinterfacevariable{narrow}{uzky}
-\setinterfacevariable{negative}{negativ}
-\setinterfacevariable{never}{nikdy}
-\setinterfacevariable{new}{novy}
-\setinterfacevariable{next}{dalsi}
-\setinterfacevariable{nextevenpage}{dalsisudastranka}
-\setinterfacevariable{nextoddpage}{dalsilichastranka}
-\setinterfacevariable{nextpage}{dalsistranka}
-\setinterfacevariable{nextsubpage}{dalsipodstranka}
-\setinterfacevariable{nine}{nine}
-\setinterfacevariable{no}{ne}
-\setinterfacevariable{nocheck}{nocheck}
-\setinterfacevariable{nodepth}{nodepth}
-\setinterfacevariable{nofit}{nofit}
-\setinterfacevariable{nogrid}{nogrid}
-\setinterfacevariable{noheight}{noheight}
-\setinterfacevariable{nohz}{nohz}
-\setinterfacevariable{noline}{noline}
-\setinterfacevariable{nomarking}{zadneznaceni}
-\setinterfacevariable{nomenubar}{nomenubar}
-\setinterfacevariable{none}{zadny}
-\setinterfacevariable{nonumber}{nonumber}
-\setinterfacevariable{norepeat}{norepeat}
-\setinterfacevariable{normal}{normalni}
-\setinterfacevariable{normalshort}{normalshort}
-\setinterfacevariable{nospacing}{nospacing}
-\setinterfacevariable{nostopper}{nostopper}
-\setinterfacevariable{not}{ne}
-\setinterfacevariable{notation}{notation}
-\setinterfacevariable{note}{note}
-\setinterfacevariable{nothanging}{nothanging}
-\setinterfacevariable{nothyphenated}{nothyphenated}
-\setinterfacevariable{notjoinedup}{notjoinedup}
-\setinterfacevariable{november}{listopad}
-\setinterfacevariable{nowhere}{nikde}
-\setinterfacevariable{nowhite}{zadnabila}
-\setinterfacevariable{number}{cislo}
-\setinterfacevariable{numbers}{cisla}
-\setinterfacevariable{october}{rijen}
-\setinterfacevariable{odd}{liche}
-\setinterfacevariable{off}{vyp}
-\setinterfacevariable{offset}{offset}
-\setinterfacevariable{old}{old}
-\setinterfacevariable{oldstyle}{oldstyle}
-\setinterfacevariable{on}{zap}
-\setinterfacevariable{one}{jedna}
-\setinterfacevariable{opposite}{naproti}
-\setinterfacevariable{ordinal}{ordinal}
-\setinterfacevariable{outer}{vnejsi}
-\setinterfacevariable{outeredge}{outeredge}
-\setinterfacevariable{outermargin}{outermargin}
-\setinterfacevariable{overbar}{nadtrzeno}
-\setinterfacevariable{overbars}{nadtrzeni}
-\setinterfacevariable{overlay}{prekryv}
-\setinterfacevariable{overprint}{overprint}
-\setinterfacevariable{overstrike}{preskrtnuto}
-\setinterfacevariable{overstrikes}{preskrtnuti}
-\setinterfacevariable{packed}{zhustene}
-\setinterfacevariable{page}{stranka}
-\setinterfacevariable{pagecomment}{komentarstranky}
-\setinterfacevariable{pagenumber}{cislostranky}
-\setinterfacevariable{paper}{papir}
-\setinterfacevariable{paragraph}{odstavec}
-\setinterfacevariable{part}{cast}
-\setinterfacevariable{positive}{positiv}
-\setinterfacevariable{postponing}{odlozit}
-\setinterfacevariable{postscript}{postscript}
-\setinterfacevariable{precedingpage}{precedingpage}
-\setinterfacevariable{preference}{nastaveni}
-\setinterfacevariable{preview}{nahled}
-\setinterfacevariable{previous}{predchozi}
-\setinterfacevariable{previousevenpage}{predchozisudastranka}
-\setinterfacevariable{previousoddpage}{predchozilichastranka}
-\setinterfacevariable{previouspage}{predchozistranka}
-\setinterfacevariable{previoussubpage}{predchozipodstranka}
-\setinterfacevariable{print}{print}
-\setinterfacevariable{printable}{tisknutelne}
-\setinterfacevariable{process}{process}
-\setinterfacevariable{product}{produkt}
-\setinterfacevariable{program}{program}
-\setinterfacevariable{project}{projekt}
-\setinterfacevariable{protected}{chranene}
-\setinterfacevariable{quadruple}{ctyrnasobny}
-\setinterfacevariable{quarterline}{quarterline}
-\setinterfacevariable{quotation}{citace}
-\setinterfacevariable{quote}{citovat}
-\setinterfacevariable{ran}{rozsah}
-\setinterfacevariable{random}{nahodny}
-\setinterfacevariable{readonly}{pouzeprocteni}
-\setinterfacevariable{rectangular}{pravouhly}
-\setinterfacevariable{reference}{odkaz}
-\setinterfacevariable{referral}{znacka}
-\setinterfacevariable{region}{region}
-\setinterfacevariable{register}{rejstrik}
-\setinterfacevariable{regular}{pravidelne}
-\setinterfacevariable{relative}{relativni}
-\setinterfacevariable{repeat}{opakovat}
-\setinterfacevariable{required}{pozadovane}
-\setinterfacevariable{reset}{reset}
-\setinterfacevariable{reverse}{reverse}
-\setinterfacevariable{right}{vpravo}
-\setinterfacevariable{rightedge}{pravahrana}
-\setinterfacevariable{righthanging}{righthanging}
-\setinterfacevariable{rightmargin}{pravyokraj}
-\setinterfacevariable{rightpage}{pravastranka}
-\setinterfacevariable{righttoleft}{righttoleft}
-\setinterfacevariable{roman}{antikva}
-\setinterfacevariable{romannumerals}{rimskecislice}
-\setinterfacevariable{rotate}{otoc}
-\setinterfacevariable{rotated}{otoceno}
-\setinterfacevariable{round}{zaobleny}
-\setinterfacevariable{row}{row}
-\setinterfacevariable{rule}{linka}
-\setinterfacevariable{samepage}{stejnastranka}
-\setinterfacevariable{sans}{sans}
-\setinterfacevariable{sansbold}{sanstucne}
-\setinterfacevariable{sansnormal}{sansnormal}
-\setinterfacevariable{sansserif}{bezserifu}
-\setinterfacevariable{saturday}{sobota}
-\setinterfacevariable{screen}{rastr}
-\setinterfacevariable{section}{sekce}
-\setinterfacevariable{sectionblockenvironment}{sectionblockenvironment}
-\setinterfacevariable{sectionnumber}{cislooddilu}
-\setinterfacevariable{see}{viz}
-\setinterfacevariable{selectfont}{selectfont}
-\setinterfacevariable{separator}{separator}
-\setinterfacevariable{september}{zari}
-\setinterfacevariable{serif}{serif}
-\setinterfacevariable{serifbold}{serifbold}
-\setinterfacevariable{serifnormal}{serifnormal}
-\setinterfacevariable{serried}{semknuto}
-\setinterfacevariable{setups}{setups}
-\setinterfacevariable{seven}{seven}
-\setinterfacevariable{sheet}{sheet}
-\setinterfacevariable{shiftdown}{shiftdown}
-\setinterfacevariable{shiftup}{shiftup}
-\setinterfacevariable{short}{short}
-\setinterfacevariable{simplefonts}{simplefonts}
-\setinterfacevariable{simplelist}{simplelist}
-\setinterfacevariable{singlesided}{jednostranne}
-\setinterfacevariable{six}{six}
-\setinterfacevariable{slanted}{sklonene}
-\setinterfacevariable{slantedbold}{sklonenetucne}
-\setinterfacevariable{small}{male}
-\setinterfacevariable{smallbodyfont}{smallbodyfont}
-\setinterfacevariable{smallbold}{maletucne}
-\setinterfacevariable{smallbolditalic}{maletucnekurzivni}
-\setinterfacevariable{smallboldslanted}{maletucnesklonene}
-\setinterfacevariable{smallcaps}{kapitalky}
-\setinterfacevariable{smaller}{smaller}
-\setinterfacevariable{smallitalic}{malekurzivni}
-\setinterfacevariable{smallitalicbold}{malekurzivnitucne}
-\setinterfacevariable{smallnormal}{malenormalni}
-\setinterfacevariable{smallslanted}{malesklonene}
-\setinterfacevariable{smallslantedbold}{malesklonenetucne}
-\setinterfacevariable{smalltype}{maletype}
-\setinterfacevariable{somewhere}{nekde}
-\setinterfacevariable{sorted}{tridene}
-\setinterfacevariable{sorting}{sorting}
-\setinterfacevariable{space}{mezera}
-\setinterfacevariable{spacing}{mezerovani}
-\setinterfacevariable{speech}{speech}
-\setinterfacevariable{split}{split}
-\setinterfacevariable{spot}{spot}
-\setinterfacevariable{standard}{standardni}
-\setinterfacevariable{start}{start}
-\setinterfacevariable{starter}{starter}
-\setinterfacevariable{sticker}{sticker}
-\setinterfacevariable{stop}{stop}
-\setinterfacevariable{stopper}{predel}
-\setinterfacevariable{stretch}{natahnout}
-\setinterfacevariable{stretched}{stretched}
-\setinterfacevariable{strict}{striktni}
-\setinterfacevariable{strong}{strong}
-\setinterfacevariable{strut}{strut}
-\setinterfacevariable{sub}{pod}
-\setinterfacevariable{subbackward}{podzpet}
-\setinterfacevariable{subformula}{subrovnice}
-\setinterfacevariable{subforward}{podvpred}
-\setinterfacevariable{subject}{tema}
-\setinterfacevariable{subpage}{podstranka}
-\setinterfacevariable{subs}{subs}
-\setinterfacevariable{subsection}{podsekce}
-\setinterfacevariable{subsubject}{podtema}
-\setinterfacevariable{subsubsection}{podpodsekce}
-\setinterfacevariable{subsubsubject}{podpodtema}
-\setinterfacevariable{subsubsubsection}{podpodpodsekce}
-\setinterfacevariable{subsubsubsubject}{podpodpodtema}
-\setinterfacevariable{subsubsubsubsection}{podpodpodpodsekce}
-\setinterfacevariable{subsubsubsubsubject}{podpodpodpodtema}
-\setinterfacevariable{subsubsubsubsubsection}{podpodpodpodpodsekce}
-\setinterfacevariable{subsubsubsubsubsubject}{podpodpodpodpodtema}
-\setinterfacevariable{subsubsubsubsubsubsection}{podpodpodpodpodpodsekce}
-\setinterfacevariable{subsubsubsubsubsubsubject}{podpodpodpodpodpodtema}
-\setinterfacevariable{subsubsubsubsubsubsubsection}{podpodpodpodpodpodpodsekce}
-\setinterfacevariable{subsubsubsubsubsubsubsubject}{podpodpodpodpodpodpodtema}
-\setinterfacevariable{subsubsubsubsubsubsubsubsection}{podpodpodpodpodpodpodpodsekce}
-\setinterfacevariable{subsubsubsubsubsubsubsubsubject}{podpodpodpodpodpodpodpodtema}
-\setinterfacevariable{subsubsubsubsubsubsubsubsubsection}{podpodpodpodpodpodpodpodpodsekce}
-\setinterfacevariable{subsubsubsubsubsubsubsubsubsubject}{podpodpodpodpodpodpodpodpodtema}
-\setinterfacevariable{sunday}{nedele}
-\setinterfacevariable{support}{podpora}
-\setinterfacevariable{sym}{sym}
-\setinterfacevariable{symbol}{symbol}
-\setinterfacevariable{synchronize}{synchronize}
-\setinterfacevariable{synonym}{synonym}
-\setinterfacevariable{system}{system}
-\setinterfacevariable{table}{tabulka}
-\setinterfacevariable{tablehead}{zahlavitabulky}
-\setinterfacevariable{tables}{tabulky}
-\setinterfacevariable{tabletail}{konectabulky}
-\setinterfacevariable{tabulate}{tabelator}
-\setinterfacevariable{tabulatehead}{tabulatehead}
-\setinterfacevariable{tabulatetail}{tabulatetail}
-\setinterfacevariable{tall}{vysoko}
-\setinterfacevariable{teletype}{strojopis}
-\setinterfacevariable{temporary}{docasne}
-\setinterfacevariable{test}{test}
-\setinterfacevariable{text}{text}
-\setinterfacevariable{textnote}{textnote}
-\setinterfacevariable{three}{tri}
-\setinterfacevariable{thursday}{ctvrtek}
-\setinterfacevariable{tight}{tight}
-\setinterfacevariable{title}{titul}
-\setinterfacevariable{toggle}{toggle}
-\setinterfacevariable{tolerant}{tolerantni}
-\setinterfacevariable{top}{vrsek}
-\setinterfacevariable{tuesday}{utery}
-\setinterfacevariable{two}{dve}
-\setinterfacevariable{txt}{txt}
-\setinterfacevariable{type}{opis}
-\setinterfacevariable{typing}{typing}
-\setinterfacevariable{unavailable}{nedostupne}
-\setinterfacevariable{underbar}{podtrzeno}
-\setinterfacevariable{underbars}{podtrzeni}
-\setinterfacevariable{understrike}{understrike}
-\setinterfacevariable{understrikes}{understrikes}
-\setinterfacevariable{unframed}{unframed}
-\setinterfacevariable{unicode}{unicode}
-\setinterfacevariable{unit}{jednotka}
-\setinterfacevariable{units}{jednotky}
-\setinterfacevariable{unknown}{neznamy}
-\setinterfacevariable{unpacked}{rozbalene}
-\setinterfacevariable{up}{up}
-\setinterfacevariable{url}{url}
-\setinterfacevariable{used}{uzito}
-\setinterfacevariable{value}{hodnota}
-\setinterfacevariable{vertical}{vertikalne}
-\setinterfacevariable{very}{velmi}
-\setinterfacevariable{verystrict}{velmistriktni}
-\setinterfacevariable{verytolerant}{velmitolerantni}
-\setinterfacevariable{vfenced}{vfenced}
-\setinterfacevariable{vulgarfraction}{vulgarfraction}
-\setinterfacevariable{weak}{weak}
-\setinterfacevariable{wednesday}{streda}
-\setinterfacevariable{week}{tyden}
-\setinterfacevariable{weekday}{vsedniden}
-\setinterfacevariable{white}{bily}
-\setinterfacevariable{wide}{siroce}
-\setinterfacevariable{width}{sirka}
-\setinterfacevariable{word}{slovo}
-\setinterfacevariable{words}{words}
-\setinterfacevariable{xml}{xml}
-\setinterfacevariable{year}{rok}
-\setinterfacevariable{yes}{ano}
-% definitions for interface constants for language cs
-%
-\setinterfaceconstant{action}{akce}
-\setinterfaceconstant{address}{adresa}
-\setinterfaceconstant{after}{po}
-\setinterfaceconstant{afterhead}{pohlavicce}
-\setinterfaceconstant{afterkey}{klavesapo}
-\setinterfaceconstant{aftersection}{aftersection}
-\setinterfaceconstant{align}{zarovnani}
-\setinterfaceconstant{alignbottom}{alignbottom}
-\setinterfaceconstant{aligncharacter}{aligncharacter}
-\setinterfaceconstant{alignmentcharacter}{alignmentcharacter}
-\setinterfaceconstant{alignmentleftsample}{alignmentleftsample}
-\setinterfaceconstant{alignmentleftwidth}{alignmentleftwidth}
-\setinterfaceconstant{alignmentrightsample}{alignmentrightsample}
-\setinterfaceconstant{alignmentrightwidth}{alignmentrightwidth}
-\setinterfaceconstant{alignsymbol}{alignsymbol}
-\setinterfaceconstant{aligntitle}{zarovnejtitul}
-\setinterfaceconstant{alternative}{alternativa}
-\setinterfaceconstant{anchor}{anchor}
-\setinterfaceconstant{anchoring}{anchoring}
-\setinterfaceconstant{andtext}{andtext}
-\setinterfaceconstant{apa}{apa}
-\setinterfaceconstant{arguments}{arguments}
-\setinterfaceconstant{arrow}{sipka}
-\setinterfaceconstant{artauthor}{artauthor}
-\setinterfaceconstant{artauthoretaldisplay}{artauthoretaldisplay}
-\setinterfaceconstant{artauthoretallimit}{artauthoretallimit}
-\setinterfaceconstant{artauthoretaltext}{artauthoretaltext}
-\setinterfaceconstant{artoffset}{artoffset}
-\setinterfaceconstant{at}{u}
-\setinterfaceconstant{author}{autor}
-\setinterfaceconstant{authorconversion}{authorconversion}
-\setinterfaceconstant{authoretaldisplay}{authoretaldisplay}
-\setinterfaceconstant{authoretallimit}{authoretallimit}
-\setinterfaceconstant{authoretaltext}{authoretaltext}
-\setinterfaceconstant{auto}{auto}
-\setinterfaceconstant{autocase}{autocase}
-\setinterfaceconstant{autofile}{autofile}
-\setinterfaceconstant{autofocus}{autoostreni}
-\setinterfaceconstant{autohang}{autohang}
-\setinterfaceconstant{autostrut}{autostrut}
-\setinterfaceconstant{autowidth}{autosirka}
-\setinterfaceconstant{availableheight}{availableheight}
-\setinterfaceconstant{availablewidth}{availablewidth}
-\setinterfaceconstant{axis}{osa}
-\setinterfaceconstant{background}{pozadi}
-\setinterfaceconstant{backgroundcolor}{barvapozadi}
-\setinterfaceconstant{backgroundcorner}{rohpozadi}
-\setinterfaceconstant{backgrounddepth}{hloubkapozadi}
-\setinterfaceconstant{backgroundoffset}{offsetpozadi}
-\setinterfaceconstant{backgroundradius}{polomerpozadi}
-\setinterfaceconstant{backgroundscreen}{rastrpozadi}
-\setinterfaceconstant{backreference}{backreference}
-\setinterfaceconstant{backspace}{zpetnamezera}
-\setinterfaceconstant{balance}{rovnovaha}
-\setinterfaceconstant{before}{pred}
-\setinterfaceconstant{beforehead}{predhlavickou}
-\setinterfaceconstant{beforesection}{beforesection}
-\setinterfaceconstant{bet}{bet}
-\setinterfaceconstant{bidi}{bidi}
-\setinterfaceconstant{big}{velky}
-\setinterfaceconstant{blank}{prazdny}
-\setinterfaceconstant{bleedoffset}{bleedoffset}
-\setinterfaceconstant{blockway}{dobloku}
-\setinterfaceconstant{bodyfont}{zakladnifont}
-\setinterfaceconstant{boffset}{boffset}
-\setinterfaceconstant{boldfeatures}{boldfeatures}
-\setinterfaceconstant{boldfont}{boldfont}
-\setinterfaceconstant{bolditalicfeatures}{bolditalicfeatures}
-\setinterfaceconstant{bolditalicfont}{bolditalicfont}
-\setinterfaceconstant{boldslantedfeatures}{boldslantedfeatures}
-\setinterfaceconstant{boldslantedfont}{boldslantedfont}
-\setinterfaceconstant{bookmark}{zalozka}
-\setinterfaceconstant{bottom}{spodek}
-\setinterfaceconstant{bottomafter}{bottomafter}
-\setinterfaceconstant{bottombefore}{bottombefore}
-\setinterfaceconstant{bottomcommand}{bottomcommand}
-\setinterfaceconstant{bottomdistance}{vzdalenostspodku}
-\setinterfaceconstant{bottomframe}{ramecekdole}
-\setinterfaceconstant{bottomoffset}{offsetspodku}
-\setinterfaceconstant{bottomspace}{bottomspace}
-\setinterfaceconstant{bottomstate}{statusspodku}
-\setinterfaceconstant{break}{break}
-\setinterfaceconstant{buffer}{buffer}
-\setinterfaceconstant{cache}{cache}
-\setinterfaceconstant{calculate}{pocitat}
-\setinterfaceconstant{category}{category}
-\setinterfaceconstant{ccommand}{cprikaz}
-\setinterfaceconstant{character}{character}
-\setinterfaceconstant{characters}{characters}
-\setinterfaceconstant{check}{check}
-\setinterfaceconstant{click}{klik}
-\setinterfaceconstant{clickin}{klikuvnitr}
-\setinterfaceconstant{clickout}{klikvne}
-\setinterfaceconstant{clipoffset}{clipoffset}
-\setinterfaceconstant{closeaction}{zavriakci}
-\setinterfaceconstant{closecommand}{closecommand}
-\setinterfaceconstant{closepage}{closepage}
-\setinterfaceconstant{closepageaction}{akcezavrenistranky}
-\setinterfaceconstant{closesymbol}{closesymbol}
-\setinterfaceconstant{color}{barva}
-\setinterfaceconstant{column}{sloupec}
-\setinterfaceconstant{columndistance}{vzdalenostsloupcu}
-\setinterfaceconstant{columns}{sloupce}
-\setinterfaceconstant{comma}{comma}
-\setinterfaceconstant{command}{prikaz}
-\setinterfaceconstant{commandafter}{prikazpo}
-\setinterfaceconstant{commandbefore}{predchoziprikaz}
-\setinterfaceconstant{commands}{prikazy}
-\setinterfaceconstant{comment}{comment}
-\setinterfaceconstant{commentchar}{commentchar}
-\setinterfaceconstant{commentoffset}{commentoffset}
-\setinterfaceconstant{compact}{compact}
-\setinterfaceconstant{component}{component}
-\setinterfaceconstant{compoundhyphen}{compoundhyphen}
-\setinterfaceconstant{compress}{compress}
-\setinterfaceconstant{compressdistance}{compressdistance}
-\setinterfaceconstant{compressmethod}{compressmethod}
-\setinterfaceconstant{compressseparator}{compressseparator}
-\setinterfaceconstant{compressstopper}{compressstopper}
-\setinterfaceconstant{concerns}{concerns}
-\setinterfaceconstant{connector}{connector}
-\setinterfaceconstant{continue}{pokracovat}
-\setinterfaceconstant{contrastcolor}{kontrastnibarva}
-\setinterfaceconstant{controls}{controls}
-\setinterfaceconstant{conversion}{konverze}
-\setinterfaceconstant{convertfile}{konverzesouboru}
-\setinterfaceconstant{copies}{copies}
-\setinterfaceconstant{corner}{roh}
-\setinterfaceconstant{coupling}{propojeni}
-\setinterfaceconstant{couplingway}{zpusobpropojeni}
-\setinterfaceconstant{criterium}{kriterium}
-\setinterfaceconstant{cropoffset}{cropoffset}
-\setinterfaceconstant{crossreference}{crossreference}
-\setinterfaceconstant{cssfile}{cssfile}
-\setinterfaceconstant{current}{aktualni}
-\setinterfaceconstant{cutspace}{cutspace}
-\setinterfaceconstant{dash}{pomlcka}
-\setinterfaceconstant{dat}{dat}
-\setinterfaceconstant{database}{database}
-\setinterfaceconstant{dataset}{dataset}
-\setinterfaceconstant{date}{datum}
-\setinterfaceconstant{deepnumbercommand}{deepnumbercommand}
-\setinterfaceconstant{deeptextcommand}{deeptextcommand}
-\setinterfaceconstant{default}{implicitni}
-\setinterfaceconstant{defaultheight}{defaultheight}
-\setinterfaceconstant{defaultwidth}{defaultwidth}
-\setinterfaceconstant{define}{define}
-\setinterfaceconstant{delay}{prodleva}
-\setinterfaceconstant{depth}{hloubka}
-\setinterfaceconstant{depthcorrection}{korekcehloubky}
-\setinterfaceconstant{direction}{smer}
-\setinterfaceconstant{directory}{adresar}
-\setinterfaceconstant{display}{obrazovka}
-\setinterfaceconstant{displaythreshold}{displaythreshold}
-\setinterfaceconstant{distance}{vzdalenost}
-\setinterfaceconstant{domain}{domain}
-\setinterfaceconstant{dot}{tecka}
-\setinterfaceconstant{doublesided}{oboustranne}
-\setinterfaceconstant{down}{down}
-\setinterfaceconstant{dummy}{dummy}
-\setinterfaceconstant{dx}{dx}
-\setinterfaceconstant{dy}{dy}
-\setinterfaceconstant{edge}{hrana}
-\setinterfaceconstant{edgedistance}{vzdalenosthrany}
-\setinterfaceconstant{editor}{editor}
-\setinterfaceconstant{editoretaldisplay}{editoretaldisplay}
-\setinterfaceconstant{editoretallimit}{editoretallimit}
-\setinterfaceconstant{editoretaltext}{editoretaltext}
-\setinterfaceconstant{empty}{prazdne}
-\setinterfaceconstant{entities}{entities}
-\setinterfaceconstant{entries}{entries}
-\setinterfaceconstant{equalheight}{equalheight}
-\setinterfaceconstant{equalwidth}{equalwidth}
-\setinterfaceconstant{escape}{escape}
-\setinterfaceconstant{etaldisplay}{etaldisplay}
-\setinterfaceconstant{etallimit}{etallimit}
-\setinterfaceconstant{etaloption}{etaloption}
-\setinterfaceconstant{etaltext}{etaltext}
-\setinterfaceconstant{evenmargin}{sudamarginalie}
-\setinterfaceconstant{exact}{exact}
-\setinterfaceconstant{exitoffset}{exitoffset}
-\setinterfaceconstant{expansion}{expanzen}
-\setinterfaceconstant{export}{export}
-\setinterfaceconstant{extras}{extras}
-\setinterfaceconstant{factor}{faktor}
-\setinterfaceconstant{fallback}{fallback}
-\setinterfaceconstant{fallbacks}{fallbacks}
-\setinterfaceconstant{family}{rodina}
-\setinterfaceconstant{features}{features}
-\setinterfaceconstant{featureset}{featureset}
-\setinterfaceconstant{fences}{fences}
-\setinterfaceconstant{field}{field}
-\setinterfaceconstant{fieldbackgroundcolor}{barvapozadipole}
-\setinterfaceconstant{fieldframecolor}{barvarameckupole}
-\setinterfaceconstant{fieldlayer}{fieldlayer}
-\setinterfaceconstant{fieldoffset}{offsetpole}
-\setinterfaceconstant{file}{soubor}
-\setinterfaceconstant{filler}{filler}
-\setinterfaceconstant{filter}{filter}
-\setinterfaceconstant{filtercommand}{filtercommand}
-\setinterfaceconstant{finalnamesep}{finalnamesep}
-\setinterfaceconstant{finalpagesep}{finalpagesep}
-\setinterfaceconstant{finalpubsep}{finalpubsep}
-\setinterfaceconstant{first}{prvni}
-\setinterfaceconstant{firstnamesep}{firstnamesep}
-\setinterfaceconstant{firstpage}{prvnistranka}
-\setinterfaceconstant{focus}{zaostreni}
-\setinterfaceconstant{focusin}{focusin}
-\setinterfaceconstant{focusoffset}{focusoffset}
-\setinterfaceconstant{focusout}{focusout}
-\setinterfaceconstant{font}{font}
-\setinterfaceconstant{footer}{upati}
-\setinterfaceconstant{footerdistance}{vzdalenostupati}
-\setinterfaceconstant{footerstate}{statusupati}
-\setinterfaceconstant{force}{sila}
-\setinterfaceconstant{foregroundcolor}{foregroundcolor}
-\setinterfaceconstant{foregroundstyle}{foregroundstyle}
-\setinterfaceconstant{format}{formatovat}
-\setinterfaceconstant{fractions}{fractions}
-\setinterfaceconstant{frame}{ramecek}
-\setinterfaceconstant{framecolor}{barvaramecku}
-\setinterfaceconstant{framecorner}{rohramecku}
-\setinterfaceconstant{framedepth}{hloubkaramecku}
-\setinterfaceconstant{frameoffset}{offsetramecku}
-\setinterfaceconstant{frameradius}{polomerramecku}
-\setinterfaceconstant{frames}{ramecky}
-\setinterfaceconstant{freeregion}{freeregion}
-\setinterfaceconstant{from}{z}
-\setinterfaceconstant{functioncolor}{functioncolor}
-\setinterfaceconstant{functionstyle}{functionstyle}
-\setinterfaceconstant{get}{ziskat}
-\setinterfaceconstant{global}{globalne}
-\setinterfaceconstant{goodies}{goodies}
-\setinterfaceconstant{grid}{mrizka}
-\setinterfaceconstant{group}{group}
-\setinterfaceconstant{groupsuffix}{groupsuffix}
-\setinterfaceconstant{hang}{zaveseni}
-\setinterfaceconstant{hcompact}{hcompact}
-\setinterfaceconstant{headalign}{headalign}
-\setinterfaceconstant{headcolor}{barvahlavicky}
-\setinterfaceconstant{headcommand}{headcommand}
-\setinterfaceconstant{headconversion}{konverzehlavicky}
-\setinterfaceconstant{header}{zahlavi}
-\setinterfaceconstant{headerdistance}{vzdalenostzahlavi}
-\setinterfaceconstant{headerstate}{statuszahlavi}
-\setinterfaceconstant{headlabel}{popisekhlavicky}
-\setinterfaceconstant{headnumber}{cislonadpisu}
-\setinterfaceconstant{headseparator}{headseparator}
-\setinterfaceconstant{headstyle}{stylhlavicky}
-\setinterfaceconstant{height}{vyska}
-\setinterfaceconstant{hfactor}{hfaktor}
-\setinterfaceconstant{hfil}{hfil}
-\setinterfaceconstant{hidenumber}{hidenumber}
-\setinterfaceconstant{hoffset}{hoffset}
-\setinterfaceconstant{horizontal}{horizontalne}
-\setinterfaceconstant{horoffset}{horoffset}
-\setinterfaceconstant{hyphen}{hyphen}
-\setinterfaceconstant{hyphens}{hyphens}
-\setinterfaceconstant{icommand}{iprikaz}
-\setinterfaceconstant{ignore}{ignore}
-\setinterfaceconstant{in}{v}
-\setinterfaceconstant{inbetween}{mezi}
-\setinterfaceconstant{increment}{zvysit}
-\setinterfaceconstant{incrementnumber}{zvysujicicislo}
-\setinterfaceconstant{indenting}{odsazovani}
-\setinterfaceconstant{indentlist}{indentlist}
-\setinterfaceconstant{indentnext}{odsadpristi}
-\setinterfaceconstant{index}{index}
-\setinterfaceconstant{indicator}{indikator}
-\setinterfaceconstant{initialsep}{initialsep}
-\setinterfaceconstant{inlinethreshold}{inlinethreshold}
-\setinterfaceconstant{inner}{vnitrni}
-\setinterfaceconstant{innermargin}{innermargin}
-\setinterfaceconstant{inputfile}{inputfile}
-\setinterfaceconstant{insidesection}{insidesection}
-\setinterfaceconstant{instance}{instance}
-\setinterfaceconstant{intent}{intent}
-\setinterfaceconstant{interaction}{interakce}
-\setinterfaceconstant{interlinespace}{meziradkovamezera}
-\setinterfaceconstant{internalgrid}{internalgrid}
-\setinterfaceconstant{italicfeatures}{italicfeatures}
-\setinterfaceconstant{italicfont}{italicfont}
-\setinterfaceconstant{itemalign}{itemalign}
-\setinterfaceconstant{items}{polozky}
-\setinterfaceconstant{joiners}{joiners}
-\setinterfaceconstant{journalconversion}{journalconversion}
-\setinterfaceconstant{juniorsep}{juniorsep}
-\setinterfaceconstant{keeptogether}{keeptogether}
-\setinterfaceconstant{ken}{ken}
-\setinterfaceconstant{keyexpansion}{keyexpansion}
-\setinterfaceconstant{keys}{keys}
-\setinterfaceconstant{keyword}{keyword}
-\setinterfaceconstant{label}{popisek}
-\setinterfaceconstant{labelalternative}{labelalternative}
-\setinterfaceconstant{labelcolor}{labelcolor}
-\setinterfaceconstant{labeloffset}{labeloffset}
-\setinterfaceconstant{labelstyle}{labelstyle}
-\setinterfaceconstant{language}{language}
-\setinterfaceconstant{last}{last}
-\setinterfaceconstant{lastnamesep}{lastnamesep}
-\setinterfaceconstant{lastpage}{poslednistrana}
-\setinterfaceconstant{lastpagesep}{lastpagesep}
-\setinterfaceconstant{lastpubsep}{lastpubsep}
-\setinterfaceconstant{layout}{layout}
-\setinterfaceconstant{left}{vlevo}
-\setinterfaceconstant{leftcolor}{barvavlevo}
-\setinterfaceconstant{leftcompoundhyphen}{leftcompoundhyphen}
-\setinterfaceconstant{leftedge}{levahrana}
-\setinterfaceconstant{leftedgedistance}{vzdalenostlevehrany}
-\setinterfaceconstant{leftframe}{ramecekvlevo}
-\setinterfaceconstant{lefthyphen}{lefthyphen}
-\setinterfaceconstant{leftmargin}{levyokraj}
-\setinterfaceconstant{leftmargindistance}{vzdalenostlevehookraje}
-\setinterfaceconstant{leftoffset}{levyoffset}
-\setinterfaceconstant{leftquotation}{citacevlevo}
-\setinterfaceconstant{leftquote}{citovatvlevo}
-\setinterfaceconstant{leftsample}{leftsample}
-\setinterfaceconstant{leftsentence}{vetavlevo}
-\setinterfaceconstant{leftspeech}{leftspeech}
-\setinterfaceconstant{leftstyle}{stylvlevo}
-\setinterfaceconstant{leftsubsentence}{podvetavlevo}
-\setinterfaceconstant{lefttext}{textvlevo}
-\setinterfaceconstant{leftwidth}{sirkavlevo}
-\setinterfaceconstant{leftwords}{leftwords}
-\setinterfaceconstant{less}{less}
-\setinterfaceconstant{level}{uroven}
-\setinterfaceconstant{levels}{urovne}
-\setinterfaceconstant{limittext}{limittext}
-\setinterfaceconstant{line}{radek}
-\setinterfaceconstant{linecorrection}{korekceradku}
-\setinterfaceconstant{linedirection}{linedirection}
-\setinterfaceconstant{lines}{radky}
-\setinterfaceconstant{list}{seznam}
-\setinterfaceconstant{listtext}{listtext}
-\setinterfaceconstant{local}{lokalne}
-\setinterfaceconstant{location}{misto}
-\setinterfaceconstant{loffset}{loffset}
-\setinterfaceconstant{logo}{logo}
-\setinterfaceconstant{logos}{loga}
-\setinterfaceconstant{marcolor}{barvaznacky}
-\setinterfaceconstant{margin}{marginalie}
-\setinterfaceconstant{margindistance}{vzdalenostokraje}
-\setinterfaceconstant{marginedge}{textovahrana}
-\setinterfaceconstant{marginedgetext}{textmarginalnihookraje}
-\setinterfaceconstant{margintext}{textmarginalie}
-\setinterfaceconstant{mark}{mark}
-\setinterfaceconstant{marking}{znaceni}
-\setinterfaceconstant{marstyle}{stylsnacky}
-\setinterfaceconstant{mask}{mask}
-\setinterfaceconstant{mathclass}{mathclass}
-\setinterfaceconstant{mathlimits}{mathlimits}
-\setinterfaceconstant{mathstyle}{mathstyle}
-\setinterfaceconstant{max}{max}
-\setinterfaceconstant{maxdepth}{maxdepth}
-\setinterfaceconstant{maxheight}{maxvyska}
-\setinterfaceconstant{maxwidth}{maxsirka}
-\setinterfaceconstant{maybeyear}{maybeyear}
-\setinterfaceconstant{menu}{menu}
-\setinterfaceconstant{method}{metoda}
-\setinterfaceconstant{middle}{stredni}
-\setinterfaceconstant{middlecolor}{middlecolor}
-\setinterfaceconstant{middlecommand}{middlecommand}
-\setinterfaceconstant{middlespeech}{middlespeech}
-\setinterfaceconstant{middlestyle}{middlestyle}
-\setinterfaceconstant{middletext}{strednitext}
-\setinterfaceconstant{middlewidth}{middlewidth}
-\setinterfaceconstant{midsentence}{midsentence}
-\setinterfaceconstant{min}{min}
-\setinterfaceconstant{mindepth}{mindepth}
-\setinterfaceconstant{minheight}{minvyska}
-\setinterfaceconstant{minwidth}{minsirka}
-\setinterfaceconstant{moffset}{moffset}
-\setinterfaceconstant{monthconversion}{monthconversion}
-\setinterfaceconstant{more}{more}
-\setinterfaceconstant{mpdepth}{mpdepth}
-\setinterfaceconstant{mpheight}{mpheight}
-\setinterfaceconstant{mpoffset}{mpoffset}
-\setinterfaceconstant{mpwidth}{mpwidth}
-\setinterfaceconstant{n}{n}
-\setinterfaceconstant{name}{jmeno}
-\setinterfaceconstant{namesep}{namesep}
-\setinterfaceconstant{nbottom}{nspodek}
-\setinterfaceconstant{nc}{nc}
-\setinterfaceconstant{next}{dalsi}
-\setinterfaceconstant{nextleft}{nextleft}
-\setinterfaceconstant{nextleftquotation}{nextleftquotation}
-\setinterfaceconstant{nextright}{nextright}
-\setinterfaceconstant{nextrightquotation}{nextrightquotation}
-\setinterfaceconstant{nl}{nl}
-\setinterfaceconstant{nleft}{nvlevo}
-\setinterfaceconstant{nlines}{nradky}
-\setinterfaceconstant{norm}{norm}
-\setinterfaceconstant{note}{note}
-\setinterfaceconstant{notes}{notes}
-\setinterfaceconstant{nr}{nr}
-\setinterfaceconstant{nright}{nvpravo}
-\setinterfaceconstant{ntop}{nvrsek}
-\setinterfaceconstant{number}{cislo}
-\setinterfaceconstant{numberalign}{numberalign}
-\setinterfaceconstant{numbercolor}{barvacisla}
-\setinterfaceconstant{numbercommand}{ciselnyprikaz}
-\setinterfaceconstant{numberconversion}{numberconversion}
-\setinterfaceconstant{numberconversionset}{numberconversionset}
-\setinterfaceconstant{numberdistance}{numberdistance}
-\setinterfaceconstant{numbering}{cislovani}
-\setinterfaceconstant{numberorder}{numberorder}
-\setinterfaceconstant{numberprefix}{numberprefix}
-\setinterfaceconstant{numbersegments}{numbersegments}
-\setinterfaceconstant{numberseparator}{oddelovaccisla}
-\setinterfaceconstant{numberseparatorset}{numberseparatorset}
-\setinterfaceconstant{numberset}{numberset}
-\setinterfaceconstant{numberstarter}{numberstarter}
-\setinterfaceconstant{numberstopper}{numberstopper}
-\setinterfaceconstant{numberstrut}{numberstrut}
-\setinterfaceconstant{numberstyle}{stylcisla}
-\setinterfaceconstant{numberwidth}{numberwidth}
-\setinterfaceconstant{nx}{nx}
-\setinterfaceconstant{ny}{ny}
-\setinterfaceconstant{object}{objekt}
-\setinterfaceconstant{obstruction}{prekazka}
-\setinterfaceconstant{oddmargin}{lichyokraj}
-\setinterfaceconstant{offset}{offset}
-\setinterfaceconstant{openaction}{otevriakci}
-\setinterfaceconstant{openpage}{openpage}
-\setinterfaceconstant{openpageaction}{akceotevrenistranky}
-\setinterfaceconstant{openup}{openup}
-\setinterfaceconstant{opticalsize}{opticalsize}
-\setinterfaceconstant{option}{volba}
-\setinterfaceconstant{order}{order}
-\setinterfaceconstant{orientation}{orientation}
-\setinterfaceconstant{otherstext}{otherstext}
-\setinterfaceconstant{outermargin}{outermargin}
-\setinterfaceconstant{overprint}{overprint}
-\setinterfaceconstant{ownerpassword}{ownerpassword}
-\setinterfaceconstant{ownnumber}{vlastnicislo}
-\setinterfaceconstant{packcriterium}{packcriterium}
-\setinterfaceconstant{page}{stranka}
-\setinterfaceconstant{pageboundaries}{hranicestranky}
-\setinterfaceconstant{pagecolor}{barvastranky}
-\setinterfaceconstant{pagecolormodel}{pagecolormodel}
-\setinterfaceconstant{pagecommand}{strankovyprikaz}
-\setinterfaceconstant{pageconnector}{pageconnector}
-\setinterfaceconstant{pageconversion}{pageconversion}
-\setinterfaceconstant{pageconversionset}{pageconversionset}
-\setinterfaceconstant{pageleft}{pageleft}
-\setinterfaceconstant{pagemethod}{pagemethod}
-\setinterfaceconstant{pagenumber}{cislostranky}
-\setinterfaceconstant{pageprefix}{pageprefix}
-\setinterfaceconstant{pageprefixconnector}{pageprefixconnector}
-\setinterfaceconstant{pageprefixconversion}{pageprefixconversion}
-\setinterfaceconstant{pageprefixconversionset}{pageprefixconversionset}
-\setinterfaceconstant{pageprefixsegments}{pageprefixsegments}
-\setinterfaceconstant{pageprefixseparatorset}{pageprefixseparatorset}
-\setinterfaceconstant{pageprefixset}{pageprefixset}
-\setinterfaceconstant{pageprefixstarter}{pageprefixstarter}
-\setinterfaceconstant{pageprefixstopper}{pageprefixstopper}
-\setinterfaceconstant{pageright}{pageright}
-\setinterfaceconstant{pagesegments}{pagesegments}
-\setinterfaceconstant{pagesep}{pagesep}
-\setinterfaceconstant{pageseparatorset}{pageseparatorset}
-\setinterfaceconstant{pageset}{pageset}
-\setinterfaceconstant{pagestarter}{pagestarter}
-\setinterfaceconstant{pagestate}{pagestate}
-\setinterfaceconstant{pagestopper}{pagestopper}
-\setinterfaceconstant{pagestyle}{stylstranky}
-\setinterfaceconstant{palet}{paleta}
-\setinterfaceconstant{paper}{papir}
-\setinterfaceconstant{paragraph}{odstavec}
-\setinterfaceconstant{period}{period}
-\setinterfaceconstant{place}{umistit}
-\setinterfaceconstant{placehead}{umistihlavicku}
-\setinterfaceconstant{placeholder}{placeholder}
-\setinterfaceconstant{placestopper}{predelmista}
-\setinterfaceconstant{position}{position}
-\setinterfaceconstant{prefix}{prefix}
-\setinterfaceconstant{prefixconnector}{prefixconnector}
-\setinterfaceconstant{prefixconversion}{prefixconversion}
-\setinterfaceconstant{prefixconversionset}{prefixconversionset}
-\setinterfaceconstant{prefixsegments}{prefixsegments}
-\setinterfaceconstant{prefixseparatorset}{prefixseparatorset}
-\setinterfaceconstant{prefixset}{prefixset}
-\setinterfaceconstant{prefixstarter}{prefixstarter}
-\setinterfaceconstant{prefixstopper}{prefixstopper}
-\setinterfaceconstant{preset}{prednastaveni}
-\setinterfaceconstant{preview}{nahled}
-\setinterfaceconstant{previous}{predchozi}
-\setinterfaceconstant{previousnumber}{predchozicislo}
-\setinterfaceconstant{print}{print}
-\setinterfaceconstant{printable}{tisknutelne}
-\setinterfaceconstant{process}{process}
-\setinterfaceconstant{processors}{processors}
-\setinterfaceconstant{profile}{profile}
-\setinterfaceconstant{properties}{properties}
-\setinterfaceconstant{pubsep}{pubsep}
-\setinterfaceconstant{quotechar}{quotechar}
-\setinterfaceconstant{radius}{polomer}
-\setinterfaceconstant{random}{nahodne}
-\setinterfaceconstant{range}{range}
-\setinterfaceconstant{reduction}{redukce}
-\setinterfaceconstant{ref}{ref}
-\setinterfaceconstant{refcommand}{refcommand}
-\setinterfaceconstant{reference}{odkaz}
-\setinterfaceconstant{referencemethod}{referencemethod}
-\setinterfaceconstant{referenceprefix}{referenceprefix}
-\setinterfaceconstant{referencetext}{referencetext}
-\setinterfaceconstant{referencing}{odkazujici}
-\setinterfaceconstant{region}{region}
-\setinterfaceconstant{regionin}{oblastuvnitr}
-\setinterfaceconstant{regionout}{oblastvne}
-\setinterfaceconstant{register}{register}
-\setinterfaceconstant{regularfeatures}{regularfeatures}
-\setinterfaceconstant{regularfont}{regularfont}
-\setinterfaceconstant{renderingsetup}{renderingsetup}
-\setinterfaceconstant{repeat}{opakovat}
-\setinterfaceconstant{reset}{reset}
-\setinterfaceconstant{resetnumber}{resetnumber}
-\setinterfaceconstant{resolution}{rozliseni}
-\setinterfaceconstant{resources}{resources}
-\setinterfaceconstant{reverse}{reverse}
-\setinterfaceconstant{right}{vpravo}
-\setinterfaceconstant{rightchars}{rightchars}
-\setinterfaceconstant{rightcolor}{barvavpravo}
-\setinterfaceconstant{rightcompoundhyphen}{rightcompoundhyphen}
-\setinterfaceconstant{rightedge}{pravahrana}
-\setinterfaceconstant{rightedgedistance}{vzdalenostpravehrany}
-\setinterfaceconstant{rightframe}{ramecekvpravo}
-\setinterfaceconstant{righthyphen}{righthyphen}
-\setinterfaceconstant{rightmargin}{pravyokraj}
-\setinterfaceconstant{rightmargindistance}{vzdalenostpravehookraje}
-\setinterfaceconstant{rightoffset}{pravyoffset}
-\setinterfaceconstant{rightquotation}{citacevpravo}
-\setinterfaceconstant{rightquote}{citovatvpravo}
-\setinterfaceconstant{rightsample}{rightsample}
-\setinterfaceconstant{rightsentence}{vetavpravo}
-\setinterfaceconstant{rightspeech}{rightspeech}
-\setinterfaceconstant{rightstyle}{stylvpravo}
-\setinterfaceconstant{rightsubsentence}{podvetavpravo}
-\setinterfaceconstant{righttext}{textvpravo}
-\setinterfaceconstant{rightwidth}{sirkavpravo}
-\setinterfaceconstant{rightwords}{rightwords}
-\setinterfaceconstant{roffset}{roffset}
-\setinterfaceconstant{rotation}{rotace}
-\setinterfaceconstant{rule}{linka}
-\setinterfaceconstant{rulecolor}{barvalinky}
-\setinterfaceconstant{rulecommand}{rulecommand}
-\setinterfaceconstant{rulethickness}{tloustkalinky}
-\setinterfaceconstant{samepage}{stejnastranka}
-\setinterfaceconstant{sample}{vzor}
-\setinterfaceconstant{samplesize}{samplesize}
-\setinterfaceconstant{saveinlist}{saveinlist}
-\setinterfaceconstant{scale}{meritko}
-\setinterfaceconstant{scope}{rozsah}
-\setinterfaceconstant{screen}{rastr}
-\setinterfaceconstant{section}{oddil}
-\setinterfaceconstant{sectionblock}{sectionblock}
-\setinterfaceconstant{sectionconversion}{sectionconversion}
-\setinterfaceconstant{sectionconversionset}{sectionconversionset}
-\setinterfaceconstant{sectionnumber}{cislooddilu}
-\setinterfaceconstant{sectionresetset}{sectionresetset}
-\setinterfaceconstant{sectionsegments}{sectionsegments}
-\setinterfaceconstant{sectionseparatorset}{sectionseparatorset}
-\setinterfaceconstant{sectionset}{sectionset}
-\setinterfaceconstant{sectionstarter}{sectionstarter}
-\setinterfaceconstant{sectionstopper}{sectionstopper}
-\setinterfaceconstant{separator}{oddelovac}
-\setinterfaceconstant{separatorcolor}{separatorcolor}
-\setinterfaceconstant{separatorstyle}{separatorstyle}
-\setinterfaceconstant{set}{set}
-\setinterfaceconstant{setups}{setups}
-\setinterfaceconstant{shrink}{shrink}
-\setinterfaceconstant{side}{pocitat}
-\setinterfaceconstant{sidealign}{sidealign}
-\setinterfaceconstant{sidemethod}{sidemethod}
-\setinterfaceconstant{sidespaceafter}{bocnimezeraza}
-\setinterfaceconstant{sidespacebefore}{bocnimezerapred}
-\setinterfaceconstant{sidespaceinbetween}{sidespaceinbetween}
-\setinterfaceconstant{sidethreshold}{sidethreshold}
-\setinterfaceconstant{sign}{znak}
-\setinterfaceconstant{simplecommand}{simplecommand}
-\setinterfaceconstant{size}{velikost}
-\setinterfaceconstant{slantedfeatures}{slantedfeatures}
-\setinterfaceconstant{slantedfont}{slantedfont}
-\setinterfaceconstant{small}{male}
-\setinterfaceconstant{smallcapsfeatures}{smallcapsfeatures}
-\setinterfaceconstant{smallcapsfont}{smallcapsfont}
-\setinterfaceconstant{solution}{solution}
-\setinterfaceconstant{sort}{sort}
-\setinterfaceconstant{sorttype}{sorttype}
-\setinterfaceconstant{source}{zdroj}
-\setinterfaceconstant{space}{mezera}
-\setinterfaceconstant{spaceafter}{mezeraza}
-\setinterfaceconstant{spaceafterside}{spaceafterside}
-\setinterfaceconstant{spacebefore}{mezerapred}
-\setinterfaceconstant{spacebeforeside}{spacebeforeside}
-\setinterfaceconstant{spaceinbetween}{spaceinbetween}
-\setinterfaceconstant{spacing}{mezerovani}
-\setinterfaceconstant{specification}{specification}
-\setinterfaceconstant{split}{split}
-\setinterfaceconstant{splitcolor}{splitcolor}
-\setinterfaceconstant{splitmethod}{splitmethod}
-\setinterfaceconstant{splitoffset}{splitoffset}
-\setinterfaceconstant{spot}{spot}
-\setinterfaceconstant{stack}{stack}
-\setinterfaceconstant{stackname}{stackname}
-\setinterfaceconstant{start}{start}
-\setinterfaceconstant{starter}{starter}
-\setinterfaceconstant{state}{status}
-\setinterfaceconstant{step}{krok}
-\setinterfaceconstant{stop}{stop}
-\setinterfaceconstant{stopper}{predel}
-\setinterfaceconstant{stretch}{natahnout}
-\setinterfaceconstant{strip}{strip}
-\setinterfaceconstant{strut}{strut}
-\setinterfaceconstant{style}{pismeno}
-\setinterfaceconstant{stylealternative}{stylealternative}
-\setinterfaceconstant{sub}{pod}
-\setinterfaceconstant{subtitle}{podtitulek}
-\setinterfaceconstant{suffix}{suffix}
-\setinterfaceconstant{suffixseparator}{suffixseparator}
-\setinterfaceconstant{suffixstopper}{suffixstopper}
-\setinterfaceconstant{surnamefirstnamesep}{surnamefirstnamesep}
-\setinterfaceconstant{surnameinitialsep}{surnameinitialsep}
-\setinterfaceconstant{surnamesep}{surnamesep}
-\setinterfaceconstant{svgstyle}{svgstyle}
-\setinterfaceconstant{sx}{sx}
-\setinterfaceconstant{sy}{sy}
-\setinterfaceconstant{symalign}{symzarovnani}
-\setinterfaceconstant{symbol}{symbol}
-\setinterfaceconstant{symbolcommand}{symbolcommand}
-\setinterfaceconstant{symbolset}{sadasymbolu}
-\setinterfaceconstant{symcolor}{barvasymbolu}
-\setinterfaceconstant{symstyle}{stylsymboly}
-\setinterfaceconstant{synonym}{synonymum}
-\setinterfaceconstant{synonymcolor}{barvasynonyma}
-\setinterfaceconstant{synonymcommand}{synonymcommand}
-\setinterfaceconstant{synonymstyle}{stylsynonyma}
-\setinterfaceconstant{tab}{tab}
-\setinterfaceconstant{text}{text}
-\setinterfaceconstant{textalign}{textalign}
-\setinterfaceconstant{textcolor}{barvatextu}
-\setinterfaceconstant{textcommand}{textovyprikaz}
-\setinterfaceconstant{textdistance}{textdistance}
-\setinterfaceconstant{textheight}{vyskatextu}
-\setinterfaceconstant{textlayer}{textlayer}
-\setinterfaceconstant{textmargin}{textmargin}
-\setinterfaceconstant{textmethod}{textmethod}
-\setinterfaceconstant{textseparator}{oddelovactextu}
-\setinterfaceconstant{textsize}{velikosttextu}
-\setinterfaceconstant{textstate}{statustextu}
-\setinterfaceconstant{textstyle}{styltextu}
-\setinterfaceconstant{textwidth}{sirkatextu}
-\setinterfaceconstant{threshold}{threshold}
-\setinterfaceconstant{time}{time}
-\setinterfaceconstant{title}{titul}
-\setinterfaceconstant{titlecolor}{barvatitulek}
-\setinterfaceconstant{titlecommand}{titlecommand}
-\setinterfaceconstant{titledistance}{vzdalenosttitulek}
-\setinterfaceconstant{titleleft}{titleleft}
-\setinterfaceconstant{titleright}{titleright}
-\setinterfaceconstant{titlestrut}{titlestrut}
-\setinterfaceconstant{titlestyle}{styltitulek}
-\setinterfaceconstant{to}{na}
-\setinterfaceconstant{toffset}{toffset}
-\setinterfaceconstant{tolerance}{tolerance}
-\setinterfaceconstant{top}{vrsek}
-\setinterfaceconstant{topcommand}{topcommand}
-\setinterfaceconstant{topdistance}{vzdalenostvrsku}
-\setinterfaceconstant{topframe}{rameceknahore}
-\setinterfaceconstant{topoffset}{offsetvrsku}
-\setinterfaceconstant{topspace}{svrchnimezera}
-\setinterfaceconstant{topstate}{statusvrsku}
-\setinterfaceconstant{totalnumber}{totalnumber}
-\setinterfaceconstant{transform}{transform}
-\setinterfaceconstant{translate}{translate}
-\setinterfaceconstant{trimoffset}{trimoffset}
-\setinterfaceconstant{type}{typ}
-\setinterfaceconstant{unit}{jednotka}
-\setinterfaceconstant{unknownreference}{neznamyodkaz}
-\setinterfaceconstant{up}{up}
-\setinterfaceconstant{urlalternative}{urlalternativa}
-\setinterfaceconstant{urlspace}{prostorurl}
-\setinterfaceconstant{userpassword}{userpassword}
-\setinterfaceconstant{validate}{validovat}
-\setinterfaceconstant{values}{values}
-\setinterfaceconstant{vcommand}{vprikaz}
-\setinterfaceconstant{vcompact}{vcompact}
-\setinterfaceconstant{vector}{vector}
-\setinterfaceconstant{veroffset}{offsethlavicky}
-\setinterfaceconstant{vertical}{vertikalne}
-\setinterfaceconstant{vfactor}{vfaktor}
-\setinterfaceconstant{vfil}{vfil}
-\setinterfaceconstant{viewerprefix}{viewerprefix}
-\setinterfaceconstant{voffset}{voffset}
-\setinterfaceconstant{vonsep}{vonsep}
-\setinterfaceconstant{way}{zpusob}
-\setinterfaceconstant{wfactor}{sfaktor}
-\setinterfaceconstant{white}{bily}
-\setinterfaceconstant{width}{sirka}
-\setinterfaceconstant{words}{words}
-\setinterfaceconstant{xanchor}{xanchor}
-\setinterfaceconstant{xfactor}{xfaktor}
-\setinterfaceconstant{xhtml}{xhtml}
-\setinterfaceconstant{xmax}{xmax}
-\setinterfaceconstant{xmlsetup}{xmlsetup}
-\setinterfaceconstant{xoffset}{xoffset}
-\setinterfaceconstant{xscale}{xmeritko}
-\setinterfaceconstant{xstep}{xkrok}
-\setinterfaceconstant{yanchor}{yanchor}
-\setinterfaceconstant{yfactor}{yfaktor}
-\setinterfaceconstant{ymax}{ymax}
-\setinterfaceconstant{yoffset}{yoffset}
-\setinterfaceconstant{yscale}{ymeritko}
-\setinterfaceconstant{ystep}{ykrok}
-% definitions for interface elements for language cs
-%
-\setinterfaceelement{answerlines}{answerlines}
-\setinterfaceelement{answerspace}{answerspace}
-\setinterfaceelement{begin}{zacatek}
-\setinterfaceelement{complete}{uplny}
-\setinterfaceelement{coupled}{propojene}
-\setinterfaceelement{currentlocal}{aktualnelokalni}
-\setinterfaceelement{end}{konec}
-\setinterfaceelement{endsetup}{}
-\setinterfaceelement{get}{ziskat}
-\setinterfaceelement{increment}{zvysit}
-\setinterfaceelement{list}{seznam}
-\setinterfaceelement{listof}{seznam}
-\setinterfaceelement{load}{nacist}
-\setinterfaceelement{local}{lokalne}
-\setinterfaceelement{makeup}{zlom}
-\setinterfaceelement{next}{dalsi}
-\setinterfaceelement{place}{umisti}
-\setinterfaceelement{previous}{predchozi}
-\setinterfaceelement{previouslocal}{predchozilokalni}
-\setinterfaceelement{reserve}{rezervovat}
-\setinterfaceelement{see}{viz}
-\setinterfaceelement{setup}{nastaveni}
-\setinterfaceelement{start}{start}
-\setinterfaceelement{stop}{stop}
-\setinterfaceelement{text}{text}
-\setinterfaceelement{type}{opis}
-% definitions for interface commands for language cs
-%
-\setinterfacecommand{Character}{Znak}
-\setinterfacecommand{Characters}{Znaky}
-\setinterfacecommand{MONTH}{MESIC}
-\setinterfacecommand{Numbers}{Cisla}
-\setinterfacecommand{Romannumerals}{Rimskecislice}
-\setinterfacecommand{SmallCapped}{Kap}
-\setinterfacecommand{SmallCaps}{Kaps}
-\setinterfacecommand{WEEKDAY}{VSEDNIDEN}
-\setinterfacecommand{WORD}{SLOVO}
-\setinterfacecommand{WORDS}{SLOVA}
-\setinterfacecommand{Word}{Slovo}
-\setinterfacecommand{Words}{Slova}
-\setinterfacecommand{about}{oref}
-\setinterfacecommand{adaptfontfeature}{adaptfontfeature}
-\setinterfacecommand{adaptlayout}{prizpusobvzhled}
-\setinterfacecommand{addfeature}{addfeature}
-\setinterfacecommand{alignbottom}{alignbottom}
-\setinterfacecommand{aligned}{aligned}
-\setinterfacecommand{alignedbox}{alignedbox}
-\setinterfacecommand{alignedline}{alignedline}
-\setinterfacecommand{alignhere}{alignhere}
-\setinterfacecommand{alignment}{alignment}
-\setinterfacecommand{alignmentcharacter}{alignmentcharacter}
-\setinterfacecommand{applytocharacters}{applytocharacters}
-\setinterfacecommand{applytofirstcharacter}{applytofirstcharacter}
-\setinterfacecommand{arg}{arg}
-\setinterfacecommand{at}{pref}
-\setinterfacecommand{atleftmargin}{atleftmargin}
-\setinterfacecommand{atpage}{nastrane}
-\setinterfacecommand{atrightmargin}{atrightmargin}
-\setinterfacecommand{background}{pozadi}
-\setinterfacecommand{backspace}{odsazenizleva}
-\setinterfacecommand{blackrule}{cernalinka}
-\setinterfacecommand{blackrules}{cernelinky}
-\setinterfacecommand{blank}{preskoc}
-\setinterfacecommand{bookmark}{zalozka}
-\setinterfacecommand{bottombox}{bottombox}
-\setinterfacecommand{bottomdistance}{vzdalenostspodku}
-\setinterfacecommand{bottomheight}{vyskaspodku}
-\setinterfacecommand{bottomleftbox}{bottomleftbox}
-\setinterfacecommand{bottomrightbox}{bottomrightbox}
-\setinterfacecommand{bottomspace}{bottomspace}
-\setinterfacecommand{buildtextbottomdot}{buildtextbottomdot}
-\setinterfacecommand{but}{spodek}
-\setinterfacecommand{button}{tlacitko}
-\setinterfacecommand{bypassblocks}{bypassblocks}
-\setinterfacecommand{character}{znak}
-\setinterfacecommand{characters}{znaky}
-\setinterfacecommand{chem}{chem}
-\setinterfacecommand{clip}{orez}
-\setinterfacecommand{clonefield}{klonujpole}
-\setinterfacecommand{color}{barva}
-\setinterfacecommand{colorbar}{barevnalista}
-\setinterfacecommand{colorvalue}{hodnotabarvy}
-\setinterfacecommand{column}{sloupec}
-\setinterfacecommand{comparecolorgroup}{porovnejskupinubarev}
-\setinterfacecommand{comparepalet}{porovnejpaletu}
-\setinterfacecommand{completepagenumber}{completepagenumber}
-\setinterfacecommand{completeregister}{completeregister}
-\setinterfacecommand{component}{komponenta}
-\setinterfacecommand{convertnumber}{konvertujcislo}
-\setinterfacecommand{copyfield}{kopirujpole}
-\setinterfacecommand{correctwhitespace}{korekcebilehomista}
-\setinterfacecommand{coupledocument}{propojenydokument}
-\setinterfacecommand{couplemarking}{propojeneznaceni}
-\setinterfacecommand{couplepage}{parovastrana}
-\setinterfacecommand{couplepaper}{dvoustrannypapir}
-\setinterfacecommand{coupleregister}{propojenyrejstrik}
-\setinterfacecommand{crlf}{crlf}
-\setinterfacecommand{currentdate}{aktualnidatum}
-\setinterfacecommand{currentheadnumber}{aktualnicislonadpisu}
-\setinterfacecommand{cutspace}{cutspace}
-\setinterfacecommand{date}{datum}
-\setinterfacecommand{decouplemarking}{rozpojeneznaceni}
-\setinterfacecommand{decrementnumber}{decrementnumber}
-\setinterfacecommand{define}{definuj}
-\setinterfacecommand{defineaccent}{definujakcent}
-\setinterfacecommand{defineblank}{definujpreskok}
-\setinterfacecommand{defineblock}{definujblok}
-\setinterfacecommand{definebodyfont}{definujzakladnifont}
-\setinterfacecommand{definebodyfontenvironment}{definujprostredizakladnihofontu}
-\setinterfacecommand{definebodyfontswitch}{definebodyfontswitch}
-\setinterfacecommand{definebuffer}{definujbuffer}
-\setinterfacecommand{definecharacter}{definujznak}
-\setinterfacecommand{definecharacterkerning}{definecharacterkerning}
-\setinterfacecommand{definecharacterspacing}{definecharacterspacing}
-\setinterfacecommand{definecolor}{definujbarvu}
-\setinterfacecommand{definecolorgroup}{definujskupinubarev}
-\setinterfacecommand{definecolumnbreak}{definecolumnbreak}
-\setinterfacecommand{definecolumnset}{definecolumnset}
-\setinterfacecommand{definecombination}{definecombination}
-\setinterfacecommand{definecombinedlist}{definujkombinovanyseznam}
-\setinterfacecommand{definecommand}{definujprikaz}
-\setinterfacecommand{defineconversion}{definujkonverzi}
-\setinterfacecommand{definedescription}{definujpopis}
-\setinterfacecommand{definedfont}{definedfont}
-\setinterfacecommand{defineenumeration}{definujvycet}
-\setinterfacecommand{definefallbackfamily}{definefallbackfamily}
-\setinterfacecommand{definefield}{definujpole}
-\setinterfacecommand{definefieldstack}{definujzasobnikpoli}
-\setinterfacecommand{definefiguresymbol}{definujobrazeksymbol}
-\setinterfacecommand{definefilefallback}{definefilefallback}
-\setinterfacecommand{definefirstline}{definefirstline}
-\setinterfacecommand{definefloat}{definujplvouciobjekt}
-\setinterfacecommand{definefont}{definujfont}
-\setinterfacecommand{definefontalternative}{definefontalternative}
-\setinterfacecommand{definefontfallback}{definefontfallback}
-\setinterfacecommand{definefontfamily}{definefontfamily}
-\setinterfacecommand{definefontfamilypreset}{definefontfamilypreset}
-\setinterfacecommand{definefontfeature}{definefontfeature}
-\setinterfacecommand{definefontfile}{definefontfile}
-\setinterfacecommand{definefontsize}{definefontsize}
-\setinterfacecommand{definefontsolution}{definefontsolution}
-\setinterfacecommand{definefontstyle}{definujstylfontu}
-\setinterfacecommand{definefontsynonym}{definujsynonumumfontu}
-\setinterfacecommand{defineframed}{definujoramovani}
-\setinterfacecommand{defineframedtext}{definujoramovanytext}
-\setinterfacecommand{definefrozenfont}{definefrozenfont}
-\setinterfacecommand{definehbox}{definujhbox}
-\setinterfacecommand{definehead}{definujnadpis}
-\setinterfacecommand{definehyphenationfeatures}{definehyphenationfeatures}
-\setinterfacecommand{defineindentedtext}{defineindentedtext}
-\setinterfacecommand{defineinmargin}{defineinmargin}
-\setinterfacecommand{defineinteractionmenu}{definujinterakcnimenu}
-\setinterfacecommand{defineitemgroup}{defineitemgroup}
-\setinterfacecommand{defineitems}{defineitems}
-\setinterfacecommand{definelabel}{definujpopisek}
-\setinterfacecommand{definelayer}{definelayer}
-\setinterfacecommand{definelayout}{definelayout}
-\setinterfacecommand{definelinenote}{definelinenote}
-\setinterfacecommand{definelist}{definujseznam}
-\setinterfacecommand{definelogo}{definujlogo}
-\setinterfacecommand{definemainfield}{definujhlavnipole}
-\setinterfacecommand{definemakeup}{definujupravu}
-\setinterfacecommand{definemarking}{definujznaceni}
-\setinterfacecommand{definemathalignment}{definemathalignment}
-\setinterfacecommand{definemode}{definemode}
-\setinterfacecommand{definenamedcolor}{definenamedcolor}
-\setinterfacecommand{definenote}{definenote}
-\setinterfacecommand{defineoutput}{definujvystup}
-\setinterfacecommand{defineoverlay}{definujprekryv}
-\setinterfacecommand{definepagebreak}{definepagebreak}
-\setinterfacecommand{definepalet}{definujpaletu}
-\setinterfacecommand{definepapersize}{definujvelikostpapiru}
-\setinterfacecommand{defineparagraphs}{definujodstavce}
-\setinterfacecommand{defineperiodkerning}{defineperiodkerning}
-\setinterfacecommand{defineplacement}{defineplacement}
-\setinterfacecommand{defineprofile}{definujprofil}
-\setinterfacecommand{defineprogram}{definujprogram}
-\setinterfacecommand{definerawfont}{definerawfont}
-\setinterfacecommand{definereference}{definujodkaz}
-\setinterfacecommand{definereferenceformat}{definujformatodkazu}
-\setinterfacecommand{definereferencelist}{definujseznamodkazu}
-\setinterfacecommand{defineregister}{definujrejstrik}
-\setinterfacecommand{definerule}{definerule}
-\setinterfacecommand{definesection}{definujsekci}
-\setinterfacecommand{definesectionblock}{definujbloksekce}
-\setinterfacecommand{definesorting}{definujtrideni}
-\setinterfacecommand{definestartstop}{definujstartstop}
-\setinterfacecommand{definestyle}{definujstyl}
-\setinterfacecommand{definesubfield}{definujpodpole}
-\setinterfacecommand{definesymbol}{definujsymbol}
-\setinterfacecommand{definesynonyms}{definujsynonyma}
-\setinterfacecommand{definetabletemplate}{definujsablonutabulky}
-\setinterfacecommand{definetabulate}{definujtabelaci}
-\setinterfacecommand{definetext}{definujtext}
-\setinterfacecommand{definetextbackground}{definetextbackground}
-\setinterfacecommand{definetextnote}{definetextnote}
-\setinterfacecommand{definetextposition}{definetextposition}
-\setinterfacecommand{definetextvariable}{definetextvariable}
-\setinterfacecommand{definetype}{definetype}
-\setinterfacecommand{definetyping}{definujopis}
-\setinterfacecommand{defineversion}{definujverzi}
-\setinterfacecommand{depthspanningtext}{depthspanningtext}
-\setinterfacecommand{determineheadnumber}{stanovcislonadpisu}
-\setinterfacecommand{determinelistcharacteristics}{stanovcharakteristickuseznamu}
-\setinterfacecommand{determineregistercharacteristics}{urcicharakteristikurejstriku}
-\setinterfacecommand{dimension}{rozmer}
-\setinterfacecommand{disableinteractionmenu}{zablokujinterakcnimenu}
-\setinterfacecommand{disablemode}{disablemode}
-\setinterfacecommand{doaddfeature}{doaddfeature}
-\setinterfacecommand{domicile}{bydliste}
-\setinterfacecommand{dontconvertfont}{dontconvertfont}
-\setinterfacecommand{donttest}{zadnytest}
-\setinterfacecommand{edgedistance}{vzdalenostokraje}
-\setinterfacecommand{edgewidth}{sirkaokraje}
-\setinterfacecommand{emphasisboldface}{emphasisboldface}
-\setinterfacecommand{emptylines}{emptylines}
-\setinterfacecommand{enablemode}{enablemode}
-\setinterfacecommand{environment}{prostredi}
-\setinterfacecommand{externalfigure}{externiobraz}
-\setinterfacecommand{fact}{fakt}
-\setinterfacecommand{fastswitchtobodyfont}{fastswitchtobodyfont}
-\setinterfacecommand{feature}{feature}
-\setinterfacecommand{field}{pole}
-\setinterfacecommand{fieldstack}{zasobnikpoli}
-\setinterfacecommand{fillinfield}{vyplnovepole}
-\setinterfacecommand{fillinline}{vyplnovyradek}
-\setinterfacecommand{fillinrules}{vyplnovelinky}
-\setinterfacecommand{fillintext}{vyplnenytext}
-\setinterfacecommand{firstcharacter}{firstcharacter}
-\setinterfacecommand{fitfield}{prizpusobivepole}
-\setinterfacecommand{fittopbaselinegrid}{fittopbaselinegrid}
-\setinterfacecommand{fixedspace}{tvrdamezera}
-\setinterfacecommand{fixedspaces}{tvrdemezery}
-\setinterfacecommand{flushnotes}{flushnotes}
-\setinterfacecommand{followprofile}{dodrzujprofil}
-\setinterfacecommand{followprofileversion}{dodrzujverziprofilu}
-\setinterfacecommand{followversion}{dodrzujverzi}
-\setinterfacecommand{footerdistance}{vzdalenostupati}
-\setinterfacecommand{footerheight}{vyskaupati}
-\setinterfacecommand{footnote}{poznamkapodcarou}
-\setinterfacecommand{footnotetext}{footnotetext}
-\setinterfacecommand{forceblocks}{forceblocks}
-\setinterfacecommand{forcecharacterstripping}{forcecharacterstripping}
-\setinterfacecommand{formulanumber}{cislorovnice}
-\setinterfacecommand{fraction}{zlomek}
-\setinterfacecommand{framed}{oramovani}
-\setinterfacecommand{from}{zref}
-\setinterfacecommand{fromlinenote}{fromlinenote}
-\setinterfacecommand{getbuffer}{ziskejbuffer}
-\setinterfacecommand{getfirstcharacter}{getfirstcharacter}
-\setinterfacecommand{getmarking}{ziskejznaceni}
-\setinterfacecommand{getnumber}{getnumber}
-\setinterfacecommand{globaldisablemode}{globaldisablemode}
-\setinterfacecommand{globalenablemode}{globalenablemode}
-\setinterfacecommand{globalpreventmode}{globalpreventmode}
-\setinterfacecommand{godown}{jdidolu}
-\setinterfacecommand{goto}{jdina}
-\setinterfacecommand{gotobox}{jdinabox}
-\setinterfacecommand{gotopage}{jdinastranu}
-\setinterfacecommand{graycolor}{sedabarva}
-\setinterfacecommand{greyvalue}{hodnotasedi}
-\setinterfacecommand{grid}{mrizka}
-\setinterfacecommand{hairline}{vlasovalinka}
-\setinterfacecommand{head}{nadpis}
-\setinterfacecommand{headerdistance}{vzdalenostzahlavi}
-\setinterfacecommand{headerheight}{vyskazahlavi}
-\setinterfacecommand{headlevel}{hlavniuroven}
-\setinterfacecommand{headnumber}{cislonadpisu}
-\setinterfacecommand{headsym}{headsym}
-\setinterfacecommand{headtext}{texthlavicky}
-\setinterfacecommand{heightspanningtext}{heightspanningtext}
-\setinterfacecommand{hideblocks}{schovejbloky}
-\setinterfacecommand{high}{vysoky}
-\setinterfacecommand{hl}{hl}
-\setinterfacecommand{immediatebetweenlist}{immediatebetweenlist}
-\setinterfacecommand{immediatetolist}{immediatetolist}
-\setinterfacecommand{in}{tref}
-\setinterfacecommand{incrementnumber}{zvysujicicislo}
-\setinterfacecommand{indenting}{odsazovani}
-\setinterfacecommand{inframed}{zaramovani}
-\setinterfacecommand{infull}{plnezneni}
-\setinterfacecommand{ininner}{ininner}
-\setinterfacecommand{inleft}{vlevo}
-\setinterfacecommand{inleftedge}{nalevo}
-\setinterfacecommand{inleftmargin}{nalevyokraj}
-\setinterfacecommand{inline}{vradku}
-\setinterfacecommand{inmargin}{naokraj}
-\setinterfacecommand{inmframed}{mazaramovani}
-\setinterfacecommand{inneredgedistance}{inneredgedistance}
-\setinterfacecommand{inneredgewidth}{inneredgewidth}
-\setinterfacecommand{innermargindistance}{innermargindistance}
-\setinterfacecommand{innermarginwidth}{innermarginwidth}
-\setinterfacecommand{inothermargin}{nadruhyokraj}
-\setinterfacecommand{inouter}{inouter}
-\setinterfacecommand{inright}{vpravo}
-\setinterfacecommand{inrightedge}{napravo}
-\setinterfacecommand{inrightmargin}{napravyokraj}
-\setinterfacecommand{installlanguage}{instalacejazyka}
-\setinterfacecommand{interactionbar}{interakcnilista}
-\setinterfacecommand{interactionbuttons}{interakcnitlacitka}
-\setinterfacecommand{interactionmenu}{interaktivnimenu}
-\setinterfacecommand{item}{polozka}
-\setinterfacecommand{itemgroup}{itemgroup}
-\setinterfacecommand{items}{polozky}
-\setinterfacecommand{itemtag}{itemtag}
-\setinterfacecommand{its}{pol}
-\setinterfacecommand{keepblocks}{zachovejbloky}
-\setinterfacecommand{kerncharacters}{kerncharacters}
-\setinterfacecommand{label}{poppisek}
-\setinterfacecommand{labels}{popisky}
-\setinterfacecommand{labeltext}{textpopisku}
-\setinterfacecommand{language}{jazyk}
-\setinterfacecommand{languageCharacters}{languageCharacters}
-\setinterfacecommand{languagecharacters}{languagecharacters}
-\setinterfacecommand{leftaligned}{zarovnanovlevo}
-\setinterfacecommand{leftbottombox}{leftbottombox}
-\setinterfacecommand{leftedgedistance}{vzdalenostlevehookraje}
-\setinterfacecommand{leftedgewidth}{sirkalevehookraje}
-\setinterfacecommand{leftline}{leftline}
-\setinterfacecommand{leftmargindistance}{vzdalenostlevemarginalie}
-\setinterfacecommand{leftmarginwidth}{sirkalevemarginalie}
-\setinterfacecommand{leg}{leg}
-\setinterfacecommand{linecorrection}{linecorrection}
-\setinterfacecommand{linenote}{linenote}
-\setinterfacecommand{linespanningtext}{linespanningtext}
-\setinterfacecommand{linewidth}{tloustkacary}
-\setinterfacecommand{listheight}{vyskaseznamu}
-\setinterfacecommand{listlength}{delkaseznamu}
-\setinterfacecommand{listsymbol}{listsymbol}
-\setinterfacecommand{listwidth}{sirkaseznamu}
-\setinterfacecommand{loadfontgoodies}{loadfontgoodies}
-\setinterfacecommand{localfootnotes}{localfootnotes}
-\setinterfacecommand{localnotes}{localnotes}
-\setinterfacecommand{logfields}{zaznamovepole}
-\setinterfacecommand{lohi}{nivy}
-\setinterfacecommand{low}{nizky}
-\setinterfacecommand{macroname}{jmeno}
-\setinterfacecommand{mainlanguage}{hlavnijazyk}
-\setinterfacecommand{makeupheight}{vyskasazby}
-\setinterfacecommand{makeupwidth}{sirkasazby}
-\setinterfacecommand{mar}{okr}
-\setinterfacecommand{marginblock}{marginblock}
-\setinterfacecommand{margindistance}{vzdalenostmarginalie}
-\setinterfacecommand{marginrule}{marginalnilinka}
-\setinterfacecommand{margintext}{marginalnitext}
-\setinterfacecommand{margintitle}{marginalninadpis}
-\setinterfacecommand{marginwidth}{sirkamarginalie}
-\setinterfacecommand{marginword}{marginalnislovo}
-\setinterfacecommand{marking}{znaceni}
-\setinterfacecommand{markversion}{oznacverzi}
-\setinterfacecommand{mathematics}{matematika}
-\setinterfacecommand{menubutton}{tlacitkomenu}
-\setinterfacecommand{mframed}{maoramovani}
-\setinterfacecommand{midaligned}{zarovnanonastred}
-\setinterfacecommand{mirror}{zrcadlit}
-\setinterfacecommand{month}{mesic}
-\setinterfacecommand{moveformula}{moveformula}
-\setinterfacecommand{moveongrid}{premistinamrizku}
-\setinterfacecommand{movesidefloat}{movesidefloat}
-\setinterfacecommand{navigating}{navigating}
-\setinterfacecommand{nodimension}{zadnyrozmer}
-\setinterfacecommand{noheaderandfooterlines}{zadnezahlaviaupati}
-\setinterfacecommand{noindenting}{zadneodsazovani}
-\setinterfacecommand{noitem}{noitem}
-\setinterfacecommand{nolist}{zadnyseznam}
-\setinterfacecommand{nomarking}{zadneznaceni}
-\setinterfacecommand{nomoreblocks}{zadnedalsibloky}
-\setinterfacecommand{nomorefiles}{zadnedalsisoubory}
-\setinterfacecommand{nop}{nop}
-\setinterfacecommand{nospace}{zadnamezera}
-\setinterfacecommand{note}{poznamka}
-\setinterfacecommand{notesymbol}{notesymbol}
-\setinterfacecommand{notopandbottomlines}{zadnehorniadolniradky}
-\setinterfacecommand{notsmallcapped}{nokap}
-\setinterfacecommand{nowhitespace}{zadnebilemisto}
-\setinterfacecommand{numberofsubpages}{numberofsubpages}
-\setinterfacecommand{numbers}{cisla}
-\setinterfacecommand{outeredgedistance}{outeredgedistance}
-\setinterfacecommand{outeredgewidth}{outeredgewidth}
-\setinterfacecommand{outermargindistance}{outermargindistance}
-\setinterfacecommand{outermarginwidth}{outermarginwidth}
-\setinterfacecommand{packed}{zhustene}
-\setinterfacecommand{page}{strana}
-\setinterfacecommand{pagebreak}{pagebreak}
-\setinterfacecommand{pagedepth}{pagedepth}
-\setinterfacecommand{pagenumber}{cislostrany}
-\setinterfacecommand{pageoffset}{pageoffset}
-\setinterfacecommand{pagereference}{odkaznastranu}
-\setinterfacecommand{paperheight}{vyskapapiru}
-\setinterfacecommand{paperwidth}{sirkapapiru}
-\setinterfacecommand{periods}{tecky}
-\setinterfacecommand{placebookmarks}{umistizalozky}
-\setinterfacecommand{placecombinedlist}{umistikombinovanyseznam}
-\setinterfacecommand{placefloat}{placefloat}
-\setinterfacecommand{placefootnotes}{umistipoznamkypodcarou}
-\setinterfacecommand{placeformula}{umistirovnici}
-\setinterfacecommand{placeheadnumber}{placeheadnumber}
-\setinterfacecommand{placeheadtext}{placeheadtext}
-\setinterfacecommand{placelegend}{umistilegendu}
-\setinterfacecommand{placelist}{umistiseznam}
-\setinterfacecommand{placelistofsynonyms}{placelistofsynonyms}
-\setinterfacecommand{placelocalfootnotes}{umistilokalnipoznamkypodcarou}
-\setinterfacecommand{placelocalnotes}{placelocalnotes}
-\setinterfacecommand{placelogos}{umistiloga}
-\setinterfacecommand{placenamedfloat}{placenamedfloat}
-\setinterfacecommand{placenotes}{placenotes}
-\setinterfacecommand{placeongrid}{umistinamrizku}
-\setinterfacecommand{placeontopofeachother}{umistinadsebe}
-\setinterfacecommand{placepagenumber}{placepagenumber}
-\setinterfacecommand{placerawlist}{placerawlist}
-\setinterfacecommand{placereferencelist}{placereferencelist}
-\setinterfacecommand{placeregister}{umistirejstrik}
-\setinterfacecommand{placerule}{placerule}
-\setinterfacecommand{placesidebyside}{umistivedlesebe}
-\setinterfacecommand{placesubformula}{umistipodrovnici}
-\setinterfacecommand{placetextvariable}{placetextvariable}
-\setinterfacecommand{position}{pozice}
-\setinterfacecommand{positiontext}{positiontext}
-\setinterfacecommand{postponenotes}{postponenotes}
-\setinterfacecommand{postponingnotes}{postponingnotes}
-\setinterfacecommand{predefinedfont}{predefinedfont}
-\setinterfacecommand{predefinefont}{predefinefont}
-\setinterfacecommand{presetdocument}{presetdocument}
-\setinterfacecommand{prettyprintbuffer}{prettyprintbuffer}
-\setinterfacecommand{preventmode}{preventmode}
-\setinterfacecommand{printpaperheight}{vyskatiskpapiru}
-\setinterfacecommand{printpaperwidth}{sirkatiskpapiru}
-\setinterfacecommand{processblocks}{zpracujbloky}
-\setinterfacecommand{processbodyfontenvironmentlist}{processbodyfontenvironmentlist}
-\setinterfacecommand{processpage}{zpracujstranu}
-\setinterfacecommand{product}{produkt}
-\setinterfacecommand{program}{program}
-\setinterfacecommand{project}{projekt}
-\setinterfacecommand{publication}{publikace}
-\setinterfacecommand{quotation}{citace}
-\setinterfacecommand{quote}{citovat}
-\setinterfacecommand{ran}{ran}
-\setinterfacecommand{redo}{opakovat}
-\setinterfacecommand{redoconvertfont}{redoconvertfont}
-\setinterfacecommand{ref}{ref}
-\setinterfacecommand{reference}{odkaz}
-\setinterfacecommand{referral}{odkaz}
-\setinterfacecommand{referraldate}{odkaznadatum}
-\setinterfacecommand{referring}{odkazujici}
-\setinterfacecommand{registerfontclass}{registerfontclass}
-\setinterfacecommand{registerhyphenationexception}{registerhyphenationexception}
-\setinterfacecommand{registerhyphenationpattern}{registerhyphenationpattern}
-\setinterfacecommand{remark}{oznaceni}
-\setinterfacecommand{replacefeature}{replacefeature}
-\setinterfacecommand{reset}{reset}
-\setinterfacecommand{resetandaddfeature}{resetandaddfeature}
-\setinterfacecommand{resetcharacteralign}{resetcharacteralign}
-\setinterfacecommand{resetcharacterkerning}{resetcharacterkerning}
-\setinterfacecommand{resetcharacterspacing}{resetcharacterspacing}
-\setinterfacecommand{resetcharacterstripping}{resetcharacterstripping}
-\setinterfacecommand{resetfeature}{resetfeature}
-\setinterfacecommand{resetfontcolorsheme}{resetfontcolorsheme}
-\setinterfacecommand{resetfontfallback}{resetfontfallback}
-\setinterfacecommand{resetfontsolution}{resetfontsolution}
-\setinterfacecommand{resethyphenationfeatures}{resethyphenationfeatures}
-\setinterfacecommand{resetlocalfloats}{resetlocalfloats}
-\setinterfacecommand{resetmarking}{resetznaceni}
-\setinterfacecommand{resetmode}{resetmode}
-\setinterfacecommand{resetnumber}{resetnumber}
-\setinterfacecommand{resetpath}{resetpath}
-\setinterfacecommand{resetperiodkerning}{resetperiodkerning}
-\setinterfacecommand{resetsystemmode}{resetsystemmode}
-\setinterfacecommand{resettextcontent}{resettextcontent}
-\setinterfacecommand{resetvisualizers}{resetvisualizers}
-\setinterfacecommand{restoreglobalbodyfont}{restoreglobalbodyfont}
-\setinterfacecommand{retestfeature}{retestfeature}
-\setinterfacecommand{revivefeature}{revivefeature}
-\setinterfacecommand{rightaligned}{zarovnanovpravo}
-\setinterfacecommand{rightbottombox}{rightbottombox}
-\setinterfacecommand{rightedgedistance}{vzdalenostpravehookraje}
-\setinterfacecommand{rightedgewidth}{sirkapravehookraje}
-\setinterfacecommand{rightline}{rightline}
-\setinterfacecommand{rightmargindistance}{vzdalenostpravemarginalie}
-\setinterfacecommand{rightmarginwidth}{sirkapravemarginalie}
-\setinterfacecommand{romannumerals}{rimskecislice}
-\setinterfacecommand{rotate}{otocit}
-\setinterfacecommand{savebuffer}{savebuffer}
-\setinterfacecommand{scale}{meritko}
-\setinterfacecommand{screen}{obrazovka}
-\setinterfacecommand{selectblocks}{vyberbloky}
-\setinterfacecommand{selectpaper}{vyberpapir}
-\setinterfacecommand{selectversion}{vyberverzi}
-\setinterfacecommand{setbigbodyfont}{setbigbodyfont}
-\setinterfacecommand{setcharacteralign}{setcharacteralign}
-\setinterfacecommand{setcharacteraligndetail}{setcharacteraligndetail}
-\setinterfacecommand{setcharactercasing}{setcharactercasing}
-\setinterfacecommand{setcharactercleaning}{setcharactercleaning}
-\setinterfacecommand{setcharacterkerning}{setcharacterkerning}
-\setinterfacecommand{setcharacterspacing}{setcharacterspacing}
-\setinterfacecommand{setcharacterstripping}{setcharacterstripping}
-\setinterfacecommand{setcurrentfontclass}{setcurrentfontclass}
-\setinterfacecommand{setfirstline}{setfirstline}
-\setinterfacecommand{setfirstpasscharacteralign}{setfirstpasscharacteralign}
-\setinterfacecommand{setfont}{setfont}
-\setinterfacecommand{setfontcolorsheme}{setfontcolorsheme}
-\setinterfacecommand{setfontfeature}{setfontfeature}
-\setinterfacecommand{setfontsolution}{setfontsolution}
-\setinterfacecommand{setfontstrut}{setfontstrut}
-\setinterfacecommand{sethyphenationfeatures}{sethyphenationfeatures}
-\setinterfacecommand{setmainbodyfont}{setmainbodyfont}
-\setinterfacecommand{setmode}{setmode}
-\setinterfacecommand{setnote}{setnote}
-\setinterfacecommand{setnotetext}{setnotetext}
-\setinterfacecommand{setnumber}{setnumber}
-\setinterfacecommand{setperiodkerning}{setperiodkerning}
-\setinterfacecommand{setsecondpasscharacteralign}{setsecondpasscharacteralign}
-\setinterfacecommand{setsmallbodyfont}{setsmallbodyfont}
-\setinterfacecommand{setsystemmode}{setsystemmode}
-\setinterfacecommand{settextcontent}{settextcontent}
-\setinterfacecommand{settextvariable}{settextvariable}
-\setinterfacecommand{setupalign}{nastavzarovnani}
-\setinterfacecommand{setupanswerarea}{setupanswerarea}
-\setinterfacecommand{setuparranging}{nastavusporadani}
-\setinterfacecommand{setupattachment}{setupattachment}
-\setinterfacecommand{setupbackground}{nastavpozadi}
-\setinterfacecommand{setupbackgrounds}{nastavpozadi}
-\setinterfacecommand{setupblackrules}{nastavcernelinky}
-\setinterfacecommand{setupblank}{nastavpreskok}
-\setinterfacecommand{setupblock}{nastavblok}
-\setinterfacecommand{setupbodyfont}{nastavzakladnifont}
-\setinterfacecommand{setupbodyfontenvironment}{nastavprostredizakladnihofontu}
-\setinterfacecommand{setupbottom}{nastavspodek}
-\setinterfacecommand{setupbottomtexts}{nastavdolnitexty}
-\setinterfacecommand{setupbuffer}{nastavbuffer}
-\setinterfacecommand{setupbuttons}{nastavtlacitka}
-\setinterfacecommand{setupcapitals}{nastavkapitalky}
-\setinterfacecommand{setupcaption}{nastavpopisek}
-\setinterfacecommand{setupcaptions}{nastavpopisky}
-\setinterfacecommand{setupcharacteralign}{setupcharacteralign}
-\setinterfacecommand{setupcharacterkerning}{setupcharacterkerning}
-\setinterfacecommand{setupcharacterspacing}{setupcharacterspacing}
-\setinterfacecommand{setupclipping}{nastavorez}
-\setinterfacecommand{setupcolor}{nastavbarvu}
-\setinterfacecommand{setupcolors}{nastavbarvy}
-\setinterfacecommand{setupcolumns}{nastavsloupce}
-\setinterfacecommand{setupcolumnset}{setupcolumnset}
-\setinterfacecommand{setupcolumnsetlines}{setupcolumnsetlines}
-\setinterfacecommand{setupcolumnsetstart}{setupcolumnsetstart}
-\setinterfacecommand{setupcombinations}{nastavspojeni}
-\setinterfacecommand{setupcombinedlist}{nastavkombinovanyseznam}
-\setinterfacecommand{setupcomment}{nastavkomentar}
-\setinterfacecommand{setupcounter}{setupcounter}
-\setinterfacecommand{setupdescription}{setupdescription}
-\setinterfacecommand{setupdescriptions}{nastavpopisy}
-\setinterfacecommand{setupenumeration}{setupenumeration}
-\setinterfacecommand{setupenumerations}{nastavvycty}
-\setinterfacecommand{setupexternalfigures}{nastavexterniobrazy}
-\setinterfacecommand{setupfield}{nastavpole}
-\setinterfacecommand{setupfields}{nastavvsechnapole}
-\setinterfacecommand{setupfillinlines}{nastavvyplnoveradky}
-\setinterfacecommand{setupfillinrules}{nastavvyplnovelinky}
-\setinterfacecommand{setupfirstline}{setupfirstline}
-\setinterfacecommand{setupfloat}{nastavplvouciobjekt}
-\setinterfacecommand{setupfloats}{nastavplvouciobjekty}
-\setinterfacecommand{setupfloatsplitting}{nastavdeleniplvoucichobjektu}
-\setinterfacecommand{setupfontexpansion}{setupfontexpansion}
-\setinterfacecommand{setupfontprotrusion}{setupfontprotrusion}
-\setinterfacecommand{setupfonts}{setupfonts}
-\setinterfacecommand{setupfontsolution}{setupfontsolution}
-\setinterfacecommand{setupfooter}{nastavupati}
-\setinterfacecommand{setupfootertexts}{nastavtextyupati}
-\setinterfacecommand{setupfootnotedefinition}{nastavdefinicipoznamekpodcarou}
-\setinterfacecommand{setupfootnotes}{nastavpoznamkypodcarou}
-\setinterfacecommand{setupforms}{setupforms}
-\setinterfacecommand{setupformula}{setupformula}
-\setinterfacecommand{setupformulas}{nastavrovnice}
-\setinterfacecommand{setupframed}{nastavoramovani}
-\setinterfacecommand{setupframedtext}{setupframedtext}
-\setinterfacecommand{setupframedtexts}{nastavoramovanetexty}
-\setinterfacecommand{setuphead}{nastavnadpis}
-\setinterfacecommand{setupheader}{nastavzahlavi}
-\setinterfacecommand{setupheadertexts}{nastavtextyzahlavi}
-\setinterfacecommand{setupheadnumber}{nastavcislonadpisu}
-\setinterfacecommand{setupheads}{nastavnadpisy}
-\setinterfacecommand{setupheadtext}{nastavtexthlavicky}
-\setinterfacecommand{setuphyphenation}{setuphyphenation}
-\setinterfacecommand{setuphyphenmark}{nastavdelitko}
-\setinterfacecommand{setupindentedtext}{setupindentedtext}
-\setinterfacecommand{setupindenting}{nastavodsazovani}
-\setinterfacecommand{setupinmargin}{nastavmarginalie}
-\setinterfacecommand{setupinteraction}{nastavinterakci}
-\setinterfacecommand{setupinteractionbar}{nastavinterakcnilistu}
-\setinterfacecommand{setupinteractionmenu}{nastavinterakcnimenu}
-\setinterfacecommand{setupinteractionscreen}{nastavinterakcniobrazovku}
-\setinterfacecommand{setupinterlinespace}{nastavmeziradkovoumezeru}
-\setinterfacecommand{setupitemgroup}{setupitemgroup}
-\setinterfacecommand{setupitemgroups}{nastavvycty}
-\setinterfacecommand{setupitems}{nastavpolozky}
-\setinterfacecommand{setuplabeltext}{nastavtextpopisku}
-\setinterfacecommand{setuplanguage}{nastavjazyk}
-\setinterfacecommand{setuplayout}{nastavvzhled}
-\setinterfacecommand{setuplegend}{nastavlegendu}
-\setinterfacecommand{setuplinenote}{setuplinenote}
-\setinterfacecommand{setuplinenumbering}{nastavcislovaniradku}
-\setinterfacecommand{setuplines}{nastavradky}
-\setinterfacecommand{setuplinewidth}{nastavsirkucary}
-\setinterfacecommand{setuplist}{nastavseznam}
-\setinterfacecommand{setupmakeup}{nastavupravu}
-\setinterfacecommand{setupmarginblock}{setupmarginblock}
-\setinterfacecommand{setupmarginblocks}{nastavmarginalniblok}
-\setinterfacecommand{setupmargindata}{setupmargindata}
-\setinterfacecommand{setupmarginrules}{nastavmarginalnilinky}
-\setinterfacecommand{setupmarking}{nastavznaceni}
-\setinterfacecommand{setupmathalignment}{setupmathalignment}
-\setinterfacecommand{setupnarrower}{nastavzuzeni}
-\setinterfacecommand{setupnotation}{setupnotation}
-\setinterfacecommand{setupnotations}{setupnotations}
-\setinterfacecommand{setupnote}{setupnote}
-\setinterfacecommand{setupnotes}{setupnotes}
-\setinterfacecommand{setupnumber}{setupnumber}
-\setinterfacecommand{setupnumbering}{nastavcislovani}
-\setinterfacecommand{setupoppositeplacing}{nastavumisteniprotejsku}
-\setinterfacecommand{setupoutput}{nastavvystup}
-\setinterfacecommand{setuppagecomment}{nastavkomentarstrany}
-\setinterfacecommand{setuppagenumber}{nastavcislostrany}
-\setinterfacecommand{setuppagenumbering}{nastavcislovanistran}
-\setinterfacecommand{setuppagetransitions}{nastavprechodstrany}
-\setinterfacecommand{setuppalet}{nastavpaletu}
-\setinterfacecommand{setuppaper}{setuppaper}
-\setinterfacecommand{setuppapersize}{nastavvelikostpapiru}
-\setinterfacecommand{setupparagraphnumbering}{nastavcislovaniodstavcu}
-\setinterfacecommand{setupparagraphs}{nastavodstavce}
-\setinterfacecommand{setupperiodkerning}{setupperiodkerning}
-\setinterfacecommand{setupplacement}{setupplacement}
-\setinterfacecommand{setuppositioning}{nastavumistovani}
-\setinterfacecommand{setupprofiles}{nastavprofily}
-\setinterfacecommand{setupprograms}{nastavprogramy}
-\setinterfacecommand{setuppublications}{nastavpublikace}
-\setinterfacecommand{setupquote}{nastavcitaci}
-\setinterfacecommand{setupreferencelist}{nastavseznamodkazu}
-\setinterfacecommand{setupreferencing}{nastavodkazovani}
-\setinterfacecommand{setupregister}{nastavrejstrik}
-\setinterfacecommand{setuprotate}{nastavotoceni}
-\setinterfacecommand{setuprule}{setuprule}
-\setinterfacecommand{setupscreens}{nastavrastr}
-\setinterfacecommand{setupsection}{nastavsekci}
-\setinterfacecommand{setupsectionblock}{nastavbloksekce}
-\setinterfacecommand{setupsorting}{nastavtrideni}
-\setinterfacecommand{setupspacing}{nastavradkovani}
-\setinterfacecommand{setupstartstop}{setupstartstop}
-\setinterfacecommand{setupstrut}{setupstrut}
-\setinterfacecommand{setupsubpagenumber}{nastavpodcislostrany}
-\setinterfacecommand{setupsymbolset}{nastavsadusymbolu}
-\setinterfacecommand{setupsynchronization}{nastavsynchronizaci}
-\setinterfacecommand{setupsynchronizationbar}{nastavsynchronizacnilistu}
-\setinterfacecommand{setupsynonyms}{nastavsynonyma}
-\setinterfacecommand{setupsystem}{nastavsystem}
-\setinterfacecommand{setuptab}{nastavtab}
-\setinterfacecommand{setuptables}{nastavtabulky}
-\setinterfacecommand{setuptabulate}{nastavtabelaci}
-\setinterfacecommand{setuptext}{nastavtext}
-\setinterfacecommand{setuptextbackground}{setuptextbackground}
-\setinterfacecommand{setuptextnote}{setuptextnote}
-\setinterfacecommand{setuptextposition}{setuptextposition}
-\setinterfacecommand{setuptextrules}{nastavtextovelinky}
-\setinterfacecommand{setuptexttexts}{nastavtexttexty}
-\setinterfacecommand{setuptextvariable}{setuptextvariable}
-\setinterfacecommand{setupthinrules}{nastavtenkelinky}
-\setinterfacecommand{setuptolerance}{nastavtoleranci}
-\setinterfacecommand{setuptop}{nastavhorejsek}
-\setinterfacecommand{setuptoptexts}{nastavhornitexty}
-\setinterfacecommand{setuptype}{nastavtype}
-\setinterfacecommand{setuptyping}{nastavopis}
-\setinterfacecommand{setupunderbar}{nastavpodtrzeni}
-\setinterfacecommand{setupurl}{nastavurl}
-\setinterfacecommand{setupversions}{nastavverze}
-\setinterfacecommand{setupwhitespace}{nastavbilamista}
-\setinterfacecommand{setvisualizerfont}{setvisualizerfont}
-\setinterfacecommand{showbodyfont}{ukazzakladnifont}
-\setinterfacecommand{showbodyfontenvironment}{ukazpostredizakladnihofontu}
-\setinterfacecommand{showcolor}{ukazbarvu}
-\setinterfacecommand{showcolorgroup}{ukazskupinubarev}
-\setinterfacecommand{showcounter}{showcounter}
-\setinterfacecommand{showexternalfigures}{ukazexterniobrazy}
-\setinterfacecommand{showfields}{ukazpole}
-\setinterfacecommand{showfont}{showfont}
-\setinterfacecommand{showfontdata}{showfontdata}
-\setinterfacecommand{showfontexpansion}{showfontexpansion}
-\setinterfacecommand{showfontitalics}{showfontitalics}
-\setinterfacecommand{showfontkerns}{showfontkerns}
-\setinterfacecommand{showfontparameters}{showfontparameters}
-\setinterfacecommand{showfontstrip}{showfontstrip}
-\setinterfacecommand{showfontstyle}{showfontstyle}
-\setinterfacecommand{showframe}{ukazramecek}
-\setinterfacecommand{showgrid}{ukazmrizku}
-\setinterfacecommand{showhyphenationtrace}{showhyphenationtrace}
-\setinterfacecommand{showkerning}{showkerning}
-\setinterfacecommand{showlayout}{ukazvzhled}
-\setinterfacecommand{showmakeup}{ukazupravu}
-\setinterfacecommand{showminimalbaseline}{showminimalbaseline}
-\setinterfacecommand{showpalet}{ukazpaletu}
-\setinterfacecommand{showprint}{ukazvytisk}
-\setinterfacecommand{showsetups}{ukaznastaveni}
-\setinterfacecommand{showstruts}{ukazpodpery}
-\setinterfacecommand{showsymbolset}{ukazsadusymbolu}
-\setinterfacecommand{smallcapped}{kap}
-\setinterfacecommand{someline}{nejakyradek}
-\setinterfacecommand{somewhere}{nekde}
-\setinterfacecommand{space}{mezera}
-\setinterfacecommand{specialitem}{specialitem}
-\setinterfacecommand{splitfloat}{rozdelplvouciobjekt}
-\setinterfacecommand{startalignment}{startzarovnavani}
-\setinterfacecommand{startbackground}{startpozadi}
-\setinterfacecommand{startcoding}{startkodovani}
-\setinterfacecommand{startcolor}{startbarva}
-\setinterfacecommand{startcolumnmakeup}{startcolumnmakeup}
-\setinterfacecommand{startcolumns}{startsloupce}
-\setinterfacecommand{startcolumnset}{startcolumnset}
-\setinterfacecommand{startcombination}{startspojeni}
-\setinterfacecommand{startcomponent}{startkomponenta}
-\setinterfacecommand{startdocument}{startdokument}
-\setinterfacecommand{startenvironment}{startprostredi}
-\setinterfacecommand{startfigure}{startobraz}
-\setinterfacecommand{startframed}{startframed}
-\setinterfacecommand{startglobal}{startglobalni}
-\setinterfacecommand{startline}{startradek}
-\setinterfacecommand{startlinecorrection}{startkorekceradku}
-\setinterfacecommand{startlinenote}{startlinenote}
-\setinterfacecommand{startlinenumbering}{startcislovaniradku}
-\setinterfacecommand{startlines}{startradky}
-\setinterfacecommand{startlocal}{startlokalni}
-\setinterfacecommand{startlocalfootnotes}{startlokalnipoznamkypodcarou}
-\setinterfacecommand{startmakeup}{startuprava}
-\setinterfacecommand{startmarginblock}{startmarginalniblok}
-\setinterfacecommand{startmarginrule}{startmarginalnilinka}
-\setinterfacecommand{startnarrower}{startzuzeni}
-\setinterfacecommand{startopposite}{startprotejsek}
-\setinterfacecommand{startoverlay}{startprekryv}
-\setinterfacecommand{startoverview}{startprehled}
-\setinterfacecommand{startpacked}{startzhustene}
-\setinterfacecommand{startpositioning}{startumistovani}
-\setinterfacecommand{startproduct}{startprodukt}
-\setinterfacecommand{startprofile}{startprofil}
-\setinterfacecommand{startproject}{startprojekt}
-\setinterfacecommand{startquotation}{startcitace}
-\setinterfacecommand{startraster}{startrastr}
-\setinterfacecommand{startsymbolset}{startsadasymbolu}
-\setinterfacecommand{startsynchronization}{startsynchronizace}
-\setinterfacecommand{starttable}{starttabulka}
-\setinterfacecommand{starttables}{starttabulky}
-\setinterfacecommand{starttext}{starttext}
-\setinterfacecommand{starttextbackground}{starttextbackground}
-\setinterfacecommand{starttextrule}{starttextovalinka}
-\setinterfacecommand{startunpacked}{startnezhustene}
-\setinterfacecommand{startversion}{startverze}
-\setinterfacecommand{stopalignment}{stopzarovnavani}
-\setinterfacecommand{stopbackground}{stoppozadi}
-\setinterfacecommand{stopcoding}{stopkodovani}
-\setinterfacecommand{stopcolor}{stopbarva}
-\setinterfacecommand{stopcolumnmakeup}{stopcolumnmakeup}
-\setinterfacecommand{stopcolumns}{stopsloupce}
-\setinterfacecommand{stopcolumnset}{stopcolumnset}
-\setinterfacecommand{stopcombination}{stopspojeni}
-\setinterfacecommand{stopcomponent}{stopkomponenta}
-\setinterfacecommand{stopdocument}{stopdokument}
-\setinterfacecommand{stopenvironment}{stopprostredi}
-\setinterfacecommand{stopframed}{stopframed}
-\setinterfacecommand{stopglobal}{stopglobalni}
-\setinterfacecommand{stopline}{stopradek}
-\setinterfacecommand{stoplinecorrection}{stopkorekceradku}
-\setinterfacecommand{stoplinenote}{stoplinenote}
-\setinterfacecommand{stoplinenumbering}{stopcislovaniradku}
-\setinterfacecommand{stoplines}{stopradky}
-\setinterfacecommand{stoplocal}{stoplokalni}
-\setinterfacecommand{stoplocalfootnotes}{stoplokalnipoznamkypodcarou}
-\setinterfacecommand{stopmakeup}{stopuprava}
-\setinterfacecommand{stopmarginblock}{stopmarginalniblok}
-\setinterfacecommand{stopmarginrule}{stopmarginalnilinka}
-\setinterfacecommand{stopnarrower}{stopzuzeni}
-\setinterfacecommand{stopopposite}{stopprotejsek}
-\setinterfacecommand{stopoverlay}{stopprekryv}
-\setinterfacecommand{stopoverview}{stopprehled}
-\setinterfacecommand{stoppacked}{stopzhustene}
-\setinterfacecommand{stoppositioning}{stopumistovani}
-\setinterfacecommand{stopproduct}{stopprodukt}
-\setinterfacecommand{stopprofile}{stopprofil}
-\setinterfacecommand{stopproject}{stopprojekt}
-\setinterfacecommand{stopquotation}{stopcitace}
-\setinterfacecommand{stopraster}{stoprastr}
-\setinterfacecommand{stopsynchronization}{stopsynchronizace}
-\setinterfacecommand{stoptable}{stoptabulka}
-\setinterfacecommand{stoptables}{stoptabulky}
-\setinterfacecommand{stoptext}{stoptext}
-\setinterfacecommand{stoptextbackground}{stoptextbackground}
-\setinterfacecommand{stoptextrule}{stoptextovalinka}
-\setinterfacecommand{stopunpacked}{stopnezhustene}
-\setinterfacecommand{stopversion}{stopverze}
-\setinterfacecommand{stretched}{roztazene}
-\setinterfacecommand{strictinspectnextcharacter}{strictinspectnextcharacter}
-\setinterfacecommand{stripcharacter}{stripcharacter}
-\setinterfacecommand{subformulanumber}{cislopodrovnice}
-\setinterfacecommand{subpagenumber}{subpagenumber}
-\setinterfacecommand{subtractfeature}{subtractfeature}
-\setinterfacecommand{switchtobodyfont}{prepninazakladnifont}
-\setinterfacecommand{switchtorawfont}{switchtorawfont}
-\setinterfacecommand{sym}{sym}
-\setinterfacecommand{symbol}{symbol}
-\setinterfacecommand{symoffset}{symoffset}
-\setinterfacecommand{synchronizationbar}{synchronizacnilista}
-\setinterfacecommand{synchronize}{synchronizovat}
-\setinterfacecommand{tab}{tab}
-\setinterfacecommand{testcolumn}{testcolumn}
-\setinterfacecommand{testfeature}{testfeature}
-\setinterfacecommand{testfeatureonce}{testfeatureonce}
-\setinterfacecommand{testpage}{testpage}
-\setinterfacecommand{tex}{tex}
-\setinterfacecommand{textbackground}{textbackground}
-\setinterfacecommand{textcolor}{textcolor}
-\setinterfacecommand{textheight}{vyskatextu}
-\setinterfacecommand{textnote}{textnote}
-\setinterfacecommand{textreference}{odkaznatext}
-\setinterfacecommand{textrule}{textovalinka}
-\setinterfacecommand{textvariable}{textvariable}
-\setinterfacecommand{textwidth}{sirkatextu}
-\setinterfacecommand{thefirstcharacter}{thefirstcharacter}
-\setinterfacecommand{thenormalizedbodyfontsize}{thenormalizedbodyfontsize}
-\setinterfacecommand{theremainingcharacters}{theremainingcharacters}
-\setinterfacecommand{thinrule}{tenkalinka}
-\setinterfacecommand{thinrules}{tenkelinky}
-\setinterfacecommand{tolinenote}{tolinenote}
-\setinterfacecommand{tooltip}{bublinkovanapoveda}
-\setinterfacecommand{topdistance}{vzdalenosthorejsku}
-\setinterfacecommand{topheight}{vyskahorejsku}
-\setinterfacecommand{topspace}{odsazenishora}
-\setinterfacecommand{totalnumberofpages}{celkovypocetstran}
-\setinterfacecommand{translate}{prelozit}
-\setinterfacecommand{txt}{txt}
-\setinterfacecommand{typ}{pis}
-\setinterfacecommand{type}{opis}
-\setinterfacecommand{typebuffer}{typebuffer}
-\setinterfacecommand{typedefinedbuffer}{typedefinedbuffer}
-\setinterfacecommand{typefile}{opissoubor}
-\setinterfacecommand{typeinlinebuffer}{typeinlinebuffer}
-\setinterfacecommand{typing}{typing}
-\setinterfacecommand{unitmeaning}{vyznam}
-\setinterfacecommand{unknown}{neznamo}
-\setinterfacecommand{unregisterhyphenationpattern}{unregisterhyphenationpattern}
-\setinterfacecommand{useJSscripts}{uzijJSscripts}
-\setinterfacecommand{useURL}{uzijURL}
-\setinterfacecommand{useXMLfilter}{useXMLfilter}
-\setinterfacecommand{useblocks}{uzijbloky}
-\setinterfacecommand{usebodyfont}{usebodyfont}
-\setinterfacecommand{usebodyfontparameter}{usebodyfontparameter}
-\setinterfacecommand{usecommands}{uzijprikazy}
-\setinterfacecommand{useencoding}{uzijkodovani}
-\setinterfacecommand{useexternaldocument}{uzijexternidokument}
-\setinterfacecommand{useexternalfigure}{uzijexterniobraz}
-\setinterfacecommand{useexternalfile}{uzijexternisoubor}
-\setinterfacecommand{useexternalfiles}{uzijexternisoubory}
-\setinterfacecommand{useexternalsoundtrack}{uzijexternizvuk}
-\setinterfacecommand{usemodule}{uzijmodul}
-\setinterfacecommand{usemodules}{uzijmoduly}
-\setinterfacecommand{usepath}{uzijadresar}
-\setinterfacecommand{usereferences}{uzijodkazy}
-\setinterfacecommand{usespecials}{uzijspeciality}
-\setinterfacecommand{usesymbols}{uzijsymbol}
-\setinterfacecommand{usetypescript}{usetypescript}
-\setinterfacecommand{usetypescriptfile}{usetypescriptfile}
-\setinterfacecommand{useurl}{uzijurl}
-\setinterfacecommand{verbatim}{verbatim}
-\setinterfacecommand{version}{verze}
-\setinterfacecommand{vl}{vl}
-\setinterfacecommand{weekday}{vsedniden}
-\setinterfacecommand{whitespace}{bilemisto}
-\setinterfacecommand{widthspanningtext}{widthspanningtext}
-\setinterfacecommand{wordright}{slovovpravo}
-\setinterfacecommand{writebetweenlist}{zapismeziseznam}
-\setinterfacecommand{writetolist}{zapisdoseznamu}
-\setinterfacecommand{writetoreferencelist}{zapisdoseznamuodkazu}
-\setinterfacecommand{writetoregister}{zapisdorejstriku}
-%
-\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/context/base/mkii/mult-de.mkii b/Master/texmf-dist/tex/context/base/mkii/mult-de.mkii
deleted file mode 100644
index 06a4fb16236..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/mult-de.mkii
+++ /dev/null
@@ -1,2224 +0,0 @@
-% this file is auto-generated, don't edit this file
-%
-% definitions for interface variables for language de
-%
-\setinterfacevariable{Addition}{Zusatz}
-\setinterfacevariable{Alphabetic}{Alphabetic}
-\setinterfacevariable{Balloon}{Ballon}
-\setinterfacevariable{Cap}{Kap}
-\setinterfacevariable{Capital}{Versalien}
-\setinterfacevariable{Character}{Buchstabe}
-\setinterfacevariable{Characters}{Buchstaben}
-\setinterfacevariable{CloseDocument}{SchliesseDokument}
-\setinterfacevariable{ExitViewer}{BeendeViewer}
-\setinterfacevariable{FirstPage}{ErsteSeite}
-\setinterfacevariable{FitHeight}{HoehePassend}
-\setinterfacevariable{FitWidth}{BreitePassend}
-\setinterfacevariable{GotoPage}{GotoPage}
-\setinterfacevariable{Greek}{Griechisch}
-\setinterfacevariable{Help}{Hilfe}
-\setinterfacevariable{HideField}{VerbergeFeld}
-\setinterfacevariable{HideLayer}{HideLayer}
-\setinterfacevariable{Key}{Schluessel}
-\setinterfacevariable{LastPage}{LetzteSeite}
-\setinterfacevariable{LoadForm}{LadeFormular}
-\setinterfacevariable{MONTH}{MONAT}
-\setinterfacevariable{New}{Neu}
-\setinterfacevariable{NextJump}{NaechsterSprung}
-\setinterfacevariable{NextPage}{FolgendeSeite}
-\setinterfacevariable{Numbers}{Ziffern}
-\setinterfacevariable{OpenNamedDocument}{OpenNamedDocument}
-\setinterfacevariable{Ordinal}{Ordinal}
-\setinterfacevariable{Paragraph}{Absatz}
-\setinterfacevariable{PauseMovie}{PauseFilm}
-\setinterfacevariable{PauseRendering}{PauseRendering}
-\setinterfacevariable{PauseSound}{PauseSound}
-\setinterfacevariable{PreviousJump}{VorigerSprung}
-\setinterfacevariable{PreviousPage}{VorigeSeite}
-\setinterfacevariable{PrintDocument}{DruckeDokument}
-\setinterfacevariable{Query}{Query}
-\setinterfacevariable{QueryAgain}{QueryAgain}
-\setinterfacevariable{ResetForm}{ZuruecksetzenFormular}
-\setinterfacevariable{ResumeMovie}{FortsetzenFilm}
-\setinterfacevariable{ResumeRendering}{ResumeRendering}
-\setinterfacevariable{ResumeSound}{ResumeSound}
-\setinterfacevariable{Romannumerals}{Roemischezahlen}
-\setinterfacevariable{SaveDocument}{SpeichereDokument}
-\setinterfacevariable{SaveForm}{SpeicheFormular}
-\setinterfacevariable{SaveNamedDocument}{SaveNamedDocument}
-\setinterfacevariable{SearchAgain}{WeiterSuchen}
-\setinterfacevariable{SearchDocument}{DokumentDurchsuchen}
-\setinterfacevariable{ShowBookmarks}{ShowBookmarks}
-\setinterfacevariable{ShowField}{ZeigeFeld}
-\setinterfacevariable{ShowThumbs}{ShowThumbs}
-\setinterfacevariable{StartMovie}{StartFilm}
-\setinterfacevariable{StartRendering}{StartRendering}
-\setinterfacevariable{StartSound}{StartSound}
-\setinterfacevariable{StopMovie}{StopFilm}
-\setinterfacevariable{StopRendering}{StopRendering}
-\setinterfacevariable{StopSound}{StopSound}
-\setinterfacevariable{SubmitForm}{VersendeFormular}
-\setinterfacevariable{ToggleLayer}{ToggleLayer}
-\setinterfacevariable{ToggleViewer}{WechseleViewer}
-\setinterfacevariable{URL}{URL}
-\setinterfacevariable{VideLayer}{VideLayer}
-\setinterfacevariable{ViewerHelp}{ViewerHilfe}
-\setinterfacevariable{WEEKDAY}{WOCHENTAG}
-\setinterfacevariable{WORD}{WORT}
-\setinterfacevariable{WORDS}{WOERTER}
-\setinterfacevariable{Word}{Wort}
-\setinterfacevariable{Words}{Woerter}
-\setinterfacevariable{abbreviation}{abkuerzung}
-\setinterfacevariable{abbreviations}{abkuerzungen}
-\setinterfacevariable{absolute}{absolut}
-\setinterfacevariable{action}{aktion}
-\setinterfacevariable{after}{nach}
-\setinterfacevariable{all}{alles}
-\setinterfacevariable{alphabetic}{alphabetic}
-\setinterfacevariable{always}{immer}
-\setinterfacevariable{anchor}{anchor}
-\setinterfacevariable{and}{und}
-\setinterfacevariable{answerarea}{answerarea}
-\setinterfacevariable{appendices}{anhaenge}
-\setinterfacevariable{appendix}{anhang}
-\setinterfacevariable{april}{april}
-\setinterfacevariable{aside}{aside}
-\setinterfacevariable{atleftmargin}{atleftmargin}
-\setinterfacevariable{atmargin}{amrand}
-\setinterfacevariable{atpage}{aufseite}
-\setinterfacevariable{atrightmargin}{atrightmargin}
-\setinterfacevariable{attachment}{attachment}
-\setinterfacevariable{august}{august}
-\setinterfacevariable{author}{autor}
-\setinterfacevariable{auto}{auto}
-\setinterfacevariable{autointro}{autointro}
-\setinterfacevariable{autopunctuation}{autopunctuation}
-\setinterfacevariable{back}{zurueck}
-\setinterfacevariable{background}{hintergrund}
-\setinterfacevariable{backmatter}{epiloge}
-\setinterfacevariable{backpart}{epilog}
-\setinterfacevariable{backspace}{rumpfspatium}
-\setinterfacevariable{backward}{rueckwaerts}
-\setinterfacevariable{bbl}{bbl}
-\setinterfacevariable{before}{vor}
-\setinterfacevariable{begin}{begin}
-\setinterfacevariable{bib}{bib}
-\setinterfacevariable{big}{gross}
-\setinterfacevariable{bigbodyfont}{bigbodyfont}
-\setinterfacevariable{bigger}{bigger}
-\setinterfacevariable{bigpreference}{grosszuegig}
-\setinterfacevariable{blank}{blanko}
-\setinterfacevariable{block}{block}
-\setinterfacevariable{blockquote}{blockquote}
-\setinterfacevariable{bodymatter}{haupttexte}
-\setinterfacevariable{bodypart}{haupttext}
-\setinterfacevariable{bold}{fett}
-\setinterfacevariable{bolditalic}{fettitalic}
-\setinterfacevariable{boldslanted}{fettgeneigt}
-\setinterfacevariable{bookmark}{bookmark}
-\setinterfacevariable{both}{beide}
-\setinterfacevariable{bothtext}{bothtext}
-\setinterfacevariable{bottom}{unten}
-\setinterfacevariable{box}{box}
-\setinterfacevariable{brief}{brief}
-\setinterfacevariable{broad}{breit}
-\setinterfacevariable{buffer}{puffer}
-\setinterfacevariable{by}{pro}
-\setinterfacevariable{calligraphic}{kalligraphie}
-\setinterfacevariable{camel}{camel}
-\setinterfacevariable{cap}{kap}
-\setinterfacevariable{capital}{versalien}
-\setinterfacevariable{category}{category}
-\setinterfacevariable{cd:character}{cd:character}
-\setinterfacevariable{cd:font}{cd:font}
-\setinterfacevariable{center}{center}
-\setinterfacevariable{centerlast}{centerlast}
-\setinterfacevariable{chapter}{kapitel}
-\setinterfacevariable{character}{buchstabe}
-\setinterfacevariable{characters}{buchstaben}
-\setinterfacevariable{chemical}{chemical}
-\setinterfacevariable{chemicals}{chemicals}
-\setinterfacevariable{chemistry}{chemistry}
-\setinterfacevariable{cite}{cite}
-\setinterfacevariable{closed}{closed}
-\setinterfacevariable{color}{farbe}
-\setinterfacevariable{column}{column}
-\setinterfacevariable{columns}{spalten}
-\setinterfacevariable{combination}{combination}
-\setinterfacevariable{command}{befehl}
-\setinterfacevariable{commands}{befehle}
-\setinterfacevariable{comment}{kommentar}
-\setinterfacevariable{component}{komponente}
-\setinterfacevariable{compressseparator}{compressseparator}
-\setinterfacevariable{compressstopper}{compressstopper}
-\setinterfacevariable{concept}{konzept}
-\setinterfacevariable{construction}{construction}
-\setinterfacevariable{content}{inhalt}
-\setinterfacevariable{contents}{inhalte}
-\setinterfacevariable{continue}{fortsetzten}
-\setinterfacevariable{continued}{continued}
-\setinterfacevariable{controls}{controls}
-\setinterfacevariable{conversion}{konversion}
-\setinterfacevariable{current}{aktuell}
-\setinterfacevariable{cutspace}{cutspace}
-\setinterfacevariable{dataset}{dataset}
-\setinterfacevariable{date}{datum}
-\setinterfacevariable{day}{tag}
-\setinterfacevariable{december}{dezember}
-\setinterfacevariable{default}{default}
-\setinterfacevariable{depth}{tiefe}
-\setinterfacevariable{description}{beschreibung}
-\setinterfacevariable{disable}{sperren}
-\setinterfacevariable{display}{bildschirm}
-\setinterfacevariable{dot}{punkt}
-\setinterfacevariable{doublesided}{doppelseitig}
-\setinterfacevariable{down}{down}
-\setinterfacevariable{each}{jede}
-\setinterfacevariable{edge}{kante}
-\setinterfacevariable{effective}{effective}
-\setinterfacevariable{eight}{acht}
-\setinterfacevariable{embed}{embed}
-\setinterfacevariable{empty}{leer}
-\setinterfacevariable{enable}{enable}
-\setinterfacevariable{end}{end}
-\setinterfacevariable{endnote}{endnote}
-\setinterfacevariable{enumeration}{nummerierung}
-\setinterfacevariable{environment}{umgebung}
-\setinterfacevariable{even}{gerade}
-\setinterfacevariable{export}{export}
-\setinterfacevariable{external}{extern}
-\setinterfacevariable{extremestretch}{extremestretch}
-\setinterfacevariable{fact}{gegeben}
-\setinterfacevariable{fallback}{fallback}
-\setinterfacevariable{february}{februar}
-\setinterfacevariable{field}{field}
-\setinterfacevariable{figure}{abbildung}
-\setinterfacevariable{figures}{abbildungen}
-\setinterfacevariable{file}{datei}
-\setinterfacevariable{final}{endfassung}
-\setinterfacevariable{first}{erste}
-\setinterfacevariable{firstcolumn}{firstcolumn}
-\setinterfacevariable{firstpage}{ersteseite}
-\setinterfacevariable{firstsubpage}{ersteunterseite}
-\setinterfacevariable{fit}{passend}
-\setinterfacevariable{five}{fuenf}
-\setinterfacevariable{fix}{stellewiederher}
-\setinterfacevariable{fixed}{fest}
-\setinterfacevariable{flexible}{flexibel}
-\setinterfacevariable{float}{gleitobjekt}
-\setinterfacevariable{flushinner}{flushinner}
-\setinterfacevariable{flushleft}{flushleft}
-\setinterfacevariable{flushouter}{flushouter}
-\setinterfacevariable{flushright}{flushright}
-\setinterfacevariable{followingpage}{followingpage}
-\setinterfacevariable{font}{font}
-\setinterfacevariable{footer}{fusszeile}
-\setinterfacevariable{footnote}{fussnote}
-\setinterfacevariable{force}{zwinge}
-\setinterfacevariable{foreground}{vordergrund}
-\setinterfacevariable{formula}{formel}
-\setinterfacevariable{formulas}{formeln}
-\setinterfacevariable{forward}{vorwaerts}
-\setinterfacevariable{four}{vier}
-\setinterfacevariable{fractions}{fractions}
-\setinterfacevariable{frame}{rahmen}
-\setinterfacevariable{framedtext}{umrahmtertext}
-\setinterfacevariable{friday}{freitag}
-\setinterfacevariable{frontmatter}{einleitungen}
-\setinterfacevariable{frontpart}{einleitung}
-\setinterfacevariable{fullhz}{fullhz}
-\setinterfacevariable{global}{global}
-\setinterfacevariable{graphic}{grafik}
-\setinterfacevariable{graphics}{grafiken}
-\setinterfacevariable{gray}{grau}
-\setinterfacevariable{greek}{griechisch}
-\setinterfacevariable{grid}{gritter}
-\setinterfacevariable{halfline}{halbezeile}
-\setinterfacevariable{handwritten}{handschrift}
-\setinterfacevariable{hang}{haengend}
-\setinterfacevariable{hanging}{haengend}
-\setinterfacevariable{hangingboth}{hangingboth}
-\setinterfacevariable{head}{kopf}
-\setinterfacevariable{header}{kopfzeile}
-\setinterfacevariable{headintext}{headintext}
-\setinterfacevariable{height}{hoehe}
-\setinterfacevariable{helptext}{hilfetext}
-\setinterfacevariable{hencefore}{vorher}
-\setinterfacevariable{here}{hier}
-\setinterfacevariable{hereafter}{nachher}
-\setinterfacevariable{hidden}{versteckt}
-\setinterfacevariable{hiddenbar}{hiddenbar}
-\setinterfacevariable{hiding}{verbergen}
-\setinterfacevariable{high}{hoch}
-\setinterfacevariable{horizontal}{horizontal}
-\setinterfacevariable{hyphenated}{hyphenate}
-\setinterfacevariable{hz}{hz}
-\setinterfacevariable{inbetween}{zwischen}
-\setinterfacevariable{index}{index}
-\setinterfacevariable{indices}{indizies}
-\setinterfacevariable{inherit}{inherit}
-\setinterfacevariable{ininner}{ininner}
-\setinterfacevariable{ininneredge}{ininneredge}
-\setinterfacevariable{ininnermargin}{ininnermargin}
-\setinterfacevariable{inleft}{imlinken}
-\setinterfacevariable{inleftedge}{imlinkenrand}
-\setinterfacevariable{inleftmargin}{inlinkermarginale}
-\setinterfacevariable{inline}{inline}
-\setinterfacevariable{inmargin}{imrand}
-\setinterfacevariable{inner}{innen}
-\setinterfacevariable{inneredge}{inneredge}
-\setinterfacevariable{innermargin}{innermargin}
-\setinterfacevariable{inother}{inother}
-\setinterfacevariable{inouter}{inouter}
-\setinterfacevariable{inouteredge}{inouteredge}
-\setinterfacevariable{inoutermargin}{inoutermargin}
-\setinterfacevariable{inright}{imrechten}
-\setinterfacevariable{inrightedge}{imrechtenrand}
-\setinterfacevariable{inrightmargin}{inrechtermarginale}
-\setinterfacevariable{integral}{integral}
-\setinterfacevariable{interaction}{interaktion}
-\setinterfacevariable{interactionmenu}{interaktionsmenue}
-\setinterfacevariable{interactive}{interactive}
-\setinterfacevariable{intermezzi}{intermezzi}
-\setinterfacevariable{intermezzo}{intermezzo}
-\setinterfacevariable{intext}{imtext}
-\setinterfacevariable{intro}{intro}
-\setinterfacevariable{invertedshort}{invertedshort}
-\setinterfacevariable{italic}{italic}
-\setinterfacevariable{italicbold}{italicfett}
-\setinterfacevariable{item}{pos}
-\setinterfacevariable{itemize}{aufzaehlung}
-\setinterfacevariable{its}{its}
-\setinterfacevariable{january}{januar}
-\setinterfacevariable{joinedup}{keinabstand}
-\setinterfacevariable{july}{juli}
-\setinterfacevariable{june}{juni}
-\setinterfacevariable{keep}{behalte}
-\setinterfacevariable{kerncharacters}{kerncharacters}
-\setinterfacevariable{knockout}{knockout}
-\setinterfacevariable{label}{label}
-\setinterfacevariable{landscape}{querformat}
-\setinterfacevariable{last}{letzte}
-\setinterfacevariable{lastcolumn}{lastcolumn}
-\setinterfacevariable{lastpage}{letzteseite}
-\setinterfacevariable{lastpagenumber}{lastpagenumber}
-\setinterfacevariable{lastsubpage}{letzteunterseite}
-\setinterfacevariable{layer}{layer}
-\setinterfacevariable{left}{links}
-\setinterfacevariable{leftedge}{linkekante}
-\setinterfacevariable{lefthanging}{lefthanging}
-\setinterfacevariable{leftmargin}{linkerrand}
-\setinterfacevariable{leftpage}{linkerseite}
-\setinterfacevariable{lefttoright}{lefttoright}
-\setinterfacevariable{legend}{legende}
-\setinterfacevariable{less}{less}
-\setinterfacevariable{lesshyphenation}{lesshyphenation}
-\setinterfacevariable{letterspacing}{letterspacing}
-\setinterfacevariable{line}{zeile}
-\setinterfacevariable{linenote}{linenote}
-\setinterfacevariable{lines}{zeilen}
-\setinterfacevariable{linked}{linked}
-\setinterfacevariable{list}{liste}
-\setinterfacevariable{local}{lokal}
-\setinterfacevariable{localenvironment}{lokaleumgebung}
-\setinterfacevariable{logo}{logo}
-\setinterfacevariable{logos}{logos}
-\setinterfacevariable{lohi}{hoti}
-\setinterfacevariable{long}{long}
-\setinterfacevariable{loose}{lose}
-\setinterfacevariable{low}{tief}
-\setinterfacevariable{ls}{ls}
-\setinterfacevariable{makeup}{umbruch}
-\setinterfacevariable{mar}{mar}
-\setinterfacevariable{march}{maerz}
-\setinterfacevariable{margin}{marginalie}
-\setinterfacevariable{marginedge}{marginalkante}
-\setinterfacevariable{margintext}{marginaltext}
-\setinterfacevariable{margintitle}{marginaltitel}
-\setinterfacevariable{marking}{beschriftung}
-\setinterfacevariable{math}{math}
-\setinterfacevariable{mathalignment}{mathalignment}
-\setinterfacevariable{mathcases}{mathcases}
-\setinterfacevariable{mathematics}{mathematik}
-\setinterfacevariable{mathmatrix}{mathmatrix}
-\setinterfacevariable{max}{max}
-\setinterfacevariable{maxdepth}{maxdepth}
-\setinterfacevariable{maxheight}{maxheight}
-\setinterfacevariable{maxwidth}{maxwidth}
-\setinterfacevariable{may}{mai}
-\setinterfacevariable{mediaeval}{mittelalterlich}
-\setinterfacevariable{medium}{mittel}
-\setinterfacevariable{middle}{mittig}
-\setinterfacevariable{min}{min}
-\setinterfacevariable{mindepth}{mindepth}
-\setinterfacevariable{minheight}{minhoehe}
-\setinterfacevariable{minwidth}{minbreite}
-\setinterfacevariable{mirrored}{gespiegelt}
-\setinterfacevariable{mixed}{mixed}
-\setinterfacevariable{monday}{montag}
-\setinterfacevariable{mono}{mono}
-\setinterfacevariable{monobold}{monofett}
-\setinterfacevariable{mononormal}{mononormal}
-\setinterfacevariable{month}{monat}
-\setinterfacevariable{more}{more}
-\setinterfacevariable{morehyphenation}{morehyphenation}
-\setinterfacevariable{name}{name}
-\setinterfacevariable{narrow}{schmall}
-\setinterfacevariable{negative}{negativ}
-\setinterfacevariable{never}{nie}
-\setinterfacevariable{new}{neu}
-\setinterfacevariable{next}{folgende}
-\setinterfacevariable{nextevenpage}{naechstegeradeseite}
-\setinterfacevariable{nextoddpage}{naechsteungeradeseite}
-\setinterfacevariable{nextpage}{folgendeseite}
-\setinterfacevariable{nextsubpage}{folgendeunterseite}
-\setinterfacevariable{nine}{neun}
-\setinterfacevariable{no}{nein}
-\setinterfacevariable{nocheck}{nocheck}
-\setinterfacevariable{nodepth}{nodepth}
-\setinterfacevariable{nofit}{nofit}
-\setinterfacevariable{nogrid}{nogrid}
-\setinterfacevariable{noheight}{noheight}
-\setinterfacevariable{nohz}{nohz}
-\setinterfacevariable{noline}{noline}
-\setinterfacevariable{nomarking}{keinebeschriftung}
-\setinterfacevariable{nomenubar}{nomenubar}
-\setinterfacevariable{none}{kein}
-\setinterfacevariable{nonumber}{nonumber}
-\setinterfacevariable{norepeat}{norepeat}
-\setinterfacevariable{normal}{normal}
-\setinterfacevariable{normalshort}{normalshort}
-\setinterfacevariable{nospacing}{nospacing}
-\setinterfacevariable{nostopper}{nostopper}
-\setinterfacevariable{not}{nicht}
-\setinterfacevariable{notation}{notation}
-\setinterfacevariable{note}{note}
-\setinterfacevariable{nothanging}{nothanging}
-\setinterfacevariable{nothyphenated}{nothyphenated}
-\setinterfacevariable{notjoinedup}{notjoinedup}
-\setinterfacevariable{november}{november}
-\setinterfacevariable{nowhere}{nirgens}
-\setinterfacevariable{nowhite}{keinweiss}
-\setinterfacevariable{number}{nummer}
-\setinterfacevariable{numbers}{ziffern}
-\setinterfacevariable{october}{oktober}
-\setinterfacevariable{odd}{ungerade}
-\setinterfacevariable{off}{aus}
-\setinterfacevariable{offset}{offset}
-\setinterfacevariable{old}{old}
-\setinterfacevariable{oldstyle}{oldstyle}
-\setinterfacevariable{on}{an}
-\setinterfacevariable{one}{eins}
-\setinterfacevariable{opposite}{gegenueber}
-\setinterfacevariable{ordinal}{ordinal}
-\setinterfacevariable{outer}{aussen}
-\setinterfacevariable{outeredge}{outeredge}
-\setinterfacevariable{outermargin}{outermargin}
-\setinterfacevariable{overbar}{ueberstrichen}
-\setinterfacevariable{overbars}{ueberstreichen}
-\setinterfacevariable{overlay}{overlay}
-\setinterfacevariable{overprint}{overprint}
-\setinterfacevariable{overstrike}{durchgestrichen}
-\setinterfacevariable{overstrikes}{durchstreichen}
-\setinterfacevariable{packed}{gepackt}
-\setinterfacevariable{page}{seite}
-\setinterfacevariable{pagecomment}{pagecomment}
-\setinterfacevariable{pagenumber}{seitennummer}
-\setinterfacevariable{paper}{papier}
-\setinterfacevariable{paragraph}{absatz}
-\setinterfacevariable{part}{teil}
-\setinterfacevariable{positive}{positiv}
-\setinterfacevariable{postponing}{verschieben}
-\setinterfacevariable{postscript}{postscript}
-\setinterfacevariable{precedingpage}{precedingpage}
-\setinterfacevariable{preference}{einstellung}
-\setinterfacevariable{preview}{vorschau}
-\setinterfacevariable{previous}{vorig}
-\setinterfacevariable{previousevenpage}{vorigegeradeseite}
-\setinterfacevariable{previousoddpage}{vorigeungeradeseite}
-\setinterfacevariable{previouspage}{vorigeseite}
-\setinterfacevariable{previoussubpage}{vorigeunterseite}
-\setinterfacevariable{print}{print}
-\setinterfacevariable{printable}{druckbar}
-\setinterfacevariable{process}{process}
-\setinterfacevariable{product}{produkt}
-\setinterfacevariable{program}{programm}
-\setinterfacevariable{project}{projekt}
-\setinterfacevariable{protected}{geschuetzt}
-\setinterfacevariable{quadruple}{viertel}
-\setinterfacevariable{quarterline}{quarterline}
-\setinterfacevariable{quotation}{zitat}
-\setinterfacevariable{quote}{zitieren}
-\setinterfacevariable{ran}{ran}
-\setinterfacevariable{random}{zufaellig}
-\setinterfacevariable{readonly}{nurlesbar}
-\setinterfacevariable{rectangular}{rechteckig}
-\setinterfacevariable{reference}{referenz}
-\setinterfacevariable{referral}{merkmal}
-\setinterfacevariable{region}{region}
-\setinterfacevariable{register}{register}
-\setinterfacevariable{regular}{regular}
-\setinterfacevariable{relative}{relativ}
-\setinterfacevariable{repeat}{wiederholen}
-\setinterfacevariable{required}{obligatorisch}
-\setinterfacevariable{reset}{zuruecksetzten}
-\setinterfacevariable{reverse}{reverse}
-\setinterfacevariable{right}{rechts}
-\setinterfacevariable{rightedge}{rechterkante}
-\setinterfacevariable{righthanging}{righthanging}
-\setinterfacevariable{rightmargin}{rechterrand}
-\setinterfacevariable{rightpage}{rechterseite}
-\setinterfacevariable{righttoleft}{righttoleft}
-\setinterfacevariable{roman}{antiqua}
-\setinterfacevariable{romannumerals}{roemischezahlen}
-\setinterfacevariable{rotate}{drehe}
-\setinterfacevariable{rotated}{gedreht}
-\setinterfacevariable{round}{rund}
-\setinterfacevariable{row}{row}
-\setinterfacevariable{rule}{linie}
-\setinterfacevariable{samepage}{selbeseite}
-\setinterfacevariable{sans}{sans}
-\setinterfacevariable{sansbold}{sansfett}
-\setinterfacevariable{sansnormal}{sansnormal}
-\setinterfacevariable{sansserif}{grotesk}
-\setinterfacevariable{saturday}{samstag}
-\setinterfacevariable{screen}{raster}
-\setinterfacevariable{section}{absatz}
-\setinterfacevariable{sectionblockenvironment}{sectionblockenvironment}
-\setinterfacevariable{sectionnumber}{abschnittsnummer}
-\setinterfacevariable{see}{sieh}
-\setinterfacevariable{selectfont}{selectfont}
-\setinterfacevariable{separator}{separator}
-\setinterfacevariable{september}{september}
-\setinterfacevariable{serif}{serif}
-\setinterfacevariable{serifbold}{serifbold}
-\setinterfacevariable{serifnormal}{serifnormal}
-\setinterfacevariable{serried}{kleinerabstand}
-\setinterfacevariable{setups}{setups}
-\setinterfacevariable{seven}{sieben}
-\setinterfacevariable{sheet}{sheet}
-\setinterfacevariable{shiftdown}{shiftdown}
-\setinterfacevariable{shiftup}{shiftup}
-\setinterfacevariable{short}{kurz}
-\setinterfacevariable{simplefonts}{simplefonts}
-\setinterfacevariable{simplelist}{simplelist}
-\setinterfacevariable{singlesided}{einzelseitig}
-\setinterfacevariable{six}{sechs}
-\setinterfacevariable{slanted}{geneigt}
-\setinterfacevariable{slantedbold}{geneigtfett}
-\setinterfacevariable{small}{klein}
-\setinterfacevariable{smallbodyfont}{smallbodyfont}
-\setinterfacevariable{smallbold}{kleinfett}
-\setinterfacevariable{smallbolditalic}{kleinfettitalic}
-\setinterfacevariable{smallboldslanted}{kleinfettgeneigt}
-\setinterfacevariable{smallcaps}{smallcaps}
-\setinterfacevariable{smaller}{smaller}
-\setinterfacevariable{smallitalic}{kleinitalic}
-\setinterfacevariable{smallitalicbold}{kleinitalicfett}
-\setinterfacevariable{smallnormal}{kleinnormal}
-\setinterfacevariable{smallslanted}{kleingeneigt}
-\setinterfacevariable{smallslantedbold}{kleingeneigtfett}
-\setinterfacevariable{smalltype}{kleintippen}
-\setinterfacevariable{somewhere}{irgendwo}
-\setinterfacevariable{sorted}{sortiert}
-\setinterfacevariable{sorting}{sorting}
-\setinterfacevariable{space}{spatium}
-\setinterfacevariable{spacing}{spatiumausgleich}
-\setinterfacevariable{speech}{speech}
-\setinterfacevariable{split}{split}
-\setinterfacevariable{spot}{spot}
-\setinterfacevariable{standard}{standard}
-\setinterfacevariable{start}{start}
-\setinterfacevariable{starter}{starter}
-\setinterfacevariable{sticker}{sticker}
-\setinterfacevariable{stop}{stop}
-\setinterfacevariable{stopper}{trenner}
-\setinterfacevariable{stretch}{strecken}
-\setinterfacevariable{stretched}{stretched}
-\setinterfacevariable{strict}{streng}
-\setinterfacevariable{strong}{strong}
-\setinterfacevariable{strut}{strut}
-\setinterfacevariable{sub}{unter}
-\setinterfacevariable{subbackward}{unterrueckwaerts}
-\setinterfacevariable{subformula}{subformel}
-\setinterfacevariable{subforward}{untervorwaerts}
-\setinterfacevariable{subject}{thema}
-\setinterfacevariable{subpage}{unterseite}
-\setinterfacevariable{subs}{subs}
-\setinterfacevariable{subsection}{unterabsatz}
-\setinterfacevariable{subsubject}{unterthema}
-\setinterfacevariable{subsubsection}{unterunterabsatz}
-\setinterfacevariable{subsubsubject}{unterunterthema}
-\setinterfacevariable{subsubsubsection}{unterunterunterabsatz}
-\setinterfacevariable{subsubsubsubject}{unterunterunterthema}
-\setinterfacevariable{subsubsubsubsection}{unterunterunterunterabsatz}
-\setinterfacevariable{subsubsubsubsubject}{unterunterunterunterthema}
-\setinterfacevariable{subsubsubsubsubsection}{unterunterunterunterunterabsatz}
-\setinterfacevariable{subsubsubsubsubsubject}{unterunterunterunterunterthema}
-\setinterfacevariable{subsubsubsubsubsubsection}{unterunterunterunterunterunterabsatz}
-\setinterfacevariable{subsubsubsubsubsubsubject}{unterunterunterunterunterunterthema}
-\setinterfacevariable{subsubsubsubsubsubsubsection}{unterunterunterunterunterunterunterabsatz}
-\setinterfacevariable{subsubsubsubsubsubsubsubject}{unterunterunterunterunterunterunterthema}
-\setinterfacevariable{subsubsubsubsubsubsubsubsection}{unterunterunterunterunterunterunterunterabsatz}
-\setinterfacevariable{subsubsubsubsubsubsubsubsubject}{unterunterunterunterunterunterunterunterthema}
-\setinterfacevariable{subsubsubsubsubsubsubsubsubsection}{unterunterunterunterunterunterunterunterunterabsatz}
-\setinterfacevariable{subsubsubsubsubsubsubsubsubsubject}{unterunterunterunterunterunterunterunterunterthema}
-\setinterfacevariable{sunday}{sonntag}
-\setinterfacevariable{support}{support}
-\setinterfacevariable{sym}{sym}
-\setinterfacevariable{symbol}{symbol}
-\setinterfacevariable{synchronize}{synchronize}
-\setinterfacevariable{synonym}{synonym}
-\setinterfacevariable{system}{systeme}
-\setinterfacevariable{table}{tabelle}
-\setinterfacevariable{tablehead}{tabellenueberschrift}
-\setinterfacevariable{tables}{tabellen}
-\setinterfacevariable{tabletail}{tabellenende}
-\setinterfacevariable{tabulate}{tabulator}
-\setinterfacevariable{tabulatehead}{tabulatehead}
-\setinterfacevariable{tabulatetail}{tabulatetail}
-\setinterfacevariable{tall}{lang}
-\setinterfacevariable{teletype}{fernschreiber}
-\setinterfacevariable{temporary}{temporaer}
-\setinterfacevariable{test}{test}
-\setinterfacevariable{text}{text}
-\setinterfacevariable{textnote}{textnote}
-\setinterfacevariable{three}{drei}
-\setinterfacevariable{thursday}{donnerstag}
-\setinterfacevariable{tight}{tight}
-\setinterfacevariable{title}{titel}
-\setinterfacevariable{toggle}{toggle}
-\setinterfacevariable{tolerant}{tolerant}
-\setinterfacevariable{top}{oben}
-\setinterfacevariable{tuesday}{dienstag}
-\setinterfacevariable{two}{zwei}
-\setinterfacevariable{txt}{txt}
-\setinterfacevariable{type}{tippen}
-\setinterfacevariable{typing}{tippen}
-\setinterfacevariable{unavailable}{nichtverfuegbar}
-\setinterfacevariable{underbar}{unterstrichen}
-\setinterfacevariable{underbars}{unterstreichen}
-\setinterfacevariable{understrike}{understrike}
-\setinterfacevariable{understrikes}{understrikes}
-\setinterfacevariable{unframed}{unframed}
-\setinterfacevariable{unicode}{unicode}
-\setinterfacevariable{unit}{einheit}
-\setinterfacevariable{units}{einheiten}
-\setinterfacevariable{unknown}{unbekannt}
-\setinterfacevariable{unpacked}{ungepackt}
-\setinterfacevariable{up}{up}
-\setinterfacevariable{url}{url}
-\setinterfacevariable{used}{verwende}
-\setinterfacevariable{value}{wert}
-\setinterfacevariable{vertical}{vertikal}
-\setinterfacevariable{very}{sehr}
-\setinterfacevariable{verystrict}{sehrstreng}
-\setinterfacevariable{verytolerant}{sehrtolerant}
-\setinterfacevariable{vfenced}{vfenced}
-\setinterfacevariable{vulgarfraction}{vulgarfraction}
-\setinterfacevariable{weak}{weak}
-\setinterfacevariable{wednesday}{mittwoch}
-\setinterfacevariable{week}{woche}
-\setinterfacevariable{weekday}{wochentag}
-\setinterfacevariable{white}{weiss}
-\setinterfacevariable{wide}{breit}
-\setinterfacevariable{width}{breite}
-\setinterfacevariable{word}{wort}
-\setinterfacevariable{words}{words}
-\setinterfacevariable{xml}{xml}
-\setinterfacevariable{year}{jahr}
-\setinterfacevariable{yes}{ja}
-% definitions for interface constants for language de
-%
-\setinterfaceconstant{action}{aktion}
-\setinterfaceconstant{address}{adresse}
-\setinterfaceconstant{after}{nach}
-\setinterfaceconstant{afterhead}{nachkopf}
-\setinterfaceconstant{afterkey}{nachtaste}
-\setinterfaceconstant{aftersection}{aftersection}
-\setinterfaceconstant{align}{ausrichtung}
-\setinterfaceconstant{alignbottom}{alignbottom}
-\setinterfaceconstant{aligncharacter}{aligncharacter}
-\setinterfaceconstant{alignmentcharacter}{alignmentcharacter}
-\setinterfaceconstant{alignmentleftsample}{alignmentleftsample}
-\setinterfaceconstant{alignmentleftwidth}{alignmentleftwidth}
-\setinterfaceconstant{alignmentrightsample}{alignmentrightsample}
-\setinterfaceconstant{alignmentrightwidth}{alignmentrightwidth}
-\setinterfaceconstant{alignsymbol}{alignsymbol}
-\setinterfaceconstant{aligntitle}{titelausrichten}
-\setinterfaceconstant{alternative}{alternative}
-\setinterfaceconstant{anchor}{anchor}
-\setinterfaceconstant{anchoring}{anchoring}
-\setinterfaceconstant{andtext}{andtext}
-\setinterfaceconstant{apa}{apa}
-\setinterfaceconstant{arguments}{arguments}
-\setinterfaceconstant{arrow}{pfeil}
-\setinterfaceconstant{artauthor}{artauthor}
-\setinterfaceconstant{artauthoretaldisplay}{artauthoretaldisplay}
-\setinterfaceconstant{artauthoretallimit}{artauthoretallimit}
-\setinterfaceconstant{artauthoretaltext}{artauthoretaltext}
-\setinterfaceconstant{artoffset}{artoffset}
-\setinterfaceconstant{at}{bei}
-\setinterfaceconstant{author}{autor}
-\setinterfaceconstant{authorconversion}{authorconversion}
-\setinterfaceconstant{authoretaldisplay}{authoretaldisplay}
-\setinterfaceconstant{authoretallimit}{authoretallimit}
-\setinterfaceconstant{authoretaltext}{authoretaltext}
-\setinterfaceconstant{auto}{auto}
-\setinterfaceconstant{autocase}{autocase}
-\setinterfaceconstant{autofile}{autofile}
-\setinterfaceconstant{autofocus}{autofocus}
-\setinterfaceconstant{autohang}{autohang}
-\setinterfaceconstant{autostrut}{autostrut}
-\setinterfaceconstant{autowidth}{autobreite}
-\setinterfaceconstant{availableheight}{availableheight}
-\setinterfaceconstant{availablewidth}{availablewidth}
-\setinterfaceconstant{axis}{achsen}
-\setinterfaceconstant{background}{hintergrund}
-\setinterfaceconstant{backgroundcolor}{hintergrundfarbe}
-\setinterfaceconstant{backgroundcorner}{hintergrundwinkel}
-\setinterfaceconstant{backgrounddepth}{hintergrundtiefe}
-\setinterfaceconstant{backgroundoffset}{hintergrundoffset}
-\setinterfaceconstant{backgroundradius}{hintergrundradius}
-\setinterfaceconstant{backgroundscreen}{hintergrundraster}
-\setinterfaceconstant{backreference}{backreference}
-\setinterfaceconstant{backspace}{rumpfspatium}
-\setinterfaceconstant{balance}{ausgleichen}
-\setinterfaceconstant{before}{vor}
-\setinterfaceconstant{beforehead}{vorkopf}
-\setinterfaceconstant{beforesection}{beforesection}
-\setinterfaceconstant{bet}{bet}
-\setinterfaceconstant{bidi}{bidi}
-\setinterfaceconstant{big}{gross}
-\setinterfaceconstant{blank}{blanko}
-\setinterfaceconstant{bleedoffset}{bleedoffset}
-\setinterfaceconstant{blockway}{blockauf}
-\setinterfaceconstant{bodyfont}{fliesstext}
-\setinterfaceconstant{boffset}{boffset}
-\setinterfaceconstant{boldfeatures}{boldfeatures}
-\setinterfaceconstant{boldfont}{boldfont}
-\setinterfaceconstant{bolditalicfeatures}{bolditalicfeatures}
-\setinterfaceconstant{bolditalicfont}{bolditalicfont}
-\setinterfaceconstant{boldslantedfeatures}{boldslantedfeatures}
-\setinterfaceconstant{boldslantedfont}{boldslantedfont}
-\setinterfaceconstant{bookmark}{bookmark}
-\setinterfaceconstant{bottom}{unten}
-\setinterfaceconstant{bottomafter}{bottomafter}
-\setinterfaceconstant{bottombefore}{bottombefore}
-\setinterfaceconstant{bottomcommand}{bottomcommand}
-\setinterfaceconstant{bottomdistance}{abstandunten}
-\setinterfaceconstant{bottomframe}{untenrahmen}
-\setinterfaceconstant{bottomoffset}{untenoffset}
-\setinterfaceconstant{bottomspace}{bottomspace}
-\setinterfaceconstant{bottomstate}{untenstatus}
-\setinterfaceconstant{break}{break}
-\setinterfaceconstant{buffer}{buffer}
-\setinterfaceconstant{cache}{cache}
-\setinterfaceconstant{calculate}{berechnen}
-\setinterfaceconstant{category}{category}
-\setinterfaceconstant{ccommand}{cbefehl}
-\setinterfaceconstant{character}{character}
-\setinterfaceconstant{characters}{characters}
-\setinterfaceconstant{check}{check}
-\setinterfaceconstant{click}{klick}
-\setinterfaceconstant{clickin}{klickin}
-\setinterfaceconstant{clickout}{klickaus}
-\setinterfaceconstant{clipoffset}{clipoffset}
-\setinterfaceconstant{closeaction}{schliessenaktion}
-\setinterfaceconstant{closecommand}{closecommand}
-\setinterfaceconstant{closepage}{closepage}
-\setinterfaceconstant{closepageaction}{closepageaction}
-\setinterfaceconstant{closesymbol}{closesymbol}
-\setinterfaceconstant{color}{farbe}
-\setinterfaceconstant{column}{spalte}
-\setinterfaceconstant{columndistance}{spaltenabstand}
-\setinterfaceconstant{columns}{spalten}
-\setinterfaceconstant{comma}{comma}
-\setinterfaceconstant{command}{befehl}
-\setinterfaceconstant{commandafter}{zumbefehl}
-\setinterfaceconstant{commandbefore}{vorbefehl}
-\setinterfaceconstant{commands}{befehle}
-\setinterfaceconstant{comment}{comment}
-\setinterfaceconstant{commentchar}{commentchar}
-\setinterfaceconstant{commentoffset}{commentoffset}
-\setinterfaceconstant{compact}{compact}
-\setinterfaceconstant{component}{component}
-\setinterfaceconstant{compoundhyphen}{compoundhyphen}
-\setinterfaceconstant{compress}{compress}
-\setinterfaceconstant{compressdistance}{compressdistance}
-\setinterfaceconstant{compressmethod}{compressmethod}
-\setinterfaceconstant{compressseparator}{compressseparator}
-\setinterfaceconstant{compressstopper}{compressstopper}
-\setinterfaceconstant{concerns}{concerns}
-\setinterfaceconstant{connector}{connector}
-\setinterfaceconstant{continue}{fortsetzen}
-\setinterfaceconstant{contrastcolor}{kontrastfarbe}
-\setinterfaceconstant{controls}{controls}
-\setinterfaceconstant{conversion}{konversion}
-\setinterfaceconstant{convertfile}{konvertieredatei}
-\setinterfaceconstant{copies}{copies}
-\setinterfaceconstant{corner}{winkel}
-\setinterfaceconstant{coupling}{verknuepfung}
-\setinterfaceconstant{couplingway}{verkopplungsart}
-\setinterfaceconstant{criterium}{kriterium}
-\setinterfaceconstant{cropoffset}{cropoffset}
-\setinterfaceconstant{crossreference}{crossreference}
-\setinterfaceconstant{cssfile}{cssfile}
-\setinterfaceconstant{current}{aktuell}
-\setinterfaceconstant{cutspace}{cutspace}
-\setinterfaceconstant{dash}{strich}
-\setinterfaceconstant{dat}{dat}
-\setinterfaceconstant{database}{database}
-\setinterfaceconstant{dataset}{dataset}
-\setinterfaceconstant{date}{datum}
-\setinterfaceconstant{deepnumbercommand}{deepnumbercommand}
-\setinterfaceconstant{deeptextcommand}{deeptextcommand}
-\setinterfaceconstant{default}{default}
-\setinterfaceconstant{defaultheight}{defaultheight}
-\setinterfaceconstant{defaultwidth}{defaultwidth}
-\setinterfaceconstant{define}{define}
-\setinterfaceconstant{delay}{wartezeit}
-\setinterfaceconstant{depth}{tiefe}
-\setinterfaceconstant{depthcorrection}{tiefekorrektur}
-\setinterfaceconstant{direction}{richtung}
-\setinterfaceconstant{directory}{verzeichnis}
-\setinterfaceconstant{display}{bildschirm}
-\setinterfaceconstant{displaythreshold}{displaythreshold}
-\setinterfaceconstant{distance}{abstand}
-\setinterfaceconstant{domain}{domain}
-\setinterfaceconstant{dot}{punkt}
-\setinterfaceconstant{doublesided}{doppelseitig}
-\setinterfaceconstant{down}{down}
-\setinterfaceconstant{dummy}{dummy}
-\setinterfaceconstant{dx}{dx}
-\setinterfaceconstant{dy}{dy}
-\setinterfaceconstant{edge}{kante}
-\setinterfaceconstant{edgedistance}{kantenabstand}
-\setinterfaceconstant{editor}{editor}
-\setinterfaceconstant{editoretaldisplay}{editoretaldisplay}
-\setinterfaceconstant{editoretallimit}{editoretallimit}
-\setinterfaceconstant{editoretaltext}{editoretaltext}
-\setinterfaceconstant{empty}{leer}
-\setinterfaceconstant{entities}{entities}
-\setinterfaceconstant{entries}{entries}
-\setinterfaceconstant{equalheight}{equalheight}
-\setinterfaceconstant{equalwidth}{equalwidth}
-\setinterfaceconstant{escape}{escape}
-\setinterfaceconstant{etaldisplay}{etaldisplay}
-\setinterfaceconstant{etallimit}{etallimit}
-\setinterfaceconstant{etaloption}{etaloption}
-\setinterfaceconstant{etaltext}{etaltext}
-\setinterfaceconstant{evenmargin}{geraderand}
-\setinterfaceconstant{exact}{exact}
-\setinterfaceconstant{exitoffset}{exitoffset}
-\setinterfaceconstant{expansion}{expansion}
-\setinterfaceconstant{export}{export}
-\setinterfaceconstant{extras}{extras}
-\setinterfaceconstant{factor}{faktor}
-\setinterfaceconstant{fallback}{fallback}
-\setinterfaceconstant{fallbacks}{fallbacks}
-\setinterfaceconstant{family}{familie}
-\setinterfaceconstant{features}{features}
-\setinterfaceconstant{featureset}{featureset}
-\setinterfaceconstant{fences}{fences}
-\setinterfaceconstant{field}{field}
-\setinterfaceconstant{fieldbackgroundcolor}{feldhintergrundfarbe}
-\setinterfaceconstant{fieldframecolor}{feldrahmenfarbe}
-\setinterfaceconstant{fieldlayer}{fieldlayer}
-\setinterfaceconstant{fieldoffset}{feldoffset}
-\setinterfaceconstant{file}{datei}
-\setinterfaceconstant{filler}{filler}
-\setinterfaceconstant{filter}{filter}
-\setinterfaceconstant{filtercommand}{filtercommand}
-\setinterfaceconstant{finalnamesep}{finalnamesep}
-\setinterfaceconstant{finalpagesep}{finalpagesep}
-\setinterfaceconstant{finalpubsep}{finalpubsep}
-\setinterfaceconstant{first}{erste}
-\setinterfaceconstant{firstnamesep}{firstnamesep}
-\setinterfaceconstant{firstpage}{ersteseite}
-\setinterfaceconstant{focus}{focus}
-\setinterfaceconstant{focusin}{focusin}
-\setinterfaceconstant{focusoffset}{focusoffset}
-\setinterfaceconstant{focusout}{focusout}
-\setinterfaceconstant{font}{font}
-\setinterfaceconstant{footer}{fusszeile}
-\setinterfaceconstant{footerdistance}{fusszeilenabstand}
-\setinterfaceconstant{footerstate}{fusszeilenstatus}
-\setinterfaceconstant{force}{zwinge}
-\setinterfaceconstant{foregroundcolor}{foregroundcolor}
-\setinterfaceconstant{foregroundstyle}{foregroundstyle}
-\setinterfaceconstant{format}{formatieren}
-\setinterfaceconstant{fractions}{fractions}
-\setinterfaceconstant{frame}{rahmen}
-\setinterfaceconstant{framecolor}{rahmenfarbe}
-\setinterfaceconstant{framecorner}{rahmenwinkel}
-\setinterfaceconstant{framedepth}{rahmentiefe}
-\setinterfaceconstant{frameoffset}{rahmenoffset}
-\setinterfaceconstant{frameradius}{rahmenradius}
-\setinterfaceconstant{frames}{umrahmen}
-\setinterfaceconstant{freeregion}{freeregion}
-\setinterfaceconstant{from}{von}
-\setinterfaceconstant{functioncolor}{functioncolor}
-\setinterfaceconstant{functionstyle}{functionstyle}
-\setinterfaceconstant{get}{hole}
-\setinterfaceconstant{global}{global}
-\setinterfaceconstant{goodies}{goodies}
-\setinterfaceconstant{grid}{gritter}
-\setinterfaceconstant{group}{group}
-\setinterfaceconstant{groupsuffix}{groupsuffix}
-\setinterfaceconstant{hang}{haengend}
-\setinterfaceconstant{hcompact}{hcompact}
-\setinterfaceconstant{headalign}{headalign}
-\setinterfaceconstant{headcolor}{kopffarbe}
-\setinterfaceconstant{headcommand}{headcommand}
-\setinterfaceconstant{headconversion}{headconversion}
-\setinterfaceconstant{header}{kopfzeile}
-\setinterfaceconstant{headerdistance}{kopfzeilenabstand}
-\setinterfaceconstant{headerstate}{kopfzeilenstatus}
-\setinterfaceconstant{headlabel}{headlabel}
-\setinterfaceconstant{headnumber}{kopfnummer}
-\setinterfaceconstant{headseparator}{headseparator}
-\setinterfaceconstant{headstyle}{kopfstil}
-\setinterfaceconstant{height}{hoehe}
-\setinterfaceconstant{hfactor}{hfaktor}
-\setinterfaceconstant{hfil}{hfil}
-\setinterfaceconstant{hidenumber}{hidenumber}
-\setinterfaceconstant{hoffset}{hoffset}
-\setinterfaceconstant{horizontal}{horizontal}
-\setinterfaceconstant{horoffset}{rumpfabstand}
-\setinterfaceconstant{hyphen}{hyphen}
-\setinterfaceconstant{hyphens}{hyphens}
-\setinterfaceconstant{icommand}{ibefehl}
-\setinterfaceconstant{ignore}{ignore}
-\setinterfaceconstant{in}{in}
-\setinterfaceconstant{inbetween}{zwischen}
-\setinterfaceconstant{increment}{erhoehen}
-\setinterfaceconstant{incrementnumber}{nummererhoehen}
-\setinterfaceconstant{indenting}{einziehen}
-\setinterfaceconstant{indentlist}{indentlist}
-\setinterfaceconstant{indentnext}{ziehefolgendeein}
-\setinterfaceconstant{index}{index}
-\setinterfaceconstant{indicator}{indikator}
-\setinterfaceconstant{initialsep}{initialsep}
-\setinterfaceconstant{inlinethreshold}{inlinethreshold}
-\setinterfaceconstant{inner}{innen}
-\setinterfaceconstant{innermargin}{innermargin}
-\setinterfaceconstant{inputfile}{inputfile}
-\setinterfaceconstant{insidesection}{insidesection}
-\setinterfaceconstant{instance}{instance}
-\setinterfaceconstant{intent}{intent}
-\setinterfaceconstant{interaction}{interaktion}
-\setinterfaceconstant{interlinespace}{zeilenabstande}
-\setinterfaceconstant{internalgrid}{internalgrid}
-\setinterfaceconstant{italicfeatures}{italicfeatures}
-\setinterfaceconstant{italicfont}{italicfont}
-\setinterfaceconstant{itemalign}{itemalign}
-\setinterfaceconstant{items}{posten}
-\setinterfaceconstant{joiners}{joiners}
-\setinterfaceconstant{journalconversion}{journalconversion}
-\setinterfaceconstant{juniorsep}{juniorsep}
-\setinterfaceconstant{keeptogether}{keeptogether}
-\setinterfaceconstant{ken}{ken}
-\setinterfaceconstant{keyexpansion}{keyexpansion}
-\setinterfaceconstant{keys}{keys}
-\setinterfaceconstant{keyword}{keyword}
-\setinterfaceconstant{label}{label}
-\setinterfaceconstant{labelalternative}{labelalternative}
-\setinterfaceconstant{labelcolor}{labelcolor}
-\setinterfaceconstant{labeloffset}{labeloffset}
-\setinterfaceconstant{labelstyle}{labelstyle}
-\setinterfaceconstant{language}{language}
-\setinterfaceconstant{last}{last}
-\setinterfaceconstant{lastnamesep}{lastnamesep}
-\setinterfaceconstant{lastpage}{letzteseite}
-\setinterfaceconstant{lastpagesep}{lastpagesep}
-\setinterfaceconstant{lastpubsep}{lastpubsep}
-\setinterfaceconstant{layout}{layout}
-\setinterfaceconstant{left}{links}
-\setinterfaceconstant{leftcolor}{linkerfarbe}
-\setinterfaceconstant{leftcompoundhyphen}{leftcompoundhyphen}
-\setinterfaceconstant{leftedge}{linkekante}
-\setinterfaceconstant{leftedgedistance}{linkerkantenabstand}
-\setinterfaceconstant{leftframe}{linkerrahmen}
-\setinterfaceconstant{lefthyphen}{lefthyphen}
-\setinterfaceconstant{leftmargin}{linkerrand}
-\setinterfaceconstant{leftmargindistance}{linkerrandabstand}
-\setinterfaceconstant{leftoffset}{linkeroffset}
-\setinterfaceconstant{leftquotation}{linkerzitat}
-\setinterfaceconstant{leftquote}{linkerzitieren}
-\setinterfaceconstant{leftsample}{leftsample}
-\setinterfaceconstant{leftsentence}{linkersatz}
-\setinterfaceconstant{leftspeech}{leftspeech}
-\setinterfaceconstant{leftstyle}{linkerstil}
-\setinterfaceconstant{leftsubsentence}{linkersubsatz}
-\setinterfaceconstant{lefttext}{linkertext}
-\setinterfaceconstant{leftwidth}{linkerbreite}
-\setinterfaceconstant{leftwords}{leftwords}
-\setinterfaceconstant{less}{less}
-\setinterfaceconstant{level}{niveau}
-\setinterfaceconstant{levels}{niveaus}
-\setinterfaceconstant{limittext}{limittext}
-\setinterfaceconstant{line}{zeile}
-\setinterfaceconstant{linecorrection}{zeilekorrektur}
-\setinterfaceconstant{linedirection}{linedirection}
-\setinterfaceconstant{lines}{zeilen}
-\setinterfaceconstant{list}{liste}
-\setinterfaceconstant{listtext}{listtext}
-\setinterfaceconstant{local}{lokal}
-\setinterfaceconstant{location}{platz}
-\setinterfaceconstant{loffset}{loffset}
-\setinterfaceconstant{logo}{logo}
-\setinterfaceconstant{logos}{logos}
-\setinterfaceconstant{marcolor}{beschrfarbe}
-\setinterfaceconstant{margin}{marginalie}
-\setinterfaceconstant{margindistance}{marginalabstand}
-\setinterfaceconstant{marginedge}{marginalkante}
-\setinterfaceconstant{marginedgetext}{marginalkantetext}
-\setinterfaceconstant{margintext}{marginaltext}
-\setinterfaceconstant{mark}{mark}
-\setinterfaceconstant{marking}{beschriftung}
-\setinterfaceconstant{marstyle}{beschrstil}
-\setinterfaceconstant{mask}{mask}
-\setinterfaceconstant{mathclass}{mathclass}
-\setinterfaceconstant{mathlimits}{mathlimits}
-\setinterfaceconstant{mathstyle}{mathstyle}
-\setinterfaceconstant{max}{max}
-\setinterfaceconstant{maxdepth}{maxdepth}
-\setinterfaceconstant{maxheight}{maxhoehe}
-\setinterfaceconstant{maxwidth}{maxbreite}
-\setinterfaceconstant{maybeyear}{maybeyear}
-\setinterfaceconstant{menu}{menue}
-\setinterfaceconstant{method}{methode}
-\setinterfaceconstant{middle}{mittig}
-\setinterfaceconstant{middlecolor}{middlecolor}
-\setinterfaceconstant{middlecommand}{middlecommand}
-\setinterfaceconstant{middlespeech}{middlespeech}
-\setinterfaceconstant{middlestyle}{middlestyle}
-\setinterfaceconstant{middletext}{mittigertext}
-\setinterfaceconstant{middlewidth}{middlewidth}
-\setinterfaceconstant{midsentence}{midsentence}
-\setinterfaceconstant{min}{min}
-\setinterfaceconstant{mindepth}{mindepth}
-\setinterfaceconstant{minheight}{minhoehe}
-\setinterfaceconstant{minwidth}{minbreite}
-\setinterfaceconstant{moffset}{moffset}
-\setinterfaceconstant{monthconversion}{monthconversion}
-\setinterfaceconstant{more}{more}
-\setinterfaceconstant{mpdepth}{mpdepth}
-\setinterfaceconstant{mpheight}{mpheight}
-\setinterfaceconstant{mpoffset}{mpoffset}
-\setinterfaceconstant{mpwidth}{mpwidth}
-\setinterfaceconstant{n}{n}
-\setinterfaceconstant{name}{name}
-\setinterfaceconstant{namesep}{namesep}
-\setinterfaceconstant{nbottom}{nunten}
-\setinterfaceconstant{nc}{nc}
-\setinterfaceconstant{next}{folgende}
-\setinterfaceconstant{nextleft}{nextleft}
-\setinterfaceconstant{nextleftquotation}{nextleftquotation}
-\setinterfaceconstant{nextright}{nextright}
-\setinterfaceconstant{nextrightquotation}{nextrightquotation}
-\setinterfaceconstant{nl}{nl}
-\setinterfaceconstant{nleft}{nlinks}
-\setinterfaceconstant{nlines}{zzeile}
-\setinterfaceconstant{norm}{norm}
-\setinterfaceconstant{note}{note}
-\setinterfaceconstant{notes}{notes}
-\setinterfaceconstant{nr}{nr}
-\setinterfaceconstant{nright}{nrechts}
-\setinterfaceconstant{ntop}{noben}
-\setinterfaceconstant{number}{nummer}
-\setinterfaceconstant{numberalign}{numberalign}
-\setinterfaceconstant{numbercolor}{nummernfarbe}
-\setinterfaceconstant{numbercommand}{nummerbefehl}
-\setinterfaceconstant{numberconversion}{numberconversion}
-\setinterfaceconstant{numberconversionset}{numberconversionset}
-\setinterfaceconstant{numberdistance}{numberdistance}
-\setinterfaceconstant{numbering}{nummerierung}
-\setinterfaceconstant{numberorder}{numberorder}
-\setinterfaceconstant{numberprefix}{numberprefix}
-\setinterfaceconstant{numbersegments}{numbersegments}
-\setinterfaceconstant{numberseparator}{nummernseperator}
-\setinterfaceconstant{numberseparatorset}{numberseparatorset}
-\setinterfaceconstant{numberset}{numberset}
-\setinterfaceconstant{numberstarter}{numberstarter}
-\setinterfaceconstant{numberstopper}{numberstopper}
-\setinterfaceconstant{numberstrut}{numberstrut}
-\setinterfaceconstant{numberstyle}{nummernstil}
-\setinterfaceconstant{numberwidth}{numberwidth}
-\setinterfaceconstant{nx}{nx}
-\setinterfaceconstant{ny}{ny}
-\setinterfaceconstant{object}{objekt}
-\setinterfaceconstant{obstruction}{gesperrt}
-\setinterfaceconstant{oddmargin}{ungeraderand}
-\setinterfaceconstant{offset}{offset}
-\setinterfaceconstant{openaction}{oeffenaktion}
-\setinterfaceconstant{openpage}{openpage}
-\setinterfaceconstant{openpageaction}{openpageaction}
-\setinterfaceconstant{openup}{openup}
-\setinterfaceconstant{opticalsize}{opticalsize}
-\setinterfaceconstant{option}{option}
-\setinterfaceconstant{order}{order}
-\setinterfaceconstant{orientation}{orientation}
-\setinterfaceconstant{otherstext}{otherstext}
-\setinterfaceconstant{outermargin}{outermargin}
-\setinterfaceconstant{overprint}{overprint}
-\setinterfaceconstant{ownerpassword}{ownerpassword}
-\setinterfaceconstant{ownnumber}{eigenenummer}
-\setinterfaceconstant{packcriterium}{packcriterium}
-\setinterfaceconstant{page}{seite}
-\setinterfaceconstant{pageboundaries}{seitenbegrenzung}
-\setinterfaceconstant{pagecolor}{seitenfarbe}
-\setinterfaceconstant{pagecolormodel}{pagecolormodel}
-\setinterfaceconstant{pagecommand}{seitenbefehl}
-\setinterfaceconstant{pageconnector}{pageconnector}
-\setinterfaceconstant{pageconversion}{pageconversion}
-\setinterfaceconstant{pageconversionset}{pageconversionset}
-\setinterfaceconstant{pageleft}{pageleft}
-\setinterfaceconstant{pagemethod}{pagemethod}
-\setinterfaceconstant{pagenumber}{seitennummer}
-\setinterfaceconstant{pageprefix}{pageprefix}
-\setinterfaceconstant{pageprefixconnector}{pageprefixconnector}
-\setinterfaceconstant{pageprefixconversion}{pageprefixconversion}
-\setinterfaceconstant{pageprefixconversionset}{pageprefixconversionset}
-\setinterfaceconstant{pageprefixsegments}{pageprefixsegments}
-\setinterfaceconstant{pageprefixseparatorset}{pageprefixseparatorset}
-\setinterfaceconstant{pageprefixset}{pageprefixset}
-\setinterfaceconstant{pageprefixstarter}{pageprefixstarter}
-\setinterfaceconstant{pageprefixstopper}{pageprefixstopper}
-\setinterfaceconstant{pageright}{pageright}
-\setinterfaceconstant{pagesegments}{pagesegments}
-\setinterfaceconstant{pagesep}{pagesep}
-\setinterfaceconstant{pageseparatorset}{pageseparatorset}
-\setinterfaceconstant{pageset}{pageset}
-\setinterfaceconstant{pagestarter}{pagestarter}
-\setinterfaceconstant{pagestate}{pagestate}
-\setinterfaceconstant{pagestopper}{pagestopper}
-\setinterfaceconstant{pagestyle}{seitenstil}
-\setinterfaceconstant{palet}{palette}
-\setinterfaceconstant{paper}{papier}
-\setinterfaceconstant{paragraph}{absatz}
-\setinterfaceconstant{period}{period}
-\setinterfaceconstant{place}{platziere}
-\setinterfaceconstant{placehead}{setzekopf}
-\setinterfaceconstant{placeholder}{placeholder}
-\setinterfaceconstant{placestopper}{setzetrenner}
-\setinterfaceconstant{position}{position}
-\setinterfaceconstant{prefix}{prefix}
-\setinterfaceconstant{prefixconnector}{prefixconnector}
-\setinterfaceconstant{prefixconversion}{prefixconversion}
-\setinterfaceconstant{prefixconversionset}{prefixconversionset}
-\setinterfaceconstant{prefixsegments}{prefixsegments}
-\setinterfaceconstant{prefixseparatorset}{prefixseparatorset}
-\setinterfaceconstant{prefixset}{prefixset}
-\setinterfaceconstant{prefixstarter}{prefixstarter}
-\setinterfaceconstant{prefixstopper}{prefixstopper}
-\setinterfaceconstant{preset}{voreinstellung}
-\setinterfaceconstant{preview}{vorschau}
-\setinterfaceconstant{previous}{vorige}
-\setinterfaceconstant{previousnumber}{vorigenummer}
-\setinterfaceconstant{print}{print}
-\setinterfaceconstant{printable}{druckbar}
-\setinterfaceconstant{process}{process}
-\setinterfaceconstant{processors}{processors}
-\setinterfaceconstant{profile}{profile}
-\setinterfaceconstant{properties}{properties}
-\setinterfaceconstant{pubsep}{pubsep}
-\setinterfaceconstant{quotechar}{quotechar}
-\setinterfaceconstant{radius}{radius}
-\setinterfaceconstant{random}{zufaellig}
-\setinterfaceconstant{range}{range}
-\setinterfaceconstant{reduction}{reduktion}
-\setinterfaceconstant{ref}{ref}
-\setinterfaceconstant{refcommand}{refcommand}
-\setinterfaceconstant{reference}{referenz}
-\setinterfaceconstant{referencemethod}{referencemethod}
-\setinterfaceconstant{referenceprefix}{referenceprefix}
-\setinterfaceconstant{referencetext}{referencetext}
-\setinterfaceconstant{referencing}{referieren}
-\setinterfaceconstant{region}{region}
-\setinterfaceconstant{regionin}{regionin}
-\setinterfaceconstant{regionout}{regionaus}
-\setinterfaceconstant{register}{register}
-\setinterfaceconstant{regularfeatures}{regularfeatures}
-\setinterfaceconstant{regularfont}{regularfont}
-\setinterfaceconstant{renderingsetup}{renderingsetup}
-\setinterfaceconstant{repeat}{wiederholen}
-\setinterfaceconstant{reset}{reset}
-\setinterfaceconstant{resetnumber}{resetnumber}
-\setinterfaceconstant{resolution}{aufloesung}
-\setinterfaceconstant{resources}{resources}
-\setinterfaceconstant{reverse}{reverse}
-\setinterfaceconstant{right}{rechts}
-\setinterfaceconstant{rightchars}{rightchars}
-\setinterfaceconstant{rightcolor}{rechterfarbe}
-\setinterfaceconstant{rightcompoundhyphen}{rightcompoundhyphen}
-\setinterfaceconstant{rightedge}{rechtekante}
-\setinterfaceconstant{rightedgedistance}{rechterkantenabstand}
-\setinterfaceconstant{rightframe}{rechterrahmen}
-\setinterfaceconstant{righthyphen}{righthyphen}
-\setinterfaceconstant{rightmargin}{rechterrand}
-\setinterfaceconstant{rightmargindistance}{rechterrandabstand}
-\setinterfaceconstant{rightoffset}{rechterabstand}
-\setinterfaceconstant{rightquotation}{rechterzitat}
-\setinterfaceconstant{rightquote}{rechterzitieren}
-\setinterfaceconstant{rightsample}{rightsample}
-\setinterfaceconstant{rightsentence}{rechtersatz}
-\setinterfaceconstant{rightspeech}{rightspeech}
-\setinterfaceconstant{rightstyle}{rechterstil}
-\setinterfaceconstant{rightsubsentence}{rechtersubsatz}
-\setinterfaceconstant{righttext}{rechtertext}
-\setinterfaceconstant{rightwidth}{rechterbreite}
-\setinterfaceconstant{rightwords}{rightwords}
-\setinterfaceconstant{roffset}{roffset}
-\setinterfaceconstant{rotation}{rotation}
-\setinterfaceconstant{rule}{linie}
-\setinterfaceconstant{rulecolor}{linienfarbe}
-\setinterfaceconstant{rulecommand}{rulecommand}
-\setinterfaceconstant{rulethickness}{liniendicke}
-\setinterfaceconstant{samepage}{selbeseite}
-\setinterfaceconstant{sample}{muster}
-\setinterfaceconstant{samplesize}{samplesize}
-\setinterfaceconstant{saveinlist}{saveinlist}
-\setinterfaceconstant{scale}{format}
-\setinterfaceconstant{scope}{bereich}
-\setinterfaceconstant{screen}{raster}
-\setinterfaceconstant{section}{abschnitt}
-\setinterfaceconstant{sectionblock}{sectionblock}
-\setinterfaceconstant{sectionconversion}{sectionconversion}
-\setinterfaceconstant{sectionconversionset}{sectionconversionset}
-\setinterfaceconstant{sectionnumber}{abschnittsnummer}
-\setinterfaceconstant{sectionresetset}{sectionresetset}
-\setinterfaceconstant{sectionsegments}{sectionsegments}
-\setinterfaceconstant{sectionseparatorset}{sectionseparatorset}
-\setinterfaceconstant{sectionset}{sectionset}
-\setinterfaceconstant{sectionstarter}{sectionstarter}
-\setinterfaceconstant{sectionstopper}{sectionstopper}
-\setinterfaceconstant{separator}{seperator}
-\setinterfaceconstant{separatorcolor}{separatorcolor}
-\setinterfaceconstant{separatorstyle}{separatorstyle}
-\setinterfaceconstant{set}{set}
-\setinterfaceconstant{setups}{setups}
-\setinterfaceconstant{shrink}{shrink}
-\setinterfaceconstant{side}{objektabstand}
-\setinterfaceconstant{sidealign}{sidealign}
-\setinterfaceconstant{sidemethod}{sidemethod}
-\setinterfaceconstant{sidespaceafter}{nebennachspatium}
-\setinterfaceconstant{sidespacebefore}{nebenvorspatium}
-\setinterfaceconstant{sidespaceinbetween}{sidespaceinbetween}
-\setinterfaceconstant{sidethreshold}{sidethreshold}
-\setinterfaceconstant{sign}{zeichen}
-\setinterfaceconstant{simplecommand}{simplecommand}
-\setinterfaceconstant{size}{groesse}
-\setinterfaceconstant{slantedfeatures}{slantedfeatures}
-\setinterfaceconstant{slantedfont}{slantedfont}
-\setinterfaceconstant{small}{klein}
-\setinterfaceconstant{smallcapsfeatures}{smallcapsfeatures}
-\setinterfaceconstant{smallcapsfont}{smallcapsfont}
-\setinterfaceconstant{solution}{solution}
-\setinterfaceconstant{sort}{sort}
-\setinterfaceconstant{sorttype}{sorttype}
-\setinterfaceconstant{source}{quelle}
-\setinterfaceconstant{space}{spatium}
-\setinterfaceconstant{spaceafter}{nachspatium}
-\setinterfaceconstant{spaceafterside}{spaceafterside}
-\setinterfaceconstant{spacebefore}{vorspatium}
-\setinterfaceconstant{spacebeforeside}{spacebeforeside}
-\setinterfaceconstant{spaceinbetween}{spaceinbetween}
-\setinterfaceconstant{spacing}{spatiumausgleich}
-\setinterfaceconstant{specification}{specification}
-\setinterfaceconstant{split}{split}
-\setinterfaceconstant{splitcolor}{splitcolor}
-\setinterfaceconstant{splitmethod}{splitmethod}
-\setinterfaceconstant{splitoffset}{splitoffset}
-\setinterfaceconstant{spot}{spot}
-\setinterfaceconstant{stack}{stack}
-\setinterfaceconstant{stackname}{stackname}
-\setinterfaceconstant{start}{start}
-\setinterfaceconstant{starter}{starter}
-\setinterfaceconstant{state}{status}
-\setinterfaceconstant{step}{schritt}
-\setinterfaceconstant{stop}{stop}
-\setinterfaceconstant{stopper}{abschnitttrenner}
-\setinterfaceconstant{stretch}{strecken}
-\setinterfaceconstant{strip}{strip}
-\setinterfaceconstant{strut}{strut}
-\setinterfaceconstant{style}{stil}
-\setinterfaceconstant{stylealternative}{stylealternative}
-\setinterfaceconstant{sub}{unter}
-\setinterfaceconstant{subtitle}{untertitel}
-\setinterfaceconstant{suffix}{suffix}
-\setinterfaceconstant{suffixseparator}{suffixseparator}
-\setinterfaceconstant{suffixstopper}{suffixstopper}
-\setinterfaceconstant{surnamefirstnamesep}{surnamefirstnamesep}
-\setinterfaceconstant{surnameinitialsep}{surnameinitialsep}
-\setinterfaceconstant{surnamesep}{surnamesep}
-\setinterfaceconstant{svgstyle}{svgstyle}
-\setinterfaceconstant{sx}{sx}
-\setinterfaceconstant{sy}{sy}
-\setinterfaceconstant{symalign}{symausrichtung}
-\setinterfaceconstant{symbol}{symbol}
-\setinterfaceconstant{symbolcommand}{symbolcommand}
-\setinterfaceconstant{symbolset}{symbolset}
-\setinterfaceconstant{symcolor}{symfarbe}
-\setinterfaceconstant{symstyle}{symstil}
-\setinterfaceconstant{synonym}{synonym}
-\setinterfaceconstant{synonymcolor}{synonymfarbe}
-\setinterfaceconstant{synonymcommand}{synonymbefehl}
-\setinterfaceconstant{synonymstyle}{synonymstil}
-\setinterfaceconstant{tab}{tab}
-\setinterfaceconstant{text}{text}
-\setinterfaceconstant{textalign}{textalign}
-\setinterfaceconstant{textcolor}{textfarbe}
-\setinterfaceconstant{textcommand}{textbefehl}
-\setinterfaceconstant{textdistance}{textdistance}
-\setinterfaceconstant{textheight}{texthoehe}
-\setinterfaceconstant{textlayer}{textlayer}
-\setinterfaceconstant{textmargin}{textmargin}
-\setinterfaceconstant{textmethod}{textmethod}
-\setinterfaceconstant{textseparator}{textseparator}
-\setinterfaceconstant{textsize}{textgroesse}
-\setinterfaceconstant{textstate}{textstatus}
-\setinterfaceconstant{textstyle}{textstil}
-\setinterfaceconstant{textwidth}{textbreite}
-\setinterfaceconstant{threshold}{threshold}
-\setinterfaceconstant{time}{time}
-\setinterfaceconstant{title}{titel}
-\setinterfaceconstant{titlecolor}{titelfarbe}
-\setinterfaceconstant{titlecommand}{titlecommand}
-\setinterfaceconstant{titledistance}{titelabstand}
-\setinterfaceconstant{titleleft}{titleleft}
-\setinterfaceconstant{titleright}{titleright}
-\setinterfaceconstant{titlestrut}{titlestrut}
-\setinterfaceconstant{titlestyle}{titelstil}
-\setinterfaceconstant{to}{zu}
-\setinterfaceconstant{toffset}{toffset}
-\setinterfaceconstant{tolerance}{toleranz}
-\setinterfaceconstant{top}{oben}
-\setinterfaceconstant{topcommand}{topcommand}
-\setinterfaceconstant{topdistance}{obenabstand}
-\setinterfaceconstant{topframe}{obenrahmen}
-\setinterfaceconstant{topoffset}{obenoffset}
-\setinterfaceconstant{topspace}{kopfspatium}
-\setinterfaceconstant{topstate}{statusoben}
-\setinterfaceconstant{totalnumber}{totalnumber}
-\setinterfaceconstant{transform}{transform}
-\setinterfaceconstant{translate}{translate}
-\setinterfaceconstant{trimoffset}{trimoffset}
-\setinterfaceconstant{type}{typ}
-\setinterfaceconstant{unit}{einheit}
-\setinterfaceconstant{unknownreference}{unbekantereferenz}
-\setinterfaceconstant{up}{up}
-\setinterfaceconstant{urlalternative}{urlalternative}
-\setinterfaceconstant{urlspace}{urlspatium}
-\setinterfaceconstant{userpassword}{userpassword}
-\setinterfaceconstant{validate}{validieren}
-\setinterfaceconstant{values}{values}
-\setinterfaceconstant{vcommand}{vbefehl}
-\setinterfaceconstant{vcompact}{vcompact}
-\setinterfaceconstant{vector}{vector}
-\setinterfaceconstant{veroffset}{kopfoffset}
-\setinterfaceconstant{vertical}{vertikal}
-\setinterfaceconstant{vfactor}{vfaktor}
-\setinterfaceconstant{vfil}{vfil}
-\setinterfaceconstant{viewerprefix}{viewerprefix}
-\setinterfaceconstant{voffset}{voffset}
-\setinterfaceconstant{vonsep}{vonsep}
-\setinterfaceconstant{way}{art}
-\setinterfaceconstant{wfactor}{bfaktor}
-\setinterfaceconstant{white}{weiss}
-\setinterfaceconstant{width}{breite}
-\setinterfaceconstant{words}{words}
-\setinterfaceconstant{xanchor}{xanchor}
-\setinterfaceconstant{xfactor}{xfaktor}
-\setinterfaceconstant{xhtml}{xhtml}
-\setinterfaceconstant{xmax}{xmax}
-\setinterfaceconstant{xmlsetup}{xmlsetup}
-\setinterfaceconstant{xoffset}{xoffset}
-\setinterfaceconstant{xscale}{xformat}
-\setinterfaceconstant{xstep}{xschritt}
-\setinterfaceconstant{yanchor}{yanchor}
-\setinterfaceconstant{yfactor}{yfaktor}
-\setinterfaceconstant{ymax}{ymax}
-\setinterfaceconstant{yoffset}{yoffset}
-\setinterfaceconstant{yscale}{yformat}
-\setinterfaceconstant{ystep}{yschritt}
-% definitions for interface elements for language de
-%
-\setinterfaceelement{answerlines}{answerlines}
-\setinterfaceelement{answerspace}{answerspace}
-\setinterfaceelement{begin}{anfang}
-\setinterfaceelement{complete}{vollende}
-\setinterfaceelement{coupled}{verknuepft}
-\setinterfaceelement{currentlocal}{aktuelllokal}
-\setinterfaceelement{end}{ende}
-\setinterfaceelement{endsetup}{ein}
-\setinterfaceelement{get}{get}
-\setinterfaceelement{increment}{erhoehen}
-\setinterfaceelement{list}{auflisten}
-\setinterfaceelement{listof}{auflistenvon}
-\setinterfaceelement{load}{laden}
-\setinterfaceelement{local}{lokal}
-\setinterfaceelement{makeup}{umbruch}
-\setinterfaceelement{next}{folgende}
-\setinterfaceelement{place}{platziere}
-\setinterfaceelement{previous}{vorige}
-\setinterfaceelement{previouslocal}{voriglokal}
-\setinterfaceelement{reserve}{reservieren}
-\setinterfaceelement{see}{sieh}
-\setinterfaceelement{setup}{stelle}
-\setinterfaceelement{start}{start}
-\setinterfaceelement{stop}{stop}
-\setinterfaceelement{text}{text}
-\setinterfaceelement{type}{type}
-% definitions for interface commands for language de
-%
-\setinterfacecommand{Character}{Buchstabe}
-\setinterfacecommand{Characters}{Buchstaben}
-\setinterfacecommand{MONTH}{MONAT}
-\setinterfacecommand{Numbers}{Ziffern}
-\setinterfacecommand{Romannumerals}{Roemischezahlen}
-\setinterfacecommand{SmallCapped}{Kap}
-\setinterfacecommand{SmallCaps}{Kaps}
-\setinterfacecommand{WEEKDAY}{WOCHENTAG}
-\setinterfacecommand{WORD}{WORT}
-\setinterfacecommand{WORDS}{WOERTER}
-\setinterfacecommand{Word}{Wort}
-\setinterfacecommand{Words}{Woerter}
-\setinterfacecommand{about}{ueber}
-\setinterfacecommand{adaptfontfeature}{adaptfontfeature}
-\setinterfacecommand{adaptlayout}{passelayoutan}
-\setinterfacecommand{addfeature}{addfeature}
-\setinterfacecommand{alignbottom}{alignbottom}
-\setinterfacecommand{aligned}{aligned}
-\setinterfacecommand{alignedbox}{alignedbox}
-\setinterfacecommand{alignedline}{alignedline}
-\setinterfacecommand{alignhere}{alignhere}
-\setinterfacecommand{alignment}{alignment}
-\setinterfacecommand{alignmentcharacter}{alignmentcharacter}
-\setinterfacecommand{applytocharacters}{applytocharacters}
-\setinterfacecommand{applytofirstcharacter}{applytofirstcharacter}
-\setinterfacecommand{arg}{arg}
-\setinterfacecommand{at}{bei}
-\setinterfacecommand{atleftmargin}{atleftmargin}
-\setinterfacecommand{atpage}{aufseite}
-\setinterfacecommand{atrightmargin}{atrightmargin}
-\setinterfacecommand{background}{hintergrund}
-\setinterfacecommand{backspace}{rumpfweite}
-\setinterfacecommand{blackrule}{rechteck}
-\setinterfacecommand{blackrules}{rechtecke}
-\setinterfacecommand{blank}{blanko}
-\setinterfacecommand{bookmark}{bookmark}
-\setinterfacecommand{bottombox}{bottombox}
-\setinterfacecommand{bottomdistance}{abstandunten}
-\setinterfacecommand{bottomheight}{hoeheunten}
-\setinterfacecommand{bottomleftbox}{bottomleftbox}
-\setinterfacecommand{bottomrightbox}{bottomrightbox}
-\setinterfacecommand{bottomspace}{bottomspace}
-\setinterfacecommand{buildtextbottomdot}{buildtextbottomdot}
-\setinterfacecommand{but}{but}
-\setinterfacecommand{button}{knopf}
-\setinterfacecommand{bypassblocks}{bypassblocks}
-\setinterfacecommand{character}{buchstabe}
-\setinterfacecommand{characters}{buchstaben}
-\setinterfacecommand{chem}{chem}
-\setinterfacecommand{clip}{ausschnitt}
-\setinterfacecommand{clonefield}{klonierefeld}
-\setinterfacecommand{color}{farbe}
-\setinterfacecommand{colorbar}{farbbalken}
-\setinterfacecommand{colorvalue}{farbewert}
-\setinterfacecommand{column}{spalte}
-\setinterfacecommand{comparecolorgroup}{vergleichefarbengruppe}
-\setinterfacecommand{comparepalet}{vergleichepalette}
-\setinterfacecommand{completepagenumber}{completepagenumber}
-\setinterfacecommand{completeregister}{completeregister}
-\setinterfacecommand{component}{komponente}
-\setinterfacecommand{convertnumber}{konvertierezahl}
-\setinterfacecommand{copyfield}{kopierefeld}
-\setinterfacecommand{correctwhitespace}{korrigierezwischenraum}
-\setinterfacecommand{coupledocument}{verknuepfedokument}
-\setinterfacecommand{couplemarking}{verknuepfebeschriftung}
-\setinterfacecommand{couplepage}{doppelseite}
-\setinterfacecommand{couplepaper}{doppelseitigespapier}
-\setinterfacecommand{coupleregister}{verknuepfregister}
-\setinterfacecommand{crlf}{crlf}
-\setinterfacecommand{currentdate}{heutigesdatum}
-\setinterfacecommand{currentheadnumber}{heutigeskopfnummer}
-\setinterfacecommand{cutspace}{cutspace}
-\setinterfacecommand{date}{datum}
-\setinterfacecommand{decouplemarking}{entknuepfebeschriftung}
-\setinterfacecommand{decrementnumber}{decrementnumber}
-\setinterfacecommand{define}{definieren}
-\setinterfacecommand{defineaccent}{definiereakzent}
-\setinterfacecommand{defineblank}{definiereblanko}
-\setinterfacecommand{defineblock}{definiereblock}
-\setinterfacecommand{definebodyfont}{definierefliesstext}
-\setinterfacecommand{definebodyfontenvironment}{definierefliesstextumgebung}
-\setinterfacecommand{definebodyfontswitch}{definebodyfontswitch}
-\setinterfacecommand{definebuffer}{definierepuffer}
-\setinterfacecommand{definecharacter}{definierezeichen}
-\setinterfacecommand{definecharacterkerning}{definecharacterkerning}
-\setinterfacecommand{definecharacterspacing}{definecharacterspacing}
-\setinterfacecommand{definecolor}{definierefarbe}
-\setinterfacecommand{definecolorgroup}{definierefarbengruppe}
-\setinterfacecommand{definecolumnbreak}{definecolumnbreak}
-\setinterfacecommand{definecolumnset}{definecolumnset}
-\setinterfacecommand{definecombination}{definecombination}
-\setinterfacecommand{definecombinedlist}{definierezusammengestellteliste}
-\setinterfacecommand{definecommand}{definierebefehl}
-\setinterfacecommand{defineconversion}{definierekonversion}
-\setinterfacecommand{definedescription}{definierebeschreibung}
-\setinterfacecommand{definedfont}{definedfont}
-\setinterfacecommand{defineenumeration}{definierenummerierung}
-\setinterfacecommand{definefallbackfamily}{definefallbackfamily}
-\setinterfacecommand{definefield}{definierefeld}
-\setinterfacecommand{definefieldstack}{definierefeldstapel}
-\setinterfacecommand{definefiguresymbol}{definiereabbsymbol}
-\setinterfacecommand{definefilefallback}{definefilefallback}
-\setinterfacecommand{definefirstline}{definefirstline}
-\setinterfacecommand{definefloat}{definieregleitobjekt}
-\setinterfacecommand{definefont}{definiereschrift}
-\setinterfacecommand{definefontalternative}{definefontalternative}
-\setinterfacecommand{definefontfallback}{definefontfallback}
-\setinterfacecommand{definefontfamily}{definefontfamily}
-\setinterfacecommand{definefontfamilypreset}{definefontfamilypreset}
-\setinterfacecommand{definefontfeature}{definefontfeature}
-\setinterfacecommand{definefontfile}{definefontfile}
-\setinterfacecommand{definefontsize}{definefontsize}
-\setinterfacecommand{definefontsolution}{definefontsolution}
-\setinterfacecommand{definefontstyle}{definiereschriftstil}
-\setinterfacecommand{definefontsynonym}{defineschriftsynonym}
-\setinterfacecommand{defineframed}{definiereumrahmt}
-\setinterfacecommand{defineframedtext}{definiereumrahmtertext}
-\setinterfacecommand{definefrozenfont}{definefrozenfont}
-\setinterfacecommand{definehbox}{definierehbox}
-\setinterfacecommand{definehead}{definiereueberschrift}
-\setinterfacecommand{definehyphenationfeatures}{definehyphenationfeatures}
-\setinterfacecommand{defineindentedtext}{defineindentedtext}
-\setinterfacecommand{defineinmargin}{defineinmargin}
-\setinterfacecommand{defineinteractionmenu}{definiereinteraktionsmenue}
-\setinterfacecommand{defineitemgroup}{defineitemgroup}
-\setinterfacecommand{defineitems}{defineitems}
-\setinterfacecommand{definelabel}{definierelabel}
-\setinterfacecommand{definelayer}{definelayer}
-\setinterfacecommand{definelayout}{definelayout}
-\setinterfacecommand{definelinenote}{definelinenote}
-\setinterfacecommand{definelist}{definiereliste}
-\setinterfacecommand{definelogo}{definierelogo}
-\setinterfacecommand{definemainfield}{definierehauptfeld}
-\setinterfacecommand{definemakeup}{definiereumbruch}
-\setinterfacecommand{definemarking}{definierebeschriftung}
-\setinterfacecommand{definemathalignment}{definemathalignment}
-\setinterfacecommand{definemode}{definemode}
-\setinterfacecommand{definenamedcolor}{definenamedcolor}
-\setinterfacecommand{definenote}{definenote}
-\setinterfacecommand{defineoutput}{defineoutput}
-\setinterfacecommand{defineoverlay}{definiereoverlay}
-\setinterfacecommand{definepagebreak}{definepagebreak}
-\setinterfacecommand{definepalet}{definierepalette}
-\setinterfacecommand{definepapersize}{definierepapierformat}
-\setinterfacecommand{defineparagraphs}{definiereabsaetze}
-\setinterfacecommand{defineperiodkerning}{defineperiodkerning}
-\setinterfacecommand{defineplacement}{defineplacement}
-\setinterfacecommand{defineprofile}{definiereprofil}
-\setinterfacecommand{defineprogram}{definiereprogramme}
-\setinterfacecommand{definerawfont}{definerawfont}
-\setinterfacecommand{definereference}{definierereferenz}
-\setinterfacecommand{definereferenceformat}{definierereferenzformat}
-\setinterfacecommand{definereferencelist}{definierereferenzliste}
-\setinterfacecommand{defineregister}{definiereregister}
-\setinterfacecommand{definerule}{definerule}
-\setinterfacecommand{definesection}{definiereabschnitt}
-\setinterfacecommand{definesectionblock}{definiereabschnittsblock}
-\setinterfacecommand{definesorting}{definieresortieren}
-\setinterfacecommand{definestartstop}{definierestartstop}
-\setinterfacecommand{definestyle}{definierestil}
-\setinterfacecommand{definesubfield}{definieresubfeld}
-\setinterfacecommand{definesymbol}{definieresymbol}
-\setinterfacecommand{definesynonyms}{definieresynonyme}
-\setinterfacecommand{definetabletemplate}{definieretabellenvorlage}
-\setinterfacecommand{definetabulate}{definieretabulator}
-\setinterfacecommand{definetext}{definieretext}
-\setinterfacecommand{definetextbackground}{definetextbackground}
-\setinterfacecommand{definetextnote}{definetextnote}
-\setinterfacecommand{definetextposition}{definetextposition}
-\setinterfacecommand{definetextvariable}{definetextvariable}
-\setinterfacecommand{definetype}{definetype}
-\setinterfacecommand{definetyping}{definieretippen}
-\setinterfacecommand{defineversion}{definiereversion}
-\setinterfacecommand{depthspanningtext}{depthspanningtext}
-\setinterfacecommand{determineheadnumber}{bestimmekopfnummer}
-\setinterfacecommand{determinelistcharacteristics}{bestimmelistencharakeristika}
-\setinterfacecommand{determineregistercharacteristics}{bestimmeregistercharakteristika}
-\setinterfacecommand{dimension}{dimension}
-\setinterfacecommand{disableinteractionmenu}{inaktiviereinteraktionsmenue}
-\setinterfacecommand{disablemode}{disablemode}
-\setinterfacecommand{doaddfeature}{doaddfeature}
-\setinterfacecommand{domicile}{wohnort}
-\setinterfacecommand{dontconvertfont}{dontconvertfont}
-\setinterfacecommand{donttest}{keintest}
-\setinterfacecommand{edgedistance}{randabstand}
-\setinterfacecommand{edgewidth}{randbreite}
-\setinterfacecommand{emphasisboldface}{emphasisboldface}
-\setinterfacecommand{emptylines}{emptylines}
-\setinterfacecommand{enablemode}{enablemode}
-\setinterfacecommand{environment}{umgebung}
-\setinterfacecommand{externalfigure}{externeabbildung}
-\setinterfacecommand{fact}{geg}
-\setinterfacecommand{fastswitchtobodyfont}{fastswitchtobodyfont}
-\setinterfacecommand{feature}{feature}
-\setinterfacecommand{field}{feld}
-\setinterfacecommand{fieldstack}{feldstapel}
-\setinterfacecommand{fillinfield}{ausfuellfeld}
-\setinterfacecommand{fillinline}{gefuelltezeile}
-\setinterfacecommand{fillinrules}{gefuelltesrechteck}
-\setinterfacecommand{fillintext}{ausfuelltext}
-\setinterfacecommand{firstcharacter}{firstcharacter}
-\setinterfacecommand{fitfield}{passendfeld}
-\setinterfacecommand{fittopbaselinegrid}{fittopbaselinegrid}
-\setinterfacecommand{fixedspace}{festesspatium}
-\setinterfacecommand{fixedspaces}{festesspatium}
-\setinterfacecommand{flushnotes}{flushnotes}
-\setinterfacecommand{followprofile}{folgeprofil}
-\setinterfacecommand{followprofileversion}{folgeprofilversion}
-\setinterfacecommand{followversion}{folgeversion}
-\setinterfacecommand{footerdistance}{fusszeileabstand}
-\setinterfacecommand{footerheight}{fusszeilenhoehe}
-\setinterfacecommand{footnote}{fussnote}
-\setinterfacecommand{footnotetext}{footnotetext}
-\setinterfacecommand{forceblocks}{forceblocks}
-\setinterfacecommand{forcecharacterstripping}{forcecharacterstripping}
-\setinterfacecommand{formulanumber}{formelnummer}
-\setinterfacecommand{fraction}{bruch}
-\setinterfacecommand{framed}{umrahmt}
-\setinterfacecommand{from}{von}
-\setinterfacecommand{fromlinenote}{fromlinenote}
-\setinterfacecommand{getbuffer}{holepuffer}
-\setinterfacecommand{getfirstcharacter}{getfirstcharacter}
-\setinterfacecommand{getmarking}{holebeschriftung}
-\setinterfacecommand{getnumber}{getnumber}
-\setinterfacecommand{globaldisablemode}{globaldisablemode}
-\setinterfacecommand{globalenablemode}{globalenablemode}
-\setinterfacecommand{globalpreventmode}{globalpreventmode}
-\setinterfacecommand{godown}{nachunten}
-\setinterfacecommand{goto}{zu}
-\setinterfacecommand{gotobox}{zurbox}
-\setinterfacecommand{gotopage}{zurseite}
-\setinterfacecommand{graycolor}{graufarbe}
-\setinterfacecommand{greyvalue}{grauwert}
-\setinterfacecommand{grid}{gitter}
-\setinterfacecommand{hairline}{haarlinie}
-\setinterfacecommand{head}{kopf}
-\setinterfacecommand{headerdistance}{kopfzeilenabstand}
-\setinterfacecommand{headerheight}{kopfzeilenhoehe}
-\setinterfacecommand{headlevel}{kopfniveau}
-\setinterfacecommand{headnumber}{kopfnummer}
-\setinterfacecommand{headsym}{headsym}
-\setinterfacecommand{headtext}{ueberschrifttext}
-\setinterfacecommand{heightspanningtext}{heightspanningtext}
-\setinterfacecommand{hideblocks}{verbergebloecke}
-\setinterfacecommand{high}{hoch}
-\setinterfacecommand{hl}{hl}
-\setinterfacecommand{immediatebetweenlist}{immediatebetweenlist}
-\setinterfacecommand{immediatetolist}{immediatetolist}
-\setinterfacecommand{in}{in}
-\setinterfacecommand{incrementnumber}{nummererhoehen}
-\setinterfacecommand{indenting}{einziehen}
-\setinterfacecommand{inframed}{imumriss}
-\setinterfacecommand{infull}{volleswort}
-\setinterfacecommand{ininner}{ininner}
-\setinterfacecommand{inleft}{imlinken}
-\setinterfacecommand{inleftedge}{imlinkenrand}
-\setinterfacecommand{inleftmargin}{inlinkermarginale}
-\setinterfacecommand{inline}{inzeile}
-\setinterfacecommand{inmargin}{inmarginalie}
-\setinterfacecommand{inmframed}{immaumrise}
-\setinterfacecommand{inneredgedistance}{inneredgedistance}
-\setinterfacecommand{inneredgewidth}{inneredgewidth}
-\setinterfacecommand{innermargindistance}{innermargindistance}
-\setinterfacecommand{innermarginwidth}{innermarginwidth}
-\setinterfacecommand{inothermargin}{inanderermarginale}
-\setinterfacecommand{inouter}{inouter}
-\setinterfacecommand{inright}{imrechten}
-\setinterfacecommand{inrightedge}{imrechtenrand}
-\setinterfacecommand{inrightmargin}{inrechtermarginale}
-\setinterfacecommand{installlanguage}{installieresprache}
-\setinterfacecommand{interactionbar}{interaktionsbalken}
-\setinterfacecommand{interactionbuttons}{interaktionsknopfe}
-\setinterfacecommand{interactionmenu}{interaktionsmenue}
-\setinterfacecommand{item}{pos}
-\setinterfacecommand{itemgroup}{itemgroup}
-\setinterfacecommand{items}{posten}
-\setinterfacecommand{itemtag}{itemtag}
-\setinterfacecommand{its}{its}
-\setinterfacecommand{keepblocks}{behaltebloecke}
-\setinterfacecommand{kerncharacters}{kerncharacters}
-\setinterfacecommand{label}{label}
-\setinterfacecommand{labels}{labels}
-\setinterfacecommand{labeltext}{labeltext}
-\setinterfacecommand{language}{sprache}
-\setinterfacecommand{languageCharacters}{languageCharacters}
-\setinterfacecommand{languagecharacters}{languagecharacters}
-\setinterfacecommand{leftaligned}{linksbuendig}
-\setinterfacecommand{leftbottombox}{leftbottombox}
-\setinterfacecommand{leftedgedistance}{abstandlinkerrand}
-\setinterfacecommand{leftedgewidth}{breitelinkerrand}
-\setinterfacecommand{leftline}{leftline}
-\setinterfacecommand{leftmargindistance}{linkemarginalafstand}
-\setinterfacecommand{leftmarginwidth}{linkemarginalbreite}
-\setinterfacecommand{leg}{leg}
-\setinterfacecommand{linecorrection}{linecorrection}
-\setinterfacecommand{linenote}{linenote}
-\setinterfacecommand{linespanningtext}{linespanningtext}
-\setinterfacecommand{linewidth}{liniendicke}
-\setinterfacecommand{listheight}{listenhoehe}
-\setinterfacecommand{listlength}{listenlaenge}
-\setinterfacecommand{listsymbol}{listsymbol}
-\setinterfacecommand{listwidth}{listenbreite}
-\setinterfacecommand{loadfontgoodies}{loadfontgoodies}
-\setinterfacecommand{localfootnotes}{localfootnotes}
-\setinterfacecommand{localnotes}{localnotes}
-\setinterfacecommand{logfields}{registrierefelder}
-\setinterfacecommand{lohi}{tiho}
-\setinterfacecommand{low}{tief}
-\setinterfacecommand{macroname}{name}
-\setinterfacecommand{mainlanguage}{hauptsprache}
-\setinterfacecommand{makeupheight}{satzhoehe}
-\setinterfacecommand{makeupwidth}{satzbreite}
-\setinterfacecommand{mar}{mar}
-\setinterfacecommand{marginblock}{marginblock}
-\setinterfacecommand{margindistance}{marginalafstand}
-\setinterfacecommand{marginrule}{marginallinie}
-\setinterfacecommand{margintext}{marginaltext}
-\setinterfacecommand{margintitle}{marginaltitel}
-\setinterfacecommand{marginwidth}{marginalbreite}
-\setinterfacecommand{marginword}{marginalwort}
-\setinterfacecommand{marking}{beschriftung}
-\setinterfacecommand{markversion}{beschrifteversion}
-\setinterfacecommand{mathematics}{mathematik}
-\setinterfacecommand{menubutton}{menueknopf}
-\setinterfacecommand{mframed}{maumrise}
-\setinterfacecommand{midaligned}{zentriert}
-\setinterfacecommand{mirror}{spiegeln}
-\setinterfacecommand{month}{monat}
-\setinterfacecommand{moveformula}{moveformula}
-\setinterfacecommand{moveongrid}{amgitterneuausrichten}
-\setinterfacecommand{movesidefloat}{movesidefloat}
-\setinterfacecommand{navigating}{navigating}
-\setinterfacecommand{nodimension}{keindimension}
-\setinterfacecommand{noheaderandfooterlines}{keinekopfundfusszeilen}
-\setinterfacecommand{noindenting}{nichteinziehen}
-\setinterfacecommand{noitem}{noitem}
-\setinterfacecommand{nolist}{keineliste}
-\setinterfacecommand{nomarking}{keinebeschriftung}
-\setinterfacecommand{nomoreblocks}{keinebloeckemehr}
-\setinterfacecommand{nomorefiles}{keinedateienmehr}
-\setinterfacecommand{nop}{nop}
-\setinterfacecommand{nospace}{keinspatium}
-\setinterfacecommand{note}{notiz}
-\setinterfacecommand{notesymbol}{notesymbol}
-\setinterfacecommand{notopandbottomlines}{keinzeilenobenundunten}
-\setinterfacecommand{notsmallcapped}{nokap}
-\setinterfacecommand{nowhitespace}{keinzwischenraum}
-\setinterfacecommand{numberofsubpages}{numberofsubpages}
-\setinterfacecommand{numbers}{ziffern}
-\setinterfacecommand{outeredgedistance}{outeredgedistance}
-\setinterfacecommand{outeredgewidth}{outeredgewidth}
-\setinterfacecommand{outermargindistance}{outermargindistance}
-\setinterfacecommand{outermarginwidth}{outermarginwidth}
-\setinterfacecommand{packed}{kleinerdurchschuss}
-\setinterfacecommand{page}{seite}
-\setinterfacecommand{pagebreak}{pagebreak}
-\setinterfacecommand{pagedepth}{pagedepth}
-\setinterfacecommand{pagenumber}{seitenummer}
-\setinterfacecommand{pageoffset}{pageoffset}
-\setinterfacecommand{pagereference}{seitenreferenz}
-\setinterfacecommand{paperheight}{papierhoehe}
-\setinterfacecommand{paperwidth}{papierbreite}
-\setinterfacecommand{periods}{punkt}
-\setinterfacecommand{placebookmarks}{platzierebookmarks}
-\setinterfacecommand{placecombinedlist}{platzierezusammengestellteliste}
-\setinterfacecommand{placefloat}{placefloat}
-\setinterfacecommand{placefootnotes}{platzierefussnoten}
-\setinterfacecommand{placeformula}{platziereformel}
-\setinterfacecommand{placeheadnumber}{placeheadnumber}
-\setinterfacecommand{placeheadtext}{placeheadtext}
-\setinterfacecommand{placelegend}{platzierelegende}
-\setinterfacecommand{placelist}{platziereliste}
-\setinterfacecommand{placelistofsynonyms}{placelistofsynonyms}
-\setinterfacecommand{placelocalfootnotes}{platzierelokalefussnoten}
-\setinterfacecommand{placelocalnotes}{placelocalnotes}
-\setinterfacecommand{placelogos}{platzierelogo}
-\setinterfacecommand{placenamedfloat}{placenamedfloat}
-\setinterfacecommand{placenotes}{placenotes}
-\setinterfacecommand{placeongrid}{amgitterausrichten}
-\setinterfacecommand{placeontopofeachother}{platziereuntereinander}
-\setinterfacecommand{placepagenumber}{placepagenumber}
-\setinterfacecommand{placerawlist}{placerawlist}
-\setinterfacecommand{placereferencelist}{placereferencelist}
-\setinterfacecommand{placeregister}{platziereregister}
-\setinterfacecommand{placerule}{placerule}
-\setinterfacecommand{placesidebyside}{platzierenebeneinander}
-\setinterfacecommand{placesubformula}{platziereunterformel}
-\setinterfacecommand{placetextvariable}{placetextvariable}
-\setinterfacecommand{position}{position}
-\setinterfacecommand{positiontext}{positiontext}
-\setinterfacecommand{postponenotes}{postponenotes}
-\setinterfacecommand{postponingnotes}{postponingnotes}
-\setinterfacecommand{predefinedfont}{predefinedfont}
-\setinterfacecommand{predefinefont}{predefinefont}
-\setinterfacecommand{presetdocument}{presetdocument}
-\setinterfacecommand{prettyprintbuffer}{prettyprintbuffer}
-\setinterfacecommand{preventmode}{preventmode}
-\setinterfacecommand{printpaperheight}{printpapierhoehe}
-\setinterfacecommand{printpaperwidth}{printpapierbreite}
-\setinterfacecommand{processblocks}{bearbeitebloecke}
-\setinterfacecommand{processbodyfontenvironmentlist}{processbodyfontenvironmentlist}
-\setinterfacecommand{processpage}{bearbeiteseite}
-\setinterfacecommand{product}{produkt}
-\setinterfacecommand{program}{programm}
-\setinterfacecommand{project}{projekt}
-\setinterfacecommand{publication}{publikation}
-\setinterfacecommand{quotation}{zitat}
-\setinterfacecommand{quote}{zitieren}
-\setinterfacecommand{ran}{ran}
-\setinterfacecommand{redo}{wiederholen}
-\setinterfacecommand{redoconvertfont}{redoconvertfont}
-\setinterfacecommand{ref}{ref}
-\setinterfacecommand{reference}{referenz}
-\setinterfacecommand{referral}{verweis}
-\setinterfacecommand{referraldate}{verweisdatum}
-\setinterfacecommand{referring}{referieren}
-\setinterfacecommand{registerfontclass}{registerfontclass}
-\setinterfacecommand{registerhyphenationexception}{registerhyphenationexception}
-\setinterfacecommand{registerhyphenationpattern}{registerhyphenationpattern}
-\setinterfacecommand{remark}{bemerkung}
-\setinterfacecommand{replacefeature}{replacefeature}
-\setinterfacecommand{reset}{ruecksetzten}
-\setinterfacecommand{resetandaddfeature}{resetandaddfeature}
-\setinterfacecommand{resetcharacteralign}{resetcharacteralign}
-\setinterfacecommand{resetcharacterkerning}{resetcharacterkerning}
-\setinterfacecommand{resetcharacterspacing}{resetcharacterspacing}
-\setinterfacecommand{resetcharacterstripping}{resetcharacterstripping}
-\setinterfacecommand{resetfeature}{resetfeature}
-\setinterfacecommand{resetfontcolorsheme}{resetfontcolorsheme}
-\setinterfacecommand{resetfontfallback}{resetfontfallback}
-\setinterfacecommand{resetfontsolution}{resetfontsolution}
-\setinterfacecommand{resethyphenationfeatures}{resethyphenationfeatures}
-\setinterfacecommand{resetlocalfloats}{resetlocalfloats}
-\setinterfacecommand{resetmarking}{ruecksetztenbeschriftung}
-\setinterfacecommand{resetmode}{resetmode}
-\setinterfacecommand{resetnumber}{resetnumber}
-\setinterfacecommand{resetpath}{resetpath}
-\setinterfacecommand{resetperiodkerning}{resetperiodkerning}
-\setinterfacecommand{resetsystemmode}{resetsystemmode}
-\setinterfacecommand{resettextcontent}{resettextcontent}
-\setinterfacecommand{resetvisualizers}{resetvisualizers}
-\setinterfacecommand{restoreglobalbodyfont}{restoreglobalbodyfont}
-\setinterfacecommand{retestfeature}{retestfeature}
-\setinterfacecommand{revivefeature}{revivefeature}
-\setinterfacecommand{rightaligned}{rechtsbuendig}
-\setinterfacecommand{rightbottombox}{rightbottombox}
-\setinterfacecommand{rightedgedistance}{abstandrechterrand}
-\setinterfacecommand{rightedgewidth}{breiterechterrand}
-\setinterfacecommand{rightline}{rightline}
-\setinterfacecommand{rightmargindistance}{rechtemarginalafstand}
-\setinterfacecommand{rightmarginwidth}{rechtemarginalbreite}
-\setinterfacecommand{romannumerals}{roemischezahlen}
-\setinterfacecommand{rotate}{drehen}
-\setinterfacecommand{savebuffer}{savebuffer}
-\setinterfacecommand{scale}{format}
-\setinterfacecommand{screen}{bildschirm}
-\setinterfacecommand{selectblocks}{waehlebloeckeaus}
-\setinterfacecommand{selectpaper}{waehlepapieraus}
-\setinterfacecommand{selectversion}{waehleversionaus}
-\setinterfacecommand{setbigbodyfont}{setbigbodyfont}
-\setinterfacecommand{setcharacteralign}{setcharacteralign}
-\setinterfacecommand{setcharacteraligndetail}{setcharacteraligndetail}
-\setinterfacecommand{setcharactercasing}{setcharactercasing}
-\setinterfacecommand{setcharactercleaning}{setcharactercleaning}
-\setinterfacecommand{setcharacterkerning}{setcharacterkerning}
-\setinterfacecommand{setcharacterspacing}{setcharacterspacing}
-\setinterfacecommand{setcharacterstripping}{setcharacterstripping}
-\setinterfacecommand{setcurrentfontclass}{setcurrentfontclass}
-\setinterfacecommand{setfirstline}{setfirstline}
-\setinterfacecommand{setfirstpasscharacteralign}{setfirstpasscharacteralign}
-\setinterfacecommand{setfont}{setfont}
-\setinterfacecommand{setfontcolorsheme}{setfontcolorsheme}
-\setinterfacecommand{setfontfeature}{setfontfeature}
-\setinterfacecommand{setfontsolution}{setfontsolution}
-\setinterfacecommand{setfontstrut}{setfontstrut}
-\setinterfacecommand{sethyphenationfeatures}{sethyphenationfeatures}
-\setinterfacecommand{setmainbodyfont}{setmainbodyfont}
-\setinterfacecommand{setmode}{setmode}
-\setinterfacecommand{setnote}{setnote}
-\setinterfacecommand{setnotetext}{setnotetext}
-\setinterfacecommand{setnumber}{setnumber}
-\setinterfacecommand{setperiodkerning}{setperiodkerning}
-\setinterfacecommand{setsecondpasscharacteralign}{setsecondpasscharacteralign}
-\setinterfacecommand{setsmallbodyfont}{setsmallbodyfont}
-\setinterfacecommand{setsystemmode}{setsystemmode}
-\setinterfacecommand{settextcontent}{settext}
-\setinterfacecommand{settextvariable}{settextvariable}
-\setinterfacecommand{setupalign}{stelleausrichtungein}
-\setinterfacecommand{setupanswerarea}{setupanswerarea}
-\setinterfacecommand{setuparranging}{stelleanordnenein}
-\setinterfacecommand{setupattachment}{setupattachment}
-\setinterfacecommand{setupbackground}{stellehintergrundein}
-\setinterfacecommand{setupbackgrounds}{stellehintergruendeein}
-\setinterfacecommand{setupblackrules}{stellerechteckein}
-\setinterfacecommand{setupblank}{stelleblankoein}
-\setinterfacecommand{setupblock}{stelleblockein}
-\setinterfacecommand{setupbodyfont}{stellefliesstextein}
-\setinterfacecommand{setupbodyfontenvironment}{stellefliesstextumgebungein}
-\setinterfacecommand{setupbottom}{stelleuntenein}
-\setinterfacecommand{setupbottomtexts}{stelletextuntenein}
-\setinterfacecommand{setupbuffer}{stellepufferein}
-\setinterfacecommand{setupbuttons}{stelleknopfein}
-\setinterfacecommand{setupcapitals}{stelleversalienein}
-\setinterfacecommand{setupcaption}{stellebildunterschriftein}
-\setinterfacecommand{setupcaptions}{stellebilderunterschriftein}
-\setinterfacecommand{setupcharacteralign}{setupcharacteralign}
-\setinterfacecommand{setupcharacterkerning}{setupcharacterkerning}
-\setinterfacecommand{setupcharacterspacing}{setupcharacterspacing}
-\setinterfacecommand{setupclipping}{stelleausschnittein}
-\setinterfacecommand{setupcolor}{stellefarbeein}
-\setinterfacecommand{setupcolors}{stellefarbenein}
-\setinterfacecommand{setupcolumns}{stellespaltenein}
-\setinterfacecommand{setupcolumnset}{setupcolumnset}
-\setinterfacecommand{setupcolumnsetlines}{setupcolumnsetlines}
-\setinterfacecommand{setupcolumnsetstart}{setupcolumnsetstart}
-\setinterfacecommand{setupcombinations}{stellekombinationein}
-\setinterfacecommand{setupcombinedlist}{stellezusammengestelltelisteein}
-\setinterfacecommand{setupcomment}{stellekommentarein}
-\setinterfacecommand{setupcounter}{setupcounter}
-\setinterfacecommand{setupdescription}{setupdescription}
-\setinterfacecommand{setupdescriptions}{definierebeschreibungen}
-\setinterfacecommand{setupenumeration}{setupenumeration}
-\setinterfacecommand{setupenumerations}{stellebeschreibungein}
-\setinterfacecommand{setupexternalfigures}{stelleexterneabbildungenein}
-\setinterfacecommand{setupfield}{stellefeldein}
-\setinterfacecommand{setupfields}{stellefelderin}
-\setinterfacecommand{setupfillinlines}{stellegefuelltezeileein}
-\setinterfacecommand{setupfillinrules}{stellegefuelltesrechteckein}
-\setinterfacecommand{setupfirstline}{setupfirstline}
-\setinterfacecommand{setupfloat}{stellegleitobjektein}
-\setinterfacecommand{setupfloats}{stellegleitobjekteein}
-\setinterfacecommand{setupfloatsplitting}{stelleplatziegeteiltegleitobjekt}
-\setinterfacecommand{setupfontexpansion}{setupfontexpansion}
-\setinterfacecommand{setupfontprotrusion}{setupfontprotrusion}
-\setinterfacecommand{setupfonts}{setupfonts}
-\setinterfacecommand{setupfontsolution}{setupfontsolution}
-\setinterfacecommand{setupfooter}{stellefusszeileein}
-\setinterfacecommand{setupfootertexts}{stellefusszeilentextein}
-\setinterfacecommand{setupfootnotedefinition}{stellefussnotendefinitionein}
-\setinterfacecommand{setupfootnotes}{stellefussnotenein}
-\setinterfacecommand{setupforms}{setupforms}
-\setinterfacecommand{setupformula}{setupformula}
-\setinterfacecommand{setupformulas}{stelleformelnein}
-\setinterfacecommand{setupframed}{stelleumrahmtein}
-\setinterfacecommand{setupframedtext}{setupframedtext}
-\setinterfacecommand{setupframedtexts}{stelleumrahmtetexteein}
-\setinterfacecommand{setuphead}{stelleueberschriftein}
-\setinterfacecommand{setupheader}{stellekopfzeileein}
-\setinterfacecommand{setupheadertexts}{stellekopfzeilentextein}
-\setinterfacecommand{setupheadnumber}{stellekopfzahlein}
-\setinterfacecommand{setupheads}{stelleueberschriftenein}
-\setinterfacecommand{setupheadtext}{stelleueberschrifttextein}
-\setinterfacecommand{setuphyphenation}{setuphyphenation}
-\setinterfacecommand{setuphyphenmark}{stellebindestrichein}
-\setinterfacecommand{setupindentedtext}{setupindentedtext}
-\setinterfacecommand{setupindenting}{stelleeinziehenein}
-\setinterfacecommand{setupinmargin}{stelleinmarginalieein}
-\setinterfacecommand{setupinteraction}{stelleinteraktionein}
-\setinterfacecommand{setupinteractionbar}{stelleinteraktionsbalkenein}
-\setinterfacecommand{setupinteractionmenu}{stelleinteraktionsmenueein}
-\setinterfacecommand{setupinteractionscreen}{stelleinteraktionsbildschirmein}
-\setinterfacecommand{setupinterlinespace}{stellezeilenabstandein}
-\setinterfacecommand{setupitemgroup}{setupitemgroup}
-\setinterfacecommand{setupitemgroups}{stelleaufzaehlungenein}
-\setinterfacecommand{setupitems}{stellepostenein}
-\setinterfacecommand{setuplabeltext}{stellelabeltextein}
-\setinterfacecommand{setuplanguage}{stellespracheein}
-\setinterfacecommand{setuplayout}{stellelayoutein}
-\setinterfacecommand{setuplegend}{stellelegendeein}
-\setinterfacecommand{setuplinenote}{setuplinenote}
-\setinterfacecommand{setuplinenumbering}{stellezeilennumerierungein}
-\setinterfacecommand{setuplines}{stellezeilenein}
-\setinterfacecommand{setuplinewidth}{stellelinienbreiteein}
-\setinterfacecommand{setuplist}{stellelisteein}
-\setinterfacecommand{setupmakeup}{stelleumbruchein}
-\setinterfacecommand{setupmarginblock}{setupmarginblock}
-\setinterfacecommand{setupmarginblocks}{stellemarginalblockein}
-\setinterfacecommand{setupmargindata}{setupmargindata}
-\setinterfacecommand{setupmarginrules}{stellemarginallinieein}
-\setinterfacecommand{setupmarking}{stellebeschriftungein}
-\setinterfacecommand{setupmathalignment}{setupmathalignment}
-\setinterfacecommand{setupnarrower}{stelleengerein}
-\setinterfacecommand{setupnotation}{setupnotation}
-\setinterfacecommand{setupnotations}{setupnotations}
-\setinterfacecommand{setupnote}{setupnote}
-\setinterfacecommand{setupnotes}{setupnotes}
-\setinterfacecommand{setupnumber}{setupnumber}
-\setinterfacecommand{setupnumbering}{stellenummerierungein}
-\setinterfacecommand{setupoppositeplacing}{stellegegenueberplatzierenein}
-\setinterfacecommand{setupoutput}{stelleausgabeein}
-\setinterfacecommand{setuppagecomment}{stelleseitenkommentarein}
-\setinterfacecommand{setuppagenumber}{stelleseitennummerein}
-\setinterfacecommand{setuppagenumbering}{stelleseitennummeriernungein}
-\setinterfacecommand{setuppagetransitions}{stelleseitenuebergangein}
-\setinterfacecommand{setuppalet}{stellepaletteein}
-\setinterfacecommand{setuppaper}{setuppaper}
-\setinterfacecommand{setuppapersize}{stellepapierformatein}
-\setinterfacecommand{setupparagraphnumbering}{stelleabsatznummerierungein}
-\setinterfacecommand{setupparagraphs}{stelleabsaetzeein}
-\setinterfacecommand{setupperiodkerning}{setupperiodkerning}
-\setinterfacecommand{setupplacement}{setupplacement}
-\setinterfacecommand{setuppositioning}{stellepositionierenein}
-\setinterfacecommand{setupprofiles}{stelleprofilein}
-\setinterfacecommand{setupprograms}{stelleprogrammein}
-\setinterfacecommand{setuppublications}{stellepublikationein}
-\setinterfacecommand{setupquote}{stellezitierenein}
-\setinterfacecommand{setupreferencelist}{stellereferenzlisteein}
-\setinterfacecommand{setupreferencing}{stellereferenzierenein}
-\setinterfacecommand{setupregister}{stelleregisterein}
-\setinterfacecommand{setuprotate}{stelledrehenein}
-\setinterfacecommand{setuprule}{setuprule}
-\setinterfacecommand{setupscreens}{stellerasterein}
-\setinterfacecommand{setupsection}{stelleabschnittein}
-\setinterfacecommand{setupsectionblock}{stelleabschnittsblockein}
-\setinterfacecommand{setupsorting}{stellesortierenein}
-\setinterfacecommand{setupspacing}{stellespatiumein}
-\setinterfacecommand{setupstartstop}{setupstartstop}
-\setinterfacecommand{setupstrut}{setupstrut}
-\setinterfacecommand{setupsubpagenumber}{stelleunterseitennummerein}
-\setinterfacecommand{setupsymbolset}{stellesymbolsetein}
-\setinterfacecommand{setupsynchronization}{stellesynchronisationein}
-\setinterfacecommand{setupsynchronizationbar}{stellesynchronisationsbalkenein}
-\setinterfacecommand{setupsynonyms}{stellesynonymein}
-\setinterfacecommand{setupsystem}{stellesystemein}
-\setinterfacecommand{setuptab}{stelletabein}
-\setinterfacecommand{setuptables}{stelletabellenein}
-\setinterfacecommand{setuptabulate}{stelletabulatorein}
-\setinterfacecommand{setuptext}{stelletextein}
-\setinterfacecommand{setuptextbackground}{setuptextbackground}
-\setinterfacecommand{setuptextnote}{setuptextnote}
-\setinterfacecommand{setuptextposition}{setuptextposition}
-\setinterfacecommand{setuptextrules}{stelletextumrissein}
-\setinterfacecommand{setuptexttexts}{stelletexttexteein}
-\setinterfacecommand{setuptextvariable}{setuptextvariable}
-\setinterfacecommand{setupthinrules}{stelleduennerumrissein}
-\setinterfacecommand{setuptolerance}{stelletoleranzein}
-\setinterfacecommand{setuptop}{stellenobenein}
-\setinterfacecommand{setuptoptexts}{stelletextobenein}
-\setinterfacecommand{setuptype}{stelletipein}
-\setinterfacecommand{setuptyping}{stelletippenein}
-\setinterfacecommand{setupunderbar}{stelleunterstreichenein}
-\setinterfacecommand{setupurl}{stelleurlein}
-\setinterfacecommand{setupversions}{stelleversionein}
-\setinterfacecommand{setupwhitespace}{stellezwischenraumein}
-\setinterfacecommand{setvisualizerfont}{setvisualizerfont}
-\setinterfacecommand{showbodyfont}{zeigefliesstext}
-\setinterfacecommand{showbodyfontenvironment}{zeigefliesstextumgebung}
-\setinterfacecommand{showcolor}{zeigefarbe}
-\setinterfacecommand{showcolorgroup}{zeigefarbengruppe}
-\setinterfacecommand{showcounter}{showcounter}
-\setinterfacecommand{showexternalfigures}{zeigeexterneabbildungen}
-\setinterfacecommand{showfields}{zeigefelder}
-\setinterfacecommand{showfont}{showfont}
-\setinterfacecommand{showfontdata}{showfontdata}
-\setinterfacecommand{showfontexpansion}{showfontexpansion}
-\setinterfacecommand{showfontitalics}{showfontitalics}
-\setinterfacecommand{showfontkerns}{showfontkerns}
-\setinterfacecommand{showfontparameters}{showfontparameters}
-\setinterfacecommand{showfontstrip}{showfontstrip}
-\setinterfacecommand{showfontstyle}{showfontstyle}
-\setinterfacecommand{showframe}{zeigerahmen}
-\setinterfacecommand{showgrid}{zeigegitter}
-\setinterfacecommand{showhyphenationtrace}{showhyphenationtrace}
-\setinterfacecommand{showkerning}{showkerning}
-\setinterfacecommand{showlayout}{zeigelayout}
-\setinterfacecommand{showmakeup}{zeigeumbruch}
-\setinterfacecommand{showminimalbaseline}{showminimalbaseline}
-\setinterfacecommand{showpalet}{zeigepalette}
-\setinterfacecommand{showprint}{zeigedruck}
-\setinterfacecommand{showsetups}{zeigeeinstellungen}
-\setinterfacecommand{showstruts}{zeigestruts}
-\setinterfacecommand{showsymbolset}{showsymbolset}
-\setinterfacecommand{smallcapped}{kap}
-\setinterfacecommand{someline}{einezeile}
-\setinterfacecommand{somewhere}{irgendwo}
-\setinterfacecommand{space}{spatium}
-\setinterfacecommand{specialitem}{specialitem}
-\setinterfacecommand{splitfloat}{teilegleitobjekt}
-\setinterfacecommand{startalignment}{startausrichtung}
-\setinterfacecommand{startbackground}{starthintergrund}
-\setinterfacecommand{startcoding}{startkodierung}
-\setinterfacecommand{startcolor}{startfarbe}
-\setinterfacecommand{startcolumnmakeup}{startcolumnmakeup}
-\setinterfacecommand{startcolumns}{startspalten}
-\setinterfacecommand{startcolumnset}{startcolumnset}
-\setinterfacecommand{startcombination}{startkombination}
-\setinterfacecommand{startcomponent}{startkomponente}
-\setinterfacecommand{startdocument}{startdokument}
-\setinterfacecommand{startenvironment}{startumgebung}
-\setinterfacecommand{startfigure}{startabbildung}
-\setinterfacecommand{startframed}{startframed}
-\setinterfacecommand{startglobal}{startglobal}
-\setinterfacecommand{startline}{startzeile}
-\setinterfacecommand{startlinecorrection}{startzeilenkorrektur}
-\setinterfacecommand{startlinenote}{startlinenote}
-\setinterfacecommand{startlinenumbering}{startzeilennumerierung}
-\setinterfacecommand{startlines}{startzeilen}
-\setinterfacecommand{startlocal}{startlokal}
-\setinterfacecommand{startlocalfootnotes}{startlokalefussnoten}
-\setinterfacecommand{startmakeup}{startumbruch}
-\setinterfacecommand{startmarginblock}{startmarginalblock}
-\setinterfacecommand{startmarginrule}{startmarginallinie}
-\setinterfacecommand{startnarrower}{startenger}
-\setinterfacecommand{startopposite}{startgegenueber}
-\setinterfacecommand{startoverlay}{startoverlay}
-\setinterfacecommand{startoverview}{startueberblick}
-\setinterfacecommand{startpacked}{startkleinerdurchschuss}
-\setinterfacecommand{startpositioning}{startpositionieren}
-\setinterfacecommand{startproduct}{startprodukt}
-\setinterfacecommand{startprofile}{startprofil}
-\setinterfacecommand{startproject}{startprojekt}
-\setinterfacecommand{startquotation}{startzitat}
-\setinterfacecommand{startraster}{startraster}
-\setinterfacecommand{startsymbolset}{startsymbolset}
-\setinterfacecommand{startsynchronization}{startsynchronisation}
-\setinterfacecommand{starttable}{starttabelle}
-\setinterfacecommand{starttables}{starttabellen}
-\setinterfacecommand{starttext}{starttext}
-\setinterfacecommand{starttextbackground}{starttextbackground}
-\setinterfacecommand{starttextrule}{starttextlinie}
-\setinterfacecommand{startunpacked}{startgrosserdurchschuss}
-\setinterfacecommand{startversion}{startversion}
-\setinterfacecommand{stopalignment}{stopausrichtung}
-\setinterfacecommand{stopbackground}{stophintergrund}
-\setinterfacecommand{stopcoding}{stopkodierung}
-\setinterfacecommand{stopcolor}{stopfarbe}
-\setinterfacecommand{stopcolumnmakeup}{stopcolumnmakeup}
-\setinterfacecommand{stopcolumns}{stopspalten}
-\setinterfacecommand{stopcolumnset}{stopcolumnset}
-\setinterfacecommand{stopcombination}{stopkombination}
-\setinterfacecommand{stopcomponent}{stopkomponente}
-\setinterfacecommand{stopdocument}{stopdokument}
-\setinterfacecommand{stopenvironment}{stopumgebung}
-\setinterfacecommand{stopframed}{stopframed}
-\setinterfacecommand{stopglobal}{stopglobal}
-\setinterfacecommand{stopline}{stopzeile}
-\setinterfacecommand{stoplinecorrection}{stopzeilenkorrektur}
-\setinterfacecommand{stoplinenote}{stoplinenote}
-\setinterfacecommand{stoplinenumbering}{stopzeilennumerierung}
-\setinterfacecommand{stoplines}{stopzeilen}
-\setinterfacecommand{stoplocal}{stoplokal}
-\setinterfacecommand{stoplocalfootnotes}{stoplokalefussnoten}
-\setinterfacecommand{stopmakeup}{stopumbruch}
-\setinterfacecommand{stopmarginblock}{stopmarginalblock}
-\setinterfacecommand{stopmarginrule}{stopmarginallinie}
-\setinterfacecommand{stopnarrower}{stopenger}
-\setinterfacecommand{stopopposite}{stopgegenueber}
-\setinterfacecommand{stopoverlay}{stopoverlay}
-\setinterfacecommand{stopoverview}{stopueberblick}
-\setinterfacecommand{stoppacked}{stopkleinerdurchschuss}
-\setinterfacecommand{stoppositioning}{stoppositionieren}
-\setinterfacecommand{stopproduct}{stopprodukt}
-\setinterfacecommand{stopprofile}{stopprofil}
-\setinterfacecommand{stopproject}{stopprojekt}
-\setinterfacecommand{stopquotation}{stopzitat}
-\setinterfacecommand{stopraster}{stopraster}
-\setinterfacecommand{stopsynchronization}{stopsynchronisation}
-\setinterfacecommand{stoptable}{stoptabelle}
-\setinterfacecommand{stoptables}{stoptabellen}
-\setinterfacecommand{stoptext}{stoptext}
-\setinterfacecommand{stoptextbackground}{stoptextbackground}
-\setinterfacecommand{stoptextrule}{stoptextlinie}
-\setinterfacecommand{stopunpacked}{stopgrosserdurchschuss}
-\setinterfacecommand{stopversion}{stopversion}
-\setinterfacecommand{stretched}{gestreckt}
-\setinterfacecommand{strictinspectnextcharacter}{strictinspectnextcharacter}
-\setinterfacecommand{stripcharacter}{stripcharacter}
-\setinterfacecommand{subformulanumber}{unterformelnummer}
-\setinterfacecommand{subpagenumber}{subpagenumber}
-\setinterfacecommand{subtractfeature}{subtractfeature}
-\setinterfacecommand{switchtobodyfont}{wechselezumfliesstext}
-\setinterfacecommand{switchtorawfont}{switchtorawfont}
-\setinterfacecommand{sym}{sym}
-\setinterfacecommand{symbol}{symbol}
-\setinterfacecommand{symoffset}{symoffset}
-\setinterfacecommand{synchronizationbar}{synchronisationsbalken}
-\setinterfacecommand{synchronize}{synchronisieren}
-\setinterfacecommand{tab}{tab}
-\setinterfacecommand{testcolumn}{testcolumn}
-\setinterfacecommand{testfeature}{testfeature}
-\setinterfacecommand{testfeatureonce}{testfeatureonce}
-\setinterfacecommand{testpage}{testpage}
-\setinterfacecommand{tex}{tex}
-\setinterfacecommand{textbackground}{textbackground}
-\setinterfacecommand{textcolor}{textcolor}
-\setinterfacecommand{textheight}{texthoehe}
-\setinterfacecommand{textnote}{textnote}
-\setinterfacecommand{textreference}{textreferenz}
-\setinterfacecommand{textrule}{textlinie}
-\setinterfacecommand{textvariable}{textvariable}
-\setinterfacecommand{textwidth}{textbreite}
-\setinterfacecommand{thefirstcharacter}{thefirstcharacter}
-\setinterfacecommand{thenormalizedbodyfontsize}{thenormalizedbodyfontsize}
-\setinterfacecommand{theremainingcharacters}{theremainingcharacters}
-\setinterfacecommand{thinrule}{duennelinie}
-\setinterfacecommand{thinrules}{duennerumriss}
-\setinterfacecommand{tolinenote}{tolinenote}
-\setinterfacecommand{tooltip}{tooltip}
-\setinterfacecommand{topdistance}{abstandoben}
-\setinterfacecommand{topheight}{hoeheoben}
-\setinterfacecommand{topspace}{kopfweite}
-\setinterfacecommand{totalnumberofpages}{gesamtseitenanzahl}
-\setinterfacecommand{translate}{uebersetzten}
-\setinterfacecommand{txt}{txt}
-\setinterfacecommand{typ}{tip}
-\setinterfacecommand{type}{tippen}
-\setinterfacecommand{typebuffer}{tippepuffer}
-\setinterfacecommand{typedefinedbuffer}{typedefinedbuffer}
-\setinterfacecommand{typefile}{tippedatei}
-\setinterfacecommand{typeinlinebuffer}{typeinlinebuffer}
-\setinterfacecommand{typing}{typing}
-\setinterfacecommand{unitmeaning}{bedeutung}
-\setinterfacecommand{unknown}{unbekant}
-\setinterfacecommand{unregisterhyphenationpattern}{unregisterhyphenationpattern}
-\setinterfacecommand{useJSscripts}{verwendeJSscript}
-\setinterfacecommand{useURL}{verwendeURL}
-\setinterfacecommand{useXMLfilter}{useXMLfilter}
-\setinterfacecommand{useblocks}{verwendebloecke}
-\setinterfacecommand{usebodyfont}{usebodyfont}
-\setinterfacecommand{usebodyfontparameter}{usebodyfontparameter}
-\setinterfacecommand{usecommands}{verwendebefehl}
-\setinterfacecommand{useencoding}{benutzekodierung}
-\setinterfacecommand{useexternaldocument}{verwendeexteresdokument}
-\setinterfacecommand{useexternalfigure}{verwendeexterneabbildung}
-\setinterfacecommand{useexternalfile}{verwendeexternedatei}
-\setinterfacecommand{useexternalfiles}{verwendeexternedateien}
-\setinterfacecommand{useexternalsoundtrack}{verwendeexternestonstueck}
-\setinterfacecommand{usemodule}{verwendemodul}
-\setinterfacecommand{usemodules}{verwendemodule}
-\setinterfacecommand{usepath}{benutzeverzeichnis}
-\setinterfacecommand{usereferences}{verwendereferenzen}
-\setinterfacecommand{usespecials}{benutzespezielles}
-\setinterfacecommand{usesymbols}{verwendesymbole}
-\setinterfacecommand{usetypescript}{usetypescript}
-\setinterfacecommand{usetypescriptfile}{usetypescriptfile}
-\setinterfacecommand{useurl}{verwendeurl}
-\setinterfacecommand{verbatim}{verbatim}
-\setinterfacecommand{version}{version}
-\setinterfacecommand{vl}{vl}
-\setinterfacecommand{weekday}{wochentag}
-\setinterfacecommand{whitespace}{zwischenraum}
-\setinterfacecommand{widthspanningtext}{widthspanningtext}
-\setinterfacecommand{wordright}{wortrechts}
-\setinterfacecommand{writebetweenlist}{schreibezwischenliste}
-\setinterfacecommand{writetolist}{schreibezurliste}
-\setinterfacecommand{writetoreferencelist}{schreibezurreferenzliste}
-\setinterfacecommand{writetoregister}{schreibezumregister}
-%
-\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/context/base/mkii/mult-def.mkii b/Master/texmf-dist/tex/context/base/mkii/mult-def.mkii
deleted file mode 100644
index a75ef993f55..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/mult-def.mkii
+++ /dev/null
@@ -1,31 +0,0 @@
-%D \module
-%D [ file=mult-def,
-%D version=2008.10.22,
-%D title=\CONTEXT\ Multilingual Macros,
-%D subtitle=Definitions,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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
-
-\setvalue{@interface@czech@}{cs}
-\setvalue{@interface@german@}{de}
-\setvalue{@interface@english@}{en}
-\setvalue{@interface@french@}{fr}
-\setvalue{@interface@italian@}{it}
-\setvalue{@interface@dutch@}{nl}
-\setvalue{@interface@persian@}{pe}
-\setvalue{@interface@romanian@}{ro}
-
-\def\userinterfacetag{\ifcsname @interface@\currentinterface @\endcsname\csname @interface@\currentinterface @\endcsname\else en\fi}
-\def\userresponsestag{\ifcsname @interface@\currentresponses @\endcsname\csname @interface@\currentresponses @\endcsname\else en\fi}
-
-\input mult-\userinterfacetag .\mksuffix \relax
-\input mult-m\userresponsestag.\mksuffix \relax
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/mult-en.mkii b/Master/texmf-dist/tex/context/base/mkii/mult-en.mkii
deleted file mode 100644
index d3a073db356..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/mult-en.mkii
+++ /dev/null
@@ -1,2221 +0,0 @@
-% this file is auto-generated, don't edit this file
-%
-% definitions for interface variables for language en
-%
-\setinterfacevariable{Addition}{Addition}
-\setinterfacevariable{Alphabetic}{Alphabetic}
-\setinterfacevariable{Balloon}{Balloon}
-\setinterfacevariable{Cap}{Cap}
-\setinterfacevariable{Capital}{Capital}
-\setinterfacevariable{Character}{Character}
-\setinterfacevariable{Characters}{Characters}
-\setinterfacevariable{CloseDocument}{CloseDocument}
-\setinterfacevariable{ExitViewer}{ExitViewer}
-\setinterfacevariable{FirstPage}{FirstPage}
-\setinterfacevariable{FitHeight}{FitHeight}
-\setinterfacevariable{FitWidth}{FitWidth}
-\setinterfacevariable{GotoPage}{GotoPage}
-\setinterfacevariable{Greek}{Greek}
-\setinterfacevariable{Help}{Help}
-\setinterfacevariable{HideField}{HideField}
-\setinterfacevariable{HideLayer}{HideLayer}
-\setinterfacevariable{Key}{Key}
-\setinterfacevariable{LastPage}{LastPage}
-\setinterfacevariable{LoadForm}{LoadForm}
-\setinterfacevariable{MONTH}{MONTH}
-\setinterfacevariable{New}{New}
-\setinterfacevariable{NextJump}{NextJump}
-\setinterfacevariable{NextPage}{NextPage}
-\setinterfacevariable{Numbers}{Numbers}
-\setinterfacevariable{OpenNamedDocument}{OpenNamedDocument}
-\setinterfacevariable{Ordinal}{Ordinal}
-\setinterfacevariable{Paragraph}{Paragraph}
-\setinterfacevariable{PauseMovie}{PauseMovie}
-\setinterfacevariable{PauseRendering}{PauseRendering}
-\setinterfacevariable{PauseSound}{PauseSound}
-\setinterfacevariable{PreviousJump}{PreviousJump}
-\setinterfacevariable{PreviousPage}{PreviousPage}
-\setinterfacevariable{PrintDocument}{PrintDocument}
-\setinterfacevariable{Query}{Query}
-\setinterfacevariable{QueryAgain}{QueryAgain}
-\setinterfacevariable{ResetForm}{ResetForm}
-\setinterfacevariable{ResumeMovie}{ResumeMovie}
-\setinterfacevariable{ResumeRendering}{ResumeRendering}
-\setinterfacevariable{ResumeSound}{ResumeSound}
-\setinterfacevariable{Romannumerals}{Romannumerals}
-\setinterfacevariable{SaveDocument}{SaveDocument}
-\setinterfacevariable{SaveForm}{SaveForm}
-\setinterfacevariable{SaveNamedDocument}{SaveNamedDocument}
-\setinterfacevariable{SearchAgain}{SearchAgain}
-\setinterfacevariable{SearchDocument}{SearchDocument}
-\setinterfacevariable{ShowBookmarks}{ShowBookmarks}
-\setinterfacevariable{ShowField}{ShowField}
-\setinterfacevariable{ShowThumbs}{ShowThumbs}
-\setinterfacevariable{StartMovie}{StartMovie}
-\setinterfacevariable{StartRendering}{StartRendering}
-\setinterfacevariable{StartSound}{StartSound}
-\setinterfacevariable{StopMovie}{StopMovie}
-\setinterfacevariable{StopRendering}{StopRendering}
-\setinterfacevariable{StopSound}{StopSound}
-\setinterfacevariable{SubmitForm}{SubmitForm}
-\setinterfacevariable{ToggleLayer}{ToggleLayer}
-\setinterfacevariable{ToggleViewer}{ToggleViewer}
-\setinterfacevariable{URL}{URL}
-\setinterfacevariable{VideLayer}{VideLayer}
-\setinterfacevariable{ViewerHelp}{ViewerHelp}
-\setinterfacevariable{WEEKDAY}{WEEKDAY}
-\setinterfacevariable{WORD}{WORD}
-\setinterfacevariable{WORDS}{WORDS}
-\setinterfacevariable{Word}{Word}
-\setinterfacevariable{Words}{Words}
-\setinterfacevariable{abbreviation}{abbreviation}
-\setinterfacevariable{abbreviations}{abbreviations}
-\setinterfacevariable{absolute}{absolute}
-\setinterfacevariable{action}{action}
-\setinterfacevariable{after}{after}
-\setinterfacevariable{all}{all}
-\setinterfacevariable{alphabetic}{alphabetic}
-\setinterfacevariable{always}{always}
-\setinterfacevariable{anchor}{anchor}
-\setinterfacevariable{and}{and}
-\setinterfacevariable{answerarea}{answerarea}
-\setinterfacevariable{appendices}{appendices}
-\setinterfacevariable{appendix}{appendix}
-\setinterfacevariable{april}{april}
-\setinterfacevariable{aside}{aside}
-\setinterfacevariable{atleftmargin}{atleftmargin}
-\setinterfacevariable{atmargin}{atmargin}
-\setinterfacevariable{atpage}{atpage}
-\setinterfacevariable{atrightmargin}{atrightmargin}
-\setinterfacevariable{attachment}{attachment}
-\setinterfacevariable{august}{august}
-\setinterfacevariable{author}{author}
-\setinterfacevariable{auto}{auto}
-\setinterfacevariable{autointro}{autointro}
-\setinterfacevariable{autopunctuation}{autopunctuation}
-\setinterfacevariable{back}{back}
-\setinterfacevariable{background}{background}
-\setinterfacevariable{backmatter}{backmatter}
-\setinterfacevariable{backpart}{backpart}
-\setinterfacevariable{backspace}{backspace}
-\setinterfacevariable{backward}{backward}
-\setinterfacevariable{bbl}{bbl}
-\setinterfacevariable{before}{before}
-\setinterfacevariable{begin}{begin}
-\setinterfacevariable{bib}{bib}
-\setinterfacevariable{big}{big}
-\setinterfacevariable{bigbodyfont}{bigbodyfont}
-\setinterfacevariable{bigger}{bigger}
-\setinterfacevariable{bigpreference}{bigpreference}
-\setinterfacevariable{blank}{blank}
-\setinterfacevariable{block}{block}
-\setinterfacevariable{blockquote}{blockquote}
-\setinterfacevariable{bodymatter}{bodymatter}
-\setinterfacevariable{bodypart}{bodypart}
-\setinterfacevariable{bold}{bold}
-\setinterfacevariable{bolditalic}{bolditalic}
-\setinterfacevariable{boldslanted}{boldslanted}
-\setinterfacevariable{bookmark}{bookmark}
-\setinterfacevariable{both}{both}
-\setinterfacevariable{bothtext}{bothtext}
-\setinterfacevariable{bottom}{bottom}
-\setinterfacevariable{box}{box}
-\setinterfacevariable{brief}{brief}
-\setinterfacevariable{broad}{broad}
-\setinterfacevariable{buffer}{buffer}
-\setinterfacevariable{by}{by}
-\setinterfacevariable{calligraphic}{calligraphic}
-\setinterfacevariable{camel}{camel}
-\setinterfacevariable{cap}{cap}
-\setinterfacevariable{capital}{capital}
-\setinterfacevariable{category}{category}
-\setinterfacevariable{cd:character}{cd:character}
-\setinterfacevariable{cd:font}{cd:font}
-\setinterfacevariable{center}{center}
-\setinterfacevariable{centerlast}{centerlast}
-\setinterfacevariable{chapter}{chapter}
-\setinterfacevariable{character}{character}
-\setinterfacevariable{characters}{characters}
-\setinterfacevariable{chemical}{chemical}
-\setinterfacevariable{chemicals}{chemicals}
-\setinterfacevariable{chemistry}{chemistry}
-\setinterfacevariable{cite}{cite}
-\setinterfacevariable{closed}{closed}
-\setinterfacevariable{color}{color}
-\setinterfacevariable{column}{column}
-\setinterfacevariable{columns}{columns}
-\setinterfacevariable{combination}{combination}
-\setinterfacevariable{command}{command}
-\setinterfacevariable{commands}{commands}
-\setinterfacevariable{comment}{comment}
-\setinterfacevariable{component}{component}
-\setinterfacevariable{compressseparator}{compressseparator}
-\setinterfacevariable{compressstopper}{compressstopper}
-\setinterfacevariable{concept}{concept}
-\setinterfacevariable{construction}{construction}
-\setinterfacevariable{content}{content}
-\setinterfacevariable{contents}{contents}
-\setinterfacevariable{continue}{continue}
-\setinterfacevariable{continued}{continued}
-\setinterfacevariable{controls}{controls}
-\setinterfacevariable{conversion}{conversion}
-\setinterfacevariable{current}{current}
-\setinterfacevariable{cutspace}{cutspace}
-\setinterfacevariable{dataset}{dataset}
-\setinterfacevariable{date}{date}
-\setinterfacevariable{day}{day}
-\setinterfacevariable{december}{december}
-\setinterfacevariable{default}{default}
-\setinterfacevariable{depth}{depth}
-\setinterfacevariable{description}{description}
-\setinterfacevariable{disable}{disable}
-\setinterfacevariable{display}{display}
-\setinterfacevariable{dot}{dot}
-\setinterfacevariable{doublesided}{doublesided}
-\setinterfacevariable{down}{down}
-\setinterfacevariable{each}{each}
-\setinterfacevariable{edge}{edge}
-\setinterfacevariable{effective}{effective}
-\setinterfacevariable{eight}{eight}
-\setinterfacevariable{embed}{embed}
-\setinterfacevariable{empty}{empty}
-\setinterfacevariable{enable}{enable}
-\setinterfacevariable{end}{end}
-\setinterfacevariable{endnote}{endnote}
-\setinterfacevariable{enumeration}{enumeration}
-\setinterfacevariable{environment}{environment}
-\setinterfacevariable{even}{even}
-\setinterfacevariable{export}{export}
-\setinterfacevariable{external}{external}
-\setinterfacevariable{extremestretch}{extremestretch}
-\setinterfacevariable{fact}{fact}
-\setinterfacevariable{fallback}{fallback}
-\setinterfacevariable{february}{february}
-\setinterfacevariable{field}{field}
-\setinterfacevariable{figure}{figure}
-\setinterfacevariable{figures}{figures}
-\setinterfacevariable{file}{file}
-\setinterfacevariable{final}{final}
-\setinterfacevariable{first}{first}
-\setinterfacevariable{firstcolumn}{firstcolumn}
-\setinterfacevariable{firstpage}{firstpage}
-\setinterfacevariable{firstsubpage}{firstsubpage}
-\setinterfacevariable{fit}{fit}
-\setinterfacevariable{five}{five}
-\setinterfacevariable{fix}{fix}
-\setinterfacevariable{fixed}{fixed}
-\setinterfacevariable{flexible}{flexible}
-\setinterfacevariable{float}{float}
-\setinterfacevariable{flushinner}{flushinner}
-\setinterfacevariable{flushleft}{flushleft}
-\setinterfacevariable{flushouter}{flushouter}
-\setinterfacevariable{flushright}{flushright}
-\setinterfacevariable{followingpage}{followingpage}
-\setinterfacevariable{font}{font}
-\setinterfacevariable{footer}{footer}
-\setinterfacevariable{footnote}{footnote}
-\setinterfacevariable{force}{force}
-\setinterfacevariable{foreground}{foreground}
-\setinterfacevariable{formula}{formula}
-\setinterfacevariable{formulas}{formulas}
-\setinterfacevariable{forward}{forward}
-\setinterfacevariable{four}{four}
-\setinterfacevariable{fractions}{fractions}
-\setinterfacevariable{frame}{frame}
-\setinterfacevariable{framedtext}{framedtext}
-\setinterfacevariable{friday}{friday}
-\setinterfacevariable{frontmatter}{frontmatter}
-\setinterfacevariable{frontpart}{frontpart}
-\setinterfacevariable{fullhz}{fullhz}
-\setinterfacevariable{global}{global}
-\setinterfacevariable{graphic}{graphic}
-\setinterfacevariable{graphics}{graphics}
-\setinterfacevariable{gray}{gray}
-\setinterfacevariable{greek}{greek}
-\setinterfacevariable{grid}{grid}
-\setinterfacevariable{halfline}{halfline}
-\setinterfacevariable{handwritten}{handwritten}
-\setinterfacevariable{hang}{hang}
-\setinterfacevariable{hanging}{hanging}
-\setinterfacevariable{hangingboth}{hangingboth}
-\setinterfacevariable{head}{head}
-\setinterfacevariable{header}{header}
-\setinterfacevariable{headintext}{headintext}
-\setinterfacevariable{height}{height}
-\setinterfacevariable{helptext}{helptext}
-\setinterfacevariable{hencefore}{hencefore}
-\setinterfacevariable{here}{here}
-\setinterfacevariable{hereafter}{hereafter}
-\setinterfacevariable{hidden}{hidden}
-\setinterfacevariable{hiddenbar}{hiddenbar}
-\setinterfacevariable{hiding}{hiding}
-\setinterfacevariable{high}{high}
-\setinterfacevariable{horizontal}{horizontal}
-\setinterfacevariable{hyphenated}{hyphenated}
-\setinterfacevariable{hz}{hz}
-\setinterfacevariable{inbetween}{inbetween}
-\setinterfacevariable{index}{index}
-\setinterfacevariable{indices}{indices}
-\setinterfacevariable{inherit}{inherit}
-\setinterfacevariable{ininner}{ininner}
-\setinterfacevariable{ininneredge}{ininneredge}
-\setinterfacevariable{ininnermargin}{ininnermargin}
-\setinterfacevariable{inleft}{inleft}
-\setinterfacevariable{inleftedge}{inleftedge}
-\setinterfacevariable{inleftmargin}{inleftmargin}
-\setinterfacevariable{inline}{inline}
-\setinterfacevariable{inmargin}{inmargin}
-\setinterfacevariable{inner}{inner}
-\setinterfacevariable{inneredge}{inneredge}
-\setinterfacevariable{innermargin}{innermargin}
-\setinterfacevariable{inother}{inother}
-\setinterfacevariable{inouter}{inouter}
-\setinterfacevariable{inouteredge}{inouteredge}
-\setinterfacevariable{inoutermargin}{inoutermargin}
-\setinterfacevariable{inright}{inright}
-\setinterfacevariable{inrightedge}{inrightedge}
-\setinterfacevariable{inrightmargin}{inrightmargin}
-\setinterfacevariable{integral}{integral}
-\setinterfacevariable{interaction}{interaction}
-\setinterfacevariable{interactionmenu}{interactionmenu}
-\setinterfacevariable{interactive}{interactive}
-\setinterfacevariable{intermezzi}{intermezzi}
-\setinterfacevariable{intermezzo}{intermezzo}
-\setinterfacevariable{intext}{intext}
-\setinterfacevariable{intro}{intro}
-\setinterfacevariable{invertedshort}{invertedshort}
-\setinterfacevariable{italic}{italic}
-\setinterfacevariable{italicbold}{italicbold}
-\setinterfacevariable{item}{item}
-\setinterfacevariable{itemize}{itemize}
-\setinterfacevariable{its}{its}
-\setinterfacevariable{january}{january}
-\setinterfacevariable{joinedup}{joinedup}
-\setinterfacevariable{july}{july}
-\setinterfacevariable{june}{june}
-\setinterfacevariable{keep}{keep}
-\setinterfacevariable{kerncharacters}{kerncharacters}
-\setinterfacevariable{knockout}{knockout}
-\setinterfacevariable{label}{label}
-\setinterfacevariable{landscape}{landscape}
-\setinterfacevariable{last}{last}
-\setinterfacevariable{lastcolumn}{lastcolumn}
-\setinterfacevariable{lastpage}{lastpage}
-\setinterfacevariable{lastpagenumber}{lastpagenumber}
-\setinterfacevariable{lastsubpage}{lastsubpage}
-\setinterfacevariable{layer}{layer}
-\setinterfacevariable{left}{left}
-\setinterfacevariable{leftedge}{leftedge}
-\setinterfacevariable{lefthanging}{lefthanging}
-\setinterfacevariable{leftmargin}{leftmargin}
-\setinterfacevariable{leftpage}{leftpage}
-\setinterfacevariable{lefttoright}{lefttoright}
-\setinterfacevariable{legend}{legend}
-\setinterfacevariable{less}{less}
-\setinterfacevariable{lesshyphenation}{lesshyphenation}
-\setinterfacevariable{letterspacing}{letterspacing}
-\setinterfacevariable{line}{line}
-\setinterfacevariable{linenote}{linenote}
-\setinterfacevariable{lines}{lines}
-\setinterfacevariable{linked}{linked}
-\setinterfacevariable{list}{list}
-\setinterfacevariable{local}{local}
-\setinterfacevariable{localenvironment}{localenvironment}
-\setinterfacevariable{logo}{logo}
-\setinterfacevariable{logos}{logos}
-\setinterfacevariable{lohi}{lohi}
-\setinterfacevariable{long}{long}
-\setinterfacevariable{loose}{loose}
-\setinterfacevariable{low}{low}
-\setinterfacevariable{ls}{ls}
-\setinterfacevariable{makeup}{makeup}
-\setinterfacevariable{mar}{mar}
-\setinterfacevariable{march}{march}
-\setinterfacevariable{margin}{margin}
-\setinterfacevariable{marginedge}{marginedge}
-\setinterfacevariable{margintext}{margintext}
-\setinterfacevariable{margintitle}{margintitle}
-\setinterfacevariable{marking}{marking}
-\setinterfacevariable{math}{math}
-\setinterfacevariable{mathalignment}{mathalignment}
-\setinterfacevariable{mathcases}{mathcases}
-\setinterfacevariable{mathematics}{mathematics}
-\setinterfacevariable{mathmatrix}{mathmatrix}
-\setinterfacevariable{max}{max}
-\setinterfacevariable{maxdepth}{maxdepth}
-\setinterfacevariable{maxheight}{maxheight}
-\setinterfacevariable{maxwidth}{maxwidth}
-\setinterfacevariable{may}{may}
-\setinterfacevariable{mediaeval}{mediaeval}
-\setinterfacevariable{medium}{medium}
-\setinterfacevariable{middle}{middle}
-\setinterfacevariable{min}{min}
-\setinterfacevariable{mindepth}{mindepth}
-\setinterfacevariable{minheight}{minheight}
-\setinterfacevariable{minwidth}{minwidth}
-\setinterfacevariable{mirrored}{mirrored}
-\setinterfacevariable{mixed}{mixed}
-\setinterfacevariable{monday}{monday}
-\setinterfacevariable{mono}{mono}
-\setinterfacevariable{monobold}{monobold}
-\setinterfacevariable{mononormal}{mononormal}
-\setinterfacevariable{month}{month}
-\setinterfacevariable{more}{more}
-\setinterfacevariable{morehyphenation}{morehyphenation}
-\setinterfacevariable{name}{name}
-\setinterfacevariable{narrow}{narrow}
-\setinterfacevariable{negative}{negative}
-\setinterfacevariable{never}{never}
-\setinterfacevariable{new}{new}
-\setinterfacevariable{next}{next}
-\setinterfacevariable{nextevenpage}{nextevenpage}
-\setinterfacevariable{nextoddpage}{nextoddpage}
-\setinterfacevariable{nextpage}{nextpage}
-\setinterfacevariable{nextsubpage}{nextsubpage}
-\setinterfacevariable{nine}{nine}
-\setinterfacevariable{no}{no}
-\setinterfacevariable{nocheck}{nocheck}
-\setinterfacevariable{nodepth}{nodepth}
-\setinterfacevariable{nofit}{nofit}
-\setinterfacevariable{nogrid}{nogrid}
-\setinterfacevariable{noheight}{noheight}
-\setinterfacevariable{nohz}{nohz}
-\setinterfacevariable{noline}{noline}
-\setinterfacevariable{nomarking}{nomarking}
-\setinterfacevariable{nomenubar}{nomenubar}
-\setinterfacevariable{none}{none}
-\setinterfacevariable{nonumber}{nonumber}
-\setinterfacevariable{norepeat}{norepeat}
-\setinterfacevariable{normal}{normal}
-\setinterfacevariable{normalshort}{normalshort}
-\setinterfacevariable{nospacing}{nospacing}
-\setinterfacevariable{nostopper}{nostopper}
-\setinterfacevariable{not}{not}
-\setinterfacevariable{notation}{notation}
-\setinterfacevariable{note}{note}
-\setinterfacevariable{nothanging}{nothanging}
-\setinterfacevariable{nothyphenated}{nothyphenated}
-\setinterfacevariable{notjoinedup}{notjoinedup}
-\setinterfacevariable{november}{november}
-\setinterfacevariable{nowhere}{nowhere}
-\setinterfacevariable{nowhite}{nowhite}
-\setinterfacevariable{number}{number}
-\setinterfacevariable{numbers}{numbers}
-\setinterfacevariable{october}{october}
-\setinterfacevariable{odd}{odd}
-\setinterfacevariable{off}{off}
-\setinterfacevariable{offset}{offset}
-\setinterfacevariable{old}{old}
-\setinterfacevariable{oldstyle}{oldstyle}
-\setinterfacevariable{on}{on}
-\setinterfacevariable{one}{one}
-\setinterfacevariable{opposite}{opposite}
-\setinterfacevariable{ordinal}{ordinal}
-\setinterfacevariable{outer}{outer}
-\setinterfacevariable{outeredge}{outeredge}
-\setinterfacevariable{outermargin}{outermargin}
-\setinterfacevariable{overbar}{overbar}
-\setinterfacevariable{overbars}{overbars}
-\setinterfacevariable{overlay}{overlay}
-\setinterfacevariable{overprint}{overprint}
-\setinterfacevariable{overstrike}{overstrike}
-\setinterfacevariable{overstrikes}{overstrikes}
-\setinterfacevariable{packed}{packed}
-\setinterfacevariable{page}{page}
-\setinterfacevariable{pagecomment}{pagecomment}
-\setinterfacevariable{pagenumber}{pagenumber}
-\setinterfacevariable{paper}{paper}
-\setinterfacevariable{paragraph}{paragraph}
-\setinterfacevariable{part}{part}
-\setinterfacevariable{positive}{positive}
-\setinterfacevariable{postponing}{postponing}
-\setinterfacevariable{postscript}{postscript}
-\setinterfacevariable{precedingpage}{precedingpage}
-\setinterfacevariable{preference}{preference}
-\setinterfacevariable{preview}{preview}
-\setinterfacevariable{previous}{previous}
-\setinterfacevariable{previousevenpage}{previousevenpage}
-\setinterfacevariable{previousoddpage}{previousoddpage}
-\setinterfacevariable{previouspage}{previouspage}
-\setinterfacevariable{previoussubpage}{previoussubpage}
-\setinterfacevariable{print}{print}
-\setinterfacevariable{printable}{printable}
-\setinterfacevariable{process}{process}
-\setinterfacevariable{product}{product}
-\setinterfacevariable{program}{program}
-\setinterfacevariable{project}{project}
-\setinterfacevariable{protected}{protected}
-\setinterfacevariable{quadruple}{quadruple}
-\setinterfacevariable{quarterline}{quarterline}
-\setinterfacevariable{quotation}{quotation}
-\setinterfacevariable{quote}{quote}
-\setinterfacevariable{ran}{ran}
-\setinterfacevariable{random}{random}
-\setinterfacevariable{readonly}{readonly}
-\setinterfacevariable{rectangular}{rectangular}
-\setinterfacevariable{reference}{reference}
-\setinterfacevariable{referral}{referral}
-\setinterfacevariable{region}{region}
-\setinterfacevariable{register}{register}
-\setinterfacevariable{regular}{regular}
-\setinterfacevariable{relative}{relative}
-\setinterfacevariable{repeat}{repeat}
-\setinterfacevariable{required}{required}
-\setinterfacevariable{reset}{reset}
-\setinterfacevariable{reverse}{reverse}
-\setinterfacevariable{right}{right}
-\setinterfacevariable{rightedge}{rightedge}
-\setinterfacevariable{righthanging}{righthanging}
-\setinterfacevariable{rightmargin}{rightmargin}
-\setinterfacevariable{rightpage}{rightpage}
-\setinterfacevariable{righttoleft}{righttoleft}
-\setinterfacevariable{roman}{roman}
-\setinterfacevariable{romannumerals}{romannumerals}
-\setinterfacevariable{rotate}{rotate}
-\setinterfacevariable{rotated}{rotated}
-\setinterfacevariable{round}{round}
-\setinterfacevariable{row}{row}
-\setinterfacevariable{rule}{rule}
-\setinterfacevariable{samepage}{samepage}
-\setinterfacevariable{sans}{sans}
-\setinterfacevariable{sansbold}{sansbold}
-\setinterfacevariable{sansnormal}{sansnormal}
-\setinterfacevariable{sansserif}{sansserif}
-\setinterfacevariable{saturday}{saturday}
-\setinterfacevariable{screen}{screen}
-\setinterfacevariable{section}{section}
-\setinterfacevariable{sectionblockenvironment}{sectionblockenvironment}
-\setinterfacevariable{sectionnumber}{sectionnumber}
-\setinterfacevariable{see}{see}
-\setinterfacevariable{selectfont}{selectfont}
-\setinterfacevariable{separator}{separator}
-\setinterfacevariable{september}{september}
-\setinterfacevariable{serif}{serif}
-\setinterfacevariable{serifbold}{serifbold}
-\setinterfacevariable{serifnormal}{serifnormal}
-\setinterfacevariable{serried}{serried}
-\setinterfacevariable{setups}{setups}
-\setinterfacevariable{seven}{seven}
-\setinterfacevariable{sheet}{sheet}
-\setinterfacevariable{shiftdown}{shiftdown}
-\setinterfacevariable{shiftup}{shiftup}
-\setinterfacevariable{short}{short}
-\setinterfacevariable{simplefonts}{simplefonts}
-\setinterfacevariable{simplelist}{simplelist}
-\setinterfacevariable{singlesided}{singlesided}
-\setinterfacevariable{six}{six}
-\setinterfacevariable{slanted}{slanted}
-\setinterfacevariable{slantedbold}{slantedbold}
-\setinterfacevariable{small}{small}
-\setinterfacevariable{smallbodyfont}{smallbodyfont}
-\setinterfacevariable{smallbold}{smallbold}
-\setinterfacevariable{smallbolditalic}{smallbolditalic}
-\setinterfacevariable{smallboldslanted}{smallboldslanted}
-\setinterfacevariable{smallcaps}{smallcaps}
-\setinterfacevariable{smaller}{smaller}
-\setinterfacevariable{smallitalic}{smallitalic}
-\setinterfacevariable{smallitalicbold}{smallitalicbold}
-\setinterfacevariable{smallnormal}{smallnormal}
-\setinterfacevariable{smallslanted}{smallslanted}
-\setinterfacevariable{smallslantedbold}{smallslantedbold}
-\setinterfacevariable{smalltype}{smalltype}
-\setinterfacevariable{somewhere}{somewhere}
-\setinterfacevariable{sorted}{sorted}
-\setinterfacevariable{sorting}{sorting}
-\setinterfacevariable{space}{space}
-\setinterfacevariable{spacing}{spacing}
-\setinterfacevariable{speech}{speech}
-\setinterfacevariable{split}{split}
-\setinterfacevariable{spot}{spot}
-\setinterfacevariable{standard}{standard}
-\setinterfacevariable{start}{start}
-\setinterfacevariable{starter}{starter}
-\setinterfacevariable{sticker}{sticker}
-\setinterfacevariable{stop}{stop}
-\setinterfacevariable{stopper}{stopper}
-\setinterfacevariable{stretch}{stretch}
-\setinterfacevariable{stretched}{stretched}
-\setinterfacevariable{strict}{strict}
-\setinterfacevariable{strong}{strong}
-\setinterfacevariable{strut}{strut}
-\setinterfacevariable{sub}{sub}
-\setinterfacevariable{subbackward}{subbackward}
-\setinterfacevariable{subformula}{subformula}
-\setinterfacevariable{subforward}{subforward}
-\setinterfacevariable{subject}{subject}
-\setinterfacevariable{subpage}{subpage}
-\setinterfacevariable{subs}{subs}
-\setinterfacevariable{subsection}{subsection}
-\setinterfacevariable{subsubject}{subsubject}
-\setinterfacevariable{subsubsection}{subsubsection}
-\setinterfacevariable{subsubsubject}{subsubsubject}
-\setinterfacevariable{subsubsubsection}{subsubsubsection}
-\setinterfacevariable{subsubsubsubject}{subsubsubsubject}
-\setinterfacevariable{subsubsubsubsection}{subsubsubsubsection}
-\setinterfacevariable{subsubsubsubsubject}{subsubsubsubsubject}
-\setinterfacevariable{subsubsubsubsubsection}{subsubsubsubsubsection}
-\setinterfacevariable{subsubsubsubsubsubject}{subsubsubsubsubsubject}
-\setinterfacevariable{subsubsubsubsubsubsection}{subsubsubsubsubsubsection}
-\setinterfacevariable{subsubsubsubsubsubsubject}{subsubsubsubsubsubsubject}
-\setinterfacevariable{subsubsubsubsubsubsubsection}{subsubsubsubsubsubsubsection}
-\setinterfacevariable{subsubsubsubsubsubsubsubject}{subsubsubsubsubsubsubsubject}
-\setinterfacevariable{subsubsubsubsubsubsubsubsection}{subsubsubsubsubsubsubsubsection}
-\setinterfacevariable{subsubsubsubsubsubsubsubsubject}{subsubsubsubsubsubsubsubsubject}
-\setinterfacevariable{subsubsubsubsubsubsubsubsubsection}{subsubsubsubsubsubsubsubsubsection}
-\setinterfacevariable{subsubsubsubsubsubsubsubsubsubject}{subsubsubsubsubsubsubsubsubsubject}
-\setinterfacevariable{sunday}{sunday}
-\setinterfacevariable{support}{support}
-\setinterfacevariable{sym}{sym}
-\setinterfacevariable{symbol}{symbol}
-\setinterfacevariable{synchronize}{synchronize}
-\setinterfacevariable{synonym}{synonym}
-\setinterfacevariable{system}{system}
-\setinterfacevariable{table}{table}
-\setinterfacevariable{tablehead}{tablehead}
-\setinterfacevariable{tables}{tables}
-\setinterfacevariable{tabletail}{tabletail}
-\setinterfacevariable{tabulate}{tabulate}
-\setinterfacevariable{tabulatehead}{tabulatehead}
-\setinterfacevariable{tabulatetail}{tabulatetail}
-\setinterfacevariable{tall}{tall}
-\setinterfacevariable{teletype}{teletype}
-\setinterfacevariable{temporary}{temporary}
-\setinterfacevariable{test}{test}
-\setinterfacevariable{text}{text}
-\setinterfacevariable{textnote}{textnote}
-\setinterfacevariable{three}{three}
-\setinterfacevariable{thursday}{thursday}
-\setinterfacevariable{tight}{tight}
-\setinterfacevariable{title}{title}
-\setinterfacevariable{toggle}{wissel}
-\setinterfacevariable{tolerant}{tolerant}
-\setinterfacevariable{top}{top}
-\setinterfacevariable{tuesday}{tuesday}
-\setinterfacevariable{two}{two}
-\setinterfacevariable{txt}{txt}
-\setinterfacevariable{type}{type}
-\setinterfacevariable{typing}{typing}
-\setinterfacevariable{unavailable}{unavailable}
-\setinterfacevariable{underbar}{underbar}
-\setinterfacevariable{underbars}{underbars}
-\setinterfacevariable{understrike}{understrike}
-\setinterfacevariable{understrikes}{understrikes}
-\setinterfacevariable{unframed}{unframed}
-\setinterfacevariable{unicode}{unicode}
-\setinterfacevariable{unit}{unit}
-\setinterfacevariable{units}{units}
-\setinterfacevariable{unknown}{unknown}
-\setinterfacevariable{unpacked}{unpacked}
-\setinterfacevariable{up}{up}
-\setinterfacevariable{url}{url}
-\setinterfacevariable{used}{used}
-\setinterfacevariable{value}{value}
-\setinterfacevariable{vertical}{vertical}
-\setinterfacevariable{very}{very}
-\setinterfacevariable{verystrict}{verystrict}
-\setinterfacevariable{verytolerant}{verytolerant}
-\setinterfacevariable{vfenced}{vfenced}
-\setinterfacevariable{vulgarfraction}{vulgarfraction}
-\setinterfacevariable{weak}{weak}
-\setinterfacevariable{wednesday}{wednesday}
-\setinterfacevariable{week}{week}
-\setinterfacevariable{weekday}{weekday}
-\setinterfacevariable{white}{white}
-\setinterfacevariable{wide}{wide}
-\setinterfacevariable{width}{width}
-\setinterfacevariable{word}{word}
-\setinterfacevariable{words}{words}
-\setinterfacevariable{xml}{xml}
-\setinterfacevariable{year}{year}
-\setinterfacevariable{yes}{yes}
-% definitions for interface constants for language en
-%
-\setinterfaceconstant{action}{action}
-\setinterfaceconstant{address}{address}
-\setinterfaceconstant{after}{after}
-\setinterfaceconstant{afterhead}{afterhead}
-\setinterfaceconstant{afterkey}{afterkey}
-\setinterfaceconstant{aftersection}{aftersection}
-\setinterfaceconstant{align}{align}
-\setinterfaceconstant{alignbottom}{alignbottom}
-\setinterfaceconstant{aligncharacter}{aligncharacter}
-\setinterfaceconstant{alignmentcharacter}{alignmentcharacter}
-\setinterfaceconstant{alignmentleftsample}{alignmentleftsample}
-\setinterfaceconstant{alignmentleftwidth}{alignmentleftwidth}
-\setinterfaceconstant{alignmentrightsample}{alignmentrightsample}
-\setinterfaceconstant{alignmentrightwidth}{alignmentrightwidth}
-\setinterfaceconstant{alignsymbol}{alignsymbol}
-\setinterfaceconstant{aligntitle}{aligntitle}
-\setinterfaceconstant{alternative}{alternative}
-\setinterfaceconstant{anchor}{anchor}
-\setinterfaceconstant{anchoring}{anchoring}
-\setinterfaceconstant{andtext}{andtext}
-\setinterfaceconstant{apa}{apa}
-\setinterfaceconstant{arguments}{arguments}
-\setinterfaceconstant{arrow}{arrow}
-\setinterfaceconstant{artauthor}{artauthor}
-\setinterfaceconstant{artauthoretaldisplay}{artauthoretaldisplay}
-\setinterfaceconstant{artauthoretallimit}{artauthoretallimit}
-\setinterfaceconstant{artauthoretaltext}{artauthoretaltext}
-\setinterfaceconstant{artoffset}{artoffset}
-\setinterfaceconstant{at}{at}
-\setinterfaceconstant{author}{author}
-\setinterfaceconstant{authorconversion}{authorconversion}
-\setinterfaceconstant{authoretaldisplay}{authoretaldisplay}
-\setinterfaceconstant{authoretallimit}{authoretallimit}
-\setinterfaceconstant{authoretaltext}{authoretaltext}
-\setinterfaceconstant{auto}{auto}
-\setinterfaceconstant{autocase}{autocase}
-\setinterfaceconstant{autofile}{autofile}
-\setinterfaceconstant{autofocus}{autofocus}
-\setinterfaceconstant{autohang}{autohang}
-\setinterfaceconstant{autostrut}{autostrut}
-\setinterfaceconstant{autowidth}{autowidth}
-\setinterfaceconstant{availableheight}{availableheight}
-\setinterfaceconstant{availablewidth}{availablewidth}
-\setinterfaceconstant{axis}{axis}
-\setinterfaceconstant{background}{background}
-\setinterfaceconstant{backgroundcolor}{backgroundcolor}
-\setinterfaceconstant{backgroundcorner}{backgroundcorner}
-\setinterfaceconstant{backgrounddepth}{backgrounddepth}
-\setinterfaceconstant{backgroundoffset}{backgroundoffset}
-\setinterfaceconstant{backgroundradius}{backgroundradius}
-\setinterfaceconstant{backgroundscreen}{backgroundscreen}
-\setinterfaceconstant{backreference}{backreference}
-\setinterfaceconstant{backspace}{backspace}
-\setinterfaceconstant{balance}{balance}
-\setinterfaceconstant{before}{before}
-\setinterfaceconstant{beforehead}{beforehead}
-\setinterfaceconstant{beforesection}{beforesection}
-\setinterfaceconstant{bet}{bet}
-\setinterfaceconstant{bidi}{bidi}
-\setinterfaceconstant{big}{big}
-\setinterfaceconstant{blank}{blank}
-\setinterfaceconstant{bleedoffset}{bleedoffset}
-\setinterfaceconstant{blockway}{blockway}
-\setinterfaceconstant{bodyfont}{bodyfont}
-\setinterfaceconstant{boffset}{boffset}
-\setinterfaceconstant{boldfeatures}{boldfeatures}
-\setinterfaceconstant{boldfont}{boldfont}
-\setinterfaceconstant{bolditalicfeatures}{bolditalicfeatures}
-\setinterfaceconstant{bolditalicfont}{bolditalicfont}
-\setinterfaceconstant{boldslantedfeatures}{boldslantedfeatures}
-\setinterfaceconstant{boldslantedfont}{boldslantedfont}
-\setinterfaceconstant{bookmark}{bookmark}
-\setinterfaceconstant{bottom}{bottom}
-\setinterfaceconstant{bottomafter}{bottomafter}
-\setinterfaceconstant{bottombefore}{bottombefore}
-\setinterfaceconstant{bottomcommand}{bottomcommand}
-\setinterfaceconstant{bottomdistance}{bottomdistance}
-\setinterfaceconstant{bottomframe}{bottomframe}
-\setinterfaceconstant{bottomoffset}{bottomoffset}
-\setinterfaceconstant{bottomspace}{bottomspace}
-\setinterfaceconstant{bottomstate}{bottomstate}
-\setinterfaceconstant{break}{break}
-\setinterfaceconstant{buffer}{buffer}
-\setinterfaceconstant{cache}{cache}
-\setinterfaceconstant{calculate}{calculate}
-\setinterfaceconstant{category}{category}
-\setinterfaceconstant{ccommand}{ccommand}
-\setinterfaceconstant{character}{character}
-\setinterfaceconstant{characters}{characters}
-\setinterfaceconstant{check}{check}
-\setinterfaceconstant{click}{click}
-\setinterfaceconstant{clickin}{clickin}
-\setinterfaceconstant{clickout}{clickout}
-\setinterfaceconstant{clipoffset}{clipoffset}
-\setinterfaceconstant{closeaction}{closeaction}
-\setinterfaceconstant{closecommand}{closecommand}
-\setinterfaceconstant{closepage}{closepage}
-\setinterfaceconstant{closepageaction}{closepageaction}
-\setinterfaceconstant{closesymbol}{closesymbol}
-\setinterfaceconstant{color}{color}
-\setinterfaceconstant{column}{column}
-\setinterfaceconstant{columndistance}{columndistance}
-\setinterfaceconstant{columns}{columns}
-\setinterfaceconstant{comma}{comma}
-\setinterfaceconstant{command}{command}
-\setinterfaceconstant{commandafter}{commandafter}
-\setinterfaceconstant{commandbefore}{commandbefore}
-\setinterfaceconstant{commands}{commands}
-\setinterfaceconstant{comment}{comment}
-\setinterfaceconstant{commentchar}{commentchar}
-\setinterfaceconstant{commentoffset}{commentoffset}
-\setinterfaceconstant{compact}{compact}
-\setinterfaceconstant{component}{component}
-\setinterfaceconstant{compoundhyphen}{compoundhyphen}
-\setinterfaceconstant{compress}{compress}
-\setinterfaceconstant{compressdistance}{compressdistance}
-\setinterfaceconstant{compressmethod}{compressmethod}
-\setinterfaceconstant{compressseparator}{compressseparator}
-\setinterfaceconstant{compressstopper}{compressstopper}
-\setinterfaceconstant{concerns}{concerns}
-\setinterfaceconstant{connector}{connector}
-\setinterfaceconstant{continue}{continue}
-\setinterfaceconstant{contrastcolor}{contrastcolor}
-\setinterfaceconstant{controls}{controls}
-\setinterfaceconstant{conversion}{conversion}
-\setinterfaceconstant{convertfile}{convertfile}
-\setinterfaceconstant{copies}{copies}
-\setinterfaceconstant{corner}{corner}
-\setinterfaceconstant{coupling}{coupling}
-\setinterfaceconstant{couplingway}{couplingway}
-\setinterfaceconstant{criterium}{criterium}
-\setinterfaceconstant{cropoffset}{cropoffset}
-\setinterfaceconstant{crossreference}{crossreference}
-\setinterfaceconstant{cssfile}{cssfile}
-\setinterfaceconstant{current}{current}
-\setinterfaceconstant{cutspace}{cutspace}
-\setinterfaceconstant{dash}{dash}
-\setinterfaceconstant{dat}{dat}
-\setinterfaceconstant{database}{database}
-\setinterfaceconstant{dataset}{dataset}
-\setinterfaceconstant{date}{date}
-\setinterfaceconstant{deepnumbercommand}{deepnumbercommand}
-\setinterfaceconstant{deeptextcommand}{deeptextcommand}
-\setinterfaceconstant{default}{default}
-\setinterfaceconstant{define}{define}
-\setinterfaceconstant{delay}{delay}
-\setinterfaceconstant{depth}{depth}
-\setinterfaceconstant{depthcorrection}{depthcorrection}
-\setinterfaceconstant{direction}{direction}
-\setinterfaceconstant{directory}{directory}
-\setinterfaceconstant{display}{display}
-\setinterfaceconstant{displaythreshold}{displaythreshold}
-\setinterfaceconstant{distance}{distance}
-\setinterfaceconstant{domain}{domain}
-\setinterfaceconstant{dot}{dot}
-\setinterfaceconstant{doublesided}{doublesided}
-\setinterfaceconstant{down}{down}
-\setinterfaceconstant{dummy}{dummy}
-\setinterfaceconstant{dx}{dx}
-\setinterfaceconstant{dy}{dy}
-\setinterfaceconstant{edge}{edge}
-\setinterfaceconstant{edgedistance}{edgedistance}
-\setinterfaceconstant{editor}{editor}
-\setinterfaceconstant{editoretaldisplay}{editoretaldisplay}
-\setinterfaceconstant{editoretallimit}{editoretallimit}
-\setinterfaceconstant{editoretaltext}{editoretaltext}
-\setinterfaceconstant{empty}{empty}
-\setinterfaceconstant{entities}{entities}
-\setinterfaceconstant{entries}{entries}
-\setinterfaceconstant{equalheight}{equalheight}
-\setinterfaceconstant{equalwidth}{equalwidth}
-\setinterfaceconstant{escape}{escape}
-\setinterfaceconstant{etaldisplay}{etaldisplay}
-\setinterfaceconstant{etallimit}{etallimit}
-\setinterfaceconstant{etaloption}{etaloption}
-\setinterfaceconstant{etaltext}{etaltext}
-\setinterfaceconstant{evenmargin}{evenmargin}
-\setinterfaceconstant{exact}{exact}
-\setinterfaceconstant{exitoffset}{exitoffset}
-\setinterfaceconstant{expansion}{expansion}
-\setinterfaceconstant{export}{export}
-\setinterfaceconstant{extras}{extras}
-\setinterfaceconstant{factor}{factor}
-\setinterfaceconstant{fallback}{fallback}
-\setinterfaceconstant{fallbacks}{fallbacks}
-\setinterfaceconstant{family}{family}
-\setinterfaceconstant{features}{features}
-\setinterfaceconstant{featureset}{featureset}
-\setinterfaceconstant{fences}{fences}
-\setinterfaceconstant{field}{field}
-\setinterfaceconstant{fieldbackgroundcolor}{fieldbackgroundcolor}
-\setinterfaceconstant{fieldframecolor}{fieldframecolor}
-\setinterfaceconstant{fieldlayer}{fieldlayer}
-\setinterfaceconstant{fieldoffset}{fieldoffset}
-\setinterfaceconstant{file}{file}
-\setinterfaceconstant{filler}{filler}
-\setinterfaceconstant{filter}{filter}
-\setinterfaceconstant{filtercommand}{filtercommand}
-\setinterfaceconstant{finalnamesep}{finalnamesep}
-\setinterfaceconstant{finalpagesep}{finalpagesep}
-\setinterfaceconstant{finalpubsep}{finalpubsep}
-\setinterfaceconstant{first}{first}
-\setinterfaceconstant{firstnamesep}{firstnamesep}
-\setinterfaceconstant{firstpage}{firstpage}
-\setinterfaceconstant{focus}{focus}
-\setinterfaceconstant{focusin}{focusin}
-\setinterfaceconstant{focusoffset}{focusoffset}
-\setinterfaceconstant{focusout}{focusout}
-\setinterfaceconstant{font}{font}
-\setinterfaceconstant{footer}{footer}
-\setinterfaceconstant{footerdistance}{footerdistance}
-\setinterfaceconstant{footerstate}{footerstate}
-\setinterfaceconstant{force}{force}
-\setinterfaceconstant{foregroundcolor}{foregroundcolor}
-\setinterfaceconstant{foregroundstyle}{foregroundstyle}
-\setinterfaceconstant{format}{format}
-\setinterfaceconstant{fractions}{fractions}
-\setinterfaceconstant{frame}{frame}
-\setinterfaceconstant{framecolor}{framecolor}
-\setinterfaceconstant{framecorner}{framecorner}
-\setinterfaceconstant{framedepth}{framedepth}
-\setinterfaceconstant{frameoffset}{frameoffset}
-\setinterfaceconstant{frameradius}{frameradius}
-\setinterfaceconstant{frames}{frames}
-\setinterfaceconstant{freeregion}{freeregion}
-\setinterfaceconstant{from}{from}
-\setinterfaceconstant{functioncolor}{functioncolor}
-\setinterfaceconstant{functionstyle}{functionstyle}
-\setinterfaceconstant{get}{get}
-\setinterfaceconstant{global}{global}
-\setinterfaceconstant{goodies}{goodies}
-\setinterfaceconstant{grid}{grid}
-\setinterfaceconstant{group}{group}
-\setinterfaceconstant{groupsuffix}{groupsuffix}
-\setinterfaceconstant{hang}{hang}
-\setinterfaceconstant{hcompact}{hcompact}
-\setinterfaceconstant{headalign}{headalign}
-\setinterfaceconstant{headcolor}{headcolor}
-\setinterfaceconstant{headcommand}{headcommand}
-\setinterfaceconstant{headconversion}{headconversion}
-\setinterfaceconstant{header}{header}
-\setinterfaceconstant{headerdistance}{headerdistance}
-\setinterfaceconstant{headerstate}{headerstate}
-\setinterfaceconstant{headlabel}{headlabel}
-\setinterfaceconstant{headnumber}{headnumber}
-\setinterfaceconstant{headseparator}{headseparator}
-\setinterfaceconstant{headstyle}{headstyle}
-\setinterfaceconstant{height}{height}
-\setinterfaceconstant{hfactor}{hfactor}
-\setinterfaceconstant{hfil}{hfil}
-\setinterfaceconstant{hidenumber}{hidenumber}
-\setinterfaceconstant{hoffset}{hoffset}
-\setinterfaceconstant{horizontal}{horizontal}
-\setinterfaceconstant{horoffset}{horoffset}
-\setinterfaceconstant{hyphen}{hyphen}
-\setinterfaceconstant{hyphens}{hyphens}
-\setinterfaceconstant{icommand}{icommand}
-\setinterfaceconstant{ignore}{ignore}
-\setinterfaceconstant{in}{in}
-\setinterfaceconstant{inbetween}{inbetween}
-\setinterfaceconstant{increment}{increment}
-\setinterfaceconstant{incrementnumber}{incrementnumber}
-\setinterfaceconstant{indenting}{indenting}
-\setinterfaceconstant{indentlist}{indentlist}
-\setinterfaceconstant{indentnext}{indentnext}
-\setinterfaceconstant{index}{index}
-\setinterfaceconstant{indicator}{indicator}
-\setinterfaceconstant{initialsep}{initialsep}
-\setinterfaceconstant{inlinethreshold}{inlinethreshold}
-\setinterfaceconstant{inner}{inner}
-\setinterfaceconstant{innermargin}{innermargin}
-\setinterfaceconstant{inputfile}{inputfile}
-\setinterfaceconstant{insidesection}{insidesection}
-\setinterfaceconstant{instance}{instance}
-\setinterfaceconstant{intent}{intent}
-\setinterfaceconstant{interaction}{interaction}
-\setinterfaceconstant{interlinespace}{interlinespace}
-\setinterfaceconstant{internalgrid}{internalgrid}
-\setinterfaceconstant{italicfeatures}{italicfeatures}
-\setinterfaceconstant{italicfont}{italicfont}
-\setinterfaceconstant{itemalign}{itemalign}
-\setinterfaceconstant{items}{items}
-\setinterfaceconstant{joiners}{joiners}
-\setinterfaceconstant{journalconversion}{journalconversion}
-\setinterfaceconstant{juniorsep}{juniorsep}
-\setinterfaceconstant{keeptogether}{keeptogether}
-\setinterfaceconstant{ken}{ken}
-\setinterfaceconstant{keyexpansion}{keyexpansion}
-\setinterfaceconstant{keys}{keys}
-\setinterfaceconstant{keyword}{keyword}
-\setinterfaceconstant{label}{label}
-\setinterfaceconstant{labelalternative}{labelalternative}
-\setinterfaceconstant{labelcolor}{labelcolor}
-\setinterfaceconstant{labeloffset}{labeloffset}
-\setinterfaceconstant{labelstyle}{labelstyle}
-\setinterfaceconstant{language}{language}
-\setinterfaceconstant{last}{last}
-\setinterfaceconstant{lastnamesep}{lastnamesep}
-\setinterfaceconstant{lastpage}{lastpage}
-\setinterfaceconstant{lastpagesep}{lastpagesep}
-\setinterfaceconstant{lastpubsep}{lastpubsep}
-\setinterfaceconstant{layout}{layout}
-\setinterfaceconstant{left}{left}
-\setinterfaceconstant{leftcolor}{leftcolor}
-\setinterfaceconstant{leftcompoundhyphen}{leftcompoundhyphen}
-\setinterfaceconstant{leftedge}{leftedge}
-\setinterfaceconstant{leftedgedistance}{leftedgedistance}
-\setinterfaceconstant{leftframe}{leftframe}
-\setinterfaceconstant{lefthyphen}{lefthyphen}
-\setinterfaceconstant{leftmargin}{leftmargin}
-\setinterfaceconstant{leftmargindistance}{leftmargindistance}
-\setinterfaceconstant{leftoffset}{leftoffset}
-\setinterfaceconstant{leftquotation}{leftquotation}
-\setinterfaceconstant{leftquote}{leftquote}
-\setinterfaceconstant{leftsample}{leftsample}
-\setinterfaceconstant{leftsentence}{leftsentence}
-\setinterfaceconstant{leftspeech}{leftspeech}
-\setinterfaceconstant{leftstyle}{leftstyle}
-\setinterfaceconstant{leftsubsentence}{leftsubsentence}
-\setinterfaceconstant{lefttext}{lefttext}
-\setinterfaceconstant{leftwidth}{leftwidth}
-\setinterfaceconstant{leftwords}{leftwords}
-\setinterfaceconstant{less}{less}
-\setinterfaceconstant{level}{level}
-\setinterfaceconstant{levels}{levels}
-\setinterfaceconstant{limittext}{limittext}
-\setinterfaceconstant{line}{line}
-\setinterfaceconstant{linecorrection}{linecorrection}
-\setinterfaceconstant{linedirection}{linedirection}
-\setinterfaceconstant{lines}{lines}
-\setinterfaceconstant{list}{list}
-\setinterfaceconstant{listtext}{listtext}
-\setinterfaceconstant{local}{local}
-\setinterfaceconstant{location}{location}
-\setinterfaceconstant{loffset}{loffset}
-\setinterfaceconstant{logo}{logo}
-\setinterfaceconstant{logos}{logos}
-\setinterfaceconstant{marcolor}{marcolor}
-\setinterfaceconstant{margin}{margin}
-\setinterfaceconstant{margindistance}{margindistance}
-\setinterfaceconstant{marginedge}{marginedge}
-\setinterfaceconstant{marginedgetext}{marginedgetext}
-\setinterfaceconstant{margintext}{margintext}
-\setinterfaceconstant{mark}{mark}
-\setinterfaceconstant{marking}{marking}
-\setinterfaceconstant{marstyle}{marstyle}
-\setinterfaceconstant{mask}{mask}
-\setinterfaceconstant{mathclass}{mathclass}
-\setinterfaceconstant{mathlimits}{mathlimits}
-\setinterfaceconstant{mathstyle}{mathstyle}
-\setinterfaceconstant{max}{max}
-\setinterfaceconstant{maxdepth}{maxdepth}
-\setinterfaceconstant{maxheight}{maxheight}
-\setinterfaceconstant{maxwidth}{maxwidth}
-\setinterfaceconstant{maybeyear}{maybeyear}
-\setinterfaceconstant{menu}{menu}
-\setinterfaceconstant{method}{method}
-\setinterfaceconstant{middle}{middle}
-\setinterfaceconstant{middlecolor}{middlecolor}
-\setinterfaceconstant{middlecommand}{middlecommand}
-\setinterfaceconstant{middlespeech}{middlespeech}
-\setinterfaceconstant{middlestyle}{middlestyle}
-\setinterfaceconstant{middletext}{middletext}
-\setinterfaceconstant{middlewidth}{middlewidth}
-\setinterfaceconstant{midsentence}{midsentence}
-\setinterfaceconstant{min}{min}
-\setinterfaceconstant{mindepth}{mindepth}
-\setinterfaceconstant{minheight}{minheight}
-\setinterfaceconstant{minwidth}{minwidth}
-\setinterfaceconstant{moffset}{moffset}
-\setinterfaceconstant{monthconversion}{monthconversion}
-\setinterfaceconstant{more}{more}
-\setinterfaceconstant{mpdepth}{mpdepth}
-\setinterfaceconstant{mpheight}{mpheight}
-\setinterfaceconstant{mpoffset}{mpoffset}
-\setinterfaceconstant{mpwidth}{mpwidth}
-\setinterfaceconstant{n}{n}
-\setinterfaceconstant{name}{name}
-\setinterfaceconstant{namesep}{namesep}
-\setinterfaceconstant{nbottom}{nbottom}
-\setinterfaceconstant{nc}{nc}
-\setinterfaceconstant{next}{next}
-\setinterfaceconstant{nextleft}{nextleft}
-\setinterfaceconstant{nextleftquotation}{nextleftquotation}
-\setinterfaceconstant{nextright}{nextright}
-\setinterfaceconstant{nextrightquotation}{nextrightquotation}
-\setinterfaceconstant{nl}{nl}
-\setinterfaceconstant{nleft}{nleft}
-\setinterfaceconstant{nlines}{nlines}
-\setinterfaceconstant{norm}{norm}
-\setinterfaceconstant{note}{note}
-\setinterfaceconstant{notes}{notes}
-\setinterfaceconstant{nr}{nr}
-\setinterfaceconstant{nright}{nright}
-\setinterfaceconstant{ntop}{ntop}
-\setinterfaceconstant{number}{number}
-\setinterfaceconstant{numberalign}{numberalign}
-\setinterfaceconstant{numbercolor}{numbercolor}
-\setinterfaceconstant{numbercommand}{numbercommand}
-\setinterfaceconstant{numberconversion}{numberconversion}
-\setinterfaceconstant{numberconversionset}{numberconversionset}
-\setinterfaceconstant{numberdistance}{numberdistance}
-\setinterfaceconstant{numbering}{numbering}
-\setinterfaceconstant{numberorder}{numberorder}
-\setinterfaceconstant{numberprefix}{numberprefix}
-\setinterfaceconstant{numbersegments}{numbersegments}
-\setinterfaceconstant{numberseparator}{numberseparator}
-\setinterfaceconstant{numberseparatorset}{numberseparatorset}
-\setinterfaceconstant{numberset}{numberset}
-\setinterfaceconstant{numberstarter}{numberstarter}
-\setinterfaceconstant{numberstopper}{numberstopper}
-\setinterfaceconstant{numberstrut}{numberstrut}
-\setinterfaceconstant{numberstyle}{numberstyle}
-\setinterfaceconstant{numberwidth}{numberwidth}
-\setinterfaceconstant{nx}{nx}
-\setinterfaceconstant{ny}{ny}
-\setinterfaceconstant{object}{object}
-\setinterfaceconstant{obstruction}{obstruction}
-\setinterfaceconstant{oddmargin}{oddmargin}
-\setinterfaceconstant{offset}{offset}
-\setinterfaceconstant{openaction}{openaction}
-\setinterfaceconstant{openpage}{openpage}
-\setinterfaceconstant{openpageaction}{openpageaction}
-\setinterfaceconstant{openup}{openup}
-\setinterfaceconstant{opticalsize}{opticalsize}
-\setinterfaceconstant{option}{option}
-\setinterfaceconstant{order}{order}
-\setinterfaceconstant{orientation}{orientation}
-\setinterfaceconstant{otherstext}{otherstext}
-\setinterfaceconstant{outermargin}{outermargin}
-\setinterfaceconstant{overprint}{overprint}
-\setinterfaceconstant{ownerpassword}{ownerpassword}
-\setinterfaceconstant{ownnumber}{ownnumber}
-\setinterfaceconstant{packcriterium}{packcriterium}
-\setinterfaceconstant{page}{page}
-\setinterfaceconstant{pageboundaries}{pageboundaries}
-\setinterfaceconstant{pagecolor}{pagecolor}
-\setinterfaceconstant{pagecolormodel}{pagecolormodel}
-\setinterfaceconstant{pagecommand}{pagecommand}
-\setinterfaceconstant{pageconnector}{pageconnector}
-\setinterfaceconstant{pageconversion}{pageconversion}
-\setinterfaceconstant{pageconversionset}{pageconversionset}
-\setinterfaceconstant{pageleft}{pageleft}
-\setinterfaceconstant{pagemethod}{pagemethod}
-\setinterfaceconstant{pagenumber}{pagenumber}
-\setinterfaceconstant{pageprefix}{pageprefix}
-\setinterfaceconstant{pageprefixconnector}{pageprefixconnector}
-\setinterfaceconstant{pageprefixconversion}{pageprefixconversion}
-\setinterfaceconstant{pageprefixconversionset}{pageprefixconversionset}
-\setinterfaceconstant{pageprefixsegments}{pageprefixsegments}
-\setinterfaceconstant{pageprefixseparatorset}{pageprefixseparatorset}
-\setinterfaceconstant{pageprefixset}{pageprefixset}
-\setinterfaceconstant{pageprefixstarter}{pageprefixstarter}
-\setinterfaceconstant{pageprefixstopper}{pageprefixstopper}
-\setinterfaceconstant{pageright}{pageright}
-\setinterfaceconstant{pagesegments}{pagesegments}
-\setinterfaceconstant{pagesep}{pagesep}
-\setinterfaceconstant{pageseparatorset}{pageseparatorset}
-\setinterfaceconstant{pageset}{pageset}
-\setinterfaceconstant{pagestarter}{pagestarter}
-\setinterfaceconstant{pagestate}{pagestate}
-\setinterfaceconstant{pagestopper}{pagestopper}
-\setinterfaceconstant{pagestyle}{pagestyle}
-\setinterfaceconstant{palet}{palet}
-\setinterfaceconstant{paper}{paper}
-\setinterfaceconstant{paragraph}{paragraph}
-\setinterfaceconstant{period}{period}
-\setinterfaceconstant{place}{place}
-\setinterfaceconstant{placehead}{placehead}
-\setinterfaceconstant{placeholder}{placeholder}
-\setinterfaceconstant{placestopper}{placestopper}
-\setinterfaceconstant{position}{position}
-\setinterfaceconstant{prefix}{prefix}
-\setinterfaceconstant{prefixconnector}{prefixconnector}
-\setinterfaceconstant{prefixconversion}{prefixconversion}
-\setinterfaceconstant{prefixconversionset}{prefixconversionset}
-\setinterfaceconstant{prefixsegments}{prefixsegments}
-\setinterfaceconstant{prefixseparatorset}{prefixseparatorset}
-\setinterfaceconstant{prefixset}{prefixset}
-\setinterfaceconstant{prefixstarter}{prefixstarter}
-\setinterfaceconstant{prefixstopper}{prefixstopper}
-\setinterfaceconstant{preset}{preset}
-\setinterfaceconstant{preview}{preview}
-\setinterfaceconstant{previous}{previous}
-\setinterfaceconstant{previousnumber}{previousnumber}
-\setinterfaceconstant{print}{print}
-\setinterfaceconstant{printable}{printable}
-\setinterfaceconstant{process}{process}
-\setinterfaceconstant{profile}{profile}
-\setinterfaceconstant{properties}{properties}
-\setinterfaceconstant{pubsep}{pubsep}
-\setinterfaceconstant{quotechar}{quotechar}
-\setinterfaceconstant{radius}{radius}
-\setinterfaceconstant{random}{random}
-\setinterfaceconstant{range}{range}
-\setinterfaceconstant{reduction}{reduction}
-\setinterfaceconstant{ref}{ref}
-\setinterfaceconstant{refcommand}{refcommand}
-\setinterfaceconstant{reference}{reference}
-\setinterfaceconstant{referencemethod}{referencemethod}
-\setinterfaceconstant{referenceprefix}{referenceprefix}
-\setinterfaceconstant{referencetext}{referencetext}
-\setinterfaceconstant{referencing}{referencing}
-\setinterfaceconstant{region}{region}
-\setinterfaceconstant{regionin}{regionin}
-\setinterfaceconstant{regionout}{regionout}
-\setinterfaceconstant{register}{register}
-\setinterfaceconstant{regularfeatures}{regularfeatures}
-\setinterfaceconstant{regularfont}{regularfont}
-\setinterfaceconstant{renderingsetup}{renderingsetup}
-\setinterfaceconstant{repeat}{repeat}
-\setinterfaceconstant{reset}{reset}
-\setinterfaceconstant{resetnumber}{resetnumber}
-\setinterfaceconstant{resolution}{resolution}
-\setinterfaceconstant{resources}{resources}
-\setinterfaceconstant{reverse}{reverse}
-\setinterfaceconstant{right}{right}
-\setinterfaceconstant{rightchars}{rightchars}
-\setinterfaceconstant{rightcolor}{rightcolor}
-\setinterfaceconstant{rightcompoundhyphen}{rightcompoundhyphen}
-\setinterfaceconstant{rightedge}{rightedge}
-\setinterfaceconstant{rightedgedistance}{rightedgedistance}
-\setinterfaceconstant{rightframe}{rightframe}
-\setinterfaceconstant{righthyphen}{righthyphen}
-\setinterfaceconstant{rightmargin}{rightmargin}
-\setinterfaceconstant{rightmargindistance}{rightmargindistance}
-\setinterfaceconstant{rightoffset}{rightoffset}
-\setinterfaceconstant{rightquotation}{rightquotation}
-\setinterfaceconstant{rightquote}{rightquote}
-\setinterfaceconstant{rightsample}{rightsample}
-\setinterfaceconstant{rightsentence}{rightsentence}
-\setinterfaceconstant{rightspeech}{rightspeech}
-\setinterfaceconstant{rightstyle}{rightstyle}
-\setinterfaceconstant{rightsubsentence}{rightsubsentence}
-\setinterfaceconstant{righttext}{righttext}
-\setinterfaceconstant{rightwidth}{rightwidth}
-\setinterfaceconstant{rightwords}{rightwords}
-\setinterfaceconstant{roffset}{roffset}
-\setinterfaceconstant{rotation}{rotation}
-\setinterfaceconstant{rule}{rule}
-\setinterfaceconstant{rulecolor}{rulecolor}
-\setinterfaceconstant{rulecommand}{rulecommand}
-\setinterfaceconstant{rulethickness}{rulethickness}
-\setinterfaceconstant{samepage}{samepage}
-\setinterfaceconstant{sample}{sample}
-\setinterfaceconstant{samplesize}{samplesize}
-\setinterfaceconstant{saveinlist}{saveinlist}
-\setinterfaceconstant{scale}{scale}
-\setinterfaceconstant{scope}{scope}
-\setinterfaceconstant{screen}{screen}
-\setinterfaceconstant{section}{section}
-\setinterfaceconstant{sectionblock}{sectionblock}
-\setinterfaceconstant{sectionconversion}{sectionconversion}
-\setinterfaceconstant{sectionconversionset}{sectionconversionset}
-\setinterfaceconstant{sectionnumber}{sectionnumber}
-\setinterfaceconstant{sectionresetset}{sectionresetset}
-\setinterfaceconstant{sectionsegments}{sectionsegments}
-\setinterfaceconstant{sectionseparatorset}{sectionseparatorset}
-\setinterfaceconstant{sectionset}{sectionset}
-\setinterfaceconstant{sectionstarter}{sectionstarter}
-\setinterfaceconstant{sectionstopper}{sectionstopper}
-\setinterfaceconstant{separator}{separator}
-\setinterfaceconstant{separatorcolor}{separatorcolor}
-\setinterfaceconstant{separatorstyle}{separatorstyle}
-\setinterfaceconstant{set}{set}
-\setinterfaceconstant{setups}{setups}
-\setinterfaceconstant{shrink}{shrink}
-\setinterfaceconstant{side}{side}
-\setinterfaceconstant{sidealign}{sidealign}
-\setinterfaceconstant{sidemethod}{sidemethod}
-\setinterfaceconstant{sidespaceafter}{sidespaceafter}
-\setinterfaceconstant{sidespacebefore}{sidespacebefore}
-\setinterfaceconstant{sidespaceinbetween}{sidespaceinbetween}
-\setinterfaceconstant{sidethreshold}{sidethreshold}
-\setinterfaceconstant{sign}{sign}
-\setinterfaceconstant{simplecommand}{simplecommand}
-\setinterfaceconstant{size}{size}
-\setinterfaceconstant{slantedfeatures}{slantedfeatures}
-\setinterfaceconstant{slantedfont}{slantedfont}
-\setinterfaceconstant{small}{small}
-\setinterfaceconstant{smallcapsfeatures}{smallcapsfeatures}
-\setinterfaceconstant{smallcapsfont}{smallcapsfont}
-\setinterfaceconstant{solution}{solution}
-\setinterfaceconstant{sort}{sort}
-\setinterfaceconstant{sorttype}{sorttype}
-\setinterfaceconstant{source}{source}
-\setinterfaceconstant{space}{space}
-\setinterfaceconstant{spaceafter}{spaceafter}
-\setinterfaceconstant{spaceafterside}{spaceafterside}
-\setinterfaceconstant{spacebefore}{spacebefore}
-\setinterfaceconstant{spacebeforeside}{spacebeforeside}
-\setinterfaceconstant{spaceinbetween}{spaceinbetween}
-\setinterfaceconstant{spacing}{spacing}
-\setinterfaceconstant{specification}{specification}
-\setinterfaceconstant{split}{split}
-\setinterfaceconstant{splitcolor}{splitcolor}
-\setinterfaceconstant{splitmethod}{splitmethod}
-\setinterfaceconstant{splitoffset}{splitoffset}
-\setinterfaceconstant{spot}{spot}
-\setinterfaceconstant{stack}{stack}
-\setinterfaceconstant{stackname}{stackname}
-\setinterfaceconstant{start}{start}
-\setinterfaceconstant{starter}{starter}
-\setinterfaceconstant{state}{state}
-\setinterfaceconstant{step}{step}
-\setinterfaceconstant{stop}{stop}
-\setinterfaceconstant{stopper}{stopper}
-\setinterfaceconstant{stretch}{stretch}
-\setinterfaceconstant{strip}{strip}
-\setinterfaceconstant{strut}{strut}
-\setinterfaceconstant{style}{style}
-\setinterfaceconstant{stylealternative}{stylealternative}
-\setinterfaceconstant{sub}{sub}
-\setinterfaceconstant{subtitle}{subtitle}
-\setinterfaceconstant{suffix}{suffix}
-\setinterfaceconstant{suffixseparator}{suffixseparator}
-\setinterfaceconstant{suffixstopper}{suffixstopper}
-\setinterfaceconstant{surnamefirstnamesep}{surnamefirstnamesep}
-\setinterfaceconstant{surnameinitialsep}{surnameinitialsep}
-\setinterfaceconstant{surnamesep}{surnamesep}
-\setinterfaceconstant{svgstyle}{svgstyle}
-\setinterfaceconstant{sx}{sx}
-\setinterfaceconstant{sy}{sy}
-\setinterfaceconstant{symalign}{symalign}
-\setinterfaceconstant{symbol}{symbol}
-\setinterfaceconstant{symbolcommand}{symbolcommand}
-\setinterfaceconstant{symbolset}{symbolset}
-\setinterfaceconstant{symcolor}{symcolor}
-\setinterfaceconstant{symstyle}{symstyle}
-\setinterfaceconstant{synonym}{synonym}
-\setinterfaceconstant{synonymcolor}{synonymcolor}
-\setinterfaceconstant{synonymcommand}{synonymcommand}
-\setinterfaceconstant{synonymstyle}{synonymstyle}
-\setinterfaceconstant{tab}{tab}
-\setinterfaceconstant{text}{text}
-\setinterfaceconstant{textalign}{textalign}
-\setinterfaceconstant{textcolor}{textcolor}
-\setinterfaceconstant{textcommand}{textcommand}
-\setinterfaceconstant{textdistance}{textdistance}
-\setinterfaceconstant{textheight}{textheight}
-\setinterfaceconstant{textlayer}{textlayer}
-\setinterfaceconstant{textmargin}{textmargin}
-\setinterfaceconstant{textmethod}{textmethod}
-\setinterfaceconstant{textseparator}{textseparator}
-\setinterfaceconstant{textsize}{textsize}
-\setinterfaceconstant{textstate}{textstate}
-\setinterfaceconstant{textstyle}{textstyle}
-\setinterfaceconstant{textwidth}{textwidth}
-\setinterfaceconstant{threshold}{threshold}
-\setinterfaceconstant{time}{time}
-\setinterfaceconstant{title}{title}
-\setinterfaceconstant{titlecolor}{titlecolor}
-\setinterfaceconstant{titlecommand}{titlecommand}
-\setinterfaceconstant{titledistance}{titledistance}
-\setinterfaceconstant{titleleft}{titleleft}
-\setinterfaceconstant{titleright}{titleright}
-\setinterfaceconstant{titlestrut}{titlestrut}
-\setinterfaceconstant{titlestyle}{titlestyle}
-\setinterfaceconstant{to}{to}
-\setinterfaceconstant{toffset}{toffset}
-\setinterfaceconstant{tolerance}{tolerance}
-\setinterfaceconstant{top}{top}
-\setinterfaceconstant{topcommand}{topcommand}
-\setinterfaceconstant{topdistance}{topdistance}
-\setinterfaceconstant{topframe}{topframe}
-\setinterfaceconstant{topoffset}{topoffset}
-\setinterfaceconstant{topspace}{topspace}
-\setinterfaceconstant{topstate}{topstate}
-\setinterfaceconstant{totalnumber}{totalnumber}
-\setinterfaceconstant{transform}{transform}
-\setinterfaceconstant{translate}{translate}
-\setinterfaceconstant{trimoffset}{trimoffset}
-\setinterfaceconstant{type}{type}
-\setinterfaceconstant{unit}{unit}
-\setinterfaceconstant{unknownreference}{unknownreference}
-\setinterfaceconstant{up}{up}
-\setinterfaceconstant{urlalternative}{urlalternative}
-\setinterfaceconstant{urlspace}{urlspace}
-\setinterfaceconstant{userpassword}{userpassword}
-\setinterfaceconstant{validate}{validate}
-\setinterfaceconstant{values}{values}
-\setinterfaceconstant{vcommand}{vcommand}
-\setinterfaceconstant{vcompact}{vcompact}
-\setinterfaceconstant{vector}{vector}
-\setinterfaceconstant{veroffset}{veroffset}
-\setinterfaceconstant{vertical}{vertical}
-\setinterfaceconstant{vfactor}{vfactor}
-\setinterfaceconstant{vfil}{vfil}
-\setinterfaceconstant{viewerprefix}{viewerprefix}
-\setinterfaceconstant{voffset}{voffset}
-\setinterfaceconstant{vonsep}{vonsep}
-\setinterfaceconstant{way}{way}
-\setinterfaceconstant{wfactor}{wfactor}
-\setinterfaceconstant{white}{white}
-\setinterfaceconstant{width}{width}
-\setinterfaceconstant{words}{words}
-\setinterfaceconstant{xanchor}{xanchor}
-\setinterfaceconstant{xfactor}{xfactor}
-\setinterfaceconstant{xhtml}{xhtml}
-\setinterfaceconstant{xmax}{xmax}
-\setinterfaceconstant{xmlsetup}{xmlsetup}
-\setinterfaceconstant{xoffset}{xoffset}
-\setinterfaceconstant{xscale}{xscale}
-\setinterfaceconstant{xstep}{xstep}
-\setinterfaceconstant{yanchor}{yanchor}
-\setinterfaceconstant{yfactor}{yfactor}
-\setinterfaceconstant{ymax}{ymax}
-\setinterfaceconstant{yoffset}{yoffset}
-\setinterfaceconstant{yscale}{yscale}
-\setinterfaceconstant{ystep}{ystep}
-% definitions for interface elements for language en
-%
-\setinterfaceelement{answerlines}{answerlines}
-\setinterfaceelement{answerspace}{answerspace}
-\setinterfaceelement{begin}{begin}
-\setinterfaceelement{complete}{complete}
-\setinterfaceelement{coupled}{coupled}
-\setinterfaceelement{currentlocal}{currentlocal}
-\setinterfaceelement{end}{end}
-\setinterfaceelement{endsetup}{}
-\setinterfaceelement{get}{get}
-\setinterfaceelement{increment}{increment}
-\setinterfaceelement{list}{list}
-\setinterfaceelement{listof}{listof}
-\setinterfaceelement{load}{load}
-\setinterfaceelement{local}{local}
-\setinterfaceelement{makeup}{makeup}
-\setinterfaceelement{next}{next}
-\setinterfaceelement{place}{place}
-\setinterfaceelement{previous}{previous}
-\setinterfaceelement{previouslocal}{previouslocal}
-\setinterfaceelement{reserve}{reserve}
-\setinterfaceelement{see}{see}
-\setinterfaceelement{setup}{setup}
-\setinterfaceelement{start}{start}
-\setinterfaceelement{stop}{stop}
-\setinterfaceelement{text}{text}
-\setinterfaceelement{type}{type}
-% definitions for interface commands for language en
-%
-\setinterfacecommand{Character}{Character}
-\setinterfacecommand{Characters}{Characters}
-\setinterfacecommand{MONTH}{MONTH}
-\setinterfacecommand{Numbers}{Numbers}
-\setinterfacecommand{Romannumerals}{Romannumerals}
-\setinterfacecommand{SmallCapped}{Cap}
-\setinterfacecommand{SmallCaps}{Caps}
-\setinterfacecommand{WEEKDAY}{WEEKDAY}
-\setinterfacecommand{WORD}{WORD}
-\setinterfacecommand{WORDS}{WORDS}
-\setinterfacecommand{Word}{Word}
-\setinterfacecommand{Words}{Words}
-\setinterfacecommand{about}{about}
-\setinterfacecommand{adaptfontfeature}{adaptfontfeature}
-\setinterfacecommand{adaptlayout}{adaptlayout}
-\setinterfacecommand{addfeature}{addfeature}
-\setinterfacecommand{alignbottom}{alignbottom}
-\setinterfacecommand{aligned}{aligned}
-\setinterfacecommand{alignedbox}{alignedbox}
-\setinterfacecommand{alignedline}{alignedline}
-\setinterfacecommand{alignhere}{alignhere}
-\setinterfacecommand{alignment}{alignment}
-\setinterfacecommand{alignmentcharacter}{alignmentcharacter}
-\setinterfacecommand{applytocharacters}{applytocharacters}
-\setinterfacecommand{applytofirstcharacter}{applytofirstcharacter}
-\setinterfacecommand{arg}{arg}
-\setinterfacecommand{at}{at}
-\setinterfacecommand{atleftmargin}{atleftmargin}
-\setinterfacecommand{atpage}{atpage}
-\setinterfacecommand{atrightmargin}{atrightmargin}
-\setinterfacecommand{background}{background}
-\setinterfacecommand{backspace}{backspace}
-\setinterfacecommand{blackrule}{blackrule}
-\setinterfacecommand{blackrules}{blackrules}
-\setinterfacecommand{blank}{blank}
-\setinterfacecommand{bookmark}{bookmark}
-\setinterfacecommand{bottombox}{bottombox}
-\setinterfacecommand{bottomdistance}{bottomdistance}
-\setinterfacecommand{bottomheight}{bottomheight}
-\setinterfacecommand{bottomleftbox}{bottomleftbox}
-\setinterfacecommand{bottomrightbox}{bottomrightbox}
-\setinterfacecommand{bottomspace}{bottomspace}
-\setinterfacecommand{buildtextbottomdot}{buildtextbottomdot}
-\setinterfacecommand{but}{but}
-\setinterfacecommand{button}{button}
-\setinterfacecommand{bypassblocks}{bypassblocks}
-\setinterfacecommand{character}{character}
-\setinterfacecommand{characters}{characters}
-\setinterfacecommand{chem}{chem}
-\setinterfacecommand{clip}{clip}
-\setinterfacecommand{clonefield}{clonefield}
-\setinterfacecommand{color}{color}
-\setinterfacecommand{colorbar}{colorbar}
-\setinterfacecommand{colorvalue}{colorvalue}
-\setinterfacecommand{column}{column}
-\setinterfacecommand{comparecolorgroup}{comparecolorgroup}
-\setinterfacecommand{comparepalet}{comparepalet}
-\setinterfacecommand{completepagenumber}{completepagenumber}
-\setinterfacecommand{completeregister}{completeregister}
-\setinterfacecommand{component}{component}
-\setinterfacecommand{convertnumber}{convertnumber}
-\setinterfacecommand{copyfield}{copyfield}
-\setinterfacecommand{correctwhitespace}{correctwhitespace}
-\setinterfacecommand{coupledocument}{coupledocument}
-\setinterfacecommand{couplemarking}{couplemarking}
-\setinterfacecommand{couplepage}{couplepage}
-\setinterfacecommand{couplepaper}{couplepaper}
-\setinterfacecommand{coupleregister}{coupleregister}
-\setinterfacecommand{crlf}{crlf}
-\setinterfacecommand{currentdate}{currentdate}
-\setinterfacecommand{currentheadnumber}{currentheadnumber}
-\setinterfacecommand{cutspace}{cutspace}
-\setinterfacecommand{date}{date}
-\setinterfacecommand{decouplemarking}{decouplemarking}
-\setinterfacecommand{decrementnumber}{decrementnumber}
-\setinterfacecommand{define}{define}
-\setinterfacecommand{defineaccent}{defineaccent}
-\setinterfacecommand{defineblank}{defineblank}
-\setinterfacecommand{defineblock}{defineblock}
-\setinterfacecommand{definebodyfont}{definebodyfont}
-\setinterfacecommand{definebodyfontenvironment}{definebodyfontenvironment}
-\setinterfacecommand{definebodyfontswitch}{definebodyfontswitch}
-\setinterfacecommand{definebuffer}{definebuffer}
-\setinterfacecommand{definecharacter}{definecharacter}
-\setinterfacecommand{definecharacterkerning}{definecharacterkerning}
-\setinterfacecommand{definecharacterspacing}{definecharacterspacing}
-\setinterfacecommand{definecolor}{definecolor}
-\setinterfacecommand{definecolorgroup}{definecolorgroup}
-\setinterfacecommand{definecolumnbreak}{definecolumnbreak}
-\setinterfacecommand{definecolumnset}{definecolumnset}
-\setinterfacecommand{definecombination}{definecombination}
-\setinterfacecommand{definecombinedlist}{definecombinedlist}
-\setinterfacecommand{definecommand}{definecommand}
-\setinterfacecommand{defineconversion}{defineconversion}
-\setinterfacecommand{definedescription}{definedescription}
-\setinterfacecommand{definedfont}{definedfont}
-\setinterfacecommand{defineenumeration}{defineenumeration}
-\setinterfacecommand{definefallbackfamily}{definefallbackfamily}
-\setinterfacecommand{definefield}{definefield}
-\setinterfacecommand{definefieldstack}{definefieldstack}
-\setinterfacecommand{definefiguresymbol}{definefiguresymbol}
-\setinterfacecommand{definefilefallback}{definefilefallback}
-\setinterfacecommand{definefirstline}{definefirstline}
-\setinterfacecommand{definefloat}{definefloat}
-\setinterfacecommand{definefont}{definefont}
-\setinterfacecommand{definefontalternative}{definefontalternative}
-\setinterfacecommand{definefontfallback}{definefontfallback}
-\setinterfacecommand{definefontfamily}{definefontfamily}
-\setinterfacecommand{definefontfamilypreset}{definefontfamilypreset}
-\setinterfacecommand{definefontfeature}{definefontfeature}
-\setinterfacecommand{definefontfile}{definefontfile}
-\setinterfacecommand{definefontsize}{definefontsize}
-\setinterfacecommand{definefontsolution}{definefontsolution}
-\setinterfacecommand{definefontstyle}{definefontstyle}
-\setinterfacecommand{definefontsynonym}{definefontsynonym}
-\setinterfacecommand{defineframed}{defineframed}
-\setinterfacecommand{defineframedtext}{defineframedtext}
-\setinterfacecommand{definefrozenfont}{definefrozenfont}
-\setinterfacecommand{definehbox}{definehbox}
-\setinterfacecommand{definehead}{definehead}
-\setinterfacecommand{definehyphenationfeatures}{definehyphenationfeatures}
-\setinterfacecommand{defineindentedtext}{defineindentedtext}
-\setinterfacecommand{defineinmargin}{defineinmargin}
-\setinterfacecommand{defineinteractionmenu}{defineinteractionmenu}
-\setinterfacecommand{defineitemgroup}{defineitemgroup}
-\setinterfacecommand{defineitems}{defineitems}
-\setinterfacecommand{definelabel}{definelabel}
-\setinterfacecommand{definelayer}{definelayer}
-\setinterfacecommand{definelayout}{definelayout}
-\setinterfacecommand{definelinenote}{definelinenote}
-\setinterfacecommand{definelist}{definelist}
-\setinterfacecommand{definelogo}{definelogo}
-\setinterfacecommand{definemainfield}{definemainfield}
-\setinterfacecommand{definemakeup}{definemakeup}
-\setinterfacecommand{definemarking}{definemarking}
-\setinterfacecommand{definemathalignment}{definemathalignment}
-\setinterfacecommand{definemode}{definemode}
-\setinterfacecommand{definenamedcolor}{definenamedcolor}
-\setinterfacecommand{definenote}{definenote}
-\setinterfacecommand{defineoutput}{defineoutput}
-\setinterfacecommand{defineoverlay}{defineoverlay}
-\setinterfacecommand{definepagebreak}{definepagebreak}
-\setinterfacecommand{definepalet}{definepalet}
-\setinterfacecommand{definepapersize}{definepapersize}
-\setinterfacecommand{defineparagraphs}{defineparagraphs}
-\setinterfacecommand{defineperiodkerning}{defineperiodkerning}
-\setinterfacecommand{defineplacement}{defineplacement}
-\setinterfacecommand{defineprofile}{defineprofile}
-\setinterfacecommand{defineprogram}{defineprogram}
-\setinterfacecommand{definerawfont}{definerawfont}
-\setinterfacecommand{definereference}{definereference}
-\setinterfacecommand{definereferenceformat}{definereferenceformat}
-\setinterfacecommand{definereferencelist}{definereferencelist}
-\setinterfacecommand{defineregister}{defineregister}
-\setinterfacecommand{definerule}{definerule}
-\setinterfacecommand{definesection}{definesection}
-\setinterfacecommand{definesectionblock}{definesectionblock}
-\setinterfacecommand{definesorting}{definesorting}
-\setinterfacecommand{definestartstop}{definestartstop}
-\setinterfacecommand{definestyle}{definestyle}
-\setinterfacecommand{definesubfield}{definesubfield}
-\setinterfacecommand{definesymbol}{definesymbol}
-\setinterfacecommand{definesynonyms}{definesynonyms}
-\setinterfacecommand{definetabletemplate}{definetabletemplate}
-\setinterfacecommand{definetabulate}{definetabulate}
-\setinterfacecommand{definetext}{definetext}
-\setinterfacecommand{definetextbackground}{definetextbackground}
-\setinterfacecommand{definetextnote}{definetextnote}
-\setinterfacecommand{definetextposition}{definetextposition}
-\setinterfacecommand{definetextvariable}{definetextvariable}
-\setinterfacecommand{definetype}{definetype}
-\setinterfacecommand{definetyping}{definetyping}
-\setinterfacecommand{defineversion}{defineversion}
-\setinterfacecommand{depthspanningtext}{depthspanningtext}
-\setinterfacecommand{determineheadnumber}{determineheadnumber}
-\setinterfacecommand{determinelistcharacteristics}{determinelistcharacteristics}
-\setinterfacecommand{determineregistercharacteristics}{determineregistercharacteristics}
-\setinterfacecommand{dimension}{dimension}
-\setinterfacecommand{disableinteractionmenu}{disableinteractionmenu}
-\setinterfacecommand{disablemode}{disablemode}
-\setinterfacecommand{doaddfeature}{doaddfeature}
-\setinterfacecommand{domicile}{domicile}
-\setinterfacecommand{dontconvertfont}{dontconvertfont}
-\setinterfacecommand{donttest}{donttest}
-\setinterfacecommand{edgedistance}{edgedistance}
-\setinterfacecommand{edgewidth}{edgewidth}
-\setinterfacecommand{emphasisboldface}{emphasisboldface}
-\setinterfacecommand{emptylines}{emptylines}
-\setinterfacecommand{enablemode}{enablemode}
-\setinterfacecommand{environment}{environment}
-\setinterfacecommand{externalfigure}{externalfigure}
-\setinterfacecommand{fact}{fact}
-\setinterfacecommand{fastswitchtobodyfont}{fastswitchtobodyfont}
-\setinterfacecommand{feature}{feature}
-\setinterfacecommand{field}{field}
-\setinterfacecommand{fieldstack}{fieldstack}
-\setinterfacecommand{fillinfield}{fillinfield}
-\setinterfacecommand{fillinline}{fillinline}
-\setinterfacecommand{fillinrules}{fillinrules}
-\setinterfacecommand{fillintext}{fillintext}
-\setinterfacecommand{firstcharacter}{firstcharacter}
-\setinterfacecommand{fitfield}{fitfield}
-\setinterfacecommand{fittopbaselinegrid}{fittopbaselinegrid}
-\setinterfacecommand{fixedspace}{fixedspace}
-\setinterfacecommand{fixedspaces}{fixedspaces}
-\setinterfacecommand{flushnotes}{flushnotes}
-\setinterfacecommand{followprofile}{followprofile}
-\setinterfacecommand{followprofileversion}{followprofileversion}
-\setinterfacecommand{followversion}{followversion}
-\setinterfacecommand{footerdistance}{footerdistance}
-\setinterfacecommand{footerheight}{footerheight}
-\setinterfacecommand{footnote}{footnote}
-\setinterfacecommand{footnotetext}{footnotetext}
-\setinterfacecommand{forceblocks}{forceblocks}
-\setinterfacecommand{forcecharacterstripping}{forcecharacterstripping}
-\setinterfacecommand{formulanumber}{formulanumber}
-\setinterfacecommand{fraction}{fraction}
-\setinterfacecommand{framed}{framed}
-\setinterfacecommand{from}{from}
-\setinterfacecommand{fromlinenote}{fromlinenote}
-\setinterfacecommand{getbuffer}{getbuffer}
-\setinterfacecommand{getfirstcharacter}{getfirstcharacter}
-\setinterfacecommand{getmarking}{getmarking}
-\setinterfacecommand{getnumber}{getnumber}
-\setinterfacecommand{globaldisablemode}{globaldisablemode}
-\setinterfacecommand{globalenablemode}{globalenablemode}
-\setinterfacecommand{globalpreventmode}{globalpreventmode}
-\setinterfacecommand{godown}{godown}
-\setinterfacecommand{goto}{goto}
-\setinterfacecommand{gotobox}{gotobox}
-\setinterfacecommand{gotopage}{gotopage}
-\setinterfacecommand{graycolor}{graycolor}
-\setinterfacecommand{greyvalue}{greyvalue}
-\setinterfacecommand{grid}{grid}
-\setinterfacecommand{hairline}{hairline}
-\setinterfacecommand{head}{head}
-\setinterfacecommand{headerdistance}{headerdistance}
-\setinterfacecommand{headerheight}{headerheight}
-\setinterfacecommand{headlevel}{headlevel}
-\setinterfacecommand{headnumber}{headnumber}
-\setinterfacecommand{headsym}{headsym}
-\setinterfacecommand{headtext}{headtext}
-\setinterfacecommand{heightspanningtext}{heightspanningtext}
-\setinterfacecommand{hideblocks}{hideblocks}
-\setinterfacecommand{high}{high}
-\setinterfacecommand{hl}{hl}
-\setinterfacecommand{immediatebetweenlist}{immediatebetweenlist}
-\setinterfacecommand{immediatetolist}{immediatetolist}
-\setinterfacecommand{in}{in}
-\setinterfacecommand{incrementnumber}{incrementnumber}
-\setinterfacecommand{indenting}{indenting}
-\setinterfacecommand{inframed}{inframed}
-\setinterfacecommand{infull}{infull}
-\setinterfacecommand{ininner}{ininner}
-\setinterfacecommand{inleft}{inleft}
-\setinterfacecommand{inleftedge}{inleftedge}
-\setinterfacecommand{inleftmargin}{inleftmargin}
-\setinterfacecommand{inline}{inline}
-\setinterfacecommand{inmargin}{inmargin}
-\setinterfacecommand{inmframed}{inmaframed}
-\setinterfacecommand{inneredgedistance}{inneredgedistance}
-\setinterfacecommand{inneredgewidth}{inneredgewidth}
-\setinterfacecommand{innermargindistance}{innermargindistance}
-\setinterfacecommand{innermarginwidth}{innermarginwidth}
-\setinterfacecommand{inothermargin}{inothermargin}
-\setinterfacecommand{inouter}{inouter}
-\setinterfacecommand{inright}{inright}
-\setinterfacecommand{inrightedge}{inrightedge}
-\setinterfacecommand{inrightmargin}{inrightmargin}
-\setinterfacecommand{installlanguage}{installlanguage}
-\setinterfacecommand{interactionbar}{interactionbar}
-\setinterfacecommand{interactionbuttons}{interactionbuttons}
-\setinterfacecommand{interactionmenu}{interactionmenu}
-\setinterfacecommand{item}{item}
-\setinterfacecommand{itemgroup}{itemgroup}
-\setinterfacecommand{items}{items}
-\setinterfacecommand{itemtag}{itemtag}
-\setinterfacecommand{its}{its}
-\setinterfacecommand{keepblocks}{keepblocks}
-\setinterfacecommand{kerncharacters}{kerncharacters}
-\setinterfacecommand{label}{label}
-\setinterfacecommand{labels}{labels}
-\setinterfacecommand{labeltext}{labeltext}
-\setinterfacecommand{language}{language}
-\setinterfacecommand{languageCharacters}{languageCharacters}
-\setinterfacecommand{languagecharacters}{languagecharacters}
-\setinterfacecommand{leftaligned}{leftaligned}
-\setinterfacecommand{leftbottombox}{leftbottombox}
-\setinterfacecommand{leftedgedistance}{leftedgedistance}
-\setinterfacecommand{leftedgewidth}{leftedgewidth}
-\setinterfacecommand{leftline}{leftline}
-\setinterfacecommand{leftmargindistance}{leftmargindistance}
-\setinterfacecommand{leftmarginwidth}{leftmarginwidth}
-\setinterfacecommand{leg}{leg}
-\setinterfacecommand{linecorrection}{linecorrection}
-\setinterfacecommand{linenote}{linenote}
-\setinterfacecommand{linespanningtext}{linespanningtext}
-\setinterfacecommand{linewidth}{linethickness}
-\setinterfacecommand{listheight}{listheight}
-\setinterfacecommand{listlength}{listlength}
-\setinterfacecommand{listsymbol}{listsymbol}
-\setinterfacecommand{listwidth}{listwidth}
-\setinterfacecommand{loadfontgoodies}{loadfontgoodies}
-\setinterfacecommand{localfootnotes}{localfootnotes}
-\setinterfacecommand{localnotes}{localnotes}
-\setinterfacecommand{logfields}{logfields}
-\setinterfacecommand{lohi}{lohi}
-\setinterfacecommand{low}{low}
-\setinterfacecommand{macroname}{name}
-\setinterfacecommand{mainlanguage}{mainlanguage}
-\setinterfacecommand{makeupheight}{makeupheight}
-\setinterfacecommand{makeupwidth}{makeupwidth}
-\setinterfacecommand{mar}{mar}
-\setinterfacecommand{marginblock}{marginblock}
-\setinterfacecommand{margindistance}{margindistance}
-\setinterfacecommand{marginrule}{marginrule}
-\setinterfacecommand{margintext}{margintext}
-\setinterfacecommand{margintitle}{margintitle}
-\setinterfacecommand{marginwidth}{marginwidth}
-\setinterfacecommand{marginword}{marginword}
-\setinterfacecommand{marking}{marking}
-\setinterfacecommand{markversion}{markversion}
-\setinterfacecommand{mathematics}{mathematics}
-\setinterfacecommand{menubutton}{menubutton}
-\setinterfacecommand{mframed}{maframed}
-\setinterfacecommand{midaligned}{midaligned}
-\setinterfacecommand{mirror}{mirror}
-\setinterfacecommand{month}{month}
-\setinterfacecommand{moveformula}{moveformula}
-\setinterfacecommand{moveongrid}{moveongrid}
-\setinterfacecommand{movesidefloat}{movesidefloat}
-\setinterfacecommand{navigating}{navigating}
-\setinterfacecommand{nodimension}{nodimension}
-\setinterfacecommand{noheaderandfooterlines}{noheaderandfooterlines}
-\setinterfacecommand{noindenting}{noindenting}
-\setinterfacecommand{noitem}{noitem}
-\setinterfacecommand{nolist}{nolist}
-\setinterfacecommand{nomarking}{nomarking}
-\setinterfacecommand{nomoreblocks}{nomoreblocks}
-\setinterfacecommand{nomorefiles}{nomorefiles}
-\setinterfacecommand{nop}{nop}
-\setinterfacecommand{nospace}{nospace}
-\setinterfacecommand{note}{note}
-\setinterfacecommand{notesymbol}{notesymbol}
-\setinterfacecommand{notopandbottomlines}{notopandbottomlines}
-\setinterfacecommand{notsmallcapped}{nocap}
-\setinterfacecommand{nowhitespace}{nowhitespace}
-\setinterfacecommand{numberofsubpages}{numberofsubpages}
-\setinterfacecommand{numbers}{numbers}
-\setinterfacecommand{outeredgedistance}{outeredgedistance}
-\setinterfacecommand{outeredgewidth}{outeredgewidth}
-\setinterfacecommand{outermargindistance}{outermargindistance}
-\setinterfacecommand{outermarginwidth}{outermarginwidth}
-\setinterfacecommand{packed}{packed}
-\setinterfacecommand{page}{page}
-\setinterfacecommand{pagebreak}{pagebreak}
-\setinterfacecommand{pagedepth}{pagedepth}
-\setinterfacecommand{pagenumber}{pagenumber}
-\setinterfacecommand{pageoffset}{pageoffset}
-\setinterfacecommand{pagereference}{pagereference}
-\setinterfacecommand{paperheight}{paperheight}
-\setinterfacecommand{paperwidth}{paperwidth}
-\setinterfacecommand{periods}{periods}
-\setinterfacecommand{placebookmarks}{placebookmarks}
-\setinterfacecommand{placecombinedlist}{placecombinedlist}
-\setinterfacecommand{placefloat}{placefloat}
-\setinterfacecommand{placefootnotes}{placefootnotes}
-\setinterfacecommand{placeformula}{placeformula}
-\setinterfacecommand{placeheadnumber}{placeheadnumber}
-\setinterfacecommand{placeheadtext}{placeheadtext}
-\setinterfacecommand{placelegend}{placelegend}
-\setinterfacecommand{placelist}{placelist}
-\setinterfacecommand{placelistofsynonyms}{placelistofsynonyms}
-\setinterfacecommand{placelocalfootnotes}{placelocalfootnotes}
-\setinterfacecommand{placelocalnotes}{placelocalnotes}
-\setinterfacecommand{placelogos}{placelogos}
-\setinterfacecommand{placenamedfloat}{placenamedfloat}
-\setinterfacecommand{placenotes}{placenotes}
-\setinterfacecommand{placeongrid}{placeongrid}
-\setinterfacecommand{placeontopofeachother}{placeontopofeachother}
-\setinterfacecommand{placepagenumber}{placepagenumber}
-\setinterfacecommand{placerawlist}{placerawlist}
-\setinterfacecommand{placereferencelist}{placereferencelist}
-\setinterfacecommand{placeregister}{placeregister}
-\setinterfacecommand{placerule}{placerule}
-\setinterfacecommand{placesidebyside}{placesidebyside}
-\setinterfacecommand{placesubformula}{placesubformula}
-\setinterfacecommand{placetextvariable}{placetextvariable}
-\setinterfacecommand{position}{position}
-\setinterfacecommand{positiontext}{positiontext}
-\setinterfacecommand{postponenotes}{postponenotes}
-\setinterfacecommand{postponingnotes}{postponingnotes}
-\setinterfacecommand{predefinedfont}{predefinedfont}
-\setinterfacecommand{predefinefont}{predefinefont}
-\setinterfacecommand{presetdocument}{presetdocument}
-\setinterfacecommand{prettyprintbuffer}{prettyprintbuffer}
-\setinterfacecommand{preventmode}{preventmode}
-\setinterfacecommand{printpaperheight}{printpaperheight}
-\setinterfacecommand{printpaperwidth}{printpaperwidth}
-\setinterfacecommand{processblocks}{processblocks}
-\setinterfacecommand{processbodyfontenvironmentlist}{processbodyfontenvironmentlist}
-\setinterfacecommand{processpage}{processpage}
-\setinterfacecommand{product}{product}
-\setinterfacecommand{program}{program}
-\setinterfacecommand{project}{project}
-\setinterfacecommand{publication}{publication}
-\setinterfacecommand{quotation}{quotation}
-\setinterfacecommand{quote}{quote}
-\setinterfacecommand{ran}{ran}
-\setinterfacecommand{redo}{redo}
-\setinterfacecommand{redoconvertfont}{redoconvertfont}
-\setinterfacecommand{ref}{ref}
-\setinterfacecommand{reference}{reference}
-\setinterfacecommand{referral}{referral}
-\setinterfacecommand{referraldate}{referraldate}
-\setinterfacecommand{referring}{referring}
-\setinterfacecommand{registerfontclass}{registerfontclass}
-\setinterfacecommand{registerhyphenationexception}{registerhyphenationexception}
-\setinterfacecommand{registerhyphenationpattern}{registerhyphenationpattern}
-\setinterfacecommand{remark}{remark}
-\setinterfacecommand{replacefeature}{replacefeature}
-\setinterfacecommand{reset}{reset}
-\setinterfacecommand{resetandaddfeature}{resetandaddfeature}
-\setinterfacecommand{resetcharacteralign}{resetcharacteralign}
-\setinterfacecommand{resetcharacterkerning}{resetcharacterkerning}
-\setinterfacecommand{resetcharacterspacing}{resetcharacterspacing}
-\setinterfacecommand{resetcharacterstripping}{resetcharacterstripping}
-\setinterfacecommand{resetfeature}{resetfeature}
-\setinterfacecommand{resetfontcolorsheme}{resetfontcolorsheme}
-\setinterfacecommand{resetfontfallback}{resetfontfallback}
-\setinterfacecommand{resetfontsolution}{resetfontsolution}
-\setinterfacecommand{resethyphenationfeatures}{resethyphenationfeatures}
-\setinterfacecommand{resetlocalfloats}{resetlocalfloats}
-\setinterfacecommand{resetmarking}{resetmarking}
-\setinterfacecommand{resetmode}{resetmode}
-\setinterfacecommand{resetnumber}{resetnumber}
-\setinterfacecommand{resetpath}{resetpath}
-\setinterfacecommand{resetperiodkerning}{resetperiodkerning}
-\setinterfacecommand{resetsystemmode}{resetsystemmode}
-\setinterfacecommand{resettextcontent}{resettextcontent}
-\setinterfacecommand{resetvisualizers}{resetvisualizers}
-\setinterfacecommand{restoreglobalbodyfont}{restoreglobalbodyfont}
-\setinterfacecommand{retestfeature}{retestfeature}
-\setinterfacecommand{revivefeature}{revivefeature}
-\setinterfacecommand{rightaligned}{rightaligned}
-\setinterfacecommand{rightbottombox}{rightbottombox}
-\setinterfacecommand{rightedgedistance}{rightedgedistance}
-\setinterfacecommand{rightedgewidth}{rightedgewidth}
-\setinterfacecommand{rightline}{rightline}
-\setinterfacecommand{rightmargindistance}{rightmargindistance}
-\setinterfacecommand{rightmarginwidth}{rightmarginwidth}
-\setinterfacecommand{romannumerals}{romannumerals}
-\setinterfacecommand{rotate}{rotate}
-\setinterfacecommand{savebuffer}{savebuffer}
-\setinterfacecommand{scale}{scale}
-\setinterfacecommand{screen}{screen}
-\setinterfacecommand{selectblocks}{selectblocks}
-\setinterfacecommand{selectpaper}{selectpaper}
-\setinterfacecommand{selectversion}{selectversion}
-\setinterfacecommand{setbigbodyfont}{setbigbodyfont}
-\setinterfacecommand{setcharacteralign}{setcharacteralign}
-\setinterfacecommand{setcharacteraligndetail}{setcharacteraligndetail}
-\setinterfacecommand{setcharactercasing}{setcharactercasing}
-\setinterfacecommand{setcharactercleaning}{setcharactercleaning}
-\setinterfacecommand{setcharacterkerning}{setcharacterkerning}
-\setinterfacecommand{setcharacterspacing}{setcharacterspacing}
-\setinterfacecommand{setcharacterstripping}{setcharacterstripping}
-\setinterfacecommand{setcurrentfontclass}{setcurrentfontclass}
-\setinterfacecommand{setfirstline}{setfirstline}
-\setinterfacecommand{setfirstpasscharacteralign}{setfirstpasscharacteralign}
-\setinterfacecommand{setfont}{setfont}
-\setinterfacecommand{setfontcolorsheme}{setfontcolorsheme}
-\setinterfacecommand{setfontfeature}{setfontfeature}
-\setinterfacecommand{setfontsolution}{setfontsolution}
-\setinterfacecommand{setfontstrut}{setfontstrut}
-\setinterfacecommand{sethyphenationfeatures}{sethyphenationfeatures}
-\setinterfacecommand{setmainbodyfont}{setmainbodyfont}
-\setinterfacecommand{setmode}{setmode}
-\setinterfacecommand{setnote}{setnote}
-\setinterfacecommand{setnotetext}{setnotetext}
-\setinterfacecommand{setnumber}{setnumber}
-\setinterfacecommand{setperiodkerning}{setperiodkerning}
-\setinterfacecommand{setsecondpasscharacteralign}{setsecondpasscharacteralign}
-\setinterfacecommand{setsmallbodyfont}{setsmallbodyfont}
-\setinterfacecommand{setsystemmode}{setsystemmode}
-\setinterfacecommand{settextcontent}{settextcontent}
-\setinterfacecommand{settextvariable}{settextvariable}
-\setinterfacecommand{setupalign}{setupalign}
-\setinterfacecommand{setupanswerarea}{setupanswerarea}
-\setinterfacecommand{setuparranging}{setuparranging}
-\setinterfacecommand{setupattachment}{setupattachment}
-\setinterfacecommand{setupbackground}{setupbackground}
-\setinterfacecommand{setupbackgrounds}{setupbackgrounds}
-\setinterfacecommand{setupblackrules}{setupblackrules}
-\setinterfacecommand{setupblank}{setupblank}
-\setinterfacecommand{setupblock}{setupblock}
-\setinterfacecommand{setupbodyfont}{setupbodyfont}
-\setinterfacecommand{setupbodyfontenvironment}{setupbodyfontenvironment}
-\setinterfacecommand{setupbottom}{setupbottom}
-\setinterfacecommand{setupbottomtexts}{setupbottomtexts}
-\setinterfacecommand{setupbuffer}{setupbuffer}
-\setinterfacecommand{setupbuttons}{setupbuttons}
-\setinterfacecommand{setupcapitals}{setupcapitals}
-\setinterfacecommand{setupcaption}{setupcaption}
-\setinterfacecommand{setupcaptions}{setupcaptions}
-\setinterfacecommand{setupcharacteralign}{setupcharacteralign}
-\setinterfacecommand{setupcharacterkerning}{setupcharacterkerning}
-\setinterfacecommand{setupcharacterspacing}{setupcharacterspacing}
-\setinterfacecommand{setupclipping}{setupclipping}
-\setinterfacecommand{setupcolor}{setupcolor}
-\setinterfacecommand{setupcolors}{setupcolors}
-\setinterfacecommand{setupcolumns}{setupcolumns}
-\setinterfacecommand{setupcolumnset}{setupcolumnset}
-\setinterfacecommand{setupcolumnsetlines}{setupcolumnsetlines}
-\setinterfacecommand{setupcolumnsetstart}{setupcolumnsetstart}
-\setinterfacecommand{setupcombinations}{setupcombinations}
-\setinterfacecommand{setupcombinedlist}{setupcombinedlist}
-\setinterfacecommand{setupcomment}{setupcomment}
-\setinterfacecommand{setupcounter}{setupcounter}
-\setinterfacecommand{setupdescription}{setupdescription}
-\setinterfacecommand{setupdescriptions}{setupdescriptions}
-\setinterfacecommand{setupenumeration}{setupenumeration}
-\setinterfacecommand{setupenumerations}{setupenumerations}
-\setinterfacecommand{setupexternalfigures}{setupexternalfigures}
-\setinterfacecommand{setupfield}{setupfield}
-\setinterfacecommand{setupfields}{setupfields}
-\setinterfacecommand{setupfillinlines}{setupfillinlines}
-\setinterfacecommand{setupfillinrules}{setupfillinrules}
-\setinterfacecommand{setupfirstline}{setupfirstline}
-\setinterfacecommand{setupfloat}{setupfloat}
-\setinterfacecommand{setupfloats}{setupfloats}
-\setinterfacecommand{setupfloatsplitting}{setupfloatsplitting}
-\setinterfacecommand{setupfontexpansion}{setupfontexpansion}
-\setinterfacecommand{setupfontprotrusion}{setupfontprotrusion}
-\setinterfacecommand{setupfonts}{setupfonts}
-\setinterfacecommand{setupfontsolution}{setupfontsolution}
-\setinterfacecommand{setupfooter}{setupfooter}
-\setinterfacecommand{setupfootertexts}{setupfootertexts}
-\setinterfacecommand{setupfootnotedefinition}{setupfootnotedefinition}
-\setinterfacecommand{setupfootnotes}{setupfootnotes}
-\setinterfacecommand{setupforms}{setupforms}
-\setinterfacecommand{setupformula}{setupformula}
-\setinterfacecommand{setupformulas}{setupformulae}
-\setinterfacecommand{setupframed}{setupframed}
-\setinterfacecommand{setupframedtext}{setupframedtext}
-\setinterfacecommand{setupframedtexts}{setupframedtexts}
-\setinterfacecommand{setuphead}{setuphead}
-\setinterfacecommand{setupheader}{setupheader}
-\setinterfacecommand{setupheadertexts}{setupheadertexts}
-\setinterfacecommand{setupheadnumber}{setupheadnumber}
-\setinterfacecommand{setupheads}{setupheads}
-\setinterfacecommand{setupheadtext}{setupheadtext}
-\setinterfacecommand{setuphyphenation}{setuphyphenation}
-\setinterfacecommand{setuphyphenmark}{setuphyphenmark}
-\setinterfacecommand{setupindentedtext}{setupindentedtext}
-\setinterfacecommand{setupindenting}{setupindenting}
-\setinterfacecommand{setupinmargin}{setupinmargin}
-\setinterfacecommand{setupinteraction}{setupinteraction}
-\setinterfacecommand{setupinteractionbar}{setupinteractionbar}
-\setinterfacecommand{setupinteractionmenu}{setupinteractionmenu}
-\setinterfacecommand{setupinteractionscreen}{setupinteractionscreen}
-\setinterfacecommand{setupinterlinespace}{setupinterlinespace}
-\setinterfacecommand{setupitemgroup}{setupitemgroup}
-\setinterfacecommand{setupitemgroups}{setupitemizations}
-\setinterfacecommand{setupitems}{setupitems}
-\setinterfacecommand{setuplabeltext}{setuplabeltext}
-\setinterfacecommand{setuplanguage}{setuplanguage}
-\setinterfacecommand{setuplayout}{setuplayout}
-\setinterfacecommand{setuplegend}{setuplegend}
-\setinterfacecommand{setuplinenote}{setuplinenote}
-\setinterfacecommand{setuplinenumbering}{setuplinenumbering}
-\setinterfacecommand{setuplines}{setuplines}
-\setinterfacecommand{setuplinewidth}{setuplinewidth}
-\setinterfacecommand{setuplist}{setuplist}
-\setinterfacecommand{setupmakeup}{setupmakeup}
-\setinterfacecommand{setupmarginblock}{setupmarginblock}
-\setinterfacecommand{setupmarginblocks}{setupmarginblocks}
-\setinterfacecommand{setupmargindata}{setupmargindata}
-\setinterfacecommand{setupmarginrules}{setupmarginrules}
-\setinterfacecommand{setupmarking}{setupmarking}
-\setinterfacecommand{setupmathalignment}{setupmathalignment}
-\setinterfacecommand{setupnarrower}{setupnarrower}
-\setinterfacecommand{setupnotation}{setupnotation}
-\setinterfacecommand{setupnotations}{setupnotations}
-\setinterfacecommand{setupnote}{setupnote}
-\setinterfacecommand{setupnotes}{setupnotes}
-\setinterfacecommand{setupnumber}{setupnumber}
-\setinterfacecommand{setupnumbering}{setupnumbering}
-\setinterfacecommand{setupoppositeplacing}{setupoppositeplacing}
-\setinterfacecommand{setupoutput}{setupoutput}
-\setinterfacecommand{setuppagecomment}{setuppagecomment}
-\setinterfacecommand{setuppagenumber}{setuppagenumber}
-\setinterfacecommand{setuppagenumbering}{setuppagenumbering}
-\setinterfacecommand{setuppagetransitions}{setuppagetransitions}
-\setinterfacecommand{setuppalet}{setuppalet}
-\setinterfacecommand{setuppaper}{setuppaper}
-\setinterfacecommand{setuppapersize}{setuppapersize}
-\setinterfacecommand{setupparagraphnumbering}{setupparagraphnumbering}
-\setinterfacecommand{setupparagraphs}{setupparagraphs}
-\setinterfacecommand{setupperiodkerning}{setupperiodkerning}
-\setinterfacecommand{setupplacement}{setupplacement}
-\setinterfacecommand{setuppositioning}{setuppositioning}
-\setinterfacecommand{setupprofiles}{setupprofiles}
-\setinterfacecommand{setupprograms}{setupprograms}
-\setinterfacecommand{setuppublications}{setuppublications}
-\setinterfacecommand{setupquote}{setupquote}
-\setinterfacecommand{setupreferencelist}{setupreferencelist}
-\setinterfacecommand{setupreferencing}{setupreferencing}
-\setinterfacecommand{setupregister}{setupregister}
-\setinterfacecommand{setuprotate}{setuprotate}
-\setinterfacecommand{setuprule}{setuprule}
-\setinterfacecommand{setupscreens}{setupscreens}
-\setinterfacecommand{setupsection}{setupsection}
-\setinterfacecommand{setupsectionblock}{setupsectionblock}
-\setinterfacecommand{setupsorting}{setupsorting}
-\setinterfacecommand{setupspacing}{setupspacing}
-\setinterfacecommand{setupstartstop}{setupstartstop}
-\setinterfacecommand{setupstrut}{setupstrut}
-\setinterfacecommand{setupsubpagenumber}{setupsubpagenumber}
-\setinterfacecommand{setupsymbolset}{setupsymbolset}
-\setinterfacecommand{setupsynchronization}{setupsynchronization}
-\setinterfacecommand{setupsynchronizationbar}{setupsynchronizationbar}
-\setinterfacecommand{setupsynonyms}{setupsynonyms}
-\setinterfacecommand{setupsystem}{setupsystem}
-\setinterfacecommand{setuptab}{setuptab}
-\setinterfacecommand{setuptables}{setuptables}
-\setinterfacecommand{setuptabulate}{setuptabulate}
-\setinterfacecommand{setuptext}{setuptext}
-\setinterfacecommand{setuptextbackground}{setuptextbackground}
-\setinterfacecommand{setuptextnote}{setuptextnote}
-\setinterfacecommand{setuptextposition}{setuptextposition}
-\setinterfacecommand{setuptextrules}{setuptextrules}
-\setinterfacecommand{setuptexttexts}{setuptexttexts}
-\setinterfacecommand{setuptextvariable}{setuptextvariable}
-\setinterfacecommand{setupthinrules}{setupthinrules}
-\setinterfacecommand{setuptolerance}{setuptolerance}
-\setinterfacecommand{setuptop}{setuptop}
-\setinterfacecommand{setuptoptexts}{setuptoptexts}
-\setinterfacecommand{setuptype}{setuptype}
-\setinterfacecommand{setuptyping}{setuptyping}
-\setinterfacecommand{setupunderbar}{setupunderbar}
-\setinterfacecommand{setupurl}{setupurl}
-\setinterfacecommand{setupversions}{setupversions}
-\setinterfacecommand{setupwhitespace}{setupwhitespace}
-\setinterfacecommand{setvisualizerfont}{setvisualizerfont}
-\setinterfacecommand{showbodyfont}{showbodyfont}
-\setinterfacecommand{showbodyfontenvironment}{showbodyfontenvironment}
-\setinterfacecommand{showcolor}{showcolor}
-\setinterfacecommand{showcolorgroup}{showcolorgroup}
-\setinterfacecommand{showcounter}{showcounter}
-\setinterfacecommand{showexternalfigures}{showexternalfigures}
-\setinterfacecommand{showfields}{showfields}
-\setinterfacecommand{showfont}{showfont}
-\setinterfacecommand{showfontdata}{showfontdata}
-\setinterfacecommand{showfontexpansion}{showfontexpansion}
-\setinterfacecommand{showfontitalics}{showfontitalics}
-\setinterfacecommand{showfontkerns}{showfontkerns}
-\setinterfacecommand{showfontparameters}{showfontparameters}
-\setinterfacecommand{showfontstrip}{showfontstrip}
-\setinterfacecommand{showfontstyle}{showfontstyle}
-\setinterfacecommand{showframe}{showframe}
-\setinterfacecommand{showgrid}{showgrid}
-\setinterfacecommand{showhyphenationtrace}{showhyphenationtrace}
-\setinterfacecommand{showkerning}{showkerning}
-\setinterfacecommand{showlayout}{showlayout}
-\setinterfacecommand{showmakeup}{showmakeup}
-\setinterfacecommand{showminimalbaseline}{showminimalbaseline}
-\setinterfacecommand{showpalet}{showpalet}
-\setinterfacecommand{showprint}{showprint}
-\setinterfacecommand{showsetups}{showsetups}
-\setinterfacecommand{showstruts}{showstruts}
-\setinterfacecommand{showsymbolset}{showsymbolset}
-\setinterfacecommand{smallcapped}{cap}
-\setinterfacecommand{someline}{someline}
-\setinterfacecommand{somewhere}{somewhere}
-\setinterfacecommand{space}{space}
-\setinterfacecommand{specialitem}{specialitem}
-\setinterfacecommand{splitfloat}{splitfloat}
-\setinterfacecommand{startalignment}{startalignment}
-\setinterfacecommand{startbackground}{startbackground}
-\setinterfacecommand{startcoding}{startcoding}
-\setinterfacecommand{startcolor}{startcolor}
-\setinterfacecommand{startcolumnmakeup}{startcolumnmakeup}
-\setinterfacecommand{startcolumns}{startcolumns}
-\setinterfacecommand{startcolumnset}{startcolumnset}
-\setinterfacecommand{startcombination}{startcombination}
-\setinterfacecommand{startcomponent}{startcomponent}
-\setinterfacecommand{startdocument}{startdocument}
-\setinterfacecommand{startenvironment}{startenvironment}
-\setinterfacecommand{startfigure}{startfigure}
-\setinterfacecommand{startframed}{startframed}
-\setinterfacecommand{startglobal}{startglobal}
-\setinterfacecommand{startline}{startline}
-\setinterfacecommand{startlinecorrection}{startlinecorrection}
-\setinterfacecommand{startlinenote}{startlinenote}
-\setinterfacecommand{startlinenumbering}{startlinenumbering}
-\setinterfacecommand{startlines}{startlines}
-\setinterfacecommand{startlocal}{startlocal}
-\setinterfacecommand{startlocalfootnotes}{startlocalfootnotes}
-\setinterfacecommand{startmakeup}{startmakeup}
-\setinterfacecommand{startmarginblock}{startmarginblock}
-\setinterfacecommand{startmarginrule}{startmarginrule}
-\setinterfacecommand{startnarrower}{startnarrower}
-\setinterfacecommand{startopposite}{startopposite}
-\setinterfacecommand{startoverlay}{startoverlay}
-\setinterfacecommand{startoverview}{startoverview}
-\setinterfacecommand{startpacked}{startpacked}
-\setinterfacecommand{startpositioning}{startpositioning}
-\setinterfacecommand{startproduct}{startproduct}
-\setinterfacecommand{startprofile}{startprofile}
-\setinterfacecommand{startproject}{startproject}
-\setinterfacecommand{startquotation}{startquotation}
-\setinterfacecommand{startraster}{startraster}
-\setinterfacecommand{startsymbolset}{startsymbolset}
-\setinterfacecommand{startsynchronization}{startsynchronization}
-\setinterfacecommand{starttable}{starttable}
-\setinterfacecommand{starttables}{starttables}
-\setinterfacecommand{starttext}{starttext}
-\setinterfacecommand{starttextbackground}{starttextbackground}
-\setinterfacecommand{starttextrule}{starttextrule}
-\setinterfacecommand{startunpacked}{startunpacked}
-\setinterfacecommand{startversion}{startversion}
-\setinterfacecommand{stopalignment}{stopalignment}
-\setinterfacecommand{stopbackground}{stopbackground}
-\setinterfacecommand{stopcoding}{stopcoding}
-\setinterfacecommand{stopcolor}{stopcolor}
-\setinterfacecommand{stopcolumnmakeup}{stopcolumnmakeup}
-\setinterfacecommand{stopcolumns}{stopcolumns}
-\setinterfacecommand{stopcolumnset}{stopcolumnset}
-\setinterfacecommand{stopcombination}{stopcombination}
-\setinterfacecommand{stopcomponent}{stopcomponent}
-\setinterfacecommand{stopdocument}{stopdocument}
-\setinterfacecommand{stopenvironment}{stopenvironment}
-\setinterfacecommand{stopframed}{stopframed}
-\setinterfacecommand{stopglobal}{stopglobal}
-\setinterfacecommand{stopline}{stopline}
-\setinterfacecommand{stoplinecorrection}{stoplinecorrection}
-\setinterfacecommand{stoplinenote}{stoplinenote}
-\setinterfacecommand{stoplinenumbering}{stoplinenumbering}
-\setinterfacecommand{stoplines}{stoplines}
-\setinterfacecommand{stoplocal}{stoplocal}
-\setinterfacecommand{stoplocalfootnotes}{stoplocalfootnotes}
-\setinterfacecommand{stopmakeup}{stopmakeup}
-\setinterfacecommand{stopmarginblock}{stopmarginblock}
-\setinterfacecommand{stopmarginrule}{stopmarginrule}
-\setinterfacecommand{stopnarrower}{stopnarrower}
-\setinterfacecommand{stopopposite}{stopopposite}
-\setinterfacecommand{stopoverlay}{stopoverlay}
-\setinterfacecommand{stopoverview}{stopoverview}
-\setinterfacecommand{stoppacked}{stoppacked}
-\setinterfacecommand{stoppositioning}{stoppositioning}
-\setinterfacecommand{stopproduct}{stopproduct}
-\setinterfacecommand{stopprofile}{stopprofile}
-\setinterfacecommand{stopproject}{stopproject}
-\setinterfacecommand{stopquotation}{stopquotation}
-\setinterfacecommand{stopraster}{stopraster}
-\setinterfacecommand{stopsynchronization}{stopsynchronization}
-\setinterfacecommand{stoptable}{stoptable}
-\setinterfacecommand{stoptables}{stoptables}
-\setinterfacecommand{stoptext}{stoptext}
-\setinterfacecommand{stoptextbackground}{stoptextbackground}
-\setinterfacecommand{stoptextrule}{stoptextrule}
-\setinterfacecommand{stopunpacked}{stopunpacked}
-\setinterfacecommand{stopversion}{stopversion}
-\setinterfacecommand{stretched}{stretched}
-\setinterfacecommand{strictinspectnextcharacter}{strictinspectnextcharacter}
-\setinterfacecommand{stripcharacter}{stripcharacter}
-\setinterfacecommand{subformulanumber}{subformulanumber}
-\setinterfacecommand{subpagenumber}{subpagenumber}
-\setinterfacecommand{subtractfeature}{subtractfeature}
-\setinterfacecommand{switchtobodyfont}{switchtobodyfont}
-\setinterfacecommand{switchtorawfont}{switchtorawfont}
-\setinterfacecommand{sym}{sym}
-\setinterfacecommand{symbol}{symbol}
-\setinterfacecommand{symoffset}{symoffset}
-\setinterfacecommand{synchronizationbar}{synchronizationbar}
-\setinterfacecommand{synchronize}{synchronize}
-\setinterfacecommand{tab}{tab}
-\setinterfacecommand{testcolumn}{testcolumn}
-\setinterfacecommand{testfeature}{testfeature}
-\setinterfacecommand{testfeatureonce}{testfeatureonce}
-\setinterfacecommand{testpage}{testpage}
-\setinterfacecommand{tex}{tex}
-\setinterfacecommand{textbackground}{textbackground}
-\setinterfacecommand{textcolor}{textcolor}
-\setinterfacecommand{textheight}{textheight}
-\setinterfacecommand{textnote}{textnote}
-\setinterfacecommand{textreference}{textreference}
-\setinterfacecommand{textrule}{textrule}
-\setinterfacecommand{textvariable}{textvariable}
-\setinterfacecommand{textwidth}{textwidth}
-\setinterfacecommand{thefirstcharacter}{thefirstcharacter}
-\setinterfacecommand{thenormalizedbodyfontsize}{thenormalizedbodyfontsize}
-\setinterfacecommand{theremainingcharacters}{theremainingcharacters}
-\setinterfacecommand{thinrule}{thinrule}
-\setinterfacecommand{thinrules}{thinrules}
-\setinterfacecommand{tolinenote}{tolinenote}
-\setinterfacecommand{tooltip}{tooltip}
-\setinterfacecommand{topdistance}{topdistance}
-\setinterfacecommand{topheight}{topheight}
-\setinterfacecommand{topspace}{topspace}
-\setinterfacecommand{totalnumberofpages}{totalnumberofpages}
-\setinterfacecommand{translate}{translate}
-\setinterfacecommand{txt}{txt}
-\setinterfacecommand{typ}{typ}
-\setinterfacecommand{type}{type}
-\setinterfacecommand{typebuffer}{typebuffer}
-\setinterfacecommand{typedefinedbuffer}{typedefinedbuffer}
-\setinterfacecommand{typefile}{typefile}
-\setinterfacecommand{typeinlinebuffer}{typeinlinebuffer}
-\setinterfacecommand{typing}{typing}
-\setinterfacecommand{unitmeaning}{unitmeaning}
-\setinterfacecommand{unknown}{unknown}
-\setinterfacecommand{unregisterhyphenationpattern}{unregisterhyphenationpattern}
-\setinterfacecommand{useJSscripts}{useJSscripts}
-\setinterfacecommand{useURL}{useURL}
-\setinterfacecommand{useXMLfilter}{useXMLfilter}
-\setinterfacecommand{useblocks}{useblocks}
-\setinterfacecommand{usebodyfont}{usebodyfont}
-\setinterfacecommand{usebodyfontparameter}{usebodyfontparameter}
-\setinterfacecommand{usecommands}{usecommands}
-\setinterfacecommand{useencoding}{useencoding}
-\setinterfacecommand{useexternaldocument}{useexternaldocument}
-\setinterfacecommand{useexternalfigure}{useexternalfigure}
-\setinterfacecommand{useexternalfile}{useexternalfile}
-\setinterfacecommand{useexternalfiles}{useexternalfiles}
-\setinterfacecommand{useexternalsoundtrack}{useexternalsoundtrack}
-\setinterfacecommand{usemodule}{usemodule}
-\setinterfacecommand{usemodules}{usemodules}
-\setinterfacecommand{usepath}{usedirectory}
-\setinterfacecommand{usereferences}{usereferences}
-\setinterfacecommand{usespecials}{usespecials}
-\setinterfacecommand{usesymbols}{usesymbols}
-\setinterfacecommand{usetypescript}{usetypescript}
-\setinterfacecommand{usetypescriptfile}{usetypescriptfile}
-\setinterfacecommand{useurl}{useurl}
-\setinterfacecommand{verbatim}{verbatim}
-\setinterfacecommand{version}{version}
-\setinterfacecommand{vl}{vl}
-\setinterfacecommand{weekday}{weekday}
-\setinterfacecommand{whitespace}{whitespace}
-\setinterfacecommand{widthspanningtext}{widthspanningtext}
-\setinterfacecommand{wordright}{wordright}
-\setinterfacecommand{writebetweenlist}{writebetweenlist}
-\setinterfacecommand{writetolist}{writetolist}
-\setinterfacecommand{writetoreferencelist}{writetoreferencelist}
-\setinterfacecommand{writetoregister}{writetoregister}
-%
-\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/context/base/mkii/mult-fr.mkii b/Master/texmf-dist/tex/context/base/mkii/mult-fr.mkii
deleted file mode 100644
index ef2da9e493f..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/mult-fr.mkii
+++ /dev/null
@@ -1,2224 +0,0 @@
-% this file is auto-generated, don't edit this file
-%
-% definitions for interface variables for language fr
-%
-\setinterfacevariable{Addition}{Ajout}
-\setinterfacevariable{Alphabetic}{Alphabetique}
-\setinterfacevariable{Balloon}{Ballon}
-\setinterfacevariable{Cap}{Cap}
-\setinterfacevariable{Capital}{Capitales}
-\setinterfacevariable{Character}{Caractere}
-\setinterfacevariable{Characters}{Caracteres}
-\setinterfacevariable{CloseDocument}{FermerDocument}
-\setinterfacevariable{ExitViewer}{SortirVisualisateur}
-\setinterfacevariable{FirstPage}{PremierePage}
-\setinterfacevariable{FitHeight}{AdapterHauteur}
-\setinterfacevariable{FitWidth}{AdapterLargeur}
-\setinterfacevariable{GotoPage}{AlleraPage}
-\setinterfacevariable{Greek}{Grec}
-\setinterfacevariable{Help}{Aide}
-\setinterfacevariable{HideField}{CacherChamps}
-\setinterfacevariable{HideLayer}{CacherCalque}
-\setinterfacevariable{Key}{Cle}
-\setinterfacevariable{LastPage}{DernierePage}
-\setinterfacevariable{LoadForm}{ChargerFormulaire}
-\setinterfacevariable{MONTH}{MOIS}
-\setinterfacevariable{New}{Nouveau}
-\setinterfacevariable{NextJump}{SautSuivant}
-\setinterfacevariable{NextPage}{PageSuivante}
-\setinterfacevariable{Numbers}{Numeros}
-\setinterfacevariable{OpenNamedDocument}{OuvrirDocumentNomme}
-\setinterfacevariable{Ordinal}{Ordinal}
-\setinterfacevariable{Paragraph}{Paragraphe}
-\setinterfacevariable{PauseMovie}{PauseFilm}
-\setinterfacevariable{PauseRendering}{PauseRendu}
-\setinterfacevariable{PauseSound}{PauseSon}
-\setinterfacevariable{PreviousJump}{SautPrecedent}
-\setinterfacevariable{PreviousPage}{PagePrecedente}
-\setinterfacevariable{PrintDocument}{ImprimerDocument}
-\setinterfacevariable{Query}{Interroger}
-\setinterfacevariable{QueryAgain}{InterrogerSuivant}
-\setinterfacevariable{ResetForm}{RazFormulaire}
-\setinterfacevariable{ResumeMovie}{RepriseFilm}
-\setinterfacevariable{ResumeRendering}{RepriseRendu}
-\setinterfacevariable{ResumeSound}{RepriseSon}
-\setinterfacevariable{Romannumerals}{Chiffresromains}
-\setinterfacevariable{SaveDocument}{EnregistrerDocument}
-\setinterfacevariable{SaveForm}{EnregistrerFormulaire}
-\setinterfacevariable{SaveNamedDocument}{EnregistrerDocumentNomme}
-\setinterfacevariable{SearchAgain}{ChercherSuivant}
-\setinterfacevariable{SearchDocument}{ChercherDocument}
-\setinterfacevariable{ShowBookmarks}{MontrerMarquepages}
-\setinterfacevariable{ShowField}{MontrerChamp}
-\setinterfacevariable{ShowThumbs}{MontrerVignettes}
-\setinterfacevariable{StartMovie}{débutFilm}
-\setinterfacevariable{StartRendering}{débutRendu}
-\setinterfacevariable{StartSound}{débutSon}
-\setinterfacevariable{StopMovie}{FinFilm}
-\setinterfacevariable{StopRendering}{FinRendu}
-\setinterfacevariable{StopSound}{FinSon}
-\setinterfacevariable{SubmitForm}{SoumettreFormulaire}
-\setinterfacevariable{ToggleLayer}{BasculerCalque}
-\setinterfacevariable{ToggleViewer}{BasculerVisualisateur}
-\setinterfacevariable{URL}{URL}
-\setinterfacevariable{VideLayer}{VideCalque}
-\setinterfacevariable{ViewerHelp}{AideVisualisateur}
-\setinterfacevariable{WEEKDAY}{JOURSEMAINE}
-\setinterfacevariable{WORD}{MOT}
-\setinterfacevariable{WORDS}{MOTS}
-\setinterfacevariable{Word}{Mot}
-\setinterfacevariable{Words}{Mots}
-\setinterfacevariable{abbreviation}{abreviation}
-\setinterfacevariable{abbreviations}{abreviations}
-\setinterfacevariable{absolute}{absolu}
-\setinterfacevariable{action}{action}
-\setinterfacevariable{after}{après}
-\setinterfacevariable{all}{tout}
-\setinterfacevariable{alphabetic}{Alphabetique}
-\setinterfacevariable{always}{toujours}
-\setinterfacevariable{anchor}{ancre}
-\setinterfacevariable{and}{et}
-\setinterfacevariable{answerarea}{zonereponse}
-\setinterfacevariable{appendices}{annexes}
-\setinterfacevariable{appendix}{annexe}
-\setinterfacevariable{april}{avril}
-\setinterfacevariable{aside}{apart}
-\setinterfacevariable{atleftmargin}{enmargegauche}
-\setinterfacevariable{atmargin}{enmarge}
-\setinterfacevariable{atpage}{enpage}
-\setinterfacevariable{atrightmargin}{enmargedroite}
-\setinterfacevariable{attachment}{piecejointe}
-\setinterfacevariable{august}{aout}
-\setinterfacevariable{author}{auteur}
-\setinterfacevariable{auto}{auto}
-\setinterfacevariable{autointro}{autointro}
-\setinterfacevariable{autopunctuation}{autoponctuation}
-\setinterfacevariable{back}{retour}
-\setinterfacevariable{background}{arriereplan}
-\setinterfacevariable{backmatter}{pagesdefin}
-\setinterfacevariable{backpart}{postface}
-\setinterfacevariable{backspace}{retourarrière}
-\setinterfacevariable{backward}{enarriere}
-\setinterfacevariable{bbl}{bbl}
-\setinterfacevariable{before}{avant}
-\setinterfacevariable{begin}{commencer}
-\setinterfacevariable{bib}{bib}
-\setinterfacevariable{big}{important}
-\setinterfacevariable{bigbodyfont}{policedecorpsimportante}
-\setinterfacevariable{bigger}{plusimportant}
-\setinterfacevariable{bigpreference}{preferenceimportante}
-\setinterfacevariable{blank}{vierge}
-\setinterfacevariable{block}{bloc}
-\setinterfacevariable{blockquote}{citerbloc}
-\setinterfacevariable{bodymatter}{pagescorpsdetexte}
-\setinterfacevariable{bodypart}{corpsdetexte}
-\setinterfacevariable{bold}{gras}
-\setinterfacevariable{bolditalic}{grasitalique}
-\setinterfacevariable{boldslanted}{grasincline}
-\setinterfacevariable{bookmark}{marquepage}
-\setinterfacevariable{both}{chacun}
-\setinterfacevariable{bothtext}{textechacun}
-\setinterfacevariable{bottom}{bas}
-\setinterfacevariable{box}{boite}
-\setinterfacevariable{brief}{brief}
-\setinterfacevariable{broad}{large}
-\setinterfacevariable{buffer}{tampon}
-\setinterfacevariable{by}{par}
-\setinterfacevariable{calligraphic}{calligraphique}
-\setinterfacevariable{camel}{camel}
-\setinterfacevariable{cap}{cap}
-\setinterfacevariable{capital}{capitales}
-\setinterfacevariable{category}{categorie}
-\setinterfacevariable{cd:character}{caracteres}
-\setinterfacevariable{cd:font}{police}
-\setinterfacevariable{center}{centrer}
-\setinterfacevariable{centerlast}{centrerdernier}
-\setinterfacevariable{chapter}{chapitre}
-\setinterfacevariable{character}{caractere}
-\setinterfacevariable{characters}{caracteres}
-\setinterfacevariable{chemical}{chimique}
-\setinterfacevariable{chemicals}{chimiques}
-\setinterfacevariable{chemistry}{chimie}
-\setinterfacevariable{cite}{cite}
-\setinterfacevariable{closed}{ferme}
-\setinterfacevariable{color}{couleur}
-\setinterfacevariable{column}{colonne}
-\setinterfacevariable{columns}{colonnes}
-\setinterfacevariable{combination}{combinaison}
-\setinterfacevariable{command}{commande}
-\setinterfacevariable{commands}{commandes}
-\setinterfacevariable{comment}{commentaire}
-\setinterfacevariable{component}{composant}
-\setinterfacevariable{compressseparator}{separateurreduction}
-\setinterfacevariable{compressstopper}{stoppeurreduction}
-\setinterfacevariable{concept}{concept}
-\setinterfacevariable{construction}{construction}
-\setinterfacevariable{content}{contenu}
-\setinterfacevariable{contents}{contenus}
-\setinterfacevariable{continue}{continuer}
-\setinterfacevariable{continued}{continue}
-\setinterfacevariable{controls}{controles}
-\setinterfacevariable{conversion}{conversion}
-\setinterfacevariable{current}{courant}
-\setinterfacevariable{cutspace}{espacecoupe}
-\setinterfacevariable{dataset}{jeudedonnees}
-\setinterfacevariable{date}{date}
-\setinterfacevariable{day}{jour}
-\setinterfacevariable{december}{decembre}
-\setinterfacevariable{default}{defaut}
-\setinterfacevariable{depth}{profondeur}
-\setinterfacevariable{description}{description}
-\setinterfacevariable{disable}{desactiver}
-\setinterfacevariable{display}{affichage}
-\setinterfacevariable{dot}{point}
-\setinterfacevariable{doublesided}{rectoverso}
-\setinterfacevariable{down}{enbas}
-\setinterfacevariable{each}{chaque}
-\setinterfacevariable{edge}{bord}
-\setinterfacevariable{effective}{effectif}
-\setinterfacevariable{eight}{huit}
-\setinterfacevariable{embed}{integrer}
-\setinterfacevariable{empty}{vide}
-\setinterfacevariable{enable}{activer}
-\setinterfacevariable{end}{terminer}
-\setinterfacevariable{endnote}{noteseule}
-\setinterfacevariable{enumeration}{énumération}
-\setinterfacevariable{environment}{environnement}
-\setinterfacevariable{even}{paire}
-\setinterfacevariable{export}{exporter}
-\setinterfacevariable{external}{externe}
-\setinterfacevariable{extremestretch}{etirementextreme}
-\setinterfacevariable{fact}{fait}
-\setinterfacevariable{fallback}{repli}
-\setinterfacevariable{february}{fevrier}
-\setinterfacevariable{field}{champ}
-\setinterfacevariable{figure}{figure}
-\setinterfacevariable{figures}{figures}
-\setinterfacevariable{file}{fichier}
-\setinterfacevariable{final}{final}
-\setinterfacevariable{first}{premier}
-\setinterfacevariable{firstcolumn}{premierecolonne}
-\setinterfacevariable{firstpage}{premierepage}
-\setinterfacevariable{firstsubpage}{premieresouspage}
-\setinterfacevariable{fit}{adapter}
-\setinterfacevariable{five}{cinq}
-\setinterfacevariable{fix}{fix}
-\setinterfacevariable{fixed}{fixe}
-\setinterfacevariable{flexible}{flexible}
-\setinterfacevariable{float}{flottant}
-\setinterfacevariable{flushinner}{alignerinterieur}
-\setinterfacevariable{flushleft}{alignergauche}
-\setinterfacevariable{flushouter}{alignerexterieur}
-\setinterfacevariable{flushright}{alignerdroite}
-\setinterfacevariable{followingpage}{pagesuccesseur}
-\setinterfacevariable{font}{font}
-\setinterfacevariable{footer}{pdp}
-\setinterfacevariable{footnote}{notebdp}
-\setinterfacevariable{force}{forcer}
-\setinterfacevariable{foreground}{premierplan}
-\setinterfacevariable{formula}{formule}
-\setinterfacevariable{formulas}{formules}
-\setinterfacevariable{forward}{enavant}
-\setinterfacevariable{four}{quatre}
-\setinterfacevariable{fractions}{fractions}
-\setinterfacevariable{frame}{cadre}
-\setinterfacevariable{framedtext}{texteencadre}
-\setinterfacevariable{friday}{vendredi}
-\setinterfacevariable{frontmatter}{pagesliminaires}
-\setinterfacevariable{frontpart}{preface}
-\setinterfacevariable{fullhz}{hzcomplet}
-\setinterfacevariable{global}{global}
-\setinterfacevariable{graphic}{graphique}
-\setinterfacevariable{graphics}{graphiques}
-\setinterfacevariable{gray}{gris}
-\setinterfacevariable{greek}{grec}
-\setinterfacevariable{grid}{grille}
-\setinterfacevariable{halfline}{demiligne}
-\setinterfacevariable{handwritten}{manuscript}
-\setinterfacevariable{hang}{suspendre}
-\setinterfacevariable{hanging}{suspension}
-\setinterfacevariable{hangingboth}{suspensionchacun}
-\setinterfacevariable{head}{tete}
-\setinterfacevariable{header}{entête}
-\setinterfacevariable{headintext}{tetedanstexte}
-\setinterfacevariable{height}{hauteur}
-\setinterfacevariable{helptext}{texteaide}
-\setinterfacevariable{hencefore}{precedemment}
-\setinterfacevariable{here}{ici}
-\setinterfacevariable{hereafter}{ciapres}
-\setinterfacevariable{hidden}{cache}
-\setinterfacevariable{hiddenbar}{barrecachee}
-\setinterfacevariable{hiding}{encachant}
-\setinterfacevariable{high}{exp}
-\setinterfacevariable{horizontal}{horizontal}
-\setinterfacevariable{hyphenated}{aveccesure}
-\setinterfacevariable{hz}{hz}
-\setinterfacevariable{inbetween}{entre}
-\setinterfacevariable{index}{index}
-\setinterfacevariable{indices}{indices}
-\setinterfacevariable{inherit}{heriter}
-\setinterfacevariable{ininner}{dansinterieur}
-\setinterfacevariable{ininneredge}{dansbordinterieur}
-\setinterfacevariable{ininnermargin}{dansmargeinterieure}
-\setinterfacevariable{inleft}{dansgauche}
-\setinterfacevariable{inleftedge}{dansbordgauche}
-\setinterfacevariable{inleftmargin}{dansmargegauche}
-\setinterfacevariable{inline}{enligne}
-\setinterfacevariable{inmargin}{dansmarge}
-\setinterfacevariable{inner}{interieur}
-\setinterfacevariable{inneredge}{bordinterieur}
-\setinterfacevariable{innermargin}{margeinterieure}
-\setinterfacevariable{inother}{dansautre}
-\setinterfacevariable{inouter}{dansexterieur}
-\setinterfacevariable{inouteredge}{dansbordexterieur}
-\setinterfacevariable{inoutermargin}{dansmargeexterieure}
-\setinterfacevariable{inright}{dansdroite}
-\setinterfacevariable{inrightedge}{dansborddroit}
-\setinterfacevariable{inrightmargin}{dansmargedroite}
-\setinterfacevariable{integral}{integrale}
-\setinterfacevariable{interaction}{interaction}
-\setinterfacevariable{interactionmenu}{menuinteraction}
-\setinterfacevariable{interactive}{interactif}
-\setinterfacevariable{intermezzi}{interludes}
-\setinterfacevariable{intermezzo}{interlude}
-\setinterfacevariable{intext}{danstexte}
-\setinterfacevariable{intro}{intro}
-\setinterfacevariable{invertedshort}{invertedshort}
-\setinterfacevariable{italic}{italique}
-\setinterfacevariable{italicbold}{italiquegras}
-\setinterfacevariable{item}{élément}
-\setinterfacevariable{itemize}{détailler}
-\setinterfacevariable{its}{els}
-\setinterfacevariable{january}{janvier}
-\setinterfacevariable{joinedup}{sansespaceentre}
-\setinterfacevariable{july}{juillet}
-\setinterfacevariable{june}{juin}
-\setinterfacevariable{keep}{conserver}
-\setinterfacevariable{kerncharacters}{approchercaracteres}
-\setinterfacevariable{knockout}{knockout}
-\setinterfacevariable{label}{etiquette}
-\setinterfacevariable{landscape}{paysage}
-\setinterfacevariable{last}{dernier}
-\setinterfacevariable{lastcolumn}{dernierecolonne}
-\setinterfacevariable{lastpage}{dernierepage}
-\setinterfacevariable{lastpagenumber}{numerodenierepage}
-\setinterfacevariable{lastsubpage}{dernieresouspage}
-\setinterfacevariable{layer}{calque}
-\setinterfacevariable{left}{gauche}
-\setinterfacevariable{leftedge}{bordgauche}
-\setinterfacevariable{lefthanging}{suspensiongauche}
-\setinterfacevariable{leftmargin}{margegauche}
-\setinterfacevariable{leftpage}{surpagegauche}
-\setinterfacevariable{lefttoright}{gaucheadroite}
-\setinterfacevariable{legend}{legende}
-\setinterfacevariable{less}{moins}
-\setinterfacevariable{lesshyphenation}{moinsdecesure}
-\setinterfacevariable{letterspacing}{espacementlettre}
-\setinterfacevariable{line}{ligne}
-\setinterfacevariable{linenote}{noteligne}
-\setinterfacevariable{lines}{lignes}
-\setinterfacevariable{linked}{lie}
-\setinterfacevariable{list}{liste}
-\setinterfacevariable{local}{local}
-\setinterfacevariable{localenvironment}{environnementlocal}
-\setinterfacevariable{logo}{logo}
-\setinterfacevariable{logos}{logos}
-\setinterfacevariable{lohi}{inex}
-\setinterfacevariable{long}{long}
-\setinterfacevariable{loose}{envrac}
-\setinterfacevariable{low}{ind}
-\setinterfacevariable{ls}{ls}
-\setinterfacevariable{makeup}{composition}
-\setinterfacevariable{mar}{rem}
-\setinterfacevariable{march}{mars}
-\setinterfacevariable{margin}{marge}
-\setinterfacevariable{marginedge}{margebord}
-\setinterfacevariable{margintext}{textemarge}
-\setinterfacevariable{margintitle}{titremarge}
-\setinterfacevariable{marking}{marquage}
-\setinterfacevariable{math}{math}
-\setinterfacevariable{mathalignment}{alignementmath}
-\setinterfacevariable{mathcases}{casmath}
-\setinterfacevariable{mathematics}{mathematics}
-\setinterfacevariable{mathmatrix}{matricemath}
-\setinterfacevariable{max}{max}
-\setinterfacevariable{maxdepth}{profondeurmax}
-\setinterfacevariable{maxheight}{hauteurmax}
-\setinterfacevariable{maxwidth}{largeurmax}
-\setinterfacevariable{may}{mai}
-\setinterfacevariable{mediaeval}{medieval}
-\setinterfacevariable{medium}{moyen}
-\setinterfacevariable{middle}{milieu}
-\setinterfacevariable{min}{min}
-\setinterfacevariable{mindepth}{profondeurmin}
-\setinterfacevariable{minheight}{hauteurmin}
-\setinterfacevariable{minwidth}{largeurmin}
-\setinterfacevariable{mirrored}{reflete}
-\setinterfacevariable{mixed}{mixte}
-\setinterfacevariable{monday}{lundi}
-\setinterfacevariable{mono}{mono}
-\setinterfacevariable{monobold}{monogras}
-\setinterfacevariable{mononormal}{normalmono}
-\setinterfacevariable{month}{mois}
-\setinterfacevariable{more}{plus}
-\setinterfacevariable{morehyphenation}{plusdecesure}
-\setinterfacevariable{name}{nom}
-\setinterfacevariable{narrow}{etroit}
-\setinterfacevariable{negative}{negatif}
-\setinterfacevariable{never}{jamais}
-\setinterfacevariable{new}{nouveau}
-\setinterfacevariable{next}{suivant}
-\setinterfacevariable{nextevenpage}{pagepairesuivante}
-\setinterfacevariable{nextoddpage}{pageimpairesuivante}
-\setinterfacevariable{nextpage}{pagesuivante}
-\setinterfacevariable{nextsubpage}{souspagesuivante}
-\setinterfacevariable{nine}{neuf}
-\setinterfacevariable{no}{non}
-\setinterfacevariable{nocheck}{sansverifier}
-\setinterfacevariable{nodepth}{sansprodondeur}
-\setinterfacevariable{nofit}{sansadapter}
-\setinterfacevariable{nogrid}{sansgrille}
-\setinterfacevariable{noheight}{sanshauteur}
-\setinterfacevariable{nohz}{sanshz}
-\setinterfacevariable{noline}{sansligne}
-\setinterfacevariable{nomarking}{sansmarquage}
-\setinterfacevariable{nomenubar}{sansbarremenu}
-\setinterfacevariable{none}{aucun}
-\setinterfacevariable{nonumber}{sansnumero}
-\setinterfacevariable{norepeat}{sansrepetition}
-\setinterfacevariable{normal}{normal}
-\setinterfacevariable{normalshort}{normalshort}
-\setinterfacevariable{nospacing}{sansespacement}
-\setinterfacevariable{nostopper}{sansstoppeur}
-\setinterfacevariable{not}{pas}
-\setinterfacevariable{notation}{notation}
-\setinterfacevariable{note}{note}
-\setinterfacevariable{nothanging}{sanssuspension}
-\setinterfacevariable{nothyphenated}{sanscesure}
-\setinterfacevariable{notjoinedup}{passansespaceentre}
-\setinterfacevariable{november}{novembre}
-\setinterfacevariable{nowhere}{nullepart}
-\setinterfacevariable{nowhite}{sansblanc}
-\setinterfacevariable{number}{numero}
-\setinterfacevariable{numbers}{numeros}
-\setinterfacevariable{october}{octobre}
-\setinterfacevariable{odd}{impair}
-\setinterfacevariable{off}{arret}
-\setinterfacevariable{offset}{decalage}
-\setinterfacevariable{old}{ancien}
-\setinterfacevariable{oldstyle}{styleancien}
-\setinterfacevariable{on}{marche}
-\setinterfacevariable{one}{un}
-\setinterfacevariable{opposite}{enface}
-\setinterfacevariable{ordinal}{ordinal}
-\setinterfacevariable{outer}{exterieur}
-\setinterfacevariable{outeredge}{bordexterieur}
-\setinterfacevariable{outermargin}{margeexterieure}
-\setinterfacevariable{overbar}{surligner}
-\setinterfacevariable{overbars}{surlignermots}
-\setinterfacevariable{overlay}{superposition}
-\setinterfacevariable{overprint}{surimpression}
-\setinterfacevariable{overstrike}{barrer}
-\setinterfacevariable{overstrikes}{barrermots}
-\setinterfacevariable{packed}{sansespaceentreitem}
-\setinterfacevariable{page}{page}
-\setinterfacevariable{pagecomment}{commentairepage}
-\setinterfacevariable{pagenumber}{numeropage}
-\setinterfacevariable{paper}{papier}
-\setinterfacevariable{paragraph}{paragraphe}
-\setinterfacevariable{part}{partie}
-\setinterfacevariable{positive}{positif}
-\setinterfacevariable{postponing}{report}
-\setinterfacevariable{postscript}{postscript}
-\setinterfacevariable{precedingpage}{pageantecedent}
-\setinterfacevariable{preference}{preference}
-\setinterfacevariable{preview}{apercu}
-\setinterfacevariable{previous}{precedent}
-\setinterfacevariable{previousevenpage}{pagepaireprecedente}
-\setinterfacevariable{previousoddpage}{pageimpaireprecedente}
-\setinterfacevariable{previouspage}{pageprecedente}
-\setinterfacevariable{previoussubpage}{souspageprecedente}
-\setinterfacevariable{print}{imprimer}
-\setinterfacevariable{printable}{imprimable}
-\setinterfacevariable{process}{traiter}
-\setinterfacevariable{product}{produit}
-\setinterfacevariable{program}{programme}
-\setinterfacevariable{project}{projet}
-\setinterfacevariable{protected}{protege}
-\setinterfacevariable{quadruple}{quadruple}
-\setinterfacevariable{quarterline}{quartdeligne}
-\setinterfacevariable{quotation}{citation}
-\setinterfacevariable{quote}{citer}
-\setinterfacevariable{ran}{gam}
-\setinterfacevariable{random}{aleatoire}
-\setinterfacevariable{readonly}{lectureseule}
-\setinterfacevariable{rectangular}{rectangulaire}
-\setinterfacevariable{reference}{reference}
-\setinterfacevariable{referral}{redirection}
-\setinterfacevariable{region}{region}
-\setinterfacevariable{register}{registre}
-\setinterfacevariable{regular}{ordinaire}
-\setinterfacevariable{relative}{relatif}
-\setinterfacevariable{repeat}{repeter}
-\setinterfacevariable{required}{requis}
-\setinterfacevariable{reset}{raz}
-\setinterfacevariable{reverse}{inverser}
-\setinterfacevariable{right}{droite}
-\setinterfacevariable{rightedge}{borddroit}
-\setinterfacevariable{righthanging}{suspensiondroite}
-\setinterfacevariable{rightmargin}{margedroite}
-\setinterfacevariable{rightpage}{surpagedroite}
-\setinterfacevariable{righttoleft}{droiteagauche}
-\setinterfacevariable{roman}{romain}
-\setinterfacevariable{romannumerals}{chiffresromains}
-\setinterfacevariable{rotate}{tourner}
-\setinterfacevariable{rotated}{tourne}
-\setinterfacevariable{round}{rond}
-\setinterfacevariable{row}{rang}
-\setinterfacevariable{rule}{trait}
-\setinterfacevariable{samepage}{memepage}
-\setinterfacevariable{sans}{sans}
-\setinterfacevariable{sansbold}{sansserifbold}
-\setinterfacevariable{sansnormal}{normalsans}
-\setinterfacevariable{sansserif}{sansserif}
-\setinterfacevariable{saturday}{samedi}
-\setinterfacevariable{screen}{ecran}
-\setinterfacevariable{section}{section}
-\setinterfacevariable{sectionblockenvironment}{environnementblocsection}
-\setinterfacevariable{sectionnumber}{numerosection}
-\setinterfacevariable{see}{voir}
-\setinterfacevariable{selectfont}{selectionnerpolice}
-\setinterfacevariable{separator}{separateur}
-\setinterfacevariable{september}{septembre}
-\setinterfacevariable{serif}{serif}
-\setinterfacevariable{serifbold}{serifgras}
-\setinterfacevariable{serifnormal}{serifnormal}
-\setinterfacevariable{serried}{serre}
-\setinterfacevariable{setups}{setups}
-\setinterfacevariable{seven}{sept}
-\setinterfacevariable{sheet}{feuille}
-\setinterfacevariable{shiftdown}{decalerenbas}
-\setinterfacevariable{shiftup}{decalerenhaut}
-\setinterfacevariable{short}{court}
-\setinterfacevariable{simplefonts}{policessimple}
-\setinterfacevariable{simplelist}{listesimple}
-\setinterfacevariable{singlesided}{recto}
-\setinterfacevariable{six}{six}
-\setinterfacevariable{slanted}{incline}
-\setinterfacevariable{slantedbold}{inclinegras}
-\setinterfacevariable{small}{petit}
-\setinterfacevariable{smallbodyfont}{policedecorpspetite}
-\setinterfacevariable{smallbold}{petitgras}
-\setinterfacevariable{smallbolditalic}{petitgrasitalique}
-\setinterfacevariable{smallboldslanted}{petitgrasincline}
-\setinterfacevariable{smallcaps}{petitescaps}
-\setinterfacevariable{smaller}{pluspetit}
-\setinterfacevariable{smallitalic}{petititalique}
-\setinterfacevariable{smallitalicbold}{petititaliquegras}
-\setinterfacevariable{smallnormal}{petitnormal}
-\setinterfacevariable{smallslanted}{petitincline}
-\setinterfacevariable{smallslantedbold}{petitinclinegras}
-\setinterfacevariable{smalltype}{petitcaractere}
-\setinterfacevariable{somewhere}{qqpart}
-\setinterfacevariable{sorted}{trie}
-\setinterfacevariable{sorting}{tri}
-\setinterfacevariable{space}{espace}
-\setinterfacevariable{spacing}{espacement}
-\setinterfacevariable{speech}{discours}
-\setinterfacevariable{split}{partager}
-\setinterfacevariable{spot}{tondirect}
-\setinterfacevariable{standard}{standard}
-\setinterfacevariable{start}{activé}
-\setinterfacevariable{starter}{demarreur}
-\setinterfacevariable{sticker}{autocollant}
-\setinterfacevariable{stop}{fin}
-\setinterfacevariable{stopper}{stoppeur}
-\setinterfacevariable{stretch}{etirer}
-\setinterfacevariable{stretched}{etire}
-\setinterfacevariable{strict}{strict}
-\setinterfacevariable{strong}{fort}
-\setinterfacevariable{strut}{entretoise}
-\setinterfacevariable{sub}{sous}
-\setinterfacevariable{subbackward}{petitenarriere}
-\setinterfacevariable{subformula}{sousformule}
-\setinterfacevariable{subforward}{petitenavant}
-\setinterfacevariable{subject}{sujet}
-\setinterfacevariable{subpage}{souspage}
-\setinterfacevariable{subs}{subs}
-\setinterfacevariable{subsection}{soussection}
-\setinterfacevariable{subsubject}{soussujet}
-\setinterfacevariable{subsubsection}{soussoussection}
-\setinterfacevariable{subsubsubject}{soussoussujet}
-\setinterfacevariable{subsubsubsection}{soussoussoussection}
-\setinterfacevariable{subsubsubsubject}{soussoussoussujet}
-\setinterfacevariable{subsubsubsubsection}{soussoussoussoussection}
-\setinterfacevariable{subsubsubsubsubject}{soussoussoussoussujet}
-\setinterfacevariable{subsubsubsubsubsection}{soussoussoussoussoussection}
-\setinterfacevariable{subsubsubsubsubsubject}{soussoussoussoussoussujet}
-\setinterfacevariable{subsubsubsubsubsubsection}{soussoussoussoussoussoussection}
-\setinterfacevariable{subsubsubsubsubsubsubject}{soussoussoussoussoussoussujet}
-\setinterfacevariable{subsubsubsubsubsubsubsection}{soussoussoussoussoussoussoussection}
-\setinterfacevariable{subsubsubsubsubsubsubsubject}{soussoussoussoussoussoussoussujet}
-\setinterfacevariable{subsubsubsubsubsubsubsubsection}{soussoussoussoussoussoussoussoussection}
-\setinterfacevariable{subsubsubsubsubsubsubsubsubject}{soussoussoussoussoussoussoussoussujet}
-\setinterfacevariable{subsubsubsubsubsubsubsubsubsection}{soussoussoussoussoussoussoussoussoussection}
-\setinterfacevariable{subsubsubsubsubsubsubsubsubsubject}{soussoussoussoussoussoussoussoussoussujet}
-\setinterfacevariable{sunday}{dimanche}
-\setinterfacevariable{support}{support}
-\setinterfacevariable{sym}{sym}
-\setinterfacevariable{symbol}{symbole}
-\setinterfacevariable{synchronize}{synchroniser}
-\setinterfacevariable{synonym}{synonyme}
-\setinterfacevariable{system}{systeme}
-\setinterfacevariable{table}{table}
-\setinterfacevariable{tablehead}{tetetableau}
-\setinterfacevariable{tables}{tables}
-\setinterfacevariable{tabletail}{queuetable}
-\setinterfacevariable{tabulate}{tabulation}
-\setinterfacevariable{tabulatehead}{tetetabulation}
-\setinterfacevariable{tabulatetail}{queuetabulation}
-\setinterfacevariable{tall}{grand}
-\setinterfacevariable{teletype}{caractereterminal}
-\setinterfacevariable{temporary}{temporaire}
-\setinterfacevariable{test}{test}
-\setinterfacevariable{text}{texte}
-\setinterfacevariable{textnote}{notetexte}
-\setinterfacevariable{three}{trois}
-\setinterfacevariable{thursday}{jeudi}
-\setinterfacevariable{tight}{resserre}
-\setinterfacevariable{title}{titre}
-\setinterfacevariable{toggle}{basculer}
-\setinterfacevariable{tolerant}{tolerant}
-\setinterfacevariable{top}{haut}
-\setinterfacevariable{tuesday}{mardi}
-\setinterfacevariable{two}{deux}
-\setinterfacevariable{txt}{txt}
-\setinterfacevariable{type}{transcrire}
-\setinterfacevariable{typing}{transcription}
-\setinterfacevariable{unavailable}{indisponible}
-\setinterfacevariable{underbar}{souligner}
-\setinterfacevariable{underbars}{soulignermots}
-\setinterfacevariable{understrike}{soubarrer}
-\setinterfacevariable{understrikes}{soubarrermots}
-\setinterfacevariable{unframed}{desencadre}
-\setinterfacevariable{unicode}{unicode}
-\setinterfacevariable{unit}{unite}
-\setinterfacevariable{units}{unites}
-\setinterfacevariable{unknown}{inconnu}
-\setinterfacevariable{unpacked}{avecespaceentreitem}
-\setinterfacevariable{up}{enhaut}
-\setinterfacevariable{url}{url}
-\setinterfacevariable{used}{utilise}
-\setinterfacevariable{value}{valeur}
-\setinterfacevariable{vertical}{vertical}
-\setinterfacevariable{very}{tres}
-\setinterfacevariable{verystrict}{tresstrict}
-\setinterfacevariable{verytolerant}{trestolerant}
-\setinterfacevariable{vfenced}{cloturev}
-\setinterfacevariable{vulgarfraction}{vulgarfraction}
-\setinterfacevariable{weak}{faible}
-\setinterfacevariable{wednesday}{mercredi}
-\setinterfacevariable{week}{semaine}
-\setinterfacevariable{weekday}{joursemaine}
-\setinterfacevariable{white}{blanc}
-\setinterfacevariable{wide}{ample}
-\setinterfacevariable{width}{largeur}
-\setinterfacevariable{word}{mot}
-\setinterfacevariable{words}{mots}
-\setinterfacevariable{xml}{xml}
-\setinterfacevariable{year}{annee}
-\setinterfacevariable{yes}{oui}
-% definitions for interface constants for language fr
-%
-\setinterfaceconstant{action}{action}
-\setinterfaceconstant{address}{adresse}
-\setinterfaceconstant{after}{après}
-\setinterfaceconstant{afterhead}{aprèstête}
-\setinterfaceconstant{afterkey}{aprèsclé}
-\setinterfaceconstant{aftersection}{aprèssection}
-\setinterfaceconstant{align}{aligner}
-\setinterfaceconstant{alignbottom}{alignerbas}
-\setinterfaceconstant{aligncharacter}{alignersurcaractere}
-\setinterfaceconstant{alignmentcharacter}{caracterealignement}
-\setinterfaceconstant{alignmentleftsample}{echantillongauchealignement}
-\setinterfaceconstant{alignmentleftwidth}{largeurgauchealignement}
-\setinterfaceconstant{alignmentrightsample}{echantillondroitealignement}
-\setinterfaceconstant{alignmentrightwidth}{largeurdroitealignement}
-\setinterfaceconstant{alignsymbol}{alignersursymbol}
-\setinterfaceconstant{aligntitle}{alignersurtitre}
-\setinterfaceconstant{alternative}{variante}
-\setinterfaceconstant{anchor}{ancre}
-\setinterfaceconstant{anchoring}{ancrage}
-\setinterfaceconstant{andtext}{ettexte}
-\setinterfaceconstant{apa}{apa}
-\setinterfaceconstant{arguments}{arguments}
-\setinterfaceconstant{arrow}{fleche}
-\setinterfaceconstant{artauthor}{artauteur}
-\setinterfaceconstant{artauthoretaldisplay}{artauteuretalaffichage}
-\setinterfaceconstant{artauthoretallimit}{artauteuretallimite}
-\setinterfaceconstant{artauthoretaltext}{artauteuretaltexte}
-\setinterfaceconstant{artoffset}{artdecalage}
-\setinterfaceconstant{at}{en}
-\setinterfaceconstant{author}{auteur}
-\setinterfaceconstant{authorconversion}{auteurconversion}
-\setinterfaceconstant{authoretaldisplay}{auteuretalaffichage}
-\setinterfaceconstant{authoretallimit}{auteuretallimite}
-\setinterfaceconstant{authoretaltext}{auteuretaltexte}
-\setinterfaceconstant{auto}{auto}
-\setinterfaceconstant{autocase}{autocase}
-\setinterfaceconstant{autofile}{autofichier}
-\setinterfaceconstant{autofocus}{autofocus}
-\setinterfaceconstant{autohang}{autosuspendre}
-\setinterfaceconstant{autostrut}{autoentretoise}
-\setinterfaceconstant{autowidth}{autolargeur}
-\setinterfaceconstant{availableheight}{hauteurdisponible}
-\setinterfaceconstant{availablewidth}{largeurdisponible}
-\setinterfaceconstant{axis}{axe}
-\setinterfaceconstant{background}{arriereplan}
-\setinterfaceconstant{backgroundcolor}{couleurarriereplan}
-\setinterfaceconstant{backgroundcorner}{coinarriereplan}
-\setinterfaceconstant{backgrounddepth}{profondeurarriereplan}
-\setinterfaceconstant{backgroundoffset}{decalagearriereplan}
-\setinterfaceconstant{backgroundradius}{rayonarriereplan}
-\setinterfaceconstant{backgroundscreen}{ecranarriereplan}
-\setinterfaceconstant{backreference}{retroreference}
-\setinterfaceconstant{backspace}{espacearrière}
-\setinterfaceconstant{balance}{equilibrer}
-\setinterfaceconstant{before}{avant}
-\setinterfaceconstant{beforehead}{avanttete}
-\setinterfaceconstant{beforesection}{avantsection}
-\setinterfaceconstant{bet}{suj}
-\setinterfaceconstant{bidi}{bidi}
-\setinterfaceconstant{big}{important}
-\setinterfaceconstant{blank}{vierge}
-\setinterfaceconstant{bleedoffset}{decalagefuite}
-\setinterfaceconstant{blockway}{faconbloc}
-\setinterfaceconstant{bodyfont}{policedecorps}
-\setinterfaceconstant{boffset}{decalageb}
-\setinterfaceconstant{boldfeatures}{fonctionnalitesgras}
-\setinterfaceconstant{boldfont}{policegras}
-\setinterfaceconstant{bolditalicfeatures}{fonctionnalitesgrasitalique}
-\setinterfaceconstant{bolditalicfont}{policegrasitalique}
-\setinterfaceconstant{boldslantedfeatures}{fonctionnalitesgrasincline}
-\setinterfaceconstant{boldslantedfont}{policegrasincline}
-\setinterfaceconstant{bookmark}{marquepage}
-\setinterfaceconstant{bottom}{bas}
-\setinterfaceconstant{bottomafter}{basaprès}
-\setinterfaceconstant{bottombefore}{basavant}
-\setinterfaceconstant{bottomcommand}{commandebas}
-\setinterfaceconstant{bottomdistance}{distancebas}
-\setinterfaceconstant{bottomframe}{cadrebas}
-\setinterfaceconstant{bottomoffset}{decalagebas}
-\setinterfaceconstant{bottomspace}{espacebas}
-\setinterfaceconstant{bottomstate}{etatbas}
-\setinterfaceconstant{break}{saut}
-\setinterfaceconstant{buffer}{tampon}
-\setinterfaceconstant{cache}{memoirecache}
-\setinterfaceconstant{calculate}{calculer}
-\setinterfaceconstant{category}{categorie}
-\setinterfaceconstant{ccommand}{commandec}
-\setinterfaceconstant{character}{caractere}
-\setinterfaceconstant{characters}{caracteres}
-\setinterfaceconstant{check}{verifier}
-\setinterfaceconstant{click}{clic}
-\setinterfaceconstant{clickin}{clicinterieur}
-\setinterfaceconstant{clickout}{clicexterieur}
-\setinterfaceconstant{clipoffset}{decalagedecoupe}
-\setinterfaceconstant{closeaction}{fermeraction}
-\setinterfaceconstant{closecommand}{fermercommande}
-\setinterfaceconstant{closepage}{fermerpage}
-\setinterfaceconstant{closepageaction}{fermeractionpage}
-\setinterfaceconstant{closesymbol}{fermersymbol}
-\setinterfaceconstant{color}{couleur}
-\setinterfaceconstant{column}{colonne}
-\setinterfaceconstant{columndistance}{distancecolonne}
-\setinterfaceconstant{columns}{colonnes}
-\setinterfaceconstant{comma}{virgule}
-\setinterfaceconstant{command}{commande}
-\setinterfaceconstant{commandafter}{commandeaprès}
-\setinterfaceconstant{commandbefore}{commandeavant}
-\setinterfaceconstant{commands}{commandes}
-\setinterfaceconstant{comment}{commentaire}
-\setinterfaceconstant{commentchar}{caracommentaire}
-\setinterfaceconstant{commentoffset}{decalagecommentaire}
-\setinterfaceconstant{compact}{compact}
-\setinterfaceconstant{component}{composant}
-\setinterfaceconstant{compoundhyphen}{traitdunioncompose}
-\setinterfaceconstant{compress}{reduire}
-\setinterfaceconstant{compressdistance}{distancereduction}
-\setinterfaceconstant{compressmethod}{methodereduction}
-\setinterfaceconstant{compressseparator}{separateurreduction}
-\setinterfaceconstant{compressstopper}{stoppeurreduction}
-\setinterfaceconstant{concerns}{concerne}
-\setinterfaceconstant{connector}{connecteur}
-\setinterfaceconstant{continue}{continuer}
-\setinterfaceconstant{contrastcolor}{couleurconstrast}
-\setinterfaceconstant{controls}{controles}
-\setinterfaceconstant{conversion}{conversion}
-\setinterfaceconstant{convertfile}{convertirfichier}
-\setinterfaceconstant{copies}{copies}
-\setinterfaceconstant{corner}{coin}
-\setinterfaceconstant{coupling}{couplage}
-\setinterfaceconstant{couplingway}{faconcouplage}
-\setinterfaceconstant{criterium}{critere}
-\setinterfaceconstant{cropoffset}{decalagerecadre}
-\setinterfaceconstant{crossreference}{renvoi}
-\setinterfaceconstant{cssfile}{fichiercss}
-\setinterfaceconstant{current}{courant}
-\setinterfaceconstant{cutspace}{espacecoupe}
-\setinterfaceconstant{dash}{pointille}
-\setinterfaceconstant{dat}{dat}
-\setinterfaceconstant{database}{basededonnees}
-\setinterfaceconstant{dataset}{jeudedonnees}
-\setinterfaceconstant{date}{date}
-\setinterfaceconstant{deepnumbercommand}{commandeprofondenumero}
-\setinterfaceconstant{deeptextcommand}{commandeprofondetexte}
-\setinterfaceconstant{default}{defaut}
-\setinterfaceconstant{defaultheight}{defaultheight}
-\setinterfaceconstant{defaultwidth}{defaultwidth}
-\setinterfaceconstant{define}{define}
-\setinterfaceconstant{delay}{retard}
-\setinterfaceconstant{depth}{profondeur}
-\setinterfaceconstant{depthcorrection}{correctionprofondeur}
-\setinterfaceconstant{direction}{direction}
-\setinterfaceconstant{directory}{repertoire}
-\setinterfaceconstant{display}{affichage}
-\setinterfaceconstant{displaythreshold}{seuilaffichage}
-\setinterfaceconstant{distance}{distance}
-\setinterfaceconstant{domain}{domaine}
-\setinterfaceconstant{dot}{point}
-\setinterfaceconstant{doublesided}{rectoverso}
-\setinterfaceconstant{down}{enbas}
-\setinterfaceconstant{dummy}{factice}
-\setinterfaceconstant{dx}{dx}
-\setinterfaceconstant{dy}{dy}
-\setinterfaceconstant{edge}{bord}
-\setinterfaceconstant{edgedistance}{distancebord}
-\setinterfaceconstant{editor}{editeur}
-\setinterfaceconstant{editoretaldisplay}{editeurealaffichage}
-\setinterfaceconstant{editoretallimit}{editeureallimite}
-\setinterfaceconstant{editoretaltext}{editeurealtexte}
-\setinterfaceconstant{empty}{vide}
-\setinterfaceconstant{entities}{entitees}
-\setinterfaceconstant{entries}{entrees}
-\setinterfaceconstant{equalheight}{hauteuregale}
-\setinterfaceconstant{equalwidth}{margeuregale}
-\setinterfaceconstant{escape}{echappatoire}
-\setinterfaceconstant{etaldisplay}{etalaffichage}
-\setinterfaceconstant{etallimit}{etallimite}
-\setinterfaceconstant{etaloption}{etaloption}
-\setinterfaceconstant{etaltext}{etalttexte}
-\setinterfaceconstant{evenmargin}{margepaire}
-\setinterfaceconstant{exact}{exact}
-\setinterfaceconstant{exitoffset}{decalagesortie}
-\setinterfaceconstant{expansion}{expansion}
-\setinterfaceconstant{export}{exporter}
-\setinterfaceconstant{extras}{extras}
-\setinterfaceconstant{factor}{facteur}
-\setinterfaceconstant{fallback}{repli}
-\setinterfaceconstant{fallbacks}{replis}
-\setinterfaceconstant{family}{famille}
-\setinterfaceconstant{features}{fonctionnalites}
-\setinterfaceconstant{featureset}{jeufonctionnalite}
-\setinterfaceconstant{fences}{barrieres}
-\setinterfaceconstant{field}{champ}
-\setinterfaceconstant{fieldbackgroundcolor}{couleurarrierreplanchamp}
-\setinterfaceconstant{fieldframecolor}{couleurcadrechamp}
-\setinterfaceconstant{fieldlayer}{calquechamp}
-\setinterfaceconstant{fieldoffset}{decalagechamp}
-\setinterfaceconstant{file}{fichier}
-\setinterfaceconstant{filler}{remplisseur}
-\setinterfaceconstant{filter}{filtre}
-\setinterfaceconstant{filtercommand}{commandefiltre}
-\setinterfaceconstant{finalnamesep}{sepnomfinal}
-\setinterfaceconstant{finalpagesep}{seppagefinale}
-\setinterfaceconstant{finalpubsep}{seppubfinale}
-\setinterfaceconstant{first}{premier}
-\setinterfaceconstant{firstnamesep}{seppremiernom}
-\setinterfaceconstant{firstpage}{premierepage}
-\setinterfaceconstant{focus}{focus}
-\setinterfaceconstant{focusin}{focusin}
-\setinterfaceconstant{focusoffset}{decalagefocus}
-\setinterfaceconstant{focusout}{focusout}
-\setinterfaceconstant{font}{font}
-\setinterfaceconstant{footer}{pdp}
-\setinterfaceconstant{footerdistance}{distancepdp}
-\setinterfaceconstant{footerstate}{etatpdp}
-\setinterfaceconstant{force}{forcer}
-\setinterfaceconstant{foregroundcolor}{couleurpremierplan}
-\setinterfaceconstant{foregroundstyle}{stylepremierplan}
-\setinterfaceconstant{format}{formatter}
-\setinterfaceconstant{fractions}{fractions}
-\setinterfaceconstant{frame}{cadre}
-\setinterfaceconstant{framecolor}{couleurcadre}
-\setinterfaceconstant{framecorner}{coincadre}
-\setinterfaceconstant{framedepth}{profondeurcadre}
-\setinterfaceconstant{frameoffset}{decalagecadre}
-\setinterfaceconstant{frameradius}{rayoncadre}
-\setinterfaceconstant{frames}{cadres}
-\setinterfaceconstant{freeregion}{regionlibre}
-\setinterfaceconstant{from}{de}
-\setinterfaceconstant{functioncolor}{couleurfonction}
-\setinterfaceconstant{functionstyle}{stylefonction}
-\setinterfaceconstant{get}{obtenir}
-\setinterfaceconstant{global}{global}
-\setinterfaceconstant{goodies}{friandises}
-\setinterfaceconstant{grid}{grille}
-\setinterfaceconstant{group}{groupe}
-\setinterfaceconstant{groupsuffix}{suffixegroupe}
-\setinterfaceconstant{hang}{suspendre}
-\setinterfaceconstant{hcompact}{compacth}
-\setinterfaceconstant{headalign}{alignertete}
-\setinterfaceconstant{headcolor}{couleurtete}
-\setinterfaceconstant{headcommand}{commandetete}
-\setinterfaceconstant{headconversion}{conversiontete}
-\setinterfaceconstant{header}{entête}
-\setinterfaceconstant{headerdistance}{distanceentête}
-\setinterfaceconstant{headerstate}{etatentête}
-\setinterfaceconstant{headlabel}{etiquettetete}
-\setinterfaceconstant{headnumber}{numerotete}
-\setinterfaceconstant{headseparator}{separateurtete}
-\setinterfaceconstant{headstyle}{styletete}
-\setinterfaceconstant{height}{hauteur}
-\setinterfaceconstant{hfactor}{facteurh}
-\setinterfaceconstant{hfil}{remplissageh}
-\setinterfaceconstant{hidenumber}{cachernumero}
-\setinterfaceconstant{hoffset}{decalageh}
-\setinterfaceconstant{horizontal}{horizontal}
-\setinterfaceconstant{horoffset}{decalagehor}
-\setinterfaceconstant{hyphen}{traitdunion}
-\setinterfaceconstant{hyphens}{traitsdunion}
-\setinterfaceconstant{icommand}{commandei}
-\setinterfaceconstant{ignore}{ignorer}
-\setinterfaceconstant{in}{dans}
-\setinterfaceconstant{inbetween}{entre}
-\setinterfaceconstant{increment}{incrementer}
-\setinterfaceconstant{incrementnumber}{incrementernumero}
-\setinterfaceconstant{indenting}{indentation}
-\setinterfaceconstant{indentlist}{indentlist}
-\setinterfaceconstant{indentnext}{indenterauuivant}
-\setinterfaceconstant{index}{index}
-\setinterfaceconstant{indicator}{indicateur}
-\setinterfaceconstant{initialsep}{sepinitial}
-\setinterfaceconstant{inlinethreshold}{seuilenligne}
-\setinterfaceconstant{inner}{interieur}
-\setinterfaceconstant{innermargin}{margeinterieure}
-\setinterfaceconstant{inputfile}{fichierentree}
-\setinterfaceconstant{insidesection}{auseinsection}
-\setinterfaceconstant{instance}{instance}
-\setinterfaceconstant{intent}{intention}
-\setinterfaceconstant{interaction}{interaction}
-\setinterfaceconstant{interlinespace}{espaceinterligne}
-\setinterfaceconstant{internalgrid}{grilleinterieure}
-\setinterfaceconstant{italicfeatures}{fonctionnalitesitalique}
-\setinterfaceconstant{italicfont}{policeitalique}
-\setinterfaceconstant{itemalign}{alignerelem}
-\setinterfaceconstant{items}{élément}
-\setinterfaceconstant{joiners}{joins}
-\setinterfaceconstant{journalconversion}{conversionjournal}
-\setinterfaceconstant{juniorsep}{sepjunior}
-\setinterfaceconstant{keeptogether}{conserverensemble}
-\setinterfaceconstant{ken}{rep}
-\setinterfaceconstant{keyexpansion}{expansioncle}
-\setinterfaceconstant{keys}{cles}
-\setinterfaceconstant{keyword}{motclé}
-\setinterfaceconstant{label}{etiquette}
-\setinterfaceconstant{labelalternative}{varianteetiquette}
-\setinterfaceconstant{labelcolor}{couleuretiquette}
-\setinterfaceconstant{labeloffset}{decalageetiquette}
-\setinterfaceconstant{labelstyle}{styleetiquette}
-\setinterfaceconstant{language}{langue}
-\setinterfaceconstant{last}{dernier}
-\setinterfaceconstant{lastnamesep}{sepderniernom}
-\setinterfaceconstant{lastpage}{dernierepage}
-\setinterfaceconstant{lastpagesep}{sepdernierepage}
-\setinterfaceconstant{lastpubsep}{sepdernierepub}
-\setinterfaceconstant{layout}{miseenpage}
-\setinterfaceconstant{left}{gauche}
-\setinterfaceconstant{leftcolor}{couleurgauche}
-\setinterfaceconstant{leftcompoundhyphen}{traitdunioncomposegauche}
-\setinterfaceconstant{leftedge}{bordgauche}
-\setinterfaceconstant{leftedgedistance}{distancebordgauche}
-\setinterfaceconstant{leftframe}{cadregauche}
-\setinterfaceconstant{lefthyphen}{traitduniongauche}
-\setinterfaceconstant{leftmargin}{margegauche}
-\setinterfaceconstant{leftmargindistance}{distancemargegauche}
-\setinterfaceconstant{leftoffset}{decalagegauche}
-\setinterfaceconstant{leftquotation}{citationgauche}
-\setinterfaceconstant{leftquote}{citergauche}
-\setinterfaceconstant{leftsample}{echantillongauche}
-\setinterfaceconstant{leftsentence}{phrasegauche}
-\setinterfaceconstant{leftspeech}{discoursgauche}
-\setinterfaceconstant{leftstyle}{stylegauche}
-\setinterfaceconstant{leftsubsentence}{sousphrasegauche}
-\setinterfaceconstant{lefttext}{textegauche}
-\setinterfaceconstant{leftwidth}{largeurgauche}
-\setinterfaceconstant{leftwords}{motsgauche}
-\setinterfaceconstant{less}{moins}
-\setinterfaceconstant{level}{niveau}
-\setinterfaceconstant{levels}{niveaux}
-\setinterfaceconstant{limittext}{textelimite}
-\setinterfaceconstant{line}{ligne}
-\setinterfaceconstant{linecorrection}{correctionligne}
-\setinterfaceconstant{linedirection}{linedirection}
-\setinterfaceconstant{lines}{lignes}
-\setinterfaceconstant{list}{liste}
-\setinterfaceconstant{listtext}{texteliste}
-\setinterfaceconstant{local}{local}
-\setinterfaceconstant{location}{emplacement}
-\setinterfaceconstant{loffset}{decalagel}
-\setinterfaceconstant{logo}{logo}
-\setinterfaceconstant{logos}{logos}
-\setinterfaceconstant{marcolor}{couleurrem}
-\setinterfaceconstant{margin}{marge}
-\setinterfaceconstant{margindistance}{distancemarge}
-\setinterfaceconstant{marginedge}{margebord}
-\setinterfaceconstant{marginedgetext}{textemargebord}
-\setinterfaceconstant{margintext}{textemarge}
-\setinterfaceconstant{mark}{marque}
-\setinterfaceconstant{marking}{marquage}
-\setinterfaceconstant{marstyle}{stylerem}
-\setinterfaceconstant{mask}{masque}
-\setinterfaceconstant{mathclass}{classemath}
-\setinterfaceconstant{mathlimits}{limitesmath}
-\setinterfaceconstant{mathstyle}{stylemath}
-\setinterfaceconstant{max}{max}
-\setinterfaceconstant{maxdepth}{profondeurmax}
-\setinterfaceconstant{maxheight}{hauteurmax}
-\setinterfaceconstant{maxwidth}{largeurmax}
-\setinterfaceconstant{maybeyear}{anneepeutetre}
-\setinterfaceconstant{menu}{menu}
-\setinterfaceconstant{method}{methode}
-\setinterfaceconstant{middle}{milieu}
-\setinterfaceconstant{middlecolor}{couleurmilieu}
-\setinterfaceconstant{middlecommand}{commandemilieu}
-\setinterfaceconstant{middlespeech}{discoursmilieu}
-\setinterfaceconstant{middlestyle}{stylemilieu}
-\setinterfaceconstant{middletext}{textemilieu}
-\setinterfaceconstant{middlewidth}{largeurmilieu}
-\setinterfaceconstant{midsentence}{milieuphrase}
-\setinterfaceconstant{min}{min}
-\setinterfaceconstant{mindepth}{profondeurmin}
-\setinterfaceconstant{minheight}{hauteurmin}
-\setinterfaceconstant{minwidth}{largeurmin}
-\setinterfaceconstant{moffset}{decalagem}
-\setinterfaceconstant{monthconversion}{conversionmois}
-\setinterfaceconstant{more}{plus}
-\setinterfaceconstant{mpdepth}{profondeurmp}
-\setinterfaceconstant{mpheight}{hauteurmp}
-\setinterfaceconstant{mpoffset}{decalagemp}
-\setinterfaceconstant{mpwidth}{largeurmp}
-\setinterfaceconstant{n}{n}
-\setinterfaceconstant{name}{nom}
-\setinterfaceconstant{namesep}{sepnom}
-\setinterfaceconstant{nbottom}{nbas}
-\setinterfaceconstant{nc}{nc}
-\setinterfaceconstant{next}{suivant}
-\setinterfaceconstant{nextleft}{suivantgauche}
-\setinterfaceconstant{nextleftquotation}{citationgauchesuivante}
-\setinterfaceconstant{nextright}{suivantdroite}
-\setinterfaceconstant{nextrightquotation}{citationdroitesuivante}
-\setinterfaceconstant{nl}{nl}
-\setinterfaceconstant{nleft}{ngauche}
-\setinterfaceconstant{nlines}{nlignes}
-\setinterfaceconstant{norm}{norme}
-\setinterfaceconstant{note}{note}
-\setinterfaceconstant{notes}{notes}
-\setinterfaceconstant{nr}{nr}
-\setinterfaceconstant{nright}{ndroite}
-\setinterfaceconstant{ntop}{nhaut}
-\setinterfaceconstant{number}{numero}
-\setinterfaceconstant{numberalign}{alignernumero}
-\setinterfaceconstant{numbercolor}{couleurnumero}
-\setinterfaceconstant{numbercommand}{commandenumero}
-\setinterfaceconstant{numberconversion}{conversionnumero}
-\setinterfaceconstant{numberconversionset}{jeuconversionnumero}
-\setinterfaceconstant{numberdistance}{distancenumero}
-\setinterfaceconstant{numbering}{numérotation}
-\setinterfaceconstant{numberorder}{ordrenumero}
-\setinterfaceconstant{numberprefix}{prefixenumero}
-\setinterfaceconstant{numbersegments}{segmentsnumero}
-\setinterfaceconstant{numberseparator}{separateurnumero}
-\setinterfaceconstant{numberseparatorset}{jeuseparateurnumero}
-\setinterfaceconstant{numberset}{jeunumero}
-\setinterfaceconstant{numberstarter}{demarreurnumero}
-\setinterfaceconstant{numberstopper}{stoppeurnumero}
-\setinterfaceconstant{numberstrut}{entretoisenumero}
-\setinterfaceconstant{numberstyle}{stylenumero}
-\setinterfaceconstant{numberwidth}{largeurnumero}
-\setinterfaceconstant{nx}{nx}
-\setinterfaceconstant{ny}{ny}
-\setinterfaceconstant{object}{objet}
-\setinterfaceconstant{obstruction}{obstruction}
-\setinterfaceconstant{oddmargin}{margeimpaire}
-\setinterfaceconstant{offset}{decalage}
-\setinterfaceconstant{openaction}{actionouvrir}
-\setinterfaceconstant{openpage}{ouvrirpage}
-\setinterfaceconstant{openpageaction}{actionouvrirpage}
-\setinterfaceconstant{openup}{ouverture}
-\setinterfaceconstant{opticalsize}{tailleoptique}
-\setinterfaceconstant{option}{option}
-\setinterfaceconstant{order}{ordre}
-\setinterfaceconstant{orientation}{orientation}
-\setinterfaceconstant{otherstext}{texteautres}
-\setinterfaceconstant{outermargin}{margeexterieure}
-\setinterfaceconstant{overprint}{surimpression}
-\setinterfaceconstant{ownerpassword}{motdepasseproprietaire}
-\setinterfaceconstant{ownnumber}{numeropropre}
-\setinterfaceconstant{packcriterium}{criterepack}
-\setinterfaceconstant{page}{page}
-\setinterfaceconstant{pageboundaries}{frontierespage}
-\setinterfaceconstant{pagecolor}{couleurpage}
-\setinterfaceconstant{pagecolormodel}{modelecouleurpage}
-\setinterfaceconstant{pagecommand}{commandepage}
-\setinterfaceconstant{pageconnector}{connecteurpage}
-\setinterfaceconstant{pageconversion}{conversionpage}
-\setinterfaceconstant{pageconversionset}{jeuconversionpage}
-\setinterfaceconstant{pageleft}{pagegauche}
-\setinterfaceconstant{pagemethod}{methodepage}
-\setinterfaceconstant{pagenumber}{numeropage}
-\setinterfaceconstant{pageprefix}{prefixepage}
-\setinterfaceconstant{pageprefixconnector}{connecteurprefixepage}
-\setinterfaceconstant{pageprefixconversion}{conversionprefixepage}
-\setinterfaceconstant{pageprefixconversionset}{jeuconversionprefixepage}
-\setinterfaceconstant{pageprefixsegments}{segmentsprefixepage}
-\setinterfaceconstant{pageprefixseparatorset}{jeuseparateurprefixepage}
-\setinterfaceconstant{pageprefixset}{jeuprefixepage}
-\setinterfaceconstant{pageprefixstarter}{demarreurprefixepage}
-\setinterfaceconstant{pageprefixstopper}{stoppeurprefixpage}
-\setinterfaceconstant{pageright}{pagedroite}
-\setinterfaceconstant{pagesegments}{segmentspage}
-\setinterfaceconstant{pagesep}{seppage}
-\setinterfaceconstant{pageseparatorset}{jeuseparateurpage}
-\setinterfaceconstant{pageset}{jeupage}
-\setinterfaceconstant{pagestarter}{demarreurpage}
-\setinterfaceconstant{pagestate}{etatpage}
-\setinterfaceconstant{pagestopper}{stoppeurpage}
-\setinterfaceconstant{pagestyle}{stylepage}
-\setinterfaceconstant{palet}{palette}
-\setinterfaceconstant{paper}{papier}
-\setinterfaceconstant{paragraph}{paragraphe}
-\setinterfaceconstant{period}{periode}
-\setinterfaceconstant{place}{placer}
-\setinterfaceconstant{placehead}{placertete}
-\setinterfaceconstant{placeholder}{placeholder}
-\setinterfaceconstant{placestopper}{placerstoppeur}
-\setinterfaceconstant{position}{position}
-\setinterfaceconstant{prefix}{prefixe}
-\setinterfaceconstant{prefixconnector}{connecteurprefixe}
-\setinterfaceconstant{prefixconversion}{conversionprefixe}
-\setinterfaceconstant{prefixconversionset}{jeuconversionprefixe}
-\setinterfaceconstant{prefixsegments}{segmentsprefixe}
-\setinterfaceconstant{prefixseparatorset}{jeuseparateurprefixe}
-\setinterfaceconstant{prefixset}{jeuprefixe}
-\setinterfaceconstant{prefixstarter}{demarreurprefixe}
-\setinterfaceconstant{prefixstopper}{stoppeurprefixe}
-\setinterfaceconstant{preset}{preregler}
-\setinterfaceconstant{preview}{apercu}
-\setinterfaceconstant{previous}{precedent}
-\setinterfaceconstant{previousnumber}{numeroprecedent}
-\setinterfaceconstant{print}{imprimer}
-\setinterfaceconstant{printable}{imprimable}
-\setinterfaceconstant{process}{traiter}
-\setinterfaceconstant{processors}{processors}
-\setinterfaceconstant{profile}{profil}
-\setinterfaceconstant{properties}{proprietes}
-\setinterfaceconstant{pubsep}{seppub}
-\setinterfaceconstant{quotechar}{caracitation}
-\setinterfaceconstant{radius}{rayon}
-\setinterfaceconstant{random}{aleatoire}
-\setinterfaceconstant{range}{gamme}
-\setinterfaceconstant{reduction}{reduction}
-\setinterfaceconstant{ref}{ref}
-\setinterfaceconstant{refcommand}{commanderef}
-\setinterfaceconstant{reference}{reference}
-\setinterfaceconstant{referencemethod}{methodereference}
-\setinterfaceconstant{referenceprefix}{prefixereference}
-\setinterfaceconstant{referencetext}{referencetext}
-\setinterfaceconstant{referencing}{referencement}
-\setinterfaceconstant{region}{region}
-\setinterfaceconstant{regionin}{regiondedans}
-\setinterfaceconstant{regionout}{regiondehors}
-\setinterfaceconstant{register}{registre}
-\setinterfaceconstant{regularfeatures}{fonctionnalitesordinaires}
-\setinterfaceconstant{regularfont}{policereordinaire}
-\setinterfaceconstant{renderingsetup}{configurationrendu}
-\setinterfaceconstant{repeat}{repeter}
-\setinterfaceconstant{reset}{raz}
-\setinterfaceconstant{resetnumber}{raznumero}
-\setinterfaceconstant{resolution}{resolution}
-\setinterfaceconstant{resources}{ressources}
-\setinterfaceconstant{reverse}{inverser}
-\setinterfaceconstant{right}{droite}
-\setinterfaceconstant{rightchars}{caracteresdroite}
-\setinterfaceconstant{rightcolor}{couleurdroite}
-\setinterfaceconstant{rightcompoundhyphen}{traitdunioncomposedroite}
-\setinterfaceconstant{rightedge}{borddroit}
-\setinterfaceconstant{rightedgedistance}{distanceborddroit}
-\setinterfaceconstant{rightframe}{cadredroite}
-\setinterfaceconstant{righthyphen}{traitduniondroite}
-\setinterfaceconstant{rightmargin}{margedroite}
-\setinterfaceconstant{rightmargindistance}{distancemargedroite}
-\setinterfaceconstant{rightoffset}{decalagedroite}
-\setinterfaceconstant{rightquotation}{citationdroite}
-\setinterfaceconstant{rightquote}{citerdroite}
-\setinterfaceconstant{rightsample}{echantillondroite}
-\setinterfaceconstant{rightsentence}{phrasedroite}
-\setinterfaceconstant{rightspeech}{discoursdroite}
-\setinterfaceconstant{rightstyle}{styledroit}
-\setinterfaceconstant{rightsubsentence}{sousphrasedroite}
-\setinterfaceconstant{righttext}{textedroite}
-\setinterfaceconstant{rightwidth}{largeurdroite}
-\setinterfaceconstant{rightwords}{motsdroite}
-\setinterfaceconstant{roffset}{decalager}
-\setinterfaceconstant{rotation}{rotation}
-\setinterfaceconstant{rule}{trait}
-\setinterfaceconstant{rulecolor}{couleurtrait}
-\setinterfaceconstant{rulecommand}{commandetrait}
-\setinterfaceconstant{rulethickness}{epaisseurtrait}
-\setinterfaceconstant{samepage}{memepage}
-\setinterfaceconstant{sample}{echantillon}
-\setinterfaceconstant{samplesize}{tailleechantillon}
-\setinterfaceconstant{saveinlist}{enregistrerdansliste}
-\setinterfaceconstant{scale}{echelle}
-\setinterfaceconstant{scope}{perimetre}
-\setinterfaceconstant{screen}{ecran}
-\setinterfaceconstant{section}{section}
-\setinterfaceconstant{sectionblock}{blocsection}
-\setinterfaceconstant{sectionconversion}{conversionsection}
-\setinterfaceconstant{sectionconversionset}{jeuconversionsection}
-\setinterfaceconstant{sectionnumber}{numerosection}
-\setinterfaceconstant{sectionresetset}{jeurazsection}
-\setinterfaceconstant{sectionsegments}{segmentssection}
-\setinterfaceconstant{sectionseparatorset}{jeuseparateursection}
-\setinterfaceconstant{sectionset}{jeusection}
-\setinterfaceconstant{sectionstarter}{demarreursection}
-\setinterfaceconstant{sectionstopper}{stoppeursection}
-\setinterfaceconstant{separator}{separateur}
-\setinterfaceconstant{separatorcolor}{couleurseparateur}
-\setinterfaceconstant{separatorstyle}{styleseparateur}
-\setinterfaceconstant{set}{regler}
-\setinterfaceconstant{setups}{setups}
-\setinterfaceconstant{shrink}{retrecir}
-\setinterfaceconstant{side}{cote}
-\setinterfaceconstant{sidealign}{alignercote}
-\setinterfaceconstant{sidemethod}{methodecote}
-\setinterfaceconstant{sidespaceafter}{espacelatéralaprès}
-\setinterfaceconstant{sidespacebefore}{espacelateralavant}
-\setinterfaceconstant{sidespaceinbetween}{espacelateralentre}
-\setinterfaceconstant{sidethreshold}{seuilcote}
-\setinterfaceconstant{sign}{signe}
-\setinterfaceconstant{simplecommand}{commandesimple}
-\setinterfaceconstant{size}{taille}
-\setinterfaceconstant{slantedfeatures}{fonctionnalitesincline}
-\setinterfaceconstant{slantedfont}{policeinclinee}
-\setinterfaceconstant{small}{petit}
-\setinterfaceconstant{smallcapsfeatures}{fonctionnalitespetitescaps}
-\setinterfaceconstant{smallcapsfont}{policepetitescaps}
-\setinterfaceconstant{solution}{solution}
-\setinterfaceconstant{sort}{trier}
-\setinterfaceconstant{sorttype}{modetri}
-\setinterfaceconstant{source}{source}
-\setinterfaceconstant{space}{espace}
-\setinterfaceconstant{spaceafter}{espaceaprès}
-\setinterfaceconstant{spaceafterside}{espaceaprèscoté}
-\setinterfaceconstant{spacebefore}{espaceavant}
-\setinterfaceconstant{spacebeforeside}{espaceavantcote}
-\setinterfaceconstant{spaceinbetween}{espaceentre}
-\setinterfaceconstant{spacing}{espacement}
-\setinterfaceconstant{specification}{specification}
-\setinterfaceconstant{split}{partager}
-\setinterfaceconstant{splitcolor}{couleurpartage}
-\setinterfaceconstant{splitmethod}{methodepartage}
-\setinterfaceconstant{splitoffset}{decalagepartage}
-\setinterfaceconstant{spot}{tondirect}
-\setinterfaceconstant{stack}{pile}
-\setinterfaceconstant{stackname}{nompile}
-\setinterfaceconstant{start}{début}
-\setinterfaceconstant{starter}{demarreur}
-\setinterfaceconstant{state}{état}
-\setinterfaceconstant{step}{etape}
-\setinterfaceconstant{stop}{fin}
-\setinterfaceconstant{stopper}{stoppeur}
-\setinterfaceconstant{stretch}{etirer}
-\setinterfaceconstant{strip}{bande}
-\setinterfaceconstant{strut}{entretoise}
-\setinterfaceconstant{style}{style}
-\setinterfaceconstant{stylealternative}{variantestyle}
-\setinterfaceconstant{sub}{sous}
-\setinterfaceconstant{subtitle}{soustitre}
-\setinterfaceconstant{suffix}{suffixe}
-\setinterfaceconstant{suffixseparator}{separateursuffixe}
-\setinterfaceconstant{suffixstopper}{stoppeursuffixe}
-\setinterfaceconstant{surnamefirstnamesep}{sepnomfamilleprenom}
-\setinterfaceconstant{surnameinitialsep}{sepnomfamilleinitial}
-\setinterfaceconstant{surnamesep}{seprenom}
-\setinterfaceconstant{svgstyle}{stylesvg}
-\setinterfaceconstant{sx}{sx}
-\setinterfaceconstant{sy}{sy}
-\setinterfaceconstant{symalign}{alignersym}
-\setinterfaceconstant{symbol}{symbole}
-\setinterfaceconstant{symbolcommand}{commandesymbole}
-\setinterfaceconstant{symbolset}{jeusymbole}
-\setinterfaceconstant{symcolor}{couleursym}
-\setinterfaceconstant{symstyle}{stylesym}
-\setinterfaceconstant{synonym}{synonyme}
-\setinterfaceconstant{synonymcolor}{couleursynonyme}
-\setinterfaceconstant{synonymcommand}{commandesynonyme}
-\setinterfaceconstant{synonymstyle}{stylesynonyme}
-\setinterfaceconstant{tab}{tab}
-\setinterfaceconstant{text}{texte}
-\setinterfaceconstant{textalign}{alignertexte}
-\setinterfaceconstant{textcolor}{couleurtexte}
-\setinterfaceconstant{textcommand}{commandetexte}
-\setinterfaceconstant{textdistance}{distancetexte}
-\setinterfaceconstant{textheight}{hauteurtexte}
-\setinterfaceconstant{textlayer}{calquetexte}
-\setinterfaceconstant{textmargin}{margetexte}
-\setinterfaceconstant{textmethod}{methodetexte}
-\setinterfaceconstant{textseparator}{separateurtexte}
-\setinterfaceconstant{textsize}{tailletexte}
-\setinterfaceconstant{textstate}{etattexte}
-\setinterfaceconstant{textstyle}{styletexte}
-\setinterfaceconstant{textwidth}{largeurtexte}
-\setinterfaceconstant{threshold}{seuil}
-\setinterfaceconstant{time}{temps}
-\setinterfaceconstant{title}{titre}
-\setinterfaceconstant{titlecolor}{couleurtitre}
-\setinterfaceconstant{titlecommand}{commandetitre}
-\setinterfaceconstant{titledistance}{distancetitre}
-\setinterfaceconstant{titleleft}{gauchetitre}
-\setinterfaceconstant{titleright}{droitetitre}
-\setinterfaceconstant{titlestrut}{entretoisetitre}
-\setinterfaceconstant{titlestyle}{styletitre}
-\setinterfaceconstant{to}{vers}
-\setinterfaceconstant{toffset}{decalaget}
-\setinterfaceconstant{tolerance}{tolerance}
-\setinterfaceconstant{top}{haut}
-\setinterfaceconstant{topcommand}{commandehaut}
-\setinterfaceconstant{topdistance}{distancehaut}
-\setinterfaceconstant{topframe}{cadrehaut}
-\setinterfaceconstant{topoffset}{decalagehaut}
-\setinterfaceconstant{topspace}{espacehaut}
-\setinterfaceconstant{topstate}{etathaut}
-\setinterfaceconstant{totalnumber}{nombretotal}
-\setinterfaceconstant{transform}{transformer}
-\setinterfaceconstant{translate}{traduire}
-\setinterfaceconstant{trimoffset}{decalagecoupe}
-\setinterfaceconstant{type}{transcrire}
-\setinterfaceconstant{unit}{unite}
-\setinterfaceconstant{unknownreference}{referenceinconnue}
-\setinterfaceconstant{up}{enhaut}
-\setinterfaceconstant{urlalternative}{varianteurl}
-\setinterfaceconstant{urlspace}{espaceurl}
-\setinterfaceconstant{userpassword}{motdepasseutilisateur}
-\setinterfaceconstant{validate}{valider}
-\setinterfaceconstant{values}{valeurs}
-\setinterfaceconstant{vcommand}{commandev}
-\setinterfaceconstant{vcompact}{compactv}
-\setinterfaceconstant{vector}{vecteur}
-\setinterfaceconstant{veroffset}{decalagever}
-\setinterfaceconstant{vertical}{vertical}
-\setinterfaceconstant{vfactor}{facteurv}
-\setinterfaceconstant{vfil}{remplissagev}
-\setinterfaceconstant{viewerprefix}{prefixevisualisateur}
-\setinterfaceconstant{voffset}{decalagev}
-\setinterfaceconstant{vonsep}{sepvon}
-\setinterfaceconstant{way}{maniere}
-\setinterfaceconstant{wfactor}{facteurw}
-\setinterfaceconstant{white}{blanc}
-\setinterfaceconstant{width}{largeur}
-\setinterfaceconstant{words}{mots}
-\setinterfaceconstant{xanchor}{ancrex}
-\setinterfaceconstant{xfactor}{facteurx}
-\setinterfaceconstant{xhtml}{xhtml}
-\setinterfaceconstant{xmax}{xmax}
-\setinterfaceconstant{xmlsetup}{configurationxml}
-\setinterfaceconstant{xoffset}{decalagex}
-\setinterfaceconstant{xscale}{echellex}
-\setinterfaceconstant{xstep}{etapex}
-\setinterfaceconstant{yanchor}{ancrey}
-\setinterfaceconstant{yfactor}{facteury}
-\setinterfaceconstant{ymax}{ymax}
-\setinterfaceconstant{yoffset}{decalagey}
-\setinterfaceconstant{yscale}{echelley}
-\setinterfaceconstant{ystep}{etapey}
-% definitions for interface elements for language fr
-%
-\setinterfaceelement{answerlines}{lignesreponse}
-\setinterfaceelement{answerspace}{espacereponse}
-\setinterfaceelement{begin}{commencer}
-\setinterfaceelement{complete}{complet}
-\setinterfaceelement{coupled}{couple}
-\setinterfaceelement{currentlocal}{localcourant}
-\setinterfaceelement{end}{terminer}
-\setinterfaceelement{endsetup}{}
-\setinterfaceelement{get}{obtenir}
-\setinterfaceelement{increment}{incrementer}
-\setinterfaceelement{list}{liste}
-\setinterfaceelement{listof}{listede}
-\setinterfaceelement{load}{charger}
-\setinterfaceelement{local}{local}
-\setinterfaceelement{makeup}{composition}
-\setinterfaceelement{next}{suivant}
-\setinterfaceelement{place}{placer}
-\setinterfaceelement{previous}{precedent}
-\setinterfaceelement{previouslocal}{localprecedent}
-\setinterfaceelement{reserve}{reserver}
-\setinterfaceelement{see}{voir}
-\setinterfaceelement{setup}{configurer}
-\setinterfaceelement{start}{début}
-\setinterfaceelement{stop}{fin}
-\setinterfaceelement{text}{texte}
-\setinterfaceelement{type}{transcrire}
-% definitions for interface commands for language fr
-%
-\setinterfacecommand{Character}{Caractere}
-\setinterfacecommand{Characters}{Caracteres}
-\setinterfacecommand{MONTH}{MOIS}
-\setinterfacecommand{Numbers}{Numeros}
-\setinterfacecommand{Romannumerals}{Chiffresromains}
-\setinterfacecommand{SmallCapped}{PetitesCap}
-\setinterfacecommand{SmallCaps}{PetitesCaps}
-\setinterfacecommand{WEEKDAY}{JOURSEMAINE}
-\setinterfacecommand{WORD}{MOT}
-\setinterfacecommand{WORDS}{MOTS}
-\setinterfacecommand{Word}{Mot}
-\setinterfacecommand{Words}{Mots}
-\setinterfacecommand{about}{apropos}
-\setinterfacecommand{adaptfontfeature}{adapterfonctionnalitepolice}
-\setinterfacecommand{adaptlayout}{adaptermiseenpage}
-\setinterfacecommand{addfeature}{ajouterfonctionnalite}
-\setinterfacecommand{alignbottom}{alignerbas}
-\setinterfacecommand{aligned}{aligne}
-\setinterfacecommand{alignedbox}{boitealignee}
-\setinterfacecommand{alignedline}{lignealignee}
-\setinterfacecommand{alignhere}{alignerici}
-\setinterfacecommand{alignment}{alignement}
-\setinterfacecommand{alignmentcharacter}{caracterealignement}
-\setinterfacecommand{applytocharacters}{appliquerauxcaracteres}
-\setinterfacecommand{applytofirstcharacter}{appliqueraupremiercaractere}
-\setinterfacecommand{arg}{arg}
-\setinterfacecommand{at}{en}
-\setinterfacecommand{atleftmargin}{enmargegauche}
-\setinterfacecommand{atpage}{enpage}
-\setinterfacecommand{atrightmargin}{enmargedroite}
-\setinterfacecommand{background}{arriereplan}
-\setinterfacecommand{backspace}{retourarrière}
-\setinterfacecommand{blackrule}{traitepais}
-\setinterfacecommand{blackrules}{traitsepais}
-\setinterfacecommand{blank}{vierge}
-\setinterfacecommand{bookmark}{marquepage}
-\setinterfacecommand{bottombox}{boitebas}
-\setinterfacecommand{bottomdistance}{distancebas}
-\setinterfacecommand{bottomheight}{hauteurbas}
-\setinterfacecommand{bottomleftbox}{basgaucheboite}
-\setinterfacecommand{bottomrightbox}{boitebasdroite}
-\setinterfacecommand{bottomspace}{espacebas}
-\setinterfacecommand{buildtextbottomdot}{construirepointtextebas}
-\setinterfacecommand{but}{mais}
-\setinterfacecommand{button}{bouton}
-\setinterfacecommand{bypassblocks}{eviteblocs}
-\setinterfacecommand{character}{caractere}
-\setinterfacecommand{characters}{caracteres}
-\setinterfacecommand{chem}{chem}
-\setinterfacecommand{clip}{decouper}
-\setinterfacecommand{clonefield}{clonerchamp}
-\setinterfacecommand{color}{couleur}
-\setinterfacecommand{colorbar}{barrecouleur}
-\setinterfacecommand{colorvalue}{valeurcouleur}
-\setinterfacecommand{column}{colonne}
-\setinterfacecommand{comparecolorgroup}{comparergroupecouleur}
-\setinterfacecommand{comparepalet}{comparerpalette}
-\setinterfacecommand{completepagenumber}{numeropagecomplet}
-\setinterfacecommand{completeregister}{registrecomplet}
-\setinterfacecommand{component}{composant}
-\setinterfacecommand{convertnumber}{convertirnumero}
-\setinterfacecommand{copyfield}{copierchamp}
-\setinterfacecommand{correctwhitespace}{corrigerespaceblanc}
-\setinterfacecommand{coupledocument}{coupledocument}
-\setinterfacecommand{couplemarking}{couplemarquage}
-\setinterfacecommand{couplepage}{couplepage}
-\setinterfacecommand{couplepaper}{couplepapier}
-\setinterfacecommand{coupleregister}{coupleregistre}
-\setinterfacecommand{crlf}{crlf}
-\setinterfacecommand{currentdate}{datecourante}
-\setinterfacecommand{currentheadnumber}{numerotetecourante}
-\setinterfacecommand{cutspace}{espacecoupe}
-\setinterfacecommand{date}{date}
-\setinterfacecommand{decouplemarking}{decouplemarquage}
-\setinterfacecommand{decrementnumber}{decrementenumero}
-\setinterfacecommand{define}{définir}
-\setinterfacecommand{defineaccent}{définiraccent}
-\setinterfacecommand{defineblank}{définirvierge}
-\setinterfacecommand{defineblock}{définirbloc}
-\setinterfacecommand{definebodyfont}{définirpolicedecorps}
-\setinterfacecommand{definebodyfontenvironment}{définirenvironnementpolicedecorps}
-\setinterfacecommand{definebodyfontswitch}{définircommutateurpolicedecorps}
-\setinterfacecommand{definebuffer}{définirtampon}
-\setinterfacecommand{definecharacter}{définircaractere}
-\setinterfacecommand{definecharacterkerning}{définirapprochecaracteres}
-\setinterfacecommand{definecharacterspacing}{définirespacementcaracteres}
-\setinterfacecommand{definecolor}{définircouleur}
-\setinterfacecommand{definecolorgroup}{définirgroupecouleur}
-\setinterfacecommand{definecolumnbreak}{définirsautdecolonne}
-\setinterfacecommand{definecolumnset}{définirjeucolonnes}
-\setinterfacecommand{definecombination}{définircombinaison}
-\setinterfacecommand{definecombinedlist}{définirlistecombinee}
-\setinterfacecommand{definecommand}{définircommande}
-\setinterfacecommand{defineconversion}{définirconversion}
-\setinterfacecommand{definedescription}{définirdescription}
-\setinterfacecommand{definedfont}{policedefinie}
-\setinterfacecommand{defineenumeration}{définirénumération}
-\setinterfacecommand{definefallbackfamily}{définirfamillederepli}
-\setinterfacecommand{definefield}{définirchamp}
-\setinterfacecommand{definefieldstack}{définirpilechamp}
-\setinterfacecommand{definefiguresymbol}{définirfiguresymbole}
-\setinterfacecommand{definefilefallback}{définirfichierderepli}
-\setinterfacecommand{definefirstline}{définirpremiereligne}
-\setinterfacecommand{definefloat}{définirflottant}
-\setinterfacecommand{definefont}{définirpolice}
-\setinterfacecommand{definefontalternative}{définirvariantepolice}
-\setinterfacecommand{definefontfallback}{définirpolicederepli}
-\setinterfacecommand{definefontfamily}{définirfamillepolice}
-\setinterfacecommand{definefontfamilypreset}{définirprereglagefamillepolice}
-\setinterfacecommand{definefontfeature}{définirfonctionnalitepolice}
-\setinterfacecommand{definefontfile}{définirfichierpolice}
-\setinterfacecommand{definefontsize}{définirtaillepolice}
-\setinterfacecommand{definefontsolution}{définirsolutionpolice}
-\setinterfacecommand{definefontstyle}{définirstylepolice}
-\setinterfacecommand{definefontsynonym}{définirsynonymepolice}
-\setinterfacecommand{defineframed}{définirencadre}
-\setinterfacecommand{defineframedtext}{définirtexteencadre}
-\setinterfacecommand{definefrozenfont}{définirpolicegelee}
-\setinterfacecommand{definehbox}{définirhbox}
-\setinterfacecommand{definehead}{définirtete}
-\setinterfacecommand{definehyphenationfeatures}{définirfonctionnalitescesure}
-\setinterfacecommand{defineindentedtext}{définirtexteindente}
-\setinterfacecommand{defineinmargin}{définirdansmarge}
-\setinterfacecommand{defineinteractionmenu}{définirmenuinteraction}
-\setinterfacecommand{defineitemgroup}{définirgroupedéléments}
-\setinterfacecommand{defineitems}{définiréléments}
-\setinterfacecommand{definelabel}{définiretiquette}
-\setinterfacecommand{definelayer}{définircalque}
-\setinterfacecommand{definelayout}{définirmiseenpage}
-\setinterfacecommand{definelinenote}{définirnotedeligne}
-\setinterfacecommand{definelist}{définirliste}
-\setinterfacecommand{definelogo}{définirlogo}
-\setinterfacecommand{definemainfield}{définirchampprincipal}
-\setinterfacecommand{definemakeup}{définircomposition}
-\setinterfacecommand{definemarking}{définirmarquage}
-\setinterfacecommand{definemathalignment}{définiralignementmath}
-\setinterfacecommand{definemode}{définirmode}
-\setinterfacecommand{definenamedcolor}{définircouleurnommee}
-\setinterfacecommand{definenote}{définirnote}
-\setinterfacecommand{defineoutput}{définirsortie}
-\setinterfacecommand{defineoverlay}{définirsuperposition}
-\setinterfacecommand{definepagebreak}{définirsautdepage}
-\setinterfacecommand{definepalet}{définirpalette}
-\setinterfacecommand{definepapersize}{définirtaillepapier}
-\setinterfacecommand{defineparagraphs}{définirparagraphes}
-\setinterfacecommand{defineperiodkerning}{reglerapprochepoint}
-\setinterfacecommand{defineplacement}{définirplacement}
-\setinterfacecommand{defineprofile}{définirprofil}
-\setinterfacecommand{defineprogram}{définirprogramme}
-\setinterfacecommand{definerawfont}{définirpolicebrute}
-\setinterfacecommand{definereference}{définirreference}
-\setinterfacecommand{definereferenceformat}{définirformatrereference}
-\setinterfacecommand{definereferencelist}{définirlistereference}
-\setinterfacecommand{defineregister}{définirregistre}
-\setinterfacecommand{definerule}{définirtrait}
-\setinterfacecommand{definesection}{définirsection}
-\setinterfacecommand{definesectionblock}{définirblocsection}
-\setinterfacecommand{definesorting}{définirtri}
-\setinterfacecommand{definestartstop}{définirdébutfin}
-\setinterfacecommand{definestyle}{définirstyle}
-\setinterfacecommand{definesubfield}{définirsouschamp}
-\setinterfacecommand{definesymbol}{définirsymbole}
-\setinterfacecommand{definesynonyms}{définirsynonymes}
-\setinterfacecommand{definetabletemplate}{définirgabarittable}
-\setinterfacecommand{definetabulate}{définirtabulation}
-\setinterfacecommand{definetext}{définirtexte}
-\setinterfacecommand{definetextbackground}{définirtextearriereplan}
-\setinterfacecommand{definetextnote}{définirnotetexte}
-\setinterfacecommand{definetextposition}{définirpositiontexte}
-\setinterfacecommand{definetextvariable}{définirvariabletexte}
-\setinterfacecommand{definetype}{définirtranscrire}
-\setinterfacecommand{definetyping}{définirtranscription}
-\setinterfacecommand{defineversion}{définirversion}
-\setinterfacecommand{depthspanningtext}{jambagetextecouvrant}
-\setinterfacecommand{determineheadnumber}{determinernumerotete}
-\setinterfacecommand{determinelistcharacteristics}{determinercaracteristiquesliste}
-\setinterfacecommand{determineregistercharacteristics}{determinercaracteristiquesregistre}
-\setinterfacecommand{dimension}{dimension}
-\setinterfacecommand{disableinteractionmenu}{desactivermenuinteraction}
-\setinterfacecommand{disablemode}{desactivermode}
-\setinterfacecommand{doaddfeature}{faireajouterfonctionnalite}
-\setinterfacecommand{domicile}{domicile}
-\setinterfacecommand{dontconvertfont}{nepasconvertirpolice}
-\setinterfacecommand{donttest}{sanstester}
-\setinterfacecommand{edgedistance}{distancebord}
-\setinterfacecommand{edgewidth}{largeurbord}
-\setinterfacecommand{emphasisboldface}{policegrasaccentue}
-\setinterfacecommand{emptylines}{lignesvide}
-\setinterfacecommand{enablemode}{activermode}
-\setinterfacecommand{environment}{environnement}
-\setinterfacecommand{externalfigure}{figureexterne}
-\setinterfacecommand{fact}{fait}
-\setinterfacecommand{fastswitchtobodyfont}{passerrapideapolicedecorps}
-\setinterfacecommand{feature}{fonctionnalite}
-\setinterfacecommand{field}{champ}
-\setinterfacecommand{fieldstack}{pilechamp}
-\setinterfacecommand{fillinfield}{champarenseigner}
-\setinterfacecommand{fillinline}{lignearenseigner}
-\setinterfacecommand{fillinrules}{traitsarenseigner}
-\setinterfacecommand{fillintext}{textearenseigner}
-\setinterfacecommand{firstcharacter}{premiercaractere}
-\setinterfacecommand{fitfield}{adapterchamp}
-\setinterfacecommand{fittopbaselinegrid}{adaptergrillehautlignedebase}
-\setinterfacecommand{fixedspace}{espacefixe}
-\setinterfacecommand{fixedspaces}{espacesfixes}
-\setinterfacecommand{flushnotes}{vidernotes}
-\setinterfacecommand{followprofile}{suivreprofile}
-\setinterfacecommand{followprofileversion}{suivreversionprofil}
-\setinterfacecommand{followversion}{suivreversion}
-\setinterfacecommand{footerdistance}{distancepdp}
-\setinterfacecommand{footerheight}{hauteurpdp}
-\setinterfacecommand{footnote}{notebdp}
-\setinterfacecommand{footnotetext}{textenotebdp}
-\setinterfacecommand{forceblocks}{forcerblocs}
-\setinterfacecommand{forcecharacterstripping}{forcerdemontagecaracteres}
-\setinterfacecommand{formulanumber}{numeroformule}
-\setinterfacecommand{fraction}{fraction}
-\setinterfacecommand{framed}{encadre}
-\setinterfacecommand{from}{de}
-\setinterfacecommand{fromlinenote}{denotedeligne}
-\setinterfacecommand{getbuffer}{obtenirtampon}
-\setinterfacecommand{getfirstcharacter}{obtenirpremiercaractere}
-\setinterfacecommand{getmarking}{obtenirmarquage}
-\setinterfacecommand{getnumber}{obtenirnumero}
-\setinterfacecommand{globaldisablemode}{desactivermodeglobal}
-\setinterfacecommand{globalenablemode}{activermodeglobal}
-\setinterfacecommand{globalpreventmode}{empechermodeglobal}
-\setinterfacecommand{godown}{allerenbas}
-\setinterfacecommand{goto}{allera}
-\setinterfacecommand{gotobox}{alleraboite}
-\setinterfacecommand{gotopage}{allerapage}
-\setinterfacecommand{graycolor}{couleurgrise}
-\setinterfacecommand{greyvalue}{valeurgris}
-\setinterfacecommand{grid}{grille}
-\setinterfacecommand{hairline}{ligneavectrait}
-\setinterfacecommand{head}{tête}
-\setinterfacecommand{headerdistance}{distanceentête}
-\setinterfacecommand{headerheight}{hauteurentête}
-\setinterfacecommand{headlevel}{niveautete}
-\setinterfacecommand{headnumber}{numerotete}
-\setinterfacecommand{headsym}{symtete}
-\setinterfacecommand{headtext}{textetete}
-\setinterfacecommand{heightspanningtext}{hauteurtextecouvrant}
-\setinterfacecommand{hideblocks}{cacherblocs}
-\setinterfacecommand{high}{exposant}
-\setinterfacecommand{hl}{lh}
-\setinterfacecommand{immediatebetweenlist}{immediatemententreliste}
-\setinterfacecommand{immediatetolist}{immediatementalister}
-\setinterfacecommand{in}{dans}
-\setinterfacecommand{incrementnumber}{incrementernumero}
-\setinterfacecommand{indenting}{indentation}
-\setinterfacecommand{inframed}{dansencadre}
-\setinterfacecommand{infull}{encomplet}
-\setinterfacecommand{ininner}{dansinterieur}
-\setinterfacecommand{inleft}{dansgauche}
-\setinterfacecommand{inleftedge}{dansbordgauche}
-\setinterfacecommand{inleftmargin}{dansmargegauche}
-\setinterfacecommand{inline}{enligne}
-\setinterfacecommand{inmargin}{dansmarge}
-\setinterfacecommand{inmframed}{dansencadremath}
-\setinterfacecommand{inneredgedistance}{distancebordinterieur}
-\setinterfacecommand{inneredgewidth}{largeurbordinterieur}
-\setinterfacecommand{innermargindistance}{distancemargeinterieure}
-\setinterfacecommand{innermarginwidth}{largeurmargeinterieure}
-\setinterfacecommand{inothermargin}{dansautremarge}
-\setinterfacecommand{inouter}{dansexterieur}
-\setinterfacecommand{inright}{dansdroite}
-\setinterfacecommand{inrightedge}{dansborddroit}
-\setinterfacecommand{inrightmargin}{dansmargedroite}
-\setinterfacecommand{installlanguage}{installerlangue}
-\setinterfacecommand{interactionbar}{barreinteraction}
-\setinterfacecommand{interactionbuttons}{boutonsinteraction}
-\setinterfacecommand{interactionmenu}{menuinteraction}
-\setinterfacecommand{item}{élément}
-\setinterfacecommand{itemgroup}{groupedéléments}
-\setinterfacecommand{items}{éléments}
-\setinterfacecommand{itemtag}{étiquettedélément}
-\setinterfacecommand{its}{els}
-\setinterfacecommand{keepblocks}{conserverblocs}
-\setinterfacecommand{kerncharacters}{approchercaracteres}
-\setinterfacecommand{label}{etiquette}
-\setinterfacecommand{labels}{etiquettes}
-\setinterfacecommand{labeltext}{texteetiquette}
-\setinterfacecommand{language}{langue}
-\setinterfacecommand{languageCharacters}{Caractereslangue}
-\setinterfacecommand{languagecharacters}{caractereslangue}
-\setinterfacecommand{leftaligned}{aligneagauche}
-\setinterfacecommand{leftbottombox}{boitebasgauche}
-\setinterfacecommand{leftedgedistance}{distancebordgauche}
-\setinterfacecommand{leftedgewidth}{largeurbordgauche}
-\setinterfacecommand{leftline}{lignegauche}
-\setinterfacecommand{leftmargindistance}{distancemargegauche}
-\setinterfacecommand{leftmarginwidth}{largeurmargegauche}
-\setinterfacecommand{leg}{leg}
-\setinterfacecommand{linecorrection}{correctionligne}
-\setinterfacecommand{linenote}{notedeligne}
-\setinterfacecommand{linespanningtext}{largeurtextecouvrant}
-\setinterfacecommand{linewidth}{largeurligne}
-\setinterfacecommand{listheight}{hauteurliste}
-\setinterfacecommand{listlength}{longueurtexte}
-\setinterfacecommand{listsymbol}{symboleliste}
-\setinterfacecommand{listwidth}{largeurliste}
-\setinterfacecommand{loadfontgoodies}{charerfriandisespolice}
-\setinterfacecommand{localfootnotes}{notesbdplocales}
-\setinterfacecommand{localnotes}{noteslocales}
-\setinterfacecommand{logfields}{logchamps}
-\setinterfacecommand{lohi}{inex}
-\setinterfacecommand{low}{indice}
-\setinterfacecommand{macroname}{nommacro}
-\setinterfacecommand{mainlanguage}{langueprincipale}
-\setinterfacecommand{makeupheight}{hauteurcomposition}
-\setinterfacecommand{makeupwidth}{largeurcomposition}
-\setinterfacecommand{mar}{rem}
-\setinterfacecommand{marginblock}{blocmarginal}
-\setinterfacecommand{margindistance}{distancemarge}
-\setinterfacecommand{marginrule}{traitmarge}
-\setinterfacecommand{margintext}{textemarge}
-\setinterfacecommand{margintitle}{titremarge}
-\setinterfacecommand{marginwidth}{largeurmarge}
-\setinterfacecommand{marginword}{motmarge}
-\setinterfacecommand{marking}{marquage}
-\setinterfacecommand{markversion}{marquerversion}
-\setinterfacecommand{mathematics}{mathematics}
-\setinterfacecommand{menubutton}{boutonmenu}
-\setinterfacecommand{mframed}{encadremath}
-\setinterfacecommand{midaligned}{aligneaumilieu}
-\setinterfacecommand{mirror}{refleter}
-\setinterfacecommand{month}{mois}
-\setinterfacecommand{moveformula}{deplacerformule}
-\setinterfacecommand{moveongrid}{deplacersurgrille}
-\setinterfacecommand{movesidefloat}{deplacerflottantcote}
-\setinterfacecommand{navigating}{navigation}
-\setinterfacecommand{nodimension}{sansdimension}
-\setinterfacecommand{noheaderandfooterlines}{sansentêtenipdp}
-\setinterfacecommand{noindenting}{sansindentation}
-\setinterfacecommand{noitem}{sansélément}
-\setinterfacecommand{nolist}{sansliste}
-\setinterfacecommand{nomarking}{sansmarquage}
-\setinterfacecommand{nomoreblocks}{sansplusdeblocs}
-\setinterfacecommand{nomorefiles}{sansplusdefichiers}
-\setinterfacecommand{nop}{san}
-\setinterfacecommand{nospace}{sansespace}
-\setinterfacecommand{note}{note}
-\setinterfacecommand{notesymbol}{symbolenote}
-\setinterfacecommand{notopandbottomlines}{sansligneshautetbas}
-\setinterfacecommand{notsmallcapped}{paspetitescaps}
-\setinterfacecommand{nowhitespace}{sansespaceblanc}
-\setinterfacecommand{numberofsubpages}{nombredesouspages}
-\setinterfacecommand{numbers}{numeros}
-\setinterfacecommand{outeredgedistance}{distancebordexterieur}
-\setinterfacecommand{outeredgewidth}{largeurbordexterieur}
-\setinterfacecommand{outermargindistance}{distancemargeexterieure}
-\setinterfacecommand{outermarginwidth}{largeurmargeexterieure}
-\setinterfacecommand{packed}{sansespaceentreitem}
-\setinterfacecommand{page}{page}
-\setinterfacecommand{pagebreak}{sautdepage}
-\setinterfacecommand{pagedepth}{profondeurpage}
-\setinterfacecommand{pagenumber}{numeropage}
-\setinterfacecommand{pageoffset}{decalagepage}
-\setinterfacecommand{pagereference}{referencepage}
-\setinterfacecommand{paperheight}{hauteurpapier}
-\setinterfacecommand{paperwidth}{largeurpapier}
-\setinterfacecommand{periods}{periodes}
-\setinterfacecommand{placebookmarks}{placermarquepages}
-\setinterfacecommand{placecombinedlist}{placerlistecombinee}
-\setinterfacecommand{placefloat}{placerflottant}
-\setinterfacecommand{placefootnotes}{placernotesbdp}
-\setinterfacecommand{placeformula}{placerformule}
-\setinterfacecommand{placeheadnumber}{placernumerotete}
-\setinterfacecommand{placeheadtext}{placertextetete}
-\setinterfacecommand{placelegend}{placerlegende}
-\setinterfacecommand{placelist}{placerliste}
-\setinterfacecommand{placelistofsynonyms}{placerlistedesynonymes}
-\setinterfacecommand{placelocalfootnotes}{placernotesbdplocales}
-\setinterfacecommand{placelocalnotes}{placernoteslocales}
-\setinterfacecommand{placelogos}{placerlogo}
-\setinterfacecommand{placenamedfloat}{placerflottantnomme}
-\setinterfacecommand{placenotes}{placernotes}
-\setinterfacecommand{placeongrid}{placersurgrille}
-\setinterfacecommand{placeontopofeachother}{placerlunaudessusdelautre}
-\setinterfacecommand{placepagenumber}{placernumeropage}
-\setinterfacecommand{placerawlist}{placerlistebrute}
-\setinterfacecommand{placereferencelist}{placerlistereference}
-\setinterfacecommand{placeregister}{placerregistre}
-\setinterfacecommand{placerule}{placertrait}
-\setinterfacecommand{placesidebyside}{placercoteacote}
-\setinterfacecommand{placesubformula}{placersousformule}
-\setinterfacecommand{placetextvariable}{placervariabletexte}
-\setinterfacecommand{position}{position}
-\setinterfacecommand{positiontext}{texteposition}
-\setinterfacecommand{postponenotes}{reporternotes}
-\setinterfacecommand{postponingnotes}{reportnotes}
-\setinterfacecommand{predefinedfont}{policepredefinie}
-\setinterfacecommand{predefinefont}{predéfinirpolice}
-\setinterfacecommand{presetdocument}{prereglerdocument}
-\setinterfacecommand{prettyprintbuffer}{imprimerjolimenttampon}
-\setinterfacecommand{preventmode}{empechermode}
-\setinterfacecommand{printpaperheight}{hauteurpapierimpression}
-\setinterfacecommand{printpaperwidth}{largeurpapierimpression}
-\setinterfacecommand{processblocks}{traiterblocs}
-\setinterfacecommand{processbodyfontenvironmentlist}{traiterlisteenvironnementpolicedecorps}
-\setinterfacecommand{processpage}{traiterpage}
-\setinterfacecommand{product}{produit}
-\setinterfacecommand{program}{programme}
-\setinterfacecommand{project}{projet}
-\setinterfacecommand{publication}{publication}
-\setinterfacecommand{quotation}{citation}
-\setinterfacecommand{quote}{citer}
-\setinterfacecommand{ran}{ran}
-\setinterfacecommand{redo}{refaire}
-\setinterfacecommand{redoconvertfont}{refaireconvertirpolice}
-\setinterfacecommand{ref}{ref}
-\setinterfacecommand{reference}{reference}
-\setinterfacecommand{referral}{redirection}
-\setinterfacecommand{referraldate}{dateredirection}
-\setinterfacecommand{referring}{fairereference}
-\setinterfacecommand{registerfontclass}{enregistrerclassepolice}
-\setinterfacecommand{registerhyphenationexception}{enregistrerexceptioncesure}
-\setinterfacecommand{registerhyphenationpattern}{enregistrermotifcesure}
-\setinterfacecommand{remark}{remarque}
-\setinterfacecommand{replacefeature}{remplacerfonctionnalite}
-\setinterfacecommand{reset}{raz}
-\setinterfacecommand{resetandaddfeature}{razetajouterfonctionnalite}
-\setinterfacecommand{resetcharacteralign}{razalignercaractere}
-\setinterfacecommand{resetcharacterkerning}{razapprochecaracteres}
-\setinterfacecommand{resetcharacterspacing}{razespacementcaracteres}
-\setinterfacecommand{resetcharacterstripping}{razdemontagecaracteres}
-\setinterfacecommand{resetfeature}{razfonctionnalite}
-\setinterfacecommand{resetfontcolorsheme}{razthemecouleurpolice}
-\setinterfacecommand{resetfontfallback}{razpolicederepli}
-\setinterfacecommand{resetfontsolution}{zarsolutionpolice}
-\setinterfacecommand{resethyphenationfeatures}{razfonctionnalitescesure}
-\setinterfacecommand{resetlocalfloats}{razflottantslocaux}
-\setinterfacecommand{resetmarking}{razmarquage}
-\setinterfacecommand{resetmode}{razmode}
-\setinterfacecommand{resetnumber}{raznumero}
-\setinterfacecommand{resetpath}{razchemin}
-\setinterfacecommand{resetperiodkerning}{razapprochepoint}
-\setinterfacecommand{resetsystemmode}{razmodesysteme}
-\setinterfacecommand{resettextcontent}{raztexte}
-\setinterfacecommand{resetvisualizers}{razvisualisateurs}
-\setinterfacecommand{restoreglobalbodyfont}{restaurerpolicedecorpsglobale}
-\setinterfacecommand{retestfeature}{retesterfonctionnalite}
-\setinterfacecommand{revivefeature}{relancerfonctionnalite}
-\setinterfacecommand{rightaligned}{aligneadroite}
-\setinterfacecommand{rightbottombox}{boitebasdroite}
-\setinterfacecommand{rightedgedistance}{distanceborddroit}
-\setinterfacecommand{rightedgewidth}{largeurborddroit}
-\setinterfacecommand{rightline}{lignedroite}
-\setinterfacecommand{rightmargindistance}{distancemargedroite}
-\setinterfacecommand{rightmarginwidth}{largeurmargedroite}
-\setinterfacecommand{romannumerals}{chiffresromains}
-\setinterfacecommand{rotate}{tourner}
-\setinterfacecommand{savebuffer}{enregistrertampon}
-\setinterfacecommand{scale}{mettrealechelle}
-\setinterfacecommand{screen}{ecran}
-\setinterfacecommand{selectblocks}{selectionnerblocs}
-\setinterfacecommand{selectpaper}{selectionnerpapier}
-\setinterfacecommand{selectversion}{selectionnerversion}
-\setinterfacecommand{setbigbodyfont}{reglerpolicedecorpsimportante}
-\setinterfacecommand{setcharacteralign}{regleralignercaractere}
-\setinterfacecommand{setcharacteraligndetail}{reglerdetailalignercaractere}
-\setinterfacecommand{setcharactercasing}{reglercassecaracteres}
-\setinterfacecommand{setcharactercleaning}{reglernettoyagecaracteres}
-\setinterfacecommand{setcharacterkerning}{reglerapprochecaracteres}
-\setinterfacecommand{setcharacterspacing}{reglerespacementcaracteres}
-\setinterfacecommand{setcharacterstripping}{reglerdemontagecaracteres}
-\setinterfacecommand{setcurrentfontclass}{reglerclassepolicecourante}
-\setinterfacecommand{setfirstline}{reglerpremiereligne}
-\setinterfacecommand{setfirstpasscharacteralign}{regleralignercaracterepremierepasse}
-\setinterfacecommand{setfont}{reglerpolice}
-\setinterfacecommand{setfontcolorsheme}{reglerthemecouleurpolice}
-\setinterfacecommand{setfontfeature}{reglerfonctionnalitepolice}
-\setinterfacecommand{setfontsolution}{reglersolutionpolice}
-\setinterfacecommand{setfontstrut}{reglerentretoisepolice}
-\setinterfacecommand{sethyphenationfeatures}{reglerfonctionnalitescesure}
-\setinterfacecommand{setmainbodyfont}{reglerpolicedecorpsprincipale}
-\setinterfacecommand{setmode}{reglermode}
-\setinterfacecommand{setnote}{reglernote}
-\setinterfacecommand{setnotetext}{reglertextenote}
-\setinterfacecommand{setnumber}{reglernumero}
-\setinterfacecommand{setperiodkerning}{reglerapprochepoint}
-\setinterfacecommand{setsecondpasscharacteralign}{regleralignercaracteresecondepasse}
-\setinterfacecommand{setsmallbodyfont}{reglerpolicedecorpspetite}
-\setinterfacecommand{setsystemmode}{reglermodesysteme}
-\setinterfacecommand{settextcontent}{reglercontenutexte}
-\setinterfacecommand{settextvariable}{reglervariabletexte}
-\setinterfacecommand{setupalign}{configureraligner}
-\setinterfacecommand{setupanswerarea}{configurerzonereponse}
-\setinterfacecommand{setuparranging}{configurerarrangement}
-\setinterfacecommand{setupattachment}{configurepiecejointe}
-\setinterfacecommand{setupbackground}{configurerarriereplan}
-\setinterfacecommand{setupbackgrounds}{configurerarriereplans}
-\setinterfacecommand{setupblackrules}{configurertraitsepais}
-\setinterfacecommand{setupblank}{configurervierge}
-\setinterfacecommand{setupblock}{configurerbloc}
-\setinterfacecommand{setupbodyfont}{configurerpolicedecorps}
-\setinterfacecommand{setupbodyfontenvironment}{configurerenvironnementpolicedecorps}
-\setinterfacecommand{setupbottom}{configurerbas}
-\setinterfacecommand{setupbottomtexts}{configurertextesbas}
-\setinterfacecommand{setupbuffer}{configurertampon}
-\setinterfacecommand{setupbuttons}{configurerboutons}
-\setinterfacecommand{setupcapitals}{configurercapitales}
-\setinterfacecommand{setupcaption}{configurerintitule}
-\setinterfacecommand{setupcaptions}{configurerintitules}
-\setinterfacecommand{setupcharacteralign}{configureralignercaractere}
-\setinterfacecommand{setupcharacterkerning}{configurerapprochecaracteres}
-\setinterfacecommand{setupcharacterspacing}{configurerespacementcaracteres}
-\setinterfacecommand{setupclipping}{configurerdecoupage}
-\setinterfacecommand{setupcolor}{configurercouleur}
-\setinterfacecommand{setupcolors}{configurercouleurs}
-\setinterfacecommand{setupcolumns}{configurercolonnes}
-\setinterfacecommand{setupcolumnset}{configurerjeucolonnes}
-\setinterfacecommand{setupcolumnsetlines}{configurerlignesjeucolonnes}
-\setinterfacecommand{setupcolumnsetstart}{configurerfinjeucolonnes}
-\setinterfacecommand{setupcombinations}{configurercombinaisons}
-\setinterfacecommand{setupcombinedlist}{configurerlistecombinee}
-\setinterfacecommand{setupcomment}{configurercommentaire}
-\setinterfacecommand{setupcounter}{configurercompteur}
-\setinterfacecommand{setupdescription}{configurerdescription}
-\setinterfacecommand{setupdescriptions}{configurerdescriptions}
-\setinterfacecommand{setupenumeration}{configurerénumération}
-\setinterfacecommand{setupenumerations}{configurerénumérations}
-\setinterfacecommand{setupexternalfigures}{configurerfiguresexterne}
-\setinterfacecommand{setupfield}{configurerchamp}
-\setinterfacecommand{setupfields}{configurerchamps}
-\setinterfacecommand{setupfillinlines}{configurerlignesarenseigner}
-\setinterfacecommand{setupfillinrules}{configurertraitsarenseigner}
-\setinterfacecommand{setupfirstline}{configurerpremiereligne}
-\setinterfacecommand{setupfloat}{configurerflottant}
-\setinterfacecommand{setupfloats}{configurerflottants}
-\setinterfacecommand{setupfloatsplitting}{configurerpartageflottants}
-\setinterfacecommand{setupfontexpansion}{configurerexpansionpolice}
-\setinterfacecommand{setupfontprotrusion}{configurerprotrusionpolice}
-\setinterfacecommand{setupfonts}{configurerpolices}
-\setinterfacecommand{setupfontsolution}{configuresolutionpolice}
-\setinterfacecommand{setupfooter}{configurerpdp}
-\setinterfacecommand{setupfootertexts}{configurertextespdp}
-\setinterfacecommand{setupfootnotedefinition}{configurerdefinitionnotebdp}
-\setinterfacecommand{setupfootnotes}{configurernotesbdp}
-\setinterfacecommand{setupforms}{configurerformulaires}
-\setinterfacecommand{setupformula}{configurerformule}
-\setinterfacecommand{setupformulas}{configurerformules}
-\setinterfacecommand{setupframed}{configurerencadre}
-\setinterfacecommand{setupframedtext}{configurertexteencadre}
-\setinterfacecommand{setupframedtexts}{configurertextesencadres}
-\setinterfacecommand{setuphead}{configurertête}
-\setinterfacecommand{setupheader}{configurerentête}
-\setinterfacecommand{setupheadertexts}{configurertextesentête}
-\setinterfacecommand{setupheadnumber}{configurernumerotête}
-\setinterfacecommand{setupheads}{configurertêtes}
-\setinterfacecommand{setupheadtext}{configurertextêtete}
-\setinterfacecommand{setuphyphenation}{configurercesure}
-\setinterfacecommand{setuphyphenmark}{configurermarquecesure}
-\setinterfacecommand{setupindentedtext}{configurertexteindente}
-\setinterfacecommand{setupindenting}{configurerindentation}
-\setinterfacecommand{setupinmargin}{configurerdansmarge}
-\setinterfacecommand{setupinteraction}{configurerinteraction}
-\setinterfacecommand{setupinteractionbar}{configurerbarreinteraction}
-\setinterfacecommand{setupinteractionmenu}{configurermenuinteraction}
-\setinterfacecommand{setupinteractionscreen}{configurerecraninteraction}
-\setinterfacecommand{setupinterlinespace}{configurerespaceinterligne}
-\setinterfacecommand{setupitemgroup}{configurergroupedéléments}
-\setinterfacecommand{setupitemgroups}{configurergroupesdéléments}
-\setinterfacecommand{setupitems}{configureréléments}
-\setinterfacecommand{setuplabeltext}{configureretiquettetexte}
-\setinterfacecommand{setuplanguage}{configurerlangue}
-\setinterfacecommand{setuplayout}{configurermiseenpage}
-\setinterfacecommand{setuplegend}{configurerlegende}
-\setinterfacecommand{setuplinenote}{configurernotedeligne}
-\setinterfacecommand{setuplinenumbering}{configurernumérotationligne}
-\setinterfacecommand{setuplines}{configurerlignes}
-\setinterfacecommand{setuplinewidth}{configurerepaisseurtrait}
-\setinterfacecommand{setuplist}{configurerliste}
-\setinterfacecommand{setupmakeup}{configurercomposition}
-\setinterfacecommand{setupmarginblock}{configurerblocmarginal}
-\setinterfacecommand{setupmarginblocks}{configurerblocmarge}
-\setinterfacecommand{setupmargindata}{configurerdonneesmarginales}
-\setinterfacecommand{setupmarginrules}{configurertraitsmarge}
-\setinterfacecommand{setupmarking}{configurermarquage}
-\setinterfacecommand{setupmathalignment}{configureralignementmath}
-\setinterfacecommand{setupnarrower}{configurerplusetroit}
-\setinterfacecommand{setupnotation}{configurernotation}
-\setinterfacecommand{setupnotations}{configurernotations}
-\setinterfacecommand{setupnote}{configurenote}
-\setinterfacecommand{setupnotes}{configurenotes}
-\setinterfacecommand{setupnumber}{configurernumero}
-\setinterfacecommand{setupnumbering}{configurernumérotation}
-\setinterfacecommand{setupoppositeplacing}{configurerplacementopposition}
-\setinterfacecommand{setupoutput}{configurersortie}
-\setinterfacecommand{setuppagecomment}{configurercommentairepage}
-\setinterfacecommand{setuppagenumber}{configurernumeropage}
-\setinterfacecommand{setuppagenumbering}{configurernumérotationpage}
-\setinterfacecommand{setuppagetransitions}{configurertransitionpage}
-\setinterfacecommand{setuppalet}{configurerpalette}
-\setinterfacecommand{setuppaper}{configurerpapier}
-\setinterfacecommand{setuppapersize}{configurertaillepapier}
-\setinterfacecommand{setupparagraphnumbering}{configurernumérotationparagraphe}
-\setinterfacecommand{setupparagraphs}{configurerparagraphe}
-\setinterfacecommand{setupperiodkerning}{configurerapprochepoint}
-\setinterfacecommand{setupplacement}{configurerplacement}
-\setinterfacecommand{setuppositioning}{configurerpositionnement}
-\setinterfacecommand{setupprofiles}{configurerprofils}
-\setinterfacecommand{setupprograms}{configurerprogrammes}
-\setinterfacecommand{setuppublications}{configurerpublications}
-\setinterfacecommand{setupquote}{configurerciter}
-\setinterfacecommand{setupreferencelist}{configurerlistereference}
-\setinterfacecommand{setupreferencing}{configurerreferencement}
-\setinterfacecommand{setupregister}{configurerregistre}
-\setinterfacecommand{setuprotate}{configurerrotation}
-\setinterfacecommand{setuprule}{configurertrait}
-\setinterfacecommand{setupscreens}{configurerecran}
-\setinterfacecommand{setupsection}{configurersection}
-\setinterfacecommand{setupsectionblock}{configurerblocsection}
-\setinterfacecommand{setupsorting}{configurertri}
-\setinterfacecommand{setupspacing}{configurerespacement}
-\setinterfacecommand{setupstartstop}{configurerdébutfin}
-\setinterfacecommand{setupstrut}{configurerentretoise}
-\setinterfacecommand{setupsubpagenumber}{configurernumerosouspage}
-\setinterfacecommand{setupsymbolset}{configurerjeusymboles}
-\setinterfacecommand{setupsynchronization}{configurersynchronisation}
-\setinterfacecommand{setupsynchronizationbar}{configurerbarresynchronisation}
-\setinterfacecommand{setupsynonyms}{configurersynonymes}
-\setinterfacecommand{setupsystem}{configurersysteme}
-\setinterfacecommand{setuptab}{configurertab}
-\setinterfacecommand{setuptables}{configurertables}
-\setinterfacecommand{setuptabulate}{configurertabulation}
-\setinterfacecommand{setuptext}{configurertexte}
-\setinterfacecommand{setuptextbackground}{configurertextearriereplan}
-\setinterfacecommand{setuptextnote}{configurernotetexte}
-\setinterfacecommand{setuptextposition}{configurerpositiontexte}
-\setinterfacecommand{setuptextrules}{configurertextetraits}
-\setinterfacecommand{setuptexttexts}{configurertextestexte}
-\setinterfacecommand{setuptextvariable}{configurervariabletexte}
-\setinterfacecommand{setupthinrules}{configurertraitsfins}
-\setinterfacecommand{setuptolerance}{configurertolerance}
-\setinterfacecommand{setuptop}{configurerhaut}
-\setinterfacecommand{setuptoptexts}{configurertexteshaut}
-\setinterfacecommand{setuptype}{configurertranscrire}
-\setinterfacecommand{setuptyping}{configurertranscription}
-\setinterfacecommand{setupunderbar}{configurersouligner}
-\setinterfacecommand{setupurl}{configurerurl}
-\setinterfacecommand{setupversions}{configurerversions}
-\setinterfacecommand{setupwhitespace}{configurerespaceblanc}
-\setinterfacecommand{setvisualizerfont}{reglervisualisateurpolice}
-\setinterfacecommand{showbodyfont}{montrerpolicedecorps}
-\setinterfacecommand{showbodyfontenvironment}{montrerenvironnementpolicedecorps}
-\setinterfacecommand{showcolor}{montrercouleur}
-\setinterfacecommand{showcolorgroup}{montrergroupecouleur}
-\setinterfacecommand{showcounter}{montrercompteur}
-\setinterfacecommand{showexternalfigures}{montrerfiguresexternes}
-\setinterfacecommand{showfields}{montrerchamps}
-\setinterfacecommand{showfont}{montrerpolice}
-\setinterfacecommand{showfontdata}{montrerdonneespolice}
-\setinterfacecommand{showfontexpansion}{montrerexpansionpolice}
-\setinterfacecommand{showfontitalics}{montreritaliquespolice}
-\setinterfacecommand{showfontkerns}{montrerlesapproches}
-\setinterfacecommand{showfontparameters}{montrerparametrespolice}
-\setinterfacecommand{showfontstrip}{montrervisuellementpolice}
-\setinterfacecommand{showfontstyle}{montrerstylepolice}
-\setinterfacecommand{showframe}{montrermiseenpage}
-\setinterfacecommand{showgrid}{montrergrille}
-\setinterfacecommand{showhyphenationtrace}{montrertracecesure}
-\setinterfacecommand{showkerning}{montrerapproche}
-\setinterfacecommand{showlayout}{montrermiseenpage}
-\setinterfacecommand{showmakeup}{montrercomposition}
-\setinterfacecommand{showminimalbaseline}{montrerlignedebase}
-\setinterfacecommand{showpalet}{montrerpalette}
-\setinterfacecommand{showprint}{montrerimpression}
-\setinterfacecommand{showsetups}{montrerconfigurations}
-\setinterfacecommand{showstruts}{montrerentretoises}
-\setinterfacecommand{showsymbolset}{montrerjeusymboles}
-\setinterfacecommand{smallcapped}{petitescap}
-\setinterfacecommand{someline}{uneligne}
-\setinterfacecommand{somewhere}{qqpart}
-\setinterfacecommand{space}{espace}
-\setinterfacecommand{specialitem}{élémentspécial}
-\setinterfacecommand{splitfloat}{flottantpartage}
-\setinterfacecommand{startalignment}{débutalignement}
-\setinterfacecommand{startbackground}{débutarriereplan}
-\setinterfacecommand{startcoding}{débutcodage}
-\setinterfacecommand{startcolor}{débutcouleur}
-\setinterfacecommand{startcolumnmakeup}{débutcompositioncolonne}
-\setinterfacecommand{startcolumns}{débutcolonnes}
-\setinterfacecommand{startcolumnset}{débutjeucolonnes}
-\setinterfacecommand{startcombination}{débutcombinaison}
-\setinterfacecommand{startcomponent}{débutcomposant}
-\setinterfacecommand{startdocument}{débutdocument}
-\setinterfacecommand{startenvironment}{débutenvironnement}
-\setinterfacecommand{startfigure}{débutfigure}
-\setinterfacecommand{startframed}{débutencadre}
-\setinterfacecommand{startglobal}{débutglobal}
-\setinterfacecommand{startline}{débutligneref}
-\setinterfacecommand{startlinecorrection}{débutcorrectionligne}
-\setinterfacecommand{startlinenote}{débutnotedeligne}
-\setinterfacecommand{startlinenumbering}{débutnumérotationligne}
-\setinterfacecommand{startlines}{débutlignes}
-\setinterfacecommand{startlocal}{débutlocal}
-\setinterfacecommand{startlocalfootnotes}{débutnotesbdplocal}
-\setinterfacecommand{startmakeup}{débutcomposition}
-\setinterfacecommand{startmarginblock}{débutblocmarge}
-\setinterfacecommand{startmarginrule}{débuttraitmarge}
-\setinterfacecommand{startnarrower}{débutplusetroit}
-\setinterfacecommand{startopposite}{débutopposition}
-\setinterfacecommand{startoverlay}{débutsuperposition}
-\setinterfacecommand{startoverview}{débutvuedensemble}
-\setinterfacecommand{startpacked}{débutemballage}
-\setinterfacecommand{startpositioning}{débutpositionnement}
-\setinterfacecommand{startproduct}{débutproduit}
-\setinterfacecommand{startprofile}{débutprofil}
-\setinterfacecommand{startproject}{débutprojet}
-\setinterfacecommand{startquotation}{débutcitation}
-\setinterfacecommand{startraster}{débutraster}
-\setinterfacecommand{startsymbolset}{débutjeusymboles}
-\setinterfacecommand{startsynchronization}{débutsynchronisation}
-\setinterfacecommand{starttable}{débuttable}
-\setinterfacecommand{starttables}{débuttables}
-\setinterfacecommand{starttext}{débuttexte}
-\setinterfacecommand{starttextbackground}{débuttextearriereplan}
-\setinterfacecommand{starttextrule}{débuttextetrait}
-\setinterfacecommand{startunpacked}{débutdesemballage}
-\setinterfacecommand{startversion}{débutversion}
-\setinterfacecommand{stopalignment}{finalignement}
-\setinterfacecommand{stopbackground}{finarriereplan}
-\setinterfacecommand{stopcoding}{fincodage}
-\setinterfacecommand{stopcolor}{fincouleur}
-\setinterfacecommand{stopcolumnmakeup}{fincompositioncolonne}
-\setinterfacecommand{stopcolumns}{fincolonnes}
-\setinterfacecommand{stopcolumnset}{finjeucolonnes}
-\setinterfacecommand{stopcombination}{fincombinaison}
-\setinterfacecommand{stopcomponent}{fincomposant}
-\setinterfacecommand{stopdocument}{findocument}
-\setinterfacecommand{stopenvironment}{finenvironnement}
-\setinterfacecommand{stopframed}{finencadre}
-\setinterfacecommand{stopglobal}{finglobal}
-\setinterfacecommand{stopline}{finligneref}
-\setinterfacecommand{stoplinecorrection}{fincorrectionligne}
-\setinterfacecommand{stoplinenote}{finnotedeligne}
-\setinterfacecommand{stoplinenumbering}{finnumérotationligne}
-\setinterfacecommand{stoplines}{finlignes}
-\setinterfacecommand{stoplocal}{finlocal}
-\setinterfacecommand{stoplocalfootnotes}{finnotesbdplocal}
-\setinterfacecommand{stopmakeup}{fincomposition}
-\setinterfacecommand{stopmarginblock}{finblocmarge}
-\setinterfacecommand{stopmarginrule}{fintraitmarge}
-\setinterfacecommand{stopnarrower}{finplusetroit}
-\setinterfacecommand{stopopposite}{finopposition}
-\setinterfacecommand{stopoverlay}{finsuperposition}
-\setinterfacecommand{stopoverview}{finvuedensemble}
-\setinterfacecommand{stoppacked}{finemballage}
-\setinterfacecommand{stoppositioning}{finpositionnement}
-\setinterfacecommand{stopproduct}{finproduit}
-\setinterfacecommand{stopprofile}{finprofil}
-\setinterfacecommand{stopproject}{finprojet}
-\setinterfacecommand{stopquotation}{fincitation}
-\setinterfacecommand{stopraster}{finraster}
-\setinterfacecommand{stopsynchronization}{finsynchronisation}
-\setinterfacecommand{stoptable}{fintable}
-\setinterfacecommand{stoptables}{fintables}
-\setinterfacecommand{stoptext}{fintexte}
-\setinterfacecommand{stoptextbackground}{fintextearriereplan}
-\setinterfacecommand{stoptextrule}{fintextetrait}
-\setinterfacecommand{stopunpacked}{findesemballage}
-\setinterfacecommand{stopversion}{finversion}
-\setinterfacecommand{stretched}{etire}
-\setinterfacecommand{strictinspectnextcharacter}{inspecterstrictementcaracteresuivant}
-\setinterfacecommand{stripcharacter}{demontercaractere}
-\setinterfacecommand{subformulanumber}{numerosousformule}
-\setinterfacecommand{subpagenumber}{numerosouspage}
-\setinterfacecommand{subtractfeature}{enleverfonctionnalite}
-\setinterfacecommand{switchtobodyfont}{passerapolicedecorps}
-\setinterfacecommand{switchtorawfont}{passerapolicebrute}
-\setinterfacecommand{sym}{sym}
-\setinterfacecommand{symbol}{symbole}
-\setinterfacecommand{symoffset}{decalagesym}
-\setinterfacecommand{synchronizationbar}{barresynchronisation}
-\setinterfacecommand{synchronize}{synchroniser}
-\setinterfacecommand{tab}{tab}
-\setinterfacecommand{testcolumn}{testcolonne}
-\setinterfacecommand{testfeature}{testerfonctionnalite}
-\setinterfacecommand{testfeatureonce}{testerfonctionnaliteunfois}
-\setinterfacecommand{testpage}{testpage}
-\setinterfacecommand{tex}{tex}
-\setinterfacecommand{textbackground}{textearriereplan}
-\setinterfacecommand{textcolor}{textecouleura}
-\setinterfacecommand{textheight}{hauteurtexte}
-\setinterfacecommand{textnote}{notetexte}
-\setinterfacecommand{textreference}{referencetexte}
-\setinterfacecommand{textrule}{traittexte}
-\setinterfacecommand{textvariable}{variabletexte}
-\setinterfacecommand{textwidth}{largeurtexte}
-\setinterfacecommand{thefirstcharacter}{lepremiercaractere}
-\setinterfacecommand{thenormalizedbodyfontsize}{lataillenormaliseepolicedecorps}
-\setinterfacecommand{theremainingcharacters}{lescaracteresrestants}
-\setinterfacecommand{thinrule}{traitfin}
-\setinterfacecommand{thinrules}{traitsfins}
-\setinterfacecommand{tolinenote}{alanotedeligne}
-\setinterfacecommand{tooltip}{infobulle}
-\setinterfacecommand{topdistance}{distancehaut}
-\setinterfacecommand{topheight}{hauteurhaut}
-\setinterfacecommand{topspace}{espacehaut}
-\setinterfacecommand{totalnumberofpages}{nombretotaldepages}
-\setinterfacecommand{translate}{traduire}
-\setinterfacecommand{txt}{txt}
-\setinterfacecommand{typ}{transcrireaveccesure}
-\setinterfacecommand{type}{transcrire}
-\setinterfacecommand{typebuffer}{transcriretampon}
-\setinterfacecommand{typedefinedbuffer}{transcriretampondefini}
-\setinterfacecommand{typefile}{transcrirefichier}
-\setinterfacecommand{typeinlinebuffer}{transcriretamponenligne}
-\setinterfacecommand{typing}{transcription}
-\setinterfacecommand{unitmeaning}{significationunite}
-\setinterfacecommand{unknown}{inconnu}
-\setinterfacecommand{unregisterhyphenationpattern}{desenregistrermotifcesure}
-\setinterfacecommand{useJSscripts}{utiliserJSscript}
-\setinterfacecommand{useURL}{utiliserURL}
-\setinterfacecommand{useXMLfilter}{utiliserfiltreXML}
-\setinterfacecommand{useblocks}{utiliserblocs}
-\setinterfacecommand{usebodyfont}{utiliserpolicedecorps}
-\setinterfacecommand{usebodyfontparameter}{utiliserparametrepolicedecorps}
-\setinterfacecommand{usecommands}{utilisercommandes}
-\setinterfacecommand{useencoding}{utilisercodage}
-\setinterfacecommand{useexternaldocument}{utiliserdocumentexterne}
-\setinterfacecommand{useexternalfigure}{utiliserfigureexterne}
-\setinterfacecommand{useexternalfile}{utiliserfichierexterne}
-\setinterfacecommand{useexternalfiles}{utiliserfichiersexternes}
-\setinterfacecommand{useexternalsoundtrack}{utilisersonexterne}
-\setinterfacecommand{usemodule}{utilisermodule}
-\setinterfacecommand{usemodules}{utilisermodules}
-\setinterfacecommand{usepath}{utiliserchemin}
-\setinterfacecommand{usereferences}{utiliserreferences}
-\setinterfacecommand{usespecials}{utiliserspeciaux}
-\setinterfacecommand{usesymbols}{utilisersymboles}
-\setinterfacecommand{usetypescript}{utiliserscriptdepolices}
-\setinterfacecommand{usetypescriptfile}{utiliserfichierscriptdepolices}
-\setinterfacecommand{useurl}{utiliserurl}
-\setinterfacecommand{verbatim}{verbatim}
-\setinterfacecommand{version}{version}
-\setinterfacecommand{vl}{lv}
-\setinterfacecommand{weekday}{joursemaine}
-\setinterfacecommand{whitespace}{espaceblanc}
-\setinterfacecommand{widthspanningtext}{largeurtextecouvrant}
-\setinterfacecommand{wordright}{ecrireadroite}
-\setinterfacecommand{writebetweenlist}{ecrireentreliste}
-\setinterfacecommand{writetolist}{ecriredansliste}
-\setinterfacecommand{writetoreferencelist}{ecriredanslistereference}
-\setinterfacecommand{writetoregister}{ecriredansregistre}
-%
-\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/context/base/mkii/mult-fst.mkii b/Master/texmf-dist/tex/context/base/mkii/mult-fst.mkii
deleted file mode 100644
index 36c3f181f22..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/mult-fst.mkii
+++ /dev/null
@@ -1,36 +0,0 @@
-%D \module
-%D [ file=mult-fst,
-%D version=2006.08.16,
-%D title=\CONTEXT\ Multilingual Macros,
-%D subtitle=Speed Up,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% And so, after a few years of keeping this potentially dangerous
-% speedup in cont-exp, we now move it to the kernel: the next
-% patch is 30\% faster on main interface (seconds) (9->7 sec on
-% 1 million calls). Another speed up is still under testing.
-
-\unprotect
-
-\startinterface english
-
- \def\dosetvalue #1#2{\@EA\def \csname#1#2\endcsname}
- \def\dosetevalue #1#2{\@EA\edef\csname#1#2\endcsname}
- \def\dosetgvalue #1#2{\@EA\gdef\csname#1#2\endcsname}
- \def\dosetxvalue #1#2{\@EA\gdef\csname#1#2\endcsname}
- \def\docopyvalue#1#2#3{\@EA\def \csname#1#3\@EA\endcsname\@EA{\csname#2#3\endcsname}}
-
- \def\setinterfaceconstant#1#2{\setvalue{\c!prefix!#1}{#1}}
- \def\setinterfacevariable#1#2{\setvalue{\v!prefix!#1}{#2}}
-
- \def\interfaced#1{#1}
-
-\stopinterface
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/mult-ini.mkii b/Master/texmf-dist/tex/context/base/mkii/mult-ini.mkii
deleted file mode 100644
index 76f6d69f2b8..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/mult-ini.mkii
+++ /dev/null
@@ -1,935 +0,0 @@
-%D \module
-%D [ file=mult-ini,
-%D version=2008.10.22, % 1996.06.01,
-%D title=\CONTEXT\ Multilingual Macros,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 module is a stripped down version of \type {mult-ini.tex},
-%D which we keep around as \type {mult-kep.tex} for sentimental
-%D reasons. There you will find some more historic information.
-
-\writestatus{loading}{ConTeXt Multilingual Macros / Initialization}
-
-\unprotect
-
-%D \macros
-%D [constanten,variabelen,commands]
-%D {v!,c!,k!,s!,e!,m!,l!,r!,f!,p!,x!,y!}
-%D
-%D In the system modules we introduced some prefixed constants,
-%D variables (both macros) and registers. Apart from a
-%D tremendous saving in terms of memory and a gain in speed we
-%D use from now on prefixes when possible for just another
-%D reason: consistency and multi||linguality. Systematically
-%D using prefixed macros enables us to implement a
-%D multi||lingual user interface. Redefining these next set of
-%D prefixes therefore can have desastrous results.
-%D
-%D \startlinecorrection
-%D \starttable[|c|c|c|]
-%D \HL
-%D \NC \bf prefix \NC \bf meaning \NC \bf application \NC\SR
-%D \HL
-%D \NC \type{\c!prefix!} \NC c! \NC constant (direct) \NC\FR
-%D \NC \type{\e!prefix!} \NC e! \NC element \NC\MR
-%D \NC \type{\f!prefix!} \NC f! \NC file \NC\MR
-%D \NC \type{\k!prefix!} \NC k! \NC constant (indirect) \NC\MR
-%D \NC \type{\l!prefix!} \NC l! \NC language \NC\MR
-%D \NC \type{\m!prefix!} \NC m! \NC message \NC\MR
-%D \NC \type{\p!prefix!} \NC p! \NC procedure \NC\MR
-%D \NC \type{\r!prefix!} \NC r! \NC reference \NC\MR
-%D \NC \type{\s!prefix!} \NC s! \NC system \NC\MR
-%D \NC \type{\v!prefix!} \NC v! \NC variable \NC\MR
-%D \HL
-%D \stoptable
-%D \stoplinecorrection
-%D
-%D In the single||lingual version we used \type{!}, \type{!!},
-%D \type{!!!} and \type{!!!!}.
-
-\def\c!prefix!{c!} \def\e!prefix!{e!} \def\f!prefix!{f!}
-\def\k!prefix!{k!} \def\l!prefix!{l!} \def\m!prefix!{m!}
-\def\p!prefix!{p!} \def\r!prefix!{r!} \def\s!prefix!{s!}
-\def\v!prefix!{v!} \def\t!prefix!{t!}
-
-%D \macros
-%D [constants,variables,commands]
-%D {@@,??}
-%D
-%D Variables generated by the system can be recognized on their
-%D prefix \type{@@}. They are composed of a command (class)
-%D specific tag, which can be recognized on \type{??}, and a
-%D system constant, which has the prefix \type{c!}. We'll se
-%D some more of this.
-
-\def\??prefix {??}
-\def\@@prefix {@@}
-
-%D Just to be complete we repeat some of the already defined
-%D system constants here. Maybe their prefix \type{\s!} now
-%D falls into place.
-
-\def\s!next {next} \def\s!default {default}
-\def\s!dummy {dummy} \def\s!unknown {unknown}
-
-\def\s!do {do} \def\s!dodo {dodo}
-
-\def\s!complex {complex} \def\s!start {start}
-\def\s!simple {simple} \def\s!stop {stop}
-
-%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,
-%D both is terms of speed and memory usage, by using control
-%D sequences instead of the words written in full.
-%D
-%D Where in the \ASCII\ file the second lines takes nine extra
-%D characters, \TEX\ saves us 13~tokens.
-%D
-%D \starttyping
-%D \hrule width 10pt height 2pt depth 1pt
-%D \hrule \!!width 10pt \!!height 2pt \!!depth 1pt
-%D \stoptyping
-%D
-%D One condition is that we have defined \type{\!!height},
-%D \type{\!!width} and \type{\!!depth} as respectively
-%D \type{height}, \type{width} and \type{depth}. Using this
-%D scheme therefore only makes sense when a token sequence is
-%D used more than once. Savings like this should of course be
-%D implemented in english, just because \TEX\ is english.
-
-\def\!!width {width}
-\def\!!height {height}
-\def\!!depth {depth}
-\def\!!plus {plus}
-\def\!!minus {minus}
-\def\!!fill {fill}
-\def\!!to {to}
-
-%D \macros
-%D {defineinterfaceconstant,
-%D defineinterfacevariable,
-%D defineinterfaceelement,
-%D definesystemvariable,
-%D definesystemconstant,
-%D definemessageconstant,
-%D definereferenceconstant,
-%D definefileconstant}
-%D
-%D The first part of this module is dedicated to dealing with
-%D multi||lingual constants and variables. When \CONTEXT\ grew
-%D bigger and bigger in terms of bytes and used string space,
-%D we switched to predefined constants. At the cost of more
-%D hash table entries, the macros not only becase more compact,
-%D they became much faster too. Maybe an even bigger advantage
-%D was that mispelling could no longer lead to problems. Even a
-%D multi||lingual interface became possible.
-%D
-%D Constants --- we'll introduce the concept of variables later
-%D on --- are preceded by a type specific prefix, followed by a
-%D \type{!}. To force consistency, we provide a few commands
-%D for defining such constants.
-%D
-%D \starttyping
-%D \defineinterfaceconstant {name} {meaning}
-%D \defineinterfacevariable {name} {meaning}
-%D \defineinterfaceelement {name} {meaning}
-%D \stoptyping
-%D
-%D Which is the same as:
-%D
-%D \starttyping
-%D \def\c!name{meaning}
-%D \def\v!name{meaning}
-%D \def\e!name{meaning}
-%D \stoptyping
-
-\def\defineinterfaceconstant #1#2{\setvalue{\c!prefix!#1}{#2}}
-\def\defineinterfacevariable #1#2{\setvalue{\v!prefix!#1}{#2}}
-\def\defineinterfaceelement #1#2{\setvalue{\e!prefix!#1}{#2}}
-
-%D Next come some interface independant constants:
-%D
-%D \starttyping
-%D \definereferenceconstant {name} {meaning}
-%D \definefileconstant {name} {meaning}
-%D \stoptyping
-
-\def\definereferenceconstant #1#2{\setvalue{\r!prefix!#1}{#2}}
-\def\definefileconstant #1#2{\setvalue{\f!prefix!#1}{#2}}
-
-%D A new one:
-
-\def\definetypescriptconstant#1#2{\setvalue{\t!prefix!#1}{#2}}
-
-%D And finaly we have the one argument, space saving constants
-%D
-%D \starttyping
-%D \definesystemconstant {name}
-%D \definemessageconstant {name}
-%D \stoptyping
-
-\def\definesystemconstant #1{\setvalue{\s!prefix!#1}{#1}}
-\def\definemessageconstant #1{\setvalue{\m!prefix!#1}{#1}}
-
-%D In a parameter driven system, some parameters are shared
-%D by more system components. In \CONTEXT\ we can distinguish
-%D parameters by a unique prefix. Such a prefix is defined
-%D with:
-%D
-%D \starttyping
-%D \definesystemvariable {name}
-%D \stoptyping
-
-\def\definesystemvariable#1{\setevalue{\??prefix#1}{\@@prefix#1}}
-
-\definesystemvariable{ms}
-
-%D \macros
-%D {selectinterface,
-%D defaultinterface, currentinterface, currentresponses}
-%D
-%D With \type{\selectinterface} we specify the language we are
-%D going to use. The system asks for the language wanted, and
-%D defaults to \type{\currentinterface} when we just give
-%D \type{enter}. By default the message system uses the
-%D current interface language, but \type{\currentresponses}
-%D can specify another language too.
-%D
-%D Because we want to generate formats directly too, we do
-%D not ask for interface specifications when these are already
-%D defined (like in cont-nl.tex and alike).
-
-\ifx\defaultinterface\undefined
-
- \def\defaultinterface{english}
-
- \def\selectinterface
- {\def\docommand##1##2%
- {\bgroup
- \endlinechar\minusone
- \global\read16 to ##1
- \egroup
- \doifnothing\currentinterface{\let##1=##2}%
- \doifundefined{\s!prefix!##1}{\let##1=##2}}%
- \docommand\currentinterface\defaultinterface
- \writestatus{interface}{defining \currentinterface\space interface}%
- \writeline
- \docommand\currentresponses\currentinterface
- \writestatus{interface}{using \currentresponses\space messages}%
- \writeline
- \let\selectinterface\relax}
-
-\else
-
- \def\selectinterface
- {\writestatus{interface}{defining \currentinterface\space interface}%
- \writeline
- \writestatus{interface}{using \currentresponses\space messages}%
- \writeline
- \let\selectinterface\relax}
-
-\fi
-
-\ifx\currentinterface\undefined \let\currentinterface=\defaultinterface \fi
-\ifx\currentresponses\undefined \let\currentresponses=\defaultinterface \fi
-
-%D \macros
-%D {startinterface}
-%D
-%D Sometimes we want to define things only for specific
-%D interface languages. This can be done by means of the
-%D selector:
-%D
-%D \starttyping
-%D \startinterface language
-%D
-%D language specific definitions & commands
-%D
-%D \stopinterface
-%D \stoptyping
-
-\def\startinterface #1
- {\doifnot{#1}{all}{\doifnotinset\currentinterface{#1}{\gobbleuntil\stopinterface}}}
-
-\let\stopinterface\relax
-
-%D \macros
-%D {startmessages,
-%D getmessage,
-%D showmessage,
-%D makemessage}
-%D
-%D A package as large as \CONTEXT\ can hardly function without
-%D a decent message mechanism. Due to its multi||lingual
-%D interface, the message subsystem has to be multi||lingual
-%D too. A major drawback of this feature is that we have to
-%D code messages. As a result, the source becomes less self
-%D documented. On the other hand, consistency will improve.
-%D
-%D Because the overhead in terms of entries in the (already
-%D exhausted) hash table has to be minimal, messages are packed
-%D in libraries. We can extract a message from such a library
-%D in three ways:
-%D
-%D \starttyping
-%D \getmessage {library} {tag}
-%D \showmessage {library} {tag} {data}
-%D \makemessage {library} {tag} {data}
-%D \stoptyping
-%D
-%D The first command gets the message \type{tag} from the
-%D \type{library} specified. The other commands take an extra
-%D argument: a list of items to be inserted in the message
-%D text. While \type{\showmessage} shows the message at the
-%D terminal, the other commands generate the message as text.
-%D Before we explain the \type{data} argument, we give an
-%D example of a library.
-%D
-%D \starttyping
-%D \startmessages english library: alfa
-%D title: something
-%D 1: first message
-%D 2: second (--) message --
-%D \stopmessages
-%D \stoptyping
-%D
-%D The first message is a simple one and can be shown with:
-%D
-%D \starttyping
-%D \showmessage {alfa} {1} {}
-%D \stoptyping
-%D
-%D The second message on the other hand needs some extra data:
-%D
-%D \starttyping
-%D \showmessage {alfa} {2} {and last,to you}
-%D \stoptyping
-%D
-%D This message is shown as:
-%D
-%D \starttyping
-%D something : second (and last) message to you
-%D \stoptyping
-%D
-%D As we can see, the title entry is shown with the message.
-%D The data fields are comma separated and are specified in the
-%D message text by \type{--}.
-%D
-%D It is not required to define all messages in a library at
-%D once. We can add messages to a library in the following way:
-%D
-%D \starttyping
-%D \startmessages english library: alfa
-%D 10: tenth message
-%D \stopmessages
-%D \stoptyping
-%D
-%D Because such definitions can take place in different
-%D modules, the system gives a warning when a tag occurs more
-%D than once. The first occurrence takes preference over later
-%D ones, so we had better use a save offset, as shown in the
-%D example. As we can see, the title field is specified only
-%D the first time!
-%D
-%D Because we want to check for duplicate tags, the macros
-%D are a bit more complicated than neccessary. The \NEWLINE\
-%D token is used as message separator.
-%D
-%D For internal purposes one can use \type {\setmessagetext},
-%D which puts the message text asked for in \type
-%D {\currentmessagetext}.
-
-\def\findinterfacemessage#1#2%
- {\let#2\empty
- \def\dofindinterfacemessage##1 #1: ##2\relax##3\end{\def#2{##2}}%
- \edef\!!stringa{\getvalue{\??ms\currentmessagelibrary} #1: \relax}%
- \expandafter\dofindinterfacemessage\!!stringa\end}
-
-\def\composemessagetext#1--#2--#3--#4--#5--#6--#7--#8--#9\\%
- {\def\docomposemessagetext##1,##2,##3,##4,##5,##6,##7,##8,##9\\%
- {\edef\currentmessagetext{#1##1#2##2#3##3#4##4#5##5#6##6#7##7#8##8}}%
- \docomposemessagetext}
-
-\def\setmessagetext#1#2%
- {\def\currentmessagelibrary{#1}%
- \findinterfacemessage{#2}\currentmessagetext}
-
-\unexpanded\def\getmessage#1#2%
- {\def\currentmessagelibrary{#1}%
- \findinterfacemessage{#2}\currentmessagetext
- \currentmessagetext}
-
-\unexpanded\def\makemessage#1#2#3%
- {\def\currentmessagelibrary{#1}%
- \findinterfacemessage{#2}\currentmessagetext
- \@EA\composemessagetext\currentmessagetext----------------\\#3,,,,,,,,\\%
- \currentmessagetext}
-
-\def\showmessage#1#2#3%
- {\def\currentmessagelibrary{#1}%
- \findinterfacemessage{#2}\currentmessagetext
- \findinterfacemessage{title}\currentmessagetitle
- \ifx\currentmessagetext\empty
- \def\currentmessagetext{<unknown message #2>}%
- \else
- \@EA\composemessagetext\currentmessagetext----------------\\#3,,,,,,,,\\%
- \fi
- \@EA\writestatus\@EA{\currentmessagetitle}{\currentmessagetext}}
-
-\def\doaddinterfacemessage#1#2%
- {\findinterfacemessage{#1}\currentmessagetext
- \doifelsenothing\currentmessagetext
- {\setxvalue{\??ms\currentmessagelibrary}%
- {\getvalue{\??ms\currentmessagelibrary} #1: #2\relax}}
- {\debuggerinfotrue % we consider this an important error
- \debuggerinfo
- {message}
- {duplicate tag #1
- in library \currentmessagelibrary\space
- of interface \currentresponses}}%
- \futurelet\next\getinterfacemessage}
-
-\bgroup
-\obeylines
-\gdef\addinterfacemessage#1: #2
- {\doaddinterfacemessage{#1}{#2}}%
-\egroup
-
-\def\getinterfacemessage
- {\ifx\next\stopmessages
- \egroup\expandafter\gobbleoneargument
- \else
- \expandafter\addinterfacemessage
- \fi}
-
-\let\stopmessages\undefined % for dep checker
-
-\def\startmessages #1 library: #2
- {\definemessageconstant{#2}% handy for modules
- \bgroup
- \obeylines
- \doifinsetelse{#1}{\currentresponses,all}
- {\def\next
- {\def\currentmessagelibrary{#2}%
- \doifundefined{\??ms\currentmessagelibrary}
- {\letgvalueempty{\??ms\currentmessagelibrary}}%
- \futurelet\next\getinterfacemessage}}
- {\long\def\next##1\stopmessages{\egroup}}%
- \next}
-
-%D Here, the messages are stored in a way that saves hash
-%D entries, i.e. they are packed in one macro per library.
-%D This was important in the days when we used \TEX's with
-%D hash tables of about 10.000. The next, less efficient way
-%D of storing the message, makes \CONTEXT\ run upto 5\%
-%D faster by storing each message in a macro. In July 2000,
-%D this costs some 185 additional hash entries, and since
-%D we run large \TEX's, let do it!
-
-\def\startmessages #1 library: #2
- {\definemessageconstant{#2}% handy for modules
- \bgroup
- \obeylines
- \ifcsname\m!prefix!#2\endcsname\else\setgvalue{\m!prefix!#2}{#2}\fi
- \doifinsetelse{#1}{\currentresponses,all}
- {\def\next
- {\def\currentmessagelibrary{#2}%
- \futurelet\next\getinterfacemessage}}
- {\long\def\next##1\stopmessages{\egroup}}%
- \next}
-
-\def\findinterfacemessage#1#2%
- {\edef#2{\getvalue{\??ms\currentmessagelibrary#1}}}
-
-\def\doaddinterfacemessage#1#2%
- {\doifdefined{\??ms\currentmessagelibrary#1}
- {\debuggerinfotrue % we consider this an important error
- \debuggerinfo
- {message}
- {duplicate tag #1
- in library \currentmessagelibrary\space
- of interface \currentresponses}}%
- \setxvalue{\??ms\currentmessagelibrary#1}{#2}%
- \futurelet\next\getinterfacemessage}
-
-\def\setinterfacemessage#1#2#3%
- {\ifcsname\m!prefix!#1\endcsname\else\setgvalue{\m!prefix!#1}{#1}\fi
- \expandafter\def\csname\??ms#1#2\endcsname{#3}}
-
-%D \macros
-%D {ifshowwarnings, ifshowmessages}
-%D
-%D Sometimes displaying message can slow down processing
-%D considerably. We therefore introduce warnings. Users can
-%D turn of warnings and messages by saying:
-%D
-%D \starttyping
-%D \showwarningstrue
-%D \showmessagestrue
-%D \stoptyping
-%D
-%D Turning off messages also turns off warnings, which is
-%D quote logical because they are less important.
-
-% not yet mkiv
-
-\newif\ifshowwarnings \showwarningstrue
-\newif\ifshowmessages \showmessagestrue
-
-\let\normalshowmessage\showmessage
-
-\def\showwarning
- {\ifshowwarnings
- \expandafter\showmessage
- \else
- \expandafter\gobblethreearguments
- \fi}
-
-\def\showmessage
- {\ifshowmessages
- \expandafter\normalshowmessage
- \else
- \expandafter\gobblethreearguments
- \fi}
-
-%D \macros
-%D {dosetvalue,dosetevalue,dosetgvalue,dosetxvalue,docopyvalue,doresetvalue} % dogetvalue
-%D
-%D We already defined these auxiliary macros in the system
-%D modules. Starting with this module however, we have to take
-%D multi||linguality a bit more serious.
-
-\def\doresetvalue#1#2%
- {\dosetvalue{#1}{#2}{}}
-
-\def\doignorevalue#1#2#3%
- {\dosetvalue{#1}{#2}{}}
-
-\def\dosetvalue#1#2%
- {\let\c!internal!\c!internal!n
- \ifcsname\k!prefix!#2\endcsname
- \let\c!internal!\c!internal!y
- \@EA\def\csname#1\csname\k!prefix!#2\endcsname%\endcsname
- \else
- \let\c!internal!\c!internal!y
- \@EA\def\csname#1#2%\endcsname
- \fi\endcsname}
-
-\def\dosetevalue#1#2%
- {\let\c!internal!\c!internal!n
- \ifcsname\k!prefix!#2\endcsname
- \let\c!internal!\c!internal!y
- \@EA\edef\csname#1\csname\k!prefix!#2\endcsname%\endcsname
- \else
- \let\c!internal!\c!internal!y
- \@EA\edef\csname#1#2%\endcsname
- \fi\endcsname}
-
-\def\dosetgvalue#1#2%
- {\let\c!internal!\c!internal!n
- \ifcsname\k!prefix!#2\endcsname
- \let\c!internal!\c!internal!y
- \@EA\gdef\csname#1\csname\k!prefix!#2\endcsname%\endcsname
- \else
- \let\c!internal!\c!internal!y
- \@EA\gdef\csname#1#2%\endcsname
- \fi\endcsname}
-
-\def\dosetxvalue#1#2%
- {\let\c!internal!\c!internal!n
- \ifcsname\k!prefix!#2\endcsname
- \let\c!internal!\c!internal!y
- \@EA\xdef\csname#1\csname\k!prefix!#2\endcsname%\endcsname
- \else
- \let\c!internal!\c!internal!y
- \@EA\xdef\csname#1#2%\endcsname
- \fi\endcsname}
-
-\def\docopyvalue#1#2#3% real tricky expansion, quite unreadable
- {\let\c!internal!\c!internal!n
- \ifcsname\k!prefix!#3\endcsname
- \let\c!internal!\c!internal!y
- \@EA\def\csname#1\csname\k!prefix!#3\endcsname
- \@EA\endcsname\@EA{\csname#2\csname\k!prefix!#3\endcsname\endcsname}%
- \else
- \let\c!internal!\c!internal!y
- \@EA\def\csname#1#3\@EA\endcsname\@EA{\csname#2#3\endcsname}%
- \fi}
-
-%D We can now redefine some messages that will be
-%D introduced in the multi||lingual system module.
-
-\def\showassignerror #1#2{\showmessage\m!check1{#1,#2}\waitonfatalerror}
-\def\showargumenterror#1#2{\showmessage\m!check2{#1,#2}\waitonfatalerror}
-\def\showdefinederror #1#2{\showmessage\m!check3{#1,#2}\waitonfatalerror}
-
-%D \CONTEXT\ is a parameter driven package. This means that
-%D users instruct the system by means of variables, values and
-%D keywords. These instructions take the form:
-%D
-%D \starttyping
-%D \setupsomething[some variable=some value, another one=a keyword]
-%D \stoptyping
-%D
-%D or by keyword only:
-%D
-%D \starttyping
-%D \dosomething[this way,that way,no way]
-%D \stoptyping
-%D
-%D Because the same variables can occur in more than one setup
-%D command, we have to be able to distinguish them. This is
-%D achieved by assigning them a unique prefix.
-%D
-%D Imagine a setup command for boxed text, that enables us to
-%D specify the height and width of the box. Behide the scenes
-%D the command
-%D
-%D \starttyping
-%D \setupbox [width=12cm, height=3cm]
-%D \stoptyping
-%D
-%D results in something like
-%D
-%D \starttyping
-%D \<box><width> {12cm}
-%D \<box><height> {3cm}
-%D \stoptyping
-%D
-%D while a similar command for specifying the page dimensions
-%D of an \cap{A4} page results in:
-%D
-%D \starttyping
-%D \<page><width> {21.0cm}
-%D \<page><height> {27.9cm}
-%D \stoptyping
-%D
-%D The prefixes \type{<box>} and \type{<page>} are hidden from
-%D users and can therefore be language independant. Variables
-%D on the other hand, differ for each language:
-%D
-%D \starttyping
-%D \<box><color> {<blue>}
-%D \<box><kleur> {<blauw>}
-%D \<box><couleur> {<blue>}
-%D \stoptyping
-%D
-%D In this example we can see that the assigned values or
-%D keywords are language dependant too. This will be a
-%D complication when defining multi||lingual setup files.
-%D
-%D A third phenomena is that variables and values can have a
-%D similar meaning.
-%D
-%D \starttyping
-%D \<pagenumber><location> {<left>}
-%D \<skip><left> {12cm}
-%D \stoptyping
-%D
-%D A (minor) complication is that where in english we use
-%D \type{<left>}, in dutch we find both \type{<links>} and
-%D \type{<linker>}. This means that when we use some sort of
-%D translation table, we have to distinguish between the
-%D variables at the left side and the fixed values at the
-%D right.
-%D
-%D The same goes for commands that are composed of different
-%D user supplied and/or language specific elements. In english
-%D we can use:
-%D
-%D \starttyping
-%D \<empty><figure>
-%D \<empty><intermezzo>
-%D \stoptyping
-%D
-%D But in dutch we have the following:
-%D
-%D \starttyping
-%D \<lege><figuur>
-%D \<leeg><intermezzo>
-%D \stoptyping
-%D
-%D These subtle differences automatically lead to a solution
-%D where variables, values, elements and other components have
-%D a similar logical name (used in macro's) but a different
-%D meaning (supplied by the user).
-%D
-%D Our solution is one in which the whole system is programmed
-%D in terms of identifiers with language specific meanings. In
-%D such an implementation, each fixed variable is available as:
-%D
-%D \starttyping
-%D \<prefix><variable>
-%D \stoptyping
-%D
-%D This means that for instance:
-%D
-%D \starttyping
-%D \setupbox[width=12cm]
-%D \stoptyping
-%D
-%D expands to something like:
-%D
-%D \starttyping
-%D \def\boxwidth{12cm}
-%D \stoptyping
-%D
-%D because we don't want to recode the source, a setup command
-%D in another language has to expand to this variable, so:
-%D
-%D \starttyping
-%D \setupblock[width=12cm]
-%D \stoptyping
-%D
-%D has to result in the definition of \type{\boxwidth} too.
-%D This method enables us to build compact, fast and readable
-%D code.
-%D
-%D An alternative method, which we considered using, uses a
-%D more indirect way. In this case, both calls generate a
-%D different variable:
-%D
-%D \starttyping
-%D \def\boxwidth {12cm}
-%D \def\boxbreedte {12cm}
-%D \stoptyping
-%D
-%D And because we don't want to recode those megabytes of
-%D already developed code, this variable has to be called with
-%D something like:
-%D
-%D \starttyping
-%D \valueof\box\width
-%D \stoptyping
-%D
-%D where \type{\valueof} takes care of the translation of
-%D \type{width} or \type{breedte} to \type{width} and
-%D combining this with \type{box} to \type{\boxwidth}.
-%D
-%D One advantage of this other scheme is that, within certain
-%D limits, we can implement an interface that can be switched
-%D to another language at will, while the current approach
-%D fixes the interface at startup. There are, by the way,
-%D other reasons too for not choosing this scheme. Switching
-%D user generated commands is for instance impossible and a
-%D dual interface would therefore give a strange mix of
-%D languages.
-%D
-%D Now let's work out the first scheme. Although the left hand
-%D of the assignment is a variable from the users point of
-%D view, it is a constant in terms of the system. Both
-%D \type{width} and \type{breedte} expand to \type{width}
-%D because in the source we only encounter \type{width}. Such
-%D system constants are presented as
-%D
-%D \starttyping
-%D \c!width
-%D \stoptyping
-%D
-%D This constant is always equivalent to \type{width}. As we
-%D can see, we use \type{c!} to mark this one as constant. Its
-%D dutch counterpart is:
-%D
-%D \starttyping
-%D breedte
-%D \stoptyping
-%D
-%D When we interpret a setup command each variable is
-%D translated to it's \type{c!} counterpart. This means that
-%D \type{breedte} and \type{width} expand to \type{breedte}
-%D and \type{\c!width} which both expand to \type{width}. That
-%D way user variables become system constants.
-%D
-%D The interpretation is done by means of a general setup
-%D command \type{\getparameters} that we introduced in the
-%D system module. Let us define some simple setup command:
-%D
-%D \starttyping
-%D \def\setupbox[#1]%
-%D {\getparameters[\??bx][#1]}
-%D \stoptyping
-%D
-%D This command can be used as:
-%D
-%D \starttyping
-%D \setupbox [width=3cm, height=1cm]
-%D \stoptyping
-%D
-%D Afterwards we have two variables \type{\@@bxwidth} and
-%D \type{\@@bxheight} which have the values \type{3cm} and
-%D \type{1cm} assigned. These variables are a combinatiom of
-%D the setup prefix \type{\??bx}, which expands to \type{@@bx}
-%D and the translated user supplied variables \type{width} and
-%D \type{height} or \type{breedte} and \type{hoogte},
-%D depending on the actual language. In dutch we just say:
-%D
-%D \starttyping
-%D \setupblock [width=3cm, height=1cm]
-%D \stoptyping
-%D
-%D and get ourselves \type{\@@bxwidth} and \type{\@@bxheight}
-%D too. In the source of \CONTEXT, we can recognize constants
-%D and variables on their leading \type{c!}, \type{v!} etc.,
-%D prefixes on \type{??} and composed variables on \type{@@}.
-%D
-%D We already saw that user supplied keywords need some
-%D special treatment too. This time we don't translate the
-%D keyword, but instead use in the source a variable which
-%D meaning depends on the interface language.
-%D
-%D \starttyping
-%D \v!left
-%D \stoptyping
-%D
-%D Which can be used in macro's like:
-%D
-%D \starttyping
-%D \processaction
-%D [\@@bxlocation]
-%D [ \v!left=>\dosomethingontheleft,
-%D \v!middle=>\dosomthinginthemiddle,
-%D \v!right=>\dosomethingontheright]
-%D \stoptyping
-%D
-%D Because variables like \type{\@@bxlocation} can have a lot
-%D of meanings, including tricky expandable tokens, we cannot
-%D translate this meaning when we compare. This means that
-%D \type{\@@bxlocation} can be \type{left} of \type{links} of
-%D whatever meaning suits the language. But because
-%D \type{\v!left} also has a meaning that suits the language,
-%D we are able to compare.
-%D
-%D Although we know it sounds confusing we want to state two
-%D important characteristics of the interface as described:
-%D
-%D \startnarrower \em
-%D user variables become system constants
-%D \stopnarrower
-%D
-%D and
-%D
-%D \startnarrower \em
-%D user constants (keywords) become system variables
-%D \stopnarrower
-%D
-
-%D Anno 2003 I've forgotten why the \type {\c!internal} is
-%D still in there; it's probably a left over from an experiment.
-
-\let\c!internal!y \string
-\def\c!internal!n {-}
-\let\c!internal! \c!internal!y
-
-\def\setinterfaceconstant#1#2%
- {\setvalue{\c!prefix!#1}{\c!internal!#1}%
- \setvalue{\k!prefix!#2}{#1}}
-
-\def\setinterfacevariable#1#2%
- {\setvalue{\v!prefix!#1}{#2}}
-
-%D \macros
-%D {defineinterfaceconstant}
-%D
-%D Next we redefine a previously defined macro to take care of
-%D interface translation too. It's a bit redundant, because
-%D in these situations we could use the c||version, but for
-%D documentation purposes the x||alternative comes in handy.
-
-\def\defineinterfaceconstant#1#2%
- {\setvalue{\c!prefix!#1}{#2}}
-
-%D \macros
-%D {startelements}
-%D
-%D Due to the object oriented nature of \CONTEXT, we also need
-%D to define the elements that are used to build commands.
-%D
-%D Such elements sometimes are the same in diferent
-%D languages, but mostly they differ. Things can get even
-%D confusing when we look at for instance the setup commands.
-%D In english we say \type{\setup<something>}, but in dutch we
-%D have: \type{\stel<iets>in}. Such split elements are no
-%D problem, because we just define two elements. When no second
-%D part is needed, we use a \type{-}:
-
-\def\setinterfaceelement#1#2%
- {\ifcsname\e!prefix!#1\endcsname
- \doifnotvalue{\e!prefix!#1}{#2}{\setvalue{\e!prefix!#1}{#2}}%
- \else
- \setvalue{\e!prefix!#1}{#2}%
- \fi}
-
-\def\setinterfacecommand#1#2%
- {\doifnot{#1}{#2}{\@EA\def\csname#2\@EA\endcsname\@EA{\csname#1\endcsname}}}% or just \let ?
-
-%D We just ignore these:
-
-\def\startvariables{\gobbleuntil\stopvariables}
-\def\startconstants{\gobbleuntil\stopconstants}
-\def\startelements {\gobbleuntil\stopelements}
-\def\startcommands {\gobbleuntil\stopcommands}
-
-%D \macros
-%D {interfaced}
-%D
-%D The setup commands translate the constants automatically.
-%D When we want to translate 'by hand' we can use the simple
-%D but effective command:
-%D
-%D \starttyping
-%D \interfaced {something}
-%D \stoptyping
-%D
-%D Giving \type{\interfaced{breedte}} results in \type{width}
-%D or, when not defined, in \type{breedte} itself. This
-%D macro is used in the font switching mechanism.
-
-\def\interfaced#1%
- {\ifcsname\k!prefix!#1\endcsname
- \csname\k!prefix!#1\endcsname
- \else
- #1%
- \fi}
-
-%D So much for the basic multi||lingual interface commands. The
-%D macro's can be enhanced with more testing facilities, but
-%D for the moment they suffice.
-
-%D Out of convenience we define the banners here.
-
-\def\contextbanner
- {ConTeXt \space
- ver: \contextversion \space \contextmark \space \space
- fmt: \formatversion \space \space
- int: \currentinterface/\currentresponses}
-
-\def\showcontextbanner
- {\writeline\writebanner{\contextbanner}\writeline}
-
-\edef\formatversion
- {\the\normalyear.\the\normalmonth.\the\normalday}
-
-\ifx\contextversion\undefined
- \def\contextversion {unknown}
- \def\contextversionnumber{0}
-\else
- \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\space\contextmark}
-\fi
-
-\ifx\undefined\everydump
- \newtoks\everydump
- \def\dump{\the\everydump\normaldump}
-\fi
-
-\appendtoks \showcontextbanner \to \everydump
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/mult-it.mkii b/Master/texmf-dist/tex/context/base/mkii/mult-it.mkii
deleted file mode 100644
index 4a4676f6892..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/mult-it.mkii
+++ /dev/null
@@ -1,2224 +0,0 @@
-% this file is auto-generated, don't edit this file
-%
-% definitions for interface variables for language it
-%
-\setinterfacevariable{Addition}{Aggiunta}
-\setinterfacevariable{Alphabetic}{Alphabetic}
-\setinterfacevariable{Balloon}{Pallone}
-\setinterfacevariable{Cap}{Cap}
-\setinterfacevariable{Capital}{Maiuscolo}
-\setinterfacevariable{Character}{Lettera}
-\setinterfacevariable{Characters}{Lettere}
-\setinterfacevariable{CloseDocument}{ChiudiDocumento}
-\setinterfacevariable{ExitViewer}{EsciVisualizzatore}
-\setinterfacevariable{FirstPage}{PrimaPagina}
-\setinterfacevariable{FitHeight}{FitHeight}
-\setinterfacevariable{FitWidth}{FitWidth}
-\setinterfacevariable{GotoPage}{VaiAPagina}
-\setinterfacevariable{Greek}{Greco}
-\setinterfacevariable{Help}{Aiuto}
-\setinterfacevariable{HideField}{NascondiCampo}
-\setinterfacevariable{HideLayer}{HideLayer}
-\setinterfacevariable{Key}{Tasto}
-\setinterfacevariable{LastPage}{UltimaPagina}
-\setinterfacevariable{LoadForm}{CaricaForm}
-\setinterfacevariable{MONTH}{MESE}
-\setinterfacevariable{New}{Nuovo}
-\setinterfacevariable{NextJump}{SaltoSuccessivo}
-\setinterfacevariable{NextPage}{PaginaSuccessiva}
-\setinterfacevariable{Numbers}{Numeri}
-\setinterfacevariable{OpenNamedDocument}{OpenNamedDocument}
-\setinterfacevariable{Ordinal}{Ordinal}
-\setinterfacevariable{Paragraph}{Capoverso}
-\setinterfacevariable{PauseMovie}{PausaFilm}
-\setinterfacevariable{PauseRendering}{PauseRendering}
-\setinterfacevariable{PauseSound}{PausaSuono}
-\setinterfacevariable{PreviousJump}{SaltoPrecedente}
-\setinterfacevariable{PreviousPage}{PaginaPrecedente}
-\setinterfacevariable{PrintDocument}{StampaDocumento}
-\setinterfacevariable{Query}{Richiesta}
-\setinterfacevariable{QueryAgain}{RinnovaRichiesta}
-\setinterfacevariable{ResetForm}{ReimpostaForm}
-\setinterfacevariable{ResumeMovie}{RiprendiFilm}
-\setinterfacevariable{ResumeRendering}{ResumeRendering}
-\setinterfacevariable{ResumeSound}{RiprendiSuono}
-\setinterfacevariable{Romannumerals}{Numeriromani}
-\setinterfacevariable{SaveDocument}{SalvaDocumento}
-\setinterfacevariable{SaveForm}{SalvaForm}
-\setinterfacevariable{SaveNamedDocument}{SaveNamedDocument}
-\setinterfacevariable{SearchAgain}{CercaAncora}
-\setinterfacevariable{SearchDocument}{CercaDocumento}
-\setinterfacevariable{ShowBookmarks}{MostraSegnalibro}
-\setinterfacevariable{ShowField}{MostraCampo}
-\setinterfacevariable{ShowThumbs}{MostraThumbs}
-\setinterfacevariable{StartMovie}{IniziaFilm}
-\setinterfacevariable{StartRendering}{StartRendering}
-\setinterfacevariable{StartSound}{IniziaSuono}
-\setinterfacevariable{StopMovie}{FermaFilm}
-\setinterfacevariable{StopRendering}{StopRendering}
-\setinterfacevariable{StopSound}{FermaSuono}
-\setinterfacevariable{SubmitForm}{MandaForm}
-\setinterfacevariable{ToggleLayer}{ToggleLayer}
-\setinterfacevariable{ToggleViewer}{ScambiaVisualizzatore}
-\setinterfacevariable{URL}{URL}
-\setinterfacevariable{VideLayer}{VideLayer}
-\setinterfacevariable{ViewerHelp}{AiutoVisualizzatore}
-\setinterfacevariable{WEEKDAY}{GIORNOSETTIMANA}
-\setinterfacevariable{WORD}{PAROLA}
-\setinterfacevariable{WORDS}{PAROLE}
-\setinterfacevariable{Word}{Parola}
-\setinterfacevariable{Words}{Parole}
-\setinterfacevariable{abbreviation}{abbreviazione}
-\setinterfacevariable{abbreviations}{abbreviazioni}
-\setinterfacevariable{absolute}{assoluto}
-\setinterfacevariable{action}{azione}
-\setinterfacevariable{after}{dopo}
-\setinterfacevariable{all}{tutti}
-\setinterfacevariable{alphabetic}{alphabetic}
-\setinterfacevariable{always}{sempre}
-\setinterfacevariable{anchor}{anchor}
-\setinterfacevariable{and}{and}
-\setinterfacevariable{answerarea}{answerarea}
-\setinterfacevariable{appendices}{appendici}
-\setinterfacevariable{appendix}{appendice}
-\setinterfacevariable{april}{aprile}
-\setinterfacevariable{aside}{aside}
-\setinterfacevariable{atleftmargin}{atleftmargin}
-\setinterfacevariable{atmargin}{almargine}
-\setinterfacevariable{atpage}{apagina}
-\setinterfacevariable{atrightmargin}{atrightmargin}
-\setinterfacevariable{attachment}{attachment}
-\setinterfacevariable{august}{agosto}
-\setinterfacevariable{author}{autore}
-\setinterfacevariable{auto}{auto}
-\setinterfacevariable{autointro}{autointro}
-\setinterfacevariable{autopunctuation}{autopunctuation}
-\setinterfacevariable{back}{dietro}
-\setinterfacevariable{background}{sfondo}
-\setinterfacevariable{backmatter}{postambolo}
-\setinterfacevariable{backpart}{postfazione}
-\setinterfacevariable{backspace}{backspace}
-\setinterfacevariable{backward}{indietro}
-\setinterfacevariable{bbl}{bbl}
-\setinterfacevariable{before}{prima}
-\setinterfacevariable{begin}{begin}
-\setinterfacevariable{bib}{bib}
-\setinterfacevariable{big}{grande}
-\setinterfacevariable{bigbodyfont}{grossofontdeltesto}
-\setinterfacevariable{bigger}{bigger}
-\setinterfacevariable{bigpreference}{grandepreferenza}
-\setinterfacevariable{blank}{rigovuoto}
-\setinterfacevariable{block}{block}
-\setinterfacevariable{blockquote}{blockquote}
-\setinterfacevariable{bodymatter}{testiprincipali}
-\setinterfacevariable{bodypart}{testoprincipale}
-\setinterfacevariable{bold}{grassetto}
-\setinterfacevariable{bolditalic}{grassettocorsivo}
-\setinterfacevariable{boldslanted}{grassettoinclinato}
-\setinterfacevariable{bookmark}{segnalibro}
-\setinterfacevariable{both}{entrambi}
-\setinterfacevariable{bothtext}{bothtext}
-\setinterfacevariable{bottom}{fondo}
-\setinterfacevariable{box}{box}
-\setinterfacevariable{brief}{brief}
-\setinterfacevariable{broad}{ampio}
-\setinterfacevariable{buffer}{buffer}
-\setinterfacevariable{by}{da}
-\setinterfacevariable{calligraphic}{calligrafico}
-\setinterfacevariable{camel}{camel}
-\setinterfacevariable{cap}{cap}
-\setinterfacevariable{capital}{maiuscolo}
-\setinterfacevariable{category}{category}
-\setinterfacevariable{cd:character}{cd:character}
-\setinterfacevariable{cd:font}{cd:font}
-\setinterfacevariable{center}{center}
-\setinterfacevariable{centerlast}{centerlast}
-\setinterfacevariable{chapter}{capitolo}
-\setinterfacevariable{character}{lettera}
-\setinterfacevariable{characters}{lettere}
-\setinterfacevariable{chemical}{chemical}
-\setinterfacevariable{chemicals}{chemicals}
-\setinterfacevariable{chemistry}{chemistry}
-\setinterfacevariable{cite}{cite}
-\setinterfacevariable{closed}{closed}
-\setinterfacevariable{color}{colore}
-\setinterfacevariable{column}{colonna}
-\setinterfacevariable{columns}{colonne}
-\setinterfacevariable{combination}{combination}
-\setinterfacevariable{command}{comando}
-\setinterfacevariable{commands}{comandi}
-\setinterfacevariable{comment}{commento}
-\setinterfacevariable{component}{componente}
-\setinterfacevariable{compressseparator}{compressseparator}
-\setinterfacevariable{compressstopper}{compressstopper}
-\setinterfacevariable{concept}{concetto}
-\setinterfacevariable{construction}{construction}
-\setinterfacevariable{content}{indice}
-\setinterfacevariable{contents}{indici}
-\setinterfacevariable{continue}{continua}
-\setinterfacevariable{continued}{continued}
-\setinterfacevariable{controls}{controlli}
-\setinterfacevariable{conversion}{coversione}
-\setinterfacevariable{current}{corrente}
-\setinterfacevariable{cutspace}{cutspace}
-\setinterfacevariable{dataset}{dataset}
-\setinterfacevariable{date}{data}
-\setinterfacevariable{day}{giorno}
-\setinterfacevariable{december}{dicembre}
-\setinterfacevariable{default}{implicito}
-\setinterfacevariable{depth}{profondita}
-\setinterfacevariable{description}{descrizione}
-\setinterfacevariable{disable}{disattiva}
-\setinterfacevariable{display}{schermo}
-\setinterfacevariable{dot}{punto}
-\setinterfacevariable{doublesided}{doppiafaccia}
-\setinterfacevariable{down}{down}
-\setinterfacevariable{each}{ogni}
-\setinterfacevariable{edge}{bordo}
-\setinterfacevariable{effective}{effective}
-\setinterfacevariable{eight}{eight}
-\setinterfacevariable{embed}{embed}
-\setinterfacevariable{empty}{vuoto}
-\setinterfacevariable{enable}{enable}
-\setinterfacevariable{end}{end}
-\setinterfacevariable{endnote}{endnote}
-\setinterfacevariable{enumeration}{enumerazione}
-\setinterfacevariable{environment}{ambiente}
-\setinterfacevariable{even}{pari}
-\setinterfacevariable{export}{export}
-\setinterfacevariable{external}{esterno}
-\setinterfacevariable{extremestretch}{extremestretch}
-\setinterfacevariable{fact}{fatto}
-\setinterfacevariable{fallback}{fallback}
-\setinterfacevariable{february}{febbraio}
-\setinterfacevariable{field}{field}
-\setinterfacevariable{figure}{figura}
-\setinterfacevariable{figures}{figure}
-\setinterfacevariable{file}{file}
-\setinterfacevariable{final}{finale}
-\setinterfacevariable{first}{primo}
-\setinterfacevariable{firstcolumn}{firstcolumn}
-\setinterfacevariable{firstpage}{primapagina}
-\setinterfacevariable{firstsubpage}{primasottopagina}
-\setinterfacevariable{fit}{adatta}
-\setinterfacevariable{five}{cinque}
-\setinterfacevariable{fix}{fisso}
-\setinterfacevariable{fixed}{fisso}
-\setinterfacevariable{flexible}{flessibile}
-\setinterfacevariable{float}{oggettomobile}
-\setinterfacevariable{flushinner}{flushinner}
-\setinterfacevariable{flushleft}{flushleft}
-\setinterfacevariable{flushouter}{flushouter}
-\setinterfacevariable{flushright}{flushright}
-\setinterfacevariable{followingpage}{followingpage}
-\setinterfacevariable{font}{font}
-\setinterfacevariable{footer}{piedipagina}
-\setinterfacevariable{footnote}{notapdp}
-\setinterfacevariable{force}{forza}
-\setinterfacevariable{foreground}{foreground}
-\setinterfacevariable{formula}{formula}
-\setinterfacevariable{formulas}{formule}
-\setinterfacevariable{forward}{avanti}
-\setinterfacevariable{four}{quattro}
-\setinterfacevariable{fractions}{fractions}
-\setinterfacevariable{frame}{cornice}
-\setinterfacevariable{framedtext}{testoincorniciato}
-\setinterfacevariable{friday}{venerdi}
-\setinterfacevariable{frontmatter}{preambolo}
-\setinterfacevariable{frontpart}{prefazione}
-\setinterfacevariable{fullhz}{fullhz}
-\setinterfacevariable{global}{globale}
-\setinterfacevariable{graphic}{grafico}
-\setinterfacevariable{graphics}{grafici}
-\setinterfacevariable{gray}{grigio}
-\setinterfacevariable{greek}{greco}
-\setinterfacevariable{grid}{griglia}
-\setinterfacevariable{halfline}{mezzariga}
-\setinterfacevariable{handwritten}{grafiamanuale}
-\setinterfacevariable{hang}{sospendi}
-\setinterfacevariable{hanging}{sospeso}
-\setinterfacevariable{hangingboth}{hangingboth}
-\setinterfacevariable{head}{testa}
-\setinterfacevariable{header}{intestazione}
-\setinterfacevariable{headintext}{headintext}
-\setinterfacevariable{height}{altezza}
-\setinterfacevariable{helptext}{testoaiuto}
-\setinterfacevariable{hencefore}{precedente}
-\setinterfacevariable{here}{qui}
-\setinterfacevariable{hereafter}{seguente}
-\setinterfacevariable{hidden}{nascosto}
-\setinterfacevariable{hiddenbar}{hiddenbar}
-\setinterfacevariable{hiding}{nascondere}
-\setinterfacevariable{high}{alto}
-\setinterfacevariable{horizontal}{orizzontale}
-\setinterfacevariable{hyphenated}{sillabato}
-\setinterfacevariable{hz}{hz}
-\setinterfacevariable{inbetween}{tra}
-\setinterfacevariable{index}{indiceanalitico}
-\setinterfacevariable{indices}{indicianalitici}
-\setinterfacevariable{inherit}{inherit}
-\setinterfacevariable{ininner}{ininner}
-\setinterfacevariable{ininneredge}{ininneredge}
-\setinterfacevariable{ininnermargin}{ininnermargin}
-\setinterfacevariable{inleft}{insinistra}
-\setinterfacevariable{inleftedge}{inlatosinistro}
-\setinterfacevariable{inleftmargin}{inmarginesinistro}
-\setinterfacevariable{inline}{inline}
-\setinterfacevariable{inmargin}{inmargine}
-\setinterfacevariable{inner}{interno}
-\setinterfacevariable{inneredge}{bordointerno}
-\setinterfacevariable{innermargin}{margineinterno}
-\setinterfacevariable{inother}{inother}
-\setinterfacevariable{inouter}{inouter}
-\setinterfacevariable{inouteredge}{inouteredge}
-\setinterfacevariable{inoutermargin}{inoutermargin}
-\setinterfacevariable{inright}{indestra}
-\setinterfacevariable{inrightedge}{inlatodestro}
-\setinterfacevariable{inrightmargin}{inmarginedestro}
-\setinterfacevariable{integral}{integral}
-\setinterfacevariable{interaction}{interazione}
-\setinterfacevariable{interactionmenu}{menuinterattivo}
-\setinterfacevariable{interactive}{interactive}
-\setinterfacevariable{intermezzi}{intermezzi}
-\setinterfacevariable{intermezzo}{intermezzo}
-\setinterfacevariable{intext}{intesto}
-\setinterfacevariable{intro}{intro}
-\setinterfacevariable{invertedshort}{invertedshort}
-\setinterfacevariable{italic}{corsivo}
-\setinterfacevariable{italicbold}{corsivograssetto}
-\setinterfacevariable{item}{elemento}
-\setinterfacevariable{itemize}{elenco}
-\setinterfacevariable{its}{its}
-\setinterfacevariable{january}{gennaio}
-\setinterfacevariable{joinedup}{unito}
-\setinterfacevariable{july}{luglio}
-\setinterfacevariable{june}{giugno}
-\setinterfacevariable{keep}{mantieni}
-\setinterfacevariable{kerncharacters}{kerncharacters}
-\setinterfacevariable{knockout}{knockout}
-\setinterfacevariable{label}{etichetta}
-\setinterfacevariable{landscape}{orizzontale}
-\setinterfacevariable{last}{ultimo}
-\setinterfacevariable{lastcolumn}{lastcolumn}
-\setinterfacevariable{lastpage}{ultimapagina}
-\setinterfacevariable{lastpagenumber}{lastpagenumber}
-\setinterfacevariable{lastsubpage}{ultimasottopagina}
-\setinterfacevariable{layer}{layer}
-\setinterfacevariable{left}{sinistra}
-\setinterfacevariable{leftedge}{bordosinistro}
-\setinterfacevariable{lefthanging}{lefthanging}
-\setinterfacevariable{leftmargin}{marginesinistro}
-\setinterfacevariable{leftpage}{paginasinistra}
-\setinterfacevariable{lefttoright}{lefttoright}
-\setinterfacevariable{legend}{legenda}
-\setinterfacevariable{less}{less}
-\setinterfacevariable{lesshyphenation}{lesshyphenation}
-\setinterfacevariable{letterspacing}{letterspacing}
-\setinterfacevariable{line}{riga}
-\setinterfacevariable{linenote}{linenote}
-\setinterfacevariable{lines}{righe}
-\setinterfacevariable{linked}{linked}
-\setinterfacevariable{list}{elenco}
-\setinterfacevariable{local}{locale}
-\setinterfacevariable{localenvironment}{ambientelocale}
-\setinterfacevariable{logo}{logo}
-\setinterfacevariable{logos}{loghi}
-\setinterfacevariable{lohi}{pedap}
-\setinterfacevariable{long}{long}
-\setinterfacevariable{loose}{lento}
-\setinterfacevariable{low}{basso}
-\setinterfacevariable{ls}{ls}
-\setinterfacevariable{makeup}{makeup}
-\setinterfacevariable{mar}{mar}
-\setinterfacevariable{march}{marzo}
-\setinterfacevariable{margin}{margine}
-\setinterfacevariable{marginedge}{bordomargine}
-\setinterfacevariable{margintext}{testoinmargine}
-\setinterfacevariable{margintitle}{titoloinmargine}
-\setinterfacevariable{marking}{marcatura}
-\setinterfacevariable{math}{math}
-\setinterfacevariable{mathalignment}{mathalignment}
-\setinterfacevariable{mathcases}{mathcases}
-\setinterfacevariable{mathematics}{matematica}
-\setinterfacevariable{mathmatrix}{mathmatrix}
-\setinterfacevariable{max}{max}
-\setinterfacevariable{maxdepth}{maxdepth}
-\setinterfacevariable{maxheight}{maxheight}
-\setinterfacevariable{maxwidth}{maxwidth}
-\setinterfacevariable{may}{maggio}
-\setinterfacevariable{mediaeval}{medievale}
-\setinterfacevariable{medium}{medio}
-\setinterfacevariable{middle}{centro}
-\setinterfacevariable{min}{min}
-\setinterfacevariable{mindepth}{mindepth}
-\setinterfacevariable{minheight}{altezzamin}
-\setinterfacevariable{minwidth}{ampiezzamin}
-\setinterfacevariable{mirrored}{riflesso}
-\setinterfacevariable{mixed}{mixed}
-\setinterfacevariable{monday}{lunedi}
-\setinterfacevariable{mono}{mono}
-\setinterfacevariable{monobold}{monograssetto}
-\setinterfacevariable{mononormal}{mononormal}
-\setinterfacevariable{month}{mese}
-\setinterfacevariable{more}{more}
-\setinterfacevariable{morehyphenation}{morehyphenation}
-\setinterfacevariable{name}{nome}
-\setinterfacevariable{narrow}{stretto}
-\setinterfacevariable{negative}{negativo}
-\setinterfacevariable{never}{mai}
-\setinterfacevariable{new}{nuovo}
-\setinterfacevariable{next}{successivo}
-\setinterfacevariable{nextevenpage}{paginaparisuccessiva}
-\setinterfacevariable{nextoddpage}{paginadisparisuccessiva}
-\setinterfacevariable{nextpage}{paginasuccessiva}
-\setinterfacevariable{nextsubpage}{sottopaginasuccessiva}
-\setinterfacevariable{nine}{nine}
-\setinterfacevariable{no}{no}
-\setinterfacevariable{nocheck}{nocheck}
-\setinterfacevariable{nodepth}{nodepth}
-\setinterfacevariable{nofit}{nofit}
-\setinterfacevariable{nogrid}{nogrid}
-\setinterfacevariable{noheight}{noheight}
-\setinterfacevariable{nohz}{nohz}
-\setinterfacevariable{noline}{noline}
-\setinterfacevariable{nomarking}{nomarcature}
-\setinterfacevariable{nomenubar}{nomenubar}
-\setinterfacevariable{none}{nessuno}
-\setinterfacevariable{nonumber}{nonumber}
-\setinterfacevariable{norepeat}{norepeat}
-\setinterfacevariable{normal}{normale}
-\setinterfacevariable{normalshort}{normalshort}
-\setinterfacevariable{nospacing}{nospacing}
-\setinterfacevariable{nostopper}{nostopper}
-\setinterfacevariable{not}{non}
-\setinterfacevariable{notation}{notation}
-\setinterfacevariable{note}{note}
-\setinterfacevariable{nothanging}{nonsospeso}
-\setinterfacevariable{nothyphenated}{nonsillabato}
-\setinterfacevariable{notjoinedup}{notjoinedup}
-\setinterfacevariable{november}{novembre}
-\setinterfacevariable{nowhere}{danessunaparte}
-\setinterfacevariable{nowhite}{nobianco}
-\setinterfacevariable{number}{numero}
-\setinterfacevariable{numbers}{numeri}
-\setinterfacevariable{october}{ottobre}
-\setinterfacevariable{odd}{dispari}
-\setinterfacevariable{off}{disattivo}
-\setinterfacevariable{offset}{offset}
-\setinterfacevariable{old}{old}
-\setinterfacevariable{oldstyle}{oldstyle}
-\setinterfacevariable{on}{attivo}
-\setinterfacevariable{one}{uno}
-\setinterfacevariable{opposite}{opposto}
-\setinterfacevariable{ordinal}{ordinal}
-\setinterfacevariable{outer}{esterno}
-\setinterfacevariable{outeredge}{bordoesterno}
-\setinterfacevariable{outermargin}{margineesterno}
-\setinterfacevariable{overbar}{sopralinea}
-\setinterfacevariable{overbars}{sopralinee}
-\setinterfacevariable{overlay}{sovrapponi}
-\setinterfacevariable{overprint}{overprint}
-\setinterfacevariable{overstrike}{sbarrato}
-\setinterfacevariable{overstrikes}{sbarrati}
-\setinterfacevariable{packed}{impaccato}
-\setinterfacevariable{page}{pagina}
-\setinterfacevariable{pagecomment}{commentopagina}
-\setinterfacevariable{pagenumber}{numeropagina}
-\setinterfacevariable{paper}{carta}
-\setinterfacevariable{paragraph}{capoverso}
-\setinterfacevariable{part}{parte}
-\setinterfacevariable{positive}{positivo}
-\setinterfacevariable{postponing}{posporre}
-\setinterfacevariable{postscript}{postscript}
-\setinterfacevariable{precedingpage}{precedingpage}
-\setinterfacevariable{preference}{preferenza}
-\setinterfacevariable{preview}{anteprima}
-\setinterfacevariable{previous}{precedente}
-\setinterfacevariable{previousevenpage}{paginapariprecedente}
-\setinterfacevariable{previousoddpage}{paginadispariprecedente}
-\setinterfacevariable{previouspage}{paginaprecedente}
-\setinterfacevariable{previoussubpage}{sottopaginaprecedente}
-\setinterfacevariable{print}{print}
-\setinterfacevariable{printable}{stampabile}
-\setinterfacevariable{process}{process}
-\setinterfacevariable{product}{prodotto}
-\setinterfacevariable{program}{programma}
-\setinterfacevariable{project}{progetto}
-\setinterfacevariable{protected}{protetto}
-\setinterfacevariable{quadruple}{quadruplo}
-\setinterfacevariable{quarterline}{quarterline}
-\setinterfacevariable{quotation}{citazione}
-\setinterfacevariable{quote}{menzione}
-\setinterfacevariable{ran}{corse}
-\setinterfacevariable{random}{casuale}
-\setinterfacevariable{readonly}{solalettura}
-\setinterfacevariable{rectangular}{rettangolare}
-\setinterfacevariable{reference}{riferimento}
-\setinterfacevariable{referral}{referral}
-\setinterfacevariable{region}{region}
-\setinterfacevariable{register}{registro}
-\setinterfacevariable{regular}{regolare}
-\setinterfacevariable{relative}{relativo}
-\setinterfacevariable{repeat}{ripeti}
-\setinterfacevariable{required}{richiestp}
-\setinterfacevariable{reset}{reimposta}
-\setinterfacevariable{reverse}{invertito}
-\setinterfacevariable{right}{destra}
-\setinterfacevariable{rightedge}{bordodestro}
-\setinterfacevariable{righthanging}{righthanging}
-\setinterfacevariable{rightmargin}{marginedestro}
-\setinterfacevariable{rightpage}{paginadestra}
-\setinterfacevariable{righttoleft}{righttoleft}
-\setinterfacevariable{roman}{roman}
-\setinterfacevariable{romannumerals}{numeriromani}
-\setinterfacevariable{rotate}{ruota}
-\setinterfacevariable{rotated}{ruotato}
-\setinterfacevariable{round}{rotondo}
-\setinterfacevariable{row}{row}
-\setinterfacevariable{rule}{linea}
-\setinterfacevariable{samepage}{stessapagina}
-\setinterfacevariable{sans}{sans}
-\setinterfacevariable{sansbold}{sansgrassetto}
-\setinterfacevariable{sansnormal}{sansnormal}
-\setinterfacevariable{sansserif}{sansserif}
-\setinterfacevariable{saturday}{sabato}
-\setinterfacevariable{screen}{schermo}
-\setinterfacevariable{section}{capoverso}
-\setinterfacevariable{sectionblockenvironment}{ambientebloccosezione}
-\setinterfacevariable{sectionnumber}{numerosezione}
-\setinterfacevariable{see}{vedi}
-\setinterfacevariable{selectfont}{selectfont}
-\setinterfacevariable{separator}{separator}
-\setinterfacevariable{september}{settembre}
-\setinterfacevariable{serif}{serif}
-\setinterfacevariable{serifbold}{serifbold}
-\setinterfacevariable{serifnormal}{serifnormal}
-\setinterfacevariable{serried}{vicino}
-\setinterfacevariable{setups}{setups}
-\setinterfacevariable{seven}{seven}
-\setinterfacevariable{sheet}{sheet}
-\setinterfacevariable{shiftdown}{shiftdown}
-\setinterfacevariable{shiftup}{shiftup}
-\setinterfacevariable{short}{short}
-\setinterfacevariable{simplefonts}{simplefonts}
-\setinterfacevariable{simplelist}{simplelist}
-\setinterfacevariable{singlesided}{facciasingola}
-\setinterfacevariable{six}{six}
-\setinterfacevariable{slanted}{inclinato}
-\setinterfacevariable{slantedbold}{inclinatograssetto}
-\setinterfacevariable{small}{piccolo}
-\setinterfacevariable{smallbodyfont}{piccolofontdelcorpo}
-\setinterfacevariable{smallbold}{piccolograssetto}
-\setinterfacevariable{smallbolditalic}{piccolograssettocorsivo}
-\setinterfacevariable{smallboldslanted}{piccolograssettoinclinato}
-\setinterfacevariable{smallcaps}{maiuscoletto}
-\setinterfacevariable{smaller}{smaller}
-\setinterfacevariable{smallitalic}{piccolocorsivo}
-\setinterfacevariable{smallitalicbold}{piccolocorsivograssetto}
-\setinterfacevariable{smallnormal}{piccolonormale}
-\setinterfacevariable{smallslanted}{piccoloinclinato}
-\setinterfacevariable{smallslantedbold}{piccoloinclinatograssetto}
-\setinterfacevariable{smalltype}{piccolotype}
-\setinterfacevariable{somewhere}{daqualcheparte}
-\setinterfacevariable{sorted}{ordinato}
-\setinterfacevariable{sorting}{sorting}
-\setinterfacevariable{space}{spazio}
-\setinterfacevariable{spacing}{spaziatura}
-\setinterfacevariable{speech}{speech}
-\setinterfacevariable{split}{separa}
-\setinterfacevariable{spot}{spot}
-\setinterfacevariable{standard}{standard}
-\setinterfacevariable{start}{inizia}
-\setinterfacevariable{starter}{starter}
-\setinterfacevariable{sticker}{sticker}
-\setinterfacevariable{stop}{termina}
-\setinterfacevariable{stopper}{stopper}
-\setinterfacevariable{stretch}{dilata}
-\setinterfacevariable{stretched}{stretched}
-\setinterfacevariable{strict}{rigido}
-\setinterfacevariable{strong}{strong}
-\setinterfacevariable{strut}{strut}
-\setinterfacevariable{sub}{sotto}
-\setinterfacevariable{subbackward}{sottoindietro}
-\setinterfacevariable{subformula}{subformula}
-\setinterfacevariable{subforward}{sottoavanti}
-\setinterfacevariable{subject}{argomento}
-\setinterfacevariable{subpage}{sottopagina}
-\setinterfacevariable{subs}{subs}
-\setinterfacevariable{subsection}{sottocapoverso}
-\setinterfacevariable{subsubject}{sottoargomento}
-\setinterfacevariable{subsubsection}{sottosottocapoverso}
-\setinterfacevariable{subsubsubject}{sottosottoargomento}
-\setinterfacevariable{subsubsubsection}{sottosottosottocapoverso}
-\setinterfacevariable{subsubsubsubject}{sottosottosottoargomento}
-\setinterfacevariable{subsubsubsubsection}{sottosottosottosottocapoverso}
-\setinterfacevariable{subsubsubsubsubject}{sottosottosottosottoargomento}
-\setinterfacevariable{subsubsubsubsubsection}{sottosottosottosottosottocapoverso}
-\setinterfacevariable{subsubsubsubsubsubject}{sottosottosottosottosottoargomento}
-\setinterfacevariable{subsubsubsubsubsubsection}{sottosottosottosottosottosottocapoverso}
-\setinterfacevariable{subsubsubsubsubsubsubject}{sottosottosottosottosottosottoargomento}
-\setinterfacevariable{subsubsubsubsubsubsubsection}{sottosottosottosottosottosottosottocapoverso}
-\setinterfacevariable{subsubsubsubsubsubsubsubject}{sottosottosottosottosottosottosottoargomento}
-\setinterfacevariable{subsubsubsubsubsubsubsubsection}{sottosottosottosottosottosottosottosottocapoverso}
-\setinterfacevariable{subsubsubsubsubsubsubsubsubject}{sottosottosottosottosottosottosottosottoargomento}
-\setinterfacevariable{subsubsubsubsubsubsubsubsubsection}{sottosottosottosottosottosottosottosottosottocapoverso}
-\setinterfacevariable{subsubsubsubsubsubsubsubsubsubject}{sottosottosottosottosottosottosottosottosottoargomento}
-\setinterfacevariable{sunday}{domenica}
-\setinterfacevariable{support}{supporto}
-\setinterfacevariable{sym}{sim}
-\setinterfacevariable{symbol}{simbolo}
-\setinterfacevariable{synchronize}{synchronize}
-\setinterfacevariable{synonym}{synonym}
-\setinterfacevariable{system}{sistema}
-\setinterfacevariable{table}{tabella}
-\setinterfacevariable{tablehead}{testatabella}
-\setinterfacevariable{tables}{tabelle}
-\setinterfacevariable{tabletail}{codatabella}
-\setinterfacevariable{tabulate}{tabulato}
-\setinterfacevariable{tabulatehead}{testatabulato}
-\setinterfacevariable{tabulatetail}{codatabulato}
-\setinterfacevariable{tall}{alto}
-\setinterfacevariable{teletype}{teletype}
-\setinterfacevariable{temporary}{temporaneo}
-\setinterfacevariable{test}{test}
-\setinterfacevariable{text}{testo}
-\setinterfacevariable{textnote}{textnote}
-\setinterfacevariable{three}{tre}
-\setinterfacevariable{thursday}{giovedi}
-\setinterfacevariable{tight}{tight}
-\setinterfacevariable{title}{titolo}
-\setinterfacevariable{toggle}{toggle}
-\setinterfacevariable{tolerant}{tollerante}
-\setinterfacevariable{top}{cima}
-\setinterfacevariable{tuesday}{martedi}
-\setinterfacevariable{two}{due}
-\setinterfacevariable{txt}{txt}
-\setinterfacevariable{type}{type}
-\setinterfacevariable{typing}{typing}
-\setinterfacevariable{unavailable}{nondisponibile}
-\setinterfacevariable{underbar}{sottolinea}
-\setinterfacevariable{underbars}{sottolinee}
-\setinterfacevariable{understrike}{understrike}
-\setinterfacevariable{understrikes}{understrikes}
-\setinterfacevariable{unframed}{unframed}
-\setinterfacevariable{unicode}{unicode}
-\setinterfacevariable{unit}{unita}
-\setinterfacevariable{units}{unita}
-\setinterfacevariable{unknown}{ignoto}
-\setinterfacevariable{unpacked}{unpacked}
-\setinterfacevariable{up}{up}
-\setinterfacevariable{url}{url}
-\setinterfacevariable{used}{usato}
-\setinterfacevariable{value}{valore}
-\setinterfacevariable{vertical}{verticale}
-\setinterfacevariable{very}{molto}
-\setinterfacevariable{verystrict}{moltorigido}
-\setinterfacevariable{verytolerant}{moltotollerante}
-\setinterfacevariable{vfenced}{vfenced}
-\setinterfacevariable{vulgarfraction}{vulgarfraction}
-\setinterfacevariable{weak}{weak}
-\setinterfacevariable{wednesday}{mercoledi}
-\setinterfacevariable{week}{settimana}
-\setinterfacevariable{weekday}{giornosettimana}
-\setinterfacevariable{white}{bianco}
-\setinterfacevariable{wide}{ampio}
-\setinterfacevariable{width}{ampiezza}
-\setinterfacevariable{word}{parola}
-\setinterfacevariable{words}{words}
-\setinterfacevariable{xml}{xml}
-\setinterfacevariable{year}{anno}
-\setinterfacevariable{yes}{si}
-% definitions for interface constants for language it
-%
-\setinterfaceconstant{action}{azione}
-\setinterfaceconstant{address}{indirizzo}
-\setinterfaceconstant{after}{dopo}
-\setinterfaceconstant{afterhead}{dopotesta}
-\setinterfaceconstant{afterkey}{dopotasto}
-\setinterfaceconstant{aftersection}{aftersection}
-\setinterfaceconstant{align}{allinea}
-\setinterfaceconstant{alignbottom}{alignbottom}
-\setinterfaceconstant{aligncharacter}{allineacarattere}
-\setinterfaceconstant{alignmentcharacter}{carattereallineamento}
-\setinterfaceconstant{alignmentleftsample}{alignmentleftsample}
-\setinterfaceconstant{alignmentleftwidth}{alignmentleftwidth}
-\setinterfaceconstant{alignmentrightsample}{alignmentrightsample}
-\setinterfaceconstant{alignmentrightwidth}{alignmentrightwidth}
-\setinterfaceconstant{alignsymbol}{alignsymbol}
-\setinterfaceconstant{aligntitle}{allineatitolo}
-\setinterfaceconstant{alternative}{alternativa}
-\setinterfaceconstant{anchor}{anchor}
-\setinterfaceconstant{anchoring}{anchoring}
-\setinterfaceconstant{andtext}{andtext}
-\setinterfaceconstant{apa}{apa}
-\setinterfaceconstant{arguments}{arguments}
-\setinterfaceconstant{arrow}{freccia}
-\setinterfaceconstant{artauthor}{artauthor}
-\setinterfaceconstant{artauthoretaldisplay}{artauthoretaldisplay}
-\setinterfaceconstant{artauthoretallimit}{artauthoretallimit}
-\setinterfaceconstant{artauthoretaltext}{artauthoretaltext}
-\setinterfaceconstant{artoffset}{artoffset}
-\setinterfaceconstant{at}{ad}
-\setinterfaceconstant{author}{autore}
-\setinterfaceconstant{authorconversion}{authorconversion}
-\setinterfaceconstant{authoretaldisplay}{authoretaldisplay}
-\setinterfaceconstant{authoretallimit}{authoretallimit}
-\setinterfaceconstant{authoretaltext}{authoretaltext}
-\setinterfaceconstant{auto}{auto}
-\setinterfaceconstant{autocase}{autocase}
-\setinterfaceconstant{autofile}{autofile}
-\setinterfaceconstant{autofocus}{autofocus}
-\setinterfaceconstant{autohang}{autohang}
-\setinterfaceconstant{autostrut}{autostrut}
-\setinterfaceconstant{autowidth}{autoampiezza}
-\setinterfaceconstant{availableheight}{availableheight}
-\setinterfaceconstant{availablewidth}{availablewidth}
-\setinterfaceconstant{axis}{asse}
-\setinterfaceconstant{background}{sfondo}
-\setinterfaceconstant{backgroundcolor}{coloresfondo}
-\setinterfaceconstant{backgroundcorner}{angolosfondo}
-\setinterfaceconstant{backgrounddepth}{profonditasfondo}
-\setinterfaceconstant{backgroundoffset}{offsetsfondo}
-\setinterfaceconstant{backgroundradius}{raggiosfondo}
-\setinterfaceconstant{backgroundscreen}{schermosfondo}
-\setinterfaceconstant{backreference}{backreference}
-\setinterfaceconstant{backspace}{backspace}
-\setinterfaceconstant{balance}{bilanciamento}
-\setinterfaceconstant{before}{prima}
-\setinterfaceconstant{beforehead}{primaditesta}
-\setinterfaceconstant{beforesection}{beforesection}
-\setinterfaceconstant{bet}{bet}
-\setinterfaceconstant{bidi}{bidi}
-\setinterfaceconstant{big}{grande}
-\setinterfaceconstant{blank}{rigovuoto}
-\setinterfaceconstant{bleedoffset}{bleedoffset}
-\setinterfaceconstant{blockway}{blockway}
-\setinterfaceconstant{bodyfont}{fonttesto}
-\setinterfaceconstant{boffset}{boffset}
-\setinterfaceconstant{boldfeatures}{boldfeatures}
-\setinterfaceconstant{boldfont}{boldfont}
-\setinterfaceconstant{bolditalicfeatures}{bolditalicfeatures}
-\setinterfaceconstant{bolditalicfont}{bolditalicfont}
-\setinterfaceconstant{boldslantedfeatures}{boldslantedfeatures}
-\setinterfaceconstant{boldslantedfont}{boldslantedfont}
-\setinterfaceconstant{bookmark}{segnalibro}
-\setinterfaceconstant{bottom}{fondo}
-\setinterfaceconstant{bottomafter}{bottomafter}
-\setinterfaceconstant{bottombefore}{bottombefore}
-\setinterfaceconstant{bottomcommand}{bottomcommand}
-\setinterfaceconstant{bottomdistance}{distanzafondo}
-\setinterfaceconstant{bottomframe}{cornicefondo}
-\setinterfaceconstant{bottomoffset}{offsetfondo}
-\setinterfaceconstant{bottomspace}{spaziofondo}
-\setinterfaceconstant{bottomstate}{statofondo}
-\setinterfaceconstant{break}{break}
-\setinterfaceconstant{buffer}{buffer}
-\setinterfaceconstant{cache}{cache}
-\setinterfaceconstant{calculate}{calcola}
-\setinterfaceconstant{category}{category}
-\setinterfaceconstant{ccommand}{ccomando}
-\setinterfaceconstant{character}{character}
-\setinterfaceconstant{characters}{characters}
-\setinterfaceconstant{check}{check}
-\setinterfaceconstant{click}{click}
-\setinterfaceconstant{clickin}{clickdentro}
-\setinterfaceconstant{clickout}{clickfuori}
-\setinterfaceconstant{clipoffset}{clipoffset}
-\setinterfaceconstant{closeaction}{azionechiudi}
-\setinterfaceconstant{closecommand}{closecommand}
-\setinterfaceconstant{closepage}{closepage}
-\setinterfaceconstant{closepageaction}{azionechiudipagina}
-\setinterfaceconstant{closesymbol}{closesymbol}
-\setinterfaceconstant{color}{colore}
-\setinterfaceconstant{column}{colonna}
-\setinterfaceconstant{columndistance}{distanzacolonne}
-\setinterfaceconstant{columns}{colonne}
-\setinterfaceconstant{comma}{comma}
-\setinterfaceconstant{command}{comando}
-\setinterfaceconstant{commandafter}{comdandodopo}
-\setinterfaceconstant{commandbefore}{comandoprima}
-\setinterfaceconstant{commands}{comandi}
-\setinterfaceconstant{comment}{comment}
-\setinterfaceconstant{commentchar}{commentchar}
-\setinterfaceconstant{commentoffset}{commentoffset}
-\setinterfaceconstant{compact}{compact}
-\setinterfaceconstant{component}{component}
-\setinterfaceconstant{compoundhyphen}{compoundhyphen}
-\setinterfaceconstant{compress}{compress}
-\setinterfaceconstant{compressdistance}{compressdistance}
-\setinterfaceconstant{compressmethod}{compressmethod}
-\setinterfaceconstant{compressseparator}{compressseparator}
-\setinterfaceconstant{compressstopper}{compressstopper}
-\setinterfaceconstant{concerns}{concerns}
-\setinterfaceconstant{connector}{connector}
-\setinterfaceconstant{continue}{continua}
-\setinterfaceconstant{contrastcolor}{colorecontrasto}
-\setinterfaceconstant{controls}{controlli}
-\setinterfaceconstant{conversion}{conversione}
-\setinterfaceconstant{convertfile}{convertifile}
-\setinterfaceconstant{copies}{copies}
-\setinterfaceconstant{corner}{angolo}
-\setinterfaceconstant{coupling}{accoppiamento}
-\setinterfaceconstant{couplingway}{modoaccoppiamento}
-\setinterfaceconstant{criterium}{criterio}
-\setinterfaceconstant{cropoffset}{cropoffset}
-\setinterfaceconstant{crossreference}{crossreference}
-\setinterfaceconstant{cssfile}{cssfile}
-\setinterfaceconstant{current}{corrente}
-\setinterfaceconstant{cutspace}{cutspace}
-\setinterfaceconstant{dash}{dash}
-\setinterfaceconstant{dat}{dat}
-\setinterfaceconstant{database}{database}
-\setinterfaceconstant{dataset}{dataset}
-\setinterfaceconstant{date}{data}
-\setinterfaceconstant{deepnumbercommand}{deepnumbercommand}
-\setinterfaceconstant{deeptextcommand}{deeptextcommand}
-\setinterfaceconstant{default}{implicito}
-\setinterfaceconstant{defaultheight}{defaultheight}
-\setinterfaceconstant{defaultwidth}{defaultwidth}
-\setinterfaceconstant{define}{define}
-\setinterfaceconstant{delay}{attesa}
-\setinterfaceconstant{depth}{profondita}
-\setinterfaceconstant{depthcorrection}{correzioneprofondita}
-\setinterfaceconstant{direction}{direzione}
-\setinterfaceconstant{directory}{directory}
-\setinterfaceconstant{display}{display}
-\setinterfaceconstant{displaythreshold}{displaythreshold}
-\setinterfaceconstant{distance}{distanza}
-\setinterfaceconstant{domain}{domain}
-\setinterfaceconstant{dot}{punto}
-\setinterfaceconstant{doublesided}{doppiafaccia}
-\setinterfaceconstant{down}{down}
-\setinterfaceconstant{dummy}{dummy}
-\setinterfaceconstant{dx}{dx}
-\setinterfaceconstant{dy}{dy}
-\setinterfaceconstant{edge}{bordo}
-\setinterfaceconstant{edgedistance}{distanzabordo}
-\setinterfaceconstant{editor}{editor}
-\setinterfaceconstant{editoretaldisplay}{editoretaldisplay}
-\setinterfaceconstant{editoretallimit}{editoretallimit}
-\setinterfaceconstant{editoretaltext}{editoretaltext}
-\setinterfaceconstant{empty}{vuoto}
-\setinterfaceconstant{entities}{entities}
-\setinterfaceconstant{entries}{entries}
-\setinterfaceconstant{equalheight}{equalheight}
-\setinterfaceconstant{equalwidth}{equalwidth}
-\setinterfaceconstant{escape}{escape}
-\setinterfaceconstant{etaldisplay}{etaldisplay}
-\setinterfaceconstant{etallimit}{etallimit}
-\setinterfaceconstant{etaloption}{etaloption}
-\setinterfaceconstant{etaltext}{etaltext}
-\setinterfaceconstant{evenmargin}{marginepari}
-\setinterfaceconstant{exact}{exact}
-\setinterfaceconstant{exitoffset}{exitoffset}
-\setinterfaceconstant{expansion}{espansione}
-\setinterfaceconstant{export}{export}
-\setinterfaceconstant{extras}{extras}
-\setinterfaceconstant{factor}{fattore}
-\setinterfaceconstant{fallback}{fallback}
-\setinterfaceconstant{fallbacks}{fallbacks}
-\setinterfaceconstant{family}{famiglia}
-\setinterfaceconstant{features}{features}
-\setinterfaceconstant{featureset}{featureset}
-\setinterfaceconstant{fences}{fences}
-\setinterfaceconstant{field}{field}
-\setinterfaceconstant{fieldbackgroundcolor}{coloresfondocampo}
-\setinterfaceconstant{fieldframecolor}{colorecornicecampo}
-\setinterfaceconstant{fieldlayer}{fieldlayer}
-\setinterfaceconstant{fieldoffset}{offsetcampo}
-\setinterfaceconstant{file}{file}
-\setinterfaceconstant{filler}{filler}
-\setinterfaceconstant{filter}{filter}
-\setinterfaceconstant{filtercommand}{filtercommand}
-\setinterfaceconstant{finalnamesep}{finalnamesep}
-\setinterfaceconstant{finalpagesep}{finalpagesep}
-\setinterfaceconstant{finalpubsep}{finalpubsep}
-\setinterfaceconstant{first}{primo}
-\setinterfaceconstant{firstnamesep}{firstnamesep}
-\setinterfaceconstant{firstpage}{primapagina}
-\setinterfaceconstant{focus}{focus}
-\setinterfaceconstant{focusin}{focusin}
-\setinterfaceconstant{focusoffset}{focusoffset}
-\setinterfaceconstant{focusout}{focusout}
-\setinterfaceconstant{font}{font}
-\setinterfaceconstant{footer}{piedipagina}
-\setinterfaceconstant{footerdistance}{distanzapdp}
-\setinterfaceconstant{footerstate}{statopdp}
-\setinterfaceconstant{force}{forza}
-\setinterfaceconstant{foregroundcolor}{coloreprimopiano}
-\setinterfaceconstant{foregroundstyle}{foregroundstyle}
-\setinterfaceconstant{format}{format}
-\setinterfaceconstant{fractions}{fractions}
-\setinterfaceconstant{frame}{cornice}
-\setinterfaceconstant{framecolor}{colorecornice}
-\setinterfaceconstant{framecorner}{angolocornice}
-\setinterfaceconstant{framedepth}{profonditacornice}
-\setinterfaceconstant{frameoffset}{offsetcornice}
-\setinterfaceconstant{frameradius}{raggiocornice}
-\setinterfaceconstant{frames}{cornici}
-\setinterfaceconstant{freeregion}{freeregion}
-\setinterfaceconstant{from}{da}
-\setinterfaceconstant{functioncolor}{functioncolor}
-\setinterfaceconstant{functionstyle}{functionstyle}
-\setinterfaceconstant{get}{prendi}
-\setinterfaceconstant{global}{globale}
-\setinterfaceconstant{goodies}{goodies}
-\setinterfaceconstant{grid}{griglia}
-\setinterfaceconstant{group}{group}
-\setinterfaceconstant{groupsuffix}{groupsuffix}
-\setinterfaceconstant{hang}{sospendi}
-\setinterfaceconstant{hcompact}{hcompact}
-\setinterfaceconstant{headalign}{headalign}
-\setinterfaceconstant{headcolor}{coloretesta}
-\setinterfaceconstant{headcommand}{headcommand}
-\setinterfaceconstant{headconversion}{conversionetesta}
-\setinterfaceconstant{header}{intestazione}
-\setinterfaceconstant{headerdistance}{distanzaintestazione}
-\setinterfaceconstant{headerstate}{statointestazione}
-\setinterfaceconstant{headlabel}{etichettatesta}
-\setinterfaceconstant{headnumber}{numerotesta}
-\setinterfaceconstant{headseparator}{headseparator}
-\setinterfaceconstant{headstyle}{stiletesta}
-\setinterfaceconstant{height}{altezza}
-\setinterfaceconstant{hfactor}{hfactor}
-\setinterfaceconstant{hfil}{hfil}
-\setinterfaceconstant{hidenumber}{hidenumber}
-\setinterfaceconstant{hoffset}{hoffset}
-\setinterfaceconstant{horizontal}{orizzontale}
-\setinterfaceconstant{horoffset}{horoffset}
-\setinterfaceconstant{hyphen}{hyphen}
-\setinterfaceconstant{hyphens}{hyphens}
-\setinterfaceconstant{icommand}{icomando}
-\setinterfaceconstant{ignore}{ignore}
-\setinterfaceconstant{in}{in}
-\setinterfaceconstant{inbetween}{tra}
-\setinterfaceconstant{increment}{incremento}
-\setinterfaceconstant{incrementnumber}{incrementanumero}
-\setinterfaceconstant{indenting}{rientro}
-\setinterfaceconstant{indentlist}{indentlist}
-\setinterfaceconstant{indentnext}{rientrasuccessivo}
-\setinterfaceconstant{index}{index}
-\setinterfaceconstant{indicator}{indicatore}
-\setinterfaceconstant{initialsep}{initialsep}
-\setinterfaceconstant{inlinethreshold}{inlinethreshold}
-\setinterfaceconstant{inner}{interno}
-\setinterfaceconstant{innermargin}{margineinterno}
-\setinterfaceconstant{inputfile}{inputfile}
-\setinterfaceconstant{insidesection}{insidesection}
-\setinterfaceconstant{instance}{instance}
-\setinterfaceconstant{intent}{intent}
-\setinterfaceconstant{interaction}{interazione}
-\setinterfaceconstant{interlinespace}{interlinea}
-\setinterfaceconstant{internalgrid}{internalgrid}
-\setinterfaceconstant{italicfeatures}{italicfeatures}
-\setinterfaceconstant{italicfont}{italicfont}
-\setinterfaceconstant{itemalign}{itemalign}
-\setinterfaceconstant{items}{elementi}
-\setinterfaceconstant{joiners}{joiners}
-\setinterfaceconstant{journalconversion}{journalconversion}
-\setinterfaceconstant{juniorsep}{juniorsep}
-\setinterfaceconstant{keeptogether}{keeptogether}
-\setinterfaceconstant{ken}{ken}
-\setinterfaceconstant{keyexpansion}{keyexpansion}
-\setinterfaceconstant{keys}{keys}
-\setinterfaceconstant{keyword}{parolachiave}
-\setinterfaceconstant{label}{etichetta}
-\setinterfaceconstant{labelalternative}{labelalternative}
-\setinterfaceconstant{labelcolor}{labelcolor}
-\setinterfaceconstant{labeloffset}{labeloffset}
-\setinterfaceconstant{labelstyle}{labelstyle}
-\setinterfaceconstant{language}{language}
-\setinterfaceconstant{last}{last}
-\setinterfaceconstant{lastnamesep}{lastnamesep}
-\setinterfaceconstant{lastpage}{ultimapagina}
-\setinterfaceconstant{lastpagesep}{lastpagesep}
-\setinterfaceconstant{lastpubsep}{lastpubsep}
-\setinterfaceconstant{layout}{layout}
-\setinterfaceconstant{left}{sinistra}
-\setinterfaceconstant{leftcolor}{coloresinistra}
-\setinterfaceconstant{leftcompoundhyphen}{leftcompoundhyphen}
-\setinterfaceconstant{leftedge}{bordosinistro}
-\setinterfaceconstant{leftedgedistance}{distanzabordosinistro}
-\setinterfaceconstant{leftframe}{cornicesinistra}
-\setinterfaceconstant{lefthyphen}{lefthyphen}
-\setinterfaceconstant{leftmargin}{marginesinistro}
-\setinterfaceconstant{leftmargindistance}{distanzamarginesinistro}
-\setinterfaceconstant{leftoffset}{offsetsinistro}
-\setinterfaceconstant{leftquotation}{citazionesinistra}
-\setinterfaceconstant{leftquote}{menzionesinistra}
-\setinterfaceconstant{leftsample}{leftsample}
-\setinterfaceconstant{leftsentence}{frasesinistra}
-\setinterfaceconstant{leftspeech}{leftspeech}
-\setinterfaceconstant{leftstyle}{stilesinistra}
-\setinterfaceconstant{leftsubsentence}{sottofrasesinistra}
-\setinterfaceconstant{lefttext}{testosinistro}
-\setinterfaceconstant{leftwidth}{ampiezzasinistra}
-\setinterfaceconstant{leftwords}{leftwords}
-\setinterfaceconstant{less}{less}
-\setinterfaceconstant{level}{livello}
-\setinterfaceconstant{levels}{livelli}
-\setinterfaceconstant{limittext}{limittext}
-\setinterfaceconstant{line}{riga}
-\setinterfaceconstant{linecorrection}{correzioneriga}
-\setinterfaceconstant{linedirection}{linedirection}
-\setinterfaceconstant{lines}{righe}
-\setinterfaceconstant{list}{elenco}
-\setinterfaceconstant{listtext}{listtext}
-\setinterfaceconstant{local}{locale}
-\setinterfaceconstant{location}{luogo}
-\setinterfaceconstant{loffset}{loffset}
-\setinterfaceconstant{logo}{logo}
-\setinterfaceconstant{logos}{loghi}
-\setinterfaceconstant{marcolor}{coloremarcatura}
-\setinterfaceconstant{margin}{margine}
-\setinterfaceconstant{margindistance}{distanzamargine}
-\setinterfaceconstant{marginedge}{bordomargine}
-\setinterfaceconstant{marginedgetext}{testobordomargine}
-\setinterfaceconstant{margintext}{testomargine}
-\setinterfaceconstant{mark}{mark}
-\setinterfaceconstant{marking}{marcatura}
-\setinterfaceconstant{marstyle}{stilemarcatura}
-\setinterfaceconstant{mask}{mask}
-\setinterfaceconstant{mathclass}{mathclass}
-\setinterfaceconstant{mathlimits}{mathlimits}
-\setinterfaceconstant{mathstyle}{mathstyle}
-\setinterfaceconstant{max}{max}
-\setinterfaceconstant{maxdepth}{maxdepth}
-\setinterfaceconstant{maxheight}{altezzamax}
-\setinterfaceconstant{maxwidth}{ampiezzamax}
-\setinterfaceconstant{maybeyear}{maybeyear}
-\setinterfaceconstant{menu}{menu}
-\setinterfaceconstant{method}{metodo}
-\setinterfaceconstant{middle}{centro}
-\setinterfaceconstant{middlecolor}{middlecolor}
-\setinterfaceconstant{middlecommand}{middlecommand}
-\setinterfaceconstant{middlespeech}{middlespeech}
-\setinterfaceconstant{middlestyle}{middlestyle}
-\setinterfaceconstant{middletext}{testocentro}
-\setinterfaceconstant{middlewidth}{middlewidth}
-\setinterfaceconstant{midsentence}{midsentence}
-\setinterfaceconstant{min}{min}
-\setinterfaceconstant{mindepth}{mindepth}
-\setinterfaceconstant{minheight}{altezzamin}
-\setinterfaceconstant{minwidth}{ampiezzamin}
-\setinterfaceconstant{moffset}{moffset}
-\setinterfaceconstant{monthconversion}{monthconversion}
-\setinterfaceconstant{more}{more}
-\setinterfaceconstant{mpdepth}{mpdepth}
-\setinterfaceconstant{mpheight}{mpheight}
-\setinterfaceconstant{mpoffset}{mpoffset}
-\setinterfaceconstant{mpwidth}{mpwidth}
-\setinterfaceconstant{n}{n}
-\setinterfaceconstant{name}{nome}
-\setinterfaceconstant{namesep}{namesep}
-\setinterfaceconstant{nbottom}{nfondo}
-\setinterfaceconstant{nc}{nc}
-\setinterfaceconstant{next}{successivo}
-\setinterfaceconstant{nextleft}{nextleft}
-\setinterfaceconstant{nextleftquotation}{nextleftquotation}
-\setinterfaceconstant{nextright}{nextright}
-\setinterfaceconstant{nextrightquotation}{nextrightquotation}
-\setinterfaceconstant{nl}{nl}
-\setinterfaceconstant{nleft}{nsinistra}
-\setinterfaceconstant{nlines}{nrighe}
-\setinterfaceconstant{norm}{norma}
-\setinterfaceconstant{note}{note}
-\setinterfaceconstant{notes}{notes}
-\setinterfaceconstant{nr}{nr}
-\setinterfaceconstant{nright}{ndestra}
-\setinterfaceconstant{ntop}{ncima}
-\setinterfaceconstant{number}{numero}
-\setinterfaceconstant{numberalign}{numberalign}
-\setinterfaceconstant{numbercolor}{colorenumero}
-\setinterfaceconstant{numbercommand}{comandonumero}
-\setinterfaceconstant{numberconversion}{numberconversion}
-\setinterfaceconstant{numberconversionset}{numberconversionset}
-\setinterfaceconstant{numberdistance}{numberdistance}
-\setinterfaceconstant{numbering}{numerazione}
-\setinterfaceconstant{numberorder}{numberorder}
-\setinterfaceconstant{numberprefix}{numberprefix}
-\setinterfaceconstant{numbersegments}{numbersegments}
-\setinterfaceconstant{numberseparator}{separatorenumero}
-\setinterfaceconstant{numberseparatorset}{numberseparatorset}
-\setinterfaceconstant{numberset}{numberset}
-\setinterfaceconstant{numberstarter}{numberstarter}
-\setinterfaceconstant{numberstopper}{numberstopper}
-\setinterfaceconstant{numberstrut}{numberstrut}
-\setinterfaceconstant{numberstyle}{stilenumero}
-\setinterfaceconstant{numberwidth}{numberwidth}
-\setinterfaceconstant{nx}{nx}
-\setinterfaceconstant{ny}{ny}
-\setinterfaceconstant{object}{oggetto}
-\setinterfaceconstant{obstruction}{ostruzione}
-\setinterfaceconstant{oddmargin}{marginedispari}
-\setinterfaceconstant{offset}{offset}
-\setinterfaceconstant{openaction}{azioneapri}
-\setinterfaceconstant{openpage}{openpage}
-\setinterfaceconstant{openpageaction}{azioneapripagina}
-\setinterfaceconstant{openup}{openup}
-\setinterfaceconstant{opticalsize}{opticalsize}
-\setinterfaceconstant{option}{opzione}
-\setinterfaceconstant{order}{order}
-\setinterfaceconstant{orientation}{orientation}
-\setinterfaceconstant{otherstext}{otherstext}
-\setinterfaceconstant{outermargin}{margineesterno}
-\setinterfaceconstant{overprint}{overprint}
-\setinterfaceconstant{ownerpassword}{ownerpassword}
-\setinterfaceconstant{ownnumber}{numeroproprio}
-\setinterfaceconstant{packcriterium}{packcriterium}
-\setinterfaceconstant{page}{pagina}
-\setinterfaceconstant{pageboundaries}{limitipagina}
-\setinterfaceconstant{pagecolor}{colorepagina}
-\setinterfaceconstant{pagecolormodel}{pagecolormodel}
-\setinterfaceconstant{pagecommand}{comandopagina}
-\setinterfaceconstant{pageconnector}{pageconnector}
-\setinterfaceconstant{pageconversion}{pageconversion}
-\setinterfaceconstant{pageconversionset}{pageconversionset}
-\setinterfaceconstant{pageleft}{pageleft}
-\setinterfaceconstant{pagemethod}{pagemethod}
-\setinterfaceconstant{pagenumber}{numeropagina}
-\setinterfaceconstant{pageprefix}{pageprefix}
-\setinterfaceconstant{pageprefixconnector}{pageprefixconnector}
-\setinterfaceconstant{pageprefixconversion}{pageprefixconversion}
-\setinterfaceconstant{pageprefixconversionset}{pageprefixconversionset}
-\setinterfaceconstant{pageprefixsegments}{pageprefixsegments}
-\setinterfaceconstant{pageprefixseparatorset}{pageprefixseparatorset}
-\setinterfaceconstant{pageprefixset}{pageprefixset}
-\setinterfaceconstant{pageprefixstarter}{pageprefixstarter}
-\setinterfaceconstant{pageprefixstopper}{pageprefixstopper}
-\setinterfaceconstant{pageright}{pageright}
-\setinterfaceconstant{pagesegments}{pagesegments}
-\setinterfaceconstant{pagesep}{pagesep}
-\setinterfaceconstant{pageseparatorset}{pageseparatorset}
-\setinterfaceconstant{pageset}{pageset}
-\setinterfaceconstant{pagestarter}{pagestarter}
-\setinterfaceconstant{pagestate}{statopagina}
-\setinterfaceconstant{pagestopper}{pagestopper}
-\setinterfaceconstant{pagestyle}{stilepagina}
-\setinterfaceconstant{palet}{tavolozza}
-\setinterfaceconstant{paper}{carta}
-\setinterfaceconstant{paragraph}{capoverso}
-\setinterfaceconstant{period}{period}
-\setinterfaceconstant{place}{metti}
-\setinterfaceconstant{placehead}{mettitesta}
-\setinterfaceconstant{placeholder}{placeholder}
-\setinterfaceconstant{placestopper}{mettistopper}
-\setinterfaceconstant{position}{posizione}
-\setinterfaceconstant{prefix}{prefisso}
-\setinterfaceconstant{prefixconnector}{prefixconnector}
-\setinterfaceconstant{prefixconversion}{prefixconversion}
-\setinterfaceconstant{prefixconversionset}{prefixconversionset}
-\setinterfaceconstant{prefixsegments}{prefixsegments}
-\setinterfaceconstant{prefixseparatorset}{prefixseparatorset}
-\setinterfaceconstant{prefixset}{prefixset}
-\setinterfaceconstant{prefixstarter}{prefixstarter}
-\setinterfaceconstant{prefixstopper}{prefixstopper}
-\setinterfaceconstant{preset}{preimpostato}
-\setinterfaceconstant{preview}{anteprima}
-\setinterfaceconstant{previous}{precedente}
-\setinterfaceconstant{previousnumber}{numeroprecedente}
-\setinterfaceconstant{print}{print}
-\setinterfaceconstant{printable}{stampabile}
-\setinterfaceconstant{process}{process}
-\setinterfaceconstant{processors}{processors}
-\setinterfaceconstant{profile}{profile}
-\setinterfaceconstant{properties}{properties}
-\setinterfaceconstant{pubsep}{pubsep}
-\setinterfaceconstant{quotechar}{quotechar}
-\setinterfaceconstant{radius}{raggio}
-\setinterfaceconstant{random}{casuale}
-\setinterfaceconstant{range}{range}
-\setinterfaceconstant{reduction}{riduzione}
-\setinterfaceconstant{ref}{ref}
-\setinterfaceconstant{refcommand}{refcommand}
-\setinterfaceconstant{reference}{riferimento}
-\setinterfaceconstant{referencemethod}{referencemethod}
-\setinterfaceconstant{referenceprefix}{referenceprefix}
-\setinterfaceconstant{referencetext}{referencetext}
-\setinterfaceconstant{referencing}{referencing}
-\setinterfaceconstant{region}{region}
-\setinterfaceconstant{regionin}{entraregione}
-\setinterfaceconstant{regionout}{esciregione}
-\setinterfaceconstant{register}{register}
-\setinterfaceconstant{regularfeatures}{regularfeatures}
-\setinterfaceconstant{regularfont}{regularfont}
-\setinterfaceconstant{renderingsetup}{renderingsetup}
-\setinterfaceconstant{repeat}{ripeti}
-\setinterfaceconstant{reset}{reset}
-\setinterfaceconstant{resetnumber}{resetnumber}
-\setinterfaceconstant{resolution}{risoluzione}
-\setinterfaceconstant{resources}{resources}
-\setinterfaceconstant{reverse}{invertito}
-\setinterfaceconstant{right}{destra}
-\setinterfaceconstant{rightchars}{rightchars}
-\setinterfaceconstant{rightcolor}{coloredestra}
-\setinterfaceconstant{rightcompoundhyphen}{rightcompoundhyphen}
-\setinterfaceconstant{rightedge}{bordodestro}
-\setinterfaceconstant{rightedgedistance}{distanzabordodestro}
-\setinterfaceconstant{rightframe}{cornicedestra}
-\setinterfaceconstant{righthyphen}{righthyphen}
-\setinterfaceconstant{rightmargin}{marginedestro}
-\setinterfaceconstant{rightmargindistance}{distanzamarginedestro}
-\setinterfaceconstant{rightoffset}{offsetdestro}
-\setinterfaceconstant{rightquotation}{citazionedestra}
-\setinterfaceconstant{rightquote}{menzionedestra}
-\setinterfaceconstant{rightsample}{rightsample}
-\setinterfaceconstant{rightsentence}{frasedestra}
-\setinterfaceconstant{rightspeech}{rightspeech}
-\setinterfaceconstant{rightstyle}{stiledestra}
-\setinterfaceconstant{rightsubsentence}{sottofrasedestra}
-\setinterfaceconstant{righttext}{testodestro}
-\setinterfaceconstant{rightwidth}{ampiezzadestra}
-\setinterfaceconstant{rightwords}{rightwords}
-\setinterfaceconstant{roffset}{roffset}
-\setinterfaceconstant{rotation}{rotazione}
-\setinterfaceconstant{rule}{linea}
-\setinterfaceconstant{rulecolor}{colorelinea}
-\setinterfaceconstant{rulecommand}{rulecommand}
-\setinterfaceconstant{rulethickness}{spessorelinea}
-\setinterfaceconstant{samepage}{stessapagina}
-\setinterfaceconstant{sample}{campione}
-\setinterfaceconstant{samplesize}{samplesize}
-\setinterfaceconstant{saveinlist}{saveinlist}
-\setinterfaceconstant{scale}{scala}
-\setinterfaceconstant{scope}{scope}
-\setinterfaceconstant{screen}{schermo}
-\setinterfaceconstant{section}{sezione}
-\setinterfaceconstant{sectionblock}{sectionblock}
-\setinterfaceconstant{sectionconversion}{sectionconversion}
-\setinterfaceconstant{sectionconversionset}{sectionconversionset}
-\setinterfaceconstant{sectionnumber}{numerosezione}
-\setinterfaceconstant{sectionresetset}{sectionresetset}
-\setinterfaceconstant{sectionsegments}{sectionsegments}
-\setinterfaceconstant{sectionseparatorset}{sectionseparatorset}
-\setinterfaceconstant{sectionset}{sectionset}
-\setinterfaceconstant{sectionstarter}{sectionstarter}
-\setinterfaceconstant{sectionstopper}{sectionstopper}
-\setinterfaceconstant{separator}{separatore}
-\setinterfaceconstant{separatorcolor}{separatorcolor}
-\setinterfaceconstant{separatorstyle}{separatorstyle}
-\setinterfaceconstant{set}{set}
-\setinterfaceconstant{setups}{setups}
-\setinterfaceconstant{shrink}{shrink}
-\setinterfaceconstant{side}{lato}
-\setinterfaceconstant{sidealign}{sidealign}
-\setinterfaceconstant{sidemethod}{sidemethod}
-\setinterfaceconstant{sidespaceafter}{spaziolateraledopo}
-\setinterfaceconstant{sidespacebefore}{spaziolateraleprima}
-\setinterfaceconstant{sidespaceinbetween}{sidespaceinbetween}
-\setinterfaceconstant{sidethreshold}{sidethreshold}
-\setinterfaceconstant{sign}{segno}
-\setinterfaceconstant{simplecommand}{simplecommand}
-\setinterfaceconstant{size}{dimensione}
-\setinterfaceconstant{slantedfeatures}{slantedfeatures}
-\setinterfaceconstant{slantedfont}{slantedfont}
-\setinterfaceconstant{small}{piccolo}
-\setinterfaceconstant{smallcapsfeatures}{smallcapsfeatures}
-\setinterfaceconstant{smallcapsfont}{smallcapsfont}
-\setinterfaceconstant{solution}{solution}
-\setinterfaceconstant{sort}{sort}
-\setinterfaceconstant{sorttype}{sorttype}
-\setinterfaceconstant{source}{origine}
-\setinterfaceconstant{space}{spazio}
-\setinterfaceconstant{spaceafter}{spaziodopo}
-\setinterfaceconstant{spaceafterside}{spaceafterside}
-\setinterfaceconstant{spacebefore}{spazioprima}
-\setinterfaceconstant{spacebeforeside}{spacebeforeside}
-\setinterfaceconstant{spaceinbetween}{spaceinbetween}
-\setinterfaceconstant{spacing}{spaziatura}
-\setinterfaceconstant{specification}{specification}
-\setinterfaceconstant{split}{separa}
-\setinterfaceconstant{splitcolor}{splitcolor}
-\setinterfaceconstant{splitmethod}{splitmethod}
-\setinterfaceconstant{splitoffset}{splitoffset}
-\setinterfaceconstant{spot}{spot}
-\setinterfaceconstant{stack}{stack}
-\setinterfaceconstant{stackname}{stackname}
-\setinterfaceconstant{start}{inizia}
-\setinterfaceconstant{starter}{starter}
-\setinterfaceconstant{state}{stato}
-\setinterfaceconstant{step}{passo}
-\setinterfaceconstant{stop}{termina}
-\setinterfaceconstant{stopper}{stopper}
-\setinterfaceconstant{stretch}{dilata}
-\setinterfaceconstant{strip}{strip}
-\setinterfaceconstant{strut}{strut}
-\setinterfaceconstant{style}{stile}
-\setinterfaceconstant{stylealternative}{stylealternative}
-\setinterfaceconstant{sub}{sotto}
-\setinterfaceconstant{subtitle}{sottotitolo}
-\setinterfaceconstant{suffix}{suffix}
-\setinterfaceconstant{suffixseparator}{suffixseparator}
-\setinterfaceconstant{suffixstopper}{suffixstopper}
-\setinterfaceconstant{surnamefirstnamesep}{surnamefirstnamesep}
-\setinterfaceconstant{surnameinitialsep}{surnameinitialsep}
-\setinterfaceconstant{surnamesep}{surnamesep}
-\setinterfaceconstant{svgstyle}{svgstyle}
-\setinterfaceconstant{sx}{sx}
-\setinterfaceconstant{sy}{sy}
-\setinterfaceconstant{symalign}{symallinea}
-\setinterfaceconstant{symbol}{simbolo}
-\setinterfaceconstant{symbolcommand}{symbolcommand}
-\setinterfaceconstant{symbolset}{setsimboli}
-\setinterfaceconstant{symcolor}{coloresimbolo}
-\setinterfaceconstant{symstyle}{stilesimbolo}
-\setinterfaceconstant{synonym}{sinonimo}
-\setinterfaceconstant{synonymcolor}{coloresinonimi}
-\setinterfaceconstant{synonymcommand}{synonymcommand}
-\setinterfaceconstant{synonymstyle}{stilesinonimi}
-\setinterfaceconstant{tab}{tab}
-\setinterfaceconstant{text}{testo}
-\setinterfaceconstant{textalign}{textalign}
-\setinterfaceconstant{textcolor}{coloretesto}
-\setinterfaceconstant{textcommand}{comandotesto}
-\setinterfaceconstant{textdistance}{distanzatesto}
-\setinterfaceconstant{textheight}{altezzatesto}
-\setinterfaceconstant{textlayer}{textlayer}
-\setinterfaceconstant{textmargin}{textmargin}
-\setinterfaceconstant{textmethod}{textmethod}
-\setinterfaceconstant{textseparator}{separatoretesto}
-\setinterfaceconstant{textsize}{dimensionetesto}
-\setinterfaceconstant{textstate}{statotesto}
-\setinterfaceconstant{textstyle}{stiletesto}
-\setinterfaceconstant{textwidth}{ampiezzatesto}
-\setinterfaceconstant{threshold}{threshold}
-\setinterfaceconstant{time}{time}
-\setinterfaceconstant{title}{titolo}
-\setinterfaceconstant{titlecolor}{coloretitolo}
-\setinterfaceconstant{titlecommand}{titlecommand}
-\setinterfaceconstant{titledistance}{distanzatitolo}
-\setinterfaceconstant{titleleft}{titleleft}
-\setinterfaceconstant{titleright}{titleright}
-\setinterfaceconstant{titlestrut}{titlestrut}
-\setinterfaceconstant{titlestyle}{stiletitolo}
-\setinterfaceconstant{to}{verso}
-\setinterfaceconstant{toffset}{toffset}
-\setinterfaceconstant{tolerance}{tolleranza}
-\setinterfaceconstant{top}{cima}
-\setinterfaceconstant{topcommand}{topcommand}
-\setinterfaceconstant{topdistance}{distanzacima}
-\setinterfaceconstant{topframe}{cornicecima}
-\setinterfaceconstant{topoffset}{offsetcima}
-\setinterfaceconstant{topspace}{spaziocima}
-\setinterfaceconstant{topstate}{statocima}
-\setinterfaceconstant{totalnumber}{totalnumber}
-\setinterfaceconstant{transform}{transform}
-\setinterfaceconstant{translate}{translate}
-\setinterfaceconstant{trimoffset}{trimoffset}
-\setinterfaceconstant{type}{type}
-\setinterfaceconstant{unit}{unita}
-\setinterfaceconstant{unknownreference}{riferimentoingoto}
-\setinterfaceconstant{up}{up}
-\setinterfaceconstant{urlalternative}{alternativaurl}
-\setinterfaceconstant{urlspace}{spaziourl}
-\setinterfaceconstant{userpassword}{userpassword}
-\setinterfaceconstant{validate}{verifica}
-\setinterfaceconstant{values}{values}
-\setinterfaceconstant{vcommand}{vcomando}
-\setinterfaceconstant{vcompact}{vcompact}
-\setinterfaceconstant{vector}{vector}
-\setinterfaceconstant{veroffset}{veroffset}
-\setinterfaceconstant{vertical}{verticale}
-\setinterfaceconstant{vfactor}{vfactor}
-\setinterfaceconstant{vfil}{vfil}
-\setinterfaceconstant{viewerprefix}{viewerprefix}
-\setinterfaceconstant{voffset}{voffset}
-\setinterfaceconstant{vonsep}{vonsep}
-\setinterfaceconstant{way}{modo}
-\setinterfaceconstant{wfactor}{wfactor}
-\setinterfaceconstant{white}{bianco}
-\setinterfaceconstant{width}{ampiezza}
-\setinterfaceconstant{words}{words}
-\setinterfaceconstant{xanchor}{xanchor}
-\setinterfaceconstant{xfactor}{xfactor}
-\setinterfaceconstant{xhtml}{xhtml}
-\setinterfaceconstant{xmax}{xmax}
-\setinterfaceconstant{xmlsetup}{xmlsetup}
-\setinterfaceconstant{xoffset}{xoffset}
-\setinterfaceconstant{xscale}{xscale}
-\setinterfaceconstant{xstep}{xstep}
-\setinterfaceconstant{yanchor}{yanchor}
-\setinterfaceconstant{yfactor}{yfactor}
-\setinterfaceconstant{ymax}{ymax}
-\setinterfaceconstant{yoffset}{yoffset}
-\setinterfaceconstant{yscale}{yscale}
-\setinterfaceconstant{ystep}{ystep}
-% definitions for interface elements for language it
-%
-\setinterfaceelement{answerlines}{answerlines}
-\setinterfaceelement{answerspace}{answerspace}
-\setinterfaceelement{begin}{inizio}
-\setinterfaceelement{complete}{completo}
-\setinterfaceelement{coupled}{accoppiato}
-\setinterfaceelement{currentlocal}{correntelocale}
-\setinterfaceelement{end}{fine}
-\setinterfaceelement{endsetup}{}
-\setinterfaceelement{get}{prendi}
-\setinterfaceelement{increment}{incrementa}
-\setinterfaceelement{list}{elenco}
-\setinterfaceelement{listof}{elencodi}
-\setinterfaceelement{load}{carica}
-\setinterfaceelement{local}{locale}
-\setinterfaceelement{makeup}{makeup}
-\setinterfaceelement{next}{successivo}
-\setinterfaceelement{place}{metti}
-\setinterfaceelement{previous}{precedente}
-\setinterfaceelement{previouslocal}{precedentelocale}
-\setinterfaceelement{reserve}{riserva}
-\setinterfaceelement{see}{vedi}
-\setinterfaceelement{setup}{imposta}
-\setinterfaceelement{start}{inizia}
-\setinterfaceelement{stop}{termina}
-\setinterfaceelement{text}{testo}
-\setinterfaceelement{type}{type}
-% definitions for interface commands for language it
-%
-\setinterfacecommand{Character}{Lettera}
-\setinterfacecommand{Characters}{Lettere}
-\setinterfacecommand{MONTH}{MESE}
-\setinterfacecommand{Numbers}{Numeri}
-\setinterfacecommand{Romannumerals}{Numeriromani}
-\setinterfacecommand{SmallCapped}{Cap}
-\setinterfacecommand{SmallCaps}{Caps}
-\setinterfacecommand{WEEKDAY}{GIORNOSETTIMANA}
-\setinterfacecommand{WORD}{PAROLA}
-\setinterfacecommand{WORDS}{PAROLE}
-\setinterfacecommand{Word}{Parola}
-\setinterfacecommand{Words}{Parole}
-\setinterfacecommand{about}{intorno}
-\setinterfacecommand{adaptfontfeature}{adaptfontfeature}
-\setinterfacecommand{adaptlayout}{adattalayout}
-\setinterfacecommand{addfeature}{addfeature}
-\setinterfacecommand{alignbottom}{alignbottom}
-\setinterfacecommand{aligned}{aligned}
-\setinterfacecommand{alignedbox}{alignedbox}
-\setinterfacecommand{alignedline}{alignedline}
-\setinterfacecommand{alignhere}{alignhere}
-\setinterfacecommand{alignment}{alignment}
-\setinterfacecommand{alignmentcharacter}{alignmentcharacter}
-\setinterfacecommand{applytocharacters}{applytocharacters}
-\setinterfacecommand{applytofirstcharacter}{applytofirstcharacter}
-\setinterfacecommand{arg}{arg}
-\setinterfacecommand{at}{al}
-\setinterfacecommand{atleftmargin}{atleftmargin}
-\setinterfacecommand{atpage}{apagina}
-\setinterfacecommand{atrightmargin}{atrightmargin}
-\setinterfacecommand{background}{sfondo}
-\setinterfacecommand{backspace}{spaziodietro}
-\setinterfacecommand{blackrule}{lineanera}
-\setinterfacecommand{blackrules}{lineenere}
-\setinterfacecommand{blank}{rigovuoto}
-\setinterfacecommand{bookmark}{segnalibro}
-\setinterfacecommand{bottombox}{bottombox}
-\setinterfacecommand{bottomdistance}{distanzafondo}
-\setinterfacecommand{bottomheight}{altezzafondo}
-\setinterfacecommand{bottomleftbox}{bottomleftbox}
-\setinterfacecommand{bottomrightbox}{bottomrightbox}
-\setinterfacecommand{bottomspace}{spaziofondo}
-\setinterfacecommand{buildtextbottomdot}{buildtextbottomdot}
-\setinterfacecommand{but}{fondo}
-\setinterfacecommand{button}{pulsante}
-\setinterfacecommand{bypassblocks}{saltablocchi}
-\setinterfacecommand{character}{lettera}
-\setinterfacecommand{characters}{lettere}
-\setinterfacecommand{chem}{chim}
-\setinterfacecommand{clip}{clip}
-\setinterfacecommand{clonefield}{clonacampo}
-\setinterfacecommand{color}{colore}
-\setinterfacecommand{colorbar}{barracolori}
-\setinterfacecommand{colorvalue}{valorecolore}
-\setinterfacecommand{column}{colonna}
-\setinterfacecommand{comparecolorgroup}{confrontagruppocolori}
-\setinterfacecommand{comparepalet}{confrontatavolozza}
-\setinterfacecommand{completepagenumber}{numeropaginacompleto}
-\setinterfacecommand{completeregister}{completeregister}
-\setinterfacecommand{component}{componenet}
-\setinterfacecommand{convertnumber}{convertinumero}
-\setinterfacecommand{copyfield}{copiacampo}
-\setinterfacecommand{correctwhitespace}{correggispaziobianco}
-\setinterfacecommand{coupledocument}{accoppiadocumento}
-\setinterfacecommand{couplemarking}{accoppiamarcatura}
-\setinterfacecommand{couplepage}{accoppiapagina}
-\setinterfacecommand{couplepaper}{accoppiacarta}
-\setinterfacecommand{coupleregister}{accoppiaregistro}
-\setinterfacecommand{crlf}{crlf}
-\setinterfacecommand{currentdate}{datadioggi}
-\setinterfacecommand{currentheadnumber}{numerotestacorrente}
-\setinterfacecommand{cutspace}{cutspace}
-\setinterfacecommand{date}{data}
-\setinterfacecommand{decouplemarking}{separamarcatura}
-\setinterfacecommand{decrementnumber}{decrementnumber}
-\setinterfacecommand{define}{definisci}
-\setinterfacecommand{defineaccent}{definisciaccento}
-\setinterfacecommand{defineblank}{definiscirigovuoto}
-\setinterfacecommand{defineblock}{definisciblocco}
-\setinterfacecommand{definebodyfont}{definiscifontdeltesto}
-\setinterfacecommand{definebodyfontenvironment}{definisciambientefontdeltesto}
-\setinterfacecommand{definebodyfontswitch}{definebodyfontswitch}
-\setinterfacecommand{definebuffer}{definiscibuffer}
-\setinterfacecommand{definecharacter}{definiscicarattere}
-\setinterfacecommand{definecharacterkerning}{definecharacterkerning}
-\setinterfacecommand{definecharacterspacing}{definecharacterspacing}
-\setinterfacecommand{definecolor}{definiscicolore}
-\setinterfacecommand{definecolorgroup}{definiscigruppocolori}
-\setinterfacecommand{definecolumnbreak}{definecolumnbreak}
-\setinterfacecommand{definecolumnset}{definiscigruppocolonne}
-\setinterfacecommand{definecombination}{definecombination}
-\setinterfacecommand{definecombinedlist}{definiscielencocombinato}
-\setinterfacecommand{definecommand}{definiscicomando}
-\setinterfacecommand{defineconversion}{definisciconversione}
-\setinterfacecommand{definedescription}{definiscidescrizione}
-\setinterfacecommand{definedfont}{definedfont}
-\setinterfacecommand{defineenumeration}{definiscienumerazione}
-\setinterfacecommand{definefallbackfamily}{definefallbackfamily}
-\setinterfacecommand{definefield}{definiscicampo}
-\setinterfacecommand{definefieldstack}{definiscistackcampi}
-\setinterfacecommand{definefiguresymbol}{definiscifigurasimbolo}
-\setinterfacecommand{definefilefallback}{definefilefallback}
-\setinterfacecommand{definefirstline}{definefirstline}
-\setinterfacecommand{definefloat}{definiscioggettomobile}
-\setinterfacecommand{definefont}{definiscifont}
-\setinterfacecommand{definefontalternative}{definefontalternative}
-\setinterfacecommand{definefontfallback}{definefontfallback}
-\setinterfacecommand{definefontfamily}{definefontfamily}
-\setinterfacecommand{definefontfamilypreset}{definefontfamilypreset}
-\setinterfacecommand{definefontfeature}{definefontfeature}
-\setinterfacecommand{definefontfile}{definefontfile}
-\setinterfacecommand{definefontsize}{definefontsize}
-\setinterfacecommand{definefontsolution}{definefontsolution}
-\setinterfacecommand{definefontstyle}{definiscistilefont}
-\setinterfacecommand{definefontsynonym}{definiscisinonimofont}
-\setinterfacecommand{defineframed}{definisciincorniciato}
-\setinterfacecommand{defineframedtext}{definiscitestoincorniciato}
-\setinterfacecommand{definefrozenfont}{definefrozenfont}
-\setinterfacecommand{definehbox}{definiscihbox}
-\setinterfacecommand{definehead}{definiscitesta}
-\setinterfacecommand{definehyphenationfeatures}{definehyphenationfeatures}
-\setinterfacecommand{defineindentedtext}{defineindentedtext}
-\setinterfacecommand{defineinmargin}{defineinmargin}
-\setinterfacecommand{defineinteractionmenu}{definiscimenuinterazione}
-\setinterfacecommand{defineitemgroup}{defineitemgroup}
-\setinterfacecommand{defineitems}{defineitems}
-\setinterfacecommand{definelabel}{definiscietichetta}
-\setinterfacecommand{definelayer}{definelayer}
-\setinterfacecommand{definelayout}{definiscilayout}
-\setinterfacecommand{definelinenote}{definelinenote}
-\setinterfacecommand{definelist}{definiscielenco}
-\setinterfacecommand{definelogo}{definiscilogo}
-\setinterfacecommand{definemainfield}{definiscicampoprincipale}
-\setinterfacecommand{definemakeup}{definiscimakeup}
-\setinterfacecommand{definemarking}{definiscimarcatura}
-\setinterfacecommand{definemathalignment}{definemathalignment}
-\setinterfacecommand{definemode}{definemode}
-\setinterfacecommand{definenamedcolor}{definenamedcolor}
-\setinterfacecommand{definenote}{definenote}
-\setinterfacecommand{defineoutput}{definiscioutput}
-\setinterfacecommand{defineoverlay}{definiscisovrapposizione}
-\setinterfacecommand{definepagebreak}{definepagebreak}
-\setinterfacecommand{definepalet}{definiscitavolozza}
-\setinterfacecommand{definepapersize}{definiscidimensionicarta}
-\setinterfacecommand{defineparagraphs}{definiscicapoversi}
-\setinterfacecommand{defineperiodkerning}{defineperiodkerning}
-\setinterfacecommand{defineplacement}{defineplacement}
-\setinterfacecommand{defineprofile}{definisciprofilo}
-\setinterfacecommand{defineprogram}{definisciprogramma}
-\setinterfacecommand{definerawfont}{definiscifontgrezzo}
-\setinterfacecommand{definereference}{definisciriferimento}
-\setinterfacecommand{definereferenceformat}{definisciformatoriferimento}
-\setinterfacecommand{definereferencelist}{definiscilistariferimenti}
-\setinterfacecommand{defineregister}{definisciregistro}
-\setinterfacecommand{definerule}{definiscilinea}
-\setinterfacecommand{definesection}{definiscisezione}
-\setinterfacecommand{definesectionblock}{definiscibloccosezione}
-\setinterfacecommand{definesorting}{definisciordinamento}
-\setinterfacecommand{definestartstop}{definisciiniziatermina}
-\setinterfacecommand{definestyle}{definiscistile}
-\setinterfacecommand{definesubfield}{definiscisottocampo}
-\setinterfacecommand{definesymbol}{definiscisimbolo}
-\setinterfacecommand{definesynonyms}{definiscisinonimi}
-\setinterfacecommand{definetabletemplate}{definiscimodellotabella}
-\setinterfacecommand{definetabulate}{definiscitabulato}
-\setinterfacecommand{definetext}{definiscitesto}
-\setinterfacecommand{definetextbackground}{definetextbackground}
-\setinterfacecommand{definetextnote}{definetextnote}
-\setinterfacecommand{definetextposition}{definisciposizionetesto}
-\setinterfacecommand{definetextvariable}{definiscivariabiletesto}
-\setinterfacecommand{definetype}{definiscitype}
-\setinterfacecommand{definetyping}{definiscityping}
-\setinterfacecommand{defineversion}{definisciversion}
-\setinterfacecommand{depthspanningtext}{depthspanningtext}
-\setinterfacecommand{determineheadnumber}{determinanumerotesta}
-\setinterfacecommand{determinelistcharacteristics}{determinacarattersticheelenco}
-\setinterfacecommand{determineregistercharacteristics}{determinacaratteristicheregistro}
-\setinterfacecommand{dimension}{dimensione}
-\setinterfacecommand{disableinteractionmenu}{disabilitamenuinterazione}
-\setinterfacecommand{disablemode}{disablemode}
-\setinterfacecommand{doaddfeature}{doaddfeature}
-\setinterfacecommand{domicile}{domicilio}
-\setinterfacecommand{dontconvertfont}{dontconvertfont}
-\setinterfacecommand{donttest}{notest}
-\setinterfacecommand{edgedistance}{distanzabordo}
-\setinterfacecommand{edgewidth}{ampiezzabordo}
-\setinterfacecommand{emphasisboldface}{emphasisboldface}
-\setinterfacecommand{emptylines}{emptylines}
-\setinterfacecommand{enablemode}{enablemode}
-\setinterfacecommand{environment}{ambiente}
-\setinterfacecommand{externalfigure}{figuraesterna}
-\setinterfacecommand{fact}{fatto}
-\setinterfacecommand{fastswitchtobodyfont}{fastswitchtobodyfont}
-\setinterfacecommand{feature}{feature}
-\setinterfacecommand{field}{campi}
-\setinterfacecommand{fieldstack}{stackcampi}
-\setinterfacecommand{fillinfield}{camporiempimento}
-\setinterfacecommand{fillinline}{rigariempimento}
-\setinterfacecommand{fillinrules}{lineeriempimento}
-\setinterfacecommand{fillintext}{testoriempimento}
-\setinterfacecommand{firstcharacter}{firstcharacter}
-\setinterfacecommand{fitfield}{adattacampo}
-\setinterfacecommand{fittopbaselinegrid}{fittopbaselinegrid}
-\setinterfacecommand{fixedspace}{spaziofisso}
-\setinterfacecommand{fixedspaces}{spazifissi}
-\setinterfacecommand{flushnotes}{flushnotes}
-\setinterfacecommand{followprofile}{seguiprofilo}
-\setinterfacecommand{followprofileversion}{seguiversioneprofilo}
-\setinterfacecommand{followversion}{seguiversione}
-\setinterfacecommand{footerdistance}{distanzapdp}
-\setinterfacecommand{footerheight}{altezzapdp}
-\setinterfacecommand{footnote}{notapdp}
-\setinterfacecommand{footnotetext}{testonotapdp}
-\setinterfacecommand{forceblocks}{forzablocchi}
-\setinterfacecommand{forcecharacterstripping}{forcecharacterstripping}
-\setinterfacecommand{formulanumber}{numeroformula}
-\setinterfacecommand{fraction}{frazione}
-\setinterfacecommand{framed}{incorniciato}
-\setinterfacecommand{from}{da}
-\setinterfacecommand{fromlinenote}{fromlinenote}
-\setinterfacecommand{getbuffer}{prendibuffer}
-\setinterfacecommand{getfirstcharacter}{getfirstcharacter}
-\setinterfacecommand{getmarking}{prendimarcatura}
-\setinterfacecommand{getnumber}{getnumber}
-\setinterfacecommand{globaldisablemode}{globaldisablemode}
-\setinterfacecommand{globalenablemode}{globalenablemode}
-\setinterfacecommand{globalpreventmode}{globalpreventmode}
-\setinterfacecommand{godown}{vaigiu}
-\setinterfacecommand{goto}{vaia}
-\setinterfacecommand{gotobox}{vaiabox}
-\setinterfacecommand{gotopage}{vaiapagina}
-\setinterfacecommand{graycolor}{coloregrigio}
-\setinterfacecommand{greyvalue}{valoregrigio}
-\setinterfacecommand{grid}{griglia}
-\setinterfacecommand{hairline}{capello}
-\setinterfacecommand{head}{testa}
-\setinterfacecommand{headerdistance}{distanzaintestazione}
-\setinterfacecommand{headerheight}{altezzaintestazione}
-\setinterfacecommand{headlevel}{livellotesta}
-\setinterfacecommand{headnumber}{numerotesta}
-\setinterfacecommand{headsym}{headsym}
-\setinterfacecommand{headtext}{testoinstestazioni}
-\setinterfacecommand{heightspanningtext}{heightspanningtext}
-\setinterfacecommand{hideblocks}{nascondiblocchi}
-\setinterfacecommand{high}{ap}
-\setinterfacecommand{hl}{hl}
-\setinterfacecommand{immediatebetweenlist}{immediatebetweenlist}
-\setinterfacecommand{immediatetolist}{immediatetolist}
-\setinterfacecommand{in}{in}
-\setinterfacecommand{incrementnumber}{incrementanumero}
-\setinterfacecommand{indenting}{rientro}
-\setinterfacecommand{inframed}{circondato}
-\setinterfacecommand{infull}{perlungo}
-\setinterfacecommand{ininner}{ininner}
-\setinterfacecommand{inleft}{insinistra}
-\setinterfacecommand{inleftedge}{inlatosinistro}
-\setinterfacecommand{inleftmargin}{inmarginesinistro}
-\setinterfacecommand{inline}{inriga}
-\setinterfacecommand{inmargin}{inmargine}
-\setinterfacecommand{inmframed}{inmaframed}
-\setinterfacecommand{inneredgedistance}{inneredgedistance}
-\setinterfacecommand{inneredgewidth}{inneredgewidth}
-\setinterfacecommand{innermargindistance}{innermargindistance}
-\setinterfacecommand{innermarginwidth}{innermarginwidth}
-\setinterfacecommand{inothermargin}{inaltromargine}
-\setinterfacecommand{inouter}{inouter}
-\setinterfacecommand{inright}{indestra}
-\setinterfacecommand{inrightedge}{inlatodestro}
-\setinterfacecommand{inrightmargin}{inmarginedestro}
-\setinterfacecommand{installlanguage}{installalingua}
-\setinterfacecommand{interactionbar}{barrainterazione}
-\setinterfacecommand{interactionbuttons}{pulsantinterazione}
-\setinterfacecommand{interactionmenu}{menuinterattivo}
-\setinterfacecommand{item}{elemento}
-\setinterfacecommand{itemgroup}{itemgroup}
-\setinterfacecommand{items}{elementi}
-\setinterfacecommand{itemtag}{itemtag}
-\setinterfacecommand{its}{el}
-\setinterfacecommand{keepblocks}{tieniblocchi}
-\setinterfacecommand{kerncharacters}{kerncharacters}
-\setinterfacecommand{label}{etichetta}
-\setinterfacecommand{labels}{etichette}
-\setinterfacecommand{labeltext}{testoetichetta}
-\setinterfacecommand{language}{lingua}
-\setinterfacecommand{languageCharacters}{languageCharacters}
-\setinterfacecommand{languagecharacters}{languagecharacters}
-\setinterfacecommand{leftaligned}{allineasinistra}
-\setinterfacecommand{leftbottombox}{leftbottombox}
-\setinterfacecommand{leftedgedistance}{distanzabordosinistro}
-\setinterfacecommand{leftedgewidth}{ampiezzabordosinistro}
-\setinterfacecommand{leftline}{leftline}
-\setinterfacecommand{leftmargindistance}{distanzamarginesinistro}
-\setinterfacecommand{leftmarginwidth}{ampiezzamarginesinistro}
-\setinterfacecommand{leg}{leg}
-\setinterfacecommand{linecorrection}{linecorrection}
-\setinterfacecommand{linenote}{linenote}
-\setinterfacecommand{linespanningtext}{linespanningtext}
-\setinterfacecommand{linewidth}{spessoreriga}
-\setinterfacecommand{listheight}{altezzaelenco}
-\setinterfacecommand{listlength}{lunghezzaelenco}
-\setinterfacecommand{listsymbol}{listsymbol}
-\setinterfacecommand{listwidth}{ampiezzaelenco}
-\setinterfacecommand{loadfontgoodies}{loadfontgoodies}
-\setinterfacecommand{localfootnotes}{localfootnotes}
-\setinterfacecommand{localnotes}{localnotes}
-\setinterfacecommand{logfields}{logcampi}
-\setinterfacecommand{lohi}{pedap}
-\setinterfacecommand{low}{ped}
-\setinterfacecommand{macroname}{nome}
-\setinterfacecommand{mainlanguage}{linguaprincipale}
-\setinterfacecommand{makeupheight}{altezzamakeup}
-\setinterfacecommand{makeupwidth}{ampiezzamakeup}
-\setinterfacecommand{mar}{mar}
-\setinterfacecommand{marginblock}{marginblock}
-\setinterfacecommand{margindistance}{distanzamargine}
-\setinterfacecommand{marginrule}{lineamargine}
-\setinterfacecommand{margintext}{testoinmargine}
-\setinterfacecommand{margintitle}{titoloinmargine}
-\setinterfacecommand{marginwidth}{ampiezzamargine}
-\setinterfacecommand{marginword}{parolainmargine}
-\setinterfacecommand{marking}{marcatura}
-\setinterfacecommand{markversion}{marcaversione}
-\setinterfacecommand{mathematics}{matematica}
-\setinterfacecommand{menubutton}{pulsantemenu}
-\setinterfacecommand{mframed}{maframed}
-\setinterfacecommand{midaligned}{allineacentro}
-\setinterfacecommand{mirror}{riflessione}
-\setinterfacecommand{month}{mese}
-\setinterfacecommand{moveformula}{spostaformula}
-\setinterfacecommand{moveongrid}{spostaagriglia}
-\setinterfacecommand{movesidefloat}{movesidefloat}
-\setinterfacecommand{navigating}{navigating}
-\setinterfacecommand{nodimension}{nientedimensioni}
-\setinterfacecommand{noheaderandfooterlines}{nientelineintestazionepdp}
-\setinterfacecommand{noindenting}{nienterientro}
-\setinterfacecommand{noitem}{noitem}
-\setinterfacecommand{nolist}{nienteelenco}
-\setinterfacecommand{nomarking}{nientemarcatura}
-\setinterfacecommand{nomoreblocks}{bastablocchi}
-\setinterfacecommand{nomorefiles}{bastafile}
-\setinterfacecommand{nop}{nop}
-\setinterfacecommand{nospace}{nientespazio}
-\setinterfacecommand{note}{nota}
-\setinterfacecommand{notesymbol}{notesymbol}
-\setinterfacecommand{notopandbottomlines}{nientelineecimafondo}
-\setinterfacecommand{notsmallcapped}{nocap}
-\setinterfacecommand{nowhitespace}{nientespaziobianco}
-\setinterfacecommand{numberofsubpages}{numberofsubpages}
-\setinterfacecommand{numbers}{numeri}
-\setinterfacecommand{outeredgedistance}{outeredgedistance}
-\setinterfacecommand{outeredgewidth}{outeredgewidth}
-\setinterfacecommand{outermargindistance}{outermargindistance}
-\setinterfacecommand{outermarginwidth}{outermarginwidth}
-\setinterfacecommand{packed}{impaccato}
-\setinterfacecommand{page}{pagina}
-\setinterfacecommand{pagebreak}{pagebreak}
-\setinterfacecommand{pagedepth}{pagedepth}
-\setinterfacecommand{pagenumber}{numeropagina}
-\setinterfacecommand{pageoffset}{pageoffset}
-\setinterfacecommand{pagereference}{riferimentopagina}
-\setinterfacecommand{paperheight}{altezzacarta}
-\setinterfacecommand{paperwidth}{ampiezzacarta}
-\setinterfacecommand{periods}{punti}
-\setinterfacecommand{placebookmarks}{mettisegnalibro}
-\setinterfacecommand{placecombinedlist}{mettielencocombinato}
-\setinterfacecommand{placefloat}{placefloat}
-\setinterfacecommand{placefootnotes}{mettinotepdp}
-\setinterfacecommand{placeformula}{mettiformula}
-\setinterfacecommand{placeheadnumber}{posizionanumerotesta}
-\setinterfacecommand{placeheadtext}{posizionatestotesta}
-\setinterfacecommand{placelegend}{mettilegenda}
-\setinterfacecommand{placelist}{mettielenco}
-\setinterfacecommand{placelistofsynonyms}{placelistofsynonyms}
-\setinterfacecommand{placelocalfootnotes}{mettinotepdplocali}
-\setinterfacecommand{placelocalnotes}{placelocalnotes}
-\setinterfacecommand{placelogos}{mettiloghi}
-\setinterfacecommand{placenamedfloat}{placenamedfloat}
-\setinterfacecommand{placenotes}{placenotes}
-\setinterfacecommand{placeongrid}{mettiingriglia}
-\setinterfacecommand{placeontopofeachother}{mettiunosullaltro}
-\setinterfacecommand{placepagenumber}{mettinumeropagina}
-\setinterfacecommand{placerawlist}{placerawlist}
-\setinterfacecommand{placereferencelist}{placereferencelist}
-\setinterfacecommand{placeregister}{mettiregistro}
-\setinterfacecommand{placerule}{mettilinea}
-\setinterfacecommand{placesidebyside}{mettifiancoafianco}
-\setinterfacecommand{placesubformula}{mettisottoformula}
-\setinterfacecommand{placetextvariable}{mettivariabiletesto}
-\setinterfacecommand{position}{posizione}
-\setinterfacecommand{positiontext}{posizionatesto}
-\setinterfacecommand{postponenotes}{postponenotes}
-\setinterfacecommand{postponingnotes}{postponingnotes}
-\setinterfacecommand{predefinedfont}{predefinedfont}
-\setinterfacecommand{predefinefont}{predefinefont}
-\setinterfacecommand{presetdocument}{presetdocument}
-\setinterfacecommand{prettyprintbuffer}{prettyprintbuffer}
-\setinterfacecommand{preventmode}{preventmode}
-\setinterfacecommand{printpaperheight}{altezzacartastampa}
-\setinterfacecommand{printpaperwidth}{ampiezzacartastampa}
-\setinterfacecommand{processblocks}{elaborablocchi}
-\setinterfacecommand{processbodyfontenvironmentlist}{processbodyfontenvironmentlist}
-\setinterfacecommand{processpage}{elaborapagina}
-\setinterfacecommand{product}{prodotto}
-\setinterfacecommand{program}{programma}
-\setinterfacecommand{project}{progetto}
-\setinterfacecommand{publication}{pubblicazione}
-\setinterfacecommand{quotation}{citazione}
-\setinterfacecommand{quote}{menzione}
-\setinterfacecommand{ran}{ran}
-\setinterfacecommand{redo}{rifai}
-\setinterfacecommand{redoconvertfont}{redoconvertfont}
-\setinterfacecommand{ref}{rif}
-\setinterfacecommand{reference}{riferimento}
-\setinterfacecommand{referral}{referral}
-\setinterfacecommand{referraldate}{datareferral}
-\setinterfacecommand{referring}{referring}
-\setinterfacecommand{registerfontclass}{registerfontclass}
-\setinterfacecommand{registerhyphenationexception}{registerhyphenationexception}
-\setinterfacecommand{registerhyphenationpattern}{registerhyphenationpattern}
-\setinterfacecommand{remark}{commento}
-\setinterfacecommand{replacefeature}{replacefeature}
-\setinterfacecommand{reset}{reimposta}
-\setinterfacecommand{resetandaddfeature}{resetandaddfeature}
-\setinterfacecommand{resetcharacteralign}{resetcharacteralign}
-\setinterfacecommand{resetcharacterkerning}{resetcharacterkerning}
-\setinterfacecommand{resetcharacterspacing}{resetcharacterspacing}
-\setinterfacecommand{resetcharacterstripping}{resetcharacterstripping}
-\setinterfacecommand{resetfeature}{resetfeature}
-\setinterfacecommand{resetfontcolorsheme}{resetfontcolorsheme}
-\setinterfacecommand{resetfontfallback}{resetfontfallback}
-\setinterfacecommand{resetfontsolution}{resetfontsolution}
-\setinterfacecommand{resethyphenationfeatures}{resethyphenationfeatures}
-\setinterfacecommand{resetlocalfloats}{resetlocalfloats}
-\setinterfacecommand{resetmarking}{reimpostamarcatura}
-\setinterfacecommand{resetmode}{resetmode}
-\setinterfacecommand{resetnumber}{resetnumber}
-\setinterfacecommand{resetpath}{resetpath}
-\setinterfacecommand{resetperiodkerning}{resetperiodkerning}
-\setinterfacecommand{resetsystemmode}{resetsystemmode}
-\setinterfacecommand{resettextcontent}{resettextcontent}
-\setinterfacecommand{resetvisualizers}{resetvisualizers}
-\setinterfacecommand{restoreglobalbodyfont}{restoreglobalbodyfont}
-\setinterfacecommand{retestfeature}{retestfeature}
-\setinterfacecommand{revivefeature}{revivefeature}
-\setinterfacecommand{rightaligned}{allineadestra}
-\setinterfacecommand{rightbottombox}{rightbottombox}
-\setinterfacecommand{rightedgedistance}{distanzabordodestro}
-\setinterfacecommand{rightedgewidth}{ampiezzabordodestro}
-\setinterfacecommand{rightline}{rightline}
-\setinterfacecommand{rightmargindistance}{distanzamarginedestro}
-\setinterfacecommand{rightmarginwidth}{ampiezzamarginedestro}
-\setinterfacecommand{romannumerals}{numeriromani}
-\setinterfacecommand{rotate}{ruota}
-\setinterfacecommand{savebuffer}{savebuffer}
-\setinterfacecommand{scale}{scala}
-\setinterfacecommand{screen}{schermo}
-\setinterfacecommand{selectblocks}{selezionablocchi}
-\setinterfacecommand{selectpaper}{selezionacarta}
-\setinterfacecommand{selectversion}{selezionaversione}
-\setinterfacecommand{setbigbodyfont}{setbigbodyfont}
-\setinterfacecommand{setcharacteralign}{setcharacteralign}
-\setinterfacecommand{setcharacteraligndetail}{setcharacteraligndetail}
-\setinterfacecommand{setcharactercasing}{setcharactercasing}
-\setinterfacecommand{setcharactercleaning}{setcharactercleaning}
-\setinterfacecommand{setcharacterkerning}{setcharacterkerning}
-\setinterfacecommand{setcharacterspacing}{setcharacterspacing}
-\setinterfacecommand{setcharacterstripping}{setcharacterstripping}
-\setinterfacecommand{setcurrentfontclass}{setcurrentfontclass}
-\setinterfacecommand{setfirstline}{setfirstline}
-\setinterfacecommand{setfirstpasscharacteralign}{setfirstpasscharacteralign}
-\setinterfacecommand{setfont}{setfont}
-\setinterfacecommand{setfontcolorsheme}{setfontcolorsheme}
-\setinterfacecommand{setfontfeature}{setfontfeature}
-\setinterfacecommand{setfontsolution}{setfontsolution}
-\setinterfacecommand{setfontstrut}{setfontstrut}
-\setinterfacecommand{sethyphenationfeatures}{sethyphenationfeatures}
-\setinterfacecommand{setmainbodyfont}{setmainbodyfont}
-\setinterfacecommand{setmode}{setmode}
-\setinterfacecommand{setnote}{setnote}
-\setinterfacecommand{setnotetext}{setnotetext}
-\setinterfacecommand{setnumber}{setnumber}
-\setinterfacecommand{setperiodkerning}{setperiodkerning}
-\setinterfacecommand{setsecondpasscharacteralign}{setsecondpasscharacteralign}
-\setinterfacecommand{setsmallbodyfont}{setsmallbodyfont}
-\setinterfacecommand{setsystemmode}{setsystemmode}
-\setinterfacecommand{settextcontent}{settext}
-\setinterfacecommand{settextvariable}{setvariabiletesto}
-\setinterfacecommand{setupalign}{impostaallineamento}
-\setinterfacecommand{setupanswerarea}{setupanswerarea}
-\setinterfacecommand{setuparranging}{impostaparranging}
-\setinterfacecommand{setupattachment}{setupattachment}
-\setinterfacecommand{setupbackground}{impostasfondo}
-\setinterfacecommand{setupbackgrounds}{impostasfondi}
-\setinterfacecommand{setupblackrules}{impostalineenere}
-\setinterfacecommand{setupblank}{impostarigovuoto}
-\setinterfacecommand{setupblock}{impostablocco}
-\setinterfacecommand{setupbodyfont}{impostafontdeltesto}
-\setinterfacecommand{setupbodyfontenvironment}{impostaambientefontdeltesto}
-\setinterfacecommand{setupbottom}{impostafondo}
-\setinterfacecommand{setupbottomtexts}{impostatestifondo}
-\setinterfacecommand{setupbuffer}{impostabuffer}
-\setinterfacecommand{setupbuttons}{impostapulsanti}
-\setinterfacecommand{setupcapitals}{impostamaiuscole}
-\setinterfacecommand{setupcaption}{impostacaption}
-\setinterfacecommand{setupcaptions}{impostacaptions}
-\setinterfacecommand{setupcharacteralign}{setupcharacteralign}
-\setinterfacecommand{setupcharacterkerning}{setupcharacterkerning}
-\setinterfacecommand{setupcharacterspacing}{setupcharacterspacing}
-\setinterfacecommand{setupclipping}{impostaclippling}
-\setinterfacecommand{setupcolor}{impostacolore}
-\setinterfacecommand{setupcolors}{impostacolori}
-\setinterfacecommand{setupcolumns}{impostacolonne}
-\setinterfacecommand{setupcolumnset}{impostagruppocolonne}
-\setinterfacecommand{setupcolumnsetlines}{setupcolumnsetlines}
-\setinterfacecommand{setupcolumnsetstart}{setupcolumnsetstart}
-\setinterfacecommand{setupcombinations}{impostacombinazioni}
-\setinterfacecommand{setupcombinedlist}{impostaelencocombinato}
-\setinterfacecommand{setupcomment}{impostacommento}
-\setinterfacecommand{setupcounter}{setupcounter}
-\setinterfacecommand{setupdescription}{setupdescription}
-\setinterfacecommand{setupdescriptions}{impostadescrizioni}
-\setinterfacecommand{setupenumeration}{setupenumeration}
-\setinterfacecommand{setupenumerations}{impostaenumerazioni}
-\setinterfacecommand{setupexternalfigures}{impostafigureesterne}
-\setinterfacecommand{setupfield}{impostacampo}
-\setinterfacecommand{setupfields}{impostacampi}
-\setinterfacecommand{setupfillinlines}{impostarigheriempimento}
-\setinterfacecommand{setupfillinrules}{impostalineeriempimento}
-\setinterfacecommand{setupfirstline}{setupfirstline}
-\setinterfacecommand{setupfloat}{impostaoggettomobile}
-\setinterfacecommand{setupfloats}{impostaoggettimobili}
-\setinterfacecommand{setupfloatsplitting}{impostaspezzamentooggettomobile}
-\setinterfacecommand{setupfontexpansion}{setupfontexpansion}
-\setinterfacecommand{setupfontprotrusion}{setupfontprotrusion}
-\setinterfacecommand{setupfonts}{setupfonts}
-\setinterfacecommand{setupfontsolution}{setupfontsolution}
-\setinterfacecommand{setupfooter}{impostapdp}
-\setinterfacecommand{setupfootertexts}{impostatestipdp}
-\setinterfacecommand{setupfootnotedefinition}{impostadefinizionenotepdp}
-\setinterfacecommand{setupfootnotes}{impostanotepdp}
-\setinterfacecommand{setupforms}{impostaforms}
-\setinterfacecommand{setupformula}{setupformula}
-\setinterfacecommand{setupformulas}{impostaformule}
-\setinterfacecommand{setupframed}{impostaincorniciato}
-\setinterfacecommand{setupframedtext}{setupframedtext}
-\setinterfacecommand{setupframedtexts}{impostatestiincorniciati}
-\setinterfacecommand{setuphead}{impostatesta}
-\setinterfacecommand{setupheader}{impostainstestazione}
-\setinterfacecommand{setupheadertexts}{impostatestiintestazioni}
-\setinterfacecommand{setupheadnumber}{impostanumerotesta}
-\setinterfacecommand{setupheads}{impostateste}
-\setinterfacecommand{setupheadtext}{impostatestointestazioni}
-\setinterfacecommand{setuphyphenation}{setuphyphenation}
-\setinterfacecommand{setuphyphenmark}{impostasegnosillabazione}
-\setinterfacecommand{setupindentedtext}{setupindentedtext}
-\setinterfacecommand{setupindenting}{impostarientro}
-\setinterfacecommand{setupinmargin}{impostainmargine}
-\setinterfacecommand{setupinteraction}{impostainterazione}
-\setinterfacecommand{setupinteractionbar}{impostabarrainterazione}
-\setinterfacecommand{setupinteractionmenu}{impostamenuinterazione}
-\setinterfacecommand{setupinteractionscreen}{impostaschermointerazione}
-\setinterfacecommand{setupinterlinespace}{impostainterlinea}
-\setinterfacecommand{setupitemgroup}{setupitemgroup}
-\setinterfacecommand{setupitemgroups}{impostaelencazioni}
-\setinterfacecommand{setupitems}{impostaelementi}
-\setinterfacecommand{setuplabeltext}{impostatestoetichette}
-\setinterfacecommand{setuplanguage}{impostalingua}
-\setinterfacecommand{setuplayout}{impostalayout}
-\setinterfacecommand{setuplegend}{impostalegenda}
-\setinterfacecommand{setuplinenote}{setuplinenote}
-\setinterfacecommand{setuplinenumbering}{impostanumerazionerighe}
-\setinterfacecommand{setuplines}{impostarighe}
-\setinterfacecommand{setuplinewidth}{impostaampiezzariga}
-\setinterfacecommand{setuplist}{impostaelenco}
-\setinterfacecommand{setupmakeup}{impostamakeup}
-\setinterfacecommand{setupmarginblock}{setupmarginblock}
-\setinterfacecommand{setupmarginblocks}{impostablocchimargine}
-\setinterfacecommand{setupmargindata}{setupmargindata}
-\setinterfacecommand{setupmarginrules}{impostalineemargine}
-\setinterfacecommand{setupmarking}{impostamarcatura}
-\setinterfacecommand{setupmathalignment}{setupmathalignment}
-\setinterfacecommand{setupnarrower}{impostapiustretto}
-\setinterfacecommand{setupnotation}{setupnotation}
-\setinterfacecommand{setupnotations}{setupnotations}
-\setinterfacecommand{setupnote}{setupnote}
-\setinterfacecommand{setupnotes}{setupnotes}
-\setinterfacecommand{setupnumber}{impostanumerazione}
-\setinterfacecommand{setupnumbering}{impostanumerazione}
-\setinterfacecommand{setupoppositeplacing}{impostaposizionamentoopposti}
-\setinterfacecommand{setupoutput}{impostaoutput}
-\setinterfacecommand{setuppagecomment}{impostacommentopagina}
-\setinterfacecommand{setuppagenumber}{impostanumeropagina}
-\setinterfacecommand{setuppagenumbering}{impostanumerazionepagina}
-\setinterfacecommand{setuppagetransitions}{impostatransizionepagina}
-\setinterfacecommand{setuppalet}{impostatavolozza}
-\setinterfacecommand{setuppaper}{setuppaper}
-\setinterfacecommand{setuppapersize}{impostadimensionicarta}
-\setinterfacecommand{setupparagraphnumbering}{impostanumerazionecapoversi}
-\setinterfacecommand{setupparagraphs}{impostacapoversi}
-\setinterfacecommand{setupperiodkerning}{setupperiodkerning}
-\setinterfacecommand{setupplacement}{setupplacement}
-\setinterfacecommand{setuppositioning}{impostaposizionamento}
-\setinterfacecommand{setupprofiles}{impostaprofili}
-\setinterfacecommand{setupprograms}{impostaprogrammi}
-\setinterfacecommand{setuppublications}{impostapubblicazioni}
-\setinterfacecommand{setupquote}{impostamenzione}
-\setinterfacecommand{setupreferencelist}{impostalistariferimenti}
-\setinterfacecommand{setupreferencing}{impostariferimento}
-\setinterfacecommand{setupregister}{impostaregistro}
-\setinterfacecommand{setuprotate}{impostarotazione}
-\setinterfacecommand{setuprule}{impostalinea}
-\setinterfacecommand{setupscreens}{impostaschermi}
-\setinterfacecommand{setupsection}{impostasezione}
-\setinterfacecommand{setupsectionblock}{impostabloccosezione}
-\setinterfacecommand{setupsorting}{impostaordinamento}
-\setinterfacecommand{setupspacing}{impostaspaziatura}
-\setinterfacecommand{setupstartstop}{impostainiziatermina}
-\setinterfacecommand{setupstrut}{impostastrut}
-\setinterfacecommand{setupsubpagenumber}{impostanumerosottopagina}
-\setinterfacecommand{setupsymbolset}{impostasetsimboli}
-\setinterfacecommand{setupsynchronization}{impostasincronizzazione}
-\setinterfacecommand{setupsynchronizationbar}{impostabarrasincronizzazione}
-\setinterfacecommand{setupsynonyms}{impostasinonimi}
-\setinterfacecommand{setupsystem}{impostasistema}
-\setinterfacecommand{setuptab}{impostatab}
-\setinterfacecommand{setuptables}{impostatabelle}
-\setinterfacecommand{setuptabulate}{impostatabulato}
-\setinterfacecommand{setuptext}{impostatesto}
-\setinterfacecommand{setuptextbackground}{setuptextbackground}
-\setinterfacecommand{setuptextnote}{setuptextnote}
-\setinterfacecommand{setuptextposition}{impostaposizionetesto}
-\setinterfacecommand{setuptextrules}{impostalineetesto}
-\setinterfacecommand{setuptexttexts}{impostatestotesti}
-\setinterfacecommand{setuptextvariable}{impostavariabiletesto}
-\setinterfacecommand{setupthinrules}{impostalineesottili}
-\setinterfacecommand{setuptolerance}{impostatolleranza}
-\setinterfacecommand{setuptop}{impostacima}
-\setinterfacecommand{setuptoptexts}{impostatesticima}
-\setinterfacecommand{setuptype}{impostatype}
-\setinterfacecommand{setuptyping}{impostatyping}
-\setinterfacecommand{setupunderbar}{impostasottolinea}
-\setinterfacecommand{setupurl}{impostaurl}
-\setinterfacecommand{setupversions}{impostaversioni}
-\setinterfacecommand{setupwhitespace}{impostaspaziobianco}
-\setinterfacecommand{setvisualizerfont}{setvisualizerfont}
-\setinterfacecommand{showbodyfont}{mostrafontdeltesto}
-\setinterfacecommand{showbodyfontenvironment}{mostraambientefontdeltesto}
-\setinterfacecommand{showcolor}{mostracolore}
-\setinterfacecommand{showcolorgroup}{mostragruppocolori}
-\setinterfacecommand{showcounter}{showcounter}
-\setinterfacecommand{showexternalfigures}{mostrafiguresterne}
-\setinterfacecommand{showfields}{mostracampi}
-\setinterfacecommand{showfont}{showfont}
-\setinterfacecommand{showfontdata}{showfontdata}
-\setinterfacecommand{showfontexpansion}{showfontexpansion}
-\setinterfacecommand{showfontitalics}{showfontitalics}
-\setinterfacecommand{showfontkerns}{showfontkerns}
-\setinterfacecommand{showfontparameters}{showfontparameters}
-\setinterfacecommand{showfontstrip}{showfontstrip}
-\setinterfacecommand{showfontstyle}{showfontstyle}
-\setinterfacecommand{showframe}{mostracornice}
-\setinterfacecommand{showgrid}{mostragriglia}
-\setinterfacecommand{showhyphenationtrace}{showhyphenationtrace}
-\setinterfacecommand{showkerning}{showkerning}
-\setinterfacecommand{showlayout}{mostralyout}
-\setinterfacecommand{showmakeup}{mostramakeup}
-\setinterfacecommand{showminimalbaseline}{showminimalbaseline}
-\setinterfacecommand{showpalet}{mostratavolozza}
-\setinterfacecommand{showprint}{mostrastampa}
-\setinterfacecommand{showsetups}{mostraimpostazioni}
-\setinterfacecommand{showstruts}{mostrastruts}
-\setinterfacecommand{showsymbolset}{mostrasetsimboli}
-\setinterfacecommand{smallcapped}{cap}
-\setinterfacecommand{someline}{qualcheriga}
-\setinterfacecommand{somewhere}{daqualcheparte}
-\setinterfacecommand{space}{spazio}
-\setinterfacecommand{specialitem}{specialitem}
-\setinterfacecommand{splitfloat}{spezzaoggettomobile}
-\setinterfacecommand{startalignment}{iniziaallineamento}
-\setinterfacecommand{startbackground}{iniziasfondo}
-\setinterfacecommand{startcoding}{iniziacodifica}
-\setinterfacecommand{startcolor}{iniziacolore}
-\setinterfacecommand{startcolumnmakeup}{startcolumnmakeup}
-\setinterfacecommand{startcolumns}{iniziacolonne}
-\setinterfacecommand{startcolumnset}{iniziagruppocolonne}
-\setinterfacecommand{startcombination}{iniziacombinazione}
-\setinterfacecommand{startcomponent}{iniziacomponente}
-\setinterfacecommand{startdocument}{iniziadocumento}
-\setinterfacecommand{startenvironment}{iniziaambiente}
-\setinterfacecommand{startfigure}{iniziafigura}
-\setinterfacecommand{startframed}{startframed}
-\setinterfacecommand{startglobal}{iniziaglobale}
-\setinterfacecommand{startline}{iniziariga}
-\setinterfacecommand{startlinecorrection}{iniziacorrezioneriga}
-\setinterfacecommand{startlinenote}{startlinenote}
-\setinterfacecommand{startlinenumbering}{inizianumerazionerighe}
-\setinterfacecommand{startlines}{iniziarighe}
-\setinterfacecommand{startlocal}{inizialocale}
-\setinterfacecommand{startlocalfootnotes}{inizianotepdplocali}
-\setinterfacecommand{startmakeup}{iniziamakeup}
-\setinterfacecommand{startmarginblock}{iniziabloccomargine}
-\setinterfacecommand{startmarginrule}{inizialineamargine}
-\setinterfacecommand{startnarrower}{iniziapiustretto}
-\setinterfacecommand{startopposite}{iniziaopposto}
-\setinterfacecommand{startoverlay}{iniziasovrapposizione}
-\setinterfacecommand{startoverview}{iniziaoverview}
-\setinterfacecommand{startpacked}{iniziaimpaccato}
-\setinterfacecommand{startpositioning}{iniziaposizionamento}
-\setinterfacecommand{startproduct}{iniziaprodotto}
-\setinterfacecommand{startprofile}{iniziaprofilo}
-\setinterfacecommand{startproject}{iniziaprogetto}
-\setinterfacecommand{startquotation}{iniziacitazione}
-\setinterfacecommand{startraster}{iniziaraster}
-\setinterfacecommand{startsymbolset}{iniziasetsimboli}
-\setinterfacecommand{startsynchronization}{iniziasincronizzazione}
-\setinterfacecommand{starttable}{iniziatabella}
-\setinterfacecommand{starttables}{iniziatabelle}
-\setinterfacecommand{starttext}{iniziatesto}
-\setinterfacecommand{starttextbackground}{starttextbackground}
-\setinterfacecommand{starttextrule}{inizialineatesto}
-\setinterfacecommand{startunpacked}{iniziaunpacked}
-\setinterfacecommand{startversion}{iniziaversione}
-\setinterfacecommand{stopalignment}{terminaallineamento}
-\setinterfacecommand{stopbackground}{terminasfondo}
-\setinterfacecommand{stopcoding}{terminacodifica}
-\setinterfacecommand{stopcolor}{terminacolore}
-\setinterfacecommand{stopcolumnmakeup}{stopcolumnmakeup}
-\setinterfacecommand{stopcolumns}{terminacolonne}
-\setinterfacecommand{stopcolumnset}{terminagruppocolonne}
-\setinterfacecommand{stopcombination}{terminacombinazione}
-\setinterfacecommand{stopcomponent}{terminacomponente}
-\setinterfacecommand{stopdocument}{terminadocumento}
-\setinterfacecommand{stopenvironment}{terminaambiente}
-\setinterfacecommand{stopframed}{stopframed}
-\setinterfacecommand{stopglobal}{terminaglobale}
-\setinterfacecommand{stopline}{terminariga}
-\setinterfacecommand{stoplinecorrection}{terminacorrezioneriga}
-\setinterfacecommand{stoplinenote}{stoplinenote}
-\setinterfacecommand{stoplinenumbering}{terminanumerazionerighe}
-\setinterfacecommand{stoplines}{terminarighe}
-\setinterfacecommand{stoplocal}{terminalocale}
-\setinterfacecommand{stoplocalfootnotes}{terminanotepdplocali}
-\setinterfacecommand{stopmakeup}{terminamakeup}
-\setinterfacecommand{stopmarginblock}{terminabloccomargine}
-\setinterfacecommand{stopmarginrule}{terminalineamargine}
-\setinterfacecommand{stopnarrower}{terminapiustretto}
-\setinterfacecommand{stopopposite}{terminaopposto}
-\setinterfacecommand{stopoverlay}{terminasovrapposizione}
-\setinterfacecommand{stopoverview}{terminaoverview}
-\setinterfacecommand{stoppacked}{terminaimpaccato}
-\setinterfacecommand{stoppositioning}{terminaposizionamento}
-\setinterfacecommand{stopproduct}{terminaprodotto}
-\setinterfacecommand{stopprofile}{terminaprofili}
-\setinterfacecommand{stopproject}{terminaprogetto}
-\setinterfacecommand{stopquotation}{terminacitazione}
-\setinterfacecommand{stopraster}{terminaraster}
-\setinterfacecommand{stopsynchronization}{terminasincronizzazione}
-\setinterfacecommand{stoptable}{terminatabella}
-\setinterfacecommand{stoptables}{terminatabelle}
-\setinterfacecommand{stoptext}{terminatesto}
-\setinterfacecommand{stoptextbackground}{stoptextbackground}
-\setinterfacecommand{stoptextrule}{terminalineatesto}
-\setinterfacecommand{stopunpacked}{terminaunpacked}
-\setinterfacecommand{stopversion}{terminaversioni}
-\setinterfacecommand{stretched}{stirato}
-\setinterfacecommand{strictinspectnextcharacter}{strictinspectnextcharacter}
-\setinterfacecommand{stripcharacter}{stripcharacter}
-\setinterfacecommand{subformulanumber}{numerosottoformula}
-\setinterfacecommand{subpagenumber}{subpagenumber}
-\setinterfacecommand{subtractfeature}{subtractfeature}
-\setinterfacecommand{switchtobodyfont}{cambiaafontdeltesto}
-\setinterfacecommand{switchtorawfont}{passaafontgrezzo}
-\setinterfacecommand{sym}{sim}
-\setinterfacecommand{symbol}{simbolo}
-\setinterfacecommand{symoffset}{symoffset}
-\setinterfacecommand{synchronizationbar}{barrasincronizzazione}
-\setinterfacecommand{synchronize}{sincronizza}
-\setinterfacecommand{tab}{tab}
-\setinterfacecommand{testcolumn}{testcolumn}
-\setinterfacecommand{testfeature}{testfeature}
-\setinterfacecommand{testfeatureonce}{testfeatureonce}
-\setinterfacecommand{testpage}{testpage}
-\setinterfacecommand{tex}{tex}
-\setinterfacecommand{textbackground}{textbackground}
-\setinterfacecommand{textcolor}{textcolor}
-\setinterfacecommand{textheight}{altezzatesto}
-\setinterfacecommand{textnote}{textnote}
-\setinterfacecommand{textreference}{riferimentotesto}
-\setinterfacecommand{textrule}{lineatesto}
-\setinterfacecommand{textvariable}{variabiletesto}
-\setinterfacecommand{textwidth}{ampiezzatesto}
-\setinterfacecommand{thefirstcharacter}{thefirstcharacter}
-\setinterfacecommand{thenormalizedbodyfontsize}{thenormalizedbodyfontsize}
-\setinterfacecommand{theremainingcharacters}{theremainingcharacters}
-\setinterfacecommand{thinrule}{lineasottile}
-\setinterfacecommand{thinrules}{lineesottili}
-\setinterfacecommand{tolinenote}{tolinenote}
-\setinterfacecommand{tooltip}{tooltip}
-\setinterfacecommand{topdistance}{distanzacima}
-\setinterfacecommand{topheight}{altezzacima}
-\setinterfacecommand{topspace}{spaziocima}
-\setinterfacecommand{totalnumberofpages}{numerototaledipagine}
-\setinterfacecommand{translate}{traduci}
-\setinterfacecommand{txt}{txt}
-\setinterfacecommand{typ}{typ}
-\setinterfacecommand{type}{type}
-\setinterfacecommand{typebuffer}{typebuffer}
-\setinterfacecommand{typedefinedbuffer}{typedefinedbuffer}
-\setinterfacecommand{typefile}{typefile}
-\setinterfacecommand{typeinlinebuffer}{typeinlinebuffer}
-\setinterfacecommand{typing}{typing}
-\setinterfacecommand{unitmeaning}{nomeunita}
-\setinterfacecommand{unknown}{ignoto}
-\setinterfacecommand{unregisterhyphenationpattern}{unregisterhyphenationpattern}
-\setinterfacecommand{useJSscripts}{usaJSscripts}
-\setinterfacecommand{useURL}{usaURL}
-\setinterfacecommand{useXMLfilter}{useXMLfilter}
-\setinterfacecommand{useblocks}{usablocco}
-\setinterfacecommand{usebodyfont}{usebodyfont}
-\setinterfacecommand{usebodyfontparameter}{usebodyfontparameter}
-\setinterfacecommand{usecommands}{usacomandi}
-\setinterfacecommand{useencoding}{usacodifica}
-\setinterfacecommand{useexternaldocument}{usadocumentoesterno}
-\setinterfacecommand{useexternalfigure}{usafiguraesterna}
-\setinterfacecommand{useexternalfile}{usafileesterno}
-\setinterfacecommand{useexternalfiles}{usafileesterni}
-\setinterfacecommand{useexternalsoundtrack}{usacolonnasonoraesterna}
-\setinterfacecommand{usemodule}{usamodulo}
-\setinterfacecommand{usemodules}{usamoduli}
-\setinterfacecommand{usepath}{usacartella}
-\setinterfacecommand{usereferences}{usariferimenti}
-\setinterfacecommand{usespecials}{usaspecialita}
-\setinterfacecommand{usesymbols}{usasimboli}
-\setinterfacecommand{usetypescript}{usetypescript}
-\setinterfacecommand{usetypescriptfile}{usetypescriptfile}
-\setinterfacecommand{useurl}{usaurl}
-\setinterfacecommand{verbatim}{verbatim}
-\setinterfacecommand{version}{versione}
-\setinterfacecommand{vl}{vl}
-\setinterfacecommand{weekday}{giornosettimana}
-\setinterfacecommand{whitespace}{spaziobianco}
-\setinterfacecommand{widthspanningtext}{widthspanningtext}
-\setinterfacecommand{wordright}{paroladestra}
-\setinterfacecommand{writebetweenlist}{scrividentroelenco}
-\setinterfacecommand{writetolist}{scriviinelenco}
-\setinterfacecommand{writetoreferencelist}{scriviinlistariferimenti}
-\setinterfacecommand{writetoregister}{scriviinregistro}
-%
-\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/context/base/mkii/mult-mcs.mkii b/Master/texmf-dist/tex/context/base/mkii/mult-mcs.mkii
deleted file mode 100644
index c733798e642..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/mult-mcs.mkii
+++ /dev/null
@@ -1,210 +0,0 @@
-\setinterfacemessage{references}{1}{neznama reference --}
-\setinterfacemessage{references}{30}{neznamy objekt --}
-\setinterfacemessage{references}{3}{neznamy typ reference --}
-\setinterfacemessage{references}{2}{duplicitni reference -- na strane --}
-\setinterfacemessage{references}{5}{number of unknown references: --}
-\setinterfacemessage{references}{4}{nedovolena reference --}
-\setinterfacemessage{references}{6}{number of illegal references: --}
-\setinterfacemessage{references}{25}{references from document '--' are not imported (export again)}
-\setinterfacemessage{references}{24}{references from document '--' are not exported}
-\setinterfacemessage{references}{title}{reference}
-\setinterfacemessage{references}{26}{references from document '--' are imported}
-\setinterfacemessage{references}{31}{duplicitni object --}
-\setinterfacemessage{references}{21}{dokument -- nacten}
-\setinterfacemessage{references}{22}{dokument -- neni interaktivni}
-\setinterfacemessage{references}{23}{obskurni (nejasna) reference -- (prefix=--)}
-\setinterfacemessage{documents}{1}{sheet --}
-\setinterfacemessage{documents}{title}{sheets}
-\setinterfacemessage{documents}{2}{number --}
-\setinterfacemessage{handlings}{1}{font handling --}
-\setinterfacemessage{handlings}{3}{unknown font handling --}
-\setinterfacemessage{handlings}{2}{font handling -- is loaded}
-\setinterfacemessage{handlings}{title}{handling}
-\setinterfacemessage{systems}{title}{system}
-\setinterfacemessage{systems}{41}{externi soubor -- ve skupine -- neexistuje}
-\setinterfacemessage{systems}{9}{-- nenalezeno/nezpracovano}
-\setinterfacemessage{systems}{91}{papertray --}
-\setinterfacemessage{systems}{8}{nova verze pomocneho souboru, je treba druheho behu}
-\setinterfacemessage{systems}{21}{pomocny soubor necten}
-\setinterfacemessage{systems}{20}{vyznam (trideni) -- nacten}
-\setinterfacemessage{systems}{5}{makra z -- nactena}
-\setinterfacemessage{systems}{4}{prikaz -- je jiz definovan}
-\setinterfacemessage{systems}{27}{verze}
-\setinterfacemessage{systems}{26}{registry}
-\setinterfacemessage{systems}{25}{reference}
-\setinterfacemessage{systems}{24}{plovouci bloky}
-\setinterfacemessage{systems}{1}{nacteni pomocneho souboru odlozeno (typemode)}
-\setinterfacemessage{systems}{23}{-- upraveno na --}
-\setinterfacemessage{systems}{22}{pouzijte platny pomocny soubor}
-\setinterfacemessage{systems}{2}{-- nacteno}
-\setinterfacemessage{systems}{19}{vyznam (synonyma) -- nacten}
-\setinterfacemessage{systems}{18}{synonymum -- -- neexistuje}
-\setinterfacemessage{systems}{7}{makra z -- jsou jiz nactena}
-\setinterfacemessage{systems}{6}{zadna makra v -- nenalezena}
-\setinterfacemessage{systems}{14}{vynucena nova stranka v seznamu na --}
-\setinterfacemessage{systems}{15}{uklada se buffer --}
-\setinterfacemessage{systems}{16}{sazi se buffer --}
-\setinterfacemessage{systems}{17}{sazi se doslovny (verbatim) buffer --}
-\setinterfacemessage{systems}{13}{znacka -- definovana --}
-\setinterfacemessage{systems}{12}{pomosny soubor neni setriden, pouzijte texutil}
-\setinterfacemessage{systems}{11}{vytvarim jednoduchy pomocny soubor}
-\setinterfacemessage{systems}{10}{nepouzivejte em v --}
-\setinterfacemessage{floatblocks}{1}{-- precislovano / -- => --}
-\setinterfacemessage{floatblocks}{3}{-- presunuto}
-\setinterfacemessage{floatblocks}{2}{-- ulozeno}
-\setinterfacemessage{floatblocks}{5}{poradi prizpusobeno}
-\setinterfacemessage{floatblocks}{4}{-- umisteno}
-\setinterfacemessage{floatblocks}{7}{pocet spodnich plovoucich objektu je omezen na --}
-\setinterfacemessage{floatblocks}{6}{pocet hornich plovoucich objektu je omezen na --}
-\setinterfacemessage{floatblocks}{9}{poradi naruseno}
-\setinterfacemessage{floatblocks}{8}{radku je mene nez --}
-\setinterfacemessage{floatblocks}{title}{plovouciobjekty}
-\setinterfacemessage{floatblocks}{13}{there is nothing to split}
-\setinterfacemessage{floatblocks}{12}{nedefinovano}
-\setinterfacemessage{floatblocks}{11}{nedan zadny blok}
-\setinterfacemessage{floatblocks}{10}{-- omezeno}
-\setinterfacemessage{interactions}{1}{pomer -- x -- (s x v)}
-\setinterfacemessage{interactions}{3}{neaktivni}
-\setinterfacemessage{interactions}{2}{aktivni}
-\setinterfacemessage{interactions}{5}{unknown attachment --}
-\setinterfacemessage{interactions}{4}{zadna strankova synchronizace (--) v hmode}
-\setinterfacemessage{interactions}{6}{attachment file -- does not exist}
-\setinterfacemessage{interactions}{title}{interakce}
-\setinterfacemessage{interactions}{21}{-- kod vlozen}
-\setinterfacemessage{regimes}{1}{kodovani --}
-\setinterfacemessage{regimes}{3}{nezname kodovani --}
-\setinterfacemessage{regimes}{2}{je nacteno kodovani --}
-\setinterfacemessage{regimes}{title}{kodovani}
-\setinterfacemessage{structures}{1}{zacatek oddilu (sekce) --}
-\setinterfacemessage{structures}{title}{struktury}
-\setinterfacemessage{structures}{2}{konec oddilu (sekce) --}
-\setinterfacemessage{linguals}{1}{vzory -- pro -- nacteny (n=--,e=--,m=--)}
-\setinterfacemessage{linguals}{3}{deleni slov -- pro -- nacteno (n=--,e=--,m=--)}
-\setinterfacemessage{linguals}{2}{zadne vzory -- pro -- (n=--,e=--,m=--) (--,--)}
-\setinterfacemessage{linguals}{5}{vzory pro -- nenacteny}
-\setinterfacemessage{linguals}{4}{zadne deleni slov -- pro -- (n=--,e=--,m=--)}
-\setinterfacemessage{linguals}{7}{specificke volby jazyka [--] zavadeji -- (zavlecenou) mezeru}
-\setinterfacemessage{linguals}{6}{jazyk -- neni definovan}
-\setinterfacemessage{linguals}{9}{language -- is active}
-\setinterfacemessage{linguals}{8}{specificke volby jazyka [--] bez mezer pripojeny}
-\setinterfacemessage{linguals}{title}{jazyky}
-\setinterfacemessage{linguals}{10}{vzory -- nacteny}
-\setinterfacemessage{verbatims}{1}{soubor -- neexistuje}
-\setinterfacemessage{verbatims}{title}{verbatim}
-\setinterfacemessage{filters}{1}{filter -- is loaded}
-\setinterfacemessage{filters}{title}{filter}
-\setinterfacemessage{filters}{2}{unknown filter --}
-\setinterfacemessage{textblocks}{1}{nova verze, je treba druhy beh}
-\setinterfacemessage{textblocks}{3}{ctu bloky z --}
-\setinterfacemessage{textblocks}{2}{zapisuji bloky do --}
-\setinterfacemessage{textblocks}{5}{-- neni skryto}
-\setinterfacemessage{textblocks}{4}{je treba druhy beh}
-\setinterfacemessage{textblocks}{7}{-- skryto}
-\setinterfacemessage{textblocks}{6}{-- skryto a zpracovano}
-\setinterfacemessage{textblocks}{9}{-- nevysazeno}
-\setinterfacemessage{textblocks}{8}{-- vysazeno}
-\setinterfacemessage{textblocks}{title}{textovyblok}
-\setinterfacemessage{textblocks}{12}{-- preskoceno}
-\setinterfacemessage{textblocks}{11}{-- nacteno a vysazeno}
-\setinterfacemessage{textblocks}{10}{-- nacteno a zpracovano}
-\setinterfacemessage{encodings}{1}{kodovani --}
-\setinterfacemessage{encodings}{3}{nezname kodovani --}
-\setinterfacemessage{encodings}{2}{je nacteno kodovani --}
-\setinterfacemessage{encodings}{title}{kodovani}
-\setinterfacemessage{columns}{1}{je mozno pouze -- sloupcu}
-\setinterfacemessage{columns}{3}{problem, vypina se vyvazovani}
-\setinterfacemessage{columns}{2}{pouzijte \string\filbreak\space jako alternativu}
-\setinterfacemessage{columns}{5}{spodni plovouci objekt jeste neni podporovan}
-\setinterfacemessage{columns}{4}{horni plovouci objekt jeste neni podporovan}
-\setinterfacemessage{columns}{7}{vyvazovani ukonceno po 100 krocich}
-\setinterfacemessage{columns}{6}{-- plovouci objekt(y) odlozeny}
-\setinterfacemessage{columns}{9}{kontrola nerovnost}
-\setinterfacemessage{columns}{8}{vyvazeno v -- krocich}
-\setinterfacemessage{columns}{title}{sloupce}
-\setinterfacemessage{columns}{13}{siroky plovouci objekt je presunut nad sloupce}
-\setinterfacemessage{columns}{12}{plovouci objekt je presunut do nasledujiciho sloupce / --}
-\setinterfacemessage{columns}{11}{plovouci objekt je pro sloupec prilis siroky}
-\setinterfacemessage{columns}{10}{zbyl (mene nez) 1 radek}
-\setinterfacemessage{symbols}{1}{nacita se soubor symbolu --}
-\setinterfacemessage{symbols}{title}{symboly}
-\setinterfacemessage{files}{1}{synonymum souboru -- je jiz pouzito pro --}
-\setinterfacemessage{files}{title}{soubory}
-\setinterfacemessage{versions}{1}{postradam @+}
-\setinterfacemessage{versions}{3}{oznacene strany: --}
-\setinterfacemessage{versions}{2}{oznacuji se strany}
-\setinterfacemessage{versions}{title}{verze}
-\setinterfacemessage{specials}{1}{-- nacteno}
-\setinterfacemessage{specials}{3}{-- je resetovano}
-\setinterfacemessage{specials}{2}{neni dovoleno hlubsi zanoreni --}
-\setinterfacemessage{specials}{5}{nacita se definicni soubor --}
-\setinterfacemessage{specials}{4}{prikaz -- neexistuje}
-\setinterfacemessage{specials}{7}{neznamy ovladac (driver) --}
-\setinterfacemessage{specials}{6}{zanoreni neni dovoleno}
-\setinterfacemessage{specials}{title}{speciality}
-\setinterfacemessage{layouts}{1}{vyska textu prizpusobena s -- na strane --}
-\setinterfacemessage{layouts}{3}{-- krat text odlozen}
-\setinterfacemessage{layouts}{2}{-- krat odlozeny text umisten}
-\setinterfacemessage{layouts}{5}{okrajove bloky neaktivni}
-\setinterfacemessage{layouts}{4}{okrajove bloky aktivni}
-\setinterfacemessage{layouts}{7}{pocita se misto pro logo}
-\setinterfacemessage{layouts}{6}{sada stran -- zpracovana (velikost --)}
-\setinterfacemessage{layouts}{9}{aktualne ne vice nez -- urovne/urovni vyctu}
-\setinterfacemessage{layouts}{8}{pocita se pozadi}
-\setinterfacemessage{layouts}{title}{layout}
-\setinterfacemessage{layouts}{11}{svisla mezera -- neni povolena v pevnem radkovem rejstriku}
-\setinterfacemessage{layouts}{10}{-- a -- nedava dohromady 1.0}
-\setinterfacemessage{fonts}{1}{kodovani --}
-\setinterfacemessage{fonts}{3}{neznama varianta --}
-\setinterfacemessage{fonts}{2}{varianta -- je nactena}
-\setinterfacemessage{fonts}{5}{styl -- neni definovan}
-\setinterfacemessage{fonts}{4}{zakladni font -- neni definovan}
-\setinterfacemessage{fonts}{7}{neznamy format --}
-\setinterfacemessage{fonts}{6}{-- je nacten}
-\setinterfacemessage{fonts}{14}{bodyfont -- is defined (can better be done global)}
-\setinterfacemessage{fonts}{8}{styl -- definovan}
-\setinterfacemessage{fonts}{title}{zakladnifont}
-\setinterfacemessage{fonts}{10}{neznamy font --}
-\setinterfacemessage{databases}{1}{--}
-\setinterfacemessage{databases}{3}{global file --}
-\setinterfacemessage{databases}{2}{local file --}
-\setinterfacemessage{databases}{4}{unknown file --}
-\setinterfacemessage{databases}{title}{databases}
-\setinterfacemessage{publications}{1}{file -- not found, unknown style ignored}
-\setinterfacemessage{publications}{3}{wrote a new auxiliary file \jobname.aux}
-\setinterfacemessage{publications}{title}{publications}
-\setinterfacemessage{publications}{2}{file -- not found, waiting for bibtex}
-\setinterfacemessage{publications}{4}{loading database from --}
-\setinterfacemessage{publications}{5}{warning: cite argument -- on line \the\inputlineno}
-\setinterfacemessage{publications}{6}{loading formatting style from --}
-\setinterfacemessage{javascript}{1}{nacita se soubor skriptu --}
-\setinterfacemessage{javascript}{title}{javascript}
-\setinterfacemessage{javascript}{2}{neznama preambule --}
-\setinterfacemessage{check}{1}{postradam '=' po '--' na radku --}
-\setinterfacemessage{check}{3}{-- -- nahrazuje makro, uzijte VERZALKY!}
-\setinterfacemessage{check}{2}{ocekavam -- argument(y) na radku --}
-\setinterfacemessage{check}{title}{kontrola}
-\setinterfacemessage{metapost}{1}{loading metapost library --}
-\setinterfacemessage{metapost}{title}{metapost}
-\setinterfacemessage{figures}{1}{obraz -- nelze nalezt}
-\setinterfacemessage{figures}{3}{dimensions of -- are determined externally}
-\setinterfacemessage{figures}{2}{obraz -- nepritomen}
-\setinterfacemessage{figures}{5}{dimensions of -- are unknown}
-\setinterfacemessage{figures}{4}{dimenze obrazu -- nacteny primo z jeho souboru}
-\setinterfacemessage{figures}{6}{dimenze obrazu -- spocteny programem rlxtools}
-\setinterfacemessage{figures}{8}{obrazovy objekt -- je znovu pouzit}
-\setinterfacemessage{figures}{title}{obrazy}
-\setinterfacemessage{colors}{1}{system -- je globalne aktivovana}
-\setinterfacemessage{colors}{3}{-- neni definovana --}
-\setinterfacemessage{colors}{2}{system -- je lokalne activovana}
-\setinterfacemessage{colors}{5}{neznamy system --}
-\setinterfacemessage{colors}{4}{system -- je nacten}
-\setinterfacemessage{colors}{7}{palette -- neni k dispozici}
-\setinterfacemessage{colors}{6}{palette -- je k dispozici}
-\setinterfacemessage{colors}{9}{-- prostor barev neni podporovan}
-\setinterfacemessage{colors}{8}{specifikace -- v barve -- bude cerna}
-\setinterfacemessage{colors}{title}{barva}
-\setinterfacemessage{colors}{12}{-- is registered}
-\setinterfacemessage{colors}{11}{barva je prevedena na sed}
-\setinterfacemessage{colors}{10}{-- prostor barev je podporovan}
-%
-\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/context/base/mkii/mult-mde.mkii b/Master/texmf-dist/tex/context/base/mkii/mult-mde.mkii
deleted file mode 100644
index 4d7f009e482..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/mult-mde.mkii
+++ /dev/null
@@ -1,210 +0,0 @@
-\setinterfacemessage{references}{1}{unbekannte Referenz --}
-\setinterfacemessage{references}{30}{unbekanntes Object --}
-\setinterfacemessage{references}{3}{unbekannte Referenz Typ --}
-\setinterfacemessage{references}{2}{doppelte Referenz -- auf Seite --}
-\setinterfacemessage{references}{5}{number of unknown references: --}
-\setinterfacemessage{references}{4}{illegale Referenz --}
-\setinterfacemessage{references}{6}{number of illegal references: --}
-\setinterfacemessage{references}{25}{references from document '--' are not imported (export again)}
-\setinterfacemessage{references}{24}{references from document '--' are not exported}
-\setinterfacemessage{references}{title}{referenzen}
-\setinterfacemessage{references}{26}{references from document '--' are imported}
-\setinterfacemessage{references}{31}{doppeltes Object --}
-\setinterfacemessage{references}{21}{Dokument -- geladen}
-\setinterfacemessage{references}{22}{Dokument -- ist nicht aktiv}
-\setinterfacemessage{references}{23}{Obskure Referenz -- (Prefix=--)}
-\setinterfacemessage{documents}{1}{Blatt --}
-\setinterfacemessage{documents}{title}{Blaetter}
-\setinterfacemessage{documents}{2}{Nummer --}
-\setinterfacemessage{handlings}{1}{Font Verarbeitung --}
-\setinterfacemessage{handlings}{3}{unknown font handling --}
-\setinterfacemessage{handlings}{2}{Font Verarbeitung -- ist geladen}
-\setinterfacemessage{handlings}{title}{handling}
-\setinterfacemessage{systems}{title}{system}
-\setinterfacemessage{systems}{41}{Externe Datei -- in Gruppe -- existiert nicht}
-\setinterfacemessage{systems}{9}{-- nicht gefunden/verarbeitet}
-\setinterfacemessage{systems}{91}{papertray --}
-\setinterfacemessage{systems}{8}{Neue Version der Hilfsdatei, zweiter Durchlauf benoetigt}
-\setinterfacemessage{systems}{21}{Die Hilfsdatei ist nicht geladen}
-\setinterfacemessage{systems}{20}{Bedeutung (sortieren) von -- geladen}
-\setinterfacemessage{systems}{5}{Modul -- geladen}
-\setinterfacemessage{systems}{4}{Befehl -- ist bereits definiert}
-\setinterfacemessage{systems}{27}{Version}
-\setinterfacemessage{systems}{26}{Register}
-\setinterfacemessage{systems}{25}{Referenzen}
-\setinterfacemessage{systems}{24}{Fliessbloecke}
-\setinterfacemessage{systems}{1}{Laden der Hilfsdatei aufgeschoben (Eingabe-Modus)}
-\setinterfacemessage{systems}{23}{-- angeordnet auf --}
-\setinterfacemessage{systems}{22}{Benoetige gueltige Hilfsdateie}
-\setinterfacemessage{systems}{2}{-- geladen}
-\setinterfacemessage{systems}{19}{Bedeutung (synonyme) von -- geladen}
-\setinterfacemessage{systems}{18}{Synonym -- -- existiert nicht}
-\setinterfacemessage{systems}{7}{Modul -- bereits geladen}
-\setinterfacemessage{systems}{6}{Modul -- gefunden}
-\setinterfacemessage{systems}{14}{Erzwungendes Seitenumbruch in Liste bei --}
-\setinterfacemessage{systems}{15}{Speichere Buffer --}
-\setinterfacemessage{systems}{16}{Setzte Buffer --}
-\setinterfacemessage{systems}{17}{Setzte tippen-Buffer --}
-\setinterfacemessage{systems}{13}{Beschriftung -- definiert --}
-\setinterfacemessage{systems}{12}{Die Hilfdatei ist nicht sortiert, verwende texutil}
-\setinterfacemessage{systems}{11}{Erstelle einfache Hilfdatei}
-\setinterfacemessage{systems}{10}{Benutzte kein em in --}
-\setinterfacemessage{floatblocks}{1}{-- neu nummeriert / -- => --}
-\setinterfacemessage{floatblocks}{3}{-- verschoben}
-\setinterfacemessage{floatblocks}{2}{-- gespeichert}
-\setinterfacemessage{floatblocks}{5}{Reihenfolge angepasst}
-\setinterfacemessage{floatblocks}{4}{-- plaziert}
-\setinterfacemessage{floatblocks}{7}{Anz. der unteren Gleitobjekte beschraengt auf --}
-\setinterfacemessage{floatblocks}{6}{Anz. der oberen Gleitobjekte beschraengt auf --}
-\setinterfacemessage{floatblocks}{9}{Reigenfolge gestoert}
-\setinterfacemessage{floatblocks}{8}{weniger als -- zeilen}
-\setinterfacemessage{floatblocks}{title}{Gleitobjektbloecke}
-\setinterfacemessage{floatblocks}{13}{there is nothing to split}
-\setinterfacemessage{floatblocks}{12}{undefiniert}
-\setinterfacemessage{floatblocks}{11}{kein Block gegeben}
-\setinterfacemessage{floatblocks}{10}{-- begrenzt}
-\setinterfacemessage{interactions}{1}{Seitenverhaeltnis -- x -- (B x H)}
-\setinterfacemessage{interactions}{3}{inaktiv}
-\setinterfacemessage{interactions}{2}{aktiv}
-\setinterfacemessage{interactions}{5}{unknown attachment --}
-\setinterfacemessage{interactions}{4}{keine Seitensynchronisation (--) im hmode}
-\setinterfacemessage{interactions}{6}{attachment file -- does not exist}
-\setinterfacemessage{interactions}{title}{Interaktion}
-\setinterfacemessage{interactions}{21}{-- Code eingefuegt}
-\setinterfacemessage{regimes}{1}{Kodierung --}
-\setinterfacemessage{regimes}{3}{Unbekannte Kodierung --}
-\setinterfacemessage{regimes}{2}{Kodierung -- ist geladen}
-\setinterfacemessage{regimes}{title}{Kodierung}
-\setinterfacemessage{structures}{1}{Begin des Abschnittsblocks --}
-\setinterfacemessage{structures}{title}{struktur}
-\setinterfacemessage{structures}{2}{Ende des Abschnittsblocks --}
-\setinterfacemessage{linguals}{1}{Trennmuster -- fuer -- geladen (n=--,e=--,m=--)}
-\setinterfacemessage{linguals}{3}{Trenndefinitionen -- fuer -- geladen (n=--,e=--,m=--)}
-\setinterfacemessage{linguals}{2}{Keine Trennmuster -- fuer -- (n=--,e=--,m=--) (--,--)}
-\setinterfacemessage{linguals}{5}{Trennmuster fuer -- nicht geladen}
-\setinterfacemessage{linguals}{4}{Keine Trenndefinitionen -- fuer -- (n=--,e=--,m=--)}
-\setinterfacemessage{linguals}{7}{Sprachenspezifische Option [--] fuegt eine Luecke von -- ein}
-\setinterfacemessage{linguals}{6}{Sprache -- ist undefiniert}
-\setinterfacemessage{linguals}{9}{Sprache -- ist aktiv}
-\setinterfacemessage{linguals}{8}{Sprachenspezifische Option [--] nahtlos hinzugefuegt}
-\setinterfacemessage{linguals}{title}{Sprache}
-\setinterfacemessage{linguals}{10}{Trennmuster -- geladen}
-\setinterfacemessage{verbatims}{1}{Datei -- existiert nicht}
-\setinterfacemessage{verbatims}{title}{verbatim}
-\setinterfacemessage{filters}{1}{filter -- ist geladen}
-\setinterfacemessage{filters}{title}{filter}
-\setinterfacemessage{filters}{2}{unknown filter --}
-\setinterfacemessage{textblocks}{1}{neue Version, zweiter Durchlauf benoetigt}
-\setinterfacemessage{textblocks}{3}{lese Bloecke von --}
-\setinterfacemessage{textblocks}{2}{schreibe Bloecke zu --}
-\setinterfacemessage{textblocks}{5}{-- nicht verborgen}
-\setinterfacemessage{textblocks}{4}{zweiter Durchlauf benoetigt}
-\setinterfacemessage{textblocks}{7}{-- verborgen}
-\setinterfacemessage{textblocks}{6}{-- verborgen und verarbeitet}
-\setinterfacemessage{textblocks}{9}{-- nicht gesetzt}
-\setinterfacemessage{textblocks}{8}{-- gesetzt}
-\setinterfacemessage{textblocks}{title}{textblock}
-\setinterfacemessage{textblocks}{12}{-- ausgelassen}
-\setinterfacemessage{textblocks}{11}{-- geladen und gesetzt}
-\setinterfacemessage{textblocks}{10}{-- geladen und verarbeitet}
-\setinterfacemessage{encodings}{1}{Kodierung --}
-\setinterfacemessage{encodings}{3}{Unbekannte Kodierung --}
-\setinterfacemessage{encodings}{2}{Kodierung -- ist geladen}
-\setinterfacemessage{encodings}{title}{Kodierung}
-\setinterfacemessage{columns}{1}{nur -- Spalten moeglich}
-\setinterfacemessage{columns}{3}{Problem, verwende [ausgleich=nein]}
-\setinterfacemessage{columns}{2}{benutzte \string\filbreak\space als Alternative}
-\setinterfacemessage{columns}{5}{Gleitobjekt unten ncoh nicht unterstuetzt}
-\setinterfacemessage{columns}{4}{Gleitobjekt oben ncoh nicht unterstuetzt}
-\setinterfacemessage{columns}{7}{ausgleich nach 100 Schritten abgebrocheb}
-\setinterfacemessage{columns}{6}{-- Gleitobjekt(e) verschoben}
-\setinterfacemessage{columns}{9}{Ausrichtung ueberpruefen}
-\setinterfacemessage{columns}{8}{ausgeglichen nach -- Schritt(en)}
-\setinterfacemessage{columns}{title}{Spalten}
-\setinterfacemessage{columns}{13}{breites Gleitobjekt an den Anfang der Spalten verschoben}
-\setinterfacemessage{columns}{12}{Gleitobjekt in naechste Zeile verschoben / --}
-\setinterfacemessage{columns}{11}{Gleitobjekt zu breit fuer Spalte}
-\setinterfacemessage{columns}{10}{(weniger als) 1 Zeile uebrig}
-\setinterfacemessage{symbols}{1}{Lade Symboldatei --}
-\setinterfacemessage{symbols}{title}{Symbole}
-\setinterfacemessage{files}{1}{Dateisynonym -- wird bereits fuer -- benutzt}
-\setinterfacemessage{files}{title}{files}
-\setinterfacemessage{versions}{1}{fehlendes @+}
-\setinterfacemessage{versions}{3}{Ausgewaehlte Seiten: --}
-\setinterfacemessage{versions}{2}{Erstelle Seiten}
-\setinterfacemessage{versions}{title}{Version}
-\setinterfacemessage{specials}{1}{-- geladen}
-\setinterfacemessage{specials}{3}{-- ist zurueckgesetzt}
-\setinterfacemessage{specials}{2}{keine tiefere Verschachtelung erlaubt --}
-\setinterfacemessage{specials}{5}{lade Definitionsdatei --}
-\setinterfacemessage{specials}{4}{Befehl -- existiert nicht}
-\setinterfacemessage{specials}{7}{unbekante Driver --}
-\setinterfacemessage{specials}{6}{Verschachtelung nicht erlaubt}
-\setinterfacemessage{specials}{title}{spezielles}
-\setinterfacemessage{layouts}{1}{Texthoehe angepasst mit -- auf Seite --}
-\setinterfacemessage{layouts}{3}{-- mal Text verschoben}
-\setinterfacemessage{layouts}{2}{-- mal verschobener Text plaziert}
-\setinterfacemessage{layouts}{5}{marginalbloecke inaktiv}
-\setinterfacemessage{layouts}{4}{marginalbloecke aktiv}
-\setinterfacemessage{layouts}{7}{berechne Platzbedarf des Logos}
-\setinterfacemessage{layouts}{6}{Unterseitenfolge -- verarbeitet (Groesse --)}
-\setinterfacemessage{layouts}{9}{z.Z. nicht mehr als -- Ebenen in Aufzaehlungen}
-\setinterfacemessage{layouts}{8}{berechne Hintergrund}
-\setinterfacemessage{layouts}{title}{Layout}
-\setinterfacemessage{layouts}{11}{Zwischenraum -- nicht im Grittermoduserlau}
-\setinterfacemessage{layouts}{10}{-- und -- ergeben zusammen nicht 1.0}
-\setinterfacemessage{fonts}{1}{Kodierung --}
-\setinterfacemessage{fonts}{3}{Unbekannte Variante --}
-\setinterfacemessage{fonts}{2}{Variante -- ist geladen}
-\setinterfacemessage{fonts}{5}{Stil -- ist nicht definiert}
-\setinterfacemessage{fonts}{4}{Fliesstext -- ist nicht definiert}
-\setinterfacemessage{fonts}{7}{unbekanntes Format --}
-\setinterfacemessage{fonts}{6}{-- ist geladen}
-\setinterfacemessage{fonts}{14}{Fliesstext -- wurde definiert (besser waere globale Definition)}
-\setinterfacemessage{fonts}{8}{Stil -- definiert}
-\setinterfacemessage{fonts}{title}{Fliesstext}
-\setinterfacemessage{fonts}{10}{unbekanntes Font --}
-\setinterfacemessage{databases}{1}{--}
-\setinterfacemessage{databases}{3}{globale Datei --}
-\setinterfacemessage{databases}{2}{lokale Datei --}
-\setinterfacemessage{databases}{4}{unbekannte Datei --}
-\setinterfacemessage{databases}{title}{Datenbank}
-\setinterfacemessage{publications}{1}{file -- not found, unknown style ignored}
-\setinterfacemessage{publications}{3}{wrote a new auxiliary file \jobname.aux}
-\setinterfacemessage{publications}{title}{publications}
-\setinterfacemessage{publications}{2}{file -- not found, waiting for bibtex}
-\setinterfacemessage{publications}{4}{loading database from --}
-\setinterfacemessage{publications}{5}{warning: cite argument -- on line \the\inputlineno}
-\setinterfacemessage{publications}{6}{loading formatting style from --}
-\setinterfacemessage{javascript}{1}{Lade Scriptdatei --}
-\setinterfacemessage{javascript}{title}{javascript}
-\setinterfacemessage{javascript}{2}{unbekannte Preamble --}
-\setinterfacemessage{check}{1}{Fehlendes '=' nach '--' in Zeile --}
-\setinterfacemessage{check}{3}{-- -- ersetzt ein Makro, verwende VERSALIEN!}
-\setinterfacemessage{check}{2}{-- Argument(e) in Zeile -- erwartet}
-\setinterfacemessage{check}{title}{check}
-\setinterfacemessage{metapost}{1}{Lade metapost Bibliothek --}
-\setinterfacemessage{metapost}{title}{metapost}
-\setinterfacemessage{figures}{1}{Abbildung -- kann nicht gefunden werden}
-\setinterfacemessage{figures}{3}{dimensions of -- are determined externally}
-\setinterfacemessage{figures}{2}{Abbildung -- wird nicht erstellt}
-\setinterfacemessage{figures}{5}{Dimensions of -- are unknown}
-\setinterfacemessage{figures}{4}{Dimensionen von -- geladen aus der Abbildungsdatei selbst}
-\setinterfacemessage{figures}{6}{Dimensionen von -- ausgerechnet durch rlxtools}
-\setinterfacemessage{figures}{8}{Abbildungobjekt -- wurde wiederverwandt}
-\setinterfacemessage{figures}{title}{Abbildungen}
-\setinterfacemessage{colors}{1}{system -- ist global aktiviert}
-\setinterfacemessage{colors}{3}{-- ist undefiniert --}
-\setinterfacemessage{colors}{2}{system -- ist lokal aktiviert}
-\setinterfacemessage{colors}{5}{unbekanntes System --}
-\setinterfacemessage{colors}{4}{system -- ist geladen}
-\setinterfacemessage{colors}{7}{palette -- ist nicht verfuegbar}
-\setinterfacemessage{colors}{6}{palette -- ist verfuegbar}
-\setinterfacemessage{colors}{9}{-- Farbraum wird nicht unterstuetzt}
-\setinterfacemessage{colors}{8}{Spezifikation -- bei Farbe -- wird schwarz}
-\setinterfacemessage{colors}{title}{farbe}
-\setinterfacemessage{colors}{12}{-- is registered}
-\setinterfacemessage{colors}{11}{Farbe wird in Grau umgewandelt}
-\setinterfacemessage{colors}{10}{-- Farbraum wird unterstuetzt}
-%
-\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/context/base/mkii/mult-men.mkii b/Master/texmf-dist/tex/context/base/mkii/mult-men.mkii
deleted file mode 100644
index a8d42935602..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/mult-men.mkii
+++ /dev/null
@@ -1,210 +0,0 @@
-\setinterfacemessage{references}{1}{unknown reference --}
-\setinterfacemessage{references}{30}{unknown object --}
-\setinterfacemessage{references}{3}{unknown reference type --}
-\setinterfacemessage{references}{2}{duplicate reference -- on page --}
-\setinterfacemessage{references}{5}{number of unknown references: --}
-\setinterfacemessage{references}{4}{illegal reference --}
-\setinterfacemessage{references}{6}{number of illegal references: --}
-\setinterfacemessage{references}{25}{references from document '--' are not imported (export again)}
-\setinterfacemessage{references}{24}{references from document '--' are not exported}
-\setinterfacemessage{references}{title}{references}
-\setinterfacemessage{references}{26}{references from document '--' are imported}
-\setinterfacemessage{references}{31}{duplicate object --}
-\setinterfacemessage{references}{21}{document -- loaded}
-\setinterfacemessage{references}{22}{document -- is not interactive}
-\setinterfacemessage{references}{23}{obscure reference -- (prefix=--)}
-\setinterfacemessage{documents}{1}{sheet --}
-\setinterfacemessage{documents}{title}{sheets}
-\setinterfacemessage{documents}{2}{number --}
-\setinterfacemessage{handlings}{1}{font handling --}
-\setinterfacemessage{handlings}{3}{unknown font handling --}
-\setinterfacemessage{handlings}{2}{font handling -- is loaded}
-\setinterfacemessage{handlings}{title}{handling}
-\setinterfacemessage{systems}{title}{system}
-\setinterfacemessage{systems}{41}{external file -- in group -- does not exist}
-\setinterfacemessage{systems}{9}{-- not found/processed}
-\setinterfacemessage{systems}{91}{papertray --}
-\setinterfacemessage{systems}{8}{new version of utility file, second pass needed}
-\setinterfacemessage{systems}{21}{no utility data is loaded}
-\setinterfacemessage{systems}{20}{meaning (sorts) of -- loaded}
-\setinterfacemessage{systems}{5}{module -- loaded}
-\setinterfacemessage{systems}{4}{command -- is already defined}
-\setinterfacemessage{systems}{27}{Version}
-\setinterfacemessage{systems}{26}{Registers}
-\setinterfacemessage{systems}{25}{References}
-\setinterfacemessage{systems}{24}{Floatblocks}
-\setinterfacemessage{systems}{1}{loading utility-file postponed (typemode)}
-\setinterfacemessage{systems}{23}{-- arranged at --}
-\setinterfacemessage{systems}{22}{use a valid utilityfile}
-\setinterfacemessage{systems}{2}{-- loaded}
-\setinterfacemessage{systems}{19}{meaning (synonyms) of -- loaded}
-\setinterfacemessage{systems}{18}{synonym -- -- does not exist}
-\setinterfacemessage{systems}{7}{module -- already loaded}
-\setinterfacemessage{systems}{6}{module -- not found}
-\setinterfacemessage{systems}{14}{forced newpage in list at --}
-\setinterfacemessage{systems}{15}{saving buffer --}
-\setinterfacemessage{systems}{16}{typesetting buffer --}
-\setinterfacemessage{systems}{17}{typesetting verbatim buffer --}
-\setinterfacemessage{systems}{13}{mark -- defined --}
-\setinterfacemessage{systems}{12}{the utility-file is not sorted, use texutil}
-\setinterfacemessage{systems}{11}{building simple util}
-\setinterfacemessage{systems}{10}{don't use em in --}
-\setinterfacemessage{floatblocks}{1}{-- renumbered / -- => --}
-\setinterfacemessage{floatblocks}{3}{-- moved}
-\setinterfacemessage{floatblocks}{2}{-- saved}
-\setinterfacemessage{floatblocks}{5}{order adapted}
-\setinterfacemessage{floatblocks}{4}{-- placed}
-\setinterfacemessage{floatblocks}{7}{n of bottom floats limited to --}
-\setinterfacemessage{floatblocks}{6}{n of top floats limited to --}
-\setinterfacemessage{floatblocks}{9}{order disturbed}
-\setinterfacemessage{floatblocks}{8}{less than -- lines}
-\setinterfacemessage{floatblocks}{title}{floatblocks}
-\setinterfacemessage{floatblocks}{13}{there is nothing to split}
-\setinterfacemessage{floatblocks}{12}{undefined}
-\setinterfacemessage{floatblocks}{11}{no block given}
-\setinterfacemessage{floatblocks}{10}{-- limited}
-\setinterfacemessage{interactions}{1}{aspect ratio -- x -- (b x h)}
-\setinterfacemessage{interactions}{3}{inactive}
-\setinterfacemessage{interactions}{2}{active}
-\setinterfacemessage{interactions}{5}{unknown attachment --}
-\setinterfacemessage{interactions}{4}{no pagesynchronisation (--) in hmode}
-\setinterfacemessage{interactions}{6}{attachment file -- does not exist}
-\setinterfacemessage{interactions}{title}{interaction}
-\setinterfacemessage{interactions}{21}{-- code inserted}
-\setinterfacemessage{regimes}{1}{regime --}
-\setinterfacemessage{regimes}{3}{unknown regime --}
-\setinterfacemessage{regimes}{2}{regime -- is loaded}
-\setinterfacemessage{regimes}{title}{regime}
-\setinterfacemessage{structures}{1}{begin of sectionblock --}
-\setinterfacemessage{structures}{title}{structure}
-\setinterfacemessage{structures}{2}{end of sectionblock --}
-\setinterfacemessage{linguals}{1}{patterns -- for -- loaded (n=--,e=--,m=--)}
-\setinterfacemessage{linguals}{3}{hyphenations -- for -- loaded (n=--,e=--,m=--)}
-\setinterfacemessage{linguals}{2}{no patterns -- for -- (n=--,e=--,m=--) (--,--)}
-\setinterfacemessage{linguals}{5}{patterns for -- not loaded}
-\setinterfacemessage{linguals}{4}{no hyphenations -- for -- (n=--,e=--,m=--)}
-\setinterfacemessage{linguals}{7}{language specific options [--] introduce a -- skip}
-\setinterfacemessage{linguals}{6}{language -- is undefined}
-\setinterfacemessage{linguals}{9}{language -- is active}
-\setinterfacemessage{linguals}{8}{language specific options [--] seamless appended}
-\setinterfacemessage{linguals}{title}{language}
-\setinterfacemessage{linguals}{10}{patterns -- loaded}
-\setinterfacemessage{verbatims}{1}{file -- does not exist}
-\setinterfacemessage{verbatims}{title}{verbatim}
-\setinterfacemessage{filters}{1}{filter -- is loaded}
-\setinterfacemessage{filters}{title}{filter}
-\setinterfacemessage{filters}{2}{unknown filter --}
-\setinterfacemessage{textblocks}{1}{new version, second pass needed}
-\setinterfacemessage{textblocks}{3}{reading blocks from --}
-\setinterfacemessage{textblocks}{2}{writing blocks to --}
-\setinterfacemessage{textblocks}{5}{-- not hidden}
-\setinterfacemessage{textblocks}{4}{second pass needed}
-\setinterfacemessage{textblocks}{7}{-- hidden}
-\setinterfacemessage{textblocks}{6}{-- hidden and processed}
-\setinterfacemessage{textblocks}{9}{-- not typeset}
-\setinterfacemessage{textblocks}{8}{-- typeset}
-\setinterfacemessage{textblocks}{title}{textblocks}
-\setinterfacemessage{textblocks}{12}{-- skipped}
-\setinterfacemessage{textblocks}{11}{-- loaded and typeset}
-\setinterfacemessage{textblocks}{10}{-- loaded and processed}
-\setinterfacemessage{encodings}{1}{coding --}
-\setinterfacemessage{encodings}{3}{unknown coding --}
-\setinterfacemessage{encodings}{2}{coding -- is loaded}
-\setinterfacemessage{encodings}{title}{encoding}
-\setinterfacemessage{columns}{1}{only -- columns possible}
-\setinterfacemessage{columns}{3}{problems, disable balancing}
-\setinterfacemessage{columns}{2}{use \string\filbreak\space as alternative}
-\setinterfacemessage{columns}{5}{bottom float not yet supported}
-\setinterfacemessage{columns}{4}{top float not yet supported}
-\setinterfacemessage{columns}{7}{balancing aborted after 100 steps}
-\setinterfacemessage{columns}{6}{-- float(s) postponed}
-\setinterfacemessage{columns}{9}{check raggedness}
-\setinterfacemessage{columns}{8}{balanced in -- step(s)}
-\setinterfacemessage{columns}{title}{columns}
-\setinterfacemessage{columns}{13}{wide float moved to top of columns}
-\setinterfacemessage{columns}{12}{float moved to next column / --}
-\setinterfacemessage{columns}{11}{float too wide for column}
-\setinterfacemessage{columns}{10}{(less than) 1 line left}
-\setinterfacemessage{symbols}{1}{loading symbolset --}
-\setinterfacemessage{symbols}{title}{symbols}
-\setinterfacemessage{files}{1}{file synonym -- is already used for --}
-\setinterfacemessage{files}{title}{files}
-\setinterfacemessage{versions}{1}{missing @+}
-\setinterfacemessage{versions}{3}{selected pages: --}
-\setinterfacemessage{versions}{2}{marking pages}
-\setinterfacemessage{versions}{title}{version}
-\setinterfacemessage{specials}{1}{-- loaded}
-\setinterfacemessage{specials}{3}{-- is reset}
-\setinterfacemessage{specials}{2}{no deeper nesting is permitted --}
-\setinterfacemessage{specials}{5}{loading definition file --}
-\setinterfacemessage{specials}{4}{command -- does not exist}
-\setinterfacemessage{specials}{7}{unknown driver --}
-\setinterfacemessage{specials}{6}{nesting is not permitted}
-\setinterfacemessage{specials}{title}{specials}
-\setinterfacemessage{layouts}{1}{textheight adapted with -- at page --}
-\setinterfacemessage{layouts}{3}{-- times text postponed}
-\setinterfacemessage{layouts}{2}{-- times postponed text placed}
-\setinterfacemessage{layouts}{5}{marginblocks inactive}
-\setinterfacemessage{layouts}{4}{marginblocks active}
-\setinterfacemessage{layouts}{7}{calculating logospace}
-\setinterfacemessage{layouts}{6}{subpage set -- processed (size --)}
-\setinterfacemessage{layouts}{9}{currently no more than -- levels in itemizations}
-\setinterfacemessage{layouts}{8}{calculating backgrounds}
-\setinterfacemessage{layouts}{title}{layout}
-\setinterfacemessage{layouts}{11}{spacing -- not permitted in gridmode}
-\setinterfacemessage{layouts}{10}{-- and -- don't add up to 1.0}
-\setinterfacemessage{fonts}{1}{coding --}
-\setinterfacemessage{fonts}{3}{unknown variant --}
-\setinterfacemessage{fonts}{2}{variant -- is loaded}
-\setinterfacemessage{fonts}{5}{style -- is not defined}
-\setinterfacemessage{fonts}{4}{bodyfont -- is not defined}
-\setinterfacemessage{fonts}{7}{unknown format --}
-\setinterfacemessage{fonts}{6}{-- is loaded}
-\setinterfacemessage{fonts}{14}{bodyfont -- is defined (can better be done global)}
-\setinterfacemessage{fonts}{8}{style -- defined}
-\setinterfacemessage{fonts}{title}{bodyfont}
-\setinterfacemessage{fonts}{10}{unknown font file --}
-\setinterfacemessage{databases}{1}{--}
-\setinterfacemessage{databases}{3}{global file --}
-\setinterfacemessage{databases}{2}{local file --}
-\setinterfacemessage{databases}{4}{unknown file --}
-\setinterfacemessage{databases}{title}{databases}
-\setinterfacemessage{publications}{1}{file -- not found, unknown style ignored}
-\setinterfacemessage{publications}{3}{wrote a new auxiliary file \jobname.aux}
-\setinterfacemessage{publications}{title}{publications}
-\setinterfacemessage{publications}{2}{file -- not found, waiting for bibtex}
-\setinterfacemessage{publications}{4}{loading database from --}
-\setinterfacemessage{publications}{5}{warning: cite argument -- on line \the\inputlineno}
-\setinterfacemessage{publications}{6}{loading formatting style from --}
-\setinterfacemessage{javascript}{1}{loading script set --}
-\setinterfacemessage{javascript}{title}{javascript}
-\setinterfacemessage{javascript}{2}{unknown preamble --}
-\setinterfacemessage{check}{1}{missing or ungrouped '=' after '--' in line --}
-\setinterfacemessage{check}{3}{-- -- replaces a macro, use CAPITALS!}
-\setinterfacemessage{check}{2}{-- argument(s) expected in line --}
-\setinterfacemessage{check}{title}{check}
-\setinterfacemessage{metapost}{1}{loading metapost library --}
-\setinterfacemessage{metapost}{title}{metapost}
-\setinterfacemessage{figures}{1}{figure -- can not be found}
-\setinterfacemessage{figures}{3}{dimensions of -- are determined externally}
-\setinterfacemessage{figures}{2}{figure -- is not preset}
-\setinterfacemessage{figures}{5}{dimensions of -- are unknown}
-\setinterfacemessage{figures}{4}{dimensions of -- loaded from figurefile itself}
-\setinterfacemessage{figures}{6}{dimensions of -- calculated by rlxtools}
-\setinterfacemessage{figures}{8}{figureobject -- is reused}
-\setinterfacemessage{figures}{title}{figures}
-\setinterfacemessage{colors}{1}{system -- is global activated}
-\setinterfacemessage{colors}{3}{-- is not defined --}
-\setinterfacemessage{colors}{2}{system -- is local activated}
-\setinterfacemessage{colors}{5}{unknown system --}
-\setinterfacemessage{colors}{4}{system -- is loaded}
-\setinterfacemessage{colors}{7}{palette -- is not available}
-\setinterfacemessage{colors}{6}{palette -- is available}
-\setinterfacemessage{colors}{9}{-- color space is not supported}
-\setinterfacemessage{colors}{8}{specification -- at color -- becomes black}
-\setinterfacemessage{colors}{title}{color}
-\setinterfacemessage{colors}{12}{-- is registered}
-\setinterfacemessage{colors}{11}{color is converted to gray}
-\setinterfacemessage{colors}{10}{-- color space is supported}
-%
-\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/context/base/mkii/mult-mfr.mkii b/Master/texmf-dist/tex/context/base/mkii/mult-mfr.mkii
deleted file mode 100644
index 7fee954c039..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/mult-mfr.mkii
+++ /dev/null
@@ -1,210 +0,0 @@
-\setinterfacemessage{references}{1}{réference -- inconnue}
-\setinterfacemessage{references}{30}{objet -- inconnu}
-\setinterfacemessage{references}{3}{type -- de réference inconnu}
-\setinterfacemessage{references}{2}{réference -- dupliquée à la page --}
-\setinterfacemessage{references}{5}{number of unknown references: --}
-\setinterfacemessage{references}{4}{réference -- inconnue}
-\setinterfacemessage{references}{6}{number of illegal references: --}
-\setinterfacemessage{references}{25}{references from document '--' are not imported (export again)}
-\setinterfacemessage{references}{24}{references from document '--' are not exported}
-\setinterfacemessage{references}{title}{réferences}
-\setinterfacemessage{references}{26}{references from document '--' are imported}
-\setinterfacemessage{references}{31}{objet -- dupliqué}
-\setinterfacemessage{references}{21}{document -- chargé}
-\setinterfacemessage{references}{22}{le document -- n'est pas interactif}
-\setinterfacemessage{references}{23}{reference -- indéterminé (préfixe=--)}
-\setinterfacemessage{documents}{1}{sheet --}
-\setinterfacemessage{documents}{title}{sheets}
-\setinterfacemessage{documents}{2}{number --}
-\setinterfacemessage{handlings}{1}{manipulation -- de police}
-\setinterfacemessage{handlings}{3}{manipulation -- inconnue de police}
-\setinterfacemessage{handlings}{2}{la manipulation -- de police est chargée}
-\setinterfacemessage{handlings}{title}{manipulation}
-\setinterfacemessage{systems}{title}{système}
-\setinterfacemessage{systems}{41}{le fichier externe -- du groupe -- n'existe pas}
-\setinterfacemessage{systems}{9}{-- non trouvé/traité}
-\setinterfacemessage{systems}{91}{papertray --}
-\setinterfacemessage{systems}{8}{nouvelle version de fichier utilitaire, seconde passe nécessaire}
-\setinterfacemessage{systems}{21}{pas de données utilitaires chargées}
-\setinterfacemessage{systems}{20}{signification (tris) de -- chargée}
-\setinterfacemessage{systems}{5}{module -- chargé}
-\setinterfacemessage{systems}{4}{la commande -- est déjà définie}
-\setinterfacemessage{systems}{27}{Version}
-\setinterfacemessage{systems}{26}{Registres}
-\setinterfacemessage{systems}{25}{Réferences}
-\setinterfacemessage{systems}{24}{blocsflottants}
-\setinterfacemessage{systems}{1}{chargement de fichier utilitaire reporté (typemode)}
-\setinterfacemessage{systems}{23}{-- arrangé à --}
-\setinterfacemessage{systems}{22}{utilise un fichier utilitaire valide}
-\setinterfacemessage{systems}{2}{-- chargé}
-\setinterfacemessage{systems}{19}{signification (synonymes) de -- chargée}
-\setinterfacemessage{systems}{18}{le synonyme -- -- n'existe pas}
-\setinterfacemessage{systems}{7}{module -- déjà chargé}
-\setinterfacemessage{systems}{6}{module -- non trouvé}
-\setinterfacemessage{systems}{14}{nouvellepage forcée dans la liste à --}
-\setinterfacemessage{systems}{15}{sauvegarde du tampon (buffer) --}
-\setinterfacemessage{systems}{16}{composition du tampon (buffer) --}
-\setinterfacemessage{systems}{17}{composition textuelle du tampon (buffer) --}
-\setinterfacemessage{systems}{13}{marquage -- defini --}
-\setinterfacemessage{systems}{12}{le fichier utilitaire n'est pas trié, utilise texutil}
-\setinterfacemessage{systems}{11}{construction util simple}
-\setinterfacemessage{systems}{10}{n'utilisez pas em dans --}
-\setinterfacemessage{floatblocks}{1}{-- renuméroté / -- => --}
-\setinterfacemessage{floatblocks}{3}{-- déplacé}
-\setinterfacemessage{floatblocks}{2}{-- sauvegardé}
-\setinterfacemessage{floatblocks}{5}{ordre adapté}
-\setinterfacemessage{floatblocks}{4}{-- placé}
-\setinterfacemessage{floatblocks}{7}{n flottants de bas de page limité à --}
-\setinterfacemessage{floatblocks}{6}{n flottants de haut de page limité à --}
-\setinterfacemessage{floatblocks}{9}{ordre perturbé}
-\setinterfacemessage{floatblocks}{8}{moins de -- lignes}
-\setinterfacemessage{floatblocks}{title}{blocs de flottants}
-\setinterfacemessage{floatblocks}{13}{there is nothing to split}
-\setinterfacemessage{floatblocks}{12}{indéfini}
-\setinterfacemessage{floatblocks}{11}{pas de bloc donné}
-\setinterfacemessage{floatblocks}{10}{-- limité}
-\setinterfacemessage{interactions}{1}{ratio d'aspect -- x -- (b x h)}
-\setinterfacemessage{interactions}{3}{inactif}
-\setinterfacemessage{interactions}{2}{actif}
-\setinterfacemessage{interactions}{5}{le fichier joint -- est inconnu}
-\setinterfacemessage{interactions}{4}{pas de synchronisation de page (--) dans le hmode}
-\setinterfacemessage{interactions}{6}{le fichier joint -- n'existe pas}
-\setinterfacemessage{interactions}{title}{interaction}
-\setinterfacemessage{interactions}{21}{-- code inseré}
-\setinterfacemessage{regimes}{1}{encodage --}
-\setinterfacemessage{regimes}{3}{encodage -- inconnu}
-\setinterfacemessage{regimes}{2}{l'encodage -- est chargé}
-\setinterfacemessage{regimes}{title}{encodage}
-\setinterfacemessage{structures}{1}{début de blocsection --}
-\setinterfacemessage{structures}{title}{structure}
-\setinterfacemessage{structures}{2}{fin de blocsection --}
-\setinterfacemessage{linguals}{1}{les motifs -- pour -- sont chargés (n=--,e=--,m=--)}
-\setinterfacemessage{linguals}{3}{hyphenations -- pour -- chargés (n=--,e=--,m=--)}
-\setinterfacemessage{linguals}{2}{pas de motifs -- pour -- (n=--,e=--,m=--) (--,--)}
-\setinterfacemessage{linguals}{5}{les motifs pour -- ne sont pas chargés}
-\setinterfacemessage{linguals}{4}{pas d'hyphenations -- pour -- (n=--,e=--,m=--)}
-\setinterfacemessage{linguals}{7}{les options spécifiques de langue [--] introduisent un -- saut}
-\setinterfacemessage{linguals}{6}{langue -- non définie}
-\setinterfacemessage{linguals}{9}{la langue -- est active}
-\setinterfacemessage{linguals}{8}{les options spécifiques de langue [--] sont ajoutés en douceur}
-\setinterfacemessage{linguals}{title}{langue}
-\setinterfacemessage{linguals}{10}{motifs -- chargés}
-\setinterfacemessage{verbatims}{1}{le fichier -- n'existe pas}
-\setinterfacemessage{verbatims}{title}{verbatim}
-\setinterfacemessage{filters}{1}{le filtre -- est chargé}
-\setinterfacemessage{filters}{title}{filtre}
-\setinterfacemessage{filters}{2}{filtre -- inconnu}
-\setinterfacemessage{textblocks}{1}{nouvelle version, une seconde passe est nécessaire}
-\setinterfacemessage{textblocks}{3}{lecture des blocs en provenance de --}
-\setinterfacemessage{textblocks}{2}{ecriture des blocs vers --}
-\setinterfacemessage{textblocks}{5}{-- non caché}
-\setinterfacemessage{textblocks}{4}{seconde passe nécessaire}
-\setinterfacemessage{textblocks}{7}{-- caché}
-\setinterfacemessage{textblocks}{6}{-- caché et traité}
-\setinterfacemessage{textblocks}{9}{-- non composé}
-\setinterfacemessage{textblocks}{8}{-- composé}
-\setinterfacemessage{textblocks}{title}{blocs de texte}
-\setinterfacemessage{textblocks}{12}{-- sauté}
-\setinterfacemessage{textblocks}{11}{-- chargé et composé}
-\setinterfacemessage{textblocks}{10}{-- chargé et traité}
-\setinterfacemessage{encodings}{1}{encodage --}
-\setinterfacemessage{encodings}{3}{encodage -- inconnu}
-\setinterfacemessage{encodings}{2}{l'encodage -- est chargé}
-\setinterfacemessage{encodings}{title}{encodage}
-\setinterfacemessage{columns}{1}{seules -- colonnes possibles}
-\setinterfacemessage{columns}{3}{problèmes, désactive l'équilibrage}
-\setinterfacemessage{columns}{2}{utilisez \string\filbreak\space en tant qu'alternative}
-\setinterfacemessage{columns}{5}{flottant en partie inférieure pas encore supporté}
-\setinterfacemessage{columns}{4}{flottant en partie supérieure pas encore supporté}
-\setinterfacemessage{columns}{7}{équilibrage abandonné après 100 pas}
-\setinterfacemessage{columns}{6}{-- flottant(s) reporté(s)}
-\setinterfacemessage{columns}{9}{vérification des irrégularités}
-\setinterfacemessage{columns}{8}{équilibré en -- pas}
-\setinterfacemessage{columns}{title}{colonnes}
-\setinterfacemessage{columns}{13}{flottant large déplacé dans la partie supérieure de la colonne}
-\setinterfacemessage{columns}{12}{flottant déplacé à la colonne suivante / --}
-\setinterfacemessage{columns}{11}{flottant mis à la largeur de la colonne}
-\setinterfacemessage{columns}{10}{(moins de) 1 ligne restante}
-\setinterfacemessage{symbols}{1}{chargement du jeu de symbole --}
-\setinterfacemessage{symbols}{title}{symboles}
-\setinterfacemessage{files}{1}{le synonyme de fichier -- est déjà utilisé pour --}
-\setinterfacemessage{files}{title}{fichiers}
-\setinterfacemessage{versions}{1}{@+ manquant}
-\setinterfacemessage{versions}{3}{pages sélectionnées : --}
-\setinterfacemessage{versions}{2}{marquage des pages}
-\setinterfacemessage{versions}{title}{version}
-\setinterfacemessage{specials}{1}{-- chargé}
-\setinterfacemessage{specials}{3}{-- est remis à zéro}
-\setinterfacemessage{specials}{2}{pas d'imbracations plus profondes ne sont permises --}
-\setinterfacemessage{specials}{5}{chargement du fichier de définition --}
-\setinterfacemessage{specials}{4}{la commande -- n'existe pas}
-\setinterfacemessage{specials}{7}{pilote -- inconnu}
-\setinterfacemessage{specials}{6}{l'imbrication n'est pas permise}
-\setinterfacemessage{specials}{title}{specials}
-\setinterfacemessage{layouts}{1}{hauteurtexte adaptée avec -- à la page --}
-\setinterfacemessage{layouts}{3}{-- times text postponed}
-\setinterfacemessage{layouts}{2}{-- times postponed text placed}
-\setinterfacemessage{layouts}{5}{blocsmarge inactifs}
-\setinterfacemessage{layouts}{4}{blocsmarge actifs}
-\setinterfacemessage{layouts}{7}{calcul de l'espace pour le logo}
-\setinterfacemessage{layouts}{6}{jeu de souspage -- traité (taille --)}
-\setinterfacemessage{layouts}{9}{pas plus de -- niveaux pour l'instant dans les élémentarisations}
-\setinterfacemessage{layouts}{8}{calcul des arrières-plans}
-\setinterfacemessage{layouts}{title}{calque}
-\setinterfacemessage{layouts}{11}{espacement -- non permis en modegrille}
-\setinterfacemessage{layouts}{10}{-- et -- ne sont pas ajoutés à 1.0}
-\setinterfacemessage{fonts}{1}{encodage --}
-\setinterfacemessage{fonts}{3}{variante -- inconnue}
-\setinterfacemessage{fonts}{2}{la variante -- est chargée}
-\setinterfacemessage{fonts}{5}{le style -- n'est pas défini}
-\setinterfacemessage{fonts}{4}{policecorps -- n'est pas définie}
-\setinterfacemessage{fonts}{7}{format -- inconnu}
-\setinterfacemessage{fonts}{6}{-- est chargé}
-\setinterfacemessage{fonts}{14}{policecorps -- est défini (une définition globale pourrait être plus adéquat)}
-\setinterfacemessage{fonts}{8}{style -- défini}
-\setinterfacemessage{fonts}{title}{corps de texte}
-\setinterfacemessage{fonts}{10}{fichier de police -- inconnu}
-\setinterfacemessage{databases}{1}{--}
-\setinterfacemessage{databases}{3}{fichier global --}
-\setinterfacemessage{databases}{2}{fichier local --}
-\setinterfacemessage{databases}{4}{fichier inconnu --}
-\setinterfacemessage{databases}{title}{bases de données}
-\setinterfacemessage{publications}{1}{file -- not found, unknown style ignored}
-\setinterfacemessage{publications}{3}{wrote a new auxiliary file \jobname.aux}
-\setinterfacemessage{publications}{title}{publications}
-\setinterfacemessage{publications}{2}{file -- not found, waiting for bibtex}
-\setinterfacemessage{publications}{4}{loading database from --}
-\setinterfacemessage{publications}{5}{warning: cite argument -- on line \the\inputlineno}
-\setinterfacemessage{publications}{6}{loading formatting style from --}
-\setinterfacemessage{javascript}{1}{chargement du jeu de script --}
-\setinterfacemessage{javascript}{title}{javascript}
-\setinterfacemessage{javascript}{2}{préambule -- inconnu}
-\setinterfacemessage{check}{1}{manquant ou dégroupé '=' après '--' à la ligne --}
-\setinterfacemessage{check}{3}{-- -- remplace une macro, utilisez des MAJUSCULES !}
-\setinterfacemessage{check}{2}{-- argument(s) attendu(s) à la ligne --}
-\setinterfacemessage{check}{title}{vérification}
-\setinterfacemessage{metapost}{1}{chargement de la bibliothèque metapost --}
-\setinterfacemessage{metapost}{title}{metapost}
-\setinterfacemessage{figures}{1}{la figure -- ne peut être trouvée}
-\setinterfacemessage{figures}{3}{dimensions of -- are determined externally}
-\setinterfacemessage{figures}{2}{la figure -- n'est pas pré-sélectionnée}
-\setinterfacemessage{figures}{5}{dimensions of -- are unknown}
-\setinterfacemessage{figures}{4}{les dimensions de -- chargées implicitement à partir du fichier de figure}
-\setinterfacemessage{figures}{6}{les dimensions de -- calculées par rlxtools}
-\setinterfacemessage{figures}{8}{figureobject -- est réutilisé}
-\setinterfacemessage{figures}{title}{figures}
-\setinterfacemessage{colors}{1}{le système -- est globalement activé}
-\setinterfacemessage{colors}{3}{-- n'est pas défini --}
-\setinterfacemessage{colors}{2}{le système -- est localement activé}
-\setinterfacemessage{colors}{5}{système -- inconnu}
-\setinterfacemessage{colors}{4}{le système -- est chargé}
-\setinterfacemessage{colors}{7}{le palette -- n'est pas disponible}
-\setinterfacemessage{colors}{6}{la palette -- est disponible}
-\setinterfacemessage{colors}{9}{l'espace de couleur -- n'est pas supporté}
-\setinterfacemessage{colors}{8}{la spécification -- de la couleur -- devient noire}
-\setinterfacemessage{colors}{title}{couleurs}
-\setinterfacemessage{colors}{12}{-- est enregistré}
-\setinterfacemessage{colors}{11}{la couleur est convertie en niveau de gris}
-\setinterfacemessage{colors}{10}{-- l'espace de couleur est supporté}
-%
-\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/context/base/mkii/mult-mit.mkii b/Master/texmf-dist/tex/context/base/mkii/mult-mit.mkii
deleted file mode 100644
index 9d09e267654..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/mult-mit.mkii
+++ /dev/null
@@ -1,210 +0,0 @@
-\setinterfacemessage{references}{1}{riferimento sconosciuto --}
-\setinterfacemessage{references}{30}{oggetto sconosciuto --}
-\setinterfacemessage{references}{3}{riferimento di tipo sconosciuto --}
-\setinterfacemessage{references}{2}{riferimento duplicato -- a pagina --}
-\setinterfacemessage{references}{5}{number of unknown references: --}
-\setinterfacemessage{references}{4}{riferimento illecito --}
-\setinterfacemessage{references}{6}{number of illegal references: --}
-\setinterfacemessage{references}{25}{references from document '--' are not imported (export again)}
-\setinterfacemessage{references}{24}{references from document '--' are not exported}
-\setinterfacemessage{references}{title}{riferimenti}
-\setinterfacemessage{references}{26}{references from document '--' are imported}
-\setinterfacemessage{references}{31}{oggetto duplicato --}
-\setinterfacemessage{references}{21}{documento -- caricato}
-\setinterfacemessage{references}{22}{il documento -- non ø interattivo}
-\setinterfacemessage{references}{23}{riferimento ambiguo -- (prefisso=--)}
-\setinterfacemessage{documents}{1}{sheet --}
-\setinterfacemessage{documents}{title}{sheets}
-\setinterfacemessage{documents}{2}{number --}
-\setinterfacemessage{handlings}{1}{font handling --}
-\setinterfacemessage{handlings}{3}{unknown font handling --}
-\setinterfacemessage{handlings}{2}{font handling -- is loaded}
-\setinterfacemessage{handlings}{title}{handling}
-\setinterfacemessage{systems}{title}{sistema}
-\setinterfacemessage{systems}{41}{il file esterno -- del gruppo -- non esiste}
-\setinterfacemessage{systems}{9}{-- non trovato/elaborato}
-\setinterfacemessage{systems}{91}{papertray --}
-\setinterfacemessage{systems}{8}{nuova versione del file supplementare, seconda passata necessaria}
-\setinterfacemessage{systems}{21}{nessuna informazione supplementare caricata}
-\setinterfacemessage{systems}{20}{significato (specie) di -- caricato}
-\setinterfacemessage{systems}{5}{macro del modulo -- caricate}
-\setinterfacemessage{systems}{4}{comando -- già definito}
-\setinterfacemessage{systems}{27}{Versione}
-\setinterfacemessage{systems}{26}{Registri}
-\setinterfacemessage{systems}{25}{Riferimenti}
-\setinterfacemessage{systems}{24}{Oggetti mobili}
-\setinterfacemessage{systems}{1}{caricamento dei file supplementari posticipato (typemode)}
-\setinterfacemessage{systems}{23}{-- sistemato a --}
-\setinterfacemessage{systems}{22}{usare un file supplementare valido}
-\setinterfacemessage{systems}{2}{-- caricato}
-\setinterfacemessage{systems}{19}{significato (sinonimi) di -- caricato}
-\setinterfacemessage{systems}{18}{sinonimo -- -- non esistente}
-\setinterfacemessage{systems}{7}{macro del modulo -- già caricate}
-\setinterfacemessage{systems}{6}{nessuna macro trovata nel modulo --}
-\setinterfacemessage{systems}{14}{nuova pagina obbligata in lista a --}
-\setinterfacemessage{systems}{15}{salvataggio del buffer --}
-\setinterfacemessage{systems}{16}{composizione del buffer --}
-\setinterfacemessage{systems}{17}{composizione verbatim del buffer --}
-\setinterfacemessage{systems}{13}{marcatura -- definita --}
-\setinterfacemessage{systems}{12}{file di supplemento non ordinato, usare texutil}
-\setinterfacemessage{systems}{11}{costruzione di un semplice supplemento}
-\setinterfacemessage{systems}{10}{non usare em in --}
-\setinterfacemessage{floatblocks}{1}{-- rinumerato / -- => --}
-\setinterfacemessage{floatblocks}{3}{-- mosso}
-\setinterfacemessage{floatblocks}{2}{-- salvato}
-\setinterfacemessage{floatblocks}{5}{ordine aggiustato}
-\setinterfacemessage{floatblocks}{4}{-- sistemato}
-\setinterfacemessage{floatblocks}{7}{n di bottom floats limitato a --}
-\setinterfacemessage{floatblocks}{6}{n di top floats limitato a --}
-\setinterfacemessage{floatblocks}{9}{ordine disturbato}
-\setinterfacemessage{floatblocks}{8}{meno di -- righe}
-\setinterfacemessage{floatblocks}{title}{oggetti mobili}
-\setinterfacemessage{floatblocks}{13}{there is nothing to split}
-\setinterfacemessage{floatblocks}{12}{non definito}
-\setinterfacemessage{floatblocks}{11}{nessun oggetto specificato}
-\setinterfacemessage{floatblocks}{10}{-- limitato}
-\setinterfacemessage{interactions}{1}{rapporto -- x -- (b x a)}
-\setinterfacemessage{interactions}{3}{inattiva}
-\setinterfacemessage{interactions}{2}{attiva}
-\setinterfacemessage{interactions}{5}{unknown attachment --}
-\setinterfacemessage{interactions}{4}{sincronizzazione di pagina (--) non disponibile in hmode}
-\setinterfacemessage{interactions}{6}{attachment file -- does not exist}
-\setinterfacemessage{interactions}{title}{interazione}
-\setinterfacemessage{interactions}{21}{codice -- inserito}
-\setinterfacemessage{regimes}{1}{codifica --}
-\setinterfacemessage{regimes}{3}{codifica sconosciuta --}
-\setinterfacemessage{regimes}{2}{codifica -- caricata}
-\setinterfacemessage{regimes}{title}{codifica}
-\setinterfacemessage{structures}{1}{inizio del blocco (sezione) --}
-\setinterfacemessage{structures}{title}{struttura}
-\setinterfacemessage{structures}{2}{fine del blocco (sezione) --}
-\setinterfacemessage{linguals}{1}{schemi -- per -- caricati (n=--,e=--,m=--)}
-\setinterfacemessage{linguals}{3}{sillabazione -- per -- caricata (n=--,e=--,m=--)}
-\setinterfacemessage{linguals}{2}{niente schemi -- per -- (n=--,e=--,m=--) (--,--)}
-\setinterfacemessage{linguals}{5}{schemi per -- non caricati}
-\setinterfacemessage{linguals}{4}{niente sillabazione -- per -- (n=--,e=--,m=--)}
-\setinterfacemessage{linguals}{7}{opzioni specifiche per la lingua [--] introducono un salto --}
-\setinterfacemessage{linguals}{6}{lingua -- non definita}
-\setinterfacemessage{linguals}{9}{lingua -- attiva}
-\setinterfacemessage{linguals}{8}{opzioni specifiche per la lingua [--] aggiunte trasparentemente}
-\setinterfacemessage{linguals}{title}{lingua}
-\setinterfacemessage{linguals}{10}{schemi -- caricati}
-\setinterfacemessage{verbatims}{1}{il file -- non esiste}
-\setinterfacemessage{verbatims}{title}{verbatim}
-\setinterfacemessage{filters}{1}{filtro -- caricato}
-\setinterfacemessage{filters}{title}{filtri}
-\setinterfacemessage{filters}{2}{filtro sconosciuto --}
-\setinterfacemessage{textblocks}{1}{nuova versione, seconda passata necessaria}
-\setinterfacemessage{textblocks}{3}{lettura dei blocchi da --}
-\setinterfacemessage{textblocks}{2}{scrittura dei blocchi su --}
-\setinterfacemessage{textblocks}{5}{-- non nascosto}
-\setinterfacemessage{textblocks}{4}{seconda passata necessaria}
-\setinterfacemessage{textblocks}{7}{-- nascosto}
-\setinterfacemessage{textblocks}{6}{-- nascosto ed elaborato}
-\setinterfacemessage{textblocks}{9}{-- non composto}
-\setinterfacemessage{textblocks}{8}{-- composto}
-\setinterfacemessage{textblocks}{title}{blocchi di testo}
-\setinterfacemessage{textblocks}{12}{-- saltato}
-\setinterfacemessage{textblocks}{11}{-- caricato e composto}
-\setinterfacemessage{textblocks}{10}{-- caricato ed elaborato}
-\setinterfacemessage{encodings}{1}{codifica --}
-\setinterfacemessage{encodings}{3}{codifica sconosciuta --}
-\setinterfacemessage{encodings}{2}{codifica -- caricata}
-\setinterfacemessage{encodings}{title}{codifica}
-\setinterfacemessage{columns}{1}{solo -- colonne possibili}
-\setinterfacemessage{columns}{3}{problemi, disabilitare il bilanciamento}
-\setinterfacemessage{columns}{2}{in alternativa, usare \string\filbreak}
-\setinterfacemessage{columns}{5}{float in fondo non ancora supportato}
-\setinterfacemessage{columns}{4}{float in cima non ancora supportato}
-\setinterfacemessage{columns}{7}{bilanciamento annullato dopo 100 passi}
-\setinterfacemessage{columns}{6}{-- float(s) posticipate}
-\setinterfacemessage{columns}{9}{controllare seghettamento}
-\setinterfacemessage{columns}{8}{bilanciamento in -- passo/i}
-\setinterfacemessage{columns}{title}{colonne}
-\setinterfacemessage{columns}{13}{oggetto mobile ampio spostato sopra le colonne}
-\setinterfacemessage{columns}{12}{oggetto mobile spostata alla colonna successiva / --}
-\setinterfacemessage{columns}{11}{oggetto mobile troppo ampio per la colonna}
-\setinterfacemessage{columns}{10}{(meno di) una riga rimasta}
-\setinterfacemessage{symbols}{1}{caricamento gruppo di simboli --}
-\setinterfacemessage{symbols}{title}{simboli}
-\setinterfacemessage{files}{1}{sinonimo file -- già in uso per --}
-\setinterfacemessage{files}{title}{file}
-\setinterfacemessage{versions}{1}{@+ mancante}
-\setinterfacemessage{versions}{3}{pagine selezionate: --}
-\setinterfacemessage{versions}{2}{marcatura pagine}
-\setinterfacemessage{versions}{title}{version}
-\setinterfacemessage{specials}{1}{-- caricato}
-\setinterfacemessage{specials}{3}{-- reimpostato}
-\setinterfacemessage{specials}{2}{non ø permesso un annidamento maggiore --}
-\setinterfacemessage{specials}{5}{caricamento del file di definizione --}
-\setinterfacemessage{specials}{4}{il comando -- non esiste}
-\setinterfacemessage{specials}{7}{driver sconosciuto --}
-\setinterfacemessage{specials}{6}{annidamento non permesso}
-\setinterfacemessage{specials}{title}{specialitø}
-\setinterfacemessage{layouts}{1}{altezza del testo adattata con -- a pagina --}
-\setinterfacemessage{layouts}{3}{testo posticipato -- volte}
-\setinterfacemessage{layouts}{2}{posizionato testo posticipato -- volte}
-\setinterfacemessage{layouts}{5}{blocchi in margine inattivi}
-\setinterfacemessage{layouts}{4}{blocchi in margine attivi}
-\setinterfacemessage{layouts}{7}{calcolo dello spazio per logo}
-\setinterfacemessage{layouts}{6}{gruppo di sottopagine -- elaborato (dimensione --)}
-\setinterfacemessage{layouts}{9}{attualmente non più di -- livelli di elencazione}
-\setinterfacemessage{layouts}{8}{calcolo dello sfondo}
-\setinterfacemessage{layouts}{title}{layout}
-\setinterfacemessage{layouts}{11}{spaziatura -- non permessa in modo griglia}
-\setinterfacemessage{layouts}{10}{-- e -- non sommano a 1.0}
-\setinterfacemessage{fonts}{1}{codifica --}
-\setinterfacemessage{fonts}{3}{variante sconosciuta --}
-\setinterfacemessage{fonts}{2}{variante -- caricata}
-\setinterfacemessage{fonts}{5}{stile -- non definito}
-\setinterfacemessage{fonts}{4}{corpo del testo -- non definito}
-\setinterfacemessage{fonts}{7}{formato sconosciuto --}
-\setinterfacemessage{fonts}{6}{-- caricato}
-\setinterfacemessage{fonts}{14}{corpo del testo -- definito (sarebbe meglio globale)}
-\setinterfacemessage{fonts}{8}{stile -- definito}
-\setinterfacemessage{fonts}{title}{font del corpo}
-\setinterfacemessage{fonts}{10}{file di font sconosciuto --}
-\setinterfacemessage{databases}{1}{--}
-\setinterfacemessage{databases}{3}{file globale --}
-\setinterfacemessage{databases}{2}{file locale --}
-\setinterfacemessage{databases}{4}{file sconosciuto --}
-\setinterfacemessage{databases}{title}{database}
-\setinterfacemessage{publications}{1}{file -- not found, unknown style ignored}
-\setinterfacemessage{publications}{3}{wrote a new auxiliary file \jobname.aux}
-\setinterfacemessage{publications}{title}{publications}
-\setinterfacemessage{publications}{2}{file -- not found, waiting for bibtex}
-\setinterfacemessage{publications}{4}{loading database from --}
-\setinterfacemessage{publications}{5}{warning: cite argument -- on line \the\inputlineno}
-\setinterfacemessage{publications}{6}{loading formatting style from --}
-\setinterfacemessage{javascript}{1}{caricamento dello script set --}
-\setinterfacemessage{javascript}{title}{javascript}
-\setinterfacemessage{javascript}{2}{preambolo sconosciuto --}
-\setinterfacemessage{check}{1}{'=' mancante o non raggruppato dopo '--' alla riga --}
-\setinterfacemessage{check}{3}{-- -- sostituisce una macro, usare le MAIUSCOLE!}
-\setinterfacemessage{check}{2}{-- argomento/i attesi alla riga --}
-\setinterfacemessage{check}{title}{controllo}
-\setinterfacemessage{metapost}{1}{caricamento della libreria metapost --}
-\setinterfacemessage{metapost}{title}{metapost}
-\setinterfacemessage{figures}{1}{figura -- non trovata}
-\setinterfacemessage{figures}{3}{dimensions of -- are determined externally}
-\setinterfacemessage{figures}{2}{la figura -- non è preimpostata}
-\setinterfacemessage{figures}{5}{dimensions of -- are unknown}
-\setinterfacemessage{figures}{4}{dimensioni di -- caricate dal file di immagini stesso}
-\setinterfacemessage{figures}{6}{dimensioni di -- calcolate da rlxtools}
-\setinterfacemessage{figures}{8}{oggetto-figura -- riutilizzato}
-\setinterfacemessage{figures}{title}{figure}
-\setinterfacemessage{colors}{1}{sistema -- attivato globalmente}
-\setinterfacemessage{colors}{3}{-- non definito --}
-\setinterfacemessage{colors}{2}{sistema -- attivato localmente}
-\setinterfacemessage{colors}{5}{sistema -- sconosciuto}
-\setinterfacemessage{colors}{4}{sistema -- caricato}
-\setinterfacemessage{colors}{7}{tavolozza -- non disponibile}
-\setinterfacemessage{colors}{6}{tavolozza -- resa disponibile}
-\setinterfacemessage{colors}{9}{spazio dei colori -- non supportato}
-\setinterfacemessage{colors}{8}{specifica -- del colore -- convertita in nero}
-\setinterfacemessage{colors}{title}{colore}
-\setinterfacemessage{colors}{12}{-- is registered}
-\setinterfacemessage{colors}{11}{il colore ø convertito in grigio}
-\setinterfacemessage{colors}{10}{spazio dei colori -- supportato}
-%
-\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/context/base/mkii/mult-mnl.mkii b/Master/texmf-dist/tex/context/base/mkii/mult-mnl.mkii
deleted file mode 100644
index fb527d4adeb..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/mult-mnl.mkii
+++ /dev/null
@@ -1,210 +0,0 @@
-\setinterfacemessage{references}{1}{onbekende verwijzing --}
-\setinterfacemessage{references}{30}{onbekend object --}
-\setinterfacemessage{references}{3}{type verwijzing -- onbekend}
-\setinterfacemessage{references}{2}{dubbele verwijzing -- op pagina --}
-\setinterfacemessage{references}{5}{number of unknown references: --}
-\setinterfacemessage{references}{4}{verboden verwijzing --}
-\setinterfacemessage{references}{6}{number of illegal references: --}
-\setinterfacemessage{references}{25}{references from document '--' are not imported (export again)}
-\setinterfacemessage{references}{24}{references from document '--' are not exported}
-\setinterfacemessage{references}{title}{verwijzingen}
-\setinterfacemessage{references}{26}{references from document '--' are imported}
-\setinterfacemessage{references}{31}{dubbel object --}
-\setinterfacemessage{references}{21}{document -- geladen}
-\setinterfacemessage{references}{22}{document -- is niet interactief}
-\setinterfacemessage{references}{23}{onduidelijke verwijzing -- (prefix=--)}
-\setinterfacemessage{documents}{1}{sheet --}
-\setinterfacemessage{documents}{title}{sheets}
-\setinterfacemessage{documents}{2}{nummer --}
-\setinterfacemessage{handlings}{1}{font afhandeling --}
-\setinterfacemessage{handlings}{3}{onbekende font afhandeling --}
-\setinterfacemessage{handlings}{2}{font afhandeling -- wordt geladen}
-\setinterfacemessage{handlings}{title}{handling}
-\setinterfacemessage{systems}{title}{systeem}
-\setinterfacemessage{systems}{41}{externe file -- in groep -- bestaat niet}
-\setinterfacemessage{systems}{9}{-- niet gevonden/geplaatst}
-\setinterfacemessage{systems}{91}{papierlade --}
-\setinterfacemessage{systems}{8}{nieuwe versie hulpfile, tweede run nodig}
-\setinterfacemessage{systems}{21}{de hulpfile is niet geladen}
-\setinterfacemessage{systems}{20}{betekenissen (sorteren) van -- geladen}
-\setinterfacemessage{systems}{5}{module -- geladen}
-\setinterfacemessage{systems}{4}{commando -- is al gedefinieerd}
-\setinterfacemessage{systems}{27}{Versie}
-\setinterfacemessage{systems}{26}{Registers}
-\setinterfacemessage{systems}{25}{Verwijzingen}
-\setinterfacemessage{systems}{24}{Plaatsblokken}
-\setinterfacemessage{systems}{1}{laden hulpfile uitgesteld (typemode)}
-\setinterfacemessage{systems}{23}{-- gearrangeerd op --}
-\setinterfacemessage{systems}{22}{gebruik een goede hulpfile}
-\setinterfacemessage{systems}{2}{-- geladen}
-\setinterfacemessage{systems}{19}{betekenissen (synoniemen) van -- geladen}
-\setinterfacemessage{systems}{18}{synoniem -- -- bestaat niet}
-\setinterfacemessage{systems}{7}{module -- reeds geladen}
-\setinterfacemessage{systems}{6}{geen module -- gevonden}
-\setinterfacemessage{systems}{14}{geforceerde paginaovergang in lijst voor --}
-\setinterfacemessage{systems}{15}{wegschrijven buffer --}
-\setinterfacemessage{systems}{16}{inlezen buffer --}
-\setinterfacemessage{systems}{17}{verbatim inlezen buffer --}
-\setinterfacemessage{systems}{13}{markering -- gedefinieerd --}
-\setinterfacemessage{systems}{12}{de hulpfile is niet gesorteerd, gebruik texutil}
-\setinterfacemessage{systems}{11}{aanmaken basale hulpfile}
-\setinterfacemessage{systems}{10}{gebruik geen em in --}
-\setinterfacemessage{floatblocks}{1}{-- hernummerd / -- => --}
-\setinterfacemessage{floatblocks}{3}{-- verplaatst}
-\setinterfacemessage{floatblocks}{2}{-- bewaard}
-\setinterfacemessage{floatblocks}{5}{volgorde aangepast}
-\setinterfacemessage{floatblocks}{4}{-- geplaatst}
-\setinterfacemessage{floatblocks}{7}{maximaal -- onder}
-\setinterfacemessage{floatblocks}{6}{maximaal -- boven}
-\setinterfacemessage{floatblocks}{9}{volgorde verstoord}
-\setinterfacemessage{floatblocks}{8}{minder dan -- regels}
-\setinterfacemessage{floatblocks}{title}{plaatsblokken}
-\setinterfacemessage{floatblocks}{13}{er is niets te splitsen}
-\setinterfacemessage{floatblocks}{12}{niet gedefinieerd}
-\setinterfacemessage{floatblocks}{11}{geen blok opgegeven}
-\setinterfacemessage{floatblocks}{10}{-- begrensd}
-\setinterfacemessage{interactions}{1}{aspect ratio -- x -- (b x h)}
-\setinterfacemessage{interactions}{3}{niet actief}
-\setinterfacemessage{interactions}{2}{actief}
-\setinterfacemessage{interactions}{5}{onbekend attachment --}
-\setinterfacemessage{interactions}{4}{geen paginasynchronisatie (--) in hmode}
-\setinterfacemessage{interactions}{6}{attachment file -- bestaat niet}
-\setinterfacemessage{interactions}{title}{interactie}
-\setinterfacemessage{interactions}{21}{-- code tussengevoegd}
-\setinterfacemessage{regimes}{1}{regime --}
-\setinterfacemessage{regimes}{3}{onbekend regime --}
-\setinterfacemessage{regimes}{2}{regime -- wordt geladen}
-\setinterfacemessage{regimes}{title}{regime}
-\setinterfacemessage{structures}{1}{begin van sectieblok --}
-\setinterfacemessage{structures}{title}{structuur}
-\setinterfacemessage{structures}{2}{eind van sectieblok --}
-\setinterfacemessage{linguals}{1}{afbreekpatronen -- voor -- geladen (n=--,e=--,m=--)}
-\setinterfacemessage{linguals}{3}{afbreekdefinities -- voor -- geladen (n=--,e=--,m=--)}
-\setinterfacemessage{linguals}{2}{geen afbreekpatronen -- voor -- (n=--,e=--,m=--) (--,--)}
-\setinterfacemessage{linguals}{5}{afbreekpatronen voor -- niet geladen}
-\setinterfacemessage{linguals}{4}{geen afbreekdefinities -- voor -- (n=--,e=--,m=--)}
-\setinterfacemessage{linguals}{7}{taal specifieke opties [--] introduceren een skip van --}
-\setinterfacemessage{linguals}{6}{taal -- is niet gedefinieerd}
-\setinterfacemessage{linguals}{9}{taal -- is actief}
-\setinterfacemessage{linguals}{8}{taal specifieke opties [--] naadloos toegevoegd}
-\setinterfacemessage{linguals}{title}{taal}
-\setinterfacemessage{linguals}{10}{patronen --geladen}
-\setinterfacemessage{verbatims}{1}{file -- bestaat niet}
-\setinterfacemessage{verbatims}{title}{typen}
-\setinterfacemessage{filters}{1}{filter -- wordt geladen}
-\setinterfacemessage{filters}{title}{filter}
-\setinterfacemessage{filters}{2}{onbekend filter --}
-\setinterfacemessage{textblocks}{1}{nieuwe versie, tweede run nodig}
-\setinterfacemessage{textblocks}{3}{inlezen blokken uit --}
-\setinterfacemessage{textblocks}{2}{wegschrijven blokken naar --}
-\setinterfacemessage{textblocks}{5}{-- niet verborgen}
-\setinterfacemessage{textblocks}{4}{er is een tweede run nodig}
-\setinterfacemessage{textblocks}{7}{-- verborgen}
-\setinterfacemessage{textblocks}{6}{-- verborgen en verwerkt}
-\setinterfacemessage{textblocks}{9}{-- niet gehandhaafd}
-\setinterfacemessage{textblocks}{8}{-- gehandhaafd}
-\setinterfacemessage{textblocks}{title}{tekstblokken}
-\setinterfacemessage{textblocks}{12}{-- overgeslagen}
-\setinterfacemessage{textblocks}{11}{-- geladen en geplaatst}
-\setinterfacemessage{textblocks}{10}{-- geladen en verwerkt}
-\setinterfacemessage{encodings}{1}{codering --}
-\setinterfacemessage{encodings}{3}{onbekende codering --}
-\setinterfacemessage{encodings}{2}{codering -- wordt geladen}
-\setinterfacemessage{encodings}{title}{encoding}
-\setinterfacemessage{columns}{1}{maximaal -- kolommen}
-\setinterfacemessage{columns}{3}{probleempje, probeer [balanceren=nee]}
-\setinterfacemessage{columns}{2}{gebruik eventueel \string\filbreak}
-\setinterfacemessage{columns}{5}{plaatsblok onder nog niet mogelijk}
-\setinterfacemessage{columns}{4}{plaatsblok boven nog niet mogelijk}
-\setinterfacemessage{columns}{7}{balanceren afgebroken na 100 stappen}
-\setinterfacemessage{columns}{6}{-- plaatsblok(en) opgeschort}
-\setinterfacemessage{columns}{9}{uitlijnen controleren!}
-\setinterfacemessage{columns}{8}{gebalanceerd in -- stap(pen)}
-\setinterfacemessage{columns}{title}{kolommen}
-\setinterfacemessage{columns}{13}{breed figuur geplaatst boven kolommen}
-\setinterfacemessage{columns}{12}{plaatsblok verplaatst naar volgende kolom / --}
-\setinterfacemessage{columns}{11}{plaatsblok te breed voor kolom}
-\setinterfacemessage{columns}{10}{(minder dan) 1 regel over}
-\setinterfacemessage{symbols}{1}{symboolset -- wordt geladen}
-\setinterfacemessage{symbols}{title}{symbolen}
-\setinterfacemessage{files}{1}{file synoniem -- is al in gebruik voor --}
-\setinterfacemessage{files}{title}{files}
-\setinterfacemessage{versions}{1}{er mankeert een @+}
-\setinterfacemessage{versions}{3}{geselecteerde pagina's: --}
-\setinterfacemessage{versions}{2}{markeren pagina's}
-\setinterfacemessage{versions}{title}{versie}
-\setinterfacemessage{specials}{1}{-- geladen}
-\setinterfacemessage{specials}{3}{-- gereset}
-\setinterfacemessage{specials}{2}{verdere nesting is niet toegestaan --}
-\setinterfacemessage{specials}{5}{definitiefile -- wordt geladen}
-\setinterfacemessage{specials}{4}{commando -- bestaat niet}
-\setinterfacemessage{specials}{7}{onbekende driver --}
-\setinterfacemessage{specials}{6}{nesting is niet toegestaan}
-\setinterfacemessage{specials}{title}{specials}
-\setinterfacemessage{layouts}{1}{teksthoogte aangepast met -- op pagina --}
-\setinterfacemessage{layouts}{3}{-- maal tekst plaatsen uitstellen}
-\setinterfacemessage{layouts}{2}{-- maal uitgestelde tekst tussengevoegd}
-\setinterfacemessage{layouts}{5}{margeblokken inactief}
-\setinterfacemessage{layouts}{4}{margeblokken actief}
-\setinterfacemessage{layouts}{7}{beeldmerken berekenen}
-\setinterfacemessage{layouts}{6}{subpagina reeks -- verwerkt (aantal --)}
-\setinterfacemessage{layouts}{9}{momenteel maximaal -- niveaus in opsommingen}
-\setinterfacemessage{layouts}{8}{achtergronden berekenen}
-\setinterfacemessage{layouts}{title}{layout}
-\setinterfacemessage{layouts}{11}{interlinie -- niet toegestaan in gridmode}
-\setinterfacemessage{layouts}{10}{-- en -- tellen niet op tot 1.0}
-\setinterfacemessage{fonts}{1}{codering --}
-\setinterfacemessage{fonts}{3}{onbekende variant --}
-\setinterfacemessage{fonts}{2}{variant -- wordt geladen}
-\setinterfacemessage{fonts}{5}{stijl -- is niet gedefinieerd}
-\setinterfacemessage{fonts}{4}{korps -- is niet gedefinieerd}
-\setinterfacemessage{fonts}{7}{onbekend formaat --}
-\setinterfacemessage{fonts}{6}{-- wordt geladen}
-\setinterfacemessage{fonts}{14}{korps -- is gedefinieerd (kan beter globaal plaatsvinden)}
-\setinterfacemessage{fonts}{8}{stijl -- gedefinieerd}
-\setinterfacemessage{fonts}{title}{korps}
-\setinterfacemessage{fonts}{10}{onbekende font file --}
-\setinterfacemessage{databases}{1}{--}
-\setinterfacemessage{databases}{3}{globaal bestand --}
-\setinterfacemessage{databases}{2}{lokaal bestand --}
-\setinterfacemessage{databases}{4}{onbekend bestand --}
-\setinterfacemessage{databases}{title}{database}
-\setinterfacemessage{publications}{1}{file -- not found, unknown style ignored}
-\setinterfacemessage{publications}{3}{wrote a new auxiliary file \jobname.aux}
-\setinterfacemessage{publications}{title}{publications}
-\setinterfacemessage{publications}{2}{file -- not found, waiting for bibtex}
-\setinterfacemessage{publications}{4}{loading database from --}
-\setinterfacemessage{publications}{5}{warning: cite argument -- on line \the\inputlineno}
-\setinterfacemessage{publications}{6}{loading formatting style from --}
-\setinterfacemessage{javascript}{1}{script set -- wordt geladen}
-\setinterfacemessage{javascript}{title}{javascript}
-\setinterfacemessage{javascript}{2}{onbekende preamble --}
-\setinterfacemessage{check}{1}{'=' ontbreekt of zonder {} na '--' in regel --}
-\setinterfacemessage{check}{3}{-- -- vervangt een macro, gebruik HOOFDLETTERS!}
-\setinterfacemessage{check}{2}{-- argument(en) verwacht in regel --}
-\setinterfacemessage{check}{title}{controle}
-\setinterfacemessage{metapost}{1}{metapost bibliotheek -- wordt geladen}
-\setinterfacemessage{metapost}{title}{metapost}
-\setinterfacemessage{figures}{1}{figuur -- is niet te vinden}
-\setinterfacemessage{figures}{3}{maten van -- worden extern vastgesteld}
-\setinterfacemessage{figures}{2}{figuur -- wordt niet preset}
-\setinterfacemessage{figures}{5}{maten van -- zijn onbekend}
-\setinterfacemessage{figures}{4}{maten van -- geladen uit figuurfile zelf}
-\setinterfacemessage{figures}{6}{maten van -- berekend door rlxtools}
-\setinterfacemessage{figures}{8}{figuurobject -- wordt opnieuw gebruikt}
-\setinterfacemessage{figures}{title}{figuren}
-\setinterfacemessage{colors}{1}{systeem -- is globaal actief}
-\setinterfacemessage{colors}{3}{-- is niet gedefinieerd --}
-\setinterfacemessage{colors}{2}{systeem -- is lokaal actief}
-\setinterfacemessage{colors}{5}{onbekend systeem --}
-\setinterfacemessage{colors}{4}{systeem -- wordt geladen}
-\setinterfacemessage{colors}{7}{palet -- is niet beschikbaar}
-\setinterfacemessage{colors}{6}{palet -- is beschikbaar}
-\setinterfacemessage{colors}{9}{-- kleurruimte wordt niet ondersteund}
-\setinterfacemessage{colors}{8}{specificatie -- bij -- wordt zwart}
-\setinterfacemessage{colors}{title}{kleur}
-\setinterfacemessage{colors}{12}{-- is geregistreerd}
-\setinterfacemessage{colors}{11}{kleur wordt vertaald in grijs}
-\setinterfacemessage{colors}{10}{-- kleurruimte wordt ondersteund}
-%
-\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/context/base/mkii/mult-mno.mkii b/Master/texmf-dist/tex/context/base/mkii/mult-mno.mkii
deleted file mode 100644
index bbbc3a6585c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/mult-mno.mkii
+++ /dev/null
@@ -1,210 +0,0 @@
-\setinterfacemessage{references}{1}{ukjent referanse --}
-\setinterfacemessage{references}{30}{ukjent objekt --}
-\setinterfacemessage{references}{3}{ukjent referansetype --}
-\setinterfacemessage{references}{2}{duplikat referanse -- pø side --}
-\setinterfacemessage{references}{5}{number of unknown references: --}
-\setinterfacemessage{references}{4}{ulovlig referanse --}
-\setinterfacemessage{references}{6}{number of illegal references: --}
-\setinterfacemessage{references}{25}{references from document '--' are not imported (export again)}
-\setinterfacemessage{references}{24}{references from document '--' are not exported}
-\setinterfacemessage{references}{title}{referanser}
-\setinterfacemessage{references}{26}{references from document '--' are imported}
-\setinterfacemessage{references}{31}{duplikat objekt --}
-\setinterfacemessage{references}{21}{dokument -- er lest inn}
-\setinterfacemessage{references}{22}{dokument -- er ikke interaktivt}
-\setinterfacemessage{references}{23}{obskur referanse -- (Prefix=--)}
-\setinterfacemessage{documents}{1}{sheet --}
-\setinterfacemessage{documents}{title}{sheets}
-\setinterfacemessage{documents}{2}{number --}
-\setinterfacemessage{handlings}{1}{font handling --}
-\setinterfacemessage{handlings}{3}{unknown font handling --}
-\setinterfacemessage{handlings}{2}{font handling -- is loaded}
-\setinterfacemessage{handlings}{title}{handling}
-\setinterfacemessage{systems}{title}{system}
-\setinterfacemessage{systems}{41}{ekstern fil -- i gruppe -- eksisterer ikke}
-\setinterfacemessage{systems}{9}{-- ikke funnet/behandlet}
-\setinterfacemessage{systems}{91}{papertray --}
-\setinterfacemessage{systems}{8}{ny versjon av hjelpefil, andre gjennomkjøring nødvendig}
-\setinterfacemessage{systems}{21}{hjelpefila er ikke lest inn}
-\setinterfacemessage{systems}{20}{betydning (sorterer) av -- er lest inn}
-\setinterfacemessage{systems}{5}{makroene i modul -- er lest inn}
-\setinterfacemessage{systems}{4}{kommando -- er allerede definert}
-\setinterfacemessage{systems}{27}{Versjon}
-\setinterfacemessage{systems}{26}{Registere}
-\setinterfacemessage{systems}{25}{Referanser}
-\setinterfacemessage{systems}{24}{Flytblokker}
-\setinterfacemessage{systems}{1}{innlesning av hjelpefila utsatt (typemode)}
-\setinterfacemessage{systems}{23}{-- arrangert på --}
-\setinterfacemessage{systems}{22}{bruk en gyldig hjelpefil}
-\setinterfacemessage{systems}{2}{-- er lest inn}
-\setinterfacemessage{systems}{19}{betydning (synonymer) av -- er lest inn}
-\setinterfacemessage{systems}{18}{synonym -- -- eksisterer ikke}
-\setinterfacemessage{systems}{7}{makroene i modul -- er allerede lest inn}
-\setinterfacemessage{systems}{6}{ingen makroer funnet i modul ---}
-\setinterfacemessage{systems}{14}{tvunget sideskift i liste ved --}
-\setinterfacemessage{systems}{15}{lagrer Buffer --}
-\setinterfacemessage{systems}{16}{tegnsetter buffer --}
-\setinterfacemessage{systems}{17}{tegnsetter verbatim-buffer --}
-\setinterfacemessage{systems}{13}{markering -- definert --}
-\setinterfacemessage{systems}{12}{hjelpefila er ikke sortert, bruk texutil}
-\setinterfacemessage{systems}{11}{lager enkel hjelpefil}
-\setinterfacemessage{systems}{10}{ikke bruk em i --}
-\setinterfacemessage{floatblocks}{1}{-- renummerert / -- => --}
-\setinterfacemessage{floatblocks}{3}{-- flyttet}
-\setinterfacemessage{floatblocks}{2}{-- lagret}
-\setinterfacemessage{floatblocks}{5}{rekkefølge tilpasset}
-\setinterfacemessage{floatblocks}{4}{-- plassert}
-\setinterfacemessage{floatblocks}{7}{maksimalt -- flytblokker nederst}
-\setinterfacemessage{floatblocks}{6}{maksimalt -- flytblokker øverst}
-\setinterfacemessage{floatblocks}{9}{rekkefølge endret}
-\setinterfacemessage{floatblocks}{8}{mindre enn -- linjer}
-\setinterfacemessage{floatblocks}{title}{flytblokker}
-\setinterfacemessage{floatblocks}{13}{there is nothing to split}
-\setinterfacemessage{floatblocks}{12}{udefinert}
-\setinterfacemessage{floatblocks}{11}{ingen blokk oppgitt}
-\setinterfacemessage{floatblocks}{10}{-- begrenset}
-\setinterfacemessage{interactions}{1}{forholdstall -- x -- (b x h)}
-\setinterfacemessage{interactions}{3}{inaktiv}
-\setinterfacemessage{interactions}{2}{aktiv}
-\setinterfacemessage{interactions}{5}{unknown attachment --}
-\setinterfacemessage{interactions}{4}{ingen sidesynkronisering (--) i hmode}
-\setinterfacemessage{interactions}{6}{attachment file -- does not exist}
-\setinterfacemessage{interactions}{title}{interaksjon}
-\setinterfacemessage{interactions}{21}{-- kode satt inn / tilføyd}
-\setinterfacemessage{regimes}{1}{koding --}
-\setinterfacemessage{regimes}{3}{ukjent koding --}
-\setinterfacemessage{regimes}{2}{koding -- er lest inn}
-\setinterfacemessage{regimes}{title}{koding}
-\setinterfacemessage{structures}{1}{starten av blokk -- (seksjon)}
-\setinterfacemessage{structures}{title}{struktur}
-\setinterfacemessage{structures}{2}{slutten av blokk -- (seksjon)}
-\setinterfacemessage{linguals}{1}{orddelingsmønster -- for -- er lest inn (n=--,e=--,m=--)}
-\setinterfacemessage{linguals}{3}{orddelingsdefinisjon -- for -- er lest inn (n=--,e=--,m=--)}
-\setinterfacemessage{linguals}{2}{ingen orddelingsmønster -- for -- (n=--,e=--,m=--) (--,--)}
-\setinterfacemessage{linguals}{5}{orddelingsmønster for -- er ikke lest inn}
-\setinterfacemessage{linguals}{4}{ingen orddelingsdefinisjon -- for -- (n=--,e=--,m=--)}
-\setinterfacemessage{linguals}{7}{spràk spesifikk opsjon [--] introduserer et -- hopp}
-\setinterfacemessage{linguals}{6}{spràk -- er udefinert}
-\setinterfacemessage{linguals}{9}{spràk -- er aktivt}
-\setinterfacemessage{linguals}{8}{spràk spesifikk opsjon [--] problemfritt tilføyd}
-\setinterfacemessage{linguals}{title}{sprøk}
-\setinterfacemessage{linguals}{10}{orddelingsmønster -- er lest inn}
-\setinterfacemessage{verbatims}{1}{fil -- eksisterer ikke}
-\setinterfacemessage{verbatims}{title}{verbatim}
-\setinterfacemessage{filters}{1}{filter -- is loaded}
-\setinterfacemessage{filters}{title}{filter}
-\setinterfacemessage{filters}{2}{unknown filter --}
-\setinterfacemessage{textblocks}{1}{ny versjon, andre gjennomkjøring nødvendig}
-\setinterfacemessage{textblocks}{3}{leser blokker fra --}
-\setinterfacemessage{textblocks}{2}{skriver blokker til --}
-\setinterfacemessage{textblocks}{5}{-- ikke skjult}
-\setinterfacemessage{textblocks}{4}{andre gjennomkjøring nødvendig}
-\setinterfacemessage{textblocks}{7}{-- skjult}
-\setinterfacemessage{textblocks}{6}{-- skjult og behandlet}
-\setinterfacemessage{textblocks}{9}{-- ikke tegnsatt}
-\setinterfacemessage{textblocks}{8}{-- tegnsatt}
-\setinterfacemessage{textblocks}{title}{tekstblokker}
-\setinterfacemessage{textblocks}{12}{-- utelatt}
-\setinterfacemessage{textblocks}{11}{-- lest inn og tegnsatt}
-\setinterfacemessage{textblocks}{10}{-- lest inn og behandlet}
-\setinterfacemessage{encodings}{1}{koding --}
-\setinterfacemessage{encodings}{3}{ukjent koding --}
-\setinterfacemessage{encodings}{2}{koding -- er lest inn}
-\setinterfacemessage{encodings}{title}{koding}
-\setinterfacemessage{columns}{1}{maksimalt -- kolonner}
-\setinterfacemessage{columns}{3}{problemer, slår av balansering}
-\setinterfacemessage{columns}{2}{bruk \string\filbreak\space som et alternativ}
-\setinterfacemessage{columns}{5}{flytblokker nedert er ikke støttet enda}
-\setinterfacemessage{columns}{4}{flytblokker øverst er ikke støttet enda}
-\setinterfacemessage{columns}{7}{balansering avbrutt etter 100 iterasjoner}
-\setinterfacemessage{columns}{6}{-- flytblokk forskjøvet}
-\setinterfacemessage{columns}{9}{kontroller tekstlayout!}
-\setinterfacemessage{columns}{8}{balansert etter -- iterasjoner}
-\setinterfacemessage{columns}{title}{kolonner}
-\setinterfacemessage{columns}{13}{bred flytblokk forksjøvet til toppen av kolonnene}
-\setinterfacemessage{columns}{12}{flytblokk forskjøvet til neste kolonne / --}
-\setinterfacemessage{columns}{11}{flytblokk for bredt for kolonna}
-\setinterfacemessage{columns}{10}{(mindre enn) 1 linje igjen}
-\setinterfacemessage{symbols}{1}{leser inn symbolsett --}
-\setinterfacemessage{symbols}{title}{symboler}
-\setinterfacemessage{files}{1}{filesynonym -- er allerede brukt for --}
-\setinterfacemessage{files}{title}{filer}
-\setinterfacemessage{versions}{1}{manglende @+}
-\setinterfacemessage{versions}{3}{valgte sider: --}
-\setinterfacemessage{versions}{2}{markerer sider}
-\setinterfacemessage{versions}{title}{versjon}
-\setinterfacemessage{specials}{1}{-- er lest inn}
-\setinterfacemessage{specials}{3}{-- er tilbakestilt}
-\setinterfacemessage{specials}{2}{dypere 'nesting' er ikke tillatt --}
-\setinterfacemessage{specials}{5}{leser inn definisjonsfil for --}
-\setinterfacemessage{specials}{4}{kommando -- eksisterer ikke}
-\setinterfacemessage{specials}{7}{ukjent driver --}
-\setinterfacemessage{specials}{6}{'nesting' er ikke tillatt}
-\setinterfacemessage{specials}{title}{specials}
-\setinterfacemessage{layouts}{1}{teksthøyde tilpasset med -- på side --}
-\setinterfacemessage{layouts}{3}{-- ganger tekst forskjøvet}
-\setinterfacemessage{layouts}{2}{-- ganger forskjøvet tekst plassert}
-\setinterfacemessage{layouts}{5}{margblokker inaktive}
-\setinterfacemessage{layouts}{4}{margblokker aktive}
-\setinterfacemessage{layouts}{7}{beregner plass for logo}
-\setinterfacemessage{layouts}{6}{delside sett -- behandlet (størrelse --)}
-\setinterfacemessage{layouts}{9}{for øyeblikket maksimalt -- nivåer i opplisting}
-\setinterfacemessage{layouts}{8}{beregner bakgrunn}
-\setinterfacemessage{layouts}{title}{layout}
-\setinterfacemessage{layouts}{11}{mellomrom -- ikke tillatt i gridmodus}
-\setinterfacemessage{layouts}{10}{-- og -- er ikke 1.0 til sammen}
-\setinterfacemessage{fonts}{1}{koding --}
-\setinterfacemessage{fonts}{3}{ukjent variant --}
-\setinterfacemessage{fonts}{2}{variant -- er lest inn}
-\setinterfacemessage{fonts}{5}{stil -- er ikke definert}
-\setinterfacemessage{fonts}{4}{hovedfont -- er ikke definert}
-\setinterfacemessage{fonts}{7}{ukjent format --}
-\setinterfacemessage{fonts}{6}{-- er lest inn}
-\setinterfacemessage{fonts}{14}{bodyfont -- is defined (can better be done global)}
-\setinterfacemessage{fonts}{8}{stil -- definert}
-\setinterfacemessage{fonts}{title}{hovedfont}
-\setinterfacemessage{fonts}{10}{ukjent fontfil --}
-\setinterfacemessage{databases}{1}{--}
-\setinterfacemessage{databases}{3}{global fil --}
-\setinterfacemessage{databases}{2}{lokal fil --}
-\setinterfacemessage{databases}{4}{ukjent fil --}
-\setinterfacemessage{databases}{title}{databaser}
-\setinterfacemessage{publications}{1}{file -- not found, unknown style ignored}
-\setinterfacemessage{publications}{3}{wrote a new auxiliary file \jobname.aux}
-\setinterfacemessage{publications}{title}{publications}
-\setinterfacemessage{publications}{2}{file -- not found, waiting for bibtex}
-\setinterfacemessage{publications}{4}{loading database from --}
-\setinterfacemessage{publications}{5}{warning: cite argument -- on line \the\inputlineno}
-\setinterfacemessage{publications}{6}{loading formatting style from --}
-\setinterfacemessage{javascript}{1}{leser inn scriptsett --}
-\setinterfacemessage{javascript}{title}{javascript}
-\setinterfacemessage{javascript}{2}{ukjent 'preamble' --}
-\setinterfacemessage{check}{1}{manglende '=' etter '--' i linje --}
-\setinterfacemessage{check}{3}{-- -- overskygger en makro, bruk STORE BOKSTAVER!}
-\setinterfacemessage{check}{2}{-- argument forventet i linje --}
-\setinterfacemessage{check}{title}{kontroll}
-\setinterfacemessage{metapost}{1}{metapost bibliotek -- blir lest inn}
-\setinterfacemessage{metapost}{title}{metapost}
-\setinterfacemessage{figures}{1}{figure -- can not be found}
-\setinterfacemessage{figures}{3}{dimensions of -- are determined externally}
-\setinterfacemessage{figures}{2}{figure -- is not preset}
-\setinterfacemessage{figures}{5}{dimensions of -- are unknown}
-\setinterfacemessage{figures}{4}{dimensions of -- loaded from figurefile itself}
-\setinterfacemessage{figures}{6}{dimensions of -- calculated by rlxtools}
-\setinterfacemessage{figures}{8}{figureobject -- is reused}
-\setinterfacemessage{figures}{title}{figures}
-\setinterfacemessage{colors}{1}{system -- er aktivert globalt}
-\setinterfacemessage{colors}{3}{-- er udefinert --}
-\setinterfacemessage{colors}{2}{system -- er aktivert lokalt}
-\setinterfacemessage{colors}{5}{ukjent system --}
-\setinterfacemessage{colors}{4}{system -- er lest inn}
-\setinterfacemessage{colors}{7}{palett -- er ikke tilgjengelig}
-\setinterfacemessage{colors}{6}{palett -- er tilgjengelig}
-\setinterfacemessage{colors}{9}{-- fargerom er ikke støttet}
-\setinterfacemessage{colors}{8}{spesifikasjon -- for farge -- gir kun svart}
-\setinterfacemessage{colors}{title}{farge}
-\setinterfacemessage{colors}{12}{-- is registered}
-\setinterfacemessage{colors}{11}{fargen vil bli vist som grø}
-\setinterfacemessage{colors}{10}{-- fargerom er støttet}
-%
-\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/context/base/mkii/mult-mpe.mkii b/Master/texmf-dist/tex/context/base/mkii/mult-mpe.mkii
deleted file mode 100644
index a8d42935602..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/mult-mpe.mkii
+++ /dev/null
@@ -1,210 +0,0 @@
-\setinterfacemessage{references}{1}{unknown reference --}
-\setinterfacemessage{references}{30}{unknown object --}
-\setinterfacemessage{references}{3}{unknown reference type --}
-\setinterfacemessage{references}{2}{duplicate reference -- on page --}
-\setinterfacemessage{references}{5}{number of unknown references: --}
-\setinterfacemessage{references}{4}{illegal reference --}
-\setinterfacemessage{references}{6}{number of illegal references: --}
-\setinterfacemessage{references}{25}{references from document '--' are not imported (export again)}
-\setinterfacemessage{references}{24}{references from document '--' are not exported}
-\setinterfacemessage{references}{title}{references}
-\setinterfacemessage{references}{26}{references from document '--' are imported}
-\setinterfacemessage{references}{31}{duplicate object --}
-\setinterfacemessage{references}{21}{document -- loaded}
-\setinterfacemessage{references}{22}{document -- is not interactive}
-\setinterfacemessage{references}{23}{obscure reference -- (prefix=--)}
-\setinterfacemessage{documents}{1}{sheet --}
-\setinterfacemessage{documents}{title}{sheets}
-\setinterfacemessage{documents}{2}{number --}
-\setinterfacemessage{handlings}{1}{font handling --}
-\setinterfacemessage{handlings}{3}{unknown font handling --}
-\setinterfacemessage{handlings}{2}{font handling -- is loaded}
-\setinterfacemessage{handlings}{title}{handling}
-\setinterfacemessage{systems}{title}{system}
-\setinterfacemessage{systems}{41}{external file -- in group -- does not exist}
-\setinterfacemessage{systems}{9}{-- not found/processed}
-\setinterfacemessage{systems}{91}{papertray --}
-\setinterfacemessage{systems}{8}{new version of utility file, second pass needed}
-\setinterfacemessage{systems}{21}{no utility data is loaded}
-\setinterfacemessage{systems}{20}{meaning (sorts) of -- loaded}
-\setinterfacemessage{systems}{5}{module -- loaded}
-\setinterfacemessage{systems}{4}{command -- is already defined}
-\setinterfacemessage{systems}{27}{Version}
-\setinterfacemessage{systems}{26}{Registers}
-\setinterfacemessage{systems}{25}{References}
-\setinterfacemessage{systems}{24}{Floatblocks}
-\setinterfacemessage{systems}{1}{loading utility-file postponed (typemode)}
-\setinterfacemessage{systems}{23}{-- arranged at --}
-\setinterfacemessage{systems}{22}{use a valid utilityfile}
-\setinterfacemessage{systems}{2}{-- loaded}
-\setinterfacemessage{systems}{19}{meaning (synonyms) of -- loaded}
-\setinterfacemessage{systems}{18}{synonym -- -- does not exist}
-\setinterfacemessage{systems}{7}{module -- already loaded}
-\setinterfacemessage{systems}{6}{module -- not found}
-\setinterfacemessage{systems}{14}{forced newpage in list at --}
-\setinterfacemessage{systems}{15}{saving buffer --}
-\setinterfacemessage{systems}{16}{typesetting buffer --}
-\setinterfacemessage{systems}{17}{typesetting verbatim buffer --}
-\setinterfacemessage{systems}{13}{mark -- defined --}
-\setinterfacemessage{systems}{12}{the utility-file is not sorted, use texutil}
-\setinterfacemessage{systems}{11}{building simple util}
-\setinterfacemessage{systems}{10}{don't use em in --}
-\setinterfacemessage{floatblocks}{1}{-- renumbered / -- => --}
-\setinterfacemessage{floatblocks}{3}{-- moved}
-\setinterfacemessage{floatblocks}{2}{-- saved}
-\setinterfacemessage{floatblocks}{5}{order adapted}
-\setinterfacemessage{floatblocks}{4}{-- placed}
-\setinterfacemessage{floatblocks}{7}{n of bottom floats limited to --}
-\setinterfacemessage{floatblocks}{6}{n of top floats limited to --}
-\setinterfacemessage{floatblocks}{9}{order disturbed}
-\setinterfacemessage{floatblocks}{8}{less than -- lines}
-\setinterfacemessage{floatblocks}{title}{floatblocks}
-\setinterfacemessage{floatblocks}{13}{there is nothing to split}
-\setinterfacemessage{floatblocks}{12}{undefined}
-\setinterfacemessage{floatblocks}{11}{no block given}
-\setinterfacemessage{floatblocks}{10}{-- limited}
-\setinterfacemessage{interactions}{1}{aspect ratio -- x -- (b x h)}
-\setinterfacemessage{interactions}{3}{inactive}
-\setinterfacemessage{interactions}{2}{active}
-\setinterfacemessage{interactions}{5}{unknown attachment --}
-\setinterfacemessage{interactions}{4}{no pagesynchronisation (--) in hmode}
-\setinterfacemessage{interactions}{6}{attachment file -- does not exist}
-\setinterfacemessage{interactions}{title}{interaction}
-\setinterfacemessage{interactions}{21}{-- code inserted}
-\setinterfacemessage{regimes}{1}{regime --}
-\setinterfacemessage{regimes}{3}{unknown regime --}
-\setinterfacemessage{regimes}{2}{regime -- is loaded}
-\setinterfacemessage{regimes}{title}{regime}
-\setinterfacemessage{structures}{1}{begin of sectionblock --}
-\setinterfacemessage{structures}{title}{structure}
-\setinterfacemessage{structures}{2}{end of sectionblock --}
-\setinterfacemessage{linguals}{1}{patterns -- for -- loaded (n=--,e=--,m=--)}
-\setinterfacemessage{linguals}{3}{hyphenations -- for -- loaded (n=--,e=--,m=--)}
-\setinterfacemessage{linguals}{2}{no patterns -- for -- (n=--,e=--,m=--) (--,--)}
-\setinterfacemessage{linguals}{5}{patterns for -- not loaded}
-\setinterfacemessage{linguals}{4}{no hyphenations -- for -- (n=--,e=--,m=--)}
-\setinterfacemessage{linguals}{7}{language specific options [--] introduce a -- skip}
-\setinterfacemessage{linguals}{6}{language -- is undefined}
-\setinterfacemessage{linguals}{9}{language -- is active}
-\setinterfacemessage{linguals}{8}{language specific options [--] seamless appended}
-\setinterfacemessage{linguals}{title}{language}
-\setinterfacemessage{linguals}{10}{patterns -- loaded}
-\setinterfacemessage{verbatims}{1}{file -- does not exist}
-\setinterfacemessage{verbatims}{title}{verbatim}
-\setinterfacemessage{filters}{1}{filter -- is loaded}
-\setinterfacemessage{filters}{title}{filter}
-\setinterfacemessage{filters}{2}{unknown filter --}
-\setinterfacemessage{textblocks}{1}{new version, second pass needed}
-\setinterfacemessage{textblocks}{3}{reading blocks from --}
-\setinterfacemessage{textblocks}{2}{writing blocks to --}
-\setinterfacemessage{textblocks}{5}{-- not hidden}
-\setinterfacemessage{textblocks}{4}{second pass needed}
-\setinterfacemessage{textblocks}{7}{-- hidden}
-\setinterfacemessage{textblocks}{6}{-- hidden and processed}
-\setinterfacemessage{textblocks}{9}{-- not typeset}
-\setinterfacemessage{textblocks}{8}{-- typeset}
-\setinterfacemessage{textblocks}{title}{textblocks}
-\setinterfacemessage{textblocks}{12}{-- skipped}
-\setinterfacemessage{textblocks}{11}{-- loaded and typeset}
-\setinterfacemessage{textblocks}{10}{-- loaded and processed}
-\setinterfacemessage{encodings}{1}{coding --}
-\setinterfacemessage{encodings}{3}{unknown coding --}
-\setinterfacemessage{encodings}{2}{coding -- is loaded}
-\setinterfacemessage{encodings}{title}{encoding}
-\setinterfacemessage{columns}{1}{only -- columns possible}
-\setinterfacemessage{columns}{3}{problems, disable balancing}
-\setinterfacemessage{columns}{2}{use \string\filbreak\space as alternative}
-\setinterfacemessage{columns}{5}{bottom float not yet supported}
-\setinterfacemessage{columns}{4}{top float not yet supported}
-\setinterfacemessage{columns}{7}{balancing aborted after 100 steps}
-\setinterfacemessage{columns}{6}{-- float(s) postponed}
-\setinterfacemessage{columns}{9}{check raggedness}
-\setinterfacemessage{columns}{8}{balanced in -- step(s)}
-\setinterfacemessage{columns}{title}{columns}
-\setinterfacemessage{columns}{13}{wide float moved to top of columns}
-\setinterfacemessage{columns}{12}{float moved to next column / --}
-\setinterfacemessage{columns}{11}{float too wide for column}
-\setinterfacemessage{columns}{10}{(less than) 1 line left}
-\setinterfacemessage{symbols}{1}{loading symbolset --}
-\setinterfacemessage{symbols}{title}{symbols}
-\setinterfacemessage{files}{1}{file synonym -- is already used for --}
-\setinterfacemessage{files}{title}{files}
-\setinterfacemessage{versions}{1}{missing @+}
-\setinterfacemessage{versions}{3}{selected pages: --}
-\setinterfacemessage{versions}{2}{marking pages}
-\setinterfacemessage{versions}{title}{version}
-\setinterfacemessage{specials}{1}{-- loaded}
-\setinterfacemessage{specials}{3}{-- is reset}
-\setinterfacemessage{specials}{2}{no deeper nesting is permitted --}
-\setinterfacemessage{specials}{5}{loading definition file --}
-\setinterfacemessage{specials}{4}{command -- does not exist}
-\setinterfacemessage{specials}{7}{unknown driver --}
-\setinterfacemessage{specials}{6}{nesting is not permitted}
-\setinterfacemessage{specials}{title}{specials}
-\setinterfacemessage{layouts}{1}{textheight adapted with -- at page --}
-\setinterfacemessage{layouts}{3}{-- times text postponed}
-\setinterfacemessage{layouts}{2}{-- times postponed text placed}
-\setinterfacemessage{layouts}{5}{marginblocks inactive}
-\setinterfacemessage{layouts}{4}{marginblocks active}
-\setinterfacemessage{layouts}{7}{calculating logospace}
-\setinterfacemessage{layouts}{6}{subpage set -- processed (size --)}
-\setinterfacemessage{layouts}{9}{currently no more than -- levels in itemizations}
-\setinterfacemessage{layouts}{8}{calculating backgrounds}
-\setinterfacemessage{layouts}{title}{layout}
-\setinterfacemessage{layouts}{11}{spacing -- not permitted in gridmode}
-\setinterfacemessage{layouts}{10}{-- and -- don't add up to 1.0}
-\setinterfacemessage{fonts}{1}{coding --}
-\setinterfacemessage{fonts}{3}{unknown variant --}
-\setinterfacemessage{fonts}{2}{variant -- is loaded}
-\setinterfacemessage{fonts}{5}{style -- is not defined}
-\setinterfacemessage{fonts}{4}{bodyfont -- is not defined}
-\setinterfacemessage{fonts}{7}{unknown format --}
-\setinterfacemessage{fonts}{6}{-- is loaded}
-\setinterfacemessage{fonts}{14}{bodyfont -- is defined (can better be done global)}
-\setinterfacemessage{fonts}{8}{style -- defined}
-\setinterfacemessage{fonts}{title}{bodyfont}
-\setinterfacemessage{fonts}{10}{unknown font file --}
-\setinterfacemessage{databases}{1}{--}
-\setinterfacemessage{databases}{3}{global file --}
-\setinterfacemessage{databases}{2}{local file --}
-\setinterfacemessage{databases}{4}{unknown file --}
-\setinterfacemessage{databases}{title}{databases}
-\setinterfacemessage{publications}{1}{file -- not found, unknown style ignored}
-\setinterfacemessage{publications}{3}{wrote a new auxiliary file \jobname.aux}
-\setinterfacemessage{publications}{title}{publications}
-\setinterfacemessage{publications}{2}{file -- not found, waiting for bibtex}
-\setinterfacemessage{publications}{4}{loading database from --}
-\setinterfacemessage{publications}{5}{warning: cite argument -- on line \the\inputlineno}
-\setinterfacemessage{publications}{6}{loading formatting style from --}
-\setinterfacemessage{javascript}{1}{loading script set --}
-\setinterfacemessage{javascript}{title}{javascript}
-\setinterfacemessage{javascript}{2}{unknown preamble --}
-\setinterfacemessage{check}{1}{missing or ungrouped '=' after '--' in line --}
-\setinterfacemessage{check}{3}{-- -- replaces a macro, use CAPITALS!}
-\setinterfacemessage{check}{2}{-- argument(s) expected in line --}
-\setinterfacemessage{check}{title}{check}
-\setinterfacemessage{metapost}{1}{loading metapost library --}
-\setinterfacemessage{metapost}{title}{metapost}
-\setinterfacemessage{figures}{1}{figure -- can not be found}
-\setinterfacemessage{figures}{3}{dimensions of -- are determined externally}
-\setinterfacemessage{figures}{2}{figure -- is not preset}
-\setinterfacemessage{figures}{5}{dimensions of -- are unknown}
-\setinterfacemessage{figures}{4}{dimensions of -- loaded from figurefile itself}
-\setinterfacemessage{figures}{6}{dimensions of -- calculated by rlxtools}
-\setinterfacemessage{figures}{8}{figureobject -- is reused}
-\setinterfacemessage{figures}{title}{figures}
-\setinterfacemessage{colors}{1}{system -- is global activated}
-\setinterfacemessage{colors}{3}{-- is not defined --}
-\setinterfacemessage{colors}{2}{system -- is local activated}
-\setinterfacemessage{colors}{5}{unknown system --}
-\setinterfacemessage{colors}{4}{system -- is loaded}
-\setinterfacemessage{colors}{7}{palette -- is not available}
-\setinterfacemessage{colors}{6}{palette -- is available}
-\setinterfacemessage{colors}{9}{-- color space is not supported}
-\setinterfacemessage{colors}{8}{specification -- at color -- becomes black}
-\setinterfacemessage{colors}{title}{color}
-\setinterfacemessage{colors}{12}{-- is registered}
-\setinterfacemessage{colors}{11}{color is converted to gray}
-\setinterfacemessage{colors}{10}{-- color space is supported}
-%
-\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/context/base/mkii/mult-mro.mkii b/Master/texmf-dist/tex/context/base/mkii/mult-mro.mkii
deleted file mode 100644
index 70673c31717..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/mult-mro.mkii
+++ /dev/null
@@ -1,210 +0,0 @@
-\setinterfacemessage{references}{1}{referinta necunoscuta --}
-\setinterfacemessage{references}{30}{obiect necunoscut --}
-\setinterfacemessage{references}{3}{tip necunoscut de referinta --}
-\setinterfacemessage{references}{2}{referinta duplicat -- la pagina --}
-\setinterfacemessage{references}{5}{number of unknown references: --}
-\setinterfacemessage{references}{4}{referinta eronata --}
-\setinterfacemessage{references}{6}{number of illegal references: --}
-\setinterfacemessage{references}{25}{references from document '--' are not imported (export again)}
-\setinterfacemessage{references}{24}{references from document '--' are not exported}
-\setinterfacemessage{references}{title}{referinte}
-\setinterfacemessage{references}{26}{references from document '--' are imported}
-\setinterfacemessage{references}{31}{obiect duplicat --}
-\setinterfacemessage{references}{21}{documentul -- este incarcat}
-\setinterfacemessage{references}{22}{documentul -- nu este interactiv}
-\setinterfacemessage{references}{23}{referinta obscura -- (prefix=--)}
-\setinterfacemessage{documents}{1}{sheet --}
-\setinterfacemessage{documents}{title}{sheets}
-\setinterfacemessage{documents}{2}{number --}
-\setinterfacemessage{handlings}{1}{font handling --}
-\setinterfacemessage{handlings}{3}{unknown font handling --}
-\setinterfacemessage{handlings}{2}{font handling -- is loaded}
-\setinterfacemessage{handlings}{title}{handling}
-\setinterfacemessage{systems}{title}{sistem}
-\setinterfacemessage{systems}{41}{fisierul extern -- din grupul -- nu exista}
-\setinterfacemessage{systems}{9}{-- nu este gasit/procesat}
-\setinterfacemessage{systems}{91}{papertray --}
-\setinterfacemessage{systems}{8}{o noua versiune de fisier utilitar, este necesara o noua trecere}
-\setinterfacemessage{systems}{21}{nici o data utilitara nu este incarcata}
-\setinterfacemessage{systems}{20}{intelesul (ordinea) pentru -- incarcat}
-\setinterfacemessage{systems}{5}{macro-urile din modulul -- s-au incarcat}
-\setinterfacemessage{systems}{4}{comanda -- este deja definita}
-\setinterfacemessage{systems}{27}{Versiune}
-\setinterfacemessage{systems}{26}{Registri}
-\setinterfacemessage{systems}{25}{Referinte}
-\setinterfacemessage{systems}{24}{Blocuri}
-\setinterfacemessage{systems}{1}{se incarca utilitarul-fisierul este amanat (typemode)}
-\setinterfacemessage{systems}{23}{-- aranjat la --}
-\setinterfacemessage{systems}{22}{folositi un fisier utilitar valid}
-\setinterfacemessage{systems}{2}{-- s-a incarcat}
-\setinterfacemessage{systems}{19}{intelesul (sinonimele) pentru -- incarcat}
-\setinterfacemessage{systems}{18}{sinonimul -- -- nu exista}
-\setinterfacemessage{systems}{7}{macro-urile din modulul -- s-au incarcat deja}
-\setinterfacemessage{systems}{6}{nu s-au gasit macro-uri in modulul --}
-\setinterfacemessage{systems}{14}{s-a fortat trecere pa pagina noua in lista la --}
-\setinterfacemessage{systems}{15}{buffer salvat --}
-\setinterfacemessage{systems}{16}{buffer-ul -- s-a cules}
-\setinterfacemessage{systems}{17}{se culege buffer-ul verbatim --}
-\setinterfacemessage{systems}{13}{marcajul -- definit --}
-\setinterfacemessage{systems}{12}{fisierul utilitar nu este sortat, folositi texutil}
-\setinterfacemessage{systems}{11}{se creeaza un utilitar simplu}
-\setinterfacemessage{systems}{10}{nu folositi em in --}
-\setinterfacemessage{floatblocks}{1}{-- renumerotat / -- => --}
-\setinterfacemessage{floatblocks}{3}{-- mutat}
-\setinterfacemessage{floatblocks}{2}{-- salvat}
-\setinterfacemessage{floatblocks}{5}{ordinea adaptata}
-\setinterfacemessage{floatblocks}{4}{-- plasat}
-\setinterfacemessage{floatblocks}{7}{nr. blocurilor de jos limitat la --}
-\setinterfacemessage{floatblocks}{6}{nr. cadrelor de sus limitat la --}
-\setinterfacemessage{floatblocks}{9}{ordinea deranjata}
-\setinterfacemessage{floatblocks}{8}{mai putin de -- linii}
-\setinterfacemessage{floatblocks}{title}{Blocuri}
-\setinterfacemessage{floatblocks}{13}{there is nothing to split}
-\setinterfacemessage{floatblocks}{12}{nedefinit}
-\setinterfacemessage{floatblocks}{11}{nu este dat nici un bloc}
-\setinterfacemessage{floatblocks}{10}{-- limitat}
-\setinterfacemessage{interactions}{1}{aspectul -- x -- (b x h)}
-\setinterfacemessage{interactions}{3}{inactiv}
-\setinterfacemessage{interactions}{2}{activ}
-\setinterfacemessage{interactions}{5}{unknown attachment --}
-\setinterfacemessage{interactions}{4}{nu exista sincronizare pt. pagini (--) in hmode}
-\setinterfacemessage{interactions}{6}{attachment file -- does not exist}
-\setinterfacemessage{interactions}{title}{interactiuni}
-\setinterfacemessage{interactions}{21}{-- cod inserat}
-\setinterfacemessage{regimes}{1}{codificarea --}
-\setinterfacemessage{regimes}{3}{codificarea -- este necunoscuta}
-\setinterfacemessage{regimes}{2}{codificarea -- este Encarcata}
-\setinterfacemessage{regimes}{title}{codificari}
-\setinterfacemessage{structures}{1}{inceput de bloc sectiune --}
-\setinterfacemessage{structures}{title}{structuri}
-\setinterfacemessage{structures}{2}{sfarsit de bloc sectiune --}
-\setinterfacemessage{linguals}{1}{sablonul -- pentru -- s-a incarcat (n=--,e=--,m=--)}
-\setinterfacemessage{linguals}{3}{despartirea in silabe -- pentru -- s-a incarcat (n=--,e=--,m=--)}
-\setinterfacemessage{linguals}{2}{nu exista sabloane -- pentru -- (n=--,e=--,m=--) (--,--)}
-\setinterfacemessage{linguals}{5}{sabloanele pentru -- nu sunt incarcate}
-\setinterfacemessage{linguals}{4}{nu exista despartire in silabe -- pentru -- (n=--,e=--,m=--)}
-\setinterfacemessage{linguals}{7}{optiunile specifice ale limbii [--] introduc un spatiu --}
-\setinterfacemessage{linguals}{6}{limba -- nu este definita}
-\setinterfacemessage{linguals}{9}{limba -- este activa}
-\setinterfacemessage{linguals}{8}{optiunile specifice ale limbii [--] adaugate}
-\setinterfacemessage{linguals}{title}{limbi}
-\setinterfacemessage{linguals}{10}{sabloanele -- incarcate}
-\setinterfacemessage{verbatims}{1}{fisierul -- nu exista}
-\setinterfacemessage{verbatims}{title}{verbatim}
-\setinterfacemessage{filters}{1}{filter -- is loaded}
-\setinterfacemessage{filters}{title}{filter}
-\setinterfacemessage{filters}{2}{unknown filter --}
-\setinterfacemessage{textblocks}{1}{o noua versiune, este nevoie de inca o trecere}
-\setinterfacemessage{textblocks}{3}{se citesc blocurile din --}
-\setinterfacemessage{textblocks}{2}{se scriu blocurile in --}
-\setinterfacemessage{textblocks}{5}{-- nu este ascuns}
-\setinterfacemessage{textblocks}{4}{este nevoie de inca o trecere}
-\setinterfacemessage{textblocks}{7}{-- ascuns}
-\setinterfacemessage{textblocks}{6}{-- ascuns si procesat}
-\setinterfacemessage{textblocks}{9}{-- nu este cules}
-\setinterfacemessage{textblocks}{8}{-- cules}
-\setinterfacemessage{textblocks}{title}{blocuri de text}
-\setinterfacemessage{textblocks}{12}{-- sarit peste}
-\setinterfacemessage{textblocks}{11}{-- incarcat si cules}
-\setinterfacemessage{textblocks}{10}{-- incarcat si procesat}
-\setinterfacemessage{encodings}{1}{codificarea --}
-\setinterfacemessage{encodings}{3}{codificarea -- este necunoscuta}
-\setinterfacemessage{encodings}{2}{codificarea -- este Encarcata}
-\setinterfacemessage{encodings}{title}{codificari}
-\setinterfacemessage{columns}{1}{este posibil numai -- coloane}
-\setinterfacemessage{columns}{3}{probleme, se dezactiveaza alinierea}
-\setinterfacemessage{columns}{2}{folositi \string\filbreak\space ca alternativa}
-\setinterfacemessage{columns}{5}{cadrele bottom (bottom float) nu sunt inca suportate}
-\setinterfacemessage{columns}{4}{cadrele top (top float) nu sunt inca suportate}
-\setinterfacemessage{columns}{7}{alinierea este oprita dupa 100 de incercari}
-\setinterfacemessage{columns}{6}{-- blocurile sunt amanate}
-\setinterfacemessage{columns}{9}{verificat alinierea}
-\setinterfacemessage{columns}{8}{aliniat in -- pas(i)}
-\setinterfacemessage{columns}{title}{coloane}
-\setinterfacemessage{columns}{13}{blocul lat este mutat in partea de sus a coloanelor}
-\setinterfacemessage{columns}{12}{blocul este mutat pe urmatoarea coloana / --}
-\setinterfacemessage{columns}{11}{blocul este prea lat pentru coloana}
-\setinterfacemessage{columns}{10}{a mai ramas (mai putin de) 1 linie}
-\setinterfacemessage{symbols}{1}{se incarca setul de simboluri --}
-\setinterfacemessage{symbols}{title}{simboluri}
-\setinterfacemessage{files}{1}{sinonimul fisierelor -- este folosit deja pentru --}
-\setinterfacemessage{files}{title}{fisiere}
-\setinterfacemessage{versions}{1}{lipseste @+}
-\setinterfacemessage{versions}{3}{pagini selectate: --}
-\setinterfacemessage{versions}{2}{pagini marcate}
-\setinterfacemessage{versions}{title}{versiuni}
-\setinterfacemessage{specials}{1}{-- incarcat}
-\setinterfacemessage{specials}{3}{-- s-a resetat}
-\setinterfacemessage{specials}{2}{nu este permis un nivel de imbricare mai mare --}
-\setinterfacemessage{specials}{5}{se incarca fisierul de definitii --}
-\setinterfacemessage{specials}{4}{comanda -- nu exista}
-\setinterfacemessage{specials}{7}{driver necunoscut --}
-\setinterfacemessage{specials}{6}{imbricarea nu este permisa}
-\setinterfacemessage{specials}{title}{specials}
-\setinterfacemessage{layouts}{1}{textheight adaptat cu -- la pagina --}
-\setinterfacemessage{layouts}{3}{textul amanat de -- ori}
-\setinterfacemessage{layouts}{2}{textul amanat de -- ori a fost plasat}
-\setinterfacemessage{layouts}{5}{blocuri marginale inactive}
-\setinterfacemessage{layouts}{4}{blocuri marginale active}
-\setinterfacemessage{layouts}{7}{se calculeaza spatiul pentru logo}
-\setinterfacemessage{layouts}{6}{setul -- de subpagini procesat (dimensiunea --)}
-\setinterfacemessage{layouts}{9}{acum nu se supota mai mult de -- nivele de adancime la iteratii}
-\setinterfacemessage{layouts}{8}{se calculeaza fundalurile}
-\setinterfacemessage{layouts}{title}{aranjamente}
-\setinterfacemessage{layouts}{11}{spatierea -- nu este permisa in gridmode}
-\setinterfacemessage{layouts}{10}{-- si -- nu se adauga pana la 1.0}
-\setinterfacemessage{fonts}{1}{codificarea --}
-\setinterfacemessage{fonts}{3}{varianta necunoscuta --}
-\setinterfacemessage{fonts}{2}{varianta -- este incarcata}
-\setinterfacemessage{fonts}{5}{stilul -- nu este definit}
-\setinterfacemessage{fonts}{4}{corpul de litere -- nu este definit}
-\setinterfacemessage{fonts}{7}{format necunoscut --}
-\setinterfacemessage{fonts}{6}{-- este incarcat}
-\setinterfacemessage{fonts}{14}{bodyfont -- is defined (can better be done global)}
-\setinterfacemessage{fonts}{8}{stilul -- definit}
-\setinterfacemessage{fonts}{title}{corp de litere}
-\setinterfacemessage{fonts}{10}{fisier font necunoscut --}
-\setinterfacemessage{databases}{1}{--}
-\setinterfacemessage{databases}{3}{fisier global --}
-\setinterfacemessage{databases}{2}{fisier local --}
-\setinterfacemessage{databases}{4}{fisier necunoscut --}
-\setinterfacemessage{databases}{title}{baze de date}
-\setinterfacemessage{publications}{1}{file -- not found, unknown style ignored}
-\setinterfacemessage{publications}{3}{wrote a new auxiliary file \jobname.aux}
-\setinterfacemessage{publications}{title}{publications}
-\setinterfacemessage{publications}{2}{file -- not found, waiting for bibtex}
-\setinterfacemessage{publications}{4}{loading database from --}
-\setinterfacemessage{publications}{5}{warning: cite argument -- on line \the\inputlineno}
-\setinterfacemessage{publications}{6}{loading formatting style from --}
-\setinterfacemessage{javascript}{1}{se incarca scriptul --}
-\setinterfacemessage{javascript}{title}{javascript}
-\setinterfacemessage{javascript}{2}{preambul necunoscut --}
-\setinterfacemessage{check}{1}{lipseste '=' dupa '--' in linia --}
-\setinterfacemessage{check}{3}{-- -- inlocuieste un macro, folositi MAJUSCULE!}
-\setinterfacemessage{check}{2}{argumentul(ele) -- sunt asteptate in linia --}
-\setinterfacemessage{check}{title}{verificari}
-\setinterfacemessage{metapost}{1}{se incarca biblioteca metapost --}
-\setinterfacemessage{metapost}{title}{metapost}
-\setinterfacemessage{figures}{1}{figura -- nu poate fi gasita}
-\setinterfacemessage{figures}{3}{dimensions of -- are determined externally}
-\setinterfacemessage{figures}{2}{figura -- nu este presetata}
-\setinterfacemessage{figures}{5}{dimensions of -- are unknown}
-\setinterfacemessage{figures}{4}{dimensiunea figurii -- se incarca din fisierul insusi}
-\setinterfacemessage{figures}{6}{dimensiunea figurii -- este calculata de rlxtools}
-\setinterfacemessage{figures}{8}{obiectul figura -- este refolosit}
-\setinterfacemessage{figures}{title}{figuri}
-\setinterfacemessage{colors}{1}{sistem -- este activata global}
-\setinterfacemessage{colors}{3}{-- nu este definita --}
-\setinterfacemessage{colors}{2}{sistem -- este activata local}
-\setinterfacemessage{colors}{5}{sistem -- necunoscuta}
-\setinterfacemessage{colors}{4}{sistem -- este incarcata}
-\setinterfacemessage{colors}{7}{palette -- nu este disponibila}
-\setinterfacemessage{colors}{6}{paleta -- este disponibila}
-\setinterfacemessage{colors}{9}{spatiul de culoare -- nu este suportat}
-\setinterfacemessage{colors}{8}{specificatia -- la culoarea -- devine neagra}
-\setinterfacemessage{colors}{title}{culori}
-\setinterfacemessage{colors}{12}{-- is registered}
-\setinterfacemessage{colors}{11}{culoarea este convertita la gri}
-\setinterfacemessage{colors}{10}{spatiul de culoare -- este suportat}
-%
-\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/context/base/mkii/mult-nl.mkii b/Master/texmf-dist/tex/context/base/mkii/mult-nl.mkii
deleted file mode 100644
index 7bf09dd57b8..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/mult-nl.mkii
+++ /dev/null
@@ -1,2221 +0,0 @@
-% this file is auto-generated, don't edit this file
-%
-% definitions for interface variables for language nl
-%
-\setinterfacevariable{Addition}{Toevoeging}
-\setinterfacevariable{Alphabetic}{Alphabetic}
-\setinterfacevariable{Balloon}{Ballon}
-\setinterfacevariable{Cap}{Kap}
-\setinterfacevariable{Capital}{Kapitaal}
-\setinterfacevariable{Character}{Letter}
-\setinterfacevariable{Characters}{Letters}
-\setinterfacevariable{CloseDocument}{SluitDocument}
-\setinterfacevariable{ExitViewer}{VerlaatViewer}
-\setinterfacevariable{FirstPage}{EerstePagina}
-\setinterfacevariable{FitHeight}{HoogtePassend}
-\setinterfacevariable{FitWidth}{BreedtePassend}
-\setinterfacevariable{GotoPage}{GaNaarPagina}
-\setinterfacevariable{Greek}{Grieks}
-\setinterfacevariable{Help}{Help}
-\setinterfacevariable{HideField}{VerbergVeld}
-\setinterfacevariable{HideLayer}{VerbergLaag}
-\setinterfacevariable{Key}{Sleutel}
-\setinterfacevariable{LastPage}{LaatstePagina}
-\setinterfacevariable{LoadForm}{LaadFormulier}
-\setinterfacevariable{MONTH}{MAAND}
-\setinterfacevariable{New}{Nieuw}
-\setinterfacevariable{NextJump}{VolgendeSprong}
-\setinterfacevariable{NextPage}{VolgendePagina}
-\setinterfacevariable{Numbers}{Cijfers}
-\setinterfacevariable{OpenNamedDocument}{OpenDocumentOpNaam}
-\setinterfacevariable{Ordinal}{Ordinal}
-\setinterfacevariable{Paragraph}{Paragraaf}
-\setinterfacevariable{PauseMovie}{PauzeerFilm}
-\setinterfacevariable{PauseRendering}{PauzeerRendering}
-\setinterfacevariable{PauseSound}{PauzeerGeluid}
-\setinterfacevariable{PreviousJump}{VorigeSprong}
-\setinterfacevariable{PreviousPage}{VorigePagina}
-\setinterfacevariable{PrintDocument}{PrintDocument}
-\setinterfacevariable{Query}{RaadpleegDocument}
-\setinterfacevariable{QueryAgain}{HerhaalRaadplegen}
-\setinterfacevariable{ResetForm}{ResetFormulier}
-\setinterfacevariable{ResumeMovie}{HervatFilm}
-\setinterfacevariable{ResumeRendering}{HervatRendering}
-\setinterfacevariable{ResumeSound}{HervatGeluid}
-\setinterfacevariable{Romannumerals}{Romeins}
-\setinterfacevariable{SaveDocument}{BewaarDocument}
-\setinterfacevariable{SaveForm}{BewaarFormulier}
-\setinterfacevariable{SaveNamedDocument}{BewaarDocumentOpNaam}
-\setinterfacevariable{SearchAgain}{HerhaalZoeken}
-\setinterfacevariable{SearchDocument}{DoorzoekDocument}
-\setinterfacevariable{ShowBookmarks}{ShowBookmarks}
-\setinterfacevariable{ShowField}{ToonVeld}
-\setinterfacevariable{ShowThumbs}{ShowThumbs}
-\setinterfacevariable{StartMovie}{StartFilm}
-\setinterfacevariable{StartRendering}{StartRendering}
-\setinterfacevariable{StartSound}{StartGeluid}
-\setinterfacevariable{StopMovie}{StopFilm}
-\setinterfacevariable{StopRendering}{StopRendering}
-\setinterfacevariable{StopSound}{StopGeluid}
-\setinterfacevariable{SubmitForm}{VerzendFormulier}
-\setinterfacevariable{ToggleLayer}{WisselLaag}
-\setinterfacevariable{ToggleViewer}{WisselViewer}
-\setinterfacevariable{URL}{URL}
-\setinterfacevariable{VideLayer}{ToonLaag}
-\setinterfacevariable{ViewerHelp}{ViewerHelp}
-\setinterfacevariable{WEEKDAY}{WEEKDAG}
-\setinterfacevariable{WORD}{WOORD}
-\setinterfacevariable{WORDS}{WOORDEN}
-\setinterfacevariable{Word}{Woord}
-\setinterfacevariable{Words}{Woorden}
-\setinterfacevariable{abbreviation}{afkorting}
-\setinterfacevariable{abbreviations}{afkortingen}
-\setinterfacevariable{absolute}{absoluut}
-\setinterfacevariable{action}{actie}
-\setinterfacevariable{after}{na}
-\setinterfacevariable{all}{alles}
-\setinterfacevariable{alphabetic}{alphabetic}
-\setinterfacevariable{always}{altijd}
-\setinterfacevariable{anchor}{anker}
-\setinterfacevariable{and}{en}
-\setinterfacevariable{answerarea}{antwoordgebied}
-\setinterfacevariable{appendices}{bijlagen}
-\setinterfacevariable{appendix}{bijlage}
-\setinterfacevariable{april}{april}
-\setinterfacevariable{aside}{aside}
-\setinterfacevariable{atleftmargin}{oplinkermarge}
-\setinterfacevariable{atmargin}{opmarge}
-\setinterfacevariable{atpage}{oppagina}
-\setinterfacevariable{atrightmargin}{oprechtermarge}
-\setinterfacevariable{attachment}{aanhangsel}
-\setinterfacevariable{august}{augustus}
-\setinterfacevariable{author}{auteur}
-\setinterfacevariable{auto}{auto}
-\setinterfacevariable{autointro}{autointro}
-\setinterfacevariable{autopunctuation}{autopunctuation}
-\setinterfacevariable{back}{terug}
-\setinterfacevariable{background}{achtergrond}
-\setinterfacevariable{backmatter}{uitleidingen}
-\setinterfacevariable{backpart}{uitleiding}
-\setinterfacevariable{backspace}{rugwit}
-\setinterfacevariable{backward}{achteruit}
-\setinterfacevariable{bbl}{bbl}
-\setinterfacevariable{before}{voor}
-\setinterfacevariable{begin}{begin}
-\setinterfacevariable{bib}{bib}
-\setinterfacevariable{big}{groot}
-\setinterfacevariable{bigbodyfont}{grootkorps}
-\setinterfacevariable{bigger}{groter}
-\setinterfacevariable{bigpreference}{grotevoorkeur}
-\setinterfacevariable{blank}{blanko}
-\setinterfacevariable{block}{block}
-\setinterfacevariable{blockquote}{blokcitaat}
-\setinterfacevariable{bodymatter}{hoofdteksten}
-\setinterfacevariable{bodypart}{hoofdtekst}
-\setinterfacevariable{bold}{vet}
-\setinterfacevariable{bolditalic}{vetitalic}
-\setinterfacevariable{boldslanted}{vetschuin}
-\setinterfacevariable{bookmark}{bookmark}
-\setinterfacevariable{both}{beide}
-\setinterfacevariable{bothtext}{bothtext}
-\setinterfacevariable{bottom}{onder}
-\setinterfacevariable{box}{box}
-\setinterfacevariable{brief}{brief}
-\setinterfacevariable{broad}{ruim}
-\setinterfacevariable{buffer}{buffer}
-\setinterfacevariable{by}{per}
-\setinterfacevariable{calligraphic}{calligrafie}
-\setinterfacevariable{camel}{camel}
-\setinterfacevariable{cap}{kap}
-\setinterfacevariable{capital}{kapitaal}
-\setinterfacevariable{category}{category}
-\setinterfacevariable{cd:character}{cd:character}
-\setinterfacevariable{cd:font}{cd:font}
-\setinterfacevariable{center}{centreer}
-\setinterfacevariable{centerlast}{centerlast}
-\setinterfacevariable{chapter}{hoofdstuk}
-\setinterfacevariable{character}{letter}
-\setinterfacevariable{characters}{letters}
-\setinterfacevariable{chemical}{chemical}
-\setinterfacevariable{chemicals}{chemicals}
-\setinterfacevariable{chemistry}{chemie}
-\setinterfacevariable{cite}{cite}
-\setinterfacevariable{closed}{gesloten}
-\setinterfacevariable{color}{kleur}
-\setinterfacevariable{column}{kolom}
-\setinterfacevariable{columns}{kolommen}
-\setinterfacevariable{combination}{combinatie}
-\setinterfacevariable{command}{commando}
-\setinterfacevariable{commands}{commandos}
-\setinterfacevariable{comment}{commentaar}
-\setinterfacevariable{component}{onderdeel}
-\setinterfacevariable{compressseparator}{compressseparator}
-\setinterfacevariable{compressstopper}{compressstopper}
-\setinterfacevariable{concept}{concept}
-\setinterfacevariable{construction}{construction}
-\setinterfacevariable{content}{inhoud}
-\setinterfacevariable{contents}{inhouden}
-\setinterfacevariable{continue}{verder}
-\setinterfacevariable{continued}{vervolgd}
-\setinterfacevariable{controls}{sturing}
-\setinterfacevariable{conversion}{conversie}
-\setinterfacevariable{current}{huidige}
-\setinterfacevariable{cutspace}{snijwit}
-\setinterfacevariable{dataset}{dataset}
-\setinterfacevariable{date}{datum}
-\setinterfacevariable{day}{dag}
-\setinterfacevariable{december}{december}
-\setinterfacevariable{default}{default}
-\setinterfacevariable{depth}{diepte}
-\setinterfacevariable{description}{doordefinitie}
-\setinterfacevariable{disable}{blokkeer}
-\setinterfacevariable{display}{scherm}
-\setinterfacevariable{dot}{punt}
-\setinterfacevariable{doublesided}{dubbelzijdig}
-\setinterfacevariable{down}{omlaag}
-\setinterfacevariable{each}{elk}
-\setinterfacevariable{edge}{rand}
-\setinterfacevariable{effective}{effectief}
-\setinterfacevariable{eight}{acht}
-\setinterfacevariable{embed}{sluitin}
-\setinterfacevariable{empty}{leeg}
-\setinterfacevariable{enable}{enable}
-\setinterfacevariable{end}{eind}
-\setinterfacevariable{endnote}{eindnoot}
-\setinterfacevariable{enumeration}{doornummering}
-\setinterfacevariable{environment}{omgeving}
-\setinterfacevariable{even}{even}
-\setinterfacevariable{export}{export}
-\setinterfacevariable{external}{extern}
-\setinterfacevariable{extremestretch}{extremestretch}
-\setinterfacevariable{fact}{gegeven}
-\setinterfacevariable{fallback}{fallback}
-\setinterfacevariable{february}{februari}
-\setinterfacevariable{field}{veld}
-\setinterfacevariable{figure}{figuur}
-\setinterfacevariable{figures}{figuren}
-\setinterfacevariable{file}{file}
-\setinterfacevariable{final}{definitief}
-\setinterfacevariable{first}{eerste}
-\setinterfacevariable{firstcolumn}{eerstekolom}
-\setinterfacevariable{firstpage}{eerstepagina}
-\setinterfacevariable{firstsubpage}{eerstesubpagina}
-\setinterfacevariable{fit}{passend}
-\setinterfacevariable{five}{vijf}
-\setinterfacevariable{fix}{herstel}
-\setinterfacevariable{fixed}{vast}
-\setinterfacevariable{flexible}{flexibel}
-\setinterfacevariable{float}{blok}
-\setinterfacevariable{flushinner}{lijnbinnen}
-\setinterfacevariable{flushleft}{lijnlinks}
-\setinterfacevariable{flushouter}{lijnbuiten}
-\setinterfacevariable{flushright}{lijnrechts}
-\setinterfacevariable{followingpage}{opvolgendepagina}
-\setinterfacevariable{font}{font}
-\setinterfacevariable{footer}{voet}
-\setinterfacevariable{footnote}{voetnoot}
-\setinterfacevariable{force}{forceer}
-\setinterfacevariable{foreground}{voorgrond}
-\setinterfacevariable{formula}{formule}
-\setinterfacevariable{formulas}{formules}
-\setinterfacevariable{forward}{vooruit}
-\setinterfacevariable{four}{vier}
-\setinterfacevariable{fractions}{fractions}
-\setinterfacevariable{frame}{kader}
-\setinterfacevariable{framedtext}{kadertekst}
-\setinterfacevariable{friday}{vrijdag}
-\setinterfacevariable{frontmatter}{inleidingen}
-\setinterfacevariable{frontpart}{inleiding}
-\setinterfacevariable{fullhz}{fullenhz}
-\setinterfacevariable{global}{globaal}
-\setinterfacevariable{graphic}{grafiek}
-\setinterfacevariable{graphics}{grafieken}
-\setinterfacevariable{gray}{grijs}
-\setinterfacevariable{greek}{grieks}
-\setinterfacevariable{grid}{grid}
-\setinterfacevariable{halfline}{halveregel}
-\setinterfacevariable{handwritten}{handschrift}
-\setinterfacevariable{hang}{hang}
-\setinterfacevariable{hanging}{hangend}
-\setinterfacevariable{hangingboth}{beidehangend}
-\setinterfacevariable{head}{kop}
-\setinterfacevariable{header}{hoofd}
-\setinterfacevariable{headintext}{kopintekst}
-\setinterfacevariable{height}{hoogte}
-\setinterfacevariable{helptext}{helptekst}
-\setinterfacevariable{hencefore}{hierboven}
-\setinterfacevariable{here}{hier}
-\setinterfacevariable{hereafter}{hieronder}
-\setinterfacevariable{hidden}{verborgen}
-\setinterfacevariable{hiddenbar}{hiddenbar}
-\setinterfacevariable{hiding}{verbergen}
-\setinterfacevariable{high}{hoog}
-\setinterfacevariable{horizontal}{horizontaal}
-\setinterfacevariable{hyphenated}{afgebroken}
-\setinterfacevariable{hz}{hz}
-\setinterfacevariable{inbetween}{tussen}
-\setinterfacevariable{index}{index}
-\setinterfacevariable{indices}{indices}
-\setinterfacevariable{inherit}{erf}
-\setinterfacevariable{ininner}{inbinnen}
-\setinterfacevariable{ininneredge}{ininneredge}
-\setinterfacevariable{ininnermargin}{ininnermargin}
-\setinterfacevariable{inleft}{inlinker}
-\setinterfacevariable{inleftedge}{inlinkerrand}
-\setinterfacevariable{inleftmargin}{inlinkermarge}
-\setinterfacevariable{inline}{inline}
-\setinterfacevariable{inmargin}{inmarge}
-\setinterfacevariable{inner}{binnen}
-\setinterfacevariable{inneredge}{binnenrand}
-\setinterfacevariable{innermargin}{binnenmarge}
-\setinterfacevariable{inother}{inandere}
-\setinterfacevariable{inouter}{inbuiten}
-\setinterfacevariable{inouteredge}{inouteredge}
-\setinterfacevariable{inoutermargin}{inoutermargin}
-\setinterfacevariable{inright}{inrechter}
-\setinterfacevariable{inrightedge}{inrechterrand}
-\setinterfacevariable{inrightmargin}{inrechtermarge}
-\setinterfacevariable{integral}{integral}
-\setinterfacevariable{interaction}{interactie}
-\setinterfacevariable{interactionmenu}{interactiemenu}
-\setinterfacevariable{interactive}{interactive}
-\setinterfacevariable{intermezzi}{intermezzos}
-\setinterfacevariable{intermezzo}{intermezzo}
-\setinterfacevariable{intext}{intekst}
-\setinterfacevariable{intro}{intro}
-\setinterfacevariable{invertedshort}{invertedshort}
-\setinterfacevariable{italic}{italic}
-\setinterfacevariable{italicbold}{italicvet}
-\setinterfacevariable{item}{som}
-\setinterfacevariable{itemize}{opsomming}
-\setinterfacevariable{its}{its}
-\setinterfacevariable{january}{januari}
-\setinterfacevariable{joinedup}{aansluitend}
-\setinterfacevariable{july}{juli}
-\setinterfacevariable{june}{juni}
-\setinterfacevariable{keep}{handhaaf}
-\setinterfacevariable{kerncharacters}{kerncharacters}
-\setinterfacevariable{knockout}{knockout}
-\setinterfacevariable{label}{label}
-\setinterfacevariable{landscape}{liggend}
-\setinterfacevariable{last}{laatste}
-\setinterfacevariable{lastcolumn}{laatstekolom}
-\setinterfacevariable{lastpage}{laatstepagina}
-\setinterfacevariable{lastpagenumber}{laatstepaginanummer}
-\setinterfacevariable{lastsubpage}{laatstesubpagina}
-\setinterfacevariable{layer}{layer}
-\setinterfacevariable{left}{links}
-\setinterfacevariable{leftedge}{linkerrand}
-\setinterfacevariable{lefthanging}{linkshangend}
-\setinterfacevariable{leftmargin}{linkermarge}
-\setinterfacevariable{leftpage}{linkerpagina}
-\setinterfacevariable{lefttoright}{lefttoright}
-\setinterfacevariable{legend}{legenda}
-\setinterfacevariable{less}{minder}
-\setinterfacevariable{lesshyphenation}{lesshyphenation}
-\setinterfacevariable{letterspacing}{letterspacing}
-\setinterfacevariable{line}{regel}
-\setinterfacevariable{linenote}{regelnoot}
-\setinterfacevariable{lines}{regels}
-\setinterfacevariable{linked}{linked}
-\setinterfacevariable{list}{lijst}
-\setinterfacevariable{local}{lokaal}
-\setinterfacevariable{localenvironment}{deelomgeving}
-\setinterfacevariable{logo}{logo}
-\setinterfacevariable{logos}{logos}
-\setinterfacevariable{lohi}{laho}
-\setinterfacevariable{long}{long}
-\setinterfacevariable{loose}{los}
-\setinterfacevariable{low}{laag}
-\setinterfacevariable{ls}{ls}
-\setinterfacevariable{makeup}{opmaak}
-\setinterfacevariable{mar}{mar}
-\setinterfacevariable{march}{maart}
-\setinterfacevariable{margin}{marge}
-\setinterfacevariable{marginedge}{kantlijn}
-\setinterfacevariable{margintext}{margetekst}
-\setinterfacevariable{margintitle}{margetitel}
-\setinterfacevariable{marking}{markering}
-\setinterfacevariable{math}{math}
-\setinterfacevariable{mathalignment}{wiskundeuitlijnen}
-\setinterfacevariable{mathcases}{mathcases}
-\setinterfacevariable{mathematics}{wiskunde}
-\setinterfacevariable{mathmatrix}{wiskundematrix}
-\setinterfacevariable{max}{max}
-\setinterfacevariable{maxdepth}{maxdiepte}
-\setinterfacevariable{maxheight}{maxhoogte}
-\setinterfacevariable{maxwidth}{maxbreedte}
-\setinterfacevariable{may}{mei}
-\setinterfacevariable{mediaeval}{mediaeval}
-\setinterfacevariable{medium}{middel}
-\setinterfacevariable{middle}{midden}
-\setinterfacevariable{min}{min}
-\setinterfacevariable{mindepth}{mindiepte}
-\setinterfacevariable{minheight}{minhoogte}
-\setinterfacevariable{minwidth}{minbreedte}
-\setinterfacevariable{mirrored}{gespiegeld}
-\setinterfacevariable{mixed}{mixed}
-\setinterfacevariable{monday}{maandag}
-\setinterfacevariable{mono}{mono}
-\setinterfacevariable{monobold}{monovet}
-\setinterfacevariable{mononormal}{mononormal}
-\setinterfacevariable{month}{maand}
-\setinterfacevariable{more}{meer}
-\setinterfacevariable{morehyphenation}{morehyphenation}
-\setinterfacevariable{name}{naam}
-\setinterfacevariable{narrow}{smal}
-\setinterfacevariable{negative}{negatief}
-\setinterfacevariable{never}{nooit}
-\setinterfacevariable{new}{nieuw}
-\setinterfacevariable{next}{volgende}
-\setinterfacevariable{nextevenpage}{volgendeevenpagina}
-\setinterfacevariable{nextoddpage}{volgendeonevenpagina}
-\setinterfacevariable{nextpage}{volgendepagina}
-\setinterfacevariable{nextsubpage}{volgendesubpagina}
-\setinterfacevariable{nine}{negen}
-\setinterfacevariable{no}{nee}
-\setinterfacevariable{nocheck}{geencontrole}
-\setinterfacevariable{nodepth}{nodepth}
-\setinterfacevariable{nofit}{nietpassend}
-\setinterfacevariable{nogrid}{geengrid}
-\setinterfacevariable{noheight}{noheight}
-\setinterfacevariable{nohz}{geenhz}
-\setinterfacevariable{noline}{noline}
-\setinterfacevariable{nomarking}{geenmarkering}
-\setinterfacevariable{nomenubar}{geenmenubalk}
-\setinterfacevariable{none}{geen}
-\setinterfacevariable{nonumber}{geennummer}
-\setinterfacevariable{norepeat}{norepeat}
-\setinterfacevariable{normal}{normaal}
-\setinterfacevariable{normalshort}{normalshort}
-\setinterfacevariable{nospacing}{geenspatiering}
-\setinterfacevariable{nostopper}{geenafsluiter}
-\setinterfacevariable{not}{niet}
-\setinterfacevariable{notation}{notation}
-\setinterfacevariable{note}{note}
-\setinterfacevariable{nothanging}{niethangend}
-\setinterfacevariable{nothyphenated}{nietafgebroken}
-\setinterfacevariable{notjoinedup}{nietaansluitend}
-\setinterfacevariable{november}{november}
-\setinterfacevariable{nowhere}{nergens}
-\setinterfacevariable{nowhite}{geenwit}
-\setinterfacevariable{number}{nummer}
-\setinterfacevariable{numbers}{cijfers}
-\setinterfacevariable{october}{oktober}
-\setinterfacevariable{odd}{oneven}
-\setinterfacevariable{off}{uit}
-\setinterfacevariable{offset}{offset}
-\setinterfacevariable{old}{oud}
-\setinterfacevariable{oldstyle}{oldstyle}
-\setinterfacevariable{on}{aan}
-\setinterfacevariable{one}{een}
-\setinterfacevariable{opposite}{naast}
-\setinterfacevariable{ordinal}{ordinal}
-\setinterfacevariable{outer}{buiten}
-\setinterfacevariable{outeredge}{buitenrand}
-\setinterfacevariable{outermargin}{buitenmarge}
-\setinterfacevariable{overbar}{overstreep}
-\setinterfacevariable{overbars}{overstrepen}
-\setinterfacevariable{overlay}{overlay}
-\setinterfacevariable{overprint}{overprint}
-\setinterfacevariable{overstrike}{doorstreep}
-\setinterfacevariable{overstrikes}{doorstrepen}
-\setinterfacevariable{packed}{opelkaar}
-\setinterfacevariable{page}{pagina}
-\setinterfacevariable{pagecomment}{paginacommentaar}
-\setinterfacevariable{pagenumber}{paginanummer}
-\setinterfacevariable{paper}{papier}
-\setinterfacevariable{paragraph}{alinea}
-\setinterfacevariable{part}{deel}
-\setinterfacevariable{positive}{positief}
-\setinterfacevariable{postponing}{uitstellen}
-\setinterfacevariable{postscript}{postscript}
-\setinterfacevariable{precedingpage}{voorafgaandepagina}
-\setinterfacevariable{preference}{voorkeur}
-\setinterfacevariable{preview}{preview}
-\setinterfacevariable{previous}{vorige}
-\setinterfacevariable{previousevenpage}{vorigeevenpagina}
-\setinterfacevariable{previousoddpage}{vorigeonevenpagina}
-\setinterfacevariable{previouspage}{vorigepagina}
-\setinterfacevariable{previoussubpage}{vorigesubpagina}
-\setinterfacevariable{print}{print}
-\setinterfacevariable{printable}{printbaar}
-\setinterfacevariable{process}{proces}
-\setinterfacevariable{product}{produkt}
-\setinterfacevariable{program}{programma}
-\setinterfacevariable{project}{project}
-\setinterfacevariable{protected}{beschermd}
-\setinterfacevariable{quadruple}{viertal}
-\setinterfacevariable{quarterline}{kwartregel}
-\setinterfacevariable{quotation}{citaat}
-\setinterfacevariable{quote}{citeer}
-\setinterfacevariable{ran}{ran}
-\setinterfacevariable{random}{willekeurig}
-\setinterfacevariable{readonly}{alleenleesbaar}
-\setinterfacevariable{rectangular}{recht}
-\setinterfacevariable{reference}{referentie}
-\setinterfacevariable{referral}{kenmerk}
-\setinterfacevariable{region}{gebied}
-\setinterfacevariable{register}{register}
-\setinterfacevariable{regular}{regular}
-\setinterfacevariable{relative}{relatief}
-\setinterfacevariable{repeat}{herhaal}
-\setinterfacevariable{required}{verplicht}
-\setinterfacevariable{reset}{reset}
-\setinterfacevariable{reverse}{omgekeerd}
-\setinterfacevariable{right}{rechts}
-\setinterfacevariable{rightedge}{rechterrand}
-\setinterfacevariable{righthanging}{rechtshangend}
-\setinterfacevariable{rightmargin}{rechtermarge}
-\setinterfacevariable{rightpage}{rechterpagina}
-\setinterfacevariable{righttoleft}{righttoleft}
-\setinterfacevariable{roman}{romaan}
-\setinterfacevariable{romannumerals}{romeins}
-\setinterfacevariable{rotate}{roteer}
-\setinterfacevariable{rotated}{geroteerd}
-\setinterfacevariable{round}{rond}
-\setinterfacevariable{row}{rij}
-\setinterfacevariable{rule}{lijn}
-\setinterfacevariable{samepage}{zelfdepagina}
-\setinterfacevariable{sans}{sans}
-\setinterfacevariable{sansbold}{sansvet}
-\setinterfacevariable{sansnormal}{sansnormal}
-\setinterfacevariable{sansserif}{schreefloos}
-\setinterfacevariable{saturday}{zaterdag}
-\setinterfacevariable{screen}{raster}
-\setinterfacevariable{section}{paragraaf}
-\setinterfacevariable{sectionblockenvironment}{sectieblokomgeving}
-\setinterfacevariable{sectionnumber}{sectienummer}
-\setinterfacevariable{see}{zie}
-\setinterfacevariable{selectfont}{selectfont}
-\setinterfacevariable{separator}{scheider}
-\setinterfacevariable{september}{september}
-\setinterfacevariable{serif}{serif}
-\setinterfacevariable{serifbold}{serifbold}
-\setinterfacevariable{serifnormal}{serifnormal}
-\setinterfacevariable{serried}{aanelkaar}
-\setinterfacevariable{setups}{setups}
-\setinterfacevariable{seven}{zeven}
-\setinterfacevariable{sheet}{sheet}
-\setinterfacevariable{shiftdown}{shiftdown}
-\setinterfacevariable{shiftup}{shiftup}
-\setinterfacevariable{short}{kort}
-\setinterfacevariable{simplefonts}{simplefonts}
-\setinterfacevariable{simplelist}{simplelist}
-\setinterfacevariable{singlesided}{enkelzijdig}
-\setinterfacevariable{six}{zes}
-\setinterfacevariable{slanted}{schuin}
-\setinterfacevariable{slantedbold}{schuinvet}
-\setinterfacevariable{small}{klein}
-\setinterfacevariable{smallbodyfont}{kleinkorps}
-\setinterfacevariable{smallbold}{kleinvet}
-\setinterfacevariable{smallbolditalic}{kleinvetitalic}
-\setinterfacevariable{smallboldslanted}{kleinvetschuin}
-\setinterfacevariable{smallcaps}{smallcaps}
-\setinterfacevariable{smaller}{kleiner}
-\setinterfacevariable{smallitalic}{kleinitalic}
-\setinterfacevariable{smallitalicbold}{kleinitalicvet}
-\setinterfacevariable{smallnormal}{kleinnormaal}
-\setinterfacevariable{smallslanted}{kleinschuin}
-\setinterfacevariable{smallslantedbold}{kleinschuinvet}
-\setinterfacevariable{smalltype}{kleintype}
-\setinterfacevariable{somewhere}{ergens}
-\setinterfacevariable{sorted}{gesorteerd}
-\setinterfacevariable{sorting}{sorting}
-\setinterfacevariable{space}{spatie}
-\setinterfacevariable{spacing}{spatiering}
-\setinterfacevariable{speech}{spraak}
-\setinterfacevariable{split}{splitsen}
-\setinterfacevariable{spot}{spot}
-\setinterfacevariable{standard}{standaard}
-\setinterfacevariable{start}{start}
-\setinterfacevariable{starter}{opener}
-\setinterfacevariable{sticker}{sticker}
-\setinterfacevariable{stop}{stop}
-\setinterfacevariable{stopper}{afsluiter}
-\setinterfacevariable{stretch}{rek}
-\setinterfacevariable{stretched}{stretched}
-\setinterfacevariable{strict}{streng}
-\setinterfacevariable{strong}{sterk}
-\setinterfacevariable{strut}{strut}
-\setinterfacevariable{sub}{sub}
-\setinterfacevariable{subbackward}{subachteruit}
-\setinterfacevariable{subformula}{subformule}
-\setinterfacevariable{subforward}{subvooruit}
-\setinterfacevariable{subject}{onderwerp}
-\setinterfacevariable{subpage}{subpagina}
-\setinterfacevariable{subs}{subs}
-\setinterfacevariable{subsection}{subparagraaf}
-\setinterfacevariable{subsubject}{subonderwerp}
-\setinterfacevariable{subsubsection}{subsubparagraaf}
-\setinterfacevariable{subsubsubject}{subsubonderwerp}
-\setinterfacevariable{subsubsubsection}{subsubsubparagraaf}
-\setinterfacevariable{subsubsubsubject}{subsubsubonderwerp}
-\setinterfacevariable{subsubsubsubsection}{subsubsubsubparagraaf}
-\setinterfacevariable{subsubsubsubsubject}{subsubsubsubonderwerp}
-\setinterfacevariable{subsubsubsubsubsection}{subsubsubsubsubparagraaf}
-\setinterfacevariable{subsubsubsubsubsubject}{subsubsubsubsubonderwerp}
-\setinterfacevariable{subsubsubsubsubsubsection}{subsubsubsubsubsubparagraaf}
-\setinterfacevariable{subsubsubsubsubsubsubject}{subsubsubsubsubsubonderwerp}
-\setinterfacevariable{subsubsubsubsubsubsubsection}{subsubsubsubsubsubsubparagraaf}
-\setinterfacevariable{subsubsubsubsubsubsubsubject}{subsubsubsubsubsubsubonderwerp}
-\setinterfacevariable{subsubsubsubsubsubsubsubsection}{subsubsubsubsubsubsubsubparagraaf}
-\setinterfacevariable{subsubsubsubsubsubsubsubsubject}{subsubsubsubsubsubsubsubonderwerp}
-\setinterfacevariable{subsubsubsubsubsubsubsubsubsection}{subsubsubsubsubsubsubsubsubparagraaf}
-\setinterfacevariable{subsubsubsubsubsubsubsubsubsubject}{subsubsubsubsubsubsubsubsubonderwerp}
-\setinterfacevariable{sunday}{zondag}
-\setinterfacevariable{support}{support}
-\setinterfacevariable{sym}{sym}
-\setinterfacevariable{symbol}{symbool}
-\setinterfacevariable{synchronize}{synchroniseer}
-\setinterfacevariable{synonym}{synonym}
-\setinterfacevariable{system}{systeem}
-\setinterfacevariable{table}{tabel}
-\setinterfacevariable{tablehead}{tabelkop}
-\setinterfacevariable{tables}{tabellen}
-\setinterfacevariable{tabletail}{tabelstaart}
-\setinterfacevariable{tabulate}{tabulatie}
-\setinterfacevariable{tabulatehead}{tabulatiekop}
-\setinterfacevariable{tabulatetail}{tabulatiestaart}
-\setinterfacevariable{tall}{lang}
-\setinterfacevariable{teletype}{teletype}
-\setinterfacevariable{temporary}{voorlopig}
-\setinterfacevariable{test}{test}
-\setinterfacevariable{text}{tekst}
-\setinterfacevariable{textnote}{tekstnoot}
-\setinterfacevariable{three}{drie}
-\setinterfacevariable{thursday}{donderdag}
-\setinterfacevariable{tight}{krap}
-\setinterfacevariable{title}{titel}
-\setinterfacevariable{toggle}{toggle}
-\setinterfacevariable{tolerant}{soepel}
-\setinterfacevariable{top}{boven}
-\setinterfacevariable{tuesday}{dinsdag}
-\setinterfacevariable{two}{twee}
-\setinterfacevariable{txt}{txt}
-\setinterfacevariable{type}{type}
-\setinterfacevariable{typing}{typen}
-\setinterfacevariable{unavailable}{nietbeschikbaar}
-\setinterfacevariable{underbar}{onderstreep}
-\setinterfacevariable{underbars}{onderstrepen}
-\setinterfacevariable{understrike}{understrike}
-\setinterfacevariable{understrikes}{understrikes}
-\setinterfacevariable{unframed}{unframed}
-\setinterfacevariable{unicode}{unicode}
-\setinterfacevariable{unit}{eenheid}
-\setinterfacevariable{units}{eenheden}
-\setinterfacevariable{unknown}{onbekend}
-\setinterfacevariable{unpacked}{vanelkaar}
-\setinterfacevariable{up}{omhoog}
-\setinterfacevariable{url}{url}
-\setinterfacevariable{used}{gebruikt}
-\setinterfacevariable{value}{waarde}
-\setinterfacevariable{vertical}{vertikaal}
-\setinterfacevariable{very}{zeer}
-\setinterfacevariable{verystrict}{zeerstreng}
-\setinterfacevariable{verytolerant}{zeersoepel}
-\setinterfacevariable{vfenced}{vfenced}
-\setinterfacevariable{vulgarfraction}{vulgarfraction}
-\setinterfacevariable{weak}{zwak}
-\setinterfacevariable{wednesday}{woensdag}
-\setinterfacevariable{week}{week}
-\setinterfacevariable{weekday}{weekdag}
-\setinterfacevariable{white}{wit}
-\setinterfacevariable{wide}{breed}
-\setinterfacevariable{width}{breedte}
-\setinterfacevariable{word}{woord}
-\setinterfacevariable{words}{words}
-\setinterfacevariable{xml}{xml}
-\setinterfacevariable{year}{jaar}
-\setinterfacevariable{yes}{ja}
-% definitions for interface constants for language nl
-%
-\setinterfaceconstant{action}{actie}
-\setinterfaceconstant{address}{adres}
-\setinterfaceconstant{after}{na}
-\setinterfaceconstant{afterhead}{kopna}
-\setinterfaceconstant{afterkey}{natoets}
-\setinterfaceconstant{aftersection}{nasectie}
-\setinterfaceconstant{align}{uitlijnen}
-\setinterfaceconstant{alignbottom}{alignbottom}
-\setinterfaceconstant{aligncharacter}{karakteruitlijnen}
-\setinterfaceconstant{alignmentcharacter}{uitlijnkarakter}
-\setinterfaceconstant{alignmentleftsample}{alignmentleftsample}
-\setinterfaceconstant{alignmentleftwidth}{alignmentleftwidth}
-\setinterfaceconstant{alignmentrightsample}{alignmentrightsample}
-\setinterfaceconstant{alignmentrightwidth}{alignmentrightwidth}
-\setinterfaceconstant{alignsymbol}{alignsymbol}
-\setinterfaceconstant{aligntitle}{titeluitlijnen}
-\setinterfaceconstant{alternative}{variant}
-\setinterfaceconstant{anchor}{anker}
-\setinterfaceconstant{anchoring}{verankering}
-\setinterfaceconstant{andtext}{andtext}
-\setinterfaceconstant{apa}{apa}
-\setinterfaceconstant{arguments}{argumenten}
-\setinterfaceconstant{arrow}{pijl}
-\setinterfaceconstant{artauthor}{artauthor}
-\setinterfaceconstant{artauthoretaldisplay}{artauthoretaldisplay}
-\setinterfaceconstant{artauthoretallimit}{artauthoretallimit}
-\setinterfaceconstant{artauthoretaltext}{artauthoretaltext}
-\setinterfaceconstant{artoffset}{artoffset}
-\setinterfaceconstant{at}{op}
-\setinterfaceconstant{author}{auteur}
-\setinterfaceconstant{authorconversion}{authorconversion}
-\setinterfaceconstant{authoretaldisplay}{authoretaldisplay}
-\setinterfaceconstant{authoretallimit}{authoretallimit}
-\setinterfaceconstant{authoretaltext}{authoretaltext}
-\setinterfaceconstant{auto}{auto}
-\setinterfaceconstant{autocase}{autocase}
-\setinterfaceconstant{autofile}{autofile}
-\setinterfaceconstant{autofocus}{autofocus}
-\setinterfaceconstant{autohang}{autohang}
-\setinterfaceconstant{autostrut}{autostrut}
-\setinterfaceconstant{autowidth}{autobreedte}
-\setinterfaceconstant{availableheight}{beschikbarehoogte}
-\setinterfaceconstant{availablewidth}{beschikbarebreedte}
-\setinterfaceconstant{axis}{assenstelsel}
-\setinterfaceconstant{background}{achtergrond}
-\setinterfaceconstant{backgroundcolor}{achtergrondkleur}
-\setinterfaceconstant{backgroundcorner}{achtergrondhoek}
-\setinterfaceconstant{backgrounddepth}{achtergronddiepte}
-\setinterfaceconstant{backgroundoffset}{achtergrondoffset}
-\setinterfaceconstant{backgroundradius}{achtergrondstraal}
-\setinterfaceconstant{backgroundscreen}{achtergrondraster}
-\setinterfaceconstant{backreference}{terugreferentie}
-\setinterfaceconstant{backspace}{rugwit}
-\setinterfaceconstant{balance}{balanceren}
-\setinterfaceconstant{before}{voor}
-\setinterfaceconstant{beforehead}{kopvoor}
-\setinterfaceconstant{beforesection}{voorsectie}
-\setinterfaceconstant{bet}{bet}
-\setinterfaceconstant{bidi}{bidi}
-\setinterfaceconstant{big}{groot}
-\setinterfaceconstant{blank}{blanko}
-\setinterfaceconstant{bleedoffset}{bleedoffset}
-\setinterfaceconstant{blockway}{blokwijze}
-\setinterfaceconstant{bodyfont}{korps}
-\setinterfaceconstant{boffset}{boffset}
-\setinterfaceconstant{boldfeatures}{boldfeatures}
-\setinterfaceconstant{boldfont}{boldfont}
-\setinterfaceconstant{bolditalicfeatures}{bolditalicfeatures}
-\setinterfaceconstant{bolditalicfont}{bolditalicfont}
-\setinterfaceconstant{boldslantedfeatures}{boldslantedfeatures}
-\setinterfaceconstant{boldslantedfont}{boldslantedfont}
-\setinterfaceconstant{bookmark}{bookmark}
-\setinterfaceconstant{bottom}{onder}
-\setinterfaceconstant{bottomafter}{bottomafter}
-\setinterfaceconstant{bottombefore}{bottombefore}
-\setinterfaceconstant{bottomcommand}{ondercommando}
-\setinterfaceconstant{bottomdistance}{onderafstand}
-\setinterfaceconstant{bottomframe}{onderkader}
-\setinterfaceconstant{bottomoffset}{onderoffset}
-\setinterfaceconstant{bottomspace}{bodemwit}
-\setinterfaceconstant{bottomstate}{onderstatus}
-\setinterfaceconstant{break}{break}
-\setinterfaceconstant{buffer}{buffer}
-\setinterfaceconstant{cache}{cache}
-\setinterfaceconstant{calculate}{bereken}
-\setinterfaceconstant{category}{categorie}
-\setinterfaceconstant{ccommand}{ccommando}
-\setinterfaceconstant{character}{character}
-\setinterfaceconstant{characters}{characters}
-\setinterfaceconstant{check}{check}
-\setinterfaceconstant{click}{klik}
-\setinterfaceconstant{clickin}{klikin}
-\setinterfaceconstant{clickout}{klikuit}
-\setinterfaceconstant{clipoffset}{clipoffset}
-\setinterfaceconstant{closeaction}{sluitactie}
-\setinterfaceconstant{closecommand}{sluitcommando}
-\setinterfaceconstant{closepage}{sluitpagina}
-\setinterfaceconstant{closepageaction}{sluitpaginaactie}
-\setinterfaceconstant{closesymbol}{sluitsymbool}
-\setinterfaceconstant{color}{kleur}
-\setinterfaceconstant{column}{kolom}
-\setinterfaceconstant{columndistance}{kolomafstand}
-\setinterfaceconstant{columns}{kolommen}
-\setinterfaceconstant{comma}{comma}
-\setinterfaceconstant{command}{commando}
-\setinterfaceconstant{commandafter}{nacommando}
-\setinterfaceconstant{commandbefore}{voorcommando}
-\setinterfaceconstant{commands}{commandos}
-\setinterfaceconstant{comment}{comment}
-\setinterfaceconstant{commentchar}{commentchar}
-\setinterfaceconstant{commentoffset}{commentoffset}
-\setinterfaceconstant{compact}{compact}
-\setinterfaceconstant{component}{component}
-\setinterfaceconstant{compoundhyphen}{koppelteken}
-\setinterfaceconstant{compress}{comprimeren}
-\setinterfaceconstant{compressdistance}{compressdistance}
-\setinterfaceconstant{compressmethod}{compressmethod}
-\setinterfaceconstant{compressseparator}{compressseparator}
-\setinterfaceconstant{compressstopper}{compressstopper}
-\setinterfaceconstant{concerns}{betreft}
-\setinterfaceconstant{connector}{connector}
-\setinterfaceconstant{continue}{doorgaan}
-\setinterfaceconstant{contrastcolor}{contrastkleur}
-\setinterfaceconstant{controls}{sturing}
-\setinterfaceconstant{conversion}{conversie}
-\setinterfaceconstant{convertfile}{converteerfile}
-\setinterfaceconstant{copies}{kopieen}
-\setinterfaceconstant{corner}{hoek}
-\setinterfaceconstant{coupling}{koppeling}
-\setinterfaceconstant{couplingway}{koppelwijze}
-\setinterfaceconstant{criterium}{criterium}
-\setinterfaceconstant{cropoffset}{cropoffset}
-\setinterfaceconstant{crossreference}{crossreference}
-\setinterfaceconstant{cssfile}{cssfile}
-\setinterfaceconstant{current}{huidige}
-\setinterfaceconstant{cutspace}{snijwit}
-\setinterfaceconstant{dash}{streep}
-\setinterfaceconstant{dat}{dat}
-\setinterfaceconstant{database}{database}
-\setinterfaceconstant{dataset}{dataset}
-\setinterfaceconstant{date}{datum}
-\setinterfaceconstant{deepnumbercommand}{diepnummercommando}
-\setinterfaceconstant{deeptextcommand}{dieptekstcommando}
-\setinterfaceconstant{default}{default}
-\setinterfaceconstant{define}{definieer}
-\setinterfaceconstant{delay}{wachttijd}
-\setinterfaceconstant{depth}{diepte}
-\setinterfaceconstant{depthcorrection}{dieptecorrectie}
-\setinterfaceconstant{direction}{richting}
-\setinterfaceconstant{directory}{directory}
-\setinterfaceconstant{display}{scherm}
-\setinterfaceconstant{displaythreshold}{displaythreshold}
-\setinterfaceconstant{distance}{afstand}
-\setinterfaceconstant{domain}{domain}
-\setinterfaceconstant{dot}{punt}
-\setinterfaceconstant{doublesided}{dubbelzijdig}
-\setinterfaceconstant{down}{down}
-\setinterfaceconstant{dummy}{dummy}
-\setinterfaceconstant{dx}{dx}
-\setinterfaceconstant{dy}{dy}
-\setinterfaceconstant{edge}{rand}
-\setinterfaceconstant{edgedistance}{randafstand}
-\setinterfaceconstant{editor}{editor}
-\setinterfaceconstant{editoretaldisplay}{editoretaldisplay}
-\setinterfaceconstant{editoretallimit}{editoretallimit}
-\setinterfaceconstant{editoretaltext}{editoretaltext}
-\setinterfaceconstant{empty}{leeg}
-\setinterfaceconstant{entities}{entities}
-\setinterfaceconstant{entries}{ingangen}
-\setinterfaceconstant{equalheight}{equalheight}
-\setinterfaceconstant{equalwidth}{equalwidth}
-\setinterfaceconstant{escape}{escape}
-\setinterfaceconstant{etaldisplay}{etaldisplay}
-\setinterfaceconstant{etallimit}{etallimit}
-\setinterfaceconstant{etaloption}{etaloption}
-\setinterfaceconstant{etaltext}{etaltext}
-\setinterfaceconstant{evenmargin}{evenmarge}
-\setinterfaceconstant{exact}{exact}
-\setinterfaceconstant{exitoffset}{exitoffset}
-\setinterfaceconstant{expansion}{expansie}
-\setinterfaceconstant{export}{exporteer}
-\setinterfaceconstant{extras}{extras}
-\setinterfaceconstant{factor}{factor}
-\setinterfaceconstant{fallback}{terugval}
-\setinterfaceconstant{fallbacks}{fallbacks}
-\setinterfaceconstant{family}{soort}
-\setinterfaceconstant{features}{features}
-\setinterfaceconstant{featureset}{featureset}
-\setinterfaceconstant{fences}{fences}
-\setinterfaceconstant{field}{veld}
-\setinterfaceconstant{fieldbackgroundcolor}{veldachtergrondkleur}
-\setinterfaceconstant{fieldframecolor}{veldkaderkleur}
-\setinterfaceconstant{fieldlayer}{veldlaag}
-\setinterfaceconstant{fieldoffset}{veldoffset}
-\setinterfaceconstant{file}{file}
-\setinterfaceconstant{filler}{filler}
-\setinterfaceconstant{filter}{filter}
-\setinterfaceconstant{filtercommand}{filtercommand}
-\setinterfaceconstant{finalnamesep}{finalnamesep}
-\setinterfaceconstant{finalpagesep}{finalpagesep}
-\setinterfaceconstant{finalpubsep}{finalpubsep}
-\setinterfaceconstant{first}{eerste}
-\setinterfaceconstant{firstnamesep}{firstnamesep}
-\setinterfaceconstant{firstpage}{eerstepagina}
-\setinterfaceconstant{focus}{focus}
-\setinterfaceconstant{focusin}{focusin}
-\setinterfaceconstant{focusoffset}{focusoffset}
-\setinterfaceconstant{focusout}{focusuit}
-\setinterfaceconstant{font}{font}
-\setinterfaceconstant{footer}{voet}
-\setinterfaceconstant{footerdistance}{voetafstand}
-\setinterfaceconstant{footerstate}{voetstatus}
-\setinterfaceconstant{force}{forceer}
-\setinterfaceconstant{foregroundcolor}{voorgrondkleur}
-\setinterfaceconstant{foregroundstyle}{voorgrondletter}
-\setinterfaceconstant{format}{formatteer}
-\setinterfaceconstant{fractions}{breuken}
-\setinterfaceconstant{frame}{kader}
-\setinterfaceconstant{framecolor}{kaderkleur}
-\setinterfaceconstant{framecorner}{kaderhoek}
-\setinterfaceconstant{framedepth}{kaderdiepte}
-\setinterfaceconstant{frameoffset}{kaderoffset}
-\setinterfaceconstant{frameradius}{kaderstraal}
-\setinterfaceconstant{frames}{hokjes}
-\setinterfaceconstant{freeregion}{vrijgebied}
-\setinterfaceconstant{from}{van}
-\setinterfaceconstant{functioncolor}{functioncolor}
-\setinterfaceconstant{functionstyle}{functionstyle}
-\setinterfaceconstant{get}{haal}
-\setinterfaceconstant{global}{globaal}
-\setinterfaceconstant{goodies}{goodies}
-\setinterfaceconstant{grid}{grid}
-\setinterfaceconstant{group}{group}
-\setinterfaceconstant{groupsuffix}{groupsuffix}
-\setinterfaceconstant{hang}{hang}
-\setinterfaceconstant{hcompact}{hcomprimeer}
-\setinterfaceconstant{headalign}{kopuitlijnen}
-\setinterfaceconstant{headcolor}{kopkleur}
-\setinterfaceconstant{headcommand}{kopcommando}
-\setinterfaceconstant{headconversion}{kopconversie}
-\setinterfaceconstant{header}{hoofd}
-\setinterfaceconstant{headerdistance}{hoofdafstand}
-\setinterfaceconstant{headerstate}{hoofdstatus}
-\setinterfaceconstant{headlabel}{koplabel}
-\setinterfaceconstant{headnumber}{kopnummer}
-\setinterfaceconstant{headseparator}{kopscheider}
-\setinterfaceconstant{headstyle}{kopletter}
-\setinterfaceconstant{height}{hoogte}
-\setinterfaceconstant{hfactor}{hfactor}
-\setinterfaceconstant{hfil}{hfil}
-\setinterfaceconstant{hidenumber}{hidenumber}
-\setinterfaceconstant{hoffset}{hoffset}
-\setinterfaceconstant{horizontal}{horizontaal}
-\setinterfaceconstant{horoffset}{rugoffset}
-\setinterfaceconstant{hyphen}{hyphen}
-\setinterfaceconstant{hyphens}{hyphens}
-\setinterfaceconstant{icommand}{icommando}
-\setinterfaceconstant{ignore}{ignore}
-\setinterfaceconstant{in}{in}
-\setinterfaceconstant{inbetween}{tussen}
-\setinterfaceconstant{increment}{verhoog}
-\setinterfaceconstant{incrementnumber}{verhoognummer}
-\setinterfaceconstant{indenting}{inspringen}
-\setinterfaceconstant{indentlist}{indentlist}
-\setinterfaceconstant{indentnext}{springvolgendein}
-\setinterfaceconstant{index}{index}
-\setinterfaceconstant{indicator}{aanduiding}
-\setinterfaceconstant{initialsep}{initialsep}
-\setinterfaceconstant{inlinethreshold}{inlinethreshold}
-\setinterfaceconstant{inner}{binnen}
-\setinterfaceconstant{innermargin}{binnenmarge}
-\setinterfaceconstant{inputfile}{inputfile}
-\setinterfaceconstant{insidesection}{binnensectie}
-\setinterfaceconstant{instance}{instance}
-\setinterfaceconstant{intent}{intent}
-\setinterfaceconstant{interaction}{interactie}
-\setinterfaceconstant{interlinespace}{interlinie}
-\setinterfaceconstant{internalgrid}{interngrid}
-\setinterfaceconstant{italicfeatures}{italicfeatures}
-\setinterfaceconstant{italicfont}{italicfont}
-\setinterfaceconstant{itemalign}{itemuitlijnen}
-\setinterfaceconstant{items}{items}
-\setinterfaceconstant{joiners}{joiners}
-\setinterfaceconstant{journalconversion}{journalconversion}
-\setinterfaceconstant{juniorsep}{juniorsep}
-\setinterfaceconstant{keeptogether}{keeptogether}
-\setinterfaceconstant{ken}{ken}
-\setinterfaceconstant{keyexpansion}{sleutelexpansie}
-\setinterfaceconstant{keys}{sleutels}
-\setinterfaceconstant{keyword}{trefwoord}
-\setinterfaceconstant{label}{label}
-\setinterfaceconstant{labelalternative}{labelvariant}
-\setinterfaceconstant{labelcolor}{labelkleur}
-\setinterfaceconstant{labeloffset}{labeloffset}
-\setinterfaceconstant{labelstyle}{labelletter}
-\setinterfaceconstant{language}{language}
-\setinterfaceconstant{last}{last}
-\setinterfaceconstant{lastnamesep}{lastnamesep}
-\setinterfaceconstant{lastpage}{laatstepagina}
-\setinterfaceconstant{lastpagesep}{lastpagesep}
-\setinterfaceconstant{lastpubsep}{lastpubsep}
-\setinterfaceconstant{layout}{layout}
-\setinterfaceconstant{left}{links}
-\setinterfaceconstant{leftcolor}{linkerkleur}
-\setinterfaceconstant{leftcompoundhyphen}{linkerkoppelteken}
-\setinterfaceconstant{leftedge}{linkerrand}
-\setinterfaceconstant{leftedgedistance}{linkerrandafstand}
-\setinterfaceconstant{leftframe}{linkerkader}
-\setinterfaceconstant{lefthyphen}{lefthyphen}
-\setinterfaceconstant{leftmargin}{linkermarge}
-\setinterfaceconstant{leftmargindistance}{linkermargeafstand}
-\setinterfaceconstant{leftoffset}{linkeroffset}
-\setinterfaceconstant{leftquotation}{linkercitaat}
-\setinterfaceconstant{leftquote}{linkerciteer}
-\setinterfaceconstant{leftsample}{leftsample}
-\setinterfaceconstant{leftsentence}{linkerzin}
-\setinterfaceconstant{leftspeech}{linkeruitspraak}
-\setinterfaceconstant{leftstyle}{linkerletter}
-\setinterfaceconstant{leftsubsentence}{linkersubzin}
-\setinterfaceconstant{lefttext}{linkertekst}
-\setinterfaceconstant{leftwidth}{linkerbreedte}
-\setinterfaceconstant{leftwords}{leftwords}
-\setinterfaceconstant{less}{minder}
-\setinterfaceconstant{level}{niveau}
-\setinterfaceconstant{levels}{niveaus}
-\setinterfaceconstant{limittext}{limiettekst}
-\setinterfaceconstant{line}{regel}
-\setinterfaceconstant{linecorrection}{regelcorrectie}
-\setinterfaceconstant{linedirection}{regelrichting}
-\setinterfaceconstant{lines}{regels}
-\setinterfaceconstant{list}{lijst}
-\setinterfaceconstant{listtext}{lijsttekst}
-\setinterfaceconstant{local}{lokaal}
-\setinterfaceconstant{location}{plaats}
-\setinterfaceconstant{loffset}{loffset}
-\setinterfaceconstant{logo}{logo}
-\setinterfaceconstant{logos}{logos}
-\setinterfaceconstant{marcolor}{markleur}
-\setinterfaceconstant{margin}{marge}
-\setinterfaceconstant{margindistance}{margeafstand}
-\setinterfaceconstant{marginedge}{kantlijn}
-\setinterfaceconstant{marginedgetext}{kantlijntekst}
-\setinterfaceconstant{margintext}{margetekst}
-\setinterfaceconstant{mark}{kernmerk}
-\setinterfaceconstant{marking}{markering}
-\setinterfaceconstant{marstyle}{marletter}
-\setinterfaceconstant{mask}{masker}
-\setinterfaceconstant{mathclass}{mathclass}
-\setinterfaceconstant{mathlimits}{mathlimits}
-\setinterfaceconstant{mathstyle}{mathstyle}
-\setinterfaceconstant{max}{max}
-\setinterfaceconstant{maxdepth}{maxdepth}
-\setinterfaceconstant{maxheight}{maxhoogte}
-\setinterfaceconstant{maxwidth}{maxbreedte}
-\setinterfaceconstant{maybeyear}{maybeyear}
-\setinterfaceconstant{menu}{menu}
-\setinterfaceconstant{method}{methode}
-\setinterfaceconstant{middle}{midden}
-\setinterfaceconstant{middlecolor}{middenkleur}
-\setinterfaceconstant{middlecommand}{middencommando}
-\setinterfaceconstant{middlespeech}{middenuitspraak}
-\setinterfaceconstant{middlestyle}{middenletter}
-\setinterfaceconstant{middletext}{middentekst}
-\setinterfaceconstant{middlewidth}{middenbreedte}
-\setinterfaceconstant{midsentence}{middenzin}
-\setinterfaceconstant{min}{min}
-\setinterfaceconstant{mindepth}{mindiepte}
-\setinterfaceconstant{minheight}{minhoogte}
-\setinterfaceconstant{minwidth}{minbreedte}
-\setinterfaceconstant{moffset}{moffset}
-\setinterfaceconstant{monthconversion}{maandconversie}
-\setinterfaceconstant{more}{meer}
-\setinterfaceconstant{mpdepth}{mpdiepte}
-\setinterfaceconstant{mpheight}{mphoogte}
-\setinterfaceconstant{mpoffset}{mpoffset}
-\setinterfaceconstant{mpwidth}{mpbreedte}
-\setinterfaceconstant{n}{n}
-\setinterfaceconstant{name}{naam}
-\setinterfaceconstant{namesep}{namesep}
-\setinterfaceconstant{nbottom}{nonder}
-\setinterfaceconstant{nc}{nc}
-\setinterfaceconstant{next}{volgende}
-\setinterfaceconstant{nextleft}{nextleft}
-\setinterfaceconstant{nextleftquotation}{nextleftquotation}
-\setinterfaceconstant{nextright}{nextright}
-\setinterfaceconstant{nextrightquotation}{nextrightquotation}
-\setinterfaceconstant{nl}{nl}
-\setinterfaceconstant{nleft}{nlinks}
-\setinterfaceconstant{nlines}{nregels}
-\setinterfaceconstant{norm}{norm}
-\setinterfaceconstant{note}{noot}
-\setinterfaceconstant{notes}{noten}
-\setinterfaceconstant{nr}{nr}
-\setinterfaceconstant{nright}{nrechts}
-\setinterfaceconstant{ntop}{nboven}
-\setinterfaceconstant{number}{nummer}
-\setinterfaceconstant{numberalign}{nummeruitlijnen}
-\setinterfaceconstant{numbercolor}{nummerkleur}
-\setinterfaceconstant{numbercommand}{nummercommando}
-\setinterfaceconstant{numberconversion}{numberconversion}
-\setinterfaceconstant{numberconversionset}{numberconversionset}
-\setinterfaceconstant{numberdistance}{nummerafstand}
-\setinterfaceconstant{numbering}{nummeren}
-\setinterfaceconstant{numberorder}{numberorder}
-\setinterfaceconstant{numberprefix}{numberprefix}
-\setinterfaceconstant{numbersegments}{numbersegments}
-\setinterfaceconstant{numberseparator}{nummerscheider}
-\setinterfaceconstant{numberseparatorset}{numberseparatorset}
-\setinterfaceconstant{numberset}{numberset}
-\setinterfaceconstant{numberstarter}{numberstarter}
-\setinterfaceconstant{numberstopper}{numberstopper}
-\setinterfaceconstant{numberstrut}{nummerstrut}
-\setinterfaceconstant{numberstyle}{nummerletter}
-\setinterfaceconstant{numberwidth}{nummerbreedte}
-\setinterfaceconstant{nx}{nx}
-\setinterfaceconstant{ny}{ny}
-\setinterfaceconstant{object}{object}
-\setinterfaceconstant{obstruction}{blokkade}
-\setinterfaceconstant{oddmargin}{onevenmarge}
-\setinterfaceconstant{offset}{offset}
-\setinterfaceconstant{openaction}{openactie}
-\setinterfaceconstant{openpage}{openpagina}
-\setinterfaceconstant{openpageaction}{openpaginaactie}
-\setinterfaceconstant{openup}{openup}
-\setinterfaceconstant{opticalsize}{opticalsize}
-\setinterfaceconstant{option}{optie}
-\setinterfaceconstant{order}{volgorde}
-\setinterfaceconstant{orientation}{orientatie}
-\setinterfaceconstant{otherstext}{otherstext}
-\setinterfaceconstant{outermargin}{buitenmarge}
-\setinterfaceconstant{overprint}{overprint}
-\setinterfaceconstant{ownerpassword}{ownerpassword}
-\setinterfaceconstant{ownnumber}{eigennummer}
-\setinterfaceconstant{packcriterium}{opelkaarcriterium}
-\setinterfaceconstant{page}{pagina}
-\setinterfaceconstant{pageboundaries}{paginaovergangen}
-\setinterfaceconstant{pagecolor}{paginakleur}
-\setinterfaceconstant{pagecolormodel}{paginakleurmodel}
-\setinterfaceconstant{pagecommand}{paginacommando}
-\setinterfaceconstant{pageconnector}{pageconnector}
-\setinterfaceconstant{pageconversion}{pageconversion}
-\setinterfaceconstant{pageconversionset}{pageconversionset}
-\setinterfaceconstant{pageleft}{pageleft}
-\setinterfaceconstant{pagemethod}{paginamethode}
-\setinterfaceconstant{pagenumber}{paginanummer}
-\setinterfaceconstant{pageprefix}{pageprefix}
-\setinterfaceconstant{pageprefixconnector}{pageprefixconnector}
-\setinterfaceconstant{pageprefixconversion}{pageprefixconversion}
-\setinterfaceconstant{pageprefixconversionset}{pageprefixconversionset}
-\setinterfaceconstant{pageprefixsegments}{pageprefixsegments}
-\setinterfaceconstant{pageprefixseparatorset}{pageprefixseparatorset}
-\setinterfaceconstant{pageprefixset}{pageprefixset}
-\setinterfaceconstant{pageprefixstarter}{pageprefixstarter}
-\setinterfaceconstant{pageprefixstopper}{pageprefixstopper}
-\setinterfaceconstant{pageright}{pageright}
-\setinterfaceconstant{pagesegments}{pagesegments}
-\setinterfaceconstant{pagesep}{pagesep}
-\setinterfaceconstant{pageseparatorset}{pageseparatorset}
-\setinterfaceconstant{pageset}{pageset}
-\setinterfaceconstant{pagestarter}{pagestarter}
-\setinterfaceconstant{pagestate}{paginastatus}
-\setinterfaceconstant{pagestopper}{pagestopper}
-\setinterfaceconstant{pagestyle}{paginaletter}
-\setinterfaceconstant{palet}{palet}
-\setinterfaceconstant{paper}{papier}
-\setinterfaceconstant{paragraph}{alinea}
-\setinterfaceconstant{period}{period}
-\setinterfaceconstant{place}{plaatsen}
-\setinterfaceconstant{placehead}{plaatskop}
-\setinterfaceconstant{placeholder}{placeholder}
-\setinterfaceconstant{placestopper}{plaatsafsluiter}
-\setinterfaceconstant{position}{positie}
-\setinterfaceconstant{prefix}{prefix}
-\setinterfaceconstant{prefixconnector}{prefixconnector}
-\setinterfaceconstant{prefixconversion}{prefixconversion}
-\setinterfaceconstant{prefixconversionset}{prefixconversionset}
-\setinterfaceconstant{prefixsegments}{prefixsegments}
-\setinterfaceconstant{prefixseparatorset}{prefixseparatorset}
-\setinterfaceconstant{prefixset}{prefixset}
-\setinterfaceconstant{prefixstarter}{prefixstarter}
-\setinterfaceconstant{prefixstopper}{prefixstopper}
-\setinterfaceconstant{preset}{preset}
-\setinterfaceconstant{preview}{preview}
-\setinterfaceconstant{previous}{vorige}
-\setinterfaceconstant{previousnumber}{vorigenummer}
-\setinterfaceconstant{print}{print}
-\setinterfaceconstant{printable}{printbaar}
-\setinterfaceconstant{process}{proces}
-\setinterfaceconstant{profile}{profile}
-\setinterfaceconstant{properties}{properties}
-\setinterfaceconstant{pubsep}{pubsep}
-\setinterfaceconstant{quotechar}{quotechar}
-\setinterfaceconstant{radius}{straal}
-\setinterfaceconstant{random}{willekeur}
-\setinterfaceconstant{range}{bereik}
-\setinterfaceconstant{reduction}{reductie}
-\setinterfaceconstant{ref}{ref}
-\setinterfaceconstant{refcommand}{refcommand}
-\setinterfaceconstant{reference}{referentie}
-\setinterfaceconstant{referencemethod}{referencemethod}
-\setinterfaceconstant{referenceprefix}{referenceprefix}
-\setinterfaceconstant{referencetext}{referencetext}
-\setinterfaceconstant{referencing}{refereren}
-\setinterfaceconstant{region}{gebied}
-\setinterfaceconstant{regionin}{gebiedin}
-\setinterfaceconstant{regionout}{gebieduit}
-\setinterfaceconstant{register}{register}
-\setinterfaceconstant{regularfeatures}{regularfeatures}
-\setinterfaceconstant{regularfont}{regularfont}
-\setinterfaceconstant{renderingsetup}{renderingsetup}
-\setinterfaceconstant{repeat}{herhaal}
-\setinterfaceconstant{reset}{reset}
-\setinterfaceconstant{resetnumber}{resetnummer}
-\setinterfaceconstant{resolution}{resolutie}
-\setinterfaceconstant{resources}{resources}
-\setinterfaceconstant{reverse}{omgekeerd}
-\setinterfaceconstant{right}{rechts}
-\setinterfaceconstant{rightchars}{rightchars}
-\setinterfaceconstant{rightcolor}{rechterkleur}
-\setinterfaceconstant{rightcompoundhyphen}{rechterkoppelteken}
-\setinterfaceconstant{rightedge}{rechterrand}
-\setinterfaceconstant{rightedgedistance}{rechterrandafstand}
-\setinterfaceconstant{rightframe}{rechterkader}
-\setinterfaceconstant{righthyphen}{righthyphen}
-\setinterfaceconstant{rightmargin}{rechtermarge}
-\setinterfaceconstant{rightmargindistance}{rechtermargeafstand}
-\setinterfaceconstant{rightoffset}{rechteroffset}
-\setinterfaceconstant{rightquotation}{rechtercitaat}
-\setinterfaceconstant{rightquote}{rechterciteer}
-\setinterfaceconstant{rightsample}{rightsample}
-\setinterfaceconstant{rightsentence}{rechterzin}
-\setinterfaceconstant{rightspeech}{rechteruitspraak}
-\setinterfaceconstant{rightstyle}{rechterletter}
-\setinterfaceconstant{rightsubsentence}{rechtersubzin}
-\setinterfaceconstant{righttext}{rechtertekst}
-\setinterfaceconstant{rightwidth}{rechterbreedte}
-\setinterfaceconstant{rightwords}{rightwords}
-\setinterfaceconstant{roffset}{roffset}
-\setinterfaceconstant{rotation}{rotatie}
-\setinterfaceconstant{rule}{lijn}
-\setinterfaceconstant{rulecolor}{lijnkleur}
-\setinterfaceconstant{rulecommand}{lijncommando}
-\setinterfaceconstant{rulethickness}{lijndikte}
-\setinterfaceconstant{samepage}{zelfdepagina}
-\setinterfaceconstant{sample}{monster}
-\setinterfaceconstant{samplesize}{samplesize}
-\setinterfaceconstant{saveinlist}{saveinlist}
-\setinterfaceconstant{scale}{schaal}
-\setinterfaceconstant{scope}{scope}
-\setinterfaceconstant{screen}{raster}
-\setinterfaceconstant{section}{sectie}
-\setinterfaceconstant{sectionblock}{sectionblock}
-\setinterfaceconstant{sectionconversion}{sectionconversion}
-\setinterfaceconstant{sectionconversionset}{sectionconversionset}
-\setinterfaceconstant{sectionnumber}{sectienummer}
-\setinterfaceconstant{sectionresetset}{sectionresetset}
-\setinterfaceconstant{sectionsegments}{sectionsegments}
-\setinterfaceconstant{sectionseparatorset}{sectionseparatorset}
-\setinterfaceconstant{sectionset}{sectionset}
-\setinterfaceconstant{sectionstarter}{sectionstarter}
-\setinterfaceconstant{sectionstopper}{sectionstopper}
-\setinterfaceconstant{separator}{scheider}
-\setinterfaceconstant{separatorcolor}{scheiderkleur}
-\setinterfaceconstant{separatorstyle}{scheiderletter}
-\setinterfaceconstant{set}{set}
-\setinterfaceconstant{setups}{setups}
-\setinterfaceconstant{shrink}{krimp}
-\setinterfaceconstant{side}{zij}
-\setinterfaceconstant{sidealign}{zijuitlijnen}
-\setinterfaceconstant{sidemethod}{zijmethode}
-\setinterfaceconstant{sidespaceafter}{zijnawit}
-\setinterfaceconstant{sidespacebefore}{zijvoorwit}
-\setinterfaceconstant{sidespaceinbetween}{zijtussenwit}
-\setinterfaceconstant{sidethreshold}{sidethreshold}
-\setinterfaceconstant{sign}{teken}
-\setinterfaceconstant{simplecommand}{simpelcommando}
-\setinterfaceconstant{size}{formaat}
-\setinterfaceconstant{slantedfeatures}{slantedfeatures}
-\setinterfaceconstant{slantedfont}{slantedfont}
-\setinterfaceconstant{small}{klein}
-\setinterfaceconstant{smallcapsfeatures}{smallcapsfeatures}
-\setinterfaceconstant{smallcapsfont}{smallcapsfont}
-\setinterfaceconstant{solution}{oplossing}
-\setinterfaceconstant{sort}{sort}
-\setinterfaceconstant{sorttype}{sortering}
-\setinterfaceconstant{source}{bron}
-\setinterfaceconstant{space}{spatie}
-\setinterfaceconstant{spaceafter}{nawit}
-\setinterfaceconstant{spaceafterside}{witnazij}
-\setinterfaceconstant{spacebefore}{voorwit}
-\setinterfaceconstant{spacebeforeside}{witvoorzij}
-\setinterfaceconstant{spaceinbetween}{tussenwit}
-\setinterfaceconstant{spacing}{spatiering}
-\setinterfaceconstant{specification}{specification}
-\setinterfaceconstant{split}{splitsen}
-\setinterfaceconstant{splitcolor}{splitskleur}
-\setinterfaceconstant{splitmethod}{splitsmethode}
-\setinterfaceconstant{splitoffset}{splitsoffset}
-\setinterfaceconstant{spot}{spot}
-\setinterfaceconstant{stack}{stapel}
-\setinterfaceconstant{stackname}{stapelnaam}
-\setinterfaceconstant{start}{start}
-\setinterfaceconstant{starter}{opener}
-\setinterfaceconstant{state}{status}
-\setinterfaceconstant{step}{stap}
-\setinterfaceconstant{stop}{stop}
-\setinterfaceconstant{stopper}{afsluiter}
-\setinterfaceconstant{stretch}{rek}
-\setinterfaceconstant{strip}{strip}
-\setinterfaceconstant{strut}{strut}
-\setinterfaceconstant{style}{letter}
-\setinterfaceconstant{stylealternative}{stylevariant}
-\setinterfaceconstant{sub}{sub}
-\setinterfaceconstant{subtitle}{subtitel}
-\setinterfaceconstant{suffix}{suffix}
-\setinterfaceconstant{suffixseparator}{suffixscheider}
-\setinterfaceconstant{suffixstopper}{suffixafsluiter}
-\setinterfaceconstant{surnamefirstnamesep}{surnamefirstnamesep}
-\setinterfaceconstant{surnameinitialsep}{surnameinitialsep}
-\setinterfaceconstant{surnamesep}{surnamesep}
-\setinterfaceconstant{svgstyle}{svgstyle}
-\setinterfaceconstant{sx}{sx}
-\setinterfaceconstant{sy}{sy}
-\setinterfaceconstant{symalign}{symuitlijnen}
-\setinterfaceconstant{symbol}{symbool}
-\setinterfaceconstant{symbolcommand}{symbolcommand}
-\setinterfaceconstant{symbolset}{symboolset}
-\setinterfaceconstant{symcolor}{symkleur}
-\setinterfaceconstant{symstyle}{symletter}
-\setinterfaceconstant{synonym}{synoniem}
-\setinterfaceconstant{synonymcolor}{synoniemkleur}
-\setinterfaceconstant{synonymcommand}{synoniemcommando}
-\setinterfaceconstant{synonymstyle}{synoniemletter}
-\setinterfaceconstant{tab}{tab}
-\setinterfaceconstant{text}{tekst}
-\setinterfaceconstant{textalign}{textalign}
-\setinterfaceconstant{textcolor}{tekstkleur}
-\setinterfaceconstant{textcommand}{tekstcommando}
-\setinterfaceconstant{textdistance}{tekstafstand}
-\setinterfaceconstant{textheight}{teksthoogte}
-\setinterfaceconstant{textlayer}{tekstlaag}
-\setinterfaceconstant{textmargin}{tekstmarge}
-\setinterfaceconstant{textmethod}{tekstmethode}
-\setinterfaceconstant{textseparator}{tekstscheider}
-\setinterfaceconstant{textsize}{tekstformaat}
-\setinterfaceconstant{textstate}{tekststatus}
-\setinterfaceconstant{textstyle}{tekstletter}
-\setinterfaceconstant{textwidth}{tekstbreedte}
-\setinterfaceconstant{threshold}{threshold}
-\setinterfaceconstant{time}{tijd}
-\setinterfaceconstant{title}{titel}
-\setinterfaceconstant{titlecolor}{titelkleur}
-\setinterfaceconstant{titlecommand}{titelcommando}
-\setinterfaceconstant{titledistance}{titelafstand}
-\setinterfaceconstant{titleleft}{titellinks}
-\setinterfaceconstant{titleright}{titelrechts}
-\setinterfaceconstant{titlestrut}{titelstrut}
-\setinterfaceconstant{titlestyle}{titelletter}
-\setinterfaceconstant{to}{aan}
-\setinterfaceconstant{toffset}{toffset}
-\setinterfaceconstant{tolerance}{tolerantie}
-\setinterfaceconstant{top}{boven}
-\setinterfaceconstant{topcommand}{bovencommando}
-\setinterfaceconstant{topdistance}{bovenafstand}
-\setinterfaceconstant{topframe}{bovenkader}
-\setinterfaceconstant{topoffset}{bovenoffset}
-\setinterfaceconstant{topspace}{kopwit}
-\setinterfaceconstant{topstate}{bovenstatus}
-\setinterfaceconstant{totalnumber}{totalnumber}
-\setinterfaceconstant{transform}{transformatie}
-\setinterfaceconstant{translate}{translate}
-\setinterfaceconstant{trimoffset}{trimoffset}
-\setinterfaceconstant{type}{type}
-\setinterfaceconstant{unit}{eenheid}
-\setinterfaceconstant{unknownreference}{onbekendereferentie}
-\setinterfaceconstant{up}{up}
-\setinterfaceconstant{urlalternative}{urlvariant}
-\setinterfaceconstant{urlspace}{urlspatie}
-\setinterfaceconstant{userpassword}{userpassword}
-\setinterfaceconstant{validate}{valideer}
-\setinterfaceconstant{values}{waarden}
-\setinterfaceconstant{vcommand}{vcommando}
-\setinterfaceconstant{vcompact}{vcomprimeer}
-\setinterfaceconstant{vector}{vector}
-\setinterfaceconstant{veroffset}{kopoffset}
-\setinterfaceconstant{vertical}{vertikaal}
-\setinterfaceconstant{vfactor}{vfactor}
-\setinterfaceconstant{vfil}{vfil}
-\setinterfaceconstant{viewerprefix}{viewerprefix}
-\setinterfaceconstant{voffset}{voffset}
-\setinterfaceconstant{vonsep}{vonsep}
-\setinterfaceconstant{way}{wijze}
-\setinterfaceconstant{wfactor}{bfactor}
-\setinterfaceconstant{white}{wit}
-\setinterfaceconstant{width}{breedte}
-\setinterfaceconstant{words}{words}
-\setinterfaceconstant{xanchor}{xanker}
-\setinterfaceconstant{xfactor}{xfactor}
-\setinterfaceconstant{xhtml}{xhtml}
-\setinterfaceconstant{xmax}{xmax}
-\setinterfaceconstant{xmlsetup}{xmlsetup}
-\setinterfaceconstant{xoffset}{xoffset}
-\setinterfaceconstant{xscale}{xschaal}
-\setinterfaceconstant{xstep}{xstap}
-\setinterfaceconstant{yanchor}{yanker}
-\setinterfaceconstant{yfactor}{yfactor}
-\setinterfaceconstant{ymax}{ymax}
-\setinterfaceconstant{yoffset}{yoffset}
-\setinterfaceconstant{yscale}{yschaal}
-\setinterfaceconstant{ystep}{ystap}
-% definitions for interface elements for language nl
-%
-\setinterfaceelement{answerlines}{antwoordregels}
-\setinterfaceelement{answerspace}{antwoordruimte}
-\setinterfaceelement{begin}{beginvan}
-\setinterfaceelement{complete}{volledige}
-\setinterfaceelement{coupled}{gekoppelde}
-\setinterfaceelement{currentlocal}{huidigelokale}
-\setinterfaceelement{end}{eindvan}
-\setinterfaceelement{endsetup}{in}
-\setinterfaceelement{get}{haal}
-\setinterfaceelement{increment}{verhoog}
-\setinterfaceelement{list}{lijst}
-\setinterfaceelement{listof}{lijstmet}
-\setinterfaceelement{load}{laad}
-\setinterfaceelement{local}{lokale}
-\setinterfaceelement{makeup}{opmaak}
-\setinterfaceelement{next}{volgende}
-\setinterfaceelement{place}{plaats}
-\setinterfaceelement{previous}{vorige}
-\setinterfaceelement{previouslocal}{vorigelokale}
-\setinterfaceelement{reserve}{reserveer}
-\setinterfaceelement{see}{zie}
-\setinterfaceelement{setup}{stel}
-\setinterfaceelement{start}{start}
-\setinterfaceelement{stop}{stop}
-\setinterfaceelement{text}{tekst}
-\setinterfaceelement{type}{type}
-% definitions for interface commands for language nl
-%
-\setinterfacecommand{Character}{Letter}
-\setinterfacecommand{Characters}{Letters}
-\setinterfacecommand{MONTH}{MAAND}
-\setinterfacecommand{Numbers}{Cijfers}
-\setinterfacecommand{Romannumerals}{Romeins}
-\setinterfacecommand{SmallCapped}{Kap}
-\setinterfacecommand{SmallCaps}{Kaps}
-\setinterfacecommand{WEEKDAY}{WEEKDAG}
-\setinterfacecommand{WORD}{WOORD}
-\setinterfacecommand{WORDS}{WOORDEN}
-\setinterfacecommand{Word}{Woord}
-\setinterfacecommand{Words}{Woorden}
-\setinterfacecommand{about}{about}
-\setinterfacecommand{adaptfontfeature}{adaptfontfeature}
-\setinterfacecommand{adaptlayout}{paslayoutaan}
-\setinterfacecommand{addfeature}{addfeature}
-\setinterfacecommand{alignbottom}{alignbottom}
-\setinterfacecommand{aligned}{aligned}
-\setinterfacecommand{alignedbox}{alignedbox}
-\setinterfacecommand{alignedline}{alignedline}
-\setinterfacecommand{alignhere}{alignhere}
-\setinterfacecommand{alignment}{uitlijnen}
-\setinterfacecommand{alignmentcharacter}{alignmentcharacter}
-\setinterfacecommand{applytocharacters}{applytocharacters}
-\setinterfacecommand{applytofirstcharacter}{applytofirstcharacter}
-\setinterfacecommand{arg}{arg}
-\setinterfacecommand{at}{op}
-\setinterfacecommand{atleftmargin}{oplinkermarge}
-\setinterfacecommand{atpage}{oppagina}
-\setinterfacecommand{atrightmargin}{oprechtermarge}
-\setinterfacecommand{background}{achtergrond}
-\setinterfacecommand{backspace}{rugwit}
-\setinterfacecommand{blackrule}{blokje}
-\setinterfacecommand{blackrules}{blokjes}
-\setinterfacecommand{blank}{blanko}
-\setinterfacecommand{bookmark}{bookmark}
-\setinterfacecommand{bottombox}{bottombox}
-\setinterfacecommand{bottomdistance}{onderafstand}
-\setinterfacecommand{bottomheight}{onderhoogte}
-\setinterfacecommand{bottomleftbox}{bottomleftbox}
-\setinterfacecommand{bottomrightbox}{bottomrightbox}
-\setinterfacecommand{bottomspace}{bodemwit}
-\setinterfacecommand{buildtextbottomdot}{buildtextbottomdot}
-\setinterfacecommand{but}{but}
-\setinterfacecommand{button}{button}
-\setinterfacecommand{bypassblocks}{passeerblokken}
-\setinterfacecommand{character}{letter}
-\setinterfacecommand{characters}{letters}
-\setinterfacecommand{chem}{chem}
-\setinterfacecommand{clip}{clip}
-\setinterfacecommand{clonefield}{kloonveld}
-\setinterfacecommand{color}{kleur}
-\setinterfacecommand{colorbar}{kleurenbalk}
-\setinterfacecommand{colorvalue}{kleurwaarde}
-\setinterfacecommand{column}{kolom}
-\setinterfacecommand{comparecolorgroup}{vergelijkkleurgroep}
-\setinterfacecommand{comparepalet}{vergelijkpalet}
-\setinterfacecommand{completepagenumber}{volledigepaginanummer}
-\setinterfacecommand{completeregister}{volledigregister}
-\setinterfacecommand{component}{onderdeel}
-\setinterfacecommand{convertnumber}{converteernummer}
-\setinterfacecommand{copyfield}{copieerveld}
-\setinterfacecommand{correctwhitespace}{corrigeerwitruimte}
-\setinterfacecommand{coupledocument}{koppeldocument}
-\setinterfacecommand{couplemarking}{koppelmarkering}
-\setinterfacecommand{couplepage}{koppelpagina}
-\setinterfacecommand{couplepaper}{koppelpapier}
-\setinterfacecommand{coupleregister}{koppelregister}
-\setinterfacecommand{crlf}{crlf}
-\setinterfacecommand{currentdate}{huidigedatum}
-\setinterfacecommand{currentheadnumber}{huidigekopnummer}
-\setinterfacecommand{cutspace}{snijwit}
-\setinterfacecommand{date}{datum}
-\setinterfacecommand{decouplemarking}{ontkoppelmarkering}
-\setinterfacecommand{decrementnumber}{verlaagnummer}
-\setinterfacecommand{define}{definieer}
-\setinterfacecommand{defineaccent}{definieeraccent}
-\setinterfacecommand{defineblank}{definieerblanko}
-\setinterfacecommand{defineblock}{definieerblok}
-\setinterfacecommand{definebodyfont}{definieerkorps}
-\setinterfacecommand{definebodyfontenvironment}{definieerkorpsomgeving}
-\setinterfacecommand{definebodyfontswitch}{definebodyfontswitch}
-\setinterfacecommand{definebuffer}{definieerbuffer}
-\setinterfacecommand{definecharacter}{definieerkarakter}
-\setinterfacecommand{definecharacterkerning}{definecharacterkerning}
-\setinterfacecommand{definecharacterspacing}{definecharacterspacing}
-\setinterfacecommand{definecolor}{definieerkleur}
-\setinterfacecommand{definecolorgroup}{definieerkleurgroep}
-\setinterfacecommand{definecolumnbreak}{definieerkolomovergang}
-\setinterfacecommand{definecolumnset}{definieerkolomgroep}
-\setinterfacecommand{definecombination}{definieercombinatie}
-\setinterfacecommand{definecombinedlist}{definieersamengesteldelijst}
-\setinterfacecommand{definecommand}{definieercommando}
-\setinterfacecommand{defineconversion}{definieerconversie}
-\setinterfacecommand{definedescription}{doordefinieren}
-\setinterfacecommand{definedfont}{definedfont}
-\setinterfacecommand{defineenumeration}{doornummeren}
-\setinterfacecommand{definefallbackfamily}{definefallbackfamily}
-\setinterfacecommand{definefield}{definieerveld}
-\setinterfacecommand{definefieldstack}{definieerveldstapel}
-\setinterfacecommand{definefiguresymbol}{definieerfiguursymbool}
-\setinterfacecommand{definefilefallback}{definefilefallback}
-\setinterfacecommand{definefirstline}{definefirstline}
-\setinterfacecommand{definefloat}{definieerplaatsblok}
-\setinterfacecommand{definefont}{definieerfont}
-\setinterfacecommand{definefontalternative}{definefontalternative}
-\setinterfacecommand{definefontfallback}{definefontfallback}
-\setinterfacecommand{definefontfamily}{definefontfamily}
-\setinterfacecommand{definefontfamilypreset}{definefontfamilypreset}
-\setinterfacecommand{definefontfeature}{definefontfeature}
-\setinterfacecommand{definefontfile}{definefontfile}
-\setinterfacecommand{definefontsize}{definefontsize}
-\setinterfacecommand{definefontsolution}{definefontsolution}
-\setinterfacecommand{definefontstyle}{definieerfontstijl}
-\setinterfacecommand{definefontsynonym}{definieerfontsynoniem}
-\setinterfacecommand{defineframed}{definieeromlijnd}
-\setinterfacecommand{defineframedtext}{definieerkadertekst}
-\setinterfacecommand{definefrozenfont}{definefrozenfont}
-\setinterfacecommand{definehbox}{definieerhbox}
-\setinterfacecommand{definehead}{definieerkop}
-\setinterfacecommand{definehyphenationfeatures}{definehyphenationfeatures}
-\setinterfacecommand{defineindentedtext}{definieeringesprongentext}
-\setinterfacecommand{defineinmargin}{definieerinmarge}
-\setinterfacecommand{defineinteractionmenu}{definieerinteractiemenu}
-\setinterfacecommand{defineitemgroup}{definieeritemgroep}
-\setinterfacecommand{defineitems}{defineitems}
-\setinterfacecommand{definelabel}{doorlabelen}
-\setinterfacecommand{definelayer}{definieerlayer}
-\setinterfacecommand{definelayout}{definieerlayout}
-\setinterfacecommand{definelinenote}{definelinenote}
-\setinterfacecommand{definelist}{definieerlijst}
-\setinterfacecommand{definelogo}{definieerbeeldmerk}
-\setinterfacecommand{definemainfield}{definieerhoofdveld}
-\setinterfacecommand{definemakeup}{definieeropmaak}
-\setinterfacecommand{definemarking}{definieermarkering}
-\setinterfacecommand{definemathalignment}{definieerwiskundeuitlijnen}
-\setinterfacecommand{definemode}{definemode}
-\setinterfacecommand{definenamedcolor}{definenamedcolor}
-\setinterfacecommand{definenote}{definenote}
-\setinterfacecommand{defineoutput}{definieeruitvoer}
-\setinterfacecommand{defineoverlay}{definieeroverlay}
-\setinterfacecommand{definepagebreak}{definieerpaginaovergang}
-\setinterfacecommand{definepalet}{definieerpalet}
-\setinterfacecommand{definepapersize}{definieerpapierformaat}
-\setinterfacecommand{defineparagraphs}{definieeralineas}
-\setinterfacecommand{defineperiodkerning}{defineperiodkerning}
-\setinterfacecommand{defineplacement}{definieerplaats}
-\setinterfacecommand{defineprofile}{definieerprofiel}
-\setinterfacecommand{defineprogram}{definieerprogramma}
-\setinterfacecommand{definerawfont}{definerawfont}
-\setinterfacecommand{definereference}{definieerreferentie}
-\setinterfacecommand{definereferenceformat}{definieerreferentieformaat}
-\setinterfacecommand{definereferencelist}{definieerreferentielijst}
-\setinterfacecommand{defineregister}{definieerregister}
-\setinterfacecommand{definerule}{definieerlijn}
-\setinterfacecommand{definesection}{definieersectie}
-\setinterfacecommand{definesectionblock}{definieersectieblok}
-\setinterfacecommand{definesorting}{definieersorteren}
-\setinterfacecommand{definestartstop}{definieerstartstop}
-\setinterfacecommand{definestyle}{definieerletter}
-\setinterfacecommand{definesubfield}{definieersubveld}
-\setinterfacecommand{definesymbol}{definieersymbool}
-\setinterfacecommand{definesynonyms}{definieersynoniemen}
-\setinterfacecommand{definetabletemplate}{definieertabelvorm}
-\setinterfacecommand{definetabulate}{definieertabulatie}
-\setinterfacecommand{definetext}{definieertekst}
-\setinterfacecommand{definetextbackground}{definieertekstachtergrond}
-\setinterfacecommand{definetextnote}{definetextnote}
-\setinterfacecommand{definetextposition}{definieertekstpositie}
-\setinterfacecommand{definetextvariable}{definieertekstvariabele}
-\setinterfacecommand{definetype}{definieertype}
-\setinterfacecommand{definetyping}{definieertypen}
-\setinterfacecommand{defineversion}{definieerversie}
-\setinterfacecommand{depthspanningtext}{depthspanningtext}
-\setinterfacecommand{determineheadnumber}{bepaalkopnummer}
-\setinterfacecommand{determinelistcharacteristics}{bepaallijstkenmerken}
-\setinterfacecommand{determineregistercharacteristics}{bepaalregisterkenmerken}
-\setinterfacecommand{dimension}{dimensie}
-\setinterfacecommand{disableinteractionmenu}{blokkeerinteractiemenu}
-\setinterfacecommand{disablemode}{disablemode}
-\setinterfacecommand{doaddfeature}{doaddfeature}
-\setinterfacecommand{domicile}{woonplaats}
-\setinterfacecommand{dontconvertfont}{dontconvertfont}
-\setinterfacecommand{donttest}{geentest}
-\setinterfacecommand{edgedistance}{randafstand}
-\setinterfacecommand{edgewidth}{randbreedte}
-\setinterfacecommand{emphasisboldface}{emphasisboldface}
-\setinterfacecommand{emptylines}{legeregels}
-\setinterfacecommand{enablemode}{enablemode}
-\setinterfacecommand{environment}{omgeving}
-\setinterfacecommand{externalfigure}{externfiguur}
-\setinterfacecommand{fact}{geg}
-\setinterfacecommand{fastswitchtobodyfont}{fastswitchtobodyfont}
-\setinterfacecommand{feature}{feature}
-\setinterfacecommand{field}{veld}
-\setinterfacecommand{fieldstack}{veldstapel}
-\setinterfacecommand{fillinfield}{invulveld}
-\setinterfacecommand{fillinline}{invulregel}
-\setinterfacecommand{fillinrules}{invullijnen}
-\setinterfacecommand{fillintext}{invultekst}
-\setinterfacecommand{firstcharacter}{firstcharacter}
-\setinterfacecommand{fitfield}{passendveld}
-\setinterfacecommand{fittopbaselinegrid}{fittopbaselinegrid}
-\setinterfacecommand{fixedspace}{vastespatie}
-\setinterfacecommand{fixedspaces}{vastespaties}
-\setinterfacecommand{flushnotes}{flushnotes}
-\setinterfacecommand{followprofile}{volgprofiel}
-\setinterfacecommand{followprofileversion}{volgprofielversie}
-\setinterfacecommand{followversion}{volgversie}
-\setinterfacecommand{footerdistance}{voetafstand}
-\setinterfacecommand{footerheight}{voethoogte}
-\setinterfacecommand{footnote}{voetnoot}
-\setinterfacecommand{footnotetext}{voetnoottekst}
-\setinterfacecommand{forceblocks}{forceerblokken}
-\setinterfacecommand{forcecharacterstripping}{forcecharacterstripping}
-\setinterfacecommand{formulanumber}{formulenummer}
-\setinterfacecommand{fraction}{breuk}
-\setinterfacecommand{framed}{omlijnd}
-\setinterfacecommand{from}{uit}
-\setinterfacecommand{fromlinenote}{fromlinenote}
-\setinterfacecommand{getbuffer}{haalbuffer}
-\setinterfacecommand{getfirstcharacter}{getfirstcharacter}
-\setinterfacecommand{getmarking}{haalmarkering}
-\setinterfacecommand{getnumber}{haalnummer}
-\setinterfacecommand{globaldisablemode}{globaldisablemode}
-\setinterfacecommand{globalenablemode}{globalenablemode}
-\setinterfacecommand{globalpreventmode}{globalpreventmode}
-\setinterfacecommand{godown}{omlaag}
-\setinterfacecommand{goto}{naar}
-\setinterfacecommand{gotobox}{naarbox}
-\setinterfacecommand{gotopage}{naarpagina}
-\setinterfacecommand{graycolor}{grijskleur}
-\setinterfacecommand{greyvalue}{grijswaarde}
-\setinterfacecommand{grid}{rooster}
-\setinterfacecommand{hairline}{haarlijn}
-\setinterfacecommand{head}{kop}
-\setinterfacecommand{headerdistance}{hoofdafstand}
-\setinterfacecommand{headerheight}{hoofdhoogte}
-\setinterfacecommand{headlevel}{kopniveau}
-\setinterfacecommand{headnumber}{kopnummer}
-\setinterfacecommand{headsym}{kopsym}
-\setinterfacecommand{headtext}{koptekst}
-\setinterfacecommand{heightspanningtext}{heightspanningtext}
-\setinterfacecommand{hideblocks}{verbergblokken}
-\setinterfacecommand{high}{hoog}
-\setinterfacecommand{hl}{hl}
-\setinterfacecommand{immediatebetweenlist}{directtussenlijst}
-\setinterfacecommand{immediatetolist}{directnaarlijst}
-\setinterfacecommand{in}{in}
-\setinterfacecommand{incrementnumber}{verhoognummer}
-\setinterfacecommand{indenting}{inspringen}
-\setinterfacecommand{inframed}{inlijnd}
-\setinterfacecommand{infull}{voluit}
-\setinterfacecommand{ininner}{inbinnen}
-\setinterfacecommand{inleft}{inlinker}
-\setinterfacecommand{inleftedge}{inlinkerrand}
-\setinterfacecommand{inleftmargin}{inlinkermarge}
-\setinterfacecommand{inline}{inregel}
-\setinterfacecommand{inmargin}{inmarge}
-\setinterfacecommand{inmframed}{inwilijnd}
-\setinterfacecommand{inneredgedistance}{binnenrandafstand}
-\setinterfacecommand{inneredgewidth}{binnenrandbreedte}
-\setinterfacecommand{innermargindistance}{binnenmargeafstand}
-\setinterfacecommand{innermarginwidth}{binnenmargebreedte}
-\setinterfacecommand{inothermargin}{inanderemarge}
-\setinterfacecommand{inouter}{inbuiten}
-\setinterfacecommand{inright}{inrechter}
-\setinterfacecommand{inrightedge}{inrechterrand}
-\setinterfacecommand{inrightmargin}{inrechtermarge}
-\setinterfacecommand{installlanguage}{installeertaal}
-\setinterfacecommand{interactionbar}{interactiebalk}
-\setinterfacecommand{interactionbuttons}{interactiebuttons}
-\setinterfacecommand{interactionmenu}{interactiemenu}
-\setinterfacecommand{item}{som}
-\setinterfacecommand{itemgroup}{itemgroup}
-\setinterfacecommand{items}{items}
-\setinterfacecommand{itemtag}{itemtag}
-\setinterfacecommand{its}{its}
-\setinterfacecommand{keepblocks}{handhaafblokken}
-\setinterfacecommand{kerncharacters}{kerncharacters}
-\setinterfacecommand{label}{label}
-\setinterfacecommand{labels}{labels}
-\setinterfacecommand{labeltext}{labeltekst}
-\setinterfacecommand{language}{taal}
-\setinterfacecommand{languageCharacters}{languageCharacters}
-\setinterfacecommand{languagecharacters}{languagecharacters}
-\setinterfacecommand{leftaligned}{regellinks}
-\setinterfacecommand{leftbottombox}{leftbottombox}
-\setinterfacecommand{leftedgedistance}{linkerrandafstand}
-\setinterfacecommand{leftedgewidth}{linkerrandbreedte}
-\setinterfacecommand{leftline}{leftline}
-\setinterfacecommand{leftmargindistance}{linkermargeafstand}
-\setinterfacecommand{leftmarginwidth}{linkermargebreedte}
-\setinterfacecommand{leg}{leg}
-\setinterfacecommand{linecorrection}{regelcorrectie}
-\setinterfacecommand{linenote}{linenote}
-\setinterfacecommand{linespanningtext}{linespanningtext}
-\setinterfacecommand{linewidth}{lijndikte}
-\setinterfacecommand{listheight}{lijsthoogte}
-\setinterfacecommand{listlength}{lijstlengte}
-\setinterfacecommand{listsymbol}{lijstsymbool}
-\setinterfacecommand{listwidth}{lijstbreedte}
-\setinterfacecommand{loadfontgoodies}{loadfontgoodies}
-\setinterfacecommand{localfootnotes}{lokalevoetnoten}
-\setinterfacecommand{localnotes}{localnotes}
-\setinterfacecommand{logfields}{registreervelden}
-\setinterfacecommand{lohi}{laho}
-\setinterfacecommand{low}{laag}
-\setinterfacecommand{macroname}{naam}
-\setinterfacecommand{mainlanguage}{hoofdtaal}
-\setinterfacecommand{makeupheight}{zethoogte}
-\setinterfacecommand{makeupwidth}{zetbreedte}
-\setinterfacecommand{mar}{mar}
-\setinterfacecommand{marginblock}{margeblok}
-\setinterfacecommand{margindistance}{margeafstand}
-\setinterfacecommand{marginrule}{kantlijn}
-\setinterfacecommand{margintext}{margetekst}
-\setinterfacecommand{margintitle}{margetitel}
-\setinterfacecommand{marginwidth}{margebreedte}
-\setinterfacecommand{marginword}{margewoord}
-\setinterfacecommand{marking}{markeer}
-\setinterfacecommand{markversion}{markeerversie}
-\setinterfacecommand{mathematics}{wiskunde}
-\setinterfacecommand{menubutton}{menubutton}
-\setinterfacecommand{mframed}{wilijnd}
-\setinterfacecommand{midaligned}{regelmidden}
-\setinterfacecommand{mirror}{spiegel}
-\setinterfacecommand{month}{maand}
-\setinterfacecommand{moveformula}{verplaatsformule}
-\setinterfacecommand{moveongrid}{verplaatsopgrid}
-\setinterfacecommand{movesidefloat}{verplaatszijblok}
-\setinterfacecommand{navigating}{navigerend}
-\setinterfacecommand{nodimension}{geendimensie}
-\setinterfacecommand{noheaderandfooterlines}{geenhoofdenvoetregels}
-\setinterfacecommand{noindenting}{nietinspringen}
-\setinterfacecommand{noitem}{noitem}
-\setinterfacecommand{nolist}{geenlijst}
-\setinterfacecommand{nomarking}{geenmarkering}
-\setinterfacecommand{nomoreblocks}{geenblokkenmeer}
-\setinterfacecommand{nomorefiles}{geenfilesmeer}
-\setinterfacecommand{nop}{nop}
-\setinterfacecommand{nospace}{geenspatie}
-\setinterfacecommand{note}{noot}
-\setinterfacecommand{notesymbol}{notesymbol}
-\setinterfacecommand{notopandbottomlines}{geenbovenenonderregels}
-\setinterfacecommand{notsmallcapped}{nokap}
-\setinterfacecommand{nowhitespace}{geenwitruimte}
-\setinterfacecommand{numberofsubpages}{aantalsubpaginas}
-\setinterfacecommand{numbers}{cijfers}
-\setinterfacecommand{outeredgedistance}{buitenrandafstand}
-\setinterfacecommand{outeredgewidth}{buitenrandbreedte}
-\setinterfacecommand{outermargindistance}{buitenmargeafstand}
-\setinterfacecommand{outermarginwidth}{buitenmargebreedte}
-\setinterfacecommand{packed}{opelkaar}
-\setinterfacecommand{page}{pagina}
-\setinterfacecommand{pagebreak}{pagebreak}
-\setinterfacecommand{pagedepth}{paginadiepte}
-\setinterfacecommand{pagenumber}{paginanummer}
-\setinterfacecommand{pageoffset}{paginaoffset}
-\setinterfacecommand{pagereference}{paginareferentie}
-\setinterfacecommand{paperheight}{papierhoogte}
-\setinterfacecommand{paperwidth}{papierbreedte}
-\setinterfacecommand{periods}{punten}
-\setinterfacecommand{placebookmarks}{plaatsbookmarks}
-\setinterfacecommand{placecombinedlist}{plaatssamengesteldelijst}
-\setinterfacecommand{placefloat}{plaatsplaatsblok}
-\setinterfacecommand{placefootnotes}{plaatsvoetnoten}
-\setinterfacecommand{placeformula}{plaatsformule}
-\setinterfacecommand{placeheadnumber}{plaatskopnummer}
-\setinterfacecommand{placeheadtext}{plaatskoptekst}
-\setinterfacecommand{placelegend}{plaatslegenda}
-\setinterfacecommand{placelist}{plaatslijst}
-\setinterfacecommand{placelistofsynonyms}{plaatslijstmetsynoniemen}
-\setinterfacecommand{placelocalfootnotes}{plaatslokalevoetnoten}
-\setinterfacecommand{placelocalnotes}{placelocalnotes}
-\setinterfacecommand{placelogos}{plaatsbeeldmerken}
-\setinterfacecommand{placenamedfloat}{placenamedfloat}
-\setinterfacecommand{placenotes}{placenotes}
-\setinterfacecommand{placeongrid}{plaatsopgrid}
-\setinterfacecommand{placeontopofeachother}{plaatsonderelkaar}
-\setinterfacecommand{placepagenumber}{plaatspaginanummer}
-\setinterfacecommand{placerawlist}{plaatsruwelijst}
-\setinterfacecommand{placereferencelist}{plaatsreferentielijst}
-\setinterfacecommand{placeregister}{plaatsregister}
-\setinterfacecommand{placerule}{plaatslijn}
-\setinterfacecommand{placesidebyside}{plaatsnaastelkaar}
-\setinterfacecommand{placesubformula}{plaatssubformule}
-\setinterfacecommand{placetextvariable}{plaatstekstvariabele}
-\setinterfacecommand{position}{positioneer}
-\setinterfacecommand{positiontext}{positioneertekst}
-\setinterfacecommand{postponenotes}{postponenotes}
-\setinterfacecommand{postponingnotes}{postponingnotes}
-\setinterfacecommand{predefinedfont}{predefinedfont}
-\setinterfacecommand{predefinefont}{predefinefont}
-\setinterfacecommand{presetdocument}{presetdocument}
-\setinterfacecommand{prettyprintbuffer}{prettyprintbuffer}
-\setinterfacecommand{preventmode}{preventmode}
-\setinterfacecommand{printpaperheight}{printpapierhoogte}
-\setinterfacecommand{printpaperwidth}{printpapierbreedte}
-\setinterfacecommand{processblocks}{verwerkblokken}
-\setinterfacecommand{processbodyfontenvironmentlist}{processbodyfontenvironmentlist}
-\setinterfacecommand{processpage}{verwerkpagina}
-\setinterfacecommand{product}{produkt}
-\setinterfacecommand{program}{programma}
-\setinterfacecommand{project}{projekt}
-\setinterfacecommand{publication}{publicatie}
-\setinterfacecommand{quotation}{citaat}
-\setinterfacecommand{quote}{citeer}
-\setinterfacecommand{ran}{ran}
-\setinterfacecommand{redo}{herhaal}
-\setinterfacecommand{redoconvertfont}{redoconvertfont}
-\setinterfacecommand{ref}{ref}
-\setinterfacecommand{reference}{referentie}
-\setinterfacecommand{referral}{kenmerk}
-\setinterfacecommand{referraldate}{kenmerkdatum}
-\setinterfacecommand{referring}{refereer}
-\setinterfacecommand{registerfontclass}{registerfontclass}
-\setinterfacecommand{registerhyphenationexception}{registerhyphenationexception}
-\setinterfacecommand{registerhyphenationpattern}{registerhyphenationpattern}
-\setinterfacecommand{remark}{toelichting}
-\setinterfacecommand{replacefeature}{replacefeature}
-\setinterfacecommand{reset}{reset}
-\setinterfacecommand{resetandaddfeature}{resetandaddfeature}
-\setinterfacecommand{resetcharacteralign}{resetcharacteralign}
-\setinterfacecommand{resetcharacterkerning}{resetcharacterkerning}
-\setinterfacecommand{resetcharacterspacing}{resetcharacterspacing}
-\setinterfacecommand{resetcharacterstripping}{resetcharacterstripping}
-\setinterfacecommand{resetfeature}{resetfeature}
-\setinterfacecommand{resetfontcolorsheme}{resetfontcolorsheme}
-\setinterfacecommand{resetfontfallback}{resetfontfallback}
-\setinterfacecommand{resetfontsolution}{resetfontsolution}
-\setinterfacecommand{resethyphenationfeatures}{resethyphenationfeatures}
-\setinterfacecommand{resetlocalfloats}{resetlocalfloats}
-\setinterfacecommand{resetmarking}{resetmarkering}
-\setinterfacecommand{resetmode}{resetmode}
-\setinterfacecommand{resetnumber}{resetnummer}
-\setinterfacecommand{resetpath}{resetpath}
-\setinterfacecommand{resetperiodkerning}{resetperiodkerning}
-\setinterfacecommand{resetsystemmode}{resetsystemmode}
-\setinterfacecommand{resettextcontent}{resettekstinhoud}
-\setinterfacecommand{resetvisualizers}{resetvisualizers}
-\setinterfacecommand{restoreglobalbodyfont}{restoreglobalbodyfont}
-\setinterfacecommand{retestfeature}{retestfeature}
-\setinterfacecommand{revivefeature}{revivefeature}
-\setinterfacecommand{rightaligned}{regelrechts}
-\setinterfacecommand{rightbottombox}{rightbottombox}
-\setinterfacecommand{rightedgedistance}{rechterrandafstand}
-\setinterfacecommand{rightedgewidth}{rechterrandbreedte}
-\setinterfacecommand{rightline}{rightline}
-\setinterfacecommand{rightmargindistance}{rechtermargeafstand}
-\setinterfacecommand{rightmarginwidth}{rechtermargebreedte}
-\setinterfacecommand{romannumerals}{romeins}
-\setinterfacecommand{rotate}{roteer}
-\setinterfacecommand{savebuffer}{bewaarbuffer}
-\setinterfacecommand{scale}{schaal}
-\setinterfacecommand{screen}{scherm}
-\setinterfacecommand{selectblocks}{selecteerblokken}
-\setinterfacecommand{selectpaper}{selecteerpapier}
-\setinterfacecommand{selectversion}{selecteerversie}
-\setinterfacecommand{setbigbodyfont}{setbigbodyfont}
-\setinterfacecommand{setcharacteralign}{setcharacteralign}
-\setinterfacecommand{setcharacteraligndetail}{setcharacteraligndetail}
-\setinterfacecommand{setcharactercasing}{setcharactercasing}
-\setinterfacecommand{setcharactercleaning}{setcharactercleaning}
-\setinterfacecommand{setcharacterkerning}{setcharacterkerning}
-\setinterfacecommand{setcharacterspacing}{setcharacterspacing}
-\setinterfacecommand{setcharacterstripping}{setcharacterstripping}
-\setinterfacecommand{setcurrentfontclass}{setcurrentfontclass}
-\setinterfacecommand{setfirstline}{setfirstline}
-\setinterfacecommand{setfirstpasscharacteralign}{setfirstpasscharacteralign}
-\setinterfacecommand{setfont}{setfont}
-\setinterfacecommand{setfontcolorsheme}{setfontcolorsheme}
-\setinterfacecommand{setfontfeature}{setfontfeature}
-\setinterfacecommand{setfontsolution}{setfontsolution}
-\setinterfacecommand{setfontstrut}{setfontstrut}
-\setinterfacecommand{sethyphenationfeatures}{sethyphenationfeatures}
-\setinterfacecommand{setmainbodyfont}{setmainbodyfont}
-\setinterfacecommand{setmode}{setmode}
-\setinterfacecommand{setnote}{setnote}
-\setinterfacecommand{setnotetext}{setnotetext}
-\setinterfacecommand{setnumber}{setnummer}
-\setinterfacecommand{setperiodkerning}{setperiodkerning}
-\setinterfacecommand{setsecondpasscharacteralign}{setsecondpasscharacteralign}
-\setinterfacecommand{setsmallbodyfont}{setsmallbodyfont}
-\setinterfacecommand{setsystemmode}{setsystemmode}
-\setinterfacecommand{settextcontent}{steltekstinhoudin}
-\setinterfacecommand{settextvariable}{kentekstvariabeletoe}
-\setinterfacecommand{setupalign}{steluitlijnenin}
-\setinterfacecommand{setupanswerarea}{stelantwoordgebiedin}
-\setinterfacecommand{setuparranging}{stelarrangerenin}
-\setinterfacecommand{setupattachment}{setupattachment}
-\setinterfacecommand{setupbackground}{stelachtergrondin}
-\setinterfacecommand{setupbackgrounds}{stelachtergrondenin}
-\setinterfacecommand{setupblackrules}{stelblokjesin}
-\setinterfacecommand{setupblank}{stelblankoin}
-\setinterfacecommand{setupblock}{stelblokin}
-\setinterfacecommand{setupbodyfont}{stelkorpsin}
-\setinterfacecommand{setupbodyfontenvironment}{stelkorpsomgevingin}
-\setinterfacecommand{setupbottom}{stelonderin}
-\setinterfacecommand{setupbottomtexts}{stelondertekstenin}
-\setinterfacecommand{setupbuffer}{stelbufferin}
-\setinterfacecommand{setupbuttons}{stelbuttonsin}
-\setinterfacecommand{setupcapitals}{stelkapitalenin}
-\setinterfacecommand{setupcaption}{stelblokkopjein}
-\setinterfacecommand{setupcaptions}{stelblokkopjesin}
-\setinterfacecommand{setupcharacteralign}{setupcharacteralign}
-\setinterfacecommand{setupcharacterkerning}{setupcharacterkerning}
-\setinterfacecommand{setupcharacterspacing}{setupcharacterspacing}
-\setinterfacecommand{setupclipping}{stelclipin}
-\setinterfacecommand{setupcolor}{stelkleurin}
-\setinterfacecommand{setupcolors}{stelkleurenin}
-\setinterfacecommand{setupcolumns}{stelkolommenin}
-\setinterfacecommand{setupcolumnset}{stelkolomgroepin}
-\setinterfacecommand{setupcolumnsetlines}{stelkolomgroepregelsin}
-\setinterfacecommand{setupcolumnsetstart}{stelkolomgroepstartin}
-\setinterfacecommand{setupcombinations}{stelcombinatiesin}
-\setinterfacecommand{setupcombinedlist}{stelsamengesteldelijstin}
-\setinterfacecommand{setupcomment}{stelcommentaarin}
-\setinterfacecommand{setupcounter}{setupcounter}
-\setinterfacecommand{setupdescription}{steldoordefinierenin}
-\setinterfacecommand{setupdescriptions}{steldoordefinierenin}
-\setinterfacecommand{setupenumeration}{steldoornummerenin}
-\setinterfacecommand{setupenumerations}{steldoornummerenin}
-\setinterfacecommand{setupexternalfigures}{stelexternefigurenin}
-\setinterfacecommand{setupfield}{stelveldin}
-\setinterfacecommand{setupfields}{stelveldenin}
-\setinterfacecommand{setupfillinlines}{stelinvulregelsin}
-\setinterfacecommand{setupfillinrules}{stelinvullijnenin}
-\setinterfacecommand{setupfirstline}{setupfirstline}
-\setinterfacecommand{setupfloat}{stelplaatsblokin}
-\setinterfacecommand{setupfloats}{stelplaatsblokkenin}
-\setinterfacecommand{setupfloatsplitting}{stelplaatsbloksplitsenin}
-\setinterfacecommand{setupfontexpansion}{setupfontexpansion}
-\setinterfacecommand{setupfontprotrusion}{setupfontprotrusion}
-\setinterfacecommand{setupfonts}{setupfonts}
-\setinterfacecommand{setupfontsolution}{setupfontsolution}
-\setinterfacecommand{setupfooter}{stelvoetin}
-\setinterfacecommand{setupfootertexts}{stelvoettekstenin}
-\setinterfacecommand{setupfootnotedefinition}{stelvoetnootdefinitiein}
-\setinterfacecommand{setupfootnotes}{stelvoetnotenin}
-\setinterfacecommand{setupforms}{stelformulierenin}
-\setinterfacecommand{setupformula}{stelformulein}
-\setinterfacecommand{setupformulas}{stelformulesin}
-\setinterfacecommand{setupframed}{stelomlijndin}
-\setinterfacecommand{setupframedtext}{stelkadertekstin}
-\setinterfacecommand{setupframedtexts}{stelkadertekstenin}
-\setinterfacecommand{setuphead}{stelkopin}
-\setinterfacecommand{setupheader}{stelhoofdin}
-\setinterfacecommand{setupheadertexts}{stelhoofdtekstenin}
-\setinterfacecommand{setupheadnumber}{stelkopnummerin}
-\setinterfacecommand{setupheads}{stelkoppenin}
-\setinterfacecommand{setupheadtext}{stelkoptekstin}
-\setinterfacecommand{setuphyphenation}{setuphyphenation}
-\setinterfacecommand{setuphyphenmark}{stelkoppeltekenin}
-\setinterfacecommand{setupindentedtext}{stelingesprongentextin}
-\setinterfacecommand{setupindenting}{stelinspringenin}
-\setinterfacecommand{setupinmargin}{stelinmargein}
-\setinterfacecommand{setupinteraction}{stelinteractiein}
-\setinterfacecommand{setupinteractionbar}{stelinteractiebalkin}
-\setinterfacecommand{setupinteractionmenu}{stelinteractiemenuin}
-\setinterfacecommand{setupinteractionscreen}{stelinteractieschermin}
-\setinterfacecommand{setupinterlinespace}{stelinterliniein}
-\setinterfacecommand{setupitemgroup}{stelitemgroepin}
-\setinterfacecommand{setupitemgroups}{stelopsommingenin}
-\setinterfacecommand{setupitems}{stelitemsin}
-\setinterfacecommand{setuplabeltext}{stellabeltekstin}
-\setinterfacecommand{setuplanguage}{steltaalin}
-\setinterfacecommand{setuplayout}{stellayoutin}
-\setinterfacecommand{setuplegend}{stellegendain}
-\setinterfacecommand{setuplinenote}{setuplinenote}
-\setinterfacecommand{setuplinenumbering}{stelregelnummerenin}
-\setinterfacecommand{setuplines}{stelregelsin}
-\setinterfacecommand{setuplinewidth}{stellijndiktein}
-\setinterfacecommand{setuplist}{stellijstin}
-\setinterfacecommand{setupmakeup}{stelopmaakin}
-\setinterfacecommand{setupmarginblock}{stelmargeblokkenin}
-\setinterfacecommand{setupmarginblocks}{stelmargeblokkenin}
-\setinterfacecommand{setupmargindata}{stelinmargein}
-\setinterfacecommand{setupmarginrules}{stelkantlijnin}
-\setinterfacecommand{setupmarking}{stelmarkeringin}
-\setinterfacecommand{setupmathalignment}{stelwiskundeuitlijnenin}
-\setinterfacecommand{setupnarrower}{stelsmallerin}
-\setinterfacecommand{setupnotation}{setupnotation}
-\setinterfacecommand{setupnotations}{setupnotations}
-\setinterfacecommand{setupnote}{setupnote}
-\setinterfacecommand{setupnotes}{setupnotes}
-\setinterfacecommand{setupnumber}{stelnummerin}
-\setinterfacecommand{setupnumbering}{stelnummerenin}
-\setinterfacecommand{setupoppositeplacing}{stelnaastplaatsenin}
-\setinterfacecommand{setupoutput}{steluitvoerin}
-\setinterfacecommand{setuppagecomment}{stelpaginacommentaarin}
-\setinterfacecommand{setuppagenumber}{stelpaginanummerin}
-\setinterfacecommand{setuppagenumbering}{stelpaginanummeringin}
-\setinterfacecommand{setuppagetransitions}{stelpaginaovergangenin}
-\setinterfacecommand{setuppalet}{stelpaletin}
-\setinterfacecommand{setuppaper}{stelpapierin}
-\setinterfacecommand{setuppapersize}{stelpapierformaatin}
-\setinterfacecommand{setupparagraphnumbering}{stelparagraafnummerenin}
-\setinterfacecommand{setupparagraphs}{stelalineasin}
-\setinterfacecommand{setupperiodkerning}{setupperiodkerning}
-\setinterfacecommand{setupplacement}{stelplaatsin}
-\setinterfacecommand{setuppositioning}{stelpositionerenin}
-\setinterfacecommand{setupprofiles}{stelprofielenin}
-\setinterfacecommand{setupprograms}{stelprogrammasin}
-\setinterfacecommand{setuppublications}{stelpublicatiesin}
-\setinterfacecommand{setupquote}{stelciterenin}
-\setinterfacecommand{setupreferencelist}{stelreferentielijstin}
-\setinterfacecommand{setupreferencing}{stelrefererenin}
-\setinterfacecommand{setupregister}{stelregisterin}
-\setinterfacecommand{setuprotate}{stelroterenin}
-\setinterfacecommand{setuprule}{stellijnin}
-\setinterfacecommand{setupscreens}{stelrastersin}
-\setinterfacecommand{setupsection}{stelsectiein}
-\setinterfacecommand{setupsectionblock}{stelsectieblokin}
-\setinterfacecommand{setupsorting}{stelsorterenin}
-\setinterfacecommand{setupspacing}{stelspatieringin}
-\setinterfacecommand{setupstartstop}{stelstartstopin}
-\setinterfacecommand{setupstrut}{stelstrutin}
-\setinterfacecommand{setupsubpagenumber}{stelsubpaginanummerin}
-\setinterfacecommand{setupsymbolset}{stelsymboolsetin}
-\setinterfacecommand{setupsynchronization}{stelsynchronisatiein}
-\setinterfacecommand{setupsynchronizationbar}{stelsynchronisatiebalkin}
-\setinterfacecommand{setupsynonyms}{stelsynoniemenin}
-\setinterfacecommand{setupsystem}{stelsysteemin}
-\setinterfacecommand{setuptab}{steltabin}
-\setinterfacecommand{setuptables}{steltabellenin}
-\setinterfacecommand{setuptabulate}{steltabulatiein}
-\setinterfacecommand{setuptext}{steltekstin}
-\setinterfacecommand{setuptextbackground}{steltekstachtergrondin}
-\setinterfacecommand{setuptextnote}{setuptextnote}
-\setinterfacecommand{setuptextposition}{steltekstpositiein}
-\setinterfacecommand{setuptextrules}{steltekstlijnenin}
-\setinterfacecommand{setuptexttexts}{stelteksttekstenin}
-\setinterfacecommand{setuptextvariable}{steltekstvariabelein}
-\setinterfacecommand{setupthinrules}{steldunnelijnenin}
-\setinterfacecommand{setuptolerance}{steltolerantiein}
-\setinterfacecommand{setuptop}{stelbovenin}
-\setinterfacecommand{setuptoptexts}{stelboventekstenin}
-\setinterfacecommand{setuptype}{steltypein}
-\setinterfacecommand{setuptyping}{steltypenin}
-\setinterfacecommand{setupunderbar}{stelonderstrepenin}
-\setinterfacecommand{setupurl}{stelurlin}
-\setinterfacecommand{setupversions}{stelversiesin}
-\setinterfacecommand{setupwhitespace}{stelwitruimtein}
-\setinterfacecommand{setvisualizerfont}{setvisualizerfont}
-\setinterfacecommand{showbodyfont}{toonkorps}
-\setinterfacecommand{showbodyfontenvironment}{toonkorpsomgeving}
-\setinterfacecommand{showcolor}{toonkleur}
-\setinterfacecommand{showcolorgroup}{toonkleurgroep}
-\setinterfacecommand{showcounter}{showcounter}
-\setinterfacecommand{showexternalfigures}{toonexternefiguren}
-\setinterfacecommand{showfields}{toonvelden}
-\setinterfacecommand{showfont}{showfont}
-\setinterfacecommand{showfontdata}{showfontdata}
-\setinterfacecommand{showfontexpansion}{showfontexpansion}
-\setinterfacecommand{showfontitalics}{showfontitalics}
-\setinterfacecommand{showfontkerns}{showfontkerns}
-\setinterfacecommand{showfontparameters}{showfontparameters}
-\setinterfacecommand{showfontstrip}{showfontstrip}
-\setinterfacecommand{showfontstyle}{showfontstyle}
-\setinterfacecommand{showframe}{toonkader}
-\setinterfacecommand{showgrid}{toongrid}
-\setinterfacecommand{showhyphenationtrace}{showhyphenationtrace}
-\setinterfacecommand{showkerning}{showkerning}
-\setinterfacecommand{showlayout}{toonlayout}
-\setinterfacecommand{showmakeup}{toonopmaak}
-\setinterfacecommand{showminimalbaseline}{showminimalbaseline}
-\setinterfacecommand{showpalet}{toonpalet}
-\setinterfacecommand{showprint}{toonprint}
-\setinterfacecommand{showsetups}{tooninstellingen}
-\setinterfacecommand{showstruts}{toonstruts}
-\setinterfacecommand{showsymbolset}{toonsymboolset}
-\setinterfacecommand{smallcapped}{kap}
-\setinterfacecommand{someline}{eenregel}
-\setinterfacecommand{somewhere}{ergens}
-\setinterfacecommand{space}{spatie}
-\setinterfacecommand{specialitem}{specialitem}
-\setinterfacecommand{splitfloat}{splitsplaatsblok}
-\setinterfacecommand{startalignment}{startuitlijnen}
-\setinterfacecommand{startbackground}{startachtergrond}
-\setinterfacecommand{startcoding}{startcodering}
-\setinterfacecommand{startcolor}{startkleur}
-\setinterfacecommand{startcolumnmakeup}{startkolomopmaak}
-\setinterfacecommand{startcolumns}{startkolommen}
-\setinterfacecommand{startcolumnset}{startkolomgroep}
-\setinterfacecommand{startcombination}{startcombinatie}
-\setinterfacecommand{startcomponent}{startonderdeel}
-\setinterfacecommand{startdocument}{startdocument}
-\setinterfacecommand{startenvironment}{startomgeving}
-\setinterfacecommand{startfigure}{startfiguur}
-\setinterfacecommand{startframed}{startomlijnd}
-\setinterfacecommand{startglobal}{startglobaal}
-\setinterfacecommand{startline}{startregel}
-\setinterfacecommand{startlinecorrection}{startregelcorrectie}
-\setinterfacecommand{startlinenote}{startlinenote}
-\setinterfacecommand{startlinenumbering}{startregelnummeren}
-\setinterfacecommand{startlines}{startregels}
-\setinterfacecommand{startlocal}{startlokaal}
-\setinterfacecommand{startlocalfootnotes}{startlokalevoetnoten}
-\setinterfacecommand{startmakeup}{startopmaak}
-\setinterfacecommand{startmarginblock}{startmargeblok}
-\setinterfacecommand{startmarginrule}{startkantlijn}
-\setinterfacecommand{startnarrower}{startsmaller}
-\setinterfacecommand{startopposite}{startnaast}
-\setinterfacecommand{startoverlay}{startoverlay}
-\setinterfacecommand{startoverview}{startoverzicht}
-\setinterfacecommand{startpacked}{startopelkaar}
-\setinterfacecommand{startpositioning}{startpositioneren}
-\setinterfacecommand{startproduct}{startprodukt}
-\setinterfacecommand{startprofile}{startprofiel}
-\setinterfacecommand{startproject}{startprojekt}
-\setinterfacecommand{startquotation}{startcitaat}
-\setinterfacecommand{startraster}{startraster}
-\setinterfacecommand{startsymbolset}{startsymboolset}
-\setinterfacecommand{startsynchronization}{startsynchronisatie}
-\setinterfacecommand{starttable}{starttabel}
-\setinterfacecommand{starttables}{starttabellen}
-\setinterfacecommand{starttext}{starttekst}
-\setinterfacecommand{starttextbackground}{starttekstachtergrond}
-\setinterfacecommand{starttextrule}{starttekstlijn}
-\setinterfacecommand{startunpacked}{startvanelkaar}
-\setinterfacecommand{startversion}{startversie}
-\setinterfacecommand{stopalignment}{stopuitlijnen}
-\setinterfacecommand{stopbackground}{stopachtergrond}
-\setinterfacecommand{stopcoding}{stopcodering}
-\setinterfacecommand{stopcolor}{stopkleur}
-\setinterfacecommand{stopcolumnmakeup}{stopkolomopmaak}
-\setinterfacecommand{stopcolumns}{stopkolommen}
-\setinterfacecommand{stopcolumnset}{stopkolomgroep}
-\setinterfacecommand{stopcombination}{stopcombinatie}
-\setinterfacecommand{stopcomponent}{stoponderdeel}
-\setinterfacecommand{stopdocument}{stopdocument}
-\setinterfacecommand{stopenvironment}{stopomgeving}
-\setinterfacecommand{stopframed}{stopomlijnd}
-\setinterfacecommand{stopglobal}{stopglobaal}
-\setinterfacecommand{stopline}{stopregel}
-\setinterfacecommand{stoplinecorrection}{stopregelcorrectie}
-\setinterfacecommand{stoplinenote}{stoplinenote}
-\setinterfacecommand{stoplinenumbering}{stopregelnummeren}
-\setinterfacecommand{stoplines}{stopregels}
-\setinterfacecommand{stoplocal}{stoplokaal}
-\setinterfacecommand{stoplocalfootnotes}{stoplokalevoetnoten}
-\setinterfacecommand{stopmakeup}{stopopmaak}
-\setinterfacecommand{stopmarginblock}{stopmargeblok}
-\setinterfacecommand{stopmarginrule}{stopkantlijn}
-\setinterfacecommand{stopnarrower}{stopsmaller}
-\setinterfacecommand{stopopposite}{stopnaast}
-\setinterfacecommand{stopoverlay}{stopoverlay}
-\setinterfacecommand{stopoverview}{stopoverzicht}
-\setinterfacecommand{stoppacked}{stopopelkaar}
-\setinterfacecommand{stoppositioning}{stoppositioneren}
-\setinterfacecommand{stopproduct}{stopprodukt}
-\setinterfacecommand{stopprofile}{stopprofiel}
-\setinterfacecommand{stopproject}{stopprojekt}
-\setinterfacecommand{stopquotation}{stopcitaat}
-\setinterfacecommand{stopraster}{stopraster}
-\setinterfacecommand{stopsynchronization}{stopsynchronisatie}
-\setinterfacecommand{stoptable}{stoptabel}
-\setinterfacecommand{stoptables}{stoptabellen}
-\setinterfacecommand{stoptext}{stoptekst}
-\setinterfacecommand{stoptextbackground}{stoptekstachtergrond}
-\setinterfacecommand{stoptextrule}{stoptekstlijn}
-\setinterfacecommand{stopunpacked}{stopvanelkaar}
-\setinterfacecommand{stopversion}{stopversie}
-\setinterfacecommand{stretched}{uitgerekt}
-\setinterfacecommand{strictinspectnextcharacter}{strictinspectnextcharacter}
-\setinterfacecommand{stripcharacter}{stripcharacter}
-\setinterfacecommand{subformulanumber}{subformulenummer}
-\setinterfacecommand{subpagenumber}{subpaginanummer}
-\setinterfacecommand{subtractfeature}{subtractfeature}
-\setinterfacecommand{switchtobodyfont}{switchnaarkorps}
-\setinterfacecommand{switchtorawfont}{switchtorawfont}
-\setinterfacecommand{sym}{sym}
-\setinterfacecommand{symbol}{symbool}
-\setinterfacecommand{symoffset}{symoffset}
-\setinterfacecommand{synchronizationbar}{synchronisatiebalk}
-\setinterfacecommand{synchronize}{synchroniseer}
-\setinterfacecommand{tab}{tab}
-\setinterfacecommand{testcolumn}{testkolom}
-\setinterfacecommand{testfeature}{testfeature}
-\setinterfacecommand{testfeatureonce}{testfeatureonce}
-\setinterfacecommand{testpage}{testpagina}
-\setinterfacecommand{tex}{tex}
-\setinterfacecommand{textbackground}{tekstachtergrond}
-\setinterfacecommand{textcolor}{textcolor}
-\setinterfacecommand{textheight}{teksthoogte}
-\setinterfacecommand{textnote}{textnote}
-\setinterfacecommand{textreference}{tekstreferentie}
-\setinterfacecommand{textrule}{tekstlijn}
-\setinterfacecommand{textvariable}{tekstvariabele}
-\setinterfacecommand{textwidth}{tekstbreedte}
-\setinterfacecommand{thefirstcharacter}{thefirstcharacter}
-\setinterfacecommand{thenormalizedbodyfontsize}{thenormalizedbodyfontsize}
-\setinterfacecommand{theremainingcharacters}{theremainingcharacters}
-\setinterfacecommand{thinrule}{dunnelijn}
-\setinterfacecommand{thinrules}{dunnelijnen}
-\setinterfacecommand{tolinenote}{tolinenote}
-\setinterfacecommand{tooltip}{suggestie}
-\setinterfacecommand{topdistance}{bovenafstand}
-\setinterfacecommand{topheight}{bovenhoogte}
-\setinterfacecommand{topspace}{kopwit}
-\setinterfacecommand{totalnumberofpages}{totaalaantalpaginas}
-\setinterfacecommand{translate}{vertaal}
-\setinterfacecommand{txt}{txt}
-\setinterfacecommand{typ}{typ}
-\setinterfacecommand{type}{type}
-\setinterfacecommand{typebuffer}{typebuffer}
-\setinterfacecommand{typedefinedbuffer}{typedefinedbuffer}
-\setinterfacecommand{typefile}{typefile}
-\setinterfacecommand{typeinlinebuffer}{typeinlinebuffer}
-\setinterfacecommand{typing}{typing}
-\setinterfacecommand{unitmeaning}{betekenis}
-\setinterfacecommand{unknown}{onbekend}
-\setinterfacecommand{unregisterhyphenationpattern}{unregisterhyphenationpattern}
-\setinterfacecommand{useJSscripts}{gebruikJSscripts}
-\setinterfacecommand{useURL}{gebruikURL}
-\setinterfacecommand{useXMLfilter}{gebruikXMLfilter}
-\setinterfacecommand{useblocks}{gebruikblokken}
-\setinterfacecommand{usebodyfont}{usebodyfont}
-\setinterfacecommand{usebodyfontparameter}{usebodyfontparameter}
-\setinterfacecommand{usecommands}{gebruikcommandos}
-\setinterfacecommand{useencoding}{usecodering}
-\setinterfacecommand{useexternaldocument}{gebruikexterndocument}
-\setinterfacecommand{useexternalfigure}{gebruikexternfiguur}
-\setinterfacecommand{useexternalfile}{gebruikexternefile}
-\setinterfacecommand{useexternalfiles}{gebruikexternefiles}
-\setinterfacecommand{useexternalsoundtrack}{gebruikexterngeluidsfragment}
-\setinterfacecommand{usemodule}{gebruikmodule}
-\setinterfacecommand{usemodules}{gebruikmodules}
-\setinterfacecommand{usepath}{gebruikpad}
-\setinterfacecommand{usereferences}{gebruikreferenties}
-\setinterfacecommand{usespecials}{gebruikspecials}
-\setinterfacecommand{usesymbols}{gebruiksymbolen}
-\setinterfacecommand{usetypescript}{gebruiktypescript}
-\setinterfacecommand{usetypescriptfile}{gebruiktypescriptfile}
-\setinterfacecommand{useurl}{gebruikurl}
-\setinterfacecommand{verbatim}{verbatim}
-\setinterfacecommand{version}{versie}
-\setinterfacecommand{vl}{vl}
-\setinterfacecommand{weekday}{weekdag}
-\setinterfacecommand{whitespace}{witruimte}
-\setinterfacecommand{widthspanningtext}{widthspanningtext}
-\setinterfacecommand{wordright}{woordrechts}
-\setinterfacecommand{writebetweenlist}{schrijftussenlijst}
-\setinterfacecommand{writetolist}{schrijfnaarlijst}
-\setinterfacecommand{writetoreferencelist}{schrijfnaarreferentielijst}
-\setinterfacecommand{writetoregister}{schrijfnaarregister}
-%
-\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/context/base/mkii/mult-pe.mkii b/Master/texmf-dist/tex/context/base/mkii/mult-pe.mkii
deleted file mode 100644
index bbfae955629..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/mult-pe.mkii
+++ /dev/null
@@ -1,2224 +0,0 @@
-% this file is auto-generated, don't edit this file
-%
-% definitions for interface variables for language pe
-%
-\setinterfacevariable{Addition}{جمع}
-\setinterfacevariable{Alphabetic}{Alphabetic}
-\setinterfacevariable{Balloon}{بادکنک}
-\setinterfacevariable{Cap}{Cap}
-\setinterfacevariable{Capital}{Capital}
-\setinterfacevariable{Character}{Character}
-\setinterfacevariable{Characters}{Characters}
-\setinterfacevariable{CloseDocument}{بستن‌نوشتار}
-\setinterfacevariable{ExitViewer}{خروج‌نمایشگر}
-\setinterfacevariable{FirstPage}{صÙحه‌اول}
-\setinterfacevariable{FitHeight}{پرکردن‌ارتÙاع}
-\setinterfacevariable{FitWidth}{پرکردن‌عرض}
-\setinterfacevariable{GotoPage}{برو‌به‌صÙحه}
-\setinterfacevariable{Greek}{یونانی}
-\setinterfacevariable{Help}{Ú©Ù…Ú©}
-\setinterfacevariable{HideField}{پنهان‌میدان}
-\setinterfacevariable{HideLayer}{پنهان‌لایه}
-\setinterfacevariable{Key}{کلید}
-\setinterfacevariable{LastPage}{صÙحه‌آخر}
-\setinterfacevariable{LoadForm}{بارگذاشتن‌Ùرم}
-\setinterfacevariable{MONTH}{ماه}
-\setinterfacevariable{New}{جدید}
-\setinterfacevariable{NextJump}{پرش‌بعدی}
-\setinterfacevariable{NextPage}{صÙحه‌بعدی}
-\setinterfacevariable{Numbers}{شماره‌ها}
-\setinterfacevariable{OpenNamedDocument}{بازکردن‌نوشتار‌ذخیره‌شده}
-\setinterfacevariable{Ordinal}{Ordinal}
-\setinterfacevariable{Paragraph}{پاراگراÙ}
-\setinterfacevariable{PauseMovie}{ایست‌Ùیلم}
-\setinterfacevariable{PauseRendering}{توقÙ‌تعبیر}
-\setinterfacevariable{PauseSound}{ایست‌صدا}
-\setinterfacevariable{PreviousJump}{پرش‌قبلی}
-\setinterfacevariable{PreviousPage}{صÙحه‌قبلی}
-\setinterfacevariable{PrintDocument}{چاپ‌نوشتار}
-\setinterfacevariable{Query}{پرسش}
-\setinterfacevariable{QueryAgain}{پرسش‌دوباره}
-\setinterfacevariable{ResetForm}{دوباره‌نشانی‌Ùرم}
-\setinterfacevariable{ResumeMovie}{ادامه‌Ùیلم}
-\setinterfacevariable{ResumeRendering}{ادامه‌تعبیر}
-\setinterfacevariable{ResumeSound}{ادامه‌صدا}
-\setinterfacevariable{Romannumerals}{اعداد‌بزرگ‌لاتین}
-\setinterfacevariable{SaveDocument}{ذخیره‌نوشتار}
-\setinterfacevariable{SaveForm}{ذخیره‌Ùرم}
-\setinterfacevariable{SaveNamedDocument}{ذخیره‌نوشتار‌بانام}
-\setinterfacevariable{SearchAgain}{جستجوی‌دوباره}
-\setinterfacevariable{SearchDocument}{جستجوی‌نوشتار}
-\setinterfacevariable{ShowBookmarks}{نمایش‌چوبخط}
-\setinterfacevariable{ShowField}{نمایش‌میدان}
-\setinterfacevariable{ShowThumbs}{نمایش‌شصت}
-\setinterfacevariable{StartMovie}{شروع‌Ùیلم}
-\setinterfacevariable{StartRendering}{شروع‌تعبیر}
-\setinterfacevariable{StartSound}{شروع‌صدا}
-\setinterfacevariable{StopMovie}{پایان‌Ùیلم}
-\setinterfacevariable{StopRendering}{پایان‌تعبیر}
-\setinterfacevariable{StopSound}{پایان‌صدا}
-\setinterfacevariable{SubmitForm}{تسلیم‌Ùرم}
-\setinterfacevariable{ToggleLayer}{تغییرلایه}
-\setinterfacevariable{ToggleViewer}{تغییرنمایشگر}
-\setinterfacevariable{URL}{URL}
-\setinterfacevariable{VideLayer}{VideLayer}
-\setinterfacevariable{ViewerHelp}{کمک‌نمایشگر}
-\setinterfacevariable{WEEKDAY}{روزهÙته}
-\setinterfacevariable{WORD}{کلمه}
-\setinterfacevariable{WORDS}{WORDS}
-\setinterfacevariable{Word}{Word}
-\setinterfacevariable{Words}{Words}
-\setinterfacevariable{abbreviation}{اختصار}
-\setinterfacevariable{abbreviations}{اختصارات}
-\setinterfacevariable{absolute}{قطعی}
-\setinterfacevariable{action}{کنش}
-\setinterfacevariable{after}{بعداز}
-\setinterfacevariable{all}{همه}
-\setinterfacevariable{alphabetic}{alphabetic}
-\setinterfacevariable{always}{همواره}
-\setinterfacevariable{anchor}{anchor}
-\setinterfacevariable{and}{and}
-\setinterfacevariable{answerarea}{answerarea}
-\setinterfacevariable{appendices}{پیوستها}
-\setinterfacevariable{appendix}{پیوست}
-\setinterfacevariable{april}{آوریل}
-\setinterfacevariable{aside}{aside}
-\setinterfacevariable{atleftmargin}{درحاشیه‌چپ}
-\setinterfacevariable{atmargin}{درحاشیه}
-\setinterfacevariable{atpage}{درصÙحه}
-\setinterfacevariable{atrightmargin}{درحاشیه‌راست}
-\setinterfacevariable{attachment}{attachment}
-\setinterfacevariable{august}{آگوست}
-\setinterfacevariable{author}{author}
-\setinterfacevariable{auto}{خودکار}
-\setinterfacevariable{autointro}{پیشگÙتارخودکار}
-\setinterfacevariable{autopunctuation}{autopunctuation}
-\setinterfacevariable{back}{پشت}
-\setinterfacevariable{background}{پس‌زمینه}
-\setinterfacevariable{backmatter}{پس‌مطلب}
-\setinterfacevariable{backpart}{پس‌قسمت}
-\setinterfacevariable{backspace}{Ùضای‌پشت}
-\setinterfacevariable{backward}{عقب‌گرد}
-\setinterfacevariable{bbl}{bbl}
-\setinterfacevariable{before}{قبل‌از}
-\setinterfacevariable{begin}{begin}
-\setinterfacevariable{bib}{bib}
-\setinterfacevariable{big}{بزرگ}
-\setinterfacevariable{bigbodyfont}{قلم‌بدنه‌بزرگ}
-\setinterfacevariable{bigger}{bigger}
-\setinterfacevariable{bigpreference}{اولویت‌بزرگ}
-\setinterfacevariable{blank}{خالی}
-\setinterfacevariable{block}{block}
-\setinterfacevariable{blockquote}{نقل‌بلوک}
-\setinterfacevariable{bodymatter}{مطلب‌بدنه}
-\setinterfacevariable{bodypart}{قسمت‌بدنه}
-\setinterfacevariable{bold}{مشکی}
-\setinterfacevariable{bolditalic}{ایتالیک‌مشکی}
-\setinterfacevariable{boldslanted}{خوابیده‌مشکی}
-\setinterfacevariable{bookmark}{چوبخط}
-\setinterfacevariable{both}{هردو}
-\setinterfacevariable{bothtext}{bothtext}
-\setinterfacevariable{bottom}{پایین}
-\setinterfacevariable{box}{box}
-\setinterfacevariable{brief}{مختصر}
-\setinterfacevariable{broad}{گسترده}
-\setinterfacevariable{buffer}{باÙر}
-\setinterfacevariable{by}{بوسیله}
-\setinterfacevariable{calligraphic}{خوشنویسی}
-\setinterfacevariable{camel}{camel}
-\setinterfacevariable{cap}{cap}
-\setinterfacevariable{capital}{capital}
-\setinterfacevariable{category}{category}
-\setinterfacevariable{cd:character}{cd:character}
-\setinterfacevariable{cd:font}{cd:font}
-\setinterfacevariable{center}{مرکز}
-\setinterfacevariable{centerlast}{centerlast}
-\setinterfacevariable{chapter}{Ùصل}
-\setinterfacevariable{character}{حرÙ}
-\setinterfacevariable{characters}{حرÙها}
-\setinterfacevariable{chemical}{chemical}
-\setinterfacevariable{chemicals}{chemicals}
-\setinterfacevariable{chemistry}{chemistry}
-\setinterfacevariable{cite}{cite}
-\setinterfacevariable{closed}{closed}
-\setinterfacevariable{color}{رنگ}
-\setinterfacevariable{column}{ستون}
-\setinterfacevariable{columns}{ستونها}
-\setinterfacevariable{combination}{combination}
-\setinterfacevariable{command}{Ùرمان}
-\setinterfacevariable{commands}{Ùرمانها}
-\setinterfacevariable{comment}{توضیح}
-\setinterfacevariable{component}{مولÙÙ‡}
-\setinterfacevariable{compressseparator}{compressseparator}
-\setinterfacevariable{compressstopper}{compressstopper}
-\setinterfacevariable{concept}{Ù…Ùهوم}
-\setinterfacevariable{construction}{construction}
-\setinterfacevariable{content}{محتوا}
-\setinterfacevariable{contents}{محتویات}
-\setinterfacevariable{continue}{ادامه}
-\setinterfacevariable{continued}{continued}
-\setinterfacevariable{controls}{کنترلها}
-\setinterfacevariable{conversion}{تبدیل}
-\setinterfacevariable{current}{جاری}
-\setinterfacevariable{cutspace}{Ùضای‌برش}
-\setinterfacevariable{dataset}{dataset}
-\setinterfacevariable{date}{تاریخ}
-\setinterfacevariable{day}{روز}
-\setinterfacevariable{december}{دسامبر}
-\setinterfacevariable{default}{پیش‌Ùرض}
-\setinterfacevariable{depth}{عمق}
-\setinterfacevariable{description}{شرح}
-\setinterfacevariable{disable}{ناتوان}
-\setinterfacevariable{display}{نمایش}
-\setinterfacevariable{dot}{نقطه}
-\setinterfacevariable{doublesided}{دورو}
-\setinterfacevariable{down}{down}
-\setinterfacevariable{each}{هر}
-\setinterfacevariable{edge}{لبه}
-\setinterfacevariable{effective}{effective}
-\setinterfacevariable{eight}{eight}
-\setinterfacevariable{embed}{embed}
-\setinterfacevariable{empty}{تهی}
-\setinterfacevariable{enable}{enable}
-\setinterfacevariable{end}{end}
-\setinterfacevariable{endnote}{ته‌نوشت}
-\setinterfacevariable{enumeration}{شماره‌بندی}
-\setinterfacevariable{environment}{محیط}
-\setinterfacevariable{even}{زوج}
-\setinterfacevariable{export}{export}
-\setinterfacevariable{external}{خارجی}
-\setinterfacevariable{extremestretch}{extremestretch}
-\setinterfacevariable{fact}{fact}
-\setinterfacevariable{fallback}{fallback}
-\setinterfacevariable{february}{Ùوریه}
-\setinterfacevariable{field}{field}
-\setinterfacevariable{figure}{Ø´Ú©Ù„}
-\setinterfacevariable{figures}{شکلها}
-\setinterfacevariable{file}{پرونده}
-\setinterfacevariable{final}{نهایی}
-\setinterfacevariable{first}{اولی}
-\setinterfacevariable{firstcolumn}{ستون‌اول}
-\setinterfacevariable{firstpage}{صÙحه‌اول}
-\setinterfacevariable{firstsubpage}{زیرصÙحه‌اول}
-\setinterfacevariable{fit}{پرکردن}
-\setinterfacevariable{five}{پنج}
-\setinterfacevariable{fix}{ثابت‌کن}
-\setinterfacevariable{fixed}{ثابت}
-\setinterfacevariable{flexible}{انعطاÙپذیر}
-\setinterfacevariable{float}{شناور}
-\setinterfacevariable{flushinner}{پمپ‌داخلی}
-\setinterfacevariable{flushleft}{پمپ‌چپ}
-\setinterfacevariable{flushouter}{پمپ‌خارجی}
-\setinterfacevariable{flushright}{پمپ‌راست}
-\setinterfacevariable{followingpage}{followingpage}
-\setinterfacevariable{font}{font}
-\setinterfacevariable{footer}{ته‌برگ}
-\setinterfacevariable{footnote}{پانوشت}
-\setinterfacevariable{force}{اجبار}
-\setinterfacevariable{foreground}{پیش‌زمینه}
-\setinterfacevariable{formula}{Ùرمول}
-\setinterfacevariable{formulas}{Ùرمولها}
-\setinterfacevariable{forward}{به‌جلو}
-\setinterfacevariable{four}{چهار}
-\setinterfacevariable{fractions}{fractions}
-\setinterfacevariable{frame}{قالب}
-\setinterfacevariable{framedtext}{متن‌قالبی}
-\setinterfacevariable{friday}{جمعه}
-\setinterfacevariable{frontmatter}{پیش‌مطلب}
-\setinterfacevariable{frontpart}{پیش‌قسمت}
-\setinterfacevariable{fullhz}{fullhz}
-\setinterfacevariable{global}{سراسری}
-\setinterfacevariable{graphic}{گراÙیک}
-\setinterfacevariable{graphics}{گراÙیکها}
-\setinterfacevariable{gray}{خاکستری}
-\setinterfacevariable{greek}{یونانی}
-\setinterfacevariable{grid}{توری}
-\setinterfacevariable{halfline}{نیم‌خط}
-\setinterfacevariable{handwritten}{دست‌نوشته}
-\setinterfacevariable{hang}{بیاویز}
-\setinterfacevariable{hanging}{آویزان}
-\setinterfacevariable{hangingboth}{hangingboth}
-\setinterfacevariable{head}{سر}
-\setinterfacevariable{header}{سربرگ}
-\setinterfacevariable{headintext}{headintext}
-\setinterfacevariable{height}{ارتÙاع}
-\setinterfacevariable{helptext}{متن‌کمکی}
-\setinterfacevariable{hencefore}{hencefore}
-\setinterfacevariable{here}{اینجا}
-\setinterfacevariable{hereafter}{ازاین‌به‌بعد}
-\setinterfacevariable{hidden}{پنهانی}
-\setinterfacevariable{hiddenbar}{hiddenbar}
-\setinterfacevariable{hiding}{پنهان‌کردن}
-\setinterfacevariable{high}{بلند}
-\setinterfacevariable{horizontal}{اÙÙ‚ÛŒ}
-\setinterfacevariable{hyphenated}{شکسته}
-\setinterfacevariable{hz}{hz}
-\setinterfacevariable{inbetween}{دربین}
-\setinterfacevariable{index}{نمایه}
-\setinterfacevariable{indices}{نمایه‌ها}
-\setinterfacevariable{inherit}{ارث‌بردن}
-\setinterfacevariable{ininner}{درداخلی}
-\setinterfacevariable{ininneredge}{ininneredge}
-\setinterfacevariable{ininnermargin}{ininnermargin}
-\setinterfacevariable{inleft}{درون‌چپ}
-\setinterfacevariable{inleftedge}{درلبه‌چپ}
-\setinterfacevariable{inleftmargin}{درحاشیه‌چپ}
-\setinterfacevariable{inline}{inline}
-\setinterfacevariable{inmargin}{درون‌حاشیه}
-\setinterfacevariable{inner}{داخلی}
-\setinterfacevariable{inneredge}{لبه‌داخلی}
-\setinterfacevariable{innermargin}{حاشیه‌داخلی}
-\setinterfacevariable{inother}{inother}
-\setinterfacevariable{inouter}{درخارجی}
-\setinterfacevariable{inouteredge}{inouteredge}
-\setinterfacevariable{inoutermargin}{inoutermargin}
-\setinterfacevariable{inright}{درون‌راست}
-\setinterfacevariable{inrightedge}{درلبه‌راست}
-\setinterfacevariable{inrightmargin}{درحاشیه‌راست}
-\setinterfacevariable{integral}{integral}
-\setinterfacevariable{interaction}{پانل}
-\setinterfacevariable{interactionmenu}{منوی‌پانل}
-\setinterfacevariable{interactive}{interactive}
-\setinterfacevariable{intermezzi}{میان‌پرده‌ها}
-\setinterfacevariable{intermezzo}{میان‌پرده}
-\setinterfacevariable{intext}{درون‌متن}
-\setinterfacevariable{intro}{پیشگÙتار}
-\setinterfacevariable{invertedshort}{invertedshort}
-\setinterfacevariable{italic}{ایتالیک}
-\setinterfacevariable{italicbold}{مشکی‌ایتالیک}
-\setinterfacevariable{item}{آیتم}
-\setinterfacevariable{itemize}{آیتم‌بندی}
-\setinterfacevariable{its}{آیم}
-\setinterfacevariable{january}{ژانویه}
-\setinterfacevariable{joinedup}{متصل‌بالا}
-\setinterfacevariable{july}{ژولای}
-\setinterfacevariable{june}{ژوئن}
-\setinterfacevariable{keep}{نگهدار}
-\setinterfacevariable{kerncharacters}{kerncharacters}
-\setinterfacevariable{knockout}{knockout}
-\setinterfacevariable{label}{برچسب}
-\setinterfacevariable{landscape}{صÙحه‌گسترده}
-\setinterfacevariable{last}{آخرین}
-\setinterfacevariable{lastcolumn}{آخرین‌ستون}
-\setinterfacevariable{lastpage}{صÙحه‌آخر}
-\setinterfacevariable{lastpagenumber}{شماه‌صÙحه‌آخر}
-\setinterfacevariable{lastsubpage}{زیرصÙحه‌آخر}
-\setinterfacevariable{layer}{layer}
-\setinterfacevariable{left}{Ú†Ù¾}
-\setinterfacevariable{leftedge}{لبه‌چپ}
-\setinterfacevariable{lefthanging}{آویزان‌چپ}
-\setinterfacevariable{leftmargin}{حاشیه‌چپ}
-\setinterfacevariable{leftpage}{صÙحه‌چپ}
-\setinterfacevariable{lefttoright}{lefttoright}
-\setinterfacevariable{legend}{راهنما}
-\setinterfacevariable{less}{less}
-\setinterfacevariable{lesshyphenation}{شکست‌کلمات‌کمتر}
-\setinterfacevariable{letterspacing}{letterspacing}
-\setinterfacevariable{line}{خط}
-\setinterfacevariable{linenote}{خط‌نوشت}
-\setinterfacevariable{lines}{خطها}
-\setinterfacevariable{linked}{linked}
-\setinterfacevariable{list}{لیست}
-\setinterfacevariable{local}{موضعی}
-\setinterfacevariable{localenvironment}{محیط‌موضعی}
-\setinterfacevariable{logo}{آرم}
-\setinterfacevariable{logos}{آرمها}
-\setinterfacevariable{lohi}{پابا}
-\setinterfacevariable{long}{long}
-\setinterfacevariable{loose}{شل}
-\setinterfacevariable{low}{پایین}
-\setinterfacevariable{ls}{ls}
-\setinterfacevariable{makeup}{آرایش}
-\setinterfacevariable{mar}{حاش}
-\setinterfacevariable{march}{مارس}
-\setinterfacevariable{margin}{حاشیه}
-\setinterfacevariable{marginedge}{لبه‌حاشیه}
-\setinterfacevariable{margintext}{متن‌حاشیه}
-\setinterfacevariable{margintitle}{عنوان‌حاشیه}
-\setinterfacevariable{marking}{نشانه‌گذاری}
-\setinterfacevariable{math}{math}
-\setinterfacevariable{mathalignment}{تنظیم‌ریاضی}
-\setinterfacevariable{mathcases}{حالتهای‌ریاضی}
-\setinterfacevariable{mathematics}{ریاضی}
-\setinterfacevariable{mathmatrix}{ماتریش‌ریاضی}
-\setinterfacevariable{max}{بیشترین}
-\setinterfacevariable{maxdepth}{maxdepth}
-\setinterfacevariable{maxheight}{maxheight}
-\setinterfacevariable{maxwidth}{maxwidth}
-\setinterfacevariable{may}{مه}
-\setinterfacevariable{mediaeval}{mediaeval}
-\setinterfacevariable{medium}{متوسط}
-\setinterfacevariable{middle}{میان}
-\setinterfacevariable{min}{کمترین}
-\setinterfacevariable{mindepth}{mindepth}
-\setinterfacevariable{minheight}{کمترین‌ارتÙاع}
-\setinterfacevariable{minwidth}{کمترین‌عرض}
-\setinterfacevariable{mirrored}{منعکس}
-\setinterfacevariable{mixed}{mixed}
-\setinterfacevariable{monday}{دوشنبه}
-\setinterfacevariable{mono}{مونو}
-\setinterfacevariable{monobold}{monobold}
-\setinterfacevariable{mononormal}{mononormal}
-\setinterfacevariable{month}{ماه}
-\setinterfacevariable{more}{more}
-\setinterfacevariable{morehyphenation}{شکست‌کلمات‌بیشتر}
-\setinterfacevariable{name}{نام}
-\setinterfacevariable{narrow}{نازک}
-\setinterfacevariable{negative}{منÙÛŒ}
-\setinterfacevariable{never}{هیچگاه}
-\setinterfacevariable{new}{جدید}
-\setinterfacevariable{next}{بعدی}
-\setinterfacevariable{nextevenpage}{صÙحه‌زوج‌بعدی}
-\setinterfacevariable{nextoddpage}{صÙحه‌Ùردبعدی}
-\setinterfacevariable{nextpage}{صÙحه‌بعدی}
-\setinterfacevariable{nextsubpage}{زیرصÙحه‌بعدی}
-\setinterfacevariable{nine}{nine}
-\setinterfacevariable{no}{نه}
-\setinterfacevariable{nocheck}{بدون‌بررسی}
-\setinterfacevariable{nodepth}{nodepth}
-\setinterfacevariable{nofit}{بدون‌پرکردن}
-\setinterfacevariable{nogrid}{بدون‌توری}
-\setinterfacevariable{noheight}{noheight}
-\setinterfacevariable{nohz}{nohz}
-\setinterfacevariable{noline}{noline}
-\setinterfacevariable{nomarking}{بدون‌نشانه‌گذاری}
-\setinterfacevariable{nomenubar}{nomenubar}
-\setinterfacevariable{none}{هیچکدام}
-\setinterfacevariable{nonumber}{بدون‌شماره}
-\setinterfacevariable{norepeat}{norepeat}
-\setinterfacevariable{normal}{نرمال}
-\setinterfacevariable{normalshort}{normalshort}
-\setinterfacevariable{nospacing}{بدون‌Ùضاگذاری}
-\setinterfacevariable{nostopper}{nostopper}
-\setinterfacevariable{not}{بدون}
-\setinterfacevariable{notation}{notation}
-\setinterfacevariable{note}{note}
-\setinterfacevariable{nothanging}{بدون‌آویزان‌کردن}
-\setinterfacevariable{nothyphenated}{بدون‌شکست}
-\setinterfacevariable{notjoinedup}{notjoinedup}
-\setinterfacevariable{november}{نوامبر}
-\setinterfacevariable{nowhere}{هیچ‌حا}
-\setinterfacevariable{nowhite}{سÙید‌نه}
-\setinterfacevariable{number}{شماره}
-\setinterfacevariable{numbers}{شماره‌ها}
-\setinterfacevariable{october}{اکتبر}
-\setinterfacevariable{odd}{Ùرد}
-\setinterfacevariable{off}{خاموش}
-\setinterfacevariable{offset}{Ø¢Ùست}
-\setinterfacevariable{old}{قدیمی}
-\setinterfacevariable{oldstyle}{oldstyle}
-\setinterfacevariable{on}{روی}
-\setinterfacevariable{one}{یک}
-\setinterfacevariable{opposite}{مخالÙ}
-\setinterfacevariable{ordinal}{ordinal}
-\setinterfacevariable{outer}{خارجی}
-\setinterfacevariable{outeredge}{لبه‌خارجی}
-\setinterfacevariable{outermargin}{حاشیه‌خارجی}
-\setinterfacevariable{overbar}{میله‌رو}
-\setinterfacevariable{overbars}{میله‌ها‌رو}
-\setinterfacevariable{overlay}{پوشش}
-\setinterfacevariable{overprint}{overprint}
-\setinterfacevariable{overstrike}{خط‌زدن}
-\setinterfacevariable{overstrikes}{خط‌زدنها}
-\setinterfacevariable{packed}{Ùشرده}
-\setinterfacevariable{page}{صÙحه}
-\setinterfacevariable{pagecomment}{توضیح‌صÙحه}
-\setinterfacevariable{pagenumber}{شماره‌صÙحه}
-\setinterfacevariable{paper}{برگ}
-\setinterfacevariable{paragraph}{پاراگراÙ}
-\setinterfacevariable{part}{قسمت}
-\setinterfacevariable{positive}{مثبت}
-\setinterfacevariable{postponing}{تاخیر}
-\setinterfacevariable{postscript}{پست‌اسکریپت}
-\setinterfacevariable{precedingpage}{precedingpage}
-\setinterfacevariable{preference}{ترجیح}
-\setinterfacevariable{preview}{پیش‌دید}
-\setinterfacevariable{previous}{قبلی}
-\setinterfacevariable{previousevenpage}{صÙحه‌زوج‌قبلی}
-\setinterfacevariable{previousoddpage}{صÙحه‌Ùردقبلی}
-\setinterfacevariable{previouspage}{صÙحه‌قبلی}
-\setinterfacevariable{previoussubpage}{زیرصÙحه‌قبلی}
-\setinterfacevariable{print}{print}
-\setinterfacevariable{printable}{قابل‌چاپ}
-\setinterfacevariable{process}{پردازش}
-\setinterfacevariable{product}{محصول}
-\setinterfacevariable{program}{برنامه}
-\setinterfacevariable{project}{پروژه}
-\setinterfacevariable{protected}{Ø­Ùاظت‌شده}
-\setinterfacevariable{quadruple}{quadruple}
-\setinterfacevariable{quarterline}{quarterline}
-\setinterfacevariable{quotation}{نقل‌قول}
-\setinterfacevariable{quote}{نقل}
-\setinterfacevariable{ran}{برد}
-\setinterfacevariable{random}{تصادÙÛŒ}
-\setinterfacevariable{readonly}{تنهاخواندنی}
-\setinterfacevariable{rectangular}{چهارگوشه}
-\setinterfacevariable{reference}{مرجع}
-\setinterfacevariable{referral}{مراجعه}
-\setinterfacevariable{region}{region}
-\setinterfacevariable{register}{ثبت}
-\setinterfacevariable{regular}{منظم}
-\setinterfacevariable{relative}{نسبی}
-\setinterfacevariable{repeat}{تکرار}
-\setinterfacevariable{required}{موردنیاز}
-\setinterfacevariable{reset}{بازنشانی}
-\setinterfacevariable{reverse}{برعکس}
-\setinterfacevariable{right}{راست}
-\setinterfacevariable{rightedge}{لبه‌راست}
-\setinterfacevariable{righthanging}{آویزان‌کردن‌راست}
-\setinterfacevariable{rightmargin}{حاشیه‌راست}
-\setinterfacevariable{rightpage}{صÙحه‌راست}
-\setinterfacevariable{righttoleft}{righttoleft}
-\setinterfacevariable{roman}{رومن}
-\setinterfacevariable{romannumerals}{شماره‌لاتین}
-\setinterfacevariable{rotate}{دوران}
-\setinterfacevariable{rotated}{دوران‌یاÙته}
-\setinterfacevariable{round}{گرد}
-\setinterfacevariable{row}{سطر}
-\setinterfacevariable{rule}{خط}
-\setinterfacevariable{samepage}{همان‌صÙحه}
-\setinterfacevariable{sans}{سانز}
-\setinterfacevariable{sansbold}{مشکی‌سانز}
-\setinterfacevariable{sansnormal}{sansnormal}
-\setinterfacevariable{sansserif}{سانزسریÙ}
-\setinterfacevariable{saturday}{شنبه}
-\setinterfacevariable{screen}{پرده}
-\setinterfacevariable{section}{بخش}
-\setinterfacevariable{sectionblockenvironment}{محیط‌بلوک‌بخش}
-\setinterfacevariable{sectionnumber}{شماره‌بخش}
-\setinterfacevariable{see}{ببینید}
-\setinterfacevariable{selectfont}{selectfont}
-\setinterfacevariable{separator}{separator}
-\setinterfacevariable{september}{سپتامبر}
-\setinterfacevariable{serif}{سریÙ}
-\setinterfacevariable{serifbold}{serifbold}
-\setinterfacevariable{serifnormal}{serifnormal}
-\setinterfacevariable{serried}{تنگ‌هم}
-\setinterfacevariable{setups}{setups}
-\setinterfacevariable{seven}{seven}
-\setinterfacevariable{sheet}{ورقه}
-\setinterfacevariable{shiftdown}{shiftdown}
-\setinterfacevariable{shiftup}{shiftup}
-\setinterfacevariable{short}{short}
-\setinterfacevariable{simplefonts}{simplefonts}
-\setinterfacevariable{simplelist}{simplelist}
-\setinterfacevariable{singlesided}{یک‌رو}
-\setinterfacevariable{six}{six}
-\setinterfacevariable{slanted}{خوابیده}
-\setinterfacevariable{slantedbold}{مشکی‌خوابیده}
-\setinterfacevariable{small}{Ú©ÙˆÚ†Ú©}
-\setinterfacevariable{smallbodyfont}{قلم‌بدنه‌کوچک}
-\setinterfacevariable{smallbold}{مشکی‌کوچک}
-\setinterfacevariable{smallbolditalic}{ایتالیک‌مشکی‌کوچک}
-\setinterfacevariable{smallboldslanted}{خوابیده‌مشکی‌کوچک}
-\setinterfacevariable{smallcaps}{smallcaps}
-\setinterfacevariable{smaller}{smaller}
-\setinterfacevariable{smallitalic}{ایتالیک‌کوچک}
-\setinterfacevariable{smallitalicbold}{مشکی‌ایتالیک‌کوچک}
-\setinterfacevariable{smallnormal}{نرمال‌کوچک}
-\setinterfacevariable{smallslanted}{خوابیده‌کوچک}
-\setinterfacevariable{smallslantedbold}{مشکی‌خوابیده‌کوچک}
-\setinterfacevariable{smalltype}{تایپ‌کوچک}
-\setinterfacevariable{somewhere}{جایی}
-\setinterfacevariable{sorted}{مرتب}
-\setinterfacevariable{sorting}{sorting}
-\setinterfacevariable{space}{Ùضا}
-\setinterfacevariable{spacing}{Ùضاگذاری}
-\setinterfacevariable{speech}{سخنرانی}
-\setinterfacevariable{split}{شکاÙتن}
-\setinterfacevariable{spot}{Ù„Ú©Ù‡}
-\setinterfacevariable{standard}{استاندارد}
-\setinterfacevariable{start}{شروع}
-\setinterfacevariable{starter}{starter}
-\setinterfacevariable{sticker}{دشنه}
-\setinterfacevariable{stop}{پایان}
-\setinterfacevariable{stopper}{ایست}
-\setinterfacevariable{stretch}{بکش}
-\setinterfacevariable{stretched}{stretched}
-\setinterfacevariable{strict}{اکید}
-\setinterfacevariable{strong}{محکم}
-\setinterfacevariable{strut}{بست}
-\setinterfacevariable{sub}{زیر}
-\setinterfacevariable{subbackward}{زیرعقب‌گرد}
-\setinterfacevariable{subformula}{زیرÙرمول}
-\setinterfacevariable{subforward}{زیرجلوگرد}
-\setinterfacevariable{subject}{موضوع}
-\setinterfacevariable{subpage}{زیرصÙحه}
-\setinterfacevariable{subs}{subs}
-\setinterfacevariable{subsection}{زیربخش}
-\setinterfacevariable{subsubject}{زیرموضوع}
-\setinterfacevariable{subsubsection}{زیرزیربخش}
-\setinterfacevariable{subsubsubject}{زیرزیرموضوع}
-\setinterfacevariable{subsubsubsection}{زیرزیرزیربخش}
-\setinterfacevariable{subsubsubsubject}{زیرزیرزیرموضوع}
-\setinterfacevariable{subsubsubsubsection}{زیرزیرزیرزیربخش}
-\setinterfacevariable{subsubsubsubsubject}{زیرزیرزیرزیرموضوع}
-\setinterfacevariable{subsubsubsubsubsection}{زیرزیرزیرزیرزیربخش}
-\setinterfacevariable{subsubsubsubsubsubject}{زیرزیرزیرزیرزیرموضوع}
-\setinterfacevariable{subsubsubsubsubsubsection}{زیرزیرزیرزیرزیرزیربخش}
-\setinterfacevariable{subsubsubsubsubsubsubject}{زیرزیرزیرزیرزیرزیرموضوع}
-\setinterfacevariable{subsubsubsubsubsubsubsection}{زیرزیرزیرزیرزیرزیرزیربخش}
-\setinterfacevariable{subsubsubsubsubsubsubsubject}{زیرزیرزیرزیرزیرزیرزیرموضوع}
-\setinterfacevariable{subsubsubsubsubsubsubsubsection}{زیرزیرزیرزیرزیرزیرزیرزیربخش}
-\setinterfacevariable{subsubsubsubsubsubsubsubsubject}{زیرزیرزیرزیرزیرزیرزیرزیرموضوع}
-\setinterfacevariable{subsubsubsubsubsubsubsubsubsection}{زیرزیرزیرزیرزیرزیرزیرزیرزیربخش}
-\setinterfacevariable{subsubsubsubsubsubsubsubsubsubject}{زیرزیرزیرزیرزیرزیرزیرزیرزیرموضوع}
-\setinterfacevariable{sunday}{یک‌شنبه}
-\setinterfacevariable{support}{حمایت}
-\setinterfacevariable{sym}{نم}
-\setinterfacevariable{symbol}{نماد}
-\setinterfacevariable{synchronize}{تطابق}
-\setinterfacevariable{synonym}{synonym}
-\setinterfacevariable{system}{سیستم}
-\setinterfacevariable{table}{جدول}
-\setinterfacevariable{tablehead}{سرجدول}
-\setinterfacevariable{tables}{جدولها}
-\setinterfacevariable{tabletail}{دنباله‌جدول}
-\setinterfacevariable{tabulate}{جدول‌بندی}
-\setinterfacevariable{tabulatehead}{سرجدول‌بندی}
-\setinterfacevariable{tabulatetail}{دنباله‌جدول‌بندی}
-\setinterfacevariable{tall}{دراز}
-\setinterfacevariable{teletype}{دورنگاره}
-\setinterfacevariable{temporary}{موقتی}
-\setinterfacevariable{test}{تست}
-\setinterfacevariable{text}{متن}
-\setinterfacevariable{textnote}{textnote}
-\setinterfacevariable{three}{سه}
-\setinterfacevariable{thursday}{پنج‌شنبه}
-\setinterfacevariable{tight}{tight}
-\setinterfacevariable{title}{عنوان}
-\setinterfacevariable{toggle}{تغییر}
-\setinterfacevariable{tolerant}{بردبار}
-\setinterfacevariable{top}{بالا}
-\setinterfacevariable{tuesday}{سه‌شنبه}
-\setinterfacevariable{two}{دو}
-\setinterfacevariable{txt}{txt}
-\setinterfacevariable{type}{تایپ}
-\setinterfacevariable{typing}{تایپ‌کردن}
-\setinterfacevariable{unavailable}{غیرموجود}
-\setinterfacevariable{underbar}{میله‌زیر}
-\setinterfacevariable{underbars}{میله‌‌های‌زیر}
-\setinterfacevariable{understrike}{understrike}
-\setinterfacevariable{understrikes}{understrikes}
-\setinterfacevariable{unframed}{unframed}
-\setinterfacevariable{unicode}{unicode}
-\setinterfacevariable{unit}{واحد}
-\setinterfacevariable{units}{واحدها}
-\setinterfacevariable{unknown}{ناشناس}
-\setinterfacevariable{unpacked}{غیرÙشرده}
-\setinterfacevariable{up}{up}
-\setinterfacevariable{url}{url}
-\setinterfacevariable{used}{استÙاده‌شده}
-\setinterfacevariable{value}{مقدار}
-\setinterfacevariable{vertical}{عمودی}
-\setinterfacevariable{very}{خیلی}
-\setinterfacevariable{verystrict}{خیلی‌سختگیر}
-\setinterfacevariable{verytolerant}{خیلی‌بردبار}
-\setinterfacevariable{vfenced}{vfenced}
-\setinterfacevariable{vulgarfraction}{vulgarfraction}
-\setinterfacevariable{weak}{Ù‡Ùته}
-\setinterfacevariable{wednesday}{چهارشنبه}
-\setinterfacevariable{week}{Ù‡Ùته}
-\setinterfacevariable{weekday}{روزهÙته}
-\setinterfacevariable{white}{سÙید}
-\setinterfacevariable{wide}{گسترده}
-\setinterfacevariable{width}{عرض}
-\setinterfacevariable{word}{word}
-\setinterfacevariable{words}{words}
-\setinterfacevariable{xml}{xml}
-\setinterfacevariable{year}{سال}
-\setinterfacevariable{yes}{بله}
-% definitions for interface constants for language pe
-%
-\setinterfaceconstant{action}{کنش}
-\setinterfaceconstant{address}{نشانی}
-\setinterfaceconstant{after}{بعداز}
-\setinterfaceconstant{afterhead}{بعدازسر}
-\setinterfaceconstant{afterkey}{بعدازکلید}
-\setinterfaceconstant{aftersection}{aftersection}
-\setinterfaceconstant{align}{تنظیم}
-\setinterfaceconstant{alignbottom}{alignbottom}
-\setinterfaceconstant{aligncharacter}{حرÙ‌تنظیم}
-\setinterfaceconstant{alignmentcharacter}{حرÙ‌تنظیم‌کردن}
-\setinterfaceconstant{alignmentleftsample}{alignmentleftsample}
-\setinterfaceconstant{alignmentleftwidth}{alignmentleftwidth}
-\setinterfaceconstant{alignmentrightsample}{alignmentrightsample}
-\setinterfaceconstant{alignmentrightwidth}{alignmentrightwidth}
-\setinterfaceconstant{alignsymbol}{alignsymbol}
-\setinterfaceconstant{aligntitle}{عنوان‌تنظیم}
-\setinterfaceconstant{alternative}{جایگزین}
-\setinterfaceconstant{anchor}{anchor}
-\setinterfaceconstant{anchoring}{anchoring}
-\setinterfaceconstant{andtext}{andtext}
-\setinterfaceconstant{apa}{apa}
-\setinterfaceconstant{arguments}{arguments}
-\setinterfaceconstant{arrow}{پیکان}
-\setinterfaceconstant{artauthor}{artauthor}
-\setinterfaceconstant{artauthoretaldisplay}{artauthoretaldisplay}
-\setinterfaceconstant{artauthoretallimit}{artauthoretallimit}
-\setinterfaceconstant{artauthoretaltext}{artauthoretaltext}
-\setinterfaceconstant{artoffset}{artoffset}
-\setinterfaceconstant{at}{در}
-\setinterfaceconstant{author}{نویسنده}
-\setinterfaceconstant{authorconversion}{authorconversion}
-\setinterfaceconstant{authoretaldisplay}{authoretaldisplay}
-\setinterfaceconstant{authoretallimit}{authoretallimit}
-\setinterfaceconstant{authoretaltext}{authoretaltext}
-\setinterfaceconstant{auto}{خودکار}
-\setinterfaceconstant{autocase}{autocase}
-\setinterfaceconstant{autofile}{پرونده‌خودکار}
-\setinterfaceconstant{autofocus}{تمرکز‌خودکار}
-\setinterfaceconstant{autohang}{آویزان‌خودکار}
-\setinterfaceconstant{autostrut}{بست‌خودکار}
-\setinterfaceconstant{autowidth}{عرض‌خودکار}
-\setinterfaceconstant{availableheight}{availableheight}
-\setinterfaceconstant{availablewidth}{availablewidth}
-\setinterfaceconstant{axis}{محورها}
-\setinterfaceconstant{background}{پس‌زمینه}
-\setinterfaceconstant{backgroundcolor}{رنگ‌پس‌زمینه}
-\setinterfaceconstant{backgroundcorner}{گوشه‌پس‌زمینه}
-\setinterfaceconstant{backgrounddepth}{عمق‌پس‌زمینه}
-\setinterfaceconstant{backgroundoffset}{Ø¢Ùست‌پس‌زمینه}
-\setinterfaceconstant{backgroundradius}{شعاع‌پس‌زمینه}
-\setinterfaceconstant{backgroundscreen}{پرده‌پس‌زمینه}
-\setinterfaceconstant{backreference}{backreference}
-\setinterfaceconstant{backspace}{Ùضای‌پس}
-\setinterfaceconstant{balance}{تعادل}
-\setinterfaceconstant{before}{قبل‌از}
-\setinterfaceconstant{beforehead}{قبل‌ازسر}
-\setinterfaceconstant{beforesection}{beforesection}
-\setinterfaceconstant{bet}{bet}
-\setinterfaceconstant{bidi}{bidi}
-\setinterfaceconstant{big}{بزرگ}
-\setinterfaceconstant{blank}{خالی}
-\setinterfaceconstant{bleedoffset}{bleedoffset}
-\setinterfaceconstant{blockway}{راه‌بلوک}
-\setinterfaceconstant{bodyfont}{قلم‌بدنه}
-\setinterfaceconstant{boffset}{boffset}
-\setinterfaceconstant{boldfeatures}{boldfeatures}
-\setinterfaceconstant{boldfont}{boldfont}
-\setinterfaceconstant{bolditalicfeatures}{bolditalicfeatures}
-\setinterfaceconstant{bolditalicfont}{bolditalicfont}
-\setinterfaceconstant{boldslantedfeatures}{boldslantedfeatures}
-\setinterfaceconstant{boldslantedfont}{boldslantedfont}
-\setinterfaceconstant{bookmark}{چوبخط}
-\setinterfaceconstant{bottom}{پایین}
-\setinterfaceconstant{bottomafter}{bottomafter}
-\setinterfaceconstant{bottombefore}{bottombefore}
-\setinterfaceconstant{bottomcommand}{bottomcommand}
-\setinterfaceconstant{bottomdistance}{Ùاصله‌پایین}
-\setinterfaceconstant{bottomframe}{قالب‌پایین}
-\setinterfaceconstant{bottomoffset}{Ø¢Ùست‌پایین}
-\setinterfaceconstant{bottomspace}{Ùضای‌پایین}
-\setinterfaceconstant{bottomstate}{وضعیت‌پایین}
-\setinterfaceconstant{break}{break}
-\setinterfaceconstant{buffer}{buffer}
-\setinterfaceconstant{cache}{میانگیر}
-\setinterfaceconstant{calculate}{محاسبه}
-\setinterfaceconstant{category}{category}
-\setinterfaceconstant{ccommand}{Ùرمان}
-\setinterfaceconstant{character}{character}
-\setinterfaceconstant{characters}{characters}
-\setinterfaceconstant{check}{check}
-\setinterfaceconstant{click}{Ùشردن}
-\setinterfaceconstant{clickin}{Ùشردن‌داخل}
-\setinterfaceconstant{clickout}{Ùشردن‌خارج}
-\setinterfaceconstant{clipoffset}{Ø¢Ùست‌کلیپ}
-\setinterfaceconstant{closeaction}{بستن‌کنش}
-\setinterfaceconstant{closecommand}{بستن‌Ùرمان}
-\setinterfaceconstant{closepage}{closepage}
-\setinterfaceconstant{closepageaction}{بستن‌عمل‌صÙحه}
-\setinterfaceconstant{closesymbol}{بستن‌نماد}
-\setinterfaceconstant{color}{رنگ}
-\setinterfaceconstant{column}{ستون}
-\setinterfaceconstant{columndistance}{Ùاصله‌ستون}
-\setinterfaceconstant{columns}{ستونها}
-\setinterfaceconstant{comma}{comma}
-\setinterfaceconstant{command}{Ùرمان}
-\setinterfaceconstant{commandafter}{Ùرمان‌بعداز}
-\setinterfaceconstant{commandbefore}{Ùرمان‌قبل‌از}
-\setinterfaceconstant{commands}{Ùرمانها}
-\setinterfaceconstant{comment}{comment}
-\setinterfaceconstant{commentchar}{commentchar}
-\setinterfaceconstant{commentoffset}{commentoffset}
-\setinterfaceconstant{compact}{compact}
-\setinterfaceconstant{component}{مولÙÙ‡}
-\setinterfaceconstant{compoundhyphen}{compoundhyphen}
-\setinterfaceconstant{compress}{Ùشردن}
-\setinterfaceconstant{compressdistance}{compressdistance}
-\setinterfaceconstant{compressmethod}{compressmethod}
-\setinterfaceconstant{compressseparator}{compressseparator}
-\setinterfaceconstant{compressstopper}{compressstopper}
-\setinterfaceconstant{concerns}{concerns}
-\setinterfaceconstant{connector}{connector}
-\setinterfaceconstant{continue}{ادامه}
-\setinterfaceconstant{contrastcolor}{contrastcolor}
-\setinterfaceconstant{controls}{کنترلها}
-\setinterfaceconstant{conversion}{تبدیل}
-\setinterfaceconstant{convertfile}{پرونده‌تبدیل}
-\setinterfaceconstant{copies}{copies}
-\setinterfaceconstant{corner}{گوشه}
-\setinterfaceconstant{coupling}{تزویج}
-\setinterfaceconstant{couplingway}{روش‌تزویج}
-\setinterfaceconstant{criterium}{criterium}
-\setinterfaceconstant{cropoffset}{cropoffset}
-\setinterfaceconstant{crossreference}{crossreference}
-\setinterfaceconstant{cssfile}{cssfile}
-\setinterfaceconstant{current}{جاری}
-\setinterfaceconstant{cutspace}{Ùضای‌برش}
-\setinterfaceconstant{dash}{دش}
-\setinterfaceconstant{dat}{dat}
-\setinterfaceconstant{database}{database}
-\setinterfaceconstant{dataset}{dataset}
-\setinterfaceconstant{date}{تاریخ}
-\setinterfaceconstant{deepnumbercommand}{Ùرمان‌شماره‌عمیق}
-\setinterfaceconstant{deeptextcommand}{Ùرمان‌متن‌عمیق}
-\setinterfaceconstant{default}{پیش‌Ùرض}
-\setinterfaceconstant{defaultheight}{defaultheight}
-\setinterfaceconstant{defaultwidth}{defaultwidth}
-\setinterfaceconstant{define}{define}
-\setinterfaceconstant{delay}{تاخیر}
-\setinterfaceconstant{depth}{عمق}
-\setinterfaceconstant{depthcorrection}{تصحیح‌عمق}
-\setinterfaceconstant{direction}{جهت}
-\setinterfaceconstant{directory}{پوشه}
-\setinterfaceconstant{display}{نمایش}
-\setinterfaceconstant{displaythreshold}{displaythreshold}
-\setinterfaceconstant{distance}{Ùاصله}
-\setinterfaceconstant{domain}{domain}
-\setinterfaceconstant{dot}{نقطه}
-\setinterfaceconstant{doublesided}{دورو}
-\setinterfaceconstant{down}{down}
-\setinterfaceconstant{dummy}{مصنوعی}
-\setinterfaceconstant{dx}{dx}
-\setinterfaceconstant{dy}{dy}
-\setinterfaceconstant{edge}{لبه}
-\setinterfaceconstant{edgedistance}{Ùاصله‌لبه}
-\setinterfaceconstant{editor}{editor}
-\setinterfaceconstant{editoretaldisplay}{editoretaldisplay}
-\setinterfaceconstant{editoretallimit}{editoretallimit}
-\setinterfaceconstant{editoretaltext}{editoretaltext}
-\setinterfaceconstant{empty}{تهی}
-\setinterfaceconstant{entities}{entities}
-\setinterfaceconstant{entries}{entries}
-\setinterfaceconstant{equalheight}{ارتÙاع‌یکسان}
-\setinterfaceconstant{equalwidth}{عرض‌یکسان}
-\setinterfaceconstant{escape}{Ùرار}
-\setinterfaceconstant{etaldisplay}{etaldisplay}
-\setinterfaceconstant{etallimit}{etallimit}
-\setinterfaceconstant{etaloption}{etaloption}
-\setinterfaceconstant{etaltext}{etaltext}
-\setinterfaceconstant{evenmargin}{حاشیه‌زوج}
-\setinterfaceconstant{exact}{exact}
-\setinterfaceconstant{exitoffset}{exitoffset}
-\setinterfaceconstant{expansion}{گسترش}
-\setinterfaceconstant{export}{export}
-\setinterfaceconstant{extras}{extras}
-\setinterfaceconstant{factor}{عامل}
-\setinterfaceconstant{fallback}{عقب‌ریختن}
-\setinterfaceconstant{fallbacks}{fallbacks}
-\setinterfaceconstant{family}{خانواده}
-\setinterfaceconstant{features}{features}
-\setinterfaceconstant{featureset}{featureset}
-\setinterfaceconstant{fences}{fences}
-\setinterfaceconstant{field}{field}
-\setinterfaceconstant{fieldbackgroundcolor}{رنگ‌پس‌زمینه‌میدان}
-\setinterfaceconstant{fieldframecolor}{رنگ‌قالب‌میدان}
-\setinterfaceconstant{fieldlayer}{لایه‌میدان}
-\setinterfaceconstant{fieldoffset}{Ø¢Ùست‌میدان}
-\setinterfaceconstant{file}{پرونده}
-\setinterfaceconstant{filler}{filler}
-\setinterfaceconstant{filter}{filter}
-\setinterfaceconstant{filtercommand}{filtercommand}
-\setinterfaceconstant{finalnamesep}{finalnamesep}
-\setinterfaceconstant{finalpagesep}{finalpagesep}
-\setinterfaceconstant{finalpubsep}{finalpubsep}
-\setinterfaceconstant{first}{اولی}
-\setinterfaceconstant{firstnamesep}{firstnamesep}
-\setinterfaceconstant{firstpage}{صÙحه‌اول}
-\setinterfaceconstant{focus}{تمرکز}
-\setinterfaceconstant{focusin}{تمرکزدرون}
-\setinterfaceconstant{focusoffset}{focusoffset}
-\setinterfaceconstant{focusout}{تمرکزبیرون}
-\setinterfaceconstant{font}{font}
-\setinterfaceconstant{footer}{ته‌برگ}
-\setinterfaceconstant{footerdistance}{Ùاصله‌ته‌برگ}
-\setinterfaceconstant{footerstate}{وضعیت‌ته‌برگ}
-\setinterfaceconstant{force}{اجبار}
-\setinterfaceconstant{foregroundcolor}{رنگ‌پیش‌زمینه}
-\setinterfaceconstant{foregroundstyle}{سبک‌پیش‌زمینه}
-\setinterfaceconstant{format}{شمایل}
-\setinterfaceconstant{fractions}{fractions}
-\setinterfaceconstant{frame}{قالب}
-\setinterfaceconstant{framecolor}{رنگ‌قالب}
-\setinterfaceconstant{framecorner}{گوشه‌قالب}
-\setinterfaceconstant{framedepth}{عمق‌قالب}
-\setinterfaceconstant{frameoffset}{Ø¢Ùست‌قالب}
-\setinterfaceconstant{frameradius}{شعاع‌قالب}
-\setinterfaceconstant{frames}{قالبها}
-\setinterfaceconstant{freeregion}{freeregion}
-\setinterfaceconstant{from}{از}
-\setinterfaceconstant{functioncolor}{functioncolor}
-\setinterfaceconstant{functionstyle}{functionstyle}
-\setinterfaceconstant{get}{بگیر}
-\setinterfaceconstant{global}{سراسری}
-\setinterfaceconstant{goodies}{goodies}
-\setinterfaceconstant{grid}{توری}
-\setinterfaceconstant{group}{group}
-\setinterfaceconstant{groupsuffix}{groupsuffix}
-\setinterfaceconstant{hang}{بیاویز}
-\setinterfaceconstant{hcompact}{hcompact}
-\setinterfaceconstant{headalign}{headalign}
-\setinterfaceconstant{headcolor}{رنگ‌سر}
-\setinterfaceconstant{headcommand}{Ùرمان‌سر}
-\setinterfaceconstant{headconversion}{تبدیل‌سر}
-\setinterfaceconstant{header}{سربرگ}
-\setinterfaceconstant{headerdistance}{Ùاصله‌سربرگ}
-\setinterfaceconstant{headerstate}{وضعیت‌سربرگ}
-\setinterfaceconstant{headlabel}{برچسب‌سر}
-\setinterfaceconstant{headnumber}{شماره‌سر}
-\setinterfaceconstant{headseparator}{headseparator}
-\setinterfaceconstant{headstyle}{سبک‌سر}
-\setinterfaceconstant{height}{ارتÙاع}
-\setinterfaceconstant{hfactor}{عامل‌ارتÙاع}
-\setinterfaceconstant{hfil}{پرکردن‌ارتÙاع}
-\setinterfaceconstant{hidenumber}{hidenumber}
-\setinterfaceconstant{hoffset}{Ø¢Ùست‌ا}
-\setinterfaceconstant{horizontal}{اÙÙ‚ÛŒ}
-\setinterfaceconstant{horoffset}{Ø¢Ùست‌اÙÙ‚}
-\setinterfaceconstant{hyphen}{شکستن}
-\setinterfaceconstant{hyphens}{hyphens}
-\setinterfaceconstant{icommand}{icommand}
-\setinterfaceconstant{ignore}{ignore}
-\setinterfaceconstant{in}{درون}
-\setinterfaceconstant{inbetween}{دربین}
-\setinterfaceconstant{increment}{اÙزایش}
-\setinterfaceconstant{incrementnumber}{شماره‌اÙزایش}
-\setinterfaceconstant{indenting}{تورÙتگی}
-\setinterfaceconstant{indentlist}{indentlist}
-\setinterfaceconstant{indentnext}{متن‌تورÙته}
-\setinterfaceconstant{index}{index}
-\setinterfaceconstant{indicator}{اندیکاتور}
-\setinterfaceconstant{initialsep}{initialsep}
-\setinterfaceconstant{inlinethreshold}{inlinethreshold}
-\setinterfaceconstant{inner}{داخلی}
-\setinterfaceconstant{innermargin}{حاشیه‌داخلی}
-\setinterfaceconstant{inputfile}{پرونده‌ورودی}
-\setinterfaceconstant{insidesection}{insidesection}
-\setinterfaceconstant{instance}{instance}
-\setinterfaceconstant{intent}{intent}
-\setinterfaceconstant{interaction}{پانل}
-\setinterfaceconstant{interlinespace}{Ùضای‌بین‌خط}
-\setinterfaceconstant{internalgrid}{internalgrid}
-\setinterfaceconstant{italicfeatures}{italicfeatures}
-\setinterfaceconstant{italicfont}{italicfont}
-\setinterfaceconstant{itemalign}{تنظیم‌آیتم}
-\setinterfaceconstant{items}{آیتمها}
-\setinterfaceconstant{joiners}{joiners}
-\setinterfaceconstant{journalconversion}{journalconversion}
-\setinterfaceconstant{juniorsep}{juniorsep}
-\setinterfaceconstant{keeptogether}{keeptogether}
-\setinterfaceconstant{ken}{ken}
-\setinterfaceconstant{keyexpansion}{گسترش‌کلید}
-\setinterfaceconstant{keys}{keys}
-\setinterfaceconstant{keyword}{کلید‌واژه}
-\setinterfaceconstant{label}{برچسب}
-\setinterfaceconstant{labelalternative}{labelalternative}
-\setinterfaceconstant{labelcolor}{labelcolor}
-\setinterfaceconstant{labeloffset}{labeloffset}
-\setinterfaceconstant{labelstyle}{labelstyle}
-\setinterfaceconstant{language}{language}
-\setinterfaceconstant{last}{last}
-\setinterfaceconstant{lastnamesep}{lastnamesep}
-\setinterfaceconstant{lastpage}{صÙحه‌آخر}
-\setinterfaceconstant{lastpagesep}{lastpagesep}
-\setinterfaceconstant{lastpubsep}{lastpubsep}
-\setinterfaceconstant{layout}{layout}
-\setinterfaceconstant{left}{Ú†Ù¾}
-\setinterfaceconstant{leftcolor}{رنگ‌چپ}
-\setinterfaceconstant{leftcompoundhyphen}{leftcompoundhyphen}
-\setinterfaceconstant{leftedge}{لبه‌چپ}
-\setinterfaceconstant{leftedgedistance}{Ùاصله‌لبه‌چپ}
-\setinterfaceconstant{leftframe}{قالب‌چپ}
-\setinterfaceconstant{lefthyphen}{شکست‌چپ}
-\setinterfaceconstant{leftmargin}{حاشیه‌چپ}
-\setinterfaceconstant{leftmargindistance}{Ùاصله‌حاشیه‌چپ}
-\setinterfaceconstant{leftoffset}{Ø¢Ùست‌چپ}
-\setinterfaceconstant{leftquotation}{نقل‌قول‌چپ}
-\setinterfaceconstant{leftquote}{نقل‌چپ}
-\setinterfaceconstant{leftsample}{leftsample}
-\setinterfaceconstant{leftsentence}{جمله‌چپ}
-\setinterfaceconstant{leftspeech}{سخنرانی‌چپ}
-\setinterfaceconstant{leftstyle}{سبک‌چپ}
-\setinterfaceconstant{leftsubsentence}{زیرجمله‌چپ}
-\setinterfaceconstant{lefttext}{متن‌چپ}
-\setinterfaceconstant{leftwidth}{عرض‌خط}
-\setinterfaceconstant{leftwords}{leftwords}
-\setinterfaceconstant{less}{less}
-\setinterfaceconstant{level}{مرحله}
-\setinterfaceconstant{levels}{مرحله‌ها}
-\setinterfaceconstant{limittext}{مرزمتن}
-\setinterfaceconstant{line}{خط}
-\setinterfaceconstant{linecorrection}{تصحیح‌خط}
-\setinterfaceconstant{linedirection}{linedirection}
-\setinterfaceconstant{lines}{خطها}
-\setinterfaceconstant{list}{لیست}
-\setinterfaceconstant{listtext}{متن‌لیست}
-\setinterfaceconstant{local}{موضعی}
-\setinterfaceconstant{location}{مکان}
-\setinterfaceconstant{loffset}{loffset}
-\setinterfaceconstant{logo}{آرم}
-\setinterfaceconstant{logos}{آرمها}
-\setinterfaceconstant{marcolor}{رنگ‌حاش}
-\setinterfaceconstant{margin}{حاشیه}
-\setinterfaceconstant{margindistance}{Ùاصله‌حاشیه}
-\setinterfaceconstant{marginedge}{لبه‌حاشیه}
-\setinterfaceconstant{marginedgetext}{متن‌لبه‌حاشیه}
-\setinterfaceconstant{margintext}{متن‌حاشیه}
-\setinterfaceconstant{mark}{mark}
-\setinterfaceconstant{marking}{نشانه‌گذاری}
-\setinterfaceconstant{marstyle}{سبک‌حاش}
-\setinterfaceconstant{mask}{mask}
-\setinterfaceconstant{mathclass}{mathclass}
-\setinterfaceconstant{mathlimits}{mathlimits}
-\setinterfaceconstant{mathstyle}{mathstyle}
-\setinterfaceconstant{max}{بیشترین}
-\setinterfaceconstant{maxdepth}{maxdepth}
-\setinterfaceconstant{maxheight}{بیشترین‌ارتÙاع}
-\setinterfaceconstant{maxwidth}{بیشترین‌عرض}
-\setinterfaceconstant{maybeyear}{maybeyear}
-\setinterfaceconstant{menu}{منو}
-\setinterfaceconstant{method}{روش}
-\setinterfaceconstant{middle}{میان}
-\setinterfaceconstant{middlecolor}{middlecolor}
-\setinterfaceconstant{middlecommand}{middlecommand}
-\setinterfaceconstant{middlespeech}{سخنرانی‌میانی}
-\setinterfaceconstant{middlestyle}{middlestyle}
-\setinterfaceconstant{middletext}{متن‌میانی}
-\setinterfaceconstant{middlewidth}{middlewidth}
-\setinterfaceconstant{midsentence}{جمله‌میانی}
-\setinterfaceconstant{min}{کمترین}
-\setinterfaceconstant{mindepth}{کمترین‌عمق}
-\setinterfaceconstant{minheight}{کمترین‌ارتÙاع}
-\setinterfaceconstant{minwidth}{کمترین‌عرض}
-\setinterfaceconstant{moffset}{moffset}
-\setinterfaceconstant{monthconversion}{monthconversion}
-\setinterfaceconstant{more}{more}
-\setinterfaceconstant{mpdepth}{mpdepth}
-\setinterfaceconstant{mpheight}{mpheight}
-\setinterfaceconstant{mpoffset}{mpoffset}
-\setinterfaceconstant{mpwidth}{mpwidth}
-\setinterfaceconstant{n}{n}
-\setinterfaceconstant{name}{نام}
-\setinterfaceconstant{namesep}{namesep}
-\setinterfaceconstant{nbottom}{nbottom}
-\setinterfaceconstant{nc}{nc}
-\setinterfaceconstant{next}{بعدی}
-\setinterfaceconstant{nextleft}{nextleft}
-\setinterfaceconstant{nextleftquotation}{nextleftquotation}
-\setinterfaceconstant{nextright}{nextright}
-\setinterfaceconstant{nextrightquotation}{nextrightquotation}
-\setinterfaceconstant{nl}{nl}
-\setinterfaceconstant{nleft}{nleft}
-\setinterfaceconstant{nlines}{nlines}
-\setinterfaceconstant{norm}{norm}
-\setinterfaceconstant{note}{note}
-\setinterfaceconstant{notes}{notes}
-\setinterfaceconstant{nr}{nr}
-\setinterfaceconstant{nright}{nright}
-\setinterfaceconstant{ntop}{ntop}
-\setinterfaceconstant{number}{شماره}
-\setinterfaceconstant{numberalign}{numberalign}
-\setinterfaceconstant{numbercolor}{رنگ‌شماره}
-\setinterfaceconstant{numbercommand}{Ùرمان‌شماره}
-\setinterfaceconstant{numberconversion}{numberconversion}
-\setinterfaceconstant{numberconversionset}{numberconversionset}
-\setinterfaceconstant{numberdistance}{Ùاصله‌شماره}
-\setinterfaceconstant{numbering}{شماره‌گذاری}
-\setinterfaceconstant{numberorder}{numberorder}
-\setinterfaceconstant{numberprefix}{numberprefix}
-\setinterfaceconstant{numbersegments}{numbersegments}
-\setinterfaceconstant{numberseparator}{جداکننده‌شماره}
-\setinterfaceconstant{numberseparatorset}{numberseparatorset}
-\setinterfaceconstant{numberset}{numberset}
-\setinterfaceconstant{numberstarter}{numberstarter}
-\setinterfaceconstant{numberstopper}{numberstopper}
-\setinterfaceconstant{numberstrut}{numberstrut}
-\setinterfaceconstant{numberstyle}{سبک‌شماره}
-\setinterfaceconstant{numberwidth}{عرض‌شماره}
-\setinterfaceconstant{nx}{nx}
-\setinterfaceconstant{ny}{ny}
-\setinterfaceconstant{object}{شیئ}
-\setinterfaceconstant{obstruction}{انسداد}
-\setinterfaceconstant{oddmargin}{حاشیه‌Ùرد}
-\setinterfaceconstant{offset}{Ø¢Ùست}
-\setinterfaceconstant{openaction}{عمل‌باز}
-\setinterfaceconstant{openpage}{openpage}
-\setinterfaceconstant{openpageaction}{عمل‌صÙحه‌باز}
-\setinterfaceconstant{openup}{openup}
-\setinterfaceconstant{opticalsize}{opticalsize}
-\setinterfaceconstant{option}{گزینه}
-\setinterfaceconstant{order}{order}
-\setinterfaceconstant{orientation}{جهت‌دهی}
-\setinterfaceconstant{otherstext}{otherstext}
-\setinterfaceconstant{outermargin}{حاشیه‌خارجی}
-\setinterfaceconstant{overprint}{overprint}
-\setinterfaceconstant{ownerpassword}{ownerpassword}
-\setinterfaceconstant{ownnumber}{شماره‌خود}
-\setinterfaceconstant{packcriterium}{packcriterium}
-\setinterfaceconstant{page}{صÙحه}
-\setinterfaceconstant{pageboundaries}{مرزهای‌صÙحه}
-\setinterfaceconstant{pagecolor}{رنگ‌صÙحه}
-\setinterfaceconstant{pagecolormodel}{pagecolormodel}
-\setinterfaceconstant{pagecommand}{Ùرمان‌صÙحه}
-\setinterfaceconstant{pageconnector}{pageconnector}
-\setinterfaceconstant{pageconversion}{pageconversion}
-\setinterfaceconstant{pageconversionset}{pageconversionset}
-\setinterfaceconstant{pageleft}{pageleft}
-\setinterfaceconstant{pagemethod}{pagemethod}
-\setinterfaceconstant{pagenumber}{شماره‌صÙحه}
-\setinterfaceconstant{pageprefix}{pageprefix}
-\setinterfaceconstant{pageprefixconnector}{pageprefixconnector}
-\setinterfaceconstant{pageprefixconversion}{pageprefixconversion}
-\setinterfaceconstant{pageprefixconversionset}{pageprefixconversionset}
-\setinterfaceconstant{pageprefixsegments}{pageprefixsegments}
-\setinterfaceconstant{pageprefixseparatorset}{pageprefixseparatorset}
-\setinterfaceconstant{pageprefixset}{pageprefixset}
-\setinterfaceconstant{pageprefixstarter}{pageprefixstarter}
-\setinterfaceconstant{pageprefixstopper}{pageprefixstopper}
-\setinterfaceconstant{pageright}{pageright}
-\setinterfaceconstant{pagesegments}{pagesegments}
-\setinterfaceconstant{pagesep}{pagesep}
-\setinterfaceconstant{pageseparatorset}{pageseparatorset}
-\setinterfaceconstant{pageset}{pageset}
-\setinterfaceconstant{pagestarter}{pagestarter}
-\setinterfaceconstant{pagestate}{وضعیت‌صÙحه}
-\setinterfaceconstant{pagestopper}{pagestopper}
-\setinterfaceconstant{pagestyle}{سبک‌صÙحه}
-\setinterfaceconstant{palet}{لوح}
-\setinterfaceconstant{paper}{برگ}
-\setinterfaceconstant{paragraph}{پاراگراÙ}
-\setinterfaceconstant{period}{period}
-\setinterfaceconstant{place}{بگذار}
-\setinterfaceconstant{placehead}{بگذارسر}
-\setinterfaceconstant{placeholder}{placeholder}
-\setinterfaceconstant{placestopper}{بگذارایست}
-\setinterfaceconstant{position}{موقعیت}
-\setinterfaceconstant{prefix}{پیشوند}
-\setinterfaceconstant{prefixconnector}{prefixconnector}
-\setinterfaceconstant{prefixconversion}{prefixconversion}
-\setinterfaceconstant{prefixconversionset}{prefixconversionset}
-\setinterfaceconstant{prefixsegments}{prefixsegments}
-\setinterfaceconstant{prefixseparatorset}{prefixseparatorset}
-\setinterfaceconstant{prefixset}{prefixset}
-\setinterfaceconstant{prefixstarter}{prefixstarter}
-\setinterfaceconstant{prefixstopper}{prefixstopper}
-\setinterfaceconstant{preset}{preset}
-\setinterfaceconstant{preview}{پیش‌دید}
-\setinterfaceconstant{previous}{قبلی}
-\setinterfaceconstant{previousnumber}{شماره‌قبلی}
-\setinterfaceconstant{print}{print}
-\setinterfaceconstant{printable}{قابل‌چاپ}
-\setinterfaceconstant{process}{پردازش}
-\setinterfaceconstant{processors}{processors}
-\setinterfaceconstant{profile}{profile}
-\setinterfaceconstant{properties}{properties}
-\setinterfaceconstant{pubsep}{pubsep}
-\setinterfaceconstant{quotechar}{quotechar}
-\setinterfaceconstant{radius}{شعاع}
-\setinterfaceconstant{random}{تصادÙÛŒ}
-\setinterfaceconstant{range}{range}
-\setinterfaceconstant{reduction}{کاهش}
-\setinterfaceconstant{ref}{رج}
-\setinterfaceconstant{refcommand}{refcommand}
-\setinterfaceconstant{reference}{مرجع}
-\setinterfaceconstant{referencemethod}{referencemethod}
-\setinterfaceconstant{referenceprefix}{referenceprefix}
-\setinterfaceconstant{referencetext}{referencetext}
-\setinterfaceconstant{referencing}{مراجعه}
-\setinterfaceconstant{region}{region}
-\setinterfaceconstant{regionin}{ناحیه‌درون}
-\setinterfaceconstant{regionout}{ناحیه‌بیرون}
-\setinterfaceconstant{register}{register}
-\setinterfaceconstant{regularfeatures}{regularfeatures}
-\setinterfaceconstant{regularfont}{regularfont}
-\setinterfaceconstant{renderingsetup}{renderingsetup}
-\setinterfaceconstant{repeat}{تکرار}
-\setinterfaceconstant{reset}{بازنشانی}
-\setinterfaceconstant{resetnumber}{بازنشانی‌شماره}
-\setinterfaceconstant{resolution}{Ú©ÛŒÙیت}
-\setinterfaceconstant{resources}{resources}
-\setinterfaceconstant{reverse}{برعکس}
-\setinterfaceconstant{right}{راست}
-\setinterfaceconstant{rightchars}{rightchars}
-\setinterfaceconstant{rightcolor}{رنگ‌راست}
-\setinterfaceconstant{rightcompoundhyphen}{rightcompoundhyphen}
-\setinterfaceconstant{rightedge}{لبه‌راست}
-\setinterfaceconstant{rightedgedistance}{Ùاصله‌لبه‌راست}
-\setinterfaceconstant{rightframe}{قالب‌راست}
-\setinterfaceconstant{righthyphen}{righthyphen}
-\setinterfaceconstant{rightmargin}{حاشیه‌راست}
-\setinterfaceconstant{rightmargindistance}{Ùاصله‌حاشیه‌راست}
-\setinterfaceconstant{rightoffset}{Ø¢Ùست‌راست}
-\setinterfaceconstant{rightquotation}{نقل‌قول‌راست}
-\setinterfaceconstant{rightquote}{نقل‌راست}
-\setinterfaceconstant{rightsample}{rightsample}
-\setinterfaceconstant{rightsentence}{جمله‌راست}
-\setinterfaceconstant{rightspeech}{سخنرانی‌راست}
-\setinterfaceconstant{rightstyle}{سبک‌راست}
-\setinterfaceconstant{rightsubsentence}{زیرجمله‌راست}
-\setinterfaceconstant{righttext}{متن‌راست}
-\setinterfaceconstant{rightwidth}{عرض‌راست}
-\setinterfaceconstant{rightwords}{rightwords}
-\setinterfaceconstant{roffset}{roffset}
-\setinterfaceconstant{rotation}{دوران}
-\setinterfaceconstant{rule}{خط}
-\setinterfaceconstant{rulecolor}{رنگ‌خط}
-\setinterfaceconstant{rulecommand}{rulecommand}
-\setinterfaceconstant{rulethickness}{ضخامت‌خط}
-\setinterfaceconstant{samepage}{همان‌صÙحه}
-\setinterfaceconstant{sample}{نمونه}
-\setinterfaceconstant{samplesize}{samplesize}
-\setinterfaceconstant{saveinlist}{saveinlist}
-\setinterfaceconstant{scale}{مقیاس}
-\setinterfaceconstant{scope}{طرح}
-\setinterfaceconstant{screen}{پرده}
-\setinterfaceconstant{section}{بخش}
-\setinterfaceconstant{sectionblock}{sectionblock}
-\setinterfaceconstant{sectionconversion}{sectionconversion}
-\setinterfaceconstant{sectionconversionset}{sectionconversionset}
-\setinterfaceconstant{sectionnumber}{شماره‌بخش}
-\setinterfaceconstant{sectionresetset}{sectionresetset}
-\setinterfaceconstant{sectionsegments}{sectionsegments}
-\setinterfaceconstant{sectionseparatorset}{sectionseparatorset}
-\setinterfaceconstant{sectionset}{sectionset}
-\setinterfaceconstant{sectionstarter}{sectionstarter}
-\setinterfaceconstant{sectionstopper}{sectionstopper}
-\setinterfaceconstant{separator}{جداکننده}
-\setinterfaceconstant{separatorcolor}{separatorcolor}
-\setinterfaceconstant{separatorstyle}{separatorstyle}
-\setinterfaceconstant{set}{قراربده}
-\setinterfaceconstant{setups}{setups}
-\setinterfaceconstant{shrink}{shrink}
-\setinterfaceconstant{side}{کنار}
-\setinterfaceconstant{sidealign}{تنظیم‌کنار}
-\setinterfaceconstant{sidemethod}{روش‌کنار}
-\setinterfaceconstant{sidespaceafter}{Ùضای‌کناری‌بعد}
-\setinterfaceconstant{sidespacebefore}{Ùضای‌کناری‌قبل}
-\setinterfaceconstant{sidespaceinbetween}{sidespaceinbetween}
-\setinterfaceconstant{sidethreshold}{sidethreshold}
-\setinterfaceconstant{sign}{علامت}
-\setinterfaceconstant{simplecommand}{simplecommand}
-\setinterfaceconstant{size}{اندازه}
-\setinterfaceconstant{slantedfeatures}{slantedfeatures}
-\setinterfaceconstant{slantedfont}{slantedfont}
-\setinterfaceconstant{small}{Ú©ÙˆÚ†Ú©}
-\setinterfaceconstant{smallcapsfeatures}{smallcapsfeatures}
-\setinterfaceconstant{smallcapsfont}{smallcapsfont}
-\setinterfaceconstant{solution}{solution}
-\setinterfaceconstant{sort}{sort}
-\setinterfaceconstant{sorttype}{ترتیب‌تایپ}
-\setinterfaceconstant{source}{منبع}
-\setinterfaceconstant{space}{Ùضا}
-\setinterfaceconstant{spaceafter}{Ùضا‌بعداز}
-\setinterfaceconstant{spaceafterside}{spaceafterside}
-\setinterfaceconstant{spacebefore}{Ùضا‌قبل‌از}
-\setinterfaceconstant{spacebeforeside}{spacebeforeside}
-\setinterfaceconstant{spaceinbetween}{Ùضا‌دربین}
-\setinterfaceconstant{spacing}{Ùضاگذاری}
-\setinterfaceconstant{specification}{specification}
-\setinterfaceconstant{split}{شکاÙتن}
-\setinterfaceconstant{splitcolor}{شکاÙتن‌رنگ}
-\setinterfaceconstant{splitmethod}{روش‌شکاÙتن}
-\setinterfaceconstant{splitoffset}{شکاÙتن‌آÙست}
-\setinterfaceconstant{spot}{Ù„Ú©Ù‡}
-\setinterfaceconstant{stack}{توده}
-\setinterfaceconstant{stackname}{stackname}
-\setinterfaceconstant{start}{شروع}
-\setinterfaceconstant{starter}{starter}
-\setinterfaceconstant{state}{وضعیت}
-\setinterfaceconstant{step}{گام}
-\setinterfaceconstant{stop}{پایان}
-\setinterfaceconstant{stopper}{ایست}
-\setinterfaceconstant{stretch}{کشیدن}
-\setinterfaceconstant{strip}{strip}
-\setinterfaceconstant{strut}{بست}
-\setinterfaceconstant{style}{سبک}
-\setinterfaceconstant{stylealternative}{stylealternative}
-\setinterfaceconstant{sub}{زیر}
-\setinterfaceconstant{subtitle}{زیرعنوان}
-\setinterfaceconstant{suffix}{پسوند}
-\setinterfaceconstant{suffixseparator}{suffixseparator}
-\setinterfaceconstant{suffixstopper}{suffixstopper}
-\setinterfaceconstant{surnamefirstnamesep}{surnamefirstnamesep}
-\setinterfaceconstant{surnameinitialsep}{surnameinitialsep}
-\setinterfaceconstant{surnamesep}{surnamesep}
-\setinterfaceconstant{svgstyle}{svgstyle}
-\setinterfaceconstant{sx}{sx}
-\setinterfaceconstant{sy}{sy}
-\setinterfaceconstant{symalign}{تنظیم‌نماد}
-\setinterfaceconstant{symbol}{نماد}
-\setinterfaceconstant{symbolcommand}{symbolcommand}
-\setinterfaceconstant{symbolset}{مجموعه‌نماد}
-\setinterfaceconstant{symcolor}{رنگ‌نماد}
-\setinterfaceconstant{symstyle}{سبک‌نماد}
-\setinterfaceconstant{synonym}{مترادÙ}
-\setinterfaceconstant{synonymcolor}{رنگ‌مترادÙ}
-\setinterfaceconstant{synonymcommand}{synonymcommand}
-\setinterfaceconstant{synonymstyle}{سبک‌مترادÙ}
-\setinterfaceconstant{tab}{تب}
-\setinterfaceconstant{text}{متن}
-\setinterfaceconstant{textalign}{textalign}
-\setinterfaceconstant{textcolor}{رنگ‌متن}
-\setinterfaceconstant{textcommand}{Ùرمان‌متن}
-\setinterfaceconstant{textdistance}{Ùاصله‌متن}
-\setinterfaceconstant{textheight}{ارتÙاع‌متن}
-\setinterfaceconstant{textlayer}{لایه‌متن}
-\setinterfaceconstant{textmargin}{حاشیه‌متن}
-\setinterfaceconstant{textmethod}{روش‌متن}
-\setinterfaceconstant{textseparator}{جداکننده‌متن}
-\setinterfaceconstant{textsize}{اندازه‌متن}
-\setinterfaceconstant{textstate}{وضعیت‌متن}
-\setinterfaceconstant{textstyle}{سبک‌متن}
-\setinterfaceconstant{textwidth}{عرض‌متن}
-\setinterfaceconstant{threshold}{threshold}
-\setinterfaceconstant{time}{time}
-\setinterfaceconstant{title}{عنوان}
-\setinterfaceconstant{titlecolor}{رنگ‌عنوان}
-\setinterfaceconstant{titlecommand}{Ùرمان‌عنوان}
-\setinterfaceconstant{titledistance}{Ùاصله‌عنوان}
-\setinterfaceconstant{titleleft}{عنوان‌چپ}
-\setinterfaceconstant{titleright}{عنوان‌راست}
-\setinterfaceconstant{titlestrut}{titlestrut}
-\setinterfaceconstant{titlestyle}{سبک‌عنوان}
-\setinterfaceconstant{to}{به}
-\setinterfaceconstant{toffset}{toffset}
-\setinterfaceconstant{tolerance}{بردباری}
-\setinterfaceconstant{top}{بالا}
-\setinterfaceconstant{topcommand}{topcommand}
-\setinterfaceconstant{topdistance}{Ùاصله‌بالا}
-\setinterfaceconstant{topframe}{قالب‌راست}
-\setinterfaceconstant{topoffset}{Ø¢Ùست‌بالا}
-\setinterfaceconstant{topspace}{Ùضای‌بالا}
-\setinterfaceconstant{topstate}{وضعیت‌بالا}
-\setinterfaceconstant{totalnumber}{totalnumber}
-\setinterfaceconstant{transform}{transform}
-\setinterfaceconstant{translate}{translate}
-\setinterfaceconstant{trimoffset}{trimoffset}
-\setinterfaceconstant{type}{تایپ}
-\setinterfaceconstant{unit}{واحد}
-\setinterfaceconstant{unknownreference}{مرجع‌ناشناس}
-\setinterfaceconstant{up}{up}
-\setinterfaceconstant{urlalternative}{urlalternative}
-\setinterfaceconstant{urlspace}{urlspace}
-\setinterfaceconstant{userpassword}{userpassword}
-\setinterfaceconstant{validate}{تاییداعتبار}
-\setinterfaceconstant{values}{values}
-\setinterfaceconstant{vcommand}{vcommand}
-\setinterfaceconstant{vcompact}{vcompact}
-\setinterfaceconstant{vector}{vector}
-\setinterfaceconstant{veroffset}{Ø¢Ùست‌عم}
-\setinterfaceconstant{vertical}{عمودی}
-\setinterfaceconstant{vfactor}{vfactor}
-\setinterfaceconstant{vfil}{vfil}
-\setinterfaceconstant{viewerprefix}{viewerprefix}
-\setinterfaceconstant{voffset}{Ø¢Ùست‌ع}
-\setinterfaceconstant{vonsep}{vonsep}
-\setinterfaceconstant{way}{راه}
-\setinterfaceconstant{wfactor}{wfactor}
-\setinterfaceconstant{white}{سÙید}
-\setinterfaceconstant{width}{عرض}
-\setinterfaceconstant{words}{words}
-\setinterfaceconstant{xanchor}{xanchor}
-\setinterfaceconstant{xfactor}{Ùاکتورایکس}
-\setinterfaceconstant{xhtml}{xhtml}
-\setinterfaceconstant{xmax}{xmax}
-\setinterfaceconstant{xmlsetup}{xmlsetup}
-\setinterfaceconstant{xoffset}{Ø¢Ùست‌ایکس}
-\setinterfaceconstant{xscale}{مقیاس‌ایکس}
-\setinterfaceconstant{xstep}{گام‌ایکس}
-\setinterfaceconstant{yanchor}{yanchor}
-\setinterfaceconstant{yfactor}{Ùاکتوروای}
-\setinterfaceconstant{ymax}{ymax}
-\setinterfaceconstant{yoffset}{Ø¢Ùست‌وای}
-\setinterfaceconstant{yscale}{مقیاس‌وای}
-\setinterfaceconstant{ystep}{گام‌وای}
-% definitions for interface elements for language pe
-%
-\setinterfaceelement{answerlines}{answerlines}
-\setinterfaceelement{answerspace}{answerspace}
-\setinterfaceelement{begin}{عنصرها}
-\setinterfaceelement{complete}{کامل}
-\setinterfaceelement{coupled}{مزدوج}
-\setinterfaceelement{currentlocal}{موضعی‌جاری}
-\setinterfaceelement{end}{انتها}
-\setinterfaceelement{endsetup}{انتهای‌بارگذاری}
-\setinterfaceelement{get}{بگیر}
-\setinterfaceelement{increment}{اÙزایش}
-\setinterfaceelement{list}{لیست}
-\setinterfaceelement{listof}{لیست‌از}
-\setinterfaceelement{load}{بارگذاشتن}
-\setinterfaceelement{local}{موضعی}
-\setinterfaceelement{makeup}{آرایش}
-\setinterfaceelement{next}{بعدی}
-\setinterfaceelement{place}{مکان}
-\setinterfaceelement{previous}{قبلی}
-\setinterfaceelement{previouslocal}{موضع‌قبلی}
-\setinterfaceelement{reserve}{رزرو}
-\setinterfaceelement{see}{ببینید}
-\setinterfaceelement{setup}{بارگذاری}
-\setinterfaceelement{start}{شروع}
-\setinterfaceelement{stop}{پایان}
-\setinterfaceelement{text}{متن}
-\setinterfaceelement{type}{تایپ}
-% definitions for interface commands for language pe
-%
-\setinterfacecommand{Character}{Character}
-\setinterfacecommand{Characters}{Characters}
-\setinterfacecommand{MONTH}{MONTH}
-\setinterfacecommand{Numbers}{Numbers}
-\setinterfacecommand{Romannumerals}{Romannumerals}
-\setinterfacecommand{SmallCapped}{Cap}
-\setinterfacecommand{SmallCaps}{Caps}
-\setinterfacecommand{WEEKDAY}{WEEKDAY}
-\setinterfacecommand{WORD}{WORD}
-\setinterfacecommand{WORDS}{WORDS}
-\setinterfacecommand{Word}{Word}
-\setinterfacecommand{Words}{Words}
-\setinterfacecommand{about}{درمورد}
-\setinterfacecommand{adaptfontfeature}{adaptfontfeature}
-\setinterfacecommand{adaptlayout}{تنظیم‌طرح‌بندی}
-\setinterfacecommand{addfeature}{addfeature}
-\setinterfacecommand{alignbottom}{alignbottom}
-\setinterfacecommand{aligned}{aligned}
-\setinterfacecommand{alignedbox}{alignedbox}
-\setinterfacecommand{alignedline}{alignedline}
-\setinterfacecommand{alignhere}{alignhere}
-\setinterfacecommand{alignment}{alignment}
-\setinterfacecommand{alignmentcharacter}{alignmentcharacter}
-\setinterfacecommand{applytocharacters}{applytocharacters}
-\setinterfacecommand{applytofirstcharacter}{applytofirstcharacter}
-\setinterfacecommand{arg}{اÙزودن}
-\setinterfacecommand{at}{در}
-\setinterfacecommand{atleftmargin}{درحاشیه‌چپ}
-\setinterfacecommand{atpage}{درصÙحه}
-\setinterfacecommand{atrightmargin}{درحاشیه‌راست}
-\setinterfacecommand{background}{پس‌زمینه}
-\setinterfacecommand{backspace}{Ùاصله‌پشت}
-\setinterfacecommand{blackrule}{خط‌سیاه}
-\setinterfacecommand{blackrules}{خطهای‌سیاه}
-\setinterfacecommand{blank}{خالی}
-\setinterfacecommand{bookmark}{چوبخط}
-\setinterfacecommand{bottombox}{bottombox}
-\setinterfacecommand{bottomdistance}{Ùاصله‌پایین}
-\setinterfacecommand{bottomheight}{ارتÙاع‌پایین}
-\setinterfacecommand{bottomleftbox}{bottomleftbox}
-\setinterfacecommand{bottomrightbox}{bottomrightbox}
-\setinterfacecommand{bottomspace}{Ùضای‌پایین}
-\setinterfacecommand{buildtextbottomdot}{buildtextbottomdot}
-\setinterfacecommand{but}{اما}
-\setinterfacecommand{button}{دکمه}
-\setinterfacecommand{bypassblocks}{عبوربلوکها}
-\setinterfacecommand{character}{حرÙ}
-\setinterfacecommand{characters}{حرÙها}
-\setinterfacecommand{chem}{chem}
-\setinterfacecommand{clip}{گیره}
-\setinterfacecommand{clonefield}{میدان‌شبیه‌سازی}
-\setinterfacecommand{color}{رنگ}
-\setinterfacecommand{colorbar}{میله‌رنگ}
-\setinterfacecommand{colorvalue}{مقداررنگ}
-\setinterfacecommand{column}{ستون}
-\setinterfacecommand{comparecolorgroup}{مقایسه‌گروه‌رنگ}
-\setinterfacecommand{comparepalet}{لوح‌مقایسه}
-\setinterfacecommand{completepagenumber}{شماره‌صÙحه‌کامل}
-\setinterfacecommand{completeregister}{ثبت‌کامل}
-\setinterfacecommand{component}{مولÙÙ‡}
-\setinterfacecommand{convertnumber}{شماره‌مبدل}
-\setinterfacecommand{copyfield}{میدان‌کپی}
-\setinterfacecommand{correctwhitespace}{Ùضای‌سÙیدصحیح}
-\setinterfacecommand{coupledocument}{نوشتارزوج}
-\setinterfacecommand{couplemarking}{نشانه‌گذاری‌زوج}
-\setinterfacecommand{couplepage}{صÙحه‌زوج}
-\setinterfacecommand{couplepaper}{کاغذزوج}
-\setinterfacecommand{coupleregister}{ثبت‌زوج}
-\setinterfacecommand{crlf}{crlf}
-\setinterfacecommand{currentdate}{تاریخ‌جاری}
-\setinterfacecommand{currentheadnumber}{شماره‌سرجاری}
-\setinterfacecommand{cutspace}{Ùضای‌برش}
-\setinterfacecommand{date}{تاریخ}
-\setinterfacecommand{decouplemarking}{جداسازی‌نشانه‌گذاری}
-\setinterfacecommand{decrementnumber}{شماره‌کاهش}
-\setinterfacecommand{define}{تعریÙ}
-\setinterfacecommand{defineaccent}{تعریÙ‌لهجه}
-\setinterfacecommand{defineblank}{تعریÙ‌خالی}
-\setinterfacecommand{defineblock}{تعریÙ‌بلوک}
-\setinterfacecommand{definebodyfont}{تعریÙ‌قلم‌متن}
-\setinterfacecommand{definebodyfontenvironment}{تعریÙ‌محیط‌قلم‌بدنه}
-\setinterfacecommand{definebodyfontswitch}{definebodyfontswitch}
-\setinterfacecommand{definebuffer}{تعریÙ‌باÙر}
-\setinterfacecommand{definecharacter}{تعریÙ‌حرÙ}
-\setinterfacecommand{definecharacterkerning}{definecharacterkerning}
-\setinterfacecommand{definecharacterspacing}{definecharacterspacing}
-\setinterfacecommand{definecolor}{تعریÙ‌رنگ}
-\setinterfacecommand{definecolorgroup}{تعریÙ‌گروه‌رنگ}
-\setinterfacecommand{definecolumnbreak}{تعریÙ‌شکستن‌ستون}
-\setinterfacecommand{definecolumnset}{تعریÙ‌مجموعه‌ستون}
-\setinterfacecommand{definecombination}{تعریÙ‌ترکیب}
-\setinterfacecommand{definecombinedlist}{تعریÙ‌لیست‌ترکیبی}
-\setinterfacecommand{definecommand}{تعریÙ‌Ùرمان}
-\setinterfacecommand{defineconversion}{تعریÙ‌تبدیل}
-\setinterfacecommand{definedescription}{تعریÙ‌شرح}
-\setinterfacecommand{definedfont}{definedfont}
-\setinterfacecommand{defineenumeration}{تعریÙ‌شماره‌بندی}
-\setinterfacecommand{definefallbackfamily}{definefallbackfamily}
-\setinterfacecommand{definefield}{تعریÙ‌میدان}
-\setinterfacecommand{definefieldstack}{تعریÙ‌توده‌میدان}
-\setinterfacecommand{definefiguresymbol}{تعریÙ‌نمادشکل}
-\setinterfacecommand{definefilefallback}{definefilefallback}
-\setinterfacecommand{definefirstline}{definefirstline}
-\setinterfacecommand{definefloat}{تعریÙ‌شناور}
-\setinterfacecommand{definefont}{تعریÙ‌قلم}
-\setinterfacecommand{definefontalternative}{definefontalternative}
-\setinterfacecommand{definefontfallback}{definefontfallback}
-\setinterfacecommand{definefontfamily}{definefontfamily}
-\setinterfacecommand{definefontfamilypreset}{definefontfamilypreset}
-\setinterfacecommand{definefontfeature}{definefontfeature}
-\setinterfacecommand{definefontfile}{definefontfile}
-\setinterfacecommand{definefontsize}{definefontsize}
-\setinterfacecommand{definefontsolution}{definefontsolution}
-\setinterfacecommand{definefontstyle}{تعریÙ‌سبک‌قلم}
-\setinterfacecommand{definefontsynonym}{تعریÙ‌مترادÙ‌قلم}
-\setinterfacecommand{defineframed}{تعریÙ‌قالبی}
-\setinterfacecommand{defineframedtext}{تعریÙ‌متن‌قالبی}
-\setinterfacecommand{definefrozenfont}{definefrozenfont}
-\setinterfacecommand{definehbox}{تعریÙ‌جعبه‌‌اÙÙ‚ÛŒ}
-\setinterfacecommand{definehead}{تعریÙ‌سر}
-\setinterfacecommand{definehyphenationfeatures}{definehyphenationfeatures}
-\setinterfacecommand{defineindentedtext}{defineindentedtext}
-\setinterfacecommand{defineinmargin}{تعریÙ‌درون‌حاشیه}
-\setinterfacecommand{defineinteractionmenu}{تعریÙ‌منوی‌پانل}
-\setinterfacecommand{defineitemgroup}{تعریÙ‌گروه‌آیتم}
-\setinterfacecommand{defineitems}{defineitems}
-\setinterfacecommand{definelabel}{تعریÙ‌برچسب}
-\setinterfacecommand{definelayer}{تعریÙ‌لایه}
-\setinterfacecommand{definelayout}{تعریÙ‌طرح‌بندی}
-\setinterfacecommand{definelinenote}{definelinenote}
-\setinterfacecommand{definelist}{تعریÙ‌لیست}
-\setinterfacecommand{definelogo}{تعریÙ‌آرم}
-\setinterfacecommand{definemainfield}{تعریÙ‌میدان‌اصلی}
-\setinterfacecommand{definemakeup}{تعریÙ‌آرایش}
-\setinterfacecommand{definemarking}{تعریÙ‌نشانه‌گذاری}
-\setinterfacecommand{definemathalignment}{تعریÙ‌تنظیم‌ریاضی}
-\setinterfacecommand{definemode}{definemode}
-\setinterfacecommand{definenamedcolor}{definenamedcolor}
-\setinterfacecommand{definenote}{definenote}
-\setinterfacecommand{defineoutput}{تعریÙ‌خروجی}
-\setinterfacecommand{defineoverlay}{تعریÙ‌پوشش}
-\setinterfacecommand{definepagebreak}{تعریÙ‌شکست‌صÙحه}
-\setinterfacecommand{definepalet}{تعریÙ‌لوح}
-\setinterfacecommand{definepapersize}{تعریÙ‌اندازه‌برگ}
-\setinterfacecommand{defineparagraphs}{تعریÙ‌پاراگراÙها}
-\setinterfacecommand{defineperiodkerning}{defineperiodkerning}
-\setinterfacecommand{defineplacement}{تعریÙ‌جانشانی}
-\setinterfacecommand{defineprofile}{تعریÙ‌پروÙایل}
-\setinterfacecommand{defineprogram}{تعریÙ‌برنامه}
-\setinterfacecommand{definerawfont}{تعریÙ‌قلم‌خام}
-\setinterfacecommand{definereference}{تعریÙ‌مرجع}
-\setinterfacecommand{definereferenceformat}{تعریÙ‌شمایل‌مرجع}
-\setinterfacecommand{definereferencelist}{تعریÙ‌لیست‌مرجع}
-\setinterfacecommand{defineregister}{تعریÙ‌ثبت}
-\setinterfacecommand{definerule}{تعریÙ‌خط‌حائل}
-\setinterfacecommand{definesection}{تعریÙ‌بخش}
-\setinterfacecommand{definesectionblock}{تعریÙ‌بلوک‌بخش}
-\setinterfacecommand{definesorting}{تعریÙ‌ترتیب}
-\setinterfacecommand{definestartstop}{تعریÙ‌شروع‌پایان}
-\setinterfacecommand{definestyle}{تعریÙ‌سبک}
-\setinterfacecommand{definesubfield}{تعریÙ‌زیرمیدان}
-\setinterfacecommand{definesymbol}{تعریÙ‌نماد}
-\setinterfacecommand{definesynonyms}{تعریÙ‌مترادÙها}
-\setinterfacecommand{definetabletemplate}{تعریÙ‌الگوی‌جدول}
-\setinterfacecommand{definetabulate}{تعریÙ‌جدول‌بندی}
-\setinterfacecommand{definetext}{تعریÙ‌متن}
-\setinterfacecommand{definetextbackground}{definetextbackground}
-\setinterfacecommand{definetextnote}{definetextnote}
-\setinterfacecommand{definetextposition}{تعریÙ‌مکان‌متن}
-\setinterfacecommand{definetextvariable}{تعریÙ‌متغیرمتن}
-\setinterfacecommand{definetype}{تعریÙ‌تایپ}
-\setinterfacecommand{definetyping}{تعریÙ‌تایپ‌کردن}
-\setinterfacecommand{defineversion}{تعریÙ‌نسخه}
-\setinterfacecommand{depthspanningtext}{depthspanningtext}
-\setinterfacecommand{determineheadnumber}{تعیین‌شماره‌سر}
-\setinterfacecommand{determinelistcharacteristics}{تعیین‌مشخصات‌لیست}
-\setinterfacecommand{determineregistercharacteristics}{تعیین‌مشخصات‌ثبت}
-\setinterfacecommand{dimension}{بعد}
-\setinterfacecommand{disableinteractionmenu}{ازکارانداختن‌منوی‌پانل}
-\setinterfacecommand{disablemode}{disablemode}
-\setinterfacecommand{doaddfeature}{doaddfeature}
-\setinterfacecommand{domicile}{مسکن}
-\setinterfacecommand{dontconvertfont}{dontconvertfont}
-\setinterfacecommand{donttest}{امتحان‌نکن}
-\setinterfacecommand{edgedistance}{Ùاصله‌لبه}
-\setinterfacecommand{edgewidth}{عرض‌لبه}
-\setinterfacecommand{emphasisboldface}{emphasisboldface}
-\setinterfacecommand{emptylines}{خطها‌خالی}
-\setinterfacecommand{enablemode}{enablemode}
-\setinterfacecommand{environment}{محیط}
-\setinterfacecommand{externalfigure}{شکل‌خارجی}
-\setinterfacecommand{fact}{حقیقت}
-\setinterfacecommand{fastswitchtobodyfont}{fastswitchtobodyfont}
-\setinterfacecommand{feature}{feature}
-\setinterfacecommand{field}{میدان}
-\setinterfacecommand{fieldstack}{میدان‌پشته}
-\setinterfacecommand{fillinfield}{درج‌درمیدان}
-\setinterfacecommand{fillinline}{درج‌درخط}
-\setinterfacecommand{fillinrules}{درج‌درخطها}
-\setinterfacecommand{fillintext}{درج‌درمتن}
-\setinterfacecommand{firstcharacter}{firstcharacter}
-\setinterfacecommand{fitfield}{پرکردن‌میدان}
-\setinterfacecommand{fittopbaselinegrid}{fittopbaselinegrid}
-\setinterfacecommand{fixedspace}{Ùضای‌ثابت}
-\setinterfacecommand{fixedspaces}{Ùضاهای‌ثابت}
-\setinterfacecommand{flushnotes}{flushnotes}
-\setinterfacecommand{followprofile}{پیروی‌پروÙایل}
-\setinterfacecommand{followprofileversion}{پیروی‌نسخه‌پروÙایل}
-\setinterfacecommand{followversion}{پیروی‌نسخه}
-\setinterfacecommand{footerdistance}{Ùاصله‌ته‌برگ}
-\setinterfacecommand{footerheight}{ارتÙاع‌ته‌برگ}
-\setinterfacecommand{footnote}{پانوشت}
-\setinterfacecommand{footnotetext}{متن‌پانوشت}
-\setinterfacecommand{forceblocks}{اجباربلوکها}
-\setinterfacecommand{forcecharacterstripping}{forcecharacterstripping}
-\setinterfacecommand{formulanumber}{شماره‌Ùرمول}
-\setinterfacecommand{fraction}{کسر}
-\setinterfacecommand{framed}{قالبی}
-\setinterfacecommand{from}{از}
-\setinterfacecommand{fromlinenote}{fromlinenote}
-\setinterfacecommand{getbuffer}{دریاÙت‌باÙر}
-\setinterfacecommand{getfirstcharacter}{getfirstcharacter}
-\setinterfacecommand{getmarking}{دریاÙت‌نشانه}
-\setinterfacecommand{getnumber}{دریاÙت‌شماره}
-\setinterfacecommand{globaldisablemode}{globaldisablemode}
-\setinterfacecommand{globalenablemode}{globalenablemode}
-\setinterfacecommand{globalpreventmode}{globalpreventmode}
-\setinterfacecommand{godown}{بروپایین}
-\setinterfacecommand{goto}{بروبه}
-\setinterfacecommand{gotobox}{بروبه‌جعبه}
-\setinterfacecommand{gotopage}{بروبه‌صÙحه}
-\setinterfacecommand{graycolor}{رنگ‌خاکستری}
-\setinterfacecommand{greyvalue}{مقدارخاکستری}
-\setinterfacecommand{grid}{توری}
-\setinterfacecommand{hairline}{خط‌مو}
-\setinterfacecommand{head}{سر}
-\setinterfacecommand{headerdistance}{Ùاصله‌سربرگ}
-\setinterfacecommand{headerheight}{ارتÙاع‌سربرگ}
-\setinterfacecommand{headlevel}{مرحله‌سر}
-\setinterfacecommand{headnumber}{شماره‌سر}
-\setinterfacecommand{headsym}{نمادسر}
-\setinterfacecommand{headtext}{متن‌سر}
-\setinterfacecommand{heightspanningtext}{heightspanningtext}
-\setinterfacecommand{hideblocks}{بلوکها‌پنهان}
-\setinterfacecommand{high}{بلند}
-\setinterfacecommand{hl}{خ‌ا}
-\setinterfacecommand{immediatebetweenlist}{Ùوری‌بین‌لیست}
-\setinterfacecommand{immediatetolist}{Ùوری‌به‌لیست}
-\setinterfacecommand{in}{درون}
-\setinterfacecommand{incrementnumber}{شماره‌اÙزایش}
-\setinterfacecommand{indenting}{تورÙتگی}
-\setinterfacecommand{inframed}{درقالبی}
-\setinterfacecommand{infull}{درپر}
-\setinterfacecommand{ininner}{درداخلی}
-\setinterfacecommand{inleft}{درچپ}
-\setinterfacecommand{inleftedge}{درلبه‌چپ}
-\setinterfacecommand{inleftmargin}{درحاشیه‌چپ}
-\setinterfacecommand{inline}{درخط}
-\setinterfacecommand{inmargin}{درحاشیه}
-\setinterfacecommand{inmframed}{inmframed}
-\setinterfacecommand{inneredgedistance}{Ùاصله‌لبه‌داخلی}
-\setinterfacecommand{inneredgewidth}{عرض‌لبه‌داخلی}
-\setinterfacecommand{innermargindistance}{Ùاصله‌حاشیه‌داخلی}
-\setinterfacecommand{innermarginwidth}{عرض‌حاشیه‌داخلی}
-\setinterfacecommand{inothermargin}{درحاشیه‌دیگر}
-\setinterfacecommand{inouter}{درخارجی}
-\setinterfacecommand{inright}{درراست}
-\setinterfacecommand{inrightedge}{درلبه‌راست}
-\setinterfacecommand{inrightmargin}{درحاشیه‌راست}
-\setinterfacecommand{installlanguage}{نصب‌زبان}
-\setinterfacecommand{interactionbar}{میله‌پانل}
-\setinterfacecommand{interactionbuttons}{دکمه‌پانل}
-\setinterfacecommand{interactionmenu}{منوی‌پانل}
-\setinterfacecommand{item}{آیتم}
-\setinterfacecommand{itemgroup}{itemgroup}
-\setinterfacecommand{items}{آیتمها}
-\setinterfacecommand{itemtag}{itemtag}
-\setinterfacecommand{its}{its}
-\setinterfacecommand{keepblocks}{Ø­Ùظ‌بلوکها}
-\setinterfacecommand{kerncharacters}{kerncharacters}
-\setinterfacecommand{label}{برچسب}
-\setinterfacecommand{labels}{برچسبها}
-\setinterfacecommand{labeltext}{متن‌برچسب}
-\setinterfacecommand{language}{زبان}
-\setinterfacecommand{languageCharacters}{languageCharacters}
-\setinterfacecommand{languagecharacters}{languagecharacters}
-\setinterfacecommand{leftaligned}{چپ‌چین}
-\setinterfacecommand{leftbottombox}{leftbottombox}
-\setinterfacecommand{leftedgedistance}{Ùاصله‌لبه‌چپ}
-\setinterfacecommand{leftedgewidth}{عرض‌لبه‌چپ}
-\setinterfacecommand{leftline}{leftline}
-\setinterfacecommand{leftmargindistance}{Ùاصله‌حاشیه‌چپ}
-\setinterfacecommand{leftmarginwidth}{عرض‌حاشیه‌چپ}
-\setinterfacecommand{leg}{پا}
-\setinterfacecommand{linecorrection}{linecorrection}
-\setinterfacecommand{linenote}{linenote}
-\setinterfacecommand{linespanningtext}{linespanningtext}
-\setinterfacecommand{linewidth}{عرض‌خط}
-\setinterfacecommand{listheight}{ارتÙاع‌خط}
-\setinterfacecommand{listlength}{طول‌لیست}
-\setinterfacecommand{listsymbol}{نمادلیست}
-\setinterfacecommand{listwidth}{عرض‌لیست}
-\setinterfacecommand{loadfontgoodies}{loadfontgoodies}
-\setinterfacecommand{localfootnotes}{localfootnotes}
-\setinterfacecommand{localnotes}{localnotes}
-\setinterfacecommand{logfields}{میدانهای‌گزارش}
-\setinterfacecommand{lohi}{پابا}
-\setinterfacecommand{low}{پایین}
-\setinterfacecommand{macroname}{نام‌ماکرو}
-\setinterfacecommand{mainlanguage}{زبان‌اصلی}
-\setinterfacecommand{makeupheight}{ارتÙاع‌آرایش}
-\setinterfacecommand{makeupwidth}{عرض‌آرایش}
-\setinterfacecommand{mar}{حاش}
-\setinterfacecommand{marginblock}{marginblock}
-\setinterfacecommand{margindistance}{Ùاصله‌حاشیه}
-\setinterfacecommand{marginrule}{خط‌حاشیه}
-\setinterfacecommand{margintext}{متن‌حاشیه}
-\setinterfacecommand{margintitle}{عنوان‌حاشیه}
-\setinterfacecommand{marginwidth}{عرض‌حاشیه}
-\setinterfacecommand{marginword}{کلمه‌حاشیه}
-\setinterfacecommand{marking}{نشانه‌گذاری}
-\setinterfacecommand{markversion}{نسخه‌نشانه}
-\setinterfacecommand{mathematics}{ریاضی}
-\setinterfacecommand{menubutton}{دکمه‌منو}
-\setinterfacecommand{mframed}{mframed}
-\setinterfacecommand{midaligned}{تنظیم‌وسط}
-\setinterfacecommand{mirror}{آینه}
-\setinterfacecommand{month}{ماه}
-\setinterfacecommand{moveformula}{انتقال‌Ùرمول}
-\setinterfacecommand{moveongrid}{انتقال‌به‌توری}
-\setinterfacecommand{movesidefloat}{انتقال‌کنار‌شناور}
-\setinterfacecommand{navigating}{هدایت}
-\setinterfacecommand{nodimension}{بدون‌بعد}
-\setinterfacecommand{noheaderandfooterlines}{بدون‌خط‌سروته‌برگ}
-\setinterfacecommand{noindenting}{بدون‌تورÙتگی}
-\setinterfacecommand{noitem}{noitem}
-\setinterfacecommand{nolist}{بدون‌لیست}
-\setinterfacecommand{nomarking}{بدون‌نشانه‌گذاری}
-\setinterfacecommand{nomoreblocks}{بدون‌بلوکهای‌بیشتر}
-\setinterfacecommand{nomorefiles}{بدون‌Ùایلهای‌بیشتر}
-\setinterfacecommand{nop}{منÙÛŒ}
-\setinterfacecommand{nospace}{بدون‌Ùضا}
-\setinterfacecommand{note}{یادداشت}
-\setinterfacecommand{notesymbol}{notesymbol}
-\setinterfacecommand{notopandbottomlines}{بدون‌خط‌بالاوپایین}
-\setinterfacecommand{notsmallcapped}{سرپوش‌کوچک‌نه}
-\setinterfacecommand{nowhitespace}{بدون‌Ùضای‌سÙید}
-\setinterfacecommand{numberofsubpages}{شماره‌زیرصÙحه}
-\setinterfacecommand{numbers}{شماره‌ها}
-\setinterfacecommand{outeredgedistance}{Ùاصله‌لبه‌خارجی}
-\setinterfacecommand{outeredgewidth}{عرض‌لبه‌خارجی}
-\setinterfacecommand{outermargindistance}{Ùاصله‌حاشیه‌خارجی}
-\setinterfacecommand{outermarginwidth}{عرض‌حاشیه‌خارجی}
-\setinterfacecommand{packed}{Ùشرده}
-\setinterfacecommand{page}{صÙحه}
-\setinterfacecommand{pagebreak}{pagebreak}
-\setinterfacecommand{pagedepth}{عمق‌صÙحه}
-\setinterfacecommand{pagenumber}{شماره‌صÙحه}
-\setinterfacecommand{pageoffset}{Ø¢Ùست‌صÙحه}
-\setinterfacecommand{pagereference}{مرجع‌صÙحه}
-\setinterfacecommand{paperheight}{ارتÙاع‌برگ}
-\setinterfacecommand{paperwidth}{عرض‌برگ}
-\setinterfacecommand{periods}{نقطه‌ها}
-\setinterfacecommand{placebookmarks}{درج‌چوب‌خط}
-\setinterfacecommand{placecombinedlist}{درج‌لیست‌مختلط}
-\setinterfacecommand{placefloat}{درج‌شناور}
-\setinterfacecommand{placefootnotes}{درج‌پانوشتها}
-\setinterfacecommand{placeformula}{درج‌Ùرمول}
-\setinterfacecommand{placeheadnumber}{درج‌شماره‌سر}
-\setinterfacecommand{placeheadtext}{درج‌متن‌سر}
-\setinterfacecommand{placelegend}{درج‌راهنما}
-\setinterfacecommand{placelist}{درج‌لیست}
-\setinterfacecommand{placelistofsynonyms}{placelistofsynonyms}
-\setinterfacecommand{placelocalfootnotes}{درج‌پانوشتهای‌موضعی}
-\setinterfacecommand{placelocalnotes}{placelocalnotes}
-\setinterfacecommand{placelogos}{درج‌آرمها}
-\setinterfacecommand{placenamedfloat}{placenamedfloat}
-\setinterfacecommand{placenotes}{placenotes}
-\setinterfacecommand{placeongrid}{درج‌در‌توری}
-\setinterfacecommand{placeontopofeachother}{درج‌در‌بالای‌یکدیگر}
-\setinterfacecommand{placepagenumber}{درج‌شماره‌صÙحه}
-\setinterfacecommand{placerawlist}{درج‌لیست‌خام}
-\setinterfacecommand{placereferencelist}{درج‌لیست‌مرجع}
-\setinterfacecommand{placeregister}{درج‌ثبت}
-\setinterfacecommand{placerule}{درج‌خط}
-\setinterfacecommand{placesidebyside}{درج‌کنار‌به‌کنار}
-\setinterfacecommand{placesubformula}{درج‌زیرÙرمول}
-\setinterfacecommand{placetextvariable}{درج‌متغیرمتن}
-\setinterfacecommand{position}{مکان}
-\setinterfacecommand{positiontext}{مکان‌متن}
-\setinterfacecommand{postponenotes}{postponenotes}
-\setinterfacecommand{postponingnotes}{postponingnotes}
-\setinterfacecommand{predefinedfont}{predefinedfont}
-\setinterfacecommand{predefinefont}{predefinefont}
-\setinterfacecommand{presetdocument}{presetdocument}
-\setinterfacecommand{prettyprintbuffer}{prettyprintbuffer}
-\setinterfacecommand{preventmode}{preventmode}
-\setinterfacecommand{printpaperheight}{چاپ‌ارتÙاع‌برگ}
-\setinterfacecommand{printpaperwidth}{چاپ‌عرض‌برگ}
-\setinterfacecommand{processblocks}{بلوکهای‌پردازش}
-\setinterfacecommand{processbodyfontenvironmentlist}{processbodyfontenvironmentlist}
-\setinterfacecommand{processpage}{صÙحه‌پردازش}
-\setinterfacecommand{product}{تولید}
-\setinterfacecommand{program}{برنامه}
-\setinterfacecommand{project}{پروژه}
-\setinterfacecommand{publication}{نشر}
-\setinterfacecommand{quotation}{نقل‌قول}
-\setinterfacecommand{quote}{نقل}
-\setinterfacecommand{ran}{ran}
-\setinterfacecommand{redo}{انجام‌دوباره}
-\setinterfacecommand{redoconvertfont}{redoconvertfont}
-\setinterfacecommand{ref}{رج}
-\setinterfacecommand{reference}{مرجع}
-\setinterfacecommand{referral}{رجوع}
-\setinterfacecommand{referraldate}{تاریخ‌رجوع}
-\setinterfacecommand{referring}{مراجعه}
-\setinterfacecommand{registerfontclass}{registerfontclass}
-\setinterfacecommand{registerhyphenationexception}{registerhyphenationexception}
-\setinterfacecommand{registerhyphenationpattern}{registerhyphenationpattern}
-\setinterfacecommand{remark}{توجه}
-\setinterfacecommand{replacefeature}{replacefeature}
-\setinterfacecommand{reset}{بازنشانی}
-\setinterfacecommand{resetandaddfeature}{resetandaddfeature}
-\setinterfacecommand{resetcharacteralign}{resetcharacteralign}
-\setinterfacecommand{resetcharacterkerning}{resetcharacterkerning}
-\setinterfacecommand{resetcharacterspacing}{resetcharacterspacing}
-\setinterfacecommand{resetcharacterstripping}{resetcharacterstripping}
-\setinterfacecommand{resetfeature}{resetfeature}
-\setinterfacecommand{resetfontcolorsheme}{resetfontcolorsheme}
-\setinterfacecommand{resetfontfallback}{resetfontfallback}
-\setinterfacecommand{resetfontsolution}{resetfontsolution}
-\setinterfacecommand{resethyphenationfeatures}{resethyphenationfeatures}
-\setinterfacecommand{resetlocalfloats}{resetlocalfloats}
-\setinterfacecommand{resetmarking}{بازنشانی‌نشانه‌گذاری}
-\setinterfacecommand{resetmode}{resetmode}
-\setinterfacecommand{resetnumber}{بازنشانی‌شماره}
-\setinterfacecommand{resetpath}{resetpath}
-\setinterfacecommand{resetperiodkerning}{resetperiodkerning}
-\setinterfacecommand{resetsystemmode}{resetsystemmode}
-\setinterfacecommand{resettextcontent}{بازنشانی‌متن}
-\setinterfacecommand{resetvisualizers}{resetvisualizers}
-\setinterfacecommand{restoreglobalbodyfont}{restoreglobalbodyfont}
-\setinterfacecommand{retestfeature}{retestfeature}
-\setinterfacecommand{revivefeature}{revivefeature}
-\setinterfacecommand{rightaligned}{تنظیم‌راست}
-\setinterfacecommand{rightbottombox}{rightbottombox}
-\setinterfacecommand{rightedgedistance}{Ùاصله‌لبه‌راست}
-\setinterfacecommand{rightedgewidth}{عرض‌لبه‌راست}
-\setinterfacecommand{rightline}{rightline}
-\setinterfacecommand{rightmargindistance}{Ùاصله‌حاشیه‌راست}
-\setinterfacecommand{rightmarginwidth}{عرض‌حاشیه‌راست}
-\setinterfacecommand{romannumerals}{اعدادلاتین}
-\setinterfacecommand{rotate}{دوران}
-\setinterfacecommand{savebuffer}{savebuffer}
-\setinterfacecommand{scale}{مقیاس}
-\setinterfacecommand{screen}{پرده}
-\setinterfacecommand{selectblocks}{انتخاب‌بلوکها}
-\setinterfacecommand{selectpaper}{انتخاب‌برگ}
-\setinterfacecommand{selectversion}{انتخاب‌نسخه}
-\setinterfacecommand{setbigbodyfont}{setbigbodyfont}
-\setinterfacecommand{setcharacteralign}{setcharacteralign}
-\setinterfacecommand{setcharacteraligndetail}{setcharacteraligndetail}
-\setinterfacecommand{setcharactercasing}{setcharactercasing}
-\setinterfacecommand{setcharactercleaning}{setcharactercleaning}
-\setinterfacecommand{setcharacterkerning}{setcharacterkerning}
-\setinterfacecommand{setcharacterspacing}{setcharacterspacing}
-\setinterfacecommand{setcharacterstripping}{setcharacterstripping}
-\setinterfacecommand{setcurrentfontclass}{setcurrentfontclass}
-\setinterfacecommand{setfirstline}{setfirstline}
-\setinterfacecommand{setfirstpasscharacteralign}{setfirstpasscharacteralign}
-\setinterfacecommand{setfont}{setfont}
-\setinterfacecommand{setfontcolorsheme}{setfontcolorsheme}
-\setinterfacecommand{setfontfeature}{setfontfeature}
-\setinterfacecommand{setfontsolution}{setfontsolution}
-\setinterfacecommand{setfontstrut}{setfontstrut}
-\setinterfacecommand{sethyphenationfeatures}{sethyphenationfeatures}
-\setinterfacecommand{setmainbodyfont}{setmainbodyfont}
-\setinterfacecommand{setmode}{setmode}
-\setinterfacecommand{setnote}{setnote}
-\setinterfacecommand{setnotetext}{setnotetext}
-\setinterfacecommand{setnumber}{تعیین‌شماره}
-\setinterfacecommand{setperiodkerning}{setperiodkerning}
-\setinterfacecommand{setsecondpasscharacteralign}{setsecondpasscharacteralign}
-\setinterfacecommand{setsmallbodyfont}{setsmallbodyfont}
-\setinterfacecommand{setsystemmode}{setsystemmode}
-\setinterfacecommand{settextcontent}{تعیین‌محتوای‌متن}
-\setinterfacecommand{settextvariable}{تعیین‌متغیر‌متن}
-\setinterfacecommand{setupalign}{بارگذاری‌تنظیم}
-\setinterfacecommand{setupanswerarea}{setupanswerarea}
-\setinterfacecommand{setuparranging}{بارگذاری‌ترتیب}
-\setinterfacecommand{setupattachment}{setupattachment}
-\setinterfacecommand{setupbackground}{بارگذاری‌پس‌زمینه}
-\setinterfacecommand{setupbackgrounds}{بارگذاری‌پس‌زمینه‌ها}
-\setinterfacecommand{setupblackrules}{بارگذاری‌خطهای‌سیاه}
-\setinterfacecommand{setupblank}{بارگذاری‌خالی}
-\setinterfacecommand{setupblock}{بارگذاری‌بلوک}
-\setinterfacecommand{setupbodyfont}{بارگذاری‌قلم‌متن}
-\setinterfacecommand{setupbodyfontenvironment}{بارگذاری‌محیط‌قلم‌متن}
-\setinterfacecommand{setupbottom}{بارگذاری‌پایین}
-\setinterfacecommand{setupbottomtexts}{بارگذاری‌متن‌پایین}
-\setinterfacecommand{setupbuffer}{بارگذاری‌باÙر}
-\setinterfacecommand{setupbuttons}{بارگذاری‌دکمه‌ها}
-\setinterfacecommand{setupcapitals}{setupcapitals}
-\setinterfacecommand{setupcaption}{بارگذاری‌شرح}
-\setinterfacecommand{setupcaptions}{بارگذاری‌شرحها}
-\setinterfacecommand{setupcharacteralign}{setupcharacteralign}
-\setinterfacecommand{setupcharacterkerning}{setupcharacterkerning}
-\setinterfacecommand{setupcharacterspacing}{setupcharacterspacing}
-\setinterfacecommand{setupclipping}{بارگذاری‌چیدن}
-\setinterfacecommand{setupcolor}{بارگذاری‌رنگ}
-\setinterfacecommand{setupcolors}{بارگذاری‌رنگها}
-\setinterfacecommand{setupcolumns}{بارگذاری‌ستونها}
-\setinterfacecommand{setupcolumnset}{بارگذاری‌مجموعه‌ستون}
-\setinterfacecommand{setupcolumnsetlines}{بارگذاری‌خطهای‌مجموعه‌ستون}
-\setinterfacecommand{setupcolumnsetstart}{بارگذاری‌شروع‌مجموعه‌ستون}
-\setinterfacecommand{setupcombinations}{بارگذاری‌ترکیب‌ها}
-\setinterfacecommand{setupcombinedlist}{بارگذاری‌لیست‌ترکیبی}
-\setinterfacecommand{setupcomment}{بارگذاری‌توضیح}
-\setinterfacecommand{setupcounter}{setupcounter}
-\setinterfacecommand{setupdescription}{setupdescription}
-\setinterfacecommand{setupdescriptions}{بارگذاری‌شرح}
-\setinterfacecommand{setupenumeration}{setupenumeration}
-\setinterfacecommand{setupenumerations}{بارگذاری‌شماره‌گذاریها}
-\setinterfacecommand{setupexternalfigures}{بارگذاری‌شکلهای‌خارجی}
-\setinterfacecommand{setupfield}{بارگذاری‌میدان}
-\setinterfacecommand{setupfields}{بارگذاری‌میدانها}
-\setinterfacecommand{setupfillinlines}{بارگذاری‌پرکردن‌خطها}
-\setinterfacecommand{setupfillinrules}{بارگذاری‌درج‌درخطها}
-\setinterfacecommand{setupfirstline}{setupfirstline}
-\setinterfacecommand{setupfloat}{بارگذاری‌شناور}
-\setinterfacecommand{setupfloats}{بارگذاری‌شناورها}
-\setinterfacecommand{setupfloatsplitting}{بارگذاری‌شکاÙتن‌شناورها}
-\setinterfacecommand{setupfontexpansion}{setupfontexpansion}
-\setinterfacecommand{setupfontprotrusion}{setupfontprotrusion}
-\setinterfacecommand{setupfonts}{setupfonts}
-\setinterfacecommand{setupfontsolution}{setupfontsolution}
-\setinterfacecommand{setupfooter}{بارگذاری‌ته‌برگ}
-\setinterfacecommand{setupfootertexts}{بارگذاری‌متن‌پانوشت}
-\setinterfacecommand{setupfootnotedefinition}{بارگذاری‌تعریÙ‌پانوشت}
-\setinterfacecommand{setupfootnotes}{بارگذاری‌پانوشتها}
-\setinterfacecommand{setupforms}{بارگذاری‌طرح}
-\setinterfacecommand{setupformula}{setupformula}
-\setinterfacecommand{setupformulas}{بارگذاری‌Ùرمولها}
-\setinterfacecommand{setupframed}{بارگذاری‌قالبی}
-\setinterfacecommand{setupframedtext}{setupframedtext}
-\setinterfacecommand{setupframedtexts}{بارگذاری‌متن‌قالبی}
-\setinterfacecommand{setuphead}{بارگذاری‌سر}
-\setinterfacecommand{setupheader}{بارگذاری‌سربرگ}
-\setinterfacecommand{setupheadertexts}{بارگذاری‌متن‌سربرگ}
-\setinterfacecommand{setupheadnumber}{بارگذاری‌شماره‌سر}
-\setinterfacecommand{setupheads}{بارگذاری‌سرها}
-\setinterfacecommand{setupheadtext}{بارگذاری‌متن‌سر}
-\setinterfacecommand{setuphyphenation}{setuphyphenation}
-\setinterfacecommand{setuphyphenmark}{بارگذاری‌نشانه‌شکستن}
-\setinterfacecommand{setupindentedtext}{setupindentedtext}
-\setinterfacecommand{setupindenting}{بارگذاری‌تورÙتگی}
-\setinterfacecommand{setupinmargin}{بارگذاری‌درون‌حاشیه}
-\setinterfacecommand{setupinteraction}{بارگذاری‌پانل}
-\setinterfacecommand{setupinteractionbar}{بارگذاری‌میله‌پانل}
-\setinterfacecommand{setupinteractionmenu}{بارگذاری‌منوی‌پانل}
-\setinterfacecommand{setupinteractionscreen}{بارگذاری‌پرده‌پانل}
-\setinterfacecommand{setupinterlinespace}{بارگذاری‌Ùاصله‌بین‌خط}
-\setinterfacecommand{setupitemgroup}{بارگذاری‌گروه‌آیتم}
-\setinterfacecommand{setupitemgroups}{بارگذاری‌گروههای‌آیتم}
-\setinterfacecommand{setupitems}{بارگذاری‌آیتمها}
-\setinterfacecommand{setuplabeltext}{باگذاری‌متن‌برچسب}
-\setinterfacecommand{setuplanguage}{بارگذاری‌زبان}
-\setinterfacecommand{setuplayout}{بارگذاری‌طرح‌بندی}
-\setinterfacecommand{setuplegend}{بارگذاری‌راهنما}
-\setinterfacecommand{setuplinenote}{setuplinenote}
-\setinterfacecommand{setuplinenumbering}{بارگذاری‌شماره‌‌گذاری‌خط}
-\setinterfacecommand{setuplines}{بارگذاری‌خطها}
-\setinterfacecommand{setuplinewidth}{بارگذاری‌عرض‌خط}
-\setinterfacecommand{setuplist}{بارگذاری‌لیست}
-\setinterfacecommand{setupmakeup}{بارگذاری‌آرایش}
-\setinterfacecommand{setupmarginblock}{setupmarginblock}
-\setinterfacecommand{setupmarginblocks}{بارگذاری‌بلوکهای‌حاشیه}
-\setinterfacecommand{setupmargindata}{setupmargindata}
-\setinterfacecommand{setupmarginrules}{بارگذاری‌خطهای‌حاشیه}
-\setinterfacecommand{setupmarking}{بارگذاری‌نشانه‌گذاری}
-\setinterfacecommand{setupmathalignment}{بارگذاری‌تنظیم‌ریاضی}
-\setinterfacecommand{setupnarrower}{بارگذاری‌باریکتر}
-\setinterfacecommand{setupnotation}{setupnotation}
-\setinterfacecommand{setupnotations}{setupnotations}
-\setinterfacecommand{setupnote}{setupnote}
-\setinterfacecommand{setupnotes}{setupnotes}
-\setinterfacecommand{setupnumber}{بارگذاری‌شماره}
-\setinterfacecommand{setupnumbering}{بارگذاری‌شماره‌گذاری}
-\setinterfacecommand{setupoppositeplacing}{بارگذاری‌درج‌مخالÙ}
-\setinterfacecommand{setupoutput}{بارگذاری‌خروجی}
-\setinterfacecommand{setuppagecomment}{بارگذاری‌توضیح‌صÙحه}
-\setinterfacecommand{setuppagenumber}{بارگذاری‌شماره‌صÙحه}
-\setinterfacecommand{setuppagenumbering}{بارگذاری‌شماره‌گذاری‌صÙحه}
-\setinterfacecommand{setuppagetransitions}{بارگذاری‌گذارصÙحه}
-\setinterfacecommand{setuppalet}{بارگذاری‌لوح}
-\setinterfacecommand{setuppaper}{بارگذاری‌برگ}
-\setinterfacecommand{setuppapersize}{بارگذاری‌اندازه‌برگ}
-\setinterfacecommand{setupparagraphnumbering}{بارگذاری‌شماره‌گذاری‌پاراگراÙ}
-\setinterfacecommand{setupparagraphs}{بارگذاری‌پاراگراÙها}
-\setinterfacecommand{setupperiodkerning}{setupperiodkerning}
-\setinterfacecommand{setupplacement}{بارگذاری‌جانشانی}
-\setinterfacecommand{setuppositioning}{بارگذاری‌مکان‌گذاری}
-\setinterfacecommand{setupprofiles}{بارگذاری‌پروÙایلها}
-\setinterfacecommand{setupprograms}{بارگذاری‌برنامه‌ها}
-\setinterfacecommand{setuppublications}{بارگذاری‌نشرها}
-\setinterfacecommand{setupquote}{بارگذاری‌نقل}
-\setinterfacecommand{setupreferencelist}{بارگذاری‌لیست‌مرجع}
-\setinterfacecommand{setupreferencing}{بارگذاری‌ارجاع}
-\setinterfacecommand{setupregister}{بارگذاری‌ثبت}
-\setinterfacecommand{setuprotate}{بارگذاری‌دوران}
-\setinterfacecommand{setuprule}{بارگذاری‌خط}
-\setinterfacecommand{setupscreens}{بارگذاری‌پرده‌ها}
-\setinterfacecommand{setupsection}{بارگذاری‌بخش}
-\setinterfacecommand{setupsectionblock}{بارگذاری‌بلوک‌بخش}
-\setinterfacecommand{setupsorting}{بارگذاری‌ترتیب}
-\setinterfacecommand{setupspacing}{بارگذاری‌Ùضا‌گذاری}
-\setinterfacecommand{setupstartstop}{بارگذاری‌شروع‌پایان}
-\setinterfacecommand{setupstrut}{بارگذاری‌بست}
-\setinterfacecommand{setupsubpagenumber}{بارگذاری‌شماره‌زیرصÙحه}
-\setinterfacecommand{setupsymbolset}{بارگذاری‌مجموعه‌نماد}
-\setinterfacecommand{setupsynchronization}{بارگذاری‌تطابق}
-\setinterfacecommand{setupsynchronizationbar}{بارگذاری‌میله‌تطابق}
-\setinterfacecommand{setupsynonyms}{بارگذاری‌مترادÙها}
-\setinterfacecommand{setupsystem}{بارگذاری‌سیستم}
-\setinterfacecommand{setuptab}{بارگذاری‌تب}
-\setinterfacecommand{setuptables}{بارگذاری‌جدولها}
-\setinterfacecommand{setuptabulate}{بارگذاری‌جدول‌بندی}
-\setinterfacecommand{setuptext}{بارگذاری‌متن}
-\setinterfacecommand{setuptextbackground}{setuptextbackground}
-\setinterfacecommand{setuptextnote}{setuptextnote}
-\setinterfacecommand{setuptextposition}{بارگذاری‌مکان‌متن}
-\setinterfacecommand{setuptextrules}{بارگذاری‌خطهای‌متن}
-\setinterfacecommand{setuptexttexts}{بارگذاری‌متن‌متنها}
-\setinterfacecommand{setuptextvariable}{بارگذاری‌متغیر‌متن}
-\setinterfacecommand{setupthinrules}{بارگذاری‌خطها‌ی‌نازک}
-\setinterfacecommand{setuptolerance}{بارگذاری‌بردباری}
-\setinterfacecommand{setuptop}{بارگذاری‌بالا}
-\setinterfacecommand{setuptoptexts}{بارگذاری‌متنهای‌بالا}
-\setinterfacecommand{setuptype}{بارگذاری‌تایپ}
-\setinterfacecommand{setuptyping}{بارگذاری‌تایپ‌کردن}
-\setinterfacecommand{setupunderbar}{بارگذاری‌میله‌زیر}
-\setinterfacecommand{setupurl}{setupurl}
-\setinterfacecommand{setupversions}{بارگذاری‌نسخه‌ها}
-\setinterfacecommand{setupwhitespace}{بارگذاری‌Ùضای‌سÙید}
-\setinterfacecommand{setvisualizerfont}{setvisualizerfont}
-\setinterfacecommand{showbodyfont}{نمایش‌قلم‌بدنه}
-\setinterfacecommand{showbodyfontenvironment}{نمایش‌محیط‌قلم‌بدنه}
-\setinterfacecommand{showcolor}{نمایش‌رنگ}
-\setinterfacecommand{showcolorgroup}{نمایش‌گروه‌رنگ}
-\setinterfacecommand{showcounter}{showcounter}
-\setinterfacecommand{showexternalfigures}{نمایش‌شکلهای‌خارجی}
-\setinterfacecommand{showfields}{نمایش‌میدانها}
-\setinterfacecommand{showfont}{showfont}
-\setinterfacecommand{showfontdata}{showfontdata}
-\setinterfacecommand{showfontexpansion}{showfontexpansion}
-\setinterfacecommand{showfontitalics}{showfontitalics}
-\setinterfacecommand{showfontkerns}{showfontkerns}
-\setinterfacecommand{showfontparameters}{showfontparameters}
-\setinterfacecommand{showfontstrip}{showfontstrip}
-\setinterfacecommand{showfontstyle}{showfontstyle}
-\setinterfacecommand{showframe}{نمایش‌قالب}
-\setinterfacecommand{showgrid}{نمایش‌توری}
-\setinterfacecommand{showhyphenationtrace}{showhyphenationtrace}
-\setinterfacecommand{showkerning}{showkerning}
-\setinterfacecommand{showlayout}{نمایش‌طرح‌بندی}
-\setinterfacecommand{showmakeup}{نمایش‌آرایش}
-\setinterfacecommand{showminimalbaseline}{showminimalbaseline}
-\setinterfacecommand{showpalet}{نمایش‌لوح}
-\setinterfacecommand{showprint}{نمایش‌چاپ}
-\setinterfacecommand{showsetups}{نمایش‌بارگذاریها}
-\setinterfacecommand{showstruts}{نمایش‌بستها}
-\setinterfacecommand{showsymbolset}{نمایش‌مجموعه‌علامت}
-\setinterfacecommand{smallcapped}{cap}
-\setinterfacecommand{someline}{یک‌خط}
-\setinterfacecommand{somewhere}{یک‌جا}
-\setinterfacecommand{space}{Ùضا}
-\setinterfacecommand{specialitem}{specialitem}
-\setinterfacecommand{splitfloat}{شکاÙتن‌شناور}
-\setinterfacecommand{startalignment}{شروع‌تنظیم}
-\setinterfacecommand{startbackground}{شروع‌پس‌زمینه}
-\setinterfacecommand{startcoding}{شروع‌کد}
-\setinterfacecommand{startcolor}{شروع‌رنگ}
-\setinterfacecommand{startcolumnmakeup}{شروع‌آرایش‌ستون}
-\setinterfacecommand{startcolumns}{شروع‌ستونها}
-\setinterfacecommand{startcolumnset}{شروع‌مجموعه‌ستون}
-\setinterfacecommand{startcombination}{شروع‌ترکیب}
-\setinterfacecommand{startcomponent}{شروع‌مولÙÙ‡}
-\setinterfacecommand{startdocument}{شروع‌نوشتار}
-\setinterfacecommand{startenvironment}{شروع‌محیط}
-\setinterfacecommand{startfigure}{شروع‌شکل}
-\setinterfacecommand{startframed}{startframed}
-\setinterfacecommand{startglobal}{شروع‌سراسری}
-\setinterfacecommand{startline}{شروع‌خط}
-\setinterfacecommand{startlinecorrection}{شروع‌تصحیح‌خط}
-\setinterfacecommand{startlinenote}{startlinenote}
-\setinterfacecommand{startlinenumbering}{شروع‌شماره‌گذاری‌خط}
-\setinterfacecommand{startlines}{شروع‌خطها}
-\setinterfacecommand{startlocal}{شروع‌موضعی}
-\setinterfacecommand{startlocalfootnotes}{شروع‌پانوشتهای‌موضعی}
-\setinterfacecommand{startmakeup}{شروع‌آرایش}
-\setinterfacecommand{startmarginblock}{شروع‌بلوک‌حاشیه}
-\setinterfacecommand{startmarginrule}{شروع‌خط‌حاشیه}
-\setinterfacecommand{startnarrower}{شروع‌باریکتر}
-\setinterfacecommand{startopposite}{شروع‌مخالÙ}
-\setinterfacecommand{startoverlay}{شروع‌پوشش}
-\setinterfacecommand{startoverview}{شروع‌بازبینی}
-\setinterfacecommand{startpacked}{شروع‌Ùشرده}
-\setinterfacecommand{startpositioning}{شروع‌مکان‌گذاری}
-\setinterfacecommand{startproduct}{شروع‌تولید}
-\setinterfacecommand{startprofile}{شروع‌پروÙایل}
-\setinterfacecommand{startproject}{شروع‌پروژه}
-\setinterfacecommand{startquotation}{شروع‌نقل‌قول}
-\setinterfacecommand{startraster}{startraster}
-\setinterfacecommand{startsymbolset}{شروع‌مجموعه‌نماد}
-\setinterfacecommand{startsynchronization}{شروع‌تطابق}
-\setinterfacecommand{starttable}{شروع‌جدول}
-\setinterfacecommand{starttables}{شروع‌جدولها}
-\setinterfacecommand{starttext}{شروع‌متن}
-\setinterfacecommand{starttextbackground}{starttextbackground}
-\setinterfacecommand{starttextrule}{شروع‌خط‌متن}
-\setinterfacecommand{startunpacked}{شروع‌غیر‌Ùشرده}
-\setinterfacecommand{startversion}{شروع‌نسخه}
-\setinterfacecommand{stopalignment}{پایان‌تنظیم}
-\setinterfacecommand{stopbackground}{پایان‌پس‌زمینه}
-\setinterfacecommand{stopcoding}{پایان‌کد}
-\setinterfacecommand{stopcolor}{پایان‌رنگ}
-\setinterfacecommand{stopcolumnmakeup}{پایان‌آرایش‌ستون}
-\setinterfacecommand{stopcolumns}{پایان‌ستونها}
-\setinterfacecommand{stopcolumnset}{پایان‌مجموعه‌ستون}
-\setinterfacecommand{stopcombination}{پایان‌ترکیب}
-\setinterfacecommand{stopcomponent}{پایان‌مولÙÙ‡}
-\setinterfacecommand{stopdocument}{پایان‌نوشتار}
-\setinterfacecommand{stopenvironment}{پایان‌محیط}
-\setinterfacecommand{stopframed}{stopframed}
-\setinterfacecommand{stopglobal}{پایان‌سراسری}
-\setinterfacecommand{stopline}{پایان‌خط}
-\setinterfacecommand{stoplinecorrection}{پایان‌تصحیح‌خط}
-\setinterfacecommand{stoplinenote}{stoplinenote}
-\setinterfacecommand{stoplinenumbering}{پایان‌شماره‌گذاری‌خط}
-\setinterfacecommand{stoplines}{پایان‌خطها}
-\setinterfacecommand{stoplocal}{پایان‌موضعی}
-\setinterfacecommand{stoplocalfootnotes}{پایان‌پانوشتهای‌موضعی}
-\setinterfacecommand{stopmakeup}{پایان‌آرایش}
-\setinterfacecommand{stopmarginblock}{پایان‌بلوک‌حاشیه}
-\setinterfacecommand{stopmarginrule}{پایان‌خط‌حاشیه}
-\setinterfacecommand{stopnarrower}{پایان‌نازکتر}
-\setinterfacecommand{stopopposite}{پایان‌مخالÙ}
-\setinterfacecommand{stopoverlay}{پایان‌پوشش}
-\setinterfacecommand{stopoverview}{پایان‌بازبینی}
-\setinterfacecommand{stoppacked}{پایان‌Ùشرده}
-\setinterfacecommand{stoppositioning}{پایان‌مکان‌گذاری}
-\setinterfacecommand{stopproduct}{پایان‌تولید}
-\setinterfacecommand{stopprofile}{پایان‌پروÙایل}
-\setinterfacecommand{stopproject}{پایان‌پروژه}
-\setinterfacecommand{stopquotation}{پایان‌نقل‌قول}
-\setinterfacecommand{stopraster}{stopraster}
-\setinterfacecommand{stopsynchronization}{پایان‌تطابق}
-\setinterfacecommand{stoptable}{پایان‌جدول}
-\setinterfacecommand{stoptables}{پایان‌جدولها}
-\setinterfacecommand{stoptext}{پایان‌متن}
-\setinterfacecommand{stoptextbackground}{stoptextbackground}
-\setinterfacecommand{stoptextrule}{پایان‌خط‌متن}
-\setinterfacecommand{stopunpacked}{پایان‌غیرÙشرده}
-\setinterfacecommand{stopversion}{پایان‌نسخه}
-\setinterfacecommand{stretched}{کشیده}
-\setinterfacecommand{strictinspectnextcharacter}{strictinspectnextcharacter}
-\setinterfacecommand{stripcharacter}{stripcharacter}
-\setinterfacecommand{subformulanumber}{شماره‌زیرÙرمول}
-\setinterfacecommand{subpagenumber}{شماره‌زیرصÙحه}
-\setinterfacecommand{subtractfeature}{subtractfeature}
-\setinterfacecommand{switchtobodyfont}{تغییربه‌قلم‌بدنه}
-\setinterfacecommand{switchtorawfont}{تغییربه‌قلم‌خام}
-\setinterfacecommand{sym}{نم}
-\setinterfacecommand{symbol}{نماد}
-\setinterfacecommand{symoffset}{symoffset}
-\setinterfacecommand{synchronizationbar}{میله‌تطابق}
-\setinterfacecommand{synchronize}{تطابق}
-\setinterfacecommand{tab}{تب}
-\setinterfacecommand{testcolumn}{ستون‌امتحان}
-\setinterfacecommand{testfeature}{testfeature}
-\setinterfacecommand{testfeatureonce}{testfeatureonce}
-\setinterfacecommand{testpage}{صÙحه‌تست}
-\setinterfacecommand{tex}{تک}
-\setinterfacecommand{textbackground}{textbackground}
-\setinterfacecommand{textcolor}{textcolor}
-\setinterfacecommand{textheight}{ارتÙاع‌متن}
-\setinterfacecommand{textnote}{textnote}
-\setinterfacecommand{textreference}{مرجع‌متن}
-\setinterfacecommand{textrule}{خط‌متن}
-\setinterfacecommand{textvariable}{متغیر متن}
-\setinterfacecommand{textwidth}{عرض‌متن}
-\setinterfacecommand{thefirstcharacter}{thefirstcharacter}
-\setinterfacecommand{thenormalizedbodyfontsize}{thenormalizedbodyfontsize}
-\setinterfacecommand{theremainingcharacters}{theremainingcharacters}
-\setinterfacecommand{thinrule}{خط‌نازک}
-\setinterfacecommand{thinrules}{خطهای‌نازک}
-\setinterfacecommand{tolinenote}{tolinenote}
-\setinterfacecommand{tooltip}{tooltip}
-\setinterfacecommand{topdistance}{Ùاصله‌بالا}
-\setinterfacecommand{topheight}{ارتÙاع‌بالا}
-\setinterfacecommand{topspace}{Ùضای‌بالا}
-\setinterfacecommand{totalnumberofpages}{شماره‌کل‌صÙحه‌ها}
-\setinterfacecommand{translate}{ترجمه}
-\setinterfacecommand{txt}{txt}
-\setinterfacecommand{typ}{typ}
-\setinterfacecommand{type}{تایپ}
-\setinterfacecommand{typebuffer}{تایپ‌باÙر}
-\setinterfacecommand{typedefinedbuffer}{typedefinedbuffer}
-\setinterfacecommand{typefile}{تایپ‌پرونده}
-\setinterfacecommand{typeinlinebuffer}{typeinlinebuffer}
-\setinterfacecommand{typing}{typing}
-\setinterfacecommand{unitmeaning}{معنی‌واحد}
-\setinterfacecommand{unknown}{ناشناس}
-\setinterfacecommand{unregisterhyphenationpattern}{unregisterhyphenationpattern}
-\setinterfacecommand{useJSscripts}{useJSscripts}
-\setinterfacecommand{useURL}{useURL}
-\setinterfacecommand{useXMLfilter}{useXMLfilter}
-\setinterfacecommand{useblocks}{استÙاده‌بلوکها}
-\setinterfacecommand{usebodyfont}{usebodyfont}
-\setinterfacecommand{usebodyfontparameter}{usebodyfontparameter}
-\setinterfacecommand{usecommands}{استÙاده‌Ùرمانها}
-\setinterfacecommand{useencoding}{استÙاده‌رمزینه}
-\setinterfacecommand{useexternaldocument}{استÙاده‌نوشتارخارجی}
-\setinterfacecommand{useexternalfigure}{استÙاده‌شکل‌خارجی}
-\setinterfacecommand{useexternalfile}{استÙاده‌پرونده‌خارجی}
-\setinterfacecommand{useexternalfiles}{استÙاده‌پرونده‌های‌خارجی}
-\setinterfacecommand{useexternalsoundtrack}{استÙاده‌قطعه‌موزیک‌خارجی}
-\setinterfacecommand{usemodule}{استÙاده‌مدول}
-\setinterfacecommand{usemodules}{استÙاده‌مدولها}
-\setinterfacecommand{usepath}{استÙاده‌مسیر}
-\setinterfacecommand{usereferences}{استÙاده‌مرجعها}
-\setinterfacecommand{usespecials}{استÙاده‌ویژگیها}
-\setinterfacecommand{usesymbols}{استÙاده‌نمادها}
-\setinterfacecommand{usetypescript}{استÙاده‌دستخط‌تایپ}
-\setinterfacecommand{usetypescriptfile}{استÙاده‌پرونده‌دستخط‌تایپ}
-\setinterfacecommand{useurl}{useurl}
-\setinterfacecommand{verbatim}{verbatim}
-\setinterfacecommand{version}{نسخه}
-\setinterfacecommand{vl}{خ‌ع}
-\setinterfacecommand{weekday}{روزهÙته}
-\setinterfacecommand{whitespace}{Ùضای‌سÙید}
-\setinterfacecommand{widthspanningtext}{widthspanningtext}
-\setinterfacecommand{wordright}{کلمه‌راست}
-\setinterfacecommand{writebetweenlist}{بنویس‌بین‌لیست}
-\setinterfacecommand{writetolist}{بنویس‌در‌لیست}
-\setinterfacecommand{writetoreferencelist}{بنویس‌درلیست‌مرجع}
-\setinterfacecommand{writetoregister}{بنویس‌درثبت}
-%
-\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/context/base/mkii/mult-ro.mkii b/Master/texmf-dist/tex/context/base/mkii/mult-ro.mkii
deleted file mode 100644
index e497b8d6b79..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/mult-ro.mkii
+++ /dev/null
@@ -1,2224 +0,0 @@
-% this file is auto-generated, don't edit this file
-%
-% definitions for interface variables for language ro
-%
-\setinterfacevariable{Addition}{Adaugare}
-\setinterfacevariable{Alphabetic}{Alphabetic}
-\setinterfacevariable{Balloon}{Balon}
-\setinterfacevariable{Cap}{Cap}
-\setinterfacevariable{Capital}{Majuscula}
-\setinterfacevariable{Character}{Caracter}
-\setinterfacevariable{Characters}{Caractere}
-\setinterfacevariable{CloseDocument}{InchideDocument}
-\setinterfacevariable{ExitViewer}{IesireVizualizator}
-\setinterfacevariable{FirstPage}{PrimaPagina}
-\setinterfacevariable{FitHeight}{AjustatInaltime}
-\setinterfacevariable{FitWidth}{AjustatLatime}
-\setinterfacevariable{GotoPage}{LaPagina}
-\setinterfacevariable{Greek}{Grec}
-\setinterfacevariable{Help}{Ajutor}
-\setinterfacevariable{HideField}{AscundeCamp}
-\setinterfacevariable{HideLayer}{HideLayer}
-\setinterfacevariable{Key}{Cheie}
-\setinterfacevariable{LastPage}{UltimaPagina}
-\setinterfacevariable{LoadForm}{IncarcaFormular}
-\setinterfacevariable{MONTH}{LUNA}
-\setinterfacevariable{New}{Nou}
-\setinterfacevariable{NextJump}{SaltUrmator}
-\setinterfacevariable{NextPage}{PaginaUrmatoare}
-\setinterfacevariable{Numbers}{Numere}
-\setinterfacevariable{OpenNamedDocument}{OpenNamedDocument}
-\setinterfacevariable{Ordinal}{Ordinal}
-\setinterfacevariable{Paragraph}{Paragraf}
-\setinterfacevariable{PauseMovie}{PauzaFilm}
-\setinterfacevariable{PauseRendering}{PauseRendering}
-\setinterfacevariable{PauseSound}{PauzaSunet}
-\setinterfacevariable{PreviousJump}{SaltPrecedent}
-\setinterfacevariable{PreviousPage}{PaginaPrecedenta}
-\setinterfacevariable{PrintDocument}{TiparesteDocument}
-\setinterfacevariable{Query}{Query}
-\setinterfacevariable{QueryAgain}{QueryAgain}
-\setinterfacevariable{ResetForm}{ResetareFormular}
-\setinterfacevariable{ResumeMovie}{RepornesteFilm}
-\setinterfacevariable{ResumeRendering}{ResumeRendering}
-\setinterfacevariable{ResumeSound}{RepornesteSunet}
-\setinterfacevariable{Romannumerals}{Numereromane}
-\setinterfacevariable{SaveDocument}{SalvareDocument}
-\setinterfacevariable{SaveForm}{SalveazaFormular}
-\setinterfacevariable{SaveNamedDocument}{SaveNamedDocument}
-\setinterfacevariable{SearchAgain}{CautaDinNou}
-\setinterfacevariable{SearchDocument}{CautaDocument}
-\setinterfacevariable{ShowBookmarks}{ShowBookmarks}
-\setinterfacevariable{ShowField}{AfiseazaCamp}
-\setinterfacevariable{ShowThumbs}{ShowThumbs}
-\setinterfacevariable{StartMovie}{StartFilm}
-\setinterfacevariable{StartRendering}{StartRendering}
-\setinterfacevariable{StartSound}{StartSunet}
-\setinterfacevariable{StopMovie}{StopFilm}
-\setinterfacevariable{StopRendering}{StopRendering}
-\setinterfacevariable{StopSound}{StopSunet}
-\setinterfacevariable{SubmitForm}{TrimiteFormular}
-\setinterfacevariable{ToggleLayer}{ToggleLayer}
-\setinterfacevariable{ToggleViewer}{SchimbaVizualizator}
-\setinterfacevariable{URL}{URL}
-\setinterfacevariable{VideLayer}{VideLayer}
-\setinterfacevariable{ViewerHelp}{AjutorVizualizator}
-\setinterfacevariable{WEEKDAY}{ZISAPTAMANA}
-\setinterfacevariable{WORD}{CUVANT}
-\setinterfacevariable{WORDS}{CUVINTE}
-\setinterfacevariable{Word}{Cuvant}
-\setinterfacevariable{Words}{Cuvinte}
-\setinterfacevariable{abbreviation}{abreviere}
-\setinterfacevariable{abbreviations}{abrevieri}
-\setinterfacevariable{absolute}{absolut}
-\setinterfacevariable{action}{actiune}
-\setinterfacevariable{after}{dupa}
-\setinterfacevariable{all}{tot}
-\setinterfacevariable{alphabetic}{alphabetic}
-\setinterfacevariable{always}{totdeauna}
-\setinterfacevariable{anchor}{anchor}
-\setinterfacevariable{and}{and}
-\setinterfacevariable{answerarea}{answerarea}
-\setinterfacevariable{appendices}{apendixuri}
-\setinterfacevariable{appendix}{apendix}
-\setinterfacevariable{april}{aprilie}
-\setinterfacevariable{aside}{aside}
-\setinterfacevariable{atleftmargin}{atleftmargin}
-\setinterfacevariable{atmargin}{lamargine}
-\setinterfacevariable{atpage}{lapagina}
-\setinterfacevariable{atrightmargin}{atrightmargin}
-\setinterfacevariable{attachment}{attachment}
-\setinterfacevariable{august}{august}
-\setinterfacevariable{author}{autor}
-\setinterfacevariable{auto}{auto}
-\setinterfacevariable{autointro}{autointro}
-\setinterfacevariable{autopunctuation}{autopunctuation}
-\setinterfacevariable{back}{inapot}
-\setinterfacevariable{background}{fundal}
-\setinterfacevariable{backmatter}{epilogul}
-\setinterfacevariable{backpart}{epilog}
-\setinterfacevariable{backspace}{spatiuspate}
-\setinterfacevariable{backward}{inapoi}
-\setinterfacevariable{bbl}{bbl}
-\setinterfacevariable{before}{inainte}
-\setinterfacevariable{begin}{begin}
-\setinterfacevariable{bib}{bib}
-\setinterfacevariable{big}{mare}
-\setinterfacevariable{bigbodyfont}{bigbodyfont}
-\setinterfacevariable{bigger}{bigger}
-\setinterfacevariable{bigpreference}{preferintamare}
-\setinterfacevariable{blank}{blank}
-\setinterfacevariable{block}{block}
-\setinterfacevariable{blockquote}{blockquote}
-\setinterfacevariable{bodymatter}{principalul}
-\setinterfacevariable{bodypart}{principal}
-\setinterfacevariable{bold}{aldin}
-\setinterfacevariable{bolditalic}{aldinitalic}
-\setinterfacevariable{boldslanted}{aldininclinat}
-\setinterfacevariable{bookmark}{semncarte}
-\setinterfacevariable{both}{ambele}
-\setinterfacevariable{bothtext}{bothtext}
-\setinterfacevariable{bottom}{subsol}
-\setinterfacevariable{box}{box}
-\setinterfacevariable{brief}{brief}
-\setinterfacevariable{broad}{broad}
-\setinterfacevariable{buffer}{buffer}
-\setinterfacevariable{by}{de}
-\setinterfacevariable{calligraphic}{caligrafic}
-\setinterfacevariable{camel}{camel}
-\setinterfacevariable{cap}{cap}
-\setinterfacevariable{capital}{majuscula}
-\setinterfacevariable{category}{category}
-\setinterfacevariable{cd:character}{cd:character}
-\setinterfacevariable{cd:font}{cd:font}
-\setinterfacevariable{center}{center}
-\setinterfacevariable{centerlast}{centerlast}
-\setinterfacevariable{chapter}{capitol}
-\setinterfacevariable{character}{caracter}
-\setinterfacevariable{characters}{caractere}
-\setinterfacevariable{chemical}{chemical}
-\setinterfacevariable{chemicals}{chemicals}
-\setinterfacevariable{chemistry}{chemistry}
-\setinterfacevariable{cite}{cite}
-\setinterfacevariable{closed}{closed}
-\setinterfacevariable{color}{culoare}
-\setinterfacevariable{column}{coloana}
-\setinterfacevariable{columns}{coloane}
-\setinterfacevariable{combination}{combination}
-\setinterfacevariable{command}{comanda}
-\setinterfacevariable{commands}{comenzi}
-\setinterfacevariable{comment}{comentariu}
-\setinterfacevariable{component}{componenta}
-\setinterfacevariable{compressseparator}{compressseparator}
-\setinterfacevariable{compressstopper}{compressstopper}
-\setinterfacevariable{concept}{concept}
-\setinterfacevariable{construction}{construction}
-\setinterfacevariable{content}{cuprins}
-\setinterfacevariable{contents}{cuprinsuri}
-\setinterfacevariable{continue}{continuu}
-\setinterfacevariable{continued}{continued}
-\setinterfacevariable{controls}{controale}
-\setinterfacevariable{conversion}{conversie}
-\setinterfacevariable{current}{curent}
-\setinterfacevariable{cutspace}{cutspace}
-\setinterfacevariable{dataset}{dataset}
-\setinterfacevariable{date}{data}
-\setinterfacevariable{day}{zi}
-\setinterfacevariable{december}{decembrie}
-\setinterfacevariable{default}{implicit}
-\setinterfacevariable{depth}{adancime}
-\setinterfacevariable{description}{descriere}
-\setinterfacevariable{disable}{dezactivat}
-\setinterfacevariable{display}{display}
-\setinterfacevariable{dot}{punct}
-\setinterfacevariable{doublesided}{douafete}
-\setinterfacevariable{down}{down}
-\setinterfacevariable{each}{fiecare}
-\setinterfacevariable{edge}{bordura}
-\setinterfacevariable{effective}{effective}
-\setinterfacevariable{eight}{eight}
-\setinterfacevariable{embed}{embed}
-\setinterfacevariable{empty}{gol}
-\setinterfacevariable{enable}{enable}
-\setinterfacevariable{end}{end}
-\setinterfacevariable{endnote}{endnote}
-\setinterfacevariable{enumeration}{enumerare}
-\setinterfacevariable{environment}{mediu}
-\setinterfacevariable{even}{par}
-\setinterfacevariable{export}{export}
-\setinterfacevariable{external}{extern}
-\setinterfacevariable{extremestretch}{extremestretch}
-\setinterfacevariable{fact}{fapt}
-\setinterfacevariable{fallback}{fallback}
-\setinterfacevariable{february}{februarie}
-\setinterfacevariable{field}{field}
-\setinterfacevariable{figure}{figura}
-\setinterfacevariable{figures}{figure}
-\setinterfacevariable{file}{fisier}
-\setinterfacevariable{final}{final}
-\setinterfacevariable{first}{primul}
-\setinterfacevariable{firstcolumn}{firstcolumn}
-\setinterfacevariable{firstpage}{primapagina}
-\setinterfacevariable{firstsubpage}{primasubpagina}
-\setinterfacevariable{fit}{ajustat}
-\setinterfacevariable{five}{cinci}
-\setinterfacevariable{fix}{fix}
-\setinterfacevariable{fixed}{fixat}
-\setinterfacevariable{flexible}{flexibil}
-\setinterfacevariable{float}{obiectmobil}
-\setinterfacevariable{flushinner}{flushinner}
-\setinterfacevariable{flushleft}{flushleft}
-\setinterfacevariable{flushouter}{flushouter}
-\setinterfacevariable{flushright}{flushright}
-\setinterfacevariable{followingpage}{followingpage}
-\setinterfacevariable{font}{font}
-\setinterfacevariable{footer}{subsol}
-\setinterfacevariable{footnote}{notasubsol}
-\setinterfacevariable{force}{fortat}
-\setinterfacevariable{foreground}{primplan}
-\setinterfacevariable{formula}{formula}
-\setinterfacevariable{formulas}{formule}
-\setinterfacevariable{forward}{avans}
-\setinterfacevariable{four}{patru}
-\setinterfacevariable{fractions}{fractions}
-\setinterfacevariable{frame}{incadrat}
-\setinterfacevariable{framedtext}{textinconjurat}
-\setinterfacevariable{friday}{vineri}
-\setinterfacevariable{frontmatter}{prologul}
-\setinterfacevariable{frontpart}{prolog}
-\setinterfacevariable{fullhz}{fullhz}
-\setinterfacevariable{global}{global}
-\setinterfacevariable{graphic}{graficul}
-\setinterfacevariable{graphics}{graficele}
-\setinterfacevariable{gray}{gri}
-\setinterfacevariable{greek}{grec}
-\setinterfacevariable{grid}{grila}
-\setinterfacevariable{halfline}{jumatatelinie}
-\setinterfacevariable{handwritten}{scrismanual}
-\setinterfacevariable{hang}{suspenda}
-\setinterfacevariable{hanging}{suspendat}
-\setinterfacevariable{hangingboth}{hangingboth}
-\setinterfacevariable{head}{antet}
-\setinterfacevariable{header}{antet}
-\setinterfacevariable{headintext}{headintext}
-\setinterfacevariable{height}{inaltime}
-\setinterfacevariable{helptext}{textajutator}
-\setinterfacevariable{hencefore}{precedent}
-\setinterfacevariable{here}{aici}
-\setinterfacevariable{hereafter}{urmator}
-\setinterfacevariable{hidden}{ascuns}
-\setinterfacevariable{hiddenbar}{hiddenbar}
-\setinterfacevariable{hiding}{ascundere}
-\setinterfacevariable{high}{inalt}
-\setinterfacevariable{horizontal}{orizontal}
-\setinterfacevariable{hyphenated}{despsilabe}
-\setinterfacevariable{hz}{hz}
-\setinterfacevariable{inbetween}{intre}
-\setinterfacevariable{index}{index}
-\setinterfacevariable{indices}{indexuri}
-\setinterfacevariable{inherit}{inherit}
-\setinterfacevariable{ininner}{ininner}
-\setinterfacevariable{ininneredge}{ininneredge}
-\setinterfacevariable{ininnermargin}{ininnermargin}
-\setinterfacevariable{inleft}{instanga}
-\setinterfacevariable{inleftedge}{inparteastanga}
-\setinterfacevariable{inleftmargin}{inmargineastanga}
-\setinterfacevariable{inline}{inline}
-\setinterfacevariable{inmargin}{inmargine}
-\setinterfacevariable{inner}{intern}
-\setinterfacevariable{inneredge}{inneredge}
-\setinterfacevariable{innermargin}{innermargin}
-\setinterfacevariable{inother}{inother}
-\setinterfacevariable{inouter}{inouter}
-\setinterfacevariable{inouteredge}{inouteredge}
-\setinterfacevariable{inoutermargin}{inoutermargin}
-\setinterfacevariable{inright}{indreapta}
-\setinterfacevariable{inrightedge}{inparteadreapta}
-\setinterfacevariable{inrightmargin}{inmargineadreapta}
-\setinterfacevariable{integral}{integral}
-\setinterfacevariable{interaction}{interactiune}
-\setinterfacevariable{interactionmenu}{meniuinteractiune}
-\setinterfacevariable{interactive}{interactive}
-\setinterfacevariable{intermezzi}{intermezzi}
-\setinterfacevariable{intermezzo}{intermezzo}
-\setinterfacevariable{intext}{intext}
-\setinterfacevariable{intro}{intro}
-\setinterfacevariable{invertedshort}{invertedshort}
-\setinterfacevariable{italic}{italic}
-\setinterfacevariable{italicbold}{italicaldin}
-\setinterfacevariable{item}{element}
-\setinterfacevariable{itemize}{enumerare}
-\setinterfacevariable{its}{propriu}
-\setinterfacevariable{january}{ianuarie}
-\setinterfacevariable{joinedup}{unit}
-\setinterfacevariable{july}{iulie}
-\setinterfacevariable{june}{iunie}
-\setinterfacevariable{keep}{mentine}
-\setinterfacevariable{kerncharacters}{kerncharacters}
-\setinterfacevariable{knockout}{knockout}
-\setinterfacevariable{label}{eticheta}
-\setinterfacevariable{landscape}{vedere}
-\setinterfacevariable{last}{ultim}
-\setinterfacevariable{lastcolumn}{lastcolumn}
-\setinterfacevariable{lastpage}{ultimapagina}
-\setinterfacevariable{lastpagenumber}{lastpagenumber}
-\setinterfacevariable{lastsubpage}{ultimasubpagina}
-\setinterfacevariable{layer}{layer}
-\setinterfacevariable{left}{stanga}
-\setinterfacevariable{leftedge}{bordurastanga}
-\setinterfacevariable{lefthanging}{lefthanging}
-\setinterfacevariable{leftmargin}{marginestanga}
-\setinterfacevariable{leftpage}{paginastanga}
-\setinterfacevariable{lefttoright}{lefttoright}
-\setinterfacevariable{legend}{legenda}
-\setinterfacevariable{less}{less}
-\setinterfacevariable{lesshyphenation}{lesshyphenation}
-\setinterfacevariable{letterspacing}{letterspacing}
-\setinterfacevariable{line}{linie}
-\setinterfacevariable{linenote}{linenote}
-\setinterfacevariable{lines}{linii}
-\setinterfacevariable{linked}{linked}
-\setinterfacevariable{list}{lista}
-\setinterfacevariable{local}{local}
-\setinterfacevariable{localenvironment}{mediulocal}
-\setinterfacevariable{logo}{logo}
-\setinterfacevariable{logos}{logos}
-\setinterfacevariable{lohi}{lohi}
-\setinterfacevariable{long}{long}
-\setinterfacevariable{loose}{larg}
-\setinterfacevariable{low}{jos}
-\setinterfacevariable{ls}{ls}
-\setinterfacevariable{makeup}{marcaj}
-\setinterfacevariable{mar}{mar}
-\setinterfacevariable{march}{martie}
-\setinterfacevariable{margin}{margine}
-\setinterfacevariable{marginedge}{marginebordura}
-\setinterfacevariable{margintext}{textmarginal}
-\setinterfacevariable{margintitle}{titlumarginal}
-\setinterfacevariable{marking}{marcaje}
-\setinterfacevariable{math}{math}
-\setinterfacevariable{mathalignment}{mathalignment}
-\setinterfacevariable{mathcases}{mathcases}
-\setinterfacevariable{mathematics}{matematica}
-\setinterfacevariable{mathmatrix}{mathmatrix}
-\setinterfacevariable{max}{max}
-\setinterfacevariable{maxdepth}{maxdepth}
-\setinterfacevariable{maxheight}{maxheight}
-\setinterfacevariable{maxwidth}{maxwidth}
-\setinterfacevariable{may}{mai}
-\setinterfacevariable{mediaeval}{medieval}
-\setinterfacevariable{medium}{mediu}
-\setinterfacevariable{middle}{centru}
-\setinterfacevariable{min}{min}
-\setinterfacevariable{mindepth}{mindepth}
-\setinterfacevariable{minheight}{inaltimeminima}
-\setinterfacevariable{minwidth}{latimeminima}
-\setinterfacevariable{mirrored}{oglindit}
-\setinterfacevariable{mixed}{mixed}
-\setinterfacevariable{monday}{luni}
-\setinterfacevariable{mono}{mono}
-\setinterfacevariable{monobold}{monoaldin}
-\setinterfacevariable{mononormal}{mononormal}
-\setinterfacevariable{month}{luna}
-\setinterfacevariable{more}{more}
-\setinterfacevariable{morehyphenation}{morehyphenation}
-\setinterfacevariable{name}{nume}
-\setinterfacevariable{narrow}{ingust}
-\setinterfacevariable{negative}{negativ}
-\setinterfacevariable{never}{niciodata}
-\setinterfacevariable{new}{nou}
-\setinterfacevariable{next}{urmatorul}
-\setinterfacevariable{nextevenpage}{paginaparaurmatoarea}
-\setinterfacevariable{nextoddpage}{paginaimparaurmatoarea}
-\setinterfacevariable{nextpage}{paginaurmatoare}
-\setinterfacevariable{nextsubpage}{urmatoareasubpagina}
-\setinterfacevariable{nine}{nine}
-\setinterfacevariable{no}{nu}
-\setinterfacevariable{nocheck}{nocheck}
-\setinterfacevariable{nodepth}{nodepth}
-\setinterfacevariable{nofit}{nofit}
-\setinterfacevariable{nogrid}{nogrid}
-\setinterfacevariable{noheight}{noheight}
-\setinterfacevariable{nohz}{nohz}
-\setinterfacevariable{noline}{noline}
-\setinterfacevariable{nomarking}{faramarcare}
-\setinterfacevariable{nomenubar}{nomenubar}
-\setinterfacevariable{none}{niciunul}
-\setinterfacevariable{nonumber}{nonumber}
-\setinterfacevariable{norepeat}{norepeat}
-\setinterfacevariable{normal}{normal}
-\setinterfacevariable{normalshort}{normalshort}
-\setinterfacevariable{nospacing}{nospacing}
-\setinterfacevariable{nostopper}{nostopper}
-\setinterfacevariable{not}{nu}
-\setinterfacevariable{notation}{notation}
-\setinterfacevariable{note}{note}
-\setinterfacevariable{nothanging}{nothanging}
-\setinterfacevariable{nothyphenated}{nedespsilabe}
-\setinterfacevariable{notjoinedup}{notjoinedup}
-\setinterfacevariable{november}{noiembrie}
-\setinterfacevariable{nowhere}{niciunde}
-\setinterfacevariable{nowhite}{faraalb}
-\setinterfacevariable{number}{numar}
-\setinterfacevariable{numbers}{numere}
-\setinterfacevariable{october}{octombrie}
-\setinterfacevariable{odd}{impar}
-\setinterfacevariable{off}{dezactivat}
-\setinterfacevariable{offset}{offset}
-\setinterfacevariable{old}{old}
-\setinterfacevariable{oldstyle}{oldstyle}
-\setinterfacevariable{on}{on}
-\setinterfacevariable{one}{unu}
-\setinterfacevariable{opposite}{opus}
-\setinterfacevariable{ordinal}{ordinal}
-\setinterfacevariable{outer}{extern}
-\setinterfacevariable{outeredge}{outeredge}
-\setinterfacevariable{outermargin}{outermargin}
-\setinterfacevariable{overbar}{barasus}
-\setinterfacevariable{overbars}{supralinie}
-\setinterfacevariable{overlay}{overlay}
-\setinterfacevariable{overprint}{overprint}
-\setinterfacevariable{overstrike}{liniepeste}
-\setinterfacevariable{overstrikes}{liniipeste}
-\setinterfacevariable{packed}{impachetat}
-\setinterfacevariable{page}{pagina}
-\setinterfacevariable{pagecomment}{comentariupagina}
-\setinterfacevariable{pagenumber}{numarpagina}
-\setinterfacevariable{paper}{foaie}
-\setinterfacevariable{paragraph}{paragraf}
-\setinterfacevariable{part}{parte}
-\setinterfacevariable{positive}{positiv}
-\setinterfacevariable{postponing}{postponing}
-\setinterfacevariable{postscript}{postscript}
-\setinterfacevariable{precedingpage}{precedingpage}
-\setinterfacevariable{preference}{preferinta}
-\setinterfacevariable{preview}{previzualizare}
-\setinterfacevariable{previous}{precedent}
-\setinterfacevariable{previousevenpage}{paginaparaprecedenta}
-\setinterfacevariable{previousoddpage}{paginaimparaprecedenta}
-\setinterfacevariable{previouspage}{paginaanterioara}
-\setinterfacevariable{previoussubpage}{subpaginaanterioara}
-\setinterfacevariable{print}{print}
-\setinterfacevariable{printable}{tiparibil}
-\setinterfacevariable{process}{process}
-\setinterfacevariable{product}{produs}
-\setinterfacevariable{program}{program}
-\setinterfacevariable{project}{proiect}
-\setinterfacevariable{protected}{protejat}
-\setinterfacevariable{quadruple}{cvadrupul}
-\setinterfacevariable{quarterline}{quarterline}
-\setinterfacevariable{quotation}{citat}
-\setinterfacevariable{quote}{minicitat}
-\setinterfacevariable{ran}{rulat}
-\setinterfacevariable{random}{aleator}
-\setinterfacevariable{readonly}{readonly}
-\setinterfacevariable{rectangular}{rectangular}
-\setinterfacevariable{reference}{referinta}
-\setinterfacevariable{referral}{referinta}
-\setinterfacevariable{region}{region}
-\setinterfacevariable{register}{registru}
-\setinterfacevariable{regular}{regular}
-\setinterfacevariable{relative}{relativ}
-\setinterfacevariable{repeat}{repetat}
-\setinterfacevariable{required}{obligatoriu}
-\setinterfacevariable{reset}{reset}
-\setinterfacevariable{reverse}{reverse}
-\setinterfacevariable{right}{dreapta}
-\setinterfacevariable{rightedge}{borduradreapta}
-\setinterfacevariable{righthanging}{righthanging}
-\setinterfacevariable{rightmargin}{marginedreapta}
-\setinterfacevariable{rightpage}{paginadreapta}
-\setinterfacevariable{righttoleft}{righttoleft}
-\setinterfacevariable{roman}{roman}
-\setinterfacevariable{romannumerals}{numereromane}
-\setinterfacevariable{rotate}{rotit}
-\setinterfacevariable{rotated}{rotat}
-\setinterfacevariable{round}{rotund}
-\setinterfacevariable{row}{rand}
-\setinterfacevariable{rule}{rigla}
-\setinterfacevariable{samepage}{aceeasipagina}
-\setinterfacevariable{sans}{sans}
-\setinterfacevariable{sansbold}{sansaldin}
-\setinterfacevariable{sansnormal}{sansnormal}
-\setinterfacevariable{sansserif}{sansserif}
-\setinterfacevariable{saturday}{sambata}
-\setinterfacevariable{screen}{ecran}
-\setinterfacevariable{section}{sectiune}
-\setinterfacevariable{sectionblockenvironment}{blocsectiuneambient}
-\setinterfacevariable{sectionnumber}{numarsetiune}
-\setinterfacevariable{see}{vezi}
-\setinterfacevariable{selectfont}{selectfont}
-\setinterfacevariable{separator}{separator}
-\setinterfacevariable{september}{septembrie}
-\setinterfacevariable{serif}{serif}
-\setinterfacevariable{serifbold}{serifbold}
-\setinterfacevariable{serifnormal}{serifnormal}
-\setinterfacevariable{serried}{serried}
-\setinterfacevariable{setups}{setups}
-\setinterfacevariable{seven}{seven}
-\setinterfacevariable{sheet}{sheet}
-\setinterfacevariable{shiftdown}{shiftdown}
-\setinterfacevariable{shiftup}{shiftup}
-\setinterfacevariable{short}{short}
-\setinterfacevariable{simplefonts}{simplefonts}
-\setinterfacevariable{simplelist}{simplelist}
-\setinterfacevariable{singlesided}{ofata}
-\setinterfacevariable{six}{six}
-\setinterfacevariable{slanted}{inclinat}
-\setinterfacevariable{slantedbold}{inclinataldin}
-\setinterfacevariable{small}{mic}
-\setinterfacevariable{smallbodyfont}{smallbodyfont}
-\setinterfacevariable{smallbold}{micaldin}
-\setinterfacevariable{smallbolditalic}{micaldininclinat}
-\setinterfacevariable{smallboldslanted}{micaldininclinat}
-\setinterfacevariable{smallcaps}{majusculemici}
-\setinterfacevariable{smaller}{smaller}
-\setinterfacevariable{smallitalic}{micitalic}
-\setinterfacevariable{smallitalicbold}{micitalicaldin}
-\setinterfacevariable{smallnormal}{micnormal}
-\setinterfacevariable{smallslanted}{micinclinat}
-\setinterfacevariable{smallslantedbold}{micinclinataldin}
-\setinterfacevariable{smalltype}{mictype}
-\setinterfacevariable{somewhere}{undeva}
-\setinterfacevariable{sorted}{sortat}
-\setinterfacevariable{sorting}{sorting}
-\setinterfacevariable{space}{spatiu}
-\setinterfacevariable{spacing}{spatiere}
-\setinterfacevariable{speech}{speech}
-\setinterfacevariable{split}{split}
-\setinterfacevariable{spot}{spot}
-\setinterfacevariable{standard}{standard}
-\setinterfacevariable{start}{start}
-\setinterfacevariable{starter}{starter}
-\setinterfacevariable{sticker}{sticker}
-\setinterfacevariable{stop}{stop}
-\setinterfacevariable{stopper}{stopper}
-\setinterfacevariable{stretch}{dilatat}
-\setinterfacevariable{stretched}{stretched}
-\setinterfacevariable{strict}{strict}
-\setinterfacevariable{strong}{strong}
-\setinterfacevariable{strut}{strut}
-\setinterfacevariable{sub}{sub}
-\setinterfacevariable{subbackward}{subinapoi}
-\setinterfacevariable{subformula}{subformula}
-\setinterfacevariable{subforward}{subavans}
-\setinterfacevariable{subject}{subiect}
-\setinterfacevariable{subpage}{subpagina}
-\setinterfacevariable{subs}{subs}
-\setinterfacevariable{subsection}{subsectiune}
-\setinterfacevariable{subsubject}{subsubiect}
-\setinterfacevariable{subsubsection}{subsubsectiune}
-\setinterfacevariable{subsubsubject}{subsubsubiect}
-\setinterfacevariable{subsubsubsection}{subsubsubsectiune}
-\setinterfacevariable{subsubsubsubject}{subsubsubsubiect}
-\setinterfacevariable{subsubsubsubsection}{subsubsubsubsectiune}
-\setinterfacevariable{subsubsubsubsubject}{subsubsubsubsubiect}
-\setinterfacevariable{subsubsubsubsubsection}{subsubsubsubsubsectiune}
-\setinterfacevariable{subsubsubsubsubsubject}{subsubsubsubsubsubiect}
-\setinterfacevariable{subsubsubsubsubsubsection}{subsubsubsubsubsubsectiune}
-\setinterfacevariable{subsubsubsubsubsubsubject}{subsubsubsubsubsubsubiect}
-\setinterfacevariable{subsubsubsubsubsubsubsection}{subsubsubsubsubsubsubsectiune}
-\setinterfacevariable{subsubsubsubsubsubsubsubject}{subsubsubsubsubsubsubsubiect}
-\setinterfacevariable{subsubsubsubsubsubsubsubsection}{subsubsubsubsubsubsubsubsectiune}
-\setinterfacevariable{subsubsubsubsubsubsubsubsubject}{subsubsubsubsubsubsubsubsubiect}
-\setinterfacevariable{subsubsubsubsubsubsubsubsubsection}{subsubsubsubsubsubsubsubsubsectiune}
-\setinterfacevariable{subsubsubsubsubsubsubsubsubsubject}{subsubsubsubsubsubsubsubsubsubiect}
-\setinterfacevariable{sunday}{duminica}
-\setinterfacevariable{support}{suport}
-\setinterfacevariable{sym}{sym}
-\setinterfacevariable{symbol}{simbol}
-\setinterfacevariable{synchronize}{synchronize}
-\setinterfacevariable{synonym}{synonym}
-\setinterfacevariable{system}{sistem}
-\setinterfacevariable{table}{tabelul}
-\setinterfacevariable{tablehead}{antettabel}
-\setinterfacevariable{tables}{tabelele}
-\setinterfacevariable{tabletail}{subsoltabel}
-\setinterfacevariable{tabulate}{tabulate}
-\setinterfacevariable{tabulatehead}{tabulatehead}
-\setinterfacevariable{tabulatetail}{tabulatetail}
-\setinterfacevariable{tall}{inalt}
-\setinterfacevariable{teletype}{teletype}
-\setinterfacevariable{temporary}{temporar}
-\setinterfacevariable{test}{test}
-\setinterfacevariable{text}{text}
-\setinterfacevariable{textnote}{textnote}
-\setinterfacevariable{three}{trei}
-\setinterfacevariable{thursday}{joi}
-\setinterfacevariable{tight}{tight}
-\setinterfacevariable{title}{titlu}
-\setinterfacevariable{toggle}{toggle}
-\setinterfacevariable{tolerant}{tolerant}
-\setinterfacevariable{top}{sus}
-\setinterfacevariable{tuesday}{marti}
-\setinterfacevariable{two}{doi}
-\setinterfacevariable{txt}{txt}
-\setinterfacevariable{type}{type}
-\setinterfacevariable{typing}{typing}
-\setinterfacevariable{unavailable}{nedisponibil}
-\setinterfacevariable{underbar}{sublinie}
-\setinterfacevariable{underbars}{sublinii}
-\setinterfacevariable{understrike}{understrike}
-\setinterfacevariable{understrikes}{understrikes}
-\setinterfacevariable{unframed}{unframed}
-\setinterfacevariable{unicode}{unicode}
-\setinterfacevariable{unit}{unitate}
-\setinterfacevariable{units}{unitati}
-\setinterfacevariable{unknown}{necunoscut}
-\setinterfacevariable{unpacked}{despachetat}
-\setinterfacevariable{up}{up}
-\setinterfacevariable{url}{url}
-\setinterfacevariable{used}{folosit}
-\setinterfacevariable{value}{valoare}
-\setinterfacevariable{vertical}{vertical}
-\setinterfacevariable{very}{foarte}
-\setinterfacevariable{verystrict}{foartestrict}
-\setinterfacevariable{verytolerant}{foartetolerant}
-\setinterfacevariable{vfenced}{vfenced}
-\setinterfacevariable{vulgarfraction}{vulgarfraction}
-\setinterfacevariable{weak}{weak}
-\setinterfacevariable{wednesday}{miercuri}
-\setinterfacevariable{week}{saptamana}
-\setinterfacevariable{weekday}{zisaptamana}
-\setinterfacevariable{white}{alb}
-\setinterfacevariable{wide}{larg}
-\setinterfacevariable{width}{latime}
-\setinterfacevariable{word}{cuvant}
-\setinterfacevariable{words}{words}
-\setinterfacevariable{xml}{xml}
-\setinterfacevariable{year}{an}
-\setinterfacevariable{yes}{da}
-% definitions for interface constants for language ro
-%
-\setinterfaceconstant{action}{actiune}
-\setinterfaceconstant{address}{adresa}
-\setinterfaceconstant{after}{dupa}
-\setinterfaceconstant{afterhead}{dupatitlu}
-\setinterfaceconstant{afterkey}{dupatasta}
-\setinterfaceconstant{aftersection}{aftersection}
-\setinterfaceconstant{align}{aliniere}
-\setinterfaceconstant{alignbottom}{alignbottom}
-\setinterfaceconstant{aligncharacter}{aliniazacaracter}
-\setinterfaceconstant{alignmentcharacter}{alierecaracter}
-\setinterfaceconstant{alignmentleftsample}{alignmentleftsample}
-\setinterfaceconstant{alignmentleftwidth}{alignmentleftwidth}
-\setinterfaceconstant{alignmentrightsample}{alignmentrightsample}
-\setinterfaceconstant{alignmentrightwidth}{alignmentrightwidth}
-\setinterfaceconstant{alignsymbol}{alignsymbol}
-\setinterfaceconstant{aligntitle}{alinieretitlu}
-\setinterfaceconstant{alternative}{alternativ}
-\setinterfaceconstant{anchor}{anchor}
-\setinterfaceconstant{anchoring}{anchoring}
-\setinterfaceconstant{andtext}{andtext}
-\setinterfaceconstant{apa}{apa}
-\setinterfaceconstant{arguments}{arguments}
-\setinterfaceconstant{arrow}{sageata}
-\setinterfaceconstant{artauthor}{artauthor}
-\setinterfaceconstant{artauthoretaldisplay}{artauthoretaldisplay}
-\setinterfaceconstant{artauthoretallimit}{artauthoretallimit}
-\setinterfaceconstant{artauthoretaltext}{artauthoretaltext}
-\setinterfaceconstant{artoffset}{artoffset}
-\setinterfaceconstant{at}{la}
-\setinterfaceconstant{author}{autor}
-\setinterfaceconstant{authorconversion}{authorconversion}
-\setinterfaceconstant{authoretaldisplay}{authoretaldisplay}
-\setinterfaceconstant{authoretallimit}{authoretallimit}
-\setinterfaceconstant{authoretaltext}{authoretaltext}
-\setinterfaceconstant{auto}{auto}
-\setinterfaceconstant{autocase}{autocase}
-\setinterfaceconstant{autofile}{autofile}
-\setinterfaceconstant{autofocus}{autofocus}
-\setinterfaceconstant{autohang}{autohang}
-\setinterfaceconstant{autostrut}{autostrut}
-\setinterfaceconstant{autowidth}{autolatime}
-\setinterfaceconstant{availableheight}{availableheight}
-\setinterfaceconstant{availablewidth}{availablewidth}
-\setinterfaceconstant{axis}{axa}
-\setinterfaceconstant{background}{fundal}
-\setinterfaceconstant{backgroundcolor}{culoarefundal}
-\setinterfaceconstant{backgroundcorner}{coltfundal}
-\setinterfaceconstant{backgrounddepth}{adancimefundal}
-\setinterfaceconstant{backgroundoffset}{offsetfundal}
-\setinterfaceconstant{backgroundradius}{razafundal}
-\setinterfaceconstant{backgroundscreen}{ecranfundal}
-\setinterfaceconstant{backreference}{backreference}
-\setinterfaceconstant{backspace}{spatiuspate}
-\setinterfaceconstant{balance}{balanta}
-\setinterfaceconstant{before}{inainte}
-\setinterfaceconstant{beforehead}{inaintetitlu}
-\setinterfaceconstant{beforesection}{beforesection}
-\setinterfaceconstant{bet}{bet}
-\setinterfaceconstant{bidi}{bidi}
-\setinterfaceconstant{big}{mare}
-\setinterfaceconstant{blank}{blanc}
-\setinterfaceconstant{bleedoffset}{bleedoffset}
-\setinterfaceconstant{blockway}{blockway}
-\setinterfaceconstant{bodyfont}{fonttext}
-\setinterfaceconstant{boffset}{boffset}
-\setinterfaceconstant{boldfeatures}{boldfeatures}
-\setinterfaceconstant{boldfont}{boldfont}
-\setinterfaceconstant{bolditalicfeatures}{bolditalicfeatures}
-\setinterfaceconstant{bolditalicfont}{bolditalicfont}
-\setinterfaceconstant{boldslantedfeatures}{boldslantedfeatures}
-\setinterfaceconstant{boldslantedfont}{boldslantedfont}
-\setinterfaceconstant{bookmark}{semncarte}
-\setinterfaceconstant{bottom}{jos}
-\setinterfaceconstant{bottomafter}{bottomafter}
-\setinterfaceconstant{bottombefore}{bottombefore}
-\setinterfaceconstant{bottomcommand}{bottomcommand}
-\setinterfaceconstant{bottomdistance}{distantajos}
-\setinterfaceconstant{bottomframe}{framejos}
-\setinterfaceconstant{bottomoffset}{offsetjos}
-\setinterfaceconstant{bottomspace}{spatiujos}
-\setinterfaceconstant{bottomstate}{starejos}
-\setinterfaceconstant{break}{break}
-\setinterfaceconstant{buffer}{buffer}
-\setinterfaceconstant{cache}{cache}
-\setinterfaceconstant{calculate}{calculeaza}
-\setinterfaceconstant{category}{category}
-\setinterfaceconstant{ccommand}{comandac}
-\setinterfaceconstant{character}{character}
-\setinterfaceconstant{characters}{characters}
-\setinterfaceconstant{check}{check}
-\setinterfaceconstant{click}{click}
-\setinterfaceconstant{clickin}{clickintru}
-\setinterfaceconstant{clickout}{clickies}
-\setinterfaceconstant{clipoffset}{clipoffset}
-\setinterfaceconstant{closeaction}{actiuneinchidere}
-\setinterfaceconstant{closecommand}{closecommand}
-\setinterfaceconstant{closepage}{closepage}
-\setinterfaceconstant{closepageaction}{actiuneinchiderepagina}
-\setinterfaceconstant{closesymbol}{closesymbol}
-\setinterfaceconstant{color}{culoare}
-\setinterfaceconstant{column}{coloana}
-\setinterfaceconstant{columndistance}{distantacoloane}
-\setinterfaceconstant{columns}{coloane}
-\setinterfaceconstant{comma}{comma}
-\setinterfaceconstant{command}{comanda}
-\setinterfaceconstant{commandafter}{comandadupa}
-\setinterfaceconstant{commandbefore}{comandainainte}
-\setinterfaceconstant{commands}{comenzi}
-\setinterfaceconstant{comment}{comment}
-\setinterfaceconstant{commentchar}{commentchar}
-\setinterfaceconstant{commentoffset}{commentoffset}
-\setinterfaceconstant{compact}{compact}
-\setinterfaceconstant{component}{component}
-\setinterfaceconstant{compoundhyphen}{compoundhyphen}
-\setinterfaceconstant{compress}{compress}
-\setinterfaceconstant{compressdistance}{compressdistance}
-\setinterfaceconstant{compressmethod}{compressmethod}
-\setinterfaceconstant{compressseparator}{compressseparator}
-\setinterfaceconstant{compressstopper}{compressstopper}
-\setinterfaceconstant{concerns}{concerns}
-\setinterfaceconstant{connector}{connector}
-\setinterfaceconstant{continue}{continua}
-\setinterfaceconstant{contrastcolor}{culoarecontrast}
-\setinterfaceconstant{controls}{controale}
-\setinterfaceconstant{conversion}{conversie}
-\setinterfaceconstant{convertfile}{convertestefisier}
-\setinterfaceconstant{copies}{copies}
-\setinterfaceconstant{corner}{colt}
-\setinterfaceconstant{coupling}{cuplare}
-\setinterfaceconstant{couplingway}{modcuplare}
-\setinterfaceconstant{criterium}{criteriu}
-\setinterfaceconstant{cropoffset}{cropoffset}
-\setinterfaceconstant{crossreference}{crossreference}
-\setinterfaceconstant{cssfile}{cssfile}
-\setinterfaceconstant{current}{curent}
-\setinterfaceconstant{cutspace}{cutspace}
-\setinterfaceconstant{dash}{dash}
-\setinterfaceconstant{dat}{dat}
-\setinterfaceconstant{database}{database}
-\setinterfaceconstant{dataset}{dataset}
-\setinterfaceconstant{date}{data}
-\setinterfaceconstant{deepnumbercommand}{deepnumbercommand}
-\setinterfaceconstant{deeptextcommand}{deeptextcommand}
-\setinterfaceconstant{default}{implicit}
-\setinterfaceconstant{defaultheight}{defaultheight}
-\setinterfaceconstant{defaultwidth}{defaultwidth}
-\setinterfaceconstant{define}{define}
-\setinterfaceconstant{delay}{intarziere}
-\setinterfaceconstant{depth}{inaltime}
-\setinterfaceconstant{depthcorrection}{corectieadancime}
-\setinterfaceconstant{direction}{directie}
-\setinterfaceconstant{directory}{director}
-\setinterfaceconstant{display}{display}
-\setinterfaceconstant{displaythreshold}{displaythreshold}
-\setinterfaceconstant{distance}{distanta}
-\setinterfaceconstant{domain}{domain}
-\setinterfaceconstant{dot}{punct}
-\setinterfaceconstant{doublesided}{douafete}
-\setinterfaceconstant{down}{down}
-\setinterfaceconstant{dummy}{dummy}
-\setinterfaceconstant{dx}{dx}
-\setinterfaceconstant{dy}{dy}
-\setinterfaceconstant{edge}{bordura}
-\setinterfaceconstant{edgedistance}{distantabordura}
-\setinterfaceconstant{editor}{editor}
-\setinterfaceconstant{editoretaldisplay}{editoretaldisplay}
-\setinterfaceconstant{editoretallimit}{editoretallimit}
-\setinterfaceconstant{editoretaltext}{editoretaltext}
-\setinterfaceconstant{empty}{gol}
-\setinterfaceconstant{entities}{entities}
-\setinterfaceconstant{entries}{entries}
-\setinterfaceconstant{equalheight}{equalheight}
-\setinterfaceconstant{equalwidth}{equalwidth}
-\setinterfaceconstant{escape}{escape}
-\setinterfaceconstant{etaldisplay}{etaldisplay}
-\setinterfaceconstant{etallimit}{etallimit}
-\setinterfaceconstant{etaloption}{etaloption}
-\setinterfaceconstant{etaltext}{etaltext}
-\setinterfaceconstant{evenmargin}{marginepara}
-\setinterfaceconstant{exact}{exact}
-\setinterfaceconstant{exitoffset}{exitoffset}
-\setinterfaceconstant{expansion}{expansiune}
-\setinterfaceconstant{export}{export}
-\setinterfaceconstant{extras}{extras}
-\setinterfaceconstant{factor}{factor}
-\setinterfaceconstant{fallback}{fallback}
-\setinterfaceconstant{fallbacks}{fallbacks}
-\setinterfaceconstant{family}{familie}
-\setinterfaceconstant{features}{features}
-\setinterfaceconstant{featureset}{featureset}
-\setinterfaceconstant{fences}{fences}
-\setinterfaceconstant{field}{field}
-\setinterfaceconstant{fieldbackgroundcolor}{culoarefundalcamp}
-\setinterfaceconstant{fieldframecolor}{culoareframecamp}
-\setinterfaceconstant{fieldlayer}{fieldlayer}
-\setinterfaceconstant{fieldoffset}{offsetcamp}
-\setinterfaceconstant{file}{fisier}
-\setinterfaceconstant{filler}{filler}
-\setinterfaceconstant{filter}{filter}
-\setinterfaceconstant{filtercommand}{filtercommand}
-\setinterfaceconstant{finalnamesep}{finalnamesep}
-\setinterfaceconstant{finalpagesep}{finalpagesep}
-\setinterfaceconstant{finalpubsep}{finalpubsep}
-\setinterfaceconstant{first}{primul}
-\setinterfaceconstant{firstnamesep}{firstnamesep}
-\setinterfaceconstant{firstpage}{primapagina}
-\setinterfaceconstant{focus}{focus}
-\setinterfaceconstant{focusin}{focusin}
-\setinterfaceconstant{focusoffset}{focusoffset}
-\setinterfaceconstant{focusout}{focusout}
-\setinterfaceconstant{font}{font}
-\setinterfaceconstant{footer}{subsol}
-\setinterfaceconstant{footerdistance}{distantasubsol}
-\setinterfaceconstant{footerstate}{staresubsol}
-\setinterfaceconstant{force}{fortat}
-\setinterfaceconstant{foregroundcolor}{foregroundcolor}
-\setinterfaceconstant{foregroundstyle}{foregroundstyle}
-\setinterfaceconstant{format}{format}
-\setinterfaceconstant{fractions}{fractions}
-\setinterfaceconstant{frame}{frame}
-\setinterfaceconstant{framecolor}{culoareframe}
-\setinterfaceconstant{framecorner}{coltframe}
-\setinterfaceconstant{framedepth}{adancimeframe}
-\setinterfaceconstant{frameoffset}{offsetframe}
-\setinterfaceconstant{frameradius}{razaframe}
-\setinterfaceconstant{frames}{frames}
-\setinterfaceconstant{freeregion}{freeregion}
-\setinterfaceconstant{from}{dela}
-\setinterfaceconstant{functioncolor}{functioncolor}
-\setinterfaceconstant{functionstyle}{functionstyle}
-\setinterfaceconstant{get}{adu}
-\setinterfaceconstant{global}{global}
-\setinterfaceconstant{goodies}{goodies}
-\setinterfaceconstant{grid}{grid}
-\setinterfaceconstant{group}{group}
-\setinterfaceconstant{groupsuffix}{groupsuffix}
-\setinterfaceconstant{hang}{suspenda}
-\setinterfaceconstant{hcompact}{hcompact}
-\setinterfaceconstant{headalign}{headalign}
-\setinterfaceconstant{headcolor}{culoaretitlu}
-\setinterfaceconstant{headcommand}{headcommand}
-\setinterfaceconstant{headconversion}{conversietitlu}
-\setinterfaceconstant{header}{antet}
-\setinterfaceconstant{headerdistance}{distantaantet}
-\setinterfaceconstant{headerstate}{stareantet}
-\setinterfaceconstant{headlabel}{etichetatitlu}
-\setinterfaceconstant{headnumber}{numartitlu}
-\setinterfaceconstant{headseparator}{headseparator}
-\setinterfaceconstant{headstyle}{stiltitlu}
-\setinterfaceconstant{height}{inaltime}
-\setinterfaceconstant{hfactor}{hfactor}
-\setinterfaceconstant{hfil}{hfil}
-\setinterfaceconstant{hidenumber}{hidenumber}
-\setinterfaceconstant{hoffset}{hoffset}
-\setinterfaceconstant{horizontal}{orizontal}
-\setinterfaceconstant{horoffset}{offsetoriz}
-\setinterfaceconstant{hyphen}{hyphen}
-\setinterfaceconstant{hyphens}{hyphens}
-\setinterfaceconstant{icommand}{comandai}
-\setinterfaceconstant{ignore}{ignore}
-\setinterfaceconstant{in}{in}
-\setinterfaceconstant{inbetween}{intre}
-\setinterfaceconstant{increment}{increment}
-\setinterfaceconstant{incrementnumber}{numarincrement}
-\setinterfaceconstant{indenting}{aliniat}
-\setinterfaceconstant{indentlist}{indentlist}
-\setinterfaceconstant{indentnext}{aliniaturmator}
-\setinterfaceconstant{index}{index}
-\setinterfaceconstant{indicator}{indicator}
-\setinterfaceconstant{initialsep}{initialsep}
-\setinterfaceconstant{inlinethreshold}{inlinethreshold}
-\setinterfaceconstant{inner}{intern}
-\setinterfaceconstant{innermargin}{innermargin}
-\setinterfaceconstant{inputfile}{inputfile}
-\setinterfaceconstant{insidesection}{insidesection}
-\setinterfaceconstant{instance}{instance}
-\setinterfaceconstant{intent}{intent}
-\setinterfaceconstant{interaction}{interactiune}
-\setinterfaceconstant{interlinespace}{spatiereinterliniara}
-\setinterfaceconstant{internalgrid}{internalgrid}
-\setinterfaceconstant{italicfeatures}{italicfeatures}
-\setinterfaceconstant{italicfont}{italicfont}
-\setinterfaceconstant{itemalign}{itemalign}
-\setinterfaceconstant{items}{elemente}
-\setinterfaceconstant{joiners}{joiners}
-\setinterfaceconstant{journalconversion}{journalconversion}
-\setinterfaceconstant{juniorsep}{juniorsep}
-\setinterfaceconstant{keeptogether}{keeptogether}
-\setinterfaceconstant{ken}{ken}
-\setinterfaceconstant{keyexpansion}{keyexpansion}
-\setinterfaceconstant{keys}{keys}
-\setinterfaceconstant{keyword}{keyword}
-\setinterfaceconstant{label}{eticheta}
-\setinterfaceconstant{labelalternative}{labelalternative}
-\setinterfaceconstant{labelcolor}{labelcolor}
-\setinterfaceconstant{labeloffset}{labeloffset}
-\setinterfaceconstant{labelstyle}{labelstyle}
-\setinterfaceconstant{language}{language}
-\setinterfaceconstant{last}{last}
-\setinterfaceconstant{lastnamesep}{lastnamesep}
-\setinterfaceconstant{lastpage}{ultimapagina}
-\setinterfaceconstant{lastpagesep}{lastpagesep}
-\setinterfaceconstant{lastpubsep}{lastpubsep}
-\setinterfaceconstant{layout}{layout}
-\setinterfaceconstant{left}{stanga}
-\setinterfaceconstant{leftcolor}{culoarestanga}
-\setinterfaceconstant{leftcompoundhyphen}{leftcompoundhyphen}
-\setinterfaceconstant{leftedge}{bordurastanga}
-\setinterfaceconstant{leftedgedistance}{distantabordurastanga}
-\setinterfaceconstant{leftframe}{framestanga}
-\setinterfaceconstant{lefthyphen}{lefthyphen}
-\setinterfaceconstant{leftmargin}{marginestanga}
-\setinterfaceconstant{leftmargindistance}{distantamarginestanga}
-\setinterfaceconstant{leftoffset}{offsetstanga}
-\setinterfaceconstant{leftquotation}{citatstanga}
-\setinterfaceconstant{leftquote}{minicitatstanga}
-\setinterfaceconstant{leftsample}{leftsample}
-\setinterfaceconstant{leftsentence}{propozitiestanga}
-\setinterfaceconstant{leftspeech}{leftspeech}
-\setinterfaceconstant{leftstyle}{stilstanga}
-\setinterfaceconstant{leftsubsentence}{subpropozitiestanga}
-\setinterfaceconstant{lefttext}{textstanga}
-\setinterfaceconstant{leftwidth}{latimestanga}
-\setinterfaceconstant{leftwords}{leftwords}
-\setinterfaceconstant{less}{less}
-\setinterfaceconstant{level}{nivel}
-\setinterfaceconstant{levels}{nivele}
-\setinterfaceconstant{limittext}{limittext}
-\setinterfaceconstant{line}{linie}
-\setinterfaceconstant{linecorrection}{corectielinie}
-\setinterfaceconstant{linedirection}{linedirection}
-\setinterfaceconstant{lines}{linii}
-\setinterfaceconstant{list}{lista}
-\setinterfaceconstant{listtext}{listtext}
-\setinterfaceconstant{local}{local}
-\setinterfaceconstant{location}{locatie}
-\setinterfaceconstant{loffset}{loffset}
-\setinterfaceconstant{logo}{logo}
-\setinterfaceconstant{logos}{logos}
-\setinterfaceconstant{marcolor}{culoaremarcaj}
-\setinterfaceconstant{margin}{margine}
-\setinterfaceconstant{margindistance}{distantamargine}
-\setinterfaceconstant{marginedge}{coltbordura}
-\setinterfaceconstant{marginedgetext}{textcoltbordura}
-\setinterfaceconstant{margintext}{textmargine}
-\setinterfaceconstant{mark}{mark}
-\setinterfaceconstant{marking}{marcaje}
-\setinterfaceconstant{marstyle}{stilmarcaj}
-\setinterfaceconstant{mask}{mask}
-\setinterfaceconstant{mathclass}{mathclass}
-\setinterfaceconstant{mathlimits}{mathlimits}
-\setinterfaceconstant{mathstyle}{mathstyle}
-\setinterfaceconstant{max}{max}
-\setinterfaceconstant{maxdepth}{maxdepth}
-\setinterfaceconstant{maxheight}{inaltimemaxima}
-\setinterfaceconstant{maxwidth}{latimemaxima}
-\setinterfaceconstant{maybeyear}{maybeyear}
-\setinterfaceconstant{menu}{meniu}
-\setinterfaceconstant{method}{metoda}
-\setinterfaceconstant{middle}{mijloc}
-\setinterfaceconstant{middlecolor}{middlecolor}
-\setinterfaceconstant{middlecommand}{middlecommand}
-\setinterfaceconstant{middlespeech}{middlespeech}
-\setinterfaceconstant{middlestyle}{middlestyle}
-\setinterfaceconstant{middletext}{textmijloc}
-\setinterfaceconstant{middlewidth}{middlewidth}
-\setinterfaceconstant{midsentence}{midsentence}
-\setinterfaceconstant{min}{min}
-\setinterfaceconstant{mindepth}{mindepth}
-\setinterfaceconstant{minheight}{inaltimeminima}
-\setinterfaceconstant{minwidth}{latimeminima}
-\setinterfaceconstant{moffset}{moffset}
-\setinterfaceconstant{monthconversion}{monthconversion}
-\setinterfaceconstant{more}{more}
-\setinterfaceconstant{mpdepth}{mpdepth}
-\setinterfaceconstant{mpheight}{mpheight}
-\setinterfaceconstant{mpoffset}{mpoffset}
-\setinterfaceconstant{mpwidth}{mpwidth}
-\setinterfaceconstant{n}{n}
-\setinterfaceconstant{name}{nume}
-\setinterfaceconstant{namesep}{namesep}
-\setinterfaceconstant{nbottom}{njos}
-\setinterfaceconstant{nc}{nc}
-\setinterfaceconstant{next}{urmatorul}
-\setinterfaceconstant{nextleft}{nextleft}
-\setinterfaceconstant{nextleftquotation}{nextleftquotation}
-\setinterfaceconstant{nextright}{nextright}
-\setinterfaceconstant{nextrightquotation}{nextrightquotation}
-\setinterfaceconstant{nl}{nl}
-\setinterfaceconstant{nleft}{nstanga}
-\setinterfaceconstant{nlines}{nlinii}
-\setinterfaceconstant{norm}{norm}
-\setinterfaceconstant{note}{note}
-\setinterfaceconstant{notes}{notes}
-\setinterfaceconstant{nr}{nr}
-\setinterfaceconstant{nright}{ndreapta}
-\setinterfaceconstant{ntop}{nsus}
-\setinterfaceconstant{number}{numar}
-\setinterfaceconstant{numberalign}{numberalign}
-\setinterfaceconstant{numbercolor}{culoarenumar}
-\setinterfaceconstant{numbercommand}{comandanumar}
-\setinterfaceconstant{numberconversion}{numberconversion}
-\setinterfaceconstant{numberconversionset}{numberconversionset}
-\setinterfaceconstant{numberdistance}{numberdistance}
-\setinterfaceconstant{numbering}{numerotare}
-\setinterfaceconstant{numberorder}{numberorder}
-\setinterfaceconstant{numberprefix}{numberprefix}
-\setinterfaceconstant{numbersegments}{numbersegments}
-\setinterfaceconstant{numberseparator}{separatornumar}
-\setinterfaceconstant{numberseparatorset}{numberseparatorset}
-\setinterfaceconstant{numberset}{numberset}
-\setinterfaceconstant{numberstarter}{numberstarter}
-\setinterfaceconstant{numberstopper}{numberstopper}
-\setinterfaceconstant{numberstrut}{numberstrut}
-\setinterfaceconstant{numberstyle}{stilnumar}
-\setinterfaceconstant{numberwidth}{numberwidth}
-\setinterfaceconstant{nx}{nx}
-\setinterfaceconstant{ny}{ny}
-\setinterfaceconstant{object}{obiect}
-\setinterfaceconstant{obstruction}{obstructie}
-\setinterfaceconstant{oddmargin}{margineimpara}
-\setinterfaceconstant{offset}{offset}
-\setinterfaceconstant{openaction}{actiunedeschidere}
-\setinterfaceconstant{openpage}{openpage}
-\setinterfaceconstant{openpageaction}{actiunedeschiderepagina}
-\setinterfaceconstant{openup}{openup}
-\setinterfaceconstant{opticalsize}{opticalsize}
-\setinterfaceconstant{option}{optiune}
-\setinterfaceconstant{order}{order}
-\setinterfaceconstant{orientation}{orientation}
-\setinterfaceconstant{otherstext}{otherstext}
-\setinterfaceconstant{outermargin}{outermargin}
-\setinterfaceconstant{overprint}{overprint}
-\setinterfaceconstant{ownerpassword}{ownerpassword}
-\setinterfaceconstant{ownnumber}{numarpropriu}
-\setinterfaceconstant{packcriterium}{packcriterium}
-\setinterfaceconstant{page}{pagina}
-\setinterfaceconstant{pageboundaries}{marginipagina}
-\setinterfaceconstant{pagecolor}{culoarepagina}
-\setinterfaceconstant{pagecolormodel}{pagecolormodel}
-\setinterfaceconstant{pagecommand}{comandapagina}
-\setinterfaceconstant{pageconnector}{pageconnector}
-\setinterfaceconstant{pageconversion}{pageconversion}
-\setinterfaceconstant{pageconversionset}{pageconversionset}
-\setinterfaceconstant{pageleft}{pageleft}
-\setinterfaceconstant{pagemethod}{pagemethod}
-\setinterfaceconstant{pagenumber}{numarpagina}
-\setinterfaceconstant{pageprefix}{pageprefix}
-\setinterfaceconstant{pageprefixconnector}{pageprefixconnector}
-\setinterfaceconstant{pageprefixconversion}{pageprefixconversion}
-\setinterfaceconstant{pageprefixconversionset}{pageprefixconversionset}
-\setinterfaceconstant{pageprefixsegments}{pageprefixsegments}
-\setinterfaceconstant{pageprefixseparatorset}{pageprefixseparatorset}
-\setinterfaceconstant{pageprefixset}{pageprefixset}
-\setinterfaceconstant{pageprefixstarter}{pageprefixstarter}
-\setinterfaceconstant{pageprefixstopper}{pageprefixstopper}
-\setinterfaceconstant{pageright}{pageright}
-\setinterfaceconstant{pagesegments}{pagesegments}
-\setinterfaceconstant{pagesep}{pagesep}
-\setinterfaceconstant{pageseparatorset}{pageseparatorset}
-\setinterfaceconstant{pageset}{pageset}
-\setinterfaceconstant{pagestarter}{pagestarter}
-\setinterfaceconstant{pagestate}{pagestate}
-\setinterfaceconstant{pagestopper}{pagestopper}
-\setinterfaceconstant{pagestyle}{stilpagina}
-\setinterfaceconstant{palet}{paleta}
-\setinterfaceconstant{paper}{hartie}
-\setinterfaceconstant{paragraph}{paragraf}
-\setinterfaceconstant{period}{period}
-\setinterfaceconstant{place}{pune}
-\setinterfaceconstant{placehead}{punetitlu}
-\setinterfaceconstant{placeholder}{placeholder}
-\setinterfaceconstant{placestopper}{punestopper}
-\setinterfaceconstant{position}{pozitie}
-\setinterfaceconstant{prefix}{prefix}
-\setinterfaceconstant{prefixconnector}{prefixconnector}
-\setinterfaceconstant{prefixconversion}{prefixconversion}
-\setinterfaceconstant{prefixconversionset}{prefixconversionset}
-\setinterfaceconstant{prefixsegments}{prefixsegments}
-\setinterfaceconstant{prefixseparatorset}{prefixseparatorset}
-\setinterfaceconstant{prefixset}{prefixset}
-\setinterfaceconstant{prefixstarter}{prefixstarter}
-\setinterfaceconstant{prefixstopper}{prefixstopper}
-\setinterfaceconstant{preset}{preset}
-\setinterfaceconstant{preview}{previzualizare}
-\setinterfaceconstant{previous}{precendent}
-\setinterfaceconstant{previousnumber}{numarprecedent}
-\setinterfaceconstant{print}{print}
-\setinterfaceconstant{printable}{tiparibil}
-\setinterfaceconstant{process}{process}
-\setinterfaceconstant{processors}{processors}
-\setinterfaceconstant{profile}{profile}
-\setinterfaceconstant{properties}{properties}
-\setinterfaceconstant{pubsep}{pubsep}
-\setinterfaceconstant{quotechar}{quotechar}
-\setinterfaceconstant{radius}{raza}
-\setinterfaceconstant{random}{aleator}
-\setinterfaceconstant{range}{range}
-\setinterfaceconstant{reduction}{reducere}
-\setinterfaceconstant{ref}{ref}
-\setinterfaceconstant{refcommand}{refcommand}
-\setinterfaceconstant{reference}{referinta}
-\setinterfaceconstant{referencemethod}{referencemethod}
-\setinterfaceconstant{referenceprefix}{referenceprefix}
-\setinterfaceconstant{referencetext}{referencetext}
-\setinterfaceconstant{referencing}{referinta}
-\setinterfaceconstant{region}{region}
-\setinterfaceconstant{regionin}{regiuneintrare}
-\setinterfaceconstant{regionout}{regiuneiesire}
-\setinterfaceconstant{register}{register}
-\setinterfaceconstant{regularfeatures}{regularfeatures}
-\setinterfaceconstant{regularfont}{regularfont}
-\setinterfaceconstant{renderingsetup}{renderingsetup}
-\setinterfaceconstant{repeat}{repeta}
-\setinterfaceconstant{reset}{reset}
-\setinterfaceconstant{resetnumber}{resetnumber}
-\setinterfaceconstant{resolution}{rezolutie}
-\setinterfaceconstant{resources}{resources}
-\setinterfaceconstant{reverse}{reverse}
-\setinterfaceconstant{right}{dreapta}
-\setinterfaceconstant{rightchars}{rightchars}
-\setinterfaceconstant{rightcolor}{culoaredreapta}
-\setinterfaceconstant{rightcompoundhyphen}{rightcompoundhyphen}
-\setinterfaceconstant{rightedge}{borduradreapta}
-\setinterfaceconstant{rightedgedistance}{distantacoltdreapta}
-\setinterfaceconstant{rightframe}{framedreapta}
-\setinterfaceconstant{righthyphen}{righthyphen}
-\setinterfaceconstant{rightmargin}{marginedreapta}
-\setinterfaceconstant{rightmargindistance}{distantamarginedreapta}
-\setinterfaceconstant{rightoffset}{offsetdreapta}
-\setinterfaceconstant{rightquotation}{citatdreapta}
-\setinterfaceconstant{rightquote}{minicitatdreapta}
-\setinterfaceconstant{rightsample}{rightsample}
-\setinterfaceconstant{rightsentence}{propozitiedreapta}
-\setinterfaceconstant{rightspeech}{rightspeech}
-\setinterfaceconstant{rightstyle}{stildreapta}
-\setinterfaceconstant{rightsubsentence}{subpropozitiedreapta}
-\setinterfaceconstant{righttext}{textdreapta}
-\setinterfaceconstant{rightwidth}{marginedreapta}
-\setinterfaceconstant{rightwords}{rightwords}
-\setinterfaceconstant{roffset}{roffset}
-\setinterfaceconstant{rotation}{rotatie}
-\setinterfaceconstant{rule}{rigla}
-\setinterfaceconstant{rulecolor}{culoarerigla}
-\setinterfaceconstant{rulecommand}{rulecommand}
-\setinterfaceconstant{rulethickness}{grosimerigla}
-\setinterfaceconstant{samepage}{aceeasipagina}
-\setinterfaceconstant{sample}{exemplu}
-\setinterfaceconstant{samplesize}{samplesize}
-\setinterfaceconstant{saveinlist}{saveinlist}
-\setinterfaceconstant{scale}{scala}
-\setinterfaceconstant{scope}{scop}
-\setinterfaceconstant{screen}{ecran}
-\setinterfaceconstant{section}{sectiune}
-\setinterfaceconstant{sectionblock}{sectionblock}
-\setinterfaceconstant{sectionconversion}{sectionconversion}
-\setinterfaceconstant{sectionconversionset}{sectionconversionset}
-\setinterfaceconstant{sectionnumber}{numarsectiune}
-\setinterfaceconstant{sectionresetset}{sectionresetset}
-\setinterfaceconstant{sectionsegments}{sectionsegments}
-\setinterfaceconstant{sectionseparatorset}{sectionseparatorset}
-\setinterfaceconstant{sectionset}{sectionset}
-\setinterfaceconstant{sectionstarter}{sectionstarter}
-\setinterfaceconstant{sectionstopper}{sectionstopper}
-\setinterfaceconstant{separator}{separator}
-\setinterfaceconstant{separatorcolor}{separatorcolor}
-\setinterfaceconstant{separatorstyle}{separatorstyle}
-\setinterfaceconstant{set}{set}
-\setinterfaceconstant{setups}{setups}
-\setinterfaceconstant{shrink}{shrink}
-\setinterfaceconstant{side}{parte}
-\setinterfaceconstant{sidealign}{sidealign}
-\setinterfaceconstant{sidemethod}{sidemethod}
-\setinterfaceconstant{sidespaceafter}{spatiulateraldupa}
-\setinterfaceconstant{sidespacebefore}{spatiulateralinainte}
-\setinterfaceconstant{sidespaceinbetween}{sidespaceinbetween}
-\setinterfaceconstant{sidethreshold}{sidethreshold}
-\setinterfaceconstant{sign}{semn}
-\setinterfaceconstant{simplecommand}{simplecommand}
-\setinterfaceconstant{size}{dimensiune}
-\setinterfaceconstant{slantedfeatures}{slantedfeatures}
-\setinterfaceconstant{slantedfont}{slantedfont}
-\setinterfaceconstant{small}{mic}
-\setinterfaceconstant{smallcapsfeatures}{smallcapsfeatures}
-\setinterfaceconstant{smallcapsfont}{smallcapsfont}
-\setinterfaceconstant{solution}{solution}
-\setinterfaceconstant{sort}{sort}
-\setinterfaceconstant{sorttype}{sorttype}
-\setinterfaceconstant{source}{sursa}
-\setinterfaceconstant{space}{spatiu}
-\setinterfaceconstant{spaceafter}{spatiudupa}
-\setinterfaceconstant{spaceafterside}{spaceafterside}
-\setinterfaceconstant{spacebefore}{spatiuinainte}
-\setinterfaceconstant{spacebeforeside}{spacebeforeside}
-\setinterfaceconstant{spaceinbetween}{spaceinbetween}
-\setinterfaceconstant{spacing}{spatiere}
-\setinterfaceconstant{specification}{specification}
-\setinterfaceconstant{split}{split}
-\setinterfaceconstant{splitcolor}{splitcolor}
-\setinterfaceconstant{splitmethod}{splitmethod}
-\setinterfaceconstant{splitoffset}{splitoffset}
-\setinterfaceconstant{spot}{spot}
-\setinterfaceconstant{stack}{stack}
-\setinterfaceconstant{stackname}{stackname}
-\setinterfaceconstant{start}{start}
-\setinterfaceconstant{starter}{starter}
-\setinterfaceconstant{state}{stare}
-\setinterfaceconstant{step}{pas}
-\setinterfaceconstant{stop}{stop}
-\setinterfaceconstant{stopper}{stopper}
-\setinterfaceconstant{stretch}{dilatat}
-\setinterfaceconstant{strip}{strip}
-\setinterfaceconstant{strut}{strut}
-\setinterfaceconstant{style}{stil}
-\setinterfaceconstant{stylealternative}{stylealternative}
-\setinterfaceconstant{sub}{sub}
-\setinterfaceconstant{subtitle}{subtitlu}
-\setinterfaceconstant{suffix}{suffix}
-\setinterfaceconstant{suffixseparator}{suffixseparator}
-\setinterfaceconstant{suffixstopper}{suffixstopper}
-\setinterfaceconstant{surnamefirstnamesep}{surnamefirstnamesep}
-\setinterfaceconstant{surnameinitialsep}{surnameinitialsep}
-\setinterfaceconstant{surnamesep}{surnamesep}
-\setinterfaceconstant{svgstyle}{svgstyle}
-\setinterfaceconstant{sx}{sx}
-\setinterfaceconstant{sy}{sy}
-\setinterfaceconstant{symalign}{symaliniere}
-\setinterfaceconstant{symbol}{simbol}
-\setinterfaceconstant{symbolcommand}{symbolcommand}
-\setinterfaceconstant{symbolset}{setsimbol}
-\setinterfaceconstant{symcolor}{culoaresimbol}
-\setinterfaceconstant{symstyle}{stilsimbol}
-\setinterfaceconstant{synonym}{sinonim}
-\setinterfaceconstant{synonymcolor}{culoaresinonim}
-\setinterfaceconstant{synonymcommand}{synonymcommand}
-\setinterfaceconstant{synonymstyle}{stilsinonim}
-\setinterfaceconstant{tab}{tab}
-\setinterfaceconstant{text}{text}
-\setinterfaceconstant{textalign}{textalign}
-\setinterfaceconstant{textcolor}{culoaretext}
-\setinterfaceconstant{textcommand}{comandatext}
-\setinterfaceconstant{textdistance}{textdistance}
-\setinterfaceconstant{textheight}{inaltimetext}
-\setinterfaceconstant{textlayer}{textlayer}
-\setinterfaceconstant{textmargin}{textmargin}
-\setinterfaceconstant{textmethod}{textmethod}
-\setinterfaceconstant{textseparator}{separatortext}
-\setinterfaceconstant{textsize}{dimensiunetext}
-\setinterfaceconstant{textstate}{staretext}
-\setinterfaceconstant{textstyle}{stiltext}
-\setinterfaceconstant{textwidth}{latimetext}
-\setinterfaceconstant{threshold}{threshold}
-\setinterfaceconstant{time}{time}
-\setinterfaceconstant{title}{titlu}
-\setinterfaceconstant{titlecolor}{culoaretitlu}
-\setinterfaceconstant{titlecommand}{titlecommand}
-\setinterfaceconstant{titledistance}{distantatitlu}
-\setinterfaceconstant{titleleft}{titleleft}
-\setinterfaceconstant{titleright}{titleright}
-\setinterfaceconstant{titlestrut}{titlestrut}
-\setinterfaceconstant{titlestyle}{stiltitlu}
-\setinterfaceconstant{to}{catre}
-\setinterfaceconstant{toffset}{toffset}
-\setinterfaceconstant{tolerance}{toleranta}
-\setinterfaceconstant{top}{sus}
-\setinterfaceconstant{topcommand}{topcommand}
-\setinterfaceconstant{topdistance}{distantasus}
-\setinterfaceconstant{topframe}{framesus}
-\setinterfaceconstant{topoffset}{offsetsus}
-\setinterfaceconstant{topspace}{spatiusus}
-\setinterfaceconstant{topstate}{staresus}
-\setinterfaceconstant{totalnumber}{totalnumber}
-\setinterfaceconstant{transform}{transform}
-\setinterfaceconstant{translate}{translate}
-\setinterfaceconstant{trimoffset}{trimoffset}
-\setinterfaceconstant{type}{type}
-\setinterfaceconstant{unit}{unitate}
-\setinterfaceconstant{unknownreference}{referintanecunoscuta}
-\setinterfaceconstant{up}{up}
-\setinterfaceconstant{urlalternative}{urlalternativ}
-\setinterfaceconstant{urlspace}{spatiuurl}
-\setinterfaceconstant{userpassword}{userpassword}
-\setinterfaceconstant{validate}{verifica}
-\setinterfaceconstant{values}{values}
-\setinterfaceconstant{vcommand}{comandav}
-\setinterfaceconstant{vcompact}{vcompact}
-\setinterfaceconstant{vector}{vector}
-\setinterfaceconstant{veroffset}{veroffset}
-\setinterfaceconstant{vertical}{vertical}
-\setinterfaceconstant{vfactor}{vfactor}
-\setinterfaceconstant{vfil}{vfil}
-\setinterfaceconstant{viewerprefix}{viewerprefix}
-\setinterfaceconstant{voffset}{voffset}
-\setinterfaceconstant{vonsep}{vonsep}
-\setinterfaceconstant{way}{mod}
-\setinterfaceconstant{wfactor}{factorw}
-\setinterfaceconstant{white}{alb}
-\setinterfaceconstant{width}{latime}
-\setinterfaceconstant{words}{words}
-\setinterfaceconstant{xanchor}{xanchor}
-\setinterfaceconstant{xfactor}{xfactor}
-\setinterfaceconstant{xhtml}{xhtml}
-\setinterfaceconstant{xmax}{xmax}
-\setinterfaceconstant{xmlsetup}{xmlsetup}
-\setinterfaceconstant{xoffset}{xoffset}
-\setinterfaceconstant{xscale}{xscala}
-\setinterfaceconstant{xstep}{xstep}
-\setinterfaceconstant{yanchor}{yanchor}
-\setinterfaceconstant{yfactor}{yfactor}
-\setinterfaceconstant{ymax}{ymax}
-\setinterfaceconstant{yoffset}{yoffset}
-\setinterfaceconstant{yscale}{yscala}
-\setinterfaceconstant{ystep}{ystep}
-% definitions for interface elements for language ro
-%
-\setinterfaceelement{answerlines}{answerlines}
-\setinterfaceelement{answerspace}{answerspace}
-\setinterfaceelement{begin}{inceput}
-\setinterfaceelement{complete}{complet}
-\setinterfaceelement{coupled}{cuplat}
-\setinterfaceelement{currentlocal}{localcurent}
-\setinterfaceelement{end}{sfarsit}
-\setinterfaceelement{endsetup}{}
-\setinterfaceelement{get}{get}
-\setinterfaceelement{increment}{increment}
-\setinterfaceelement{list}{lista}
-\setinterfaceelement{listof}{listade}
-\setinterfaceelement{load}{incarca}
-\setinterfaceelement{local}{local}
-\setinterfaceelement{makeup}{makeup}
-\setinterfaceelement{next}{urmatorul}
-\setinterfaceelement{place}{pune}
-\setinterfaceelement{previous}{precedent}
-\setinterfaceelement{previouslocal}{precedentlocal}
-\setinterfaceelement{reserve}{rezervat}
-\setinterfaceelement{see}{vezi}
-\setinterfaceelement{setup}{setare}
-\setinterfaceelement{start}{start}
-\setinterfaceelement{stop}{stop}
-\setinterfaceelement{text}{text}
-\setinterfaceelement{type}{type}
-% definitions for interface commands for language ro
-%
-\setinterfacecommand{Character}{Litera}
-\setinterfacecommand{Characters}{Litere}
-\setinterfacecommand{MONTH}{LUNA}
-\setinterfacecommand{Numbers}{Numere}
-\setinterfacecommand{Romannumerals}{Numereromane}
-\setinterfacecommand{SmallCapped}{Kap}
-\setinterfacecommand{SmallCaps}{Kaps}
-\setinterfacecommand{WEEKDAY}{ZIDINSAPTAMANA}
-\setinterfacecommand{WORD}{CUVANT}
-\setinterfacecommand{WORDS}{CUVINTE}
-\setinterfacecommand{Word}{Cuvant}
-\setinterfacecommand{Words}{Cuvinte}
-\setinterfacecommand{about}{despre}
-\setinterfacecommand{adaptfontfeature}{adaptfontfeature}
-\setinterfacecommand{adaptlayout}{adapteazaaspect}
-\setinterfacecommand{addfeature}{addfeature}
-\setinterfacecommand{alignbottom}{alignbottom}
-\setinterfacecommand{aligned}{aligned}
-\setinterfacecommand{alignedbox}{alignedbox}
-\setinterfacecommand{alignedline}{alignedline}
-\setinterfacecommand{alignhere}{alignhere}
-\setinterfacecommand{alignment}{alignment}
-\setinterfacecommand{alignmentcharacter}{alignmentcharacter}
-\setinterfacecommand{applytocharacters}{applytocharacters}
-\setinterfacecommand{applytofirstcharacter}{applytofirstcharacter}
-\setinterfacecommand{arg}{arg}
-\setinterfacecommand{at}{la}
-\setinterfacecommand{atleftmargin}{atleftmargin}
-\setinterfacecommand{atpage}{lapagina}
-\setinterfacecommand{atrightmargin}{atrightmargin}
-\setinterfacecommand{background}{fundal}
-\setinterfacecommand{backspace}{spatiuspate}
-\setinterfacecommand{blackrule}{linieneagra}
-\setinterfacecommand{blackrules}{liniinegre}
-\setinterfacecommand{blank}{blanc}
-\setinterfacecommand{bookmark}{semncarte}
-\setinterfacecommand{bottombox}{bottombox}
-\setinterfacecommand{bottomdistance}{distantajos}
-\setinterfacecommand{bottomheight}{inaltimejos}
-\setinterfacecommand{bottomleftbox}{bottomleftbox}
-\setinterfacecommand{bottomrightbox}{bottomrightbox}
-\setinterfacecommand{bottomspace}{spatiujos}
-\setinterfacecommand{buildtextbottomdot}{buildtextbottomdot}
-\setinterfacecommand{but}{but}
-\setinterfacecommand{button}{buton}
-\setinterfacecommand{bypassblocks}{saripesteblocuri}
-\setinterfacecommand{character}{litera}
-\setinterfacecommand{characters}{litere}
-\setinterfacecommand{chem}{chem}
-\setinterfacecommand{clip}{clip}
-\setinterfacecommand{clonefield}{cloneazacamp}
-\setinterfacecommand{color}{culoare}
-\setinterfacecommand{colorbar}{baraculoare}
-\setinterfacecommand{colorvalue}{valoareculoare}
-\setinterfacecommand{column}{coloana}
-\setinterfacecommand{comparecolorgroup}{comparagrupculoare}
-\setinterfacecommand{comparepalet}{comparapaleta}
-\setinterfacecommand{completepagenumber}{completeazanumarpagina}
-\setinterfacecommand{completeregister}{completeregister}
-\setinterfacecommand{component}{componenta}
-\setinterfacecommand{convertnumber}{convertestenumar}
-\setinterfacecommand{copyfield}{copiazacamp}
-\setinterfacecommand{correctwhitespace}{corecteazaspatiualb}
-\setinterfacecommand{coupledocument}{cupleazadocument}
-\setinterfacecommand{couplemarking}{cupleazamarcaje}
-\setinterfacecommand{couplepage}{paginadubla}
-\setinterfacecommand{couplepaper}{hartiedubla}
-\setinterfacecommand{coupleregister}{cupleazaregistru}
-\setinterfacecommand{crlf}{crlf}
-\setinterfacecommand{currentdate}{datacurenta}
-\setinterfacecommand{currentheadnumber}{numartitlucurent}
-\setinterfacecommand{cutspace}{cutspace}
-\setinterfacecommand{date}{data}
-\setinterfacecommand{decouplemarking}{decupleazamarcaje}
-\setinterfacecommand{decrementnumber}{decrementnumber}
-\setinterfacecommand{define}{defineste}
-\setinterfacecommand{defineaccent}{definesteaccent}
-\setinterfacecommand{defineblank}{definesteblanc}
-\setinterfacecommand{defineblock}{definestebloc}
-\setinterfacecommand{definebodyfont}{definestefonttext}
-\setinterfacecommand{definebodyfontenvironment}{definestemediulfonttext}
-\setinterfacecommand{definebodyfontswitch}{definebodyfontswitch}
-\setinterfacecommand{definebuffer}{definestebuffer}
-\setinterfacecommand{definecharacter}{definestecaracter}
-\setinterfacecommand{definecharacterkerning}{definecharacterkerning}
-\setinterfacecommand{definecharacterspacing}{definecharacterspacing}
-\setinterfacecommand{definecolor}{definesteculoare}
-\setinterfacecommand{definecolorgroup}{definestegrupculori}
-\setinterfacecommand{definecolumnbreak}{definecolumnbreak}
-\setinterfacecommand{definecolumnset}{definecolumnset}
-\setinterfacecommand{definecombination}{definecombination}
-\setinterfacecommand{definecombinedlist}{definestelistacombinata}
-\setinterfacecommand{definecommand}{definestecomanda}
-\setinterfacecommand{defineconversion}{definesteconversie}
-\setinterfacecommand{definedescription}{definestedescriere}
-\setinterfacecommand{definedfont}{definedfont}
-\setinterfacecommand{defineenumeration}{definesteenumerare}
-\setinterfacecommand{definefallbackfamily}{definefallbackfamily}
-\setinterfacecommand{definefield}{definestecamp}
-\setinterfacecommand{definefieldstack}{definestestivacampuri}
-\setinterfacecommand{definefiguresymbol}{definestesimbolfigura}
-\setinterfacecommand{definefilefallback}{definefilefallback}
-\setinterfacecommand{definefirstline}{definefirstline}
-\setinterfacecommand{definefloat}{definestefloat}
-\setinterfacecommand{definefont}{definestefont}
-\setinterfacecommand{definefontalternative}{definefontalternative}
-\setinterfacecommand{definefontfallback}{definefontfallback}
-\setinterfacecommand{definefontfamily}{definefontfamily}
-\setinterfacecommand{definefontfamilypreset}{definefontfamilypreset}
-\setinterfacecommand{definefontfeature}{definefontfeature}
-\setinterfacecommand{definefontfile}{definefontfile}
-\setinterfacecommand{definefontsize}{definefontsize}
-\setinterfacecommand{definefontsolution}{definefontsolution}
-\setinterfacecommand{definefontstyle}{definestestilfont}
-\setinterfacecommand{definefontsynonym}{definestesinonimfont}
-\setinterfacecommand{defineframed}{definesteinconjurare}
-\setinterfacecommand{defineframedtext}{definestetextinconjurat}
-\setinterfacecommand{definefrozenfont}{definefrozenfont}
-\setinterfacecommand{definehbox}{definestehbox}
-\setinterfacecommand{definehead}{definesteantet}
-\setinterfacecommand{definehyphenationfeatures}{definehyphenationfeatures}
-\setinterfacecommand{defineindentedtext}{defineindentedtext}
-\setinterfacecommand{defineinmargin}{defineinmargin}
-\setinterfacecommand{defineinteractionmenu}{definestemeniuinteractiune}
-\setinterfacecommand{defineitemgroup}{defineitemgroup}
-\setinterfacecommand{defineitems}{defineitems}
-\setinterfacecommand{definelabel}{definesteeticheta}
-\setinterfacecommand{definelayer}{definelayer}
-\setinterfacecommand{definelayout}{definelayout}
-\setinterfacecommand{definelinenote}{definelinenote}
-\setinterfacecommand{definelist}{definestelista}
-\setinterfacecommand{definelogo}{definestelogo}
-\setinterfacecommand{definemainfield}{definestecampprincipal}
-\setinterfacecommand{definemakeup}{definestemakeup}
-\setinterfacecommand{definemarking}{definestemarcaje}
-\setinterfacecommand{definemathalignment}{definemathalignment}
-\setinterfacecommand{definemode}{definemode}
-\setinterfacecommand{definenamedcolor}{definenamedcolor}
-\setinterfacecommand{definenote}{definenote}
-\setinterfacecommand{defineoutput}{definesteoutput}
-\setinterfacecommand{defineoverlay}{definesteoverlay}
-\setinterfacecommand{definepagebreak}{definepagebreak}
-\setinterfacecommand{definepalet}{definestepaleta}
-\setinterfacecommand{definepapersize}{definestedimensiunehartie}
-\setinterfacecommand{defineparagraphs}{definesteparagraf}
-\setinterfacecommand{defineperiodkerning}{defineperiodkerning}
-\setinterfacecommand{defineplacement}{defineplacement}
-\setinterfacecommand{defineprofile}{definesteprofil}
-\setinterfacecommand{defineprogram}{definesteprogram}
-\setinterfacecommand{definerawfont}{definestefontraw}
-\setinterfacecommand{definereference}{definestereferinte}
-\setinterfacecommand{definereferenceformat}{definesteformatreferinte}
-\setinterfacecommand{definereferencelist}{definestelistareferinte}
-\setinterfacecommand{defineregister}{definesteregistru}
-\setinterfacecommand{definerule}{definesterigla}
-\setinterfacecommand{definesection}{definestesectiune}
-\setinterfacecommand{definesectionblock}{definesteblocsectiune}
-\setinterfacecommand{definesorting}{definestesortare}
-\setinterfacecommand{definestartstop}{definestestartstop}
-\setinterfacecommand{definestyle}{definestestil}
-\setinterfacecommand{definesubfield}{definestesubcamp}
-\setinterfacecommand{definesymbol}{definestesimbol}
-\setinterfacecommand{definesynonyms}{definestesinonim}
-\setinterfacecommand{definetabletemplate}{definestesablontabel}
-\setinterfacecommand{definetabulate}{definestetabulatori}
-\setinterfacecommand{definetext}{definestetext}
-\setinterfacecommand{definetextbackground}{definetextbackground}
-\setinterfacecommand{definetextnote}{definetextnote}
-\setinterfacecommand{definetextposition}{definestepozitietext}
-\setinterfacecommand{definetextvariable}{definestevariabilatext}
-\setinterfacecommand{definetype}{definetype}
-\setinterfacecommand{definetyping}{definestetyping}
-\setinterfacecommand{defineversion}{definesteversiune}
-\setinterfacecommand{depthspanningtext}{depthspanningtext}
-\setinterfacecommand{determineheadnumber}{determinanumartitlu}
-\setinterfacecommand{determinelistcharacteristics}{determinacaracteristicilelistei}
-\setinterfacecommand{determineregistercharacteristics}{determinacaracteristiciregistru}
-\setinterfacecommand{dimension}{dimensiune}
-\setinterfacecommand{disableinteractionmenu}{dezactiveazameniuinteractiune}
-\setinterfacecommand{disablemode}{disablemode}
-\setinterfacecommand{doaddfeature}{doaddfeature}
-\setinterfacecommand{domicile}{domiciliu}
-\setinterfacecommand{dontconvertfont}{dontconvertfont}
-\setinterfacecommand{donttest}{nutesta}
-\setinterfacecommand{edgedistance}{distantacolt}
-\setinterfacecommand{edgewidth}{latimecolturi}
-\setinterfacecommand{emphasisboldface}{emphasisboldface}
-\setinterfacecommand{emptylines}{emptylines}
-\setinterfacecommand{enablemode}{enablemode}
-\setinterfacecommand{environment}{mediu}
-\setinterfacecommand{externalfigure}{figuraexterna}
-\setinterfacecommand{fact}{fact}
-\setinterfacecommand{fastswitchtobodyfont}{fastswitchtobodyfont}
-\setinterfacecommand{feature}{feature}
-\setinterfacecommand{field}{camp}
-\setinterfacecommand{fieldstack}{stivacampuri}
-\setinterfacecommand{fillinfield}{campumplere}
-\setinterfacecommand{fillinline}{linieumplere}
-\setinterfacecommand{fillinrules}{rigleumplere}
-\setinterfacecommand{fillintext}{textumplere}
-\setinterfacecommand{firstcharacter}{firstcharacter}
-\setinterfacecommand{fitfield}{potrivestecamp}
-\setinterfacecommand{fittopbaselinegrid}{fittopbaselinegrid}
-\setinterfacecommand{fixedspace}{spatiufixat}
-\setinterfacecommand{fixedspaces}{spatiifixate}
-\setinterfacecommand{flushnotes}{flushnotes}
-\setinterfacecommand{followprofile}{urmeazaprofil}
-\setinterfacecommand{followprofileversion}{urmeazaversiuneprofil}
-\setinterfacecommand{followversion}{urmeazaversiune}
-\setinterfacecommand{footerdistance}{distantasubsol}
-\setinterfacecommand{footerheight}{inaltimesubsol}
-\setinterfacecommand{footnote}{notasubsol}
-\setinterfacecommand{footnotetext}{footnotetext}
-\setinterfacecommand{forceblocks}{forteazablocuri}
-\setinterfacecommand{forcecharacterstripping}{forcecharacterstripping}
-\setinterfacecommand{formulanumber}{numarformula}
-\setinterfacecommand{fraction}{fractie}
-\setinterfacecommand{framed}{framed}
-\setinterfacecommand{from}{din}
-\setinterfacecommand{fromlinenote}{fromlinenote}
-\setinterfacecommand{getbuffer}{adubuffer}
-\setinterfacecommand{getfirstcharacter}{getfirstcharacter}
-\setinterfacecommand{getmarking}{adumarcaje}
-\setinterfacecommand{getnumber}{getnumber}
-\setinterfacecommand{globaldisablemode}{globaldisablemode}
-\setinterfacecommand{globalenablemode}{globalenablemode}
-\setinterfacecommand{globalpreventmode}{globalpreventmode}
-\setinterfacecommand{godown}{injos}
-\setinterfacecommand{goto}{dute}
-\setinterfacecommand{gotobox}{dutebox}
-\setinterfacecommand{gotopage}{dutepagina}
-\setinterfacecommand{graycolor}{culoaregri}
-\setinterfacecommand{greyvalue}{valoaregri}
-\setinterfacecommand{grid}{grid}
-\setinterfacecommand{hairline}{firdepar}
-\setinterfacecommand{head}{titlu}
-\setinterfacecommand{headerdistance}{distantaantet}
-\setinterfacecommand{headerheight}{inaltimeantet}
-\setinterfacecommand{headlevel}{niveltitlu}
-\setinterfacecommand{headnumber}{numartitlu}
-\setinterfacecommand{headsym}{headsym}
-\setinterfacecommand{headtext}{texttitlu}
-\setinterfacecommand{heightspanningtext}{heightspanningtext}
-\setinterfacecommand{hideblocks}{ascundeblocuri}
-\setinterfacecommand{high}{inalt}
-\setinterfacecommand{hl}{hl}
-\setinterfacecommand{immediatebetweenlist}{immediatebetweenlist}
-\setinterfacecommand{immediatetolist}{immediatetolist}
-\setinterfacecommand{in}{in}
-\setinterfacecommand{incrementnumber}{numarincrement}
-\setinterfacecommand{indenting}{aliniat}
-\setinterfacecommand{inframed}{inframed}
-\setinterfacecommand{infull}{pelung}
-\setinterfacecommand{ininner}{ininner}
-\setinterfacecommand{inleft}{instanga}
-\setinterfacecommand{inleftedge}{inparteastanga}
-\setinterfacecommand{inleftmargin}{inmargineastanga}
-\setinterfacecommand{inline}{inlinie}
-\setinterfacecommand{inmargin}{marginal}
-\setinterfacecommand{inmframed}{inmaframed}
-\setinterfacecommand{inneredgedistance}{inneredgedistance}
-\setinterfacecommand{inneredgewidth}{inneredgewidth}
-\setinterfacecommand{innermargindistance}{innermargindistance}
-\setinterfacecommand{innermarginwidth}{innermarginwidth}
-\setinterfacecommand{inothermargin}{inaltamargine}
-\setinterfacecommand{inouter}{inouter}
-\setinterfacecommand{inright}{indreapta}
-\setinterfacecommand{inrightedge}{inparteadreapta}
-\setinterfacecommand{inrightmargin}{inmargineadreapta}
-\setinterfacecommand{installlanguage}{instalarelimba}
-\setinterfacecommand{interactionbar}{barainteractiune}
-\setinterfacecommand{interactionbuttons}{butoaneinteractiune}
-\setinterfacecommand{interactionmenu}{meniuinteractiune}
-\setinterfacecommand{item}{element}
-\setinterfacecommand{itemgroup}{itemgroup}
-\setinterfacecommand{items}{element}
-\setinterfacecommand{itemtag}{itemtag}
-\setinterfacecommand{its}{el}
-\setinterfacecommand{keepblocks}{pastreazablocuri}
-\setinterfacecommand{kerncharacters}{kerncharacters}
-\setinterfacecommand{label}{eticheta}
-\setinterfacecommand{labels}{etichete}
-\setinterfacecommand{labeltext}{texteticheta}
-\setinterfacecommand{language}{limba}
-\setinterfacecommand{languageCharacters}{languageCharacters}
-\setinterfacecommand{languagecharacters}{languagecharacters}
-\setinterfacecommand{leftaligned}{aliniatstanga}
-\setinterfacecommand{leftbottombox}{leftbottombox}
-\setinterfacecommand{leftedgedistance}{distantacoltstanga}
-\setinterfacecommand{leftedgewidth}{latimecoltstanga}
-\setinterfacecommand{leftline}{leftline}
-\setinterfacecommand{leftmargindistance}{distantamarginestanga}
-\setinterfacecommand{leftmarginwidth}{latimemarginestanga}
-\setinterfacecommand{leg}{leg}
-\setinterfacecommand{linecorrection}{linecorrection}
-\setinterfacecommand{linenote}{linenote}
-\setinterfacecommand{linespanningtext}{linespanningtext}
-\setinterfacecommand{linewidth}{grosimelinie}
-\setinterfacecommand{listheight}{inaltimelista}
-\setinterfacecommand{listlength}{lungimelista}
-\setinterfacecommand{listsymbol}{listsymbol}
-\setinterfacecommand{listwidth}{latimelista}
-\setinterfacecommand{loadfontgoodies}{loadfontgoodies}
-\setinterfacecommand{localfootnotes}{localfootnotes}
-\setinterfacecommand{localnotes}{localnotes}
-\setinterfacecommand{logfields}{logcampuri}
-\setinterfacecommand{lohi}{jossus}
-\setinterfacecommand{low}{jos}
-\setinterfacecommand{macroname}{nume}
-\setinterfacecommand{mainlanguage}{limbaprincipala}
-\setinterfacecommand{makeupheight}{inaltimemakeup}
-\setinterfacecommand{makeupwidth}{latimemakeup}
-\setinterfacecommand{mar}{mar}
-\setinterfacecommand{marginblock}{marginblock}
-\setinterfacecommand{margindistance}{distantamargine}
-\setinterfacecommand{marginrule}{liniemargine}
-\setinterfacecommand{margintext}{textmarginal}
-\setinterfacecommand{margintitle}{titlumarginal}
-\setinterfacecommand{marginwidth}{latimemargine}
-\setinterfacecommand{marginword}{cuvantmarginal}
-\setinterfacecommand{marking}{marcaje}
-\setinterfacecommand{markversion}{marcheazaversiune}
-\setinterfacecommand{mathematics}{matematica}
-\setinterfacecommand{menubutton}{butonmeniu}
-\setinterfacecommand{mframed}{maframed}
-\setinterfacecommand{midaligned}{aliniatcentru}
-\setinterfacecommand{mirror}{reflexie}
-\setinterfacecommand{month}{luna}
-\setinterfacecommand{moveformula}{moveformula}
-\setinterfacecommand{moveongrid}{mutapegrid}
-\setinterfacecommand{movesidefloat}{movesidefloat}
-\setinterfacecommand{navigating}{navigating}
-\setinterfacecommand{nodimension}{faradimensiune}
-\setinterfacecommand{noheaderandfooterlines}{faraliniiantetsisubsol}
-\setinterfacecommand{noindenting}{faraaliniat}
-\setinterfacecommand{noitem}{noitem}
-\setinterfacecommand{nolist}{faralista}
-\setinterfacecommand{nomarking}{faramarcaje}
-\setinterfacecommand{nomoreblocks}{gatablocuri}
-\setinterfacecommand{nomorefiles}{farafisiere}
-\setinterfacecommand{nop}{nop}
-\setinterfacecommand{nospace}{faraspatiu}
-\setinterfacecommand{note}{nota}
-\setinterfacecommand{notesymbol}{notesymbol}
-\setinterfacecommand{notopandbottomlines}{faraliniisussijos}
-\setinterfacecommand{notsmallcapped}{nokap}
-\setinterfacecommand{nowhitespace}{faraspatiualb}
-\setinterfacecommand{numberofsubpages}{numberofsubpages}
-\setinterfacecommand{numbers}{numere}
-\setinterfacecommand{outeredgedistance}{outeredgedistance}
-\setinterfacecommand{outeredgewidth}{outeredgewidth}
-\setinterfacecommand{outermargindistance}{outermargindistance}
-\setinterfacecommand{outermarginwidth}{outermarginwidth}
-\setinterfacecommand{packed}{impachetat}
-\setinterfacecommand{page}{pagina}
-\setinterfacecommand{pagebreak}{pagebreak}
-\setinterfacecommand{pagedepth}{pagedepth}
-\setinterfacecommand{pagenumber}{numarpagina}
-\setinterfacecommand{pageoffset}{pageoffset}
-\setinterfacecommand{pagereference}{referintapagina}
-\setinterfacecommand{paperheight}{inaltimehartie}
-\setinterfacecommand{paperwidth}{latimehartie}
-\setinterfacecommand{periods}{puncte}
-\setinterfacecommand{placebookmarks}{plaseazasemnecarte}
-\setinterfacecommand{placecombinedlist}{punelistacombinata}
-\setinterfacecommand{placefloat}{placefloat}
-\setinterfacecommand{placefootnotes}{punenotesubsol}
-\setinterfacecommand{placeformula}{puneformula}
-\setinterfacecommand{placeheadnumber}{placeheadnumber}
-\setinterfacecommand{placeheadtext}{placeheadtext}
-\setinterfacecommand{placelegend}{punelegenda}
-\setinterfacecommand{placelist}{punelista}
-\setinterfacecommand{placelistofsynonyms}{placelistofsynonyms}
-\setinterfacecommand{placelocalfootnotes}{punenotesubsollocale}
-\setinterfacecommand{placelocalnotes}{placelocalnotes}
-\setinterfacecommand{placelogos}{punelogouri}
-\setinterfacecommand{placenamedfloat}{placenamedfloat}
-\setinterfacecommand{placenotes}{placenotes}
-\setinterfacecommand{placeongrid}{plaseazapegrid}
-\setinterfacecommand{placeontopofeachother}{punedeasuprafiecareia}
-\setinterfacecommand{placepagenumber}{punenumarpagina}
-\setinterfacecommand{placerawlist}{placerawlist}
-\setinterfacecommand{placereferencelist}{placereferencelist}
-\setinterfacecommand{placeregister}{puneregistru}
-\setinterfacecommand{placerule}{punerigla}
-\setinterfacecommand{placesidebyside}{punefatainfata}
-\setinterfacecommand{placesubformula}{punesubformula}
-\setinterfacecommand{placetextvariable}{punevariabilatext}
-\setinterfacecommand{position}{pozitie}
-\setinterfacecommand{positiontext}{pozitietext}
-\setinterfacecommand{postponenotes}{postponenotes}
-\setinterfacecommand{postponingnotes}{postponingnotes}
-\setinterfacecommand{predefinedfont}{predefinedfont}
-\setinterfacecommand{predefinefont}{predefinefont}
-\setinterfacecommand{presetdocument}{presetdocument}
-\setinterfacecommand{prettyprintbuffer}{prettyprintbuffer}
-\setinterfacecommand{preventmode}{preventmode}
-\setinterfacecommand{printpaperheight}{inaltimehartieimprimanta}
-\setinterfacecommand{printpaperwidth}{latimehartieimprimanta}
-\setinterfacecommand{processblocks}{proceseazabloc}
-\setinterfacecommand{processbodyfontenvironmentlist}{processbodyfontenvironmentlist}
-\setinterfacecommand{processpage}{proceseazapagina}
-\setinterfacecommand{product}{produs}
-\setinterfacecommand{program}{program}
-\setinterfacecommand{project}{proiect}
-\setinterfacecommand{publication}{publicatie}
-\setinterfacecommand{quotation}{citat}
-\setinterfacecommand{quote}{minicitat}
-\setinterfacecommand{ran}{ran}
-\setinterfacecommand{redo}{refa}
-\setinterfacecommand{redoconvertfont}{redoconvertfont}
-\setinterfacecommand{ref}{ref}
-\setinterfacecommand{reference}{referinta}
-\setinterfacecommand{referral}{referit}
-\setinterfacecommand{referraldate}{datareferit}
-\setinterfacecommand{referring}{referring}
-\setinterfacecommand{registerfontclass}{registerfontclass}
-\setinterfacecommand{registerhyphenationexception}{registerhyphenationexception}
-\setinterfacecommand{registerhyphenationpattern}{registerhyphenationpattern}
-\setinterfacecommand{remark}{remarca}
-\setinterfacecommand{replacefeature}{replacefeature}
-\setinterfacecommand{reset}{reset}
-\setinterfacecommand{resetandaddfeature}{resetandaddfeature}
-\setinterfacecommand{resetcharacteralign}{resetcharacteralign}
-\setinterfacecommand{resetcharacterkerning}{resetcharacterkerning}
-\setinterfacecommand{resetcharacterspacing}{resetcharacterspacing}
-\setinterfacecommand{resetcharacterstripping}{resetcharacterstripping}
-\setinterfacecommand{resetfeature}{resetfeature}
-\setinterfacecommand{resetfontcolorsheme}{resetfontcolorsheme}
-\setinterfacecommand{resetfontfallback}{resetfontfallback}
-\setinterfacecommand{resetfontsolution}{resetfontsolution}
-\setinterfacecommand{resethyphenationfeatures}{resethyphenationfeatures}
-\setinterfacecommand{resetlocalfloats}{resetlocalfloats}
-\setinterfacecommand{resetmarking}{reseteazamarcaje}
-\setinterfacecommand{resetmode}{resetmode}
-\setinterfacecommand{resetnumber}{resetnumber}
-\setinterfacecommand{resetpath}{resetpath}
-\setinterfacecommand{resetperiodkerning}{resetperiodkerning}
-\setinterfacecommand{resetsystemmode}{resetsystemmode}
-\setinterfacecommand{resettextcontent}{resettextcontent}
-\setinterfacecommand{resetvisualizers}{resetvisualizers}
-\setinterfacecommand{restoreglobalbodyfont}{restoreglobalbodyfont}
-\setinterfacecommand{retestfeature}{retestfeature}
-\setinterfacecommand{revivefeature}{revivefeature}
-\setinterfacecommand{rightaligned}{aliniatdreapta}
-\setinterfacecommand{rightbottombox}{rightbottombox}
-\setinterfacecommand{rightedgedistance}{distantacoltdreapta}
-\setinterfacecommand{rightedgewidth}{latimecoltdreapta}
-\setinterfacecommand{rightline}{rightline}
-\setinterfacecommand{rightmargindistance}{distantamarginedreapta}
-\setinterfacecommand{rightmarginwidth}{latimemarginedreapta}
-\setinterfacecommand{romannumerals}{numereromane}
-\setinterfacecommand{rotate}{roteste}
-\setinterfacecommand{savebuffer}{savebuffer}
-\setinterfacecommand{scale}{scala}
-\setinterfacecommand{screen}{ecran}
-\setinterfacecommand{selectblocks}{selecteazablocuri}
-\setinterfacecommand{selectpaper}{selecteazahartie}
-\setinterfacecommand{selectversion}{selecteazaversiune}
-\setinterfacecommand{setbigbodyfont}{setbigbodyfont}
-\setinterfacecommand{setcharacteralign}{setcharacteralign}
-\setinterfacecommand{setcharacteraligndetail}{setcharacteraligndetail}
-\setinterfacecommand{setcharactercasing}{setcharactercasing}
-\setinterfacecommand{setcharactercleaning}{setcharactercleaning}
-\setinterfacecommand{setcharacterkerning}{setcharacterkerning}
-\setinterfacecommand{setcharacterspacing}{setcharacterspacing}
-\setinterfacecommand{setcharacterstripping}{setcharacterstripping}
-\setinterfacecommand{setcurrentfontclass}{setcurrentfontclass}
-\setinterfacecommand{setfirstline}{setfirstline}
-\setinterfacecommand{setfirstpasscharacteralign}{setfirstpasscharacteralign}
-\setinterfacecommand{setfont}{setfont}
-\setinterfacecommand{setfontcolorsheme}{setfontcolorsheme}
-\setinterfacecommand{setfontfeature}{setfontfeature}
-\setinterfacecommand{setfontsolution}{setfontsolution}
-\setinterfacecommand{setfontstrut}{setfontstrut}
-\setinterfacecommand{sethyphenationfeatures}{sethyphenationfeatures}
-\setinterfacecommand{setmainbodyfont}{setmainbodyfont}
-\setinterfacecommand{setmode}{setmode}
-\setinterfacecommand{setnote}{setnote}
-\setinterfacecommand{setnotetext}{setnotetext}
-\setinterfacecommand{setnumber}{setnumber}
-\setinterfacecommand{setperiodkerning}{setperiodkerning}
-\setinterfacecommand{setsecondpasscharacteralign}{setsecondpasscharacteralign}
-\setinterfacecommand{setsmallbodyfont}{setsmallbodyfont}
-\setinterfacecommand{setsystemmode}{setsystemmode}
-\setinterfacecommand{settextcontent}{settextcontent}
-\setinterfacecommand{settextvariable}{setvariabilatext}
-\setinterfacecommand{setupalign}{seteazaalinierea}
-\setinterfacecommand{setupanswerarea}{setupanswerarea}
-\setinterfacecommand{setuparranging}{seteazaaranjareapag}
-\setinterfacecommand{setupattachment}{setupattachment}
-\setinterfacecommand{setupbackground}{seteazafundal}
-\setinterfacecommand{setupbackgrounds}{seteazafundaluri}
-\setinterfacecommand{setupblackrules}{seteazaliniinegre}
-\setinterfacecommand{setupblank}{seteazablanc}
-\setinterfacecommand{setupblock}{seteazabloc}
-\setinterfacecommand{setupbodyfont}{seteazafonttext}
-\setinterfacecommand{setupbodyfontenvironment}{seteazamediulfonttext}
-\setinterfacecommand{setupbottom}{seteazajos}
-\setinterfacecommand{setupbottomtexts}{seteazatextejos}
-\setinterfacecommand{setupbuffer}{seteazabuffer}
-\setinterfacecommand{setupbuttons}{seteazabutoane}
-\setinterfacecommand{setupcapitals}{seteazamajuscule}
-\setinterfacecommand{setupcaption}{seteazalegenda}
-\setinterfacecommand{setupcaptions}{seteazalegendele}
-\setinterfacecommand{setupcharacteralign}{setupcharacteralign}
-\setinterfacecommand{setupcharacterkerning}{setupcharacterkerning}
-\setinterfacecommand{setupcharacterspacing}{setupcharacterspacing}
-\setinterfacecommand{setupclipping}{seteazaclipping}
-\setinterfacecommand{setupcolor}{seteazaculoare}
-\setinterfacecommand{setupcolors}{seteazaculori}
-\setinterfacecommand{setupcolumns}{seteazacoloane}
-\setinterfacecommand{setupcolumnset}{setupcolumnset}
-\setinterfacecommand{setupcolumnsetlines}{setupcolumnsetlines}
-\setinterfacecommand{setupcolumnsetstart}{setupcolumnsetstart}
-\setinterfacecommand{setupcombinations}{seteazacombinari}
-\setinterfacecommand{setupcombinedlist}{seteazalistacombinata}
-\setinterfacecommand{setupcomment}{seteazacomentariu}
-\setinterfacecommand{setupcounter}{setupcounter}
-\setinterfacecommand{setupdescription}{setupdescription}
-\setinterfacecommand{setupdescriptions}{seteazadescriere}
-\setinterfacecommand{setupenumeration}{setupenumeration}
-\setinterfacecommand{setupenumerations}{seteazaenumerare}
-\setinterfacecommand{setupexternalfigures}{seteazafiguriexterne}
-\setinterfacecommand{setupfield}{seteazacamp}
-\setinterfacecommand{setupfields}{seteazacampuri}
-\setinterfacecommand{setupfillinlines}{seteazaliniiumplere}
-\setinterfacecommand{setupfillinrules}{seteazarigleumplere}
-\setinterfacecommand{setupfirstline}{setupfirstline}
-\setinterfacecommand{setupfloat}{seteazafloat}
-\setinterfacecommand{setupfloats}{seteazafloats}
-\setinterfacecommand{setupfloatsplitting}{seteazaimpartireafloat}
-\setinterfacecommand{setupfontexpansion}{setupfontexpansion}
-\setinterfacecommand{setupfontprotrusion}{setupfontprotrusion}
-\setinterfacecommand{setupfonts}{setupfonts}
-\setinterfacecommand{setupfontsolution}{setupfontsolution}
-\setinterfacecommand{setupfooter}{seteazasubsol}
-\setinterfacecommand{setupfootertexts}{seteazatextesubsol}
-\setinterfacecommand{setupfootnotedefinition}{seteazadefinireanotasubsol}
-\setinterfacecommand{setupfootnotes}{seteazanotasubsol}
-\setinterfacecommand{setupforms}{seteazaformulare}
-\setinterfacecommand{setupformula}{setupformula}
-\setinterfacecommand{setupformulas}{seteazaformule}
-\setinterfacecommand{setupframed}{seteazainconjurat}
-\setinterfacecommand{setupframedtext}{setupframedtext}
-\setinterfacecommand{setupframedtexts}{definestetexteinconjurate}
-\setinterfacecommand{setuphead}{seteazatitlu}
-\setinterfacecommand{setupheader}{seteazaantet}
-\setinterfacecommand{setupheadertexts}{seteazatexteantet}
-\setinterfacecommand{setupheadnumber}{seteazanumartitlu}
-\setinterfacecommand{setupheads}{seteazatitluri}
-\setinterfacecommand{setupheadtext}{seteazatexttitlu}
-\setinterfacecommand{setuphyphenation}{setuphyphenation}
-\setinterfacecommand{setuphyphenmark}{seteazaliniesilabe}
-\setinterfacecommand{setupindentedtext}{setupindentedtext}
-\setinterfacecommand{setupindenting}{seteazaaliniat}
-\setinterfacecommand{setupinmargin}{seteazamarginal}
-\setinterfacecommand{setupinteraction}{seteazainteractiunea}
-\setinterfacecommand{setupinteractionbar}{seteazabarainteractiune}
-\setinterfacecommand{setupinteractionmenu}{seteazameniuinteractiune}
-\setinterfacecommand{setupinteractionscreen}{seteazaecraninteractiune}
-\setinterfacecommand{setupinterlinespace}{seteazaspatiuinterliniar}
-\setinterfacecommand{setupitemgroup}{setupitemgroup}
-\setinterfacecommand{setupitemgroups}{setareitemization}
-\setinterfacecommand{setupitems}{seteazaelemente}
-\setinterfacecommand{setuplabeltext}{seteazatexteticheta}
-\setinterfacecommand{setuplanguage}{setarelimba}
-\setinterfacecommand{setuplayout}{seteazaaspect}
-\setinterfacecommand{setuplegend}{seteazalegenda}
-\setinterfacecommand{setuplinenote}{setuplinenote}
-\setinterfacecommand{setuplinenumbering}{seteazanumerotarelinii}
-\setinterfacecommand{setuplines}{seteazalinii}
-\setinterfacecommand{setuplinewidth}{seteazagrosimelinie}
-\setinterfacecommand{setuplist}{seteazalista}
-\setinterfacecommand{setupmakeup}{seteazamakeup}
-\setinterfacecommand{setupmarginblock}{setupmarginblock}
-\setinterfacecommand{setupmarginblocks}{seteazablocurimarginale}
-\setinterfacecommand{setupmargindata}{setupmargindata}
-\setinterfacecommand{setupmarginrules}{seteazaliniimargine}
-\setinterfacecommand{setupmarking}{seteazamarcaje}
-\setinterfacecommand{setupmathalignment}{setupmathalignment}
-\setinterfacecommand{setupnarrower}{seteazaingust}
-\setinterfacecommand{setupnotation}{setupnotation}
-\setinterfacecommand{setupnotations}{setupnotations}
-\setinterfacecommand{setupnote}{setupnote}
-\setinterfacecommand{setupnotes}{setupnotes}
-\setinterfacecommand{setupnumber}{setupnumber}
-\setinterfacecommand{setupnumbering}{seteazanumerotare}
-\setinterfacecommand{setupoppositeplacing}{seteazaplasareaopozita}
-\setinterfacecommand{setupoutput}{setareoutput}
-\setinterfacecommand{setuppagecomment}{seteazacomentariupagina}
-\setinterfacecommand{setuppagenumber}{seteazanumarpagina}
-\setinterfacecommand{setuppagenumbering}{seteazanumerotarepagina}
-\setinterfacecommand{setuppagetransitions}{seteazatranzitiepagina}
-\setinterfacecommand{setuppalet}{seteazapaleta}
-\setinterfacecommand{setuppaper}{setuppaper}
-\setinterfacecommand{setuppapersize}{seteazadimensiunihartie}
-\setinterfacecommand{setupparagraphnumbering}{seteazanumerotareparagrafe}
-\setinterfacecommand{setupparagraphs}{seteazaparagrafe}
-\setinterfacecommand{setupperiodkerning}{setupperiodkerning}
-\setinterfacecommand{setupplacement}{setupplacement}
-\setinterfacecommand{setuppositioning}{setarepozitie}
-\setinterfacecommand{setupprofiles}{seteazaprofile}
-\setinterfacecommand{setupprograms}{seteazaprograme}
-\setinterfacecommand{setuppublications}{seteazapublicatii}
-\setinterfacecommand{setupquote}{seteazaminicitat}
-\setinterfacecommand{setupreferencelist}{seteazalistareferinte}
-\setinterfacecommand{setupreferencing}{seteazareferinte}
-\setinterfacecommand{setupregister}{seteazaregistru}
-\setinterfacecommand{setuprotate}{seteazarotare}
-\setinterfacecommand{setuprule}{seteazarigla}
-\setinterfacecommand{setupscreens}{seteazaecrane}
-\setinterfacecommand{setupsection}{seteazasectiune}
-\setinterfacecommand{setupsectionblock}{seteazablocsectiune}
-\setinterfacecommand{setupsorting}{seteazasortare}
-\setinterfacecommand{setupspacing}{seteazaspatiu}
-\setinterfacecommand{setupstartstop}{setupstartstop}
-\setinterfacecommand{setupstrut}{seteazastrut}
-\setinterfacecommand{setupsubpagenumber}{seteazanumarsubpagina}
-\setinterfacecommand{setupsymbolset}{seteazasimbol}
-\setinterfacecommand{setupsynchronization}{setaresincronizare}
-\setinterfacecommand{setupsynchronizationbar}{setarebarasincronizare}
-\setinterfacecommand{setupsynonyms}{seteazasinonime}
-\setinterfacecommand{setupsystem}{seteazasistem}
-\setinterfacecommand{setuptab}{seteazatab}
-\setinterfacecommand{setuptables}{seteazatabele}
-\setinterfacecommand{setuptabulate}{seteazatabulatori}
-\setinterfacecommand{setuptext}{seteazatext}
-\setinterfacecommand{setuptextbackground}{setuptextbackground}
-\setinterfacecommand{setuptextnote}{setuptextnote}
-\setinterfacecommand{setuptextposition}{seteazapozitietext}
-\setinterfacecommand{setuptextrules}{seteazarigletext}
-\setinterfacecommand{setuptexttexts}{seteazatextetext}
-\setinterfacecommand{setuptextvariable}{seteazavariabilatext}
-\setinterfacecommand{setupthinrules}{seteazaliniesubtire}
-\setinterfacecommand{setuptolerance}{seteazatoleranta}
-\setinterfacecommand{setuptop}{seteazasus}
-\setinterfacecommand{setuptoptexts}{seteazatextesus}
-\setinterfacecommand{setuptype}{seteazatype}
-\setinterfacecommand{setuptyping}{seteazatyping}
-\setinterfacecommand{setupunderbar}{seteazasublinie}
-\setinterfacecommand{setupurl}{seteazaurl}
-\setinterfacecommand{setupversions}{seteazaversiuni}
-\setinterfacecommand{setupwhitespace}{seteazaspatiualb}
-\setinterfacecommand{setvisualizerfont}{setvisualizerfont}
-\setinterfacecommand{showbodyfont}{afiseazafonttext}
-\setinterfacecommand{showbodyfontenvironment}{afiseazamediufonttext}
-\setinterfacecommand{showcolor}{afiseazaculoare}
-\setinterfacecommand{showcolorgroup}{afiseazagrupculoare}
-\setinterfacecommand{showcounter}{showcounter}
-\setinterfacecommand{showexternalfigures}{afiseazafiguriexterne}
-\setinterfacecommand{showfields}{afiseazacampuri}
-\setinterfacecommand{showfont}{showfont}
-\setinterfacecommand{showfontdata}{showfontdata}
-\setinterfacecommand{showfontexpansion}{showfontexpansion}
-\setinterfacecommand{showfontitalics}{showfontitalics}
-\setinterfacecommand{showfontkerns}{showfontkerns}
-\setinterfacecommand{showfontparameters}{showfontparameters}
-\setinterfacecommand{showfontstrip}{showfontstrip}
-\setinterfacecommand{showfontstyle}{showfontstyle}
-\setinterfacecommand{showframe}{afiseazarama}
-\setinterfacecommand{showgrid}{afiseazagrid}
-\setinterfacecommand{showhyphenationtrace}{showhyphenationtrace}
-\setinterfacecommand{showkerning}{showkerning}
-\setinterfacecommand{showlayout}{afiseazaaspect}
-\setinterfacecommand{showmakeup}{afiseazamakeup}
-\setinterfacecommand{showminimalbaseline}{showminimalbaseline}
-\setinterfacecommand{showpalet}{afiseazapaleta}
-\setinterfacecommand{showprint}{afiseazatiparire}
-\setinterfacecommand{showsetups}{afiseazasetari}
-\setinterfacecommand{showstruts}{afiseazastruts}
-\setinterfacecommand{showsymbolset}{afiseazasetsimboluri}
-\setinterfacecommand{smallcapped}{kap}
-\setinterfacecommand{someline}{olinie}
-\setinterfacecommand{somewhere}{undeva}
-\setinterfacecommand{space}{spatiu}
-\setinterfacecommand{specialitem}{specialitem}
-\setinterfacecommand{splitfloat}{impartefloat}
-\setinterfacecommand{startalignment}{startaliniere}
-\setinterfacecommand{startbackground}{startfundal}
-\setinterfacecommand{startcoding}{startcodificare}
-\setinterfacecommand{startcolor}{startculoare}
-\setinterfacecommand{startcolumnmakeup}{startcolumnmakeup}
-\setinterfacecommand{startcolumns}{startcoloane}
-\setinterfacecommand{startcolumnset}{startcolumnset}
-\setinterfacecommand{startcombination}{startcombinare}
-\setinterfacecommand{startcomponent}{startcomponenta}
-\setinterfacecommand{startdocument}{startdocument}
-\setinterfacecommand{startenvironment}{startmediu}
-\setinterfacecommand{startfigure}{startfigura}
-\setinterfacecommand{startframed}{startframed}
-\setinterfacecommand{startglobal}{startglobal}
-\setinterfacecommand{startline}{startlinie}
-\setinterfacecommand{startlinecorrection}{startcorectielinie}
-\setinterfacecommand{startlinenote}{startlinenote}
-\setinterfacecommand{startlinenumbering}{startnumerotarelinii}
-\setinterfacecommand{startlines}{startlinii}
-\setinterfacecommand{startlocal}{startlocal}
-\setinterfacecommand{startlocalfootnotes}{startnotesubsollocale}
-\setinterfacecommand{startmakeup}{startmakeup}
-\setinterfacecommand{startmarginblock}{startblocmarginal}
-\setinterfacecommand{startmarginrule}{startliniemargine}
-\setinterfacecommand{startnarrower}{startingust}
-\setinterfacecommand{startopposite}{startopozit}
-\setinterfacecommand{startoverlay}{startoverlay}
-\setinterfacecommand{startoverview}{startoverview}
-\setinterfacecommand{startpacked}{startimpachetat}
-\setinterfacecommand{startpositioning}{startpozitionare}
-\setinterfacecommand{startproduct}{startprodus}
-\setinterfacecommand{startprofile}{startprofil}
-\setinterfacecommand{startproject}{startproiect}
-\setinterfacecommand{startquotation}{startcitat}
-\setinterfacecommand{startraster}{startraster}
-\setinterfacecommand{startsymbolset}{startsetsimboluri}
-\setinterfacecommand{startsynchronization}{startsincronizare}
-\setinterfacecommand{starttable}{starttabel}
-\setinterfacecommand{starttables}{starttabele}
-\setinterfacecommand{starttext}{starttext}
-\setinterfacecommand{starttextbackground}{starttextbackground}
-\setinterfacecommand{starttextrule}{startriglatext}
-\setinterfacecommand{startunpacked}{startneimpachetat}
-\setinterfacecommand{startversion}{startversiune}
-\setinterfacecommand{stopalignment}{stopaliniere}
-\setinterfacecommand{stopbackground}{stopfundal}
-\setinterfacecommand{stopcoding}{stopcodificare}
-\setinterfacecommand{stopcolor}{stopculoare}
-\setinterfacecommand{stopcolumnmakeup}{stopcolumnmakeup}
-\setinterfacecommand{stopcolumns}{stopcoloane}
-\setinterfacecommand{stopcolumnset}{stopcolumnset}
-\setinterfacecommand{stopcombination}{stopcombinare}
-\setinterfacecommand{stopcomponent}{stopcomponenta}
-\setinterfacecommand{stopdocument}{stopdocument}
-\setinterfacecommand{stopenvironment}{stopmediu}
-\setinterfacecommand{stopframed}{stopframed}
-\setinterfacecommand{stopglobal}{stopblobal}
-\setinterfacecommand{stopline}{stoplinie}
-\setinterfacecommand{stoplinecorrection}{stopcorectielinie}
-\setinterfacecommand{stoplinenote}{stoplinenote}
-\setinterfacecommand{stoplinenumbering}{stopnumerotarelinii}
-\setinterfacecommand{stoplines}{stoplinii}
-\setinterfacecommand{stoplocal}{stoplocal}
-\setinterfacecommand{stoplocalfootnotes}{stopnotesubsollocale}
-\setinterfacecommand{stopmakeup}{stopmakeup}
-\setinterfacecommand{stopmarginblock}{stopblocmarginal}
-\setinterfacecommand{stopmarginrule}{stopliniemargine}
-\setinterfacecommand{stopnarrower}{stopingust}
-\setinterfacecommand{stopopposite}{stopopozit}
-\setinterfacecommand{stopoverlay}{stopoverlay}
-\setinterfacecommand{stopoverview}{stopoverview}
-\setinterfacecommand{stoppacked}{stopimpachetat}
-\setinterfacecommand{stoppositioning}{stoppozitionare}
-\setinterfacecommand{stopproduct}{stopprodus}
-\setinterfacecommand{stopprofile}{stopprofil}
-\setinterfacecommand{stopproject}{stopproiect}
-\setinterfacecommand{stopquotation}{stopcitat}
-\setinterfacecommand{stopraster}{stopraster}
-\setinterfacecommand{stopsynchronization}{stopsincronizare}
-\setinterfacecommand{stoptable}{stoptabel}
-\setinterfacecommand{stoptables}{stoptabele}
-\setinterfacecommand{stoptext}{stoptext}
-\setinterfacecommand{stoptextbackground}{stoptextbackground}
-\setinterfacecommand{stoptextrule}{stopriglatext}
-\setinterfacecommand{stopunpacked}{stopneimpachetat}
-\setinterfacecommand{stopversion}{stopversiune}
-\setinterfacecommand{stretched}{intins}
-\setinterfacecommand{strictinspectnextcharacter}{strictinspectnextcharacter}
-\setinterfacecommand{stripcharacter}{stripcharacter}
-\setinterfacecommand{subformulanumber}{numarsubformula}
-\setinterfacecommand{subpagenumber}{subpagenumber}
-\setinterfacecommand{subtractfeature}{subtractfeature}
-\setinterfacecommand{switchtobodyfont}{trecilafonttext}
-\setinterfacecommand{switchtorawfont}{trecilafontraw}
-\setinterfacecommand{sym}{sim}
-\setinterfacecommand{symbol}{simbol}
-\setinterfacecommand{symoffset}{symoffset}
-\setinterfacecommand{synchronizationbar}{barasincronizare}
-\setinterfacecommand{synchronize}{sincronizeaza}
-\setinterfacecommand{tab}{tab}
-\setinterfacecommand{testcolumn}{testcolumn}
-\setinterfacecommand{testfeature}{testfeature}
-\setinterfacecommand{testfeatureonce}{testfeatureonce}
-\setinterfacecommand{testpage}{testpage}
-\setinterfacecommand{tex}{tex}
-\setinterfacecommand{textbackground}{textbackground}
-\setinterfacecommand{textcolor}{textcolor}
-\setinterfacecommand{textheight}{inaltimetext}
-\setinterfacecommand{textnote}{textnote}
-\setinterfacecommand{textreference}{referintatext}
-\setinterfacecommand{textrule}{riglatext}
-\setinterfacecommand{textvariable}{variabilatext}
-\setinterfacecommand{textwidth}{latimetext}
-\setinterfacecommand{thefirstcharacter}{thefirstcharacter}
-\setinterfacecommand{thenormalizedbodyfontsize}{thenormalizedbodyfontsize}
-\setinterfacecommand{theremainingcharacters}{theremainingcharacters}
-\setinterfacecommand{thinrule}{liniesubtire}
-\setinterfacecommand{thinrules}{liniisubtiri}
-\setinterfacecommand{tolinenote}{tolinenote}
-\setinterfacecommand{tooltip}{tooltip}
-\setinterfacecommand{topdistance}{distantasus}
-\setinterfacecommand{topheight}{inaltimesus}
-\setinterfacecommand{topspace}{spatiusus}
-\setinterfacecommand{totalnumberofpages}{numartotalpagini}
-\setinterfacecommand{translate}{traduce}
-\setinterfacecommand{txt}{txt}
-\setinterfacecommand{typ}{typ}
-\setinterfacecommand{type}{type}
-\setinterfacecommand{typebuffer}{scriebuffer}
-\setinterfacecommand{typedefinedbuffer}{typedefinedbuffer}
-\setinterfacecommand{typefile}{typefile}
-\setinterfacecommand{typeinlinebuffer}{typeinlinebuffer}
-\setinterfacecommand{typing}{typing}
-\setinterfacecommand{unitmeaning}{numeunitate}
-\setinterfacecommand{unknown}{necunoscut}
-\setinterfacecommand{unregisterhyphenationpattern}{unregisterhyphenationpattern}
-\setinterfacecommand{useJSscripts}{folosestescriptJS}
-\setinterfacecommand{useURL}{folosesteURL}
-\setinterfacecommand{useXMLfilter}{useXMLfilter}
-\setinterfacecommand{useblocks}{folosestebloc}
-\setinterfacecommand{usebodyfont}{usebodyfont}
-\setinterfacecommand{usebodyfontparameter}{usebodyfontparameter}
-\setinterfacecommand{usecommands}{folosestecomenzi}
-\setinterfacecommand{useencoding}{folosestecodificarea}
-\setinterfacecommand{useexternaldocument}{folosestedocumentextern}
-\setinterfacecommand{useexternalfigure}{folosestefiguraexterna}
-\setinterfacecommand{useexternalfile}{folosestefisierextern}
-\setinterfacecommand{useexternalfiles}{folosestefisiereexterne}
-\setinterfacecommand{useexternalsoundtrack}{folosestemuzicaexterna}
-\setinterfacecommand{usemodule}{folosestemodul}
-\setinterfacecommand{usemodules}{folosestemodule}
-\setinterfacecommand{usepath}{folosestedirector}
-\setinterfacecommand{usereferences}{folosestereferinte}
-\setinterfacecommand{usespecials}{folosestespeciale}
-\setinterfacecommand{usesymbols}{folosestesimboluri}
-\setinterfacecommand{usetypescript}{usetypescript}
-\setinterfacecommand{usetypescriptfile}{usetypescriptfile}
-\setinterfacecommand{useurl}{folosesteurl}
-\setinterfacecommand{verbatim}{verbatim}
-\setinterfacecommand{version}{versiune}
-\setinterfacecommand{vl}{vl}
-\setinterfacecommand{weekday}{zidinsaptamana}
-\setinterfacecommand{whitespace}{spatiualb}
-\setinterfacecommand{widthspanningtext}{widthspanningtext}
-\setinterfacecommand{wordright}{cuvantdreapta}
-\setinterfacecommand{writebetweenlist}{scrieintreliste}
-\setinterfacecommand{writetolist}{scrieinlista}
-\setinterfacecommand{writetoreferencelist}{scrieinlistareferinte}
-\setinterfacecommand{writetoregister}{scrieinregistru}
-%
-\endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/context/base/mkii/mult-sys.mkii b/Master/texmf-dist/tex/context/base/mkii/mult-sys.mkii
deleted file mode 100644
index 1961fdf11b1..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/mult-sys.mkii
+++ /dev/null
@@ -1,892 +0,0 @@
-%D \module
-%D [ file=mult-sys,
-%D version=1996.06.01,
-%D title=\CONTEXT\ Multilingual Macros,
-%D subtitle=System,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 boring module we define a lot of obscure but useful
-%D system constants. By doing so we save lots of memory while
-%D at the same time we prevent ourself from typing errors.
-
-\writestatus{loading}{ConTeXt Multilingual Macros / System}
-
-\unprotect
-
-%D The constants are grouped in such a way that there is a
-%D minimal change of conflicts.
-%D
-%D \starttyping
-%D \definesystemconstants {word}
-%D \definemessageconstant {word}
-%D \stoptyping
-%D
-%D This commands generate \type{\s!word} and \type{\m!word}.
-
-\definesystemconstant {hans}
-\definesystemconstant {taco}
-
-%D First we define some system constants used for both the
-%D multi||lingual interface and multi||linguag typesetting.
-
-\definesystemconstant {afrikaans} \definesystemconstant {af}
-\definesystemconstant {arabic} \definesystemconstant {ar}
-\definesystemconstant {catalan} \definesystemconstant {ca}
-\definesystemconstant {chinese} \definesystemconstant {cn}
-\definesystemconstant {croatian} \definesystemconstant {hr}
-\definesystemconstant {czech} \definesystemconstant {cs} \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 {lithuanian} \definesystemconstant {lt}
-\definesystemconstant {bokmal} \definesystemconstant {nb} \definesystemconstant {norwegian} \definesystemconstant {no}
-\definesystemconstant {nynorsk} \definesystemconstant {nn}
-\definesystemconstant {polish} \definesystemconstant {pl}
-\definesystemconstant {persian} \definesystemconstant {pe}
-\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 {turkmen} \definesystemconstant {tk}
-\definesystemconstant {gbenglish} \definesystemconstant {gb} \definesystemconstant {ukenglish} \definesystemconstant {uk}
-\definesystemconstant {usenglish} \definesystemconstant {us}
-\definesystemconstant {ukrainian} \definesystemconstant {ua}
-\definesystemconstant {greek} \definesystemconstant {gr}
-\definesystemconstant {ancientgreek} \definesystemconstant {agr}
-\definesystemconstant {vietnamese} \definesystemconstant {vi} \definesystemconstant {vn}
-
-%D For proper \UNICODE\ support we need a few font related
-%D constants.
-
-\definesystemconstant {BoldItalic}
-\definesystemconstant {BoldSlanted}
-\definesystemconstant {Bold}
-\definesystemconstant {Italic}
-\definesystemconstant {Regular}
-\definesystemconstant {Slanted}
-\definesystemconstant {Unicode}
-
-\definesystemconstant {Serif} \definesystemconstant {Regular}
-\definesystemconstant {Sans} \definesystemconstant {Support}
-\definesystemconstant {Mono} \definesystemconstant {Type}
-\definesystemconstant {Math}
-\definesystemconstant {Handwriting}
-\definesystemconstant {Calligraphy}
-\definesystemconstant {Casual}
-
-\definesystemconstant {SerifBold} \definesystemconstant {SansBold} \definesystemconstant {MonoBold}
-\definesystemconstant {SerifItalic} \definesystemconstant {SansItalic} \definesystemconstant {MonoItalic}
-\definesystemconstant {SerifBoldItalic} \definesystemconstant {SansBoldItalic} \definesystemconstant {MonoBoldItalic}
-\definesystemconstant {SerifSlanted} \definesystemconstant {SansSlanted} \definesystemconstant {MonoSlanted}
-\definesystemconstant {SerifBoldSlanted} \definesystemconstant {SansBoldSlanted} \definesystemconstant {MonoBoldSlanted}
-\definesystemconstant {SerifCaps} \definesystemconstant {SansCaps} \definesystemconstant {MonoCaps}
-
-\definesystemconstant {Normal}
-\definesystemconstant {Caps}
-
-\definesystemconstant {mnem} % kind of generic short tag
-
-\definesystemconstant {file}
-\definesystemconstant {name}
-\definesystemconstant {spec}
-
-\definesystemconstant {serif}
-\definesystemconstant {sans}
-\definesystemconstant {mono}
-\definesystemconstant {math}
-\definesystemconstant {handwriting}
-\definesystemconstant {calligraphy}
-\definesystemconstant {casual}
-\definesystemconstant {fax}
-
-\definesystemconstant {fallback}
-
-\definesystemconstant {none}
-\definesystemconstant {default}
-\definesystemconstant {smallcaps}
-
-%D As the name of their define command states, the next set of
-%D constants is used in the message macro's.
-
-\definemessageconstant {check}
-\definemessageconstant {colors}
-\definemessageconstant {columns}
-\definemessageconstant {encodings}
-\definemessageconstant {regimes}
-\definemessageconstant {figures}
-\definemessageconstant {fields}
-\definemessageconstant {files}
-\definemessageconstant {floatblocks}
-\definemessageconstant {fonts}
-\definemessageconstant {handlings}
-\definemessageconstant {interactions}
-\definemessageconstant {javascript}
-\definemessageconstant {layouts}
-\definemessageconstant {linguals}
-\definemessageconstant {references}
-\definemessageconstant {specials}
-\definemessageconstant {structures}
-\definemessageconstant {symbols}
-\definemessageconstant {systems}
-\definemessageconstant {lua}
-\definemessageconstant {textblocks}
-\definemessageconstant {verbatims}
-\definemessageconstant {versions}
-\definemessageconstant {metapost}
-\definemessageconstant {chemicals}
-\definemessageconstant {publications}
-
-%D Net come some \CONTEXT\ constants, used in the definition
-%D of private commands:
-
-\definesystemconstant {tex}
-\definesystemconstant {xml}
-\definesystemconstant {lua}
-
-\definesystemconstant {next}
-\definesystemconstant {pickup}
-\definesystemconstant {ascii}
-\definesystemconstant {default}
-\definesystemconstant {unknown}
-\definesystemconstant {action}
-\definesystemconstant {compare}
-\definesystemconstant {do}
-\definesystemconstant {dodo}
-\definesystemconstant {complex}
-\definesystemconstant {simple}
-\definesystemconstant {start}
-\definesystemconstant {stop}
-\definesystemconstant {dummy}
-\definesystemconstant {local}
-\definesystemconstant {global}
-\definesystemconstant {done}
-\definesystemconstant {font}
-\definesystemconstant {link}
-\definesystemconstant {parent}
-\definesystemconstant {clone}
-\definesystemconstant {section} \let\v!sectionlevel\s!section % for old times sake
-\definesystemconstant {handler}
-\definesystemconstant {counter}
-\definesystemconstant {single}
-\definesystemconstant {multi}
-
-\definesystemconstant {hasnumber}
-\definesystemconstant {hastitle}
-\definesystemconstant {hascaption}
-\definesystemconstant {haslevel}
-
-\definesystemconstant {mkiv}
-\definesystemconstant {mkii}
-\definesystemconstant {entities}
-
-\definesystemconstant {normal}
-\definesystemconstant {bold}
-\definesystemconstant {italic}
-\definesystemconstant {slanted}
-
-\definesystemconstant {default}
-\definesystemconstant {smallcaps}
-
-\definesystemconstant {text}
-\definesystemconstant {page}
-\definesystemconstant {leftpage}
-\definesystemconstant {rightpage}
-\definesystemconstant {somewhere}
-
-%D A more experienced \TEX\ user will recognize the next four
-%D constants. We need these because font-definitions are
-%D partially english.
-
-\definesystemconstant {run}
-
-\definesystemconstant {fam}
-\definesystemconstant {text}
-\definesystemconstant {script}
-\definesystemconstant {scriptscript}
-
-\definesystemconstant {lefthyphenmin}
-\definesystemconstant {righthyphenmin}
-\definesystemconstant {lefthyphenchar}
-\definesystemconstant {righthyphenchar}
-
-\definesystemconstant {skewchar}
-\definesystemconstant {hyphenchar}
-\definesystemconstant {catcodes}
-\definesystemconstant {encoding}
-\definesystemconstant {resource}
-\definesystemconstant {mapping}
-\definesystemconstant {language}
-\definesystemconstant {patterns}
-\definesystemconstant {rname}
-\definesystemconstant {rscale}
-\definesystemconstant {handling}
-\definesystemconstant {features}
-\definesystemconstant {fallbacks}
-\definesystemconstant {goodies}
-\definesystemconstant {background}
-\definesystemconstant {ucmap}
-
-\definesystemconstant {property}
-\definesystemconstant {overprint}
-\definesystemconstant {layer}
-\definesystemconstant {effect}
-\definesystemconstant {negative}
-\definesystemconstant {color}
-\definesystemconstant {transparency}
-
-\definesystemconstant {black}
-\definesystemconstant {white}
-
-\definesystemconstant {format}
-\definesystemconstant {extensions}
-\definesystemconstant {initializations}
-
-%D Just to be complete we define the standard \TEX\ units.
-
-\definesystemconstant {cm}
-\definesystemconstant {em}
-\definesystemconstant {ex}
-\definesystemconstant {mm}
-\definesystemconstant {pt}
-\definesystemconstant {sp}
-\definesystemconstant {bp}
-\definesystemconstant {in}
-\definesystemconstant {pc}
-\definesystemconstant {cm}
-\definesystemconstant {dd}
-\definesystemconstant {cc}
-\definesystemconstant {nd}
-\definesystemconstant {nc}
-
-%D These constants are used for internal and utility
-%D commands.
-
-\definesystemconstant {check}
-\definesystemconstant {reset}
-\definesystemconstant {set}
-
-\definesystemconstant {entrya}
-\definesystemconstant {entryb}
-\definesystemconstant {entryc}
-\definesystemconstant {entryd}
-\definesystemconstant {entry}
-\definesystemconstant {see}
-\definesystemconstant {from}
-\definesystemconstant {to}
-\definesystemconstant {line}
-\definesystemconstant {page}
-\definesystemconstant {realpage}
-\definesystemconstant {userpage}
-\definesystemconstant {subpage}
-
-\definesystemconstant {synonym}
-
-\definesystemconstant {reference}
-\definesystemconstant {main}
-
-\definesystemconstant {list}
-
-\definesystemconstant {item}
-\definesystemconstant {itemcount}
-
-\definesystemconstant {number}
-\definesystemconstant {references}
-\definesystemconstant {between}
-\definesystemconstant {format}
-\definesystemconstant {old}
-
-\definesystemconstant {thisisblock}
-\definesystemconstant {thiswasblock}
-
-\definesystemconstant {figurepreset}
-
-\definesystemconstant {empty}
-
-%D Some \CONTEXT\ commands take a two||pass aproach to
-%D optimize the typesetting. Each two||pass object has its
-%D own tag.
-
-\definesystemconstant {pass}
-
-\definesystemconstant {data}
-\definesystemconstant {float}
-\definesystemconstant {list}
-\definesystemconstant {page}
-\definesystemconstant {subpage}
-\definesystemconstant {margin}
-\definesystemconstant {profile}
-\definesystemconstant {versionbegin}
-\definesystemconstant {versionend}
-\definesystemconstant {cross}
-\definesystemconstant {paragraph}
-
-%D A lot of macros use tags to distinguish between different
-%D objects, e.g. lists and registers.
-
-\definesystemconstant {prt} % part (deel)
-\definesystemconstant {chp} % chapter (hoofdstuk)
-\definesystemconstant {sec} % section (paragraaf)
-\definesystemconstant {tit} % title (titel)
-\definesystemconstant {sub} % subject (onderwerp)
-\definesystemconstant {mar} % margin (marge)
-\definesystemconstant {num} % number (doornummeren)
-\definesystemconstant {def} % definition (doordefinieren)
-\definesystemconstant {for} % formula (formule)
-\definesystemconstant {fnt} % footnote (voetnoot)
-\definesystemconstant {ind} % index (register)
-\definesystemconstant {lin} % linked index
-\definesystemconstant {lst} % list (opsomming)
-\definesystemconstant {flt} % float (plaatsblok)
-\definesystemconstant {pag} % page (pagina)
-\definesystemconstant {txt} % text (tekst)
-\definesystemconstant {ref} % reference (verwijzing)
-\definesystemconstant {lab} % label (label)
-\definesystemconstant {aut} % automatic (inhoud, index)
-\definesystemconstant {vwa} % automatic (illustrations)
-\definesystemconstant {vwb} % automatic (illustrations)
-
-\definesystemconstant {kop} % kop % still dutch
-
-%D Reference labels can be tagged by users, for instance by
-%D means of \type{tag:}. The reference mechanism itself uses
-%D some tags too. These are definitely not to be used by users.
-%D Here they are:
-
-\definereferenceconstant {cross} {:c:} % cross reference
-\definereferenceconstant {view} {:v:} % view reference
-\definereferenceconstant {viewa} {:a:} % view reference test a
-\definereferenceconstant {viewb} {:b:} % view reference test b
-\definereferenceconstant {page} {:p:} % page referece
-\definereferenceconstant {list} {:l:} % list reference
-\definereferenceconstant {exec} {:e:} % execution reference
-\definereferenceconstant {form} {:m:} % form reference
-\definereferenceconstant {syst} {:s:} % system reference
-
-\definereferenceconstant {from} {:f:} % from list reference
-\definereferenceconstant {to} {:t:} % to list reference
-
-\definereferenceconstant {object} {:o:} % object reference
-\definereferenceconstant {driver} {:d:} % driver object reference
-\definereferenceconstant {widget} {:w:} % field chain reference
-
-\definereferenceconstant {java} {:j:} % java scripts
-
-%D When we use numbers and dimensions the same applies as
-%D with the keywords like \type{width} and \type{plus}
-%D mentioned earlier.
-
-\def\!!ten {10}
-\def\!!twelve {12}
-\def\!!hundred {100}
-\def\!!thousand {1000}
-\def\!!tenthousand {10000}
-\def\!!maxcard {65536}
-\def\!!medcard {32768}
-
-\def\!!zeropoint {0pt}
-\def\!!onepoint {1pt}
-\def\!!twopoint {2pt}
-\def\!!threepoint {3pt}
-\def\!!fourpoint {4pt}
-\def\!!fivepoint {5pt}
-\def\!!sixpoint {6pt}
-\def\!!sevenpoint {7pt}
-\def\!!eightpoint {8pt}
-\def\!!ninepoint {9pt}
-\def\!!tenpoint {10pt}
-\def\!!elevenpoint {11pt}
-\def\!!twelvepoint {12pt}
-\def\!!fourteenpointfour {14.4pt}
-
-\let\onerealpoint\onepoint % needed for latex
-
-% D Another optimization is:
-%
-% \let\points\onepoint
-
-%D A rough test is:
-%D
-%D \starttyping
-%D \def\TestMe % 7.75 sec on a P4/2G
-%D {\dimen0=10\points\dimen0=10\points\dimen0=10\points\dimen0=10\points\dimen0=10\points
-%D \dimen0=10\points\dimen0=10\points\dimen0=10\points\dimen0=10\points\dimen0=10\points}
-%D
-%D \def\TestMe % 11.5 sec on a P4/2G
-%D {\dimen0=10pt\dimen0=10pt\dimen0=10pt\dimen0=10pt\dimen0=10pt%
-%D \dimen0=10pt\dimen0=10pt\dimen0=10pt\dimen0=10pt\dimen0=10pt}
-%D
-%D \def\TestMe % 12.5 sec on a P4/2G
-%D {\dimen0=10\s!pt\dimen0=10\s!pt\dimen0=10\s!pt\dimen0=10\s!pt\dimen0=10\s!pt%
-%D \dimen0=10\s!pt\dimen0=10\s!pt\dimen0=10\s!pt\dimen0=10\s!pt\dimen0=10\s!pt}
-%D
-%D \testfeatureonce {500000}{\TestMe}
-%D \stoptyping
-
-%D Variables are composed of a command specific tag and a user
-%D supplied variable (system constant). The first tag \type{ag}
-%D for instance is available as \type{\??ag} and expands to
-%D \type{@@ag} in composed variables.
-
-% vervallen : hd hr hm vt vr vm tr tn te br bm bo on om or
-
-\definesystemvariable {ab} % AlignedBoxes
-\definesystemvariable {ac} % ACcent
-\definesystemvariable {ae} % AttributEs
-\definesystemvariable {ag} % AchterGrond
-\definesystemvariable {al} % ALinea's
-\definesystemvariable {am} % interActieMenu
-\definesystemvariable {an} % ANchor
-\definesystemvariable {as} % AlignmentSwitch
-\definesystemvariable {at} % ATtachments
-\definesystemvariable {ba} % synchronisatieBAlk
-\definesystemvariable {bc} % BaCkend
-\definesystemvariable {be} % startstop (BeginEnd)
-\definesystemvariable {bj} % BlokJe
-\definesystemvariable {bk} % Blokken (floats)
-\definesystemvariable {bl} % BLanko
-\definesystemvariable {bg} % BleedinG
-\definesystemvariable {bm} % BookMark
-\definesystemvariable {bo} % BlankO (definitions)
-\definesystemvariable {bp} % BreakPoint
-\definesystemvariable {br} % sideBaR
-\definesystemvariable {bs} % SelecteerBlokken
-\definesystemvariable {bt} % BuTton
-\definesystemvariable {bu} % BUffer
-\definesystemvariable {bv} % Brieven
-\definesystemvariable {by} % Per
-\definesystemvariable {cb} % CollectBox
-\definesystemvariable {cc} % Comment
-\definesystemvariable {ce} % CasEs
-\definesystemvariable {cf} % Style (ColorFont)
-\definesystemvariable {ch} % CHaracterspacing
-\definesystemvariable {ci} % CItaat
-\definesystemvariable {ck} % Character Kerning
-\definesystemvariable {cl} % kleur (CoLor setup)
-\definesystemvariable {cn} % CollumN
-\definesystemvariable {cm} % CheMical
-\definesystemvariable {co} % COmbinaties
-\definesystemvariable {cp} % CliP
-\definesystemvariable {cr} % kleur (ColoR)
-\definesystemvariable {cs} % kleur (ColorSeparation
-\definesystemvariable {cv} % ConVersie
-\definesystemvariable {cy} % CrYteria
-\definesystemvariable {da} % DAte
-\definesystemvariable {db} % Labels
-\definesystemvariable {dc} % DroppedCaps
-\definesystemvariable {dd} % DoorDefinieren
-\definesystemvariable {de} % DEel
-\definesystemvariable {di} % DIrections
-\definesystemvariable {dl} % DunneLijnen
-\definesystemvariable {dn} % DoorNummeren
-\definesystemvariable {dm} % DefineMeasure
-\definesystemvariable {do} % DefinieerOpmaak
-\definesystemvariable {du} % DUmmy
-\definesystemvariable {ds} % DoorSpringen
-\definesystemvariable {ef} % ExternFiguur
-\definesystemvariable {ec} % EnCoding
-\definesystemvariable {el} % Elements
-\definesystemvariable {en} % ENvironments
-\definesystemvariable {ep} % ExternfiguurPreset
-\definesystemvariable {eq} % EQalign
-\definesystemvariable {er} % external resources
-\definesystemvariable {ex} % ExterneFiguren
-\definesystemvariable {fa} % font feature
-\definesystemvariable {fc} % FramedContent
-\definesystemvariable {fd} % FielD
-\definesystemvariable {fe} % FoxetExtensions
-\definesystemvariable {ff} % FontFile
-\definesystemvariable {fg} % FiGuurmaten
-\definesystemvariable {fi} % FIle
-\definesystemvariable {fl} % Floats
-\definesystemvariable {fm} % ForMules
-\definesystemvariable {fn} % subformulas
-\definesystemvariable {fo} % xml FO
-\definesystemvariable {fp} % FilegroeP
-\definesystemvariable {fq} % Features
-\definesystemvariable {fr} % ForM
-\definesystemvariable {fs} % FileSynonym
-\definesystemvariable {ft} % FonTs
-\definesystemvariable {fu} % FontSolution
-\definesystemvariable {fv} % FontVariant
-\definesystemvariable {fw} % simpleFonts by Wolfgang
-\definesystemvariable {fx} % FoXet
-\definesystemvariable {gr} % GRid
-\definesystemvariable {ha} % HAng
-\definesystemvariable {hs} % HSpace
-\definesystemvariable {ht} % HiddenText
-\definesystemvariable {ia} % Interactie
-\definesystemvariable {ib} % InteractieBalk
-\definesystemvariable {ic} % ICc profiles
-\definesystemvariable {id} % Index
-\definesystemvariable {ig} % ItemGroup
-\definesystemvariable {ih} % InHoudsopgave
-\definesystemvariable {ii} % stelIndexIn
-\definesystemvariable {il} % stelInvulRegelsin
-\definesystemvariable {im} % InMarge
-\definesystemvariable {in} % INspringen
-\definesystemvariable {ip} % InsertPages
-\definesystemvariable {is} % Items
-\definesystemvariable {it} % stelInTerliniein
-\definesystemvariable {iv} % stelInvulLijnenin
-\definesystemvariable {ka} % KAntlijn
-\definesystemvariable {kd} % KaDerteksten
-\definesystemvariable {kj} % KopJes (floats)
-\definesystemvariable {kk} % Kapitalen
-\definesystemvariable {kl} % KoLommen
-\definesystemvariable {km} % KenMerk
-\definesystemvariable {ko} % KOp(pen)
-\definesystemvariable {kp} % KopPelteken
-\definesystemvariable {kr} % KoRps
-\definesystemvariable {ks} % KolomSpan
-\definesystemvariable {kt} % KonTakten
-\definesystemvariable {kw} % KontaktWaarde
-\definesystemvariable {la} % LAnguage
-\definesystemvariable {lb} % LaBels
-\definesystemvariable {ld} % LegenDa
-\definesystemvariable {le} % LinetablE
-\definesystemvariable {lf} % LocalFigures
-\definesystemvariable {lg} % taal (LanGuage)
-\definesystemvariable {li} % LIjst
-\definesystemvariable {lk} % LinK
-\definesystemvariable {ll} % Layers
-\definesystemvariable {lx} % LayerteXt
-\definesystemvariable {ln} % LijNen
-\definesystemvariable {lo} % LOgos
-\definesystemvariable {lt} % LiTeratuur
-\definesystemvariable {ls} % languageScript
-\definesystemvariable {ly} % LaYout
-\definesystemvariable {ma} % MargeAchtergrond
-\definesystemvariable {mb} % MargeBlokken
-\definesystemvariable {md} % MoDule
-\definesystemvariable {me} % MultilingualElement (tags)
-\definesystemvariable {mg} % Metapost paGe
-\definesystemvariable {mh} % MultilingualHead
-\definesystemvariable {mk} % MarKering
-\definesystemvariable {ml} % MultilingualLabel
-\definesystemvariable {mm} % MultilingualMath
-\definesystemvariable {mt} % inline MaTh
-\definesystemvariable {mo} % Math Options
-\definesystemvariable {mp} % MetaPost
-\definesystemvariable {mx} % MatriX
-\definesystemvariable {ng} % parbuilders
-\definesystemvariable {nh} % new heads (structure)
-\definesystemvariable {nn} % structurenumbering
-\definesystemvariable {nm} % Nummering
-\definesystemvariable {np} % NaastPlaatsen
-\definesystemvariable {nr} % Nummeren
-\definesystemvariable {of} % OFfset
-\definesystemvariable {oi} % OmlijndInstellingen
-\definesystemvariable {ol} % OmLijnd
-\definesystemvariable {od} % Omlijnd Defaults (simple)
-\definesystemvariable {on} % ONderstreep
-\definesystemvariable {oo} % OpsOmmingen
-\definesystemvariable {op} % OPsomming
-\definesystemvariable {or} % OtpfilteR
-\definesystemvariable {os} % OffSet
-\definesystemvariable {ot} % OTpsequence
-\definesystemvariable {ov} % OVerlay
-\definesystemvariable {ox} % OffsetBox
-\definesystemvariable {pa} % PAlet
-\definesystemvariable {pb} % PuBlication
-\definesystemvariable {pc} % PageComment
-\definesystemvariable {pe} % PagEhandler
-\definesystemvariable {pf} % ProFiel
-\definesystemvariable {pg} % KoppelPagina
-\definesystemvariable {ph} % ParagrapH
-\definesystemvariable {pl} % PLaats
-\definesystemvariable {pn} % PaginaNummer
-\definesystemvariable {po} % PrOcessor
-\definesystemvariable {pp} % PaPier
-\definesystemvariable {pr} % PRogrammas
-\definesystemvariable {ps} % PoSitioneren
-\definesystemvariable {pt} % PageshifT
-\definesystemvariable {py} % PropertYs
-\definesystemvariable {pv} % PublicationVariable
-\definesystemvariable {ra} % RAise
-\definesystemvariable {rd} % RenDering
-\definesystemvariable {rf} % ReFereren
-\definesystemvariable {rg} % ReGel
-\definesystemvariable {rl} % ReferentieLijst
-\definesystemvariable {rn} % RegelNummer
-\definesystemvariable {ro} % ROteren
-\definesystemvariable {rr} % linenotes
-\definesystemvariable {rs} % RaSters
-\definesystemvariable {rt} % RoosTers
-\definesystemvariable {rv} % ReserVeerfiguur
-\definesystemvariable {rw} % RenderingWindow
-\definesystemvariable {sa} % ScAle
-\definesystemvariable {sb} % SectieBlok
-\definesystemvariable {sc} % SCherm
-\definesystemvariable {sd} % SounD
-\definesystemvariable {se} % SEctie
-\definesystemvariable {sf} % SpeciFics
-\definesystemvariable {sg} % SpacinG
-\definesystemvariable {sh} % ShapeText
-\definesystemvariable {si} % SplIt
-\definesystemvariable {sk} % SectieKop
-\definesystemvariable {sl} % SmalLer
-\definesystemvariable {sm} % SynonieMen
-\definesystemvariable {sn} % SubNummer
-\definesystemvariable {so} % SOrteren
-\definesystemvariable {sp} % SelecteerPapier
-\definesystemvariable {sr} % SpacehandleR
-\definesystemvariable {ss} % Symbool
-\definesystemvariable {st} % STickers
-\definesystemvariable {su} % SetUp
-\definesystemvariable {sv} % SysteemVariabelen
-\definesystemvariable {sw} % SectionWorld
-\definesystemvariable {sx} % Selector
-\definesystemvariable {sy} % SYnchronisatie
-\definesystemvariable {ta} % TAb
-\definesystemvariable {tb} % TekstBlokken
-\definesystemvariable {td} % TextbackgrounDs
-\definesystemvariable {te} % TEmplate
-\definesystemvariable {tf} % TypeFace
-\definesystemvariable {tg} % Tex paGe
-\definesystemvariable {ti} % TabelInstellingen
-\definesystemvariable {tk} % Teksten
-\definesystemvariable {tl} % TekstLijnen
-\definesystemvariable {tm} % TypesynonyM
-\definesystemvariable {tp} % TyPen
-\definesystemvariable {tx} % TeXtflow
-\definesystemvariable {to} % TOlerance
-\definesystemvariable {tr} % TRacer
-\definesystemvariable {ts} % TypeScript
-\definesystemvariable {tt} % TabulaTe
-\definesystemvariable {ty} % TYpe
-\definesystemvariable {uc} % Unicode
-\definesystemvariable {ui} % UItvoer
-\definesystemvariable {ur} % URl
-\definesystemvariable {up} % Utility Program
-\definesystemvariable {va} % VspAce
-\definesystemvariable {ve} % VErsie
-\definesystemvariable {vn} % VoetNoten
-\definesystemvariable {vs} % VSpacing
-\definesystemvariable {vt} % VerTical
-\definesystemvariable {wr} % WitRuimte
-\definesystemvariable {wl} % WordList
-\definesystemvariable {xf} % XML File
-\definesystemvariable {xl} % lxml (mkiv)
-\definesystemvariable {xm} % xml (mkiv)
-\definesystemvariable {xp} % XML Processing
-\definesystemvariable {xy} % schaal
-\definesystemvariable {za} % ZetspiegelAanpassing
-
-%D Next we define some language independant one letter
-%D variables and keywords.
-
-\defineinterfaceconstant {x} {x} % x offset
-\defineinterfaceconstant {y} {y} % y offset
-\defineinterfaceconstant {w} {w} % width
-\defineinterfaceconstant {h} {h} % height
-\defineinterfaceconstant {s} {s} % size
-\defineinterfaceconstant {t} {t} % title
-\defineinterfaceconstant {c} {c} % creator
-\defineinterfaceconstant {e} {e} % extension
-\defineinterfaceconstant {f} {f} % file
-
-\defineinterfaceconstant {a} {a} % kunnen weg
-\defineinterfaceconstant {b} {b} % kunnen weg
-\defineinterfaceconstant {c} {c} % kunnen weg
-\defineinterfaceconstant {d} {d} % kunnen weg
-\defineinterfaceconstant {e} {e} % kunnen weg
-
-\defineinterfaceconstant {s} {s}
-\defineinterfaceconstant {r} {r}
-\defineinterfaceconstant {g} {g}
-\defineinterfaceconstant {b} {b}
-\defineinterfaceconstant {c} {c}
-\defineinterfaceconstant {m} {m}
-\defineinterfaceconstant {y} {y}
-\defineinterfaceconstant {k} {k}
-\defineinterfaceconstant {a} {a} % alternative
-\defineinterfaceconstant {t} {t} % transparency
-\defineinterfaceconstant {p} {p} % percentage
-
-\defineinterfaceconstant {t} {t}
-\defineinterfaceconstant {h} {h}
-\defineinterfaceconstant {b} {b}
-
-\defineinterfaceconstant {rgb} {rgb}
-\defineinterfacevariable {rgb} {rgb}
-
-\defineinterfaceconstant {cmyk} {cmyk}
-\defineinterfacevariable {cmyk} {cmyk}
-
-\defineinterfaceconstant {mp} {mp}
-\defineinterfacevariable {mp} {mp}
-
-\defineinterfacevariable {s} {s}
-
-\defineinterfacevariable {a} {a}
-\defineinterfacevariable {b} {b}
-\defineinterfacevariable {c} {c}
-\defineinterfacevariable {d} {d}
-
-%D Special purpose variables:
-
-\def\v!oddeven#1{\ifodd#1\v!odd\else\v!even\fi}
-
-%D The names of files and their extensions are fixed.
-%D \CONTEXT\ uses as less files as possible. Utility files can
-%D be recognized by the first two characters of the extension:
-%D \type{tu}.
-
-\definefileconstant {utilityfilename} {texutil}
-
-\definefileconstant {blockextension} {tub}
-\definefileconstant {figureextension} {tuf}
-\definefileconstant {inputextension} {tui}
-\definefileconstant {outputextension} {tuo} % tup for previous run
-\definefileconstant {optionextension} {top}
-\definefileconstant {temporaryextension} {tmp}
-\definefileconstant {patternsextension} {pat}
-\definefileconstant {hyphensextension} {hyp}
-\definefileconstant {fontmapextension} {map}
-\definefileconstant {bibextension} {bbl}
-
-%D These files are loaded at start||up. They may contain system
-%D specific setups (or calls to other files), old macro's, to
-%D garantee compatibility and new macro's noy yet present in
-%D the format.
-
-\definefileconstant {errfilename} {cont-err}
-\definefileconstant {sysfilename} {cont-sys}
-\definefileconstant {newfilename} {cont-new}
-\definefileconstant {locfilename} {cont-loc}
-\definefileconstant {expfilename} {cont-exp}
-%definefileconstant {usrfilename} {cont-usr} % .tex
-%definefileconstant {fmtfilename} {cont-fmt} % .tex
-
-%D Handy for typescripts (we could use s! instead:
-
-\definetypescriptconstant {name} {name}
-\definetypescriptconstant {default} {default}
-\definetypescriptconstant {map} {map}
-\definetypescriptconstant {special} {special}
-\definetypescriptconstant {size} {size}
-
-%D The setup files for the language, font, color and special
-%D subsystems have a common prefix. This means that we have at
-%D most three characters for unique filenames.
-
-\definefileconstant {colorprefix} {colo-}
-\definefileconstant {encodingprefix} {enco-}
-\definefileconstant {filterprefix} {filt-}
-\definefileconstant {fontprefix} {font-}
-\definefileconstant {handlingprefix} {hand-}
-\definefileconstant {javascriptprefix} {java-}
-\definefileconstant {languageprefix} {lang-}
-\definefileconstant {mathprefix} {math-}
-\definefileconstant {metapostprefix} {meta-}
-\definefileconstant {regimeprefix} {regi-}
-\definefileconstant {specialprefix} {spec-}
-\definefileconstant {symbolprefix} {symb-}
-\definefileconstant {typeprefix} {type-}
-\definefileconstant {xtagprefix} {xtag-}
-\definefileconstant {propprefix} {prop-}
-\definefileconstant {unicprefix} {unic-}
-\definefileconstant {sortprefix} {sort-}
-\definefileconstant {prettyprefix} {pret-}
-
-\definefileconstant {moduleprefix} {m-}
-\definefileconstant {styleprefix} {s-}
-\definefileconstant {xstyleprefix} {x-}
-\definefileconstant {privateprefix} {p-}
-\definefileconstant {thirdprefix} {t-}
-
-%definefileconstant {beforeprefix} {b-}
-%definefileconstant {afterprefix} {a-}
-
-%D \CONTEXT\ follows different strategies for finding files.
-%D The macros that are responsible for this 'clever' searching
-%D make use of two (very important) path specifiers.
-
-\definefileconstant {pathseparator} {/}
-\definefileconstant {currentpath} {.}
-\definefileconstant {parentpath} {..}
-
-%D The way fonts are defined and called upon is language
-%D independant. We follow the scheme laid down by Knuth in
-%D Plain \TEX. We'll explain their meaning later.
-
-\defineinterfaceconstant {tf} {tf}
-\defineinterfaceconstant {bf} {bf}
-\defineinterfaceconstant {bs} {bs}
-\defineinterfaceconstant {bi} {bi}
-\defineinterfaceconstant {sl} {sl}
-\defineinterfaceconstant {it} {it}
-\defineinterfaceconstant {sc} {sc}
-\defineinterfaceconstant {rm} {rm}
-\defineinterfaceconstant {ss} {ss}
-\defineinterfaceconstant {tt} {tt}
-\defineinterfaceconstant {hw} {hw}
-\defineinterfaceconstant {cg} {cg}
-\defineinterfaceconstant {os} {os}
-\defineinterfaceconstant {mm} {mm}
-\defineinterfaceconstant {i} {i}
-\defineinterfaceconstant {nn} {nn}
-
-\defineinterfaceconstant {x} {x}
-\defineinterfaceconstant {xx} {xx}
-
-\defineinterfaceconstant {em} {em}
-
-\defineinterfaceconstant {mi} {mi}
-\defineinterfaceconstant {sy} {sy}
-\defineinterfaceconstant {ex} {ex}
-\defineinterfaceconstant {mr} {mr}
-
-\defineinterfaceconstant {ma} {ma}
-\defineinterfaceconstant {mb} {mb}
-\defineinterfaceconstant {mc} {mc}
-
-%D For figure inclusion we need:
-
-\defineinterfaceconstant {tif} {tif}
-\defineinterfaceconstant {eps} {eps}
-\defineinterfaceconstant {mps} {mps}
-\defineinterfaceconstant {jpg} {jpg}
-\defineinterfaceconstant {pdf} {pdf}
-\defineinterfaceconstant {png} {png}
-\defineinterfaceconstant {avi} {avi}
-\defineinterfaceconstant {mov} {mov}
-\defineinterfaceconstant {svg} {svg}
-\defineinterfaceconstant {tex} {tex}
-\defineinterfaceconstant {tmp} {tmp}
-\defineinterfaceconstant {cld} {cld}
-
-%D A careful reader will have noticed that in the module
-%D \type{mult-ini} we defined \type{\selectinterface}. We were
-%D not yet able to actually select an interface, because we
-%D still had to define the constants and variables. Now we've
-%D done so, selection is permitted.
-
-\selectinterface
-
-%D Ok, here are some more, because we've got ouselves some
-%D extensions to \CONTEXT.
-
-\definemessageconstant {addresses}
-\definemessageconstant {documents}
-
-\protect
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/norm-alo.mkii b/Master/texmf-dist/tex/context/base/mkii/norm-alo.mkii
deleted file mode 100644
index d359cf7e88f..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/norm-alo.mkii
+++ /dev/null
@@ -1,36 +0,0 @@
-%D \module
-%D [ file=norm-alo,
-%D version=2009.03.19,
-%D title=\CONTEXT\ Norm Macros,
-%D subtitle=\ALEPH\ and \OMEGA,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 file will become obsolete!
-
-% omega primitives
-
-\let\textdir = \textdir
-\let\pagedir = \pagedir
-\let\mathdir = \mathdir
-\let\pardir = \pardir
-\let\bodydir = \bodydir
-\let\leftghost = \leftghost
-\let\rightghost = \rightghost
-\let\localleftbox = \localleftbox
-\let\localrightbox = \localrightbox
-\let\localinterlinepenalty = \localinterlinepenalty
-\let\localbrokenpenalty = \localbrokenpenalty
-
-% aleph primitives
-
-\let\boxdir = \boxdir
-\let\pagebottomoffset = \pagebottomoffset
-\let\pagerightoffset = \pagerightoffset
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/norm-ctx.mkii b/Master/texmf-dist/tex/context/base/mkii/norm-ctx.mkii
deleted file mode 100644
index b1a4c7d3593..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/norm-ctx.mkii
+++ /dev/null
@@ -1,16 +0,0 @@
-%D \module
-%D [ file=norm-ctx,
-%D version=2009.03.19,
-%D title=\CONTEXT\ Norm Macros,
-%D subtitle=\ALEPH\ and \OMEGA,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 A few more might end up here (like the weird ones in syst-ini).
-
-\let\normalreqno = \normaleqno
diff --git a/Master/texmf-dist/tex/context/base/mkii/norm-etx.mkii b/Master/texmf-dist/tex/context/base/mkii/norm-etx.mkii
deleted file mode 100644
index bd244e4d1e9..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/norm-etx.mkii
+++ /dev/null
@@ -1,79 +0,0 @@
-%D \module
-%D [ file=norm-etx,
-%D version=2009.03.19,
-%D title=\CONTEXT\ Norm Macros,
-%D subtitle=\ETEX,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% etex primitives
-
-\let \normalbotmarks = \botmarks
-\let \normalclubpenalties = \clubpenalties
-\let \normalcurrentgrouplevel = \currentgrouplevel
-\let \normalcurrentgrouptype = \currentgrouptype
-\let \normalcurrentifbranch = \currentifbranch
-\let \normalcurrentiflevel = \currentiflevel
-\let \normalcurrentiftype = \currentiftype
-\let \normaldetokenize = \detokenize
-\let \normaldimexpr = \dimexpr
-\let \normaldisplaywidowpenalties = \displaywidowpenalties
-\let \normaleTeXVersion = \eTeXVersion
-\let \normaleTeXminorversion = \eTeXminorversion
-\let \normaleTeXrevision = \eTeXrevision
-\let \normaleTeXversion = \eTeXversion
-\let \normaleveryeof = \everyeof
-\let \normalfirstmarks = \firstmarks
-\let \normalfontchardp = \fontchardp
-\let \normalfontcharht = \fontcharht
-\let \normalfontcharic = \fontcharic
-\let \normalfontcharwd = \fontcharwd
-\let \normalglueexpr = \glueexpr
-\let \normalglueshrink = \glueshrink
-\let \normalglueshrinkorder = \glueshrinkorder
-\let \normalgluestretch = \gluestretch
-\let \normalgluestretchorder = \gluestretchorder
-\let \normalgluetomu = \gluetomu
-\let \normalifcsname = \ifcsname
-\let \normalifdefined = \ifdefined
-\let \normaliffontchar = \iffontchar
-\let \normalinteractionmode = \interactionmode
-\let \normalinterlinepenalties = \interlinepenalties
-\let \normallastlinefit = \lastlinefit
-\let \normallastnodetype = \lastnodetype
-\let \normalmarks = \marks
-\let \normalmuexpr = \muexpr
-\let \normalmutoglue = \mutoglue
-\let \normalnumexpr = \numexpr
-\let \normalpagediscards = \pagediscards
-\let \normalparshapedimen = \parshapedimen
-\let \normalparshapeindent = \parshapeindent
-\let \normalparshapelength = \parshapelength
-\let \normalpredisplaydirection = \predisplaydirection
-\let \normalprotected = \protected
-\let \normalreadline = \readline
-\let \normalsavinghyphcodes = \savinghyphcodes
-\let \normalsavingvdiscards = \savingvdiscards
-\let \normalscantokens = \scantokens
-\let \normalshowgroups = \showgroups
-\let \normalshowifs = \showifs
-\let \normalshowtokens = \showtokens
-\let \normalsplitbotmarks = \splitbotmarks
-\let \normalsplitdiscards = \splitdiscards
-\let \normalsplitfirstmarks = \splitfirstmarks
-\let \normaltopmarks = \topmarks
-\let \normaltracingassigns = \tracingassigns
-\let \normaltracinggroups = \tracinggroups
-\let \normaltracingifs = \tracingifs
-\let \normaltracingnesting = \tracingnesting
-\let \normaltracingscantokens = \tracingscantokens
-\let \normalunexpanded = \unexpanded
-\let \normalunless = \unless
-\let \normalwidowpenalties = \widowpenalties
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/norm-ltx.mkii b/Master/texmf-dist/tex/context/base/mkii/norm-ltx.mkii
deleted file mode 100644
index 9a8f7ba576c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/norm-ltx.mkii
+++ /dev/null
@@ -1,177 +0,0 @@
-%D \module
-%D [ file=norm-ltx,
-%D version=2009.03.19,
-%D title=\CONTEXT\ Norm Macros,
-%D subtitle=\LUATEX,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 file will become obsolete!
-
-% luatex primitives (incomplete)
-
-\let \normalUdelcode = \Udelcode
-\let \normalUdelcodenum = \Udelcodenum
-\let \normalUdelimiter = \Udelimiter
-\let \normalUmathaccent = \Umathaccent
-\let \normalUmathaccents = \Umathaccents
-\let \normalUmathaxis = \Umathaxis
-\let \normalUmathbinbinspacing = \Umathbinbinspacing
-\let \normalUmathbinclosespacing = \Umathbinclosespacing
-\let \normalUmathbininnerspacing = \Umathbininnerspacing
-\let \normalUmathbinopenspacing = \Umathbinopenspacing
-\let \normalUmathbinopspacing = \Umathbinopspacing
-\let \normalUmathbinordspacing = \Umathbinordspacing
-\let \normalUmathbinpunctspacing = \Umathbinpunctspacing
-\let \normalUmathbinrelspacing = \Umathbinrelspacing
-\let \normalUmathbotaccent = \Umathbotaccent
-\let \normalUmathchar = \Umathchar
-\let \normalUmathchardef = \Umathchardef
-\let \normalUmathcharnum = \Umathcharnum
-\let \normalUmathclosebinspacing = \Umathclosebinspacing
-\let \normalUmathcloseclosespacing = \Umathcloseclosespacing
-\let \normalUmathcloseinnerspacing = \Umathcloseinnerspacing
-\let \normalUmathcloseopenspacing = \Umathcloseopenspacing
-\let \normalUmathcloseopspacing = \Umathcloseopspacing
-\let \normalUmathcloseordspacing = \Umathcloseordspacing
-\let \normalUmathclosepunctspacing = \Umathclosepunctspacing
-\let \normalUmathcloserelspacing = \Umathcloserelspacing
-\let \normalUmathcode = \Umathcode
-\let \normalUmathcodenum = \Umathcodenum
-\let \normalUmathconnectoroverlapmin = \Umathconnectoroverlapmin
-\let \normalUmathfractiondelsize = \Umathfractiondelsize
-\let \normalUmathfractiondenomdown = \Umathfractiondenomdown
-\let \normalUmathfractiondenomvgap = \Umathfractiondenomvgap
-\let \normalUmathfractionnumup = \Umathfractionnumup
-\let \normalUmathfractionnumvgap = \Umathfractionnumvgap
-\let \normalUmathfractionrule = \Umathfractionrule
-\let \normalUmathinnerbinspacing = \Umathinnerbinspacing
-\let \normalUmathinnerclosespacing = \Umathinnerclosespacing
-\let \normalUmathinnerinnerspacing = \Umathinnerinnerspacing
-\let \normalUmathinneropenspacing = \Umathinneropenspacing
-\let \normalUmathinneropspacing = \Umathinneropspacing
-\let \normalUmathinnerordspacing = \Umathinnerordspacing
-\let \normalUmathinnerpunctspacing = \Umathinnerpunctspacing
-\let \normalUmathinnerrelspacing = \Umathinnerrelspacing
-\let \normalUmathlimitabovebgap = \Umathlimitabovebgap
-\let \normalUmathlimitabovekern = \Umathlimitabovekern
-\let \normalUmathlimitabovevgap = \Umathlimitabovevgap
-\let \normalUmathlimitdownbgap = \Umathlimitdownbgap
-\let \normalUmathlimitdownkern = \Umathlimitdownkern
-\let \normalUmathlimitdownvgap = \Umathlimitdownvgap
-\let \normalUmathopbinspacing = \Umathopbinspacing
-\let \normalUmathopclosespacing = \Umathopclosespacing
-\let \normalUmathopenbinspacing = \Umathopenbinspacing
-\let \normalUmathopenclosespacing = \Umathopenclosespacing
-\let \normalUmathopeninnerspacing = \Umathopeninnerspacing
-\let \normalUmathopenopenspacing = \Umathopenopenspacing
-\let \normalUmathopenopspacing = \Umathopenopspacing
-\let \normalUmathopenordspacing = \Umathopenordspacing
-\let \normalUmathopenpunctspacing = \Umathopenpunctspacing
-\let \normalUmathopenrelspacing = \Umathopenrelspacing
-\let \normalUmathoperatorsize = \Umathoperatorsize
-\let \normalUmathopinnerspacing = \Umathopinnerspacing
-\let \normalUmathopopenspacing = \Umathopopenspacing
-\let \normalUmathopopspacing = \Umathopopspacing
-\let \normalUmathopordspacing = \Umathopordspacing
-\let \normalUmathoppunctspacing = \Umathoppunctspacing
-\let \normalUmathoprelspacing = \Umathoprelspacing
-\let \normalUmathordbinspacing = \Umathordbinspacing
-\let \normalUmathordclosespacing = \Umathordclosespacing
-\let \normalUmathordinnerspacing = \Umathordinnerspacing
-\let \normalUmathordopenspacing = \Umathordopenspacing
-\let \normalUmathordopspacing = \Umathordopspacing
-\let \normalUmathordordspacing = \Umathordordspacing
-\let \normalUmathordpunctspacing = \Umathordpunctspacing
-\let \normalUmathordrelspacing = \Umathordrelspacing
-\let \normalUmathoverbarkern = \Umathoverbarkern
-\let \normalUmathoverbarrule = \Umathoverbarrule
-\let \normalUmathoverbarvgap = \Umathoverbarvgap
-\let \normalUmathoverdelimiterbgap = \Umathoverdelimiterbgap
-\let \normalUmathoverdelimitervgap = \Umathoverdelimitervgap
-\let \normalUmathpunctbinspacing = \Umathpunctbinspacing
-\let \normalUmathpunctclosespacing = \Umathpunctclosespacing
-\let \normalUmathpunctinnerspacing = \Umathpunctinnerspacing
-\let \normalUmathpunctopenspacing = \Umathpunctopenspacing
-\let \normalUmathpunctopspacing = \Umathpunctopspacing
-\let \normalUmathpunctordspacing = \Umathpunctordspacing
-\let \normalUmathpunctpunctspacing = \Umathpunctpunctspacing
-\let \normalUmathpunctrelspacing = \Umathpunctrelspacing
-\let \normalUmathquad = \Umathquad
-\let \normalUmathradicaldegreeafter = \Umathradicaldegreeafter
-\let \normalUmathradicaldegreebefore = \Umathradicaldegreebefore
-\let \normalUmathradicaldegreeraise = \Umathradicaldegreeraise
-\let \normalUmathradicalkern = \Umathradicalkern
-\let \normalUmathradicalrule = \Umathradicalrule
-\let \normalUmathradicalvgap = \Umathradicalvgap
-\let \normalUmathrelbinspacing = \Umathrelbinspacing
-\let \normalUmathrelclosespacing = \Umathrelclosespacing
-\let \normalUmathrelinnerspacing = \Umathrelinnerspacing
-\let \normalUmathrelopenspacing = \Umathrelopenspacing
-\let \normalUmathrelopspacing = \Umathrelopspacing
-\let \normalUmathrelordspacing = \Umathrelordspacing
-\let \normalUmathrelpunctspacing = \Umathrelpunctspacing
-\let \normalUmathrelrelspacing = \Umathrelrelspacing
-\let \normalUmathspaceafterscript = \Umathspaceafterscript
-\let \normalUmathstackdenomdown = \Umathstackdenomdown
-\let \normalUmathstacknumup = \Umathstacknumup
-\let \normalUmathstackvgap = \Umathstackvgap
-\let \normalUmathsubshiftdown = \Umathsubshiftdown
-\let \normalUmathsubshiftdrop = \Umathsubshiftdrop
-\let \normalUmathsubsupshiftdown = \Umathsubsupshiftdown
-\let \normalUmathsubsupvgap = \Umathsubsupvgap
-\let \normalUmathsubtopmax = \Umathsubtopmax
-\let \normalUmathsupbottommin = \Umathsupbottommin
-\let \normalUmathsupshiftdrop = \Umathsupshiftdrop
-\let \normalUmathsupshiftup = \Umathsupshiftup
-\let \normalUmathsupsubbottommax = \Umathsupsubbottommax
-\let \normalUmathunderbarkern = \Umathunderbarkern
-\let \normalUmathunderbarrule = \Umathunderbarrule
-\let \normalUmathunderbarvgap = \Umathunderbarvgap
-\let \normalUmathunderdelimiterbgap = \Umathunderdelimiterbgap
-\let \normalUmathunderdelimitervgap = \Umathunderdelimitervgap
-\let \normalUoverdelimiter = \Uoverdelimiter
-\let \normalUradical = \Uradical
-\let \normalUroot = \Uroot
-\let \normalUunderdelimiter = \Uunderdelimiter
-\let \normalattribute = \attribute
-\let \normalattributedef = \attributedef
-\let \normalcatcodetable = \catcodetable
-\let \normalclearmarks = \clearmarks
-\let \normalcrampeddisplaystyle = \crampeddisplaystyle
-\let \normalcrampedscriptscriptstyle = \crampedscriptscriptstyle
-\let \normalcrampedscriptstyle = \crampedscriptstyle
-\let \normalcrampedtextstyle = \crampedtextstyle
-\let \normalformatname = \formatname
-\let \normalifabsdim = \ifabsdim
-\let \normalifabsnum = \ifabsnum
-\let \normalifprimitive = \ifprimitive
-\let \normalinitcatcodetable = \initcatcodetable
-\let \normallatelua = \latelua
-\let \normalluaescapestring = \luaescapestring
-\let \normalluastartup = \luastartup
-%let \normalluatexdatestamp = \luatexdatestamp
-\let \normalluatexrevision = \luatexrevision
-\let \normalluatexversion = \luatexversion
-\let \normalnokerns = \nokerns
-\let \normalnoligs = \noligs
-\let \normalpageleftoffset = \pageleftoffset
-\let \normalpagetopoffset = \pagetopoffset
-\let \normalpostexhyphenchar = \postexhyphenchar
-\let \normalposthyphenchar = \posthyphenchar
-\let \normalpreexhyphenchar = \preexhyphenchar
-\let \normalprehyphenchar = \prehyphenchar
-\let \normalprimitive = \primitive
-\let \normalsavecatcodetable = \savecatcodetable
-\let \normalscantextokens = \scantextokens
-\let \normalsuppressfontnotfounderror = \suppressfontnotfounderror
-\let \normalsuppressifcsnameerror = \suppressifcsnameerror
-\let \normalsuppresslongerror = \suppresslongerror
-\let \normalsynctex = \synctex
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/norm-ptx.mkii b/Master/texmf-dist/tex/context/base/mkii/norm-ptx.mkii
deleted file mode 100644
index 14a57aeec1b..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/norm-ptx.mkii
+++ /dev/null
@@ -1,132 +0,0 @@
-%D \module
-%D [ file=norm-ptx,
-%D version=2009.03.19,
-%D title=\CONTEXT\ Norm Macros,
-%D subtitle=\PDFTEX,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Eventually most of these will be disabled in \MKIV.
-
-\let \normalefcode = \efcode
-\let \normalexpanded = \expanded
-\let \normalifincsname = \ifincsname
-\let \normalifpdfabsdim = \ifpdfabsdim
-\let \normalifpdfabsnum = \ifpdfabsnum
-\let \normalifpdfprimitive = \ifpdfprimitive
-\let \normalleftmarginkern = \leftmarginkern
-\let \normalletterspacefont = \letterspacefont
-\let \normallpcode = \lpcode
-\let \normalpdfadjustspacing = \pdfadjustspacing
-\let \normalpdfannot = \pdfannot
-\let \normalpdfcatalog = \pdfcatalog
-\let \normalpdfcolorstack = \pdfcolorstack
-\let \normalpdfcolorstackinit = \pdfcolorstackinit
-\let \normalpdfcompresslevel = \pdfcompresslevel
-\let \normalpdfcopyfont = \pdfcopyfont
-\let \normalpdfcreationdate = \pdfcreationdate
-\let \normalpdfdecimaldigits = \pdfdecimaldigits
-\let \normalpdfdest = \pdfdest
-\let \normalpdfdestmargin = \pdfdestmargin
-\let \normalpdfdraftmode = \pdfdraftmode
-\let \normalpdfeachlinedepth = \pdfeachlinedepth
-\let \normalpdfeachlineheight = \pdfeachlineheight
-\let \normalpdfendlink = \pdfendlink
-\let \normalpdfendthread = \pdfendthread
-\let \normalpdffirstlineheight = \pdffirstlineheight
-\let \normalpdffontattr = \pdffontattr
-\let \normalpdffontexpand = \pdffontexpand
-\let \normalpdffontname = \pdffontname
-\let \normalpdffontobjnum = \pdffontobjnum
-\let \normalpdffontsize = \pdffontsize
-\let \normalpdfforcepagebox = \pdfforcepagebox % obsolete
-\let \normalpdfgamma = \pdfgamma
-\let \normalpdfgentounicode = \pdfgentounicode
-\let \normalpdfglyphtounicode = \pdfglyphtounicode
-\let \normalpdfhorigin = \pdfhorigin
-\let \normalpdfignoreddimen = \pdfignoreddimen
-\let \normalpdfimageapplygamma = \pdfimageapplygamma
-\let \normalpdfimagegamma = \pdfimagegamma
-\let \normalpdfimagehicolor = \pdfimagehicolor
-\let \normalpdfimageresolution = \pdfimageresolution
-\let \normalpdfincludechars = \pdfincludechars
-\let \normalpdfinclusioncopyfonts = \pdfinclusioncopyfonts
-\let \normalpdfinclusionerrorlevel = \pdfinclusionerrorlevel
-\let \normalpdfinfo = \pdfinfo
-\let \normalpdfinsertht = \pdfinsertht
-\let \normalpdflastannot = \pdflastannot
-\let \normalpdflastlinedepth = \pdflastlinedepth
-\let \normalpdflastlink = \pdflastlink
-\let \normalpdflastobj = \pdflastobj
-\let \normalpdflastxform = \pdflastxform
-\let \normalpdflastximage = \pdflastximage
-\let \normalpdflastximagecolordepth = \pdflastximagecolordepth
-\let \normalpdflastximagepages = \pdflastximagepages
-\let \normalpdflastxpos = \pdflastxpos
-\let \normalpdflastypos = \pdflastypos
-\let \normalpdflinkmargin = \pdflinkmargin
-\let \normalpdfliteral = \pdfliteral
-\let \normalpdfmapfile = \pdfmapfile
-\let \normalpdfmapline = \pdfmapline
-\let \normalpdfminorversion = \pdfminorversion
-\let \normalpdfmovechars = \pdfmovechars % obsolete
-\let \normalpdfnames = \pdfnames
-\let \normalpdfnoligatures = \pdfnoligatures
-\let \normalpdfnormaldeviate = \pdfnormaldeviate
-\let \normalpdfobj = \pdfobj
-\let \normalpdfobjcompresslevel = \pdfobjcompresslevel
-\let \normalpdfoptionalwaysusepdfpagebox = \pdfoptionalwaysusepdfpagebox % obsolete
-\let \normalpdfoptionpdfinclusionerrorlevel = \pdfoptionpdfinclusionerrorlevel % obsolete
-\let \normalpdfoptionpdfminorversion = \pdfoptionpdfminorversion
-\let \normalpdfoutline = \pdfoutline
-\let \normalpdfoutput = \pdfoutput
-\let \normalpdfpageattr = \pdfpageattr
-\let \normalpdfpagebox = \pdfpagebox
-\let \normalpdfpageheight = \pdfpageheight
-\let \normalpdfpageref = \pdfpageref
-\let \normalpdfpageresources = \pdfpageresources
-\let \normalpdfpagesattr = \pdfpagesattr
-\let \normalpdfpagewidth = \pdfpagewidth
-\let \normalpdfpkmode = \pdfpkmode
-\let \normalpdfpkresolution = \pdfpkresolution
-\let \normalpdfprimitive = \pdfprimitive
-\let \normalpdfprotrudechars = \pdfprotrudechars
-\let \normalpdfpxdimen = \pdfpxdimen
-\let \normalpdfrandomseed = \pdfrandomseed
-\let \normalpdfrefobj = \pdfrefobj
-\let \normalpdfrefxform = \pdfrefxform
-\let \normalpdfrefximage = \pdfrefximage
-\let \normalpdfreplacefont = \pdfreplacefont
-\let \normalpdfrestore = \pdfrestore
-\let \normalpdfretval = \pdfretval
-\let \normalpdfsave = \pdfsave
-\let \normalpdfsavepos = \pdfsavepos
-\let \normalpdfsetmatrix = \pdfsetmatrix
-\let \normalpdfsetrandomseed = \pdfsetrandomseed
-\let \normalpdfstartlink = \pdfstartlink
-\let \normalpdfstartthread = \pdfstartthread
-\let \normalpdftexbanner = \pdftexbanner
-\let \normalpdftexrevision = \pdftexrevision
-\let \normalpdftexversion = \pdftexversion
-\let \normalpdfthread = \pdfthread
-\let \normalpdfthreadmargin = \pdfthreadmargin
-\let \normalpdftracingfonts = \pdftracingfonts
-\let \normalpdftrailer = \pdftrailer
-\let \normalpdfuniformdeviate = \pdfuniformdeviate
-\let \normalpdfuniqueresname = \pdfuniqueresname
-\let \normalpdfvorigin = \pdfvorigin
-\let \normalpdfxform = \pdfxform
-\let \normalpdfxformname = \pdfxformname
-\let \normalpdfximage = \pdfximage
-\let \normalpdfximagebbox = \pdfximagebbox
-\let \normalquitvmode = \quitvmode
-\let \normalrightmarginkern = \rightmarginkern
-\let \normalrpcode = \rpcode
-\let \normaltagcode = \tagcode
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/norm-tex.mkii b/Master/texmf-dist/tex/context/base/mkii/norm-tex.mkii
deleted file mode 100644
index 0bd54f71a99..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/norm-tex.mkii
+++ /dev/null
@@ -1,351 +0,0 @@
-%D \module
-%D [ file=norm-etx,
-%D version=2009.03.19,
-%D title=\CONTEXT\ Norm Macros,
-%D subtitle=\TEX,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Since \LUATEX\ can generate these lists internally it started
-%D to make sense to cleanup this \type {\normalstuff} for \MKII\ as
-%D well. The tables are generated with a \LUA\ script.
-
-% tex primitives
-
-% Beware, we already redefined \dump, \outer and \everyjob !
-
-% \normal = \
-% \normal- = \-
-% \normal/ = \/
-\let \normalabove = \above
-\let \normalabovedisplayshortskip = \abovedisplayshortskip
-\let \normalabovedisplayskip = \abovedisplayskip
-\let \normalabovewithdelims = \abovewithdelims
-\let \normalaccent = \accent
-\let \normaladjdemerits = \adjdemerits
-\let \normaladvance = \advance
-\let \normalafterassignment = \afterassignment
-\let \normalaftergroup = \aftergroup
-\let \normalatop = \atop
-\let \normalatopwithdelims = \atopwithdelims
-\let \normalbadness = \badness
-\let \normalbaselineskip = \baselineskip
-\let \normalbatchmode = \batchmode
-\let \normalbegingroup = \begingroup
-\let \normalbelowdisplayshortskip = \belowdisplayshortskip
-\let \normalbelowdisplayskip = \belowdisplayskip
-\let \normalbinoppenalty = \binoppenalty
-\let \normalbotmark = \botmark
-\let \normalbox = \box
-\let \normalboxmaxdepth = \boxmaxdepth
-\let \normalbrokenpenalty = \brokenpenalty
-\let \normalcatcode = \catcode
-\let \normalchar = \char
-\let \normalchardef = \chardef
-\let \normalcleaders = \cleaders
-\let \normalclosein = \closein
-\let \normalcloseout = \closeout
-\let \normalclubpenalty = \clubpenalty
-\let \normalcopy = \copy
-\let \normalcount = \count
-\let \normalcountdef = \countdef
-\let \normalcr = \cr
-\let \normalcrcr = \crcr
-\let \normalcsname = \csname
-\let \normalday = \day
-\let \normaldeadcycles = \deadcycles
-\let \normaldef = \def
-\let \normaldefaulthyphenchar = \defaulthyphenchar
-\let \normaldefaultskewchar = \defaultskewchar
-\let \normaldelcode = \delcode
-\let \normaldelimiter = \delimiter
-\let \normaldelimiterfactor = \delimiterfactor
-\let \normaldelimitershortfall = \delimitershortfall
-\let \normaldimen = \dimen
-\let \normaldimendef = \dimendef
-\let \normaldirectlua = \directlua
-\let \normaldiscretionary = \discretionary
-\let \normaldisplayindent = \displayindent
-\let \normaldisplaylimits = \displaylimits
-\let \normaldisplaystyle = \displaystyle
-\let \normaldisplaywidowpenalty = \displaywidowpenalty
-\let \normaldisplaywidth = \displaywidth
-\let \normaldivide = \divide
-\let \normaldoublehyphendemerits = \doublehyphendemerits
-\let \normaldp = \dp
-% \normaldump = \dump
-\let \normaledef = \edef
-\let \normalelse = \else
-\let \normalemergencystretch = \emergencystretch
-\let \normalend = \end
-\let \normalendcsname = \endcsname
-\let \normalendgroup = \endgroup
-\let \normalendinput = \endinput
-\let \normalendlinechar = \endlinechar
-\let \normaleqno = \eqno
-\let \normalerrhelp = \errhelp
-\let \normalerrmessage = \errmessage
-\let \normalerrorcontextlines = \errorcontextlines
-\let \normalerrorstopmode = \errorstopmode
-\let \normalescapechar = \escapechar
-\let \normaleverycr = \everycr
-\let \normaleverydisplay = \everydisplay
-\let \normaleveryhbox = \everyhbox
-% \normaleveryjob = \everyjob
-\let \normaleverymath = \everymath
-\let \normaleverypar = \everypar
-\let \normaleveryvbox = \everyvbox
-\let \normalexhyphenchar = \exhyphenchar
-\let \normalexhyphenpenalty = \exhyphenpenalty
-\let \normalexpandafter = \expandafter
-\let \normalfam = \fam
-\let \normalfi = \fi
-\let \normalfinalhyphendemerits = \finalhyphendemerits
-\let \normalfirstmark = \firstmark
-\let \normalfloatingpenalty = \floatingpenalty
-\let \normalfont = \font
-\let \normalfontdimen = \fontdimen
-\let \normalfontname = \fontname
-\let \normalfuturelet = \futurelet
-\let \normalgdef = \gdef
-\let \normalglobal = \global
-\let \normalglobaldefs = \globaldefs
-\let \normalhalign = \halign
-\let \normalhangafter = \hangafter
-\let \normalhangindent = \hangindent
-\let \normalhbadness = \hbadness
-\let \normalhbox = \hbox
-\let \normalhfil = \hfil
-\let \normalhfill = \hfill
-\let \normalhfilneg = \hfilneg
-\let \normalhfuzz = \hfuzz
-\let \normalhoffset = \hoffset
-\let \normalholdinginserts = \holdinginserts
-\let \normalhrule = \hrule
-\let \normalhsize = \hsize
-\let \normalhskip = \hskip
-\let \normalhss = \hss
-\let \normalht = \ht
-\let \normalhyphenation = \hyphenation
-\let \normalhyphenchar = \hyphenchar
-\let \normalhyphenpenalty = \hyphenpenalty
-\let \normalif = \if
-\let \normalifcase = \ifcase
-\let \normalifcat = \ifcat
-\let \normalifdim = \ifdim
-\let \normalifeof = \ifeof
-\let \normaliffalse = \iffalse
-\let \normalifhbox = \ifhbox
-\let \normalifhmode = \ifhmode
-\let \normalifinner = \ifinner
-\let \normalifmmode = \ifmmode
-\let \normalifnum = \ifnum
-\let \normalifodd = \ifodd
-\let \normaliftrue = \iftrue
-\let \normalifvbox = \ifvbox
-\let \normalifvmode = \ifvmode
-\let \normalifvoid = \ifvoid
-\let \normalifx = \ifx
-\let \normalignorespaces = \ignorespaces
-\let \normalimmediate = \immediate
-\let \normalindent = \indent
-% \normalinput = \input
-\let \normalinputlineno = \inputlineno
-\let \normalinsert = \insert
-\let \normalinsertpenalties = \insertpenalties
-\let \normalinterlinepenalty = \interlinepenalty
-\let \normaljobname = \jobname
-\let \normalkern = \kern
-\let \normallanguage = \language
-\let \normallastbox = \lastbox
-\let \normallastkern = \lastkern
-\let \normallastpenalty = \lastpenalty
-\let \normallastskip = \lastskip
-\let \normallccode = \lccode
-\let \normalleaders = \leaders
-\let \normalleft = \left
-\let \normallefthyphenmin = \lefthyphenmin
-\let \normalleftskip = \leftskip
-\let \normalleqno = \leqno
-\let \normallet = \let
-\let \normallimits = \limits
-\let \normallinepenalty = \linepenalty
-\let \normallineskip = \lineskip
-\let \normallineskiplimit = \lineskiplimit
-\let \normallong = \long
-\let \normallooseness = \looseness
-\let \normallower = \lower
-\let \normallowercase = \lowercase
-\let \normalmag = \mag
-\let \normalmark = \mark
-\let \normalmathaccent = \mathaccent
-\let \normalmathbin = \mathbin
-\let \normalmathchar = \mathchar
-\let \normalmathchardef = \mathchardef
-\let \normalmathchoice = \mathchoice
-\let \normalmathclose = \mathclose
-\let \normalmathcode = \mathcode
-\let \normalmathinner = \mathinner
-\let \normalmathop = \mathop
-\let \normalmathopen = \mathopen
-\let \normalmathord = \mathord
-\let \normalmathpunct = \mathpunct
-\let \normalmathrel = \mathrel
-\let \normalmathsurround = \mathsurround
-\let \normalmaxdeadcycles = \maxdeadcycles
-\let \normalmaxdepth = \maxdepth
-\let \normalmeaning = \meaning
-\let \normalmedmuskip = \medmuskip
-\let \normalmessage = \message
-\let \normalmiddle = \middle
-\let \normalmkern = \mkern
-\let \normalmonth = \month
-\let \normalmoveleft = \moveleft
-\let \normalmoveright = \moveright
-\let \normalmskip = \mskip
-\let \normalmultiply = \multiply
-\let \normalmuskip = \muskip
-\let \normalmuskipdef = \muskipdef
-\let \normalnewlinechar = \newlinechar
-\let \normalnoalign = \noalign
-\let \normalnoboundary = \noboundary
-\let \normalnoexpand = \noexpand
-\let \normalnoindent = \noindent
-\let \normalnolimits = \nolimits
-\let \normalnonscript = \nonscript
-\let \normalnonstopmode = \nonstopmode
-\let \normalnulldelimiterspace = \nulldelimiterspace
-\let \normalnullfont = \nullfont
-\let \normalnumber = \number
-\let \normalomit = \omit
-\let \normalopenin = \openin
-\let \normalopenout = \openout
-\let \normalor = \or
-% \normalouter = \outer
-\let \normaloutput = \output
-\let \normaloutputpenalty = \outputpenalty
-\let \normalover = \over
-\let \normaloverfullrule = \overfullrule
-\let \normaloverline = \overline
-\let \normaloverwithdelims = \overwithdelims
-\let \normalpagedepth = \pagedepth
-\let \normalpagefilllstretch = \pagefilllstretch
-\let \normalpagefillstretch = \pagefillstretch
-\let \normalpagefilstretch = \pagefilstretch
-\let \normalpagegoal = \pagegoal
-\let \normalpageshrink = \pageshrink
-\let \normalpagestretch = \pagestretch
-\let \normalpagetotal = \pagetotal
-\let \normalpar = \par
-\let \normalparfillskip = \parfillskip
-\let \normalparindent = \parindent
-\let \normalparshape = \parshape
-\let \normalparskip = \parskip
-\let \normalpatterns = \patterns
-\let \normalpausing = \pausing
-\let \normalpenalty = \penalty
-\let \normalpostdisplaypenalty = \postdisplaypenalty
-\let \normalpredisplaypenalty = \predisplaypenalty
-\let \normalpredisplaysize = \predisplaysize
-\let \normalpretolerance = \pretolerance
-\let \normalprevdepth = \prevdepth
-\let \normalprevgraf = \prevgraf
-\let \normalradical = \radical
-\let \normalraise = \raise
-\let \normalread = \read
-\let \normalrelax = \relax
-\let \normalrelpenalty = \relpenalty
-\let \normalright = \right
-\let \normalrighthyphenmin = \righthyphenmin
-\let \normalrightskip = \rightskip
-\let \normalromannumeral = \romannumeral
-\let \normalscriptfont = \scriptfont
-\let \normalscriptscriptfont = \scriptscriptfont
-\let \normalscriptscriptstyle = \scriptscriptstyle
-\let \normalscriptspace = \scriptspace
-\let \normalscriptstyle = \scriptstyle
-\let \normalscrollmode = \scrollmode
-\let \normalsetbox = \setbox
-\let \normalsetlanguage = \setlanguage
-\let \normalsfcode = \sfcode
-\let \normalshipout = \shipout
-\let \normalshow = \show
-\let \normalshowbox = \showbox
-\let \normalshowboxbreadth = \showboxbreadth
-\let \normalshowboxdepth = \showboxdepth
-\let \normalshowlists = \showlists
-\let \normalshowthe = \showthe
-\let \normalskewchar = \skewchar
-\let \normalskip = \skip
-\let \normalskipdef = \skipdef
-\let \normalspacefactor = \spacefactor
-\let \normalspaceskip = \spaceskip
-\let \normalspan = \span
-\let \normalspecial = \special
-\let \normalsplitbotmark = \splitbotmark
-\let \normalsplitfirstmark = \splitfirstmark
-\let \normalsplitmaxdepth = \splitmaxdepth
-\let \normalsplittopskip = \splittopskip
-\let \normalstring = \string
-\let \normaltabskip = \tabskip
-\let \normaltextfont = \textfont
-\let \normaltextstyle = \textstyle
-\let \normalthe = \the
-\let \normalthickmuskip = \thickmuskip
-\let \normalthinmuskip = \thinmuskip
-\let \normaltime = \time
-\let \normaltoks = \toks
-\let \normaltoksdef = \toksdef
-\let \normaltolerance = \tolerance
-\let \normaltopmark = \topmark
-\let \normaltopskip = \topskip
-\let \normaltracingcommands = \tracingcommands
-\let \normaltracinglostchars = \tracinglostchars
-\let \normaltracingmacros = \tracingmacros
-\let \normaltracingonline = \tracingonline
-\let \normaltracingoutput = \tracingoutput
-\let \normaltracingpages = \tracingpages
-\let \normaltracingparagraphs = \tracingparagraphs
-\let \normaltracingrestores = \tracingrestores
-\let \normaltracingstats = \tracingstats
-\let \normaluccode = \uccode
-\let \normaluchyph = \uchyph
-\let \normalunderline = \underline
-\let \normalunhbox = \unhbox
-\let \normalunhcopy = \unhcopy
-\let \normalunkern = \unkern
-\let \normalunpenalty = \unpenalty
-\let \normalunskip = \unskip
-\let \normalunvbox = \unvbox
-\let \normalunvcopy = \unvcopy
-\let \normaluppercase = \uppercase
-\let \normalvadjust = \vadjust
-\let \normalvalign = \valign
-\let \normalvbadness = \vbadness
-\let \normalvbox = \vbox
-\let \normalvcenter = \vcenter
-\let \normalvfil = \vfil
-\let \normalvfill = \vfill
-\let \normalvfilneg = \vfilneg
-\let \normalvfuzz = \vfuzz
-\let \normalvoffset = \voffset
-\let \normalvrule = \vrule
-\let \normalvsize = \vsize
-\let \normalvskip = \vskip
-\let \normalvsplit = \vsplit
-\let \normalvss = \vss
-\let \normalvtop = \vtop
-\let \normalwd = \wd
-\let \normalwidowpenalty = \widowpenalty
-\let \normalwrite = \write
-\let \normalxdef = \xdef
-\let \normalxleaders = \xleaders
-\let \normalxspaceskip = \xspaceskip
-\let \normalyear = \year
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/norm-xtx.mkii b/Master/texmf-dist/tex/context/base/mkii/norm-xtx.mkii
deleted file mode 100644
index 851b90b310c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/norm-xtx.mkii
+++ /dev/null
@@ -1,18 +0,0 @@
-%D \module
-%D [ file=norm-xtx,
-%D version=2009.03.19,
-%D title=\CONTEXT\ Norm Macros,
-%D subtitle=\XETEX,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% xetex primitives
-
-% nothing yet (also defined pdftex primitives)
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/pack-box.mkii b/Master/texmf-dist/tex/context/base/mkii/pack-box.mkii
deleted file mode 100644
index 92845038530..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/pack-box.mkii
+++ /dev/null
@@ -1,956 +0,0 @@
-%D \module
-%D [ file=pack-box,
-%D version=2002.04.12,
-%D title=\CONTEXT\ Packaging Macros,
-%D subtitle=Boxes,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Packaging Macros / Boxes}
-
-%D This module contains all kind of macros for moving content
-%D around. Many macros here come from other modules, but
-%D depencies made it more clear to isolate them.
-
-% \placeornament
-
-\unprotect
-
-% \definelayer[\v!tekst-2][\c!positie=\v!ja]
-% \definelayer[\v!tekst-1][\c!positie=\v!ja]
-% \definelayer[\v!tekst+1][\c!positie=\v!ja]
-% \definelayer[\v!tekst+2][\c!positie=\v!ja]
-
-% we need to set the size, else we get dimensions depending
-% on the content, which in itself is ok, but can lead to loops
-% due to rounding errors (happened in demo-obv)
-
-\definelayer[\v!text-2][\c!position=\v!yes,\c!width=\overlaywidth,\c!height=\overlayheight]
-\definelayer[\v!text-1][\c!position=\v!yes,\c!width=\overlaywidth,\c!height=\overlayheight]
-\definelayer[\v!text+1][\c!position=\v!yes,\c!width=\overlaywidth,\c!height=\overlayheight]
-\definelayer[\v!text+2][\c!position=\v!yes,\c!width=\overlaywidth,\c!height=\overlayheight]
-
-\def\internaltextoverlay#1% will become more generic and installable
- {\startoverlay % i.e. probably an overlay by itself
- {\positionoverlay{\v!text#1}} % see later
- {\composedlayer {\v!text#1}}
- \stopoverlay}
-
-%\def\internaltextoverlay#1%
-% {\hbox to \zeropoint{\positionoverlay{\v!tekst#1}\hss}%
-% \composedlayer{\v!tekst#1}}
-
-% todo: share info, so that tuo will be smaller
-
-\defineoverlay[\v!text-2][\internaltextoverlay{-2}]
-\defineoverlay[\v!text-1][\internaltextoverlay{-1}]
-\defineoverlay[\v!text+1][\internaltextoverlay{+1}]
-\defineoverlay[\v!text+2][\internaltextoverlay{+2}]
-
-% to be documented
-
-\definelayer[anchor]
-
-\def\anchor
- {\dosingleargument\doanchor}
-
-\def\doanchor[#1]%
- {\ifundefined{\??an#1}\@EA\dodoanchor\else\@EA\nonoanchor\fi[#1]}
-
-\def\nonoanchor[#1]%
- {\getvalue{\??an#1}}
-
-\def\dodoanchor[#1]%
- {\dotripleempty\dododoanchor[#1]}
-
-\def\dododoanchor
- {\ifthirdargument
- \expandafter\dodoanchorT
- \else
- \expandafter\dodoanchorS
- \fi}
-
-\def\dodoanchorS[#1][#2][#3]%
- {\dodoanchorT[#1][#2][#2]}
-
-\def\dodoanchorT[#1][#2][#3]%
- {\dowithnextbox
- {\bgroup
- \checktextbackgrounds
- \setbox\scratchbox\null
- \wd\scratchbox\nextboxwd
- \ht\scratchbox\nextboxht
- \dp\scratchbox\nextboxdp
- \setlayer
- [anchor]
- [\c!width=\wd\scratchbox,
- \c!height=\ht\scratchbox,
- \c!offset=\!!zeropoint,
- #2,#3]
- {\setlayer[#1]{\flushnextbox}}%
- \framed
- [#2,
- \c!background=anchor,
- \c!offset=\v!overlay,
- \c!frame=\v!off,
- #3]
- {\box\scratchbox}%
- \egroup}%
- \vbox}
-
-\def\defineanchor
- {\doquadrupleempty\dodefineanchor}
-
-\def\dodefineanchor[#1][#2][#3][#4]%
- {\setvalue{\??an#1}{\dodefinedanchor[#2][#3][#4]}}
-
-\def\dodefinedanchor[#1][#2][#3]%
- {\def\docommand[##1][##2]%
- {\ifsecondargument
- \def\next{\dodoanchorT[#1][#2,##1][#3,##2]}%
- \else\iffirstargument
- \def\next{\dodoanchorT[#1][#2,##1][#2,##1]}%
- \else
- \def\next{\dodoanchorT[#1][#2][#3]}%
- \fi\fi
- \next}%
- \dodoubleempty\docommand}
-
-\def\@@collectorbox{@@collectorbox}
-
-\def\definecollector
- {\dodoubleargument\dodefinecollector}
-
-\def\dodefinecollector[#1][#2]%
- {\ifundefined{\@@collectorbox#1}%
- \expandafter\newbox\csname\@@collectorbox#1\endcsname
- \fi
- \resetcollector[#1]%
- \setupcollector
- [#1]
- [\c!state=\v!start,
- \c!x=\!!zeropoint,\c!y=\!!zeropoint,
- \c!offset=\!!zeropoint,\c!rotation=, % geen 0 !
- \c!hoffset=\!!zeropoint,\c!voffset=\!!zeropoint,
- \c!location=rb,\c!corner=,#2]}
-
-\def\setupcollector
- {\dodoubleargument\dosetupcollector}
-
-\def\dosetupcollector[#1][#2]%
- {\def\docommand##1{\getparameters[\??cb##1][#2]}%
- \processcommalist[#1]\docommand}
-
-\def\setcollector
- {\dodoubleargument\dosetcollector}
-
-\def\dosetcollector[#1][#2]%
- {\bgroup
- \forgetall
- \dontcomplain
- \dowithnextbox
- {\ifundefined{\@@collectorbox#1}%
- \writestatus{collector}{unknown layer #1}%
- \else
- \dodosetcollector[#1][#2]%
- \fi
- \egroup}
- \hbox}
-
-\def\collectorparameter#1{\csname\??cb\currentcollector#1\endcsname}
-
-\def\dodosetcollector[#1][#2]% todo: keep reference point
- {\def\currentcollector{#1}%
- \mathchardef\collectorbox\csname\@@collectorbox#1\endcsname
- \getparameters[\??cb#1][#2]%
- \@@layerxsiz\wd\collectorbox
- \@@layerysiz\ht\collectorbox
- \doifvaluesomething{\??cb#1\c!rotation}
- {\setbox\nextbox\hbox
- {\rotate
- [\c!location=\v!high,
- \c!rotation=\collectorparameter\c!rotation]
- {\flushnextbox}}}%
- \advance\@@layerysiz\dp\collectorbox
- \@@layerxpos\collectorparameter\c!x
- \advance\@@layerxpos\collectorparameter\c!hoffset
- \@@layerypos\collectorparameter\c!y
- \advance\@@layerypos\collectorparameter\c!voffset
- \doifelse\v!middle{\collectorparameter\c!corner}
- {\ifdim\@@layerxsiz>\zeropoint
- \advance\@@layerxpos.5\@@layerxsiz
- \fi
- \ifdim\@@layerysiz>\zeropoint
- \advance\@@layerypos.5\@@layerysiz
- \fi}%
- {\ExpandBothAfter\doifinset\v!bottom{\collectorparameter\c!corner}
- {\ifdim\@@layerysiz>\zeropoint
- \advance\@@layerypos-\@@layerysiz
- \@@layerypos-\@@layerypos
- \fi}%
- \ExpandBothAfter\doifinset\v!right{\collectorparameter\c!corner}
- {\ifdim\@@layerxsiz>\zeropoint
- \advance\@@layerxpos-\@@layerxsiz
- \@@layerxpos-\@@layerxpos
- \fi}}%
- \setbox\nextbox\hbox
- {\alignedbox[\collectorparameter\c!location]\vbox{\flushnextbox}}%
- \boxmaxdepth\zeropoint % really needed, nice example
- \global\advance\boxhdisplacement\@@layerxpos
- \ifdim\boxhdisplacement<\zeropoint
- \global\setbox\collectorbox\hbox
- {\hskip-\boxhdisplacement
- \box\collectorbox}%
- \fi
- \global\advance\boxvdisplacement\@@layerypos
- \ifdim\boxvdisplacement<\zeropoint
- \global\setbox\collectorbox\hbox
- {\lower-\boxvdisplacement
- \box\collectorbox}%
- \fi
- \@@layerxsiz\wd\collectorbox
- \@@layerysiz\ht\collectorbox
- \advance\@@layerysiz\dp\collectorbox
- \global\setbox\collectorbox\hbox
- {\box\collectorbox
- \hskip-\@@layerxsiz
- \hskip\@@layerxpos\relax
- \ifdim\boxhdisplacement<\zeropoint
- \hskip-\boxhdisplacement
- \fi
- \lower\@@layerypos\hbox
- {\ifdim\boxvdisplacement<\zeropoint
- \lower-\boxvdisplacement\flushnextbox
- \else
- \flushnextbox
- \fi}}%
- % combine height and depth into depth only (later flushed as height)
- \global\setbox\collectorbox\hbox
- {\lower\ht\collectorbox\box\collectorbox}%
- % just to be sure
- \ifdim\wd\collectorbox<\@@layerxsiz
- \wd\collectorbox\@@layerxsiz
- \fi}
-
-\def\flushcollector[#1]%
- {\ifundefined{\@@collectorbox#1}%
- \writestatus{collector}{unknown collector #1}%
- \else
- \doifnotvalue{\??cb#1\c!state}\v!stop
- {\vbox
- {\hbox
- {\doifelsevalue{\??cb#1\c!state}\v!repeat
- {\let\next\copy}{\let\next\box}%
- \raise\dp\csname\@@collectorbox#1\endcsname
- \next\csname\@@collectorbox#1\endcsname}}}%
- \fi}
-
-\def\composedcollector#1{\flushcollector[#1]}
-
-\def\resetcollector[#1]%
- {\ifundefined{\@@collectorbox#1}\else
- \global\setbox\csname\@@collectorbox#1\endcsname\emptybox
- \fi}
-
-\def\adaptcollector
- {\dodoubleargument\doadaptcollector}
-
-\def\doadaptcollector[#1][#2]% % a typical case where \global\wd looks better in the code
- {\bgroup
- \def\currentcollector{#1}%
- \mathchardef\collectorbox\csname\@@collectorbox#1\endcsname
- \getparameters
- [\??cb#1][\c!voffset=\zeropoint,\c!hoffset=\zeropoint,#2]%
- \scratchdimen\wd\collectorbox
- \advance\scratchdimen\collectorparameter\c!hoffset
- \global\wd\collectorbox\scratchdimen
- \scratchdimen\ht\collectorbox
- \advance\scratchdimen\collectorparameter\c!voffset
- \global\ht\collectorbox\scratchdimen
- \egroup}
-
-%\definecollector[test]
-%\setcollector[test]
-% [location=rb]
-% {\externalfigure[koe][frame=on,width=3cm]}
-%\setcollector[test]
-% [corner={right,bottom},location={left,top}]
-% {\framed{gans}}
-%\composedcollector{test}
-
-\definecollector
- [caption]
-
-\def\collectedtext
- {\dodoubleempty\docollectedtext}
-
-\def\docollectedtext[#1][#2]#3%
- {\bgroup
- \dowithnextbox
- {\setcollector
- [caption]
- {\flushnextbox}%
- \setcollector
- [caption][#1]
- {\getparameters[\??du][#2]%
- \dosetfontattribute\??du\c!style\setupinterlinespace
- \framed % watch the special setting of kader/overlay
- [\c!frame=\v!overlay,#2]
- {\doattributes\??du\c!style\c!color{#3}}}%
- \composedcollector{caption}%
- \egroup}%
- \hbox}
-
-% \collectedtext
-% [corner={right,bottom},location={left,top}]
-% [background=color,backgroundcolor=white,offset=0pt]
-% {gans}
-% {\externalfigure[koe][width=3cm]}
-%
-% \collectedtext
-% [rotation=90,corner={right,bottom},location={right,top}]
-% [frame=on,offset=0pt]
-% {gans}
-% {\externalfigure[koe][width=3cm]}
-%
-% \collectedtext
-% [rotation=90,corner={left,bottom},location={left,top}]
-% [frame=on,offset=0pt]
-% {gans}
-% {\externalfigure[koe][width=3cm]}
-
-\definelayer
- [caption]
-
-\def\layeredtext
- {\dodoubleempty\dolayeredtext}
-
-\def\dolayeredtext[#1][#2]#3%
- {\bgroup
- \dowithnextbox
- {\!!widtha \nextboxwd
- \!!heighta\nextboxht
- \bgroup % preserve \nextbox
- \setuplayer
- [caption]
- [\c!width=\!!widtha,\c!height=\!!heighta]%
- \setlayer
- [caption]
- [#1]
- {\getparameters[\??du][#2]%
- \dosetfontattribute\??du\c!style\setupinterlinespace
- \framed
- [\c!frame=\v!overlay,,#2]
- {\doattributes\??du\c!style\c!color{#3}}}%
- \egroup
- \framed
- [\c!offset=\v!overlay,
- \c!frame=\v!off,
- \c!background={\v!foreground,caption},
- \c!width=\!!widtha,
- \c!height=\!!heighta]
- {\flushnextbox}%
- \egroup}%
- \hbox}
-
-% \layeredtext
-% [corner={right,bottom},location={left,top}]
-% [background=color,backgroundcolor=white,offset=0pt]
-% {gans}
-% {\externalfigure[koe][width=3cm]}
-%
-% \layeredtext
-% [rotation=90,corner={right,bottom},location={right,top}]
-% [frame=on,offset=0pt]
-% {gans}
-% {\externalfigure[koe][width=3cm]}
-%
-% \layeredtext
-% [rotation=90,corner={left,bottom},location={left,top}]
-% [frame=on,offset=0pt]
-% {gans}
-% {\externalfigure[koe][width=3cm]}
-
-\def\ornamenttext
- {\dodoubleempty\doornamenttext}
-
-\def\doornamenttext[#1][#2]%
- {\bgroup
- \doifassignmentelse{#1}
- {\getparameters[\s!dummy][\c!alternative=\v!a,#1]%
- \doifelse\dummyalternative\v!a
- {\egroup\collectedtext}%
- {\egroup\layeredtext }%
- [#1][#2]}%
- {\egroup\getvalue{#1}}}
-
-\def\defineornament
- {\dotripleempty\dodefineornament}
-
-\def\dodefineornament[#1][#2][#3]%
- {\setvalue{#1}{\doornamenttext[#2][#3]}}
-
-% \defineornament
-% [affiliation]
-% [rotation=90,corner={right,bottom},location={right,top},
-% hoffset=-.25ex]
-% [frame=on,background=color,backgroundcolor=red,offset=0pt]
-%
-% \ruledhbox{\affiliation{gans}{\externalfigure[koe][width=3cm]}}
-%
-% \defineornament
-% [affiliation]
-% [rotation=90,corner={right,bottom},location={right,top},
-% hoffset=-.25ex,alternative=b]
-% [frame=on,background=color,backgroundcolor=red,offset=0pt]
-%
-% \ruledhbox{\affiliation{gans}{\externalfigure[koe][width=3cm]}}
-%
-% \defineornament
-% [affiliation]
-% [rotation=90,corner={right,bottom},location={left,top},
-% hoffset=.25ex,voffset=.25ex,alternative=a]
-% [background=color,style=\ss\tfxx,backgroundcolor=white,offset=0pt]
-%
-% \affiliation{photo}{\externalfigure[molen][width=3cm]}
-%
-% \defineornament
-% [affiliation]
-% [rotation=90,corner={right,bottom},location={left,top},
-% hoffset=.25ex,voffset=.25ex,alternative=b]
-% [background=color,style=\ss\tfxx,backgroundcolor=white,offset=0pt]
-%
-% \affiliation{drawing}{\externalfigure[hakker][width=3cm]}
-
-% pas op: aanpassen aan nieuwe layer hoek ankers en columnset
-
-\newcount\nofbleeds % per pag
-
-\def\setupbleeding
- {\dodoubleempty\getparameters[\??bg]}
-
-\setupbleeding
- [\c!location=l,
- \c!stretch=\v!yes,
- \c!width=3cm,
- \c!height=3cm,
- \c!offset=2mm,
- \c!page=\v!no,
- \c!voffset=\@@bgoffset,
- \c!hoffset=\@@bgoffset]
-
-\def\bleed
- {\dosingleempty\dobleed}
-
-\def\bleedwidth {\the\hsize}%
-\def\bleedheight{\the\vsize}%
-
-\def\dobleed[#1]#2%
- {\hbox\bgroup
- \xdef\bleedwidth {\the\hsize}%
- \xdef\bleedheight{\the\vsize}%
- \global\advance\nofbleeds\plusone
- \getparameters[\??bg][#1]%
- \!!doneafalse % left
- \!!donebfalse % right
- \!!donecfalse % top
- \!!donedfalse % bottom
- % replace this part ! todo: default location
- \processaction
- [\@@bglocation]
- [ t=>\!!donectrue\let\@@bghoffset\!!zeropoint,
- b=>\!!donedtrue\let\@@bghoffset\!!zeropoint,
- l=>\!!doneatrue\let\@@bgvoffset\!!zeropoint,
- r=>\!!donebtrue\let\@@bgvoffset\!!zeropoint,
- bl=>\!!doneatrue\!!donedtrue,
- lb=>\!!doneatrue\!!donedtrue,
- br=>\!!donebtrue\!!donedtrue,
- rb=>\!!donebtrue\!!donedtrue,
- tl=>\!!doneatrue\!!donectrue,
- lt=>\!!doneatrue\!!donectrue,
- tr=>\!!donebtrue\!!donectrue,
- rt=>\!!donebtrue\!!donectrue]%
- \doifelse\@@bgstretch\v!yes\donetrue\donefalse
- \scratchdimen\@@bgwidth
- \edef\currentbgposition {\??bg:\number\nofbleeds}%
- \edef\currentpageposition{page:0}% todo: per page
- \ifdone
- \if!!donea
- \advance\scratchdimen\dimexpr \MPx\currentbgposition-\MPx\currentpageposition\relax
- \else\if!!doneb
- \scratchdimen\dimexpr\paperwidth-\MPx\currentbgposition-\MPx\currentpageposition\relax % not checked
- \fi\fi
- \fi
- \advance\scratchdimen\@@bghoffset
- \xdef\bleedwidth{\the\scratchdimen}%
- \scratchdimen\@@bgheight
- \ifdone
- \if!!donec
- \scratchdimen\dimexpr\paperheight-\MPy\currentbgposition-\MPy\currentpageposition\relax % not checked
- \else\if!!doned
- \advance\scratchdimen\dimexpr \MPy\currentbgposition-\MPy\currentpageposition\relax % not checked
- \fi\fi
- \fi
- \advance\scratchdimen\@@bgvoffset
- \xdef\bleedheight{\the\scratchdimen}%
- \hsize\bleedwidth
- \vsize\bleedheight
- \setbox\scratchbox\hbox{#2}%
- \doif\@@bgpage\v!yes
- {\setbox\scratchbox\topskippedbox{\box\scratchbox}}%
- \setbox\scratchbox\hbox to \@@bgwidth
- {\if!!donea\hss\fi\box\scratchbox\if!!doneb\hss\fi}%
- \if!!doned
- \setbox\scratchbox\hbox
- {\lower\bleedheight\hbox{\raise\@@bgheight\box\scratchbox}}%
- \fi
- \wd\scratchbox\@@bgwidth
- \ht\scratchbox\@@bgheight
- \dp\scratchbox\zeropoint
- \ifdone
- \hpos\currentbgposition{\box\scratchbox}%
- \else
- \box\scratchbox
- \fi
- \egroup}
-
-\setupbleeding[\c!stretch=\v!yes]
-
-\defineexternalfigure[bleed][\c!width=\bleedwidth,\c!height=\bleedheight]
-
-% \placefigure[left]{none}
-% {\bleed[width=5cm,height=3cm,location=lt]{\externalfigure[koe][bleed]}}
-%
-% \input tufte
-%
-% \placefigure[left]{none}
-% {\bleed[width=5cm,height=3cm,location=l]{\externalfigure[koe][bleed]}}
-%
-% \input tufte
-%
-% \placefigure[right]{none}
-% {\bleed[width=5cm,height=3cm,location=r]{\externalfigure[koe][bleed]}}
-%
-% \input tufte
-%
-% \placesomefloat[right]{none}
-% {\bleed[width=5cm,height=3cm,location=rb]{\externalfigure[koe][bleed]}}
-%
-% \input tufte
-%
-% \placefigure
-% [top,none]
-% {} % no caption
-% {\bleed
-% [hoffset=-\backspace,
-% voffset=3mm,
-% width=0cm,
-% height=6\lineheight,
-% page=yes, % correct for topskip
-% location=lt]
-% {\externalfigure[koe][bleed][frame=on]}}
-
-% \setlayerframed[layer id][layer settings][framed setting]{data}
-% \setlayerframed[layer id][combined settings]{data}
-
-\def\setlayerframed
- {\dotripleempty\dosetlayerframed}
-
-\def\dosetlayerframed
- {\ifthirdargument
- \expandafter\dosetlayerframedT
- \else
- \expandafter\dosetlayerframedS
- \fi}
-
-\def\dosetlayerframedT[#1][#2][#3]%
- {\dowithnextbox{\setlayer[#1][#2]{\flushnextbox}}%
- \hbox\framed[#3]}
-
-% \def\dosetlayerframedS[#1][#2][#3]%
-% {\dowithnextbox
-% {\setlayer[#1][\c!width=\nextboxwd,\c!height=\nextboxht,\c!offset=\!!zeropoint,#2]{\flushnextbox}}%
-% \hbox\framed[\c!location=\v!normal,#2]}
-%
-% better (2011-09-06)
-
-\def\dosetlayerframedS[#1][#2][#3]%
- {\dowithnextbox
- {\setlayer[#1][\c!width=\nextboxwd,\c!height=\nextboxht,#2,\c!offset=\!!zeropoint]{\flushnextbox}}%
- \hbox\framed[\c!location=\v!normal,#2]}
-
-\def\setlayertext
- {\dotripleempty\dosetlayertext}
-
-\def\dosetlayertext[#1][#2][#3]%
- {\bgroup
- \getparameters
- [\??lx]
- [\c!align=,
- \c!width=\hsize,
- \c!color=,
- \c!style=,
- #3]%
- \dowithnextboxcontent
- {\forgetall
- \hsize\@@lxwidth
- \expanded{\setupalign[\@@lxalign]}%
- \dosetfontattribute\??lx\c!style}
- {\setlayer[#1][#2]{\strut\color[\@@lxcolor]{\flushnextbox}}%
- \egroup}%
- \vtop}
-
-% \setupbackgrounds
-% [page]
-% [background=pagefigures]
-%
-% \definelayer
-% [pagefigures]
-% [x=-2mm,
-% y=-2mm,
-% width=\paperwidth,
-% height=\paperheight]
-%
-% \definelayerpreset [lefttop] [corner={left,top},location={right,bottom}]
-% \definelayerpreset [righttop] [corner={right,top},location={left,bottom}]
-% \definelayerpreset [leftbottom] [corner={left,bottom},location={right,top}]
-% \definelayerpreset [rightbottom] [corner={right,bottom},location={left,top}]
-% \definelayerpreset [middle] [corner=middle,location=middle]
-%
-% \setlayer[pagefigures][preset=lefttop]
-% \setlayer[pagefigures][preset=righttop]
-% \setlayer[pagefigures][preset=leftbottom]
-% \setlayer[pagefigures][preset=rightbottom]
-
-\definelayerpreset
- [\v!left\v!top]
- [\c!corner={\v!left,\v!top},\c!location={\v!right,\v!bottom}]
-
-\definelayerpreset
- [\v!right\v!top]
- [\c!corner={\v!right,\v!top},\c!location={\v!left,\v!bottom}]
-
-\definelayerpreset
- [\v!left\v!bottom]
- [\c!corner={\v!left,\v!bottom},\c!location={\v!right,\v!top}]
-
-\definelayerpreset
- [\v!right\v!bottom]
- [\c!corner={\v!right,\v!bottom},\c!location={\v!left,\v!top}]
-
-\definelayerpreset
- [\v!middle]
- [\c!corner=\v!middle,\c!location=\v!middle]
-
-% \definelayerpreset
-% [\v!middle\v!top]
-% [\c!location=\v!bottom,\c!hoffset=.5\layerwidth]
-
-% \definelayerpreset
-% [\v!middle\v!bottom]
-% [\c!location=\v!top,\c!hoffset=.5\layerwidth,\c!voffset=\layerheight]
-
-% \definelayerpreset
-% [\v!middle\v!left]
-% [\c!location=\v!right,\c!voffset=.5\layerheight]
-
-% \definelayerpreset
-% [\v!middle\v!right]
-% [\c!location=\v!left,\c!hoffset=\layerwidth,\c!voffset=.5\layerheight]
-
-\definelayerpreset
- [\v!middle\v!top]
- [\c!location=\v!bottom,\c!corner=\v!top,\c!dx=.5\layerwidth]
-
-\definelayerpreset
- [\v!middle\v!bottom]
- [\c!location=\v!top,\c!corner=\v!bottom,\c!dx=.5\layerwidth]
-
-\definelayerpreset
- [\v!middle\v!left]
- [\c!location=\v!right,\c!corner=\v!left,\c!dy=.5\layerheight]
-
-\definelayerpreset
- [\v!middle\v!right]
- [\c!location=\v!left,\c!corner=\v!right,\c!dy=.5\layerheight]
-
-\def\alignedbox
- {\dodoubleempty\doalignedbox[]}
-
-% \def\doalignedbox[#1][#2]%
-% {\bgroup
-% %\let\iftraceboxplacement\iftracelayers % ugly
-% \dowithnextbox
-% {\let\next\middlebox
-% \processaction
-% [#2]
-% [ t=>\let\next\topbox , b=>\let\next\bottombox ,
-% l=>\let\next\leftbox , r=>\let\next\rightbox ,
-% bl=>\let\next\bottomleftbox,br=>\let\next\bottomrightbox,
-% tl=>\let\next\topleftbox ,tr=>\let\next\toprightbox ,
-% lt=>\let\next\lefttopbox ,lb=>\let\next\leftbottombox ,
-% rt=>\let\next\righttopbox ,rb=>\let\next\rightbottombox]%
-% \next{\flushnextbox}%
-% \egroup}#1}
-
-\def\doalignedbox[#1][#2]%
- {\bgroup
- %\let\iftraceboxplacement\iftracelayers % ugly
- \dowithnextbox
- {\serializecommalist[#2]%
- \executeifdefined{\??ab\??ab\serializedcommalist}\middlebox{\flushnextbox}%
- \egroup}#1}
-
-\setvalue{\??ab\??ab }{\middlebox}
-\setvalue{\??ab\??ab\v!middle }{\middlebox}
-\setvalue{\??ab\??ab\v!left }{\leftbox }
-\setvalue{\??ab\??ab\v!right }{\rightbox }
-\setvalue{\??ab\??ab\v!bottom }{\bottombox}
-\setvalue{\??ab\??ab\v!top }{\topbox }
-
-\setvalue{\??ab\??ab\v!middle\v!middle}{\middlebox}
-\setvalue{\??ab\??ab\v!left \v!top }{\lefttopbox}
-\setvalue{\??ab\??ab\v!left \v!bottom}{\leftbottombox}
-\setvalue{\??ab\??ab\v!right \v!top }{\righttopbox}
-\setvalue{\??ab\??ab\v!right \v!bottom}{\rightbottombox}
-\setvalue{\??ab\??ab\v!top \v!left }{\topleftbox}
-\setvalue{\??ab\??ab\v!bottom\v!left }{\bottomleftbox}
-\setvalue{\??ab\??ab\v!top \v!right }{\toprightbox}
-\setvalue{\??ab\??ab\v!bottom\v!right }{\bottomrightbox}
-
-\setvalue{\??ab\??ab c}{\middlebox}
-\setvalue{\??ab\??ab l}{\leftbox}
-\setvalue{\??ab\??ab r}{\rightbox}
-\setvalue{\??ab\??ab b}{\bottombox}
-\setvalue{\??ab\??ab t}{\topbox}
-
-\setvalue{\??ab\??ab lt}{\lefttopbox}
-\setvalue{\??ab\??ab lb}{\leftbottombox}
-\setvalue{\??ab\??ab rt}{\righttopbox}
-\setvalue{\??ab\??ab rb}{\rightbottombox}
-\setvalue{\??ab\??ab tl}{\topleftbox}
-\setvalue{\??ab\??ab bl}{\bottomleftbox}
-\setvalue{\??ab\??ab tr}{\toprightbox}
-\setvalue{\??ab\??ab br}{\bottomrightbox}
-
-\setvalue{\??ab\??ab m}{\middlebox}
-
-% The next ones were desparately needed by Vit Zyka (see
-% \type {supp-box} for definitions).
-
-\setvalue{\??ab\??ab g}{\baselinemiddlebox}
-\setvalue{\??ab\??ab gl}{\baselineleftbox}
-\setvalue{\??ab\??ab gc}{\baselinemiddlebox}
-\setvalue{\??ab\??ab gr}{\baselinerightbox}
-
-\setvalue{\??ab\??ab \v!line }{\baselinemiddlebox} % \v!grid is taken
-\setvalue{\??ab\??ab \v!line\v!left }{\baselineleftbox}
-\setvalue{\??ab\??ab \v!line\v!middle}{\baselinemiddlebox}
-\setvalue{\??ab\??ab \v!line\v!right }{\baselinerightbox}
-
-\unexpanded\def\offsetbox
- {\dodoubleempty\dooffsetbox[]}
-
-% left/right/top/bottomoffset -> dimensions change
-% x/y | method=fixed -> dimensions don't change
-
-\def\dooffsetbox[#1][#2]%
- {\bgroup
- \dowithnextbox
- {\getparameters[\??ox]
- [\c!x=\zeropoint,
- \c!y=\zeropoint,
- \c!width=\nextboxwd,
- \c!height=\nextboxht,
- \c!depth=\nextboxdp,
- \c!location=,
- \c!leftoffset=\zeropoint,
- \c!rightoffset=\zeropoint,
- \c!topoffset=\zeropoint,
- \c!bottomoffset=\zeropoint,
- \c!method=,
- #2]%
- \donefalse
- \ifdim\@@oxleftoffset =\zeropoint\else\donetrue\fi
- \ifdim\@@oxrightoffset=\zeropoint\else\donetrue\fi
- \ifdim\@@oxtopoffset =\zeropoint\else\donetrue\fi
- \ifdim\@@oxbottomoffset =\zeropoint\else\donetrue\fi
- \ifdone
- \doif\@@oxmethod\v!fixed % new
- {\ifdim\@@oxleftoffset=\zeropoint
- \ifdim\@@oxrightoffset=\zeropoint \else
- \scratchdimen-\@@oxrightoffset
- \edef\@@oxx{\the\scratchdimen}%
- \let\@@oxrightoffset\zeropoint
- \fi
- \else
- \let\@@oxx\@@oxleftoffset
- \let\@@oxleftoffset\zeropoint
- \fi
- \ifdim\@@oxtopoffset=\zeropoint
- \ifdim\@@oxbottomoffset=\zeropoint \else
- \scratchdimen-\@@oxbottomoffset
- \edef\@@oxy{\the\scratchdimen}%
- \let\@@oxbottomoffset\zeropoint
- \fi
- \else
- \let\@@oxy\@@oxtopoffset
- \let\@@oxtopoffset\zeropoint
- \fi
- \donefalse}%
- \fi
- \ifdone
- \setbox\nextbox\vbox
- {\forgetall\offinterlineskip
- \vskip\@@oxtopoffset
- \hbox
- {\hskip\@@oxleftoffset
- \flushnextbox
- \hskip\@@oxrightoffset}%
- \vskip\@@oxbottomoffset}%
- \scratchdimen\nextboxht
- \advance\scratchdimen\nextboxdp
- \nextboxht\scratchdimen
- \nextboxdp\zeropoint
- \fi
- \freezedimenmacro\@@oxwidth
- \freezedimenmacro\@@oxheight
- \freezedimenmacro\@@oxdepth
- \setbox\nextbox\hbox
- {\hskip\@@oxx\lower\@@oxy\hbox
- {\doifelsenothing\@@oxlocation
- {\flushnextbox}
- {\alignedbox[\@@oxlocation]\hbox{\flushnextbox}}}}%
- \nextboxwd\@@oxwidth
- \nextboxht\@@oxheight
- \nextboxdp\@@oxdepth
- \flushnextbox
- \egroup}#1}
-
-% \useMPlibrary[pre] \setupbackgrounds[page][background=pagegrid]
-%
-% \placefigure[left,none]{}{\offset[leftoffset=1cm]{\externalfigure[koe][breedte=3cm]}}
-% \input tufte
-% \placefigure[left,none]{}{\offset[rightoffset=1cm]{\externalfigure[koe][breedte=3cm]}}
-% \input tufte
-% \placefigure[left,none]{}{\offset[topoffset=1cm]{\externalfigure[koe][breedte=3cm]}}
-% \input tufte
-% \placefigure[left,none]{}{\offset[bottomoffset=1cm]{\externalfigure[koe][breedte=3cm]}}
-% \input tufte
-
-\unexpanded\def\offset {\dodoubleempty\dooffsetbox [\hbox]} % yes or no
-\unexpanded\def\aligned{\dosingleempty\doalignedbox[\hbox]} % yes or no
-
-%\ruledhbox{\offsetbox[x=-1cm,y=-1cm,location=c]
-% {\framed[width=4cm,height=4cm]{x}}}
-
-\def\dotabbed#1#2#3#4%
- {\dontleavehmode
- \bgroup
- \setbox\scratchbox\hbox{#3}%
- \hbox to \wd\scratchbox{#1#4#2}%
- \egroup}
-
-\unexpanded\def\ltabbed{\dotabbed\relax\hss}
-\unexpanded\def\rtabbed{\dotabbed\hss \relax}
-\unexpanded\def\ctabbed{\dotabbed\hss \hss} \let\mtabbed\ctabbed
-
-% \ltabbed{\romeins{3}}{\romeins{1}} test \endgraf
-% \ltabbed{\romeins{3}}{\romeins{2}} test \endgraf
-% \ltabbed{\romeins{3}}{\romeins{3}} test \endgraf
-%
-% \rtabbed{\romeins{3}}{\romeins{1}} test \endgraf
-% \rtabbed{\romeins{3}}{\romeins{2}} test \endgraf
-% \rtabbed{\romeins{3}}{\romeins{3}} test \endgraf
-%
-% \ctabbed{\romeins{3}}{\romeins{1}} test \endgraf
-% \ctabbed{\romeins{3}}{\romeins{2}} test \endgraf
-% \ctabbed{\romeins{3}}{\romeins{3}} test \endgraf
-
-% alternative, if done, then other name
-%
-% \def\dotabbed#1#2#3#4%
-% {\dontleavehmode
-% \bgroup
-% \scratchdimen\zeropoint
-% \def\docommand##1%
-% {\setbox\scratchbox\hbox{##1}%
-% \ifdim\wd\scratchbox>\scratchdimen
-% \scratchdimen\wd\scratchbox
-% \fi}%
-% \processcommalist[#3]\docommand
-% \hbox to \scratchdimen{#1#4#2}%
-% \egroup}
-%
-% \def\ltabbed{\dotabbed\relax\hss}
-% \def\rtabbed{\dotabbed\hss \relax}
-% \def\ctabbed{\dotabbed\hss \hss} \let\mtabbed\ctabbed
-%
-% \ltabbed{\romeins{10},\romeins{2000},\romeins{15}}{\romeins{10}} test \endgraf
-% \ltabbed{\romeins{10},\romeins{2000},\romeins{15}}{\romeins{15}} test \endgraf
-% \ltabbed{\romeins{10},\romeins{2000},\romeins{15}}{\romeins{2000}} test \endgraf
-%
-% \rtabbed{\romeins{10},\romeins{2000},\romeins{15}}{\romeins{10}} test \endgraf
-% \rtabbed{\romeins{10},\romeins{2000},\romeins{15}}{\romeins{15}} test \endgraf
-% \rtabbed{\romeins{10},\romeins{2000},\romeins{15}}{\romeins{2000}} test \endgraf
-%
-% \ctabbed{\romeins{10},\romeins{2000},\romeins{15}}{\romeins{10}} test \endgraf
-% \ctabbed{\romeins{10},\romeins{2000},\romeins{15}}{\romeins{15}} test \endgraf
-% \ctabbed{\romeins{10},\romeins{2000},\romeins{15}}{\romeins{2000}} test \endgraf
-
-% to be documented
-
-\unexpanded\def\phantombox[#1]%
- {\hbox\bgroup
- \getparameters
- [\??ol]
- [\c!width=\zeropoint,%
- \c!height=\zeropoint,%
- \c!depth=\zeropoint,#1]%
- \setbox\scratchbox\null
- \wd\scratchbox\@@olwidth
- \ht\scratchbox\@@olheight
- \dp\scratchbox\@@oldepth
- \box\scratchbox
- \egroup}
-
-% \backgroundimage{1}{\hsize}{\vsize}{\externalfigure[cow][\c!width=3cm]}
-
-\unexpanded\def\backgroundimage#1#2#3% repeat hsize vsize
- {\bgroup
- \forgetall
- \dowithnextbox
- {\offinterlineskip
- \ifcase#1\relax
- % just one
- \else
- \scratchdimen#2\divide\scratchdimen\nextboxwd\count0\scratchdimen\advance\count0\plusone
- \scratchdimen#3\divide\scratchdimen\nextboxht\count2\scratchdimen\advance\count2\plusone
- % to be considered, probably methods
- \ifcase#1\or % x and y
- \setbox\nextbox\hbox{\dorecurse{\count0}{\copy\nextbox}}%
- \setbox\nextbox\vbox{\dorecurse{\count2}{\copy\nextbox\endgraf}}%
- \or % x
- \setbox\nextbox\hbox{\dorecurse{\count0}{\copy\nextbox}}%
- \or % y
- \setbox\nextbox\vbox{\dorecurse{\count2}{\copy\nextbox\endgraf}}%
- \fi
- \fi
- \ifdim\nextboxwd>#2\relax
- \setbox\nextbox\hbox to #2{\hss\flushnextbox\hss}%
- \setbox\nextbox\hbox{\expanded{\clip[\c!width=#2,\c!height=\the\nextboxht]{\flushnextbox}}}%
- \fi
- \ifdim\nextboxht>#3\relax
- \setbox\nextbox\vbox to #3{\vss\flushnextbox\vss}%
- \setbox\nextbox\hbox{\expanded{\clip[\c!width=\the\nextboxwd,\c!height=#3]{\flushnextbox}}}%
- \fi
- \flushnextbox
- \egroup}%
- \hbox}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/pack-lyr.mkii b/Master/texmf-dist/tex/context/base/mkii/pack-lyr.mkii
deleted file mode 100644
index 1b0c0fd63f2..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/pack-lyr.mkii
+++ /dev/null
@@ -1,755 +0,0 @@
-%D \module
-%D [ file=pack-lyr,
-%D version=2000.10.20,
-%D title=\CONTEXT\ Packaging Macros,
-%D subtitle=Layers,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Packaging Macros / Layers}
-
-%D This module is now etex dependent.
-
-% todo : first / last / next / +... => page key
-% test on left/right box when no doublesided option given
-% use \ifcsname instead of doifvalue
-
-\unprotect
-
-% When being backgrounds layers get the background offset
-% displacement. Should be an option, on by default
-% (compatibility).
-
-% positie=forceer == ja maar dan ook in status=herhaal
-
-%D The layering mechanism implemented here is independent of
-%D the output routine, but future extensions may depend on a
-%D more close cooperation.
-
-%D First we overload a macro from \type {core-rul}. From now on
-%D we accept a (optional) argument: the specific layer it
-%D will go in. This means that we can move an overlay from one
-%D background to the other using the dimensions of the parent.
-
-%D ! ! ! ! to be documented ! ! ! !
-
-\ifx\undefined\defineoverlay \message{loaded to early} \wait \fi
-
-\def\defineoverlay
- {\dotripleempty\dodefineoverlay}
-
-\def\dodefineoverlay[#1][#2][#3]% overlay [layer] content
- {\ifthirdargument
- \writestatus{BEWARE}{This (overlay definition) has changed!}% temp
- \def\docommand##1{\setvalue{\??ov##1}{\setlayer[#2]{\executedefinedoverlay{##1}{#3}}}}
- \else
- \def\docommand##1{\setvalue{\??ov##1}{\executedefinedoverlay{##1}{#2}}}%
- \fi
- \processcommalist[#1]\docommand}
-
-%D When tracing is turned on, a couple of boxes will
-%D show up as well as the reference point.
-
-\newif\iftracelayers % \tracelayerstrue
-
-%D This handy constant saved some string memory.
-
-\def\@@layerbox{@@layerbox}
-
-%D \macros
-%D {definelayer}
-%D
-%D Each layer gets its own (global) box. This also means that
-%D the data that goes into a layer, is typeset immediately.
-%D Each layer automatically gets an associated overlay,
-%D which can be used in any background assignment.
-
-% todo : links/rechts
-
-\def\definelayer
- {\dodoubleargument\dodefinelayer}
-
-\def\dodefinelayer[#1][#2]% \zeropoint ipv \!!zeropoint
- {\setuplayer
- [#1]
- [\c!doublesided=,\c!preset=,
- \c!state=\v!start,\c!direction=\v!normal,\c!option=,
- \c!x=\zeropoint,\c!y=\zeropoint,\c!position=\v!no,
- \c!line=0,\c!column=0,
- \c!width=\nextboxwd,\c!height=\nextboxht,
- \c!offset=\zeropoint,\c!rotation=, % geen 0 !
- \c!hoffset=\zeropoint,\c!voffset=\zeropoint,
- \c!dx=\zeropoint,\c!dy=\zeropoint,
- \c!location=rb,\c!position=\v!no,\c!page=,
- \c!method=\v!overlay,
- \c!sx=1,\c!sy=1,\c!corner=,#2]%
- \doifvalue{\??ll#1\c!doublesided}\v!yes
- {\dopresetlayerbox{\v!left #1}%
- \dopresetlayerbox{\v!right#1}}%
- \dopresetlayerbox{#1}%
- \defineoverlay[#1][\composedlayer{#1}]}
-
-\def\dopresetlayerbox#1%
- {\ifundefined{\@@layerbox#1}%
- \expandafter\newbox\csname\@@layerbox#1\endcsname
- \else
- \resetlayer[#1]%
- \fi}
-
-%D \macros
-%D {setuplayer}
-%D
-%D After a layer is defined, you can change its
-%D characteristics.
-
-\def\setuplayer
- {\dodoubleargument\dosetuplayer}
-
-\def\dosetuplayer[#1][#2]%
- {\def\docommand##1{\getparameters[\??ll##1][#2]}%
- \processcommalist[#1]\docommand}
-
-%D \macros
-%D {setlayer}
-%D
-%D Data is moved into a layer with the following macro. When
-%D \type {position} is set, relative positioning is used, with
-%D the current point as reference point. Otherwise the topleft
-%D corner is used as reference point.
-%D
-%D \starttyping
-%D \setlayer [identifier] [optional parameters] {data}
-%D \stoptyping
-
-\newcount\currentlayerdata
-
-\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}\emptybox}
-\def\thelayerheight#1{\the\ht\executeifdefined{\@@layerbox#1}\emptybox}
-
-\def\setlayer
- {\dotripleempty\dosetlayer}
-
-\def\dosetlayer[#1][#2][#3]% #4 == box do \fi is ok
- {\doifelsevalue{\??ll#1\c!state}\v!stop
- {\dowithnextbox\donothing\hbox}
- {\ifthirdargument
- \dodosetlayer[#1][#2][#3]%
- \else
- \doifassignmentelse{#2}
- {\dodosetlayer[#1][][#2]}%
- {\dodosetlayer[#1][#2][]}%
- \fi}}
-
-\def\dodosetlayer[#1][#2][#3]% #2 = links/rechts
- {\bgroup
- \recalculatebackgrounds
- \recalculatelogos
- \global\advance\currentlayerdata\plusone
- \forgetall
- \dontcomplain
- \doifvalue{\??ll#1\c!option}\v!test\tracelayerstrue
- \iftracelayers\traceboxplacementtrue\fi
- \dowithnextbox % sneller als aparte macro
- {\ifcsname\@@layerbox#1\endcsname % nb: odd/even discard, left/right not
- \edef\@@layerloc{#2}%
- \ifx\@@layerloc\v!even
- \ifodd\realpageno
- % discard nextbox
- \else
- \dododosetlayer[#1][\v!left][#3]%
- \fi
- \else\ifx\@@layerloc\v!odd
- \ifodd\realpageno
- \dododosetlayer[#1][\v!right][#3]%
- %\else
- % discard nextbox
- \fi
- \else
- \dododosetlayer[#1][#2][#3]%
- \fi\fi
- \else
- \writestatus{layer}{unknown layer #1}%
- \fi
- \egroup}%
- \hbox}
-
-\newbox\layerbox
-
-\newdimen\@@layerxsiz
-\newdimen\@@layerysiz
-\newdimen\@@layerxoff
-\newdimen\@@layeryoff
-\newdimen\@@layerxpos
-\newdimen\@@layerypos
-
-\let\lastlayerxpos\!!zeropoint
-\let\lastlayerypos\!!zeropoint
-\let\lastlayerwd \!!zeropoint
-\let\lastlayerht \!!zeropoint
-\let\lastlayerdp \!!zeropoint
-
-% todo left/right
-
-\def\setlastlayerpos#1%
- {\edef\layerpage{\MPp{lyr:\the\currentlayerdata}}%
- \xdef\lastlayerxpos{\the\dimexpr-\MPx{lyr:#1:\layerpage}+\MPx{lyr:\the\currentlayerdata}\relax}%
- \xdef\lastlayerypos{\the\dimexpr \MPy{lyr:#1:\layerpage}-\MPy{lyr:\the\currentlayerdata}\relax}}
-
-\def\definelayerpreset
- {\dodoubleargument\dodefinelayerpreset}
-
-% \def\dodefinelayerpreset[#1][#2]%
-% {\setvalue{\??ll\??ll#1}{\dopresetlayer{#2}}}
-%
-% more fun: \definelayerpreset[whatever][lefttop]
-
-\def\dodefinelayerpreset[#1][#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]}
-
-\letempty\currentlayer
-
-\def\layerparameter#1{\csname\??ll\currentlayer#1\endcsname}
-
-\newdimen\layerwidth
-\newdimen\layerheight
-
-\chardef\@@lacome=1 % LAyerCOnstructionMEthod / temp, will be default
-
-\def\dododosetlayer[#1][#2][#3]% will be sped up
- {% we use the global width, never change this
- \def\currentlayer{#1}%
- \@@layerxsiz\layerparameter\c!width
- \@@layerysiz\layerparameter\c!height
- \layerwidth \@@layerxsiz
- \layerheight\@@layerysiz
- % preroll
- \getparameters[\??ll\currentlayer][#3]%
- % presets and real roll
-% maybe todo:
-% \doif{\layerparameter\c!method}\v!fit
-% {\@@layerxsiz\thelayerwidth \currentlayer
-% \@@layerysiz\thelayerheight\currentlayer
-% \layerwidth \@@layerxsiz
-% \layerheight\@@layerysiz
-% }%
- % etc
- \executeifdefined{\??ll\??ll\layerparameter\c!preset}\gobbletwoarguments\currentlayer{#3}%
- % that was real slow
- \doif{\layerparameter\c!position}\v!overlay % slow, use \dosetvalue instead
- {\getparameters[\??ll\currentlayer][\c!width=\zeropoint,\c!height=\zeropoint,\c!position=\v!yes]}%
- \doifsomething{\layerparameter\c!rotation}
- {\setbox\nextbox\hbox
- {\rotate % to be checked with new rotation
- [\c!location=\v!high,\c!rotation=\layerparameter\c!rotation]
- {\flushnextbox}}}%
- % no, not local
- % \@@layerxsiz\layerparameter\c!width
- % \@@layerysiz\layerparameter\c!height
- % never change that
- \@@layerxpos\layerparameter\c!x
- \@@layerypos\layerparameter\c!y
- \doifelse{\layerparameter\c!hoffset}\v!max
- {\@@layerxoff\@@layerxsiz}{\@@layerxoff\layerparameter\c!hoffset}%
- \doifelse{\layerparameter\c!voffset}\v!max
- {\@@layeryoff\@@layerysiz}{\@@layeryoff\layerparameter\c!voffset}%
- % dx/dy are internal context ones and can be used in preset
- \advance\@@layerxoff\dimexpr\layerparameter\c!offset+\layerparameter\c!dx\relax
- \advance\@@layeryoff\dimexpr\layerparameter\c!offset+\layerparameter\c!dy\relax
- \@@layerxpos\layerparameter\c!sx\@@layerxpos
- \@@layerypos\layerparameter\c!sy\@@layerypos
- \@@layerxoff\layerparameter\c!sx\@@layerxoff
- \@@layeryoff\layerparameter\c!sy\@@layeryoff
- \doifelse{\layerparameter\c!position}\v!yes % combine ^
- {\setlastlayerpos{#2\currentlayer}% todo l/r %%%%%%%%%%%%
- \@@layerxpos\lastlayerxpos
- \@@layerypos\lastlayerypos
- \letgvalue{\??ll\currentlayer\layerpage\c!position}\v!yes
- \letgvalue{\??ll\currentlayer\c!state}\v!start % needed ?
- \setbox\layerbox\vbox to \@@layerysiz
- {\hbox to \@@layerxsiz{\xypos{lyr:\the\currentlayerdata}\hss}\vss}}
- {\setbox\layerbox\emptybox
- \globallet\lastlayerxpos\!!zeropoint
- \globallet\lastlayerypos\!!zeropoint
- \ExpandBothAfter\doifinset\v!bottom{\layerparameter\c!corner}
- {\ifnum\layerparameter\c!line=\zerocount\else % can be < 0
- \setevalue{\??ll\currentlayer\c!line}%
- {\the\numexpr-\layerparameter\c!line+\layoutlines+\plusone\relax}%
- \fi
- \ifdim\@@layerysiz>\zeropoint
- \advance\@@layerypos-\@@layerysiz
- \@@layerypos-\@@layerypos
- \@@layeryoff-\@@layeryoff
- \fi}%
- \ExpandBothAfter\doifinset\v!right{\layerparameter\c!corner}
- {\ifnum\layerparameter\c!column=\zerocount\else % can be < 0
- \setevalue{\??ll\currentlayer\c!column}%
- {\the\numexpr-\layerparameter\c!column+\layoutcolumns+\plusone\relax}%
- \fi
- \ifdim\@@layerxsiz>\zeropoint
- \advance\@@layerxpos-\@@layerxsiz
- \@@layerxpos-\@@layerxpos
- \@@layerxoff-\@@layerxoff
- \fi}%
- \ExpandBothAfter\doif\v!middle{\layerparameter\c!corner}
- {\ifdim\@@layerxsiz>\zeropoint \advance\@@layerxpos.5\@@layerxsiz \fi
- \ifdim\@@layerysiz>\zeropoint \advance\@@layerypos.5\@@layerysiz \fi}%
- \edef\layerpage{\layerparameter\c!page}}%
- \doifsomething\layerpage
- {\edef\layerpage{:\layerpage}%
- \doifundefined{\@@layerbox#2\currentlayer\layerpage}
- {\global\expandafter\newbox\csname\@@layerbox#2\currentlayer\layerpage\endcsname}}%
- \dontcomplain % more comfortable
- \mathchardef\layerpagebox\csname\@@layerbox#2\currentlayer\layerpage\endcsname
- \ifvoid\layerpagebox
- \gsetboxllx\layerpagebox\zeropoint
- \gsetboxlly\layerpagebox\zeropoint
- \fi
- \global\setbox\layerpagebox\vbox %to \layerparameter\c!height % new, otherwise no negative y possible
- {\offinterlineskip
- %postpone, to after nextboxwd correction % \hsize\layerparameter\c!width % new, keep box small
- %\ifvoid\csname\@@layerbox\currentlayer\layerpage\endcsname\else % why not #2#1
- \ifvoid\layerpagebox
- \let\lastlayerwidth \zeropoint
- \let\lastlayerheight\zeropoint
- \else
- \edef\lastlayerwidth {\the\wd\layerpagebox}%
- \edef\lastlayerheight{\the\ht\layerpagebox}%
- \ht\layerpagebox\zeropoint
- \dp\layerpagebox\zeropoint
- \wd\layerpagebox\zeropoint
- \doifnot{\layerparameter\c!direction}\v!reverse{\box\layerpagebox}%
- \fi
- % don't move
- \xdef\lastlayerwd{\the\nextboxwd}%
- \xdef\lastlayerht{\the\nextboxht}% % not entirely ok when grid !
- \xdef\lastlayerdp{\the\nextboxdp}% % not entirely ok when grid !
- % this code
- \doifelse{\layerparameter\c!location}\v!grid\donetrue\donefalse
- \ifdone
- \nextboxht\strutheight
- \nextboxdp\strutdepth
- \else
- \setbox\nextbox\hbox{\alignedbox[\layerparameter\c!location]\vbox{\flushnextbox}}%
- \fi
- \ifnum\layerparameter\c!line=\zerocount\else % no \ifcase, can be negative
- \advance\@@layerypos\dimexpr\layerparameter\c!line\lineheight+\topskip-\lineheight-\nextboxht\relax
- \fi
- \ifnum\layerparameter\c!column=\zerocount\else % no \ifcase, can be negative
- \advance\@@layerxpos\layoutcolumnoffset{\layerparameter\c!column}%
- \fi
- \ifdone
- \setbox\nextbox\hbox{\alignedbox[rb]\vbox{\flushnextbox}}%
- \fi
- % ll registration
- \scratchdimen\@@layerxpos
- \advance\scratchdimen\@@layerxoff
- \ifdim\scratchdimen<\getboxllx\layerpagebox
- \gsetboxllx\layerpagebox\scratchdimen
- \fi
- \ifcase\@@lacome\or % this test will become obsolete
- \advance\scratchdimen\nextboxwd
- \nextboxwd\ifdim\scratchdimen>\lastlayerwidth \scratchdimen \else \lastlayerwidth \fi
- \fi
- \scratchdimen\@@layerypos
- \advance\scratchdimen\@@layeryoff
- \ifdim\scratchdimen<\getboxlly\layerpagebox
- \gsetboxlly\layerpagebox\scratchdimen
- \fi
- % ll compensation
- \ifcase\@@lacome\or % this test will become obsolete
- \advance\scratchdimen\dimexpr\nextboxht+\nextboxdp\relax
- \nextboxht\ifdim\scratchdimen>\lastlayerheight \scratchdimen \else \lastlayerheight \fi
- \nextboxdp\zeropoint
- \fi
- % placement
- \hsize\layerparameter\c!width % new, keep box small
- \vbox to \layerparameter\c!height \bgroup
- \smashbox\nextbox
- \vskip\dimexpr\@@layerypos+\@@layeryoff\relax
- \hskip\dimexpr\@@layerxpos+\@@layerxoff\relax
- \flushnextbox
- \ifvoid\layerpagebox
- % already flushed
- \else
- % the reverse case % check !
- \vskip-\dimexpr\@@layerypos+\@@layeryoff\relax
- \box\layerpagebox
- \fi
- \egroup}%
- % when position is true, the layerbox holds the compensation and needs
- % to be placed; never change this !
- \ifvoid\layerbox\else\box\layerbox\fi}
-
-%D Given the task to be accomplished, the previous macro is
-%D not even that complicated. It mainly comes down to skipping
-%D to the right place and placing a box on top of or below the
-%D existing content. In the case of position tracking, another
-%D reference point is chosen.
-
-%D \macros
-%D {doifelselayerdata}
-%D
-
-\def\doifelselayerdata#1%
- {\ifundefined{\@@layerbox#1}%
- \@EA\secondoftwoarguments
- \else\ifvoid\csname\@@layerbox#1\endcsname
- \@EAEAEA\secondoftwoarguments
- \else
- \@EAEAEA\firstoftwoarguments
- \fi\fi}
-
-%D \macros
-%D {flushlayer}
-%D
-%D When we flush a layer, we flush both the main one and the
-%D page dependent one (when defined). This feature is more
-%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
- {\doifelsevalue{\??ll#1\c!state}\v!continue
- {\global\letvalue{\??ll#1\c!state}\v!repeat} % dangerous, stack-built-up
- {\doifelsevalue{\??ll#1\c!doublesided}\v!yes
- {\doifundefinedelse{\@@layerbox#1}%
- {\dodoflushlayerA[#1]}
- {\doifbothsidesoverruled
- {\dodoflushlayerB\v!left [#1]}% left
- {\dodoflushlayerB\v!right[#1]}% right
- {\dodoflushlayerB\v!left [#1]}}}% left
- {\dodoflushlayerA[#1]}}}}
-
-\def\dodoflushlayerA[#1]%
- {\doifnotvalue{\??ll#1\c!state}\v!stop
- {\startoverlay
- {\dodoflushlayer1{#1}{#1}}
- {\dodoflushlayer0{#1}{#1:\realfolio}}
- \stopoverlay}}
-
-\def\dodoflushlayerB#1[#2]%
- {\doifnotvalue{\??ll#2\c!state}\v!stop
- {\startoverlay
- {\dodoflushlayer1{#2}{#2}}
- {\dodoflushlayer0{#2}{#2:\realfolio}}
- {\dodoflushlayer1{#2}{#1#2}}
- {\dodoflushlayer0{#2}{#1#2:\realfolio}}
- \stopoverlay}}
-
-\def\dodoflushlayer#1#2#3%
- {\ifundefined{\@@layerbox#3}%
- \ifcase#1\else\writestatus{layer}{unknown layer #3}\fi
- \else
- \bgroup
- \forgetall
- \offinterlineskip
- % needed because we need to handle method
- \executeifdefined{\??ll\??ll\getvalue{\??ll#2\c!preset}}\gobbletwoarguments{#2}{}%
- %
- \doifvalue{\??ll#2\c!option}\v!test\tracelayerstrue
- \iftracelayers\traceboxplacementtrue\fi
- \!!doneafalse
- \!!donebfalse
- \doifvalue{\??ll#2\c!method}\v!overlay\!!doneatrue
- \doifvalue{\??ll#2\c!method}\v!fit\!!donebtrue
- \!!donectrue
- \ifcase#1\else
- \doifnotvalue{\??ll#2\c!position}\v!yes
- {\doifvalue{\??ll#2\c!repeat}\v!yes\!!donecfalse
- \doifvalue{\??ll#2\c!state}\v!repeat\!!donecfalse}%
- \fi
- \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
- \setbox\nextbox \if!!doneb
-% \vbox
-% {\scratchdimen\getboxlly\layerbox
-% \vskip-\scratchdimen
-% \scratchdimen\getboxllx\layerbox
-% \hskip-\scratchdimen
-% \advance\scratchdimen-\wd\layerbox
-% \hsize-\scratchdimen
-% \if!!donec\box\else\copy\fi\layerbox}%
- \vbox
- {\vskip-\getboxlly\layerbox
- \hskip-\getboxllx\layerbox
- \hsize-\dimexpr\getboxllx\layerbox-\wd\layerbox\relax
- \if!!donec\box\else\copy\fi\layerbox}%
- \else
- \if!!donec\box\else\copy\fi\layerbox % sorry for the delay due to copying
- \fi
- % todo: method=offset => overlayoffset right/down (handy for backgrounds with offset)
- \iftracelayers \ruledvbox \else \vbox \fi \if!!donea to \overlayheight \fi
- {\hbox \if!!donea to \overlaywidth \fi
- {% klopt dit? #3 en niet #2 ?
- \doifvalue{\??ll#3\realfolio\c!position}\v!yes{\xypos{lyr:#3:\realfolio}}%
- \doifoverlayelse{#3}
- {\box\nextbox}
- {\startlayoutcomponent{l:#3}{layer #3}\box\nextbox\stoplayoutcomponent}%
- \hss}%
- \vss}%
- \if!!donec
- \gsetboxllx\layerbox\zeropoint
- \gsetboxlly\layerbox\zeropoint
- \fi
- \egroup
- \fi}
-
-% \definelayer[test][method=fit] \setupcolors[state=start] \tracelayerstrue
-%
-% \framed[framecolor=red,offset=overlay]{\setlayer[test]{aa}\setlayer[test][x=10pt]{g}\flushlayer[test]}
-% \framed[framecolor=red,offset=overlay]{\setlayer[test]{aa}\setlayer[test][x=-10pt]{bb}\flushlayer[test]}
-% \framed[framecolor=red,offset=overlay]{\setlayer[test][x=-20pt]{cccccc}\flushlayer[test]}
-% \framed[framecolor=red,offset=overlay]{\setlayer[test]{dd}\setlayer[test][x=-20pt,y=-3pt]{eeeeee}\flushlayer[test]}
-
-%D \macros
-%D {composedlayer,placelayer,tightlayer}
-%D
-%D This is a handy shortcut, which saves a couple of braces
-%D when we use it as parameter. This name also suits better
-%D to other layering commands.
-
-\def\composedlayer#1{\flushlayer[#1]}
-
-\let\placelayer\flushlayer
-
-\def\tightlayer[#1]%
- {\hbox
- {\def\currentlayer{#1}% todo: left/right
- \setbox\nextbox\emptybox % hoogte/breedte are \wd\nextbox/\ht\nextbox
- \hsize\layerparameter\c!width % \overlaywidth = \hsize
- \vsize\layerparameter\c!height % \overlaywheight = \vsize
- \composedlayer{#1}}}
-
-%D \macros
-%D {resetlayer}
-%D
-%D This macro hardly needs an explanation (and is seldom
-%D needed as well).
-
-\def\doresetlayer#1%
- {\ifundefined{\@@layerbox#1}\else
- \global\setbox\csname\@@layerbox#1\endcsname\emptybox
- \fi}
-
-\def\resetlayer[#1]%
- {\doresetlayer{#1}%
- \doifvalue{\??ll#1\c!doublesided}\v!yes % kind of redundant test
- {\doresetlayer{\v!left #1}%
- \doresetlayer{\v!right#1}}%
- \doresetlayer{#1:\realfolio}}
-
-%D \macros
-%D {setMPlayer}
-%D
-%D The following layer macro uses the positions that are
-%D registered by \METAPOST.
-%D
-%D \starttyping
-%D \definelayer[test]
-%D
-%D \setMPlayer [test] [somepos-1] {Whatever we want here!}
-%D \setMPlayer [test] [somepos-2] {Whatever we need there!}
-%D \setMPlayer [test] [somepos-3] {\externalfigure[cow.mps][width=2cm]}
-%D
-%D \startuseMPgraphic{oeps}
-%D draw fullcircle scaled 10cm withcolor red ;
-%D register ("somepos-1",2cm,3cm,center currentpicture) ;
-%D register ("somepos-2",8cm,5cm,(-1cm,-2cm)) ;
-%D register ("somepos-3",0cm,0cm,(-2cm,2cm)) ;
-%D \stopuseMPgraphic
-%D
-%D \getMPlayer[test]{\useMPgraphic{oeps}}
-%D \stoptyping
-%D
-%D The last line is equivalent to
-%D
-%D \starttyping
-%D \framed
-%D [background={foreground,test},offset=overlay]
-%D {\useMPgraphic{oeps}}
-%D \stoptyping
-
-\def\setMPlayer
- {\dotripleempty\dosetMPlayer}
-
-\def\MPlayerwidth {\hsize}
-\def\MPlayerheight{\vsize}
-
-\def\dosetMPlayer[#1][#2][#3]%
- {\checkpositions % new, else only support after \starttext
- \edef\MPlayerwidth {\MPw{#2}}%
- \edef\MPlayerheight{\MPh{#2}}%
- \setlayer[#1][\c!x=\MPx{#2},\c!y=\MPy{#2},\c!position=\v!no,#3]}
-
-\def\getMPlayer
- {\dodoubleempty\dogetMPlayer}
-
-\def\dogetMPlayer[#1][#2]%
- {\framed
- [\c!background={\v!foreground,#1},
- \c!frame=\v!off,
- \c!offset=\v!overlay,#2]}
-
-% Some day this (old) mechanism will be combined/integrated
-% in overlays
-
-\newskip\xposition \newskip\yposition
-\newskip\xdimension \newskip\ydimension
-\newskip\xoffset \newskip\yoffset
-
-% already defined \newbox\positionbox
-
-\def\startpositioning
- {\bgroup
- \xposition \zeropoint \yposition \zeropoint
- \xdimension\zeropoint \ydimension\zeropoint
- \xoffset \zeropoint \yoffset \zeropoint
- \hfuzz \paperwidth \vfuzz \paperheight
- \setbox\positionbox\hbox\bgroup}
-
-\def\stoppositioning
- {\doifnot\@@psoffset\v!yes
- {\global\xoffset\zeropoint
- \global\yoffset\zeropoint}%
- \global\advance\xdimension \xoffset
- \global\advance\ydimension \yoffset
- \egroup
- \vbox to \ydimension
- {\vskip\yoffset
- \hbox to \xdimension
- {\hskip\xoffset
- \box\positionbox
- \hfill}
- \vfill}%
- \egroup}
-
-\def\resetpositioning
- {\getparameters[\??ps]
- [\c!state=\v!start,%
- \c!unit=\s!cm,%
- \c!factor=1,%
- \c!scale=1,%
- \c!xfactor=\@@psfactor,%
- \c!yfactor=\@@psfactor,%
- \c!xscale=\@@psscale,%
- \c!yscale=\@@psscale,%
- \c!xstep=\v!absolute,%
- \c!ystep=\v!absolute,%
- \c!xoffset=\!!zeropoint,%
- \c!yoffset=\!!zeropoint]}
-
-\def\setuppositioning
- {\resetpositioning
- \dodoubleargument\getparameters[\??ps]}
-
-\def\calculateposition#1#2#3#4#5#6#7#8#9%
- {\setdimensionwithunit\scratchskip{#1}\@@psunit
- \scratchskip#8\scratchskip
- \scratchskip#9\scratchskip
- \advance\scratchskip #4\relax
- \doif{#2}\v!relative
- {\advance\scratchskip #3%
- \let#4\!!zeropoint}%
- #3\scratchskip\relax
- \doifnot\@@psstate\v!overlay
- {\scratchskip#5\relax
- \advance\scratchskip #3\relax
- \ifdim#3<-#7\relax \global#7-#3\relax \fi
- \ifdim\scratchskip>#6\relax \global#6\scratchskip\relax \fi}}
-
-\def\position
- {\dosingleempty\doposition}
-
-\def\doposition[#1]#2(#3,#4)%
- {\dowithnextbox
- {\bgroup
- \getparameters[\??ps][#1]%
- \dontcomplain
- \calculateposition{#3}\@@psxstep\xposition
- \@@psxoffset{\nextboxwd}\xdimension\xoffset
- \@@psxscale\@@psxfactor
- \scratchdimen\nextboxht \advance\scratchdimen \nextboxdp
- \calculateposition{#4}\@@psystep\yposition
- \@@psyoffset\scratchdimen\ydimension\yoffset
- \@@psyscale\@@psyfactor
- \vbox to \zeropoint % kan beter.
- {\vskip\yposition
- \hbox to \zeropoint
- {\hskip\xposition
- \flushnextbox
- \hss}
- \vss}%
- \xdef\dopoppositioning
- {\xposition\the\xposition
- \yposition\the\yposition
- \noexpand\def\noexpand\@@psxoffset{\@@psxoffset}%
- \noexpand\def\noexpand\@@psyoffset{\@@psyoffset}}%
- \egroup
- \dopoppositioning
- \ignorespaces}
- \hbox}
-
-\resetpositioning
-
-\setuppositioning
- [\c!unit=\s!cm,
- \c!factor=1,
- \c!scale=1,
- \c!xstep=\v!absolute,
- \c!ystep=\v!absolute,
- \c!offset=\v!yes,
- \c!xoffset=\!!zeropoint,
- \c!yoffset=\!!zeropoint]
-
-%D Watch out, a redefinition:
-
-\ifx\settextpagecontent\undefined \writestatus\m!systems{error in page-lyr.tex} \wait \fi
-
-\let\normalsettextpagecontent\settextpagecontent
-
-\definelayer
- [OTRTEXT]
-
-\setuplayer
- [OTRTEXT]
- [\c!width=\innermakeupwidth,
- \c!height=\textheight]
-
-% will be overloaded in page-spr
-
-\def\settextpagecontent#1#2#3% #2 and #3 will disappear
- {\doifelselayerdata{OTRTEXT}
- {\setbox#1\hbox to \makeupwidth
- {\startoverlay
- {\tightlayer[OTRTEXT]} % first, otherwise problems with toc
- {\normalsettextpagecontent{#1}{#2}{#3}\box#1}
- \stopoverlay}%
- \dp#1\zeropoint}%
- {\normalsettextpagecontent{#1}{#2}{#3}}}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/pack-obj.mkii b/Master/texmf-dist/tex/context/base/mkii/pack-obj.mkii
deleted file mode 100644
index 81523d52564..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/pack-obj.mkii
+++ /dev/null
@@ -1,371 +0,0 @@
-%D \module
-%D [ file=pack-obj,
-%D version=1998.01.15,
-%D title=\CONTEXT\ Packaging Macros,
-%D subtitle=Objects,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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, move more to mkiv, get rid of blabelgroup
-
-\writestatus{loading}{ConTeXt Packaging Macros / Objects}
-
-\unprotect
-
-%D \macros
-%D {setobject,getobject,ifinobject}
-%D
-%D Boxes can be considered reuable objects. Unfortunaltely once
-%D passed to the \DVI\ file, such objects cannot be reused. In
-%D \PDF\ however, reusing is possible and sometimes even a
-%D necessity. Therefore, \CONTEXT\ supports reusable objects.
-%D
-%D During the \TEX\ processing run, boxes can serve the purpose
-%D of objects, and the \DVI\ driver module implements objects
-%D using packed boxes.
-%D
-%D The \PDF\ and \PDFTEX\ driver modules implement objects
-%D using \PDF\ forms. There is no (real) restriction on the
-%D number of objects there.
-%D
-%D The first application of objects in \CONTEXT\ concerned
-%D \METAPOST\ graphics and fill||in form fields. The first
-%D application can save lots of bytes, while the latter use is
-%D more a necessity than byte saving.
-%D
-%D \starttyping
-%D \setobject{class}{name}\somebox{}
-%D \getobject{class}{name}
-%D \stoptyping
-%D
-%D Here \type{\somebox} can be whatever box specification suits
-%D \TEX. We save the dimensions of an object, although some
-%D drivers will do so themselves. This means that when for
-%D instance using \PDFTEX\ we could save a hash entry plus some
-%D 20+ memory locations per object by delegating this
-%D housekeeping to the driver. The current approach permits
-%D us to keep the box characteristic too.
-
-\newif\ifinobject
-
-\def\checkobjectreferences
- {\startnointerference
- \protectlabels
- \ifx\usedoutputdriver\currentoutput
- \doutilities{objectreferences}\jobname\empty\relax\relax
- \else
- % different format (will fails on \purenumber)
- \fi
- \global\let\checkobjectreferences\relax
- \stopnointerference}
-
-\def\objectplaceholder{NOT YET FLUSHED}%
-
-\def\presetobject#1#2% \global added
- {\blabelgroup
- \ifcsname\r!object#1::#2\endcsname\else
- \global\@EA\let\csname\r!object#1::#2\endcsname\objectplaceholder
- \fi
- \elabelgroup}
-
-\def\dosetobject#1#2#3% \initializepaper this will move to \everyshipout
- {\initializepaper
- \blabelgroup
- \ifcsname\r!object#2::#3\endcsname
- \elabelgroup \expandafter\gobblefivearguments
- \else % tzt, overload internal referenced objects to save entries
- \elabelgroup \expandafter\dodosetobject
- \fi
- {#1}{#2}{#3}}
-
-\def\resetobject#1#2%
- {\checkobjectreferences
- \letbeundefined{\r!object#1::#2}}
-
-%D \macros
-%D {finalizeobjectbox}
-%D
-%D This one provides a hook for last minute object box processing
-%D we need this in \MKIV.
-
-\ifx\finalizeobjectbox\undefined
- \let\finalizeobjectbox\gobbleoneargument
-\fi
-
-%D Somehow there is a rounding error problem in either \PDFTEX\
-%D or in viewers, or maybe it is conforming the specs. The next
-%D variable compensate for it by removing the rather tight
-%D clip.
-
-\def\objectoffset{1cm}
-
-% \def\dodosetobject#1#2#3%
-% {\bgroup
-% \inobjecttrue
-% \dowithnextbox{\dododosetobject{#1}{#2}{#3}\egroup}}
-
-\def\dodosetobject#1#2#3%
- {\bgroup
- \globalpushmacro\crossreferenceobject \objectreferenced
- \inobjecttrue
- \dowithnextbox
- {\globalpopmacro\crossreferenceobject
- \dododosetobject{#1}{#2}{#3}\egroup}}
-
-\def\dododosetobject#1#2#3%
- {\blabelgroup
- \dontshowcomposition % rather fuzzy in \setxvalue ... \hbox
- \scratchdimen\objectoffset
- \@EA\xdef\csname\r!object#2::#3\endcsname
- {\noexpand\dohandleobject{#2}{#3}%
- {\ifhbox\nextbox\hbox\else\vbox\fi}%
- %{\the\nextboxwd}{\the\nextboxht}{\the\nextboxdp}}%
- {\number\nextboxwd}{\number\nextboxht}{\number\nextboxdp}%
- {\number\scratchdimen}}%
- \expanded % freeze the dimensions since \dostartobject may use \nextbox
- {\dostartobject
- {#2}{#3}{\the\nextboxwd}{\the\nextboxht}{\the\nextboxdp}}%
- \ifcase#1\relax\else \ifdim\objectoffset>\zeropoint
- \setbox\nextbox\vbox spread 2\scratchdimen
- {\forgetall \offinterlineskip
- \vss\hbox spread 2\scratchdimen{\hss\flushnextbox\hss}\vss}%
- \fi \fi
- \flushnextbox
- \dostopobject
- \elabelgroup}
-
-\def\getobject#1#2%
- {\blabelgroup
- \let\dohandleobject\dogetobject
- \csname\r!object#1::#2\endcsname}
-
-% \def\dogetobject#1#2#3#4#5#6%
-% {\initializepaper
-% \forgetall
-% \dontshowcomposition
-% \setbox\scratchbox\vbox
-% {\doinsertobject{#1}{#2}}%
-% \setbox\scratchbox#3%
-% {\vbox to #5\scaledpoint
-% {\ifdim\ht\scratchbox>#5\scaledpoint
-% % or \ifdim\wd\scratchbox>#4\scaledpoint
-% \vss\hbox to #4\scaledpoint{\hss\box\scratchbox\hss}\vss
-% \else
-% \vss\box\scratchbox
-% \fi}}%
-% \wd\scratchbox#4\scaledpoint
-% \ht\scratchbox#5\scaledpoint
-% \dp\scratchbox#6\scaledpoint
-% \box\scratchbox
-% \elabelgroup}
-
-% \def\dogetobject#1#2#3#4#5#6#7%
-% {\initializepaper
-% \forgetall
-% \dontshowcomposition
-% \setbox\scratchbox\vbox
-% {\doinsertobject{#1}{#2}}%
-% \setbox\scratchbox#3%
-% {\vbox to #5\scaledpoint
-% {\ifdim\ht\scratchbox>#5\scaledpoint
-% % or \ifdim\wd\scratchbox>#4\scaledpoint
-% \vss\hbox to #4\scaledpoint{\hss\box\scratchbox\hss}\vss
-% \else
-% \vss\box\scratchbox
-% \fi}}%
-% \scratchdimen#7\scaledpoint
-% \setbox\nextbox\hbox
-% {\hskip-\scratchdimen\lower\scratchdimen\flushnextbox}%
-% \wd\scratchbox#4\scaledpoint
-% \ht\scratchbox#5\scaledpoint
-% \dp\scratchbox#6\scaledpoint
-% \box\scratchbox
-% \elabelgroup}
-
-\def\dogetobject#1#2#3#4#5#6#7% don't change this, should work for dvi & pdf
- {\initializepaper
- \forgetall
- \dontshowcomposition
- \setbox\scratchbox\vbox
- {\doinsertobject{#1}{#2}}%
- \setbox\scratchbox#3%
- {\vbox to #5\scaledpoint
- {\ifdim\ht\scratchbox>#5\scaledpoint
- \vss\hbox to #4\scaledpoint{\hss\box\scratchbox\hss}\vss
- \else\ifdim\wd\scratchbox>#4\scaledpoint
- \vss\hbox to #4\scaledpoint{\hss\box\scratchbox\hss}\vss
- \else
- %\vss\box\scratchbox
- \vss\hbox to #4\scaledpoint{\box\scratchbox\hss}% fix Chof
- \fi\fi}}%
- \box\scratchbox
- \elabelgroup}
-
-%D If needed one can ask for the dimensions of an object with:
-%D
-%D \starttyping
-%D \getobjectdimensions{class}{name}
-%D \stoptyping
-%D
-%D The results are reported in \type {\objectwidth}, \type
-%D {\objectheight} and \type {\objectdepth}.
-
-% \def\dogetobjectdimensions#1#2#3#4#5#6%
-% {\def\objectwidth {#4\s!sp}%
-% \def\objectheight{#5\s!sp}%
-% \def\objectdepth {#6\s!sp}}
-
-\def\dogetobjectdimensions#1#2#3#4#5#6#7%
- {\def\objectwidth {#4\s!sp}%
- \def\objectheight{#5\s!sp}%
- \def\objectdepth {#6\s!sp}%
- \def\objectmargin{#7\s!sp}}
-
-\def\getobjectdimensions#1#2%
- {\let\dohandleobject\dogetobjectdimensions
- \let\objectwidth \!!zeropoint
- \let\objectheight\!!zeropoint
- \let\objectdepth \!!zeropoint
- \labelcsname\r!object#1::#2\endcsname}
-
-%D Apart from this kind of objects, that have typeset content,
-%D we can have low level driver specific objects. Both types
-%D can have references to internal representations, hidden for
-%D the user. We keep track of such references by means of a
-%D dedicated cross reference mechanism. Normally, objects are
-%D defined before they are used, but forward referencing
-%D sometimes occurs.
-%D
-%D \starttyping
-%D \dosetobjectreference {class} {identifier} {reference value} {page}
-%D \dogetobjectreference {class} {identifier} \csname
-%D \stoptyping
-%D
-%D These commands are to be called by the \type{\startobject},
-%D \type{\stopobject} and \type{\insertobject} specials.
-
-\def\objectreferenced{\global\chardef\crossreferenceobject\plusone}
-\def\driverreferenced{\global\chardef\crossreferenceobject\zerocount}
-
-\objectreferenced
-
-% no undefined test ! ! ! ! (pdftex fails on undefined objects)
-
-\def\setobjectreferences
- {\def\objectreference##1##2##3##4%
- {\ifundefined{\r!driver##1::##2}%
- \setxvalue{\r!driver##1::##2}{{##3}{##4}}%
- \else
- \showmessage\m!references{31}{[##1 ##2=>##3/##4]}%
- \fi}}
-
-\def\resetobjectreferences
- {\let\objectreference\gobblefourarguments}
-
-\resetobjectreferences
-
-\def\doregisterobjectreference#1#2#3%
- {\checkobjectreferences
- \blabelgroup
- \expanded{\writeutilitycommand{\noexpand\objectreference{#1}{#2}{#3}{\noexpand\realfolio}}}%
- \setxvalue{\r!driver#1::#2}{{#3}{\noexpand\realfolio}}%
- \elabelgroup}
-
-\def\dooverloadobjectreference#1#2#3%
- {\checkobjectreferences
- \blabelgroup
- \setxvalue{\r!driver#1::#2}{{#3}{\noexpand\realfolio}}%
- \elabelgroup}
-
-\def\dosetobjectreference
- {\ifcase\crossreferenceobject
- \objectreferenced
- \expandafter\dooverloadobjectreference
- \else
- \expandafter\doregisterobjectreference
- \fi}
-
-\def\dosetdriverreference
- {\driverreferenced\dosetobjectreference}
-
-\def\defaultobjectreference#1#2{0} % driver dependent
-\def\defaultobjectpage #1#2{\realfolio}
-
-\def\dogetobjectreference {\dodogetobjectreference\firstoftwoarguments\defaultobjectreference}
-\def\dogetobjectreferencepage{\dodogetobjectreference\secondoftwoarguments\defaultobjectpage}
-
-\def\dodogetobjectreference#1#2#3#4#5%
- {\checkobjectreferences
- \blabelgroup
- \ifundefined{\r!driver#3::#4}%
- \showmessage\m!references{30}{[#3 #4=>#3/#4]}%
- \xdef#5{#2{#3}{#4}}%
- \else
- \xdef#5{\@EAEAEA#1\csname\r!driver#3::#4\endcsname}%
- \fi
- \elabelgroup}
-
-\def\setobject {\driverreferenced\dosetobject1}
-\def\settightobject{\driverreferenced\dosetobject0}
-
-%D \macros
-%D {doifobjectfoundelse,doifobjectreferencefoundelse}
-%D
-%D To prevent redundant definition of objects, one can use
-%D the next tests:
-%D
-%D \starttyping
-%D \doifobjectfoundelse{class}{object}{do then}{do else}
-%D \doifobjectreferencefoundelse{class}{object}{do then}{do else}
-%D \stoptyping
-
-\def\doifobjectfoundelse#1#2%
- {\blabelgroup \ifcsname\r!object#1::#2\endcsname
- \elabelgroup \expandafter\firstoftwoarguments
- \else
- \elabelgroup \expandafter\secondoftwoarguments
- \fi}
-
-\def\doifobjectreferencefoundelse#1#2%
- {\checkobjectreferences
- \blabelgroup \ifcsname\r!driver#1::#2\endcsname
- \elabelgroup \expandafter\firstoftwoarguments
- \else
- \elabelgroup \expandafter\secondoftwoarguments
- \fi}
-
-%D \macros
-%D {doifobjectssupportedelse}
-%D
-%D Starting with reuse of graphics, we will implement object
-%D reuse when possible. To enable mechanisms to determine
-%D what method to use, we provide:
-%D
-%D \starttyping
-%D \doifobjectssupportedelse{true action}{false action}
-%D \stoptyping
-%D
-%D As we can see, currently objects depend on the special
-%D driver.
-
-\newif\ifobjectssupported \objectssupportedtrue
-
-\def\doifobjectssupportedelse
- {\ifobjectssupported
- \@EA\doifspecialavailableelse\@EA\doinsertobject
- \else
- \@EA\secondoftwoarguments
- \fi}
-
-%D There is a conceptual problem here. Objects are not possible
-%D in \DVI, unless faked like in \type {spec-dvi}. This means
-%D that we must be careful in loading special drivers that do
-%D support objects while we still want to be able to use the
-%D \DVI\ output.
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/pack-rul.mkii b/Master/texmf-dist/tex/context/base/mkii/pack-rul.mkii
deleted file mode 100644
index 7399cacd811..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/pack-rul.mkii
+++ /dev/null
@@ -1,3650 +0,0 @@
-%D \module
-%D [ file=pack-rul, % was core-rul,
-%D version=1998.10.16,
-%D title=\CONTEXT\ Packaging Macros,
-%D subtitle=Ruled Content,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Packaging Macros / Ruled Content}
-
-\unprotect
-
-%D We have removed the rather old and out dated raster methods. They
-%D have not been used for ages.
-
-%D \macros
-%D {linewidth, setuplinewidth}
-%D
-%D This module deals with rules (lines) in several ways. First
-%D we introduce two macros that can be used to set some common
-%D characteristics.
-%D
-%D \showsetup{setuplinewidth}
-%D
-%D The linewidth is available in \type{\linewidth}. The
-%D preset value of .4pt equals the default hard coded \TEX\
-%D rule width.
-
-\newdimen\linewidth
-
-\def\dosetuplinewidth[#1]%
- {\assigndimension{#1}\linewidth{.2\points}{.4\points}{.6\points}}
-
-\def\setuplinewidth
- {\dosingleargument\dosetuplinewidth}
-
-%D \macros
-%D {ruledlinewidth, inheritruledlinewidth}
-%D
-%D Inside framed boxed we will use a private dimensions. As
-%D an option one can let the linewidth inherit its value from
-%D this one.
-
-\newdimen\ruledlinewidth \newif\ifinheritruledlinewidth
-
-% %D \TEX\ lacks support for color and even gray scales. The next
-% %D macros can provide a sort of poor mans gray scales as well
-% %D as give access to more suitable methods of rendering. Such a
-% %D method looks like:
-% %D
-% %D \starttyping
-% %D \def\methodegraybox#1#2#3#4#5#6%
-% %D { ... }
-% %D \stoptyping
-% %D
-% %D The string \type{graybox} is a common element in the name,
-% %D so we can have for instance \type {\postscriptgraybox} or
-% %D \type {\texgraybox}. The first three arguments take a
-% %D dimension, the fourth one takes a number between~0 and~1,
-% %D and the last argument specifies a radius of the box when
-% %D rounded corners are used, so:
-% %D
-% %D \startbuffer
-% %D \dotgraybox{.5\hsize}{1cm}{0cm}{.85}{\v!no}{0pt}
-% %D \stopbuffer
-% %D
-% %D \typebuffer
-% %D
-% %D becomes:
-% %D
-% %D %\startlinecorrection
-% %D % \vbox to 1cm{\getbuffer}
-% %D %\stoplinecorrection
-% %D
-% %D \startlinecorrection
-% %D \unprotect
-% %D \vbox to 1cm{\dotgraybox{.5\hsize}{1cm}{0cm}{.85}{\v!no}{0pt}}
-% %D \protect
-% %D \stoplinecorrection
-% %D
-% %D There are two predefined methodes, one uses periods and the
-% %D other uses small rules. The second method is less
-% %D efficient, but sometimes give better results. The dimensions
-% %D of the resullting box are set to zero.
-%
-% \setvalue{\v!dot graybox}{\processraster\symbol\rasterdot}
-% \setvalue{\v!rule graybox}{\processraster\symbol\rasterbox}
-%
-% \def\rasterdot{\rasterfont.}
-% \def\rasterbox{\hss\vrule\!!width.4pt\!!height.4pt\!!depth\zeropoint}
-%
-% %D Now of course we need:
-%
-% \ifx\rasterfont\undefined \def\rasterfont{\fivepoint} \fi
-%
-% %D We implement two pure \TEX\ based generators, that use
-% %D \type{\leaders} to quickly gerenate the gray pattern. One
-% %D should beware of \DIMENSION\ conflicts, so we use some
-% %D registers above~8. These macros are memory hungry and byte
-% %D spoiling.
-%
-% \def\processraster#1#2#3#4#5#6#7%
-% {\bgroup
-% \forgetall
-% \dontcomplain
-% \dimen10=\onepoint
-% \dimen10=\@@rsfactor\dimen10
-% \dimen10=#5\dimen10
-% \setbox2\hbox to #2
-% {\cleaders\hbox to 2\dimen10{#1\hss}\hss}%
-% \dimen12=#3%
-% \advance\dimen12 #4%
-% % \setbox0\vbox to \dimen12
-% {\cleaders\vbox to 2\dimen10{\box2\vss}\vss}%
-% \setbox0\hbox
-% {\hskip-.5\dimen10\lower0.5\dimen10\copy0
-% \hskip-\wd0\hskip\dimen10\lower1.5\dimen10\box0}%
-% \box0
-% \egroup}
-
-%D \macros
-%D {setupscreens}
-%D
-%D The previous macro uses a predefined constant
-%D \type{\@@rsfactor}. This factor can be set by:
-%D
-%D \showsetup{setupscreens}
-
-\def\setupscreens
- {\dodoubleargument\getparameters[\??rs]}
-
-% %D The most appropriate way to call for this feature is
-% %D using \type{\graybox}, which is defined as:
-%
-% \def\graybox{\getvalue{\@@rsmethod graybox}}
-%
-% %D We just introduced two pure \TEX\ methods for generating
-% %D rasters. However, it's far more efficient and comfortable in
-% %D terms of speed, memory usage and file size, to use a driver
-% %D supported method.
-%
-% \setvalue{\v!external graybox}{\setgraybox}
-%
-% %D For compatibility reasons we also define the original one:
-%
-% \setvalue{\v!postscript graybox}{\getvalue{\v!external graybox}}
-%
-% %D A quite valid way of letting drivers do the job, is giving
-% %D a solid rule a gray texture.
-
-%D We will communicate through module specific variables, current
-%D framed parameters and some reserved dimension registers.
-
-\newdimen \frameddimenwd
-\newdimen \frameddimenht
-\newdimen \frameddimendp
-
-%D We don't have to stick to a \TEX\ drawn rule, but
-%D also can use rounded or even fancier shapes, as we will
-%D see later on.
-
-\def\dofilledbox
- {\bgroup
- \doifelse{\framedparameter\c!backgroundcorner}\v!rectangular
- {\dofilledlinedbox}
- {\ifzeropt\dimexpr\framedparameter\c!backgroundradius\relax % just in case of .x\bodyfontsize
- \dofilledlinedbox
- \else
- \dofilledroundbox
- \fi}%
- \egroup}
-
-\def\dophantombox
- {\hphantom{\dofilledbox}}
-
-\def\dofilledlinedbox
- {\vrule\!!width\frameddimenwd\!!height\frameddimenht\!!depth\frameddimendp\relax}%
-
-\def\dostrokedroundbox
- {\doif{\framedparameter\c!frame}\v!on\dodostrokedroundbox}
-
-\def\dodostrokedroundbox
- {\bgroup
- \edef\ovalmod{\framedparameter\c!framecorner}%
- \doifelse\ovalmod\v!round{\let\ovalmod\!!zerocount}{\edef\ovalmod{\number\ovalmod}}%
- \edef\ovalwid{\the\frameddimenwd}%
- \edef\ovalhei{\the\frameddimenht}%
- \edef\ovaldep{\the\frameddimendp}%
- \edef\ovallin{\the\dimexpr\ruledlinewidth}%
- \edef\ovalrad{\the\dimexpr\framedparameter\c!frameradius}%
- \let\ovalstr\!!plusone
- \let\ovalfil\!!zerocount
- \forcecolorhack
- \doovalbox\ovalwid\ovalhei\ovaldep\ovallin\ovalrad\ovalstr\ovalfil\ovalmod
- \egroup}
-
-\def\dofilledroundbox
- {\bgroup
- \edef\ovalmod{\framedparameter\c!backgroundcorner}%
- \doifelse\ovalmod\v!round{\let\ovalmod\!!zerocount}{\edef\ovalmod{\number\ovalmod}}%
- \edef\ovalwid{\the\frameddimenwd}%
- \edef\ovalhei{\the\frameddimenht}%
- \edef\ovaldep{\the\frameddimendp}%
- \edef\ovallin{\the\dimexpr\ruledlinewidth\relax}%
- \edef\ovalrad{\the\dimexpr\framedparameter\c!backgroundradius\relax}%
- \let\ovalstr\!!zerocount
- \let\ovalfil\!!plusone
- \forcecolorhack
- \doovalbox\ovalwid\ovalhei\ovaldep\ovallin\ovalrad\ovalstr\ovalfil\ovalmod
- \egroup}
-
-% a lot of weird corners
-%
-% \startTEXpage
-% \dontleavehmode\framed
-% [corner=0,frame=on,framecolor=green,
-% background=color,backgroundcolor=yellow]{\tttf TEST \twodigits\recurselevel}%
-% \vskip1em
-% \dontleavehmode\dostepwiserecurse {1} {4}{1}{\framed
-% [corner=\recurselevel,frame=on,framecolor=green,
-% background=color,backgroundcolor=yellow]{\tttf TEST \twodigits\recurselevel}%
-% \quad}
-% \vskip1em
-% \dontleavehmode\dostepwiserecurse {5} {8}{1}{\framed
-% [corner=\recurselevel,frame=on,framecolor=green,
-% background=color,backgroundcolor=yellow]{\tttf TEST \twodigits\recurselevel}%
-% \quad}
-% \vskip1em
-% \dontleavehmode\dostepwiserecurse {1} {4}{1}{\framed
-% [corner=\recurselevel,frame=on,framecolor=green]{\tttf TEST \twodigits\recurselevel}%
-% \quad}
-% \vskip1em
-% \dontleavehmode\dostepwiserecurse {5} {8}{1}{\framed
-% [corner=\recurselevel,frame=on,framecolor=green]{\tttf TEST \twodigits\recurselevel}%
-% \quad}
-% \vskip1em
-% \dontleavehmode\dostepwiserecurse {9}{12}{1}{\framed
-% [corner=\recurselevel,frame=on,framecolor=green]{\tttf TEST \twodigits\recurselevel}%
-% \quad}
-% \vskip1em
-% \dontleavehmode\dostepwiserecurse{13}{16}{1}{\framed
-% [corner=\recurselevel,frame=on,framecolor=green]{\tttf TEST \twodigits\recurselevel}%
-% \quad}
-% \vskip1em
-% \dontleavehmode\dostepwiserecurse{17}{20}{1}{\framed
-% [corner=\recurselevel,frame=on,framecolor=green]{\tttf TEST \twodigits\recurselevel}%
-% \quad}
-% \vskip1em
-% \dontleavehmode\dostepwiserecurse{21}{24}{1}{\framed
-% [corner=\recurselevel,frame=on,framecolor=green]{\tttf TEST \twodigits\recurselevel}%
-% \quad}
-% \vskip1em
-% \dontleavehmode\dostepwiserecurse{25}{28}{1}{\framed
-% [corner=\recurselevel,frame=on,framecolor=green]{\tttf TEST \twodigits\recurselevel}%
-% \quad}
-% \stopTEXpage
-
-%D The oval box is drawn using a special macro, depending on
-%D the driver in use.
-
-\def\dograybox % avoid black rules when no gray
- {\doifelsenothing{\framedparameter\c!backgroundscreen}
- {\dophantombox}
- {\raster[\framedparameter\c!backgroundscreen]{\dofilledbox}}}
-
-%D It won't be a surprise that we not only provide gray boxes,
-%D but also colored ones. Here it is:
-
-\def\docolorbox
- {\hbox{\ifincolor
- \doifcolorelse{\framedparameter\c!backgroundcolor}
- {\localcolortrue\color[\framedparameter\c!backgroundcolor]{\dofilledbox}}
- {\dophantombox}%
- \else
- \dophantombox
- \fi}}
-
-%D \macros
-%D {defineoverlay, doifoverlayelse, overlayoffset,
-%D overlaywidth, overlayheight, overlaydepth,
-%D overlaycolor, overlaylinecolor, overlaylinewidth}
-%D
-%D Before we define the macro that actually takes card of the
-%D backgrounds, we introduce overlays. An overlay is something
-%D that contrary to its name lays {\em under} the text. An
-%D example of an overlay definition is:
-%D
-%D \startbuffer[tmp-1]
-%D \defineoverlay
-%D [fancy]
-%D [{\externalfigure
-%D [mp-cont.502]
-%D [width=\overlaywidth,
-%D height=\overlayheight]}]
-%D \stopbuffer
-%D
-%D \typebuffer[tmp-1]
-%D
-%D That for instance can be uses in:
-%D
-%D \startbuffer[tmp-2]
-%D \framed[backgroundachtergrond=fancy]{How Fancy!}
-%D \framed[backgroundachtergrond=fancy,frame=off]{Even More Fancy!}
-%D \stopbuffer
-%D
-%D and looks like:
-%D
-%D \startlinecorrection
-%D \vbox{\baselineskip24pt\getbuffer[tmp-1]\getbuffer[tmp-2]}
-%D \stoplinecorrection
-%D
-%D The formal definition is:
-%D
-%D \showsetup{defineoverlay}
-%D
-%D This macro's definition is a bit obscure, due the many
-%D non||used arguments and the two step call that enable the
-%D setting of the width, height and depth variables.
-%D Multiple backgrounds are possible and are specified as:
-%D
-%D \starttyping
-%D \framed[background={one,two,three}]{Three backgrounds!}
-%D \stoptyping
-%D
-%D Most drawing packages only know width and height. Therefore
-%D the dimensions have a slightly different meaning here:
-%D
-%D \startitemize[packed]
-%D \item \type{\overlaywidth }: width of the overlay
-%D \item \type{\overlayheight}: height plus depth of the overlay
-%D \item \type{\overlaydepth }: depth of the overlay
-%D \stopitemize
-%D
-%D The resulting box is lowered to the right depth.
-
-\def\overlaywidth {\the\hsize\space} % We preset the variables
-\def\overlayheight {\the\vsize\space} % to some reasonable default
-\let\overlaydepth \!!zeropoint % values. The attributes
-\let\overlayoffset \!!zeropoint % of the frame can be (are)
-\let\overlaycolor \empty % set somewhere else.
-\let\overlaylinewidth \!!zeropoint %
-\let\overlaylinecolor \empty %
-
-%D The next register is used to initialize overlays.
-
-\newtoks\everyoverlay
-
-%D An example of an initialization is the following (overlays
-%D can contain text and be executed under an regime where
-%D interlineskip is off).
-
-\appendtoks \oninterlineskip \to \everyoverlay
-
-\def\defineoverlay
- {\dodoubleargument\dodefineoverlay}
-
-\def\dodefineoverlay[#1][#2]%
- {\def\docommand##1{\setvalue{\??ov##1}{\executedefinedoverlay{##1}{#2}}}%
- \processcommalist[#1]\docommand}
-
-\prependtoks
- \hsize\overlaywidth
- \vsize\overlayheight
-\to\everyoverlay
-
-\long\def\executedefinedoverlay#1#2%
- {\bgroup
- \edef\overlaywidth {\the\frameddimenwd\space}%
- \edef\overlayheight{\the\dimexpr\frameddimenht+\frameddimendp\relax\space}%
- \edef\overlaydepth {\the\frameddimendp\space}%
- \edef\overlaycolor {\framedparameter\c!backgroundcolor}%
- %\edef\overlaycorner{\framedparameter\c!backgroundcorner}%
- %\edef\overlayradius{\framedparameter\c!backgroundradius}%
- \let\overlayoffset\backgroundoffset % we steal this one
- \setbox\scratchbox\hbox{\lower\overlaydepth\hbox{\the\everyoverlay#2}}%
- \setbox\scratchbox\hbox
- {\hskip-.5\dimexpr\wd\scratchbox-\overlaywidth \relax
- \raise-.5\dimexpr\ht\scratchbox-\frameddimenht\relax % not overlayheight !
- \box\scratchbox}%
- \wd\scratchbox\overlaywidth
- \ht\scratchbox\overlayheight
- \dp\scratchbox\overlaydepth
- \startlayoutcomponent{o:#1}{overlay #1}%
- \box\scratchbox
- \stoplayoutcomponent
- \egroup}
-
-%D The empty case is:
-
-\let\executeoverlay\gobblesevenarguments
-
-%D For testing we provide:
-
-\def\doifoverlayelse#1%
- {\doifdefinedelse{\??ov#1}}
-
-%D We predefine two already familiar backgrounds:
-
-\setvalue{\??ov\v!screen}{\dograybox }
-\setvalue{\??ov\v!color }{\docolorbox}
-
-% %D After all these preparations, the background macro does no
-% %D bring to many surprises. One has to keep in mind that this
-% %D macro starts up a call chain, depending on the background
-% %D one needs:
-% %D
-% %D \startitemize[packed]
-% %D \item a raster, color or user defined shape
-% %D \item square or round corners
-% %D \item a \TEX\ or driver based method
-% %D \stopitemize
-% %D
-% %D The macro can be extended by adding commands to the token
-% %D list register \type {\everybackgroundbox}. For this
-% %D purpose, the name of the current background is available in
-% %D \type {\currentbackgound}.
-
-%D The content of the box will be (temporary) saved in a box. We
-%D also have an extra box for backgrounds.
-
-\newbox\framebox
-\newbox\extraframebox
-
-\newtoks\everybackgroundbox
-
-\let\currentbackground\empty
-
-% \def\dodobackgroundbox#1% also less passing, we can get rid of the old method
-% {\bgroup
-% \def\currentbackground{#1}%
-% \the\everybackgroundbox
-% \setbox\extraframebox\hbox
-% {\vbox{\moveleft\backgroundoffset\hbox{\executeifdefined{\??ov\currentbackground}\donothing}}}%
-% \wd\extraframebox\zeropoint % \backgroundwidth
-% \ht\extraframebox\backgroundheight
-% \dp\extraframebox\backgrounddepth
-% \box\extraframebox % \hskip-\backgroundwidth
-% \egroup}
-
-% \def\dodobackgroundbox#1% also less passing, we can get rid of the old method
-% {\bgroup
-% \def\currentbackground{#1}%
-% \ifcsname\??ov\currentbackground\endcsname
-% \the\everybackgroundbox
-% \setbox\extraframebox\hbox{\vbox{\moveleft\backgroundoffset\hbox{\csname\??ov\currentbackground\endcsname}}}%
-% \wd\extraframebox\zeropoint % \backgroundwidth
-% \ht\extraframebox\backgroundheight
-% \dp\extraframebox\backgrounddepth
-% \box\extraframebox % \hskip-\backgroundwidth
-% \fi
-% \egroup}
-
-\def\dodobackgroundbox
- {\bgroup
- \ifcsname\??ov\currentbackground\endcsname
- \the\everybackgroundbox
- \setbox\extraframebox\hbox{\vbox{\moveleft\backgroundoffset\hbox{\csname\??ov\currentbackground\endcsname}}}%
- \wd\extraframebox\zeropoint % \backgroundwidth
- \ht\extraframebox\backgroundheight
- \dp\extraframebox\backgrounddepth
- \box\extraframebox % \hskip-\backgroundwidth
- \fi
- \egroup}
-
-\def\dododobackgroundbox#1,#2% #2 gobbles spaces
- {\edef\currentbackground{#1}%
- \ifx\currentbackground\s!unknown\else
- \dodobackgroundbox\expandafter\dododobackgroundbox
- \fi#2}
-
-\let\backgroundoffset\!!zeropoint
-\let\backgrounddepth \!!zeropoint
-\def\backgroundwidth {\the\hsize}
-\def\backgroundheight{\the\vsize}
-
-% todo: also \def\theforegroundbox{#1}
-
-% \def\dobackgroundbox#1%
-% {\setbox\framebox\vbox
-% {\forgetall
-% \boxmaxdepth\maxdimen
-% \scratchdimen \framedparameter{#1}\relax
-% \frameddimenwd\dimexpr\wd\framebox+2\scratchdimen\relax
-% \frameddimenht\dimexpr\ht\framebox+ \scratchdimen\relax
-% \frameddimendp\dimexpr\dp\framebox+ \scratchdimen+\framedparameter\c!backgrounddepth\relax
-% \edef\backgroundoffset{\the\scratchdimen}%
-% \edef\backgroundwidth {\the\wd\framebox}%
-% \edef\backgroundheight{\the\ht\framebox}%
-% \edef\backgrounddepth {\the\dp\framebox}%
-% %\edef\foregroundbox{\box#1}%
-% \def\foregroundbox% fuzzy but needed hack, this \vss, otherwise
-% {\vbox to \backgroundheight{\vss\box\framebox\vss}}% vertical shift
-% \edef\component{\framedparameter\c!component}%
-% \hbox to \backgroundwidth % in case 'foreground' is used as overlay
-% {\ifx\component\empty
-% \rawprocesscommalist[\framedbackground]\dodobackgroundbox
-% \else
-% \startlayoutcomponent{b:\component}{\s!background\space\component}%
-% \rawprocesscommalist[\framedbackground]\dodobackgroundbox
-% \stoplayoutcomponent
-% \fi
-% \box\framebox\hss}}}
-
-\def\normalforegroundbox% fuzzy but needed hack, this \vss, otherwise
- {\vbox to \backgroundheight{\vss\box\framebox\vss}}% vertical shift
-
-\def\dobackgroundbox#1%
- {\setbox\framebox\vbox
- {\forgetall
- \boxmaxdepth\maxdimen
- \scratchdimen \framedparameter{#1}\relax
- \frameddimenwd\dimexpr\wd\framebox+2\scratchdimen\relax
- \frameddimenht\dimexpr\ht\framebox+ \scratchdimen\relax
- \frameddimendp\dimexpr\dp\framebox+ \scratchdimen+\framedparameter\c!backgrounddepth\relax
- \edef\backgroundoffset{\the\scratchdimen}%
- \edef\backgroundwidth {\the\wd\framebox}%
- \edef\backgroundheight{\the\ht\framebox}%
- \edef\backgrounddepth {\the\dp\framebox}%
- %\edef\foregroundbox{\box#1}%
- \edef\component{\framedparameter\c!component}%
- \let\foregroundbox\normalforegroundbox
- \hbox to \backgroundwidth % in case 'foreground' is used as overlay
- {\ifx\component\empty
- \expanded{\dododobackgroundbox\framedparameter\c!background},\s!unknown,\relax
- \else
- \startlayoutcomponent{b:\component}{background \component}%
- \expanded{\dododobackgroundbox\framedparameter\c!background},\s!unknown,\relax
- \stoplayoutcomponent
- \fi
- \box\framebox\hss}}}
-
-%D One can explictly insert the foreground box. For that
-%D purpose we introduce the overlay \type {foreground}.
-
-\defineoverlay[\v!foreground][\foregroundbox]
-
-%D We can specify overlays as a comma separated list of
-%D overlays, a sometimes handy feature.
-
-%D Besides backgrounds (overlays) we also need some macros to
-%D draw outlines (ruled borders). Again we have to deal with
-%D square and round corners. The first category can be handled
-%D by \TEX\ itself, the latter one depends on the driver. This
-%D macro also support a negative offset.
-
-\ifx\scratchoffset\undefined \newdimen\scratchoffset \fi
-
-\def\dooutlinebox % we needed to move the color command in order to apply attributes properly
- {\setbox\framebox\vbox % rules on top of box
- {\scratchoffset \framedparameter\c!frameoffset\relax
- \frameddimenwd\dimexpr\wd\framebox+2\scratchoffset\relax
- \frameddimenht\dimexpr\ht\framebox+ \scratchoffset\relax
- \frameddimendp\dimexpr\dp\framebox+ \scratchoffset+\framedparameter\c!framedepth\relax
- \ifdim\frameddimendp<\zeropoint
- \advance\frameddimenht \frameddimendp
- \scratchdimen-\frameddimendp
- \frameddimendp\zeropoint
- \else
- \scratchdimen\zeropoint
- \fi
- \setbox\extraframebox\hbox
- {\doifsomething{\framedparameter\c!framecolor}{\color[\framedparameter\c!framecolor]}{\dostrokedbox}}%
- \setbox\extraframebox\hbox
- {\raise\scratchdimen\vbox
- {\moveleft\scratchoffset
- \box\extraframebox}}%
- \wd\extraframebox\wd\framebox
- \ht\extraframebox\ht\framebox
- \dp\extraframebox\dp\framebox
- \hbox{\box\framebox\hskip-\wd\extraframebox\box\extraframebox}}}
-
-\def\dostrokedbox
- {\doifelse{\framedparameter\c!framecorner}\v!rectangular
- {\dostrokedlinedbox}
- {\ifzeropt\dimexpr\framedparameter\c!frameradius\relax % just in case of .x\bodyfontsize
- \dostrokedlinedbox
- \else
- \dostrokedroundbox
- \fi}}
-
-\def\dostrokedlinedbox
- {\setbox\scratchbox\null
- \wd\scratchbox\frameddimenwd
- \ht\scratchbox\frameddimenht
- \dp\scratchbox\frameddimendp
- \setbox\scratchbox\vbox \bgroup
- \csname t\@@frame@@\framedparameter\c!frame\framedparameter\c!topframe \endcsname
- \hbox \bgroup
- \csname l\@@frame@@\framedparameter\c!frame\framedparameter\c!leftframe \endcsname
- \box\scratchbox
- \csname r\@@frame@@\framedparameter\c!frame\framedparameter\c!rightframe \endcsname
- \egroup
- \csname b\@@frame@@\framedparameter\c!frame\framedparameter\c!bottomframe\endcsname
- \egroup
- \wd\scratchbox\frameddimenwd
- \ht\scratchbox\frameddimenht
- \dp\scratchbox\frameddimendp
- \box\scratchbox}
-
-\def\@@frame@@{@@frame@@}
-
-% \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{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{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{r\@@frame@@\v!off\v!on}{\kern-\ruledlinewidth\vrule\!!width\ruledlinewidth}
-% \setvalue{r\@@frame@@\v!on }{\kern-\ruledlinewidth\vrule\!!width\ruledlinewidth}
-
-\def\@@frame@@trule{\hrule\!!height\ruledlinewidth\kern-\ruledlinewidth}
-\def\@@frame@@brule{\kern-\ruledlinewidth\hrule\!!height\ruledlinewidth}
-\def\@@frame@@rrule{\kern-\ruledlinewidth\vrule\!!width\ruledlinewidth}
-\def\@@frame@@lrule{\vrule\!!width\ruledlinewidth\kern-\ruledlinewidth}
-
-\letvalue{t\@@frame@@\v!on \v!on}\@@frame@@trule
-\letvalue{t\@@frame@@\v!off\v!on}\@@frame@@trule
-\letvalue{t\@@frame@@\v!on }\@@frame@@trule
-
-\letvalue{b\@@frame@@\v!on \v!on}\@@frame@@brule
-\letvalue{b\@@frame@@\v!off\v!on}\@@frame@@brule
-\letvalue{b\@@frame@@\v!on }\@@frame@@brule
-
-\letvalue{l\@@frame@@\v!on \v!on}\@@frame@@lrule
-\letvalue{l\@@frame@@\v!off\v!on}\@@frame@@lrule
-\letvalue{l\@@frame@@\v!on }\@@frame@@lrule
-
-\letvalue{r\@@frame@@\v!on \v!on}\@@frame@@rrule
-\letvalue{r\@@frame@@\v!off\v!on}\@@frame@@rrule
-\letvalue{r\@@frame@@\v!on }\@@frame@@rrule
-
-% no overlapping rules
-
-\def\@@frame@@trules{\hbox{\kern\ruledlinewidth\vrule\!!width\dimexpr\frameddimenwd-2\ruledlinewidth\relax\!!height\ruledlinewidth}\nointerlineskip\kern-\ruledlinewidth}
-\def\@@frame@@brules{\kern-\ruledlinewidth\nointerlineskip\hbox{\kern\ruledlinewidth\vrule\!!width\dimexpr\frameddimenwd-2\ruledlinewidth\relax\!!height\ruledlinewidth}}
-\def\@@frame@@rrules{\kern-\ruledlinewidth\vrule\!!height\dimexpr\frameddimenht-\ruledlinewidth\relax\!!depth-\ruledlinewidth\!!width\ruledlinewidth}
-\def\@@frame@@lrules{\vrule\!!height\dimexpr\frameddimenht-\ruledlinewidth\relax\!!depth-\ruledlinewidth\!!width\ruledlinewidth\kern-\ruledlinewidth}
-
-% small is relatively new
-
-\letvalue{t\@@frame@@\v!small\v!small}\@@frame@@trules
-\letvalue{t\@@frame@@\v!off \v!small}\@@frame@@trules
-\letvalue{t\@@frame@@\v!small }\@@frame@@trules
-
-\letvalue{b\@@frame@@\v!small\v!small}\@@frame@@brules
-\letvalue{b\@@frame@@\v!off \v!small}\@@frame@@brules
-\letvalue{b\@@frame@@\v!small }\@@frame@@brules
-
-\letvalue{l\@@frame@@\v!small\v!small}\@@frame@@lrules
-\letvalue{l\@@frame@@\v!off \v!small}\@@frame@@lrules
-\letvalue{l\@@frame@@\v!small }\@@frame@@lrules
-
-\letvalue{r\@@frame@@\v!small\v!small}\@@frame@@rrules
-\letvalue{r\@@frame@@\v!off \v!small}\@@frame@@rrules
-\letvalue{r\@@frame@@\v!small }\@@frame@@rrules
-
-%D I condidered using the low level support command
-%D \type{\ruledhbox}, but this would slow down processing by a
-%D factor~3.
-
-% \framed
-% [width=4cm,height=3cm,rulethickness=3mm,
-% frame=off,rightframe=on,leftframe=on,topframe=on,bottomframe=on]
-% {}
-% \framed
-% [width=4cm,height=3cm,rulethickness=3mm,
-% frame=off,rightframe=small,leftframe=small,topframe=small,bottomframe=small]
-% {}
-% \framed
-% [width=4cm,height=3cm,rulethickness=3mm,
-% frame=off,rightframe=small,leftframe=small,topframe=small,bottomframe=on]
-% {}
-
-%D The next few macros are probably the most misused ones in
-%D \CONTEXT. They deal with putting rules around boxes, provide
-%D backgrounds, offer alignment features, and some more. We
-%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
-\newif\ifboxhasformat
-\newif\ifboxhasstrut
-\newif\ifboxisoverlaid
-\newif\ifboxhasframe
-\newif\ifdelayedstrut
-
-%D We also need a few \DIMENSIONS:
-
-\newdimen\@@localoffset
-\newdimen\@@globalwidth
-
-%D \macros
-%D {framed, setupframed}
-%D
-%D Ruled boxes are typeset using \type{\framed}. This command
-%D is quite versatile and, although some users will probably
-%D seldom use it, one cannot overlook its features.
-%D
-%D \showsetup{setupframed}
-%D \showsetup{framed}
-%D
-%D This general macro is a special version of an even more
-%D general case, that can easily be linked into other macros
-%D that need some kind of framing. The local version is called
-%D with an extra parameter: the variable identifier. The reason
-%D for passing this identifier between brackets lays in the
-%D mere fact that this way we can use the optional argument
-%D grabbers.
-
-\def\defaultframeoffset{.25ex}
-
-\unexpanded\def\framed
- {\bgroup
- \copylocalframed[\??ol][\??oi]% == \presetlocalframed[\??ol]%
- \dodoubleempty\startlocalframed[\??ol]}
-
-\def\presetlocalframed[#1]%
- {\copylocalframed[#1][\??oi]}
-
-% \def\copylocalframed[#1]#2[#3]%
-% {\copyparameters[#1][#3]%
-% [\c!width,\c!height,\c!radius,\c!corner,\c!depth,\c!offset,%
-% \c!autowidth,\c!empty,\c!component,\c!orientation,\c!lines,%
-% \c!align,\c!bottom,\c!top,\c!strut,\c!autostrut,\c!location,\c!setups,\c!extras,%
-% \c!foregroundstyle,\c!foregroundcolor,%
-% \c!background,\c!backgroundoffset,\c!backgroundcorner,\c!backgroundradius,\c!backgrounddepth,\c!backgroundcolor,\c!backgroundscreen,%
-% \c!frame,\c!frameoffset,\c!framecorner,\c!frameradius,\c!framedepth,\c!framecolor,\c!rulethickness,%
-% \c!topframe,\c!bottomframe,\c!leftframe,\c!rightframe]}
-
-% since framed is used all over the place, we have a (small) speedup)
-
-\def\copylocalframed[#1]#2[#3]%
- {\edef\copiedfrom{#1}\edef\copiedto{#3}%
- \docopyvalue\copiedfrom\copiedto\c!width
- \docopyvalue\copiedfrom\copiedto\c!height
- \docopyvalue\copiedfrom\copiedto\c!autowidth
- \docopyvalue\copiedfrom\copiedto\c!offset
- \docopyvalue\copiedfrom\copiedto\c!empty
- \docopyvalue\copiedfrom\copiedto\c!rulethickness
- \docopyvalue\copiedfrom\copiedto\c!radius
- \docopyvalue\copiedfrom\copiedto\c!corner
- \docopyvalue\copiedfrom\copiedto\c!depth
- \docopyvalue\copiedfrom\copiedto\c!frame
- \docopyvalue\copiedfrom\copiedto\c!framecolor
- \docopyvalue\copiedfrom\copiedto\c!foregroundstyle
- \docopyvalue\copiedfrom\copiedto\c!foregroundcolor
- \docopyvalue\copiedfrom\copiedto\c!lines
- \docopyvalue\copiedfrom\copiedto\c!orientation
- \docopyvalue\copiedfrom\copiedto\c!topframe
- \docopyvalue\copiedfrom\copiedto\c!bottomframe
- \docopyvalue\copiedfrom\copiedto\c!leftframe
- \docopyvalue\copiedfrom\copiedto\c!rightframe
- \docopyvalue\copiedfrom\copiedto\c!rulethickness
- \docopyvalue\copiedfrom\copiedto\c!frameoffset
- \docopyvalue\copiedfrom\copiedto\c!background
- \docopyvalue\copiedfrom\copiedto\c!component
- \docopyvalue\copiedfrom\copiedto\c!backgroundoffset
- \docopyvalue\copiedfrom\copiedto\c!backgroundscreen
- \docopyvalue\copiedfrom\copiedto\c!backgroundcolor
- \docopyvalue\copiedfrom\copiedto\c!align
- \docopyvalue\copiedfrom\copiedto\c!bottom
- \docopyvalue\copiedfrom\copiedto\c!top
- \docopyvalue\copiedfrom\copiedto\c!strut
- \docopyvalue\copiedfrom\copiedto\c!autostrut
- \docopyvalue\copiedfrom\copiedto\c!location
- \docopyvalue\copiedfrom\copiedto\c!component
- \docopyvalue\copiedfrom\copiedto\c!extras
- \docopyvalue\copiedfrom\copiedto\c!setups
- \docopyvalue\copiedfrom\copiedto\c!backgroundradius
- \docopyvalue\copiedfrom\copiedto\c!backgroundcorner
- \docopyvalue\copiedfrom\copiedto\c!backgrounddepth
- \docopyvalue\copiedfrom\copiedto\c!frameradius
- \docopyvalue\copiedfrom\copiedto\c!framecorner
- \docopyvalue\copiedfrom\copiedto\c!framedepth}
-
-\def\setupframed
- {\dodoubleempty\dosetupframed}
-
-\def\dosetupframed
- {\ifsecondargument
- \@EA\dodoublesetupframed
- \else
- \@EA\dosinglesetupframed
- \fi}
-
-\def\dosinglesetupframed[#1][#2]%
- {\getparameters[\??oi][#1]}
-
-\def\dodoublesetupframed[#1][#2]%
- {\bgroup
- \let\dodoubleempty\empty
- \def\doframed[##1]{\gdef\globalredefinedframed{\dodoubleempty\doframed[##1,#2]}}%
- \getvalue{#1}%
- \egroup
- \letvalue{#1}\globalredefinedframed}
-
-%D \startbuffer
-%D \setupframed [framecolor=yellow] \framed{A}
-%D \defineframed[myframed] [framecolor=blue] \myframed{B}
-%D \setupframed [myframed] [framecolor=red] \myframed{C}
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-%D
-%D \startbuffer
-%D \presetlocalframed[myframed]
-%D \setuplocalframed[myframed][width=4cm,height=2cm]
-%D \localframed[myframed][framecolor=green]{oeps}
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-
-%D \macros
-%D {ifinframed}
-%D
-%D The normal case first presets all parameters and next starts
-%D looking for the user supplied ones. The first step is
-%D omitted in the local case, because these are preset at
-%D declaration time and keep their values unless explictly
-%D changed. By presetting the variables everytime the normal
-%D command is called, we can use this command nested, without
-%D the unwanted side effect of inheritance. The boolean is
-%D used to speed up the color stack.
-
-\newif\ifinframed
-
-\def\localframed
- {\bgroup
- \dodoubleempty\startlocalframed}
-
-%D The next one is faster on multiple backgrounds per page. No
-%D dimensions can be set, only frames and backgrounds.
-
-\def\fastlocalframed[#1]#2[#3]#4% 3-4
- {\bgroup
- \inframedtrue
- \edef\@@framed{#1}%
- % more bytes
- % \scratchdimen\framedparameter\c!frameoffset
- % \setevalue{\@@framed\c!frameoffset}{\the\scratchdimen}%
- % \doifnotvalue{\@@framed\c!backgroundoffset}\v!frame
- % {\scratchdimen\framedparameter\c!backgroundoffset
- % \setevalue{\@@framed\c!backgroundoffset}{\the\scratchdimen}}%
- % less bytes
- \@EA\freezedimenmacro\csname\@@framed\c!frameoffset\endcsname
- \doifnotvalue{\@@framed\c!backgroundoffset}\v!frame
- {\@EA\freezedimenmacro\csname\@@framed\c!backgroundoffset\endcsname}%
- % so far
- \setbox\framebox\hbox{#4}%
- \getparameters[\@@framed][#3]% no \expanded !
- % no, better in calling macro
- %
- % \edef\doframedsetups{\framedparameter\c!setups}%
- % \ifx\doframedsetups\empty\else
- % \edef\doframedsetups{\noexpand\setups[\doframedsetups]}%
- % \fi
- \removeframedboxdepth
- \edef\framedforegroundcolor{\framedparameter\c!foregroundcolor}%
- \ifx\framedforegroundcolor\empty\else\docolorframebox\fi
- \edef\overlaylinecolor{\framedparameter\c!framecolor}%
- \def \overlaylinewidth{\the\ruledlinewidth}% no edef
- \edef\@@localframing {\framedparameter\c!frame}%
- \ifx\@@localframing\v!overlay \else \ifx\@@localframing\v!none \else
- \edef\framedrulethickness{\framedparameter\c!rulethickness}%
- \ifx\framedrulethickness\empty\else
- \ruledlinewidth\framedrulethickness\relax
- \ifinheritruledlinewidth\linewidth\ruledlinewidth\fi
- \fi
- \dooutlinebox % real or invisible frame
- \fi \fi
- \edef\framedbackground{\framedparameter\c!background}%
- \ifx\framedbackground\empty\else\dobackedbox\fi
- \restoreframedboxdepth
- \box\framebox
- \egroup}
-
-%D Before we go into details, we present (and implement) the
-%D main framing routine. I saw no real reason for splitting the
-%D next two macros into smaller pieces. The content will be
-%D collected in a horizontal or vertical box with fixed or free
-%D dimensions and specific settings concerning aligment and
-%D offsets.
-%D
-%D In the first few lines, we pre||expand the frame and
-%D background offsets. We do so, because the can be defined in
-%D terms of the main offset. However, see for instance page
-%D backgrounds, when \type {#2} sets the offset to \type
-%D {overlay}, both offsets become invalid.
-%D
-%D Because it is used so often the he next macro is (and
-%D looks) rather optimized.
-
-\let\postprocessframebox\relax
-
-\let\@@framed\s!unknown
-
-\def\framedparameter#1%
- {\csname\@@framed#1\endcsname}
-
-\newdimen\!!framedwidth
-\newdimen\!!framedheight
-
-\def\startlocalframed[#1][#2]%
- {\bgroup
- \inframedtrue
- \edef\@@framed{#1}%
- % this piece of pre expansion is needed (sometimes used in frameoffset)
- % \doifvaluesomething{\@@framed\c!rulethickness} % obsolete
- % {\ruledlinewidth\getvalue{\@@framed\c!rulethickness}}% obsolete
- % this piece of pre expansion is needed (sometimes used circular)
- \setevalue{\@@framed\c!frameoffset}{\the\dimexpr\framedparameter\c!frameoffset\relax}%
- \doifnotvalue{\@@framed\c!backgroundoffset}\v!frame
- {\setevalue{\@@framed\c!backgroundoffset}{\the\dimexpr\framedparameter\c!backgroundoffset\relax}}%
- % to prevent deadlock in case of self refering
- \ifsecondargument % faster
- \getparameters[\@@framed][#2]% here !
- \fi
- % new, experimental dirty hook
- \framedparameter\c!extras
- % to get the right spacing
- \doifvaluesomething{\@@framed\c!foregroundstyle}
- {\@EA\doconvertfont\csname\@@framed\c!foregroundstyle\endcsname\empty}%
- % beware, both the frame and background offset can be overruled
- %
- \edef\doframedsetups{\framedparameter\c!setups}%
- \ifx\doframedsetups\empty\else
- \edef\doframedsetups{\noexpand\setups[\doframedsetups]}%
- \fi
- % the next macros are visible
- \edef\localoffset{\framedparameter\c!offset}%
- \edef\localwidth {\framedparameter\c!width}%
- \edef\localheight{\framedparameter\c!height}%
- \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
- \else\ifx\@@localframing\v!none % no frame, no framewidth
- \boxhasframefalse
- \else
- \boxhasframetrue
- \fi\fi
- \ifboxhasframe
- \edef\framedrulethickness{\framedparameter\c!rulethickness}%
- \ifx\framedrulethickness\empty\else
- \ruledlinewidth\framedrulethickness\relax
- \ifinheritruledlinewidth\linewidth\ruledlinewidth\fi
- \fi
- \else
- \ruledlinewidth\zeropoint
- \fi
- \ifx\localformat\empty
- \boxhasformatfalse
- \else
- \boxhasformattrue
- \dosetraggedcommand\localformat
- \edef\dobeforeframedbox{\raggedtopcommand\framedparameter\c!top}%
- \edef\doafterframedbox {\framedparameter\c!bottom\raggedbottomcommand}%
- \fi
- \ifx\localoffset\v!none
- \boxhasoffsetfalse
- \boxhasstrutfalse
- \boxisoverlaidfalse
- \@@localoffset\ruledlinewidth
- \else\ifx\localoffset\v!overlay
- % \ifx\@@localframing\v!no \boxhasframefalse \fi % test first
- \boxhasoffsetfalse
- \boxhasstrutfalse
- \boxisoverlaidtrue
- \@@localoffset\zeropoint
- \else
- \boxhasoffsettrue
- \boxhasstruttrue
- \boxisoverlaidfalse
- \ifx\localoffset\v!default % new per 2-6-2000
- \let\localoffset\defaultframeoffset
- \letvalue{\@@framed\c!offset}\defaultframeoffset
- \else
- \let\defaultframeoffset\localoffset
- \fi
- \@@localoffset\dimexpr\localoffset+\ruledlinewidth\relax
- \fi\fi
- \!!framedheight\zeropoint
- \!!framedwidth \zeropoint
- \ifx\localwidth\v!fit
- \ifboxhasformat
- \boxhaswidthtrue
- \!!framedwidth\hsize
- \else
- \boxhaswidthfalse
- \fi
- \else\ifx\localwidth\v!fixed % equals \v!fit but no shapebox
- \ifboxhasformat
- \boxhaswidthtrue
- \!!framedwidth\hsize
- \else
- \boxhaswidthfalse
- \fi
- \else\ifx\localwidth\v!broad
- \boxhaswidthtrue
- \!!framedwidth\hsize
- \else\ifx\localwidth\v!local
- \boxhaswidthtrue
- \setlocalhsize
- \!!framedwidth\localhsize
- \else
- \boxhaswidthtrue
- \!!framedwidth\localwidth
- \fi\fi\fi\fi
- \ifx\localheight\v!fit
- \boxhasheightfalse % no longer: \boxhasstrutfalse
- \else\ifx\localheight\v!broad
- \boxhasheightfalse
- \else
- \boxhasheighttrue
- \!!framedheight\localheight
- \fi\fi
- \ifboxhasheight
- % obey user set height, also downward compatible
- \else
- \doifvaluesomething{\@@framed\c!lines}
- {\ifcase\framedparameter\c!lines\else
- \!!framedheight\framedparameter\c!lines\lineheight
- \edef\localheight{\the\!!framedheight}%
- \boxhasheighttrue
- \fi}%
- \fi
- % this is now an option: width=local
- %
- % \ifdim\!!framedwidth=\hsize
- % \parindent\zeropoint
- % \setlocalhsize
- % \!!framedwidth\localhsize
- % \fi
- % i.e. disable (colsetbackgroundproblemintechniek)
- \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
- \setstrut
- \fi\fi\fi
- \ifboxhasstrut
- \let\localbegstrut\begstrut
- \let\localendstrut\endstrut
- \let\localstrut \strut
- \else
- \let\localbegstrut\pseudobegstrut % was: \relax
- \let\localendstrut\pseudoendstrut % was: \relax
- \let\localstrut \pseudostrut % was: \relax
- %\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
- \let\hairline\vboxedhairline
- \ifboxhasformat
- \let\next\doformatboxSomeFormat
- \else
- \let\next\doformatboxNoFormat
- \fi
- \else
- \let\hairline\hboxedhairline
- \ifboxhasformat
- \let\next\doformatboxHeight
- \else
- \let\next\doformatboxVSize
- \fi
- \fi
- \else
- \ifboxhaswidth
- \ifboxhasformat
- \let\hairline\vboxedhairline
- \let\\\vboxednewline
- \let\next\doformatboxWidth
- \else
- \let\hairline\hboxedhairline
- \let\\\hboxednewline
- \let\next\doformatboxHSize
- \fi
- \else
- \let\hairline\hboxedhairline
- \let\\\hboxednewline
- \let\next\doformatboxNoSize
- \fi
- \fi
- \edef\framedwidth % a new feature, visible for user
- {\ifdim\!!framedwidth >\zeropoint\the\!!framedwidth \else\zeropoint\fi}%
- \edef\framedheight% a new feature, visible for user
- {\ifdim\!!framedheight>\zeropoint\the\!!framedheight\else\zeropoint\fi}%
- % we need to register the (outer) color
- \startregistercolor[\framedparameter\c!foregroundcolor]%
- % first alternative
- %\def\dowithframedbox%
- % {\let\postprocessframebox\relax %new
- % \aftergroup\stoplocalframed}%
- % \afterassignment\dowithframedbox
- % \setbox\framebox=\next}
- % second alternative
- %\dowithnextbox
- % {\setbox\framebox\flushnextbox
- % \let\postprocessframebox\relax %new
- % \stoplocalframed}
- % \next}
- \@@startframedorientation
- \afterassignment\dodowithframebox
- \setbox\framebox\next}
-
-\def\dowithframebox
- {% moved : \let\postprocessframebox\relax
- \stoplocalframed}
-
-\def\dodowithframebox
- {\aftergroup\dowithframebox}
-
-\let\doafterframedbox \relax
-\let\dobeforeframedbox\relax
-
-%D Carefull analysis of this macro will learn us that not all
-%D branches in the last conditionals can be encountered, that
-%D is, some assignments to \type{\next} will never occur.
-%D Nevertheless we implement the whole scheme, if not for
-%D future extensions.
-
-%D \macros
-%D {ifreshapeframebox}
-%D
-%D The last few lines tell what to do after the content of the
-%D box is collected and passed to the next macro. In the case
-%D of a fixed width and centered alignment, the content is
-%D evaluated and used to determine the most natural width. The
-%D rest of the code deals with backgrounds and frames.
-
-\newif\ifreshapeframebox \reshapeframeboxtrue
-
-%D Beware: setting \type {top} and \type {bottom} to nothing, may
-%D result in a frame that is larger that the given height! try:
-%D
-%D \starttyping
-%D \framed
-%D [height=3cm,top=,bottom=,offset=overlay]
-%D {\strut test \shapefill \strut test}
-%D \stoptyping
-%D
-%D This is intended behaviour and not a bug! One can always set
-%D
-%D \starttyping
-%D ...,bottom=\kern0pt,...
-%D \stoptyping
-
-\def\stoplocalframed
- {\dontshowcomposition
- \@@stopframedorientation % hm, wrong place ! should rotate the result (after reshape)
- \stopregistercolor
- \handleframedlocator\c!before\@@locallocation
- \ifboxhasformat
- \ifx\@@localautowidth\v!force
- \ifreshapeframebox\doreshapeframedbox\fi
- \boxhaswidthfalse
- \else
- \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\!!framedwidth
- \fi
- \ifboxhasheight
- \ht\framebox\!!framedheight
- \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}%
- \edef\framedforegroundcolor{\framedparameter\c!foregroundcolor}%
- \ifx\framedforegroundcolor\empty\else\docolorframebox\fi
- \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
- \dooutlinebox
- \fi
- \edef\framedbackground{\framedparameter\c!background}%
- \ifx\framedbackground\empty\else\dobackedbox\fi
- \handleframedlocator\c!after\@@locallocation
- \box\framebox
- \egroup
- \egroup}
-
-\def\installframedlocator#1#2#3%
- {\setvalue{\??ol:\c!location:\c!before:#1}{#2}%
- \setvalue{\??ol:\c!location:\c!after :#1}{#3}}
-
-\def\handleframedlocator#1#2%
- {\getvalue{\??ol:\c!location:#1:#2}}
-
-\def\doprelocframedbox#1%
- {\scratchdimen\dimexpr#1+\ruledlinewidth\relax
- \ifboxhasoffset
- \advance\scratchdimen \framedparameter\c!offset
- \fi
- \scratchskip\dimexpr\ht\framebox-\scratchdimen\relax}
-
-% \ruledhbox
-% {A
-% \framed[width=2cm,align=middle,location=hanging]{location\\equals\\hanging}
-% \framed[width=2cm,align=middle,location=depth] {location\\equals\\depth}
-% \framed[width=2cm,align=middle,location=height] {location\\equals\\height}
-% B}
-% \vskip2cm
-% \ruledhbox
-% {A
-% \framed[width=2cm,align=middle,location=low] {location\\equals\\low}
-% \framed[width=2cm,align=middle,location=line] {location\\equals\\line}
-% \framed[width=2cm,align=middle,location=high] {location\\equals\\high}
-% B}
-% \vskip2cm
-% \ruledhbox
-% {A
-% \framed[width=2cm,align=middle,location=top] {location\\equals\\top}
-% \framed[width=2cm,align=middle,location=bottom] {location\\equals\\bottom}
-% \framed[width=2cm,align=middle,location=lohi] {location\\equals\\lohi}
-% \framed[width=2cm,align=middle,location=middle] {location\\equals\\middle}
-% B}
-
-\installframedlocator \v!hanging % best with strut=no
- {}
- {\dp\framebox\ht\framebox
- \ht\framebox\zeropoint}
-
-\installframedlocator \v!depth
- {}
- {\ht\framebox\dimexpr\ht\framebox-\strutdp\relax
- \dp\framebox\strutdp
- \box\framebox}
-
-\installframedlocator \v!height
- {}
- {\dp\framebox\dimexpr\ht\framebox-\strutht\relax
- \ht\framebox\strutht
- \box\framebox}
-
-\installframedlocator \v!high
- {}
- {\doprelocframedbox\strutht
- \setbox\framebox\hbox{\lower\scratchskip\box\framebox}%
- \ht\framebox\strutht
- \dp\framebox\strutdp
- \hbox{\box\framebox}}
-
-\installframedlocator \v!line
- {}
- {\setbox\framebox\hbox{\lower.5\ht\framebox\box\framebox}%
- \ht\framebox.5\lineheight
- \dp\framebox.5\lineheight
- \hbox{\box\framebox}}
-
-\installframedlocator \v!low
- {}
- {\doprelocframedbox\strutdp
- \setbox\framebox\hbox{\lower\scratchdimen\box\framebox}%
- \ht\framebox\strutht
- \dp\framebox\strutdp
- \box\framebox}
-
-\installframedlocator \v!top
- {}
- {\doprelocframedbox\strutht
- \setbox\framebox\hbox{\lower\scratchskip\box\framebox}%
- \ht\framebox\scratchdimen
- \dp\framebox\scratchskip
- \hbox{\box\framebox}}
-
-\installframedlocator \v!middle
- {}
- {\scratchdimen.5\ht\framebox
- \setbox\framebox\hbox{\lower\scratchdimen\box\framebox}%
- \ht\framebox\scratchdimen
- \dp\framebox\scratchdimen
- \hbox{\box\framebox}}
-
-\installframedlocator \v!lohi
- {\handleframedlocator\c!before\v!middle}
- {\handleframedlocator\c!after \v!middle}
-
-\installframedlocator \v!bottom
- {}
- {\doprelocframedbox\strutdp
- \setbox\framebox\hbox{\lower\scratchdimen\box\framebox}%
- \ht\framebox\scratchskip
- \dp\framebox\scratchdimen
- \hbox{\box\framebox}}
-
-\installframedlocator \v!keep % retains height/depth
- {\removeframedboxdepth}
- {\restoreframedboxdepth}
-
-% also used in fastlocalframed
-
-\newdimen\originalframedwd
-\newdimen\originalframedht
-\newdimen\originalframeddp
-
-\def\removeframedboxdepth
- {\originalframedwd\wd\framebox
- \originalframedht\ht\framebox
- \originalframeddp\dp\framebox
- \ifzeropt\originalframeddp\else\setbox\framebox\hbox{\raise\originalframeddp\box\framebox}\fi
- \wd\framebox\originalframedwd
- \ht\framebox\dimexpr\originalframedht+\originalframeddp\relax
- \dp\framebox\zeropoint}
-
-\def\restoreframedboxdepth
- {\ifzeropt\originalframeddp\else\setbox\framebox\hbox{\lower\originalframeddp\box\framebox}\fi
- \wd\framebox\originalframedwd
- \ht\framebox\originalframedht
- \dp\framebox\originalframeddp}
-
-% \let\@@startframedorientation\relax
-% \let\@@stopframedorientation \relax
-
-% \framed[width=12cm,height=3cm,orientation=0]{\input ward\relax}
-% \framed[width=12cm,height=3cm,orientation=90]{\input ward\relax}
-% \framed[width=12cm,height=3cm,orientation=180]{\input ward\relax}
-% \framed[width=12cm,height=3cm,orientation=270]{\input ward\relax}
-% \framed[width=12cm,height=3cm,orientation=-90]{\input ward\relax}
-% \framed[width=12cm,height=3cm,orientation=-180]{\input ward\relax}
-% \framed[width=12cm,height=3cm,orientation=-270]{\input ward\relax}
-
-\def\@@startframedorientation
- {\let\@@stopframedorientation \relax
- \ifx\@@localorientation\empty\else
- \ifcase\@@localorientation\else
- \scratchcounter\@@localorientation
- \divide\scratchcounter\plustwo
- \ifodd\scratchcounter
- \swapmacros\framedwidth \framedheight
- \swapmacros\localwidth \localheight
- \swapdimens\!!framedheight\!!framedwidth
- \def\@@stopframedorientation{\@@dostopframedorientation\plusone}%
- \else
- \def\@@stopframedorientation{\@@dostopframedorientation\zerocount}%
- \fi
- \fi
- \fi}
-
-\def\@@dostopframedorientation#1%
- {\ifcase#1\else
- \swapmacros\framedwidth \framedheight
- \swapmacros\localwidth \localheight
- \swapdimens\!!framedheight\!!framedwidth
- \fi
- \setbox\framebox\hbox{\dorotatebox\@@localorientation\hbox{\box\framebox}}}
-
-%D The last conditional takes care of the special situation of
-%D in||line \inframed[height=3cm]{framed} boxes. Such boxes have
-%D to be \inframed{aligned} with the running text.
-
-\def\doinframed[#1]% we could omit #1] but readibility ...
- {\framed[\c!location=\v!low,#1]}
-
-\unexpanded\def\inframed
- {\dosingleempty\doinframed}
-
-%D When we set \type{empty} to \type{yes}, we get
-%D ourselves a frame and/or background, but no content, so
-%D actually we have a sort of phantom framed box.
-
-%D Because color marks and specials can interfere with
-%D spacing, we provide a way to specify a foregroundcolor.
-
-\def\docolorframebox
- {\doifvaluesomething{\@@framed\c!foregroundcolor}
- {\doifcolorelse{\framedparameter\c!foregroundcolor}
- {\setbox\framebox\hbox
- {\localcolortrue
- \color[\framedparameter\c!foregroundcolor]{\box\framebox}}}
- {}}}
-
-%D \macros
-%D {mframed, minframed}
-%D
-%D When Tobias asked how to frame mathematical elements in
-%D formulas, Taco's posted the next macro:
-%D
-%D \starttyping
-%D \def\mframed#1%
-%D {\relax
-%D \ifmmode
-%D \vcenter{\hbox{\framed{$\ifinner\else\displaystyle\fi#1$}}}%
-%D \else
-%D \framed{$#1$}%
-%D \fi}
-%D \stoptyping
-%D
-%D Because \type {\ifinner} does not (always) reports what
-%D one would expect, we move the test to the outer level. We
-%D also want to pass arguments,
-%D
-%D \starttyping
-%D \def\mframed%
-%D {\dosingleempty\domframed}
-%D
-%D \def\domframed[#1]#2% % tzt \dowithnextmathbox ?
-%D {\relax
-%D \ifmmode
-%D \ifinner
-%D \inframed[#1]{$#2$}%
-%D \else
-%D \vcenter{\hbox{\framed[#1]{$\displaystyle#2$}}}%
-%D \fi
-%D \else
-%D \inframed[#1]{$#2$}%
-%D \fi}
-%D \stoptyping
-%D
-%D Still better is the next alternative, if only because it
-%D takes care of setting the super- and subscripts styles
-
-\ifx\restoremathstyle\undefined \let\restoremathstyle\relax \fi
-
-\def\domframed[#1][#2]#3%
- {\begingroup
- \ifmmode
- \ifinner
- \let\mframedstyle\restoremathstyle
- \else
- \let\mframedstyle\displaystyle
- \fi
- \else
- \let\mframedstyle\restoremathstyle
- \fi
- #1\ifdone
- \def\normalstrut{$\mframedstyle\vphantom($}%
- \framed
- [\c!frameoffset=\@@oioffset,\c!offset=\v!overlay,#2]
- {$\mframedstyle#3$}%
- \else
- \inframed
- [#2]
- {$\mframedstyle#3$}%
- \fi
- \endgroup}
-
-\def\mframed
- {\dodoubleempty\domframed[\donetrue]}
-
-\def\inmframed
- {\dodoubleempty\domframed[\donefalse]}
-
-%D So instead of the rather versatile \type {\framed}, we ue
-%D the \type {\mframed}.
-%D
-%D \startbuffer
-%D \startformula
-%D x \times \mframed{y} \times y^{z_z}
-%D x \times \inmframed{y} \times y^{z_z}
-%D \stopformula
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \getbuffer
-%D
-%D However, we got into troubles when we want to nest sub- and
-%D superscripts, like in
-%D
-%D \startbuffer
-%D \startformula
-%D x \times \mframed{y} \times y^{\mframed{z}_{\mframed{z}}}
-%D \stopformula
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \getbuffer
-%D
-%D Therefore, we can best use \type {\super} and \type {\suber}
-%D instead of \type {^} and \type {_}. Both commands take care
-%D of proper font switching.
-%D
-%D \startbuffer
-%D \startformula
-%D x \times \mframed{y} \times y\super{\mframed{z}\suber{\mframed{z}}}
-%D \stopformula
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \getbuffer
-%D
-%D As usual, one can specify in what way the text should be
-%D framed. One should be aware of the fact that, inorder to
-%D preserve the proper spacing, the \type {offset} is set to
-%D \type {overlay} and \type {frameoffset} is used used
-%D instead.
-%D
-%D \startbuffer
-%D \startformula
-%D x \times y\super{\mframed[framecolor=red]{z}\suber{z}}
-%D \stopformula
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \getbuffer
-%D
-%D For inline use, we also provide the \type {\inmframed}
-%D alternative: we want $x \times \inmframed{y}$ in inline
-%D math, right?
-
-%D This previous framing macros needs a lot of alternatives for
-%D putting rules around boxes, inserting offsets and aligning
-%D text. Each step is handled by separate macros.
-
-\def\dowidenframebox#1%
- {\setbox\framebox\vbox
- {\kern#1\hbox{\kern#1\box\framebox\kern#1}\kern#1}}
-
-\def\dooffsetframebox{\dowidenframebox\localoffset}
-\def\dolocateframebox{\dowidenframebox\ruledlinewidth}
-
-%D Let's hope that the next few examples show us enough of
-%D what needs to be done by the auxiliary macros.
-%D
-%D \startbuffer
-%D \framed[height=1cm,offset=.5cm] {rule based learning}
-%D \framed[height=1cm,offset=0cm] {rule based learning}
-%D \framed[height=1cm,offset=none] {rule based learning}
-%D \framed[height=1cm,offset=overlay]{rule based learning}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \startlinecorrection
-%D \hbox{\getbuffer}
-%D \stoplinecorrection
-%D
-%D \startbuffer
-%D \framed[offset=.5cm] {rule based learning}
-%D \framed[offset=0cm] {rule based learning}
-%D \framed[offset=none] {rule based learning}
-%D \framed[offset=overlay]{rule based learning}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \startlinecorrection
-%D \hbox{\getbuffer}
-%D \stoplinecorrection
-%D
-%D \startbuffer
-%D \framed[strut=nee,offset=.5cm] {rule based learning}
-%D \framed[strut=nee,offset=0cm] {rule based learning}
-%D \framed[strut=nee,offset=none] {rule based learning}
-%D \framed[strut=nee,offset=overlay]{rule based learning}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \startlinecorrection
-%D \hbox{\getbuffer}
-%D \stoplinecorrection
-%D
-%D \startbuffer
-%D \framed[width=3cm,align=left] {rule\\based\\learning}
-%D \framed[width=3cm,align=middle] {rule\\based\\learning}
-%D \framed[width=3cm,align=right] {rule\\based\\learning}
-%D \framed[width=fit,align=middle] {rule\\based\\learning}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \startlinecorrection
-%D \hbox{\dontcomplain\getbuffer}
-%D \stoplinecorrection
-%D
-%D So now we're ready for the complicated stuff. We distinguish
-%D between borders with straight lines and those with round
-%D corners. When using the first alternative it is possible to
-%D turn off one or more lines. More fancy shapes are also
-%D possible by specifying dedicated backgrounds. Turning lines
-%D on and off is implemented as efficient as possible and as a
-%D result is interface language dependant. This next
-%D implementation evolved from simpler ones. It puts for
-%D instance the rules on top of the content and provides
-%D additional offset capabilities. The lot of calls to other
-%D macros makes this mechanism not that easy to comprehend.
-
-%D Getting the backgrounds right takes less code. Again we
-%D have to take care of additional offsets.
-
-\def\dobackedbox
- {\doifelsevalue{\@@framed\c!backgroundoffset}\v!frame % new
- {\dobackgroundbox\c!frameoffset}
- {\dobackgroundbox\c!backgroundoffset}}
-
-%D We handle left, right or middle alignment as well as fixed
-%D or free widths and heights. Each combination gets its own
-%D macro.
-
-%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 \!!framedheight
- \bgroup
- \let\postprocessframebox\relax
- \forgetall
- \oninterlineskip
- \hsize\!!framedwidth
- \vsize\!!framedheight
- \doframedsetups
- \raggedcommand
- \dobeforeframedbox
- \bgroup
- \localbegstrut
- \aftergroup\localendstrut
- \aftergroup\doafterframedbox
- \aftergroup\egroup
- \doformatonelinerbox}
-
-\def\doformatboxNoFormat
- {\vbox to \!!framedheight
- \bgroup
- \let\postprocessframebox\relax
- \forgetall
- \oninterlineskip
- \hsize\!!framedwidth
- \vsize\!!framedheight
- \doframedsetups
- \raggedcenter
- \vss
- \bgroup
- \localbegstrut
- \aftergroup\localendstrut
- \aftergroup\vss
- \aftergroup\egroup
- \doformatonelinerbox}
-
-\def\doformatboxHeight
- {\vbox to \!!framedheight
- \bgroup
- \let\postprocessframebox\relax
- \forgetall
- \oninterlineskip
- \doframedsetups
- \raggedcommand
- \vss
- \bgroup
- \aftergroup\localendstrut
- \aftergroup\vss
- \aftergroup\egroup
- \localbegstrut
- \doformatonelinerbox}
-
-\def\doformatboxWidth
- {\vbox
- \bgroup
- \let\postprocessframebox\relax
- \forgetall
- \oninterlineskip
- \hsize\!!framedwidth
- \doframedsetups
- \raggedcommand
- \dobeforeframedbox
- \bgroup
- \localbegstrut
- \aftergroup\localendstrut
- \aftergroup\doafterframedbox
- \aftergroup\egroup
- \doformatonelinerbox}
-
-\def\doformatboxVSize
- {\vbox to \!!framedheight
- \bgroup
- \let\postprocessframebox\relax
- \forgetall
- \vsize\!!framedheight
- \doframedsetups
- \vss
- \bgroup
- \aftergroup\vss
- \aftergroup\egroup
- \hbox
- \bgroup
- \aftergroup\egroup
- \localstrut
- \doformatonelinerbox}
-
-\def\doformatboxHSize
- {\hbox to \!!framedwidth
- \bgroup
- \let\postprocessframebox\relax
- \forgetall
- \doframedsetups
- \hss
- \localstrut
- \bgroup
- \aftergroup\hss
- \aftergroup\egroup
- \doformatonelinerbox}
-
-\def\doformatboxNoSize
- {\hbox
- \bgroup
- \let\postprocessframebox\relax
- \doframedsetups
- \localstrut
- \doformatonelinerbox}
-
-\let\doframedsetups\relax
-
-%D On the next page we show some examples of how these macros
-%D come into action. The examples show us how
-%D \type {fit}, \type {broad} dimensions influence the
-%D formatting. Watch the visualized struts. \footnote {Here we
-%D used \type {\showstruts}.}
-%D
-%D \startpostponing
-%D \bgroup
-%D \showstruts
-%D \dontcomplain
-%D \startlinecorrection
-%D \halign{#\enskip&#\enskip&#\enskip&#\enskip&#\enskip&#\cr
-%D \framed[width=.2\hsize, height=.2\hsize, align=] {a\par b\par c}&
-%D \framed[width=.2\hsize, height=broad, align=] {a\par b\par c}&
-%D \framed[width=.2\hsize, height=fit, align=] {a\par b\par c}&
-%D \framed[width=fit, height=.2\hsize, align=] {a\par b\par c}&
-%D \framed[width=fit, height=broad, align=] {a\par b\par c}&
-%D \framed[width=fit, height=fit, align=] {a\par b\par c}\cr
-%D \noalign{\vskip1em}
-%D \framed[width=.2\hsize, height=.2\hsize, align=yes] {a\par b\par c}&
-%D \framed[width=.2\hsize, height=broad, align=yes] {a\par b\par c}&
-%D \framed[width=.2\hsize, height=fit, align=yes] {a\par b\par c}&
-%D \framed[width=fit, height=.2\hsize, align=yes] {a\par b\par c}&
-%D \framed[width=fit, height=broad, align=yes] {a\par b\par c}&
-%D \framed[width=fit, height=fit, align=yes] {a\par b\par c}\cr
-%D \noalign{\vskip1em}
-%D \framed[width=.2\hsize, height=.2\hsize, align=right] {a\par b\par c}&
-%D \framed[width=.2\hsize, height=broad, align=right] {a\par b\par c}&
-%D \framed[width=.2\hsize, height=fit, align=right] {a\par b\par c}&
-%D \framed[width=fit, height=.2\hsize, align=right] {a\par b\par c}&
-%D \framed[width=fit, height=broad, align=right] {a\par b\par c}&
-%D \framed[width=fit, height=fit, align=right] {a\par b\par c}\cr
-%D \noalign{\vskip1em}
-%D \framed[width=.2\hsize, height=.2\hsize, align=left] {a\par b\par c}&
-%D \framed[width=.2\hsize, height=broad, align=left] {a\par b\par c}&
-%D \framed[width=.2\hsize, height=fit, align=left] {a\par b\par c}&
-%D \framed[width=fit, height=.2\hsize, align=left] {a\par b\par c}&
-%D \framed[width=fit, height=broad, align=left] {a\par b\par c}&
-%D \framed[width=fit, height=fit, align=left] {a\par b\par c}\cr
-%D \noalign{\vskip1em}
-%D \framed[width=.2\hsize, height=.2\hsize, align=middle] {a\par b\par c}&
-%D \framed[width=.2\hsize, height=broad, align=middle] {a\par b\par c}&
-%D \framed[width=.2\hsize, height=fit, align=middle] {a\par b\par c}&
-%D \framed[width=fit, height=.2\hsize, align=middle] {a\par b\par c}&
-%D \framed[width=fit, height=broad, align=middle] {a\par b\par c}&
-%D \framed[width=fit, height=fit, align=middle] {a\par b\par c}\cr}
-%D \stoplinecorrection
-%D \blank[2*big]
-%D \egroup
-%D \stoppostponing
-
-%D \macros
-%D {framednoflines, framedlastlength}
-%D
-%D It is possible to let the frame macro calculate the width
-%D of a centered box automatically (\type {fit}). When
-%D doing so, we need to reshape the box:
-
-% The next implementation is frozen! It preserves the depth,
-% otherwise we get problems with framed display math and auto
-% width.
-
-\newcount\framednoflines
-\newdimen\framedlastlength
-
-\def\resetshapeframebox
- {\framednoflines \zerocount
- \framedlastlength\zeropoint}
-
-\chardef\reshapeframeboxmethod\plusone % 0=no flush, 1=old method 2=no depth messing
-
-\def\shapeboxstrut % put this in front if needed !
- {\vrule\!!width\zeropoint\!!height\ht\shapebox\!!depth\dp\shapebox}
-
-\let\framedboxwidth \!!zeropoint
-\let\framedboxheight\!!zeropoint
-\let\framedboxdepth \!!zeropoint
-
-\def\doreshapeframedbox % frozen, that is ... \shapeboxstrut added
- {\ifvbox\framebox
- \beginofshapebox
- \unvcopy\framebox
- \endofshapebox
- \global\@@globalwidth\zeropoint
- \edef\framedboxwidth {\the\wd\framebox}%
- \edef\framedboxheight{\the\ht\framebox}%
- \edef\framedboxdepth {\the\dp\framebox}%
- \resetshapeframebox
- \reshapebox
- {\setbox0\hbox
- {\strut\ifhbox\shapebox\shapeboxstrut\unhbox\else\box\fi\shapebox}%
- \global\advance\framednoflines \plusone
- \ifdim\framedlastlength>\zeropoint\else
- \global\framedlastlength\wd0
- \fi
- \ifdim\wd0>\@@globalwidth
- \global\@@globalwidth\wd0
- \fi}%
- \ifreshapingfailed
- % no need for anothr pass or finalizer
- \else
- \dosetraggedcommand\localformat
- \raggedcommand
- \ifboxhasheight
- \setbox\framebox\vbox to \localheight
- {\hsize\@@globalwidth
- \reshapebox{\hbox to \hsize{\ifhbox\shapebox\shapeboxstrut\unhbox\else\box\fi\shapebox}}%
- \dobeforeframedbox
- \innerflushshapebox
- \doafterframedbox}%
- \else
- \setbox\framebox\vbox to \framedboxheight % \ht\framebox
- {\hsize\@@globalwidth
- \reshapebox{\hbox to \hsize{\ifhbox\shapebox\shapeboxstrut\unhbox\else\box\fi\shapebox}}%
- \ifcase\reshapeframeboxmethod
- \or \innerflushshapebox \or \innerflushshapebox
- \fi}%
- \ifcase\reshapeframeboxmethod \or
- \dp\framebox\framedboxdepth % \strutdp otherwise problem with math
- \fi
- \fi
- \ifdim\framedlastlength=\zeropoint\global\framedlastlength\wd\framebox\fi
- \ifcase\framednoflines\global\framednoflines\plusone\fi
- \fi
- \fi}
-
-%D The two variables \type {\framednoflines} and \type
-%D {\framedlastlength} can be used in a second pass to
-%D optimized framed material.
-
-% torture test / strange case (much depth) / method 2 needed
-%
-% \startTEXpage[frame=on]
-% \startformula \startalign \NC A \NC B \NR \intertext{test} \NC C \NC D \NR \stopalign \stopformula
-% test outside formula
-% \startformula \startalign \NC A \NC B \NR \intertext{test} \NC C \NC D \NR \stopalign \stopformula
-% \blank[big]
-% \startformula \startalign \NC \int_01 \NC B \NR \intertext{test} \NC \int_01 \NC D \NR \stopalign \stopformula
-% test outside formula
-% \startformula \startalign \NC \int_01 \NC B \NR \intertext{test} \NC \int_01 \NC D \NR \stopalign \stopformula
-% \stopTEXpage
-
-%D The examples on the next page show how one can give the
-%D frame as well as the background an additional offset and
-%D even a bit more depth. The blue outline is the frame, the
-%D red box is the background and the small black outline is the
-%D visualization of the resulting box, that is, we applied
-%D \type{\ruledhbox} to the result.
-
-%D \startpostponing
-%D \bgroup
-%D \unprotect
-%D \dontcomplain
-%D
-%D \startbuffer
-%D \vbox to \vsize
-%D \bgroup
-%D \startalignment[middle]
-%D \vss
-%D \dontleavehmode\vbox to .8\vsize
-%D \bgroup
-%D \hsize=300pt
-%D \setupframed
-%D [background=color,
-%D backgroundcolorachtergrondkleur=darkred,
-%D width=300pt,
-%D height=60pt,
-%D framecolorkaderkleur=DemoBlue,
-%D rulethickness=2pt]
-%D \def\status%
-%D {backgroundoffset=\framedparameter\c!backgroundoffset\\
-%D frameoffset=\framedparameter\c!frameoffset\\
-%D depth=\framedparameter\c!depth}
-%D \dontleavehmode \ruledhbox{\framed[backgroundoffset=0pt,frameoffset=0pt]{\status}}
-%D \vss
-%D \dontleavehmode \ruledhbox{\framed[backgroundoffset=5pt,frameoffset=0pt]{\status}}
-%D \vss
-%D \dontleavehmode \ruledhbox{\framed[backgroundoffset=0pt,frameoffset=5pt]{\status}}
-%D \vss
-%D \dontleavehmode \ruledhbox{\framed[backgroundoffset=2pt,frameoffset=5pt]{\status}}
-%D \vss
-%D \dontleavehmode \ruledhbox{\framed[backgroundoffset=5pt,frameoffset=2pt]{\status}}
-%D \vss
-%D \dontleavehmode \ruledhbox{\framed[backgroundoffset=5pt,frameoffset=5pt]{\status}}
-%D \egroup
-%D \vss
-%D \stopalignment
-%D \egroup
-%D \stopbuffer
-%D
-%D \getbuffer \page
-%D
-%D {\setupframed[depth=4pt]\getbuffer} \page
-%D
-%D \protect
-%D \egroup
-%D \stoppostponing
-
-%D When typesetting the framed box inline, we have to keep the
-%D baseline intact outside as well as inside the framed box.
-
-\def\doinlineframedbox
- {\scratchdimen\dimexpr\strutdp+\ruledlinewidth\relax
- \ifboxhasoffset
- \advance\scratchdimen \framedparameter\c!offset
- \fi
- \setbox\framebox\hbox{\lower\scratchdimen\box\framebox}%
- \ht\framebox\strutht
- \dp\framebox\strutdp
- \box\framebox}
-
-%D We can also lower the box over the natural depth of the
-%D line.
-
-\def\doloweredframedbox
- {\ht\framebox\dimexpr\ht\framebox+\dp\framebox-\strutdp\relax
- \dp\framebox\strutdp
- \box\framebox}
-
-%D Hanging the content is mainly meant for cases like the
-%D following:
-%D
-%D \starttyping
-%D \framed[strut=no]
-%D {\framed[height=2cm,location=hanging]{test}%
-%D \framed[height=1cm,location=hanging]{test}}
-%D \stoptyping
-
-\def\dohangingframedbox % best with strut=no
- {\scratchdimen\dimexpr\ht\framebox+\dp\framebox\relax
- \ht\framebox\zeropoint
- \dp\framebox\scratchdimen}
-
-%D We can draw lines from left to right and top to bottom by
-%D using the normal \type{\hairline} command. Both directions
-%D need a different treatment.
-%D
-%D \startbuffer
-%D \framed[width=4cm] {alfa\hairline beta\hairline gamma}
-%D \framed[height=2cm] {alfa\hairline beta\hairline gamma}
-%D \framed[width=4cm,height=2cm]{alfa\hairline beta\hairline gamma}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \startlinecorrection
-%D \hbox{\getbuffer}
-%D \stoplinecorrection
-%D
-%D These macros try to adapt their behaviour as good as
-%D possible to the circumstances and act as natural as
-%D possible.
-
-\def\vboxedhairline
- {\bgroup
- \dimen2=\ifboxhasoffset \localoffset \else \zeropoint \fi
- \dimen4=\dimexpr\dimen2+\ruledlinewidth\relax
- \setbox0\vbox
- {\advance\hsize 2\dimen4
- \vskip\dimen2
- \hrule
- \!!height\ruledlinewidth
- \!!depth\zeropoint
- \!!width\hsize
- \vskip\dimen2}%
- %\endgraf\nointerlineskip\endgraf
- %\moveleft\dimen4\box0
- %\endgraf\nointerlineskip\localbegstrut
- \endgraf\obeydepth\nointerlineskip
- \moveleft\dimen4\box0
- \endgraf\nointerlineskip\localbegstrut % beware, we might kill it in a style using \vskip\lineheight
- \egroup} % so this must not be changed
-
-\def\hboxedhairline % use framed dimen
- {\bgroup
- \dimen2=\ifboxhasoffset \localoffset \else \zeropoint \fi
- \ifboxhasheight
- \dimen4\dimexpr\localheight/2+\strutdp-2\ruledlinewidth\relax
- \dimen6\dimexpr\localheight/2-\strutdp+2\ruledlinewidth\relax
- \else
- \dimen4\dimexpr\strutht+\dimen2\relax
- \dimen6\dimexpr\strutdp+\dimen2\relax
- \fi
- \unskip
- \setbox\scratchbox\hbox
- {\hskip\dimen2
- \vrule\!!height\dimen4\!!depth\dimen6\!!width\ruledlinewidth
- \hskip\dimen2}%
- \ht\scratchbox\strutht
- \dp\scratchbox\strutdp
- \box\scratchbox
- \ignorespaces
- \egroup}
-
-%D The argument of the frame command accepts \type{\\} as a
-%D sort of newline signal. In horizontal boxes it expands to a
-%D space.
-
-\def\vboxednewline
- {\endgraf\ignorespaces}
-
-\def\hboxednewline
- {\unskip\normalspace\ignorespaces}
-
-%D We can set each rule on or off. The default setting is
-%D inherited from \type{frame}. An earlier implementation
-%D use a bit different approach, but the new one seems more
-%D natural:
-%D
-%D \bgroup
-%D \setuptyping[margin=0pt]
-%D \startlinecorrection
-%D \startbuffer
-%D \framed[offset=overlay,frame=on]{\darkred\blackrule}
-%D \stopbuffer
-%D \hbox{\getbuffer\vbox{\typebuffer}}
-%D
-%D \startbuffer
-%D \framed[offset=overlay,frame=on,bottomframe=off]{\darkred\blackrule}
-%D \stopbuffer
-%D \hbox{\getbuffer\vbox{\typebuffer}}
-%D
-%D \startbuffer
-%D \framed[offset=overlay,frame=on,bottomframe=on]{\darkred\blackrule}
-%D \stopbuffer
-%D \hbox{\getbuffer\vbox{\typebuffer}}
-%D
-%D \startbuffer
-%D \framed[offset=overlay,frame=off]{\darkred\blackrule}
-%D \stopbuffer
-%D \hbox{\getbuffer\vbox{\typebuffer}}
-%D
-%D \startbuffer
-%D \framed[offset=overlay,frame=off,bottomframe=off]{\darkred\blackrule}
-%D \stopbuffer
-%D \hbox{\getbuffer\vbox{\typebuffer}}
-%D
-%D \startbuffer
-%D \framed[offset=overlay,frame=off,bottomframe=on]{\darkred\blackrule}
-%D \stopbuffer
-%D \hbox{\getbuffer\vbox{\typebuffer}}
-%D \stoplinecorrection
-%D \egroup
-
-%D \macros
-%D {setupblackrules}
-%D
-%D The graphic capabilities of \TEX\ do not go beyond simple
-%D filled rules, except of course when using specials. Let's
-%D start with a warning: using this commands is far more slower
-%D than using the \TEX\ primitives \type{\hrule} and
-%D \type{\vrule}, but they save us some tokens. The
-%D characteristics of these rule drawing command can be set by:
-%D
-%D \showsetup{setupblackrules}
-
-\def\setupblackrules
- {\dodoubleargument\getparameters[\??bj]}
-
-%D \macros
-%D {blackrule}
-%D
-%D The simple command draws only one rule. Its optional
-%D argument can be used to specify the dimensions. By setting
-%D the width, height or depth to \type {max}, one gets the
-%D natural dimensions.
-%D
-%D \showsetup{blackrule}
-
-\def\doblackrule[#1]%
- {\hbox\bgroup
- \getparameters[\??bj][#1]%
- \setstrut
- \doif\@@bjwidth \v!max{\def\@@bjwidth {1em}}%
- \doif\@@bjheight\v!max{\def\@@bjheight{\strutht}}%
- \doif\@@bjdepth \v!max{\def\@@bjdepth {\strutdp}}%
- \localstartcolor[\@@bjcolor]%
- \vrule
- \!!width \@@bjwidth
- \!!height\@@bjheight
- \!!depth \@@bjdepth
- \localstopcolor
- \egroup}
-
-\unexpanded\def\blackrule
- {\dosingleempty\doblackrule}
-
-%D \macros
-%D {blackrules}
-%D
-%D One can call for a sequence of black rules, if needed
-%D equally spaced over the given width.
-%D
-%D \showsetup{blackrules}
-%D
-%D The two alternative calls are therefore:
-%D
-%D \startbuffer
-%D Tell me, is this according to the \blackrules[n=6]?
-%D These \blackrules[alternativevariant=b,n=10,distance=.2em,width=4cm] are quite clear.
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D or:
-%D
-%D \startvoorbeeld
-%D \startlines
-%D \getbuffer
-%D \stoplines
-%D \stopvoorbeeld
-%D
-%D We could of course have implemented this macro using
-%D \type{\leaders}, but this would probably have taken more
-%D tokens.
-
-\def\doblackrules[#1]%
- {\hbox\bgroup
- \getparameters[\??bj][#1]%
- \!!widtha\@@bjwidth
- \!!widthb\@@bjdistance
- \doif\@@bjalternative\c!b
- {\scratchcounter\@@bjn
- \ifnum\scratchcounter=\plusone
- \!!widthb\zeropoint
- \else
- \advance\scratchcounter \minusone
- \advance\!!widtha -\scratchcounter\!!widthb
- \divide \!!widtha \@@bjn
- \fi}%
- \localstartcolor[\@@bjcolor]%
- \dorecurse\@@bjn
- {\vrule
- \!!width \!!widtha
- \!!height\@@bjheight
- \!!depth \@@bjdepth
- \hskip\!!widthb}%
- \unskip
- \localstopcolor
- \egroup}
-
-\unexpanded\def\blackrules
- {\dosingleempty\doblackrules}
-
-%D The next commands can be used to draw margin rules. We
-%D support two methods: \marginrule{one for in||line use} and
-%D one that acts on a paragraph. Drawing a margin rule is
-%D rather straightforward because we can use the commands that
-%D put text in the margin.
-
-\def\dodrawmarginrule
- {\setbox\scratchbox\hbox
- {\vrule\!!depth\strutdepth\!!height\strutheight\!!width\@@karulethickness}%
- \smashbox\scratchbox % no \vsmash !!!
- \box\scratchbox}
-
-\def\drawmarginrule
- {\strut\inleft{\dodrawmarginrule}}
-
-%D \macros
-%D {marginrule}
-%D
-%D The first method gobbles words and simply puts a bar in the
-%D margin. This method is not entirely robust.
-%D
-%D \showsetup{marginrule}
-
-\definecomplexorsimple\marginrule
-
-\def\simplemarginrule
- {\let\processword\drawmarginrule
- \processwords}
-
-\def\complexmarginrule[#1]%
- {\ifnum#1<\@@kalevel\relax \else
- \def\@@kadefaultwidth{#1}%
- \expandafter\simplemarginrule
- \fi}
-
-%D We need an auxiliary variable
-
-\def\@@kadefaultwidth{1}
-
-%D \macros
-%D {setupmarginrules}
-%D
-%D This macro definitions show us that we can pass an optional
-%D level, which is matched against the previous set one. The
-%D level can be set up with
-%D
-%D \showsetup{setupmarginrules}
-
-\def\setupmarginrules
- {\dodoubleargument\getparameters[\??ka]}
-
-%D \macros
-%D {startmarginrule}
-%D
-%D The second method collects text and reformats it afterwards,
-%D using the shapebox macros. We prevent local margin rules.
-%D
-%D \showsetup{startmarginrule}
-
-\definecomplexorsimple\startmarginrule
-
-\def\simplestartmarginrule
- {\bgroup
- \let\drawmarginrule\relax
- \let\stopmarginrule\dostopmarginrule
- \beginofshapebox}
-
-\def\complexstartmarginrule[#1]%
- {\bgroup
- \let\drawmarginrule\relax
- \ifnum#1<\@@kalevel\relax
- \let\stopmarginrule\egroup
- \else
- \def\@@kadefaultwidth{#1}%
- \let\stopmarginrule\dostopmarginrule
- \expandafter\beginofshapebox
- \fi}
-
-\def\dostopmarginrule
- {\endofshapebox
- \reshapebox
- {\hbox{\inleftmargin{\dodrawmarginrule}\box\shapebox}}%
- \flushshapebox
- \egroup}
-
-%D \startbuffer
-%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
-%D \stopbuffer
-%D
-%D In next example we show most features. Watch the rule
-%D thickness adapting itself to the level.
-%D
-%D \startvoorbeeld
-%D \getbuffer
-%D \stopvoorbeeld
-%D
-%D We just said:
-%D
-%D \typebuffer
-
-%D \macros
-%D {vl, hl}
-%D
-%D The command \type{\vl} draws a vertical rule \vl\ with strut
-%D dimensions, multiplied with the factor specified in the
-%D optional argument. The height and depth are clipped \vl[3]
-%D to the baselinedistance. Its horizontal counterpart
-%D \type{\hl} draws a horizontal rule \hl\ with a width of 1em,
-%D multiplied with the optional factor. The horizontal rule is
-%D drawn on top of the baseline.
-%D
-%D \showsetup{vl}
-%D \showsetup{hl}
-
-\def\complexvl[#1]%
- {\bgroup
- \!!dimena#1\strutht
- \!!dimenb#1\strutdp
- \setbox\scratchbox\hbox
- {\vrule
- \!!width \linewidth
- \!!height\!!dimena
- \!!depth \!!dimenb}%
- \dp\scratchbox\strutdp
- \ht\scratchbox\strutht
- \box\scratchbox
- \egroup}
-
-\def\complexhl[#1]%
- {\hbox
- {\vrule
- \!!width #1\s!em
- \!!height\linewidth
- \!!depth \zeropoint}}
-
-\definecomplexorsimple\vl \def\simplevl{\complexvl[1]}
-\definecomplexorsimple\hl \def\simplehl{\complexhl[1]}
-
-%D \macros
-%D {hairline, thinrule, thinrules, setupthinrules}
-%D
-%D Drawing thin lines can of course easily be accomplished by
-%D the \TEX\ primitives \type{\hrule} and \type{\vrule}. The
-%D next few macros however free us from some specifications.
-%D
-%D \startbuffer
-%D some text
-%D
-%D \hairline
-%D
-%D some more text
-%D
-%D \thinrule
-%D
-%D more and more text
-%D
-%D hi \thinrule\ there
-%D
-%D and then the final text
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D becomes
-%D
-%D \startvoorbeeld
-%D \getbuffer
-%D \stopvoorbeeld
-%D
-%D So we've got
-%D
-%D \showsetup{hairline}
-%D \showsetup{thinrule}
-%D
-%D Both can be set up with:
-%D
-%D \showsetup{setupthinrules}
-%D
-%D We also have
-%D
-%D \showsetup{thinrules}
-%D
-%D which looks like: \thinrules[n=2]
-
-\def\thinrule
- {\strut
- \bgroup
- \chardef\ruletype\plusone
- \processaction
- [\@@dlalternative]
- [ \v!a=>\chardef\ruletype0,% no line
- %\v!b=>\chardef\ruletype1,% height/depth
- \v!c=>\chardef\ruletype2,% topheight/botdepth
- % 11=>\chardef\ruletype1,% fallback for backgrounds
- 0=>\chardef\ruletype0,% compatible with backgrounds
- % 1=>\chardef\ruletype1,% compatible with backgrounds
- 2=>\chardef\ruletype2]% compatible with backgrounds
- \doifsomething\@@dlrulethickness
- {\linewidth\@@dlrulethickness}%
- \ifdim\linewidth=\zeropoint
- \chardef\ruletype\zerocount
- \else
- \doifnot\@@dlframe\v!on{\chardef\ruletype\zerocount}%
- \fi
- \ifnum\ruletype=\plusone
- \doif\@@dlheight\v!max{\let\@@dlheight\!!plusone}%
- \doif\@@dldepth \v!max{\let\@@dldepth \!!plusone}%
- \else
- \let\@@dlheight\!!plusone
- \let\@@dldepth\!!plusone
- \fi
- \freezedimensionwithunit\@@dlheight\strutht
- \freezedimensionwithunit\@@dldepth\strutdp
- \divide\linewidth \plustwo
- \doifelse\@@dlbackground\v!color
- {\startcolor[\@@dlbackgroundcolor]%
- \ifnum\ruletype=\plustwo % prevent overshoot due to rounding
- \leaders
- \hrule
- \!!height\dimexpr\@@dlheight-.5\linewidth\relax
- \!!depth \dimexpr\@@dldepth -.5\linewidth\relax
- \hfill
- \else
- \leaders
- \hrule
- \!!height\@@dlheight
- \!!depth \@@dldepth
- \hfill
- \fi
- \stopcolor
- \ifcase\ruletype
- % no rule
- \or
- \startcolor[\@@dlcolor]%
- \hfillneg
- \leaders\hrule\!!height\linewidth\!!depth\linewidth\hfill
- \stopcolor
- \or
- \startcolor[\@@dlcolor]%
- \hfillneg\leaders\hrule\!!height\dimexpr-\@@dldepth+\linewidth\relax\!!depth\@@dldepth\hfill
- \hfillneg\leaders\hrule\!!height\@@dlheight\!!depth\dimexpr-\@@dlheight+\linewidth\relax\hfill
- \stopcolor
- \fi}
- {\ifcase\ruletype \else
- \startcolor[\@@dlcolor]%
- \leaders\hrule\!!height\@@dlheight\!!depth\@@dldepth\hfill
- \stopcolor
- \fi}%
- \strut
- \carryoverpar\egroup}
-
-\def\hairline
- {\endgraf
- \thinrule
- \endgraf}
-
-\def\dosetupthinrules[#1]%
- {\getparameters[\??dl][#1]}
-
-\def\setupthinrules
- {\dosingleargument\dosetupthinrules}
-
-\def\dothinrules[#1]%
- {\bgroup
- \dosetupthinrules[#1]%
- \@@dlbefore
- \assignvalue\@@dlinterlinespace\@@dlinterlinespace{1.0}{1.5}{2.0}%
- \spacing\@@dlinterlinespace
- \dorecurse\@@dln
- {\ifnum\recurselevel=\@@dln \dothinrulesnobreak \else
- \ifnum\recurselevel=2 \dothinrulesnobreak \fi\fi
- \thinrule
- \ifnum\recurselevel<\@@dln\relax
- % test needed, else messed up whitespace
- \ifx\@@dlinbetween\empty
- \softbreak
- \else
- \endgraf
- \nowhitespace
- \@@dlinbetween
- \fi
- \fi}%
- \doifelsenothing\@@dlafter
- {\carryoverpar\egroup}
- {\@@dlafter\egroup}}
-
-\def\thinrules
- {\dosingleempty\dothinrules}
-
-%D A couple of examples are given below.
-%D
-%D \startbuffer
-%D \setupthinrules[n=3,inbetween=,color=gray]
-%D
-%D test test \thinrules\ test test \par
-%D test test \thinrules [color=green] test test \par
-%D test test \thinrules [height=max, depth=max] test test \par
-%D
-%D \setupthinrules[height=.9,depth=.9]
-%D
-%D test test \thinrules\ test test \par
-%D test test \thinrules [alternativevariant=b] test test \par
-%D test test \thinrules [alternativevariant=c] test test \par
-%D test test \thinrules [alternativevariant=c,inbetween=\vskip2ex] test test \par
-%D \stopbuffer
-%D
-%D \typebuffer {\getbuffer}
-%D
-%D There are a couple of alternative ways to visualize rules
-%D using backgrounds. At first sight these may look strange,
-%D but they make sense in educational settings. The
-%D alternatives are more or less compatible with the more
-%D advanced \METAPOST\ based implementation.
-%D
-%D \startbuffer[a]
-%D \setupthinrules
-%D [n=2,
-%D backgroundcolor=gray ,
-%D rulethickness=1pt,
-%D colorkleur=donkerblauw,
-%D after=\blank,
-%D before=\blank]
-%D \stopbuffer
-%D
-%D \typebuffer[a]
-%D
-%D \startbuffer[b]
-%D \thinrules[alternativevariant=a]
-%D \thinrules[alternativevariant=b]
-%D \thinrules[alternativevariant=c]
-%D \stopbuffer
-%D
-%D \typebuffer[b] \getbuffer[a,b]
-%D
-%D \startbuffer[b]
-%D \thinrules[alternativevariant=a,background=color]
-%D \thinrules[alternativevariant=b,background=color]
-%D \thinrules[alternativevariant=c,background=color]
-%D \stopbuffer
-%D
-%D \typebuffer[b] \getbuffer[a,b]
-%D
-%D \startbuffer[b]
-%D \thinrules[alternativevariant=a,height=.8,depth=.8,background=color]
-%D \thinrules[alternativevariant=b,height=.8,depth=.8,background=color]
-%D \thinrules[alternativevariant=c,height=.8,depth=.8,background=color]
-%D \stopbuffer
-%D
-%D \typebuffer[b] \getbuffer[a,b]
-
-%D \macros
-%D {optimizethinrules}
-%D
-%D By saying \type {\thinrulestrue} or \type {-false}, we
-%D can influence the way dangling lines are handled.
-
-\newif\ifoptimizethinrules \optimizethinrulestrue
-
-\def\dothinrulesnobreak
- {\ifoptimizethinrules\penalty500\fi}
-
-%D \macros
-%D {startframedtext, setupframedtexts, defineframedtext}
-%D
-%D The general framing command we discussed previously, is not
-%D entirely suited for what we call framed texts, as for
-%D instance used in intermezzo's. The next examples show what
-%D we have in mind.
-%D
-%D \startbuffer[framed-0]
-%D \setupframedtexts
-%D [frame=off,
-%D width=\hsize,
-%D background=screen]
-%D
-%D \startframedtext
-%D By default the framed text is centered \dots
-%D \stopframedtext
-%D
-%D \startframedtext[right]
-%D \dots\ but we can also align left, middle and right.
-%D \stopframedtext
-%D \stopbuffer
-%D
-%D \startbuffer[framed-1]
-%D \defineframedtext
-%D [Example]
-%D [width=6cm,
-%D height=5cm]
-%D
-%D \startExample
-%D \typebuffer[framed-1]
-%D \stopExample
-%D \stopbuffer
-%D
-%D \startbuffer[framed-2]
-%D \defineframedtext
-%D [Example]
-%D [width=6cm]
-%D
-%D \startExample
-%D \typebuffer[framed-2]
-%D \stopExample
-%D \stopbuffer
-%D
-%D \startbuffer[framed-3]
-%D \defineframedtext
-%D [Example]
-%D [height=5cm]
-%D
-%D \startExample
-%D \typebuffer[framed-3]
-%D \stopExample
-%D \stopbuffer
-%D
-%D \startbuffer[framed-4]
-%D \defineframedtext
-%D [Example]
-%D [width=fit,height=broad]
-%D
-%D \Example{a very exciting example}
-%D \stopbuffer
-%D
-%D \bgroup \setuptyping[margin=0pt] \getbuffer[framed-0] \egroup
-%D \bgroup \setuptyping[margin=0pt] \getbuffer[framed-1] \egroup
-%D \bgroup \setuptyping[margin=0pt] \getbuffer[framed-2] \egroup
-%D \bgroup \setuptyping[margin=0pt] \getbuffer[framed-3] \egroup
-%D \bgroup \setuptyping[margin=0pt] \getbuffer[framed-4] \egroup
-%D
-%D Here we can see that we have a predefined framed text class
-%D as well as the tools for defining our own. So we have:
-%D
-%D \showsetup{setupframedtexts}
-%D
-%D as well as the definition command:
-%D
-%D \showsetup{defineframedtext}
-%D
-%D that generates two commands:
-%D
-%D \showsetup{start<<framedtext>>}
-%D \showsetup{<<framedtext>>}
-%D
-%D The next definition shows the defaults.
-
-\def\dodefineframedtext[#1][#2]%
- {\presetlocalframed[\??kd#1]%
- \getparameters[\??kd#1]
- [\c!width=0.75\hsize,
- \c!height=\v!fit,
- \c!align=\v!yes,
- \c!top=,
- \c!bottom=\vfill,
- \c!offset=1em,
- \c!bodyfont=,
- \c!style=,
- \c!color=,
- \c!left=,
- \c!right=\hfill,
- \c!before=\blank,
- \c!after=\blank,
- \c!inner=,
- \c!frame=\v!on,
- \c!topframe=,
- \c!bottomframe=,
- \c!leftframe=,
- \c!rightframe=,
- \c!radius=.5\bodyfontsize,
- \c!corner=\v!rectangular,
- \c!foregroundcolor=,
- \c!foregroundstyle=,
- \c!background=,
- \c!backgroundcolor=,
- \c!backgroundscreen=\@@rsscreen,
- \c!linecorrection=\v!on,
- \c!depthcorrection=\v!on,
- \c!margin=\v!standard,
- \c!orientation=,
- \c!indenting=,
- #2]%
- \setvalue{\e!start#1}{\dostartframedtext[#1]}%
- \setvalue{\e!stop #1}{\dostopframedtext }%
- \setvalue {#1}{\doframedtext [#1]}}
-
-\def\defineframedtext
- {\dodoubleempty\dodefineframedtext}
-
-%D We define the general (and original) case by just saying:
-
-\defineframedtext[\v!framedtext]
-
-%D We need several steps before the actual job is done,
-%D because we have to handle an optional identifier (and
-%D because these commands evolved out of a single case).
-
-\def\framedtextparameter#1#2%
- {\csname\??kd#1#2\endcsname}
-
-\def\dosetupframedtexts[#1][#2]%
- {\ifsecondargument
- \def\docommand##1{\getparameters[\??kd##1][#2]}%
- \processcommacommand[#1]\docommand % new, #1 may be macro
- \else
- \getparameters[\??kd\v!framedtext][#1]%
- \fi}
-
-\def\setupframedtexts
- {\dodoubleempty\dosetupframedtexts}
-
-\def\dostartframedtext
- {\bgroup\dotripleempty\dodostartframedtext}
-
-\def\dodostartframedtext[#1][#2][#3]%
- {\doifassignmentelse{#2}
- {\dododostartframedtext[#1][][#2]}
- {\dododostartframedtext[#1][#2][#3]}}
-
-\setfalse\framedtextlocationnone
-
-\def\checkframedtext % messy dependency
- {\ifinsidefloat
- \localhsize\hsize
- \else\ifdim\sidefloatvsize>\zeropoint % will be proper handle
- % \strut % rather clean way to invoke the sidefloat OTR
- % \setbox0=\lastbox % and get the widths set, so from now on we
- % \setlocalhsize % can have framed texts alongside sidefloats
- \checksidefloat
- \setlocalhsize
- \else
- \localhsize\hsize
- \fi\fi}
-
-\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
- \letvalue{\??kd#1\c!right}\hfill,
- \v!right=>\letvalue{\??kd#1\c!left }\hfill
- \letvalue{\??kd#1\c!right}\relax,
- \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
- \settrue\framedtextlocationnone]%
- \letvalue{\??kd#1\c!location}\empty
- % removed 06/2001
- % \forgetparindent
- % added 06/2001 [see demo-bbv]
- \localhsize\hsize \checkframedtext
- % so far
- \setbox\framebox\vbox
- \startboxedcontent
- \hsize\localhsize
- % \insidefloattrue % ? better
- \expanded{\switchtobodyfont[\framedtextparameter{#1}\c!bodyfont]}%
- \startcolor[\framedtextparameter{#1}\c!color]%
- \localframed[\??kd#1][\c!strut=\v!no,#3]% todo: use delayedstrut
- \bgroup
- \let\\=\endgraf
- \framedtextparameter{#1}\c!inner % oud spul
- \doifvalue{\??kd#1\c!depthcorrection}\v!on % new, inside box
- {\bgroup
- \verticalstrut
- % we need \nowhitespace in case of setups setting whitespace
- % nb, not safe, text vs \vbox as next
- \vskip-\struttotal
- \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}}}
-
-%D The \type {none} option is handy for nested usage, as
-%D in the presentation styles, where we don't want
-%D interference.
-
-\def\dodostopframedtext#1#2% % no \baselinecorrection, see faq docs
- {\endgraf
- \removelastskip
- \doifvalue{\??kd#1\c!depthcorrection}\v!on % local and global
- {\forgetall
- \vskip-\struttotal
- \verticalstrut
- \egroup
- \forgetall
- \vskip-\lineheight
- % will be an option, not default
- % \setbaselinecorrections
- % \donegbotbaselinecorrection
- \verticalstrut}
- \stopboxedcontent
- \stopcolor
- \ifconditional\framedtextlocationnone
- \egroup
- \box\framebox
- \else\ifinsidefloat
- \egroup
- \box\framebox
- \else
- \egroup
- \doplacement[\??kd#1][\c!depthcorrection=\v!off]{\box\framebox}%
- \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.
-
-\def\doframedtext
- {\bgroup\dodoubleempty\dodoframedtext}
-
-\def\dodoframedtext[#1][#2]% beware!
- {\expanded{\switchtobodyfont[\getvalue{\??kd#1\c!bodyfont}]}%
- \localframed[\??kd#1][\c!strut=\v!no,#2]%
- \bgroup
- \blank[\v!disable]%
- \let\\=\endgraf
- \getvalue{\??kd#1\c!inner}% % kleur naar outer level
- \dostartattributes{\??kd#1}\c!style\c!color\empty
- \bgroup
- \aftergroup\docloseframedtext
- \let\next=}
-
-\def\docloseframedtext
- {\removelastskip
- \dostopattributes
- \egroup
- \egroup}
-
-%D \macros
-%D {defineframed}
-%D
-%D One can also define simple framed texts, using:
-%D
-%D \showsetup{defineframed}
-
-\def\defineframed
- {\dodoubleempty\dodefineframed}
-
-\def\dodefineframed[#1][#2]%
- {\iffirstargument
- \setvalue{#1}{\dodoubleempty\doframed[#2]}%
- \fi}
-
-\def\doframed[#1][#2]%
- {\framed[#1,#2]}
-
-%D \macros
-%D {textrule, starttextrule, setuptextrules}
-%D
-%D Putting rules before and after a paragraph is very space
-%D sensitive, but the next command handles that quite well. It
-%D comes in two disguises:
-%D
-%D \startbuffer
-%D \textrule[top]{fragments}
-%D \input reich
-%D \textrule
-%D \stopbuffer
-%D
-%D \bgroup \typebuffer \getbuffer \egroup
-%D
-%D \startbuffer
-%D \setuptextrules
-%D [width=90pt,distance=12pt,rulecolor=blue,
-%D bodyfont=small,style=\sc,color=red]
-%D
-%D \starttextrule{Ship Building Tools}
-%D \nl \setuptolerance[tolerant] \input materie
-%D \stoptextrule
-%D \stopbuffer
-%D
-%D \bgroup \typebuffer \getbuffer \egroup
-%D
-%D \startbuffer
-%D \setuptextrules
-%D [location=inmargin,
-%D bodyfont=small,style=slantedbold]
-%D
-%D \starttextrule{wonderful}
-%D \input tufte
-%D \stoptextrule
-%D \stopbuffer
-%D
-%D \bgroup \typebuffer \getbuffer \egroup
-%D
-%D The formal definition of these commands is:
-%D
-%D \showsetup{textrule}
-%D \showsetup{starttextrule}
-%D \showsetup{setuptextrules}
-%D
-%D The implementation looks a bit complicated due to the
-%D optional arguments.
-
-\def\setuptextrules
- {\dodoubleargument\getparameters[\??tl]}
-
-\def\complextextrule[#1]% if needed we can make it installable
- {\let\next\dobottomtextrule
- \processaction
- [#1]
- [ \v!top=>\let\next\dotoptextrule,
- \v!middle=>\let\next\domiddletextrule,
- \v!bottom=>\let\next\dobottomtextrule]%
- \dosinglegroupempty\next}
-
-\definecomplexorsimple\textrule
-
-\def\simpletextrule
- {\dosinglegroupempty\dounknowntextrule}
-
-\def\docomplextextrule#1%
- {\bgroup
- \advance\hsize\dimexpr-\rightskip-\leftskip\relax
- \setbox\scratchbox\hbox to \hsize
- {\dimen4\dimexpr .5ex+.5\linewidth\relax
- \dimen6\dimexpr-.5ex+.5\linewidth\relax
- \doifnothing{#1}\firstargumentfalse
- \iffirstargument
- \doifelse\@@tllocation\v!inmargin
- {\llap{\doattributes\??tl\c!style\c!color{#1}\hskip\leftmargindistance}}
- {\color[\@@tlrulecolor]
- {\vrule\!!height\dimen4\!!depth\dimen6\!!width\@@tlwidth}%
- \hbox spread 2\dimexpr\@@tldistance\relax
- {\hss\doattributes\??tl\c!style\c!color{\strut#1}\hss}}%
- \fi
- \color[\@@tlrulecolor]
- {\leaders\hrule\!!height\dimen4\!!depth\dimen6\hfill}}%
- \ht\scratchbox\strutht
- \dp\scratchbox\strutdp
- \noindent\box\scratchbox
-%\nobreak\verticalstrut\kern-\struttotal
-% evt \witruimte
- \egroup}
-
-\def\dotoptextrule#1%
- {\page[\v!preference] % interferes
- %\whitespace % no
- \@@tlbefore
- \docomplextextrule{#1}%
-% todo, option: \doifnothing{#1}{\ruledvskip-.5ex}
- \nowhitespace
- \@@tlinbetween
- \endgraf}
-
-\def\dodobottomtextrule#1#2%
- {\ifhmode
- \endgraf
- \fi
- \dimen0\strutdp
- \ifdim\prevdepth>\strutdp\else % was <\strutdp
- \ifdim\prevdepth>\zeropoint
- \advance\dimen0 -\prevdepth
- \fi
- \fi
- \advance\dimen0 .5ex
- \vskip\dimen0
-% ==
-% \vskip\dimexpr \strutdp + .5ex
-% \ifdim\prevdepth>\strutdp\else\ifdim\prevdepth>\zeropoint-\prevdepth\fi\fi\relax
-%
- \@@tlinbetween
- \doifelsenothing{#2}
- {\bgroup
- \advance\hsize\dimexpr-\rightskip-\leftskip\relax
- \nointerlineskip
- \moveleft-\leftskip\vbox
- {\color[\@@tlrulecolor]
- {\hrule\!!depth\linewidth\!!height\zeropoint\!!width\hsize}}%
- \egroup}
- {\docomplextextrule{#2}}%
- \ifvmode\prevdepth\zeropoint\fi
- #1%
- \page[\v!preference]}
-
-\def\dobottomtextrule
- {\dodobottomtextrule\@@tlafter}
-
-\def\domiddletextrule
- {\dodobottomtextrule\@@tlinbetween}
-
-\def\dounknowntextrule
- {\iffirstargument
- \@EA\dotoptextrule
- \else
- \@EA\dobottomtextrule\@EA\empty
- \fi}
-
-%D The grouped commands also supports bodyfont switching:
-
-\def\starttextrule#1%
- {\bgroup
- \def\dounknowntextrule{\domiddletextrule}
- \dotoptextrule{#1}
- \bgroup
- \doifsomething\@@tlbodyfont{\switchtobodyfont[\@@tlbodyfont]}}
-
-\def\stoptextrule
- {\par
- \egroup
- \dobottomtextrule\empty
- \egroup}
-
-%D \macros
-%D {fillinrules, setupfillinrules}
-%D
-%D The next few commands do not really deserve a place in a
-%D core module, because they deal with specific typography.
-%D Nevertheless I decided to make them part of the core,
-%D because they permit us to make questionaires. Let's start
-%D with some examples.
-%D
-%D \fillinrules[n=2,width=fit]{first}
-%D \fillinrules[n=2,width=broad]{first}
-%D \fillinrules[n=2,width=3cm]{first}
-%D \fillinrules[n=2,width=3cm,distance=.5em,separator=:]{first}
-%D \fillinrules[n=2]{first}{last}
-%D \fillintext{first}{last} \input reich \par
-%D
-%D The main command is \type{\fillinrules}. This command takes
-%D one and an optional second argument and sets a paragraph with
-%D empty visualized lines.
-%D
-%D \showsetup{fillinrules}
-%D \showsetup{setupfillinrules}
-
-\def\setupfillinrules
- {\dodoubleargument\getparameters[\??il]}
-
-\definecomplexorsimpleempty\fillinrules
-
-\def\complexfillinrules[#1]%
- {\def\docomplexfillinrules##1##2%
- {\dodocomplexfillinrules[#1]{##1}{##2}{\thinrules
- [\c!n=\@@iln,\c!interlinespace=\@@ilinterlinespace,\c!before=,\c!after=]}}%
- \dodoublegroupempty\docomplexfillinrules}
-
-\def\dodocomplexfillinrules[#1]#2#3#4%
- {\endgraf
- \@@ilbefore
- \begingroup
- \setupfillinrules[#1]%
- \noindent
- \doifsomething{#2}
- {\doifelse\@@ilwidth\v!fit
- {\let\@@ildistance\!!zeropoint
- \hbox}
- {\doifelse\@@ilwidth\v!broad
- {\hbox}
- {\hbox to \@@ilwidth}}%
- \bgroup
- \doattributes\??il\c!style\c!color{\strut#2\hfill\@@ilseparator}%
- \hskip\@@ildistance
- \egroup}%
- %\hangindent=\wd0\relax % tzt hang=yes,n
- %\parindent=\hangindent
- %\box0\relax
- \setupwhitespace[\v!big]%
- \ignorespaces
- #4%
- \doifsomething{#3}
- {\kern\@@ildistance
- \doattributes\??il\c!style\c!color{#3\strut}}%
- \endgroup
- \endgraf
- \@@ilafter}
-
-%D \macros
-%D {fillintext}
-%D
-%D To provide compatible layouts when texts and lines are
-%D mixed, one can typeset a paragraph by using the command
-%D \type{\fillintext}.
-%D
-%D \showsetup{fillintext}
-
-\definecomplexorsimpleempty\fillintext
-
-\def\complexfillintext[#1]% rather rough, using an \unhbox is suboptimal
- {\def\docomplexfillintext##1##2%
- {\dowithnextbox
- {\dodocomplexfillinrules[#1]{##1}{\hfill##2}{\unhbox\nextbox\unskip}}%
- \hbox\bgroup\let\par\egroup\ignorespaces}%
- \dodoublegroupempty\docomplexfillintext}
-
-%D \macros
-%D {fillinline, setupfillinlines}
-%D
-%D Another member of the family takes care of putting a (often
-%D small) rule after a piece of text, like
-%D
-%D \startbuffer
-%D \fillinline \input reich \par
-%D \fillinline[margin=0cm] \input reich \par
-%D \stopbuffer
-%D
-%D \startvoorbeeld
-%D \getbuffer
-%D \stopvoorbeeld
-%D
-%D which was typeset by saying:
-%D
-%D \typebuffer
-%D
-%D The two commands that take care of this are:
-%D
-%D \showsetup{fillinline}
-%D \showsetup{setupfillinlines}
-
-\def\setupfillinlines
- {\dodoubleargument\getparameters[\??iv]}
-
-\definecomplexorsimpleempty\fillinline
-
-\def\complexfillinline[#1]%
- {%\endgraf % interferes with \definedescription cum suis
- \@@ivbefore
- \begingroup
- \setupfillinlines[#1]%
- \advance\rightskip \@@ivmargin
- \parfillskip\zeropoint
- \def\par % very dangerous
- {\let\par\endgraf % -)
- \ifhmode\unskip\hfill\fi
- \scratchdimen\dimexpr\@@ivwidth-\@@ivdistance\relax
- \ifdim\scratchdimen>\@@ivmargin\else\expandafter\rlap\fi
- {\kern\@@ivdistance
- \vrule
- \!!width \scratchdimen
- \!!height.5\linewidth
- \!!depth .5\linewidth}%
- \endgraf % !
- \endgroup
- \endgraf % !
- \@@ilafter}}
-
-%D \stopdocumentation
-%D \bgroup
-%D
-%D \setupframedtexts
-%D [setuptext]
-%D [background=color,backgroundcolor=white]
-%D
-%D \startbuffer
-%D \setupbackground
-%D [backgroundoffset=4pt,
-%D background=screen,
-%D frame=on,
-%D framecolor=red,
-%D leftoffset=2pt]
-%D \stopbuffer
-%D
-%D \getbuffer
-%D
-%D \startbackground
-%D
-%D \macros
-%D {setupbackground,startbackground,background}
-%D
-%D The section deals with backgrounds in the running text. This
-%D means that texts is to be collected and split over pages. To
-%D show what can be done, we provide this part of the
-%D documentation with some gray background and a red frame.
-%D Both the background and frame can have all characteristics
-%D of \type{\framed}. This time we used the setting:
-%D
-%D \typebuffer
-%D
-%D The implementation is not that sophisticated, but suffices.
-%D The main problem with this kind of functionality is to get
-%D the spacing all right.
-
-%D Specifying the background is more or less the same as
-%D specifying a framed box.
-%D
-%D \showsetup{setupbackground}
-
-\presetlocalframed[\??ag]
-
-\def\dosetupbackground[#1]%
- {\getparameters[\??ag][#1]%
- \doifelse\@@agstate\v!start
- {\let\startbackground\dostartbackground
- \let\stopbackground \dostopbackground
- \let\background \dobackground}
- {\let\startbackground\relax
- \let\stopbackground \relax
- \let\background \relax}}
-
-\def\setupbackground
- {\dosingleargument\dosetupbackground}
-
-%D Actually typesetting the background is implemented rather
-%D straightforward. We need to handle some spacing as well as
-%D the (often) a bit smaller horizontal size.
-%D
-%D \showsetup{startbackground}
-%D
-%D Although we could have used a scratch one, we first
-%D declare a boolean.
-
-% 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
-%D adding a dummy line.
-
-\def\dostartbackground
- {\endgraf
- \bgroup
- \setbox0\vbox\bgroup
- \vbox to \lineheight{}\vskip\zeropoint
- \blank[\v!disable]
- % \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)
- {\endgraf
- \removelastskip
- \egroup
- \dimen2\leftskip % new **
- \forgetall
- \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
- \setbox\scratchbox\vbox{\@@agbefore}%
- \scratchdimen\dimexpr\pagegoal-\ht\scratchbox-\pagetotal\relax
- \chardef\backgroundsplit\plustwo % split to partial height
- \fi
- \advance\scratchdimen\dimexpr-\@@agtopoffset-\@@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
- \ifdim\ht0>\zeropoint \repeat
- \fi
- \egroup
- \endgraf}
-
-%D As a bonus we also have a short command, that is of not
-%D much use, but kept there for historic reasons.
-%D
-%D \showsetup{background}
-
-\def\dobackground
- {\bgroup
- \dowithnextbox
- {\localframed[\??ag][\c!offset=\v!overlay]{\flushnextbox}\egroup}
- \vbox}
-
-%D \stopdocumentation
-%D \stopbackground
-%D \egroup
-
-%D New, for the moment private; let's see when GB finds out
-%D about this one and its obscure usage. It's used in:
-%D
-%D \startbuffer
-%D \defineframedtext
-%D [tabulateframe]
-%D [offset=overlay,
-%D backgroundoffset=3pt,
-%D background=color,
-%D backgroundcolor=green]
-%D
-%D \setuptabulate
-%D [tabulate]
-%D [frame=tabulateframe]
-%D
-%D \setuptables
-%D [frame=tabulateframe]
-%D
-%D \input tufte
-%D
-%D \starttabulate[|l|l|]
-%D \NC test \NC test \NC \NR \NC test \NC test \NC \NR
-%D \NC test \NC test \NC \NR \NC test \NC test \NC \NR
-%D \stoptabulate
-%D
-%D \input tufte
-%D
-%D \starttable[|l|l|]
-%D \NC test \NC test \NC \AR \NC test \NC test \NC \AR
-%D \NC test \NC test \NC \AR \NC test \NC test \NC \AR
-%D \stoptable
-%D \stopbuffer
-%D
-%D \typebuffer
-
-\def\defineframedcontent
- {\dodoubleempty\dodefineframedcontent}
-
-\def\dodefineframedcontent[#1][#2]%
- {\presetlocalframed[\??fc#1]%
- \getparameters[\??fc#1]
- [\c!leftoffset=\zeropoint,
- \c!rightoffset=\getvalue{\??fc#1\c!leftoffset},
- \c!topoffset=\zeropoint,
- \c!bottomoffset=\getvalue{\??fc#1\c!topoffset},
- \c!strut=\v!no,
- \c!offset=\v!overlay,
- \c!linecorrection=\v!no,
- \c!left=,
- \c!right=,
- #2]}
-
-\let\setuplocalframed\getparameters
-
-\def\setupframedcontent
- {\dodoubleempty\dosetupframedcontent}
-
-\def\dosetupframedcontent[#1][#2]%
- {\def\docommand##1{\getparameters[\??fc##1][#2]}%
- \processcommacommand[#1]\docommand}
-
-\def\startframedcontent[#1]%
- {\bgroup
- \let\stopframedcontent\egroup
- \doifnot{#1}\v!off
- {\doifdefined{\??fc#1\c!frame}
- {\def\stopframedcontent{\dostopframedcontent{#1}}%
- \dostartframedcontent{#1}}}}
-
-\def\dostartframedcontent#1%
- {\setbox\framebox\hbox\bgroup
- \setlocalhsize
- \hsize\localhsize
- \advance\hsize\dimexpr-\getvalue{\??fc#1\c!leftoffset}-\getvalue{\??fc#1\c!rightoffset} \relax
- \advance\vsize\dimexpr-\getvalue{\??fc#1\c!topoffset} -\getvalue{\??fc#1\c!bottomoffset}\relax
- \hskip\getvalue{\??fc#1\c!leftoffset}%
- \vbox\bgroup
- \vskip\getvalue{\??fc#1\c!topoffset}%
- \vbox\bgroup
- \forgetall
- \blank[\v!disable]}
-
-\def\dostopframedcontent#1%
- {\removelastskip
- \egroup
- \vskip\getvalue{\??fc#1\c!bottomoffset}%
- \egroup
- \hskip\getvalue{\??fc#1\c!rightoffset}%
- \egroup
- \doifvalue{\??fc#1\c!width}\v!fit
- {\letvalue{\??fc#1\c!width}\v!fixed}% no shapebox
- \ifinsidefloat
- \donefalse
- \else
- \doifelsevalue{\??fc#1\c!linecorrection}\v!yes\donetrue\donefalse
- \fi
- % plaats ?
- \ifdone\startlinecorrection\fi
- \getvalue{\??fc#1\c!left}% new
- \localframed[\??fc#1]{\box\framebox}%
- \getvalue{\??fc#1\c!right}% new
- \ifdone\stoplinecorrection\fi
- \egroup}
-
-%D \macros
-%D {backgroundline}
-%D
-%D For the moment an undocumented feature, but a cancidate
-%D for going public.
-
-\def\backgroundline[#1]%
- %{\doifsomething{#1}{\dobackgroundline{#1}}\hbox}
- {\doifcolorelse{#1}{\dobackgroundline{#1}\hbox}\hbox}
-
-% \def\backgroundline[#1]%
-% {\doifcolor{#1}{\dobackgroundline{#1}}\hbox}
-
-\def\dobackgroundline#1%
- {\dowithnextbox
- {\hbox
- {\localcolortrue
- \startcolor[#1]%
- \vrule
- \!!width \nextboxwd
- \!!height\nextboxht
- \!!depth \nextboxdp
- \stopcolor
- \hskip-\nextboxwd
- \flushnextbox}}}
-
-%D \macros
-%D {encircled}
-%D
-%D Some not so robust left||overs (borrowed from Knuth,
-%D \TEX Book\ page 356):
-
-\def\encircled#1%
- {{\ooalign{\hfil\raise0.07ex\hbox{{\tx#1}}\hfil\crcr\mathhexbox20D}}}
-
-\let\omcirkeld\encircled
-
-\setuplinewidth
- [\v!medium]
-
-\setupframed
- [\c!width=\v!fit,
- \c!height=\v!broad,
- \c!lines=,
- \c!offset=0.25ex, % \defaultframeoffset
- \c!empty=\v!no,
- \c!frame=\v!on,
- \c!topframe=,
- \c!bottomframe=,
- \c!leftframe=,
- \c!rightframe=,
- \c!radius=.5\bodyfontsize,
- \c!rulethickness=\linewidth,
- \c!corner=\v!rectangular,
- \c!depth=\!!zeropoint,
- \c!foregroundcolor=,
- \c!foregroundstyle=,
- \c!background=,
- \c!backgroundscreen=\@@rsscreen,
- \c!backgroundcolor=,
- \c!backgroundoffset=\!!zeropoint,
- \c!framecolor=,
- \c!frameoffset=\!!zeropoint,
- \c!backgroundcorner=\framedparameter\c!corner,
- \c!backgroundradius=\framedparameter\c!radius,
- \c!backgrounddepth=\framedparameter\c!depth,
- \c!framecorner=\framedparameter\c!corner,
- \c!frameradius=\framedparameter\c!radius,
- \c!framedepth=\framedparameter\c!depth,
- \c!component=,
- \c!align=,
- \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
- [%\c!factor=1.0, % obsolete
- %\c!method=\v!external, % obsolete
- \c!screen=0.95]
-
-\setupblackrules
- [\c!n=3,
- \c!width=1em,
- \c!height=1ex,
- \c!depth=\!!zeropoint,
- \c!alternative=\c!a,
- \c!distance=.25ex,
- \c!color=]
-
-\setupmarginrules
- [\c!level=0,
- \c!rulethickness=\@@kadefaultwidth\linewidth]
-
-\setupthinrules
- [\c!interlinespace=\v!small,
- \c!n=3,
- \c!before=,
- \c!inbetween={\blank[\v!white]},
- \c!after=,
- \c!color=,
- \c!height=.5\linewidth,
- \c!depth=.5\linewidth,
- \c!frame=\v!on, % compatible with textbackgrounds
- \c!alternative=\v!b,
- \c!backgroundcolor=,
- \c!background=,
- \c!rulethickness=]
-
-\setuptextrules
- [\c!location=\v!left,
- \c!before=\blank,
- \c!after=\blank,
- \c!inbetween=,
- \c!width=2em,
- \c!style=\v!bold,
- \c!color=,
- \c!rulecolor=,
- \c!bodyfont=,
- \c!distance=.5em]
-
-\setupfillinrules
- [\c!width=\v!broad,
- \c!distance=1em,
- \c!before=\blank,
- \c!after=\blank,
- \c!n=1,
- \c!interlinespace=\v!small,
- \c!separator=,
- \c!style=\v!normal,
- \c!color=]
-
-\setupfillinlines
- [\c!width=3cm,
- \c!margin=\@@ivwidth,
- \c!distance=1em,
- \c!before=\blank,
- \c!after=\blank]
-
-\setupbackground
- [\c!leftoffset=.5\bodyfontsize,
- \c!rightoffset=\@@agleftoffset,
- \c!topoffset=\!!zeropoint,
- \c!bottomoffset=\@@agtopoffset,
- \c!state=\v!start,
- \c!radius=.5\bodyfontsize,
- \c!corner=\v!rectangular,
- \c!frame=\v!off,
- \c!color=,
- \c!depth=\!!zeropoint,
- \c!background=\v!screen,
- \c!backgroundcolor=\@@agcolor,
- \c!screen=\@@rsscreen,
- \c!before=,
- \c!after=]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/page-app.mkii b/Master/texmf-dist/tex/context/base/mkii/page-app.mkii
deleted file mode 100644
index 75e0cf87467..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/page-app.mkii
+++ /dev/null
@@ -1,225 +0,0 @@
-%D \module
-%D [ file=page-app, % from meta-fig
-%D version=1998.01.15,
-%D title=\CONTEXT\ Page Macros,
-%D subtitle=Independent page building,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 / Applications}
-
-%D The fitting page code is moved from \type {meta-fig} to
-%D here.
-
-\unprotect
-
-\definepapersize
- [\??fp\s!dummy]
- [\c!width=\fittingwd,
- \c!height=\fittinght]
-
-\definelayout
- [\??fp\s!dummy]
- [\c!width=\fittingwd,\c!height=\fittinght,\c!location=\v!middle,
- \c!topspace=\!!zeropoint,\c!backspace=\!!zeropoint,
- \c!cutspace=\!!zeropoint,\c!bottomspace=\!!zeropoint,
- \c!textdistance=\!!zeropoint,\c!lines=0,\c!grid=\v!no,
- \c!top=\!!zeropoint,\c!bottom=\!!zeropoint,
- \c!margin=\!!zeropoint,\c!edge=\!!zeropoint,
- \c!leftmargin=\!!zeropoint,\c!leftedge=\!!zeropoint,
- \c!rightmargin=\!!zeropoint,\c!rightedge=\!!zeropoint,
- \c!header=\!!zeropoint,\c!footer=\!!zeropoint]
-
-
-\def\dostartfittingpage[#1][#2]%
- {\page % this is kind of tricky! there can be preceding page refs
- \autostarttext
- \bgroup % resulting in a zero height page; test fig-make !
- \def\currentfittingpage{#1}%
- \dontcomplain
- % runs under current page regime, i.e. page variables passed to mp
- \getparameters[\currentfittingpage][\c!paper=,#2]% auto or size or nothing
- \setbox\scratchbox\hbox
- \bgroup
- % needed later \getparameters[\currentfittingpage][\c!paper=,#2]% auto or size or nothing
- \doifvalue{\currentfittingpage\c!margin}\v!page % undocumented
- {\offsetbox
- [\c!leftoffset=\backspace,
- \c!rightoffset=\cutspace,
- \c!topoffset=\topspace,
- \c!bottomoffset=\bottomspace]\hbox}%
- \bgroup
- \scale[\c!scale=\getvalue{\currentfittingpage\c!scale}]%
- \bgroup\localframed[\currentfittingpage]%
- \bgroup}
-
-\def\dostopfittingpage
- {\egroup % localframed
- \egroup % scale
- \egroup % offsetbox
- \egroup % scratchbox
- \edef\fittingwd{\the\wd\scratchbox}%
- \edef\fittinght{\the\ht\scratchbox}%
- \startlocallayout
- \ifdim\fittinght<\lineheight
- % write status : too small
- \setbox\scratchbox\vbox to \lineheight{\vss\box\scratchbox\vss}%
- \edef\fittinght{\the\lineheight}%
- \fi
- \let\checkcurrentlayout\relax % else interference with odd/even layout
- \processaction
- [\getvalue{\currentfittingpage\c!paper}]
- [ \v!auto=>\let\fittingpapersize\printpapersize,
- \s!unknown=>\let\fittingpapersize\commalistelement,
- \s!default=>\def\fittingpapersize{\??fp\s!dummy}]%
- \expanded{\setuppapersize[\??fp\s!dummy][\fittingpapersize]}%
- \definelayout
- [\v!page]%
- [\c!location=\v!middle,
- \c!width=\fittingwd,
- \c!height=\fittinght]%
- \setuplayout
- [\v!page]%
- \startmakeup[\v!standard][\c!textstate=\v!empty,\c!doublesided=\v!no,\c!page=]%
- \centerbox{\box\scratchbox}%
- \stopmakeup
- \stoplocallayout
- \egroup
- \autostoptext}
-
-%D \TEX\ pages (for \METAPOST\ pages, see \type {meta-fig}):
-
-\presetlocalframed[\??tg]
-
-\def\setupTEXpage
- {\dodoubleargument\getparameters[\??tg]}
-
-\def\startTEXpage
- {\dosingleempty\dostartTEXpage}
-
-\def\dostartTEXpage[#1]%
- {\dostartfittingpage[\??tg][#1]\gobblespacetokens}
-
-\def\stopTEXpage
- {\removelastspace
- \dostopfittingpage}
-
-\setupTEXpage
- [\c!scale=1000,
- \c!strut=\v!no,
- \c!align=\v!normal, % needed, else problems !
- \c!offset=\v!overlay,
- \c!width=\v!fit,
- \c!height=\v!fit,
- \c!frame=\v!off]
-
-%D For Mojca:
-%D
-%D \starttyping
-%D \startTEXstream \chapter{Bla} Hello world!\crlf Hello world! \stopTEXstream
-%D \startTEXpage \chapter{Bla} Hello world!\crlf Hello world! \stopTEXpage
-%D \stoptyping
-%D
-%D maybe I should support stream=yes in framed.
-
-\def\startTEXstream
- {\dosingleempty\dostartTEXstream}
-
-\def\dostartTEXstream[#1]%
- {\page
- \defineoutputstream[tex]%
- \enableoutputstream[tex]%
- \def\stopTEXstream
- {\disableoutputstream
- \startTEXpage
- \outputstreamunvbox[tex]%
- \stopTEXpage}}
-
-%D Application pages (for an example, see \type {m-pstric}):
-
-\def\@@texapp{texapp}
-\def\@@texdim{texdim}
-
-\def\saveTEXapplication#1#2%
- {\immediate\openout\scratchwrite=\bufferprefix\@@texdim.tmp
- \immediate\write\scratchwrite{\dimen#1=\the\ht\scratchbox}%
- \immediate\write\scratchwrite{\dimen#2=\the\wd\scratchbox}%
- \immediate\closeout\scratchwrite}
-
-\def\restoreTEXapplication
- {\readlocfile{\bufferprefix\@@texdim.tmp}\donothing\donothing}
-
-\def\startTEXapplication
- {\dosingleempty\dostartTEXapplication}
-
-\long\def\dostartTEXapplication[#1]#2#3\stopTEXapplication
- {\bgroup
- \bgroup
- \let\f!temporaryextension\c!tex
- \setbuffer[\@@texapp]%
- \starttext
- #2% preamble
- \startTEXpage[#1]%
- \topskip\zeropoint
- \setbox\scratchbox\hbox{#3}%
- \saveTEXapplication02% dimensions
- \box\scratchbox
- \stopTEXpage
- \stoptext
- \endbuffer
- \egroup
- \doifelse\jobsuffix{dvi}\donetrue\donefalse
- \executesystemcommand{texexec \bufferprefix\@@texapp.tex --once --batch}%
- \ifdone % eps
- \executesystemcommand{dvips -E* -o \@@texapp.eps \@@texapp}%
- \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]
- [\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}
-
-%D \macros
-%D {startpagefigure}
-%D
-%D \starttyping
-%D \starttext \pagefigure[two.1] \stoptext
-%D \stoptyping
-
-\def\startpagefigure
- {\dodoubleempty\dostartpagefigure}
-
-\def\dostartpagefigure[#1][#2]%
- {\bgroup
- \getparameters[\??ex][\c!offset=\v!overlay,#2]%
- \startTEXpage[\c!offset=\@@exoffset]%
- \externalfigure[#1][#2]\ignorespaces} % so we can put some text below the graphic
-
-\def\stoppagefigure
- {\stopTEXpage
- \egroup}
-
-\def\pagefigure
- {\dodoubleempty\dopagefigure}
-
-\def\dopagefigure[#1][#2]%
- {\dostartpagefigure[#1][#2]\stoppagefigure}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/page-bck.mkii b/Master/texmf-dist/tex/context/base/mkii/page-bck.mkii
deleted file mode 100644
index 4c636d29e34..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/page-bck.mkii
+++ /dev/null
@@ -1,593 +0,0 @@
-%D \module
-%D [ file=page-bck, % copied from main-001
-%D version=1997.03.31,
-%D title=\CONTEXT\ Page Macros,
-%D subtitle=Backgrounds,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 / Backgrounds}
-
-% \chardef\kindofpagetextareas=1 will isolate graphics from backgrounds
-
-\unprotect
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-%D \macros
-%D {recalculatebackgrounds}
-%D
-%D We use a couple of switches so that we can minimize the
-%D amount of background calculations. The main switch is set
-%D by the recalculate directive.
-%D
-%D \starttyping
-%D \recalculatebackgrounds
-%D \stoptyping
-%D
-%D Other modules may not directly set the switches
-%D themselves.
-
-\newif\ifnewbackground
-\newif\ifsomebackground
-
-%D For special purposes, users can question the \type
-%D {*background} mode. This mode is only available when
-%D typesetting the pagebody.
-%D
-%D \starttyping
-%D \startmode[*background] ...
-%D \stoptyping
-
-\appendtoks
- \ifsomebackground \ifnewbackground \setsystemmode\v!background \fi \fi
-\to \everybeforepagebody
-
-%D \macros
-%D {addmainbackground, addtextbackground,
-%D addpagebackground, addprintbackground}
-%D
-%D Apart from the previously mentioned directive, the
-%D interface between this module and the other modules
-%D is made up by four macros that add background to parts of
-%D the layout.
-%D
-%D \starttyping
-%D \addmainbackground <box>
-%D \addtextbackground <box>
-%D \addpagebackground <box>
-%D \addprintbackground <box>
-%D \stoptyping
-
-%D To minimize calculations, we keep track of the state of the
-%D background of each area. A previous implementation did
-%D check each call to the background calculation macro, but
-%D using an intermediate usage flag instead of testing each
-%D time saves about 3\% on a run with a couple of backgrounds.
-%D (On the 824 pages maps bibliography runtime went down from
-%D 309 to 299 seconds.)
-
-\def\checkbackground#1%
- {\edef\!!stringe{\??ma#1}%
- \doifelsevaluenothing{\!!stringe\c!background }
- {\doifelsevaluenothing{\!!stringe\c!foregroundcolor}
- {\doifelsevalue{\!!stringe\c!frame }\v!on\!!doneatrue
- {\doifelsevalue{\!!stringe\c!leftframe }\v!on\!!doneatrue
- {\doifelsevalue{\!!stringe\c!rightframe}\v!on\!!doneatrue
- {\doifelsevalue{\!!stringe\c!topframe }\v!on\!!doneatrue
- {\doifelsevalue{\!!stringe\c!bottomframe }\v!on\!!doneatrue
- \!!doneafalse}}}}}
- \!!doneatrue}
- \!!doneatrue
- \if!!donea
- \setusage \!!stringe
- \else
- \resetusage\!!stringe
- \fi}
-
-\def\ifsomebackgroundfound#1%
- {\ifusage{\??ma#1}}
-
-% \def\doifsomebackgroundelse#1#2#3%
-% {\ifusage{\??ma#1}#2\else#3\fi}
-
-\def\doifsomebackgroundelse#1%
- {\ifusage{\??ma#1}%
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-%D The background mechanism falls back on the \type {\framed}
-%D macro. This means that all normal frame and overlay
-%D features can be used.
-
-\def\addsomebackground#1#2#3#4% area box width height / zero test added
- {\ifsomebackgroundfound#1\ifdim#3>\zeropoint\ifdim#4>\zeropoint
- \doifvaluesomething{\??ma#1\c!setups}{\setups[\getvalue{\??ma#1\c!setups}]}% should not produce funny spaces !
- \setbox#2\vbox\fastlocalframed
- [\??ma#1]
- [\c!component=#1,\c!strut=\v!no,\c!offset=\v!overlay,\c!setups=,%
- \c!width=#3,\c!height=#4]
- {\dp#2\zeropoint\box#2}%
- \fi\fi\fi}
-
-%D There are quite some backgrounds. At the bottom layer,
-%D there is the {\em paper} background. This one is only
-%D used for special purposes, like annotations to documents.
-
-\def\addprintbackground#1%
- {\addsomebackground
- \v!paper#1\printpaperwidth\printpaperheight}
-
-%D The page backgrounds can be put behind the {\em left
-%D page}, the {\em right page} or {\em each page}. As with
-%D the paper background, these are calculated on each page.
-
-\def\addpagebackground#1%
- {\doifbothsidesoverruled
- {\addsomebackground\v!rightpage#1\paperwidth\paperheight}
- {\addsomebackground\v!rightpage#1\paperwidth\paperheight}
- {\addsomebackground\v!leftpage #1\paperwidth\paperheight}%
- \addsomebackground\v!page #1\paperwidth\paperheight}
-
-%D Then there are the 25 areas that make up the layout: {\em
-%D top, header, text, footer, bottom} times {\em left edge,
-%D left margin, text, right margin, right edge}. These are
-%D only recalculated when they change or when the \type
-%D {status} is set to \type {repeat}.
-
-\newbox\leftbackground
-\newbox\rightbackground
-
-\def\addmainbackground#1% todo: dimension spec
- {\ifsomebackground
- \ifnewbackground \setbackgroundboxes \fi
- \setbox#1\vbox
- {\offinterlineskip
- \doifmarginswapelse
- {\copy\leftbackground}{\copy\rightbackground}%
- \box#1}%
- \fi}
-
-%D Finaly there is an aditional {\em text} background, again
-%D useful for special purposes only. This one is calculated
-%D each time. The hidden backgrounds are not meant for users!
-
-\newconditional\hiddenbackgroundenabled
-
-\def\addtextbackground#1%
- {\ifconditional\hiddenbackgroundenabled
- \addsomebackground\v!hidden#1\makeupwidth\textheight % mine !
- \fi
- \addsomebackground\v!text#1\makeupwidth\textheight}
-
-%D The next couple of macros implement the area backgrounds.
-%D As said, these are cached in dedicated boxes. The offsets
-%D and depth of the page are used for alignment purposes.
-
-\newdimen\pageoffset % bleed
-\newdimen\pagedepth
-
-\let\pagebackgroundhoffset\!!zeropoint
-\let\pagebackgroundvoffset\!!zeropoint
-\let\pagebackgrounddepth \!!zeropoint
-
-% \def\setbackgroundboxes
-% {\showmessage\m!layouts8\empty
-% \setbackgroundbox\leftbackground\relax
-% \ifdoublesided
-% \setbackgroundbox\rightbackground\doswapmargins
-% \fi
-% \doifnot\@@mastatus\v!herhaal{\global\newbackgroundfalse}}
-
-%D We need a bit more clever mechanism in order to handle
-%D layers well. This means that we cannot calculate both
-%D background at the same time since something may have
-%D changed halfway a page.
-
-\chardef\newrightbackground\zerocount
-\chardef\newleftbackground \zerocount
-
-\def\recalculatebackgrounds
- {\global\newbackgroundtrue}
-
-\def\setbackgroundboxes
- {\ifnewbackground
- \global\chardef\newrightbackground\plusone
- \global\chardef\newleftbackground\plusone
- \global\setbox\leftbackground\emptybox
- \global\setbox\rightbackground\emptybox
- \fi
- \doifbothsides
- {\ifcase\newleftbackground \else
- % \showmessage\m!layouts8\empty
- \setbackgroundbox\leftbackground\relax
- \global\chardef\newleftbackground\zerocount
- \global\chardef\newrightbackground\zerocount
- \fi}
- {\ifcase\newleftbackground \else
- % \showmessage\m!layouts8\empty
- \setbackgroundbox\leftbackground\relax
- \global\chardef\newleftbackground\zerocount
- \fi}
- {\ifcase\newrightbackground \else
- % \showmessage\m!layouts8\empty
- \setbackgroundbox\rightbackground\doswapmargins
- \global\chardef\newrightbackground\zerocount
- \fi}%
- \ifx\@@mastate\v!repeat\else\global\newbackgroundfalse\fi}
-
-\def\addmainbackground#1% todo: dimension spec
- {\ifsomebackground
- \setbackgroundboxes
- \setbox#1\vbox
- {\offinterlineskip
- \doifmarginswapelse
- {\copy\leftbackground}
- {\copy\rightbackground}
- \box#1}%
- \fi}
-
-\def\setbackgroundoffsets
- {\ifsomebackground \ifnewbackground
- \global\let\pagebackgroundhoffset\!!zeropoint
- \global\let\pagebackgroundvoffset\!!zeropoint
- \global\let\pagebackgrounddepth \!!zeropoint
- \doifsomebackgroundelse{\v!text\v!text}\donetrue\donefalse
- \ifdone\else\doifsomebackgroundelse\v!text\donetrue\donothing\fi
- \ifdone
- \bgroup
- \scratchdimen\getvalue{\??ma\v!page\c!offset}%
- \doifsomebackgroundelse{\v!top\v!text}\donothing
- {\doifsomebackgroundelse{\v!bottom\v!text}\donothing
- {\xdef\pagebackgroundhoffset{\the\scratchdimen}}}%
- \doifsomebackgroundelse{\v!text\v!rightedge}\donothing
- {\doifsomebackgroundelse{\v!text\v!leftedge}\donothing
- {\xdef\pagebackgroundvoffset{\the\scratchdimen}%
- \scratchdimen\getvalue{\??ma\v!page\c!depth}%
- \xdef\pagebackgrounddepth{\the\scratchdimen}}}%
- \egroup
- \fi
- \fi \fi}
-
-\appendtoks \setbackgroundoffsets \to \everybeforepagebody
-
-\newconditional\swapbackgroundmargins \settrue\swapbackgroundmargins
-
-\def\setbackgroundbox#1#2%
- {\global\setbox#1\vbox
- {\dontcomplain
- \swapmargins
- \ifconditional\swapbackgroundmargins
- \doifmarginswapelse \donothing
- {\swapmacros\v!rightmargin\v!leftmargin
- \swapmacros\v!rightedge \v!leftedge}%
- \fi
- \calculatereducedvsizes
- \offinterlineskip
- #2\relax
- \vskip\dimexpr-\topheight-\topdistance\relax
- \dodopagebodybackground\v!top\topheight
- \vskip\topdistance
- \dodopagebodybackground\v!header\headerheight
- \vskip\headerdistance
- \dodopagebodybackground\v!text\textheight
- \vskip\footerdistance
- \dodopagebodybackground\v!footer\footerheight
- \vskip\bottomdistance
- \dodopagebodybackground\v!bottom\bottomheight
- \vfilll}%
- \smashbox#1}
-
-\def\dodopagebodybackground#1#2%
- {\ifdim#2>\zeropoint % added, faster
- \setbox\scratchbox\vbox to #2
- \bgroup\hbox\bgroup
- % \swapmargins
- \goleftonpage
- \dododopagebodybackground\leftedgewidth #2#1\v!leftedge
- \hskip\leftedgedistance
- \dododopagebodybackground\leftmarginwidth #2#1\v!leftmargin
- \hskip\leftmargindistance
- \dododopagebodybackground\makeupwidth #2#1\v!text
- \hskip\rightmargindistance
- \dododopagebodybackground\rightmarginwidth#2#1\v!rightmargin
- \hskip\rightedgedistance
- \dododopagebodybackground\rightedgewidth #2#1\v!rightedge
- \egroup\egroup
- \wd\scratchbox\zeropoint
- \box\scratchbox\relax
- \fi}
-
-\def\dododopagebodybackground#1#2#3#4% width height pos pos
- {\ifsomebackgroundfound{#3#4}%
- \ifdim#2>\zeropoint\relax
- \ifdim#1>\zeropoint\relax
- \doifvaluesomething{\??ma#3#4\c!setups}{\setups[\getvalue{\??ma#3#4\c!setups}]}% should not produce funny spaces !
- \fastlocalframed
- [\??ma#3#4]
- [\c!component=#3-#4,\c!offset=\v!overlay,\c!setups=]
- {\vbox to #2{\vss\hbox to#1{\hss\getvalue{\??ma#3#4\c!command}\hss}\vss}}%
- \else
- \hskip#1%
- \fi
- \else
- \hskip#1%
- \fi
- \else
- \hskip#1%
- \fi}
-
-%D The background mechanism is quite demanding in terms or
-%D resources. We used to delay these definitions till runtime
-%D usage, but since today's \TEX's are large, we now do the
-%D work on forehand.
-%D
-%D \starttyping
-%D \setupbackgrounds [settings]
-%D \setupbackgrounds [paper,page,text,..] [settings]
-%D \setupbackgrounds [top,...] [leftedge,...] [settings]
-%D \stoptyping
-%D
-%D \showsetup{setupbackgrounds}
-%D
-%D Because the number of arguments runs from one to three,
-%D we need to check for it.
-
-\def\setupbackgrounds
- {\dotripleempty\dosetupbackgrounds}
-
-\def\dosetupbackgrounds[#1][#2][#3]%
- {\ifthirdargument
- \global\somebackgroundtrue
- \def\docommand##1%
- {\doifinsetelse{##1}{\v!paper,\v!page,\v!leftpage,\v!rightpage}
- {\getparameters[\??ma##1][#3]\checkbackground{##1}}
- {\def\dodocommand####1{\getparameters[\??ma##1####1][#3]\checkbackground{##1####1}}%
- \processcommalist[#2]\dodocommand}}%
- \processcommalist[#1]\docommand
- \else\ifsecondargument
- \global\somebackgroundtrue
- \doifcommonelse{#1}{\v!text,\v!hidden,\v!paper,\v!page,\v!leftpage,\v!rightpage}
- {\def\docommand##1{\getparameters[\??ma##1][#2]\checkbackground{##1}}%
- \processcommalist[#1]\docommand}%
- {\setupbackgrounds
- [#1]%
- [\v!leftedge,\v!leftmargin,\v!text,\v!rightmargin,\v!rightedge]%
- [#2]}%
- \else\iffirstargument
- \getparameters[\??ma][#1]%
- \fi\fi\fi
- \doifelsevalue{\??ma\v!page\c!offset}\v!overlay
- {\global\pageoffset\zeropoint}
- {\global\pageoffset\getvalue{\??ma\v!page\c!offset}}%
- \global\pagedepth\getvalue{\??ma\v!page\c!depth}%
- \xdef\pagebackgroundoffset{\the\pageoffset}%
- \xdef\pagebackgrounddepth {\the\pagedepth }%
- \doifelse\@@mastate\v!stop
- {\global\newbackgroundfalse}
- {\global\newbackgroundtrue }}
-
-\let\pagebackgroundoffset\!!zeropoint
-\let\pagebackgrounddepth \!!zeropoint
-
-%D Each areas (currently there are $1+3+25+1=30$ of them)
-%D has its own low level framed object associated.
-
-\presetlocalframed [\??ma\v!paper]
-\presetlocalframed [\??ma\v!page]
-\presetlocalframed [\??ma\v!leftpage]
-\presetlocalframed [\??ma\v!rightpage]
-
-\copyparameters
- [\??ma\v!paper\c!frame][\??ma\v!page]
- [\c!offset,\c!depth,\c!radius,\c!corner,\c!color,\c!screen]
-
-\copyparameters
- [\??ma\v!paper\c!background][\??ma\v!page]
- [\c!offset,\c!depth,\c!radius,\c!corner,\c!color,\c!screen]
-
-\copyparameters
- [\??ma\v!page\c!frame][\??ma\v!page]
- [\c!offset,\c!depth,\c!radius,\c!corner,\c!color,\c!screen]
-
-\copyparameters
- [\??ma\v!page\c!background][\??ma\v!page]
- [\c!offset,\c!depth,\c!radius,\c!corner,\c!color,\c!screen]
-
-\copyparameters
- [\??ma\v!leftpage\c!frame][\??ma\v!leftpage]
- [\c!offset,\c!depth,\c!radius,\c!corner,\c!color,\c!screen]
-
-\copyparameters
- [\??ma\v!leftpage\c!background][\??ma\v!leftpage]
- [\c!offset,\c!depth,\c!radius,\c!corner,\c!color,\c!screen]
-
-\copyparameters
- [\??ma\v!rightpage\c!frame][\??ma\v!rightpage]
- [\c!offset,\c!depth,\c!radius,\c!corner,\c!color,\c!screen]
-
-\copyparameters
- [\??ma\v!rightpage\c!background][\??ma\v!rightpage]
- [\c!offset,\c!depth,\c!radius,\c!corner,\c!color,\c!screen]
-
-%D We save some keying by defining the areas using
-%D intermediate commands. The inheritance macro makes sure
-%D that copies are efficient.
-
-\def\dodocommand#1#2%
- {\copylocalframed
- [\??ma#1#2][\??ma\v!page]%
- \getparameters
- [\??ma#1#2]
- [\c!background=,\c!frame=,\c!color=,\c!screen=\@@rsscreen,
- \c!bottomframe=,\c!topframe=,\c!leftframe=,\c!rightframe=]%
- \inheritparameter[\??ma][#1#2\c!color][\v!page\c!color]%
- \inheritparameter[\??ma][#1#2\c!screen][\v!page\c!screen]%
- \inheritparameter[\??ma][#1#2\c!framecolor][\v!page\c!framecolor]%
- \inheritparameter[\??ma][#1#2\c!backgroundcolor][\v!page\c!backgroundcolor]%
- \inheritparameter[\??ma][#1#2\c!backgroundscreen][\v!page\c!backgroundscreen]}
-
-%D The stand alone text area inherits from the page too.
-
-\dodocommand\v!text \empty
-\dodocommand\v!hidden\empty
-
-%D We now define all 25 main areas in a row.
-
-\def\docommand#1%
- {\dodocommand#1\v!leftedge
- \dodocommand#1\v!leftmargin
- \dodocommand#1\v!text
- \dodocommand#1\v!rightmargin
- \dodocommand#1\v!rightedge}
-
-\docommand\v!top
-\docommand\v!header
-\docommand\v!text
-\docommand\v!footer
-\docommand\v!bottom
-
-%D We need some cleanup now.
-
-\let\dodocommand\relax \let\docommand\relax
-
-%D We now set up the individual areas to use reasonable
-%D defaults.
-
-\setupbackgrounds
- [\c!state=\c!start]
-
-\setupbackgrounds
- [\v!paper,\v!page,\v!leftpage,\v!rightpage]
- [\c!frame=\v!off,
- \c!radius=.5\bodyfontsize,
- \c!corner=\v!rectangular,
- \c!background=,
- \c!screen=\@@rsscreen,
- \c!color=,
- %\c!frameoffset=\getvalue{\??ma\v!page\c!offset},
- %\c!backgroundoffset=\getvalue{\??ma\v!page\c!offset},
- \c!offset=\!!zeropoint, % later set to \v!overlay, watch out !
- \c!depth=\!!zeropoint]
-
-\def\docommand#1%
- {\inheritparameter[\??ma][#1\c!frameoffset][\v!page\c!offset]%
- \inheritparameter[\??ma][#1\c!backgroundoffset][\v!page\c!offset]}
-
-\docommand\v!paper
-\docommand\v!page
-\docommand\v!leftpage
-\docommand\v!rightpage
-
-%D Again we clean up temporary macros.
-
-\let\docommand\relax
-
-%D The hidden layer can be populated by extending the
-%D following comma separated list. This only happens in core
-%D modules.
-
-% todo page-2 .. page+2 achter pagina -> bleed
-% spread-2 .. spread+2 achter spread -> spread (repeat 2 times)
-
-\def\enablehiddenbackground
- {\global\settrue\hiddenbackgroundenabled
- \global\somebackgroundtrue
- \recalculatebackgrounds}
-
-\def\disablehiddenbackground
- {\global\setfalse\hiddenbackgroundenabled}
-
-\def\hiddenbackground
- {\v!text-2,\v!text-1,\v!foreground,\v!text+1,\v!text+2}
-
-\setupbackgrounds
- [\v!hidden]
- [\c!background=\hiddenbackground]
-
-% The next series is used in local (for instance floating)
-% backgrounds.
-
-\presetlocalframed
- [\??ma\v!local]
-
-\def\localbackground
- {\v!local-2,\v!local-1,\v!foreground,\v!local+1,\v!local+2}
-
-\defineoverlay[\v!local-2][\positionoverlay{\v!local-2}]
-\defineoverlay[\v!local-1][\positionoverlay{\v!local-1}]
-\defineoverlay[\v!local+1][\positionoverlay{\v!local+1}]
-\defineoverlay[\v!local+2][\positionoverlay{\v!local+2}]
-
-\def\addlocalbackgroundtobox
- {\ifconditional\hiddenbackgroundenabled
- \expandafter\doaddlocalbackground
- \else
- \resetglobal \expandafter\gobbleoneargument
- \fi}
-
-\def\doaddlocalbackground#1%
- {\dodoglobal\setbox#1\hbox
- {\fastlocalframed % \localframed
- [\??ma\v!local]
- [\c!component=local,\c!frame=\v!off,\c!offset=\v!overlay,\c!setups=,%
- \c!location=\v!keep,% when we use \localframed instead of \fastlocalframed
- \c!background=\localbackground]%
- {\registerMPlocaltextarea{\box#1}}}%
- \resetglobal % redundant
- \doglobal\increment\localpositionnumber\relax} % afterwards !
-
-% Test how previous macro behaves with depth:
-%
-% \startcolumnset
-% \input tufte
-% \placefigure{none}{\framed[lines=5]{xxx}}
-% \input tufte
-% \placefigure{none}{\starttabulate\NC test\nc test\NC\NR\stoptabulate}
-% \input tufte
-% \stopcolumnset
-
-%D Because we haven't really set up backgrounds yet, we set
-%D the main efficiency switch to false.
-
-\somebackgroundfalse
-
-\protect \endinput
-
-%D Removed \quote {features}:
-%D
-%D \starttyping
-%D \startinteraction
-%D \doifmarginswapelse
-%D {\copy\leftbackground}
-%D {\copy\rightbackground}%
-%D \stopinteraction
-%D \stoptyping
-%D
-%D \starttyping
-%D \edef\setpagebackgrounddepth%
-%D {\dp#2=\the\dp#2}%
-%D \setbox#2=\vbox\localframed[\??ma#1]{...}
-%D \setpagebackgrounddepth
-%D \stoptyping
diff --git a/Master/texmf-dist/tex/context/base/mkii/page-flw.mkii b/Master/texmf-dist/tex/context/base/mkii/page-flw.mkii
deleted file mode 100644
index ba8fd3eabaf..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/page-flw.mkii
+++ /dev/null
@@ -1,107 +0,0 @@
-%D \module
-%D [ file=page-flw,
-%D version=2003.04.19, % from test-002 (1997) profile experiment
-%D title=\CONTEXT\ Page Macros,
-%D subtitle=Text Flows,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 / Text Flows}
-
-%D This is high experimental and especially flushing may change (proper
-%D spacing is the driving force here).
-
-\unprotect
-
-\def\definetextflow
- {\dodoubleempty\dodefinetextflow}
-
-\def\dodefinetextflow[#1][#2]% flow settings
- {\iffirstargument
- \doiftextflowcollectorelse{#1}
- {\setbox\textflowcollector{#1}\emptybox}
- {\@EA\newbox\csname\??tx:c:#1\endcsname}%
- \getparameters[\??tx:p:#1]
- [\c!width=\hsize,\c!style=,#2]%
- \fi}
-
-\def\textflowparameter#1#2{\csname\??tx:p:#1#2\endcsname}
-\def\textflowcollector #1{\csname\??tx:c:#1\endcsname}
-
-\def\doiftextflowcollectorelse#1{\doifdefinedelse{\??tx:c:#1}}
-
-\def\doiftextflowelse#1%
- {\doiftextflowcollectorelse{#1}
- {\ifvoid\textflowcollector{#1}%
- \expandafter\secondoftwoarguments
- \else
- \expandafter\firstoftwoarguments
- \fi}
- {\secondoftwoarguments}}
-
-\def\doiftextflow#1%
- {\doiftextflowelse{#1}\firstofoneargument\gobbleoneargument}
-
-\def\starttextflow[#1]%
- {\doiftextflowcollectorelse{#1}
- {\global\setbox\textflowcollector{#1}\vbox
- \bgroup
- \unvbox\textflowcollector{#1}%
- \hsize\textflowparameter{#1}\c!width
- \doifsomething{\textflowparameter{#1}\c!style}%
- {\doconvertfont{\textflowparameter{#1}\c!style}}%
- \def\stoptextflow{\endgraf\egroup}}
- {\let\stoptextflow\relax}}
-
-\def\flushtextflow#1%
- {\doiftextflow{#1}
- {\ifdim\ht\textflowcollector{#1}>\vsize
- \setbox\scratchbox\vsplit\textflowcollector{#1} to \vsize
- \unvbox\scratchbox
- \else
- \unvbox\textflowcollector{#1}%
- \fi}}
-
-\protect \endinput
-
-% Example (dutch)
-%
-% \stelpapierformaatin [S6]
-% \steltolerantiein [soepel,rek]
-% \stelkleurenin [status=start]
-% \stelvoetin [strut=nee]
-% \stelwitruimtein [groot]
-%
-% \stellayoutin
-% [rechterrand=5cm,breedte=passend,marge=0pt,randafstand=1cm,
-% voet=4cm,voetafstand=1cm,hoofd=0cm]
-%
-% \stelteksttekstenin[rand][][\vbox{\flushtextflow{alpha}}]
-% \stelvoettekstenin [rand][][\vbox{\flushtextflow{beta}}]
-% \stelvoettekstenin [\vbox{\flushtextflow{gamma}}][]
-%
-% \definetextflow [alfa] [breedte=\rechterrandbreedte]
-% \definetextflow [beta] [breedte=\rechterrandbreedte]
-% \definetextflow [gamma] [breedte=\voethoogte]
-%
-% \starttekst
-%
-% \dorecurse{50}
-% {\getrandomnumber{\funny}{0}{8}
-% \ifcase\funny \starttextflow[alfa] \input tufte.tex \stoptextflow
-% \or \starttextflow[beta] \input knuth.tex \stoptextflow
-% \or \starttextflow[gamma] \input materie.tex \stoptextflow
-% \or {\bf TUFTE}\quad \input tufte \par
-% \or {\bf TUFTE}\quad \input tufte \par
-% \or {\bf KNUTH}\quad \input knuth \par
-% \or {\bf KNUTH}\quad \input knuth \par
-% \or {\bf MATERIE}\quad \input materie \par
-% \else {\bf MATERIE}\quad \input materie \par
-% \fi}
-%
-% \stoptekst
diff --git a/Master/texmf-dist/tex/context/base/mkii/page-imp.mkii b/Master/texmf-dist/tex/context/base/mkii/page-imp.mkii
deleted file mode 100644
index bf10504b48c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/page-imp.mkii
+++ /dev/null
@@ -1,1662 +0,0 @@
-%D \module
-%D [ file=page-imp, % was: core-pag,
-%D version=1998.01.15,
-%D title=\CONTEXT\ Page Macros,
-%D subtitle=Pagebody Building (Imposition),
-%D author=Hans Hagen & Willi Egger,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% much of this can more to run time loading !
-
-\writestatus{loading}{ConTeXt Page Macros / Pagebody Building}
-
-\unprotect
-
-% sizing bug:
-%
-% \setuppapersize[A4][A4,landscape] \setuparranging[2UP] \showframe
-%
-% \starttext \dorecurse{10}{\input tufte \par} \stoptext
-
-% to be moved code:
-
-\newif\ifclipprintbox \clipprintboxtrue
-%newif\ifclippagebox \clippageboxtrue
-
-\def\clippedprintbox#1#2% can be made more efficient, see other clipper
- {\ifclipprintbox
- \!!widthc \pagebackgroundoffset
- \!!widtha \dimexpr\paperwidth + \!!widthc\relax
- \!!heighta\dimexpr\paperheight+2\!!widthc\relax
- \setbox#2\vbox to \paperheight{\vfill\box#2}%
- \ht#2\paperheight
- \wd#2\paperwidth
- \setbox#2\vbox
- {\framed
- [\c!offset=\!!widthc,\c!strut=\v!no,\c!frame=\v!off]
- {\box#2}}%
- \setbox#2\hbox to \paperwidth
- {\ifcase#1\relax
- \!!widthb\zeropoint
- \hskip-\!!widthc
- \else
- \!!widthb\!!widthc
- \fi
- \lower\!!widthc\hbox
- {\clip
- [\c!width=\!!widtha,\c!height=\!!heighta,
- \c!hoffset=\!!widthb,\c!voffset=\zeropoint]
- {\box#2}}}%
- \wd#2\paperwidth
- \ht#2\paperheight
- \fi
- \box#2\relax}
-
-\let\clippagebox \gobbleoneargument
-\let\clipprintbox\gobbleoneargument
-
-% \setuppagenumbering[alternative=doublesided]
-% \setupcolors[state=start]
-% \setuppapersize[A4][A4,oversized]
-% \setuplayout[location=middle,clipoffset=5mm]
-% \setupbackgrounds
-% [page]
-% [frame=on,rulethickness=1mm,
-% backgroundoffset=10mm,background=color,backgroundcolor=red]
-% \starttext \dorecurse{10}{\input tufte \par} \stoptext
-
-\def\clippagebox#1%
- {\ifdim\@@lyclipoffset>\zeropoint
- \!!widtha \wd#1%
- \!!heighta\ht#1%
- \!!deptha \dp#1%
- \setbox#1\hbox
- {\!!widthb \@@lyclipoffset
- \advance\!!heighta\dimexpr\!!deptha+2\!!widthb\relax
- \advance\!!widtha \!!widthb
- \doifbothsides
- {\advance\!!widtha\!!widthb \!!widthc-\!!widthb \hskip\!!widthc}%
- {\!!widthc\zeropoint}
- {\!!widthc-\!!widthb \hskip\!!widthc}%
- \lower\!!widthb\hbox
- {\clip
- [\c!hoffset=\!!widthc,
- \c!voffset=-\!!widthb,
- \c!width=\!!widtha,
- \c!height=\!!heighta]%
- {\box#1}}}%
- \wd#1\!!widtha
- \ht#1\!!heighta
- \dp#1\!!deptha
- \fi}
-
-%D \macros
-%D {starttextdata}
-%D
-%D This is a user macro (appending to every last shipout is not
-%D really user friendly.
-
-\newtoks \collectedtextdata
-
-\long\def\starttextdata#1\stoptextdata
- {\doglobal\appendtoks#1\to\collectedtextdata}
-
-\def\flushtextdata
- {\vsmashed{\the\collectedtextdata}% all dimensions zero
- \global\collectedtextdata\emptytoks
- \globallet\flushtextdata\donothing}
-
-\prependtoks \flushtextdata \to \everylastshipout
-
-% moved code:
-
-% \def\myshipout#1%
-% {\beforeshipout % voor de pagebody dus !
-% \dontshowcomposition
-% \ifarrangingpages\@EA\actualarrange\else\@EA\actualshipout\fi
-% {\thisisrealpage\realfolio#1}%
-% \gotonextrealpage
-% \aftershipout}
-
-\def\installpagehandler#1#2% % a handler takes one argument: something to be boxed
- {\setvalue{\??pp:\c!method:#1}{#2}} % and shipped out (don't depend on the exact package)
-
-\installpagehandler\v!normal
- {\ifarrangingpages\expandafter\actualarrange\else\expandafter\actualshipout\fi}
-
-\def\myshipout#1%
- {\beforeshipout % voor de pagebody dus !
- \dontshowcomposition
- \executeifdefined{\??pp:\c!method:\@@ppmethod}\gobbleoneargument{\thisisrealpage\realfolio#1}%
- \gotonextrealpage
- \aftershipout}
-
-\newbox\postponedcontent
-
-\def\flushatshipout
- {\dowithnextbox
- {\global\setbox\postponedcontent\hbox to \zeropoint
- {%\hskip-\maxdimen % niet hier, gaat mis in acrobat (clipt)
- \unhbox\postponedcontent\unhbox\nextbox}%
- \ht\postponedcontent\zeropoint
- \dp\postponedcontent\zeropoint
- \wd\postponedcontent\zeropoint}%
- \hbox}
-
-% \starttypen
-% \def\pagestoshipout{1,3,5}
-% \stoptypen
-
-\newcount\shippedoutpages
-
-\let\pagestoshipout\empty % {1,3,6}
-\chardef\whichpagetoshipout=0 % 0=all 1=odd 2=even
-
-\ifx\finalizeshipoutbox\undefined \let\finalizeshipoutbox\firstofoneargument \fi
-
-\def\actualshipout#1%
- {\global\advance\shippedoutpages\plusone
- % this is not resource safe!
- \ifx\pagestoshipout\empty
- \ifcase\whichpagetoshipout\relax
- \donetrue
- \or % 1
- \ifodd\shippedoutpages\relax\donetrue\else\donefalse\fi
- \or % 2
- \ifodd\shippedoutpages\relax\donefalse\else\donetrue\fi
- \else
- \donetrue
- \fi
- \else % testen, aangepast / expanded nodig ?
- \expanded{\doifinsetelse{\the\shippedoutpages}{\pagestoshipout}}%
- \donetrue\donefalse
- \fi
- \ifdone
- \shipout\vbox
- {\forgetall
- \offinterlineskip
- \dontcomplain
- \scratchdimen-1in
- \vskip\scratchdimen
- \hskip\scratchdimen
- \hbox % \setbox0=\box.. is nicer
- {\setbox0\hbox{\finalizeshipoutbox{#1}}% just in case there are objects there, hook for testing
- \setbox\scratchbox\hbox
- {% before the main one !
- \ifcase\realfolio \or
- \the\everyfirstshipout
- \global\everyfirstshipout\emptytoks
- \fi
- % the main one
- \the\everyshipout\relax
- % always last (and after the main one)
- \ifnum\realpageno=\lastpage\relax
- \the\everylastshipout
- \global\everylastshipout\emptytoks
- \fi}%
- \smashbox\scratchbox
- \box\scratchbox
- \box\postponedcontent % evt ver naar links !
- \box0}}%
- \else
- \message
- {[\ifarrangingpages arranged \fi page
- \ifarrangingpages\the\arrangeno\else\the\realpageno\fi\normalspace
- not flushed]}%
- \setbox0\hbox{#1}%
- \deadcycles\zerocount
- \fi}
-
-\def\actualarrange#1%
- {\setbox0\hbox{\thisisrealpage{\realfolio}#1}%
- \pusharrangedpage0%
- \deadcycles\zerocount}
-
-%D We need a couple of boxes for duplex printing \unknown
-
-\newbox\arrangedpageA \newbox\arrangedpageB
-
-%D \unknown\ and some for simulating big sheets.
-
-\newbox\arrangedpageC \newbox\arrangedpageD
-\newbox\arrangedpageE \newbox\arrangedpageF
-\newbox\arrangedpageG \newbox\arrangedpageH
-
-\newif\ifswaparranged
-\newif\ifnegatearranged
-\newif\ifmirrorarranged
-\newif\ifdoublearranged
-
-\newif\ifarrangingdisabled
-
-\def\arrangedrotationO{0}
-\def\arrangedrotationE{0}
-
-\newcounter\arrangedpageN
-\newcounter\arrangedpageM
-
-\chardef\arrangedpageT=1
-\chardef\arrangedpageX=1
-\chardef\arrangedpageY=1
-
-\def\calculatepaperoffsets#1%
- {\scratchdimen\getvalue{\??pp#1\c!offset}%
- \divide\scratchdimen \arrangedpageX
- \global\advance\paperwidth -2\scratchdimen
- \scratchdimen\getvalue{\??pp#1\c!offset}%
- \divide\scratchdimen \arrangedpageY
- \global\advance\paperheight-2\scratchdimen}
-
-\newconditional\arrangedbackgroundokay % more ifs -> conditionals
-
-\def\setuparranging[#1]%
- {\ifarrangingdisabled \else
- \doifelse{#1}\v!disable
- {\global\arrangingdisabledtrue}
- {\global\arrangingdisabledfalse}%
- \global\arrangingpagestrue
- \global\negatearrangedfalse
- \global\mirrorarrangedfalse
- \global\doublearrangedfalse
- \gdef\arrangedrotationO{0}%
- \gdef\arrangedrotationE{180}%
- \processallactionsinset
- [#1]
- [ \v!mirrored=>\global\mirrorarrangedtrue,
- \v!doublesided=>\global\doublearrangedtrue,
- \v!negative=>\global\negatearrangedtrue,
- \v!rotated=>\gdef\arrangedrotationO {90}\gdef\arrangedrotationE{270},
- 90=>\gdef\arrangedrotationO {90}\gdef\arrangedrotationE{270},
- 180=>\gdef\arrangedrotationO{180}\gdef\arrangedrotationE{0},
- 270=>\gdef\arrangedrotationO{270}\gdef\arrangedrotationE{90},
- \s!reset=>\global\arrangingpagesfalse,
- \v!background=>\global\settrue\arrangedbackgroundokay,
- \s!unknown=>\checkinstalledpagearrangement\commalistelement]%
- % no \s!default=> we can have aaa,,bbb
- \ifx\handlearrangedpage\undefined
- \global\arrangingpagesfalse
- \fi
- \doifcommonelse{#1}{90,270,\v!rotated}
- {\swapmacros\horizontalcutmarks\verticalcutmarks}{}% ugly solution
- \setuppapersize
- \ifarrangingpages
- \abortutilitygeneration
- \fi
- \fi}
-
-\def\installpagearrangement #1 %
- {\setgvalue{\??pp\??pp#1}}
-
-\def\checkinstalledpagearrangement#1% can be empty: aaa,,bbb
- {\executeifdefined{\??pp\??pp#1}\donothing}
-
-\def\dosetuparrangement#1#2#3#4#5#6#7#8%
- {\global\chardef\arrangedpageX #1%
- \global\chardef\arrangedpageY #2%
- \global\chardef\arrangedpageT #3%
- \global\chardef\horizontalcutmarks#4%
- \global\chardef\verticalcutmarks #5%
- \global\let \pusharrangedpage #6%
- \global\let \poparrangedpages #7%
- \global\let \handlearrangedpage#8}
-
-\installpagearrangement {\v!normal}
- {\global\arrangingpagesfalse}
-
-\installpagearrangement 2*16
- {\dosetuparrangement{4}{4}{16}{5}{5}%
- \pusharrangedpageTHIRTYTWO\poparrangedpagesAB\relax}
-
-\installpagearrangement 2*8
- {\dosetuparrangement{4}{2}{8}{5}{3}%
- \pusharrangedpageSIXTEEN\poparrangedpagesAB\relax}
-
-\installpagearrangement 2*4
- {\dosetuparrangement{2}{2}{4}{3}{3}%
- \pusharrangedpageEIGHT\poparrangedpagesAB\relax}
-
-\installpagearrangement 2*2
- {\dosetuparrangement{2}{1}{2}{3}{2}%
- \pusharrangedpageFOURA\poparrangedpagesAB\relax}
-
-\installpagearrangement 2**2
- {\dosetuparrangement{2}{1}{2}{3}{2}%
- \pusharrangedpageFOURB\poparrangedpagesAB\relax}
-
-\installpagearrangement 2SIDE
- {\dosetuparrangement{2}{1}{2}{3}{2}%
- \pusharrangedpageSIDETOP\poparrangedpagesTWO\handlearrangedpageSIDE}
-
-\installpagearrangement 2TOP
- {\dosetuparrangement{1}{2}{2}{2}{3}%
- \pusharrangedpageSIDETOP\poparrangedpagesTWO\handlearrangedpageTOP}
-
-\installpagearrangement 2UP
- {\dosetuparrangement{2}{1}{4}{3}{2}%
- \pusharrangedpageTWO\poparrangedpagesTWO\handlearrangedpageTWOUP}
-
-\installpagearrangement 2DOWN
- {\dosetuparrangement{1}{2}{4}{2}{3}%
- \pusharrangedpageTWO\poparrangedpagesTWO\handlearrangedpageTWODOWN}
-
-\installpagearrangement 2*4*2 % one defined by Willy Egger:
- {\dosetuparrangement{2}{2}{4}{3}{3}%
- \pusharrangedpageSIXTEENTWO\poparrangedpagesAtoD\relax}
-
-\installpagearrangement 2*2*4 % onother one of Willy Egger
- {\dosetuparrangement{2}{1}{8}{3}{2}%
- \pusharrangedpageSIXTEENFOUR\poparrangedpagesAtoH\relax}
-
-\installpagearrangement 2TOPSIDE
- {\dosetuparrangement{1}{2}{4}{2}{3}%
- \pusharrangedpageTWOTOPSIDE\poparrangedpagesTWOTOPSIDE\handlearrangedpageTOP}
-
-% \def\filluparrangedpages % beware: \realpageno is 1 ahead
-% {\ifarrangingpages
-% \scratchcounter-\realpageno
-% \divide\scratchcounter \arrangedpageT
-% \multiply\scratchcounter \arrangedpageT
-% \advance\scratchcounter \realpageno
-% \advance\scratchcounter \minusone
-% \dorecurse\scratchcounter{\noheaderandfooterlines\ejectdummypage}%
-% \fi}
-
-\def\filluparrangedpages % beware: \realpageno is 1 ahead
- {\ifarrangingpages
- \scratchcounter\numexpr\realpageno-\plusone\relax
- \dosetmodulo\scratchcounter\arrangedpageT\scratchcounter
- \ifcase\scratchcounter\else
- \advance\scratchcounter \plusone
- \dostepwiserecurse\scratchcounter\arrangedpageT\plusone
- {\noheaderandfooterlines\ejectdummypage}%
- \fi
- \fi}
-
-\def\handlearrangedpageXandY#1#2#3#4#5%
- {\global\setbox#5\hbox to \arrangedpageX\paperwidth
- {\setbox\scratchbox\vbox to \arrangedpageY\paperheight
- {\forgetall
- \offinterlineskip
- \dontcomplain
- \vskip#4\paperheight
- \hskip#3\paperwidth
- \dorotatebox{\ifcase#2 0\else180\fi}\hbox{\box#1}%
- \vfill}%
- \wd\scratchbox\zeropoint
- \box\scratchbox\box#5\hss}}
-
-\def\gotonextarrangepage
- {\global\advance\arrangeno \plusone
- \def\pagecutmarksymbol{\the\arrangeno}}
-
-\def\outputarrangedbox#1%
- {\bgroup
- \gotonextarrangepage
- \ifnum\arrangedrotationO\arrangedrotationE>\zerocount
- \setbox#1\vbox
- {\ifdoublearranged
- \ifodd\arrangeno
- \dorotatebox\arrangedrotationO\hbox{\box#1}%
- \else
- \dorotatebox\arrangedrotationE\hbox{\box#1}%
- \fi
- \else
- \dorotatebox\arrangedrotationO\hbox{\box#1}%
- \fi}%
- \fi
- \ifmirrorarranged
- \setbox#1\vbox{\domirrorbox\vbox{\box#1}}%
- \fi
- \ifnegatearranged
- \negatecolorbox{#1}%
- \fi
- \finishpagebox#1%
- \ifconditional\arrangedbackgroundokay\addprintbackground#1\fi
- \actualshipout{\box#1}%
- \egroup}
-
-%D The format file can be 16K smaller when we postpone the
-%D real arrangments. Some day ...
-
-% TOP
-
-% 32/16/8/4/SIDE
-
-\def\poparrangedpagesAB
- {\ifnum\arrangedpageN>\zerocount
- \dontcomplain
- \paperwidth\arrangedpageX\paperwidth
- \paperheight\arrangedpageY\paperheight
- \outputarrangedbox\arrangedpageA
- \outputarrangedbox\arrangedpageB
- \doglobal\newcounter\arrangedpageN
- \fi}
-
-\def\pusharrangedpageTHIRTYTWO#1% taco's challenge
- {\doglobal\increment\arrangedpageN
- \reportarrangedpage\arrangedpageN
- \ifcase\arrangedpageN
- \or \handlearrangedpageXandY{#1}033\arrangedpageA % 1
- \or \handlearrangedpageXandY{#1}003\arrangedpageB % 2
- \or \handlearrangedpageXandY{#1}100\arrangedpageB % 3
- \or \handlearrangedpageXandY{#1}130\arrangedpageA % 4
- \or \handlearrangedpageXandY{#1}100\arrangedpageA % 5
- \or \handlearrangedpageXandY{#1}130\arrangedpageB % 6
- \or \handlearrangedpageXandY{#1}033\arrangedpageB % 7
- \or \handlearrangedpageXandY{#1}003\arrangedpageA % 8
- \or \handlearrangedpageXandY{#1}102\arrangedpageA % 9
- \or \handlearrangedpageXandY{#1}132\arrangedpageB % 10
- \or \handlearrangedpageXandY{#1}031\arrangedpageB % 11
- \or \handlearrangedpageXandY{#1}001\arrangedpageA % 12
- \or \handlearrangedpageXandY{#1}031\arrangedpageA % 13
- \or \handlearrangedpageXandY{#1}001\arrangedpageB % 14
- \or \handlearrangedpageXandY{#1}102\arrangedpageB % 15
- \or \handlearrangedpageXandY{#1}132\arrangedpageA % 16
- \or \handlearrangedpageXandY{#1}122\arrangedpageA % 17
- \or \handlearrangedpageXandY{#1}112\arrangedpageB % 18
- \or \handlearrangedpageXandY{#1}011\arrangedpageB % 19
- \or \handlearrangedpageXandY{#1}021\arrangedpageA % 20
- \or \handlearrangedpageXandY{#1}011\arrangedpageA % 21
- \or \handlearrangedpageXandY{#1}021\arrangedpageB % 22
- \or \handlearrangedpageXandY{#1}122\arrangedpageB % 23
- \or \handlearrangedpageXandY{#1}112\arrangedpageA % 24
- \or \handlearrangedpageXandY{#1}013\arrangedpageA % 25
- \or \handlearrangedpageXandY{#1}023\arrangedpageB % 26
- \or \handlearrangedpageXandY{#1}120\arrangedpageB % 27
- \or \handlearrangedpageXandY{#1}110\arrangedpageA % 28
- \or \handlearrangedpageXandY{#1}120\arrangedpageA % 29
- \or \handlearrangedpageXandY{#1}110\arrangedpageB % 30
- \or \handlearrangedpageXandY{#1}013\arrangedpageB % 31
- \or \handlearrangedpageXandY{#1}023\arrangedpageA % 32
- \poparrangedpages
- \fi}
-
-\def\pusharrangedpageSIXTEEN#1% changed to match the official way of doing
- {\doglobal\increment\arrangedpageN
- \reportarrangedpage\arrangedpageN
- \ifcase\arrangedpageN
- \or \handlearrangedpageXandY{#1}031\arrangedpageA % 1
- \or \handlearrangedpageXandY{#1}001\arrangedpageB % 2
- \or \handlearrangedpageXandY{#1}031\arrangedpageB % 3
- \or \handlearrangedpageXandY{#1}001\arrangedpageA % 4
- \or \handlearrangedpageXandY{#1}100\arrangedpageA % 5
- \or \handlearrangedpageXandY{#1}130\arrangedpageB % 6
- \or \handlearrangedpageXandY{#1}100\arrangedpageB % 7
- \or \handlearrangedpageXandY{#1}130\arrangedpageA % 8
- \or \handlearrangedpageXandY{#1}120\arrangedpageA % 9
- \or \handlearrangedpageXandY{#1}110\arrangedpageB % 10
- \or \handlearrangedpageXandY{#1}120\arrangedpageB % 11
- \or \handlearrangedpageXandY{#1}110\arrangedpageA % 12
- \or \handlearrangedpageXandY{#1}011\arrangedpageA % 13
- \or \handlearrangedpageXandY{#1}021\arrangedpageB % 14
- \or \handlearrangedpageXandY{#1}011\arrangedpageB % 15
- \or \handlearrangedpageXandY{#1}021\arrangedpageA % 16
- \poparrangedpages
- \fi}
-
-\def\pusharrangedpageEIGHT#1% changed to match the official way of doing
- {\doglobal\increment\arrangedpageN
- \reportarrangedpage\arrangedpageN
- \ifcase\arrangedpageN
- \or \handlearrangedpageXandY{#1}011\arrangedpageA % 1
- \or \handlearrangedpageXandY{#1}001\arrangedpageB % 2
- \or \handlearrangedpageXandY{#1}100\arrangedpageB % 3
- \or \handlearrangedpageXandY{#1}110\arrangedpageA % 4
- \or \handlearrangedpageXandY{#1}100\arrangedpageA % 5
- \or \handlearrangedpageXandY{#1}110\arrangedpageB % 6
- \or \handlearrangedpageXandY{#1}011\arrangedpageB % 7
- \or \handlearrangedpageXandY{#1}001\arrangedpageA % 8
- \poparrangedpages
- \fi}
-
-\def\pusharrangedpageFOURA{\pusharrangedpageFOURdo01}
-\def\pusharrangedpageFOURB{\pusharrangedpageFOURdo10}
-
-\def\pusharrangedpageFOURdo#1#2#3%
- {\doglobal\increment\arrangedpageN
- \reportarrangedpage\arrangedpageN
- \ifcase\arrangedpageN
- \or \handlearrangedpageXandY{#3}010\arrangedpageA % 1
- \or \handlearrangedpageXandY{#3}0{#1}0\arrangedpageB % 2/3 not {1}
- \or \handlearrangedpageXandY{#3}0{#2}0\arrangedpageB % 3/2 not {1}
- \or \handlearrangedpageXandY{#3}000\arrangedpageA % 4
- \poparrangedpages
- \fi}
-
-\def\pusharrangedpageSIDETOP#1%
- {\doglobal\increment\arrangedpageN
- \reportarrangedpage\arrangedpageN
- \ifcase\arrangedpageN
- \or \handlearrangedpageXandY{#1}000\arrangedpageA % 1
- \or \handlearrangedpageXandY{#1}000\arrangedpageB % 2
- \poparrangedpages
- \fi}
-
-\def\handlearrangedpageSIDE
- {\wd\arrangedpageA\paperwidth
- \wd\arrangedpageB\paperwidth
- \global\setbox\arrangedpageA\hbox
- {\box\arrangedpageA\box\arrangedpageB}%
- \ht\arrangedpageA\paperheight}
-
-\def\handlearrangedpageTOP
- {\ht\arrangedpageA\paperheight
- \ht\arrangedpageB\paperheight
- \global\setbox\arrangedpageA\vbox
- {\forgetall\offinterlineskip\vskip\paperheight
- \box\arrangedpageA\box\arrangedpageB}%
- \global\setbox\arrangedpageB\box\scratchbox} % ?
-
-% 2UP/2DOWN / 1pt prevents overflow
-
-\def\splitoffarrangedpagesTWO
- {\splittopskip\zeropoint
- \global\setbox\arrangedpageA\vsplit\arrangedpageB to \onepoint
- \scratchdimen\dimexpr\ht\arrangedpageB-\onepoint\relax
- \ifdim\scratchdimen>\onepoint
- \setbox\scratchbox\vsplit\arrangedpageB to \scratchdimen
- \fi}
-
-\def\handlearrangedpageTWOUP
- {\splitoffarrangedpagesTWO
- \ifswaparranged
- \global\setbox\arrangedpageA\hbox
- {\clippedprintbox0\arrangedpageA
- \clippedprintbox1\arrangedpageB}%
- \swaparrangedfalse
- \else
- \global\setbox\arrangedpageA\hbox
- {\clippedprintbox0\arrangedpageB
- \clippedprintbox1\arrangedpageA}%
- \swaparrangedtrue
- \fi
- \ht\arrangedpageA\paperheight
- \global\setbox\arrangedpageB\box\scratchbox}
-
-\def\handlearrangedpageTWODOWN
- {\splitoffarrangedpagesTWO
- \ht\arrangedpageA\paperheight
- \ht\arrangedpageB\paperheight
- \ifswaparranged
- \global\setbox\arrangedpageA\vbox
- {\forgetall\offinterlineskip\vskip\paperheight
- \box\arrangedpageA\box\arrangedpageB}%
- \swaparrangedfalse
- \else
- \global\setbox\arrangedpageA\vbox
- {\forgetall\offinterlineskip\vskip\paperheight
- \box\arrangedpageB\box\arrangedpageA}%
- \swaparrangedtrue
- \fi
- \global\setbox\arrangedpageB\box\scratchbox}
-
-\def\poparrangedpagesTWO
- {\ifnum\arrangedpageN>\zerocount
- \dontcomplain
- \swaparrangedfalse
- \doloop
- {\handlearrangedpage
- \bgroup
- \paperwidth\arrangedpageX\paperwidth
- \paperheight\arrangedpageY\paperheight
- \ht\arrangedpageA\paperheight
- \wd\arrangedpageA\paperwidth
- \outputarrangedbox\arrangedpageA
- \egroup
- \ifdim\ht\arrangedpageB=\zeropoint
- \exitloop
- \fi}%
- \doglobal\newcounter\arrangedpageN
- \fi}
-
-\def\pusharrangedpageTWO#1%
- {\doglobal\increment\arrangedpageN
- \reportarrangedpage\arrangedpageN
- \global\setbox\arrangedpageB\vbox
- {\forgetall
- \offinterlineskip
- \unvbox\arrangedpageB
- \allowbreak
- \ht#1\onepoint
- \dp#1\zeropoint
- \vbox{\box#1}}}
-
-\def\poparrangedpagesTWOTOPSIDE
- {\ifnum\arrangedpageN>\zerocount
- \bgroup
- \gdef\arrangedpageN{2}\poparrangedpagesTWO
- \let\arrangedpageA\arrangedpageC
- \let\arrangedpageB\arrangedpageD
- \gdef\arrangedpageN{2}\poparrangedpagesTWO
- \doglobal\newcounter\arrangedpageN
- \egroup
- \fi}
-
-\def\pusharrangedpageTWOTOPSIDE#1%
- {\doglobal\increment\arrangedpageN
- \reportarrangedpage\arrangedpageN
- \ifcase\arrangedpageN
- \or \handlearrangedpageXandY{#1}000\arrangedpageA % 1
- \or \handlearrangedpageXandY{#1}000\arrangedpageC % 2
- \or \handlearrangedpageXandY{#1}000\arrangedpageB % 1
- \or \handlearrangedpageXandY{#1}000\arrangedpageD % 2
- \poparrangedpages
- \fi}
-
-%D Willy Egger's sheet simulations:
-
-\def\poparrangedpagesAtoH
- {\ifnum\arrangedpageN>\zerocount
- \dontcomplain
- \paperwidth\arrangedpageX\paperwidth
- \paperheight\arrangedpageY\paperheight
- \outputarrangedbox\arrangedpageA
- \outputarrangedbox\arrangedpageB
- \outputarrangedbox\arrangedpageC
- \outputarrangedbox\arrangedpageD
- \outputarrangedbox\arrangedpageE
- \outputarrangedbox\arrangedpageF
- \outputarrangedbox\arrangedpageG
- \outputarrangedbox\arrangedpageH
- \doglobal\newcounter\arrangedpageN
- \fi}
-
-% to arrange 16 pages on 2 sheets to form one booklet
-
-\def\poparrangedpagesAtoD
- {\ifnum\arrangedpageN>\zerocount
- \dontcomplain
- \paperwidth\arrangedpageX\paperwidth
- \paperheight\arrangedpageY\paperheight
- \outputarrangedbox\arrangedpageA
- \outputarrangedbox\arrangedpageB
- \outputarrangedbox\arrangedpageC
- \outputarrangedbox\arrangedpageD
- \doglobal\newcounter\arrangedpageN
- \fi}
-
-% to arrange 16 pages on 4 sheets to form one booklet
-
-\def\pusharrangedpageSIXTEENFOUR#1%
- {\doglobal\increment\arrangedpageN
- \reportarrangedpage\arrangedpageN
- \ifcase\arrangedpageN
- \or \handlearrangedpageXandY{#1}010\arrangedpageA % 1
- \or \handlearrangedpageXandY{#1}000\arrangedpageB % 2
- \or \handlearrangedpageXandY{#1}010\arrangedpageC % 3
- \or \handlearrangedpageXandY{#1}000\arrangedpageD % 4
- \or \handlearrangedpageXandY{#1}010\arrangedpageE % 5
- \or \handlearrangedpageXandY{#1}000\arrangedpageF % 6
- \or \handlearrangedpageXandY{#1}010\arrangedpageG % 7
- \or \handlearrangedpageXandY{#1}000\arrangedpageH % 8
- \or \handlearrangedpageXandY{#1}010\arrangedpageH % 9
- \or \handlearrangedpageXandY{#1}000\arrangedpageG % 10
- \or \handlearrangedpageXandY{#1}010\arrangedpageF % 11
- \or \handlearrangedpageXandY{#1}000\arrangedpageE % 12
- \or \handlearrangedpageXandY{#1}010\arrangedpageD % 13
- \or \handlearrangedpageXandY{#1}000\arrangedpageC % 14
- \or \handlearrangedpageXandY{#1}010\arrangedpageB % 15
- \or \handlearrangedpageXandY{#1}000\arrangedpageA % 16
- \poparrangedpages
- \fi}
-
-% to arrange 16 pages on 2 sheets to form one booklet
-
-\def\pusharrangedpageSIXTEENTWO#1%
- {\doglobal\increment\arrangedpageN
- \reportarrangedpage\arrangedpageN
- \ifcase\arrangedpageN
- \or \handlearrangedpageXandY{#1}011\arrangedpageA % 1
- \or \handlearrangedpageXandY{#1}001\arrangedpageB % 2
- \or \handlearrangedpageXandY{#1}011\arrangedpageC % 3
- \or \handlearrangedpageXandY{#1}001\arrangedpageD % 4
- \or \handlearrangedpageXandY{#1}100\arrangedpageD % 5
- \or \handlearrangedpageXandY{#1}110\arrangedpageC % 6
- \or \handlearrangedpageXandY{#1}100\arrangedpageB % 7
- \or \handlearrangedpageXandY{#1}110\arrangedpageA % 8
- \or \handlearrangedpageXandY{#1}100\arrangedpageA % 9
- \or \handlearrangedpageXandY{#1}110\arrangedpageB % 10
- \or \handlearrangedpageXandY{#1}100\arrangedpageC % 11
- \or \handlearrangedpageXandY{#1}110\arrangedpageD % 12
- \or \handlearrangedpageXandY{#1}011\arrangedpageD % 13
- \or \handlearrangedpageXandY{#1}001\arrangedpageC % 14
- \or \handlearrangedpageXandY{#1}011\arrangedpageB % 15
- \or \handlearrangedpageXandY{#1}001\arrangedpageA % 16
- \poparrangedpages
- \fi}
-
-% % handy for stickers etc, this way we can treat them as page
-%
-% \setuppapersize [XY][A4]
-% \setuppaper [topspace=5mm,backspace=5mm,dx=1mm,dy=1mm,nx=2,ny=6]
-% \setuplayout [page] [topspace=5mm,backspace=5mm]
-% \setuplayout [page]
-% \setuplayout [location=middle]
-% \setuparranging [XY]
-% \showframe
-%
-% \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
- \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
- \dontcomplain
- \paperwidth\arrangedpageX\paperwidth
- \paperheight \arrangedpageY\paperheight
- \outputarrangedbox\arrangedpageA
- \doglobal\newcounter\arrangedpageN
- \doglobal\newcounter\arrangedpageM
- \fi}
-
-\installpagearrangement XY
- {\dosetuparrangement\@@ppnx\@@ppny\@@ppxy\!!zerocount\!!zerocount
- \pusharrangedpageXY\poparrangedpagesXY\relax}
-
-%D A crazy definition, don't guess who pushed me for the landscape option.
-
-\definepapersize
- [XY]
- [\c!height=\dimexpr\dimexpr\@@ppheight-\numexpr\@@ppny-1\relax\dimexpr\@@ppdy\relax\relax/\@@ppny\relax,
- \c!width =\dimexpr\dimexpr\@@ppwidth -\numexpr\@@ppnx-1\relax\dimexpr\@@ppdx\relax\relax/\@@ppnx\relax]
-
-\setuppaper
- [\c!width =\dimexpr\printpaperwidth -2\dimexpr\@@ppbackspace\relax\relax,
- \c!height=\dimexpr\printpaperheight-2\dimexpr\@@pptopspace \relax\relax]
-
-%D Might be used if a printer is printing from a rol or creating mini-books from A4:
-%D This section has 16 pages. The folding scheme is first a Z-fold and at the end
-%D a final fold in the spine.
-%D Coding: [2*8*Z]
-
-\installpagearrangement 2*8*Z
- {\dosetuparrangement{2}{4}{8}{3}{5}% X,Y,Total,hcutmarks,vcutmarks
- \pusharrangedpageSIXTEENZ\poparrangedpagesAB\relax}
-
-\def\pusharrangedpageSIXTEENZ#1%
- {\doglobal\increment\arrangedpageN
- \reportarrangedpage\arrangedpageN
- \ifcase\arrangedpageN
- \or \handlearrangedpageXandY{#1}010\arrangedpageA % 1
- \or \handlearrangedpageXandY{#1}000\arrangedpageB % 2
- \or \handlearrangedpageXandY{#1}101\arrangedpageB % 3
- \or \handlearrangedpageXandY{#1}111\arrangedpageA % 4
- \or \handlearrangedpageXandY{#1}012\arrangedpageA % 5
- \or \handlearrangedpageXandY{#1}002\arrangedpageB % 6
- \or \handlearrangedpageXandY{#1}103\arrangedpageB % 7
- \or \handlearrangedpageXandY{#1}113\arrangedpageA % 8
- \or \handlearrangedpageXandY{#1}103\arrangedpageA % 9
- \or \handlearrangedpageXandY{#1}113\arrangedpageB % 10
- \or \handlearrangedpageXandY{#1}012\arrangedpageB % 11
- \or \handlearrangedpageXandY{#1}002\arrangedpageA % 12
- \or \handlearrangedpageXandY{#1}101\arrangedpageA % 13
- \or \handlearrangedpageXandY{#1}111\arrangedpageB % 14
- \or \handlearrangedpageXandY{#1}010\arrangedpageB % 15
- \or \handlearrangedpageXandY{#1}000\arrangedpageA % 16
- \poparrangedpages
- \fi}
-
-%D Another Z-folded section with 12 pages
-%D Coding: [2*6*Z]
-
-\installpagearrangement 2*6*Z
- {\dosetuparrangement{2}{3}{6}{3}{4}% X,Y,Total,hcutmarks,vcutmarks
- \pusharrangedpageTWELVEZ\poparrangedpagesAB\relax}
-
-\def\pusharrangedpageTWELVEZ#1%
- {\doglobal\increment\arrangedpageN
- \reportarrangedpage\arrangedpageN
- \ifcase\arrangedpageN
- \or \handlearrangedpageXandY{#1}010\arrangedpageA % 1: rotation (0=upright),x (0=first column),y (0=first row)
- \or \handlearrangedpageXandY{#1}000\arrangedpageB % 2
- \or \handlearrangedpageXandY{#1}101\arrangedpageB % 3
- \or \handlearrangedpageXandY{#1}111\arrangedpageA % 4
- \or \handlearrangedpageXandY{#1}012\arrangedpageA % 5
- \or \handlearrangedpageXandY{#1}002\arrangedpageB % 6
- \or \handlearrangedpageXandY{#1}012\arrangedpageB % 7
- \or \handlearrangedpageXandY{#1}002\arrangedpageA % 8
- \or \handlearrangedpageXandY{#1}101\arrangedpageA % 9
- \or \handlearrangedpageXandY{#1}111\arrangedpageB % 10
- \or \handlearrangedpageXandY{#1}010\arrangedpageB % 11
- \or \handlearrangedpageXandY{#1}000\arrangedpageA % 12
- \poparrangedpages
- \fi}
-
-%D For Heinz' special greeting cards folding. This scheme is also used for the PocketDiary (module):
-%D Coding: [1*8]
-
-\installpagearrangement 1*8
- {\dosetuparrangement{4}{2}{8}{5}{3} % X,Y,Total,hcutmarks,vcutmarks
- \pusharrangedpageEIGHTSINGLESIDEDFOLDED\poparrangedpagesTWO\relax}
-
-\def\pusharrangedpageEIGHTSINGLESIDEDFOLDED#1%
- {\doglobal\increment\arrangedpageN
- \reportarrangedpage\arrangedpageN
- \ifcase\arrangedpageN
- \or \handlearrangedpageXandY{#1}010\arrangedpageA % 1 rot,hskip,vskip
- \or \handlearrangedpageXandY{#1}020\arrangedpageA % 2
- \or \handlearrangedpageXandY{#1}030\arrangedpageA % 3
- \or \handlearrangedpageXandY{#1}131\arrangedpageA % 4
- \or \handlearrangedpageXandY{#1}121\arrangedpageA % 5
- \or \handlearrangedpageXandY{#1}111\arrangedpageA % 6
- \or \handlearrangedpageXandY{#1}101\arrangedpageA % 7
- \or \handlearrangedpageXandY{#1}000\arrangedpageA % 8
- \poparrangedpages
- \fi}
-
-%D This is not a section. \CONTEXT\ places 4 pages on a sheet of paper, singlesided
-%D Coding: [1*4]
-
-\installpagearrangement 1*4
- {\dosetuparrangement{2}{2}{4}{3}{3} % X,Y,Total,hcutmarks,vcutmarks
- \pusharrangedpageFOURSINGLESIDEDFOLDED\poparrangedpagesTWO\relax}
-
-\def\pusharrangedpageFOURSINGLESIDEDFOLDED#1%
- {\doglobal\increment\arrangedpageN
- \reportarrangedpage\arrangedpageN
- \ifcase\arrangedpageN
- \or \handlearrangedpageXandY{#1}100\arrangedpageA % 1 rot,hskip,vskip
- \or \handlearrangedpageXandY{#1}001\arrangedpageA % 2
- \or \handlearrangedpageXandY{#1}011\arrangedpageA % 3
- \or \handlearrangedpageXandY{#1}110\arrangedpageA % 4
- \poparrangedpages
- \fi}
-
-%D This imposition scheme was requested by Hraban Ramm, by Willi Egger 21-07-2003
-%D Coding: [3SIDE]
-
-\installpagearrangement 3SIDE
- {\dosetuparrangement{3}{1}{3}{4}{2}% X,Y,Total,hcutmarks,vcutmarks
- \pusharrangedpageTHREESIDE\poparrangedpagesAB\relax}
-
-\def\pusharrangedpageTHREESIDE#1% Willi's approach
- {\doglobal\increment\arrangedpageN
- \reportarrangedpage\arrangedpageN
- \ifcase\arrangedpageN
- \or \handlearrangedpageXandY{#1}000\arrangedpageA % 1 rot,hskip,vskip
- \or \handlearrangedpageXandY{#1}010\arrangedpageA % 2
- \or \handlearrangedpageXandY{#1}020\arrangedpageA % 3
- \or \handlearrangedpageXandY{#1}000\arrangedpageB % 4
- \or \handlearrangedpageXandY{#1}010\arrangedpageB % 5
- \or \handlearrangedpageXandY{#1}020\arrangedpageB % 6
- \poparrangedpages
- \fi}
-
-%D FLYER in three parts and 6 pages 22-10-2010
-%D Coding: [TRYPTICHON]
-
-\installpagearrangement TRYPTICHON
- {\dosetuparrangement{3}{1}{3}{4}{2}% X,Y,Total,hcutmarks,vcutmarks
- \pusharrangedpageFOLDERSIX\poparrangedpagesAB\relax}
-
-\def\pusharrangedpageFOLDERSIX#1% Willi's approach
- {\doglobal\increment\arrangedpageN
- \reportarrangedpage\arrangedpageN
- \ifcase\arrangedpageN
- \or \handlearrangedpageXandY{#1}020\arrangedpageA % 1 rot,hskip,vskip
- \or \handlearrangedpageXandY{#1}000\arrangedpageB % 2
- \or \handlearrangedpageXandY{#1}010\arrangedpageB % 3
- \or \handlearrangedpageXandY{#1}020\arrangedpageB % 4
- \or \handlearrangedpageXandY{#1}000\arrangedpageA % 5
- \or \handlearrangedpageXandY{#1}010\arrangedpageA % 6
- \poparrangedpages
- \fi}
-
-%D FLYER in Z-fold with 8 pages 22-01-2010
-%D Coding: [ZFLYER-8]
-
-\installpagearrangement ZFLYER-8
- {\dosetuparrangement{4}{1}{4}{5}{2}% X,Y,Total,hcutmarks,vcutmarks
- \pusharrangedpageZFOLDEREIGHT\poparrangedpagesAB\relax}
-
-\def\pusharrangedpageZFOLDEREIGHT#1% Willi's approach
- {\doglobal\increment\arrangedpageN
- \reportarrangedpage\arrangedpageN
- \ifcase\arrangedpageN
- \or \handlearrangedpageXandY{#1}030\arrangedpageA % 1 rot,hskip,vskip
- \or \handlearrangedpageXandY{#1}000\arrangedpageB % 2
- \or \handlearrangedpageXandY{#1}010\arrangedpageB % 3
- \or \handlearrangedpageXandY{#1}020\arrangedpageB % 4
- \or \handlearrangedpageXandY{#1}030\arrangedpageB % 5
- \or \handlearrangedpageXandY{#1}000\arrangedpageA % 6
- \or \handlearrangedpageXandY{#1}010\arrangedpageA % 7
- \or \handlearrangedpageXandY{#1}020\arrangedpageA % 8
- \poparrangedpages
- \fi}
-
-%D FLYER in Z-fold with 10 pages 04-08-2010
-%D Coding: [ZFLYER-10]
-
-\installpagearrangement ZFLYER-10
- {\dosetuparrangement{5}{1}{5}{6}{2}% X,Y,Total,hcutmarks,vcutmarks
- \pusharrangedpageZFLYERTEN\poparrangedpagesAB\relax}
-
-\def\pusharrangedpageZFLYERTEN#1% Willi's approach
- {\doglobal\increment\arrangedpageN
- \reportarrangedpage\arrangedpageN
- \ifcase\arrangedpageN
- \or \handlearrangedpageXandY{#1}040\arrangedpageA % 1 rot,hskip,vskip
- \or \handlearrangedpageXandY{#1}000\arrangedpageB % 2
- \or \handlearrangedpageXandY{#1}010\arrangedpageB % 3
- \or \handlearrangedpageXandY{#1}020\arrangedpageB % 4
- \or \handlearrangedpageXandY{#1}030\arrangedpageB % 5
- \or \handlearrangedpageXandY{#1}040\arrangedpageB % 6
- \or \handlearrangedpageXandY{#1}000\arrangedpageA % 7
- \or \handlearrangedpageXandY{#1}010\arrangedpageA % 8
- \or \handlearrangedpageXandY{#1}020\arrangedpageA % 9
- \or \handlearrangedpageXandY{#1}030\arrangedpageA % 10
- \poparrangedpages
- \fi}
-
-
-%D FLYER in Z-fold with 12 pages 04-08-2010
-%D Coding: [ZFLYER-12]
-
-\installpagearrangement ZFLYER-12
- {\dosetuparrangement{6}{1}{6}{7}{2}% X,Y,Total,hcutmarks,vcutmarks
- \pusharrangedpageZFLYERTWELVE\poparrangedpagesAB\relax}
-
-\def\pusharrangedpageZFLYERTWELVE#1% Willi's approach
- {\doglobal\increment\arrangedpageN
- \reportarrangedpage\arrangedpageN
- \ifcase\arrangedpageN
- \or \handlearrangedpageXandY{#1}050\arrangedpageA % 1 rot,hskip,vskip
- \or \handlearrangedpageXandY{#1}000\arrangedpageB % 2
- \or \handlearrangedpageXandY{#1}010\arrangedpageB % 3
- \or \handlearrangedpageXandY{#1}020\arrangedpageB % 4
- \or \handlearrangedpageXandY{#1}030\arrangedpageB % 5
- \or \handlearrangedpageXandY{#1}040\arrangedpageB % 6
- \or \handlearrangedpageXandY{#1}050\arrangedpageB % 7
- \or \handlearrangedpageXandY{#1}000\arrangedpageA % 8
- \or \handlearrangedpageXandY{#1}010\arrangedpageA % 9
- \or \handlearrangedpageXandY{#1}020\arrangedpageA % 10
- \or \handlearrangedpageXandY{#1}030\arrangedpageA % 11
- \or \handlearrangedpageXandY{#1}040\arrangedpageA % 12
- \poparrangedpages
- \fi}
-
-%D FLYER folded as a map with 6 pages per side.
-%D Coding: [MAPFLYER-12]
-
-\installpagearrangement MAPFLYER-12
- {\dosetuparrangement{3}{2}{6}{4}{2}% X,Y,Total,hcutmarks,vcutmarks
- \pusharrangedpageMFOLDERTWELVE\poparrangedpagesAB\relax}
-
-\def\pusharrangedpageMFOLDERTWELVE#1% Willi's approach
- {\doglobal\increment\arrangedpageN
- \reportarrangedpage\arrangedpageN
- \ifcase\arrangedpageN
- \or \handlearrangedpageXandY{#1}020\arrangedpageA % 1 rot,hskip,vskip
- \or \handlearrangedpageXandY{#1}000\arrangedpageB % 2
- \or \handlearrangedpageXandY{#1}001\arrangedpageB % 3
- \or \handlearrangedpageXandY{#1}010\arrangedpageB % 4
- \or \handlearrangedpageXandY{#1}011\arrangedpageB % 5
- \or \handlearrangedpageXandY{#1}020\arrangedpageB % 6
- \or \handlearrangedpageXandY{#1}021\arrangedpageB % 7
- \or \handlearrangedpageXandY{#1}000\arrangedpageA % 8
- \or \handlearrangedpageXandY{#1}001\arrangedpageA % 9
- \or \handlearrangedpageXandY{#1}010\arrangedpageA % 10
- \or \handlearrangedpageXandY{#1}011\arrangedpageA % 11
- \or \handlearrangedpageXandY{#1}021\arrangedpageA % 12
- \poparrangedpages
- \fi}
-
-%D FLYER folded as double window with 4 pages per side.
-%D Coding: [DOUBLEWINDOW]
-
-\installpagearrangement DOUBLEWINDOW
- {\dosetuparrangement{4}{1}{4}{5}{2}% X,Y,Total,hcutmarks,vcutmarks
- \pusharrangedpageDOUBLEWINDOWEIGHT\poparrangedpagesAB\relax}
-
-\def\pusharrangedpageDOUBLEWINDOWEIGHT#1% Willi's approach
- {\doglobal\increment\arrangedpageN
- \reportarrangedpage\arrangedpageN
- \ifcase\arrangedpageN
- \or \handlearrangedpageXandY{#1}020\arrangedpageA % 1 rot,hskip,vskip
- \or \handlearrangedpageXandY{#1}030\arrangedpageA % 2
- \or \handlearrangedpageXandY{#1}000\arrangedpageB % 3
- \or \handlearrangedpageXandY{#1}010\arrangedpageB % 4
- \or \handlearrangedpageXandY{#1}020\arrangedpageB % 5
- \or \handlearrangedpageXandY{#1}030\arrangedpageB % 6
- \or \handlearrangedpageXandY{#1}000\arrangedpageA % 7
- \or \handlearrangedpageXandY{#1}010\arrangedpageA % 8
- \poparrangedpages
- \fi}
-
-%D Imposition as requested by Jan Pohanka 26-08-2010, 4 pages, two verso, two recto,
-%D uneven pages upright and down, even pages top and rotated 180.
-%D Implementation with 2 pages for conference-name-display
-%D Coding: [1*2-Conference]
-
-\installpagearrangement 1*2-Conference
- {\dosetuparrangement{1}{2}{4}{3}{2}% X,Y,Total,hcutmarks,vcutmarks
- \pusharrangedpageCONFERENCE2\poparrangedpagesAB\relax}
-
-\def\pusharrangedpageCONFERENCE2#1%
- {\doglobal\increment\arrangedpageN
- \reportarrangedpage\arrangedpageN
- \ifcase\arrangedpageN
- \or \handlearrangedpageXandY{#1}001\arrangedpageA % 1 rot,hskip,vskip
- \or \handlearrangedpageXandY{#1}100\arrangedpageA % 2
- \poparrangedpages
- \fi}
-
-%D Implementation with 4 pages for conference-name-display
-%D Coding: [1*4-Conference]
-
-\installpagearrangement 1*4-Conference
- {\dosetuparrangement{1}{2}{4}{3}{2}% X,Y,Total,hcutmarks,vcutmarks
- \pusharrangedpageCONFERENCE4\poparrangedpagesAB\relax}
-
-\def\pusharrangedpageCONFERENCE4#1%
- {\doglobal\increment\arrangedpageN
- \reportarrangedpage\arrangedpageN
- \ifcase\arrangedpageN
- \or \handlearrangedpageXandY{#1}001\arrangedpageA % 1 rot,hskip,vskip
- \or \handlearrangedpageXandY{#1}100\arrangedpageA % 2
- \or \handlearrangedpageXandY{#1}011\arrangedpageB % 3
- \or \handlearrangedpageXandY{#1}110\arrangedpageB % 4
- \poparrangedpages
- \fi}
-
-% There should be arrangements for section made of heavy and thick paper. i.e. the heavier the paper
-% the fewer pages per section:
-% Section with 8 pages put on to sheets of paper. Each sheet carries recto 2 and verso 2 pages.
-% Coding: [2*2*2]
-
-\installpagearrangement 2*2*2
- {\dosetuparrangement{2}{1}{2}{3}{2}% X,Y,Total,hcutmarks,vcutmarks
- \pusharrangedpageEIGHTTWO\poparrangedpagesAtoD\relax}
-
-\def\pusharrangedpageEIGHTWO#1%
- {\doglobal\increment\arrangedpageN
- \reportarrangedpage\arrangedpageN
- \ifcase\arrangedpageN
- \or \handlearrangedpageXandY{#1}010\arrangedpageA % 1 rot,hskip,vskip
- \or \handlearrangedpageXandY{#1}000\arrangedpageB % 2
- \or \handlearrangedpageXandY{#1}010\arrangedpageC % 3
- \or \handlearrangedpageXandY{#1}000\arrangedpageD % 4
- \or \handlearrangedpageXandY{#1}010\arrangedpageD % 5
- \or \handlearrangedpageXandY{#1}000\arrangedpageC % 6
- \or \handlearrangedpageXandY{#1}010\arrangedpageB % 7
- \or \handlearrangedpageXandY{#1}000\arrangedpageA % 8
- \poparrangedpages
- \fi}
-
-% Section with 12 pages, built from three sheets of paper.
-% Each sheet carries 2 pages recto and verso.
-% Coding: [2*2*3]
-
-\def\poparrangedpagesAtoF
- {\ifnum\arrangedpageN>\zerocount
- \paperwidth \arrangedpageX\paperwidth
- \paperheight\arrangedpageY\paperheight
- \outputarrangedbox\arrangedpageA
- \outputarrangedbox\arrangedpageB
- \outputarrangedbox\arrangedpageC
- \outputarrangedbox\arrangedpageD
- \outputarrangedbox\arrangedpageE
- \outputarrangedbox\arrangedpageF
- \global\arrangedpageN\zerocount
- \fi}
-\installpagearrangement 2*2*3
- {\dosetuparrangement{2}{1}{2}{3}{2}% X,Y,Total,hcutmarks,vcutmarks
- \pusharrangedpageTWELVETWO\poparrangedpagesAtoD\relax}
-
-\def\pusharrangedpageTWELVETWO#1%
- {\doglobal\increment\arrangedpageN
- \reportarrangedpage\arrangedpageN
- \ifcase\arrangedpageN
- \or \handlearrangedpageXandY{#1}010\arrangedpageA % 1 rot,hskip,vskip
- \or \handlearrangedpageXandY{#1}000\arrangedpageB % 2
- \or \handlearrangedpageXandY{#1}010\arrangedpageC % 3
- \or \handlearrangedpageXandY{#1}000\arrangedpageD % 4
- \or \handlearrangedpageXandY{#1}010\arrangedpageE % 5
- \or \handlearrangedpageXandY{#1}000\arrangedpageF % 6
- \or \handlearrangedpageXandY{#1}010\arrangedpageF % 7
- \or \handlearrangedpageXandY{#1}000\arrangedpageE % 8
- \or \handlearrangedpageXandY{#1}010\arrangedpageD % 9
- \or \handlearrangedpageXandY{#1}000\arrangedpageC % 10
- \or \handlearrangedpageXandY{#1}010\arrangedpageB % 11
- \or \handlearrangedpageXandY{#1}000\arrangedpageA % 12
- \poparrangedpages
- \fi}
-
-% \definepageshift[test][horizontal][10pt,20pt,30pt,40pt,50pt]
-% \definepageshift[test][vertical] [10pt,20pt,30pt,40pt,50pt]
-%
-% \setuppageshift[test]
-% \setuppageshift[test][test]
-% \setuppageshift[test][none]
-% \setuppageshift[none][test]
-% \setuppageshift[paper][test][test] % arrange only
-% \setuppageshift[paper][test] % arrange only
-% \setuppageshift[print][test][test]
-%
-% \showframe \dorecurse{100}{\input tufte \par}
-
-% #1=name #2=horizontal|vertical #3=shiftlist
-
-\def\definepageshift
- {\dotripleargument\dodefinepageshift}
-
-\def\dodefinepageshift[#1][#2][#3]%
- {\setvalue{\??pt#2:#1}{#3}}
-
-\letempty \hpageshifts \newcounter\nofhpageshifts
-\letempty \vpageshifts \newcounter\nofvpageshifts
-
-% \let\shiftprintpagebox\gobbleoneargument
-% \let\shiftpaperpagebox\gobbleoneargument
-
-\def\dogetpageshift#1#2#3% #1=\dimenx #2=\xpageshifts #3=\nofxpageshifts
- {\ifx#2\empty
- #1\zeropoint
- \else
- \doglobal\increment#3%
- \getfromcommacommand[#2][#3]%
- \ifx\commalistelement\empty
- \globallet#3\!!plusone
- \getfromcommacommand[#2][#3]%
- \fi
- \ifx\commalistelement\empty
- #1\zeropoint
- \else
- #1=\commalistelement
- \donetrue
- \fi
- \fi}
-
-\def\shiftpagebox#1%
- {\donefalse
- \dogetpageshift{\dimen0}\hpageshifts\nofhpageshifts
- \dogetpageshift{\dimen2}\vpageshifts\nofvpageshifts
- \ifdone % see also layout offsets, maybe \movebox
- \edef\next{\wd#1\the\wd#1\ht#1\the\ht#1\dp#1\the\dp#1}%
- \setbox#1\vbox % \forgetall already done
- {\offinterlineskip\vskip\dimen2\hskip\dimen0\box#1}%
- \next
- \fi}
-
-\def\setuppageshift
- {\dotripleempty\dosetuppageshift}
-
-\def\dosetuppageshift[#1][#2][#3]% page|paper horizontal vertical
- {\ifthirdargument % paper=arrange
- \let\hpageshifts\empty
- \let\vpageshifts\empty
- \let\shiftprintpagebox\gobbleoneargument
- \let\shiftpaperpagebox\gobbleoneargument
- \doifdefined{\??pt\v!horizontal:#2}
- {\edef\hpageshifts{\getvalue{\??pt\v!horizontal:#2}}}%
- \doifdefined{\??pt\v!vertical :#3}
- {\edef\vpageshifts{\getvalue{\??pt\v!vertical :#3}}}%
- \doif{#1}\v!page{\let\shiftprintpagebox\shiftpagebox}%
- \doif{#1}\v!paper{\let\shiftpaperpagebox\shiftpagebox}%
- \else\ifsecondargument
- \doifinsetelse{#1}{\v!page,\v!paper}
- {\setuppageshift[#1][#2][#2]}
- {\setuppageshift[\v!page][#1][#2]}%
- \else\iffirstargument
- \setuppageshift[\v!page][#1][#1]%
- \fi\fi\fi}
-
-%D One can (mis)use this mechanism, in close cooperation
-%D with \PDFTEX\ to arrange pages of already produced files.
-%D
-%D \starttyping
-%D \insertpages[file.pdf][1,3][n=30,width=18cm]
-%D \stoptyping
-%D
-%D The pages are inserted in the text area, and even pages
-%D are repositioned according to the width. In this example
-%D empty pages are added after page 1 and 3.
-%D
-%D Selecting pages can be accomplished by:
-%D
-%D \starttyping
-%D \filterpages[file.pdf][1,3,5][n=30,width=18cm]
-%D \stoptyping
-%D
-%D One may pass \type {odd} or \type {even} instead of a
-%D comma separated list. A third alternative is:
-%D
-%D \starttyping
-%D \copypages[file.pdf][n=30,scale=950]
-%D \stoptyping
-%D
-%D This macros inserts the page, according to the settings
-%D provided.
-
-\def\insertpages
- {\dotripleempty\doinsertpages}
-
-\def\doinsertpages[#1][#2][#3]%
- {\doifassignmentelse{#2}
- {\dodoinsertpages[#1][][#2]}
- {\dodoinsertpages[#1][#2][#3]}}
-
-\def\dodoinsertpages[#1][#2][#3]%
- {\bgroup
- \dontcomplain
- \getfiguredimensions[#1]%
- \getparameters[\??ip][\c!n=\noffigurepages,\c!width=\!!zeropoint,#3]%
- \doifinset0{#2}{\null\page}%
- \dorecurse\@@ipn
- {\dofilterpage{#1}\recurselevel
- \doifinset\recurselevel{#2}{\null\page}}%
- \egroup}
-
-\def\filterpages
- {\dotripleempty\dofilterpages}
-
-\def\dofilterpages[#1][#2][#3]% % \noffigurepages not yet supported
- {\bgroup
- \dontcomplain
- \getfiguredimensions[#1]%
- \getparameters[\??ip][\c!n=\noffigurepages,\c!width=\!!zeropoint,#3]%
- \doifelse{#2}\v!even
- {\dorecurse\@@ipn
- {\ifodd\recurselevel\relax\else\dofilterpage{#1}\recurselevel\fi}}
- {\doifelse{#2}\v!odd
- {\dorecurse\@@ipn
- {\ifodd\recurselevel\relax\dofilterpage{#1}\recurselevel\fi}}
- {\def\dodocommand##1%
- {\ifnum##1>\@@ipn\else\dofilterpage{#1}{##1}\fi}%
- \def\docommand##1%
- {\dowithrange{##1}\dodocommand}%
- \processcommalist[#2]\docommand}}%
- \egroup}
-
-\def\dofilterpage#1#2%
- {\hbox to \textwidth
- {\ifdoublesided\ifdim\@@ipwidth>\zeropoint\relax\ifodd\realpageno\else
- \hfill
- \def\dowithfigure{\hskip-\@@ipwidth}%
- \fi\fi\fi
- \setbox0\hbox
- {\externalfigure[#1][\c!page=#2,\c!height=\textheight]}%
- \wd0\zeropoint
- \box0}
- \page}
-
-\def\copypages
- {\dodoubleempty\docopypages}
-
-\def\docopypages[#1][#2]%
- {\bgroup
- \getfiguredimensions[#1]%
- \getparameters[\??ip]
- [\c!n=\noffigurepages,
- \c!marking=\v!off,
- \c!scale=\!!thousand,
- \c!offset=\!!zeropoint,
- #2]%
- \dorecurse\@@ipn
- {\vbox to \textheight
- {\hsize\textwidth
- \scratchdimen\@@ipoffset
- \centeredbox
- {\doifelse\@@ipmarking\v!on\cuthbox\hbox
- {\ifdim\scratchdimen>\zeropoint\relax
- \advance\vsize -2\scratchdimen
- \advance\hsize -2\scratchdimen
- \externalfigure[#1][\c!page=\recurselevel,#2,\c!scale=,\c!factor=\v!max,\c!offset=\v!overlay]%
- \else
- \externalfigure[#1][\c!page=\recurselevel,#2,\c!offset=\v!overlay]%
- \fi}}}
- \page}
- \egroup}
-
-%D \macros
-%D {combinepages}
-%D
-%D Yet another way of postprocessing is handles by \type
-%D {\combinepages}. This macro builds a matrix of pages from a
-%D file, for example:
-%D
-%D \starttyping
-%D \setuppapersize
-%D [A4][A4] % or [A4,landscape][A4,landscape]
-%D
-%D \setuplayout
-%D [header=0pt,footer=1cm,
-%D backspace=1cm,topspace=1cm,
-%D width=middle,height=middle]
-%D
-%D \setupfootertexts
-%D [presentation---\currentdate\space---\space\pagenumber]
-%D
-%D \starttext
-%D \combinepages[slides][nx=2,ny=3,frame=on]
-%D \stoptext
-%D \stoptyping
-%D
-%D One can influence the way the pages are combined. (This
-%D will be explained some time.)
-
-\def\combinepages
- {\dodoubleempty\docombinepages}
-
-\def\docombinepages[#1][#2]% a=perpag b=free
- {\bgroup
- \dontcomplain
- \getfiguredimensions[#1]%
- \getparameters
- [\??ip]
- [\c!alternative=\v!a,
- \c!n=\noffigurepages,\c!nx=2,\c!ny=2,\c!start=1,\c!stop=\!!maxcard,
- \c!distance=\bodyfontsize,
- \c!bottom=\vfill,\c!top=\vss,
- \c!left=\hss,\c!right=\hss,
- \c!before=\page,\c!after=\page,\c!inbetween=\blank,
- \c!frame=,\c!background=,\c!backgroundcolor=,
- #2]%
- \def\@@ipname{#1}%
- \@@ipbefore
- \executeifdefined{\strippedcsname\docombinepages\@@ipalternative}\docombinepagesb
- \@@ipafter
- \egroup}
-
-\def\docombinepagesa
- {\globallet\combinedpagescounter\@@ipstart
- \doloop
- {\vbox to \textheight
- {\hsize\textwidth % ? ?
- \scratchdimen\@@ipdistance
- \!!widtha \dimexpr(\hsize-\@@ipnx\scratchdimen+\scratchdimen)/\@@ipnx\relax
- \!!heighta\dimexpr(\vsize-\@@ipny\scratchdimen+\scratchdimen)/\@@ipny\relax
- \dorecurse\@@ipny
- {\hbox to \hsize
- {\dorecurse\@@ipnx
- {\vbox to \!!heighta
- {\hsize\!!widtha
- \vsize\!!heighta
- \@@iptop
- \hbox to \hsize
- {\@@ipleft
- \ifnum\combinedpagescounter>\@@ipstop\relax
- \globallet\@@ipn\!!zerocount
- \else\ifnum\combinedpagescounter>\@@ipn \else
- \externalfigure[\@@ipname]
- [\c!object=\v!no,
- \c!page=\combinedpagescounter,
- \c!factor=\v!max,
- \c!background=\@@ipbackground,
- \c!backgroundcolor=\@@ipbackgroundcolor,
- \c!frame=\@@ipframe]%
- \fi\fi
- \@@ipright}
- \@@ipbottom}%
- \doglobal\increment\combinedpagescounter
- \hfil}%
- \hfilneg}
- \vfil}%
- \vfilneg}%
- \page
- \ifnum\combinedpagescounter>\@@ipn \exitloop\fi}}
-
-\def\docombinepagesc
- {\globallet\combinedpagescounter\@@ipstart
- \doloop
- {\vbox to \textheight
- {\hsize\textwidth % ? ?
- \scratchdimen\@@ipdistance
- \!!widtha \dimexpr(\hsize-\@@ipnx\scratchdimen+\scratchdimen)/\@@ipnx\relax
- \!!heighta\dimexpr(\vsize-\@@ipny\scratchdimen+\scratchdimen)/\@@ipny\relax
- \hbox to \hsize
- {\dorecurse\@@ipnx
- {\@@ipleft
- \vbox to \textheight
- {\hsize\!!widtha
- {\dorecurse\@@ipny
- {\@@iptop
- \hbox to \hsize
- {\vbox to \!!heighta
- {\hsize\!!widtha
- \vsize\!!heighta
- \ifnum\combinedpagescounter>\@@ipstop\relax
- \globallet\@@ipn\!!zerocount
- \else\ifnum\combinedpagescounter>\@@ipn \else
- \externalfigure[\@@ipname]
- [\c!object=\v!no,
- \c!page=\combinedpagescounter,
- \c!factor=\v!max,
- \c!background=\@@ipbackground,
- \c!backgroundcolor=\@@ipbackgroundcolor,
- \c!frame=\@@ipframe]%
- \fi\fi}}
- \doglobal\increment\combinedpagescounter
- \@@ipbottom}%
- \vfil}%
- \vfilneg}
- \hfil}%
- \hfilneg}}
- \page
- \ifnum\combinedpagescounter>\@@ipn \exitloop\fi}}
-
-\let\docombinepageshorizontal\docombinepagesa
-\let\docombinepagesvertical \docombinepagesc
-
-\def\docombinepagesb
- {\globallet\combinedpagescounter\@@ipstart
- \doloop
- {\startbaselinecorrection
- \scratchdimen\@@ipdistance
- \!!widtha\dimexpr(\hsize-\@@ipnx\scratchdimen+\scratchdimen)/\@@ipnx\relax
- \hbox to \hsize
- {\dorecurse\@@ipnx
- {\doglobal\increment\combinedpagescounter
- \ifnum\combinedpagescounter>\@@ipn \else
- \expanded{\externalfigure[\@@ipname]
- [\c!page=\combinedpagescounter,
- \c!width=\the\!!widtha,% todo \freezedimenmacro
- \c!background=\@@ipbackground,
- \c!backgroundcolor=\@@ipbackgroundcolor,
- \c!frame=\@@ipframe]}%
- \hfill
- \fi}\hfillneg}%
- \stopbaselinecorrection
- \ifnum\combinedpagescounter<\@@ipn\relax
- \@@ipinbetween
- \else
- \exitloop
- \fi}}
-
-%D \macros
-%D {setuppagecomment,startpagecomment}
-%D
-%D This command is not yet documented. Usage:
-%D
-%D \starttyping
-%D \setuppagecomment[state=start,location=right]
-%D
-%D \startpagecomment
-%D \input knuth
-%D \stoppagecomment
-%D \stoptyping
-
-\def\setuppagecomment
- {\dosingleempty\dosetuppagecomment}
-
-\def\dosetuppagecomment[#1]%
- {\getparameters[\??pc][#1]%
- \doifelse\@@pcstate\v!start
- {\doifinsetelse\@@pclocation{\v!bottom,\v!top}
- {\setuppapersize[\c!left=\hskip\@@pcoffset]%
- \edef\@@pcpaperheight{\the\dimexpr\paperheight+\@@pcoffset+\@@pcoffset+\@@pcdistance+\@@pcheight\relax}%
- \edef\@@pcpaperwidth {\the\dimexpr\paperwidth+\@@pcoffset+\@@pcoffset\relax}%
- \defineoverlay[\v!pagecomment][\placepagecommentTB]}
- {\setuppapersize[\c!top=\vskip\@@pcoffset]%
- \edef\@@pcpaperheight{\the\dimexpr\paperheight+\@@pcoffset+\@@pcoffset\relax}%
- \edef\@@pcpaperwidth {\the\dimexpr\paperwidth+\@@pcoffset+\@@pcoffset+\@@pcdistance+\@@pcwidth\relax}%
- \defineoverlay[\v!pagecomment][\placepagecommentLR]}%
- \processaction
- [\@@pclocation]
- [ \v!bottom=>{\setuppapersize[\c!bottom =\vss,\c!top =\vskip\@@pcoffset]},
- \v!top=>{\setuppapersize[\c!top =\vss,\c!bottom =\vskip\@@pcoffset]},
- \v!left=>{\setuppapersize[\c!left =\hss,\c!right=\hskip\@@pcoffset]},
- \v!right=>{\setuppapersize[\c!right=\hss,\c!left =\hskip\@@pcoffset]}]%
- \definepapersize
- [\v!pagecomment]
- [\c!height=\@@pcpaperheight,
- \c!width=\@@pcpaperwidth]%
- \let\@@pcprintpapersize\printpapersize
- \setuppapersize[\papersize][\v!pagecomment]%
- \setupbackgrounds[\v!paper][\c!background=\v!pagecomment]}
- {\doif\@@pcstate\v!stop % else initialization invokes backgrounds
- {% this should be tested first
- % \expanded{\setuppapersize[\papersize][\@@pcprintpapersize]}%
- \setupbackgrounds[\v!paper][\c!background=]}}}
-
-\def\@@pcprintpapersize{\printpapersize}
-
-\def\placepagecommentTB
- {\vbox to \printpaperheight
- {\forgetall
- \hsize\printpaperwidth
- \vskip\@@pcoffset
- \doifelse\@@pclocation\v!bottom{\vskip\dimexpr\paperheight+\@@pcdistance\relax}\vss
- \hskip\@@pcoffset
- \vbox to \@@pcheight
- {\forgetall
- \hsize\paperwidth
- \ifpagecomment
- \getbuffer[\v!pagecomment]%
- \global\pagecommentfalse
- \fi}%
- \hfill
- \doifelse\@@pclocation\v!bottom\vss{\vskip\dimexpr\paperheight+\@@pcdistance\relax}%
- \vskip\@@pcoffset}}
-
-\def\placepagecommentLR
- {\hbox to \printpaperwidth
- {\hskip\@@pcoffset
- \doifelse\@@pclocation\v!right{\hskip\paperwidth\hskip\@@pcdistance}\hss
- \vbox to \printpaperheight
- {\forgetall
- \vskip\@@pcoffset
- \hsize\@@pcwidth
- \ifpagecomment
- \getbuffer[\v!pagecomment]%
- \global\pagecommentfalse
- \fi
- \vss}%
- \doifelse\@@pclocation\v!right\hss{\hskip\paperwidth\hskip\@@pcdistance}%
- \hskip\@@pcoffset}}
-
-\newif\ifpagecomment
-
-\setvalue{\e!start\v!pagecomment}%
- {\global\pagecommenttrue
- \dostartbuffer[\v!pagecomment][\e!start\v!pagecomment][\e!stop\v!pagecomment]}
-
-\setuppagecomment
- [\c!state=, % \v!stop would invoke background calculation
- \c!location=\v!bottom,
- \c!offset=.5cm,
- \c!distance=.5cm,
- \c!height=5cm,
- \c!width=10cm]
-
-% This macro cuts a page into n parts that can be pasted
-% together.
-
-\def\slicepages
- {\dotripleempty\doslicepages}
-
-\def\doslicepages[#1][#2][#3]%
- {\ifthirdargument
- \dodoslicepages[#1][#2][#3]%
- \else
- \dodoslicepages[#1][#2][#2]%
- \fi}
-
-\newcounter\slicedpagenumber
-
-\def\dodoslicepages[#1][#2][#3]%
- {\bgroup
- \dontcomplain
- \globallet\slicedpagenumber\!!zerocount
- \getfiguredimensions[#1]
- \getparameters
- [\??ip]
- [\c!n=1,
- \c!offset=\!!zeropoint,
- \c!hoffset=\!!zeropoint,\c!voffset=\!!zeropoint,
- \c!width=\figurewidth,\c!height=\figureheight,#2]
- \ifnum\@@ipn>\zerocount
- \definepapersize
- [\s!dummy][\c!height=\@@ipheight,\c!width=\@@ipwidth]
- \setuppapersize
- [\s!dummy][\s!dummy]
- \setuplayout
- [\c!backspace=\!!zeropoint,\c!topspace=\!!zeropoint,
- \c!height=\v!middle,\c!width=\v!middle,
- \c!textdistance=\!!zeropoint,
- \c!header=\!!zeropoint,\c!footer=\!!zeropoint]
- \fi
- \dorecurse\noffigurepages
- {\global\let\slicedpagenumber\recurselevel
- \ifnum\@@ipn>\plusone
- \dorecurse\@@ipn
- {\let\xslice\recurselevel
- \dorecurse\@@ipn
- {\let\yslice\recurselevel
- \clip
- [\c!nx=\@@ipn,\c!ny=\@@ipn,\c!x=\xslice,\c!y=\yslice]
- {\scale
- [\c!scale=\@@ipn000]
- {\externalfigure[#1][\c!page=\slicedpagenumber]}}
- \page}}
- \else
- \ifodd\slicedpagenumber\relax
- \getparameters[\??ip][#2]
- \else
- \getparameters[\??ip][#3]
- \fi
- \hskip\@@ipoffset
- \clip
- [\c!hoffset=\@@iphoffset,\c!voffset=\@@ipvoffset,
- \c!height=\@@ipheight,\c!width=\@@ipwidth]
- {\externalfigure[#1][\c!page=\slicedpagenumber]}
- \page
- \fi}
- \egroup}
-
-% \starttext \slicepages[slice1.pdf][n=3] \stoptext
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/page-ini.mkii b/Master/texmf-dist/tex/context/base/mkii/page-ini.mkii
deleted file mode 100644
index bc4aab60f89..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/page-ini.mkii
+++ /dev/null
@@ -1,1558 +0,0 @@
- %D \module
-%D [ file=page-ini,
-%D version=2000.10.20,
-%D title=\CONTEXT\ Page Macros,
-%D subtitle=Initializations,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 / Initializations}
-
-% still a dutch/english mess
-
-%D This class of modules implements the output routines and
-%D floating body support. Although the modules are relatively
-%D new, the code herein is rather old. This reordering was
-%D needed when column sets were implemented and sharing code
-%D started to make sense.
-
-%D The history shows from the code, since both column
-%D mechanism use a different way of looping over columns.
-
-\unprotect
-
-\def\m!otr{otr}
-
-\chardef\normalpagebox=255
-
-\newbox\pagebox
-
-\ifx\recalculatelayout\undefined
-
- \let \recalculatelayout \relax
-
-\fi
-
-\ifx\recalculatelogos\undefined
-
- \let \recalculatelogos \relax
- \let \addlogobackground \gobbleoneargument % <box>
-
-\fi
-
-\ifx\recalculatebackgrounds\undefined
-
- \let \recalculatebackgrounds \relax
- \let \addmainbackground \gobbleoneargument % <box>
- \let \addtextbackground \gobbleoneargument % <box>
- \let \addpagebackground \gobbleoneargument % <box>
- \let \addprintbackground \gobbleoneargument % <box>
- \let \addstatusinfo \gobbleoneargument % <box>
-
-\fi
-
-\ifx\realpageno\undefined
-
- \countdef\realpageno = 0 \realpageno = 1
- \countdef\userpageno = 1 \userpageno = 1
- \countdef\subpageno = 2 \subpageno = 0 % !!
- \countdef\arrangeno = 3 \arrangeno = 0 % !!
-
- \let\pageno\userpageno
-
-\fi
-
-\ifx\realfolio\undefined
-
- \def\realfolio{\the\realpageno}
-
-\fi
-
-\newcount\nofshipouts
-
-\appendtoks
- \global\advance\nofshipouts\plusone
-\to \everyaftershipout
-
-% principle:
-%
-% multiple otr's
-%
-% (1) single column, simple routine (old one)
-% (2) multi column, collect and split routine (old one)
-% (3) multi column, page by page (new one, needed for taco)
-% (4) single column, spread handling (for fun)
-% (5) multi column, page by page, spread handling (as challenge)
-%
-% common components
-%
-% (1) float placement
-% (2) float flushing
-% (3) page body building
-% (4) ...
-%
-% ort
-%
-% + balancing
-% - mixed / one / multi / balancetofit
-% + backgrounds
-% + pre / post
-% + distances / heights
-% + ragged / baseline / normal
-% - pos sync
-% - last page
-%
-% - itemize / subtexts -> old mechanism
-%
-% floats
-%
-% - top / bottom / side / page / column / spead
-% - flush / packed flush / current page / next page / area
-%
-% footnotes
-%
-% + carry over pre column / local to column
-% + last column / pre last column / each column
-% - multiple classes
-% - area / page / end
-%
-% areas
-%
-% - top / bottom / mid in spread
-%
-% IMPORTANT
-%
-% switchtobodyfont in between ivm top
-
-% floats:
-%
-% tricky in balancing mode, a la huidige multi columns
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-% messages moved
-
-\ifx\dosetuplayout\undefined % overloaded in page-lay !
-
- \def\setuplayout{\dodoubleempty\getparameters[\??ly]}
-
-\fi
-
-\ifx\mkprocesscolumncontents\undefined\let\mkprocesscolumncontents\gobbleoneargument\fi
-\ifx\mkprocesspagecontents \undefined\let\mkprocesspagecontents \gobbleoneargument\fi
-\ifx\mkprocessboxcontents \undefined\let\mkprocessboxcontents \gobbleoneargument\fi
-
-\def\normalejectpenalty{-\plustenthousand } \let\ejectpenalty\normalejectpenalty
-\def\normalsuperpenalty{-\plustwentythousand} \let\superpenalty\normalsuperpenalty
-
-%D In case we're not running \ETEX, we need to bypass a
-%D couple of primitives.
-
-% ONE = single column
-% MUL = multi column
-% SET = columns sets
-
-\def\@@OTR{OTR}
-
-\let\OTRdefault\empty
-
-\def\OTRcommand#1%
- {\csname\@@OTR
- \ifcsname\@@OTR\OTRidentifier\strippedcsname#1\endcsname
- \OTRidentifier
- \else\ifcsname\@@OTR\OTRdefault\strippedcsname#1\endcsname % fallback
- \OTRdefault
- \fi\fi
- \strippedcsname#1\endcsname}
-
-% obsolete
-
-\def\installotr#1% andere naam, beter \connectotr of zo
- {\def\OTRidentifier{#1}}
-
-\def\activateotr#1#2%
- {\def\OTRidentifier{#1}%
- \def\OTRdefault {#2}}
-
-%D The initialization of the \type {\hsize} and \type {\vsize}
-%D depends on the OTR used.
-
-\def\setvsize {\OTRcommand\setvsize}
-\def\sethsize {\OTRcommand\sethsize}
-\def\finalsidefloatoutput {\OTRcommand\finalsidefloatoutput}
-\def\dopagecontents {\OTRcommand\dopagecontents}
-
-\def\dosettopinserts {\OTRcommand\dosettopinserts}
-\def\dosetbotinserts {\OTRcommand\dosetbotinserts}
-\def\dotopinsertions {\OTRcommand\dotopinsertions}
-\def\dobotinsertions {\OTRcommand\dobotinsertions}
-\def\dosetbothinserts {\OTRcommand\dosetbothinserts}
-
-\def\doflushfloats {\OTRcommand\doflushfloats}
-\def\flushfloatbox {\OTRcommand\flushfloatbox}
-\def\docheckiffloatfits {\OTRcommand\docheckiffloatfits}
-
-\def\someherefloat {\OTRcommand\someherefloat}
-\def\somefixdfloat {\OTRcommand\somefixdfloat}
-\def\somepagefloat {\OTRcommand\somepagefloat}
-\def\sometopsfloat {\OTRcommand\sometopsfloat}
-\def\somebotsfloat {\OTRcommand\somebotsfloat}
-\def\somesidefloat {\OTRcommand\somesidefloat}
-
-\def\flushsavedfloats {\OTRcommand\flushsavedfloats}
-
-\def\synchronizehsize {\OTRcommand\synchronizehsize}
-
-\def\gotonextpage {\OTRcommand\gotonextpage }
-\def\gotonextpageX{\OTRcommand\gotonextpageX} % will become obsolete
-
-% beter een \installotr#1 met #1 = macro en auto test
-
-\newif \iftraceotr
-\newif \ifinotr
-\newtoks \mainoutput
-\newcount\otrlevel
-
-% When issuing two \par\penalty-\plustenthousand's, only the first
-% triggers the otr; obscure feature or optimization?
-
-\def\outputcounter{-100010} % -10010
-
-\def\doinvokeoutput
- {\iftraceotr
- \expandafter\dodotracedoutput
- \else
- \expandafter\dodoinvokeoutput
- \fi}
-
-\def\outputmessage#1#2#3%
- {\iftraceotr\writestatus\m!otr{#1 #2 \number#3}\fi}
-
-\def\dodoinvokeoutput#1%
- {\outputmessage+{special}{#1}%
- \bgroup\par\penalty#1\relax\egroup
- \outputmessage-{special}{#1}}
-
-\def\dodotracedoutput#1%
- {\outputmessage+{traced}{#1/\the\outputpenalty}%
- \writestatus\m!otr{c:\number\mofcolumns,v:\the\vsize,g:\the\pagegoal,t:\the\pagetotal}%
- \dodoinvokeoutput{#1}%
- \writestatus\m!otr{c:\number\mofcolumns,v:\the\vsize,g:\the\pagegoal,t:\the\pagetotal}%
- \outputmessage-{traced}{#1/\the\outputpenalty}}
-
-\def\installoutput#1#2% \invoke \action
- {\decrement\outputcounter
- \edef#1{\noexpand\doinvokeoutput{\outputcounter}}%
- \setvalue{\@@OTR\outputcounter}{#2}}
-
-\def\invokeoutputroutine
- {\outputmessage+{trying}\outputpenalty
- \executeifdefined{\@@OTR\the\outputpenalty}\dodonormaloutput
- \outputmessage-{trying}\outputpenalty}
-
-\def\dodonormaloutput
- {\outputmessage+{normal}\outputpenalty
- \the\OTRcommand\output
- \outputmessage-{normal}\outputpenalty}
-
-\mainoutput{\invokeoutputroutine} \output{\inotrtrue\the\mainoutput}
-
-%D Some hooks:
-
-\output{\inotrtrue\the\everybeforeoutput\the\mainoutput\the\everyafteroutput}
-
-\ifx\pagediscards\undefined \let\pagediscards\relax \fi
-
-\installoutput\synchronizeoutput % maybe add pagediscards
- {\ifvoid\normalpagebox\else
- \unvbox\normalpagebox
- \pagediscards % maybe not needed ?
- \fi}
-
-\installoutput\discardpage
- {\setbox\scratchbox\box\normalpagebox}
-
-%D In order to force consistent use of variables, we
-%D predefine a lot of them here.
-
-%D The next two registers can be used to store pre column
-%D material as well as footnotes or so.
-
-\newbox\precolumnbox \newdimen\precolumnboxheight
-\newbox\postcolumnbox \newdimen\postcolumnboxheight
-
-%D We reserve a counter for the number of columns as well as
-%D the current column. Both are not to be changed by users!
-
-\newcount\nofcolumns \nofcolumns = 1
-\newcount\mofcolumns \mofcolumns = 1
-
-\chardef\maxnofcolumns = 50
-\chardef\allocatednofcolumns = 0
-
-%D The next dimensions reports the final column height
-
-\newdimen\finalcolumnheights
-\newcount\finalcolumnlines
-
-%D During initialization the temporary boxes are allocated.
-%D This enables us to use as much columns as we want, without
-%D exhausting the pool of boxes too fast. We could have packed
-%D them in one box, but we've got enough boxes.
-%D
-%D Two sets of boxes are declared, the txtboxes are used for
-%D the text, the topboxes are for moved column floats.
-
-\def\@col@{@col@}
-
-\def\initializecolumns#1%
- {\ifnum#1>\maxnofcolumns
- \showmessage\m!columns1\maxnofcolumns
- \nofcolumns\maxnofcolumns
- \else
- \nofcolumns#1\relax
- \fi
- \ifnum\nofcolumns>\allocatednofcolumns
- \dorecurse\nofcolumns
- {\ifnum\recurselevel>\allocatednofcolumns\relax
- % \newbox\next \letgvalue{\@col@-\recurselevel-t}=\next
- \@EA\newbox\csname\@col@-\recurselevel-t\endcsname % text
- \@EA\newbox\csname\@col@-\recurselevel-f\endcsname % foot
- \@EA\newbox\csname\@col@-\recurselevel-h\endcsname % top insert
- \@EA\newbox\csname\@col@-\recurselevel-l\endcsname % top insert
- \fi}%
- \global\chardef\allocatednofcolumns=\nofcolumns
- \fi}
-
-\def\firstcolumnbox {\columntextbox\plusone}
-\def\currentcolumnbox {\columntextbox\mofcolumns}
-\def\lastcolumnbox {\columntextbox\nofcolumns}
-
-\def\firsttopcolumnbox {\columntopbox \plusone}
-\def\currenttopcolumnbox{\columntopbox \mofcolumns}
-\def\lasttopcolumnbox {\columntopbox \nofcolumns}
-
-\def\columntextbox#1{\csname\@col@-\number#1-t\endcsname}
-\def\columnfootbox#1{\csname\@col@-\number#1-f\endcsname}
-\def\columntopbox #1{\csname\@col@-\number#1-h\endcsname}
-\def\columnbotbox #1{\csname\@col@-\number#1-l\endcsname}
-
-\def\columnsettextbox{\global\setbox\columntextbox}
-\def\columnsetfootbox{\global\setbox\columnfootbox}
-\def\columnsettopbox {\global\setbox\columntopbox}
-\def\columnsetbotbox {\global\setbox\columnbotbox}
-
-\def\columngettextbox{\copy\columntextbox}
-\def\columngetfootbox{\copy\columnfootbox}
-\def\columngettopbox {\copy\columntopbox}
-\def\columngetbotbox {\copy\columnbotbox}
-
-\def\columnerasetextboxes{\dorecurse\allocatednofcolumns{\columnsettextbox\recurselevel\emptybox}}
-\def\columnerasefootboxes{\dorecurse\allocatednofcolumns{\columnsetfootbox\recurselevel\emptybox}}
-\def\columnerasetopboxes {\dorecurse\allocatednofcolumns{\columnsettopbox \recurselevel\emptybox}}
-\def\columnerasebotboxes {\dorecurse\allocatednofcolumns{\columnsetbotbox \recurselevel\emptybox}}
-
-%D Without going in details we present two macro's which handle
-%D the columns. The action which is transfered by the the first
-%D and only parameter can do something with \type
-%D {\currentcolumnbox}. In case of the mid columns, \type
-%D {\firstcolumnbox} and \type {\lastcolumnbox} are handled
-%D outside these macro's.
-
-\def\dohandlecolumn#1%
- {\mofcolumns\recurselevel
- \let\currentcolumn\recurselevel
- #1\relax}
-
-\def\dohandleallcolumns#1%
- {\dorecurse\nofcolumns{\dohandlecolumn{#1}}}
-
-\def\dohandlerevcolumns#1%
- {\dostepwiserecurse\nofcolumns\plusone\minusone{\dohandlecolumn{#1}}}
-
-\def\dohandlemidcolumns#1%
- {\dohandleallcolumns
- {\ifnum\recurselevel>\plusone
- \ifnum\recurselevel<\nofcolumns
- \dohandlecolumn{#1}%
- \fi
- \fi}}
-
-%D This register can be used as a temporary storage for page
-%D content.
-
-\newbox\restofpage
-
-%D Features.
-
-\newif\ifintermediatefootnotes
-\newif\ifcarryoverfootnotes %\carryoverfootnotestrue
-\newif\iflastcolumnfootnotes %\lastcolumnfootnotestrue
-\newif\ifbalancecolumns %\balancecolumnstrue
-\newif\ifbalancetoheight %\balancetoheighttrue
-\newif\ifforcecolumngrid \forcecolumngridtrue
-\newif\ifstretchcolumns \stretchcolumnsfalse
-\newif\ifinheritcolumns \inheritcolumnsfalse
-\newif\ifheightencolumns \heightencolumnsfalse
-
-\newif\ifbalancingcolumns
-\newif\ifcollectingcontent
-\newif\ifcolumnoverflow
-\newif\iffinalflushingfloats
-\newif\ifpackflushedfloats \packflushedfloatstrue % for the moment
-
-\newdimen\intercolumnwidth
-\newdimen\localcolumnwidth
-\newdimen\savedpagetotal
-
-\chardef\columndirection=0 % 0:lr 1:rl
-
-\def\minbalancetoplines {1}
-\def\minfreecolumnlines {2}
-
-\newif\ifrecentercolumnbox \recentercolumnboxtrue
-\newif\ifrerecentercolumnbox \rerecentercolumnboxtrue
-\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
-%D on the baseline, as is the case with preceding pages.
-%D Also, a \type {\vfil} better than a \type {\vfill}.
-
-% to be replaced by \page[now] \page[final] / merged
-
-% \def\eject {\par\penalty-\plustenthousand } % == {\par\break} % plain
-% \def\supereject {\par\penalty-\plustwentythousand} % 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} % pg set to \textheight
-\def\ejectpage {\doejectpage\eject}
-\def\superejectpage{\doejectpage\supereject}
-
-\ifx\bye\undefined \def\bye{\par\vfill\supereject\end} \fi % plain tex command
-
-% floats
-%
-% \def\ejectinsert
-% {\flushnotes
-% \bgroup
-% \noftopfloats\plusthousand
-% \nofbotfloats\zerocount
-% \doflushfloats
-% \egroup}
-
-\def\ejectinsert
- {\flushnotes
- \bgroup
- \noftopfloats\plusthousand
- \nofbotfloats\zerocount
- % this is needed in case a float that has been stored
- % ends up at the current page; this border case occurs when
- % the calculated room is 'eps' smaller that the room available
- % when just flushing; so now we have (maybe optional):
- \pagebaselinecorrection
- % alas, this is tricky but needed (first surfaced in prikkels)
- \doflushfloats
- \egroup}
-
-\def\ejectdummypage
- {\endgraf \ifvmode
- \ejectinsert
- \hardespatie % will be different
- \vfill
- \gotonextpage
- \fi}
-
-\def\beforefinaloutput
- {}
-
-\def\afterfinaloutput
- {\forgetall
- \vskip\zeropoint\relax
- \ifvoid\normalpagebox \else
- \unvbox\normalpagebox
- \penalty\outputpenalty
- \fi
- % not really needed, replaced by \flushsavedfloats
- \ifnum\outputpenalty>\superpenalty \else % better use a proper otr signal
- \dosupereject
- \fi
- % but does not hurt either (we're still in the otr!)
- \inpagebodytrue % needed for enabling \blank !
- \flushsavedfloats % was \dosetbothinserts; only otr one !
- \setvsize % this is needed for interacting components, like floats and multicolumns
- \adaptfuzzypagegoal} % watch this hack!
-
-\def\dofinaloutput#1#2% \vbox: prevents spurious spaces in every..pagebody
- {\beforefinaloutput
- \the\everybeforeshipout % brrr not in shipout
- \ifspecialbasedsettings
- \myshipout{\hbox{\hbox to \zeropoint{\the\pageboundsettings}%
- \hbox{\vbox{\dopagebody#1#2\setpagecounters}}}}%
- \else
- \the\pageboundsettings
- \myshipout{\hbox{\vbox{\dopagebody#1#2\setpagecounters}}}%
- \fi
- \the\everyaftershipout
- \afterfinaloutput
- \popproperties} % ... and here ...
-
-\def\donofinaloutput#1#2%
- {\beforefinaloutput
- \the\everybeforeshipout
- \setpagecounters
- \message{[-\the\realpageno]}%
- \setbox\scratchbox\hbox
- {%\the\everyshipout % still needed here ?
- \dopagebody#1#2}%
- \deadcycles\zerocount
- \gotonextrealpage
- \the\everyaftershipout
- \afterfinaloutput
- \popproperties} % ... and here
-
-% beware: \ifprocessingpages is in use
-
-\ifx\checkpageversion\undefined \let\checkpageversion\relax \fi % todo: hook into \everybeforeshipout
-\ifx\doflushspread \undefined \let\doflushspread \relax \fi % todo
-
-\def\finaloutput#1#2%
- {\checkpageversion
- \ifprocessingpages
- \ifpageselected
- \@EAEAEA\dofinaloutput
- \else
- \@EAEAEA\donofinaloutput
- \fi
- \else
- \ifpageselected
- \@EAEAEA\donofinaloutput
- \else
- \@EAEAEA\dofinaloutput
- \fi
- \fi#1#2%
- \resetselectiepagina
- \incrementpagenumber
- \checkpagedimensions
- \ifnum\outputpenalty>\superpenalty \else
- \dosupereject
- \fi
- \doflushspread
- \dopostponeblock}
-
-\def\dooutput
- {\finaloutput\unvbox\normalpagebox}
-
-\maxdeadcycles=1000
-
-% will be installable tracer; better use chardef
-
-% this needs a real cleanup
-
-\def\doplaceversiontext#1#2%
- {\doifsomething{#2}
- {\defconvertedcommand\ascii{#2}%
- \space#1:\space\ascii\space
- \!!doneatrue}}
-
-\def\placeversioninfo % nog engels maken
- {\ifcase\conceptmode
- % 0 : nothing
- \or
- % 1 : simple
- \vskip\!!sixpoint
- \hbox to \makeupwidth
- {\infofont
- \v!concept:\space\currentdate
- \hss\reportpagedimensions}%
- \else
- % 2/3 : extensive
- \vskip\!!sixpoint
- \hbox to \makeupwidth
- {\infofont
- \getmessage\m!systems{27}:\space\currentdate\space
- \doplaceversiontext\v!project \currentproject
- \doplaceversiontext\v!product \currentproduct
- \doplaceversiontext\v!component\currentcomponent
- \if!!donea\else\space\v!file:\space\jobname\fi
- \hss\reportpagedimensions}%
- \fi}
-
-% tot hier
-
-\def\doversion[#1]%
- {\chardef\conceptmode\zerocount
- \overfullrule\zeropoint
- \processaction % \v!final=>
- [#1]
- [ \v!concept=>\chardef\conceptmode\plusone, % simple banner
- \v!file=>\chardef\conceptmode\plustwo, % full banner
- \v!temporary=>\chardef\conceptmode\plusthree % full banner plus
- \overfullrule5\points]} % info in the margin
-
-\def\version
- {\dosingleargument\doversion}
-
-\def\addstatusinfo
- {\ifcase\conceptmode
- \@EA\gobbleoneargument
- \else
- \@EA\doaddstatusinfo
- \fi}
-
-\def\doaddstatusinfo#1%
- {\setbox#1\vbox to \paperheight
- {\vsmashbox#1\box#1%
- \offinterlineskip
- \vskip\topspace
- \hsize\paperwidth
- \hfill\hbox{\placetestinfo\hskip.5cm}\vss
- \settexthoffset\hskip\texthoffset % brrrr
- %\tlap{\placeversioninfo}\vskip.5cm
- \vbox to 1cm{\vss\placeversioninfo\vss}}}
-
-\def\dotestinfo#1#2#3%
- {\ifinpagebody\else\ifnum\conceptmode=\plusthree
- \begingroup
- \defconvertedcommand\ascii{#3}%
- \xdef\extratestinfo
- {#2\space\ascii}%
- \gdef\totaltestinfo
- {\global\setbox#1\vbox
- {\unvbox#1\relax
- \infofont \setupinterlinespace
- \hbox
- {\strut
- \expanded{\doboundtext{\extratestinfo}{12em}{..}}%
- \quad}}}%
- \endgroup
- \ifinner
- \aftergroup\totaltestinfo
- \else
- \totaltestinfo
- \fi
- \fi\fi}
-
-% this will be inserts some day
-
-% \installinsertion\referenceinfobox
-% \installinsertion\registerinfobox
-% \installinsertion\floatinfobox
-
-\newbox\referenceinfobox
-\newbox\registerinfobox
-\newbox\floatinfobox
-
-\def\referenceinfo{\dotestinfo\referenceinfobox}
-\def\registerinfo {\dotestinfo\registerinfobox}
-\def\floatinfo {\dotestinfo\floatinfobox}
-
-\def\placetestinfo
- {\vbox to \makeupheight
- {\forgetall
- \infofont
- \hsize10em
- \ifvoid\floatinfobox\else
- \strut \getmessage\m!systems{24}%
- \vskip\!!sixpoint
- \unvbox\floatinfobox
- \vskip\!!twelvepoint
- \fi
- \ifvoid\referenceinfobox\else
- \strut \getmessage\m!systems{25}%
- \vskip\!!sixpoint
- \unvbox\referenceinfobox
- \vskip\!!twelvepoint
- \fi
- \ifvoid\registerinfobox\else
- \strut \getmessage\m!systems{26}%
- \vskip\!!sixpoint
- \unvbox\registerinfobox
- \fi
- \vss}}
-
-\version[\v!final]
-
-% bewaren tvb documentatie
-%
-% \hbox to \hsize
-% {\en
-% \switchnaarkorps[5pt]%
-% \emergencystretch2em
-% \dimen0=\baselineskip
-% \baselineskip=\dimen0 plus 1pt
-% \hsize=.2\hsize
-% \vsize=2\hsize
-% \ruledvbox to \vsize{\input tufte \par}\hss
-% \ruledvbox to \vsize{\input tufte \par\kern-\prevdepth}\hss
-% \ruledvbox to \vsize{\input tufte \par\kern0pt}\hss
-% \ruledvbox to \vsize{\input tufte \par\vfill}\hss
-% \ruledvbox to \vsize{\input tufte \par\kern-\prevdepth\vfill}}
-%
-% \hbox to \hsize
-% {\en
-% \switchnaarkorps[5pt]%
-% \emergencystretch2em
-% \dimen0=\baselineskip
-% \baselineskip=\dimen0 plus 1pt
-% \hsize=.18\hsize
-% \vsize=2.5\hsize
-% \setbox0=\vbox{\input tufte\relax}%
-% \ruledvbox to \vsize{\unvcopy0}\hss
-% \ruledvbox to \vsize{\unvcopy0\kern-\dp0}\hss
-% \ruledvbox to \vsize{\unvcopy0\kern0pt}\hss
-% \ruledvbox to \vsize{\unvcopy0\vfill}\hss
-% \ruledvbox to \vsize{\unvcopy0\kern-\dp0\vfill}}
-
-\newtoks\afterpage \newtoks\aftereverypage
-\newtoks\beforepage \newtoks\beforeeverypage
-
-\chardef\showgridstate=0
-
-\def\showgrid
- {\dosingleempty\doshowgrid}
-
-\def\doshowgrid[#1]%
- {\chardef\showgridstate \plusone % downward compatible default
- \chardef\gridboxlinemode \plusone
- \chardef\gridboxlinenomode\plusone
- \processallactionsinset
- [#1]%
- [ \v!reset=>\chardef\showgridstate \zerocount,
- \v!bottom=>\chardef\showgridstate \plusone,
- \v!top=>\chardef\showgridstate \plustwo,
- \v!none=>\chardef\gridboxlinemode \zerocount,
- \v!all=>\chardef\gridboxlinemode \plusone,
- \v!lines=>\chardef\gridboxlinemode \plustwo,
- \v!frame=>\chardef\gridboxlinemode \plusthree,
- \v!nonumber=>\chardef\gridboxlinenomode\zerocount,
- \v!right=>\chardef\gridboxlinenomode\plusone,
- \v!left=>\chardef\gridboxlinenomode\plustwo]}
-
-\def\buildpagebox#1%
- {\setbox#1\vbox to \paperheight
- {\hsize\paperwidth
- \vskip\topspace
- \doifbothsides
- {\hskip\backspace}
- {\hskip\backspace}
- {\hskip\paperwidth \hskip-\backspace \hskip-\makeupwidth}%
- \box#1}%
- \dp#1\zeropoint}
-
-% \newif\ifpagebodyornaments \pagebodyornamentstrue
-%
-% \appendtoks
-% \global\pagebodyornamentstrue
-% \to \everyaftershipout
-
-\newif\ifarrangingpages \arrangingpagesfalse
-
-\chardef\pageornamentstate\zerocount % 0=on 1=one-off 2=always-off
-
-\def\pagebodyornamentstrue {\chardef\pageornamentstate\zerocount} % for a while
-\def\pagebodyornamentsfalse{\chardef\pageornamentstate\plusone} % for a while
-
-\appendtoks
- \ifcase\pageornamentstate\or
- \chardef\pageornamentstate\zerocount
- \fi
-\to \everyaftershipout
-
-\let\poparrangedpages\relax
-\let\pusharrangedpage\relax
-
-\ifx\shiftprintpagebox\undefined
- \let\shiftprintpagebox\gobbleoneargument
- \let\shiftpaperpagebox\gobbleoneargument
-\fi
-
-\ifx\registerpageposition\undefined
- \let\registerpageposition\gobbleoneargument
-\fi
-
-\def\reportarrangedpage#1%
- {\showmessage\m!systems
- {23}{\the\realpageno.\the\pageno\ifnum\subpageno>0 .\the\subpageno\fi,#1}}
-
-\newif\ifsavepagebody \newbox\savedpagebody
-
-% beware, \??ly is used before defined, i.e. bad module design
-
-\setuplayout[\c!method=\v!normal]
-
-\def\buildpagebody#1#2%
- {\ifsavepagebody\global\setbox\savedpagebody\fi
- \vbox
- {\beginrestorecatcodes
- \forgetall % igv problemen, check: \boxmaxdepth\maxdimen
- \boxmaxdepth\maxdimen % new
- \dontcomplain
- % the following plugin uses and sets pagebox; beware: this
- % will change and is for my (hh) personal experiments
- \executeifdefined{\??ly\c!method\@@lymethod}%
- {\getvalue{\??ly\c!method\v!normal}}#1#2%
- % the finishing touch
- \ifcase\pageornamentstate
- \addpagebackground \pagebox
- \fi
- \registerpageposition\pagebox
- \ifarrangingpages
- \shiftpaperpagebox \pagebox % \v!paper
- \else
- \clippagebox \pagebox
- \doifelse\@@lymarking\v!page
- {\replicatepagebox \pagebox
- \addpagecutmarks \pagebox}
- {\addpagecutmarks \pagebox
- \replicatepagebox \pagebox}%
- \scalepagebox \pagebox
- \mirrorpaperbox \pagebox
- \orientpaperbox \pagebox
- \addpagecolormarks \pagebox
- \centerpagebox \pagebox
- \addprintbackground\pagebox
- \mirrorprintbox \pagebox
- \orientprintbox \pagebox
- \shiftprintpagebox \pagebox % \v!page
- \offsetprintbox \pagebox
- \negateprintbox \pagebox
- \fi
- \box\pagebox
- \endrestorecatcodes}%
- \ifsavepagebody\copy\savedpagebody\fi}
-
-\setvalue{\??ly\c!method\v!normal}#1#2%
- {\setbox\pagebox\vbox
- {\offinterlineskip
- \ifcase\pageornamentstate
- \bgroup % else footnotes get inconsistent font/baseline
- \dostartattributes\??ly\c!style\c!color\empty
- \offinterlineskip
- \gettextboxes
- \dostopattributes
- \egroup
- \fi
- \getmainbox#1#2}% including footnotes
- \ifcase\pageornamentstate
- \addmainbackground \pagebox
- \addlogobackground \pagebox
- \fi
- \buildpagebox \pagebox
- \addstatusinfo \pagebox}
-
-\def\finishpagebox#1%
- {\ifarrangingpages
- \addpagecutmarks #1%
- \addpagecolormarks#1%
- \centerpagebox #1%
- \mirrorprintbox #1%
- \orientprintbox #1%
- \offsetprintbox #1%
- \negateprintbox #1%
- \fi}
-
-\appendtoks \restoreglobalbodyfont \to \everybeforepagebody
-\appendtoks \restorecolumnsettings \to \everybeforepagebody
-
-\ifx\nestednewbox\undefined \newbox\nestednextbox \fi
-
-\prependtoks \let\nextbox\nestednextbox \to \everybeforepagebody
-
-\def\dopagebody#1#2%
- {%\getallmarks % now in following token register
- \the\everybeforepagebody
- \starttextproperties
- \gotonextsubpage % nog eens: als in pagina (tbv standaard opmaak)
- \dontshowboxes % dan hier blokkeren en verderop resetten
-% \shipoutfacingpage
- \checkreferences
- \checkmargeblokken
- \the\beforeeverypage
- \flushtoks\beforepage
- \inpagebodytrue\buildpagebody#1#2%
- \flushtoks\afterpage
- \the\aftereverypage
- \resetpagebreak
- %updatelistreferences % now in aftereverypage
- \resetlayouttextlines % will go to \aftereverypage
- \stoptextproperties
- \the\everyafterpagebody}
-
-\newtoks\pageboundsettings
-
-\prependtoks \initializepaper \to \pageboundsettings
-
-% not here
-
-\newif\ifpagebreakdisabled \pagebreakdisabledfalse
-
-% \chardef\testpagemethod=0 % todo: \testnewpage[method=,lines=,voffset=]
-%
-% \def\testpage {\dotripleempty\dotestpage[\plusone]}
-% \def\testpageonly{\dotripleempty\dotestpage[\plustwo]}
-%
-% \def\dotestpage[#1][#2][#3]%
-% {%\relax % needed before \if
-% \endgraf
-% \ifpagebreakdisabled
-% % do nothing
-% \else
-% %ifnum#1=\plusone\synchronizeoutput\fi
-% \ifdim\pagegoal<\maxdimen \relax
-% \ifdim\pagetotal<\pagegoal \relax
-% \scratchdimen\lineheight
-% \multiply\scratchdimen#2\relax
-% \advance\scratchdimen \pagetotal
-% \ifdim\lastskip<\parskip
-% \advance\scratchdimen \parskip
-% \fi
-% \ifthirdargument
-% \advance\scratchdimen#3\relax
-% \fi
-% \ifcase\testpagemethod
-% \ifdim\scratchdimen>.99\pagegoal
-% \vfill\eject % \penalty-\!!tenthousand\relax
-% \fi
-% \or
-% \advance\scratchdimen-\pagegoal
-% \ifdim\scratchdimen>-\lineheight
-% \vfill\eject % \penalty-\!!tenthousand\relax
-% \fi
-% \or
-% \getnoflines\pagegoal
-% \advance\scratchdimen-\noflines\lineheight \relax
-% \ifdim\scratchdimen>-\lineheight
-% \vfill\eject % \penalty-\!!tenthousand\relax
-% \fi
-% \or % same as 0 but more accurate
-% \advance\scratchdimen-10\s!sp\relax
-% \ifdim\scratchdimen>\pagegoal
-% \vfill\eject % \penalty-\!!tenthousand\relax
-% \fi
-% \fi
-% \else
-% % force page break / new
-% % \vfill\eject % \penalty-\!!tenthousand\relax
-% \fi
-% \else
-% \ifnum#1=\plusone\goodbreak\fi
-% \fi
-% \fi}
-
-\chardef\testpagemethod \zerocount % todo: \testnewpage[method=,lines=,voffset=]
-\chardef\testpagetrigger\zerocount
-
-\def\testpage {\dotripleempty\dotestpage[\plusone ]} %
-\def\testpageonly{\dotripleempty\dotestpage[\plustwo ]} % no penalties added to the mvl
-\def\testpagesync{\dotripleempty\dotestpage[\plusthree]} % force sync
-
-\def\dotestpage[#1][#2][#3]% don't change, only add more methods
- {\relax % needed before \if
- \ifpagebreakdisabled
- \endgraf
- \else
- % new from here
- \ifcase\testpagetrigger
- \endgraf
- \or
- \ifvmode
- \dosomebreak\allowbreak
- \else % indeed?
- \vadjust{\allowbreak}%
- \endgraf
- \fi
- \fi
- % till here
- \ifdim\pagegoal<\maxdimen \relax
- \ifdim\pagetotal<\pagegoal \relax
- \scratchdimen\lineheight
- \multiply\scratchdimen#2\relax
- \advance\scratchdimen \pagetotal
- \ifdim\lastskip<\parskip
- \advance\scratchdimen \parskip
- \fi
- \ifthirdargument
- \advance\scratchdimen#3\relax
- \fi
- \ifcase\testpagemethod
- \ifdim\scratchdimen>.99\pagegoal
- \penalty-\!!tenthousand\relax
- \fi
- \or
- \advance\scratchdimen-\pagegoal
- \ifdim\scratchdimen>-\lineheight
- \penalty-\!!tenthousand\relax
- \fi
- \or
- \getnoflines\pagegoal
- \advance\scratchdimen-\noflines\lineheight \relax
- \ifdim\scratchdimen>-\lineheight
- \penalty-\!!tenthousand\relax
- \fi
- \or % same as 0 but more accurate
- \advance\scratchdimen-10\s!sp\relax
- \ifdim\scratchdimen>\pagegoal
- \penalty-\!!tenthousand\relax
- \fi
- \fi
- \else
- \ifnum#1=\plusthree
- \flushpagesofar
- \fi
- \fi
- \else
- \ifnum#1=\plusone\goodbreak\fi
- \fi
- \fi}
-
-\def\flushpagesofar
- {\endgraf
- \ifdim\pagetotal>\pagegoal
- \ifdim\dimexpr\pagetotal-\pageshrink\relax>\pagegoal
- \goodbreak % \penalty0
- \else
- \page
- \fi
- \else
- \fi}
-
-\def\testcolumn
- {\dodoubleempty\dotestcolumn}
-
-\def\dotestcolumn[#1][#2]%
- {%\relax % needed before \if !
- \endgraf
- \ifdim\pagegoal<\maxdimen \ifdim\pagetotal<\pagegoal % \relax
- \scratchdimen\pagegoal
- \advance\scratchdimen-\pagetotal
- \ifdim\lastskip<\parskip
- \advance\scratchdimen \parskip
- \fi
- \ifsecondargument
- \advance\scratchdimen#2%
- \fi
- \getrawnoflines\scratchdimen % raw !
- % \message{[\number#1>\number\noflines ?}\wait
- \ifnum#1>\noflines
- \column
- \fi
- \else
- \penalty-\!!tenthousand % untested ! ! \column
- \fi \fi}
-
-\let\resetcurrentsectionmarks\relax
-
-% was: \resetsectionmarks\firstsection, zie \handlepagebreak
-
-\def\page{\pagebreak} % the short form of \pagebreak (mult-com one)
-
-\def\resetpagebreak
- {\global\pagebreakdisabledfalse}
-
-\def\simplifypagebreak
- {\def\dopagebreak[##1]{\goodbreak}}
-
-\def\disablepagebreaks
- {\def\dopagebreak[##1]{}}
-
-\def\executepagebreakhandler#1%
- {\edef\@@pagespecification{#1}%
- \doifdefinedelse{\??pe:\@@pagespecification}
- {\getvalue{\??pe:\@@pagespecification}}
- {\doifdefinedelse{\??pe::\@@pagespecification}
- {\executepagebreakhandlers{\getvalue{\??pe::\@@pagespecification}}}
- {\getvalue{\??pe:\s!unknown}}}}
-
-\long\def\installpagebreakhandler#1#2%
- {\long\setvalue{\??pe:#1}{#2}}
-
-% \definecomplexorsimple\pagebreak
-
-% \def\simplepagebreak
-% {\executepagebreakhandler\v!ja}
-
-% \def\complexpagebreak[#1]% if empty, do nothing and avoid processing,
-% {\flushnotes % see head's; watch how we group
-% \doifsomething{#1}{\bgroup\executepagebreakhandlers{#1}\egroup}}
-
-\unexpanded\def\pagebreak
- {\dosingleempty\dopagebreak}
-
-\def\dopagebreak[#1]% so, page ornaments are reset after a pagebreak command, unless set
- {\bgroup
- \edef\prevrealpageno{\the\realpageno}%
- \ifcase\pageornamentstate \or
- % disable reset after shipout
- \global\chardef\pageornamentstate\plustwo
- \fi
- \iffirstargument % or if empty i.e. []
- \flushnotes\executepagebreakhandlers{#1}%
- \else % so, no pagebreak when \pagebreak[] ! ! !
- \flushnotes\executepagebreakhandler\v!yes
- \fi
- \ifnum\prevrealpageno<\realpageno
- \global\chardef\pageornamentstate\zerocount
- \fi
- \egroup}
-
-\def\executepagebreakhandlers#1%
- {\processcommacommand[#1]\executepagebreakhandler}
-
-\installpagebreakhandler \s!dummy
- {\ejectinsert
- \gotonextpage
- \ejectdummypage}
-
-\installpagebreakhandler \v!frame
- {\page\bgroup\showframe\page[\v!empty]\egroup}
-
-\installpagebreakhandler \s!unknown
- {\doifinstringelse{+}\@@pagespecification
- {\ejectinsert
- \gotonextpage
- \dorecurse\@@pagespecification\ejectdummypage}
- {\doifnumberelse\@@pagespecification
- {\ejectinsert
- \gotonextpage
- \doloop
- {\ifnum\userpageno<\@@pagespecification\relax
- \ejectdummypage
- \else
- \exitloop
- \fi}}
- {}}}
-
-\installpagebreakhandler \s!default
- {} % do nothing if empty
-
-\installpagebreakhandler \v!reset
- {% better not: \global\chardef\pageornamentstate\zerocount
- \resetpagebreak}
-
-\installpagebreakhandler \v!disable
- {\global\pagebreakdisabledtrue}
-
-\installpagebreakhandler \v!yes
- {\ifpagebreakdisabled\else
- \ejectinsert
- \gotonextpage
- \ifinsidecolumns % this will move to MUL
- \ejectpage % anders soms geen overgang
- \fi
- \fi}
-
-\installpagebreakhandler \v!makeup % ??
- {\ifpagebreakdisabled\else
- \eject
- \fi}
-
-\installpagebreakhandler \v!blank
- {\ifcase\pageornamentstate
- \global\chardef\pageornamentstate\plusone
- \fi}
-
-\installpagebreakhandler \v!no
- {\ifpagebreakdisabled\else
- \dosomebreak\nobreak
- \fi}
-
-\installpagebreakhandler \v!preference
- {\ifpagebreakdisabled\else
- \ifinsidecolumns % this will move to MUL
- \dosomebreak\goodbreak
- \else
- \testpage[3][\zeropoint]%
- \fi
- \fi}
-
-\installpagebreakhandler \v!bigpreference
- {\ifpagebreakdisabled\else
- \ifinsidecolumns % this will move to MUL
- \dosomebreak\goodbreak
- \else
- \testpage[5][\zeropoint]%
- \fi
- \fi}
-
-\installpagebreakhandler \v!empty
- {\ejectinsert
- \gotonextpage
- \doifnotvalue{\??tk\v!header\c!state}\v!stop{\setupheader[\c!state=\v!empty]}%
- \doifnotvalue{\??tk\v!footer\c!state}\v!stop{\setupfooter[\c!state=\v!empty]}%
- \ejectdummypage}
-
-\installpagebreakhandler \v!left
- {\ejectinsert
- \gotonextpageX % will become \gotonextpage
- \doifbothsidesoverruled{}{\resetcurrentsectionmarks\ejectdummypage}{}}
-
-\installpagebreakhandler \v!right
- {\ejectinsert
- \gotonextpageX % will become \gotonextpage
- \doifbothsidesoverruled{}{}{\resetcurrentsectionmarks\ejectdummypage}}
-
-\installpagebreakhandler \v!even
- {\page
- \doifoddpageelse{\resetcurrentsectionmarks\ejectdummypage}\donothing}
-
-\installpagebreakhandler \v!odd
- {\page
- \doifoddpageelse\donothing{\resetcurrentsectionmarks\ejectdummypage}}
-
-\installpagebreakhandler \v!quadruple % not yet ok inside columnsets
- {\ifdoublesided
- \!!counta\realpageno
- \!!countb\realpageno
- \divide\!!counta 4
- \divide\!!countb 2
- \ifnum\!!counta=\!!countb
- \else
- \executepagebreakhandler\v!yes
- \executepagebreakhandler\v!empty
- \executepagebreakhandler\v!empty
- \fi
- \fi}
-
-\installpagebreakhandler \v!last
- {\ejectinsert
- \gotonextpageX % will become \gotonextpage
- \relax
- \doifbothsidesoverruled
- {\shipoutfacingpage}
- {}
- {\noheaderandfooterlines \ejectdummypage}%
- \filluparrangedpages}
-
-\installpagebreakhandler \v!lastpage % handy for backpage preceded by empty pages
- {\executepagebreakhandler\v!yes
- \ifdoublesided
- \executepagebreakhandler\v!left
- \executepagebreakhandler\v!empty
- \executepagebreakhandler\v!empty
- \fi}
-
-\installpagebreakhandler \v!start
- {\globallet\shipout\normalshipout}
-
-\installpagebreakhandler \v!stop
- {\globallet\shipout\noshipout}
-
-% nb: \executepagebreakhandler\v!hoofd in other ones
-
-\installpagebreakhandler \v!header
- {\doifnotvalue{\??tk\v!header\c!state}\v!stop{\setupheader[\c!state=\v!empty]}}
-
-\installpagebreakhandler \v!footer
- {\doifnotvalue{\??tk\v!footer\c!state}\v!stop{\setupfooter[\c!state=\v!empty]}}
-
-% \definepagebreak
-% [chapter]
-% [yes,header,right]
-%
-% \setuphead
-% [chapter]
-% [page=chapter,
-% header=empty,
-% footer=chapter]
-%
-% \definepagebreak % untested
-% [lastpage]
-% [left,{empty,right},{empty,left}]
-
-% public page handler, beware: definepage already in use (core-ref)
-%
-% \definepagebreak[instance][forsure]
-% \definepagebreak[forsure][yes,+4]
-
-\def\definepagebreak
- {\dodoubleargument\dodefinepagebreak}
-
-\def\dodefinepagebreak[#1][#2]% non recursive, meant for simple mappings
- {\setvalue{\??pe::#1}{#2}}
-
-% hier nog uti blokkeren
-
-% don't change this / test case:
-%
-% \setupbackgrounds[state=repeat]
-% \setupbackgrounds[text][text][background=whatever]
-% \couplepage[chapter][before={\defineoverlay[whatever][ON]}]
-% \setuphead[chapter][before={\pagetype[chapter]}]
-% \chapter{First} \page test \chapter{second} \page test
-
-\long\def\installcolumnbreakhandler#1#2#3% #1=otr-id #2=tag
- {\long\setvalue{\??cn:#1:#2}{#3}}
-
-\def\definecolumnbreak
- {\dodoubleargument\dodefinecolumnbreak}
-
-\def\dodefinecolumnbreak[#1][#2]% non recursive, meant for simple mappings
- {\setvalue{\??cn::#1}{#2}}
-
-%\def\columnbreak
-% {\dosingleempty\docolumnbreak}
-%
-%\def\docolumnbreak[#1]%
-% {\expanded{\nextcolumn[\executeifdefined{\??cn::#1}{#1}]}}
-
-\definecomplexorsimple\columnbreak
-
-\def\simplecolumnbreak
- {\executecolumnbreakhandler\v!yes}
-
-\def\complexcolumnbreak[#1]% if empty, do nothing and avoid processing
- {\doifsomething{#1}{\executecolumnbreakhandlers{#1}}}
-
-\def\executecolumnbreakhandlers#1%
- {\processcommacommand[#1]\executecolumnbreakhandler}
-
-\def\executecolumnbreakhandler#1% here no commalist
- {\edef\@@columnspecification{#1}%
- \doifdefinedelse{\??cn:\OTRidentifier:\@@columnspecification}
- {\getvalue{\??cn:\OTRidentifier:\@@columnspecification}}
- {\doifdefinedelse{\??cn::\@@columnspecification}
- {\executecolumnbreakhandlers{\getvalue{\??cn::\@@columnspecification}}}
- {\getvalue{\??cn:\OTRidentifier:\s!unknown}}}}
-
-%let\nextcolumn\columnbreak
-\let\column \columnbreak
-
-% We don't want spurious last pages (due to left over marks):
-
-\def\noshipout
- {\writestatus\m!systems{ignoring further shipouts}%
- \global\advance\realpageno\minusone % else no flush of resources
- \dowithnextbox{\deadcycles\zerocount}}
-
-% \def\doignorerestoftext
-% {\ifarrangingpages \else \ifnum\textlevel>\zerocount \else
-% \globallet\shipout\noshipout
-% \fi \fi}
-%
-% better:
-
-\def\doignorerestoftext
- {\ifarrangingpages \else \ifnum\textlevel=\plusone
- \globallet\shipout\noshipout
- \fi \fi}
-
-\let\ignorerestoftext\donothing
-
-\prependtoks % only ignore in a symmetrical doc
- \globallet\ignorerestoftext\doignorerestoftext
-\to \everystarttext
-
-% \appendtoks
-% \ignorerestoftext
-% \to \everylastshipout
-
-\newif\ifpageselected \pageselectedtrue
-\newif\ifselectingpages \selectingpagesfalse
-\newif\ifprocessingpages\processingpagestrue
-
-\let\pageselection \empty
-\let\currentpageselection\empty
-\let\aftershipout \relax
-\let\beforeshipout \relax
-
-\def\dodobeforeshipout#1%
- {\global\let\beforeshipout\relax
- \getvalue{\??pg#1\c!before}}
-
-\def\dobeforeshipout
- {\doifsomething\currentpageselection
- {\processcommacommand[\currentpageselection]\dodobeforeshipout}}
-
-\def\dododoaftershipout#1%
- {\global\let\aftershipout\relax
- \global\let\currentpageselection\empty
- \getvalue{\??pg#1\c!after}}
-
-\def\dodoaftershipout#1%
- {\doifelsevalue{\??pg#1\c!option}\v!doublesided
- {\doifbothsidesoverruled
- {\dododoaftershipout{#1}}
- {\dododoaftershipout{#1}}
- {}}
- {\dododoaftershipout{#1}}}
-
-\def\doaftershipout
- {\doifsomething\currentpageselection
- {\processcommacommand[\currentpageselection]\dodoaftershipout}}
-
-% Dit wordt eigenlijk nooit en moet worden vervangen door
-% het meer algemene mechanisme.
-
-\def\dopagetype[#1]%
- {\edef\desoortpagina{#1}%
- \ifx\desoortpagina\empty \else
- \@EA\doglobal\@EA\addtocommalist\@EA{\desoortpagina}\currentpageselection
- \ifselectingpages
- \fullexpandtwoargsafter\doifcommon\desoortpagina\pageselection
- {\global\pageselectedtrue}%
- \fi
- \gdef\beforeshipout{\dobeforeshipout}%
- \gdef\aftershipout {\doaftershipout}%
- \fi}
-
-\def\pagetype
- {\dosingleargument\dopagetype}
-
-\def\docouplepage[#1][#2]%
- {\getparameters
- [\??pg]
- [\c!before=,
- \c!after=,
- \c!option=,
- #2]%
- \def\docommand##1%
- {\getparameters
- [\??pg##1]
- [\c!before=\@@pgbefore,
- \c!after=\@@pgafter,
- \c!option=\@@pgoption]}%
- \processcommalist[#1]\docommand}%
-
-\def\couplepage
- {\dodoubleargument\docouplepage}
-
-\def\doprocesspage[#1][#2]%
- {\processaction
- [#2]
- [\v!yes=>\global\processingpagestrue,
- \v!no=>\global\processingpagesfalse]%
- \gdef\pageselection{#1}%
- \global\selectingpagestrue
- \global\pageselectedfalse}
-
-\def\processpage
- {\dodoubleargument\doprocesspage}
-
-\def\resetselectiepagina
- {\ifselectingpages
- \doifbothsidesoverruled{\global\pageselectedfalse}{}{\global\pageselectedfalse}%
- \fi}
-
-\newif\ifregistertextareas
-\newif\iftracetextareas
-
-\newbox\registertextbox
-
-% \def\registeredtextarea#1#2#3% #1=lower-dp #2=correct-ht #3=box
-% {\hbox{\box#3}}
-
-\def\enabletextarearegistration{\global\registertextareastrue}
-
-\def\registeredtextarea#1#2#3% #1=lower-dp #2=correct-ht #3=box
- {\hbox\bgroup
- \ifregistertextareas \ifx\registerMPtextarea\undefined \else
- \setbox\registertextbox\null
- \wd\registertextbox\wd#3%
- \ht\registertextbox\ht#3%
- \dp\registertextbox\dp#3%
- \ifcase#1\or % 1
- \setbox\registertextbox\hbox{\lower\strutdp\box\registertextbox}%
- \fi
- \ifcase#2\or % 1
- \setbox\registertextbox\hbox{\raise\topskip\hbox{\lower\strutht\box\registertextbox}}%
- \dp\registertextbox\strutdp
- \fi
- \dp\registertextbox\strutdp % needed
- %\setbox\registertextbox\hbox
- % {\iftracetextareas\gray\boxrulewidth2pt\ruledhbox\fi
- % {\registerMPtextarea{\box\registertextbox}}}%
- \setbox\registertextbox\hbox
- {\registerMPtextarea{\box\registertextbox}}%
- \smashbox\registertextbox
- \box\registertextbox
- \fi \fi
- \box#3%
- \egroup}
-
-%D \macros
-%D {setupoppositeplacing,startopposite}
-%D
-%D \starttyping
-%D \starttext
-%D test \startopposite \blackrule[width=3cm,height=4cm] \stopopposite test
-%D test \startopposite \blackrule[width=3cm,height=4cm] \stopopposite test
-%D \stoptext
-%D \stoptyping
-
-% Moved from page-mar.tex, made english, cleaned up, but still to be
-% redesigned
-
-\newbox\facingpage
-
-\def\setupoppositeplacing
- {\dodoubleargument\getparameters[\??np]}
-
-\def\startopposite
- {\dowithnextboxcontent
- {\hsize\makeupwidth}%
- {\global\setbox\facingpage\vbox
- {\ifvoid\facingpage
- \@@npbefore
- \else
- \@@npinbetween
- \unvbox\facingpage
- \fi
- \box\nextbox}}%
- \vbox\bgroup}
-
-\def\stopopposite
- {\egroup}
-
-\def\finishfacingpage
- {\ifvoid\facingpage\else
- \global\setbox\facingpage\vbox to \makeupheight
- {\unvbox\facingpage
- \@@npafter
- \vss}%
- \fi}
-
-\def\shipoutfacingpage
- {\doif\@@npstate\v!start
- {\ifvoid\facingpage\else
- \ifnum\realpageno>\plusone
- \bgroup
- \chardef\pageornamentstate\plusone
- \finishfacingpage
- \myshipout{\buildpagebody\box\facingpage}%
- \egroup
- \else
- \global\setbox\facingpage\emptybox
- \fi
- \fi}}
-
-\setupoppositeplacing
- [\c!state=\v!start,
- \c!before=,
- \c!inbetween=\blank,
- \c!after=]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/page-ins.mkii b/Master/texmf-dist/tex/context/base/mkii/page-ins.mkii
deleted file mode 100644
index ce0f51d7282..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/page-ins.mkii
+++ /dev/null
@@ -1,103 +0,0 @@
-%D \module
-%D [ file=core-ins,
-%D version=2002.04.16,
-%D title=\CONTEXT\ Insertion Macros,
-%D subtitle=Insertions,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Core Macros / Insertions}
-
-%D Insertions are special data collections that are associated
-%D to \TEX's internal page builder. When multiple footnote
-%D classes were introduced, I decided to isolate some of the
-%D functionality in a module.
-
-\unprotect
-
-\newtoks\@@insertionlist
-
-\def\processinsertions{\the\@@insertionlist}
-
-\let\doprocessinsert\gobbleoneargument
-
-%\def\installinsertion#1%
-% {\ifx#1\undefined
-% \newinsert#1%
-% \count#1\plusthousand
-% \skip #1\zeropoint
-% \dimen#1\maxdimen
-% \appendtoks\doprocessinsert#1\to\@@insertionlist
-% \fi}
-
-\def\installinsertion#1%
- {\ifx#1\undefined
- \let#1\relax
- \fi
- \ifx#1\relax % permits \csname...\endcsname
- \newinsert#1%
- \count#1\plusthousand
- \skip #1\zeropoint
- \dimen#1\maxdimen
- \appendtoks\doprocessinsert#1\to\@@insertionlist
- \fi}
-
-
-\def\synchronizeinsertions
- {\def\doprocessinsert##1{\ifvoid##1\else\insert##1{\unvbox##1}\fi}%
- \processinsertions}
-
-%D For instance, when we postpone footnotes, we need to save
-%D some data related to the inserts. The next methods are
-%D far from ideal, but better than nothing. We save and
-%D restore box content and associated data independently.
-%D The box content is only restores when non||void.
-
-\def\backupinsertion#1%
- {\csname\string#1\endcsname}
-
-\def\installbackupinsertion#1%
- {\expandafter\newinsert\csname\string#1\endcsname
- \count\backupinsertion#1\zerocount
- \skip \backupinsertion#1\zeropoint
- \dimen\backupinsertion#1\maxdimen}
-
-\def\saveinsertionbox#1%
- {\ifdim\ht#1>\zeropoint % hm, actually unknown
- \global\setbox\backupinsertion#1\box#1%
- \else
- \global\setbox\backupinsertion#1\emptybox
- \fi}
-
-\def\restoreinsertionbox#1%
- {\ifvoid\backupinsertion#1\else % if void, we keep the content
- \global\setbox#1\box\backupinsertion#1%
- \fi}
-
-\def\eraseinsertionbackup#1%
- {\global\setbox\backupinsertion#1\emptybox}
-
-\def\saveinsertiondata#1%
- {\global\skip \backupinsertion#1\skip #1%
- \global\count\backupinsertion#1\count#1%
- \global\dimen\backupinsertion#1\dimen#1}
-
-\def\restoreinsertiondata#1%
- {\global\skip #1\skip \backupinsertion#1%
- \global\count#1\count\backupinsertion#1%
- \global\dimen#1\dimen\backupinsertion#1}
-
-%D Auxiliary macros:
-
-\def\addinsertionheight#1\to#2%
- {\ifvoid#1\else
- \advance#2 1\skip#1\relax
- \advance#2 \ht #1\relax
- \fi}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/page-lay.mkii b/Master/texmf-dist/tex/context/base/mkii/page-lay.mkii
deleted file mode 100644
index 61ff8764f38..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/page-lay.mkii
+++ /dev/null
@@ -1,1439 +0,0 @@
-%D \module
-%D [ file=page-lay,
-%D version=2000.10.20, % copied from main-001
-%D title=\CONTEXT\ Page Macros,
-%D subtitle=Layout Specification,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 / Layout Specification}
-
-%D This module is now etex dependent.
-
-% to be translated into english
-
-% hoofdhoogte wordt bij status=hoog niet aangepast op outer
-% level, wel binnen bepaalde berekeningen
-
-%D Before you start wondering why some of the page related
-%D modules skip upward or left in order to place elements, you
-%D must realize that the reference point is the top left
-%D corner of the main typesetting area. One reason for this
-%D choice is that it suited some viewers that displayed page
-%D areas. Another reason is that margins, edges and top and
-%D bottom areas are kind of virtual, while the header, text
-%D and footer areas normally determine the text flow.
-
-\unprotect
-
-%D First we get rid of the funny \TEX\ offset defaults of one
-%D inch by setting them to zero.
-
-\voffset = 0pt % setting this to -1in let's go metapost crazy
-\hoffset = 0pt % setting this to -1in let's go metapost crazy
-
-%D The dimensions related to layout areas are represented by
-%D real dimensions.
-
-\newdimen\paperheight \paperheight = 297mm
-\newdimen\paperwidth \paperwidth = 210mm
-
-\newdimen\printpaperheight \printpaperheight = \paperheight
-\newdimen\printpaperwidth \printpaperwidth = \paperwidth
-
-\newdimen\makeupheight % calculated
-\newdimen\makeupwidth % calculated
-
-\newdimen\textheight % calculated
-\newdimen\textwidth % calculated
-
-\newdimen\topspace \topspace = 2cm
-\newdimen\backspace \backspace = \topspace
-\newdimen\cutspace \cutspace = 0pt
-\newdimen\bottomspace \bottomspace = 0pt
-
-\newdimen\headerheight \headerheight = 2cm
-\newdimen\footerheight \footerheight = \headerheight
-
-\newdimen\topoffset \topoffset = 0pt
-\newdimen\backoffset \backoffset = \topoffset
-
-\newdimen\leftmarginwidth \leftmarginwidth = 3cm
-\newdimen\rightmarginwidth \rightmarginwidth = \leftmarginwidth
-
-\newdimen\leftedgewidth \leftedgewidth = 3cm
-\newdimen\rightedgewidth \rightedgewidth = \leftedgewidth
-
-\newdimen\topheight \topheight = 0cm
-\newdimen\bottomheight \bottomheight = \topheight
-
-\newcount\layoutlines \layoutlines = 0
-\newcount\layoutcolumns \layoutcolumns = 0
-\newdimen\layoutcolumndistance \layoutcolumndistance = 0pt
-\newdimen\layoutcolumnwidth \layoutcolumnwidth = 0pt
-
-%D We can save some tokens and fuzzy parameters by using a
-%D symbolic name for the current set of layout parameters.
-
-\let\currentlayout\empty
-
-\def\layoutparameter#1%
- {\csname\??ly\ifcsname
- \??ly\currentlayout#1\endcsname\currentlayout
- \fi#1\endcsname}
-
-\def\namedlayoutparameter#1#2%
- {\csname\??ly\ifcsname\??ly #1#2\endcsname#1\else
- \ifcsname\??ly\currentlayout#2\endcsname\currentlayout
- \fi\fi#2\endcsname}
-
-%D Beause normal \TEX\ has at most 256 dimensions (of which a
-%D substantial part is already in use), we provide a way to
-%D generate a format with macro based alternatives. For a long
-%D time, this used to be the default case. Beware: only fixed
-%D dimensions can be used in calculations! By the way, the
-%D gain in speed can hardly be called impressive and is roughly
-%D 1 second on a 35 second run of 850 empty pages with a
-%D couple of backgrounds only (which is far less than one
-%D percent on a normal document).
-
-%D The next series of dimensions are complemented by left
-%D and rights ones.
-
-\newdimen \margindistance
-\newdimen \edgedistance
-\newdimen \marginwidth
-\newdimen \edgewidth
-
-%D Because a distance does not really makes sense when there
-%D is no area, we use a zero distance in case there is no
-%D area.
-
-\def\layoutdistance#1#2%
- {\ifdim\zeropoint<#1\layoutparameter#2\else\zeropoint\fi}
-
-%D The horizontal distances are:
-
-\newdimen \leftedgedistance
-\newdimen \rightedgedistance
-\newdimen \leftmargindistance
-\newdimen \rightmargindistance
-
-%D The vertical distances are:
-
-\newdimen \topdistance
-\newdimen \headerdistance
-\newdimen \footerdistance
-\newdimen \bottomdistance
-
-%D We need to calculate the extra distances:
-
-\def\setlayoutdimensions
- {\global\marginwidth \layoutparameter\c!margin
- \global\edgewidth \layoutparameter\c!edge
- \global\margindistance \layoutparameter\c!margindistance
- \global\edgedistance \layoutparameter\c!edgedistance
- \global\leftedgedistance \layoutdistance \leftedgewidth \c!leftedgedistance
- \global\rightedgedistance \layoutdistance \rightedgewidth \c!rightedgedistance
- \global\leftmargindistance \layoutdistance \leftmarginwidth \c!leftmargindistance
- \global\rightmargindistance\layoutdistance \rightmarginwidth \c!rightmargindistance
- \global\topdistance \layoutdistance \topheight \c!topdistance
- \global\headerdistance \layoutdistance \headerheight \c!headerdistance
- \global\footerdistance \layoutdistance \footerheight \c!footerdistance
- \global\bottomdistance \layoutdistance \bottomheight \c!bottomdistance}
-
-\def\setlayoutdistances % local in \setreducedvsize
- {\headerdistance\layoutdistance\headerheight\c!headerdistance
- \footerdistance\layoutdistance\footerheight\c!footerdistance}
-
-% these are wrong in the running text, assumes some swapping, needs a cleanup
-
-\def\outermarginwidth {\rightorleftpageaction\rightmarginwidth \leftmarginwidth }
-\def\innermarginwidth {\rightorleftpageaction\leftmarginwidth \rightmarginwidth}
-\def\outermargindistance{\rightorleftpageaction\rightmargindistance\leftmargindistance }
-\def\innermargindistance{\rightorleftpageaction\leftmargindistance \rightmargindistance}
-
-\def\outeredgewidth {\rightorleftpageaction\rightedgewidth \leftedgewidth }
-\def\inneredgewidth {\rightorleftpageaction\leftedgewidth \rightedgewidth}
-\def\outeredgedistance {\rightorleftpageaction\rightedgedistance\leftedgedistance }
-\def\inneredgedistance {\rightorleftpageaction\leftedgedistance \rightedgedistance}
-
-\def\outerspacewidth {\rightorleftpageaction\cutspace\backspace}
-\def\innerspacewidth {\rightorleftpageaction\backspace\cutspace}
-
-\newtoks\extralayoutcalculations \def\calculatelayoutextras{\the\extralayoutcalculations}
-
-% \appendtoks
-% non etex calculations used to go here
-% \to \extralayoutcalculations
-
-\newtoks\everyswapmargins % watch the order !
-
-\appendtoks
- \swapdimens\leftmargindistance\rightmargindistance
- \swapdimens\leftedgedistance \rightedgedistance
- \swapdimens\leftmarginwidth \rightmarginwidth
- \swapdimens\leftedgewidth \rightedgewidth
-\to \everyswapmargins
-
-\appendtoks
- \swapmacros\leftmargintotal \rightmargintotal
- \swapmacros\leftedgetotal \rightedgetotal
- \swapmacros\leftsidetotal \rightsidetotal
- \swapmacros\leftcombitotal \rightcombitotal
- \swapmacros\innermargintotal\outermargintotal
- \swapmacros\inneredgetotal \outeredgetotal
- \swapmacros\innercombitotal \outercombitotal
- \swapmacros\innersidetotal \outersidetotal
-\to \everyswapmargins
-
-%D \macros
-%D {definepapersize}
-%D
-%D Before we start calculating layout dimensions, we will
-%D first take care of paper sizes. The first argument can be
-%D either an assignment (for defaults) or an identifier, in
-%D which case the second argument is an assignment.
-%D
-%D \showsetup{definepapersize}
-
-\def\definepapersize
- {\dodoubleempty\dodefinepapersize}
-
-\def\definepapersize
- {\dotripleempty\dodefinepapersize}
-
-\def\dodefinepapersize[#1][#2][#3]%
- {\ifsecondargument
- \doifsomething{#1} % to be sure
- {\doifassignmentelse{#2}
- {\getparameters
- [\??pp#1] % geen \c!scale, scheelt hash ruimte
- [\c!width=\@@ppwidth,\c!height=\@@ppheight,\c!offset=\@@ppoffset,#2]}
- {\setvalue{\??pp:1:#1}{#2}%
- \setvalue{\??pp:2:#1}{#3}}}%
- \else
- \getparameters[\??pp][#1]%
- \setuppapersize % hm. this will freeze !
- \fi}
-
-%D For the moment we need to fake this macro.
-
-\ifx\setuppapersize\undefined
- \let\setuppapersize\relax
-\fi
-
-%D We set the defaults to the dimensions of an A4 sheet of
-%D paper.
-
-\definepapersize
- [\c!width=210mm,\c!height=297mm,\c!offset=\!!zeropoint]
-
-%D Yet undocumented, let's see if it gets noticed.
-%D
-%D \starttyping
-%D \definepapersize[main] [A4] [A4]
-%D \definepapersize[extra][A4,landscape][A4,landscape]
-%D
-%D \starttext
-%D \setuppapersize[main]
-%D Page 1. \page
-%D Page 2. \page
-%D \setuppapersize[extra]
-%D Page 2 \page
-%D \setuppapersize[main]
-%D Page 3. \page
-%D Page 4. \page
-%D \adaptpapersize[extra]
-%D Page 5. \page
-%D Page 6. \page
-%D \stoptext
-%D \stoptyping
-
-%D \macros
-%D {setuppaper,setuppapersize}
-%D
-%D When setting up the papersize on which to typeset and
-%D print, we can also determine some more characteristics.
-%D
-%D \showsetup{setuppapersize}
-%D
-%D We keep track of these features with the following
-%D variables.
-
-\chardef\papermirror =0 \chardef\printmirror =0
-\chardef\paperorientation=0 \chardef\printorientation=0 % beware: later no chardef
-\chardef\paperreverse =0 \chardef\printreverse =0
-\chardef\paperlandscape =0 \chardef\printlandscape =0
-
-\let\papersize\empty \let\printpapersize\empty
-
-\def\paperscale{1} \newif\ifnegateprintbox
-
-\def\setuppaper[#1]%
- {\getparameters[\??pp][\c!paper=,\c!page=,#1]%
- \edef\@@ppxy{\the\numexpr\@@ppnx*\@@ppny\relax}%
- \doifelsenothing\@@pppage
- {\doifelsenothing\@@pppaper
- {} % {\setuppapersize} % added, removed, no need for, too tricky, mag-01 (fixed by freezing pp's)
- {\dodosetuppapersize[\papersize][\@@pppaper]}}
- {\doifelsenothing\@@pppaper
- {\dodosetuppapersize[\@@pppage][\printpapersize]}
- {\dodosetuppapersize[\@@pppage][\@@pppaper]}}}
-
-\def\setuppapersize
- {\dodoubleempty\dosetuppapersize}
-
-\def\dosetuppapersize[#1][#2]%
- {\doifassignmentelse{#1}
- {\setuppaper[#1]}
- {\doifelsenothing{#2}
- {\expanded{\dodosetuppapersize
- [\executeifdefined{\??pp:1:#1}{#1}]%
- [\executeifdefined{\??pp:2:#1}{\v!default}]}}
- {\doifassignmentelse{#2}
- {\getparameters[\??pp\executeifdefined{\??pp:1:#1}{#1}][#2]}
- {\expanded{\dodosetuppapersize
- [\executeifdefined{\??pp:1:#1}{#1}]%
- [\executeifdefined{\??pp:1:#2}{#2}]}}}}}
-
-\let\reinstatepapersize\relax
-
-\def\adaptpapersize
- {\global\let\reinstatepapersize\restorepapersize
- \setuppapersize}
-
-\appendtoks
- \reinstatepapersize
- \global\let\reinstatepapersize\relax
-\to \everyaftershipout
-
-\def\dodosetuppapersize[#1][#2]%
- {\ifsecondargument
- \expanded{\dododosetuppapersize[#1][#2]}%
- \calculatehsizes
- \calculatevsizes
- \recalculatelogos
- \recalculatebackgrounds
- \recalculatelayout
- \else\iffirstargument
- \setuppapersize[#1][#2]%
- \else\ifx\papersize\undefined\else
- \restorepapersize
- \fi\fi\fi}
-
-% dimen freeze is a bit tricky, but catches local redundant calls
-% with values where e.g width is defined in terms of \paperwidth
-
-\def\dododosetuppapersize[#1][#2]%
- {\xdef\restorepapersize{\noexpand\setuppapersize[#1][#2]}%
- \dosetuppaperorientation{#1}\paperlandscape\paperorientation\paperreverse\papermirror
- \dosetuppaperorientation{#2}\printlandscape\printorientation\printreverse\printmirror
- \def\docommand##1%
- {\doifsomething{##1}{\doifdefined{\??pp##1\c!width}
- {\global\paperwidth \getvalue{\??pp##1\c!width}%
- \global\paperheight\getvalue{\??pp##1\c!height}%
-\ifinpagebody
- \setevalue{\??pp##1\c!height}{\the\paperheight}%
- \setevalue{\??pp##1\c!width }{\the\paperwidth }%
-\fi
- \calculatepaperoffsets{##1}%
- \xdef\papersize{##1}}}}%
- \processcommacommand[#1]\docommand
- \doifdefinedelse{\??pp#1\c!scale}
- {\edef\paperscale{\getvalue{\??pp#1\c!scale}}}
- {\edef\paperscale{1}}%
- \def\docommand##1%
- {\doifsomething{##1}{\doifdefined{\??pp##1\c!width}
- {\global\printpaperwidth \getvalue{\??pp##1\c!width}%
- \global\printpaperheight\getvalue{\??pp##1\c!height}%
-\ifinpagebody
- \setevalue{\??pp##1\c!height}{\the\printpaperheight}%
- \setevalue{\??pp##1\c!width }{\the\printpaperwidth}%
-\fi
- \xdef\printpapersize{##1}}}}%
- \processcommacommand[#2]\docommand
- \global\setdimentoatleast\paperwidth \onepoint
- \global\setdimentoatleast\paperheight \onepoint
- \global\setdimentoatleast\printpaperwidth \onepoint
- \global\setdimentoatleast\printpaperheight\onepoint
- \ifcase\paperlandscape\else
- \doglobal\swapdimens\paperwidth\paperheight
- \fi
- \ifcase\printlandscape\else
- \doglobal\swapdimens\printpaperwidth\printpaperheight
- \fi
- % this check can be confusing, so we've added the possibility
- % to bypass this test: \setuppapersize[option=fit]
- \doif\@@ppoption\v!max % \v!fit is
- {\bgroup
- % we need to pre-swap else we get the wrong paper size
- \ifcase\paperorientation\else
- \doifinset\paperorientation{90,270}{\swapdimens\paperwidth\paperheight}%
- \fi
- \ifcase\printorientation\else
- \doifinset\printorientation{90,270}{\swapdimens\printpaperwidth\printpaperheight}%
- \fi
- \ifdim\paperheight>\printpaperheight
- \global\printpaperheight\paperheight
- \writestatus\m!systems{print height forced to paper height}%
- \fi
- \ifdim\paperwidth>\printpaperwidth
- \global\printpaperwidth\paperwidth
- \writestatus\m!systems{print width forced to paper width}%
- \fi
- \egroup}}
-
-\def\dosetuppaperorientation#1#2#3#4#5%
- {\global\chardef#2\zerocount
- \global\chardef#5\zerocount
- \globallet#3\!!zerocount
- \globallet#4\!!zerocount
- \global\negateprintboxfalse
- \processallactionsinset
- [#1]
- [ \v!landscape=>\global\chardef#2\plusone,
- \v!mirrored=>\global\chardef#5\plusone,
- \v!rotated=>\gdef#3{90}\gdef#4{270},
- \v!negative=>\global\negateprintboxtrue,
- 90=>\gdef#3{90}\gdef#4{270},
- 180=>\gdef#3{180}\gdef#4{0},
- 270=>\gdef#3{270}\gdef#4{90}]}
-
-\ifx\calculatepaperoffsets\undefined
-
- \def\calculatepaperoffsets#1%
- {\scratchdimen\getvalue{\??pp#1\c!offset}%
- \global\advance\paperwidth -2\scratchdimen
- \global\advance\paperheight-2\scratchdimen}
-
-\fi
-
-\let\restorepapersize\relax
-
-\def\checkforems[#1]%
- {\def\docommand##1%
- {\beforesplitstring##1\at em\to\asciia
- \doifnot\asciia{##1}
- {\aftersplitstring\asciia\at=\to\asciia
- \doifsomething\asciia
- {\showmessage\m!systems{10}{##1}}}}%
- \processcommalist[#1]\docommand}
-
-\ifx\setups\undefined \def\setups[#1]{\setdefaultpenalties} \fi
-
-% \newtoks \everybeforelayout \relax
-% \newtoks \everyafterlayout \relax
-
-\def\recalculatelayout
- {\doifsomething{\layoutparameter\c!page\layoutparameter\c!paper}
- {\expanded{\dododosetuppapersize[\layoutparameter\c!page][\layoutparameter\c!paper]}}%
- \dorecalculatelayout}
-
-\def\dorecalculatelayout
- {%\the\everybeforelayout
- \setups[\layoutparameter\c!preset]%
- \global\leftmarginwidth \layoutparameter\c!leftmargin
- \global\rightmarginwidth\layoutparameter\c!rightmargin
- \global\leftedgewidth \layoutparameter\c!leftedge
- \global\rightedgewidth \layoutparameter\c!rightedge
- \global\headerheight \layoutparameter\c!header
- \global\footerheight \layoutparameter\c!footer
- \global\bottomheight \layoutparameter\c!bottom
- \global\topheight \layoutparameter\c!top
- \global\backspace \layoutparameter\c!backspace
- \global\topspace \layoutparameter\c!topspace
- \setlayoutdimensions % the rest of the `dimensions'
- \doifelse\@@lygrid\v!yes\gridsnappingtrue\gridsnappingfalse
- \ifgridsnapping
- \setsystemmode\v!grid
- \else
- \resetsystemmode\v!grid
- \fi
- \setups[\layoutparameter\c!setups]% depends on gridsnapping !
- \simplesetupwhitespace
- \simplesetupblank
- \global\cutspace\layoutparameter\c!cutspace
- \relax
- \doifelse{\layoutparameter\c!width}\v!middle
- {\ifdim\cutspace=\zeropoint
- \global\cutspace\backspace
- \fi
- \global\makeupwidth\dimexpr\paperwidth-\backspace-\cutspace\relax}
- {\doifelse{\layoutparameter\c!width}\v!fit
- {\ifdim\cutspace=\zeropoint
- \global\cutspace\backspace
- \fi
- \global\makeupwidth\dimexpr\paperwidth-\cutspace\relax
- \scratchdimen\dimexpr\backspace
- -\leftedgewidth -\leftedgedistance
- -\leftmarginwidth-\leftmargindistance\relax
- \ifdim\scratchdimen<\zeropoint
- \scratchdimen\zeropoint
- \fi
- \global\advance\makeupwidth\dimexpr
- -\rightmargindistance-\rightmarginwidth
- -\rightedgedistance -\rightedgewidth
- -\scratchdimen\relax}
- {\global\makeupwidth\layoutparameter\c!width\relax
- \ifdim\cutspace=\zeropoint
- \global\cutspace\dimexpr\paperwidth-\makeupwidth-\backspace\relax
- % \else
- % A kind of inconsistent specification, but used
- % in for instance s-pre-19.tex; the cutspace is
- % used only for determining some kind of right
- % margin; don't use this in doublesided mode
- \fi}}%
- \scratchdimen\layoutparameter\c!bottomspace\relax
- %\ifdim\scratchdimen=\zeropoint
- % \scratchdimen\topspace
- %\fi
- \global\bottomspace\layoutparameter\c!bottomspace\relax
- \global\layoutlines0\number\layoutparameter\c!lines\relax % may be empty
- \ifcase\layoutlines
- \doifelse{\layoutparameter\c!height}\v!middle
- {\ifdim\bottomspace=\zeropoint
- \global\bottomspace\topspace
- \fi
- \global\makeupheight\dimexpr\paperheight-\topspace-\bottomspace\relax}
- {\doifelse{\layoutparameter\c!height}\v!fit
- {\ifdim\bottomspace=\zeropoint
- \global\bottomspace\topspace
- \fi
- \global\makeupheight\dimexpr\paperheight-\bottomspace\relax
- \scratchdimen\dimexpr\topspace-\topheight-\topdistance\relax
- \ifdim\scratchdimen<\zeropoint
- \scratchdimen\zeropoint
- \fi
- \global\advance\makeupheight\dimexpr-\bottomdistance-\bottomheight-\scratchdimen\relax}
- {\global\makeupheight\layoutparameter\c!height\relax
- \ifdim\bottomspace=\zeropoint
- \global\bottomspace\dimexpr\paperheight-\makeupheight-\topspace\relax
- \else
- % inconsistent specification
- \fi}}%
- \else
- % beware, when the bodyfont changes (switched) this will change as well; implementing
- % a global lineheight is tricky: should we take the bodyfont interlinespace or the one set
- % independent of the bodyfont (before or after a layout spec); way too fuzzy, so we
- % stick to the current method (after a night of experimenting ...2003/10/13)
- \global\makeupheight\dimexpr
- \layoutparameter\c!lines\lineheight-\strutheight+\topskip+
- \headerdistance+\headerheight+\footerdistance+\footerheight\relax
- \fi
- \backoffset\layoutparameter\c!horoffset
- \topoffset \layoutparameter\c!veroffset
- \global\setdimentoatleast\makeupwidth\onepoint
- \global\setdimentoatleast\makeupheight \onepoint
- % \checkcurrentlayout % here ?
- % \the\everyafterlayout
- \calculatelayoutextras
- \calculatehsizes
- \calculatevsizes
- \calculatepseudocolumns
- \checkgridsnapping
- \recalculatelogos
- \recalculatebackgrounds}
-
-\def\calculatepseudocolumns
- {\global\layoutcolumns\layoutparameter\c!columns
- \global\layoutcolumndistance\layoutparameter\c!columndistance
- \global\layoutcolumnwidth\dimexpr\makeupwidth-\layoutcolumns\layoutcolumndistance+\layoutcolumndistance\relax
- \global\divide\layoutcolumnwidth\layoutcolumns
- \dorecurse\layoutcolumns
- {\setxvalue{\??ly:c:\recurselevel}%
- {\the\numexpr\recurselevel-\plusone\relax\dimexpr\layoutcolumnwidth+\layoutcolumndistance\relax}}}
-
-%\dorecurse\layoutcolumns
-% {\setxvalue{\??ly:c:\recurselevel}{\the\dimexpr
-% (\numexpr(\recurselevel-1)\dimexpr(\layoutcolumnwidth+\layoutcolumndistance))}}
-
-\def\layoutcolumnoffset#1%
- {\executeifdefined{\??ly:c:#1}\!!zeropoint}
-
-\def\checklayout
- {\ifdim\makeupheight=\layoutlines\lineheight \else \recalculatelayout \fi}
-
-\appendtoks \checklayout \to \everystarttext
-
-% document:
-%
-% \setuplayout[odd][state=stop] \setuplayout[even][state=stop] \setuplayout[page]
-%
-% \startstandardmakeup[page=blank] ... \stopstandardmakeup
-
-\def\changetolayout#1%
- {%\writestatus\m!layouts{changing to layout #1}%
- \xdef\currentlayout{#1}\recalculatelayout}
-
-\def\checkcurrentoddlayout
- {\ifcsname\??ly\v!odd\c!state\endcsname
- \doifvalue{\??ly\v!odd\c!state}\v!start{\changetolayout\v!odd}%
- \fi}
-
-\def\checkcurrentevenlayout
- {\ifcsname\??ly\v!even\c!state\endcsname
- \doifvalue{\??ly\v!even\c!state}\v!start{\changetolayout\v!even}%
- \fi}
-
-\ifx\lastpage\undefined \def\lastpage{1} \fi
-
-\def\reverserealfolio
- {\ifnum\lastpage>\plusone
- \ifnum\lastpage=\realfolio
- \v!last
- \else\ifnum\plusone=\realfolio
- \v!first
- \else
- \the\numexpr\realfolio-\lastpage\relax
- \fi\fi
- \else
- \!!zerocount
- \fi}
-
-\def\checkcurrentlayout % public and used in naw, so keep this name
- {\ifcsname\??ly\realfolio\c!state\endcsname
- \doifvalue{\??ly\realfolio\c!state}\v!start{\changetolayout\realfolio}%
- \else\ifcsname\??ly\reverserealfolio\c!state\endcsname
- \doifvalue{\??ly\reverserealfolio\c!state}\v!start{\changetolayout\reverserealfolio}%
- \else\ifcsname\??ly\v!current\c!state\endcsname
- \changetolayout\v!current % no start test ?
- \else
- \doifoddpageelse\checkcurrentoddlayout\checkcurrentevenlayout
- \fi\fi\fi}
-
-% testcase
-%
-% \setuppagenumbering[alternative=doublesided]
-%
-% \setuplayout [width=11cm]
-% \definelayout [odd] [backspace=1cm]
-% \definelayout [even] [backspace=4cm]
-% \definelayout [5] [backspace=5cm]
-% \definelayout [6] [backspace=5cm]
-% \definelayout [-2] [backspace=0cm,cutspace=0cm]
-% \definelayout [last] [backspace=0cm,cutspace=0cm]
-%
-% \checkcurrentlayout \showframe
-%
-% \starttext
-% \dorecurse{20} {\input knuth \endgraf \input tufte \endgraf}
-% \stoptext
-
-%appendtoks \checkcurrentlayout \to \everyaftershipout % no
-\appendtoks \checkcurrentlayout \to \everystarttext
-
-\appendtoks
- \dochecknextlayout
-\to \everyaftershipout
-
-% \def\dochecknextlayout
-% {\ifx\currentlayout\v!current
-% % prevent redundant calculations
-% \else
-% \globallet\currentlayout\empty
-% \global\letbeundefined{\??ly\v!current\c!state}%
-% \checkcurrentlayout
-% \fi}
-%
-% this breaks after a standardmakeup
-
-\def\dochecknextlayout{\checkcurrentlayout}
-
-\newif\ifdoublesidedprint
-
-\def\presetcenterpagebox % in \setuplayout !!!!!!!!!!!!!!!!
- {\doublesidedprintfalse
- \ExpandFirstAfter\processallactionsinset
- [\@@lylocation]
- [ \v!middle=>{\setuppapersize[\c!left=\hss,\c!right=\hss,\c!top=\vss,\c!bottom=\vss]},
- \v!left=>{\setuppapersize[\c!left=,\c!right=\hss]},
- \v!right=>{\setuppapersize[\c!left=\hss,\c!right=]},
- \v!bottom=>{\setuppapersize[\c!top=\vss,\c!bottom=]},
- \v!top=>{\setuppapersize[\c!top=,\c!bottom=\vss]},%
- \v!doublesided=>\doublesidedprinttrue,
- \v!singlesided=>\doublesidedprintfalse]}
-
-\def\definelayout
- {\dodoubleargument\dodefinelayout}
-
-\def\dodefinelayout[#1][#2]%
- {\getparameters[\??ly#1][\c!state=\v!start,#2]}
-
-\def\dodosetuplayout[#1][#2]%
- {\ConvertToConstant\doifnot{#2}\v!reset % #2 ?
- {\getparameters[\??ly#1][#2]%
- \checkforems[#2]}}
-
-% global needed for non-doublesided standardmakeup
-
-\def\dosetuplayout[#1][#2]%
- {\globallet\currentlayout\empty % new, global
- \ifsecondargument
- \dodosetuplayout[#1][#2]%
- \else\iffirstargument
- \doifassignmentelse{#1}
- {\dodosetuplayout[][#1]}
- {\doifnot{#1}\v!reset{\xdef\currentlayout{#1}}}% new, global
- \fi\fi
- \recalculatelayout
- \checkcurrentlayout % here ?
- \presetcenterpagebox}
-
-\def\setuplayout
- {\dodoubleempty\dosetuplayout}
-
-\let\@@zaheight=\!!zeropoint
-
-\def\dopushpagedimensions
- {\xdef\oldtextheight {\the\textheight }%
- \xdef\oldfooterheight{\the\footerheight}%
- \global\let\@@zaheight\@@zaheight}
-
-\def\dopoppagedimensions
- {\global\textheight \oldtextheight
- \global\footerheight\oldfooterheight
- \recalculatelayout
- \global\let\pushpagedimensions\dopushpagedimensions
- \global\let\poppagedimensions\relax}
-
-\let\poppagedimensions = \relax
-\let\pushpagedimensions = \dopushpagedimensions
-
-% Elke \csname ... \endcsname wordt ook aangemaakt, dus ook
-% in een test met \doifdefined. Bij veel bladzijden kan dit
-% te veel macro's kosten. Vandaar de set \adaptedpages. Het
-% kost tijd, maar scheelt macro's.
-
-\let\adaptedpages\empty
-
-\def\adaptpagedimensions
- {\ifx\adaptedpages\empty\else
- \rawdoifinsetelse\realfolio\adaptedpages
- {\getvalue{\??za\realfolio}%
- \letbeundefined{\??za\realfolio}}
- \donothing
- \fi}
-
-\def\checkpagedimensions
- {\poppagedimensions
- \adaptpagedimensions}
-
-\def\reportpagedimensions
- {\ifx\poppagedimensions\relax \else
- \space\the\dimexpr\@@zaheight\relax\space-\space
- \fi
- \realfolio}
-
-\def\dodoadaptlayout[#1]%
- {\getparameters[\??za][\c!height=,\c!lines=0,#1]%
- \pushpagedimensions
- \ifcase\@@zalines\relax
- \showmessage\m!layouts1{\@@zaheight,\realfolio}%
- \else
- \showmessage\m!layouts1{\@@zalines\space\v!lines,\realfolio}%
- \def\@@zaheight{\@@zalines\openlineheight}%
- \fi
- \doifelse\@@zaheight\v!max
- {\balancedimensions\textheight\footerheight\footerheight}
- {\balancedimensions\textheight\footerheight\@@zaheight}%
- \ifdim\footerheight<\zeropoint
- \global\advance\textheight \footerheight
- \global\footerheight\zeropoint
- \global\xdef\@@zaheight{\layoutparameter\c!footer\space(\v!max)}%
- \fi
- \setvsize
- \global\pagegoal\vsize % nog corrigeren voor insertions ?
- \recalculatelogos
- \recalculatebackgrounds
- \global\let\pushpagedimensions\relax
- \global\let\poppagedimensions\dopoppagedimensions}
-
-\def\doadaptlayout[#1][#2]%
- {\doifelsenothing{#2}
- {\dodoadaptlayout[#1]}
- {\def\docommand##1%
- {\addtocommalist{##1}\adaptedpages
- \setgvalue{\??za##1}{\dodoadaptlayout[#2]}}%
- \processcommalist[#1]\docommand
- \adaptpagedimensions}}
-
-\def\adaptlayout
- {\dodoubleempty\doadaptlayout}
-
-% describe interface
-
-%D Centering the paper area on the print area is determined
-%D by the \type {top}, \type {bottom}, \type {left} and \type
-%D {right} parameters.
-
-\def\centerpagebox#1%
- {\printpaperwidth \paperscale\printpaperwidth
- \printpaperheight\paperscale\printpaperheight
- \setbox#1\vbox to \printpaperheight
- {\@@pptop
- \hbox to \printpaperwidth
- {\ifdoublesidedprint
- \doifbothsides
- {\@@ppleft \box#1\@@ppright}
- {\@@ppleft \box#1\@@ppright}
- {\@@ppright\box#1\@@ppleft }%
- \else
- \@@ppleft \box#1\@@ppright
- \fi}%
- \par
- \@@ppbottom}}
-
-\def\offsetprintbox#1%
- {\ifdim\topoffset=\zeropoint % \relax
- \ifdim\backoffset=\zeropoint
- \donefalse
- \else
- \donetrue
- \fi
- \else
- \donetrue
- \fi
- \ifdone
- \edef\next{\wd#1\the\wd#1\ht#1\the\ht#1\dp#1\the\dp#1}%
- \setbox#1\vbox
- {%\forgetall
- \offinterlineskip
- \vskip\topoffset
- \doifbothsides{\hskip\backoffset}{\hskip\backoffset}{\hskip-\backoffset}%
- \box#1}%
- \next
- \fi}
-
-\def\replicatepagebox#1%
- {\ifnum\@@lynx>\plusone
- \donetrue
- \else\ifnum\@@lyny>\plusone
- \donetrue
- \else
- \donefalse
- \fi\fi
- \ifdone
- \setbox#1\vbox
- {%\forgetall
- \offinterlineskip
- \dorecurse\@@lyny
- {\hbox{\dorecurse\@@lynx{\copy#1\hskip\@@lydx}\unskip}%
- \vskip\@@lydy}
- \unskip}%
- \fi}
-
-\def\orientpagebodybox#1#2#3%
- {\ifnum#2#3>\zerocount
- \setbox#1\vbox
- {\edef\somerotation{\ifdoublesided\ifodd\realpageno#2\else#3\fi\else#2\fi}%
- \dorotatebox\somerotation\hbox{\box#1}}%
- \fi}
-
-\def\orientpaperbox#1%
- {\orientpagebodybox{#1}\paperorientation\paperreverse}
-
-\def\orientprintbox#1%
- {\orientpagebodybox{#1}\printorientation\printreverse}
-
-\def\mirrorpagebodybox#1#2%
- {\ifcase#2\or
- \setbox#1\vbox
- {\domirrorbox\vbox{\box#1}}%
- \fi}
-
-\def\mirrorpaperbox#1%
- {\mirrorpagebodybox{#1}\papermirror}
-
-\def\mirrorprintbox#1%
- {\mirrorpagebodybox{#1}\printmirror}
-
-\def\scalepagebox#1%
- {\ifdim\@@lyscale\points=\onepoint \else
- \setbox#1\vbox
- {\scale[\c!sx=\@@lyscale,\c!sy=\@@lyscale]{\box#1}}%
- \paperwidth\@@lyscale\paperwidth
- \paperheight \@@lyscale\paperheight
- \fi}
-
-\def\negateprintbox#1%
- {\ifnegateprintbox
- \negatecolorbox{#1}%
- \fi}
-
-\def\pagecutmarksymbol {\the\realpageno}
-\def\pagecutmarklength {.5cm}
-\let\pagecutmarktoptext \empty
-\let\pagecutmarkbottomtext \empty
-
-\def\extrapagecutmarkbottomtext
- {\rlap{\jobname}\hfill\currentdate\space-\space\currenttime\hfill\llap{\realfolio}}
-
-\def\makepagecutbox % #1
- {\let\cutmarksymbol \pagecutmarksymbol
- \let\cutmarklength \pagecutmarklength
- \let\cutmarktoptext \pagecutmarktoptext
- \let\cutmarkbottomtext\pagecutmarkbottomtext
- \makecutbox}
-
-\setvalue{\??ly:n:\c!marking:\v!on}%
- {\makepagecutbox}
-
-\setvalue{\??ly:n:\c!marking:\v!page}% only at outer when nx/ny > 0
- {\makepagecutbox}
-
-\setvalue{\??ly:n:\c!marking:\v!empty}%
- {\let\pagecutmarksymbol\empty
- \let\pagecutmarktoptext\empty
- \let\pagecutmarkbottomtext\empty
- \makepagecutbox}
-
-\setvalue{\??ly:n:\c!marking:\v!text}%
- {\let\pagecutmarksymbol\empty
- \let\pagecutmarkbottomtext\extrapagecutmarkbottomtext
- \makepagecutbox}
-
-\setvalue{\??ly:c:\c!marking:\v!color}%
- {\doaddpagecolormarks\colormarkbox}
-
-\setvalue{\??ly:c:\c!marking:\v!screen}%
- {\doaddpagecolormarks\rastermarkbox}
-
-\def\addpagecutmarks % #1
- {\executeifdefined{\??ly:n:\c!marking:\@@lymarking}\gobbleoneargument}
-
-\def\addpagecolormarks % #1
- {\executeifdefined{\??ly:c:\c!marking:\@@lymarking}\gobbleoneargument}
-
-\def\doaddpagecolormarks#1#2%
- {\makepagecutbox{#2}%
- \ifnum\horizontalcutmarks>2 \chardef\colormarkoffset4 \fi
- \ifnum\verticalcutmarks >2 \chardef\colormarkoffset4 \fi
- #1{#2}}
-
-% 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
- \doifelselayoutsomeline \v!header
- {\redoglobal\advance\textheight-\dimexpr\headerheight+\headerdistance\relax}%
- \donothing
- \doifelselayoutsomeline \v!footer
- {\redoglobal\advance\textheight-\dimexpr\footerheight+\footerdistance\relax}%
- \donothing
- \ifzeropt\headerheight
- \resetsystemmode\v!header
- \else
- \setsystemmode\v!header
- \fi
- \ifzeropt\footerheight
- \resetsystemmode\v!footer
- \else
- \setsystemmode\v!footer
- \fi
- \resetglobal
- \setvsize}
-
-\def\calculatereducedvsizes
- {\textheight\makeupheight
- \doifelselayoutsomeline \v!header
- {\advance\textheight-\dimexpr\headerheight+\headerdistance\relax}%
- {\headerheight\zeropoint
- \setlayoutdistances}%
- \doifelselayoutsomeline \v!footer
- {\advance\textheight-\dimexpr\footerheight+\footerdistance\relax}%
- {\footerheight\zeropoint
- \setlayoutdistances}}
-
-\newdimen\innermakeupwidth % special purpose
-\newdimen\innermakeupmargin % special purpose
-
-\chardef\innermakeupcompensation\plusone
-
-\def\compensatedinnermakeupmargin
- {\dimexpr\ifnum\innermakeupcompensation=\plusone+\innermakeupmargin\else\zeropoint\fi\relax}
-
-\def\freezetextwidth % \makeupwidth may be set to \textwidth
- {\textwidth\makeupwidth % which is a tricky but valid value
- \doifsomething{\layoutparameter\c!textwidth}
- {\textwidth\layoutparameter\c!textwidth}% % local
- \global\innermakeupwidth\textwidth
- \doifelsenothing{\layoutparameter\c!textmargin}
- {\global\innermakeupmargin\zeropoint}
- {\global\innermakeupmargin\layoutparameter\c!textmargin}%
- \global\advance\innermakeupwidth-\dimexpr\innermakeupmargin+\innermakeupmargin\relax
- \advance\textwidth-\dimexpr\innermakeupmargin+\innermakeupmargin\relax} % local
-
-\def\calculatehsizes
- {\freezetextwidth
- \sethsize}
-
-% De onderstaande macro voert commando's uit, afhankelijk van
-% het karakter van het paginanummer.
-%
-% \doifoddpageelse{then-commando}{else-commando}
-
-%D When we start at an even page, we need to swap the layout
-%D differently. We cannot adapt the real page number, since
-%D it is used in cross referencing. The next switch is set
-%D when we start at an even page.
-
-\newif\ifshiftedrealpageno
-
-% \def\doifoddpageelse#1#2%
-% {\ifshiftedrealpageno
-% \ifodd\realpageno#2\else#1\fi
-% \else
-% \ifodd\realpageno#1\else#2\fi
-% \fi}
-
-\def\doifoddpageelse
- {\ifshiftedrealpageno
- \ifodd\realpageno
- \@EAEAEA\secondoftwoarguments
- \else
- \@EAEAEA\firstoftwoarguments
- \fi
- \else
- \ifodd\realpageno
- \@EAEAEA\firstoftwoarguments
- \else
- \@EAEAEA\secondoftwoarguments
- \fi
- \fi}
-
-\let\doifonevenpaginaelse\doifoddpageelse
-
-% what are those \relax'es doing there?
-
-% \def\doifbothsidesoverruled#1#2#3%
-% {\ifdoublesided
-% \doifoddpageelse{#2}{#3}\relax
-% \else
-% #1\relax
-% \fi}
-
-% \def\doifbothsides#1#2#3%
-% {\ifdoublesided
-% \ifsinglesided
-% #1\relax
-% \else
-% \doifoddpageelse{#2}{#3}\relax
-% \fi
-% \else
-% #1\relax
-% \fi}
-
-\def\redoifoddpageelse#1{\doifoddpageelse}
-
-\def\doifbothsidesoverruled
- {\ifdoublesided
- \@EA\redoifoddpageelse
- \else
- \@EA\firstofthreearguments
- \fi}
-
-\def\doifbothsides
- {\ifdoublesided
- \ifsinglesided
- \@EAEAEA\firstofthreearguments
- \else
- \@EAEAEA\redoifoddpageelse
- \fi
- \else
- \@EA\firstofthreearguments
- \fi}
-
-\newdimen\texthoffset
-
-\def\settexthoffset
- {\doifbothsides
- {\texthoffset\backspace}
- {\texthoffset\backspace}
- {\texthoffset\dimexpr\paperwidth-\backspace-\makeupwidth\relax}}
-
-\def\goleftonpage
- {\hskip-\dimexpr\leftmargindistance+\leftmarginwidth+\leftedgedistance+\leftedgewidth\relax}
-
-\def\doifmarginswapelse#1#2%
- {\doifbothsides{#1}{#1}{#2}}
-
-\def\swapmargins
- {\doifmarginswapelse\relax\doswapmargins}
-
-\def\doswapmargins
- {\let\swapmargins \relax % to prevent local swapping
- \let\doswapmargins\relax % to prevent local swapping
- \the\everyswapmargins}
-
-\def\rightorleftpageaction
- {\ifdoublesided
- \ifsinglesided
- \@EAEAEA\firstoftwoarguments
- \else
- \@EAEAEA\doifoddpageelse
- \fi
- \else
- \@EA\firstoftwoarguments
- \fi}
-
-\def\outermarginwidth {\rightorleftpageaction\rightmarginwidth \leftmarginwidth }
-\def\innermarginwidth {\rightorleftpageaction\leftmarginwidth \rightmarginwidth}
-\def\outermargindistance{\rightorleftpageaction\rightmargindistance\leftmargindistance }
-\def\innermargindistance{\rightorleftpageaction\leftmargindistance \rightmargindistance}
-
-\def\outeredgewidth {\rightorleftpageaction\rightedgewidth \leftedgewidth }
-\def\inneredgewidth {\rightorleftpageaction\leftedgewidth \rightedgewidth}
-\def\outeredgedistance {\rightorleftpageaction\rightedgedistance\leftedgedistance }
-\def\inneredgedistance {\rightorleftpageaction\leftedgedistance \rightedgedistance}
-
-\def\outerspacewidth {\rightorleftpageaction\cutspace \backspace }
-\def\innerspacewidth {\rightorleftpageaction\backspace\cutspace}
-
-\def\leftmargintotal {\dimexpr\leftmarginwidth +\leftmargindistance \relax}
-\def\rightmargintotal {\dimexpr\rightmarginwidth+\rightmargindistance\relax}
-\def\leftedgetotal {\dimexpr\leftedgewidth +\leftedgedistance \relax}
-\def\rightedgetotal {\dimexpr\rightedgewidth +\rightedgedistance \relax}
-
-\def\leftsidetotal {\dimexpr\leftmarginwidth +\leftedgetotal \relax}
-\def\rightsidetotal {\dimexpr\rightmarginwidth+\rightedgetotal\relax}
-\def\leftcombitotal {\dimexpr\leftmargintotal +\leftedgetotal \relax}
-\def\rightcombitotal {\dimexpr\rightmargintotal+\rightedgetotal\relax}
-
-\def\innermargintotal {\dimexpr\innermarginwidth+\innermargindistance\relax}
-\def\outermargintotal {\dimexpr\outermarginwidth+\outermargindistance\relax}
-\def\inneredgetotal {\dimexpr\inneredgewidth +\inneredgedistance \relax}
-\def\outeredgetotal {\dimexpr\outeredgewidth +\outeredgedistance \relax}
-
-\def\innercombitotal {\dimexpr\innermargintotal+\inneredgetotal\relax}
-\def\outercombitotal {\dimexpr\outermargintotal+\outeredgetotal\relax}
-\def\innersidetotal {\dimexpr\innermarginwidth+\inneredgetotal\relax}
-\def\outersidetotal {\dimexpr\outermarginwidth+\outeredgetotal\relax}
-
-%D \macros
-%D {startlocallayout}
-%D
-%D These macros should be used with care. They permit local
-%D layouts (as used in fitting pages, see \type {page-app.tex}).
-
-%D This is kind of obsolete now that we have \type
-%D {\definelayout}, so this hack will disappear in future
-%D versions.
-
-\def\startlocallayout
- {\globalpushmacro\restorepapersize
- \globalpushmacro\currentlayout}
-
-\def\stoplocallayout
- {\globalpopmacro\currentlayout
- \globalpopmacro\restorepapersize
- \restorepapersize
- \setuplayout}
-
-%D \macros
-%D {showprint, showframe, showlayout, showsetups}
-%D
-%D We predefine a couple of tracing macros.
-%D
-%D \showsetup{showprint}
-%D \showsetup{showframe}
-%D \showsetup{showlayout}
-%D \showsetup{showsetups}
-%D %showsetup{showmargins}
-
-\fetchruntimecommand \showprint {page-run}
-\fetchruntimecommand \showframe {page-run}
-\fetchruntimecommand \showlayout {page-run}
-\fetchruntimecommand \showsetups {page-run}
-\fetchruntimecommand \showmargins {page-run}
-
-%D The default dimensions are quite old and will not change.
-%D The funny fractions were introduced when we went from fixed
-%D dimensions to relative ones. Since \CONTEXT\ is a dutch
-%D package, the dimensions are based on the metric system. The
-%D asymmetrical layout is kind of handy for short
-%D quick||and||dirty stapled documents.
-%D
-%D Although valid, it is not a real good idea to use
-%D dimensions based on the \type {em} unit. First of all,
-%D since there are no fonts loaded yet, this dimension makes
-%D no sense, and second, you would loose track of values,
-%D since they could change while going to a new page,
-%D depending on the current font setting.
-
-\setuplayout
- [ \c!topspace=.08417508418\paperheight, % 2.5cm
- \c!top=\!!zeropoint,
- \c!topdistance=\!!zeropoint,
- \c!header=.06734006734\paperheight, % 2.0cm
- \c!headerdistance=\!!zeropoint,
- \c!height=.84175084175\paperheight, % 25.0cm
- \c!footerdistance=\layoutparameter\c!headerdistance,
- \c!footer=.06734006734\paperheight, % 2.0cm
- \c!bottomdistance=\layoutparameter\c!topdistance,
- \c!bottom=\!!zeropoint,
- \c!backspace=.11904761905\paperwidth, % 2.5cm
- \c!edge=\!!zeropoint,
- \c!edgedistance=\layoutparameter\c!margindistance,
- \c!margin=.12649983170\paperwidth, % snijwit-2*afstand
- \c!margindistance=.02008341748\paperwidth, % 12.0pt
- \c!leftedge=\layoutparameter\c!edge,
- \c!leftedgedistance=\layoutparameter\c!edgedistance,
- \c!leftmargin=\layoutparameter\c!margin,
- \c!leftmargindistance=\layoutparameter\c!margindistance,
- \c!width=.71428571429\paperwidth, % 15.0cm
- \c!rightmargindistance=\layoutparameter\c!margindistance,
- \c!rightmargin=\layoutparameter\c!margin,
- \c!rightedgedistance=\layoutparameter\c!edgedistance,
- \c!rightedge=\layoutparameter\c!edge,
- \c!veroffset=\!!zeropoint,
- \c!bottomspace=\!!zeropoint,
- \c!horoffset=\!!zeropoint,
- \c!cutspace=\!!zeropoint,
- \c!textwidth=, % dangerous option -> centered / local
- \c!textmargin=, % dangerous option -> both sides
- \c!textdistance=\!!zeropoint, % shift down on grid
- \c!style=,
- \c!color=,
- \c!marking=\v!off,
- \c!location=, % \v!singlesided, but empty is signal
- \c!scale=1,
- \c!nx=1,
- \c!ny=1,
- \c!dx=\!!zeropoint,
- \c!dy=\!!zeropoint,
- \c!grid=\v!no,
- \c!preset=,
- \c!setups=\systemsetupsprefix\s!default,
- \c!clipoffset=\!!zeropoint,
- \c!lines=0,
- \c!paper=, % for foxet
- \c!page=, % for foxet
- \c!columns=1,
- \c!columndistance=\!!zeropoint]
-
-%D First we define a whole range of (DIN) papersizes,
-%D of which the A-series makes most sense. We enable checking.
-
-%D We also set some of the parameters that will be used when
-%D positioning the typeset paper onto the print paper.
-
-\setuppaper % (size) % only used in XY imposition
- [\c!width=\zeropoint,
- \c!height=\zeropoint,
- \c!topspace=\zeropoint,
- \c!backspace=\zeropoint,
- \c!dx=\zeropoint,
- \c!dy=\zeropoint,
- \c!nx=1,
- \c!ny=1,
- \c!method=\v!normal]
-
-\setuppapersize
- [\c!option=\v!max,
- \c!top=,
- \c!bottom=\vss,
- \c!left=,
- \c!right=\hss]
-
-\definepapersize [A0] [\c!width=841mm,\c!height=1189mm]
-\definepapersize [A1] [\c!width=594mm,\c!height=841mm]
-\definepapersize [A2] [\c!width=420mm,\c!height=594mm]
-\definepapersize [A3] [\c!width=297mm,\c!height=420mm]
-\definepapersize [A4] [\c!width=210mm,\c!height=297mm]
-\definepapersize [A5] [\c!width=148mm,\c!height=210mm]
-\definepapersize [A6] [\c!width=105mm,\c!height=148mm]
-\definepapersize [A7] [\c!width=74mm,\c!height=105mm]
-\definepapersize [A8] [\c!width=52mm,\c!height=74mm]
-\definepapersize [A9] [\c!width=37mm,\c!height=52mm]
-\definepapersize [A10] [\c!width=26mm,\c!height=37mm]
-
-\definepapersize [B0] [\c!width=1000mm,\c!height=1414mm]
-\definepapersize [B1] [\c!width=707mm,\c!height=1000mm]
-\definepapersize [B2] [\c!width=500mm,\c!height=707mm]
-\definepapersize [B3] [\c!width=353mm,\c!height=500mm] % [\c!width=354mm,\c!height=500mm]
-\definepapersize [B4] [\c!width=250mm,\c!height=353mm] % [\c!width=250mm,\c!height=354mm]
-\definepapersize [B5] [\c!width=176mm,\c!height=250mm] % [\c!width=177mm,\c!height=250mm]
-\definepapersize [B6] [\c!width=125mm,\c!height=176mm] % [\c!width=125mm,\c!height=177mm]
-\definepapersize [B7] [\c!width=88mm,\c!height=125mm]
-\definepapersize [B8] [\c!width=62mm,\c!height=88mm] % [\c!width=63mm,\c!height=88mm]
-\definepapersize [B9] [\c!width=44mm,\c!height=62mm] % [\c!width=44mm,\c!height=63mm]
-\definepapersize [B10] [\c!width=31mm,\c!height=44mm]
-
-\definepapersize [C0] [\c!width=917mm,\c!height=1297mm]
-\definepapersize [C1] [\c!width=648mm,\c!height=917mm] % [\c!width=649mm,\c!height=917mm]
-\definepapersize [C2] [\c!width=458mm,\c!height=648mm] % [\c!width=459mm,\c!height=649mm]
-\definepapersize [C3] [\c!width=324mm,\c!height=458mm] % [\c!width=324mm,\c!height=459mm]
-\definepapersize [C4] [\c!width=229mm,\c!height=324mm]
-\definepapersize [C5] [\c!width=162mm,\c!height=229mm]
-\definepapersize [C6] [\c!width=114mm,\c!height=162mm] % [\c!width=115mm,\c!height=162mm]
-\definepapersize [C7] [\c!width=81mm,\c!height=114mm] % [\c!width=81mm,\c!height=115mm]
-\definepapersize [C8] [\c!width=57mm,\c!height=81mm]
-\definepapersize [C9] [\c!width=40mm,\c!height=57mm]
-\definepapersize [C10] [\c!width=28mm,\c!height=40mm]
-
-%D Per August 2004 the rounding of some (seldom used) sizes
-%D were corrected top the latest DIN specifications. Peter
-%D Rolf came up with these and a few more missing sizes.
-%D Watch out: spaces and slashes!
-
-\definepapersize [4 A0] [\c!width=1682mm,\c!height=2378mm]
-\definepapersize [2 A0] [\c!width=1189mm,\c!height=1682mm]
-\definepapersize [C6/C5] [\c!width=114mm,\c!height=229mm]
-
-%D Because there are no standardized screen sizes, we define
-%D a bunch of sizes with $4:3$ ratios. The \type {S6} size is
-%D nearly as wide as a sheet of \type {A4} paper.
-
-\definepapersize [S3] [\c!width=300pt,\c!height=225pt]
-\definepapersize [S4] [\c!width=400pt,\c!height=300pt]
-\definepapersize [S5] [\c!width=500pt,\c!height=375pt]
-\definepapersize [S6] [\c!width=600pt,\c!height=450pt]
-\definepapersize [S8] [\c!width=800pt,\c!height=600pt]
-\definepapersize [SW] [\c!width=800pt,\c!height=450pt]
-\definepapersize [SM] [\c!width=720pt,\c!height=450pt]
-
-%D These are handy too:
-
-\definepapersize [S33] [\c!width=300pt,\c!height=300pt]
-\definepapersize [S44] [\c!width=400pt,\c!height=400pt]
-\definepapersize [S55] [\c!width=500pt,\c!height=500pt]
-\definepapersize [S66] [\c!width=600pt,\c!height=600pt]
-
-%D One may wonder if \TEX\ should be used for typesetting
-%D \CDROM\ covers, but it does not hurt to have the paper size
-%D ready.
-
-\definepapersize [CD] [\c!width=120mm,\c!height=120mm]
-
-%D The next series is for our English speaking friends who
-%D decided to stick to non metric values. Thanks to Nelson
-%D Beebe for completing the inch based list.
-
-\definepapersize [letter] [\c!width=8.5in,\c!height=11in]
-\definepapersize [ledger] [\c!width=11in,\c!height=17in]
-\definepapersize [tabloid] [\c!width=17in,\c!height=11in]
-
-\definepapersize [legal] [\c!width=8.5in,\c!height=14in]
-\definepapersize [folio] [\c!width=8.5in,\c!height=13in]
-\definepapersize [executive] [\c!width=7.25in,\c!height=10.5in]
-
-\definepapersize [A] [\c!width=8.5in,\c!height=11in] % 1 sheet
-\definepapersize [B] [\c!width=11in,\c!height=17in] % 2 sheets
-\definepapersize [C] [\c!width=17in,\c!height=22in] % 4 sheets
-
-%D The next set is for Tobias Burnus, who gave me the sizes.
-
-\definepapersize [envelope 9] [\c!width=8.88in,\c!height=3.88in]
-\definepapersize [envelope 10] [\c!width=9.5in,\c!height=4.13in]
-\definepapersize [envelope 11] [\c!width=10.38in,\c!height=4.5in]
-\definepapersize [envelope 12] [\c!width=11.0in,\c!height=4.75in]
-\definepapersize [envelope 14] [\c!width=11.5in,\c!height=5.0in]
-\definepapersize [monarch] [\c!width=7.5in,\c!height=3.88in]
-\definepapersize [check] [\c!width=8.58in,\c!height=3.88in]
-\definepapersize [DL] [\c!width=110mm,\c!height=220mm] % [\c!width=220mm,\c!height=110mm]
-\definepapersize [E4] [\c!width=280mm,\c!height=400mm]
-
-%D The next three sets are supplied by Taco:
-
-\definepapersize [RA0] [\c!width=860mm,\c!height=1220mm]
-\definepapersize [RA1] [\c!width=610mm,\c!height=860mm]
-\definepapersize [RA2] [\c!width=430mm,\c!height=610mm]
-\definepapersize [RA3] [\c!width=305mm,\c!height=430mm]
-\definepapersize [RA4] [\c!width=215mm,\c!height=305mm]
-
-%D ISO SRA (supplementary raw A) sizes:
-
-\definepapersize [SRA0] [\c!width=900mm,\c!height=1280mm]
-\definepapersize [SRA1] [\c!width=640mm,\c!height=900mm]
-\definepapersize [SRA2] [\c!width=450mm,\c!height=640mm]
-\definepapersize [SRA3] [\c!width=320mm,\c!height=450mm]
-\definepapersize [SRA4] [\c!width=225mm,\c!height=320mm]
-
-%D Swedish thesis formats:
-
-\definepapersize [G5] [\c!width=169mm,\c!height=239mm]
-\definepapersize [E5] [\c!width=155mm,\c!height=220mm]
-
-%D Industry invention:
-
-\definepapersize [A3plus] [\c!width=329mm,\c!height=483mm]
-
-%D We can now default to a reasonable size. We match the print
-%D paper size with the typeset paper size. This setting should
-%D come after the first layout specification (already done).
-
-% not interfaced !
-
-\definepapersize
- [oversized]
- [ \c!width=\dimexpr\paperwidth +1.5cm\relax,
- \c!height=\dimexpr\paperheight+1.5cm\relax]
-
-\definepapersize
- [doublesized]
- [ \c!width=\dimexpr \paperwidth \relax,
- \c!height=\dimexpr2\paperheight\relax]
-
-\definepapersize
- [doubleoversized]
- [ \c!width=\dimexpr \paperheight+1.5cm\relax,
- \c!height=\dimexpr2\paperwidth +1.5cm\relax]
-
-\definepapersize
- [\v!default]
- [ \c!width=\paperwidth,
- \c!height=\paperheight]
-
-\definepapersize
- [samesized]
- [ \c!width=\paperwidth,
- \c!height=\paperheight]
-
-\setuppapersize
- [A4][samesized]
-
-%D For orthogonality:
-
-\definepapersize
- [undersized]
- [ \c!width=\dimexpr\paperwidth -1.5cm\relax,
- \c!height=\dimexpr\paperheight-1.5cm\relax]
-
-\definelayout
- [\v!page]
- [\c!backspace=\zeropoint,
- \c!cutspace=\zeropoint,
- \c!topspace=\zeropoint,
- \c!bottomspace=\zeropoint,
- \c!margin=\zeropoint,
- \c!edge=\zeropoint,
- \c!header=\zeropoint,
- \c!footer=\zeropoint,
- \c!top=\zeropoint,
- \c!bottom=\zeropoint,
- \c!leftmargin=\zeropoint,
- \c!rightmargin=\zeropoint,
- \c!leftedge=\zeropoint,
- \c!rightedge=\zeropoint,
- \c!textdistance=\zeropoint,
- \c!width=\v!middle,
- \c!height=\v!middle,
- \c!lines=0,
- \c!grid=\v!no]
-
-\definelayout
- [\v!middle]
- [\c!width=\v!middle,
- \c!height=\v!middle]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/page-lin.mkii b/Master/texmf-dist/tex/context/base/mkii/page-lin.mkii
deleted file mode 100644
index c6b352ae73c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/page-lin.mkii
+++ /dev/null
@@ -1,312 +0,0 @@
-%D \module
-%D [ file=page-lin, % copied from main-001
-%D version=1997.03.31,
-%D title=\CONTEXT\ Core Macros,
-%D subtitle=Line Numbering,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Core Macros / Line Numbering}
-
-\unprotect
-
-\newif\ifnumberinglines
-\newif\iftypesettinglines
-
-\newcount\linenumber
-\newcount\linestepper
-
-\chardef\linenumberlocation=0
-
-\newtoks\beforeeverylinenumbering
-\newtoks\aftereverylinenumbering
-
-% het gebruik van \setlocalreference scheelt een hash entry
-
-\def\dodoshowlinenumber % for use elsewhere, to be extended
- {\doplacelinenumber
- \global\advance\linenumber \plusone}
-
-\def\completelinenumber
- {\@@rnleft\convertnumber\@@rnconversion\linenumber\@@rnright}
-
-\def\dosetuplinenumbering[#1]%
- {\getparameters[\??rn][\c!start=1,\c!step=1,#1]%
- \global\linenumber\plusone}
-
-\def\setuplinenumbering
- {\dosingleargument\dosetuplinenumbering}
-
-\def\dostartnummerenLINE
- {\EveryPar{\placelinenumber}} % why not append to everypar ? better
-
-\def\dostopnummerenLINE
- {\the\aftereverylinenumbering
- \egroup}
-
-\def\dostartnummerenVERB
- {\EveryLine{\placelinenumber}}
-
-\def\dostopnummerenVERB
- {\the\aftereverylinenumbering
- \egroup}
-
-\newevery \everylinenumber \relax
-
-\def\dodoplacelinenumber
- {% beware of em's, the font is already switched !
- \setbox\scratchbox\hbox
- {\setbox0\hbox{\@@rncommand{\completelinenumber}}\vsmashbox0%
- \ifcase\linenumberlocation
- \iftypesettinglines % hack
- \expandafter\llap
- \else
- \expandafter\rlap
- \fi{\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\complexstartlinenumbering[#1]%
- {\doifnot{#1}\v!continue
- {\doifnumberelse{#1}
- {\global\linenumber#1\relax}
- {\doifelsenothing\@@rnstart
- {\global\linenumber\plusone}
- {\global\linenumber\@@rnstart}}}%
- \chardef\linenumberlocation\zerocount
- \processaction
- [\@@rnlocation]
- [ \v!inmargin=>\chardef\linenumberlocation\plusone,
- \v!inleft=>\chardef\linenumberlocation\plusone,
- \v!inright=>\chardef\linenumberlocation\plustwo,
- \v!margin=>\chardef\linenumberlocation\plusone]%
- % \v!text=>\chardef\linenumberlocation\zerocount,
- %\s!unknown=>\chardef\linenumberlocation\zerocount,
- %\s!default=>\chardef\linenumberlocation\zerocount]%
- \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
- [\@@rnmethod]
- [ \v!type=>\chardef\@@rn@@rnmethod\zerocount,
- \v!line=>\chardef\@@rn@@rnmethod\plusone,
- \v!text=>\chardef\@@rn@@rnmethod\plustwo,
- \v!file=>\chardef\@@rn@@rnmethod\plusthree]%
- \ifcase\@@rn@@rnmethod % verbatim, line by line
- \typesettinglinestrue
- \let\dostartnummeren\dostartnummerenVERB
- \let\stoplinenumbering\dostopnummerenVERB
- \def\placelinenumber
- {\doplacelinenumber
- \global\advance\linenumber \plusone}%
- \or % text, line by line
- \let\dostartnummeren\dostartnummerenLINE
- \let\stoplinenumbering\dostopnummerenLINE
- \def\placelinenumber
- {\doplacelinenumber
- \global\advance\linenumber \plusone}%
- \or % text, whole lot
- \let\dostartnummeren\dostartnummerenPAR
- \let\stoplinenumbering\dostopnummerenPAR
- \def\placelinenumber
- {\global\advance\linenumber \minusone
- \doplacelinenumber}%
- \or % verbatim, selective line by line
- \typesettinglinestrue
- \let\dostartnummeren\dostartnummerenVERB
- \let\stoplinenumbering\dostopnummerenVERB
- \def\placelinenumber
- {\global\linenumber\verbatimlinenumber
- \global\advance\linenumber \minusone
- \doplacelinenumber}%
- \fi
- \dostartnummeren}
-
-\def\startlinenumbering
- {\bgroup
- \the\beforeeverylinenumbering
- \numberinglinestrue
- \complexorsimpleempty\startlinenumbering}
-
-\def\donoplacelinenumber
- {\the\everylinenumber}
-
-\def\doplacelinenumber
- {\ifnum\linenumber<\@@rnstart\relax
- \donoplacelinenumber
- \else
- \ifnum\numexpr(\linenumber/\@@rnstep)*\@@rnstep\relax=\linenumber
- \doattributes\??rn\c!style\c!color\dodoplacelinenumber
- \else
- \donoplacelinenumber
- \fi
- \fi}
-
-\def\someline[#1]%
- {\dolinereference0[#1]\ignorespaces}
-
-\def\startline[#1]%
- {\dolinereference1[#1]\ignorespaces}
-
-\def\stopline[#1]%
- {\removelastspace\dolinereference2[#1]}
-
-\def\inline#1[#2]%
- {\doifelsenothing{#1}
- {\doifinstringelse{--}\currenttextreference
- {\in{\leftlabeltext\v!lines}{\rightlabeltext\v!lines}[\@@rnprefix#2]}
- {\in{\leftlabeltext\v!line }{\rightlabeltext\v!line }[\@@rnprefix#2]}}
- {\in{#1}[\@@rnprefix#2]}}
-
-\def\dostartnummerenPAR
- {\beginofshapebox
- \doglobal\newcounter\linereference}
-
-% localcrossref heroverwegen
-
-\def\setlinereference#1#2#3#4%
- {\setxvalue{lrf:#1}{\noexpand\dogetlinereference{#2}{#3}{#4}}}
-
-\def\getlinereference#1%
- {\getvalue{lrf:#1}}
-
-\def\dogetlinereference#1#2#3%
- {\edef\linereferencename{#1}%
- \edef\linereferenceline{#2}%
- \edef\linereferenceplus{#3}}
-
-% 1 xxx xxx xxx xxx xxx xxx xxx
-% 2 xxx yyy yyy yyy yyy yyy yyy <= start y
-% 3 yyy yyy yyy yyy yyy yyy yyy
-% 4 yyy yyy yyy yyy yyy xxx xxx <= stop y
-% 5 xxx xxx xxx xxx xxx xxx xxx
-
-\def\dolinereference#1[#2]%
- {\bgroup
- \dimen0=\strutdp
- \doif\@@rnreferencing\v!on
- {\doglobal\increment\linereference
- % start 1=>(n=y,l=0,p=1)
- % stop 2=>(n=y,l=0,p=2)
- \setlinereference{\linereference}{\@@rnprefix#2}{0}{#1}%
- \advance\dimen0 \linereference sp}%
- \prewordbreak
- \vrule \!!width \zeropoint \!!depth \dimen0 \!!height \zeropoint
- \prewordbreak
- \egroup}
-
-\def\dostopnummerenPAR % dp's -> openstrutdepth
- {\endofshapebox
- \checkreferences
- \linestepper\zerocount
- \reshapebox{\global\advance\linestepper \plusone}%
- \global\advance\linenumber \linestepper
- \doifelse\@@rnreferencing\v!on
- {\reshapebox % We are going back!
- {\global\advance\linenumber \minusone
- \dimen0=\dp\shapebox
- \advance\dimen0 -\strutdp\relax
- \ifdim\dimen0>\zeropoint
- % 1=>4 | 2=>4 1=>2
- % start 1=>(n=y,l=2,p=1)
- % stop 2=>(n=y,l=4,p=2)
- \dostepwiserecurse\plusone{\number\dimen0}\plusone
- {\getlinereference\recurselevel
- \setlinereference\recurselevel
- {\linereferencename}{\the\linenumber}{\linereferenceplus}}%
- \fi}%
- \global\advance\linenumber \linestepper
- \ifnum\linereference>\zerocount % anders vreemde loop in paragraphs+recurse
- \dorecurse\linereference
- {\getlinereference\recurselevel
- \ifnum\linereferenceplus=2 % stop
- % ref y: text = 4 / Kan dit buiten referentie mechanisme om?
- \expanded{\setlocalcrossreference
- {\referenceprefix\linereferencename}{}{}{\linereferenceline}}%
- \fi}%
- \dorecurse\linereference
- {\getlinereference\recurselevel
- \ifnum\linereferenceplus<2 % start / lone
- \ifnum\linereferenceplus=1 % start
- \getreferenceelements\linereferencename % text = 4
- \ifnum\linereferenceline<0\currenttextreference\relax % 0 prevents error
- \edef\linereferenceline{\linereferenceline--\currenttextreference}%
- \fi
- \fi
- \expanded{\setlocalcrossreference
- {\referenceprefix\linereferencename}{}{}{\linereferenceline}}%
- \fi}%
- \global\let\scratchline\linenumber % We are going back!
- \reshapebox
- {\doglobal\decrement\scratchline
- \hbox
- {\dorecurse\linereference
- {\getlinereference\recurselevel
- \getreferenceelements\linereferencename
- \beforesplitstring\currenttextreference--\at--\to\firstline
- \ifnum\firstline=\scratchline\relax
- % beter een rawtextreference, i.e. expanded
- % \textreference[\linereferencename]{\currenttextreference}%
- \rawtextreference\s!lin\linereferencename\currenttextreference
- \expanded{\setlocalcrossreference
- {\referenceprefix\linereferencename}{}{}{0}}% ==done
- \fi}%
- \dimen0\dp\shapebox
- \advance\dimen0 -\strutdp\relax
- \ifdim\dimen0>\zeropoint
- \dp\shapebox\strutdp
- \fi
- \placelinenumber\box\shapebox}}% no \strut !
- \else
- \reshapebox{\hbox{\placelinenumber\box\shapebox}}% no \strut !
- \fi}
- {\reshapebox{\global\advance\linenumber \minusone}%
- \global\advance\linenumber \linestepper
- \reshapebox{\hbox{\placelinenumber\box\shapebox}}}% no \strut !
- \global\advance\linenumber \linestepper
- \flushshapebox
- \the\aftereverylinenumbering
- \egroup}
-
-\setuplinenumbering
- [\c!method=,
- \c!conversion=\v!numbers,
- \c!start=1,
- \c!step=1,
- \c!location=\v!margin,
- \c!style=,
- \c!color=,
- \c!prefix=,
- \c!referencing=\v!on,
- \c!width=\ifcase\linenumberlocation2em\else\v!margin\fi,
- \c!left=,
- \c!right=,
- \c!command=,
- \c!distance=\zeropoint,
- \c!align=\ifcase\linenumberlocation\v!right\or\v!right\or\v!left\fi]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/page-log.mkii b/Master/texmf-dist/tex/context/base/mkii/page-log.mkii
deleted file mode 100644
index c64c27bce03..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/page-log.mkii
+++ /dev/null
@@ -1,202 +0,0 @@
-%D \module
-%D [ file=page-log, % moved here from main-001
-%D version=1997.03.31,
-%D title=\CONTEXT\ Page Macros,
-%D subtitle=Logos,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 / Logos}
-
-\unprotect
-
-%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
-%D interfere with the other ones, but an even more important
-%D reason is that logos are kind of special in the sense that
-%D they have a short life span and may change after the first
-%D page.
-
-%D \macros
-%D {recalculatelogos,addlogobackground}
-%D
-%D The interface to the other low level page building routines
-%D is provided by a macro that signals changes in layout
-%D specifications:
-%D
-%D \starttyping
-%D \recalculatelogos
-%D \stoptyping
-%D
-%D as well as a simple placement macro:
-%D
-%D \starttyping
-%D \addlogobackground <box>
-%D \stoptyping
-%D
-%D In no way the following boolean switch should be used
-%D directly.
-
-\newif\ifnewlogos
-
-\def\recalculatelogos
- {\global\newlogostrue}
-
-%D The current state of logos is registered in a status
-%D variable \type {\logostatus}.
-%D
-%D \starttabulate[|l|l|l|]
-%D \NC 0 \NC don't place \NC remains 0 \NC \NR
-%D \NC 1 \NC place now \NC remains 1 \NC \NR
-%D \NC 2 \NC calulate and place \NC becomes 1 \NC \NR
-%D \NC 3 \NC calculate and place once \NC becomes 2 \NC \NR
-%D \stoptabulate
-
-\chardef\logostatus=0
-
-\def\addlogobackground#1% todo: dimension spec
- {\ifcase\logostatus \else
- \ifcase\logostatus
- % no logos to take care of
- \or % 1
- \ifnewlogos
- \chardef\logostatus2
- \setlogoboxes
- \chardef\logostatus1
- \global\newlogosfalse
- \fi
- \or % 2
- \setlogoboxes
- \chardef\logostatus1
- \or % 3
- \setlogoboxes
- \global\chardef\logostatus2
- \fi
- \setbox#1\vbox
- {\offinterlineskip
- \doifmarginswapelse
- {\copy\leftlogos}
- {\copy\rightlogos}
- \box#1}%
- \fi}
-
-%D For efficiency reasons (and since logos seldom change inside
-%D a document) we can save the left and right hand (or first
-%D and following page) logos in boxes. The areas are slightly
-%D different from the ones used in backgrounds and text
-%D placement, but still related to the page layout. The {\em
-%D left} and {\em right edge}, as well as {\em top} and {\em
-%D bottom} touch the bounding box of the paper and are
-%D therefore not the sams as their background adn text
-%D counterparts. In addition there are {\em left}, {\em right}
-%D and {\em middle} areas as well as a {\em page} one.
-
-\newbox\leftlogos
-\newbox\rightlogos
-
-\def\setlogoboxes
- {\showmessage\m!layouts7\empty
- \dosetlogobox\leftlogos\relax
- \ifdoublesided
- \dosetlogobox\rightlogos\doswapmargins
- \fi}
-
-\def\dosetlogobox#1#2%
- {\global\setbox#1\vbox to \paperheight
- {\dontcomplain % needed here ?
- \calculatereducedvsizes % needed here ?
- \offinterlineskip
- #2\relax
- \vskip-\topspace
- \dodosetlogobox\v!top\blap
- \vskip\topspace
- \dodosetlogobox\v!header\blap
- \vskip\dimexpr\headerheight+\headerdistance\relax
- \dodosetlogobox\v!text\blap
- \vskip\dimexpr\textheight+\footerdistance+\footerheight\relax
- \dodosetlogobox\v!footer \tlap
- \vfilll
- \dodosetlogobox\v!bottom\tlap
- \vskip\topspace}
- \smashbox#1}
-
-\def\dodosetlogobox#1#2%
- {\hbox % width equals \makeupwidth
- {\def\docommand##1%
- {\donefalse
- \ifnum\logostatus=3 \ExpandBothAfter
- \doifinset{\getvalue{\??lo#1##1}}\requestedlogos\donetrue
- \else
- \doifvalue{\??lo#1##1\c!state}\v!start\donetrue
- \fi
- \ifdone
- #2{\hbox{\getvalue{\??lo#1##1\c!command}}}%
- \fi}%
- \def\dodocommand##1##2##3##4##5##6%
- {\hsmash
- {\hskip-\texthoffset
- \hbox to \paperwidth
- {\rlap{\docommand##1}\hss\llap{\docommand##6}}%
- \hskip-\paperwidth
- \hbox to \paperwidth
- {\hskip\texthoffset
- \hskip-\leftmarginwidth
- \hskip-\leftmargindistance
- \hbox to \leftmarginwidth{\docommand##2\hss}%
- \hskip\leftmargindistance
- \hbox to \makeupwidth{\docommand##3\hss\docommand##4}%
- \hskip\rightmargindistance
- \hbox to \rightmarginwidth{\hss\docommand##5}%
- \hfill}}}%
- \normalbaselines
- \settexthoffset
- \hsmash
- {\hbox to \makeupwidth{\hss\docommand\c!middle\hss}}%
- \hsmash
- {\hskip-\texthoffset
- \hbox to \paperwidth{\docommand\v!page\hss}}%
- \swapmargins
- \doifbothsidesoverruled
- {\dodocommand
- \v!leftedge \v!leftmargin \v!left
- \v!right \v!rightmargin \v!rightedge}
- {\dodocommand
- \v!leftedge \v!leftmargin \v!left
- \v!right \v!rightmargin \v!rightedge}
- {\dodocommand
- \v!rightedge \v!rightmargin \v!right
- \v!left \v!leftmargin \v!leftedge}}}
-
-%D The user interface is relatively simple and provides
-%D macros for assigning logos to logo areas as well as
-%D forcing placement.
-%D
-%D \showsetup{definelogo}
-%D \showsetup{placelogos}
-
-\let\definedlogos \empty
-\let\requestedlogos\empty
-
-\long\def\dodefinelogo[#1][#2][#3][#4]%
- {\addtocommalist{#1}\definedlogos
- \long\setvalue{\??lo#2#3}{#1}%
- \getparameters[\??lo#2#3][#4]%
- \global\chardef\logostatus2 }
-
-\def\definelogo
- {\doquadrupleargument\dodefinelogo}
-
-\def\placelogos
- {\dosingleempty\doplacelogos}
-
-\def\doplacelogos[#1]%
- {\xdef\requestedlogos{\iffirstargument#1\else\definedlogos\fi}%
- \global\chardef\logostatus3 }
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/page-mak.mkii b/Master/texmf-dist/tex/context/base/mkii/page-mak.mkii
deleted file mode 100644
index 3a513137fe8..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/page-mak.mkii
+++ /dev/null
@@ -1,230 +0,0 @@
-%D \module
-%D [ file=page-mak, % copied from main-001,
-%D version=1997.03.31,
-%D title=\CONTEXT\ Page Macros,
-%D subtitle=Simple MakeUp,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 / MakeUp}
-
-\unprotect
-
-%D \macros
-%D {definemakeup, setupmakeup, startmakeup}
-%D
-%D A makeup is a separate page, like a title page or colofon.
-%D There is one standard makeup page, but you can define more
-%D if needed.
-%D
-%D \starttyping
-%D \startstandardmakeup
-%D My Fancy Title
-%D \stopstandardmakeup
-%D \stoptyping
-%D
-%D The associated commands are:
-%D
-%D \showsetup{definemakeup}
-%D \showsetup{setupmakeup}
-%D \showsetup{startmakeup}
-
-\def\definemakeup
- {\dodoubleargument\dodefinemakeup}
-
-\def\dodefinemakeup[#1][#2]%
- {\getparameters
- [\??do#1]%
- [\c!width=\innermakeupwidth, % example in manual / was \makeupwidth
- \c!height=\textheight, % example in manual
- \c!commands=,
- \c!setups=,
- \c!page=\v!right,
- \c!doublesided=\v!empty,
- \c!before=,
- \c!top=\vss,
- \c!bottom=\vss,
- \c!after=,
- \c!bottomstate=\v!normal,
- \c!topstate=\v!normal,
- \c!textstate=\v!normal,
- \c!headerstate=\v!stop,
- \c!footerstate=\v!stop,
- \c!pagestate=\v!stop, % in manual ! ! !
- \c!color=,
- \c!align=,
- #2]%
- \setvalue{\e!start#1\e!makeup}{\startmakeup[#1]}%
- \setvalue{\e!stop #1\e!makeup}{\stopmakeup}}
-
-\def\setupmakeup
- {\dodoubleargument\dosetupmakeup}
-
-\def\dosetupmakeup[#1]%
- {\getparameters[\??do#1]}
-
-%D This will save us some 375 bytes in the format file.
-
-\def\makeupparameter#1{\getvalue{\??do\currentmakeup#1}}
-
-%D The \type{\start}||\type{\stop} macros are used for both
-%D the direct and indirect way. The parameterless call will
-%D build a simple box.
-
-\newtoks\everymakeup
-
-\appendtoks \postponemarks \to \everymakeup
-
-\let\currentmakeup\empty
-
-\def\startmakeup
- {\dodoubleempty\dostartmakeup}
-
-\def\dostartmakeup[#1][#2]%
- {\bgroup
- \edef\currentmakeup{#1}%
- \the\everymakeup
- \iffirstargument
- \setupmakeup[\currentmakeup][#2]%
- \let\stopmakeup\dodostopmakeup
- \expandafter \dodostartmakeup
- \else
- \let\stopmakeup\donostopmakeup
- \expandafter \donostartmakeup
- \fi}
-
-%D The simple case:
-
-\def\donostartmakeup % textwidth ?
- {\page
- \setupheader[\c!state=\v!empty]%
- \setupfooter[\c!state=\v!empty]%
- \setsystemmode\v!makeup
- \vbox to \textheight\bgroup\hsize\textwidth}
-
-\def\donostopmakeup
- {\egroup
- \flushmarks % new, here, else empty pages
- \page
- \egroup}
-
-%D The normal one:
-
-\newbox\makeupbox
-
-\def\dodostartmakeup
- {\doifvaluesomething{\??do\currentmakeup\c!page}
- {\ExpandFirstAfter\page[\makeupparameter\c!page]}%
- \pagetype[\currentmakeup]%
- \setsystemmode\v!makeup
- \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
- \setups[\makeupparameter\c!setups]%
- \hsize\makeupparameter\c!width
- \doifsomething{\makeupparameter\c!align}
- {\setupalign[\makeupparameter\c!align]}%
- \makeupparameter\c!top}
-
-\def\dodostopmakeup
- {\endgraf
- \makeupparameter\c!bottom
- \egroup
- \flushmarks % new, here, else empty pages
- \stopregistercolor
- \doflushmakeup
- \egroup
- \calculatehsizes
- \calculatevsizes}
-
-%D Selective page processing is handled here. (Why?)
-
-\def\doflushmakeup
- {\ifprocessingpages
- \ifpageselected
- \doshipoutmakeup
- \fi
- \else
- \ifpageselected \else
- \doshipoutmakeup
- \fi
- \fi
- \ifselectingpages
- \global\pageselectedfalse
- \fi}
-
-% \def\pushpagestate{\globalpushmacro\@@pnstate}
-% \def\poppagestate {\globalpopmacro \@@pnstate}
-
-\def\doshipoutmakeup
- {\pushpagestate % new
- \makeupparameter\c!before
- \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
- \ifdoublesided \ifodd\realpageno\else
- \processaction
- [\makeupparameter\c!doublesided]
- [ \v!yes=>\null
- \page,
- \v!empty=>{\setupmakeuplayout
- \page[\v!blank]%
- \null
- \page}]%
- \fi \fi
- \poppagestate} % new
-
-%D The text surrounding the main body text can be influenced
-%D by setting their associated status variables. The
-%D connection between them is made by the following macro
-
-\def\setupmakeuplayout
- {\setupfooter[\c!state=\makeupparameter\c!footerstate]%
- \setupheader[\c!state=\makeupparameter\c!headerstate]%
- \setuptext [\c!state=\makeupparameter\c!textstate]%
- \setupbottom[\c!state=\makeupparameter\c!bottomstate]%
- \setuptop [\c!state=\makeupparameter\c!topstate]%
- % this is needed, but no \setuplayout here; fails in texexec --fig=c
- \recalculatelayout}
-
-%D The standard page template is defined as follows:
-
-\definemakeup
- [\v!standard]
- [\c!width=\innermakeupwidth,
- \c!height=\textheight,
- \c!page=\v!right,
- \c!doublesided=\v!empty]
-
-\definemakeup
- [\v!text]
- [\c!topstate=\v!start,
- \c!headerstate=\v!start,
- \c!textstate=\v!start,
- \c!footerstate=\v!start,
- \c!bottomstate=\v!start,
- \c!doublesided=\v!no,
- \c!page=\v!yes,
- \c!top=\pseudostrut\ignorespaces,
- \c!bottom=\obeydepth\vss]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/page-mar.mkii b/Master/texmf-dist/tex/context/base/mkii/page-mar.mkii
deleted file mode 100644
index d386d8ab93b..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/page-mar.mkii
+++ /dev/null
@@ -1,867 +0,0 @@
-%D \module
-%D [ file=page-mar, % moved here from main-001
-%D version=1997.03.31,
-%D title=\CONTEXT\ Page Macros,
-%D subtitle=Marginal Things,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 margin words is one of the reasons for writing
-%D \CONTEXT. Over time support for marginal content has been
-%D extended en enhanced. Therefore it's always good to watch
-%D out for unexpected side effects.
-
-\writestatus{loading}{ConTeXt Page Macros / Maginal Things}
-
-\unprotect
-
-%D There are three categories and their historically grown meaning is
-%D as follows:
-%D
-%D marginlines: these are flushed relative to the start of a line and
-%D need to be invoked there.
-%D
-%D marginwords: these can be issued in the text flow and will migrate
-%D sidewards; in spite of the name, it can be a paragraph of text as
-%D well, but normally it's words.
-%D
-%D margintexts: these can be set beforehand and are flushed at the
-%D next paragraph of text (of header)
-%D
-%D While these mechanisms were rather separated, they now are slightly
-%D more integrated. Instead of low level instances we now have a mechanism
-%D for defining additional ones.
-
-%D \macros
-%D {inleftedge,inleftmargin,inrightmargin,inrightedge}
-%D
-%D The fast and clean way of putting things in the margin is
-%D using \type{\rlap} or \type{\llap}. Unfortunately these
-%D macro's don't handle indentation, left and right skips. We
-%D therefore embed them in some macro's that (force and)
-%D remove the indentation and restore it afterwards.
-
-\def\definemarginline
- {\dodoubleargument\dodefinemarginline}
-
-\def\dodefinemarginline[#1][#2]%
- {\getparameters
- [\??im\??im#1]
- [\c!location=\v!left,
- \c!distance=\zeropoint,
- \c!width=\leftmarginwidth,
- \c!hoffset=\leftmargindistance,
- \c!command=,
- #2]%
- \unexpanded\setvalue{#1}{\dohandlemarginline{#1}}}
-
-\def\marginlineparameter #1{\csname\??im\??im\currentmarginline#1\endcsname}
-\def\marginlineexecuter #1#2{\executeifdefined{\??im\??im\currentmarginline#1}{#2}}
-
-\def\dohandlemarginline#1% #2
- {\def\currentmarginline{#1}%
- \csname\s!do\??im\??im\executeifdefined{\??im\??im#1\c!location}\v!left\endcsname{#1}} % {#2}
-
-\def\doleftmarginline#1#2% #1 is redundant (we can remove it when we group dohandlemarginline; maybe ...
- {\pushindentation
- \llap
- {\def\currentmarginline{#1}%
- \postsignalrightpage
- \hsize\marginlineparameter\c!width\relax
- \marginlineexecuter\c!command\firstofoneargument{#2}\relax
- \hskip\dimexpr
- +\leftskip
- +\compensatedinnermakeupmargin
- +\marginlineparameter\c!hoffset
- +\marginlineparameter\c!distance
- \relax}%
- \popindentation
- \ignorespaces}
-
-\def\dorightmarginline#1#2% #1 is redundant
- {\pushindentation
- \rlap
- {\def\currentmarginline{#1}%
- \postsignalrightpage
- \hskip\dimexpr
- +\hsize
- -\rightskip
- +\compensatedinnermakeupmargin
- +\marginlineparameter\c!hoffset
- +\marginlineparameter\c!distance
- \relax
- \hsize\marginlineparameter\c!width
- \marginlineexecuter\c!command\firstofoneargument{#2}}%
- \popindentation
- \ignorespaces}
-
-\long\def\installmarginlinehandler#1#2{\setvalue{\s!do\??im\??im#1}{#2}}
-
-\installmarginlinehandler \v!left {\doleftmarginline}
-\installmarginlinehandler \v!right {\dorightmarginline}
-\installmarginlinehandler \v!inner {\presignalrightpage\doifrightpageelse\doleftmarginline \dorightmarginline}
-\installmarginlinehandler \v!outer {\presignalrightpage\doifrightpageelse\dorightmarginline\doleftmarginline }
-
-\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,\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]
-
-\definemarginline[atleftmargin] [\c!location=\v!left, \c!command=\lrlap,\c!width=\zeropoint,\c!distance=\zeropoint,\c!hoffset=\zeropoint]
-\definemarginline[atrightmargin][\c!location=\v!right,\c!command=\rllap,\c!width=\zeropoint,\c!distance=\zeropoint,\c!hoffset=\zeropoint]
-
-\ifx\lrlap\undefined \def\lrlap#1{\llap{\rlap{#1}}} \fi
-\ifx\rllap\undefined \def\rllap#1{\rlap{\llap{#1}}} \fi
-
-\def\lrlap#1{\llap{\rlap{#1}}}
-\def\rllap#1{\rlap{\hskip\hsize\llap{#1}}}
-
-%D We want to keep things efficient and therefore only handle
-%D situations like:
-%D
-%D \startbuffer
-%D \inleftedge {fine} some text \par
-%D \strut \inleftmargin {fine} some text \par
-%D \noindent \inrightmargin {fine} some text \par
-%D \noindent \strut \inrightedge {fine} some text \par
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D which looks like:
-%D
-%D \bgroup
-%D \getbuffer
-%D \parindent 30pt
-%D \getbuffer
-%D \egroup
-%D
-%D A torture test:
-%D
-%D \starttyping
-%D \def\TestLine#1#2{\backgroundline[#1]{\strut\white\tttf#2~\recurselevel}}
-%D
-%D \startbuffer
-%D \inleftmargin {\TestLine{red} {lm}} test test test \par
-%D \inrightmargin{\TestLine{green} {rm}} test test test \par
-%D \inleftedge {\TestLine{red} {le}} test test test \par
-%D \inrightedge {\TestLine{green} {re}} test test test \par
-%D \inoutermargin{\TestLine{blue} {om}} test test test \par
-%D \ininnermargin{\TestLine{yellow}{im}} test test test \par
-%D \inouteredge {\TestLine{blue} {oe}} test test test \par
-%D \ininneredge {\TestLine{yellow}{ie}} test test test \par
-%D \atleftmargin {\TestLine{red} {alm}} \hfill test \par
-%D \atrightmargin{\TestLine{green} {arm}} test \hfill \par
-%D \stopbuffer
-%D
-%D \dorecurse{40}\getbuffer \page
-%D \stoptyping
-
-%D New, yet undocumented:
-%D
-%D used for pascal:
-%D
-%D \starttyping
-%D \index {test} test \index {west} west \index {rest} rest
-%D
-%D \startnarrower
-%D \placeregister[index][alternative=b,command=\atleftmargin]
-%D \stopnarrower
-%D \stoptyping
-
-% todo: compensate distance when setuplayout[textwidth=..]
-% todo: generalize margin/edge model, now too much duplication
-
-%D The next bunch of macros looks messy which is due to its
-%D multi-purpose character.
-
-\chardef\margincontentdisplacement \zerocount
-\let \margincontentdistance \!!zeropoint
-\let \margincontenthoffset \!!zeropoint
-\def \margincontentlines {1}
-\def \margincontenttag {0}
-\let \margincontentseparator \empty
-\def \margincontentstrutheight {\strutht}
-
-\newcount\margincontentlevel
-\newdimen\margincontentheight
-
-\def\setupinmargin
- {\dodoubleempty\dosetupinmargin}
-
-\def\dosetupinmargin[#1][#2]%
- {\ifsecondargument
- \processcommalist[#1]{\dodosetupinmargin[#2]}% becomes [#2]{##1}
- \else
- \getparameters[\??im][#1]%
- \fi}
-
-% \def\dodosetupinmargin[#1]#2% [settings]{class}
-% {\checkinmargin[#2]%
-% \getparameters[\??im#2][#1]}
-
-\def\dodosetupinmargin[#1]#2% [settings]{class}
- {\checkinmargin[#2]%
- \getparameters[\??im#2][#1]%
- % will become an \everyinmarginsetup thing
- \ifcase\executeifdefined{\??im#2\c!sidemethod}{0}\else
- \enableparpositions
- \fi}
-
-\def\checkinmargin[#1]%
- {\ifundefined{\??im#1\c!offset}% this offset is related to framed !
- \addtocommalist{#1}\inmargintaglist
- \presetmargintext[#1]%
- \fi}
-
-\def\presetmargintext[#1]%
- {\presetlocalframed
- [\??im#1]%
- \getparameters
- [\??im#1]
- [\c!frame=\v!off,
- \c!offset=\v!overlay,
- \c!line=1,
- \c!separator=,
- \c!width=\v!broad,
- \c!distance=, % empty = signal
- \c!hoffset=\zeropoint,
- \c!style=\@@imstyle,
- \c!color=\@@imcolor,
- \c!strut=\@@imstrut,
- \c!location=\@@imlocation,
- \c!align=\@@imalign,
- \c!before=\@@imbefore,
- \c!after=\@@imafter]}
-
-\newdimen\naturalmargincontentheight
-
-\def\makemargintextblock#1#2#3% width l r content
- {\bgroup
- \forgetall % added, else problems with 'center' and nested itemize
- \dontcomplain
- \hsize\getvalue{\??im#1\c!width}\relax
- \doifnumberelse\margincontenttag
- {\ifcase\margincontenttag\relax
- \edef\margincontenttag{#1}% first one is setups id as well
- \fi}
- \donothing
- \doifnumberelse\margincontenttag
- {\ifnum\margincontenttag>25 % to be translated
- \writestatus\m!systems{potential margin stack overflow (\margincontenttag)}%
- \fi}
- \donothing
- % we need to preserve {a,b,c} kind of settings
- \let\margincontentalign#1%
- \processallactionsinset
- [\getvalue{\??im\margincontenttag\c!align}]
- [ \v!yes=>\let\margincontentalign#1,
- \v!no=>\let\margincontentalign\v!normal,
- \v!inner=>\let\margincontentalign#1,
- \v!outer=>\let\margincontentalign#2,
- \v!left=>\let\margincontentalign\v!left,
- \v!middle=>\let\margincontentalign\v!middle,
- \v!right=>\let\margincontentalign\v!right]%
- \doifvaluesomething{\??im\margincontenttag\c!align} % watch {} around set
- {\edef\margincontentalign{{\getvalue{\??im\margincontenttag\c!align},\margincontentalign}}}%
- %
- \expanded{\getparameters[\??im\margincontenttag][\c!align=\margincontentalign]}%
- %
- \edef\margincontentstrut{\getvalue{\??im\margincontenttag\c!strut}}%
- \savestrut %
- \setbox\scratchbox\vbox\localframed
- [\??im\margincontenttag]
- [\c!strut=\v!no,\c!offset=\v!overlay] % strut handled internally
- {\decrement\margincontentlines
- \dorecurse\margincontentlines{\savedstrut\endgraf\nointerlineskip}% ! savedstrut
- \@@imbefore
- \dostartattributes{\??im\margincontenttag}\c!style\c!color\empty
- \dosetupstrut[\margincontentstrut]% was: \setstrut % yes or no
- \begstrut#3\endstrut\endgraf
- \xdef\margincontentstrutheight{\the\strutht}% so that it's known outside the framed
- \dostopattributes
- \@@imafter}%
- \global \naturalmargincontentheight\ht\scratchbox
- \global\advance\naturalmargincontentheight\dp\scratchbox
- \doif\@@imstack\v!yes
- {\def\overlappingmargin{-20\scaledpoint}% test value, maybe .25\strutboxdp, maybe configurable
- \setbox\scratchbox\vbox{\stackeddown\vbox{\box\scratchbox}}}% new
- \ht\scratchbox\strutht
- \dp\scratchbox\strutdp % nieuw
- \box\scratchbox
- \egroup}
-
-%D The stacker permits constructs like:
-%D
-%D \starttyping
-%D \setupinmargin[stack=yes]
-%D
-%D \inleft{test 1}test\break
-%D \inleft{test 2}test\break
-%D \inleft{test 1}
-%D \input tufte
-%D \inleft{test 1}
-%D \inleft{test 2}
-%D \inleft{test 3}
-%D \input tufte
-%D \inleft{test 1}
-%D \inleft{test 2\endgraf test 3}
-%D \inleft{test 4}
-%D \input tufte
-%D \inleft{test 1}
-%D \inleft{test 2\endgraf test 3}
-%D \inleft{test 4\endgraf test 5\endgraf test 6}
-%D \inleft{test 7\endgraf test 8\endgraf test 9}
-%D \input tufte
-%D \stoptyping
-
-%D This approach permits us to implement a better mechanism
-%D later. We need the \type {\graphicvadjust} in order to
-%D handle:
-%D
-%D \starttyping
-%D \inleft{test} {\red \dorecurse{40}{test }\par}
-%D {\red \inleft{test} \dorecurse{40}{test }\par}
-%D \stoptyping
-%D
-%D The outer margin color is either black or color set as
-%D main text color.
-
-\newif\ifrightmargin % documenteren
-
-\ifx\dopositionmarginbox\undefined
- \def\dopositionmarginbox#1{\graphicvadjust{\box#1}}
-\fi
-
-% watch out, margin dimensions are swapped locally (\swapmargins)
-
-% with \margincontentmethod one can control pagebreaks
-%
-% 0 no break
-% 1 each entry is one line
-% 2 only natural height
-% 3 also stack height
-
-\chardef\margincontentmethod \plusthree % beware: 1 = old method
-\chardef\marginpagecheckmethod\plusone
-
-\def\margincontentextralines{1} % old method, play safe
-\def\nofmargincontentlines {0}
-
-\def\doplacemargintext#1#2#3#4%
- {\dontcomplain
- \strut
- \doifsomething{#1}
- {\def\margincontenttag{#1}}%
- \doifinsetelse{\margincontenttag}{\v!left,\v!right} % ugly hack
- {\let \margincontentdistance \empty % signal
- \let \margincontenthoffset \zeropoint}
- {\edef\margincontentdistance{\executeifdefined{\??im\margincontenttag\c!distance }\empty }% signal
- \edef\margincontenthoffset {\executeifdefined{\??im\margincontenttag\c!hoffset }\zeropoint}}%
- \edef\margincontentlines {\executeifdefined{\??im\margincontenttag\c!line }\plusone }%
- \edef\margincontentseparator {\executeifdefined{\??im\margincontenttag\c!separator}\donothing}%
- \setbox\scratchbox\hbox{#4}% % todo: make sure that color stack works
- \ifcase\margincontentmethod
- \scratchdimen\zeropoint
- \or % old method
- \scratchdimen\ht\scratchbox
- \advance\scratchdimen\dp\scratchbox
- \or
- \scratchdimen\naturalmargincontentheight
- \or
- \scratchdimen\naturalmargincontentheight
- \ifx\laststackvmove\undefined\else\global\advance\scratchdimen\laststackvmove\fi
- \fi
- \ifdim\scratchdimen>\margincontentheight
- \global\margincontentheight\scratchdimen
- \fi
- \setbox\scratchbox\hbox
- {#2{\hskip#3\strut
- \ifcase\margincontentdisplacement
- % normal, move strutheight up
- \scratchdimen\strutdp
- \advance\scratchdimen \margincontentstrutheight
- \advance\scratchdimen -\strutht
- \raise\scratchdimen
- \or
- % low, obey vadjust
- \fi
- \box\scratchbox}}%
- \ht\scratchbox\zeropoint
- \dp\scratchbox\zeropoint
- \gdef\margincontentstrutheight{\the\strutht}%
- %\graphicvadjust{\box\scratchbox}} % fails in high math lines, let it be
- %\hbox{\lower\strutdp\box\scratchbox}} % alas, wrong lapping, therefore useless
- \dopositionmarginbox\scratchbox}
-
-% \def\domarginblockskip#1%
-% {\hskip\margincontenthoffset
-% \hskip\compensatedinnermakeupmargin\relax
-% \doifelsenothing\margincontentdistance
-% {\hskip\getvalue{\??im#1\c!distance}}
-% {\hskip\margincontentdistance}%
-% \relax}
-
-\def\domarginblockskip#1%
- {\doifelsenothing\margincontentdistance
- {\hskip\dimexpr
- +\margincontenthoffset
- +\compensatedinnermakeupmargin
- +\csname\??im#1\c!distance\endcsname
- \relax}
- {\dimexpr
- +\margincontenthoffset
- +\compensatedinnermakeupmargin
- +\margincontentdistance
- \relax}%
- \relax}
-
-\def\doleftmarginblock#1#2%
- {\doplacemargintext{#1}\llap\zeropoint
- {\llap{\placemargincontentseparator}%
- \makemargintextblock\v!left\v!right{#2}%
- \domarginblockskip\v!left}}
-
-\def\dorightmarginblock#1#2%
- {\doplacemargintext{#1}\rlap\hsize
- {\hskip\textwidth\hskip-\hsize % new: hsize correction
- \domarginblockskip\v!right
- \makemargintextblock\v!right\v!left{#2}%
- \rlap{\placemargincontentseparator}}}
-
-\def\placemargincontentseparator
- {\ifnum\margincontentlevel>\zerocount
- \ifx\margincontentseparator\empty\else
- \bgroup
- \scratchdimen\margincontentlines\lineheight
- \advance\scratchdimen -\lineheight
- \lower\scratchdimen\hbox{\margincontentseparator}%
- \egroup
- \fi
- \fi}
-
-\newbox\marginconstructbox
-
-\def\doinmarginswapped#1#2#3#4%
- {\iffirstsidefloatparagraph\nowhitespace\fi % zo laat mogelijk
- \setbox\marginconstructbox\hbox\bgroup % prevents page break in the middle of construction
- \startsignalrightpage
- \doifswappedrightpageelse
- {\rightmargintrue #2}
- {\rightmarginfalse#1}
- {#3}% setups
- {#4}% content
- \stopsignalrightpage
- \egroup
- \unhbox\marginconstructbox}
-
-% history made this a bit complicated, the +/- was needed before
-% we had enough mem/hash to do the page correction
-
-\edef\inmargintaglist{+,-,\v!low,\v!left,\v!right,\v!inner,\v!outer}
-
-% the old one:
-%
-% \def\doinmargin[#1][#2][#3][#4][#5]% #6 #7
-% {\doifcommonelse{+,-,\v!laag}{#4}
-% {\dodoinmargin[#1][#2][#3][#4][#5]}
-% {\dodoinmargin[#1][#2][#3][][#4]}}
-%
-% an alternative:
-%
-% \letvalue{\??im\v!laag\c!offset}\empty
-% \letvalue{\??im +\c!offset}\empty
-% \letvalue{\??im -\c!offset}\empty
-%
-% \def\doinmargin[#1][#2][#3][#4][#5]% #6 #7
-% {\doifnumberelse{#4}
-% {\dodoinmargin[#1][#2][#3][#4][#5]}
-% {\doifdefinedelse{\??im#4\c!offset}
-% {\dodoinmargin[#1][#2][#3][#4][#5]}
-% {\dodoinmargin[#1][#2][#3][][#4]}}}
-%
-% the problem is that we need to keep downward compatibility
-% with respect to the first argument thing a reference or a
-% directive; the alternative is to force users to pass a
-% directive along with a reference; anyhow, as long as one
-% does not use references that have the same name as a
-% directive we can use the (slow) alternative
-
-\def\doinmargin[#1][#2][#3][#4][#5]% #6 #7
- {\expanded{\doifinsetelse{#4}{\inmargintaglist}}
- {\dodoinmargin[#1][#2][#3][#4][#5]}
- {\dodoinmargin[#1][#2][#3][][#4]}}
-
-\def\defineinmargin
- {\doquadrupleempty\dodefineinmargin}
-
-\def\dodefineinmargin[#1][#2][#3][#4]%
- {\doifassignmentelse{#4}
- {\setupinmargin[#1][#4]%
- \setvalue{#1}{\indentation\doquintupleempty\doinmargin[#2][#3][#1]}}
- {\setvalue{#1}{\indentation\doquintupleempty\doinmargin[#2][#3][#4]}}}
-
-\defineinmargin [inleft] [\v!left] [\v!normal] % takes left settings
-\defineinmargin [inright] [\v!right] [\v!normal] % takes right settings
-\defineinmargin [ininner] [\v!inner] [\v!normal] % takes left/right settings
-\defineinmargin [inouter] [\v!outer] [\v!normal] % takes left/right settings
-\defineinmargin [inmargin] [\@@imlocation] [\v!normal] % takes left/right settings
-\defineinmargin [inother] [\@@imlocation] [\v!reverse] % takes left/right settings
-
-\def\inothermargin{\inother}
-
-%D This permits definitions like:
-%D
-%D \starttyping
-%D \defineinmargin [SomePlace] [inner] [normal] [distance=1cm]
-%D \defineinmargin [SomePlace] [inner] [normal] [SomePlace] \setupinmargin[SomePlace][distance=1cm]
-%D \defineinmargin [MyPlace] [inner] [normal] [SomePlace]
-%D \defineinmargin [YourPlace] [inner] [normal] [SomePlace]
-%D \stoptyping
-%D
-%D A torture test:
-%D
-%D \starttyping
-%D \startbuffer
-%D \inleft {\TestLine{red} {l}} test test test \par
-%D \inright {\TestLine{green} {r}} test test test \par
-%D \inmargin {\TestLine{blue} {m}} test test test \par
-%D \inothermargin{\TestLine{yellow} {x}} test test test \par
-%D \ininner {\TestLine{cyan} {i}} test test test \par
-%D \inouter {\TestLine{magenta}{o}} test test test \par
-%D \stopbuffer
-%D
-%D \dorecurse{80}\getbuffer \page
-%D \stoptyping
-%D
-%D and
-%D
-%D \starttyping
-%D \defineinmargin [InOuterA] [outer] [normal] [distance=0cm]
-%D \defineinmargin [InOuterB] [outer] [normal] [distance=1cm]
-%D \defineinmargin [InOuterC] [outer] [normal] [distance=2cm,line=2]
-%D
-%D \startbuffer
-%D \InOuterA{\TestLine{red} {A}} test test test \par
-%D \InOuterB{\TestLine{green}{B}} test test test \par
-%D \InOuterC{\TestLine{blue} {C}} test test test \par
-%D \stopbuffer
-%D
-%D \dorecurse{80}\getbuffer \page
-%D
-%D \dorecurse{10}{\inleft {one} test \inleft {two} test } \page
-%D
-%D \start
-%D \margintext {one} \margintext {two} \input thuan \par
-%D \setupinmargin[1][line=3,distance=1cm]
-%D \margintext [1]{one}
-%D \margintext [2]{two}
-%D \input thuan \page
-%D \stop
-%D
-%D \setupinmargin[3][location=inner,distance=1cm]
-%D \setupinmargin[4][location=outer,distance=2cm]
-%D
-%D % \setupinmargin[left] [line=2]
-%D % \setupinmargin[right][line=2]
-%D
-%D \dorecurse
-%D {10}
-%D {\margintext {\kern3cm\TestLine{blue}{none}}
-%D \margintext[3] {\TestLine{darkgray}{3}}
-%D \margintext[4] {\TestLine{darkgray}{4}}
-%D \margintext[left] {\TestLine{red} {left}}
-%D \margintext[right]{\TestLine{green} {right}}
-%D \margintext[inner]{\TestLine{cyan} {inner}}
-%D \margintext[outer]{\TestLine{magenta} {outer}}
-%D \input thuan \endgraf}
-%D
-%D \dorecurse{10}{\margintext{test\\test\\test} \input thuan \endgraf}
-%D \stoptyping
-
-% Test case:
-%
-% \setuppagenumbering[alternative=doublesided] \setupwhitespace[medium]
-%
-% \placefigure[right]{}{\externalfigure[dummy][width=2cm]}
-% \input tufte \inothermargin{test} \input tufte
-
-% \def\dodoinmargin[#1][#2][#3][#4][#5]#6%
-% {\bgroup
-% \forgetall % otherwise sidefloat problems, added 2005/07/20, maybe dangerous
-% \postponenotes % group is (somehow) needed
-% \doifinsetelse\v!low{#4}
-% {\chardef\margincontentdisplacement\plusone}
-% {\chardef\margincontentdisplacement\zerocount}%
-% \doif\v!reverse{#2}
-% {\swapmacros\dorightmarginblock\doleftmarginblock}%
-% \processaction
-% [#1]
-% [ \v!left=>\let\next\doleftmarginblock, % no swapping
-% \v!right=>\let\next\dorightmarginblock, % no swapping
-% \v!inner=>\def\next{\doinmarginswapped\dorightmarginblock\doleftmarginblock },
-% \v!outer=>\def\next{\doinmarginswapped\doleftmarginblock \dorightmarginblock},
-% \s!unknown=>\ifdoublesided
-% \doifcommonelse{+,-}{#4}
-% {\def\next{\doinmarginswapped\dorightmarginblock\doleftmarginblock }}
-% {\def\next{\doinmarginswapped\doleftmarginblock \dorightmarginblock}}%
-% \else
-% \let\next\doleftmarginblock
-% \fi]%
-% \next{#3}{#6}%
-% \rawpagereference\s!mar{#5}% naar binnen ! ! ! !
-% \flushnotes
-% \egroup % don't forget the group
-% \ignorespaces}
-
-% test first
-%
-% setupsystem[random=1235]
-%
-% \setupinmargin[left][sidemethod=3]
-% \dorecurse{10}{test \fakewords{20}{40} test \inleft{test\\test} test \fakewords{20}{40} \par}
-% \page
-% \setupinmargin[left][sidemethod=4]
-% \dorecurse{40}{test \fakewords{50}{80} test \inleft{test\\test} \par}
-% \page
-
-\def\dodoinmargin[#1][#2][#3][#4][#5]#6%
- {\bgroup
-% \tracingall
- % old stuff, a bit tricky, but now interfaced
- \edef\currentmargincontent{#1}%
- \chardef\marginrepositionmethod\executeifdefined{\??im\currentmargincontent\c!sidemethod }\plusone
- \chardef\margincontentmethod \executeifdefined{\??im\currentmargincontent\c!textmethod }\plusthree
- \chardef\marginpagecheckmethod \executeifdefined{\??im\currentmargincontent\c!splitmethod}\plusone
- % so far
- \forgetall % otherwise sidefloat problems, added 2005/07/20, maybe dangerous
- \postponenotes % group is (somehow) needed
- \doifinsetelse\v!low{#4}
- {\chardef\margincontentdisplacement\plusone}
- {\chardef\margincontentdisplacement\zerocount}%
- \doif\v!reverse{#2}
- {\swapmacros\dorightmarginblock\doleftmarginblock}%
- \processaction
- [#1]
- [ \v!left=>\let\next\doleftmarginblock, % no swapping
- \v!right=>\let\next\dorightmarginblock, % no swapping
- \v!inner=>\def\next{\doinmarginswapped\dorightmarginblock\doleftmarginblock },
- \v!outer=>\def\next{\doinmarginswapped\doleftmarginblock \dorightmarginblock},
- \s!unknown=>\ifdoublesided
- \doifcommonelse{+,-}{#4}
- {\def\next{\doinmarginswapped\dorightmarginblock\doleftmarginblock }}
- {\def\next{\doinmarginswapped\doleftmarginblock \dorightmarginblock}}%
- \else
- \let\next\doleftmarginblock
- \fi]%
- \next{#3}{#6}%
- \rawpagereference\s!mar{#5}% naar binnen ! ! ! !
- \flushnotes
- \egroup % don't forget the group
- \ignorespaces}
-
-% dit zijn voorlopig lokale commando's / vervallen
-%
-% \def\woordinmarge {\indentation\doquintupleempty\doinmargin[\@@implaats][\inleftmargin][\inrightmarge]}
-%
-% \def\woordinlinker {\inleftmargin } % vervallen
-% \def\woordinrechter{\inrechtermarge} % vervallen
-
-% Some day: \definemarking[\v!margetitel]
-
-%D Now come the margin text collectors. The collected content is
-%D flushed at every paragraph by the following macro. Note for
-%D myself: here the location (plaats) is no longer a tag (number).
-
-% gone: \def\doflushmargincontent{\doinmargin[\@@implaats][\v!normaal][]} % + [#1][#2]{#3}}
-
-%D These are now all the same (long ago they had different
-%D implementations, somewhere in Sork time if I remember
-%D right).
-
-\def\margintext {\dodoubleempty\domargincontent}
-\def\marginword {\margintext}
-\def\margintitle{\margintext} % txt mark as well
-
-\newtoks\collectedmargintexts % so .. delayed!
-\chardef\margintextcollected \zerocount
-
-\def\domargincontent[#1][#2]#3% we used to check for #2/#1 being number, no longer now
- {\global\chardef\margintextcollected\plusone
- \edef\margincontenttag{#1}%
- \ifx\margincontenttag\empty
- \global\advance\margincontentlevel\plusone
- \edef\margincontenttag{\number\margincontentlevel}%
- \fi
- \checkinmargin[\margincontenttag]%
- \doglobal \appendetoks
- \noexpand \checkinmargin[\margincontenttag]%
- \noexpand \doinmargin[\executeifdefined{\??im\margincontenttag\c!location}\@@imlocation][\v!normal][\margincontenttag][\margincontenttag][#2]%
- \to \collectedmargintexts
- \doglobal \appendtoks
- {#3}%
- \to \collectedmargintexts}
-
-\let\restoreinterlinepenalty\relax
-
-\def\flushmargincontents % plural
- {\restoreinterlinepenalty % here?
- \ifcase\margintextcollected\else % called quite often, so we
- \expandafter\doflushmargincontents % speed up the \fi scan by
- \fi} % using a \do..
-
-\def\doflushmargincontents % links + rechts
- {\bgroup
- \forgetall
- \global\margincontentheight\zeropoint
- \startsignalrightpage
- \the\collectedmargintexts
- \signalrightpage
- \stopsignalrightpage
- \resetmargincontent
- % dirty tricks
- \ifcase\margincontentmethod
- \donefalse
- \else\ifinsidecolumns % brrrr
- \donetrue % how fuzzy
- \else\ifdim\margincontentheight>\lineheight\relax
- \donetrue % how dirty
- \else
- \donefalse % how needed
- \fi\fi\fi
- \savemargincontentlines
- \ifdone
- \advance\margincontentheight \margincontentextralines\lineheight
- \ifdim\pagegoal>\pagetotal
- \bgroup % preserve \margincontentheight
- \advance\margincontentheight \pagetotal
- \ifdim\margincontentheight>\pagegoal
- \egroup
- \ifcase\marginpagecheckmethod
- % disabled
- \or
- \setmargincontentpenalties
- \or
- % potentially dangerous, maybe better a \goodbreak; the problem is that
- % there can be a penalty there, which we then overload and we also introduce
- % nasty side effects, so, we drop this option
- % \vadjust pre {\page}%
- \fi
- \else
- \egroup
- \fi
- \fi
- \else % We need the above because interlinepenalties overrule vadjusted \nobreaks.
- % a bit dangerous
- \vadjust{\nobreak}%
- \fi
- \egroup}
-
-\def\setmargincontentpenalties
- {\getnoflines\margincontentheight
- \keeplinestogether\noflines}
-
-\def\savemargincontentlines
- {\bgroup
- \advance\margincontentheight \margincontentextralines\lineheight % 1 by default
- \getnoflines\margincontentheight
- \xdef\nofmargincontentlines{\the\noflines}%
- \egroup}
-
-\def\fillupmargincontentlines % etex ! ! !
- {\endgraf
- \begingroup
- \scratchcounter\numexpr\nofmargincontentlines-\prevgraf\relax\relax
- \ifnum\scratchcounter>\zerocount
- \forgetall\dorecurse\scratchcounter{\nobreak\crlf}%
- \fi
- \endgroup}
-
-% Yet undocumented, for a manual flush in for instance headers.
-
-\def\resetmargincontent
- {\global\margincontentlevel\zerocount
- \global\chardef\margintextcollected\zerocount
- \global\collectedmargintexts\emptytoks}
-
-% \def\placemargincontent
-% {\ifcase\margintextcollected\else
-% \bgroup
-% \chardef\graphicvadjustmode\zerocount
-% \doflushmargincontents
-% \egroup
-% \fi}
-%
-% font fix:
-
-\def\placemargincontent
- {\ifcase\margintextcollected\else % was level check
- \bgroup
- \redoconvertfont % !!
- \chardef\graphicvadjustmode\zerocount
- \doflushmargincontents
- \egroup
- \fi}
-
-% For old times sake (i use it in project styles) we provide
-
-\def\placemargintexts {\placemargincontent}
-\def\resetmargetitels {\resetmargincontent}
-\def\margewoordpositie{\margewoord} % obsolete, now no longer range
-
-% but never use them yourself since they may disappear.
-
-\def\oplinker#1%
- {\strut
- \graphicvadjust
- {\dontcomplain
- \setbox\scratchbox\vtop{\forgetall\strut#1}%
- \getboxheight\scratchdimen\of\box\scratchbox
- \vskip-\scratchdimen % waarom stond hier een \ ?
- \box\scratchbox}}
-
-\setupinmargin
- [\c!style=\v!bold,
- \c!color=,
- \c!strut=\v!auto,
- \c!location=\v!both,
- \c!align=\v!inner,
- \c!stack=\v!no,
- \c!before=,
- \c!after=]
-
-\setupinmargin
- [\v!left]
- [\c!distance=\leftmargindistance,
- \c!width=\leftmarginwidth,
- %\c!align=\v!left, % no
- \c!location=\v!left]
-
-\setupinmargin
- [\v!right]
- [\c!distance=\rightmargindistance,
- \c!width=\rightmarginwidth,
- %\c!align=\v!right, % no
- \c!location=\v!right]
-
-% bonus needed when [inner/outer] is used as tag
-
-\setupinmargin[\v!inner][\c!location=\v!inner,\c!align=\v!inner]
-\setupinmargin[\v!outer][\c!location=\v!outer,\c!align=\v!inner]
-
-% more efficient (5K less fotmat file)
-%
-% \letvalue{\??im\v!inner\c!location}\v!inner \letvalue{\??im\v!inner\c!align}\v!inner
-% \letvalue{\??im\v!outer\c!location}\v!outer \letvalue{\??im\v!outer\c!align}\v!inner
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/page-mis.mkii b/Master/texmf-dist/tex/context/base/mkii/page-mis.mkii
deleted file mode 100644
index a61b2435baf..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/page-mis.mkii
+++ /dev/null
@@ -1,268 +0,0 @@
-%D \module
-%D [ file=page-mis,
-%D version=2008.11.17, % was part of page-flt.tex / 2000.10.20
-%D title=\CONTEXT\ Page Macros,
-%D subtitle=Misc Float Things,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 / Misc Float Things}
-
-\unprotect
-
-\newif\ifmargeblokken
-
-\def\dosetupmarginblocks[#1]%
- {\getparameters[\??mb][#1]%
- \doifelse\@@mbstate\v!start
- {\showmessage\m!layouts4\empty
- \margeblokkentrue
- \let\somenextfloat\dosomenextfloat
- \let\startmarginblock\dostartmarginblock
- \let\stopmarginblock\dostopmarginblock}%
- {\showmessage\m!layouts5\empty
- \margeblokkenfalse
- \def\somenextfloat[##1]%
- {\someelsefloat[##1,\v!here]}%
- \let\startmarginblock\dontstartmargeblok
- \let\stopmarginblock\dontstopmargeblok}}
-
-\def\setupmarginblocks
- {\dosingleargument\dosetupmarginblocks}
-
-\newbox\marginbox
-
-\def\dosomenextfloat[#1]%
- {\global\setbox\marginbox\vbox
- {\hsize\@@mbwidth
- \unvcopy\marginbox
- \ifvoid\marginbox\else\expandafter\@@mbinbetween\fi
- \box\floatbox\filbreak}%
- \ifdim\ht\marginbox>\textheight
- \dosavefloatinfo
- \else
- \doinsertfloatinfo
- \fi}
-
-\newbox\preparedmarginbox
-
-\def\reshapemargin
- {\ifdim\ht\preparedmarginbox>\zeropoint
- \beginofshapebox
- \unvbox\preparedmarginbox
- \endofshapebox
- \reshapebox
- {\box\shapebox}%
- \setbox\preparedmarginbox\vbox to \textheight
- {\@@mbtop
- \flushshapebox
- \@@mbbottom}%
- \fi}
-
-\def\plaatsrechtermargeblok
- {\hskip\rightmarginwidth}
-
-\def\plaatslinkermargeblok
- {\hskip\leftmarginwidth}
-
-\def\checkmargeblokken
- {\ifvoid\marginbox\else\docheckmargeblokken\fi}
-
-\def\docheckmargeblokken % erg inefficient
- {\setbox\preparedmarginbox\vbox
- {\forgetall
- \splittopskip\topskip
- \ifvoid\marginbox\else
- \ifdim\ht\marginbox>\textheight
- \vsplit\marginbox to \textheight
- \else
- \unvbox\marginbox
- \fi
- \fi}%
- \reshapemargin
- \setbox\preparedmarginbox\vbox
- {\@@mbbefore\box\preparedmarginbox\@@mbafter}%
- \def\rightmarginbox
- {\def\plaatsrechtermargeblok
- {\setbox\preparedmarginbox\hbox to \rightmarginwidth
- {\@@mbleft\box\preparedmarginbox\@@mbright}%
- \vsmashbox\preparedmarginbox
- \box\preparedmarginbox}}%
- \def\leftmarginbox
- {\def\plaatslinkermargeblok
- {\setbox\preparedmarginbox\hbox to \leftmarginwidth
- {\@@mbright\box\preparedmarginbox\@@mbleft}%
- \vsmashbox\preparedmarginbox
- \box\preparedmarginbox}}%
- \processaction % traag
- [\@@mblocation]
- [ \v!inmargin=>\doifbothsidesoverruled\rightmarginbox\rightmarginbox\leftmarginbox,
- \v!middle=>\doifbothsidesoverruled\rightmarginbox\leftmarginbox\rightmarginbox,
- \v!left=>\leftmarginbox,
- \v!right=>\rightmarginbox,
- \s!unknown=>\setbox\preparedmarginbox\hbox{}]}
-
-\def\dostartmarginblock % 2 maal \vbox ivm \unvbox elders
- {\global\setbox\marginbox\vtop\bgroup\vbox\bgroup
- \hsize\@@mbwidth
- \ifvoid\marginbox\else
- \unvbox\marginbox
- \@@mbinbetween
- \fi
- \setupalign[\@@mbalign]%
- \dostartattributes\??mb\c!style\c!color{}%
- \begstrut\ignorespaces}
-
-\def\dostopmarginblock
- {\unskip\endstrut
- \dostopattributes
- \egroup
- \egroup}
-
-\def\dontstartmargeblok
- {\@@mbbefore
- \bgroup
- \dostartattributes\??mb\c!style\c!color\empty}
-
-\def\dontstopmargeblok
- {\dostopattributes
- \egroup
- \@@mbafter}
-
-\newcounter\nofpostponedblocks
-
-\newif\ifinpostponing
-
-\newevery\everytopofpage\relax
-
-\appendtoks \the\everytopofpage \to\everystarttext
-\appendtoks\global\everytopofpage\emptytoks\to\everystoptext
-
-% \startpostponing [pagenumber] [+pageoffset]
-%
-% \startpostponing[2]
-% PAGE 2 \blank
-% \stoppostponing
-%
-% \startpostponing[+1]
-% PAGE +1 \blank
-% \stoppostponing
-%
-% \startpostponing[+2]
-% PAGE +2 \blank
-% \stoppostponing
-%
-% \starttext \dorecurse{4}{\input tufte \page} \stoptext
-
-\newtoks \postponedpageblocks
-\newcounter\nofpostponedpageblocks
-
-% \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\flushrestfloats
-% {\doif{\floatsharedparameter\c!cache}\v!no\doflushfloats}
-
-% \let\flushrestfloats\relax
-
-\def\dopostponeblock
- {\bgroup % new may 2004
- \setsystemmode\v!postponing % new may 2004
- \the\everytopofpage
- %\flushrestfloats
- \flushpagefloats
- \donefalse
- \ifinpostponing \else
- \ifcase\nofpostponedblocks \else \donetrue \fi
- \ifcase\nofpostponedpageblocks \else \donetrue \fi
- \fi
- \ifdone
- \bgroup % we need the color/font switch, else problems inside split verbatim
- \setnormalcatcodes % postponing in verbatim
- \pushpostponedpagecolor
- \restoreglobalbodyfont % The \nof-test is
- \global\pagetotal\zeropoint % recently added and
- \global\inpostponingtrue % definitely needed else
- \the\postponedpageblocks % we can loose or disorder
- \dorecurse\nofpostponedblocks % floats; anyhow, this
- {\getbuffer[pbuf-\recurselevel]}% % mechanism is still
- \doflushfloats % new but potential dangerous % suboptimal and needs a
- \doglobal\newcounter\nofpostponedblocks % proper analysis
- \global\inpostponingfalse
- \poppostponedpagecolor
- \egroup
- \fi
- \egroup} % new may 2004
-
-\def\getpostponedblock#1#2%
- {\doif{#1}\realfolio{\getbuffer[rbuf-#2]}} % no \ifnum, avoid \fi
-
-% beware, \dosingleempty conflicts with buffers (feeds back the \par)
-
-\setvalue{\e!start\v!postponing}%
- {\bgroup
- \obeylines
- \doifnextoptionalelse{\egroup\nodostartpostponing}{\egroup\dodostartpostponing}}
-
-\def\nodostartpostponing[#1]%
- {\doglobal\increment\nofpostponedpageblocks
- \bgroup % a little bit of misusing grouping
- \doifinstring{+}{#1}\advance \realpageno#1\relax % ugly but efficient
- \doglobal\appendetoks\noexpand\getpostponedblock
- {\realfolio}{\nofpostponedpageblocks}\to\postponedpageblocks
- \egroup
- \showmessage\m!layouts3\nofpostponedpageblocks
- \dostartbuffer[rbuf-\nofpostponedpageblocks]%
- [\e!start\v!postponing][\e!stop\v!postponing]}
-
-\def\dodostartpostponing
- {\doglobal\increment\nofpostponedblocks
- \showmessage\m!layouts3\nofpostponedblocks
- \expanded{\dostartbuffer[pbuf-\nofpostponedblocks][\e!start\v!postponing][\e!stop\v!postponing]}}
-
-% Setups:
-
-\setupmarginblocks
- [\c!state=\v!start,
- \c!location=\v!inmargin,
- \c!width=\rightmarginwidth,
- \c!style=,
- \c!color=,
- \c!align=,
- \c!left=,
- \c!right=,
- \c!top=,
- \c!inbetween=\blank,
- \c!bottom=\vfill,
- \c!before=,
- \c!after=]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/page-mul.mkii b/Master/texmf-dist/tex/context/base/mkii/page-mul.mkii
deleted file mode 100644
index bf258abed45..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/page-mul.mkii
+++ /dev/null
@@ -1,1773 +0,0 @@
-%D \module
-%D [ file=page-mul, % was: core-mul
-%D version=1998.03.15,
-%D title=\CONTEXT\ Page Macros,
-%D subtitle=Multi Column Output,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 / Simple Multi Column}
-
-%D This module is mostly a copy from the original multi column
-%D routine as implemented in \type {core-mul}. When the main
-%D OTR macro's were isolated in modules and column sets were
-%D introduced, this module became part of the OTR modules. As
-%D a result this module is no longer generic. It also needs
-%D an overhaul.
-
-\unprotect
-
-% TO DO !
-
-\let\OTRMULsetvsize \OTRONEsetvsize
-\let\OTRMULsethsize \OTRONEsethsize
-\let\OTRMULdopagecontents \OTRONEdopagecontents
-\let\OTRMULfinalsidefloatoutput\OTRONEfinalsidefloatoutput % ???
-\let\OTRMULflushfloatbox \OTRONEflushfloatbox
-
-\let\OTRMULdosettopinserts \relax
-\let\OTRMULdosetbotinserts \relax
-\let\OTRMULdotopinsertions \relax
-\let\OTRMULdobotinsertions \relax
-\let\OTRMULdosetbothinserts \relax
-\let\OTRMULflushsavedfloats \relax
-
-\let\OTRMULflushsidefloats \forgetsidefloats % \relax
-\let\OTRMULsynchronizesidefloats\forgetsidefloats % \relax
-
-\newtoks \OTRMULoutput
-
-\def\OTRMULgotonextpage
- {\ejectpage}
-
-\def\OTRMULgotonextpageX % will become obsolete
- {\superejectpage}
-
-% check \count<insert> multiplications
-
-% some day try this in balancing routine
-%
-% \ifdim\pagetotal>\pagegoal
-% \eject
-% \else
-% \goodbreak
-% \fi
-
-%D The following macro's implement a multi||column output
-%D routine. The original implementation was based on Donald
-%D Knuth's implementation, which was adapted by Craig Platt to
-%D support balancing of the last page. I gradually adapted
-%D Platt's version to our needs but under certain
-%D circumstances things still went wrong. I considered all
-%D calls to Platt's \type{\balancingerror} as undesirable.
-
-%D This completely new implementation can handle enough
-%D situations for everyday documents, but is still far from
-%D perfect. While at the moment the routine doesn't support
-%D all kind of floats, it does support:
-%D
-%D \startitemize[packed]
-%D \item an unlimitted number of columns
-%D \item ragged or not ragged bottoms
-%D \item optional balancing without \type{\balancingerrors}
-%D \item different \type{\baselineskips}, \type{\spacing},
-%D \type{\topskip} and \type{\maxdepth}
-%D \item left- and right indentation, e.g. within lists
-%D \item moving columns floats to the next column or page
-%D \item handling of floats that are to wide for a columns
-%D \stopitemize
-%D
-%D One could wonder why single and multi||columns modes are
-%D still separated. One reason for this is that \TeX\ is not
-%D suited well for handling multi||columns. As a result, the
-%D single columns routines are more robust. Handling one
-%D column as a special case of multi||columns is posible but at
-%D the cost of worse float handling, worse page breaking,
-%D worse etc. Complicated multi||column page handling should
-%D be done in \cap{DTP}||systems anyway.
-%D
-%D There are three commands provided for entering and leaving
-%D multi||column mode and for going to the next column:
-%D
-%D \interface \type{\beginmulticolumns} \\ \\
-%D \interface \type{\endmulticolumns} \\ \\
-%D \interface \type{\ejectcolumn} \\ \\
-%D
-%D This routines are sort of stand||alone. They communicate
-%D with the rest of \CONTEXT\ by means of some interface
-%D macro's, which we only mention.
-%D
-%D \interface \type{\nofcolumns} \\
-%D the number of columns \\
-%D \interface \type{\minbalancetoplines} \\
-%D the minimum number op balanced top lines \\
-%D \interface \type{\betweencolumns} \\
-%D the stuff between columns \\
-%D \interface \type{\finaloutput{action}{box}} \\
-%D some kind of \type{\pagebody} and \type{\shipout} \\
-%D
-%D \interface \type{\ifbalancecolumns} \\
-%D balancing the colums or not \\
-%D \interface \type{\ifstretchcolumns} \\
-%D ragging the bottom or not \\
-%D
-%D \interface \type{\ifheightencolumns} \\
-%D fix the heigh tor not \\
-%D \interface \type{\fixedcolumnheight} \\
-%D the optional fixed height \\
-%D
-%D \interface \type{\ifinheritcolumns} \\
-%D handle ragging or not \\
-%D \interface \type{\ifr@ggedbottom} \\
-%D use ragged bottoms \\
-%D \interface \type{\ifb@selinebottom} \\
-%D put the bottom line on the baseline \\
-%D \interface \type{\ifnormalbottom} \\
-%D put the bottom line at the baseline \\
-%D
-%D \interface \type{\ifreversecolumns} \\
-%D reverse the order in wich columns are flushed \\
-%D
-%D \interface \type{\usercolumnwidth} \\
-%D the calculated width of a column \\
-%D \interface \type{\columntextwidth} \\
-%D the maximum width of a column \\
-%D \interface \type{\columntextheight} \\
-%D the minimum width of a column \\
-%D
-%D \interface \type{\spacingfactor} \\
-%D the spacing factor \\
-%D \interface \type{\bodyfontsize} \\
-%D the (local) bodyfontsize \\
-%D \interface \type{\openlineheight} \\
-%D the lineheight (including \type{\spacing}) \\
-%D
-%D \interface \type{\EveryBodyFont} \\
-%D communication channel to font switching routines \\
-%D
-%D \interface \type{\global\settopskip} \\
-%D set \type{\topskip} \\
-%D \interface \type{\setvsize} \\
-%D set \type{\vsize} and \type{\pagegoal} \\
-%D \interface \type{\sethsize} \\
-%D set \type{\hsize} \\
-%D
-%D \interface \type{\flushcolumnfloats} \\
-%D push saved column floats (next page) \\
-%D \interface \type{\flushcolumnfloat} \\
-%D push saved column floats (next column) \\
-%D \interface \type{\setcolumnfloats} \\
-%D initialize column floats \\
-%D
-%D \interface \type{\finishcolumnbox} \\
-%D do something special (a hook) \\
-%D \interface \type{\postprocesscolumnpagebox} \\
-%D do something with each columnbox (also a hook) \\
-%D \interface \type{\postprocesscolumnbox} \\
-%D do something with each columnbox (also a hook) \\
-%D \interface \type{\postprocesscolumnline} \\
-%D do something with each columnline (also a hook) \\
-%D \interface \type{\currentcolumn} \\
-%D the current column \\
-%D
-%D These interface macro's are called upon or initialized
-%D by the multi||column macro's.
-
-%D A lot of footnote stuff added!
-
-\def\finalcolumntextwidth {\makeupwidth}
-\def\finalcolumntextheight {\textheight}
-\def\columntextwidth {\makeupwidth}
-\def\columntextheight {\textheight}
-\def\usercolumnwidth {\textwidth}
-\def\columntextoffset {\!!zeropoint}
-
-\def\fixedcolumnheight {\textheight}
-\def\betweencolumns {\hskip\bodyfontsize}
-
-\let\setcolumnfloats \relax % in CONTEXT used for floats
-\let\flushcolumnfloats \relax % in CONTEXT used for floats
-\let\flushcolumnfloat \relax % in CONTEXT used for floats
-\let\finishcolumnbox \relax % in CONTEXT used for backgrounds
-
-% %D In fact, the column height and width are set by means of
-% %D two macro's. One can change their meaning if needed:
-%
-% \def\setcolumntextheight
-% {\def\columntextheight{\teksthoogte}}
-%
-% \def\setcolumntextwidth
-% {\def\columntextwidth{\zetbreedte}}
-
-%D Both macros are redefined in \CONTEXT\ when backgrounds
-%D are applied to columns. The final values are used when
-%D flushing the columns.
-
-\newtoks\singlecolumnout % remove that one
-
-%D It's more convenient to use \type {\columnwidth} instead
-%D of messing around with boxes each time.
-
-\newdimen\columnwidth
-\newdimen\gutterwidth
-
-\def\determinecolumnwidth
- {\bgroup
- \setbox\scratchbox\hbox
- {\setcolumnhsize
- \global\columnwidth\usercolumnwidth
- \global\gutterwidth\intercolumnwidth}%
- \egroup}
-
-%D Going to a new columns is done by means of a
-%D \type{\ejectcolumn}. The following definition does not
-%D always work.
-
-\def\ejectcolumn
- {\goodbreak\showmessage\m!columns2\empty}
-
-%D The next macro should never be called so let's deal with it.
-%D There were several solutions to these kind of errors. First
-%D we check for a good breakpoint before firing up the
-%D multi||column routine (\type{\break} or \type{\allowbreak}).
-%D We do the same at the end of the routine
-%D (\type{\allowbreak}). These allowances are definitely
-%D needed!
-%D
-%D Some on first sight redundant calls to for instance
-%D \type{\setvsize} in the flushing, splitting and balancing
-%D macro's can definitely not be omitted! Some are just there
-%D to handle situations that only few times arise. One of
-%D those can be that the output routine is invoked before
-%D everything is taken care of. This happens when we
-%D flush (part of) the current page with an \type{\unvbox}
-%D with a \type{\pagetotal}~$\approx$ \type{\pagegoal}. One
-%D simply cannot balance columns that are just balanced.
-%D
-%D I hope one never sees the following message. Because it
-%D took me a lot of time to develop the multi||columns
-%D routines, every (although seldom) warning gives me the
-%D creeps!
-
-\def\balancingerror
- {\showmessage\m!columns3\empty
- \finaloutput\unvbox\normalpagebox}
-
-\def\OTRMULsometopsfloat{\showmessage\m!columns4\empty \someherefloat}
-\def\OTRMULsomebotsfloat{\showmessage\m!columns5\empty \someherefloat}
-
-\def\OTRMULsomeherefloat{\OTRONEsomeherefloat}
-
-%D The local column width is available in the dimension
-%D register \type{\localcolumnwidth}, which is calculated as:
-
-\def\setcolumnhsize % beware, this one is available for use in macros
- {\setbox\scratchbox\hbox{\parindent\zeropoint\betweencolumns}%
- \intercolumnwidth\wd\scratchbox
- \localcolumnwidth\columntextwidth
- \advance\localcolumnwidth -\leftskip
- \advance\localcolumnwidth -\rightskip
- % new
- \advance\localcolumnwidth -\colleftskip
- \advance\localcolumnwidth -\colrightskip
- %
- \advance\localcolumnwidth -\nofcolumns\intercolumnwidth
- \advance\localcolumnwidth \intercolumnwidth
- \divide \localcolumnwidth \nofcolumns
- \scratchdimen\columntextoffset
- \multiply\scratchdimen \plustwo
- \advance\localcolumnwidth -\scratchdimen
- \usercolumnwidth\localcolumnwidth
- \hsize\localcolumnwidth} % we don't do it \global
-
-%D Torture test:
-%D
-%D \startbuffer
-%D \startbuffer[b]
-%D \startcolumns
-%D \input tufte
-%D \stopcolumns
-%D \stopbuffer
-%D \typebuffer[b] \getbuffer[b]
-%D
-%D \startbuffer[b]
-%D \startnarrower
-%D \input tufte
-%D \stopnarrower
-%D \stopbuffer
-%D \typebuffer[b] \getbuffer[b]
-%D
-%D \startbuffer[b]
-%D \startcolumns \startnarrower
-%D \input tufte
-%D \stopnarrower \stopcolumns
-%D \stopbuffer
-%D \typebuffer[b] \getbuffer[b]
-%D
-%D \startbuffer[b]
-%D \startnarrower \startcolumns
-%D \input tufte
-%D \stopcolumns \stopnarrower
-%D \stopbuffer
-%D \typebuffer[b] \getbuffer[b]
-%D
-%D \startbuffer[b]
-%D \startcolumns \startnarrower[left]
-%D \input tufte
-%D \stopnarrower \stopcolumns
-%D \stopbuffer
-%D \typebuffer[b] \getbuffer[b]
-%D
-%D \startbuffer[b]
-%D \startnarrower[left] \startcolumns
-%D \input tufte
-%D \stopcolumns \stopnarrower
-%D \stopbuffer
-%D \typebuffer[b] \getbuffer[b]
-%D
-%D \startbuffer[b]
-%D \startnarrower \startcolumns \startnarrower
-%D \input tufte
-%D \stopnarrower\stopcolumns \stopnarrower
-%D \stopbuffer
-%D \typebuffer[b] \getbuffer[b]
-%D
-%D \startbuffer[b]
-%D \startnarrower[left] \startcolumns \startnarrower
-%D \input tufte
-%D \stopnarrower\stopcolumns \stopnarrower
-%D \stopbuffer
-%D \typebuffer[b] \getbuffer[b]
-%D \stopbuffer
-%D
-%D \start
-%D \def\postprocesscolumnline#1{\ruledhbox{\strut\box#1}\hss}
-%D \getbuffer
-%D \stop
-
-%D One should be aware that when font related dimensions are
-%D used in typesetting the in||between material, these
-%D dimensions are influenced by bodyfont switches inside
-%D multi||column mode.
-
-\newdimen\mcscratchdimen
-\newcount\nofcolumnlines
-
-\chardef\multicolumnlinemethod\zerocount % 0: overshoot (old default), 1: tight
-% \chardef\multicolumnlinemethod\plusone
-
-\def\getmulticolumnlines
- {\mcscratchdimen-\columntextoffset
- \multiply\mcscratchdimen \plustwo
- \advance\mcscratchdimen \columntextheight
- \ifdim\precolumnboxheight>\zeropoint
- \advance\mcscratchdimen -\precolumnboxheight
- \fi
- \settotalinsertionheight
- \advance\mcscratchdimen -\totalinsertionheight
- \ifcase\multicolumnlinemethod \getnoflines\mcscratchdimen
- \or \getrawnoflines\mcscratchdimen
- \else \getrawnoflines\mcscratchdimen
- \fi
- % added 30/7/2004
- \ifnum\layoutlines>\zerocount \ifnum\noflines>\layoutlines
- \noflines\layoutlines
- \fi \fi
- \nofcolumnlines\noflines}
-
-\def\multicolumnovershootratio{.5} % {\ifgridsnapping0\else.5\fi}
-
-\def\setcolumnvsize
- {\getmulticolumnlines
- \mcscratchdimen\nofcolumnlines\openlineheight
- \advance\mcscratchdimen \multicolumnovershootratio\openlineheight % collect enough data
- \global\vsize\nofcolumns\mcscratchdimen
- \global\pagegoal\vsize} % let's do it only here
-
-%D It really starts here. After some checks and initializations
-%D we change the output routine to continous multi||column
-%D mode. This mode handles columns that fill the current and
-%D next full pages. The method used is (more or less)
-%D multiplying \type{\vsize} and dividing \type{\hsize} by
-%D \type{\nofcolumns}. More on this can be found in the
-%D \TeX book. We save the top of the current page in box
-%D \type{\precolumnbox}.
-%D
-%D We manipulate \type{\topskip} a bit, just to be shure that
-%D is has no flexibility. This has te be done every time a
-%D font switch takles place, because \type{\topskip} can depend
-%D on this.
-%D
-%D Watch the trick with the \type{\vbox}. This way we get the
-%D right interlining and white space.
-
-\def\beginmulticolumns
- {\par
- \flushnotes
- \xdef\precolumndepth{\the\prevdepth}%
- \begingroup
- % new
- \leftskip1\leftskip
- \rightskip1\rightskip
- \edef\colleftskip {\the\leftskip}%
- \edef\colrightskip{\the\rightskip}%
- \leftskip\zeropoint
- \rightskip\zeropoint
- %
- \dontshowcomposition
- %\setcolumntextwidth\relax
- %\setcolumntextheight\relax
- \widowpenalty\zerocount % is gewoon beter
- \clubpenalty \zerocount % zeker bij grids
- \ifsomefloatwaiting
- \showmessage\m!columns6{\the\savednoffloats}%
- \global\setbox\savedfloatlist\box\floatlist
- \xdef\restoresavedfloats
- {\global\savednoffloats\the\savednoffloats
- \global\setbox\floatlist\box\savedfloatlist
- \global\noexpand\somefloatwaitingtrue}%
- \global\savednoffloats\zerocount
- \global\somefloatwaitingfalse
- \else
- \global\let\restoresavedfloats\relax
- \fi
- \dimen0\pagetotal
- \advance\dimen0 \parskip
- \advance\dimen0 \openlineheight
- \ifdim\dimen0<\pagegoal
- \allowbreak
- \else
- \break % Sometimes fails
- \fi
- \appendtoks\topskip1\topskip\to\everybodyfont
- \the\everybodyfont % ugly here
- \saveinterlinespace % ugly here
- \initializecolumns\nofcolumns
- \hangafter\zerocount
- \hangindent\zeropoint
- \everypar\emptytoks
- \ifdim\pagetotal=\zeropoint \else
- \verticalstrut
- \vskip-\struttotal
- \fi
- \global\savedpagetotal\pagetotal
- \global\singlecolumnout\output
- %\global\output{\global\setbox\precolumnbox\vbox{\unvbox\normalpagebox}}%
- \global\output{\global\setbox\precolumnbox\vbox{\dotopinsertions\unvbox\normalpagebox}}%
- \eject % no \holdinginserts=1, can make footnote disappear !
- \global\precolumnboxheight\ht\precolumnbox
- \global\output{\continuousmulticolumnsout}%
- \setcolumnfloats
- \dohandleallcolumns
- {\global\setbox\currenttopcolumnbox\emptybox}%
- \checkbegincolumnfootnotes
- \activateotr{MUL}{ONE}% todo ! ! ! !
- \let\sethsize\setcolumnhsize
- \let\setvsize\setcolumnvsize
- \sethsize
- \setvsize
- \showcomposition}
-
-%D When we leave the multi||column mode, we have to process the
-%D not yet shipped out part of the columns. When we don't
-%D balance, we simply force a continuous output, but a balanced
-%D output is more tricky.
-
-%D First we try to fill up the page and when all or something
-%D is left we try to balance things. This is another useful
-%D adaption of the ancesters of these macro's. It takes some
-%D reasoning to find out what happens and maybe I'm making
-%D some mistake, but it works.
-%D
-%D Voiding box \type{\precolumnbox} is sometimes necessary,
-%D e.g. when there is no text given between \type{\begin..}
-%D and \type{\end..}. The \type{\par} is needed!
-
-\chardef\multicolumnendsyncmethod\plusone % 1: old sync 2: new sync (cont-loc/project) / may fail ! ! ! !
-
-\def\endmulticolumns
- {%\par
- \ifnum\multicolumnendsyncmethod=\plustwo
- \synchronizeoutput
- \else
- % don't combine these
- \vskip\lineheight
- \vskip-\lineheight % take footnotes into account
- \fi
- \dontshowcomposition
- \doflushcolumnfloat % added recently
- %\doflushcolumnfloats % no, since it results in wrong top floats
- \flushnotes % before start of columns
- \par
- \ifbalancecolumns
- \ifnum\multicolumnendsyncmethod=\plusone
- \global\output{\continuousmulticolumnsout}%
- \goodbreak
- \fi
- \global\output{\balancedmulticolumnsout}%
- \else
- \goodbreak
- \fi
- \eject % the prevdepth is important, try e.g. toclist in
- \prevdepth\zeropoint % columns before some noncolumned text text
- \global\output\singlecolumnout
- \global\output{\the\mainoutput}% % % % % todo
- \ifvoid\precolumnbox\else
- \unvbox\precolumnbox
- \fi
- \global\precolumnboxheight\zeropoint
- \endgroup % here
- \nofcolumns\plusone
- \setvsize % the outer one!
- \synchronizeoutput % new may 2004 / we need to: \pagegoal\vsize
- \checkendcolumnfootnotes
- \dosomebreak\allowbreak
- \restoresavedfloats}
-
-%D Because some initializations happen three times, we
-%D defined a macro for them. Erasing \type{\everypar} is
-%D needed because we don't want anything to interfere.
-
-\def\setmulticolumnsout
- {\everypar\emptytoks
- \dontcomplain
- \settopskip
- \setmaxdepth
- \topskip1\topskip
- \splittopskip\topskip
- \splitmaxdepth\maxdepth
- \boxmaxdepth\maxdepth % dangerous
- \emergencystretch\zeropoint\relax} % sometimes needed !
-
-%D Flushing the page comes to pasting the columns together and
-%D appending the result to box \type{\precolumnbox}, if not
-%D void. I've seen a lot of implementations in which some skip
-%D was put between normal text and multi||column text. When we
-%D don't want this, the baselines can be messed up. I hope the
-%D seemingly complicated calculation of a correction
-%D \type{\kern} is adequate to overcome this. Although not
-%D watertight, spacing is taken into account and even multiple
-%D mode changes on one page go well. But cross your fingers and
-%D don't blame me.
-%D
-%D One of the complications of flushing out the boxes is that
-%D \type{\precolumnbox} needs to be \type{\unvbox}'ed, otherwise
-%D there is too less flexibility in the page when using
-%D \type{\r@ggedbottom}. It took a lot of time before these
-%D kind of problems were overcome. Using \type{\unvbox} at the
-%D wrong moment can generate \type{\balancingerror}'s.
-%D
-%D One can use the macros \type {\maxcolumnheight} and \type
-%D {\maxcolumndepth} when generating material between columns
-%D as well as postprocessing column lines.
-
-\let\maxcolumnheight=\zeropoint
-\let\maxcolumndepth =\zeropoint
-
-\newbox\columnpagebox
-
-\def\setmaxcolumndimensions
- {\let\maxcolumnheight\!!zeropoint
- \let\maxcolumndepth \!!zeropoint
- \dohandleallcolumns
- {\ifdim\ht\currentcolumnbox>\maxcolumnheight
- \edef\maxcolumnheight{\the\ht\currentcolumnbox}%
- \fi
- \ifdim\dp\currentcolumnbox>\maxcolumndepth
- \edef\maxcolumndepth{\the\dp\currentcolumnbox}%
- \fi}}
-
-\chardef\multicolumntopflushmethod\plusone % 0: no correction, 1: correction when topstuff, 2: correction, 3: correction++
-\chardef\multicolumntopalignmethod\plustwo % 0: nothing, 1: force grid, 2: follow grid
-
-\def\flushprecolumnboxnogrid
- {\unvbox\precolumnbox}
-
-\def\flushprecolumnboxongrid
- {\scratchdimen\savedpagetotal
- \advance\scratchdimen -\ht\precolumnbox
- \advance\scratchdimen -\dp\precolumnbox
- \advance\scratchdimen -\topskip
- \box\precolumnbox
- \kern\scratchdimen}
-
-\newconditional\someprecolumncontent
-
-\def\flushcolumnedpage#1%
- {\bgroup
- \ifvoid\precolumnbox
- \setfalse\someprecolumncontent % will be set elsewhere
- \else
- \settrue\someprecolumncontent
-\mkprocessboxcontents\precolumnbox
- \fi
- \forgetall
- \setmulticolumnsout
- \showcomposition
- \setmaxcolumndimensions
- \dohandleallcolumns
- {\mkprocesscolumncontents\currentcolumnbox}%
- \postprocesscolumns
- \dohandleallcolumns % \hbox i.v.m. \showcomposition
- {\global\setbox\currentcolumnbox\hbox to \localcolumnwidth
- {\box\currentcolumnbox}%
- \wd\currentcolumnbox\localcolumnwidth
- \ifheightencolumns
- \ht\currentcolumnbox\fixedcolumnheight
- \fi}%
- \setmaxcolumndimensions
- \overlaycolumnfootnotes
- \setbox\columnpagebox\vbox
- {\hbox to \finalcolumntextwidth
- {\hskip\colleftskip\relax % new, \relax needed
- \ifreversecolumns
- \popsplitproperties % else wrong color stack
- \@EA\dohandlerevcolumns
- \else
- \@EA\dohandleallcolumns
- \fi
- {\finishcolumnbox{\hbox
- {\ifx\finishcolumnbox\relax\else\strut\fi
- \box\currentcolumnbox}}%
- \hfil}%
- \unskip
- \hskip\colrightskip}}% new
- \scratchdimen\zeropoint
- \dohandleallcolumns
- {\ifdim-\ht\currenttopcolumnbox<\scratchdimen
- \scratchdimen-\ht\currenttopcolumnbox
- \fi
- \global\setbox\currenttopcolumnbox\emptybox}%
- \advance\scratchdimen \ht\columnpagebox
- \setbox\scratchbox\hbox to \columntextwidth
- {\vrule
- \!!width\zeropoint
- \!!height\scratchdimen
- \!!depth\dp\columnpagebox
- \dostepwiserecurse2\nofcolumns1{\hfil\betweencolumns}\hfil}%
- \setbox\columnpagebox\hbox
- {\box\columnpagebox
- \hskip-\columntextwidth
- \restoretextcolor{\box\scratchbox}}%
- \postprocesscolumnpagebox % new, acts upon \box\columnpagebox
- \ifconditional\someprecolumncontent
- \settrue\someprecolumncontent
- % next some incredible crappy code
- \ifcase\multicolumntopalignmethod
- \flushprecolumnboxnogrid % not on grid
- \or
- \flushprecolumnboxongrid % force on grid
- \else\ifgridsnapping % somehow this junk fails in pascal
- \flushprecolumnboxongrid % obey grid settings, force on grid
- \else
- \flushprecolumnboxnogrid % ignore grid settings, not on grid
- \fi \fi
- \fi
- \global\precolumnboxheight\zeropoint
- \setvsize
- \dosomebreak\nobreak % hm, only needed when topstuff
- \ifgridsnapping
- \else
- \ifcase\multicolumntopflushmethod
- % 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
- \ifconditional\someprecolumncontent
-% \scratchdimen\topskip
-% \advance\scratchdimen -\openstrutheight
-% \nointerlineskip
-% \vskip-\scratchdimen
- \nointerlineskip
- \vskip\dimexpr\openstrutheight-\topskip\relax
- \fi
- \or
-% \scratchdimen\topskip
-% \advance\scratchdimen -\openstrutheight
-% \nointerlineskip
-% \vskip-\scratchdimen
- \nointerlineskip
- \vskip\dimexpr\openstrutheight-\topskip\relax
- \or
- % untested but maybe handy
-% \scratchdimen\topskip
-% \advance\scratchdimen -\openstrutheight
-% \nointerlineskip
-% \vskip-\scratchdimen
-% \vskip-\lineheight
-% \vbox{\strut}%
- \nointerlineskip
- \vskip\dimexpr\openstrutheight-\topskip-\lineheight\relax
- \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}
-
-%D In case one didn't notice, finaly \type{\finishcolumnbox} is
-%D applied to all boxes. One can use these hooks for special
-%D purposes.
-%D
-%D Once upon a time I wanted to manipulate the individual lines
-%D in a column. This feature is demonstrated in the two examples
-%D below.
-%D
-%D \startbuffer
-%D \def\postprocesscolumnline#1% or \postprocesscolumnbox
-%D {\ruledhbox{\box#1}\hss}
-%D
-%D \startcolumns[n=4]
-%D \dorecurse{25}{line: \recurselevel\par}
-%D \stopcolumns
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D Here we show the natural width of the lines:
-%D
-%D {\getbuffer}
-%D
-%D The next example does a bit more advanced manipulation:
-%D
-%D \startbuffer
-%D \def\postprocesscolumnline#1%
-%D {\ifodd\currentcolumn
-%D \hfill\unhbox#1\relax
-%D \else
-%D \relax\unhbox#1\hfill
-%D \fi}
-%D
-%D \startcolumns[n=4]
-%D \dorecurse{25}{line \recurselevel\par}
-%D \stopcolumns
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D Here we also see an application of \type{\currentcolumn}:
-%D
-%D {\getbuffer}
-%D
-%D This feature is implemented using the reshape macros
-%D presented in \type{supp-box}.
-
-\def\postprocesscolumns
- {\ifx\postprocesscolumnline\undefined \else
- \dohandleallcolumns
- {\global\setbox\currentcolumnbox\vtop
- {\beginofshapebox
- \unvbox\currentcolumnbox
- \unskip\unskip
- \endofshapebox
- \reshapebox
- {\dimen0\ht\shapebox
- \dimen2\dp\shapebox
- \setbox\shapebox\hbox to \hsize
- {\postprocesscolumnline\shapebox}%
- \ht\shapebox\dimen0
- \dp\shapebox\dimen2
- \box\shapebox}%
- \flushshapebox
- \everypar\emptytoks
- \parskip\zeropoint % = \forgetall
- \verticalstrut
- \vskip-\struttotal
- \vfil}}%
- \fi
- \ifx\postprocesscolumnbox\undefined \else
- \dohandleallcolumns
- {\global\setbox\currentcolumnbox\hbox
- {\postprocesscolumnbox\currentcolumnbox}}
- \fi}
-
-%D We default to doing nothing!
-
-\let\postprocesscolumnline =\undefined
-\let\postprocesscolumnbox =\undefined
-\let\postprocesscolumnpagebox=\relax
-
-%D \macros
-%D {reversecolumnstrue}
-%D
-%D We can force the macro that takes care of combining
-%D the columns, to flush them in the revere order. Of
-%D course, by default we don't reverse.
-
-\newif\ifreversecolumns
-
-%D Here comes the simple splitting routine. It's a bit
-%D longer than expected because of ragging bottoms or not.
-%D This part can be a bit shorter but I suppose that I will
-%D forget what happens. The splitting takes some already
-%D present material (think of floats) into account!
-%D
-%D First we present some auxiliary routines. Any material,
-%D like for instance floats, that is already present in the
-%D boxes is preserved.
-
-\def\splitcolumn#1from \box#2to \dimen#3 top \box#4%
- {\bgroup
- \ifdim\ht#4>\zeropoint
- \dimen0\dimen#3\relax
- \dimen2\dimen0
- \advance\dimen0 -\ht#4%
- \columnfootnotecorrection{#1}{\dimen0}%
- \setbox0\vsplit#2 to \dimen0
- \global\setbox#1\vbox to \dimen2
- {\ifgridsnapping
- \dimen0-\openstrutheight
- \advance\dimen0 \topskip
- \vskip\dimen0\copy#4\vskip-\dimen0
- \else
- \unvcopy#4%
- \fi
- \fuzzysnappedbox\unvbox0
- \fakecolumnfootnotes{#1}}%
- \else
- \ifcase\clevernotes
- \global\setbox#1\vsplit#2 to \dimen#3%
- \global\setbox#1\vbox
- {\fuzzysnappedbox\unvbox{#1}}% % or \box ?
- \else
- \columnfootnotecorrection{#1}{\dimen#3}%
- \setbox0\vsplit#2 to \dimen#3%
- \global\setbox#1\vbox to \dimen#3%
- {\fuzzysnappedbox\unvbox0
- \fakecolumnfootnotes{#1}}%
- \fi
- \fi
- \egroup}
-
-\def\splitcurrentcolumn from \box#1to \dimen#2%
- {\splitcolumn\currentcolumnbox from \box#1 to \dimen#2 top \box\currenttopcolumnbox}
-
-\def\splitfirstcolumn from \box#1to \dimen#2%
- {\splitcolumn\firstcolumnbox from \box#1 to \dimen#2 top \box\firsttopcolumnbox}
-
-\def\splitlastcolumn from \box#1to \dimen#2%
- {\global\setbox\lastcolumnbox\vbox
- {\unvcopy\lasttopcolumnbox
- \fuzzysnappedbox\unvbox{#1}%
- \fakecolumnfootnotes\lastcolumnbox}}
-
-%D NEW: still to be documented.
-
-\def\fakecolumnfootnotes#1%
- {\relax
- \ifcase\clevernotes\else
- \ifnum#1=\lastcolumnbox
- \fakenotes
- \fi
- \fi}
-
-\def\columnfootnotecorrection#1#2%
- {\relax
- \ifcase\clevernotes
- % page notes
- \or
- \ifnum#1=\firstcolumnbox\relax
- \calculatetotalclevernoteheight
- \advance#2 -\totalnoteheight
- \fi
- \else
- \ifnum#1=\lastcolumnbox\relax
- \calculatetotalclevernoteheight
- \advance#2 -\totalnoteheight
- \fi
- \fi}
-
-\def\overlaycolumnfootnotes
- {\relax
- \ifcase\clevernotes
- % page notes
- \else
- \checknotepresence
- \ifnotespresent
- % the note box has the depth of the notefont
- % because a column (i.e. first column has no depth,
- % we need to anchor top down)
- \bgroup
- \ifcase\clevernotes\or
- \getmulticolumnlines
- \advance\nofcolumnlines \minustwo
- \scratchdimen\nofcolumnlines\lineheight
- \advance\scratchdimen \topskip
- \setbox0\hbox
- {\lower\scratchdimen\vbox{\placenoteinserts}}%
- \ht0=\openstrutheight % \strutht
- \dp0=\openstrutdepth % \strutdp
- \scratchdimen\ht\firstcolumnbox
- \global\setbox\firstcolumnbox\vbox to \scratchdimen
- {\box\firstcolumnbox
- \vskip-\scratchdimen
- \restoretextcolor{\box0}}%
- \else
- % maybe here also \getmulticolumnlines
- \scratchdimen\ht\firstcolumnbox
- \advance\scratchdimen -\openstrutdepth % \strutdp
- \getnoflines\scratchdimen
- \advance\noflines \minustwo
- \scratchdimen\noflines\lineheight
- \advance\scratchdimen \topskip
- \setbox0\hbox
- {\lower\scratchdimen\vbox{\placenoteinserts}}%
- \ht0=\openstrutheight % \strutht
- \dp0=\openstrutdepth % \strutdp
- \scratchdimen\ht\lastcolumnbox
- \global\setbox\lastcolumnbox\vbox to \scratchdimen
- {\box\lastcolumnbox
- \vskip-\scratchdimen
- \restoretextcolor{\box0}}%
- \fi
- \egroup
- \fi
- \fi}
-
-%D Here comes the routine that splits the long box in columns.
-%D The macro \type{\flushcolumnfloats} can be used to flush
-%D either floats that were present before the multi||column
-%D mode was entered, or floats that migrate to next columns.
-%D Flushing floats is a delicate process.
-
-\def\continuousmulticolumnsout
- {\bgroup
- \forgetall
- \setmulticolumnsout
- \dontshowcomposition
-% \dimen0=\columntextheight
-% \advance\dimen0 -\precolumnboxheight
-% \settotalinsertionheight
-% \advance\dimen0 -\totalinsertionheight
-% \ifgridsnapping % evt altijd, nog testen
-% \getnoflines{\dimen0}
-% \dimen0=\noflines\openlineheight
-% \fi
- \getmulticolumnlines
- \dimen0=\nofcolumnlines\openlineheight
- \dohandleallcolumns
- {\splitcurrentcolumn from \box\normalpagebox to \dimen0}%
- \setbox\restofpage\vbox{\unvbox\normalpagebox}%
- \ifinheritcolumns
- \ifr@ggedbottom % vreemd
- \dohandleallcolumns
- {\global\setbox\currentcolumnbox\vbox to \ht\firstcolumnbox
- {\dimen0\dp\currentcolumnbox
- \unvbox\currentcolumnbox
- \vskip-\dimen0
- \vskip\openstrutdepth % \strutdp
- \prevdepth\openstrutdepth % \strutdp
- \vfill}}%
- \ifbottomnotes \else
- \dimen0\ht\firstcolumnbox
- \fi
- \fi
- \ifn@rmalbottom
- \advance\dimen0 \maxdepth
- \dohandleallcolumns
- {\global\setbox\currentcolumnbox\vbox to \dimen0
- {\unvbox\currentcolumnbox}}%
- \fi
- \ifb@selinebottom
- % the columns are on top of the baseline
- \fi
- \else
- \dohandleallcolumns
- {\global\setbox\currentcolumnbox\vbox to \dimen0
- {\ifstretchcolumns
- \unvbox\currentcolumnbox
- \else
- \unvbox\currentcolumnbox % wel of niet \unvbox ?
- \vfill
- \fi}}%
- \dohandleallcolumns
- {\ht\currentcolumnbox\dimen0}% redundant
- \fi
- \setbox\precolumnbox\vbox{\flushcolumnedpage\zerocount}%
- \finaloutput\box\precolumnbox
- \sethsize
- \setvsize
- \flushcolumnfloats
- \unvbox\restofpage
- % \penalty\outputpenalty % gaat gruwelijk mis in opsommingen
- \egroup}
-
-%D And this is the balancing stuff. Again, part of the routine
-%D is dedicated to handling ragged bottoms, but here we also
-%D see some handling concerning the stretching of columns.
-%D We set \type{\widowpenalty} at~0, which enables us to
-%D balance columns with few lines. The use of \type{\box2} and
-%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
- \dontshowcomposition
- \widowpenalty\zerocount
- \setbox0\vbox{\unvbox\normalpagebox}%
-\ifdim\ht0>\openlineheight % at least one line
- \ifnum\minbalancetoplines<2 % balance anyway
- \donetrue
- \else % check criterium to available lines
- \getnoflines{\ht0}%
- \divide\noflines \nofcolumns \relax
- \ifnum\noflines<\minbalancetoplines \relax
- \dimen0\ht0
- \advance\dimen0 \ht\firsttopcolumnbox
- \advance\dimen0 \openlineheight \relax % let's play safe
- \ifdim\dimen0>\columntextheight % column exceeding text height
- \donetrue
- \else % it seems to fit
- \donefalse
- \fi
- \else % balance indeed
- \donetrue
- \fi
- \fi
-\else % balancing does not make sense
- \donefalse
-\fi
-\ifdone % start balancing
- %\ifdim\ht0>\openlineheight
- \dimen0\ht0
- \advance\dimen0 \topskip
- \advance\dimen0 -\baselineskip
- \dohandleallcolumns
- {\advance\dimen0 \ht\currenttopcolumnbox}%
- \divide\dimen0 \nofcolumns
- \vbadness\!!tenthousand\relax
- \count255=\zerocount
- \bgroup
- \ifgridsnapping
- \dimen2\lineheight
- \else
- \dimen2=\onepoint % RUBISH
- \dimen2=\spacingfactor\dimen2
- \fi
- \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>\multicolumnsbalancemax\relax
- \showmessage\m!columns7\empty
- \else
- \showmessage\m!columns8{\the\count255\space}%
- \fi
- \egroup
- \ifinheritcolumns
- % 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 % funny value
- \global\setbox\currentcolumnbox\vbox to \dimen0
- {\unvbox\currentcolumnbox
- \ifdim\dimen4>\dimen6
- \ifdim\dimen4<\dimen0
- \ifdim\dimen4>\dimen2
- \vskip\zeropoint % !!
- \else
- \vskip\openlineheight
- \vfill
- \fi
- \else
- \vskip\zeropoint
- \fi
- \else
- \vskip\openlineheight
- \vfill
- \fi}}%
- \else
- \bgroup
- \ifstretchcolumns
- \dimen0\ht\firstcolumnbox
- \dimen2=\bottomtolerance\ht\firstcolumnbox
- \setbox0\vbox{\unvcopy\lastcolumnbox}%
- \advance\dimen0 -\ht0\relax
- \advance\dimen0 -\dp0\relax
- \ifdim\dimen0>\openlineheight\relax
- \ifdim\dimen0>\dimen2\relax
- % \stretchcolumnsfalse % beter goed slecht dan slecht goed
- \showmessage\m!columns9\empty
- \fi
- \fi
- \fi
- \dohandleallcolumns
- {\global\setbox\currentcolumnbox\vbox to \ht\firstcolumnbox
- {\ifstretchcolumns
- \unvbox\currentcolumnbox
- \else
- \box\currentcolumnbox
- \vfill
- \fi}}%
- \egroup
- \fi
- \else
- % a one liner is not properly handled here, so best rewrite the text then
- \showmessage\m!columns{10}\empty
- \global\setbox\firstcolumnbox\vbox{\unvbox0}%
- \fi
- \global\output{\balancingerror}%
- \b@selinebottomtrue % forces depth in separation rule
- \flushcolumnedpage\plusone
- \multicolumnseject
- \egroup}
-
-\def\multicolumnseject
- {%\ifdim\pagetotal>\textheight
- % \eject % new, but wrong as fails on mixed-001.tex (wrong pagetotal at this point)
- %\else
- \allowbreak
- }%\fi}
-
-%D The multicolumn mechanism is incorporated in a \CONTEXT\
-%D interface, which acts like:
-%D
-%D \starttyping
-%D \startcolumns[n=4,balance=no]
-%D some text
-%D \stopcolumns
-%D \stoptyping
-%D
-%D The setup is optional. The default behaviour of columns
-%D can be set up with:
-%D
-%D \starttyping
-%D \setupcolumns
-%D [n=2,
-%D balance=yes]
-%D \stoptyping
-%D
-%D In this case, stretching is according to the way it's
-%D done outside columns (\type{\inheritcolumnstrue}). Also
-%D we can setup the \type{tolerance} within a column, the
-%D \type{distance} between columns and the fixed
-%D \type{height} of a column.
-
-%D Multi||column output: the float routines
-%D
-%D Here come the routines that handle the placement of column
-%D floats. Floats that are to big migrate to the next
-%D column. Floats that are too wide, migrate to the top of the
-%D next page, where they span as much columns as needed.
-%D Floats that are left over from outside the multi||column
-%D mode are flushed first. In macro \type{\finaloutput} the
-%D topfloats that are left from previous text should be set.
-%D
-%D When there are some floats in the queue, we inhibit the
-%D flushing of floats on top of columns. The number of
-%D waiting floats is preswent in \type{\savednoftopfloats} and
-%D is saved. As long as there are floats waiting, the topfloats
-%D are places as if we are outside multi||column mode. This is
-%D neccessary for e.g. multicolumn lists.
-%D
-%D When all those floats are flushed, we switch to the local
-%D flushing routine.
-
-\def\setcolumnfloats
- {\xdef\globalsavednoffloats{\the\savednoffloats}%
- \ifnum\globalsavednoffloats>\zerocount
- \setglobalcolumnfloats
- \else
- \setlocalcolumnfloats
- \fi}
-
-\def\setglobalcolumnfloats
- {\everypar\emptytoks
- \let\flushcolumnfloat\relax
- %\let\doroomfloat\relax
- \let\docheckiffloatfits\relax
- \let\flushcolumnfloats\noflushcolumnfloats}
-
-\def\setlocalcolumnfloats
- {\everypar{\flushnotes\flushcolumnfloat\flushmargincontents\checkindentation}%
- \let\flushcolumnfloat\doflushcolumnfloat
- %\let\doroomfloat\docolumnroomfloat
- \let\docheckiffloatfits\docolumnroomfloat
- \let\flushcolumnfloats\doflushcolumnfloats
- \let\doflushfloats\doflushcolumnfloats % new
- \let\dosetbothinserts\relax
- \let\dotopinsertions\relax}
-
-\def\noflushcolumnfloats
- {\bgroup
- \xdef\localsavednoffloats{\the\savednoffloats}%
- \global\savednoffloats\globalsavednoffloats
- \dotopinsertions
- \xdef\globalsavenoffloats{\the\savednoffloats}%
- \ifnum\globalsavednoffloats=\zerocount
- \setlocalcolumnfloats
- \fi
- \global\savednoffloats\localsavednoffloats
- \egroup}
-
-%D We need to calculate the amount of free space in a columns.
-%D When there is not enough room, we migrate the float to the
-%D next column. These macro's are alternatives (and
-%D look||alikes) of \type{\doroomfloat}. When a float is to
-%D wide, for one column, it is moved to the top of the next
-%D page. Of course such moved floats have to be taken into
-%D account when we calculate the available space. It's a pitty
-%D that such things are no integral part of \TEX.
-
-\def\getcolumnstatus\column#1\total#2\goal#3\\%
- {\dimen0=\ifdim\pagegoal<\maxdimen \pagetotal \else \zeropoint \fi
- \dimen2=\zeropoint
- \count255=\zerocount
- \dimen8=\columntextheight
- \advance\dimen8 -\precolumnboxheight
- \def\dogetcolumnstatus
- {\advance\count255 \plusone
- \advance\dimen2 \ht\currenttopcolumnbox
- \advance\dimen2 \dp\currenttopcolumnbox
- \dimen4\dimen2
- \advance\dimen4 \dimen0
- \dimen6=\count255\dimen8
- \ifdim\dimen4>\dimen6
- \else
- \let\dogetcolumnstatus\relax
- \fi}%
- \dohandleallcolumns{\dogetcolumnstatus}%
- \ifnum\count255=0 \count255=1 \fi
- #1=\count255
- #2=\dimen4
- #3=\dimen6 }
-
-\def\getinsertionheight
- {\ifdim\pagegoal<\maxdimen
- \bgroup
- \dimen0=\columntextheight
- \advance\dimen0 -\pagegoal
- \xdef\insertionheight{\the\dimen0}%
- \egroup
- \else
- \global\let\insertionheight\zeropoint
- \fi}
-
-\def\docolumnroomfloat
- {\ifpostponecolumnfloats
- \global\roomforfloatfalse
- \else\ifnofloatpermitted
- \global\roomforfloatfalse
- \else
- \bgroup
- \getcolumnstatus\column\count255\total\dimen0\goal\dimen2\\%
- \advance\dimen0 2\openlineheight % nog nodig ?
- %\ifnum\count255=\nofcolumns
- % \getinsertionheight
- % %\message{\insertionheight}\wait
- % \advance\dimen0 \insertionheight
- %\fi
- \setbox\scratchbox\vbox % tricky met objecten ?
- {\blank[\@@bkspacebefore]
- \snaptogrid\vbox{\copy\floatbox}}%
- \advance\dimen0 \ht\scratchbox
- \advance\dimen0 .5\lineheight % needed because goal a bit higher
- %\message{column: \the\count255; total: \the\dimen0; goal: \the\dimen2}\wait
- \ifdim\dimen0>\dimen2
- \global\roomforfloatfalse
- \else
- \global\roomforfloattrue
- \fi
- \ifdim\wd\floatbox>\hsize
- \showmessage\m!columns{11}\empty
- \global\roomforfloatfalse
- \fi
- \egroup
- \fi\fi}
-
-%D Flushing one float is done as soon as possible, i.e.
-%D \type{\everypar}. This means that (at the moment)
-%D sidefloats are not supported (overulled)!
-
-\newif\ifflushingcolumnfloats \flushingcolumnfloatstrue
-
-\def\doflushcolumnfloat
- {\ifpostponecolumnfloats\else\ifflushingcolumnfloats\ifprocessingverbatim\else\ifsomefloatwaiting
- \bgroup
- \forgetall
- \let\doflushcolumnfloat\relax
- \getcolumnstatus\column\mofcolumns\total\dimen0\goal\dimen2\\%
- \ifdim\dimen0>\zeropoint
- \dogetfloat
- \ifdim\wd\floatbox>\hsize
- \doresavefloat
- \else
- %\setbox2=\vbox
- % {\blank[\@@bkspacebefore]
- % \snaptogrid\vbox{\copy\floatbox}%
- % \blank[\@@bkspaceafter]
- \setbox2=\vbox
- {\blank[\@@bkspacebefore]
- \snaptogrid\vbox{\copy\floatbox}}%
- \advance\dimen0 \ht2
- \ifdim\dimen0>\dimen2
- \ifnum\mofcolumns<\nofcolumns
- \advance\mofcolumns \plusone
-%% bug %% \edef\currenttopcolumnbox{\getvalue{\@@topcol\the\count255}}%
- \ifdim\ht\currenttopcolumnbox=\zeropoint
- \global\setbox\currenttopcolumnbox\vbox
- {\snaptogrid\vbox{\copy\floatbox}
- \whitespace % nodig ?
- \blank[\@@bkspaceafter]}%
- \dimen4=\ht\currenttopcolumnbox
- \advance\dimen4 \dp\currenttopcolumnbox
- \global\advance\vsize -\dimen4
- \advance\dimen4 -\pagegoal
- \global\pagegoal-\dimen4
- \showmessage\m!columns{12}a%
- \else
- \showmessage\m!columns{12}b%
- \doresavefloat
- \fi
- \else
- \showmessage\m!columns{12}c%
- \doresavefloat
- \fi
- \else
- \ifhmode{\setbox0\lastbox}\fi% waar is die er in geslopen
- \par
- \ifdim\prevdepth<\zeropoint \else % anders bovenaan kolom witruimte
- \nobreak
- \blank[\@@bkspacebefore]
- \nobreak
- \fi
- \flushfloatbox
- \blank[\@@bkspaceafter]
- \fi
- \fi
- \fi
- \egroup
- \fi\fi\fi\fi}
-
-%D This one looks complicated. Upto \type{\nofcolumns} floats
-%D are placed, taking the width of a float into account. This
-%D routine can be improved on different ways:
-%D
-%D \startitemize[intro,packed]
-%D \item taking into account some imaginary baseline, just to
-%D get the captions in line
-%D \item multipass flushing until as many floats are displaced
-%D as possible
-%D \stopitemize
-%D
-%D When handling lots of (small) floats spacing can get worse
-%D because of lining out the columns.
-
-\def\doflushcolumnfloats
- {\ifpostponecolumnfloats\else
- \bgroup
- \forgetall
- \ifsomefloatwaiting
- \dimen8\zeropoint
- \dimen4\zeropoint
- \count0\zerocount % count0 can be used local
- \count2\nofcolumns % count2 can be used local
- \dohandleallcolumns
- {\ifnum\count0>\zerocount % the wide one's reserved space
- \global\setbox\currenttopcolumnbox\vbox
- {\snaptogrid\vbox
- {\copy\currenttopcolumnbox
- \hbox{\vphantom{\copy\floatbox}}}
- \whitespace % nodig ?
- \blank[\@@bkspaceafter]}%
- \else
- \dogetfloat
- \ifdim\wd\floatbox>\finalcolumntextwidth % better somewhere else too
- \global\setbox\floatbox\hbox to \finalcolumntextwidth{\hss\box\floatbox\hss}%
- \fi % otherwise the graphic may disappear
- \ifdim\wd\floatbox>\hsize
- \dimen0\wd\floatbox
- \advance\dimen0 \intercolumnwidth
- \dimen2\hsize
- \advance\dimen2 \intercolumnwidth
- \advance\dimen0 .5pt % hm, why 1
- \advance\dimen2 .5pt % hm, why 2
- \divide\dimen0 \dimen2
- \count0\dimen0
- \advance\count0 \plusone
- \ifnum\count0>\count2
- \doresavefloat
- \count0\zerocount
- \else
- \dimen0=\count0\hsize
- \advance\dimen0 \count0\intercolumnwidth
- \advance\dimen0 -\intercolumnwidth
- \global\setbox\floatbox\hbox to \dimen0
- %{\hss\hbox{\copy\floatbox}\hss}%
- {\processaction[\@@bklocation] % how easy to forget
- [ \v!left=>\copy\floatbox\hss,
- \v!right=>\hss\copy\floatbox,
- \s!default=>\hss\copy\floatbox\hss,
- \s!unknown=>\hss\copy\floatbox\hss]}%
- \fi
- \showmessage\m!columns{13}\empty
- \else
- % \showmessage\m!columns{13}\empty
- \fi
- \ifdim\ht\floatbox>\zeropoint\relax
- \global\setbox\currenttopcolumnbox\vbox
- {\snaptogrid\vbox
- {\copy\currenttopcolumnbox
- \copy\floatbox}
- \whitespace % nodig ?
- \blank[\@@bkspaceafter]}%
- \fi
- \dimen6\ht\currenttopcolumnbox
- \advance\dimen6 \dp\currenttopcolumnbox
- \fi
- \ifdim\dimen4<\ht\currenttopcolumnbox
- \dimen4\ht\currenttopcolumnbox
- \fi
- \advance\dimen8 \dimen6
- \advance\count2 \minusone
- \advance\count0 \minusone }%
- \setvsize
- \global\advance\vsize -\dimen8
- \global\pagegoal\vsize
- \else
- %\doflushfloats % does not snap!
- \fi
- \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
-%D One inprovement can be to normalize the height of floats
-%D to $n\times$\type{\lineheight} with a macro like:
-%D
-%D \starttyping
-%D \normalizevbox{...}
-%D \stoptyping
-
-% border case, should fit on one page
-%
-% \startcolumns
-%
-% 1 \input tufte \par \plaatsfiguur{}{\omlijnd[breedte=\hsize,hoogte=3cm]{1}}
-% 2 \input tufte \par \plaatsfiguur{}{\omlijnd[breedte=\hsize,hoogte=3cm]{2}}
-% 3 \input tufte \par \plaatsfiguur{}{\omlijnd[breedte=\hsize,hoogte=3cm]{3}}
-%
-% \stopcolumns
-
-\def\setupcolumns
- {\dosingleempty\dosetupcolumns}
-
-\def\dosetupcolumns[#1]%
- {\getparameters[\??kl][#1]%
- \nofcolumns\@@kln\relax
- \processaction
- [\@@klrule]
- [ \v!on=>\let\betweencolumns\linebetweencolumns,
- \v!off=>\let\betweencolumns\spacebetweencolumns,
- \s!default=>\let\betweencolumns\spacebetweencolumns,
- \s!unknown=>\let\betweencolumns\@@klrule]}
-
-\def\linebetweencolumns
- {\bgroup
- \starttextproperties
- \ifdim\@@kldistance>\zeropoint
- \dimen0=\@@kldistance
- \else
- \dimen0=\linewidth
- \fi
- \advance\dimen0 -\linewidth
- \hskip.5\dimen0
- \vrule
- \!!width\linewidth
- \ifb@selinebottom\!!depth\strutdepth\fi
- \hskip.5\dimen0\relax
- \stoptextproperties
- \egroup}
-
-\def\spacebetweencolumns
- {\hskip\@@kldistance}
-
-\presetlocalframed[\??kl]
-
-\def\backgroundfinishcolumnbox
- {\doifinsetelse\@@kloffset{\v!none,\v!overlay}
- {\let\@@kloffset\!!zeropoint}
- {\scratchdimen\@@kloffset
- \advance\scratchdimen -\@@klrulethickness
- \edef\@@kloffset{\the\scratchdimen}}%
- \localframed
- [\??kl]
- [\c!strut=\v!no,
- \c!width=\v!fit,
- \c!height=\v!fit,
- \c!align=]}
-
-\let\restorecolumnsettings\relax
-
-\definecomplexorsimpleempty\startcolumns
-
-\def\complexstartcolumns[#1]% %% \startcolumns
- {\bgroup
- \let\stopcolumns\egroup
- \ifinsidecolumns
- \else
- \setupcolumns[#1]%
- \ifnum\@@kln>1\relax
- \whitespace
- \begingroup
- \doif\@@kloption\v!background
- {\let\finishcolumnbox\backgroundfinishcolumnbox
- \let\columntextoffset\@@kloffset}%
- \ifx\@@klcommand\empty\else
- \let\postprocesscolumnline\@@klcommand
- \fi
- \doifelsenothing\@@klheight
- \heightencolumnsfalse
- \heightencolumnstrue
- \doifelse\@@kldirection\v!right
- \reversecolumnsfalse
- \reversecolumnstrue
- \doifelse\@@klbalance\v!yes
- \balancecolumnstrue
- \balancecolumnsfalse
-\installalign\v!yes {\stretchcolumnstrue \inheritcolumnsfalse}% todo: new key
-\installalign\v!no {\stretchcolumnsfalse\inheritcolumnsfalse}% todo: new key
-\installalign\v!text{\stretchcolumnsfalse\inheritcolumnstrue }%
-\stretchcolumnsfalse
-\inheritcolumnstrue
-\doifsomething\@@klalign{\expanded{\setupalign[\@@klalign]}}%
-% \processaction
-% [\@@klalign]
-% [ \v!yes=>\stretchcolumnstrue
-% \inheritcolumnsfalse,
-% \v!no=>\stretchcolumnsfalse
-% \inheritcolumnsfalse,
-% \v!text=>\stretchcolumnsfalse
-% \inheritcolumnstrue]%
- \nofcolumns=\@@kln
- %
- % probably more is needed, and how about nesting save's
- %
- \savecurrentblank
- \savecurrentwhitespace
- \def\restorecolumnsettings
- {\boxmaxdepth\maxdimen % done elsewhere
- \restorecurrentblank
- \restorecurrentwhitespace}%
- %
- \edef\fixedcolumnheight{\@@klheight}%
- \edef\minbalancetoplines{\@@klntop}%
- \setuptolerance[\@@kltolerance]% %% \startcolumns
- \setupblank[\@@klblank]%
- \ifdim\ctxparskip>\zeropoint\relax
- \setupwhitespace[\@@klblank]%
- \fi
- \def\stopcolumns
- {\endmulticolumns
- \global\insidecolumnsfalse
- \endgroup
- \egroup}%
- \global\insidecolumnstrue
- \beginmulticolumns
- \fi
- \fi}
-
-\installcolumnbreakhandler {MUL} \v!preference
- {\goodbreak}
-
-\installcolumnbreakhandler {MUL} \v!yes
- {\par % todo: since
- {\testrulewidth\zeropoint\ruledvskip\textheight}% we misuse a
- \penalty-200 % side effect
- \vskip-\textheight
- }% bugged : \prevdepth-\thousandpoint} % signals top of column to \blank
-
-%D New: only at start of columns; may change ! Rather
-%D interwoven and therefore to be integrated when the multi
-%D column modules are merged. (moved from cont-new.tex)
-
-\def\setupcolumnspan[#1]%
- {\getparameters[\??ks][#1]}
-
-\presetlocalframed
- [\??ks]
-
-\setupcolumnspan
- [\c!n=2,
- \c!offset=\v!overlay,
- \c!frame=\v!off]
-
-\newbox\columnspanbox \let\postprocesscolumnspanbox\gobbleoneargument
-
-\def\dostartcolumnspan[#1]%
- {\bgroup
- \setupcolumnspan[#1]%
- \forgetall
- \ifinsidecolumns
- \advance\hsize \intercolumnwidth
- \hsize\@@ksn\hsize
- \advance\hsize -\intercolumnwidth
- \fi
- \dowithnextbox
- {\setbox\columnspanbox\flushnextbox
- \ifinsidecolumns\wd\columnspanbox\hsize\fi
- \postprocesscolumnspanbox\columnspanbox
- \scratchdimen\ht\columnspanbox
- \setbox\columnspanbox\hbox % depth to be checked, probably option!
- {\localframed[\??ks][\c!offset=\v!overlay]{\box\columnspanbox}}%
- \ht\columnspanbox\scratchdimen
- \dp\columnspanbox\strutdp
- \wd\columnspanbox\hsize
- \ifinsidecolumns
- \ifnum\@@ksn>1
- \setvsize
- \dohandleallcolumns
- {\ifnum\currentcolumn>\@@ksn\else
- \global\setbox\currenttopcolumnbox=\vbox
- {\ifnum\currentcolumn=1
- \snaptogrid\vbox{\copy\columnspanbox}
- \else
- \snaptogrid\vbox{\vphantom{\copy\columnspanbox}}
- \fi}%
- \wd\currenttopcolumnbox\hsize
- \global\advance\vsize -\ht\currenttopcolumnbox
- \fi}
- \global\pagegoal\vsize
- \else
- \snaptogrid\vbox{\box\columnspanbox}
- \fi
- \else
- \snaptogrid\vbox{\box\columnspanbox}
- \fi
- \endgraf
- \ifvmode\prevdepth\strutdp\fi
- \egroup}
- \vbox\bgroup
- %\topskipcorrection % becomes an option !
- \EveryPar{\begstrut\EveryPar{}}} % also !
-
-\def\startcolumnspan
- {\dosingleempty\dostartcolumnspan}
-
-\def\stopcolumnspan
- {\egroup}
-
-\setupcolumns
- [\c!n=2,
- \c!ntop=1,
- \c!command=,
- \c!direction=\v!right,
- \c!rule=\v!off,
- \c!tolerance=\v!tolerant,
- \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\bodyfontsize]
-
-%D Undocumented and still under development.
-
-\def\startsimplecolumns
- {\dosingleempty\dostartsimplecolumns}
-
-\def\dostartsimplecolumns[#1]%
- {\bgroup
- \nopenalties
- \getparameters[\??kl]
- [\c!width=\hsize,\c!distance=1.5\bodyfontsize,%
- \c!n=2,\c!lines=0,#1]%
- \let\rigidcolumnlines\@@kllines
- \setrigidcolumnhsize\@@klwidth\@@kldistance\@@kln
- \setbox\scratchbox\vbox\bgroup
- \forgetall} % \blank[\v!disable]
-
-\def\stopsimplecolumns
- {\removebottomthings
- \egroup
- \rigidcolumnbalance\scratchbox
- \egroup}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/page-not.mkii b/Master/texmf-dist/tex/context/base/mkii/page-not.mkii
deleted file mode 100644
index 7bb9824307c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/page-not.mkii
+++ /dev/null
@@ -1,72 +0,0 @@
-%D \module
-%D [ file=page-nnt,
-%D version=2002.04.16,
-%D title=\CONTEXT\ Page Macros,
-%D subtitle=Footnotes,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 / Footnotes}
-
-%D Terrible hacks: we need to share save/restore
-
-%D We've moved some footnote handling to a separate page
-%D module. The macros below are used in the single and multi
-%D column page handlers and permit mixed usage of column and
-%D page notes.
-
-\unprotect
-
-\def\checkbegincolumnfootnotes % should happen inside otr
- {\ifcase\clevernotes
- \erasenotebackup
- \else
- \doflushnotes
- \savenotecontent
- \fi
- \savenotedata
- \checknotes}
-
-\def\checkendcolumnfootnotes
- {\restorenotedata % maybe better just \checknotes
- \ifcase\clevernotes\else
- \restorenotecontent
- \fi}
-
-\def\checksinglecolumnfootnotes
- {\checknotes} % njet : \restorenotedata
-
-\newdimen\totalinsertionheight
-
-\def\settotalinsertionheight
- {\calculatetotalnoteheight
- \totalinsertionheight\totalnoteheight
- \addinsertionheight\topins\to\totalinsertionheight
- \addinsertionheight\botins\to\totalinsertionheight}
-
-% hm
-
-\def\checkbegincolumnfootnotes % should happen inside otr
- {\ifcase\clevernotes
- \erasenotebackup
- \else
- \doflushnotes
- \savenotecontent
- \fi
- \savenotedata
- \checknotes}
-
-\def\checkendcolumnfootnotes
- {\restorenotedata
- \ifinsidecolumns
- \ifcase\clevernotes\else
- \restorenotecontent
- \fi
- \fi}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/page-one.mkii b/Master/texmf-dist/tex/context/base/mkii/page-one.mkii
deleted file mode 100644
index fe4b285cb91..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/page-one.mkii
+++ /dev/null
@@ -1,659 +0,0 @@
-%D \module
-%D [ file=page-one,
-%D version=2000.10.20,
-%D title=\CONTEXT\ Page Macros,
-%D subtitle=Default Routine,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 / Default Routine}
-
-%D This is just the good old \CONTEXT\ output routine, which
-%D has been there right from the start.
-
-\unprotect
-
-% OTRONE: basic single column
-
-\activateotr{ONE}{} % the default one
-
-\newtoks\OTRONEoutput
-
-\def\OTRONEgotonextpage
- {\ejectpage}
-
-\def\OTRONEgotonextpageX % will become obsolete
- {\superejectpage}
-
-\def\OTRONEsethsize
- {\global\hsize\textwidth}
-
-% keep (original one)
-%
-% \def\OTRONEsetvsize
-% {\ifdim\vsize=\teksthoogte \else
-% \bgroup
-% \scratchdimen-\vsize
-% \advance\scratchdimen \teksthoogte
-% \global\advance\vsize \scratchdimen
-% \relax \ifdim\pagegoal<\maxdimen
-% \advance\scratchdimen \pagegoal
-% \global\pagegoal\scratchdimen
-% \fi
-% \egroup
-% \fi}
-%
-% no (keep)
-%
-% \def\OTRONEsetvsize
-% {\ifdim\vsize=\teksthoogte \else
-% \bgroup
-% \scratchdimen-\vsize
-% \advance\scratchdimen \teksthoogte
-% \ifgridsnapping
-% \getrawnoflines\scratchdimen
-% \scratchdimen\noflines\openlineheight
-% \ifdim\scratchdimen>\noflinesheight % available afterwards
-% \advance\scratchdimen-\openlineheight
-% \fi
-% \ifdim\scratchdimen<\zeropoint
-% \scratchdimen\zeropoint
-% \fi
-% \fi
-% \global\advance\vsize \scratchdimen
-% \relax \ifdim\pagegoal<\maxdimen
-% \advance\scratchdimen \pagegoal
-% \global\pagegoal\scratchdimen
-% \fi
-% \egroup
-% \fi}
-
-% \def\OTRONEsetvsize
-% {\ifgridsnapping
-% \ifcase\layoutlines
-% \getrawnoflines\teksthoogte
-% \else
-% \noflines\layoutlines
-% \fi
-% \global\vsize\noflines\openlineheight
-% \else
-% \global\vsize\teksthoogte
-% \fi
-% \ifdim\pagegoal<\maxdimen
-% \global\pagegoal\vsize
-% \fi}
-
-\newdimen\oldvsize
-
-\def\OTRONEsetvsize
- {\ifgridsnapping
- \ifcase\layoutlines
- \getrawnoflines\textheight
- \else
- \noflines\layoutlines
- \fi
- \global\vsize\noflines\openlineheight
- \else
- \global\vsize\textheight
- \fi
- \ifdim\pagegoal<\maxdimen
- \ifdim\oldvsize=\vsize
- % let's assume that the layout didn't change
- \else
- \bgroup
- \global\oldvsize\vsize
- \advance\vsize-\topinserted
- \advance\vsize-\botinserted
- \global\pagegoal\vsize
- \egroup
- \fi
- \fi}
-
-\chardef\kindofpagetextareas=2 % whole page (public variable! never change)
-
-\def\OTRONEregisteredtextarea#1%
- {\ifregistertextareas
- \setbox0\vbox{#1}%
- \wd0\makeupwidth % somehow a space creeps in
- \vbox{\registeredtextarea000}%
- \else
- #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 (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
- \dotopinsertions
- \ifgridsnapping
- \OTRONEregisteredtextareaA{#1#2}%
- \vskip-\currentpagedepth\vskip\openstrutdepth
- \pushproperties % moved from just after #1#2
- \prevdepth\openstrutdepth
- \dobotinsertions
- \vfil
- \else\ifr@ggedbottom
- \OTRONEregisteredtextareaA{#1#2}%
- \vskip-\currentpagedepth\vskip\openstrutdepth
- \pushproperties % moved from just after #1#2
- \prevdepth\openstrutdepth
- \dobotinsertions
- \vfil
- \else\ifb@selinebottom
- \OTRONEregisteredtextareaA{#1#2}%
- \kern-\currentpagedepth\kern\maxdepth
- \pushproperties % moved from just after #1#2
- \dobotinsertions
- \else
- \OTRONEregisteredtextareaA{#1#2}%
- \pushproperties % moved from just after #1#2
- \dobotinsertions % added
- \fi\fi\fi
- \fakepagenotes}% was \fakenotes, but wrong! (check with \setupalign[height])
- \ifbottomnotes
- \ifgridsnapping
-\ifcase\layoutlines % todo: make macro of this
- \getrawnoflines\textheight
-\else
- \noflines\layoutlines
-\fi
-% \getnoflines\textheight
- \advance\noflines \minusone
- \scratchdimen\noflines\lineheight
- \advance\scratchdimen \topskip
- \else
- \scratchdimen\ht0
- \fi
- \else
- \scratchdimen\zeropoint
- \fi
- \setbox2\hbox
- {\checksinglecolumnfootnotes
- \lower\scratchdimen\vbox{\placebottomnotes}}%
- \smashbox2% % needed here
- \ifbottomnotes
- \ht0\zeropoint
- \fi
- \OTRONEregisteredtextareaB
- {\vbox to \textheight
- {\box0\box2\ifbottomnotes\else\vfill\fi}}%
- \egroup}
-
-\def\OTRONEfinalsidefloatoutput
- {\finaloutput\unvbox\normalpagebox}
-
-\OTRONEoutput
- {\sidefloatoutput}
-
-%D Insertions
-
-\newif\iftopofinsert
-
-% \def\OTRONEdosettopinserts
-% {\bgroup
-% \ifsomefloatwaiting
-% \noffloatinserts\zerocount
-% \let\totaltopinserted\!!zeropoint
-% \OTRONEdodosettopinserts
-% \ifnum\@@bknbottom=\zerocount
-% \ifnum\@@bknlines>\zerocount
-% \ifdim\totaltopinserted>\zeropoint\relax
-% \dimen0=\lineheight
-% \dimen0=\@@bknlines\dimen0
-% \advance\dimen0 \totaltopinserted\relax
-% \ifdim\dimen0>\textheight
-% \showmessage\m!floatblocks8\@@bknlines
-% \vfilll\eject
-% \fi
-% \fi
-% \fi
-% \fi
-% \fi
-% \egroup}
-
-\def\OTRONEdosettopinserts
- {\bgroup
- \ifsomefloatwaiting
- \noffloatinserts\zerocount
- \let\totaltopinserted\!!zeropoint
- \OTRONEdodosettopinserts
- \ifnum\@@bknbottom=\zerocount
- \ifnum\@@bknlines>\zerocount
- \ifdim\totaltopinserted>\zeropoint\relax
- \ifdim\dimexpr\@@bknlines\lineheight+\totaltopinserted\relax>\textheight
- \showmessage\m!floatblocks8\@@bknlines
- \vfilll\eject
- \fi
- \fi
- \fi
- \fi
- \fi
- \egroup}
-
-\def\OTRONEdodosettopinserts
- {\ifnum\noffloatinserts<\noftopfloats
- \dogetfloat
- \ifdim\topinserted=\zeropoint
- \topofinserttrue
- \else
- \topofinsertfalse
- \fi
- \global\advance\topinserted\dimexpr\ht\floatbox+\dp\floatbox+\floatbottomskip\relax
- \ifdim\topinserted<\textheight\relax
- \xdef\totaltopinserted{\the\topinserted}%
- \insert\topins
- {\forgetall
- \iftopofinsert
- \topskipcorrection % [xx] new: see icare topbleed
- \kern-\lineskip\par
- \prevdepth\maxdimen
- \else
- %\blank[-\@@bkspaceafter,\@@bkspacebefore]% inserts can't look back
- \betweenfloatblanko
- \fi
- \flushfloatbox
- \blank[\@@bkspaceafter]}%
- \ifsomefloatwaiting
- \advance\noffloatinserts \plusone
- \else
- \noffloatinserts\noftopfloats\relax
- \fi
- \dofloatflushedinfo
- \else
- \doresavefloat
- \noffloatinserts\noftopfloats\relax
- \fi
- \else
- \ifsomefloatwaiting
- \showmessage\m!floatblocks6{\the\noftopfloats}%
- \fi
- \let\OTRONEdodosettopinserts\relax
- \fi
- \OTRONEdodosettopinserts}
-
-\def\OTRONEdosetbotinserts
- {\bgroup
- \ifsomefloatwaiting
- \noffloatinserts\zerocount
- \OTRONEdodosetbotinserts
- \fi
- \egroup}
-
-\def\OTRONEdodosetbotinserts
- {\ifnum\noffloatinserts<\nofbotfloats\relax
- \dogetfloat
- \global\advance\botinserted \ht\floatbox\relax
- \global\advance\botinserted \dp\floatbox\relax
- \global\advance\botinserted \floattopskip\relax
- \ifdim\botinserted<\pagegoal\relax
- \insert\botins
- {\forgetall
- \blank[\@@bkspacebefore]%
- \flushfloatbox}%
- \ifsomefloatwaiting
- \advance\noffloatinserts \plusone
- \else
- \noffloatinserts\nofbotfloats
- \fi
- \dofloatflushedinfo
- \else
- \doresavefloat
- \noffloatinserts\nofbotfloats\relax
- \fi
- \global\nofloatpermittedtrue % vgl topfloats s!
- \else
- \ifsomefloatwaiting
- \showmessage\m!floatblocks7{\the\nofbotfloats}%
- \fi
- \let\OTRONEdodosetbotinserts\relax
- \fi
- \OTRONEdodosetbotinserts}
-
-\def\OTRONEdosetbothinserts
- {\global\topinserted\zeropoint
- \global\botinserted\zeropoint
- \ifflushingfloats \else
- \OTRONEdosettopinserts
- \OTRONEdosetbotinserts
- \ifsomefloatwaiting
- \doif\@@bkcache\v!no\doflushfloats
- \fi
- \fi}
-
-% \def\OTRONEdotopinsertions
-% {\ifvoid\topins\else
-% \ifgridsnapping
-% \box\topins
-% \vskip-\topskip \vskip\strutheight % [xx] new: see icare topbleed
-% \else
-% \unvbox\topins
-% \fi
-% \fi
-% \global\topinserted\zeropoint}
-
-\chardef\topinserttopskipmode=0 % 1 no topskip
-
-\def\OTRONEdotopinsertions
- {\ifvoid\topins\else
- \ifgridsnapping
- \box\topins
- \vskip-\topskip
- \vskip\strutheight % [xx] new: see icare topbleed
- \else
- \ifcase\topinserttopskipmode
- % 0: default, do nothing
- \or
- % 1: no topskip (crossed fingers)
- \vskip-\topskip
- \vskip\strutheight
- \fi
- \unvbox\topins
- \fi
- \fi
- \global\topinserted\zeropoint}
-
-\def\OTRONEdobotinsertions
- {\ifvoid\botins\else
- \ifgridsnapping
- \snaptogrid\hbox{\box\botins}%
- \else
- \unvbox\botins
- \fi
- \fi
- \global\botinserted\zeropoint
- \global\nofloatpermittedfalse}
-
-\def\OTRONEdoflushfloats
- {\global\flushingfloatstrue
- \ifsomefloatwaiting
- \par
- % if kept, then option and definitely off in gridmode ! ! ! !
- % \ifvmode \prevdepth\maxdimen \fi % prevents whitespace; problematic in icare tests
- \OTRONEdodoflushfloats
- \fi
- \global\savednoffloats\zerocount
- \global\somefloatwaitingfalse
- \global\flushingfloatsfalse}
-
-\def\OTRONEflushfloatbox % nog verder doorvoeren en meer info in marge
- {\ifcenterfloatbox \ifdim\wd\floatbox<\hsize
- \setbox\floatbox\hbox to \hsize{\hss\box\floatbox\hss}%
- \fi \fi
- \snaptogrid\hbox{\iftestfloatbox\ruledhbox\fi{\copy\floatbox}}}
-
-\def\OTRONEdodoflushfloats % much in common with OTRSET
- {\ifsomefloatwaiting
- \ifpackflushedfloats
- \centerfloatboxfalse
- \dogetfloat
- \ifdim\wd\floatbox>\makeupwidth
- \global\setbox\floatbox\hbox to \makeupwidth{\hss\box\floatbox\hss}%
- \fi
- \OTRONEsetvsize
- \!!widtha\wd\floatbox
- \dofloatflushedinfo
- \doloop
- {\ifsomefloatwaiting
- \dosavefloatstatus
- \dogetfloat
- \advance\!!widtha 1em % variable
- \advance\!!widtha \wd\floatbox\relax
- \ifdim\!!widtha>\hsize
- \dorestorefloatstatus
- \global\somefloatwaitingtrue
- \exitloop
- \else
- \global\setbox\floatbox\hbox
- {\ifcase\columndirection % nog document wide
- \ifvoid\savedfloatbox\else
- \ifhbox\savedfloatbox\unhbox\else\box\fi\savedfloatbox\hfil
- \fi
- \ifhbox\floatbox\unhbox\else\box\fi\floatbox
- \else
- \ifhbox\floatbox\unhbox\else\box\fi\floatbox
- \ifvoid\savedfloatbox\else
- \hfil\ifhbox\savedfloatbox\unhbox\else\box\fi\savedfloatbox
- \fi
- \fi}%
- \dofloatflushedinfo
- \fi
- \else
- \exitloop
- \fi}%
- \global\setbox\floatbox\hbox to \hsize
- {\hfil\ifhbox\floatbox\unhbox\else\box\fi\floatbox\hfil}%
- \else
- %\bgroup % \box\floatbox can be in use!? messy
- \dogetfloat
- %\doplacefloatbox
- %\egroup
- \dofloatflushedinfo
- \fi
- % there is a chance that due to rounding errors, the float
- % fits on a page where it was first rejected, in which case
- % the prevdepth is -maxdimen and we cannot obey the grid
- \doplacefloatbox
- \expandafter\OTRONEdodoflushfloats
- \fi}
-
-\def\OTRONEdocheckiffloatfits % vervangen ivm downward comp
- {\ifnofloatpermitted
- \global\roomforfloatfalse
- \else
- % new per 31/5/2004, should be an option, only one column mode
- \begingroup
- \scratchdimen\dimexpr\pagetotal+\lineheight\relax
- \ifdim\scratchdimen>\pagegoal
- \goodbreak % hack ? needed in icare-az
- \fi
- % should be an option
- \endgroup
- \dimen0\dimexpr\pagetotal+\ht\floatbox+\dp\floatbox+\floattopskip-\pageshrink\relax
- %\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\OTRONEflushsavedfloats
- {\dosetbothinserts}
-
-% TODO: TEST FIRST, NO CORRECTION NEEDED IN GRID MODE, EVT OPTION
-
-\def\OTRONEsomeherefloat[#1]% spacing between two successive must be better
- {\baselinecorrection % not really needed in grid mode:
- %\ifgridsnapping \else \baselinecorrection \fi % ! ! ! test test test ! ! ! !
- \doplacefloatbox
- \doinsertfloatinfo
- \dochecknextindentation\??bk
- \dorechecknextindentation}
-
-% \def\OTRONEsomefixdfloat % [#1]
-% {\docheckiffloatfits
-% \ifroomforfloat\else
-% \goodbreak
-% \fi
-% \showmessage\m!floatblocks9\empty
-% \someherefloat} % [#1]
-%
-% better:
-%
-% \dorecurse{50}
-% {[before normal] \input thuan
-% \placefigure{normal}{\framed[height=1cm,width=8cm]{}}
-% \placefigure{normal}{\framed[height=2cm,width=8cm]{}}
-% [before force] \input thuan
-% \placefigure[force]{force}{\framed[height=8cm,width=8cm]{}}}
-
-\chardef\fixedfloatmethod=3
-
-% \def\OTRONEsomefixdfloat % [#1]
-% {\docheckiffloatfits
-% \ifroomforfloat\else
-% \ifzeropt\pagetotal
-% % let's assume that there is room
-% \else
-% \ifcase\fixedfloatmethod
-% % disabled
-% \or % 1 (old method)
-% \goodbreak
-% \or % 2 (safe method)
-% \page
-% \or % 3 (keeps in stream)
-% \vskip\textheight
-% \vskip-\textheight
-% \or % 4 (also keeps in place)
-% \dosomebreak\nobreak
-% \fi
-% \fi
-% \fi
-% \showmessage\m!floatblocks9\empty
-% \someherefloat} % [#1]
-
-\def\OTRONEsomefixdfloat % [#1]
- {% there is (in mkii) no good way to prevent a break
- % so better fail than mess, we can get loose from
- % heads, so be it
- \showmessage\m!floatblocks9\empty
- \OTRONEsomeherefloat} % [#1]
-
-\def\OTRONEsomesidefloat[#1]% links, rechts NOG TESTEN EN AANPASSEN
- {\ifinsidecolumns
- \someelsefloat[\v!here]%
- \else
- %\checkwaitingfloats{#1}%
- \def\logsidefloat
- {\doinsertfloatinfo}%
- \setbox\floatbox\vbox{\box\floatbox}%
- \wd\floatbox\floatwidth
- \processfirstactioninset
- [#1]
- [ \v!left=>\leftfloat {\box\floatbox},
- \v!right=>\rightfloat {\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=>\cutspacefloat {\box\floatbox}]%
- \doifinset\v!tall{#1}\flushsidefloatsafterpar
- \fi}
-
-\def\OTRONEdosomepagefloat#1[#2]%
- {%\checkwaitingfloats{#1}%
- \global\setbox#1\vbox
- {\unvbox#1%
- \vbox to \textheight
- {\doifnotinset\v!high{#2}\vfill
- \box\floatbox
- \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
- \else
- \topofinsertfalse
- \fi
- \global\advance\topinserted \ht\floatbox
- \global\advance\topinserted \dp\floatbox
- \global\advance\topinserted \floatbottomskip
- \insert\topins
- {\forgetall
- \iftopofinsert
- \topskipcorrection % [xx] new: see icare topbleed
- \kern-\lineskip\par\prevdepth\maxdimen
- \else
- %\blank[-\@@bkspaceafter,\@@bkspacebefore]% inserts can't look back
- \betweenfloatblanko
- \fi
- \flushfloatbox
- \blank[\@@bkspaceafter]}%
- \doinsertfloatinfo}
-
-\def\OTRONEsomebotsfloat[#1]%
- {\global\advance\botinserted \ht\floatbox
- \global\advance\botinserted \dp\floatbox
- \global\advance\botinserted \floattopskip
- \insert\botins
- {\forgetall
- \blank[\@@bkspacebefore]%
- \flushfloatbox}%
- %\global\nofloatpermittedtrue
- \doinsertfloatinfo}
-
-\def\OTRONEsomefacefloat[#1]% untested
- {\startopposite\flushfloatbox\stopopposite}
-
-\def\OTRONEnextcolumn[#1]%
- {}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/page-par.mkii b/Master/texmf-dist/tex/context/base/mkii/page-par.mkii
deleted file mode 100644
index 9b5e0b6ebfa..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/page-par.mkii
+++ /dev/null
@@ -1,58 +0,0 @@
-%D \module
-%D [ file=page-par, % copied from page-lin
-%D version=1997.03.31,
-%D title=\CONTEXT\ Page Macros,
-%D subtitle=Line Numbering,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 / Paragraph Numbering}
-
-\unprotect
-
-\newcount\internalparagraphnumber
-
-\def\setupparagraphnumbering
- {\dosingleempty\dosetupparagraphnumbering}
-
-\def\dosetupparagraphnumbering[#1]%
- {\getparameters
- [\??ph][#1]%
- \processaction
- [\@@phstate]
- [\v!start=>\let\showparagraphnumber\doshowparagraphnumberA,
- \v!stop=>\let\showparagraphnumber\relax,
- \v!line=>\let\showparagraphnumber\doshowparagraphnumberB,
- \v!reset=>\global\internalparagraphnumber\zerocount
- \let\showparagraphnumber\doshowparagraphnumberA]}
-
-\def\dodoshowparagraphnumber
- {\global\advance\internalparagraphnumber \plusone
- \inleftmargin % \tf normalizes em
- {\tf{\doattributes\??ph\c!style\c!color{\the\internalparagraphnumber}}%
- \kern\@@phdistance}}
-
-\def\doshowparagraphnumberA
- {\ifprocessingverbatim
- \iflinepar\dodoshowparagraphnumber\fi
- \else
- \dodoshowparagraphnumber
- \fi}
-
-\def\doshowparagraphnumberB
- {\ifnumberinglines
- \doshowparagraphnumberA
- \fi}
-
-\setupparagraphnumbering
- [\c!state=\v!stop,
- \c!style=,
- \c!color=,
- \c!distance=\ifcase\linenumberlocation2em\else\!!zeropoint\fi] % will change
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/page-plg.mkii b/Master/texmf-dist/tex/context/base/mkii/page-plg.mkii
deleted file mode 100644
index 3c3255f4c70..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/page-plg.mkii
+++ /dev/null
@@ -1,202 +0,0 @@
-%D \module
-%D [ file=page-pls,
-%D version=2003.03.16,
-%D title=\CONTEXT\ Page Macros,
-%D subtitle=Page Setup,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Page 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\dimexpr-1\topskip+\strutheight\relax
- %
- \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}
- {\let\!!stringa\v!rightpage}
- {\let\!!stringa\v!leftpage}%
- \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}
- {\dodopagearea{#1}{#2}\c!righttext}
- {\dodopagearea{#1}{#2}\c!lefttext }%
- \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/mkii/page-run.mkii b/Master/texmf-dist/tex/context/base/mkii/page-run.mkii
deleted file mode 100644
index b128c192d87..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/page-run.mkii
+++ /dev/null
@@ -1,382 +0,0 @@
-%D \module
-%D [ file=page-run,
-%D version=2000.10.20,
-%D title=\CONTEXT\ Page Macros,
-%D subtitle=Runtime Macros,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 / Runtime Macros}
-
-\unprotect
-
-\gdef\doshowprint[#1][#2][#3]%
- {\framed
- [\c!offset=\v!overlay,
- \c!strut=\v!no]
- {\forgetall
- \dontcomplain
- \globaldefs\minusone
- \dimen0\pagegoal
- \definepapersize[X][\c!width=4em, \c!height=6em]%
- \definepapersize[Y][\c!width=12em,\c!height=14em]%
- \setuppapersize[#1,X][#2,Y]%
- \setuplayout[#3]%
- \setbox0\vbox
- {\framed
- [\c!offset=\v!overlay,\c!strut=\v!no,
- \c!width=\paperwidth,\c!height=\paperheight]
- {\ss ABC\par DEF}}%
- \doublesidedfalse
- \def\cutmarklength{.5em}%
- \addpagecutmarks0%
- \replicatepagebox0%
- \scalepagebox0%
- \mirrorpaperbox0%
- \orientpaperbox0%
- \centerpagebox0%
- \mirrorprintbox0%
- \orientprintbox0%
- \offsetprintbox0%
- \pagegoal\dimen0
- \box0}}
-
-\gdef\showprint
- {\dotripleempty\doshowprint}
-
-% \switchnaarkorps[8pt]
-%
-% \startcombinatie[4*4]
-% {\toonprint} {\strut}
-% {\toonprint[][][plaats=midden]} {\type{plaats=midden}}
-% {\toonprint[][][plaats=midden,markering=aan]} {\type{markering=aan}\break
-% \type{plaats=midden}}
-% {\toonprint[][][plaats=midden,markering=aan,nx=2]} {\type{markering=aan}\break
-% \type{plaats=midden}\break
-% \type{nx=2}}
-% {\toonprint[][][plaats=links]} {\type{plaats=links}}
-% {\toonprint[][][plaats=rechts]} {\type{plaats=rechts}}
-% {\toonprint[][][plaats={links,onder}]} {\type{plaats={links,onder}}}
-% {\toonprint[][][plaats={rechts,onder}]} {\type{plaats={rechts,onder}}}
-% {\toonprint[][][nx=2,ny=1]} {\type{nx=2,ny=1}}
-% {\toonprint[][][nx=1,ny=2]} {\type{nx=1,ny=2}}
-% {\toonprint[][][nx=2,ny=2]} {\type{nx=2,ny=2}}
-% {\toonprint[][][nx=2,ny=2,plaats=midden]} {\type{nx=2,ny=2}\break
-% \type{plaats=midden}}
-% {\toonprint[][][rugoffset=3pt]} {\type{rugoffset=.5cm}}
-% {\toonprint[][][kopoffset=3pt]} {\type{kopoffset=.5cm}}
-% {\toonprint[][][schaal=1.5]} {\type{schaal=1.5}}
-% {\toonprint[][][schaal=0.8]} {\type{schaal=0.8}}
-% \stopcombinatie
-%
-% \startcombinatie[3*4]
-% {\toonprint[liggend][][plaats=midden]} {\type{liggend}}
-% {\toonprint[][liggend][plaats=midden]} {\strut\break\type{liggend}}
-% {\toonprint[liggend][liggend][plaats=midden]} {\type{liggend}\break\type{liggend}}
-% {\toonprint[90][][plaats=midden]} {\type{90}}
-% {\toonprint[][90][plaats=midden]} {\strut\break\type{90}}
-% {\toonprint[90][90][plaats=midden]} {\type{90}\break\type{90}}
-% {\toonprint[180][][plaats=midden]} {\type{180}}
-% {\toonprint[][180][plaats=midden]} {\strut\break\type{180}}
-% {\toonprint[180][180][plaats=midden]} {\type{180}\break\type{180}}
-% {\toonprint[gespiegeld][][plaats=midden]} {\type{gespiegeld}}
-% {\toonprint[][gespiegeld][plaats=midden]} {\strut\break\type{gespiegeld}}
-% {\toonprint[gespiegeld][gespiegeld][plaats=midden]} {\type{gespiegeld}\break\type{gespiegeld}}
-% \stopcombinatie
-
-\gdef\doshowframe[#1][#2]%
- {\ifsecondargument
- \setupbackgrounds
- [\v!page]
- [\c!frame=\v!on,
- \c!corner=\v!rectangular,
- \c!frameoffset=\!!zeropoint,
- \c!framedepth=\!!zeropoint,
- \c!framecolor=layout:page]
- \setupbackgrounds
- [#1][#2]
- [\c!background=,
- \c!frame=\v!on,
- \c!corner=\v!rectangular,
- \c!frameoffset=\!!zeropoint,
- \c!framedepth=\!!zeropoint,
- \c!framecolor=]
- \else\iffirstargument
- \showframe
- [\v!header,\v!text,\v!footer]
- [#1]
- \else
- \showframe
- [\v!header,\v!text,\v!footer]
- [\v!leftedge,\v!leftmargin,
- \v!text,
- \v!rightmargin,\v!rightedge]
- \fi\fi
- \setupbackgrounds
- [\c!state=\v!repeat]}
-
-\gdef\showframe{\dodoubleempty\doshowframe}
-
-\gdef\showsetupA#1#2%
- {#1&\PtToCm{\the#2}&\the#2&\tttf\string#2\cr}
-
-\gdef\showsetupB#1#2#3%
- {#1&&#2#3&\tttf\string#3\cr}
-
-% \startinterface english % english is fallback
-
-\gdef\showsetups
- {\noindent
- \vbox
- {\forgetall
- \dontcomplain
- \switchtobodyfont[\v!small]
- \tabskip\zeropoint
- \halign
- {\strut##\quad\hss&##\quad\hss&##\quad\hss&##\hss\cr
- \showsetupA{paperheight} \paperheight
- \showsetupA{paperwidth} \paperwidth
- \showsetupA{printpaperheight} \printpaperheight
- \showsetupA{printpaperwidth} \printpaperwidth
- \showsetupA{topspace} \topspace
- \showsetupA{backspace} \backspace
- \showsetupA{height} \makeupheight
- \showsetupA{width} \makeupwidth
- \showsetupA{top} \topheight
- \showsetupA{topdistance} \topdistance
- \showsetupA{header} \headerheight
- \showsetupA{headerdistance} \headerdistance
- \showsetupA{textheight} \textheight
- \showsetupA{footerdistance} \footerdistance
- \showsetupA{footer} \footerheight
- \showsetupA{bottomdistance} \bottomdistance
- \showsetupA{bottom} \bottomheight
- \showsetupA{leftedge} \leftedgewidth
- \showsetupA{leftedgedistance} \leftedgedistance
- \showsetupA{leftmargin} \leftmarginwidth
- \showsetupA{leftmargindistance} \leftmargindistance
- \showsetupA{textwidth} \textwidth
- \showsetupA{rightmargindistance}\rightmargindistance
- \showsetupA{rightmargin} \rightmarginwidth
- \showsetupA{rightedgedistance} \rightedgedistance
- \showsetupA{rightedge} \rightedgewidth
- \showsetupB{bodyfontsize} \the \globalbodyfontsize
- \showsetupB{line} \relax \normallineheight
- \showsetupB{height} \relax \strutheightfactor
- \showsetupB{depth} \relax \strutdepthfactor
- \showsetupB{topskip} \relax \topskipfactor
- \showsetupB{maxdepth} \relax \maxdepthfactor}}}
-
-% \stopinterface
-
-\startinterface dutch
-
-\gdef\showsetups
- {\noindent
- \vbox
- {\forgetall
- \dontcomplain
- \switchtobodyfont[\v!small]
- \tabskip\zeropoint
- \halign
- {\strut##\quad\hss&##\quad\hss&##\quad\hss&##\hss\cr
- \showsetupA{papierhoogte} \papierhoogte
- \showsetupA{papierbreedte} \papierbreedte
- \showsetupA{printpapierhoogte} \printpapierhoogte
- \showsetupA{printpapierbreedte} \printpapierbreedte
- \showsetupA{kopwit} \kopwit
- \showsetupA{rugwit} \rugwit
- \showsetupA{snijwit} \snijwit
- \showsetupA{hoogte} \zethoogte
- \showsetupA{breedte} \zetbreedte
- \showsetupA{boven} \bovenhoogte
- \showsetupA{bovenafstand} \bovenafstand
- \showsetupA{hoofd} \hoofdhoogte
- \showsetupA{hoofdafstand} \hoofdafstand
- \showsetupA{teksthoogte} \teksthoogte
- \showsetupA{voetafstand} \voetafstand
- \showsetupA{voet} \voethoogte
- \showsetupA{onderafstand} \onderafstand
- \showsetupA{onder} \onderhoogte
- \showsetupA{linkerrand} \linkerrandbreedte
- \showsetupA{linkerrandafstand} \linkerrandafstand
- \showsetupA{linkermarge} \linkermargebreedte
- \showsetupA{linkermargeafstand} \linkermargeafstand
- \showsetupA{tekstbreedte} \tekstbreedte
- \showsetupA{rechtermargeafstand}\rechtermargeafstand
- \showsetupA{rechtermarge} \rechtermargebreedte
- \showsetupA{rechterrandafstand} \rechterrandafstand
- \showsetupA{rechterrand} \rechterrandbreedte
- \showsetupB{korps} \the \globalbodyfontsize
- \showsetupB{regel} \relax \normallineheight
- \showsetupB{hoogte} \relax \strutheightfactor
- \showsetupB{diepte} \relax \strutdepthfactor
- \showsetupB{boven} \relax \topskipfactor
- \showsetupB{onder} \relax \maxdepthfactor}}}
-
-\stopinterface
-
-% todo: \showsetupA{rugwit} \rugwit
-
-\startinterface german
-
-\gdef\showsetups%
- {\noindent
- \vbox
- {\forgetall
- \dontcomplain
- \switchtobodyfont[\v!small]
- \tabskip\zeropoint
- \halign
- {\strut##\quad\hss&##\quad\hss&##\quad\hss&##\hss\cr
- \showsetupA{papierhoehe} \papierhoehe
- \showsetupA{papierbreite} \papierbreite
- \showsetupA{printpapierhoehe} \printpapierhoehe
- \showsetupA{printpapierbreite} \printpapierbreite
- \showsetupA{kopfweite} \kopfweite
- \showsetupA{rumpfweite} \rumpfweite
- \showsetupA{hoehe} \satzhoehe
- \showsetupA{breite} \satzbreite
- \showsetupA{oben} \hoeheoben
- \showsetupA{abstandoben} \abstandoben
- \showsetupA{kopfzeile} \kopfzeilenhoehe
- \showsetupA{kopfzeilenabstand} \kopfzeilenabstand
- \showsetupA{texthoehe} \texthoehe
- \showsetupA{fusszeileabstand} \fusszeileabstand
- \showsetupA{fusszeilen} \fusszeilenhoehe
- \showsetupA{abstandunten} \abstandunten
- \showsetupA{hoeheunten} \hoeheunten
- \showsetupA{linkerrand} \breitelinkerrand
- \showsetupA{abstandlinkerrand} \abstandlinkerrand
- \showsetupA{linkemarginal} \linkemarginalbreite
- \showsetupA{linkemarginalafstand} \linkemarginalafstand
- \showsetupA{textbreite} \textbreite
- \showsetupA{rechtemarginalafstand}\rechtemarginalafstand
- \showsetupA{rechtemarginal} \rechtemarginalbreite
- \showsetupA{abstandrechterrand} \abstandrechterrand
- \showsetupA{rechterrand} \breiterechterrand
- \showsetupB{fliesstext} \the \globalbodyfontsize
- \showsetupB{linie} \relax \normallineheight
- \showsetupB{hoehe} \relax \strutheightfactor
- \showsetupB{tiefe} \relax \strutdepthfactor
- \showsetupB{topskip} \relax \topskipfactor
- \showsetupB{maxdepth} \relax \maxdepthfactor}}}
-
-\stopinterface
-
-\startinterface czech
-
-\gdef\showsetups%
- {\noindent
- \vbox
- {\forgetall
- \dontcomplain
- \switchtobodyfont[\v!small]
- \tabskip\zeropoint
- \halign
- {\strut##\quad\hss&##\quad\hss&##\quad\hss&##\hss\cr
- \showsetupA{vyskapapiru} \vyskapapiru
- \showsetupA{sirkapapiru} \sirkapapiru
- \showsetupA{vyskatiskpapiru} \vyskatiskpapiru
- \showsetupA{sirkatiskpapiru} \sirkatiskpapiru
- \showsetupA{hornimezera} \hornimezera
- \showsetupA{spodnimezera} \spodnimezera
- \showsetupA{vyska} \vyskasazby
- \showsetupA{breite} \sirkasazby
- \showsetupA{vyskatextu} \vyskatextu
- \showsetupA{sirkatextu} \sirkatextu
- \showsetupA{horejsek} \vyskahorejsku
- \showsetupA{vzdalenosthorejsku} \vzdalenosthorejsku
- \showsetupA{zahlavi} \vyskazahlavi
- \showsetupA{vzdalenostzahlavi} \vzdalenostzahlavi
- \showsetupA{fusszeileabstand} \vzdalenostupati
- \showsetupA{upati} \vyskaupati
- \showsetupA{vzdalenostspodku} \vzdalenostspodku
- \showsetupA{spodek} \vyakaspodku
- \showsetupA{levyokraj} \sirkalevehookraje
- \showsetupA{vzdalenostlevehookraje} \vzdalenostlevehookraje
- \showsetupA{levamarginalie} \sirkalevemarginalie
- \showsetupA{vzdalenostlevemarginalie} \vzdalenostlevemarginalie
- \showsetupA{vzdalenostpravemarginalie}\vzdalenostpravemarginalie
- \showsetupA{pravamarginalie} \sirkapravemarginalie
- \showsetupA{vzdalenostpravehookraje} \vzdalenostpravehookraje
- \showsetupA{pravyokraj} \sirkapravehookraje
- \showsetupB{zakladnivelikost} \the \globalbodyfontsize
- \showsetupB{linka} \relax \normallineheight
- \showsetupB{vyska} \relax \strutheightfactor
- \showsetupB{hloubka} \relax \strutdepthfactor
- \showsetupB{topskip} \relax \topskipfactor
- \showsetupB{maxdepth} \relax \maxdepthfactor}}}
-
-\stopinterface
-
-\startinterface romanian
-
-\gdef\showsetups%
- {\noindent
- \vbox
- {\forgetall
- \dontcomplain
- \switchtobodyfont[\v!small]
- \tabskip\zeropoint
- \halign
- {\strut##\quad\hss&##\quad\hss&##\quad\hss&##\hss\cr
- \showsetupA{paperheight} \paperheight
- \showsetupA{paperwidth} \paperwidth
- \showsetupA{printpaperheight} \printpaperheight
- \showsetupA{printpaperwidth} \printpaperwidth
- \showsetupA{topspace} \topspace
- \showsetupA{backspace} \backspace
- \showsetupA{height} \makeupheight
- \showsetupA{width} \makeupwidth
- \showsetupA{top} \topheight
- \showsetupA{topdistance} \topdistance
- \showsetupA{header} \headerheight
- \showsetupA{headerdistance} \headerdistance
- \showsetupA{textheight} \textheight
- \showsetupA{footerdistance} \footerdistance
- \showsetupA{footer} \footerheight
- \showsetupA{bottomdistance} \bottomdistance
- \showsetupA{bottom} \bottomheight
- \showsetupA{leftedge} \leftedgewidth
- \showsetupA{leftedgedistance} \leftedgedistance
- \showsetupA{leftmargin} \leftmarginwidth
- \showsetupA{leftmargindistance} \leftmargindistance
- \showsetupA{textwidth} \textwidth
- \showsetupA{rightmargindistance}\rightmargindistance
- \showsetupA{rightmargin} \rightmarginwidth
- \showsetupA{rightedgedistance} \rightedgedistance
- \showsetupA{rightedge} \rightedgewidth
- \showsetupB{bodyfontsize} \the \globalbodyfontsize
- \showsetupB{line} \relax \normallineheight
- \showsetupB{height} \relax \strutheightfactor
- \showsetupB{depth} \relax \strutdepthfactor
- \showsetupB{topskip} \relax \topskipfactor
- \showsetupB{maxdepth} \relax \maxdepthfactor}}}
-
-\stopinterface
-
-\gdef\showlayout % interfereert lelijk met een \typefile er na
- {\bgroup
- \page
- \showframe
- \setuplayout[\c!marking=\v!on]
- \dorecurse{4}{\showsetups\page}
- \egroup}
-
-\gdef\showmargins
- {\starttabulate
- \NC asynchrone \NC \doifoddpageelse {odd} {even} \NC \NR
- \NC synchrone \NC \doifrightpageelse {right} {left} \NC \NR
- \NC right margin \NC \the\rightmarginwidth \NC \NR
- \NC left margin \NC \the\leftmarginwidth \NC \NR
- \NC outer margin \NC \the\outermarginwidth \NC \NR
- \NC inner margin \NC \the\innermarginwidth \NC \NR
- \stoptabulate}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/page-set.mkii b/Master/texmf-dist/tex/context/base/mkii/page-set.mkii
deleted file mode 100644
index 3c8c87e5c40..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/page-set.mkii
+++ /dev/null
@@ -1,2781 +0,0 @@
-%D \module
-%D [ file=page-set,
-%D version=2000.10.20,
-%D title=\CONTEXT\ Page Macros,
-%D subtitle=Column Sets,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% getnoflines vs getrawnoflines
-
-% some day: cleanup and go etex
-
-\writestatus{loading}{ConTeXt Page Macros / Column Sets}
-
-% todo : last longer than previous
-% todo : block span over last column if footnotes
-% todo : diagnosis balancing run
-% todo : separate footnote placement
-% todo : go on on same page with colset
-% todo : test page areas per page
-% todo : leftmargin/rightmargin (better than afstand(1))
-
-% use the OTRSET layer for more purposes, like the footnotes !
-
-\unprotect
-
-\newcount\tofcolumns % total
-\newcount\lofcolumns % left
-\newcount\rofcolumns % right
-
-\newcount\columnfirstcell \columnfirstcell=1
-\newcount\columnlastcell
-\newcount\columnfreecells
-\newcount\currenthcell
-\newcount\currentvcell
-\newcount\columnhcells
-\newcount\columnvcells
-
-\newif\ifenoughcolumncells
-\newif\ifsomefreecolumncells
-\newif\ifcolumnspread
-\newif\iftracecolumnset % \tracecolumnsettrue
-
-\def\columnmaxcells {75} % runtime
-\def\columnmaxfreecells {0} % runtime
-\def\columngaplimit {0} % {5}
-
-\def\@otr@{otr}
-
-\def\OTRSETmakeupwidth{\innermakeupwidth}
-
-\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}
-
-\long\def\OTRSETdoifcellelse#1#2%
- {\relax\ifvoid\csname\@otr@:\number#1:\number#2\endcsname
- \@EA\secondoftwoarguments\else\@EA\firstoftwoarguments
- \fi}
-
-% The following two macros are used to compensate for a switch in body fonts
-% as in:
-%
-% \definecolumnset [two] [n=2,balancing=yes]
-% \definecolumnset [three] [n=3,balancing=yes]
-%
-% \setupcolumnsetlines[two][1][1][7]
-% \setupcolumnsetlines[two][1][2][10]
-%
-% \setupcolumnsetlines[three][1][1][40]
-% \setupcolumnsetlines[three][1][2][40]
-% \setupcolumnsetlines[three][1][3][40]
-%
-% \setupcolumnsetstart[three][1][1][15]
-% \setupcolumnsetstart[three][1][2][20]
-% \setupcolumnsetstart[three][1][3][20]
-%
-% \starttext
-% \startcolumnset [two] \dorecurse {1}{\input tufte \par} \stopcolumnset
-% \switchtobodyfont[small]
-% \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
-%D \setuplayout[height=middle,width=middle,grid=yes]
-%D
-%D \starttext
-%D \startcolumnset
-%D \dorecurse{10}
-%D {\input thuan \endgraf
-%D \bgroup
-%D \ss\restoreinterlinespace
-%D \dorecurse{3}{\input hawking \endgraf}
-%D \egroup
-%D \input bryson \endgraf}
-%D \stopcolumnset
-%D \stoptext
-%D \stoptyping
-
-\def\OTRSETsetcorrectnofcells#1%
- {\bgroup
- \!!counta#1\relax
- \ifdim\globalbodyfontsize=\localbodyfontsize
- \restoreinterlinespace
- \else
- \!!dimena-\!!counta\lineheight
- \restoreglobalbodyfont % slow, we need a fast one
- \advance\!!dimena\!!counta\lineheight
- \getnoflines\!!dimena
- \advance\!!counta\noflines
- \ifnum\!!counta<#1\else
- \!!counta#1\relax
- \fi
- \fi
- \relax % needed ! ! ! ! else lookahead over \fi and \@EA
- \@EA\egroup\@EA\scratchcounter\the\!!counta\relax}
-
-\def\OTRSETsetcorrectcellht
- {\bgroup
- \!!dimena-\strutht\relax
- \ifdim\globalbodyfontsize=\localbodyfontsize
- \restoreinterlinespace
- \else
- \restoreglobalbodyfont
- \fi
- \advance\!!dimena\strutht
- \relax % needed ! ! ! ! else lookahead over \fi and \@EA
- \@EA\egroup\@EA\scratchdimen\the\!!dimena\relax}
-
-\def\columnerasegridboxes % maybe dedicated loops
- {\bgroup
- \increment\columnmaxcells\relax
- \ifodd\realpageno
- \else % we are on the other page
- \columnspreadfalse
- \fi
- \ifcolumnspread
- \dorecurse\nofcolumns
- {\let\!!stringa\recurselevel
- \scratchcounter\recurselevel \advance\scratchcounter\lofcolumns
- \edef\!!stringb{\the\scratchcounter}%
- \dostepwiserecurse \zerocount \columnmaxcells \plusone
- {\ifcsname\@otr@:\!!stringa:\recurselevel\endcsname
- \global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname
- \ifcsname\@otr@:\!!stringb:\recurselevel\endcsname
- \box\csname\@otr@:\!!stringb:\recurselevel\endcsname
- %\global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname\box\csname\@otr@:\!!stringb:\recurselevel\endcsname
- \else
- \emptybox
- %\global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname\emptybox
- \expandafter\newbox\csname\@otr@:\!!stringb:\recurselevel\endcsname
- \fi
- \else
- \expandafter\newbox\csname\@otr@:\!!stringa:\recurselevel\endcsname
- \ifcsname\@otr@:\!!stringb:\recurselevel\endcsname
- \global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname\box\csname\@otr@:\!!stringb:\recurselevel\endcsname
- \else
- \expandafter\newbox\csname\@otr@:\!!stringb:\recurselevel\endcsname
- \fi
- \fi}}%
- \else
- \dorecurse \tofcolumns
- {\let\!!stringa\recurselevel
- \dostepwiserecurse \zerocount \columnmaxcells \plusone
- {\ifcsname\@otr@:\!!stringa:\recurselevel\endcsname
- \global\setbox\csname\@otr@:\!!stringa:\recurselevel\endcsname\emptybox
- \else
- \expandafter\newbox\csname\@otr@:\!!stringa:\recurselevel\endcsname
- \fi}}%
- \fi
- \dorecurse\tofcolumns
- {\global\setbox\csname\@otr@:\recurselevel:\columnmaxcells\endcsname\copy\placeholderboxa}%
- \global\columnfirstcell\zerocount
- \global\columnlastcell\columnfirstcell
- \global\columnfreecells\columnfirstcell
- \egroup}
-
-\def\doOTRSETsetgridcells#1#2#3#4#5#6% placeholder col row wid hei {data}
- {\!!countd#2\advance\!!countd#4\advance\!!countd\minusone
- \!!counte#3\advance\!!counte#5\advance\!!counte\minusone
- \dostepwiserecurse{#2}\!!countd\plusone
- {\!!countf\recurselevel
- \dostepwiserecurse{#3}\!!counte\plusone
- {\OTRSETsetgridcell\!!countf\recurselevel#1}}%
- \dostepwiserecurse{#3}\!!counte\plusone
- {\wd\OTRSETgridcell{#2}\recurselevel\hsize}%
- \OTRSETsetgridcell{#2}\!!counte#6}
-
-\def\OTRSETsetgridcells
- {\doOTRSETsetgridcells{\copy\placeholderboxb}}
-
-\def\OTRSETerasegridcells#1#2#3#4%
- {\doOTRSETsetgridcells{\emptybox}{#1}{#2}{#3}{#4}{\emptybox}}
-
-\def\setupcolumnsetlines{\doquintupleempty\dosetupcolumnsettrick[l]}
-\def\setupcolumnsetstart{\doquintupleempty\dosetupcolumnsettrick[s]}
-
-\def\dosetupcolumnsettrick[#1][#2][#3][#4][#5]% tag id page col value
- {% not needed, is already relative
- % \doifinstringelse{+}{#3}{\scratchcounter\realpageno}{\scratchcounter\zerocount}%
- % \advance\scratchcounter#3\relax % \relax needed
- % \setevalue{\??mc:#1:#2:\the\scratchcounter:\number#4}{\number#5}}
- \iffifthargument
- \setevalue{\??mc:#1:#2:\number#3:\number#4}{\number#5}%
- \else
- \setevalue{\??mc:#1:#2:\number#3:0}{\number#4}%
- \fi}
-
-\def\currentcolumnmaxcellstag #1{\??mc:l:\OTRSETidentifier:\columnsetpage:\number#1}
-\def\currentcolumnstartcelltag#1{\??mc:s:\OTRSETidentifier:\columnsetpage:\number#1}
-
-\def\doresetcolumnsetlines#1%
- {\ifcsname\currentcolumnmaxcellstag{#1}\endcsname
- \letgvalue{\currentcolumnmaxcellstag{#1}}\zerocount
- \fi
- \ifcsname\currentcolumnmaxcellstag{#1}\endcsname
- \letgvalue{\currentcolumnmaxcellstag{#1}}\zerocount
- \fi}
-
-\def\currentcolumnsomecells#1#2%
- {\ifcsname#1\mofcolumns\endcsname
- \ifnum\csname#1\mofcolumns\endcsname=\zerocount
- #2%
- \else
- \number\numexpr\ifnum\csname#1\mofcolumns\endcsname<\zerocount
- \columnmaxcells+\fi\csname#1\mofcolumns\endcsname\relax
- \fi
- \else\ifcsname#10\endcsname
- \ifnum\csname#10\endcsname=\zerocount
- #2%
- \else
- \number\numexpr\ifnum\csname#10\endcsname<\zerocount
- \columnmaxcells+\fi\csname#10\endcsname\relax
- \fi
- \else
- #2%
- \fi\fi}
-
-\def\currentcolumnmaxcells {\currentcolumnsomecells\currentcolumnmaxcellstag \columnmaxcells}
-\def\currentcolumnstartcell{\currentcolumnsomecells\currentcolumnstartcelltag\plusone}
-
-\def\OTRSETsetfreecells#1#2% col start
- {\bgroup
- \global\columnfirstcell\ifnum#2=0 1\else#2\fi\relax
- \OTRSETsetcorrectnofcells\currentcolumnmaxcells % sets \scratchcounter
- \edef\columnmaxcells{\the\scratchcounter}%
- \ifnum\columnfirstcell>\columnmaxcells
- \global\columnfreecells\zerocount
- \global\columnfirstcell\plusone
- \global\columnlastcell \zerocount
- \global\somefreecolumncellsfalse
- %\message{no cells a}%
- \else
- \doloop
- {\ifnum\columnfirstcell>\columnmaxcells\relax
- \exitloop
- \else
- \OTRSETdoifcellelse{#1}\columnfirstcell
- {\global\advance\columnfirstcell\plusone}\exitloop
- \fi}%
- \global\columnlastcell\columnfirstcell
- \doloop
- {\ifnum\columnlastcell>\columnmaxcells\relax
- \exitloop
- \else
- \OTRSETdoifcellelse{#1}\columnlastcell
- {\global\advance\columnlastcell \minusone \exitloop}
- {\global\advance\columnlastcell \plusone }%
- \fi}%
- \ifnum\columnfirstcell>\columnmaxcells
- \global\columnfreecells\zerocount
- \global\columnfirstcell\plusone
- \global\columnlastcell \zerocount
- \global\somefreecolumncellsfalse
- %\message{no cells b}%
- \else
- \ifnum\columnlastcell>\columnmaxcells
- \global\columnlastcell\columnmaxcells
- \fi
- \global\columnfreecells\columnlastcell
- \global\advance\columnfreecells -\columnfirstcell
- \global\advance\columnfreecells \plusone
- \global\somefreecolumncellstrue
- %\message{\number\columnfirstcell-\number\columnlastcell=\number\columnfreecells}%
- \fi
- \fi
- \egroup}
-
-\def\OTRSETgetmaxfreecells#1#2% col start
- {\let\columnmaxfreecells\!!zerocount
- \let\columnfrmfreecells\!!zerocount
- \pushmacro \columnmaxcells
-\OTRSETsetcorrectnofcells\currentcolumnmaxcells % sets \scratchcounter
-\edef\columnmaxcells{\the\scratchcounter}%
- \scratchcounter\zerocount
- \dostepwiserecurse{#2}\columnmaxcells\plusone
- {\OTRSETdoifcellelse{#1}\recurselevel
- {\ifnum\columnmaxfreecells<\scratchcounter
- \edef\columnmaxfreecells{\the\scratchcounter}%
- \let\columnfrmfreecells\recurselevel
- \fi
- \scratchcounter\zerocount}
- {\advance\scratchcounter\plusone}}%
- \popmacro\columnmaxcells}
-
-\long\def\OTRSETrecurseRL#1%
- {\dostepwiserecurse\nofcolumns\plusone\minusone
- {#1\hskip\OTRSETgetparameter\c!distance\recurselevel}}
-
-\def\OTRSETmakegridbox
- {\ifcase\columndirection
- \OTRSETdomakegridbox\plusone\nofcolumns\plusone
- \else
- \OTRSETdomakegridbox\nofcolumns\plusone\minusone
- \fi}
-
-\def\OTRSETmakeupwidth{\makeupwidth} % temporary indirectness
-
-\def\OTRSETdomakegridbox#1#2#3%
- {\hbox\bgroup
- \dontcomplain
- \forgetall % can go once in \flush
- \!!heighta \textheight
- % test first !
- \hbox to \OTRSETmakeupwidth
- {\dostepwiserecurse{#1}{#2}{#3}
- {\mofcolumns\recurselevel
- \localcolumnwidth\OTRSETlocalwidth\mofcolumns
- \setbox\scratchbox\hbox\localframed
- [\??mc\OTRSETidentifier\number\mofcolumns]%
- [\c!width=\localcolumnwidth,\c!height=\!!heighta,\c!lines=]%
- {}%
- \wd\scratchbox\localcolumnwidth
- \ht\scratchbox\!!heighta
- \ifcase\columndirection
- \hskip\OTRSETgetparameter\c!distance\recurselevel
- \box\scratchbox
- \else
- \box\scratchbox
- \hskip\OTRSETgetparameter\c!distance\recurselevel
- \fi}}%
- \hskip-\OTRSETmakeupwidth
- % main text
- \hbox to \OTRSETmakeupwidth
- {\dostepwiserecurse{#1}{#2}{#3}
- {\mofcolumns\recurselevel
- \localcolumnwidth\OTRSETlocalwidth\mofcolumns
- \offinterlineskip
- \setbox\scratchbox\vbox to \!!heighta
- {\topskipcorrection % not needed
- \ifcase\OTRSETbalancemethod
- % no
- \or
- % yes
- \doifelselayerdata{OTRTEXT}\vfill\relax % temp hack
- \or
- % top
- \or
- % bottom
- \vfill
- \fi
- \dorecurse\columnmaxcells
- {\setbox\scratchbox\hbox{\OTRSETgetgridcell\mofcolumns\recurselevel}%
-% {\setbox\scratchbox\hbox
-% {\localstarttextcolor
-% \OTRSETgetgridcell\mofcolumns\recurselevel
-% \localstoptextcolor}%
- \ht\scratchbox\strutht
- \dp\scratchbox\strutdp
- \ifcase\columndirection
- \box\scratchbox
- \else
- \hbox to \localcolumnwidth
- {\hskip\localcolumnwidth\llap{\box\scratchbox}}%
- \fi
- \par}%
- \ifcase\OTRSETbalancemethod
- % no
- \else
- % yes, top, bottom
- \ifdim\globalbodyfontsize=\localbodyfontsize
- \removedepth
- \restoreglobalbodyfont
- \vskip\strutdepth
- \fi
- \kern\zeropoint
- \vss
- \fi}%
- \wd\scratchbox\localcolumnwidth % \textwidth
- \ifcase\columndirection
- \hskip\OTRSETgetparameter\c!distance\recurselevel\box\scratchbox
- \else
- \box\scratchbox\hskip\OTRSETgetparameter\c!distance\recurselevel
- \fi}}%
- \egroup}
-
-\let\OTRSETbalht\zeropoint
-
-\def\OTRSETreducegridbox % for the moment no difference between methods
- {\globallet\OTRSETbalht\zeropoint
- \ifcase\OTRSETbalancemethod
- % no balancing
- \else
- \bgroup
- \!!counta\columnmaxcells
- \donetrue
- \doloop
- {\dorecurse\nofcolumns{\OTRSETdoifcellelse\recurselevel\!!counta\donefalse\donothing}%
- \ifdone
- \ifnum\!!counta>\plusone\advance\!!counta\minusone\else\exitloop\fi
- \else
- \exitloop
- \fi}%
- \ifnum\!!counta>\plusone
- \!!heighta\lineheight
- \multiply\!!heighta \!!counta
- \advance\!!heighta \topskip
- \advance\!!heighta -\lineheight
- \else
- \!!heighta\zeropoint
- \fi
- \xdef\OTRSETbalht{\the\!!heighta}%
- \egroup
- \fi}
-
-\def\OTRSETflushfinalfootnotes
- {\ifcase\lastcolumnlastcell \else
- \setbox\scratchbox\hbox
- {\placebottomnotes}%
- \ifdim\ht\scratchbox>\zeropoint
- \setbox\scratchbox\hbox
- {\hbox to \zeropoint{\OTRSETgetgridcell\nofcolumns\lastcolumnlastcell}%
- \box\scratchbox}%
- \ht\scratchbox\strutht
- \dp\scratchbox\strutdp
- \OTRSETsetgridcell\nofcolumns\lastcolumnlastcell\box\scratchbox
- \fi
- \global\lastcolumnlastcell\zerocount
- \fi}
-
-\def\OTRSETdoflush
- {\ifcollectingcontent
- \registerOTRSETmarks
- \global\mofcolumns\plusone
- \else
- \OTRSETdofinalflush
- \OTRSETdofinaloutput
- \ifnum\columnsetpage>0
- \dorecurse\nofcolumns{\doresetcolumnsetlines\recurselevel}%
- \fi
- \doglobal\increment\columnsetpage
- \OTRSETinitializecolumns
- %\OTRSETdoflushfloats
- \OTRSETstartnextpage
-\presetOTRSETmarks
- \initializecolumntextareas
- \fi}
-
-\newbox\OTRfinalpagebox
-
-\def\OTRSETdofinalflush % see \OTRSETdoflush
- {\OTRSETflushfinalfootnotes
- \placecolumntextareas
- \OTRSETcentergridcells
- \bgroup % we want to keep the reduction local
- \OTRSETreducegridbox
- \global\setbox\OTRfinalpagebox\OTRSETmakegridbox
- \egroup % otherwise we get the wrong number of free cells
- %\gdef\localcolumnmaxcells{0}% here ?
- \global\mofcolumns\nofcolumns} % otherwise problems in finaloutput
-
-\def\OTRSETdofinaloutput
- {\ifdim\ht\OTRfinalpagebox=\textheight
- \bgroup % \let\OTRSETsetvsize\relax % prevents useless search for gap
- \ifcase\OTRSETbalancemethod
- \finaloutput\box\OTRfinalpagebox
- \else\ifdim\OTRSETbalht>\zeropoint
- % catch a bordercase
- \scratchdimen\OTRSETbalht
- \advance\scratchdimen\lineheight\relax
- \ifdim\scratchdimen>\textheight
- % full page
- \finaloutput\box\OTRfinalpagebox
- \else
- % same page
- \global\setbox\OTRfinalpagebox \iftracecolumnset\ruledvbox\else\vbox\fi to \OTRSETbalht
- {\box\OTRfinalpagebox\vss}%
- \setlayer[OTRTEXT]{\box\OTRfinalpagebox}%
- \snaptogrid\vbox{\vskip\OTRSETbalht}% hack
- \fi
- \else
- \finaloutput\box\OTRfinalpagebox
- \fi \fi
- \globallet\OTRSETbalht\zeropoint
- \egroup
- \fi}
-
-\definesystemvariable {mc}
-\definesystemvariable {mt}
-\definesystemconstant {colset}
-
-\definetwopasslist\s!colset
-
-\newdimen \OTRSETtextswidth
-\newdimen \OTRSETtextsheight
-\let \OTRSETidentifier=\empty
-
-\newtoks \OTRSEToutput
-
-\def\OTRSETgetparameter#1#2{\csname\??mc\OTRSETidentifier\number#2#1\endcsname}
-\def\OTRSETsetparameter#1#2{\setvalue{\??mc\OTRSETidentifier\number#2#1}}
-
-\def\OTRSETskipstart
- {\scratchcounter\executeifdefined{\??mc\OTRSETidentifier\c!start}\zerocount
- \relax % needed !
- \ifcase\scratchcounter\else
- \advance\scratchcounter\plusone
- \doOTRSETsetgridcells
- {\copy\placeholderboxe}
- \plusone\plusone\nofcolumns\scratchcounter
- \null
- \fi}
-
-\def\OTRSETsetvsize % snap per sectie (gap here?)
- {\ifcollectingcontent \else % can be assigndimen
-\OTRSETskipstart % not that well tested
- \OTRSETcheckinsert % added
- \OTRSETsetfreecells\mofcolumns\columnfirstcell
- \ifsomefreecolumncells
- \global\vsize\columnfreecells\lineheight
- \ifinotr % else problems with floats, see extreme
- \global\pagegoal\vsize % niet nodig, tenzij binnen otr
- \fi
- \synchronizeoutput % fails on example
- % \allowbreak % hm
- \fi
- \synchronizenotes
- \fi}
-
-\def\OTRSETsethsize % of course this does not migrate outside the otr
- {\localcolumnwidth\OTRSETlocalwidth\mofcolumns
- \textwidth\localcolumnwidth
- \hsize\localcolumnwidth}
-
-\def\OTRSETsynchronizehsize
- {\ifcase0\getvalue{\??mc\??mc\c!width}\else % some width set
- \bgroup
- \scratchdimen\OTRSETlocalwidth\mofcolumns
- \ifdim\scratchdimen=\textwidth
- \egroup
- \else
- % only if change in width and \column/\break
- \egroup \OTRSETsethsize
- \fi
- \fi}
-
-\def\OTRSETcheckfreelines
- {\OTRSETsetvsize}
-
-\def\doOTRSETcolumnseparator
- {\hbox to \zeropoint{\hss\red\vl\hss}}
-
-\let\OTRSETcolumnseparator\relax
-
-\def\showbreaks
- {\let\OTRSETcolumnseparator\doOTRSETcolumnseparator}
-
-% \installcolumnbreakhandler {SET} \v!ja
-% {% hmmm:
-% \ifhmode
-% \bgroup
-% \removeunwantedspaces
-% \parfillskip\zeropoint
-% \OTRSETcolumnseparator
-% \par
-% \egroup
-% \fi
-% % brrr:
-% \ejectinsert
-% \ejectpage
-% \OTRSETsynchronizehsize} % no \OTRSETsethsize, can be mid smaller (like tabulate)
-%
-% \installcolumnbreakhandler {SET} \v!forceer
-% {\OTRSETgotocolumn[\v!forceer]}
-% \installcolumnbreakhandler {SET} \v!eerste
-% {\OTRSETgotocolumn[\v!eerste]}
-% \installcolumnbreakhandler {SET} \v!laatste
-% {\OTRSETgotocolumn[\v!laatste]}
-%
-% \installcolumnbreakhandler {SET} \v!pagina
-% {\simplepagebreak % \flushnotes \executepagebreakhandler\v!ja
-% \ifnum\mofcolumns>\plusone
-% \OTRSETgotocolumn[\v!laatste,\v!forceer]%
-% \fi}
-
-\def\OTRSETcolumnhbreak
- {\ifhmode
- \bgroup
- \removeunwantedspaces
- \parfillskip\zeropoint
- \OTRSETcolumnseparator
- \par
- \egroup
- \fi}
-
-\installcolumnbreakhandler {SET} \v!local
- {\OTRSETcolumnhbreak
- \ejectinsert
- \ejectpage % brrr
- % no \OTRSETsethsize, can be mid smaller (like tabulate)
- % also, this one should be executed at the outer level
- % (setting hsize inside otr does not work)
- \OTRSETsynchronizehsize}
-
-% We need to make sure that we really leave the column; mid
-% column we may end up in an empty gap, and we don't want to
-% stay there (basically such a gap is a small empty page
-% then).
-
-\installcolumnbreakhandler {SET} \v!yes
- {\OTRSETcolumnhbreak
- \edef\savedmofcolumns{\the\mofcolumns}%
- \edef\savedrealpageno{\the\realpageno}%
- \ejectinsert
- \ejectpage % brrr
- \doloop
- {\ifnum\savedmofcolumns=\mofcolumns
- \ifnum\savedrealpageno=\realpageno
- \OTRSETdummycolumn
- \else
- \exitloop
- \fi
- \else
- \exitloop
- \fi}%
- \OTRSETsynchronizehsize}
-
-\installcolumnbreakhandler {SET} \s!unknown
- {\expanded{\OTRSETgotocolumn[\@@columnspecification]}}
-
-\installcolumnbreakhandler {SET} \v!page
- {\vfill\eject % \doejectpage\eject
- \OTRSETgotonextpage}
-
-\newtoks\OTRSETeverystartofcolumn
-
-\newbox\OTRSETsavedfootnotes
-
-% \installoutput\OTRSETflushtextsofar % spacing goes wrong
-
-%\def\OTRSETflushtextsofar
-% {\ifvoid\normalpagebox \else
-% \setbox\scratchbox\vbox{\unvbox\normalpagebox}%
-% \OTRSETsavenotes
-% \OTRSEThandleflushedtext0
-% \fi}
-
-% The complication is in the fact that when the HERE float
-% is placed, the otr is not invoked when there is not yet
-% enough content; this can lead to a change in order (turning
-% on the tracer with option 0 is very instructive, watch the
-% small numbers in the margin)
-%
-% 0 = no flushing, so no interference but user should handle
-% border cases of placement
-% 1 = the normal otr, rather untested
-% 2 = a solution that works ok, is experimental and above
-% all messy
-
-\chardef\OTRSETflushtextmode=0
-
-\def\OTRSETflushtextsofar
- {\ifcase\OTRSETflushtextmode
- % don't mess around
- \or
- % the normal one
- \ifvoid\normalpagebox\else
- \OTRSETnaturalflush
- \OTRSETcheckfreelines
- \fi
- \or
- % way to complicated, but kind of ok
- \doOTRSETflushtextsofar
- \fi}
-
-\newskip\lastskipinotr
-
-\installoutput\doOTRSETflushtextsofar % experimental
- {\ifvoid\normalpagebox\else
- \scratchdimen\dp\normalpagebox
- \setbox\scratchbox\vbox
- {\forgetall
- \unvbox\normalpagebox
- \global\lastskipinotr\lastskip\relax
- \ifdim\lastskipinotr>\zeropoint\relax
- \removelastskip
- \else
- \kern-\scratchdimen % handle depth
- \fi}%
- \ifdim\lastskipinotr>\zeropoint
- \scratchskip\ht\scratchbox
- \setbox\scratchbox\hbox
- {\lower\strutdepth\box\scratchbox}%
- \dp\scratchbox\scratchdimen
- \ht\scratchbox\scratchskip
- \fi
- \OTRSETsavenotes
- \OTRSEThandleflushedtext\zerocount
- \ifdim\lastskipinotr>\zeropoint
- %\vskip \lastskipinotr % hm, gets lost anyway
- \else
- % we should not discard skips after here; tricky
- \fi
- \OTRSETsetvsize
- \fi}
-
-\def\OTRSETplacebottomnotes
- {\iflastcolumnfootnotes
- \ifnum\nofcolumns=\mofcolumns
- \ifintermediatefootnotes \placebottomnotes \fi
- \fi
- \else
- \placebottomnotes
- \fi}
-
-\def\OTRSETflushsavednotes
- {\iflastcolumnfootnotes
- \ifnum\nofcolumns=\mofcolumns
- \flushsavednotes
- \fi
- \else
- \flushsavednotes
- \fi}
-
-\def\OTRSETsavenotes
- {\iflastcolumnfootnotes
- \ifnum\nofcolumns=\mofcolumns \else
- \savenotes
- \fi
- \fi}
-
-\appendtoks \OTRSETflushsavednotes \to \OTRSETeverystartofcolumn
-
-\def\OTRSETnaturalflush
- {\bgroup
- \forgetall % new, needed !
- \setbox0\vbox to \columnfreecells\lineheight
- {\vskip-\topskip
- \vskip\lineheight
- \prevdepth\strutdp
- \unvbox\normalpagebox
- \vfill}%
- \setbox2\hbox
- {\OTRSETplacebottomnotes}%
- \setbox\scratchbox\hbox
- {\wd0\zeropoint\box0\box2}%
- \dp\scratchbox\strutdp
- \OTRSEThandleflushedtext\plusone
- \egroup}
-
-\newcount\lastcolumnlastcell
-
-\def\OTRSEThandleflushedtext#1%
- {\getnoflines{\ht\scratchbox}%
- %\wd\scratchbox\textwidth % geen \hsize kan < zijn in bv split tabulate
- \wd\scratchbox\OTRSETlocalwidth\mofcolumns
- \doOTRSETsetgridcells
- {\copy\placeholderboxf}
- \mofcolumns\columnfirstcell\plusone\noflines
- {\registeredtextarea1\columnfirstcell\scratchbox}% == \hbox / tricky htcorr == \columnfirstcell
- \global\columnlastcell\columnfirstcell
- \global\advance\columnlastcell \noflines
- \global\lastcolumnlastcell\columnlastcell
- \global\advance\lastcolumnlastcell \minusone
- % find next (acceptable) gap, todo: deadcycle
- \ifcase#1\else
- \OTRSETfillgapsbetweencells\mofcolumns\columnlastcell
- \fi
- \OTRSETfindnextgap
- % \message{\the\mofcolumns,\the\columnfirstcell,\the\columnfreecells}%
- % \wait
- % we cannot adapt the hsize since it may have changed (like
- % inside a tabulate) so we only change it when there is a
- % reason to do so
- \OTRSETsynchronizehsize
- \OTRSETsetvsize}
-
-\def\OTRSETfindnextgap
- {\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
- \global\columnlastcell\plusone
- \global\columnfirstcell\zerocount
- \OTRSETdoflushfloats
- \else
- \the\OTRSETeverystartofcolumn
- \global\columnlastcell\plusone
- \global\columnfirstcell\zerocount
- \fi
- \fi}
-
-\let\OTRSETcheckfreelines\donothing
-
-\def\OTRSETfillgapsbetweencells#1#2% col
- {\ifnum\columngaplimit>\zerocount
- \donefalse
- \dostepwiserecurse{#2}\columnmaxcells\plusone
- {\OTRSETdoifcellelse{#1}\recurselevel
- {\ifdone
- \!!countb\recurselevel \advance\!!countb -\!!counta\relax
- \ifnum\!!countb>\plusone
- \advance\!!countb \minusone
- \ifnum\!!countb<\columngaplimit\relax
- \!!countb\recurselevel \advance\!!countb \minusone
- \dostepwiserecurse\!!counta\!!countb\plusone
- {\OTRSETsetgridcell{#1}\recurselevel\copy\placeholderboxc}%
- %\message{[gap]}%
- \fi
- \fi
- \fi
- \donefalse}
- {\ifdone \else
- \donetrue
- \!!counta\recurselevel
- \fi}}%
- \fi}
-
-\appendtoks
- \OTRSETfillgapsbetweencells\mofcolumns\plusone
-\to \OTRSETeverystartofcolumn
-
-%\def\OTRSETfreezeminimumgap#1%
-% {\OTRSETgetmaxfreecells{#1}{1}%
-% \ifnum\columnmaxfreecells>0
-% \!!countb=\columnfrmfreecells
-% \!!counta=\!!counta \advance\!!counta -\columnmaxfreecells
-% \dorecurse{\columnmaxcells}
-% {\ifnum\recurselevel<\!!counta\relax
-% \donetrue
-% \else\ifnum\recurselevel>\!!countb
-% \donetrue
-% \else
-% \donefalse
-% \fi\fi
-% \ifdone
-% \OTRSETdoifcellelse{#1}{\recurselevel}
-% {}{\OTRSETsetgridcell{#1}\recurselevel\copy\placeholderboxc}%
-% \fi}%
-% \fi}
-%
-%\def\OTRSETfillgaps#1#2#3% col from to
-% {\dostepwiserecurse{#2}{#3}{1}
-% {\OTRSETdoifcellelse{#1}{\recurselevel}
-% {}{\OTRSETsetgridcell{#1}\recurselevel\copy\placeholderboxc}}}
-%
-%\def\OTRSETfillbotgaps#1#2% col first
-% {\OTRSETfillgaps{#1}{#2}{\columnmaxcells}}
-%
-%\def\OTRSETfilltopgaps#1#2% col last
-% {\OTRSETfillgaps{#1}{1}{#2}}
-
-\newif\ifspancolumnslots \spancolumnslotstrue
-\newif\ifcheckcolumnspan \checkcolumnspantrue
-
-\def\OTRSETcheckwidthgap#1#2% box size
- {\ifcheckcolumnspan
- \bgroup
- \scratchdimen#2%
- \advance\scratchdimen-\wd#1\relax
- \ifdim-10\scaledpoint>\scratchdimen
- \egroup
- \else\ifdim10\scaledpoint<\scratchdimen
- \egroup
- \else
- \egroup
- \wd#1=#2%
- \fi\fi
- \fi}
-
-\def\OTRSETcheckcolumnslot#1%
- {\enoughcolumncellstrue
- \ifspancolumnslots\else
- \OTRSETcheckwidthgap#1\hsize
- \ifdim\wd#1>\hsize
- \enoughcolumncellsfalse
- \fi
- \fi
- \ifenoughcolumncells
- \getnoflines\pagetotal
- \scratchcounter\noflines
- \getnoflines{\ht#1}%
- \columnvcells\noflines
- \columnhcells\plusone
- \advance\scratchcounter \columnvcells \relax
- \ifnum\scratchcounter>\columnfreecells
- \enoughcolumncellsfalse
- \fi
- \fi}
-
-\def\OTRSETstoreincolumnslotPAGE#1%
- {\ifenoughcolumncells
- % to do
- \OTRSETsavebox{#1}%
- \else
- \OTRSETsavebox{#1}%
- \fi}
-
-\def\OTRSETstoreincolumnslotTOPS#1%
- {\OTRSETprepareforcolumnslot1{#1}%
- \OTRSETcheckcolumnslot{#1}%
- \ifenoughcolumncells
- \OTRSETcheckcolumnspace\mofcolumns\columnfirstcell{#1}%
- \fi
- \ifenoughcolumncells
- \OTRSETsetgridcells\mofcolumns\columnfirstcell\columnhcells\columnvcells
- {\hbox{\copy#1}}%
- \OTRSETsetvsize
- \else
- \OTRSETsavebox{#1}%
- \fi}
-
-\def\OTRSETstoreincolumnslotBOTS#1%
- {\OTRSETprepareforcolumnslot3{#1}%
- \edef\savedcolumnlastcell{\the\columnlastcell}%
- \OTRSETcheckcolumnslot{#1}%
- \ifenoughcolumncells
- \advance\columnlastcell -\columnvcells \advance\columnlastcell \plusone
-% \OTRSETcheckcolumnspace\mofcolumns\columnfirstcell{#1}%
- \OTRSETcheckcolumnspace\mofcolumns\columnlastcell{#1}%
- \fi
- \ifenoughcolumncells
- \OTRSETsetgridcells\mofcolumns\columnlastcell\columnhcells\columnvcells{\copy#1}%
- \OTRSETfillgapsbetweencells\mofcolumns\savedcolumnlastcell % -)
- \OTRSETsetvsize
- \else
- \columnlastcell\savedcolumnlastcell
- \OTRSETsavebox{#1}%
- \fi}
-
-\newdimen\totalcolumnspace
-
-\def\columnspacetopoffset{0}
-\def\columnspacebotoffset{0}
-
-\def\OTRSETcheckcolumnspace#1#2#3% col row box
- {\columnhcells\plusone
- \totalcolumnspace\zeropoint
- \scratchcounter#1%
- \enoughcolumncellstrue
- \doloop
- {\advance\totalcolumnspace \OTRSETlocalwidth\scratchcounter\relax % needed
-\OTRSETcheckwidthgap#3\totalcolumnspace
- \ifnum\wd#3>\totalcolumnspace\relax
- \ifnum\scratchcounter=\nofcolumns
- \enoughcolumncellsfalse
- \exitloop
- \else
- \advance\columnhcells \plusone
- \advance\scratchcounter \plusone
- \advance\totalcolumnspace \OTRSETgetparameter\c!distance\scratchcounter
- \fi
- \else
- \exitloop
- \fi}%
- \ifenoughcolumncells
- \getnoflines{\ht#3}%
- \columnvcells\noflines
- \OTRSETcheckcolumncells{#1}{#2}\columnhcells\columnvcells
- \fi}
-
-\def\OTRSETcheckcolumncells#1#2#3#4% col row wid hei
- {\!!countd#1\advance\!!countd#3\advance\!!countd\minusone
- \!!counte#2\advance\!!counte#4\advance\!!counte\minusone
- \ifnum\!!counte>\columnmaxcells\relax
- \enoughcolumncellsfalse
- \else
- \enoughcolumncellstrue
-%\let\columnspacetopoffset\zerocount
-%\scratchcounter#2\advance\scratchcounter\minusone
-%\ifnum\scratchcounter>0
-% \dostepwiserecurse{#1}\!!countd\plusone
-% {\ifdim\wd\OTRSETgridcell\recurselevel\scratchcounter>\zeropoint
-% \let\columnspacetopoffset\plusone
-% \else\ifdim\dp\OTRSETgridcell\recurselevel\scratchcounter>\zeropoint
-% \let\columnspacetopoffset\plusone
-% \fi\fi}%
-% \advance\!!counte \columnspacetopoffset \relax
-% \advance\columnvcells \columnspacetopoffset \relax
-%\fi
-%\let\columnspacebotoffset\zerocount
-%\scratchcounter\!!counte
-%\advance\scratchcounter \columnvcells \relax
-%\ifnum\scratchcounter>\columnmaxcells\else
-% \dostepwiserecurse{#1}\!!countd\plusone
-% {\ifdim\wd\OTRSETgridcell\recurselevel\scratchcounter>\zeropoint
-% \let\columnspacebotoffset\plusone
-% \else\ifdim\dp\OTRSETgridcell\recurselevel\scratchcounter>\zeropoint
-% \let\columnspacebotoffset\plusone
-% \fi\fi}%
-% \advance\!!counte \columnspacebotoffset \relax
-% \advance\columnvcells \columnspacebotoffset \relax
-%\fi
- \dostepwiserecurse{#1}\!!countd\plusone % cols
- {\ifenoughcolumncells
- \!!countf\recurselevel\relax
- \dostepwiserecurse{#2}\!!counte\plusone % rows
- {\ifenoughcolumncells
- \OTRSETdoifcellelse\!!countf\recurselevel
- {\enoughcolumncellsfalse}{}%
- \fi}%
- \fi}%
- \fi}
-
-\def\OTRSETsetpreferedcolumnslot#1#2%
- {\doifsomething{#1}{\edef\preferedcolumn{#1}}%
- \doifsomething{#2}{\edef\preferedrow {#2}}}
-
-\OTRSETsetpreferedcolumnslot{\nofcolumns}{1} % default ?
-
-\let\pofcolumns\mofcolumns
-\let\qofcolumns\mofcolumns
-
-\newif\ifquitincurrentcolumn
-
-\def\OTRSETstoreincolumnslotLRTB#1%
- {\OTRSETprepareforcolumnslot1{#1}%
- \OTRSETflushtextsofar
- \OTRSETstoreincolumnslotindeed
- \mofcolumns\nofcolumns+\currenthcell
- \plusone\columnmaxcells+\currentvcell{#1}}
-
-\def\OTRSETstoreincolumnslotLRBT#1%
- {\OTRSETprepareforcolumnslot3{#1}%
- \OTRSETflushtextsofar
- \OTRSETstoreincolumnslotindeed
- \mofcolumns\nofcolumns+\currenthcell
- \columnmaxcells\plusone-\currentvcell{#1}}
-
-\def\OTRSETstoreincolumnslotRLTB#1%
- {\OTRSETprepareforcolumnslot1{#1}%
- \OTRSETflushtextsofar
- \OTRSETcheckprefered
- \OTRSETstoreincolumnslotindeed
- \nofcolumns\qofcolumns-\currenthcell
- \plusone\columnmaxcells+\currentvcell{#1}}
-
-\def\OTRSETstoreincolumnslotRLBT#1%
- {\OTRSETprepareforcolumnslot3{#1}%
- \OTRSETflushtextsofar
- \OTRSETcheckprefered
- \OTRSETstoreincolumnslotindeed
- \nofcolumns\qofcolumns-\currenthcell
- \columnmaxcells\plusone-\currentvcell{#1}}
-
-\def\OTRSETstoreincolumnslotTBLR#1%
- {\OTRSETprepareforcolumnslot1{#1}%
- \OTRSETflushtextsofar
- \OTRSETstoreincolumnslotindeed
- \plusone\columnmaxcells+\currentvcell
- \mofcolumns\nofcolumns+\currenthcell{#1}}
-
-\def\OTRSETstoreincolumnslotTBRL#1%
- {\OTRSETprepareforcolumnslot1{#1}%
- \OTRSETflushtextsofar
- \OTRSETcheckprefered
- \OTRSETstoreincolumnslotindeed
- \plusone\columnmaxcells+\currentvcell
- \nofcolumns\qofcolumns-\currenthcell{#1}}
-
-\def\OTRSETstoreincolumnslotBTLR#1%
- {\OTRSETprepareforcolumnslot3{#1}%
- \OTRSETflushtextsofar
- \OTRSETstoreincolumnslotindeed
- \columnmaxcells\plusone-\currentvcell
- \mofcolumns\nofcolumns+\currenthcell{#1}}
-
-\def\OTRSETstoreincolumnslotBTRL#1%
- {\OTRSETprepareforcolumnslot3{#1}%
- \OTRSETflushtextsofar
- \OTRSETcheckprefered
- \OTRSETstoreincolumnslotindeed
- \columnmaxcells\plusone-\currentvcell
- \nofcolumns\qofcolumns-\currenthcell{#1}}
-
-\def\OTRSETstoreincolumnslotFXTB#1% fixed column
- {\OTRSETcheckprefered
- \OTRSETdoifcellelse\pofcolumns\plusone
- {\OTRSETprepareforcolumnslot2}{\OTRSETprepareforcolumnslot1}{#1}% % 1/2 dependent of place, todo
- \OTRSETflushtextsofar
- \OTRSETstoreincolumnslotindeed
- \pofcolumns \pofcolumns +\currenthcell
- \preferedrow\columnmaxcells+\currentvcell{#1}}
-
-\def\OTRSETstoreincolumnslotFXBT#1% fixed column
- {\OTRSETcheckprefered
- \OTRSETdoifcellelse\pofcolumns\columnmaxcells
- {\OTRSETprepareforcolumnslot2}{\OTRSETprepareforcolumnslot3}{#1}% % 3/2 dependent of place, todo
- \OTRSETflushtextsofar
- \OTRSETstoreincolumnslotindeed
- \pofcolumns \pofcolumns +\currenthcell
- \columnmaxcells\preferedrow-\currentvcell{#1}}
-
-% \def\OTRSETstoreincolumnslotHERE#1% fixed column
-% {\OTRSETprepareforcolumnslot2{#1}%
-% \OTRSETflushtextsofar
-% \getnoflines\pagetotal \advance\noflines\columnfirstcell
-% \OTRSETstoreincolumnslotindeed
-% \mofcolumns\mofcolumns+\currenthcell
-% \noflines\columnmaxcells+\currentvcell{#1}%
-% \OTRSETsetvsize}
-
-\chardef\OTRSETforcefixedfloats=0
-
-\def\OTRSETstoreincolumnslotHERE#1% fixed column
- {\ifcase\OTRSETforcefixedfloats
- \OTRSETstoreincolumnslotSOMEWHERE2{#1}%
- \else
- \OTRSETstoreincolumnslotFIXD{#1}%
- \fi}
-
-% this one looses too wide graphics
-%
-% \def\OTRSETstoreincolumnslotFIXD#1% fixed column
-% {\OTRSETprepareforcolumnslot2{#1}%
-% % no flush text sofar here, beware: no width test
-% \snaptogrid\vbox{\box#1}}
-%
-% still imperfect
-
-\def\OTRSETstoreincolumnslotFIXD#1% fixed column
- {\OTRSETflushtextsofar
- \ifdim\wd#1>\textwidth
- \OTRSETstoreincolumnslotSOMEWHERE2{#1}%
- \else
- % crappy test / needed for o-pbu-f / will be replaced
- \getnoflines{\ht#1}%
- \scratchdimen\noflines\lineheight
- \advance\scratchdimen\lineheight
- \advance\scratchdimen\pagetotal\relax
- \ifdim\scratchdimen<\pagegoal
- %OTRSETprepareforcolumnslot3{#1}%
- %ruledvskip\columnslotspacing\lineheight
- \blank[\columnslotspacing*\v!line]%
- \snaptogrid\hbox to \hsize{\hss\box#1\hss}% strange, why the centering
- \blank[\columnslotspacing*\v!line]%
- \else
- \OTRSETstoreincolumnslotSOMEWHERE2{#1}%
- \fi
- \fi}
-
-\def\OTRSETstoreincolumnslotSOMEWHERE#1#2%
- {\OTRSETprepareforcolumnslot{#1}{#2}%
- \OTRSETflushtextsofar
- \getnoflines\pagetotal \advance\noflines\columnfirstcell
- \OTRSETstoreincolumnslotindeed
- \mofcolumns\mofcolumns+\currenthcell
- \noflines\columnmaxcells+\currentvcell{#2}%
- \OTRSETsetvsize}
-
-\def\OTRSETcheckprefered
- {\ifnum\preferedcolumn<\mofcolumns
- \let\pofcolumns\mofcolumns
- \else
- \let\pofcolumns\preferedcolumn
- \fi
- \ifquitincurrentcolumn
- \ifnum\mofcolumns=\nofcolumns
- \def\qofcolumns{\mofcolumns}%
- \else
- \scratchcounter\mofcolumns
- \advance\scratchcounter \plusone
- \edef\qofcolumns{\the\scratchcounter}%
- \fi
- \else
- \let\qofcolumns\mofcolumns
- \fi}
-
-\def\OTRSETstoreincolumnslotindeed#1#2#3#4#5#6#7#8#9%
- {\OTRSETcheckprefered
- \enoughcolumncellsfalse
- \donefalse
- \dostepwiserecurse{#1}{#2}{#31}
- {\ifdone
- \exitloop
- \else
- #4=\recurselevel
- \dostepwiserecurse{#5}{#6}{#71}
- {\ifdone
- \exitloop
- \else
- #8=\recurselevel
- \OTRSETcheckcolumnspace\currenthcell\currentvcell{#9}%
- \ifenoughcolumncells \donetrue \fi
- \fi}%
- \fi}%
- \ifdone
- \enoughcolumncellstrue
- \else
- \enoughcolumncellsfalse
- \fi
- \ifenoughcolumncells
-% \ifnum\columnspacetopoffset>0\message{[+++]}\fi
-% \ifnum\columnspacebotoffset>0\message{[---]}\fi
-% \OTRSETsetgridcells\currenthcell\currentvcell\columnhcells\columnvcells
-% {\vbox
-% {\ifcase\columnspacetopoffset\else\ruledvskip\columnspacetopoffset\lineheight\fi
-% \copy#9
-% \ifcase\columnspacebotoffset\else\ruledvskip\columnspacebotoffset\lineheight\fi}}%
- \OTRSETsetgridcells\currenthcell\currentvcell\columnhcells\columnvcells
- {\copy#9}%
- \ifnum\currenthcell=\mofcolumns\relax
- \ifdim\ht\OTRSETsavedfootnotes>\zeropoint
- \OTRSETsetfreecells\mofcolumns\columnfirstcell
- \ifsomefreecolumncells
- \getnoflines{\ht\OTRSETsavedfootnotes}\relax
- \ifnum\columnfreecells<\noflines
- \global\somefreecolumncellsfalse
- \else
- %\message{[flt]}% float
- \fi
- \fi
- \ifsomefreecolumncells
- % ok, enough room for notes
- %\message{[flt]}% float
- \else % ?
- \OTRSETsavebox{#9}%
- \OTRSETerasegridcells\currenthcell\currentvcell\columnhcells\columnvcells
- %\message{[clr]}% save box
- \fi
- \else
- %\message{[flt]}% float
- \fi
- \else
- %\message{[flt]}% float
- \fi
- \OTRSETsetvsize
- %\message{[fnt]}% float
- \else
- %\message{[rej]}% save box
- \OTRSETsavebox{#9}%
- \fi}
-
-\chardef\columnslotspacing \plusone
-
-\def\OTRSETstoreincolumnslot#1% #2 % {method} {box} % alleen last
- {% no messing around here
- % \dp#2=\zeropoint
- % \ifcase\columnslotspacing\else
- % \setbox#2=\vbox spread \columnslotspacing\lineheight
- % {\vss\box#2\vss}%
- % \fi
- % and don't change this any more
-% \doifdefinedelse{\strippedcsname\OTRSETstoreincolumnslot#1}
-% {\getvalue{\strippedcsname\OTRSETstoreincolumnslot#1}{#2}}
-% {\OTRSETstoreincolumnslotUNKNOWN{#2}}}
- \executeifdefined{\strippedcsname\OTRSETstoreincolumnslot#1}
- \OTRSETstoreincolumnslotUNKNOWN} % {#2}}
-
-\def\OTRSETstoreincolumnslotUNKNOWN#1%
- {\OTRSETprepareforcolumnslot2{#1}\copy#1} % {} ?
-
-% \def\OTRSETprepareforcolumnslot#1#2% 1=hoog 2=midden 3=laag
-% {\dp#2\zeropoint
-% \ifcase\columnslotspacing\else
-% \scratchdimen\columnslotspacing\lineheight
-% \ifnum#1=2 \scratchdimen2\scratchdimen \fi
-% \setbox#2\vbox spread \scratchdimen
-% {\ifnum#1>1\vss\fi\box#2\relax\ifnum#1<3\vss\fi}%
-% \fi}
-
-\def\OTRSETprepareforcolumnslot#1#2% 1=hoog 2=midden 3=laag
- {\dp#2\zeropoint
- \ifcase\columnslotspacing\else
- \scratchdimen\columnslotspacing\lineheight
- \ifnum#1=2 \scratchdimen2\scratchdimen \fi
- \begingroup
- \advance\scratchdimen\ht#2\relax
- \ifdim\scratchdimen<\columnmaxcells\lineheight
- \endgroup \setbox#2\vbox spread \scratchdimen \bgroup
- \else
- \endgroup \setbox#2\vbox to \columnmaxcells\lineheight \bgroup
- \vskip\strutdepth
- \fi
- \ifnum#1>1\vss\fi
- \box#2\relax
- \ifnum#1<3\vss\fi
- \egroup
- \fi}
-
-\def\OTRSETdocheckiffloatfits % eigenlijk moet else float anders
- {\global\ifnofloatpermitted\roomforfloatfalse\else\roomforfloattrue\fi}
-
-\def\OTRSETunpreparebox#1%
- {\ifhbox#1% spans and so
- \global\setbox\floatbox\vbox{\box#1}%
- \else
- \setbox\scratchbox\vbox
- {\unvbox#1\unskip\unskip\unskip
- \global\setbox\floatbox\lastbox}%
- \fi}
-
-\def\OTRSETsavebox#1% clean up the skips
- {\OTRSETunpreparebox{#1}%
- \dosavefloat}
-
-\def\OTRSETresavebox#1% clean up the skips
- {\OTRSETunpreparebox{#1}%
- \doresavefloat}
-
-\def\OTRSETflushfloatbox % nog verder doorvoeren en meer info in marge
- {\iftestfloatbox\ruledhbox\fi{\box\floatbox}}
-
-\def\OTRSETdoflushfloats
- {\bgroup
- \def\OTRSETsavebox##1{\!!doneafalse}%
- \doloop
- {\ifsomefloatwaiting
-\OTRSETskipstart
- \dogetfloat
- \ifdim\wd\floatbox>\zeropoint
- \!!doneatrue
- \dp\floatbox\zeropoint
- \OTRSETstoreincolumnslot{TBLR}\floatbox
- \if!!donea
- %\message{[flu]}%
- \else
- \OTRSETresavebox\floatbox
- \exitloop
- \fi
- \else
- %\message{[err]}% happens but why?
- \fi
- \else
- \exitloop
- \fi}
- \egroup}
-
-\newif\ifcentergridcells \centergridcellstrue
-
-\newif\ifcentergridcellonly \centergridcellonlyfalse
-\newif\ifautocentergridcellonly \autocentergridcellonlytrue
-
-\def\OTRSETcentergridcells
- {\ifcentergridcells
- \dorecurse\nofcolumns
- {\currenthcell\recurselevel
- \ifautocentergridcellonly
- % we prevent centering when the next column is empty
- % to be checked ! ! ! !
- \advance\currenthcell \plusone
- \centergridcellonlytrue
- \ifnum\currenthcell>\nofcolumns
- % ok already
- \else
- % only span if there is a next column with content
- \dorecurse\columnmaxcells
- {\ifdim\ht\OTRSETgridcell\currenthcell\currentvcell>\zeropoint
- \centergridcellonlyfalse
- \else\ifdim\dp\OTRSETgridcell\currenthcell\currentvcell>\zeropoint
- \centergridcellonlyfalse
- \fi\fi}%
- \fi
- \fi
- \currenthcell\recurselevel
- \dorecurse\columnmaxcells
- {\currentvcell\recurselevel\relax
- \ifdim\ht\OTRSETgridcell\currenthcell\currentvcell>\zeropoint
- \ifdim\dp\OTRSETgridcell\currenthcell\currentvcell=\zeropoint
- \bgroup
- \setbox\scratchbox\OTRSETgetgridcell\currenthcell\currentvcell
- \getnoflines{\ht\scratchbox}%
- \!!counta\currentvcell
- \advance\!!counta -\noflines
- \advance\!!counta \plusone
- % first col always ok
- \!!countb\currenthcell
- \!!countc\currenthcell
- \advance\!!countc \plusone
- \!!donebtrue
- \ifcentergridcellonly
- \!!countc\maxdimen
- \fi
- \dostepwiserecurse\!!countc\nofcolumns\plusone
- {\if!!doneb
- \let\xrecurselevel\recurselevel
- \dostepwiserecurse\!!counta\currentvcell\plusone
- {\ifdim\ht\OTRSETgridcell\xrecurselevel\recurselevel>\zeropoint
- \!!donebfalse
- \else\ifdim\wd\OTRSETgridcell\xrecurselevel\recurselevel>\zeropoint
- \!!donebfalse
- \fi\fi}%
- \if!!doneb
- \!!countb\xrecurselevel
- \fi
- \fi}%
- \totalcolumnspace\OTRSETlocalwidth\currenthcell
- \dostepwiserecurse\!!countc\!!countb\plusone
- {\advance\totalcolumnspace \OTRSETlocalwidth\recurselevel
- \advance\totalcolumnspace \OTRSETgetparameter\c!distance\recurselevel}%
- \ifdim\totalcolumnspace>\wd\scratchbox
- \setbox\scratchbox\hbox to \totalcolumnspace{\hss\box\scratchbox\hss}%
- \fi
- \OTRSETsetgridcell\currenthcell\currentvcell\box\scratchbox
- \egroup
- \fi
- \fi}}%
- \fi}
-
-\def\OTRSETinitializecolumns% once per page
- {\columnspreadtrue % todo
- \ifcolumnspread
- \global\rofcolumns\getvalue{\??mc\OTRSETidentifier\c!nright}%
- \global\lofcolumns\getvalue{\??mc\OTRSETidentifier\c!nleft}%
- \global\tofcolumns\rofcolumns \relax
- \ifodd\realpageno\relax
- \global\nofcolumns\rofcolumns
- \else
- \global\advance\tofcolumns\lofcolumns
- \global\nofcolumns\lofcolumns
- \fi
- \else
- \global\nofcolumns\getvalue{\??mc\OTRSETidentifier\c!n}%
- \global\rofcolumns\nofcolumns
- \global\lofcolumns\nofcolumns
- \global\tofcolumns\nofcolumns
- \fi
- \OTRSETassignwidths
- \global\mofcolumns\plusone
- \columnerasegridboxes}
-
-% vanaf hier:
-
-\def\definecolumnset
- {\dodoubleargument\dodefinecolumnset}
-
-\def\dodefinecolumnset[#1][#2]%
- {\getparameters[\??mc#1]
- [\c!direction=\v!right,
- \c!balance=\v!no,
- \c!distance=1.5\bodyfontsize, % controleren
- \c!n=2,
- \c!nleft=\getvalue{\??mc#1\c!n},
- \c!nright=\getvalue{\??mc#1\c!n},
- \c!width=\v!fit,
- \c!lines=0,
- \c!start=0,
- #2]%
- \dorecurse{\getvalue{\??mc#1\c!nleft}} % todo
- {\dododefinecolumnset[#1][\recurselevel]}%
- \dorecurse{\getvalue{\??mc#1\c!nright}} % todo
- {\dododefinecolumnset[#1][\recurselevel]}%
- % redo framed settings
- \setupcolumnset[#1][1][\c!distance=\!!zeropoint]}
-
-\def\dododefinecolumnset[#1][#2]%
- {\presetlocalframed
- [\??mc#1#2]%
- \setupcolumnset
- [#1][#2]
- [\c!offset=\v!overlay,
- \c!frame=\v!off,
- \c!align=,
- \c!lines=0,% really needed since c!regels is now part of framed
- \c!width=\getvalue{\??mc#1\c!width},
- \c!distance=\getvalue{\??mc#1\c!distance}]}
-
-\def\setupcolumnset
- {\dotripleargument\dosetupcolumnset}
-
-\def\dosetupcolumnset[#1][#2][#3]%
- {\ifthirdargument
- \def\docommand##1%
- {\doifelse{##1}\v!each
- {\dorecurse{\getvalue{\??mc#1\c!n}}{\docommand\recurselevel}}
- {\getparameters[\??mc#1##1][#3]}}%
- \processcommalist[#2]\docommand
- \else
- \getparameters[\??mc#1][#2]%
- \fi}
-
-\definecolumnset[\s!default][\c!n=2] % fallback
-
-\def\OTRSETgotonextpage
- {\vfill\eject
- \relax\ifnum\mofcolumns>\plusone
- \OTRSETgotocolumn[\v!last]%
- \ifnum\mofcolumns>\plusone
- \OTRSETgotocolumn[\v!force]%
- \fi
- \fi}
-
-\let\OTRSETgotonextpageX\OTRSETgotonextpage % will become obsolete
-
-\def\OTRSETgotocolumn
- {\dosingleempty\doOTRSETgotocolumn}
-
-\def\doOTRSETgotoCOLROW#1% <number>|<number>*<number>
- {\bgroup % really needed
- \splitstring#1\at*\to\column\and\row
- \bgroup
- \ifx\column\empty\else\expanded{\doOTRSETgotoCOLUMN{\column}}\fi
- \egroup
- \bgroup
- \ifx\row \empty\else\expanded{\doOTRSETgotoROW {\row }}\fi
- \egroup
- \egroup}
-
-\def\doOTRSETgotoCOLUMN#1%
- {\ifnum\mofcolumns=#1\else
- \vfill\eject % \doejectpage\eject
- \doloop
- {\ifnum\mofcolumns=#1\relax
- \exitloop \else \OTRSETdummycolumn
- \fi}%
- \fi}
-
-\def\doOTRSETgotoROW#1%
- {\ifnum#1>1
- \scratchcounter\zerocount
- \currenthcell\mofcolumns
- \currentvcell#1\advance\currentvcell \minusone
- \dorecurse\currentvcell
- {\OTRSETdoifcellelse\mofcolumns\recurselevel\donothing
- {\advance\scratchcounter\plusone}}
- \getnoflines\pagetotal
- \advance\scratchcounter-\noflines
- \ifnum\scratchcounter>\zerocount
- \dorecurse\scratchcounter{\line{\strut}}%
- \fi
- \fi
- \OTRSETsetvsize}
-
-\def\doOTRSETgotocolumn[#1]% yes|force|first|last|<number>|<number>*<number>
- {\processallactionsinset
- [#1]
- [ \v!yes=>\OTRSETdummycolumn,
- \v!no=>,% not supported
- \v!force=>\OTRSETdummycolumn,
- \v!first=>\expanded{\doOTRSETgotoCOLUMN{1}},
- \v!last=>\expanded{\doOTRSETgotoCOLUMN{\the\nofcolumns}},
- \s!default=>\OTRSETdummycolumn,
- \s!unknown=>\expanded{\doOTRSETgotoCOLROW{\commalistelement}}]}
-
-% to be documented and tested, not yet that robust
-
-% \def\OTRSETgotocell#1#2%
-% {\endgraf
-% \gdef\gotocellcounter{0}%
-% \doloop
-% {\ifnum\mofcolumns<#1\relax
-% \doglobal\increment\gotocellcounter\relax
-% \ifnum\gotocellcounter>#1\relax
-% \line{\strut}\crlf
-% \line{\strut}\crlf
-% \column
-% \writestatus{columnset}{quitting goto cell}%
-% \exitloop
-% \else
-% \column
-% \fi
-% \else
-% \exitloop
-% \fi}%
-% \ifnum\mofcolumns=#1\relax
-% \ifnum#2>1
-% \scratchcounter\zerocount
-% \currenthcell\mofcolumns
-% \currentvcell#2\advance\currentvcell \minusone
-% \dorecurse\currentvcell
-% {\OTRSETdoifcellelse\mofcolumns\recurselevel\donothing
-% {\advance\scratchcounter\plusone}}
-% \getnoflines\pagetotal
-% \advance\scratchcounter-\noflines
-% \ifnum\scratchcounter>\zerocount
-% \dorecurse\scratchcounter{\line{\strut}}%
-% \fi
-% \fi
-% \fi
-% \OTRSETsetvsize}
-
-\def\OTRSETgotocell#1#2% obsolete: now \column[#1*#2]
- {\endgraf
- \doOTRSETgotoCOLUMN{#1}%
- \doOTRSETgotoROW {#2}}
-
-\def\OTRSETdummycolumn
- {\verticalstrut
- \vskip-\struttotal
- \vfill
- \eject}
-
-\newcounter\columnsetlevel
-\let\currentcolumnset\empty
-\chardef\OTRSETfinish\zerocount
-
-\def\startcolumnset
- {\dodoubleempty\dostartcolumnset}
-
-\def\dostartcolumnset[#1][#2]%
- {\increment\columnsetlevel\relax
- \globallet\localcolumnmaxcells\!!zerocount
- \global\chardef\OTRSETfinish\zerocount
- \resetOTRSETmarks
- \ifnum\columnsetlevel=\plusone
- \bgroup
- \saveinterlinespace
- \globallet\columnsetpage\!!plusone
- \def\currentcolumnset{#2}%
- \insidecolumnstrue % will be different flag in addition
- \activateotr{SET}{ONE}% andere naam, activate or so
- \doifelsenothing{#1}
- {\globallet\OTRSETlist\s!default}
- {\xdef\OTRSETlist{#1}}%
- \OTRSETstartnextpage
- \OTRSETassignwidths
- \OTRSETsethsize
- \else
- \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
- \ht\OTRfinalpagebox\textheight % signals output that there is content
- \OTRSETdofinaloutput
- \globallet\OTRSETbalht\zeropoint
- \egroup}
- {}}
-
-\def\stopcolumnset
- {\relax
- \ifnum\columnsetlevel=\plusone
- \endgraf % needed, else wrong vsize in one par case
- \global\chardef\OTRSETfinish\plusone
- % no, extra page \pagebreak % (test on pascal toc)
- \dostopcolumnset
- \egroup
- \global\notelimittrue % brrr, untested and fuzzy
- \setvsize
- \sethsize
- \ifvoid\OTRfinalpagebox\else
- % probably balanced
- \ifdim\ht\OTRfinalpagebox<\textheight
- \snaptogrid[\v!page]\hbox{\box\OTRfinalpagebox}%
- \else
- \box\OTRfinalpagebox
- \fi
- \fi
- \global\chardef\OTRSETfinish\zerocount
- \ifsomefloatwaiting \setvsize \pagebreak \setvsize \fi
- \OTRSETflushleftovers
- \else
- \egroup
- \fi
- \decrement\columnsetlevel\relax}
-
-\chardef\OTRSETbalancemethod\zerocount
-
-\def\dostopcolumnset
- {%\OTRSETdofinalflushfloats % yes/no
- \ifcase\OTRSETbalancemethod
- \OTRSETnobalance
- \else
- \OTRSETdobalance
- \fi}
-
-\def\OTRSETdobalance
- {\OTRSETnobalance}
-
-\def\localcolumnmaxcells{0}
-
-% don't loose empty 1page/1column with area (example **)
-%
-% \definecolumntextarea[title][x=1,y=4,nx=2,ny=7,state=start]
-% \setupcolumntextareatext[title][\vtop to 5cm{a\\b\\b\\d}]
-%
-% \starttext
-% \startcolumnset \dorecurse{1}{\input tufte \par} \stopcolumnset
-% \stoptext
-
-% better:
-
-\def\definecolumnsetarea {\definecolumntextarea}
-\def\setupcolumnsetarea {\setupcolumntextarea}
-\def\setupcolumnsetareatext{\setupcolumntextareatext}
-
-\def\OTRSETnobalance
- {\iflastcolumnfootnotes % testen ! optie
- % inhibit flush of floats !
- % todo: nothing if no footnotes, else empty page
- \dostepwiserecurse\mofcolumns\nofcolumns\plusone
- {\vskip-\struttotal\verticalstrut\vfill\eject}%
- \else
- \ifnum\mofcolumns>\plusone
- \donetrue
- \else\ifdim\pagetotal>\zeropoint % too dangerous, we loose data
- \donetrue
- \else
- \donefalse
- \fi\fi
- \ifdone
- \ifnum\mofcolumns=\nofcolumns
- \OTRSETflushfinalfootnotes
- \else
- % probably todo
- \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
- \OTRSETdofinalflush
- \OTRSETdofinaloutput
- \fi
- \fi
- \fi}
-
-\def\OTRSETstartnextpage
- {\doifsomething\OTRSETlist
- {\getfromcommacommand[\OTRSETlist][1]%
- \global\let\OTRSETidentifier\commalistelement
- \doifundefined{\??mc\OTRSETidentifier\c!n}
- {\globallet\OTRSETidentifier\s!default}%
- \let\newcommalistelement\empty
- \doglobal\replaceincommalist\OTRSETlist1%
- \OTRSETrestart}}
-
-\def\OTRSETrestart % weed
- {\OTRSETinitializefeatures
- \OTRSETflushpreposttext
- \OTRSETinitializecolumns
- \OTRSETcheckinsert
- \OTRSETcheckgrid
- \OTRSETsetvsize
- \OTRSETsethsize % or local ?
- \OTRSETsetplaceholders
- \OTRSEThandlepreposttext
- \initializecolumntextareas % name !
- \OTRSETcheckstartcells
- \OTRSETsetvsize}
-
-% \def\OTRSETcheckstartcells
-% {\dorecurse\nofcolumns
-% {\bgroup
-% \mofcolumns\recurselevel
-% \scratchcounter\currentcolumnstartcell % uses \mofcolumns, returns 1 or more
-% \advance\scratchcounter \minusone
-% \dorecurse\scratchcounter
-% {\OTRSETdoifcellelse\mofcolumns\recurselevel
-% \donothing{\OTRSETsetgridcell\mofcolumns\recurselevel\copy\placeholderboxe}}%
-% \egroup}}
-
-\def\OTRSETcheckstartcells
- {\dorecurse\nofcolumns
- {\bgroup
- \mofcolumns\recurselevel
-\OTRSETsetcorrectnofcells\currentcolumnstartcell
-\advance\scratchcounter \minusone
- \dorecurse\scratchcounter
- {\OTRSETdoifcellelse\mofcolumns\recurselevel
- \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)
- \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
- {% number of lines
- % new: raw
- \getrawnoflines\textheight\xdef\columnmaxcells{\the\noflines}%
- % direction
- \doifelsevalue{\??mc\OTRSETidentifier\c!direction}\v!right
- {\chardef\columndirection\zerocount}
- {\chardef\columndirection\plusone}%
- % balancing
- \chardef\OTRSETbalancemethod\zerocount
- \processaction
- [\getvalue{\??mc\OTRSETidentifier\c!balance}]
- [ \v!yes=>\chardef\OTRSETbalancemethod\plusone,
- \v!top=>\chardef\OTRSETbalancemethod\plustwo,
- \v!bottom=>\chardef\OTRSETbalancemethod\plusthree]}
-
-% keep 'm for a while
-%
-% \installoutput\OTRSETflushpreposttext
-% {\global\setbox\precolumnbox\vbox{\unvbox\normalpagebox}%
-% \ifcarryoverfootnotes \else
-% \global\setbox\postcolumnbox\vbox{\placebottomnotes}%
-% \fi}
-%
-% to be tested on 'boekinhoud' in 'pascal/demo-bbi'
-%
-% junk ! ! ! ! !
-%
-%\installoutput\OTRSETflushpreposttext
-% {\global\setbox\precolumnbox\vbox
-% {\unvbox\normalpagebox
-% \strut\vskip-2\lineheight\strut}% we want a proper depth
-% \ifcarryoverfootnotes \else
-% \global\setbox\postcolumnbox\vbox{\placebottomnotes}%
-% \fi}
-%
-% \starttext
-% \definecolumnset[two][n=2]
-% \startcolumnset[two] \dorecurse{4}{\input tufte } \stopcolumnset
-% \input tufte
-% \startcolumnset[two] \input tufte \stopcolumnset
-% \stoptext
-%
-% \installoutput\OTRSETflushpreposttext
-% {\global\setbox\precolumnbox\vbox{\unvbox\normalpagebox}%
-% \dp\precolumnbox\strutdepth
-% \ifcarryoverfootnotes \else
-% \global\setbox\postcolumnbox\vbox{\placebottomnotes}%
-% \fi}
-
-% test:
-%
-% \setupcolumnset [test-1] [balance=yes]
-% \setupcolumnset [test-2] [balance=yes]
-% \setupcolumnsetlines[test-1][1][1] [8]
-% \setupcolumnsetlines[test-1][1][2][10]
-% \startcolumnset [test-1] \dorecurse {1}{\input tufte \par} \stopcolumnset
-% \startcolumnset [test-2] \dorecurse {2}{\input ward \par} \stopcolumnset
-
-\ifx\lastskipinotr\undefined \newskip\lastskipinotr \fi
-
-\installoutput\OTRSETflushpreposttext
- {\global\setbox\precolumnbox\vbox
- {\unvbox\normalpagebox
- \global\lastskipinotr\lastskip}%
- \ifdim\lastskipinotr>\zeropoint
- \global\setbox\precolumnbox\hbox
- {\lower\strutdepth\box\precolumnbox}%
- \fi
- \dp\precolumnbox\strutdepth
- \ifcarryoverfootnotes \else
- \global\setbox\postcolumnbox\vbox{\placebottomnotes}%
- \fi}
-
-\let\precolumnlines \!!zerocount
-\let\postcolumnlines\!!zerocount
-
-\def\OTRSEThandlepreposttext
- {\ifdim\ht\precolumnbox>\zeropoint % new
- \getnoflines{\ht\precolumnbox}%
- \edef\precolumnlines{\the\noflines}%
- \doOTRSETsetgridcells
- {\copy\placeholderboxe}
- \plusone\plusone\nofcolumns\noflines
- % normal version (single column set)
- % {\box\precolumnbox}%
- % compensated for bodyfont change
- {\hbox
- {\OTRSETsetcorrectcellht
- \raise\scratchdimen\box\precolumnbox}}%
- \else
- \let\precolumnlines\!!zerocount
- \fi
- \ifdim\ht\postcolumnbox>\zeropoint % new, otherwise empty bottom line
- \getnoflines{\ht\postcolumnbox}%
- \edef\postcolumnlines{\the\noflines}%
- \advance\columnfreecells -\noflines
- \advance\columnfreecells \plusone
- \doOTRSETsetgridcells
- {\copy\placeholderboxe}
- \plusone\columnfreecells\nofcolumns\noflines
- {\box\postcolumnbox}%
- \else
- \let\postcolumnlines\!!zerocount
- \fi}
-
-\def\OTRSETchecksidefloat
- {} % {\sidefloatoutput}
-
-\def\OTRSETfinalsidefloatoutput
- {}
-
-\def\OTRSETcheckgrid
- {\topskip1\topskip
- \ifforcecolumngrid
- \widowpenalty\zerocount
- \clubpenalty\zerocount
- \brokenpenalty\zerocount
- \fi}
-
-\def\OTRSETcheckinsert
- {\iflastcolumnfootnotes
- \ifnum\nofcolumns=\mofcolumns
- \OTRSETforceinserts
- \else
- \OTRSETinhibitinserts
- \fi
- \else
- \OTRSETforceinserts
- \fi}
-
-\def\OTRSETforceinserts
- {\enablenotes}
-
-\def\OTRSETinhibitinserts
- {\disablenotes}
-
-% undocumented goodie
-
-\def\definecolumnsethsize#1#2#3#4% will be improved/speed up
- {\bgroup
- \def\OTRSETidentifier{#1}%
- \ifcase\columnsetlevel\relax
- \mofcolumns\plusone
- \OTRSETinitializecolumns
- \OTRSETassignwidths
- \OTRSETsethsize
- \fi
- \!!counta#2\!!countb#3\docalculatecolumnsetspan
- \expandafter\egroup\expandafter\edef\expandafter
- #4\expandafter{\the\!!widtha}}
-
-% interface to footnotes
-
-\def\OTRSETassignwidths
- {%\scratchdimen\makeupwidth
- \freezetextwidth \scratchdimen\textwidth
- %
- \scratchcounter\zerocount
- \dorecurse\nofcolumns
- {\doifelsevalue{\??mc\OTRSETidentifier\recurselevel\c!width}\v!fit
- {\advance\scratchcounter \plusone }
- {\advance\scratchdimen -\getvalue{\??mc\OTRSETidentifier\recurselevel\c!width}}%
- \advance\scratchdimen -\getvalue{\??mc\OTRSETidentifier\recurselevel\c!distance}}%
- \ifcase\scratchcounter\else
- \divide\scratchdimen \scratchcounter
- \fi
- \setgvalue{\??mc\??mc\c!width}{0}%
- \dorecurse\nofcolumns
- {\doifelsevalue{\??mc\OTRSETidentifier\recurselevel\c!width}\v!fit
- {\dimen0=\scratchdimen}
- {\setgvalue{\??mc\??mc\c!width}{1}%
- \dimen0=\getvalue{\??mc\OTRSETidentifier\recurselevel\c!width}}%
- \setxvalue{\??mc\recurselevel\??mc\c!width}{\the\dimen0}}}
-
-\def\OTRSETlocalwidth#1%
- {\getvalue{\??mc\number#1\??mc\c!width}}
-
-\newbox\placeholderboxa
-\newbox\placeholderboxb
-\newbox\placeholderboxc
-\newbox\placeholderboxd
-\newbox\placeholderboxe
-\newbox\placeholderboxf
-
-\def\columnplaceholder#1#2%
- {\hbox
- {\localcolortrue
- \setbox\scratchbox\hbox to \hsize
- {\iftracecolumnset \incolortrue \localcolortrue
- \hskip-.5ex%
- \startcolor[columnset:#2]\vrule\!!width1ex\!!height.5ex\!!depth.5ex\stopcolor
- \fi
- \hss}%
- \ifcase#1\relax
- \ht\scratchbox\zeropoint
- \dp\scratchbox\zeropoint
- \wd\scratchbox\zeropoint
- \else
- \wd\scratchbox\hsize
- \ht\scratchbox\strutht
- \dp\scratchbox\strutdp
- \fi
- \box\scratchbox}}
-
-\definepalet
- [columnset]
- [a=cyan,b=green,c=blue,d=red,e=magenta,f=darkgray]
-
-\def\OTRSETsetplaceholders
- {\global\setbox\placeholderboxa\columnplaceholder0a%
- \global\setbox\placeholderboxb\columnplaceholder0b%
- \global\setbox\placeholderboxc\columnplaceholder0c%
- \global\setbox\placeholderboxd\columnplaceholder0d%
- \global\setbox\placeholderboxe\columnplaceholder0e%
- \global\setbox\placeholderboxf\columnplaceholder1f}
-
-\def\doOTRSETshowstatus
- {\llap{\incolortrue \localcolortrue \tt\tfxx
- \startcolor[blue](\the\vsize->\number\columnfirstcell\#\number\columnfreecells)\stopcolor
- \hskip\leftskip}}
-
-\def\OTRSETshowstatus
- {\iftracecolumnset \doOTRSETshowstatus \fi}
-
-% \appendtoks \OTRSETshowstatus \to \everypar
-
-% page contents
-
-\def\OTRSETdopagecontents#1#2% takes two args: \box<n> \unvbox<n>
- {\vbox to \textheight{\forgetall#1#2\pushproperties}}
-
-\def\OTRSETsomepagefloat {\def\floatmethod{PAGE}\OTRSETsomeslotfloat} % check
-\def\OTRSETsomeherefloat {\def\floatmethod{HERE}\OTRSETsomeslotfloat} % check
-\def\OTRSETsomeelsefloat {\def\floatmethod{HERE}\OTRSETsomeslotfloat} % check
-\def\OTRSETsomefixdfloat {\def\floatmethod{FIXD}\OTRSETsomeslotfloat} % check
-\def\OTRSETsometopfloat {\def\floatmethod{TOPS}\OTRSETsomeslotfloat} % check
-\def\OTRSETsomebottomfloat{\def\floatmethod{BOTS}\OTRSETsomeslotfloat} % check
-
-\def\OTRSETflushfloatbox % nog verder doorvoeren en meer info in marge
- {\iftestfloatbox\ruledhbox\fi{\box\floatbox}}
-
-\def\OTRSETsomeslotfloat[#1]%
- {\setbox\floatbox\vbox{\flushfloatbox}%
- \dp\floatbox\strutdp
- \@EA\uppercasestring\floatmethod\to\floatmethod
- \OTRSETstoreincolumnslot\floatmethod\floatbox
- \doinsertfloatinfo}
-
-% kind of new, looks much like OTRONE, but not entirely
-
-\def\OTRSETdosettopinserts
- {\bgroup
- \ifsomefloatwaiting
- \noffloatinserts\zerocount
- \let\totaltopinserted\!!zeropoint
- \OTRSETdodosettopinserts
- \ifnum\@@bknbottom=\zerocount
- \ifnum\@@bknlines>\zerocount
- \ifdim\totaltopinserted>\zeropoint\relax
- \dimen0\lineheight
- \dimen0=\@@bknlines\dimen0
- \advance\dimen0 \totaltopinserted\relax
- \ifdim\dimen0>\textheight % \vsize %%%%%%%%% \textheight
- \showmessage\m!floatblocks8{\@@bknlines}%
- \vfilll\eject
- \fi
- \fi
- \fi
- \fi
- \fi
- \egroup}
-
-\def\OTRSETdodosettopinserts
- {\ifnum\noffloatinserts<\noftopfloats
- \dogetfloat
- \ifdim\topinserted=\zeropoint\relax
- \topofinserttrue
- \else
- \topofinsertfalse
- \fi
- \setbox\scratchbox\vbox % kan beter !
- {\forgetall
- \iftopofinsert
- \ifdim\OTRSETtopoffset=\zeropoint
- \moveongrid[\v!top]
- \fi
- \else
- \betweenfloatblanko % inserts can't look back
- \fi
- \flushfloatbox
- \blank[\@@bkspaceafter]}%
- \global\advance\topinserted \ht\scratchbox\relax
- \ifdim\topinserted>\vsize % was \textheight\relax
- \OTRSETresavebox\floatbox
- \noffloatinserts\noftopfloats\relax
- \global\advance\topinserted -\ht\scratchbox
- \let\OTRSETdodosettopinserts\relax % to be tested
- \else
- \xdef\totaltopinserted{\the\topinserted}%
- \insert\topins{\forgetall\box\scratchbox}% interlineskip ?
- \ifsomefloatwaiting
- \advance\noffloatinserts \plusone
- \else
- \noffloatinserts\noftopfloats\relax
- \fi
- \dofloatflushedinfo
- \fi
- \else
- \ifsomefloatwaiting
- \showmessage\m!floatblocks6{\the\noftopfloats}%
- \fi
- \let\OTRSETdodosettopinserts\relax
- \fi
- \OTRSETdodosettopinserts}
-
-\def\OTRSETdosetbotinserts
- {\bgroup
- \ifsomefloatwaiting
- \noffloatinserts\zerocount
- \OTRSETdodosetbotinserts
- \fi
- \egroup}
-
-\def\OTRSETdodosetbotinserts
- {\ifnum\noffloatinserts<\nofbotfloats\relax
- \dogetfloat
- \global\advance\botinserted \ht\floatbox\relax
- \global\advance\botinserted \dp\floatbox\relax
- \global\advance\botinserted \floattopskip\relax
- \ifdim\botinserted<\pagegoal\relax
- \insert\botins
- {\forgetall
- \blank[\@@bkspacebefore]%
- \flushfloatbox}%
- \ifsomefloatwaiting
- \advance\noffloatinserts \plusone
- \else
- \noffloatinserts\nofbotfloats
- \fi
- \dofloatflushedinfo
- \else
- \OTRSETresavebox\floatbox
- \noffloatinserts\nofbotfloats\relax
- \fi
- \global\nofloatpermittedtrue % vgl topfloats s!
- \else
- \ifsomefloatwaiting
- \showmessage\m!floatblocks7{\the\nofbotfloats}%
- \fi
- \let\OTRSETdodosetbotinserts\relax
- \fi
- \OTRSETdodosetbotinserts}
-
-\let\OTRSETdosetbothinserts\relax
-
-\def\OTRSETdotopinsertions
- {\ifvoid\topins\else
- \ifvoid\columntopbox\mofcolumns
- \columnsettopbox\mofcolumns\box\topins
- \else
- \columnsettopbox\mofcolumns\vbox % temp, must be better
- {\forgetall
- \offinterlineskip
- \box\columntopbox\mofcolumns
- \box\topins}
- \fi
- \fi
- \global\topinserted\zeropoint\relax} % goes away
-
-\def\OTRSETdobotinsertions
- {\ifvoid\botins \else
- \columnsetbotbox\mofcolumns\box\botins
-% \else
-% \columnsetbotbox\mofcolumns\vbox % temp, must be better
-% {\forgetall
-% \offinterlineskip
-% \box\botins
-% \box\columnbotbox\mofcolumns}
- \fi
- \global\botinserted\zeropoint\relax} % goes away
-
-% set ipv text
-
-% left right 1 2 3 +1 +2 +3
-
-\let\columnleftareas \empty
-\let\columnrightareas\empty
-
-% links rechts => odd, even, n, named
-
-\def\definecolumntextarea
- {\dotripleempty\dodefinecolumntextarea}
-
-\def\dodefinecolumntextarea[#1][#2][#3]% y=0 is mogelijke en handig !
- {\ifthirdargument
- \doifinsetelse{#2}{\v!both,\v!fixed}
- {\definecolumntextarea[#1][\v!left ][\c!type=#2,#3]%
- \definecolumntextarea[#1][\v!right][\c!type=#2,#3]}
- {\doifelse{#2}\v!next
- {\doifoddpageelse
- {\definecolumntextarea[#1][\v!right][\c!type=#2,#3]}
- {\definecolumntextarea[#1][\v!left ][\c!type=#2,#3]}}
- {\presetlocalframed
- [\??mt#1#2]%
- \processaction[#2] % \doglobal voorkomt stack build up
- [ \v!left=>\doglobal\addtocommalist{#1}\columnleftareas,
- \v!right=>\doglobal\addtocommalist{#1}\columnrightareas]%
- \getparameters[\??mt#1#2]
- [\c!x=1,\c!y=1,\c!nx=1,\c!ny=1,\c!clipoffset=2\lineheight,
- \c!leftoffset=\zeropoint,\c!rightoffset=\zeropoint,
- \c!offset=\v!overlay,\c!strut=\v!no,\c!frame=\v!off,
- \c!type=#2,\c!page=1,\c!state=\v!stop,#3]}}%
- \else
- \definecolumntextarea[#1][\v!next][#2]%
- \fi}
-
-\def\setupcolumntextarea
- {\dotripleempty\dosetupcolumntextarea}
-
-\def\dosetupcolumntextarea[#1][#2][#3]%
- {\ifthirdargument
- \doifelse{#2}\v!both
- {\setupcolumntextarea[#1][\v!left ][#3]%
- \setupcolumntextarea[#1][\v!right][#3]}
- {\doifelse{#2}\v!next
- {\doifoddpageelse
- {\setupcolumntextarea[#1][\v!right][#3]}
- {\setupcolumntextarea[#1][\v!left][#3]}}
- {\getparameters[\??mt#1#2][#3]}}%
- \else
- \setupcolumntextarea[#1][\v!next][#2]%
- \fi}
-
-\def\docheckcolumnsetareapage#1#2%
- {\ifnum\getvalue{\??mt#1\c!page}>\plusone
- \doifelsevalue{\??mt#1\c!type}\v!fixed
- {\ifnum\columnsetpage=\getvalue{\??mt#1\c!page}\relax
- \donetrue\else\donefalse
- \fi}
- {\ifnum\columnsetpage<\getvalue{\??mt#1\c!page}\relax
- \donefalse\else\donetrue
- \fi}%
- \else
- \donetrue
- \fi}
-
-\def\initializecolumntextareas
- {\ifodd\realpageno
- \doinitializecolumntextareas\columnrightareas\v!right
- \else
- \doinitializecolumntextareas\columnleftareas\v!left
- \fi}
-
-\def\doinitializecolumntextareas#1#2%
- {\def\docommand##1%
- {\docheckcolumnsetareapage{##1#2}\plusone
- \ifdone
- \donefalse
- \processaction
- [\getvalue{\??mt##1#2\c!state}]
- [ \v!start=>\donetrue,
- \v!repeat=>\donetrue,
- \s!unknown=>\doperformtest\commalistelement\donetrue\donefalse]%
- \ifdone\dodoinitializecolumntextareas{##1}{#2}\fi
- \fi}%
- \processcommacommand[#1]\docommand}
-
-\def\dodoinitializecolumntextareas#1#2%
- {\doOTRSETsetgridcells
- {\copy\placeholderboxd}
- {\getvalue{\??mt#1#2\c!x }}{\getvalue{\??mt#1#2\c!y }}
- {\getvalue{\??mt#1#2\c!nx}}{\getvalue{\??mt#1#2\c!ny}}
- {\copy\placeholderboxd}}
-
-\def\placecolumntextareas
- {\ifodd\realpageno
- \doplacecolumntextareas\columnrightareas\v!right
- \else
- \doplacecolumntextareas\columnleftareas\v!left
- \fi}
-
-\def\doplacecolumntextareas#1#2% global ?
- {\bgroup
- \forgetall
- \def\docommand##1%
- {\docheckcolumnsetareapage{##1#2}\zerocount
- \ifdone
- \donefalse
- \processaction
- [\getvalue{\??mt##1#2\c!state}]
- [ \v!start=>\donetrue\doglobal\removefromcommalist{##1}#1,
- \v!repeat=>\donetrue,
- \s!unknown=>\doperformtest\commalistelement\donetrue\donefalse]%
- \ifdone
- \dodoplacecolumntextareas{##1}{#2}%
- \else
- \doglobal\removefromcommalist{##1}#1%
- \fi
- \fi}%
- \processcommacommand[#1]\docommand
- \egroup}
-
-% \page[left]
-% \definecolumntextarea[intro][left][x=1,y=1,nx=4,ny=20,state=start,background=introlayer]
-% \setupcolumntextareatext[intro][left][\setups{intro}]
-% \flushcolumntextareas
-
-\def\flushcolumntextareas
- {\initializecolumntextareas
- \setvsize}
-
-\def\columntextlastbackspace{\backspace}
-
-% beware, we have clipping offsets of 2\lineheight by default
-
-\def\columntextareaparameter#1%
- {\csname\??mt\currentcolumntestarea#1\endcsname}
-
-\def\dodoplacecolumntextareas#1#2%
- {\def\currentcolumntestarea{#1#2}%
- \!!counta\columntextareaparameter\c!x
- \!!countb\columntextareaparameter\c!nx
- \docalculatecolumnsetspan
- \!!heighta\columntextareaparameter\c!ny\lineheight
- % wrong
- % \ifnum\columntextareaparameter\c!y=\zerocount
- % \advance\!!heighta -\lineheight
- % \advance\!!heighta \topskip
- % \fi
- % \advance\!!heighta -\lineheight % option
- \ifnum\columntextareaparameter\c!y=\plusone
- \advance\!!heighta -\lineheight
- \advance\!!heighta \topskip
- \fi
- %
- \setbox\scratchbox\vbox
- {\donetrue\localframed
- [\??mt\currentcolumntestarea]
- [\c!location=,% new (*)
- \c!width=\!!widtha,\c!height=\!!heighta,\c!lines=]
- {\columntextareaparameter\empty}}%
- \!!counta\columntextareaparameter\c!x
- \!!countb\columntextareaparameter\c!y
- \advance\!!countb \columntextareaparameter\c!ny
- \advance\!!countb \minusone
- % new (*)
- \doif{\columntextareaparameter\c!location}\v!depth
- {\setbox\scratchbox\hbox{\lower\strutdepth\box\scratchbox}%
- \dp\scratchbox\zeropoint
- \ht\scratchbox\!!heighta}%
- %
- \setbox0\hbox
- {\ifcase\!!countc
- \copy\scratchbox % \box
- \else
- \clip
- [ %\c!topoffset=\columntextareaparameter\c!clipoffset,%
- %\c!bottomoffset=\columntextareaparameter\c!clipoffset,%
- %\c!leftoffset=\columntextareaparameter\c!clipoffset,%
- \c!offset=\columntextareaparameter\c!clipoffset,%
- \c!offset=\columntextareaparameter\c!clipoffset,%
- \c!rightoffset=\columntextareaparameter\c!rightoffset,%
- \c!width=\!!widthb,%
- \c!height=\!!heighta]%
- {\copy\scratchbox}%
- \fi}%
- \OTRSETsetgridcell\!!counta\!!countb\box0
- \ifcase\!!countc\else
- \advance\!!counta \columntextareaparameter\c!nx
- \advance\!!counta -\!!countc
- \advance\!!widtha -\!!widthb
- \setbox0\hbox
- {\hskip-\namedlayoutparameter\v!odd\c!backspace
- \clip
- [ %\c!topoffset=\columntextareaparameter\c!clipoffset,%
- %\c!bottomoffset=\columntextareaparameter\c!clipoffset,%
- %\c!rightoffset=\columntextareaparameter\c!clipoffset,%
- \c!offset=\columntextareaparameter\c!clipoffset,%
- \c!offset=\columntextareaparameter\c!clipoffset,%
- \c!leftoffset=\columntextareaparameter\c!leftoffset,%
- \c!width=\!!widtha,%
- \c!height=\!!heighta,%
- \c!hoffset=\!!widthb]%
- {\copy\scratchbox}}%
- \OTRSETsetgridcell\!!counta\!!countb\box0%
- \fi}
-
-\def\setupcolumntextareatext
- {\dotripleempty\dosetupcolumntextareatext}
-
-\long\def\dosetupcolumntextareatext[#1][#2][#3]%
- {\ifthirdargument
- \doifelse{#2}\v!both
- {\setvalue{\??mt#1\v!left }{#3}%
- \setvalue{\??mt#1\v!right}{#3}}
- {\doifelse{#2}\v!next
- {\doifoddpageelse
- {\setvalue{\??mt#1\v!right}{#3}}%
- {\setvalue{\??mt#1\v!left }{#3}}}%
- {\setvalue{\??mt#1#2}{#3}}}%
- \else
- \setupcolumntextareatext[#1][\v!next][{#2}]%
- \fi}
-
-\def\docalculatecolumnsetspan
- {% \!!counta <= x
- % \!!countb <= nx
- % \!!widtha => total width
- % \!!widthb => left width
- % \!!countc => left cols
- \!!widtha\!!countb\textwidth % we assume equal widths
- \advance\!!countb \!!counta
- \advance\!!countb \minusone
- \ifnum\!!countb>\nofcolumns
- \!!countc\!!countb
- \advance\!!countc -\nofcolumns
- \!!countb\nofcolumns
- \else
- \!!countc\zerocount
- \fi
- \advance\!!counta \plusone
- \dostepwiserecurse\!!counta\!!countb\plusone
- {\advance\!!widtha\OTRSETgetparameter\c!distance\recurselevel}%
- \!!widthb\!!widtha
- \advance\!!widthb -\!!countc\textwidth
- \ifodd\realpageno \else % tricky, assumes that we keep there
- \ifcase\!!countc\else
- % 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
- \dorecurse\!!countc
- {\advance\!!widtha\OTRSETgetparameter\c!distance\recurselevel}%
- \fi
- \fi}
-
-\def\columnsetspanhsize{\textwidth}
-
-\def\setcolumnsetspanhsize#1#2% x nx / uses counta/b
- {\!!counta#1\!!countb#2\docalculatecolumnsetspan
- \edef\columnsetspanhsize{\the\!!widtha}}
-
-\def\definecolumnsetspan
- {\dodoubleempty\dodefinecolumnsetspan}
-
-\def\dodefinecolumnsetspan[#1][#2]%
- {%\ifsecondargument
- \defineframedtext
- [cs:#1]
- [\c!frame=\v!off,
- \c!before=,
- \c!after=,
- \c!offset=\v!overlay,
- \c!location=\v!left,
- \c!linecorrection=\v!off,
- \c!depthcorrection=\v!off,
- \c!n=2,
- \c!nlines=0,
- \c!indenting=,
- \c!indentnext=\v!yes,
- \c!default=HERE,
- \c!alternative=\v!a,
- #2]%
- %\else
- % \definecolumnspan[][#1]%
- }%\fi}
-
-\definecolumnsetspan[\s!default]
-
-\def\setupcolumnsetspan
- {\dodoubleempty\dosetupcolumnsetspan}
-
-\def\dosetupcolumnsetspan[#1][#2]%
- {\ifsecondargument
- \setupframedtexts[cs:#1][#2]%
- \else
- \setupcolumnsetspan[\s!default][#1]%
- \fi}
-
-\def\startcolumnsetspan
- {\dotripleempty\dostartcolumnsetspan}
-
-%%%%%%%%%%%%%%%% TODO
-
-\def\dostartcolumnsetspan[#1][#2][#3]% [#3] gobbles space
- {\endgraf % else rubish output if forgotten
- \vskip \zeropoint % make sure otr is done, otherwise last line problems
- \bgroup
- \forgetall
- \ifnum\columnsetlevel>\zerocount\else
- % of course we needed a one-column fall back for tm
- \columnsetspanhsize\hsize
- \nofcolumns\plusone
- \mofcolumns\plusone
- \fi
- \setupframedtexts[cs:#1]
- [\c!width=\columnsetspanhsize,
- \c!linecorrection=\v!off,
- \c!depthcorrection=\v!off,
- #2]%
- % determine widths
- \!!countc\framedtextparameter{cs:#1}\c!n
- % \!!countd\numexpr(\nofcolumns-\mofcolumns+\plusone)%
- \!!countd\nofcolumns
- % n <= n of columns
- \ifnum\!!countc>\!!countd \!!countc\!!countd \fi
- \advance\!!countd -\mofcolumns
- \advance\!!countd \plusone
- % n <= n of available columns (alternative a)
- \doif{\framedtextparameter{cs:#1}\c!alternative}\v!a
- {\ifnum\!!countc>\!!countd \!!countc\!!countd \fi}%
- % here it all starts
- \setcolumnsetspanhsize\mofcolumns\!!countc % a/b used
- \hsize\columnsetspanhsize
- \setbox\scratchbox\vbox\bgroup
- \dostartframedtext[cs:#1][\v!none]% geen nils placement
- % spoils spacing : \vskip-\struttotal\par\verticalstrut\par
- \ifnum\columnsetlevel>\zerocount
- \framedtextparameter{cs:#1}\c!before
- \fi
- \def\stopcolumnsetspan{\dostopcolumnsetspan{#1}}}
-
-\def\dostopcolumnsetspan#1%
- {\par
- \verticalstrut
- \kern-2\struttotal
- \verticalstrut
- \ifnum\columnsetlevel>\zerocount
- \doifsomething{\framedtextparameter{cs:#1}\c!after}
- {\framedtextparameter{cs:#1}\c!after
- \kern\zeropoint}% otherwise blanks disappear, better be a switch
- \else
- \endgraf
- \fi
- \dostopframedtext
- \egroup
- \setbox\scratchbox\frozenhbox to \hsize
- {\dontcomplain
- \alignedline{\framedtextparameter{cs:#1}\c!location}\v!middle
- {\lower\strutdepth\box\scratchbox}}%
- \dp\scratchbox\zeropoint % else wrong snap insidefloat
-%
-% to be tested first (strange in grid mode)
-%
-% \setbox\scratchbox\frozenhbox to \hsize
-% {\dontcomplain
-% \chardef\alignstrutmode\zerocount
-% \alignedline{\framedtextparameter{cs:#1}\c!plaats}\v!midden
-% {\box\scratchbox}}%
-%
- \ifinsidefloat
- \box\scratchbox
- \else\ifnum\columnsetlevel>\zerocount
- % we only set \columnsetspacing when asked for, else bottom problems
- % don't change this any more (test naw)
- \chardef\columnslotspacing\framedtextparameter{cs:#1}\c!nlines\relax
- % todo: nboven/onder & \chardef\columnslotlocation2
- %\OTRSETstoreincolumnslotHERE\scratchbox
- \edef\floatmethod{\framedtextparameter{cs:#1}\c!default}%
- \@EA\uppercasestring\floatmethod\to\floatmethod
- % todo : \v!here -> here enzovoorts
- \OTRSETstoreincolumnslot\floatmethod\scratchbox
- % watch out: no \dochecknextindentation{tag}
- \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
- \scratchdimen\ht\scratchbox
- \advance\scratchdimen-\strutdp
- \ht\scratchbox\scratchdimen
- \framedtextparameter{cs:#1}\c!before
- \snaptogrid\vbox{\box\scratchbox}%
- \framedtextparameter{cs:#1}\c!after
- \fi\fi
- \egroup
- \endgraf}
-
-% \startcolumnset[two]
-% \input tufte
-% \startcolumnsetspan[two][width=20cm,location=middle] \input tufte \stopcolumnsetspan
-% \startcolumnsetspan[two][default=btlr] \input tufte \stopcolumnsetspan
-% \input tufte \par
-% \input tufte \par
-% \startcolumnsetspan[two] \emptylines[5] \stopcolumnsetspan
-% \startcolumnsetspan[two] \input tufte \stopcolumnsetspan
-% \stopcolumnset
-
-\protect \endinput
-
-% extreme examples (1)
-%
-% \setupfloats[numbering=nocheck]
-%
-% \definecolumnset [first] [n=2,start=0]
-% \definecolumnset [next] [n=2,start=3]
-%
-% \setuptexttexts[\vbox to \textheight{\topskipcorrection \hsize\makeupwidth left \hfill right\vfill}]
-%
-% \setuphead[chapter][text=empty]
-%
-% \starttext
-%
-% \startcolumnset[first,next]
-% \placefigure[btrl]{}{}
-% \placefigure[tblr]{}{}
-% \chapter{thuan} \dorecurse{25}{\recurselevel: \input thuan \endgraf}
-% \stopcolumnset
-%
-% \startcolumnset[first,next]
-% \chapter{thuan} \dorecurse{25}{\input thuan \endgraf\placefigure{}{}}
-% \stopcolumnset
-
-\unprotect
-
-% only in columnsets
-
-% \def\cornerfigure
-% {\dotripleempty\docornerfigure}
-%
-% \def\docornerfigure[#1][#2][#3]% [layer] [location] [settings]
-% {\bgroup
-% \dowithnextbox
-% {\!!doneafalse
-% \!!donebfalse
-% \processallactionsinset
-% [\v!left,\v!bottom,#2]
-% [ \v!left=>\!!doneatrue ,
-% \v!right=>\!!doneafalse,
-% \v!top=>\!!donebtrue ,
-% \v!bottom=>\!!donebfalse]%
-% \!!widtha\nextboxwd
-% \if!!donea
-% % unchecked
-% \advance\!!widtha-\backspace
-% \else
-% % unchecked
-% \advance\!!widtha-\backspace
-% \fi
-% \!!widtha\textwidth % could be an option
-% \!!heighta\nextboxht
-% % zou een macro moeten zijn \getnoflayoutlines
-% \ifnum\layoutparameter\c!lines=\zerocount
-% \getnoflines\textheight
-% \else
-% \noflines\layoutparameter\c!lines
-% \fi
-% %
-% \advance\noflines \plusone % wordt default, instelbaar
-% \!!heightb\noflines\lineheight\relax
-% \if!!doneb % boven
-% % unchecked
-% \advance\!!heighta-\topspace
-% \advance\!!heighta-\headerheight
-% \advance\!!heighta-\headerdistance
-% \else % onder
-% % checked
-% \advance\!!heighta-\paperheight
-% \advance\!!heighta+\!!heightb
-% \advance\!!heighta+\topspace
-% \advance\!!heighta+\headerheight
-% \advance\!!heighta+\headerdistance
-% \advance\!!heighta-\footerdistance
-% \advance\!!heighta-\footerheight
-% \fi
-% \getnoflines\!!heighta
-% \!!heighta\noflines\lineheight\relax
-% \def\docornerfigure[####1]%
-% {\expanded{\plaatsfiguur[####1,\v!none]{}
-% {\noexpand\phantombox[\c!width=\the\!!widtha,\c!height=\the\!!heighta]}}}%
-% \if!!donea
-% \if!!doneb % links boven / rb
-% \setlayer[#1]
-% [\c!corner={\v!left,\v!top},\c!location=rb,#3]
-% {\flushnextbox}%
-% \docornerfigure[tblr]%
-% \else % links onder / rt
-% \setlayer[#1]
-% [\c!corner={\v!left,\v!bottom},\c!location=rt,#3]
-% {\flushnextbox}%
-% \docornerfigure[btlr]%
-% \fi
-% \else
-% \if!!doneb % rechts boven / lt
-% \setlayer[#1]
-% [\c!corner={\v!right,\v!top},\c!location=lb,#3]
-% {\flushnextbox}%
-% \docornerfigure[tbrl]%
-% \else % rechts onder / lb
-% \setlayer[#1]
-% [\c!corner={\v!right,\v!bottom},\c!location=lt,#3]
-% {\flushnextbox}%
-% \docornerfigure[btrl]%
-% \fi
-% \fi
-% \egroup}
-% \vbox}
diff --git a/Master/texmf-dist/tex/context/base/mkii/page-sid.mkii b/Master/texmf-dist/tex/context/base/mkii/page-sid.mkii
deleted file mode 100644
index 6c3447e1ca0..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/page-sid.mkii
+++ /dev/null
@@ -1,931 +0,0 @@
-%D \module
-%D [ file=page-sid,
-%D version=2000.10.20,
-%D title=\CONTEXT\ Page Macros,
-%D subtitle=Side Floats,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 / Side Floats}
-
-\unprotect
-
-% problem: when too small, side effects; we need to determine the
-% shift earlier so that we can act when shift < size
-%
-% \definefloat[edgefigure]
-% \setupfloat
-% [edgefigure]
-% [rightmargindistance=-\rightmargintotal,
-% leftmargindistance=-\rightmargintotal,
-% default=outer]
-% \starttext
-% \placeedgefigure{}{\framed[width=12cm]{}} \input tufte
-% \placeedgefigure{}{\framed[width=5cm]{}} \input tufte
-% \placeedgefigure{}{\framed[width=4cm]{}} \input tufte
-% \placeedgefigure{}{\framed[width=2cm]{}} \input tufte
-% \stoptext
-
-% todo: dimexpr an dnumexpr
-
-% These macro deal with side floats. We started with Daniel
-% Comenetz macros as published in TUGBoat Volume 14 (1993),
-% No.\ 1: Anchored Figures at Either Margin. I extended and
-% patched the macros to suite our needs which results in a
-% messy module. Therefore, this module badly needs an update
-% because it's now a mixture of old and new macros.
-
-% afhankelijke variabelen
-%
-% \overgap vervangen door \floatsidetopskip
-% \sidegap vervangen door \floatsideskip
-% \undergap vervangen door \floatsidebottomskip
-%
-% \prskp vervangen door \ctxparskip
-
-% toegevoegde macro's/aanroepen
-%
-% \logsidefloat : loginformatie
-% \flushsidefloats : nodig voor koppen
-
-% recente wijzigingen:
-%
-% namen aangepast: \float... enz. i.p.v. \pic
-
-% Pas op: \EveryPar{\EveryPar{}\margetitel{whatever}}
-% \plaatsfiguur[links]{}{} moet goed gaan. In dat geval
-% begint de tekst terecht wat lager.
-
-\newdimen\sidefloatheight % includes the topskip
-\newdimen\sidefloatwidth
-\newdimen\sidefloathsize
-\newdimen\sidefloatshift
-\newdimen\sidefloatextrashift
-\newdimen\sidefloatvsize \def\nofloatvsize{-1pt }
-\newdimen\sidefloatprogress
-\newdimen\sidefloatpagetotal
-
-\newbox\floatbottom
-
-\newcount\sidefloatsidelines
-\newcount\sidefloatlinesdone
-
-% 1 = backspace
-% 2 = leftedge
-% 3 = leftmargin
-% 4 = leftside
-% 5 = rightside
-% 6 = rightmargin
-% 7 = rightedge
-% 8 = cutspace
-
-\chardef\sidefloattype\zerocount
-
-\def\backspacefloat {\global\chardef\sidefloattype1 \putsidefloat}
-\def\leftedgefloat {\global\chardef\sidefloattype2 \putsidefloat}
-\def\leftmarginfloat {\global\chardef\sidefloattype3 \putsidefloat}
-\def\leftfloat {\global\chardef\sidefloattype4 \putsidefloat}
-\def\rightfloat {\global\chardef\sidefloattype5 \putsidefloat}
-\def\rightmarginfloat {\global\chardef\sidefloattype6 \putsidefloat}
-\def\rightedgefloat {\global\chardef\sidefloattype7 \putsidefloat}
-\def\cutspacefloat {\global\chardef\sidefloattype8 \putsidefloat}
-
-\let\marginfloat \cutspacefloat
-
-\newif\ifroomforfloat
-\newif\iffloatshort
-\newif\iffloatflag
-\newif\iffloatrighteqo
-\newif\iffloatlefteqo
-
-\newdimen\sidefloatleftskip
-\newdimen\sidefloatrightskip
-\newdimen\sidefloatmaximum
-
-% \def\checksidefloatshift
-% {\ifdim\sidefloatmaximum>\zeropoint
-% \ifcase\sidefloattype
-% % invalid
-% \or
-% % backspace
-% \or
-% \global\sidefloatshift-\sidefloatmaximum
-% \global\advance\sidefloatshift-\rightorleftpageaction \leftedgedistance \rightedgedistance
-% \global\advance\sidefloatshift-\rightorleftpageaction \leftmarginwidth \rightmarginwidth
-% \global\advance\sidefloatshift-\rightorleftpageaction \leftmargindistance \rightmargindistance
-% \or
-% \global\sidefloatshift-\sidefloatmaximum
-% \global\advance\sidefloatshift-\rightorleftpageaction \leftmargindistance \rightmargindistance
-% \or
-% % left
-% \or
-% % right
-% \or
-% \global\sidefloatshift-\sidefloatmaximum
-% \global\advance\sidefloatshift-\rightorleftpageaction \leftmargindistance \rightmargindistance
-% \or
-% \global\sidefloatshift-\sidefloatmaximum
-% \global\advance\sidefloatshift-\rightorleftpageaction \leftedgedistance \rightedgedistance
-% \global\advance\sidefloatshift-\rightorleftpageaction \leftmarginwidth \rightmarginwidth
-% \global\advance\sidefloatshift-\rightorleftpageaction \leftmargindistance \rightmargindistance
-% \or
-% % cutspace
-% \fi
-% \fi}
-
-\def\checksidefloatshift
- {\ifdim\sidefloatmaximum>\zeropoint
- \ifcase\sidefloattype
- % invalid
- \or
- % backspace
- \or
- \global\sidefloatshift\dimexpr
- -\sidefloatmaximum
- -\rightorleftpageaction \leftedgedistance \rightedgedistance
- -\rightorleftpageaction \leftmarginwidth \rightmarginwidth
- -\rightorleftpageaction \leftmargindistance \rightmargindistance
- -\compensatedinnermakeupmargin
- \relax
- \or
- \global\sidefloatshift\dimexpr
- -\sidefloatmaximum
- -\rightorleftpageaction \leftmargindistance \rightmargindistance
- -\compensatedinnermakeupmargin
- \relax
- \or
- % left
- \or
- % right
- \or
- \global\sidefloatshift\dimexpr
- -\sidefloatmaximum
- -\rightorleftpageaction \leftmargindistance \rightmargindistance
- -\compensatedinnermakeupmargin
- \relax
- \or
- \global\sidefloatshift\dimexpr
- -\sidefloatmaximum
- -\rightorleftpageaction \leftedgedistance \rightedgedistance
- -\rightorleftpageaction \leftmarginwidth \rightmarginwidth
- -\rightorleftpageaction \leftmargindistance \rightmargindistance
- -\compensatedinnermakeupmargin
- \relax
- \or
- % cutspace
- \fi
- \fi}
-
-% \def\setsidefloatskips
-% {\global\sidefloatrightskip\zeropoint
-% \global\sidefloatleftskip \zeropoint
-% \ifcase\sidefloattype
-% \or % backspace
-% \global \sidefloatleftskip \rightorleftpageaction \backspace \cutspace
-% \or % leftedge
-% \global \sidefloatleftskip \rightorleftpageaction \leftmargindistance\rightmargindistance
-% \global\advance\sidefloatleftskip \rightorleftpageaction \leftmarginwidth\rightmarginwidth
-% \global\advance\sidefloatleftskip \rightorleftpageaction \leftedgedistance\rightedgedistance
-% \or % leftmargin
-% \global \sidefloatleftskip \rightorleftpageaction \leftmargindistance\rightmargindistance
-% \or % leftside
-% \or % rightside
-% \or % rightmargin
-% \global \sidefloatrightskip\rightorleftpageaction \rightmargindistance\leftmargindistance
-% \or % rightedge
-% \global \sidefloatrightskip\rightorleftpageaction \rightmargindistance\leftmargindistance
-% \global\advance\sidefloatrightskip\rightorleftpageaction \rightmarginwidth\leftmarginwidth
-% \global\advance\sidefloatrightskip\rightorleftpageaction \rightedgedistance\leftedgedistance
-% \or % cutspace
-% \global \sidefloatrightskip\rightorleftpageaction \cutspace\backspace
-% \fi
-% \ifdim\sidefloatrightskip>\zeropoint
-% \doglobal\advance\sidefloatrightskip\rightskip
-% \fi
-% \ifdim\sidefloatleftskip>\zeropoint
-% \doglobal\advance\sidefloatleftskip\leftskip
-% \fi}
-
-
-% use \outermarginwidth etc here
-
-\def\setsidefloatskips
- {\global\sidefloatrightskip\zeropoint
- \global\sidefloatleftskip \zeropoint
- \ifcase\sidefloattype
- \or % backspace
- \global\sidefloatleftskip\dimexpr
- +\rightorleftpageaction \backspace \cutspace
- +\compensatedinnermakeupmargin
- \relax
- \or % leftedge
- \global\sidefloatleftskip\dimexpr
- +\rightorleftpageaction \leftmargindistance \rightmargindistance
- +\rightorleftpageaction \leftmarginwidth \rightmarginwidth
- +\rightorleftpageaction \leftedgedistance \rightedgedistance
- +\compensatedinnermakeupmargin
- \relax
- \or % leftmargin
- \global\sidefloatleftskip\dimexpr
- +\rightorleftpageaction \leftmargindistance \rightmargindistance
- +\compensatedinnermakeupmargin
- \relax
- \or % leftside
- \or % rightside
- \or % rightmargin
- \global\sidefloatrightskip\dimexpr
- +\rightorleftpageaction \rightmargindistance \leftmargindistance
- +\compensatedinnermakeupmargin
- \relax
- \or % rightedge
- \global\sidefloatrightskip\dimexpr
- +\rightorleftpageaction \rightmargindistance \leftmargindistance
- +\rightorleftpageaction \rightmarginwidth \leftmarginwidth
- +\rightorleftpageaction \rightedgedistance \leftedgedistance
- +\compensatedinnermakeupmargin
- \relax
- \or % cutspace
- \global\sidefloatrightskip\dimexpr
- +\rightorleftpageaction \cutspace \backspace
- +\compensatedinnermakeupmargin
- \relax
- \fi
- \ifdim\sidefloatrightskip>\zeropoint \doglobal\advance\sidefloatrightskip\rightskip \fi
- \ifdim\sidefloatleftskip >\zeropoint \doglobal\advance\sidefloatleftskip \leftskip \fi}
-
-% eq is still crap
-
-\ifx\normalleqno\undefined
-
- \let\floatrighteqo=\eqno
- \let\floatleftleqo=\leqno
-
-\else
-
- \let\floatrighteqo=\normaleqno
- \let\floatleftleqo=\normalleqno
-
-\fi
-
-% Watch it even more! In inner, gaat't mis omdat daar
-% pagetotal enz niet zijn aangepast. Inner kan overigens niet
-% betrouwbaar worden getest!
-
-% \def\flushsidefloats%
-% {\par
-% \sidefloatprogress=\sidefloatvsize
-% \advance\sidefloatprogress by -\pagetotal
-% \ifdim\sidefloatprogress>\zeropoint
-% \witruimte % nog checken op interferentie
-% \kern\sidefloatprogress
-% \fi
-% \global\sidefloatvsize=\nofloatvsize
-% \global\floatflagfalse}
-%
-% no, too buggy, leads to top of page crap
-%
-%\def\flushsidefloats
-% {\par
-% \dochecksidefloat
-% \scratchcounter=-\hangafter
-% \dorecurse{\scratchcounter}{\strut\hfill\strut\par}}
-%
-%\def\flushsidefloats
-% {\par
-% \!!heighta\sidefloatvsize
-% \advance\!!heighta -\pagetotal
-% \ifdim\!!heighta>\zeropoint
-% % to be checked for interference
-% \witruimte
-% % will be option
-% \getnoflines\!!heighta
-% \!!heighta\noflines\lineheight
-% % so far for option
-% \kern\!!heighta
-% \fi
-% % == \forgetsidefloats
-% \global\sidefloatvsize\nofloatvsize
-% \global\floatshortfalse
-% \global\floatflagfalse}
-
-% \def\flushsidefloats
-% {\par
-% \!!heighta\sidefloatvsize
-% \advance\!!heighta -\pagetotal
-% \ifdim\!!heighta>\zeropoint
-% % to be checked for interference
-% \witruimte
-% % will be option
-% \getnoflines\!!heighta
-% \!!heighta\noflines\lineheight
-% % so far for option
-% \ifdim\sidefloatbottomskip>\zeropoint\relax
-% \ifdim\!!heighta>\sidefloatbottomskip
-% \advance\!!heighta-\sidefloatbottomskip
-% \kern\!!heighta
-% \vskip\sidefloatbottomskip
-% \else
-% \kern\!!heighta
-% \fi
-% \else
-% \kern\!!heighta
-% \fi
-% \fi
-% % == \forgetsidefloats
-% \global\sidefloatvsize\nofloatvsize
-% \global\floatshortfalse
-% \global\floatflagfalse}
-
-\newif\iftracesidefloats
-
-\def\flushsidefloats
- {\par
- \!!heighta\sidefloatvsize
- \advance\!!heighta -\pagetotal
- \ifnum\!!heighta>\zeropoint
- \global\advance\sidefloatvsize -\sidefloatbottomskip
- \ifdim\!!heighta>\zeropoint
- \bgroup
- \let\flushsidefloats\relax
- \forgetall
- \doloop
- {\strut
- \iftracesidefloats
- \color[darkgray]%
- {\baselinerulefalse
- \boxrulewidth.5\points
- \ruledhbox{\strut\kern\sidefloatwidth}}%
- \fi
- \par
- \!!heighta\sidefloatvsize
- \advance\!!heighta -\pagetotal
- \ifdim\!!heighta>\zeropoint
- \ifnum\recurselevel>\plushundred
- \exitloop
- \fi
- \else
- \exitloop
- \fi}%
- \egroup
- \ifdim\parskip>\zeropoint
- \ifdim\sidefloatbottomskip>\parskip
- \nowhitespace
- \vskip\sidefloatbottomskip
- \fi
- \fi
- \else\ifdim\sidefloatbottomskip>\parskip
- \vskip\sidefloatbottomskip
- \fi\fi
- \fi
- % not entirely the same as \forgetsidefloats
- \global\sidefloatvsize\nofloatvsize
- % \global\sidefloatsidelines\zerocount % no, we flush before a side float
- \global\floatshortfalse % so this will get lost
- % also here if used at all \global\holdinginserts\zerocount
- \global\floatflagfalse}
-
-\def\flushsidefloatsafterpar
- {\xdef\oldpagetotal{\the\pagetotal}%
- \gdef\checksidefloat
- {\dochecksidefloat
- \ifdim\oldpagetotal=\pagetotal \else
- \global\let\checksidefloat\dochecksidefloat
- \flushsidefloats
- \global\sidefloatsidelines\zerocount % here !
- \fi}}
-
-\def\forgetsidefloats
- {\global\sidefloatvsize\nofloatvsize
- \global\sidefloatsidelines\zerocount
- % also here if used at all \global\holdinginserts\zerocount
- \global\floatshortfalse
- \global\floatflagfalse}
-
-\let\logsidefloat=\relax
-
-\def\pushpenalties % needed ? and right
- {\widowpenalty\plusone
- \clubpenalty\plustwo
- \brokenpenalty\plusone
- \let\pushpenalties\relax
- \edef\poppenalties
- {\widowpenalty \the\widowpenalty
- \clubpenalty \the\clubpenalty
- \brokenpenalty\the\brokenpenalty
- \let\poppenalties\relax}}
-
-% shouldn;t that be:
-%
-% \def\pushpenalties % needed?
-% {\let\pushpenalties\relax
-% \edef\poppenalties
-% {\widowpenalty \the\widowpenalty
-% \clubpenalty \the\clubpenalty
-% \brokenpenalty\the\brokenpenalty
-% \let\poppenalties\relax}%
-% \widowpenalty\plusone
-% \clubpenalty\plustwo
-% \brokenpenalty\plusone}
-
-\let\poppenalties=\relax
-
-\def\restorepenalties
- {\ifnum\outputpenalty=\!!tenthousand\else
- \penalty\outputpenalty
- \fi}
-
-\def\sidefloatoutput
- {\iffloatshort
- \unvbox\normalpagebox
- \setbox\floatbottom\lastbox
- \ifdim\wd\floatbottom>\sidefloathsize
- \penalty-201
- \box\floatbottom
- \else
- \ifvoid\floatbottom
- \else
- \restoreleftindent
- \ifdim\wd\floatbottom<\sidefloathsize
- \parskip\zeropoint
- %\noindent
- \ifinner\else\vadjust{\penalty\minusone}\fi
- \iffloatlefteqo
- \global\floatlefteqofalse
- \else
- \global\advance\sidefloathsize -\wd\floatbottom
- \iffloatrighteqo
- \global\floatrighteqofalse
- \else
- \global\divide\sidefloathsize \plustwo
- \fi
- \hskip\sidefloathsize
- \fi
- \fi
- \box\floatbottom
- \restorepenalties
- \fi
- \fi
- % why was this \global\holdinginserts\zerocount
- \global\floatshortfalse
- \else
- \finalsidefloatoutput % new
- \global\sidefloatvsize\nofloatvsize
- \global\sidefloatsidelines\zerocount
- % we can end up in fig lock, so \global\holdinginserts\zerocount here too ?
- \poppenalties
- \fi}
-
-\def\finalsidefloatoutput% new
- {\finaloutput\unvbox\normalpagebox}
-
-\def\restoreleftindent
- {\relax \ifnum\sidefloattype>4 \else
- \parskip\zeropoint % here ?
- \ifdim\sidefloatwidth>\zeropoint % new, see prikkels
- \noindent
- \ifinner\else\vadjust{\penalty\minusone}\fi
- \hskip\sidefloatwidth
- %\else
- % we have a margin or edge float
- \fi
- \fi}
-
-\ifx\normaleqno\undefined
-
- \def\normaleqno
- {\iffloatshort
- \global\floatrighteqotrue
- \fi
- \floatrighteqo}
-
-\else
-
- \def\eqno
- {\iffloatshort
- \global\floatrighteqotrue
- \fi
- \floatrighteqo}
-
-\fi
-
-% externfiguur -> grid =ja|hoogte|diepte|halveregel|passend -> helemaal in details
-% stelplaatsblokin -> zijuitlijnen=hoogte|diepte|regel|halveregel|grid -> halveregel in 'details'
-
-% replacement for below
-%
-% \global\setbox\floatbox\hbox % no \hskip, but \kern here
-% {\ifcase\sidefloattype
-% \vbox{#1}%
-% \or % 1
-% \hskip\sidefloatleftshift
-% \hskip\sidefloatshift
-% \vbox{#1}%
-% \kern-\sidefloatextrashift
-% \or % 2
-% \hskip\sidefloatshift
-% \vbox{#1}%
-% \kern-\sidefloatextrashift
-% \or % 3
-% \hskip\sidefloatshift
-% \vbox{#1}%
-% \kern-\sidefloatextrashift
-% \or % 4
-% \hskip\sidefloatleftshift
-% \hskip\sidefloatshift
-% \vbox{#1\removedepth}%
-% \kern-\sidefloatextrashift
-% \or % 5
-% \hskip-\sidefloatextrashift
-% \vbox{#1}%
-% \kern\sidefloatshift
-% \kern\sidefloatrightshift
-% \or % 6
-% \hskip-\sidefloatextrashift
-% \vbox{#1}%
-% \kern\sidefloatshift
-% \or % 7
-% \hskip-\sidefloatextrashift
-% \vbox{#1}%
-% \kern\sidefloatshift
-% \or % 8
-% \hskip-\sidefloatextrashift
-% \vbox{#1}%
-% \kern\sidefloatshift
-% \kern\sidefloatrightshift
-% \fi}%
-%
-% keep this ^
-
-\def\putsidefloat#1% grid (4) is rather experimental
- {\par
- \whitespace
- % moved here dec 2001
- {\everypar\emptytoks\forgetall\verticalstrut\vskip-\struttotal}% moved
- \checksidefloatshift
- \ifdim\sidefloatshift=\zeropoint \relax
- \ifnum\sidefloattype=4
- \global\advance\sidefloatshift\sidefloatextrashift
- \global\sidefloatextrashift\zeropoint
- \else\ifnum\sidefloattype=5
- \global\advance\sidefloatshift\sidefloatextrashift
- \global\sidefloatextrashift\zeropoint
- \fi\fi
- \else
- \ifnum\sidefloattype<4
- \global\chardef\sidefloattype4
- \else\ifnum\sidefloattype>5
- \global\chardef\sidefloattype5
- \fi\fi
- \fi
- \previoussidefloat
- \stallsidefloat
- %\global\setbox\floatbox\hbox
- % {\ifmarginfloat\else\ifrightfloat\else\kern\sidefloatleftshift\fi\fi
- % \hskip\ifrightfloat-\sidefloatextrashift\else\sidefloatshift\fi
- % \vbox{#1\ifnum\sidefloatalign=4 \removedepth\fi}%
- % \kern\ifrightfloat\sidefloatshift\else-\sidefloatextrashift\fi
- % \ifmarginfloat\else\ifrightfloat\kern\sidefloatrightshift\fi\fi}%
- \global\setbox\floatbox\hbox % no \hskip, but \kern here
- {\ifnum\sidefloattype=4
- \hskip\sidefloatleftshift
- \else\ifnum\sidefloattype=1
- \hskip\sidefloatleftshift
- \fi\fi
- \ifnum\sidefloattype>4
- \hskip-\sidefloatextrashift
- \else
- \hskip\sidefloatshift
- \fi
- \vbox{#1\ifnum\sidefloatalign=4 \removedepth\fi}%
- \ifnum\sidefloattype>4
- \kern\sidefloatshift
- \else
- \kern-\sidefloatextrashift
- \fi
- \ifnum\sidefloattype=8
- \kern\sidefloatrightshift
- \else\ifnum\sidefloattype=5
- \kern\sidefloatrightshift
- \fi\fi}%
- \ifnum\sidefloatalign=4
- \getnoflines{\ht\floatbox}%
- \scratchdimen\noflines\lineheight
- \advance\scratchdimen-\strutdepth
- \getrawnoflines\sidefloattopskip
- \advance\scratchdimen\noflines\lineheight
- % todo: maybe rounding problem here
- % \global\setbox\floatbox\hbox{\lower\lineheight\box\floatbox}%
- \global\setbox\floatbox\hbox{\lower\strutdepth\box\floatbox}%
- \ht\floatbox\scratchdimen
- \dp\floatbox\zeropoint
- \fi
- \ifcase\sidefloatalign \else
- \global\sidefloattopskip\zeropoint
- \fi
- \scratchdimen
- \ifnum\sidefloattype<4
- \sidefloattopskip
- \else\ifnum\sidefloattype>5
- \sidefloattopskip
- \else
- \zeropoint
- \fi\fi
- % the top of the box is at the previous baseline
- \ifcase\sidefloatalign
- % 0 normal
- \advance\scratchdimen\strutdepth % == \sidefloattopoffset
- \or % 1 height
- \advance\scratchdimen\strutdepth % == \sidefloattopoffset
- \or % 2 line
- \or % 3 depth
- \advance\scratchdimen\lineheight
- \advance\scratchdimen\strutdepth
- \or % 4 grid
- \scratchdimen\zeropoint
- \or
- \advance\scratchdimen\strutheight
- \fi
- % new
- \global\sidefloatlinesdone\zerocount
- \ifnum\sidefloatsidelines>\zerocount
- \advance\scratchdimen\sidefloatsidelines\lineheight
- \fi
- % new
- \global\setbox\floatbox\hbox
- {\vbox
- {\vskip\scratchdimen
- \nointerlineskip
- \box\floatbox
- \ifnum\sidefloatalign=5 \vskip-\lineheight \fi}}%
- \ifnum\sidefloattype<4
- \global\sidefloattopskip\zeropoint
- \else\ifnum\sidefloattype>5
- \global\sidefloattopskip\zeropoint
- \fi\fi
- \global\sidefloatdownshift\zeropoint
- \measuresidefloat
- \ifroomforfloat \else
- \tosssidefloat
- \measuresidefloat
- \stallsidefloat
- \fi
- \setsidefloat}
-
-\def\progresssidefloat
- {\sidefloatprogress\sidefloatvsize
- \iffloatflag
- \advance\sidefloatprogress -\sidefloatpagetotal
- \global\floatflagfalse
- \else
- \advance\sidefloatprogress -\pagetotal
- \fi}
-
-\def\tosssidefloat
- {\vfill\eject}
-
-\def\measuresidefloat
- {\global\floatflagtrue
- \global\sidefloatpagetotal \pagetotal % global
- \ifnum\sidefloattype<4
- \global \sidefloatwidth \zeropoint
- \else\ifnum\sidefloattype>5
- \global \sidefloatwidth \zeropoint
- \else
- \global \sidefloatwidth \wd\floatbox
- \global\advance\sidefloatwidth \floatsideskip
- \fi\fi
- \ifdim\sidefloatwidth<\zeropoint
- \global\sidefloatwidth\zeropoint
- \fi
- \global \sidefloathsize \hsize
- \global\advance\sidefloathsize -\sidefloatwidth
- \global \sidefloatheight \ht\floatbox
- \global\advance\sidefloatheight \dp\floatbox
- \global\advance\sidefloatheight \sidefloattopskip
- \global \sidefloatvsize \sidefloatheight
- \global\advance\sidefloatvsize \sidefloatpagetotal
- \dimen0\sidefloatvsize
- \dimen2\pagegoal
- \relax
- \ifcase\sidefloatmethod
- % 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
- \dimen0=\pagegoal
- \advance\dimen0 -\sidefloatvsize
- \ifdim\dimen0<\sidefloatbottomskip
- \global\advance\sidefloatvsize \dimen0
- \global\floatshorttrue
- \pushpenalties
- % why was this \global\holdinginserts\plusone
- \else
- \global\advance\sidefloatvsize \sidefloatbottomskip
- \global\floatshortfalse
- \fi
- \global\roomforfloattrue
- \fi}
-
-\def\setsidefloat% nilling everypar saves time and redudant pos's
- {% removed here dec 2001
- % {\everypar\emptytoks\forgetall\verticalstrut\vskip-\struttotal}%
- \ifnum\sidefloattype=4 \kern\sidefloattopskip \fi
- \ifnum\sidefloattype=5 \kern\sidefloattopskip \fi
- \edef\presidefloatdepth{\the\prevdepth}%
- \nointerlineskip
- \bgroup
- \everypar\emptytoks
- \parskip\zeropoint
- %\checksidefloatshift
- \setsidefloatskips
- \logsidefloat
- \relax
- \ifcase\sidefloattype
- % invalid
- \or % backspace
- \noindent\llap{\rlap{\box\floatbox}\hskip\sidefloatleftskip}\hfill
- \or % leftedge
- \noindent\llap{\box\floatbox\hskip\sidefloatleftskip}\hfill
- \or % leftmargin
- \noindent\llap{\box\floatbox\hskip\sidefloatleftskip}\hfill
- \or % leftside
- \noindent\box\floatbox\hfill
- \or % rightside
- \hfill\box\floatbox
- \or % rightmargin
- \hfill\rlap{\hskip\sidefloatrightskip\box\floatbox}%
- \or % rightedge
- \hfill\rlap{\hskip\sidefloatrightskip\box\floatbox}%
- \or % cutspace
- \hfill\rlap{\hskip\sidefloatrightskip\llap{\box\floatbox}}%
- \fi
- \egroup
- \par
- \kern-\sidefloatheight
- \penalty10001 % oeps, this will change
- \normalbaselines
- \prevdepth\presidefloatdepth
- % \noindent
- \resetsidefloatparagraph
- \ignorespaces} % not really needed
-
-\newcount\sidefloatparagraph
-
-\def\iffirstsidefloatparagraph
- {\ifcase\sidefloatparagraph\or}
-
-% without sidefloat lines
-%
-% \def\setsidefloatparagraph
-% {%\advance\sidefloatprogress \sidefloatbottomskip
-% %\!!counta\sidefloatprogress
-% \scratchdimen\sidefloatprogress
-% \advance\scratchdimen \strutht
-% \advance\scratchdimen -\roundingeps % new, needed in prikkels, prevent rounding errors
-% \!!counta\scratchdimen
-% \divide\!!counta \baselineskip
-% \ifnum\!!counta>0
-% \hangindent \ifnum\sidefloattype>4 -\fi\sidefloatwidth
-% \hangafter-\!!counta
-% \fi
-% \global\advance\sidefloatparagraph \plusone
-% \iftracesidefloats
-% \hskip-\sidefloatwidth
-% \color[darkgray]%
-% {\vrule\!!height.5\points\!!depth.5\points\!!width\sidefloatwidth
-% %\hskip-.25\bodyfontsize\showstruts\strut\hskip.25\bodyfontsize}%
-% \llap{\showstruts\strut\hskip.25\bodyfontsize}}%
-% \fi}
-
-\def\setsidefloatparagraph
- {%\advance\sidefloatprogress \sidefloatbottomskip
- %\!!counta\sidefloatprogress
- \scratchdimen\sidefloatprogress
- \advance\scratchdimen \strutht
- \advance\scratchdimen -\roundingeps % new, needed in prikkels, prevent rounding errors
- \!!counta\scratchdimen
- \divide\!!counta \baselineskip\relax
- \ifnum\!!counta>0
- % new from here
- \ifcase\sidefloatsidelines\else
- \ifcase\sidefloatlinesdone
- \global\sidefloatlinesdone\!!counta
- \else
- \scratchcounter\sidefloatlinesdone
- \advance\scratchcounter-\!!counta
- \global\advance\sidefloatsidelines-\scratchcounter
- \fi
- \fi
- \ifnum\sidefloatsidelines>\zerocount
- \scratchtoks\emptytoks
- \scratchcounter\sidefloatsidelines
- \scratchdimen\hsize
- \advance\scratchdimen-\sidefloatwidth
- \dorecurse\sidefloatsidelines
- {\appendtoks \zeropoint \hsize \to \scratchtoks}%
- \ifnum\!!counta>\sidefloatsidelines
- \advance\!!counta -\sidefloatsidelines\relax
- \advance\scratchcounter\!!counta
- \dorecurse\!!counta
- {\ifnum\sidefloattype>4
- \appendtoks \zeropoint \scratchdimen \to \scratchtoks
- \else
- \appendtoks \sidefloatwidth \scratchdimen \to \scratchtoks
- \fi}%
- \fi
- \advance\scratchcounter \plusone
- \parshape \scratchcounter \the\scratchtoks \zeropoint \hsize\relax
- \else
- % new till here
- \hangindent \ifnum\sidefloattype>4 -\fi\sidefloatwidth
- \hangafter-\!!counta
- \fi
- \fi
- \global\advance\sidefloatparagraph \plusone
- \iftracesidefloats
- \hskip-\sidefloatwidth
- \color[darkgray]%
- {\vrule\!!height.5\points\!!depth.5\points\!!width\sidefloatwidth
- %\hskip-.25\bodyfontsize\showstruts\strut\hskip.25\bodyfontsize}%
- \llap{\showstruts\strut\hskip.25\bodyfontsize}}%
- \fi}
-
-\def\resetsidefloatparagraph
- {\global\sidefloatparagraph\zerocount }
-
-\def\dochecksidefloat
- {\progresssidefloat
- \ifdim\sidefloatprogress>\zeropoint
- \setsidefloatparagraph
- \else
- \resetsidefloatparagraph
- \fi
- \parskip\ctxparskip}
-
-\def\checksidefloat
- {\dochecksidefloat}
-
-\def\synchronizesidefloats
- {\ifinner \else \checksidefloat \fi}
-
-\def\doadjustsidefloatdisplaylines
- {\par
- \vskip-\parskip
- \noindent
- \ignorespaces}
-
-\def\adjustsidefloatdisplaylines
- {\aftergroup\doadjustsidefloatdisplaylines}
-
-\def\previoussidefloat
- {\progresssidefloat
- \ifdim\sidefloatprogress>\zeropoint \relax
- \iffloatshort
- \global\floatshortfalse
- \tosssidefloat
- \else
- \kern\sidefloatprogress
- \fi
- \fi}
-
-\def\stallsidefloat
- {\!!counta\pageshrink
- \divide\!!counta \baselineskip
- \advance\!!counta \plusone
- \parskip\zeropoint
- \dorecurse\!!counta{\line{}}%
- \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/mkii/page-spr.mkii b/Master/texmf-dist/tex/context/base/mkii/page-spr.mkii
deleted file mode 100644
index 65e435d7c2f..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/page-spr.mkii
+++ /dev/null
@@ -1,104 +0,0 @@
-%D \module
-%D [ file=page-spr,
-%D version=2002.11.11,
-%D title=\CONTEXT\ Page Macros,
-%D subtitle=Spreading,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 / Spreading}
-
-% This module is experimental and not yet official!
-
-\unprotect
-
-\newbox\spreadbox
-\newif \ifinspread
-
-\chardef\showspreadmode=1
-
-% beware, ugly overload, to be redone
-
-\def\normalsettextpagecontent#1#2#3% #2 and #3 will disappear
- {\setbox#1\hbox
- {\vbox to \textheight
- {\offinterlineskip
- \freezetextwidth
- \hsize\textwidth % local variant of \sethsize
- \boxmaxdepth\maxdepth
- \noindent % content can be < \hsize
- \dopagecontents#2#3}}%
- \dp#1\zeropoint
- \setbox#1\hbox to \makeupwidth
- {\ifinspread
- \ifvoid\spreadbox
- \global\setbox\spreadbox\box#1%
- \copy\spreadbox\hss % left page
- \else
- % prevent duplicate writes in normal run
- \ifarrangingpages \else \ifcase\showspreadmode
- \global\setbox\spreadbox\null
- \wd\spreadbox\makeupwidth
- \ht\spreadbox\textheight
- \fi \fi
- \hss\box\spreadbox % right page
- \fi
- \else
- \hss\box#1\hss % never change the \hss's
- \fi}}
-
-\def\doflushspread
- {\ifinspread \ifvoid\spreadbox\else
- % this page will be discarded later
- \null \page
- \fi \fi }
-
-\def\startspread
- {\bgroup
- \ifdoublesided
- \page[\v!left]%
- %\setsystemmode{spread}%
- \inspreadtrue
- \scratchdimen2\textwidth
- \advance\scratchdimen2\backspace
- \expanded{\setuplayout[\c!textwidth=\the\scratchdimen]}%
- \def\startspread{\bgroup\let\stopspread\egroup}%
- \let\stopspread\dostopspread
- \else
- \let\stopspread\egroup
- \fi}
-
-\let\stopspread\relax
-
-\def\dostopspread
- {\kern\zeropoint\page
- \inspreadfalse
- \setuplayout[\c!textwidth=\textwidth]
- \page[\v!left]
- \egroup}
-
-\protect \endinput
-
-% texexec --arr --pdf test
-%
-% \setuplayout[width=middle]
-% \setuppapersize[A4][A3,landscape]
-% \setuppagenumbering[alternative=doublesided]
-% \setuparranging[2UP]
-%
-% \starttext
-%
-% \dorecurse{3}{\input tufte }
-%
-% \startspread
-% \dorecurse{10}{\input tufte }
-% \stopspread
-%
-% \dorecurse{3}{\input tufte }
-%
-% \stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkii/page-str.mkii b/Master/texmf-dist/tex/context/base/mkii/page-str.mkii
deleted file mode 100644
index df0cc5aa2fd..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/page-str.mkii
+++ /dev/null
@@ -1,331 +0,0 @@
-%D \module
-%D [ file=page-str,
-%D version=2006.03.21,
-%D title=\CONTEXT\ Page Macros,
-%D subtitle=Page Streams,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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}.
-
-% not yet ok in mkiv ... marknotes
-
-\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}\emptybox
- \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\outputstreamht [#1]{\ht\outputstreamtag{#1}}
-\def\outputstreamdp [#1]{\dp\outputstreamtag{#1}}
-\def\outputstreamwd [#1]{\wd\outputstreamtag{#1}}
-
-%def\outputstreambox [#1]{\ifvoid\outputstreamtag{#1}\else\box \outputstreamtag{#1}\fi}
-%def\outputstreamcopy[#1]{\ifvoid\outputstreamtag{#1}\else\copy\outputstreamtag{#1}\fi}
-
-\def\dowithoutputstreambox#1[#2]{\ifvoid\outputstreamtag{#2}\else#1\outputstreamtag{#2}\fi}
-
-\def\outputstreamcopy {\dowithoutputstreambox\copy }
-\def\outputstreambox {\dowithoutputstreambox\box }
-\def\outputstreamunvcopy{\dowithoutputstreambox\unvcopy}
-\def\outputstreamunvbox {\dowithoutputstreambox\unvbox }
-
-%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}}{#2}%
- \expanded{\marking[mn:#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 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/mkii/page-txt.mkii b/Master/texmf-dist/tex/context/base/mkii/page-txt.mkii
deleted file mode 100644
index dd643b1b4e6..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/page-txt.mkii
+++ /dev/null
@@ -1,784 +0,0 @@
-%D \module
-%D [ file=page-txt, % copied from main-001,
-%D version=1997.03.31,
-%D title=\CONTEXT\ Page Macros,
-%D subtitle=Texts,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% \setuplayouttext in manual
-
-\writestatus{loading}{ConTeXt Page Macros / Texts}
-
-\unprotect
-
-\let\dodummypageskip\gobbleoneargument % obsolete
-
-%D Interfacing between this and other modules is handled by
-%D the following macros. The current state of a text line
-%D (header, footer, etc.) is checked by:
-%D
-%D \starttyping
-%D \resetlayouttextlines
-%D \stoptyping
-%D
-%D The main text box is finished by the following macro:
-%D
-%D \starttyping
-%D \getmainbox <box> <\vbox|\unvbox>
-%D \stoptyping
-%D
-%D The text lines are collected with:
-%D
-%D \starttyping
-%D \gettextboxes
-%D \stoptyping
-%D
-%D It is possible to extens the default content of the text
-%D areas by appending content to the following token list
-%D registers:
-
-\newtoks\toptextcontent \newtoks\leftedgetextcontent
-\newtoks\headertextcontent \newtoks\leftmargintextcontent
-\newtoks\footertextcontent \newtoks\rightmargintextcontent
-\newtoks\bottomtextcontent \newtoks\rightedgetextcontent
-
-\newtoks\texttextcontent
-
-%D \macros
-%D {setuptop, setupheader, setuptext,
-%D setupfooter, setupbottom}
-%D
-%D The macros in this module sometimes look a bit more complicated
-%D than needed, which is a direct result of the fact that their
-%D ancestors are quite old and upward compatibility is a must.
-%D
-%D \showsetup{setuptop}
-%D \showsetup{setupheader}
-%D \showsetup{setuptext}
-%D \showsetup{setupfooter}
-%D \showsetup{setupbottom}
-
-\def\setuplayouttext
- {\dotripleempty\dosetuplayouttext}
-
-\def\dosetuplayouttext[#1][#2][#3]% beware, non global
- {\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
- \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]}
-\def\setuptext {\dotripleempty\dosetuplayouttext[\v!text]}
-\def\setupfooter {\dotripleempty\dosetuplayouttext[\v!footer]}
-\def\setupbottom {\dotripleempty\dosetuplayouttext[\v!bottom]}
-
-%D \macros
-%D {noheaderandfooterlines,notopandbottomlines}
-%D
-%D Although not really needed, the following shortcuts
-%D sometimes come in handy.
-%D
-%D \showsetup{noheaderandfooterlines}
-%D \showsetup{notopandbottomlines}
-
-\def\noheaderandfooterlines
- {\setupheader[\c!state=\v!empty]%
- \setupfooter[\c!state=\v!empty]}
-
-\def\notopandbottomlines
- {\setuptop [\c!state=\v!empty]%
- \setupbottom[\c!state=\v!empty]}
-
-%D \macros
-%D {setuptoptexts, setupheadertexts, setuptexttexts,
-%D setupfootertexts, setupbottomtexts}
-%D
-%D The next macros take one or more arguments. The exact setup
-%D depends on the number of arguments. Although not that
-%D intuitive, the current scheme evolved out of the original.
-%D When margin and edge texts as well as middle texts showed
-%D up, the current odd|/|even scheme surfaced.
-%D
-%D \showsetup{setuptoptexts}
-%D \showsetup{setupheadertexts}
-%D \showsetup{setuptexttexts}
-%D \showsetup{setupfootertexts}
-%D \showsetup{setupbottomtexts}
-
-\def\setuptoptexts {\dosixtupleempty\dosetuptexts[\v!top]}
-\def\setupheadertexts {\dosixtupleempty\dosetuptexts[\v!header]}
-\def\setuptexttexts {\dosixtupleempty\dosetuptexts[\v!text]}
-\def\setupfootertexts {\dosixtupleempty\dosetuptexts[\v!footer ]}
-\def\setupbottomtexts {\dosixtupleempty\dosetuptexts[\v!bottom]}
-
-%D The left, right and center variables can also be set
-%D directly using the previously discussed macros.
-
-\def\dosetuptexts[#1][#2][#3][#4][#5][#6]%
- {\ifsixthargument
- \setvalue{\??tk#1#2\c!lefttext}%
- {\dodoubletexts{\??tk#1}{#2}%
- {\c!leftstyle \c!leftcolor \c!leftwidth }{#3}%
- {\c!rightstyle\c!rightcolor\c!rightwidth}{#6}}%
- \setvalue{\??tk#1#2\c!righttext}%
- {\dodoubletexts{\??tk#1}{#2}%
- {\c!rightstyle\c!rightcolor\c!rightwidth}{#4}%
- {\c!leftstyle \c!leftcolor \c!leftwidth }{#5}}%
- \else\iffifthargument
- \setvalue{\??tk#1\v!text\c!lefttext}%
- {\dodoubletexts{\??tk#1}\v!text
- {\c!leftstyle \c!leftcolor \c!leftwidth }{#2}%
- {\c!rightstyle\c!rightcolor\c!rightwidth}{#5}}%
- \setvalue{\??tk#1\v!text\c!righttext}%
- {\dodoubletexts{\??tk#1}\v!text
- {\c!rightstyle\c!rightcolor\c!rightwidth}{#3}%
- {\c!leftstyle \c!leftcolor \c!leftwidth }{#4}}%
- \else\iffourthargument
- \setvalue{\??tk#1#2\c!lefttext}%
- {\dodoubletexts{\??tk#1}{#2}
- {\c!leftstyle\c!leftcolor\c!leftwidth}{#3}%
- {\c!leftstyle\c!leftcolor\c!leftwidth}{#3}}%
- \setvalue{\??tk#1#2\c!righttext}%
- {\dodoubletexts{\??tk#1}{#2}
- {\c!rightstyle\c!rightcolor\c!rightwidth}{#4}%
- {\c!rightstyle\c!rightcolor\c!rightwidth}{#4}}%
- \else\ifthirdargument
- \setvalue{\??tk#1\v!text\c!lefttext}%
- {\dodoubletexts{\??tk#1}\v!text
- {\c!leftstyle\c!leftcolor\c!leftwidth}{#2}%
- {\c!leftstyle\c!leftcolor\c!leftwidth}{#2}}%
- \setvalue{\??tk#1\v!text\c!righttext}%
- {\dodoubletexts{\??tk#1}\v!text
- {\c!rightstyle\c!rightcolor\c!rightwidth}{#3}%
- {\c!rightstyle\c!rightcolor\c!rightwidth}{#3}}%
- \else\ifsecondargument % new
- \letvalue{\??tk#1\v!text\c!lefttext }\empty
- \letvalue{\??tk#1\v!text\c!righttext}\empty
- \setvalue{\??tk#1\v!text\c!middletext }%
- {\dosingletexts{\??tk#1}\v!text\c!style\c!color\c!width{#2}}%
- \else
- \dosixtupleempty\dosetuptexts[#1][\v!text][][][][]%
- \dosixtupleempty\dosetuptexts[#1][\v!margin][][][][]%
- \dosixtupleempty\dosetuptexts[#1][\v!edge ][][][][]%
- \fi\fi\fi\fi\fi}
-
-%D Left and right texts are swapped on odd and even pages, but
-%D only when double sided typesetting is enabled.
-
-\def\dodoubletexts#1#2#3#4#5#6%
- {\doifoddpageelse
- {\dosingletexts{#1}{#2}#3{#4}} % #3 => provides three arguments
- {\dosingletexts{#1}{#2}#5{#6}}} % #5 => provides three arguments
-
-%D The next macro will be cleaned up amd made less messy and
-%D dependent.
-
-\def\placetextlinestrut#1%
- {\doifvalue{#1\c!strut}\v!yes{\setstrut\strut}}
-
-\def\dosingletexts#1#2#3#4#5#6%
- {\bgroup
- \defconvertedargument\ascii{#6}%
- \doifsomething\ascii
- {\doattributes{#1#2}#3#4%
- {\placetextlinestrut{#1}% here !
- %\doifdefinedelse{\??mk\ascii\c!coupling} % brrr
- \doifelsemarking\ascii
- {\dolimitatetexts{#1#2#5}{\getmarking[\ascii][\v!first]}}
- {\ConvertConstantAfter\doifelse\v!pagenumber{#6}
- \@@plaatspaginanummer
- {\ConvertConstantAfter\doifelse\v!date{#6}
- {\currentdate}
- {% #6{}{}{} -> {} needed for macros that look
- % ahead, like \uniqueMPgraphic
- \opeenregel\dolimitatetexts{#1#2#5}{#6{}{}{}}}}}}}%
- \egroup}
-
-%D When specified, the texts are automatically limited in
-%D length.
-
-\def\dolimitatetexts#1#2%
- {\doifelsevaluenothing{#1}{#2}{\limitatetext{#2}{\getvalue{#1}}{\unknown}}}
-
-%D The placement of text is hooked into the token lists
-%D associated to the area at hand.
-
-\appendtoks \placelayouttextline\v!top \topheight \to \toptextcontent
-\appendtoks \placelayouttextline\v!header\headerheight \to \headertextcontent
-\appendtoks \placelayouttextline\v!text \textheight \to \texttextcontent
-\appendtoks \placelayouttextline\v!footer\footerheight \to \footertextcontent
-\appendtoks \placelayouttextline\v!bottom\bottomheight \to \bottomtextcontent
-
-%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% postpone
- {\setgvalue{\??tk#1\s!reset}{\letgvalue{\??tk#1\c!state}\v!normal}}
-
-\def\placelayouttextline#1% #2
- {\settextlinestatus{#1}%
- \csname\string\placelayouttextline
- \ifundefined{\string\placelayouttextline\textlinestatus}%
- \s!unknown
- \else
- \textlinestatus
- \fi
- \endcsname{#1}} % {#2}
-
-\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}
-
-\setvalue{\string\placelayouttextline\v!none}#1#2%
- {}
-
-\setvalue{\string\placelayouttextline\v!high}#1#2%
- {\global\settrue\resyncaftertextline
- \resettextlinestatus{#1}}
-
-\setvalue{\string\placelayouttextline\v!empty}#1#2%
- {\resettextlinestatus{#1}}
-
-\setvalue{\string\placelayouttextline\v!start}#1#2%
- {\resettextlinestatus{#1}%
- \doplacelayouttextline{#1}{#2}}
-
-\setvalue{\string\placelayouttextline\v!stop}#1#2%
- {}
-
-\setvalue{\string\placelayouttextline\v!nomarking}#1#2%
- {\bgroup
- \resettextlinestatus{#1}%
- \let\dogetmarking\nogetmarking
- \doplacelayouttextline{#1}{#2}%
- \egroup}
-
-\setvalue{\string\placelayouttextline\s!unknown}#1#2%
- {\global\settrue\resyncaftertextline
- \bgroup % new
- \resettextlinestatus{#1}%
- \getvalue{\??tk#1\textlinestatus}%
- \getvalue{\??tk#1\v!text \textlinestatus}%
- \getvalue{\??tk#1\v!margin\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%
- {\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}
-
-% \settext[header][text][middle][xxx][yyy]
-
-\def\settextcontent
- {\doquintupleempty\dosettextcontent}
-
-\def\dosettextcontent[#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\resettextcontent
- {\dotripleempty\doresettextcontent}
-
-\def\doresettextcontent[#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}
-
-\let\settext \settextcontent % downward compatibility
-\let\resettext\resettextcontent % downward compatibility
-
-\setvalue{:\c!middle:\c!text:}{\c!middletext}
-\setvalue{:\c!left :\c!text:}{\c!lefttext }
-\setvalue{:\c!right :\c!text:}{\c!righttext }
-
-%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
-
-\def\gettextboxes
- {\setbox\scratchpagebox\vbox
- {\dontcomplain
- \calculatereducedvsizes
- \swapmargins
- \offinterlineskip
- \vskip\dimexpr-\topheight-\topdistance\relax
- \the\toptextcontent
- \vskip\dimexpr\topheight+\topdistance\relax
- \the\headertextcontent
- \vskip\dimexpr\headerheight+\headerdistance\relax
- \placepositionanchors
- \vskip-\textheight
- \the\texttextcontent
- \vskip\textheight
- \the\everyendoftextbody
- \vskip\footerdistance
- \the\footertextcontent
- \vskip\dimexpr\footerheight+\bottomdistance\relax
- \the\bottomtextcontent
- \vskip\bottomheight
- \vfilll}%
- \smashbox\scratchpagebox
- \box\scratchpagebox}
-
-\def\getmainbox#1#2%
- {\setbox\scratchpagebox\vbox
- {\offinterlineskip % na \paginaletter !
- \calculatereducedvsizes
- \calculatehsizes
- \swapmargins
- \vskip\dimexpr\headerheight+\headerdistance+\layoutparameter\c!textdistance\relax
- \hbox to \makeupwidth
- {\bgroup
- \swapmargins
- \goleftonpage
- \ifdim\leftedgewidth>\zeropoint
- \the\leftedgetextcontent
- \hskip\leftedgewidth
- \fi
- \hskip\leftedgedistance
- \ifdim\leftmarginwidth>\zeropoint
- \the\leftmargintextcontent
- \hskip\leftmarginwidth
- \fi
- \hskip\leftmargindistance
- \egroup
- \mkprocesspagecontents{#2}%
- \settextpagecontent\scratchpagebox{#1}{#2}%
- \setbox\scratchpagebox\vbox % can we avoid this extra box
- {\startlayoutcomponent{textbody}{text body}%
- \box\scratchpagebox
- \stoplayoutcomponent}%
- \addtextbackground\scratchpagebox
- \addtextgridlayer\scratchpagebox
- \localstarttextcolor % does not work in mkiv
- \box\scratchpagebox
- \localstoptextcolor % so we have to change this
- \bgroup
- \hskip\rightmargindistance
- \ifdim\rightmarginwidth>\zeropoint
- \the\rightmargintextcontent
- \hskip\rightmarginwidth
- \fi
- \hskip\rightedgedistance
- \ifdim\rightedgewidth>\zeropoint
- \the\rightedgetextcontent
- \hskip\rightedgewidth
- \fi
- \egroup
- \hss}}%
- \smashbox\scratchpagebox
- \box\scratchpagebox}
-
-%D The main text area has to be combined with some additional
-%D (tracing) information.
-
-% will be overloaded in page-lyr
-
-\def\settextpagecontent#1#2#3% #2 and #3 will disappear
- {\setbox#1\hbox to \makeupwidth
- {\hss % so don't change this
- \vbox to \textheight
- {\offinterlineskip
- \freezetextwidth
- \hsize\textwidth % local variant of \sethsize
- \boxmaxdepth\maxdepth
- \noindent % content can be < \hsize
- \dopagecontents#2#3}%
- \hss}%
- \dp#1\zeropoint}
-
-\definepalet
- [layout]
- [grid=red,
- page=green]
-
-\def\addtextgridlayer#1% tzt run time
- {\ifcase\showgridstate\else % 1=bottom 2=top
- \setgridbox\scratchbox\makeupwidth\textheight
- \setbox#1\hbox
- {\ifcase\showgridstate\or\or\box#1\hskip-\makeupwidth\fi
- \bgroup % color
- \startlayoutcomponent{gridcolumns}{grid columns}%
- \incolortrue
- \ifcase\layoutcolumns\else
- \gray
- \hbox to \makeupwidth
- {\dorecurse\layoutcolumns
- {\hskip\layoutcolumnwidth
- \ifnum\recurselevel<\layoutcolumns
- \vrule
- \!!height\ht\scratchbox
- \!!depth\dp\scratchbox
- \!!width\layoutcolumndistance
- \fi}}%
- \hskip-\makeupwidth
- \fi
- \stoplayoutcomponent
- \startlayoutcomponent{gridlines}{grid lines}%
- \startcolor[layout:grid]\box\scratchbox\stopcolor
- \stoplayoutcomponent
- \egroup
- \ifcase\showgridstate\or\hskip-\makeupwidth\box#1\fi}%
- \fi}
-
-%D The placement of a whole line is handled by the next two
-%D macros. These are hooked into the general purpose token
-%D list registers mentioned before.
-
-\def\ignoredlinebreak{\unskip\space\ignorespaces}
-
-\def\doplacelayouttextline#1#2%
- {\ifdim#2>\zeropoint\relax % prevents pagenumbers when zero height
- \goleftonpage
- \hbox
- {\setbox\scratchpagebox\vbox to #2
- {%\forgetall
- \vsize#2\relax
- \normalbaselines
- \let\\\ignoredlinebreak
- \let\crlf\ignoredlinebreak
- %\getvalue{\??tk#1\v!text\c!before}%
- \getvalue{\??tk#1\c!before}%
- \doifbothsidesoverruled
- {\dodoplacelayouttextline#1\c!lefttext \c!middletext\c!righttext\gobbleoneargument\getvalue}
- {\dodoplacelayouttextline#1\c!lefttext \c!middletext\c!righttext\gobbleoneargument\getvalue}
- {\dodoplacelayouttextline#1\c!righttext\c!middletext\c!lefttext \getvalue\gobbleoneargument}%
- %\getvalue{\??tk#1\v!text\c!after}%
- \getvalue{\??tk#1\c!after}%
- \kern\zeropoint}% keep the \dp, beware of \vtops, never change this!
- \dp\scratchpagebox\zeropoint
- \box\scratchpagebox}%
- \vskip-#2\relax
- \fi}
-
-\def\dodoplacelayouttextline#1#2#3#4#5#6% \hsize toegevoegd, \hss's niet meer wijzigen
- {\hbox
- {\ifdim\leftedgewidth>\zeropoint
- \dododoplacelayouttextline\leftedgewidth{#1}\v!edge
- {\hss\getvalue{\??tk#1\v!edge#2}}%
- \hskip\leftedgedistance
- \fi
- \ifdim\leftmarginwidth>\zeropoint
- \dododoplacelayouttextline\leftmarginwidth{#1}\v!margin
- {\hbox to \leftmarginwidth
- {\hss\getvalue{\??tk#1\v!margin#2}}%
- \hskip-\leftmarginwidth
- \hbox to \leftmarginwidth
- {\hss#5{\??tk#1\v!margin\c!margintext}}}%
- \hskip\leftmargindistance
- \fi
- \ifdim\makeupwidth>\zeropoint
- \dododoplacelayouttextline\makeupwidth{#1}\v!text
- {\hbox to \makeupwidth
- {\@@nmpre{#5{\??tk#1\v!text\c!marginedgetext}}%
- \getvalue{\??tk#1\v!text#2}\hss}%
- \hskip-\makeupwidth
- \hbox to \makeupwidth
- {\hss\getvalue{\??tk#1\v!text#3}\hss}%
- \hskip-\makeupwidth
- \hbox to \makeupwidth
- {\hss\getvalue{\??tk#1\v!text#4}%
- \@@nmpos{#6{\??tk#1\v!text\c!marginedgetext}}}}%
- \fi
- \ifdim\rightmarginwidth>\zeropoint
- \hskip\rightmargindistance
- \dododoplacelayouttextline\rightmarginwidth{#1}\v!margin
- {\hbox to \rightmarginwidth
- {\getvalue{\??tk#1\v!margin#4}\hss}%
- \hskip-\rightmarginwidth
- \hbox to \rightmarginwidth
- {#6{\??tk#1\v!margin\c!margintext}\hss}}%
- \fi
- \ifdim\rightedgewidth>\zeropoint
- \hskip\rightedgedistance
- \dododoplacelayouttextline\rightedgewidth{#1}\v!edge
- {\getvalue{\??tk#1\v!edge#4}\hss}%
- \fi}}
-
-% \def\dododoplacelayouttextline#1#2#3#4%
-% {\vbox % to \vsize
-% {\hsize#1\relax
-% \getvalue{\??tk#2#3\c!voor}
-% \hbox to #1{#4}%
-% \getvalue{\??tk#2#3\c!na}}}
-
-\def\dododoplacelayouttextline#1#2#3#4%
- {\vbox % to \vsize
- {\hsize#1\relax
- \getvalue{\??tk#2#3\c!before}%
- \startlayoutcomponent{t:#2:#3}{area #2 #3}%
- \hbox to #1{#4}%
- \stoplayoutcomponent
- \getvalue{\??tk#2#3\c!after}}}
-
-%D Although it is far better to use backgrounds for this
-%D purpose, one can add a rule in the following way. This
-%D method makes the rules disappear in case of an empty text
-%D line. Consider this a feature.
-%D
-%D \starttyping
-%D \setupheadertexts[left][right]
-%D
-%D \setupheader[text][after=\hrule,style=bold]
-%D
-%D \starttext
-%D \input tufte \page
-%D \setupheader[state=empty]
-%D \input tufte \page
-%D \stoptext
-%D \stoptyping
-
-%D The next twosome will be done differently (using an
-%D existing auxiliary macro).
-
-% \def\@@nmpre#1{\setbox0\hbox{#1}\ifdim\wd0=\zeropoint\else\unhbox0\tfskip\fi}
-% \def\@@nmpos#1{\setbox0\hbox{#1}\ifdim\wd0=\zeropoint\else\tfskip\unhbox0\fi}
-
-% cleaner
-
-\def\@@nmpre#1{\doiftext{#1}{{#1}\tfskip}}
-\def\@@nmpos#1{\doiftext{#1}{\tfskip{#1}}}
-
-% newer
-
-\def\@@nmprepos#1#2#3#4#5%
- {\doifelsenothing\@@nmwidth
- {\doiftext{#5}{#1{#5}#2}}
- {\doiftext{#5}{\hbox to \@@nmwidth{#3{#5}#4}}}}
-
-\def\@@nmpre{\@@nmprepos\empty\tfskip\relax\hss}
-\def\@@nmpos{\@@nmprepos\tfskip\empty\hss\relax}
-
-%D This code will move to \type {page-flt.tex}.
-
-\appendtoks
- \plaatsrechtermargeblok \hskip-\rightmarginwidth
-\to \rightmargintextcontent
-
-\appendtoks
- \plaatslinkermargeblok \hskip-\leftmarginwidth
-\to \leftmargintextcontent
-
-%D The next hook will later be used for keeping track of
-%D positions, i.e.\ it will provide a proper (page
-%D dependent) reference point.
-
-\ifx\undefined\placepositionanchors
- \def\placepositionanchors{\vskip\textheight}
-\fi
-
-%D \macros
-%D {definetext}
-%D
-%D Some macros ago, we implemented the \type {status} option
-%D \type {unknown}. This one is used to take care of
-%D symbolic texts handlers.
-%D
-%D \showsetup{definetext}
-%D
-%D The next example demonstrates how we can use this
-%D mechanism to provide page (event) dependent text lines.
-%D
-%D \starttyping
-%D \definetext[chapter][footer][pagenumber]
-%D \setuphead[chapter][header=high,footer=chapter]
-%D \setupheadertexts[pagenumber]
-%D \setupfootertexts[left][right]
-%D \chapter{eerste} \dorecurse{20}{\input tufte \relax}
-%D \chapter{tweede} \dorecurse{20}{\input tufte \relax}
-%D \stoptyping
-
-\def\definetext
- {\doseventupleempty\dodefinetext}
-
-\def\dodefinetext[#1][#2][#3][#4][#5][#6][#7]%
- {\ifseventhargument
- \setvalue{\??tk#2#3#1}{\dosixtupleempty\dosetuptexts[#2][#3][#4][#5][#6][#7]}%
- \else\ifsixthargument
- \setvalue{\??tk #2#1}{\dosixtupleempty\dosetuptexts[#2][#3][#4][#5][#6]}%
- \else\iffifthargument
- \setvalue{\??tk#2#3#1}{\dosixtupleempty\dosetuptexts[#2][#3][#4][#5]}%
- \else\iffourthargument
- \setvalue{\??tk #2#1}{\dosixtupleempty\dosetuptexts[#2][#3][#4]}%
- \else
- \setvalue{\??tk #2#1}{\dosixtupleempty\dosetuptexts[#2][#3]}%
- \fi\fi\fi\fi}
-
-%D The rest of this file is dedicated to setting up the
-%D texts. This code is not that impressive.
-
-\setupheadertexts [\v!text] [] []
-\setupheadertexts [\v!margin] [] []
-\setupheadertexts [\v!edge] [] []
-
-\setupfootertexts [\v!text] [] []
-\setupfootertexts [\v!margin] [] []
-\setupfootertexts [\v!edge] [] []
-
-\setuptexttexts [\v!text] [] []
-\setuptexttexts [\v!margin] [] []
-\setuptexttexts [\v!edge] [] []
-
-\setupbottomtexts [\v!text] [] []
-\setupbottomtexts [\v!margin] [] []
-\setupbottomtexts [\v!edge] [] []
-
-\setuptoptexts [\v!text] [] []
-\setuptoptexts [\v!margin] [] []
-\setuptoptexts [\v!edge] [] []
-
-% alternative
-%
-% \def\resetlayouttekst%
-% {\dodoubleempty\doresetlayouttekst}
-%
-% \def\doresetlayouttekst[#1][#2]%
-% {\ifsecondargument
-% \dodoresetlayouttekst[#1][#2]%
-% \else
-% \dodoresetlayouttekst[#1][\v!tekst]%
-% \fi}
-%
-% \def\dodoresetlayouttekst[#1][#2]%
-% {...}
-%
-% \def\docommand#1%
-% {\resetlayouttekst[#1][\v!tekst]%
-% \resetlayouttekst[#1][\v!marge]%
-% \resetlayouttekst[#1][\v!rand]}
-
-%D We combine a lot of similar settings in a macro that
-%D we will later dispose.
-
-\def\dodocommand[#1][#2]%
- {\getparameters
- [\??tk#1#2]
- [%\c!state=\v!normal, % moved
- \c!before=, % both global and local are used
- \c!after=, % both global and local are used
- \c!strut=, % the local one, not (yet) used
- \c!style=\getvalue{\??tk#1\c!style},% hm, got lost
- \c!color=\getvalue{\??tk#1\c!color}, % hm, got lost
- \c!lefttext=,
- \c!middletext=,
- \c!righttext=,
- \c!marginedgetext=,
- \c!margintext=,
- \c!width=]%
- \inheritparameter[\??tk#1#2][\c!leftstyle ][\c!style ]%
- \inheritparameter[\??tk#1#2][\c!rightstyle ][\c!style ]%
- \inheritparameter[\??tk#1#2][\c!leftcolor ][\c!color ]%
- \inheritparameter[\??tk#1#2][\c!rightcolor ][\c!color ]%
- \inheritparameter[\??tk#1#2][\c!leftwidth ][\c!width]%
- \inheritparameter[\??tk#1#2][\c!rightwidth][\c!width]}
-
-\def\docommand#1%
- {\dodocommand[#1][\v!text]%
- \dodocommand[#1][\v!margin]%
- \dodocommand[#1][\v!edge]}
-
-\docommand\v!top
-\docommand\v!header
-\docommand\v!footer
-\docommand\v!text
-\docommand\v!bottom
-
-\let\docommand \relax
-\let\dodocommand\relax
-
-%D While the header and footer lines are moved away from the
-%D main text, the top and bottom lines are centered.
-
-\setuptop [\c!state=\v!normal,\c!before=\vss,\c!after=\vss,\c!strut=]
-\setupheader[\c!state=\v!normal,\c!before=, \c!after=\vss,\c!strut=\v!yes]
-\setuptext [\c!state=\v!normal,\c!before=\vss,\c!after=\vss,\c!strut=]
-\setupfooter[\c!state=\v!normal,\c!before=\vss,\c!after=, \c!strut=\v!yes]
-\setupbottom[\c!state=\v!normal,\c!before=\vss,\c!after=\vss,\c!strut=]
-
-\setuptop [\c!style=,\c!color=]
-\setupheader[\c!style=,\c!color=]
-\setuptext [\c!style=,\c!color=]
-\setupfooter[\c!style=,\c!color=]
-\setupbottom[\c!style=,\c!color=]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/pdfr-def.mkii b/Master/texmf-dist/tex/context/base/mkii/pdfr-def.mkii
deleted file mode 100644
index b3f67b93f82..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/pdfr-def.mkii
+++ /dev/null
@@ -1,843 +0,0 @@
-% filename : pdfr-def.mkii
-% comment : generated by mtxrun --script chars --pdf
-% author : Hans Hagen, PRAGMA-ADE, Hasselt NL
-% copyright: PRAGMA ADE / ConTeXt Development Team
-% license : see context related readme files
-%
-\pdfglyphtounicode{space}{0020}%
-\pdfglyphtounicode{exclam}{0021}%
-\pdfglyphtounicode{quotedbl}{0022}%
-\pdfglyphtounicode{numbersign}{0023}%
-\pdfglyphtounicode{dollar}{0024}%
-\pdfglyphtounicode{percent}{0025}%
-\pdfglyphtounicode{ampersand}{0026}%
-\pdfglyphtounicode{quotesingle}{0027}%
-\pdfglyphtounicode{parenleft}{0028}%
-\pdfglyphtounicode{parenright}{0029}%
-\pdfglyphtounicode{asterisk}{002A}%
-\pdfglyphtounicode{plus}{002B}%
-\pdfglyphtounicode{comma}{002C}%
-\pdfglyphtounicode{hyphen}{002D}%
-\pdfglyphtounicode{period}{002E}%
-\pdfglyphtounicode{slash}{002F}%
-\pdfglyphtounicode{zero}{0030}%
-\pdfglyphtounicode{one}{0031}%
-\pdfglyphtounicode{two}{0032}%
-\pdfglyphtounicode{three}{0033}%
-\pdfglyphtounicode{four}{0034}%
-\pdfglyphtounicode{five}{0035}%
-\pdfglyphtounicode{six}{0036}%
-\pdfglyphtounicode{seven}{0037}%
-\pdfglyphtounicode{eight}{0038}%
-\pdfglyphtounicode{nine}{0039}%
-\pdfglyphtounicode{colon}{003A}%
-\pdfglyphtounicode{semicolon}{003B}%
-\pdfglyphtounicode{less}{003C}%
-\pdfglyphtounicode{equal}{003D}%
-\pdfglyphtounicode{greater}{003E}%
-\pdfglyphtounicode{question}{003F}%
-\pdfglyphtounicode{at}{0040}%
-\pdfglyphtounicode{A}{0041}%
-\pdfglyphtounicode{B}{0042}%
-\pdfglyphtounicode{C}{0043}%
-\pdfglyphtounicode{D}{0044}%
-\pdfglyphtounicode{E}{0045}%
-\pdfglyphtounicode{F}{0046}%
-\pdfglyphtounicode{G}{0047}%
-\pdfglyphtounicode{H}{0048}%
-\pdfglyphtounicode{I}{0049}%
-\pdfglyphtounicode{J}{004A}%
-\pdfglyphtounicode{K}{004B}%
-\pdfglyphtounicode{L}{004C}%
-\pdfglyphtounicode{M}{004D}%
-\pdfglyphtounicode{N}{004E}%
-\pdfglyphtounicode{O}{004F}%
-\pdfglyphtounicode{P}{0050}%
-\pdfglyphtounicode{Q}{0051}%
-\pdfglyphtounicode{R}{0052}%
-\pdfglyphtounicode{S}{0053}%
-\pdfglyphtounicode{T}{0054}%
-\pdfglyphtounicode{U}{0055}%
-\pdfglyphtounicode{V}{0056}%
-\pdfglyphtounicode{W}{0057}%
-\pdfglyphtounicode{X}{0058}%
-\pdfglyphtounicode{Y}{0059}%
-\pdfglyphtounicode{Z}{005A}%
-\pdfglyphtounicode{bracketleft}{005B}%
-\pdfglyphtounicode{backslash}{005C}%
-\pdfglyphtounicode{bracketright}{005D}%
-\pdfglyphtounicode{asciicircum}{005E}%
-\pdfglyphtounicode{underscore}{005F}%
-\pdfglyphtounicode{grave}{0060}%
-\pdfglyphtounicode{a}{0061}%
-\pdfglyphtounicode{b}{0062}%
-\pdfglyphtounicode{c}{0063}%
-\pdfglyphtounicode{d}{0064}%
-\pdfglyphtounicode{e}{0065}%
-\pdfglyphtounicode{f}{0066}%
-\pdfglyphtounicode{g}{0067}%
-\pdfglyphtounicode{h}{0068}%
-\pdfglyphtounicode{i}{0069}%
-\pdfglyphtounicode{j}{006A}%
-\pdfglyphtounicode{k}{006B}%
-\pdfglyphtounicode{l}{006C}%
-\pdfglyphtounicode{m}{006D}%
-\pdfglyphtounicode{n}{006E}%
-\pdfglyphtounicode{o}{006F}%
-\pdfglyphtounicode{p}{0070}%
-\pdfglyphtounicode{q}{0071}%
-\pdfglyphtounicode{r}{0072}%
-\pdfglyphtounicode{s}{0073}%
-\pdfglyphtounicode{t}{0074}%
-\pdfglyphtounicode{u}{0075}%
-\pdfglyphtounicode{v}{0076}%
-\pdfglyphtounicode{w}{0077}%
-\pdfglyphtounicode{x}{0078}%
-\pdfglyphtounicode{y}{0079}%
-\pdfglyphtounicode{z}{007A}%
-\pdfglyphtounicode{braceleft}{007B}%
-\pdfglyphtounicode{bar}{007C}%
-\pdfglyphtounicode{braceright}{007D}%
-\pdfglyphtounicode{asciitilde}{007E}%
-\pdfglyphtounicode{exclamdown}{00A1}%
-\pdfglyphtounicode{cent}{00A2}%
-\pdfglyphtounicode{sterling}{00A3}%
-\pdfglyphtounicode{currency}{00A4}%
-\pdfglyphtounicode{yen}{00A5}%
-\pdfglyphtounicode{brokenbar}{00A6}%
-\pdfglyphtounicode{section}{00A7}%
-\pdfglyphtounicode{dieresis}{00A8}%
-\pdfglyphtounicode{copyright}{00A9}%
-\pdfglyphtounicode{ordfeminine}{00AA}%
-\pdfglyphtounicode{guillemotleft}{00AB}%
-\pdfglyphtounicode{logicalnot}{00AC}%
-\pdfglyphtounicode{registered}{00AE}%
-\pdfglyphtounicode{macron}{00AF}%
-\pdfglyphtounicode{degree}{00B0}%
-\pdfglyphtounicode{plusminus}{00B1}%
-\pdfglyphtounicode{acute}{00B4}%
-\pdfglyphtounicode{mu}{00B5}%
-\pdfglyphtounicode{paragraph}{00B6}%
-\pdfglyphtounicode{periodcentered}{00B7}%
-\pdfglyphtounicode{cedilla}{00B8}%
-\pdfglyphtounicode{ordmasculine}{00BA}%
-\pdfglyphtounicode{guillemotright}{00BB}%
-\pdfglyphtounicode{onequarter}{00BC}%
-\pdfglyphtounicode{onehalf}{00BD}%
-\pdfglyphtounicode{threequarters}{00BE}%
-\pdfglyphtounicode{questiondown}{00BF}%
-\pdfglyphtounicode{Agrave}{00C0}%
-\pdfglyphtounicode{Aacute}{00C1}%
-\pdfglyphtounicode{Acircumflex}{00C2}%
-\pdfglyphtounicode{Atilde}{00C3}%
-\pdfglyphtounicode{Adieresis}{00C4}%
-\pdfglyphtounicode{Aring}{00C5}%
-\pdfglyphtounicode{AE}{00C6}%
-\pdfglyphtounicode{Ccedilla}{00C7}%
-\pdfglyphtounicode{Egrave}{00C8}%
-\pdfglyphtounicode{Eacute}{00C9}%
-\pdfglyphtounicode{Ecircumflex}{00CA}%
-\pdfglyphtounicode{Edieresis}{00CB}%
-\pdfglyphtounicode{Igrave}{00CC}%
-\pdfglyphtounicode{Iacute}{00CD}%
-\pdfglyphtounicode{Icircumflex}{00CE}%
-\pdfglyphtounicode{Idieresis}{00CF}%
-\pdfglyphtounicode{Eth}{00D0}%
-\pdfglyphtounicode{Ntilde}{00D1}%
-\pdfglyphtounicode{Ograve}{00D2}%
-\pdfglyphtounicode{Oacute}{00D3}%
-\pdfglyphtounicode{Ocircumflex}{00D4}%
-\pdfglyphtounicode{Otilde}{00D5}%
-\pdfglyphtounicode{Odieresis}{00D6}%
-\pdfglyphtounicode{multiply}{00D7}%
-\pdfglyphtounicode{Oslash}{00D8}%
-\pdfglyphtounicode{Ugrave}{00D9}%
-\pdfglyphtounicode{Uacute}{00DA}%
-\pdfglyphtounicode{Ucircumflex}{00DB}%
-\pdfglyphtounicode{Udieresis}{00DC}%
-\pdfglyphtounicode{Yacute}{00DD}%
-\pdfglyphtounicode{Thorn}{00DE}%
-\pdfglyphtounicode{germandbls}{00DF}%
-\pdfglyphtounicode{agrave}{00E0}%
-\pdfglyphtounicode{aacute}{00E1}%
-\pdfglyphtounicode{acircumflex}{00E2}%
-\pdfglyphtounicode{atilde}{00E3}%
-\pdfglyphtounicode{adieresis}{00E4}%
-\pdfglyphtounicode{aring}{00E5}%
-\pdfglyphtounicode{ae}{00E6}%
-\pdfglyphtounicode{ccedilla}{00E7}%
-\pdfglyphtounicode{egrave}{00E8}%
-\pdfglyphtounicode{eacute}{00E9}%
-\pdfglyphtounicode{ecircumflex}{00EA}%
-\pdfglyphtounicode{edieresis}{00EB}%
-\pdfglyphtounicode{igrave}{00EC}%
-\pdfglyphtounicode{iacute}{00ED}%
-\pdfglyphtounicode{icircumflex}{00EE}%
-\pdfglyphtounicode{idieresis}{00EF}%
-\pdfglyphtounicode{eth}{00F0}%
-\pdfglyphtounicode{ntilde}{00F1}%
-\pdfglyphtounicode{ograve}{00F2}%
-\pdfglyphtounicode{oacute}{00F3}%
-\pdfglyphtounicode{ocircumflex}{00F4}%
-\pdfglyphtounicode{otilde}{00F5}%
-\pdfglyphtounicode{odieresis}{00F6}%
-\pdfglyphtounicode{divide}{00F7}%
-\pdfglyphtounicode{oslash}{00F8}%
-\pdfglyphtounicode{ugrave}{00F9}%
-\pdfglyphtounicode{uacute}{00FA}%
-\pdfglyphtounicode{ucircumflex}{00FB}%
-\pdfglyphtounicode{udieresis}{00FC}%
-\pdfglyphtounicode{yacute}{00FD}%
-\pdfglyphtounicode{thorn}{00FE}%
-\pdfglyphtounicode{ydieresis}{00FF}%
-\pdfglyphtounicode{Amacron}{0100}%
-\pdfglyphtounicode{amacron}{0101}%
-\pdfglyphtounicode{Abreve}{0102}%
-\pdfglyphtounicode{abreve}{0103}%
-\pdfglyphtounicode{Aogonek}{0104}%
-\pdfglyphtounicode{aogonek}{0105}%
-\pdfglyphtounicode{Cacute}{0106}%
-\pdfglyphtounicode{cacute}{0107}%
-\pdfglyphtounicode{Ccircumflex}{0108}%
-\pdfglyphtounicode{ccircumflex}{0109}%
-\pdfglyphtounicode{Cdotaccent}{010A}%
-\pdfglyphtounicode{cdotaccent}{010B}%
-\pdfglyphtounicode{Ccaron}{010C}%
-\pdfglyphtounicode{ccaron}{010D}%
-\pdfglyphtounicode{Dcaron}{010E}%
-\pdfglyphtounicode{dcaron}{010F}%
-\pdfglyphtounicode{Dcroat}{0110}%
-\pdfglyphtounicode{dcroat}{0111}%
-\pdfglyphtounicode{Emacron}{0112}%
-\pdfglyphtounicode{emacron}{0113}%
-\pdfglyphtounicode{Ebreve}{0114}%
-\pdfglyphtounicode{ebreve}{0115}%
-\pdfglyphtounicode{Edotaccent}{0116}%
-\pdfglyphtounicode{edotaccent}{0117}%
-\pdfglyphtounicode{Eogonek}{0118}%
-\pdfglyphtounicode{eogonek}{0119}%
-\pdfglyphtounicode{Ecaron}{011A}%
-\pdfglyphtounicode{ecaron}{011B}%
-\pdfglyphtounicode{Gcircumflex}{011C}%
-\pdfglyphtounicode{gcircumflex}{011D}%
-\pdfglyphtounicode{Gbreve}{011E}%
-\pdfglyphtounicode{gbreve}{011F}%
-\pdfglyphtounicode{Gdotaccent}{0120}%
-\pdfglyphtounicode{gdotaccent}{0121}%
-\pdfglyphtounicode{Gcommaaccent}{0122}%
-\pdfglyphtounicode{gcommaaccent}{0123}%
-\pdfglyphtounicode{Hcircumflex}{0124}%
-\pdfglyphtounicode{hcircumflex}{0125}%
-\pdfglyphtounicode{Hbar}{0126}%
-\pdfglyphtounicode{hbar}{0127}%
-\pdfglyphtounicode{Itilde}{0128}%
-\pdfglyphtounicode{itilde}{0129}%
-\pdfglyphtounicode{Imacron}{012A}%
-\pdfglyphtounicode{imacron}{012B}%
-\pdfglyphtounicode{Ibreve}{012C}%
-\pdfglyphtounicode{ibreve}{012D}%
-\pdfglyphtounicode{Iogonek}{012E}%
-\pdfglyphtounicode{iogonek}{012F}%
-\pdfglyphtounicode{Idotaccent}{0130}%
-\pdfglyphtounicode{dotlessi}{0131}%
-\pdfglyphtounicode{IJ}{0132}%
-\pdfglyphtounicode{ij}{0133}%
-\pdfglyphtounicode{Jcircumflex}{0134}%
-\pdfglyphtounicode{jcircumflex}{0135}%
-\pdfglyphtounicode{Kcommaaccent}{0136}%
-\pdfglyphtounicode{kcommaaccent}{0137}%
-\pdfglyphtounicode{kgreenlandic}{0138}%
-\pdfglyphtounicode{Lacute}{0139}%
-\pdfglyphtounicode{lacute}{013A}%
-\pdfglyphtounicode{Lcommaaccent}{013B}%
-\pdfglyphtounicode{lcommaaccent}{013C}%
-\pdfglyphtounicode{Lcaron}{013D}%
-\pdfglyphtounicode{lcaron}{013E}%
-\pdfglyphtounicode{Ldot}{013F}%
-\pdfglyphtounicode{ldot}{0140}%
-\pdfglyphtounicode{Lslash}{0141}%
-\pdfglyphtounicode{lslash}{0142}%
-\pdfglyphtounicode{Nacute}{0143}%
-\pdfglyphtounicode{nacute}{0144}%
-\pdfglyphtounicode{Ncommaaccent}{0145}%
-\pdfglyphtounicode{ncommaaccent}{0146}%
-\pdfglyphtounicode{Ncaron}{0147}%
-\pdfglyphtounicode{ncaron}{0148}%
-\pdfglyphtounicode{napostrophe}{0149}%
-\pdfglyphtounicode{Eng}{014A}%
-\pdfglyphtounicode{eng}{014B}%
-\pdfglyphtounicode{Omacron}{014C}%
-\pdfglyphtounicode{omacron}{014D}%
-\pdfglyphtounicode{Obreve}{014E}%
-\pdfglyphtounicode{obreve}{014F}%
-\pdfglyphtounicode{Ohungarumlaut}{0150}%
-\pdfglyphtounicode{ohungarumlaut}{0151}%
-\pdfglyphtounicode{OE}{0152}%
-\pdfglyphtounicode{oe}{0153}%
-\pdfglyphtounicode{Racute}{0154}%
-\pdfglyphtounicode{racute}{0155}%
-\pdfglyphtounicode{Rcommaaccent}{0156}%
-\pdfglyphtounicode{rcommaaccent}{0157}%
-\pdfglyphtounicode{Rcaron}{0158}%
-\pdfglyphtounicode{rcaron}{0159}%
-\pdfglyphtounicode{Sacute}{015A}%
-\pdfglyphtounicode{sacute}{015B}%
-\pdfglyphtounicode{Scircumflex}{015C}%
-\pdfglyphtounicode{scircumflex}{015D}%
-\pdfglyphtounicode{Scedilla}{015E}%
-\pdfglyphtounicode{scedilla}{015F}%
-\pdfglyphtounicode{Scaron}{0160}%
-\pdfglyphtounicode{scaron}{0161}%
-\pdfglyphtounicode{Tcommaaccent}{0162}%
-\pdfglyphtounicode{tcommaaccent}{0163}%
-\pdfglyphtounicode{Tcaron}{0164}%
-\pdfglyphtounicode{tcaron}{0165}%
-\pdfglyphtounicode{Tbar}{0166}%
-\pdfglyphtounicode{tbar}{0167}%
-\pdfglyphtounicode{Utilde}{0168}%
-\pdfglyphtounicode{utilde}{0169}%
-\pdfglyphtounicode{Umacron}{016A}%
-\pdfglyphtounicode{umacron}{016B}%
-\pdfglyphtounicode{Ubreve}{016C}%
-\pdfglyphtounicode{ubreve}{016D}%
-\pdfglyphtounicode{Uring}{016E}%
-\pdfglyphtounicode{uring}{016F}%
-\pdfglyphtounicode{Uhungarumlaut}{0170}%
-\pdfglyphtounicode{uhungarumlaut}{0171}%
-\pdfglyphtounicode{Uogonek}{0172}%
-\pdfglyphtounicode{uogonek}{0173}%
-\pdfglyphtounicode{Wcircumflex}{0174}%
-\pdfglyphtounicode{wcircumflex}{0175}%
-\pdfglyphtounicode{Ycircumflex}{0176}%
-\pdfglyphtounicode{ycircumflex}{0177}%
-\pdfglyphtounicode{Ydieresis}{0178}%
-\pdfglyphtounicode{Zacute}{0179}%
-\pdfglyphtounicode{zacute}{017A}%
-\pdfglyphtounicode{Zdotaccent}{017B}%
-\pdfglyphtounicode{zdotaccent}{017C}%
-\pdfglyphtounicode{Zcaron}{017D}%
-\pdfglyphtounicode{zcaron}{017E}%
-\pdfglyphtounicode{longs}{017F}%
-\pdfglyphtounicode{florin}{0192}%
-\pdfglyphtounicode{Ohorn}{01A0}%
-\pdfglyphtounicode{ohorn}{01A1}%
-\pdfglyphtounicode{Uhorn}{01AF}%
-\pdfglyphtounicode{uhorn}{01B0}%
-\pdfglyphtounicode{Gcaron}{01E6}%
-\pdfglyphtounicode{gcaron}{01E7}%
-\pdfglyphtounicode{Aringacute}{01FA}%
-\pdfglyphtounicode{aringacute}{01FB}%
-\pdfglyphtounicode{AEacute}{01FC}%
-\pdfglyphtounicode{aeacute}{01FD}%
-\pdfglyphtounicode{Oslashacute}{01FE}%
-\pdfglyphtounicode{oslashacute}{01FF}%
-\pdfglyphtounicode{Scommaaccent}{0218}%
-\pdfglyphtounicode{scommaaccent}{0219}%
-\pdfglyphtounicode{afii57929}{02BC}%
-\pdfglyphtounicode{afii64937}{02BD}%
-\pdfglyphtounicode{circumflex}{02C6}%
-\pdfglyphtounicode{caron}{02C7}%
-\pdfglyphtounicode{breve}{02D8}%
-\pdfglyphtounicode{dotaccent}{02D9}%
-\pdfglyphtounicode{ring}{02DA}%
-\pdfglyphtounicode{ogonek}{02DB}%
-\pdfglyphtounicode{tilde}{02DC}%
-\pdfglyphtounicode{hungarumlaut}{02DD}%
-\pdfglyphtounicode{gravecomb}{0300}%
-\pdfglyphtounicode{acutecomb}{0301}%
-\pdfglyphtounicode{tildecomb}{0303}%
-\pdfglyphtounicode{hookabovecomb}{0309}%
-\pdfglyphtounicode{dotbelowcomb}{0323}%
-\pdfglyphtounicode{tonos}{0384}%
-\pdfglyphtounicode{dieresistonos}{0385}%
-\pdfglyphtounicode{Alphatonos}{0386}%
-\pdfglyphtounicode{anoteleia}{0387}%
-\pdfglyphtounicode{Epsilontonos}{0388}%
-\pdfglyphtounicode{Etatonos}{0389}%
-\pdfglyphtounicode{Iotatonos}{038A}%
-\pdfglyphtounicode{Omicrontonos}{038C}%
-\pdfglyphtounicode{Upsilontonos}{038E}%
-\pdfglyphtounicode{Omegatonos}{038F}%
-\pdfglyphtounicode{iotadieresistonos}{0390}%
-\pdfglyphtounicode{Alpha}{0391}%
-\pdfglyphtounicode{Beta}{0392}%
-\pdfglyphtounicode{Gamma}{0393}%
-\pdfglyphtounicode{Epsilon}{0395}%
-\pdfglyphtounicode{Zeta}{0396}%
-\pdfglyphtounicode{Eta}{0397}%
-\pdfglyphtounicode{Theta}{0398}%
-\pdfglyphtounicode{Iota}{0399}%
-\pdfglyphtounicode{Kappa}{039A}%
-\pdfglyphtounicode{Lambda}{039B}%
-\pdfglyphtounicode{Mu}{039C}%
-\pdfglyphtounicode{Nu}{039D}%
-\pdfglyphtounicode{Xi}{039E}%
-\pdfglyphtounicode{Omicron}{039F}%
-\pdfglyphtounicode{Pi}{03A0}%
-\pdfglyphtounicode{Rho}{03A1}%
-\pdfglyphtounicode{Sigma}{03A3}%
-\pdfglyphtounicode{Tau}{03A4}%
-\pdfglyphtounicode{Upsilon}{03A5}%
-\pdfglyphtounicode{Phi}{03A6}%
-\pdfglyphtounicode{Chi}{03A7}%
-\pdfglyphtounicode{Psi}{03A8}%
-\pdfglyphtounicode{Iotadieresis}{03AA}%
-\pdfglyphtounicode{Upsilondieresis}{03AB}%
-\pdfglyphtounicode{alphatonos}{03AC}%
-\pdfglyphtounicode{epsilontonos}{03AD}%
-\pdfglyphtounicode{etatonos}{03AE}%
-\pdfglyphtounicode{iotatonos}{03AF}%
-\pdfglyphtounicode{upsilondieresistonos}{03B0}%
-\pdfglyphtounicode{alpha}{03B1}%
-\pdfglyphtounicode{beta}{03B2}%
-\pdfglyphtounicode{gamma}{03B3}%
-\pdfglyphtounicode{delta}{03B4}%
-\pdfglyphtounicode{epsilon}{03B5}%
-\pdfglyphtounicode{zeta}{03B6}%
-\pdfglyphtounicode{eta}{03B7}%
-\pdfglyphtounicode{theta}{03B8}%
-\pdfglyphtounicode{iota}{03B9}%
-\pdfglyphtounicode{kappa}{03BA}%
-\pdfglyphtounicode{lambda}{03BB}%
-\pdfglyphtounicode{nu}{03BD}%
-\pdfglyphtounicode{xi}{03BE}%
-\pdfglyphtounicode{omicron}{03BF}%
-\pdfglyphtounicode{pi}{03C0}%
-\pdfglyphtounicode{rho}{03C1}%
-\pdfglyphtounicode{sigma1}{03C2}%
-\pdfglyphtounicode{sigma}{03C3}%
-\pdfglyphtounicode{tau}{03C4}%
-\pdfglyphtounicode{upsilon}{03C5}%
-\pdfglyphtounicode{phi}{03C6}%
-\pdfglyphtounicode{chi}{03C7}%
-\pdfglyphtounicode{psi}{03C8}%
-\pdfglyphtounicode{omega}{03C9}%
-\pdfglyphtounicode{iotadieresis}{03CA}%
-\pdfglyphtounicode{upsilondieresis}{03CB}%
-\pdfglyphtounicode{omicrontonos}{03CC}%
-\pdfglyphtounicode{upsilontonos}{03CD}%
-\pdfglyphtounicode{omegatonos}{03CE}%
-\pdfglyphtounicode{theta1}{03D1}%
-\pdfglyphtounicode{Upsilon1}{03D2}%
-\pdfglyphtounicode{phi1}{03D5}%
-\pdfglyphtounicode{omega1}{03D6}%
-\pdfglyphtounicode{afii10023}{0401}%
-\pdfglyphtounicode{afii10051}{0402}%
-\pdfglyphtounicode{afii10052}{0403}%
-\pdfglyphtounicode{afii10053}{0404}%
-\pdfglyphtounicode{afii10054}{0405}%
-\pdfglyphtounicode{afii10055}{0406}%
-\pdfglyphtounicode{afii10056}{0407}%
-\pdfglyphtounicode{afii10057}{0408}%
-\pdfglyphtounicode{afii10058}{0409}%
-\pdfglyphtounicode{afii10059}{040A}%
-\pdfglyphtounicode{afii10060}{040B}%
-\pdfglyphtounicode{afii10061}{040C}%
-\pdfglyphtounicode{afii10062}{040E}%
-\pdfglyphtounicode{afii10145}{040F}%
-\pdfglyphtounicode{afii10017}{0410}%
-\pdfglyphtounicode{afii10018}{0411}%
-\pdfglyphtounicode{afii10019}{0412}%
-\pdfglyphtounicode{afii10020}{0413}%
-\pdfglyphtounicode{afii10021}{0414}%
-\pdfglyphtounicode{afii10022}{0415}%
-\pdfglyphtounicode{afii10024}{0416}%
-\pdfglyphtounicode{afii10025}{0417}%
-\pdfglyphtounicode{afii10026}{0418}%
-\pdfglyphtounicode{afii10027}{0419}%
-\pdfglyphtounicode{afii10028}{041A}%
-\pdfglyphtounicode{afii10029}{041B}%
-\pdfglyphtounicode{afii10030}{041C}%
-\pdfglyphtounicode{afii10031}{041D}%
-\pdfglyphtounicode{afii10032}{041E}%
-\pdfglyphtounicode{afii10033}{041F}%
-\pdfglyphtounicode{afii10034}{0420}%
-\pdfglyphtounicode{afii10035}{0421}%
-\pdfglyphtounicode{afii10036}{0422}%
-\pdfglyphtounicode{afii10037}{0423}%
-\pdfglyphtounicode{afii10038}{0424}%
-\pdfglyphtounicode{afii10039}{0425}%
-\pdfglyphtounicode{afii10040}{0426}%
-\pdfglyphtounicode{afii10041}{0427}%
-\pdfglyphtounicode{afii10042}{0428}%
-\pdfglyphtounicode{afii10043}{0429}%
-\pdfglyphtounicode{afii10044}{042A}%
-\pdfglyphtounicode{afii10045}{042B}%
-\pdfglyphtounicode{afii10046}{042C}%
-\pdfglyphtounicode{afii10047}{042D}%
-\pdfglyphtounicode{afii10048}{042E}%
-\pdfglyphtounicode{afii10049}{042F}%
-\pdfglyphtounicode{afii10065}{0430}%
-\pdfglyphtounicode{afii10066}{0431}%
-\pdfglyphtounicode{afii10067}{0432}%
-\pdfglyphtounicode{afii10068}{0433}%
-\pdfglyphtounicode{afii10069}{0434}%
-\pdfglyphtounicode{afii10070}{0435}%
-\pdfglyphtounicode{afii10072}{0436}%
-\pdfglyphtounicode{afii10073}{0437}%
-\pdfglyphtounicode{afii10074}{0438}%
-\pdfglyphtounicode{afii10075}{0439}%
-\pdfglyphtounicode{afii10076}{043A}%
-\pdfglyphtounicode{afii10077}{043B}%
-\pdfglyphtounicode{afii10078}{043C}%
-\pdfglyphtounicode{afii10079}{043D}%
-\pdfglyphtounicode{afii10080}{043E}%
-\pdfglyphtounicode{afii10081}{043F}%
-\pdfglyphtounicode{afii10082}{0440}%
-\pdfglyphtounicode{afii10083}{0441}%
-\pdfglyphtounicode{afii10084}{0442}%
-\pdfglyphtounicode{afii10085}{0443}%
-\pdfglyphtounicode{afii10086}{0444}%
-\pdfglyphtounicode{afii10087}{0445}%
-\pdfglyphtounicode{afii10088}{0446}%
-\pdfglyphtounicode{afii10089}{0447}%
-\pdfglyphtounicode{afii10090}{0448}%
-\pdfglyphtounicode{afii10091}{0449}%
-\pdfglyphtounicode{afii10092}{044A}%
-\pdfglyphtounicode{afii10093}{044B}%
-\pdfglyphtounicode{afii10094}{044C}%
-\pdfglyphtounicode{afii10095}{044D}%
-\pdfglyphtounicode{afii10096}{044E}%
-\pdfglyphtounicode{afii10097}{044F}%
-\pdfglyphtounicode{afii10071}{0451}%
-\pdfglyphtounicode{afii10099}{0452}%
-\pdfglyphtounicode{afii10100}{0453}%
-\pdfglyphtounicode{afii10101}{0454}%
-\pdfglyphtounicode{afii10102}{0455}%
-\pdfglyphtounicode{afii10103}{0456}%
-\pdfglyphtounicode{afii10104}{0457}%
-\pdfglyphtounicode{afii10105}{0458}%
-\pdfglyphtounicode{afii10106}{0459}%
-\pdfglyphtounicode{afii10107}{045A}%
-\pdfglyphtounicode{afii10108}{045B}%
-\pdfglyphtounicode{afii10109}{045C}%
-\pdfglyphtounicode{afii10110}{045E}%
-\pdfglyphtounicode{afii10193}{045F}%
-\pdfglyphtounicode{afii10146}{0462}%
-\pdfglyphtounicode{afii10194}{0463}%
-\pdfglyphtounicode{afii10147}{0472}%
-\pdfglyphtounicode{afii10195}{0473}%
-\pdfglyphtounicode{afii10148}{0474}%
-\pdfglyphtounicode{afii10196}{0475}%
-\pdfglyphtounicode{afii10050}{0490}%
-\pdfglyphtounicode{afii10098}{0491}%
-\pdfglyphtounicode{afii10846}{04D9}%
-\pdfglyphtounicode{afii57799}{05B0}%
-\pdfglyphtounicode{afii57801}{05B1}%
-\pdfglyphtounicode{afii57800}{05B2}%
-\pdfglyphtounicode{afii57802}{05B3}%
-\pdfglyphtounicode{afii57793}{05B4}%
-\pdfglyphtounicode{afii57794}{05B5}%
-\pdfglyphtounicode{afii57795}{05B6}%
-\pdfglyphtounicode{afii57798}{05B7}%
-\pdfglyphtounicode{afii57797}{05B8}%
-\pdfglyphtounicode{afii57806}{05B9}%
-\pdfglyphtounicode{afii57796}{05BB}%
-\pdfglyphtounicode{afii57807}{05BC}%
-\pdfglyphtounicode{afii57839}{05BD}%
-\pdfglyphtounicode{afii57645}{05BE}%
-\pdfglyphtounicode{afii57841}{05BF}%
-\pdfglyphtounicode{afii57842}{05C0}%
-\pdfglyphtounicode{afii57804}{05C1}%
-\pdfglyphtounicode{afii57803}{05C2}%
-\pdfglyphtounicode{afii57658}{05C3}%
-\pdfglyphtounicode{afii57664}{05D0}%
-\pdfglyphtounicode{afii57665}{05D1}%
-\pdfglyphtounicode{afii57666}{05D2}%
-\pdfglyphtounicode{afii57667}{05D3}%
-\pdfglyphtounicode{afii57668}{05D4}%
-\pdfglyphtounicode{afii57669}{05D5}%
-\pdfglyphtounicode{afii57670}{05D6}%
-\pdfglyphtounicode{afii57671}{05D7}%
-\pdfglyphtounicode{afii57672}{05D8}%
-\pdfglyphtounicode{afii57673}{05D9}%
-\pdfglyphtounicode{afii57674}{05DA}%
-\pdfglyphtounicode{afii57675}{05DB}%
-\pdfglyphtounicode{afii57676}{05DC}%
-\pdfglyphtounicode{afii57677}{05DD}%
-\pdfglyphtounicode{afii57678}{05DE}%
-\pdfglyphtounicode{afii57679}{05DF}%
-\pdfglyphtounicode{afii57680}{05E0}%
-\pdfglyphtounicode{afii57681}{05E1}%
-\pdfglyphtounicode{afii57682}{05E2}%
-\pdfglyphtounicode{afii57683}{05E3}%
-\pdfglyphtounicode{afii57684}{05E4}%
-\pdfglyphtounicode{afii57685}{05E5}%
-\pdfglyphtounicode{afii57686}{05E6}%
-\pdfglyphtounicode{afii57687}{05E7}%
-\pdfglyphtounicode{afii57688}{05E8}%
-\pdfglyphtounicode{afii57689}{05E9}%
-\pdfglyphtounicode{afii57690}{05EA}%
-\pdfglyphtounicode{afii57716}{05F0}%
-\pdfglyphtounicode{afii57717}{05F1}%
-\pdfglyphtounicode{afii57718}{05F2}%
-\pdfglyphtounicode{afii57388}{060C}%
-\pdfglyphtounicode{afii57403}{061B}%
-\pdfglyphtounicode{afii57407}{061F}%
-\pdfglyphtounicode{afii57409}{0621}%
-\pdfglyphtounicode{afii57410}{0622}%
-\pdfglyphtounicode{afii57411}{0623}%
-\pdfglyphtounicode{afii57412}{0624}%
-\pdfglyphtounicode{afii57413}{0625}%
-\pdfglyphtounicode{afii57414}{0626}%
-\pdfglyphtounicode{afii57415}{0627}%
-\pdfglyphtounicode{afii57416}{0628}%
-\pdfglyphtounicode{afii57417}{0629}%
-\pdfglyphtounicode{afii57418}{062A}%
-\pdfglyphtounicode{afii57419}{062B}%
-\pdfglyphtounicode{afii57420}{062C}%
-\pdfglyphtounicode{afii57421}{062D}%
-\pdfglyphtounicode{afii57422}{062E}%
-\pdfglyphtounicode{afii57423}{062F}%
-\pdfglyphtounicode{afii57424}{0630}%
-\pdfglyphtounicode{afii57425}{0631}%
-\pdfglyphtounicode{afii57426}{0632}%
-\pdfglyphtounicode{afii57427}{0633}%
-\pdfglyphtounicode{afii57428}{0634}%
-\pdfglyphtounicode{afii57429}{0635}%
-\pdfglyphtounicode{afii57430}{0636}%
-\pdfglyphtounicode{afii57431}{0637}%
-\pdfglyphtounicode{afii57432}{0638}%
-\pdfglyphtounicode{afii57433}{0639}%
-\pdfglyphtounicode{afii57434}{063A}%
-\pdfglyphtounicode{afii57440}{0640}%
-\pdfglyphtounicode{afii57441}{0641}%
-\pdfglyphtounicode{afii57442}{0642}%
-\pdfglyphtounicode{afii57443}{0643}%
-\pdfglyphtounicode{afii57444}{0644}%
-\pdfglyphtounicode{afii57445}{0645}%
-\pdfglyphtounicode{afii57446}{0646}%
-\pdfglyphtounicode{afii57470}{0647}%
-\pdfglyphtounicode{afii57448}{0648}%
-\pdfglyphtounicode{afii57449}{0649}%
-\pdfglyphtounicode{afii57450}{064A}%
-\pdfglyphtounicode{afii57451}{064B}%
-\pdfglyphtounicode{afii57452}{064C}%
-\pdfglyphtounicode{afii57453}{064D}%
-\pdfglyphtounicode{afii57454}{064E}%
-\pdfglyphtounicode{afii57455}{064F}%
-\pdfglyphtounicode{afii57456}{0650}%
-\pdfglyphtounicode{afii57457}{0651}%
-\pdfglyphtounicode{afii57458}{0652}%
-\pdfglyphtounicode{afii57392}{0660}%
-\pdfglyphtounicode{afii57393}{0661}%
-\pdfglyphtounicode{afii57394}{0662}%
-\pdfglyphtounicode{afii57395}{0663}%
-\pdfglyphtounicode{afii57396}{0664}%
-\pdfglyphtounicode{afii57397}{0665}%
-\pdfglyphtounicode{afii57398}{0666}%
-\pdfglyphtounicode{afii57399}{0667}%
-\pdfglyphtounicode{afii57400}{0668}%
-\pdfglyphtounicode{afii57401}{0669}%
-\pdfglyphtounicode{afii57381}{066A}%
-\pdfglyphtounicode{afii63167}{066D}%
-\pdfglyphtounicode{afii57511}{0679}%
-\pdfglyphtounicode{afii57506}{067E}%
-\pdfglyphtounicode{afii57507}{0686}%
-\pdfglyphtounicode{afii57512}{0688}%
-\pdfglyphtounicode{afii57513}{0691}%
-\pdfglyphtounicode{afii57508}{0698}%
-\pdfglyphtounicode{afii57505}{06A4}%
-\pdfglyphtounicode{afii57509}{06AF}%
-\pdfglyphtounicode{afii57514}{06BA}%
-\pdfglyphtounicode{afii57519}{06D2}%
-\pdfglyphtounicode{afii57534}{06D5}%
-\pdfglyphtounicode{Wgrave}{1E80}%
-\pdfglyphtounicode{wgrave}{1E81}%
-\pdfglyphtounicode{Wacute}{1E82}%
-\pdfglyphtounicode{wacute}{1E83}%
-\pdfglyphtounicode{Wdieresis}{1E84}%
-\pdfglyphtounicode{wdieresis}{1E85}%
-\pdfglyphtounicode{Ygrave}{1EF2}%
-\pdfglyphtounicode{ygrave}{1EF3}%
-\pdfglyphtounicode{afii61664}{200C}%
-\pdfglyphtounicode{afii301}{200D}%
-\pdfglyphtounicode{afii299}{200E}%
-\pdfglyphtounicode{afii300}{200F}%
-\pdfglyphtounicode{figuredash}{2012}%
-\pdfglyphtounicode{endash}{2013}%
-\pdfglyphtounicode{emdash}{2014}%
-\pdfglyphtounicode{afii208}{2015}%
-\pdfglyphtounicode{underscoredbl}{2017}%
-\pdfglyphtounicode{quoteleft}{2018}%
-\pdfglyphtounicode{quoteright}{2019}%
-\pdfglyphtounicode{quotesinglbase}{201A}%
-\pdfglyphtounicode{quotereversed}{201B}%
-\pdfglyphtounicode{quotedblleft}{201C}%
-\pdfglyphtounicode{quotedblright}{201D}%
-\pdfglyphtounicode{quotedblbase}{201E}%
-\pdfglyphtounicode{dagger}{2020}%
-\pdfglyphtounicode{daggerdbl}{2021}%
-\pdfglyphtounicode{bullet}{2022}%
-\pdfglyphtounicode{onedotenleader}{2024}%
-\pdfglyphtounicode{twodotenleader}{2025}%
-\pdfglyphtounicode{ellipsis}{2026}%
-\pdfglyphtounicode{afii61573}{202C}%
-\pdfglyphtounicode{afii61574}{202D}%
-\pdfglyphtounicode{afii61575}{202E}%
-\pdfglyphtounicode{perthousand}{2030}%
-\pdfglyphtounicode{minute}{2032}%
-\pdfglyphtounicode{second}{2033}%
-\pdfglyphtounicode{guilsinglleft}{2039}%
-\pdfglyphtounicode{guilsinglright}{203A}%
-\pdfglyphtounicode{exclamdbl}{203C}%
-\pdfglyphtounicode{fraction}{2044}%
-\pdfglyphtounicode{colonmonetary}{20A1}%
-\pdfglyphtounicode{franc}{20A3}%
-\pdfglyphtounicode{lira}{20A4}%
-\pdfglyphtounicode{peseta}{20A7}%
-\pdfglyphtounicode{afii57636}{20AA}%
-\pdfglyphtounicode{dong}{20AB}%
-\pdfglyphtounicode{Euro}{20AC}%
-\pdfglyphtounicode{afii61248}{2105}%
-\pdfglyphtounicode{Ifraktur}{2111}%
-\pdfglyphtounicode{afii61289}{2113}%
-\pdfglyphtounicode{afii61352}{2116}%
-\pdfglyphtounicode{weierstrass}{2118}%
-\pdfglyphtounicode{Rfraktur}{211C}%
-\pdfglyphtounicode{prescription}{211E}%
-\pdfglyphtounicode{trademark}{2122}%
-\pdfglyphtounicode{Omega}{2126}%
-\pdfglyphtounicode{estimated}{212E}%
-\pdfglyphtounicode{aleph}{2135}%
-\pdfglyphtounicode{onethird}{2153}%
-\pdfglyphtounicode{twothirds}{2154}%
-\pdfglyphtounicode{oneeighth}{215B}%
-\pdfglyphtounicode{threeeighths}{215C}%
-\pdfglyphtounicode{fiveeighths}{215D}%
-\pdfglyphtounicode{seveneighths}{215E}%
-\pdfglyphtounicode{arrowleft}{2190}%
-\pdfglyphtounicode{arrowup}{2191}%
-\pdfglyphtounicode{arrowright}{2192}%
-\pdfglyphtounicode{arrowdown}{2193}%
-\pdfglyphtounicode{arrowboth}{2194}%
-\pdfglyphtounicode{arrowupdn}{2195}%
-\pdfglyphtounicode{arrowupdnbse}{21A8}%
-\pdfglyphtounicode{carriagereturn}{21B5}%
-\pdfglyphtounicode{arrowdblleft}{21D0}%
-\pdfglyphtounicode{arrowdblup}{21D1}%
-\pdfglyphtounicode{arrowdblright}{21D2}%
-\pdfglyphtounicode{arrowdbldown}{21D3}%
-\pdfglyphtounicode{arrowdblboth}{21D4}%
-\pdfglyphtounicode{universal}{2200}%
-\pdfglyphtounicode{partialdiff}{2202}%
-\pdfglyphtounicode{existential}{2203}%
-\pdfglyphtounicode{emptyset}{2205}%
-\pdfglyphtounicode{Delta}{2206}%
-\pdfglyphtounicode{gradient}{2207}%
-\pdfglyphtounicode{element}{2208}%
-\pdfglyphtounicode{notelement}{2209}%
-\pdfglyphtounicode{suchthat}{220B}%
-\pdfglyphtounicode{product}{220F}%
-\pdfglyphtounicode{summation}{2211}%
-\pdfglyphtounicode{minus}{2212}%
-\pdfglyphtounicode{asteriskmath}{2217}%
-\pdfglyphtounicode{radical}{221A}%
-\pdfglyphtounicode{proportional}{221D}%
-\pdfglyphtounicode{infinity}{221E}%
-\pdfglyphtounicode{orthogonal}{221F}%
-\pdfglyphtounicode{angle}{2220}%
-\pdfglyphtounicode{logicaland}{2227}%
-\pdfglyphtounicode{logicalor}{2228}%
-\pdfglyphtounicode{intersection}{2229}%
-\pdfglyphtounicode{union}{222A}%
-\pdfglyphtounicode{integral}{222B}%
-\pdfglyphtounicode{therefore}{2234}%
-\pdfglyphtounicode{similar}{223C}%
-\pdfglyphtounicode{congruent}{2245}%
-\pdfglyphtounicode{approxequal}{2248}%
-\pdfglyphtounicode{notequal}{2260}%
-\pdfglyphtounicode{equivalence}{2261}%
-\pdfglyphtounicode{lessequal}{2264}%
-\pdfglyphtounicode{greaterequal}{2265}%
-\pdfglyphtounicode{propersubset}{2282}%
-\pdfglyphtounicode{propersuperset}{2283}%
-\pdfglyphtounicode{notsubset}{2284}%
-\pdfglyphtounicode{reflexsubset}{2286}%
-\pdfglyphtounicode{reflexsuperset}{2287}%
-\pdfglyphtounicode{circleplus}{2295}%
-\pdfglyphtounicode{circlemultiply}{2297}%
-\pdfglyphtounicode{perpendicular}{22A5}%
-\pdfglyphtounicode{dotmath}{22C5}%
-\pdfglyphtounicode{house}{2302}%
-\pdfglyphtounicode{revlogicalnot}{2310}%
-\pdfglyphtounicode{integraltp}{2320}%
-\pdfglyphtounicode{integralbt}{2321}%
-\pdfglyphtounicode{angleleft}{2329}%
-\pdfglyphtounicode{angleright}{232A}%
-\pdfglyphtounicode{SF100000}{2500}%
-\pdfglyphtounicode{SF110000}{2502}%
-\pdfglyphtounicode{SF10000}{250C}%
-\pdfglyphtounicode{SF30000}{2510}%
-\pdfglyphtounicode{SF20000}{2514}%
-\pdfglyphtounicode{SF40000}{2518}%
-\pdfglyphtounicode{SF80000}{251C}%
-\pdfglyphtounicode{SF90000}{2524}%
-\pdfglyphtounicode{SF60000}{252C}%
-\pdfglyphtounicode{SF70000}{2534}%
-\pdfglyphtounicode{SF50000}{253C}%
-\pdfglyphtounicode{SF430000}{2550}%
-\pdfglyphtounicode{SF240000}{2551}%
-\pdfglyphtounicode{SF510000}{2552}%
-\pdfglyphtounicode{SF520000}{2553}%
-\pdfglyphtounicode{SF390000}{2554}%
-\pdfglyphtounicode{SF220000}{2555}%
-\pdfglyphtounicode{SF210000}{2556}%
-\pdfglyphtounicode{SF250000}{2557}%
-\pdfglyphtounicode{SF500000}{2558}%
-\pdfglyphtounicode{SF490000}{2559}%
-\pdfglyphtounicode{SF380000}{255A}%
-\pdfglyphtounicode{SF280000}{255B}%
-\pdfglyphtounicode{SF270000}{255C}%
-\pdfglyphtounicode{SF260000}{255D}%
-\pdfglyphtounicode{SF360000}{255E}%
-\pdfglyphtounicode{SF370000}{255F}%
-\pdfglyphtounicode{SF420000}{2560}%
-\pdfglyphtounicode{SF190000}{2561}%
-\pdfglyphtounicode{SF200000}{2562}%
-\pdfglyphtounicode{SF230000}{2563}%
-\pdfglyphtounicode{SF470000}{2564}%
-\pdfglyphtounicode{SF480000}{2565}%
-\pdfglyphtounicode{SF410000}{2566}%
-\pdfglyphtounicode{SF450000}{2567}%
-\pdfglyphtounicode{SF460000}{2568}%
-\pdfglyphtounicode{SF400000}{2569}%
-\pdfglyphtounicode{SF540000}{256A}%
-\pdfglyphtounicode{SF530000}{256B}%
-\pdfglyphtounicode{SF440000}{256C}%
-\pdfglyphtounicode{upblock}{2580}%
-\pdfglyphtounicode{dnblock}{2584}%
-\pdfglyphtounicode{block}{2588}%
-\pdfglyphtounicode{lfblock}{258C}%
-\pdfglyphtounicode{rtblock}{2590}%
-\pdfglyphtounicode{ltshade}{2591}%
-\pdfglyphtounicode{shade}{2592}%
-\pdfglyphtounicode{dkshade}{2593}%
-\pdfglyphtounicode{filledbox}{25A0}%
-\pdfglyphtounicode{H22073}{25A1}%
-\pdfglyphtounicode{H18543}{25AA}%
-\pdfglyphtounicode{H18551}{25AB}%
-\pdfglyphtounicode{filledrect}{25AC}%
-\pdfglyphtounicode{triagup}{25B2}%
-\pdfglyphtounicode{triagrt}{25BA}%
-\pdfglyphtounicode{triagdn}{25BC}%
-\pdfglyphtounicode{triaglf}{25C4}%
-\pdfglyphtounicode{lozenge}{25CA}%
-\pdfglyphtounicode{circle}{25CB}%
-\pdfglyphtounicode{H18533}{25CF}%
-\pdfglyphtounicode{invbullet}{25D8}%
-\pdfglyphtounicode{invcircle}{25D9}%
-\pdfglyphtounicode{openbullet}{25E6}%
-\pdfglyphtounicode{smileface}{263A}%
-\pdfglyphtounicode{invsmileface}{263B}%
-\pdfglyphtounicode{sun}{263C}%
-\pdfglyphtounicode{female}{2640}%
-\pdfglyphtounicode{male}{2642}%
-\pdfglyphtounicode{spade}{2660}%
-\pdfglyphtounicode{club}{2663}%
-\pdfglyphtounicode{heart}{2665}%
-\pdfglyphtounicode{diamond}{2666}%
-\pdfglyphtounicode{musicalnote}{266A}%
-\pdfglyphtounicode{musicalnotedbl}{266B}%
-%
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/pdfr-ec.mkii b/Master/texmf-dist/tex/context/base/mkii/pdfr-ec.mkii
deleted file mode 100644
index e2208aa3657..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/pdfr-ec.mkii
+++ /dev/null
@@ -1,145 +0,0 @@
-%D \module
-%D [ file=pdfr-ec,
-%D version=2005.07.27,
-%D title=\CONTEXT\ PDF Font Resources,
-%D subtitle=EC encoding,
-%D author={Vladimir Volovich / Taco Hoekwater},
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 vector is derived (but reformatted a bit) from
-%D the one in \LaTeX's CMap package
-
-\startpdffontresource[ec]
-/CIDInit /ProcSet findresource begin
-12 dict begin
- begincmap
- /CIDSystemInfo
- << /Registry (TeX)
- /Ordering (T1)
- /Supplement 0
- >> def
- /CMapName /TeX-T1-0 def
- /CMapType 2 def
- 1 begincodespacerange
- <00> <FF>
- endcodespacerange
- 10 beginbfrange
- <0E> <0F> <2039>
- <10> <12> <201C>
- <15> <16> <2013>
- <21> <26> <0021>
- <28> <5F> <0028>
- <61> <7E> <0061>
- <C0> <D6> <00C0>
- <D8> <DE> <00D8>
- <E0> <F6> <00E0>
- <F8> <FE> <00F8>
- endbfrange
- 95 beginbfchar
- <00> <0060>
- <01> <00B4>
- <02> <02C6>
- <03> <02DC>
- <04> <00A8>
- <05> <02DD>
- <06> <02DA>
- <07> <02C7>
- <08> <02D8>
- <09> <00AF>
- <0A> <02D9>
- <0B> <00B8>
- <0C> <02DB>
- <0D> <201A>
- <13> <00AB>
- <14> <00BB>
- <17> <200C>
- <19> <0131>
- <1B> <00660066>
- <1C> <00660069>
- <1D> <0066006C>
- <1E> <006600660069>
- <1F> <00660066006C>
- <20> <2423>
- <27> <2019>
- <60> <2018>
- <7F> <002D>
- <80> <0102>
- <81> <0104>
- <82> <0106>
- <83> <010C>
- <84> <010E>
- <85> <011A>
- <86> <0118>
- <87> <011E>
- <88> <0139>
- <89> <013D>
- <8A> <0141>
- <8B> <0143>
- <8C> <0147>
- <8D> <014A>
- <8E> <0150>
- <8F> <0154>
- <90> <0158>
- <91> <015A>
- <92> <0160>
- <93> <015E>
- <94> <0164>
- <95> <021A>
- <96> <0170>
- <97> <016E>
- <98> <0178>
- <99> <0179>
- <9A> <017D>
- <9B> <017B>
- <9C> <0132>
- <9D> <0130>
- <9E> <0111>
- <9F> <00A7>
- <A0> <0103>
- <A1> <0105>
- <A2> <0107>
- <A3> <010D>
- <A4> <010F>
- <A5> <011B>
- <A6> <0119>
- <A7> <011F>
- <A8> <013A>
- <A9> <013E>
- <AA> <0142>
- <AB> <0144>
- <AC> <0148>
- <AD> <014B>
- <AE> <0151>
- <AF> <0155>
- <B0> <0159>
- <B1> <015B>
- <B2> <0161>
- <B3> <015F>
- <B4> <0165>
- <B5> <021B>
- <B6> <0171>
- <B7> <016F>
- <B8> <00FF>
- <B9> <017A>
- <BA> <017E>
- <BB> <017C>
- <BC> <0133>
- <BD> <00A1>
- <BE> <00BF>
- <BF> <00A3>
- <D7> <0152>
- <DF> <00530053>
- <F7> <0153>
- <FF> <00DF>
- endbfchar
- endcmap
-CMapName currentdict /CMap defineresource pop end
-end
-\stoppdffontresource
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/pdfr-il2.mkii b/Master/texmf-dist/tex/context/base/mkii/pdfr-il2.mkii
deleted file mode 100644
index 81f9c42acca..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/pdfr-il2.mkii
+++ /dev/null
@@ -1,233 +0,0 @@
-%D \module
-%D [ file=pdfr-il2,
-%D version=2000.12.10,
-%D title=\CONTEXT\ PDF Font Resources,
-%D subtitle=ISO Latin 2,
-%D author={Ondrej Koala Vacha, Hans Hagen},
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 vector is derived (but reformatted a bit) from a
-%D sample send to me by Petr Ferdus. There was some Czech
-%D comment in which I could recognize the name of Ondrej
-%D Koala Vacha. More information on setting up such a vector
-%D can be found in the \PDF\ reference manual.
-
-\startpdffontresource[il2]
-/CIDInit /ProcSet findresource begin
-12 dict begin
- begincmap
- /CIDSystemInfo
- << /Registry (Adobe)
- /Ordering (T1UV)
- /Supplement 0
- >> def
- /CMapName /Adobe-Identity-UCS def
- /CMapType 1 def
- 1 begincodespacerange
- <00> <FF>
- endcodespacerange
- %%FontSpecificEncoding
- 191 beginbfrange
- <20> <20> <0020> % space dec: 32 oct:040 hex:20
- <21> <21> <0021> % exclam dec: 33 oct:041 hex:21
- <22> <22> <0022> % quotedbl dec: 34 oct:042 hex:22
- <23> <23> <0023> % numbersign dec: 35 oct:043 hex:23
- <24> <24> <0024> % dollar dec: 36 oct:044 hex:24
- <25> <25> <0025> % percent dec: 37 oct:045 hex:25
- <26> <26> <0026> % ampersand dec: 38 oct:046 hex:26
- <27> <27> <0027> % quotesingle dec: 39 oct:047 hex:27
- <28> <28> <0028> % parenleft dec: 40 oct:050 hex:28
- <29> <29> <0029> % parenright dec: 41 oct:051 hex:29
- <2a> <2a> <002a> % asterisk dec: 42 oct:052 hex:2a
- <2b> <2b> <002b> % plus dec: 43 oct:053 hex:2b
- <2c> <2c> <002c> % comma dec: 44 oct:054 hex:2c
- <2d> <2d> <002d> % hyphen dec: 45 oct:055 hex:2d
- <2e> <2e> <002e> % period dec: 46 oct:056 hex:2e
- <2f> <2f> <002f> % slash dec: 47 oct:057 hex:2f
- <30> <30> <0030> % zero dec: 48 oct:060 hex:30
- <31> <31> <0031> % one dec: 49 oct:061 hex:31
- <32> <32> <0032> % two dec: 50 oct:062 hex:32
- <33> <33> <0033> % three dec: 51 oct:063 hex:33
- <34> <34> <0034> % four dec: 52 oct:064 hex:34
- <35> <35> <0035> % five dec: 53 oct:065 hex:35
- <36> <36> <0036> % six dec: 54 oct:066 hex:36
- <37> <37> <0037> % seven dec: 55 oct:067 hex:37
- <38> <38> <0038> % eight dec: 56 oct:070 hex:38
- <39> <39> <0039> % nine dec: 57 oct:071 hex:39
- <3a> <3a> <003a> % colon dec: 58 oct:072 hex:3a
- <3b> <3b> <003b> % semicolon dec: 59 oct:073 hex:3b
- <3c> <3c> <003c> % less dec: 60 oct:074 hex:3c
- <3d> <3d> <003d> % equal dec: 61 oct:075 hex:3d
- <3e> <3e> <003e> % greater dec: 62 oct:076 hex:3e
- <3f> <3f> <003f> % question dec: 63 oct:077 hex:3f
- <40> <40> <0040> % at dec: 64 oct:100 hex:40
- <41> <41> <0041> % A dec: 65 oct:101 hex:41
- <42> <42> <0042> % B dec: 66 oct:102 hex:42
- <43> <43> <0043> % C dec: 67 oct:103 hex:43
- <44> <44> <0044> % D dec: 68 oct:104 hex:44
- <45> <45> <0045> % E dec: 69 oct:105 hex:45
- <46> <46> <0046> % F dec: 70 oct:106 hex:46
- <47> <47> <0047> % G dec: 71 oct:107 hex:47
- <48> <48> <0048> % H dec: 72 oct:110 hex:48
- <49> <49> <0049> % I dec: 73 oct:111 hex:49
- <4a> <4a> <004a> % J dec: 74 oct:112 hex:4a
- <4b> <4b> <004b> % K dec: 75 oct:113 hex:4b
- <4c> <4c> <004c> % L dec: 76 oct:114 hex:4c
- <4d> <4d> <004d> % M dec: 77 oct:115 hex:4d
- <4e> <4e> <004e> % N dec: 78 oct:116 hex:4e
- <4f> <4f> <004f> % O dec: 79 oct:117 hex:4f
- <50> <50> <0050> % P dec: 80 oct:120 hex:50
- <51> <51> <0051> % Q dec: 81 oct:121 hex:51
- <52> <52> <0052> % R dec: 82 oct:122 hex:52
- <53> <53> <0053> % S dec: 83 oct:123 hex:53
- <54> <54> <0054> % T dec: 84 oct:124 hex:54
- <55> <55> <0055> % U dec: 85 oct:125 hex:55
- <56> <56> <0056> % V dec: 86 oct:126 hex:56
- <57> <57> <0057> % W dec: 87 oct:127 hex:57
- <58> <58> <0058> % X dec: 88 oct:130 hex:58
- <59> <59> <0059> % Y dec: 89 oct:131 hex:59
- <5a> <5a> <005a> % Z dec: 90 oct:132 hex:5a
- <5b> <5b> <005b> % bracketleft dec: 91 oct:133 hex:5b
- <5c> <5c> <005c> % backslash dec: 92 oct:134 hex:5c
- <5d> <5d> <005d> % bracketright dec: 93 oct:135 hex:5d
- <5e> <5e> <005e> % asciicircum dec: 94 oct:136 hex:5e
- <5f> <5f> <005f> % underscore dec: 95 oct:137 hex:5f
- <60> <60> <0060> % grave dec: 96 oct:140 hex:60
- <61> <61> <0061> % a dec: 97 oct:141 hex:61
- <62> <62> <0062> % b dec: 98 oct:142 hex:62
- <63> <63> <0063> % c dec: 99 oct:143 hex:63
- <64> <64> <0064> % d dec:100 oct:144 hex:64
- <65> <65> <0065> % e dec:101 oct:145 hex:65
- <66> <66> <0066> % f dec:102 oct:146 hex:66
- <67> <67> <0067> % g dec:103 oct:147 hex:67
- <68> <68> <0068> % h dec:104 oct:150 hex:68
- <69> <69> <0069> % i dec:105 oct:151 hex:69
- <6a> <6a> <006a> % j dec:106 oct:152 hex:6a
- <6b> <6b> <006b> % k dec:107 oct:153 hex:6b
- <6c> <6c> <006c> % l dec:108 oct:154 hex:6c
- <6d> <6d> <006d> % m dec:109 oct:155 hex:6d
- <6e> <6e> <006e> % n dec:110 oct:156 hex:6e
- <6f> <6f> <006f> % o dec:111 oct:157 hex:6f
- <70> <70> <0070> % p dec:112 oct:160 hex:70
- <71> <71> <0071> % q dec:113 oct:161 hex:71
- <72> <72> <0072> % r dec:114 oct:162 hex:72
- <73> <73> <0073> % s dec:115 oct:163 hex:73
- <74> <74> <0074> % t dec:116 oct:164 hex:74
- <75> <75> <0075> % u dec:117 oct:165 hex:75
- <76> <76> <0076> % v dec:118 oct:166 hex:76
- <77> <77> <0077> % w dec:119 oct:167 hex:77
- <78> <78> <0078> % x dec:120 oct:170 hex:78
- <79> <79> <0079> % y dec:121 oct:171 hex:79
- <7a> <7a> <007a> % z dec:122 oct:172 hex:7a
- <7b> <7b> <007b> % braceleft dec:123 oct:173 hex:7b
- <7c> <7c> <007c> % bar dec:124 oct:174 hex:7c
- <7d> <7d> <007d> % braceright dec:125 oct:175 hex:7d
- <7e> <7e> <007e> % asciitilde dec:126 oct:176 hex:7e
- <a0> <a0> <00a0> % nbspace dec:160 oct:240 hex:a0
- <a1> <a1> <0104> % Aogonek dec:161 oct:241 hex:a1
- <a2> <a2> <00a2> % breve dec:162 oct:242 hex:a2
- <a3> <a3> <00a3> % Lslash dec:163 oct:243 hex:a3
- <a4> <a4> <00a4> % currency dec:164 oct:244 hex:a4
- <a5> <a5> <013d> % Lcaron dec:165 oct:245 hex:a5
- <a6> <a6> <015a> % Sacute dec:166 oct:246 hex:a6
- <a7> <a7> <00a7> % section dec:167 oct:247 hex:a7
- <a8> <a8> <00a8> % dieresis dec:168 oct:250 hex:a8
- <a9> <a9> <0160> % Scaron dec:169 oct:251 hex:a9
- <aa> <aa> <015e> % Scedilla dec:170 oct:252 hex:aa
- <ab> <ab> <0164> % Tcaron dec:171 oct:253 hex:ab
- <ac> <ac> <0179> % Zacute dec:172 oct:254 hex:ac
- <ad> <ad> <00ad> % sfthyphen dec:173 oct:255 hex:ad
- <ae> <ae> <017d> % Zcaron dec:174 oct:256 hex:ae
- <af> <af> <00af> % Zdotaccent dec:175 oct:257 hex:af
- <b0> <b0> <00b0> % ring dec:176 oct:260 hex:b0
- <b1> <b1> <0105> % aogonek dec:177 oct:261 hex:b1
- <b2> <b2> <00b2> % ogonek dec:178 oct:262 hex:b2
- <b3> <b3> <00b3> % lslash dec:179 oct:263 hex:b3
- <b4> <b4> <00b4> % acute dec:180 oct:264 hex:b4
- <b5> <b5> <013e> % lcaron dec:181 oct:265 hex:b5
- <b6> <b6> <015b> % sacute dec:182 oct:266 hex:b6
- <b7> <b7> <00b7> % caron dec:183 oct:267 hex:b7
- <b8> <b8> <00b8> % cedilla dec:184 oct:270 hex:b8
- <b9> <b9> <0161> % scaron dec:185 oct:271 hex:b9
- <ba> <ba> <015f> % scedilla dec:186 oct:272 hex:ba
- <bb> <bb> <0165> % tcaron dec:187 oct:273 hex:bb
- <bc> <bc> <017a> % zacute dec:188 oct:274 hex:bc
- <bd> <bd> <00bd> % hungarumlaut dec:189 oct:275 hex:bd
- <be> <be> <017e> % zcaron dec:190 oct:276 hex:be
- <bf> <bf> <00bf> % zdotaccent dec:191 oct:277 hex:bf
- <c0> <c0> <0154> % Racute dec:192 oct:300 hex:c0
- <c1> <c1> <00c1> % Aacute dec:193 oct:301 hex:c1
- <c2> <c2> <00c2> % Acircumflex dec:194 oct:302 hex:c2
- <c3> <c3> <0102> % Abreve dec:195 oct:303 hex:c3
- <c4> <c4> <00c4> % Adieresis dec:196 oct:304 hex:c4
- <c5> <c5> <0139> % Lacute dec:197 oct:305 hex:c5
- <c6> <c6> <0106> % Cacute dec:198 oct:306 hex:c6
- <c7> <c7> <00c7> % Ccedilla dec:199 oct:307 hex:c7
- <c8> <c8> <010c> % Ccaron dec:200 oct:310 hex:c8
- <c9> <c9> <00c9> % Eacute dec:201 oct:311 hex:c9
- <ca> <ca> <0118> % Eogonek dec:202 oct:312 hex:ca
- <cb> <cb> <00cb> % Edieresis dec:203 oct:313 hex:cb
- <cc> <cc> <011a> % Ecaron dec:204 oct:314 hex:cc
- <cd> <cd> <00cd> % Iacute dec:205 oct:315 hex:cd
- <ce> <ce> <00ce> % Icircumflex dec:206 oct:316 hex:ce
- <cf> <cf> <010e> % Dcaron dec:207 oct:317 hex:cf
- <d0> <d0> <00d0> % Dslash dec:208 oct:320 hex:d0
- <d1> <d1> <0143> % Nacute dec:209 oct:321 hex:d1
- <d2> <d2> <0147> % Ncaron dec:210 oct:322 hex:d2
- <d3> <d3> <00d3> % Oacute dec:211 oct:323 hex:d3
- <d4> <d4> <00d4> % Ocircumflex dec:212 oct:324 hex:d4
- <d5> <d5> <00d5> % Ohungarumlaut dec:213 oct:325 hex:d5
- <d6> <d6> <00d6> % Odieresis dec:214 oct:326 hex:d6
- <d7> <d7> <00d7> % multiply dec:215 oct:327 hex:d7
- <d8> <d8> <0158> % Rcaron dec:216 oct:330 hex:d8
- <d9> <d9> <016e> % Uring dec:217 oct:331 hex:d9
- <da> <da> <00da> % Uacute dec:218 oct:332 hex:da
- <db> <db> <00db> % Uhungarumlaut dec:219 oct:333 hex:db
- <dc> <dc> <00dc> % Udieresis dec:220 oct:334 hex:dc
- <dd> <dd> <00dd> % Yacute dec:221 oct:335 hex:dd
- <de> <de> <00de> % Tcommaaccent dec:222 oct:336 hex:de
- <df> <df> <00df> % germandbls dec:223 oct:337 hex:df
- <e0> <e0> <0155> % racute dec:224 oct:340 hex:e0
- <e1> <e1> <00e1> % aacute dec:225 oct:341 hex:e1
- <e2> <e2> <00e2> % acircumflex dec:226 oct:342 hex:e2
- <e3> <e3> <0103> % abreve dec:227 oct:343 hex:e3
- <e4> <e4> <00e4> % adieresis dec:228 oct:344 hex:e4
- <e5> <e5> <013a> % lacute dec:229 oct:345 hex:e5
- <e6> <e6> <0107> % cacute dec:230 oct:346 hex:e6
- <e7> <e7> <00e7> % ccedilla dec:231 oct:347 hex:e7
- <e8> <e8> <010d> % ccaron dec:232 oct:350 hex:e8
- <e9> <e9> <00e9> % eacute dec:233 oct:351 hex:e9
- <ea> <ea> <0119> % eogonek dec:234 oct:352 hex:ea
- <eb> <eb> <00eb> % edieresis dec:235 oct:353 hex:eb
- <ec> <ec> <011b> % ecaron dec:236 oct:354 hex:ec
- <ed> <ed> <00ed> % iacute dec:237 oct:355 hex:ed
- <ee> <ee> <00ee> % icircumflex dec:238 oct:356 hex:ee
- <ef> <ef> <010f> % dcaron dec:239 oct:357 hex:ef
- <f0> <f0> <00f0> % dmacron dec:240 oct:360 hex:f0
- <f1> <f1> <0144> % nacute dec:241 oct:361 hex:f1
- <f2> <f2> <0148> % ncaron dec:242 oct:362 hex:f2
- <f3> <f3> <00f3> % oacute dec:243 oct:363 hex:f3
- <f4> <f4> <00f4> % ocircumflex dec:244 oct:364 hex:f4
- <f5> <f5> <00f5> % ohungarumlaut dec:245 oct:365 hex:f5
- <f6> <f6> <00f6> % odieresis dec:246 oct:366 hex:f6
- <f7> <f7> <00f7> % divide dec:247 oct:367 hex:f7
- <f8> <f8> <0159> % rcaron dec:248 oct:370 hex:f8
- <f9> <f9> <016f> % uring dec:249 oct:371 hex:f9
- <fa> <fa> <00fa> % uacute dec:250 oct:372 hex:fa
- <fb> <fb> <00fb> % uhungarumlaut dec:251 oct:373 hex:fb
- <fc> <fc> <00fc> % udieresis dec:252 oct:374 hex:fc
- <fd> <fd> <00fd> % yacute dec:253 oct:375 hex:fd
- <fe> <fe> <00fe> % tcommaaccent dec:254 oct:376 hex:fe
- <ff> <ff> <00ff> % dotaccent dec:255 oct:377 hex:ff
- endbfrange
- endcmap
-CMapName currentdict /CMap defineresource pop end
-end
-\stoppdffontresource
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/prop-ini.mkii b/Master/texmf-dist/tex/context/base/mkii/prop-ini.mkii
deleted file mode 100644
index 11efd036234..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/prop-ini.mkii
+++ /dev/null
@@ -1,150 +0,0 @@
-%D \module
-%D [ file=prop-ini,
-%D version=2003.04.20,
-%D title=\CONTEXT\ Property Macros,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Property Macros / Initialization}
-
-%D Welcome to the third alternative of this yet undocumented module,
-%D which means that there is no public interface yet!
-
-\unprotect
-
-\newcount\propertylevel
-
-\def\currentpropertylevel {\csname\??py:l:\currentpropertytype\endcsname} % counter
-\def\previouspropertylevel{\csname\??py:p:\currentpropertytype\endcsname} % counter
-
-\def\currentproperty {\csname\??py:c:\number\currentpropertylevel \endcsname} % string
-\def\previousproperty {\csname\??py:c:\number\previouspropertylevel\endcsname} % string
-
-% more efficient:
-
-\def\currentproperty {\csname\??py:c:\number\propertylevel\endcsname} % string
-\def\currentpropertytype {\csname\??py\currentproperty\c!type\endcsname}
-
-\def\docheckproperty % watch the s instead of e
- {\csname\s!check\currentpropertytype property\endcsname
- \global\expandafter\let\csname\??py\s!check\currentproperty\endcsname\empty}
-
-\def\checkproperty[#1]%
- {\bgroup
- \def\currentproperty{#1}%
- \csname\??py\s!check\currentproperty\endcsname
- \egroup}
-
-\unexpanded\def\property[#1]%
- {\groupedcommand{\dostartproperty{#1}}\dostopproperty}
-
-\unexpanded\def\startproperty[#1]%
- {\dostartproperty{#1}}
-
-\unexpanded\def\stopproperty
- {\dostopproperty}
-
-\def\dostartgproperty
- {\begingroup\dostartproperty}
-
-\def\dostopgproperty
- {\dostopproperty\endgroup}
-
-\def\dostartproperty#1% evt pack: {current}{level}{
- {\global\advance\propertylevel\plusone
- \@EAEAEA\xdef\currentproperty{#1}%
- \global\advance\previouspropertylevel\plusone
- \global\advance\currentpropertylevel\plusone
- \csname\??py\s!check\currentproperty\endcsname
- \csname\s!start\currentpropertytype\s!property\endcsname}
-
-\def\dostopproperty
- {\csname\s!stop\currentpropertytype\s!property\endcsname
- \global\advance\currentpropertylevel\minusone
- \global\advance\previouspropertylevel\minusone
- \global\advance\propertylevel\minusone}
-
-\def\defineproperty
- {\dotripleempty\dodefineproperty}
-
-\def\dodefineproperty[#1]%
- {\ifcsname\??py#1\c!global\endcsname
- \expandafter\nododefineproperty
- \else
- \expandafter\dododefineproperty
- \fi[#1]}
-
-% due to initializations/counters, definitions are always global
-%
-% global : yes : ungrouped
-% no : grouped
-% method : command : define commands
-% none : no commands
-
-\def\dododefineproperty[#1][#2][#3]% global ! ! !
- {\getgparameters[\??py#1][\c!global=\v!no,\c!type=#2,\c!method=\v!none,#3]% global ! ! ! !
- \ifcsname\??py:l:#2\endcsname \else
- \expandafter\newcount\csname\??py:l:#2\endcsname % current level
- \expandafter\newcount\csname\??py:p:#2\endcsname % previous level
- \global\csname\??py:p:#2\endcsname\minusone
- \global\expandafter\expandafter\let\csname\??py:c:0\endcsname\empty
- \fi
- \letgvalue{\??py\s!check#1}\docheckproperty
- \doifelsevalue{\??py#1\c!method}\v!command
- {\doifelsevalue{\??py#1\c!global}\v!yes
- {\setgvalue{\e!start#1}{\dostartproperty{#1}}%
- \letgvalue{\e!stop #1}\dostopproperty}%
- {\setgvalue{\e!start#1}{\dostartgproperty{#1}}%
- \letgvalue{\e!stop #1}\dostopgproperty}}%
- {\doifelsevalue{\??py#1\c!global}\v!yes
- {\setgvalue{\e!start#2}[##1]{\dostartproperty{##1}}%
- \letgvalue{\e!stop #2}\dostopproperty}%
- {\setgvalue{\e!start#2}[##1]{\dostartgproperty{##1}}%
- \letgvalue{\e!stop #2}\dostopgproperty}}}
-
-\def\nododefineproperty[#1][#2][#3]%
- {}
-
-\def\doifelseproperty#1{\doifdefinedelse{\??py#1\c!global}}
-
-\def\setupproperty
- {\dodoubleempty\dosetupproperty}
-
-\def\dosetupproperty[#1][#2]% local
- {\ifsecondargument
- \getparameters[\??py#1][#2]%
- \else
- \getparameters[\??py][#1]%
- \fi}
-
-\letvalue{\??py\s!empty}\empty
-
-% beware, normally \*parameter concerns the current one
-
-\def\propertyparameter#1#2% expands to #1 when not defined (see \define...)
- {\csname\??py
- \ifcsname\??py#1#2\endcsname
- #1#2%
- \else\ifcsname\??py\csname\??py#1\c!type\endcsname#2\endcsname
- \csname\??py#1\c!type\endcsname#2%
- \else
- \s!empty
- \fi\fi
- \endcsname}
-
-\def\currentpropertyparameter % self and class
- {\propertyparameter\currentproperty}
-
-\def\checkedpropertyparameter#1% only self
- {\executeifdefined{\??py\currentproperty#1}}
-
-\def\definepropertyhandler#1{\setvalue{\??py*#1}}
-\def\propertyhandler #1{\getvalue{\??py*#1}}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/prop-lay.mkii b/Master/texmf-dist/tex/context/base/mkii/prop-lay.mkii
deleted file mode 100644
index 77c48ca6ed2..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/prop-lay.mkii
+++ /dev/null
@@ -1,143 +0,0 @@
-%D \module
-%D [ file=prop-lay,
-%D version=2003.04.20,
-%D title=\CONTEXT\ Property Macros,
-%D subtitle=Layers,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Property Macros / Layers}
-
-%D Highly experimental, will probably change/evolve. Also, quite certainly
-%D we will no longer share code between mkii and mkiv.
-
-\unprotect
-
-\let\currentlayerproperty\empty
-
-\def\checklayerproperty
- {\doifelse{\checkedpropertyparameter\v!printable\currentproperty}\v!no
- {\def\printviewerlayer{0}}
- {\def\printviewerlayer{1}}%
- \dodefineviewerlayer
- \currentproperty % tag
- {\checkedpropertyparameter\c!title\currentproperty}%
- {\checkedpropertyparameter\c!state\v!start}% visible or hidden
- {0}% type (1=frozen)
- {\printviewerlayer}}% 1=printable
-
-\def\startlayerproperty
- {\let\currentlayerproperty\currentproperty
- \dostartviewerlayer\currentproperty}
-
-\def\stoplayerproperty
- {\dostopviewerlayer
- \let\currentlayerproperty\previousproperty}
-
-\def\domakelayerpropertylist
- {\iflocation
- \expandafter\domakeviewerlayerlist
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\setglobalsystemreference \rt!exec \v!HideLayer {hidelayer}
-\setglobalsystemreference \rt!exec \v!VideLayer {videlayer}
-\setglobalsystemreference \rt!exec \v!ToggleLayer {togglelayer}
-
-\setexecutecommandcheck {hidelayer} \domakelayerpropertylist
-\setexecutecommandcheck {videlayer} \domakelayerpropertylist
-\setexecutecommandcheck {togglelayer} \domakelayerpropertylist
-
-% \currentlayerproperty
-% \checklayerproperty
-% \startlayerproperty
-% \stoplayerproperty
-% \domakelayerpropertylist
-
-%D \starttext
-%D
-%D \setuppapersize[S4][S4]
-%D \setuplayout[middle]
-%D \setupcolors[state=start]
-%D \setupinteraction[state=start,color=,contrastcolor=]
-%D
-%D \defineproperty [L1] [layer] [title=layer 1]
-%D \defineproperty [L2] [layer] [title=layer 2]
-%D
-%D \button{HIDE L1}[HideLayer{L1}]
-%D \button{VIDE L1}[VideLayer{L1}]
-%D \button{TOGGLE L1}[ToggleLayer{L1}]
-%D
-%D \button{HIDE L2}[HideLayer{L2}]
-%D \button{VIDE L2}[VideLayer{L2}]
-%D \button{TOGGLE L2}[ToggleLayer{L2}]
-%D
-%D \noheaderandfooterlines \centerbox{\startoverlay
-%D {\definedfont[Mono at 150pt]%
-%D \startproperty[L1]\red TEST\stopproperty}
-%D {\definedfont[Mono at 150pt]%
-%D \startproperty[L2]\green TEST\stopproperty}
-%D \stopoverlay} \page
-%D
-%D \noheaderandfooterlines \centerbox{\startoverlay
-%D {\definedfont[Mono at 15pt]%
-%D \goto{\startproperty[L1]\red TEST\stopproperty}[CloseDocument]}
-%D {\definedfont[Mono at 15pt]%
-%D \goto{\startproperty[L2]\green TEST\stopproperty}[CloseDocument]}
-%D \stopoverlay} \page
-%D
-%D \startproperty[L1]
-%D level 1 \startproperty[L2]level 2 \stopproperty level 1
-%D \stopproperty
-%D
-%D \startproperty[L1]
-%D level 1 \page \startproperty[L2]level 2 \stopproperty level 1
-%D \stopproperty
-%D
-%D \stoptext
-
-%D Handy for tracing:
-
-\def\showlayoutcomponents
- {\let\startlayoutcomponent\dostartlayoutcomponent
- \let\stoplayoutcomponent \dostoplayoutcomponent}
-
-\def\dodefinelayoutcomponent#1#2%
- {\doifelsenothing{#2}%
- {\defineproperty[#1][\s!layer]}%
- {\defineproperty[#1][\s!layer][\c!title=#2]}}
-
-\def\dostartlayoutcomponent#1#2%
- {\doifelseproperty{#1}\donothing{\dodefinelayoutcomponent{#1}{#2}}%
- \startproperty[#1]}
-
-\def\dostoplayoutcomponent
- {\stopproperty}
-
-\let\startlayoutcomponent\gobbletwoarguments
-\let\stoplayoutcomponent \relax
-
-\protect \endinput
-
-% \def\remaplayering
-% {\dodoubleargument\doremaplayering}
-%
-% \def\remaplayering[#1][#2]%
-% {\setvalue{\??lm#1}{#2}}
-%
-% \def\remappedlayering#1%
-% {\ifcsname\??lm#1\endcsname
-% \@EA\remappedlayering\csname\??lm#1\endcsname\else#1%
-% \fi}
-%
-% \def\startshowlayering#1#2%
-% {\ifshowlayering
-% \defineproperty[\remappedlayering{#1}][\s!layer][\c!titel=#2]%
-% \startproperty[\remappedlayering{#1}]%
-% \fi}
diff --git a/Master/texmf-dist/tex/context/base/mkii/prop-mis.mkii b/Master/texmf-dist/tex/context/base/mkii/prop-mis.mkii
deleted file mode 100644
index 47fb9ea0661..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/prop-mis.mkii
+++ /dev/null
@@ -1,189 +0,0 @@
-%D \module
-%D [ file=prop-mis,
-%D version=2004.05.29, % some code moved from private modules
-%D title=\CONTEXT\ Property Macros,
-%D subtitle=Miscelaneous,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Property Macros / Miscelaneous}
-
-%D This module contains some code that has been in use in some
-%D private modules (p-*). These features depend on the fact
-%D that pdftex writes the page content as one stream.
-
-%D EXPERIMENTAL
-
-\unprotect
-
-%D Stream based overprint and knockout:
-
-\defineproperty[\v!overprint][\s!overprint] [\c!method=\v!command]
-\defineproperty[\v!knockout] [\s!overprint] [\c!method=\v!command]
-
-%D Negation.
-
-\defineproperty [\v!negative] [\s!negative] [\c!method=\v!command]
-\defineproperty [\v!positive] [\s!negative] [\c!method=\v!command]
-
-%D Special font effects.
-
-\setupproperty
- [\s!effect]
- [\c!rulethickness=\zeropoint,
- \c!stretch=0]
-
-\defineproperty [\v!inner] [\s!effect] [\c!rulethickness=.25pt]
-\defineproperty [\v!outer] [\s!effect] [\c!rulethickness=.25pt]
-\defineproperty [\v!both] [\s!effect] [\c!rulethickness=.25pt]
-\defineproperty [\v!normal] [\s!effect]
-\defineproperty [\v!hidden] [\s!effect]
-
-\defineproperty [\v!stretch] [\s!effect] [\c!stretch=1]
-
-%D Overprint cum suis.
-
-\definepropertyhandler \v!overprint {\dostartoverprint}
-\definepropertyhandler \v!knockout {\dostopoverprint }
-
-\def\startoverprintproperty
- {\ifincolor
- \propertyhandler\currentproperty
- \dooverprintmark\currentproperty
- \fi}
-
-\def\stopoverprintproperty
- {\ifincolor
- \ifcase\currentpropertylevel\or
- \dostopoverprint
- \dooverprintmark\empty
- \else
- \propertyhandler\previousproperty
- \dooverprintmark\previousproperty
- \fi
- \fi}
-
-\rawnewmark\overprintmark
-
-\def\dooverprintmark#1%
- {\ifinpagebody \else \ifinframed \else
- \expanded{\rawsetmark\noexpand\overprintmark{#1}}%
- \fi \fi}
-
-\def\pushoverprintproperty
- {\doifsomething{\rawgetbotmark\overprintmark}\dostopoverprint}
-
-\def\popoverprintproperty
- {\doifsomething{\rawgetbotmark\overprintmark}%
- {\propertyhandler{\rawgetbotmark\overprintmark}}}
-
-\def\popsplitoverprintproperty
- {\getsplitmarks\overprintmark % hier wel
- \doifsomething{\rawgetsplitbotmark\overprintmark}%
- {\propertyhandler{\rawgetsplitbotmark\overprintmark}}}
-
-\appendtoks \pushoverprintproperty \to \everypushproperties
-\appendtoks \popoverprintproperty \to \everypopproperties
-\appendtoks \popsplitoverprintproperty \to \everypopsplitproperties
-
-%D Negative cum suis.
-
-\definepropertyhandler \v!negative {\dostartnegative}
-\definepropertyhandler \v!positive {\dostopnegative }
-
-\def\startnegativeproperty
- {\ifincolor
- \propertyhandler\currentproperty
- \donegativemark\currentproperty
- \fi}
-
-\def\stopnegativeproperty
- {\ifincolor
- \ifcase\currentpropertylevel\or
- \dostopnegative
- \donegativemark\empty
- \else
- \propertyhandler\previousproperty
- \donegativemark\previousproperty
- \fi
- \fi}
-
-\rawnewmark\negativemark
-
-\def\donegativemark#1%
- {\ifinpagebody \else \ifinframed \else
- \expanded{\rawsetmark\noexpand\negativemark{#1}}%
- \fi \fi}
-
-\def\pushnegativeproperty
- {\doifsomething{\rawgetbotmark\negativemark}\dostopnegative}
-
-\def\popnegativeproperty
- {\doifsomething{\rawgetbotmark\overprintmark}%
- {\propertyhandler{\rawgetbotmark\negativemark}}}
-
-\def\popsplitnegativeproperty
- {\getsplitmarks\negativemark % hier wel
- \doifsomething{\rawgetsplitbotmark\negativemark}%
- {\propertyhandler{\rawgetsplitbotmark\negativemark}}}
-
-\appendtoks \pushnegativeproperty \to \everypushproperties
-\appendtoks \popnegativeproperty \to \everypopproperties
-\appendtoks \popsplitnegativeproperty \to \everypopsplitproperties
-
-%D Effects.
-
-\definepropertyhandler \v!normal {0}
-\definepropertyhandler \v!inner {0}
-\definepropertyhandler \v!outer {1}
-\definepropertyhandler \v!both {2}
-\definepropertyhandler \v!hidden {3}
-\definepropertyhandler \v!stretch{0}
-
-\def\effectpropertydata#1%
- {{\propertyhandler{#1}}%
- {\propertyparameter{#1}\c!rulethickness}%
- {\propertyparameter{#1}\c!stretch}}
-
-\def\starteffectproperty
- {\expanded{\dostartfonteffect\effectpropertydata\currentproperty}%
- \doeffectmark{\effectpropertydata\currentproperty}}
-
-\def\stopeffectproperty
- {\dostopfonteffect
- \ifcase\currentpropertylevel\or
- \doeffectmark\empty
- \else
- \expanded{\dostartfonteffect\effectpropertydata\previousproperty}%
- \doeffectmark{\effectpropertydata\previousproperty}%
- \fi}
-
-\rawnewmark\effectmark
-
-\def\doeffectmark#1%
- {\ifinpagebody \else \ifinframed \else
- \expanded{\rawsetmark\noexpand\effectmark{#1}}% could be number
- \fi \fi}
-
-\def\pusheffectproperty
- {\doifsomething{\rawgetbotmark\effectmark}\dostopfonteffect}
-
-\def\popeffectproperty
- {\doifsomething{\rawgetbotmark\effectmark}%
- {\expanded{\dostartfonteffect\rawgetbotmark\effectmark}}}
-
-\def\popspliteffectproperty
- {\getsplitmarks\effectmark
- \doifsomething{\rawgetsplitbotmark\effectmark}%
- {\expanded{\dostartfonteffect\rawgetsplitbotmark\effectmark}}}
-
-\appendtoks \pusheffectproperty \to \everypushproperties
-\appendtoks \popeffectproperty \to \everypopproperties
-\appendtoks \popspliteffectproperty \to \everypopsplitproperties
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/regi-8859-1.mkii b/Master/texmf-dist/tex/context/base/mkii/regi-8859-1.mkii
deleted file mode 100644
index 00439ae9e3e..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/regi-8859-1.mkii
+++ /dev/null
@@ -1,154 +0,0 @@
-%D \module
-%D [ file=regi-8859-1,
-%D version=2005.12.26,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=iso-8859-1 (West European),
-%D author=script-generated,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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: \type{\enableregime[8859-1]} (see \type {regi-syn} for
-%D alternatives calls).
-
-\startregime[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/mkii/regi-8859-10.mkii b/Master/texmf-dist/tex/context/base/mkii/regi-8859-10.mkii
deleted file mode 100644
index 6646860342a..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/regi-8859-10.mkii
+++ /dev/null
@@ -1,152 +0,0 @@
-%D \module
-%D [ file=regi-8859-10,
-%D version=2005.12.26,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=iso-8859-10 (Nordic),
-%D author=script-generated,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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-10/Latin6 input encoding (regime) for Nordic languages.
-%D
-%D Usage: \type{\enableregime[8859-10]} (see \type {regi-syn} for
-%D alternatives calls).
-
-
-\startregime[iso-8859-10]
-
-\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 {\Emacron} % 0112 LATIN CAPITAL LETTER E WITH MACRON
-\defineactivetoken 163 {\Gcommaaccent} % 0122 LATIN CAPITAL LETTER G WITH CEDILLA
-\defineactivetoken 164 {\Imacron} % 012A LATIN CAPITAL LETTER I WITH MACRON
-\defineactivetoken 165 {\Itilde} % 0128 LATIN CAPITAL LETTER I WITH TILDE
-\defineactivetoken 166 {\Kcommaaccent} % 0136 LATIN CAPITAL LETTER K WITH CEDILLA
-\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN
-\defineactivetoken 168 {\Lcommaaccent} % 013B LATIN CAPITAL LETTER L WITH CEDILLA
-\defineactivetoken 169 {\Dstroke} % 0110 LATIN CAPITAL LETTER D WITH STROKE
-\defineactivetoken 170 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON
-\defineactivetoken 171 {\Tstroke} % 0166 LATIN CAPITAL LETTER T WITH STROKE
-\defineactivetoken 172 {\Zcaron} % 017D LATIN CAPITAL LETTER Z WITH CARON
-\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN
-\defineactivetoken 174 {\Umacron} % 016A LATIN CAPITAL LETTER U WITH MACRON
-\defineactivetoken 175 {\Neng} % 014A LATIN CAPITAL LETTER ENG
-\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN
-\defineactivetoken 177 {\aogonek} % 0105 LATIN SMALL LETTER A WITH OGONEK
-\defineactivetoken 178 {\emacron} % 0113 LATIN SMALL LETTER E WITH MACRON
-\defineactivetoken 179 {\gcommaaccent} % 0123 LATIN SMALL LETTER G WITH CEDILLA
-\defineactivetoken 180 {\imacron} % 012B LATIN SMALL LETTER I WITH MACRON
-\defineactivetoken 181 {\itilde} % 0129 LATIN SMALL LETTER I WITH TILDE
-\defineactivetoken 182 {\kcommaaccent} % 0137 LATIN SMALL LETTER K WITH CEDILLA
-\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT
-\defineactivetoken 184 {\lcommaaccent} % 013C LATIN SMALL LETTER L WITH CEDILLA
-\defineactivetoken 185 {\dstroke} % 0111 LATIN SMALL LETTER D WITH STROKE
-\defineactivetoken 186 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON
-\defineactivetoken 187 {\tstroke} % 0167 LATIN SMALL LETTER T WITH STROKE
-\defineactivetoken 188 {\zcaron} % 017E LATIN SMALL LETTER Z WITH CARON
-\defineactivetoken 189 {\texthorizontalbar} % 2015 HORIZONTAL BAR
-\defineactivetoken 190 {\umacron} % 016B LATIN SMALL LETTER U WITH MACRON
-\defineactivetoken 191 {\neng} % 014B LATIN SMALL LETTER ENG
-\defineactivetoken 192 {\Amacron} % 0100 LATIN CAPITAL LETTER A WITH MACRON
-\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 {\Iogonek} % 012E LATIN CAPITAL LETTER I WITH OGONEK
-\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 {\Edotaccent} % 0116 LATIN CAPITAL LETTER E WITH DOT ABOVE
-\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 {\Ncommaaccent} % 0145 LATIN CAPITAL LETTER N WITH CEDILLA
-\defineactivetoken 210 {\Omacron} % 014C LATIN CAPITAL LETTER O WITH MACRON
-\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 {\Utilde} % 0168 LATIN CAPITAL LETTER U WITH TILDE
-\defineactivetoken 216 {\Ostroke} % 00D8 LATIN CAPITAL LETTER O WITH STROKE
-\defineactivetoken 217 {\Uogonek} % 0172 LATIN CAPITAL LETTER U WITH OGONEK
-\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 {\amacron} % 0101 LATIN SMALL LETTER A WITH MACRON
-\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 {\iogonek} % 012F LATIN SMALL LETTER I WITH OGONEK
-\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 {\edotaccent} % 0117 LATIN SMALL LETTER E WITH DOT ABOVE
-\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 {\ncommaaccent} % 0146 LATIN SMALL LETTER N WITH CEDILLA
-\defineactivetoken 242 {\omacron} % 014D LATIN SMALL LETTER O WITH MACRON
-\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 {\utilde} % 0169 LATIN SMALL LETTER U WITH TILDE
-\defineactivetoken 248 {\ostroke} % 00F8 LATIN SMALL LETTER O WITH STROKE
-\defineactivetoken 249 {\uogonek} % 0173 LATIN SMALL LETTER U WITH OGONEK
-\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 {\kkra} % 0138 LATIN SMALL LETTER KRA
-
-\stopregime
-
diff --git a/Master/texmf-dist/tex/context/base/mkii/regi-8859-13.mkii b/Master/texmf-dist/tex/context/base/mkii/regi-8859-13.mkii
deleted file mode 100644
index f1b1dbe7870..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/regi-8859-13.mkii
+++ /dev/null
@@ -1,152 +0,0 @@
-%D \module
-%D [ file=regi-8859-13,
-%D version=2005.12.26,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=iso-8859-13 (Baltic),
-%D author=script-generated,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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-13/Latin7 input encoding (regime) for Baltic languages,
-%D see also iso-8859-4 and cp1257.
-%D
-%D Usage: \type{\enableregime[8859-13]} (see \type {regi-syn} for
-%D alternatives calls).
-
-\startregime[iso-8859-13]
-
-\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 {\quotedblright} % 201D RIGHT DOUBLE QUOTATION MARK
-\defineactivetoken 162 {\textcent} % 00A2 CENT SIGN
-\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN
-\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN
-\defineactivetoken 165 {\quotedblbase} % 201E DOUBLE LOW-9 QUOTATION MARK
-\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 {\quotedblleft} % 201C LEFT DOUBLE QUOTATION MARK
-\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 {\quoteright} % 2019 RIGHT SINGLE QUOTATION MARK
-
-\stopregime
-
diff --git a/Master/texmf-dist/tex/context/base/mkii/regi-8859-15.mkii b/Master/texmf-dist/tex/context/base/mkii/regi-8859-15.mkii
deleted file mode 100644
index 1455161c30e..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/regi-8859-15.mkii
+++ /dev/null
@@ -1,154 +0,0 @@
-%D \module
-%D [ file=regi-8859-15,
-%D version=2005.12.26,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=iso-8859-15 (West European),
-%D author=script-generated,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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
-%D West European languages, almost the same as iso-8859-1 with rarely
-%D used symbols (currency symbol,%D fractions, accents) replaced by
-%D Euro and some additional letters,%D see also cp1252.
-%D
-%D Usage: \type{\enableregime[8859-15]} (see \type {regi-syn} for
-%D alternatives calls).
-
-\startregime[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/mkii/regi-8859-16.mkii b/Master/texmf-dist/tex/context/base/mkii/regi-8859-16.mkii
deleted file mode 100644
index f284c4116e7..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/regi-8859-16.mkii
+++ /dev/null
@@ -1,151 +0,0 @@
-%D \module
-%D [ file=regi-8859-16,
-%D version=2005.12.26,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=iso-8859-16 (Romanian),
-%D author=script-generated,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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-16/Latin10 input encoding (regime) for Romanian.
-%D
-%D Usage: \type{\enableregime[8859-16]} (see \type {regi-syn} for
-%D alternatives calls).
-
-\startregime[8859-16]
-
-\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 {\aogonek} % 0105 LATIN SMALL LETTER A WITH OGONEK
-\defineactivetoken 163 {\Lstroke} % 0141 LATIN CAPITAL LETTER L WITH STROKE
-\defineactivetoken 164 {\texteuro} % 20AC EURO SIGN
-\defineactivetoken 165 {\quotedblbase} % 201E DOUBLE LOW-9 QUOTATION MARK
-\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 {\Scommaaccent} % 0218 LATIN CAPITAL LETTER S WITH COMMA BELOW
-\defineactivetoken 171 {\leftguillemot} % 00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
-\defineactivetoken 172 {\Zacute} % 0179 LATIN CAPITAL LETTER Z WITH ACUTE
-\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN
-\defineactivetoken 174 {\zacute} % 017A LATIN SMALL LETTER Z WITH ACUTE
-\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 {\Ccaron} % 010C LATIN CAPITAL LETTER C WITH CARON
-\defineactivetoken 179 {\lstroke} % 0142 LATIN SMALL LETTER L WITH STROKE
-\defineactivetoken 180 {\Zcaron} % 017D LATIN CAPITAL LETTER Z WITH CARON
-\defineactivetoken 181 {\quotedblright} % 201D RIGHT DOUBLE QUOTATION MARK
-\defineactivetoken 182 {\paragraphmark} % 00B6 PILCROW SIGN
-\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT
-\defineactivetoken 184 {\zcaron} % 017E LATIN SMALL LETTER Z WITH CARON
-\defineactivetoken 185 {\ccaron} % 010D LATIN SMALL LETTER C WITH CARON
-\defineactivetoken 186 {\scommaaccent} % 0219 LATIN SMALL LETTER S WITH COMMA BELOW
-\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 {\zdotaccent} % 017C LATIN SMALL LETTER Z WITH DOT ABOVE
-\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 {\Abreve} % 0102 LATIN CAPITAL LETTER A WITH BREVE
-\defineactivetoken 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS
-\defineactivetoken 197 {\Cacute} % 0106 LATIN CAPITAL LETTER C WITH ACUTE
-\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 {\Dstroke} % 0110 LATIN CAPITAL LETTER D WITH STROKE
-\defineactivetoken 209 {\Nacute} % 0143 LATIN CAPITAL LETTER N WITH 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 {\Ohungarumlaut} % 0150 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
-\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS
-\defineactivetoken 215 {\Sacute} % 015A LATIN CAPITAL LETTER S WITH ACUTE
-\defineactivetoken 216 {\Uhungarumlaut} % 0170 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
-\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 {\Eogonek} % 0118 LATIN CAPITAL LETTER E WITH OGONEK
-\defineactivetoken 222 {\Tcommaaccent} % 021A LATIN CAPITAL LETTER T WITH COMMA BELOW
-\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 {\abreve} % 0103 LATIN SMALL LETTER A WITH BREVE
-\defineactivetoken 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS
-\defineactivetoken 229 {\cacute} % 0107 LATIN SMALL LETTER C WITH ACUTE
-\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 {\dstroke} % 0111 LATIN SMALL LETTER D WITH STROKE
-\defineactivetoken 241 {\nacute} % 0144 LATIN SMALL LETTER N WITH ACUTE
-\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 {\ohungarumlaut} % 0151 LATIN SMALL LETTER O WITH DOUBLE ACUTE
-\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS
-\defineactivetoken 247 {\sacute} % 015B LATIN SMALL LETTER S WITH ACUTE
-\defineactivetoken 248 {\uhungarumlaut} % 0171 LATIN SMALL LETTER U WITH DOUBLE ACUTE
-\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 {\eogonek} % 0119 LATIN SMALL LETTER E WITH OGONEK
-\defineactivetoken 254 {\tcommaaccent} % 021B LATIN SMALL LETTER T WITH COMMA BELOW
-\defineactivetoken 255 {\ydiaeresis} % 00FF LATIN SMALL LETTER Y WITH DIAERESIS
-
-\stopregime
-
diff --git a/Master/texmf-dist/tex/context/base/mkii/regi-8859-2.mkii b/Master/texmf-dist/tex/context/base/mkii/regi-8859-2.mkii
deleted file mode 100644
index 9efc27a7968..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/regi-8859-2.mkii
+++ /dev/null
@@ -1,152 +0,0 @@
-%D \module
-%D [ file=regi-8859-2,
-%D version=2005.12.26,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=iso-8859-2 (East European),
-%D author=script-generated,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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
-%D Central European languages, see also cp1250.
-%D
-%D Usage: \type{\enableregime[8859-2]} (see \type {regi-syn} for
-%D alternatives calls).
-
-\startregime[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/mkii/regi-8859-3.mkii b/Master/texmf-dist/tex/context/base/mkii/regi-8859-3.mkii
deleted file mode 100644
index 99fa66ac313..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/regi-8859-3.mkii
+++ /dev/null
@@ -1,145 +0,0 @@
-%D \module
-%D [ file=regi-8859-3,
-%D version=2005.12.26,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=iso-8859-3 (South European),
-%D author=script-generated,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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-3/Latin3 input encoding (regime) for South
-%D European languages, esp. for Esperanto and Maltese.
-%D
-%D Usage: \type{\enableregime[8859-3]} (see \type {regi-syn} for
-%D alternatives calls).
-
-\startregime[8859-3]
-
-\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 {\Hstroke} % 0126 LATIN CAPITAL LETTER H WITH STROKE
-\defineactivetoken 162 {\textbreve} % 02D8 BREVE
-\defineactivetoken 163 {\textsterling} % 00A3 POUND SIGN
-\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN
-\defineactivetoken 166 {\Hcircumflex} % 0124 LATIN CAPITAL LETTER H WITH CIRCUMFLEX
-\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN
-\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS
-\defineactivetoken 169 {\Idotaccent} % 0130 LATIN CAPITAL LETTER I WITH DOT ABOVE
-\defineactivetoken 170 {\Scedilla} % 015E LATIN CAPITAL LETTER S WITH CEDILLA
-\defineactivetoken 171 {\Gbreve} % 011E LATIN CAPITAL LETTER G WITH BREVE
-\defineactivetoken 172 {\Jcircumflex} % 0134 LATIN CAPITAL LETTER J WITH CIRCUMFLEX
-\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN
-\defineactivetoken 175 {\Zdotaccent} % 017B LATIN CAPITAL LETTER Z WITH DOT ABOVE
-\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN
-\defineactivetoken 177 {\hstroke} % 0127 LATIN SMALL LETTER H WITH STROKE
-\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 {\hcircumflex} % 0125 LATIN SMALL LETTER H WITH CIRCUMFLEX
-\defineactivetoken 183 {\periodcentered} % 00B7 MIDDLE DOT
-\defineactivetoken 184 {\textcedilla} % 00B8 CEDILLA
-\defineactivetoken 185 {\dotlessi} % 0131 LATIN SMALL LETTER DOTLESS I
-\defineactivetoken 186 {\scedilla} % 015F LATIN SMALL LETTER S WITH CEDILLA
-\defineactivetoken 187 {\gbreve} % 011F LATIN SMALL LETTER G WITH BREVE
-\defineactivetoken 188 {\jcircumflex} % 0135 LATIN SMALL LETTER J WITH CIRCUMFLEX
-\defineactivetoken 189 {\onehalf} % 00BD VULGAR FRACTION ONE HALF
-\defineactivetoken 191 {\zdotaccent} % 017C LATIN SMALL LETTER Z WITH DOT ABOVE
-\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 196 {\Adiaeresis} % 00C4 LATIN CAPITAL LETTER A WITH DIAERESIS
-\defineactivetoken 197 {\Cdotaccent} % 010A LATIN CAPITAL LETTER C WITH DOT ABOVE
-\defineactivetoken 198 {\Ccircumflex} % 0108 LATIN CAPITAL LETTER C WITH CIRCUMFLEX
-\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 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 {\Gdotaccent} % 0120 LATIN CAPITAL LETTER G WITH DOT ABOVE
-\defineactivetoken 214 {\Odiaeresis} % 00D6 LATIN CAPITAL LETTER O WITH DIAERESIS
-\defineactivetoken 215 {\textmultiply} % 00D7 MULTIPLICATION SIGN
-\defineactivetoken 216 {\Gcircumflex} % 011C LATIN CAPITAL LETTER G WITH CIRCUMFLEX
-\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 {\Ubreve} % 016C LATIN CAPITAL LETTER U WITH BREVE
-\defineactivetoken 222 {\Scircumflex} % 015C LATIN CAPITAL LETTER S WITH CIRCUMFLEX
-\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 228 {\adiaeresis} % 00E4 LATIN SMALL LETTER A WITH DIAERESIS
-\defineactivetoken 229 {\cdotaccent} % 010B LATIN SMALL LETTER C WITH DOT ABOVE
-\defineactivetoken 230 {\ccircumflex} % 0109 LATIN SMALL LETTER C WITH CIRCUMFLEX
-\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 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 {\gdotaccent} % 0121 LATIN SMALL LETTER G WITH DOT ABOVE
-\defineactivetoken 246 {\odiaeresis} % 00F6 LATIN SMALL LETTER O WITH DIAERESIS
-\defineactivetoken 247 {\textdiv} % 00F7 DIVISION SIGN
-\defineactivetoken 248 {\gcircumflex} % 011D LATIN SMALL LETTER G WITH CIRCUMFLEX
-\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 {\ubreve} % 016D LATIN SMALL LETTER U WITH BREVE
-\defineactivetoken 254 {\scircumflex} % 015D LATIN SMALL LETTER S WITH CIRCUMFLEX
-\defineactivetoken 255 {\textdotaccent} % 02D9 DOT ABOVE
-
-\stopregime
-
diff --git a/Master/texmf-dist/tex/context/base/mkii/regi-8859-4.mkii b/Master/texmf-dist/tex/context/base/mkii/regi-8859-4.mkii
deleted file mode 100644
index c7adf34710e..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/regi-8859-4.mkii
+++ /dev/null
@@ -1,152 +0,0 @@
-%D \module
-%D [ file=regi-8859-4,
-%D version=2005.12.26,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=iso-8859-4 (North European),
-%D author=script-generated,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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-4/Latin4 input encoding (regime) for West
-%D European languages, see also cp1257 and iso-8859-13.
-%D
-%D Usage: \type{\enableregime[8859-4]} (see \type {regi-syn} for
-%D alternatives calls).
-
-\startregime[8859-4]
-
-\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 {\kkra} % 0138 LATIN SMALL LETTER KRA
-\defineactivetoken 163 {\Rcommaaccent} % 0156 LATIN CAPITAL LETTER R WITH CEDILLA
-\defineactivetoken 164 {\textcurrency} % 00A4 CURRENCY SIGN
-\defineactivetoken 165 {\Itilde} % 0128 LATIN CAPITAL LETTER I WITH TILDE
-\defineactivetoken 166 {\Lcommaaccent} % 013B LATIN CAPITAL LETTER L WITH CEDILLA
-\defineactivetoken 167 {\sectionmark} % 00A7 SECTION SIGN
-\defineactivetoken 168 {\textdiaeresis} % 00A8 DIAERESIS
-\defineactivetoken 169 {\Scaron} % 0160 LATIN CAPITAL LETTER S WITH CARON
-\defineactivetoken 170 {\Emacron} % 0112 LATIN CAPITAL LETTER E WITH MACRON
-\defineactivetoken 171 {\Gcommaaccent} % 0122 LATIN CAPITAL LETTER G WITH CEDILLA
-\defineactivetoken 172 {\Tstroke} % 0166 LATIN CAPITAL LETTER T WITH STROKE
-\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN
-\defineactivetoken 174 {\Zcaron} % 017D LATIN CAPITAL LETTER Z WITH CARON
-\defineactivetoken 175 {\textmacron} % 00AF MACRON
-\defineactivetoken 176 {\textdegree} % 00B0 DEGREE SIGN
-\defineactivetoken 177 {\aogonek} % 0105 LATIN SMALL LETTER A WITH OGONEK
-\defineactivetoken 178 {\textogonek} % 02DB OGONEK
-\defineactivetoken 179 {\rcommaaccent} % 0157 LATIN SMALL LETTER R WITH CEDILLA
-\defineactivetoken 180 {\textacute} % 00B4 ACUTE ACCENT
-\defineactivetoken 181 {\itilde} % 0129 LATIN SMALL LETTER I WITH TILDE
-\defineactivetoken 182 {\lcommaaccent} % 013C LATIN SMALL LETTER L WITH CEDILLA
-\defineactivetoken 183 {\textcaron} % 02C7 CARON
-\defineactivetoken 184 {\textcedilla} % 00B8 CEDILLA
-\defineactivetoken 185 {\scaron} % 0161 LATIN SMALL LETTER S WITH CARON
-\defineactivetoken 186 {\emacron} % 0113 LATIN SMALL LETTER E WITH MACRON
-\defineactivetoken 187 {\gcommaaccent} % 0123 LATIN SMALL LETTER G WITH CEDILLA
-\defineactivetoken 188 {\tstroke} % 0167 LATIN SMALL LETTER T WITH STROKE
-\defineactivetoken 189 {\Neng} % 014A LATIN CAPITAL LETTER ENG
-\defineactivetoken 190 {\zcaron} % 017E LATIN SMALL LETTER Z WITH CARON
-\defineactivetoken 191 {\neng} % 014B LATIN SMALL LETTER ENG
-\defineactivetoken 192 {\Amacron} % 0100 LATIN CAPITAL LETTER A WITH MACRON
-\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 {\Iogonek} % 012E LATIN CAPITAL LETTER I WITH OGONEK
-\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 {\Edotaccent} % 0116 LATIN CAPITAL LETTER E WITH DOT ABOVE
-\defineactivetoken 205 {\Iacute} % 00CD LATIN CAPITAL LETTER I WITH ACUTE
-\defineactivetoken 206 {\Icircumflex} % 00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX
-\defineactivetoken 207 {\Imacron} % 012A LATIN CAPITAL LETTER I WITH MACRON
-\defineactivetoken 208 {\Dstroke} % 0110 LATIN CAPITAL LETTER D WITH STROKE
-\defineactivetoken 209 {\Ncommaaccent} % 0145 LATIN CAPITAL LETTER N WITH CEDILLA
-\defineactivetoken 210 {\Omacron} % 014C LATIN CAPITAL LETTER O WITH MACRON
-\defineactivetoken 211 {\Kcommaaccent} % 0136 LATIN CAPITAL LETTER K WITH CEDILLA
-\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 {\Uogonek} % 0172 LATIN CAPITAL LETTER U WITH OGONEK
-\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 {\Utilde} % 0168 LATIN CAPITAL LETTER U WITH TILDE
-\defineactivetoken 222 {\Umacron} % 016A LATIN CAPITAL LETTER U WITH MACRON
-\defineactivetoken 223 {\ssharp} % 00DF LATIN SMALL LETTER SHARP S
-\defineactivetoken 224 {\amacron} % 0101 LATIN SMALL LETTER A WITH MACRON
-\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 {\iogonek} % 012F LATIN SMALL LETTER I WITH OGONEK
-\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 {\edotaccent} % 0117 LATIN SMALL LETTER E WITH DOT ABOVE
-\defineactivetoken 237 {\iacute} % 00ED LATIN SMALL LETTER I WITH ACUTE
-\defineactivetoken 238 {\icircumflex} % 00EE LATIN SMALL LETTER I WITH CIRCUMFLEX
-\defineactivetoken 239 {\imacron} % 012B LATIN SMALL LETTER I WITH MACRON
-\defineactivetoken 240 {\dstroke} % 0111 LATIN SMALL LETTER D WITH STROKE
-\defineactivetoken 241 {\ncommaaccent} % 0146 LATIN SMALL LETTER N WITH CEDILLA
-\defineactivetoken 242 {\omacron} % 014D LATIN SMALL LETTER O WITH MACRON
-\defineactivetoken 243 {\kcommaaccent} % 0137 LATIN SMALL LETTER K WITH CEDILLA
-\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 {\uogonek} % 0173 LATIN SMALL LETTER U WITH OGONEK
-\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 {\utilde} % 0169 LATIN SMALL LETTER U WITH TILDE
-\defineactivetoken 254 {\umacron} % 016B LATIN SMALL LETTER U WITH MACRON
-\defineactivetoken 255 {\textdotaccent} % 02D9 DOT ABOVE
-
-\stopregime
-
diff --git a/Master/texmf-dist/tex/context/base/mkii/regi-8859-5.mkii b/Master/texmf-dist/tex/context/base/mkii/regi-8859-5.mkii
deleted file mode 100644
index 807d74640b4..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/regi-8859-5.mkii
+++ /dev/null
@@ -1,152 +0,0 @@
-%D \module
-%D [ file=regi-8859-5,
-%D version=2005.12.26,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=iso-8859-5 (Cyrillic),
-%D author=script-generated,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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-5 input encoding (regime) for Cyrillic,
-%D see also regi-cyr and regi-cyp.
-%D
-%D Usage: \type{\enableregime[8859-5]} (see \type {regi-syn} for
-%D alternatives calls).
-
-\startregime[8859-5]
-
-\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 {\cyrillicYO} % 0401 CYRILLIC CAPITAL LETTER IO
-\defineactivetoken 162 {\cyrillicDJE} % 0402 CYRILLIC CAPITAL LETTER DJE
-\defineactivetoken 163 {\cyrillicGJE} % 0403 CYRILLIC CAPITAL LETTER GJE
-\defineactivetoken 164 {\cyrillicIE} % 0404 CYRILLIC CAPITAL LETTER UKRAINIAN IE
-\defineactivetoken 165 {\cyrillicDZE} % 0405 CYRILLIC CAPITAL LETTER DZE
-\defineactivetoken 166 {\cyrillicII} % 0406 CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
-\defineactivetoken 167 {\cyrillicYI} % 0407 CYRILLIC CAPITAL LETTER YI
-\defineactivetoken 168 {\cyrillicJE} % 0408 CYRILLIC CAPITAL LETTER JE
-\defineactivetoken 169 {\cyrillicLJE} % 0409 CYRILLIC CAPITAL LETTER LJE
-\defineactivetoken 170 {\cyrillicNJE} % 040A CYRILLIC CAPITAL LETTER NJE
-\defineactivetoken 171 {\cyrillicTSHE} % 040B CYRILLIC CAPITAL LETTER TSHE
-\defineactivetoken 172 {\cyrillicKJE} % 040C CYRILLIC CAPITAL LETTER KJE
-\defineactivetoken 173 {\softhyphen} % 00AD SOFT HYPHEN
-\defineactivetoken 174 {\cyrillicUSHRT} % 040E CYRILLIC CAPITAL LETTER SHORT U
-\defineactivetoken 175 {\cyrillicDZHE} % 040F CYRILLIC CAPITAL LETTER DZHE
-\defineactivetoken 176 {\cyrillicA} % 0410 CYRILLIC CAPITAL LETTER A
-\defineactivetoken 177 {\cyrillicB} % 0411 CYRILLIC CAPITAL LETTER BE
-\defineactivetoken 178 {\cyrillicV} % 0412 CYRILLIC CAPITAL LETTER VE
-\defineactivetoken 179 {\cyrillicG} % 0413 CYRILLIC CAPITAL LETTER GHE
-\defineactivetoken 180 {\cyrillicD} % 0414 CYRILLIC CAPITAL LETTER DE
-\defineactivetoken 181 {\cyrillicE} % 0415 CYRILLIC CAPITAL LETTER IE
-\defineactivetoken 182 {\cyrillicZH} % 0416 CYRILLIC CAPITAL LETTER ZHE
-\defineactivetoken 183 {\cyrillicZ} % 0417 CYRILLIC CAPITAL LETTER ZE
-\defineactivetoken 184 {\cyrillicI} % 0418 CYRILLIC CAPITAL LETTER I
-\defineactivetoken 185 {\cyrillicISHRT} % 0419 CYRILLIC CAPITAL LETTER SHORT I
-\defineactivetoken 186 {\cyrillicK} % 041A CYRILLIC CAPITAL LETTER KA
-\defineactivetoken 187 {\cyrillicL} % 041B CYRILLIC CAPITAL LETTER EL
-\defineactivetoken 188 {\cyrillicM} % 041C CYRILLIC CAPITAL LETTER EM
-\defineactivetoken 189 {\cyrillicN} % 041D CYRILLIC CAPITAL LETTER EN
-\defineactivetoken 190 {\cyrillicO} % 041E CYRILLIC CAPITAL LETTER O
-\defineactivetoken 191 {\cyrillicP} % 041F CYRILLIC CAPITAL LETTER PE
-\defineactivetoken 192 {\cyrillicR} % 0420 CYRILLIC CAPITAL LETTER ER
-\defineactivetoken 193 {\cyrillicS} % 0421 CYRILLIC CAPITAL LETTER ES
-\defineactivetoken 194 {\cyrillicT} % 0422 CYRILLIC CAPITAL LETTER TE
-\defineactivetoken 195 {\cyrillicU} % 0423 CYRILLIC CAPITAL LETTER U
-\defineactivetoken 196 {\cyrillicF} % 0424 CYRILLIC CAPITAL LETTER EF
-\defineactivetoken 197 {\cyrillicH} % 0425 CYRILLIC CAPITAL LETTER HA
-\defineactivetoken 198 {\cyrillicC} % 0426 CYRILLIC CAPITAL LETTER TSE
-\defineactivetoken 199 {\cyrillicCH} % 0427 CYRILLIC CAPITAL LETTER CHE
-\defineactivetoken 200 {\cyrillicSH} % 0428 CYRILLIC CAPITAL LETTER SHA
-\defineactivetoken 201 {\cyrillicSHCH} % 0429 CYRILLIC CAPITAL LETTER SHCHA
-\defineactivetoken 202 {\cyrillicHRDSN} % 042A CYRILLIC CAPITAL LETTER HARD SIGN
-\defineactivetoken 203 {\cyrillicERY} % 042B CYRILLIC CAPITAL LETTER YERU
-\defineactivetoken 204 {\cyrillicSFTSN} % 042C CYRILLIC CAPITAL LETTER SOFT SIGN
-\defineactivetoken 205 {\cyrillicEREV} % 042D CYRILLIC CAPITAL LETTER E
-\defineactivetoken 206 {\cyrillicYU} % 042E CYRILLIC CAPITAL LETTER YU
-\defineactivetoken 207 {\cyrillicYA} % 042F CYRILLIC CAPITAL LETTER YA
-\defineactivetoken 208 {\cyrillica} % 0430 CYRILLIC SMALL LETTER A
-\defineactivetoken 209 {\cyrillicb} % 0431 CYRILLIC SMALL LETTER BE
-\defineactivetoken 210 {\cyrillicv} % 0432 CYRILLIC SMALL LETTER VE
-\defineactivetoken 211 {\cyrillicg} % 0433 CYRILLIC SMALL LETTER GHE
-\defineactivetoken 212 {\cyrillicd} % 0434 CYRILLIC SMALL LETTER DE
-\defineactivetoken 213 {\cyrillice} % 0435 CYRILLIC SMALL LETTER IE
-\defineactivetoken 214 {\cyrilliczh} % 0436 CYRILLIC SMALL LETTER ZHE
-\defineactivetoken 215 {\cyrillicz} % 0437 CYRILLIC SMALL LETTER ZE
-\defineactivetoken 216 {\cyrillici} % 0438 CYRILLIC SMALL LETTER I
-\defineactivetoken 217 {\cyrillicishrt} % 0439 CYRILLIC SMALL LETTER SHORT I
-\defineactivetoken 218 {\cyrillick} % 043A CYRILLIC SMALL LETTER KA
-\defineactivetoken 219 {\cyrillicl} % 043B CYRILLIC SMALL LETTER EL
-\defineactivetoken 220 {\cyrillicm} % 043C CYRILLIC SMALL LETTER EM
-\defineactivetoken 221 {\cyrillicn} % 043D CYRILLIC SMALL LETTER EN
-\defineactivetoken 222 {\cyrillico} % 043E CYRILLIC SMALL LETTER O
-\defineactivetoken 223 {\cyrillicp} % 043F CYRILLIC SMALL LETTER PE
-\defineactivetoken 224 {\cyrillicr} % 0440 CYRILLIC SMALL LETTER ER
-\defineactivetoken 225 {\cyrillics} % 0441 CYRILLIC SMALL LETTER ES
-\defineactivetoken 226 {\cyrillict} % 0442 CYRILLIC SMALL LETTER TE
-\defineactivetoken 227 {\cyrillicu} % 0443 CYRILLIC SMALL LETTER U
-\defineactivetoken 228 {\cyrillicf} % 0444 CYRILLIC SMALL LETTER EF
-\defineactivetoken 229 {\cyrillich} % 0445 CYRILLIC SMALL LETTER HA
-\defineactivetoken 230 {\cyrillicc} % 0446 CYRILLIC SMALL LETTER TSE
-\defineactivetoken 231 {\cyrillicch} % 0447 CYRILLIC SMALL LETTER CHE
-\defineactivetoken 232 {\cyrillicsh} % 0448 CYRILLIC SMALL LETTER SHA
-\defineactivetoken 233 {\cyrillicshch} % 0449 CYRILLIC SMALL LETTER SHCHA
-\defineactivetoken 234 {\cyrillichrdsn} % 044A CYRILLIC SMALL LETTER HARD SIGN
-\defineactivetoken 235 {\cyrillicery} % 044B CYRILLIC SMALL LETTER YERU
-\defineactivetoken 236 {\cyrillicsftsn} % 044C CYRILLIC SMALL LETTER SOFT SIGN
-\defineactivetoken 237 {\cyrillicerev} % 044D CYRILLIC SMALL LETTER E
-\defineactivetoken 238 {\cyrillicyu} % 044E CYRILLIC SMALL LETTER YU
-\defineactivetoken 239 {\cyrillicya} % 044F CYRILLIC SMALL LETTER YA
-\defineactivetoken 240 {\textnumero} % 2116 NUMERO SIGN
-\defineactivetoken 241 {\cyrillicyo} % 0451 CYRILLIC SMALL LETTER IO
-\defineactivetoken 242 {\cyrillicdje} % 0452 CYRILLIC SMALL LETTER DJE
-\defineactivetoken 243 {\cyrillicgje} % 0453 CYRILLIC SMALL LETTER GJE
-\defineactivetoken 244 {\cyrillicie} % 0454 CYRILLIC SMALL LETTER UKRAINIAN IE
-\defineactivetoken 245 {\cyrillicdze} % 0455 CYRILLIC SMALL LETTER DZE
-\defineactivetoken 246 {\cyrillicii} % 0456 CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
-\defineactivetoken 247 {\cyrillicyi} % 0457 CYRILLIC SMALL LETTER YI
-\defineactivetoken 248 {\cyrillicje} % 0458 CYRILLIC SMALL LETTER JE
-\defineactivetoken 249 {\cyrilliclje} % 0459 CYRILLIC SMALL LETTER LJE
-\defineactivetoken 250 {\cyrillicnje} % 045A CYRILLIC SMALL LETTER NJE
-\defineactivetoken 251 {\cyrillictshe} % 045B CYRILLIC SMALL LETTER TSHE
-\defineactivetoken 252 {\cyrillickje} % 045C CYRILLIC SMALL LETTER KJE
-\defineactivetoken 253 {\sectionmark} % 00A7 SECTION SIGN
-\defineactivetoken 254 {\cyrillicushrt} % 045E CYRILLIC SMALL LETTER SHORT U
-\defineactivetoken 255 {\cyrillicdzhe} % 045F CYRILLIC SMALL LETTER DZHE
-
-\stopregime
-
diff --git a/Master/texmf-dist/tex/context/base/mkii/regi-8859-7.mkii b/Master/texmf-dist/tex/context/base/mkii/regi-8859-7.mkii
deleted file mode 100644
index 1c8197a4270..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/regi-8859-7.mkii
+++ /dev/null
@@ -1,153 +0,0 @@
-%D \module
-%D [ file=regi-8859-7,
-%D version=2005.12.26,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=iso-8859-7 (Greek),
-%D author=script-generated,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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: \type{\enableregime[8859-7]} (see \type {regi-syn} for
-%D alternatives calls).
-
-\startregime[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 {\unknownchar} % 20AF DRACHMA SIGN (TODO)
-\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} % 037A GREEK YPOGEGRAMMENI (TODO)
-\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/mkii/regi-8859-9.mkii b/Master/texmf-dist/tex/context/base/mkii/regi-8859-9.mkii
deleted file mode 100644
index 60757b2e684..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/regi-8859-9.mkii
+++ /dev/null
@@ -1,152 +0,0 @@
-%D \module
-%D [ file=regi-8859-9,
-%D version=2005.12.26,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=iso-8859-9 (Turkish),
-%D author=script-generated,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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-9/Latin5 input encoding (regime) for Turkish,
-%D see also cp1254.
-%D
-%D Usage: \type{\enableregime[8859-9]} (see \type {regi-syn} for
-%D alternatives calls).
-
-\startregime[8859-9]
-
-\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 {\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/mkii/regi-cp1250.mkii b/Master/texmf-dist/tex/context/base/mkii/regi-cp1250.mkii
deleted file mode 100644
index c13ee53e2c1..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/regi-cp1250.mkii
+++ /dev/null
@@ -1,153 +0,0 @@
-%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 \& \CONTEXT\ Development Team}]
-%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/mkii/regi-cp1251.mkii b/Master/texmf-dist/tex/context/base/mkii/regi-cp1251.mkii
deleted file mode 100644
index 66576bd16be..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/regi-cp1251.mkii
+++ /dev/null
@@ -1,152 +0,0 @@
-%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 \& \CONTEXT\ Development Team}]
-%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/mkii/regi-cp1252.mkii b/Master/texmf-dist/tex/context/base/mkii/regi-cp1252.mkii
deleted file mode 100644
index 316d694a67e..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/regi-cp1252.mkii
+++ /dev/null
@@ -1,156 +0,0 @@
-%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 \& \CONTEXT\ Development Team}]
-%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/mkii/regi-cp1253.mkii b/Master/texmf-dist/tex/context/base/mkii/regi-cp1253.mkii
deleted file mode 100644
index 05d53c1298e..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/regi-cp1253.mkii
+++ /dev/null
@@ -1,153 +0,0 @@
-%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 \& \CONTEXT\ Development Team}]
-%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/mkii/regi-cp1254.mkii b/Master/texmf-dist/tex/context/base/mkii/regi-cp1254.mkii
deleted file mode 100644
index 73f8f270820..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/regi-cp1254.mkii
+++ /dev/null
@@ -1,153 +0,0 @@
-%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 \& \CONTEXT\ Development Team}]
-%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/mkii/regi-cp1257.mkii b/Master/texmf-dist/tex/context/base/mkii/regi-cp1257.mkii
deleted file mode 100644
index 4c9cb56f059..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/regi-cp1257.mkii
+++ /dev/null
@@ -1,153 +0,0 @@
-%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 \& \CONTEXT\ Development Team}]
-%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/mkii/regi-cyp.mkii b/Master/texmf-dist/tex/context/base/mkii/regi-cyp.mkii
deleted file mode 100644
index 3f45ace2307..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/regi-cyp.mkii
+++ /dev/null
@@ -1,1169 +0,0 @@
-%D \module
-%D [ file=regi-cyp,
-%D version=2003.01.24,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=Cyrillic Plus,
-%D author=...,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-%D In this file several rarely user cyrillic input regimes
-%D are defined.
-
-\startregime[cp855]
-
-\defineactivetoken 128 {\cyrillicdje}
-\defineactivetoken 129 {\cyrillicDJE}
-\defineactivetoken 130 {\'\cyrillicg}
-\defineactivetoken 131 {\'\cyrillicG}
-\defineactivetoken 132 {\cyrillicyo}
-\defineactivetoken 133 {\cyrillicYO}
-\defineactivetoken 134 {\cyrillicie}
-\defineactivetoken 135 {\cyrillicIE}
-\defineactivetoken 136 {\cyrillicdze}
-\defineactivetoken 137 {\cyrillicDZE}
-\defineactivetoken 138 {\cyrillicii}
-\defineactivetoken 139 {\cyrillicII}
-\defineactivetoken 140 {\cyrillicyi}
-\defineactivetoken 141 {\cyrillicYI}
-\defineactivetoken 142 {\cyrillicje}
-\defineactivetoken 143 {\cyrillicJE}
-\defineactivetoken 144 {\cyrilliclje}
-\defineactivetoken 145 {\cyrillicLJE}
-\defineactivetoken 146 {\cyrillicnje}
-\defineactivetoken 147 {\cyrillicNJE}
-\defineactivetoken 148 {\cyrillictshe}
-\defineactivetoken 149 {\cyrillicTSHE}
-\defineactivetoken 150 {\'\cyrillick}
-\defineactivetoken 151 {\'\cyrillicK}
-\defineactivetoken 152 {\cyrillicushrt}
-\defineactivetoken 153 {\cyrillicUSHRT}
-\defineactivetoken 154 {\cyrillicdzhe}
-\defineactivetoken 155 {\cyrillicDZHE}
-\defineactivetoken 156 {\cyrillicyu}
-\defineactivetoken 157 {\cyrillicYU}
-\defineactivetoken 158 {\cyrillichrdsn}
-\defineactivetoken 159 {\cyrillicHRDSN}
-\defineactivetoken 160 {\cyrillica}
-\defineactivetoken 161 {\cyrillicA}
-\defineactivetoken 162 {\cyrillicb}
-\defineactivetoken 163 {\cyrillicB}
-\defineactivetoken 164 {\cyrillicc}
-\defineactivetoken 165 {\cyrillicC}
-\defineactivetoken 166 {\cyrillicd}
-\defineactivetoken 167 {\cyrillicD}
-\defineactivetoken 168 {\cyrillice}
-\defineactivetoken 169 {\cyrillicE}
-\defineactivetoken 170 {\cyrillicf}
-\defineactivetoken 171 {\cyrillicF}
-\defineactivetoken 172 {\cyrillicg}
-\defineactivetoken 173 {\cyrillicG}
-\defineactivetoken 174 {\leftguillemot}
-\defineactivetoken 175 {\rightguillemot}
-\defineactivetoken 181 {\cyrillich}
-\defineactivetoken 182 {\cyrillicH}
-\defineactivetoken 183 {\cyrillici}
-\defineactivetoken 184 {\cyrillicI}
-\defineactivetoken 189 {\cyrillicishrt}
-\defineactivetoken 190 {\cyrillicISHRT}
-\defineactivetoken 198 {\cyrillick}
-\defineactivetoken 199 {\cyrillicK}
-\defineactivetoken 207 {\textcurrency}
-\defineactivetoken 208 {\cyrillicl}
-\defineactivetoken 209 {\cyrillicL}
-\defineactivetoken 210 {\cyrillicm}
-\defineactivetoken 211 {\cyrillicM}
-\defineactivetoken 212 {\cyrillicn}
-\defineactivetoken 213 {\cyrillicN}
-\defineactivetoken 214 {\cyrillico}
-\defineactivetoken 215 {\cyrillicO}
-\defineactivetoken 216 {\cyrillicp}
-\defineactivetoken 221 {\cyrillicP}
-\defineactivetoken 222 {\cyrillicya}
-\defineactivetoken 224 {\cyrillicYA}
-\defineactivetoken 225 {\cyrillicr}
-\defineactivetoken 226 {\cyrillicR}
-\defineactivetoken 227 {\cyrillics}
-\defineactivetoken 228 {\cyrillicS}
-\defineactivetoken 229 {\cyrillict}
-\defineactivetoken 230 {\cyrillicT}
-\defineactivetoken 231 {\cyrillicu}
-\defineactivetoken 232 {\cyrillicU}
-\defineactivetoken 233 {\cyrilliczh}
-\defineactivetoken 234 {\cyrillicZH}
-\defineactivetoken 235 {\cyrillicv}
-\defineactivetoken 236 {\cyrillicV}
-\defineactivetoken 237 {\cyrillicsftsn}
-\defineactivetoken 238 {\cyrillicSFTSN}
-\defineactivetoken 239 {\textnumero}
-\defineactivetoken 240 {\-}
-\defineactivetoken 241 {\cyrillicery}
-\defineactivetoken 242 {\cyrillicERY}
-\defineactivetoken 243 {\cyrillicz}
-\defineactivetoken 244 {\cyrillicZ}
-\defineactivetoken 245 {\cyrillicsh}
-\defineactivetoken 246 {\cyrillicSH}
-\defineactivetoken 247 {\cyrillicerev}
-\defineactivetoken 248 {\cyrillicEREV}
-\defineactivetoken 249 {\cyrillicshch}
-\defineactivetoken 250 {\cyrillicSHCH}
-\defineactivetoken 251 {\cyrillicch}
-\defineactivetoken 252 {\cyrillicCH}
-\defineactivetoken 253 {\sectionmark}
-\defineactivetoken 254 {\textblacksquare}
-\defineactivetoken 255 {\nonbreakablespace}
-
-\stopregime
-
-\startregime[cp866av]
-
-\defineactivetoken 128 {\cyrillicA}
-\defineactivetoken 129 {\cyrillicB}
-\defineactivetoken 130 {\cyrillicV}
-\defineactivetoken 131 {\cyrillicG}
-\defineactivetoken 132 {\cyrillicD}
-\defineactivetoken 133 {\cyrillicE}
-\defineactivetoken 134 {\cyrillicZH}
-\defineactivetoken 135 {\cyrillicZ}
-\defineactivetoken 136 {\cyrillicI}
-\defineactivetoken 137 {\cyrillicISHRT}
-\defineactivetoken 138 {\cyrillicK}
-\defineactivetoken 139 {\cyrillicL}
-\defineactivetoken 140 {\cyrillicM}
-\defineactivetoken 141 {\cyrillicN}
-\defineactivetoken 142 {\cyrillicO}
-\defineactivetoken 143 {\cyrillicP}
-\defineactivetoken 144 {\cyrillicR}
-\defineactivetoken 145 {\cyrillicS}
-\defineactivetoken 146 {\cyrillicT}
-\defineactivetoken 147 {\cyrillicU}
-\defineactivetoken 148 {\cyrillicF}
-\defineactivetoken 149 {\cyrillicH}
-\defineactivetoken 150 {\cyrillicC}
-\defineactivetoken 151 {\cyrillicCH}
-\defineactivetoken 152 {\cyrillicSH}
-\defineactivetoken 153 {\cyrillicSHCH}
-\defineactivetoken 154 {\cyrillicHRDSN}
-\defineactivetoken 155 {\cyrillicERY}
-\defineactivetoken 156 {\cyrillicSFTSN}
-\defineactivetoken 157 {\cyrillicEREV}
-\defineactivetoken 158 {\cyrillicYU}
-\defineactivetoken 159 {\cyrillicYA}
-\defineactivetoken 160 {\cyrillica}
-\defineactivetoken 161 {\cyrillicb}
-\defineactivetoken 162 {\cyrillicv}
-\defineactivetoken 163 {\cyrillicg}
-\defineactivetoken 164 {\cyrillicd}
-\defineactivetoken 165 {\cyrillice}
-\defineactivetoken 166 {\cyrilliczh}
-\defineactivetoken 167 {\cyrillicz}
-\defineactivetoken 168 {\cyrillici}
-\defineactivetoken 169 {\cyrillicishrt}
-\defineactivetoken 170 {\cyrillick}
-\defineactivetoken 171 {\cyrillicl}
-\defineactivetoken 172 {\cyrillicm}
-\defineactivetoken 173 {\cyrillicn}
-\defineactivetoken 174 {\cyrillico}
-\defineactivetoken 175 {\cyrillicp}
-\defineactivetoken 224 {\cyrillicr}
-\defineactivetoken 225 {\cyrillics}
-\defineactivetoken 226 {\cyrillict}
-\defineactivetoken 227 {\cyrillicu}
-\defineactivetoken 228 {\cyrillicf}
-\defineactivetoken 229 {\cyrillich}
-\defineactivetoken 230 {\cyrillicc}
-\defineactivetoken 231 {\cyrillicch}
-\defineactivetoken 232 {\cyrillicsh}
-\defineactivetoken 233 {\cyrillicshch}
-\defineactivetoken 234 {\cyrillichrdsn}
-\defineactivetoken 235 {\cyrillicery}
-\defineactivetoken 236 {\cyrillicsftsn}
-\defineactivetoken 237 {\cyrillicerev}
-\defineactivetoken 238 {\cyrillicyu}
-\defineactivetoken 239 {\cyrillicya}
-\defineactivetoken 240 {\cyrillicYO}
-\defineactivetoken 241 {\cyrillicyo}
-\defineactivetoken 252 {\textnumero}
-\defineactivetoken 253 {\textcurrency}
-\defineactivetoken 254 {\textblacksquare}
-\defineactivetoken 255 {\nonbreakablespace}
-\defineactivetoken 246 {\mathematics\rightarrow}
-\defineactivetoken 247 {\mathematics\leftarrow}
-\defineactivetoken 248 {\mathematics\downarrow}
-\defineactivetoken 249 {\mathematics\uparrow}
-\defineactivetoken 250 {\textdiv}
-\defineactivetoken 251 {\textpm}
-
-\stopregime
-
-\startregime[cp866mav]
-
-\defineactivetoken 128 {\cyrillicA}
-\defineactivetoken 129 {\cyrillicB}
-\defineactivetoken 130 {\cyrillicV}
-\defineactivetoken 131 {\cyrillicG}
-\defineactivetoken 132 {\cyrillicD}
-\defineactivetoken 133 {\cyrillicE}
-\defineactivetoken 134 {\cyrillicZH}
-\defineactivetoken 135 {\cyrillicZ}
-\defineactivetoken 136 {\cyrillicI}
-\defineactivetoken 137 {\cyrillicISHRT}
-\defineactivetoken 138 {\cyrillicK}
-\defineactivetoken 139 {\cyrillicL}
-\defineactivetoken 140 {\cyrillicM}
-\defineactivetoken 141 {\cyrillicN}
-\defineactivetoken 142 {\cyrillicO}
-\defineactivetoken 143 {\cyrillicP}
-\defineactivetoken 144 {\cyrillicR}
-\defineactivetoken 145 {\cyrillicS}
-\defineactivetoken 146 {\cyrillicT}
-\defineactivetoken 147 {\cyrillicU}
-\defineactivetoken 148 {\cyrillicF}
-\defineactivetoken 149 {\cyrillicH}
-\defineactivetoken 150 {\cyrillicC}
-\defineactivetoken 151 {\cyrillicCH}
-\defineactivetoken 152 {\cyrillicSH}
-\defineactivetoken 153 {\cyrillicSHCH}
-\defineactivetoken 154 {\cyrillicHRDSN}
-\defineactivetoken 155 {\cyrillicERY}
-\defineactivetoken 156 {\cyrillicSFTSN}
-\defineactivetoken 157 {\cyrillicEREV}
-\defineactivetoken 158 {\cyrillicYU}
-\defineactivetoken 159 {\cyrillicYA}
-\defineactivetoken 160 {\cyrillica}
-\defineactivetoken 161 {\cyrillicb}
-\defineactivetoken 162 {\cyrillicv}
-\defineactivetoken 163 {\cyrillicg}
-\defineactivetoken 164 {\cyrillicd}
-\defineactivetoken 165 {\cyrillice}
-\defineactivetoken 166 {\cyrilliczh}
-\defineactivetoken 167 {\cyrillicz}
-\defineactivetoken 168 {\cyrillici}
-\defineactivetoken 169 {\cyrillicishrt}
-\defineactivetoken 170 {\cyrillick}
-\defineactivetoken 171 {\cyrillicl}
-\defineactivetoken 172 {\cyrillicm}
-\defineactivetoken 173 {\cyrillicn}
-\defineactivetoken 174 {\cyrillico}
-\defineactivetoken 175 {\cyrillicp}
-\defineactivetoken 224 {\cyrillicr}
-\defineactivetoken 225 {\cyrillics}
-\defineactivetoken 226 {\cyrillict}
-\defineactivetoken 227 {\cyrillicu}
-\defineactivetoken 228 {\cyrillicf}
-\defineactivetoken 229 {\cyrillich}
-\defineactivetoken 230 {\cyrillicc}
-\defineactivetoken 231 {\cyrillicch}
-\defineactivetoken 232 {\cyrillicsh}
-\defineactivetoken 233 {\cyrillicshch}
-\defineactivetoken 234 {\cyrillichrdsn}
-\defineactivetoken 235 {\cyrillicery}
-\defineactivetoken 236 {\cyrillicsftsn}
-\defineactivetoken 237 {\cyrillicerev}
-\defineactivetoken 238 {\cyrillicyu}
-\defineactivetoken 239 {\cyrillicya}
-\defineactivetoken 240 {\cyrillicYO}
-\defineactivetoken 241 {\cyrillicyo}
-\defineactivetoken 248 {\textdegree}
-\defineactivetoken 249 {\textbullet}
-\defineactivetoken 250 {\periodcentered}
-\defineactivetoken 254 {\textblacksquare}
-\defineactivetoken 255 {\nonbreakablespace}
-\defineactivetoken 242 {\mathematics\geq}
-\defineactivetoken 243 {\mathematics\leq}
-\defineactivetoken 246 {\textdiv}
-\defineactivetoken 247 {\mathematics\sim}
-\defineactivetoken 251 {\textsurd}
-\defineactivetoken 252 {\high{\txx n}}
-\defineactivetoken 253 {\twosuperior}
-
-\stopregime
-
-\startregime[cp866tat]
-
-\defineactivetoken 128 {\cyrillicA}
-\defineactivetoken 129 {\cyrillicB}
-\defineactivetoken 130 {\cyrillicV}
-\defineactivetoken 131 {\cyrillicG}
-\defineactivetoken 132 {\cyrillicD}
-\defineactivetoken 133 {\cyrillicE}
-\defineactivetoken 134 {\cyrillicZH}
-\defineactivetoken 135 {\cyrillicZ}
-\defineactivetoken 136 {\cyrillicI}
-\defineactivetoken 137 {\cyrillicISHRT}
-\defineactivetoken 138 {\cyrillicK}
-\defineactivetoken 139 {\cyrillicL}
-\defineactivetoken 140 {\cyrillicM}
-\defineactivetoken 141 {\cyrillicN}
-\defineactivetoken 142 {\cyrillicO}
-\defineactivetoken 143 {\cyrillicP}
-\defineactivetoken 144 {\cyrillicR}
-\defineactivetoken 145 {\cyrillicS}
-\defineactivetoken 146 {\cyrillicT}
-\defineactivetoken 147 {\cyrillicU}
-\defineactivetoken 148 {\cyrillicF}
-\defineactivetoken 149 {\cyrillicH}
-\defineactivetoken 150 {\cyrillicC}
-\defineactivetoken 151 {\cyrillicCH}
-\defineactivetoken 152 {\cyrillicSH}
-\defineactivetoken 153 {\cyrillicSHCH}
-\defineactivetoken 154 {\cyrillicHRDSN}
-\defineactivetoken 155 {\cyrillicERY}
-\defineactivetoken 156 {\cyrillicSFTSN}
-\defineactivetoken 157 {\cyrillicEREV}
-\defineactivetoken 158 {\cyrillicYU}
-\defineactivetoken 159 {\cyrillicYA}
-\defineactivetoken 160 {\cyrillica}
-\defineactivetoken 161 {\cyrillicb}
-\defineactivetoken 162 {\cyrillicv}
-\defineactivetoken 163 {\cyrillicg}
-\defineactivetoken 164 {\cyrillicd}
-\defineactivetoken 165 {\cyrillice}
-\defineactivetoken 166 {\cyrilliczh}
-\defineactivetoken 167 {\cyrillicz}
-\defineactivetoken 168 {\cyrillici}
-\defineactivetoken 169 {\cyrillicishrt}
-\defineactivetoken 170 {\cyrillick}
-\defineactivetoken 171 {\cyrillicl}
-\defineactivetoken 172 {\cyrillicm}
-\defineactivetoken 173 {\cyrillicn}
-\defineactivetoken 174 {\cyrillico}
-\defineactivetoken 175 {\cyrillicp}
-\defineactivetoken 224 {\cyrillicr}
-\defineactivetoken 225 {\cyrillics}
-\defineactivetoken 226 {\cyrillict}
-\defineactivetoken 227 {\cyrillicu}
-\defineactivetoken 228 {\cyrillicf}
-\defineactivetoken 229 {\cyrillich}
-\defineactivetoken 230 {\cyrillicc}
-\defineactivetoken 231 {\cyrillicch}
-\defineactivetoken 232 {\cyrillicsh}
-\defineactivetoken 233 {\cyrillicshch}
-\defineactivetoken 234 {\cyrillichrdsn}
-\defineactivetoken 235 {\cyrillicery}
-\defineactivetoken 236 {\cyrillicsftsn}
-\defineactivetoken 237 {\cyrillicerev}
-\defineactivetoken 238 {\cyrillicyu}
-\defineactivetoken 239 {\cyrillicya}
-\defineactivetoken 240 {\cyrillicYO}
-\defineactivetoken 241 {\cyrillicyo}
-\defineactivetoken 242 {\cyrillicSCHWA}
-\defineactivetoken 243 {\cyrillicschwa}
-\defineactivetoken 244 {\cyrillicOTLD}
-\defineactivetoken 245 {\cyrillicotld}
-\defineactivetoken 246 {\cyrillicY}
-\defineactivetoken 247 {\cyrillicy}
-\defineactivetoken 248 {\cyrillicZHDSC}
-\defineactivetoken 249 {\cyrilliczhdsc}
-\defineactivetoken 250 {\cyrillicNDSC}
-\defineactivetoken 251 {\cyrillicndsc}
-\defineactivetoken 252 {\cyrillicSHHA}
-\defineactivetoken 253 {\cyrillicshha}
-\defineactivetoken 254 {\textblacksquare}
-\defineactivetoken 255 {\nonbreakablespace}
-
-\stopregime
-
-\startregime[ctt]
-
-\defineactivetoken 171 {\leftguillemot}
-\defineactivetoken 187 {\rightguillemot}
-\defineactivetoken 192 {\cyrillicA}
-\defineactivetoken 193 {\cyrillicB}
-\defineactivetoken 194 {\cyrillicV}
-\defineactivetoken 195 {\cyrillicG}
-\defineactivetoken 196 {\cyrillicD}
-\defineactivetoken 197 {\cyrillicE}
-\defineactivetoken 168 {\cyrillicYO}
-\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 170 {\cyrillicOTLD}
-\defineactivetoken 207 {\cyrillicP}
-\defineactivetoken 208 {\cyrillicR}
-\defineactivetoken 209 {\cyrillicS}
-\defineactivetoken 210 {\cyrillicT}
-\defineactivetoken 211 {\cyrillicU}
-\defineactivetoken 175 {\cyrillicY}
-\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 184 {\cyrillicyo}
-\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 186 {\cyrillicotld}
-\defineactivetoken 239 {\cyrillicp}
-\defineactivetoken 240 {\cyrillicr}
-\defineactivetoken 241 {\cyrillics}
-\defineactivetoken 242 {\cyrillict}
-\defineactivetoken 243 {\cyrillicu}
-\defineactivetoken 191 {\cyrillicy}
-\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}
-
-\stopregime
-
-\startregime[dbk]
-
-\defineactivetoken 128 {\cyrillicA}
-\defineactivetoken 129 {\cyrillicB}
-\defineactivetoken 130 {\cyrillicV}
-\defineactivetoken 131 {\cyrillicG}
-\defineactivetoken 132 {\cyrillicD}
-\defineactivetoken 133 {\cyrillicE}
-\defineactivetoken 134 {\cyrillicYO}
-\defineactivetoken 135 {\cyrillicZH}
-\defineactivetoken 136 {\cyrillicZ}
-\defineactivetoken 137 {\cyrillicI}
-\defineactivetoken 139 {\cyrillicISHRT}
-\defineactivetoken 140 {\cyrillicK}
-\defineactivetoken 142 {\cyrillicL}
-\defineactivetoken 143 {\cyrillicM}
-\defineactivetoken 144 {\cyrillicN}
-\defineactivetoken 145 {\cyrillicO}
-\defineactivetoken 146 {\cyrillicOTLD}
-\defineactivetoken 147 {\cyrillicP}
-\defineactivetoken 148 {\cyrillicR}
-\defineactivetoken 149 {\cyrillicS}
-\defineactivetoken 150 {\cyrillicT}
-\defineactivetoken 151 {\cyrillicU}
-\defineactivetoken 152 {\cyrillicY}
-\defineactivetoken 153 {\cyrillicF}
-\defineactivetoken 154 {\cyrillicH}
-\defineactivetoken 155 {\cyrillicC}
-\defineactivetoken 156 {\cyrillicCH}
-\defineactivetoken 157 {\cyrillicSH}
-\defineactivetoken 158 {\cyrillicSHCH}
-\defineactivetoken 159 {\cyrillicHRDSN}
-\defineactivetoken 160 {\cyrillicERY}
-\defineactivetoken 161 {\cyrillicSFTSN}
-\defineactivetoken 162 {\cyrillicEREV}
-\defineactivetoken 163 {\cyrillicYU}
-\defineactivetoken 164 {\cyrillicYA}
-\defineactivetoken 165 {\cyrillica}
-\defineactivetoken 166 {\cyrillicb}
-\defineactivetoken 167 {\cyrillicv}
-\defineactivetoken 168 {\cyrillicg}
-\defineactivetoken 169 {\cyrillicd}
-\defineactivetoken 170 {\cyrillice}
-\defineactivetoken 171 {\cyrillicyo}
-\defineactivetoken 172 {\cyrilliczh}
-\defineactivetoken 173 {\cyrillicz}
-\defineactivetoken 174 {\cyrillici}
-\defineactivetoken 175 {\cyrillicishrt}
-\defineactivetoken 225 {\cyrillick}
-\defineactivetoken 226 {\cyrillicl}
-\defineactivetoken 227 {\cyrillicm}
-\defineactivetoken 228 {\cyrillicn}
-\defineactivetoken 229 {\cyrillico}
-\defineactivetoken 230 {\cyrillicotld}
-\defineactivetoken 231 {\cyrillicp}
-\defineactivetoken 232 {\cyrillicr}
-\defineactivetoken 233 {\cyrillics}
-\defineactivetoken 234 {\cyrillict}
-\defineactivetoken 235 {\cyrillicu}
-\defineactivetoken 236 {\cyrillicy}
-\defineactivetoken 237 {\cyrillicf}
-\defineactivetoken 238 {\cyrillich}
-\defineactivetoken 239 {\cyrillicc}
-\defineactivetoken 241 {\cyrillicch}
-\defineactivetoken 242 {\cyrillicsh}
-\defineactivetoken 243 {\cyrillicshch}
-\defineactivetoken 244 {\cyrillichrdsn}
-\defineactivetoken 245 {\cyrillicery}
-\defineactivetoken 246 {\cyrillicsftsn}
-\defineactivetoken 247 {\cyrillicerev}
-\defineactivetoken 248 {\cyrillicyu}
-\defineactivetoken 249 {\cyrillicya}
-
-\stopregime
-
-\startregime[iso88595]
-
-\defineactivetoken 160 {\nonbreakablespace}
-\defineactivetoken 161 {\cyrillicYO}
-\defineactivetoken 162 {\cyrillicDJE}
-\defineactivetoken 163 {\'\cyrillicG}
-\defineactivetoken 164 {\cyrillicIE}
-\defineactivetoken 165 {\cyrillicDZE}
-\defineactivetoken 166 {\cyrillicII}
-\defineactivetoken 167 {\cyrillicYI}
-\defineactivetoken 168 {\cyrillicJE}
-\defineactivetoken 169 {\cyrillicLJE}
-\defineactivetoken 170 {\cyrillicNJE}
-\defineactivetoken 171 {\cyrillicTSHE}
-\defineactivetoken 172 {\'\cyrillicK}
-\defineactivetoken 173 {\-}
-\defineactivetoken 174 {\cyrillicUSHRT}
-\defineactivetoken 175 {\cyrillicDZHE}
-\defineactivetoken 176 {\cyrillicA}
-\defineactivetoken 177 {\cyrillicB}
-\defineactivetoken 178 {\cyrillicV}
-\defineactivetoken 179 {\cyrillicG}
-\defineactivetoken 180 {\cyrillicD}
-\defineactivetoken 181 {\cyrillicE}
-\defineactivetoken 182 {\cyrillicZH}
-\defineactivetoken 183 {\cyrillicZ}
-\defineactivetoken 184 {\cyrillicI}
-\defineactivetoken 185 {\cyrillicISHRT}
-\defineactivetoken 186 {\cyrillicK}
-\defineactivetoken 187 {\cyrillicL}
-\defineactivetoken 188 {\cyrillicM}
-\defineactivetoken 189 {\cyrillicN}
-\defineactivetoken 190 {\cyrillicO}
-\defineactivetoken 191 {\cyrillicP}
-\defineactivetoken 192 {\cyrillicR}
-\defineactivetoken 193 {\cyrillicS}
-\defineactivetoken 194 {\cyrillicT}
-\defineactivetoken 195 {\cyrillicU}
-\defineactivetoken 196 {\cyrillicF}
-\defineactivetoken 197 {\cyrillicH}
-\defineactivetoken 198 {\cyrillicC}
-\defineactivetoken 199 {\cyrillicCH}
-\defineactivetoken 200 {\cyrillicSH}
-\defineactivetoken 201 {\cyrillicSHCH}
-\defineactivetoken 202 {\cyrillicHRDSN}
-\defineactivetoken 203 {\cyrillicERY}
-\defineactivetoken 204 {\cyrillicSFTSN}
-\defineactivetoken 205 {\cyrillicEREV}
-\defineactivetoken 206 {\cyrillicYU}
-\defineactivetoken 207 {\cyrillicYA}
-\defineactivetoken 208 {\cyrillica}
-\defineactivetoken 209 {\cyrillicb}
-\defineactivetoken 210 {\cyrillicv}
-\defineactivetoken 211 {\cyrillicg}
-\defineactivetoken 212 {\cyrillicd}
-\defineactivetoken 213 {\cyrillice}
-\defineactivetoken 214 {\cyrilliczh}
-\defineactivetoken 215 {\cyrillicz}
-\defineactivetoken 216 {\cyrillici}
-\defineactivetoken 217 {\cyrillicishrt}
-\defineactivetoken 218 {\cyrillick}
-\defineactivetoken 219 {\cyrillicl}
-\defineactivetoken 220 {\cyrillicm}
-\defineactivetoken 221 {\cyrillicn}
-\defineactivetoken 222 {\cyrillico}
-\defineactivetoken 223 {\cyrillicp}
-\defineactivetoken 224 {\cyrillicr}
-\defineactivetoken 225 {\cyrillics}
-\defineactivetoken 226 {\cyrillict}
-\defineactivetoken 227 {\cyrillicu}
-\defineactivetoken 228 {\cyrillicf}
-\defineactivetoken 229 {\cyrillich}
-\defineactivetoken 230 {\cyrillicc}
-\defineactivetoken 231 {\cyrillicch}
-\defineactivetoken 232 {\cyrillicsh}
-\defineactivetoken 233 {\cyrillicshch}
-\defineactivetoken 234 {\cyrillichrdsn}
-\defineactivetoken 235 {\cyrillicery}
-\defineactivetoken 236 {\cyrillicsftsn}
-\defineactivetoken 237 {\cyrillicerev}
-\defineactivetoken 238 {\cyrillicyu}
-\defineactivetoken 239 {\cyrillicya}
-\defineactivetoken 240 {\textnumero}
-\defineactivetoken 241 {\cyrillicyo}
-\defineactivetoken 242 {\cyrillicdje}
-\defineactivetoken 243 {\'\cyrillicg}
-\defineactivetoken 244 {\cyrillicie}
-\defineactivetoken 245 {\cyrillicdze}
-\defineactivetoken 246 {\cyrillicii}
-\defineactivetoken 247 {\cyrillicyi}
-\defineactivetoken 248 {\cyrillicje}
-\defineactivetoken 249 {\cyrilliclje}
-\defineactivetoken 250 {\cyrillicnje}
-\defineactivetoken 251 {\cyrillictshe}
-\defineactivetoken 252 {\'\cyrillick}
-\defineactivetoken 253 {\sectionmark}
-\defineactivetoken 254 {\cyrillicushrt}
-\defineactivetoken 255 {\cyrillicdzhe}
-
-\stopregime
-
-\startregime[isoir111]
-
-\defineactivetoken 225 {\cyrillicA}
-\defineactivetoken 226 {\cyrillicB}
-\defineactivetoken 247 {\cyrillicV}
-\defineactivetoken 231 {\cyrillicG}
-\defineactivetoken 228 {\cyrillicD}
-\defineactivetoken 229 {\cyrillicE}
-\defineactivetoken 179 {\cyrillicYO}
-\defineactivetoken 246 {\cyrillicZH}
-\defineactivetoken 250 {\cyrillicZ}
-\defineactivetoken 233 {\cyrillicI}
-\defineactivetoken 234 {\cyrillicISHRT}
-\defineactivetoken 235 {\cyrillicK}
-\defineactivetoken 236 {\cyrillicL}
-\defineactivetoken 237 {\cyrillicM}
-\defineactivetoken 238 {\cyrillicN}
-\defineactivetoken 239 {\cyrillicO}
-\defineactivetoken 240 {\cyrillicP}
-\defineactivetoken 242 {\cyrillicR}
-\defineactivetoken 243 {\cyrillicS}
-\defineactivetoken 244 {\cyrillicT}
-\defineactivetoken 245 {\cyrillicU}
-\defineactivetoken 230 {\cyrillicF}
-\defineactivetoken 232 {\cyrillicH}
-\defineactivetoken 227 {\cyrillicC}
-\defineactivetoken 254 {\cyrillicCH}
-\defineactivetoken 251 {\cyrillicSH}
-\defineactivetoken 253 {\cyrillicSHCH}
-\defineactivetoken 255 {\cyrillicHRDSN}
-\defineactivetoken 249 {\cyrillicERY}
-\defineactivetoken 248 {\cyrillicSFTSN}
-\defineactivetoken 252 {\cyrillicEREV}
-\defineactivetoken 224 {\cyrillicYU}
-\defineactivetoken 241 {\cyrillicYA}
-\defineactivetoken 193 {\cyrillica}
-\defineactivetoken 194 {\cyrillicb}
-\defineactivetoken 215 {\cyrillicv}
-\defineactivetoken 199 {\cyrillicg}
-\defineactivetoken 196 {\cyrillicd}
-\defineactivetoken 197 {\cyrillice}
-\defineactivetoken 163 {\cyrillicyo}
-\defineactivetoken 214 {\cyrilliczh}
-\defineactivetoken 218 {\cyrillicz}
-\defineactivetoken 201 {\cyrillici}
-\defineactivetoken 202 {\cyrillicishrt}
-\defineactivetoken 203 {\cyrillick}
-\defineactivetoken 204 {\cyrillicl}
-\defineactivetoken 205 {\cyrillicm}
-\defineactivetoken 206 {\cyrillicn}
-\defineactivetoken 207 {\cyrillico}
-\defineactivetoken 208 {\cyrillicp}
-\defineactivetoken 210 {\cyrillicr}
-\defineactivetoken 211 {\cyrillics}
-\defineactivetoken 212 {\cyrillict}
-\defineactivetoken 213 {\cyrillicu}
-\defineactivetoken 198 {\cyrillicf}
-\defineactivetoken 200 {\cyrillich}
-\defineactivetoken 195 {\cyrillicc}
-\defineactivetoken 222 {\cyrillicch}
-\defineactivetoken 219 {\cyrillicsh}
-\defineactivetoken 221 {\cyrillicshch}
-\defineactivetoken 223 {\cyrillichrdsn}
-\defineactivetoken 217 {\cyrillicery}
-\defineactivetoken 216 {\cyrillicsftsn}
-\defineactivetoken 220 {\cyrillicerev}
-\defineactivetoken 192 {\cyrillicyu}
-\defineactivetoken 209 {\cyrillicya}
-\defineactivetoken 160 {\nonbreakablespace}
-\defineactivetoken 161 {\cyrillicdje}
-\defineactivetoken 162 {\'\cyrillicg}
-\defineactivetoken 164 {\cyrillicie}
-\defineactivetoken 165 {\cyrillicdze}
-\defineactivetoken 166 {\cyrillicii}
-\defineactivetoken 167 {\cyrillicyi}
-\defineactivetoken 168 {\cyrillicje}
-\defineactivetoken 169 {\cyrilliclje}
-\defineactivetoken 170 {\cyrillicnje}
-\defineactivetoken 171 {\cyrillictshe}
-\defineactivetoken 172 {\'\cyrillick}
-\defineactivetoken 173 {\-}
-\defineactivetoken 174 {\cyrillicushrt}
-\defineactivetoken 175 {\cyrillicdzhe}
-\defineactivetoken 176 {\textnumero}
-\defineactivetoken 177 {\cyrillicDJE}
-\defineactivetoken 178 {\'\cyrillicG}
-\defineactivetoken 180 {\cyrillicIE}
-\defineactivetoken 181 {\cyrillicDZE}
-\defineactivetoken 182 {\cyrillicII}
-\defineactivetoken 183 {\cyrillicYI}
-\defineactivetoken 184 {\cyrillicJE}
-\defineactivetoken 185 {\cyrillicLJE}
-\defineactivetoken 186 {\cyrillicNJE}
-\defineactivetoken 187 {\cyrillicTSHE}
-\defineactivetoken 188 {\'\cyrillicK}
-\defineactivetoken 189 {\textcurrency}
-\defineactivetoken 190 {\cyrillicUSHRT}
-\defineactivetoken 191 {\cyrillicDZHE}
-
-\stopregime
-
-\startregime[mik]
-
-\defineactivetoken 128 {\cyrillicA}
-\defineactivetoken 129 {\cyrillicB}
-\defineactivetoken 130 {\cyrillicV}
-\defineactivetoken 131 {\cyrillicG}
-\defineactivetoken 132 {\cyrillicD}
-\defineactivetoken 133 {\cyrillicE}
-\defineactivetoken 134 {\cyrillicZH}
-\defineactivetoken 135 {\cyrillicZ}
-\defineactivetoken 136 {\cyrillicI}
-\defineactivetoken 137 {\cyrillicISHRT}
-\defineactivetoken 138 {\cyrillicK}
-\defineactivetoken 139 {\cyrillicL}
-\defineactivetoken 140 {\cyrillicM}
-\defineactivetoken 141 {\cyrillicN}
-\defineactivetoken 142 {\cyrillicO}
-\defineactivetoken 143 {\cyrillicP}
-\defineactivetoken 144 {\cyrillicR}
-\defineactivetoken 145 {\cyrillicS}
-\defineactivetoken 146 {\cyrillicT}
-\defineactivetoken 147 {\cyrillicU}
-\defineactivetoken 148 {\cyrillicF}
-\defineactivetoken 149 {\cyrillicH}
-\defineactivetoken 150 {\cyrillicC}
-\defineactivetoken 151 {\cyrillicCH}
-\defineactivetoken 152 {\cyrillicSH}
-\defineactivetoken 153 {\cyrillicSHCH}
-\defineactivetoken 154 {\cyrillicHRDSN}
-\defineactivetoken 155 {\cyrillicERY}
-\defineactivetoken 156 {\cyrillicSFTSN}
-\defineactivetoken 157 {\cyrillicEREV}
-\defineactivetoken 158 {\cyrillicYU}
-\defineactivetoken 159 {\cyrillicYA}
-\defineactivetoken 160 {\cyrillica}
-\defineactivetoken 161 {\cyrillicb}
-\defineactivetoken 162 {\cyrillicv}
-\defineactivetoken 163 {\cyrillicg}
-\defineactivetoken 164 {\cyrillicd}
-\defineactivetoken 165 {\cyrillice}
-\defineactivetoken 166 {\cyrilliczh}
-\defineactivetoken 167 {\cyrillicz}
-\defineactivetoken 168 {\cyrillici}
-\defineactivetoken 169 {\cyrillicishrt}
-\defineactivetoken 170 {\cyrillick}
-\defineactivetoken 171 {\cyrillicl}
-\defineactivetoken 172 {\cyrillicm}
-\defineactivetoken 173 {\cyrillicn}
-\defineactivetoken 174 {\cyrillico}
-\defineactivetoken 175 {\cyrillicp}
-\defineactivetoken 176 {\cyrillicr}
-\defineactivetoken 177 {\cyrillics}
-\defineactivetoken 178 {\cyrillict}
-\defineactivetoken 179 {\cyrillicu}
-\defineactivetoken 180 {\cyrillicf}
-\defineactivetoken 181 {\cyrillich}
-\defineactivetoken 182 {\cyrillicc}
-\defineactivetoken 183 {\cyrillicch}
-\defineactivetoken 184 {\cyrillicsh}
-\defineactivetoken 185 {\cyrillicshch}
-\defineactivetoken 186 {\cyrillichrdsn}
-\defineactivetoken 187 {\cyrillicery}
-\defineactivetoken 188 {\cyrillicsftsn}
-\defineactivetoken 189 {\cyrillicerev}
-\defineactivetoken 190 {\cyrillicyu}
-\defineactivetoken 191 {\cyrillicya}
-\defineactivetoken 213 {\textnumero}
-\defineactivetoken 214 {\sectionmark}
-\defineactivetoken 248 {\textdegree}
-\defineactivetoken 249 {\textbullet}
-\defineactivetoken 250 {\periodcentered}
-\defineactivetoken 254 {\textblacksquare}
-\defineactivetoken 255 {\nonbreakablespace}
-\defineactivetoken 224 {\mathematics\alpha}
-\defineactivetoken 225 {\mathematics\beta}
-\defineactivetoken 226 {\mathematics\Gamma}
-\defineactivetoken 227 {\mathematics\pi}
-\defineactivetoken 228 {\mathematics\Sigma}
-\defineactivetoken 229 {\mathematics\sigma}
-\defineactivetoken 230 {\textmu}
-\defineactivetoken 231 {\mathematics\tau}
-\defineactivetoken 232 {\mathematics\Phi}
-\defineactivetoken 233 {\mathematics\Theta}
-\defineactivetoken 234 {\mathematics\Omega}
-\defineactivetoken 235 {\mathematics\delta}
-\defineactivetoken 236 {\mathematics\infty}
-\defineactivetoken 237 {\mathematics\emptyset}
-\defineactivetoken 238 {\mathematics\in}
-\defineactivetoken 239 {\mathematics\cap}
-\defineactivetoken 240 {\mathematics\equiv}
-\defineactivetoken 241 {\textpm}
-\defineactivetoken 242 {\mathematics\geq}
-\defineactivetoken 243 {\mathematics\leq}
-\defineactivetoken 246 {\textdiv}
-\defineactivetoken 247 {\mathematics\sim}
-\defineactivetoken 251 {\textsurd}
-\defineactivetoken 252 {\high{\txx n}}
-\defineactivetoken 253 {\twosuperior}
-
-\stopregime
-
-\startregime[mls]
-
-% The symbols 194 to 253 are defined in Mongolian fonts in
-% the Mon\TeX\ package (?)
-
-\defineactivetoken 128 {\cyrillicB}
-\defineactivetoken 129 {\cyrillicy}
-\defineactivetoken 130 {\cyrillicD}
-\defineactivetoken 131 {\cyrillicYO}
-\defineactivetoken 132 {\cyrillicerev}
-\defineactivetoken 133 {\cyrillicZH}
-\defineactivetoken 134 {\cyrillicZ}
-\defineactivetoken 135 {\cyrillicI}
-\defineactivetoken 136 {\cyrillicISHRT}
-\defineactivetoken 137 {\cyrillicyo}
-\defineactivetoken 138 {\cyrillicL}
-\defineactivetoken 139 {\cyrillicishrt}
-\defineactivetoken 140 {\cyrillicOTLD}
-\defineactivetoken 141 {\cyrillicP}
-\defineactivetoken 142 {\cyrillicEREV}
-\defineactivetoken 143 {\cyrillicU}
-\defineactivetoken 144 {\cyrillicF}
-\defineactivetoken 145 {\cyrillicC}
-\defineactivetoken 146 {\cyrillicCH}
-\defineactivetoken 147 {\cyrillicSH}
-\defineactivetoken 148 {\cyrillicotld}
-\defineactivetoken 149 {\cyrillicSHCH}
-\defineactivetoken 150 {\cyrillicHRDSN}
-\defineactivetoken 151 {\cyrillicERY}
-\defineactivetoken 152 {\cyrillicSFTSN}
-\defineactivetoken 153 {\cyrillicOTLD}
-\defineactivetoken 154 {\cyrillicY}
-\defineactivetoken 155 {\cyrillicEREV}
-\defineactivetoken 156 {\cyrillicYU}
-\defineactivetoken 157 {\cyrillicYA}
-\defineactivetoken 158 {\cyrillicb}
-\defineactivetoken 159 {\cyrillicv}
-\defineactivetoken 160 {\cyrillicg}
-\defineactivetoken 161 {\cyrillicd}
-\defineactivetoken 162 {\cyrilliczh}
-\defineactivetoken 163 {\cyrillicz}
-\defineactivetoken 164 {\cyrillici}
-\defineactivetoken 165 {\cyrillicishrt}
-\defineactivetoken 166 {\cyrillick}
-\defineactivetoken 167 {\cyrillicl}
-\defineactivetoken 168 {\cyrillicm}
-\defineactivetoken 169 {\cyrillicn}
-\defineactivetoken 170 {\cyrillicotld}
-\defineactivetoken 171 {\cyrillicp}
-\defineactivetoken 172 {\cyrillict}
-\defineactivetoken 173 {\cyrillicy}
-\defineactivetoken 174 {\leftguillemot}
-\defineactivetoken 175 {\rightguillemot}
-\defineactivetoken 176 {\cyrillicf}
-\defineactivetoken 177 {\cyrillicc}
-\defineactivetoken 178 {\cyrillicch}
-\defineactivetoken 180 {\cyrillicsh}
-\defineactivetoken 181 {\cyrillicshch}
-\defineactivetoken 182 {\cyrillichrdsn}
-\defineactivetoken 183 {\cyrillicery}
-\defineactivetoken 184 {\cyrillicsftsn}
-\defineactivetoken 189 {\cyrillicerev}
-\defineactivetoken 190 {\cyrillicyu}
-\defineactivetoken 193 {\cyrillicya}
-\defineactivetoken 226 {\cyrillicG}
-\defineactivetoken 225 {\ss}
-\defineactivetoken 231 {\mathematics{\gamma}}
-\defineactivetoken 255 {\nonbreakablespace}
-\defineactivetoken 194 {\titem}
-\defineactivetoken 195 {\shud}
-\defineactivetoken 197 {\secondaryshud}
-\defineactivetoken 198 {\shilbe}
-\defineactivetoken 199 {\gedes}
-\defineactivetoken 207 {\secondarygedes}
-\defineactivetoken 208 {\cegteishud}
-\defineactivetoken 209 {\lewer}
-\defineactivetoken 210 {\suuliinlewer}
-\defineactivetoken 211 {\tertiarylewer}
-\defineactivetoken 212 {\mewer}
-\defineactivetoken 213 {\suuliinmewer}
-\defineactivetoken 214 {\xewteeqix}
-\defineactivetoken 215 {\dawxarcegtxewteeqix}
-\defineactivetoken 216 {\halfnum}
-\defineactivetoken 219 {\num}
-\defineactivetoken 220 {\halfnumtgedes}
-\defineactivetoken 221 {\numtaigedes}
-\defineactivetoken 222 {\buruuxarsangedes}
-\defineactivetoken 223 {\gedesteishilbe}
-\defineactivetoken 224 {\erweeljinshilbe}
-\defineactivetoken 227 {\secerweeljin}
-\defineactivetoken 228 {\bosooshilbe}
-\defineactivetoken 229 {\etgershilbe}
-\defineactivetoken 230 {\zawj}
-\defineactivetoken 232 {\suuliinzawj}
-\defineactivetoken 233 {\dawxarcegtzawj}
-\defineactivetoken 234 {\sereeewer}
-\defineactivetoken 235 {\matgarshilbe}
-\defineactivetoken 236 {\bituushilbe}
-\defineactivetoken 237 {\secondaryqagt}
-\defineactivetoken 238 {\qagt}
-\defineactivetoken 239 {\secnumtdelbenqix}
-\defineactivetoken 240 {\numtdelbenqix}
-\defineactivetoken 241 {\secsertenqixtnum}
-\defineactivetoken 242 {\sertenqixtnum}
-\defineactivetoken 243 {\zadgaizardigt}
-\defineactivetoken 244 {\bituuzardigt}
-\defineactivetoken 245 {\malgaitaititem}
-\defineactivetoken 246 {\suul}
-\defineactivetoken 247 {\orxic}
-\defineactivetoken 248 {\biodoisuul}
-\defineactivetoken 249 {\bagodoisuul}
-\defineactivetoken 250 {\nceg}
-\defineactivetoken 251 {\gceg}
-\defineactivetoken 252 {\ceg}
-\defineactivetoken 253 {\dorwoljin}
-
-\stopregime
-
-\startregime[mnk]
-
-\defineactivetoken 128 {\cyrillicA}
-\defineactivetoken 129 {\cyrillicB}
-\defineactivetoken 130 {\cyrillicV}
-\defineactivetoken 131 {\cyrillicG}
-\defineactivetoken 132 {\cyrillicD}
-\defineactivetoken 133 {\cyrillicE}
-\defineactivetoken 134 {\cyrillicYO}
-\defineactivetoken 135 {\cyrillicZH}
-\defineactivetoken 136 {\cyrillicZ}
-\defineactivetoken 137 {\cyrillicI}
-\defineactivetoken 138 {\cyrillicISHRT}
-\defineactivetoken 139 {\cyrillicK}
-\defineactivetoken 140 {\cyrillicL}
-\defineactivetoken 141 {\cyrillicM}
-\defineactivetoken 142 {\cyrillicN}
-\defineactivetoken 143 {\cyrillicO}
-\defineactivetoken 144 {\cyrillicOTLD}
-\defineactivetoken 145 {\cyrillicP}
-\defineactivetoken 146 {\cyrillicR}
-\defineactivetoken 147 {\cyrillicS}
-\defineactivetoken 148 {\cyrillicT}
-\defineactivetoken 149 {\cyrillicU}
-\defineactivetoken 150 {\cyrillicY}
-\defineactivetoken 151 {\cyrillicF}
-\defineactivetoken 152 {\cyrillicH}
-\defineactivetoken 153 {\cyrillicC}
-\defineactivetoken 154 {\cyrillicCH}
-\defineactivetoken 155 {\cyrillicSH}
-\defineactivetoken 156 {\cyrillicSHCH}
-\defineactivetoken 157 {\cyrillicHRDSN}
-\defineactivetoken 158 {\cyrillicERY}
-\defineactivetoken 159 {\cyrillicSFTSN}
-\defineactivetoken 160 {\cyrillicEREV}
-\defineactivetoken 161 {\cyrillicYU}
-\defineactivetoken 162 {\cyrillicYA}
-\defineactivetoken 163 {\cyrillica}
-\defineactivetoken 164 {\cyrillicb}
-\defineactivetoken 165 {\cyrillicv}
-\defineactivetoken 166 {\cyrillicg}
-\defineactivetoken 167 {\cyrillicd}
-\defineactivetoken 168 {\cyrillice}
-\defineactivetoken 169 {\cyrillicyo}
-\defineactivetoken 170 {\cyrilliczh}
-\defineactivetoken 173 {\cyrillicz}
-\defineactivetoken 224 {\cyrillici}
-\defineactivetoken 225 {\cyrillicishrt}
-\defineactivetoken 226 {\cyrillick}
-\defineactivetoken 227 {\cyrillicl}
-\defineactivetoken 228 {\cyrillicm}
-\defineactivetoken 229 {\cyrillicn}
-\defineactivetoken 230 {\cyrillico}
-\defineactivetoken 231 {\cyrillicotld}
-\defineactivetoken 232 {\cyrillicp}
-\defineactivetoken 233 {\cyrillicr}
-\defineactivetoken 234 {\cyrillics}
-\defineactivetoken 235 {\cyrillict}
-\defineactivetoken 236 {\cyrillicu}
-\defineactivetoken 237 {\cyrillicy}
-\defineactivetoken 238 {\cyrillicf}
-\defineactivetoken 239 {\cyrillich}
-\defineactivetoken 240 {\cyrillicc}
-\defineactivetoken 241 {\cyrillicch}
-\defineactivetoken 242 {\cyrillicsh}
-\defineactivetoken 243 {\cyrillicshch}
-\defineactivetoken 244 {\cyrillichrdsn}
-\defineactivetoken 245 {\cyrillicery}
-\defineactivetoken 248 {\cyrillicsftsn}
-\defineactivetoken 252 {\cyrillicerev}
-\defineactivetoken 253 {\cyrillicyu}
-\defineactivetoken 254 {\cyrillicya}
-
-\stopregime
-
-\startregime[mos]
-
-\defineactivetoken 128 {\cyrillicA}
-\defineactivetoken 129 {\cyrillicB}
-\defineactivetoken 130 {\cyrillicV}
-\defineactivetoken 131 {\cyrillicG}
-\defineactivetoken 132 {\cyrillicD}
-\defineactivetoken 133 {\cyrillicE}
-\defineactivetoken 160 {\cyrillicYO}
-\defineactivetoken 134 {\cyrillicZH}
-\defineactivetoken 135 {\cyrillicZ}
-\defineactivetoken 136 {\cyrillicI}
-\defineactivetoken 137 {\cyrillicISHRT}
-\defineactivetoken 138 {\cyrillicK}
-\defineactivetoken 139 {\cyrillicL}
-\defineactivetoken 140 {\cyrillicM}
-\defineactivetoken 141 {\cyrillicN}
-\defineactivetoken 142 {\cyrillicO}
-\defineactivetoken 153 {\cyrillicOTLD}
-\defineactivetoken 143 {\cyrillicP}
-\defineactivetoken 144 {\cyrillicR}
-\defineactivetoken 145 {\cyrillicS}
-\defineactivetoken 146 {\cyrillicT}
-\defineactivetoken 147 {\cyrillicU}
-\defineactivetoken 154 {\cyrillicY}
-\defineactivetoken 148 {\cyrillicF}
-\defineactivetoken 149 {\cyrillicH}
-\defineactivetoken 150 {\cyrillicC}
-\defineactivetoken 151 {\cyrillicCH}
-\defineactivetoken 152 {\cyrillicSH}
-\defineactivetoken 164 {\cyrillicSHCH}
-\defineactivetoken 162 {\cyrillicHRDSN}
-\defineactivetoken 155 {\cyrillicERY}
-\defineactivetoken 156 {\cyrillicSFTSN}
-\defineactivetoken 157 {\cyrillicEREV}
-\defineactivetoken 158 {\cyrillicYU}
-\defineactivetoken 159 {\cyrillicYA}
-\defineactivetoken 224 {\cyrillica}
-\defineactivetoken 225 {\cyrillicb}
-\defineactivetoken 226 {\cyrillicv}
-\defineactivetoken 227 {\cyrillicg}
-\defineactivetoken 228 {\cyrillicd}
-\defineactivetoken 229 {\cyrillice}
-\defineactivetoken 161 {\cyrillicyo}
-\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 249 {\cyrillicotld}
-\defineactivetoken 239 {\cyrillicp}
-\defineactivetoken 240 {\cyrillicr}
-\defineactivetoken 241 {\cyrillics}
-\defineactivetoken 242 {\cyrillict}
-\defineactivetoken 243 {\cyrillicu}
-\defineactivetoken 250 {\cyrillicy}
-\defineactivetoken 244 {\cyrillicf}
-\defineactivetoken 245 {\cyrillich}
-\defineactivetoken 246 {\cyrillicc}
-\defineactivetoken 247 {\cyrillicch}
-\defineactivetoken 248 {\cyrillicsh}
-\defineactivetoken 165 {\cyrillicshch}
-\defineactivetoken 163 {\cyrillichrdsn}
-\defineactivetoken 251 {\cyrillicery}
-\defineactivetoken 252 {\cyrillicsftsn}
-\defineactivetoken 253 {\cyrillicerev}
-\defineactivetoken 254 {\cyrillicyu}
-\defineactivetoken 168 {\cyrillicya}
-
-\stopregime
-
-\startregime[ncc]
-
-\defineactivetoken 128 {\cyrillicA}
-\defineactivetoken 129 {\cyrillicB}
-\defineactivetoken 130 {\cyrillicV}
-\defineactivetoken 131 {\cyrillicG}
-\defineactivetoken 132 {\cyrillicD}
-\defineactivetoken 133 {\cyrillicE}
-\defineactivetoken 134 {\cyrillicYO}
-\defineactivetoken 135 {\cyrillicZH}
-\defineactivetoken 136 {\cyrillicZ}
-\defineactivetoken 137 {\cyrillicI}
-\defineactivetoken 139 {\cyrillicISHRT}
-\defineactivetoken 140 {\cyrillicK}
-\defineactivetoken 142 {\cyrillicL}
-\defineactivetoken 143 {\cyrillicM}
-\defineactivetoken 144 {\cyrillicN}
-\defineactivetoken 145 {\cyrillicO}
-\defineactivetoken 146 {\cyrillicOTLD}
-\defineactivetoken 147 {\cyrillicP}
-\defineactivetoken 148 {\cyrillicR}
-\defineactivetoken 149 {\cyrillicS}
-\defineactivetoken 150 {\cyrillicT}
-\defineactivetoken 151 {\cyrillicU}
-\defineactivetoken 152 {\cyrillicY}
-\defineactivetoken 153 {\cyrillicF}
-\defineactivetoken 154 {\cyrillicH}
-\defineactivetoken 155 {\cyrillicC}
-\defineactivetoken 156 {\cyrillicCH}
-\defineactivetoken 157 {\cyrillicSH}
-\defineactivetoken 158 {\cyrillicSHCH}
-\defineactivetoken 159 {\cyrillicHRDSN}
-\defineactivetoken 160 {\cyrillicERY}
-\defineactivetoken 161 {\cyrillicSFTSN}
-\defineactivetoken 162 {\cyrillicEREV}
-\defineactivetoken 163 {\cyrillicYU}
-\defineactivetoken 164 {\cyrillicYA}
-\defineactivetoken 165 {\cyrillica}
-\defineactivetoken 166 {\cyrillicb}
-\defineactivetoken 167 {\cyrillicv}
-\defineactivetoken 168 {\cyrillicg}
-\defineactivetoken 169 {\cyrillicd}
-\defineactivetoken 170 {\cyrillice}
-\defineactivetoken 171 {\cyrillicyo}
-\defineactivetoken 172 {\cyrilliczh}
-\defineactivetoken 173 {\cyrillicz}
-\defineactivetoken 225 {\cyrillici}
-\defineactivetoken 226 {\cyrillicishrt}
-\defineactivetoken 227 {\cyrillick}
-\defineactivetoken 228 {\cyrillicl}
-\defineactivetoken 229 {\cyrillicm}
-\defineactivetoken 230 {\cyrillicn}
-\defineactivetoken 231 {\cyrillico}
-\defineactivetoken 232 {\cyrillicotld}
-\defineactivetoken 233 {\cyrillicp}
-\defineactivetoken 234 {\cyrillicr}
-\defineactivetoken 235 {\cyrillics}
-\defineactivetoken 236 {\cyrillict}
-\defineactivetoken 237 {\cyrillicu}
-\defineactivetoken 238 {\cyrillicy}
-\defineactivetoken 239 {\cyrillicf}
-\defineactivetoken 240 {\cyrillich}
-\defineactivetoken 241 {\cyrillicc}
-\defineactivetoken 242 {\cyrillicch}
-\defineactivetoken 243 {\cyrillicsh}
-\defineactivetoken 244 {\cyrillicshch}
-\defineactivetoken 245 {\cyrillichrdsn}
-\defineactivetoken 246 {\cyrillicery}
-\defineactivetoken 247 {\cyrillicsftsn}
-\defineactivetoken 248 {\cyrillicerev}
-\defineactivetoken 249 {\cyrillicyu}
-\defineactivetoken 251 {\cyrillicya}
-
-\stopregime
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/regi-cyr.mkii b/Master/texmf-dist/tex/context/base/mkii/regi-cyr.mkii
deleted file mode 100644
index 1910c0e7cb3..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/regi-cyr.mkii
+++ /dev/null
@@ -1,722 +0,0 @@
-%D \module
-%D [ file=regi-cyr,
-%D version=2003.01.24,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=Cyrillic,
-%D author=...,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Here are additional input regimes for cyrillic encodings others than cp1251
-%D and iso-8859-5:
-%D
-%D \startitemize
-%D \item two variants of dos
-%D \item three variants of koi-8 for *nix: russian,
-%D ukrainian and mixed
-%D \item two variants for the mac
-%D \stopitemize
-%D
-%D Other, not so popular regimes, can be found in \type
-%D {regi-cy2}.
-
-\startregime[cp866]
-
-\defineactivetoken 128 {\cyrillicA}
-\defineactivetoken 129 {\cyrillicB}
-\defineactivetoken 130 {\cyrillicV}
-\defineactivetoken 131 {\cyrillicG}
-\defineactivetoken 132 {\cyrillicD}
-\defineactivetoken 133 {\cyrillicE}
-\defineactivetoken 134 {\cyrillicZH}
-\defineactivetoken 135 {\cyrillicZ}
-\defineactivetoken 136 {\cyrillicI}
-\defineactivetoken 137 {\cyrillicISHRT}
-\defineactivetoken 138 {\cyrillicK}
-\defineactivetoken 139 {\cyrillicL}
-\defineactivetoken 140 {\cyrillicM}
-\defineactivetoken 141 {\cyrillicN}
-\defineactivetoken 142 {\cyrillicO}
-\defineactivetoken 143 {\cyrillicP}
-\defineactivetoken 144 {\cyrillicR}
-\defineactivetoken 145 {\cyrillicS}
-\defineactivetoken 146 {\cyrillicT}
-\defineactivetoken 147 {\cyrillicU}
-\defineactivetoken 148 {\cyrillicF}
-\defineactivetoken 149 {\cyrillicH}
-\defineactivetoken 150 {\cyrillicC}
-\defineactivetoken 151 {\cyrillicCH}
-\defineactivetoken 152 {\cyrillicSH}
-\defineactivetoken 153 {\cyrillicSHCH}
-\defineactivetoken 154 {\cyrillicHRDSN}
-\defineactivetoken 155 {\cyrillicERY}
-\defineactivetoken 156 {\cyrillicSFTSN}
-\defineactivetoken 157 {\cyrillicEREV}
-\defineactivetoken 158 {\cyrillicYU}
-\defineactivetoken 159 {\cyrillicYA}
-\defineactivetoken 160 {\cyrillica}
-\defineactivetoken 161 {\cyrillicb}
-\defineactivetoken 162 {\cyrillicv}
-\defineactivetoken 163 {\cyrillicg}
-\defineactivetoken 164 {\cyrillicd}
-\defineactivetoken 165 {\cyrillice}
-\defineactivetoken 166 {\cyrilliczh}
-\defineactivetoken 167 {\cyrillicz}
-\defineactivetoken 168 {\cyrillici}
-\defineactivetoken 169 {\cyrillicishrt}
-\defineactivetoken 170 {\cyrillick}
-\defineactivetoken 171 {\cyrillicl}
-\defineactivetoken 172 {\cyrillicm}
-\defineactivetoken 173 {\cyrillicn}
-\defineactivetoken 174 {\cyrillico}
-\defineactivetoken 175 {\cyrillicp}
-\defineactivetoken 224 {\cyrillicr}
-\defineactivetoken 225 {\cyrillics}
-\defineactivetoken 226 {\cyrillict}
-\defineactivetoken 227 {\cyrillicu}
-\defineactivetoken 228 {\cyrillicf}
-\defineactivetoken 229 {\cyrillich}
-\defineactivetoken 230 {\cyrillicc}
-\defineactivetoken 231 {\cyrillicch}
-\defineactivetoken 232 {\cyrillicsh}
-\defineactivetoken 233 {\cyrillicshch}
-\defineactivetoken 234 {\cyrillichrdsn}
-\defineactivetoken 235 {\cyrillicery}
-\defineactivetoken 236 {\cyrillicsftsn}
-\defineactivetoken 237 {\cyrillicerev}
-\defineactivetoken 238 {\cyrillicyu}
-\defineactivetoken 239 {\cyrillicya}
-\defineactivetoken 240 {\cyrillicYO}
-\defineactivetoken 241 {\cyrillicyo}
-\defineactivetoken 242 {\cyrillicIE}
-\defineactivetoken 243 {\cyrillicie}
-\defineactivetoken 244 {\cyrillicYI}
-\defineactivetoken 245 {\cyrillicyi}
-\defineactivetoken 246 {\cyrillicUSHRT}
-\defineactivetoken 247 {\cyrillicushrt}
-\defineactivetoken 248 {\textdegree}
-\defineactivetoken 249 {\bullet}
-\defineactivetoken 250 {\periodcentered}
-\defineactivetoken 252 {\textnumero}
-\defineactivetoken 253 {\textcurrency}
-\defineactivetoken 254 {\textblacksquare}
-\defineactivetoken 255 {\nonbreakablespace}
-\defineactivetoken 251 {\textsurd}
-
-\stopregime
-
-\startregime[cp866nav]
-
-\defineactivetoken 128 {\cyrillicA}
-\defineactivetoken 129 {\cyrillicB}
-\defineactivetoken 130 {\cyrillicV}
-\defineactivetoken 131 {\cyrillicG}
-\defineactivetoken 132 {\cyrillicD}
-\defineactivetoken 133 {\cyrillicE}
-\defineactivetoken 134 {\cyrillicZH}
-\defineactivetoken 135 {\cyrillicZ}
-\defineactivetoken 136 {\cyrillicI}
-\defineactivetoken 137 {\cyrillicISHRT}
-\defineactivetoken 138 {\cyrillicK}
-\defineactivetoken 139 {\cyrillicL}
-\defineactivetoken 140 {\cyrillicM}
-\defineactivetoken 141 {\cyrillicN}
-\defineactivetoken 142 {\cyrillicO}
-\defineactivetoken 143 {\cyrillicP}
-\defineactivetoken 144 {\cyrillicR}
-\defineactivetoken 145 {\cyrillicS}
-\defineactivetoken 146 {\cyrillicT}
-\defineactivetoken 147 {\cyrillicU}
-\defineactivetoken 148 {\cyrillicF}
-\defineactivetoken 149 {\cyrillicH}
-\defineactivetoken 150 {\cyrillicC}
-\defineactivetoken 151 {\cyrillicCH}
-\defineactivetoken 152 {\cyrillicSH}
-\defineactivetoken 153 {\cyrillicSHCH}
-\defineactivetoken 154 {\cyrillicHRDSN}
-\defineactivetoken 155 {\cyrillicERY}
-\defineactivetoken 156 {\cyrillicSFTSN}
-\defineactivetoken 157 {\cyrillicEREV}
-\defineactivetoken 158 {\cyrillicYU}
-\defineactivetoken 159 {\cyrillicYA}
-\defineactivetoken 160 {\cyrillica}
-\defineactivetoken 161 {\cyrillicb}
-\defineactivetoken 162 {\cyrillicv}
-\defineactivetoken 163 {\cyrillicg}
-\defineactivetoken 164 {\cyrillicd}
-\defineactivetoken 165 {\cyrillice}
-\defineactivetoken 166 {\cyrilliczh}
-\defineactivetoken 167 {\cyrillicz}
-\defineactivetoken 168 {\cyrillici}
-\defineactivetoken 169 {\cyrillicishrt}
-\defineactivetoken 170 {\cyrillick}
-\defineactivetoken 171 {\cyrillicl}
-\defineactivetoken 172 {\cyrillicm}
-\defineactivetoken 173 {\cyrillicn}
-\defineactivetoken 174 {\cyrillico}
-\defineactivetoken 175 {\cyrillicp}
-\defineactivetoken 224 {\cyrillicr}
-\defineactivetoken 225 {\cyrillics}
-\defineactivetoken 226 {\cyrillict}
-\defineactivetoken 227 {\cyrillicu}
-\defineactivetoken 228 {\cyrillicf}
-\defineactivetoken 229 {\cyrillich}
-\defineactivetoken 230 {\cyrillicc}
-\defineactivetoken 231 {\cyrillicch}
-\defineactivetoken 232 {\cyrillicsh}
-\defineactivetoken 233 {\cyrillicshch}
-\defineactivetoken 234 {\cyrillichrdsn}
-\defineactivetoken 235 {\cyrillicery}
-\defineactivetoken 236 {\cyrillicsftsn}
-\defineactivetoken 237 {\cyrillicerev}
-\defineactivetoken 238 {\cyrillicyu}
-\defineactivetoken 239 {\cyrillicya}
-\defineactivetoken 240 {\cyrillicYO}
-\defineactivetoken 241 {\cyrillicyo}
-\defineactivetoken 242 {\cyrillicGUP}
-\defineactivetoken 243 {\cyrillicgup}
-\defineactivetoken 244 {\cyrillicIE}
-\defineactivetoken 245 {\cyrillicie}
-\defineactivetoken 246 {\cyrillicII}
-\defineactivetoken 247 {\cyrillicii}
-\defineactivetoken 248 {\cyrillicYI}
-\defineactivetoken 249 {\cyrillicyi}
-\defineactivetoken 250 {\cyrillicUSHRT}
-\defineactivetoken 251 {\cyrillicushrt}
-\defineactivetoken 252 {\textnumero}
-\defineactivetoken 253 {\leftguillemot}
-\defineactivetoken 254 {\rightguillemot}
-\defineactivetoken 255 {\nonbreakablespace}
-
-\stopregime
-
-\startregime[koi8-r]
-
-\defineactivetoken 225 {\cyrillicA}
-\defineactivetoken 226 {\cyrillicB}
-\defineactivetoken 247 {\cyrillicV}
-\defineactivetoken 231 {\cyrillicG}
-\defineactivetoken 228 {\cyrillicD}
-\defineactivetoken 229 {\cyrillicE}
-\defineactivetoken 179 {\cyrillicYO}
-\defineactivetoken 246 {\cyrillicZH}
-\defineactivetoken 250 {\cyrillicZ}
-\defineactivetoken 233 {\cyrillicI}
-\defineactivetoken 234 {\cyrillicISHRT}
-\defineactivetoken 235 {\cyrillicK}
-\defineactivetoken 236 {\cyrillicL}
-\defineactivetoken 237 {\cyrillicM}
-\defineactivetoken 238 {\cyrillicN}
-\defineactivetoken 239 {\cyrillicO}
-\defineactivetoken 240 {\cyrillicP}
-\defineactivetoken 242 {\cyrillicR}
-\defineactivetoken 243 {\cyrillicS}
-\defineactivetoken 244 {\cyrillicT}
-\defineactivetoken 245 {\cyrillicU}
-\defineactivetoken 230 {\cyrillicF}
-\defineactivetoken 232 {\cyrillicH}
-\defineactivetoken 227 {\cyrillicC}
-\defineactivetoken 254 {\cyrillicCH}
-\defineactivetoken 251 {\cyrillicSH}
-\defineactivetoken 253 {\cyrillicSHCH}
-\defineactivetoken 255 {\cyrillicHRDSN}
-\defineactivetoken 249 {\cyrillicERY}
-\defineactivetoken 248 {\cyrillicSFTSN}
-\defineactivetoken 252 {\cyrillicEREV}
-\defineactivetoken 224 {\cyrillicYU}
-\defineactivetoken 241 {\cyrillicYA}
-\defineactivetoken 193 {\cyrillica}
-\defineactivetoken 194 {\cyrillicb}
-\defineactivetoken 215 {\cyrillicv}
-\defineactivetoken 199 {\cyrillicg}
-\defineactivetoken 196 {\cyrillicd}
-\defineactivetoken 197 {\cyrillice}
-\defineactivetoken 163 {\cyrillicyo}
-\defineactivetoken 214 {\cyrilliczh}
-\defineactivetoken 218 {\cyrillicz}
-\defineactivetoken 201 {\cyrillici}
-\defineactivetoken 202 {\cyrillicishrt}
-\defineactivetoken 203 {\cyrillick}
-\defineactivetoken 204 {\cyrillicl}
-\defineactivetoken 205 {\cyrillicm}
-\defineactivetoken 206 {\cyrillicn}
-\defineactivetoken 207 {\cyrillico}
-\defineactivetoken 208 {\cyrillicp}
-\defineactivetoken 210 {\cyrillicr}
-\defineactivetoken 211 {\cyrillics}
-\defineactivetoken 212 {\cyrillict}
-\defineactivetoken 213 {\cyrillicu}
-\defineactivetoken 198 {\cyrillicf}
-\defineactivetoken 200 {\cyrillich}
-\defineactivetoken 195 {\cyrillicc}
-\defineactivetoken 222 {\cyrillicch}
-\defineactivetoken 219 {\cyrillicsh}
-\defineactivetoken 221 {\cyrillicshch}
-\defineactivetoken 223 {\cyrillichrdsn}
-\defineactivetoken 217 {\cyrillicery}
-\defineactivetoken 216 {\cyrillicsftsn}
-\defineactivetoken 220 {\cyrillicerev}
-\defineactivetoken 192 {\cyrillicyu}
-\defineactivetoken 209 {\cyrillicya}
-\defineactivetoken 148 {\textblacksquare}
-\defineactivetoken 149 {\textbullet}
-\defineactivetoken 154 {\nonbreakablespace}
-\defineactivetoken 156 {\textdegree}
-\defineactivetoken 158 {\periodcentered}
-\defineactivetoken 191 {\copyright}
-\defineactivetoken 150 {\textsurd}
-\defineactivetoken 151 {\mathematics\sim}
-\defineactivetoken 152 {\mathematics\leq}
-\defineactivetoken 153 {\mathematics\geq}
-\defineactivetoken 157 {\twosuperior}
-\defineactivetoken 159 {\textdiv}
-
-\stopregime
-
-\startregime[koi8-ru]
-
-\defineactivetoken 225 {\cyrillicA}
-\defineactivetoken 226 {\cyrillicB}
-\defineactivetoken 247 {\cyrillicV}
-\defineactivetoken 231 {\cyrillicG}
-\defineactivetoken 228 {\cyrillicD}
-\defineactivetoken 229 {\cyrillicE}
-\defineactivetoken 179 {\cyrillicYO}
-\defineactivetoken 246 {\cyrillicZH}
-\defineactivetoken 250 {\cyrillicZ}
-\defineactivetoken 233 {\cyrillicI}
-\defineactivetoken 234 {\cyrillicISHRT}
-\defineactivetoken 235 {\cyrillicK}
-\defineactivetoken 236 {\cyrillicL}
-\defineactivetoken 237 {\cyrillicM}
-\defineactivetoken 238 {\cyrillicN}
-\defineactivetoken 239 {\cyrillicO}
-\defineactivetoken 240 {\cyrillicP}
-\defineactivetoken 242 {\cyrillicR}
-\defineactivetoken 243 {\cyrillicS}
-\defineactivetoken 244 {\cyrillicT}
-\defineactivetoken 245 {\cyrillicU}
-\defineactivetoken 230 {\cyrillicF}
-\defineactivetoken 232 {\cyrillicH}
-\defineactivetoken 227 {\cyrillicC}
-\defineactivetoken 254 {\cyrillicCH}
-\defineactivetoken 251 {\cyrillicSH}
-\defineactivetoken 253 {\cyrillicSHCH}
-\defineactivetoken 255 {\cyrillicHRDSN}
-\defineactivetoken 249 {\cyrillicERY}
-\defineactivetoken 248 {\cyrillicSFTSN}
-\defineactivetoken 252 {\cyrillicEREV}
-\defineactivetoken 224 {\cyrillicYU}
-\defineactivetoken 241 {\cyrillicYA}
-\defineactivetoken 193 {\cyrillica}
-\defineactivetoken 194 {\cyrillicb}
-\defineactivetoken 215 {\cyrillicv}
-\defineactivetoken 199 {\cyrillicg}
-\defineactivetoken 196 {\cyrillicd}
-\defineactivetoken 197 {\cyrillice}
-\defineactivetoken 163 {\cyrillicyo}
-\defineactivetoken 214 {\cyrilliczh}
-\defineactivetoken 218 {\cyrillicz}
-\defineactivetoken 201 {\cyrillici}
-\defineactivetoken 202 {\cyrillicishrt}
-\defineactivetoken 203 {\cyrillick}
-\defineactivetoken 204 {\cyrillicl}
-\defineactivetoken 205 {\cyrillicm}
-\defineactivetoken 206 {\cyrillicn}
-\defineactivetoken 207 {\cyrillico}
-\defineactivetoken 208 {\cyrillicp}
-\defineactivetoken 210 {\cyrillicr}
-\defineactivetoken 211 {\cyrillics}
-\defineactivetoken 212 {\cyrillict}
-\defineactivetoken 213 {\cyrillicu}
-\defineactivetoken 198 {\cyrillicf}
-\defineactivetoken 200 {\cyrillich}
-\defineactivetoken 195 {\cyrillicc}
-\defineactivetoken 222 {\cyrillicch}
-\defineactivetoken 219 {\cyrillicsh}
-\defineactivetoken 221 {\cyrillicshch}
-\defineactivetoken 223 {\cyrillichrdsn}
-\defineactivetoken 217 {\cyrillicery}
-\defineactivetoken 216 {\cyrillicsftsn}
-\defineactivetoken 220 {\cyrillicerev}
-\defineactivetoken 192 {\cyrillicyu}
-\defineactivetoken 209 {\cyrillicya}
-\defineactivetoken 147 {\upperleftsinglesixquote}
-\defineactivetoken 148 {\textblacksquare}
-\defineactivetoken 149 {\textbullet} % Changed by V.F. 07/02/2003 (was: \bullet)
-\defineactivetoken 150 {\upperrightdoubleninequote}
-\defineactivetoken 151 {\emdash}
-\defineactivetoken 152 {\textnumero}
-\defineactivetoken 153 {\trademark} % Changed by V.F. 07/02/2003 (was: \texttrademark)
-\defineactivetoken 154 {\nonbreakablespace}
-\defineactivetoken 155 {\rightguillemot}
-\defineactivetoken 156 {\registered}
-\defineactivetoken 157 {\leftguillemot}
-\defineactivetoken 158 {\periodcentered} % Changed by V.F. 07/02/2003 (was: \textperiodcentered)
-\defineactivetoken 159 {\textcurrency}
-\defineactivetoken 164 {\cyrillicie}
-\defineactivetoken 166 {\cyrillicii}
-\defineactivetoken 167 {\cyrillicyi}
-\defineactivetoken 173 {\cyrillicgup}
-\defineactivetoken 174 {\cyrillicushrt}
-\defineactivetoken 180 {\cyrillicIE}
-\defineactivetoken 182 {\cyrillicII}
-\defineactivetoken 183 {\cyrillicYI}
-\defineactivetoken 189 {\cyrillicGUP}
-\defineactivetoken 190 {\cyrillicUSHRT}
-\defineactivetoken 191 {\copyright}
-
-\stopregime
-
-\startregime[koi8-u]
-
-\defineactivetoken 225 {\cyrillicA}
-\defineactivetoken 226 {\cyrillicB}
-\defineactivetoken 247 {\cyrillicV}
-\defineactivetoken 231 {\cyrillicG}
-\defineactivetoken 228 {\cyrillicD}
-\defineactivetoken 229 {\cyrillicE}
-\defineactivetoken 179 {\cyrillicYO}
-\defineactivetoken 246 {\cyrillicZH}
-\defineactivetoken 250 {\cyrillicZ}
-\defineactivetoken 233 {\cyrillicI}
-\defineactivetoken 234 {\cyrillicISHRT}
-\defineactivetoken 235 {\cyrillicK}
-\defineactivetoken 236 {\cyrillicL}
-\defineactivetoken 237 {\cyrillicM}
-\defineactivetoken 238 {\cyrillicN}
-\defineactivetoken 239 {\cyrillicO}
-\defineactivetoken 240 {\cyrillicP}
-\defineactivetoken 242 {\cyrillicR}
-\defineactivetoken 243 {\cyrillicS}
-\defineactivetoken 244 {\cyrillicT}
-\defineactivetoken 245 {\cyrillicU}
-\defineactivetoken 230 {\cyrillicF}
-\defineactivetoken 232 {\cyrillicH}
-\defineactivetoken 227 {\cyrillicC}
-\defineactivetoken 254 {\cyrillicCH}
-\defineactivetoken 251 {\cyrillicSH}
-\defineactivetoken 253 {\cyrillicSHCH}
-\defineactivetoken 255 {\cyrillicHRDSN}
-\defineactivetoken 249 {\cyrillicERY}
-\defineactivetoken 248 {\cyrillicSFTSN}
-\defineactivetoken 252 {\cyrillicEREV}
-\defineactivetoken 224 {\cyrillicYU}
-\defineactivetoken 241 {\cyrillicYA}
-\defineactivetoken 193 {\cyrillica}
-\defineactivetoken 194 {\cyrillicb}
-\defineactivetoken 215 {\cyrillicv}
-\defineactivetoken 199 {\cyrillicg}
-\defineactivetoken 196 {\cyrillicd}
-\defineactivetoken 197 {\cyrillice}
-\defineactivetoken 163 {\cyrillicyo}
-\defineactivetoken 214 {\cyrilliczh}
-\defineactivetoken 218 {\cyrillicz}
-\defineactivetoken 201 {\cyrillici}
-\defineactivetoken 202 {\cyrillicishrt}
-\defineactivetoken 203 {\cyrillick}
-\defineactivetoken 204 {\cyrillicl}
-\defineactivetoken 205 {\cyrillicm}
-\defineactivetoken 206 {\cyrillicn}
-\defineactivetoken 207 {\cyrillico}
-\defineactivetoken 208 {\cyrillicp}
-\defineactivetoken 210 {\cyrillicr}
-\defineactivetoken 211 {\cyrillics}
-\defineactivetoken 212 {\cyrillict}
-\defineactivetoken 213 {\cyrillicu}
-\defineactivetoken 198 {\cyrillicf}
-\defineactivetoken 200 {\cyrillich}
-\defineactivetoken 195 {\cyrillicc}
-\defineactivetoken 222 {\cyrillicch}
-\defineactivetoken 219 {\cyrillicsh}
-\defineactivetoken 221 {\cyrillicshch}
-\defineactivetoken 223 {\cyrillichrdsn}
-\defineactivetoken 217 {\cyrillicery}
-\defineactivetoken 216 {\cyrillicsftsn}
-\defineactivetoken 220 {\cyrillicerev}
-\defineactivetoken 192 {\cyrillicyu}
-\defineactivetoken 209 {\cyrillicya}
-\defineactivetoken 164 {\cyrillicie}
-\defineactivetoken 166 {\cyrillicii}
-\defineactivetoken 167 {\cyrillicyi}
-\defineactivetoken 173 {\cyrillicgup}
-\defineactivetoken 180 {\cyrillicIE}
-\defineactivetoken 182 {\cyrillicII}
-\defineactivetoken 183 {\cyrillicYI}
-\defineactivetoken 189 {\cyrillicGUP}
-
-\stopregime
-
-\startregime[maccyr]
-
-\defineactivetoken 128 {\cyrillicA}
-\defineactivetoken 129 {\cyrillicB}
-\defineactivetoken 130 {\cyrillicV}
-\defineactivetoken 131 {\cyrillicG}
-\defineactivetoken 132 {\cyrillicD}
-\defineactivetoken 133 {\cyrillicE}
-\defineactivetoken 134 {\cyrillicZH}
-\defineactivetoken 135 {\cyrillicZ}
-\defineactivetoken 136 {\cyrillicI}
-\defineactivetoken 137 {\cyrillicISHRT}
-\defineactivetoken 138 {\cyrillicK}
-\defineactivetoken 139 {\cyrillicL}
-\defineactivetoken 140 {\cyrillicM}
-\defineactivetoken 141 {\cyrillicN}
-\defineactivetoken 142 {\cyrillicO}
-\defineactivetoken 143 {\cyrillicP}
-\defineactivetoken 144 {\cyrillicR}
-\defineactivetoken 145 {\cyrillicS}
-\defineactivetoken 146 {\cyrillicT}
-\defineactivetoken 147 {\cyrillicU}
-\defineactivetoken 148 {\cyrillicF}
-\defineactivetoken 149 {\cyrillicH}
-\defineactivetoken 150 {\cyrillicC}
-\defineactivetoken 151 {\cyrillicCH}
-\defineactivetoken 152 {\cyrillicSH}
-\defineactivetoken 153 {\cyrillicSHCH}
-\defineactivetoken 154 {\cyrillicHRDSN}
-\defineactivetoken 155 {\cyrillicERY}
-\defineactivetoken 156 {\cyrillicSFTSN}
-\defineactivetoken 157 {\cyrillicEREV}
-\defineactivetoken 158 {\cyrillicYU}
-\defineactivetoken 159 {\cyrillicYA}
-\defineactivetoken 160 {\textdag} % Changed by V.F. 07/02/2003 (was: dag)
-\defineactivetoken 161 {\textdegree}
-\defineactivetoken 162 {\textcent}
-\defineactivetoken 163 {\textsterling} % Changed by V.F. 07/02/2003 (was: \sterling)
-\defineactivetoken 164 {\sectionmark} % Changed by V.F. 07/02/2003 (was: \S)
-\defineactivetoken 165 {\textbullet} % Changed by V.F. 07/02/2003 (was: \bullet}
-\defineactivetoken 166 {\paragraphmark} % Changed by V.F. 07/02/2003 (was: \P)
-\defineactivetoken 167 {\cyrillicII}
-\defineactivetoken 168 {\registered}
-\defineactivetoken 169 {\copyright}
-\defineactivetoken 170 {\trademark} % Changed by V.F. 07/02/2003 (was: \texttrademark}
-\defineactivetoken 171 {\cyrillicDJE}
-\defineactivetoken 172 {\cyrillicdje}
-\defineactivetoken 174 {\'\cyrillicG}
-\defineactivetoken 175 {\'\cyrillicg}
-\defineactivetoken 180 {\cyrillicii}
-\defineactivetoken 183 {\cyrillicJE}
-\defineactivetoken 184 {\cyrillicIE}
-\defineactivetoken 185 {\cyrillicie}
-\defineactivetoken 186 {\cyrillicYI}
-\defineactivetoken 187 {\cyrillicyi}
-\defineactivetoken 188 {\cyrillicLJE}
-\defineactivetoken 189 {\cyrilliclje}
-\defineactivetoken 190 {\cyrillicNJE}
-\defineactivetoken 191 {\cyrillicnje}
-\defineactivetoken 192 {\cyrillicje}
-\defineactivetoken 193 {\cyrillicDZE}
-\defineactivetoken 196 {\textflorin} % Changed by V.F. 07/02/2003 (was: \florijn)
-\defineactivetoken 199 {\leftguillemot}
-\defineactivetoken 200 {\rightguillemot}
-\defineactivetoken 201 {\textellipsis} % Changed by V.F. 07/02/2003 (was: \dots)
-\defineactivetoken 202 {\nonbreakablespace}
-\defineactivetoken 203 {\cyrillicTSHE}
-\defineactivetoken 204 {\cyrillictshe}
-\defineactivetoken 205 {\'\cyrillicK}
-\defineactivetoken 206 {\'\cyrillick}
-\defineactivetoken 207 {\cyrillicdze}
-\defineactivetoken 208 {\endash}
-\defineactivetoken 209 {\emdash}
-\defineactivetoken 210 {\upperleftdoublesixquote} % Changed by V.F. 07/02/2003
- % (was: \upperleftsinglesixquote)
-\defineactivetoken 211 {\upperrightdoubleninequote}
-\defineactivetoken 212 {\upperleftsinglesixquote}
-\defineactivetoken 213 {\upperrightsingleninequote}
-\defineactivetoken 215 {\lowerleftdoubleninequote}
-\defineactivetoken 216 {\cyrillicUSHRT}
-\defineactivetoken 217 {\cyrillicushrt}
-\defineactivetoken 218 {\cyrillicDZHE}
-\defineactivetoken 219 {\cyrillicdzhe}
-\defineactivetoken 220 {\textnumero}
-\defineactivetoken 221 {\cyrillicYO}
-\defineactivetoken 222 {\cyrillicyo}
-\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 {\textcurrency}
-\defineactivetoken 173 {\mathematics{\neq}} % Added by V.F. 07/02/2003
-\defineactivetoken 176 {\mathematics{\infty}} % Added by V.F. 07/02/2003
-\defineactivetoken 177 {\textpm} % Added by V.F. 07/02/2003
-\defineactivetoken 178 {\mathematics{\leq}} % Added by V.F. 07/02/2003
-\defineactivetoken 179 {\mathematics{\geq}} % Added by V.F. 07/02/2003
-\defineactivetoken 181 {\textmu} % Added by V.F. 07/02/2003
-\defineactivetoken 182 {\mathematics{\partial}} % Added by V.F. 07/02/2003
-\defineactivetoken 194 {\textlognot} % Added by V.F. 07/02/2003
-\defineactivetoken 195 {\textsurd} % Added by V.F. 07/02/2003
-\defineactivetoken 197 {\mathematics{\approx}} % Added by V.F. 07/02/2003
-\defineactivetoken 198 {\mathematics{\Delta}} % Added by V.F. 07/02/2003
-\defineactivetoken 214 {\textdiv} % Added by V.F. 07/02/2003
-
-\stopregime
-
-\startregime[macukr]
-
-\defineactivetoken 128 {\cyrillicA}
-\defineactivetoken 129 {\cyrillicB}
-\defineactivetoken 130 {\cyrillicV}
-\defineactivetoken 131 {\cyrillicG}
-\defineactivetoken 132 {\cyrillicD}
-\defineactivetoken 133 {\cyrillicE}
-\defineactivetoken 134 {\cyrillicZH}
-\defineactivetoken 135 {\cyrillicZ}
-\defineactivetoken 136 {\cyrillicI}
-\defineactivetoken 137 {\cyrillicISHRT}
-\defineactivetoken 138 {\cyrillicK}
-\defineactivetoken 139 {\cyrillicL}
-\defineactivetoken 140 {\cyrillicM}
-\defineactivetoken 141 {\cyrillicN}
-\defineactivetoken 142 {\cyrillicO}
-\defineactivetoken 143 {\cyrillicP}
-\defineactivetoken 144 {\cyrillicR}
-\defineactivetoken 145 {\cyrillicS}
-\defineactivetoken 146 {\cyrillicT}
-\defineactivetoken 147 {\cyrillicU}
-\defineactivetoken 148 {\cyrillicF}
-\defineactivetoken 149 {\cyrillicH}
-\defineactivetoken 150 {\cyrillicC}
-\defineactivetoken 151 {\cyrillicCH}
-\defineactivetoken 152 {\cyrillicSH}
-\defineactivetoken 153 {\cyrillicSHCH}
-\defineactivetoken 154 {\cyrillicHRDSN}
-\defineactivetoken 155 {\cyrillicERY}
-\defineactivetoken 156 {\cyrillicSFTSN}
-\defineactivetoken 157 {\cyrillicEREV}
-\defineactivetoken 158 {\cyrillicYU}
-\defineactivetoken 159 {\cyrillicYA}
-\defineactivetoken 160 {\textdag} % Changed by V.F. 07/02/2003 (was: \dag)
-\defineactivetoken 161 {\textdegree}
-\defineactivetoken 162 {\cyrillicGUP}
-\defineactivetoken 163 {\textsterling} % Changed by V.F. 07/02/2003 (was: \sterling)
-\defineactivetoken 164 {\sectionmark} % Changed by V.F. 07/02/2003 (was: \S)
-\defineactivetoken 165 {\textbullet} % Changed by V.F. 07/02/2003 (was: \bullet}
-\defineactivetoken 166 {\paragraphmark} % Changed by V.F. 07/02/2003 (was: \P)
-\defineactivetoken 167 {\cyrillicII}
-\defineactivetoken 168 {\registered}
-\defineactivetoken 169 {\copyright}
-\defineactivetoken 170 {\trademark} % Changed by V.F. 07/02/2003 (was: \texttrademark}
-\defineactivetoken 171 {\cyrillicDJE}
-\defineactivetoken 172 {\cyrillicdje}
-\defineactivetoken 174 {\'\cyrillicG}
-\defineactivetoken 175 {\'\cyrillicg}
-\defineactivetoken 180 {\cyrillicii}
-\defineactivetoken 182 {\cyrillicgup}
-\defineactivetoken 183 {\cyrillicJE}
-\defineactivetoken 184 {\cyrillicIE}
-\defineactivetoken 185 {\cyrillicie}
-\defineactivetoken 186 {\cyrillicYI}
-\defineactivetoken 187 {\cyrillicyi}
-\defineactivetoken 188 {\cyrillicLJE}
-\defineactivetoken 189 {\cyrilliclje}
-\defineactivetoken 190 {\cyrillicNJE}
-\defineactivetoken 191 {\cyrillicnje}
-\defineactivetoken 192 {\cyrillicje}
-\defineactivetoken 193 {\cyrillicDZE}
-\defineactivetoken 196 {\textflorin} % Changed by V.F. 07/02/2003 (was: \florijn)
-\defineactivetoken 199 {\leftguillemot}
-\defineactivetoken 200 {\rightguillemot}
-\defineactivetoken 201 {\textellipsis} % Changed by V.F. 07/02/2003 (was: \dots)
-\defineactivetoken 202 {\nonbreakablespace}
-\defineactivetoken 203 {\cyrillicTSHE}
-\defineactivetoken 204 {\cyrillictshe}
-\defineactivetoken 205 {\'\cyrillicK}
-\defineactivetoken 206 {\'\cyrillick}
-\defineactivetoken 207 {\cyrillicdze}
-\defineactivetoken 208 {\endash}
-\defineactivetoken 209 {\emdash}
-\defineactivetoken 210 {\upperleftdoublesixquote} % Changed by V.F. 07/02/2003
- % (was: \upperleftsinglesixquote)
-\defineactivetoken 211 {\upperrightdoubleninequote}
-\defineactivetoken 212 {\upperleftsinglesixquote}
-\defineactivetoken 213 {\upperrightsingleninequote}
-\defineactivetoken 215 {\lowerleftdoubleninequote}
-\defineactivetoken 216 {\cyrillicUSHRT}
-\defineactivetoken 217 {\cyrillicushrt}
-\defineactivetoken 218 {\cyrillicDZHE}
-\defineactivetoken 219 {\cyrillicdzhe}
-\defineactivetoken 220 {\textnumero}
-\defineactivetoken 221 {\cyrillicYO}
-\defineactivetoken 222 {\cyrillicyo}
-\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 {\textcurrency}
-\defineactivetoken 173 {\mathematics{\neq}} % Added by V.F. 07/02/2003
-\defineactivetoken 176 {\mathematics{\infty}} % Added by V.F. 07/02/2003
-\defineactivetoken 177 {\textpm} % Added by V.F. 07/02/2003
-\defineactivetoken 178 {\mathematics{\leq}} % Added by V.F. 07/02/2003
-\defineactivetoken 179 {\mathematics{\geq}} % Added by V.F. 07/02/2003
-\defineactivetoken 181 {\textmu} % Added by V.F. 07/02/2003
-\defineactivetoken 194 {\textlognot} % Added by V.F. 07/02/2003
-\defineactivetoken 195 {\textsurd} % Added by V.F. 07/02/2003
-\defineactivetoken 197 {\mathematics{\approx}} % Added by V.F. 07/02/2003
-\defineactivetoken 198 {\mathematics{\Delta}} % Added by V.F. 07/02/2003
-\defineactivetoken 214 {\textdiv} % Added by V.F. 07/02/2003
-
-\stopregime
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/regi-def.mkii b/Master/texmf-dist/tex/context/base/mkii/regi-def.mkii
deleted file mode 100644
index 3af0c9d3c5d..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/regi-def.mkii
+++ /dev/null
@@ -1,21 +0,0 @@
-%D \module
-%D [ file=regi-def,
-%D version=2000.20.12, % split from less verbose base file
-%D title=\CONTEXT\ Regime Macros,
-%D subtitle=Default Character Definitions,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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[default]
-
-\dostepwiserecurse{128}{255}{1}
- {\expanded{\defineactivetoken\recurselevel\space{\rawcharacter\recurselevel}}}%
-
-\stopregime
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/regi-ibm.mkii b/Master/texmf-dist/tex/context/base/mkii/regi-ibm.mkii
deleted file mode 100644
index 5756e77054f..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/regi-ibm.mkii
+++ /dev/null
@@ -1,73 +0,0 @@
-%D \module
-%D [ file=regi-ibm,
-%D version=1995.01.01,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=The Good Old MSDOS IBM codepage,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 module activates the \cap{IBM PC} high \ASCII\
-%D characters, such as ‰ and á.
-
-\startregime [ibm]
-
-\defineactivetoken 145 {\aeligature} % ‘
-\defineactivetoken 146 {\AEligature} % ’
-\defineactivetoken 152 {\ijligature} % ˜
-
-\defineactivetoken 225 {\ssharp} % á
-
-\defineactivetoken 160 {\aacute} %  
-\defineactivetoken 130 {\eacute} % ‚
-\defineactivetoken 144 {\Eacute} %
-\defineactivetoken 161 {\iacute} % ¡
-\defineactivetoken 162 {\oacute} % ¢
-\defineactivetoken 163 {\uacute} % £
-
-\defineactivetoken 135 {\ccedilla} % ‡
-\defineactivetoken 128 {\Ccedilla} % €
-
-\defineactivetoken 132 {\adiaeresis} % „
-\defineactivetoken 142 {\Adiaeresis} % Ž
-\defineactivetoken 137 {\ediaeresis} % ‰
-\defineactivetoken 139 {\idiaeresis} % ‹
-\defineactivetoken 148 {\odiaeresis} % ”
-\defineactivetoken 153 {\Odiaeresis} % ™
-\defineactivetoken 129 {\udiaeresis} %
-\defineactivetoken 154 {\Udiaeresis} % š
-
-\defineactivetoken 164 {\ntilde} % ¤
-\defineactivetoken 165 {\Ntilde} % ¥
-
-\defineactivetoken 134 {\aring} % †
-\defineactivetoken 143 {\Aring} %
-
-\defineactivetoken 131 {\acircumflex} % ƒ
-\defineactivetoken 136 {\ecircumflex} % ˆ
-\defineactivetoken 140 {\icircumflex} % Œ
-\defineactivetoken 147 {\ocircumflex} % “
-\defineactivetoken 150 {\ucircumflex} % –
-
-\defineactivetoken 133 {\agrave} % …
-\defineactivetoken 138 {\egrave} % Š
-\defineactivetoken 141 {\igrave} %
-\defineactivetoken 149 {\ograve} % •
-\defineactivetoken 151 {\ugrave} % —
-
-\stopregime
-
-% todo
-
-\startregime [ibm]
-
-\defineactivetoken ® {\ifvmode\leavevmode\fi\leftguillemot\prewordbreak}
-\defineactivetoken ¯ {\prewordbreak\rightguillemot}
-
-\stopregime
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/regi-ini.mkii b/Master/texmf-dist/tex/context/base/mkii/regi-ini.mkii
deleted file mode 100644
index 1122ce18ac9..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/regi-ini.mkii
+++ /dev/null
@@ -1,248 +0,0 @@
-%D \module
-%D [ file=regi-ini,
-%D version=2000.12.27, % 1998.12.03,
-%D title=\CONTEXT\ Regime Macros,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Remark: regimes accumulate, so there is no explicit reset in
-%D mkii mode.
-
-%D Variables.
-
-\def\@reg@{@r@eg@} % regime prefix
-
-%D \macros
-%D {currentregime}
-
-\let\currentregime\empty
-\let\defaultregime\s!default
-
-%D Some low level inheritance stuff (mkii).
-
-\def\doautosetregime#1#2%
- {\ifnum#2>127
- \expanded{\defineactivetoken #2 \@EA\noexpand\csname#1\endcsname}%
- \fi}
-
-%D \macros
-%D {startregime}
-%D
-%D Sometimes it makes sense to activate the characters in the
-%D upper half of the character table. Such a bundle of
-%D characters can be packages in a regime. Later we will see
-%D encodings (that links characters slots to glyphs) and
-%D mappings (that take care of hyphenation and case changes).
-%D
-%D When character~231 is of category code letter, it
-%D directly maps to glyph~231 (unless of course some virtual
-%D font is used). By making character~231 active, we can map
-%D it onto for instance the glyph in slot 233. This mapping
-%D can in itself be indirect, in the sense that it is for
-%D instance handled by an accent command.
-%D
-%D Regimes are implemented roughly the same as mappings, but
-%D enabled under different circumstances. In the future, the
-%D low level implementation may change.
-
-\def\startregime[#1]%
- {\pushmacro\currentregime
- \edef\currentregime{#1}%
- \checkregimetoks}
-
-\def\checkregimetoks
- {\doifundefined{\@reg@\currentregime}
- {\@EA\newtoks\csname\@reg@\currentregime\endcsname}}
-
-\def\stopregime
- {\popmacro\currentregime}
-
-\def\setregimetoks
- {\checkregimetoks
- \@EA\let\@EA\regimetoks\csname\@reg@\currentregime\endcsname}
-
-%D \macros
-%D {defineactivedecimal, defineactivedecimals, defineactivetoken}
-%D
-%D The following commands are rather ugly ones. It makes a
-%D character active and assigns it a value. When expanded,
-%D the decimal number of the character is passed as first
-%D argument.
-%D
-%D \starttyping
-%D \def\decimalcharacter#1{\message{#1 is now active}}
-%D
-%D \defineactivedecimal 122 {\decimalcharacter}
-%D
-%D \defineactivedecimals 128 to 255 as {\decimalcharacter}
-%D \stoptyping
-%D
-%D This command is typically used in coding definitions,
-%D like the \UNICODE\ one.
-
-\def\dodefineactivedecimal#1#2% \unexpanded ? pdfdoc encoding
- {\catcode#1\active
- \scratchcounter\uccode\activehackcode
- \uccode\activehackcode#1\relax
- \uppercase{\unexpanded\edef~{\noexpand#2{\number#1}}}%
- \uccode\activehackcode\scratchcounter}
-
-\long\def\defineactivedecimal#1 #2 %
- {\setregimetoks
- \regimetoks\expandafter{\the\regimetoks\dodefineactivedecimal{#1}{#2}}}
-
-\long\def\defineactivedecimals#1 to #2 as #3 %
- {\setregimetoks
- \dostepwiserecurse{#1}{#2}\plusone
- {\regimetoks\@EA\@EA\@EA{\@EA\the\@EA\regimetoks\@EA\dodefineactivedecimal\@EA{\recurselevel}{#3}}}}
-
-\def\doexpandactivedecimal#1%
- {\ifnum#1>\scratchcounter
- \expandafter\gobbletwoarguments
- \else
- \noexpand\dodefineactivedecimal{#1}{\the\scratchtoks}%
- \expandafter\expandafter\expandafter\doexpandactivedecimal\expandafter
- \fi\expandafter{\the\numexpr#1+\plusone\relax}}
-
-\long\def\defineactivedecimals#1 to #2 as #3 %
- {\setregimetoks
- \scratchcounter#2\relax
- \scratchtoks{#3}%
- \expanded{\regimetoks{\the\regimetoks\doexpandactivedecimal{#1}}}%
- \ignorespaces}
-
-\long\def\defineactivetoken #1 #2% no {} after #2, else no kern
- {\setregimetoks
- \regimetoks\expandafter{\the\regimetoks\defineactivecharacter#1 {#2}}}
-
-\long\def\defineactiveinspector #1 #2% watch the missing {}
- {\setregimetoks
- \regimetoks\expandafter{\the\regimetoks\defineactivecharacter#1 {#2}}}
-
-%D \macros
-%D {defineregimesynonym,trueregimename}
-
-\def\defineregimesynonym
- {\dodoubleargument\dodefineregimesynonym}
-
-\def\dodefineregimesynonym[#1][#2]%
- {\setevalue{\@reg@:s:#1}{#2}}
-
-\def\trueregimename#1%
- {\executeifdefined{\@reg@:s:#1}{#1}}
-
-%D \macros
-%D {useregime}
-
-\def\useregime[#1]%
- {\processcommalist[#1]\douseregime}
-
-\def\douseregime#1%
- {\doifundefined{\c!file\f!regimeprefix#1}%
- {\letgvalue{\c!file\f!regimeprefix#1}\empty
- \makeshortfilename[\truefilename{\f!regimeprefix#1}]%
- \startreadingfile
- \readsysfile{\shortfilename.mkii}
- {\showmessage\m!regimes2{#1}}
- {\showmessage\m!regimes3{#1}}%
- \stopreadingfile}}
-
-%D \macros
-%D {enableregime,disableregime}
-
-\let\enabledregime\empty
-
-\def\enableregime[#1]%
- {\edef\currentregime{\trueregimename{#1}}%
- \doifelsenothing\currentregime
- {\disableregime}
- {\douseregime\currentregime
- \the\executeifdefined{\@reg@\currentregime}\emptytoks}}
-
-\def\disableregime
- {\let\currentregime\empty}
-
-%D \macros
-%D {protectregime, settoletterunlessactive, settocodeunlessactive}
-%D
-%D The next boolean is used later on to prevent unwanted
-%D catcode changes. Use it with care.
-
-\newif\ifprotectregime \protectregimetrue
-
-\def\settoletterunlessactive#1%
- {\ifprotectregime\ifnum\catcode#1=\active\else
- \catcode#1\@@letter
- \fi\else
- \catcode#1\@@letter
- \fi}
-
-\def\settootherunlessactive#1%
- {\ifprotectregime\ifnum\catcode#1=\active\else
- \catcode#1=\@@other
- \fi\else
- \catcode#1=\@@other
- \fi}
-
-\def\settocodeunlessactive#1#2%
- {\ifprotectregime\ifnum\catcode#1=\active\else
- \catcode#1=#2\relax
- \fi\else
- \catcode#1=#2\relax
- \fi}
-
-%D Goodie:
-
-\def\showregime[#1]%
- {\doifnot{#1}{utf}
- {\bgroup
- \enableregime[#1]%
- \starttabulate[|l|l|l|]
- \dostepwiserecurse{128}{255}{1}
- {\expanded
- {\scantokens
- {\NC \recurselevel
- \NC \rawcharacter\recurselevel
- \NC \noexpand\tttf
- \noexpand\meaning\rawcharacter\recurselevel \NC \NR}}}%
- \stoptabulate
- \unskip
- \egroup}}
-
-%D Sort related:
-
-\def\dowalkregime#1%
- {\the\executeifdefined{\@reg@#1}\emptytoks}
-
-%D Simplify matters for \XETEX.
-
-\ifnum\texengine=\xetexengine
-
- \def\enableregime[#1]%
- {\doifelse{#1}{utf}%
- {\writestatus\m!regimes{mapping utf to utf-8}%
- \XeTeXinputencoding{utf-8}}
- {\XeTeXinputencoding{#1}}}
-
- \def\disableregime
- {\XeTeXinputencoding{utf-8}}
-
- \def\loadregime[#1]{}
- \let\walkregime \gobbleoneargument
- \let\doautosetregime \gobbletwoarguments
-
-\else
-
- \useregime[def,uni,utf] % we load the rest runtime
-
-\fi
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/regi-mac.mkii b/Master/texmf-dist/tex/context/base/mkii/regi-mac.mkii
deleted file mode 100644
index 30f57ab18cb..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/regi-mac.mkii
+++ /dev/null
@@ -1,147 +0,0 @@
-%D \module
-%D [ file=regi-mac,
-%D version=2001.03.18,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=Mac Encoding,
-%D author={Michel Bovani \& Adam Lindsay \& Hans Hagen},
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 [mac]
-
-\defineactivetoken 128 {\Adiaeresis}
-\defineactivetoken 129 {\Aring}
-\defineactivetoken 130 {\Ccedilla}
-\defineactivetoken 131 {\Eacute}
-\defineactivetoken 132 {\Ntilde}
-\defineactivetoken 133 {\Odiaeresis}
-\defineactivetoken 134 {\Udiaeresis}
-\defineactivetoken 135 {\aacute}
-\defineactivetoken 136 {\agrave}
-\defineactivetoken 137 {\acircumflex}
-\defineactivetoken 138 {\adiaeresis}
-\defineactivetoken 139 {\atilde}
-\defineactivetoken 140 {\aring}
-\defineactivetoken 141 {\ccedilla}
-\defineactivetoken 142 {\eacute}
-\defineactivetoken 143 {\egrave}
-\defineactivetoken 144 {\ecircumflex}
-\defineactivetoken 145 {\ediaeresis}
-\defineactivetoken 146 {\iacute}
-\defineactivetoken 147 {\igrave}
-\defineactivetoken 148 {\icircumflex}
-\defineactivetoken 149 {\idiaeresis}
-\defineactivetoken 150 {\ntilde}
-\defineactivetoken 151 {\oacute}
-\defineactivetoken 152 {\ograve}
-\defineactivetoken 153 {\ocircumflex}
-\defineactivetoken 154 {\odiaeresis}
-\defineactivetoken 155 {\otilde}
-\defineactivetoken 156 {\uacute}
-\defineactivetoken 157 {\ugrave}
-\defineactivetoken 158 {\ucircumflex}
-\defineactivetoken 159 {\udiaeresis}
-\defineactivetoken 160 {\textdag}
-\defineactivetoken 161 {\textdegree}
-\defineactivetoken 162 {\textcent}
-\defineactivetoken 163 {\textsterling}
-\defineactivetoken 164 {\sectionmark}
-\defineactivetoken 165 {\textbullet}
-\defineactivetoken 166 {\paragraphmark}
-\defineactivetoken 167 {\ssharp}
-\defineactivetoken 168 {\registered}
-\defineactivetoken 169 {\copyright}
-\defineactivetoken 170 {\trademark}
-\defineactivetoken 171 {\textacute}
-\defineactivetoken 172 {\textdiaeresis}
-\defineactivetoken 173 {\mathematics\neq}
-\defineactivetoken 174 {\AEligature}
-\defineactivetoken 175 {\Ostroke}
-\defineactivetoken 176 {\mathematics\infty}
-\defineactivetoken 177 {\textpm}
-\defineactivetoken 178 {\mathematics\leq}
-\defineactivetoken 179 {\mathematics\geq}
-\defineactivetoken 180 {\textyen}
-\defineactivetoken 181 {\textmu}
-\defineactivetoken 182 {\mathematics\partial}
-\defineactivetoken 183 {\mathematics\Sigma}
-\defineactivetoken 184 {\mathematics\Pi}
-\defineactivetoken 185 {\mathematics\pi}
-\defineactivetoken 186 {\mathematics\smallint}
-\defineactivetoken 187 {\ordfeminine}
-\defineactivetoken 188 {\ordmasculine}
-\defineactivetoken 189 {\mathematics\Omega}
-\defineactivetoken 190 {\aeligature}
-\defineactivetoken 191 {\ostroke}
-\defineactivetoken 192 {\questiondown}
-\defineactivetoken 193 {\exclamdown}
-\defineactivetoken 194 {\textlognot}
-\defineactivetoken 195 {\mathematics{\sqrt{}}}
-\defineactivetoken 196 {\textflorin}
-\defineactivetoken 197 {\mathematics\approx}
-\defineactivetoken 198 {\mathematics\Delta}
-\defineactivetoken 199 {\leftguillemot}
-\defineactivetoken 200 {\rightguillemot}
-\defineactivetoken 201 {\dots}
-\defineactivetoken 202 {\nonbreakablespace}
-\defineactivetoken 203 {\Agrave}
-\defineactivetoken 204 {\Atilde}
-\defineactivetoken 205 {\Otilde}
-\defineactivetoken 206 {\OEligature}
-\defineactivetoken 207 {\oeligature}
-\defineactivetoken 208 {\endash}
-\defineactivetoken 209 {\emdash}
-\defineactivetoken 210 {\quotedblleft}
-\defineactivetoken 211 {\quotedblright}
-\defineactivetoken 212 {\quoteleft}
-\defineactivetoken 213 {\quoteright}
-\defineactivetoken 214 {\textdiv}
-\defineactivetoken 215 {\mathematics\diamond}
-\defineactivetoken 216 {\ydiaeresis}
-\defineactivetoken 217 {\Ydiaeresis}
-\defineactivetoken 218 {\textfraction}
-\defineactivetoken 219 {\texteuro}
-\defineactivetoken 220 {\guilsingleleft}
-\defineactivetoken 221 {\guilsingleright}
-\defineactivetoken 222 {fi}
-\defineactivetoken 223 {fl}
-\defineactivetoken 224 {\textddag}
-\defineactivetoken 225 {\periodcentered}
-\defineactivetoken 226 {\quotesinglebase}
-\defineactivetoken 227 {\quotedblbase }
-\defineactivetoken 228 {\perthousand}
-\defineactivetoken 229 {\Acircumflex}
-\defineactivetoken 230 {\Ecircumflex}
-\defineactivetoken 231 {\Aacute}
-\defineactivetoken 232 {\Ediaeresis}
-\defineactivetoken 233 {\Egrave}
-\defineactivetoken 234 {\Iacute}
-\defineactivetoken 235 {\Icircumflex}
-\defineactivetoken 236 {\Idiaeresis}
-\defineactivetoken 237 {\Igrave}
-\defineactivetoken 238 {\Oacute}
-\defineactivetoken 239 {\Ocircumflex}
-%defineactivetoken 240 % No definition for Apple logo glyph yet.
-\defineactivetoken 241 {\Ograve}
-\defineactivetoken 242 {\Uacute}
-\defineactivetoken 243 {\Ucircumflex}
-\defineactivetoken 244 {\Ugrave}
-\defineactivetoken 245 {\dotlessi}
-\defineactivetoken 246 {\textcircumflex}
-\defineactivetoken 247 {\texttilde}
-\defineactivetoken 248 {\textmacron}
-\defineactivetoken 249 {\textbreve}
-\defineactivetoken 250 {\textdotaccent}
-\defineactivetoken 251 {\textring}
-\defineactivetoken 252 {\textcedilla}
-\defineactivetoken 253 {\texthungarumlaut}
-\defineactivetoken 254 {\textogonek}
-\defineactivetoken 255 {\textcaron}
-
-\stopregime
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/regi-syn.mkii b/Master/texmf-dist/tex/context/base/mkii/regi-syn.mkii
deleted file mode 100644
index 09fd59deeb5..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/regi-syn.mkii
+++ /dev/null
@@ -1,73 +0,0 @@
-%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 ADE \& \CONTEXT\ Development Team}]
-%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] [8859-1]
-\defineregimesynonym [il2] [8859-2]
-\defineregimesynonym [il3] [8859-3]
-\defineregimesynonym [il4] [8859-4]
-\defineregimesynonym [il5] [8859-9]
-\defineregimesynonym [il6] [8859-10]
-\defineregimesynonym [il7] [8859-13]
-%defineregimesynonym [il8] [8859-14]
-\defineregimesynonym [il9] [8859-15]
-\defineregimesynonym [il10] [8859-16]
-
-\defineregimesynonym [iso-8859-1] [8859-1]
-\defineregimesynonym [iso-8859-2] [8859-2]
-\defineregimesynonym [iso-8859-3] [8859-3]
-\defineregimesynonym [iso-8859-4] [8859-4]
-\defineregimesynonym [iso-8859-9] [8859-9]
-\defineregimesynonym [iso-8859-10] [8859-10]
-\defineregimesynonym [iso-8859-13] [8859-13]
-%defineregimesynonym [iso-8859-14] [8859-14]
-\defineregimesynonym [iso-8859-15] [8859-15]
-\defineregimesynonym [iso-8859-16] [8859-16]
-
-\defineregimesynonym [latin1] [8859-1]
-\defineregimesynonym [latin2] [8859-2]
-\defineregimesynonym [latin3] [8859-3]
-\defineregimesynonym [latin4] [8859-4]
-\defineregimesynonym [latin5] [8859-9]
-\defineregimesynonym [latin6] [8859-10]
-\defineregimesynonym [latin7] [8859-13]
-%defineregimesynonym [latin8] [8859-14]
-\defineregimesynonym [latin9] [8859-15]
-\defineregimesynonym [latin10] [8859-16]
-
-% kind of special
-
-\defineregimesynonym [utf-8] [utf]
-\defineregimesynonym [utf8] [utf]
-
-% for historical reasons / compatibility
-
-\defineregimesynonym [windows] [cp1252]
-\defineregimesynonym [grk] [8859-7]
-\defineregimesynonym [iso88595] [8859-5]
-
-\protect \endinput
-
diff --git a/Master/texmf-dist/tex/context/base/mkii/regi-uni.mkii b/Master/texmf-dist/tex/context/base/mkii/regi-uni.mkii
deleted file mode 100644
index fe2f99a4f2d..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/regi-uni.mkii
+++ /dev/null
@@ -1,24 +0,0 @@
-%D \module
-%D [ file=enco-uni,
-%D version=1998.10.18,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=Unicode,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 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]
-
-\defineactivedecimals 128 to 255 as {\handleunicodeflowglyph}
-
-\stopregime
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/regi-utf.mkii b/Master/texmf-dist/tex/context/base/mkii/regi-utf.mkii
deleted file mode 100644
index 09926a17231..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/regi-utf.mkii
+++ /dev/null
@@ -1,52 +0,0 @@
-%D \module
-%D [ file=regi-utf,
-%D version=2002.12.03,
-%D title=\CONTEXT\ Encoding Macros,
-%D subtitle=UTF-8,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\ifnum\texengine>\pdftexengine
- \expandafter \endinput
-\fi
-
-%D This regime activates the characters $>192$ and let them
-%D handle \UTF\ encoded content streams. This regime runs on
-%D top of the \type {unic} modules. We use an active inspector
-%D instead of a active token handler because here we don't want
-%D the \type {{}}. We only support this in \ETEX.
-
-% ÀÃÂÃÄÅàáâãäå
-% ÆÇæç
-% ÈÉÊËèéêë
-% ÃŒÃÃŽÃÞìíîïþ
-% Ãð
-% Ññ
-% ÒÓÔÕÖòóôõö
-% Øø
-% ÙÚÛÜùúûü
-% Ãýÿ
-% ß
-% Ţţ
-
-\unprotect
-
-\startregime[utf]
-
-\dostepwiserecurse{192}{223}{1}
- {\expanded{\defineactiveinspector{\recurselevel} {\noexpand\utftwouniglph {\recurselevel}}}} % space delimited
-
-\dostepwiserecurse{224}{239}{1}
- {\expanded{\defineactiveinspector{\recurselevel} {\noexpand\utfthreeuniglph{\recurselevel}}}} % space delimited
-
-\dostepwiserecurse{240}{247}{1}
- {\expanded{\defineactiveinspector{\recurselevel} {\noexpand\utffouruniglph {\recurselevel}}}} % space delimited
-
-\stopregime
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/regi-vis.mkii b/Master/texmf-dist/tex/context/base/mkii/regi-vis.mkii
deleted file mode 100644
index 1807bdc93df..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/regi-vis.mkii
+++ /dev/null
@@ -1,158 +0,0 @@
-%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 \& \CONTEXT\ Development Team}]
-%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 VISCII input encoding (regime) for Vietnamese.
-%D
-%D Usage:
-%D \type{\enableregime[vis]}
-
-
-\startregime[viscii]
-
-\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
-
diff --git a/Master/texmf-dist/tex/context/base/mkii/scrn-fld.mkii b/Master/texmf-dist/tex/context/base/mkii/scrn-fld.mkii
deleted file mode 100644
index 993b510ea4b..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/scrn-fld.mkii
+++ /dev/null
@@ -1,1247 +0,0 @@
-%D \module
-%D [ file=scrn-fld,
-%D version=1997.05.18,
-%D title=\CONTEXT\ Screen Macros,
-%D subtitle=Fields,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% \appendtocommalist versus \addtocommalist
-%
-% * as default trigger in radiofields ?
-%
-% beware: weblink plugin truncates on length, while save as doesn't;
-% more precise: (1) first time right string is sent, (2)
-% internal string truncated, (3) second time truncated
-% string is sent.
-
-\writestatus{loading}{ConTeXt Screen Macros / Fields}
-
-% messages
-
-\definemessageconstant{fields}
-
-\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%
- {\getobject{SYM}{#1}}
-
-\def\dopresetfieldsymbol#1%
- {\checkobjectreferences
- \doifobjectfoundelse{SYM}{#1}
- {}
- {\settightobject{SYM}{#1}\hbox{\symbol[#1]}%
- \flushatshipout
- {\setbox0\hbox{\hskip-\maxdimen\getobject{SYM}{#1}}%
- \smashbox0\box0}}}
-
-\def\presetfieldsymbols[#1]% slow
- {\def\dopresetfieldsymbols##1%
- {\processcommalist[##1]\dopresetfieldsymbol}%
- \@EA\processcommalist\@EA[#1]\dopresetfieldsymbols}
-
-\def\definedefaultsymbols
- {\definesymbol[defaultyes][$\times$]%
- \definesymbol[defaultno][$\cdot$]}
-
-\def\resetfieldsymbol[#1]% for experimental usage only
- {\resetobject{SYM}{#1}}
-
-%D The interface to the specials. DEFAULT NOG ANDERS
-
-\def\preparefieldvariables % evt \def's at the outer level (test) or \edef's here for fast testing
- {\let\@@DriverFieldNumber \@@fdn
- \let\@@DriverFieldStyle \@@fdstyle
- \let\@@DriverFieldColor \@@fdcolor
- \let\@@DriverFieldBackgroundColor\@@fdfieldbackgroundcolor
- \let\@@DriverFieldFrameColor \@@fdfieldframecolor
- \let\@@DriverFieldLayer \@@fdfieldlayer
- \let\@@DriverFieldOption \@@fdoption
- \let\@@DriverFieldAlign \@@fdalign
- \let\@@DriverFieldClickIn \@@fdclickin
- \let\@@DriverFieldClickOut \@@fdclickout
- \let\@@DriverFieldRegionIn \@@fdregionin
- \let\@@DriverFieldRegionOut \@@fdregionout
- \let\@@DriverFieldAfterKey \@@fdafterkey
- \let\@@DriverFieldFormat \@@fdformat
- \let\@@DriverFieldValidate \@@fdvalidate
- \let\@@DriverFieldCalculate \@@fdcalculate
- \let\@@DriverFieldFocusIn \@@fdfocusin
- \let\@@DriverFieldFocusOut \@@fdfocusout}
-
-% todo : remove arguments, consider DriverField a namespace
-
-\def\presetlinefield
- {\preparefieldvariables
- \dopresetlinefield
- {\@@DriverFieldName}
- {\@@DriverFieldWidth}
- {\@@DriverFieldHeight}
- {\@@DriverFieldDefault}
- {\@@DriverFieldNumber}
- {\@@DriverFieldStyle,\@@DriverFieldColor,\@@DriverFieldBackgroundColor,\@@DriverFieldFrameColor}
- {\@@DriverFieldOption}
- {\@@DriverFieldAlign}
- {\@@DriverFieldClickIn,\@@DriverFieldClickOut,\@@DriverFieldRegionIn,\@@DriverFieldRegionOut,%
- \@@DriverFieldAfterKey,\@@DriverFieldFormat,\@@DriverFieldValidate,\@@DriverFieldCalculate,%
- \@@DriverFieldFocusIn,\@@DriverFieldFocusOut}}
-
-\def\presettextfield
- {\preparefieldvariables
- \dopresettextfield
- {\@@DriverFieldName}
- {\@@DriverFieldWidth}
- {\@@DriverFieldHeight}
- {\@@DriverFieldDefault}
- {\@@DriverFieldNumber}
- {\@@DriverFieldStyle,\@@DriverFieldColor,\@@DriverFieldBackgroundColor,\@@DriverFieldFrameColor}
- {\@@DriverFieldOption}
- {\@@DriverFieldAlign}
- {\@@DriverFieldClickIn,\@@DriverFieldClickOut,\@@DriverFieldRegionIn,\@@DriverFieldRegionOut,%
- \@@DriverFieldAfterKey,\@@DriverFieldFormat,\@@DriverFieldValidate,\@@DriverFieldCalculate,%
- \@@DriverFieldFocusIn,\@@DriverFieldFocusOut}}
-
-\def\presetchoicefield
- {\preparefieldvariables
- \dopresetchoicefield
- {\@@DriverFieldName}
- {\@@DriverFieldWidth}
- {\@@DriverFieldHeight}
- {\@@DriverFieldDefault}
- {\@@DriverFieldStyle,\@@DriverFieldColor,\@@DriverFieldBackgroundColor,\@@DriverFieldFrameColor}
- {\@@DriverFieldOption}
- {\@@DriverFieldValues}
- {\@@DriverFieldClickIn,\@@DriverFieldClickOut,\@@DriverFieldRegionIn,\@@DriverFieldRegionOut,%
- \@@DriverFieldAfterKey,\@@DriverFieldFormat,\@@DriverFieldValidate,\@@DriverFieldCalculate,%
- \@@DriverFieldFocusIn,\@@DriverFieldFocusOut}}
-
-\def\presetpopupfield
- {\preparefieldvariables
- \dopresetpopupfield
- {\@@DriverFieldName}
- {\@@DriverFieldWidth}
- {\@@DriverFieldHeight}
- {\@@DriverFieldDefault}
- {\@@DriverFieldStyle,\@@DriverFieldColor,\@@DriverFieldBackgroundColor,\@@DriverFieldFrameColor}
- {\@@DriverFieldOption}
- {\@@DriverFieldValues}
- {\@@DriverFieldClickIn,\@@DriverFieldClickOut,\@@DriverFieldRegionIn,\@@DriverFieldRegionOut,%
- \@@DriverFieldAfterKey,\@@DriverFieldFormat,\@@DriverFieldValidate,\@@DriverFieldCalculate,%
- \@@DriverFieldFocusIn,\@@DriverFieldFocusOut}}
-
-\def\presetcombofield
- {\preparefieldvariables
- \dopresetcombofield
- {\@@DriverFieldName}
- {\@@DriverFieldWidth}
- {\@@DriverFieldHeight}
- {\@@DriverFieldDefault}
- {\@@DriverFieldStyle,\@@DriverFieldColor,\@@DriverFieldBackgroundColor,\@@DriverFieldFrameColor}
- {\@@DriverFieldOption}
- {\@@DriverFieldValues}
- {\@@DriverFieldClickIn,\@@DriverFieldClickOut,\@@DriverFieldRegionIn,\@@DriverFieldRegionOut,%
- \@@DriverFieldAfterKey,\@@DriverFieldFormat,\@@DriverFieldValidate,\@@DriverFieldCalculate,%
- \@@DriverFieldFocusIn,\@@DriverFieldFocusOut}}
-
-\def\presetcheckfield
- {\preparefieldvariables
- \presetfieldsymbols[\@@DriverFieldValues]%
- \dopresetcheckfield
- {\@@DriverFieldName}
- {\@@DriverFieldWidth}
- {\@@DriverFieldHeight}
- {\@@DriverFieldDefault}
- {\@@DriverFieldOption}
- {\@@DriverFieldValues}
- {\@@DriverFieldClickIn,\@@DriverFieldClickOut,\@@DriverFieldRegionIn,\@@DriverFieldRegionOut,%
- \@@DriverFieldAfterKey,\@@DriverFieldFormat,\@@DriverFieldValidate,\@@DriverFieldCalculate,%
- \@@DriverFieldFocusIn,\@@DriverFieldFocusOut}}
-
-\def\presetpushfield
- {\preparefieldvariables
- %\edef\@@DriverFieldValues{{\@@DriverFieldValues}}% makes sure {a,b,c} is passed
- \presetfieldsymbols[\@@DriverFieldValues]%
- \dopresetpushfield
- {\@@DriverFieldName}
- {\@@DriverFieldWidth}
- {\@@DriverFieldHeight}
- {\@@DriverFieldDefault}
- {\@@DriverFieldOption}
- {\@@DriverFieldValues}
- {\@@DriverFieldClickIn,\@@DriverFieldClickOut,\@@DriverFieldRegionIn,\@@DriverFieldRegionOut,%
- \@@DriverFieldAfterKey,\@@DriverFieldFormat,\@@DriverFieldValidate,\@@DriverFieldCalculate,%
- \@@DriverFieldFocusIn,\@@DriverFieldFocusOut}}
-
-\def\presetradiofield
- {\preparefieldvariables
- \presetfieldsymbols[\@@DriverFieldValues]%
- \dopresetradiofield
- {\@@DriverFieldName}
- {\@@DriverFieldWidth}
- {\@@DriverFieldHeight}
- {\@@DriverFieldDefault}
- {\@@DriverFieldOption}
- {\@@DriverFieldRoot}
- {\@@DriverFieldValues}
- {\@@DriverFieldClickIn,\@@DriverFieldClickOut,\@@DriverFieldRegionIn,\@@DriverFieldRegionOut,%
- \@@DriverFieldAfterKey,\@@DriverFieldFormat,\@@DriverFieldValidate,\@@DriverFieldCalculate,%
- \@@DriverFieldFocusIn,\@@DriverFieldFocusOut}}
-
-\def\presetradiorecord
- {\preparefieldvariables
- \dopresetradiorecord
- {\@@DriverFieldName}
- {\@@DriverFieldDefault}
- {\@@DriverFieldOption}
- {\@@DriverFieldKids}
- {\@@DriverFieldClickIn,\@@DriverFieldClickOut,\@@DriverFieldRegionIn,\@@DriverFieldRegionOut,%
- \@@DriverFieldAfterKey,\@@DriverFieldFormat,\@@DriverFieldValidate,\@@DriverFieldCalculate,%
- \@@DriverFieldFocusIn,\@@DriverFieldFocusOut}}
-
-\def\setfieldmodes#1#2#3%
- {\xdef\@@DriverFieldMode{#1}% % 0 1 2 3
- \xdef\@@DriverFieldFree{#2}% % 0 1
- \xdef\@@DriverFieldAuto{#3}} % 0 1
-
-\newevery\everysetfield\relax
-
-\def\doiffieldelse#1{\doifdefinedelse{fielddata#1}}
-
-\def\setfield#1#2#3#4#5#6#7#8#9%
- {\bgroup
- \doglobal\increment\numberoffields
- \iftracefields
- \doglobal\addtocommalist{#1}\collectedfields
- \fi
- \the\everysetfield
- \setxvalue{fielddata#1}% kortere tag #7 needs expansion etc
- {\noexpand\dosetfield{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}%
- \egroup}
-
-\def\dosetfield#1#2#3#4#5#6#7#8#9%
- {\xdef\@@DriverFieldName {#1}%
- \xdef\@@DriverFieldType {#2}%
- \xdef\@@DriverFieldRoot {#3}%
- \xdef\@@DriverFieldParent {#4}%
- \xdef\@@DriverFieldKids {#5}%
- \xdef\@@DriverFieldGroup {#6}%
- \setfieldmodes #7%
- \bgroup
- \def\par{\string\n\string\n}%
- \xdef\@@DriverFieldValues {#8}%
- \xdef\@@DriverFieldDefault{#9}%
- \egroup}
-
-\def\changefield#1%
- {\setfield{#1}\@@DriverFieldType\@@DriverFieldRoot\@@DriverFieldParent\@@DriverFieldKids\@@DriverFieldGroup
- {\@@DriverFieldMode\@@DriverFieldFree\@@DriverFieldAuto}\@@DriverFieldValues\@@DriverFieldDefault}
-
-\def\getfield#1% name
- {\doifundefinedelse{fielddata#1}
- {\dosetfield{#1}\empty\empty\empty\empty\empty{\empty00}\empty\empty}
- {\getvalue{fielddata#1}}}
-
-\newif\iftracefields \tracefieldsfalse
-
-\let\tracefields\tracefieldstrue
-
-\def\doshowfields[#1]% todo: tabulate van maken en runtime
- {\bgroup
- \switchtobodyfont[8pt,tt]%
- \doifsomething{#1}{\def\collectedfields{#1}}%
- \ifx\collectedfields\empty
- \par specify [fieldlist] or say \type{\tracefieldstrue} first\par
- \else
- \def\normalizedfieldmode##1##2##3%
- {\ifcase0##2 \else\sl\fi
- \ifcase0##1 loner\or parent\or clone\or copy\fi}%
- \def\dosetfield##1##2##3##4##5##6##7##8##9%
- {##1&##2&##3&##4&##5&##6&\normalizedfieldmode##7&##8&##9\cr}%
- \halign
- {&##\strut\hss\quad\cr
- \noalign{\hrule}%
- NAME &TYPE &ROOT &
- PARENT&KIDS &GROUP &
- MODE &VALUES&DEFAULT\cr
- \noalign{\hrule}%
- \@EA\globalprocesscommalist\@EA[\collectedfields]\getfield
- \noalign{\hrule}}%
- \fi
- \egroup}
-
-\def\showfields
- {\dosingleempty\doshowfields}
-
-\def\dologfields[#1]%
- {\bgroup
- \immediate\openout\scratchwrite=fields.log
- \doifsomething{#1}{\def\collectedfields{#1}}%
- \ifx\colledtedfields\empty
- \immediate\write\scratchwrite{use \tracefieldstrue}%
- \else
- \def\normalizedfieldmode##1##2##3%
- {\edef\@@DriverFieldMode
- {\ifcase##1 loner \or parent \or clone \or copy \fi
- \ifcase##2 \else(done)\fi}}%
- \def\dosetfield##1##2##3##4##5##6##7##8##9%
- {\normalizedfieldmode##7%
- \immediate\write\scratchwrite
- {N=##1 / T=##2 / R=##3 / P=##4 / K=##5 / G=##6 /
- M=\@@DriverFieldMode\space/ V=##8 / D=##9}}%
- \processcommacommand[\collectedfields]\getfield
- \fi
- \immediate\closeout\scratchwrite
- \egroup}
-
-\def\logfields
- {\dosingleempty\doLogFields}
-
-%D \starttyping
-%D \definefield [name] [type] [group] [values] [default]
-%D
-%D \definefield [WWWW] [text] [textsetup] [default text]
-%D \definefield [XXXX] [push] [pushsetup] [yes,no] [yes]
-%D \definefield [XXXX] [check] [checksetup] [yes,no] [yes]
-%D \definefield [YYYY] [combo] [combosetup] [a,b,c,d] [b]
-%D \definefield [ZZZZ] [radio] [radiosetup] [W,X,Y,Z] [Y]
-%D
-%D \definesubfield [W] [subsetup] [p,q]
-%D \definesubfield [X,Y] [subsetup] [p,r]
-%D \definesubfield [Z] [subsetup] [y,z]
-%D
-%D evt \definemainfield ... wanneer geplaatst voor subs gegeven
-%D
-%D \clonefield [XXXX] [XX,YY] [mysetup] [on,off]
-%D \clonefield [Z] [AA,BB] [somesetup] [true,false]
-%D \clonefield [Z] [CC,DD] [anothersetup]
-%D
-%D \copyfield [XXXX] [PP,QQ,RR]
-%D
-%D \field[XXXX]
-%D \fitfield[XXXX]
-%D \stoptyping
-%D
-%D Beware, in \MKII\ we don't support autocloning for radiofields.
-
-\newif\ifdefinemainfield \definemainfieldfalse
-
-%D We need to keep track of cloned (related) fields and so by
-%D maintaining lists of field clones.
-%D
-%D The first alternative used a two pass data list and was
-%D implemented as follows:
-%D
-%D \starttyping
-%D \def\getmainfieldkids#1%
-%D {\let\@@DriverFieldKids\empty
-%D \ifdefinemainfield
-%D \definetwopasslist{fld:#1}% defined by system
-%D \doloop
-%D {\gettwopassdata{fld:#1}%
-%D \iftwopassdatafound
-%D %\addtocommalist\twopassdata\@@DriverFieldKids
-%D \appendtocommalist\twopassdata\@@DriverFieldKids
-%D \else
-%D \exitloop
-%D \fi}%
-%D \fi}
-%D \stoptyping
-%D
-%D However, the next alternative is much faster when we have
-%D a field with thousands of clones, something not that
-%D imaginary.
-%D
-%D \starttyping
-%D \def\getmainfieldkids#1%
-%D {\let\@@DriverFieldKids\empty
-%D \ifdefinemainfield
-%D \definetwopasslist{fld:#1}% runtime defined by system
-%D \getnamedtwopassdatalist{fld:#1}\@@DriverFieldKids
-%D \fi}
-%D \stoptyping
-%D
-%D The data is written by file using:
-%D
-%D \starttyping
-%D \newcounter\nofmainfieldkids
-%D
-%D \def\setmainfieldkid#1#2%
-%D {\doglobal\increment\nofmainfieldkids
-%D \savetwopassdata{fld:#1}{\nofmainfieldkids}{#2}}
-%D \stoptyping
-%D
-%D The trade of of this mechanism is that for each cloned or
-%D copied field, the uitlity file is to be read in order to
-%D fetch the data.
-%D
-%D The next, much faster alternative uses a dedicated %
-%D reference mechanism.
-
-\def\setmainfieldkid#1#2%
- {\immediatewriteutilitycommand{\fieldreference{#1}{#2}}}
-
-\def\checkfieldreferences
- {\startnointerference
- \protectlabels
- \doutilities{fieldreferences}\jobname\empty\relax\relax
- \global\let\checkfieldreferences\relax
- \stopnointerference}
-
-\def\setfieldreferences
- {\def\fieldreference##1##2%
- {\ifundefined{\r!widget##1}%
- \setxvalue{\r!widget##1}{##2}%
- \else
- \edef\!!stringa{\getvalue{\r!widget##1}}%
- \setxvalue{\r!widget##1}{\!!stringa,##2}%
- \fi}}
-
-\def\resetfieldreferences
- {\let\fieldreference\gobbletwoarguments}
-
-\def\getmainfieldkids#1%
- {\checkfieldreferences
- \ifdefinemainfield
- \doifundefinedelse{\r!widget#1}%
- {\let\@@DriverFieldKids\empty}
- {\@EA\let\@EA\@@DriverFieldKids\csname\r!widget#1\endcsname}%
- \else
- \let\@@DriverFieldKids\empty
- \fi}
-
-\resetfieldreferences
-
-%D Of course it costs a few more tokens to implement, but it's
-%D worth the memory: running for instance the 2000 page
-%D english examns publishing on demand document went down from
-%D 1350 seconds to less than 950 on a 650 Mhz pentium.
-
-\def\definefield
- {\definemainfieldfalse\doquintupleempty\dodefinefield}
-
-\def\definemainfield
- {\definemainfieldtrue \doquintupleempty\dodefinefield}
-
-\let\collectedfields\empty
-\newcounter\numberoffields
-\newcounter\totalnumberoffields
-
-\def\savenumberoffields
- {\ifcase\numberoffields\relax\else
- \savecurrentvalue\totalnumberoffields\numberoffields
- \fi}
-
-\appendtoks \savenumberoffields \to \everybye % \everylastshipout
-
-% \def\presetfieldreferences
-% {\ifnum\totalnumberoffields>0
-% \definereference[AtOpenInitializeForm][\v!ResetForm]%
-% \fi}
-%
-% \definereference[AtOpenInitializeForm][\v!geen]
-%
-% \appendtoks \presetfieldreferences \to \everycheckreferences
-
-\def\dodefinefield[#1][#2][#3][#4][#5]%
- {\ifsecondargument
- \edef\currentfieldname{#1}% just in case we're inside a loop
- \doifundefinedelse{define#2field}
- {\writestatus\m!fields{unknown field type #2}}
- {\doifundefined{fielddata\currentfieldname}
- {\getmainfieldkids\currentfieldname
- \ifdefinemainfield
- \ifx\@@DriverFieldKids\empty
- \let\@@DriverFieldMode\fieldlonermode
- \else
- \let\@@DriverFieldMode\fieldparentmode
- \fi
- \def\@@DriverFieldAuto{1}%
- \else
- \let\@@DriverFieldMode\fieldlonermode
- \def\@@DriverFieldAuto{0}%
- \fi
- \def\@@DriverFieldFree{0}%
- \getvalue{define#2field}{\currentfieldname}{#2}{#3}{#4}{#5}}}%
- \else
- \writestatus\m!fields{pass fieldname and fieldtype}%
- \fi}
-
-\def\definelinefield#1#2#3#4#5%
- {\setfield{#1}{#2}{}{}{\@@DriverFieldKids}{#3}{\@@DriverFieldMode\@@DriverFieldFree\@@DriverFieldAuto}{}{#4}}
-
-\let\definetextfield=\definelinefield
-
-\def\definechoicefield#1#2#3#4#5%
- {\doifelsenothing{#4}
- {\def\@@DriverFieldValues{yes,no}}
- {\def\@@DriverFieldValues{#4}}%
- \doifelsenothing{#5}
- {\dogetcommacommandelement2\from\@@DriverFieldValues \to\@@DriverFieldDefault
- \dogetcommacommandelement1\from\@@DriverFieldDefault\to\@@DriverFieldDefault}
- {\def\@@DriverFieldDefault{#5}}%
- \setfield{#1}{#2}{}{}{\@@DriverFieldKids}{#3}{\@@DriverFieldMode\@@DriverFieldFree\@@DriverFieldAuto}{\@@DriverFieldValues}{\@@DriverFieldDefault}}
-
-\let\definepopupfield=\definechoicefield
-\let\definecombofield=\definechoicefield
-
-%\def\definecheckfield#1#2#3#4#5%
-% {\doifelsenothing{#4}
-% {\definedefaultsymbols
-% \def\@@DriverFieldValues{defaultyes}}
-% {\def\@@DriverFieldValues{#4}}%
-% \doifelsenothing{#5}
-% {\dogetcommacommandelement2\from\@@DriverFieldValues\to\@@DriverFieldDefault
-% \dogetcommacommandelement1\from\@@DriverFieldDefault\to\@@DriverFieldDefault}
-% {\def\@@DriverFieldDefault{#5}}%
-% \setfield{#1}{#2}{}{}{\@@DriverFieldKids}{#3}{\@@DriverFieldMode\@@DriverFieldFree\@@DriverFieldAuto}{\@@DriverFieldValues}{\@@DriverFieldDefault}}
-
-%D Since these fields have an on/off state only, we pass 1/0
-%D to the driver as default values.
-
-\def\definecheckfield#1#2#3#4#5%
- {\doifelsenothing{#4}
- {\definedefaultsymbols
- \def\@@DriverFieldValues{defaultyes}}
- {\def\@@DriverFieldValues{#4}}%
- \doifelsenothing{#5}
- {\def\@@DriverFieldDefault{2}}
- {\dogetcommacommandelement1\from\@@DriverFieldValues\to\@@DriverFieldDefault
- \doifinstringelse{#5}{\@@DriverFieldDefault}
- {\def\@@DriverFieldDefault{1}}
- {\def\@@DriverFieldDefault{0}}}%
- \setfield
- {#1}{#2}{}{}{\@@DriverFieldKids}{#3}%
- {\@@DriverFieldMode\@@DriverFieldFree\@@DriverFieldAuto}%
- {\@@DriverFieldValues}{\@@DriverFieldDefault}}
-
-\let\definepushfield=\definecheckfield
-
-\def\defineradiofield#1#2#3#4#5%
- {\iffourthargument
- \doifelsenothing{#5}
- {\dogetcommacommandelement1\from#4\to\SavedFieldDefault
- \dogetcommacommandelement1\from\SavedFieldDefault\to\SavedFieldDefault}
- {\def\SavedFieldDefault{#5}}%
-% when opt works
-% \@EA\beforesplitstring\SavedFieldDefault\at=>\to\SavedFieldDefault
- \ifx\@@DriverFieldKids\empty
- \setfield{#1}{#2}{}{}{#4}{#3}{\@@DriverFieldMode\@@DriverFieldFree\@@DriverFieldAuto}{}{\SavedFieldDefault}%
- \else
- \setfield{#1}{#2}{}{}{#4,\@@DriverFieldKids}{#3}{\@@DriverFieldMode\@@DriverFieldFree\@@DriverFieldAuto}{}{\SavedFieldDefault}%
- \fi
-%
- \def\docommand##1%
- {\doifelse{##1}\SavedFieldDefault
- {\def\@@DriverFieldDefault{##1}}%
- {\let\@@DriverFieldDefault\empty}%
- \setfield{##1}{#2}{#1}{}{}{#3}{\@@DriverFieldMode\@@DriverFieldFree\@@DriverFieldAuto}{}{\@@DriverFieldDefault}}%
-% when opt works
-% \def\docommand##1%
-% {\@EA\beforesplitstring##1\at=>\to\FieldValue
-% \doifelse\FieldValue\SavedFieldDefault
-% {\let\@@DriverFieldDefault\FieldValue}%
-% {\let\@@DriverFieldDefault\empty}%
-% \setfield\FieldValue{#2}{#1}{}{}{#3}{\@@DriverFieldMode\@@DriverFieldFree\@@DriverFieldAuto}{}{\@@DriverFieldDefault}}%
- \processcommalist[#4]\docommand
- \else
- \writestatus\m!fields{pass values too}%
- \fi}
-
-\def\definesubfield
- {\dotripleempty\dodefinesubfield}
-
-\def\dodefinesubfield[#1][#2][#3]% for the moment only radio ones
- {\ifsecondargument
- \def\docommand##1%
- {\getfield{##1}%
- \ifx\@@DriverFieldType\empty
- \writestatus\m!fields{unknown field ##1}% to do
- \else
- \doifsomething{#2}
- {\edef\@@DriverFieldGroup{#2}}%
- \doifelsenothing{#3}
- {\definedefaultsymbols
- \def\@@DriverFieldValues{defaultyes}}
- {\def\@@DriverFieldValues{#3}}%
- \changefield{##1}%
- \fi}%
- \processcommalist[#1]\docommand
- \else
- \writestatus\m!fields{pass fieldname, setupgroup, values and default}%
- \fi}
-
-\def\doclonefield[#1][#2][#3][#4]% parent children setupgroup values
- {\ifsecondargument
- \getfield{#1}%
-\iftrialtypesetting\else
- \ifx\@@DriverFieldType\empty
- \writestatus\m!fields{unknown field #1}%
- \else
- \let\@@DriverFieldMode\fieldparentmode
- %\def\docommand##1{\addtocommalist{##1}\@@DriverFieldKids}%
- \def\docommand##1{\appendtocommalist{##1}\@@DriverFieldKids}%
- \processcommalist[#2]\docommand
- \changefield{#1}%
- \let\@@DriverFieldAutoParent\@@DriverFieldAuto
- \def\@@DriverFieldParent{#1}%
- \let\@@DriverFieldKids\empty
- \let\@@DriverFieldRoot\empty
- \let\@@DriverFieldMode\fieldchildmode
- \def\@@DriverFieldFree{0}%
- \def\@@DriverFieldAuto{0}%
- \doifsomething{#3}{\edef\@@DriverFieldGroup{#3}}%
- \doifsomething{#4}{\edef\@@DriverFieldValues{#4}}%
- \def\docommand##1%
- {\ifcase\@@DriverFieldAutoParent\else
- \setmainfieldkid{\@@DriverFieldParent}{##1}%
- \fi
- \changefield{##1}}%
- \processcommalist[#2]\docommand
- \fi
-\fi
- \else
- \writestatus\m!fields{pass parent field and clones}%
- \fi}
-
-\def\clonefield
- {\doquadrupleempty\doclonefield}
-
-\def\docopyfield[#1][#2]% parent children
- {\ifsecondargument
- \getfield{#1}%
-\iftrialtypesetting\else
- \ifx\@@DriverFieldType\empty
- \writestatus\m!fields{unknown field #1}%
- \else
- \let\@@DriverFieldMode\fieldparentmode
- %\def\docommand##1{\addtocommalist{##1}\@@DriverFieldKids}%
- \def\docommand##1{\appendtocommalist{##1}\@@DriverFieldKids}%
- \processcommalist[#2]\docommand
- \changefield{#1}%
- \let\@@DriverFieldAutoParent\@@DriverFieldAuto
- \def\@@DriverFieldParent{#1}%
- \let\@@DriverFieldKids\empty
- \let\@@DriverFieldRoot\empty
- \let\@@DriverFieldMode\fieldcopymode
- \def\@@DriverFieldFree{0}%
- \def\@@DriverFieldAuto{0}%
- \def\docommand##1%
- {\ifcase\@@DriverFieldAutoParent\else
- \setmainfieldkid{\@@DriverFieldParent}{##1}%
- \fi
- \changefield{##1}}%
- \processcommalist[#2]\docommand
- \fi
-\fi
- \else
- \writestatus\m!fields{pass parent field and copies}%
- \fi}
-
-\def\copyfield{\dodoubleempty\docopyfield}
-
-\unexpanded\def\field {\dotripleempty\dofield[\dohandlefield]}
-\unexpanded\def\fitfield{\dotripleempty\dofield[\dohandlefitfield]}
-
-\def\dofield[#1][#2][#3]%
- {\iffirstargument
- \bgroup
- \getfield{#2}%
- \ifsecondargument
- \def\@@DriverFieldLabel{#3}%
- \else
- \let\@@DriverFieldLabel\@@DriverFieldName
- \fi
- \ifx\@@DriverFieldType\empty
- \writestatus\m!fields{unknown field #2}%
- \else\ifcase\@@DriverFieldFree\relax
- \doifdefinedelse{\strippedcsname\setupfield\@@DriverFieldGroup}
- {\let\dosetupfield=#1\getvalue{\strippedcsname\setupfield\@@DriverFieldGroup}}
- {#1[\@@DriverFieldName][\v!label,\v!frame,\v!horizontal][][][]}%
-\iftrialtypesetting\else
- \def\@@DriverFieldFree{1}%
- \changefield{#2}%
-\fi
- \else\ifcase\@@DriverFieldAuto\relax
- % \writestatus\m!fields{field #2 already typeset}%
- \else
- % \writestatus\m!fields{field #2 automatically copied}%
- \nextsystemfield
- \copyfield[\@@DriverFieldName][\currentsystemfield]%
- \dotripleempty\dofield[#1][\currentsystemfield][#3]% get the if's right
- \fi\fi\fi
- \egroup
- \fi}
-
-\def\typesetfield
- {\useJSscripts[fld]%
- \ifx\@@DriverFieldRoot\empty \else
- \let\@@SavedFieldName\@@DriverFieldName
- \getfield\@@DriverFieldRoot
- \ifcase\@@DriverFieldFree\relax
- \dosetfieldstatus\@@DriverFieldMode\@@DriverFieldParent\@@DriverFieldKids\@@DriverFieldRoot
- \dopresetrecord
-\iftrialtypesetting\else
- \def\@@DriverFieldFree{1}%
- \changefield\@@DriverFieldName
-\fi
- \fi
- \getfield\@@SavedFieldName
- \fi
- \ifx\@@DriverFieldKids\empty
- \donefalse
- \else
- \donetrue
- \fi
- \ifdone
- \let\@@DriverFieldParent\@@DriverFieldName
- %\addtocommalist\@@DriverFieldParent\@@DriverFieldKids
- \appendtocommalist\@@DriverFieldParent\@@DriverFieldKids
- \dosetfieldstatus\@@DriverFieldMode\@@DriverFieldParent\@@DriverFieldKids\@@DriverFieldRoot
- \dopresetfield
- \let\@@DriverFieldMode\fieldchildmode
- \fi
- \dosetfieldstatus\@@DriverFieldMode\@@DriverFieldParent\@@DriverFieldKids\@@DriverFieldRoot
- \dopresetfield}
-
-\def\dopresetfield
- {\iftrialtypesetting\else\iflocation\getvalue{preset\@@DriverFieldType field}\fi\fi}
-
-\def\dopresetrecord
- {\iftrialtypesetting\else\iflocation\getvalue{preset\@@DriverFieldType record}\fi\fi}
-
-\def\dodefinethefieldset[#1][#2]%
- {\dodefinefieldset{#1}{#2}}
-
-\def\definefieldset%
- {\dodoubleargument\dodefinethefieldset}
-
-\def\normaldodosetupfield[#1][#2][#3][#4][#5]%
- {\doifdefinedelse{\strippedcsname\setupfield#1}
- {\pushmacro\dosetupfield
- \def\dosetupfield[##1][##2][##3][##4][##5]%
- {\setvalue{\strippedcsname\setupfield#1}{\dosetupfield[#1][##2,#2][##3,#3][##4,#4][##5,#5]}}%
- \getvalue{\strippedcsname\setupfield#1}%
- \popmacro\dosetupfield}
- {\setvalue{\strippedcsname\setupfield#1}{\dosetupfield[#1][#2][#3][#4][#5]}}}
-
-\let\dodosetupfield\normaldodosetupfield
-
-\def\donosetupfield[#1][#2][#3][#4][#5]%
- {\setvalue{\strippedcsname\setupfield#1}{\dosetupfield[#1][#2][#3][#4][#5]}}
-
-\def\dosetupfield[#1][#2][#3][#4][#5]%
- {\iffifthargument
- \def\docommand##1{\dodosetupfield[##1][#2][#3][#4][#5]}%
- \processcommalist[#1]\docommand
- \else\ifthirdargument
- \def\docommand##1{\dodosetupfield[##1][#2][][][#3]}%
- \processcommalist[#1]\docommand
- \else\ifsecondargument
- \doifelse{#2}\v!reset
- {\def\docommand##1{\donosetupfield[#1][][][][]}}
- {\def\docommand##1{\dodosetupfield[##1][][][][#2]}}%
- \processcommalist[#1]\docommand
- \else\iffirstargument
- \def\docommand##1{\dodosetupfield[##1][][][][]}%
- \processcommalist[#1]\docommand
- \else
- \writestatus\m!fields{provide either 1, 2, 3 or 5 arguments}%
- \fi\fi\fi\fi}
-
-\def\setupfield
- {\doquintupleempty\dosetupfield}
-
-\def\dosetupfields[#1][#2][#3][#4]%
- {\ifsecondargument
- \def\dodosetupfield[##1][##2][##3][##4][##5]%
- {\doifdefinedelse{\strippedcsname\setupfield##1}
- {\def\dosetupfield[####1][####2][####3][####4][####5]%
- {\setvalue{\strippedcsname\setupfield##1}{\dosetupfield[##1][#1,####2,##2][#2,####3,##3][#3,####4,##4][#4,####5,##5]}}%
- \getvalue{\strippedcsname\setupfield##1}}
- {\setvalue{\strippedcsname\setupfield##1}{\dosetupfield[##1][#1,##2][#2,##3][#3,##4][#4,##5]}}}%
- \else\iffirstargument
- \doifelse{#1}\v!reset
- {\resetfields}
- {\setupfields[][][][#1]}% checken
- \else
- \writestatus\m!fields{provide either 1 or 4 arguments}%
- \fi\fi}
-
-\def\setupfields
- {\doquadrupleempty\dosetupfields}
-
-\def\resetfields
- {\let\dodosetupfield\normaldodosetupfield}
-
-% \setupfields[\v!reset]
-
-% opties: veld, label, kader, vertikaal/horizontaal
-
-\newif\ifShowFieldLabel
-\newif\ifShowFieldFrame
-\newif\ifVerticalField
-\newif\ifHorizontalField
-
-% way to slow/complicated, we need some simple alternative
-% as well
-
-\def\dohandlefield[#1][#2][#3][#4][#5]%
- {\presetlocalframed[\??fd]%
- \processallactionsinset
- [#2]
- [ \v!reset=>\ShowFieldLabelfalse\ShowFieldFramefalse
- \HorizontalFieldfalse\VerticalFieldfalse,
- \v!label=>\ShowFieldLabeltrue,
- \v!frame=>\ShowFieldFrametrue,
- \v!horizontal=>\HorizontalFieldtrue,
- \v!vertical=>\VerticalFieldtrue]%
- \ifVerticalField
- \getparameters[\??fd]
- [\c!distance=\!!zeropoint,\c!inbetween=\vskip\@@localoffset,
- \c!align=\v!right,\c!width=20em]%
- \else\ifHorizontalField
- \getparameters[\??fd]
- [\c!distance=\@@localoffset,\c!inbetween=,\c!align=\c!left,
- \c!height=10ex]%
- \else
- \getparameters[\??fd]
- [\c!distance=\!!zeropoint,\c!inbetween=,\c!align=\c!left]%
- \fi\fi
- \getparameters[\??fd]
- [\c!n=,\c!before=,\c!after=\vss,\c!style=,\c!color=,#3]%
- \reshapeframeboxfalse % else ugly spacing
- \ifShowFieldFrame
- \localframed[\??fd][\c!strut=\v!no,\c!align=]\bgroup
- \else
- \vbox\bgroup
- \fi
- \dontcomplain
- \ifShowFieldLabel
- \setbox0\hbox
- {\reshapeframeboxtrue % else wrong dimensions
- \framed
- [\c!style=,\c!color=,\c!align=\c!right,#4]
- {\@@DriverFieldLabel}}%
- \fi
- \setbox2\hbox
- {\reshapeframeboxtrue % else wrong dimensions
- \ifVerticalField
- \setupframed[\c!height=6ex,\c!width=\hsize]%
- \else\ifHorizontalField
- \setupframed[\c!height=\vsize,\c!width=20em]%
- \else
- \setupframed[\c!height=2cm,\c!width=2cm]%
- \fi\fi
- \framed
- [\c!align=\v!right,\c!strut=\v!no,#5]
- {\getparameters
- [\??fd]
- [\c!color=,\c!style=,\c!align=\v!right,\c!option=,
- \c!clickin=,\c!clickout=,\c!regionin=,\c!regionout=,
- \c!afterkey=,\c!format=,\c!validate=,\c!calculate=,
- \c!focusin=,\c!focusout=,
- \c!fieldoffset=\!!zeropoint,\c!fieldbackgroundcolor=,
- \c!fieldframecolor=,\c!fieldlayer=\@@iafieldlayer,#5]%
- \scratchdimen\framedwidth \edef\@@DriverFieldWidth {\the\scratchdimen}%
- \scratchdimen\framedheight\edef\@@DriverFieldHeight{\the\scratchdimen}%
- \vfill
- \hbox{\lower\@@fdfieldoffset\hbox{\typesetfield}}
- \vss}}%
- \ifShowFieldLabel
- \ifVerticalField
- \vbox
- {\copy0
- \@@fdinbetween
- \copy2}%
- \else
- \hbox
- {\vbox \ifdim\ht2>\ht0 to \ht2 \fi
- {\@@fdbefore
- \copy0
- \@@fdafter}%
- \hskip\@@fddistance
- \vbox \ifdim\ht0>\ht2 to \ht0 \fi
- {\@@fdbefore
- \box2
- \@@fdafter}}%
- \fi
- \else
- \box2
- \fi
- \egroup}
-
-\chardef\fitfieldmode\plusone % 3 = best
-
-\def\dohandlefitfield[#1][#2][#3][#4][#5]% alleen check
- {\presetlocalframed[\??fd]%
- \localframed
- [\??fd]
- [\c!n=1024, % beware: weblink plug in truncates
- \c!strut=\v!no,\c!color=,\c!style=,\c!option=,
- \c!clickin=,\c!clickout=,\c!regionin=,\c!regionout=,
- \c!focusin=,\c!focusout=,
- \c!afterkey=,\c!format=,\c!validate=,\c!calculate=,
- \c!fieldoffset=\!!zeropoint,\c!fieldbackgroundcolor=,
- \c!fieldframecolor=,\c!fieldlayer=\@@iafieldlayer,#5,\c!align=]
- {\dogetcommacommandelement1\from\@@DriverFieldValues\to\@@DriverFieldValue
- \ifx\@@DriverFieldValue\empty
- \let\@@DriverFieldValue\@@DriverFieldDefault
- \fi
- \dopresetfieldsymbol\@@DriverFieldValue
- \setbox\scratchbox\hbox{\dogetfieldsymbol\@@DriverFieldValue}%
- \scratchdimen\wd\scratchbox \edef\@@DriverFieldWidth {\the\scratchdimen}%
- \scratchdimen\ht\scratchbox \edef\@@DriverFieldHeight{\the\scratchdimen}%
- \ifcase\fitfieldmode
- \typesetfield
- \or % 1 = ignore depth (original, assumed no depth, actually a bug)
- \vbox to \ht\scratchbox{\vfill\hbox to \wd\scratchbox{\typesetfield\hfill}\vss}%
- \or % 2 = add depth to height, but no depth in result
- \advance\scratchdimen\dp\scratchbox \edef\@@DriverFieldHeight{\the\scratchdimen}%
- \vbox to \ht\scratchbox{\vfill\hbox to \wd\scratchbox{\typesetfield\hfill}\vss}%
- \or % 3 = add depth to height, and apply depth to result
- \advance\scratchdimen\dp\scratchbox \edef\@@DriverFieldHeight{\the\scratchdimen}%
- \hbox to \wd\scratchbox{\lower\dp\scratchbox\hbox{\typesetfield}\hfill}%
- \fi}}
-
-%D Common stuff
-
-\newcounter\nofsystemfields
-
-\def\nextsystemfield
- {\doglobal\increment\nofsystemfields
- \def\currentsystemfield{sys::\nofsystemfields}}
-
-%D An example:
-
-\def\fillinfield
- {\dosingleempty\dofillinfield}
-
-\def\dofillinfield[#1]#2%
- {\dontleavehmode
- \hbox
- {\forgetall
- \setupfields[\v!reset]%
- \nextsystemfield
- \useJSscripts[ans]%
- \doifelsenothing{#1}
- {\def\therightanswer{#2}}
- {\def\therightanswer{#1}}%
- \setbox0\hbox{#2}%
- \setbox2\hbox{\therightanswer}%
- \dimen0=\ifdim\wd0>\wd2 \wd0 \else \wd2 \fi
- \advance\dimen0 .2em
- \definefield
- [\currentsystemfield][line][systemfield]%
- \setupfield
- [systemfield]
- [\c!n=1024, % beware: weblink plugin truncates
- \c!location=\v!low,\c!strut=\v!yes,\c!fieldoffset=0pt,
- \c!height=1.2\openlineheight,\c!width=\dimen0,\c!offset=\v!overlay,
- \c!style=,\c!align=\v!middle,\c!frame=\v!off,
- \c!color=red,\c!fieldbackgroundcolor=\s!white,\c!fieldframecolor=blue,
- \c!validate=JS(Check_Answer{\currentsystemfield,\therightanswer})]%
- \switchtobodyfont
- [\c!small]%
- \hbox to \wd0
- {\copy0\hskip-\wd0\hss\field[\currentsystemfield]\hss}}}
-
-%D and another one:
-
-\def\tooltip
- {\dosingleempty\dotooltip}
-
-\def\dotooltip[#1]#2#3%
- {\bgroup
- \setupfields[\v!reset]%
- \useJSscripts[fld]%
- \setbox0\hbox
- {\dontcomplain
- \nextsystemfield
- \setbox0\hbox{#2}%
- \definesymbol
- [\currentsystemfield:txt]
- [{\inframed[\c!frame=\v!off,\c!background=\v!screen]{#3}}]%
- \setbox2\hbox{\symbol[\currentsystemfield:txt]}%
- \definefield
- [\currentsystemfield:txt][check]
- [dummy][\currentsystemfield:txt][\currentsystemfield:txt]%
- \setupfield
- [dummy]
- [\c!frame=\v!off,
- \c!regionout=JS(Hide_Field{\currentsystemfield:txt}),
- \c!option=\v!hidden]%
- \hbox to \zeropoint
- {\dimen0\wd2\advance\dimen0 -\wd0
- \doifelse{#1}\v!left
- {\hskip-\dimen0}
- {\doif{#1}\v!middle
- {\hskip-.5\dimen0}}%
- \lower\openlineheight\hbox to \zeropoint
- {\fitfield[\currentsystemfield:txt]}}%
- \dimen0=\ifdim\wd0=\zeropoint 3em\else\wd0\fi
- \definesymbol
- [\currentsystemfield:but]
- [{\framed[\c!height=2ex,\c!width=\dimen0,\c!frame=\v!off]{}}]%
- \definefield
- [\currentsystemfield:but][push]
- [dummy][\currentsystemfield:but][\currentsystemfield:but]%
- \setupfield
- [dummy]
- [\c!frame=\v!off,
- \c!option=,
- \c!regionin=JS(Vide_Field{\currentsystemfield:txt}),
- \c!regionout=JS(Hide_Field{\currentsystemfield:txt}),
- \c!fieldlayer=\@@iafieldlayer]%
- \lower2ex\hbox to \zeropoint
- {\fitfield[\currentsystemfield:but]}%
- #2}%
- \ht0\strutht\dp0\strutdp\box0
- \egroup}
-
-%D And one more:
-
-\def\definefieldstack
- {\dotripleargument\dodefinefieldstack}
-
-\def\dodefinefieldstack[#1][#2][#3]% name, symbols, settings
- {\doifundefined{fieldstack:#1}
- {\setgvalue{fieldstack:#1}{\dodofieldstack[#1][#2][#3]}}}
-
-\def\dodofieldstack[#1][#2][#3]% start=n, 0 == leeg
- {\bgroup
- \getparameters[\??fd][\c!start=1,#3]%
- \setupfields[\v!reset]%
- \definesymbol[\v!empty][]%
- \useJSscripts[fld][FieldStack]%
- \newcounter\stackedfieldnumber
- \def\dododofieldstack##1%
- {\increment\stackedfieldnumber
- \ifnum\stackedfieldnumber=\@@fdstart\relax
- \definefield[#1:\stackedfieldnumber][check][#1][##1,\v!empty][##1]%
- \else
- \definefield[#1:\stackedfieldnumber][check][#1][##1,\v!empty][\v!empty]%
- \fi}%
- \processcommalist[#2]\dododofieldstack
- \setupfield[#1][\v!reset]% added
- \setupfield[#1][\c!option=\v!readonly,#3]% #3 swapped
- \newcounter\stackedfieldnumber
- \def\dododofieldstack##1%
- {\doglobal\increment\stackedfieldnumber
- \fitfield[#1:\stackedfieldnumber]\egroup\bgroup}%
- \startoverlay
- \bgroup
- \globalprocesscommalist[#2]\dododofieldstack
- \egroup
- \stopoverlay
- \egroup}
-
-\def\dofieldstack[#1][#2][#3]%
- {\ifsecondargument
- \dodefinefieldstack[#1][#2][#3]\fieldstack[#1]%
- \else
- \getvalue{fieldstack:#1}\setgvalue{fieldstack:#1}{[#1]}%
- \fi}
-
-\def\fieldstack
- {\dotripleempty\dofieldstack}
-
-%D When submitting a form, we need to tell the driver module
-%D that we want \FDF\ or \HTML.
-
-\def\setupforms
- {\dodoubleargument\getparameters[\??fr]}
-
-\def\checksubmitform#1%
- {\setsubmitoutputformat\@@frmethod}
-
-\setexecutecommandcheck {submitform} \checksubmitform
-
-\setupforms
- [\c!method=HTML]
-
-%D Goodie:
-
-\def\definepushbutton % name optional setup
- {\dodoubleempty\dodefinepushbutton}
-
-\def\dodefinepushbutton[#1][#2]% name setup
- {\dododefinepushbutton{#1}{n}{push}%
- \dododefinepushbutton{#1}{r}{\symbol[psym:#1:n]}%
- \dododefinepushbutton{#1}{d}{\symbol[psym:#1:r]}%
- \setvalue{pushbutton:#1}{\dohandlepushbutton{#1}{#2}}}
-
-\def\dododefinepushbutton#1#2#3%
- {\doifsymboldefinedelse{psym:#1:#2}%
- \donothing{\definesymbol[psym:#1:#2][{#3}]}}
-
-\def\definepushsymbol
- {\dotripleargument\dodefinepushsymbol}
-
-\def\dodefinepushsymbol[#1][#2]% [#3]
- {\definesymbol[psym:#1:#2]}
-
-\def\dopushbutton[#1][#2]%
- {\executeifdefined{pushbutton:#1}\gobbleoneargument{#2}}
-
-\def\pushbutton
- {\dodoubleargument\dopushbutton}
-
-\def\dohandlepushbutton#1#2#3% identifier setup script
- {\bgroup
- \nextsystemfield
- \setupfield
- [pushbutton]
- [\c!frame=\v!overlay,
- \c!offset=\v!overlay,
- \c!clickout=#3,#2]%
- \definefield
- [\currentsystemfield]
- [push]
- [pushbutton]
- [psym:#1:n,psym:#1:r,psym:#1:d]%
- \fitfield
- [\currentsystemfield]%
- \egroup}
-
-% \def\do@@ampsh
-% {\dodoubleargument\dodo@@ampsh}
-%
-% \def\dodo@@ampsh[#1][#2]#3\\%
-% {\txt\pushbutton[#1][#2]\\}%
-%
-%\appendtoks \let\psh\do@@ampsh \to \everysetmenucommands
-
-\def\@@ampsh{\txt\pushbutton}
-
-\appendtoks \let\psh\@@ampsh \to \everysetmenucommands
-
-% \definepushbutton [reset]
-%
-% \definepushsymbol [reset] [n] [\uniqueMPgraphic{whatever}{color=green}]
-% \definepushsymbol [reset] [r] [\uniqueMPgraphic{whatever}{color=white}]
-%
-% \startinteractionmenu[bottom]
-% \psh [reset] [JS(reset_something)] \\
-% \stopinteractionmenu
-
-%D Another goodie:
-
-% \definecolor[rollover:n][red]
-% \definecolor[rollover:r][green]
-% \definecolor[rollover:d][blue]
-
-\definepalet
- [rollover]
- [n=red,
- r=green,
- d=blue]
-
-\newcounter\nofrollovers
-\newcounter\nofrollbuttons
-
-\def\dorollbutton[#1][#2]#3[#4]%
- {\dontleavehmode
- \bgroup
- \doglobal\increment\nofrollovers
- \doglobal\increment\nofrollbuttons
- \unexpanded\def\dosetlocationbox[##1]##2[##3]%
- {\getparameters[##1][##3]%
- \definecolor[rollover][rollover:##2]%
- \doifelse{##2}{n}{\doifelsevalue{##1\c!alternative}\v!hidden\phantom\hbox}\hbox
- {\localframed[##1]
- [\c!framecolor=rollover,\c!backgroundcolor=rollover,\c!color=rollover]%
- {\dolocationattributes{##1}\c!style\c!color{#3}}}}%
- \iffirstargument
- \ifsecondargument
- \def\setlocationbox##1{\dosetlocationbox[\??am#1]{##1}[#2]}%
- \else
- \doifassignmentelse{#1}
- {\def\setlocationbox##1{\dosetlocationbox[\??bt]{##1}[#1]}}
- {\def\setlocationbox##1{\dosetlocationbox[\??am#1]{##1}[]}}%
- \fi
- \else
- \def\setlocationbox##1{\dosetlocationbox[\??bt]{##1}[]}%
- \fi
- % todo: share symbols, tricky since different dimensions
- \definesymbol[rsym:\nofrollovers:n][\setlocationbox n]%
- \definesymbol[rsym:\nofrollovers:r][\setlocationbox r]%
- \definesymbol[rsym:\nofrollovers:d][\setlocationbox d]%
- \setupfield
- [rollbutton]
- [\c!frame=\v!off,
- \c!offset=\v!overlay,
- \c!clickout={#4}]%
- \definefield
- [roll:\nofrollbuttons][push][rollbutton]
- [rsym:\nofrollovers:n,%
- rsym:\nofrollovers:r,%
- rsym:\nofrollovers:d]%
- \fitfield[roll:\nofrollbuttons]%
- \egroup}
-
-\unexpanded\def\rollbutton
- {\dodoubleempty\dorollbutton}
-
-\def\menu@rob[#1]#2\\%
- {\txt\rollbutton[\currentmenu]{\ignorespaces#2\unskip}[#1]\\}%
-
-\appendtoks \let\rob\menu@rob \to \everysetmenucommands
-
-% calls:
-% {..} [JS..]
-% [left] {..} [JS..]
-% [a=b] {..} [JS..]
-% [left] [a=b] {..} [JS..]
-%
-% \setupbuttons[offset=0pt,frame=off] % alternative=hidden
-%
-% \rollbutton {Manuals} [JS(Goto_File{show-man.pdf})]
-% \rollbutton {Articles} [JS(Goto_File{show-art.pdf})]
-% \rollbutton {Papers} [JS(Goto_File{show-pap.pdf})]
-% \rollbutton {Presentations} [JS(Goto_File{show-pre.pdf})]
-% \rollbutton {Resources} [JS(Goto_File{show-res.pdf})]
-%
-% \rob [JS(...)] bla bla \\
-
-\unexpanded\def\overlayrollbutton
- {\dodoubleargument\dooverlayrollbutton}
-
-\def\dooverlayrollbutton[#1][#2]%
- {\bgroup
- \nextsystemfield
- \setupfield
- [overlayrollbutton]
- [\c!frame=\v!off,\c!offset=\v!overlay,\c!regionin={#1},\c!regionout={#2}]%
- \definesymbol
- [\currentsystemfield]
- [{\framed[\c!frame=\v!off,\c!width=\overlaywidth,\c!height=\overlayheight]{}}]%
- \definefield
- [\currentsystemfield][push][overlayrollbutton][\currentsystemfield][\currentsystemfield]%
- \fitfield[\currentsystemfield]%
- \egroup}
-
-% \defineoverlay
-% [ShowMenu]
-% [{\overlayrollbutton[VideLayer{navigation}][HideLayer{navigation}]}]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/scrn-hlp.mkii b/Master/texmf-dist/tex/context/base/mkii/scrn-hlp.mkii
deleted file mode 100644
index c526f51ebb4..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/scrn-hlp.mkii
+++ /dev/null
@@ -1,171 +0,0 @@
-%D \module
-%D [ file=scrn-hlp,
-%D version=1998.10.10,
-%D title=\CONTEXT\ Screen Macros,
-%D subtitle=Help (Experimental),
-%D author={Hans Hagen \& Ton Otten},
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 : dedicated vide/hide voor helps
-
-\writestatus{loading}{ConTeXt Screen Macros / Help popups}
-
-%D This is an experimental and private module, so the interface
-%D and functionality can change. Pieces of code will be moved
-%D to other modules. More features are possible but will be
-%D interfaces later. See m-chart for an application as well
-%D as the second tno-tpd manual (graphic in margin, click
-%D on it, pop up big one, use menu with hides, as well as
-%D background, etc. etc.
-
-\unprotect
-
-\defineframedtext
- [\v!helptext]
-
-\setupframedtexts
- [\v!helptext]
- [\c!width=.75\textwidth,
- \c!align=\v!normal,
- \c!frame=\v!off,
- \c!background=\v!screen]
-
-\newcounter \nofhelpdataentries
-\newconditional \somehelpdatadefined
-
-\appendtoks \getpagehelpdata \to \beforeeverypage
-\appendtoks \synchronizepagehelpdata \to \aftereverypage
-
-% will be proper state variable
-
-\let\pagehelpdata\empty
-
-\def\dontresetpagedata
- {\let\synchronizepagehelpdata\relax}
-
-\def\resetpagehelpdata
- {\iflocation
- \let\synchronizepagehelpdata\resetpagehelpdata
- \global\let\pagehelpdata\empty
- \resetreference[HideHelp]%
- \fi}
-
-\let\synchronizepagehelpdata\resetpagehelpdata
-
-\resetreference[HideHelp]
-
-\def\getpagehelpdata
- {\iflocation\ifcase\nofhelpdataentries\else
- \let\pagehelpdata\empty
- \ifconditional\somehelpdatadefined
- \definetwopasslist{hlp:\realfolio}%
- \doloop
- {\gettwopassdata{hlp:\realfolio}%
- \iftwopassdatafound
- \addtocommalist\twopassdata\pagehelpdata
- \else
- \exitloop
- \fi}%
- \fi
- \ifx\pagehelpdata\empty \else
- \useJSscripts[fld]%
- \definereference[HideHelp][JS(Hide_Fields)]% for the moment
- \fi
- \fi\fi}
-
-\def\setpagehelpdata[#1]%
- {\iflocation\expanded{\dosetpagehelpdata{#1}}\fi}
-
-\def\dosetpagehelpdata#1%
- {\doglobal\increment\nofhelpdataentries
- \savetwopassdata{hlp:\realfolio}{\nofhelpdataentries}{#1}}
-
-\setvalue{\e!start\v!helptext}[#1]%
- {\iflocation
- \global\settrue\somehelpdatadefined
- \setvalue{\e!stop\v!helptext}%
- %{\definesymbol[helpinfo:#1][{\doframedtext[\v!helptext]{\getbuffer[\v!helptext]}}]%
- % \dopresetfieldsymbol{helpinfo:#1}}%
- {\definesymbol[\v!helptext:#1][{\doframedtext[\v!helptext]{\getbuffer[\v!helptext]}}]%
- \dopresetfieldsymbol{\v!helptext:#1}}%
- \else
- \letvalue{\e!stop\v!helptext}\relax
- \fi
- \dostartbuffer[\v!helptext][\e!start\v!helptext][\e!stop\v!helptext]}
-
-\long\def\helptext[#1]#2%
- {\iflocation
- \global\settrue\somehelpdatadefined
- %\definesymbol[helpinfo:#1][{\doframedtext[\v!helptext]{#2}}]%
- %\dopresetfieldsymbol{helpinfo:#1}%
- \definesymbol[\v!helptext:#1][{\doframedtext[\v!helptext]{#2}}]%
- \dopresetfieldsymbol{\v!helptext:#1}%
- \fi}
-
-\let\definehelptext\helptext % for backward compabilities sake
-
-\def\dohelpdata#1%
- {\setbox\scratchbox\hbox
- {\startoverlay
- {\box\scratchbox}
- %{\definemainfield[help:#1][check][helpsetup][helpinfo:#1][helpinfo:#1]%
- {\definemainfield[help:#1][check][helpsetup][\v!helptext:#1][\v!helptext:#1]%
- \fitfield[help:#1]}
- \stopoverlay}}
-
-\def\helpdata
- {\iflocation
- \bgroup
- %\getpagehelpdata
- \ifx\pagehelpdata\empty \else
- \setupfields[\v!reset]%
- \setupfield
- [helpsetup]
- [\c!width=\v!fit,
- \c!height=\v!fit,
- \c!frame=\v!off,
- \c!clickin=JS(Hide_Fields),
- \c!option={\v!readonly,\v!hidden}]%
- \setbox\scratchbox\emptybox
- \processcommacommand[\pagehelpdata]\dohelpdata
- \box\scratchbox
- \fi
- \egroup
- \fi}
-
-\def\helpbutton % also gobble spaces between [][]
- {\dodoubleempty\dohelpbutton}
-
-\def\dohelpbutton
- {\ifsecondargument
- \expandafter\donohelpbutton
- \else
- \expandafter\dodohelpbutton
- \fi}
-
-\def\dodohelpbutton[#1][#2]#3[#4]% #2 is space gobbling dummy
- {\iflocation
- \setpagehelpdata[#4]%
- \useJSscripts[fld]%
- \button[#1]{#3}[JS(Vide_Hide_Fields{help:#4})]%
- \fi}
-
-\def\donohelpbutton[#1][#2]%
- {\dodohelpbutton[#1][]{}[#2]}
-
-\def\doifhelpinfo#1#2%
- {\iflocation
- \doifsymboldefinedelse{helpinfo:#1}{#2}\donothing
- \fi}
-
-\def\doifelsehelpinfo#1#2#3%
- {\iflocation
- \doifsymboldefinedelse{helpinfo:#1}{#2}{#3}%
- \fi}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/scrn-int.mkii b/Master/texmf-dist/tex/context/base/mkii/scrn-int.mkii
deleted file mode 100644
index 01d8501e217..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/scrn-int.mkii
+++ /dev/null
@@ -1,2312 +0,0 @@
-%D \module
-%D [ file=scrn-int,
-%D version=1995.01.01,
-%D title=\CONTEXT\ Core Macros,
-%D subtitle=Interaction,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% evt interactionbaren runtime laden (scheelt 8K)
-
-%D Still to be done properly.
-
-\writestatus{loading}{ConTeXt Screen Macros / Interaction}
-
-\unprotect
-
-% \expand vs \expanded
-
-% linked registers implementeren als een koppeling == mooier
-
-\presetlocalframed[\??lk]
-
-\newcounter\numberoflinks
-
-\def\stelkoppelingenin
- {\dodoubleargument\getparameters[\??lk]}
-
-\def\definieerkoppeling[#1]% % local loading !
- {\doifundefined{\s!link:#1:\s!list}
- {\expanded{\definetwopasslist{\s!link:#1}}% \expanded{\doloadtwopassdata{\s!link:#1}}%
- \getfirsttwopassdata{\s!link:#1}%
- \let\firstlink\twopassdata
- \getlasttwopassdata{\s!link:#1}%
- \let\lastlink\twopassdata
- \let\noflinks\noftwopassitems
- \gettwopassdata{\s!link:#1}%
- \let\currentlink\twopassdata
- \let\nextlink\twopassdata
- \setxvalue{\s!link:#1:}{\firstlink:\lastlink:\noflinks:\currentlink:\nextlink}}}
-
-\def\koppeling[#1]#2%
- {\bgroup
- \definieerkoppeling[#1]%
- \doglobal\increment\numberoflinks
- \gettwopassdata{\s!link:#1}%
- \def\next[##1:##2:##3:##4:##5]%
- {\edef\firstlink {0##1}%
- \edef\lastlink {0##2}%
- \edef\noflinks {0##3}%
- \edef\prevlink {0##4}%
- \edef\currentlink{0##5}}%
- \expanded{\next[\getvalue{\s!link:#1:}]}%
- \edef\nextlink{0\iftwopassdatafound\twopassdata\else\lastlink\fi}%
- \setxvalue{\s!link:#1:}{\firstlink:\lastlink:\noflinks:\currentlink:\nextlink}%
- \lazysavetwopassdata{\s!link:#1}{\numberoflinks}{\noexpand\realfolio}%
- \ifnum\noflinks<\plustwo
- \locationfalse
- \fi
- \iflocation
- \hbox
- {\setinteractionparameter\c!width\!!zeropoint
- #2\relax
- \hskip\@@lkdistance
- \dogotosomepage\??lk\gotobegincharacter\firstlink\hss
- \ifnum\noflinks>\plustwo
- \dogotosomepage\??lk\gobackwardcharacter\prevlink\hss
- \fi
- \ifnum\noflinks>\plustwo
- \dogotosomepage\??lk\goforwardcharacter\nextlink\hss
- \hskip\@@lkdistance
- \fi
- \dogotosomepage\??lk\gotoendcharacter\lastlink}%
- \else
- \hbox{#2}%
- \fi
- \egroup}
-
-\let\setupinteractionscreens\empty
-
-\def\docalculateinteractionscreen
- {\doifelse\@@scwidth\v!fit
- {\!!widtha\leftcombitotal
- \ifdim\backspace>\!!widtha\ifdim\backspace>\zeropoint\relax
- \advance\backspace -\!!widtha
- \fi\fi
- \advance\!!widtha\rightcombitotal
- \advance\!!widtha 2\dimexpr\@@scbackspace+\@@schoroffset\relax
- \advance\!!widtha \makeupwidth}
- {\doifelse\@@scwidth\v!max
- {\!!widtha\printpaperwidth}
- {\!!widtha\@@scwidth}}%
- \doifelse\@@scheight\v!fit
- {\!!heighta\dimexpr\topheight+\topdistance\relax
- \ifdim\topspace>\!!heighta\ifdim\topspace>\zeropoint\relax
- \advance\topspace -\!!heighta
- \fi\fi
- \advance\!!heighta \dimexpr\makeupheight+\bottomdistance+\bottomheight\relax
- \advance\!!heighta 2\dimexpr\@@sctopspace+\@@scveroffset\relax}
- {\doifelse\@@scheight\v!max
- {\!!heighta\printpaperheight}
- {\!!heighta\@@scheight}}%
- \doif\@@scdelay\v!none{\let\@@scdelay\zerocountervalue}}
-
-% The macro is not to be changed; only the \@@ia-variables
-% may be set! ConTeXt is the producer but we no longer
-% mention the pragma site, since we don't want to be bothered
-% with remarks about third party documents and/or associated
-% with documents produced outside our control.
-
-\def\doprepareidentity % beware, we need to construct
- {\let\!!stringa\@@iakeyword % an unexpanded space separated
- \let\@@iakeyword\empty % list of keywords from a comma
- \def\doprepareidentity##1% % separated one
- {\ifx\@@iakeyword\empty
- \appended\def\@@iakeyword{##1}%
- \else
- \appended\def\@@iakeyword{ ##1}%
- \fi}%
- \@EA\processcommalist\@EA[\!!stringa]\doprepareidentity
- \global\let\doprepareidentity\relax}
-
-%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
- {\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
-
-\def\initializepaper
- {\bgroup
- \ifx\@@ppleft \empty
- \ifx\@@ppright\empty
- \ifx\@@pptop \empty
- \ifx\@@ppbottom \empty
- \ifx\@@pcstate\v!start
- \locationfalse\fi\else
- \locationfalse\fi\else
- \locationfalse\fi\else
- \locationfalse\fi\else
- \locationfalse\fi
- \iflocation % without screen settings
- \egroup
- \dosetuppaper\papersize\paperwidth\paperheight
- \else
- \egroup
- \dosetuppaper\printpapersize\printpaperwidth\printpaperheight
- \fi}
-
-\appendtoks \initializepaper \to \everyshipout
-
-\def\doinitializepaper
- {\bgroup
- \docalculateinteractionscreen
- \ifdim\!!widtha>\paperwidth\ifdim\!!widtha>\zeropoint
- \paperwidth\!!widtha
- \fi\fi
- \ifdim\!!heighta>\paperheight\ifdim\!!heighta>\zeropoint
- \paperheight\!!heighta
- \fi\fi
- \dosetuppaper
- {\printpapersize}
- {\the\paperwidth}
- {\the\paperheight}%
- \egroup}
-
-\let\@@pcscreendata\empty
-
-\def\dosetupinteractionscreens % met a, b en \number
- {\doifnot\@@pcstate\v!start\dodosetupinteractionscreens}
-
-\setvalue{\??sc\c!option\v!max }{1} % tzt share with driver
-\setvalue{\??sc\c!option\v!bookmark }{2} % tzt share with driver
-\setvalue{\??sc\c!option\v!fit }{3} % tzt share with driver
-\setvalue{\??sc\c!option\v!doublesided}{4} % tzt share with driver
-
-\def\dodosetupinteractionscreens % met a, b en \number
- {\bgroup
- \docalculateinteractionscreen
- \!!counte=0\getvalue{\??sc\c!option\@@scoption}\relax
- % niet waterdicht
- \doifnot{\the\!!widtha\the\!!heighta}\@@pcscreendata
- {\xdef\@@pcscreendata{\the\!!widtha\the\!!heighta}%
- \showmessage\m!interactions1{\withoutpt\the\!!widtha,\withoutpt\the\!!heighta}}%
- % needs to be split: dimensions for each page
- % and mode per document and only once !
- \dosetupscreen \backoffset\topoffset\!!widtha\!!heighta{\the\!!counte}%
- \dosetupcropbox\backoffset\topoffset\!!widtha\!!heighta
- \egroup}
-
-\def\dosetupinteractionscreen[#1]%
- {\getparameters[\??sc][#1]%
- \ifproductionrun
- \let\initializepaper\doinitializepaper
- \let\setupinteractionscreens\dosetupinteractionscreens
- \fi}
-
-\appendtoks \setupinteractionscreens \to \everyfirstshipout % needed to get option=max etc working
-\appendtoks \setupinteractionscreens \to \everyshipout % needed for page/screen dimensions
-
-\def\setupinteractionscreen
- {\dosingleempty\dosetupinteractionscreen}
-
-%D Due to requests I finally decided to support bookmarks, a
-%D driver dependant way of showing tables of content. The most
-%D simple way of support is hooking bookmark generation into
-%D the existing list mechanisms. That way users can generate
-%D bookmarks automatically, although its entirely valid to add
-%D bookmarks by defining alternative ones. These will be added
-%D at the appropriate place in the list.
-
-% \hoofdstuk{het eerste hoofdstuk}
-%
-% \bookmark {de eerste bookmark} % optional overruled hoofdstuk
-%
-% .... text ....
-%
-% \placebookmarks [hoofdstuk,paragraaf,subparagraaf,subsubparagraaf,mylist]
-% [open list]
-%
-% \bookmark[mylist]{whatever}
-
-\def\@@bookmark {bm::}
-\def\@@booklevel{bl::}
-\def\@@bookcount{bc::}
-
-\definelist[\@@bookmark]
-
-\newtoks\postponedbookmarks
-
-\def\flushpostponedbookmark
- {\the\postponedbookmarks
- \global\postponedbookmarks\emptytoks}
-
-\def\simplebookmark#1%
- {\doglobal\prependtoks
- \writetolist[\@@bookmark]{}{#1}%
- \to\postponedbookmarks}
-
-\def\complexbookmark[#1]#2%
- {\doglobal\appendtoks\writetolist[#1]{}{#2}\to\postponedbookmarks}
-
-\definecomplexorsimple\bookmark
-
-\newif\iftracebookmarks \tracebookmarksfalse
-
-\let\tracebookmarks\tracebookmarkstrue
-
-\def\placebookmarks
- {\dodoubleempty\doplacebookmarks}
-
-\def\doplacebookmarks[#1][#2]%
- {\iflocation
- \iffirstargument
- \bgroup
- \ifsecondargument
- \doifelse{#2}\v!all
- {\edef\openbookmarklist{#1}}
- {\edef\openbookmarklist{#2}}%
- \else
- \let\openbookmarklist\empty
- \fi
- \xdef\doplacebookmarksindeed{\noexpand\dodoplacebookmarksindeed[#1][\openbookmarklist]}
- \egroup
- \else
- \expanded{\placebookmarks\@EA[\getvalue{\??ih\v!content\c!list}]}%
- \fi
- \fi}
-
-\def\dodoplacebookmarksindeed[#1][#2]%
- {\bgroup
- \edef\openbookmarklist{#2}%
- \global\let\bookmarklevellist\empty
- \def\bookmarklevelcount{0}%
- \doprocessbookmarks[#1]\dogetbookmarkelement
- \dolistelement{}{}{}{}{}{}% needed to finish the first pass
- \doprocessbookmarks[#1]\doputbookmarkelement
- \flushbookmark
- \egroup}
-
-\let\doplacebookmarksindeed\relax
-
-\prependtoks
- \doplacebookmarksindeed % new, now postponed so that halfway defined commands work out ok
-\to \everystoptext
-
-\def\doprocessbookmarks[#1]#2%
- {\let\dolistelement#2\relax
- \scratchcounter\zerocount
- \def\docommand##1%
- {\advance\scratchcounter \plusone
- \getlistlevel[##1]\listlevel{\the\scratchcounter}%
- \setxvalue{\@@bookcount\the\scratchcounter}{1}%
- \setxvalue{\@@booklevel##1}{\listlevel}}%
- \processcommalist[#1]\docommand
- \setxvalue{\@@bookcount0}{1}%
- \global\chardef\currentbookmarklevel\zerocount
- \global\chardef\previousbookmarklevel\zerocount
- \doutilities{listentries,#1,\@@bookmark}\jobname{#1}\relax\relax}
-
-\def\dodogetbookmarkelement#1#2#3#4#5#6%
- {\doifelsenothing{#1}
- {\global\chardef\currentbookmarklevel\zerocount}
- {\global\chardef\currentbookmarklevel\getvalue{\@@booklevel#1}\relax}%
- \ifnum\currentbookmarklevel>\previousbookmarklevel
- \setxvalue{\@@bookcount\the\currentbookmarklevel}{1}%
- \else\ifnum\currentbookmarklevel<\previousbookmarklevel
- \bgroup
- \!!counta\previousbookmarklevel
- \doloop
- {\let\bookmarktag\empty
- \!!countb\!!counta
- \advance\!!countb \minusone
- \dorecurse\!!countb
- {\edef\bookmarktag
- {\bookmarktag\getvalue{\@@bookcount\recurselevel}:}}%
- \edef\bookmarklevelcount
- {\getvalue{\@@bookcount\the\!!counta}}%
- \xdef\bookmarklevellist
- {\bookmarklevellist/\bookmarktag:\bookmarklevelcount/}%
- \advance\!!counta \minusone
- \ifnum\!!counta=\currentbookmarklevel
- \exitloop
- \fi}%
- \egroup
- \@EA\doglobal\@EA\increment\csname \@@bookcount\the\currentbookmarklevel\endcsname\relax
- \else
- \@EA\doglobal\@EA\increment\csname \@@bookcount\the\previousbookmarklevel\endcsname\relax
- \fi\fi
- \global\utilitydonetrue
- \global\chardef\previousbookmarklevel\currentbookmarklevel}
-
-\def\getbookmarklevelcount
- {\@EA\def\@EA\docommand\@EA[\@EA##\@EA1\@EA/\bookmarktag:##2/##3]%
- {\def\bookmarklevelcount{##2}}%
- \@EA\@EA\@EA\docommand\@EA\@EA\@EA[\@EA\bookmarklevellist\@EA/\bookmarktag:0/]}
-
-\def\dodoputbookmarkelement#1#2#3#4#5#6%
- {\doifelsenothing{#1}
- {\global\chardef\currentbookmarklevel\zerocount}
- {\global\chardef\currentbookmarklevel\getvalue{\@@booklevel#1}\relax}%
- \ifnum\currentbookmarklevel>\previousbookmarklevel
- \setxvalue{\@@bookcount\the\currentbookmarklevel}{1}%
- \else\ifnum\currentbookmarklevel<\previousbookmarklevel
- \@EA\doglobal\@EA\increment\csname \@@bookcount\the\currentbookmarklevel\endcsname\relax
- \else
- \@EA\doglobal\@EA\increment\csname \@@bookcount\the\previousbookmarklevel\endcsname\relax
- \fi\fi
- \let\bookmarktag\empty
- \!!countb\currentbookmarklevel
- \dorecurse\!!countb
- {\edef\bookmarktag
- {\bookmarktag\getvalue{\@@bookcount\recurselevel}:}}%
- \getbookmarklevelcount
- \iftracebookmarks
- \bgroup
- \par
- \bookmarktag\quad
- \dorecurse\currentbookmarklevel{\quad}\unskip#1\quad
- (\bookmarklevelcount)\quad
- \egroup
- \fi
- \global\chardef\previousbookmarklevel\currentbookmarklevel
- \global\utilitydonetrue
- \insertsomebookmark{#1}{\the\currentbookmarklevel}{\bookmarklevelcount}{#4}{#6}}
-
-\def\dogetbookmarkelement#1#2#3#4#5#6%
- {\doifnot{#1}\@@bookmark
- {\dodogetbookmarkelement{#1}{#2}{#3}{#4}{#5}{#6}}}
-
-\def\doputbookmarkelement#1#2#3#4#5#6%
- {\doifelse{#1}\@@bookmark
- {\localbookmark{#4}}
- {\flushbookmark
- \dodoputbookmarkelement{#1}{#2}{#3}{#4}{#5}{#6}}}
-
-\let\flushbookmark\relax
-\let\localbookmark\gobbleoneargument
-
-\def\insertsomebookmark#1#2#3#4#5%
- {\gdef\flushbookmark
- {\doinsertsomebookmark{#1}{#2}{#3}{#4}{#5}{g}}%
- \gdef\localbookmark##1%
- {\doinsertsomebookmark{#1}{#2}{#3}{##1}{#5}{l}}}
-
-\def\doinsertsomebookmark#1#2#3#4#5#6%
- {\global\utilitydonetrue
- \global\let\localbookmark\gobbleoneargument
- \global\let\flushbookmark\relax
- \doifinstringelse{#1}\openbookmarklist
- {\chardef\openbookmark\plusone}
- {\chardef\openbookmark\zerocount}%
- \iftracebookmarks(#6: #4)\quad(\the\openbookmark)\par\fi
- \doinsertbookmark{#2}{#3}{#4}{#5}{\openbookmark}}
-
-% \startinteractionmenu[rechts]
-% \but [eerste] eerste \\
-% \txt hello world \\
-% \but [tweede] tweede \\
-% \nop \\
-% \but [tweede] tweede \\
-% \rul whow \\
-% \but [tweede] tweede \\
-% \raw hello world \\
-% \but [tweede] tweede \\
-% \com \vfill \\
-% \but [derde] derde \\
-% \stopinteractionmenu
-
-\newif\iflocationmenupermitted
-
-\def\testinteractionmenu#1%
- {\iflocation
- \doifelse\@@iamenu\v!on
- {\doifelsevalue{\??am#1\c!state}\v!start
- {\global\locationmenupermittedtrue}
- {\global\locationmenupermittedfalse}}
- {\global\locationmenupermittedfalse}%
- \else
- \global\locationmenupermittedfalse
- \fi}
-
-\def\dodisableinteractionmenu[#1][#2][#3]%
- {\def\dododisableinteractionmenu##1%
- {\doifelse{#3}{}
- {\letvalue{\??am##1\c!obstruction}\empty}
- {\edef\interactieblokkade{\getvalue{\??am##1\c!obstruction}}
- \def\docommand####1{#1{####1}{\interactieblokkade}}% #1 = \remove or \add
- \processcommalist[#3]\docommand
- \setevalue{\??am##1\c!obstruction}{\interactieblokkade}}}%
- \processcommalist[#2]\dododisableinteractionmenu}
-
-\def\disableinteractionmenu
- {\dotripleempty\dodisableinteractionmenu[\addtocommalist]}
-
-\def\enableinteractionmenu
- {\dotripleempty\dodisableinteractionmenu[\removefromcommalist]}
-
-% ja : kader/achtergrond met tekst
-% leeg : kader/achtergrond maar geen tekst
-% nee : alleen ruimte reserveren
-% geen : helemaal weglaten
-
-\newif\iflocationdummy
-\newif\ifskippedmenuitem
-
-\newif\iflocationempty
-\newif\iflocationclick
-
-% ja : kader/achtergrond met tekst
-% leeg : kader/achtergrond maar geen tekst
-% nee : alleen ruimte reserveren
-% geen : helemaal weglaten
-%
-% \setupinteractionmenu[right][samepage=yes, unknownreference=yes]
-% \setupinteractionmenu[right][samepage=empty,unknownreference=empty]
-% \setupinteractionmenu[right][samepage=no, unknownreference=no]
-% \setupinteractionmenu[right][samepage=none, unknownreference=none]
-%
-% \startinteractionmenu[right]
-% \but [firstpage] first \\
-% \but [lastpage] last \\
-% \but [somepage] crap \\
-% \stopinteractionmenu
-
-\def\dosetlocationboxcontent#1[#2]#3[#4]%
- {\global\skippedmenuitemfalse
- \setbox\locationbox\hbox
- {\resetgoto % anders cyclische aanroep !
- \localframed[#1][#2]{\dolocationattributes{#1}\c!style\c!color{#3}}}%
- \iflocationclick
- \hbox{\gotolocation{#4}{\box\locationbox}}%
- \else
- \hbox{\box\locationbox}%
- \fi}
-
-\let\dosetlocationboxyes\dosetlocationboxcontent
-
-\def\dosetlocationboxempty#1[%
- {\dosetlocationboxcontent{#1}[\c!empty=\v!yes,}
-
-\def\dosetlocationboxno#1[%
- {\dosetlocationboxcontent{#1}[\c!empty=\v!yes,\c!frame=,\c!background=,}
-
-\def\dosetlocationboxnone#1[#2]#3[#4]%
- {\global\skippedmenuitemtrue}
-
-\def\setlocationboxyes#1[#2]#3[#4]%
- {\locationclicktrue
- \setbox\locationbox\hbox
- {\resetgoto % anders cyclische aanroep !
- \global\skippedmenuitemfalse
- \gotolocation
- {#4}% % needed
- {\ifrealreferencepage
- \ifcase\csname\??am\??am\csname#1\c!samepage\endcsname\endcsname\relax
- \copycsname#1\c!color\endcsname\csname#1\c!contrastcolor\endcsname
- \localframed[#1][#2]{\dolocationattributes{#1}\c!style\c!color{#3}}%
- \or
- \localframed[#1][\c!empty=\v!yes,#2]{\dolocationattributes{#1}\c!style\c!color{#3}}%
- \or
- \localframed[#1][\c!empty=\v!yes,\c!frame=,\c!background=,#2]{\dolocationattributes{#1}\c!style\c!color{#3}}%
- \or
- \global\skippedmenuitemtrue
- \fi
- \else
- \localframed[#1][#2]{\dolocationattributes{#1}\c!style\c!color{#3}}%
- \fi}}%
- \ifskippedmenuitem\else\box\locationbox\fi}
-
-\def\setlocationboxnop#1[#2]#3[#4]% inefficient as text can be outside box
- {\locationclickfalse
- \setbox\locationbox\hbox
- {\resetgoto % anders cyclische aanroep !
- \global\skippedmenuitemfalse
- \ifcase\csname\??am\??am\csname#1\c!unknownreference\endcsname\endcsname\relax
- \localframed[#1][#2]{\dolocationattributes{#1}\c!style\c!color{#3}}%
- \or
- \localframed[#1][\c!empty=\v!yes,#2]{\dolocationattributes{#1}\c!style\c!color{#3}}%
- \or
- \localframed[#1][\c!empty=\v!yes,\c!frame=,\c!background=,#2]{\dolocationattributes{#1}\c!style\c!color{#3}}%
- \or
- \global\skippedmenuitemtrue
- \fi}%
- \ifskippedmenuitem\else\box\locationbox\fi}
-
-\def\setlocationboxraw#1[#2]#3[#4]%
- {\localframed[#1][#2]{\dolocationattributes{#1}\c!style\c!color{#3}}}
-
-\def\setlocationbox#1[#2]#3[#4]%
- {\bgroup % really needed !
- \edef\permittedreferences{\csname#1\c!obstruction\endcsname}%
- \doifreferencepermittedelse{#4}%
- {\setlocationboxyes{#1}[#2]{#3}[#4]}%
- {\setlocationboxnop{#1}[#2]{#3}[#4]}%
- \egroup}
-
-\def\setlocationnop#1[#2]#3%
- {\localframed[#1][#2]{#3}}
-
-\def\executeamboxcommands#1#2#3#4#5%
- {%\processaction
- % [\getvalue{\??am#1\c!dummy}]
- % [ \v!yes=>\chardef\handleunknownmenuitem=0\relax,
- % \v!empty=>\chardef\handleunknownmenuitem=1\relax,
- % \v!no=>\chardef\handleunknownmenuitem=2\relax]%
- \getvalue{\??am#1#3}\relax
- \setamboxcommands{#1}{#4}%
- \ignorespaces#2\unskip
- \getvalue{\??am#1#5}}
-
-\newcounter\currentamposition
-
-\newtoks\everysetmenucommands
-
-\def\setamboxcommands#1#2%
- {\def\currentmenu{#1}% % kan nog eerder
- \def\currentsubmenu{#2}% % ? ?
- \doglobal\newcounter\currentamposition
- \the\everysetmenucommands}
-
-\def\menu@@amboxcommand#1\\%
- {\dontleavehmode
- \bgroup
- \ignorespaces#1\unskip\relax
- \ifskippedmenuitem \else
- \getvalue{\??am\currentmenu\currentsubmenu}%
- \fi
- \egroup
- \ignorespaces}
-
-\appendtoks
- \let\@@amboxcommand\menu@@amboxcommand
-\to \everysetmenucommands
-
-\def\menu@raw[#1]#2\\%
- {\@@amboxcommand\gotobox{\ignorespaces#2\unskip}[#1]\\}%
-
-\def\menu@but[#1]#2\\%
- {\@@amboxcommand\do@@amposition\currentmenu{#1}{\setlocationbox{\??am\currentmenu}[]{\ignorespaces#2\unskip}[#1]}\\}%
-
-\def\menu@got[#1]#2\\% pas op! offset
- {\@@amboxcommand\setlocationbox{\??am\currentmenu}[\c!frame=\v!off,\c!background=]{\ignorespaces#2\unskip}[#1]\\}%
-
-\def\menu@nop#1\\%
- {\@@amboxcommand\setlocationboxraw{\??am\currentmenu}[\c!frame=\v!off,\c!background=,\c!empty=\v!yes]{\ignorespaces#1\unskip}[]\\}%
-
-\def\menu@txt#1\\%
- {\@@amboxcommand\localframed[\??am\currentmenu][\c!frame=\v!off,\c!background=]{\ignorespaces#1\unskip}\\}%
-
-\def\menu@rul#1\\% ook \do@@amposition !
- {\@@amboxcommand\localframed[\??am\currentmenu][]{\ignorespaces#1\unskip}\\}%
-
-\def\menu@com#1\\%
- {\ignorespaces#1\unskip\ignorespaces}%
-
-\appendtoks
- \let\raw\menu@raw
- \let\but\menu@but
- \let\got\menu@got
- \let\nop\menu@nop
- \let\txt\menu@txt
- \let\rul\menu@rul
- \let\com\menu@com
-\to \everysetmenucommands
-
-\ifx\do@@amposition\undefined
- \let\do@@amposition\gobbletwoarguments % hook for positional thingies
-\fi
-
-\let\currentmenu\empty
-
-% beware : never change the concept of pbgoffset
-
-\def\menuparameter#1{\csname\??am\currentmenu#1\endcsname}
-
-\def\@@amhbox#1#2#3#4%
- {\def\currentmenu{#3}%
- \testinteractionmenu{#3}%
- \iflocationmenupermitted
- \bgroup
- \showcomposition
- \scratchdimen\dimexpr
- \makeupwidth
- +\pagebackgroundhoffset
- +\pagebackgroundhoffset
- -\menuparameter\c!leftoffset
- -\menuparameter\c!rightoffset
- \relax
- \setbox\scratchbox\hbox to \scratchdimen
- {\forgetall\executeamboxcommands{#3}{#4}\c!left\c!middle\c!right}%
- \setbox\scratchbox\hbox{\do@@ammenuposition{#3}{\box\scratchbox}}%
- \wd\scratchbox\makeupwidth % geen \ht=#2 setting (yet)
- \hskip\dimexpr-\pagebackgroundhoffset+\menuparameter\c!leftoffset\relax
- \box\scratchbox
- \egroup
- \else
- #1\relax
- \fi}
-
-\def\@@amvbox#1#2#3#4% don't change skipping, this one works!
- {\def\currentmenu{#3}%
- \testinteractionmenu{#3}%
- \iflocationmenupermitted
- \bgroup
- \showcomposition
- \scratchdimen\dimexpr
- \textheight
- +\pagebackgroundvoffset
- +\pagebackgroundvoffset
- +\pagebackgrounddepth
- -\menuparameter\c!topoffset
- -\menuparameter\c!bottomoffset
- \relax
- \setbox\scratchbox\vbox to \scratchdimen
- {\forgetall % Voor't geval de afstand
- %\setupblank[\v!standard]% % (tijdelijk) is aangepast.
- \restorestandardblank
- \hsize#2\relax
- \executeamboxcommands{#3}{#4}\c!before\c!inbetween\c!after}%
- \setbox\scratchbox\vbox{\hbox{\do@@ammenuposition{#3}{\box\scratchbox}}}%
- \setbox\scratchbox\vbox
- {\ht\scratchbox\zeropoint
- \vskip\dimexpr-\pagebackgroundvoffset+\menuparameter\c!topoffset\relax
- \box\scratchbox
- \vskip\pagebackgroundvoffset}% overbodig
- \ht\scratchbox\textheight
- \wd\scratchbox#2\relax
- \box\scratchbox
- \egroup
- \else
- #1\relax
- \fi}
-
-\ifx\do@@ammenuposition\undefined
- \let\do@@ammenuposition\gobbleoneargument % hook for positional thingies
-\fi
-
-\setvalue{\??am\s!do\v!right }{\@@amvbox{\dodummypageskip\v!right }\rightedgewidth}
-\setvalue{\??am\s!do\v!left }{\@@amvbox{\dodummypageskip\v!left }\leftedgewidth }
-\setvalue{\??am\s!do\v!top }{\@@amhbox{\dodummypageskip\v!top }\topheight }
-\setvalue{\??am\s!do\v!bottom}{\@@amhbox{\dodummypageskip\v!bottom}\bottomheight }
-
-\def\dointeractionmenu#1#2%
- {\getvalue{\??am\s!do\getvalue{\??am#1\c!location}}{#1}{#2}}
-
-\unexpanded\def\interactionmenu[#1]%
- {\getvalue{\??am\c!menu#1}}
-
-\def\horizontalinteractionmenu#1#2#3#4%
- {\ifdim#2>\zeropoint % new
- \scratchdimen\zeropoint
- \setbox\scratchbox\hbox
- {\def\docommand##1%
- {\doifnotvalue{\??am##1\c!state}\v!none
- {\hskip\scratchdimen
- \setbox2\hbox to #2
- {\getvalue{\??am##1#3}\interactionmenu[##1]\getvalue{\??am##1#4}}%
- \doifelsevalue{\??am##1\c!distance}\v!overlay
- {\scratchdimen\zeropoint
- \wd2\zeropoint}%
- {\scratchdimen\getvalue{\??am##1\c!distance}}%
- \box2}}%
- \startinteraction
- \processcommacommand[\getvalue{\??am#1}]\docommand
- \stopinteraction}%
- \wd\scratchbox#2\relax
- \box\scratchbox
- \fi}
-
-\def\verticalinteractionmenu#1#2#3#4%
- {\ifdim#2>\zeropoint % new
- \scratchdimen\zeropoint
- \setbox\scratchbox\vbox
- {\def\docommand##1%
- {\doifnotvalue{\??am##1\c!state}\v!none
- {\vskip\scratchdimen
- \setbox2\vbox to #2
- {\getvalue{\??am##1#3}\interactionmenu[##1]\getvalue{\??am##1#4}}%
- \doifelsevalue{\??am##1\c!distance}\v!overlay
- {\scratchdimen\zeropoint
- \offinterlineskip
- \dp2\zeropoint
- \ht2\zeropoint}%
- {\scratchdimen\getvalue{\??am##1\c!distance}}%
- \box2}}%
- \startinteraction
- \processcommacommand[\getvalue{\??am#1}]\docommand
- \stopinteraction}%
- \ht\scratchbox#2\relax
- \dp\scratchbox\zeropoint
- \box\scratchbox
- \fi}
-
-\letvalue{\??am\v!left }\empty
-\letvalue{\??am\v!right}\empty
-\letvalue{\??am\v!top }\empty
-\letvalue{\??am\v!bottom }\empty
-
-% todo : \defineinteractionmenuclass
-
-\def\interactionmenus[#1]%
- {\iflocation
- \getvalue{\??am\??am\c!menu#1}%
- \else
- \dodummypageskip{#1}%
- \fi}
-
-\setvalue{\??am\??am\c!menu\v!left }{\horizontalinteractionmenu\v!left \leftedgewidth \c!left \c!right}
-\setvalue{\??am\??am\c!menu\v!right }{\horizontalinteractionmenu\v!right \rightedgewidth\c!left \c!right}
-\setvalue{\??am\??am\c!menu\v!top }{\verticalinteractionmenu \v!top \topheight \c!before\c!after}
-\setvalue{\??am\??am\c!menu\v!bottom}{\verticalinteractionmenu \v!bottom\bottomheight \c!before\c!after}
-
-% this can be implemented with the following command (which
-% is new, undocumented, experimental, untested, etc etc)
-
-\def\defineinteractionmenuclass
- {\dodoubleargument\dodefineinteractionmenuclass}
-
-\def\dodefineinteractionmenuclass[#1][#2]% tag hori|veri
- {\doifelse{#2}\v!vertical
- {\setvalue{\??am\??am\c!menu#1}{\verticalinteractionmenu {#1}{\getvalue{\??am#1\c!width }}\c!before\c!after}}
- {\setvalue{\??am\??am\c!menu#1}{\horizontalinteractionmenu{#1}{\getvalue{\??am#1\c!height}}\c!left\c!right }}}
-
-% \setupinteraction[menu=on,state=start]
-%
-% \defineinteractionmenuclass[test] [vertical]
-% \defineinteractionmenuclass[another][horizontal]
-%
-% \defineinteractionmenu[test] [left][state=start,width=4cm]
-% \defineinteractionmenu[another][top] [state=start,height=1cm]
-%
-% \startinteractionmenu[test]
-% \but [firstpage] test-a \\
-% \but [nextpage] test-b \\
-% \stopinteractionmenu
-%
-% \startinteractionmenu[another]
-% \but [firstpage] test-a \\
-% \but [nextpage] test-b \\
-% \stopinteractionmenu
-%
-% \setupheadertexts[{\interactionmenu[another]}]
-%
-% \starttext
-%
-% test \interactionmenu[test] \page
-% test \interactionmenu[test] \page
-%
-% \stoptext
-
-%D This can save complicated menu macros when one want to
-%D keep control over parts of a menu (i.e.\ turn them on and
-%D off). We could have achieved something similar with modes.
-
-\def\local@@ambox#1#2#3#4% don't change skipping, this one works!
- {\bgroup
- \testinteractionmenu{#3}%
- \iflocationmenupermitted
- \executeamboxcommands{#3}{#4}\c!before\c!inbetween\c!after
- \else
- #1\relax
- \fi
- \egroup}
-
-\def\includemenu[#1]%
- {\doifvalue{\??am#1\c!state}\v!local
- {\bgroup
- \letvalue{\??am#1\c!state}\v!start
- \let\@@amvbox\local@@ambox
- \let\@@amhbox\local@@ambox
- \getvalue{\??am\c!menu#1}%
- \egroup}}
-
-%D We also need an explicit position control some day. I'll
-%D do that when I need it. [The stacking order.]
-
-\newif\ifextendedmenu
-
-% [name] [location]
-% [name] [location] [pars]
-
-\def\defineinteractionmenu
- {\dotripleempty\dodefineinteractionmenu}
-
-\def\dodefineinteractionmenu[#1][#2][#3]%
- {% main settings
- \letvalue{\??am\c!menu#1}\empty
- \setvalue{\@@dodolistelement#1}{\def\dosomelistelement{\dodomenulistelement{#1}}}%
- \presetlocalframed[\??am#1]%
- % register location
- \expanded{\addtocommalist{#1}\@EA\noexpand\csname\??am#2\endcsname}%
- % inherit settings
- \doifnot{#1}{#2}
- {\copyparameters[\??am#1][\??am#2]
- [\c!left,\c!middle,\c!right,\c!before,\c!after,\c!inbetween,%
- \c!width,\c!height,\c!distance,\c!offset,%
- \c!frame,\c!framecolor,\c!rulethickness,%
- \c!background,\c!backgroundcolor,\c!backgroundscreen,%
- \c!style,\c!color,\c!contrastcolor,\c!samepage,\c!unknownreference,%
- \c!leftoffset,\c!rightoffset,\c!topoffset,\c!bottomoffset]}%
- % additional settings
- \getparameters[\??am#1][\c!location=#2,\c!obstruction=,#3]}
-
-\def\setupinteractionmenu
- {\dodoubleargument\dosetupinteractionmenu}
-
-\def\dosetupinteractionmenu[#1][#2]%
- {\def\docommand##1{\getparameters[\??am##1][#2]}%
- \processcommalist[#1]\docommand}
-
-\expandafter\chardef\csname\??am\??am\v!yes \endcsname\zerocount
-\expandafter\chardef\csname\??am\??am\v!empty\endcsname\plusone
-\expandafter\chardef\csname\??am\??am\v!no \endcsname\plustwo
-\expandafter\chardef\csname\??am\??am\v!none \endcsname\plusthree
-\expandafter\chardef\csname\??am\??am \endcsname\plusone % default
-
-\processbetween{\v!interactionmenu}\dostartinteractionmenu
-
-\def\dostartinteractionmenu#1%
- {\dodostartinteractionmenu#1\dodostopinteractionmenu}
-
-\def\dodostartinteractionmenu[#1]#2\dodostopinteractionmenu
- {\setvalue{\??am\c!menu#1}{\extendedmenutrue\dointeractionmenu{#1}{#2}}}
-
-\def\resetinteractionmenu[#1]%
- {\letvalue{\??am\c!menu#1}\empty}
-
-\def\dodomenulistelement#1#2#3#4#5#6#7%
- {\setbox0=\hbox
- {\let\gotolocation\gobbleoneargument % hack to catch last []
- %\locationclickfalse % ipv ^
- \docheckrealreferencepage{#7}%
- \setlocationboxyes
- {\??am#1}% % needed !
- []% no settings
- {\limitatetext{#5}{\getvalue{\??li#2\c!maxwidth}}{\unknown}}% % needed !
- []}% normally the destination, catch by gobble
- \@@amboxcommand\do@@amposition{#1}{#7}% beware, we pass the pagenumber
- {\ignorespaces\linklisttoelement{#3}{#6}{#7}{\box0}\unskip}\\}
-
-% \scherm moet worden als \page
-
-\def\screen
- {\dosingleempty\doscreen}
-
-\def\doscreen[#1]%
- {\iflocation\page[#1]\fi}
-
-\unexpanded\def\menubutton
- {\dodoubleempty\domenubutton}
-
-\def\domenubutton[#1]%
- {\iffirstargument
- \ifsecondargument
- \@EAEAEA\domenubuttonB
- \else
- \doifassignmentelse{#1}
- {\@EAEAEA\domenubuttonC}
- {\@EAEAEA\domenubuttonD}%
- \fi
- \else
- \@EA\domenubuttonA
- \fi[#1]}
-
-\def\domenubuttonA[#1][#2]#3[#4]% normal button, no parameters
- {\bgroup
- %\locationdummytrue
- \setlocationbox\??bt[]{#3}[#4]%
- \egroup}
-
-\def\domenubuttonB[#1][#2]#3[#4]% menu button, with parameters
- {\bgroup
- %\locationdummytrue
- \setlocationbox{\??am#1}[#2]{#3}[#4]%
- \egroup}
-
-\def\domenubuttonC[#1][#2]#3[#4]% normal button, with parameters
- {\bgroup
- %\locationdummytrue
- \setlocationbox\??bt[#1]{#3}[#4]%
- \egroup}
-
-\def\domenubuttonD[#1][#2]#3[#4]% menu button, no parameters
- {\bgroup
- %\locationdummytrue
- \setlocationbox{\??am#1}[]{#3}[#4]%
- \egroup}
-
-\def\menubox
- {\dodoubleempty\domenubox}
-
-\def\domenubox[#1][#2]#3%
- {\bgroup
- \let\setlocationbox\setlocationboxraw
- \domenubutton[#1][#2]#3[]%
- \egroup}
-
-% Hier volgen de synchronisatiemacro's:
-
-\def\syncprefix{sync}
-
-%def\syncmarker{syncmark}
-%\definemarking[\syncmarker]
-%\setupmarking[\syncmarker][\c!expansie=\v!ja]
-
-\newmark\syncmarker
-
-\newcounter\synccounter
-
-\newif\ifsynchronisation
-
-\def\startsynchronization%
- {\iflocation\ifsynchronisation
- \doglobal\increment\synccounter
- \fi\fi}
-
-\def\stopsynchronization%
- {\iflocation\ifsynchronisation
- %\thisisdestination{\syncprefix:\synccounter}%
- \pagereference[\syncprefix:\synccounter]%
- \ifvmode
- \@EA\setmark\@EA\syncmarker\@EA{\synccounter} % \marking[\syncmarker]{\synccounter}%
- \else
- \showmessage\m!interactions4\synccounter
- \fi
- \fi\fi}
-
-\def\synchronize%
- {\startsynchronization
- \stopsynchronization}
-
-\def\dosetupsynchronization[#1]%
- {\getparameters[\??sy][#1]%
- \doifelse\@@systate\v!start
- \synchronisationtrue
- \synchronisationfalse}
-
-\def\setupsynchronization
- {\dosingleargument\dosetupsynchronization}
-
-\def\definesynchronization
- {\dosingleargument\dodefinesynchronization}
-
-\def\setupsynchronizationbar
- {\dodoubleargument\getparameters[\??ba]}
-
-\presetlocalframed[\??ba]
-
-\setvalue{synchronisatie\v!page}[#1]%
- {\bgroup
- %\setupinteraction[\c!width=\!!zeropoint]%
- \setinteractionparameter\c!width\!!zeropoint
- \setbox0\hbox
- {\localframed[\??ba][]{\dolocationattributes\??ba\c!style\c!color{\strut\@@batext}}}%
- \dontcomplain
- \def\atthebottom
- {\leaders\hrule\!!depth1ex\!!height-.5ex\hfil}%
- \def\atthetop##1##2##3%
- {\dimen0=\wd0
- \divide\dimen0 3
- \multiply\dimen0 ##2\relax
- \dimen2=.25em % brrr
- \advance\dimen0 -##3\dimen2
- %\gotodestination
- % {}{#1}{\syncprefix:##1}{}
- % {\hbox to \dimen0{\color[\locationcolor\@@bacolor]{\atthebottom}}}}%
- \gotobox
- {\hbox to \dimen0{\color[\locationcolor\@@bacolor]{\atthebottom}}}%
- [#1::\syncprefix:##1]}%
- \hbox
- {\def\check##1##2%
- {\edef##2{0##1\syncmarker}%
- \ifnum0##2=0 \def##2{1}\fi}%
- \check\gettopmark\top
- \check\getfirstmark\first
- \check\getbotmark\bot
- \setbox2\hbox to \wd0
- {\ifnum\top=\first\relax
- \ifnum\first=\bot\relax
- \atthetop\first30\relax
- \else
- \atthetop\first21\hss\atthetop\bot11\relax
- \fi
- \else
- \ifnum\first=\bot\relax
- \atthetop\top11\hss\atthetop\first21\relax
- \else
- \atthetop\top11\hss\atthetop\first11\hss\atthetop\bot11\relax
- \fi
- \fi}%
- \wd2=\zeropoint\box2
- \box0\relax}%
- \egroup}
-
-\setvalue{synchronisatie\v!local}[#1]%
- {\bgroup
- %\setupinteraction[\c!width=\!!zeropoint]%
- \setinteractionparameter\c!width\!!zeropoint
- \def\blackrule{\hbox{\vrule\!!height.5em\!!width.5em}}%
- %\gotodestination
- % {}{##1}{\syncprefix:#1}{0}
- % {\color[\locationcolor\@@bacolor]{\blackrule}}%
- \gotobox %
- {\color[\locationcolor\@@bacolor]{\blackrule}}%
- [#1::\syncprefix:\synccounter]%
- \egroup}
-
-\def\synchronizationbar[#1][#2]%
- {\iflocation\ifsynchronisation
- \bgroup
- \setupsynchronizationbar
- [\c!text=\getvalue{doc:des:#1},#2]%
- \getvalue{synchronisatie\@@baalternative}[#1]%
- \egroup
- \fi\fi}
-
-% A nice application of glue. All this code will be rewritten and
-% generalized.
-
-\newbox\interactionbarbox
-
-\newif\ifbarsymbol
-
-\def\dogotosomepage#1#2#3% nog checken !
- {\checkreferences % nodig ??
- \hbox
- {\iflocation
- \ifnum#3=\realpageno
- #2%
- \else
- \gotorealpage\empty\empty{#3}{\doifsomething{#1}{\dolocationattributes{#1}\c!style\c!color}{#2}}%
- \fi
- \else
- #2%
- \fi}}
-
-\def\dogotosomecontrastpage#1#2#3% nog checken, may replace previous
- {\checkreferences % nodig ??
- \hbox
- {\iflocation
- \ifnum#3=\realpageno
- \gotorealpage\empty\empty{#3}{\doifsomething{#1}{\dolocationattributes{#1}\c!style\c!contrastcolor}{#2}}%
- \else
- \gotorealpage\empty\empty{#3}{\doifsomething{#1}{\dolocationattributes{#1}\c!style\c!color}{#2}}%
- \fi
- \else
- #2%
- \fi}}
-
-\presetlocalframed[\??ib]
-
-\def\interactionbara % we need better control over contrastcolor
- {\iflocation % maybe just use gotopage and set colors
- \bgroup
- \setinteractionparameter\c!width\zeropoint
- \setupblackrules[\c!height=\v!max,\c!depth=\v!max]%
- \!!widthb\dimexpr\@@ibwidth-2.75\emwidth\relax
- \!!widtha\dimexpr\!!widthb/\lastpage\relax
- \bgroup
- \advance\realpageno\minusone
- \ifvoid\interactionbarbox
- \bgroup
- \processaction
- [\@@ibstep]
- [ \v!small=>\scratchdimen.25\emwidth,
- \v!medium=>\scratchdimen.5\emwidth,
- \v!big=>\scratchdimen\emwidth,
- \s!unknown=>\scratchdimen\!!widtha]%
- \ifdim\!!widtha<\scratchdimen\relax
- \!!counta\numexpr\scratchdimen/\!!widtha\relax
- \else
- \!!counta\@@ibstep\relax
- \fi
- \!!widtha\!!counta\!!widtha
- \setbox\scratchbox\hbox{\blackrule[\c!width=\!!widtha,\c!color=middlegray]}% color here, else no mkiv
- \global\setbox\interactionbarbox\hbox to \!!widthb
- {\hss
- \dostepwiserecurse\plusone\lastpage\!!counta
- {\gotorealpage\empty\empty\recurselevel{\copy\scratchbox}}%
- \hss}%
- \wd\interactionbarbox\zeropoint
- \egroup
- \fi
- \egroup
- \noindent
- \strut
- \hbox to \@@ibwidth
- {\dontcomplain
- \setupblackrules[\c!width=\emwidth]%
- \dogotosomecontrastpage\??ib\blackrule\firstpage
- \hss
- \copy\interactionbarbox
- \hbox to \!!widthb
- {\ifdim\!!widtha<\emwidth
- \!!widtha\emwidth
- \fi
- \setupblackrules[\c!width=\!!widtha]%
- \ifnum\realpageno>\plusone
- \!!counta\numexpr\realpageno-\plustwo\relax
- \hskip\zeropoint\!!plus\!!counta \s!sp\relax % cm gives overflow
- \dogotosomepage\??ib\blackrule\prevpage
- \fi
- \dogotosomecontrastpage\??ib{\blackrule[\c!width=.5em]}\realpageno
- \ifnum\realpageno<\lastpage\relax
- \dogotosomepage\??ib\blackrule\nextpage
- \!!counta\numexpr\lastpage-\realpageno-\plusone\relax
- \hskip\zeropoint\!!plus\!!counta \s!sp\relax % cm gives overflow
- \fi}%
- \hss
- \dogotosomecontrastpage\??ib\blackrule\lastpage}%
- \egroup
- \fi}
-
-\def\interactionbarb
- {\ifnum\lastpage>\firstpage\relax
- \interactionbuttons[\v!firstpage,\v!previouspage,\v!nextpage,\v!lastpage]%
- \fi}
-
-\def\interactionbarc
- {\iflocation
- \ifnum\lastpage>\plusone
- \hbox to \@@ibwidth
- {\setupblackrules[\c!height=\@@ibheight,\c!depth=\@@ibdepth]%
- \scratchdimen\dimexpr(\@@ibwidth-4\emwidth)/\numexpr\lastpage+\minusone\relax\relax
- \!!widtha\numexpr\realpageno+\minusone\relax\scratchdimen
- \!!widthb\numexpr\lastpage-\realpageno\relax\scratchdimen
- \startcolor[\locationcolor\@@ibcolor]%
- \dogotosomepage\empty{\blackrule[\c!width=\emwidth]}\firstpage
- \hss
- \dogotosomepage\empty{\blackrule[\c!width=\!!widtha]}\prevpage
- \color[\@@ibcontrastcolor]{\blackrule[\c!width=\emwidth]}%
- \dogotosomepage\empty{\blackrule[\c!width=\!!widthb]}\nextpage
- \hss
- \dogotosomepage\empty{\blackrule[\c!width=\emwidth]}\lastpage
- \stopcolor}%
- \fi
- \fi}
-
-\def\interactionbard
- {\iflocation\ifshowingsubpage
- \ifnum\nofsubpages>\plusone
- \hbox \bgroup
- \setinteractionparameter\c!width\!!zeropoint
- \ifbarsymbol
- \setupsymbolset[\@@iasymbolset]%
- \def\dogotox##1%
- {\hbox{\symbol[\ifcase##1 \v!previous\or\v!somewhere\or\v!next\fi]}}%
- \else
- \def\dogotox##1%
- {\hbox{\vrule\!!height\@@ibheight\!!depth \@@ibdepth\!!width \@@ibwidth}}%
- \fi
- \dostepwiserecurse\plusone\nofsubpages\plusone
- {\bgroup
- \scratchcounter\numexpr\recurselevel+\firstsubpage+\minusone\relax
- \ifnum\scratchcounter<\realpageno\relax
- \dogotosomecontrastpage\??ib{\dogotox0}\scratchcounter
- \else\ifnum\scratchcounter=\realpageno\relax
- \dogotosomecontrastpage\??ib{\dogotox1}\scratchcounter
- \else
- \dogotosomecontrastpage\??ib{\dogotox2}\scratchcounter
- \fi\fi
- \egroup
- \hskip\@@ibdistance}%
- \unskip % not needed
- \egroup
- \fi
- \fi\fi}
-
-\def\interactionbare% KAN WORDEN GECOMBINEERD MET D
- {\iflocation\ifshowingsubpage
- \ifnum\nofsubpages>\plusone
- \bgroup
- \!!widthb\dimexpr\nofsubpages\dimexpr\@@ibdistance\relax-\@@ibdistance\relax % (n-1)
- \!!widtha\dimexpr(\@@ibwidth-\!!widthb)/\nofsubpages\relax
- \ifdim\!!widtha<\@@ibdistance\relax
- \interactionbarf
- \else
- \setinteractionparameter\c!width\!!zeropoint
- \noindent
- \hbox to \@@ibwidth
- \bgroup
- \ifbarsymbol
- \setupsymbolset[\@@iasymbolset]%
- \def\dogotox##1%
- {\hbox{\symbol[\ifcase##1 \v!previous\or\v!somewhere\or\v!next\fi}}%
- \else
- \def\dogotox##1%
- {\hbox{\vrule\!!height\@@ibheight\!!depth\@@ibdepth\!!width\!!widtha}}%
- \fi
- \dostepwiserecurse\plusone\nofsubpages\plusone
- {\bgroup
- \scratchcounter\numexpr\recurselevel+\firstsubpage+\minusone\relax
- \ifnum\scratchcounter<\realpageno\relax
- \dogotosomecontrastpage\??ib{\dogotox0}\scratchcounter
- \else\ifnum\scratchcounter=\realpageno\relax
- \dogotosomecontrastpage\??ib{\dogotox1}\scratchcounter
- \else
- \dogotosomecontrastpage\??ib{\dogotox2}\scratchcounter
- \fi\fi
- \egroup
- \hss}%
- \unskip
- \egroup
- \fi
- \egroup
- \fi
- \fi\fi}
-
-\def\interactionbarf % !! KAN WORDEN GECOMBINEERD MET D !!
- {\iflocation\ifshowingsubpage
- \ifnum\nofsubpages>\plusone
- \setinteractionparameter\c!width\!!zeropoint
- \noindent
- \hbox to \@@ibwidth
- \bgroup
- \!!countb\zerocount
- \loop % todo: \doloop
- \advance\!!countb \plusone
- %\!!countc\nofsubpages \divide\!!countc \!!countb \advance\!!countc \plusone
- \!!countc\numexpr(\nofsubpages/\!!countb)+\plusone\relax % rounding
- \!!widthb\@@ibdistance
- \multiply\!!widthb \!!countc
- \advance\!!widthb -\@@ibdistance
- \!!widtha\@@ibwidth
- \advance\!!widtha -\!!widthb
- \divide\!!widtha \!!countc
- \ifdim\!!widtha<\@@ibdistance\relax
- \repeat
- \ifnum\!!countc>\plusone
- % this is not that well tested
- \advance\!!countc \minustwo
- \!!widtha-\@@ibdistance
- \!!widtha\!!countc\!!widtha
- \advance\!!widtha \@@ibwidth
- \advance\!!countc \plusone
- \divide\!!widtha \!!countc
- \fi
- \ifbarsymbol
- \setupsymbolset[\@@iasymbolset]%
- \def\dogotox##1%
- {\hbox{\symbol[\ifcase##1 \v!previous\or\v!somewhere\or\v!somewhere\or\v!somewhere\or\v!next\fi}}%
- \else
- \def\dogotox##1%
- {\hbox
- {\!!heighta\@@ibheight
- \!!deptha\@@ibdepth
- \ifcase##1\relax
- \vrule\!!height \!!heighta\!!depth \!!deptha\!!width\!!widtha
- \or
- \vrule\!!height.5\!!heighta\!!depth.5\!!deptha\!!width\!!widtha
- \or
- \vrule\!!height \!!heighta\!!depth \!!deptha\!!width\!!widtha
- \or
- \vrule\!!height.5\!!heighta\!!depth.5\!!deptha\!!width\!!widtha
- \or
- \vrule\!!height \!!heighta\!!depth \!!deptha\!!width\!!widtha
- \fi}}%
- \fi
- \!!countc\numexpr\realpageno-\plustwo\relax
- \!!countd\numexpr\realpageno+\plustwo\relax
- \ifnum\!!countc<\plusone \!!countc\plusone \fi
- \!!countf\zerocount
- \dostepwiserecurse\firstsubpage\lastsubpage\plusone
- {\!!doneafalse
- \advance\!!countf \plusone
- \ifnum\recurselevel=\firstsubpage\relax \!!doneatrue \fi
- \ifnum\recurselevel=\lastsubpage\relax \!!doneatrue \fi
- \if!!donea
- \ifnum\recurselevel<\realpageno
- \dogotosomecontrastpage\??ib{\dogotox0}\recurselevel
- \else\ifnum\recurselevel>\realpageno
- \dogotosomecontrastpage\??ib{\dogotox2}\recurselevel
- \else
- \dogotosomecontrastpage\??ib{\dogotox4}\recurselevel
- \fi\fi
- \hss
- \!!countf\zerocount
- \else\ifnum\!!countf=\!!countb
- \ifnum\recurselevel<\realpageno
- \dogotosomecontrastpage\??ib{\dogotox1}\recurselevel
- \else\ifnum\recurselevel>\realpageno
- \dogotosomecontrastpage\??ib{\dogotox3}\recurselevel
- \else
- \dogotosomecontrastpage\??ib{\dogotox2}\recurselevel
- \fi\fi
- \hss
- \!!countf\zerocount
- \fi\fi}%
- \unskip
- \egroup
- \fi
- \fi\fi}
-
-\def\interactionbarg
- {\ifnum\lastsubpage>\firstsubpage\relax
- \interactionbuttons[\v!firstsubpage,\v!previoussubpage,\v!nextsubpage,\v!lastsubpage]%
- \fi}
-
-\def\checkinteractionbar#1#2#3%
- {\ifdim\@@ibwidth=\zeropoint\def\@@ibwidth{#1}\fi
- \doifnothing\@@ibheight{\def\@@ibheight{#2}}%
- \doifnothing\@@ibdepth{\def\@@ibdepth{#3}}}
-
-\def\complexinteractionbar[#1]%
- {\doifelse{#1}\v!reset
- {\global\setbox\interactionbarbox\emptybox}%
- {\bgroup
- \iflocation
- \checksubpages % goes wrong / loads \numberofpages too
- \getparameters[\??ib][#1]%
- \doif\@@ibstate\v!start
- {\startinteraction
- \processaction % breedte defaults !
- [\@@ibalternative]
- [ c=>\checkinteractionbar{10em}\v!max \v!max,
- d=>\checkinteractionbar{.5em}{.5em} \!!zeropoint,
- e=>\checkinteractionbar{10em}{.5em} \!!zeropoint,
- f=>\checkinteractionbar{10em}{.5em} \!!zeropoint,
- \s!default=>\checkinteractionbar{10em}\v!broad\!!zeropoint,
- \s!unknown=>\checkinteractionbar{10em}\v!broad\!!zeropoint]%
- \doifelse\@@ibsymbol\v!yes
- \barsymboltrue\barsymbolfalse
- \getvalue{interactionbar\@@ibalternative}%
- \stopinteraction}%
- \fi
- \egroup}}
-
-\definecomplexorsimpleempty\interactionbar
-
-\def\setupinteractionbar
- {\dodoubleargument\getparameters[\??ib]}
-
-% Er wordt vooralsnog uitgegaan van een symmetrische
-% start-stop situatie.
-
-\def\c!profiel!! {profiel:} % brrr
-\def\c!versie!! {versie:}
-
-\def\dodefineprofile[#1][#2]%
- {\iflocation
- \def\dododefineprofile##1%
- {\def\dodododefineprofile####1%
- {\doifdefinedelse{\c!profiel!!####1}%
- {\edef\!!stringa{\getvalue{\c!profiel!!####1}}%
- \setevalue{\c!profiel!!####1}{\!!stringa,##1}}%
- {\setevalue{\c!profiel!!####1}{##1}}}%
- \processcommalist[#2]\dodododefineprofile}%
- \processcommalist[#1]\dododefineprofile
- \fi}
-
-\def\defineprofile%
- {\dodoubleargument\dodefineprofile}
-
-% Als met \getpar wordt gewerkt, dan moet \next worden toegepast.
-
-% TZT initialisatie!
-
-\def\profilepage{}
-
-\let\dosetprofilepage\relax
-\let\dogetprofilepage\relax
-
-\def\processprofile#1[#2]%
- {\iflocation
- \par % needed for pdftex
- \bgroup
- \dosetprofilepage
- \dogetprofilepage
- \def\processoneprofile##1##2%
- {\ExpandBothAfter\doifinsetelse{##2}{\processedprofiles}%
- {\doifsomething{##1}{(##1)}}%
- {\addtocommalist{##2}\processedprofiles
- ##1\relax
- \ifcase#1\relax
- \dobeginofprofile{##2}\paperwidth\paperheight\profilepage
- \else
- \doendofprofile
- \fi}}%
- \let\processedprofiles\empty
- \def\doprocessprofile##1%
- {\doifelse{\@@pfoption}{\v!test}%
- {\goodbreak\blank\nobreak\tt[\space
- \ifcase#1\v!start\else\v!stop\fi profiel\space ##1:\space
- \doifdefinedelse{\c!profiel!!##1}%
- {\def\dodoprocessprofile####1%
- {\processoneprofile
- {\goto{####1}[\c!profiel!!####1]}%
- {####1}%
- \space}%
- \processcommacommand
- [\getvalue{\c!profiel!!##1}]\dodoprocessprofile}%
- {- }%
- ]\nobreak\blank}%
- {\doifdefined{\c!profiel!!##1}%
- {\def\dodoprocessprofile####1%
- {\processoneprofile{}{####1}}%
- \processcommacommand
- [\getvalue{\c!profiel!!##1}]\dodoprocessprofile}}}%
- \processcommalist[#2]\doprocessprofile
- \egroup
- \par % needed for pdftex
- \fi}
-
-\def\startprofile[#1]%
- {\iflocation
- \bgroup
- \addtocommalist{#1}\actualprofile
- \def\stopprofile%
- {\processprofile1[#1]%
- \egroup}%
- \def\next{\processprofile0[#1]}% % \DoAfterFi \processprofile0[#1]%
- \else % ^^^^^^^^^^ will be obsolete
- \let\next\relax % since ugly and never used
- \fi
- \next}
-
-\let\stopprofile\relax
-
-\def\dofollowprofile#1[#2]%
- {\iflocation
- \hbox
- {\dohandlegoto
- {\dolocationattributes\??ia\c!style\c!color{#1\presetgoto}}%
- {\dostartgotoprofile\buttonwidth\buttonheight{#2}}%
- {\dostopgotoprofile}}%
- \else
- {#1}%
- \fi}
-
-\def\followprofile#1[#2]%
- {\iflocation
- \doif\@@pfoption\v!test{\pagereference[\c!profiel!!#2]}%
- \dofollowprofile{#1}[#2]%
- \fi}
-
-\def\setupprofiles%
- {\dodoubleargument\getparameters[\??pf]}
-
-% Als er nog geen tekst op de pagina staat, dan heeft het
-% profiel betrekking op het bovenstaande, dus soms een vorige
-% pagina! Vreemd, omdat PDF paginagewijs werkt. Gelukkig
-% biedt /page een oplossing. Echter: expansie van een
-% \special kan niet worden uitgesteld, zodat alleen een
-% two-pass een oplossing vormt. Het onderstaande kan komen
-% te vervallen als Acrobat dit ondervangt. Het scheelt een
-% pass en een lijst.
-%
-% Er kunnen eventueel twee lijsten worden gebruikt. Een voor
-% het begin (start) en een voor het eind (stop). Nu staat
-% alles in een lijst.
-
-\definetwopasslist\s!profile
-
-\newcounter\currentprofile
-
-\def\dosetprofilepage%
- {\doglobal\increment\currentprofile
- \lazysavetwopassdata{\s!profile}{\currentprofile}{\noexpand\realfolio}}
-
-\def\dogetprofilepage%
- {\gettwopassdata{\s!profile}%
- \let\profilepage=\twopassdata}
-
-% is this stuff used at all
-
-\newcounter\versionlevel
-\newcounter\versionorder
-
-\newif\ifrecentversion
-
-\let\oldatcharacter=@
-
-\def\minimumversion{0}
-\def\actualversion{0}
-
-\def\dosetupversions[#1]%
- {\getparameters[\??ve][#1]
- \stripcharacter.\from\@@venumber\to\minimumversion}
-
-\def\setupversions
- {\dosingleargument\dosetupversions}
-
-\definetwopasslist\s!versionbegin
-\definetwopasslist\s!versionend
-
-\let\actualprofile\empty
-
-\def\doresetpageversion
- {\lazysavetwopassdata{\s!versionend}{\versionorder}{\noexpand\realfolio}}
-
-\def\dosetpageversion#1%
- {\recentversiontrue
- \doglobal\increment\versionorder\relax
- \lazysavetwopassdata{\s!versionbegin}{\versionorder}{\noexpand\realfolio}%
- \let\resetpageversion\doresetpageversion}
-
-\def\recentcontributions{}
-
-\def\checkrecentcontributions%
- {\gettwopassdata{\s!versionbegin}%
- \iftwopassdatafound
- \!!counta\twopassdata\relax
- \gettwopassdata{\s!versionend}%
- \iftwopassdatafound
- \!!countb\twopassdata\relax
- \doglobal\increment\versionorder\relax
- \savetwopassdata{\s!versionbegin}{\versionorder}{\the\!!counta}%
- \savetwopassdata{\s!versionend }{\versionorder}{\the\!!countb}%
- \dostepwiserecurse\!!counta\!!countb\plusone
- {\@EA\doglobal\@EA\addtocommalist\@EA{\recurselevel}{\recentcontributions}}%
- \let\next\checkrecentcontributions
- \else
- \let\next\relax
- \fi
- \else
- \let\next\relax
- \fi
- \next}
-
-\def\docheckpageversion
- {\ExpandBothAfter\doifinsetelse{\realfolio}{\recentcontributions}
- {\pageselectedtrue}%
- {\pageselectedfalse}}
-
-\let\setpageversion \gobbleoneargument
-\let\resetpageversion \relax
-\let\checkpageversion \relax
-
-\def\complexstartversion[#1]%
- {\bgroup
- \doifelsenothing\actualprofile
- {\startprofile[#1]}%
- {\startprofile[#1,\actualprofile]}%
- \def\docomplexstartversie##1%
- {\stripcharacter.\from##1\to\actualversion
- \ifnum\versionlevel>\zerocount\relax
- \ifnum\actualversion=\zerocount
- \setpageversion\actualversion % unknown version
- \else
- \ifnum\actualversion<\minimumversion\relax
- \relax % old version
- \else
- \setpageversion\actualversion % new version
- \fi
- \fi
- \fi}%
- \doglobal\increment\versionlevel\relax
- \doifelsenothing{#1}
- {\docomplexstartversie{0}}%
- {\processcommalist[#1]\docomplexstartversie}}
-
-\definecomplexorsimpleempty\startversion
-
-\def\stopversion
- {\stopprofile
- \doglobal\decrement\versionlevel
- \ifnum\versionlevel<\zerocount
- \showmessage\m!versions1\empty
- \else
- \resetpageversion
- \egroup
- \fi}
-
-\def\markversion
- {\showmessage\m!versions2\empty
- \let\setpageversion\dosetpageversion
- \let\resetpageversion\relax
- \let\checkpageversion\relax}
-
-\def\selectversion
- {\checkrecentcontributions
- \showmessage\m!versions3\recentcontributions
- \let\setpageversio\gobbleoneargument
- \let\resetpageversion\relax
- \let\checkpageversion\docheckpageversion}
-
-\def\dodefineversion[#1][#2]%
- {\setvalue{\c!versie!!#1}{#2}%
- \defineprofile[#1][#2]}
-
-\def\defineversion
- {\dodoubleargument\dodefineversion}
-
-\def\followversion
- {\followprofile}
-
-\def\followprofileversion#1[#2][#3]%
- {\def\docommand##1%
- {\defineprofile[#2#3][##1]}%
- \processcommacommand[\getvalue{\c!versie!!#3}]\docommand
- \followprofile#1[#2#3]}
-
-\newcounter\currentpagetransition
-
-\newif\ifrandomtransitions
-
-\def\setuppagetransitions%
- {\dosingleempty\dosetuppagetransitions}
-
-\def\dosetuppagetransitions[#1]%
- {\doifelsenothing{#1}
- {\doifnot\@@scdelay\v!none
- {\let\setpagetransition\setsomepagedelay}}
- {\doifelse{#1}\v!start
- {\doifnot\@@scdelay\v!none
- {\let\setpagetransition\setsomepagedelay}}
- {\doglobal\newcounter\currentpagetransition
- \doifinsetelse{#1}{\v!reset,\v!stop}
- {\let\setpagetransition\relax}
- {\let\setpagetransition\setsomepagetransition
- \doifinsetelse\v!random{#1}
- {\randomtransitionstrue}{\randomtransitionsfalse}%
- \edef\userpagetransitions{#1}%
- \@EA\removefromcommalist\@EA{\v!random}\userpagetransitions
- \ifx\userpagetransitions\empty
- \let\userpagetransitions\pagetransitions
- \fi}}}}
-
-\def\setsomepagedelay
- {\expanded{\dosetpagetransition{0}{\@@scdelay}}}
-
-\def\setsomepagetransition
- {\iflocation
- \ifrandomtransitions
- \expanded{\getcommalistsize[\userpagetransitions]}%
- \getrandomnumber\currentpagetransition1\commalistsize
- \else
- \doglobal\increment\currentpagetransition
- \fi
- \expanded{\getfromcommalist[\userpagetransitions][\currentpagetransition]}%
- \doifnumberelse\commalistelement
- {\expanded{\getfromcommalist[\pagetransitions][\commalistelement]}}
- {}%
- \ifx\commalistelement\empty
- \doglobal\newcounter\currentpagetransition
- \setsomepagetransition
- \else
- \doifelse\@@scdelay\v!none
- {\expanded{\dosetpagetransition{\commalistelement}{0}}}
- {\expanded{\dosetpagetransition{\commalistelement}{\@@scdelay}}}%
- \fi
- \fi}
-
-\prependtoks \setpagetransition \to \everyshipout
-
-% temporary here
-
-%D \startbuffer
-%D \dorecurse{10}
-%D {\horizontalpositionbar
-%D \pos\recurselevel \min1 \max10
-%D \token\framed{\recurselevel}%
-%D \\}
-%D
-%D \hbox to 15em
-%D {\hss
-%D \dorecurse{10}
-%D {\verticalpositionbar\pos\recurselevel\min1\max10\token\blackrule\\
-%D \hss}}
-%D \stopbuffer
-
-\def\horizontalpositionbar\pos#1\min#2\max#3\token#4\\%
- {\hbox to \hsize
- {\hskip\zeropoint\!!plus #1\!!fill
- \hskip\zeropoint\!!plus-#2\!!fill
- #4\relax
- \hskip\zeropoint\!!plus #3\!!fill
- \hskip\zeropoint\!!plus-#1\!!fill}}
-
-\def\verticalpositionbar\pos#1\min#2\max#3\token#4\\%
- {\vbox to \vsize
- {\vskip\zeropoint\!!plus #1\!!fill
- \vskip\zeropoint\!!plus-#2\!!fill
- \hbox{#4}\relax
- \vskip\zeropoint\!!plus #3\!!fill
- \vskip\zeropoint\!!plus-#1\!!fill}}
-
-\def\horizontalgrowingbar\pos#1\min#2\max#3\height#4\depth#5\\%
- {\hbox to \hsize
- {\scratchcounter#1%
- \advance\scratchcounter -#2%
- \advance\scratchcounter \plusone
- \leaders\vrule\hskip\zeropoint\!!plus \scratchcounter\!!fill
- \vrule\!!width\zeropoint\!!height#4\!!depth#5%
- \hskip\zeropoint\!!plus #3\!!fill
- \hskip\zeropoint\!!plus-#1\!!fill}}
-
-\def\verticalgrowingbar\pos#1\min#2\max#3\width#4\\%
- {\vbox to \vsize
- {\scratchcounter#1%
- \advance\scratchcounter -#2%
- \advance\scratchcounter \plusone
- \leaders\hrule\vskip\zeropoint\!!plus\scratchcounter\!!fill
- \hrule\!!width#4\!!height\zeropoint\!!depth\zeropoint
- \vskip\zeropoint\!!plus #3\!!fill
- \vskip\zeropoint\!!plus-#1\!!fill}}
-
-\newbox\commentbox
-
-\def\doflushcommentanchors
- {\let\next\relax % new
- \processaction
- [\@@cclocation]
- [% \v!text=>\let\next\relax, % new
- \v!inmargin=>\let\next\inmargin, % brr not the same as inleft|rightmargin
- \v!leftedge=>\let\next\inleftedge,
- \v!rightedge=>\let\next\inrightedge,
- \v!leftmargin=>\let\next\inleftmargin,
- \v!rightmargin=>\let\next\inrightmargin]%
- \next{\hbox{\raise\strutht\box\commentbox}}}
-
-\def\flushcommentanchors % in everypar so indirect
- {\ifvoid\commentbox\else \doflushcommentanchors \fi}
-
-\def\setupcomment
- {\dodoubleargument\getparameters[\??cc]}
-
-\setvalue{\e!start\v!comment}% the dummy triple gobbles trailing spaces
- {\dotripleempty\dostartcommentaar}
-
-\def\comment
- {\dodoubleempty\docomment}
-
-\def\dodocomment#1%
- {\!!widtha\@@ccwidth
- \!!heighta\@@ccheight
- \doifelse\@@ccoption\v!max
- {\let\@@ccopen \!!plusone}{\let\@@ccopen \!!zerocount}%
- \doifelse\@@ccoption\v!buffer
- {\let\@@cccollect\!!plusone}{\let\@@cccollect\!!zerocount}%
- \preparecommentvariables
- \doinsertcomment
- \@@cctitle\!!widtha\!!heighta
- \@@cccolor\@@ccopen\@@ccsymbol
- \@@cccollect{#1}}
-
-\def\preparecommentvariables % more will move here as with fields
- {\let\@@DriverCommentLayer\@@cctextlayer}
-
-\def\dopreparecommentaar#1#2%
- {\doifassignmentelse{#1}
- {\getparameters[\??cc][#1]}
- {\getparameters[\??cc][\c!title=#1,#2]}%
- \obeylines
- \doif\@@ccspace\v!yes\obeyspaces}
-
-\def\dostartcommentaar[#1][#2][#3]%
- {\bgroup
- \doifelse\@@ccstate\v!start
- {\dopreparecommentaar{#1}{#2}%
- \long\def\docommand##1%
- {\global\setbox\commentbox\frozenhbox
- {\hbox to \zeropoint
- {\struttedbox{\tbox{\dodocomment{##1}}}\hss}%
- \hskip\ifvoid\commentbox\@@ccmargin\else\@@ccdistance\fi
- \box\commentbox}%
- \egroup}}%
- {\long\def\docommand##1%
- {\egroup}}%
- \grabuntil{\e!stop\v!comment}\docommand}
-
-\letvalue{\e!stop\v!comment}\relax % handy for \expanded{...}
-
-\def\docomment[#1][#2]#3%
- {\doif\@@ccstate\v!start
- {\hbox to \zeropoint
- {\dopreparecommentaar{#1}{#2}%
- \hskip-\@@ccmargin
- \struttedbox{\tbox{\dodocomment{#3}}\hss}}}%
- \ignorespaces}
-
-% \startcomment
-% hello beautiful\\world
-% \stopcomment
-%
-% \startcomment[hello]
-% hello << \'e\'erste >>
-% beautiful
-% world
-% \stopcomment
-%
-% \startcomment[hello][color=green,width=4cm,height=3cm]
-% hello \leftguillemot\ \'e\'erste \rightguillemot\
-% beautiful
-% world
-% \stopcommentaar
-%
-% \startcomment[hello][color=green,width=4cm,height=3cm]
-% hello \leftguillemot\ \'e\'erste \rightguillemot\ test
-%
-% beautiful
-%
-% world
-% \stopcomment
-%
-% \startcomment[symbol=Balloon]
-% Do we want this kind of rubish? And, why isn't this and
-% some more features related to text annotations so poorly
-% (actually not) documented? Anyhow, by providing this
-% functionality we demonstrate that \pdfTeX\ can do it. By
-% the way, it's funny that when in Acrobat we scale up the
-% text, the symbols scale down.
-% \stopcomment
-
-% \definesymbol [comment-normal][{\externalfigure[cow.pdf]}]
-% \definesymbol [comment-down] [{\externalfigure[cow.pdf]}]
-%
-% \def\CowSymbol#1#2%
-% {\scale
-% [\c!height=#1]
-% {\startMPcode
-% loadfigure "koe.mp" number 1 ;
-% refill currentpicture withcolor #2 ;
-% \stopMPcode}}
-%
-% \definesymbol [comment-normal]
-% [\CowSymbol{4ex}{red}]
-%
-% \definesymbol [comment-down]
-% [\CowSymbol{4ex}{green}]
-%
-% \setupcomment
-% [\c!symbol={comment-normal,comment-down},
-% \c!option=\v!buffer]
-%
-% \setupfootertexts[\placecomments]
-
-\def\placecomments
- {\doflushcomments}
-
-% \setupinteraction[state=start]
-%
-% \useattachment[test.tex]
-% \useattachment[whatever][test.tex]
-% \useattachment[whatever][newname][test.tex]
-% \useattachment[whatever][title][newname][test.tex]
-%
-% % \setupattachments[\c!symbol={symbol-normal,symbol-down}]
-%
-% \starttext \attachment[whatever] \stoptext
-
-
-\def\useattachment
- {\doquadrupleempty\douseattachment}
-
-\def\douseattachment[#1][#2][#3][#4]% tag title newname filename
- {\iffourthargument
- \setgvalue{\??at:#1}{{#2}{#3}{#4}}% tooltip kind of case
- \else\ifthirdargument
- \setgvalue{\??at:#1}{{#2}{#2}{#3}}% full path case
- \else\ifsecondargument
- \setgvalue{\??at:#1}{{#2}{#2}{#2}}% obvious case
- \else
- \setgvalue{\??at:#1}{{#1}{#1}{#1}}% worst case
- \fi\fi\fi}
-
-\let\attachmenttitle\empty
-\let\attachmentname \empty
-\let\attachmentfile \empty
-
-\def\getattachmentdata[#1]%
- {\edef\attachmenttitle{\filterfromvalue{\??at:#1}31}% description
- \edef\attachmentname {\filterfromvalue{\??at:#1}32}% new name
- \edef\attachmentfile {\filterfromvalue{\??at:#1}33}% original
- \expandafter\splitstring\attachmentname\at.\to\!!stringa\and\!!stringb
- \ifx\!!stringb\empty % no suffix, so we need to inherit it
- \expandafter\splitstring\attachmentfile\at.\to\!!stringc\and\!!stringd
- \edef\attachmentname{\attachmentname.\!!stringd}%
- \fi}
-
-\def\attachment
- {\dodoubleempty\doattachment}
-
-\def\doattachment[#1][#2]% currently title equals newname
- {\iflocation
- \ifsecondargument
- \doifundefined{\??at:#2}
- {\showmessage\m!interactions6{#2}%
- \useattachment[#2]}%
- \doif\@@atstate\v!start
- {\bgroup
- \getattachmentdata[#2]%
- \doiffileelse\attachmentfile
- {\setupattachments[#1]%
- \presetattachmentvariables
-\struttedbox{\tbox{%
- \doattachfile
- \attachmenttitle
- {1em}\strutheight\strutdepth\@@atcolor\@@atsymbol
- \attachmentname
- \attachmentfile}%
-}}%
- {\showmessage\m!interactions5\attachmentfile}%
- \egroup}%
- \else\iffirstargument
- \attachment[][#1]%
- \fi\fi
- \fi}
-
-\def\presetattachmentvariables
- {\let\@@DriverAttachmentLayer\@@attextlayer}
-
-\def\setupattachments
- {\dodoubleempty\getparameters[\??at]}
-
-\setupattachments
- [\c!state=\v!start,
- \c!color=\@@iacolor,
- \c!textlayer=,
- \c!symbol=]
-
-% jammer, tussen/midden had erin gemoeten; \c!commando toevoegen
-
-\def\registermenucommand#1%
- {{\textonly\noindent#1\space}} % no math switching
-
-\def\doregistermenubuttons[#1][#2]% [menu id] [register]
- {\bgroup
- \ifsecondargument
- \setupinteractionmenu
- [#1][\c!unknownreference=\v!yes,\c!samepage=\v!yes]%
- \def\docommand##1%
- {\registermenucommand{\menubutton[#1]{##1}[#2:##1]}}%
- \else
- \def\docommand##1%
- {\registermenucommand
- {\button
- [\c!unknownreference=\v!yes,\c!samepage=\v!yes]
- {##1}[#1:##1]}}%
- \fi
- \handletokens abcdefghijklmnopqrstuvwxyz\with\docommand % moet anders
- \egroup}
-
-\def\registermenubuttons
- {\dodoubleempty\doregistermenubuttons}
-
-% It took quite a while to figure this out (using the preliminary 1.5
-% spec). There are still a lot of things to be implemented. This is
-% the third alternative.
-
-% todo: multiple instances, dus indirect
-
-\let\currentrendering\empty
-
-\definereference[StartCurrentRendering] [\v!StartRendering {\currentrendering}]
-\definereference[StopCurrentRendering] [\v!StopRendering {\currentrendering}]
-\definereference[PauseCurrentRendering] [\v!PauseRendering {\currentrendering}]
-\definereference[ResumeCurrentRendering][\v!ResumeRendering{\currentrendering}]
-
-\newcounter\nofexternalrenderings
-
-\def\useexternalrendering{\doquadrupleempty\douseexternalrendering}
-\def\setinternalrendering{\dodoubleempty \dosetinternalrendering}
-
-\def\douseexternalrendering[#1][#2][#3][#4]% tag mime file options
- {\setgvalue{\??rd:#1}{\plusone{#1}{#2}{#3}{#4}}}
-
-\def\dosetinternalrendering[#1][#2]% tag options {content}
- {\bgroup
- \dowithnextbox
- {\setgvalue{\??rd:#1}{\plustwo{#1}{IRO}{#1}{#2}}%
- \let\objectoffset\zeropoint
- \setobject{IRO}{#1}\hbox{\box\nextbox}%
- \egroup}%
- \hbox}
-
-\def\checkrendering#1% let's hope that \next is not used
- {\iflocation
- \doifsomething{#1}%
- {\doifdefined{\??rd:#1}%
- {\expanded{\getvalue{\??rd::\number\renderingtype{#1}}%
- {\filterfromvalue{\??rd:#1}52}{\filterfromvalue{\??rd:#1}53}%
- {\filterfromvalue{\??rd:#1}54}{\filterfromvalue{\??rd:#1}55}}}}%
- \fi}
-
-\setvalue{\??rd::1}{\doinsertrendering}
-\setvalue{\??rd::2}{\doinsertrenderingobject}
-
-\def\renderingtype #1{\filterfromvalue{\??rd:#1}51}
-\def\renderingoptions#1{\filterfromvalue{\??rd:#1}55}
-
-\setexecutecommandcheck {startrendering} \checkrendering
-\setexecutecommandcheck {stoprendering} \checkrendering
-\setexecutecommandcheck {pauserendering} \checkrendering
-\setexecutecommandcheck {resumerendering} \checkrendering
-
-% by using a nice trick (used in other places of context as well) we
-% can easily overload the default size to match the opbject size
-
-\def\renderingwidth {8cm}
-\def\renderingheight{6cm}
-
-\def\definerenderingwindow
- {\dodoubleempty\dodefinerenderingwindow}
-
-\def\dodefinerenderingwindow[#1][#2]%
- {\presetlocalframed[\??rw#1]%
- \getparameters%
- [\??rw#1]%
- [\c!openpageaction=,\c!closepageaction=,%
- \c!width=\renderingwidth,\c!height=\renderingheight,%
- #2]}
-
-\def\setuprenderingwindow
- {\dodoubleargument\dosetuprenderingwindow}
-
-\def\dosetuprenderingwindow[#1]%
- {\getparameters[\??rw#1]}
-
-\def\placerenderingwindow
- {\dodoubleempty\doplacerenderingwindow}
-
-\def\doplacerenderingwindow[#1][#2]%
- {\bgroup
- \edef\currentrendering{\ifsecondargument#2\else#1\fi}%
- \ifcase\renderingtype\currentrendering\or
- % a file
- \or
- % an object
- \getobjectdimensions{IRO}\currentrendering
- \scratchdimen\objectheight
- \advance\scratchdimen\objectdepth
- \edef\renderingheight{\the\scratchdimen}%
- \edef\renderingwidth{\objectwidth}%
- \fi
- % create fall back if needed
- \doifdefinedelse{\??rw#1\c!width}
- {\def\currentrenderingwindow{#1}}
- {\let\currentrenderingwindow\s!default
- \definerenderingwindow[\currentrenderingwindow]}%
- \checkrendering\currentrendering
- \handlereferenceactions{\getvalue{\??rw\currentrenderingwindow\c!openpageaction }}\dosetuprenderingopenpageaction
- \handlereferenceactions{\getvalue{\??rw\currentrenderingwindow\c!closepageaction}}\dosetuprenderingclosepageaction
- \localframed
- [\??rw\currentrenderingwindow][\c!offset=\v!overlay]%
- {\expanded{\doinsertrenderingwindow
- \noexpand\currentrendering\hsize\vsize{\renderingoptions\currentrendering}}}%
- \egroup}
-
-% todo:
-%
-% \setinternalrendering[example-1][options]{}
-
-% test file:
-%
-% \definerenderingwindow
-% [example]
-% [width=320pt,height=150pt,frame=off,
-% background=color,backgroundcolor=gray,
-% openpageaction=StartCurrentRendering,
-% closepageaction=NextPage]% StopCurrentRendering]
-%
-% \useexternalrendering[example-1][audio/mpeg] [eldorado.mp3]
-% \useexternalrendering[example-2][audio/mpeg] [myst-12.mp3]
-% \useexternalrendering[example-3][application/x-shockwave-flash][http://localhost/mb.swf] [auto]
-% \useexternalrendering[example-4][application/x-shockwave-flash][celebration.swf]
-% \useexternalrendering[example-5][video/quicktime] [p1000726.mov]
-% \useexternalrendering[example-6][application/smil] [quadratic_map.smi]
-%
-% \def\renderingmenu[#1]%
-% {\hbox
-% {\setupbuttons[width=2.5em]%
-% \button{\symbol[StartRendering]} [StartRendering{#1}]\enspace
-% \button{\symbol[StopRendering]} [StopRendering{#1}]\enspace
-% \button{\symbol[PauseRendering]} [PauseRendering{#1}]\enspace
-% \button{\symbol[ResumeRendering]}[ResumeRendering{#1}]}}
-%
-% \renderingmenu[example-1]\blank
-% \renderingmenu[example-2]\blank
-% \renderingmenu[example-3]\blank
-% \renderingmenu[example-4] \placefigure{A ShockWave}{\placerenderingwindow[example][example-4]} \page
-% \renderingmenu[example-5] \placefigure{A Movie}{\placerenderingwindow[example][example-5]} \page
-% \renderingmenu[example-6] \placefigure{A Smile}{\placerenderingwindow[example][example-6]}
-
-\stelkoppelingenin
- [\c!distance=.25em,
- \c!width=\v!fit,
- \c!location=\v!low,
- \c!color=\@@iacolor,
- \c!frame=\v!off,
- \c!background=,
- \c!backgroundscreen=\@@rsscreen,
- \c!backgroundcolor=]
-
-\defineinteractionmenu
- [\v!right]
- [\v!right]
- [\c!before=,
- \c!after=\vfil,
- \c!inbetween=\blank,
- \c!distance=\bodyfontsize, % 12pt
- \c!left=\hss,
- \c!right=\hss,
- \c!width=\rightedgewidth,
- \c!height=\v!broad]
-
-\defineinteractionmenu
- [\v!left]
- [\v!left]
- [\c!before=,
- \c!after=\vfil,
- \c!inbetween=\blank,
- \c!distance=\bodyfontsize, % 12pt
- \c!left=\hss,
- \c!right=\hss,
- \c!width=\leftedgewidth,
- \c!height=\v!broad]
-
-\defineinteractionmenu
- [\v!bottom]
- [\v!bottom]
- [\c!before=\vss,
- \c!after=\vss,
- \c!middle=\hfil,
- \c!distance=\bodyfontsize, % 12pt
- \c!width=\v!fit,
- \c!height=\v!broad]
-
-\defineinteractionmenu
- [\v!top]
- [\v!top]
- [\c!before=\vss,
- \c!after=\vss,
- \c!middle=\hfil,
- \c!distance=\bodyfontsize, % 12pt
- \c!width=\v!fit,
- \c!height=\v!broad]
-
-\setupinteractionmenu
- [\v!left,\v!right,\v!top,\v!bottom]
- [\c!offset=.25em,
- \c!position=\v!no,
- \c!frame=\v!on,
- \c!background=,
- \c!backgroundcolor=,
- \c!backgroundscreen=\@@rsscreen,
- \c!style=\@@iastyle,
- \c!color=\@@iacolor,
- \c!contrastcolor=\@@iacontrastcolor,
- \c!state=\v!start,
- \c!samepage=\v!yes,
- \c!unknownreference=\v!empty,
- \c!topoffset=\!!zeropoint,
- \c!bottomoffset=\!!zeropoint,
- \c!leftoffset=\!!zeropoint,
- \c!rightoffset=\!!zeropoint]
-
-\def\placeleftedgetextblock % Is \hss/\hsize really needed here?
- {\hbox to \leftedgewidth % (check outer level and settings)
- {\hsize\leftedgewidth\hss\interactionmenus[\v!left]}}
-
-\def\placerightedgetextblock % Is \hss/\hsize really needed here?
- {\hbox to \rightedgewidth % (check outer level and settings)
- {\hsize\rightedgewidth\interactionmenus[\v!right]\hss}}
-
-\def\placetoptextblock
- {\vbox to \topheight
- {\vsize\topheight
- \csname\??tk\v!top\c!before\endcsname
- \interactionmenus[\v!top]%
- \csname\??tk\v!top\c!after\endcsname
- \kern\zeropoint}}
-
-\def\placebottomtextblock
- {\vbox to \bottomheight
- {\vsize\bottomheight
- \csname\??tk\v!bottom\c!before\endcsname
- \interactionmenus[\v!bottom]%
- \csname\??tk\v!bottom\c!after\endcsname
- \kern\zeropoint}}
-
-\ifx\leftedgetextcontent\undefined \else
-
- \appendtoks \placeleftedgetextblock \hskip-\leftedgewidth \to \leftedgetextcontent
- \appendtoks \placerightedgetextblock \hskip-\rightedgewidth \to \rightedgetextcontent
- \appendtoks \placetoptextblock \vskip-\topheight \to \toptextcontent
- \appendtoks \placebottomtextblock \vskip-\bottomheight \to \bottomtextcontent
-
-\fi
-
-\setupinteractionscreen
- [\c!width=\printpaperwidth,
- \c!height=\printpaperheight,
- \c!horoffset=\!!zeropoint,
- \c!veroffset=\!!zeropoint,
- \c!backspace=\backspace,
- \c!topspace=\topspace,
- \c!option=\v!min,
- \c!delay=\v!none]
-
-\setupbuttons
- [\c!state=\v!start,
- \c!width=\v!fit,
- \c!height=\v!broad,
- \c!offset=0.25em,
- \c!frame=\v!on,
- \c!background=,
- \c!backgroundscreen=\@@rsscreen,
- \c!backgroundcolor=,
- \c!style=\@@iastyle,
- \c!color=\@@iacolor,
- \c!contrastcolor=\@@iacontrastcolor,
- \c!samepage=\v!yes,
- \c!unknownreference=\v!yes]
-
-\setupinteractionbar
- [\c!state=\v!start,
- \c!alternative=a,
- \c!symbol=\v!no,
- \c!width=\rightedgewidth,
- \c!height=, % these are taken care
- \c!depth=, % of at calling time
- \c!distance=.5em, % beter relateren aan breedte
- \c!step=1,
- \c!color=\@@iacolor,
- \c!contrastcolor=\@@iacontrastcolor,
- \c!frame=\v!on,
- \c!background=,
- \c!backgroundscreen=\@@rsscreen,
- \c!backgroundcolor=,
- \c!samepage=\v!yes,
- \c!unknownreference=\v!yes]
-
-\setupsynchronizationbar
- [\c!alternative=\v!page,
- \c!width=\rightedgewidth,
- \c!style=\@@iastyle,
- \c!color=\@@iacolor,
- \c!background=,
- \c!backgroundscreen=\@@rsscreen,
- \c!backgroundcolor=]
-
-\setupsynchronization
- [\c!state=\v!stop]
-
-\setupprofiles
- [\c!option=]
-
-\setuppagetransitions
- [\v!reset]
-
-\setupcomment
- [\c!state=\v!start,
- \c!margin=2.5em,
- \c!distance=1em,
- \c!width=.3\textwidth,
- \c!height=.2\textheight,
- \c!color=\@@iacolor,
- \c!title=,
- \c!space=\v!no,
- \c!symbol=\v!normal,
- \c!location=\v!inmargin,
- \c!option=,
- \c!textlayer=]
-
-\setupversions % beware, @ is made active here,
- [\c!number=1, % therefore we set this one at the end
- \c!style=\ss,
- \c!color=]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/scrn-nav.mkii b/Master/texmf-dist/tex/context/base/mkii/scrn-nav.mkii
deleted file mode 100644
index 3bb56bacee7..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/scrn-nav.mkii
+++ /dev/null
@@ -1,379 +0,0 @@
-%D \module
-%D [ file=scrn-nav,
-%D version=1998.01.15,
-%D title=\CONTEXT\ Core Macros,
-%D subtitle=Navigation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Screen Macros / Navigation}
-
-\unprotect
-
-%D Support for interactive document is very present in
-%D \CONTEXT\ and interwoven in many modules. This means that in
-%D this module, where we deal with some common navigational
-%D features, there will be quite some forward references.
-%D
-%D When I started implementing hypertext support, the macros
-%D were mostly dealing with things related to locations, that
-%D is click in this location and goto that one. The
-%D functionality of many macro depends on the output medium:
-%D paper or screen. The next boolean holds the state:
-
-\newif\iflocation \def\ifinteractief{\iflocation} % upw comp
-
-%D We also allocate a scratchbox:
-
-\newbox\locationbox
-
-%D There is no interaction at all unless enabled by saying:
-%D
-%D \starttyping
-%D \setupinteraction[state=start]
-%D \stoptyping
-%D
-%D The other settings are:
-%D
-%D \showsetup{setupinteraction}
-%D
-%D In the special driver modules we introduced a switch that
-%D forces page destinations (instead of named ones). We set
-%D this switch here.
-
-\def\setinteractionparameter#1#2% use with case, no checking done
- {\setvalue{\??ia#1}{#2}} % pass #2, can be \blabla
-
-\def\resetinteractionparameter#1% use with case, no checking done
- {\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]%
- \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:
-
-\def\dolocationstartup
- {\iflocation
- \dosetupinteraction
- \handlereferenceactions\@@iaopenaction \dosetupopenaction
- \handlereferenceactions\@@iacloseaction\dosetupcloseaction
- \setupinteractionscreens
- \global\let\dolocationstartup\relax
- \fi}
-
-\appendtoks \dolocationstartup \to \everyshipout
-
-\def\dolocationpagecheck % brr pdf dependent
- {\iflocation
- \handlereferenceactions\@@iaopenpageaction \dosetupopenpageaction
- \handlereferenceactions\@@iaclosepageaction\dosetupclosepageaction
- \fi}
-
-\appendtoks \dolocationpagecheck \to \everyshipout
-
-%D The next few macros are really horrible. For proper
-%D navigation a in||line hypertext fragment must have
-%D comfortable properties, so we must force some minimal
-%D dimensions. On the other hand button, and here I mean those
-%D pieces of text with fancy outlines and/or backgrounds, often
-%D have fixed, preset dimensions.
-%D
-%D To make things even worse, if we choose to let the optimal
-%D dimensions depend on the height and depth of a strut, a not
-%D too uncommon practice in \TEX, we have to deal with the fact
-%D that such a strut, set inside a box, is unknown too the
-%D outside world.
-%D
-%D The solution lays in passing the strut characteristics in
-%D a proper way, in our case by applying \type{\presetgoto}:
-%D
-%D \starttyping
-%D {some piece of text \presetgoto}
-%D \stoptyping
-%D
-%D This macro stores the current strut values.
-
-\newif\iflocationstrut
-\newif\iflocationsplit
-
-\def\resetgoto
- {\globallet\@@ia@@hoogte\!!zeropoint
- \globallet\@@ia@@diepte\!!zeropoint}
-
-\resetgoto
-
-\def\presetgoto
- {\iflocationstrut
- \setstrut
- %\xdef\@@ia@@hoogte{\the\strutht}%
- %\xdef\@@ia@@diepte{\the\strutdp}%
- \globallet\@@ia@@hoogte\strutheight
- \globallet\@@ia@@diepte\strutdepth
- \else
- \globallet\@@ia@@hoogte\@@iaheight
- \globallet\@@ia@@diepte\@@iadepth
- \fi}
-
-%D In the macros that deal with making areas into hyperlinks,
-%D we use:
-
-\newbox\driverresources
-
-\def\collectdriverresource#1%
- {\global\setbox\driverresources\hbox{\box\driverresources#1}}
-
-\def\flushdriverresources
- {\ifvoid\driverresources\else\box\driverresources\fi}
-
-\def\dohandlegoto#1#2#3%
- {\ifsecondaryreference
- \bgroup\setbox0\hbox{#2#3}\egroup
- \else
- \hbox
- {\setbox0\hbox{#1}%
- \ifdim\wd0<\@@iawidth\relax
- \buttonwidth\@@iawidth\relax
- \else
- \buttonwidth\wd0
- \fi
- \ifdim\ht0<\@@ia@@hoogte\relax
- \buttonheight\@@ia@@hoogte\relax
- \else
- \buttonheight\ht0
- \fi
- \ifdim\dp0<\@@ia@@diepte\relax
- \dimen0=\@@ia@@diepte\relax % = !
- \else
- \dimen0\dp0
- \fi
- \advance\buttonheight \dimen0
- \setbox2\hbox
- {\lower\dimen0\hbox
- {\dontcomplain
- \dimen0=.5\wd0 % direct skipping is faster of course
- \advance\dimen0 -.5\buttonwidth % buts this is nicer
- \hskip\dimen0#2#3}}% when visualizing things
- \naturalhbox % needed for omega / moved from plus-omg
- {\ifreversegoto
- \dimen0\wd0\box0\kern-\dimen0\smashbox2\box2\kern\dimen0
- \else
- \smashbox2\box2\box0
- \fi
- \flushdriverresources}%
- \resetgoto}%
- \fi}
-
-%D The secondary references are processed but not typeset. The
-%D special driver must collect the data needed.
-
-%D The width of the active area depends on the dimensions
-%D preset, the actual dimens and/or the height and depth of the
-%D strut.
-%D
-%D Normally the hyper active area is laid on top of the text.
-%D This enables stacking hyperlinks on top of each other. When,
-%D for some reason the opposite is prefered, one can use the
-%D next boolean to signal this wish.
-
-\newif\ifreversegoto \reversegotofalse
-
-%D As long as there a natural feeling of what can be considered
-%D hyper active or not, we have to tell users where they can
-%D possibly click. We've already seen a few macros that deal
-%D with this visualization, something we definitely do not let
-%D up to the viewer. One way of telling is using a distinctive
-%D typeface, another way is using color.
-%D
-%D There are two colors involved: one for normal hyperlinks,
-%D and one for those that point to the currentpage, the
-%D contrast color.
-
-\definecolor [interactioncolor] [r=0, g=.6, b=0]
-\definecolor [interactioncontrastcolor] [r=.8, g=0, b=0]
-
-\definecolor [interactiekleur] [interactioncolor]
-\definecolor [interactiecontrastkleur] [interactioncontrastcolor]
-
-%D The next few macros are responsible for highlighting hyper
-%D links. The first one, \type{\showlocation}, is used in those
-%D situations where the typeface is handled by the calling
-%D macro.
-
-\def\interactioncolor % todo \??ia as argument
- {\iflocation
- \ifrealreferencepage
- \@@iacontrastcolor
- \else
- \@@iacolor
- \fi
- \fi}
-
-%D CHECK WHERE USED / CONSISTENCY
-
-\def\showlocation#1%
- {\iflocation\color[\@@iacolor]{#1\presetgoto}\else#1\fi}
-
-%D When local color settings are to be used, we can use the
-%D next macro, where \type{#1} is a tag like \type{\??tg} and
-%D \type{#2} some text.
-
-\def\showcoloredlocation#1#2%
- {\iflocation
- \color[\getvalue{#1\c!color}]{#2\presetgoto}%
- \else
- #2%
- \fi}
-
-%D When we're dealing with pure page references, contrast
-%D colors are used when we are already at the page mentioned.
-
-\def\showcontrastlocation#1#2#3% the \@EA is needed
- {\iflocation
- \ifnum#2=\realpageno\relax
- \doifelsevaluenothing{#1\c!color}
- {#3\presetgoto}
- {\color[\getvalue{#1\c!contrastcolor}]{#3\presetgoto}}%
- \else
- \color[\getvalue{#1\c!color}]{#3\presetgoto}%
- \fi
- \else
- #3%
- \fi}
-
-%D The next simple macro can be used in color specifications,
-%D like \type{\color[\locationcolor{green}]}.
-
-\def\locationcolor#1%
- {\iflocation#1\fi}
-
-%D More tokens are spend when we want both typeface and color
-%D highlighting.
-
-\def\dolocationattributes#1#2#3#4%
- {\bgroup
- \let\fontattribute\empty
- \let\colorattribute\empty
- \doifdefined{#1#2}{\def\fontattribute{\getvalue{#1#2}}}%
- \iflocation
- \doifdefined{#1#3}{\def\colorattribute{\getvalue{#1#3}}}%
- \fi
- \startcolor[\colorattribute]%
- \@EA\doconvertfont\@EA{\fontattribute}{#4}% no \edef, but \@EA here
- \stopcolor
- \egroup}
-
-\def\navigating
- {\dolocationattributes\??ia\c!style\c!color}
-
-%D Although not decently supported in current viewers, a
-%D provisory hiding mechanims is implemented. Areas marked as
-%D such, are visible on screen, but invisible on paper. Don't
-%D trust this mechanism yet!
-
-\def\dostartinteraction
- {\bgroup
- \let\stopinteraction\egroup
- \dowithnextbox{\dostarthide\flushnextbox\dostophide\egroup}\hbox}
-
-\let\startinteraction = \relax
-\let\stopinteraction = \relax
-
-% in the future:
-%
-% eerst boolean invoeren bij menu, achtergrond, balk, button
-% enz; verder startinteractie een argument meegeven {#1} ->
-% \getvalue{#1\c!print}=={\v!ja} enz. Consequent menubutton
-% gebruiken!
-
-\def\@@iatimestamp
- {\the\normalyear
- \ifnum\normalmonth<10 0\fi\the\normalmonth
- \ifnum\normalday <10 0\fi\the\normalday}
-
-% happens in core-fld
-%
-% \definereference [AtOpenInitializeForm] [\v!geen]
-
-\setupinteraction % start fit page and reset form
- [\c!state=\v!stop,
- \c!page=\v!no,
- \c!click=\v!yes,
- \c!display=,
- %\c!openaction={\v!firstpage,AtOpenInitializeForm},
- %\c!openaction={\v!firstpage,\v!ResetForm},
- %\c!openaction=\v!ResetForm, % too buggy in reader 4.05
- \c!openaction=,
- \c!closeaction=,
- \c!openpageaction=,
- \c!closepageaction=,
- \c!display=\v!normal,
- \c!focus=\v!fit,
- \c!menu=\v!off,
- \c!style=\v!bold,
- \c!calculate=,
- \c!strut=\v!yes,
- \c!split=\v!yes,
- \c!color=interactioncolor,
- \c!contrastcolor=interactioncontrastcolor,
- \c!symbolset=,
- \c!width=1em,
- \c!height=\!!zeropoint,
- \c!depth=\!!zeropoint,
- \c!title=\jobname, % needed for fdf/x
- \c!subtitle=,
- \c!author=,
- \c!keyword=,
- \c!date=\@@iatimestamp]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/sort-def.mkii b/Master/texmf-dist/tex/context/base/mkii/sort-def.mkii
deleted file mode 100644
index 168f94e9e9a..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/sort-def.mkii
+++ /dev/null
@@ -1,450 +0,0 @@
-%D \module
-%D [ file=sort-def,
-%D version=2005.08.08,
-%D title=\CONTEXT\ Sort Macros,
-%D subtitle=Defaults,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 module replaces existing sort key handling and is meant to be
-%D used with the new texutil functionality. Here we define the default
-%D mappings
-
-\exportsortexpansion{aeligature} {ae}
-\exportsortexpansion{AEligature} {AE}
-\exportsortexpansion{ijligature} {ij}
-\exportsortexpansion{IJligature} {IJ}
-\exportsortexpansion{oeligature} {oe}
-\exportsortexpansion{OEligature} {OE}
-
-\exportsortexpansion{ssharp} {ss}
-\exportsortexpansion{Ssharp} {SS}
-
-\exportsortexpansion{thorn} {}
-\exportsortexpansion{Thorn} {}
-
-\exportsortexpansion{eth} {}
-\exportsortexpansion{Eth} {}
-
-\exportsortexpansion{dj} {dstroke}
-\exportsortexpansion{Dj} {Dstroke}
-
-\exportsortexpansion{Acircumflex} {}
-\exportsortexpansion{acircumflex} {}
-\exportsortexpansion{Ccircumflex} {}
-\exportsortexpansion{ccircumflex} {}
-\exportsortexpansion{Ecircumflex} {}
-\exportsortexpansion{ecircumflex} {}
-\exportsortexpansion{Gcircumflex} {}
-\exportsortexpansion{gcircumflex} {}
-\exportsortexpansion{Hcircumflex} {}
-\exportsortexpansion{hcircumflex} {}
-\exportsortexpansion{Icircumflex} {}
-\exportsortexpansion{icircumflex} {}
-\exportsortexpansion{Jcircumflex} {}
-\exportsortexpansion{jcircumflex} {}
-\exportsortexpansion{Ocircumflex} {}
-\exportsortexpansion{ocircumflex} {}
-\exportsortexpansion{Scircumflex} {}
-\exportsortexpansion{scircumflex} {}
-\exportsortexpansion{Ucircumflex} {}
-\exportsortexpansion{ucircumflex} {}
-\exportsortexpansion{Wcircumflex} {}
-\exportsortexpansion{wcircumflex} {}
-\exportsortexpansion{Ycircumflex} {}
-\exportsortexpansion{ycircumflex} {}
-
-\exportsortexpansion{Agrave} {}
-\exportsortexpansion{agrave} {}
-\exportsortexpansion{Egrave} {}
-\exportsortexpansion{egrave} {}
-\exportsortexpansion{Igrave} {}
-\exportsortexpansion{igrave} {}
-\exportsortexpansion{Ograve} {}
-\exportsortexpansion{ograve} {}
-\exportsortexpansion{Ugrave} {}
-\exportsortexpansion{ugrave} {}
-\exportsortexpansion{Ygrave} {}
-\exportsortexpansion{ygrave} {}
-
-\exportsortexpansion{Atilde} {}
-\exportsortexpansion{atilde} {}
-\exportsortexpansion{Itilde} {}
-\exportsortexpansion{itilde} {}
-\exportsortexpansion{Ntilde} {}
-\exportsortexpansion{ntilde} {}
-\exportsortexpansion{Otilde} {}
-\exportsortexpansion{otilde} {}
-\exportsortexpansion{Utilde} {}
-\exportsortexpansion{utilde} {}
-\exportsortexpansion{Ytilde} {}
-\exportsortexpansion{ytilde} {}
-
-\exportsortexpansion{Adiaeresis} {}
-\exportsortexpansion{adiaeresis} {}
-\exportsortexpansion{Ediaeresis} {}
-\exportsortexpansion{ediaeresis} {}
-\exportsortexpansion{Idiaeresis} {}
-\exportsortexpansion{idiaeresis} {}
-\exportsortexpansion{Odiaeresis} {}
-\exportsortexpansion{odiaeresis} {}
-\exportsortexpansion{Udiaeresis} {}
-\exportsortexpansion{udiaeresis} {}
-\exportsortexpansion{Ydiaeresis} {}
-\exportsortexpansion{ydiaeresis} {}
-
-\exportsortexpansion{Aacute} {}
-\exportsortexpansion{aacute} {}
-\exportsortexpansion{Cacute} {}
-\exportsortexpansion{cacute} {}
-\exportsortexpansion{Eacute} {}
-\exportsortexpansion{eacute} {}
-\exportsortexpansion{Iacute} {}
-\exportsortexpansion{iacute} {}
-\exportsortexpansion{Lacute} {}
-\exportsortexpansion{lacute} {}
-\exportsortexpansion{Nacute} {}
-\exportsortexpansion{nacute} {}
-\exportsortexpansion{Oacute} {}
-\exportsortexpansion{oacute} {}
-\exportsortexpansion{Racute} {}
-\exportsortexpansion{racute} {}
-\exportsortexpansion{Sacute} {}
-\exportsortexpansion{sacute} {}
-\exportsortexpansion{Uacute} {}
-\exportsortexpansion{uacute} {}
-\exportsortexpansion{Yacute} {}
-\exportsortexpansion{yacute} {}
-\exportsortexpansion{Zacute} {}
-\exportsortexpansion{zacute} {}
-
-\exportsortexpansion{dstroke} {}
-\exportsortexpansion{Dstroke} {}
-\exportsortexpansion{Hstroke} {}
-\exportsortexpansion{hstroke} {}
-\exportsortexpansion{Tstroke} {}
-\exportsortexpansion{tstroke} {}
-
-\exportsortexpansion{Cdotaccent} {}
-\exportsortexpansion{cdotaccent} {}
-\exportsortexpansion{Edotaccent} {}
-\exportsortexpansion{edotaccent} {}
-\exportsortexpansion{Gdotaccent} {}
-\exportsortexpansion{gdotaccent} {}
-\exportsortexpansion{Idotaccent} {}
-\exportsortexpansion{idotaccent} {}
-\exportsortexpansion{Zdotaccent} {}
-\exportsortexpansion{zdotaccent} {}
-
-\exportsortexpansion{Amacron} {}
-\exportsortexpansion{amacron} {}
-\exportsortexpansion{Emacron} {}
-\exportsortexpansion{emacron} {}
-\exportsortexpansion{Imacron} {}
-\exportsortexpansion{imacron} {}
-\exportsortexpansion{Omacron} {}
-\exportsortexpansion{omacron} {}
-\exportsortexpansion{Umacron} {}
-\exportsortexpansion{umacron} {}
-
-\exportsortexpansion{Ccedilla} {}
-\exportsortexpansion{ccedilla} {}
-\exportsortexpansion{Kcedilla} {}
-\exportsortexpansion{kcedilla} {}
-\exportsortexpansion{Lcedilla} {}
-\exportsortexpansion{lcedilla} {}
-\exportsortexpansion{Ncedilla} {}
-\exportsortexpansion{ncedilla} {}
-\exportsortexpansion{Rcedilla} {}
-\exportsortexpansion{rcedilla} {}
-\exportsortexpansion{Scedilla} {}
-\exportsortexpansion{scedilla} {}
-\exportsortexpansion{Tcedilla} {}
-\exportsortexpansion{tcedilla} {}
-
-\exportsortexpansion{Ohungarumlaut} {}
-\exportsortexpansion{ohungarumlaut} {}
-\exportsortexpansion{Uhungarumlaut} {}
-\exportsortexpansion{uhungarumlaut} {}
-
-\exportsortexpansion{Aogonek} {}
-\exportsortexpansion{aogonek} {}
-\exportsortexpansion{Eogonek} {}
-\exportsortexpansion{eogonek} {}
-\exportsortexpansion{Iogonek} {}
-\exportsortexpansion{iogonek} {}
-\exportsortexpansion{Uogonek} {}
-\exportsortexpansion{uogonek} {}
-
-\exportsortexpansion{Aring} {}
-\exportsortexpansion{aring} {}
-\exportsortexpansion{Uring} {}
-\exportsortexpansion{uring} {}
-
-\exportsortexpansion{Abreve} {}
-\exportsortexpansion{abreve} {}
-\exportsortexpansion{Ebreve} {}
-\exportsortexpansion{ebreve} {}
-\exportsortexpansion{Gbreve} {}
-\exportsortexpansion{gbreve} {}
-\exportsortexpansion{Ibreve} {}
-\exportsortexpansion{ibreve} {}
-\exportsortexpansion{Obreve} {}
-\exportsortexpansion{obreve} {}
-\exportsortexpansion{Ubreve} {}
-\exportsortexpansion{ubreve} {}
-
-\exportsortexpansion{Ccaron} {}
-\exportsortexpansion{ccaron} {}
-\exportsortexpansion{Dcaron} {}
-\exportsortexpansion{dcaron} {}
-\exportsortexpansion{Ecaron} {}
-\exportsortexpansion{ecaron} {}
-\exportsortexpansion{Lcaron} {}
-\exportsortexpansion{lcaron} {}
-\exportsortexpansion{Ncaron} {}
-\exportsortexpansion{ncaron} {}
-\exportsortexpansion{Rcaron} {}
-\exportsortexpansion{rcaron} {}
-\exportsortexpansion{Scaron} {}
-\exportsortexpansion{scaron} {}
-\exportsortexpansion{Tcaron} {}
-\exportsortexpansion{tcaron} {}
-\exportsortexpansion{Ycaron} {}
-\exportsortexpansion{ycaron} {}
-\exportsortexpansion{Zcaron} {}
-\exportsortexpansion{zcaron} {}
-
-\exportsortexpansion{Lstroke} {}
-\exportsortexpansion{lstroke} {}
-\exportsortexpansion{Ostroke} {}
-\exportsortexpansion{ostroke} {}
-
-\exportsortexpansion{aumlaut} {}
-\exportsortexpansion{eumlaut} {}
-\exportsortexpansion{iumlaut} {}
-\exportsortexpansion{oumlaut} {}
-\exportsortexpansion{uumlaut} {}
-
-\exportsortexpansion{Aumlaut} {}
-\exportsortexpansion{Eumlaut} {}
-\exportsortexpansion{Iumlaut} {}
-\exportsortexpansion{Oumlaut} {}
-\exportsortexpansion{Uumlaut} {}
-
-\exportsortexpansion{scommaaccent} {}
-\exportsortexpansion{Scommaaccent} {}
-\exportsortexpansion{tcommaaccent} {}
-\exportsortexpansion{Tcommaaccent} {}
-
-\exportsortexpansion{Etilde} {}
-\exportsortexpansion{etilde} {}
-
-\exportsortexpansion{Ahook} {}
-\exportsortexpansion{ahook} {}
-\exportsortexpansion{Ehook} {}
-\exportsortexpansion{ehook} {}
-\exportsortexpansion{Ihook} {}
-\exportsortexpansion{ihook} {}
-\exportsortexpansion{Ohook} {}
-\exportsortexpansion{ohook} {}
-\exportsortexpansion{Uhook} {}
-\exportsortexpansion{uhook} {}
-\exportsortexpansion{Yhook} {}
-\exportsortexpansion{yhook} {}
-
-\exportsortexpansion{Acircumflexgrave} {}
-\exportsortexpansion{Acircumflexacute} {}
-\exportsortexpansion{Acircumflextilde} {}
-\exportsortexpansion{Acircumflexhook} {}
-\exportsortexpansion{acircumflexgrave} {}
-\exportsortexpansion{acircumflexacute} {}
-\exportsortexpansion{acircumflextilde} {}
-\exportsortexpansion{acircumflexhook} {}
-\exportsortexpansion{Ecircumflexgrave} {}
-\exportsortexpansion{Ecircumflexacute} {}
-\exportsortexpansion{Ecircumflextilde} {}
-\exportsortexpansion{Ecircumflexhook} {}
-\exportsortexpansion{ecircumflexgrave} {}
-\exportsortexpansion{ecircumflexacute} {}
-\exportsortexpansion{ecircumflextilde} {}
-\exportsortexpansion{ecircumflexhook} {}
-\exportsortexpansion{Ocircumflexgrave} {}
-\exportsortexpansion{Ocircumflexacute} {}
-\exportsortexpansion{Ocircumflextilde} {}
-\exportsortexpansion{Ocircumflexhook} {}
-\exportsortexpansion{ocircumflexgrave} {}
-\exportsortexpansion{ocircumflexacute} {}
-\exportsortexpansion{ocircumflextilde} {}
-\exportsortexpansion{ocircumflexhook} {}
-
-\exportsortexpansion{Abrevegrave} {}
-\exportsortexpansion{Abreveacute} {}
-\exportsortexpansion{Abrevetilde} {}
-\exportsortexpansion{Abrevehook} {}
-\exportsortexpansion{abrevegrave} {}
-\exportsortexpansion{abreveacute} {}
-\exportsortexpansion{abrevetilde} {}
-\exportsortexpansion{abrevehook} {}
-
-\exportsortexpansion{Adotbelow} {}
-\exportsortexpansion{adotbelow} {}
-\exportsortexpansion{Edotbelow} {}
-\exportsortexpansion{edotbelow} {}
-\exportsortexpansion{Idotbelow} {}
-\exportsortexpansion{idotbelow} {}
-\exportsortexpansion{Odotbelow} {}
-\exportsortexpansion{odotbelow} {}
-\exportsortexpansion{Udotbelow} {}
-\exportsortexpansion{udotbelow} {}
-\exportsortexpansion{Ydotbelow} {}
-\exportsortexpansion{ydotbelow} {}
-\exportsortexpansion{Ohorndotbelow} {}
-\exportsortexpansion{ohorndotbelow} {}
-\exportsortexpansion{Uhorndotbelow} {}
-\exportsortexpansion{uhorndotbelow} {}
-
-\exportsortexpansion{Acircumflexdotbelow} {}
-\exportsortexpansion{acircumflexdotbelow} {}
-\exportsortexpansion{Ecircumflexdotbelow} {}
-\exportsortexpansion{ecircumflexdotbelow} {}
-\exportsortexpansion{Ocircumflexdotbelow} {}
-\exportsortexpansion{ocircumflexdotbelow} {}
-\exportsortexpansion{Abrevedotbelow} {}
-\exportsortexpansion{abrevedotbelow} {}
-
-\exportsortexpansion{Ohorn} {}
-\exportsortexpansion{Ohorngrave} {}
-\exportsortexpansion{Ohornacute} {}
-\exportsortexpansion{Ohorntilde} {}
-\exportsortexpansion{Ohornhook } {}
-\exportsortexpansion{ohorn} {}
-\exportsortexpansion{ohorngrave} {}
-\exportsortexpansion{ohornacute} {}
-\exportsortexpansion{ohorntilde} {}
-\exportsortexpansion{ohornhook } {}
-\exportsortexpansion{Uhorn} {}
-\exportsortexpansion{Uhorngrave} {}
-\exportsortexpansion{Uhornacute} {}
-\exportsortexpansion{Uhorntilde} {}
-\exportsortexpansion{Uhornhook } {}
-\exportsortexpansion{uhorn} {}
-\exportsortexpansion{uhorngrave} {}
-\exportsortexpansion{uhornacute} {}
-\exportsortexpansion{uhorntilde} {}
-\exportsortexpansion{uhornhook} {}
-
-\exportsortexpansion{eszett} {ssharp}
-\exportsortexpansion{Eszett} {Ssharp}
-
-\exportsortexpansion{lslash} {lstroke}
-\exportsortexpansion{Lslash} {Lstroke}
-\exportsortexpansion{dslash} {dstroke}
-\exportsortexpansion{Dslash} {Dstroke}
-\exportsortexpansion{oslash} {ostroke}
-\exportsortexpansion{Oslash} {Ostroke}
-
-\exportsortexpansion{dcroat} {dstroke}
-\exportsortexpansion{Dcroat} {Dstroke}
-
-% more
-
-\exportsortshortcut{\^ A} {\Acircumflex} \exportsortshortcut{\^ a} {\acircumflex}
-\exportsortshortcut{\^ C} {\Ccircumflex} \exportsortshortcut{\^ c} {\ccircumflex}
-\exportsortshortcut{\^ E} {\Ecircumflex} \exportsortshortcut{\^ e} {\ecircumflex}
-\exportsortshortcut{\^ G} {\Gcircumflex} \exportsortshortcut{\^ g} {\gcircumflex}
-\exportsortshortcut{\^ H} {\Hcircumflex} \exportsortshortcut{\^ h} {\hcircumflex}
-\exportsortshortcut{\^ I} {\Icircumflex} \exportsortshortcut{\^ i} {\icircumflex} \exportsortshortcut{\^\i} {\icircumflex}
-\exportsortshortcut{\^ J} {\Jcircumflex} \exportsortshortcut{\^ j} {\jcircumflex} \exportsortshortcut{\^\j} {\jcircumflex}
-\exportsortshortcut{\^ O} {\Ocircumflex} \exportsortshortcut{\^ o} {\ocircumflex}
-\exportsortshortcut{\^ S} {\Scircumflex} \exportsortshortcut{\^ s} {\scircumflex}
-\exportsortshortcut{\^ U} {\Ucircumflex} \exportsortshortcut{\^ u} {\ucircumflex}
-\exportsortshortcut{\^ W} {\Wcircumflex} \exportsortshortcut{\^ w} {\wcircumflex}
-\exportsortshortcut{\^ Y} {\Ycircumflex} \exportsortshortcut{\^ y} {\ycircumflex}
-
-\exportsortshortcut{\` A} {\Agrave} \exportsortshortcut{\` a} {\agrave}
-\exportsortshortcut{\` E} {\Egrave} \exportsortshortcut{\` e} {\egrave}
-\exportsortshortcut{\` I} {\Igrave} \exportsortshortcut{\` i} {\igrave} \exportsortshortcut{\`\i} {\igrave}
-\exportsortshortcut{\` O} {\Ograve} \exportsortshortcut{\` o} {\ograve}
-\exportsortshortcut{\` U} {\Ugrave} \exportsortshortcut{\` u} {\ugrave}
-\exportsortshortcut{\` Y} {\Ygrave} \exportsortshortcut{\` y} {\ygrave}
-
-\exportsortshortcut{\~ A} {\Atilde} \exportsortshortcut{\~ a} {\atilde}
-\exportsortshortcut{\~ I} {\Itilde} \exportsortshortcut{\~ i} {\itilde} \exportsortshortcut{\~\i} {\itilde}
-\exportsortshortcut{\~ O} {\Otilde} \exportsortshortcut{\~ o} {\otilde}
-\exportsortshortcut{\~ U} {\Utilde} \exportsortshortcut{\~ u} {\utilde}
-
-\exportsortshortcut{\" A} {\Adiaeresis} \exportsortshortcut{\" a} {\adiaeresis}
-\exportsortshortcut{\" E} {\Ediaeresis} \exportsortshortcut{\" e} {\ediaeresis}
-\exportsortshortcut{\" I} {\Idiaeresis} \exportsortshortcut{\" i} {\idiaeresis} \exportsortshortcut{\"\i} {\idiaeresis}
-\exportsortshortcut{\" O} {\Odiaeresis} \exportsortshortcut{\" o} {\odiaeresis}
-\exportsortshortcut{\" U} {\Udiaeresis} \exportsortshortcut{\" u} {\udiaeresis}
-\exportsortshortcut{\" Y} {\Ydiaeresis} \exportsortshortcut{\" y} {\ydiaeresis}
-
-\exportsortshortcut{\' A} {\Aacute} \exportsortshortcut{\' a} {\aacute}
-\exportsortshortcut{\' C} {\Cacute} \exportsortshortcut{\' c} {\cacute}
-\exportsortshortcut{\' E} {\Eacute} \exportsortshortcut{\' e} {\eacute}
-\exportsortshortcut{\' I} {\Iacute} \exportsortshortcut{\' i} {\iacute} \exportsortshortcut{\'\i} {\iacute}
-\exportsortshortcut{\' L} {\Lacute} \exportsortshortcut{\' l} {\lacute}
-\exportsortshortcut{\' N} {\Nacute} \exportsortshortcut{\' n} {\nacute}
-\exportsortshortcut{\' O} {\Oacute} \exportsortshortcut{\' o} {\oacute}
-\exportsortshortcut{\' R} {\Racute} \exportsortshortcut{\' r} {\racute}
-\exportsortshortcut{\' S} {\Sacute} \exportsortshortcut{\' s} {\sacute}
-\exportsortshortcut{\' U} {\Uacute} \exportsortshortcut{\' u} {\uacute}
-\exportsortshortcut{\' Y} {\Yacute} \exportsortshortcut{\' y} {\yacute}
-\exportsortshortcut{\' Z} {\Zacute} \exportsortshortcut{\' z} {\zacute}
-
-\exportsortshortcut{\. C} {\Cdotaccent} \exportsortshortcut{\. c} {\cdotaccent}
-\exportsortshortcut{\. E} {\Edotaccent} \exportsortshortcut{\. e} {\edotaccent}
-\exportsortshortcut{\. G} {\Gdotaccent} \exportsortshortcut{\. g} {\gdotaccent}
-\exportsortshortcut{\. I} {\Idotaccent} \exportsortshortcut{\. i} {\idotaccent} \exportsortshortcut{\.\i} {\idotaccent}
-\exportsortshortcut{\. Z} {\Zdotaccent} \exportsortshortcut{\. z} {\zdotaccent}
-
-\exportsortshortcut{\= A} {\Amacron} \exportsortshortcut{\= a} {\amacron}
-\exportsortshortcut{\= E} {\Emacron} \exportsortshortcut{\= e} {\emacron}
-\exportsortshortcut{\= I} {\Imacron} \exportsortshortcut{\= i} {\imacron} \exportsortshortcut{\=\i} {\imacron}
-\exportsortshortcut{\= O} {\Omacron} \exportsortshortcut{\= o} {\omacron}
-\exportsortshortcut{\= U} {\Umacron} \exportsortshortcut{\= u} {\umacron}
-
-\exportsortshortcut{\c C} {\Ccedilla} \exportsortshortcut{\c c} {\ccedilla}
-\exportsortshortcut{\c K} {\Kcedilla} \exportsortshortcut{\c k} {\kcedilla}
-\exportsortshortcut{\c L} {\Lcedilla} \exportsortshortcut{\c l} {\lcedilla}
-\exportsortshortcut{\c N} {\Ncedilla} \exportsortshortcut{\c n} {\ncedilla}
-\exportsortshortcut{\c R} {\Rcedilla} \exportsortshortcut{\c r} {\rcedilla}
-\exportsortshortcut{\c S} {\Scedilla} \exportsortshortcut{\c s} {\scedilla}
-\exportsortshortcut{\c T} {\Tcedilla} \exportsortshortcut{\c t} {\tcedilla}
-
-\exportsortshortcut{\H O} {\Ohungarumlaut} \exportsortshortcut{\H o} {\ohungarumlaut}
-\exportsortshortcut{\H u} {\uhungarumlaut} \exportsortshortcut{\H U} {\Uhungarumlaut}
-
-\exportsortshortcut{\k A} {\Aogonek} \exportsortshortcut{\k a} {\aogonek}
-\exportsortshortcut{\k E} {\Eogonek} \exportsortshortcut{\k e} {\eogonek}
-\exportsortshortcut{\k I} {\Iogonek} \exportsortshortcut{\k i} {\iogonek}
-\exportsortshortcut{\k U} {\Uogonek} \exportsortshortcut{\k u} {\uogonek}
-
-\exportsortshortcut{\r A} {\Aring} \exportsortshortcut{\r a} {\aring}
-\exportsortshortcut{\r U} {\Uring} \exportsortshortcut{\r u} {\uring}
-
-\exportsortshortcut{\u A} {\Abreve} \exportsortshortcut{\u a} {\abreve}
-\exportsortshortcut{\u E} {\Ebreve} \exportsortshortcut{\u e} {\ebreve}
-\exportsortshortcut{\u G} {\Gbreve} \exportsortshortcut{\u g} {\gbreve}
-\exportsortshortcut{\u I} {\Ibreve} \exportsortshortcut{\u i} {\ibreve} \exportsortshortcut{\u\i} {\ibreve}
-\exportsortshortcut{\u O} {\Obreve} \exportsortshortcut{\u o} {\obreve}
-\exportsortshortcut{\u U} {\Ubreve} \exportsortshortcut{\u u} {\ubreve}
-
-\exportsortshortcut{\v C} {\Ccaron} \exportsortshortcut{\v c} {\ccaron}
-\exportsortshortcut{\v D} {\Dcaron} \exportsortshortcut{\v d} {\dcaron}
-\exportsortshortcut{\v E} {\Ecaron} \exportsortshortcut{\v e} {\ecaron}
-\exportsortshortcut{\v L} {\Lcaron} \exportsortshortcut{\v l} {\lcaron}
-\exportsortshortcut{\v N} {\Ncaron} \exportsortshortcut{\v n} {\ncaron}
-\exportsortshortcut{\v R} {\Rcaron} \exportsortshortcut{\v r} {\rcaron}
-\exportsortshortcut{\v S} {\Scaron} \exportsortshortcut{\v s} {\scaron}
-\exportsortshortcut{\v T} {\Tcaron} \exportsortshortcut{\v t} {\tcaron}
-\exportsortshortcut{\v Z} {\Zcaron} \exportsortshortcut{\v z} {\zcaron}
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/sort-ini.mkii b/Master/texmf-dist/tex/context/base/mkii/sort-ini.mkii
deleted file mode 100644
index 8114f82c8eb..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/sort-ini.mkii
+++ /dev/null
@@ -1,161 +0,0 @@
-%D \module
-%D [ file=sort-ini,
-%D version=2005.08.08,
-%D title=\CONTEXT\ Sorting Macros,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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: 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.
-
-\writestatus{loading}{ConTeXt Sorting Macros / Initialization}
-
-%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
-
-%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
-%D the rules. Currently we have multipass substitution and onepass sorting,
-%D but we may change this some day. Since there is a plugin mechanism, using
-%D an external sorter is also possible.
-
-% test file:
-%
-% \mainlanguage[sl] \readfile{sort-ini}{}{}
-%
-% \starttext
-% test \index {aa1} test \index {ab1} test \index {aa2}
-% test \index {ab2} test \index {aa10} test \index {aa8}
-% test \index {aa9} test \index {aa11} test \index {aa10}
-% test \index {cccc} test \index {\ccaron ccc} test \index {\cacute ccc}
-% test \index {caaa} test \index {\ccaron aaa} test \index {\cacute aaa}
-% \placeindex
-% \stoptext
-
-% definitions:
-%
-% \exportsortshortcut{\\\'\\i}{iacute}
-% \exportsortshortcut{\\\'i} {iacute}
-% \exportsortshortcut{\\\"e} {ediaeresis}
-% \exportsortshortcut{\\\'o} {oacute}
-%
-% \exportsortexpansion{aeligature}{ae}
-% \exportsortexpansion{ijligature}{y}
-% \exportsortexpansion{oacute} {oz}
-% \exportsortexpansion{eacute} {ezzz} % or e3
-% \exportsortexpansion{egrave} {ezz} % or e2
-% \exportsortexpansion{ediaeresis}{ez} % or e1
-% \exportsortexpansion{adiaeresis}{az}
-% \exportsortreduction{ch} {c}
-% \exportsortreduction{ij} {y}
-%
-% \exportsortexpansion{ccaron} {cz}
-% \exportsortexpansion{cacute} {czz}
-% \exportsortexpansion{dstroke} {dz}
-% \exportsortexpansion{scaron} {sz}
-% \exportsortexpansion{zcaron} {zz}
-%
-% \exportsortreduction{ch}{c}
-% \exportsortreduction{ij}{y}
-%
-% \exportsortexpansion {ccaron} {c+1}
-% \exportsortdivision {c+1} {ccaron}
-% ==
-% \exportsortrule {ccaron} {c+1}
-
-\unprotect
-
-\def\savesortkeys
- {\ifproductionrun
- \the\everysavesortkeys
- \global\everysavesortkeys\emptytoks
- \fi}
-
-\appendtoks \savesortkeys \to \everyshipout
-
-\let\currentexportclass\empty
-
-\def\exportsortaction#1#2#3%
- {\defconvertedargument\asciia{#2}%
- \defconvertedargument\asciib{#3}%
- \immediatewriteutility{x #1 {\currentexportclass} {\asciia} {\asciib}}}
-
-\def\exportsortshortcut {\exportsortaction s}
-\def\exportsortexpansion{\exportsortaction e}
-\def\exportsortreduction{\exportsortaction r}
-\def\exportsortdivision {\exportsortaction d}
-
-\def\exportsortrule#1#2%
- {\exportsortexpansion{#1}{#2}%
- \exportsortdivision {#2}{#1}}
-
-\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% mkii code !
- {\doifnumberelse{##1}
- {\expanded{\exportsortshortcut{\rawcharacter{##1}}}{##2}}%
- {\expanded{\exportsortshortcut{\rawcharacter{\number`##1}}}{##2}}}%
- \doifelsenothing\currentregime
- {\doifnot\characterencoding\nocharacterencoding % to be sure, autoregime
- {\dowalkregime\characterencoding}}%
- {\dowalkregime\characterencoding}}%
- \egroup
- \startnointerference
- \setcatcodetable\ctxcatcodes
- \readsysfile{\f!sortprefix def.mkii}\donothing\donothing % default
- \stopnointerference
- \global\let\savesortdefinitions\relax}
-
-\def\savesortlanguage#1% language specifics
- {\doifsomething{#1}
- {\doifundefined{\f!sortprefix::#1}%
- {\startnointerference
- \global\letvalue{\f!sortprefix::#1}\empty
- \def\currentexportclass{#1}%
- \enablemode[sortorder-#1]%
- \setcatcodetable\ctxcatcodes
- \readsysfile{\f!sortprefix lan.mkii}\donothing\donothing
- \stopnointerference}}}
-
-\prependtoks
- \savesortdefinitions
-\to \everysavesortkeys
-
-% \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
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/sort-lan.mkii b/Master/texmf-dist/tex/context/base/mkii/sort-lan.mkii
deleted file mode 100644
index c239623718f..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/sort-lan.mkii
+++ /dev/null
@@ -1,217 +0,0 @@
-%D \module
-%D [ file=sort-lan,
-%D version=2005.08.08,
-%D title=\CONTEXT\ Sort Macros,
-%D subtitle=Language Definitions,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%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.
-
-% slovenian
-%
-% 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}
-% \exportsortexpansion {dstroke} {dz}
-% \exportsortexpansion {scaron} {sz}
-% \exportsortexpansion {zcaron} {zz}
-
-% \exportsortdivision {cz} {ccaron}
-% \exportsortdivision {czz} {cacute}
-% \exportsortdivision {dz} {dstroke}
-% \exportsortdivision {sz} {scaron}
-% \exportsortdivision {zz} {zcaron}
-% \stopmode
-%
-% \startmode[sortorder-sl]
-% \exportsortexpansion {ccaron} {c+1}
-% \exportsortexpansion {cacute} {c+2}
-% \exportsortexpansion {dstroke} {d+1}
-% \exportsortexpansion {scaron} {s+1}
-% \exportsortexpansion {zcaron} {z+1}
-%
-% \exportsortdivision {c+1} {ccaron}
-% \exportsortdivision {c+2} {cacute}
-% \exportsortdivision {d+1} {dstroke}
-% \exportsortdivision {s+1} {scaron}
-% \exportsortdivision {z+1} {zcaron}
-% \stopmode
-
-\startmode[sortorder-sl]
- \exportsortrule {ccaron} {c+1}
- \exportsortrule {cacute} {c+2}
- \exportsortrule {dstroke} {d+1}
- \exportsortrule {scaron} {s+1}
- \exportsortrule {zcaron} {z+1}
-\stopmode
-
-% finnish
-%
-% a-u, v+w sorted together, x-z, aring, adiaeresis, odiaeresis
-
-\startmode[sortorder-fi]
- \exportsortrule {v} {w}
- \exportsortrule {aring} {z+1}
- \exportsortrule {adiaeresis} {z+2}
- \exportsortrule {odiaeresis} {z+3}
-\stopmode
-
-% swedish
-%
-% 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}
- \exportsortrule {odiaeresis} {z+3}
-\stopmode
-
-% norwegian, danish
-%
-% a-z, aeligature, oslash, aring
-
-\startmode[sortorder-no,sortorder-da]
- \exportsortrule {aeligature} {z+1}
- \exportsortrule {oslash} {z+2}
- \exportsortrule {aring} {z+3}
-\stopmode
-
-% islandic
-%
-% a, aacute, b, c, d, eth, e, eacute, f-i, iacute, j-o, oacute, p-u, uacute, v, w (?), x, y, yacute, z, aeligature, oslash, thorn
-
-% estonian
-%
-% a-s, scaron, z, zcaron, t-w, otilde, adiaeresis, odiaeresis, udiaeresis, x, y
-
-% czech
-%
-% 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]
- \exportsortexpansion {aacute} {a}
- \exportsortexpansion {Aacute} {A}
- \exportsortexpansion {ccaron} {c+1}
- \exportsortexpansion {Ccaron} {C+1}
- \exportsortdivision {c+1} {ccaron}
- \exportsortexpansion {dcaron} {d}
- \exportsortexpansion {Dcaron} {D}
- %\exportsortdivision {d+1} {dcaron}
- \exportsortexpansion {eacute} {e}
- \exportsortexpansion {Eacute} {E}
- \exportsortexpansion {ecaron} {e}
- \exportsortexpansion {Ecaron} {E}
- \exportsortreduction {ch} {h+1}
- \exportsortexpansion {ch} {h+1}
- \exportsortreduction {Ch} {H+1}
- \exportsortexpansion {Ch} {H+1}
- \exportsortdivision {h+1} {czsortdivisionch}
- \exportsortexpansion {iacute} {i}
- \exportsortexpansion {Iacute} {I}
- \exportsortexpansion {ncaron} {n}
- \exportsortexpansion {Ncaron} {N}
- %\exportsortdivision {n+1} {ncaron}
- \exportsortexpansion {oacute} {o}
- \exportsortexpansion {Oacute} {O}
- \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}
- \exportsortexpansion {Tcaron} {T}
- %\exportsortdivision {t+1} {tcaron}
- \exportsortexpansion {uacute} {u}
- \exportsortexpansion {Uacute} {U}
- \exportsortexpansion {uring} {u}
- \exportsortexpansion {Uring} {U}
- \exportsortexpansion {yacute} {y}
- \exportsortexpansion {Yacute} {Y}
- \exportsortexpansion {zcaron} {z+1}
- \exportsortexpansion {Zcaron} {Z+1}
- \exportsortdivision {z+1} {zcaron}
-\stopmode
-
-% Polish:
-
-\startmode[sortorder-pl]
- \exportsortrule {aogonek} {a+1}
- \exportsortrule {cacute} {c+1}
- \exportsortrule {eogonek} {e+1}
- \exportsortrule {lstroke} {l+1}
- \exportsortrule {nacute} {n+1}
- \exportsortrule {oacute} {o+1}
- \exportsortrule {sacute} {s+1}
- \exportsortrule {zacute} {z+1}
- \exportsortrule {zdotaccent} {z+2}
-\stopmode
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/spac-gen.mkii b/Master/texmf-dist/tex/context/base/mkii/spac-gen.mkii
deleted file mode 100644
index 91e37925041..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/spac-gen.mkii
+++ /dev/null
@@ -1,4667 +0,0 @@
-%D \module
-%D [ file=core-spa,
-%D version=1997.03.31,
-%D title=\CONTEXT\ Core Macros,
-%D subtitle=Spacing,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Core Macros / Spacing}
-
-% to be sorted out: dependencies, order of initialization / also some dutch code here
-
-\unprotect
-
-% some will move to core-var
-
-\newif \ifgridsnapping
-\newif \iffuzzyvskip
-\let \fuzzyvskip \gobbleoneargument
-\let \removelastfuzzyvskip \relax
-
-\let \startbaselinecorrection \relax
-\let \stopbaselinecorrection \relax
-\let \baselinecorrection \relax
-\let \offbaselinecorrection \relax
-
-\appendtoks \spacing 1\to \everybodyfont
-\appendtoks \presetnormallineheight \to \everybodyfont
-\appendtoks \setnormalbaselines \to \everybodyfont % check if redundant
-\appendtoks \setstrut \to \everybodyfont % check if redundant
-\appendtoks \settopskip \to \everybodyfont
-\appendtoks \setmaxdepth \to \everybodyfont
-%appendtoks \spacing 1\to \everybodyfont
-\appendtoks \simplesetupindenting \to \everybodyfont
-\appendtoks \simplesetupblank \to \everybodyfont
-\appendtoks \simplesetupwhitespace \to \everybodyfont
-%appendtoks \checknotes \to \everybodyfont % not
-\appendtoks \simplesetupspacing \to \everybodyfont % nieuw
-\appendtoks \setrelativeinterlinespace \to \everybodyfont
-
-\appendtoks \updateraggedskips \to \everyfontswitch % under test
-\prependtoks \let\par\endgraf \to \everypagebody % see \fillinline
-\appendtoks \simplesetupspacing \to \everydefinedfont
-
-% if you want to hyphenate the first word of a paragraph ... \appendtoks\hskip0pt\to\everypar
-
-\def\stelfactorenin
- {\simplesetupwhitespace
- \simplesetupblank
- \settopskip
- \setmaxdepth}
-
-\def\softbreak
- {\relax\ifhmode\hskip\parfillskip\break\fi}
-
-\let\poplastnode\relax
-
-\def\pushlastnode
- {\ifdim\lastskip=\zeropoint
- \ifnum\lastpenalty=\zerocount
- \ifnum\lastkern=\zerocount
- \let\poplastnode\relax
- \else
- \edef\poplastnode{\kern\the\lastkern\relax}\kern-\lastkern % untested
- \fi
- \else
- \edef\poplastnode{\penalty\the\lastpenalty\relax}\nobreak % untested
- \fi
- \else
- \edef\poplastnode{\vskip\the\lastskip\relax}\vskip-\lastskip % \removelastskip
- \fi}
-
-%D The dreadful sequence \type {\bgroup} \unknown\
-%D \type {\carryoverpar} \unknown\ \type {\egroup} is needed
-%D when for instance sidefloats are used in combination with
-%D something that starts with a group. This is because
-%D otherwise the indentation as set (by the output routine)
-%D inside the group are forgotten afterwards. (I must
-%D not forget its existence).
-
-\global\let\carriedoverpar\relax
-
-\def\carryoverpar#1%
- {\expanded % \scratchtoks{#1}%
- {\noexpand#1% \the\scratchtoks
- \hangindent\the\hangindent
- \hangafter \the\hangafter
- \parskip \the\parskip
- \leftskip \the\leftskip
- \rightskip \the\rightskip}}
-
-%D A quick way to determine left|/|middle|/|right states
-%D (experimental).
-
-\setvalue{\??as\v!left }{0}
-\setvalue{\??as\v!middle}{1}
-\setvalue{\??as\v!right }{2}
-
-\def\setalignmentswitch#1%
- {\chardef\alignmentswitch0\csname\??as#1\endcsname\relax}
-
-%D There are two ways to influence the interline spacing. The
-%D most general and often most consistent way is using
-%D
-%D \showsetup{setupinterlinespace}
-%D
-%D For instance
-%D
-%D \starttyping
-%D \setupinterlinespace[line=2.8ex]
-%D \stoptyping
-%D
-%D This setting adapts itself to the bodyfontsize, while for
-%D instance saying
-%D
-%D \starttyping
-%D \setupinterlinespace[line=12pt]
-%D \stoptyping
-%D
-%D sets things fixed for all sizes, which is definitely not
-%D what we want. Therefore one can also say:
-%D
-%D \starttyping
-%D \definebodyfontenvironment[9pt][interlinespace=11pt]
-%D \stoptyping
-%D
-%D One can still use \type{\setupinterlinespace} (without
-%D arguments) to set the interline space according to the
-%D current font, e.g. a \type{\bfa}.
-
-\newif\iflocalinterlinespace
-
-% font-ini
-
-\ifx\bodyfontinterlinespecs\undefined
-
- \let\bodyfontinterlinespecs\empty
- \let\bodyfontinterlinespace\empty
-
-\fi
-
-\def\presetnormallineheight
- {\edef\normallineheight{\@@itline}%
-% done elsewhere : \spacing\!!plusone % new per 10/08/2004, else problems in otr / !! needed
- \iflocalinterlinespace \else
- \doifdefined\bodyfontinterlinespecs
- {\doifsomething\bodyfontinterlinespace
- {\edef\normallineheight{\bodyfontinterlinespace}}}%
- \fi}
-
-\def\setupspecifiedinterlinespace[#1]%
- {\getparameters[\??it][#1]%
- \scratchdimen0\@@itheight\points
- \advance\scratchdimen 0\@@itdepth\points
- \ifdim\scratchdimen>\onepoint
- \showmessage\m!layouts{10}{\@@itheight,\@@itdepth}%
- \let\@@itheight\strutheightfactor
- \let\@@itdepth \strutdepthfactor
- \else
- \let\strutheightfactor\@@itheight
- \let\strutdepthfactor \@@itdepth
- \fi
- \let\minimumstrutheight \@@itminheight
- \let\minimumstrutdepth \@@itmindepth
- \let\minimumlinedistance\@@itdistance
- \let\normallineheight \@@itline % let ! ! ! ! ! ivm ex
- \doifelse\@@ittop\v!height % new, topskip does more bad than good
- {\let\topskipfactor \@@itheight}
- {\let\topskipfactor \@@ittop }%
- \let\maxdepthfactor \@@itbottom
- \let\baselinegluefactor \@@itstretch
- \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
- [#1]
- [ \v!on=>\oninterlineskip,
- \v!off=>\offinterlineskip,
- \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]}
-
-\def\setuplocalinterlinespace[#1]%
- {\localinterlinespacetrue
- \setupinterlinespace[#1]%
- \localinterlinespacefalse}
-
-\def\simplesetupinterlinespace
- {\localinterlinespacetrue
- \setfontparameters
- \updateraggedskips % funny one here
- \localinterlinespacefalse}
-
-\definecomplexorsimple\setupinterlinespace
-
-% In earlier versions \type{\bigskipamount} was
-% \type{\ht\strutbox} and the stretch was plus or minus
-% \type{.4\dp\strutbox}. Don't ask me why. The most recent
-% implementation is based on a user supplied distance, which
-% is by default \type{.75\normalskipamount} where
-% \type{\normalskipamount} equals the current baseline
-% distance.
-
-% \lineskiplimit = -\maxdimen -> freezes baselineskip
-
-% can be conditionals
-
-\newif\ifblanknowhite \blanknowhitefalse
-\newif\ifblankindeed \blankindeedfalse
-\newif\ifblankreset \blankresetfalse
-\newif\ifblankdisable \blankdisablefalse
-\newif\ifblankflexible \blankflexibletrue
-\newif\ifblankouter
-\newif\ifblankforce
-\newif\ifblankgoback
-
-\newskip\blankskip \blankskip=\bigskipamount
-\newskip\blankskipamount
-
-\def\skipfactor {.75}
-\def\skipgluefactor{.25}
-
-\def\normalskipamount
- {\openlineheight
- \ifgridsnapping \else \ifblankflexible
- \!!plus \skipgluefactor\openlineheight
- \!!minus\skipgluefactor\openlineheight
- \fi \fi
- \relax}
-
-\def\linedistance {\normalskipamount}
-\def\appliedblankskip{\skipfactor\linedistance}
-\def\lastblankskip {\blankskip}
-\def\currentblank {\v!big}
-\def\oldprevdepth {\prevdepth}
-\def\newprevdepth {-1001pt}
-\def\mindimen {1sp} % was: 0.00002pt
-
-\newif\iflocalblankfixed
-\newif\iflocalblankflexible
-
-\def\geenblanko{\removelastskip} % will become obsolete
-
-%%%% pas op, wordt ook in core-pos gebruikt
-
-\def\doassignsomeskip#1\to#2% ook nog \v!halfline+fuzzysnap
- {\doifelse{#1}\v!line
- {#2\openlineheight}
- {\ifgridsnapping
- \assigndimension{#1}{#2}{.25\openlineheight}{.5\openlineheight}\openlineheight
- \else
- \assigndimension{#1}{#2}\smallskipamount\medskipamount\bigskipamount
- \fi}%
- \relax}
-
-% \relax is really needed, else we may loose stretch due to lookahead; somehow
-% this bug was introduced a while ago but somehow went unnoticed; fixed 2/7/2008
-
-\def\addblankskip#1#2#3{\global\advance\blankskip#1\ifgridsnapping#3\else#2\fi\relax}
-
-\def\defineblankmethod[#1]#2{\setvalue{\??bo\??bo#1}{#2}}
-
-\defineblankmethod [\v!big] {\addblankskip+\bigskipamount \openlineheight}
-\defineblankmethod [-\v!big] {\addblankskip-\bigskipamount \openlineheight}
-\defineblankmethod [\v!medium] {\addblankskip+\medskipamount {.5\openlineheight}}
-\defineblankmethod [-\v!medium] {\addblankskip-\medskipamount {.5\openlineheight}}
-\defineblankmethod [\v!small] {\addblankskip+\smallskipamount{.25\openlineheight}}
-\defineblankmethod [-\v!small] {\addblankskip-\smallskipamount{.25\openlineheight}}
-\defineblankmethod [\v!white] {\addblankskip+\parskip \openlineheight}
-\defineblankmethod [-\v!white] {\addblankskip-\parskip \openlineheight}
-\defineblankmethod [\v!line] {\addblankskip+\openlineheight \openlineheight}
-\defineblankmethod [-\v!line] {\addblankskip-\openlineheight \openlineheight}
-
-\defineblankmethod [\v!formula] {\global\advance\blankskip\medskipamount}
-\defineblankmethod [\v!nowhite] {\global\blanknowhitetrue}
-\defineblankmethod [\v!disable] {\global\blankdisabletrue}
-\defineblankmethod [\v!force] {\global\blankforcetrue}
-\defineblankmethod [\v!outer] {\ifvmode\ifinner\blankoutertrue\fi\fi}
-\defineblankmethod [\v!reset] {\global\blankresettrue}
-\defineblankmethod [\v!flexible] {\global\localblankflexibletrue}
-\defineblankmethod [\v!fixed] {\global\localblankfixedtrue}
-\defineblankmethod [\v!back] {\global\blankgobacktrue} % {\geenblanko}
-\defineblankmethod [\v!halfline] {\ifgridsnapping\global\fuzzyvskiptrue\fi
- \global\advance\blankskip .5\lineheight}
-\defineblankmethod [\v!none] {\global\blankresettrue}
-\defineblankmethod [\v!joinedup] {\ifvmode\nointerlineskip\fi}
-\defineblankmethod[\v!synchronize] {\verticalstrut\vskip-2\lineheight\verticalstrut}
-
-% \vtop{\blank[synchronize]\blank[line]test}
-
-\defineblankmethod [\v!always] {\redowhitespace} % experimental
-
-% 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+\openlineheight\openlineheight
- \addblankskip+\openlineheight\openlineheight}
-
-\defineblankmethod
- [2*\v!big]
- {\addblankskip+\bigskipamount\openlineheight
- \addblankskip+\bigskipamount\openlineheight}
-
-\def\doblank#1%
- {\edefconvertedargument\ascii{#1}%
- \ifx\ascii\empty\else
- \ifcsname\??bo\??bo\ascii\endcsname % internal def
- \csname\??bo\??bo\ascii\endcsname
- \else\ifcsname\??bo\ascii\endcsname % user def / slow
- \@EA\rawprocesscommalist\@EA[\csname\??bo\ascii\endcsname]\doblank\relax
- \else
- \dorepeatwithcommand[#1]\redoblank
- \fi\fi
- \fi
- \relax}
-
-\def\redoblank#1%
- {\edefconvertedargument\ascii{#1}%
- \ifx\ascii\empty\else
- \ifcsname\??bo\??bo\ascii\endcsname % internal def
- \csname\??bo\??bo\ascii\endcsname
- \else\ifcsname\??bo\ascii\endcsname % user def / slow
- \@EA\rawprocesscommalist\@EA[\csname\??bo\ascii\endcsname]\doblank\relax
- \else
- \global\advance\blankskip#1\relax
- \fi\fi
- \fi
- \relax}
-
-\unexpanded\def\blank % the \relax is definitely needed due to the many \if's
- {\relax\complexorsimple\doblank}
-
-\def\complexdoblank
- {\flushnotes
- \ifmmode
- \@EA\nocomplexdoblank
- \else
- \ifopelkaar
- \ifinpagebody
- \@EA\@EAEAEA\@EA\docomplexdoblank
- \else
- \@EA\@EAEAEA\@EA\nocomplexdoblank
- \fi
- \else
- \@EAEAEA\docomplexdoblank
- \fi
- \fi}
-
-\def\nocomplexdoblank[#1]%
- {% evt blokkeerfalse
- \ifmmode\else\par\fi}
-
-% Overloaded in cont-new!
-
-\newsignal\noblanksignal
-
-% \def\doinhibitblank
-% {\kern\noblanksignal}
-
-% \def\inhibitblank% the fast, local way
-% {\endgraf\ifvmode\prevdepth\newprevdepth\fi}
-
-% \def\docomplexdoblank[#1]% pas op \relax's zijn nodig ivm volgende \if
-% {\global\blankresetfalse
-% \global\blankdisablefalse
-% \global\blanknowhitefalse
-% \global\localblankflexiblefalse
-% \global\localblankfixedfalse
-% \global\blankskip\zeropoint
-% \global\blankforcefalse
-% \global\blankgobackfalse
-% \blankouterfalse
-% \expanded{\rawprocesscommalist[#1]}\doblank
-% \ifdim\blankskip=\zeropoint\relax
-% \iflocalblankflexible
-% \doglobal\advance\blankskip \currentblank
-% \else\iflocalblankfixed
-% \doglobal\advance\blankskip \currentblank
-% \fi\fi
-% \fi
-% \ifblankouter
-% \else
-% \par
-% \ifvmode
-% \ifblankgoback
-% \removelastskip
-% \fi
-% \ifblankforce
-% % dit gaat mis in pos fonts
-% % \ifdim\prevdepth>\zeropoint\else ...
-% % -1000pt signals top of page or column (\ejectcolumn)
-% \bgroup\forgeteverypar\verticalstrut\egroup\kern-\struttotal
-% \fi
-% \ifblankdisable
-% \global\blankindeedfalse
-% \ifgridsnapping
-% \ifdim\prevdepth<\zeropoint
-% % brrr
-% \else
-% % dirty trick: smaller blanks are ignored after
-% % a larger one, so 10 lines is probably safe; first make
-% % sure that we honor penalties
-% \scratchcounter\lastpenalty
-% % now comes the trick (cross our fingers that this works
-% % well in multi columns; maybe an ifinner test is needed
-% % \vskip-10\lineheight
-% % \ifnum\scratchcounter=\zerocount \else \penalty\lastpenalty \fi
-% % \vskip 10\lineheight
-% % allas, this leads to overfull pages, so we try this:
-% \kern-\noblanksignal
-% \ifnum\scratchcounter=\zerocount
-% \else
-% \penalty\lastpenalty
-% \fi
-% \kern\noblanksignal
-% % end-of-dirty-trick
-% \fi
-% \else
-% \ifdim\prevdepth<\zeropoint
-% % brrr
-% \else
-% % ensure at least a proper prevdepth, this should be
-% % an option
-% \vskip-\prevdepth
-% \vskip\strutdepth
-% \prevdepth\strutdepth
-% \fi
-% % the old crappy piece of code
-% \edef\oldprevdepth{\the\prevdepth}%
-% \prevdepth\newprevdepth
-% \fi
-% \else
-% \global\blankindeedtrue
-% \fi
-% \ifblankreset
-% \global\blankindeedtrue
-% \ifgridsnapping
-% % let's play safe and not fool around with the depth, if
-% % only because it took a lot of effort to sort out the grid
-% % stuff in the first place
-% \else
-% \ifdim\prevdepth=\newprevdepth
-% \prevdepth\oldprevdepth
-% \fi
-% \fi
-% \fi
-% \ifblankindeed
-% \ifdim1\lastskip<1\blankskip\relax
-% % else when \blanko[2*groot] + \blanko[3*groot] with parskip
-% % equaling 1*groot, gives a groot=\parskip so adding a small
-% % value makes it distinguishable; can also be done at parskip
-% % setting time (better)
-% \global\advance\blankskip \mindimen\relax % = skip
-% % test this on 2* + 3* and parskip groot
-% \ifblanknowhite
-% \global\advance\blankskip -\parskip
-% \else
-% \ifdim\lastskip=\parskip
-% \else % force this due to previous comment
-% \ifdim\parskip>\zeropoint\relax
-% \ifdim\blankskip<\parskip\relax
-% \global\blankskip\zeropoint
-% \else
-% \global\advance\blankskip -\parskip
-% \fi
-% \fi
-% \fi
-% \fi
-% \ifblankflexible \else
-% \blankskip1\blankskip
-% \fi
-% \iflocalblankfixed
-% \blankskip1\blankskip
-% \fi
-% \iflocalblankflexible
-% \blankskip1\blankskip
-% \!!plus\skipgluefactor\blankskip
-% \!!minus\skipgluefactor\blankskip
-% \fi
-% \ifdim\lastkern=\noblanksignal % controled and grid
-% \global\blankindeedfalse
-% \else\ifgridsnapping\else\ifdim\prevdepth=\newprevdepth
-% \global\blankindeedfalse
-% \fi\fi\fi
-% \ifblankindeed
-% \iffuzzyvskip
-% \removelastfuzzyvskip
-% \fuzzyvskip\blankskip\relax
-% \else
-% \removelastskip
-% \vskip\blankskip\relax
-% \fi
-% \fi
-% \else
-% \iffuzzyvskip
-% \removelastfuzzyvskip
-% \fuzzyvskip\blankskip\relax
-% \else
-% % new, test this on pascal
-% \ifdim\blankskip<\zeropoint
-% \advance\blankskip-\lastskip
-% \removelastskip
-% \ifdim\blankskip>\zeropoint
-% \vskip\blankskip
-% \else
-% \vskip\zeropoint
-% \fi
-% \else
-% % also new
-% \ifdim\blankskip=\zeropoint
-% \ifblanknowhite
-% \geenwitruimte
-% \fi
-% \fi
-% \fi
-% \fi
-% \fi
-% \fi
-% \fi
-% \fi
-% \global\fuzzyvskipfalse
-% \presetindentation}
-
-% goback was broken:
-
-% \def\doinhibitblank
-% {\kern\noblanksignal}
-
-% \def\inhibitblank% the fast, local way
-% {\endgraf\ifvmode\prevdepth\newprevdepth\fi}
-
-% problem: we cannot look back in the mvl so we need 3 kinds of signals
-
-\def\noblankpsignal{1010101}
-
-\def\inhibitgridblank % was doinhibitblank
- {\ifvmode\else\endgraf\fi
- \ifvmode
- \ifnum\lastpenalty<10000
- \kern-\noblanksignal % new
- \kern \noblanksignal
- \else
- \penalty\noblankpsignal
- \fi
- \fi}
-
-\def\inhibittextblank % was inhibitblank
- {\endgraf
- \ifvmode
- \prevdepth\newprevdepth
- \fi}
-
-% new macro
-%
-% \def\inhibitblank % need some work
-% {\endgraf
-% \ifvmode
-% \ifgridsnapping
-% \inhibitgridblank
-% \else
-% % this one spoils the grid
-% \inhibittextblank
-% \fi
-% \fi}
-
-\def\doinhibitblank{\inhibitgridblank}
-\def\inhibitblank {\inhibittextblank}
-
-% will become obsolete
-
-\ifx\undefined\savedlastskip \newskip \savedlastskip \fi
-\ifx\undefined\savedlastpenalty \newcount\savedlastpenalty \fi
-
-% beware, prevdepth can have funny values (e.g. mvl value when in box)
-
-\def\docomplexdoblank[#1]% pas op \relax's zijn nodig ivm volgende \if
- {\global\blankresetfalse
- \global\blankdisablefalse
- \global\blanknowhitefalse
- \global\localblankflexiblefalse
- \global\localblankfixedfalse
- \global\blankforcefalse
- \global\blankgobackfalse
- \blankouterfalse
- \global\blankskip\zeropoint
-%
-\edefconvertedargument\ascii{#1}% todo fast check for simple
-\ifcsname\??bo\??bo\ascii\endcsname % internal def
- \csname\??bo\??bo\ascii\endcsname
-\else\ifcsname\??bo\ascii\endcsname % user def / slow
- \@EA\rawprocesscommalist\@EA[\csname\??bo\ascii\endcsname]\doblank\relax
-\else
- \expanded{\rawprocesscommalist[#1]}\doblank
-\fi\fi
-%
- \relax % to be sure
- \ifdim\blankskip=\zeropoint\relax
- \iflocalblankflexible
- \doglobal\advance\blankskip \currentblank
- \else\iflocalblankfixed
- \doglobal\advance\blankskip \currentblank
- \fi\fi
- \fi
- \relax % to be sure
- \ifblankouter
- % do nothing
- \else
- \par
- \ifvmode
- \ifblankgoback
- \ifdim\lastskip>\zeropoint \vskip-\lastskip \fi
- \savedlastskip\zeropoint
- \else\ifdim\lastskip>\zeropoint
- \savedlastskip\lastskip
- \else % todo: lastnode, dan namelijk geen skip !
- \savedlastskip\zeropoint
- \fi\fi
- \ifblankforce
- % dit gaat mis in pos fonts
- % \ifdim\prevdepth>\zeropoint\else ...
- % -1000pt signals top of page or column (\ejectcolumn)
- \bgroup\forgeteverypar\verticalstrut\egroup\kern-\struttotal
- \savedlastskip\zeropoint
- \fi
- \savedlastpenalty\lastpenalty % hm, now it gets lost
- \ifblankdisable
- \global\blankindeedfalse % keep this, i.e. disable current too
- \ifgridsnapping
- \ifdim\prevdepth<\zeropoint
- % brrr
- \else
- % dirty trick: smaller blanks are ignored after a
- % larger one, so 10 lines is probably safe; we need
- % to make sure that we honor penalties; here comes the
- % trick (cross our fingers that this works well in
- % multi columns; maybe an ifinner test is needed
- % \scratchcounter\lastpenalty
- % \vskip-10\lineheight
- % \ifnum\scratchcounter=\zerocount \else \penalty\lastpenalty \fi
- % \vskip 10\lineheight
- % alas, this leads to overfull pages, so we try this:
- \inhibitgridblank
- \fi
- \else
- \ifdim\prevdepth<\zeropoint
- % brrr
- \else
- % ensure at least a proper prevdepth, this should be
- % an option
- \vskip-\prevdepth
- \vskip\strutdepth
- \prevdepth\strutdepth
- \fi
- % the old crappy piece of code
- \edef\oldprevdepth{\the\prevdepth}%
- \prevdepth\newprevdepth % == \inhibittextblank
- \fi
- \else
- \global\blankindeedtrue
- \fi
- \ifblankreset
- \global\blankindeedtrue
- \ifgridsnapping
- % let's play safe and not fool around with the depth, if
- % only because it took a lot of effort to sort out the grid
- % stuff in the first place
- \else
- \ifdim\prevdepth=\newprevdepth
- \prevdepth\oldprevdepth
- \fi
- \fi
- \fi
- \ifblankindeed
- \ifdim1\savedlastskip<1\blankskip\relax
- % else when \blank[2*groot] + \blank[3*groot] with parskip
- % equaling 1*groot, gives a groot=\parskip so adding a small
- % value makes it distinguishable; can also be done at parskip
- % setting time (better)
- \global\advance\blankskip \mindimen\relax % = skip
- % test this on 2* + 3* and parskip groot
- \ifblanknowhite
- \global\advance\blankskip -\parskip
- \else
- \ifdim\savedlastskip=\parskip
- \else % force this due to previous comment
- \ifdim\parskip>\zeropoint\relax
- \ifdim\blankskip<\parskip\relax
- \global\blankskip\zeropoint
- \else
- \global\advance\blankskip -\parskip
- \fi
- \fi
- \fi
- \fi
- \ifblankflexible \else
- \blankskip1\blankskip
- \fi
- \iflocalblankfixed
- \blankskip1\blankskip
- \fi
- \iflocalblankflexible
- \blankskip1\blankskip
- \!!plus \skipgluefactor\blankskip
- \!!minus\skipgluefactor\blankskip
- \fi
- \ifdim\lastkern=\noblanksignal\relax % controlled and grid
- \global\blankindeedfalse
- \else\ifnum\savedlastpenalty=\noblankpsignal\relax % controlled and grid
- \global\blankindeedfalse
- \else\ifgridsnapping\else\ifdim\prevdepth=\newprevdepth
- \global\blankindeedfalse
- \fi\fi\fi\fi
- \ifblankindeed
- \iffuzzyvskip
- \removelastfuzzyvskip
- \fuzzyvskip\blankskip\relax
- \else
- \relax\ifdim\savedlastskip=\zeropoint\else
- \vskip-\savedlastskip
- \fi
- \vskip\blankskip\relax
- \fi
- \fi
- \else
- \iffuzzyvskip
- \removelastfuzzyvskip
- \fuzzyvskip\blankskip\relax
- \else
- % new, test this on pascal
- \ifdim\blankskip<\zeropoint
- \relax\ifdim\savedlastskip=\zeropoint\else
- \advance\blankskip-\savedlastskip
- \vskip-\savedlastskip
- \fi
- \ifdim\blankskip>\zeropoint
- \vskip\blankskip
- \else
- \vskip\zeropoint
- \fi
- \else
- % also new
- \ifdim\blankskip=\zeropoint
- \ifblanknowhite
- \nowhitespace
- \fi
- \fi
- \fi
- \fi
- \fi
- \fi
- \fi
- \fi
- \global\fuzzyvskipfalse
- \presetindentation}
-
-%D For a long time we had:
-%D
-%D \starttyping
-%D \def\simpledoblank%
-%D {\doifelse{\currentwhitespace}{\v!geen}
-%D {\blank[\currentblank]}
-%D {\blank[\currentwhitespace]}}
-%D \stoptyping
-%D
-%D But Berend de Boer wanted more control, so now we have:
-
-\def\simpledoblank % ...
- {\doifelse\currentwhitespace\v!none
- {\blank[\currentblank]}
- {\blank[\s!default]}}
-
-%D Another useful definition would be:
-%D
-%D \starttyping
-%D \defineblank
-%D [\s!default]
-%D [\v!groot]
-%D \stoptyping
-
-\def\dosetupblank#1% amount are an plain inheritance
- {\bigskipamount#1\relax
- \ifblankflexible \else
- \bigskipamount1\bigskipamount
- \fi
- \medskipamount \bigskipamount \divide\medskipamount \plustwo
- \smallskipamount\bigskipamount \divide\smallskipamount\plusfour}%
-
-\def\complexsetupblank[#1]% more \let's -> this also wil become installable
- {\ifgridsnapping
- \blankflexiblefalse
- \else
- \ExpandFirstAfter\processallactionsinset
- [#1]
- [ \v!flexible=>\blankflexibletrue,
- \v!fixed=>\blankflexiblefalse]%
- \fi
- \ExpandFirstAfter\processallactionsinset
- [#1]
- [ \v!flexible=>\dosetupblank\appliedblankskip,
- \v!fixed=>\dosetupblank\appliedblankskip,
- \v!line=>\edef\appliedblankskip{\linedistance}%
- \dosetupblank\appliedblankskip,
- \v!halfline=>\scratchskip.5\linedistance
- \edef\appliedblankskip{\the\scratchskip}%
- \dosetupblank\appliedblankskip,
- \v!big=>\ifgridsnapping
- \edef\appliedblankskip{\linedistance}%
- \dosetupblank\appliedblankskip
- \fi
- \let\currentblank\v!big,
- \v!medium=>\let\currentblank\v!medium,
- \v!small=>\let\currentblank\v!small,
- \v!global=>\let\currentblank\v!global,
- \v!normal=>\dosetupblank\appliedblankskip,
- \v!standard=>\edef\appliedblankskip{\skipfactor\linedistance}%
- \dosetupblank\appliedblankskip,
- \s!default=>\dosetupblank\appliedblankskip,
- \s!unknown=>\let\appliedblankskip\commalistelement
- \dosetupblank\appliedblankskip]%
- \simplesetupwhitespace}
-
-% \definecomplexorsimpleempty\setupblank
-%
-% speed gain: 60 sec -> 30 sec
-
-\definecomplexorsimple\setupblank
-
-\def\simplesetupblank % == snelle \setupblank[\s!default]
- {\ifgridsnapping
- \blankflexiblefalse
- \fi
- \dosetupblank\appliedblankskip
- % \let\deblanko\v!big
- \simplesetupwhitespace}
-
-\def\restorestandardblank% \v!standard
- {\edef\appliedblankskip{\skipfactor\linedistance}%
- \dosetupblank\appliedblankskip
- }%\let\deblanko\v!big}
-
-\def\dodefineblank[#1][#2]%
- {\def\docommand##1{\setvalue{\??bo##1}{#2}}%
- \processcommalist[#1]\docommand}
-
-\def\defineblank
- {\dodoubleargument\dodefineblank}
-
-\def\savecurrentblank
- {\edef\restorecurrentblank
- {\bigskipamount\the\bigskipamount
- \medskipamount\the\medskipamount
- \smallskipamount\the\smallskipamount
- \noexpand\def\noexpand\currentblank{\currentblank}%
- \ifblankflexible
- \noexpand\blankflexibletrue
- \else
- \noexpand\blankflexiblefalse
- \fi}}
-
-%D Now.
-
-\defineblank [\s!default] [\v!white]
-\defineblank [\v!height] [\strutheight]
-\defineblank [\v!depth] [\strutdepth]
-
-% old implementation
-%
-% \let\currentindentation=\empty
-%
-% \newdimen\ctxparindent
-%
-% \newif\ifindentfirstparagraph % \indentfirstparagraphtrue
-%
-% \def\presetindentation
-% {\doifoutervmode{\ifindentfirstparagraph\else\noindentation\fi}}
-%
-% \definecomplexorsimple\setupindenting
-%
-% \def\complexsetupindenting[#1]%
-% {\processallactionsinset
-% [#1]
-% [ \v!first=>\indentfirstparagraphtrue,
-% \v!next=>\indentfirstparagraphfalse,
-% \s!default=>\simplesetupindenting,
-% \s!unknown=>\edef\currentindentation{\commalistelement}%
-% \simplesetupindenting]}
-%
-% \def\simplesetupindenting
-% {\assigndimension\currentindentation\ctxparindent{1em}{1.5em}{2em}%
-% \parindent\ctxparindent\relax}
-%
-% \def\indenting % watch out: \dodo and no \do
-% {\dosingleargument\dodoindenting}
-%
-% \def\dodoindenting[#1]% oeps, we needed a commalist handler here!
-% {\edef\currentindenting{#1}%
-% \processcommacommand[#1]\dododoindenting}
-%
-% \def\dododoindenting#1%
-% {\executeifdefined{\??in:#1}\donothing}
-%
-% \let\currentindenting\empty
-%
-% \def\defineindentingmethod[#1]#2%
-% {\setvalue{\??in:#1}{#2}}
-%
-% \defineindentingmethod [\v!no] {\parindent\ctxparindent\noindent}
-% \defineindentingmethod [\v!not] {\parindent\ctxparindent\noindent}
-%
-% \defineindentingmethod [\v!first] {\indentfirstparagraphtrue}
-% \defineindentingmethod [\v!next] {\indentfirstparagraphfalse}
-%
-% \defineindentingmethod [\v!yes] {\parindent\ctxparindent\relax} % no \indent !
-% \defineindentingmethod [\v!always] {\parindent\ctxparindent\relax} % no \indent !
-%
-% \defineindentingmethod [\v!never] {\parindent\zeropoint\relax} % no \indent !
-%
-% \def\noindenting{\indenting[\v!no,\v!next]} % was \nietinspringen
-% \def\doindenting{\indenting[\v!yes,\v!first]} % was \welinspringen
-%
-% \def\dochecknextindentation#1% internal one
-% {\checknextindentation[\getvalue{#1\c!indentnext}]}
-%
-% \def\checknextindentation[#1]%
-% {\processaction[#1][%\v!keep=>,
-% \v!yes=>\doindentation,
-% \v!no=>\noindentation,
-% \v!auto=>\autoindentation]}
-%
-% \def\doindentation% too simple
-% {\gdef\checkindentation{\global\indentationtrue}}
-%
-% \ifx\autoindentation\undefined
-% \let\autoindentation\relax
-% \fi
-%
-% \newif\ifindentation \indentationtrue % documenteren, naar buiten
-%
-% \let\checkindentation=\relax
-%
-% \def\donoindentation
-% {\ifdim\parindent=\zeropoint \else
-% \bgroup \setbox\scratchbox\lastbox \egroup
-% \fi}
-%
-% \def\noindentation % made global
-% {\ifinpagebody \else
-% \global\indentationfalse
-% \gdef\checkindentation
-% {\donoindentation
-% \gdef\checkindentation{\global\indentationtrue}}%
-% \fi}
-%
-% \def\nonoindentation % bv bij floats
-% {\ifinpagebody \else
-% \global\indentationtrue
-% \gdef\checkindentation{\global\indentationtrue}%
-% \fi}
-%
-% \def\indentation
-% {\ifvmode \ifdim\parindent=\zeropoint \else
-% % was : \hskip\parindent
-% % can be: \indent
-% % but we test:
-% \noindent\hskip\parindent
-% \fi \fi}
-
-\let\currentindentation\empty % amount/keyword
-% \let\normalindentation \empty % used for reinstating normal indentation
-\let\currentindenting \empty % method
-
-\newdimen\ctxparindent
-
-\newif\ifindentfirstparagraph % \indentfirstparagraphtrue
-
-\chardef\indentingtoggle\zerocount
-
-%D After a blank or comparable situation (left side floats) we
-%D need to check if the next paragraph has to be indented.
-
-\def\presetindentation
- {\doifoutervmode{\ifindentfirstparagraph\else\noindentation\fi}}
-
-%D This sets up the (normally) global indentation behavior as well
-%D as the amounts.
-
-\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}%
- \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%
- {\edefconvertedargument\!!stringa{#1}%
- \doifundefined{\??in:\!!stringa}%
- {\edef\currentindentation{#1}%
- \let\normalindentation\currentindentation
- \simplesetupindenting}}
-
-\def\docomplexsetupindentingB#1%
- {\edefconvertedargument\!!stringa{#1}% catch #1=\somedimen
- \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
- {\dosingleargument\complexsetupindenting}
-
-% use \noindentation to suppress next indentation
-
-\def\defineindentingmethod[#1]#2%
- {\setvalue{\??in:#1}{#2}}
-
-\defineindentingmethod [\v!no] {\parindent\zeropoint}% was: \ctxparindent\noindent}
-\defineindentingmethod [\v!not] {\parindent\zeropoint}% was: \ctxparindent\noindent}
-
-\defineindentingmethod [\v!first] {\indentfirstparagraphtrue}
-\defineindentingmethod [\v!next] {\indentfirstparagraphfalse}
-
-\defineindentingmethod [\v!yes] {\parindent\ctxparindent\relax} % no \indent !
-\defineindentingmethod [\v!always] {\parindent\ctxparindent\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}
-
-\defineindentingmethod [\v!normal] {\ifx\normalindentation\empty\else
- \let\currentindentation\normalindentation
- \simplesetupindenting
- \fi}
-
-\defineindentingmethod [\v!reset] {\indentfirstparagraphtrue
- \parindent\zeropoint
- \chardef\indentingtoggle\zerocount}
-
-\def\noindenting{\indenting[\v!no, \v!next ]}
-\def\doindenting{\indenting[\v!yes,\v!first]}
-
-%D This one sets up the local indentation behaviour (i.e. either or not
-%D a next paragraph will be indented).
-
-\def\dochecknextindentation#1% internal one
- {\checknextindentation[\getvalue{#1\c!indentnext}]}
-
-\def\checknextindentation[#1]%
- {\processaction
- [#1]
- [%\v!keep=>,
- \v!yes=>\doindentation,
- \v!no=>\noindentation,
- \v!auto=>\autoindentation]}
-
-%D Here come the handlers.
-
-\newif\ifindentation \indentationtrue % documenteren, naar buiten
-
-\let\checkindentation\relax
-
-\ifx\autoindentation\undefined \let\autoindentation\relax \fi % hook
-
-\def\doindentation
- {\gdef\checkindentation{\global\indentationtrue}}
-
-\def\noindentation % made global
- {\ifinpagebody \else
- \global\indentationfalse
- \gdef\checkindentation
- {\donoindentation
- \gdef\checkindentation{\global\indentationtrue}}%
- \fi}
-
-\def\nonoindentation % bv bij floats
- {\ifinpagebody \else
- \global\indentationtrue
- \gdef\checkindentation{\global\indentationtrue}%
- \fi}
-
-\def\donoindentation
- {\ifdim\parindent=\zeropoint \else
- \bgroup \setbox\scratchbox\lastbox \egroup
- \fi}
-
-\def\indentation
- {\ifvmode \ifdim\parindent=\zeropoint \else
- % was : \hskip\parindent
- % can be: \indent
- % but we test:
- \noindent\hskip\parindent
- \fi \fi}
-
-\def\toggleindentation
- {\ifcase\indentingtoggle
- % nothing
- \or
- \notoggleindentation
- \or
- \dotoggleindentation
- \fi}
-
-\def\dokillindentation
- {\gdef\checkindentation{\global\indentationfalse\donoindentation}}
-
-\def\dotoggleindentation
- {\gdef\checkindentation{\global\indentationfalse\notoggleindentation\donoindentation}}
-
-\def\notoggleindentation
- {\gdef\checkindentation{\global\indentationtrue\dotoggleindentation}}
-
-\appendtoks
- \pushmacro\checkindentation
- \pushmacro\ifindentation
-\to \everypushsomestate
-
-\appendtoks
- \popmacro\ifindentation
- \popmacro\checkindentation
-\to \everypopsomestate
-
-% 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
-
-
-%D \macros
-%D {frenchspacing,nonfrenchspacing}
-%D
-%D Smehow \type{\frenchspacing} can lead to hyphenation between
-%D dashes so we now have \type {\newfrenchspacing} (moved from
-%D \type {syst-chr}).
-
-%D Hm ... todo:
-
-\sfcode`\)=0
-\sfcode`\'=0
-\sfcode`\]=0
-
-\def\setfrenchspacing#1%
- {\sfcode`\.#1 \sfcode`\,#1\relax
- \sfcode`\?#1 \sfcode`\!#1\relax
- \sfcode`\:#1 \sfcode`\;#1\relax}
-
-\def\frenchspacing
- {\setfrenchspacing{1000}}
-
-\def\resetfrenchspacing
- {\sfcode`\.3000 \sfcode`\,1250
- \sfcode`\?3000 \sfcode`\!3000
- \sfcode`\:2000 \sfcode`\;1500 }
-
-\def\frenchspacing {\setfrenchspacing{1000}}
-\def\newfrenchspacing{\setfrenchspacing{1050}}
-\def\nonfrenchspacing{\resetfrenchspacing}
-
-\def\definespacingmethod[#1]#2{\setvalue{\??sg\??sg#1}{#2}}
-
-\definespacingmethod[\v!packed]{\newfrenchspacing}
-\definespacingmethod[\v!broad ]{\nonfrenchspacing}
-
-\def\complexsetupspacing[#1]%
- {\executeifdefined{\??sg\??sg#1}\relax
- \updateraggedskips}
-
-\def\simplesetupspacing
- {\updateraggedskips}
-
-\definecomplexorsimple\setupspacing
-
-\let\normalspaceprimitive=\ % space-comment is really needed else \<newline>
-
-\unexpanded\def\nonbreakablespace{\penalty\plustenthousand\normalspaceprimitive}
-
-\letcatcodecommand \ctxcatcodes `\~ \nonbreakablespace
-
-\def\space { }
-\def\removelastspace{\ifhmode\unskip\fi}
-\def\nospace {\removelastspace\ignorespaces}
-
-% in tables we need:
-%
-% \def\fixedspace {\hskip.5em\relax}
-%
-% but, since not all fonts have .5em digits:
-
-\unexpanded\def\fixedspace
- {\setbox\scratchbox\normalhbox{\mathortext{0}{0}}%
- \hskip\wd\scratchbox\relax}
-
-\def\fixedspaces
- {\letcatcodecommand \ctxcatcodes `\~ \fixedspace}
-
-\def\removeunwantedspaces
- {\ifhmode % we also need to unskip 0pt skips
- \unskip\unskip\unskip\unskip\unskip
- \unskip\unskip\unskip\unskip\unskip
- \fi}
-
-\appendtoks
- \let~\space
- \let\ \space
-\to\simplifiedcommands
-
-% still not fixed in aleph / luatex
-%
-% \def\removeunwantedspaces
-% {\ifhmode \ifnum\lastnodetype=\@@gluenode
-% \unskip \@EAEAEA\removeunwantedspaces
-% \fi \fi}
-
-%D For old time sake, will disappear soon.
-
-\let\hardespatie\fixedspace
-\let\geenspatie \nospace
-
-% \startbuffer
-% \startlines \tt \fixedspaces
-% 0~1~~2~~~3~~~~4~~~~~5
-% 0~~~~~~~~~~~~~~~~~~~5
-% $0~1~~2~~~3~~~~4~~~~~5$
-% $0~~~~~~~~~~~~~~~~~~~5$
-% \stoplines
-%
-% \starttabulate[|~|]
-% \NC 0~1~~2~~~3~~~~4~~~~~5 \NC \NR \NC 0~~~~~~~~~~~~~~~~~~~5 \NC \NR
-% \NC $0~1~~2~~~3~~~~4~~~~~5$ \NC \NR \NC $0~~~~~~~~~~~~~~~~~~~5$ \NC \NR
-% \stoptabulate
-%
-% \starttable[||]
-% \NC 0~1~~2~~~3~~~~4~~~~~5 \NC \AR \NC 0~~~~~~~~~~~~~~~~~~~5 \NC \AR
-% \NC $0~1~~2~~~3~~~~4~~~~~5$ \NC \AR \NC $0~~~~~~~~~~~~~~~~~~~5$ \NC \AR
-% \stoptable
-% \stopbuffer
-%
-% \setupbodyfont[cmr] \getbuffer
-% \setupbodyfont[lbr] \getbuffer
-
-\def\packed
- {\nointerlineskip}
-
-\def\godown[#1]%
- {\relax
- \ifhmode\endgraf\fi
- \ifvmode\nointerlineskip\vskip#1\relax\fi}
-
-%D A couple of plain macros:
-
-\ifx\thinspace\undefined
-
- \def\thinspace {\kern .16667em }
- \def\negthinspace{\kern-.16667em }
- \def\enspace {\kern .5em }
-
- \def\thinspace {\kern .16667\emwidth}
- \def\negthinspace{\kern-.16667\emwidth}
- \def\enspace {\kern .5\emwidth}
-
-\fi
-
-\ifx\quad\undefined
-
- \def\enskip{\hskip.5em\relax}
- \def\quad {\hskip 1em\relax}
- \def\qquad {\hskip 2em\relax}
-
- \def\enskip{\hskip.5\emwidth}
- \def\quad {\hskip \emwidth}
- \def\qquad {\hskip 2\emwidth}
-
-\fi
-
-\let\emspace\quad
-
-\ifx\smallskip\undefined
-
- \def\smallskip{\vskip\smallskipamount}
- \def\medskip {\vskip\medskipamount}
- \def\bigskip {\vskip\bigskipamount}
-
-\fi
-
-\ifx\allowbreak\undefined
-
- \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 }
-
-\fi
-
-%D Made slightly more readable:
-
-\ifx\vglue\undefined
-
- \def\vglue {\afterassignment\dovglue\scratchskip=}
- \def\hglue {\afterassignment\dohglue\scratchskip=}
- \def\topglue{\nointerlineskip\vglue-\topskip\vglue}
-
- \def\dovglue
- {\par
- \scratchdimen\prevdepth
- \hrule\!!height\zeropoint
- \nobreak\vskip\scratchskip
- \prevdepth\scratchdimen}
-
- \def\dohglue
- {\dontleavehmode % \leavevmode
- \scratchcounter\spacefactor
- \vrule\!!width\zeropoint
- \nobreak\hskip\scratchskip
- \spacefactor\scratchcounter}
-
-\fi
-
-\unexpanded\def\textormathglue#1#2#3% cleaned up one
- {\begingroup
- \ifmmode
- \mskip#1#2%
- \else
- \scratchdimen#1\hspaceamount\empty{#3}%
- \scratchskip\scratchdimen\!!plus.5\scratchdimen\!!minus.3\scratchdimen
- \hskip\scratchskip
- \fi
- \endgroup}
-
-\def\thinglue {\textormathglue+\thinmuskip 1}
-\def\medglue {\textormathglue+\medmuskip 2}
-\def\thickglue{\textormathglue+\thickmuskip3}
-
-\ifx\eject\undefined
-
- \def\eject{\par\break}
-
-\fi
-
-\ifx\supereject\undefined
-
- \def\supereject{\par\penalty\superpenalty}
-
-\fi
-
-\ifx\dosupereject\undefined
-
- \def\dosupereject
- {\ifnum\insertpenalties>\zerocount % something is being held over
- \line{}
- \kern-\topskip
- \nobreak
- \vfill\supereject
- \fi}
-
-\fi
-
-%D We adapt plain's \type {\removelastskip} a bit:
-
-\ifx\removelastskip\undefined
-
- \def\removelastskip
- {\ifvmode \ifdim\lastskip=\zeropoint \else
- \vskip-\lastskip
- \fi \fi}
-
-\fi
-
-\ifx\smallbreak\undefined
-
-\def\smallbreak
- {\par
- \ifdim\lastskip<\smallskipamount
- \removelastskip
- \penalty-50
- \smallskip
- \fi}
-
-\def\medbreak
- {\par
- \ifdim\lastskip<\medskipamount
- \removelastskip
- \penalty-100
- \medskip
- \fi}
-
-\def\bigbreak
- {\par
- \ifdim\lastskip<\bigskipamount
- \removelastskip
- \penalty-200
- \bigskip
- \fi}
-
-\fi
-
-\newskip\ctxparskip \ctxparskip\zeropoint
-
-\newconditional \flexiblewhitespace \settrue\flexiblewhitespace
-
-\def\blankokleinmaat {\smallskipamount}
-\def\blankomiddelmaat {\medskipamount}
-\def\blankogrootmaat {\bigskipamount}
-\def\currentwhitespace {\zeropoint}
-
-\definecomplexorsimple\setupwhitespace
-
-% \def\simplesetupwhitespace
-% {\doifnot\currentwhitespace\v!none\dosetupwhitespace}
-%
-% \def\complexsetupwhitespace[#1]%
-% {\doifelsenothing{#1}
-% {\simplesetupwhitespace}
-% {\edef\currentwhitespace{#1}%
-% \dosetupwhitespace}}
-%
-% \def\dosetupwhitespace
-% {\processcommacommand[\currentwhitespace]\dowhitespacemethod
-% \dodosetupwhitespace}
-
-\def\simplesetupwhitespace
- {\doifnot\currentwhitespace\v!none\dosetupwhitespace}
-
-\def\complexsetupwhitespace[#1]%
- {\edef\nextcurrentwhitespace{#1}%
- \ifx\nextcurrentwhitespace\empty
- \simplesetupwhitespace
- \else
- \let\currentwhitespace\nextcurrentwhitespace
- \dosetupwhitespace
- \fi}
-
-\def\dosetupwhitespace % quick test for no list
- {\doifdefinedelse{\??ws\??ws\currentwhitespace}% no ifcsname due to nested \lineheight
- {\getvalue{\??ws\??ws\currentwhitespace}}%
- {\processcommacommand[\currentwhitespace]\dowhitespacemethod}%
- \ifgridsnapping
- \setfalse\flexiblewhitespace
- \ifdim\ctxparskip>\zeropoint
- \ctxparskip
- \ifcase\baselinegridmode
- \baselineskip % normal ! ! ! ! !!
- \or
- \ifdim\scratchdimen=\baselineskip % maybe range
- \baselineskip % normal ! ! ! ! !!
- \else
- \numexpr\ctxparskip/\dimexpr.5\lineheight\relax\relax\dimexpr.5\lineheight\relax
- \fi
- \else
- \baselineskip % normal ! ! ! ! !!
- \fi
- \fi
- \else
- \ifconditional\flexiblewhitespace \else \ctxparskip1\ctxparskip \fi
- \fi
- \parskip\ctxparskip}
-
-\chardef\baselinegridmode=0 % option in layout / 1=permit_half_lines
-
-\def\dodosetupwhitespace
- {\ifgridsnapping
- \setfalse\flexiblewhitespace
- \ctxparskip1\ctxparskip
- \ifdim\ctxparskip>\zeropoint
- \ifcase\baselinegridmode
- \ctxparskip\baselineskip % normal ! ! ! ! !!
- \or
- \ifdim\scratchdimen=\baselineskip % maybe range
- \ctxparskip\baselineskip % normal ! ! ! ! !!
- \else
- \ctxparskip\numexpr\ctxparskip/\dimexpr.5\lineheight\relax\relax\dimexpr.5\lineheight\relax
- \fi
- \else
- \ctxparskip\baselineskip % normal ! ! ! ! !!
- \fi
- \fi
- \else
- \ifconditional\flexiblewhitespace \else \ctxparskip1\ctxparskip \fi
- \fi
- \parskip\ctxparskip}
-
-\definesystemvariable {ws} % whitespace
-
-\def\definewhitespacemethod[#1]#2{\setvalue{\??ws\??ws#1}{#2}}
-
-\definewhitespacemethod [\v!fix] {}
-\definewhitespacemethod [\v!fixed] {\setfalse\flexiblewhitespace}
-\definewhitespacemethod [\v!flexible] {\settrue\flexiblewhitespace}
-\definewhitespacemethod [\v!line] {\ctxparskip \baselineskip}
-\definewhitespacemethod [\v!halfline] {\ctxparskip.5\baselineskip}
-\definewhitespacemethod [\v!none] {\ctxparskip \zeropoint}
-\definewhitespacemethod [\v!big] {\ctxparskip \bigskipamount}
-\definewhitespacemethod [\v!medium] {\ctxparskip \medskipamount}
-\definewhitespacemethod [\v!small] {\ctxparskip \smallskipamount}
-
-\definewhitespacemethod [\s!default] {\simplesetupwhitespace} % {\stelwitruimteopnieuwin}
-
-% \def\dowhitespacemethod#1%
-% {\executeifdefined{\??ws\??ws#1}{\ctxparskip#1}\relax}
-
-\def\dowhitespacemethod#1% \doifdefined because of \lineheight
- {\doifdefinedelse{\??ws\??ws#1}{\getvalue{\??ws\??ws#1}}{\ctxparskip#1}\relax}
-
-\def\nowhitespace
- {\ifdim\parskip>\zeropoint\relax
- \ifdim\lastskip=-\parskip
- \else
- \vskip-\parskip
- \fi
- \fi}
-
-\def\nowhitespaceunlessskip
- {\ifdim\lastskip>\zeropoint \else
- \nowhitespace
- \fi}
-
-\def\redowhitespace
- {\ifdim\lastskip>-\parskip \else
- \vskip\parskip
- \fi}
-
-\def\savecurrentwhitespace
- {\edef\restorecurrentwhitespace
- {\ctxparskip\the\ctxparskip
- \parskip\the\parskip
- \noexpand\def\noexpand\currentwhitespace{\currentwhitespace}%
- \ifconditional\flexiblewhitespace
- \noexpand\settrue\flexiblewhitespace
- \else
- \noexpand\setfalse\flexiblewhitespace
- \fi}}
-
-% deze variant is nodig binnen \startopelkaar
-% steeds testen:
-%
-% \hoofdstuk{..}
-% \plaatslijst[..]
-% \hoofdstuk{..}
-% \input tufte
-%
-% met/zonder witruimte
-
-\def\whitespace
- {\par
- \ifdim\parskip>\zeropoint\relax
- %\ifdim\lastskip>\parskip \else
- % \removelastskip interferes with blanko blokkeer en klein
- \vskip\parskip
- %\fi
- \fi}
-
-\def\nonoblanko[#1]%
- {\par}
-
-\def\noblanko
- {\dosingleempty\nonoblanko}
-
-% De onderstaande macro handelt ook de situatie dat er geen
-% tekst tussen \start ... \stop is geplaatst. Daartoe wordt de
-% laatste skip over de lege tekst heen gehaald. Dit komt goed
-% van pas bij het plaatsen van (mogelijk lege) lijsten.
-
-\newif\ifopelkaar
-
-\newsignal \noparskipsignal % \def\noparskipsignal {0.00001pt}
-\def\lastdoneparskip {0pt}
-
-\def\startpacked
- {\dosingleempty\dostartpacked}
-
-\def\dostartpacked[#1]% nesting afvangen
- {\par
- \ifvmode
- \edef\lastdoneparskip {\the\lastskip}%
- \edef\lastdoneprevdepth{\the\prevdepth}% zeer recent toegevoegd
- \ifdim\prevdepth=-\thousandpoint % toegevoegd omdat binnen
- \else % een vbox een extra skip
- \whitespace % ongewenst is; dit kan
- \baselinecorrection %% zie in \placeregister[n=1]
- \vskip\noparskipsignal % waarschijnlijk ook in
- \fi % blanko blokkeer
- \bgroup
- \doifelse{#1}\v!blank
- \opelkaarfalse
- \opelkaartrue
- \blank[\v!disable] % dit is nog niet ok, gaat fout
- \setupwhitespace[\v!none] % bovenin vtop (dwz, baseline)
- \fi}
-
-\def\stoppacked
- {\par
- \ifvmode
- \egroup
- \ifdim\lastskip=\noparskipsignal\relax
- \removelastskip
- \nowhitespace
- \vskip-\lastdoneparskip
- \vskip+\lastdoneparskip
- \prevdepth-\lastdoneprevdepth % zeer recent toegevoegd
- \fi
- \fi}
-
-\def\startunpacked
- {\blank
- \leavevmode
- \bgroup}
-
-\def\stopunpacked
- {\egroup
- \blank}
-
-% De onderstaande macro's moeten nog eens nader worden uitgewerkt.
-% Ze spelen een rol bij de spatiering rond omkaderde teksten
-% en/of boxen zonder diepte.
-
-\def\toonregelcorrectie{\showbaselinecorrection}
-\def\regelcorrectie {\baselinecorrection}
-
-% \prevdepth crosses pageboundaries!
-%
-% todo: a version that works ok inside a box
-
-\let\doaroundlinecorrection\relax
-
-\def\startlinecorrection
- {\dodoubleempty\dostartlinecorrection}
-
-\def\dostartlinecorrection[#1][#2]% #2 gobbles spaces
- {\bgroup
- \processaction
- [#1]
- [ \v!blank=>\let\doaroundlinecorrection\blank,
- \s!default=>\let\doaroundlinecorrection\relax,
- \s!unknown=>{\def\doaroundlinecorrection{\blank[#1]}}]%
- \doaroundlinecorrection
- \startbaselinecorrection
- \offbaselinecorrection
- \ignorespaces}
-
-\def\stoplinecorrection
- {\stopbaselinecorrection
- \doaroundlinecorrection
- \egroup}
-
-\def\correctwhitespace
- {\dowithnextbox
- {\startbaselinecorrection
- \flushnextbox
- \stopbaselinecorrection}%
- \vbox}
-
-\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
-% 0.28 zijn ooit eens ontleend aan INRS-TEX en moeten wellicht
-% nog eens instelbaar worden.
-%
-% \lineheight : de hoogte van een regel
-% \spacing{getal} : instellen interlinie
-% \normalbaselines : instellen regelafstend
-%
-% \setstrut : instellen \strut
-% \setnostrut : resetten \strut, \endstrut, \begstrut
-%
-% \setteststrut : instellen zichtbare struts
-% \resetteststrut : instellen onzichtbare struts
-%
-% \setfontparameters : instellen na fontset
-%
-% De hoogte van een regel (\lineheight) is gelijk aan de
-% som van de hoogte (\ht) en diepte (\dp) van \strutbox.
-%
-% \strut : denkbeeldig blokje met hoogte en diepte
-%
-% Een \hbox kan als deze aan het begin van een regel staat
-% een breedte \hsize krijgen. Dit is soms te voorkomen met het
-% commando \leavevmode. Binnen een \vbox geeft dit echter
-% niet altijd het gewenste resultaat, vandaar het commando
-%
-% \leaveoutervmode
-
-% Pas op: niet zomaar \topskip en \baselineskip aanpassen
-% en zeker niet \widowpenalty. Dit kan ernstige gevolgen
-% hebben voor kolommen.
-%
-% Enige glue kan op zich geen kwaad, echter als blanko=vast,
-% dan moet ook de rek 0 zijn. Binnen kolommen is rek ook
-% niet bepaald mooi. Een hele kleine waarde (0.025) voldoet,
-% omdat een positieve glue eindeloos rekbaar is.
-
-\newdimen\strutdimen
-\newdimen\lineheight
-\newdimen\openlineheight
-\newdimen\openstrutheight
-\newdimen\openstrutdepth
-\newdimen\topskipgap
-\newdimen\struttotal
-
-\def\strutheightfactor {.72}
-\def\strutdepthfactor {.28}
-
-\def\baselinefactor {2.8}
-\def\baselinegluefactor {0}
-
-\def\minimumstrutheight {0pt}
-\def\minimumstrutdepth {0pt}
-
-\def\normallineheight {\baselinefactor ex}
-\def\minimumlinedistance {\lineskip}
-
-\def\strutheight {0pt}
-\def\strutdepth {0pt}
-\def\strutwidth {0pt}
-
-\def\spacingfactor {1}
-
-\def\topskipfactor {1.0}
-\def\maxdepthfactor {0.5}
-
-\def\systemtopskipfactor {\topskipfactor}
-\def\systemmaxdepthfactor {\maxdepthfactor}
-
-% De onderstaande definitie wordt in de font-module overruled
-
-\ifdefined\globalbodyfontsize\else
- \newdimen\globalbodyfontsize
- \globalbodyfontsize=12pt
-\fi
-
-\ifx\normalizedbodyfontsize\undefined
- \def\normalizedbodyfontsize{12pt}
-\fi
-
-% door een \dimen. Dit is geen probleem omdat (1) de default
-% korpsgrootte 12pt is en (2) de fonts nog niet geladen zijn
-% en de instellingen bij het laden nogmaals plaatsvinden.
-
-% \def\topskipcorrection
-% {\ifdim\topskip>\openstrutheight
-% % == \vskip\topskipgap
-% \vskip\topskip
-% \vskip-\openstrutheight
-% \fi
-% \verticalstrut
-% \vskip-\struttotal}
-
-\def\topskipcorrection
- {\simpletopskipcorrection
- \vskip-\struttotal
- \verticalstrut}
-
-\def\simpletopskipcorrection
- {\ifdim\topskip>\openstrutheight
- % == \vskip\topskipgap
- \vskip\topskip
- \vskip-\openstrutheight
- \fi}
-
-% \def\settopskip % the extra test is needed for the lbr family
-% {\topskip\systemtopskipfactor\globalbodyfontsize
-% \ifgridsnapping \else
-% \ifr@ggedbottom\!!plus5\globalbodyfontsize\fi
-% \fi
-% \relax % the skip
-% \topskipgap\topskip
-% \advance\topskipgap -\openstrutheight\relax
-% \ifdim\topskip<\strutheightfactor\openlineheight
-% \topskip\strutheightfactor\openlineheight\relax
-% \fi}
-
-\def\settopskip % the extra test is needed for the lbr family
- {\topskip\systemtopskipfactor\globalbodyfontsize
- \ifgridsnapping \else
- \ifr@ggedbottom\!!plus5\globalbodyfontsize\fi
- \fi
- \relax % the skip
- \topskipgap\topskip
- \advance\topskipgap -\openstrutheight\relax
-\ifdim\minimumstrutheight>\zeropoint
- \ifdim\topskip<\minimumstrutheight
- \topskip\minimumstrutheight\relax
- \fi
-\else
- \ifdim\topskip<\strutheightfactor\openlineheight
- \topskip\strutheightfactor\openlineheight\relax
- \fi
-\fi}
-
-\def\setmaxdepth
- {\maxdepth\systemmaxdepthfactor\globalbodyfontsize}
-
-\def\normalbaselines
- {\baselineskip \normalbaselineskip
- \lineskip \normallineskip
- \lineskiplimit\normallineskiplimit}
-
-% \def\setnormalbaselines
-% {\ifdim\normallineheight>\zeropoint
-% \lineheight\normallineheight
-% \fi
-% \openlineheight\spacingfactor\lineheight
-% \openstrutheight\strutheightfactor\openlineheight
-% \openstrutdepth \strutdepthfactor \openlineheight
-% \normalbaselineskip\openlineheight
-% \!!plus\baselinegluefactor\openlineheight
-% \!!minus\baselinegluefactor\openlineheight
-% \normallineskip\minimumlinedistance\relax % \onepoint\relax
-% \normallineskiplimit\zeropoint\relax
-% \normalbaselines}
-
-\def\setnormalbaselines
- {\ifdim\normallineheight>\zeropoint
- \lineheight\normallineheight
- \fi
- \openlineheight\spacingfactor\lineheight
- \openstrutheight \ifdim\minimumstrutheight>\zeropoint
- \minimumstrutheight % new
- \else
- \strutheightfactor\openlineheight
- \fi
- \openstrutdepth \ifdim\minimumstrutdepth>\zeropoint
- \minimumstrutdepth % new
- \else
- \strutdepthfactor \openlineheight
- \fi
- \ifdim\dimexpr\minimumstrutdepth+\minimumstrutheight\relax>\zeropoint
- \openlineheight\dimexpr\openstrutheight+\openstrutdepth\relax % new
- \fi
- \normalbaselineskip\openlineheight
- \ifgridsnapping\else
- \!!plus \baselinegluefactor\openlineheight
- \!!minus\baselinegluefactor\openlineheight
- \fi
- \normallineskip\minimumlinedistance\relax % \onepoint\relax
- \normallineskiplimit\zeropoint\relax
- \normalbaselines}
-
-% \def\setspacingfactor#1\to#2\by#3\\%
-% {\strutdimen#2\points
-% \strutdimen#3\strutdimen
-% \edef#1{\withoutpt\the\strutdimen}}
-%
-% \def\spacing#1%
-% {\ifgridsnapping
-% %\doifnot{#1}{1}{\showmessage\m!layouts{11}{#1}}%
-% \ifdim#1\points=\onepoint\else\showmessage\m!layouts{11}{#1}\fi
-% \edef\spacingfactor{1}%
-% \else
-% \edef\spacingfactor{#1}%
-% \fi
-% \setspacingfactor\systemtopskipfactor \to\topskipfactor \by#1\\% why no \spacingfactor ?
-% \setspacingfactor\systemmaxdepthfactor\to\maxdepthfactor\by#1\\% why no \spacingfactor ?
-% \setnormalbaselines
-% \setstrut}
-%
-% \def\setspacingfactor#1#2#3%
-% {\edef#1{\withoutpt\the\dimexpr#2\points*#3\relax}}
-
-\def\spacing#1%
- {\ifgridsnapping
- \ifdim#1\points=\onepoint\else\showmessage\m!layouts{11}{#1}\fi
- \edef\spacingfactor{1}%
- \else
- \edef\spacingfactor{#1}%
- \fi
- %\setspacingfactor\systemtopskipfactor \topskipfactor {#1}% why no \spacingfactor ?
- %\setspacingfactor\systemmaxdepthfactor\maxdepthfactor{#1}% why no \spacingfactor ?
- \edef\systemtopskipfactor {\withoutpt\the\dimexpr#1\dimexpr\topskipfactor \points}%
- \edef\systemmaxdepthfactor{\withoutpt\the\dimexpr#1\dimexpr\maxdepthfactor\points}%
- \setnormalbaselines
- \setstrut}
-
-%D Sometimes one needs to freeze the interlinespacing
-%D
-%D \starttyping
-%D \rm \saveinterlinespace .... {\ss \restoreinterlinespace .... \endgraf}
-%D \stoptyping
-
-\let\restoreinterlinespace\relax
-
-\def\saveinterlinespace
- {\edef\restoreinterlinespace
- {\lineheight \the\lineheight
- \openstrutheight \the\openstrutheight
- \openstrutdepth \the\openstrutdepth
- \openlineheight \the\openlineheight
- \normalbaselineskip \the\normalbaselineskip
- \normallineskip \the\normallineskip
- \normallineskiplimit\the\normallineskiplimit
- \noexpand\def\noexpand\normallineheight{\the\dimexpr\normallineheight}%
- \noexpand\normalbaselines}}
-
-% plain definition:
-%
-% \def\strut{\relax\ifmmode\copy\strutbox\else\unhcopy\strutbox\fi}
-%
-% could be:
-%
-% \def\strut{\relax\ifmmode\copy\else\unhcopy\fi\strutbox}
-
-\ifx\strutbox\undefined
-
- \newbox\strutbox
-
- \setbox\strutbox=\normalhbox{\vrule height8.5pt depth3.5pt width\zeropoint}
-
- %\def\strut{\relax\ifmmode\copy\strutbox\else\unhcopy\strutbox\fi}
- \def\strut{\relax\ifmmode\copy\else\unhcopy\fi\strutbox}
-
-\fi
-
-\let\normalstrut\strut
-
-% The double \hbox construction enables us to \backtrack
-% boxes.
-
-% \def\setstrutdimen#1#2#3% % een strut is n.m maal ex
-% {\strutdimen\normallineheight % wat niet per se \lineheight
-% \strutdimen#2\strutdimen % is omdat een strut lokaal
-% \strutdimen#3\strutdimen % kan afwijken van de globale
-% \edef#1{\the\strutdimen}} % macro % strut
-
-% \def\setstrutdimen#1#2#3% % een strut is n.m maal ex
-% {\strutdimen\normallineheight % wat niet per se \lineheight
-% \strutdimen#2\strutdimen % is omdat een strut lokaal
-% \strutdimen#3\strutdimen % kan afwijken van de globale
-% \edef#1{\the\strutdimen}} % macro % strut
-
-% \def\setstrut
-% {\setstrutdimen\strutheight\strutheightfactor\spacingfactor
-% \setstrutdimen\strutdepth \strutdepthfactor \spacingfactor
-% \let\strut=\normalstrut
-% \setbox\strutbox=\normalhbox
-% {\normalhbox
-% {\vrule
-% \!!width \strutwidth
-% \!!height \strutheight
-% \!!depth \strutdepth
-% \normalkern-\strutwidth}}}
-
-% \def\setstrut
-% {\setstrutdimen\strutheight\strutheightfactor\spacingfactor
-% \setstrutdimen\strutdepth \strutdepthfactor \spacingfactor
-% \dosetstrut}
-
-% \def\setstrut
-% {\strutdimen\normallineheight
-% \strutdimen\strutheightfactor\strutdimen
-% \strutdimen\spacingfactor\strutdimen
-% \edef\strutheight{\the\strutdimen}%
-% \strutdimen\normallineheight
-% \ifgridsnapping
-% \advance\strutdimen-\strutheight
-% \else
-% \strutdimen\strutdepthfactor\strutdimen
-% \strutdimen\spacingfactor\strutdimen
-% \fi
-% \edef\strutdepth{\the\strutdimen}%
-% \dosetstrut}
-
-% interesting, strutdepth 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
-% \strutdimen\spacingfactor\strutdimen
-% \edef\strutheight{\the\strutdimen}%
-% % depth
-% \strutdimen\normallineheight
-% \ifgridsnapping
-% \ifdim\minimumstrutdepth>\zeropoint
-% \strutdimen\minimumstrutdepth
-% \else
-% \advance\strutdimen-\strutheight
-% \fi
-% \else
-% \ifdim\minimumstrutdepth>\zeropoint
-% \strutdimen\minimumstrutdepth
-% \else
-% \strutdimen\strutdepthfactor\strutdimen
-% \fi
-% \strutdimen\spacingfactor\strutdimen
-% \fi
-% \edef\strutdepth{\the\strutdimen}%
-% % finish
-% \dosetstrut}
-
-% \def\setstrut
-% {% height
-% \ifdim\minimumstrutheight>\zeropoint
-% \edef\strutheight{\the\dimexpr\spacingfactor\dimexpr\minimumstrutheight}%
-% \else
-% \edef\strutheight{\the\dimexpr\spacingfactor\dimexpr\strutheightfactor\dimexpr\normallineheight}%
-% \fi
-% % depth
-% \ifgridsnapping
-% \ifdim\minimumstrutdepth>\zeropoint
-% \edef\strutdepth{\the\dimexpr\minimumstrutdepth}%
-% \else
-% \edef\strutdepth{\the\dimexpr\normallineheight-\strutheight}%
-% \fi
-% \else
-% \ifdim\minimumstrutdepth>\zeropoint
-% \edef\strutdepth{\the\dimexpr\spacingfactor\dimexpr\minimumstrutdepth}%
-% \else
-% \edef\strutdepth{\the\dimexpr\spacingfactor\dimexpr\strutdepthfactor\dimexpr\normallineheight}%
-% \fi
-% \fi
-% % finish
-% \dosetstrut}
-
-\unexpanded\def\setstrut
- {% height
- \edef\strutheight
- {\the\dimexpr\spacingfactor\dimexpr
- \ifdim\minimumstrutheight>\zeropoint
- \minimumstrutheight
- \else
- \strutheightfactor\dimexpr\normallineheight
- \fi}%
- % depth
- \edef\strutdepth
- {\the\dimexpr
- \ifgridsnapping
- \ifdim\minimumstrutdepth>\zeropoint
- \minimumstrutdepth
- \else
- \normallineheight-\strutheight
- \fi
- \else
- \spacingfactor\dimexpr
- \ifdim\minimumstrutdepth>\zeropoint
- \minimumstrutdepth
- \else
- \strutdepthfactor\dimexpr\normallineheight
- \fi
- \fi}%
- % finish
- \dosetstrut}
-
-\unexpanded\def\setcharstrut#1%
- {\setbox\strutbox\normalhbox{#1}%
- \edef\strutheight{\the\strutht}%
- \edef\strutdepth {\the\strutdp}%
- \dosetstrut}
-
-% \def\setfontstrut
-% {\setcharstrut{(}}
-%
-% better, since some fonts have small (but descending Q etc)
-
-\unexpanded\def\setfontstrut
- {\setcharstrut{(gplQT}}
-
-\unexpanded\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
-% {\let\strut\normalstrut
-% \setbox\strutbox\normalhbox
-% {\normalhbox to \zeropoint
-% {% \hss % new, will be option
-% \vrule
-% \!!width \strutwidth
-% \!!height\strutheight
-% \!!depth \strutdepth
-% \hss}}%
-% \struttotal\dimexpr\strutht+\strutdp\relax}
-%
-% because of all the callbacks in mkiv, we avoid unnecessary boxes ...
-% maybe use an attribute so that we can tag boxes that don't need a
-% treatment; tests with using an attribute so far have shown that
-% it's slower because testing the attribute takes time too
-
-\def\dosetstrut
- {\let\strut\normalstrut
- \ifdim\strutwidth=\zeropoint
- \setbox\strutbox\normalhbox
- {\vrule
- \!!width \zeropoint
- \!!height\strutheight
- \!!depth \strutdepth}%
- \else
- \setbox\strutbox\normalhbox
- {\normalhbox to \zeropoint
- {% \hss % new, will be option
- \vrule
- \!!width \strutwidth
- \!!height\strutheight
- \!!depth \strutdepth
- \hss}}%
- \fi
- \struttotal\dimexpr\strutht+\strutdp\relax}
-
-%D The dimen \type {\struttotal} holds the exact size of the
-%D strut; occasionally a one scaled point difference can show
-%D up with the lineheight.
-
-%D Sometimes a capstrut comes in handy
-%D
-%D \starttabulate[|Tl|l|l|]
-%D \NC yes \NC normal strut \NC {\showstruts\setupstrut[yes]\strut} \NC \NR
-%D \NC no \NC no strut \NC {\showstruts\setupstrut[no]\strut} \NC \NR
-%D \NC kap \NC a capital strut (i.e. Q) \NC {\showstruts\setupstrut[cap]\strut} \NC \NR
-%D \NC A B \unknown \NC a character strut (e.g. A) \NC {\showstruts\setupstrut[A]\strut} \NC \NR
-%D \NC \NC a normal strut \NC {\showstruts\setupstrut\strut} \NC \NR
-%D \stoptabulate
-
-\def\setupstrut
- {\dosingleempty\dosetupstrut}
-
-\def\dosetupstrut[#1]% yet undocumented, todo: fontstrut
- {\processaction
- [#1]
- [ \v!yes=>\setstrut,
- \v!auto=>\setautostrut,
- \v!no=>\setnostrut,
- \v!cap=>\setcapstrut,
- \v!fit=>\setfontstrut,
- \v!line=>\setstrut,
- \s!default=>\setstrut,
- \s!unknown=>\setcharstrut\commalistelement]}
-
-\def\setteststrut
- {\def\strutwidth{.8pt}%
- \setstrut}
-
-\def\autostrutfactor{1.1}
-
-\def\setautostrut
- {\begingroup
- \setbox\scratchbox\copy\strutbox
- \setstrut
- \ifdim\ht\strutbox>\autostrutfactor\ht\scratchbox
- \endgroup \setstrut
- \else\ifdim\dp\strutbox>\autostrutfactor\dp\scratchbox
- \endgroup \setstrut
- \else
- \endgroup
- \fi\fi}
-
-% simple version
-%
-% \def\begstrut
-% {\relax\ifcase\strutht\else
-% \strut
-% \normalpenalty\plustenthousand
-% \normalhskip\zeropoint
-% \ignorespaces
-% \fi}
-%
-% \def\endstrut
-% {\relax\ifhmode\ifcase\strutht\else
-% \removeunwantedspaces
-% \normalpenalty\plustenthousand
-% \normalhskip\zeropoint
-% \strut
-% \fi\fi}
-
-% when enabled, sigstruts will remove themselves if nothing
-% goes inbetween
-
-\newsignal\strutsignal \setfalse\sigstruts
-
-\def\begstrut
- {\relax\ifcase\strutht\else
- \ifconditional\sigstruts
- \noindent\horizontalstrut
- \normalpenalty\plustenthousand
- \normalhskip-\strutsignal
- \normalhskip\strutsignal
- \else
- \strut
- \normalpenalty\plustenthousand
- \normalhskip\zeropoint
- \fi
- \expandafter \ignorespaces
- \fi}
-
-\def\endstrut
- {\relax\ifhmode\ifcase\strutht\else
- \ifconditional\sigstruts
- \ifdim\lastskip=\strutsignal
- \unskip\unskip\unpenalty\setbox\scratchbox\lastbox
- \else
- \normalpenalty\plustenthousand
- \normalhskip\zeropoint
- \strut
- \fi
- \else
- \removeunwantedspaces
- \normalpenalty\plustenthousand
- \normalhskip\zeropoint
- \strut
- \fi
- \fi\fi}
-
-\newbox\nostrutbox \setbox\nostrutbox\normalhbox{} % {\normalhbox{}}
-
-\def\setnostrut
- {\setbox\strutbox\copy\nostrutbox
- \let\strut\empty
- \let\endstrut\empty
- \let\begstrut\empty
- \let\crlfplaceholder\empty}
-
-% unsave:
-%
-% \def\pseudostrut
-% {\bgroup
-% \setnostrut
-% \normalstrut
-% \egroup}
-%
-% try:
-%
-% \startchemie
-% \chemie[ONE,Z0,SB15,MOV1,SB15,Z0][C,C]
-% \stopchemie
-%
-% so:
-
-\def\pseudostrut
- {\noindent} % better: \dontleavehmode
-
-\let\pseudobegstrut\pseudostrut
-
-\let\pseudoendstrut\removeunwantedspaces
-
-\def\resetteststrut
- {\let\strutwidth\zeropoint
- \setstrut}
-
-\ifx\setfontparameters\undefined
- % problems ! ! ! !
- \def\setfontparameters{\the\everybodyfont}
-\fi
-
-%D Handy:
-
-\def\baselinedistance{\the\lineheight}
-
-%D We need \type{\normaloffinterlineskip} because the new
-%D definition contains an assignment, and |<|don't ask me
-%D why|>| this assignment gives troubles in for instance the
-%D visual debugger.
-
-%D The plain ones:
-
-\def\offinterlineskip
- {\baselineskip-\thousandpoint
- \lineskip\zeropoint
- \lineskiplimit\maxdimen}
-
-\def\nointerlineskip
- {\prevdepth-\thousandpoint}
-
-\let\normaloffinterlineskip=\offinterlineskip % knuth's original
-
-%D My own one:
-
-\def\offinterlineskip
- {\ifdim\baselineskip>\zeropoint
- \edef\oninterlineskip
- {\baselineskip\the\baselineskip
- \lineskip\the\lineskip
- \lineskiplimit\the\lineskiplimit
- \let\noexpand\offinterlineskip\noexpand\normaloffinterlineskip}%
- \else
- \let\oninterlineskip\setnormalbaselines
- \fi
- \normaloffinterlineskip}
-
-\let\oninterlineskip=\relax
-
-\def\leaveoutervmode
- {\ifvmode\ifinner\else
- \leavevmode
- \fi\fi}
-
-% We stellen enkele penalties anders in dan Plain TEX:
-
-% oud
-%
-% \widowpenalty=\defaultwidowpenalty\relax
-% \clubpenalty =\defaultclubpenalty \relax
-
-\def\resetpenalties#1%
- {\ifx#1\undefined\else
- #1\minusone
- \fi}
-
-\def\setpenalties#1#2#3%
- {\ifx#1\undefined\else % space before #3 prevents lookahead problems, needed when #3=text
- #1\numexpr#2+\plusone\relax\space\doexpandedrecurse{\the\numexpr#2\relax}{ #3}\zerocount\relax
- \fi}
-
-\def\doexpandedrecurse#1#2%
- {\ifnum#1>\zerocount#2\@EA\doexpandedrecurse\@EA{\the\numexpr#1-1\relax}{#2}\fi}
-
-%D \macros
-%D {keeplinestogether}
-%D
-%D Dirty hack, needed in margin content that can run of a page.
-
-\def\keeplinestogether#1%
- {\xdef\restoreinterlinepenalty{\global\resetpenalties\interlinepenalties}%
- \global\setpenalties\interlinepenalties{#1}\plustenthousand}
-
-\newif\ifgridsnapping % to be sure
-
-\def\defaultwidowpenalty {2000} % was: 1000
-\def\defaultclubpenalty {2000} % was: 800
-\def\defaultdisplaywidowpenalty {50}
-\def\defaultbrokenpenalty {100}
-
-\def\defaultgridwidowpenalty {0}
-\def\defaultgridclubpenalty {0}
-\def\defaultgriddisplaywidowpenalty {0}
-\def\defaultgridbrokenpenalty {0}
-
-% The original approach:
-%
-% \def\setdefaultpenalties
-% {\ifgridsnapping
-% \widowpenalty\defaultgridwidowpenalty
-% \clubpenalty \defaultgridclubpenalty
-% \else
-% \widowpenalty\defaultwidowpenalty
-% \clubpenalty \defaultclubpenalty
-% \fi}
-%
-% However, we will use setups:
-
-% to be documented
-
-\def\nopenalties
- {\widowpenalty \zerocount
- \clubpenalty \zerocount
- \brokenpenalty \zerocount
- \doublehyphendemerits\zerocount
- \finalhyphendemerits \zerocount
- \adjdemerits \zerocount}
-
-\def\setdefaultpenalties
- {\directsetup{\systemsetupsprefix\s!default}}
-
-\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]
-
- \directsetup{\systemsetupsprefix\s!reset}
-
- \widowpenalty \defaultwidowpenalty
- \clubpenalty \defaultclubpenalty
- \displaywidowpenalty\defaultdisplaywidowpenalty
- \brokenpenalty \defaultbrokenpenalty
-
-\stopsetups
-
-\startsetups [\v!grid] [\systemsetupsprefix\s!default]
-
- \directsetup{\systemsetupsprefix\s!reset}
-
- \widowpenalty \defaultgridwidowpenalty
- \clubpenalty \defaultgridclubpenalty
- \displaywidowpenalty\defaultgriddisplaywidowpenalty
- \brokenpenalty \defaultgridbrokenpenalty
-
-\stopsetups
-
-% as an illustration:
-
-\startsetups [\systemsetupsprefix\v!strict]
-
- \directsetup{\systemsetupsprefix\s!reset}
-
- \setpenalties\widowpenalties2\maxdimen
- \setpenalties\clubpenalties 2\maxdimen
- \brokenpenalty \maxdimen
-
-\stopsetups
-
-\setdefaultpenalties % will happen later in \setuplayout
-
-% Suggested by GB (not the name -):
-
-\def\rapfillskip{.5\hsize plus .092\hsize minus .5\hsize} % D.A.'s value
-
-% Bovendien definieren we enkele extra \fill's:
-
-\def\hfilll{\hskip\zeropoint\!!plus1filll\relax}
-\def\vfilll{\vskip\zeropoint\!!plus1filll\relax}
-
-% De onderstaande hulpmacro's moeten nog eens instelbaar worden
-% gemaakt.
-
-\def\tfskipsize{1em\relax}
-\def\tfkernsize{1ex\relax}
-
-\def\tfskip{\dotfskip\tfskipsize}
-\def\tfkern{\dotfkern\tfkernsize}
-
-\def\dotfskip#1{{\tf\hskip#1}}
-\def\dotfkern#1{{\tf\kern #1}}
-
-% needs a proper \definenarrower or installnarrower
-
-\newskip\ctxleftskip
-\newskip\ctxrightskip
-\newskip\ctxmidskip
-
-\def\dosinglenarrower#1%
- {\processaction
- [#1]
- [ \v!left=>\global\advance\ctxleftskip \@@slleft,
- \v!middle=>\global\advance\ctxmidskip \@@slmiddle,
- \v!right=>\global\advance\ctxrightskip \@@slright,
- -\v!left=>\global\advance\ctxleftskip -\@@slleft,
- -\v!middle=>\global\advance\ctxmidskip -\@@slmiddle,
- -\v!right=>\global\advance\ctxrightskip-\@@slright,
- \v!reset=>\global\ctxleftskip \zeropoint
- \global\ctxmidskip \zeropoint
- \global\ctxrightskip\zeropoint,
- \v!none=>,
- \s!unknown=>\global\advance\ctxmidskip \commalistelement]}
-
-% \def\donarrower[#1]% hm, can be dorepeat directly
-% {\processaction
-% [#1]
-% [ \v!left=>\global\advance\ctxleftskip \@@slleft,
-% \v!middle=>\global\advance\ctxmidskip \@@slmiddle,
-% \v!right=>\global\advance\ctxrightskip \@@slright,
-% \v!none=>,% handy for delimitedtexts
-% \s!unknown=>{\dorepeatwithcommand[#1]\dosinglenarrower}]}
-
-\def\donarrower[#1]% hm, can be dorepeat directly
- {\dorepeatwithcommand[#1]\dosinglenarrower}
-
-\def\complexstartnarrower[#1]%
- {\@@slbefore % was hard coded \par
- \bgroup
- \global\ctxleftskip \zeropoint
- \global\ctxrightskip\zeropoint
- \global\ctxmidskip \zeropoint
- \processcommalistwithparameters[#1]\donarrower
- \advance\leftskip \ctxleftskip
- \advance\rightskip \ctxrightskip
- \advance\leftskip \ctxmidskip
- \advance\rightskip \ctxmidskip
- \seteffectivehsize}
-
-% todo: definenarrower
-
-\def\simplestartnarrower
- {\startnarrower[\v!middle]}
-
-\definecomplexorsimple\startnarrower
-
-\def\stopnarrower
- {\@@slafter % was hard coded \par / needed, else skips forgotten
- \egroup}
-
-\def\setupnarrower
- {\dodoubleargument\getparameters[\??sl]}
-
-\newdimen\@@effectivehsize \def\effectivehsize {\hsize}
-\newdimen\@@effectiveleftskip \def\effectiveleftskip {\leftskip}
-\newdimen\@@effectiverightskip \def\effectiverightskip{\rightskip}
-
-\def\seteffectivehsize
- {\setlocalhsize
- \@@effectivehsize \localhsize
- \@@effectiveleftskip \leftskip
- \@@effectiverightskip \rightskip
- \let\effectivehsize \@@effectivehsize
- \let\effectiveleftskip \@@effectiveleftskip
- \let\effectiverightskip\@@effectiverightskip}
-
-\def\dodefinehbox[#1][#2]%
- {\setvalue{hbox#1}##1%
- {\hbox to #2{\begstrut##1\endstrut\hss}}}
-
-\def\definehbox
- {\dodoubleargument\dodefinehbox}
-
-\def\iobox#1#2#3#% here #3# is not really needed
- {\vbox\bgroup % we want to return a vbox like the others
- \hbox\bgroup% we need to pack the signal with the box
- \signalrightpage
- \dowithnextboxcontent
- {\let\\=\endgraf\forgetall\doifrightpageelse#1#2}
- {\box\nextbox\egroup\egroup}
- \vbox#3}
-
-\def\obox{\iobox\raggedleft \raggedright} % outerbox
-\def\ibox{\iobox\raggedright\raggedleft} % innerbox
-
-\def\dosetraggedvbox#1%
- {\let\raggedbox\vbox
- \processfirstactioninset
- [#1]
- [ \v!left=>\let\raggedbox\lbox,
- \v!right=>\let\raggedbox\rbox,
- \v!middle=>\let\raggedbox\cbox,
- \v!inner=>\let\raggedbox\ibox,
- \v!outer=>\let\raggedbox\obox,
- \v!flushleft=>\let\raggedbox\rbox,
- \v!flushright=>\let\raggedbox\lbox,
- \v!center=>\let\raggedbox\cbox,
- \v!no=>\def\raggedbox{\vbox\bgroup\raggedright\let\next=}]}
-
-\def\dosetraggedhbox#1%
- {\let\raggedbox\hbox
- \processaction % slow
- [#1]
- [ \v!left=>\def\raggedbox{\doalignedline\v!left },
- \v!right=>\def\raggedbox{\doalignedline\v!right },
- \v!middle=>\def\raggedbox{\doalignedline\v!middle},
- \v!inner=>\def\raggedbox{\doalignedline\v!inner },
- \v!outer=>\def\raggedbox{\doalignedline\v!outer },
- \v!flushleft=>\def\raggedbox{\doalignedline\v!right },
- \v!flushright=>\def\raggedbox{\doalignedline\v!left },
- \v!center=>\def\raggedbox{\doalignedline\v!middle}]}
-
-\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!
- {\everyraggedcommand \emptytoks
- \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}}
-
-\def\dododosetraggedcommand#1%
- {\executeifdefined{\@@ragged@@command\string#1}\relax}
-
-\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 \appendtoks\veryraggedleft\to\everyraggedcommand
- \else \appendtoks\raggedleft \to\everyraggedcommand
- \fi
- \!!donecfalse}
-
-\setvalue{\@@ragged@@command\v!right}%
- {\if!!donea \appendtoks\veryraggedright\to\everyraggedcommand
- \else \appendtoks\raggedright \to\everyraggedcommand
- \fi
- \!!donecfalse}
-
-\setvalue{\@@ragged@@command\v!middle}%
- {\if!!donec
- \if!!doneb \appendtoks\raggedwidecenter\to\everyraggedcommand
- \else\if!!donea \appendtoks\veryraggedcenter\to\everyraggedcommand
- \else \appendtoks\raggedcenter \to\everyraggedcommand
- \fi\fi
- \!!donecfalse
- \else
- \let\raggedbottomcommand\vfilll % bonus, pretty strong
- \let\raggedtopcommand \vfilll % used with \framed for
- \fi} % instance in tables
-
-\setvalue{\@@ragged@@command\v!flushleft }{\getvalue{\@@ragged@@command\v!right }}
-\setvalue{\@@ragged@@command\v!flushright}{\getvalue{\@@ragged@@command\v!left }}
-\setvalue{\@@ragged@@command\v!center }{\getvalue{\@@ragged@@command\v!middle}}
-
-\setvalue{\@@ragged@@command\v!high}%
- {\let\raggedbottomcommand\vfilll} % and since we lack a
-
-\setvalue{\@@ragged@@command\v!low}%
- {\let\raggedtopcommand\vfilll} % proper keyword, but
-
-\setvalue{\@@ragged@@command\v!lohi}%
- {\let\raggedbottomcommand\vfilll % we do support the
- \let\raggedtopcommand\vfilll} % ugly laho (lohi)
-
-\setvalue{\@@ragged@@command\v!no}%
- {\appendtoks\raggedright\to\everyraggedcommand}
-
-\setvalue{\@@ragged@@command\v!yes}%
- {\appendtoks\notragged\to\everyraggedcommand}
-
-\setvalue{\@@ragged@@command\v!normal}%
- {\appendtoks\notragged\to\everyraggedcommand}
-
-\setvalue{\@@ragged@@command\v!inner}% not yet perfect
- {\signalrightpage % may interfere
- \doifrightpageelse
- {\getvalue{\@@ragged@@command\v!right}}
- {\getvalue{\@@ragged@@command\v!left}}}
-
-\setvalue{\@@ragged@@command\v!outer}% not yet perfect
- {\signalrightpage % may interfere
- \doifrightpageelse
- {\getvalue{\@@ragged@@command\v!left}}
- {\getvalue{\@@ragged@@command\v!right}}}
-
-\setvalue{\@@ragged@@command\v!lesshyphenation}%
- {\appendtoks\lesshyphens\to\everyraggedcommand}
-\setvalue{\@@ragged@@command\v!morehyphenation}%
- {\appendtoks\morehyphens\to\everyraggedcommand}
-
-% 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}
-
-%D Unofficial, may disappear. Now handled directly in the
-%D core-rul module.
-
-% \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\@@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}
-
-% Nog doen:
-%
-% \goodbreak -> \allowbreak en \dosomebreak{..} in koppen
-%
-% bij koppen zowieso: \blanko[reset]
-
-% Nog in commando verwerken:
-%
-% \voorkeur … la \blanko
-%
-% Om ongewenste witruimte te voorkomen kan met \dosomebreak{\break}
-% een \penalty voor witruimte worden geplaatst.
-
-\def\removelastskip % a redefinition of plain
- {\ifvmode\ifdim\lastskip=\zeropoint\else\vskip-\lastskip\fi\fi}
-
-% first version:
-%
-% \def\dosomebreak#1%
-% {\scratchskip\lastskip
-% \removelastskip
-% %\type{#1}%
-% #1\relax
-% \ifdim\scratchskip=\zeropoint \else
-% \vskip\scratchskip
-% \fi}
-%
-% don't change the next improvement:
-
-% \def\dosomebreak#1%
-% {\endgraf % beware, this forces a newline
-% \ifvmode
-% \ifdim\lastskip=\zeropoint
-% #1\relax
-% \else
-% \scratchskip\lastskip
-% \removelastskip
-% #1\relax
-% \vskip\scratchskip
-% \fi
-% \fi}
-
-% beter, vooral in \vbox; nog in \pagina toepassen s!
-
-\def\doifoutervmode#1%
- {\ifvmode\ifinner\else#1\fi\fi}
-
-\ifx\dosomebreak\undefined % defined in mkiv
-
- \def\dosomebreak#1%
- {\doifoutervmode
- {\scratchskip\lastskip
- \removelastskip
- %\leavevmode\type{#1}%
- #1\relax
- \ifdim\scratchskip=\zeropoint % else interference with footnotes
- \else
- \vskip\scratchskip
- \fi}}
-
-\fi
-
-\def\forgeteverypar
- {\everypar{\the\neverypar}}
-
-%\def\forgetparindent
-% {\forgeteverypar
-% \indentfirstparagraphtrue % recently added
-% \setupindenting[\v!geen]}
-
-%\def\forgetparskip
-% {\setupwhitespace[\v!geen]}
-
-\def\forgetparindent
- {\forgeteverypar
- \indentfirstparagraphtrue % recently added
- \let\currentindentation\v!none
- \ctxparindent\zeropoint
- \parindent\zeropoint\relax}
-
-\def\forgetparskip
- {\let\currentwhitespace\v!none
- \ctxparskip\zeropoint
- \parskip\zeropoint\relax}
-
-\def\forgetbothskips
- {\tolerance1500
- \leftskip\zeropoint
- \rightskip\zeropoint\relax}
-
-\def\forgetspacing
- {\emergencystretch\zeropoint}
-
-\newif\ifforgotten % rather good signal for inner
-
-\appendtoks \forgottentrue \to \everyforgetall
-\appendtoks \forgetragged \to \everyforgetall
-\appendtoks \forgetparskip \to \everyforgetall
-\appendtoks \forgetparindent \to \everyforgetall
-\appendtoks \forgetbothskips \to \everyforgetall
-\appendtoks \forgetspacing \to \everyforgetall % i.v.m. funny spacing in pagebody
-\appendtoks \spacing\!!plusone \to \everyforgetall % new per 10/08/2004, else problems in otr / !! needed
-\appendtoks \everypar\emptytoks \to \everyforgetall % indeed!
-
-\def\localvbox#1#%
- {\vbox#1\bgroup
- \forgetparskip
- \setlocalhsize
- \hsize\localhsize
- \forgetparindent
- \forgetbothskips
- \forgeteverypar
- \let\next=}
-
-% ach ja, hoort niet hier
-
-% \unexpanded\def\dostartattributes#1#2#3%
-% {\begingroup % geen \bgroup, anders in mathmode lege \hbox
-% \doifdefinedelse{#1#2}
-% {\def\fontattribute{\getvalue{#1#2}}}
-% {\let\fontattribute=\empty}%
-% \doifdefinedelse{#1#3}
-% {\def\colorattribute{\getvalue{#1#3}}}
-% {\let\colorattribute=\empty}%
-% \startcolor[\colorattribute]%
-% \@EA\doconvertfont\@EA{\fontattribute}}
-%
-% \unexpanded\def\dostopattributes%
-% {\stopcolor
-% \endgroup}
-%
-% \unexpanded\def\doattributes#1#2#3#4%
-% {\dostartattributes{#1}{#2}{#3}{#4}\dostopattributes}
-
-%D A hardly faster implementation follows. We cannot use
-%D \type {csname} testing since the first argument can be
-%D anything, even a raw fontswitch. No a real improvement
-%D (some 5 seconds on 260 seconds for the maps bibliography).
-
-\let\dostopattributes\relax % in case these commands end up in an edef
-
-\unexpanded\def\dostartattributes#1#2#3%
- {\begingroup % geen \bgroup, anders in mathmode lege \hbox
- \ifcsname#1#3\endcsname
- \let\dostopattributes\@@dostopattributes
- \startcolor[\csname#1#3\endcsname]%
- \else
- \let\dostopattributes\@@nostopattributes
- \fi
- \ifcsname#1#2\endcsname
- \expandafter\doconvertfont
- \else
- \expandafter\gobbleoneargument
- \fi{\csname#1#2\endcsname}}
-
-\newconditional \parbasedattributes
-
-\def\finishparbasedattributes
- {\ifconditional\parbasedattributes
- \setfalse\parbasedattributes
- \par
- \fi}
-
-\def\dostopparbasedattributes
- {\settrue\parbasedattributes
- \dostopattributes}
-
-\unexpanded\def\@@dostopattributes
- {\stopcolor
- \finishparbasedattributes
- \endgroup}
-
-\unexpanded\def\@@nostopattributes
- {\finishparbasedattributes
- \endgroup}
-
-\unexpanded\def\doattributes#1#2#3#4%
- {\dostartattributes{#1}{#2}{#3}{#4}\dostopattributes}
-
-% An even faster \ETEX\ version:
-
-\unexpanded\def\dostartattributes#1#2#3%
- {\begingroup % geen \bgroup, anders in mathmode lege \hbox
- \ifincolor
- \ifcsname#1#3\endcsname
- \let\dostopattributes\@@dostopattributes
- \faststartcolor[\csname#1#3\endcsname]%
- \else
- \let\dostopattributes\@@nostopattributes
- \fi
- \else
- \let\dostopattributes\@@nostopattributes
- \fi
- \ifcsname#1#2\endcsname
- % \@EAEAEA\doconvertfont\@EA\@EA\csname#1#2\endcsname
- \@EA\doconvertfont\csname#1#2\@EA\endcsname
- \fi}
-
-\unexpanded\def\@@dostopattributes
- {\faststopcolor
- \finishparbasedattributes
- \endgroup}
-
-\unexpanded\def\@@nostopattributes
- {\finishparbasedattributes
- \endgroup}
-
-%D Bonus macro, see core-sec.tex
-
-\unexpanded\def\dosetfontattribute#1#2%
- {\ifcsname#1#2\endcsname
- \@EA\doconvertfont\csname#1#2\@EA\endcsname
- \fi\empty}
-
-%D Since this happens a lot, and sometimes large arguments
-%D are passed in \type {#4}, we just copy some code:
-
-\unexpanded\def\doattributes#1#2#3#4%
- {\begingroup % geen \bgroup, anders in mathmode lege \hbox
- \ifincolor
- \ifcsname#1#3\endcsname
- \let\dostopattributes\@@dostopattributes
- \faststartcolor[\csname#1#3\endcsname]%
- \else
- \let\dostopattributes\endgroup
- \fi
- \else
- \let\dostopattributes\endgroup
- \fi
- \ifcsname#1#2\endcsname
- % \@EAEAEA\doconvertfont\@EA\@EA\csname#1#2\endcsname
- \@EA\doconvertfont\csname#1#2\@EA\endcsname
- \fi
- {#4}%
- \dostopattributes}
-
-% Kan vaker worden toegepast en moet bovendien sneller!
-
-\newskip\leftskipadaption
-\newskip\rightskipadaption
-
-\def\doadaptleftskip#1%
- {\dosetleftskipadaption{#1}%
- \advance\leftskip \leftskipadaption}
-
-\def\doadaptrightskip#1%
- {\dosetrightskipadaption{#1}%
- \advance\rightskip \rightskipadaption}
-
-\setvalue{@lsa@\v!standard}{\ifdim\ctxparindent=\zeropoint\@@slleft\else\ctxparindent\fi}
-\setvalue{@lsa@\v!yes }{\ifdim\ctxparindent=\zeropoint\@@slleft\else\ctxparindent\fi}
-\letvalue{@lsa@\v!no }\zeropoint
-\letvalue{@lsa@\empty }\zeropoint
-\setvalue{@rsa@\v!standard}{\@@slright}
-\setvalue{@rsa@\v!yes }{\@@slright}
-\letvalue{@rsa@\v!no }\zeropoint
-\letvalue{@rsa@\empty }\zeropoint
-
-% not safe for 2\parindent
-%
-% \def\dosetleftskipadaption#1%
-% {\leftskipadaption
-% \ifcsname @lsa@#1\endcsname
-% \csname @lsa@#1\endcsname
-% \else
-% #1%
-% \fi
-% \relax}
-
-\def\dosetleftskipadaption#1%
- {\edefconvertedargument\ascii{@lsa@#1}%
- \leftskipadaption
- \ifcsname\ascii\endcsname
- \csname\ascii\endcsname
- \else
- #1%
- \fi
- \relax}
-
-\def\dosetrightskipadaption#1%
- {\edefconvertedargument\ascii{@rsa@#1}%
- \rightskipadaption
- \ifcsname\ascii\endcsname
- \csname\ascii\endcsname
- \else
- #1%
- \fi
- \relax}
-
-\newcount \noftrackedpagestates
-\newif \ifpagestatemismatch
-\newcount \realpagestateno
-\chardef \frozenpagestate \zerocount
-
-\def\dotrackpagestate#1#2%
- {\ifdoublesided \ifinpagebody \else
- \doforcedtrackpagestate{#1}{#2}%
- \fi \fi}
-
-\def\doforcedtrackpagestate#1#2%
- {\ifcase\frozenpagestate
- \global\advance\noftrackedpagestates\plusone
- \global\advance#2\plusone
- \lazysavetaggedtwopassdata{#1}{\number\noftrackedpagestates}{\number#2}{\noexpand\realfolio}%
- %\llap{\infofont\number\noftrackedpagestates/\number#2}% tracing
- \fi}
-
-\def\doifrightpagestateelse#1#2%
- {\ifcase\frozenpagestate
- \pagestatemismatchfalse
- \realpagestateno\realfolio
- \ifinpagebody
- \ifdoublesided
- \ifodd\realpageno\relax
- \twopassdatafoundtrue \else \twopassdatafoundfalse
- \fi
- \else
- \twopassdatafoundtrue
- \fi
- \else\ifdoublesided
- \findtwopassdata{#1}{\number#2}%
- \iftwopassdatafound
- \realpagestateno\twopassdata\relax
- \ifnum\twopassdata=\realpageno \else
- \pagestatemismatchtrue
- \fi
- \ifodd\twopassdata\relax
- \twopassdatafoundtrue \else \twopassdatafoundfalse
- \fi
- \else
- \ifodd\realpageno\relax
- \twopassdatafoundtrue \else \twopassdatafoundfalse
- \fi
- \fi
- \else
- \twopassdatafoundtrue
- \fi\fi
- \else
- \ifodd\realpagestateno\relax
- \twopassdatafoundtrue \else \twopassdatafoundfalse
- \fi
- \fi
- \iftwopassdatafound
- \@EA\firstoftwoarguments
- \else
- \@EA\secondoftwoarguments
- \fi}
-
-\def\doifforcedrightpagestateelse#1#2%
- {\ifcase\frozenpagestate
- \pagestatemismatchfalse
- \realpagestateno\realfolio
- \findtwopassdata{#1}{\number#2}%
- \iftwopassdatafound
- \realpagestateno\twopassdata\relax
- \ifnum\twopassdata=\realpageno \else
- \pagestatemismatchtrue
- \fi
- \ifodd\twopassdata\relax
- \twopassdatafoundtrue \else \twopassdatafoundfalse
- \fi
- \else
- \ifodd\realpageno\relax
- \twopassdatafoundtrue \else \twopassdatafoundfalse
- \fi
- \fi
- \else
- \ifodd\realpagestateno\relax
- \twopassdatafoundtrue \else \twopassdatafoundfalse
- \fi
- \fi
- \iftwopassdatafound
- \@EA\firstoftwoarguments
- \else
- \@EA\secondoftwoarguments
- \fi}
-
-\def\freezepagestate {\chardef\frozenpagestate\plusone }
-\def\defrostpagestate{\chardef\frozenpagestate\zerocount}
-
-% we can make more of these on top, but how to deal with mixed frozen states
-
-\definetwopasslist\s!paragraph \newcount \nofraggedparagraphs
-
-\def\signalrightpage {\dotrackpagestate \s!paragraph\nofraggedparagraphs}
-\def\doifrightpageelse{\doifrightpagestateelse\s!paragraph\nofraggedparagraphs}
-
-\newcount\pagesignallevel
-
-\def\startsignalrightpage % one may do a \postsignalrightplace
- {\advance\pagesignallevel\plusone
- \presignalrightpage
- \let\signalrightpage\relax
- \let\presignalrightpage\relax
- \let\startsignalrightpage\relax
- \doifrightpageelse\donothing\donothing
- \freezepagestate}
-
-\def\stopsignalrightpage
- {\ifcase\pagesignallevel\or\postsignalrightpage\fi
- \advance\pagesignallevel\minusone}
-
-\def\setraggedparagraphmode
- {\signalrightpage\doifrightpageelse} % move it there
-
-\ifx\swapmargins\undefined \let\swapmargins\undefined \fi % todo
-
-\def\doifswappedrightpageelse#1#2% alleen in box construction !
- {\doifrightpageelse
- {#1}
- {\scratchcounter\realpageno
- \realpageno\realpagestateno\relax
- \swapmargins
- \realpageno\scratchcounter
- #2}}
-
-\newbox\signaledrightpage % this way we can avoid interference, i.e. postpone placement
-
-\def\presignalrightpage {\global\setbox\signaledrightpage\hbox{\signalrightpage}}
-\def\postsignalrightpage{\ifvoid\signaledrightpage\else\box\signaledrightpage\fi}
-
-% The next feature is is used in:
-%
-% \definenumber[test][way=bypage]
-%
-% \def\Test
-% {\incrementnumber[test]\rawnumber[test]/%
-% \incrementnumber[test]\rawnumber[test]/%
-% \incrementnumber[test]\rawnumber[test]\space
-% \checkpagechange{oeps}\changedpage{oeps}\space
-% \ifpagechanged TRUE\else FALSE\fi}
-%
-% \Test\page \Test\par \Test\page \Test\par \Test\page \Test\page
-%
-% (adapted from cont-new.tex:)
-
-\newif\ifpagechanged \let\lastchangedpage\empty
-
-\def\docheckpagestatechange#1#2#3%
- {\pagechangedfalse
- \doforcedtrackpagestate{#2}{#3}%
- \findtwopassdata{#2}{\number#3}%
- \iftwopassdatafound
- \ifnum\twopassdata>0\getvalue{#2:p:#1}\relax
- \pagechangedtrue
- \fi
- \fi
- \ifpagechanged
- \letgvalue{#2:p:#1}\twopassdata
- \globallet\lastchangedpage\twopassdata
- \else
- \globallet\lastchangedpage\realfolio
- \fi}
-
-\def\changedpagestate#1#2%
- {\executeifdefined{#2:p:#1}{0}}
-
-\def\checkpagechange#1{\docheckpagestatechange{#1}\s!paragraph\nofraggedparagraphs}
-\def\changedpage #1{\changedpagestate{#1}\s!paragraph}
-
-% saved struts
-
-\ifx\savedstrutbox\undefined \newbox\savedstrutbox \fi
-
-\def\savestrut {\setbox\savedstrutbox\copy\strutbox}
-\def\savedstrut{\copy \savedstrutbox}
-
-% De onderstaande macro's zijn opgenomen in Plain TeX.
-%
-% \def\raggedright%
-% {\rightskip\zeropoint plus2em \spaceskip.3333em \xspaceskip.5em\relax}
-%
-% \def\ttraggedright%
-% {\tttf\rightskip\zeropoint plus2em\relax}
-%
-% \newif\ifr@ggedbottom
-%
-% \def\raggedbottom%
-% {\topskip 10\points plus60\points \r@ggedbottomtrue}
-%
-% \def\normalbottom%
-% {\topskip 10\points \r@ggedbottomfalse}
-%
-% en worden hieronder wat aangepast.
-
-% the three boolean will become obsolete some day in favour
-% of \bottomraggedness
-
-\chardef\bottomraggedness=0 % 0=ragged 1=normal/align 2=baseline
-
-\def\bottomalignlimit{3\lineheight}
-
-\newif\ifn@rmalbottom
-\newif\ifr@ggedbottom
-\newif\ifb@selinebottom
-
-\def\normalbottom
- {% \topskip 10pt
- \r@ggedbottomfalse}
-
-\def\raggedbottom
- {\chardef\bottomraggedness\zerocount
- \n@rmalbottomfalse
- \r@ggedbottomtrue
- \b@selinebottomfalse
- \settopskip}
-
-\def\alignbottom
- {\chardef\bottomraggedness\plusone
- \n@rmalbottomtrue
- \r@ggedbottomfalse
- \b@selinebottomfalse
- \settopskip}
-
-\def\baselinebottom
- {\chardef\bottomraggedness\plustwo
- \n@rmalbottomfalse
- \r@ggedbottomfalse
- \b@selinebottomtrue
- \settopskip}
-
-\let\normalbottom=\alignbottom % downward compatible
-
-% so, the new one will be
-%
-% \chardef\bottomraggedness=0 % 0=ragged 1=normal/align 2=baseline
-%
-% \def\bottomalignlimit{3\lineheight} % will be settable
-%
-% \def\raggedbottom {\chardef\bottomraggedness=0 \settopskip}
-% \def\alignbottom {\chardef\bottomraggedness=1 \settopskip}
-% \def\baselinebottom{\chardef\bottomraggedness=2 \settopskip}
-%
-% \let\normalbottom =\alignbottom
-
-% \hyphenpenalty = ( 2.5 * \hsize ) / \raggedness
-% \tolerance >= 1500 % was 200
-% \raggedness = 2 .. 6\bodyfontsize
-
-\chardef\raggedstatus=0 % normal left center right
-
-\def\leftraggedness {2\bodyfontsize}
-\def\rightraggedness {2\bodyfontsize}
-\def\middleraggedness {6\bodyfontsize}
-
-\def\middleraggedness {.5\hsize} % was: 6\bodyfontsize, fails on: \placefigure{x $x=x$ x}{}
-
-% oeps, hsize can be 0pt in which case we get a strange division
-
-\def\middleraggedness {\ifdim\hsize=\zeropoint6\bodyfontsize\else.5\hsize\fi} % was: 6\bodyfontsize, fails on: \placefigure{x $x=x$ x}{}
-
-%D More hyphenation control, will be combined with align
-%D setup.
-
-\def\nohyphens
- {\ifx\dohyphens\relax
- \edef\dohyphens
- {\hyphenpenalty\the\hyphenpenalty
- \exhyphenpenalty\the\exhyphenpenalty\relax}%
- \fi
- \hyphenpenalty\plustenthousand
- \exhyphenpenalty\plustenthousand}
-
-\let\dohyphens\relax
-
-%D To prevent unwanted side effects, we also have to check
-%D for hyphens here:
-
-% \def\setraggedness#1%
-% {\ifnum\tolerance<1500\relax % small values have
-% \tolerance1500\relax % unwanted side effects
-% \fi
-% \spaceskip2.5\hsize % we misuse these registers
-% \xspaceskip#1\relax % for temporary storage;
-% \divide\spaceskip \xspaceskip % they are changed anyway
-% \ifx\dohyphens\relax
-% \hyphenpenalty\spaceskip % \else no hyphens is active
-% \fi}
-
-\newskip\@@raggedskipa
-\newskip\@@raggedskipb
-
-\def\setraggedness#1%
- {\ifnum\tolerance<1500\relax % small values have
- \tolerance1500\relax % unwanted side effects
- \fi
- \ifx\dohyphens\relax
- % this code will be reconsidered / kind of fuzzy (and old)
- \@@raggedskipa 2.5\hsize
- \@@raggedskipb #1\relax
- \divide\@@raggedskipa \@@raggedskipb
- \hyphenpenalty\@@raggedskipa
- \fi}
-
-\let\updateraggedskips\relax
-
-\def\setraggedskips#1#2#3#4#5#6#7% never change this name
- {\def\updateraggedskips{\dosetraggedskips{#1}{#2}{#3}{#4}{#5}{#6}{#7}}%
- \updateraggedskips}
-
-\def\dosetraggedskips#1#2#3#4#5#6#7%
- {\chardef \raggedstatus#1\relax
- \leftskip 1\leftskip \!!plus#2\relax % zie: Tex By Topic 8.1.3
- \rightskip 1\rightskip\!!plus#3\relax % zie: Tex By Topic 8.1.3
- \spaceskip #4\relax
- \xspaceskip #5\relax
- \parfillskip\zeropoint\!!plus#6\relax
- \parindent #7\relax}
-
-% \def\notragged%
-% {\setraggedskips{0}{0em}{0em}{0em}{0em}{1fil}{\parindent}}
-
-% older (context) names:
-
-\let\spaceamount \interwordspace
-\let\emspaceamount\emwidth
-
-% tracing:
-
-\def\doshowpardata#1%
- {\ifx#1\relax\else
- \hbox{\string#1: \the#1}\endgraf
- \expandafter\doshowpardata
- \fi}
-
-\def\showpardata
- {\edef\thepardata
- {\hbox{font: \fontname\font}\endgraf
- \doshowpardata
- \interwordspace \interwordstretch \interwordshrink \emwidth \exheight \extraspace
- \hsize \vsize
- \leftskip \rightskip
- \spaceskip \xspaceskip
- \parindent \parfillskip
- \hyphenpenalty \exhyphenpenalty
- \displaywidowpenalty \widowpenalty \clubpenalty \brokenpenalty
- \doublehyphendemerits \finalhyphendemerits \adjdemerits
- \relax}%
- \begingroup
- \dontshowcomposition
- \inleftmargin{\vsmash
- {\switchtobodyfont[7pt,tt]%
- \framed[\c!align=\v!right]{\thepardata}}}%
- \endgroup}
-
-\def\startshowpardata
- {\begingroup
- \showcomposition
- \showstruts\tracepositionstrue \tracingparagraphs\maxdimen
- \appendtoksonce\showpardata\let\showpardata\relax\to\everypar}
-
-\def\stopshowpardata
- {\endgraf
- \endgroup}
-
-% \defineXMLenvironment[showpardata] \startshowpardata \stopshowpardata
-% \defineXMLsingular [showpardata] \showpardata
-
-% defaults
-
-\def\raggedfillamount {1fil}
-\def\raggedhalffillamount{.5fil}
-\def\raggedspaceamount {\interwordspace} % {.3333em}
-\def\raggedxspaceamount {.5em}
-
-\def\notragged
- {\chardef\raggedstatus\zerocount
- \leftskip 1\leftskip
- \rightskip 1\rightskip
- \spaceskip \zeropoint
- \xspaceskip \zeropoint
- \parfillskip\zeropoint\!!plus\raggedfillamount\relax
- \let\updateraggedskips\relax} % new
-
-\let\forgetragged\notragged
-
-\def\raggedleft
- {\setraggedness\leftraggedness
- \setraggedskips1\leftraggedness\zeropoint\raggedspaceamount
- \raggedxspaceamount\zeropoint\zeropoint}
-
-\def\raggedcenter
- {\setraggedness\middleraggedness
- \setraggedskips2\middleraggedness\middleraggedness\raggedspaceamount
- \raggedxspaceamount\zeropoint\zeropoint}
-
-%D We used to have:
-%D
-%D \starttyping
-%D \def\raggedright
-%D {\setraggedness\rightraggedness
-%D \setraggedskips{3}{0em}{\rightraggedness}{.3333em}{.5em}{0em}{\parindent}}
-%D \stoptyping
-%D
-%D However, the next alternative, suggested by Taco, is better.
-
-\def\raggedright
- {\setraggedness\rightraggedness
- \setraggedskips3\zeropoint\rightraggedness\raggedspaceamount
- \raggedxspaceamount\raggedfillamount\parindent}
-
-\def\veryraggedleft
- {\setraggedskips1\raggedfillamount\zeropoint\raggedspaceamount
- \raggedxspaceamount\zeropoint\zeropoint}
-
-%D When we want the last line to have a natural width:
-%D
-%D \starttyping
-%D \def\veryraggedleft%
-%D {\setraggedskips{1}{1fil}{0em}{.3333em}{.5em}{0em}{-1fil}}
-%D \stoptyping
-%D
-%D but this one is not accepted by the macros.
-
-\def\veryraggedcenter
- {\setraggedskips2\raggedfillamount\raggedfillamount\raggedspaceamount
- \raggedxspaceamount\zeropoint\zeropoint}
-
-\def\veryraggedright
- {\setraggedskips3\zeropoint\raggedfillamount\raggedspaceamount
- \raggedxspaceamount\zeropoint\parindent}
-
-\def\ttraggedright
- {\tttf
- \setraggedskips3\zeropoint\rightraggedness
- \zeropoint\zeropoint\zeropoint\parindent} % \ctxparindent
-
-%D A bonus one:
-
-\def\raggedwidecenter
- {\setraggedness\middleraggedness
- \setraggedskips2\raggedhalffillamount\raggedhalffillamount
- \raggedspaceamount\raggedxspaceamount\zeropoint\zeropoint}
-
-\newif\if@@asragged \@@asraggedtrue % old method
-
-% todo
-%
-% \setuplayout[grid=yes,lines=44] \showgrid
-% \starttext
-% test \vfill test \endgraf \strut \endgraf \vskip-\lineheight \removedepth \pagina test
-% \stoptext
-
-% \setupalign[reset,new,right,old]
-
-\def\@@align@@rl{\if!!donea\veryraggedleft \else\raggedleft \fi}
-\def\@@align@@rr{\if!!donea\veryraggedright \else\raggedright \fi}
-\def\@@align@@rc{\if!!donea\veryraggedcenter\else\raggedcenter\fi}
-
-\setvalue{@@ngila@@\v!broad }{\!!doneatrue}
-\setvalue{@@ngila@@\v!wide }{\!!donebtrue}
-
-\def\installalign#1#2{\setvalue{@@align@@#1}{#2}} % can be used for overloads
-
-\installalign \v!new {\@@asraggedfalse}
-\installalign \v!old {\@@asraggedtrue}
-\installalign \empty {}
-
-\installalign \v!line {\baselinebottom}
-\installalign \v!bottom {\raggedbottom}
-\installalign \v!height {\normalbottom}
-\installalign \v!width {\notragged}
-\installalign \v!normal {\notragged}
-\installalign \v!yes {\notragged}
-\installalign \v!no {\raggedright}
-\installalign \v!inner {\if@@asragged \setraggedparagraphmode\@@align@@rl\@@align@@rr \else
- \setraggedparagraphmode\@@align@@rr\@@align@@rl \fi}
-\installalign \v!outer {\if@@asragged \setraggedparagraphmode\@@align@@rr\@@align@@rl \else
- \setraggedparagraphmode\@@align@@rl\@@align@@rr \fi}
-\installalign \v!left {\if@@asragged\@@align@@rl\else\@@align@@rr\fi}
-\installalign \v!right {\if@@asragged\@@align@@rr\else\@@align@@rl\fi}
-\installalign \v!middle {\if!!doneb\raggedwidecenter\else\@@align@@rc\fi}
-\installalign \v!flushleft {\if!!donea\veryraggedright \else\raggedright\fi}
-\installalign \v!flushright {\if!!donea\veryraggedleft \else\raggedleft \fi}
-\installalign \v!flushouter {\setraggedparagraphmode\raggedleft\raggedright}
-\installalign \v!flushinner {\setraggedparagraphmode\raggedright\raggedleft}
-\installalign \v!center {\if!!doneb\raggedwidecenter\else\@@align@@rc\fi}
-\installalign \v!hanging {\enableprotruding}
-\installalign \v!nothanging {\disableprotruding}
-\installalign \v!hz {\enableadjusting}
-\installalign \v!nohz {\disableadjusting}
-\installalign \v!spacing {\enablespacehandling \enablekernhandling}
-\installalign \v!nospacing {\disablespacehandling\disablekernhandling}
-\installalign \v!hyphenated {\dohyphens}
-\installalign \v!nothyphenated {\nohyphens}
-\installalign \v!new {\@@asraggedfalse} % so new will give you consistency
-\installalign \v!reset {\notragged\normalbottom}
-
-\installalign \v!tolerant {\tolerance3000 \relax}
-\installalign \v!verytolerant {\tolerance4500 \relax}
-\installalign \v!stretch {\emergencystretch\bodyfontsize}
-
-\newcount\hyphenminoffset
-
-\ifx\sethyphenationvariables\undefined \let\sethyphenationvariables\relax \fi
-
-\def\lesshyphens
- {\advance\hyphenminoffset\plusone
- \sethyphenationvariables}
-
-\def\morehyphens
- {\ifcase\hyphenminoffset \else
- \advance\hyphenminoffset\minusone
- \fi
- \sethyphenationvariables}
-
-\installalign \v!lesshyphenation {\lesshyphens}
-\installalign \v!morehyphenation {\morehyphens}
-
-\def\dodosetupalign#1{\csname @@align@@#1\endcsname}
-\def\dodosetupngila#1{\csname @@ngila@@#1\endcsname}
-
-\def\setupalign
- {\dosingleargument\dosetupalign}
-
-\def\dosetupalign[#1]% can be made faster by checking for defined #1
- {\!!doneafalse
- \!!donebfalse
- \processcommacommand[#1]\dodosetupngila
- \processcommacommand[#1]\dodosetupalign}
-
-% \setupalign[flushleft] \input ward \par % lijnlinks
-% \setupalign[right] \input ward \par
-
-% \setupalign[flushright] \input ward \par % lijnrechts
-% \setupalign[left] \input ward \par
-
-% \setupalign[middle] \input ward \par % centreer
-% \setupalign[center] \input ward \par
-
-\def\startalignment
- {\bgroup
- \setupalign}
-
-\def\stopalignment
- {\par
- \egroup}
-
-\chardef\alignstrutmode=1
-
-% see later for the real definition, which in the simple case is:
-
-\newtoks \everyleftofalignedline
-\newtoks \everyrightofalignedline
-
-\def\shiftalignedline#1#2#3#4% left, right, inner, outer
- {\rightorleftpageaction
- {\everyleftofalignedline {\hskip\dimexpr#1+#3\relax}%
- \everyrightofalignedline{\hskip\dimexpr#2+#4\relax}}
- {\everyleftofalignedline {\hskip\dimexpr#1+#4\relax}%
- \everyrightofalignedline{\hskip\dimexpr#2+#3\relax}}}
-
-% \def\doalignline#1#2% \\ == newline
-% {\begingroup
-% \setlocalhsize % new
-% \def\\{\egroup\par\doalignline{#1}{#2}\bgroup}%
-% \dowithnextbox
-% {\noindentation % was \noindent
-% \dontleavehmode % added in marrakesch at TUG 2006
-% \hbox to \localhsize
-% {\ifcase\alignstrutmode\or\strut\fi
-% \the\everyleftofalignedline
-% #1\unhbox\nextbox#2\relax
-% \the\everyrightofalignedline}%
-% \endgroup}
-% \hbox}
-
-\def\doalignline#1#2% \\ == newline
- {\noindentation % was \noindent
- \dontleavehmode % added in marrakesch at TUG 2006\begingroup
- \begingroup
- \setlocalhsize % new
- \def\\{\egroup\par\doalignline{#1}{#2}\bgroup}%
- \dowithnextbox
- {\hbox to \localhsize
- {\ifcase\alignstrutmode\or\strut\fi
- \the\everyleftofalignedline
- #1\unhbox\nextbox#2\relax
- \the\everyrightofalignedline}%
- \endgroup}
- \hbox}
-
-% plain commands
-
-\ifx\undefined\line \def\line {\hbox to\hsize} \fi
-\ifx\undefined\leftline \def\leftline #1{\line{#1\hss}} \fi
-\ifx\undefined\rightline \def\rightline #1{\line{\hss#1}} \fi
-\ifx\undefined\centerline \def\centerline#1{\line{\hss#1\hss}} \fi
-
-% directe commando's
-
-\def\leftaligned {\doalignline \relax \hss }
-\def\midaligned {\doalignline \hss \hss }
-\def\rightaligned{\doalignline \hss \relax}
-
-\let\centeraligned\midaligned
-
-\def\regelbegrensd#1{\limitatetext{#1}{\hsize}{\unknown}} % to be translated
-
-% indirecte commando's
-
-\letvalue{\s!do\v!line\v!left }\leftaligned
-\letvalue{\s!do\v!line\v!right }\rightaligned
-\letvalue{\s!do\v!line\v!middle }\midaligned
-\letvalue{\s!do\v!line\v!flushleft }\rightaligned
-\letvalue{\s!do\v!line\v!flushright}\leftaligned
-\letvalue{\s!do\v!line\v!center }\midaligned
-
-\def\doalignedline#1{\csname\s!do\v!line#1\endcsname}
-
-%D Experimental:
-
-% simple version
-%
-% \def\doxalignline#1#2%
-% {\bgroup
-% \setlocalhsize
-% \def\\{\egroup\par\doxalignline{#1}{#2}\bgroup}% inefficient
-% \dowithnextbox
-% {\noindent\hbox to \localhsize
-% {\ifcase\alignstrutmode\or\strut\fi
-% \signalrightpage
-% \doifrightpageelse{#1\unhbox\nextbox#2}{#2\unhbox\nextbox#1}}%
-% \egroup}
-% \hbox}
-%
-% \setvalue{\s!do\v!regel\v!binnen}{\doxalignline\relax\hss}
-% \setvalue{\s!do\v!regel\v!buiten}{\doxalignline\hss\relax}
-%
-% more extensive:
-
-\def\doxalignline#1#2#3#4#5#6%
- {\noindentation % was \noindent
- \dontleavehmode % added in marrakesch at TUG 2006\begingroup
- \begingroup
- \setlocalhsize
- \def\\{\egroup\par\doxalignline#1#2#3#4#5#6\bgroup}% inefficient
- \dowithnextbox
- {%\noindent moved up
- \hbox to \localhsize
- {#1\hskip\ifdone#2\else#3\fi#4%
- \hbox to \localhsize
- {\the\everyleftofalignedline
- \ifcase\alignstrutmode\or\strut\fi
- \ifdone#5\unhbox\nextbox#6\else#6\unhbox\nextbox#5\fi
- \the\everyrightofalignedline}%
- \hss}%
- \endgroup}
- \hbox}
-
-\def\doxcheckline
- {\signalrightpage\doifrightpageelse\donetrue\donefalse}
-
-\setvalue{\s!do\v!line\v!inner }{\doxalignline\doxcheckline++\zeropoint \relax\hss }
-\setvalue{\s!do\v!line\v!outer }{\doxalignline\doxcheckline++\zeropoint \hss \relax}
-\setvalue{\s!do\v!line\v!innermargin}{\doxalignline\doxcheckline-+\innermargintotal\relax\hss }
-\setvalue{\s!do\v!line\v!outermargin}{\doxalignline\doxcheckline+-\outermargintotal\hss \relax}
-\setvalue{\s!do\v!line\v!inneredge }{\doxalignline\doxcheckline-+\inneredgetotal \relax\hss }
-\setvalue{\s!do\v!line\v!outeredge }{\doxalignline\doxcheckline+-\outeredgetotal \hss \relax}
-\setvalue{\s!do\v!line\v!backspace }{\doxalignline\doxcheckline-+\backspace \relax\hss }
-\setvalue{\s!do\v!line\v!cutspace }{\doxalignline\doxcheckline+-\cutspace \hss \relax}
-
-\setvalue{\s!do\v!line\v!leftmargin }{\doxalignline\donefalse --\leftmargintotal \hss \relax}
-\setvalue{\s!do\v!line\v!rightmargin}{\doxalignline\donefalse ++\rightmargintotal\relax\hss }
-\setvalue{\s!do\v!line\v!leftedge }{\doxalignline\donefalse --\leftedgetotal \hss \relax}
-\setvalue{\s!do\v!line\v!rightedge }{\doxalignline\donefalse ++\rightedgetotal \relax\hss }
-
-% ! ! ! beware, redefining \doalignline gives the wrong results ! ! !
-%
-% \def\doalignline{\doxalignline\donefalse++\zeropoint}
-
-%D Better:
-
-\def\doalignedline#1{\csname\s!do\v!line#1\endcsname}
-
-% \def\alignedline#1#2% setting default
-% {\csname
-% \s!do\v!line
-% \ifundefined{\s!do\v!line#1}#2\else#1\fi
-% \endcsname}
-
-\def\alignedline#1#2% setting default
- {\csname\s!do\v!line\ifcsname\s!do\v!line#1\endcsname#1\else#2\fi\endcsname}
-
-%D ...
-
-\def\dosetuptolerance[#1]%
- {\doifinsetelse\v!vertical{#1}%
- {\ExpandFirstAfter\processallactionsinset
- [#1]
- [ \v!verystrict=>\def\bottomtolerance{},
- \v!strict=>\def\bottomtolerance{.050},
- \v!tolerant=>\def\bottomtolerance{.075},
- \v!verytolerant=>\def\bottomtolerance{.100}]}%
- {\ExpandFirstAfter\processallactionsinset
- [#1]
- [ \v!stretch=>\emergencystretch\bodyfontsize,
- \v!space=>\spaceskip.5em\!!plus.25em\!!minus.25em\relax,
- \v!verystrict=>\tolerance 200,
- \v!strict=>\tolerance1500,
- \v!tolerant=>\tolerance3000,
- \v!verytolerant=>\tolerance4500]}}
-
-\def\setuptolerance
- {\dosingleargument\dosetuptolerance}
-
-% \def\woordrechts
-% {\groupedcommand{\hfill\hbox}{\parfillskip\zeropoint}}
-
-% beware: \wordright{whatever\kern-\rightskip} should work!
-% so, no funny boxing here
-
-\def\dowordright[#1]%
- {% don't change
- \groupedcommand
- {\removeunwantedspaces
- \hfill
- \allowbreak % changed back from \hskip\zeropoint
- \strut
- \hfill
- \quad % decent spacing
- \hbox}
- {\doifelse{#1}\v!right{\kern-\rightskip}{\doifsomething{#1}{\kern-#1}}%
- \parfillskip\zeropoint
- %\finalhyphendemerits\zerocount % yes or no
- \par}}
-
-\def\wordright
- {\dosingleempty\dowordright}
-
-% \dorecurse{5}{something } \wordright{--someone} \endgraf
-% \dorecurse{6}{something } \wordright{--someone} \endgraf
-% \dorecurse{7}{something } \wordright{--someone} \endgraf
-%
-% \dorecurse{5}{something } \wordright{--someone else entirely} \endgraf
-% \dorecurse{6}{something } \wordright{--someone else entirely} \endgraf
-% \dorecurse{7}{something } \wordright{--someone else entirely} \endgraf
-%
-% \wordright[\rightskip]{whatever}
-
-% \simplealignedbox{2cm}{right}{x}
-
-\setvalue{\s!simple\c!align\v!right }#1#2{\hbox to #1{#2\hss}}
-\setvalue{\s!simple\c!align\v!left }#1#2{\hbox to #1{\hss#2}}
-\setvalue{\s!simple\c!align\v!flushright }#1#2{\hbox to #1{\hss#2}}
-\setvalue{\s!simple\c!align\v!flushleft }#1#2{\hbox to #1{#2\hss}}
-\setvalue{\s!simple\c!align\v!middle }#1#2{\hbox to #1{\hss#2\hss}}
-
-\def\simplealignedbox#1{\executeifdefined{\s!simple\c!align#1}{\getvalue{\s!simple\c!align\v!right}}}
-
-%D \macros
-%D {pushindentation,popindentation}
-%D
-%D The pushing and popping is done by:
-
-\newbox\indentationboxA
-\newbox\indentationboxB
-
-\def\pushindentation
- {\bgroup
- \ifhmode
- \unskip
- \setbox\indentationboxA\lastbox % get \strut if present
- \unskip
- \setbox\indentationboxB\lastbox % get \indent generated box
- \unskip
- \else
- \hskip\zeropoint % switch to horizontal mode
- \unskip
- \setbox\indentationboxA\lastbox % get \indent generated box
- \setbox\indentationboxB\emptybox
- \fi}
-
-\def\popindentation
- {\box\indentationboxB\box\indentationboxA % put back the boxes
- \egroup}
-
-%D The only complication lays in \type{\strut}. In \PLAIN\
-%D \TEX\ a \type{\strut} is defined as:
-%D
-%D \starttyping
-%D \def\strut%
-%D {\relax\ifmmode\copy\strutbox\else\unhcopy\strutbox\fi}
-%D \stoptyping
-%D
-%D But what is a \type{\strut}? Normally it's a rule of width
-%D zero, but when made visual, it's a rule and a negative skip.
-%D The mechanism for putting things in the margins described
-%D here cannot handle this situation very well. One
-%D characteristic of \type{\strut} is that the \type{\unhcopy}
-%D results in entering horizontal mode, which in return leads
-%D to some indentation.
-%D
-%D To serve our purpose a bit better, the macro \type{\strut}
-%D can be redefined as:
-%D
-%D \starttyping
-%D \def\strut
-%D {\relax\ifmmode\else\hskip0pt\fi\copy\strutbox}
-%D \stoptyping
-%D
-%D Or more compatible:
-%D
-%D \starttyping
-%D \def\strut
-%D {\relax\ifmmode
-%D \copy\strutbox
-%D \else
-%D \bgroup\setbox\strutbox=\normalhbox{\box\strutbox}\unhcopy\strutbox\egroup
-%D \fi}
-%D \stoptyping
-%D
-%D In \CONTEXT\ however we save some processing time by putting
-%D an extra \type{\hbox} around the \type{\strutbox}.
-
-% moved from page-lin.tex to here (due to visualization added
-% in august 2003)
-%
-% \unexpanded \def\crlf
-% {\ifhmode\unskip\else\strut\fi\ifcase\raggedstatus\hfil\fi\break}
-
-\unexpanded \def\crlf
- {\ifhmode
- \unskip
- \prewordbreak\crlfplaceholder
- \ifcase\raggedstatus\hfil\or\or\or\hfil\fi
- \break
- \else
- \crlfplaceholder
- \endgraf
- \fi}
-
-\def\crlfplaceholder
- {\strut}
-
-\def\settestcrlf
- {\def\crlfplaceholder
- {\hbox to \zeropoint
- {\strut{\infofont\kern.25em}\lohi{\infofont CR}{\infofont LF}\hss}}}
-
-%D \starttyping
-%D % \setuplayout[gridgrid=yes] \showgrid
-%D
-%D \startbuffer
-%D test 1\crlf
-%D test 2\crlf
-%D
-%D \crlf test 3
-%D
-%D test 4\crlf
-%D test 5
-%D
-%D \crlf
-%D \crlf
-%D \crlf
-%D test 6
-%D \stopbuffer
-%D
-%D \hbox
-%D {\hsize5em
-%D \ruledvtop{\getbuffer}\enspace
-%D \ruledvtop{\showstruts\getbuffer}\enspace
-%D \hsize15em \setuptyping[before=,after=]%
-%D \ruledvtop{\typebuffer}}
-%D \stoptyping
-
-\def\opeenregel % to be used grouped
- {\def\crlf{\removelastspace\space}\let\\\crlf}
-
-\def\showstruts
- {\setteststrut
- \settestcrlf}
-
-\def\definehspace
- {\dotripleempty\dodefinehspace}
-
-\def\dodefinehspace[#1][#2][#3]% #1 = optional namespace
- {\ifthirdargument
- \setvalue{\??hs#1:#2}{#3}%
- \else
- \setvalue{\??hs:#1}{#2}%
- \fi}
-
-\unexpanded\def\hspace
- {\dodoubleempty\dohspace}
-
-%\def\dohspace[#1][#2]%
-% {\ifhmode
-% \removeunwantedspaces
-% \hskip
-% \ifsecondargument
-% \hspaceamount{#1}{#2}%
-% \else
-% \hspaceamount\empty{\iffirstargument#1\else\s!default\fi}%
-% \fi
-% \expandafter\ignorespaces
-% \fi}
-
-\def\dohspace[#1][#2]%
- {\ifsecondargument
- \dodohspace[#1][#2]%
- \else\iffirstargument
- \hspace[][#1]%
- \else
- \hspace[][\s!default]%
- \fi\fi}
-
-% \def\dodohspace[#1][#2#3]%
-% {\ifhmode
-% \removeunwantedspaces
-% \doifelse{#2}{-}
-% {{\scratchskip\hspaceamount{#1}{#3}\hskip-\scratchskip}}
-% {\hskip\hspaceamount{#1}{#2#3}}%
-% \expandafter\ignorespaces
-% \fi}
-%
-% not needed, tex handles -- as +
-
-\def\dodohspace[#1][#2]%
- {\ifhmode
- \removeunwantedspaces
- \hskip\hspaceamount{#1}{#2}%
- \expandafter\ignorespaces
- \fi}
-
-\def\hspaceamount#1#2%
- {\executeifdefined{\??hs#1:#2}{\executeifdefined{\??hs:#2}\zeropoint}}
-
-\definehspace [\v!small] [.25\emspaceamount]
-\definehspace [\v!medium] [.5\emspaceamount]
-\definehspace [\v!big] [1\emspaceamount]
-\definehspace [\v!normal] [1\spaceamount]
-\definehspace [\v!default] [\spaceamount]
-
-%D Taken from Taco's math module (cq. \AMS\ macros), but
-%D adapted to \type {\hspace}:
-
-\unexpanded\def\textormathspace#1#2#3%
- {\ifmmode\mskip#1#2\else\kern#1\hspaceamount\empty{#3}\fi\relax}
-
-\newmuskip\hairmuskip \hairmuskip=.15mu
-
-\def\hairspace {\textormathspace+\hairmuskip{.5}}
-\def\thinspace {\textormathspace+\thinmuskip 1}
-\def\medspace {\textormathspace+\medmuskip 2}
-\def\thickspace {\textormathspace+\thickmuskip3}
-\def\neghairspace {\textormathspace-\thinmuskip{.5}}
-\def\negthinspace {\textormathspace-\thinmuskip 1}
-\def\negmedspace {\textormathspace-\medmuskip 2}
-\def\negthickspace{\textormathspace-\thickmuskip3}
-
-% needed for unicode:
-
-\def\twoperemspace {\hskip\dimexpr\emwidth/2\relax} % == \enspace
-\def\threeperemspace {\hskip\dimexpr\emwidth/3\relax}
-\def\fourperemspace {\hskip\dimexpr\emwidth/4\relax}
-\def\fiveperemspace {\hskip\dimexpr\emwidth/5\relax} % goodie
-\def\sixperemspace {\hskip\dimexpr\emwidth/6\relax}
-\def\figurespace {\begingroup\setbox\scratchbox\hbox{0}\hskip\wd\scratchbox\endgroup} % there is a command for this
-\def\punctuationspace {\begingroup\setbox\scratchbox\hbox{.}\hskip\wd\scratchbox\endgroup}
-\def\ideographicspace {\hskip\dimexpr\emwidth/1\relax}
-\def\ideographichalffillspace{\hskip\dimexpr\emwidth/2\relax}
-%def\nobreakspace {\penalty\plustenthousand\space}
-\def\nobreakspace {\penalty\plustenthousand\kern\interwordspace}
-\def\narrownobreakspace {\penalty\plustenthousand\thinspace}
-%def\zerowidthnobreakspace {\penalty\plustenthousand\hskip\zeropoint}
-\def\zerowidthnobreakspace {\penalty\plustenthousand\kern\zeropoint}
-\def\zerowidthspace {\hskip\zeropoint}
-
-\definehspace[.5][.1250\emspaceamount] % could also be [.1250\spaceamount]
-\definehspace[1] [.1667\emspaceamount]
-\definehspace[2] [.2222\emspaceamount]
-\definehspace[3] [.2777\emspaceamount]
-
-\let \, \thinspace
-\let \: \medspace
-\let \; \thickspace
-\let \! \negthinspace
-
-% this will become an alternative bunch of \blank settings
-%
-% \startlines
-% \scratchskip=.23pt plus 10pt minus 4pt \relax \number\scratchskip \space \the\scratchskip
-% \setsimplifiedskip\scratchskip1 \number\scratchskip \space \the\scratchskip
-% \setsimplifiedskip\scratchskip2 \number\scratchskip \space \the\scratchskip
-% \getsimplifiedskip\scratchskip\scratchcounter \number\scratchcounter
-% \stoplines
-%
-% \hrule width10cm \endgraf
-% \discardedskip{10pt}
-% \retainedskip {4pt}
-% \discardedskip {5pt}
-% \hrule width10cm \endgraf
-% \blockedskip{0pt}
-% \discardedskip{10pt}
-% \retainedskip {4pt}
-% \discardedskip {5pt}
-% \hrule width10cm \endgraf
-% \frozenskip {4cm}
-% \hrule width10cm \endgraf
-% \vskip10pt
-% \hrule width10cm \endgraf
-
-% ! ! ! etex only, evt splitskip macro gebruiken (syst-new)
-
-\newskip\simplifiedskip
-\newskip\simplifiedcounter
-
-\chardef\@@discardedskip1
-\chardef\@@retainedskip 2
-\chardef\@@forcedskip 3
-\chardef\@@blockedskip 4
-\chardef\@@frozenskip 5 % after heads, no break
-
-\def\setsimplifiedskip#1#2%
- {#1\dimexpr(10\dimexpr(#1/10)) plus \gluestretch#1 minus \glueshrink#1\relax
- \advance#1\numexpr(#2)sp\relax}
-
-\def\getsimplifiedskip#1#2%
- {\simplifiedskip#1\relax
- \ifzeropt\simplifiedskip % \ifdim\simplifiedskip=\zeropoint
- #2\zerocount
- \else
- \simplifiedcounter\dimexpr10\dimexpr#1/10\relax\relax
- \advance\simplifiedskip-\simplifiedcounter
- #2\number\simplifiedskip\relax
- \fi}
-
-\def\conditionalskip#1#2%
- {\scratchskip#1\relax
- \setsimplifiedskip\scratchskip#2\relax
- \vskip\scratchskip\relax}
-
-\def\defrostskip
- {\scratchskip\lastskip\penalty50000\normalvskip-\scratchskip\penalty50000\relax}
-
-\def\frozenskip#1%
- {\endgraf
- \ifvmode
- \getsimplifiedskip\lastskip\scratchcounter
- \ifdim\lastskip>#1\else
- \defrostskip
- \conditionalskip{#1}\@@frozenskip
- \fi
- \fi}
-
-\def\discardedskip#1%
- {\endgraf
- \ifvmode
- \getsimplifiedskip\lastskip\scratchcounter
- \ifcase\scratchcounter
- \conditionalskip{#1}\@@discardedskip
- \or % discard
- \ifdim\lastskip>#1\else
- \normalvskip-\lastskip
- \conditionalskip{#1}\@@discardedskip
- \fi
- \or % retain
- \ifdim\lastskip>#1\else
- \normalvskip-\lastskip
- \conditionalskip{#1}\@@discardedskip
- \fi
- \or % forced
- \conditionalskip{#1}\@@discardedskip
- \or % ignored
- \or % frozen
- \ifdim\lastskip>#1\else
- \defrostskip
- \conditionalskip{#1}\@@frozenskip
- \fi
- \else\ifdim#1=\zeropoint\else
- \vskip#1\relax
- \fi\fi
- \fi}
-
-\def\retainedskip#1%
- {\endgraf
- \ifvmode
- \getsimplifiedskip\lastskip\scratchcounter
- \ifcase\scratchcounter
- \conditionalskip{#1}\@@retainedskip
- \or % discard
- \normalvskip-\lastskip
- \conditionalskip{#1}\@@retainedskip
- \or % retain
- \ifdim\lastskip>#1\else
- \normalvskip-\lastskip
- \conditionalskip{#1}\@@retainedskip
- \fi
- \or % forced
- \conditionalskip{#1}\@@retainedskip
- \or % ignored
- \or % frozen
- \ifdim\lastskip>#1\else
- \defrostskip
- \conditionalskip{#1}\@@frozenskip
- \fi
- \else\ifdim#1=\zeropoint\else
- \vskip#1\relax
- \fi\fi
- \fi}
-
-\def\forcedskip#1%
- {\endgraf
- \ifvmode
- \conditionalskip{#1}\@@forcedskip
- \fi}
-
-\def\blockedskip#1%
- {\endgraf
- \ifvmode
- \getsimplifiedskip\lastskip\scratchcounter
- \ifcase\scratchcounter
- \conditionalskip{#1}\@@blockedskip
- \or % discard
- \conditionalskip{#1}\@@blockedskip
- \or % retain
- \conditionalskip{#1}\@@blockedskip
- \or % forced
- \conditionalskip{#1}\@@blockedskip
- \or % ignored
- \or % frozen
- \ifdim\lastskip>#1\else
- \defrostskip
- \conditionalskip{#1}\@@frozenskip
- \fi
- \else\ifdim#1=\zeropoint\else
- \vskip#1\relax
- \fi\fi
- \fi}
-
-% beware, changing this will break some code (like pos/backgrounds)
-
-\newtoks\everyfirstparagraphintro
-\newtoks\everynextparagraphintro
-\newtoks\@@everyparagraphtoks
-
-\chardef\everyparagraphintro\zerocount
-
-\def\setupparagraphintro
- {\dodoubleempty\dosetupparagraphintro}
-
-\def\dosetupparagraphintro[#1][#2]%
- {\processallactionsinset
- [#1]
- [ \v!reset=>\global\chardef\everyparagraphintro\zerocount
- \global\everyfirstparagraphintro\emptytoks
- \global\everynextparagraphintro \emptytoks,
- \v!first=>\global\chardef\everyparagraphintro\plusone
- \doglobal\appendtoks#2\to\everyfirstparagraphintro,
- \v!next=>\ifcase\everyparagraphintro\global\chardef\everyparagraphintro\plusone\fi
- \doglobal\appendtoks#2\to\everynextparagraphintro,
- \v!each=>\ifcase\everyparagraphintro\global\chardef\everyparagraphintro\plustwo\fi
- \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
-% \@@everyparagraphtoks\emptytoks
-% \or
-% % first data
-% \global\chardef\everyparagraphintro\plustwo
-% \@@everyparagraphtoks\everyfirstparagraphintro
-% \global\everyfirstparagraphintro\emptytoks
-% \or
-% % next data
-% \@@everyparagraphtoks\everynextparagraphintro
-% \fi
-% \the\@@everyparagraphtoks}
-
-\def\doinsertparagraphintro
- {\begingroup
- \everypar\emptytoks
- \ifcase\everyparagraphintro\relax
- % no data
- \@@everyparagraphtoks\emptytoks
- \or
- % first data
- \global\chardef\everyparagraphintro\plustwo
- \@@everyparagraphtoks\everyfirstparagraphintro
- \global\everyfirstparagraphintro\emptytoks
- \or
- % next data
- \@@everyparagraphtoks\everynextparagraphintro
- \fi
- \the\@@everyparagraphtoks
- \endgroup}
-
-\def\insertparagraphintro
- {\ifcase\everyparagraphintro\else\@EA\doinsertparagraphintro\fi}
-
-% \appendtoksonce\insertparagraphintro\to\everypar % should come last
-
-%D \starttyping
-%D \setupparagraphintro[first][\hbox to 3.5em{\tt FIRST \hss}]
-%D \setupparagraphintro[first][\hbox to 3.5em{\tt TSRIF \hss}]
-%D \setupparagraphintro[next] [\hbox to 3.5em{\tt NEXT \hss}]
-%D \setupparagraphintro[next] [\hbox to 3.5em{\tt TXEN \hss}]
-%D \setupparagraphintro[each] [\hbox to 3.0em{\tt EACH \hss}]
-%D \setupparagraphintro[each] [\hbox to 3.0em{\tt HCEA \hss}]
-%D
-%D some paragraph \par
-%D some paragraph \par
-%D some paragraph \par
-%D
-%D \definelabel[parnumber]
-%D
-%D \setupparagraphintro[reset,each][\inleft{\slxx\parnumber}]
-%D
-%D some paragraph \par
-%D some paragraph \par
-%D some paragraph \par
-%D \stoptyping
-
-%D \macros
-%D {flushatnextpar}
-%D
-%D This macro collects data that will be flushed at the next paragraph.
-%D By using this macro you can avoid interfering nodes (writes, etc).
-
-\newbox \postponednodedata
-
-\def\flushatnextpar
- {\bgroup
- \dowithnextbox
- {\global\setbox\postponednodedata\hbox{\box\postponednodedata\box\nextbox}\egroup}%
- \hbox}
-
-\def\flushpostponednodedata
- {\ifvoid\postponednodedata\else
- \hbox{\smashedbox\postponednodedata}%
- \fi}
-
-% Very nasty but needed for margin stuff inside colored
-% paragraphs.
-
-\let\normalvadjust\vadjust
-
-% \def\graphicvadjust % bad, those low level color calls here
-% {\dowithnextbox
-% {\normalvadjust
-% {\dostartgraphicgroup
-% \localstarttextcolor
-% \unvbox\nextbox
-% \localstoptextcolor
-% \dostopgraphicgroup}}%
-% \vbox}
-
-% test this prikkels/pascal margin text before heads (mode
-% 1) as well as uitwerkingen (mode 2)
-
-%chardef\graphicvadjustmode=0 % fake
-%chardef\graphicvadjustmode=1 % normal
-\chardef\graphicvadjustmode=2 % normal + compensate (== default)
-
-\def\graphicvadjust % bad, those low level color calls here
- {\dowithnextboxcontent
- {\forgetall}
- {\ifcase\graphicvadjustmode \@EA \fakedvadjust \else \@EA\normalvadjust \fi
- {\dostartgraphicgroup % don't ask
- \localstarttextcolor
- \unvbox\nextbox
- \localstoptextcolor % don't ask
- \dostopgraphicgroup
- \ifcase\graphicvadjustmode \or \or
- % corrects for one line paragraphs
- \nointerlineskip
- \kern-\struttotal
- \nointerlineskip
- \verticalstrut
- \fi}}%
- \vbox}
-
-%D This works only in a properly strutted line, and is meant
-%D for deeply burried operations, like in heads.
-
-\def\fakedvadjust
- {\dowithnextbox
- {\setbox\nextbox\hbox{\llap{\lower\strutdepth\box\nextbox}}%
- \smashedbox\nextbox}%
- \vtop}
-
-\def\flexiblespaceamount#1#2#3%
- {#1\interwordspace
- \!!plus#2\interwordstretch
- \!!minus#3\interwordshrink}
-
-\def\fixedspaceamount#1%
- {#1\interwordspace}
-
-%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}
-
-% moved from page-lin
-
-\def\installspacehandler#1#2% needs to set \obeyedspace
- {\setvalue{\??sr#1}{#2}}
-
-\installspacehandler \v!on
- {\obeyspaces
- \def\obeyedspace{\mathortext\normalspace{\dontleavehmode{\tt\controlspace}}}%
- \let\ =\obeyedspace}
-
-\installspacehandler \v!yes
- {\obeyspaces
- \def\obeyedspace{\mathortext\normalspace{\dontleavehmode \normalspace }}%
- \let\ =\obeyedspace}
-
-\installspacehandler \v!off % == default
- {\normalspaces
- \let\obeyedspace\normalspace
- \let\ =\normalspaceprimitive} % was \normalspace
-
-\installspacehandler \v!fixed
- {\obeyspaces
- \def\obeyedspace{\mathortext\normalspace{\dontleavehmode\fixedspace}}%
- \let\ =\obeyedspace}
-
-\def\activatespacehandler#1%
- {\executeifdefined{\??sr#1}{\activatespacehandler\v!off}}
-
-% moved from page-lin
-
-%D When spacing is active we need to handle commands in
-%D a special way:
-%D
-%D \starttyping
-%D \setuplines[space=on]
-%D
-%D \startlines
-%D Let's talk about this{\ttsl\gobbleoneargument or}that.
-%D \stoplines
-%D
-%D \startlines
-%D Let's talk about this{\getvalue{ttsl}or}that.
-%D \stoplines
-%D \stoptyping
-%D
-%D One can indent in several ways:
-%D
-%D \starttyping
-%D \setupindenting[medium] \setuplines[indenting=odd] % no yes odd even
-%D
-%D \startlines
-%D first
-%D second
-%D third
-%D fourth
-%D \stoplines
-%D \stoptyping
-
-\def\setuplines
- {\dodoubleargument\getparameters[\??rg]}
-
-\def\startlines
- {\@@rgbefore
- \pushmacro\checkindentation
- \whitespace
- %\page[\v!preference]} gaat mis na koppen, nieuw: later \nobreak
- \begingroup
- \setupindenting[\@@rgindenting]%
- \typesettinglinestrue
- \setupwhitespace[\v!none]%
- \obeylines
- \ignorespaces
- \gdef\afterfirstobeyedline % tzt two pass, net als opsomming
- {\gdef\afterfirstobeyedline
- {\nobreak
- \doifnot\@@rgoption\v!packed{\global\let\afterfirstobeyedline\relax}}}%
- \def\obeyedline
- {\par
- \futurelet\next\dobetweenthelines}%
- \activatespacehandler\@@rgspace
- \GotoPar}
-
-\def\stoplines
- {\endgroup
- \popmacro\checkindentation
- \@@rgafter}
-
-\def\dobetweenthelines
- {\doifmeaningelse\next\obeyedline
- {\@@rginbetween}
- {\afterfirstobeyedline}}
-
-\setuplines
- [\c!option=,
- \c!before=\blank,
- \c!after=\blank,
- \c!inbetween=\blank,
- \c!indenting=\v!no,
- \c!space=\v!default]
-
-\def\emptylines
- {\dosingleempty\doemptylines}
-
-\def\doemptylines[#1]%
- {\endgraf\dorecurse{\iffirstargument#1\else3\fi}\crlf}
-
-\setupwhitespace
- [\v!none]
-
-% still old-fashioned
-
-\indenting
- [\v!never]
-
-\setupindenting
- [\v!none]
-
-\setupblank
- [\v!standard,
- \v!big]
-
-\defineblank[\v!default] [\currentblank]
-\defineblank[\v!before] [\v!default]
-\defineblank[\v!inbetween][\v!default]
-\defineblank[\v!after] [\v!before]
-
-\setupinterlinespace
- [\c!minheight=0pt, % only special purpose
- \c!mindepth=0pt, % only special purpose
- \c!height=.72,
- \c!depth=.28,
- \c!top=1.0,
- \c!bottom=0.4,
- \c!distance=1pt,
- \c!line=2.8ex,
- \c!stretch=0]
-
-\setupnarrower
- [\c!before=\endgraf,
- \c!after=\endgraf,
- \c!left=1.5em,
- \c!right=1.5em,
- \c!middle=1.5em]
-
-\setuptolerance
- [\v!horizontal,\v!verystrict]
-
-\setuptolerance
- [\v!vertical,\v!strict]
-
-\setupalign
- [\v!bottom,
- \v!width]
-
-\setupspacing
- [\v!packed]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/spac-grd.mkii b/Master/texmf-dist/tex/context/base/mkii/spac-grd.mkii
deleted file mode 100644
index 97699de51c4..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/spac-grd.mkii
+++ /dev/null
@@ -1,1074 +0,0 @@
-%D \module
-%D [ file=core-grd,
-%D version=1998.03.10,
-%D title=\CONTEXT\ Core Macros,
-%D subtitle=Grid Snapping (Experimental),
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt Core Macros / Grid Snapping}
-
-\unprotect
-
-%D Moved from supp-box:
-
-%D \macros
-%D {startbaselinecorrection,baselinecorrection,
-%D showbaselinecorrection,offbaselinecorrection}
-%D
-%D Spacing around ruled boxes can get pretty messed up. The
-%D next macro tries as good as possible to fix this.
-%D
-%D \startbuffer[1]
-%D \startbaselinecorrection
-%D \ruledhbox{Rule Brittanica}
-%D \stopbaselinecorrection
-%D \stopbuffer
-%D
-%D \typebuffer[1]
-%D
-%D The macros put some white space around the box:
-%D
-%D \getbuffer[1]
-%D
-%D A simple alternative is \type {\baselinecorrection}, which
-%D only looks at the previous line.
-%D
-%D \startbuffer[2]
-%D \baselinecorrection
-%D \ruledhbox{Rule Brittanica}
-%D \baselinecorrection
-%D \stopbuffer
-%D
-%D \typebuffer[2]
-%D
-%D This time the last preceding line gets a correction,%
-%D dependant on the depth.
-%D
-%D \getbuffer[2]
-%D
-%D One can make the correction visible by saying \type
-%D {\showbaselinecorrection}. Part of the correction is
-%D calculated from the dimensions of a~(. One can disble the
-%D correction by calling \type {\offbaselinecorrection}.
-%D
-%D When visualize the first example looks like:
-%D
-%D {\showbaselinecorrection\getbuffer[1]}
-%D
-%D and the second one comes out as:
-%D
-%D {\showbaselinecorrection\getbuffer[2]}
-
-% \definecolor[GridLineColor][red]
-% \definecolor[GridTextColor][blue]
-
-\definepalet
- [grid]
- [ one=red,
- two=green,
- three=blue,
- four=gray]
-
-\def\setbaselinecorrections
- {\setbox0\hbox{\setstrut\strut}%
- \setbox2\hbox{(}%
- \dimen0\ht0\advance\dimen0 -\ht2
- \ifdim\dimen0<\zeropoint\dimen0\zeropoint\fi
- \dimen2\dp0\advance\dimen2 -\dp2
- \ifdim\dimen2<\zeropoint\dimen2\zeropoint\fi
- \edef\thetopbaselinecorrection {\the\dimen0}\dimen0-\dimen0
- \edef\thebotbaselinecorrection {\the\dimen2}\dimen2-\dimen2
- \edef\thenegtopbaselinecorrection{\the\dimen0}%
- \edef\thenegbotbaselinecorrection{\the\dimen2}}
-
-\def\dotopbaselinecorrection {\kern\thetopbaselinecorrection}
-\def\dobotbaselinecorrection {\kern\thebotbaselinecorrection}
-\def\donegtopbaselinecorrection{\kern\thenegtopbaselinecorrection}
-\def\donegbotbaselinecorrection{\kern\thenegbotbaselinecorrection}
-
-\def\showbaselinecorrection
- {\def\dobaselinecorrection % visualization is not watertight!
- {\bgroup
-\ifdim\prevdepth>\zeropoint\kern-\prevdepth\fi
- \setbox0\null
- \wd0\hsize
- \dp0\strutdp
- \nointerlineskip
- \forgetall
- \ruledvbox{\box0}%
- \egroup
- \prevdepth\strutdp}%
- \def\dotopbaselinecorrection
- {\hrule\!!height\thetopbaselinecorrection}%
- \def\dobotbaselinecorrection
- {\hrule\!!height\thebotbaselinecorrection}}
-
-\def\dobaselinecorrection
- {\ifdim\prevdepth>\zeropoint\kern-\prevdepth\fi
- \kern\strutdp
- \prevdepth\strutdp}
-
-% \def\baselinecorrection
-% {\endgraf
-% \ifvmode
-% \ifdim\prevdepth<\maxdimen
-% \ifdim\prevdepth<\zeropoint \else
-% \ifdim\prevdepth<\strutdp
-% \dobaselinecorrection
-% \fi
-% \fi
-% \fi
-% \fi}
-
-\def\baselinecorrection
- {\endgraf
- \ifvmode
- \ifdim\prevdepth<\maxdimen
- \ifdim\prevdepth<\zeropoint \else
- \ifdim\prevdepth<\strutdepth \relax
- \pushlastnode
- \dobaselinecorrection
- \poplastnode
- \fi
- \fi
- \fi
- \fi}
-
-\def\pagebaselinecorrection
- {\ifdim\pagegoal<\maxdimen
- \ifdim\pagetotal>\lineheight % or \topskip
- \scratchdimen\pagetotal
- \advance\scratchdimen\lineheight
- \ifdim\scratchdimen<\pagegoal
- \baselinecorrection
- \fi
- \fi
- \fi}
-
-% Beware, keep this one as it is, see for instance module
-% m-steps.tex, where we apply a \localhsize to the \vbox, in
-% order to follow narrower and side floats !
-
-% \def\startbaselinecorrection
-% {\baselinecorrection
-% \ifvmode
-% \bgroup
-% \setbox\scratchbox\vbox\bgroup
-% \ignorespaces
-% \let\stopbaselinecorrection\dostopbaselinecorrection
-% \else
-% \let\stopbaselinecorrection\relax
-% \fi}
-
-% \def\dostopbaselinecorrection % I have to check columns yet.
-% {\endgraf
-% \egroup
-% \topbaselinecorrection
-% \box\scratchbox
-% \botbaselinecorrection
-% \egroup}
-
-% \let\stopbaselinecorrection=\relax
-
-\def\startbaselinecorrection
- {\bgroup
- \let\stopbaselinecorrection\egroup
- \ifcase\baselinecorrectionmode
- \or % normal
- \baselinecorrection
- \ifvmode
- \setbox\scratchbox\vbox\bgroup\ignorespaces
- \let\stopbaselinecorrection\donormalstopbaselinecorrection
- \fi
- \or % off
- \or % force
- \baselinecorrection
- \ifvmode
- \setbox\scratchbox\vbox\bgroup\ignorespaces
- \let\stopbaselinecorrection\doforcedstopbaselinecorrection
- \fi
- \fi}
-
-\let\stopbaselinecorrection\relax
-
-\def\donormalstopbaselinecorrection % I have to check columns yet.
- {\egroup
- \topbaselinecorrection
- \box\scratchbox
- \botbaselinecorrection
- \egroup}
-
-\def\doforcedstopbaselinecorrection % I have to check columns yet.
- {\egroup
- \forcedtopbaselinecorrection
- \box\scratchbox
- \forcedbotbaselinecorrection
- \egroup}
-
-%D We do a bit more checking than needed. The pageborder check
-%D is not needed, but I want to look the visualization as good
-%D as possible too.
-
-% \def\offbaselinecorrection % Can be used inside correction.
-% {\def\startbaselinecorrection{\bgroup\let\stopbaselinecorrection\egroup}}
-
-\chardef\baselinecorrectionmode\plusone
-
-\def\onbaselinecorrection {\chardef\baselinecorrectionmode\plusone }
-\def\offbaselinecorrection {\chardef\baselinecorrectionmode\plustwo }
-\def\forcebaselinecorrection{\chardef\baselinecorrectionmode\plusthree}
-
-%D \macros
-%D {topbaselinecorrection,botbaselinecorrection}
-%D
-%D The actual top and bottom corrections are implemented as:
-
-% \def\topbaselinecorrection
-% {\ifvmode \ifdim\pagegoal<\maxdimen
-% \bgroup
-% \setbaselinecorrections
-% \whitespace
-% \nointerlineskip
-% \dotopbaselinecorrection
-% \egroup
-% \fi \fi}
-
-
-\def\topbaselinecorrection
- {\ifvmode \ifdim\pagegoal<\maxdimen
- \forcedtopbaselinecorrection
- \fi \fi}
-
-\def\forcedtopbaselinecorrection
- {\ifvmode
- \bgroup
- \setbaselinecorrections
- \whitespace
- \nointerlineskip
- \dotopbaselinecorrection
- \egroup
- \fi}
-
-\def\botbaselinecorrection
- {\ifvmode
- \bgroup
- \setbaselinecorrections
- \dobotbaselinecorrection
- \allowbreak % new, otherwise problems when many in a row
- \prevdepth\strutdp
- \egroup
- \fi}
-
-\let\forcedbotbaselinecorrection\botbaselinecorrection
-
-%D Still very experimental and therefore undocumented.
-
-\newif\ifgridsnapping % UNDER DEVELOPMENT, USE WITH CARE
-\newif\ifforcepresnap \forcepresnaptrue % false in mixed single/double
-\newif\ifstrutsnapping \strutsnappingtrue % sometimes handy to be false
-
-\def\positiveextrasnap {\gdef\extrasnapsign{+}}
-\def\negativeextrasnap {\gdef\extrasnapsign{-}}
-
-\def\extrasnapreset {\global\chardef\@@extrasnap0
- \positiveextrasnap}
-\def\extrasnapbefore {\global\chardef\@@extrasnap1 }
-\def\extrasnaparound {\global\chardef\@@extrasnap2 }
-\def\extrasnapafter {\global\chardef\@@extrasnap3 }
-
-\def\enablepresnapcorrection {\global\chardef\@@presnap\zerocount}
-\def\disablepresnapcorrection {\global\chardef\@@presnap\plusone}
-
-\extrasnapreset \enablepresnapcorrection
-
-\newif\iftracegridsnapping
-\newif\ifshowgridboxes
-\newif\ifshowfuzzyskips
-
-\let\showgridboxes\showgridboxestrue
-
-\def\showgridsnapping
- {\tracegridsnappingtrue
- \showgridboxestrue}
-
-\chardef\@@alignsnap =0
-\chardef\@@alignsnapbox =0
-\chardef\@@alignsnapmethod=0
-
-\let\presnapskip \!!zeropoint \def\presnap {-}
-\let\postsnapskip\!!zeropoint \let\postsnap\presnap
-
-\newcount\currentgridsnap
-
-\def\tracedsnapping
- {\iftracegridsnapping
- \llap
- {\startlayoutcomponent{gridsnaps}{grid snaps}%
- \infofont
- \global\advance\currentgridsnap\plusone
- \color[grid:three]{\vl\presnapskip
- \vl\presnap
- \vl\postsnap
- \ifcase\@@alignsnapbox\relax
- \vl\ifcase\@@extrasnap
- 00\or
- \extrasnapsign0\or
- \extrasnapsign\extrasnapsign\or
- 0\extrasnapsign\fi
- \fi
- \vl\the\currentgridsnap\vl}%
- \stoplayoutcomponent}%
- \fi}
-
-\def\snaptogrid% [#1]#2 -> #2 == \hbox|\vbox
- {\dosingleempty\dosnaptogrid}
-
-% \def\dosnaptogrid[#1]%
-% {\ifgridsnapping
-% \iffirstargument\doifsomething{#1}{\verplaatsopgrid[#1]}\fi
-% \expandafter\dodosnaptogrid
-% \fi}
-
-% \def\dosnaptogrid[#1]%
-% {\resetlastlinewidth % maybe in more places, otherwise spacing gets messed up
-% \ifgridsnapping
-% \iffirstargument\doifsomething{#1}{\moveongrid[#1]}\fi
-% \expandafter\dodosnaptogrid
-% \fi}
-
-\def\dosnaptogrid[#1]%
- {\resetlastlinewidth % maybe in more places, otherwise spacing gets messed up
- \doifinsetelse\v!force{#1}%
- {\moveongrid[#1]%
- \dodosnaptogrid}
- {\ifgridsnapping
- \doifsomething{#1}{\moveongrid[#1]}%
- \expandafter\dodosnaptogrid
- \fi}}
-
-% \def\forcedpresnapcorrection % test this on 'details'
-% {\ifforcepresnap
-% \ifvmode \else \par \fi % new
-% % we don't want top of page space when 'top' option
-% %\verticalstrut\nobreak\vskip-\struttotal
-% %\verticalstrut\vskip-\struttotal
-% % nobreak really needed
-% \allowbreak\verticalstrut\nobreak\vskip-\struttotal
-% %\ifdim\pagetotal>\topskip \else
-% % eigenlijk signal
-% %\writestatus{grid}{removing dummy at top of page}%
-% %\bgroup
-% %\output{\setbox\scratchbox\box255}%
-% %\penalty\outputpenalty
-% %\egroup
-% %\fi
-% \fi}
-
-\def\forcedpresnapcorrection % test this on 'details'
- {\ifforcepresnap
- \ifvmode \else \par \fi % new
- % we don't want top of page space when 'top' option
- % \verticalstrut\nobreak\vskip-\struttotal
- % \verticalstrut\vskip-\struttotal
- % \nobreak really needed
- % \dosomebreak\allowbreak % no: spoils heads, so only under know situation, not in snapper
- \verticalstrut
- \nobreak
- \vskip-\struttotal
- %\ifdim\pagetotal>\topskip \else
- % eigenlijk signal
- %\writestatus{grid}{removing dummy at top of page}%
- %\bgroup
- %\output{\setbox\scratchbox\box255}%
- %\penalty\outputpenalty
- %\egroup
- %\fi
- \fi}
-
-\def\setgridtracebox#1[#2]% % maybe reverse the order
- {\setbox\nextbox#1%
- {\hbox
- {\hbox to \zeropoint
- {\startlayoutcomponent{gridsnaps}{grid snaps}%
- \color[grid:#2]{\ruledhbox{\fakebox\nextbox}}%
- \stoplayoutcomponent
- \hss}%
- \flushnextbox}}}
-
-\newif\ifboxedsnapping \boxedsnappingtrue
-
-\chardef\depthsnapmethod \plusone % downward compatible, minus one line
-\chardef\heightsnapmethod\plusone % downward compatible, minus one line
-
-\def\dodosnaptogrid
- {\dowithnextbox
- {\bgroup
- \ifcase\@@alignsnapmethod \or
- % we're dealing with text with a possible big depth/height
- \chardef\depthsnapmethod \plustwo
- \chardef\heightsnapmethod\plustwo
- \fi
- \ifdim\nextboxht<\textheight % handle special case (like page fig)
- \ifcase\@@alignsnapbox\relax
- \ifcase\@@alignsnap\else % 1=top 2=high 3=middle 4=low
- \ifshowgridboxes
- \setgridtracebox\hbox[two]%
- \fi
- %\getnoflines{\nextboxht}%
- \getnoflines\nextboxht
- \setbox\nextbox\vbox to \noflines\lineheight
- {\ifnum\@@alignsnap=1 \kern\lineheight\kern-\topskip\fi
- \ifnum\@@alignsnap>2 \vfill\fi
- \flushnextbox
- \ifnum\@@alignsnap<4 \vfill\fi}%
- \fi
- \ifshowgridboxes
- \setgridtracebox\hbox[three]%
- \fi
- \forgetall
- \par
- \ifvbox\nextbox
- \setbox\nextbox\hbox{\flushnextbox}% don't ask
- \fi
- \scratchskip\lastskip
- \edef\presnapskip{\the\lastskip}%
- % mixing single/double columns sometimes goes wrong,
- % check 'som' document
- \ifinsidecolumns
- \forcepresnaptrue
- \fi
- \forcedpresnapcorrection
- \ifdim\nextboxht>\strutht
- \scratchdimen\nextboxht
- \ifcase\@@presnap\relax
- \ifdim\scratchskip>\zeropoint\relax
- \scratchcounter\scratchskip
- \advance\scratchcounter -\openlineheight
- \ifnum\scratchcounter<0
- \scratchcounter-\scratchcounter
- \fi
- \ifnum\scratchcounter<10 % \lastkip is about \openlineheight
- \advance\scratchdimen -\openstrutdepth
- \edef\presnapskip{*\presnapskip}%
- \else\ifdim\scratchskip>\openlineheight
- %<\openlineheight \else
- \advance\scratchdimen -\openstrutdepth
- \edef\presnapskip{*\presnapskip}%
- \fi\fi
- \fi
- \fi
- % \getnoflines\scratchdimen % maybe raw ?
- % \advance\noflines -1
- \ifcase\heightsnapmethod
- % raw
- \or
- \advance\scratchdimen-\lineheight % tight (default)
- \or
- \advance\scratchdimen-\strutheight % fit (text)
- \or
- \advance\scratchdimen-\strutheight % tolerant
- \advance\scratchdimen-\roundingeps
- \fi
- \getnoflines\scratchdimen
- \ifnum\noflines>0
- \scratchdimen\noflines\lineheight
- \else
- \scratchdimen\zeropoint
- \fi
- \else
- \scratchdimen\zeropoint
- \fi
- \ifnum\@@extrasnap=1 \advance\scratchdimen \extrasnapsign \lineheight \fi
- \ifnum\@@extrasnap=2 \advance\scratchdimen \extrasnapsign.5\lineheight \fi
- \edef\presnap{\the\scratchdimen}%
- \ifstrutsnapping
- \ifboxedsnapping
- \getrawnoflines\scratchdimen
- \advance\scratchdimen-\noflines\lineheight
- \vskip\scratchdimen % disappears at top of page
- \dorecurse\noflines{\verticalstrut\nobreak}%
- \else \ifdim\scratchdimen=\zeropoint
- % nothing to skip
- \else % disappears at top of page
- \vskip\scratchdimen
- \fi \fi
- \fi
- \ifdim\nextboxdp>\strutdp
- % \getnoflines\nextboxdp
- % \advance\noflines \minusone
- \scratchdimen\nextboxdp\relax
- \ifcase\depthsnapmethod
- % raw
- \or
- \advance\scratchdimen-\lineheight % tight (default)
- \or
- \advance\scratchdimen-\strutdepth % fit (text)
- \or
- \advance\scratchdimen-\strutdepth % tolerant
- \advance\scratchdimen-\roundingeps
- \fi
- \getnoflines\scratchdimen
- \ifnum\noflines>0
- \scratchdimen\noflines\lineheight
- \else
- \scratchdimen\zeropoint
- \fi
- \else
- \scratchdimen\zeropoint
- \fi
- \ifnum\@@extrasnap=2 \advance\scratchdimen \extrasnapsign.5\lineheight \fi
- \ifnum\@@extrasnap=3 \advance\scratchdimen \extrasnapsign \lineheight \fi
- \edef\postsnap{\the\scratchdimen}%
- \ifstrutsnapping
- \nextboxht\strutht
- \nextboxdp\strutdp
- \else
- \scratchdimen\presnap
- \advance\scratchdimen \strutht
- \nextboxht\scratchdimen
- \scratchdimen\postsnap
- \advance\scratchdimen \strutdp
- \nextboxdp\scratchdimen
- \fi
- \hbox{\tracedsnapping\flushnextbox}%
- \ifstrutsnapping
- \ifdim\scratchdimen=\zeropoint\else\vskip\scratchdimen\fi
- \fi
- \else
- \scratchdimen\nextboxht\relax
- \ifcase\@@alignsnapbox
- % can't happen here
- \or
- \getrawnoflines\scratchdimen
- \else
- \getnoflines \scratchdimen
- \fi
- \scratchdimen\noflines\lineheight\relax
- \advance\scratchdimen-\strutdepth
- % spoils the whole game (fit/broad/line)
- % \ifnum\pagetotal>\zeropoint \else % disable this as option
- % \advance\scratchdimen-\strutheight
- % \advance\scratchdimen+\topskip
- % \fi
- \dimen0=\scratchdimen
- \dimen2=\strutdepth
- \ifshowgridboxes
- \setgridtracebox\hbox[two]%
- \fi
- \nextboxdp\strutdp
- \dimen4=\nextboxht
- \dimen6=\nextboxdp
- \iftracegridsnapping
- \setbox\scratchbox\hbox
- {\scratchdimen\@@alignsnapamount\relax
- \ifdim\scratchdimen<\zeropoint
- \tracedgridamount\zeropoint{-\scratchdimen}%
- \else
- \tracedgridamount\scratchdimen\zeropoint
- \fi}%
- \smashbox\scratchbox
- \setbox\nextbox\hbox{\box\scratchbox\flushnextbox}%
- \fi
- \setbox\nextbox\hbox
- {\scratchdimen\@@alignsnapamount\relax
- \ifcase\@@alignsnapdepth\or
- % don't change this ever !
- \ifdim\dimen0<\lineheight
- % otherwise it is ok, but ending up inside
- % the next paragraph is seldom what we want,
- % so we move one line up
- \advance\scratchdimen-\lineheight
- \advance\scratchdimen\strutheight
- \else
- % otherwise we can move down to the
- % baseline
- \advance\scratchdimen\dimen6 % == \strutdepth
- \fi
- \fi
- \lower\scratchdimen\flushnextbox}%
- \nextboxht\dimen4
- \nextboxdp\dimen6
- \ifnum\@@alignsnap<4 % 4 = regel
- \setbox\nextbox\vbox to \scratchdimen
- {\forgetall
- \ifnum\@@alignsnap>2 \vfill\fi % 3 4
- \flushnextbox
- \nointerlineskip % \offinterlineskip
- \ifnum\@@alignsnap<4 \vfill\fi % 2 3
- \kern\zeropoint}%
- \fi
- \ifshowgridboxes
- \setgridtracebox\vbox[three]%
- \fi
- \scratchdimen\@@alignsnapamount
- \edef\presnapskip{\the\scratchdimen}%
- \ifnum\@@alignsnap>2 \def\presnap {+}\fi
- \ifnum\@@alignsnap<4 \def\postsnap{+}\fi
- \setbox\nextbox\hbox{\tracedsnapping\flushnextbox}%
- \par
- \nextboxht\dimen0
- \nextboxdp\dimen2
- \forcedpresnapcorrection
- \nointerlineskip
- \flushnextbox
- \fi
- \else
- \setbox\nextbox\vbox to \textheight
- {\ifdim\nextboxdp=\zeropoint
- \hbox{\lower\strutdepth\flushnextbox}
- \else % this branch is yet untested
- \vss
- \hbox{\lower\nextboxdp\flushnextbox}
- \vskip-\strutdepth
- \fi}%
- \nextboxdp\strutdepth
- \flushnextbox
- \fi
- \extrasnapreset
- \enablepresnapcorrection
- \global\chardef\@@alignsnap\zerocount
- \global\chardef\@@alignsnapbox\zerocount
- \egroup}}
-
-\def\tracedgridamount#1#2%
- {\startlayoutcomponent{gridsnaps}{grid snaps}%
- \color[grid:four]{\vrule\!!width\nextboxwd\!!height#1\!!depth#2}%
- \stoplayoutcomponent}
-
-\def\snaptomathgrid % probably not working ok, also kind of obsolete
- {\ifgridsnapping
- \dowithnextbox
- {\blank[\v!line]\snaptogrid\vbox{\flushnextbox}\blank[\v!line]}
- \vbox\bgroup
- \forgetdisplayskips
- \@EA\let\@EA\next
- \fi}
-
-\def\topsnaptogrid
- {\ifgridsnapping
- \dowithnextbox
- {\scratchdimen\nextboxht
- \advance\scratchdimen -\strutht
- \advance\scratchdimen \topskip
- \nextboxht\scratchdimen
- \nextboxdp\zeropoint
- \flushnextbox
- \kern\lineheight
- \kern-\topskip
- \nointerlineskip}
- \hbox
- \fi}
-
-% \def\centertogrid % meant for special situations
-% {\ifgridsnapping
-% \dowithnextboxcontent
-% {\ignorespaces}
-% {\bgroup
-% \par
-% \scratchdimen\nextboxht
-% \advance\scratchdimen \nextboxdp
-% \getnoflines\scratchdimen
-% \setbox\nextbox\vbox to \noflines\lineheight
-% {\forgetall
-% \vskip\zeropoint \!!plus \nextboxht
-% \copy\nextbox
-% \kern.5\strutdp % VOORLOPIGE WAARDE
-% \vskip\zeropoint \!!plus \nextboxdp}%
-% \noindent\snaptogrid\vbox{\flushnextbox}%
-% \egroup}
-% \vbox % was \hbox
-% \fi}
-
-% The next implementation is sub-optimal
-%
-% \def\centertogrid % usage: see ie pascal / stepcharts
-% {\snaptogrid[\v!midden,.5\strutdp]\vbox}
-
-\def\centertogrid % meant for special situations
- {\ifgridsnapping
- \dowithnextboxcontent
- {\ignorespaces}
- {\bgroup
- \par
- \scratchdimen\nextboxht
- \advance\scratchdimen \nextboxdp
- \getnoflines\scratchdimen
- \setbox\nextbox\vbox to \noflines\lineheight
- {\forgetall
- \vss
- \topbaselinecorrection
- \copy\nextbox
- \botbaselinecorrection
- \vss}%
- \setbox\nextbox\hbox{\lower\strutdp\flushnextbox}%
- \forgeteverypar % new per 3/4/2008, prevents duplicate pos nodes resulting in extra whitespace
- \noindent\snaptogrid\vbox{\flushnextbox}%
- \egroup}
- \vbox % was \hbox
- \fi}
-
-% testbed for \centertogrid
-%
-% \strut Bruggetje
-% \startlinecorrection
-% \startcombination
-% {\framed{test}} {} {\framed{test}} {}
-% \stopcombination
-% \stoplinecorrection
-% \strut Bruggetje
-% \startlinecorrection
-% \startcombination[2*2]
-% {\framed{test}} {} {\framed{test}} {}
-% {\framed{test}} {} {\framed{test}} {}
-% \stopcombination
-% \stoplinecorrection
-% \strut Bruggetje
-% \startlinecorrection[blank]
-% \startcombination
-% {\framed{test}} {} {\framed{test}} {}
-% \stopcombination
-% \stoplinecorrection
-% \strut Bruggetje
-% \startlinecorrection[blank]
-% \startcombination[2*2]
-% {\framed{test}} {} {\framed{test}} {}
-% {\framed{test}} {} {\framed{test}} {}
-% \stopcombination
-% \stoplinecorrection
-% \strut Bruggetje
-% \startlinecorrection
-% \startcombination
-% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {}
-% \stopcombination
-% \stoplinecorrection
-% \strut Bruggetje
-% \startlinecorrection
-% \startcombination[2*2]
-% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {}
-% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {}
-% \stopcombination
-% \stoplinecorrection
-% \strut Bruggetje
-% \startlinecorrection[blank]
-% \startcombination
-% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {}
-% \stopcombination
-% \stoplinecorrection
-% \strut Bruggetje
-% \startlinecorrection[blank]
-% \startcombination[2*2]
-% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {}
-% {\framed[lines=1]{test}} {} {\framed[lines=1]{test}} {}
-% \stopcombination
-% \stoplinecorrection
-
-\ifx\startbaselinecorrection\undefined \wait \fi % change order
-
-\let\normalstartbaselinecorrection=\startbaselinecorrection
-
-\def\startbaselinecorrection
- {\ifgridsnapping
- \centertogrid\bgroup
- \let\stopbaselinecorrection\egroup
- \else
- \normalstartbaselinecorrection
- \fi}
-
-\chardef\gridboxlinenomode\plusone
-\chardef\gridboxlinemode \plusone % 0:nothing 1:all 2:lines 3:frame
-
-\def\gridboxvbox {\ifcase\gridboxlinemode\vbox\or\ruledvbox\or\vbox\or\ruledvbox\else\ruledvbox\fi}
-\def\gridboxwidth{\ifcase\gridboxlinemode0\or.5\or.5\or0\else.5\fi\testrulewidth}
-
-\def\setgridbox#1#2#3%
- {\setbox#1\gridboxvbox to #3 % given size
- {\forgetall
- \resetteststrut
- \offinterlineskip
- \hsize#2%
- \baselinerulefalse
- \gridboxvbox % calculated size
- {\getrawnoflines{#3}% \getnoflines{#3}%
- \vskip\topskip
- \vskip-\strutht
- \scratchdimen#2\advance\scratchdimen \lineheight
- \dorecurse\noflines
- {\strut
- \hskip-.5\lineheight
- \ifcase\gridboxlinenomode\or
- \rlap
- {\hskip.2\bodyfontsize\hskip\scratchdimen
- \infofont\hbox to 1em{\hss\recurselevel}}%
- \or
- \llap
- {\infofont\hbox to 1em{\hss\recurselevel}%
- \hskip.2\bodyfontsize}%
- \fi
- \vrule
- \!!height \gridboxwidth
- \!!depth \gridboxwidth
- \!!width \scratchdimen
- \par}}
- \vfill}}
-
-%D Some intervention macros:
-
-\def\gridwarning#1{\message{[beware of #1 extra snap]}}
-
-\global\let\@@alignsnapamount\!!zeropoint
-\global\chardef\@@alignsnapdepth0
-
-\def\@@unknowngriddisplacement
- {\global\chardef\@@alignsnapbox\plusthree
- \global\let\@@alignsnapamount\commalistelement}
-
-\def\domoveongrid[#1]%
- {\ifgridsnapping\doifsomething{#1}{\dodomoveongrid[#1]}\fi}
-
-\def\dodomoveongrid[#1]% some day : speed up
- {\global\chardef\@@alignsnap\zerocount
- \global\chardef\@@alignsnapbox\zerocount
- \global\chardef\@@alignsnapdepth\zerocount
- \global\chardef\@@alignsnapmethod\zerocount
- \global\let\@@alignsnapamount\!!zeropoint
- \donefalse
- \expanded{\processallactionsinset[#1]}
- [\v!standard=>,
- \v!normal=>, % to be sure
- \v!yes=>, % to be sure
- \v!top=>\gridwarning+\positiveextrasnap\extrasnapbefore,
- \v!bottom=>\gridwarning+\positiveextrasnap\extrasnapafter,
- \v!both=>\positiveextrasnap\extrasnaparound,
- -\v!top=>\gridwarning-\negativeextrasnap\extrasnapbefore,
- -\v!bottom=>\gridwarning-\negativeextrasnap\extrasnapafter,
- -\v!both=>\negativeextrasnap\extrasnaparound,
- \v!text=>\global\chardef\@@alignsnapmethod\plusone, % accurate calculations
- \v!page=>\global\chardef\@@alignsnap\plusone, % topskip
- \v!high=>\global\chardef\@@alignsnap\plustwo,
- \v!middle=>\global\chardef\@@alignsnap\plusthree,
- \v!low=>\global\chardef\@@alignsnap\plusfour,
- \v!fit=>\global\chardef\@@alignsnapbox\plusone, % new
- \v!broad=>\global\chardef\@@alignsnapbox\plustwo, % new
- \v!depth=>\global\chardef\@@alignsnapdepth\plusone, % new
- \v!line=>\global\chardef\@@alignsnapbox\plusthree
-% \global\chardef\@@alignsnapdepth\plusone
- \global\chardef\@@alignsnap\plusfour,
- \v!reset=>\positiveextrasnap\extrasnapreset,
- \v!none=>\global\chardef\@@alignsnap\zerocount
- \global\chardef\@@alignsnapbox\zerocount,
- \v!force=>, % turns on grid snapping even when not on
- \s!default=>,
- \s!unknown=>\@@unknowngriddisplacement]}
-
-\def\moveongrid
- {\dosingleempty\domoveongrid}
-
-\def\doplaceongrid[#1]%
- {\domoveongrid[#1]\snaptogrid\vbox}
-
-\def\placeongrid
- {\dosingleempty\doplaceongrid}
-
-%D Snapping is rather robust as long as we use whole lines.
-%D Half lines of white space can however be handled when they
-%D come in pairs. The corrections needed when crossing page
-%D boundaries in the middle of such a pair, are handled by
-%D macros that are (named) sort of fuzzy. This fuzzy mechanism
-%D was written as an extension to the grid typesetting needed
-%D for typesetting (part of) the \MAPS.
-%D
-%D \starttyping
-%D \setuptyping
-%D [before={\blank[halfline]},
-%D after={\blank[halfline]}]
-%D \stoptyping
-
-\newif \iffuzzyvskip
-\newif \iffuzzysnapdone
-\newif \iffuzzysnapping
-\newif \iffuzzysnapped
-\chardef \fuzzysnappedleft=0 % ==1 when fuzzybegin still open
-\newpersistentmark\fuzzymark % (!)
-\newcount \fuzzymarker
-\newbox \fuzzysnapbox
-\newbox \fuzzysnapsplit
-
-\def\dosyncfuzzyvskip
- {\ifvmode\ifdim\lastskip<\lineheight\ifdim\lastskip>\zeropoint
- \bgroup % - added 28/2/2003: check this, there was no -
- \endgraf\forgetall\verticalstrut\nobreak\vskip-\struttotal
- \egroup
- \fi\fi\fi}
-
-\def\fuzzyvskip#1%
- {\iffuzzysnapdone
- \dosyncfuzzyvskip % NEWER
- \endfuzzysnapping
- \vskip#1\relax
- \global\fuzzysnapdonefalse
- \else
- \vskip#1\relax
- \beginfuzzysnapping
- \global\fuzzysnapdonetrue
- \fi}
-
-\def\setfuzzymark#1#2#3% #1/#2 => error recovery
- {\ifgridsnapping
- \global\fuzzysnappingtrue
- \global\advance\fuzzymarker \ifodd\fuzzymarker#1\else#2\fi
- \nobreak
- \ifshowfuzzyskips
- \hbox{\color[grid:three]
- {\llap{\infofont#3\vl\the\fuzzymarker}\nobreak
- \vrule\!!width\hsize\!!height.1\lineheight}}
- \nobreak
- \fi
- %[\the\fuzzymarker]
- %\expandafter\fuzzymark\expandafter{\the\fuzzymarker}%
- \expandafter\rawsetmark\expandafter\fuzzymark\expandafter{\the\fuzzymarker}%
- \nobreak
- \fi}
-
-\def\beginfuzzysnapping{\setfuzzymark21\v!start} % odd
-\def\endfuzzysnapping {\setfuzzymark12\v!stop } % even
-
-\def\removelastfuzzyvskip
- {\ifgridsnapping
- \iffuzzysnapping
- \ifdim\lastskip<\openlineheight
- \else
- \removelastskip
- \fi
- \else
- \removelastskip
- \fi
- \else
- \removelastskip
- \fi}
-
-\def\docheckfuzzysnap#1%
- {\bgroup
- \dontcomplain
- \setbox\fuzzysnapbox\copy#1\relax
- \setbox\fuzzysnapsplit\vsplit\fuzzysnapbox to 1\lineheight
- \let\topfuzzymark\empty % indeed here ... no real mark
- \getsplitmarks\fuzzymark
-% \ifcase0\topfuzzymark
- \ifcase0\rawgetsplittopmark\fuzzymark
- \global\chardef\fuzzysnappedleft\zerocount
- \global\fuzzysnappedfalse
-% \else\ifodd\topfuzzymark
- \else\ifodd\rawgetsplittopmark\fuzzymark
- \global\chardef\fuzzysnappedleft\plusone
- \global\fuzzysnappedtrue
- \else
- \global\chardef\fuzzysnappedleft=2
- \global\fuzzysnappedtrue
- \fi\fi
- \iffuzzysnapped \else
- \doloop
- {\ifvoid\fuzzysnapbox
- \exitloop
- \else
- \setbox\fuzzysnapsplit=\vsplit\fuzzysnapbox to \lineheight
- %\let\topfuzzymark=\empty % ... but not here
- \getsplitmarks\fuzzymark
-% \ifcase0\topfuzzymark
- \ifcase0\rawgetsplittopmark\fuzzymark
- % continue
-% \else\ifodd\topfuzzymark
- \else\ifodd\rawgetsplittopmark\fuzzymark
- \exitloop
- \else
- \global\chardef\fuzzysnappedleft\plusone
- \global\fuzzysnappedtrue
- \exitloop
- \fi\fi
- \fi}%
- \fi
- \egroup}
-
-\def\getfuzzysnapcorrection#1%
- {\global\let\presnapcorrection \relax
- \global\let\postsnapcorrection\relax
- \ifgridsnapping\iffuzzysnapping
- \docheckfuzzysnap{#1}%
- \iffuzzysnapped
- \iftracegridsnapping
- \gdef\presnapcorrection
- {\color[grid:four]{\hrule\!!height.5\openlineheight\!!width\hsize}}%
- \else
- \gdef\presnapcorrection{\kern.5\openlineheight}%
- \fi
- \gdef\postsnapcorrection{\kern-.5\openlineheight}% get the height ok
- \fi
- \fi\fi}
-
-\def\fuzzysnappedbox#1#2% \box<n> \unvbox<n>
- {\getfuzzysnapcorrection{#2}%
- \presnapcorrection
- #1#2%
- \postsnapcorrection}
-
-\def\adaptfuzzypagegoal
- {\ifgridsnapping\iffuzzysnapping\ifcase\fuzzysnappedleft\or % see dopagecontents
- \scratchdimen\pagegoal
- \advance\scratchdimen -.5\openlineheight
- \global\pagegoal\scratchdimen
- \global\advance\vsize -.5\openlineheight
- \global\chardef\fuzzysnappedleft0
- \fi\fi\fi}
-
-%D New, experimental, used in caption snapping:
-%D
-%D \starttyping
-%D \startcolumnset
-%D
-%D \setupcaption[figure][style=\tfx\setupinterlinespace,inbetween=,grid=top]
-%D
-%D \placefigure [lrtb] {\dorecurse{5}{green gras}}
-%D {\externalfigure[dummy][width=\textwidth,height=3cm,grid=height]}
-%D \placefigure [lrtb] {\dorecurse{15}{green gras}}
-%D {\externalfigure[dummy][width=\textwidth,height=3cm,grid=height]}
-%D
-%D \setupcaption[figure][style=\tfx\setupinterlinespace,inbetween=,grid=bottom]
-%D
-%D \placefigure [rltb] {\dorecurse{5}{green gras}}
-%D {\externalfigure[dummy][width=\textwidth,height=3cm,grid=height]}
-%D \placefigure [rltb] {\dorecurse{15}{green gras}}
-%D {\externalfigure[dummy][width=\textwidth,height=3cm,grid=height]}
-%D
-%D \input thuan
-%D
-%D \stopcolumnset
-%D \stoptyping
-
-\def\moveboxontogrid#1#2#3% box method firstlineht % experimental ! ! !
- {\doifsomething{#2}
- {\getnoflines{\ht#1}% no depth taken into account, depth preserved
- \scratchdimen\noflines\lineheight
- \advance\scratchdimen-\strutdp
- \bgroup
- \advance\scratchdimen-\onepoint % be a bit tolerant
- \ifdim\scratchdimen>\ht#1\relax
- \egroup
- \doif{#2}\v!top {\setbox#1\vbox to \scratchdimen{\vskip-#3\vskip\strutht\box#1\vfill}}%
- \doif{#2}\v!bottom{\setbox#1\vbox to \scratchdimen{\vfill\box#1\removedepth}}%
- \dp#1\strutdp
- \else
- \egroup
- \ht#1\scratchdimen
- \dp#1\strutdp
- \fi}}
-
-%D New:
-
-\let\checkgridsnapping\relax
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/spec-def.mkii b/Master/texmf-dist/tex/context/base/mkii/spec-def.mkii
deleted file mode 100644
index 60051579d04..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/spec-def.mkii
+++ /dev/null
@@ -1,1016 +0,0 @@
-%D \module
-%D [ file=spec-def,
-%D version=1996.01.25,
-%D title=\CONTEXT\ Special Macros,
-%D subtitle=Definitions,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 module used to be integrated in \type {spec-ini},
-%D but testing optimization is more convenient this way.
-
-\writestatus{loading}{ConTeXt Special Macros / Definitions}
-
-\unprotect
-
-%D Ok, messy, but we need this because we load drivers before
-%D references.
-
-\newif\ifcollectreferenceactions
-
-%D The following libraries are defined. Two postscript
-%D drivers are supported, as well as two mechanisms for
-%D interactive texts.
-%D
-%D \startlinecorrection
-%D \starttable[|l|l|l|l|l|]
-%D \HL
-%D \NC \bf file \NC
-%D \bf name \NC
-%D \bf calls \NC
-%D \bf support \NC
-%D \bf program / driver \NC\SR
-%D \HL
-%D \NC \tttf spec-tex \NC
-%D \tttf tex \NC
-%D \NC
-%D Generic \TEX\ (\DVI) \NC
-%D (default) \NC\FR
-%D \NC \tttf spec-tpd \NC
-%D \tttf \PDF \NC
-%D \NC
-%D Han The Thanh \NC
-%D (pdftex) \NC\MR
-%D \NC \tttf spec-ps \NC
-%D \tttf postscript \NC
-%D \NC
-%D Adobe PostScript \NC
-%D (default) \NC\MR
-%D \NC \tttf spec-tr \NC
-%D \tttf rokicki \NC
-%D \tttf postscript \NC
-%D Thomas Rokicki \NC
-%D (dvips) \NC\MR
-%D \NC \tttf spec-yy \NC
-%D \tttf yandy \NC
-%D \tttf postscript \NC
-%D YandY \NC
-%D (dvipsone, dviwindo) \NC\MR
-%D \NC \tttf spec-pdf \NC
-%D \tttf pdf \NC
-%D \NC
-%D Adobe PDF \NC
-%D (Acrobat) \NC\MR
-%D \NC \tttf spec-win \NC
-%D \tttf dviwindo \NC
-%D YandY \NC
-%D (dviwindo) \NC\MR
-%D \NC \tttf spec-htm \NC
-%D \tttf html \NC
-%D \NC
-%D HTML V 2.0 \NC
-%D (dvips) \NC\LR
-%D \HL
-%D \stoptable
-%D \stoplinecorrection
-
-%D \macros
-%D {dostartgraymode,dostopgraymode,
-%D dostartrgbcolormode,dostartcmykcolormode,dostartgraycolormode,dostopcolormode}
-%D
-%D Switching to and from color can be done in two ways:
-%D
-%D \startitemize[packed,n]
-%D \item insert driver specific commands
-%D \item pass instructions to the output device
-%D \stopitemize
-%D
-%D The first approach is more general and lays the
-%D responsibility at the driver side. Probably due to the fact
-%D that \TEX\ does not directly support color, we have been
-%D confronted for the last few years with changing special
-%D definitions. The need for support depends on how a macro
-%D package handles colored text that crosses the page boundary.
-%D Again, there are two approaches.
-%D
-%D \startitemize[packed,n]
-%D \item let \TEX\ do the job
-%D \item let the driver handle things
-%D \stopitemize
-%D
-%D The first approach is as driver independant as possible and
-%D can easily be accomplished by using \TEX's mark mechanism.
-%D In \CONTEXT\ we follow this approach. More and more, drivers
-%D are starting to support color, including stacking them.
-%D
-%D Colors as well as grayscales can be represented in scales
-%D from~0 to~1. When drivers use values in the range 0..255,
-%D this value has to be adapted in the translation process.
-%D Technically it's possible to get a grayscale from combining
-%D colors. In the \cap{RGB} color system, a color with Red,
-%D Green and Blue components of 0.80 show the same gray as a
-%D Gray Scale specified 0.80. The \cap{CMYK} color system
-%D supports a Black component apart from Cyan, Magenta and
-%D Yellow.
-%D
-%D Depending on the target format, color support differs from
-%D gray support. PostScript for example offers different
-%D operators for setting gray and color. This is because
-%D printing something using three colors is someting else than
-%D printing with just black.
-%D
-%D In \CONTEXT\ we have implemented a color subsystem that
-%D supports the use of well defined colors that, when printed
-%D in black and white, still can be distinguished. This
-%D approach enables us to serve both printed and electronic
-%D versions, using colored text and illustrations. More on the
-%D fundamentals of this topic can be found in the \cap{MAPS} of
-%D the Dutch User Group, 14 (95.1).
-%D
-%D To satisfy all those needs, we define four specials which
-%D supply enough information for drivers to act upon. We
-%D could have used more general commands with the keywords
-%D 'rgb' and 'gray', but because these specials are used often,
-%D we prefer the more direct and shorter alternative.
-%D
-%D We start with the installation of color and grayscale
-%D specials. The values are in the range 0..1 (e.g. 0.25).
-%D
-%D \starttyping
-%D \dostartgraymode {gray} ... \dostopgraymode
-%D \dostartrgbcolormode {red} {green} {blue} ... \dostopcolormode
-%D \dostartcmykcolormode {cyan} {magenta} {yellow} {black} ... \dostopcolormode
-%D \dostartgraycolormode {gray} ... \dostopcolormode
-%D \stoptyping
-%D
-%D Because we can expect conflicts between drivers, we
-%D implement them as category \type{or}. In previous versions
-%D of \DVIPSONE\ the use of their color||specials did not
-%D interfere with the PostScript ones, but recent versions do.
-
-\installspecial [\dostartgraymode] [or] [1]
-\installspecial [\dostopgraymode] [or] [0]
-
-\installspecial [\dostartrgbcolormode] [or] [3]
-\installspecial [\dostartcmykcolormode] [or] [4]
-\installspecial [\dostartgraycolormode] [or] [1]
-\installspecial [\dostopcolormode] [or] [0]
-
-%D New and experimental:
-
-\installspecial [\dostartspotcolormode] [or] [2]
-
-\installspecial [\doregisterrgbspotcolor] [or] [7]
-\installspecial [\doregistercmykspotcolor] [or] [8]
-\installspecial [\doregistergrayspotcolor] [or] [5]
-
-\installspecial [\doregisterrgbindexcolor] [or] [7]
-\installspecial [\doregistercmykindexcolor] [or] [8]
-\installspecial [\doregistergrayindexcolor] [or] [5]
-
-\installspecial [\doregisterspotcolorname] [or] [2]
-
-\installspecial [\dostartnonecolormode] [or] [0]
-\installspecial [\doregisternonecolor] [or] [0]
-
-%D For some drivers, the stop special is of no use and can
-%D simply call the start one with zero arguments.
-
-%D \macros
-%D {dogetfiguresize,doinsertfile,doinsertMPfile}
-%D
-%D Probably the most problematic special is the following
-%D one. Because we want to be able to support different
-%D schemes, we pass a lot of data to it.
-%D
-%D The support of inserting files (like illustrations) comes in
-%D many flavors. Some drivers use scales, some take dimensions.
-%D Some need offsets and others act on stored characteristics.
-%D They need one thing in common: a filename. Although separate
-%D specials for different formats sometimes are more clear, we
-%D decided to combine them all in one:
-%D
-%D \starttyping
-%D \doinsertfile {type,method} {file,label}
-%D {xscale} {yscale} {x} {y} {w} {h}
-%D {options}
-%D \stoptyping
-%D
-%D The scale is given percents, the other values are base
-%D points.
-%D
-%D Per 2006 we have simplified this model. The amount of drivers
-%D is not growing and all support scaling. We pass variables via
-%D Driver specific macros.
-%D
-%D \starttyping
-%D \doinsertfile
-%D \stoptyping
-%D
-%D The special is implemented as \type{or}. Because \DVIPSONE\
-%D understands them all, a chain of alternatives would generate
-%D multiple occurrences of the same illustration.
-%D
-%D When option 1 is passed, the viewers is asked to present a
-%D preview, like the first frame of a movie.
-
-\installspecial [\dogetfiguresize][or] [0] % now a special
-\installspecial [\doinsertfile] [or] [0] % [9]
-\installspecial [\doinsertMPfile] [or] [1] % speed up
-
-%D No start||stop construction is needed here, because there in
-%D no further interference of \TEX. All dimensions are output
-%D in points and scales as a number, where 100 equal 100\%. (We
-%D used to pass scaled points).
-
-%D \macros
-%D {doinsertsoundtrack}
-%D
-%D Sounds are (for the moment) just files with
-%D associated options.
-%D
-%D \starttyping
-%D \doinsertsoundtrack {file} {label} {options}
-%D \stoptyping
-
-\installspecial [\doinsertsoundtrack] [or] [3]
-
-%D \macros
-%D {dogetnofinsertpages}
-%D
-%D Some file formats support more than one page, like \PDF,
-%D and for special applications, one may want to have access
-%D to the total number of pages.
-%D
-%D \starttyping
-%D \dogetnofinsertpages{filename}
-%D \stoptyping
-%D
-%D The number is also available after the insert is placed,
-%D since inclusion may take place immediate when an insert is
-%D called upon.
-
-\def\nofinsertpages{1} % one of the few 'talk backs'
-
-\installspecial [\dogetnofinsertpages] [or] [1]
-
-%D \macros
-%D {dostartrotation,
-%D dostoprotation}
-%D
-%D We support rotation with the special:
-%D
-%D \starttyping
-%D \dostartrotation {angle} ... \dostoprotation
-%D \stoptyping
-%D
-%D For the moment these specials are installed as
-%D category \type{or}.
-
-\installspecial [\dostartrotation] [or] [1]
-\installspecial [\dostoprotation] [or] [0]
-
-%D \macros
-%D {dostartscaling,
-%D dostopscaling}
-%D
-%D Scaling is also supported:
-%D
-%D \starttyping
-%D \dostartscaling {x} {y} ... \dostopscaling
-%D \stoptyping
-%D
-%D Like the previous one, these specials are of category
-%D \type{or}.
-
-\installspecial [\dostartscaling] [or] [2]
-\installspecial [\dostopscaling] [or] [0]
-
-%D \macros
-%D {dostartmirroring,
-%D dostopmirroring}
-%D
-%D And indeed, mirroring is there too:
-%D
-%D \starttyping
-%D \dostartmirroring {x} {y} ... \dostopmirroring
-%D \stoptyping
-%D
-%D Again these specials are installed as category \type{or}.
-
-\installspecial [\dostartmirroring] [or] [0]
-\installspecial [\dostopmirroring] [or] [0]
-
-%D \macros
-%D {dostartnegative,
-%D dostopnegative}
-%D
-%D When producing output for an image setter, negating the
-%D page comes into view. Here are the tools:
-
-\installspecial [\dostartnegative] [or] [0]
-\installspecial [\dostopnegative] [or] [0]
-
-%D \macros
-%D {dostartoverprint,
-%D dostopoverprint}
-%D
-%D Rudimentary overprint (knockout) control is implemented
-%D using:
-
-\installspecial [\dostartoverprint] [or] [0]
-\installspecial [\dostopoverprint] [or] [0]
-
-%D The following two specials are used in for instance \type
-%D {\vadjust}'d margin material inside colored paragraphs.
-
-\installspecial [\dostartgraphicgroup] [or] [0]
-\installspecial [\dostopgraphicgroup ] [or] [0]
-
-%D \macros
-%D {doselectfirstpaperbin,
-%D doselectsecondpaperbin}
-%D
-%D Here are some very printer||specific ones. No further
-%D comment.
-
-\installspecial [\doselectfirstpaperbin] [or] [0]
-\installspecial [\doselectsecondpaperbin] [or] [0]
-
-%D \macros
-%D {doovalbox}
-%D
-%D When we look at the implementation, this is a complicated
-%D one. There are seven arguments.
-%D
-%D \starttyping
-%D \doovalbox {w} {h} {d} {linewidth} {radius} {stroke} {fill} {variant}
-%D \stoptyping
-%D
-%D This command has to return a \type{\vbox} which can be used
-%D to lay over another one (with text). The radius is in
-%D degrees, the stroke and fill are~\type{1} (true) of~\type{0}
-%D (false).
-
-\installspecial [\doovalbox] [or] [8]
-
-%D \macros
-%D {dostartclipping,dostopclipping}
-%D
-%D Clipping is implemented in such a way that an arbitrary
-%D can be fed.
-%D
-%D \starttyping
-%D \dostartclipping {pathname}{width} {height}
-%D \dostopclipping
-%D \stoptyping
-%D
-%D
-
-\installspecial [\dostartclipping] [or] [3]
-\installspecial [\dostopclipping] [or] [0]
-
-%D \macros
-%D {dosetupidentity}
-%D
-%D We can declare some characteristics of the document with
-%D
-%D \starttyping
-%D \dosetupidentity {title} {subject} {author} {creator} {date} {keys}
-%D \stoptyping
-%D
-%D All data is in string format.
-
-\installspecial [\dosetupidentity] [and] [6]
-
-%D \macros
-%D {dosetuppaper}
-%D
-%D This special can be used to tell the driver what page size
-%D to use. The special takes three arguments.
-%D
-%D \starttyping
-%D \dosetuppaper {type} {width} {height}
-%D \stoptyping
-%D
-%D The type is one of the common identifiers, like A4, A5 or
-%D B2.
-
-\installspecial [\dosetuppaper] [and] [3]
-
-%D \macros
-%D {dosetupprinter}
-%D
-%D Some drivers enable the user to specify the paper type
-%D used and/or page dimensions to be taken into account.
-%D
-%D \starttyping
-%D \dosetupprinter {type} {hoffset} {voffset} {width} {height}
-%D \stoptyping
-%D
-%D The first argument is one of \type{letter}, \type{legal},
-%D \type{A4}, \type{A5} etc. The dimensions are in
-%D basepoints.
-
-\installspecial [\dosetupprinter] [and] [5]
-
-%D \macros
-%D {dosetupopenaction, dosetupclosaction,
-%D dosetupopenpageaction, dosetupclospageaction,
-%D dosetupinteraction,
-%D dosetupscreen,
-%D dosetupviewmode}
-%D
-%D Here come some obscure interactive commands. Probably the
-%D specs will change with the development of the macros that
-%D use them.
-%D
-%D The first ones can be used to set up the interaction.
-%D
-%D \starttyping
-%D \dosetupinteraction
-%D \stoptyping
-%D
-%D Normally this command does nothing but giving a message
-%D that some scheme is supported.
-%D
-%D \starttyping
-%D \dosetupstartaction
-%D \dosetupstopaction
-%D \stoptyping
-%D
-%D These two setup the actions to be executed when the document
-%D is opened and closed.
-%D
-%D The next commands sets up the page and screen. They are
-%D kind of related.
-%D
-%D \starttyping
-%D \dosetuppage {hoffset} {voffset} {width} {height} {options}
-%D \dosetupscreen {hoffset} {voffset} {width} {height} {options}
-%D \stoptyping
-%D
-%D The first four arguments are in points. Option~1 results in a
-%D full screen launch.
-%D
-%D \starttyping
-%D \dosetuppageview {keyword}
-%D \stoptyping
-%D
-%D For the moment we only support \type{fit}.
-
-\installspecial [\dosetupinteraction] [and] [0]
-
-\installspecial [\dosetupopenaction] [and] [0]
-\installspecial [\dosetupscreen] [and] [5]
-\installspecial [\dosetuppageview] [and] [1]
-
-\installspecial [\dosetupcloseaction] [and] [0]
-\installspecial [\dosetupopenpageaction] [and] [0]
-\installspecial [\dosetupclosepageaction] [and] [0]
-\installspecial [\dosetuprenderingopenpageaction] [and] [0]
-\installspecial [\dosetuprenderingclosepageaction] [and] [0]
-
-% new, yet undocumented, replaces \dosetupscreen
-
-\installspecial [\dosetupcropbox] [and] [4]
-\installspecial [\dosetuptrimbox] [and] [4]
-\installspecial [\dosetupartbox] [and] [4]
-\installspecial [\dosetupbleedbox] [and] [4]
-
-%D \macros
-%D {dostarthide,
-%D dostophide}
-%D
-%D Not every part of the screen is suitable for paper. Menus
-%D for instance have no meaning on an non||interactive medium.
-%D These elements are hidden by means of:
-%D
-%D \starttyping
-%D \dostarthide
-%D \dostophide
-%D \stoptyping
-
-\installspecial [\dostarthide] [or] [0]
-\installspecial [\dostophide] [or] [0]
-
-%D \macros
-%D {dostartgotolocation, dostopgotolocation,
-%D dostartgotorealpage, dostopgotorealpage}
-%D
-%D When we want to support hypertext buttons, again we have
-%D to deal with two concepts.
-%D
-%D \startitemize[packed,n]
-%D \item let \TEX\ highlight the text
-%D \item let the driver show us where to click
-%D \stopitemize
-%D
-%D The first approach is the most secure one. It gives us
-%D complete control over the visual appearance of hyper
-%D buttons. The second alternative lets the driver guess what
-%D part of the text needs highlighting. As long as we deal with
-%D not too complicated textual buttons, this is no problem.
-%D It's even a bit more efficient when we take long mid
-%D paragraph active regions into account. When we let \TEX\
-%D handle active sentences {\em for instance marked like this
-%D one}, we have to take care of line- and pagebreaks ourselve.
-%D However, it's no trivial matter to let a driver find out
-%D where things begin and end. Because most hyperlinks can be
-%D found in tables of contents and registers, the saving in
-%D terms of bytes can be neglected and the first approach is a
-%D clear winner.
-%D
-%D The most convenient way of cross||referencing is using named
-%D destinations. A more simple scheme is using page numbers as
-%D destinations. Because the latter alternative can often be
-%D implemented more efficient, and because we cannot be sure
-%D what scheme a driver supports, we always have to supply a
-%D pagenumber, even when we use named destinations.
-%D
-%D To enable a driver to find out what to make active, we have
-%D to provide begin and endpoints, so like with color, we use
-%D pairs of specials. The first scheme can be satisfied with
-%D proper dimensions of the areas to be made active.
-%D
-%D The interactive real work is done by the following four
-%D specials. The reason for providing the first one with both
-%D a label and a number, is a result of the quite poor
-%D implementation of \type{pdfmarks} in version 1.0 of
-%D Acrobat. Because only pagenumbers were supported as
-%D destination, we had to provide both labels (\DVIWINDO) and
-%D pagenumbers (\PDF). Some drivers use start stop pairs.
-%D
-%D \starttyping
-%D \dostartgotolocation {w} {h} {url} {file} {label} {page}
-%D \dostartgotorealpage {w} {h} {url} {file} {page}
-%D \stoptyping
-%D
-%D Their counterparts are:
-%D
-%D \starttyping
-%D \dostopgotolocation
-%D \dostopgotorealpage
-%D \stoptyping
-%D
-%D The internal alternative is used for system||generated
-%D links, the external one for user||generated links. The
-%D Uniform Resource Locator can be used to let the reader
-%D surf the net.
-
-\installspecial [\dostartgotolocation] [and] [6]
-\installspecial [\dostopgotolocation] [and] [0]
-\installspecial [\dostartgotorealpage] [and] [5]
-\installspecial [\dostopgotorealpage] [and] [0]
-
-%D One may wonder why jumps to page and location are not
-%D combined. By splitting them, we enable macro||packages to
-%D force the prefered alternative, while on the other hand
-%D drivers can pick up the alternative desired most.
-
-%D \macros
-%D {dostartgotoJS, doflushJSpreamble}
-%D
-%D Rather special is the option to include and execute
-%D JavaScript code. This is a typical \PDF\ option.
-%D
-%D \starttyping
-%D \dostartgotoJS {w} {h} {script}
-%D \stoptyping
-%D
-%D This not so standard \TEX\ feature should be used with
-%D care. Preamble scripts are flushed by
-%D
-%D \doflushJSpreamble {script}
-
-\installspecial [\dostartgotoJS] [and] [3]
-\installspecial [\dostopgotoJS] [and] [0]
-\installspecial [\doflushJSpreamble][and] [1]
-
-%D \macros
-%D {dostartthisislocation, dostopthisislocation,
-%D dostartthisisrealpage, dostopthisisrealpage}
-%D
-%D Before we can goto some location or page, we have to tell
-%D the system where it can be found. Because some drivers
-%D follow the \SGML\ approach of begin||end tags, we have to
-%D support pairs. A possible extension to this scheme is
-%D supplying coordinates for viewing the text.
-%D
-%D The opposite commands of \type{\dogotosomething} have only
-%D one argument:
-%D
-%D \starttyping
-%D \dostartthisislocation {label}
-%D \dostartthisisrealpage {page}
-%D \stoptyping
-%D
-%D These commands are accompanied by:
-%D
-%D \starttyping
-%D \dostopthisislocation
-%D \dostopthisisrealpage
-%D \stoptyping
-%D
-%D As with all interactive commands's they are installed as
-%D \type{and} category specials.
-
-\installspecial [\dostartthisislocation] [and] [1]
-\installspecial [\dostopthisislocation] [and] [0]
-\installspecial [\dostartthisisrealpage] [and] [1]
-\installspecial [\dostopthisisrealpage] [and] [0]
-
-%D In \CONTEXT\ we don't use the \type{\stopsomething}
-%D macros because we let \TEX\ take care of typographic
-%D issues.
-
-%D \macros
-%D {doresetgotowhereever}
-%D
-%D These and others need:
-
-\installspecial [\doresetgotowhereever] [and] [0]
-
-%D \macros
-%D {dostartexecutecommand, dostopexecutecommand}
-%D
-%D The actual behavior of the next pair of commands depends
-%D much on the viewing engine. Therefore one cannot depend
-%D too much on their support.
-%D
-%D \starttyping
-%D \dostartexecutecommand {w} {h} {command} {options}
-%D \stoptyping
-%D
-%D At least the next commands are supported (more examples
-%D can be found in \type {spec-fdf.tex}:
-%D
-%D \startlinecorrection\setupalign[middle]\leavevmode
-%D \starttable[|l|l|]
-%D \HL
-%D \NC \bf command \NC \bf action \NC\SR
-%D \HL
-%D \NC first \NC go to the first page \NC\FR
-%D \NC previous \NC go to the previous page \NC\MR
-%D \NC next \NC go to the next page \NC\MR
-%D \NC last \NC go to the last page \NC\MR
-%D \NC backward \NC go back to the link list \NC\MR
-%D \NC forward \NC go forward in the link list \NC\MR
-%D \NC print \NC enter print mode \NC\MR
-%D \NC exit \NC exit viewer \NC\MR
-%D \NC close \NC close document \NC\MR
-%D \NC enter \NC enter viewer \NC\MR
-%D \NC help \NC show help on the viewer \NC\LR
-%D \HL
-%D \stoptable
-%D \stoplinecorrection
-%D
-%D Options are to be passed as a comma separated list of
-%D assignments.
-
-\installspecial [\dostartexecutecommand] [and] [4]
-\installspecial [\dostopexecutecommand] [and] [0]
-
-%D \macros
-%D {dostartobject,
-%D dostopobject,
-%D doresetobjects,
-%D doinsertobject}
-%D
-%D Reuse of object can reduce the output filesize
-%D considerably. Reusable objects are implemented with:
-%D
-%D \starttyping
-%D \dostartobject{class}{name}{width}{height}{depth}
-%D some typeset material
-%D \dostopobject
-%D \stoptyping
-%D
-%D \starttyping
-%D \doinsertobject{class}{name}
-%D \stoptyping
-%D
-%D The savings can be huge in interactive texts. The next macro needs
-%D to be called after a graphic is inserted (in order to clean up
-%D global references).
-%D
-%D \starttyping
-%D \doresetobjects
-%D \stoptyping
-
-\installspecial [\dostartobject] [or] [5]
-\installspecial [\dostopobject] [or] [0]
-\installspecial [\doinsertobject] [or] [2]
-\installspecial [\doresetobjects] [or] [0]
-
-%D \macros
-%D {doregisterfigure, doregisterfigurecolor}
-%D
-%D Images can be objects as well and it's up to the driver to
-%D handle this. Alternative images are also up to the driver,
-%D and the next macro tells the driver that the previous image
-%D is somehow followed by another and that both have to be
-%D handled together. This is a rather fuzzy model, but for the
-%D moment it suits its purpose: low res screen versions combined
-%D with high res printable ones.
-
-\installspecial [\doregisterfigure] [or] [2]
-\installspecial [\doregisterfigurecolor][or] [1]
-
-% %D \macros
-% %D {dogetobjectreference}
-% %D
-% %D For very special purposes, one can ask for the internal
-% %D reference to the object. Beware!
-%
-% \installspecial [\dogetobjectreference] [or] [3]
-%
-% %D The first argument is the name, the second a macro that
-% %D gets the associated value.
-
-%D \macros
-%D {dostartrunprogram, dostoprunprogram,
-%D dostartgotoprofile, dostopgotoprofile,
-%D dobeginofprofile,
-%D doendofprofile}
-%D
-%D These specials are still experimental. They are not yet
-%D supported by the programs the way they should be.
-%D
-%D {\em --- still undocumented ---}
-
-\installspecial [\dostartrunprogram] [and] [4]
-\installspecial [\dostoprunprogram] [and] [0]
-\installspecial [\dostartgotoprofile] [and] [3]
-\installspecial [\dostopgotoprofile] [and] [0]
-\installspecial [\dobeginofprofile] [and] [4]
-\installspecial [\doendofprofile] [and] [0]
-
-%D \macros
-%D {doinsertbookmark}
-%D
-%D Bookmarks, that is viewer generated tables of contents, are
-%D a strange phenomena, mainly because \TEX\ can provide
-%D whatever kind of table in much better quality.
-
-\installspecial [\doinsertbookmark] [and] [5]
-
-%D This special is called as:
-%D
-%D \starttyping
-%D \doinstallbookmark {level} {nofsubentries} {text} {page} {open}
-%D \stoptyping
-%D
-%D This definition is very \PDF\ oriented, so for more
-%D information we kindly refer to the \PDF\ manuals.
-
-%D \macros
-%D {dosetpagetransition}
-%D
-%D In presentations, fancy page transitions can, at least for a
-%D short moment, let the audience focus at the screen. Like the
-%D previous one, this special is very \PDF.
-%D
-%D \starttyping
-%D \dosetpagetransition{dissolve}{0}
-%D \stoptyping
-%D
-%D Transitions have symbolic names, like dissolve, box, split,
-%D blinds, wipe and glitter. The second argument determines
-%D the wait time (unless zero).
-
-\installspecial [\dosetpagetransition] [or] [2]
-
-%D \macros
-%D {dopresettextfield,dopresetlinefield,
-%D dopresetchoicefield,dopresetpopupfield,dopresetcombofield,
-%D dopresetbuttonfield,dopresetcheckfield,
-%D dopresetradiofield,dopresetradiorecord}
-%D
-%D The special drivers are programmed independant from their
-%D calling macros are thereby use the standard \TEX\ way of
-%D passing parameters. Unfortunately fields often have more
-%D than nine characteristics, so we pack some arguments in one.
-%D
-%D \starttyping
-%D \dopresettextfield / \dopresetlinefield
-%D {name} {width} {height} {default} {length}
-%D {style,color} {options} {alignment} {actions}
-%D
-%D \dopresetchoicefield / \dopresetpopupfield / \dopresetcombofield
-%D {name} {width} {height} {default}
-%D {style,color} {options} {values} {actions}
-%D
-%D \dopresetpushfield
-%D {name} {width} {height} {default}
-%D {options} {values} {actions}
-%D
-%D \dopresetcheckfield
-%D {name} {width} {height} {default}
-%D {options} {values} {actions}
-%D
-%D \dopresetradiofield
-%D {name} {width} {height} {default}
-%D {options} {parent} {values} {actions}
-%D
-%D \dopresetradiorecord
-%D {name} {top} {options} {kids} {actions}
-%D \stoptyping
-
-\installspecial [\dopresetlinefield] [or] [9]
-\installspecial [\dopresettextfield] [or] [9]
-\installspecial [\dopresetchoicefield] [or] [8]
-\installspecial [\dopresetpopupfield] [or] [8]
-\installspecial [\dopresetcombofield] [or] [8]
-\installspecial [\dopresetpushfield] [or] [7]
-\installspecial [\dopresetcheckfield] [or] [7]
-\installspecial [\dopresetradiofield] [or] [8]
-\installspecial [\dopresetradiorecord] [or] [5]
-
-%D \macros
-%D {dodefinefieldset,dogetfieldset,doiffieldset}
-%D
-%D Field sets, used in resetting and submitting, are handled
-%D by:
-
-\installspecial [\dodefinefieldset] [or] [2]
-\installspecial [\dogetfieldset] [or] [1]
-\installspecial [\doiffieldset] [or] [2]
-
-%D \macros
-%D {dosetfieldstatus}
-%D
-%D For practical reasons we set some field characteristics
-%D using:
-%D
-%D \starttyping
-%D \dosetfieldstatus {mode} {parent} {kids} {root}
-%D \stoptyping
-
-\installspecial [\dosetfieldstatus] [or] [4]
-
-%D with:
-
-\def\fieldlonermode {0} % no \chardef here
-\def\fieldparentmode{1} % no \chardef here
-\def\fieldchildmode {2} % no \chardef here
-\def\fieldcopymode {3} % no \chardef here
-
-%D \macros
-%D {doregistercalculationset}
-%D
-%D We can define a calculation order list with:
-%D
-%D \starttyping
-%D \doregistercalculationset {set identifier}
-%D \stoptyping
-
-\installspecial [\doregistercalculationset] [or] [1]
-
-%D \macros
-%D {doinsertcomment, doflushcomments}
-%D
-%D Not so much out of need, but to be complete, we also
-%D implement text annotations, so called comment:
-%D
-%D \starttyping
-%D \doinsertcomment
-%D {title} {width} {height} {color} {open} {symbol} {collect} {data}
-%D \stoptyping
-%D
-%D When enables, comments can be collected and flushed:
-%D
-%D \starttyping
-%D \doflushcomments
-%D \stoptyping
-
-\installspecial[\doinsertcomment] [and] [8]
-\installspecial[\doflushcomments] [and] [0]
-
-%D \macros
-%D {dosetposition, dosetpositionwhd, dosetpositionplus,
-%D dosetpositionpapersize}
-%D
-%D Not natural to \TEX, but available in \PDFTEX, and by
-%D means of postprocessed \DVI, we can save and call upon
-%D positions.
-%D
-%D \starttyping
-%D \dosetposition {identifier}
-%D \dosetpositionwhd {identifier} {width} {height} {depth}
-%D \dosetpositionplus {identifier} {width} {height} {depth} {list}
-%D \dosetpositionpapersize {width} {height}
-%D \stoptyping
-%D
-%D This is one of the few specials where when using \PDFTEX\
-%D the driver directly deals with the utility file.
-
-%D Support is moved to spec-mis.tex. The whole idea originates
-%D and was implemented first in \PDFTEX. Later \DVIPDFMX\
-%D supported the \CONTEXT\ specific specials and nowadays
-%D \PDFTEX\ supports this feature in \DVI\ mode and \XETEX\
-%D implements it as well. This means that only \ALEPH\ is
-%D still dependent on specials, but that variant of \TEX\ has
-%D become obsolete anyway.
-
-% \installspecial [\dosetposition] [or] [1]
-% \installspecial [\dosetpositionwhd] [or] [4]
-% \installspecial [\dosetpositionplus] [or] [5]
-
-% \installspecial [\dosetpositionpapersize] [or] [2]
-
-%D \macros
-%D {dostarttransparency,dostoptransparency}
-%D
-%D \starttyping
-%D \dostarttransparency{fraction}{type}
-%D \dostoptransparency
-%D \stoptyping
-%D
-%D Although in \CONTEXT\ transparency is closely integrated
-%D in the color drivers, in the end it is an independent
-%D feature.
-
-\installspecial [\dostarttransparency] [or] [2]
-\installspecial [\dostoptransparency] [or] [0]
-
-%D \macros
-%D {doattachfile}
-%D
-%D \starttyping
-%D \doattachfile{title}{width}{height}{depth}{color}{symbol}{filename}{source}
-%D \stoptyping
-
-\installspecial [\doattachfile] [or] [8]
-
-%D Experimental (properties):
-
-\installspecial[\dostartviewerlayer] [or] [1]
-\installspecial[\dostopviewerlayer] [or] [0]
-\installspecial[\dodefineviewerlayer] [or] [5]
-%installspecial[\doflushviewertextlayers] [or] [0]
-%installspecial[\doflushviewerpagelayers] [or] [0]
-\installspecial[\domakeviewerlayerlist] [or] [1]
-
-\installspecial[\doinsertrenderingwindow] [or] [4]
-\installspecial[\doinsertrendering] [or] [4]
-\installspecial[\doinsertrenderingobject] [or] [4]
-\installspecial[\doinsertrenderingobject] [or] [4]
-
-\installspecial[\dostartfonteffect] [or] [3]
-\installspecial[\dostopfonteffect] [or] [0]
-
-%D From now on, mapfile loading is also a special; we assume the
-%D more or less standard dvips syntax.
-
-\installspecial[\doresetmapfilelist] [and] [0]
-\installspecial[\doloadmapfile] [and] [2] % + - = | filename
-\installspecial[\doloadmapline] [and] [2] % + - = | fileline
-
-%D We define a couple of backends:
-
-\defineoutput [dvipsone] [dvi,ps,yy]
-\defineoutput [dviwindo] [dvi,ps,yy,win]
-\defineoutput [dvips] [dvi,ps,tr]
-\defineoutput [dviview] [dvi,ps,tr,dv]
-\defineoutput [pdftex] [tpd]
-\defineoutput [pdf] [tpd]
-\defineoutput [dvipdfm] [dpm]
-\defineoutput [dpm] [dpm]
-\defineoutput [dvipdfmx] [dpx]
-\defineoutput [dpx] [dpx]
-\defineoutput [acrobat] [pdf,ps,tr]
-
-\defineoutput [xetex] [dpx,xet]
-\defineoutput [xtx] [dpx,xet]
-\defineoutput [xdv] [dvi,xtx,xet]
-\defineoutput [xdv2pdf] [dvi,xtx,xet]
-
-%D We don't enable \ACROBAT, because pure \POSTSCRIPT\ is not
-%D that strong on objects and \PDFTEX\ does a better job.
-%D Some reasonable alternatives are:
-%D
-%D \starttyping
-%D \setupoutput [dvipsone,acrobat]
-%D \setupoutput [dviwindo,acrobat]
-%D \stoptyping
-%D
-%D Although, better is:
-%D
-%D \starttyping
-%D \setupoutput [pdftex]
-%D \stoptyping
-
-%D Please let me know if we need more. From now on we default
-%D to:
-
-\appendtoks
- \setupoutput[dvips]%
-\to \everydump
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/spec-dpm.mkii b/Master/texmf-dist/tex/context/base/mkii/spec-dpm.mkii
deleted file mode 100644
index fe721405aee..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/spec-dpm.mkii
+++ /dev/null
@@ -1,444 +0,0 @@
-%D \module
-%D [ file=spec-dpm,
-%D version=1998.11.24,
-%D title=\CONTEXT\ Special Macros,
-%D subtitle=DVIPDFM support,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 driver is build on top of the general \PDF\ macros,
-%D as defined in \type{spec-fdf}, so we inherit that one. Remark:
-%D this driver is no longer actively maintained, use the dpx one
-%D instead!
-
-\startspecials[dpm][reset,fdf]
-
-%D \macros
-%D {jobsuffix}
-%D
-%D Because no intermediate output format is used, we set the
-%D jobsuffix to \PDF.
-
-\setjobsuffix{pdf}
-
-%D Literal \PDF\ inclusion is implemented as:
-
-\def\PDFcode #1{\special{pdf: content #1}}
-\def\PDFcontentcode#1{\special{pdf: content #1}}
-\def\PDFdirectcode #1{\special{pdf: literal #1}}
-
-%D \macros
-%D {dosetuppaper}
-%D
-%D A simple one.
-
-\def\doDPMsetuppaper#1#2#3%
- {\bgroup
- \scratchdimen#2\edef\width {\the\scratchdimen\space}%
- \scratchdimen#3\edef\height{\the\scratchdimen\space}%
- \special{pdf: pagesize width \width height \height}%
- \global\let\doDPMsetuppaper\gobblethreearguments
- \egroup}
-
-\definespecial\dosetuppaper#1#2#3%
- {\doDPMsetuppaper{#1}{#2}{#3}}
-
-%D \macros
-%D {doinsertfile}
-%D
-%D Only \METAPOST, \JPG\ and \PDF\ inclusion are supported.
-
-\definespecial\doinsertfile
- {\dofileinsertion{dpm}\@@DriverImageType}
-
-\definefileinsertion{dpm}{mps}%
- {\PointsToWholeBigPoints\@@DriverImageWidth \width
- \PointsToWholeBigPoints\@@DriverImageHeight\height
- \special
- {PSfile="\@@DriverImageFile"\space
- llx=\EPSllx\space lly=\EPSlly\space
- urx=\EPSurx\space ury=\EPSury\space
- rwi=\width0\space rhi=\height0}}
-
-\definefileinsertion{dpm}{pdf}%
- {\special{pdf: epdf
- width \@@DriverImageWidth \space
- height \@@DriverImageHeight\space
- (\@@DriverImageFile)}}
-
-\definefileinsertion{dpm}{jpg}%
- {\special{pdf: image
- width \@@DriverImageWidth \space
- height \@@DriverImageHeight\space
- (\@@DriverImageFile)}}
-
-\definefileinsertion{dpm}{mov}{\doPDFinsertmov}
-\definefileinsertion{dpm}{avi}{\doPDFinsertmov}
-
-%D \macros
-%D {doinsertsoundtrack}
-%D
-%D Sounds are supported too.
-
-\definespecial\doinsertsoundtrack{\doPDFinsertsoundtrack}
-
-%D \macros
-%D {doovalbox}
-
-\definespecial\doovalbox{\doPDFovalbox}
-
-%D \macros
-%D {dostartgraymode,dostopgraymode,
-%D dostartrgbcolormode,dostartcmykcolormode,dostartgraycolormode,
-%D dostopcolormode,
-%D dostartrotation,dostoprotation,
-%D dostartscaling,dostopscaling,
-%D dostartmirroring,dostopmirroring,
-%D dostartnegative,dostopnegative}
-%D
-%D Unfortunately the direct \PDF\ inclusion is not suited
-%D for the next macros, which means that we cannot use the
-%D \type {\doPDF..} alternatives. Since \CONTEXT\ maintains
-%D its own colorstack, we use the \DVIPS\ alternatives.
-
-\definespecial\dostartgraymode #1{\special{color gray #1}}
-\definespecial\dostopgraymode {\special{color gray 0}}
-\definespecial\dostartrgbcolormode #1#2#3{\special{color rgb #1 #2 #3}}
-\definespecial\dostartcmykcolormode#1#2#3#4{\special{color cmyk #1 #2 #3 #4}}
-\definespecial\dostartgraycolormode #1{\special{color gray #1}}
-\definespecial\dostopcolormode {\special{color gray 0}}
-\definespecial\dostartrotation #1{\special{pdf: bt rotate #1}}
-\definespecial\dostoprotation {\special{pdf: et}}
-\definespecial\dostartscaling #1#2{\special{pdf: bt xscale #1 yscale #2}}
-\definespecial\dostopscaling {\special{pdf: et}}
-\definespecial\dostartmirroring {\special{pdf: bt xscale -1}} % ?
-\definespecial\dostopmirroring {\special{pdf: et}}
-
-%D Negation is not (yet) supported:
-
-% \definespecial\dostartnegative {}
-% \definespecial\dostopnegative {}
-% \definespecial\dostarttransparency {}
-% \definespecial\dostoptransparency {}
-
-
-%D \macros
-%D {dosetupinteraction,
-%D dosetupopenaction,dosetupcloseaction}
-
-\definespecial\dosetupinteraction%
- {\showmessage\m!interactions{21}{DVIPDFM}}
-
-\definespecial\dosetupopenaction {\doPDFsetupopenaction}
-\definespecial\dosetupcloseaction{\doPDFsetupcloseaction}
-
-%D \macros
-%D {doresetgotowhereever,
-%D dostartthisisrealpage,dostartthisislocation,
-%D dostartgotorealpage,dostartgotolocation,dostartgotoJS}
-
-\definespecial\doresetgotowhereever {\doPDFresetgotowhereever}
-\definespecial\dostartthisislocation{\doPDFstartthisislocation}
-
-\definespecial\dostartgotolocation{\doPDFstartgotolocation}
-\definespecial\dostartgotorealpage{\doPDFstartgotorealpage}
-\definespecial\dostartgotoJS {\doPDFstartgotoJS}
-
-%D \macros
-%D {doflushJSpreamble}
-
-\definespecial\doflushJSpreamble#1%
- {\bgroup
- \let\compositeJScode=\empty
- \def\docommand##1%
- {\edef\sanitizedJScode{\getJSpreamble{##1}}%
- \@EA\doPSsanitizeJScode\sanitizedJScode\to\sanitizedJScode
- \special{pdf: object @JS:#1 <</S /JavaScript /JS (\sanitizedJScode)>>}%
- \edef\compositeJScode{\compositeJScode\space (##1) @JS:#1}}%
- \processcommalist[#1]\docommand
- \special{pdf: object @JS:JS <</Names [\compositeJScode]>>}%
- \special{pdf: put @names <</JavaScript @JS:JS>>}%
- \egroup}
-
-%D \macros
-%D {dostarthide,dostophide}
-
-\definespecial\dostarthide{}
-\definespecial\dostophide {}
-
-%D \macros
-%D {dosetupscreen}
-
-\definespecial\dosetupscreen {\doPDFsetupscreen \printpaperheight}
-
-\definespecial\dosetupartbox {\doPDFsetupartbox \printpaperheight}
-\definespecial\dosetupcropbox {\doPDFsetupcropbox \printpaperheight}
-\definespecial\dosetupbleedbox{\doPDFsetupbleedbox\printpaperheight}
-\definespecial\dosetuptrimbox {\doPDFsetuptrimbox \printpaperheight}
-
-%D \macros
-%D {dostartexecutecommand}
-
-\definespecial\dostartexecutecommand{\doPDFstartexecutecommand}
-
-%D \macros
-%D {dosetupidentity}
-
-\definespecial\dosetupidentity{\doPDFsetupidentity}
-
-%D \macros
-%D {dostartrunprogam}
-
-\definespecial\dostartrunprogram{\doPDFstartrunprogram}
-
-%D \macros
-%D {dostartgotoprofile, dostopgotoprofile,
-%D dobeginofprofile, doendofprofile}
-
-\definespecial\dostartgotoprofile{\doPDFstartgotoprofile}
-
-\definespecial\dobeginofprofile#1#2#3#4%
- {\bgroup
- \setPDFdestination{#1}%
- \scratchdimen#2\edef\width {\the\scratchdimen\space}%
- \scratchdimen#3\edef\height{\the\scratchdimen\space}%
- \doifsomething{\PDFdestination}
- {\special
- {pdf: thread @ART::\PDFdestination\space
- width \width height \height
- <</Title (\PDFdestination)>>}}%
- \egroup}
-
-\definespecial\doendofprofile%
- {}
-
-%D \macros
-%D {doinsertbookmark}
-
-\definespecial\doinsertbookmark{\doPDFinsertbookmark}
-
-%D \macros
-%D {dostartobject,dostopobject,doinsertobject}
-
-% \definespecial\dostartobject#1#2#3#4#5%
-% {\bgroup
-% \setbox\nextbox=\hbox\bgroup
-% \dosetobjectreference{#1}{#2}{#1::#2}%
-% \scratchdimen#3\edef\width {\the\scratchdimen\space}%
-% \scratchdimen#4\edef\height{\the\scratchdimen\space}%
-% \special{pdf: bxobj @#1::#2 width \width height \height}}
-
-% \definespecial\dostopobject%
-% {\special{pdf: exobj}%
-% \egroup
-% \smashbox\nextbox
-% \flushatshipout{\box\nextbox}%
-% \egroup}
-
-\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}%
- \special{pdf: exobj}%
- \global\let\currentPDFresources\empty}%
- \smashbox\nextbox
- \flushatshipout{\box\nextbox}%
- \egroup}%
- \hbox\bgroup}
-
-\definespecial\dostopobject
- {\egroup}
-
-
-\definespecial\doinsertobject#1#2%
- {\hbox
- {\dogetobjectreference{#1}{#2}\PDFobjectreference
- \ifx\PDFobjectreference\empty \else
- \special{pdf: usexobj @#1::#2}%
- \fi}}
-
-%D \macros
-%D {dosetpagetransition}
-
-\definespecial\dosetpagetransition{\doPDFsetpagetransition}
-
-%D \macros
-%D {doinsertcomment, doflushcomments}
-
-\definespecial\doinsertcomment{\doPDFinsertcomment}
-\definespecial\doflushcomments{\doPDFflushcomments}
-
-%D \macros
-%D {dopresetlinefield,dopresettextfield,
-%D dopresetchoicefield,dopresetpopupfield,dopresetcombofield,
-%D dopresetpushfield,dopresetcheckfield,
-%D dopresetradiofield,dopresetradiorecord}
-
-\definespecial\dopresetlinefield {\doFDFpresetlinefield}
-\definespecial\dopresettextfield {\doFDFpresettextfield}
-\definespecial\dopresetchoicefield{\doFDFpresetchoicefield}
-\definespecial\dopresetpopupfield {\doFDFpresetpopupfield}
-\definespecial\dopresetcombofield {\doFDFpresetcombofield}
-\definespecial\dopresetpushfield {\doFDFpresetpushfield}
-\definespecial\dopresetcheckfield {\doFDFpresetcheckfield}
-\definespecial\dopresetradiofield {\doFDFpresetradiofield}
-\definespecial\dopresetradiorecord{\doFDFpresetradiorecord}
-
-%D \macros
-%D {dodefinefieldset,dogetfieldset,doiffieldset}
-
-\definespecial\dodefinefieldset{\doFDFdefinefieldset}
-\definespecial\dogetfieldset {\doFDFgetfieldset}
-\definespecial\doiffieldset {\doFDFiffieldset}
-
-%D \macros
-%D {doregistercalculationset}
-
-\definespecial\doregistercalculationset{\doFDFregistercalculationset}
-
-%D \macros
-%D {doPDFdestination}
-
-\def\doPDFdestination#1%
- {\special{pdf: dest (#1) [@thispage /View [/Fit]]}}
-
-%D \macros
-%D {doPDFaction,doPDFannotation,ifsharePDFactions}
-%D
-%D Sharing is not yet supported.
-
-\newif\ifsharePDFactions \sharePDFactionsfalse
-
-\def\dodoPDFaction#1#2#3#4%
- {\ifcollectreferenceactions
- \xdef\lastPDFaction{#4}%
- \else
- \bgroup
- % this is yet untested
- %\ifsharePDFactions
- % \ifcase\similarreference\relax
- % \xdef\lastPDFaction{<<#4>>}%
- % \or
- % \global\advance\nofPDFsimilar by 1
- % \special{pdf: object @PDF::sim:\the\nofPDFsimilar\space<<#4>>}%
- % \xdef\lastPDFaction{@PDF::sim:\the\nofPDFsimilar}%
- % \else
- % % leave \lastPDFaction untouched
- % \fi
- %\else
- \xdef\lastPDFaction{<<#4>>}%
- %\fi
- \scratchdimen#2\edef\width {\the\scratchdimen\space}%
- \scratchdimen#3\edef\height{\the\scratchdimen\space}%
- \special{pdf: ann #1 width \width height \height
- <</Subtype /Link /Border [0 0 0]
- \ifhighlighthyperlinks \else /H /N \fi
- /A \lastPDFaction\space>>}%
- \egroup
- \fi}
-
-\def\doPDFaction#1#2#3%
- {\dodoPDFaction\empty{#1}{#2}{#3}}
-
-\def\doPDFannotation#1#2#3%
- {\bgroup
- \scratchdimen#1\edef\width {\the\scratchdimen\space}%
- \scratchdimen#2\edef\height{\the\scratchdimen\space}%
- \special{pdf: ann width \width height \height
- <</Subtype /Link /Border [0 0 0] /A <<#3>>}%
- \egroup}
-
-%D \macros
-%D {doPDFannotationobject,doPDFactionobject}
-
-\def\doPDFannotationobject#1#2#3#4#5%
- {\bgroup
- \scratchdimen#3\edef\width {\the\scratchdimen\space}%
- \scratchdimen#4\edef\height{\the\scratchdimen\space}%
- \special{pdf: ann @#1::#2 width \width height \height <<#5>>}%
- \dosetobjectreference{#1}{#2}{@#1::#2}%
- \egroup}
-
-\def\doPDFactionobject#1#2#3#4#5%
- {\dodoPDFaction{@#1::#2}{#3}{#4}{#5}%
- \dosetobjectreference{#1}{#2}{#1::#2}}
-
-%D \macros
-%D {doPDFaddtocatalog,doPDFaddtoinfo,
-%D doPDFpageattribute,doPDFpagesattribute}
-
-\def\doPDFaddtocatalog#1%
- {\special{pdf: put @catalog <<#1>>}}
-
-\def\doPDFaddtoinfo#1% Is this auto appended? Not checked!
- {\special{pdf: docinfo <<#1>>}} % put @docinfo <<#1>>}}
-
-\def\doPDFpageattribute#1%
- {\special{pdf: put @thispage <<#1>>}}
-
-\def\doPDFpagesattribute#1%
- {\special{pdf: put @pages <<#1>>}}
-
-\def\doPDFpageresource#1%
- {\message{[skipping PDF resource]}}
-
-\let\doPDFresetpageresources \relax
-\let\doPDFresetpageattributes\relax
-
-%D \macros
-%D {doPDFbookmark}
-
-\def\doPDFbookmark#1#2#3#4#5%
- {\ifcase#2\else
- \scratchcounter#4\advance\scratchcounter\minusone
- \special{pdf: out \ifcase#5-\fi#2
- % <</Page \the\scratchcounter\space /View [/Fit] /Title (#3)>>}%
- % <</Title (#3) /A <</S /GoTo /D [@page\number#4\space\PDFpageviewwrd]>> >>}%
- <</Title \ifPDFunicode<#3>\else(#3)\fi\space /A <</S /GoTo /D [@page\number#4\space\PDFpageviewwrd]>> >>}%
- \fi}
-
-%D \macros
-%D {doPDFdictionaryobject,doPDFarrayobject}
-
-\def\doPDFdictionaryobject#1#2#3%
- {\special{pdf: object @#1::#2 <<#3>>}}
-
-\def\doPDFarrayobject#1#2#3%
- {\special{pdf: object @#1::#2 [#3]}}
-
-%D \macros
-%D {defaultobjectreference,doPDFgetobjectreference}
-
-\def\defaultobjectreference#1#2{#1::#2}
-
-\def\doPDFgetobjectreference#1#2#3%
- {\dogetobjectreference{#1}{#2}#3%
- \ifx#3\empty\else\edef#3{{#3}}\fi}
-
-% \def\doPDFgetobjectpage #1#2#3{..}
-% \def\doPDFgetobjectpagereference#1#2#3{..}
-
-\def\doPDFgetpagereference#1#2%
- {\edef#2{@page#1}}
-
-%D Done.
-
-\stopspecials
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/spec-dpx.mkii b/Master/texmf-dist/tex/context/base/mkii/spec-dpx.mkii
deleted file mode 100644
index 323152e0b3c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/spec-dpx.mkii
+++ /dev/null
@@ -1,792 +0,0 @@
-%D \module
-%D [ file=spec-dpx,
-%D version=2005.08.12,
-%D title=\CONTEXT\ Special Macros,
-%D subtitle=DVIPDFMx support,
-%D author=Jin-Hwan Cho,
-%D date=\currentdate,
-%D copyright={Jin-Hwan Cho \& Hans Hagen}]
-%C
-%C DVIPDFMx is an eXtended version of the DVIPDFM, a DVI to PDF
-%C translator, still under construction by Jin-Hwan Cho and
-%C Shunsaku Hirata.
-%C
-%C It supports multi-byte character encodings and large character
-%C sets for East Asian languages by CID-keyed font technology,
-%C and many features including PDF encryption, PDF bookmarks and
-%C annotations with Chinese, Japanese, Korean characters, etc.
-%C
-%C DVIPDFMx (and information) can be downloaded from:
-%C
-%C http://project.ktug.or.kr/dvipdfmx/
-
-%D This driver is built on top of the general \PDF\ macros,
-%D as defined in \type{spec-fdf}, so we inherit that one.
-
-\startspecials[dpx][reset,fdf]
-
-%D 1. Modified codes from \type{spec-dpm}
-
-%D \macros
-%D {jobsuffix}
-%D
-%D Because no intermediate output format is used, we set the
-%D jobsuffix to \PDF.
-
-\setjobsuffix{pdf}
-
-%D Map files (experimental)
-
-\definespecial\doloadmapfile#1#2%
- {\flushatshipout{\special{pdf:mapfile +#2}}}
-
-%D DVIPDFMx supports the special command \type{pdf: literal ...}
-%D since the version \type{dvipdfmx-20021028}.
-%D
-%D 1. \type{pdf: literal #1} puts the given PDF commands \#1
-%D after changing the text matrix with \type{"1 0 0 1 x y cm"}
-%D to set the current DVI position $(x,y)$ to the origin.
-%D
-%D 2. \type{pdf: literal reverse #1} puts the given PDF commands \#1
-%D after changing the text matrix with \type{"1 0 0 1 -x -y cm"}.
-%D
-%D 3. \type{pdf: literal direct #1} puts directly the given PDF
-%D commands \#1 without changing the text matrix.
-%D
-%D Since the version \type{dvipdfmx-20050812}, the role of the special
-%D command \type{pdf:literal} is changed so that
-%D
-%D 1. \type{pdf:literal #1} puts the given PDF commands \#1
-%D after changing the text matrix with \type{"1 0 0 1 x y cm"}
-%D to set the current DVI position $(x,y)$ to the origin. After that
-%D it restores the previous setting by changing the text matrix with
-%D \type{"1 0 0 1 -x -y cm"}.
-%D
-%D 2. \type{pdf:literal direct #1} puts directly the given PDF commands
-%D \type {#1} without changing the text matrix.
-%D
-%D Literal \PDF\ inclusion is implemented as:
-
-\def\PDFcode #1{\special{pdf:literal #1}}
-\def\PDFcontentcode#1{\special{pdf:content #1}}
-\def\PDFdirectcode #1{\special{pdf:literal direct #1}}
-
-%D \type{\dosetuppaper} in \type{spec-dpm} did not work properly
-%D because DVIPDFM did not permit changing the page size.
-%D
-%D However, DVIPDFMx permits different page size in each page
-%D since the version \type{dvipdfmx-20021028}.
-%D
-%D \macros
-%D {dosetuppaper}
-%D
-%D A simple one.
-
-\let\PDFpagexyzspec\relax \def\PDFpagexyzspec{@xpos @ypos 0} % untested
-
-\definespecial\dosetuppaper#1#2#3%
- {\bgroup
- \scratchdimen#2\edef\width {\the\scratchdimen\space}%
- \scratchdimen#3\edef\height{\the\scratchdimen\space}%
- \special{pdf:pagesize width \width height \height}%
- \egroup}
-
-%D \macros
-%D {doinsertfile}
-%D
-%D Only \METAPOST, \BMP\ \JPG\ \PNG\ and \PDF\ inclusion are supported.
-
-\definespecial\doinsertfile
- {\dofileinsertion{dpx}\@@DriverImageType}
-
-%D Even though DVIPDFM supports \METAPOST directly, the funtionality
-%D is not good. It conflicts much with \CONTEXT.
-%D
-%D So, \METAPOST will be treated as the same way as PDFTeX using
-%D MPtoPDF in DVIPDFMx since the version \type{dvipdfmx-20021028}.
-
-%D DVIPDFM (and DVIPDFMx too) supports the image files with
-%D the extension, \PDF, \JPG, \PNG, \BMP, and \EPS.
-
-% \def\handleepsimage
-% {\PointsToWholeBigPoints\@@DriverImageWidth \width
-% \PointsToWholeBigPoints\@@DriverImageHeight\height
-% \special
-% {PSfile="\@@DriverImageFile"\space
-% llx=\EPSllx\space lly=\EPSlly\space
-% urx=\EPSurx\space ury=\EPSury\space
-% rwi=\width0\space rhi=\height0}}
-
-% \definefileinsertion{dpx}{mps}{\handleepsimage}
-
-\definefileinsertion{dpx}{mps}
- {\hbox
- {\convertMPtoPDF\@@DriverImageFile{1}{1}%
- \global\let\PDFimagereference\empty}}
-
-\def\handlebmpimage
- {\special{pdf: image
- width \@@DriverImageWidth \space
- height \@@DriverImageHeight\space
- (\@@DriverImageFile)}}
-
-\definefileinsertion{dpx}{pdf}{\handlebmpimage}
-\definefileinsertion{dpx}{jpg}{\handlebmpimage}
-\definefileinsertion{dpx}{png}{\handlebmpimage}
-\definefileinsertion{dpx}{bmp}{\handlebmpimage}
-
-\definefileinsertion{dpx}{mov}{\doPDFinsertmov}
-\definefileinsertion{dpx}{avi}{\doPDFinsertmov}
-
-%D \macros
-%D {doinsertsoundtrack}
-%D
-%D Sounds are supported too.
-
-\definespecial\doinsertsoundtrack{\doPDFinsertsoundtrack}
-
-%D \macros
-%D {doovalbox}
-
-\definespecial\doovalbox{\doPDFovalbox}
-
-%D \macros
-%D {dostartgraymode,dostopgraymode,
-%D dostartrgbcolormode,dostartcmykcolormode,dostartgraycolormode,
-%D dostopcolormode,
-%D dostartrotation,dostoprotation,
-%D dostartscaling,dostopscaling,
-%D dostartmirroring,dostopmirroring,
-%D dostartnegative,dostopnegative}
-%D
-%D Unfortunately the direct \PDF\ inclusion is not suited
-%D for the next macros, which means that we cannot use the
-%D \type {\doPDF..} alternatives. Since \CONTEXT\ maintains
-%D its own colorstack, we use the \DVIPS\ alternatives.
-
-\definespecial\dostartgraymode {\doPDFstartgraymode}
-\definespecial\dostopgraymode {\doPDFstopgraymode}
-\definespecial\dostartrgbcolormode {\doPDFstartrgbcolormode}
-\definespecial\dostartcmykcolormode{\doPDFstartcmykcolormode}
-\definespecial\dostartgraycolormode{\doPDFstartgraycolormode}
-\definespecial\dostartspotcolormode{\doPDFstartspotcolormode}
-\definespecial\dostopcolormode {\doPDFstopcolormode}
-
-\definespecial\doregistercmykspotcolor{\doPDFregistercmykspotcolor}
-\definespecial\doregisterrgbspotcolor {\doPDFregisterrgbspotcolor}
-\definespecial\doregistergrayspotcolor{\doPDFregistergrayspotcolor}
-
-\definespecial\doregistercmykindexcolor{\doPDFregistercmykindexcolor}
-\definespecial\doregisterrgbindexcolor {\doPDFregisterrgbindexcolor}
-\definespecial\doregistergrayindexcolor{\doPDFregistergrayindexcolor}
-
-\definespecial\doregisterfigurecolor{\doPDFregisterfigurecolor}
-
-\definespecial\dostartnonecolormode{\doPDFstartnonecolormode}
-\definespecial\doregisternonecolor {\doPDFregisternonecolor}
-
-\definespecial\dostartrotation #1{\special{pdf:btrans rotate #1}}
-\definespecial\dostoprotation {\special{pdf:etrans}}
-\definespecial\dostartscaling#1#2{\special{pdf:btrans xscale #1 yscale #2}}
-\definespecial\dostopscaling {\special{pdf:etrans}}
-\definespecial\dostartmirroring {\special{pdf:btrans xscale -1}}
-\definespecial\dostopmirroring {\special{pdf:etrans}}
-
-%D Negation is not (yet) supported:
-\definespecial\dostartnegative {\doPDFstartnegative}
-\definespecial\dostopnegative {\doPDFstopnegative}
-\definespecial\dostartoverprint {\doPDFstartoverprint}
-\definespecial\dostopoverprint {\doPDFstopoverprint}
-
-\definespecial\dostarttransparency{\doPDFstarttransparency}
-\definespecial\dostoptransparency {\doPDFstoptransparency}
-
-\PDFtransparencysupportedtrue
-
-\def\@@PDT{@PDT@}
-
-\ifx\PDFcurrenttransparency\undefined
- \newcount\PDFcurrenttransparency \PDFcurrenttransparency=0 % -1
-\fi
-
-\def\assignPDFtransparency#1#2%
- {\def\PDFtransparencyidentifier{/Tr#1}%
- \def\PDFtransparencyreference{@TR:#2}} % todo: \PDFobjref{TR:#2}
-
-\def\presetPDFtransparency#1#2%
- {\initializePDFtransparency
- \executeifdefined{\@@PDT#1:#2}{\dopresetPDFtransparency{#1}{#2}}}
-
-\def\dopresetPDFtransparency#1#2%
- {\global\advance\PDFcurrenttransparency \plusone
- \doPDFreserveDPXobject{TR:\the\PDFcurrenttransparency}{<< >>}% hack
- \special{pdf:\doPDFcheckedDPXobject{TR:\the\PDFcurrenttransparency}\PDFtransparancydictionary{#1}{#2}{}}%
- \edef\PDFtransparencyidentifier{/Tr\the\PDFcurrenttransparency}%
- \edef\PDFtransparencyreference {@TR:\the\PDFcurrenttransparency}%
- \setxvalue{\@@PDT#1:#2}%
- {\noexpand\assignPDFtransparency{\the\PDFcurrenttransparency}{\the\PDFcurrenttransparency}}%
- \appendtoPDFdocumentextgstates
- {\PDFtransparencyidentifier\space
- \PDFtransparencyreference\space}}
-
-\def\initializePDFtransparency
- {\doPDFreserveDPXobject{TR:0}{<< >>}% hack
- \special{pdf:\doPDFcheckedDPXobject{TR:0}\PDFtransparancydictionary{1}{1}{/AIS false}}%
- \xdef\PDFtransparencyresetidentifier{/Tr0}%
- \xdef\PDFtransparencyresetreference{@TR:0}%
- \setxvalue{\@@PDT0:0}%
- {\noexpand\assignPDFtransparency{0}{0}}%
- \appendtoPDFdocumentextgstates
- {\PDFtransparencyresetidentifier\space
- \PDFtransparencyresetreference\space}%
- \global\let\initializePDFtransparency\relax}
-
-%D \macros
-%D {dosetupinteraction,
-%D dosetupopenaction,dosetupcloseaction}
-
-\definespecial\dosetupinteraction
- {\showmessage\m!interactions{21}{DVIPDFMx}}
-
-\definespecial\dosetupopenaction {\doPDFsetupopenaction}
-\definespecial\dosetupcloseaction{\doPDFsetupcloseaction}
-
-%D \macros
-%D {doresetgotowhereever,
-%D dostartthisisrealpage,dostartthisislocation,
-%D dostartgotorealpage,dostartgotolocation,dostartgotoJS}
-
-\definespecial\doresetgotowhereever {\doPDFresetgotowhereever}
-\definespecial\dostartthisislocation{\doPDFstartthisislocation}
-
-\definespecial\dostartgotolocation{\doPDFstartgotolocation}
-\definespecial\dostartgotorealpage{\doPDFstartgotorealpage}
-\definespecial\dostartgotoJS {\doPDFstartgotoJS}
-
-%D \macros
-%D {doflushJSpreamble}
-
-\definespecial\doflushJSpreamble#1%
- {\bgroup
- \let\compositeJScode\empty
- \def\docommand##1%
- {\edef\sanitizedJScode{\getJSpreamble{##1}}%
- \@EA\doPSsanitizeJScode\sanitizedJScode\to\sanitizedJScode
- \special{pdf:object @JS:##1 <</S /JavaScript /JS (\sanitizedJScode)>>}%
- \edef\compositeJScode{\compositeJScode\space (##1) @JS:##1}}%
- \processcommalist[#1]\docommand
- \special{pdf:names /JavaScript [\compositeJScode]}%
- \egroup}
-
-%D \macros
-%D {dostarthide,dostophide}
-
-\definespecial\dostarthide{}
-\definespecial\dostophide {}
-
-%D \macros
-%D {dosetupscreen}
-
-\definespecial\dosetupscreen {\doPDFsetupscreen \printpaperheight}
-
-\definespecial\dosetupartbox {\doPDFsetupartbox \printpaperheight}
-\definespecial\dosetupcropbox {\doPDFsetupcropbox \printpaperheight}
-\definespecial\dosetupbleedbox{\doPDFsetupbleedbox\printpaperheight}
-\definespecial\dosetuptrimbox {\doPDFsetuptrimbox \printpaperheight}
-
-%D \macros
-%D {dostartexecutecommand}
-
-\definespecial\dostartexecutecommand{\doPDFstartexecutecommand}
-
-%D \macros
-%D {dosetupidentity}
-
-\definespecial\dosetupidentity{\doPDFsetupidentity}
-
-%D \macros
-%D {dostartrunprogam}
-
-\definespecial\dostartrunprogram{\doPDFstartrunprogram}
-
-%D \macros
-%D {dostartgotoprofile, dostopgotoprofile,
-%D dobeginofprofile, doendofprofile}
-
-\definespecial\dostartgotoprofile{\doPDFstartgotoprofile}
-
-\definespecial\dobeginofprofile#1#2#3#4%
- {\bgroup
- \setPDFdestination{#1}%
- \scratchdimen#2\edef\width {\the\scratchdimen\space}%
- \scratchdimen#3\edef\height{\the\scratchdimen\space}%
- \doifsomething{\PDFdestination}
- {\special
- {pdf:thread @ART::\PDFdestination\space
- width \width height \height
- <</Title (\PDFdestination)>>}}%
- \egroup}
-
-\definespecial\doendofprofile
- {}
-
-%D \macros
-%D {doinsertbookmark}
-
-\definespecial\doinsertbookmark{\doPDFinsertbookmark}
-
-%D \macros
-%D {dostartobject,dostopobject,doinsertobject}
-%D
-%D Modified to support the color shading feature since version
-%D \type{dvipdfmx-20021128}.
-
-% wd nextbox > #3 ivm offset
-
-% \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
- {\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 @#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>>}%
- \global\let\currentPDFresources\empty
- \fi
- \special{pdf:exobj}}%
- \finalizeobjectbox\nextbox
- \smashbox\nextbox
- \flushatshipout{\box\nextbox}%
- \egroup}%
- \hbox\bgroup}
-
-\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
- \ifx\PDFobjectreference\empty \else
- \special{pdf:uxobj @#1::#2}%
- \fi}}
-
-%D \macros
-%D {dosetpagetransition}
-
-\definespecial\dosetpagetransition{\doPDFsetpagetransition}
-
-%D \macros
-%D {doinsertcomment, doflushcomments}
-
-\definespecial\doinsertcomment{\doPDFinsertcomment}
-\definespecial\doflushcomments{\doPDFflushcomments}
-
-%D \macros
-%D {dopresetlinefield,dopresettextfield,
-%D dopresetchoicefield,dopresetpopupfield,dopresetcombofield,
-%D dopresetpushfield,dopresetcheckfield,
-%D dopresetradiofield,dopresetradiorecord}
-
-\definespecial\dopresetlinefield {\doFDFpresetlinefield}
-\definespecial\dopresettextfield {\doFDFpresettextfield}
-\definespecial\dopresetchoicefield{\doFDFpresetchoicefield}
-\definespecial\dopresetpopupfield {\doFDFpresetpopupfield}
-\definespecial\dopresetcombofield {\doFDFpresetcombofield}
-\definespecial\dopresetpushfield {\doFDFpresetpushfield}
-\definespecial\dopresetcheckfield {\doFDFpresetcheckfield}
-\definespecial\dopresetradiofield {\doFDFpresetradiofield}
-\definespecial\dopresetradiorecord{\doFDFpresetradiorecord}
-
-%D \macros
-%D {dodefinefieldset,dogetfieldset,doiffieldset}
-
-\definespecial\dodefinefieldset{\doFDFdefinefieldset}
-\definespecial\dogetfieldset {\doFDFgetfieldset}
-\definespecial\doiffieldset {\doFDFiffieldset}
-
-%D \macros
-%D {doregistercalculationset}
-
-\definespecial\doregistercalculationset{\doFDFregistercalculationset}
-
-%D \type{\doPDFdestination} in \type{spec-dpm} had a bug.
-%D
-%D \macros
-%D {doPDFdestination}
-
-\def\doPDFdestination#1%
- {\special{pdf:names /Dests (#1) [@thispage \PDFpageviewwrd]}}
-
-%D \macros
-%D {doPDFaction,doPDFannotation,ifsharePDFactions}
-%D
-%D Sharing is not yet supported.
-
-\newif\ifsharePDFactions \sharePDFactionsfalse
-
-\def\dodoPDFaction#1#2#3#4%
- {\ifcollectreferenceactions
- \xdef\lastPDFaction{#4}%
- \else
- \bgroup
- % this is yet untested
- %\ifsharePDFactions
- % \ifcase\similarreference\relax
- % \xdef\lastPDFaction{<<#4>>}%
- % \or
- % \global\advance\nofPDFsimilar by 1
- % \special{pdf: object @PDF::sim:\the\nofPDFsimilar\space<<#4>>}%
- % \xdef\lastPDFaction{@PDF::sim:\the\nofPDFsimilar}%
- % \else
- % % leave \lastPDFaction untouched
- % \fi
- %\else
- \xdef\lastPDFaction{<<#4>>}%
- %\fi
- \scratchdimen#2\edef\width {\the\scratchdimen\space}%
- \scratchdimen#3\edef\height{\the\scratchdimen\space}%
- \special{pdf:ann #1 width \width height \height
- <</Subtype /Link /Border [0 0 0]
- \ifhighlighthyperlinks \else /H /N \fi
- /A \lastPDFaction\space>>}%
- \egroup
- \fi}
-
-\def\doPDFaction#1#2#3%
- {\dodoPDFaction\empty{#1}{#2}{#3}}
-
-%D \type{\doPDFannotation} in \type{spec-dpm} had a bug.
-%D
-%D \type{\doPDFannotation} conflicts with \type{\doPDFinsertmov},
-%D since width and height also defined in \type{\doPDFinsertmov}.
-
-\def\doPDFannotation#1#2#3%
- {\bgroup
- \edef\data{#3}%
- \scratchdimen#1\edef\width {\the\scratchdimen\space}%
- \scratchdimen#2\edef\height{\the\scratchdimen\space}%
- \special{pdf:ann width \width height \height <<\data>>}%
- \egroup}
-
-%D \macros
-%D {doPDFannotationobject,doPDFactionobject}
-
-\def\doPDFannotationobject#1#2#3#4#5%
- {\bgroup
- \scratchdimen#3\edef\width {\the\scratchdimen\space}%
- \scratchdimen#4\edef\height{\the\scratchdimen\space}%
- \special{pdf:ann @#1::#2 width \width height \height <<#5>>}%
- \dosetobjectreference{#1}{#2}{@#1::#2}%
- \egroup}
-
-\def\doPDFactionobject#1#2#3#4#5%
- {\dodoPDFaction{@#1::#2}{#3}{#4}{#5}%
- \dosetobjectreference{#1}{#2}{@#1::#2}}
-
-%D \macros
-%D {doPDFaddtocatalog,doPDFaddtoinfo,
-%D doPDFpageattribute,doPDFpagesattribute}
-
-% we could move much more to spec-fdf
-
-% \ifx\pdfcatalog \undefined \newtoks\pdfcatalog \fi
-% \ifx\pdfinfo \undefined \newtoks\pdfinfo \fi
-% \ifx\pdfpageattr \undefined \newtoks\pdfpageattr \fi
-% \ifx\pdfpageresources\undefined \newtoks\pdfpageresources \fi
-% \ifx\pdfpagesattr \undefined \newtoks\pdfpagesattr \fi
-
-% \def\doPDFaddtocatalog #1{\expanded{\global\pdfcatalog {#1\the\pdfcatalog }}}
-% \def\doPDFaddtoinfo #1{\expanded{\global\pdfinfo {#1\the\pdfinfo }}}
-% \def\doPDFpageattribute #1{\expanded{\global\pdfpageattr {#1\the\pdfpageattr }}}
-% \def\doPDFpageresource #1{\expanded{\global\pdfpageresources{#1\the\pdfpageresources}}}
-% \def\doPDFpagesattribute#1{\expanded{\global\pdfpagesattr {#1\the\pdfpagesattr }}}
-
-% \def\doPDFresetpageattributes{\global\pdfpageattr\emptytoks}
-% \def\doPDFresetpageresources {\global\pdfpageresources\emptytoks}
-
-% \appendtoks
-% \special{pdf: put @catalog <<#1>>}%
-% \special{pdf: docinfo <<#1>>}%
-% \special{pdf: put @pages <<#1>>}%
-% \to \everylastshipout
-
-% \appendtoks
-% \special{pdf: put @thispage <<#1>>}%
-% \to\everyshipout
-
-\def\doPDFaddtocatalog#1%
- {\special{pdf:put @catalog <<#1>>}}
-
-\def\doPDFaddtoinfo#1%
- {\special{pdf:put @docinfo <<#1>>}}
-
-\def\doPDFpageattribute#1%
- {\special{pdf:put @thispage <<#1>>}}
-
-\def\doPDFpagesattribute#1%
- {\special{pdf:put @pages <<#1>>}}
-
-\def\doPDFpageresource#1%
- {\special{pdf:put @resources <<#1>>}}
-
-\let\doPDFresetpageresources \relax
-\let\doPDFresetpageattributes\relax
-
-%D \type{\doPDFbookmark} in \type{spec-dpm} had a bug.
-%D The openbookmark option \#5 is not supported yet.
-%D
-%D \macros
-%D {doPDFbookmark}
-
-\def\doPDFbookmark#1#2#3#4#5%
- {\ifcase#1\else
- %\scratchcounter#4\advance\scratchcounter\minusone
- \special{pdf:outline #1 %\ifcase#5 opened\fi
- % <</Title (#3) /A <</S /GoTo /D (page:\the\scratchcounter)>>>>}%
- % <</Title (#3) /A <</S /GoTo /D [@page\number#4\space\PDFpageviewwrd]>> >>}%
- <</Title \ifPDFunicode<#3>\else(#3)\fi\space /A <</S /GoTo /D [@page\number#4\space\PDFpageviewwrd]>> >>}%
- \fi}
-
-%D \macros
-%D {doPDFdictionaryobject,doPDFarrayobject}
-
-% Dvipdfmx can't handle
-%
-% \special{pdf:put @foo << /Bar @bar >>}
-% \special{pdf:put @bar << /Foo @foo >>}
-%
-% Objects must be defined before they are used.
-%
-% \special{pdf:obj @foo << >>}
-% \special{pdf:obj @bar << >>}
-% \special{pdf:put @foo << /Bar @bar >>}
-% \special{pdf:put @bar << /Foo @foo >>}
-%
-% However, this only works for dictionary and array.
-
-\def\doPDFreserveDPXobject#1#2%
- {\ifundefined{r:pdx:d:#1}%
- % we need a \flushatshipoutprep (prepended, normally appended)
- \flushatshipout{\special{pdf:object @#1 #2}}%
- \global\letvalue{r:pdx:d:#1}\empty
- \fi}
-
-\def\doPDFreserveDPXobjectfirst#1#2%
- {\ifundefined{r:pdx:d:#1}%
- \doglobal\prependtoks\special{pdf:object @#1 #2}\to\everyfirstshipout
- \global\letvalue{r:pdx:d:#1}\empty
- \fi}
-
-\def\doPDFcheckedDPXobject#1{\ifundefined{r:pdx:d:#1}object\else put\fi\space @#1\space}
-
-% new, experimental, can save a run, bugged, too many xforms now
-%
-% \def\doreservePDFobject#1#2%
-% {\dosetobjectreference{#1}{#2}{@#1::#2}}
-%
-% \def\doPDFreserveddictionaryobject#1#2#3%
-% {\flushatshipout{\special{pdf:object @#1::#2 << #3 >>}}}
-%
-% \def\doPDFreservedarrayobject#1#2#3%
-% {\flushatshipout{\special{pdf:object @#1::#2 [ #3 ]}}}
-%
-% \doreservePDFobject{FDF}{docuextgstates}
-% \doreservePDFobject{FDF}{colorspaces}
-% \doreservePDFobject{FDF}{docushades}
-
-% so this is to be checked
-
-\def\doPDFdictionaryobject#1#2#3%
- {\flushatshipout
- {\special{pdf:\doPDFcheckedDPXobject{#1::#2}<<#3>>}%
- \dosetobjectreference{#1}{#2}{@#1::#2}}}
-
-\def\doPDFarrayobject#1#2#3%
- {\flushatshipout
- {\special{pdf:\doPDFcheckedDPXobject{#1::#2}[#3]}%
- \dosetobjectreference{#1}{#2}{@#1::#2}}}
-
-%D \macros
-%D {defaultobjectreference,doPDFgetobjectreference}
-
-\def\defaultobjectreference#1#2{@#1::#2}
-
-%D \type{\doPDFgetobjectreference} in \type{spec-dpm} had a bug.
-
-\def\doPDFgetobjectreference#1#2#3%
- {\dogetobjectreference{#1}{#2}#3%
- \ifx#3\empty\else\edef#3{#3}\fi}
-
-\def\doPDFgetpagereference#1#2%
- {\edef#2{@page#1}}
-
-%D Done.
-
-% %D 2. Modified codes from \type{spec-fdf}
-%
-% \definespecial\dostartgraphicgroup{\special{pdf: literal direct q}}
-% \definespecial\dostopgraphicgroup {\special{pdf: literal direct Q}}
-
-%D 3. Copied codes from \type{spec-tpd}
-
-%D \macros
-%D {dostartclipping,dostopclipping}
-%D
-%D Clipping in \PDFTEX\ is rather trivial. We can even hook
-%D in \METAPOST\ without problems.
-
-\definespecial\dostartclipping#1#2#3%
- {\PointsToBigPoints{#2}\width
- \PointsToBigPoints{#3}\height
- \grabMPclippath{#1}{1}\width\height
- {0 0 m \width\space 0 l \width \height l 0 \height l}%
- \PDFcode
- {q 0 w \MPclippath\space W n}}
-
-\definespecial\dostopclipping
- {\PDFcode{Q n}}
-
-%D 4. Modified codes from \type{supp-pdf}
-
-\def\dosetMPsomePDFshade#1#2%
- {\global\advance\currentPDFshade \plusone
- \special{pdf:object @ftn:Sh:\currentPDFshade\space
- <</FunctionType 2
- /Domain [\gMPs1 \gMPs2]
- /C0 [\MPshadeA]
- /C1 [\MPshadeB]
- /N \gMPs3>>}%
- \special{pdf:object @obj:Sh:\currentPDFshade\space
- <</ShadingType #1
- /ColorSpace /\MPresolvedspace
- /Function @ftn:Sh:\currentPDFshade\space
- /Coords [\MPshadeC]
- /Extend [true true]>>}%
- \appendtoPDFdocumentshades{/Sh\the\currentPDFshade\space @obj:Sh:\currentPDFshade}%
- \setxvalue{\@@MPSK#2}{\noexpand\dohandleMPshade{\the\currentPDFshade}}}
-
-\def\handleMPfigurespecial#1#2#3#4#5#6#7% toto : combine with ext fig
- {\doiffileelse{#7}
- {\vbox to \zeropoint
- {\vss
- \hbox to \zeropoint
- {\special{pdf:btrans matrix #1 #2 #3 #4 #5 #6}%
- \rlap{\special{pdf:image width 1bp height 1bp (#7)}}
- \special{pdf:etrans}\hss}}}
- {\message{[unknown figure #7]}}}
-
-%D 5. Modified codes from \type{supp-pdf}
-
-\let\handleMPfshow\dohandleMPfshow
-
-\newcounter\MPPDFcounter
-
-\newcounter\MPPDFobjectcounter
-
-\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}}%
- \finalizeobjectbox#2%
- \box#2%
- \doDVIPDFMXstopobject}
-
-\let\getMPPDFobject\gobbletwoarguments
-
-\definespecial\doinsertMPfile#1%
- {\doiffileelse{./#1}{\includeMPasPDF{./#1}}{\message{[MP #1]}}}
-
-%D Experimental (untested):
-
-\definespecial\dostartfonteffect#1#2#3%
- {\ifdim#2>\zeropoint
- \PointsToBigPoints{#2}\ascii
- \PDFdirectcode{\ascii\space w}%
- \fi
- \ifdim#3\points=\onepoint\else
- \scratchdimen#3\points
- \PDFdirectcode{\withoutpt{\the\scratchdimen}\space Tc}%
- \fi
- \PDFdirectcode{\purenumber#1 Tr}}
-
-\definespecial\dostopfonteffect
- {\PDFdirectcode{1 w 0 Tc 0 Tr}}
-
-%D 6. Modified codes from \type{core-obj}
-%D
-%D In the viewpoint of TeX, the special command \type{pdf:uxobj @obj}
-%D generates a box with zero point width and zero point height so that
-%D it must be careful to place the box at the reference point.
-
-\def\dogetobject#1#2#3#4#5#6#7% don't change this, should work for dvi & pdf
- {\initializepaper
- \forgetall
- \dontshowcomposition
- \setbox\scratchbox\vbox
- {\doinsertobject{#1}{#2}}%
- \setbox\scratchbox#3%
- {\vbox to #5\scaledpoint
- {\ifdim\ht\scratchbox>#5\scaledpoint
- \vss\hbox to #4\scaledpoint{\hss\box\scratchbox\hss}\vss
- \else\ifdim\wd\scratchbox>#4\scaledpoint
- \vss\hbox to #4\scaledpoint{\hss\box\scratchbox\hss}\vss
- \else
- %\vss\box\scratchbox
- \vss\hbox to #4\scaledpoint{\box\scratchbox\hss}%
- \fi\fi}}%
- \box\scratchbox
- \elabelgroup}
-
-\stopspecials
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/spec-dvi.mkii b/Master/texmf-dist/tex/context/base/mkii/spec-dvi.mkii
deleted file mode 100644
index 89a1330a2e5..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/spec-dvi.mkii
+++ /dev/null
@@ -1,116 +0,0 @@
-%D \module
-%D [ file=spec-dvi,
-%D version=1996.01.25,
-%D title=\CONTEXT\ Special Macros,
-%D subtitle=Generic \TEX\ Solutions,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 \macros
-%D {dostartobject,
-%D dostopobject,
-%D doinsertobject}
-%D
-%D Reuse of object is not supported by the \DVI\ format. We
-%D therefore just duplicate them using boxes.
-
-\setjobsuffix{dvi} % can be overloaded in other spec's
-
-\startspecials[tex]
-
-\newbox\DVIobjects \newcounter\DVIobjectcounter
-
-\definespecial\dostartobject#1#2#3#4#5%
- {\setbox\nextbox\vbox\bgroup
- \def\dodostopobject
- {\egroup
- \doglobal\increment\DVIobjectcounter
- \global\setbox\DVIobjects\vbox
- {\offinterlineskip
- \forgetall
- \unvbox\DVIobjects
- \setbox\nextbox\hbox{\box\nextbox}%
- \wd\nextbox\zeropoint
- \dp\nextbox\zeropoint
- \ht\nextbox\onepoint
- \allowbreak
- \box\nextbox}%
- \dosetobjectreference{#1}{#2}{\DVIobjectcounter}}}
-
-\definespecial\dostopobject
- {\dodostopobject}
-
-\definespecial\doinsertobject#1#2%
- {\bgroup
- \dogetobjectreference{#1}{#2}\DVIobjectreference
- \splittopskip\zeropoint
- \setbox0=\copy\DVIobjects
- \dimen0=\DVIobjectreference\onepoint
- \advance\dimen0 -\onepoint
- \setbox2\vsplit0 to \dimen0
- \ifdim\ht0>\onepoint
- \setbox0\vsplit0 to \onepoint
- \fi
- \unvbox0
- \setbox0\lastbox
- \hbox{\unhbox0}% the \hbox is really needed!
- \egroup}
-
-%D \macros
-%D {dosetposition,
-%D dosetpositionwhd,
-%D dosetpositionplus}
-%D
-%D The next specials only identify a position. It is up to
-%D a \DVI\ postprocessing utility to merge the right commands
-%D into the utility file. Since in \CONTEXT, we only deal
-%D with relative positions, the reference point is not so
-%D important.
-%D
-%D The postprocessor should translate the specials into
-%D commands and append these to \type {jobname.tuo} using the
-%D format:
-%D
-%D \starttyping
-%D \pospxy {identifier}{page}{x}{y}
-%D \pospxywhd {identifier}{page}{x}{y}{w}{h}{d}
-%D \pospxyplus{identifier}{page}{x}{y}{w}{h}{d}{list}
-%D \stoptyping
-%D
-%D The postprocessor should, of course, provide the \type
-%D {page}, \type {x}, and \type {y} values.
-
-%D Now in spec-mis.tex:
-
-% \definespecial\dosetposition#1%
-% {\special{pos:pxy "#1"}}
-%
-% \definespecial\dosetpositionwhd#1#2#3#4%
-% {\special{pos:pxywhd "#1" #2 #3 #4}}
-%
-% \definespecial\dosetpositionplus#1#2#3#4#5%
-% {\special{pos:pxyplus "#1" #2 #3 #4 #5}}
-
-%D The next special tells the position postprocessor what
-%D page dimensions were used.
-
-%D Also in spec-mis.tex:
-
-% \let\flushDVIpositionpapersize\relax
-%
-% \definespecial\dosetpositionpapersize#1#2%
-% {\xdef\flushDVIpositionpapersize%
-% {\special{pos:papersize \number#1 \number#2}%
-% \noexpand\installprogram{dvipos -o \jobname.tuo \jobname.dvi }%
-% \global\noexpand\let\noexpand\flushDVIpositionpapersize\relax}}
-%
-% \prependtoksonce \flushDVIpositionpapersize \to \everyshipout
-
-\stopspecials
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/spec-fdf.mkii b/Master/texmf-dist/tex/context/base/mkii/spec-fdf.mkii
deleted file mode 100644
index 0713fa80cd1..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/spec-fdf.mkii
+++ /dev/null
@@ -1,3532 +0,0 @@
-%D \module
-%D [ file=spec-fdf,
-%D version=1998.05.18,
-%D title=\CONTEXT\ \PDF\ Macros,
-%D subtitle=Support Macros,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 name of this module is a bit strange but it started with fields
-%D so we keep the name.
-
-%D When dealing with resources, we share the resource dictionaries
-%D between all xforms. This is inefficent in the sense that when no
-%D resources are used, redundant entries take space, but on the other
-%D hand we save redundant dictionaries so it's a nice compromise. Maybe
-%D that in \LUATEX\ I will reimplement most of the code here anyway.
-
-%D We need to check if we can use \type {\driverreferenced}
-%D object in more places.
-
-%D Initialization of fields is tricky. If a field has no
-%D value, it is kind of not there. If ResetForm is used, the
-%D default is assigned, but pushbuttons are spoiled. Adding a
-%D \type {/MK} dictionary helps, but gives ugly down
-%D appearances (displaced with background). What a mess.
-%D Also, in order to get at least something, the \type {/AS}
-%D key should be provided.
-
-% to do : /IF << /SW /N >> == no scaling / clipping of widget
-
-\unprotect
-
-%D \macros
-%D {PDFobjref}
-%D
-%D Just a shortcut.
-
-% Watch out, \def\PDFobjref#1{\purenumber#1 0 R} also works, but not when
-% #1 == \the\whatever
-
-\def\PDFobjref#1{\purenumber{#1} 0 R}
-
-%D \macros
-%D {PDFswapdir}
-
-\let\PDFswapdir\empty \def\PDFswapdir{\ifcase\inlinedirection\or\or-\fi}
-
-% 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
-
-%D \macros
-%D {setPDFdestination}
-%D
-%D \PDF\ destinations should obey the specifications laid down
-%D in the \PDF\ reference manual. The next macro strips illegal
-%D characters from the destination name.
-%D
-%D The \ACROBAT\ programs are not bug free. By setting the next
-%D switches, we will at least try to prevent problems.
-
-\newif\ifovercomePDFbugs \overcomePDFbugsfalse % dest sort problem / 3-
-\newif\ifovercomePDFspace \overcomePDFspacetrue % dest sort problem / 3-
-
-\let\setPDFdestination\gobbleoneargument % a MK specific definition
-
-%D \macros
-%D {sanitizePDFstring}
-%D
-%D This macro at least tries to convert a arbitrary string
-%D into a sequence of characters valid for \PDF\ bookmarks and
-%D alike.
-
-\def\sanitizePDFstring#1\to#2{}
-
-%D \macros
-%D {doPDFdestination,
-%D doPDFaction,
-%D doPDFannotation,
-%D doPDFannotationobject,
-%D doPDFdictionaryobject,
-%D doPDFarrayobject,
-%D doPDFaddtocatalog,
-%D doPDFaddtoinfo,
-%D doPDFpageattribute,
-%D doPDFpageresource,
-%D doPDFpagesattribute,
-%D doPDFbookmark,
-%D defaultobjectreference,
-%D doPDFgetobjectreference}
-%D
-%D This module deals with \PDF\ support, including fill||in
-%D forms. Before we present the largely unreadable bunch of
-%D macros, we introduce the here||not||defined low level
-%D interface macros. These must be provided by the special
-%D drivers \type{pdf} (\ACROBAT) and \type{tpd} (\PDFTEX).
-%D
-%D \starttyping
-%D \doPDFdestination #1 name
-%D \doPDFaction #1#2#3 width height action
-%D \doPDFannotation #1#2#3 width height data
-%D \doPDFannotationobject #1#2#3#4#5 class name width height data
-%D \doPDFdictionaryobject #1#2#3 class name data
-%D \doPDFarrayobject #1#2#3 class name data
-%D \doPDFaddtocatalog #1
-%D \doPDFaddtoinfo #1
-%D \doPDFpageattribute #1
-%D \doPDFpageresource #1
-%D \doPDFpagesattribute #1
-%D \doPDFbookmark #1#2#3#4#5 level n text page open
-%D
-%D \defaultobjectreference #1#2 class name
-%D \doPDFgetobjectreference #1#2#3 class name \PDFobjectreference
-%D \doPDFgetobjectpagereference #1#2#3 class name \PDFobjectreference
-%D \stoptyping
-%D
-%D The keywords reflect their use. For the moment we stick to
-%D keywords, because that way at we get an indication of what
-%D we're doing.
-
-\startspecials[fdf]
-
-%D Common:
-
-% \def\doPDFgetobjectreference#1#2#3%
-% {\def#3{..}}
-
-\def\doPDFgetobjectpage#1#2#3%
- {\dogetobjectreferencepage{#1}{#2}#3%
- \ifx#3\empty\def#3{\realfolio}\fi}
-
-\def\doPDFgetobjectpagereference#1#2#3%
- {\dogetobjectreferencepage{#1}{#2}#3%
- \ifx#3\empty
- \doPDFgetpagereference\realfolio#3%
- \else
- \doPDFgetpagereference#3#3% we assume that #3 gets expanded
- \fi}
-
-% \def\doPDFgetpagereference#1#2%%%%%%%%%%%%%%%
-% {\def#2{...}}
-
-%D Due to the fact that \PDFTEX\ has a different concept of
-%D page attributes, we need:
-
-\let\doPDFresetpageattributes\relax
-\let\doPDFresetpageresources \relax
-
-\appendtoksonce
- \doPDFresetpageattributes
- \doPDFresetpageresources
-\to \everyaftershipout
-
-\ifx\PDFcode\undefined
- \ifx\pdfliteral\undefined
- \def\PDFcode#1{\message{[ignored pdfliteral: #1]}}
- \else
- \let\PDFcode\pdfliteral
- \fi
-\fi
-
-%D For special (\METAPOST) effects, we need to build
-%D resource dictionaries. Here is the framework.
-
-\let\docuPDFextgstates\empty
-%let\pagePDFextgstates\empty
-
-\def\checkPDFextgstates
- {\ifx\docuPDFextgstates\empty \else
- \ifnum\realpageno=\lastpage\relax
- %\doPDFreserveddictionaryobject{FDF}{docuextgstates}{\docuPDFextgstates}%
- \doPDFdictionaryobject{FDF}{docuextgstates}{\docuPDFextgstates}%
- \fi
- \doPDFgetobjectreference{FDF}{docuextgstates}\PDFobjectreference
- \doPDFpageresource{/ExtGState \PDFobjectreference}%
- \fi}
-
-\appendtoksonce
- \checkPDFextgstates
-\to \everyshipout
-
-\def\appendtoPDFdocumentextgstates#1%
- {\xdef\docuPDFextgstates{\docuPDFextgstates\space#1}}
-
-%D Patterns (for tikz)
-
-\let\docuPDFpatterns\empty
-
-\def\checkPDFpatterns
- {\ifx\docuPDFpatterns\empty \else
- \ifnum\realpageno=\lastpage\relax
- \doPDFdictionaryobject{FDF}{docupatterns}{\docuPDFpatterns}%
- \fi
- \doPDFgetobjectreference{FDF}{docupatterns}\PDFobjectreference
- \doPDFpageresource{/Pattern \PDFobjectreference}%
- \fi}
-
-\appendtoksonce
- \checkPDFpatterns
-\to \everyshipout
-
-\def\appendtoPDFdocumentpatterns#1%
- {\xdef\docuPDFpatterns{\docuPDFpatterns\space#1}}
-
-%D Another special mechanism (needed for color separation):
-
-\let\docuPDFcolorspaces\empty
-
-\def\checkPDFcolorspaces
- {\ifx\docuPDFcolorspaces\empty \else
- \ifnum\realpageno=\lastpage\relax
- %\doPDFreserveddictionaryobject{FDF}{colorspaces}{\docuPDFcolorspaces}%
- \doPDFdictionaryobject{FDF}{colorspaces}{\docuPDFcolorspaces}%
- \fi
- \doPDFgetobjectreference{FDF}{colorspaces}\PDFobjectreference
- \doPDFpageresource{/ColorSpace \PDFobjectreference}%
- \fi}
-
-\appendtoksonce
- \checkPDFcolorspaces
-\to \everyshipout
-
-\def\appendtoPDFdocumentcolorspaces#1%
- {\xdef\docuPDFcolorspaces{\docuPDFcolorspaces\space#1}}
-
-%D And another one (used to be in spec-pdf)
-
-\let\docuPDFshades\empty
-
-\def\checkPDFshades
- {\ifx\docuPDFshades\empty \else
- \ifnum\realpageno=\lastpage\relax
- %\doPDFreserveddictionaryobject{FDF}{docushades}{\docuPDFshades}%
- \doPDFdictionaryobject{FDF}{docushades}{\docuPDFshades}%
- \fi
- \doPDFgetobjectreference{FDF}{docushades}\PDFobjectreference
- \doPDFpageresource{/Shading \PDFobjectreference}%
- \fi}
-
-\appendtoksonce
- \checkPDFshades
-\to \everyshipout
-
-\def\appendtoPDFdocumentshades#1%
- {\xdef\docuPDFshades{\docuPDFshades\space#1}}
-
-%D \macros
-%D {doPDFsetupscreen,doPDFsetupidentity}
-%D
-%D Opposite to \DVI\ drivers, \PDF\ ones must know which what
-%D page dimensions they are dealing. We also use the
-%D opportunity to launch full screen (1) or show bookmarks (2).
-
-\let\currentPDFpagemode \empty % document catalog
-\let\currentPDFviewerprefs\empty % document catalog
-
-\let\currentPDFcropbox \empty % page attributes
-\let\currentPDFbleedbox \empty % page attributes
-\let\currentPDFartbox \empty % page attributes
-\let\currentPDFtrimbox \empty % page attributes
-
-\def\doPDFsetupscreen#1#2#3#4#5#6% watch the extra argument
- {\bgroup
-% \!!widtha#4%
-% \advance\!!widtha#2%
-% \!!heighta-#5%
-% \!!heightb#1% extra argument
-% \advance\!!heightb -#3%
-% \advance\!!heighta \!!heightb
-% % sometimes whole values give better results
-% % \PointsToWholeBigPoints{#2}\left
-% % \PointsToWholeBigPoints\!!heighta\bottom
-% % \PointsToWholeBigPoints\!!widtha \width
-% % \PointsToWholeBigPoints\!!heightb\height
-% % but since pdf/x does not round when checking if
-% % the boxes fit inside the media box ...
-% \PointsToBigPoints{#2}\left
-% \PointsToBigPoints\!!heighta\bottom
-% \PointsToBigPoints\!!widtha \width
-% \PointsToBigPoints\!!heightb\height
-% \xdef\currentPDFcropboxspec
-% {[\left\space\bottom\space\width\space\height]}%
-% \global\let\currentPDFtrimboxspec\currentPDFcropboxspec
-%
-% \xdef\currentPDFpagemode
-% {/PageMode \ifcase#6
-% /UseNone\or/FullScreen\or/UseOutlines\else/UseNone\fi}%
-%
- \xdef\currentPDFpagemode
- {\ifnum#6=4
- /PageLayout /TwoColumnRight
- \else
- /PageMode \ifcase#6
- /UseNone\or/FullScreen\or/UseOutlines\else/UseNone\fi
- \fi}%
- \xdef\currentPDFviewerprefs % space after #6 needed, else \relax
- {\ifcase#6 \or\or\else /ViewerPreferences << /FitWindow true >>\fi}%
- \egroup}
-
-% not that good if we switch drivers
-
-\def\addPDFdocumentinfo
- {\doPDFaddtocatalog{\currentPDFpagemode\currentPDFviewerprefs}%
- \doPDFaddtocatalog{/Version /\PDFversion}%
- \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)}}
-
-\appendtoksonce % hack to prevent duplicates
- \addPDFdocumentinfo
-\to \everyfirstshipout
-
-\ifx\pdfminorversion\undefined
- \ifx\pdfoptionpdfminorversion\undefined
- \newcount\pdfminorversion
- \else
- \let\pdfminorversion\pdfoptionpdfminorversion
- \fi
-\fi
-
-\pdfminorversion=5
-
-\def\PDFversion{1.\number\pdfminorversion}
-
-\appendtoksonce
- \def\PDFversion{1.\the\pdfminorversion}%
- \let\addPDFdocumentinfo\relax
-\to \everyresetspecials
-
-\def\doPDFsetupwhateverbox#1#2#3#4#5#6% watch the extra arguments
- {\bgroup
- \!!widtha \dimexpr#5+#3\relax
- \!!heightb\dimexpr#2-#4\relax
- \!!heighta\dimexpr\!!heightb-#6\relax
- % sometimes whole values give better results
- % \PointsToWholeBigPoints{#3}\left
- % \PointsToWholeBigPoints\!!heighta\bottom
- % \PointsToWholeBigPoints\!!widtha \width
- % \PointsToWholeBigPoints\!!heightb\height
- % but since pdf/x does not round when checking if
- % the boxes fit inside the media box ...
- \PointsToBigPoints{#3}\left
- \PointsToBigPoints\!!heighta\bottom
- \PointsToBigPoints\!!widtha \width
- \PointsToBigPoints\!!heightb\height
- \xdef#1{[\left\space\bottom\space\width\space\height]}%
- \egroup}
-
-\def\doPDFsetupartbox {\doPDFsetupwhateverbox\currentPDFartbox }
-\def\doPDFsetupcropbox {\doPDFsetupwhateverbox\currentPDFcropbox }
-\def\doPDFsetupbleedbox{\doPDFsetupwhateverbox\currentPDFbleedbox}
-\def\doPDFsetuptrimbox {\doPDFsetupwhateverbox\currentPDFtrimbox }
-
-\gdef\currentPDFtrimbox{\currentPDFcropbox} % default, needed for pdf/x
-
-\def\flushPDFwhateverbox#1#2%
- {\doifsomething{#1}{\doPDFpageattribute{/#2Box #1}}}
-
-\def\flushPDFpageboxes
- {\flushPDFwhateverbox\currentPDFartbox {Art}%
- \flushPDFwhateverbox\currentPDFcropbox {Crop}%
- \flushPDFwhateverbox\currentPDFbleedbox{Bleed}%
- \flushPDFwhateverbox\currentPDFtrimbox {Trim}}
-
-\appendtoksonce
- \flushPDFpageboxes
-\to \everyshipout
-
-% \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 (\!!stringa)
-% /ID (\jobname.\!!stringa) % needed for pdf/x
-% /Keywords (#6)}}%
-% \egroup}
-
-\def\doPDFsetupidentity#1#2#3#4#5#6%
- {\bgroup
- \enablePDFdocencoding
- \sanitizePDFencoding#1\to\idtitle \stripstring\idtitle
- \sanitizePDFencoding#2\to\idsubject\stripstring\idsubject
- \sanitizePDFencoding#3\to\idauthor \stripstring\idauthor
- \sanitizePDFencoding#4\to\idcreator\stripstring\idcreator
- \sanitizePDFencoding#6\to\idkeyword\stripstring\idkeyword
- \expanded{\doPDFaddtoinfo
- {/Title \ifPDFunicode<\idtitle >\else(\idtitle )\fi
- /Subject \ifPDFunicode<\idsubject>\else(\idsubject)\fi
- /Author \ifPDFunicode<\idauthor >\else(\idauthor )\fi
- /Creator \ifPDFunicode<\idcreator>\else(\idcreator)\fi
- /ModDate (#4)
- /ID (\jobname.#5) % needed for pdf/x
- /Keywords \ifPDFunicode<\idkeyword>\else(\idkeyword)\fi}}%
- \egroup}
-
-%D \macros
-%D {doPDFsetupopenaction,doPDFsetupcloseaction,
-%D doPDFsetupopenpageaction,doPDFsetupclosepageaction}
-%D
-%D Setting the open and close actions is kind of fuzzy
-%D because action chains are derived from the reference
-%D mechanism.
-
-%D Starting with version~5 viewers, when the open actions
-%D started yto give problems, for testing purposes we
-%D decided use indirect actions.
-
-% \definespecial\dosetupopenaction {\doPDFsetupopenaction}
-% \definespecial\dosetupcloseaction {\doPDFsetupcloseaction}
-% \definespecial\dosetupopenpageaction {\doPDFsetupopenpageaction}
-% \definespecial\dosetupclosepageaction{\doPDFsetupclosepageaction}
-
-\let\lastPDFaction\empty
-
-%D We can safe a couple of references by moving this code
-%D to the specific drivers.
-%D
-%D The following code used to work okay, but as with any
-%D update of Acrobat Viewers, upward compatibility was
-%D just a dream.
-
-\definespecial\dosetupopenaction {\doPDFaddtocatalog{/OpenAction <<\lastPDFaction>>}}
-\definespecial\dosetupcloseaction{\doPDFaddtocatalog{/CloseAction <<\lastPDFaction>>}}
-
-% todo: /AA << dictionary in catalog >>
-
-% \globalletempty\PDFdocumentclose
-% \globalletempty\PDFwillsave
-% \globalletempty\PDFdidsave
-% \globalletempty\PDFwillprint
-% \globalletempty\PDFdidprint
-
-% \definespecial\dosetupdocumentcloseaction {\global\let\PDFdocumentclose\lastPDFaction}
-% \definespecial\dosetupwillsaveaction {\global\let\PDFwillsave \lastPDFaction}
-% \definespecial\dosetupdidsaveaction {\global\let\PDFdidsave \lastPDFaction}
-% \definespecial\dosetupwillprintaction {\global\let\PDFwillprint \lastPDFaction}
-% \definespecial\dosetupdidprintaction {\global\let\PDFdidprint \lastPDFaction}
-
-% \def\checkPDFdocumentactions
-% {\iflocation
-% \doPDFpageattribute
-% {/AA <<\ifx\PDFdocumentclose\empty \else /DC <<\PDFdocumentclose>> \fi
-% \ifx\PDFwillsave \empty \else /WS <<\PDFwillsave >> \fi
-% \ifx\PDFdidsave \empty \else /DS <<\PDFdidsave >> \fi
-% \ifx\PDFwillprint \empty \else /WP <<\PDFwillprint >> \fi
-% \ifx\PDFdidprint \empty \else /DP <<\PDFdidprint >> \fi>>}%
-% % \globalletempty\PDFdocumentclose
-% % \globalletempty\PDFwillsave
-% % \globalletempty\PDFdidsave
-% % \globalletempty\PDFwillprint
-% % \globalletempty\PDFdidprint
-% \global\let\checkPDFdocumentactions\relax
-% \fi}
-
-% \appendtoksonce
-% \checkPDFdocumentactions
-% \to \everylastshipout
-
-%\def\doPDFsetupopenaction%
-% {\doPDFdictionaryobject{FDF}{local:openaction}\lastPDFaction
-% \doPDFgetobjectreference{FDF}{local:openaction}\PDFobjectreference
-% \doPDFaddtocatalog{/OpenAction \PDFobjectreference}}
-%
-%\def\doPDFsetupcloseaction%
-% {\doPDFdictionaryobject{FDF}{local:closeaction}\lastPDFaction
-% \doPDFgetobjectreference{FDF}{local:closeaction}\PDFobjectreference
-% \doPDFaddtocatalog{/CloseAction \PDFobjectreference}}
-
-\let\PDFopenpageaction \empty
-\let\PDFclosepageaction\empty
-
-\definespecial\dosetupopenpageaction {\global\let\PDFopenpageaction \lastPDFaction}
-\definespecial\dosetupclosepageaction{\global\let\PDFclosepageaction\lastPDFaction}
-
-\def\checkPDFpageactions
- {\iflocation % important since direct -)
- \donefalse
- \ifx\PDFopenpageaction \empty\!!doneafalse\else\donetrue\!!doneatrue\fi
- \ifx\PDFclosepageaction\empty\!!donebfalse\else\donetrue\!!donebtrue\fi
- \ifdone
- \doPDFpageattribute
- {/AA <<\if!!donea/O <<\PDFopenpageaction >> \fi
- \if!!doneb/C <<\PDFclosepageaction>> \fi>>}%
- \fi
- \global\let\PDFopenpageaction \empty
- \global\let\PDFclosepageaction\empty
- \fi}
-
-\appendtoksonce
- \checkPDFpageactions
-\to \everyshipout
-
-%D \macros
-%D {doPDFstartthisislocation}
-%D
-%D Next we define the macros that deal with hyperreferencing,
-%D graphic inclusion and general document features. These are
-%D the olderst ones. I won't comment much because one needs
-%D knowledge of \PDF\ itself, and explaning \PDF\ is beyond
-%D this documentation.
-
-\def\doPDFstartthisislocation#1%
- {\bgroup
- \setPDFdestination{#1}%
- \ifx\PDFdestination\empty \else
- \doPDFdestination{\PDFdestination}%
- \fi
- \egroup}
-
-%D \macros
-%D {doPDFstartgotolocation,
-%D doPDFstartgotorealpage,
-%D doPDFstartgotoJS}
-%D
-%D The goto macros use the switch \type{\ifsecondaryreference}
-%D to determine if actions should be linked.
-
-\def\locationfilesuffix{pdf}
-
-% \def\preparePDFlocationfile#1#2%
-% {\setreferencefilename#1\to#2%
-% \expanded{\doifnotinstring{.\locationfilesuffix}{#2}}
-% {\edef#2{#2.\locationfilesuffix}}}
-%
-% \def\preparePDFlocationfile#1\to#2%
-% {\setreferencefilename#1\to#2%
-% \expanded{\doifnotinstring{.pdf}{#2}}{\edef#2{#2.pdf}}}
-
-\def\doPDFstartgotolocation#1#2#3#4#5#6%
- {\bgroup
- \doifelsenothing{#3}
- {\setPDFdestination{#5}%
- \doifelsenothing\PDFdestination
- {\let\action\empty}
- {\doifelsenothing{#4}
- {\let\PDFfile\empty}
- {\expanded{\beforesplitstring#4}\at.\to\PDFfile
- \doifparentfileelse\PDFfile % {#4}
- {\let\PDFfile\empty}
- %{\setreferencefilename#4.\locationfilesuffix\to\PDFfile
- {\@EA\setreferencefilename\PDFfile.\locationfilesuffix\to\PDFfile
- \edef\PDFfile
- {R /F (\PDFfile)\ifgotonewwindow\space/NewWindow true \fi}}}%
- \edef\action%
- {/S /GoTo\PDFfile\space /D (\PDFdestination)}}}
- {\doifelsenothing{#4}
- {\let\PDFfile\empty
- \let\PDFdestination\empty}
- {\setreferencefilename/#4\to\PDFfile
- \setPDFdestination{#5}%
- \doifsomething\PDFdestination
- {\edef\PDFdestination{\URLhash\PDFdestination}}}%
- \edef\action{/S /URI /URI (#3\PDFfile\PDFdestination)}}%
- \ifx\action\empty\else
- \ifsecondaryreference
- \savesecondaryPDFreference\action
- \else
- \getsecondaryPDFreferences
- \doPDFaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}%
- \fi
- \fi
- \egroup}
-
-\def\PDFgotonewwindow{\ifgotonewwindow\space/NewWindow true \fi}
-
-% optimization in tpd driver
-%
-% \edef\PDFdestination{(page:\the\scratchcounter)}%
-%
-% ==>
-%
-% \advance\scratchcounter 1
-% \edef\PDFdestination{[\pdfpageref \PDFobjref\scratchcounter\PDFpageviewwrd]}%
-%
-% \doPDFgetpagedestination#1#2% pagenumber macro % % fuzzy hack
-
-\def\doPDFstartgotorealpage#1#2#3#4#5% watch the R append trick
- {\bgroup
- \doifelsenothing{#3}% #1 = url
- {\scratchcounter0#5\relax
- \ifnum\scratchcounter>0
- \doifelsenothing{#4}
- {\let\PDFfile\empty}
- {\expanded{\beforesplitstring#4}\at.\to\PDFfile
- \doifparentfileelse\PDFfile % {#4}
- {\let\PDFfile\empty}
- %{\setreferencefilename#4.\locationfilesuffix\to\PDFfile
- {\@EA\setreferencefilename\PDFfile.\locationfilesuffix\to\PDFfile
- \edef\PDFfile{R /F (\PDFfile)\PDFgotonewwindow}}}%
- \ifx\PDFfile\empty
- \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 / pdf starts numbering at zero
- \advance\scratchcounter \minusone
- \edef\PDFdestination{[\the\scratchcounter\space\PDFpageviewwrd]}%
- \fi
- \edef\action{/S /GoTo\PDFfile\space /D \PDFdestination}%
- \else
- \let\action\empty
- \fi}
- {\doifelsenothing{#4}
- {\let\PDFfile\empty}
- {\setreferencefilename/#4\to\PDFfile}%
- \edef\action{/S /URI /URI (#3\PDFfile)}}%
- \ifx\action\empty\else
- \ifsecondaryreference
- \savesecondaryPDFreference\action
- \else
- \getsecondaryPDFreferences
- \doPDFaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}%
- \fi
- \fi
- \egroup}
-
-\let\lastfakedPDFpage\!!zerocount
-
-\def\fakePDFpagedestination % as in pdf, we start numbering at zero
- {\iflocation \ifarrangingpages \else \ifnum\overcomePDFpage=\plustwo
- \ifnum\lastfakedPDFpage<\realpageno
- \bgroup
- \xdef\lastfakedPDFpage{\realfolio}%
- \advance\realpageno \minusone % is \expanded needed ?
- \expanded{\doPDFdestination{page:\realfolio}}%
- \egroup
- \fi
- \fi \fi \fi}
-
-\appendtoksonce
- \fakePDFpagedestination
-\to \everyshipout
-
-\def\doPDFstartgotoJS#1#2#3%
- {\bgroup
- \doPSsanitizeJScode#3\to\sanitizedJScode
- \edef\action
- {/S /JavaScript /JS (\sanitizedJScode)}%
- \ifsecondaryreference
- \savesecondaryPDFreference\action
- \else
- \getsecondaryPDFreferences
- \doPDFaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}%
- \fi
- \egroup}
-
-%D \macros
-%D {doPDFstartexecutecommand}
-%D
-%D At the cost of much auxiliary placeholders, we can pretty
-%D fast convert the command asked for. This is how the \PDF\
-%D code looks like.
-
-\def\PDFmoviecode#1#2#3%
- {/Movie
- /T (\ifcase#1movie \else sound \fi\ifx\argumentA\empty#2\else\argumentA\fi)
- /Operation /\ifcase#3Play\or Stop\or Pause\or Resume\fi\space}
-
-\def\PDFexecutestartmovie {\PDFmoviecode0\currentmovie0}
-\def\PDFexecutestopmovie {\PDFmoviecode0\currentmovie1}
-\def\PDFexecutepausemovie {\PDFmoviecode0\currentmovie2}
-\def\PDFexecuteresumemovie {\PDFmoviecode0\currentmovie3}
-
-\def\PDFexecutestartsound {\PDFmoviecode1\currentsound0}
-\def\PDFexecutestopsound {\PDFmoviecode1\currentsound1}
-\def\PDFexecutepausesound {\PDFmoviecode1\currentsound2}
-\def\PDFexecuteresumesound {\PDFmoviecode1\currentsound3}
-
-\def\PDFformcode#1%
- {\doFDFiffieldset{#1}{/Field [\doFDFgetfieldset{#1}]}}
-
-% bit 3 = html
-% bit 6 = xml
-% bit 4 = get
-
-\ifx\PDFsubmitfiller\undefined \let\PDFsubmitfiller\empty \fi
-
-\chardef\PDFformmethod=1 % 0=GET 1=POST
-
-\def\PDFformflag#1#2{\ifcase\PDFformmethod#1\else#2\fi}
-
-\def\PDFexecuteimportform {/Named /N /AcroForm:ImportFDF}
-\def\PDFexecuteexportform {/Named /N /AcroForm:ExportFDF}
-\def\PDFexecuteresetform {/ResetForm \PDFformcode\argumentA}
-\def\PDFexecutesubmitform {/SubmitForm \PDFformcode\argumentB
- /Flags \ifcase\submitoutputformat\space
- \PDFformflag{12} {4} % 0=unknown
- \or \PDFformflag{12} {4} % 1=HTML
- \or \PDFformflag {8} {0} % 2=FDF
- \or \PDFformflag{40}{32} % 3=XML
- \else \PDFformflag{12} {4} % ?=unknown
- \fi
- /F (\argumentA)\PDFsubmitfiller}
-
-% urifill permits url substitution
-
-\def\PDFexecutehide {/Hide /T (\argumentA) /H true}
-\def\PDFexecuteshow {/Hide /T (\argumentA) /H false}
-
-\def\PDFexecutefirst {/Named /N /FirstPage}
-\def\PDFexecuteprevious {/Named /N /PrevPage}
-\def\PDFexecutenext {/Named /N /NextPage}
-\def\PDFexecutelast {/Named /N /LastPage}
-\def\PDFexecutebackward {/Named /N /GoBack}
-\def\PDFexecuteforward {/Named /N /GoForward}
-\def\PDFexecuteprint {/Named /N /Print}
-\def\PDFexecuteexit {/Named /N /Quit}
-\def\PDFexecuteclose {/Named /N /Close}
-\def\PDFexecutesave {/Named /N /Save}
-\def\PDFexecutesavenamed {/Named /N /SaveAs}
-\def\PDFexecuteopennamed {/Named /N /Open}
-\def\PDFexecutehelp {/Named /N /HelpUserGuide}
-\def\PDFexecutetoggle {/Named /N /FullScreen}
-\def\PDFexecutesearch {/Named /N /Find}
-\def\PDFexecutesearchagain {/Named /N /FindAgain}
-\def\PDFexecutegotopage {/Named /N /GoToPage}
-\def\PDFexecutequery {/Named /N /AcroSrch:Query}
-\def\PDFexecutequeryagain {/Named /N /AcroSrch:NextHit}
-\def\PDFexecutefitwidth {/Named /N /FitWidth}
-\def\PDFexecutefitheight {/Named /N /FitHeight}
-
-\let\PDFobjectclass\empty
-\let\PDFobjectname \empty
-
-\def\doPDFstartexecutecommand#1#2#3#4%
- {\doifdefined{PDFexecute#3}
- {\bgroup
- \edef\argument{#4}%
- \ifx\argument\empty
- \let\argumentA\empty
- \let\argumentB\empty
- \else
- \@EA\dogetcommalistelement\@EA1\@EA\from#4\to\argumentA
- \@EA\dogetcommalistelement\@EA2\@EA\from#4\to\argumentB
- \fi
- \edef\action%
- {/S \getvalue{PDFexecute#3}}%
- \ifsecondaryreference
- \savesecondaryPDFreference\action
- \else
- \getsecondaryPDFreferences
-% \ifx\PDFobjectclass\empty
-% \let\next\doPDFaction
-% \else
-% \edef\next{\doPDFactionobject{\PDFobjectclass}{\PDFobjectname}}%
-% \globalletempty\PDFobjectclass
-% \globalletempty\PDFobjectname
-% \fi
-% \next
- \doPDFaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}%
- \fi
- \egroup}}
-
-%D \macros
-%D {doPDFstartrunprogram}
-%D
-%D Running programs is possible, but is non that portable, and
-%D therefore dangerous.
-
-\def\doPDFstartrunprogram#1#2#3#4% new: #3 => #3#4
- {\bgroup
- %\edef\string{#3}%
- %\@EA\beforesplitstring\string\at{ }\to\program
- %\@EA\aftersplitstring \string\at{ }\to\parameters
- %\edef\action%
- % {/S /Launch /F (\program) /P (\parameters) /D (.)}%
- \edef\action
- {/S /Launch /F (#3) /P (#4) /D (.)}%
- \ifsecondaryreference
- \savesecondaryPDFreference\action
- \else
- \getsecondaryPDFreferences
- \doPDFaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}%
- \fi
- \egroup}
-
-%D \macros
-%D {doPDFstartgotoprofile}
-%D
-%D Far from perfect, but nevertheless present, is the profile
-%D handler. We want to misuse article threads for reder
-%D profiles.
-
-\def\doPDFstartgotoprofile#1#2#3% to be done: file
- {\bgroup
- \setPDFdestination{#3}%
- \doifsomething\PDFdestination
- {\edef\action
- {/S /Thread /D (\PDFdestination)}%
- \ifsecondaryreference
- \savesecondaryPDFreference\action
- \else
- \getsecondaryPDFreferences
- \doPDFaction{\PDFswapdir#1}{#2}{\action \secondaryPDFreferences}%
- \fi}%
- \egroup}
-
-%D \macros
-%D {doPDFsetpagetransition}
-%D
-%D This array holds a reasonable selection of transitions
-%D (watch out: \type{replace} is not in this list). Most of
-%D the transitions look awful anyway. By the way, \CONTEXT\ is
-%D able to select transitions randomly.
-
-% some day, when 1.5 is on linux and apple, we will add:
-%
-% \def\pagetransitions
-% {{split,in,vertical},{split,in,horizontal},
-% {split,out,vertical},{split,out,horizontal},
-% {blinds,horizontal},{blinds,vertical},
-% {box,in},{box,out},
-% {wipe,east},{wipe,west},{wipe,north},{wipe,south},
-% dissolve,
-% {glitter,east},{glitter,south},
-% {fly,in,east},{fly,in,west},{fly,in,north},{fly,in,south},
-% {fly,out,east},{fly,out,west},{fly,out,north},{fly,out,south},
-% {push,east},{push,west},{push,north},{push,south},
-% {cover,east},{cover,west},{cover,north},{cover,south},
-% {uncover,east},{uncover,west},{uncover,north},{uncover,south},
-% fade}
-
-\def\pagetransitions
- {{split,in,vertical},{split,in,horizontal},
- {split,out,vertical},{split,out,horizontal},
- {blinds,horizontal},{blinds,vertical},
- {box,in},{box,out},
- {wipe,east},{wipe,west},{wipe,north},{wipe,south},
- dissolve,
- {glitter,east},{glitter,south}}
-
-%D Again, we use macros as placeholders for \PDF\ key||value
-%D pairs.
-
-\def\PDFpagesplit {/S /Split }
-\def\PDFpageblinds {/S /Blinds }
-\def\PDFpagebox {/S /Box }
-\def\PDFpagewipe {/S /Wipe }
-\def\PDFpagedissolve {/S /Dissolve }
-\def\PDFpageglitter {/S /Glitter }
-\def\PDFpagereplace {/S /R }
-
-\def\PDFpagefly {/S /Fly } % 1.5
-\def\PDFpagepush {/S /Push } % 1.5
-\def\PDFpagecover {/S /Cover } % 1.5
-\def\PDFpageuncover {/S /Uncover } % 1.5
-\def\PDFpagefade {/S /Fade } % 1.5
-
-\def\PDFpagehorizontal {/Dm /H }
-\def\PDFpagevertical {/Dm /V }
-\def\PDFpagein {/M /I }
-\def\PDFpageout {/M /O }
-\def\PDFpageeast {/Di 0 }
-\def\PDFpagenorth {/Di 90 }
-\def\PDFpagewest {/Di 180 }
-\def\PDFpagesouth {/Di 270 }
-
-\def\dodoPDFsetpagetransition#1%
- {\doifdefined{PDFpage#1}
- {\edef\PDFpagetransitions{\PDFpagetransitions\getvalue{PDFpage#1}}}}
-
-\def\doPDFsetpagetransition#1#2%
- {\let\PDFpagetransitions\empty
- \processcommalist[#1]\dodoPDFsetpagetransition
- \doPDFpageattribute
- %{\ifnum#2>0 /Dur #2 \fi
- {\ifnum0<0#2 /Dur #2 \fi
- \ifx\PDFpagetransitions\empty\else/Trans <<\PDFpagetransitions>>\fi}}
-% \ifx\PDFpagetransitions\empty\else/Trans <</Type /Trans \PDFpagetransitions>>\fi}}
-
-%D \macros
-%D {doPDFinsertmov}
-%D
-%D Most of the annotations we use here are of type {\em
-%D link}, but here is another one: the {\em movie} annotation.
-%D The driver module must implement \type {setcurrentmovie}.
-
-%D Great: this will become an obsolete pdf feature; why did we have to
-%D keep up with the bugs ... and by the time acrobat gets better in
-%D handling it have to drop it.
-
-\let\currentmovie\s!unknown
-
-\def\doPDFinsertmov
- {\bgroup
- \xdef\currentmovie{\@@DriverImageLabel}%
- \PointsToBigPoints\@@DriverImageWidth \width
- \PointsToBigPoints\@@DriverImageHeight\height
- \let\pdf@@options\empty
- \let\pdf@@actions\empty
- \donefalse
- \expanded{\processallactionsinset[\@@DriverImageOptions]}
- [\v!controls=>\donetrue,
- \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\@@DriverImageWidth\@@DriverImageHeight
- {/Subtype /Movie
- /Border [0 0 0]
- /T (movie \currentmovie)
- /Movie << /F (\@@DriverImageFile) /Aspect [\width\space\height] \pdf@@options >>
- /A << \pdf@@actions >>}%
- \egroup}
-
-%D \macros
-%D {doPDFinsertsoundtrack}
-%D
-%D In \PDF\ sounds can be embedded like movies.
-
-\ifx\everygoto\undefined \newtoks\everygoto \fi
-
-\let\currentsound\s!unknown
-
-\def\doPDFinsertsoundtrack#1#2#3%
- {\bgroup
- \xdef\currentsound{#2}%
- \let\pdf@@actions\empty
- \@EA\processallactionsinset\@EA
- [#3]
- [\v!repeat=>\edef\pdf@@actions{\pdf@@actions /Mode /Repeat }]%
- \collectdriverresource
- %\flushatshipout % since it can be buried in a chained box
- {\doPDFannotation{0pt}{0pt}
- {/Subtype /Movie
- /Border [0 0 0]
- /T (sound \currentsound)
- /Movie <</F (#1)>>%
- \ifx\pdf@@actions\empty\else/A << \pdf@@actions >>\fi}}%
- \egroup}
-
-%D \macros
-%D {doPDFattachfile}
-
-\def\doPDFfilestreamobject#1#2#3#4%
- {}
-
-\def\doPDFfilestreamidentifier#1%
- {0}
-
-\def\doPDFgetfilestreamreference#1#2%
- {0 0 R}
-
-\def\doPDFattachfile#1#2#3#4#5#6#7#8%
- {\bgroup % title width height color symbol file
- \edefconvertedargument\PDFfile{#8}%
- % beware: the symbol may (indirectly) use the file
- % reference when typesetting the object number;
- \presetPDFsymbolappearance{#5}{#6}{#2}{#3}{#4}% sets width/height
- \startPDFsymbolappearance
- \doPDFembedfile\PDFfile{#7}{#8}%
- \doPDFgetembeddedfilereference\PDFfile\PDFobjectreference
- \setFDFlayer\@@DriverAttachmentLayer
- \doPDFannotation{\width}{\totalheight}
- {/Subtype /FileAttachment
- /FS \PDFobjectreference\space
- /Contents (#1)
- \PDFsymbol
- \FDFlayer
- \PDFattributes}%
- \stopPDFsymbolappearance
- \egroup}
-
-% semi-public
-
-\def\doPDFembedfile#1#2#3% symbolic name | filename | user name
- {\edefconvertedargument\PDFfile{#1}%
- \doifnotflagged{a:\PDFfile}%
- {\doPDFfilestreamobject{PDFEF}{\PDFfile}{#2}{#3}%
- \doglobal\setflag{a:\PDFfile}}}
-
-\def\doPDFgetembeddedfilereference#1#2%
- {\edefconvertedargument\PDFfile{#1}%
- \doPDFgetobjectreference{PDFEF}\PDFfile#2}
-
-\def\doPDFgetembeddedfilestreamreference#1#2%
- {\edefconvertedargument\PDFfile{#1}%
- \doPDFgetfilestreamreference\PDFfile#2} % == \doPDFgetobjectreference{PDFFS}\PDFfile#2
-
-\definespecial \doattachfile {\doPDFattachfile}
-
-% requested by Jens-Uwe Morawski: permits usage of pdftosrc
-% in viewers that don't support attachments:
-%
-% \definesymbol
-% [ObjectNumber]
-% % [object number {\PDFattachmentnumber[xx]}] % named
-% [object number \PDFattachmentnumber] % current
-%
-% \useattachment[test][xx][test.tex]
-% \setupattachments[symbol=ObjectNumber]
-% \attachment[test]
-
-\def\PDFattachmentnumber
- {\dosingleargument\doPDFattachmentnumber}
-
-\def\doPDFattachmentnumber[#1]%
- {\iffirstargument
- \doPDFfilestreamidentifier{#1}%
- \else
- \doPDFfilestreamidentifier\PDFfile
- \fi}
-
-%D \macros
-%D {...}
-%D
-%D Rather preliminary. We have to wait till the complete specs
-%D show up. As usual, we cannot really check it (Acrobat 6.0
-%D has a bug that inhibits us to make a test file). Half a day
-%D of testing made clear that trying to control the plugin fails
-%D in most cases (we need plugin specs -). We also miss a feature
-%D to let acrobat wait with proceeding (action processing) till
-%D the media clip is ready.
-
-% aiff audio/aiff
-% au audio/basic
-% avi video/avi
-% mid audio/midi
-% mov video/quicktime
-% mp3 audio/x-mp3 (mpeg)
-% mp4 audio/mp4
-% mp4 video/mp4
-% mpeg video/mpeg
-% smil application/smil
-% swf application/x-shockwave-flash
-
-% beware, this is preliminary code, should be improved
-
-\def\PDFrenderingspecs#1{\executeifdefined{PDFMR:#1}\empty}
-
-\def\PDFexecutestartrendering {/Rendition /OP 0 \PDFrenderingspecs\argumentA}
-\def\PDFexecutestoprendering {/Rendition /OP 1 \PDFrenderingspecs\argumentA}
-\def\PDFexecutepauserendering {/Rendition /OP 2 \PDFrenderingspecs\argumentA}
-\def\PDFexecuteresumerendering {/Rendition /OP 3 \PDFrenderingspecs\argumentA}
-
-% todo : sub files
-%
-% \doPDFembedfile{pier-39.png}{pier-39.png}{pier-39.png}%
-% \doPDFgetembeddedfilestreamreference{pier-39.png}\xPDFobjectreference
-% \edef\xxxx{/RF [(pier-39.png) \xPDFobjectreference]}%
-
-% todo: alternative renderings
-%
-% object_1 -> <</Type /Rendition /S /MR /C << /Type /MediaClip ... >> >>
-% object_2 -> <</Type /Rendition /S /MR /C << /Type /MediaClip ... >> >>
-%
-% rendering -> <</Type /Rendition /S /MS [objref_1 objref_2]>>
-
-% todo: embedded files (too buggy)
-%
-% \let\PDFattribute\empty
-% % /D \PDFobjectreference
-% % test one, no error, but ignored
-% \doifinset\v!file{#4}
-% {\doPDFembedfile{#3}{#3}{#3}%
-% \doPDFgetembeddedfilestreamreference{#3}\PDFobjectreference
-% \edef\PDFattribute{/EF \PDFobjectreference}}%
-% % official, does not work either
-% \doifinset\v!file{#4}
-% {\doPDFembedfile{#3}{#3}{#3}%
-% \doPDFgetembeddedfilereference{#3}\PDFobjectreference}
-% % do we play the game as follows
-
-\definespecial\doinsertrendering#1#2#3#4% tag mime file options
- {\ifundefined{PDFMR:#1}%
- \doifinstringelse{://}{#3}\donetrue\donefalse % evt url as keyword
- \doPDFdictionaryobject{PDFMF}{#1}
- {/Type /Rendition
- /S /MR
- % does not work: /SP << /Type /MediaScreenParam /BE << /B [1 0 0] /O 0.5 >> >>
- /C << /Type /MediaClip
- /S /MCD
- /N (#1)
- /Alt [() (file not found)] % language id + message
- /D << /Type /Filespec
- /F (#3)
- \ifdone/FS /URL\fi >>
- /CT (#2) >>}%
- % common code
- \doifobjectreferencefoundelse{PDFMS}{#1}
- {\doPDFgetobjectreference{PDFMS}{#1}\PDFobjectreferenceB}
- {\doPDFgetobjectreference{PDFMU}{#1}\PDFobjectreferenceB}%
- \doPDFgetobjectreference{PDFMF}{#1}\PDFobjectreferenceA
- \setxvalue{PDFMR:#1}% needed /AA actions in /Screen
- {/R \PDFobjectreferenceA
- /AN \PDFobjectreferenceB}%
- \doifobjectreferencefoundelse{PDFMS}{#1}\donothing
- {\dodoinsertrenderingwindow{PDFMU}{#1}\zeropoint\zeropoint{#4}}%
- \fi}
-
-\definespecial\doinsertrenderingobject#1#2#3#4% tag class objectname options
- {\ifundefined{PDFMR:#1}%
- \doPDFgetobjectreference{#2}{#3}\PDFobjectreference
- \doPDFdictionaryobject{PDFMF}{#1}
- {/Type /Rendition
- /S /MR
- /C << /Type /MediaClip
- /S /MCD
- /N (#1)
- /D \PDFobjectreference>>}%
- % common code
- \doifobjectreferencefoundelse{PDFMS}{#1}
- {\doPDFgetobjectreference{PDFMS}{#1}\PDFobjectreferenceB}
- {\doPDFgetobjectreference{PDFMU}{#1}\PDFobjectreferenceB}%
- \doPDFgetobjectreference{PDFMF}{#1}\PDFobjectreferenceA
- \setxvalue{PDFMR:#1}% needed /AA actions in /Screen
- {/R \PDFobjectreferenceA
- /AN \PDFobjectreferenceB}%
- \doifobjectreferencefoundelse{PDFMS}{#1}\donothing
- {\dodoinsertrenderingwindow{PDFMU}{#1}\zeropoint\zeropoint{#4}}%
- \fi}
-
-\definespecial\doinsertrenderingwindow
- {\dodoinsertrenderingwindow{PDFMS}}
-
-\def\dodoinsertrenderingwindow#1#2#3#4#5%
- {\vbox to #4 \bgroup
- \checkPDFscreenactions{#2}{#5}%
- \doPDFgetobjectpagereference{PDFMF}{#2}\PDFobjectreferenceA
- \doPDFgetobjectreference {PDFMF}{#2}\PDFobjectreferenceB
- \vss
- \hbox to #3 \bgroup
- \doPDFannotationobject{#1}{#2}{#3}{#4}
- {/Subtype /Screen
- /P \PDFobjectreferenceA
- /A \PDFobjectreferenceB
- \PDFattributes
- /Border [0 0 0]}%
- \hss
- \egroup
- \egroup}
-
-\global\let\PDFrenderingopenpageaction \empty
-\global\let\PDFrenderingclosepageaction\empty
-
-\def\checkPDFscreenactions#1#2%
- {\let\PDFattributes\empty
- \iflocation % important since direct -)
- % the action can either (already) be set by the window handler
- % or (normally when no window [i.e a zero dimensions one] is present) by keyword
- \doifinset\v!auto{#2}
- {% brrr, here instead of in navigation module, must move and become special
- % now two sided dependency
- \let\checkrendering\gobbleoneargument
- \ifx\PDFrenderingopenpageaction \empty
- \handlereferenceactions{\v!StartRendering{#1}}\dosetuprenderingopenpageaction
- \fi
- \ifx\PDFrenderingclosepageaction\empty
- \handlereferenceactions{\v!StopRendering {#1}}\dosetuprenderingclosepageaction
- \fi
- }%
- \donefalse
- \ifx\PDFrenderingopenpageaction \empty\!!doneafalse\else\donetrue\!!doneatrue\fi
- \ifx\PDFrenderingclosepageaction\empty\!!donebfalse\else\donetrue\!!donebtrue\fi
- \ifdone
- \edef\PDFattributes
- {/AA <<\if!!donea/PO <<\PDFrenderingopenpageaction >> \fi
- \if!!doneb/PC <<\PDFrenderingclosepageaction>> \fi>>}%
- \fi
- \global\let\PDFrenderingopenpageaction \empty
- \global\let\PDFrenderingclosepageaction\empty
- \fi}
-
-\definespecial\dosetuprenderingopenpageaction {\global\let\PDFrenderingopenpageaction \lastPDFaction}
-\definespecial\dosetuprenderingclosepageaction{\global\let\PDFrenderingclosepageaction\lastPDFaction}
-
-%D \macros
-%D {doPDFinsertbookmark}
-%D
-%D Well, here is the dreadfull bookmark, rather useless because
-%D only standard encoding is possible, no typography is done,
-%D and a maximum of 32~characters is advized.
-
-\def\doPDFinsertbookmark#1#2#3#4#5% level sublevels text page open=1
- {\bgroup
- \sanitizePDFencoding#3\to\bookmarktext % uses scratchcounter
- \stripstring\bookmarktext
- \doPDFbookmark{#1}{#2}{\bookmarktext}{#4}{#5}%
- \egroup}
-
-%D The next section of this module is dedicated to form
-%D support. These macros are complicated by the fact that
-%D cloning is possible.
-
-%D \macros
-%D {FDFflag...,FDFplus...}
-%D
-%D The \type{/FT} key determines the type of field: text,
-%D button or choice. The latter two come in several disguises,
-%D which are set by flipping bits in the \type{/Ff}. Other bits
-%D are used to set states. Personally I hate this bitty way of
-%D doing things. The next six bit determine the field sub type:
-
-\def\FDFflagMultiLine {4096} % 13
-\def\FDFflagNoToggleToOff {16384} % 15
-\def\FDFflagRadio {32768} % 16 (not used as such)
-\def\FDFflagPushButton {65536} % 17
-\def\FDFflagPopUp {131072} % 18
-\def\FDFflagEdit {262144} % 19
-
-% bugged anyway, so we need to drop it:
-
-\def\FDFflagRadiosInUnison {33554432} % 26
-
-%D A few more (pdf 1.4) flags, what the spell check one: for
-%D obscure reasons for Adobe downward compatibility means
-%D enabling features that harm old applications like testing.
-
-\def\FDFflagDoNotSpellCheck {4194304} % 23
-\def\FDFflagDoNotScroll {8388608} % 24
-
-%D The next bits (watch how strange the bits are organized)
-%D take care of the states:
-
-\def\FDFflagReadOnly {1} % 1
-\def\FDFflagRequired {2} % 2
-\def\FDFflagNoExport {4} % 3
-\def\FDFflagPassword {8192} % 14
-\def\FDFflagSort {524288} % 20
-\def\FDFflagFileSelect {1048576} % 21
-
-%D There is a second, again bitset oriented, \type{/F} flag:
-
-\def\FDFplusInvisible {1} % 1
-\def\FDFplusHidden {2} % 2
-\def\FDFplusPrintable {4} % 3
-
-%def\FDFplusNoView {32} % 6
-%def\FDFplusToggleNoView {256} % 9
-
-\def\FDFplusAutoView {256} % {288} % 6+9
-
-%D \macros
-%D {setFDFswitches}
-%D
-%D The non||type bits are mapped onto user||interface
-%D swithes, to be used later on:
-
-\def\@@FDFflag{FDFflag}
-\def\@@FDFplus{FDFplus}
-
-\letvalue {\@@FDFflag\v!readonly}=\FDFflagReadOnly
-\letvalue {\@@FDFflag\v!required}=\FDFflagRequired
-\letvalue {\@@FDFflag\v!protected}=\FDFflagPassword
-\letvalue {\@@FDFflag\v!sorted}=\FDFflagSort
-\letvalue {\@@FDFflag\v!unavailable}=\FDFflagNoExport
-\letvalue {\@@FDFflag\v!nocheck}=\FDFflagDoNotSpellCheck
-\letvalue {\@@FDFflag\v!fixed}=\FDFflagDoNotScroll
-\letvalue {\@@FDFflag\v!file}=\FDFflagFileSelect
-
-\letvalue {\@@FDFplus\v!hidden}=\FDFplusHidden
-\letvalue {\@@FDFplus\v!printable}=\FDFplusPrintable
-
-\letvalue {\@@FDFplus\v!auto}=\FDFplusAutoView
-
-%D A set of switches is collected into the flags we mentioned
-%D before by the next macro (we don't handle negations yet,
-%D but do take care of redundancy):
-
-\def\FDFflag{0}
-\def\FDFplus{0}
-
-\def\setFDFswitches[#1]%
- {\bgroup
- \!!counta\zerocount
- \!!countb\zerocount
- \def\docommand##1%
- {\doifsomething{##1}
- {\advance\!!counta 0\getvalue{\@@FDFflag##1}%
- \setvalue{\@@FDFflag##1}{0}%
- \advance\!!countb 0\getvalue{\@@FDFplus##1}%
- \setvalue{\@@FDFplus##1}{0}}}%
- \processcommacommand[#1]\docommand
- \xdef\FDFflag{\the\!!counta}%
- \xdef\FDFplus{\the\!!countb}%
- \egroup}
-
-%D \macros
-%D {setFDFvalues}
-%D
-%D Menu items are passed as an array of \type{(string)}'s and
-%D the content of this array is build with:
-
-\let\FDFvalues \empty
-\let\FDFfirstvalues \empty
-\let\FDFsecondvalues\empty
-\let\FDFkidlist \empty
-\let\FDFdefaultindex\!!zerocount
-\let\FDFdefaultvalue\empty
-
-% Why do we need to tweak this mechanism each time acrobat updates ...
-% it would make sense to have version specific sections in pdf files
-% since my guess is that it never will be done right since each year
-% new programmers have new ideas about what is supposed to happen with
-% kids. So .. best is not to trust this feature esp not for radio
-% widgets. (new flags, different interpretation of AS etc etc)
-
-\def\setFDFvalues[#1][#2]% #1 = list (item=>value) #2 = default
- {\let\FDFvalues \empty
- %when radio opt works ok
- %\let\FDFfirstvalues \empty
- %\let\FDFsecondvalues\empty
- \let\FDFkidlist \empty
- %\let\FDFdefaultindex\!!zerocount
- %\let\FDFdefaultvalue\empty
- %\scratchcounter\zerocount
- \def\dodocommand##1=>##2=>##3\end
- {\addtocommalist{##1}\FDFkidlist
- %\edef\FDFfirstvalues{\FDFfirstvalues(##1)}%
- %\doif{##1}{#2}{\edef\FDFdefaultindex{\the\scratchcounter}}%
- %\advance\scratchcounter\plusone
- \doifelsenothing{##2}
- {\doif{##1}{#2}{\edef\FDFdefaultvalue{##1}}%
- %\edef\FDFsecondvalues{\FDFsecondvalues(##1)}%
- \edef\FDFvalues{\FDFvalues [(##1)(##1)] }}
- {\doif{##1}{#2}{\edef\FDFdefaultvalue{##2}}%
- %\edef\FDFsecondvalues{\FDFsecondvalues(##2)}%
- \edef\FDFvalues{\FDFvalues [(##2)(##1)] }}}% ! ##1 is shown
- \def\docommand##1%
- {\dodocommand##1=>=>\end}%
- \expanded{\processcommalist[#1]}\docommand}
-
-%D This macro accepts comma separated \type{visual=>result}
-%D pairs.
-
-%D \macros
-%D {setFDFalignment}
-%D
-%D Text and line fields can be entered and showed in three
-%D alternative alingments, indicated by a digit:
-
-\def\FDFalign{0}
-
-\def\setFDFalignment[#1]%
- {\processaction
- [#1]
- [ \v!left=>\edef\FDFalign{2}, % raggedleft
- \v!middle=>\edef\FDFalign{1}, % raggedcenter
- \v!right=>\edef\FDFalign{0}]} % raggedright
-
-%D \macros
-%D {setFDFattributes}
-%D
-%D The weak part of (at least version 2.1 \PDF) is that only
-%D default fonts are handled well. Another restriction is that
-%D the encoding vector must be the standard \PDF\ document one.
-%D Although the \PDF\ reference explictly states that one could
-%D use the normal text operators, leading is not yet handled.
-%D
-%D For the moment the current \CONTEXT\ font is mapped onto
-%D one best suitable default font. The color attribute is
-%D less problematic and is directly derived from the \CONTEXT\
-%D color.
-
-\def\FDFattributes{/Helv 12 Tf 0 g 14.4 TL}
-
-\def\FDFrm {TiRo} \def\FDFss {Helv} \def\FDFtt {Cour}
-\def\FDFrmtf{TiRo} \def\FDFsstf{Helv} \def\FDFtttf{Cour}
-\def\FDFrmbf{TiBo} \def\FDFssbf{HeBo} \def\FDFttbf{CoBo}
-\def\FDFrmit{TiIt} \def\FDFssit{HeOb} \def\FDFttit{CoOb}
-\def\FDFrmsl{TiIt} \def\FDFsssl{HeOb} \def\FDFttsl{CoOb}
-\def\FDFrmbi{TiBI} \def\FDFssbi{HeBO} \def\FDFttbi{CoBO}
-\def\FDFrmbs{TiBI} \def\FDFssbs{HeBO} \def\FDFttbs{CoBO}
-
-\let\FDFusedfonts=\FDFsstf
-
-\def\setFDFattributes[#1,#2,#3,#4]% style, color, backgroundcolor, framecolor
- {\bgroup % nog interlinie: n TL
- \setbox\scratchbox\hbox
- \bgroup
- \doconvertfont{#1}{}%
- \PointsToBigPoints\bodyfontsize\size % x/xx, so better the actual size
- \doifdefinedelse{FDF\fontstyle\fontalternative}
- {\xdef\FDFattributes{\getvalue{FDF\fontstyle\fontalternative}}}
- {\doifdefinedelse{FDF\fontstyle}
- {\xdef\FDFattributes{\getvalue{FDF\fontstyle}}}
- {\xdef\FDFattributes{\FDFrm}}}%
- \doglobal\addtocommalist\FDFattributes\FDFusedfonts
- \xdef\FDFattributes% move up with "x.y Ts"
- {/\FDFattributes\space\size\space Tf\space\PDFcolor{#2}}%
- \doifelsenothing{#3}
- {\global\let\FDFsurroundings\empty}
- {\xdef\FDFsurroundings{/BG \FDFcolor{#3}}}%
- \doifsomething{#4}
- {\xdef\FDFsurroundings{\FDFsurroundings\space /BC \FDFcolor{#4}}}%
- \ifx\FDFsurroundings\empty \else
- \xdef\FDFsurroundings{/MK << \FDFsurroundings\space>>}%
- \fi
- \egroup
- \egroup}
-
-%D \macros
-%D {setFDFactions}
-%D
-%D Depending on the type of the field, one can assign
-%D \JAVASCRIPT\ code to a mouse event or keystroke. The next
-%D preparation macro shows what events are handled.
-
-\let\FDFactions\empty
-
-\def\setFDFactions[#1,#2,#3,#4,#5,#6,#7,#8,%
- {\global\let\FDFactions\empty
- \setFDFaction D#1\relax% mousedown
- \setFDFaction U#2\relax% mouseup
- \setFDFaction E#3\relax% enterregion
- \setFDFaction X#4\relax% exitregion
- \setFDFaction K#5\relax% afterkeystroke
- \setFDFaction F#6\relax% formatresult
- \setFDFaction V#7\relax% validateresult
- \setFDFaction C#8\relax% calculatewhatever
- \setFDFactionsmore}
-
-\def\setFDFactionsmore#1,#2]%
- {\setFDFaction{Fo}#1\relax% focusin
- \setFDFaction{Bl}#2\relax% focusout % was I (now pdf ref manual explicitly talks about lowercase l)
- \ifx\FDFactions\empty\else
- \xdef\FDFactions{/AA << \FDFactions >>}% since 1.3 no longer inherited
- \fi}
-
-% todo, when new var scheme is implemented
-%
-% \setFDFaction{PO}\@@DriverFieldPageOpen\relax
-% \setFDFaction{PC}\@@DriverFieldPageClose\relax
-% \setFDFaction{PV}\@@DriverFieldPageVisible\relax
-% \setFDFaction{PI}\@@DriverFieldPageInVisible\relax
-
-%D The event handler becomes something:
-%D
-%D \starttyping
-%D /AA << /D << /S ... >> ... /C << /S ... >>
-%D /A << /S /JavaScript /JS (...) >>
-%D \stoptyping
-
-% \def\setFDFaction#1#2\relax%
-% {\bgroup
-% \global\let\sanitizedJScode\empty
-% \def\setFDFaction##1%
-% {\doifreferencefoundelse{##1}
-% {\doifelse{\currentreferencespecial}{JS} % filter non-js
-% {\presetJScode
-% \currentreferenceoperation
-% \currentreferencearguments
-% \doPSsanitizeJScode\JScode\to\JScode
-% \xdef\sanitizedJScode{\sanitizedJScode\space\JScode}}
-% {\illegalreference{##1}}}
-% {\unknownreference{##1}}}%
-% \@EA\processcommalist\@EA[#2]\setFDFaction % one level expansion
-% \ifx\sanitizedJScode\empty \else
-% \xdef\FDFactions%
-% {\FDFactions /#1 << /S /JavaScript /JS (\sanitizedJScode) >> }%
-% \fi
-% \egroup}
-%
-% acrobat 5 supports other that JS actions too
-
-\def\setFDFaction#1#2\relax%
- {\bgroup
- \def\docommand{\xdef\FDFactions{\FDFactions /#1 << \lastPDFaction >> }}%
- \@EA\handlereferenceactions\@EA{#2}\docommand % one level expansion
- \egroup}
-
-%D \macros
-%D {testFDFactions}
-%D
-%D This rather confusion prone series of script can be tested
-%D with:
-%D
-%D \starttyping
-%D \testFDFactions
-%D \stoptyping
-%D
-%D which simply redefined the previous macro to one that prints
-%D a message to the console.
-
-\def\testFDFactions
- {\def\setFDFaction##1##2\relax%
- {\doPSsanitizeJScode console.show();console.println("executing:##1"); \to\sanitizedJScode
- \edef\FDFactions{\FDFactions /##1 << /S /JavaScript /JS (\sanitizedJScode) >> }}}
-
-%D \macros
-%D {doFDFregistercalculationset}
-%D
-%D There is at most one calculation order list, which defines
-%D the order in which fields are calculated.
-
-\let\PDFcalculationset\empty
-
-\def\doFDFregistercalculationset#1%
- {\def\PDFcalculationset{#1}}
-
-%D \macros
-%D {registerFDFobject,everylastshipout}
-%D
-%D Officially one needs to embed some general datastructures
-%D that tell the viewer what fields are present in the file, as
-%D well as what resources they use. The next mechanism does that
-%D job automatically when one registers the field.
-
-\def\flushFDFnames
- {\ifbuildFDFdictionary
- \ifx\FDFcollection\empty\else
- \ifbuildFDFencodingvector
- \doPDFdictionaryobject{FDF}{local:encodingvector}{\FDFencodingvector}%
- \fi
- \defineFDFfonts
- \doPDFarrayobject{FDF}{local:fields}{\FDFcollection}%
- \doPDFgetobjectreference{FDF}{local:fields}\PDFobjectreference
- % The /NeedAppearances is pretty important because
- % otherwise Acrobat 5 blows up on cloned radio widgets
- \doPDFdictionaryobject{FDF}{local:acroform}
- {/Fields \PDFobjectreference\space
- /NeedAppearances true
- \doFDFiffieldset\PDFcalculationset{/CO [\doFDFgetfieldset\PDFcalculationset]}
- /DR << /Font << \FDFfonts >> >>
- /DA (/Helv 10 Tf 0 g)}%
- \doPDFgetobjectreference{FDF}{local:acroform}\PDFobjectreference
- \doPDFaddtocatalog
- {/AcroForm \PDFobjectreference}%
- \global\let\FDFcollection\empty
- \global\let\flushFDFnames\relax
- \fi
- \fi}
-
-\let\FDFcollection\empty
-
-\def\registerFDFobject#1%
- {\ifbuildFDFdictionary
- \ifx\flushFDFnames\relax
- \writestatus{FDF}{second run needed for field list (#1)}%
- \fi
- \doPDFgetobjectreference{FDF}{#1}\PDFobjectreference
- \xdef\FDFcollection{\FDFcollection\space\PDFobjectreference}%
- \fi}
-
-\appendtoksonce \flushFDFnames \to \everylastshipout % test \everybye / was \prependtoksonce
-
-%D \macros
-%D {defineFDFfonts,
-%D ifbuildFDFdictionary,
-%D ifbuildFDFencodingvector}
-%D
-%D Another datastruture concerns the fonts used. We only
-%D define the fonts we use.
-
-\newif\ifbuildFDFdictionary \buildFDFdictionarytrue
-\newif\ifbuildFDFencodingvector \buildFDFencodingvectortrue
-
-\def\defineFDFfonts
- {\let\FDFfonts\empty
- \processcommacommand[\FDFusedfonts]\defineFDFfont}
-
-\def\defineFDFfont#1%
- {\ifbuildFDFencodingvector
- \doPDFgetobjectreference{FDF}{local:encodingvector}\PDFobjectreference
- \fi
- \doPDFdictionaryobject{FDF}{local:#1}
- {/Type /Font
- /Subtype /Type1
- /Name /#1
- \ifbuildFDFencodingvector /Encoding \PDFobjectreference\space\fi
- /BaseFont /\getvalue{FDFname#1}}%
- \doPDFgetobjectreference{FDF}{local:#1}\PDFobjectreference
- \edef\FDFfonts{\FDFfonts \space/#1 \PDFobjectreference}}
-
-%D Another list of constants:
-
-\def\FDFnameTiRo {Times-Roman}
-\def\FDFnameTiBo {Times-Bold}
-\def\FDFnameTiIt {Times-Italic}
-\def\FDFnameTiBI {Times-BoldItalic}
-\def\FDFnameHelv {Helvetica}
-\def\FDFnameHeBo {Helvetica-Bold}
-\def\FDFnameHeOb {Helvetica-Oblique}
-\def\FDFnameHeBO {Helvetica-BoldOblique}
-\def\FDFnameCour {Courier}
-\def\FDFnameCoBo {Courier-Bold}
-\def\FDFnameCoOb {Courier-Oblique}
-\def\FDFnameCoBO {Courier-BoldOblique}
-
-%D And a big one: (should be run time loaded (spec-run or
-%D so)).
-
-\def\FDFencodingvector
- {/Type /Encoding
- /Differences
- [ 24 /breve /caron /circumflex /dotaccent /hungarumlaut /ogonek
- /ring /tilde
- 39 /quotesingle
- 96 /grave
- 128 /bullet /dagger /daggerdbl /ellipsis /emdash /endash /florin
- /fraction /guilsinglleft /guilsinglright /minus /perthousand
- /quotedblbase /quotedblleft /quotedblright /quoteleft
- /quoteright /quotesinglbase /trademark /fi /fl /Lslash /OE
- /Scaron /Ydieresis /Zcaron /dotlessi /lslash /oe /scaron
- /zcaron
- 164 /currency
- 166 /brokenbar
- 168 /dieresis /copyright /ordfeminine
- 172 /logicalnot /.notdef /registered /macron /degree /plusminus
- /twosuperior /threesuperior /acute /mu
- 183 /periodcentered /cedilla /onesuperior /ordmasculine
- 188 /onequarter /onehalf /threequarters 192 /Agrave /Aacute
- /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla /Egrave
- /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex
- /Idieresis /Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde
- /Odieresis /multiply /Oslash /Ugrave /Uacute /Ucircumflex
- /Udieresis /Yacute /Thorn /germandbls /agrave /aacute
- /acircumflex /atilde /adieresis /aring /ae /ccedilla /egrave
- /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex
- /idieresis /eth /ntilde /ograve /oacute /ocircumflex /otilde
- /odieresis /divide /oslash /ugrave /uacute /ucircumflex
- /udieresis /yacute /thorn /ydieresis ]}
-
-%D \macros
-%D {currentFDFmode,currentFDFparent,currentFDFkids,currenrFDFroot}
-%D
-%D There are three more quasi global interfacing variables
-%D that need to be set.
-
-\let\currentFDFmode =\fieldlonermode
-\let\currentFDFkids =\empty
-\let\currentFDFparent=\empty
-\let\currentFDFroot =\empty
-
-%D \macros
-%D {dosetfieldstatus}
-%D
-%D And here comes the special that deals with them.
-
-\definespecial\dosetfieldstatus#1#2#3#4%
- {\chardef\currentFDFmode #1%
- \edef\currentFDFparent {#2}%
- \edef\currentFDFkids {#3}%
- \edef\currentFDFroot {#4}}
-
-%D \macros
-%D {dosetuppageview}
-%D
-%D Because this command will seldom be called, we can permit
-%D slow action processing. We need three settings, one for
-%D direct \PDF\ inclusion, the other as \PDFTEX\ keyword, an
-%D a last one for form. All determine in what way the
-%D screen is adapted when going to a destination. Watch the
-%D space.
-
-\def\PDFpageviewkey{fit}
-\def\PDFpageviewwrd{/Fit}
-\def\PDFpageview {/View [\PDFpageviewwrd] }
-\let\PDFpagexyzspec\relax % 0 0 0 hack, pdftex does handle this, for dvipdfmx we need height
-
-\def\dosetuppageview#1% watch the v-h swapping here
- {\processaction
- [#1]
- [ \v!fit=>\def\PDFpageviewkey {fit}\def\PDFpageviewwrd{/Fit},
- \v!width=>\def\PDFpageviewkey {fith}\def\PDFpageviewwrd{/FitH},
- \v!height=>\def\PDFpageviewkey {fitv}\def\PDFpageviewwrd{/FitV},
- \v!minwidth=>\def\PDFpageviewkey{fitbh}\def\PDFpageviewwrd{/FitBH},
- \v!minheight=>\def\PDFpageviewkey{fitbv}\def\PDFpageviewwrd{/FitBV},
- \v!standard=>\ifx\PDFpagexyzspec\relax
- % empty does not work too wel with dpx
- \def\PDFpageviewkey{fit}%
- \def\PDFpageviewwrd{/Fit}%
- \else
- \edef\PDFpageviewkey{xyz \PDFpagexyzspec}%
- \edef\PDFpageviewwrd{/XYZ \PDFpagexyzspec}%
- \fi,
- \s!unknown=>\def\PDFpageviewkey {fit}\def\PDFpageviewwrd{/Fit}]%
- \edef\PDFpageview{\ifx\PDFpageviewwrd\empty\else/View [\PDFpageviewwrd]\fi}}
-
-%D \macros
-%D {setFDFkids}
-%D
-%D Clones as well as radiofields (which themselves can have
-%D cloned components) need a list of kids. The next macro
-%D builds one.
-
-\def\setFDFkids[#1][#2]% tag commalist
- {\let\FDFkids\empty
- \def\docommand##1%
- {\doPDFgetobjectreference{FDF}{#1##1}\PDFobjectreference
- \edef\FDFkids{\FDFkids\PDFobjectreference\space}}%
- \@EA\processcommalist\@EA[#2]\docommand
- \ifx\FDFkids\empty\else\edef\FDFkids{/Kids [\FDFkids]}\fi
-% \edef\FDFkids{/Kids [\FDFkids]}%
- }
-
-%D \macros
-%D {doFDFpresetlinefield,doFDFpresettextfield,
-%D doFDFpresetchoicefield,doFDFpresetpopupfield,doFDFpresetcombofield,
-%D doFDFpresetpushfield,doFDFpresetcheckfield,
-%D doFDFpresetfield,doFDFpresetradiorecord}
-%D
-%D I would say: read the \PDF\ reference manual first and see
-%D what happens here next. Lucky us that they have so much in
-%D common.
-
-\def\doFDFpresetlinefield#1#2#3#4#5#6#7#8#9%
- {\bgroup
- \setFDFlayer\@@DriverFieldLayer
- \setFDFswitches[#7]%
- \setFDFattributes[#6]%
- \setFDFalignment[#8]%
- \setFDFactions[#9]%
- \expanded{\escapePSstring#4}\to\FDFtext
- \ifcase\currentFDFmode
- \doPDFannotationobject{FDF}{#1}{#2}{#3}
- {/Subtype /Widget /T (#1) /FT /Tx
- /MaxLen \ifcase0#5 1000 \else#5 \fi
- %/DV (#4) /V (#4) % value added
- /DV (\FDFtext) /V (\FDFtext) % value added
- /Ff \FDFflag\space
- /F \FDFplus\space
- /DA (\FDFattributes)
- \FDFlayer\space
- \FDFsurroundings\space
- /Q \FDFalign\space
- \FDFactions}%
- \registerFDFobject{#1}%
- \or
- \setFDFkids[kids:][\currentFDFkids]%
- \doPDFdictionaryobject{FDF}{#1}
- {/T (#1) /FT /Tx
- /MaxLen \ifcase0#5 1000 \else#5 \fi
- \FDFkids\space
- %/DV (#4) /V (#4) % value added
- /DV (\FDFtext) /V (\FDFtext) % value added
- /Ff \FDFflag\space
- /F \FDFplus\space
- /DA (\FDFattributes)
- \FDFlayer\space
- \FDFsurroundings\space
- /Q \FDFalign\space
- \FDFactions}%
- \registerFDFobject{#1}%
- \or
- \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference
- %\global\objectreferencingtrue
- \doPDFannotationobject{FDF}{kids:#1}{#2}{#3}
- {/Subtype /Widget
- /Parent \PDFobjectreference
- /Ff \FDFflag\space
- /F \FDFplus\space
- /DA (\FDFattributes)
- \FDFlayer\space
- \FDFsurroundings\space
- /Q \FDFalign\space
- \FDFactions}%
- \or
- \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference
- %\global\objectreferencingtrue
- \doPDFannotationobject{FDF}{kids:#1}{#2}{#3}
- {/Subtype /Widget
- /Parent \PDFobjectreference
- /F \FDFplus
- \FDFactions}%
- \fi
- \egroup}
-
-\def\doFDFpresettextfield#1#2#3#4#5#6#7#8#9%
- {\doFDFpresetlinefield{#1}{#2}{#3}{#4}{#5}{#6}{MultiLine,#7}{#8}{#9}}
-
-\def\doFDFpresetchoicefield#1#2#3#4#5#6#7#8%
- {\bgroup
- \setFDFlayer\@@DriverFieldLayer
- \setFDFswitches[#6]%
- \setFDFattributes[#5]%
- \setFDFvalues[#7][#4]%
- \setFDFactions[#8]%
- \ifcase\currentFDFmode
- \doPDFannotationobject{FDF}{#1}{#2}{#3}
- {/Subtype /Widget
- /T (#1) /FT /Ch
- /DV (#4) /V (#4)
- /Ff \FDFflag\space
- /F \FDFplus\space
- /DA (\FDFattributes)
- \FDFlayer\space
- \FDFsurroundings\space
- /Opt [\FDFvalues]
- \FDFactions}%
- \registerFDFobject{#1}%
- \or
- \setFDFkids[kids:][\currentFDFkids]%
- \doPDFdictionaryobject{FDF}{#1}
- {/T (#1) /FT /Ch
- \FDFkids\space
- /DV (#4) /V (#4)
- /Ff \FDFflag\space
- /F \FDFplus\space
- /DA (\FDFattributes)
- \FDFlayer\space
- \FDFsurroundings\space
- /Opt [\FDFvalues]
- \FDFactions}%
- \registerFDFobject{#1}%
- \or
- \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference
- %\global\objectreferencingtrue
- \doPDFannotationobject{FDF}{kids:#1}{#2}{#3}
- {/Subtype /Widget
- /Parent \PDFobjectreference
- /Ff \FDFflag\space
- /F \FDFplus\space
- /DA (\FDFattributes)
- \FDFlayer\space
- \FDFsurroundings\space
- \FDFactions}%
- \or
- \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference
- %\global\objectreferencingtrue
- \doPDFannotationobject{FDF}{kids:#1}{#2}{#3}
- {/Subtype /Widget
- /Parent \PDFobjectreference
- /F \FDFplus
- \FDFactions}%
- \fi
- \egroup}
-
-\def\doFDFpresetpopupfield#1#2#3#4#5#6#7#8%
- {\doFDFpresetchoicefield{#1}{#2}{#3}{#4}{#5}{PopUp,#6}{#7}{#8}}
-
-\def\doFDFpresetcombofield#1#2#3#4#5#6#7#8%
- {\doFDFpresetchoicefield{#1}{#2}{#3}{#4}{#5}{PopUp,Edit,#6}{#7}{#8}}
-
-\newif\ifFDFvalues
-
-\def\doFDFpresetpushcheckfield#1#2#3#4#5#6#7#8% in acro<5 (\FDFdefault)
- {\bgroup % in acro>5 /\FDFdefault
- \setFDFlayer\@@DriverFieldLayer
- \ifcase#8\relax\FDFvaluesfalse\else\FDFvaluestrue\fi
- \setFDFswitches[#5]%
- \setFDFactions[#7]%
- \doifelse{#4}{1}
- {\def\FDFdefault{On}}
- {\def\FDFdefault{Off}}%
- \ifcase\currentFDFmode
- \doFDFappearance{On}{#6}{#8}%
- \doPDFannotationobject{FDF}{#1}{#2}{#3}
- {/Subtype /Widget /T (#1) /FT /Btn
- \ifFDFvalues
- /DV /\FDFdefault\space
- /V /\FDFdefault\space
- /AS /\FDFdefault\space
- \fi
- \FDFlayer
- /Ff \FDFflag\space
- /F \FDFplus\space
- \FDFlayer\space
- \FDFappearance\space
-% /IF << /SW /N >> % strange, only works for stupid buttons
- \FDFactions}%
- \registerFDFobject{#1}%
- \or % no appearance and layer ?
- \setFDFkids[kids:][\currentFDFkids]%
- \doPDFdictionaryobject{FDF}{#1}
- {/T (#1) /FT /Btn
- \FDFkids\space
- \ifFDFvalues
- /DV /\FDFdefault\space
- /V /\FDFdefault\space
- /AS /\FDFdefault\space
- \fi
- /Ff \FDFflag\space
- /F \FDFplus\space
- \FDFactions}%
- \registerFDFobject{#1}%
- \or
- \doFDFappearance{On}{#6}{#8}%
- \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference
- %\global\objectreferencingtrue
- \doPDFannotationobject{FDF}{kids:#1}{#2}{#3}
- {/Subtype /Widget
- /Parent \PDFobjectreference\space
- \ifFDFvalues
- /DV /\FDFdefault\space
- /V /\FDFdefault\space
- /AS /\FDFdefault\space
- \fi
- /Ff \FDFflag\space
- /F \FDFplus\space
- \FDFlayer\space
- \FDFappearance\space
- \FDFactions}%
- \or
- \doFDFappearance{On}{#6}{#8}%
- \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference
- %\global\objectreferencingtrue
- \doPDFannotationobject{FDF}{kids:#1}{#2}{#3}
- {/Subtype /Widget
- /Parent \PDFobjectreference\space
- /F \FDFplus\space
- \ifFDFvalues
- /DV /\FDFdefault\space
- /V /\FDFdefault\space
- /AS /\FDFdefault\space
- \fi
- \FDFlayer\space
- \FDFappearance
- \FDFactions}%
- \fi
- \egroup}
-
-\def\doFDFpresetpushfield#1#2#3#4#5#6#7%
- {\doFDFpresetpushcheckfield{#1}{#2}{#3}{#4}{PushButton,#5}{#6}{#7}{0}}
-
-\def\doFDFpresetcheckfield#1#2#3#4#5#6#7%
- {\doFDFpresetpushcheckfield{#1}{#2}{#3}{#4}{#5}{#6}{#7}{1}}
-
-% As pdf widgets are rather consistently upward incompatible
-% especially with regards to inheritance, the following code is not
-% quite okay. I've decided no longer to bother about in it in MkII
-% and use a flat model in MkIV which somehow seems to work better.
-
-\def\doFDFpresetradiofield#1#2#3#4#5#6#7#8%
- {\bgroup
- \setFDFlayer\@@DriverFieldLayer
- \FDFvaluestrue
- \setFDFswitches[#5]%
- \setFDFactions[#8]%
- \doifelsenothing{#4}
- {\def\FDFdefault{Off}}
- {\def\FDFdefault{#4}}%
- \@EA\aftersplitstring\FDFdefault\at=>\to\FDFdefaultvalue
- \ifx\FDFdefaultvalue\empty\else\let\FDFdefault\FDFdefaultvalue\fi
- \ifcase\currentFDFmode
- \doFDFappearance{#1}{#7}{1}%
- \doPDFgetobjectreference{FDF}{#6}\PDFobjectreference
- \doPDFannotationobject{FDF}{#1}{#2}{#3}
- {/Subtype /Widget
- /Parent \PDFobjectreference\space
- /F \FDFplus\space
- /AS /\FDFdefault\space
- \FDFlayer\space
- \FDFappearance\space
- \FDFactions}%
- \registerFDFobject{#1}%
- \or
- \setFDFkids[kids:][\currentFDFkids]%
- \doPDFgetobjectreference{FDF}{#6}\PDFobjectreference
- \doPDFdictionaryobject{FDF}{#1}
- {/Parent \PDFobjectreference\space
- \FDFkids\space
- /F \FDFplus\space
- \FDFactions}%
- \registerFDFobject{#1}%
- \or
- %\doFDFappearance{#1}{#7}{1}%
- \doFDFappearance{\currentFDFparent}{#7}{1}%
- \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference
- %\global\objectreferencingtrue % nb
- \doPDFannotationobject{FDF}{kids:#1}{#2}{#3}
- {/Subtype /Widget
- /Parent \PDFobjectreference\space
- /AS /\FDFdefault\space
- /F \FDFplus\space
- \FDFlayer\space
- \FDFappearance\space
- \FDFactions}%
- \or
- %\doFDFappearance{#1}{#7}{1}%
- \doFDFappearance{\currentFDFparent}{#7}{1}%
- \doPDFgetobjectreference{FDF}\currentFDFparent\PDFobjectreference
- %\global\objectreferencingtrue
- \doPDFannotationobject{FDF}{kids:#1}{#2}{#3}
- {/Subtype /Widget
- /Parent \PDFobjectreference\space
- /AS /\FDFdefault\space
- /F \FDFplus\space
- \FDFlayer\space
- \FDFappearance\space
- \FDFactions}%
- \fi
- \egroup}
-
-%D \macros
-%D {setFDFstrings}
-%D
-%D This one creates a string array.
-
-%\def\setFDFstrings[#1]%
-% {\let\FDFstrings\empty
-% \def\docommand##1{\edef\FDFstrings{\FDFstrings(##1)}}%
-% \processcommacommand[#1]\docommand}
-
-% Beware, RadiosInUnison is really needed in the pre 1.5/6 time this
-% was the default but out of a sudden it's no longer the case. Also
-% the NoToggleToOff interferes with kids of kids and both it will
-% break older documents, i.e. so much for pdf as standard. With
-% features like widgets we can probably best wait till adobe tools
-% themselves support it because that's probably the moment that
-% functionality gets frozen/becomes definitive. Actually, acrobat
-% flattens the kids tree, so that's yet another situation. The
-% interesting thing is that it worked ok in acrobat 2/3 but got bugged
-% in later versions. [The rationale is in html compatibility, which
-% seems to be more important than compatibility of documents, which in
-% turn renders acrobat useless for forms.] Anyway, synchronization is
-% broken or not depending on the combination pdfversion/acrobatversion.
-%
-% Hm, nowadays Radio will overload RadiosInUnison so we need to use only one
-% of them.
-
-\def\doFDFpresetradiorecord#1#2#3#4#5%
- {\bgroup
- % < pdf 1.5 (1.5 was broken)
- % \setFDFswitches[Radio,NoToggleToOff,RadiosInUnison,#3]%
- % > pdf 1.5
- % \setFDFswitches[Radio,RadiosInUnison,#3]%
- % > pdf 1.6
- \setFDFswitches[RadiosInUnison,#3]%
- %setFDFswitches[PushButton,RadiosInUnison,#3]% this is what acrobat itself does
- % older, else fatal error
- % \setFDFkids[#4][]%
- % newer
- \setFDFvalues[#4][#2]% inits kidlist
- \expanded{\setFDFkids[][\FDFkidlist]}%
- %
- \setFDFactions[#5]%
- \doPDFdictionaryobject{FDF}{#1}
- {%/Subtype /Widget
- /FT /Btn /T (#1) /Rect [0 0 0 0]
- % used to be this
- % /V (#2)
- % then this
- % /DV (#2)
- % since this bomded in 5
- % /V (#2)
- % and now finally this works
- /H /N
- % /opt is buggy in 5.05, only works once, sigh
- %\ifx\FDFfirstvalues\FDFsecondvalues
- /V /#2
- %\else
- % /V /\FDFdefaultindex\space
- % /Opt [\FDFsecondvalues]
- %\fi
- /Ff \FDFflag\space
- /F \FDFplus\space
- \FDFkids\space
- \FDFactions}%
- \egroup}
-
-%D At the cost of some more references, we can save bytes,
-%D by sharing appearance dictionaries. This code needs more
-%D documentation. Surprise:
-
-\def\dodoFDFappearance#1#2%
- {\ifx#2\empty\else
- \dogetcommacommandelement1\from#2\to\commalistelement
- \ifx\commalistelement\empty\else
- \doPDFgetobjectreference{SYM}\commalistelement\PDFobjectreference
- \edef\N{\ifFDFvalues\N /#1 \fi\PDFobjectreference\space}%
- \fi
- \dogetcommacommandelement2\from#2\to\commalistelement
- \ifx\commalistelement\empty\else
- \doPDFgetobjectreference{SYM}\commalistelement\PDFobjectreference
- \edef\R{\ifFDFvalues\R /#1 \fi\PDFobjectreference\space}%
- \fi
- \dogetcommacommandelement3\from#2\to\commalistelement
- \ifx\commalistelement\empty\else
- \doPDFgetobjectreference{SYM}\commalistelement\PDFobjectreference
- \edef\D{\ifFDFvalues\D /#1 \fi\PDFobjectreference\space}%
- \def\FDFappearance{/H /P }%
- \fi
- \fi}
-
-\def\redoFDFappearance#1%
- {\ifx#1\empty\else
- \dogetcommacommandelement3\from#1\to\commalistelement
- \ifx\commalistelement\empty\else
- \def\FDFappearance{/H /P }%
- \fi
- \fi}
-
-\def\doFDFappearance#1#2#3%
- {\ifcase#3\relax % push only field
- \edef\yes{#2}%
- \let\no\empty
- \else % on / off field
- \dogetcommacommandelement1\from#2,\to\yes
- \dogetcommacommandelement2\from#2,\to\no
- \fi
- \def\FDFappearance{/H /N}%
- \doifobjectfoundelse{FDF}{ap:#1:\yes:\no}
- {\redoFDFappearance\yes
- \redoFDFappearance\no}
- {\presetobject{FDF}{ap:#1:\yes:\no}% funny hack
- \let\N\empty\let\R\empty\let\D\empty
- \dodoFDFappearance{#1}\yes
- \dodoFDFappearance{Off}\no
- \doPDFdictionaryobject{FDF}{ap:#1:\yes:\no}
- {\ifx\N\empty\else/N \ifFDFvalues<<\N>>\else\N\fi\fi
- \ifx\R\empty\else/R \ifFDFvalues<<\R>>\else\R\fi\fi
- \ifx\D\empty\else/D \ifFDFvalues<<\D>>\else\D\fi\fi}}%
- \doPDFgetobjectreference{FDF}{ap:#1:\yes:\no}\PDFobjectreference
- \edef\FDFappearance{\FDFappearance /AP \PDFobjectreference}}
-
-%\def\doFDFdefault#1#2%
-% {\dogetcommacommandelement1\from#1,\to\commalistelement
-% \dogetcommacommandelement1\from\commalistelement\to\commalistelement
-% \doifelse{\commalistelement}{#2} % kan ook met \ifx
-% {\def\FDFdefault{On}}{\def\FDFdefault{Off}}}
-
-\def\doFDFdefault#1#2%
- {\doifelse{#2}{1}{\def\FDFdefault{On}}{\def\FDFdefault{Off}}}
-
-%D Layer support:
-
-\def\setFDFlayer#1% todo : \ifx\PDFobjectreference\noPDFobjectreference ipv found
- {\letempty\FDFlayer
- \doifsomething{#1}%
- {\checkproperty[#1]% == \dodocheckproperty\@@DriverFieldLayer
- \doifobjectreferencefoundelse{PDLN}{#1}
- {\doPDFgetobjectreference{PDLN}{#1}\!!stringa % we need to avoid a clash with other macros
- \edef\FDFlayer{/OC \!!stringa}}%
- \donothing}}
-
-%D The three appearances {\em normal}, \type{roll over} and
-%D \type{push down} are passed as comma separated triplets,
-%D that is, the second argument can look like:
-%D
-%D \starttyping
-%D {yes,ok,fine},{no,rubish,awful}
-%D \stoptyping
-
-%D \macros
-%D {doFDFdefinefieldset,doFDFgetfieldset,doFDFiffieldset}
-%D
-%D Field sets, the ones we use in submitting and resetting
-%D fields, are implemented using the next low level specials:
-%D
-%D \starttyping
-%D \doFDFdefinefieldset{TAG}{name,name,...}
-%D \doFDFgetfieldset{TAG}
-%D \doFDFiffieldset{TAG}{sequence}
-%D \stoptyping
-
-\def\doFDFdefinefieldset#1#2% tag commalist
- {\let\FDFfieldset\empty
- \def\docommand##1%
- {\doPDFgetobjectreference{FDF}{##1}\PDFobjectreference
- \edef\FDFfieldset{\FDFfieldset\PDFobjectreference\space}}%
- \processcommacommand[#2]\docommand % nb: command
- \setevalue{FDF:set:#1}{\FDFfieldset}}
-
-\def\doFDFgetfieldset#1%
- {\getvalue{FDF:set:#1}}
-
-\def\doFDFiffieldset#1#2%
- {\ifundefined{FDF:set:#1}\else#2\fi}
-
-%D In the goto specials we took care of secondary references.
-%D Here we define the macros used.
-
-\def\doPDFresetgotowhereever
- {\global\let\secondaryPDFreferences\empty}
-
-\doPDFresetgotowhereever % just to be sure
-
-% we can (in etex) share more by testing on this
-
-\def\savesecondaryPDFreference#1%
- {\@EA\xdef\csname PDF-SR:\the\nofsecondaryreferences\endcsname{#1}}
-
-\def\savesecondaryPDFreference % #1 == \action
- {\global\@EA\let\csname PDF-SR:\the\nofsecondaryreferences\endcsname}
-
-%\def\getsecondaryPDFreferences%
-% {\ifcase\nofsecondaryreferences\else
-% %\doifdefined{PDF-SR:\the\nofsecondaryreferences}
-% \xdef\secondaryPDFreferences%
-% {/Next << \csname PDF-SR:\the\nofsecondaryreferences\endcsname\space
-% \secondaryPDFreferences >>}%
-% \global\advance\nofsecondaryreferences \minusone
-% \expandafter\getsecondaryPDFreferences
-% \fi}
-
-% test should happen in core-ref
-
-\def\getsecondaryPDFreferences
- {\ifcase\nofsecondaryreferences\else
- \ifcsname PDF-SR:\the\nofsecondaryreferences\endcsname
- \xdef\secondaryPDFreferences
- {/Next << \csname PDF-SR:\the\nofsecondaryreferences\endcsname\space
- \secondaryPDFreferences >>}%
- \fi
- \global\advance\nofsecondaryreferences \minusone
- \expandafter\getsecondaryPDFreferences
- \fi}
-
-%D \macros
-%D {loadFDFfields, showFDFfields,
-%D getFDFfield, setFDFfield}
-%D
-%D Once filled in, we can export or submit the field in the
-%D \FDF\ file format. Such a file can be loaded by
-%D
-%D \starttyping
-%D \loadFDFfields{fiel-ini}
-%D \stoptyping
-%D
-%D or inspected by
-%D
-%D \starttyping
-%D \showFDFfields{fiel-ini}
-%D \stoptyping
-%D
-%D After both commands, one can use
-%D
-%D \starttyping
-%D \getFDFfield{name}
-%D \setFDFfield{name}{value}
-%D \stoptyping
-%D
-%D to inspect and overrule the data.
-%D
-%D By default \CONTEXT\ calls the perl script \type{fdf2tex}.
-%D This script reads the \type{fdf} file and produces a file
-%D named \type{filename.fdt}. If one disables the call to this
-%D script, by saying:
-%D
-%D \starttyping
-%D \runFDFconverterfalse
-%D \stoptyping
-%D
-%D or when \CONTEXT\ cannot find the \type{fdt} file, it tries
-%D to interpret the \type{fdf} file directly. Both mechanisms
-%D are rather crude.
-
-\newif\ifrunFDFconverter \runFDFconvertertrue
-
-%D The \PERL\ script produces a file formatted as:
-%D
-%D \starttyping
-%D \beginFDFobject
-%D \beginFDFdata
-%D \beginFDFfields
-%D \FDFfield[name=,value=]
-%D \endFDFfields
-%D \endFDFdata
-%D \endFDFobject
-%D \stoptyping
-%D
-%D One reason for using key value pairs is that we cannot be
-%D sure or the order in which the name and value are given
-%D (actually the reverse).
-
-\def\PERLloadFDFfields#1% will become obsolete soon
- {\bgroup
- \global\let\allFDFfields\empty
- \ifrunFDFconverter
- \executesystemcommand{fdf2tex #1}%
- \let\beginFDFobject\relax \let\endFDFobject\relax
- \let\beginFDFdata \relax \let\endFDFdata \relax
- \let\beginFDFfields\relax \let\endFDFfields\relax
- \def\FDFfield[##1]%
- {\getparameters[FDF][##1]%
- \doglobal\addtocommalist\FDFname\allFDFfields
- \global\setFDFfield{\FDFname}{\FDFvalue}}%
- \ReadFile{#1.fdt}%
- \fi
- \egroup}
-
-%D The next macro does the same job, but now in the \TEX\ way
-%D of doing things. Easy eh? Will become obsolete!
-
-\bgroup
-
-\catcode`\/=\@@other
-\global\let\normalslash=/
-\catcode`\/=\@@escape
-
-\gdef\TEXloadFDFfields#1% will become obsolete due to XFDF
- {\bgroup
- \setbox0=\hbox
- {\global\let\allFDFfields\empty
- \scratchcounter=0
- \escapechar=-1
- \catcode`\/=\@@escape
- \catcode`\(=\@@begingroup
- \catcode`\)=\@@endgroup
- \catcode`\%=\@@letter
- \let/A =\relax \let/AS =\relax \let/Kids=\relax \let/Fields=\relax
- \let/F =\relax \let/ID =\relax \let/SetF=\relax \let/setFf =\relax
- \let/Ff=\relax \let/Opt=\relax \let/ClrF=\relax \let/ClrFf =\relax
- \let/AP=\relax \let/FDF=\relax \let/Root=\relax
- \def/T##1{\check\Title{##1}}
- \def/V{\bgroup\catcode`\/=\@@other\futurelet\next/doV}
- \def/doV{\ifx\next\normalslash\@EA/doVb\else\@EA/doVa\fi}
- \def/doVa##1{\egroup\check\Value{##1}}
- \def/doVb##1##2 {\egroup\check\Value{##2}} % watch the space
- \def\check##1##2%
- {\def##1{##2}
- \advance\scratchcounter\plusone\relax
- \ifodd\scratchcounter \else
- \defconvertedcommand\asciia\Title
- \global\setFDFfield{\asciia}{\Value}
- \doglobal\addtocommalist\Title\allFDFfields
- \fi}
- \ReadFile{#1.fdf}}%
- \egroup}
-
-\egroup
-
-%D Whatever mechanism is used, the next macros can be used to
-%D fetch the values.
-
-\def\getFDFfield #1{\getvalue {FDFfield::#1}}
-\def\setFDFfield#1#2{\setevalue{FDFfield::#1}{#2}}
-
-%D Of course the fields are only present when the file is
-%D loaded.
-
-\def\loadFDFfields#1%
- {\PERLloadFDFfields{#1}%
- \ifx\allFDFfields\empty
- \TEXloadFDFfields{#1}%
- \fi}
-
-\def\showFDFfields#1%
- {\bgroup
- \loadFDFfields{#1}
- \def\docommand##1{\par##1 = \getFDFfield{##1}\par}%
- \processcommacommand[\allFDFfields]\docommand
- \egroup}
-
-%D \macros
-%D {sanitizePDFencoding,sanitizePDFdocencoding}
-%D
-%D We already dealt with the encoding vector. Conversion from
-%D \TEX\ \ASCII\ encoding to the other one, is accomplished by
-%D the next few macros. Wach out: we don't group here.
-
-%D This will be reimplemented using the mapping mechanism.
-
-% \def\enablePDFdocencoding
-% {\reducetocoding[pdfdoc]\simplifycommands}
-
-\def\enablePDFdocencoding
- {\enablecoding[pdfdoc]%
- \enablelanguagespecifics[\currentlanguage]% redundant ?
- \simplifycommands}
-
-\long\def\sanitizePDFdocencoding#1\to#2%
- {\enablePDFcrlf
- \enablePDFdocencoding
- %\honorunexpanded % otherwise problems with "e etc in de
- \edef#2{#1}}
-
-\bgroup
-\catcode`\^^M=\@@active
-\gdef\enablePDFcrlf%
- {\def\\{\string\r}%
- \def\par{\\\\}%
- \def\endgraf{\\\\}%
- \catcode`\^^M=\@@active%
- \let^^M=\\}
-\egroup
-
-% \let\sanitizePDFencoding\sanitizePDFdocencoding
-
-%D The conversions comes down to (for the sake of speed the
-%D implementation combines steps):
-%D
-%D \startitemize
-%D \item we expand the \UTF\ sequences into \type {\unicodechar}'s
-%D \item spaces become character 255's (so that they are not
-%D gobbled in argument fetching
-%D \item normal \ASCII\ chars are unchanged
-%D \item \par's and alike are converted to \type {\unicodechar}'s
-%D \stopitemize
-%D
-%D This happens by expansion; next we convert the resulting
-%D sequence by interpreting the stream.
-
-\long\def\sanitizePDFuniencoding#1\to#2%
- {\enablePDFunicrlf
- \simplifycommands % added due to Dohyun Kim
- \let\unicodechar\relax % prevent further expansion
- \retainlccodes\lccode32=255 % slooow
- \lowercasestring\PDFunicodetrigger#1\to#2%
- \edef#2{\expandafter\doPDFuni#2\empty\empty}} % slooow
-
-%D Handling of empty lines:
-
-\bgroup
-\catcode`\^^M=\@@active
-\gdef\enablePDFunicrlf%
- {\def\\{\unicodechar{13}}%
- \def\par{\\\\}%
- \catcode`\^^M=\@@active%
- \let^^M=\\}
-\egroup
-
-%D Conversion to 16 bit \UNICODE:
-
-\def\PDFunicodechar#1%
- {\@EA\lchexnumbers\@EA{\number\utfdiv{#1}}%
- \@EA\lchexnumbers\@EA{\number\utfmod{#1}}}
-
-\def\PDFunicodetrigger
- {\unicodechar{65279}}
-
-%D The postprocessor:
-
-\def\doPDFuni#1%
- {\ifx#1\relax
- \@EA\dodoPDFuni
- \else\ifx#1\empty
- % quit
- \else
- \@EAEAEA\nodoPDFuni
- \fi\fi#1}
-
-\def\nodoPDFuni#1%
- {\PDFunicodechar{\ifnum`#1=255 32\else`#1\fi}\doPDFuni}
-
-\def\dodoPDFuni#1#2%
- {\PDFunicodechar{#2}\doPDFuni}
-
-\def\sanitizePDFencoding
- {\doifelse\currentregime{utf}{\PDFunicodetrue\sanitizePDFuniencoding}\sanitizePDFdocencoding}
-
-%D A bit out of place, but useful:
-
-\ifdefined\everysetfield \else \newtoks\everysetfield \fi
-
-\appendtoksonce
- \enablePDFdocencoding
- \enablePDFcrlf
-\to \everysetfield
-
-%D \macros
-%D {doPDFinsertcomment}
-%D
-%D An example its use is the next special, one that deals with
-%D text annotations.
-
-% starting point (keep this)
-%
-% \long\def\doPDFinsertcomment#1#2#3#4#5#6#7#8%
-% {\bgroup % title width height color open symbol collect data
-% \doifelsenothing{#1}
-% {\let\PDFidentifier\empty}
-% {\def\PDFidentifier{/T (#1)}}%
-% \doifelsenothing{#4}
-% {\let\PDFattributes\empty}
-% {\def\PDFattributes{/C \FDFcolor{#4}}}%
-% \doifundefinedelse{PDFsymbol#6}
-% {\let\PDFsymbol\empty}
-% {\def\PDFsymbol{/Name \getvalue{PDFsymbol#6} }}%
-% \sanitizePDFencoding#8\to\PDFdata
-% \setbox\scratchbox\vbox to #3
-% {\vfill
-% \doPDFannotation{#2}{#3}
-% {/Subtype /Text
-% \ifcase#5 \else/Open true\fi
-% /Contents \ifPDFunicode <\PDFdata> \else(\PDFdata) \fi
-% \PDFsymbol
-% \PDFidentifier
-% \PDFattributes}}%
-% \wd\scratchbox\zeropoint
-% \ht\scratchbox\zeropoint
-% \dp\scratchbox\zeropoint
-% \box\scratchbox
-% \egroup}
-
-\newcounter\nofFDFcomments
-
-\newif\ifPDFpopupcomments \PDFpopupcommentstrue
-
-\def\doPDFflushcomments
- {\box\PDFsymbolbox}
-
-\long\def\doPDFinsertcomment#1#2#3#4#5#6#7#8% % \@@DriverCommentLayer set otherwise
- {\bgroup % title width height color open symbol collect data
- \presetPDFsymbolappearance{#4}{#6}{#2}{#3}\!!zeropoint% sets width/height
-% \doifelsenothing{#1}
-% {\let\PDFidentifier\empty}
-% {\def\PDFidentifier{/T (#1)}}%
- \doifelsenothing{#1}
- {\let\PDFidentifier\empty}
- {\sanitizePDFencoding#1\to\PDFcommenttitle
- \def\PDFidentifier{/T \ifPDFunicode <\PDFcommenttitle>\else (\PDFcommenttitle)\fi}}%
- \sanitizePDFencoding#8\to\PDFdata
- \setFDFlayer\@@DriverCommentLayer
- \startPDFsymbolappearance
- \ifPDFpopupcomments
- \doglobal\increment\nofFDFcomments
- \doifobjectreferencefoundelse{FDF}{c:\nofFDFcomments}
- {\doPDFgetobjectreference{FDF}{c:\nofFDFcomments}\PDFobjectreference
- \donetrue}
- \donefalse
- \ifdone
- \setbox\scratchbox\hbox
- {\doPDFannotationobject{FDF}{c::\nofFDFcomments}{#2}{#3}% text window, size does not work
- {/Subtype /Popup
- /Parent \PDFobjectreference}}%
- \ifcase#7\relax
- \vbox to \height{\forgetall\vskip#3\box\scratchbox\vss}%
- \else % incredible trial and error hack
- % it's quite a mess, the annot width cannot be set, well, it can
- % but the appearance and text sizes get mixed up
-% \setbox\scratchbox\vbox to \height{\forgetall\vskip#3\box\scratchbox\vss}%
-% \global\setbox\PDFsymbolbox\vbox
-% {\hsize#2%
-% \forgetall
-% \vsmash{\box\PDFsymbolbox}
-% \box\scratchbox}%
- % this may change when acrobat gets less bugged
- \setbox\scratchbox\vbox to #3{\forgetall\vss\box\scratchbox}%
- \wd\scratchbox#2%
- \global\setbox\PDFsymbolbox\vbox
- {\startoverlay{\box\PDFsymbolbox}{\box\scratchbox}\stopoverlay}%
- \fi
- \fi
- % generic
- \doifobjectreferencefoundelse{FDF}{c::\nofFDFcomments}
- {\doPDFgetobjectreference{FDF}{c::\nofFDFcomments}\PDFobjectreference
- \donetrue}
- \donefalse
- \doPDFannotationobject{FDF}{c:\nofFDFcomments}{\width}{\height}
- {/Subtype /Text
- \ifcase#5 \else/Open true\fi
- % pdftex (efficient)
- % \ifdone /Popup \PDFobjref\pdflastannot\fi
- % generic (less efficient)
- \ifdone /Popup \PDFobjectreference\fi
- /Contents \ifPDFunicode <\PDFdata> \else(\PDFdata) \fi
- \PDFidentifier
- \FDFlayer
- \PDFsymbol
- \PDFattributes}%
- \else
- \doPDFannotation{#2}{#3}
- {/Subtype /Text
- \ifcase#5 \else/Open true\fi
- /Contents \ifPDFunicode <\PDFdata> \else(\PDFdata) \fi
- \FDFlayer
- \PDFsymbol
- \PDFidentifier
- \PDFattributes}%
- \fi
- \stopPDFsymbolappearance
- \egroup}
-
-% symbols with a reasonable default of 18/24 pt
-
-\newbox\PDFsymbolbox
-
-\def\PDFsymbolNew {/Insert}
-\def\PDFsymbolBalloon {/Comment}
-\def\PDFsymbolAddition {/NewParagraph}
-\def\PDFsymbolHelp {/Help}
-\def\PDFsymbolParagraph {/Paragraph}
-\def\PDFsymbolKey {/Key }
-
-\def\PDFsymbolGraph {/Graph}
-\def\PDFsymbolPaperclip {/Paperclip}
-\def\PDFsymbolAttachment{/Attachment}
-\def\PDFsymbolTag {/Tag}
-
-\def\startPDFsymbolappearance
- {\setbox\scratchbox\vbox to \totalheight \bgroup \vfill}
-
-\def\stopPDFsymbolappearance
- {\egroup
- \setbox\scratchbox\hbox{\lower\depth\box\scratchbox}%
- \wd\scratchbox\width
- \ht\scratchbox\height
- \dp\scratchbox\depth
- \box\scratchbox}
-
-\def\presetPDFsymbolappearance#1#2#3#4#5% symbol color width height depth
- {\doifelsenothing{#1}
- {\let\PDFattributes\empty}
- {\def\PDFattributes{/C \FDFcolor{#1}}}%
- \scratchdimen#3\edef\width {\the\scratchdimen}%
- \scratchdimen#4\edef\height{\the\scratchdimen}%
- \scratchdimen#5\edef\depth {\the\scratchdimen}%
- \advance\scratchdimen\height\edef\totalheight{\the\scratchdimen}%
- \doifelsenothing{#2}
- {\let\PDFsymbol\empty}
- {\ifundefined{PDFsymbol#2}%
- \getfromcommacommand[#2][1]\let\PDFsymbolnormalsymbol\commalistelement
- \getfromcommacommand[#2][2]\let\PDFsymboldownsymbol \commalistelement
- \doifsymboldefinedelse\PDFsymbolnormalsymbol
- {\doifsymboldefinedelse\PDFsymboldownsymbol
- {\dopresetPDFsymbolappearance
- \PDFsymbolnormalsymbol\PDFsymboldownsymbol}
- {\dopresetPDFsymbolappearance
- \PDFsymbolnormalsymbol\PDFsymbolnormalsymbol}}
- {\doifsymboldefinedelse\PDFsymboldownsymbol
- {\dopresetPDFsymbolappearance
- \PDFsymboldownsymbol\PDFsymboldownsymbol}
- {\let\PDFsymbol\empty}}%
- \else
- \def\PDFsymbol{/Name \getvalue{PDFsymbol#2} }%
- \fi}}
-
-\def\dopresetPDFsymbolappearance#1#2%
- {\dopresetfieldsymbol{#1}%
- \dopresetfieldsymbol{#2}%
- \setbox\scratchbox\hbox{\symbol[#1]}%
- \edef\width {\the\wd\scratchbox}%
- \edef\height{\the\ht\scratchbox}%
- \edef\depth {\the\dp\scratchbox}%
- \scratchdimen\height \advance\scratchdimen\depth
- \edef\totalheight{\the\scratchdimen}%
- \doPDFgetobjectreference{SYM}{#1}\FDFsymbolNappearance
- \doPDFgetobjectreference{SYM}{#2}\FDFsymbolDappearance
- \edef\PDFsymbol
- {/AP <</N \FDFsymbolNappearance /D \FDFsymbolDappearance>>}}
-
-%D Hooked into \CONTEXT, this special supports
-%D
-%D \starttyping
-%D \startcomment
-%D hello beautiful\\world
-%D \stopcomment
-%D
-%D \startcomment[hello]
-%D de \'e\'erste keer
-%D the f\'irst time
-%D \stopcommen
-%D
-%D \startcommentaar[hallo][color=green,width=4cm,height=3cm]
-%D first
-%D
-%D second
-%D \stopcommentaar
-%D \stoptyping
-%D
-%D So, special characters, forced linebreaks using \type{\\}
-%D and \type{\par} are handled in the appropriate way.
-
-%D \macros
-%D {doPDFovalbox}
-%D
-%D For drawing ovals we use quite raw \PDF\ code. The next
-%D implementation does not differ that much from the one
-%D implemented in the \POSTSCRIPT\ driver.
-
-\def\doPDFovalcalc#1#2#3%
- {\dimen2=#1%
- \advance\dimen2 #2\relax
- \PointsToBigPoints{\dimen2}#3}
-
-\def\doPDFovalbox#1#2#3#4#5#6#7#8% todo: \scratchdimen/\scatchbox
- {\forcecolorhack
- \bgroup
- \dimen0=#4\divide\dimen0 \plustwo
- \doPDFovalcalc{0pt}{+\dimen0}\xmin
- \doPDFovalcalc{#1}{-\dimen0}\xmax
- \doPDFovalcalc{#2}{-\dimen0}\ymax
- \doPDFovalcalc{-#3}{+\dimen0}\ymin
- \advance\dimen0 by #5%
- \doPDFovalcalc{0pt}{+\dimen0}\xxmin
- \doPDFovalcalc{#1}{-\dimen0}\xxmax
- \doPDFovalcalc{#2}{-\dimen0}\yymax
- \doPDFovalcalc{-#3}{+\dimen0}\yymin
- \doPDFovalcalc{#4}{\zeropoint}\stroke
- \doPDFovalcalc{#5}{\zeropoint}\radius
- \edef\dostroke{#6}%
- \edef\dofill{#7}%
- \edef\mode{\number#8 \space}%
- % no \ifcase, else \relax in pdfcode
- \setbox\scratchbox\hbox
- {\ifnum\dostroke\dofill>\zerocount
- \ifPDFstrokecolor\else\ifnum\dostroke=\plusone
- \writestatus\m!colors{pdf stroke color will fail}\wait
- \fi\fi
- \PDFcode
- {q
- \stroke\space w
- \ifcase\mode
- \xxmin\space \ymin \space m
- \xxmax\space \ymin \space l
- \xmax \space \ymin \space \xmax \space \yymin\space y
- \xmax \space \yymax\space l
- \xmax \space \ymax \space \xxmax\space \ymax \space y
- \xxmin\space \ymax \space l
- \xmin \space \ymax \space \xmin \space \yymax\space y
- \xmin \space \yymin\space l
- \xmin \space \ymin \space \xxmin\space \ymin \space y
- h
- \or % 1
- \xxmin\space \ymin \space m
- \xxmax\space \ymin \space l
- \xmax \space \ymin \space \xmax \space \yymin\space y
- \xmax \space \ymax \space l
- \xmin \space \ymax \space l
- \xmin \space \yymin\space l
- \xmin \space \ymin \space \xxmin\space \ymin \space y
- h
- \or % 2
- \xxmin\space \ymin \space m
- \xmax \space \ymin \space l
- \xmax \space \ymax \space l
- \xxmin\space \ymax \space l
- \xmin \space \ymax \space \xmin \space \yymax\space y
- \xmin \space \yymin\space l
- \xmin \space \ymin \space \xxmin\space \ymin \space y
- h
- \or % 3
- \xmin \space \ymin \space m
- \xmax \space \ymin \space l
- \xmax \space \yymax\space l
- \xmax \space \ymax \space \xxmax\space \ymax \space y
- \xxmin\space \ymax \space l
- \xmin \space \ymax \space \xmin \space \yymax\space y
- \xmin \space \ymin \space l
- h
- \or % 4
- \xmin \space \ymin \space m
- \xxmax\space \ymin \space l
- \xmax \space \ymin \space \xmax \space \yymin\space y
- \xmax \space \yymax\space l
- \xmax \space \ymax \space \xxmax\space \ymax \space y
- \xmin \space \ymax \space l
- \xmin \space \ymin\space l
- h
- \or % 5
- \xmin \space \ymin \space m
- \xmax \space \ymin \space l
- \xmax \space \yymax\space l
- \xmax \space \ymax \space \xxmax\space \ymax \space y
- \xmin \space \ymax \space l
- \xmin \space \ymin \space l
- h
- \or % 6
- \xmin \space \ymin \space m
- \xxmax\space \ymin \space l
- \xmax \space \ymin \space \xmax \space \yymin\space y
- \xmax \space \ymax \space l
- \xmin \space \ymax \space l
- \xmin \space \ymin \space l
- h
- \or
- \xxmin\space \ymin \space m
- \xmax \space \ymin \space l
- \xmax \space \ymax \space l
- \xmin \space \ymax \space l
- \xmin \space \yymin\space l
- \xmin \space \ymin \space \xxmin\space \ymin \space y
- h
- \or
- \xmin \space \ymin \space m
- \xmax \space \ymin \space l
- \xmax \space \ymax \space l
- \xxmin\space \ymax \space l
- \xmin \space \ymax \space \xmin \space \yymax\space y
- \xmin \space \ymin \space l
- h
- \or % 9 top open
- \xmin \space \ymax \space m
- \xmin \space \yymin\space l
- \xmin \space \ymin \space \xxmin\space \ymin \space y
- \xxmax\space \ymin \space l
- \xmax \space \ymin \space \xmax \space \yymin\space y
- \xmax \space \ymax \space l
- \or % 10 right open
- \xmax \space \ymax \space m
- \xxmin\space \ymax \space l
- \xmin \space \ymax \space \xmin \space \yymax\space y
- \xmin \space \yymin\space l
- \xmin \space \ymin \space \xxmin\space \ymin \space y
- \xmax\space \ymin \space l
- \or % 11 bottom open
- \xmax \space \ymin \space m
- \xmax \space \yymax\space l
- \xmax \space \ymax \space \xxmax \space \ymax\space y
- \xxmin\space \ymax \space l
- \xmin \space \ymax \space \xmin \space \yymax\space y
- \xmin \space \ymin \space l
- \or % 12 left open
- \xmin \space \ymax \space m
- \xxmax\space \ymax \space l
- \xmax \space \ymax \space \xmax \space \yymax\space y
- \xmax \space \yymin\space l
- \xmax \space \ymin \space \xxmax\space \ymin \space y
- \xmin \space \ymin \space l
- \or % 13
- \xmin \space \ymax \space m
- \xxmax\space \ymax \space l
- \xmax \space \ymax \space \xmax \space \yymax\space y
- \xmax\space \ymin \space l
- \or % 14
- \xmax \space \ymax \space m
- \xmax \space \yymin\space l
- \xmax \space \ymin \space \xxmax\space \ymin \space y
- \xmin \space \ymin \space l
- \or % 15
- \xmax \space \ymin \space m
- \xxmin\space \ymin \space l
- \xmin \space \ymin \space \xmin \space \yymin\space y
- \xmin \space \ymax \space l
- \or % 16
- \xmin \space \ymin \space m
- \xmin \space \yymax\space l
- \xmin \space \ymax \space \xxmin\space \ymax \space y
- \xmax \space \ymax \space l
- \or % 17
- \xxmax\space \ymax \space m
- \xmax \space \ymax \space \xmax \space \yymax\space y
- \or % 18
- \xmax \space \yymin\space m
- \xmax \space \ymin \space \xxmax\space \ymin \space y
- \or % 19
- \xxmin\space \ymin \space m
- \xmin \space \ymin \space \xmin \space \yymin\space y
- \or % 20
- \xmin \space \yymax\space m
- \xmin \space \ymax \space \xxmin\space \ymax \space y
- \or % 21
- \xxmax\space \ymax \space m
- \xmax \space \ymax \space \xmax \space \yymax\space y
- \xmin \space \yymax\space m
- \xmin \space \ymax \space \xxmin\space \ymax \space y
- \or % 22
- \xxmax\space \ymax \space m
- \xmax \space \ymax \space \xmax \space \yymax\space y
- \xmax \space \yymin\space m
- \xmax \space \ymin \space \xxmax\space \ymin \space y
- \or % 23
- \xmax \space \yymin\space m
- \xmax \space \ymin \space \xxmax\space \ymin \space y
- \xxmin\space \ymin \space m
- \xmin \space \ymin \space \xmin \space \yymin\space y
- \or % 24
- \xxmin\space \ymin \space m
- \xmin \space \ymin \space \xmin \space \yymin\space y
- \xmin \space \yymax\space m
- \xmin \space \ymax \space \xxmin\space \ymax \space y
- \or % 25
- \xxmax\space \ymax \space m
- \xmax \space \ymax \space \xmax \space \yymax\space y
- \xmax \space \yymin\space m
- \xmax \space \ymin \space \xxmax\space \ymin \space y
- \xxmin\space \ymin \space m
- \xmin \space \ymin \space \xmin \space \yymin\space y
- \xmin \space \yymax\space m
- \xmin \space \ymax \space \xxmin\space \ymax \space y
- \or % 26
- \xmax \space \yymin\space m
- \xmax \space \ymin \space \xxmax\space \ymin \space y
- \xmin \space \yymax\space m
- \xmin \space \ymax \space \xxmin\space \ymax \space y
- \or % 27
- \xxmax\space \ymax \space m
- \xmax \space \ymax \space \xmax \space \yymax\space y
- \xxmin\space \ymin \space m
- \xmin \space \ymin \space \xmin \space \yymin\space y
- \or % 28
- \fi
- \ifnum\mode>8
- S
- \else
- \ifnum\dostroke=\plusone S \fi
- \ifnum\dofill =\plusone f \fi
- \fi
- Q}%
- \fi}%
- \wd\scratchbox#1\ht\scratchbox#2\dp\scratchbox#3\box\scratchbox
- \egroup}
-
-%D \macros
-%D {doPDFstartgraymode,doPDFstopgraymode,
-%D doPDFstartrgbcolormode,doPDFstartcmykcolormode,doPDFstartgraycolormode,
-%D doPDFstopcolormode}
-%D
-%D In \PDF\ there are two color states, one for strokes and one
-%D for fills. This means that we have to set the color in a
-%D rather redundant looking way. Unfortunately this makes the
-%D \PDF\ file much larger than needed. We can save few bytes
-%D by not setting the stroke color. Due to zip compression we
-%D only save a few percent.
-
-% \newif\ifPDFstrokecolor \PDFstrokecolortrue
-
-\def\doPDFstartgraymode#1%
-% {\PDFdirectcode{#1 g\ifPDFstrokecolor\space#1 G\fi}}
- {\PDFcode{#1 g\ifPDFstrokecolor\space#1 G\fi}}
-
-\def\doPDFstopgraymode
-% {\PDFdirectcode{0 g\ifPDFstrokecolor\space0 G\fi}}
- {\PDFcode{0 g\ifPDFstrokecolor\space0 G\fi}}
-
-\def\doPDFstartrgbcolormode#1#2#3%
-% {\PDFdirectcode{#1 #2 #3 rg\ifPDFstrokecolor\space#1 #2 #3 RG\fi}}
- {\PDFcode{#1 #2 #3 rg\ifPDFstrokecolor\space#1 #2 #3 RG\fi}}
-
-\def\doPDFstartcmykcolormode#1#2#3#4%
-% {\PDFdirectcode{#1 #2 #3 #4 k\ifPDFstrokecolor\space#1 #2 #3 #4 K\fi}}
- {\PDFcode{#1 #2 #3 #4 k\ifPDFstrokecolor\space#1 #2 #3 #4 K\fi}}
-
-\def\doPDFstartgraycolormode#1%
-% {\PDFdirectcode{#1 g\ifPDFstrokecolor\space#1 G\fi}}
- {\PDFcode{#1 g\ifPDFstrokecolor\space#1 G\fi}}
-
-\def\doPDFstartspotcolormode#1#2% redefining spotcolors is not possible anyway
- {\ifundefined{pdf:scs:#2}%
- \bgroup
- \getcommacommandsize[#2]%
- \ifcase\commalistsize\or
- \setxvalue{pdf:scs:#2}{#2 SCN #2 scn}% \setxvalue{pdf:scs:#2}{#2 SC #2 sc}%
- \else
- \let\PDFspotcolorspecs\empty
- \def\dospotcolorcommand##1{\edef\PDFspotcolorspecs{\PDFspotcolorspecs##1\space}}%
- \processcommacommand[#2]\dospotcolorcommand
- \setxvalue{pdf:scs:#2}{\PDFspotcolorspecs SCN \PDFspotcolorspecs scn}%
- \fi
- \egroup
- \fi
-% \PDFdirectcode{/#1 cs /#1 CS \PDFgetspotcolorspec{#2}}}
- \PDFcode{/#1 cs /#1 CS \PDFgetspotcolorspec{#2}}}
-
-\def\PDFgetspotcolorspec#1%
- {\executeifdefined{pdf:scs:#1}\empty} % better no default than one with too less args
-
-\def\doPDFstartnonecolormode
-% {\PDFdirectcode{/None CS 1 SC /None cs 1 sc}}
- {\PDFcode{/None CS 1 SC /None cs 1 sc}}
-
-\def\doPDFstopcolormode
-% {\PDFdirectcode{0 g\ifPDFstrokecolor\space0 G\fi}}
- {\PDFcode{0 g\ifPDFstrokecolor\space0 G\fi}}
-
-%D We need to register the spot colors and their fallbacks.
-
-% we cannot use /DeviceN since GS <=7.21 breaks on it
-% and Jaws does not handle it at all {[/DeviceN [/All|/None]
-% /Device#2 \PDFobjref\pdflastobj]} so we use separation
-% colors that work and print ok
-
-\def\doPDFregistersomespotcolor#1#2#3#4% implemented in the driver
- {\writestatus\m!systems{missing spot color definition}\wait}
-
-\def\doPDFregisternonecolor % internal command
- {\doPDFregistergrayspotcolor{None}{1}%
- \globallet\doPDFregisternonecolor\relax}
-
-\def\doPDFregisterspotcolorname#1#2% implemented in the driver
- {}
-
-\definespecial\doregisterspotcolorname{\doPDFregisterspotcolorname}
-
-\def\dodoPDFregisterrgbspotcolor#1#2#3#4#5#6#7% name noffractions names p's r g b
- {\doPDFregistersomespotcolor{#1}{#2}{#3}{#4}{RGB}{0.0 1.0 0.0 1.0 0.0 1.0}%
- {\ifcase#2\or dup #5 mul exch dup #6 mul exch #7 mul\else#5 #6 #7\fi}}
-
-\def\dodoPDFregistercmykspotcolor#1#2#3#4#5#6#7#8% name noffractions names p's c m y k
- {\doPDFregistersomespotcolor{#1}{#2}{#3}{#4}{CMYK}{0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0}%
- {\ifcase#2\or dup #5 mul exch dup #6 mul exch dup #7 mul exch #8 mul\else #5 #6 #7 #8\fi}}
-
-\def\dodoPDFregistergrayspotcolor#1#2#3#4#5% name noffractions names p's s
- {\doPDFregistersomespotcolor{#1}{#2}{#3}{#4}{Gray}{0.0 1.0}%
- {\ifcase#2\or #5 mul\else #5\fi}}
-
-% \let\doPDFregisterrgbspotcolor \dodoPDFregisterrgbspotcolor
-% \let\doPDFregistercmykspotcolor\dodoPDFregistercmykspotcolor
-% \let\doPDFregistergrayspotcolor\dodoPDFregistergrayspotcolor
-
-\def\doPDFregisterrgbspotcolor#1#2#3#4#5#6#7% name noffractions names p's r g b
- {\ifRGBsupported
- \dodoPDFregisterrgbspotcolor{#1}{#2}{#3}{#4}{#5}{#6}{#7}%
- \else
- \edef\@@cl@@r{#5}\edef\@@cl@@g{#6}\edef\@@cl@@b{#7}%
- \ifCMYKsupported
- \convertRGBtoCMYK\@@cl@@r\@@cl@@g\@@cl@@b
- \dodoPDFregistercmykspotcolor{#1}{#2}{#3}{#4}\@@cl@@c\@@cl@@m\@@cl@@y\@@cl@@k
- \else
- \convertRGBtoGRAY\@@cl@@r\@@cl@@g\@@cl@@b
- \dodoPDFregistergrayspotcolor{#1}{#2}{#3}{#4}\@@cl@@s
- \fi
- \fi}
-
-\def\doPDFregistercmykspotcolor#1#2#3#4#5#6#7#8% name noffractions names p's c m y k
- {\ifCMYKsupported
- \dodoPDFregistercmykspotcolor{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}%
- \else
- \edef\@@cl@@c{#5}\edef\@@cl@@m{#6}\edef\@@cl@@y{#7}\edef\@@cl@@k{#8}%
- \ifRGBsupported
- \convertCMYKtoRGB\@@cl@@c\@@cl@@m\@@cl@@y\@@cl@@k
- \dodoPDFregisterrgbspotcolor{#1}{#2}{#3}{#4}\@@cl@@r\@@cl@@g\@@cl@@b
- \else
- \convertCMYKtoGRAY\@@cl@@c\@@cl@@m\@@cl@@y\@@cl@@k
- \dodoPDFregistergrayspotcolor{#1}{#2}{#3}{#4}\@@cl@@s
- \fi
- \fi}
-
-\def\doPDFregistergrayspotcolor{\dodoPDFregistergrayspotcolor}
-
-%D New and very experimental.
-
-\def\doPDFregistercmykindexcolor#1#2#3#4#5#6#7#8% name noffractions names p's c m y k
- {\doPDFregistersomeindexcolor{#1}{#2}{#3}{#4}{CMYK}{0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0}%
- {dup #5 mul exch dup #6 mul exch dup #7 mul exch #8 mul}}
-
-\def\doPDFregisterrgbindexcolor#1#2#3#4#5#6#7% name noffractions names p's r g b
- {\doPDFregistersomeindexcolor{#1}{#2}{#3}{#4}{RGB}{0.0 1.0 0.0 1.0 0.0 1.0}%
- {dup #5 mul exch dup #6 mul exch #7 mul}}
-
-\def\doPDFregistergrayindexcolor#1#2#3#4#5% name noffractions names p's s
- {\doPDFregistersomeindexcolor{#1}{#2}{#3}{#4}{Gray}{0.0 1.0}%
- {pop}}
-
-\let\checkpredefinedcolor\predefineindexcolor % we need an index in order to negate bitmaps
-
-\def\doPDFregisterfigurecolor#1% always an index color
- {\dogetobjectreference
- {PDFIX}
- {\internalspotcolorname{#1}}
- \PDFimagecolorreference}
-
-%D \macros
-%D {doPDFstartrotation,doPDFstoprotation}
-%D
-%D Rotating some text can be accomplished by setting the first
-%D four elements of the transform matrix. We only support some
-%D fixed angles. The \type{q}'s take care of grouping.
-
-% The original:
-%
-% \def\doPDFstartrotation#1%
-% {\PDFcode{q}%
-% \processaction
-% [#1]
-% [ 90=>\PDFcode{ 0 1 -1 0 0 0 cm},
-% 180=>\PDFcode{-1 0 0 -1 0 0 cm},
-% 270=>\PDFcode{ 0 -1 1 0 0 0 cm},
-% 360=>\PDFcode{ 1 0 0 1 0 0 cm}]}
-%
-% We cannot directly pass an angle, but have to calculate
-% factors (rx and ry). As in the \METAPOST\ to \PDF\
-% converter module we need to compensate the deformation
-% by setting (sx and sy).
-%
-% Optimized but bigger:
-%
-% \def\doPDFstartrotation#1%
-% {\PDFcode{q}%
-% \processaction
-% [#1]
-% [ 0=>\PDFcode{ 1 0 0 1 0 0 cm},
-% 90=>\PDFcode{ 0 1 -1 0 0 0 cm},
-% 180=>\PDFcode{-1 0 0 -1 0 0 cm},
-% 270=>\PDFcode{ 0 -1 1 0 0 0 cm},
-% 360=>\PDFcode{ 1 0 0 1 0 0 cm},
-% #1=>\setcalculatedcos\cos{#1}%
-% \setcalculatedsin\sin{#1}%
-% \PDFcode{\cos \space % cos
-% \sin \space % sin
-% \negated\sin\space % -sin
-% \cos \space % cos
-% 0 0 cm}]}
-%
-% Since the sine and cosine values are preset and rounded we
-% can use the next alternative without running into inaccuracies.
-
-\def\doPDFstartrotation#1% grouped
- {\setcalculatedcos\cos{#1}%
- \setcalculatedsin\sin{#1}%
- \forcecolorhack
- \PDFcode{q \cos\space\sin\space\negated\sin\space\cos\space0 0 cm}}
-
-\def\doPDFstoprotation
- {\PDFcode{Q}}
-
-%D \macros
-%D {doPDFstartscaling,doPDFstopscaling}
-%D
-%D Scaling is rather straightforward:
-
-\def\@@PDFzeroscale{.0001}
-
-\def\doPDFstartscaling#1#2% the test is needed because acrobat is bugged!
- {\forcecolorhack
- \PDFcode{q \ifdim#1\points=\zeropoint\@@PDFzeroscale\else#1\fi\space 0 0
- \ifdim#2\points=\zeropoint\@@PDFzeroscale\else#2\fi\space 0 0 cm}}
-
-% \def\doPDFstartscaling#1#2% the test is needed because acrobat is bugged!
-% {\PDFcode{q\ifdim#1\points=\zeropoint\else\ifdim#2\points=\zeropoint\else
-% \space#1\space 0 0 #2\space 0 0 cm\fi\fi}}
-
-\def\doPDFstopscaling
- {\PDFcode{Q}}
-
-%D \macros
-%D {doPDFstartmirroring,doPDFstopmirroring}
-%D
-%D Mirroring is implemented in a similar way:
-
-\def\doPDFstartmirroring
- {\PDFcode{-1 0 0 1 0 0 cm}}
-
-\def\doPDFstopmirroring
- {\PDFcode{-1 0 0 1 0 0 cm}}
-
-%D \macros
-%D {doPDFstartnegative,doPDFstopnegative}
-%D
-%D When producing output for an image setter, sometimes negative
-%D output is needed.
-
-\def\doPDFstartnegative
- {\ifx\initializePDFnegative\undefined\else
- \initializePDFnegative
-% \PDFdirectcode{/GSnegative gs}%
- \PDFcode{/GSnegative gs}%
- \fi}
-
-\def\doPDFstopnegative
- {\ifx\initializePDFnegative\undefined\else
- \initializePDFnegative
-% \PDFdirectcode{/GSpositive gs}%
- \PDFcode{/GSpositive gs}%
- \fi}
-
-%D \macros
-%D {doPDFstartoverprint,doPDFstopoverprint}
-%D
-%D Some printers like overprint more than knockout.
-
-\def\doPDFstartoverprint
- {\ifx\initializePDFoverprint\undefined\else
- \initializePDFoverprint
-% \PDFdirectcode{/GSoverprint gs}%
- \PDFcode{/GSoverprint gs}%
- \fi}
-
-\def\doPDFstopoverprint
- {\ifx\initializePDFoverprint\undefined\else
- \initializePDFoverprint
-% \PDFdirectcode{/GSknockout gs}%
- \PDFcode{/GSknockout gs}% wrong
- \fi}
-
-%D Transparency support:
-
-\newif\ifPDFtransparencysupported
-
-\def\PDFtransparancydictionary#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\or Hue\or Saturation\or Color\or
- Luminosity\else Compatible\fi
- #3>>}
-
-\def\dodoPDFstarttransparency#1#2%
- {\presetPDFtransparency{#1}{#2}%
- \PDFcode{\PDFtransparencyidentifier\space gs }}
-
-\def\dodoPDFstoptransparency
- {\PDFcode{/Tr0 gs }}
-
-\def\doPDFstarttransparency
- {\ifPDFtransparencysupported
- \global\let\doPDFstarttransparency\dodoPDFstarttransparency
- \global\let\doPDFstoptransparency \dodoPDFstoptransparency
- \initializetransparency
- \expandafter\doPDFstarttransparency
- \else
- \expandafter\gobbletwoarguments
- \fi}
-
-% \let\doPDFstoptransparency\relax
-%
-% This is tricky: because a text stream is handled before
-% the page body is built, we can run into stops that will
-% match an outer start; however, the stop is needed in case
-% of a text color: [text color text] [other color text] on a
-% first page combined with color splitting will go wrong if
-% we stick to the relaxing method.
-
-\def\doPDFstoptransparency
- {\ifPDFtransparencysupported
- \initializetransparency
- \dodoPDFstoptransparency
- \fi}
-
-%D These use:
-
-\let\PDFtransparencyresetreference \empty
-\let\PDFtransparencyresetidentifier\empty
-
-\let\PDFtransparencyreference \empty
-\let\PDFtransparencyidentifier\empty
-
-\let\presetPDFtransparency \gobbletwoarguments
-\let\initializetransparency\relax
-
-%D New trickery:
-
-\definespecial\dostartgraphicgroup{\PDFcode{q}}
-\definespecial\dostopgraphicgroup {\PDFcode{Q}}
-
-%D Even newer trickery:
-
-\definespecial\dostartviewerlayer {\doPDFstartlayer}
-\definespecial\dostopviewerlayer {\doPDFstoplayer}
-\definespecial\dodefineviewerlayer{\doPDFdefinelayer}
-
-\let\PDFtextlayers\empty
-\let\PDFpagelayers\empty
-\let\PDFhidelayers\empty
-\let\PDFvidelayers\empty
-
-% \def\doPDFstartlayer#1{\PDFdirectcode{/OC /#1 BDC}}
-% \def\doPDFstoplayer {\PDFdirectcode {EMC}}
-
-\def\doPDFstartlayer#1{\PDFcode{/OC /#1 BDC}}
-\def\doPDFstoplayer {\PDFcode {EMC}}
-
-% resource -> prop -> mc's -> OCG|OCMD (nested)
-
-% ocg:
-
-% /Intent/Design
-
-% ocmd
-
-% /P /AllOn
-
-% kan zelf ocmd bevatten
-
-\def\doPDFdefinelayer#1#2#3#4#5% tag title visible type printable
- {\doPDFdictionaryobject{PDLN}{#1}
- {/Type /OCG
- \ifcase#4 \or
- /Intent /Design % disable layer hiding by user
- \fi
- \ifnum#5=\zerocount
- /Usage << /Print << /PrintState /OFF >> >> % printable or not
- \fi
- /Name (#2)}%
- \doPDFgetobjectreference{PDLN}{#1}\PDFobjectreference
- \xdef\PDFtextlayers{\PDFtextlayers\space\PDFobjectreference}%
- \doifelse{#3}\v!start
- {\xdef\PDFvidelayers{\PDFvidelayers\space\PDFobjectreference}}%
- {\xdef\PDFhidelayers{\PDFhidelayers\space\PDFobjectreference}}%
- \doPDFdictionaryobject{PDLD}{#1}
- {/Type /OCMD
- /OCGs [\PDFobjectreference]}%
- \doPDFgetobjectreference{PDLD}{#1}\PDFobjectreference
- \xdef\PDFpagelayers{\PDFpagelayers\space /#1 \PDFobjectreference}}
-
-\def\flushPDFtextlayers
- {\ifx\PDFtextlayers\empty \else
- \driverreferenced \doPDFarrayobject{PDF}{textlayers}{\PDFtextlayers}%
- \doPDFgetobjectreference{PDF}{textlayers}\!!stringa
- \ifx\PDFvidelayers\empty
- \def\!!stringb{[null]}%
- \else
- \driverreferenced \doPDFarrayobject{PDF}{videlayers}{\PDFvidelayers}%
- \doPDFgetobjectreference{PDF}{videlayers}\!!stringb
- \fi
- \ifx\PDFhidelayers\empty
- \def\!!stringc{[null]}%
- \else
- \driverreferenced \doPDFarrayobject{PDF}{hidelayers}{\PDFhidelayers}%
- \doPDFgetobjectreference{PDF}{hidelayers}\!!stringc
- \fi
- \doPDFaddtocatalog
- {/OCProperties
- << % display in menu
- /D << /Order \!!stringa
- /ON \!!stringb
- /OFF \!!stringc >>
- % used properties
- /OCGs \!!stringa >>}%
- \globallet\flushPDFtextlayers\relax
- \fi}
-
-\def\flushPDFpagelayers
- {\ifx\PDFpagelayers\empty \else
- \doPDFpageresource{/Properties <<\PDFpagelayers>>}%
- \fi}
-
-\prependtoksonce \flushPDFpagelayers \to \everyshipout
-\prependtoksonce \flushPDFtextlayers \to \everylastshipout
-
-\def\PDFlayeractionlist{null}
-
-\def\PDFexecutehidelayer {/SetOCGState /State [/OFF \PDFlayeractionlist]}
-\def\PDFexecutevidelayer {/SetOCGState /State [/ON \PDFlayeractionlist]}
-\def\PDFexecutetogglelayer {/SetOCGState /State [/Toggle \PDFlayeractionlist]}
-
-\def\domakeviewerlayerlist#1%
- {\bgroup
- \globallet\PDFlayeractionlist\empty
- \def\docommand##1%
- {\doPDFgetobjectreference{PDLN}{##1}\PDFobjectreference
- \xdef\PDFlayeractionlist{\PDFlayeractionlist\space\PDFobjectreference}}%
- \processcommalist[#1]\docommand
- \egroup}
-
-%D Something rather pdf dependent:
-
-% #1 => 1=fill 2=stroke 3=strokedfill 4=invisible
-% #2 => linewidth
-% #3 => spacing (beware, one needs to set the hsize as well)
-
-\def\doPDFstartfonteffect#1#2#3%
- {\ifdim#2>\zeropoint
- \PointsToBigPoints{#2}\ascii
-% \PDFdirectcode{\ascii\space w}%
- \PDFcode{\ascii\space w}%
- \fi
- \ifdim#3\points=\onepoint\else
- \scratchdimen#3\points
-% \PDFdirectcode{\withoutpt{\the\scratchdimen}\space Tc}%
- \PDFcode{\withoutpt{\the\scratchdimen}\space Tc}%
- \fi
-% \PDFdirectcode{\purenumber#1 Tr}}
- \PDFcode{\purenumber#1 Tr}}
-
-\def\doPDFstopfonteffect
-% {\PDFdirectcode{1 w 0 Tc 0 Tr}}
- {\PDFcode{1 w 0 Tc 0 Tr}}
-
-%D Handy for the \METAPOST\ to \PDF\ converter:
-
-\ifdefined\everyPDFximage \else \newtoks\everyPDFximage \fi
-\ifdefined\everyPDFxform \else \newtoks\everyPDFxform \fi
-
-\appendtoksonce
- \collectPDFresources
- \global\let\currentPDFresources\collectedPDFresources
-\to \everyPDFxform
-
-\let\collectedPDFresources\empty
-
-\def\collectPDFresources % suboptimal
- {\doifobjectreferencefoundelse{FDF}{docushades} % redundant, we have an reserved object now
- {\doPDFgetobjectreference{FDF}{docushades}\PDFobjectreference
- \xdef\collectedPDFresources{\collectedPDFresources/Shading \PDFobjectreference}}\donothing
- \doifobjectreferencefoundelse{FDF}{docuextgstates}
- {\doPDFgetobjectreference{FDF}{docuextgstates}\PDFobjectreference
- \xdef\collectedPDFresources{\collectedPDFresources/ExtGState \PDFobjectreference}}\donothing
- \doifobjectreferencefoundelse{FDF}{docupatterns}
- {\doPDFgetobjectreference{FDF}{docupatterns}\PDFobjectreference
- \xdef\collectedPDFresources{\collectedPDFresources/Pattern \PDFobjectreference}}\donothing
- \doifobjectreferencefoundelse{FDF}{colorspaces}
- {\doPDFgetobjectreference{FDF}{colorspaces}\PDFobjectreference
- \xdef\collectedPDFresources{\collectedPDFresources/ColorSpace \PDFobjectreference}}\donothing
- \global\let\collectPDFresources\relax}
-
-%D And that was about all.
-
-\stopspecials
-
-\ifx\fullytransparentcolor\undefined \else
-
- \def\fullytransparentcolor
- {\doPDFregisternonecolor
- \doPDFstartnonecolormode}
-
- \let\doPDFstarttransparency\gobbletwoarguments
- \let\doPDFstoptransparency\relax
-
-\fi
-
-%D Temporary hack:
-
-\def\TransparencyHack % png: /CS /DeviceRGB /I true
- {\appendtoks
- \doPDFpageattribute{/Group << /S /Transparency /I true /K true>>}%
- \to \everyPDFxform
- \appendtoks
- \doPDFpageattribute{/Group << /S /Transparency /I true /K true>>}%
- \to \everyshipout}
-
-%D We still need to implement a few helpers:
-
-\chardef\safePDFcode=`-
-
-\def\setPDFdestination#1%
- {\bgroup
- \retainlccodes
- \lccode`\/\safePDFcode \lccode`\#\safePDFcode
- \lccode`\<\safePDFcode \lccode`\>\safePDFcode
- \lccode`\[\safePDFcode \lccode`\]\safePDFcode
- \lccode`\(\safePDFcode \lccode`\)\safePDFcode
- \ifovercomePDFspace
- \lccode`\ \safePDFcode
- \fi
- \ifovercomePDFbugs
- \xdef\PDFdestination{'#1'}%
- \else
- \xdef\PDFdestination{#1}%
- \fi
- % nicer \xdef\PDFdestination{\ifovercomePDFbugs'\fi#1\ifovercomePDFbugs'\fi}%
- \lowercase\@EA{\@EA\xdef\@EA\PDFdestination\@EA{\PDFdestination}}%
- \egroup}
-
-%D This is much faster since we don't have to set the full
-%D range of lc-codes; about 5 sec on a 1000mhz PIII for
-%D 20K named destinations "x(x) x"). Of course when you use
-%D page destinations, the saving is nil.
-
-% \doifnotmode{atpragma}{\let\next\setPDFdestination} % experimental
-%
-% \catcode`\/=\@@active \catcode`\#=\@@active
-% \catcode`\<=\@@active \catcode`\>=\@@active
-% \catcode`\[=\@@active \catcode`\]=\@@active
-% \catcode`\(=\@@active \catcode`\)=\@@active
-%
-% \gdef\PDFrepchar{-}
-%
-% \gdef\setPDFdcharacters
-% {\catcode`\/=\@@active \let/\PDFrepchar
-% \catcode`\#=\@@active \let#\PDFrepchar
-% \catcode`\<=\@@active \let<\PDFrepchar
-% \catcode`\>=\@@active \let>\PDFrepchar
-% \catcode`\[=\@@active \let[\PDFrepchar
-% \catcode`\]=\@@active \let]\PDFrepchar
-% \catcode`\(=\@@active \let(\PDFrepchar
-% \catcode`\)=\@@active \let)\PDFrepchar}
-%
-% \egroup
-%
-% \def\setPDFdestination#1% expansion is needed, otherwise embedded
-% {\bgroup % macros will not expand under the new
-% \setPDFdcharacters % catcode regime
-% \ifovercomePDFspace
-% \catcode32=\@@ignore
-% \fi
-% \xdef\PDFdestination{\ifovercomePDFbugs'\fi#1\ifovercomePDFbugs'\fi}%
-% \scantokens\@EA{\@EA\xdef\@EA\PDFdestination\@EA{\PDFdestination}}%
-% \egroup}
-%
-% \doifnotmode{atpragma}{\let\setPDFdestination\next} % experimental
-
-%D This is a slow one, that uses \type{\lccode}'s to
-%D change the glyph as well as converts sensisitve ones into a
-%D \PDF\ command sequence, so \type{(} becomes \type{\(}. In
-%D fact we translate the string to lowercase inactive and non
-%D special characters, limit their number and finaly convert
-%D some of the characters to save ones.
-
-\chardef\maxPDFstringsize=60
-
-\def\sanitizePDFstring#1\to#2% bugged
- {\bgroup
- \retainlccodes
- \lccode`( \zerocount \lccode`) \zerocount
- \lccode`< \zerocount \lccode`> \zerocount
- \lccode`[ \zerocount \lccode`] \zerocount
- \lccode`\\\zerocount \lccode`/ \zerocount
- \lowercase{\defconvertedargument\ascii{#1}}%
- % by integrating the split in the loop below
- % \splitofftokens\maxPDFstringsize\from\ascii\to\ascii
- % we diminish the processing time considerably
- \scratchcounter\maxPDFstringsize
- \def\docommand##1%
- {\ifcase\scratchcounter\else
- \advance\scratchcounter \minusone
- \ifcase\lccode`##1\relax
- \xdef#2{#2\expandafter\string\csname##1\endcsname}%
- \else
- \xdef#2{#2##1}%
- \fi
- \fi}%
- %\global\let#2=\empty
- % or to permit #2 to be \ascii too:
- \global\@EA\let\@EA#2\@EA\empty
- \@EA\handletokens\ascii\with\docommand
- \egroup}
-
-% \doifnotmode{atpragma}{\let\next\sanitizePDFstring} % experimental
-%
-% \bgroup
-%
-% \catcode`\.=\@@escape
-%
-% .catcode`./=.@@active
-% .catcode`.<=.@@active .catcode`.>=.@@active
-% .catcode`.[=.@@active .catcode`.]=.@@active
-% .catcode`.(=.@@active .catcode`.)=.@@active
-%
-% .gdef.setPDFscharacters%
-% {.catcode`.\=.@@other
-% .catcode`./=.@@active .def/{.noexpand./}%
-% .catcode`.<=.@@active .def<{.noexpand.<}%
-% .catcode`.>=.@@active .def>{.noexpand.>}%
-% .catcode`.[=.@@active .def[{.noexpand.[}%
-% .catcode`.]=.@@active .def]{.noexpand.]}%
-% .catcode`.(=.@@active .def({.noexpand.(}%
-% .catcode`.)=.@@active .def){.noexpand.)}}
-%
-% .gdef.sanitizePDFstring#1.to#2%
-% {.bgroup
-% .setPDFscharacters
-% .catcode`=.@@escape
-% .edef.next{.strippedcsname#2}%
-% .scantokens{setxvalue{next}{#1}}%
-% .egroup}
-%
-% .egroup
-%
-% \doifnotmode{atpragma}{\let\sanitizePDFstring\next} % experimental
-%
-% There is an unicode variant in spec-tst!
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/spec-ini.mkii b/Master/texmf-dist/tex/context/base/mkii/spec-ini.mkii
deleted file mode 100644
index 9361ed2225a..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/spec-ini.mkii
+++ /dev/null
@@ -1,559 +0,0 @@
-%D \module
-%D [ file=spec-ini,
-%D version=1996.01.25,
-%D title=\CONTEXT\ Special Macros,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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: make this one more plain so that i can use it in plain jobs
-% todo: no args, named vars instead
-% maybe also drop multiple drivers and make simplify the default, then simplier defs
-
-\newif\ifsimplifyspecials \simplifyspecialstrue % see later
-
-%D We will forbid loading specials after the first page is
-%D shipped out.
-
-\ifx\realpageno\undefined
- \countdef\realpageno=0 \realpageno=1
-\fi
-
-%D Specials are \TEX's channel to the outside world. They make
-%D \TEX\ even more platform independant and permit easy
-%D adaption to new developments. One major drawback of specials
-%D is that they have to be supported by printer drivers. We've
-%D tried to overcome this problem by implementing specials as
-%D a sort of drivers themselves.
-
-\writestatus{loading}{ConTeXt Special Macros / Initialization}
-
-\unprotect
-
-%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
-%D specifiers and arguments. The \DVI||format incorporates a
-%D channel to the outside world. This channel is activated by
-%D the \TEX\ primitive \type {\special}. The sequence
-%D
-%D \starttyping
-%D \special{Hello here I am.}
-%D \stoptyping
-%D
-%D results in \DVI||codes:
-%D
-%D \starttyping
-%D xxx1 16 Hello here I am.
-%D \stoptyping
-%D
-%D The \type {xxx1} is represented in byte code 239 and the
-%D number of following bytes in a~1, 2, 3 or~4 byte number. So
-%D here we get $1+1+16$ bytes of code.
-%D
-%D Translating these codes is upto the \DVI\ driver. It's
-%D common use to ignore specials that cannot be interpreted, so
-%D the example string should have no consequences for the
-%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.
-
-\newtoks \everyresetspecials
-
-\appendtoksonce
- \ifx\setjobsuffix\undefined\else\setjobsuffix{dvi}\fi
-\to \everyresetspecials
-
-%D A rather fundamental difference between special and direct
-%D settings is that the latter don't interfere with typesetting
-%D but must be set before the first shipout, while the specials
-%D must be packaged in the shipped out box in such a way that
-%D they don't interfere.
-
-\newif\ifspecialbasedsettings \specialbasedsettingstrue
-
-\appendtoksonce
- \specialbasedsettingstrue
-\to \everyresetspecials
-
-%D Because there is no standardization in the use of specials,
-%D more than one driver or program can be supported. The
-%D specials are grouped in libraries. Some of these are
-%D general, such as the \type{postscript} library, some are
-%D tuned to a special kind of program, like the \type{pdf}
-%D ones, and some support a specific driver, as we can see in
-%D the \type{yandy} library. A library is build with the
-%D commands:
-%D
-%D \starttyping
-%D \startspecials[name][inheritance]
-%D
-%D \definespecial\none{...}
-%D \definespecial\onlyone#1{...}
-%D \definespecial\alot#1#2#3#4{...}
-%D
-%D \stopspecials
-%D \stoptyping
-%D
-%D Because drivers can have overlap in low level macros, a
-%D mechanism of inheritance is implemented. The libraries
-%D defined as second argument are loaded first.
-%D
-%D Every special has to be predefined first. We do this with
-%D the command:
-%D
-%D \starttyping
-%D \installspecial [\none] [and] [0]
-%D \installspecial [\onlyone] [and] [1]
-%D \installspecial [\alot] [or] [4]
-%D \stoptyping
-%D
-%D This means as much as: there is a special names
-%D \type{\none} which has no arguments and has more than one
-%D appearance. The special \type{\alot} on the other hand has
-%D four arguments and is only defined once. Every instance in
-%D the libraries of a special of category \type{and} is
-%D executed when called upon, but only one special of
-%D category \type{or} can be active. Most of the
-%D \type{postscript}||specials are of category \type{or},
-%D because they tend to interfere with driver specific ones.
-%D The interactive specials of \type{dviwindo} and \type{pdf}
-%D are an example of specials that can be called both.
-%D
-%D A library is defined in a file with the name
-%D \type{spec-...}. We load a library with the command:
-%D
-%D \starttyping
-%D \usespecials [list]
-%D \stoptyping
-%D
-%D where the list can contain one or more file tags, the
-%D \type{...} in the filename. The keyword \type{reset}
-%D resets all loaded specials. This is equivalent to
-%D \type{\resetspecials}.
-
-%D Although a mechanism of nesting can be implemented, we
-%D prefer to use a inheritance mechanism as mentioned. Calls
-%D upon \type{\usespecials} within a \type{\startspecials}
-%D would lead to confusion and errors.
-
-\newif\ifinheritspecials
-
-%D We define some local constants and variables. They look a
-%D bit horrible but we don't want conflicts.
-
-\def\@@specfil@@{@@spcfil@@}
-\def\@@speclst@@{@@spclst@@}
-\def\@@speccat@@{@@spccat@@}
-\def\@@specarg@@{@@spcarg@@}
-\def\@@specexc@@{@@spcexc@@}
-
-% not faster
-%
-% \def\@@specfil@@{@sp@f@}
-% \def\@@speclst@@{@sp@l@}
-% \def\@@speccat@@{@sp@c@}
-% \def\@@specarg@@{@sp@a@}
-% \def\@@specexc@@{@sp@e@}
-
-\let\currentspecial \empty
-\let\currentspecialfile\empty
-
-%D \macros
-%D {startspecials}
-%D
-%D Every library has a unique name, which is given as the first
-%D argument to \type{\startspecials}. When another library is
-%D defined with the same name, previous specials can be
-%D overruled. The name may differ from the file||tag.
-%D
-%D The optional second argument can consist of a list of
-%D libraries that are to be loaded first.
-
-\def\dostartspecials[#1][#2]%
- {\doifsomething{#2}
- {\processcommalist[#2]\dousespecials}%
- \doifelsenothing{#1}
- {\let\currentspecial\s!unknown}
- {\def\currentspecial{#1}}%
- \unprotect}
-
-\def\startspecials
- {\localpushmacro\currentspecial
- \dodoubleempty\dostartspecials}
-
-\def\stopspecials
- {\localpopmacro\currentspecial
- \protect}
-
-%D \macros
-%D {installspecial,
-%D resetspecials}
-%D
-%D We have to install specials before we can define and use
-%D them. The command itself is defined as a call to another
-%D command that executes one or more user||defined specials,
-%D depending of it's category: \type{or} versus \type{and}.
-%D
-%D The command \type{\installspecial} takes three
-%D (non||optional) arguments: the name of the command, the
-%D category it belongs to and the number of arguments it
-%D takes.
-%D
-%D With \type{\resetspecials} we can unload the predefined
-%D specials. Special reset actions |<|look in \type{spec-mis}
-%D for an example|>| can be assigned to the token register
-%D \type{\everyresetspecials}.
-
-\let\@@allspecials=\empty
-
-\def\doinstallspecial[#1][#2][#3]%
- {\letvalue{\@@speclst@@\string#1}\empty
- \setvalue{\@@speccat@@\string#1}{#2}%
- \setvalue{\@@specarg@@\string#1}{#3}%
- \addtocommalist{\string#1}\@@allspecials
- \def#1{\executespecial#1}}
-
-\def\installspecial
- {\dotripleargument\doinstallspecial}
-
-\def\resetspecials
- {\the\everyresetspecials
- \def\docommand##1%
- {\letvalue{\@@speclst@@##1}\empty}%
- \processcommacommand[\@@allspecials]\docommand}
-
-%D \macros
-%D {definespecial}
-%D
-%D The command \type{\definespecial} take the place of
-%D \type{\def} in the definition of a special. Just to be
-%D sure, we first check if the command is permitted, i.e.
-%D installed. If not, we give a warning and gobble the
-%D illegal command in an quite elegant way.
-%D
-%D If the command can be combined (\type{and}) with others,
-%D we append it to a list, otherwise (\type{or}) it becomes
-%D the only item in the list.
-
-\def\definespecial#1%
- {\ifx#1\undefined
- \showmessage\m!specials4{\string#1}%
- \def\next
- {\def\@@illegalspecial@@}%
- \else
- \def\next
- {\doifelsevalue{\@@speccat@@\string#1}{or}
- {\edef\@@newspeclst@@{\currentspecial}}
- {\edef\@@newspeclst@@{\getvalue{\@@speclst@@\string#1}}%
- \addtocommalist\currentspecial\@@newspeclst@@}%
- \setevalue{\@@speclst@@\string#1}{\@@newspeclst@@}%
- \setvalue{\currentspecial\string#1}}%
- \fi
- \next}
-
-%D \macros
-%D {usespecials}
-%D
-%D We use \type{\usespecials} to load a specific library.
-%D This command is only permitted outside the definition part.
-
-\def\dousespecials#1%
- {\doifelse{#1}\v!reset
- {\resetspecials}
- {\doifdefinedelse{\@@specfil@@#1}
- {\edef\currentspecialfile{\getvalue{\@@specfil@@#1}}}
- {\edef\currentspecialfile{#1}}%
- \makeshortfilename[\truefilename{\f!specialprefix\currentspecialfile}]%
- \startreadingfile
- \readsysfile{\shortfilename.mkii}{\showmessage\m!specials5\currentspecialfile}\donothing
- \stopreadingfile}}
-
-\def\usespecials[#1]%
- {\ifnum\realpageno<2
- \doifelsenothing\currentspecial
- {\processcommalist[#1]\dousespecials}
- {\showmessage\m!specials6\empty}%
- \fi}
-
-%D \macros
-%D {executespecials}
-%D
-%D The command \type{\executespecials} is used to execute the
-%D defined specials. Once a special is installed, the special
-%D itself calls for this command, so it's not needed outside
-%D this module. One can use it if wanted.
-%D
-%D A former implementation grouped the execution. Recent
-%D additions however |<|like the specials that implement object
-%D handling|>| asked for non||grouped execution.
-
-%D \starttyping
-%D \def\executespecials#1#2%
-%D {\def\doonespecial##1%
-%D {\getvalue{##1\string#1}#2\relax}%
-%D \processcommacommand
-%D [\getvalue{\@@speclst@@\string#1}]\doonespecial}
-%D
-%D \def\executespecial#1%
-%D {\expandafter\ifcase\getvalue{\@@specarg@@\string#1}\relax
-%D \def\next%
-%D {\executespecials#1{}}%
-%D \or
-%D \def\next##1%
-%D {\executespecials#1{{##1}}}%
-%D \or
-%D \def\next##1##2%
-%D {\executespecials#1{{##1}{##2}}}%
-%D \or
-%D \def\next##1##2##3%
-%D {\executespecials#1{{##1}{##2}{##3}}}%
-%D \or
-%D \def\next##1##2##3##4%
-%D {\executespecials#1{{##1}{##2}{##3}{##4}}}%
-%D \or
-%D \def\next##1##2##3##4##5%
-%D {\executespecials#1{{##1}{##2}{##3}{##4}{##5}}}%
-%D \or
-%D \def\next##1##2##3##4##5##6%
-%D {\executespecials#1{{##1}{##2}{##3}{##4}{##5}{##6}}}%
-%D \or
-%D \def\next##1##2##3##4##5##6##7%
-%D {\executespecials#1{{##1}{##2}{##3}{##4}{##5}{##6}{##7}}}%
-%D \or
-%D \def\next##1##2##3##4##5##6##7##8%
-%D {\executespecials#1{{##1}{##2}{##3}{##4}{##5}{##6}{##7}{##8}}}%
-%D \or
-%D \def\next##1##2##3##4##5##6##7##8##9%
-%D {\executespecials#1{{##1}{##2}{##3}{##4}{##5}{##6}{##7}{##8}{##9}}}%
-%D \else
-%D \def\next%
-%D {\message{illegal special: \string#1}}%
-%D \fi
-%D \next}
-%D \stoptyping
-%D
-%D Because specials happen quite often, we will use a bit more
-%D brute force. Keep in mind that we have to collect the
-%D arguments because we want to support more drivers at once.
-%D
-%D I tested this on the next test. Where the previous alternative
-%D took about 32 seconds, the new alternative takes 25 seconds.
-%D
-%D \starttyping
-%D \testfeature{10000}{\setbox0=\hbox{test \color[red]{oeps} test}}
-%D \stoptyping
-
-\def\@@exsp{exsp}
-
-\setvalue{\@@exsp0}{{}}
-\setvalue{\@@exsp1}#1{{{#1}}}
-\setvalue{\@@exsp2}#1#2{{{#1}{#2}}}
-\setvalue{\@@exsp3}#1#2#3{{{#1}{#2}{#3}}}
-\setvalue{\@@exsp4}#1#2#3#4{{{#1}{#2}{#3}{#4}}}
-\setvalue{\@@exsp5}#1#2#3#4#5{{{#1}{#2}{#3}{#4}{#5}}}
-\setvalue{\@@exsp6}#1#2#3#4#5#6{{{#1}{#2}{#3}{#4}{#5}{#6}}}
-\setvalue{\@@exsp7}#1#2#3#4#5#6#7{{{#1}{#2}{#3}{#4}{#5}{#6}{#7}}}
-\setvalue{\@@exsp8}#1#2#3#4#5#6#7#8{{{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}}}
-\setvalue{\@@exsp9}#1#2#3#4#5#6#7#8#9{{{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{#9}}}
-
-%D \starttyping
-%D \def\executespecials#1%
-%D {\def\doonespecial##1%
-%D {\csname##1\xspecialcommand\endcsname#1\relax}%
-%D \@EA\rawprocesscommalist\@EA
-%D [\csname\@@speclst@@\xspecialcommand\endcsname]\doonespecial}
-%D
-%D \def\executespecial#1%
-%D {\def\xspecialcommand{\string#1}%
-%D \@EA\@EA\@EA\executespecials\csname\@@exsp\csname\@@specarg@@\xspecialcommand\endcsname\endcsname}
-%D \stoptyping
-
-%D Some more speed can be gained by using a dedicated string
-%D processing routine. Now we can bring down the execution
-%D time to 21 seconds, one third less than the original run time.
-
-\def\executespecials#1%
- {\@EA\let\@EA\speciallist\csname\@@speclst@@\xspecialcommand\endcsname
- \ifx\speciallist\empty\else
- \def\doonespecial##1%
- {\csname##1\xspecialcommand\endcsname#1\relax}%
- \@EA\dodoonespecial\speciallist,\end,%
- \fi}
-
-\def\executespecial#1%
- {\def\xspecialcommand{\string#1}%
- \@EA\@EA\@EA\executespecials\csname\@@exsp\csname\@@specarg@@\xspecialcommand\endcsname\endcsname}
-
-\def\dodoonespecial#1,%
- {\ifx\end#1\else
- \doonespecial{#1}\expandafter\dodoonespecial
- \fi}
-
-%D This kind of saving only shows up when making interative
-%D documents with lots of color switches. In such documents
-%D tens of thousands of special calls are rather normal.
-%D On a 650 Mhz Pentium, the previous test takes 15 seconds
-%D less (on about 65 seconds). When processing 2000 page
-%D interactive documents this saving can be neglected.
-
-%D In the previous macros, the \type{{{...}}} are needed
-%D because we pass all those arguments to the specials support
-%D macro.
-
-\let\openspecialfile \relax
-\let\closespecialfile \relax
-
-%D \macros
-%D {doifspecialavailableelse}
-%D
-%D For testing purposes (this was first needed when object
-%D support was implemented) we have:
-%D
-%D \starttyping
-%D \doifspecialavailableelse\specialcommand{true}{false}
-%D \stoptyping
-%D
-%D e.g:
-%D
-%D \starttyping
-%D \doifspecialavailableelse\doinsertobject{...}{...}
-%D \stoptyping
-
-\def\doifspecialavailableelse#1#2#3%
- {\doifelsevaluenothing{\@@speclst@@\string#1}{#3}{#2}}
-
-%D So far for the macros that deal with installing specials.
-%D In the file \type {spec-def} you will find the predefined
-%D specials.
-
-%D Now that we have seen the flexible way (permitting
-%D special chains) we will implement a faster and flat
-%D alternative. But only if flag si set.
-
-\ifsimplifyspecials
-
- \def\doinstallspecial[#1][#2][#3]%
- {\appendtoks\forgetspecial#1{#3}\to\everyresetspecials
- \@EA\chardef\csname\@@speclst@@\string#1\endcsname\zerocount
- \forgetspecial#1{#3}}
-
- \def\forgetspecial#1#2%
- {\ifcase#2\relax
- \let#1\relax \or
- \let#1\gobbleoneargument \or
- \let#1\gobbletwoarguments \or
- \let#1\gobblethreearguments \or
- \let#1\gobblefourarguments \or
- \let#1\gobblefivearguments \or
- \let#1\gobblesixarguments \or
- \let#1\gobblesevenarguments \or
- \let#1\gobbleeightarguments \or
- \let#1\gobbleninearguments \or
- \let#1\gobbletenarguments \fi}
-
- \def\resetspecials
- {\the\everyresetspecials}
-
- \def\definespecial#1%
- {\@EA\chardef\csname\@@speclst@@\string#1\endcsname=1
- \def#1}
-
- \def\doifspecialavailableelse#1%
- {\ifcase\csname\@@speclst@@\string#1\endcsname
- \expandafter\secondoftwoarguments
- \else
- \expandafter\firstoftwoarguments
- \fi}
-
-\fi
-
-%D For quite some time the \CONTEXT\ way of specifying the
-%D output format has been:
-%D
-%D \starttyping
-%D \usespecials[ps,yy,win,pdf]
-%D \stoptyping
-%D
-%D Because at \PRAGMA\ we use \DVIPSONE, this was a suitable
-%D setting, but with \CONTEXT\ going public, the next sequence
-%D is more suitable for \DVIPS\ users:
-%D
-%D \starttyping
-%D \usespecials[reset,ps,tr,pdf]
-%D \stoptyping
-%D
-%D On the other hand, for \PDFTEX\ we needed:
-%D
-%D \starttyping
-%D \usespecials[tpd]
-%D \stoptyping
-%D
-%D To simplify things, I decided to provide a higher level
-%D command.
-%D
-%D \starttyping
-%D \defineoutput[name][specials]
-%D \setupoutput[name,...]
-%D \stoptyping
-%D
-%D In a \type {spec-def} you can find some examples.
-
-\def\defineoutput
- {\dodoubleargument\dodefineoutput}
-
-\def\dodefineoutput[#1][#2]%
- {\setvalue{\??ui#1}{#2}}
-
-\def\dosetupoutput#1%
- {\doifdefinedelse{\??ui#1}
- {\processcommacommand[\getvalue{\??ui#1}]\dousespecials}
- {\doifdefinedelse{\@@specfil@@#1}
- {\dousespecials{#1}}
- {\showmessage\m!specials7{#1}}}}
-
-% Beware, from now on changing the (default) driver files demands
-% remaking the format (no big deal, since only i adapt the driver
-% and need delayed loading).
-
-\let\currentoutput\empty
-
-\def\setupoutput[#1]%
- {\doifnot{#1}{\currentoutput}
- {\ifnum\realpageno<\plustwo % new
- \resetspecials\processcommacommand[#1]\dosetupoutput
- \edef\currentoutput{#1}%
- \fi}}
-
-\def\preloadspecials % it's nicer to report this
- {\doifsomething\currentoutput
- {\showmessage\m!specials1\currentoutput}}
-
-\appendtoks
- \savecurrentvalue\usedoutputdriver\currentoutput
-\to \everyfirstshipout
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/spec-mis.mkii b/Master/texmf-dist/tex/context/base/mkii/spec-mis.mkii
deleted file mode 100644
index de0debd3cdf..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/spec-mis.mkii
+++ /dev/null
@@ -1,288 +0,0 @@
-%D \module
-%D [ file=spec-mis,
-%D version=1997.04.01,
-%D title=\CONTEXT\ Special Macros,
-%D subtitle=Miscellaneous Macros,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Quite some modules in this group are dedicated to supporting
-%D \PDF\ directly by means of \PDFTEX or indirectly by using
-%D Acrobat Distiller. This module implements some common
-%D features.
-
-\writestatus{loading}{ConTeXt Special Macros / Miscellaneous Macros}
-
-\unprotect
-
-%D \macros
-%D {URLhash}
-%D
-%D A rather trivial macro:
-
-\expandafter\def\expandafter\URLhash\expandafter{\string#}
-
-%D \macros
-%D {ifusepagedestinations}
-%D
-%D In \PDF\ version 1.0 only page references were supported,
-%D while in \DVIWINDO\ 1.N only named references were accepted.
-%D Therefore \CONTEXT\ supports both methods of referencing. In
-%D \PDF\ version 1.1 named destinations arrived. Lack of
-%D continuous support of version 1.1 viewers for \MSDOS\
-%D therefore sometimes forces us to prefer page references. As
-%D a bonus, they are faster too and have no limitations. How
-%D fortunate we were having both mechanisms available when the
-%D version 3.0 (\PDF\ version 1.2) viewers proved to be too
-%D bugged to support named destinations.
-
-\newif\ifusepagedestinations
-
-%D \macros
-%D {ifhighlighthyperlinks}
-%D
-%D The next switch can be used to make user hyperlinks are
-%D not highlighted when clicked on.
-
-\newif\ifhighlighthyperlinks
-
-%D \macros
-%D {ifgotonewwindow}
-%D
-%D To make the {\em goto previous jump} feature more
-%D convenient when using more than one file, it makes sense
-%D to force the viewer to open a new window for each file
-%D opened.
-
-\newif\ifgotonewwindow
-
-%D \macros
-%D {ifPDFstrokecolor}
-%D
-%D We can reduce the filesize a bit by setting the next switch
-%D to false. The amount of reduction depends on the use of
-%D color, but don't expect more than a few percent. Zip
-%D compression is already rather efficient in itself.
-
-\newif\ifPDFstrokecolor \PDFstrokecolortrue
-
-%D \macros
-%D {dofileinsertion,definefileinsertion,doiffileinsertionsupported}
-%D
-%D File insertion depend on the driver or \TEX\ variant used.
-%D All driver modules use the same scheme for file insertion,
-%D and therefore have the next macro in common (stupified
-%D per august 2006):
-
-\let\supportedfileinsertions\empty
-\let\supportedfilecheckers \empty
-
-\def\definefileinsertion#1#2#3%
- {\addtocommalist{#2}\supportedfileinsertions
- \setvalue{do#1insert#2}{#3}}
-
-\def\definefilechecker#1#2#3%
- {\addtocommalist{#2}\supportedfilecheckers
- \setvalue{do#1check#2}{#3}}
-
-\def\dofileinsertion#1#2{\executeifdefined{do#1insert#2}\donothing}
-\def\dofilechecker #1#2{\executeifdefined{do#1check#2} \donothing}
-
-\appendtoks \let\supportedfileinsertions\empty \to \everyresetspecials
-\appendtoks \let\supportedfilecheckers \empty \to \everyresetspecials
-
-% \def\doiffileinsertionsupportedelse#1%
-% {\expanded{\doifinstringelse{#1}{\c!tex,\c!tmp,\supportedfileinsertions}}}
-
-\def\doiffileinsertionsupportedelse#1% lowercasing happens at tex end
- {\expanded{\doifinstringelse{\truegraphictype{#1}}{\c!tex,\c!tmp,\supportedfileinsertions}}}
-
-%D This macro is called with 10 arguments, where the first
-%D one specifies the driver, like \type{yy} or \type{tr}. The
-%D second argument is a \type{{type,method}} pair and the
-%D third the filename.
-
-%D Just in case this one is undefined (which can happen if
-%D this module is used outside \CONTEXT):
-
-\ifx\setreferencefilename\undefined
-
- \def\setreferencefilename#1\to#2{\edef#2{#1}}
-
-\fi
-
-%D When submitting forms, we need to communicate the format.
-
-\chardef\submitoutputformat=0 % 0=unknown 1=HTML 2=FDF 3=XML
-
-\def\setsubmitoutputformat#1%
- {\doifinsetelse{#1}{FDF,fdf}
- {\chardef\submitoutputformat2}
- {\doifinsetelse{#1}{XML,xml}
- {\chardef\submitoutputformat3}
- {\chardef\submitoutputformat1}}%
- \relax}
-
-%D \macros
-%D {escapePSstring}
-%D
-%D \starttyping
-%D \escapePSstring(t\e\1st)))))\to\crap \crap
-%D \stoptyping
-
-% testcase: webschrift met lege regels en unbalanced ()
-
-\bgroup
-
-\catcode`\*=\@@escape
-\catcode`\\=\@@letter
-
-*long*gdef*escapedPSstring#1%
- {*aftergroup*string
- *ifnum`#1=12
- *aftergroup*n%
- *else*ifnum`#1=13
- *aftergroup*n%
- *else*if#1(%
- *aftergroup*(%
- *else*if#1)%
- *aftergroup*)%
- *else*if#1\%
- *aftergroup*\%
- *else
- *aftergroup#1%
- *fi*fi*fi*fi*fi}
-
-*egroup
-
-\long\def\escapePSstring#1\to#2%
- {\defconvertedargument#2{#1}%
- \bgroup
- \ifx#2\empty \else
- \setverbosecscharacters
- \aftergroup\edef
- \aftergroup#2%
- \aftergroup{%
- \expandafter\handletokens#2\with\escapedPSstring
- \aftergroup}%
- \fi
- \egroup}
-
-% \long\def\preservePSpar#1\to#2%
-% {\bgroup
-% \def\par{\rawcharacter{12}}%
-% \expanded{\egroup\noexpand\def\noexpand#2{#1}}}
-
-\long\def\preservePSpar#1\to#2%
- {\bgroup
- \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
-%D {ifPDFunicode}
-%D
-%D We can use this switch to signal that content streams has
-%D to be unicoded.
-
-\newif\ifPDFunicode
-
-%D \macros
-%D {makeMPintoPDFobject, handleMPfshow, setMPPDFobject, getMPPDFobject}
-%D
-%D \METAPOST\ support.
-
-\ifx\makeMPintoPDFobject\undefined \newcount\makeMPintoPDFobject \fi
-
-\appendtoks
- \makeMPintoPDFobject\zerocount
- \def\setMPPDFobject#1#2{\def\getMPPDFobject{\box#2}}%
-\to \everyresetspecials
-
-\appendtoks
- \let\handleMPfshow\dohandleMPfshow
-\to \everyresetspecials
-
-%D
-
-%D \macros
-%D {dosetposition, dosetpositionwdh, dosetpositionplus}
-%D
-%D Opposite to its \DVI\ counterpart, the \PDFTEX\ backend
-%D can provide positional information directly. Since
-%D \CONTEXT\ only uses relative positions, the origin is of
-%D less importance. Nowadays \XETEX\ also supports this
-%D feature.
-
-\ifx\pdfsavepos\undefined
-
- % only for ancient pdftex, less old xetex and current aleph
-
- \def\dosetposition #1{\special{pos:pxy "#1"}}
- \def\dosetpositionwhd #1#2#3#4{\special{pos:pxywhd "#1" #2 #3 #4}}
- \def\dosetpositionplus#1#2#3#4#5{\special{pos:pxyplus "#1" #2 #3 #4 #5}}
-
- \let\flushDVIpositionpapersize\relax
-
- \def\dosetpositionpapersize#1#2%
- {\xdef\flushDVIpositionpapersize
- {\special{pos:papersize \number#1 \number#2}%
- \noexpand\installprogram{dvipos -o \jobname.tuo \jobname.dvi }%
- \global\noexpand\let\noexpand\flushDVIpositionpapersize\relax}}
-
- % kind of obsolete since nowadays xetex supports \pdfsavepos as well
-
- \ifnum\texengine=\xetexengine
-
- \def\dosetpositionpapersize#1#2%
- {\xdef\flushDVIpositionpapersize
- {\special{pos:papersize \number#1 \number#2}%
- \noexpand\installprogram{dvipos -o \jobname.tuo \jobname.xdv }%
- \global\noexpand\let\noexpand\flushDVIpositionpapersize\relax}}
-
- \fi
-
- \prependtoksonce \flushDVIpositionpapersize \to \everyshipout
-
-\else
-
- \def\dosetposition#1%
- {\pdfsavepos
- \dolazysaveposition
- {#1}%
- {\noexpand\realfolio}%
- {\noexpand\the\dimexpr\pdflastxpos\scaledpoint\relax}%
- {\noexpand\the\dimexpr\pdflastypos\scaledpoint\relax}}%
-
- \def\dosetpositionwhd#1#2#3#4%
- {\pdfsavepos
- \dolazysavepositionwhd
- {#1}%
- {\noexpand\realfolio}%
- {\noexpand\the\dimexpr\pdflastxpos\scaledpoint\relax}%
- {\noexpand\the\dimexpr\pdflastypos\scaledpoint\relax}%
- {#2}{#3}{#4}}
-
- \def\dosetpositionplus#1#2#3#4#5%
- {\pdfsavepos
- \dolazysavepositionplus
- {#1}%
- {\noexpand\realfolio}%
- {\noexpand\the\dimexpr\pdflastxpos\scaledpoint\relax}%
- {\noexpand\the\dimexpr\pdflastypos\scaledpoint\relax}%
- {#2}{#3}{#4}{#5}}
-
- \let\dosetpositionpapersize\gobbletwoarguments
-
-\fi
-
-%D Handy to have this available asap:
-
-\ifdefined\everyPDFxform \newtoks\everyPDFxform \fi
-\ifdefined\everyPDFximage \newtoks\everyPDFximage \fi
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/spec-pdf.mkii b/Master/texmf-dist/tex/context/base/mkii/spec-pdf.mkii
deleted file mode 100644
index 33722f60345..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/spec-pdf.mkii
+++ /dev/null
@@ -1,482 +0,0 @@
-%D \module
-%D [ file=spec-pdf,
-%D version=1997.09.20,
-%D title=\CONTEXT\ Special Macros,
-%D subtitle=Adobe \ACROBAT\ version 2.1,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% funny things: mail to yeny: "please geen auto-crlf in special"
-
-%D This driver is build on top of the general \PDF\ macros,
-%D as defined in \type{spec-fdf}, so we inherit that one.
-
-\startspecials[pdf][fdf]
-
-%D \macros
-%D {dosetupinteraction,
-%D doPDFsetopenaction,doPDFsetcloseaction}
-%D
-%D Instead of a prolog, we can put the code in the file
-%D ourselve.
-%D
-%D \starttyping
-%D \definespecial\dosetupinteraction%
-%D {\special
-%D {\@@insertpostscriptretain
-%D /pdfmark where
-%D {pop}
-%D {userdict /pdfmark /cleartomark load put}
-%D ifelse}}
-%D \stoptyping
-%D
-%D We decided to use a prolog file. The following code has to
-%D be put somewhere, e.g.\ in the startup directory of
-%D \DISTILLER. To overcome problems, we always embed the fonts,
-%D but copyrights force us always to make subsets.
-%D
-%D \starttyping
-%D /currentdistillerparams where
-%D { pop } { userdict /currentdistillerparams { 1 dict } put } ifelse
-%D
-%D /setdistillerparams where
-%D { pop } { userdict /setdistillerparams { pop } put } ifelse
-%D
-%D << /AntiAliasColorImages true
-%D /AntiAliasGrayImages true
-%D /AntiAliasMonoImages true
-%D /ConvertCMYKImagesToRGB true
-%D /MaxSubsetPct 99
-%D /EmbedAllFonts true
-%D /SubSetFonts true >> setdistillerparams
-%D \stoptyping
-%D
-%D Beware, this is the PostScript Level 2 way of doing things.
-
-\definespecial\dosetupinteraction
- {\showmessage\m!interactions{21}{acrobat}}
-
-\definespecial\dosetupopenaction {\doPDFsetupopenaction}
-\definespecial\dosetupcloseaction{\doPDFsetupcloseaction}
-
-%D \macros
-%D {dostartthisislocation}
-%D
-%D We share a lot of macros with the \PDFTEX\ driver. First
-%D the one that handles named destinations.
-
-\definespecial\dostartthisislocation {\doPDFstartthisislocation}
-
-%D \macros
-%D {doresetgotowhereever,
-%D dostartgotolocation,dostartgotorealpage,dostartgotoJS,
-%D dostartexecutecommand,dostartrunprogram,dostartgotoprofile}
-%D
-%D The next specials are responsible for handling references.
-%D Each goto handler can handle multiple references.
-
-\definespecial\doresetgotowhereever {\doPDFresetgotowhereever}
-\definespecial\dostartgotolocation {\doPDFstartgotolocation}
-\definespecial\dostartgotorealpage {\doPDFstartgotorealpage}
-\definespecial\dostartgotoJS {\doPDFstartgotoJS}
-\definespecial\dostartexecutecommand{\doPDFstartexecutecommand}
-\definespecial\dostartrunprogram {\doPDFstartrunprogram}
-\definespecial\dostartgotoprofile {\doPDFstartgotoprofile}
-
-%D \macros
-%D {doflushJSpreamble}
-%D
-%D Thanks to the fact that \DISTILLER\ cannot handle multiple
-%D names entries in the document catalog, for the moment we
-%D have to misuse the page attributes. Beware, the preambles
-%D must be packed.
-
-\definespecial\doflushJSpreamble#1%
- {\bgroup
- \ifoneJSpreamble
- \edef\sanitizedJScode{\getJSpreamble{#1}}%
- \expandafter\doPSsanitizeJScode\sanitizedJScode\to\sanitizedJScode
- \special % nota bene, the page starts at 1
- {\@@insertpostscriptretain
- [ /_objdef{JS:#1} /type /dict /OBJ pdfmark
- [ {JS:#1} << /S /JavaScript /JS (\sanitizedJScode) >> /PUT pdfmark
- [ {Page1} << /AA << /O {JS:#1} >> >> /PUT pdfmark}%
- \else % temporary message
- \writestatus{\m!specials}{Acrobat workaround needed: please pack JS preambles}%
- \fi
- \egroup}
-
-%D \macros
-%D {dostarthide,dostophide}
-%D
-%D Hopefully some day hiding navigational things when
-%D printing \PDF\ files will be supported properly.
-
-\definespecial\dostarthide%
- {\special
- {\@@insertpostscriptretain
- [ /DataSource (false \iftrue\string{\else}\fi)
- /PS
- pdfmark}}
-
-\definespecial\dostophide%
- {\special
- {\@@insertpostscriptretain
- [ /DataSource (\iffalse{\else\string}\fi if)
- /PS
- pdfmark}}
-
-%D \macros
-%D {dosetupscreen,
-%D dosetupidentity}
-%D
-%D We can set up the page dimensions, full screen start up
-%D mode and identify the file with:
-
-\definespecial\dosetupscreen {\doPDFsetupscreen \printpaperheight}
-
-\definespecial\dosetupartbox {\doPDFsetupartbox \printpaperheight}
-\definespecial\dosetupcropbox {\doPDFsetupcropbox \printpaperheight}
-\definespecial\dosetupbleedbox{\doPDFsetupbleedbox\printpaperheight}
-\definespecial\dosetuptrimbox {\doPDFsetuptrimbox \printpaperheight}
-
-\definespecial\dosetupidentity{\doPDFsetupidentity}
-
-%D \macros
-%D {dobeginofprofile,doendofprofile}
-%D
-%D Profile support is still far from perfect. This is
-%D especially due to the fact that the specification of
-%D threads are sort of fuzzy and depend on the viewer.
-
-\definespecial\dobeginofprofile#1#2#3#4% label width height page
- {\bgroup
- \setPDFdestination{#1}%
- \doifsomething{\PDFdestination}
- {\PointsToBigPoints{#2}\width
- \PointsToBigPoints{#3}\height
- \special
- {\@@insertpostscriptretain
- [ /Title (\PDFdestination)
- /Rect [0 0 \width\space\height]
- /ARTICLE
- pdfmark}}%
- \egroup}
-
-\definespecial\doendofprofile%
- {}
-
-%D Apart from movies, graphic inclusion is handled in the
-%D \POSTSCRIPT\ drivers. We just link the movie annotation
-%D handled to the file inclusion system.
-
-\definefileinsertion{yy}{mov}{\doPDFinsertmov}
-\definefileinsertion{tr}{mov}{\doPDFinsertmov}
-
-\definefileinsertion{yy}{avi}{\doPDFinsertmov}
-\definefileinsertion{tr}{avi}{\doPDFinsertmov}
-
-%D \macros
-%D {doinsertsoundtrack}
-%D
-%D Sounds look much like movies:
-
-\definespecial\doinsertsoundtrack{\doPDFinsertsoundtrack}
-
-%D \macros
-%D {dostartobject,dostopobject,
-%D doinsertobject}
-%D
-%D Objects, those nice reusable pieces of text and graphics,
-%D are handled by three specials:
-
-\definespecial\dostartobject#1#2#3#4#5%
- {\bgroup
- \setbox\nextbox=\hbox\bgroup
- \bgroup
- \PointsToBigPoints{#3}\width
- \PointsToBigPoints{#4}\height
- \PointsToBigPoints{#5}\depth
- \dosetobjectreference{#1}{#2}{#1::#2}%
- \special
- {\@@insertpostscriptretain
- [ /BBox [0 -\depth\space \width\space \height]
- /_objdef {#1::#2}
- /BP
- pdfmark}%
- \egroup}
-
-\definespecial\dostopobject%
- {\special
- {\@@insertpostscriptretain
- [ /EP
- pdfmark}%
- \egroup
- \smashbox\nextbox
- \flushatshipout{\box\nextbox}%
- \egroup}
-
-\definespecial\doinsertobject#1#2%
- {\hbox
- {\dogetobjectreference{#1}{#2}\PDFobjectreference
- \ifx\PDFobjectreference\empty \else
- \special
- {\@@insertpostscriptretain
- [ {\PDFobjectreference}
- /SP
- pdfmark}%
- \fi}}
-
-%D \macros
-%D {doinsertbookmark}
-%D
-%D Although personally I never use bookmarks, \CONTEXT\ does
-%D support them, due to user requests.
-
-\definespecial\doinsertbookmark {\doPDFinsertbookmark}
-
-%D \macros
-%D {dosetpagetransition}
-%D
-%D Page transitions, again a user wish, is taken care of by:
-
-\definespecial\dosetpagetransition{\doPDFsetpagetransition}
-
-%D \macros
-%D {doinsertcomment, doflushcomments}
-%D
-%D I never needed (and used) one until now, but here is the
-%D text annotation special:
-
-\definespecial\doinsertcomment{\doPDFinsertcomment}
-\definespecial\doflushcomments{\doPDFflushcomments}
-
-%D \macros
-%D {dopresetlinefield,dopresettextfield,
-%D dopresetchoicefield,dopresetpopupfield,dopresetcombofield,
-%D dopresetpushfield,dopresetcheckfield,
-%D dopresetradiofield,dopresetradiorecord}
-%D
-%D There is nothing enervating to the next few mappings.
-
-\definespecial\dopresetlinefield {\doFDFpresetlinefield}
-\definespecial\dopresettextfield {\doFDFpresettextfield}
-\definespecial\dopresetchoicefield{\doFDFpresetchoicefield}
-\definespecial\dopresetpopupfield {\doFDFpresetpopupfield}
-\definespecial\dopresetcombofield {\doFDFpresetcombofield}
-\definespecial\dopresetpushfield {\doFDFpresetpushfield}
-\definespecial\dopresetcheckfield {\doFDFpresetcheckfield}
-\definespecial\dopresetradiofield {\doFDFpresetradiofield}
-\definespecial\dopresetradiorecord{\doFDFpresetradiorecord}
-
-%D \macros
-%D {dodefinefieldset,dogetfieldset,doiffieldset}
-%D
-%D Field sets, used in resetting and submitting, are handled
-%D by:
-
-\definespecial\dodefinefieldset{\doFDFdefinefieldset}
-\definespecial\dogetfieldset {\doFDFgetfieldset}
-\definespecial\doiffieldset {\doFDFiffieldset}
-
-%D \macros
-%D {doregistercalculationset}
-%D
-%D The calculation order is defined using:
-
-\definespecial\doregistercalculationset{\doFDFregistercalculationset}
-
-%D \macros
-%D {doPDFdestination}
-%D
-%D Last we implement the low level pdfmark macros. The
-%D definitions are rather verbose. First the destination
-%D macro.
-
-\def\doPDFdestination#1%
- {\special
- {\@@insertpostscriptretain
- [ /Dest /#1\space
- \PDFpageview
- /DEST
- pdfmark}}
-
-%D \macros
-%D {doPDFaction,doPDFannotation,doPDFannotationobject,
-%D ifsharePDFactions}
-%D
-%D We have three alternative annotation macros. The first
-%D handles the goto ones, the second takes care of for instance
-%D movies and the third is used in fields.
-
-\newcount\nofPDFsimilar
-
-\newif\ifsharePDFactions \sharePDFactionstrue
-
-\def\dodoPDFaction#1#2#3#4%
- {\ifcollectreferenceactions
- \xdef\lastPDFaction{#4}%
- \else
- \bgroup
- % does not work well with distiller 4
- %\ifsharePDFactions
- % \ifcase\similarreference\relax
- % \xdef\lastPDFaction{<<#4>>}%
- % \or
- % \global\advance\nofPDFsimilar by 1
- % \special
- % {\@@insertpostscriptretain
- % [ /_objdef {PDF::sim:\the\nofPDFsimilar} /type /dict /OBJ pdfmark
- % [ {PDF::sim:\the\nofPDFsimilar} <<#4>>\space /PUT pdfmark}%
- % \xdef\lastPDFaction{{PDF::sim:\the\nofPDFsimilar}}%
- % \else
- % % leave \lastPDFaction untouched
- % \fi
- %\else
- \xdef\lastPDFaction{<<#4>>}%
- %\fi
- \PointsToBigPoints{#2}\width
- \PointsToBigPoints{#1}\height
- \special
- {\@@insertpostscriptretain
- [ #1
- /Action \lastPDFaction\space
- /Rect [0 0 \width\space \height]
- /Border [0 0 0]
- \ifhighlighthyperlinks \else /H /N \fi
- /Subtype /Link
- /ANN
- pdfmark}%
- \egroup
- \fi}
-
-\def\doPDFaction#1#2#3%
- {\dodoPDFaction\empty{#1}{#2}{#3}}
-
-\def\doPDFannotation#1#2#3%
- {\bgroup
- \PointsToBigPoints{#1}\width
- \PointsToBigPoints{#2}\height
- \special
- {\@@insertpostscriptretain
- [ /Rect [0 0 \width\space \height] #3
- /ANN
- pdfmark}%
- \egroup}
-
-\def\doPDFannotationobject#1#2#3#4#5%
- {\bgroup
- \PointsToBigPoints{#3}\width
- \PointsToBigPoints{#4}\height
- \special
- {\@@insertpostscriptretain
- [ /_objdef {#1::#2}
- /Rect [0 0 \width\space \height] #5
- /ANN
- pdfmark}%
- \egroup
- \dosetobjectreference{#1}{#2}{#1::#2}}
-
-\def\doPDFactionobject#1#2#3#4#5%
- {\dodoPDFaction{/_objdef {#1::#2}}{#3}{#4}{#5}%
- \dosetobjectreference{#1}{#2}{#1::#2}}
-
-%D \macros
-%D {doPDFdictionaryobject,doPDFarrayobject}
-%D
-%D These two macros are used to build low level objects.
-
-\def\doPDFdictionaryobject#1#2#3%
- {\special
- {\@@insertpostscriptretain
- [ /_objdef {#1::#2} /type /dict /OBJ pdfmark
- [ {#1::#2} << #3 >> /PUT pdfmark}%
- \dosetobjectreference{#1}{#2}{#1::#2}}
-
-\def\doPDFarrayobject#1#2#3%
- {\special
- {\@@insertpostscriptretain
- [ /_objdef {#1::#2} /type /array /OBJ pdfmark
- [ {#1::#2} 0 [#3] /PUTINTERVAL pdfmark}%
- \dosetobjectreference{#1}{#2}{#1::#2}}
-
-%D \macros
-%D {doPDFaddtocatalog,doPDFaddtoinfo,
-%D doPDFpageattribute,doPDFpagesattribute}
-%D
-%D Next come our housekeeping macros.
-
-\def\doPDFaddtocatalog#1%
- {\doifsomething{#1}
- {\special
- {\@@insertpostscriptretain
- [ {Catalog} << #1 >> /PUT pdfmark}}}
-
-\def\doPDFaddtoinfo#1% unchecked
- {\special
- {\@@insertpostscriptretain
- [ #1 /DOCINFO pdfmark}} % [ {DocInfo} << #1 >> /PUT pdfmark}}
-
-\def\doPDFpageattribute#1%
- {\doifsomething{#1}
- {\special
- {\@@insertpostscriptretain
- [ {ThisPage} << #1 >> /PUT pdfmark}}}
-
-\def\doPDFpageresource#1%
- {\message{[skipping PDF resource]}}
-
-\def\doPDFpagesattribute#1%
- {\doifsomething{#1}
- {\special
- {\@@insertpostscriptretain
- [ #1 /PAGES pdfmark}}}
-
-\let\doPDFresetpageresources \relax
-\let\doPDFresetpageattributes\relax
-
-%D \macros
-%D {doPDFbookmark}
-%D
-%D This is how we force bookmarks entries in the file.
-
-\def\doPDFbookmark#1#2#3#4#5%
- {\scratchcounter#4\advance\scratchcounter\minusone
- \special
- {\@@insertpostscriptretain
- [ /Page \the\scratchcounter\space
- \ifcase#2 \else/Count \ifcase#5-\fi#2 \fi
- \PDFpageview
- /Title (#3)
- /OUT
- pdfmark}}
-
-%D \macros
-%D {defaultobjectreference,doPDFgetobjectreference}
-%D
-%D The object references are \type{{named}}, that is, no hard
-%D coded numbers are needed (opposite to \PDFTEX).
-
-\def\defaultobjectreference#1#2{#1::#2}
-
-\def\doPDFgetobjectreference#1#2#3%
- {\dogetobjectreference{#1}{#2}#3%
- \ifx#3\empty\else\edef#3{{#3}}\fi}
- %\edef#3{\ifx#3\empty null\else{#3}\fi}}
-
-% \def\doPDFgetobjectpage #1#2#3{..}
-% \def\doPDFgetobjectpagereference#1#2#3{..}
-
-\def\doPDFgetpagereference#1#2%
- {\edef#2{{page#1}}}
-
-%D Done.
-
-\stopspecials
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/spec-ps.mkii b/Master/texmf-dist/tex/context/base/mkii/spec-ps.mkii
deleted file mode 100644
index 02ec16453cb..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/spec-ps.mkii
+++ /dev/null
@@ -1,229 +0,0 @@
-%D \module
-%D [ file=spec-ps,
-%D version=1996.01.25,
-%D title=\CONTEXT\ Special Macros,
-%D subtitle=Adobe PostScript,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 \macros
-%D {dostartgraymode,dostopgraymode,
-%D dostartrgbcolormode,dostartcmykcolormode,dostartgraycolormode,dostopcolormode,
-%D dostartrotation,dostoprotation,
-%D dostartscaling,dostopscaling,
-%D dostartmirroring,dostopmirroring,
-%D dostartnegative,dostopnegative,
-%D dostartoverprint,dostopoverprint,
-%D doselectfirstpaperbin,
-%D doselectsecondpaperbin}
-%D
-%D This implementation is straightforward and can be used as
-%D a default with postscript||drivers. We use \type{ps:} as
-%D opening, because most drivers support this.
-
-\startspecials[postscript]
-
-\def\@@insertpostscriptliteral {ps: }
-\def\@@insertpostscriptretain {" }
-
-\definespecial\dostartgraymode#1%
- {\special
- {\@@insertpostscriptliteral
- #1\space setgray}}
-
-\definespecial\dostopgraymode
- {\special
- {\@@insertpostscriptliteral
- 0 setgray}}
-
-\definespecial\dostartrgbcolormode#1#2#3%
- {\special
- {\@@insertpostscriptliteral
- #1\space #2\space #3\space setrgbcolor}}
-
-\definespecial\dostartcmykcolormode#1#2#3#4%
- {\special
- {\@@insertpostscriptliteral
- #1\space #2\space #3\space #4\space setcmykcolor}}
-
-\definespecial\dostartgraycolormode#1%
- {\special
- {\@@insertpostscriptliteral
- #1\space setgray}}
-
-\definespecial\dostopcolormode
- {\special
- {\@@insertpostscriptliteral
- 0 setgray}}
-
-\definespecial\doselectfirstpaperbin
- {\special
- {\@@insertpostscriptliteral
- statusdict begin 1 setpapertray end}} % checken
-
-\definespecial\doselectsecondpaperbin
- {\special
- {\@@insertpostscriptliteral
- statusdict begin 0 setpapertray end}} % checken
-
-\definespecial\dostartrotation#1% straight from the YandY manual
- {\special
- {\@@insertpostscriptliteral
- gsave currentpoint currentpoint translate
- \number#1\space\space rotate neg exch neg exch translate}}
-
-\definespecial\dostoprotation
- {\special
- {\@@insertpostscriptliteral
- currentfont currentpoint grestore moveto setfont}}
-
-\definespecial\dostartscaling#1#2% conforming the YandY manual
- {\special
- {\@@insertpostscriptliteral
- gsave currentpoint currentpoint translate
- #1\space #2\space scale neg exch neg exch translate}}
-
-\definespecial\dostopscaling
- {\special
- {\@@insertpostscriptliteral
- currentfont currentpoint grestore moveto setfont}}
-
-\definespecial\dostartmirroring % some translate and exch stuff from YandY
- {\special
- {\@@insertpostscriptliteral
- gsave currentpoint currentpoint translate
- [-1 0 0 1 0 0] concat neg exch neg exch translate}}
-
-\definespecial\dostopmirroring
- {\special
- {\@@insertpostscriptliteral
- currentfont currentpoint grestore moveto setfont}}
-
-\definespecial\dostartnegative
- {\special{\@@insertpostscriptliteral gsave {1 exch sub} settransfer}}
-
-\definespecial\dostopnegative
- {\special{\@@insertpostscriptliteral grestore}}
-
-\definespecial\dostartoverprint
- {\special{\@@insertpostscriptliteral true setoverprint}}
-
-\definespecial\dostopoverprint
- {\special{\@@insertpostscriptliteral false setoverprint}}
-
-\definespecial\dostartgraphicgroup
- {\special{\@@insertpostscriptliteral gsave}}
-
-\definespecial\dostopgraphicgroup
- {\special{\@@insertpostscriptliteral grestore}}
-
-%D \macros
-%D {doovalbox}
-%D
-%D This implementation is a mixture of several possible
-%D implementations. We use some constants that may not be
-%D changed. It took some time to find them, but these values
-%D offer quite accurate results. The macro calls for
-%D \type{\forgetall}, which resets indentation, skips and
-%D \type{\everypar}.
-%D
-%D Because a stroke follows the line, we correct for half of
-%D the linewidth. Furthermore we use scaling to overcome some
-%D limitations in the precision ($<1$~sp) and to prevent
-%D rounding errors. We also do some correction for large
-%D values. We let PostScript compare some arguments with
-%D \type{a b eq {action} fi}.
-%D
-%D The path is based on a macro of J.~Hefferon cs. We also
-%D tried the D.~Salomon implementation, but this did not work
-%D well, just like some other alternatives.
-
-% #1 = width #2 = height #3 = depth
-% #4 = linewidth #5 = radius
-% #5 = stroke (ja,nee) #7 = fill (ja,nee)
-
-\def\@@insertpostscriptliteral {ps: }
-\def\@@insertpostscriptretain {postscript } % unknown
-
-\def\dosomeovalcalc#1#2#3%
- {\dimen2=#1%
- \advance\dimen2 #2%
- \PointsToBigPoints{\dimen2}#3}
-
-\def\dosomeovalbox#1#2#3#4#5#6#7#8% variant not yet supported
- {\bgroup
- \dimen0=#4\divide\dimen0 2
- \dosomeovalcalc{0pt}{+\dimen0}\xmin
- \dosomeovalcalc{#1}{-\dimen0}\xmax
- \dosomeovalcalc{#2}{-\dimen0}\ymax
- \dosomeovalcalc{-#3}{+\dimen0}\ymin
- \dosomeovalcalc{#4}{0pt}\stroke
- \dosomeovalcalc{#5}{0pt}\radius
- \edef\dostroke{#6}%
- \edef\dofill{#7}%
- \setbox\nextbox\hbox
- {\ifnum\dostroke\dofill>0
- \special
- {\@@insertpostscriptretain
- gsave
- newpath
- \xmin\space \radius\space add \ymin\space moveto
- \xmax\space \ymin\space \xmax\space \ymax\space \radius\space arcto
- \xmax\space \ymax\space \xmin\space \ymax\space \radius\space arcto
- \xmin\space \ymax\space \xmin\space \ymin\space \radius\space arcto
- \xmin\space \ymin\space \xmax\space \ymin\space \radius\space arcto
- \xmin\space \radius\space add \ymin\space moveto
- 16 {pop} repeat
- closepath
- (\dostroke) (1) eq
- {\stroke\space 0 ne
- {gsave
- \stroke\space setlinewidth
- stroke
- grestore} if} if
- (\dofill) (1) eq
- {fill} if
- grestore}%
- \fi}%
- \nextboxwd#1%
- \nextboxht#2%
- \nextboxdp#3%
- \flushnextbox
- \egroup}
-
-%D The indirect call permits a (rather) dirty hack, needed
-%D for \DVIPS\ support.
-
-\definespecial\doovalbox
- {\dosomeovalbox}
-
-%D \macros
-%D {dostartclipping,dostopclipping}
-%D
-%D These two specials are not yet working as expected.
-
-\definespecial\dostartclipping#1#2#3%
- {\PointsToBigPoints{#2}\width
- \PointsToBigPoints{#3}\height
- \grabMPclippath{#1}{0}{\width}{\height}
- {0 0 moveto \width 0 lineto \width \height lineto 0 \height\space lineto}%
- \special
- {\@@insertpostscriptliteral\space
- save newpath \MPclippath\space closepath clip}}
-
-\definespecial\dostopclipping
- {\special{\@@insertpostscriptliteral\space restore}}
-
-%D Some MP stuff:
-
-\definespecial\doinsertMPfile#1%
- {\doiffileelse{./#1}{\includeMPasEPS{./#1}}{\message{[MP #1]}}}
-
-\stopspecials
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/spec-tpd.mkii b/Master/texmf-dist/tex/context/base/mkii/spec-tpd.mkii
deleted file mode 100644
index 042d5cdfe36..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/spec-tpd.mkii
+++ /dev/null
@@ -1,1334 +0,0 @@
-%D \module
-%D [ file=spec-tpd,
-%D version=1996.01.25,
-%D title=\CONTEXT\ Special Macros,
-%D subtitle=\PDFTEX,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% once we can be sure that the latest versions of pdftex are
-% available we can use:
-%
-% \pdfobj reserveobjnum \edef\one{\the\pdflastobj}
-% \pdfobj reserveobjnum \edef\two{\the\pdflastobj}
-%
-% \pdfobj useobjnum \one {x}
-% \pdfobj useobjnum \two {x}
-%
-% we then can rewrite part of spec-fdf because the other drivers
-% already support symbolic references
-
-% layers and links don't work while the spec says they should
-
-% method = auto
-%
-% \definefileinsertion{tpd}{auto}%
-% {\executesystemcommand{t:/ruby/pstopdf.rb #2}%
-% \dofileinsertion{tpd}{pdf}}
-
-% \let\PDFdestvoffset\zeropoint
-% \newbox\pdfdestbox
-%
-% \def\doPDFdestination#1%
-% {\ifdim\PDFdestvoffset=\zeropoint\relax
-% \pdfdest name {#1}\PDFpageviewkey
-% \else
-% \setbox\pdfdestbox\hbox to \zeropoint
-% {\raise\PDFdestvoffset\hbox{\pdfdest name {#1}\PDFpageviewkey}}%
-% \ht\pdfdestbox\zeropoint
-% \box\pdfdestbox
-% \fi}
-%
-% \def\PDFdestvoffset{2\lineheight} % {1.5\strutht}
-
-%D \macros
-%D {jobsuffix}
-%D
-%D Being one of the first typographical systems able to support
-%D advances \PDF\ support, \TEX\ is also one of the first
-%D systems to produce high quality \PDF\ code directly. Thanks
-%D to Han The Thanh c.s. the \TEX\ community can leap forward
-%D once again.
-%D
-%D One important characteristic of \PDFTEX\ is that is can
-%D produce standard \DVI\ code as well as \PDF\ code. This
-%D enables us to use one format file to support both output
-%D formats.
-
-%D All modules in this group use specials to tell drivers what
-%D non||\TEX\ actions to take. Because from the \TEX\ point of
-%D view, there is no difference between \DVI\ and \PDF, we
-%D therefore only have to bend the \DVI\ driver support into
-%D \PDF\ support. Technically spoken, specials no longer serve
-%D a purpose, except from ending up as comment in the \PDF\
-%D file.
-%D
-%D Before we continue we need to make sure if indeed those
-%D \PDFTEX\ primitives are permitted. If no primitives are
-%D available, we just stop reading any further.
-
-\unprotect
-
-\ifx\pdftexversion\undefined
- \writestatus\m!systems{you should use pdfTeX binaries}\wait
- \protect\expandafter\endinput
-\fi
-
-\ifnum\pdftexversion<13
- \writestatus\m!systems{your pdfTeX version is much too old}\wait
- \protect\expandafter\endinput
-\fi
-
-\ifnum\pdftexversion<14
- \writestatus\m!systems{please update your pdfTeX binaries}
-\fi
-
-\ifnum\pdftexversion>19
- \pdfhorigin=1 true in
- \pdfvorigin=1 true in
-\fi
-
-%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\pdfpkresolution \undefined \newcount\pdfpkresolution \fi
-
-\pdfimageresolution=300
-\pdfpkresolution =600
-
-%D Another downward compatible hack:
-
-\ifx\pdflastximagepages\undefined
- \newcount\pdflastximagepages \pdflastximagepages=1
-\fi
-
-%D And:
-
-\ifx\pdfpageresources\undefined
- \newtoks\pdfpageresources
-\fi
-
-%D In order to get high quality \METAPOST\ inclusion, we set
-%D the number of digits to~5 (prevents rounding errors).
-
-\ifx\pdfdecimaldigits\undefined
- \newcount\pdfdecimaldigits
-\fi
-
-\pdfdecimaldigits=10
-
-\ifx\pdfinclusionerrorlevel\undefined
- \ifx\pdfoptionpdfinclusionerrorlevel\undefined
- \newcount\pdfinclusionerrorlevel
- \else
- \let\pdfinclusionerrorlevel\pdfoptionpdfinclusionerrorlevel
- \fi
-\fi
-
-\pdfinclusionerrorlevel=0
-
-\ifx\pdfminorversion\undefined
- \ifx\pdfoptionpdfminorversion\undefined
- \newcount\pdfminorversion
- \else
- \let\pdfminorversion\pdfoptionpdfminorversion
- \fi
-\fi
-
-\pdfminorversion=5
-
-\def\PDFversion{1.\number\pdfminorversion}
-
-% %D Why are the Acrobat viewers so buggy? To prevent font cache
-% %D mismatches, we say:
-%
-% \ifx\pdfuniqueresname\undefined \else
-% \pdfuniqueresname=1
-% \fi
-
-%D Once we are sure that we're indeed supporting \PDFTEX, we
-%D force \PDF\ output at the highest compression. For debugging
-%D purposes one can set the compresslevel to~0. We also have to
-%D make sure no other specials are supported, else \PDFTEX\
-%D will keep on telling us that we're wrong. We also load the
-%D general \PDF\ macros that are shared between this driver and
-%D the \ACROBAT\ one.
-
-\startspecials[tpd][reset,fdf]
-
-%D This means that by saying
-%D
-%D \starttyping
-%D \usespecials[tpd]
-%D \stoptyping
-%D
-%D we get ourselves full \PDF\ output.
-
-%D For some internal testing we need to know the output
-%D suffix.
-
-\setjobsuffix{pdf}
-
-%D We don't use specials here, which means that we must flush
-%D settings before the page is shipped out.
-
-\specialbasedsettingsfalse
-
-%D Some more internal settings.
-
-\appendtoksonce
- \pdfoutput\zerocount
-\to \everyresetspecials
-
-\pdfoutput=1 % we reset that one with \everyresetspecials
-
-%D Just in case we mimmick specials, we have to make sure no
-%D default specials end up in the process.
-
-\let\defaultspecial=\gobbleoneargument
-
-\appendtoksonce
- \let\defaultspecial\normalspecial
-\to \everyresetspecials
-
-\let\PDFcode \pdfliteral
-\def\PDFcontentcode{\pdfliteral}
-\def\PDFdirectcode {\pdfliteral direct}
-
-%D \macros
-%D {everyPDFximage}
-%D
-%D This token register is flushed before an ximage is loaded.
-
-\ifdefined\everyPDFximage \else \newtoks\everyPDFximage \fi
-\ifdefined\everyPDFxform \else \newtoks\everyPDFxform \fi
-
-%D \macros
-%D {dosetuppaper}
-%D
-%D If we don't set the paper size, \PDFTEX\ will certainly do
-%D it in a way we don't want, therefore we need:
-
-\definespecial\dosetuppaper#1#2#3%
- {\global\pdfpagewidth #2\relax
- \global\pdfpageheight#3\relax}
-
-%D \macros
-%D {doloadmapfile,doloadmapline,doresetmapfilelist}
-
-\ifx\pdfmapfile\undefined \let\pdfmapfile\gobbletwoarguments \fi
-\ifx\pdfmapline\undefined \let\pdfmapline\gobbletwoarguments \fi
-
-\definespecial\doresetmapfilelist
- {\global\let\doresetmapfilelist\relax
- \pdfmapfile{original-empty.map}}
-
-\ifnum\pdftexversion<120
-
- \definespecial\doloadmapfile #1#2{\pdfmapfile{+#2}}
- \definespecial\doloadmapline #1#2{}
-
-\else
-
- \definespecial\doloadmapfile #1#2{\pdfmapfile{#1#2}}
- \definespecial\doloadmapline #1#2{\pdfmapline{#1#2}}
-
-\fi
-
-%D nasty but needed
-
-\appendtoksonce \loadallfontmapfiles \to \everyPDFximage
-\appendtoksonce \loadallfontmapfiles \to \everyPDFxform
-
-%D \macros
-%D {doinsertfile,dogetnofinsertpages}
-%D
-%D Graphics are not part of \TEX\ and therefore not part of the
-%D \DVI\ standard. \PDF\ on the other hand has several graphic
-%D primitives. During the multi||step process \TEX\
-%D $\rightarrow$ \DVI\ $\rightarrow$ \POSTSCRIPT\ $\rightarrow$
-%D \PDF\ one can insert graphics using specials. In \PDFTEX\
-%D however there is only one step! This means that \PDFTEX\
-%D itself has to do the inclusion.
-%D
-%D At the moment \PDFTEX\ supports inclusion of bitmap \PNG\
-%D graphics as well as not too complicated \PDF\ code. Using
-%D this last option, we are able to include both \METAPOST\ and
-%D \PDF\ output produced by \GHOSTSCRIPT.
-%D
-%D We fall back on the generic \CONTEXT\ module supp-pdf to
-%D accomplish \PDF\ inclusion. The methods implemented there
-%D are hooked into both the figure placement mechanisms of
-%D \CONTEXT\ and the specials inclusion mechanism.
-
-\definespecial\doinsertfile
- {\dofileinsertion{tpd}{\truegraphictype\@@DriverImageType}}
-
-%D The number of pages in (for instance an \PDF) insert
-%D file, can be asked for using:
-
-\definespecial\dogetnofinsertpages#1%
- {\xdef\nofinsertpages{1}% global
- \doifvalidpdfimagefileelse{#1}%
- {\pdfximage{#1}\xdef\nofinsertpages{\the\pdflastximagepages}}
- {}}
-
-%D Currently we support \type{pdf} for \PDF\ files, \type{mps}
-%D for \METAPOST\ graphics, \type{png} and \type{jpg} for
-%D bitmap graphics.
-
-\definefileinsertion{tpd}{mps}
- {\hbox
- {\convertMPtoPDF\@@DriverImageFile{1}{1}%
- \global\let\PDFimagereference\empty}}
-
-\definefileinsertion{tpd}{pdf}{\handlepdfimage}
-\definefileinsertion{tpd}{png}{\handlepdfimage}
-\definefileinsertion{tpd}{jpg}{\handlepdfimage}
-\definefileinsertion{tpd}{jb2}{\handlepdfimage}
-
-% \definefileinsertion{tpd}{jpeg} {\handlepdfimage}
-% \definefileinsertion{tpd}{jbig2}{\handlepdfimage}
-
-%D Experimental:
-
-%D The main file insertion macro is as follows. Because
-%D \PDFTEX\ does not support arbitrary suffixes, we double
-%D check on a user supplied filename, because \PDFTEX\ chokes
-%D on unknown suffixes.
-
-\def\doifvalidpdfimagefileelse#1% todo: greedy split
- {\doiffileelse{#1}
- {\edef\filesuffix{#1}%
- \doloop
- {\@EA\aftersplitstring\filesuffix\at.\to\temp
- \ifx\temp\empty
- \exitloop
- \else
- \lowercasestring\temp\to\filesuffix % insertion check also needs lowercase
- % a temporary hack
- \doif\filesuffix{pdf}{\pdfimageresolution72}%
- % because pdfTeX scales back
- \fi}}
- {\let\filesuffix\s!unknown}%
- \doiffileinsertionsupportedelse\filesuffix}
-
-\ifx\pdflastximagepages\undefined \chardef\pdflastximagepages=1 \fi
-
-\def\checkpdfimagepagenumber
- {\edef\pdfimagepagenumber
- {\ifx\@@DriverImagePage\empty\else\ifnum\@@DriverImagePage>\zerocount
- \space page\space\@@DriverImagePage\space
- \fi\fi}}
-
-\ifnum\pdftexversion>13
-
- \def\handlepdfimage
- {\bgroup
- \the\everyPDFximage
- \doifvalidpdfimagefileelse\@@DriverImageFile
- {\checkpdfimagepagenumber
- \ifx\pdfimagepagenumber\empty\@EA\pdfimmediateximage\else\@EA\pdfximage\fi
- \ifdim\@@DriverImageWidth >\zeropoint \!!width \@@DriverImageWidth \fi
- \ifdim\@@DriverImageHeight>\zeropoint \!!height\@@DriverImageHeight\fi
- \pdfimagepagenumber
- \@@DriverImageBox
- {\@@DriverImageFile}
- \xdef\PDFimagereference{\the\pdflastximage}%
- \xdef\nofinsertpages{\the\pdflastximagepages}%
- \pdfrefximage\pdflastximage}
- {\framed[\c!width=\@@DriverImageWidth,\c!height=\@@DriverImageHeight]{\@@DriverImageFile}}%
- \egroup}
-
-\else
-
- \def\handlepdfimage
- {\bgroup
- \doifvalidpdfimagefileelse\@@DriverImageFile
- {\pdfimage
- \ifdim\@@DriverImageWidth >\zeropoint \!!width \@@DriverImageWidth \fi
- \ifdim\@@DriverImageHeight>\zeropoint \!!height \@@DriverImageHeight\fi
- {\@@DriverImageFile}}%
- {\framed[\c!width=\@@DriverImageWidth,\c!height=\@@DriverImageHeight]{\@@DriverImageFile}}%
- \egroup}
-
-\fi
-
-%D As we will see now, \PDFTEX\ not only directly supports
-%D \type{mps}, \type{png}, \type{pdf}, \type{jpg} but also
-%D \type{mov}. In \CONTEXT\ we support movie inserts in a way
-%D similar to figure inclusion. The next macro calls the
-%D general \PDF\ one.
-
-\definefileinsertion{tpd}{mov}{\doPDFinsertmov}
-\definefileinsertion{tpd}{avi}{\doPDFinsertmov}
-
-%D \macros
-%D {doinsertsoundtrack}
-%D
-%D We use numbers instead of labels to keep track of sounds.
-
-\definespecial\doinsertsoundtrack{\doPDFinsertsoundtrack}
-
-%D For the moment we don't test for alternatives that
-%D themselves have alternatives, especially cylcic
-%D dependencies.
-
-% some day we will do a proper check on bitmap depth,
-%
-% \pdfobj reserveobjnum\relax
-% \pdfximage colorspace \pdflastobj {some file}
-% ... \pdflastximagecolordepth ...
-% \immediate\pdfobj useobjnum \pdflastobj {some spec}
-
-\ifx\@@DriverImageBox\undefined \def\@@DriverImageBox{artbox} \fi
-
-\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
- {\doifvalidpdfimagefileelse\@@DriverImageFile
- {\ifvoid\foundexternalfigure
- \donetrue
- \else\ifx\PDFfigurereference\empty
- \donetrue
- \else
- % hm, is this still needed
- \doifinstringelse\filesuffix{\c!png,\c!jpg}\donetrue\donefalse
- \fi\fi}
- {\donefalse}%
- \ifdone
- \the\everyPDFximage
- \checkpdfimageattributes
- \checkpdfimagecolorspecs
- \checkpdfimagepagenumber
- \global\setbox\foundexternalfigure\hbox
- {\ifx\pdfimagepagenumber\empty\@EA\pdfimmediateximage\else\@EA\pdfximage\fi
- \pdfimageattributes
- \pdfimagecolorspecs
- \pdfimagepagenumber
- \@@DriverImageBox
- {\@@DriverImageFile}%
- \xdef\PDFimagereference{\the\pdflastximage}%
- \xdef\nofinsertpages{\the\pdflastximagepages}%
- \pdfrefximage\pdflastximage}%
- \xdef\analyzedfigurewidth {\the\wd\foundexternalfigure}%
- \xdef\analyzedfigureheight{\the\ht\foundexternalfigure}%
- \global\let\PDFfigurereference\empty
- \global\let\PDFimageattributes\empty
- \else
- \global\let\analyzedfigurewidth \!!zeropoint
- \global\let\analyzedfigureheight\!!zeropoint
- \fi}
-
-\else
-
- \def\dogetTPDfiguresize
- {\doifvalidpdfimagefileelse\@@DriverImageFile
- {\global\setbox\foundexternalfigure\vbox{\pdfimage{\@@DriverImageFile}}%
- \xdef\analyzedfigurewidth {\the\wd\foundexternalfigure}%
- \xdef\analyzedfigureheight{\the\ht\foundexternalfigure}}
- {\global\let\analyzedfigurewidth \!!zeropoint
- \global\let\analyzedfigureheight\!!zeropoint}}
-
-\fi
-
-\definefilechecker{tpd}{pdf}{\dogetTPDfiguresize}
-\definefilechecker{tpd}{png}{\dogetTPDfiguresize}
-\definefilechecker{tpd}{jpg}{\dogetTPDfiguresize}
-\definefilechecker{tpd}{jb2}{\dogetTPDfiguresize}
-
-\definespecial\dogetfiguresize
- {\dofilechecker{tpd}{\truegraphictype\@@DriverImageType}}
-
-%D \macros
-%D {doregisterfigure}
-%D
-%D Here is the fuzzy, very special dependant figure
-%D registration special. We need to refer to the innermost
-%D object (ximage).
-
-\ifnum\pdftexversion>13
-
- \definespecial\doregisterfigure#1#2%
- {\doifundefined{IM::#1::#2}
- {\setxvalue{IM::#1::#2}{\the\pdflastximage}}%
- \xdef\PDFfigurereference{\getvalue{IM::#1::#2}}}
-
-\fi
-
-%D \macros
-%D {doovalbox}
-%D
-%D Drawing frames with round corners is inherited from the
-%D main module.
-
-\definespecial\doovalbox {\doPDFovalbox}
-
-%D \macros
-%D {dostartgraymode,dostopgraymode,
-%D dostartrgbcolormode,dostartcmykcolormode,dostartgraycolormode,
-%D dostopcolormode,
-%D dostartrotation,dostoprotation,
-%D dostartscaling,dostopscaling,
-%D dostartmirroring,dostopmirroring,
-%D dostartnegative,dostopnegative,
-%D dostartoverprint,dostopoverprint}
-%D
-%D These are implemented in the main \PDF\ module.
-
-\definespecial\dostartgraymode {\doPDFstartgraymode}
-\definespecial\dostopgraymode {\doPDFstopgraymode}
-\definespecial\dostartrgbcolormode {\doPDFstartrgbcolormode}
-\definespecial\dostartcmykcolormode{\doPDFstartcmykcolormode}
-\definespecial\dostartgraycolormode{\doPDFstartgraycolormode}
-\definespecial\dostartspotcolormode{\doPDFstartspotcolormode}
-\definespecial\dostopcolormode {\doPDFstopcolormode}
-\definespecial\dostartrotation {\doPDFstartrotation}
-\definespecial\dostoprotation {\doPDFstoprotation}
-\definespecial\dostartscaling {\doPDFstartscaling}
-\definespecial\dostopscaling {\doPDFstopscaling}
-\definespecial\dostartmirroring {\doPDFstartmirroring}
-\definespecial\dostopmirroring {\doPDFstopmirroring}
-\definespecial\dostartnegative {\doPDFstartnegative}
-\definespecial\dostopnegative {\doPDFstopnegative}
-\definespecial\dostartoverprint {\doPDFstartoverprint}
-\definespecial\dostopoverprint {\doPDFstopoverprint}
-
-\definespecial\doregistercmykspotcolor{\doPDFregistercmykspotcolor}
-\definespecial\doregisterrgbspotcolor {\doPDFregisterrgbspotcolor}
-\definespecial\doregistergrayspotcolor{\doPDFregistergrayspotcolor}
-
-\definespecial\doregistercmykindexcolor{\doPDFregistercmykindexcolor}
-\definespecial\doregisterrgbindexcolor {\doPDFregisterrgbindexcolor}
-\definespecial\doregistergrayindexcolor{\doPDFregistergrayindexcolor}
-
-\definespecial\doregisterfigurecolor{\doPDFregisterfigurecolor}
-
-\definespecial\dostartnonecolormode{\doPDFstartnonecolormode}
-\definespecial\doregisternonecolor {\doPDFregisternonecolor}
-
-\def\doPDFregisterspotcolorname#1#2% no need for escape in luatex
- {\bgroup
- \let\ascii\empty
- \def\docommand##1%
- {\edef\ascii{\ascii
- \ifx\nexthandledtoken\space
- \letterhash20%
- \else\ifx\nexthandledtoken\blankspace
- \letterhash20%
- \else
- ##1%
- \fi\fi}}%
- \expanded{\handletokens#2}\with\docommand
- \letgvalue{@@pdf@@scn@@#1}\ascii
- \egroup}
-
-\def\doPDFregistersomespotcolor#1#2#3#4#5#6#7% name fractions names p's space domain function
- {\bgroup
- \let\spotpops\empty
- \ifcase#2\or
- %def\PDFspotcolornames{/Separation /#1}%
- \edef\PDFspotcolornames{/Separation /\executeifdefined{@@pdf@@scn@@#1}{#1}}%
- \def\PDFspotcolordomain{0.0 1.0}%
- \else
- \dorecurse{#2}{\edef\spotpops{\spotpops pop }}%
- \let\PDFspotcolornames \empty
- \let\PDFspotcolordomain\empty
- \def\dospotcolorcommand##1%
- {\edef\PDFspotcolornames {\PDFspotcolornames/\executeifdefined{@@pdf@@scn@@##1}{##1}\space}%
- \edef\PDFspotcolordomain{\PDFspotcolordomain 0.0 1.0\space}}%
- \processcommacommand[#3]\dospotcolorcommand
- \edef\PDFspotcolornames{/DeviceN [\PDFspotcolornames]}%
- \fi
- \immediate \pdfobj stream attr
- {/FunctionType 4 /Domain [\PDFspotcolordomain] /Range [#6]}{{\spotpops#7}}%
- \immediate \pdfobj
- {[\PDFspotcolornames\space /Device#5 \PDFobjref\pdflastobj]}%
- \dosetobjectreference{PDFCS}{#1}{\the\pdflastobj}%
- \appendtoPDFdocumentcolorspaces{/#1 \PDFobjref\pdflastobj}%
- \egroup}
-
-%D New and very experimental.
-
-% \def\doPDFregistersomeindexcolor#1#2#3#4#5#6#7% name fractions names p's space domain function
-% {\bgroup
-% \let\spotpops\empty
-% \dorecurse{#2}{\edef\spotpops{\spotpops exch pop\space}}%
-% \let\PDFspotcolornames \empty
-% \let\PDFspotcolordomain\empty
-% \def\docommand##1%
-% {\edef\PDFspotcolornames{\PDFspotcolornames/\executeifdefined{@@pdf@@scn@@##1}{##1}\space}%
-% \edef\PDFspotcolordomain{\PDFspotcolordomain 0.0 1.0\space}}%
-% \processcommacommand[#3,None]\docommand
-% \let\PDFcolorindexvector\empty
-% \def\docommand##1%
-% {\scratchdimen##1\points
-% \scratchdimen\recurselevel\scratchdimen
-% \scratchcounter\scratchdimen
-% \divide\scratchcounter \maxcard
-% \edef\PDFcolorindexvector{\PDFcolorindexvector\uchexnumbers\scratchcounter}}%
-% \dostepwiserecurse\zerocount{255}\plusone
-% {\rawprocesscommacommand[#4,1]\docommand
-% \xdef\PDFcolorindexvector{\PDFcolorindexvector\space}}%
-% \immediate \pdfobj stream attr
-% {/FunctionType 4 /Domain [\PDFspotcolordomain] /Range [#6]}{{\spotpops#7}}%
-% \immediate \pdfobj
-% {[/Indexed
-% [/DeviceN [\PDFspotcolornames] /Device#5 \PDFobjref\pdflastobj] %
-% 255 <\PDFcolorindexvector>]}%
-% \dosetobjectreference{PDFIX}{#1}{\the\pdflastobj}%
-% \appendtoPDFdocumentcolorspaces{/#1_INDEXED \PDFobjref\pdflastobj}%
-% \egroup}
-
-% we reverse the index; an alternative is to negate the graphic itself (\start/stop negative)
-
-\def\doPDFregistersomeindexcolor#1#2#3#4#5#6#7% name fractions names p's space domain function
- {\bgroup
- \let\spotpops\empty
- \dorecurse{#2}{\edef\spotpops{\spotpops exch pop\space}}%
- \let\PDFspotcolornames \empty
- \let\PDFspotcolordomain\empty
- \def\docommand##1%
- {%\edef\PDFspotcolornames {\PDFspotcolornames/##1\space}%
- \edef\PDFspotcolornames{\PDFspotcolornames/\executeifdefined{@@pdf@@scn@@##1}{##1}\space}%
- \edef\PDFspotcolordomain{\PDFspotcolordomain 0.0 1.0\space}}%
- \processcommacommand[#3,None]\docommand
- \let\PDFcolorindexvector\empty
- \def\docommand##1%
- {\scratchdimen##1\points
- \scratchdimen\recurselevel\scratchdimen
- \scratchcounter\scratchdimen
- \divide\scratchcounter \maxcard
- \edef\PDFcolorindexvector{\PDFcolorindexvector\uchexnumbers\scratchcounter}}%
- %\dostepwiserecurse\zerocount{255}\plusone
- \dostepwiserecurse{255}\zerocount\minusone % we need to negate
- {\rawprocesscommacommand[#4,1]\docommand
- \xdef\PDFcolorindexvector{\PDFcolorindexvector\space}}%
- \immediate \pdfobj stream attr
- {/FunctionType 4 /Domain [\PDFspotcolordomain] /Range [#6]}{{\spotpops#7}}%
- \immediate \pdfobj
- {[/Indexed
- [/DeviceN [\PDFspotcolornames] /Device#5 \the\pdflastobj\space0 R] %
- 255 <\PDFcolorindexvector>]}%
- \dosetobjectreference{PDFIX}{#1}{\the\pdflastobj}%
- \appendtoPDFdocumentcolorspaces{/#1_INDEXED \the\pdflastobj\space0 R}%
- \egroup}
-
-%D \macros
-%D {dostarttransparency,dostoptransparency}
-%D
-%D For transparency, we need to implement a couple of
-%D auxiliary macros. If needed, we will generalize them later.
-
-\definespecial\dostarttransparency{\doPDFstarttransparency}
-\definespecial\dostoptransparency {\doPDFstoptransparency}
-
-\PDFtransparencysupportedtrue
-
-\def\@@PDT{@PDT@}
-
-\ifx\PDFcurrenttransparency\undefined
- \newcount\PDFcurrenttransparency \PDFcurrenttransparency=0 % -1
-\fi
-
-\def\assignPDFtransparency#1#2%
- {\edef\PDFtransparencyidentifier{/Tr#1}%
- \edef\PDFtransparencyreference{\PDFobjref{#2}}}
-
-\def\presetPDFtransparency#1#2%
- {\initializePDFtransparency
- \executeifdefined{\@@PDT#1:#2}{\dopresetPDFtransparency{#1}{#2}}}
-
-\def\dopresetPDFtransparency#1#2%
- {\global\advance\PDFcurrenttransparency \plusone
- \immediate\pdfobj{\PDFtransparancydictionary{#1}{#2}{}}%
- \edef\PDFtransparencyidentifier{/Tr\the\PDFcurrenttransparency}%
- \edef\PDFtransparencyreference {\PDFobjref\pdflastobj}%
- \setxvalue{\@@PDT#1:#2}%
- {\noexpand\assignPDFtransparency{\the\PDFcurrenttransparency}{\the\pdflastobj}}%
- \appendtoPDFdocumentextgstates
- {\PDFtransparencyidentifier\space
- \PDFtransparencyreference\space}}
-
-\def\initializePDFtransparency
- {\immediate\pdfobj{\PDFtransparancydictionary{1}{1}{/AIS false}}%
- \xdef\PDFtransparencyresetidentifier{/Tr0}%
- \xdef\PDFtransparencyresetreference{\PDFobjref\pdflastobj}%
- \setxvalue{\@@PDT0:0}%
- {\noexpand\assignPDFtransparency{0}{\the\pdflastobj}}%
- \appendtoPDFdocumentextgstates
- {\PDFtransparencyresetidentifier\space
- \PDFtransparencyresetreference\space}%
- \global\let\initializePDFtransparency\relax}
-
-%D \macros
-%D {dostartclipping,dostopclipping}
-%D
-%D Clipping in \PDFTEX\ is rather trivial. We can even hook
-%D in \METAPOST\ without problems.
-
-\definespecial\dostartclipping#1#2#3%
- {\PointsToBigPoints{#2}\width
- \PointsToBigPoints{#3}\height
- \grabMPclippath{#1}{1}\width\height
- {0 0 m \width\space 0 l \width \height l 0 \height l}%
- \pdfliteral % PDFcode ?
- {q 0 w \MPclippath\space W n}}
-
-\definespecial\dostopclipping
- {\pdfliteral{Q n}} % PDFcode
-
-%D \macros
-%D {dosetupinteraction}
-%D
-%D Nothing special is needed to enable \PDF\ commands and
-%D interaction. We stick with a message.
-
-\definespecial\dosetupinteraction
- {\showmessage\m!interactions{21}{pdftex}}
-
-%D \macros
-%D {doresetgotowhereever,
-%D dostartthisisrealpage,dostartthisislocation,
-%D dostartgotorealpage,dostartgotolocation,dostartgotoJS}
-%D
-%D The interactions macros are the core of this module. We
-%D support both page destinations and named ones. We don't
-%D need the \type{\stop}||alternatives. We also don't need
-%D to set the special that sets the real page number.
-
-\definespecial\doresetgotowhereever {\doPDFresetgotowhereever}
-\definespecial\dostartthisislocation{\doPDFstartthisislocation}
-
-%D When going to a location, we obey the time and space saving
-%D boolean \type{\ifusepagedestination}. Named destinations are
-%D stripped and made robust. This all happens in the macros
-%D called for.
-
-\definespecial\dostartgotolocation{\doPDFstartgotolocation}
-\definespecial\dostartgotorealpage{\doPDFstartgotorealpage}
-\definespecial\dostartgotoJS {\doPDFstartgotoJS}
-
-\let\PDFpagexyzspec\empty % pdftex does not accept spec
-
-%D \macros
-%D {doflushJSpreamble}
-%D
-%D It does not make sense to duplicate common \JAVASCRIPT\
-%D functions, and therefore they can be predefined and must be
-%D output separately. Currently this special is not shared
-%D with the \ACROBAT\ one, simply because \DISTILLER\ does not
-%D yet support something \type{\pdfnames}.
-
-% \oneJSpreamblefalse % buggy in acrobat
-
-\definespecial\doflushJSpreamble#1%
- {\bgroup
- \let\compositeJScode\empty
- \def\docommand##1%
- {\edef\sanitizedJScode{\getJSpreamble{##1}}%
- \@EA\doPSsanitizeJScode\sanitizedJScode\to\sanitizedJScode
- \immediate\pdfobj {<< /S /JavaScript /JS (\sanitizedJScode) >>}%
- \edef\compositeJScode
- {\compositeJScode\space (##1) \PDFobjref\pdflastobj}}%
- \processcommalist[#1]\docommand
- \immediate\pdfobj{<< /Names [ \compositeJScode ] >>}%
- \pdfnames{/JavaScript \PDFobjref\pdflastobj}%
- \egroup}
-
-%D \macros
-%D {dostarthide,dostophide}
-%D
-%D Hiding parts of the document for printing is not yet
-%D supported by \PDF\ and therefore \PDFTEX.
-
-\definespecial\dostarthide{}
-\definespecial\dostophide {}
-
-%D \macros
-%D {dosetupscreen}
-%D
-%D Setting of the screen boundingbox involves some
-%D calculations. Here we also take care of (non) full screen
-%D startup. The dimensions are rounded. Because \PDFTEX\ and
-%D \ACROBAT\ handle setting the page dimensions in a
-%D different way, we do not share this special.
-
-\definespecial\dosetupscreen {\doPDFsetupscreen \pdfpageheight}
-
-\definespecial\dosetupartbox {\doPDFsetupartbox \pdfpageheight}
-\definespecial\dosetupcropbox {\doPDFsetupcropbox \pdfpageheight}
-\definespecial\dosetupbleedbox{\doPDFsetupbleedbox\pdfpageheight}
-\definespecial\dosetuptrimbox {\doPDFsetuptrimbox \pdfpageheight}
-
-%D \macros
-%D {dostartexecutecommand}
-%D
-%D \PDF\ viewers enable us to navigate using menus and shortcut
-%D keys. These navigational tools can also be accessed by using
-%D annotations. The next special takes care of inserting them.
-
-\definespecial\dostartexecutecommand{\doPDFstartexecutecommand}
-
-%D \macros
-%D {dosetupidentity}
-%D
-%D Documents can be tagged with an application accessible title
-%D and subtitle, the authorname, a date, the creator, keywords
-%D etc. For the moment \PDFTEX\ only supports the first three
-%D of these.
-
-\definespecial\dosetupidentity{\doPDFsetupidentity}
-
-%D \macros
-%D {dostartrunprogam}
-%D
-%D We can run a program form within a document, although this
-%D feature is rather weak, due to path problems and buggy
-%D argument passing.
-
-\definespecial\dostartrunprogram{\doPDFstartrunprogram}
-
-%D \macros
-%D {dostartgotoprofile, dostopgotoprofile,
-%D dobeginofprofile, doendofprofile}
-%D
-%D \CONTEXT\ user profiles and version control fall back on
-%D \PDF\ article threads. Unfortunately one cannot influence
-%D the view yet in an (for me) acceptable way.
-
-\definespecial\dostartgotoprofile{\doPDFstartgotoprofile}
-
-%D Some day, I'll reimplement threading in a useful way.
-%D Currently the viewers handle threads rather diffuse.
-
-\ifnum\pdftexversion>13
-
-\definespecial\dobeginofprofile#1#2#3#4%
- {\setPDFdestination{#1}%
- \doifsomething\PDFdestination
- {\pdfthread
- width #2 height #3
- attr {/Title (\PDFdestination)} % can be omitted
- name {\PDFdestination}}}
-
-\definespecial\doendofprofile%
- {}
-
-\fi
-
-%D \macros
-%D {doinsertbookmark}
-%D
-%D In \PDF\ bookmarks are the building blocks of a viewer
-%D provided sort of table of contents. \TEX\ has to provide
-%D the entry as well as the number of child entries. Strings
-%D need to be sanatized as good as possible to suit the default
-%D encoding. In \CONTEXT\ users can overrule this string by
-%D supplying an alternative one. Look at the macro called for
-%D to see how funny these bookmarks are defined.
-
-\definespecial\doinsertbookmark{\doPDFinsertbookmark}
-
-%D \macros
-%D {dostartobject,dostopobject,doinsertobject}
-%D
-%D Due to \PDF's object oriented character, we can include and
-%D reuse objects. These can be compared with \TEX's boxes. The
-%D \TEX\ counterpart is defined in the module \type{spec-dvi}.
-%D We don't use the dimensions here.
-%D
-%D The next solution is not that beautiful. Because objects are
-%D containers for whatever kind of content, graphics can be
-%D part of this content, and a graphic object can be part of
-%D the more general type. In practice this means that an ximage
-%D would be embedded in an xform, which in itself is not that
-%D big a problem, apart from a few bytes overhead. However, for
-%D reasons unknown to me alternative images must be pure
-%D ximages |<|indeed, somehow one cannot use a vector graphic
-%D as alternative|>| that are not embedded into forms, so this
-%D is why the object handler treats them different. This
-%D implies knowledge of the calling routines, especially the
-%D \type{FIG} trigger, that signals that we just embedded an
-%D image. Alternatively I could have introduced a dual object
-%D system, but the overhead in duplicate specials is currently
-%D not what we want. I'd rather implement a more mature
-%D object support system from scratch.
-
-\let\currentPDFresources\empty
-\let\PDFimageattributes \empty
-\let\PDFfigurereference \empty
-\let\PDFimagereference \empty
-
-\ifnum\pdftexversion>13
-
- \definespecial\dostartobject#1#2#3#4#5%
- {\bgroup
- \setbox\nextbox\vbox\bgroup
- \def\dodostopobject
- {\egroup
- \ifx\PDFimagereference\empty
- % We also flush page resources, since shared
- % resources end up there; otherwise transparencies
- % won't work in xforms; some day I will optimize
- % this.
- \the\everyPDFxform
- \finalizeobjectbox\nextbox
- \immediate\pdfxform
- resources {\currentPDFresources\the\pdfpageresources}%
- \nextbox
- \global\let\currentPDFresources\empty
- \dosetobjectreference{#1}{#2}{\the\pdflastxform}%
- \else
- \dosetobjectreference{#1}{#2}{-\PDFimagereference}%
- \global\let\PDFimagereference\empty
- \fi}}
-
- \definespecial\dostopobject
- {\dodostopobject
- \egroup}
-
- \definespecial\doresetobjects
- {\global\let\PDFimagereference\empty}
-
- \definespecial\doinsertobject#1#2%
- {\bgroup
- \doifobjectreferencefoundelse{#1}{#2}
- {\dogetobjectreference{#1}{#2}\PDFobjectreference
- \ifnum\PDFobjectreference<0
- \@EA\@EA\@EA\pdfrefximage\@EA\gobbleoneargument\PDFobjectreference
- \else
- \pdfrefxform\PDFobjectreference
- \fi}%
- {}%
- \egroup}
-
-\else
-
- \definespecial\dostartobject#1#2#3#4#5%
- {\bgroup
- \setbox\nextbox\vbox\bgroup
- \def\dodostopobject
- {\egroup
- \the\everyPDFxform
- \pdfform\nextbox
- \dosetobjectreference{#1}{#2}{\the\pdflastform}}}
-
- \definespecial\dostopobject
- {\dodostopobject
- \egroup}
-
- \definespecial\doinsertobject#1#2%
- {\bgroup
- \dogetobjectreference{#1}{#2}\PDFobjectreference
- \pdfrefform\PDFobjectreference
- \egroup}
-
-\fi
-
-\appendtoksonce
- \collectPDFresources
- \global\let\currentPDFresources\collectedPDFresources
-\to \everyPDFxform
-
-%D \macros
-%D {dosetpagetransition}
-%D
-%D Page transitions only make sence in presentations. They are
-%D passed as raw \PDF\ code to the page object. Take a look
-%D at the implementation to get an impression of the rubish
-%D passed on.
-
-\definespecial\dosetpagetransition{\doPDFsetpagetransition}
-
-%D The expansion is needed because else the \type{\pdfpageattr}
-%D token list flushes an unexpanded \type{\csname}. The
-%D \type{\global} is needed because the assignment can take
-%D place deeply buried (for instance in the \type{\shipout}
-%D box.
-
-%D \macros
-%D {doinsertcomment, doflushcomments}
-%D
-%D Text annotation, or comments, are provided too:
-
-\definespecial\doinsertcomment{\doPDFinsertcomment}
-\definespecial\doflushcomments{\doPDFflushcomments}
-
-%D \macros
-%D {dopresetlinefield,dopresettextfield,
-%D dopresetchoicefield,dopresetpopupfield,dopresetcombofield,
-%D dopresetpushfield,dopresetcheckfield,
-%D dopresetradiofield,dopresetradiorecord}
-%D
-%D \PDF\ offers extensive field support. The next bunch of
-%D definitions map the specials.
-
-\definespecial\dopresetlinefield {\doFDFpresetlinefield}
-\definespecial\dopresettextfield {\doFDFpresettextfield}
-\definespecial\dopresetchoicefield{\doFDFpresetchoicefield}
-\definespecial\dopresetpopupfield {\doFDFpresetpopupfield}
-\definespecial\dopresetcombofield {\doFDFpresetcombofield}
-\definespecial\dopresetpushfield {\doFDFpresetpushfield}
-\definespecial\dopresetcheckfield {\doFDFpresetcheckfield}
-\definespecial\dopresetradiofield {\doFDFpresetradiofield}
-\definespecial\dopresetradiorecord{\doFDFpresetradiorecord}
-
-%D \macros
-%D {dodefinefieldset,dogetfieldset,doiffieldset}
-%D
-%D Field sets, needed for reset and submit handling, are
-%D taken care of by:
-
-\definespecial\dodefinefieldset{\doFDFdefinefieldset}
-\definespecial\dogetfieldset {\doFDFgetfieldset}
-\definespecial\doiffieldset {\doFDFiffieldset}
-
-%D \macros
-%D {doregistercalculationset}
-%D
-%D The calculation order is defined using:
-
-\definespecial\doregistercalculationset{\doFDFregistercalculationset}
-
-%D \macros
-%D {doPDFdestination}
-%D
-%D Finally we implement some low level macros to deal with
-%D flushing \PDF\ code. First we handle the named destinations.
-
-\def\doPDFdestination#1%
- {\pdfdest name {#1}\PDFpageviewkey}
-
-%D \macros
-%D {doPDFaction,doPDFannotation,ifsharePDFactions}
-%D
-%D Next we handle annotations. All link annotations are
-%D implemented using the action dictionary. This enables us to
-%D use multiple actions. The second macro is for instance
-%D used for movie inclusion.
-
-\newif\ifsharePDFactions \sharePDFactionstrue
-
-% hm, due to some stupid optimization this feature has been
-% disabled for some time, watch out \lastPDFaction is to be
-% persistent
-
-\ifnum\pdftexversion>13
-
- \def\doPDFaction#1#2#3%
- {\xdef\lastPDFcontent{#3}%
- \ifcollectreferenceactions
- \global\let\lastPDFaction\lastPDFcontent
- \else
- \ifsharePDFactions
- \ifcase\similarreference\relax
- \xdef\lastPDFaction{<<\lastPDFcontent>>}%
- \or
- \immediate\pdfobj{<<\lastPDFcontent>>}%
- \xdef\lastPDFaction{\PDFobjref\pdflastobj}%
- \else
- % leave \lastPDFaction untouched
- \fi
- \else
- \xdef\lastPDFaction{<<\lastPDFcontent>>}%
- \fi
- \pdfannot
- width #1 height #2 depth \zeropoint
- {/Subtype /Link
- /Border [0 0 0]
- \ifhighlighthyperlinks \else /H /N \fi
- /A \lastPDFaction}%
- \fi}
-
-\else
-
- \def\doPDFaction#1#2#3%
- {\ifcollectreferenceactions
- \xdef\lastPDFaction{#3}%
- \else
- \ifsharePDFactions
- \ifcase\similarreference\relax
- \xdef\lastPDFaction{<<#3>>}%
- \or
- \immediate\pdfobj{<<#3>>}%
- \xdef\lastPDFaction{\PDFobjref\pdflastobj}%
- \else
- % leave \lastPDFaction untouched
- \fi
- \else
- \xdef\lastPDFaction{<<#3>>}%
- \fi
- \pdfannotlink % could be \pdfannot if not the - problem was there
- width #1 height #2 depth \zeropoint
- user {/Subtype /Link
- /Border [0 0 0]
- \ifhighlighthyperlinks \else /H /N \fi
- /A \lastPDFaction}%
- \pdfendlink
- \fi}
-
-\fi
-
-% pdftex and viewers give problems with this one (printing forms)
-%
-%\def\doPDFannotation#1#2#3%
-% {\pdfannot width #1sp height -#2sp depth \zeropoint{#3}}
-%
-% This is corrected in version 14. When this version is wide
-% spread, this will be cleaned up.
-
-\ifnum\pdftexversion>13
-
- \def\doPDFannotation#1#2#3%
- {\pdfannot width #1 height #2 depth \zeropoint{#3}}
-
-\else
-
- \def\doPDFannotation#1#2#3%
- {\hbox{\raise#2\hbox{\pdfannot width #1 height #2 depth \zeropoint{#3}}}}
-
-\fi
-
-%D \macros
-%D {doPDFannotationobject,doPDFactionobject}
-%D
-%D For field support we need annotation objects. Although in
-%D many cases we can do without indirect references (and use
-%D the last annotation object number directly), we take the
-%D save route.
-
-\def\doPDFannotationobject#1#2#3#4#5%
- {\doPDFannotation{#3}{#4}{#5}%
- \dosetobjectreference{#1}{#2}{\the\pdflastannot}}
-
-\def\doPDFactionobject#1#2#3#4#5%
- {\doPDFaction{#3}{#4}{#5}%
- \dosetobjectreference{#1}{#2}{\the\pdflastannot}}
-
-%D \macros
-%D {doPDFaddtocatalog,doPDFaddtoinfo,
-%D doPDFpageattribute,doPDFpagesattribute}
-%D
-%D Next some simple ones. Watch the global directive and the
-%D expansion in the page attribute macro.
-
-\def\doPDFaddtocatalog
- {\pdfcatalog}
-
-\def\doPDFaddtoinfo
- {\pdfinfo}
-
-\def\doPDFpageattribute#1%
- {\expanded{\global\pdfpageattr{#1\the\pdfpageattr}}}
-
-\def\doPDFpageresource#1%
- {\expanded{\global\pdfpageresources{#1\the\pdfpageresources}}}
-
-\def\doPDFpagesattribute#1%
- {\expanded{\global\pdfpagesattr{#1\the\pdfpagesattr}}}
-
-\def\doPDFresetpageattributes
- {\global\pdfpageattr\emptytoks}
-
-\def\doPDFresetpageresources
- {\global\pdfpageresources\emptytoks}
-
-%D \macros
-%D {doPDFbookmark}
-%D
-%D Well, isn't the next one ugly? Thanks to the \PDF\
-%D standard.
-
-\def\doPDFbookmark#1#2#3#4#5%
- {\doPDFgetpagereference{#4}\PDFobjectreference
- \pdfoutline
- user {<</S /GoTo /D [\PDFobjectreference\space\PDFpageviewwrd]>>}%
- \ifcase#2 \else count \ifcase#5-\fi#2 \fi
- {\ifPDFunicode<#3>\else#3\fi}}
-
-%D \macros
-%D {doPDFdictionaryobject,doPDFarrayobject}
-%D
-%D Where \PDFTEX\ has only one object primitive, optionally a
-%D stream one, \ACROBAT\ has several operators.
-
-\def\doPDFdictionaryobject#1#2#3%
- {\flushatshipout
- {\immediate\pdfobj{<< #3 >>}%
- \dosetobjectreference{#1}{#2}{\the\pdflastobj}}}
-
-\def\doPDFarrayobject#1#2#3%
- {\flushatshipout
- {\immediate\pdfobj{[ #3 ]}%
- \dosetobjectreference{#1}{#2}{\the\pdflastobj}}}
-
-% tricky .. too many xforms now
-%
-% \def\doreservePDFobject#1#2%
-% {\pdfobj reserveobjnum{}%
-% \driverreferenced\dosetobjectreference{#1}{#2}{\the\pdflastobj}}
-%
-% \def\doPDFreserveddictionaryobject#1#2#3%
-% {\doPDFgetobjectnumber{#1}{#2}\PDFobjectnumber
-% \immediate\pdfobj useobjnum \PDFobjectnumber {<< #3 >>}}
-%
-% \def\doPDFreservedarrayobject#1#2#3%
-% {\doPDFgetobjectnumber{#1}{#2}\PDFobjectnumber
-% \immediate\pdfobj useobjnum \PDFobjectnumber {[ #3 ]}}
-
-% \doreservePDFobject{FDF}{docuextgstates}
-% \doreservePDFobject{FDF}{colorspaces}
-% \doreservePDFobject{FDF}{docushades}
-
-%D \macros
-%D {defaultobjectreference,doPDFgetobjectreference}
-%D
-%D Because in \PDFTEX\ we have to construct the object
-%D references \type{N 0 R}, we can default to the non existing
-%D zero object number.
-
-\def\defaultobjectreference#1#2%
- {0}
-
-\def\doPDFgetobjectreference#1#2#3%
- {\dogetobjectreference{#1}{#2}#3%
- \edef#3{\ifx#3\empty null\else\PDFobjref{#3}\fi}}
-
-\def\doPDFgetobjectnumber#1#2#3%
- {\dogetobjectreference{#1}{#2}#3%
- \edef#3{\ifx#3\empty 0\else#3\fi}}
-
-% \def\doPDFgetobjectpage #1#2#3{..}
-% \def\doPDFgetobjectpagereference#1#2#3{..}
-
-\ifx\pdfpageref\undefined
-
- \def\doPDFgetpagereference % number macro
- {\installprogram{texutil --filter \jobname}%
- \gdef\doPDFgetpagereference##1{\doPDFgetobjectreference{PDFP}{\number##1}}% {##2}
- \doPDFgetpagereference}
-
-\else
-
- \def\doPDFgetpagereference#1#2% number macro
- {\edef#2{\ifnum#1>\zerocount\PDFobjref{\pdfpageref#1}\else null\fi}}
-
-\fi
-
-%D \macros
-%D {initializePDFnegative,initializePDFoverprint}
-%D
-%D Here follow some rather obscure macros. They will only
-%D come into action when one wants negated output.
-
-%D Todo: move code to fdf module
-
-\def\initializePDFnegative
- {\immediate\pdfobj stream attr {/FunctionType 4 /Range [0 1] /Domain [0 1]} {{1 exch sub}}%
- \immediate\pdfobj{<</Type /ExtGState /TR \PDFobjref\pdflastobj>>}%
- \appendtoPDFdocumentextgstates{/GSnegative \PDFobjref\pdflastobj}%
- \immediate\pdfobj{<</Type /ExtGState /TR /Identity>>}%
- \appendtoPDFdocumentextgstates{/GSpositive \PDFobjref\pdflastobj}%
- \global\let\initializePDFnegative\relax}
-
-\def\initializePDFoverprint
- {\immediate\pdfobj{<</Type /ExtGState /OP false /OPM 0>>}% /op defaults to /OP
- \appendtoPDFdocumentextgstates{/GSknockout \PDFobjref\pdflastobj}%
- \immediate\pdfobj{<</Type /ExtGState /OP true /OPM 1>>}% /op defaults to /OP
- \edef\PDFobjectreferenceB{\the\pdflastobj}%
- \appendtoPDFdocumentextgstates{/GSoverprint \PDFobjref\pdflastobj}%
- \global\let\initializePDFoverprint\relax}
-
-%D File embedding. Storing the stream identifier is needed
-%D to get access to the number. When typeset, the user can
-%D feed this number to \type {pdftosrc} and filter the
-%D file from the \PDF\ file.
-
-\let\PDFlaststreamobject \s!unknown
-%def\PDFlaststreamreference{0 0 R}
-
-\def\doPDFfilestreamobject#1#2#3#4%
- {\immediate\pdfobj stream file{#4}%
- \edef\PDFlaststreamobject{\the\pdflastobj}%
- \dosetobjectreference{PDFFS}{#2}{\PDFlaststreamobject}%
- \doPDFdictionaryobject{#1}{#2}{/Type /Filespec /F (#3) /EF <</F \PDFobjref\PDFlaststreamobject>>}}
-
-\def\doPDFgetfilestreamreference#1#2%
- {\doPDFgetobjectreference{PDFFS}{#1}#2}
-
-\def\doPDFfilestreamidentifier#1%
- {\doifsomething{#1}
- {\doPDFgetfilestreamreference{#1}\PDFobjectreference
- \@EA\beforesplitstring\PDFobjectreference\at{ }\to\PDFlaststreamobject
- \PDFlaststreamobject}}
-
-% %D We can set \METAPOST\ prologues to~1:
-
-\def\MPprologues{1}
-
-%D Experimental:
-
-\definespecial\dostartfonteffect{\doPDFstartfonteffect}
-\definespecial\dostopfonteffect {\doPDFstopfonteffect}
-
-%D Some MP stuff:
-
-\let\handleMPfshow\dohandleMPfshow % default anyway
-
-\ifnum\pdftexversion<14
-
- \def\setMPPDFobject#1#2% resources boxnumber
- {\def\getMPPDFobject{\box#2}}
-
-\else
-
- \def\setMPPDFobject#1#2% resources boxnumber
- {\the\everyPDFxform
- \finalizeobjectbox{#2}%
- \immediate\pdfxform resources{#1}#2%
- \edef\getMPPDFobject{\noexpand\pdfrefxform\the\pdflastxform}}
-
-\fi
-
-\let\getMPPDFobject\relax
-
-\definespecial\doinsertMPfile#1%
- {\doiffileelse{./#1}{\includeMPasPDF{./#1}}{\message{[MP #1]}}}
-
-%D Now we can finish this module.
-
-\stopspecials
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/spec-tr.mkii b/Master/texmf-dist/tex/context/base/mkii/spec-tr.mkii
deleted file mode 100644
index 19ddb7495a3..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/spec-tr.mkii
+++ /dev/null
@@ -1,107 +0,0 @@
-%D \module
-%D [ file=spec-tr,
-%D version=1996.01.25,
-%D title=\CONTEXT\ Special Macros,
-%D subtitle=Thomas Rokicki's \DVIPS,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Especially the rotation proved to be incompatible with
-%D the default \POSTSCRIPT\ special driver. Many thanks to
-%D Gilbert van den Dobbelsteen for testing and hacking the
-%D \DVIPS\ source and pinpointing the problem.
-
-%D \macros
-%D {doinsertfile}
-%D
-%D We overrule the figure||insertion special. Things should
-%D be more accurate, but maybe someday \unknown
-
-\startspecials[rokicki]
-
-\def\@@insertpostscriptliteral {ps: }
-\def\@@insertpostscriptretain {" }
-
-%D Ugly but useful:
-
-\definefileinsertion{tr}{eps}
- {\bgroup
- \PointsToWholeBigPoints\@@DriverImageWidth \width
- \PointsToWholeBigPoints\@@DriverImageHeight\height
- \special
- {PSfile="\@@DriverImageFile"\space
- llx=\EPSllx\space
- lly=\EPSlly\space
- urx=\EPSurx\space
- ury=\EPSury\space
- \ifdim\@@DriverImageWidth >\zeropoint rwi=\width 0\space\fi
- \ifdim\@@DriverImageHeight>\zeropoint rhi=\height0 \fi}%
- \egroup}
-
-\definefileinsertion{tr}{mps}
- {\hbox
- {\convertMPcolors\@@DriverImageFile
- \dofileinsertion{tr}{eps}}}
-
-\definespecial\doinsertfile
- {\dofileinsertion{tr}\@@DriverImageType}
-
-%D Some MP stuff:
-
-\definespecial\doinsertMPfile#1%
- {\doiffileelse{./#1}{\includeMPasEPS{./#1}}{\message{[MP #1]}}}
-
-%D \macros
-%D {dostartrotation}
-%D
-%D Because \DVIPS\ uses a reverse rotation scheme, we have
-%D to add an extra \type{neg} to the default \POSTSCRIPT\
-%D rotation definition:
-
-\definespecial\dostartrotation#1% straight from the YandY manual / 1st neg added
- {\special
- {\@@insertpostscriptliteral
- gsave currentpoint currentpoint translate
- \number#1\space\space neg rotate neg exch neg exch translate}}
-
-\definespecial\dostoprotation
- {\special
- {\@@insertpostscriptliteral
- currentfont currentpoint grestore moveto setfont}}
-
-%D Drawing ovals in \DVIPS\ is complicated by the fact that
-%D the colors get reset. Therefore we need a more literal
-%D approach and therefore scale to local units. By redefining
-%D the retain constant into a macro, we can use the already
-%D present \POSTSCRIPT\ definition (see \type{spec-ps}).
-
-\definespecial\doovalbox#1#2#3#4#5#6#7#8% variant not yet supported
- {\bgroup
- \edef\@@insertpostscriptretain gsave%
- {\@@insertpostscriptliteral
- gsave
- Resolution 72 div
- VResolution 72 div neg scale currentpoint translate}%
- \dosomeovalbox{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}%
- \egroup}
-
-%D \macros
-%D {dosetuppaper}
-%D
-%D Relatively new:
-
-\definespecial\dosetuppaper#1#2#3%
- {\begingroup
- \!!dimena#2%
- \!!dimenb#3%
- \special{papersize=\the\!!dimena,\the\!!dimenb}%
- \endgroup}
-
-\stopspecials
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/spec-tst.mkii b/Master/texmf-dist/tex/context/base/mkii/spec-tst.mkii
deleted file mode 100644
index 4f580e7b403..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/spec-tst.mkii
+++ /dev/null
@@ -1,48 +0,0 @@
-%D \module
-%D [ file=spec-tst,
-%D version=2002.12.08,
-%D title=\CONTEXT\ \PDF\ Macros,
-%D subtitle=Special Test Macro,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 code is now merged into spec-*.mkii
-
-\doifnotmode{demo}{\endinput}
-
-\mainlanguage[vn]
-\enableregime[utf]
-\usetypescript[all][computer-modern][t5]
-
-\setupinteraction
- [state=start,
- title={Thử tiếng Việt},
- author={Tác Văn Giả},
- keyword={Thử tiếng Việt}]
-
-\placebookmarks[chapter,section,subsection]
-
-\starttext
-
-\placelist[chapter,section,subsection][alternative=c]
-
-\chapter{Thử tiếng Việt}
-
-\section {Mục thứ nhất}
-\subsection{Mục nhỠthứ nhất} Thử tiếng Việt
-\subsection{Mục nhỠthứ hai} Thử tiếng Việt
-
-\section {Mục thứ hai}
-\subsection{Mục nhỠthứ nhất} Thử tiếng Việt
-\subsection{Mục nhỠthứ hai} Thử tiếng Việt
-
-\section {Mục thứ ba}
-\subsection{Mục nhỠthứ nhất} Thử tiếng Việt
-\subsection{Mục nhỠthứ hai} Thử tiếng Việt
-
-\stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkii/spec-var.mkii b/Master/texmf-dist/tex/context/base/mkii/spec-var.mkii
deleted file mode 100644
index 3641ba9599e..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/spec-var.mkii
+++ /dev/null
@@ -1,83 +0,0 @@
-%D \module
-%D [ file=spec-var,
-%D version=2003.10.10,
-%D title=\CONTEXT\ Special Macros,
-%D subtitle=Variables,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 module used to be integrated in \type {spec-ini},
-%D but testing optimization is more convenient this way.
-
-\writestatus{loading}{ConTeXt Special Macros / Variables}
-
-% new approach, 'global' variables, since we run out of
-% arguments
-
-\unprotect
-
-% This variable holds a comma separated list of (supported) figure
-% types. It may be changes by other modules.
-
-\let\figuretypes\empty
-
-\ifx\undefined\@@DriverFieldName
-
- \letempty \@@DriverFieldName
- \letempty \@@DriverFieldWidth
- \letempty \@@DriverFieldHeight
- \letempty \@@DriverFieldDefault
- \letempty \@@DriverFieldNumber
- \letempty \@@DriverFieldNumber
- \letempty \@@DriverFieldStyle
- \letempty \@@DriverFieldColor
- \letempty \@@DriverFieldBackgroundColor
- \letempty \@@DriverFieldFrameColor
- \letempty \@@DriverFieldLayer
- \letempty \@@DriverFieldOption
- \letempty \@@DriverFieldAlign
- \letempty \@@DriverFieldClickIn
- \letempty \@@DriverFieldClickOut
- \letempty \@@DriverFieldRegionIn
- \letempty \@@DriverFieldRegionOut
- \letempty \@@DriverFieldAfterKey
- \letempty \@@DriverFieldFormat
- \letempty \@@DriverFieldValidate
- \letempty \@@DriverFieldCalculate
- \letempty \@@DriverFieldFocusIn
- \letempty \@@DriverFieldFocusOut
-
-\fi
-
-\ifx\undefined\@@DriverCommentLayer
-
- \letempty \@@DriverCommentLayer
-
-\fi
-
-\ifx\undefined\@@DriverAttachmentLayer
-
- \letempty \@@DriverAttachmentLayer
-
-\fi
-
-\ifx\undefined\@@DriverImageBox
-
- \letempty \@@DriverImageBox
- \letempty \@@DriverImageOptions
- \letempty \@@DriverImageWidth
- \letempty \@@DriverImageHeight
- \letempty \@@DriverImageFile
- \letempty \@@DriverImageLabel
- \letempty \@@DriverImageType
- \letempty \@@DriverImageMethod
- \letempty \@@DriverImagePage
-
-\fi
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/spec-win.mkii b/Master/texmf-dist/tex/context/base/mkii/spec-win.mkii
deleted file mode 100644
index e16984a56e6..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/spec-win.mkii
+++ /dev/null
@@ -1,97 +0,0 @@
-%D \module
-%D [ file=spec-win,
-%D version=1996.01.25,
-%D title=\CONTEXT\ Special Macros,
-%D subtitle=\YandY's \DVIWINDO,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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: chained references are not yet implemented.
-
-%D \macros
-%D {dosetupinteraction,
-%D dostartthisislocation,
-%D dostartthisisrealpage,
-%D dostartgotolocation,
-%D dostartgotorealpage,
-%D dostartrunprogram,
-%D usepagedestinations}
-%D {}
-%D
-%D As told before, these were the first interactive specials.
-%D In those days, these kind of specials were still elegant
-%D and straightforward.
-
-\startspecials[dviwindo]
-
-\definespecial\dosetupinteraction%
- {\showmessage\m!interactions{21}{dviwindo}}
-
-\definespecial\dostartgotolocation#1#2#3#4#5#6%
- {\bgroup
- \doifelsenothing{#3}
- {\doifelsenothing{#4}
- {\!!doneafalse}
- {\doifparentfileelse{#4}
- {\!!doneafalse}
- {\!!doneatrue}}%
- \setreferencefilename#4\to\DVIfile
- \scratchdimen#1\edef\width {\the\scratchdimen\space}%
- \scratchdimen#2\edef\height{\the\scratchdimen\space}%
- \special
- {button:
- \width \height
- \if!!donea
- file: \DVIfile,
- \fi
- "#5"}}
- {}% nog uri afhandelen
- \egroup}
-
-\definespecial\dostartgotorealpage#1#2#3#4#5%
- {\bgroup
- \doifelsenothing{#3}
- {\doifelsenothing{#4}
- {\!!doneafalse}
- {\doifparentfileelse{#4}
- {\!!doneafalse}
- {\!!doneatrue}}%
- \setreferencefilename#4\to\DVIfile
- \scratchdimen#1\edef\width {\the\scratchdimen\space}%
- \scratchdimen#2\edef\height{\the\scratchdimen\space}%
- \special
- {button:
- \width \height
- \if!!donea
- file: \DVIfile,
- \fi
- \ifnum0#5=0 \else
- page: #5
- \fi}}
- {}% nog uri afhandelen
- \egroup}
-
-\definespecial\dostartthisislocation#1%
- {\special{mark: "#1"}}
-
-\definespecial\dostartthisisrealpage#1%
- {}
-
-\definespecial\dostartrunprogram#1#2#3#4%
- {\bgroup
- \scratchdimen#1\edef\width {\the\scratchdimen\space}%
- \scratchdimen#2\edef\height{\the\scratchdimen\space}%
- \special{button: \width \height launch: #3 #4}%
- \egroup}
-
-\let\doyandyinsertmov = \docommoninsertmov
-\let\dotrinsertmov = \docommoninsertmov
-
-\stopspecials
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/spec-xet.mkii b/Master/texmf-dist/tex/context/base/mkii/spec-xet.mkii
deleted file mode 100644
index 0cbd55ba7fd..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/spec-xet.mkii
+++ /dev/null
@@ -1,66 +0,0 @@
-%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
-
-\definespecial\doinsertfile
- {\dofileinsertion{xtx}\@@DriverImageType}
-
-\definefileinsertion{xtx}{jpg}{\xtxhandleotherimage}
-\definefileinsertion{xtx}{png}{\xtxhandleotherimage}
-\definefileinsertion{xtx}{gif}{\xtxhandleotherimage}
-\definefileinsertion{xtx}{tif}{\xtxhandleotherimage}
-\definefileinsertion{xtx}{pdf}{\xtxhandlepdfimage }
-
-\def\checkpdfimagepagenumber
- {\edef\pdfimagepagenumber
- {\ifx\@@DriverImagePage\empty\else\ifnum\@@DriverImagePage>\zerocount
- \space page\space\@@DriverImagePage\space
- \fi\fi}}
-
-\def\xtxhandleotherimage
- {\XeTeXpicfile "\@@DriverImageFile"
- \ifdim\@@DriverImageWidth >\zeropoint \!!width \@@DriverImageWidth \space\fi
- \ifdim\@@DriverImageHeight>\zeropoint \!!height \@@DriverImageHeight \fi
- \relax}
-
-\def\xtxhandlepdfimage
- {\checkpdfimagepagenumber
- \XeTeXpdffile "\@@DriverImageFile"
- \pdfimagepagenumber
- \ifdim\@@DriverImageWidth >\zeropoint \!!width \@@DriverImageWidth \space\fi
- \ifdim\@@DriverImageHeight>\zeropoint \!!height \@@DriverImageHeight \fi
- \relax}
-
-\def\dogetXTXfiguresize
- {\setbox\foundexternalfigure\vbox{\XeTeXpicfile "\@@DriverImageFile"\relax}%
- \xdef\analyzedfigurewidth {\the\wd\foundexternalfigure}%
- \xdef\analyzedfigureheight{\the\ht\foundexternalfigure}}
-
-\def\dogetXTXpdfsize
- {\checkpdfimagepagenumber
- \setbox\foundexternalfigure\vbox{\XeTeXpdffile "\@@DriverImageFile" \pdfimagepagenumber\relax}%
- \xdef\analyzedfigurewidth {\the\wd\foundexternalfigure}%
- \xdef\analyzedfigureheight{\the\ht\foundexternalfigure}}
-
-\definefilechecker{xtx}{png}{\dogetXTXfiguresize}
-\definefilechecker{xtx}{jpg}{\dogetXTXfiguresize}
-\definefilechecker{xtx}{gif}{\dogetXTXfiguresize}
-\definefilechecker{xtx}{tif}{\dogetXTXfiguresize}
-\definefilechecker{xtx}{pdf}{\dogetXTXpdfsize }
-
-\definespecial\dogetfiguresize
- {\dofilechecker{xtx}\@@DriverImageType}
-
-%D The figure object system caused no end of headaches. They all
-%D went away with this single line:
-
-\setupexternalfigures[\c!object=\v!no]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/spec-xtx.mkii b/Master/texmf-dist/tex/context/base/mkii/spec-xtx.mkii
deleted file mode 100644
index 81b83e66318..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/spec-xtx.mkii
+++ /dev/null
@@ -1,85 +0,0 @@
-%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}]
-
-\startspecials[xetex][reset,dpx]
-
-%D Actually, there's an intermediate ``\type{xdv}''
-%D output format, but by default, it's tranparently
-%D converted to \PDF\ by \XETEX.
-
-\setjobsuffix{pdf}
-
-%D Rotation looks fine.
-
-\definespecial\dostartrotation#1%
- {\special{x:gsave}\special{x:rotate #1}}
-
-\definespecial\dostoprotation
- {\special{x:grestore}}
-
-%D Scaling and mirroring are also fine.
-
-\definespecial\dostartscaling#1#2%
- {\special{x:gsave}\special{x:scale #1 #2}}
-
-\definespecial\dostopscaling
- {\special{x:grestore}}
-
-\definespecial\dostartmirroring
- {\special{x:gsave}\special{x:scale -1 1}}
-
-\definespecial\dostopmirroring
- {\special{x:grestore}}
-
-%D Colors are done with the \DVIPDFMX\ color model, which are
-%D inherited.
-
-%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 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}
-%
-% \starttypen
-% \dostarttransparency{fraction}{type}
-% \dostoptransparency
-% \stoptypen
-%
-% Although in \CONTEXT\ transparency is closely integrated
-% in the color drivers, in the end it is an independent
-% feature.
-
-%\installspecial [\dostarttransparency] [or] [2]
-%\installspecial [\dostoptransparency] [or] [0]
-
-%D \macros
-%D {doloadmapfile,doloadmapline,doresetmapfilelist}
-%D
-%D \XETEX\ 0.91 allows map file additions, via a special.
-
-\definespecial\doresetmapfilelist{\special{x:fontmapfile original-empty.map}}
-\definespecial\doloadmapfile #1#2{\special{x:fontmapfile #1#2}}
-\definespecial\doloadmapline #1#2{\special{x:fontmapline #1#2}}
-
-%D \macros
-%D {dosetuppaper}
-
-\ifx\pdfpagewidth\undefined \else
- \definespecial\dosetuppaper#1#2#3%
- {\global\pdfpagewidth #2\relax
- \global\pdfpageheight#3\relax}
-\fi
-
-\stopspecials
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/spec-yy.mkii b/Master/texmf-dist/tex/context/base/mkii/spec-yy.mkii
deleted file mode 100644
index b5a1d590b08..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/spec-yy.mkii
+++ /dev/null
@@ -1,90 +0,0 @@
-%D \module
-%D [ file=spec-yy,
-%D version=1996.01.25,
-%D title=\CONTEXT\ Special Macros,
-%D subtitle=\YandY's \DVIPSONE\ and \DVIWINDO,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 \macros
-%D {dostartgraymode,dostopgraymode,
-%D dostartrgbcolormode,dostartcmykcolormode,dostartgraycolormode,dostopcolormode,
-%D doinsertfile}
-%D
-%D We implement a nice and simple figure||insertion special
-%D and make use of \YandY's color specials. Otherwise \DVIWINDO\
-%D would not show colors.
-
-\startspecials[yandy]
-
-\def\@@insertpostscriptliteral {ps: }
-\def\@@insertpostscriptretain {" } % this was: {postscript}
-
-\definespecial\dostartgraymode#1%
- {\special{color gray #1}}
-
-\definespecial\dostopgraymode%
- {\special{color gray 0}}
-
-\definespecial\dostartrgbcolormode#1#2#3%
- {\special{color rgb #1 #2 #3}}
-
-\definespecial\dostartcmykcolormode#1#2#3#4%
- {\special{color cmyk #1 #2 #3 #4}}
-
-\definespecial\dostartgraycolormode#1%
- {\special{color gray #1}}
-
-\definespecial\dostopcolormode%
- {\special{color gray 0}}
-
-% \definefileinsertion{yy}{eps}%
-% {\PointsToBigPoints\@@DriverImageWidth \width
-% \PointsToBigPoints\@@DriverImageHeight\height
-% \special
-% {psfile=\@@DriverImageFile\space
-% %hscale=100\space
-% %vscale=100\space
-% hoffset=\width\space
-% voffset=\height}}
-
-\definefileinsertion{tr}{eps}
- {\bgroup
- \PointsToWholeBigPoints\@@DriverImageWidth \width
- \PointsToWholeBigPoints\@@DriverImageHeight\height
- \special
- {PSfile="\@@DriverImageFile"\space
- llx=\EPSllx\space
- lly=\EPSlly\space
- urx=\EPSurx\space
- ury=\EPSury\space
- \ifdim\@@DriverImageWidth >\zeropoint rwi=\width 0\space\fi
- \ifdim\@@DriverImageHeight>\zeropoint rhi=\height0 \fi}%
- \egroup}
-
-\definefileinsertion{yy}{mps}
- {\hbox
- {\includeMPfonts \@@DriverImageFile
- \convertMPcolors\@@DriverImageFile
- \dofileinsertion{yy}{eps}}}
-
-\definefileinsertion{yy}{tif}
- {\special{insertimage:
- \@@DriverImageFile \space
- \@@DriverImageWidth\space
- \@@DriverImageHeight}}
-
-\definespecial\doinsertfile
- {\dofileinsertion{yy}\@@DriverImageType}
-
-\def\MPprologues{1}
-\def\MPOSTdriver{dvipsone}
-
-\stopspecials
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/strc-blk.mkii b/Master/texmf-dist/tex/context/base/mkii/strc-blk.mkii
deleted file mode 100644
index b6056769c87..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/strc-blk.mkii
+++ /dev/null
@@ -1,548 +0,0 @@
-%D \module
-%D [ file=strc-blk, % split off core-buf.tex
-%D version=2000.01.05,
-%D title=\CONTEXT\ Structure Macros,
-%D subtitle=Blockmoves,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% investigate etex's \readline and \scantokens
-
-\writestatus{loading}{ConTeXt Structure Macros / Blockmoves}
-
-\unprotect
-
-\def\blockversion {1996.03.10}
-
-\def\@@blockerrormessage
- {\showmessage\m!textblocks1\empty
- \global\let\@@blockerrormessage\relax}
-
-\def\thisisblockversion#1%
- {\doifnot\blockversion{#1}{\@@blockerrormessage\endinput}}
-
-\def\stopcopyingblocks
- {\ifcopyingblocks
- \immediate\closeout\outblocks
- \copyblockfile
- \global\copyingblocksfalse
- \fi}
-
-\def\dodosetblockcounters[#1]#2%
- {\expanded{\setvalue{\??se\s!old#2}{\@@filterheadpart[#1]}}%
- \doifnot{#2}\lastsection
- {\expanded{\dodosetblockcounters[\@@filtertailpart[#1]]}%
- {\getvalue{\??se#2\c!after}}}} % ????
-
-\def\dosetblockcounters[#1]%
- {\ifblockpermitted
- \expanded{\dodosetblockcounters[\@@filtersecondpart[#1]]}\firstsection
- \expanded{\setsectiontype[\@@filterfirstpart[#1]]}%
- \def\@@sectionvalue##1{\getvalue{\??se\s!old##1}}%
- \let\@@sectionconversion\secondoftwoarguments
- \fi}
-
-\let\blockstatus\empty
-
-\def\setblockcounters
- {\ifx\blockstatus\empty \else
- \@EA\dosetblockcounters\@EA[\blockstatus]%
- \fi}
-
-\def\getblockstatus#1%
- {\dosetfilterlevel{\@@bscriterium}\empty
- \expanded{\doifblklevelelse[#1\sectionseparator\sectionseparator0]}
- {\global\blockpermittedtrue}
- {\global\blockpermittedfalse}%
- \def\blockstatus{#1}}
-
-\def\setupblockparameters
- {\dodoubleargument\dosetupblockparameters}
-
-\def\dosetupblockparameters[#1][#2]%
- {\getparameters[\??tb#1][#2]}
-
-\def\blockparameter#1#2%
- {\@EA\csname\ifcsname\??tb#1#2\endcsname\??tb#1#2\else\s!empty\fi\endcsname}
-
-\ifx\outblocks\undefined \newwrite\outblocks \fi
-\ifx\inpblocks\undefined \newread \inpblocks \fi
-\ifx\tmpblocks\undefined \newwrite\tmpblocks \fi
-\ifx\blockbox \undefined \newbox \blockbox \fi
-
-\newif\ifcopyingblocks
-\newif\ifblockpermitted
-\newif\iftmpblockstarted
-\newif\ifoldinbijlagen
-\newif\ifdoingblocks
-
-\newcount\blocklevel
-
-\def\setblocklevel#1% sign
- {\global\advance\blocklevel #11
- \ifcase\blocklevel\doingblocksfalse\else\doingblockstrue\fi}
-
-\def\opentmpblock
- {\immediate\openout\tmpblocks\TEXbufferfile{\f!utilityfilename\the\blocklevel}}
-
-\def\closetmpblock
- {\immediate\write\tmpblocks{}% een lege regel is handig voor \par commando's
- \immediate\closeout\tmpblocks}
-
-\def\writetmpblock#1%
- {\iftmpblockstarted
- \immediate\write\tmpblocks{#1}%
- \else
- \doifsomething{#1}
- {\tmpblockstartedtrue
- \immediate\write\tmpblocks{\string#1}}%
- \fi}
-
-\def\startcopyingblocks
- {\global\copyingblocksfalse}
-
-\def\checkcopyingblocks
- {\ifcopyingblocks
- \else
- \immediate\openout\outblocks\f!utilityfilename.\f!blockextension%
- \immediate\write\outblocks{\string\thisisblockversion{\blockversion}}%
- \immediate\write\outblocks{\string\thisissectionseparator{\sectionseparator}}%
- \global\copyingblockstrue
- \fi}
-
-\def\stopcopyingblocks
- {\ifcopyingblocks
- \immediate\closeout\outblocks
- \copyblockfile
- \global\copyingblocksfalse
- \fi}
-
-\def\nomoreblocks
- {\stopcopyingblocks}
-
-\def\copyblockfile
- {\ifcopyingblocks
- \begingroup
- \showmessage\m!textblocks2{\jobname.\f!blockextension}%
- \openlocin\inpblocks{\f!utilityfilename.\f!blockextension}%
- \immediate\openout\outblocks\jobname.\f!blockextension
- \setupcopyblock
- \catcode`\^^M=\@@ignore\relax
- \def\copynextline
- {\read\inpblocks to \!!stringa
- \immediate\write\outblocks{\!!stringa}%
- \ifeof\inpblocks\else\expandafter\copynextline\fi}%
- \copynextline
- \immediate\closein\inpblocks
- \immediate\closeout\outblocks
- \immediate\openout\tmpblocks\f!utilityfilename.\f!blockextension
- \immediate\closeout\tmpblocks
- \endgroup
- \fi}
-
-\def\loadallblocks#1%
- {\beginrestorecatcodes
- \catcode`\^^M=\@@endofline\relax
- \readjobfile{#1.\f!blockextension}
- {\showmessage\m!textblocks3{#1.\f!blockextension}}
- {\showmessage\m!textblocks4\empty}%
- \endrestorecatcodes}
-
-\def\setupcopyblock
- {\setcatcodetable\vrbcatcodes
- \obeylines}
-
-\def\writeoutblocks
- {\immediate\write\outblocks}
-
-\long\def\processnextblocklineAB#1% #2#3%
- {\defconvertedargument\next{#1 }%
- \doifinstringelse\endofblockA\next
- \firstoftwoarguments
- {\doifinstringelse\endofblockB\next
- \firstoftwoarguments\secondoftwoarguments}}
-
-\bgroup
-\obeylines
-\long\gdef\copyblocklineAB#1
- {\processnextblocklineAB{#1}\closeblock{\writeoutblocks{#1}\writetmpblock{#1}\copyblocklineAB}}
-\long\gdef\skipblocklineAB#1
- {\processnextblocklineAB{#1}\closeblock\skipblocklineAB}
-\egroup
-
-\long\def\processnextblockline#1% #2#3%
- {\defconvertedargument\next{#1 }%
- \ifx\next\emptybufferline
- \expandafter\secondoftwoarguments% #3%
- \else
- \emptybufferlinefalse
- \doifinstringelse\endofblock\next
- {\expandafter\firstoftwoarguments }% #2}
- {\expandafter\secondoftwoarguments}% #3}%
- \fi}
-
-\bgroup
-\obeylines
-\long\gdef\copyblockline#1
- {\processnextblockline{#1}\closeblock{\writeoutblocks{#1}\writetmpblock{#1}\copyblockline}}
-\long\gdef\skipblockline#1
- {\processnextblockline{#1}\closeblock\skipblockline}
-\egroup
-
-\def\skipblock#1%
- {\checkcopyingblocks
- \defconvertedcommand\endofblock{\string\thiswasblock{#1}}% command expands once !
- \let\openblock\begingroup
- \let\closeblock\endgroup
- \openblock
- \setupcopyblock
- \skipblockline}
-
-\let\doafterblock \gobbletwoarguments
-\let\dobeforeblock\gobbletwoarguments
-
-\def\thisisblock#1%
- {\executeifdefined{\s!thisisblock#1}{\skipblock{#1}}}
-
-\def\thiswasblock#1%
- {\getvalue{\s!thiswasblock#1}}
-
-\def\saveblock#1#2%
- {\checkcopyingblocks
- \obeylines
- \@EA\defconvertedcommand\@EA\endofblockA\@EA{\@EA\string\csname\e!end#1\endcsname}%
- \defconvertedcommand\endofblockB{\string\endblock[#1]}% % MULTI LINGUAL MAKEN
- \def\openblock
- {\dobeforeblock{#1}{#2}%
- \opentmpblock
- \begingroup
- \makesectionformat
- \immediate\write\outblocks{}%
- \immediate\write\outblocks{\string\thisisblock{#1}{\sectionformat}[#2]}}%
- \def\closeblock
- {\immediate\write\outblocks{}% handig voor \par commando's
- \immediate\write\outblocks{\string\thiswasblock{#1}}%
- \endgroup
- \closetmpblock
- \doafterblock{#1}{#2}%
- \egroup}%
- \openblock
- \setupcopyblock
- \copyblocklineAB}
-
-\def\copyblock
- {\let\opentmpblock\empty
- \let\closetmpblock\empty
- \let\writetmpblock\gobbleoneargument
- \saveblock}
-
-\def\loadoneblock
- {\edef\blockfilename{\TEXbufferfile{\f!utilityfilename\the\blocklevel}}%
- \setblocklevel+%
- \readjobfile\blockfilename\donothing\donothing
- \setblocklevel-}%
-
-\def\dodefineblock[#1]%
- {\bypassblock[#1]%
- \keepblocks[#1]%
- \setupblock
- [#1]
- [\c!before=\blank,
- \c!after=\blank,
- \c!inner=,
- \c!style=,
- \c!file=\jobname]}
-
-% \def\defineblock
-% {\dosingleargumentwithset\dodefineblock}
-
-\def\defineblock
- {\dosingleargument\dodefineblock}
-
-\def\dosetupblock[#1][#2]%
- {\getparameters[\??tb#1][#2]}
-
-\def\setupblock
- {\dodoubleargumentwithset\dosetupblock}
-
-\def\bypassblock[#1]%
- {\setvalue{\s!thisisblock#1}##1[##2]{\skipblock{#1}}}
-
-\def\dohideblock[#1][#2][#3]%
- {\doifassignmentelse{#3}
- {\dodohideblock[#1][#2][][#3]}
- {\dodohideblock[#1][#2][#3][]}}
-
-\def\dodohideblock[#1][#2][#3][#4]%
- {\doifelsenothing{#2}
- {\global\blockpermittedfalse
- \edef\blocktitle{#1}}
- {\doifelsenothing{#3}
- {\global\blockpermittedtrue
- \edef\blocktitle{#1}}
- {\doifcommonelse{#2}{#3}
- {\global\blockpermittedfalse
- \edef\blocktitle{#1:#2}}
- {\global\blockpermittedtrue
- \edef\blocktitle{#1:#3}}}}%
- \ifblockpermitted
- \showwarning\m!textblocks5\blocktitle
- \def\next
- {\def\dobeforeblock####1####2%
- {\begingroup}%
- \def\doafterblock####1####2%
- {\endgroup
- \doexecuteloadedblock{#1}{#4}}%
- \saveblock{#1}{#3#4}}%
- \else
- \doifinsetelse{+}{#3}
- {\showwarning\m!textblocks6\blocktitle
- \def\next
- {\def\dobeforeblock####1####2%
- {\begingroup
- \visiblefalse}%
- \def\doafterblock####1####2%
- {{\setbox0\vbox
- {\catcode`\^^M=\@@endofline\relax
- \loadoneblock
- \par}}%
- \endgroup}%
- \saveblock{#1}{#3#4}}}%
- {\showwarning\m!textblocks7\blocktitle
- \def\next
- {\def\dobeforeblock####1####2%
- {\begingroup
- \globaldefs\minusone}%
- \def\doafterblock####1####2%
- {\endgroup}%
- \copyblock{#1}{#3#4}}}%
- \fi
- \next}
-
-\def\dohideblocks[#1][#2]%
- {\def\docommand##1%
- {\setvalue{\e!begin##1}%
- {\bgroup\obeylines\dotripleempty\dohideblock[##1][#2]}}%
- \processcommalist[#1]\docommand}
-
-\def\hideblocks
- {\dodoubleempty\dohideblocks}
-
-\def\doexecuteloadedblock#1#2%
- {\blockpermittedtrue % ?
- \bgroup % before \c!before (think of: \c!before=\startitemize)
- \dosetupblockparameters[#1][#2]% voor 'voor'?
- \getvalue{\??tb#1\c!before}%
- \dostartattributes{\??tb#1}\c!style\c!color\empty
- \visibletrue
- \catcode`\^^M=\@@endofline\relax
- \getvalue{\??tb#1\c!inner}%
- \ignorespaces
- \loadoneblock
- % \par moved
- \dostopattributes
- \getvalue{\??tb#1\c!after}%
- \par
- \egroup}
-
-\def\dokeepblock[#1][#2][#3]%
- {\doifassignmentelse{#3}
- {\dodokeepblock[#1][#2][][#3]}
- {\dodokeepblock[#1][#2][#3][]}}
-
-\def\dodokeepblock[#1][#2][#3][#4]%
- {\doifelsenothing{#2}
- {\global\blockpermittedtrue
- \edef\blocktitle{#1}}
- {\doifcommonelse{#2}{#3}
- {\global\blockpermittedtrue
- \edef\blocktitle{#1:#2}}
- {\doifinsetelse\v!all{#2}
- {\doifelsenothing{#3}
- {\global\blockpermittedtrue
- \edef\blocktitle{#1}}
- {\global\blockpermittedfalse
- \edef\blocktitle{#1:#3}}}
- {\global\blockpermittedfalse
- \doifelsenothing{#3}
- {\edef\blocktitle{#1}}
- {\edef\blocktitle{#1:#3}}}}}%
- \ifblockpermitted
- \showwarning\m!textblocks8\blocktitle
- \def\dobeforeblock##1##2%
- {\begingroup}%
- \def\doafterblock##1##2%
- {\endgroup
- \doexecuteloadedblock{#1}{#4}}%
- \else
- \showwarning\m!textblocks9\blocktitle
- \fi
- \saveblock{#1}{#3#4}}
-
-\def\dokeepblocks[#1][#2]%
- {\def\docommand##1%
- {\setvalue{\e!begin##1}%
- {\bgroup\obeylines\dotripleempty\dokeepblock[##1][#2]}}%
- \processcommalist[#1]\docommand}
-
-\def\keepblocks
- {\dodoubleempty\dokeepblocks}
-
-\newconditional\processblockstatus
-\newconditional\dummyblockstatus
-\newconditional\blockassignmentstatus
-
-\def\dodouseblock#1#2#3#4%
- {\getblockstatus{#2}%
- \ifblockpermitted
- \setfalse\dummyblockstatus
- \doifassignmentelse{#3}
- {\settrue \blockassignmentstatus}
- {\setfalse\blockassignmentstatus}%
- \doifelsenothing{#4}
- {\edef\blocktitle{#1}}
- {\ifconditional\blockassignmentstatus
- \edef\blocktitle{#1}%
- \else
- \doifnotcommon{#3}{#4}
- {\ifconditional\processblockstatus
- \settrue\dummyblockstatus
- \else
- \global\blockpermittedfalse
- \fi}%
- \edef\blocktitle{#1:#3}%
- \fi}%
- \else
- \edef\blocktitle{#1}%
- \fi
- \ifblockpermitted
- \setblocklevel+%
- \ifconditional\blockassignmentstatus \else
- \doifinset{-}{#3}{\settrue\dummyblockstatus}%
- \fi
- \ifconditional\dummyblockstatus
- \showwarning\m!textblocks{10}\blocktitle
- \setvalue{\s!thiswasblock#1}%
- {\removeunwantedspaces
- \par
- \egroup
- \setblocklevel-}%
- \def\next
- {\setbox0\vbox\bgroup
- \ifconditional\blockassignmentstatus
- \dosetupblockparameters[#1][#3]%
- \fi}%
- \else
- \showwarning\m!textblocks{11}\blocktitle
- \setvalue{\s!thiswasblock#1}%
- {\removeunwantedspaces
- % \par moved
- \dostopattributes
- \getvalue{\??tb#1\c!after}%
- \par
- \egroup
- \setblocklevel-}%
- \def\next
- {\bgroup
- \ifconditional\blockassignmentstatus
- \dosetupblockparameters[#1][#3]%
- \fi
- \getvalue{\??tb#1\c!before}%
- \dostartattributes{\??tb#1}\c!style\c!color\empty
- \visibletrue
- \getvalue{\??tb#1\c!inner}%
- \ignorespaces}%
- \fi
- \else
- \def\next
- {\showwarning\m!textblocks{12}\blocktitle
- \skipblock{#1}}%
- \fi
- \next}
-
-\def\douseblock[#1][#2]%
- {\setvalue{\s!thisisblock#1}##1[##2]{\dodouseblock{#1}{##1}{##2}{#2}}}
-
-\def\dodouseblocks[#1][#2]%
- {\def\docommand##1%
- {\douseblock[##1][#2]}%
- \processcommalist[#1]\docommand
- \dogetcommalistelement1\from#1\to\commalistelement
- \doifdefined{\??tb\commalistelement\c!file}
- {\loadallblocks{\getvalue{\??tb\commalistelement\c!file}}}%
- \endgroup}
-
-\def\douseblocks
- {\begingroup
- \doassign[\??bs][\c!criterium=\v!all]%
- \dodoubleempty\dodouseblocks}
-
-\def\useblocks
- {\setfalse\processblockstatus\douseblocks}
-
-\def\processblocks
- {\settrue \processblockstatus\douseblocks}
-
-\def\doselectblocks[#1][#2][#3]%
- {\begingroup
- \doifelsenothing{#3}
- {\getparameters[\??bs][\c!criterium=\v!all,#2]%
- \dodouseblocks[#1][]}
- {\getparameters[\??bs][\c!criterium=\v!all,#3]%
- \dodouseblocks[#1][#2]}}%
-
-\def\selectblocks
- {\dotripleempty\doselectblocks}
-
-\def\beginblock[#1]% % we also check \endblock[..]
- {\getvalue{\e!begin#1}}
-
-\def\forceblocks[#1]%
- {\def\docommand##1%
- {\setvalue{\e!begin##1}%
- {\setblocklevel+\bgroup
- \dodoubleempty\doforceblock[##1]}%
- \setvalue{\e!end##1}%
- {\dostopattributes
- \getvalue{\??tb##1\c!after}%
- \egroup\setblocklevel-}}%
- \processcommalist[#1]\docommand}
-
-\def\doforceblock[#1][#2]%
- {\doifassignmentelse{#2}
- {\settrue \blockassignmentstatus}
- {\setfalse\blockassignmentstatus}%
- \ifconditional\blockassignmentstatus
- \dosetupblockparameters[#1][#2]%
- \fi
- \getvalue{\??tb#1\c!before}%
- \dostartattributes{\??tb#1}\c!style\c!color\empty
- \getvalue{\??tb#1\c!inner}%
- \ignorespaces}
-
-\def\bypassblocks[#1]%
- {\def\docommand##1%
- {\setvalue{\e!begin##1}%
- {\setblocklevel+\bgroup
- \obeylines % here, since we look ahead
- \dodoubleempty\dobypassblock[##1]}%}%
- \setvalue{\e!end##1}%
- {}}%
- \processcommalist[#1]\docommand}
-
-\def\dobypassblock[#1][#2]%
- {\def\closeblock
- {\egroup\setblocklevel-}%
- \checkcopyingblocks
- \obeylines
- \@EA\defconvertedcommand\@EA\endofblockA\@EA{\@EA\string\csname\e!end#1\endcsname}%
- \defconvertedcommand\endofblockB{\string\endblock[#1]} % MULTI LINGUAL MAKEN
- \setupcopyblock
- \skipblocklineAB}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/strc-des.mkii b/Master/texmf-dist/tex/context/base/mkii/strc-des.mkii
deleted file mode 100644
index e699df9ea1d..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/strc-des.mkii
+++ /dev/null
@@ -1,921 +0,0 @@
-%D \module
-%D [ file=strc-des,
-%D version=1997.03.31,
-%D title=\CONTEXT\ Structure Macros,
-%D subtitle=Descriptions,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Structure Macros / Descriptions}
-
-%D In order to be more flexible with theorems Aditya Mahajan added
-%D support for titles and endsymbols. At the same time we some more
-%D flexible support for inheriting numbers was added.
-
-%D \startbuffer
-%D \defineenumeration[one]
-%D \defineenumeration[two] [one]
-%D \defineenumeration[three] [number=one,style=slanted]
-%D \defineenumeration[four] [three]
-%D \defineenumeration[five] [three] [number=five]
-%D
-%D \startone test test 1 \stopone
-%D \starttwo test test 2 \stoptwo
-%D \startthree test test 3 \stopthree
-%D \startfour test test 4 \stopfour
-%D \startfive test test 1 \stopfive
-%D \stopbuffer
-%D
-%D \typebuffer \start \getbuffer \stop
-
-\unprotect
-
-% Dit kan en moet dus anders:
-%
-% \start... : \vbox\bgroup
-% \stop... : \egroup
-% llap enz.
-% geen indent!
-%
-% enz. enz.
-%
-% Op die manier is meer mogelijk en worden \par's geskipt.
-%
-% De macro \??dd#1\s!do\c!commando levert de koppeling tussen
-% \doornummeren en \doordefinieren. Deze constructie is nodig
-% omdat doornummeren geen argument heeft en omdat subnummers
-% niet worden genest binnen het hogere niveau.
-%
-% herimplementeren met \nextbox en \unhbox\unvbox
-
-% list and titles are experiental
-%
-% \definedescription[test] [location=left,hang=4,headalign={right},distance=1em,list=test]
-% \defineenumeration[lemma][title=yes,right=:,textdistance=1em, location=top, titlestyle=\bs,list=lemma]
-% \defineenumeration[ammel][title=yes,right=:,textdistance=.5em,location=left,titlestyle=\it,width=9em]
-%
-% \placelist[enumeration:lemma]
-% \placelist[description:test][width=0pt]
-%
-% \starttest {something something something} \input zapf \stoptest
-% \startlemma {with a title of a certain length} \input tufte \stoplemma
-% \startammel {with a title} \input zapf \stopammel
-%
-% \defineenumeration[lemma][...]
-% \defineenumeration[titledlemma][lemma][title=yes,right=:,text=lemma,list=lemma]
-
-\newbox\@@descriptionbox
-
-\def\descriptionparameter#1{\csname\??dd\currentdescription#1\endcsname}
-
-\def\@@descriptionhandler{\descriptionparameter{\s!do\c!command}}
-
-% \def\normal@@descriptionhandler[#1]#2#3%
-% {\doattributes
-% {\??dd\currentdescription}\c!headstyle\c!headcolor
-% {\descriptionparameter\c!command{#3}}% NAAR BUITENSTE NIVEAU !
-% \rawreference\s!def{#1}{#2}} % brrr moet in #4
-
-\def\normal@@descriptionhandler[#1]#2#3%
- {\doattributes
- {\??dd\currentdescription}\c!headstyle\c!headcolor
- {\descriptionparameter\c!command{#3}}% NAAR BUITENSTE NIVEAU !
- \doifsomething{\descriptionparameter\c!list}
- {\dowritetolist
- {\descriptionparameter\c!type:\descriptionparameter\c!list}
- {}{#2}{\currentdescription}}%
- % beware: with footnotes #2 can be something messy but then #1 is
- % empty anyway, so we have an extra safeguard
- \doifsomething{#1}{\rawreference\s!def{#1}{#2}}} % brrr moet in #4
-
-\setvalue{@@description\v!left}%
- {\@@descriptionhang\@@descriptionleftpure\@@descriptionlefthang}
-
-\setvalue{@@description\v!right}%
- {\@@descriptionhang\@@descriptionrightpure\@@descriptionrighthang}
-
-\def\@@descriptionhang#1#2%
- {\processaction
- [\descriptionparameter\c!hang]
- [ \v!none=>\let\next#1,%
- 0=>\let\next#1,%
- \s!unknown=>\let\next#2,%
- \s!default=>\let\next#1]%
- \next}
-
-\def\@@descriptionleftpure[#1]#2%
- {\@@dostartdescription[#1]{\def\\{\crlf}}{#2}%
- \noindent\ignorespaces
- \leftskip\@@leftdescriptionskip
- \rightskip\@@rightdescriptionskip
- \advance\leftskip \!!widtha
- \@@makedescriptionpurebox\raggedright
- \advance\leftskip \!!widthb
- \llap
- {\hbox to \leftskip
- {\hskip\@@leftdescriptionskip
- \copy\@@descriptionbox\hss}}%
- \@@dodescription}
-
-\def\@@descriptionrightpure[#1]#2%
- {\@@dostartdescription[#1]{\def\\{\crlf}}{#2}%
- \noindent\ignorespaces
- \leftskip\@@leftdescriptionskip
- \rightskip\@@rightdescriptionskip
- \advance\rightskip \!!widtha
- \@@makedescriptionpurebox\raggedleft
- \rlap
- {\hskip\hsize
- \hskip-\leftskip
- \hskip-\rightskip
- \copy\@@descriptionbox
- \hskip\@@rightdescriptionskip}%
- \advance\rightskip \!!widthb
- \@@dodescription}
-
-\def\@@makedescriptionpurebox#1%
- {\setbox\@@descriptionbox\vtop
- {\dontcomplain
- \hsize\!!widtha
- \leftskip\zeropoint
- \rightskip\zeropoint
- #1\setupalign[\descriptionparameter\c!align]%
- \ifhbox\@@descriptionbox\unhcopy\else\copy\fi\@@descriptionbox}%
- \ht\@@descriptionbox\strutht
- \dp\@@descriptionbox\strutdp}
-
-\def\@@descriptionlefthang[#1]#2%
- {\@@dostartdescription[#1]{\def\\{\crlf}}{#2}%
- \dontcomplain
- \advance\!!widtha \!!widthb
- \hangindent\!!widtha
- \@@makedescriptionhangbox\raggedright{\advance\rightskip \!!widthb}%
- \noindent\ignorespaces
- \llap
- {\dontshowcomposition
- \vtop to \zeropoint{\box\@@descriptionbox}}%
- \@@dodescription}
-
-\def\@@descriptionrighthang[#1]#2%
- {\@@dostartdescription[#1]{\def\\{\crlf}}{#2}%
- \dontcomplain
- \advance\!!widtha \!!widthb
- \hangindent-\!!widtha
- \@@makedescriptionhangbox\raggedleft{\advance\leftskip \!!widthb}%
- \noindent\ignorespaces
- \rlap
- {\dontcomplain
- \dontshowcomposition
- \scratchdimen\hsize
- \advance\scratchdimen -\leftskip
- \advance\scratchdimen -\rightskip
- \hbox to \scratchdimen
- {\hss\vtop to \zeropoint{\box\@@descriptionbox}}}%
- \@@dodescription}
-
-\def\@@makedescriptionhangbox#1#2%
- {\setbox\@@descriptionbox\vtop % \vbox gaat fout in hang
- {\forgetall
- \dontcomplain
- \hsize\!!widtha
- #1\setupalign[\descriptionparameter\c!align]#2%
- \ifhbox\@@descriptionbox\unhcopy\else\copy\fi\@@descriptionbox}%
- \ht\@@descriptionbox\strutht
- \dp\@@descriptionbox\strutdp
- \doifsomething{\descriptionparameter\c!hang}
- {\doifinsetelse{\descriptionparameter\c!hang}{\v!fit,\v!broad}
- {\scratchdimen\ht\@@descriptionbox
- \advance\scratchdimen \dp\@@descriptionbox
- \doif{\descriptionparameter\c!hang}\v!broad
- {\advance\scratchdimen .5\strutht}%
- \getnoflines\scratchdimen
- \hangafter-\noflines}
- {\hangafter-\descriptionparameter\c!hang}}}
-
-\setvalue{@@description\v!top}[#1]#2%
- {%\page[\v!preference]% % Weg ermee!
- %\dosomebreak{\goodbreak}% % Dit is beter en nodig!
- \dohandlepagebreakX\plusone % En dit moet het maar worden.
- \@@dostartdescription[#1]{\let\\=\space}{#2}%
- \noindent\ignorespaces
- \copy\@@descriptionbox\par
- \nobreak
- \descriptionparameter\c!inbetween
- \nobreak
- \@@dodescription}
-
-\def\do@@description#1[#2]#3%
- {\@@dostartdescription[#2]{\def\\{\crlf}}{#3}%
- \noindent\ignorespaces % not needed this ignore
- #1{\ifhbox\@@descriptionbox\unhcopy\else\copy\fi\@@descriptionbox}%
- \@@dodescription}
-
-\setvalue{@@description\v!inmargin }{\do@@description\inmargin}
-\setvalue{@@description\v!inleft }{\do@@description\inleft }
-\setvalue{@@description\v!inright }{\do@@description\inright }
-\setvalue{@@description\v!margin }{\do@@description\inmargin}
-\setvalue{@@description\v!leftmargin }{\do@@description\inleft }
-\setvalue{@@description\v!rightmargin }{\do@@description\inright }
-\setvalue{@@description\v!innermargin }{\do@@description\ininner }
-\setvalue{@@description\v!outermargin }{\do@@description\inouter }
-
-\setvalue{@@description\v!serried\v!fit}[#1]#2%
- {\@@dostartdescription[#1]{\def\\{\crlf}}{#2}%
- \noindent\ignorespaces
- \ifhbox\@@descriptionbox\unhcopy\else\copy\fi\@@descriptionbox
- \hskip\!!widthb % toegevoegd
- \@@dodescription}
-
-\setvalue{@@description\v!serried\v!broad}[#1]#2%
- {\@@dostartdescription[#1]{\def\\{\crlf}}{#2}%
- \noindent\ignorespaces
- \ifhbox\@@descriptionbox\unhcopy\else\copy\fi\@@descriptionbox
- \hskip\!!widthb \!!plus .5\!!widthb \!!minus .25\!!widthb
- \@@dodescription}
-
-\setvalue{@@description\v!serried\v!wide}[#1]#2%
- {\@@dostartdescription[#1]{\def\\{\crlf}}{#2}%
- \noindent\ignorespaces
- \hbox to \!!widtha
- {\ifhbox\@@descriptionbox\unhcopy\else\copy\fi\@@descriptionbox\hss}%
- \hskip\!!widthb
- \ignorespaces
- \@@dodescription}
-
-\setvalue{@@description\v!serried}[#1]#2%
- {\processaction
- [\descriptionparameter\c!width]
- [ \v!fit=>\let\next\v!fit,
- \v!broad=>\let\next\v!broad,
- \s!unknown=>\let\next\v!wide,
- \s!default=>\let\next\v!broad]%
- \getvalue{@@description\v!serried\next}[#1]{#2}}
-
-\setvalue{@@description\v!hanging}[#1]#2%
- {\@@dostartdescription[#1]{\def\\{\crlf}}{#2}% % adds \c!margin to \leftskip
- \noindent\ignorespaces
- \advance\leftskip -\leftskipadaption \relax
- \ifdim\leftskipadaption=\zeropoint
- \leftskipadaption1.5em % just some default
- \ifnum\nesteddescriptionstate=\plusone
- \ifdim\leftskip>\zeropoint \relax
- \leftskipadaption\leftskip
- \fi
- \fi
- \fi
- \ifnum\nesteddescriptionstate>\zerocount % was \ifnum\nesteddescriptionstate=\plusone
- \advance\leftskip \leftskipadaption % but we're already further on
- \fi
- \hskip-\leftskipadaption
- \ifhbox\@@descriptionbox\unhcopy\else\copy\fi\@@descriptionbox
- \kern\ifdim\!!widthb=\zeropoint .75em\else\!!widthb\fi
- \ignorespaces
- \@@dodescription}
-
-%D A bonus definition
-%D
-%D \starttyping
-%D \setupfootnotedefinition[location=command,headcommand=\llap]
-%D \stoptyping
-
-\setvalue{@@description\v!command}#1%
- {\do@@description{\executeifdefined{\??dd#1\c!headcommand}\framed}{#1}}
-
-%D A new key 'headalign' in definitions.
-
-\def\resetdescriptions % to be used in e.g. footnotes
- {\chardef\nesteddescriptionstate\zerocount}
-
-\resetdescriptions
-
-\let\@@leftdescriptionskip \!!zeropoint
-\let\@@rightdescriptionskip\!!zeropoint
-
-\def\@@dostartdescription[#1]#2#3%
- {\descriptionparameter\c!before
- \begingroup
- \doadaptleftskip{\descriptionparameter\c!margin}%
- \showcomposition
- \!!widthb\descriptionparameter\c!distance\relax
- \ifdim\!!widthb=\zeropoint\relax
- \doif{\descriptionparameter\c!width}\v!broad{\!!widthb=1em}%
- \fi
- % temp hack, we need to avoid this kind of preprocessing
- \setbox\@@descriptionbox\hbox % preroll
- {\forgetall
- \trialtypesettingtrue
- \dontcomplain
- #2% sets \\ to space or \crlf
- \@@descriptionhandler[#1]{#3}{\begstrut\descriptionparameter\c!text\ignorespaces#3\endstrut}}%
- % so far
- \assignwidth
- \!!widtha
- {\descriptionparameter\c!width}%
- {\doifelsenothing{\descriptionparameter\c!sample}%
- {% preroll can move here (test first)
- \ifhbox\@@descriptionbox\unhcopy\else\copy\fi \@@descriptionbox}%
- {\@@descriptionhandler[#1]{#3}{\descriptionparameter\c!text\descriptionparameter\c!sample}}}
- \!!widthb
- \setbox\@@descriptionbox\hbox
- {\forgetall
- \dontcomplain
- #2% sets \\ to space or \crlf
- \doifelse{\descriptionparameter\c!location}\v!serried
- {\@@descriptionhandler[#1]{#3}{\begstrut\descriptionparameter\c!text#3\endstrut}}
- {\@@descriptionhandler[#1]{#3}{\vtop{\hsize\!!widtha\advance\hsize-\!!widthb
- \begstrut\descriptionparameter\c!text\ignorespaces#3\endstrut}}}}%
- \doifelse{\descriptionparameter\c!aligntitle}\v!no
- {\edef\@@leftdescriptionskip {\the\leftskip }%
- \edef\@@rightdescriptionskip{\the\rightskip}}
- {\ifcase\nesteddescriptionstate
- \edef\@@leftdescriptionskip {\the\leftskip }%
- \edef\@@rightdescriptionskip{\the\rightskip}%
- \fi}%
- \expanded{\indenting[\descriptionparameter\c!indenting]}%
- % better a system mode
- \ifcase\nesteddescriptionstate
- \chardef\nesteddescriptionstate\plusone
- \or
- \chardef\nesteddescriptionstate\plustwo
- \fi% now happens elsewhere : \noindent\ignorespaces
- \@@resetdescriptionclosesymbol}
-
-\def\@@stopdescription#1%
- {\def\currentdescription{#1}%
- \@@placedescriptionclosesymbol
- % was \par \dostopattributes % here, else problems with interlinespace and font change
- \dostopparbasedattributes % == \settrue\parbasedattributes \dostopattributes
- \endgroup
- \descriptionparameter\c!after %hm, which currentdescription?
- \egroup % temporary hack
- \def\currentdescription{#1}%
- \dochecknextindentation{\??dd\currentdescription}%
- \dorechecknextindentation}
-
-\def\@@dodescription
- {\dostartattributes{\??dd\currentdescription}\c!style\c!color\empty
- \ignorespaces}
-
-% starters:
-
-\def\@@startdescription[#1][#2]%
- {\def\currentdescription{#1}%
- \doifelse{\descriptionparameter\c!title}\v!yes
- % {\dowithwargument{\@@startsomedescription{#1}[#2]}} % patched for theorems
- {\permitspacesbetweengroups
- \dodoublegroupempty{\@@startsomedescription{#1}[#2]}}
- {\@@startsomedescription{#1}[#2]{}}}
-
-\def\@@description[#1][#2]%
- {\def\currentdescription{#1}%
- \doifelse{\descriptionparameter\c!title}\v!yes
- % {\dowithwargument{\@@somedescription{#1}[#2]}} % patched for theorems
- {\permitspacesbetweengroups
- \dodoublegroupempty{\@@somedescription{#1}[#2]}}
- {\@@somedescription{#1}[#2]{}}}
-
-% these call:
-
-\def\@@somedescription#1[#2]#3%
- {\dowithpar
- {\bgroup\@@makedescription{#1}[#2]{#3}}%
- {\@@stopdescription{#1}}}
-
-\def\@@startsomedescription#1[#2]#3%
- {\bgroup % temporary hack
- \BeforePar{\@@makedescription{#1}[#2]{#3}}%
- \GotoPar}
-
-% which calls:
-
-\def\@@makedescription#1%
- {\postponenotes % new, assumes grouping
- \def\currentdescription{#1}%
- \executeifdefined
- {@@description\descriptionparameter\c!location}
- {\getvalue{@@description\v!left}}}
-
-% \def\@@makedescription#1%
-% {\def\currentdescription{#1}%
-% \ifundefined{@@description\descriptionparameter\c!location}%
-% \letvalue{\??dd#1\c!location}\v!left
-% \fi
-% \getvalue{@@description\descriptionparameter\c!location}}
-
-% definitions
-
-\def\setupdescriptions
- {\dodoubleempty\dosetupdescriptions}
-
-\def\dosetupdescriptions[#1][#2]% % beter: \iffirstargument
- {\ConvertToConstant\doifelse{#2}{}
- {\dodosetupdescriptions[][#1]}
- {\dodoubleargumentwithset\dodosetupdescriptions[#1][#2]}}
-
-\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!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,
- \c!titleleft,\c!titleright,\c!titlecommand,\c!closesymbol,\c!closecommand]%
- \getparameters[\??dd#1]
- [\c!title=\v!yes,\s!do\c!command=\normal@@descriptionhandler,
- \c!type=\v!description,\c!list=,\c!listtext=,
- \c!level=,#2]%AM?? Why do we have title=yes here?
- %\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]}}%
- \doifvaluesomething{\??dd#1\c!list}
- {\definelist[\getvalue{\??dd#1\c!type}:\getvalue{\??dd#1\c!list}]}% new
- \setvalue {#1}{\dodoubleempty\@@description[#1]}%
- \setvalue{\e!start#1}{\dodoubleempty\@@startdescription[#1]}%
- \setvalue{\e!stop #1}{\@@stopdescription{#1}}}
-
-\def\definedescription
- {\dodoubleemptywithset\dodefinedescription}
-
-\def\currentdescriptionnumber {\csname\??dd\currentdescription\??dd\c!number\endcsname}
-\def\directcurrentdescriptionnumber#1{\csname\??dd #1\??dd\c!number\endcsname}
-
-\ifx\preparednumber\undefined \let\preparednumber\empty \fi
-
-\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]%
- \prepareprefixnumber{\??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]%
- \prepareprefixnumber{\??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]%
- %\prepareprefixnumber{\??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
- \descriptionparameter\c!left
- \strut\doshowdnnumber
- \showdntitle{#2}%
- \descriptionparameter\c!stopper
- \descriptionparameter\c!right}}%
- \doifsomething{\descriptionparameter\c!list}
- {\dowritetolist
- {\descriptionparameter\c!type:\descriptionparameter\c!list}
- {\showdnlisttext\doshowdnnumber}{#2}{\currentdescription}}%
- \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}{#2}}}%
- \else
- \doattributes{\??dd\currentdescription}\c!headstyle\c!headcolor
- {\descriptionparameter\c!command
- {\showdnpuretext
- \descriptionparameter\c!left
- \showdntitle{#2}%
- \descriptionparameter\c!stopper
- \descriptionparameter\c!right}}%
- \doifnot{#1}{-}{\rawreference\s!num{#1}{{}{#2}}}%
- \fi}
-
-\def\showdntitle#1%
- {\doif{\descriptionparameter\c!title}\v!yes % new, for david antos
- {\doifsomething{#1}
- {\doattributes{\??dd\currentdescription}\c!titlestyle\c!titlecolor
- {\hskip\descriptionparameter\c!titledistance
- \descriptionparameter\c!titlecommand
- {\descriptionparameter\c!titleleft
- \begstrut#1\endstrut
- \descriptionparameter\c!titleright}}}}}
-
-
-\def\showdnpuretext
- {\strut\descriptionparameter\c!text} % geen spatie
-
-\def\showdnlisttext
- {\descriptionparameter\c!listtext} % space in default
-
-\def\showdntext
- {\doifelsenothing{\descriptionparameter\c!text}
- {\ignorespaces}
- {\strut
- \descriptionparameter\c!text
- \removeunwantedspaces\fixedspace}}
-
-\def\doshowdnnumber
- {\getvalue{showdn\descriptionparameter\c!level\c!number}}
-
-% maybe recursive until end condition undefined
-
-\setvalue{showdn\c!number}%
- {\preparednumber
- \convertednumber[\currentdescriptionnumber]}
-
-\setvalue{showdn\v!sub\c!number}%
- {\getvalue{showdn\c!number}%
- \spr{\descriptionparameter\c!separator}%
- \convertednumber[\v!sub\currentdescriptionnumber]}
-
-\setvalue{showdn\v!sub\v!sub\c!number}%
- {\getvalue{showdn\v!sub\c!number}%
- \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}%
- \spr{\descriptionparameter\c!separator}%
- \convertednumber[\v!sub\v!sub\v!sub\currentdescriptionnumber]}
-
-\def\domakednnumber
- {\descriptionparameter\c!left
- \strut\doshowdnnumber
- \descriptionparameter\c!stopper
- \descriptionparameter\c!right}
-
-\setvalue{\??dd\s!set\v!sub\s!sub\s!sub\c!number}#1%
- {\edef\@@descriptionnumber{\directcurrentdescriptionnumber{#1}}%
- \setnumber[\v!sub\v!sub\v!sub\@@descriptionnumber]}
-
-\setvalue{\??dd\s!set\v!sub\s!sub\c!number}#1%
- {\getvalue{\??dd\s!reset\v!sub\v!sub\v!sub\c!number}{#1}%
- \setnumber[\v!sub\v!sub\@@descriptionnumber]}
-
-\setvalue{\??dd\s!set\v!sub\c!number}#1%
- {\getvalue{\??dd\s!reset\v!sub\v!sub\c!number}{#1}%
- \setnumber[\v!sub\@@descriptionnumber]}
-
-\setvalue{\??dd\s!set\c!number}#1%
- {\getvalue{\??dd\s!reset\v!sub\c!number}{#1}%
- \setnumber[\@@descriptionnumber]}
-
-\setvalue{\??dd\s!reset\v!sub\v!sub\v!sub\c!number}#1%
- {\edef\@@descriptionnumber{\directcurrentdescriptionnumber{#1}}%
- \resetnumber[\v!sub\v!sub\v!sub\@@descriptionnumber]}
-
-\setvalue{\??dd\s!reset\v!sub\v!sub\c!number}#1%
- {\getvalue{\??dd\s!reset\v!sub\v!sub\v!sub\c!number}{#1}%
- \resetnumber[\v!sub\v!sub\@@descriptionnumber]}
-
-\setvalue{\??dd\s!reset\v!sub\c!number}#1%
- {\getvalue{\??dd\s!reset\v!sub\v!sub\c!number}{#1}%
- \resetnumber[\v!sub\@@descriptionnumber]}
-
-\setvalue{\??dd\s!reset\c!number}#1%
- {\getvalue{\??dd\s!reset\v!sub\c!number}{#1}%
- \resetnumber[\@@descriptionnumber]}
-
-\setvalue{\??dd\e!next\v!sub\v!sub\v!sub\c!number}#1#2%
- {\edef\@@descriptionnumber{\directcurrentdescriptionnumber{#1}}%
- \incrementnumber[\v!sub\v!sub\v!sub\@@descriptionnumber]%
- \rawreference\s!num{#2}{\getvalue{showdn\v!sub\v!sub\v!sub\c!number}}}%
-
-\setvalue{\??dd\e!next\v!sub\v!sub\c!number}#1#2%
- {\getvalue{\??dd\s!reset\v!sub\v!sub\v!sub\c!number}{#1}%
- \incrementnumber[\v!sub\v!sub\@@descriptionnumber]%
- \rawreference\s!num{#2}{\getvalue{showdn\v!sub\v!sub\c!number}}}%
-
-\setvalue{\??dd\e!next\v!sub\c!number}#1#2%
- {\getvalue{\??dd\s!reset\v!sub\v!sub\c!number}{#1}%
- \incrementnumber[\v!sub\@@descriptionnumber]%
- \rawreference\s!num{#2}{\getvalue{showdn\v!sub\c!number}}}%
-
-\setvalue{\??dd\e!next\c!number}#1#2%
- {\getvalue{\??dd\s!reset\v!sub\c!number}{#1}%
- \incrementnumber[\@@descriptionnumber]%
- \rawreference\s!num{#2}{\getvalue{showdn\c!number}}}%
-
-\def\dodosetupenumerations[#1][#2]%
- {\getparameters[\??dd#1][#2]%
- \doifdefined{\??dd#1\c!start}
- {\setupnumber[#1][\c!start=\getvalue{\??dd#1\c!start}]}%
- \setupnumber[#1][\c!conversion=\getvalue{\??dd#1\c!conversion}]}
-
-\def\dosetupenumerations[#1][#2]%
- {\ConvertToConstant\doifelse{#2}{}
- {\getparameters[\??dn][#1]}
- {\dodoubleargumentwithset\dodosetupenumerations[#1][#2]}}
-
-\def\setupenumerations
- {\dodoubleempty\dosetupenumerations}
-
-\def\docheckenumerationnumber#1#2#3%
- {\processaction
- [\getvalue{\??dd#2\c!number}]
- [ \v!yes=>\setvalue{\??dd#2\??dd\c!number}{#3},%
- \v!no=>\setvalue{\??dd#2\??dd\c!number}{#3},%
- \v!default=>\setvalue{\??dd#2\??dd\c!number}{#3},%
- \v!unknown=>\letvalue{\??dd#2\??dd\c!number}\commalistelement]}
-
-\def\dododefineenumeration#1#2#3[#4][#5]%
- {\makecounter{\??dd\c!coupling#1}% new: global cross linking
- \dodefinedescription[#3#1]%
- [\c!title=\v!no,\c!level=#3,\c!type=\v!enumeration,\c!list=,%
- \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!titledistance,\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!title,\c!titleleft,\c!titleright,\c!titlecommand,\c!closesymbol,\c!closecommand]%
- \doifassignmentelse{#4}
- {\getparameters[\??dd#3#1]%
- [\c!text=#1,\??dd\c!number=#1,\c!conversion=,\c!listtext=#1\space,
- \c!left=,\c!right=,\c!coupling=,\c!couplingway=\v!local,#4]%
- \docheckenumerationnumber{#1}{#3#1}{#1}}%
- {\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]%
- \docheckenumerationnumber{#1}{#3#1}{#1}}%
- {\copyparameters[\??dd#3#1][\??dd#3#4]
- [\c!location,\c!headstyle,\c!style,\c!color,\c!headcolor,
- \c!width,\c!number,\c!distance,\c!titledistance,\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,
- \c!title,\c!titleleft,\c!titleright,\c!titlecommand,\c!closesymbol,\c!closecommand]%
- \getparameters[\??dd#3#1]
- [\c!text=#1,\??dd\c!number=#4,\c!conversion=,#5]%
- %docheckenumerationnumber{#1}{#3#1}{#4}}}%
- \docheckenumerationnumber{#1}{#3#1}{\getvalue{\??dd#3#4\??dd\c!number}}}}%
- \doifvalue{\??dd#3#1\??dd\c!number}{#1}
- {\definenumber
- [#3#1]
- [\c!way=\descriptionparentparameter\c!way,
- \c!blockway=\descriptionparentparameter\c!blockway,
- \c!conversion=\descriptionparentparameter\c!conversion,
- \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
- \doifvaluesomething{\??dd#3#1\c!list}
- {\definelist[\getvalue{\??dd#3#1\c!type}:\getvalue{\??dd#3#1\c!list}]}% new
- % 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}
-
-\def\dodefineenumeration[#1][#2][#3]%
- {\dododefineenumeration{#1}{1}{}[#2][#3]%
- \dododefineenumeration{#1}{2}{\v!sub}[#2][#3]%
- \dododefineenumeration{#1}{3}{\v!sub\v!sub}[#2][#3]%
- \dododefineenumeration{#1}{4}{\v!sub\v!sub\v!sub}[#2][#3]}
-
-\def\defineenumeration
- {\dotripleemptywithset\dodefineenumeration}
-
-\def\doresetenumerationnumber[#1][#2]% name level
- {\getvalue{\??dd\s!reset#2\c!number}{#1}}%
-
-\def\dosetenumerationnumber[#1][#2]% name level
- {\getvalue{\??dd\s!set#2\c!number}{#1}}%
-
-\def\donextenumerationnumber[#1][#2][#3]% name level reference
- {\pluscounter{\??dd\c!coupling#1}% new: global crosslinking
- \getvalue{\??dd\e!next#2\c!number}{#1}{#3}}%
-
-\def\@@resetdescriptionclosesymbol
- {\global\@EA\settrue\csname\??dd\currentdescription:mrk\endcsname
- \let\placeclosesymbol\@@placedescriptionclosesymbol
- \let\qed \@@placedescriptionclosesymbol}
-
-\def\@@placedescriptionclosesymbol
- {\ifconditional\csname\??dd\currentdescription:mrk\endcsname
- \global\@EA\setfalse\csname\??dd\currentdescription:mrk\endcsname
- \doifsomething{\descriptionparameter\c!closesymbol}{\descriptionparameter\c!closecommand{\descriptionparameter\c!closesymbol}}%
- \fi}
-
-% Het default-mechanisme kan mooier: leegtest, enz.
-%
-% Werkprocedure buiten description
-
-\def\dodosetupindentations[#1][#2]%
- {\getparameters[\??ds#1][#2]}
-
-\def\dosetupindentations[#1][#2]%
- {\ConvertToConstant\doifelse{#2}{}
- {\dodosetupindentations[][#1]}
- {\dodoubleargumentwithset\dodosetupindentations[#1][#2]}}
-
-\def\setupindentations
- {\dodoubleempty\dosetupindentations}
-
-% what to do with this
-
-\def\startdoorspringen
- {\whitespace
- \@@dsbefore
- \dosomebreak\goodbreak % \page[\v!preference]
- \begingroup
- \parskip\zeropoint\relax}
-
-\def\stopdoorspringen
- {\endgroup
- \@@dsafter}
-
-%
-
-\def\dododefineindenting#1#2#3%
- {\par
- \getvalue{\??ds#1\c!before}%
- \begingroup
- \doifvaluenothing{\??ds#1\c!sample}
- {\setvalue{\??ds#1\c!sample}%
- {\getvalue{\??ds#1\c!text}}}%
- \assignwidth
- {\!!widtha}
- {\getvalue{\??ds#1\c!width}}
- {\doattributes
- {\??ds#1}\c!headstyle\c!headcolor
- {\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
- {\doattributes
- {\??ds#1}\c!headstyle\c!headcolor
- {\strut
- \getvalue{\??ds#1\c!text}%
- \hss
- \spr{\getvalue{\??ds#1\c!separator}}%
- \hskip\getvalue{\??ds#1\c!distance}}}%
- \parindent\zeropoint
- \hskip#2\!!widtha\indent\box2%
- \hangindent#3\!!widtha
- \doattributes{\??ds#1}\c!style\c!color\empty
- \AfterPar{\endgroup\getvalue{\??ds#1\c!after}}% must be redone
- \GetPar}
-
-\def\dodefineindenting[#1][#2]%
- {\copyparameters[\??ds#1][\??ds]
- [\c!text,\c!separator,\c!width,\c!style,\c!color,
- \c!headstyle,\c!sample,\c!before,\c!after,\c!distance]%
- \getparameters[\??ds#1][#2]%
- \setvalue {#1}{\dododefineindenting{#1}{0}{1}}%
- \setvalue {\v!sub#1}{\dododefineindenting{#1}{1}{2}}%
- \setvalue{\v!sub\v!sub#1}{\dododefineindenting{#1}{2}{3}}}
-
-\def\defineindenting
- {\dodoubleargumentwithset\dodefineindenting}
-
-\def\definelabel
- {\dodoubleargumentwithset\dodefinelabel}
-
-\def\dodefinelabel[#1][#2]%
- {\definenumber
- [#1]
- [\c!command=,\c!location=,#2]%
- % downward compatible
- \processaction
- [\numberparameter{#1}\c!location]
- [ \v!inmargin=>{\setupnumber[#1][\c!command=\inmargin]},
- \v!inleft=>{\setupnumber[#1][\c!command=\inleft ]},
- \v!inright=>{\setupnumber[#1][\c!command=\inright ]},
- \v!margin=>{\setupnumber[#1][\c!command=\inmargin]}]%
- % generated commands (in addition to the number ones)
- \setvalue {#1}{\dodoubleempty\do@@label[#1]}%
- \setvalue{\s!reset #1}{\resetnumber[#1]}%
- \setvalue{\e!increment#1}{\incrementnumber[#1]}%
- \setvalue{\e!next #1}{\dodoubleempty\do@@nextlabel[#1]}%
- \setvalue{\c!current #1}{\currentnumber[#1]}}
-
-\def\do@@label[#1][#2]%
- {\numberparameter{#1}\c!before
- \numberparameter{#1}\c!command{\doattributes{\@@thenumber{#1}}\c!headstyle\c!headcolor{\getvalue{\e!next#1}[#2]}}%
- \numberparameter{#1}\c!after}%
-
-\def\do@@nextlabel[#1][#2]%
- {\nextnumber[#1][\s!lab][#2]}
-
-\def\currentnumber[#1]% kan tekst hier weg ?
- {\dotextprefix{\numberparameter{#1}\c!text}\sectionnumberonly[#1]}
-
-\def\nextnumber[#1][#2][#3]%
- {\incrementnumber[#1]%
- \currentnumber[#1]%
- \rawreference{#2}{#3}{\composedsectionnumber}}
-
-\setupdescriptions
- [\c!location=\v!left,
- \c!headstyle=\v!bold,
- \c!titlestyle=\v!bold,
- \c!style=\v!normal,
- \c!color=,
- \c!headcolor=,
- \c!titlecolor=,
- \c!width=8em,
- \c!distance=0pt,
- \c!titledistance=0.5em,
- \c!hang=,
- \c!sample=,
- \c!align=,
- \c!margin=\v!no,
- \c!before=\blank,
- \c!inbetween=\blank,
- \c!after=\blank,
- \c!indentnext=\v!yes,
- \c!indenting=\v!never,
- \c!titleleft=(,
- \c!titleright=),
- \c!closesymbol=,
- \c!closecommand=\wordright,
- \c!command=,
- \c!titlecommand=]
-
-\setupenumerations
- [\c!location=\v!top,
- \c!headstyle=\v!bold,
- \c!headcolor=,
- \c!titlestyle=\v!bold,
- \c!titlecolor=,
- \c!style=\v!normal,
- \c!color=,
- \c!width=8em,
- \c!distance=0pt,
- \c!titledistance=0.5em,
- \c!hang=,
- \c!sample=,
- \c!align=,
- \c!margin=\v!no,
- \c!before=\blank,
- \c!inbetween=\blank,
- \c!after=\blank,
- \c!indentnext=\v!yes,
- \c!indenting=\v!never,
- \c!text=,
- \c!levels=3, % to be upward compatible
- \c!conversion=, % to be upward compatible
- \c!way=\v!by\v!text,
- \c!sectionnumber=\v!yes,
- \c!separator=\@@koseparator, % per 2006.06.23, was .
- \c!stopper=,
- \c!titleleft=(,
- \c!titleright=),
- \c!closesymbol=,
- \c!closecommand=\wordright,
- \c!number=,
- \c!command=,
- \c!titlecommand=]
-
-\setupindentations
- [\c!style=\v!normal,
- \c!headstyle=\v!normal,
- \c!color=,
- \c!headcolor=,
- \c!width=\v!fit,
- \c!text=\unknown,
- \c!sample=,
- \c!before=\blank,
- \c!after=\blank,
- \c!distance=1em,
- \c!separator={ :}]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/strc-flt.mkii b/Master/texmf-dist/tex/context/base/mkii/strc-flt.mkii
deleted file mode 100644
index 26125c65f96..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/strc-flt.mkii
+++ /dev/null
@@ -1,2173 +0,0 @@
-%D \module
-%D [ file=strc-flt,
-%D version=2000.10.20,
-%D title=\CONTEXT\ Structure Macros,
-%D subtitle=Floating Bodies,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Structure Macros / Float Numbering}
-
-%D Some of the sidefloat settings should move to page-sid; now it's quite
-%D fuzzy the way the variables are set/reset.
-
-\unprotect
-
-\ifx\addlocalbackgroundtobox\undefined \def\addlocalbackgroundtobox{\resetglobal\gobbleoneargument} \fi
-
-\def\placefloats{\doflushfloats} % keep this one
-
-\def\floatparameter #1{\csname\??fl\currentfloat#1\endcsname}
-\def\floatcaptionparameter#1{\csname\??kj\currentfloat#1\endcsname}
-
-% \def\floatparameter #1{\csname \ifcsname\??fl\currentfloat#1\endcsname\??fl\currentfloat\else\??bk\fi#1\endcsname}
-% \def\floatcaptionparameter#1{\csname\??kj\ifcsname\??kj\currentfloat#1\endcsname \currentfloat \fi#1\endcsname}
-
-% for the moment we need to define the parameters anyway, first we need to implement a
-% proper parent chain (also for framed); no problem now that machines are fast (tests
-% show that this may save 20 k or more in the format)
-%
-% \def\floatparameter #1{\executeifdefined{\??fl\currentfloat#1}{\csname\??fl#1\endcsname}}
-% \def\floatcaptionparameter#1{\executeifdefined{\??kj\currentfloat#1}{\csname\??bk#1\endcsname}}
-
-\def\setupfloats
- {\dodoubleargument\getparameters[\??bk]} % funny, why not \??fl, must be a reason
-
-\def\setupcaptions
- {\dodoubleargument\getparameters[\??kj]}
-
-\def\dosetupfloat[#1][#2]%
- {\def\docommand##1{\getparameters[\??fl##1][#2]}%
- \processcommalist[#1]\docommand}
-
-\def\setupfloat
- {\dodoubleargument\dosetupfloat}
-
-\def\dosetupcaption[#1][#2]%
- {\def\docommand##1{\getparameters[\??kj##1][#2]}%
- \processcommalist[#1]\docommand}
-
-\def\setupcaption
- {\dodoubleargument\dosetupcaption}
-
-\def\doemptyblock#1%
- {\localframed
- [\??fl#1]
- [\c!frame=\v!on,
- \c!width=\@@bkwidth,
- \c!height=\@@bkheight,
- \c!location=\v!normal,
- \c!offset=\@@bkoffset]%
- {\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.
-% Therefore we may not trust on variable assignments before
-% we're realy dealing with the float. Some day I'll root out
-% the global settings.
-
-\def\docomplexplacefloat[#1][#2]% [#3]#4%
- {\edef\currentfloat{#1}%
- \doifelsenothing\currentfloat
- {\let\currentfloat\v!figure}
- {}% {\doifundefined{\??fl#1\c!default}{\let\currentfloat\v!figure}}%
- \doifelsenothing{#2}
- {\edef\floatlocation{\floatparameter\c!default}}
- {\edef\floatlocation{#2}}%
- \doifinsetelse\v!split{#2}
- {\expanded{\dodocomplexsplitfloat[\currentfloat][\floatlocation]}}
- {\expanded{\dodocomplexplacefloat[\currentfloat][\floatlocation]}}}
-
-\long\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
-
-\long\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
- \doifinset\v!margin{#2}\endgraf
- \fi
- \global\insidefloattrue
- \begingroup % **
- \ifmargeblokken
- \doifinset\v!margin{#2}{\hsize\@@mbwidth}%
- \fi
- \the\everyinsidefloat
- \let\@@extrafloat\empty
- \presetmorefloatvariables{#2}%
- \dowithnextboxcontent % better a \the\everyfloattoks
- {\setlocalfloathsize
- \floatparameter\c!inner
- \fuzzysnappingfalse
- \postponenotes} % new
- {\doifsomething{\floatparameter\c!criterium}
- {\ifdim\wd\nextbox>\floatparameter\c!criterium\relax
- \edef\forcedfloatmethod{\executeifdefined{\??fl\currentfloat\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
- \global\sidefloatextrashift\zeropoint
- \ifparfloat
- \doifinset\v!reset{#2}\forgetsidefloats
- \doinhibitblank
- \fi}% better move this to side floats
- \vbox}
-
-\def\xxdocompletefloat#1#2%
- {\rightorleftpageaction{\let\@@extrafloat#1}{\let\@@extrafloat#2}}
-
-\chardef\textfloatmethod=0 % 0=raw 1=safe (.99) 2=tight (-1pt)
-\chardef\sidefloatmethod=1 % 0=raw 1=safe (.99) 2=tight (-1pt)
-
-\let\floatrotation\!!zerocount
-
-\long\def\presetfloatvariables#1#2#3#4%
- {\doifcommonelse
- {#2}
- {\v!left,\v!right,\v!inner,\v!outer,%
- \v!inleft,\v!inright,\v!inmargin,%
- \v!backspace,\v!cutspace,%
- \v!innermargin,\v!outermargin,\v!inneredge,\v!outeredge,%
- \v!leftmargin,\v!leftedge,\v!rightmargin,\v!rightedge}
- {\global\parfloattrue}
- {\global\parfloatfalse}%
- \ifinsidecolumns
- \global\parfloatfalse
- \fi
- \global\sidefloatshift\zeropoint
- \global\sidefloatmaximum\zeropoint
- \global\chardef\sidefloatmethod\floatparameter\c!sidemethod
- \global\chardef\textfloatmethod\floatparameter\c!textmethod
- \global\chardef\sidefloatalign\zerocount
- \globallet\floatrotation\!!zerocount
- \calculatefloatskips
- \ifparfloat
- \processaction
- [\floatparameter\c!sidealign]
- [\v!height=>\global\chardef\sidefloatalign\plusone,%
- \v!line=>\global\chardef\sidefloatalign\plustwo,% (***)
- \v!depth=>\global\chardef\sidefloatalign\plusthree,%
- \v!grid=>\global\chardef\sidefloatalign4,%
- \v!halfline=>\global\chardef\sidefloatalign5]%
-% todo (test first): \doifinset\v!lokaal{#2}{\chardef\sidefloatalign\zerocount}%
- \ifcase\sidefloatalign\relax % todo: optie v!lokaal => \else
- \doifinset\v!height {#2}{\global\chardef\sidefloatalign\plusone}%
- \doifinset\v!line {#2}{\global\chardef\sidefloatalign\plustwo}%
- \doifinset\v!depth {#2}{\global\chardef\sidefloatalign\plusthree}%
- \doifinset\v!grid {#2}{\global\chardef\sidefloatalign4}%
- \doifinset\v!halfline{#2}{\global\chardef\sidefloatalign5}% meant for 'none'
- \fi
- \doifinset\v!high{#2}{\global\sidefloattopskip \zeropoint}%
- \doifinset\v!low {#2}{\global\sidefloatbottomskip\zeropoint}%
- \doifinset\v!fit {#2}
- {\global\sidefloattopskip \zeropoint
- \global\sidefloatbottomskip\zeropoint
- \global\floatsideskip \zeropoint}%
- \else
- \processallactionsinset
- [#2]
- [ 90=>\globallet\floatrotation\commalistelement,%
- 180=>\globallet\floatrotation\commalistelement,%
- 270=>\globallet\floatrotation\commalistelement]%
- \fi
- \doifinsetelse\v!nonumber{#2}
- {\global\nofloatnumbertrue}
- {\doifelse{\floatcaptionparameter\c!number}\v!yes
- {\global\nofloatnumberfalse}
- {\global\nofloatnumbertrue}}%
- \ConvertToConstant\doifelse{#4}{}
- {\global\emptyfloatcaptiontrue}
- {\global\emptyfloatcaptionfalse}%
- \doifinsetelse\v!none{#2}
- {\global\nofloatcaptiontrue}
- {\ConvertToConstant\doifelse{#4}\v!none
- {\global\nofloatcaptiontrue}
- {\global\nofloatcaptionfalse}}%
- \doif{\floatcaptionparameter\c!number}\v!none % new
- {\global\nofloatcaptiontrue}%
- \ifemptyfloatcaption \ifnofloatnumber
- \global\nofloatcaptiontrue
- \fi \fi}
-
-% documenteren in details
-
-\def\presetmorefloatvariables#1%
- {\doifelse\@@bklocal\v!yes % fout keyword
- \globalcenterfloatboxtrue
- \globalcenterfloatboxfalse
- \ifglobalcenterfloatbox
- \localcenterfloatboxtrue
- \else
- \doifinsetelse\v!local{#1}
- \localcenterfloatboxtrue
- \localcenterfloatboxfalse
- \fi
- \doifnotcommon{\v!always,\v!here,\v!force}{#1} % ! ! ! ! ! !
- {\globalcenterfloatboxfalse
- \localcenterfloatboxfalse}}
-
-\def\setlocalfloathsize
- {\iflocalcenterfloatbox
- \seteffectivehsize
- \hsize\localhsize
- \fi}
-
-\appendtoks
- \everyinsidefloat\emptytoks % in case it's called earlier
- \dogetfloatdata
-\to \everyinsidefloat
-
-%\appendtoks
-% \fuzzysnappingfalse
-%\to \everyinsidefloat
-
-\def\doifrightpagefloatelse
- {\ifdoublesided
- \ifsinglesided
- \@EAEAEA\firstoftwoarguments
- \else
- \@EAEAEA\doifoddfloatpageelse
- \fi
- \else
- \@EA\firstoftwoarguments
- \fi}
-
-\def\doifoddfloatpageelse
- {\ifodd\purenumber\twopassfloatdata\space
- \@EA\firstoftwoarguments
- \else
- \@EA\secondoftwoarguments
- \fi}
-
-\appendtoks
- \let\rightorleftpageaction\doifrightpagefloatelse
-\to \everyinsidefloat
-
-\newif\ifextrafloatactions \extrafloatactionstrue
-
-% \let\movesidefloat\gobbleoneargument
-
-% new : \place...[leftmargin,-2*line]; we need to catch fxtb:2*3
-% watch out: line alone aligns on the line ! ! !
-
-\def\movesidefloat[#1]% (-)n*line|x=,y=
- {\global\sidefloatdownshift \zeropoint
- \global\sidefloatextrashift\zeropoint
- \doifassignmentelse{#1}%
- {\bgroup
- \getparameters[\??fl][\c!x=\zeropoint,\c!y=\zeropoint,#1]%
- \ifgridsnapping
- \getnoflines\@@fly
- \global\sidefloatdownshift\noflines\lineheight
- \else
- \global\sidefloatdownshift\@@fly
- \fi
- \global\sidefloatextrashift\@@flx
- \egroup}
- {\movedownsidefloat[#1]}}
-
-\def\movedownsidefloat[#1]% already in core
- {\bgroup
- \cleanupfeatures
- \doifinstringelse{:}{#1}
- \donothing
- {\def\docommand##1%
- {\processaction
- [##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}%
- \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]%
- {\global\sidefloatsidelines#1\relax}
-
-\long\def\xdocompletefloat#1#2#3#4#5#6%
- {\ifextrafloatactions
- \doifinsetelse\v!text{#4}
- {% fuzzy, text overloads left, since then it's a directive
- \docompletefloat{#1}{#2}{#3}{#4}{#5}{#6}\nextbox}
- {\let\@@extrafloat\empty
- % \sidefloatdownshift will be reset afterwards, and can
- % 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!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!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
- \else
- \docompletefloat{#1}{#2}{#3}{\@@extrafloat,#4}{#5}{#6}\nextbox
- \fi}%
- \else % downward compatible
- \docompletefloat{#1}{#2}{#3}{#4}{#5}{#6}\nextbox
- \fi}
-
-% pas op, maxbreedte niet instellen als plaats=links/rechts
-
-\def\setlocalfloatdimensions#1%
- {\global\sidefloatshift \zeropoint % duplicate
- \global\sidefloatmaximum\zeropoint\relax % duplicate
- \ifextrafloatactions
- \ifdim\sidefloatdownshift=\zeropoint\else
- \global\setbox\floatbox\vbox
- {\vskip\sidefloatdownshift\nointerlineskip\box\floatbox}%
- \fi
- \doifsomething{\floatparameter\c!minwidth}
- {\scratchdimen\floatparameter\c!minwidth\relax
- \ifdim\wd\floatbox<\scratchdimen
- \global\setbox\floatbox\hbox to \scratchdimen
- {\doifnot{\floatparameter\c!location}\v!left \hss
- \box\floatbox%
- \doifnot{\floatparameter\c!location}\v!right\hss}%
- \fi}%
- % todo: rand / rug
- \doifinset\v!hanging{#1}
- {\doifcommonelse{\v!inleft,\v!leftmargin}{#1}
- {\letvalue{\??fl\currentfloat\c!maxwidth}\leftmarginwidth}%
- {\doifcommon{\v!inright,\v!rightmargin}{#1}
- {\letvalue{\??fl\currentfloat\c!maxwidth}\rightmarginwidth}}}%
- \doifsomething{\floatparameter\c!maxwidth}
- {\scratchdimen\floatparameter\c!maxwidth\relax
- \ifdim\wd\floatbox>\scratchdimen
- \doifcommonelse{\v!inright,\v!rightmargin,\v!rightedge
- \v!inleft,\v!leftmargin,\v!leftedge}{#1}
- {\global\sidefloatmaximum\scratchdimen}
- {\global\setbox\floatbox\hbox to \scratchdimen
- {\doifcommonelse{\v!right,\v!left}{#1}
- {\doifnotinset\v!right{#1}\hss
- \box\floatbox
- \doifnotinset\v!left{#1}\hss}%
- {\doifnot{\floatparameter\c!location}\v!left\hss
- \box\floatbox
- \doifnot{\floatparameter\c!location}\v!right\hss}}}%
- \fi}%
- \fi}
-
-\def\docomplexstarttextblock[#1][#2][#3]%
- {\flushnotes
- \flushsidefloats % hoort eigenlijk niet hier
- \docomplexplacefloat[#1][\v!text,#2,\v!left][#3]}
-
-\long\def\docomplexreserveblock[#1][#2][#3][#4]#5%
- {\getvalue{\e!place#1}[#3][#4]{#5}{\localframed[\??fl#1][#2]{#1}}}
-
-\def\docomplexstartreservetextblock[#1][#2][#3][#4]%
- {\flushsidefloats % hoort eigenlijk niet hier
- \docomplexreserveblock[#1][#2][\v!text,#3,\v!left][#4]}
-
-\def\definefloat
- {\dotripleempty\dodefinefloat}
-
-\def\dodefinefloat[#1][#2][#3]% #1=naam #2=meervoud #3=parent
- {\ifthirdargument
- \redodefinefloat[#1][#2][#3]%
- \else\ifsecondargument
- \dododefinefloat[#1][#2]%
- \else
- \dododefinefloat[#1][#1]%
- \fi\fi}
-
-% todo: \floatparameter + \currentfloat - saves many hash entries
-
-\def\dododefinefloat[#1][#2]% inherits from kj and not from parent
- {\def\currentfloat{#1}%
- \presetlocalframed[\??fl#1]%
- \setupfloat
- [#1]
- [%\c!width=8\lineheight, % 15\bodyfontsize,
- %\c!height=6\lineheight, % 10\bodyfontsize,
- \c!offset=\v!overlay,
- \c!width=\v!fit,
- \c!height=\v!fit,
- \c!minwidth=,
- \c!maxwidth=,
- \c!maxheight=,
- \c!criterium=,
- % inherited
- \c!sidespacebefore=\@@bksidespacebefore,
- \c!sidespaceafter=\@@bksidespaceafter,
- \c!sidealign=\@@bksidealign, % \v!line
- \c!margin=\@@bkmargin,
- \c!leftmargin=\@@bkleftmargin,
- \c!rightmargin=\@@bkrightmargin,
- \c!innermargin=\@@bkinnermargin,
- \c!outermargin=\@@bkoutermargin,
- \c!leftmargindistance=\@@bkleftmargindistance,
- \c!rightmargindistance=\@@bkrightmargindistance,
- \c!frame=\@@bkframe,
- \c!radius=\@@bkradius,
- \c!corner=\@@bkcorner,
- \c!location=\@@bklocation,
- \c!background=\@@bkbackground,
- \c!backgroundscreen=\@@bkbackgroundscreen,
- \c!backgroundcolor=\@@bkbackgroundcolor,
- \c!backgroundoffset=\@@bkbackgroundoffset,
- \c!topframe=\@@bktopframe,
- \c!bottomframe=\@@bkbottomframe,
- \c!leftframe=\@@bkleftframe,
- \c!rightframe=\@@bkrightframe,
- \c!frameoffset=\@@bkframeoffset,
- \c!framecolor=\@@bkframecolor,
- %\c!local=\@@bklocal,
- \c!textmethod=\@@bktextmethod,
- \c!sidemethod=\@@bksidemethod,
- \c!method=\@@bkmethod,
- \c!pageboundaries=,
- \c!default=]%
- \setupcaption
- [#1]
- [\c!headstyle=\@@kjheadstyle,
- \c!headcolor=\@@kjheadcolor,
- \c!textstyle=\@@kjtextstyle,
- \c!textcolor=\@@kjtextcolor,
- \c!style=\@@kjstyle,
- \c!color=\@@kjcolor,
- \c!location=\@@kjlocation,
- \c!grid=\@@kjgrid,
- %\c!before=\@@kjbefore,
- \c!inbetween=\@@kjinbetween,
- %\c!after=\@@kjafter,
- \c!spacebefore=\@@kjspacebefore,
- \c!spaceinbetween=\@@kjspaceinbetween,
- \c!spaceafter=\@@kjspaceafter,
- \c!width=\@@kjwidth,
- \c!minwidth=\@@kjminwidth,
- \c!align=\@@kjalign,
- \c!number=\@@kjnumber,
- \c!way=\@@kjway,
- \c!blockway=\@@kjblockway,
- \c!sectionnumber=\@@kjsectionnumber,
- \c!distance=\@@kjdistance,
- \c!separator=\@@kjseparator,
- \c!stopper=\@@kjstopper,
- \c!suffix=\@@kjsuffix, % hook
- \c!command=\@@kjcommand,
- \c!conversion=\@@kjconversion,
- \c!leftmargin=\@@kjleftmargin,
- \c!rightmargin=\@@kjrightmargin,
- \c!outermargin=\@@kjoutermargin,
- \c!innermargin=\@@kjinnermargin,
- \c!setups=\@@kjsetups,
- ]%
- \definenumber % \definelabel
- [#1]
- [\c!text=#1,
- \c!location=\v!intext,
- \c!way=\floatcaptionparameter\c!way,
- \c!blockway=\floatcaptionparameter\c!blockway,
- \c!sectionnumber=\floatcaptionparameter\c!sectionnumber,
- \c!conversion=\floatcaptionparameter\c!conversion]%
- \presetlabeltext[#1=\Word{#1}~]%
- \newnodelocation{\v!float\@@thenumber{#1}}%
- \dodefinefloatcommands[#1][#2]}
-
-\def\dodefinefloatcommands[#1][#2]%
- {\definelist[#1]%
- \presetheadtext[#2=\Word{#2}]%
- \setvalue {\e!place\e!listof#2}{\dodoubleempty\doplacelist[#1]}%
- \setvalue {\e!complete\e!listof#2}{\dotripleempty\dodocompletelist[#1][#2]}%
- \setvalue {\e!place#1}{\dotripleempty\docomplexplacefloat[#1]}%
- \setvalue {\e!reserve#1}{\doquadrupleempty\docomplexreserveblock[#1]}%
- \setvalue {\e!start#1\e!text}{\dotripleempty\docomplexstarttextblock[#1]}%
- \setvalue {\e!stop#1\e!text}{\dostoptextfloat}%
- \setvalue{\e!start\e!reserve#1\e!text}{\doquadrupleempty\docomplexstartreservetextblock[#1]}%
- \setvalue {\e!stop\e!reserve#1\e!text}{\dostoptextfloat}}
-
-% \setupfloat[...][leftmargindistance=1cm,default={left,none}]
-
-\def\redodefinefloat[#1][#2][#3]% same label/number
- {\presetlocalframed[\??fl#1]%
- \copylocalframed[\??fl#1][\??fl#3]%
- \copyparameters[\??fl#1][\??fl#3]
- [\c!width,\c!height,%\c!local,
- \c!maxwidth,\c!maxheight,\c!minwidth,
- \c!margin,\c!sidespacebefore,\c!sidespaceafter,\c!sidealign,
- \c!leftmargindistance,\c!rightmargindistance,\c!criterium,
- \c!leftmargin,\c!rightmargin,\c!innermargin,\c!outermargin,
- \c!frame,\c!radius,\c!corner,\c!location,\c!background,\c!framecolor,
- \c!backgroundscreen,\c!backgroundcolor,\c!backgroundoffset,
- \c!topframe,\c!bottomframe,\c!leftframe,\c!rightframe,
- \c!frameoffset,\c!pageboundaries,\c!default,
- \c!textmethod,\c!sidemethod,\c!method]%
- \copyparameters[\??kj#1][\??kj#3]
- [\c!location,\c!before,\c!inbetween,\c!after,
- \c!spacebefore,\c!spaceinbetween,\c!spaceafter,
- \c!width,\c!headstyle,\c!headcolor,\c!style,\c!color,
- \c!textstyle,\c!textcolor,\c!minwidth,
- \c!leftmargin,\c!rightmargin,\c!innermargin,\c!outermargin,
- \c!align,\c!number,\c!way,\c!blockway,\c!setups,
- \c!sectionnumber,\c!separator,\c!stopper,\c!suffix,\c!distance,\c!conversion]%
- \definenumber[#1][#3]%
- \presetlabeltext[#1=\labeltext{#3}]%
- \dodefinefloatcommands[#1][#2]}
-
-\def\placefloat
- {\dotripleempty\docomplexplacefloat}
-
-\installinsertion\topins
-\installinsertion\botins
-
-\newdimen\botinserted
-\newdimen\topinserted
-
-%D Extra float registers.
-
-\newif\ifsomefloatwaiting \somefloatwaitingfalse
-\newif\ifroomforfloat \roomforfloattrue
-\newif\ifnofloatpermitted \nofloatpermittedfalse
-
-\newcount\totalnoffloats \totalnoffloats =0
-\newcount\savednoffloats \savednoffloats =0
-\newcount\noffloatinserts \noffloatinserts=0
-
-\newbox\floatlist
-\newbox\savedfloatlist
-
-\newif\ifflushingfloats \flushingfloatsfalse
-
-\newbox\floattext
-
-\newdimen\floattextwidth
-\newdimen\floattextheight
-
-\newbox\floatbox
-\newbox\savedfloatbox
-
-\newdimen\floatwidth
-\newdimen\floatheight
-
-% the tricky part of getting float related two pass data is
-% that we should fetch is early but can only save it with
-% the composed float box; this determines the order: get it
-% before saving it
-
-\definetwopasslist{\s!float\s!data} \newcounter\noffloatdata
-
-\let\twopassfloatdata\realpageno
-
-\def\dosavefloatdata % \expanded
- {\doglobal\increment\noffloatdata
- \lazysavetaggedtwopassdata{\s!float\s!data}{\noffloatdata}{\noffloatpages}{\noexpand\realfolio}}% later {}{}{}{} and \getfirst...
-
-\def\dogetfloatdata % precedes save !
- {\doglobal\increment\noffloatpages
- \findtwopassdata{\s!float\s!data}{\noffloatpages}%
- \iftwopassdatafound
- \globallet\twopassfloatdata\twopassdata
- \else
- \globallet\twopassfloatdata\realpageno % \realfolio
- \fi}
-
-\def\tracefloatnumber#1%
- {\doifnot\@@bknumbering\v!nocheck{\tagnodelocation{\v!float\@@thenumber{#1}}}}
-
-\newconditional\retainfloatnumber
-
-\def\preparefloatnumber#1%
- {\xdef\floatcaptionnumber{#1}%
- \doifelsenodelocation{\v!float\@@thenumber{#1}}
- \donothing {\chardef\nodelocationmode\zerocount}%
- \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
- \nextnodelocation{\v!float\@@thenumber{#1}}% better \nextfloatnumber
- \analyzenodelocation{\v!float\@@thenumber{#1}}%
- \scratchcounter\getnodelocationo{\v!float\@@thenumber{#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
-% melding in de marge volgt: \ifinner is dan namelijk true.
-
-\def\dofloatinfomessage#1#2#3%
- {\bgroup
- \showmessage\m!floatblocks{#2}{#3}%
- \setmessagetext\m!floatblocks{#2}%
- \@EA\floatinfo\@EA#1\@EA{\currentmessagetext}%
- \egroup}
-
-\def\dosavefloatinfo
- {\dofloatinfomessage>2{\the\totalnoffloats}}
-
-\def\dofloatflushedinfo
- {\bgroup
- \!!counta\totalnoffloats
- \advance\!!counta -\savednoffloats
- \dofloatinfomessage<3{\the\!!counta}%
- \egroup}
-
-\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 !
- % retain special alignments
- \ifinsidecolumns
- \ifdim\wd\floatbox>\makeupwidth
- \wd\floatbox\makeupwidth
- \fi
- \fi
- \fi
- \else
- \setbox\floatbox\box\globalscratchbox % local !
- \fi
- \global\advance\savednoffloats \minusone
- \ifcase\savednoffloats
- \global\somefloatwaitingfalse
- \fi
- \else
- \global\savednoffloats\zerocount
- \global\setbox\floatbox\emptybox
- \fi}
-
-\def\uncenteredfloatbox
- {\ifcenterfloatbox
- \ifhbox\floatbox\relax % remove centering
- \ifdim\wd\floatbox=\hsize
- \ifhbox\floatbox
- \setbox\scratchbox\hbox
- {\unhbox\floatbox
- \unskip\unskip
- \global\setbox\globalscratchbox\lastbox}%
- \box\globalscratchbox
- \else
- \box\floatbox
- \fi
- \else
- \box\floatbox
- \fi
- \else
- \box\floatbox
- \fi
- \else
- \box\floatbox
- \fi}
-
-\def\dosavefloat
- {\global\setbox\floatlist\vbox
- {\nointerlineskip
- \uncenteredfloatbox
- \unvbox\floatlist}%
- \global\advance\savednoffloats \plusone
- \global\somefloatwaitingtrue
- \dosavefloatinfo
- \nonoindentation}
-
-\def\doresavefloat
- {\global\setbox\floatlist\vbox
- {\nointerlineskip
- \unvbox\floatlist
- \uncenteredfloatbox}%
- \global\advance\savednoffloats \plusone
- \global\somefloatwaitingtrue}
-
-\def\doreversesavefloat
- {\global\setbox\floatlist\vbox
- {\nointerlineskip
- \unvbox\floatlist
- \uncenteredfloatbox}%
- \global\advance\savednoffloats \plusone
- \global\somefloatwaitingtrue
- \dosavefloatinfo}
-
-% better (todo): \savednofsavedfloats
-
-\def\dosavefloatstatus
- {\global\setbox\savedfloatlist\copy\floatlist
- \global\setbox\savedfloatbox \copy\floatbox
- \xdef\dorestorefloatstatus
- {\global\setbox\floatlist\box\savedfloatlist
- \global\setbox\floatbox \box\savedfloatbox
- \global\savednoffloats\the\savednoffloats}}
-
-\let\dorestorefloatstatus\relax
-
-\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
-\newif\iflocalcenterfloatbox \localcenterfloatboxfalse
-\newif\ifglobalcenterfloatbox \globalcenterfloatboxfalse
-
-% beter de laatste skip buiten de \insert uitvoeren,
-% bovendien bij volle flush onder baseline.
-
-\def\betweenfloatblanko% assumes that \@@bkspaceafter is present
- {\bgroup
- \setbox0\vbox{\strut\blank[\@@bkspacebefore]\strut}%
- \setbox2\vbox{\strut\blank[\@@bkspaceafter ]\strut}%
- \ifdim\ht0>\ht2
- \blank[-\@@bkspaceafter,\@@bkspacebefore]%
- \fi
- \egroup}
-
-\def\doplacefloatbox
- {%\forgetall % NJET!
- \whitespace
- \blank[\@@bkspacebefore]
- \flushfloatbox
- \blank[\@@bkspaceafter]}
-
-\ifx\someherefloat\undefined \let\someherefloat\doplacefloatbox \fi
-\ifx\somefixdfloat\undefined \let\somefixdfloat\doplacefloatbox \fi
-\ifx\somepagefloat\undefined \let\somepagefloat\doplacefloatbox \fi
-\ifx\sometopsfloat\undefined \let\sometopsfloat\doplacefloatbox \fi
-\ifx\somebotsfloat\undefined \let\somebotsfloat\doplacefloatbox \fi
-
-\ifx\somesidefloat\undefined \let\somesidefloat\doplacefloatbox \fi
-\ifx\somefacefloat\undefined \let\somefacefloat\doplacefloatbox \fi
-\ifx\sometextfloat\undefined \let\sometextfloat\doplacefloatbox \fi
-
-% brr, wordt deze niet overladen in page-one? weg er mee
-
-% \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}%
- \gdef\dostoptextfloat{\dodostoptextfloat[#1]}% brr global
- \global\floattextwidth\hsize
- \global\floatwidth\wd\floatbox
- \global\floatheight\ht\floatbox % forget about the depth
- \global\advance\floattextwidth -\floatwidth
- \global\advance\floattextwidth -\@@bkmargin\relax % was \tfskipsize
- \doifinsetelse\v!tall{#1}
- {\floattextheight\pagegoal
- \advance\floattextheight -\pagetotal
- \advance\floattextheight -\bigskipamount % lelijk
- \ifdim\floattextheight>\textheight
- \floattextheight\textheight
- \fi
- \boxmaxdepth\zeropoint \relax % toegevoegd
- \ifdim\floattextheight<\floatheight
- \floattextheight\floatheight
- \fi
- \setbox\floattext\vbox to \floattextheight}
- {\setbox\floattext\vbox}%
- \bgroup
- \forgetall \setupblank \setupwhitespace % new, also needed for footnotes
- \blank[\v!disable]
- \hsize\floattextwidth
- \ignorespaces}
-
-\def\dodostoptextfloat[#1]% % de tekst kan beter in een soort
- {\egroup % kadertekst zonder kader, is flexibeler
- \doifnotinset\v!tall{#1}% en beter
- {\ifdim\ht\floattext<\floatheight
- \floattextheight\floatheight
- \else
- \floattextheight\ht\floattext
- \fi}%
- \setbox\floatbox\vbox to \floattextheight
- {\hsize\floatwidth
- \doifinsetelse\v!both{#1}%
- {\doifinsetelse\v!low{#1}
- {\vfill\box\floatbox}
- {\doifinsetelse\v!middle{#1}
- {\vfill\box\floatbox\vfill}
- {\box\floatbox\vfill}}}
- {\box\floatbox\vfill}}%
- \setbox\floattext\vbox to \floattextheight
- {\hsize\floattextwidth
- \doifinsetelse\v!low{#1}
- {\vfill
- \box\floattext
- \doifinset\c!offset{#1}{\whitespace\blank}}
- {\doifinsetelse\v!middle{#1}
- {\vfill
- \box\floattext
- \vfill}
- {\doifinset\v!offset{#1}{\whitespace\blank}%
- \box\floattext
- \vfill}}}%
- \doifinsetelse\v!right{#1}% \floatmethod
- {\setbox\floatbox\hbox to \hsize
- {\box\floattext
- \hfill
- \box\floatbox}}
- {\setbox\floatbox\hbox to \hsize
- {\box\floatbox
- \hfill
- \box\floattext}}%
- \baselinecorrection
- \whitespace
- \blank[\@@bkspacebefore]%
- \doifnotinset\v!tall{#1}%
- {\dp\floatbox\openstrutdepth}% dp\strutbox}% % toegevoegd
- \box\floatbox
- \blank[\@@bkspaceafter]%
- \endgroup % **
- \doinsertfloatinfo}
-
-\def\somefacefloat[#1]% links, rechts, midden, hoog, midden, laag
- {%\checkwaitingfloats{#1}%
- \startopposite\box\floatbox\stopopposite
- \doinsertfloatinfo}
-
-\def\someelsefloat[#1]%
- {\doifinsetelse\v!here{#1}
- {\doifinsetelse\v!always{#1}
- {\page[\v!preference]%
- \docheckiffloatfits
- \ifroomforfloat
- \placesomeherefloat[#1]%
- \else
- \showmessage\m!floatblocks9\empty
- \doreversesavefloat
- \fi}
- {\ifsomefloatwaiting
- \dosavefloat
- \else
- \page[\v!preference]%
- \docheckiffloatfits
- \ifroomforfloat
- \placesomeherefloat[#1]%
- \else
- \dosavefloat
- \fi
- \fi}}
- {\doifinsetelse\v!always{#1}
- {\docheckiffloatfits
- \ifroomforfloat
- \sometopbottomfloat[#1]
- \else
- \showmessage\m!floatblocks9\empty
- \doreversesavefloat
- \fi}
- {\docheckiffloatfits
- \ifroomforfloat
- \sometopbottomfloat[#1]
- \else
- \dosavefloat
- \fi}}}
-
-\def\floatautofactor{.5}
-
-\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
-% meer).
-%
-% \dofloat {plaats} {label1} {label2}
-%
-% \docompletefloat {nummer} {referentie} {lijst}
-% {plaats} {label1} {label2} {inhoud}
-%
-% \box\floatbox inhoud+referentie
-%
-% \do???float#1 #1 = boxnummer
-
-\newdimen\floatsideskip \floatsideskip =12pt
-\newdimen\floattopskip \floattopskip =\floattopskip
-\newdimen\floatbottomskip \floatbottomskip=\floattopskip
-
-\newdimen\sidefloattopskip \sidefloattopskip =\floattopskip
-\newdimen\sidefloatbottomskip \sidefloatbottomskip=\floatbottomskip
-
-\newskip\sidefloatdownshift
-\newskip\sidefloatleftshift
-\newskip\sidefloatrightshift
-
-\def\sidefloattopoffset {\openstrutdepth} % {\strutdp}
-
-\newcount\noftopfloats \noftopfloats=2
-\newcount\nofbotfloats \nofbotfloats=0
-
-\newif\ifnofloatcaption
-\newif\ifnofloatnumber
-\newif\ifemptyfloatcaption
-
-\def\docalculatefloatskip#1#2%
- {\doifelsenothing{#2}
- {\global#1\zeropoint}
- {\doifelse{#2}\v!none
- {\global#1\zeropoint}
- {\setbox0\vbox{\whitespace\expanded{\blank[#2]}}%
- \global#1\ht0}}}
-
-\def\calculatefloatskips
- {{\docalculatefloatskip\floattopskip \@@bkspacebefore
- \docalculatefloatskip\floatbottomskip \@@bkspaceafter
- \docalculatefloatskip\sidefloattopskip {\floatparameter\c!sidespacebefore}%
- \docalculatefloatskip\sidefloatbottomskip{\floatparameter\c!sidespaceafter }%
- \gdef \sidefloattopoffset{\openstrutdepth}% was \def
- \global\floatsideskip \floatparameter\c!margin
- \global\sidefloatleftshift \floatparameter\c!leftmargindistance
- \global\sidefloatrightshift\floatparameter\c!rightmargindistance
- \global\noftopfloats \@@bkntop \relax
- \global\nofbotfloats \@@bknbottom\relax}}
-
-\let\floatcaptionsuffix\empty % an optional suffix
-\let\floatcaptionnumber\empty % a logical counter
-
-% Quite experimental !
-
-% the split is needed when for instance the float goes into
-% a multi page field and the list of figs becomes larger than
-% one page: cycle between 'only flush when object ref ok'
-% and 'one/many page fig list'; see "uguide finometer"
-%
-% potential sync bug with sectionblocks, see uguide.tex
-
-\def\placefloatcaption
- {\dodoubleempty\doplacefloatcaption}
-
-\long\def\doplacefloatcaption[#1][#2]#3%
- {\setfloatcaption[#1][#2]{#3}%
- \placefloatcaptiontext[#1]%
- \placefloatcaptionreference[#1]}
-
-\def\setfloatcaption % \dosetfloatcaption already in use
- {\dodoubleempty\dodosetfloatcaption} % beware, name clash
-
-\long\def\dodosetfloatcaption[#1][#2]#3% to do namespace for number/ascii
- {\ifnofloatnumber % also handle trialtypesetting
- \letgvalue{@fl@r@#1}\relax
- \letgvalue{@fl@t@#1}\relax
- \else
- \preparefloatnumber{#1}%
- \letgvalue{@fl@n@#1}\composedsectionnumber
- % indirect macro can be more efficient
- \setgvalue{@fl@r@#1}%
- {\tracefloatnumber{#1}%
-\ifconditional\retainfloatnumber\else
- \dowritetolist{#1}{\getvalue{@fl@n@#1}}{#3}{#1}%
- \gdefconvertedargument\flasciititle{#3}% \asciititle is global
- \doifsomething{#2}{\rawreference\s!flt{#2}{{\getvalue{@fl@n@#1}}{\flasciititle}}}%
-\fi
- \letgvalue{@fl@r@#1}\relax}% nils
- \setgvalue{@fl@t@#1}%
- {\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}}%
- \doattributes{\??kj#1}\c!textstyle\c!textcolor
- {\dotfskip{\floatcaptionparameter\c!distance}#3}}}%
- \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
-
-\let\placefloatlabel \placefloatcaption
-\let\placefloatlabeltext \placefloatcaptiontext
-\let\placefloatlabelreference \placefloatcaptionreference
-
-\def\borderedfloatbox
- {\localframed[\??fl\currentfloat][\c!location=\v!normal]{\box\floatbox}}
-
-\newbox\captionbox
-
-\long\def\putcompletecaption#1#2%
- {\doifsomething{\floatcaptionparameter\c!spacebefore}{\blank[\floatcaptionparameter\c!spacebefore]}%
-% \floatcaptionparameter\c!before % test for side effects first
- \noindent
- \xdef\lastcaptiontag{\strut#1}%
- \dostartattributes{\??kj\currentfloat}\c!style\c!color\empty
- \ifnofloatnumber
- \else
- \hbox{\doattributes{\??kj\currentfloat}\c!headstyle\c!headcolor{\strut#1}}%
- \ifnofloatcaption \else \ifemptyfloatcaption \else
- \doifelsenothing{\floatcaptionparameter\c!spaceinbetween}
- {\scratchskip\floatcaptionparameter\c!distance\relax
- \dotfskip\scratchskip\emergencystretch.5\scratchskip}
- {\blank[\floatcaptionparameter\c!spaceinbetween]}%
- \fi \fi
- \fi
- \ifnofloatcaption
- \globallet\lastcaptionht\!!zeropoint
- \globallet\lastcaptiondp\!!zeropoint
- \else
- \doattributes{\??kj\currentfloat}\c!textstyle\c!textcolor
- {\xdef\lastcaptionht{\strutheight}%
- \xdef\lastcaptiondp{\strutdepth}%
- \begstrut#2\endstrut\endgraf}%
- \fi
- \dostopattributes
-% \floatcaptionparameter\c!after % test for side effects first
- \doifsomething{\floatcaptionparameter\c!spaceafter}{\blank[\floatcaptionparameter\c!spaceafter]}}
-
-\let\lastcaptionht\!!zeropoint
-\let\lastcaptiondp\!!zeropoint
-
-% new
-
-\newbox\tempfloatbox
-\newbox\tempcaptionbox
-
-\newif\iftracecaptions
-
-\def\settracedcaptionbox
- {\iftracecaptions\setbox\tempcaptionbox\ruledhbox{\box\tempcaptionbox}\fi}
-
-%\stelblokkopjesin[\c!width=5cm]
-%\stelblokkopjesin[\c!align=\v!left]
-%\stelblokkopjesin[\c!align=\v!right]
-
-
-% \definefloat [figure-1] [figure]
-% \definefloat [figure-2] [figure]
-% \setupfloat [figure-1] [location=left,leftmargin=10mm]
-% \setupfloat [figure-2] [location=left,leftmargin=-5mm]
-% \setupcaption [figure-1] [align=flushleft]
-% \setupcaption [figure-2] [align=flushleft,leftmargin=15mm]
-%
-% \startsetups somefigure
-% \ifdim\wd\nextbox>\textwidth
-% \placefloat[figure-2][][]{}{\box\nextbox}
-% \else
-% \placefloat[figure-1][][]{}{\box\nextbox}
-% \fi
-% \stopsetups
-%
-% \def\setupswithbox[#1]{\dowithnextbox{\setups[#1]}\vbox}
-%
-% test \setupswithbox[somefigure]{\framed[width=3cm] {}} test
-% test \setupswithbox[somefigure]{\framed[width=\dimexpr\textwidth+3cm\relax]{}} test
-
-\def\dosetcaptionthings
- {\setups[\floatcaptionparameter\c!setups]% expanded ?
-% \advance\leftskip \floatcaptionparameter\c!leftmargin
-% \advance\rightskip\floatcaptionparameter\c!rightmargin
- \relax}
-
-\def\dofakecaptionthings
- {\hbox{\dosetcaptionthings\hskip\leftskip\hskip\rightskip}}
-
-\long\def\docheckcaptioncontent#1#2%
- {\ifnofloatcaption \else
- \setbox\tempcaptionbox\hbox
- {\trialtypesettingtrue
- \notesenabledfalse
- \putcompletecaption{#1}{#2}}%
- % new, \placefigure{\XMLflush{somecaption}}{} passes earlier empty check
- % so here we misuse the scratch box; actually this means that the previous
- % test can go away (some day, when i redo this module)
- \ifdim\wd\tempcaptionbox=\zeropoint
- \global\emptyfloatcaptiontrue
- \ifnofloatnumber
- \global\nofloatcaptiontrue
- \fi
- \else
- \setbox\tempcaptionbox\hbox{\dosetcaptionthings\hskip\leftskip\box\tempcaptionbox}% yet incomplete
- \fi
- \fi}
-
-% minwidth=fit,width=max : no overshoot, as wide as graphic
-
-\ifx\moveboxontogrid\undefined \let\movecaptionontogrid\gobblethreearguments \fi
-
-\def\locatefloatbox
- {\chardef\alignstrutmode\zerocount
- \shiftalignedline
- {\floatparameter\c!leftmargin }{\floatparameter\c!rightmargin}%
- {\floatparameter\c!innermargin}{\floatparameter\c!outermargin}%
- \alignedline{\floatparameter\c!location}\v!middle}
-
-\def\locatecaptionbox
- {\chardef\alignstrutmode\zerocount
- \shiftalignedline
- {\floatcaptionparameter\c!leftmargin }{\floatcaptionparameter\c!rightmargin}%
- {\floatcaptionparameter\c!innermargin}{\floatcaptionparameter\c!outermargin}%
- \alignedline{\floatparameter\c!location}\v!middle}
-
-\long\def\dosetpagfloat#1#2#3% \copy wegwerken
- {\bgroup
- \setlocalfloathsize
- \ifnum\floatrotation>0
- \swapdimens\hsize\vsize
- \fi
- \forgetall
- \postponenotes
- \dontcomplain
- \setbox\tempfloatbox\vbox{\borderedfloatbox}%
- \let\locatefloat \locatefloatbox
- \let\locatecaption\locatecaptionbox
- \docheckcaptioncontent{#2}{#3}%
- \ifcase\floatparameter\c!method
- \or % automatic
- \ifnofloatcaption
- \dopreparenocaption{#1}{#2}{#3}%
- \edef\width{\the\wd\floatbox}%
- \doglobal\addlocalbackgroundtobox\floatbox
- \else
- % todo: installable maken, variant/method=auto vs macro
- \dopreparedocaption{#1}{#2}{#3}%
- \settracedcaptionbox
- \edef\width{\the\wd\tempfloatbox}%
- \addlocalbackgroundtobox\tempfloatbox
- \setbox\tempcaptionbox\hbox
- {\dosetcaptionthings
- \floatcaptionparameter\c!command{\box\tempcaptionbox}}%
- \moveboxontogrid\tempcaptionbox{\floatcaptionparameter\c!grid}\lastcaptionht
- \addlocalbackgroundtobox\tempcaptionbox
- \buildfloatbox
- \fi
- \or % semi automatic
- \or % manual
- \fi
- \ifnum\floatrotation>0
- \global\setbox\floatbox\vbox
- {\rotate[\c!rotation=\floatrotation]{\box\floatbox}}%
- \edef\width{\the\wd\tempfloatbox}%
- \else
- \postcenterfloatbox\width
- \fi
- \egroup}
-
-\def\captionminwidth {15\bodyfontsize}
-\def\captionovershoot {2em}
-
-\def\dopreparenocaption#1#2#3%
- {\global\setbox\floatbox\vbox % pas op als wd groter dan hsize
- {\ifinsidecolumns\ifdim\wd\tempfloatbox>\hsize
- \let\locatefloat\relax
- \fi\fi
- \locatefloat{\copy\tempfloatbox}}}
-
-\def\dopreparedocaption#1#2#3%
- {\doifinsetelse{\floatcaptionparameter\c!location}{\v!top,\v!bottom}
- {\doifinsetelse{\floatcaptionparameter\c!width}{\v!fit,\v!max}
- {\doifelse{\floatcaptionparameter\c!minwidth}\v!fit
- {\doifelse{\floatcaptionparameter\c!width}\v!max
- {\dopreparestackcaptionmax{#1}{#2}{#3}}
- {\ifdim\wd\tempcaptionbox>\wd\tempfloatbox % wider caption
- \doifelse{\floatcaptionparameter\c!width}\v!fit
- {\dopreparestackcaptionaut{#1}{#2}{#3}}
- {\dopreparestackcaptionwid{#1}{#2}{#3}}%
- \else
- \dopreparestackcaptionmin{#1}{#2}{#3}%
- \fi}}
- {\dopreparestackcaptionfix{#1}{#2}{#3}}}%
- {\dopreparesidewidthcaption{#1}{#2}{#3}}}% new, special effects (see icare)
- {\doifinsetelse{\floatcaptionparameter\c!width}{\v!fit,\v!max}
- {\dopreparesideautocaption{#1}{#2}{#3}}
- {\dopreparesidewidthcaption{#1}{#2}{#3}}}}
-
-% \def\dosettempcaptionbox
-% {\dosetraggedvbox{\floatcaptionparameter\c!align}%
-% \setbox\tempcaptionbox\raggedbox}
-
-\def\dosettempcaptionbox
- {\setbox\tempcaptionbox\vbox\bgroup
- %expanded{\setupalign[\v!new,\v!reset,\floatcaptionparameter\c!align,\v!old]}% wrong! see icare
- \expanded{\setupalign[\v!reset,\floatcaptionparameter\c!align]}% i need to check what reset does
- \dosetcaptionthings
- \let\next}
-
-\def\dopreparesideautocaption#1#2#3%
- {\scratchdimen\dimexpr\hsize-\wd\tempfloatbox-\@@bkmargin\relax % was \tfskipsize\relax
- \ifdim\wd\tempcaptionbox>\scratchdimen
- \ifdim\wd\tempcaptionbox<1.3\scratchdimen
- \scratchdimen0.8\scratchdimen
- \fi
- \fi
- \dosettempcaptionbox
- {\hsize\scratchdimen
- \putcompletecaption{#2}{#3}}}
-
-\def\dopreparesidewidthcaption#1#2#3%
- {\dosettempcaptionbox
- {\hsize\floatcaptionparameter\c!width
- \putcompletecaption{#2}{#3}}}
-
-\def\dopreparestackcaptionfix#1#2#3%
- {\dosettempcaptionbox
- {\hsize\floatcaptionparameter\c!minwidth % special effects
- \putcompletecaption{#2}{#3}}}
-
-\def\dopreparestackcaptionmax#1#2#3%
- {\dosettempcaptionbox
- {\hsize\wd\tempfloatbox
- \putcompletecaption{#2}{#3}}}
-
-\def\dopreparestackcaptionwid#1#2#3%
- {\dosettempcaptionbox
- {\hsize\floatcaptionparameter\c!width
- \putcompletecaption{#2}{#3}}}
-
-\def\dopreparestackcaptionmin#1#2#3%
- {\dosettempcaptionbox
- {\hsize\wd\tempfloatbox
- \doifnothing{\floatcaptionparameter\c!align}\raggedcenter % on purpose overloads align !
- \putcompletecaption{#2}{#3}}}
-
-\def\dopreparestackcaptionaut#1#2#3%
- {\doifsomething{\floatcaptionparameter\c!align}
- {\doifnotinset{\v!middle}{\floatcaptionparameter\c!align}%
- {\let\captionovershoot\!!zeropoint}}%
- \edef\captionhsize{\the\wd\tempfloatbox}%
- \ifdim\captionhsize>\hsize
- % float is wider than \hsize
- \dosettempcaptionbox
- {\trialtypesettingtrue
- \hsize\captionhsize
- \notesenabledfalse
- \putcompletecaption{#2}{#3}}%
- \ifdim\ht\scratchbox>\lineheight % more lines
- \dosettempcaptionbox
- {\hsize\captionhsize
- \advance\hsize -\captionovershoot\relax
- \ifdim\hsize<\captionminwidth\relax
- \hsize\captionhsize
- \fi
- \putcompletecaption{#2}{#3}}%
- \else
- \dosettempcaptionbox
- {\hsize\captionhsize
- \putcompletecaption{#2}{#3}}%
- \fi
- \else
- % float is smaller of equal to \hsize
- \ifdim\captionhsize<\captionminwidth\relax
- \scratchdimen\captionminwidth % float smaller than min width
- \edef\captionhsize{\the\scratchdimen}%
- \fi
- \setbox\scratchbox\vbox % test with overshoot
- {\trialtypesettingtrue
- \scratchdimen\captionhsize
- \advance\scratchdimen \captionovershoot
- \advance\scratchdimen 3em % an average word length
- \ifdim\scratchdimen<\hsize \hsize\scratchdimen \fi
- \notesenabledfalse
- \putcompletecaption{#2}{#3}}%
- \ifdim\ht\scratchbox>\lineheight
- % at least an average word longer than a line
- \dosettempcaptionbox
- {\scratchdimen\captionhsize
- \advance\scratchdimen \captionovershoot
- \ifdim\scratchdimen<\hsize \hsize\scratchdimen \fi
- \putcompletecaption{#2}{#3}}%
- \else
- % just over a line, don't use an overshoot % % % todo: outer/inner and such
- \doifcommonelse{\floatcaptionparameter\c!align}{\v!left,\v!right,\v!flushleft,\v!flushright}
- {\dosettempcaptionbox
- {\hsize\captionhsize
- % strange : \raggedcenter
- \putcompletecaption{#2}{#3}}}
- {% nicer
- \dosettempcaptionbox
- {\hsize\captionhsize
- \doifnothing{\floatcaptionparameter\c!align}\raggedcenter% overloads
- \putcompletecaption{#2}{#3}}}%
- \fi
- \fi}
-
-\newdimen\tempfloatheight
-\newdimen\tempfloatwidth
-
-\def\dofloatboxbetweenstack
- {\endgraf\nointerlineskip\floatcaptionparameter\c!inbetween\endgraf}
-
-\def\dofloatboxdefaultbuilder % done
- {\locatefloat{\box\tempfloatbox}}
-
-\def\dofloatboxnextrightbuilder#1%
- {\ifparfloat \hbox \else \expandafter \locatefloat \fi
- {\tempfloatheight\ht\tempfloatbox
- \box\tempfloatbox
- \expanded{\doifnotinset{\v!hang}{\floatcaptionparameter\c!location}}{\dotfskip{\floatcaptionparameter\c!distance}}%
- \vbox to\tempfloatheight{#1}}}
-
-\def\dofloatboxnextleftbuilder#1%
- {\ifparfloat \hbox \else \expandafter \locatefloat \fi
- {\tempfloatheight\ht\tempfloatbox
- \vbox to\tempfloatheight{#1}%
- \expanded{\doifnotinset{\v!hang}{\floatcaptionparameter\c!location}}{\dotfskip{\floatcaptionparameter\c!distance}}%
- \box\tempfloatbox}}
-
-\def\dofloatboxnextouterbuilder
- {\doifrightpagefloatelse\dofloatboxnextrightbuilder\dofloatboxnextleftbuilder}
-\def\dofloatboxnextinnerbuilder
- {\doifrightpagefloatelse\dofloatboxnextleftbuilder\dofloatboxnextrightbuilder}
-
-\def\dofloatboxnextrighthangbuilder#1%
- {\ifparfloat \hbox \else \expandafter \locatefloat \fi
- {\tempfloatheight\ht\tempfloatbox
- \box\tempfloatbox
- \vbox to\tempfloatheight{#1}}}
-
-\def\dofloatboxnextlefthangbuilder#1%
- {\ifparfloat \hbox \else \expandafter \locatefloat \fi
- {\tempfloatheight\ht\tempfloatbox
- \vbox to\tempfloatheight{#1}%
- \box\tempfloatbox}}
-
-\def\dodofloatboxnextrightmarginbuilder#1#2%
- {\ifparfloat
- \hbox\bgroup
- \tempfloatheight\ht\tempfloatbox
- \box\tempfloatbox
- \hsmash{\hskip#1\vbox to\tempfloatheight{#2}}%
- \egroup
- \else
- \begingroup
- \tempfloatheight\ht\tempfloatbox
- \everyrightofalignedline{\hsmash{\hskip#1\vbox to\tempfloatheight{#2}}}%
- \locatefloat{\box\tempfloatbox}%
- \endgroup
- \fi}
-
-\def\dodofloatboxnextleftmarginbuilder#1#2%
- {\ifparfloat
- \hbox\bgroup
- \tempfloatheight\ht\tempfloatbox
- \hsmash{\hskip-\dimexpr#1+\wd\tempcaptionbox\relax\vbox to\tempfloatheight{#2}}%
- \box\tempfloatbox
- \egroup
- \else
- \begingroup
- \tempfloatheight\ht\tempfloatbox
- \everyleftofalignedline{\hsmash{\hskip-\dimexpr#1+\wd\tempcaptionbox\relax\vbox to\tempfloatheight{#2}}}%
- \locatefloat{\box\tempfloatbox}%
- \endgroup
- \fi}
-
-\def\dofloatboxnextrightmarginbuilder{\dodofloatboxnextrightmarginbuilder\rightmargindistance}
-\def\dofloatboxnextleftmarginbuilder {\dodofloatboxnextleftmarginbuilder \leftmargindistance }
-
-\def\dofloatboxnextoutermarginbuilder
- {\doifrightpagefloatelse
- {\dodofloatboxnextrightmarginbuilder\rightmargindistance}
- {\dodofloatboxnextleftmarginbuilder \rightmargindistance}}
-
-\def\dofloatboxnextinnermarginbuilder
- {\doifrightpagefloatelse
- {\dodofloatboxnextleftmarginbuilder \leftmargindistance}
- {\dodofloatboxnextrightmarginbuilder\leftmargindistance}}
-
-\def\dofloatboxnextbuilder % beware, we first check on left/rightmargin because there can be left/right also
- {\let\next\dofloatboxnextleftbuilder
- \expanded{\processallactionsinset[\floatcaptionparameter\c!location]}
- [ \v!outermargin=>\let\next\dofloatboxnextoutermarginbuilder,
- \v!innermargin=>\let\next\dofloatboxnextinnermarginbuilder,
- \v!leftmargin=>\let\next\dofloatboxnextleftmarginbuilder,
- \v!rightmargin=>\let\next\dofloatboxnextrightmarginbuilder,
- \v!lefthanging=>\let\next\dofloatboxnextlefthangbuilder,
- \v!righthanging=>\let\next\dofloatboxnextrighthangbuilder,
- \v!outer=>\let\next\dofloatboxnextouterbuilder,
- \v!inner=>\let\next\dofloatboxnextinnerbuilder,
- \v!left=>\let\next\dofloatboxnextleftbuilder,
- \v!right=>\let\next\dofloatboxnextrightbuilder]%
- \next}
-
-\def\dofloatboxsidebuilder
- {\ifparfloat
- \let\next\dofloatboxhighbuilder
- \else
- \let\next\dofloatboxmiddlebuilder
- \expanded{\processallactionsinset[\floatcaptionparameter\c!location]}
- [ \v!low=>\let\next\dofloatboxlowbuilder,
- \v!middle=>\let\next\dofloatboxmiddlebuilder,
- \v!high=>\let\next\dofloatboxhighbuilder]%
- \fi
- \next}
-
-\def\doflushfloatleftcaptionhang
- {\hsmash{\llap{\box\tempcaptionbox\dotfskip{\floatcaptionparameter\c!distance}}}}
-\def\doflushfloatrightcaptionhang
- {\hsmash{\rlap{\dotfskip{\floatcaptionparameter\c!distance}\box\tempcaptionbox}}}
-
-\def\doflushfloatcaptionhang
- {\expanded{\doifinsetelse{\v!righthanging}{\floatcaptionparameter\c!location}}
- {\doflushfloatrightcaptionhang}
- {\expanded{\doifinsetelse{\v!lefthanging}{\floatcaptionparameter\c!location}}
- {\doflushfloatleftcaptionhang}
- {\expanded{\doifinsetelse{\v!hang}{\floatcaptionparameter\c!location}}
- {\expanded{\doifinsetelse{\v!outer}{\floatcaptionparameter\c!location}}
- {\doifrightpagefloatelse{\doflushfloatrightcaptionhang}{\doflushfloatleftcaptionhang}}
- {\expanded{\doifinsetelse{\v!right}{\floatcaptiondirectives}}
- {\doflushfloatrightcaptionhang}
- {\doflushfloatleftcaptionhang}}}
- {\box\tempcaptionbox}}}}
-
-\def\dofloatboxhighbuilder
- {\dofloatboxnextbuilder{\dofloatboxbetweenstack\doflushfloatcaptionhang\vfill}}
-
-\def\dofloatboxlowbuilder
- {\dofloatboxnextbuilder{\vfill\doflushfloatcaptionhang\dofloatboxbetweenstack}}
-
-\def\dofloatboxmiddlebuilder
- {\dofloatboxnextbuilder{\vfill\box\tempcaptionbox\vfill}}
-
-% \definefloat
-% [lefty][lefties][figure]
-% \setupfloat
-% [lefty]
-% [default=left,
-% rightmargindistance=-2cm,
-% leftmargindistance=-2cm]
-% \setupcaption
-% [lefty]
-% [location={bottom,overlay}]
-%
-% \starttext
-% \placelefty{}{} \input tufte \input tufte
-% \placelefty{}{} \input tufte \input tufte
-% \stoptext
-
-\def\bothangfloat#1{\ruledvbox to \ht\tempfloatbox{#1\vss}}
-\def\tophangfloat#1{\ruledvbox to \ht\tempfloatbox{\vss#1}}
-
-\def\dofloatboxnormaltopstackbuilder
- {\expanded{\doifinset{\v!overlay}{\floatcaptionparameter\c!location}}\tophangfloat
- {\tempfloatwidth\wd\tempfloatbox
- \ifparfloat
- \hbox{\locatesidefloat{\box\tempcaptionbox}}%
- \dofloatboxbetweenstack
- \hbox{\hbox {\box\tempfloatbox }}%
- \else
- \hbox{\locatetextfloat{\box\tempcaptionbox}}
- \dofloatboxbetweenstack
- \hbox{\locatefloat {\box\tempfloatbox }}%
- \fi}}
-
-\def\dofloatboxnormalbotstackbuilder
- {\expanded{\doifinset{\v!overlay}{\floatcaptionparameter\c!location}}\bothangfloat
- {\tempfloatwidth\wd\tempfloatbox
- \ifparfloat
- \hbox{\hbox {\box\tempfloatbox }}%
- \dofloatboxbetweenstack
- \hbox{\locatesidefloat{\box\tempcaptionbox}}%
- \else
- \hbox{\locatefloat {\box\tempfloatbox }}%
- \dofloatboxbetweenstack
- \hbox{\locatetextfloat{\box\tempcaptionbox}}%
- \fi}}
-
-\def\dofloatboxgridtopstackbuilder
- {\dp\tempcaptionbox\strutdepth
- \setbox\scratchbox\vbox
- {\tempfloatwidth\wd\tempfloatbox
- \ifparfloat
- \locatesidefloat{\box\tempcaptionbox}%
- \vss\dofloatboxbetweenstack
- \hbox {\box\tempfloatbox }%
- \else
- \locatetextfloat{\box\tempcaptionbox}%
- \vss\dofloatboxbetweenstack
- \locatefloat {\box\tempfloatbox }%
- \fi}%
- \getnoflines{\dimexpr\htdp\scratchbox-10\scaledpoint\relax}% get rid of inaccuracy
- \vbox to \noflines\lineheight{\unvbox\scratchbox}}
-
-\def\dofloatboxgridbotstackbuilder
- {\dp\tempcaptionbox\strutdepth
- \setbox\scratchbox\vbox
- {\tempfloatwidth\wd\tempfloatbox
- \ifparfloat
- \hbox {\box\tempfloatbox }%
- \vss\dofloatboxbetweenstack
- \locatesidefloat{\box\tempcaptionbox}%
- \else
- \locatefloat {\box\tempfloatbox }%
- \vss\dofloatboxbetweenstack
- \locatetextfloat{\box\tempcaptionbox}%
- \fi}%
- \getnoflines{\dimexpr\htdp\scratchbox-10\scaledpoint\relax}% get rid of inaccuracy
- \vbox to \noflines\lineheight{\unvbox\scratchbox}}
-
-\def\dofloatboxstretchtopstackbuilder
- {\dp\tempcaptionbox\strutdepth
- \setbox\scratchbox\vbox
- {\locatecaption{\copy\tempcaptionbox}%
- \locatefloat {\copy\tempfloatbox }}%
- \getnoflines{\dimexpr\htdp\scratchbox-10\scaledpoint\relax}% get rid of inaccuracy
- \vbox to \noflines\lineheight
- {\tempfloatwidth\wd\tempfloatbox
- \ifparfloat
- \locatesidefloat{\box\tempcaptionbox}%
- \vss\dofloatboxbetweenstack\vss
- \hbox {\box\tempfloatbox }%
- \else
- \locatetextfloat{\box\tempcaptionbox}%
- \vss\dofloatboxbetweenstack\vss
- \locatefloat {\box\tempfloatbox }%
- \fi}}
-
-\def\dofloatboxstretchbotstackbuilder
- {\dp\tempcaptionbox\strutdepth
- \setbox\scratchbox\vbox
- {\locatefloat {\copy\tempfloatbox }%
- \locatecaption{\copy\tempcaptionbox}}%
- \getnoflines{\dimexpr\htdp\scratchbox-10\scaledpoint\relax}% get rid of inaccuracy
- \vbox to \noflines\lineheight
- {\tempfloatwidth\wd\tempfloatbox
- \ifparfloat
- \hbox {\box\tempfloatbox }%
- \vss\dofloatboxbetweenstack\vss
- \locatesidefloat{\box\tempcaptionbox}
- \else
- \locatefloat {\box\tempfloatbox }%
- \vss\dofloatboxbetweenstack\vss
- \locatetextfloat{\box\tempcaptionbox}%
- \fi}}
-
-\def\dofloatboxtopbuilder
- {\let\next\dofloatboxnormaltopstackbuilder
- \expanded{\processfirstactioninset[\floatcaptionparameter\c!location]}
- [ \v!grid=>\let\next\dofloatboxgridstackbuilder,
- \v!stretch=>\let\next\dofloatboxstretchstackbuilder]%
- \next}
-
-\def\dofloatboxbottombuilder
- {\let\next\dofloatboxnormalbotstackbuilder
- \expanded{\processfirstactioninset[\floatcaptionparameter\c!location]}
- [ \v!grid=>\let\next\dofloatboxgridstackbuilder,
- \v!stretch=>\let\next\dofloatboxstretchstackbuilder]%
- \next}
-
-\def\relocatecaptionright#1{\locatecaption{\hbox to \tempfloatwidth{\hss#1}}}
-\def\relocatecaptionleft #1{\locatecaption{\hbox to \tempfloatwidth{#1\hss}}}
-
-\long\def\installfloatboxbuilder#1#2{\setvalue{\??kj:#1}{#2}}
-
-\def\buildfloatbox
- {\global\setbox\floatbox\vbox
- {\setlocalfloathsize
- \forgetall
- \let\floatcaptionarrangement\s!default
- \def\docommand##1%
- {\doifdefined{\??kj:##1}{\def\floatcaptionarrangement{##1}\quitcommalist}}%
- \processcommacommand[\floatcaptionparameter\c!location]\docommand
- \executeifdefined{\??kj:\floatcaptionarrangement}{\getvalue{\??kj:\s!default}}}}
-
-\def\locatetextfloat
- {\let\next\locatecaption
- \expanded{\processallactionsinset[\floatcaptionparameter\c!location]}
- [ \v!left=>\let\next\relocatecaptionleft,
- \v!right=>\let\next\relocatecaptionright,
- \v!inner=>\doifrightpagefloatelse{\let\next\relocatecaptionleft }{\let\next\relocatecaptionright},
- \v!outer=>\doifrightpagefloatelse{\let\next\relocatecaptionright}{\let\next\relocatecaptionleft }]%
- \next}
-
-\installfloatboxbuilder \v!none \dofloatboxdefaultbuilder
-\installfloatboxbuilder \s!default \dofloatboxdefaultbuilder
-\installfloatboxbuilder \v!high \dofloatboxhighbuilder
-\installfloatboxbuilder \v!low \dofloatboxlowbuilder
-\installfloatboxbuilder \v!middle \dofloatboxmiddlebuilder
-
-\installfloatboxbuilder \v!left \dofloatboxsidebuilder
-\installfloatboxbuilder \v!right \dofloatboxsidebuilder
-
-\installfloatboxbuilder \v!top \dofloatboxtopbuilder
-\installfloatboxbuilder \v!bottom \dofloatboxbottombuilder
-
-% \setuplayout[grid=yes] \showgrid \setupcaptions[style=smallbodyfont,location=grid,inbetween=]
-%
-% \starttext
-% test \placefigure{} {\externalfigure[cow.pdf][frame=on,grid=yes]} test \page
-% test \placefigure{\input zapf\relax}{\externalfigure[cow.pdf][frame=on,grid=yes]} test \page
-% test \placefigure{} {\externalfigure[cow.pdf][frame=on,grid=depth]} test \page
-% test \placefigure{\input zapf\relax}{\externalfigure[cow.pdf][frame=on,grid=depth]} test \page
-% \stoptext
-
-\newif\ifpostponecolumnfloats \postponecolumnfloatsfalse % don't change
-
-\chardef\postcenterfloatmethod\plusone
-
-\def\postcenterfloatbox#1%
- {\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
- {\ifglobalcenterfloatbox
- \donetrue
- \else\iflocalcenterfloatbox
- \donetrue
- \else
- \donefalse
- \fi\fi
- \ifdim\scratchdimen>\effectivehsize
- \donefalse
- \fi
- \hss\ifdone\hskip\effectiveleftskip\fi
- \box\floatbox
- \ifdone\hskip\effectiverightskip\fi\hss}}
-
-\long\def\dosetparfloat#1#2#3%
- {\bgroup
- \forgetall
- \postponenotes
- \dontcomplain
- %\showcomposition
- \setbox\tempfloatbox\vbox{\borderedfloatbox}%
- \addlocalbackgroundtobox\tempfloatbox % no \doglobal
- \docheckcaptioncontent{#2}{#3}%
- \ifnofloatcaption
- \global\setbox\floatbox\vbox{\box\tempfloatbox}%
- \else
- \dopreparedosidecaption{#1}{#2}{#3}%
- \settracedcaptionbox
- \setbox\tempcaptionbox\hbox{\floatcaptionparameter\c!command{\box\tempcaptionbox}}%
- \moveboxontogrid\tempcaptionbox{\floatcaptionparameter\c!grid}\lastcaptionht
- \addlocalbackgroundtobox\tempcaptionbox % no \doglobal
- \buildsidefloatbox
- \fi
- \egroup}
-
-\def\dopreparedosidecaption#1#2#3% will be enhanced
- {\doifelse{\floatcaptionparameter\c!width}\v!max
- {\dosettempcaptionbox
- {\hsize\wd\tempfloatbox
- \putcompletecaption{#2}{#3}}}%
- {\doifelse{\floatcaptionparameter\c!width}\v!fit
- {\ifdim\wd\tempcaptionbox>\wd\tempfloatbox\relax
- \setbox\tempcaptionbox\vbox
- {\forgetall % needed?
- \hsize\wd\tempfloatbox
- \dosetcaptionthings
- \putcompletecaption{#2}{#3}}%
- \else
- \setbox\tempcaptionbox\hbox to \wd\tempfloatbox
- {\hss\box\tempcaptionbox\hss}%
- \fi}
- {\dosettempcaptionbox
- {\hsize\floatcaptionparameter\c!width % \wd\tempfloatbox
- \putcompletecaption{#2}{#3}}}}}
-
-\def\buildsidefloatbox
- {\let\locatefloat \relax
- \let\locatecaption\relax
- \def\locatesidefloat##1%
- {\begingroup
- \chardef\alignstrutmode\zerocount
- \hsize\tempfloatwidth \forgetall
- \alignedline{\floatparameter\c!location}\v!middle{##1}%
- \endgroup}%
- \buildfloatbox}
-
-\newif\ifparfloat
-
-\long\def\dosetfloatbox#1#2#3% todo : \global\setbox
- {\ifvisible
- \par
- \edef\floatcaptiondirectives{\floatparameter\c!location,\floatcaptionparameter\c!location}%
- \ifparfloat\@EA\dosetparfloat\else\@EA\dosetpagfloat\fi{#1}{#2}{#3}%
- \setlocalfloatdimensions{#1}%
- \setbox\floatbox\hbox
- {\dosavefloatdata\restoretextcolor{\box\floatbox}}%
- \global\floatheight\ht\floatbox
- \global\advance\floatheight \dp\floatbox
- \global\floatwidth\wd\floatbox
- \global\advance\totalnoffloats \plusone
- \doifnotinset\v!margin{#1} % gaat namelijk nog fout
- {\setbox\floatbox\vbox
- {\parindent\zeropoint
- \doifconcepttracing{\inleftmargin{\framed{\infofont\the\totalnoffloats}}}%
- \box\floatbox}}%
- \wd\floatbox\floatwidth
- \dimen0=\floatheight
- \advance\dimen0 \lineheight
- \ifdim\dimen0<\textheight
- \else
- \global\floatheight\textheight
- \global\advance\floatheight -\lineheight
- \ht\floatbox\floatheight
- \dp\floatbox\zeropoint
- \showmessage\m!floatblocks{10}{\the\totalnoffloats}%
- \fi
- \fi}
-
-\newcounter\noxfloatlocations
-
-\long\def\dofloat#1#2#3%
- {\dosetfloatbox{#1}{#2}{#3}%
- \dogetfloatbox{#1}\empty}
-
-\let\naturalfloatheight\!!zeropoint
-\let\naturalfloatwidth \!!zeropoint
-\let\naturalfloatdepth \!!zeropoint
-
-\def\setnaturalfloatdimensions#1%
- {\xdef\naturalfloatheight{\the\ht#1}%
- \xdef\naturalfloatwidth {\the\wd#1}%
- \xdef\naturalfloatdepth {\the\dp#1}}
-
-\long\def\doifelsemainfloatbody#1#2%
- {\ifinsidesplitfloat\ifconditional\splitfloatfirstdone#2\else#1\fi\else#1\fi}
-
-
-\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
- \doifelsemainfloatbody{\rawpagereference\s!flt{#2}}\donothing
- \vss}% gets rid of the depth (unless tabulate)
- \egroup
- \dofloat{#4}{}{#6}%
- \else
- \gdefconvertedargument\asciititle{#6}% \asciititle is global
- \ifnofloatnumber
- \global\setbox\floatbox\vbox
- {\unvbox\floatbox % no \vss, keep the depth
- \doifelsemainfloatbody{\rawreference\s!flt{#2}{{}{\asciititle}}}\donothing}%
- \egroup
- \dofloat{#4}{}{#6}%
- \else
- \preparefloatnumber{#1}%
- \global\setbox\floatbox\vbox
- {\unvbox\floatbox % no \vss, keep the depth
- \doifelsemainfloatbody
- {\tracefloatnumber{#1}%
- \rawreference\s!flt{#2}{{\composedsectionnumber}{\asciititle}}%
- \dowritetolist{#3}{\composedsectionnumber}{#6}{#3}}
- \donothing
- }%
- \egroup
- \preparefullnumber{\??kj#1}\composedsectionnumber\preparednumber
- \dofloat{#4}{\labeltexts{#5}{\preparednumber}}{#6}%
- \fi
- \fi
- \global\insidefloatfalse}
-
-\def\dooutput{\sidefloatoutput} % redefinition of \dooutput
-
-\definefloat
- [\v!figure]
- [\v!figures]
-
-\definefloat
- [\v!table]
- [\v!tables]
-
-\setupfloat
- [\v!table]
- [\c!frame=\v!off]
-
-\definefloat
- [\v!intermezzo]
- [\v!intermezzi]
-
-\definefloat
- [\v!graphic]
- [\v!graphics]
-
-\setupcaptions
- [\c!location=\v!bottom,
- \c!grid=,
- \c!before=, % not used (yet)
- \c!inbetween={\blank[\v!medium]},
- \c!after=, % not used (yet)
- \c!spacebefore=,
- \c!spaceinbetween=, % replaces fuzzy inbetween dual usage
- \c!spaceafter=,
- \c!width=\v!fit,
- \c!minwidth=\v!fit, % id est: the width of the floatbox in some cases
- \c!headstyle=\v!bold,
- \c!headcolor=,
- \c!leftmargin=\zeropoint,
- \c!rightmargin=\zeropoint,
- \c!outermargin=\zeropoint,
- \c!innermargin=\zeropoint,
- \c!setups=,
- \c!style=\v!normal,
- \c!color=,
- \c!textstyle=,
- \c!textcolor=,
- \c!align=,
- \c!number=\v!yes,
- \c!way=\@@nrway,
- \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]
-
-\setupfloats
- [\c!location=\v!middle,
- \c!width=8\lineheight,
- \c!height=6\lineheight,
- \c!offset=\v!overlay,
- \c!frame=\v!off,
- \c!radius=.5\bodyfontsize,
- \c!corner=\v!rectangular,
- \c!background=,
- \c!backgroundscreen=\@@rsscreen,
- \c!backgroundcolor=,
- \c!backgroundoffset=\!!zeropoint,
- \c!topframe=,
- \c!bottomframe=,
- \c!leftframe=,
- \c!rightframe=,
- \c!framecolor=,
- \c!frameoffset=\!!zeropoint,
- \c!before=,
- \c!after=,
- \c!spacebefore=\v!big,
- \c!spaceafter=\v!big,
- \c!sidespacebefore=\@@bkspacebefore,
- \c!sidespaceafter=\@@bkspaceafter,
- \c!sidealign=\v!normal,
- \c!textmethod=\ifgridsnapping2\else0\fi, % 0=raw 1=safe (.99pg) 2=tight (-1pt)
- \c!sidemethod=\ifgridsnapping2\else1\fi, % 0=raw 1=safe (.99pg) 2=tight (-1pt)
- \c!indentnext=\v!no,
- \c!margin=1em,
- \c!method=1,
- \c!cache=\v!yes, % when no, then intermediate flush
- \c!leftmargin=\zeropoint, % displacement in 'normal floats'
- \c!rightmargin=\zeropoint, % idem
- \c!innermargin=\zeropoint, % idem
- \c!outermargin=\zeropoint, % idem
- \c!leftmargindistance=\zeropoint,
- \c!rightmargindistance=\@@bkleftmargindistance,
- \c!ntop=2,
- \c!nbottom=0,
- \c!nlines=4,
- \c!local=,
- \c!default=, % was \v!figure but this is the location
- \c!numbering=\v!yes]
-
-% float strategy, replaces some of the above macros
-
-\let\floatmethod \empty
-\let\floatcolumn \empty
-\let\floatrow \empty
-\let\forcedfloatmethod\empty
-
-\def\dogetfloatbox#1#2%
- {\ifvisible
- \doifelsenothing{#2}
- {\getfromcommalist[#1][1]%
- \@EA\beforesplitstring\commalistelement\at:\to\floatmethod
- \@EA\aftersplitstring \commalistelement\at:\to\floatcolumn
- \@EA\aftersplitstring \floatcolumn\at*\to\floatrow
- \@EA\beforesplitstring\floatcolumn\at*\to\floatcolumn
- % todo: nog algemeen otr
- \ifx\OTRSETsetpreferedcolumnslot\undefined\else
- \OTRSETsetpreferedcolumnslot\floatcolumn\floatrow
- \fi}
- {\let\floatcolumn\empty
- \let\floatrow\empty
- \edef\floatmethod{#2}}%
- \doifundefined{\string\floatmethod\floatmethod}
- {\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
- {\setvalue{\string\floatmethod#1}{#2}}
-
-\installfloathandler \v!here \someherefloat
-\installfloathandler \v!force \somefixdfloat
-\installfloathandler \v!left \someleftsidefloat
-\installfloathandler \v!right \somerightsidefloat
-\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
-\installfloathandler \v!leftmargin \someinleftmarginfloat
-\installfloathandler \v!rightmargin \someinrightmarginfloat
-\installfloathandler \v!leftedge \someinleftedgefloat
-\installfloathandler \v!rightedge \someinrightedgefloat
-
-\installfloathandler \v!backspace \somebackspacefloat
-\installfloathandler \v!cutspace \somecutspacefloat
-
-\installfloathandler {tblr} \someslotfloat
-\installfloathandler {lrtb} \someslotfloat
-\installfloathandler {tbrl} \someslotfloat
-\installfloathandler {rltb} \someslotfloat
-\installfloathandler {btlr} \someslotfloat
-\installfloathandler {lrbt} \someslotfloat
-\installfloathandler {btrl} \someslotfloat
-\installfloathandler {rlbt} \someslotfloat
-\installfloathandler {fxtb} \someslotfloat
-\installfloathandler {fxbt} \someslotfloat
-
-\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]}
-\def\someinleftedgefloat [#1]{\somesidefloat[#1]}
-\def\someinrightedgefloat [#1]{\somesidefloat[#1]}
-\def\someinmarginfloat [#1]{\somesidefloat[#1]}
-\def\someherefloat [#1]{\someelsefloat[\v!here,#1]}
-
-\def\somebackspacefloat [#1]{\somesidefloat[#1]}
-\def\somecutspacefloat [#1]{\somesidefloat[#1]}
-
-\def\somefixdfloat {\placesomefixdfloat}
-\def\somepagefloat {\placesomepagefloat}
-\def\someleftpagefloat {\placesomeleftpagefloat}
-\def\somerightpagefloat{\placesomerightpagefloat}
-\def\somefacefloat {\placesomefacefloat}
-\def\someslotfloat {\placesomeslotfloat}
-
-%D Local floats.
-
-\def\setuplocalfloats
- {\getparameters[\??lf]}
-
-\setuplocalfloats
- [%\c!before=\blank,
- %\c!after=\blank,
- \c!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}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/strc-itm.mkii b/Master/texmf-dist/tex/context/base/mkii/strc-itm.mkii
deleted file mode 100644
index 697618323bb..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/strc-itm.mkii
+++ /dev/null
@@ -1,1335 +0,0 @@
-%D \module
-%D [ file=strc-itm, % updated
-%D version=1997.03.31,
-%D title=\CONTEXT\ Structure Macros,
-%D subtitle=itemgroups,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% new: text + lefttext=(,righttext=)
-% start=
-
-\writestatus{loading}{ConTeXt Structure Macros / Itemgroups}
-
-\unprotect
-
-% - instellingen in macro
-% - [0] voor start op 0
-% - start=2
-
-\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
-\newconditional\beforelistitem \setfalse\beforelistitem
-\newconditional\afterlistitem \setfalse\afterlistitem
-\newconditional\nowhitelistitem \setfalse\nowhitelistitem
-\newconditional\joinedlistitem \setfalse\joinedwhitelistitem
-\newconditional\reverselistitem \setfalse\reverselistitem
-\newconditional\continuelistitems \setfalse\continuelistitems
-\newconditional\fittinglistitems \setfalse\fittinglistitems
-
-\newcount\noflists
-\newcount\currentnoflists
-\newcount\itemcolumndepth
-\newcount\itemdepth
-\newcount\maxitemdepth
-
-\definetwopasslist\s!list
-
-\let\currentitemlevel \!!zerocount
-\let\currentitemgroup \empty
-\let\currentnofitems \!!zerocount
-\let\currentmaxnofitems\!!zerocount
-\let\currentminnofitems\!!zerocount
-\let\currentitemoffset \!!zerocount
-\def\currentitemnumber{\countervalue{\@@itemcounter\currentitemlevel}}
-
-% tricky ... we cannot use trialtypesetting here because there can be
-% multiple itemizes in e.g. a table, so we need something more advanced
-% where counters etc are reset to pre-outertrial values
-
-\def\dolistreference
- {\ifconditional\continuelistitems
- \savetaggedtwopassdata\s!list{\number\currentnoflists}{\number\currentnoflists}%
- {\currentitemlevel:\noflistelements:c:\getitemparameter\currentitemlevel\c!maxwidth}%
- \else
- \savetaggedtwopassdata\s!list{\number\currentnoflists}{\number\currentnoflists}%
- {\currentitemlevel:\noflistelements:n:\getitemparameter\currentitemlevel\c!maxwidth}%
- \fi}
-
-\def\splititemtwopassdata#1%
- {\expanded{\findtwopassdata{\s!list}{\number#1}}%
- \expandafter\dosplititemtwopassdata\twopassdata:0:0:0:0:0\relax}
-
-\def\dosplititemtwopassdata#1:#2:#3:#4:#5\relax
- {\edef\itemdatal{#1}\edef\itemdatan{#2}\edef\itemdatat{#3}\edef\itemdataw{#4}}
-
-\def\checkcurrentnofitems
- {\splititemtwopassdata\currentnoflists
- \iftwopassdatafound
- \ifcase\itemdatan\relax % \scratchcounter
- \let\currentnofitems \!!zerocount
- \let\currentminnofitems\!!plusone
- \let\currentmaxnofitems\!!zerocount
- \else
- \scratchcounter\itemdatan\relax
- \edef\currentnofitems{\the\scratchcounter}%
- \let\currentitemtag\itemdatat
- \doloop
- {\splititemtwopassdata{\numexpr\currentnoflists+\recurselevel\relax}%
- \iftwopassdatafound
- \ifnum\itemdatal=\currentitemlevel\relax
- \doifelse{c}\itemdatat
- {\advance\scratchcounter\itemdatan\relax}
- {\exitloop}%
- \fi
- \else
- \exitloop
- \fi}%
- \edef\currentmaxnofitems{\the\scratchcounter}%
- \scratchcounter\zerocount
- \doif{c}\currentitemtag
- {\doloop
- {\splititemtwopassdata{\numexpr\currentnoflists-\recurselevel\relax}%
- \iftwopassdatafound
- \ifnum\itemdatal=\currentitemlevel\relax
- \doifelse{c}\itemdatat
- {\advance\scratchcounter\itemdatan\relax}
- {\advance\scratchcounter\itemdatan\exitloop}%
- \fi
- \else
- \exitloop
- \fi}}%
- \advance\scratchcounter\plusone
- \edef\currentminnofitems{\the\scratchcounter}%
- % [[\currentnofitems,\currentminnofitems,\currentmaxnofitems]]
- \fi
- \else % new, when no tuo yet
- \let\currentnofitems \!!zerocount
- \let\currentminnofitems\!!plusone
- \let\currentmaxnofitems\!!zerocount
- \fi} % [[\currentnofitems,\currentminnofitems,\currentmaxnofitems]]
-
-% \startitemize[n,packed]
-% \item test \item test \item test
-% \stopitemize
-%
-% \startitemize[n,packed,reverse]
-% \item test \item test \item test
-% \stopitemize
-%
-% \startitemize[n,packed,reverse] \item test \item test \stopitemize
-% \startitemize[continue]
-% \item test \startitemize[n,packed] \item test \item test \stopitemize
-% \item test
-% \item test
-% \stopitemize
-% \startitemize[continue] \item test \stopitemize
-%
-% \startitemize[n,packed] \item test \item test \stopitemize
-% \startitemize[continue] \item test \stopitemize
-% \startitemize[continue] \item test \stopitemize
-
-\def\unknownitemreference{0} \let\itemreferences\unknownitemreference
-
-% #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} % #3 -> {#3}
-\def\letitemparameter #1#2{\@EA\let\csname\??op\currentitemgroup#1#2\endcsname}
-
-% works ok but not needed (also possible compatibility problem)
-%
-% \def\getitemparameter#1#2%
-% {\executeifdefined{\??op\currentitemgroup#1#2}%
-% {\executeifdefined{\??op\currentitemgroup #2}%
-% {\executeifdefined{\??oo #2}%
-% {}}}}
-
-% 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}
-\def\@@localitemsymbol #1{\??op\currentitemgroup\c!symbol\s!local #1}
-\def\@@currentitemsymbol#1{\??op\currentitemgroup\c!symbol #1}
-
-\def\@@itemcounter{\s!itemcount\currentitemgroup}
-
-% \def\doitembreak#1{\ifconditional\textlistitem\else\dosomebreak#1\fi}
-%
-% s-pre-61 / pre-dis, test extensively, 2004/5
-
-\def\doitembreak#1{\ifconditional\optimizelistitem\ifconditional\textlistitem\else\dosomebreak#1\fi\fi}
-
-\def\initializeitemgroupslevel#1%
- {\ifundefined{\@@globalitemsymbol{#1}}%
- \edef\itemreferences{\itemreferences,#1}%
- \makecounter{\@@itemcounter#1}%
- \setevalue{\@@globalitemsymbol{#1}}{#1}%
- \fi}
-
-\def\initializeitemgrouplevel#1% safeguard
- {\ifundefined{\??op\currentitemgroup#1\c!width}%
- \doinitializeitemgrouplevel{#1}%
- \fi}
-
-\def\doinitializeitemgrouplevel#1%
- {\copyparameters
- [\??op\currentitemgroup#1][\??oo]
- [\c!width,\c!factor,\c!distance,\c!align,\c!symalign,\c!option,%
- \c!style,\c!marstyle,\c!symstyle,\c!headstyle,%
- \c!color,\c!marcolor,\c!symcolor,\c!headcolor,%
- \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!indentnext,%
- \c!command,%
- \c!start,\c!lefttext,\c!righttext]}
-
-\def\setupitemgroups
- {\dosingleargument\dosetupitemgroups}
-
-\def\dosetupitemgroups[#1]% still undocumented
- {\getparameters[\??oo][\c!levels=4,#1]%
- % will change (remove)
- \ifnum\@@oolevels>\maxitemdepth
- \maxitemdepth\@@oolevels\relax
- \dorecurse\maxitemdepth{\initializeitemgroupslevel\recurselevel}%
- \fi}
-
-\def\doitemreference#1,#2,#3\\%
- {\ifnum\currentitemlevel>#1\relax
- \ifnum#1>\zerocount \tempsymbol \fi
- \getvalue{\@@currentitemsymbol{#2}}%
- \doitemreference#2,#3\\%
- \fi}
-
-\def\itemreference
- {\expandafter\doitemreference\itemreferences,,\\}
-
-\def\packitems
- {\ifcase\currentitemlevel \else \settrue\packlistitem \fi}
-
-\def\dosetupitemgroupvariable[#1]% [#2]% niveau instellingen
- {\doifelsenothing{#1}
- {\getparameters[\??op\currentitemgroup\currentitemlevel]}% [#2]}%
- {\getparameters[\??op\currentitemgroup#1]}}% [#2]}}
-
-\newconditional\inlinelistitem \setfalse\inlinelistitem
-
-\def\dododosetupitemgroupconstant[#1][#2#3#4]% * permits [2]
- {\global\setitemparameter\currentitemlevel\c!maxwidth{0}%
- \processaction
- [#2#3#4]
- [ \v!packed*=>\packitems,
- \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*=>\settrue\textlistitem
- \settrue\inlinelistitem
- \settrue\joinedlistitem % \dosetuppackeditemgroup{#1}%
- \packitems,
- \v!columns*=>\packitems,
- \v!before*=>\settrue\beforelistitem,
- \v!after*=>\settrue\afterlistitem,
- \v!nowhite*=>\settrue\nowhitelistitem, % \def\packeditemspacing{\nowhitespace},
- \v!margin*=>\setitemparameter{#1}\c!width{-2em}, % signal
- \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*=>\setfalse\optimizelistitem,
- \v!fit*=>\settrue\fittinglistitems,
- \v!nofit*=>\setfalse\fittinglistitems,
- \v!paragraph*=>\settrue\paragraphlistitem
- \packitems,
- \v!joinedup*=>\settrue\joinedlistitem % \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}, % keep {}
- \v!unpacked*=>\setfalse\packlistitem,
- \v!repeat*=>\settrue\repeatlistitem, % new
- \v!reverse*=>\settrue\reverselistitem,
- \v!standard*=>\dosetupstandarditemgroup{#1}]}
-
-\def\dosetupstandarditemgroup#1%
- {\getparameters
- [\??op\currentitemgroup#1]
- [\c!width=1.5em,
- \c!factor=0,
- \c!distance=.5em,
- \c!beforehead=,
- \c!afterhead=\blank,
- \c!before=\blank,
- \c!inbetween=\blank,
- \c!after=\blank,
- \c!inner=]}
-
-% \def\packeditemspacing{\empty}
-
-% \setupwhitespace[big]
-% \starttext
-% test \startitemize[joinedup] \item test \item test \stopitemize test \par
-% test \startitemize[joinedup,nowhite] \item test \item test \stopitemize test \par
-% test \startitemize[joinedup,nowhite,before] \item test \item test \stopitemize test \par
-% test \startitemize[joinedup,nowhite,after] \item test \item test \stopitemize test \par
-% \stoptext
-
-\def\itembeforecommand
- {\ifconditional\nowhitelistitem
- \ifconditional\beforelistitem
- \ifcase\currentitemlevel\or\getitemparameter\currentitemlevel\c!before\fi
- \else
- \nowhitespace
- \fi
- \else\ifconditional\joinedlistitem
- % \empty
- \else
- \getitemparameter\currentitemlevel\c!before
- \fi\fi}
-
-\def\itemaftercommand
- {\ifconditional\nowhitelistitem
- \ifconditional\afterlistitem
- \ifcase\currentitemlevel\or\getitemparameter\currentitemlevel\c!after\fi
- \else
- \nowhitespace
- \fi
- \else\ifconditional\joinedlistitem
- % \empty
- \else
- \getitemparameter\currentitemlevel\c!after
- \fi\fi}
-
-\def\iteminbetweencommand
- {\ifconditional\nowhitelistitem
- \nowhitespace
- \else\ifconditional\joinedlistitem
- % \empty
- \else
- \getitemparameter\currentitemlevel\c!inbetween
- \fi\fi}
-
-\def\itembeforeheadcommand
- {\ifconditional\nowhitelistitem
- \nowhitespace
- \else\ifconditional\joinedlistitem
- % \empty
- \else
- \getitemparameter\currentitemlevel\c!beforehead
- \fi\fi}
-
-\def\itemafterheadcommand
- {\ifconditional\nowhitelistitem
- \nowhitespace
- \else\ifconditional\joinedlistitem
- % \empty
- \else
- \getitemparameter\currentitemlevel\c!afterhead
- \fi\fi}
-
-% \def\dosetuppackeditemgroup#1%
-% {\setitemparameter{#1}\c!beforehead{\packeditemspacing}%
-% \setitemparameter{#1}\c!afterhead {\packeditemspacing}%
-% \setitemparameter{#1}\c!before {\packeditemspacing}%
-% \setitemparameter{#1}\c!after {\packeditemspacing}%
-% \setitemparameter{#1}\c!inbetween {\packeditemspacing}}
-
-\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}\c!option{#2}}}%
-
-\def\dodododosetupitemgroup[#1][#2]%
- {\ConvertToConstant\doifnot{#2}{}
- {\doifelse{#1}\v!each
- {\dorecurse\maxitemdepth{\ExpandFirstAfter\dododododosetupitemgroup[\recurselevel][#2]}}
- {\ExpandFirstAfter\dododododosetupitemgroup[#1][#2]}}}
-
-\def\dododosetupitemgroup[#1][#2]%
- {\ConvertToConstant\doifelse{#2}{}
- {\ifcase\currentitemlevel\relax
- \dodododosetupitemgroup[\v!each][#1]%
- \else
- \dodododosetupitemgroup[\currentitemlevel][#1]%
- \fi}
- {\doifelsenothing{#1}
- {\dodododosetupitemgroup[\currentitemlevel][#2]}
- {\dodododosetupitemgroup[#1][#2]}}}
-
-\def\dodosetupitemgroup[#1][#2][#3][#4]%
- {\pushmacro\currentitemgroup
- \def\currentitemgroup{#1}%
- \dododosetupitemgroup[#2][#3]%
- \ConvertToConstant\doifnot{#4}{} % anders wordt #2 overruled
- {\dododosetupitemgroup[#2][#4]}%
- \popmacro\currentitemgroup}
-
-\def\dosetupitemgroup[#1][#2][#3][#4]%
- {\def\docommand##1{\dodosetupitemgroup[##1][#2][#3][#4]}%
- \processcommalist[#1]\docommand}
-
-\def\setupitemgroup
- {\doquadrupleempty\dosetupitemgroup}
-
-\def\doadvanceitem
- {\ifconditional\sublistitem\else\ifconditional\symbollistitem\else
- \pluscounter{\@@itemcounter\currentitemlevel}%
- \fi\fi}
-
-\def\setitemlevel#1%
- {\ifnum\currentitemlevel>\zerocount
- \settrue\firstlistitem
- % \expanded{\setitemparameter{\currentitemlevel}{\c!start}{1}}% ***
- \doifinset{0}{#1}{\setitemparameter\currentitemlevel\c!start{0}}% ***
- \setcounter{\@@itemcounter\currentitemlevel}{\the\numexpr\getitemparameter\currentitemlevel\c!start-1\relax}% ***
- \doifelsenothing{\getitemparameter\currentitemlevel\c!start}
- {\def\currentitemoffset{1}}
- {\def\currentitemoffset{\getitemparameter\currentitemlevel\c!start}%
- \letitemparameter\currentitemlevel\c!start\empty}%
- \def\tempnumber
- {\countervalue{\@@itemcounter\currentitemlevel}}%
- \doifelse{\getitemparameter\currentitemlevel\c!placestopper}\v!yes
- {\def\tempsymbol{\getitemparameter\currentitemlevel\c!stopper}}
- {\let\tempsymbol\empty}%
- \fi}
-
-
-\def\actualitemnumber
- {\ifconditional\reverselistitem
- \convertnumber\currentitemsymbol{\numexpr\currentmaxnofitems+\currentitemoffset-\currentitemnumber+1\relax}%
- \else
- \convertnumber\currentitemsymbol{\numexpr\currentminnofitems+\currentitemoffset+\currentitemnumber-1\relax}%
- \fi}
-
-% PAS OP: ook 'opelkaar' en zo worden getest, nog eens afvangen!
-
-\def\unknownitemsymbol{?}
-
-\def\setitemmark#1% % en pas op: resets \docommand
- {\doifsymboldefinedelse{#1}
- {\edef\currentitemsymbol{#1}%
- \setxvalue{\@@globalitemsymbol\currentitemlevel}{\currentitemsymbol}%
- \setgvalue{\@@localitemsymbol \currentitemlevel}{\unknownitemsymbol}%
- \def\listitem{\symbol[\currentitemsymbol]}%
- \let\@@opsymbol\empty}% \let\docommand\gobbleoneargument}
- {\doifconversiondefinedelse{#1}
- {\edef\currentitemsymbol{#1}%
- \setxvalue{\@@globalitemsymbol\currentitemlevel}{\currentitemsymbol}%
- \setgvalue{\@@localitemsymbol\currentitemlevel }{\actualitemnumber }%
- \ifconditional\textlistitem
- \doifsomething{\getitemparameter\currentitemlevel\c!lefttext}
- {\let\tempsymbol\empty}%
- \fi
- \def\listitem
- {\getitemparameter\currentitemlevel
- {\ifconditional\textlistitem\c!lefttext\else\c!left\fi}%
- \getvalue{\@@localitemsymbol\currentitemlevel}\tempsymbol
- \getitemparameter\currentitemlevel
- {\ifconditional\textlistitem\c!righttext\else\c!right\fi}}%
- \let\@@opsymbol\empty}%\let\docommand\gobbleoneargument}
- {}}}
-
-\def\calculatelistwidth#1#2% distance deals with 'broad'
- {#2=\getitemparameter{#1}\c!distance\relax
- \ifnum\getitemparameter{#1}\c!factor>\zerocount
- \ifdim#2=\zeropoint #2=.5em\fi
- \fi
- \multiply#2 \getitemparameter{#1}\c!factor
- \advance #2 \getitemparameter{#1}\c!width\relax}
-
-% The next conditionals deal with \item \startitemgroup. It
-% looks like a hack to skip back, but that way we preserve
-% the indentation and bullet placement. It's a rather
-% untested feature.
-
-\newconditional\concatnextitem \setfalse\concatnextitem
-\newconditional\autoconcatnextitem \settrue \autoconcatnextitem
-\newsignal \itemsignal
-
-\def\startitemgroup
- {\dotripleempty\dostartitemgroup}
-
-% \def\dostartitemgroup[#1][#2][#3]%
-% {\bgroup
-% \def\currentitemgroup{#1}%
-% \ifthirdargument
-% \dodostartitemgroup[#2][#3]%
-% \else
-% \doifassignmentelse{#2}
-% {\dodostartitemgroup[][#2]}
-% {\dodostartitemgroup[#2][]}%
-% \fi}
-
-\def\dostartitemgroup[#1][#2][#3]%
- {\bgroup
- \ifnum\currentitemlevel=\zerocount
- \def\currentitemgroup{#1}% no nested mixing of itemgroups
- \fi
- \ifthirdargument
- \dodostartitemgroup[#2][#3]%
- \else
- \doifassignmentelse{#2}
- {\dodostartitemgroup[][#2]}
- {\dodostartitemgroup[#2][]}%
- \fi}
-
-\def\dodostartitemgroup[#1]% [#2]%
- {\relax % prevents lookahead
- \ifnum\currentitemlevel=\maxitemdepth\relax
- \showmessage\m!layouts9{\number\maxitemdepth}%
- \let\itemincrement\zerocount
- \else
- \let\itemincrement\plusone
- \fi
- \global\advance\itemdepth\itemincrement
- \xdef\currentitemlevel{\number\itemdepth}%
- \initializeitemgrouplevel\currentitemlevel % safeguard
- \edef\itemgroupoptions{\getitemparameter\currentitemlevel\c!option}%
- \ifx\itemgroupoptions\empty
- \edef\itemgroupoptions{#1}%
- \else
- \doifsomething{#1}{\edef\itemgroupoptions{\itemgroupoptions,#1}}%
- \fi
- \expanded{\redostartitemgroup[\itemgroupoptions]}}% [#2]
-
-\let\startcollectitems\relax
-\let\stopcollectitems \relax
-
-%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}
-
-%D End of plugin.
-
-\ifx\startcolumns\undefined \def\startcolumns[#1]{} \fi
-\ifx\stopcolumns \undefined \let\stopcolumns\relax \fi
-
-\def\dosetsymalign#1% hm, we should use one of the core-spa macros or make a helper
- {\processaction
- [#1]
- [ \v!flushleft=>\let\symalignleft\relax,
- \v!right=>\let\symalignleft\relax,
- \v!flushright=>\let\symalignleft\hfill,
- \v!left=>\let\symalignleft\hfill,
- \v!middle=>\let\symalignleft\hfil,
- \v!center=>\let\symalignleft\hfil]}
-
-\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
- \ifconditional\textlistitem\else\doifnotinset\v!text{#1}\par\fi % suboptimal
- \fi
- \begingroup
- % new where, ok or not / we should integrate random, intro, continue here
- % beware, the following no longer inherit from the previous level, is this ok?
- \setfalse\reverselistitem
- \setfalse\introlistitem
- \setfalse\autointrolistitem
- \setfalse\beforelistitem
- \setfalse\afterlistitem
- \setfalse\nowhitelistitem
- \setfalse\randomizeitems
- %
- \doifinsetelse\v!intro {#1}{\settrue\introlistitem }{\setfalse\introlistitem }%
- \doifinsetelse\v!random {#1}{\settrue\randomizeitems }{\setfalse\randomizeitems }%
- \doifinsetelse\v!continue{#1}{\settrue\continuelistitems}{\setfalse\continuelistitems}%
- % == \doifinsetelse\v!intro{#1}\settrue\setfalse\introlistitem
- \global\advance\noflists\plusone
- \currentnoflists=\noflists
- \newcounter\noflistelements
- \setfalse\headlistitem
- \setfalse\sublistitem
- \setfalse\symbollistitem
- \let\marsymbol\relax
- \globallet\doitemdestination\empty
- \let\symsymbol\empty
- \let\symalignleft\relax
- \the\itemgroupcommands
-\checkcurrentnofitems
- % \getitemparameter\currentitemlevel\empty
- \let\listitem\empty % ** start value
- \doifelsenothing{#1} % iffirstargument
- {\edef\@@opsymbol{\getitemparameter\currentitemlevel\c!symbol}%
- \letgvalueempty{\@@globalitemsymbol\currentitemlevel}%
- \global\letitemparameter\currentitemlevel\v!continue\empty
- % \setitemmark\@@opsymbol % ** default value
- \dosetupitemgroupvariable[\currentitemlevel][#2]}
- {\dosetupitemgroupconstant[\currentitemlevel][#1]%
- \dosetupitemgroupvariable[\currentitemlevel][#2]%
- \doifinsetelse\v!continue{#1}% \noexpand, else problems in non-etex with chinese
- {\edef\@@opsymbol{\noexpand\getvalue{\@@globalitemsymbol\currentitemlevel}}%
- \getitemparameter\currentitemlevel\v!continue}
- {\edef\@@opsymbol{\noexpand\getitemparameter{\currentitemlevel}{\c!symbol}}%
- \global\setitemparameter\currentitemlevel\v!continue
- {\dosetupitemgroupconstant[\currentitemlevel][#1]%
- \dosetupitemgroupvariable[\currentitemlevel][#2]}}%
- \def\docommand##1% \setitemmark resets \docommand
- {\doifnot{##1}{0}{\setitemmark{##1}}}%
- % \processcommalist[#1,\@@opsymbol]\docommand
- \processcommalist[#1]\docommand}% ** preset sequence or provided sequence
- % moved to here, after settings
- \ifnum\currentitemlevel=\plusone % NIEUW
- \doadaptleftskip {\getitemparameter1\c!margin}%
- \doadaptleftskip {\getitemparameter1\c!leftmargin}%
- \doadaptrightskip{\getitemparameter1\c!rightmargin}%
- \fi
- \dosetraggedcommand{\getitemparameter\currentitemlevel\c!align}\raggedcommand
- \dosetsymalign{\getitemparameter\currentitemlevel\c!symalign}%
- \doifsomething{\getitemparameter\currentitemlevel\c!indenting}
- {% is \expanded needed?
- \expanded{\setupindenting[\getitemparameter\currentitemlevel\c!indenting]}}%
- %
- \setitemlevel{#1}% moved to here
- \ifx\listitem\empty
- \setitemmark\@@opsymbol % ** default value
- \ifx\listitem\empty
- \edef\currentitemsymbol{\currentitemlevel}% ** fall back
- \fi
- \fi
- \ifconditional\autointrolistitem\ifnum\prevgraf<3
- \settrue\introlistitem
- \fi\fi
- \ifconditional\paragraphlistitem
- \ifnum\currentitemlevel>\plusone
- \letitemparameter\currentitemlevel\c!inbetween\empty
- \fi
- \fi
- \ifconditional\packlistitem
- \letitemparameter\currentitemlevel\c!inbetween\empty
- \fi
- \doifinset\v!columns{#1}%
- {\ifinsidecolumns\else\ifcase\itemcolumndepth
- \global\itemcolumndepth\currentitemlevel\relax
- \itembeforecommand
- \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\currentitemlevel\c!n]%
- \startcolumns
- [\c!n=\!!counta, % netter \??op\currentitemlevel\c!n
- \c!height=,
- \c!rule=\v!off,
- \c!balance=\v!yes,
- \c!align=\v!no]%
- \fi\fi}%
-\ifconditional\fittinglistitems
- \splititemtwopassdata\currentnoflists
- \ifdim\itemdataw sp>\zeropoint
- \expanded{\setitemparameter{\currentitemlevel}{\c!width}{\itemdataw sp}}%
- \fi
-\fi
- \calculatelistwidth\currentitemlevel{\dimen0}%
- \ifdim\dimen0>\zeropoint\relax
- \ifconditional\inlinelistitem\else
- \advance\leftskip \dimen0\relax
- \fi
- \fi
- \startcollectitems}
-
-% test / example
-%
-% \startnarrower[left] \startcolumns[n=3] \startitemize
-% \item \input ward \item \input ward \item \input ward
-% \stopitemize \stopcolumns\stopnarrower \blank
-%
-% \startnarrower[left] \startitemize[columns,three]
-% \item \input ward \item \input ward \item \input ward
-% \stopitemize \stopnarrower \blank
-%
-% \setupitemize[leftmargin=1.5em] \startitemize[columns,three]
-% \item \input ward \item \input ward \item \input ward
-% \stopitemize \blank
-
-\def\stopitemgroup
- {\stopcollectitems
- \ifconditional\textlistitem
- \removeunwantedspaces\space\ignorespaces
- \else
- \par
- \fi
- \dolistreference
- \ifconditional\firstlistitem \else \endgroup \fi % toegevoegd, eerste \som opent groep
- \ifnum\itemcolumndepth=\currentitemlevel\relax
- \stopcolumns
- \global\itemcolumndepth\zerocount
- \itemaftercommand
- \dontrechecknextindentation
- \else
- \ifnum\currentitemlevel=\plusone
- \doitembreak\allowbreak % toegevoegd
- \itemaftercommand % \getitemparameter\currentitemlevel\c!after
- % was: \dochecknextindentation\??oo, is now:
- \dochecknextindentation{\??op\currentitemgroup\currentitemlevel}%
- \else
- % nieuw, not yet nobreak handling
- \ifcase\autoitemgroupspacing
- \itemaftercommand
- \or
- \itemaftercommand
- \fi
- \dontrechecknextindentation
- \fi
- \fi
- % new test, needed in sidefloats (surfaced in volker's proceedings)
- \ifconditional\textlistitem % else forgotten
- \endgroup
- \global\advance\itemdepth-\itemincrement
- \xdef\currentitemlevel{\number\itemdepth}%
- \egroup
- \else
- \endgroup
- \global\advance\itemdepth-\itemincrement
- \xdef\currentitemlevel{\number\itemdepth}%
- \egroup
- \par
- \fi
- \dorechecknextindentation}
-
-\newtoks\itemgroupcommands
-
-\def\itemgroupitem
- {\doitemgroupitem}
-
-\def\itemgroupnoitem
- {\doitemgroupnoitem}
-
-\def\itemgroupbutton[#1]%
- {\gdef\doitemdestination{#1}%
- \itemgroupitem}
-
-\def\itemgroupdummy
- {\itemgroupsymbol{\strut}\strut}
-
-\def\itemgroupsubitem
- {\settrue\sublistitem
- \itemgroupitem}
-
-\def\itemgroupsymbol#1%
- {\def\symsymbol{\doitemattributes\currentitemlevel\c!symstyle\c!symcolor{#1}}%
- \settrue\symbollistitem
- \itemgroupitem}
-
-\def\itemgroupedge#1%
- {\itemgroupsymbol
- {\calculatelistwidth\currentitemlevel{\dimen0}%
- \hbox to \dimen0
- {#1\hskip\getitemparameter\currentitemlevel\c!distance}}}
-
-\def\itemgrouphead
- {\settrue\headlistitem\doitemgrouphead}
-
-\def\itemgroupitems
- {\dosingleempty\doitemgroupitems}
-
-\def\doitemgroupitems[#1]%
- {\itemgroupedge
- {\dorecurse{0\getitemparameter\currentitemlevel\c!items}{\listitem\hss}%
- \unskip}}
-
-\def\itemgroupmargin#1%
- {\def\marsymbol
- {\llap
- {\doitemattributes\currentitemlevel\c!marstyle\c!marcolor{#1}%
- \hskip\leftskip\hskip\leftmargindistance}}%
- \itemgroupitem}
-
-\appendtoks \let\item \itemgroupitem \to \itemgroupcommands
-\appendtoks \let\noitem \itemgroupnoitem \to \itemgroupcommands
-\appendtoks \letvalue\v!item \itemgroupitem \to \itemgroupcommands
-\appendtoks \let\itm \itemgroupitem \to \itemgroupcommands
-\appendtoks \let\but \itemgroupbutton \to \itemgroupcommands
-\appendtoks \let\nop \itemgroupdummy \to \itemgroupcommands
-\appendtoks \letvalue\v!sub \itemgroupsubitem \to \itemgroupcommands
-\appendtoks \letvalue\v!sym \itemgroupsymbol \to \itemgroupcommands
-\appendtoks \letvalue\v!ran \itemgroupedge \to \itemgroupcommands
-\appendtoks \letvalue\v!head \itemgrouphead \to \itemgroupcommands
-\appendtoks \letvalue\v!its \itemgroupitems \to \itemgroupcommands
-\appendtoks \letvalue\v!mar \itemgroupmargin \to \itemgroupcommands
-
-% todo : \startitem .. \stopitem
-
-\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
-% \item test
-% \item test
-% \headsym{xx} test \par test
-% \stopitemize
-
-% aligned items
-%
-% \startitemize[n,fit,broad][itemalign=flushright]
-% \dorecurse{100}{\item The first item.}
-% \stopitemize
-%
-% \setupitemgroup[itemize][each][fit]
-% \setupitemgroup[itemize][each][distance=.5em,factor=1,itemalign=flushright]
-%
-% \startitemize[n]
-% \dorecurse{100}{\item The first item.}
-% \stopitemize
-
-\appendtoks \let\headsym \itemgroupheadsym \to \itemgroupcommands
-
-\def\itemgroupheadsym#1%
- {\def\symsymbol{\doitemattributes\currentitemlevel\c!symstyle\c!symcolor{#1}}%
- \settrue\symbollistitem
- \settrue\headlistitem
- \doitemgrouphead}
-
-% \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\currentitemlevel\c!headstyle\c!headcolor{#1}}%
- \settrue\symbollistitem
- \settrue\txtlistitem
- \itemgroupitem}
-
-\def\itembreak % -10
- {\flushnotes\penalty-5\relax}
-
-\def\itemnobreak % +5
- {\flushnotes\penalty+5\ifinsidecolumns\else00\fi\relax}
-
-\def\dodotxtitem
- {\scratchdimen\wd8
- \advance \scratchdimen \getitemparameter\currentitemlevel\c!distance\relax
- \ifdim\scratchdimen>\dimen0
- \advance\scratchdimen -\dimen0
- \else
- \scratchdimen\zeropoint
- \fi
- \llap{\hbox to \dimen0{\ifconditional\sublistitem\llap{+}\fi\box8\hss}}% was: \hfill
- \hskip\scratchdimen}
-
-\def\optimizelistitemsbreak
- {\ifcase\itemcolumndepth \ifconditional\optimizelistitem
- \ifcase \currentnofitems \else
- \ifnum\currentnofitems=\plusthree
- \ifnum\noflistelements>\plusone
- \doitembreak\itemnobreak
- \fi
- \else\ifnum\currentnofitems>\plusthree
- \ifnum\noflistelements=\plustwo
- \ifconditional\introlistitem
- \doitembreak\nobreak
- \else
- \doitembreak\itemnobreak
- \fi
- \else\ifnum\currentnofitems=\noflistelements\relax
- \doitembreak\itemnobreak
- \else\ifnum\noflistelements>\plustwo
- \doitembreak\itembreak
- \else
- \ifconditional\introlistitem\else\doitembreak\itembreak\fi
- \fi\fi\fi
- \fi\fi
- \fi
- \fi\fi}
-
-\def\dolistitem % evt aantal items opslaan per niveau, scheelt zoeken
- {\ifconditional\textlistitem
- % begin of item
- \else
- \par
- \fi
-% \ignorespaces
- \increment\noflistelements
- \optimizelistitemsbreak
- \noindent
- \setbox8\hbox
- {\ifconditional\headlistitem
- \ifconditional\symbollistitem
- \symsymbol
- \else
- \doitemattributes\currentitemlevel\c!headstyle\c!headcolor{\listitem}%
- \fi
- \else
- \ifconditional\symbollistitem
- \symsymbol % no attributes, why?
- \else
- \doitemattributes\currentitemlevel\c!style\c!color{\listitem}%
- \fi
- \fi}%
-\ifconditional\fittinglistitems
- \ifdim\wd8>\getitemparameter\currentitemlevel\c!maxwidth sp\relax
- \expanded{\global\noexpand\setitemparameter{\currentitemlevel}{\c!maxwidth}{\number\wd8}}%
- \fi
- \splititemtwopassdata\currentnoflists
- \ifdim\itemdataw sp>\zeropoint
- \setbox8\simplealignedbox{\getitemparameter\currentitemlevel\c!itemalign}{\itemdataw sp}{\box8}%
- \fi
-\fi
- \doifsomething\doitemdestination
- {\setbox8\hbox{\goto{\box8}[\doitemdestination]}}%
- \globallet\doitemdestination\empty
- \dimen2=\getitemparameter\currentitemlevel\c!width\relax
- % new, prevents loops when symbol is (not yet found) graphic
- \ht8=\strutheight
- \dp8=\strutdepth
- % so that content differs per run (esp mp graphics afterwards)
- \checkforrepeatedlistitem
- \ifdim\dimen2<\zeropoint\relax
- \llap{\ifconditional\sublistitem\llap{+}\fi\box8\hskip\leftmargindistance}%
- \else
- \ifdim\dimen2=\zeropoint\relax
- \calculatelistwidth1{\dimen0}%
- \else
- \calculatelistwidth\currentitemlevel{\dimen0}%
- \fi
- \ifconditional\textlistitem
- \hbox{\ifconditional\sublistitem+\fi\box8\hskip\interwordspace}\nobreak
- \else\ifconditional\inlinelistitem
- \hbox to \dimen0{\ifconditional\sublistitem\llap{+}\fi\box8\hss}% was: \hfill
- \else\ifconditional\txtlistitem
- \dodotxtitem
- \else
- % todo: align+marge binnen de hbox
-% \llap{\hbox to \dimen0{\ifconditional\sublistitem\llap{+}\fi\box8\hfill}}%
- \llap{\hbox to \dimen0{\ifconditional\sublistitem\llap{+}\fi
- \symalignleft
- \box8\hfil
- \hskip\getitemparameter\currentitemlevel\c!distance% T h
- }}%
- \fi\fi\fi
- \fi
- \forceunexpanded % needed for m conversion (\os) / i need to look into this
- \setevalue{\@@currentitemsymbol\currentitemlevel}%
- {\getvalue{\@@localitemsymbol\currentitemlevel}}% still problems with \uchar ?
- %{\noexpand\getvalue{\@@localitemsymbol\currentitemlevel}}% no, spoils subrefs
- \resetunexpanded
- \setfalse\headlistitem
- \setfalse\sublistitem
- \setfalse\symbollistitem
- \EveryPar{\ignorespaces}% needed ?
- \ignorespaces}
-
-% For Wolfgang Schuster
-
-% \startitemize[n,repeat]
-% \noitem \startitemize[a] \item Item 1.a. \item Item 1.b. \stopitemize
-% \noitem \startitemize[a] \item Item 2.a. \item Item 2.b. \stopitemize
-% \stopitemize
-
-\def\donolistitem % reduced \dolistitem
- {\increment\noflistelements
- \setbox8\hbox
- {\doitemattributes\currentitemlevel\c!style\c!color{\listitem}}%
- \checkforrepeatedlistitem
- \ignorespaces}
-
-\def\doitemgroupnoitem
- {\doadvanceitem\donolistitem}
-
-% For Frank Grieshaber and Mojca Miklavec:
-
-\newconditional\repeatlistitem
-
-\def\checkforrepeatedlistitem
- {\ifnum\currentitemlevel=\plusone
- \initializeboxstack{item}%
- \fi
- \ifconditional\repeatlistitem
- \savebox{item}{\currentitemlevel}{\hbox{\copy8}}%
- \setbox8\hbox to \wd8
- {\setbox\scratchbox\hbox
- {\scratchcounter\currentitemlevel
- \advance\scratchcounter\minusone
- \dorecurse\scratchcounter{\foundbox{item}{\recurselevel}}}%
- \ifnum\currentitemlevel>\plusone
- \ifdim\wd\scratchbox>\zeropoint
- \hskip-\dimen2
- \box\scratchbox
- \fi
- \fi
- \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]%
- {\ifconditional\textlistitem
- % begin of item
- \else
- \par
- \fi
-% \ignorespaces
- \ifconditional\concatnextitem % new, concat
- \doitembreak\nobreak % new, concat
- \fi % new, concat
- \doadvanceitem
- \ifcase\itemcolumndepth \ifnum\noflistelements>0\relax
- % wrong, but why was this here in the first place, probably some
- % mistaken change when cleaning up: \doitembreak\nobreak
- \fi\fi
- \ifconditional\firstlistitem
- \setfalse\firstlistitem
- \begingroup
- \ifcase\currentitemlevel
- \or % 1
- \ifcase\itemcolumndepth
- \ifconditional\introlistitem\doitembreak\nobreak\fi
- \itembeforecommand % \getitemparameter\currentitemlevel\c!before
- \ifconditional\introlistitem\doitembreak\nobreak\fi
- \fi
- \else % 2 en hoger
- \ifconditional\paragraphlistitem \else
- \let\previtemlevel\currentitemlevel
- \decrement\previtemlevel
- \ifcase\autoitemgroupspacing\relax % nieuw
- \itembeforecommand
- \or
- \doifelsenothing{\itembeforecommand}
- {\itembeforecommand}
- {\getitemparameter\previtemlevel\c!inbetween}%
- \else
- \getitemparameter\previtemlevel\c!inbetween % == itemlevel-1
- \fi
- \fi
- \fi
- \else
-\ifconditional\textlistitem % was bugged: \inlinelistitem
-% \removeunwantedspaces\hskip\interwordspace\!!plus\emwidth\relax % new per 2006/10/20
- \removeunwantedspaces\hskip\emwidth\!!plus\interwordstretch\!!minus\interwordshrink\relax % new per 2006/10/20
-\else
- \iteminbetweencommand
-\fi
- \fi
- \ifconditional\concatnextitem % new, concat
- \vskip-\lastskip % new, concat
- \vskip-\lineheight % new, concat
- \nobreak % new, concat
- \fi % new, concat
-% \ignorespaces
- \dolistitem
- \relax
- \ifconditional\packlistitem
- \setupwhitespace[\v!none]%
- \fi
- \getitemparameter\currentitemlevel\c!inner
- \marsymbol
- \let\marsymbol\relax
- \doifsomething{#1}
- {\doifnot\itemreference\unknownitemreference
- {\bgroup
- \protectconversion
- \rawreference\s!lst{#1}\itemreference
- \egroup}}%
- \strut % added 11-08-99
- \setfalse\concatnextitem % new, concat
- \nobreak % else problems with intext items
- \hskip\itemsignal % new, concat
- \getitemparameter\currentitemlevel\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[]\begstrut#2\endstrut\par
- \stopitemgroup}
-
-\definecomplexorsimpleempty\item
-\definecomplexorsimpleempty\doitemgroupitem
-
-\def\complexhead[#1]#2\par#3\par
- {\startitemgroup[#1]%
- \complexdoitemgrouphead[]\begstrut#2\endstrut\par\begstrut#3\endstrut\par
- \stopitemgroup}
-
-% \def\complexdoitemgrouphead[#1]#2\par% % beter in \complexdosom hangen met een if
-% {\ifconditional\firstlistitem\else\doitembreak\allowbreak\fi
-% \ifconditional\packlistitem\else\itembeforeheadcommand\fi
-% \ifconditional\firstlistitem\ifconditional\introlistitem\else\ifcase\currentitemlevel % incr in \complexdosom
-% \doitembreak\allowbreak
-% \fi\fi\fi
-% \complexdoitemgroupitem[#1]{\doitemattributes\currentitemlevel\c!headstyle\c!headcolor
-% {\ignorespaces#2}}%
-% \ifconditional\textlistitem
-% \removeunwantedspaces\space\ignorespaces
-% \else
-% \par
-% \fi
-% \doitembreak\nobreak
-% \ifconditional\packlistitem\else\itemafterheadcommand\fi
-% \doitembreak\nobreak
-% \noindentation}
-%
-% the next solution accepts \head test \type{x{x}x} test ...
-
-\def\dostartitemattributes#1{\dostartattributes{\??op\currentitemgroup#1}}
-\def\dostopitemattributes {\dostopattributes}
-
-\def\complexdoitemgrouphead[#1]% beter in \complexdosom hangen met een if
- {\ifconditional\firstlistitem\else\doitembreak\allowbreak\fi
- \ifconditional\packlistitem\else\itembeforeheadcommand\fi
- \ifconditional\firstlistitem\ifconditional\introlistitem\else\ifcase\currentitemlevel % incr in \complexdosom
- \doitembreak\allowbreak
- \fi\fi\fi
- \complexdoitemgroupitem[#1]%
- \bgroup
- \dostartitemattributes\currentitemlevel\c!headstyle\c!headcolor\empty
- \ignorespaces
- \let\par\enditemhead} % brrrr but simple anyway
-
-\def\enditemhead
- {\removeunwantedspaces
- \dostopitemattributes
- \egroup
- \ifconditional\textlistitem
- \space\ignorespaces
- \else
- \par
- \fi
- \doitembreak\nobreak
- \ifconditional\packlistitem\else\itemafterheadcommand\fi
- \doitembreak\nobreak
- \noindentation}
-
-\definecomplexorsimpleempty\head
-\definecomplexorsimpleempty\doitemgrouphead
-
-% \def\sym#1%
-% {\noindent
-% \begingroup
-% \setbox\scratchbox\hbox{\trialtypesettingtrue#1}%
-% \setbox\scratchbox\hbox
-% \ifdim\wd\scratchbox<1em to 1.5\else spread 1\fi em{#1\hfil}%
-% \hangindent\wd\scratchbox
-% \box\scratchbox
-% \endgroup
-% \ignorespaces}
-
-\def\sym#1%
- {\noindent
- \begingroup
- \setbox\scratchbox\hbox{\trialtypesettingtrue#1}%
- \setbox\scratchbox\hbox
- \ifdim\wd\scratchbox<1em to 1.5\else spread 1\fi em{#1\hfil}%
- \expanded{\box\scratchbox\endgroup\hangindent\the\wd\scratchbox}%
- \ignorespaces}
-
-\setupitemgroups % undocumented
- [\c!levels=6,
- \c!margin=\zeropoint,
- \c!leftmargin=\zeropoint,
- \c!rightmargin=\zeropoint,
- \c!indentnext=\v!yes,
- \c!width=1.5em,
- \c!factor=0,
- \c!distance=.5em,
- %\c!align=\v!normal, % definitely not \v!normal, see mails and
- \c!align=, % debug reports of David A & Patrick G on context list
- \c!symalign=,
- \c!color=,
- \c!indenting=, % untouched if empty
- \c!color=,
- \c!style=, % kan tzt weg
- \c!marstyle=\c!type, % \c! ???
- \c!symstyle=,
- \c!headstyle=,
- \c!marcolor=,
- \c!symcolor=,
- \c!headcolor=,
- \c!beforehead=,
- \c!afterhead=\blank,
- \c!before=\blank,
- \c!inbetween=\blank,
- \c!after=\blank,
- \c!stopper=.,
- \c!placestopper=\v!yes,
- \c!inner=,
- \c!n=2,
- \c!items=4,
- \c!lefttext=(,
- \c!righttext=),
- \c!start=1,
- \c!option=,
- \c!command=\defaultitemcommand,
- \c!symbol=\currentitemlevel] % \v!niveau
-
-\def\defineitemgroup
- {\dodoubleempty\dodefineitemgroup}
-
-\def\dodefineitemgroup[#1][#2]%
- {\doifsomething{#1}
- {\pushmacro\currentitemgroup
- \def\currentitemgroup{#1}%
- \setvalue{\e!start#1}{\startitemgroup[#1]}%
- \setvalue{\e!stop#1}{\stopitemgroup}%
- \setvalue{\e!setup#1\e!endsetup}{\setupitemgroup[#1]}%
- \getparameters[\??ig#1][\c!levels=3,#2]%
- \ifnum\getvalue{\??ig#1\c!levels}<\maxitemdepth\relax
- \setevalue{\??ig#1\c!levels}{\number\maxitemdepth}%
- \fi
- \dorecurse{\getvalue{\??ig#1\c!levels}}{\initializeitemgrouplevel\recurselevel}%
- \popmacro\currentitemgroup}}
-
-% efficient default itemize as well as upward compatible
-% definition:
-
-\defineitemgroup [\v!itemize] [\c!levels=6]
-
-% keep these, needed for styles:
-
-% \def\startitemize {\startitemgroup[\v!itemize]}
-% \def\stopitemize {\stopitemgroup}
-% \def\setupitemize {\setupitemgroup[\v!itemize]}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/strc-lnt.mkii b/Master/texmf-dist/tex/context/base/mkii/strc-lnt.mkii
deleted file mode 100644
index 3c878a8d232..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/strc-lnt.mkii
+++ /dev/null
@@ -1,197 +0,0 @@
-%D \module
-%D [ file=strc-lnt,
-%D version=2002.05.10,
-%D title=\CONTEXT\ Structure Macros,
-%D subtitle=Line Notes,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Structure Macros / Line Notes}
-
-%D This module loads on top of the footnote and line numbering macros.
-
-\unprotect
-
-\newcounter\linenotecounter
-\newtoks \collectedlinenotes
-\newif \iftracelinenotes
-
-\appendtoks
- \the\collectedlinenotes
-\to \everylinenumber
-
-\appendtoks
- \global\collectedlinenotes\emptytoks
-\to \beforeeverylinenumbering
-
-\def\dohandlelinenote#1#2#3%
- {\bgroup
- \expanded{\beforesplitstring#2}\at--\to\linenotelinenumber
- \ifnum\linenotelinenumber=\linenumber\relax
- % todo: \onlyfootnote{#2}{#3}% == configurable
- % \setupnote[#1][\c!numbercommand=\gobbleoneargument]%
- % \setnotetext[#1]{\rawreference\s!fnt{\s!fnt:f:\number\internalnotereference}{}#2: #3}%
- \def\linenotelinenumber##1{#2}%
- \setupnote[#1][\c!numbercommand=\linenotelinenumber,\c!textcommand=\gobbleoneargument]%
- \setnote[#1]{#3}%
- \fi
- \egroup}
-
-\def\dotracedlinenote#1%
- {\iftracelinenotes
- \hbox to \zeropoint
- {\forgetall
- \localcolortrue
- \hsize\zeropoint
- \hss
- \vbox to \strutheight{\llap{\red\infofont\setstrut\linenotecounter}\vss}%
- {\color[blue]{\vl}}%
- \vbox to \strutheight{\rlap{\red\infofont\setstrut#1}\vss}%
- \hss}%
- \prewordbreak
- \fi}
-
-\def\dolinenote#1#2%
- {\doglobal\increment\linenotecounter
- \doifreferencefoundelse{\??rr:\linenotecounter}%
- {\expanded{\doglobal\noexpand\appendtoks\noexpand\dohandlelinenote
- {#1}{\currenttextreference}}{#2}\to\collectedlinenotes}
- \donothing
- \dotracedlinenote\empty
- \expanded{\someline[\??rr:\linenotecounter]}}
-
-\def\dostartlinenote#1[#2]#3%
- {\doifreferencefoundelse{\??rr:#2}%
- {\expanded{\doglobal\noexpand\appendtoks\noexpand\dohandlelinenote
- {#1}{\currenttextreference}}{#3}\to\collectedlinenotes}
- \donothing
- \dotracedlinenote{#2}%
- \startline[\??rr:#2]}
-
-\def\dostoplinenote#1[#2]%
- {\stopline[\??rr:#2]}
-
-% defining them
-
-\def\definelinenote
- {\dodoubleempty\dodefinelinenote}
-
-\def\dodefinelinenote[#1][#2]%
- {\definenote[#1][#2]%
- \setvalue {#1}{\dolinenote {#1}}%
- \setvalue{\e!start#1}{\dostartlinenote{#1}}%
- \setvalue{\e!stop #1}{\dostoplinenote {#1}}}
-
-\def\setuplinenote % convenient
- {\setupnote}
-
-% We predefine one, namely \type {\linenote} cum suis.
-
-\definelinenote[\v!linenote]
-
-% \startbuffer[test]
-% \startlinenumbering[100]
-% test \linenote {oeps} test test test test test test
-% test \startlinenote [well] {oeps} test test test test test test
-% test \linenote {oeps} test test test test test test
-% test \linenote {oeps} test test test test test test
-% test \linenote {oeps} test test test test test test
-% test \linenote {oeps} test test test test test test
-% test \stoplinenote [well] test test test test test test
-% \stoplinenumbering
-% \stopbuffer
-%
-% \setupnotedefinition[linenote] [location=serried,distance=.5em]
-%
-% {\typebuffer[test] \getbuffer[test]} \page
-%
-% \startbuffer[setup]
-% \setuplinenumbering
-% [align=left]
-% \stopbuffer
-%
-% {\typebuffer[setup] \getbuffer[setup,test]} \page
-%
-% \startbuffer[setup]
-% \setuplinenumbering
-% [width=1em,
-% align=left]
-% \stopbuffer
-%
-% {\typebuffer[setup] \getbuffer[setup,test]} \page
-%
-% \startbuffer[setup]
-% \setuplinenumbering
-% [width=2em,
-% distance=.5em,
-% align=left]
-% \stopbuffer
-%
-% {\typebuffer[setup] \getbuffer[setup,test]} \page
-%
-% \startbuffer[setup]
-% \setuplinenumbering
-% [width=2em,
-% align=middle]
-% \stopbuffer
-%
-% {\typebuffer[setup] \getbuffer[setup,test]} \page
-%
-% \startbuffer[setup]
-% \setuplinenumbering
-% [conversion=romannumerals,
-% start=1,
-% step=1,
-% location=text,
-% style=slanted,
-% color=blue,
-% width=1.5em]
-% \stopbuffer
-%
-% {\typebuffer[setup] \startnarrower\getbuffer[setup,test]\stopnarrower} \page
-%
-% \startbuffer[setup]
-% \setuplinenumbering
-% [width=4em,
-% left=--,
-% right=--,
-% align=middle]
-% \stopbuffer
-%
-% {\typebuffer[setup] \getbuffer[setup,test]} \page
-%
-% \startbuffer[setup-1]
-% \setuplinenumbering
-% [style=\bfxx,
-% command=\WatchThis]
-% \stopbuffer
-%
-% \startbuffer[setup-2]
-% \def\WatchThis#1%
-% {\ifodd\linenumber
-% \definecolor[linecolor][red]%
-% \else
-% \definecolor[linecolor][green]%
-% \fi
-% \inframed
-% [offset=1pt,frame=off,background=color,backgroundcolor=linecolor]
-% {#1}}
-% \stopbuffer
-%
-% {\typebuffer[setup-1,setup-2] \getbuffer[setup-1,setup-2,test]} \page
-%
-% \startbuffer[setup-1]
-% \setuplinenumbering
-% [location=inright,
-% style=\bfxx,
-% command=\WatchThis]
-% \stopbuffer
-%
-% {\typebuffer[setup-1] \getbuffer[setup-1,setup-2,test]} \page
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/strc-lst.mkii b/Master/texmf-dist/tex/context/base/mkii/strc-lst.mkii
deleted file mode 100644
index ffb1a4dbde4..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/strc-lst.mkii
+++ /dev/null
@@ -1,1150 +0,0 @@
-%D \module
-%D [ file=strc-lst,
-%D version=1997.03.31,
-%D title=\CONTEXT\ Structure Macros,
-%D subtitle=Lists,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Structure Macros / Lists}
-
-\unprotect
-
-% \getlistlevel[hoofdstuk]\test{0} \test
-
-% can be made faster if needed
-
-\def\getlistlevel[#1]#2#3% [list] \variable \default
- {\doifdefinedelse{\??ko#1\c!section}
- {\edef#2{\getvalue{\??ko#1\c!section}}%
- \doifdefinedelse{\??se#2\c!level}
- {\edef#2{\getvalue{\??se#2\c!level}}}
- {\edef#2{#3}}}
- {\edef#2{#3}}}
-
-% Auto cross document links work by either using logical or
-% page references, depending on the general settings. The
-% locations are stored in global references where the auto tag
-% number uses the text container. We use reference mapping
-% (define reference) to keep track of the current ref.
-
-% \@@sectie == current level
-
-\def\dowritetolist#1%
- {\doifelsevalue{\??li#1\c!state}\v!start
- \dodowritetolist\gobblefourarguments{#1}}
-
-\long\def\dodowritetolist#1#2#3#4%
- {\begingroup
- \expanded{\everylistentry\emptytoks\the\everylistentry}% \emptytoks, else loop
- \def\currentlist{#1}% evt naar dowritetolist
- \defconvertexpanded\asciilistentry{\getvalue{\??li\currentlist\c!expansion}}{#3}%
- \makesectionformat
- \doifelse\@@nmstate\v!start
- {\def\dopagenummer{\noexpand\pagenumber}}
- {\let\dopagenummer\!!zerocount}%
- % niet waterdicht, wat te doen met figuren en zo
- % first hack: scheelt rommel, second hack: alleen koppen
- \doifelsevalue{\??rf\currentlist\c!state}\v!start
- {\doif{\@@sectionlevel\@@sectie}{0}\autocrossdocumentfalse}
- {\autocrossdocumentfalse}%
- % weak and inefficient
- \ifautocrossdocument
- \bgroup
- \thisisnextinternal\currentlist
- %\thisisdestination{\currentlist::\sectionformat}%
- \expanded{\setsectieenkoppeling{\currentlist}}%
- \edef\currentlevel{\@@sectionlevel\@@sectie}%
- \processcommacommand[\crossdocumentreferences]\dododowritetolist
- \egroup
- \else
- \thisisnextinternal\currentlist
- \fi
- \expanded
- {\writeutilitycommand % todo: also an immediate option
- {\noexpand\listentry
- {\currentlist}%
- {\nextinternalreference}%
- {#2}%
- {\asciilistentry}%
- {\sectionformat\sectionseparator\sectionseparator\dopagenummer}%
- {\noexpand\realfolio}}}%
- \endgroup}
-
-\def\dododowritetolist#1%
- {\def\docommand##1%
- {\doifvalue{\??rf##1\c!state}\v!start
- {\setsectieenkoppeling{##1}%
- \def\level{\@@sectionlevel\@@sectie}%
- \ifnum\level>\currentlevel
- \expanded{\definereference[#1::##1][\v!none]}%
- \else\ifnum\level=\currentlevel
- \expanded{\definereference[#1::##1][#1::{##1::\sectionformat}]}%
- \fi\fi}}%
- \processcommacommand[\crossdocumentelements]\docommand}
-
-% so far
-
-\def\dowritebetweenlist#1#2%
- {\doifvalue{\??li#1\c!state}\v!start
- {\begingroup
- \defconvertedargument\ascii{#2}%
- \makesectionformat
- \doifelse{\@@nmstate}\v!start
- {\def\dopagenummer{\noexpand\pagenumber}}
- {\let\dopagenummer\!!zerocount}%
- \expanded
- {\writeutilitycommand
- {\noexpand\listbetween
- {#1}%
- {\ascii}%
- {\sectionformat\sectionseparator\sectionseparator\dopagenummer}%
- {\noexpand\realfolio}}}%
- \endgroup}}
-
-% experimental (no nodes in mvl), needed for naw
-
-\def\immediatetolist[#1]#2#3#4%
- {\begingroup
- \defconvertexpanded\asciilistentry{\getvalue{\??li#1\c!expansion}}{#3}%
- \makesectionformat
- \immediatewriteutilitycommand
- {\listentry
- {#1}{}{#2}{\asciilistentry}%
- {\sectionformat\sectionseparator\sectionseparator\number#4}%
- {\realfolio}}%
- \endgroup}
-
-\def\immediatebetweenlist[#1]#2%
- {\begingroup
- \defconvertedargument\asciilistentry{#2}%
- \makesectionformat
- \immediatewriteutilitycommand
- {\listbetween
- {#1}{\asciilistentry}%
- {\sectionformat\sectionseparator\sectionseparator0}%
- {\realfolio}}%
- \endgroup}
-
-\def\setlistentries
- {\def\listentry ##1{\executeifdefined{##1\c!list }\gobblefivearguments }%
- \def\listbetween##1{\executeifdefined{##1\c!inbetween}\gobblethreearguments}}
-
-\def\resetlistentries
- {\let\listentry \gobblesixarguments
- \let\listbetween\gobblefourarguments}
-
-\resetlistentries
-
-\addutilityreset{listentries}
-
-% 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}
-
-\def\setlistparameter#1#2#3{\@EA\def\csname\??li#1#2\endcsname{#3}} % often
-\def\listparameter #1{\csname\??li\currentlist#1\endcsname}
-
-\def\dosetuplist[#1][#2]% slow -)
- {\def\docommand##1%
- {\getparameters[\??li##1][#2]%
- \preparepageprefix{\??li##1}}%
- \processcommalist[#1]\docommand}
-
-\def\setuplist
- {\dodoubleargument\dosetuplist}
-
-\def\dodosetlist#1%
- {\def\nolist{\splitsequence{\getvalue{\??li#1\c!limittext}}}%
- \setvalue{#1\c!inbetween}{\dobetweenlist{#1}}%
- \setvalue{#1\c!list }{\dolistelement{#1}}}
-
-% \def\dodoresetlist#1%
-% {\let\nolist\empty
-% \setvalue{#1\c!inbetween}{\gobblefourarguments{#1}}%
-% \setvalue{#1\c!list }{\gobblesixarguments {#1}}}
-
-\def\dodoresetlist#1%
- {\let\nolist\empty
- \letvalue{#1\c!inbetween}\gobblethreearguments
- \letvalue{#1\c!list }\gobblefivearguments}
-
-\let\nolist\empty
-
-\def\dodefinelist[#1][#2][#3]%
- {\presetlocalframed[\??li#1]%
- \getparameters
- [\??li#1]
- [\c!height=\v!broad,
- \c!depth=\v!broad,
- \c!offset=0.25em,
- \c!maxwidth=,
- \c!align=,
- \c!state=\v!start,
- \c!coupling=\v!off,
- \c!criterium=\v!local,
- \c!width=3em,
- \c!alternative=\c!b,
- \c!style=\v!normal,
- \c!textstyle=\listparameter\c!style,
- \c!numberstyle=\listparameter\c!style,
- \c!pagestyle=\listparameter\c!style,
- \c!color=,
- \c!textcolor=\listparameter\c!color,
- \c!numbercolor=\listparameter\c!color,
- \c!pagecolor=\listparameter\c!color,
- \c!numbercommand=\listnumbercommand,
- \c!textcommand=\listtextcommand,
- \c!pagecommand=\listpagecommand,
- \c!pagenumber=\v!yes,
- \c!headnumber=\v!yes,
- \c!pageboundaries=,
- \c!margin=\!!zeropoint,
- \c!aligntitle=,
- \c!before=,
- \c!after=,
- \c!inbetween=,
- \c!symbol=,
- \c!interaction=\v!sectionnumber,
- \v!part\v!number=\v!yes, % nodig ? % v
- %\c!prefix=\v!no, % we need to initialize it
- \c!label=\v!no,
- \c!distance=\!!zeropoint,
- \c!separator=\@@koseparator,
- \c!limittext=\@@kolimittext,
- \c!stopper=,
- \c!expansion=]%
- \doifassignmentelse{#2}
- {\getparameters[\??li#1][#2]}
- {\ConvertToConstant\doifnot{#2}{} % not \doifsomething ivm Convert...
- {\copyparameters % interactie ?
- [\??li#1][\??li#2]
- [\c!state,\c!width,\c!alternative,\c!style,\c!color,
- \c!textstyle,\c!textcolor,\c!textcommand,
- \c!pagestyle,\c!pagecommand,\c!pagecolor,
- \c!numberstyle,\c!numbercolor,\c!numbercommand,
- \c!headnumber,
- \c!pagenumber,\c!pageboundaries,\c!margin,\c!symbol,\c!limittext,
- \c!aligntitle,\c!before,\c!after,\c!inbetween,\v!part\c!number,\c!label]%
- \getparameters[\??li#1][#3]}}%
- \addutilityreset{#1}%
- \setvalue{\s!set #1}{\dodosetlist {#1}}%
- \setvalue{\s!reset#1}{\dodoresetlist{#1}}}
-
-\def\definelist
- {\dotripleempty\dodefinelist}
-
-\def\iflijstgeplaatst{\ifutilitydone} % obsolete, is now a mode
-
-\def\placelist
- {\dodoubleempty\doplacelist}
-
-\def\placerawlist
- {\dodoubleempty\doplacerawlist}
-
-\def\dobeginoflist
- {\begingroup
- \startpacked[\v!blank]}
-
-\def\doendoflist
- {\stoppacked
- \endgroup}
-
-\def\doplacelist[#1][#2]%
- {\dobeginoflist
- \doplacerawlist[#1][#2]%
- \doendoflist}
-
-\def\doplacerawlist[#1][#2]%
- {\begingroup
- \dogetcommalistelement1\from#1\to\firstlistelement
- \dosetuplist[#1][#2]%
- \doifvalue{\??li\firstlistelement\c!coupling}\v!on
- {\startlistreferences{#1}}%
- \dosettoclevel\??li\firstlistelement
- \honorlocalfilterlevel
- \doutilities{listentries,#1}\jobname{#1}\relax\par
- \stoplistreferences
- \dosetlistmode
- \endgroup}
-
-% the simple approach:
-%
-% \def\dosettoclevel#1#2%
-% {\dosetfilterlevel{\getvalue{#1#2\c!criterium}}\empty}
-%
-% but we want to to support selection by number:
-%
-% \starttypen
-% \placelist[section][criterium=chapter,number=1] \blank
-% \placelist[section][criterium=chapter,number=2] \blank
-% \placelist[section][criterium=chapter,number=3] \blank
-%
-% \chapter{first} \section{AA} \section{BB}
-% \chapter{second} \section{CC} \section{DD}
-% \chapter{third} \section{EE} \section{FF}
-% \stoptypen
-
-\def\dosettoclevel#1#2% todo: check if criterium is headid, else error
- {\ifundefined{#1#2\c!number}%
- \dosetfilterlevel{\getvalue{#1#2\c!criterium}}\empty
- \else
- % \doifnot{#2}\v!local ...
- \doifelsevaluenothing{#1#2\c!number}%
- {\dosetfilterlevel{\getvalue{#1#2\c!criterium}}\empty}
- {\setsectieenkoppeling{\getvalue{#1#2\c!criterium}}%
- \dosetfilterlevel
- {\previoussection\@@sectie}%
- {\getvalue{#1#2\c!number}}}%
- \fi}
-
-\def\dosetlistmode
- {\ifutilitydone
- \setsystemmode \v!list
- \else
- \resetsystemmode\v!list
- \fi}
-
-\def\dodocompletelist[#1][#2][#3]% enkelvoud, meervoud, instellingen
- {\expanded{\systemsuppliedtitle[#2]{\noexpand\headtext{#2}}}% expansion needed for v! vs french !
- \doplacelist[#1][#3]}
-
-\def\docompletelist[#1][#2]%
- {\dodocompletelist[#1][#1][#2]}
-
-\def\completelist
- {\dodoubleempty\docompletelist}
-
-\def\listelements {} % list of page breaks
-\def\listnumbercommand #1{#1} % no strut due to interactive version
-\def\listtextcommand #1{\begstrut#1\endstrut}
-\def\listpagecommand #1{\strut#1}
-
-\def\doassigndimen#1#2#3%
- {\doifinsetelse{#2}{\v!fit,\v!broad}{#1=#3}{#1=#2}\relax}
-
-% \let\dohandlelistnumber\firstofoneargument
-%
-% can be anything, so no \expanded{\separatednumber{#1}} !
-
-\def\dohandlelistnumber#1{\separatednumber{#1}}
-
-\def\listsymbol[#1]#2%
- {\begingroup
- \def\currentlist{#1}%
- \def\currentlistnumber{#2}%
- \currentlistsymbol
- \endgroup}
-
-% Beware, the list symbol macro gets an argument passed, i.e. when this
-% argument is not picked up, the symbol becomes a kind of prefix.
-
-% for historical reasons we're stuck to symbols, so in order to generalize,
-% we have to hook it into the symbol handler; we need a beter clean up later
-%
-% < 2005
-%
-% \def\dosetlistsymbol % #1
-% {\executeifdefined{listsymbol@\listparameter\c!symbol}\listsymbol@default} % {#1}
-%
-% >= 2005
-%
-% at this symbol level, we have access to the raw 'number' in
-% \currentlistnumber
-
-\definesymbol[\v!list][\v!none ][\listsymbol@none ]
-\definesymbol[\v!list][\v!one ][\listsymbol@one ]
-\definesymbol[\v!list][\v!two ][\listsymbol@two ]
-\definesymbol[\v!list][\v!three ][\listsymbol@three ]
-\definesymbol[\v!list][\s!default][\listsymbol@default]
-\definesymbol[\v!list][\s!unknown][\listsymbol@unknown]
-
-\def\currentlistsymbol
- {\doifinsymbolsetelse\v!list{\listparameter\c!symbol}
- {\directsymbol\v!list{\listparameter\c!symbol}}
- {\directsymbol\v!list\s!default}}
-
-\def\listsymbol@none
- {\doassigndimen\scratchdimen{\listparameter\c!width}{1.5em}%
- \hbox to \scratchdimen{}}
-
-\def\listsymbol@one
- {\strut$\bullet$}
-
-\def\listsymbol@two
- {\vrule\!!width1em\!!height1ex\!!depth\zeropoint}
-
-\def\listsymbol@three
- {\begingroup
- \doassigndimen{\dimen0}{\listparameter\c!width }{1.5em}%
- \doassigndimen{\dimen2}{\listparameter\c!height}{1ex}%
- \doassigndimen{\dimen4}{\listparameter\c!depth }\zeropoint
- \vrule\!!width\dimen0\!!height\dimen2\!!depth\dimen4%
- \endgroup}
-
-\def\listsymbol@default
- {\doifelse{\listparameter\c!prefix}\v!no % ook nog eerste
- {\edef\splitlistsymbol{\@EA\removefirstprefix\@EA{\currentlistnumber}}}% one level expansion
- {\doifelse{\listparameter\c!prefix}\v!none
- {\edef\splitlistsymbol{\@EA\removeallprefixes\@EA{\currentlistnumber}}}%
- {\let\splitlistsymbol\currentlistnumber}}% geen \edef ivm 8 bit enz
- \doif{\listparameter\c!label}\v!yes{\leftlabeltext\currentlist}%
- \strut
- \def\numberseparator{\listparameter\c!separator}% overloaded, todo
- \@EA\dohandlelistnumber\@EA{\splitlistsymbol}%
- \listparameter\c!stopper
- \doif{\listparameter\c!label}\v!yes{\rightlabeltext\currentlist}}
-
-\def\listsymbol@unknown
- {\listparameter\c!symbol}
-
-% so far for list symbols
-
-\def\@@dodolistelement{dodolistelement}
-
-\def\dosomelistelement#1#2#3{#1 #2 \translatednumber[#3]}
-
-\setvalue{\@@dodolistelement a}{\let\dosomelistelement\dodofixdlistelementABC}
-\setvalue{\@@dodolistelement b}{\let\dosomelistelement\dodofixdlistelementABC}
-\setvalue{\@@dodolistelement c}{\let\dosomelistelement\dodofixdlistelementABC}
-\setvalue{\@@dodolistelement d}{\let\dosomelistelement\dodofixdlistelementD}
-\setvalue{\@@dodolistelement e}{\let\dosomelistelement\dodofixdlistelementE}
-\setvalue{\@@dodolistelement f}{\let\dosomelistelement\dodofixdlistelementF}
-\setvalue{\@@dodolistelement g}{\let\dosomelistelement\dodofixdlistelementG}
-
-\setvalue{\@@dodolistelement\v!none }{\def\dosomelistelement{\dodofreevlistelement}}
-\setvalue{\@@dodolistelement\v!vertical }{\def\dosomelistelement{\dodofreevlistelement}}
-\setvalue{\@@dodolistelement\v!horizontal}{\def\dosomelistelement{\dodofreehlistelement}}
-\setvalue{\@@dodolistelement\v!command }{\let\dosomelistelement\dodocommandlistelement}
-
-% \setuplist
-% [section]
-% [alternative=MyListItem,
-% after=\blank,
-% before=\blank]
-%
-% \definelistplacement[MyListItem][none]#1#2#3%
-% {(#1) (#2) (#3)}
-
-\def\definelistplacement
- {\dodoubleempty\dodefinelistplacement}
-
-\def\dodefinelistplacement[#1][#2]%
- {\setvalue{\@@dodolistelement#1}%
- {\doifelsenothing{#2}
- {\getvalue{\@@dodolistelement\v!command}}%
- {\executeifdefined{\@@dodolistelement#2}
- {\getvalue{\@@dodolistelement\v!command}}}%
- \setvalue{\??li\currentlist\c!command}{\getvalue{\@@dodolistelement::#1}}}%
- \setvalue{\@@dodolistelement::#1}}
-
-% don't mess arround with endgraf/grouping else we loose leftskip
-
-% \strippedcsname\dodolistelement
-
-\def\newlineinlist{\space}
-
-\let\currentlist\s!unknown
-
-\def\dolistelement#1#2#3#4#5#6% pas op: wordt ook elders gedefinieerd
- {\doiftoclevelelse[#5]{\dodolistelement{#1}{#2}{#3}{#4}{#5}{#6}}{}}
-
-\def\dodolistelement#1#2#3#4#5#6%
- {\def\currentlist{#1}%
- \def\currentlistnumber{#3}%
- \getvalue{\@@dodolistelement\listparameter\c!alternative}%
- %\showcomposition
- \let\@@iawidth\!!zeropoint % moet boolean worden
- \bgroup
- \edef\listelements
- {\listparameter\c!pageboundaries}%
- \ExpandBothAfter\doifinset{#3}\listelements
- {\showmessage\m!systems{14}{#3}%
- \page}%
- \egroup
- \dontcomplain
- \setfullsectionnumber{\??li\currentlist}%
- \dosomelistelement{#1}{#2}{#3}{#4}{#5}{#6}%
- \global\utilitydonetrue}
-
-\def\donestedlistattributes#1#2%
- {\doifvaluesomething{\??li\currentlist#2} % color
- {\resetinteractionparameter\c!color
- \resetinteractionparameter\c!contrastcolor}%
- \dolistattributes{#1}{#2}}
-
-\def\dostartlistattributes{\dostartattributes{\??li\currentlist}}
-\def\dostoplistattributes {\dostopattributes}
-\def\dolistattributes {\doattributes{\??li\currentlist}}
-
-\def\dodocommandlistelement#1#2#3#4#5#6%
- {\doifdefinedelse{\??li#1\c!command}
- {\listparameter\c!command
- {#3}{#4}{\pageprefix\??li\currentlist[#5]\translatednumber[#5]}}
- {[\currentlist: #3 - #4 - \pageprefix\??li\currentlist[#5]\translatednumber[#5]]}}
-
-\def\dodofreelistelement#1#2#3#4#5#6#7#8%
- {\def\makelistelement##1##2%
- {\noindent % new and needed
- \hbox
- {\doifelse{\listparameter\c!interaction}{##1} % \??li ipv \??ia
- {\setbox0\hbox{\showcontrastlocation{\??li\currentlist}{#6}{##2}}%
- \linklisttoelement{#2}{#5}{#6}{\box0}}%{\copy0}}%
- {##2}}}%
- \listparameter\c!before% can be \hskip
- \doifdefinedelse{\??li#1\c!command}
- {\makelistelement{\listparameter\c!interaction}% this forces all
- {\listparameter\c!command
- {#3}% geen conversies etc
- {#4}% geen conversies etc
- {\pageprefix\??li\currentlist[#5]%
- \translatednumber[#5]}}}
- {#7%
- \vbox
- {\forgetall
- \makelistelement\v!all
- {%
-\doif{\listparameter\c!headnumber}\v!yes
- {\makelistelement\v!sectionnumber
- {\donestedlistattributes\c!numberstyle\c!numbercolor
- {\listparameter\c!numbercommand{\currentlistsymbol}}}%
-}%
- \makelistelement\v!text
- {\donestedlistattributes\c!textstyle\c!textcolor
- {\let\\=\newlineinlist
- \dontconvertfont
- \listparameter\c!textcommand{#4}}}%
- \doif{\listparameter\c!pagenumber}\v!yes
- {\doifsomething{#5}
- {\makelistelement\v!pagenumber
- {\donestedlistattributes\c!pagestyle\c!pagecolor
- {\listparameter\c!pagecommand
- {\pageprefix\??li\currentlist[#5]%
- \translatednumber[#5]}}}}}}}%
- #8}%
- \listparameter\c!after}
-
-\def\dodofreehlistelement#1#2#3#4#5#6%
- {\dodofreelistelement{#1}{#2}{#3}{#4}{#5}{#6}
- {\noindent}{}}
-
-\def\dodofreevlistelement#1#2#3#4#5#6% % \nointerlineskip needed,
- {\dodofreelistelement{#1}{#2}{#3}{#4}{#5}{#6} % otherwise wrong spacing
- {\ifvmode\nointerlineskip\fi} % at multi-line lists
- {\ifvmode\nointerlineskip\fi\endgraf\allowbreak}} % test is saveguard
-
-% to be documented: align, hang
-
-% now also in abc
-
-\def\limitatedlistentry#1%
- {\doifelsenothing{\listparameter\c!maxwidth}
- {\listparameter\c!textcommand{#1}}
- {\listparameter\c!textcommand
- {\limitatetext
- {#1}%
- {\listparameter\c!maxwidth}%
- {\splitsymbol{\listparameter\c!limittext}}}}}
-
-\def\dodofixdlistelementABC#1#2#3#4#5#6% weeden
- {\endgraf
- \leftskip\listparameter\c!margin% na de \endgraf !
- \listparameter\c!before
- \!!widthc\listparameter\c!distance
- \doifelse{\listparameter\c!width}\v!fit
- {\!!widtha\zeropoint}
- {\doifelsenothing{#3}
- {\doifelse{\listparameter\c!aligntitle}\v!yes
- {\!!widtha\zeropoint
- \!!widthc\zeropoint}
- {\!!widtha\listparameter\c!width}}
- {\!!widtha\listparameter\c!width}}%
- \getvalue{\??li\c!alternative\listparameter\c!alternative}%
- \endgraf
- \def\makelistelement##1##2%
- {\doifelse{\listparameter\c!interaction}{##1}
- {\setbox0\hbox{\showcontrastlocation\??ia{#6}{##2}}%
- \linklisttoelement{#2}{#5}{#6}{\box0}}%{\copy0}}%
- {\hbox{##2}}}%
- \doif{\listparameter\c!interaction}\v!text % not supported ! ! ! ! ! ! text == all
- {\setlistparameter\currentlist\c!interaction\v!all}%
- % \dontleavehmode % new, else no margin, but wrong, better (else \indent as well):
- \noindent
- \makelistelement\v!all
- {\setlocalhsize
- \hsize\localhsize
- \hbox to \hsize
- {\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{}}%
- \setbox4\hbox
- {\doif{\listparameter\c!pagenumber}\v!yes
- {\doifsomething{#5} % \listwidth is new ; temp hack
- {\hbox \ifdim\listwidth>\zeropoint to \listwidth\fi
- {\hfill
- \makelistelement\v!pagenumber
- {\donestedlistattributes\c!pagestyle\c!pagecolor
- {\listparameter\c!pagecommand
- {\pageprefix\??li\currentlist[#5]%
- \translatednumber[#5]}}}}}}}%
- \vbox
- {\hsize\!!widthb
- \setupalign[\listparameter\c!align]%
- \ifdim\!!widtha<\hsize
- \hangindent\wd2
- \dimen2=\!!widthc % \listparameter\c!distance
- \advance\hangindent \dimen2
- \hangafter\plusone
- \doif{\listparameter\c!hang}\v!no{\hangafter\zerocount}%
- \ifdim\wd4=\zeropoint % \ifvoid4
- % we kunnen gewoon afbreken aan het eind
- \else
- \ifdim\listskip>\zeropoint\relax
- \rightskip\listskip\!!plus\liststretch\relax
- \parfillskip-\rightskip
- \fi
- \fi
- \else
- \dimen2\zeropoint
- \fi
- \parindent\zeropoint\relax
- \leavevmode
- \box2\relax
- \hskip\dimen2
- \bgroup
- \donestedlistattributes\c!textstyle\c!textcolor
- {\let\\=\newlineinlist
- \dontconvertfont
- %\listparameter\c!textcommand{#4}}%
- \limitatedlistentry{#4}}%
- %\carryoverpar % new otherwise wrong linespacing
- \egroup
- \ifdim\wd4=\zeropoint\relax % \ifvoid4
- % \ifdim\!!widtha<\hsize \hfill\strut \fi % spoils align
- \else
- \nobreak\listfill
- \box4\relax
- \relax
- \fi}%
- \hss
- \dostoplistattributes}}% new
- \endgraf % new, else problems with nointerlinespace and prevdepth
- \nointerlineskip % anders verkeerde spatiering bij multi-line
- \endgraf
- \allowbreak
- \listparameter\c!after}
-
-% % example from the context list
-%
-% \setuphead [part] [page=right,placehead=yes]
-% \setuplist [chapter] [alternative=d,before=\blank,after=\blank]
-% \setuplist [part] [before=\blank,after=\blank]
-%
-% \starttext
-% \startnarrower[2*right] \placecontent \stopnarrower
-% \blank[4*big]
-% \startsetups chapter
-% \blank \startnarrower[3*middle] \placecontent[criterium=local] \stopnarrower
-% \stopsetups
-% \placelist[part][criterium=text,after=\setups{chapter}]
-%
-% \part{First part} \chapter{Chapter one} \chapter{Chapter two}
-% \chapter{Chapter three} \chapter{Chapter four} \chapter{Chapter five}
-% \part{Second part} \chapter{Chapter one} \chapter{Chapter two}
-% \chapter{Chapter three} \chapter{Chapter four} \chapter{Chapter five}
-% \part{Third part} \chapter{Chapter one} \chapter{Chapter two}
-% \chapter{Chapter three} \chapter{Chapter four} \chapter{Chapter five}
-% \stoptext
-
-% overrulen interactie kan sneller, bv door hulpconstanten
-% te gebruiken en die te letten
-
-\def\dodofixdlistelementD#1#2#3#4#5#6%
- {%\leftskip=\listparameter\c!margin
- \ifvmode
- \advance\leftskip\listparameter\c!margin% AANGEPAST
- \fi
- \bgroup
- \ifvmode
- \noindent\leavevmode % leavevmode ? ? ?
- \fi
- \doif{\listparameter\c!interaction}\v!text % not supported
- {\setlistparameter\currentlist\c!interaction\v!sectionnumber}%
- \doif{\listparameter\c!interaction}\v!all % not supported
- {\setlistparameter\currentlist\c!interaction\v!sectionnumber}%
- \def\makelistelement##1##2%
- {\doifelse{\listparameter\c!interaction}{##1}
- {\setbox0\hbox{\showcontrastlocation\??ia{#6}{##2}}%
- \linklisttoelement{#2}{#5}{#6}{\box0}}%{\copy0}}%
- {\hbox{##2}}}%
- \setbox4\hbox
- {\doif{\listparameter\c!pagenumber}\v!yes
- {\doifsomething{#5}
- {\makelistelement\v!pagenumber
- {\donestedlistattributes\c!pagestyle\c!pagecolor
- {\listparameter\c!pagecommand
- {\pageprefix\??li\currentlist[#5]%
- \translatednumber[#5]}}}}}}%
-\doif{\listparameter\c!headnumber}\v!yes{%
- \donetrue
- \doifnothing{#3}{\doifnothing{\listparameter\c!symbol}\donefalse}%
- % == \doifnothing{#3\listparameter\c!symbol}\donefalse
- \ifdone
- \hbox
- {\listparameter\c!left
- \makelistelement\v!sectionnumber
- {\donestedlistattributes\c!numberstyle\c!numbercolor
- {\listparameter\c!numbercommand{\currentlistsymbol}}}%
- \listparameter\c!right
- \hskip.5em}%
- \nobreak
- \fi
-}%
- \tolerance3500 % niet zomaar veranderen
- \donestedlistattributes\c!textstyle\c!textcolor
- {\let\\=\newlineinlist
- \dontconvertfont
- %\listparameter\c!textcommand{#4}}%
- \limitatedlistentry{#4}}%
- \ifvoid4\else
- \nobreak
- \hskip.75em\relax
- \nobreak
- \box4
- \fi
- \dimen0=\listparameter\c!distance\relax
- \ifdim\dimen0<1em\relax
- \hskip1em\!!plus1em\!!minus.25em\relax
- \else
- \hskip\dimen0\!!plus.5\dimen0\!!minus.25\dimen0\relax
- \fi
- \egroup}
-
-\def\dodofixdlistelementE#1%
- {\dodofixdlistelementEFG
- {\setupinteraction[\c!strut=\v!no]}
- {\localframed[\??li\currentlist][\c!depth=\!!zeropoint,\c!color=]}
- {}}
-
-\def\dodofixdlistelementF#1%
- {\dodofixdlistelementEFG
- {}
- {\dosetraggedhbox{\listparameter\c!align}\raggedbox}
- {}}
-
-\def\dodofixdlistelementG#1%
- {\dodofixdlistelementEFG
- {}
- \midaligned
- {}}
-
-\def\dodofixdlistelementEFG#1#2#3#4#5#6#7#8%
- {\noindent
- \bgroup
- \def\makelistelement##1##2% isolated by Wolfgang Schuster
- {\doifelse{\listparameter\c!interaction}{##1}
- {#2{##2}}
- {\setbox0\hbox{#2{\showcontrastlocation\??ia{#8}{##2}}}%
- \linklisttoelement{#4}{#7}{#8}{\box0}}}%
- \makelistelement\v!no
- {\let\\=\newlineinlist
- #1% in case E nils the strut (still needed?)
- \dostartlistattributes\c!style\c!color\empty
- \ignorespaces\dontconvertfont\setstrut
- \begstrut
- \limitatedlistentry{#6}%
- \endstrut
- \dostoplistattributes}%
- \egroup
- \par
- \listparameter\c!inbetween}
-
-% better:
-%
-% \def\linklisttoelement#1#2#3#4% % list location format page data
-% {\ifautocrossdocument
-% \gotodestination{}{}{\currentlist::\@@filterblocknumberpart[#2]}{#3}{#4}%
-% \else
-% \gotonextinternal\currentlist{#1}{#3}{#4}%
-% \fi}
-%
-% but for the moment:
-
-\def\linklisttoelement#1#2#3#4% % list location format page data
- {\gotonextinternal\currentlist{#1}{#3}{#4}}
-
-\def\writetolist[#1]#2#3%
- {\doifsomething{#1}
- {\defconvertedargument\firstlistelement{#2}%
- \@EA\dowritetolist\@EA{#1}{\firstlistelement}{#3}{\v!head}}}
-
-\def\dobetweenlist#1#2#3#4% pas op: wordt ook elders gedefinieerd
- {\doiftoclevelelse[#3]{#2}{}}
-
-\def\writebetweenlist[#1]#2%
- {\@EA\dowritebetweenlist\@EA{#1}{#2}} % #2 weg en \expanded
-
-% NOG ENGELS MAKEN
-
-\def\listlength{\utilitylistlength}
-\def\listwidth {\utilitylistwidth}
-\def\listheight{\utilitylistheight}
-
-\def\utilitylistlength {0}
-\def\utilitylistwidth {0pt}
-\def\utilitylistheight {0pt}
-
-\def\dolistelementX#1#2#3#4#5#6%
- {\doiftoclevelelse[#5]
- {\doglobal\increment\utilitylistlength
- \hbox
- {\dolistattributes\c!textstyle\c!textcolor
- {\let\\=\newlineinlist
- \dontconvertfont
- \listparameter\c!textcommand{#4}}}%
- \global\utilitydonetrue}
- {}}
-
-\def\dodeterminelistcharacteristics[#1][#2]%
- {\begingroup
- \doglobal\newcounter\utilitylistlength
- \let\dolistelement\dolistelementX
- \dosetuplist[#1][#2]%
- \dogetcommalistelement1\from#1\to\commalistelement
- \dosettoclevel\??li\commalistelement
- \setbox0\vbox{\doutilities{listentries,#1}\jobname{#1}\relax\par}%
- \xdef\utilitylistheight{\the\ht0}%
- \xdef\utilitylistwidth {\the\wd0}%
- \endgroup
- \dosetlistmode}
-
-\def\determinelistcharacteristics
- {\dodoubleempty\dodeterminelistcharacteristics}
-
-% \definerreferencelist
-% [externalfigure]
-% [command=\showbigfigure,
-% before=\page,
-% after=\page]
-%
-% \definereferencelist
-% [externaltable]
-% [command=\showbigtable,
-% before=\page,
-% after=\page]
-%
-% \def\showbigfigure#1%
-% {\externalfigure[#1][frame=on,factor=max]}
-%
-% \def\showbigtable#1%
-% {\switchtobodyfont[12pt]\getbuffer[#1]}
-%
-% \writetoreferencelist[externalfigure]{koe} {\externalfigure[koe] [width=3cm,frame=on]}
-% \writetoreferencelist[externalfigure]{paard}{\externalfigure[paard][width=3cm,frame=on]}
-%
-% \startbuffer[kanweg]
-% \starttable[|||]
-% \HL
-% \VL test \VL test \VL\SR
-% \HL
-% \VL test \VL test \VL\FR
-% \VL test \VL test \VL\MR
-% \VL test \VL test \VL\LR
-% \HL
-% \stoptable
-% \stopbuffer
-%
-% \writetoreferencelist[externaltable]{kanweg}{\switchtbodyfont[5pt]\getbuffer[kanweg]}
-%
-% \placereferencelist[externalfigure,externaltable]
-
-% algemeen
-
-\def\referencebutton#1[#2]%
- {\hbox\bgroup % the \hbox is needed to bypass
- \let\referenceprefix\empty % \dontleavehmode in \gotobox
- \setupinteraction[\c!color=,\c!contrastcolor=,\c!strut=]%
- \setupreferencing[\c!prefix=]%
- \gotobox{\hbox{\ignorespaces#1}}[#2]%
- \egroup}
-
-\newcounter\referencecounter
-
-\def\doreferencelistelement#1#2#3#4#5%
- {\doiftoclevelelse[#4]
- {\getvalue{\??rl#1\c!before}%
- \referencebutton
- {\getvalue{\??rl#1\c!command}{#3}\pagereference[\r!to#2]}%
- [\r!from#2]%
- \global\utilitydonetrue
- \getvalue{\??rl#1\c!after}}
- {}}
-
-\def\doplacereferencelist[#1][#2]%
- {\begingroup
- \setupreferencelist[#1][#2,\c!state=\v!stop]%
- \dogetcommalistelement1\from#1\to\commalistelement
- \dosettoclevel\??rl\commalistelement
- \doutilities{listentries,#1}\jobname{#1}\relax\par
- \endgroup}
-
-\def\placereferencelist
- {\dodoubleempty\doplacereferencelist}
-
-\def\dowritetoreferencelist#1#2#3%
- {\doifvalue{\??rl#1\c!state}\v!start
- {\begingroup
- \makesectionformat
- \doifelse{\@@nmstate}\v!start
- {\def\dopagenummer{\noexpand\pagenumber}}
- {\let\dopagenummer\!!zerocount}%
- \expanded
- {\writeutilitycommand%
- {\noexpand\referencelistentry%
- {#1}% tag
- {#2}% number
- {#3}% data
- {\sectionformat\sectionseparator\sectionseparator\dopagenummer}%
- {\noexpand\realfolio}}}%
- \endgroup}}
-
-\def\writetoreferencelist[#1]#2% #1=class #2=data #3=visualization
- {\dowithnextbox
- {\doifelsevalue{\??rl#1\c!state}\v!start
- {\doglobal\increment\referencecounter % must be resolved due to #2
- \referencebutton
- {\flushnextbox
- \pagereference[\r!from\referencecounter]%
- \dowritetoreferencelist{#1}{\referencecounter}{#2}}%
- [\r!to\referencecounter]}
- {\flushnextbox}}
- \hbox} % \vbox ?
-
-\def\referencelistentry#1%
- {\executeifdefined{#1\c!list}\gobblefourarguments}
-
-\def\dodosetreferencelist#1%
- {\setvalue{#1\c!list}{\doreferencelistelement{#1}}}
-
-\def\dodoresetreferencelist#1%
- {\setvalue{#1\c!list}{\gobblefourarguments}}
-
-\def\dodefinereferencelist[#1][#2]%
- {\setupreferencelist[#1]
- [\c!command=,
- \c!state=\v!start,
- \c!criterium=\v!all,
- \c!before=,
- \c!after=,
- #2]%
- \resetcounter{#1}%
- \addutilityreset{#1}%
- \setvalue{\s!set #1}{\dodosetreferencelist {#1}}%
- \setvalue{\s!reset#1}{\dodoresetreferencelist{#1}}}
-
-\def\definereferencelist
- {\dodoubleempty\dodefinereferencelist}
-
-\def\dosetupreferencelist[#1][#2]%
- {\getparameters[\??rl#1][#2]}
-
-\def\setupreferencelist
- {\dodoubleempty\dosetupreferencelist}
-
-\def\dosetupcombinedlist[#1][#2]%
- {\getparameters[\??ih#1][#2]%
- \expanded{\setuplist[\getvalue{\??ih#1\c!list}]}[#2]}
-
-\def\setupcombinedlist
- {\dodoubleargument\dosetupcombinedlist}
-
-\def\doplacecombinedlist[#1][#2]%
- {\begingroup
- \getparameters[\??ih#1][#2]%
- \dosettoclevel\??ih{#1}%
- \edef\combinedlist{\getvalue{\??ih#1\c!list}}%
- \doifelsevalue{\??ih#1\c!level}\v!current %
- {\!!counta=0\@@kolevel} % hm: \@@kolevel
- {\fullexpandoneargafter\doifnumberelse{\getvalue{\??ih#1\c!level}}% in verband
- {\!!counta\getvalue{\??ih#1\c!level}% met de vorige implementatie
- \advance\!!counta \plusone % accepteren we ook nummers (0==deel)
- \getfromcommacommand[\combinedlist][\!!counta]%
- \edef\maximumlist{\commalistelement}}%
- {\edef\maximumlist{\getvalue{\??ih#1\c!level}}}%
- \doifdefinedelse{\??ko\maximumlist\c!section}
- {\!!counta\getvalue{\??se\getvalue{\??ko\maximumlist\c!section}\c!level}}%
- {\!!counta\zerocount}}
- \let\!!stringa\combinedlist
- \let\combinedlist\empty
- \def\docommand##1%
- {\doifdefinedelse{\??ko##1\c!section}
- {\ifnum\getvalue{\??se\getvalue{\??ko##1\c!section}\c!level}>\!!counta\else
- \addtocommalist{##1}\combinedlist
- \fi}%
- {\addtocommalist{##1}\combinedlist}}%
- \processcommacommand[\!!stringa]\docommand
- \doifvalue{\??ih#1\c!coupling}\v!on
- {\startlistreferences{#1}}%
- \ExpandFirstAfter\dodoplacecombinedlist[\combinedlist][#2]%
- \stoplistreferences
- \endgroup
- \dosetlistmode}
-
-\def\dodoplacecombinedlist[#1][#2]%
- {\dobeginoflist
- \dosetuplist[#1][#2]%
- \doutilities{listentries,#1}\jobname{#1}\relax\par
- \doendoflist}
-
-\def\docompletecombinedlist[#1][#2]%
- {\expanded{\systemsuppliedtitle[#1]{\noexpand\headtext{#1}}}% expansion due to v! vs french !
- \doplacecombinedlist[#1][#2]}
-
-\def\dodefinecombinedlist[#1][#2][#3]%
- {\makerawcommalist[#2]\combinedlist % for fast processing
- \letvalue{\??ih#1\c!list}\combinedlist
- \getcommalistsize[#2]%
- \getfromcommalist[#2][\commalistsize]%
- \doeassign[\??ih#1][\c!level=\commalistelement]%
- \getparameters
- [\??ih#1]
- [\c!criterium=\v!local,#3]%
- \setvalue{\e!setup#1\e!endsetup}%
- {\dodoubleempty\dosetupcombinedlist[#1]}%
- \setvalue{\e!place#1}%
- {\dodoubleempty\doplacecombinedlist[#1]}%
- \setvalue{\e!complete#1}%
- {\dodoubleempty\docompletecombinedlist[#1]}}
-
-\def\definecombinedlist
- {\dotripleempty\dodefinecombinedlist}
-
-\def\placecombinedlist
- {\dodoubleempty\doplacecombinedlist}
-
-% new and yet undocumented (used in cocoa qa)
-%
-% \setupremaininglistlength
-% [left=\hss nog~,right=~ingangen]
-%
-% \resetremaininglistlength
-% [section][settings]
-%
-% \placelist
-% [section]
-% [before=\showremaininglistlength]
-%
-% \dorecurse{100}{\section{hans}}
-
-\definesystemvariable {ll} % ListLength
-
-\def\setupremaininglistlength[#1]%
- {\getparameters[\??ll][#1]%
- \globallet\listlengthcounter\!!zerocount}
-
-\setupremaininglistlength
- [\c!left=\hss,\c!right=,\c!number=\v!yes,
- \c!before=\blank,\c!after=\page,
- \c!style=\v!smallnormal,\c!color=]
-
-\def\resetremaininglistlength
- {\dodoubleempty\doresetremaininglistlength}
-
-\def\doresetremaininglistlength[#1][#2]%
- {\determinelistcharacteristics[#1][#2]% \determinelistcharacteristics[#1][#2]%
- \xdef\listlengthcounter{\number\utilitylistlength}}
-
-\def\showremaininglistlength
- {\bgroup
- \ifnum\listlengthcounter>\plusone
- \setbox\scratchbox\vbox
- {\@@llbefore\par\horizontalstrut\par\horizontalstrut\par\@@llafter}%
- \scratchdimen\pagetotal
- \advance\scratchdimen \ht\scratchbox
- \advance\scratchdimen \dp\scratchbox
- \ifdim\scratchdimen>\pagegoal
- \@@llbefore
- \nobreak\hbox to \hsize
- {\doifnot\@@llnumber\v!yes{\let\listlengthcounter\empty}%
- \doattributes\??ll\c!style\c!color{\@@llleft\listlengthcounter\@@llright}}
- \@@llafter
- \fi
- \fi
- \doglobal\decrement\listlengthcounter\relax
- \egroup}
-
-\setupreferencelist
- [\c!style=\v!normal]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/strc-mar.mkii b/Master/texmf-dist/tex/context/base/mkii/strc-mar.mkii
deleted file mode 100644
index 2ae81e47bb5..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/strc-mar.mkii
+++ /dev/null
@@ -1,318 +0,0 @@
-%D \module
-%D [ file=strc-mar,
-%D version=1997.03.31,
-%D title=\CONTEXT\ Structure Macros,
-%D subtitle=Markings,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Structure Macros / Markings}
-
-\unprotect
-
-\prependtoks \getallmarks \to \everybeforepagebody
-\prependtoks \setallmarks \to \everyafterpagebody % currently \relax
-
-% voor 'interne' doeleinden zijn beschikbaar:
-%
-% \fetchmark[naam][plaats]
-
-\def\mainmarking#1%
- {\ifcsname\??mk#1\c!coupling\endcsname
- \csname\??mk#1\c!coupling\endcsname
- \fi}
-
-\def\fastresetmarker#1%
- {\ifcsname\??mk#1\c!coupling\endcsname
- \@EA\resetmark\csname\??mk\csname\??mk#1\c!coupling\endcsname\endcsname
- \fi}
-
-\def\fastresetmarkerlist[#1]%
- {\expanded{\rawprocesscommalist[#1]}\fastresetmarker}
-
-\def\doresetmarking[#1]%
- {\processcommalist[#1]\fastresetmarker}
-
-\def\resetmarking
- {\dosingleargument\doresetmarking}
-
-\def\dosetupmarking[#1][#2]%
- {\def\docommand##1{\getparameters[\??mk##1][#2]}%
- \processcommalist[#1]\docommand}
-
-\def\setupmarking
- {\dodoubleargument\dosetupmarking}
-
-% betere protectie
-
-\letvalue{\??mk\??mk\v!previous}\gettopmark
-\letvalue{\??mk\??mk\v!first }\getfirstmark
-\letvalue{\??mk\??mk\v!last }\getbotmark
-\letvalue{\??mk\??mk\v!current }\getcurrentmark
-
-% todo: make it work in balancing
-%
-% \definemarking[vers][]
-% \setupheadertexts
-% [\doiftext{\getmarking[vers][first]}
-% {\doiftextelse{\getmarking[vers][column:last]}
-% {\getmarking[vers][first] -- \getmarking[vers][column:last]}
-% {\getmarking[vers][first]}}]
-% \starttext
-% \startcolumns[n=2,balance=no]
-% \dorecurse{10}{\expanded{\marking[vers]{\recurselevel}} \recurselevel:\dorecurse{4}{\input ward } \endgraf}
-% \stopcolumns
-% \stoptext
-
-\letvalue{\??mk\??mk\v!column:\v!first}\getsplitfirstmark
-\letvalue{\??mk\??mk\v!column:\v!last }\getsplitbottommark
-
-\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={\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]}}
-
-\def\dodefinemarking[#1][#2]%
- {\doifelsenothing{#2}
- {\dododefinemarking[#1][#1]}
- {\dododefinemarking[#1][#2]}}
-
-\def\definemarking
- {\dodoubleempty\dodefinemarking}
-
-\def\definerawmarking[#1]% global ! ! ! !
- {\getgparameters[\??mk#1]
- [\c!expansion=\v!no, % saves a macro
- \c!separator={ --- }, % watch the spaces
- \c!limittext=,
- \c!state=\v!start]%
- \setxvalue{\??mk#1\c!coupling}{#1}%
- \expandafter\newmark\csname\??mk#1\endcsname
- \showmessage\m!systems{13}{#1}}
-
-\let\nomarking\empty
-
-\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]%
- {\dofetchtwomarks[#1][#1]}
-
-\def\fetchallmarks[#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][#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}%
- \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][#3]%
- {}
-
-\unexpanded\def\getmarking
- {\dotripleargument\dogetmarking}
-
-\let\setsomemark\setmark
-
-\def\domarking[#1]#2%
- {\ifcsname\??mk#1\c!coupling\endcsname
- \bgroup
- \doifelsevalue{\??mk#1\c!expansion}\v!yes
- \expandmarkstrue\expandmarksfalse
- \@EA\setsomemark\csname\??mk\csname\??mk#1\c!coupling\endcsname\endcsname{#2}%
- \egroup
- \fi}
-
-\def\marking
- {\dosingleargument\domarking}
-
-%D Used in placing text lines.
-
-\def\doifelsemarking#1%
- {\ifundefined{\??mk#1\c!coupling}%
- \expandafter\secondoftwoarguments
- \else
- \expandafter\firstoftwoarguments
- \fi}
-
-%D And then \unknown\ we had a chaptertitle packaged in a
-%D makeup environment. And we don't want to loose marks there!
-
-\newbox\collectedmarks
-
-\def\flushmarks % use with care to avoid empty pages
- {\ifvoid\collectedmarks\else\unhbox\collectedmarks\fi}
-
-\def\postponemarks
- {\let\setsomemark\postponemark}
-
-\def\postponemark#1#2%
- {%\writestatus{marks}{postponing \string#1 => #2}%
- \global\setbox\collectedmarks\hbox
- {\unhbox\collectedmarks\setmark{#1}{#2}}}
-
-\protect \endinput
-
-% Pseudo marks: (for Hraban)
-%
-% \def\RegisterPageMark#1#2%
-% {\iftrialtypesetting \else
-% \doglobal\increment\NameCounter
-% \textreference[#1:t:\NameCounter]{#2}%
-% \doifreferencefoundelse{#1:t:\NameCounter}
-% {\doifundefined{#1:f:\currentrealreference}%
-% {\setxvalue{#1:f:\currentrealreference}%
-% {\noexpand\in[#1:t:\NameCounter]}}%
-% \setxvalue{#1:l:\currentrealreference}%
-% {\noexpand\in[#1:t:\NameCounter]}}%
-% {}%
-% \fi}
-%
-% \def\GetFirstOnPage#1{\getvalue{#1:f:\realfolio}}
-% \def\GetLastOnPage #1{\getvalue{#1:l:\realfolio}}
-%
-% \setupheadertexts[\GetFirstOnPage{Name}][\GetLastOnPage{Name}]
-%
-% \starttext
-%
-% \def\Name#1{\RegisterPageMark{Name}{#1}#1}
-% \def\TestLine#1{\NC test \NC \Name {test: #1} \NC \NR}
-%
-% \starttabulate
-% \dorecurse{100}{\expanded{\TestLine{\recurselevel}}}
-% \stoptabulate
-%
-% \stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkii/strc-mat.mkii b/Master/texmf-dist/tex/context/base/mkii/strc-mat.mkii
deleted file mode 100644
index 34f716f3bdf..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/strc-mat.mkii
+++ /dev/null
@@ -1,2925 +0,0 @@
-%D \module
-%D [ file=strc-mat,
-%D version=2006.03.27, % 1998.12.07
-%D title=\CONTEXT\ Structure Macros,
-%D subtitle=Math Fundamentals,
-%D author={Hans Hagen, Taco Hoekwater \& Aditya Mahajan},
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% engels maken
-
-\writestatus{loading}{ConTeXt Structure Macros / Math Fundamentals}
-
-\unprotect
-
-% \startlines
-% $\mathopnolimits{\rm d}x$
-% $\mathopnolimits{\kern\zeropoint \rm d}x$
-% $\puremathcomm{nolop}{\rm d}x$
-% $\puremathcomm{nolop}{\kern\zeropoint\rm d}x$
-% \blank
-% $\puremathcomm{nolop}{\mr d}x$
-% $\puremathcomm{nolop}{\kern\zeropoint\mr d}x$
-% $\mathop{\kern\zeropoint\mr d}x$
-% $\mathopnolimits{\kern\zeropoint d}x$
-% \stoplines
-
-% \definemessageconstant{math}
-
-% % messages moved
-
-% \def\invalidmathcommand#1{\showmessage\m!math1{#1}}
-
-% \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
-
-\unexpanded\def\mathortext
- {\ifmmode
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-% \defineactivecharacter _ {\mathortext{_}{\_}} text_text $a^2$
-
-% force text mode, will be overloaded later
-
-\ifx\text\undefined \let\text\hbox \fi
-
-\newdimen\lastlinewidth
-
-% does not work at all
-%
-% \def\setlastlinewidth
-% {\resetlastlinewidth
-% \ifmmode\else\ifhmode\else\ifoptimizedisplayspacing
-% \bgroup
-% \forgetdisplayskips
-% $$\global\lastlinewidth\predisplaysize$$
-% \vskip-\baselineskip
-% \egroup
-% \fi\fi\fi}
-
-% test \par \dorecurse{10}{test } \moveformula \startformula test \stopformula test \endgraf
-% test \par \dorecurse{10}{test } \startformula test \stopformula test \endgraf
-% \dorecurse{30}{\bpar \dorecurse\recurselevel{test } \epar \startformula formula \stopformula}
-
-\def\setlastlinewidth
- {\resetlastlinewidth
- \ifoptimizedisplayspacing\ifmmode\else\ifhmode
- \bgroup
- \forgetdisplayskips
- \displaywidowpenalty\widowpenalty % brrr, else widowpenalty does not work
- \everymath \emptytoks
- \everydisplay\emptytoks
- $$\strut\global\lastlinewidth\predisplaysize$$
- \vskip-\lineheight
- \vskip\zeropoint
- \egroup
- \fi\fi\fi}
-
-\def\resetlastlinewidth
- {\global\lastlinewidth\zeropoint\relax}
-
-% not here: \appendtoks \setlastlinewidth \to \everyendofpar
-
-%D moved from main-001
-
-%\def\EveryMathPar{\EveryPar}
-%
-%\newevery \everymath \EveryMath
-
-\abovedisplayskip = \zeropoint
-\abovedisplayshortskip = \zeropoint % evt. 0pt minus 3pt
-\belowdisplayskip = \zeropoint
-\belowdisplayshortskip = \zeropoint % evt. 0pt minus 3pt
-
-\predisplaypenalty = \zerocount
-\postdisplaypenalty = \zerocount % -5000 gaat mis, zie penalty bij \paragraaf
-
-% we don't use the skip's
-
-\def\displayskipsize#1#2% obsolete
- {\ifdim\ctxparskip>\zeropoint
- #1\ctxparskip\!!plus#2\ctxparskip\!!minus#2\ctxparskip\relax
- \else
- #1\lineheight\!!plus#2\lineheight\!!minus#2\lineheight\relax
- \fi}
-
-\def\displayskipfactor {1.0} % obsolete
-\def\displayshortskipfactor {0.8} % obsolete
-\def\displayskipgluefactor {0.3} % obsolete
-\def\displayshortskipgluefactor {0.2} % obsolete
-
-\def\abovedisplayskipsize% obsolete
- {\displayskipsize\displayskipfactor\displayskipgluefactor}
-
-\def\belowdisplayskipsize% obsolete
- {\displayskipsize\displayskipfactor\displayskipgluefactor}
-
-\def\abovedisplayshortskipsize% obsolete
- {\displayskipsize\displayshortskipfactor\displayshortskipgluefactor}
-
-\def\belowdisplayshortskipsize% obsolete
- {\displayskipsize\displayshortskipfactor\displayshortskipgluefactor}
-
-\def\forgetdisplayskips % to do
- {\abovedisplayskip \zeropoint
- \belowdisplayskip \zeropoint
- \abovedisplayshortskip\zeropoint
- \belowdisplayshortskip\zeropoint}
-
-\definenumber % \definelabel
- [\v!formula]
- [\c!text=\v!formula,
- \c!way=\@@fmway,
- \c!blockway=\@@fmblockway,
- \c!location=\v!intext,
- \c!conversion=\@@fmconversion]
-
-\def\setupformulas
- {\dodoubleargument\getparameters[\??fm]}
-
-\newconditional\handleformulanumber
-\newconditional\incrementformulanumber
-
-\def\formuladistance{\formulaparameter\c!distance}
-
-\def\doformulareference#1#2%
- {\doifsomething{#1}{\doifnotinset{#1}{+,-}{\rawreference\s!for{#1}{#2}}}}
-
-\def\dododoformulanumber#1#2#3#4% (#1,#2)=outer(ref,sub) (#3,#4)=inner(ref,sub)
- {\hbox\bgroup
- \ifconditional\handleformulanumber
- \ifconditional\incrementformulanumber
- \incrementnumber[\v!formula]%
- \fi
- \makesectionnumber[\v!formula]%
- \setbox0\hbox{\ignorespaces#2\unskip}%
- \ifdim\wd0>\zeropoint
- \edef\hetsubnummer{\@@fnseparator#2}%AM: was \edef\hetsubnummer{#2}%
- \else
- \let\hetsubnummer\empty
- \fi
- \doformulareference{#1}{\composedsectionnumber\hetsubnummer}%
- \setbox0\hbox{\ignorespaces#4\unskip}%
- \ifdim\wd0>\zeropoint
- \edef\hetsubnummer{\@@fnseparator#4}%AM: was \edef\hetsubnummer{#4}%
- \fi
- \doformulareference{#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
- \preparefullnumber\??fm\composedsectionnumber\preparednumber
- \labeltexts\v!formula
- {\ignorespaces\preparednumber\ignorespaces\hetsubnummer\unskip}%
- \@@fmright
- \dostopattributes}%
- \doif{\formulaparameter\c!location}\v!left{\hskip\formuladistance}%
- \fi
- \egroup}
-
-\def\dodoformulanumber[#1][#2][#3]%
- {\doquadruplegroupempty\dododoformulanumber{#1}{#2}{#3}}
-
-\def\doformulanumber
- {\dotripleempty\dodoformulanumber}
-
-\setvalue{\e!start\v!formula}{\dostartformula{}}
-\setvalue{\e!stop \v!formula}{\dostopformula}
-
-\def\definieerformule
- {\dodoubleempty\dodefinieerformule}
-
-\def\dodefinieerformule[#1][#2]%
- {\doifsomething{#1}
- {\copyparameters
- [\??fm#1][\??fm]
- [\c!spacebefore,\c!spaceafter,\c!grid,
- \c!leftmargin,\c!rightmargin,\c!margin,
- \c!indentnext,\c!alternative,
- \c!strut,\c!align,\c!distance]%
- \setupformulas[#1][#2]%
- \setvalue{\e!start#1\v!formula}{\dostartformula{#1}}%
- \setvalue{\e!stop #1\v!formula}{\dostopformula}}}
-
-\newtoks \everysetupformulas \relax % we need a hook for extensions in modules
-
-\def\setupformulas
- {\dodoubleempty\dosetupformulas}
-
-\def\dosetupformulas[#1][#2]%
- {\ifsecondargument
- \getparameters[\??fm#1][#2]%
- \else
- \getparameters[\??fm][#1]%
- \fi
- \the\everysetupformulas}
-
-\def\formulaparameter#1%
- {\csname\??fm\currentformula#1\endcsname}
-
-\setupformulas
- [\c!way=\@@nrway,
- \c!blockway=,
- \c!sectionnumber=\@@nrsectionnumber,
- \c!conversion=\v!numbers,
- \c!location=\v!right,
- \c!left=(,
- \c!right=),
- \c!spacebefore=,
- \c!spaceafter=\@@fmspacebefore,
- \c!leftmargin=\!!zeropoint,
- \c!rightmargin=\!!zeropoint,
- \c!margin=,
- \c!indentnext=\v!no,
- \c!alternative=\s!default,
- \c!align=,
- \c!strut=\v!no,
- \c!separator=\@@koseparator,
- \c!distance=1em]
-
-\def\currentformula {}
-\def\predisplaysizethreshhold{2em} % was 3em
-
-\def\leftdisplayskip {\leftskip}
-\def\rightdisplayskip {\rightskip}
-\def\leftdisplaymargin {\formulaparameter\c!leftmargin}
-\def\rightdisplaymargin {\formulaparameter\c!rightmargin}
-\def\displaygridsnapping{\formulaparameter\c!grid}
-
-\def\beforedisplayspace
- {\doifnot{\formulaparameter\c!spacebefore}\v!none{\blank[\formulaparameter\c!spacebefore]}}
-
-\def\afterdisplayspace
- {\doifnot{\formulaparameter\c!spaceafter }\v!none{\blank[\formulaparameter\c!spaceafter ]}}
-
-\def\setpredisplaysize#1%
- {\predisplaysize#1\relax
- \ifdim\predisplaysize<\maxdimen
- \ifdim\predisplaysize>\zeropoint
- \advance\predisplaysize \predisplaysizethreshhold
- \fi
- \advance\predisplaysize \displayindent % needed ?
- \ifdim\predisplaysize>\hsize
- \predisplaysize\hsize
- \fi
- \else
- \predisplaysize\zeropoint
- \fi}
-
-\def\setdisplaydimensions
- {\displayindent\leftdisplayskip
- \advance\displayindent\leftdisplaymargin
- \displaywidth\hsize
-% \setlocalhsize
-% \displaywidth\localhsize
- \ifdim\hangindent>\zeropoint
- \advance\displayindent\hangindent
- \else
- \advance\displaywidth\hangindent
- \fi
- \advance\displaywidth-\displayindent
- \advance\displaywidth-\rightdisplayskip
- \advance\displaywidth-\rightdisplaymargin
- \hsize\displaywidth} % new, else overfull in itemize
-
-\newif\ifoptimizedisplayspacing
-
-\def\dostartformula#1%
- {\dodoubleempty\dodostartformula[#1]}
-
-\newskip\formulaparskip
-\newskip\formulastrutht
-\newskip\formulastrutdp
-
-% hm, invoke otr in hmode in order to move skips to mvl, could be an option
-
-%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
- %
- % \ifdim\lastskip>\zeropoint
- % \resetlastlinewidth % else problems with in between stuff without \epar
- % \fi
- \bgroup % HERE
- \the\everybeforedisplayformula
- \formulaparskip\parskip
- \formulastrutdp\strutdepth
- \formulastrutht\strutheight
- \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
- \long\def\dostartformula##1{\bgroup\let\dostopformula\egroup}%
- \freezedimenmacro\leftdisplayskip
- \freezedimenmacro\rightdisplayskip
- \freezedimenmacro\leftdisplaymargin
- \freezedimenmacro\rightdisplaymargin
- \freezedimenmacro\predisplaysizethreshhold
- \forgetdisplayskips
- \ifoptimizedisplayspacing
- \ifdim\lastlinewidth>\zeropoint
- \abovedisplayshortskip-\strutht\relax
- \fi
- \else
- \resetlastlinewidth
- \fi
- \getvalue{\e!start\formulaparameter\c!alternative\v!formula}}
-
-\def\switchtoformulabodyfont{\switchtobodyfont}
-
-\setvalue{\v!formula}{\dosingleempty\doformula}
-
-\def\doformula[#1]#2%
- {\begingroup
- \switchtoformulabodyfont[#1]%
- % not : \def\doformula[##1]##2{\mathematics{##2}}%
- \mathematics{#2}%
- \endgroup}
-
-\let\doplaceformulanumber\empty
-
-\def\dostopformula
- {\doplaceformulanumber
- \getvalue{\e!stop\formulaparameter\c!alternative\v!formula}%
- \resetlastlinewidth
- \nonoindentation
- \dochecknextindentation{\??fm\currentformula}%
- \egroup
- \hangafter\minusone % added for side floats
- \hangindent\zeropoint % added for side floats
- \setfalse\handleformulanumber
- \dorechecknextindentation} % here ?
-
-\newif\ifinformula
-
-\def\startdisplaymath
- {\ifgridsnapping
- \beforedisplayspace
- \snapmathtogrid\vbox
- \bgroup
- \informulatrue
- %\forgetall % breaks side floats
- \else
- \bgroup
- \parskip\formulaparskip % ! !
- \informulatrue
- %\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
- \fi
- \doif\displaygridcorrection{-\v!top}{\kern-\strutht}% new, currently only option/default
- \beforedisplayspace
- \par
- \ifvmode
- \ifindentfirstparagraph % tricky, probably needs more testing
- \prevdepth-\maxdimen % texbook pagina 79-80
- % otherwise problems at the top of a page, don't remove:
- \verticalstrut
- \vskip-\struttotal
- \vskip-\baselineskip
- \fi
- \fi
- \fi
- $$\setdisplaydimensions
- \setpredisplaysize\lastlinewidth
- \startinnermath}
-
-\def\stopdisplaymath
- {\stopinnermath
- $$%
- \ifgridsnapping
- \egroup
- \afterdisplayspace
- \else
- \par\ifvmode\ifdim\parskip>\zeropoint\whitespace\vskip-\parskip\fi\fi
- \afterdisplayspace
- \egroup
- \fi
- \globallet\displaylinecorrection\empty
- \gdef\displaygridcorrection{\displaygridsnapping}}
-
-\newif\ifclipdisplaymath \clipdisplaymathtrue
-\def\displaymathclipfactor{1.1}
-
-\def\snapmathtogrid % to do \dp
- {\dowithnextbox
- {\bgroup
- \donefalse
- \ifclipdisplaymath
- \ifdim\nextboxht<\displaymathclipfactor\lineheight
- \donetrue
- \fi
- \fi
- \ifdone
- \nextboxht\lineheight
- \else
- \getnoflines\nextboxht
- \setbox\nextbox\vbox to \noflines\lineheight
- {\vfill\flushnextbox\vfill}%
- \setbox\nextbox\hbox{\lower\strutdepth\flushnextbox}%
- \fi
- \snaptogrid[\displaygridcorrection]\hbox{\flushnextbox}%
- \egroup}}
-
-\def\displaygridcorrection{\displaygridsnapping}
-\let\displaygridcorrection\empty
-
-\def\moveformula
- {\dosingleempty\domoveformula}
-
-\def\domoveformula[#1]% brr gaat mogelijk fout
- {\iffirstargument
- \xdef\displaygridcorrection{#1}%
- \else
- \gdef\displaygridcorrection{-\v!top}% handy with short preline
- \fi
- \globallet\displaylinecorrection\displaygridcorrection}
-
-\let\startinnermath\empty
-\let\stopinnermath \empty
-
-\def\defineformulaalternative
- {\dotripleargument\dodefineformulaalternative}
-
-\def\dodefineformulaalternative[#1][#2][#3]%
- {\setvalue{\e!start#1\v!formula}{#2}%
- \setvalue{\e!stop #1\v!formula}{#3}}
-
-\defineformulaalternative[\s!default][\startdisplaymath][\stopdisplaymath]
-
-% sp = single line paragraph sd = single line display
-% mp = multi line paragraph md = multy line display
-
-\defineformulaalternative[single][\startdisplaymath][\stopdisplaymath]
-\defineformulaalternative[multi] [\startdisplaymath][\stopdisplaymath]
-
-\definieerformule
- [sp]
- [\c!spacebefore=\v!none,\c!spaceafter=\v!none,
- \c!indentnext=\v!no,
- \c!alternative=single]
-
-\definieerformule
- [sd]
- [\c!spacebefore=\v!none,\c!spaceafter=\v!none,
- \c!indentnext=\v!yes,
- \c!alternative=single]
-
-\definieerformule
- [mp]
- [\c!indentnext=\v!no,
- \c!alternative=multi]
-
-\definieerformule
- [md]
- [\c!indentnext=\v!yes,
- \c!alternative=multi]
-
-% \defineformulaalternative[multi][\begindmath][\enddmath]
-%
-% \fakewords{20}{40}\epar
-% \placeformula {a} $$ \fakespacingformula $$
-% \fakewords{20}{40}\epar
-% \placeformula {b} \startformule \fakespacingformula \stopformule
-% \placeformula {b} \startformule \fakespacingformula \stopformule
-% \fakewords{20}{40}\epar
-% \placeformula {c} \startmdformule \fakespacingformula \stopmdformule
-% \placeformula {c} \startmdformule \fakespacingformula \stopmdformule
-% \fakewords{20}{40}\epar
-% \placeformula {d} \startmpformule \fakespacingformula \stopmpformule
-% \placeformula {d} \startmpformule \fakespacingformula \stopmpformule
-% \fakewords{20}{40}\epar
-% \placeformula {e} \startsdformule \fakespacingformula \stopsdformule
-% \placeformula {e} \startsdformule \fakespacingformula \stopsdformule
-% \fakewords{20}{40}\epar
-% \placeformula {f} \startspformule \fakespacingformula \stopspformule
-% \placeformula {f} \startspformule \fakespacingformula \stopspformule
-% \fakewords{20}{40}
-
-\def\placeformula
- {\settrue\incrementformulanumber
- \dodoubleempty\doplaceformula}
-
-\def\placesubformula
- {\setfalse\incrementformulanumber
- \dodoubleempty\doplaceformula}
-
-%D \macros
-%D {setupsubformulas, startsubformulas}
-%D
-%D New code (by Aditya Mahajan / cleaned up by HH, please check):
-
-% \setupsubformulas[conversion=romannumerals]
-%
-% \placeformula
-% \startsubformulas[Maxwell]
-% \startformulas
-% \startformula \startalign
-% \NC \nabla\cdot\bf E \NC = \frac{\rho}{\varepsilon_0} \NR[Maxwell 1]
-% \NC \nabla\times\bf E \NC = - \frac{\partial\bf B}{\partial t} \NR[Maxwell II]
-% \stopalign \stopformula
-% \startformula \startalign
-% \NC \nabla\cdot \bf B \NC = 0 \NR[Maxwell III]
-% \NC \nabla\times\bf B \NC = \mu_0{\bf j}+\varepsilon_0\mu_0\frac{\partial\bf E}{\partial t} \NR[Maxwell IV]
-% \stopalign \stopformula
-% \stopformulas
-% \stopsubformulas
-%
-% Maxwell : \in [Maxwell] and II : \in [Maxwell II]
-
-\def\setupsubformulas
- {\dodoubleargument\getparameters[\??fn]}
-
-\definenumber[\v!formula*]
-
-\def\subformulaconversion % #1
- {\getnumber[\v!formula*]\@@fnseparator\convertnumber\@@fnconversion} % #1
-
-\defineconversion[\v!subformula][\subformulaconversion]
-
-\def\startsubformulas
- {\dosingleempty\dostartsubformulas}
-
-\def\dostartsubformulas[#1]%
- {\incrementnumber[\v!formula]%
- \makesectionnumber[\v!formula]%
- \doflushformulalistentry{\composedsectionnumber}%
- \doformulareference{#1}\composedsectionnumber
- \expanded{\setupnumber
- [\v!formula*]
- [\c!start={\rawnumber[\v!formula]},
- \c!way=\@@fmway,
- \c!conversion=\@@fmconversion]}%
- \bgroup
- \savenumber[\v!formula]%
- \setupformulas
- [\c!conversion=\v!subformula,
- \c!way=\v!by\v!text]%
- \resetnumber
- [\v!formula]}
-
-\def\stopsubformulas
- {\restorenumber[\v!formula]%
- \egroup
- \resetlastlinewidth
- \nonoindentation
- \dochecknextindentation\??fn
- \dorechecknextindentation} % here ?
-
-%D Named subformulas
-
-\def\startnamedsubformulas
- {\dosingleempty\dostartnamedsubformulas}
-
-\def\dostartnamedsubformulas[#1]#2%
- {\setformulalistentry{#2}%
- \startsubformulas[#1]}
-
-\def\stopnamedsubformulas
- {\stopsubformulas}
-
-\setupsubformulas
- [\c!conversion=\v!character,
- %\c!separator=\@@fmseparator,
- \c!separator=,% AM: for compatibility with \placesubformula
- \c!indentnext=\@@fmindentnext]
-
-%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
- \ifx\next\bgroup
- \egroup \@EA\moreplaceformula % [ref]{}
- \else
- \let\nextnext$% no def
- \ifx\next\nextnext
- \egroup \@EAEAEA\dispplaceformula % [ref]$$
- \else
- \egroup \@EAEAEA\dodoplaceformula % [ref]\start
- \fi
- \fi[#1]{}}%
- \futurelet\next\redoplaceformula}
-
-\long\def\moreplaceformula[#1]#2#3#4% #2 dummy #4 gobbles spaces
- {\def\redoplaceformula
- {\bgroup
- \let\nextnext$% no def
- \ifx\next\nextnext
- \egroup \@EA\dispplaceformula % [ref]$$
- \else
- \egroup \@EA\dodoplaceformula % [ref]\start
- \fi
- [#1]{#3}}%
- \futurelet\next\redoplaceformula#4}
-
-\let\startplaceformula\placeformula
-\let\stopplaceformula \relax
-
-\def\startformulas#1\stopformulas % new / to be internationalized
- {\bgroup
- \forgetdisplayskips
- \startdisplaymath
- \setlocalhsize
- \long\def\startformula##1\stopformula
- {\advance\scratchcounter\plusone}%
- \scratchcounter\zerocount
- #1% preroll
- \ifcase\scratchcounter\else
- \divide \hsize \scratchcounter
- \fi
- \hbox to \localhsize \bgroup
- \hss
- \def\normalstartformula{\vskip-\strutdepth$$}% i hate this
- \def\normalstopformula {$$}%
- \def\startformula {$\vcenter\bgroup\normalstartformula}%
- \def\stopformula {\normalstopformula\egroup$\hss}%
- #1%
- \egroup
- \stopdisplaymath
- \egroup
- \hangafter\minusone % added for side floats
- \hangindent\zeropoint} % added for side floats
-
-\def\dispplaceformula[#1]#2$$#3$$%
- {\dodoplaceformula[#1]{#2}\dostartformula{}#3\dostopformula}
-
-\let\donestedformulanumber\gobbletwoarguments
-
-\def\dodoplaceformula[#1]#2% messy, needs a clean up
- {\doifelse{#1}{-}
- {\setfalse\handleformulanumber}
- {\doifelse{#2}{-}
- {\setfalse\handleformulanumber}
- {\settrue\handleformulanumber}}%
- \ifconditional\handleformulanumber
- \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}%
- \gdef\doplaceformulanumber
- {\global\let\doplaceformulanumber\empty
- \doifelse\@@fmlocation\v!left
- {\normalleqno{\doformulanumber[#1][#2][]{}}}
- {\normalreqno{\doformulanumber[#1][#2][]{}}}}%
- \else
- \def\formulanumber{\doformulanumber[#1][#2]}%
- \let\donestedformulanumber\gobbletwoarguments
- \let\subformulanumber\doformulanumber % was \global
- \global\let\doplaceformulanumber\empty
- \fi}
-
-%D We need a hook into the plain math alignment macros
-%D
-%D \starttyping
-%D \displaylines
-%D \eqalignno
-%D \eqalignno
-%D \stoptyping
-%D
-%D Otherwise we get a missing \type {$$} error reported.
-
-\def\resetdisplaymatheq
- {\let\normalleqno\relax \let\leqno\relax
- \let\normalreqno\relax \let\eqno \relax
- \let\doplaceformulanumber\empty}
-
-%D The next code is derived from plain \TEX.
-
-\newcount\interdisplaylinepenalty \interdisplaylinepenalty=100
-
-\newif\ifdt@p
-
-\def\displ@y
- {\global\dt@ptrue
- \openup\displayopenupvalue % was \openup\jot
- \everycr
- {\noalign
- {\ifdt@p
- \global\dt@pfalse
- \ifdim\prevdepth>-\thousandpoint
- \vskip-\lineskiplimit
- \vskip\normallineskiplimit
- \fi
- \else
- \penalty\interdisplaylinepenalty
- \fi}}}
-
-\let\normaldispl@y\displ@y
-
-\def\displ@y{\resetdisplaymatheq\normaldispl@y}
-
-\def\m@th{\mathsurround\zeropoint} % obsolete
-
-%D Here we implement a basic math alignment mechanism. Numbers
-%D are also handled. The macros \type {\startinnermath} and
-%D \type {\stopinnermath} can be overloaded in specialized
-%D modules.
-
-\def\startinnermath
- {\getvalue{\e!start\??fm\formulaparameter\c!align}}
-
-\def\stopinnermath
- {\getvalue{\e!stop \??fm\formulaparameter\c!align}}
-
-\def\mathinnerstrut
- {\doif{\formulaparameter\c!strut}\v!yes\strut}
-
-\long\def\defineinnermathhandler#1#2#3%
- {\setvalue{\e!start\??fm#1}{#2}%
- \setvalue{\e!stop \??fm#1}{#3}}
-
-\newif\iftracemath
-
-\def\mathhbox
- {\iftracemath\ruledhbox\else\hbox\fi}
-
-\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
- \let\normalreqno\eqno
- \let\normalleqno\leqno
- % added
- \doplaceformulanumber
- \setbox\scratchbox\mathhbox to \displaywidth\bgroup
- \mathinnerstrut
- $%
- \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
- \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!left {\startmathbox\plusone }{\stopmathbox}
-\defineinnermathhandler\v!middle {\startmathbox\plustwo }{\stopmathbox}
-\defineinnermathhandler\v!right {\startmathbox\plusthree}{\stopmathbox}
-\defineinnermathhandler\v!flushleft {\startmathbox\plusthree}{\stopmathbox}
-\defineinnermathhandler\v!center {\startmathbox\plustwo }{\stopmathbox}
-\defineinnermathhandler\v!flushright{\startmathbox\plusone }{\stopmathbox}
-
-%D [The examples below are in english and don't process in the
-%D documentation style, which will be english some day.]
-%D
-%D Normally a formula is centered, but in case you want to
-%D align it left or right, you can set up formulas to behave
-%D that way. Normally a formula will adapt is left indentation
-%D to the environment:
-%D
-%D \startbuffer
-%D \fakewords{20}{40}\epar
-%D \startitemize
-%D \item \fakewords{20}{40}\epar
-%D \placeformula \startformula \fakeformula \stopformula
-%D \item \fakewords{20}{40}\epar
-%D \stopitemize
-%D \fakewords{20}{40}\epar
-%D \stopbuffer
-%D
-%D % \getbuffer
-%D
-%D In the next examples we explicitly align formulas to the
-%D left (\type {\raggedleft}), center and right (\type
-%D {\raggedright}):
-%D
-%D \startbuffer
-%D \setupformulas[align=left]
-%D \startformula\fakeformula\stopformula
-%D \setupformulas[align=middle]
-%D \startformula\fakeformula\stopformula
-%D \setupformulas[align=right]
-%D \startformula\fakeformula\stopformula
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D Or in print:
-%D
-%D % {\getbuffer}
-%D
-%D With formula numbers these formulas look as follows:
-%D
-%D \startbuffer
-%D \setupformulas[align=left]
-%D \placeformula \startformula\fakeformula\stopformula
-%D \setupformulas[align=middle]
-%D \placeformula \startformula\fakeformula\stopformula
-%D \setupformulas[align=right]
-%D \placeformula \startformula\fakeformula\stopformula
-%D \stopbuffer
-%D
-%D % {\getbuffer}
-%D
-%D This was keyed in as:
-%D
-%D \typebuffer
-%D
-%D When tracing is turned on (\type {\tracemathtrue}) you can
-%D visualize the bounding box of the formula,
-%D
-%D % {\tracemathtrue\getbuffer}
-%D
-%D As you can see, the dimensions are the natural ones, but if
-%D needed you can force a normalized line:
-%D
-%D \startbuffer
-%D \setupformulas[strut=yes]
-%D \placeformula \startformula \fakeformula \stopformula
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D This time we get a more spacy result.
-%D
-%D % {\tracemathtrue\getbuffer}
-%D
-%D We will now show a couple of more settings and combinations
-%D of settings. In centered formulas, the number takes no space
-%D
-%D \startbuffer
-%D \setupformulas[align=middle]
-%D \startformula \fakeformula \stopformula
-%D \placeformula \startformula \fakeformula \stopformula
-%D \stopbuffer
-%D
-%D \typebuffer % {\tracemathtrue\getbuffer}
-%D
-%D You can influence the placement of the whole box with the
-%D parameters \type {leftmargin} and \type {rightmargin}.
-%D
-%D \startbuffer
-%D \setupformulas[align=right,leftmargin=3em]
-%D \startformula \fakeformula \stopformula
-%D \placeformula \startformula \fakeformula \stopformula
-%D
-%D \setupformulas[align=left,rightmargin=1em]
-%D \startformula \fakeformula \stopformula
-%D \placeformula \startformula \fakeformula \stopformula
-%D \stopbuffer
-%D
-%D \typebuffer % {\tracemathtrue\getbuffer}
-%D
-%D You can also inherit the margin from the environment.
-%D
-%D \startbuffer
-%D \setupformulas[align=right,margin=standard]
-%D \startformula \fakeformula \stopformula
-%D \placeformula \startformula \fakeformula \stopformula
-%D \stopbuffer
-%D
-%D \typebuffer % {\tracemathtrue\getbuffer}
-%D
-%D The distance between the formula and the number is only
-%D applied when the formula is left or right aligned.
-%D
-%D \startbuffer
-%D \setupformulas[align=left,distance=2em]
-%D \startformula \fakeformula \stopformula
-%D \placeformula \startformula \fakeformula \stopformula
-%D \stopbuffer
-%D
-%D \typebuffer % {\tracemathtrue\getbuffer}
-
-%D \macros
-%D {big..}
-%D
-%D Because they are related to the bodyfontsize, we redefine
-%D some \PLAIN\ macros.
-
-\def\@@dobig#1#2%
- {{\hbox{$\left#2\vbox\!!to#1\bodyfontsize{}\right.\nulldelimiterspace\zeropoint\relax\mathsurround\zeropoint$}}}
-
-\def\big {\@@dobig{0.85}}
-\def\Big {\@@dobig{1.15}}
-\def\bigg{\@@dobig{1.45}}
-\def\Bigg{\@@dobig{1.75}}
-
-%D \macros
-%D {bordermatrix}
-%D
-%D We already redefined \type {\bordermatrix} in \type
-%D {font-ini}.
-
-%D \macros
-%D {setuptextformulas}
-%D
-%D This command sets up in||line math. Most features deals
-%D with grid snapping and are experimental.
-
-\newevery \everysetuptextformulas \relax
-
-\def\setuptextformulas
- {\dosingleempty\dosetuptextformulas}
-
-\def\dosetuptextformulas[#1]%
- {\getparameters[\??mt][#1]%
- \the\everysetuptextformulas}
-
-%D \macros
-%D {super, sub}
-%D
-%D \TEX\ uses \type{^} and \type{_} for entering super- and
-%D subscript mode. We want however a bit more control than
-%D normally provided, and therefore provide \type {\super}
-%D and \type{sub}.
-
-\global\let\normalsuper=^
-\global\let\normalsuber=_
-
-\newcount\supersubmode
-
-\newevery\everysupersub \EverySuperSub
-
-\appendtoks \advance\supersubmode \plusone \to \everysupersub
-
-\appendtoks
- \gridsupsubstyle
-\to \everysupersub
-
-\appendtoks
- \doifelse\@@mtsize\v!small
- {\let\gridsupsubstyle \scriptscriptstyle
- \let\gridsupsubbodyfont \setsmallbodyfont}%
- {\let\gridsupsubstyle \scriptstyle
- \let\gridsupsubbodyfont \relax}%
-\to \everysetuptextformulas
-
-\setuptextformulas
- [\c!size=\v!normal]
-
-\def\dogridsupsub#1#2%
- {\begingroup
- \setbox\nextbox\iftracegridsnapping\ruledhbox\else\hbox\fi
- {\gridsupsubbodyfont
- $\strut^{\the\everysupersub#1}_{\the\everysupersub#2}$}%
- \nextboxht\strutheight
- \nextboxdp\strutdepth
- \flushnextbox
- \endgroup}
-
-\def\gridsupsub
- {\ifconditional\crazymathsnapping
- \ifgridsnapping
- \@EAEAEA\dogridsupsub
- \else
- \@EAEAEA\normalsupsub
- \fi
- \else
- \@EA\normalsupsub
- \fi}
-
-\def\normalsupsub#1#2%
- {^{\the\everysupersub#1}_{\the\everysupersub#2}}
-
-\appendtoks
- \let\gridsupsubstyle \relax
- \let\gridsupsubbodyfont\relax
- \let\gridsupsub \normalsupsub
-\to \everydisplay
-
-\def\super#1{^{\the\everysupersub#1}}
-\def\suber#1{_{\the\everysupersub#1}}
-\def\supsub#1#2{\super{#1}\suber{#2}}
-\def\subsup#1#2{\suber{#1}\super{#2}}
-
-%\def\super#1{\gridsupsub{#1}{}} %
-%\def\suber#1{\gridsupsub{}{#1}} %
-%
-%\def\supsub#1#2{\gridsupsub{#1}{#2}}
-%\def\subsup#1#2{\gridsupsub{#2}{#1}}
-
-\def\gridsuper#1{\gridsupsub{#1}{}}
-\def\gridsuber#1{\gridsupsub{}{#1}}
-
-% \let\sup\super % math char
-% \let\sub\suber
-
-% test set:
-%
-% \startbuffer
-% \sform{x\frac{1}{2}}
-% \sform{x\sup{\frac{1}{2}} + x\sup{2} + 2}
-% \sform{x\supsub{\frac{1}{2}}{\frac{1}{2}} + x\sup{2} + 2}
-% \stopbuffer
-%
-% \typebuffer
-%
-% \startlines
-% \getbuffer
-% \stoplines
-%
-% \startbuffer
-% $x\frac{1}{2}$
-% $x\sup{\frac{1}{2}} + x^2 + 2$
-% $x\supsub{\frac{1}{2}}{\frac{1}{2}} + x^2 + 2$
-% \stopbuffer
-%
-% \typebuffer
-%
-% \start
-% \enablesupersub
-% \enableautomath
-% \startlines
-% \getbuffer
-% \stoplines
-% \stop
-
-%D \macros
-%D {enablesupersub,enablesimplesupersub}
-%D
-%D We can let \type {^} and \type {_} act like \type {\super}
-%D and \type {\sub} by saying \type {\enablesupersub}.
-
-\bgroup
-\catcode`\^=\@@active
-\catcode`\_=\@@active
-\gdef\enablesupersub
- {\catcode`\^=\@@active
- \def^{\ifmmode\expandafter\super\else\expandafter\normalsuper\fi}%
- \catcode`\_=\@@active
- \def_{\ifmmode\expandafter\suber\else\expandafter\normalsuber\fi}}
-\egroup
-
-%D \macros
-%D {enableautomath}
-%D
-%D The next one can be dangerous, but handy in controlled
-%D situations.
-
-\bgroup \catcode`\$=\active
-
-\gdef\enableautomath
- {\catcode`\$=\active
- \def$##1${\snappedinlineformula{##1}}}
-
-% \gdef\enableautomath
-% {\catcode`\$=\active
-% \def${\doifnextcharelse$\doautodmath\doautoimath}%
-% \def\doautoimath##1${\snappedinlineformula{##1}}%
-% \def\doautodmath$##1$${\startformula##1\stopformula}}
-
-\egroup
-
-%D \macros
-%D {...}
-%D
-%D New and experimental: snapping big inline math!
-
-\newconditional\halfcrazymathlines % \settrue\halfcrazymathlines
-\newconditional\crazymathsnapping % \settrue\crazymathsnapping
-
-\appendtoks
- \doifelse\@@mtgrid\v!yes \settrue\setfalse\crazymathsnapping
- \doifelse\@@mtstep\v!halfline\settrue\setfalse\halfcrazymathlines
-\to \everysetuptextformulas
-
-\setuptextformulas
- [\c!grid=\v!yes,
- \c!step=\v!line]
-
-\newcount\crazymathhack
-
-\let\lastcrazymathline \!!zeropoint
-\let\lastcrazymathpage \!!zerocount
-\let\lastcrazymathprelines \!!zerocount
-\let\lastcrazymathpostlines\!!zerocount
-
-\def\crazymathtag{amh:\the\crazymathhack}
-\def\crazytexttag{\v!text:\lastcrazymathpage}
-
-\def\crazymathindent{\hskip\MPx\crazymathtag\hskip-\MPx\crazytexttag}
-
-\def\flushcrazymathbox
- {\nextboxht\strutheight
- \nextboxdp\strutdepth
- \hbox{\iftracegridsnapping\ruledhbox\fi{\flushnextbox}}}
-
-% possible pdftex bug:
-%
-% \dorecurse{100}{gest \vadjust {\strut} \par} \page
-% \dorecurse{100}{gest \vadjust pre {\strut} \par} \page
-%
-% duplicate depth compensation with pre
-
-\def\snappedinlineformula
- {\dosingleempty\dosnappedinlineformula}
-
-%D \starttabulate[|Tl|l|]
-%D \NC - \NC half lines \NC \NR
-%D \NC + \NC full lines \NC \NR
-%D \NC = \NC force \NC \NR
-%D \NC < \NC force, minus pre \NC \NR
-%D \NC > \NC force, minus post \NC \NR
-%D \stoptabulate
-
-\newif\if!!donee
-\newif\if!!donef
-
-\def\inlinemathmargin{1pt}
-
-\settrue\autocrazymathsnapping
-
-% FROM NOW ON, CHANGES AS OPTIONS
-
-% TODO: SKYLINE (PREV LINE POS SCAN)
-
-\def\dosnappedinlineformula[#1]#2%
- {\ifvmode\dontleavehmode\fi % tricky
- \strut % prevents funny space at line break
- \begingroup % interesting: \bgroup can make \vadjust disappear
- \ifconditional\crazymathsnapping
- \ifgridsnapping
- \ifx\pdftexversion\undefined
- \donefalse
- \else
- \checktextbackgrounds % we need pos tracking, to be made less redundant
- \donetrue
- \fi
- \else
- \donefalse
- \fi
- \else
- \donefalse
- \fi
- \!!doneafalse % forced or not auto
- \!!donebfalse % too heigh
- \!!donecfalse % too low
- \!!donedfalse % less before
- \!!doneefalse % less after
- \ifdone
- \setbox\nextbox\hbox{$#2$}%
- \iftracegridsnapping
- \setbox\nextbox\ruledhbox
- {\incolortrue\localcolortrue
- \backgroundline[gray]{\showstruts\strut\flushnextbox}}%
- \fi
- \def\docommand##1%
- {\doif{##1}-{\settrue \halfcrazymathlines}%
- \doif{##1}+{\setfalse\halfcrazymathlines}%
- \doif{##1}={\!!doneatrue}%
- \doif{##1}<{\!!donedtrue}%
- \doif{##1}>{\!!doneetrue}}%
- \processcommalist[#1]\docommand
-\if!!doneb
- \if!!donec \else
- \setfalse\halfcrazymathlines
- \fi
-\else
- \if!!donec
- \setfalse\halfcrazymathlines
- \fi
-\fi
- \donefalse
- \if!!donea
- \donetrue
-\scratchdimen \nextboxht
-\advance\scratchdimen .5\lineheight
-\nextboxht\scratchdimen
-\scratchdimen \nextboxdp
-\advance\scratchdimen .5\lineheight
-\nextboxdp\scratchdimen
- \else\ifdim\nextboxht>\strutht
- \donetrue
- \else\ifdim\nextboxdp>\strutdp
- \donetrue
- \fi\fi\fi
- \ifconditional\autocrazymathsnapping \else \if!!donea \else
- % don't compensate, just snap to strut
- \donefalse
- % signal for next else, snap line to strut
- \!!doneatrue
- \fi \fi
- \fi
- \ifdone
- % analyze height
- \scratchdimen\inlinemathmargin
- \advance\scratchdimen \strutht
- \ifdim\nextboxht<\scratchdimen \else \!!donebtrue \fi
- % analyze depth
- \scratchdimen\inlinemathmargin
- \advance\scratchdimen \strutdp
- \ifdim\nextboxdp<\scratchdimen \else \!!donectrue \fi
- % analyzed or forced
- \ifdone
- \global\advance\crazymathhack\plusone
- \donefalse
- \ifnum\MPp\crazymathtag=\lastcrazymathpage\relax
- \ifdim\MPy\crazymathtag=\lastcrazymathline\relax
- \donetrue
- \fi
- \fi
- \ifnum\MPp\crazymathtag=\zerocount \donefalse \fi
- \ifdim\MPy\crazymathtag=\zeropoint \donefalse \fi
- \ifdone
- % same page and same line
- \else
- \global\let\lastcrazymathprelines \!!zerocount
- \global\let\lastcrazymathpostlines\!!zerocount
- \xdef\lastcrazymathpage{\MPp\crazymathtag}%
- \xdef\lastcrazymathline{\MPy\crazymathtag}%
- \fi
- \if!!doneb
- % \getrawnoflines\nextboxht
- \scratchdimen\nextboxht
- \advance\scratchdimen-\strutht
- \getnoflines\scratchdimen
- \if!!doned \advance\noflines\minusone \fi
- \scratchcounter\noflines
- \advance\noflines-\lastcrazymathprelines\relax
- \ifnum\noflines>\zerocount
- \xdef\lastcrazymathprelines{\the\scratchcounter}%
- \scratchdimen\noflines\lineheight
- \ifconditional\halfcrazymathlines
- \advance\scratchdimen-.5\lineheight
- \fi
- \advance\scratchdimen-\strutdepth
- \setbox\scratchbox\null
- \wd\scratchbox2\bodyfontsize
- \ht\scratchbox\scratchdimen
- \dp\scratchbox\strutdepth
- %%% top correction code (see below)
- \normalvadjust pre
- {%\allowbreak % sometimes breaks spacing
- \forgetall
- \crazymathindent
- \iftracegridsnapping
- \setbox\scratchbox\hbox
- {\incolortrue\localcolortrue\green
- \ruledhbox{\box\scratchbox}}%
- \fi
- \box\scratchbox
- \endgraf
- \nobreak}%
- \else\ifnum\scratchcounter>\zerocount
- \normalvadjust pre
- {\nobreak}%
- \fi\fi
- \fi
- \if!!donec
- % \getrawnoflines\nextboxdp
- \scratchdimen\nextboxdp
- \advance\scratchdimen-\strutdp
- \getnoflines\scratchdimen
- \if!!donee \advance\noflines\minusone \fi
- \scratchcounter\noflines
- \advance\noflines-\lastcrazymathpostlines\relax
- \ifnum\noflines>\zerocount
- \donetrue
- \else\ifnum\lastcrazymathpostlines=\zerocount
- \donetrue
- \else
- \donefalse
- \fi\fi
- \else
- \donefalse
- \fi
- \ifdone
- \xdef\lastcrazymathpostlines{\the\scratchcounter}%
- \ifnum\lastcrazymathpostlines=\zerocount
- \global\let\lastcrazymathpostlines\!!plusone
- \fi
- \hbox{\setposition\crazymathtag\flushcrazymathbox}%
- \scratchdimen\noflines\lineheight
- \advance\scratchdimen-\lineheight
- \advance\scratchdimen+\strutheight
-\ifdim\scratchdimen>\zeropoint \else
- \scratchdimen=\strutheight % todo : test for half lines
-\fi
- \ifconditional\halfcrazymathlines
- \advance\scratchdimen-.5\lineheight
- \fi
- \setbox\scratchbox\null
- \wd\scratchbox2\bodyfontsize
- \ht\scratchbox\scratchdimen
- \dp\scratchbox\strutdepth
- \normalvadjust
- {\forgetall
- \crazymathindent
- \iftracegridsnapping
- \setbox\scratchbox\hbox
- {\incolortrue\localcolortrue\color[blue]{\ruledhbox{\box\scratchbox}}}%
- \fi
- \box\scratchbox
- \endgraf
- % precaution: else we stick below the text bottom
- \ifconditional\halfcrazymathlines
- \allowbreak
- \else
- \vskip-\lineheight
- \vskip \lineheight
- \fi}%
- \else
- \hbox{\setposition\crazymathtag\flushcrazymathbox}%
- \fi
- \else
- \flushcrazymathbox
- \fi
- \else\if!!donea
- \flushcrazymathbox
- \else
- \mathematics{#2}%
- \fi\fi
- \endgroup}
-
-
-%%% top correction code
-%%%
-%%% correct for fuzzy top of page situations
-%
-% \scratchdimen\lastcrazymathprelines\lineheight
-% \advance\scratchdimen\MPy\crazymathtag
-% \advance\scratchdimen\lineheight
-% \advance\scratchdimen\topskip
-% \advance\scratchdimen-\strutheight
-% \dimen0=\MPy\crazytexttag
-% \advance\dimen0 \MPh\crazytexttag
-% \advance\scratchdimen-\dimen0\relax
-% % do we need correction at all
-% \ifdim\scratchdimen>\strutdepth\relax
-% \donefalse
-% \else\ifdim\scratchdimen<\zeropoint
-% \donefalse
-% \else
-% \donetrue
-% \fi\fi
-% % analysis done
-% \donefalse
-% \ifdone
-% \edef\crazymathcorrection{\the\scratchdimen}%
-% \advance\scratchdimen-\dp\scratchbox
-% \dp\scratchbox-\scratchdimen
-% \else
-% \let\crazymathcorrection\zeropoint
-% \fi
-%
-%%%
-%%% keep the previous code
-%%%
-
-\let\tform\mathematics
-\let\gform\snappedinlineformula
-
-% test set:
-%
-% \startbuffer
-% Crazy math \gform {1+x} or \gform {\dorecurse {100} {1+} 1 =
-% 101} and even gore crazy \gform {2^{2^2}_{1_1}}
-% again\dorecurse {20} { and again} \gform {\sqrt {\frac
-% {x^{5^5}} {\frac {1} {2}}}} even gore\dorecurse {50} { and
-% gore} \tform {\dorecurse {12} {\gform {\sqrt {\frac
-% {x^{5^5}} {3}}}+\gform {\sqrt {\frac {x^{5^5}} {\frac {1}
-% {2}}}}+}x=10}\dorecurse{20} { super crazy math}: \tform
-% {\dorecurse {30} {\gform {\sqrt {\frac {x^{5^5}} {3}}}+
-% \gform {\sqrt {\frac {x^{5^5}} {\frac {1} {2}}}}+ }x = 10},
-% and we're\dorecurse {20} { done}!
-% \stopbuffer
-%
-% \setupcolors[state=start] \setuppapersize[S6][S6]
-%
-% \showgrid \tracegridsnappingtrue \showstruts
-%
-% \starttext
-% \setuplayout[grid=yes,lines=15]\getbuffer \page
-% \setuplayout[grid=yes,lines=16]\getbuffer \page
-% \setuplayout[grid=yes,lines=17]\getbuffer \page
-% \setuplayout[grid=yes,lines=18]\getbuffer \page
-% \setuplayout[grid=yes,lines=19]\getbuffer \page
-% \stoptext
-%
-% test
-%
-% \startregels
-% \gform[<]{35 \cdot p^{\frac{3}{4}} = 70}
-% \gform{12{,}4 \cdot d^3 = 200}
-% \gform{a \cdot x^b}.
-% \gform{12x^6 \cdot \negative 3x^4}
-% \gform{\frac{12x^6}{\negative 3x^4}}
-% \gform{(4x^2)^3}
-% \gform{4x \sqrt{x} \cdot 3x^2}
-% \gform{\frac{2x^4}{4x \sqrt{x}}}
-% \gform{y = a \cdot x^b}.
-% \gform{y_1 = \frac{15x^2}{x}}
-% \gform{y_2 = x \cdot \sqrt{x}}
-% \gform{y_3 = \frac{6x^3}{x^2}}
-% \gform[<]{y_4 = \left(2x^2\right)^{\frac{1}{2}}}
-% \gform{y_1 = \frac{4x^5}{x^2}}
-% \gform{y_2 = 4 \cdot \sqrt{x}}
-% \gform{y_3 = 4x^3}
-% \gform{y_4 = \frac{100x}{\sqrt{x}}}
-% \gform[<]{y_5 = 4 \cdot x^{\frac{1}{2}}}
-% \gform{y_6 = \frac{1}{2} x \cdot 4x^2}
-% \gform{y_7 = 2 \cdot x^3}
-% \gform{y_8 = 100 \cdot x^{\frac{1}{2}}}
-% \gform{4x^8 \cdot 8x^3}
-% \gform{\frac{4x^8}{8x^3}}
-% \gform{\left(\negative3x^4\right)^3}
-% \gform{x^3 \sqrt{x} \cdot 3x^2}
-% \gform{\frac{6x^3}{x^2 \sqrt{x}}}
-% \gform{\frac{6}{2x^4}}
-% \gform{\frac{1}{3x^6}}
-% \gform{\frac{12x^8}{4x^{10}}}
-% \gform{\frac{4}{\sqrt{x}}}
-% \gform{\frac{1}{2x \sqrt{x}}}
-% \gform{\frac{2{,}25}{p} = 0{,}35}
-% \gform{4{,}50 + \frac{300}{k} = 4{,}70}
-% \gform{\frac{1200}{k+12} - 42 = 6}
-% \stopregels
-
-%D \macros
-%D {restoremathstyle}
-%D
-%D We can pick up the current math style by calling \type
-%D {\restoremathstyle}.
-
-\def\restoremathstyle
- {\ifmmode
- \ifcase\supersubmode
- \textstyle
- \or
- \scriptstyle
- \else
- \scriptscriptstyle
- \fi
- \fi}
-
-%D \macros
-%D {mathstyle}
-%D
-%D If one want to be sure that something is typeset in the
-%D appropriate style, \type {\mathstyle} can be used:
-%D
-%D \starttyping
-%D \mathstyle{something}
-%D \stoptyping
-
-\def\mathstyle#1%
- {\mathchoice
- {\displaystyle #1}%
- {\textstyle #1}%
- {\scriptstyle #1}%
- {\scriptscriptstyle#1}}
-
-%D Something similar can be used in the (re|)|definition
-%D of \type {\text}. This version is a variation on the one
-%D in the math module (see \type{m-math} and|/|or \type
-%D {m-newmat}).
-
-\unexpanded\def\mathtext
- {\mathortext\domathtext\hbox}
-
-\def\domathtext#1%
- {\mathchoice
- {\dodomathtext\displaystyle \textface {#1}}%
- {\dodomathtext\textstyle \textface {#1}}%
- {\dodomathtext\scriptstyle \scriptface {#1}}%
- {\dodomathtext\scriptscriptstyle\scriptscriptface{#1}}}
-
-\def\dodomathtext#1#2#3% no \everymath !
- %{\hbox{\everymath{#1}\switchtobodyfont [#2]#3}} % 15 sec
- {\hbox{\everymath{#1}\setcurrentfontbody{#2}#3}} % 3 sec (no math)
-
-%D Because we may overload \type {\text} in other (structuring)
-%D macros, we say:
-
-\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
- {\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}%
- \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
- \global\chardef\mathnumberstatus\plusone
- \ifcase\mathraggedstatus
- \def\finishalignno{\crcr\egroup}%
- \else
- % we're in a mathbox
- \vcenter\bgroup
- \def\finishalignno{\crcr\egroup\egroup}%
- \fi
- \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]%
- {\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)
-
-%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\installmathmatrixhandler#1#2%
- {\setvalue{\??mx:#1}{#2}}
-
-% First alternative:
-%
-% \def\processlowhighmathmatrix#1%
-% {\def\mathmatrixleft
-% {\setbox\nextbox}
-% \def\mathmatrixright
-% {#1.5\dimexpr\nextboxdp-\nextboxht\relax
-% \hbox{$\mathmatrixparameter\c!left
-% \vcenter{\unvbox\nextbox}%
-% \mathmatrixparameter\c!right$}}%
-% \let\mathmatrixbox\vbox}
-%
-% \installmathmatrixhandler\v!high {\processlowhighmathmatrix\raise}
-% \installmathmatrixhandler\v!low {\processlowhighmathmatrix\lower}
-%
-% \installmathmatrixhandler\v!top {\processlowhighmathmatrix\raise}
-% \installmathmatrixhandler\v!bottom{\processlowhighmathmatrix\lower}
-%
-% \installmathmatrixhandler\v!lohi
-% {\def\mathmatrixleft {\mathmatrixparameter\c!left}%
-% \def\mathmatrixright{\mathmatrixparameter\c!right}%
-% \let\mathmatrixbox\vcenter}
-%
-% An alternative
-%
-% \let\mathmatrixleft \empty
-% \let\mathmatrixright\empty
-%
-% \def\processlowhighmathmatrix#1%
-% {\dowithnextbox
-% {#1.5\dimexpr\nextboxdp-\nextboxht\relax
-% \hbox{$\mathmatrixparameter\c!left
-% \vcenter{\unvbox\nextbox}%
-% \mathmatrixparameter\c!right$}}%
-% \vbox}
-%
-% \def\processlohimathmatrix
-% {\dowithnextbox
-% {\mathmatrixparameter\c!left
-% \vcenter{\unvbox\nextbox}%
-% \mathmatrixparameter\c!right}%
-% \vbox}
-%
-% \installmathmatrixhandler\v!high {\def\mathmatrixbox{\processlowhighmathmatrix\raise}}
-% \installmathmatrixhandler\v!low {\def\mathmatrixbox{\processlowhighmathmatrix\lower}}
-% \installmathmatrixhandler\v!top {\def\mathmatrixbox{\processlowhighmathmatrix\raise}}
-% \installmathmatrixhandler\v!bottom{\def\mathmatrixbox{\processlowhighmathmatrix\lower}}
-% \installmathmatrixhandler\v!lohi {\let\mathmatrixbox \processlohimathmatrix}
-%
-% Final version
-
-\let\mathmatrixleft \empty % experimental hook
-\let\mathmatrixright\empty % experimental hook
-
-\def\processlowhighmathmatrix#1#2%
- {\dowithnextbox
- {\scratchdimen\dimexpr(\nextboxdp-\nextboxht)/2 \ifcase#2\or+\mathaxisheight\textfont2\fi\relax
- \ifcase#1\relax\or\lower\scratchdimen\or\or\raise\scratchdimen\fi
- \hbox{$\mathmatrixparameter\c!left
- \vcenter{\unvbox\nextbox}%
- \mathmatrixparameter\c!right$}}%
- \vbox}
-
-\installmathmatrixhandler\v!top {\def\mathmatrixbox{\processlowhighmathmatrix\plusthree\plusone }}
-\installmathmatrixhandler\v!high {\def\mathmatrixbox{\processlowhighmathmatrix\plusthree\zerocount}}
-\installmathmatrixhandler\v!lohi {\def\mathmatrixbox{\processlowhighmathmatrix\plustwo \zerocount}}
-\installmathmatrixhandler\v!low {\def\mathmatrixbox{\processlowhighmathmatrix\plusone \zerocount}}
-\installmathmatrixhandler\v!bottom{\def\mathmatrixbox{\processlowhighmathmatrix\plusone \plusone }}
-
-\def\dostartmathmatrix[#1][#2]%
- {\begingroup
- \edef\currentmathmatrix{#1}%
- \doifassignmentelse{#2}{\setupmathmatrix[#1][#2]}\donothing
- \null
- \executeifdefined{\??mx:\mathmatrixparameter\c!location}{\getvalue{\??mx:\v!lohi}}%
- \mathmatrixleft
- \mathmatrixbox\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>\zerocount \eqaligncolumn \else \plusone \fi
- \global\eqaligncolumn\plusone
- \preparemathmatrix } % uses scratchcounter
-
-\def\dostopmathmatrix
- {\crcr
- \mathstrut\crcr
- \noalign{\kern-\baselineskip}%
- \egroup
- \popmacro\domatrixNC
- \egroup
- \mathmatrixright
- \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 \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 {startmatrices}
-%D
-%D Just a handy keystroke safer:
-
-\def\startmatrices
- {\begingroup
- \setupmathmatrix}
-
-\def\stopmatrices
- {\endgroup}
-
-%D \startbuffer
-%D \startformula
-%D \startmatrix[left={\left(},right={\right)}]
-%D \NC A \NC B \NR \NC C \NC D \NR
-%D \stopmatrix
-%D =
-%D \startmatrix[left={\left(},right={\right)},location=low]
-%D \NC A \NC B \NR \NC C \NC D \NR
-%D \stopmatrix
-%D =
-%D \startmatrix[left={\left(},right={\right)},location=high]
-%D \NC A \NC B \NR \NC C \NC D \NR
-%D \stopmatrix
-%D \stopformula
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-%D
-%D \startbuffer
-%D \startformula
-%D \startmatrices[left={\left(},right={\right)}]
-%D \startmatrix
-%D \NC A \NC B \NR \NC C \NC D \NR
-%D \stopmatrix
-%D =
-%D \startmatrix[location=bottom]
-%D \NC A \NC B \NR \NC C \NC D \NR
-%D \stopmatrix
-%D =
-%D \startmatrix[location=top]
-%D \NC A \NC B \NR \NC C \NC D \NR
-%D \stopmatrix
-%D \stopmatrices
-%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}}}
-
-\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 {substack}
-%D
-%D Preliminary code:
-%D
-%D \startbuffer
-%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 \stopbuffer
-%D
-%D \getbuffer which was typed as \typebuffer
-%D
-%D Notice that these macros give the correct spacing for
-%D subscripts. Compare for example
-%D
-%D \startbuffer
-%D \startformula
-%D \sum_{\startsubstack a \NR b \NR \stopsubstack}
-%D \text{ and }
-%D \sum_{\scriptstyle a \atop \scriptstyle}
-%D \stopformula
-%D \typebuffer which gives \getbuffer
-
-\def\startsubstack
- {\begingroup
- \vcenter\bgroup
- \baselineskip\mathstacktotal
- \lineskip\mathstackvgap
- \lineskiplimit\lineskip
- \let\stopmathmode\relax
- \def\NC{\domatrixNC}%
- \def\MC{\domatrixNC\startmathmode}%
- \global\let\domatrixNC\dodomatrixNC
- \def\NR
- {\stopmathmode
- \global\let\domatrixNC\dodomatrixNC
- \crcr}%
- \mathsurround\zeropoint
- \everycr\emptytoks
- \halign\bgroup\hfil$\scriptstyle##$\hfil\crcr}
-
-\def\stopsubstack
- {\crcr
- \egroup
- \egroup
- \endgroup}
-
-%D \macros
-%D {frac, xfrac, xxfrac}
-%D
-%D This is another one Tobias asked for. It replaces the
-%D primitive \type {\over}. We also take the opportunity to
-%D handle math style restoring, which makes sure units and
-%D chemicals come out ok.
-%D
-%D \starttyping
-%D \def\frac#1#2%
-%D {\relax
-%D \ifmmode
-%D {{\mathstyle{#1}}\over{\mathstyle{#2}}}%
-%D \else
-%D $\frac{#1}{#2}$%
-%D \fi}
-%D \stoptyping
-%D
-%D Better is:
-%D
-%D \starttyping
-%D \def\frac#1#2%
-%D {\relax\mathematics{{{\mathstyle{#1}}\over{\mathstyle{#2}}}}}
-%D \stoptyping
-%D
-%D The \type {\frac} macro kind of replaces the awkward \type
-%D {\over} primitive. Say that we have the following formulas:
-%D
-%D \startbuffer[sample]
-%D test $\frac {1}{2}$ test $$1 + \frac {1}{2} = 1.5$$
-%D test $\xfrac {1}{2}$ test $$1 + \xfrac {1}{2} = 1.5$$
-%D test $\xxfrac{1}{2}$ test $$1 + \xxfrac{1}{2} = 1.5$$
-%D \stopbuffer
-%D
-%D \typebuffer[sample]
-%D
-%D With the most straightforward definitions, we get:
-%D
-%D \startbuffer[code]
-%D \def\dofrac#1#2#3{\relax\mathematics{{{#1{#2}}\over{#1{#3}}}}}
-%D
-%D \def\frac {\dofrac\mathstyle}
-%D \def\xfrac {\dofrac\scriptstyle}
-%D \def\xxfrac{\dofrac\scriptscriptstyle}
-%D \stopbuffer
-%D
-%D \typebuffer[code] \getbuffer[code,sample]
-%D
-%D Since this does not work well, we can try:
-%D
-%D \startbuffer[code]
-%D \def\xfrac #1#2{\hbox{$\dofrac\scriptstyle {#1}{#2}$}}
-%D \def\xxfrac#1#2{\hbox{$\dofrac\scriptscriptstyle{#1}{#2}$}}
-%D \stopbuffer
-%D
-%D \typebuffer[code] \getbuffer[code,sample]
-%D
-%D This for sure looks better than:
-%D
-%D \startbuffer[code]
-%D \def\xfrac #1#2{{\scriptstyle \dofrac\relax{#1}{#2}}}
-%D \def\xxfrac#1#2{{\scriptscriptstyle\dofrac\relax{#1}{#2}}}
-%D \stopbuffer
-%D
-%D \typebuffer[code] \getbuffer[code,sample]
-%D
-%D So we stick to the next definitions (watch the local
-%D overloading of \type {\xfrac}).
-
-\def\dofrac#1#2#3{\relax\mathematics{{{#1{#2}}\over{#1{#3}}}}}
-
-% \unexpanded\def\frac
-% {\dofrac\mathstyle}
-%
-% \chardef\mathfracmode=0 $\frac{1}{2}$
-% \chardef\mathfracmode=1 $\frac{1}{2}$
-% \chardef\mathfracmode=2 $\frac{1}{2}$
-% \chardef\mathfracmode=3 $\frac{1}{2}$
-% \chardef\mathfracmode=4 $\frac{1}{2}$
-% \chardef\mathfracmode=5 $\frac{1}{2}$
-
-\chardef\mathfracmode=0 % 0=mathstyle, 1=displaystyle, 2=textstyle, 3=scriptstyle, 4=scriptscriptstyle
-
-\unexpanded\def\frac
- {\ifcase\mathfracmode
- \expandafter\dofrac\expandafter\mathstyle
- \or
- \expandafter\dofrac\expandafter\displaystyle
- \or
- \expandafter\dofrac\expandafter\textstyle
- \or
- \expandafter\dofrac\expandafter\scriptstyle
- \or
- \expandafter\dofrac\expandafter\scriptscriptstyle
- \else
- \expandafter\dofrac\expandafter\mathstyle
- \fi}
-
-\unexpanded\def\xfrac#1#2%
- {\begingroup
- \let\xfrac\xxfrac
- \dofrac\scriptstyle{#1}{#2}%
- \endgroup}
-
-\unexpanded\def\xxfrac#1#2%
- {\begingroup
- \dofrac\scriptscriptstyle{#1}{#2}%
- \endgroup}
-
-%D The \type {xx} variant looks still ugly, so maybe it's
-%D best to say:
-
-\unexpanded\def\xxfrac#1#2%
- {\begingroup
- \dofrac\scriptscriptstyle{#1}{\raise.25ex\hbox{$\scriptscriptstyle#2$}}%
- \endgroup}
-
-%D Something low level for scientific calculator notation:
-
-\unexpanded\def\scinot#1#2%
- {#1\times10^{#2}}
-
-%D The next macro, \type {\ch}, is \PPCHTEX\ aware. In
-%D formulas one can therefore best use \type {\ch} instead of
-%D \type {\chemical}, especially in fractions.
-
-\ifx\mathstyle\undefined
- \let\mathstyle\relax
-\fi
-
-\unexpanded\def\ch#1%
- {\ifx\@@chemicalletter\undefined
- \mathstyle{\rm#1}%
- \else
- \dosetsubscripts
- \mathstyle{\@@chemicalletter{#1}}%
- \doresetsubscripts
- \fi}
-
-%D \macros
-%D {/}
-%D
-%D Just to be sure, we restore the behavior of some typical
-%D math characters.
-
-\bgroup
-
-\catcode`\/=\@@other \global \let\normalforwardslash/
-\catcode`\/=\@@active \doglobal\appendtoks\let/\normalforwardslash\to\everymathematics
-
-\egroup
-
-%D These macros were first needed by Frits Spijker (also
-%D known as Gajes) for typesetting the minus sign that is
-%D keyed into scientific calculators.
-
-% This is the first alternative, which works okay for the
-% minus, but less for the plus.
-%
-% \def\dodoraisedmathord#1#2#3%
-% {\mathord{{#2\raise.#1ex\hbox{#2#3}}}}
-%
-% \def\doraisedmathord#1%
-% {\mathchoice
-% {\dodoraisedmathord5\tf #1}%
-% {\dodoraisedmathord5\tf #1}%
-% {\dodoraisedmathord4\tfx #1}%
-% {\dodoraisedmathord3\tfxx#1}}
-%
-% \def\negative{\doraisedmathord-}
-% \def\positive{\doraisedmathord+}
-%
-% So, now we use the monospaced signs, that we also
-% define as symbol, so that they can be overloaded.
-
-\def\dodoraisedmathord#1#2#3%
- {\mathord{{#2\raise.#1ex\hbox{#2\symbol[#3]}}}}
-
-\def\doraisedmathord#1%
- {\mathchoice
- {\dodoraisedmathord5\tf {#1}}%
- {\dodoraisedmathord5\tf {#1}}%
- {\dodoraisedmathord4\tx {#1}}%
- {\dodoraisedmathord3\txx{#1}}}
-
-\def\dodonumbermathord#1#2%
- {\setbox\scratchbox\hbox{0}%
- \mathord{\hbox to \wd\scratchbox{\hss#1\symbol[#2]\hss}}}
-
-\def\donumbermathord#1%
- {\mathchoice
- {\dodonumbermathord\tf {#1}}%
- {\dodonumbermathord\tf {#1}}%
- {\dodonumbermathord\tx {#1}}%
- {\dodonumbermathord\txx{#1}}}
-
-\definesymbol[positive] [\getglyph{Mono}{+}]
-\definesymbol[negative] [\getglyph{Mono}{-}]
-\definesymbol[zeroamount][\getglyph{Mono}{-}]
-
-\def\negative {\doraisedmathord{negative}}
-\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{\mr#1}\nolimits} % was \rm, which follows text fonts (used in mml parser)
-\def\mathopdolimits#1{\mathop{\mr#1}} % was \rm, which follows text fonts (used in mml parser)
-
-%D \macros{overset, underset}
-%D
-%D The macros \type{\overset} and \type{\underset} are provided by
-%D \AMS\ packages in \LATEX. These macro allows you to place a symbol
-%D above or below another symbol, irrespective of whether the other
-%D symbol is a relation or something else, and without influencing the
-%D spacing. For most cases there is a better way to do such things
-%D (declaring a math command with limop option, or using accents), but
-%D occasionally these macros can be useful, for example:
-%D
-%D \startbuffer
-%D \startformula
-%D \overset{*}{X} \underset{*}{X}
-%D \stopformula
-%D \stopbuffer
-%D \typebuffer \getbuffer
-%D
-%D Use these macros sparingly. Remember, \TEX\ was designed for
-%D mathematics, so there is usually a proper method for typesetting
-%D common math notation.
-
-%D These macros are a clearer version of \type{\binrel@} and
-%D \type{\binrel@@} macros in \AMSTEX\ packages.
-
-\def\preparebinrel#1%
- {\begingroup
- \setbox\scratchbox\hbox
- {\thinmuskip 0mu
- \medmuskip -1mu
- \thickmuskip -1mu
- \setbox\scratchbox\hbox{$#1\mathsurround\zeropoint$}%
- \kern-\wd\scratchbox
- ${}#1{}\mathsurround\zeropoint$}%
- \expanded
- {\endgroup
- \let\noexpand\currentbinrel
- \ifdim\wd\scratchbox<\zeropoint
- \mathbin
- \else\ifdim\wd\scratchbox>\zeropoint
- \mathrel
- \else
- \relax
- \fi\fi}}
-
-\unexpanded\def\overset#1#2%
- {\preparebinrel{#2}%
- \currentbinrel{\mathop{\kern\zeropoint#2}\limits^{#1}}}
-
-\unexpanded\def\underset#1#2%
- {\preparebinrel{#2}%
- \currentbinrel{\mathop{\kern\zeropoint#2}\limits_{#1}}}
-
-%D \macros
-%D {boldsymbol}
-%D
-%D The math definition is inspired by amsmath.
-%D
-%D \startbuffer
-%D \definetypeface [boldmath] [mm] [boldmath] [latin-modern] [modern] [encoding=texnansi]
-%D
-%D $a \times b$ $a \boldsymbol{\times} b$
-%D \stopbuffer
-%D
-%D \typebuffer \start \getbuffer \stop
-
-\def\mathboldsymbol#1%
- {\preparebinrel{#1}%
- \currentbinrel{\mathchoice
- {\hbox{\switchtoformulabodyfont [boldmath]$\mathsurround\zeropoint#1$}}
- {\hbox{\switchtoformulabodyfont [boldmath]$\mathsurround\zeropoint#1$}}
- {\hbox{\switchtoformulabodyfont [boldmath,script]$\mathsurround\zeropoint#1$}}
- {\hbox{\switchtoformulabodyfont[boldmath,scriptscript]$\mathsurround\zeropoint#1$}}}}
-
-\def\boldsymbol
- {\mathortext\mathboldsymbol\bold}
-
-%D Some encoding hackery (for Mojca. who else):
-%D
-%D \starttyping
-%D \startmathcollection[eul:texnansi]
-%D \definemathsymbol [breve] [accent] [tf] ["15]
-%D \stopmathcollection
-%D \startmathcollection[eul:ec]
-%D \definemathsymbol [breve] [accent] [tf] ["08]
-%D \stopmathcollection
-%D
-%D $\breve e$
-%D \stoptyping
-
-\let\outerencoding\empty
-
-\def\checkoutermathencoding
- {\ifx\outerencoding\empty
- \ifx\outerencoding\s!default\else
- \edef\outerencoding{\currentencoding}%
- \fi
- \fi}
-
-\prependtoks
- \checkoutermathencoding
-\to \everymathematics
-
-%D More. (A temp hack, else no proper default fall back (like \type
-%D {\textmultiply}); todo: sync encoding.
-
-\def\dealwithmathtextencoding
- {\expanded{\everyhbox{\the\everyhbox\noexpand\fastenableencoding{\currentencoding}}}%
- \expanded{\everyvbox{\the\everyvbox\noexpand\fastenableencoding{\currentencoding}}}%
- \def\dealwithmathtextencoding{\let\characterencoding\nocharacterencoding}%
- \dealwithmathtextencoding}
-
-\appendtoks
- \dealwithmathtextencoding
-\to \everymathematics
-
-%D How negative such a symbol looks is demonstrated in:
-%D $\negative 10^{\negative 10^{\negative 10}}$.
-
-\setupformulas
- [\c!way=\@@nrway,
- \c!blockway=,
- \c!sectionnumber=\@@nrsectionnumber,
- \c!location=\v!right,
- \c!left=(,
- \c!right=),
- \c!numberstyle=,
- \c!numbercolor=,
- \c!numbercommand=,
- \c!spacebefore=\v!big,
- \c!spaceafter=\@@fmspacebefore,
- \c!grid=]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/strc-not.mkii b/Master/texmf-dist/tex/context/base/mkii/strc-not.mkii
deleted file mode 100644
index bee21342ea7..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/strc-not.mkii
+++ /dev/null
@@ -1,1470 +0,0 @@
-%D \module
-%D [ file=strc-not,
-%D version=2002.05.10, % 1997.09.15
-%D title=\CONTEXT\ Structure Macros,
-%D subtitle=Note Handling, % Footnote Handling
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Structure Macros / Note Handling}
-
-%D Unfortunately we cannot force an even number of lines in
-%D a two column footnote placement.
-
-%D There are some (still) dutch core commands used in this
-%D file.
-
-\unprotect
-
-% \dochecknote in processnotes
-
-% splitskips setten
-
-%D Footnotes are can be characterized by three components:
-%D
-%D \startitemize[packed]
-%D \item a small number \footnote {a footnote number} or
-%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
-%D \stopitemize
-%D
-%D Because footnotes are declared at the location of their
-%D reference they can be seen as a special kind of
-%D floating bodies. Their placement is postponed but has to be
-%D taken into account in the pagebreak calculations. This kind
-%D of calculations are forced by using \type{\insert}.
-
-%D \macros
-%D {setupnote,setupnotedefinition}
-%D
-%D We can influence footnote typesetting with the setup
-%D command:
-%D
-%D \showsetup{setupfootnotes} % ! !
-%D
-%D It's sort of a custom to precede footnotes by a horizontal
-%D rule and although fancy rules like
-%D
-%D \starttyping
-%D \hbox to 10em{\hskip-3em\dotfill}
-%D \stoptyping
-%D
-%D Are quite ligitimate, we default to a simple one 20\% of the
-%D text width.
-%D
-%D When \type{n} exceeds~1, footnotes are typeset in
-%D multi||columns, using the algoritm presented on page~397
-%D of \TEX book. Footnotes can be places on a per page basis
-%D or whereever suitable. When we set~\type{n} to~0, we get a
-%D rearanged paragraph, typeset by the algoritms on pages 398
-%D and~389. We definitely did not reinvent that wheel.
-
-\newif\ifendnotes \endnotesfalse
-\newif\ifbottomnotes \bottomnotestrue
-
-\chardef\clevernotes=\zerocount % 0=page 1=firstcolumn 2=lastcolumn
-
-%D The next definitions indicate that we can frame the footnote
-%D area. The footnotes themselves are treated as definitions.
-%D
-%D \showsetup{setupfootnotes}
-
-\let\currentnote\v!footnote
-
-\def\noteparameter #1{\csname\??vn \currentnote#1\endcsname}
-\def\notedefparameter #1{\csname\??vn\??vn\currentnote#1\endcsname}
-\def\footnoteparameter #1{\csname\??vn \v!footnote#1\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}
-\def\currentsaveins {\csname\??vn-\currentnote\endcsname}
-\def\localpostponednotes {\csname\??vn+\currentnote\endcsname}
-
-\def\backupnoteins #1{\@EA\backupinsertion\csname\??vn:#1\endcsname}
-\def\currentbackupnoteins{\@EA\backupinsertion\csname\??vn:\currentnote\endcsname}
-
-%D The numbers that accompany a footnote are generated using
-%D the standard \CONTEXT\ numbering mechanism, and thereby can
-%D be assigned on a per whatever sectioning basis.
-
-\ifx\noteinsertions\undefined \let\noteinsertions\empty \fi % permits reload
-
-\def\doprocessnotes#1#2% #1 may be { ... }
- {\def\currentnote{#2}#1}
-
-\def\doprocessnotescs#1#2% #1 == \cs that takes arg
- {\def\currentnote{#2}\@EA#1\csname\??vn:\currentnote\endcsname}
-
-\def\processnotes #1{\processcommacommand[\noteinsertions]{\doprocessnotes {#1}}}
-\def\processnotescs#1{\processcommacommand[\noteinsertions]{\doprocessnotescs#1}}
-
-\def\savenotecontent {\processnotescs\saveinsertionbox }
-\def\erasenotebackup {\processnotescs\eraseinsertionbackup}
-\def\savenotedata {\processnotescs\saveinsertiondata }
-\def\restorenotecontent{\processnotescs\restoreinsertionbox }
-\def\restorenotedata {\processnotescs\restoreinsertiondata}
-
-%D ... due to invisibility of inserts ... maybe save them twice
-%D and split new part ... todo ...
-
-\def\doenablenotes % brrr
- {\global\count\currentnoteins\plusthousand
- \global\skip \currentnoteins1\baselineskip\relax}
-
-\def\dodisablenotes
- {\global\count\currentnoteins\zerocount
- \global\skip \currentnoteins\zeropoint}
-
-\def\enablenotes {\processnotes\doenablenotes }
-\def\disablenotes{\processnotes\dodisablenotes}
-
-\def\dosavenotes
- {\global\setbox\currentsaveins\vbox
- {\ifvoid\currentsaveins\else\unvbox\currentsaveins\fi
- \box\currentnoteins}}
-
-\def\doflushsavednotes
- {\ifvoid\currentsaveins\else
- \insert\currentnoteins{\unvbox\currentsaveins}%
- \fi}
-
-\def\savenotes {\processnotes\dosavenotes }
-\def\flushsavednotes{\processnotes\doflushsavednotes}
-
-%D Both these parameters are coupled to the setup command we
-%D will implement in a moment. This means that, given a
-%D suitable symbol set, symbols can be used instead of numbers,
-%D by saying:
-%D
-%D \starttyping
-%D \setupfootnotes[conversion=set 2]
-%D \stoptyping
-
-% experiment: (compare scope=text and scope=page)
-%
-% \definenote[mynote][way=bytext,location=text,width=\leftmarginwidth,scope=page,rule=,before=,after=,factor=0]
-% \setuptexttexts[margin][\vbox to \textheight{\placenotes[mynote]\vfill}][]
-
-\def\definenote
- {\dodoubleempty\dodefinenote}
-
-% maybe we should inherit (todo)
-
-\def\@@defaultnotedefloc{\v!inleft}
-\def\@@defaultnotedefdis{\!!zeropoint}
-
-\def\dodefinenote[#1][#2]%
- {\def\currentnote{#1}%
- \ifundefined{\??vn:\currentnote}%
- \@EA\installinsertion \csname\??vn:\currentnote\endcsname\relax
- \@EA\installbackupinsertion\csname\??vn:\currentnote\endcsname\relax
-% \@EA\newbox\csname\??vn::\currentnote\endcsname % scratch box % needed ?
- \@EA\newbox\csname\??vn+\currentnote\endcsname % local box
- \@EA\newbox\csname\??vn-\currentnote\endcsname % local box
- \doglobal\addtocommalist{#1}\noteinsertions
- \fi
- \definedescription
- [\??vn\??vn\currentnote]
- [\c!location=\@@defaultnotedefloc,
- \c!distance=\@@defaultnotedefdis,
- \c!width=\v!fit,
- \c!headstyle=\noteparameter\c!style,
- \c!headcolor=\noteparameter\c!color,
- \c!before=,
- \c!after=]%
- \presetlocalframed
- [\??vn\currentnote]%
- \getparameters
- [\??vn\currentnote]
- [\c!location=\v!page,
- \c!way=\v!by\v!part,
- \c!sectionnumber=\v!no,
- \c!conversion=,
- \c!rule=\v!on,
- \c!before=\blank,
- \c!bodyfont=\v!small,
- \c!style=,
- \c!color=,
- \c!after=,
- \c!rulecolor=,
- \c!rulethickness=\linewidth,
- \c!frame=\v!off,
- \c!margindistance=.5em,
- \c!columndistance=1em,
- \c!distance=.125em,
- \c!align=\v!normal,
- \c!tolerance=\v!tolerant,
- \c!split=\v!tolerant,
- %\c!width=\makeupwidth,
- %\c!width=\ifdim\hsize<\makeupwidth\hsize\else\makeupwidth\fi,
- \c!width=\defaultnotewidth,
- \c!height=\textheight,
- \c!numbercommand=\high,
- \c!command=\noteparameter\c!numbercommand, % downward compatible
- \c!separator=\@@koseparator,
- \c!textcommand=\high,
- \c!textstyle=\tx,
- \c!textcolor=,
- \c!interaction=\v!yes,
- \c!factor=,
- \c!scope=, % \v!text \v!page
- \c!next=\autoinsertnextspace, % new, experimental with startnotes
- \c!n=1]%
- \definenumber
- [\currentnote]
- [\c!way=\noteparameter\c!way,
- \c!sectionnumber=\noteparameter\c!way,
- \c!conversion=\noteparameter\c!conversion]%
- \letvalue{\??vn\c!rule:\currentnote}\normalnoterule
- \unexpanded\setvalue{\currentnote }{\setnote[#1]}%
- \unexpanded\setvalue{\currentnote\v!text }{\setnotetext[#1]}%
- \unexpanded\setvalue{\e!start\currentnote}{\dodoubleempty\dostartcurrentnote[#1]}%
- \unexpanded\setvalue{\e!stop\currentnote }{\dostopcurrentnote}%
- \setupnote[\currentnote][#2]}
-
-\def\dostartcurrentnote[#1][#2]{\setnote[#1][#2]\bgroup\ignorespaces}
-\def\dostopcurrentnote {\removeunwantedspaces\egroup\noteparameter\c!next}
-
-\def\setupnotedefinition[#1]%
- {\setupdescriptions[\??vn\??vn#1]}
-
-\def\setupnote
- {\dodoubleempty\dosetupnote}
-
-\def\dosetupnote[#1][#2]%
- {\edef\currentnote{#1}%
- \ifsecondargument
- \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,
- \v!off=>\letvalue{\??vn\c!rule:\currentnote}\relax,
- \s!default=>\letvalue{\??vn\c!rule:\currentnote}\relax,
- \s!unknown=>\setvalue{\??vn\c!rule:\currentnote}{\noteparameter\c!rule}]%
- \processaction % todo
- [\noteparameter\c!split]
- [ \v!tolerant=>\notepenalty\zeropoint,
- \v!strict=>\notepenalty9999,
- \v!verystrict=>\notepenalty\maxdimen,
- \s!default=>\notepenalty\zeropoint,
- \s!unknown=>\notepenalty\commalistelement]%
- \fi
- \dochecknote}
-
-\def\dolocalsetupnotes#1#2%
- {\ifsecondargument
- \edef\noteinsertions{#1}%
- \processnotes{\setupnote[\currentnote][#2]}%
- \else\iffirstargument
- \doifassignmentelse{#1}
- {\processnotes{\setupnote[\currentnote][#1]}}
- {\edef\noteinsertions{#1}}%
- \fi\fi}
-
-% redefined:
-
-% so that it matches:
-
-% todo: make sure less calls, is quite some code
-
-\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 (**)
- \setnotedistance
- \count\currentnoteins\plusthousand
- \expanded{\doifcommonelse{\v!columns,\v!lastcolumn}{\noteparameter\c!location}}% **
- {\chardef\clevernotes\plustwo}
- {\expanded{\doifinsetelse{\v!firstcolumn}{\noteparameter\c!location}}% **
- {\chardef\clevernotes\plusone}%
- {\chardef\clevernotes\zerocount}}%
- \ifcase\clevernotes\relax
- % notes not in column areas
- \ifnum\noteparameter\c!n=\zerocount % no ifcase
- \settextnotes
- \scratchcounter\plusone
- \else
- \setcolumnnotes
- \scratchcounter\noteparameter\c!n\relax
- \divide\count\currentnoteins \scratchcounter
- \fi
- \global\endnotesfalse
- \expanded{\doifinsetelse{\v!page}{\noteparameter\c!location}}% **
- {\expanded{\doifinsetelse{\v!high}{\noteparameter\c!location}}% **
- {\global\bottomnotesfalse}
- {\global\bottomnotestrue}}
- {\global\endnotestrue
- \global\bottomnotestrue}% not: \postponenotes, else global
- \else
- % notes in column areas
- \ifnum\@@kln=\zerocount % no ifcase / brrr dependency on \??kl
- \scratchcounter\plusone
- \else
- \scratchcounter\footnoteparameter\c!n\relax % **
- \fi
- \global\endnotesfalse
- \global\bottomnotestrue
- \setclevernotes
- \fi
- \doifsomething{\noteparameter\c!factor}
- {\ifnum\noteparameter\c!factor<\zerocount\else
- \count\currentnoteins\noteparameter\c!factor
- \fi}%
- \ifnotelimit
- \dimen\currentnoteins\noteparameter\c!height
- \multiply\dimen\currentnoteins \scratchcounter
- \fi
- \ifendnotes
- \dimen\currentnoteins\maxdimen
- \count\currentnoteins\zerocount
- \skip \currentnoteins\zeropoint
- \fi}
-
-\def\checknotes
- {\processnotes\dochecknote}
-
-% Example of using factor:
-%
-% \definenote[mynote][way=bypage,location=text,width=\marginwidth,rule=,before=,factor=0]
-% \setuplayout[backspace=5cm,margin=3cm,margindistance=.5cm,width=middle]
-% \setuptexttexts[margin][\vbox to \textheight{\placenotes[mynote]\vfill}][]
-% \starttext
-% \dorecurse{10}{test \mynote{one one one one one one} \input zapf \mynote{one one one one one one} }
-% \stoptext
-
-%D The noterule can be a graphic and therefore calling this
-%D setup macro at every skipswitch is tricky (many many MP
-%D runs). Let's just reserve a few points, that probably match
-%D those of the stretch component.
-
-\def\placenoterule
- {\getvalue{\??vn\c!rule:\currentnote}}
-
-\def\normalnoterule
- {\ifvmode
- \color
- [\noteparameter\c!rulecolor]
- {\hrule
- \!!width .2\hsize
- \!!height\noteparameter\c!rulethickness
- \!!depth \zeropoint}%
- \kern\strutdepth
- \fi}
-
-%D The following switch can be used to disable limiting the
-%D height of the footnote area, something that is needed in
-%D multi column balancing. Use this switch with care.
-
-\newif\ifnotelimit \notelimittrue
-
-\def\setnotedistance
- {\setbox\scratchbox\vbox
- {\forgetall
- \noteparameter\c!before
- \placenoterule
- \noteparameter\c!after}%
- \global\skip\currentnoteins\ht\scratchbox
- \setbox\scratchbox\emptybox} % scratchbox can be in use
-
-\ifx\setnotehsize\undefined
-
- \def\setnotehsize{\hsize\noteparameter\c!width} % can be overloaded
-
-\fi
-
-\def\setclevernotes
- {\def\startpushnote {\bgroup % wellicht ooit kopuitlijnen
- \setupinmargin[\c!align=\v!left]%
- \startnotedef}%
- \def\stoppushnote {\stopnotedef
- \egroup}%
- \let\startpopnotes \donothing
- \let\stoppopnotes \donothing}
-
-\def\setcolumnnotes
- {\def\startpushnote {\setnotehsize % possibly overloaded
- \setrigidcolumnhsize\hsize{\noteparameter\c!columndistance}{\noteparameter\c!n}%
- \bgroup
- \setupinmargin[\c!align=\v!left]%
- \startnotedef}%
- \def\stoppushnote {\stopnotedef
- \egroup}%
- \def\startpopnotes {\bgroup
- \setnotehsize
- \setrigidcolumnhsize\hsize{\noteparameter\c!columndistance}{\noteparameter\c!n}%
- \setbox0\vbox\bgroup}%
- \def\stoppopnotes {\egroup
- \setbox0\vbox
- {\unvbox0\setbox0\lastbox
- \ifvbox0\unvbox\else\box\fi0}%
- \rigidcolumnbalance0\egroup}}
-
-% \def\settextnotes
-% {\def\startpushnote {\startvboxtohbox
-% \dostartattributes{\??vn\currentnote}\c!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
- \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
- \doreshapebox{\box\shapebox}{}{}{}% get rid of penalties etc
- \innerflushshapebox
- \convertvboxtohbox
- \egroup}}
-
-%D The formatting depends on the width of the table, so we
-%D have to set \type {n} to zero.
-%D
-%D \starttyping
-%D \startbuffer
-%D \bTABLE
-%D \bTR \bTD one \footnote{\dorecurse{10}{abcd }} \eTD \bTD two \eTD \eTR
-%D \bTR \bTD three fout five six seven eight nine \eTD \bTD ten \eTD \eTR
-%D \eTABLE
-%D \stopbuffer
-%D
-%D \startlocalfootnotes[n=0,location={text,none}]
-%D \placelegend[n=2]{\getbuffer}{\placelocalfootnotes}
-%D \stoplocalfootnotes
-%D \stoptyping
-
-%D \macros
-%D {footnote}
-%D
-%D A footnote can have a reference as optional argument and
-%D therefore its formal specification looks like:
-%D
-%D \showsetup{footnote}
-%D
-%D This command has one optional command: the reference. By
-%D saying \type{[-]} the number is omitted. The footnote
-%D command is not that sensitive to spacing, so it's quite
-%D legal to say:
-%D
-%D \startbuffer
-%D Users of \CONTEXT\ must keep both feet \footnote{Given they
-%D have two.} on the ground and not get confused \footnote{Or
-%D even crazy.} by all those obscure \footnote{But fortunately
-%D readable.} parameters.
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D When setting the \type{conversion} to \type{set 2} we get
-%D something like:
-%D
-%D \bgroup
-%D \startnarrower
-%D \setupfootnotes[conversion=set 1]
-%D \getbuffer
-%D \stopnarrower
-%D \egroup
-%D
-%D Typesetting footnotes is, at least for the moment, disabled
-%D when reshaping boxes.
-%D
-%D The additional macro \type {\footnotetext} and the
-%D associated \type {\note} macro were implemented at
-%D request of users on the mailing list and a suggestion by
-%D taco to split of the symbol placement. I decided to
-%D merge this functionality with the existing \type {\note}
-%D functionality.
-
-\newif\ifnotesymbol
-
-\unexpanded\def\setnote {\dotripleempty\dosetnote[1]}
-\unexpanded\def\setnotetext{\dotripleempty\dosetnote[0]}
-
-\def\dosetnote[#1][#2][#3]%
- {\removeunwantedspaces
- \def\currentnote{#2}%
- \dochecknote % sometimes needed for local notes
- \ifcase#1\relax
- \global\notesymbolfalse
- \else
- \global\notesymboltrue
- \fi
- \ifvisible % misty feature, make it obsolete
- \ifreshapingbox
- \@EAEAEA\gobbletwoarguments
- \else
- \@EAEAEA\dodonote
- \fi
- \else % todo: \iftrialtypesetting
- \@EA\gobbletwoarguments
- \fi{#3}}
-
-%D \macros
-%D {notesenabled}
-%D
-%D Before we come to typesetting a footnote, we first check
-%D if we have to typeset a number. When a \type{-} is passed
-%D instead of a reference, no number is typeset. We can
-%D temporary disable footnotes by saying
-%D
-%D \starttyping
-%D \notesenabledfalse
-%D \stoptyping
-%D
-%D which can be handy while for instance typesetting tables
-%D of contents. The pagewise footnote numbering is dedicated
-%D to Han The Thanh, who needed it first.
-
-\newif\ifnotesenabled \notesenabledtrue
-
-\appendtoks \notesenabledfalse \to \everymarking
-
-\newconditional\pagewisenotes % saves two hash entries
-
-\def\lastnotepage{1}
-
-\def\domovednote#1#2%
- {\ifconditional\pagewisenotes
- \doifreferencefoundelse{\s!fnt:t:\number\internalnotereference}
- {\let\savedrealreference\currentrealreference
- \doifreferencefoundelse{\s!fnt:f:\number\internalnotereference}
- {\ifnum\savedrealreference<\currentrealreference\relax\symbol[#1]\else
- \ifnum\savedrealreference>\currentrealreference\relax\symbol[#2]\fi\fi}
- \donothing}
- \donothing
- \fi}
-
-% maybe some day
-%
-% \newconditional\tracemovednotes
-% \def\domovednote#1#2%
-% {\iflocation
-% \doshowmovednote{#1}{#2}%
-% \else\ifconditional\tracemovednotes
-% \doshowtracednote{#1}{#2}%
-% \fi\fi}
-% \def\doshowmovednote#1#2%
-% {\doifreferencefoundelse{\s!fnt:t:\number\internalnotereference}
-% {\let\savedrealreference\currentrealreference
-% \doifreferencefoundelse{\s!fnt:f:\number\internalnotereference}
-% {\ifnum\savedrealreference<\currentrealreference\relax
-% \symbol[#1]%
-% \else\ifnum\savedrealreference>\currentrealreference\relax
-% \symbol[#2]%
-% \fi\fi}
-% \donothing}
-% \donothing}
-% \def\doshowtracednote#1#2%
-% {\doifreferencefoundelse{\s!fnt:t:\number\internalnotereference}
-% {\let\savedrealreference\currentrealreference
-% \doifreferencefoundelse{\s!fnt:f:\number\internalnotereference}
-% {\ifnum\savedrealreference<\currentrealreference\relax
-% \writestatus{NOTE}{forward note reference on real page \currentrealreference}%
-% \else\ifnum\savedrealreference>\currentrealreference\relax
-% \writestatus{NOTE}{backward note reference on real page \currentrealreference}%
-% \fi\fi}
-% \donothing}
-% \donothing}
-
-\def\dodonote
- {\ifnotesenabled
- \iftrialtypesetting
- \@EAEAEA\nododonote
- \else
- \@EAEAEA\dododonote
- \fi
- \else
- \@EA\gobbletwoarguments
- \fi}
-
-% \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:\number\internalnotereference}
- {\ifnum\currentrealreference>\lastnotepage\relax
- \globallet\lastnotepage\currentrealreference
- \resetnumber[\currentnote]%
- \fi}
- {}%
- \fi
- \incrementnumber[\currentnote]%
- \makesectionnumber[\currentnote]%
- \let\lastnotenumber\composedsectionnumber
- \dolastnotesymbol
- \decrementnumber[\currentnote]}}
-
-\def\dododonote#1%
- {\global\advance\internalnotereference\plusone
- \doifelse{\noteparameter\c!way}{\v!by\v!page}
- {\settrue\pagewisenotes}
- {\setfalse\pagewisenotes}%
- \doifelse{#1}{-}
- {\let\lastnotenumber\empty}
- {\ifconditional\pagewisenotes
- \doifreferencefoundelse{\s!fnt:t:\number\internalnotereference}
- {\ifnum\currentrealreference>\lastnotepage\relax
- \globallet\lastnotepage\currentrealreference
- \resetnumber[\currentnote]%
- \fi}
- {}%
- \fi
- \incrementnumber[\currentnote]%
- \makesectionnumber[\currentnote]%
- \rawreference\s!fnt{#1}\composedsectionnumber
- \let\lastnotenumber\composedsectionnumber}%
- \dostartnote}
-
-%D The main typesetting routine is more or less the same as the
-%D \PLAIN\ \TEX\ one, except that we only handle one type while
-%D \PLAIN\ also has something \type{\v...}. In most cases
-%D footnotes can be handled by a straight insert, but we do so
-%D by using an indirect call to the \type{\insert} primitive.
-
-\def\dostartlocalnoteinsert
- {\dochecknote
- \ifendnotes
- \global\setbox\localpostponednotes\vbox\bgroup
- \ifvoid\localpostponednotes\else\unvbox\localpostponednotes\fi
- \else
- \insert\currentnoteins\bgroup
- \fi}
-
-\let\startlocalnoteinsert\dostartlocalnoteinsert
-\let\stoplocalnoteinsert \egroup
-
-%D Making footnote numbers active is not always that logical,
-%D Making footnote numbers active is not always that logical,
-%D especially when we keep the reference and text at one page.
-%D On the other hand we need interactivity when we refer to
-%D previous notes or use end notes. Therefore we support
-%D interactive footnote numbers in two ways \footnote{This
-%D feature was implemented years after we were able to do so,
-%D mainly because endnotes had to be supported.} that is,
-%D automatically (vise versa) and by user supplied reference.
-
-\newcount\internalnotereference
-
-\let\startpushnote=\relax
-\let\stoppushnote =\relax
-
-\newsignal\notesignal
-\newcount \notepenalty
-
-\notepenalty=0 % needed in order to split in otrset
-
-\newconditional\processingnote
-
-\def\footnotereferencefrom
- {\rawreference\s!fnt{\s!fnt:f:\number\internalnotereference}{}}
-
-\def\footnotereferenceto
- {\global\advance\crossreferencenumber\minusone\relax % else problem, needs further testing
- \rawreference\s!fnt{\s!fnt:t:\number\internalnotereference}{}}
-
-\def\dostartnote% nog gobble als in pagebody
- {\pushsomestates
- \bgroup
- \settrue\processingnote
- %\restorecatcodes % to be tested first
- \iftypesettinglines % otherwise problems with \type <crlf> {xxx}
- \ignorelines % makes footnotes work in \startlines ... \stoplines
- \fi
- \ifnotesymbol
- \dolastnotesymbol
- \else
- \unskip\unskip
- \globallet\lastnotesymbol\dolastnotesymbol
- \fi
- \startlocalnoteinsert
- \doif{\noteparameter\c!scope}\v!page{\floatingpenalty\maxdimen}% experiment
- \penalty\notepenalty
- \forgetall
- \setnotebodyfont
- \redoconvertfont % to undo \undo calls in in headings etc
- \splittopskip\strutht % not actually needed here
- \splitmaxdepth\strutdp % not actually needed here
- \leftmargindistance\noteparameter\c!margindistance
- \rightmargindistance\leftmargindistance
- \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
- \preparefullnumber{\??vn\currentnote}\lastnotenumber\preparednumber
- \doifelse{\noteparameter\c!interaction}\v!no
- {\noteparameter\c!numbercommand
- {\preparednumber\domovednote\v!nextpage\v!previouspage}}%
- {\gotobox{\noteparameter\c!command % was \c!numbercommand, but compatible
- {\preparednumber\domovednote\v!nextpage\v!previouspage}}%
- [\s!fnt:f:\number\internalnotereference]}%
- \fi
- \doifelse{\noteparameter\c!interaction}\v!no
- {\ifconditional\pagewisenotes
- \footnotereferenceto
- \fi}%
- {\footnotereferenceto}}%
- \bgroup
- \postponenotes
- \aftergroup\dostopnote
- \begstrut
- \let\next}
-
-\def\dostopnote
- {\endstrut
- \stoppushnote
- \egroup
- \stoplocalnoteinsert
- \kern\notesignal\relax % \relax is needed to honor spaces
- \popsomestates}
-
-\def\dolastnotesymbol
- {\removeunwantedspaces
- \doifitalicelse\/\donothing % Charles IV \footnote{the fourth}
- \ifdim\lastkern=\notesignal
- \dodonotesymbol{\kern\noteparameter\c!distance}% gets the font right, hack !
- \fi
- \nobreak
- \doifelse{\noteparameter\c!interaction}\v!no
- {\dodonotesymbol{\lastnotenumber\domovednote\v!previouspage\v!nextpage}%
- \ifconditional\pagewisenotes
- \footnotereferencefrom
- \fi}
- {\gotobox
- {\dodonotesymbol{\lastnotenumber\domovednote\v!previouspage\v!nextpage}}%
- [\s!fnt:t:\number\internalnotereference]%
- \footnotereferencefrom}%
- \globallet\lastnotesymbol\relax}
-
-\let\lastnotesymbol\relax
-
-%D \macros
-%D {note}
-%D
-%D Refering to a note is accomplished by the rather short
-%D command:
-%D
-%D \showsetup{note}
-%D
-%D This command is implemented rather straightforward as:
-
-\def\notesymbol
- {\dodoubleempty\donotesymbol}
-
-% \def\donotesymbol[#1][#2]%
-% {\bgroup
-% \ifnotesenabled
-% \def\currentnote{#1}%
-% \ifsecondargument
-% \ifx\lastnotesymbol\relax
-% \unskip
-% \naarbox{\high{\tx\currenttextreference}}[#2]%
-% \else
-% \lastnotesymbol
-% \fi
-% \else
-% \lastnotesymbol
-% \fi
-% \fi
-% \egroup}
-
-\def\dodonotesymbol#1%
- {\noteparameter\c!textcommand{\doattributes{\??vn\currentnote}\c!textstyle\c!textcolor{#1}}}
-
-% \def\donotesymbol[#1][#2]%
-% {\bgroup
-% \ifnotesenabled
-% \def\currentnote{#1}%
-% \ifsecondargument
-% \ifx\lastnotesymbol\relax % bugged
-% \unskip
-% \gotobox{\dodonotesymbol\currenttextreference}[#2]%
-% \else
-% \lastnotesymbol
-% \fi
-% \else
-% \lastnotesymbol
-% \fi
-% \fi
-% \egroup}
-
-\def\donotesymbol[#1][#2]%
- {\bgroup
- \ifnotesenabled
- \def\currentnote{#1}%
- \ifsecondargument
- \unskip
- \gotobox{\dodonotesymbol\currenttextreference}[#2]%
- \else
- \lastnotesymbol
- \fi
- \fi
- \egroup}
-
-%D Normally footnotes are saved as inserts that are called upon
-%D as soon as the pagebody is constructed. The footnote
-%D insertion routine looks just like the \PLAIN\ \TEX\ one,
-%D except that we check for the end note state.
-
-\let\startpopnotes = \relax
-\let\stoppopnotes = \relax
-
-\def\placenoteinserts
- {\processnotes\doplacenoteinserts}
-
-% testcase for split bottom alignment see (a) below
-%
-% \dorecurse{6}{\input tufte\footnote{\input ward \input tufte \relax}}
-
-\def\doplacenoteinserts
- {%\ifvoid\currentnoteins \else % unsafe, strange
- \relax\ifdim\ht\currentnoteins>\zeropoint\relax
- \dochecknote
- \ifendnotes \else
- \noteparameter\c!before
- \placenoterule % alleen in ..mode
- \bgroup
- \setnotebodyfont
- \setbox0\hbox
- {\startpopnotes
- \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\relax
-\iftrialtypesetting\unvcopy\else\unvbox\fi\currentnoteins
-% \unvbox\currentnoteins
- \or
-\iftrialtypesetting\copy\else\box\fi\currentnoteins
-% \box\currentnoteins
- \obeydepth % (a) added , since split footnotes will not align properly
- \else
-\iftrialtypesetting\unvcopy\else\unvbox\fi\currentnoteins
-% \unvbox\currentnoteins
- \fi
- % this is too ugly actually
- \stoppopnotes}%
- \setbox2\hbox
- {\localframed
- [\??vn\currentnote]
- [\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
- \box0
- \fi}}%
- \setbox2\hbox{\lower\strutdepth\box2}%
- \dp2=\strutdepth % so we know that it has the note bodyfont depth
- \box2
- \egroup
- \noteparameter\c!after
- \fi
- \fi}
-
-%D Supporting end notes is surprisingly easy. Even better, we
-%D can combine this feature with solving the common \TEX\
-%D problem of disappearing inserts when they're called for in
-%D deeply nested boxes. The general case looks like:
-%D
-%D \starttyping
-%D \postponenotes
-%D \.box{whatever we want with footnotes}
-%D \flushnotes
-%D \stoptyping
-%D
-%D This alternative can be used in headings, captions, tables
-%D etc. The latter one sometimes calls for notes local to
-%D the table, which can be realized by saying
-%D
-%D \starttyping
-%D \setlocalfootnotes
-%D some kind of table with local footnotes
-%D \placelocalfootnotes
-%D \stoptyping
-%D
-%D Postponing is accomplished by simply redefining the (local)
-%D insert operation. A not too robust method uses the
-%D \type{\insert} primitive when possible. This method fails in
-%D situations where it's not entirely clear in what mode \TEX\
-%D is. Therefore the auto method can is to be overruled when
-%D needed.
-
-\newconditional\postponednote
-
-\def\autopostponenotes
- {\def\startlocalnoteinsert % not global
- {\ifinner
- %\message{[postponed note]}%
- \global\setbox\localpostponednotes\vbox\bgroup
- \global\settrue\postponednote
- \ifvoid\localpostponednotes\else\unvbox\localpostponednotes\fi
- \else
- %\message{[inserted note]}%
- \expandafter\dostartlocalnoteinsert
- \fi}}
-
-\def\postponenotes
- {\let\autopostponenotes\postponenotes
- \let\postponenotes\relax % prevent loops
- \def\startlocalnoteinsert % not global
- {%\message{[postponed note]}%
- \global\setbox\localpostponednotes\vbox\bgroup
- \global\settrue\postponednote
-% \unvbox\localpostponednotes}}
- \ifvoid\localpostponednotes\else\unvbox\localpostponednotes\fi}}
-
-\def\dodoflushnotes % per class, todo: handle endnotes here
- {\ifdim\ht\localpostponednotes>\zeropoint
- \bgroup
- \dochecknote
- \ifendnotes \else
- % not that accurate when multiple notes
- \ifdim\dimexpr\pagegoal-\pagetotal\relax<\ht\localpostponednotes
- \message{[moved note \currentnote]}%
- \fi
- \insert\currentnoteins\bgroup\unvbox\localpostponednotes\egroup
- \fi
- \egroup
- \fi}
-
-\def\doflushnotes % also called directly, \ifvoid is needed !
- {\ifconditional\processingnote \else \ifconditional\postponednote
- \let\localnoteinsert\normalnoteinsert % not global
- \processnotes\dodoflushnotes
- \global\setfalse\postponednote
- \fi \fi}
-
-\def\flushnotes
- {\ifconditional\processingnote \else \ifconditional\postponednote
- \ifinner \else \ifinpagebody \else
- %\ifvmode % less interference, but also less secure
- \doflushnotes
- %\fi
- \fi \fi
- \fi \fi}
-
-%D For old times sake:
-
-\def\flushfootnotes {\flushnotes}
-\def\doflushfootnotes{\doflushnotes}
-
-%D This is a nasty and new secondary footnote flusher. It
-%D can be hooked into \type {\everypar} like:
-%D
-%D \starttyping
-%D \appendtoks \synchronizenotes \to \everypar
-%D \stoptyping
-
-\def\dosynchronizenotes
- {\ifvoid\currentnoteins\else\insert\currentnoteins{\unvbox\currentnoteins}\fi}
-
-\def\synchronizenotes
- {\processnotes\dosynchronizenotes}
-
-%D There are several placement alternatives.
-
-\def\placenotesintext#1%
- {\ifdim\ht#1>\zeropoint
- \endgraf
- \ifvmode
- \whitespace
- \noteparameter\c!before
- \fi
- \snaptogrid\hbox
- {\setnotebodyfont
- \setbox0\hbox
- {\startpopnotes
- \unvbox#1\endgraf\relax
- \stoppopnotes}%
- \doif{\noteparameter\c!width}\v!fit % new, auto width
- {\setbox0\hbox % uggly but ok.
- {\beginofshapebox
- \unhbox0\setbox0=\lastbox\unvbox0
- \endofshapebox
- \reshapebox{\hbox{\unhbox\shapebox}}%
- \vbox{\flushshapebox}}}%
- \localframed
- [\??vn\currentnote]
- [ \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
- \box0
- \fi}}%
- \ifvmode
- \noteparameter\c!after
- \fi
- \fi}
-
-%D A stupid alternative is also provided:
-%D
-%D \starttyping
-%D \setupfootnotes[location={text,none}]
-%D \stoptyping
-
-\def\placenotesasnone#1% is grouped already
- {\ifdim\ht#1>\zeropoint
- \noteparameter\c!before
- \setnotebodyfont
- \startpopnotes % make sure that fake height is killed
- \unvbox#1\endgraf
- \stoppopnotes
- % weird
- \ifhmode
- \setbox0=\lastbox \ifvbox0 \unvbox0\else\box0\fi % enable columns
- \fi
- \noteparameter\c!after
- \fi}
-
-%D \macros
-%D {startlocalfootnotes,placelocalfootnotes}
-%D
-%D The next two macros can be used in for instance tables, as
-%D we'll demonstrate later on.
-%D
-%D \showsetup{startlocalfootnotes}
-%D \showsetup{placelocalfootnotes}
-
-\def\defaultnotewidth{\makeupwidth}
-
-% \def\collectlocalnotes
-% {\def\localnoteinsert##1% was \gdef, but never reset!
-% {%\message{[local note]}%
-% \global\setbox\localpostponednotes\vbox\bgroup
-% \ifvoid\localpostponednotes \else
-% \unvbox\localpostponednotes
-% \fi
-% \let\next}}
-
-\def\collectlocalnotes
- {\def\startlocalnoteinsert% was \gdef, but never reset!
- {%\message{[local note]}%
- \global\setbox\localpostponednotes\vbox\bgroup
- \ifvoid\localpostponednotes\else\unvbox\localpostponednotes\fi}}
-
-\def\startlocalnotes
- {\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]}%
- \savenumber[\currentnote]%
- \resetnumber[\currentnote]}%
- \collectlocalnotes}
-
-\def\stoplocalnotes
- {\processnotes{\restorenumber[\currentnote]}%
- \egroup
- \checknotes} % really needed, else wrong main settings
-
-\def\placelocalnotes
- {\dodoubleempty\doplacelocalnotes}
-
-\def\doplacelocalnotes[#1][#2]%
- {\bgroup
- \chardef\localnodemode\plusone % new
- \dolocalsetupnotes{#1}{#2}%
- \processnotes\dodoplacelocalnotes
- \egroup
- \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
-%D \startbuffer
-%D \startlocalnotes[width=.3\hsize,n=0]
-%D \placetable
-%D {Some Table}
-%D \placeontopofeachother
-%D {\starttable[|l|r|]
-%D \HL
-%D \VL Nota\footnote{Bene} \VL Bene\footnote{Nota} \VL\SR
-%D \VL Bene\footnote{Nota} \VL Nota\footnote{Bene} \VL\SR
-%D \HL
-%D \stoptable}
-%D {\placelocalnotes}
-%D \stoplocalnotes
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D Because this table placement macro expect box content, and
-%D thanks to the grouping of the local footnotes, we don't need
-%D additional braces.
-%D
-%D \getbuffer
-
-%D \macros
-%D {placefootnotes}
-%D
-%D We still have no decent command for placing footnotes
-%D somewhere else than at the bottom of the page (for which no
-%D user action is needed). Footnotes (endnotes) can be
-%D placed by using
-%D
-%D \showsetup{placefootnotes}
-
-\def\placebottomnotes
- {\processnotes\dodoplacenotes}
-
-% \definecomplexorsimple\placenotes
-
-% \def\simpleplacenotes
-% {\processnotes\dodoplacenotes}
-
-% \def\complexplacenotes[#1]%
-% {\bgroup
-% \edef\noteinsertions{#1}%
-% \simpleplacenotes
-% \egroup}
-
-\def\placenotes
- {\dodoubleempty\doplacenotes}
-
-\def\doplacenotes[#1][#2]%
- {\bgroup
- \dolocalsetupnotes{#1}{#2}%
- \processnotes\dodoplacenotes
- \egroup}
-
-\def\dodoplacenotes
- {\dochecknote
- \ifendnotes
- \ifinpagebody \else \ifdim\ht\localpostponednotes>\zeropoint
- \expanded{\doifinsetelse{\v!none}{\noteparameter\c!location}}
- \placenotesasnone\placenotesintext\localpostponednotes
- \fi \fi
- \else \ifdim\ht\currentnoteins>\zeropoint
- \placenoteinserts
- \fi \fi}
-
-%D \macros
-%D {fakenotes}
-
-\def\fakenotes
- {\ifhmode\endgraf\fi\ifvmode
- \calculatetotalclevernoteheight
- \ifdim\totalnoteheight>\zeropoint \kern\totalnoteheight \fi
- \fi}
-
-\def\fakepagenotes
- {\ifhmode\endgraf\fi\ifvmode
- \calculatetotalpagenoteheight
- \ifdim\totalnoteheight>\zeropoint \kern\totalnoteheight \fi
- \fi}
-
-\newdimen\totalnoteheight
-
-\def\doaddtototalnoteheight#1%
- {\ifdim\ht#1>\zeropoint
- \advance\totalnoteheight\ht #1%
- \advance\totalnoteheight\skip#1%
- \fi}
-
-\def\docalculatetotalnoteheight
- {\ifcase\clevernotes % tricky here ! ! ! to be sorted out ! ! !
- \doaddtototalnoteheight\currentnoteins
- \else
- \doaddtototalnoteheight\currentbackupnoteins
- \fi}
-
-\def\docalculatetotalclevernoteheight
- {\ifcase\clevernotes \else % tricky here ! ! ! to be sorted out ! ! !
- \doaddtototalnoteheight\currentnoteins
- \fi}
-
-\def\docalculatetotalpagenoteheight
- {\doaddtototalnoteheight\currentnoteins}
-
-\def\calculatetotalnoteheight {\totalnoteheight\zeropoint\processnotes\docalculatetotalnoteheight}
-\def\calculatetotalclevernoteheight{\totalnoteheight\zeropoint\processnotes\docalculatetotalclevernoteheight}
-\def\calculatetotalpagenoteheight {\totalnoteheight\zeropoint\processnotes\docalculatetotalpagenoteheight}
-
-\newif\ifnotespresent
-
-\def\dochecknotepresence
- {\ifdim\ht\currentnoteins>\zeropoint
- \notespresenttrue
- \fi}
-
-\def\checknotepresence
- {\notespresentfalse
- \processnotes\dochecknotepresence}
-
-%D Now how can this mechanism be hooked into \CONTEXT\ without
-%D explictly postponing footnotes? The solution turned out to
-%D be rather simple:
-%D
-%D \starttyping
-%D \everypar {...\flushnotes...}
-%D \neverypar {...\postponenotes}
-%D \stoptyping
-%D
-%D and
-%D
-%D \starttyping
-%D \def\ejectinsert%
-%D {...
-%D \flushnotes
-%D ...}
-%D \stoptyping
-%D
-%D We can use \type{\neverypar} because in most commands
-%D sensitive to footnote gobbling we disable \type{\everypar}
-%D in favor for \type{\neverypar}. In fact, this footnote
-%D implementation is the first to use this scheme.
-
-%D When typesetting footnotes, we have to return to the
-%D footnote specific bodyfont size, which is in most cases derived
-%D from the global document bodyfont size. In the previous macros
-%D we already used a footnote specific font setting macro.
-
-\def\setnotebodyfont
- {\let\setnotebodyfont\relax
- \restoreglobalbodyfont
- \switchtobodyfont[\noteparameter\c!bodyfont]%
- \setuptolerance[\noteparameter\c!tolerance]%
- \setupalign[\noteparameter\c!align]}
-
-%D The footnote mechanism defaults to a traditional one
-%D column way of showing them. By default we precede them by
-%D a small line.
-
-\ifx\v!endnote\undefined \def\v!endnote{endnote} \fi
-
-\definenote [\v!footnote ]
-\definenote [\v!endnote ] [\c!location=\v!none] % else no break
-
-% \definenote
-% [mynote]
-% [way=bypage,
-% location={page,high},
-% factor=0,
-% width=\leftmarginwidth,
-% scope=page,
-% rule=,
-% before=,
-% after=]
-%
-% \setuptexttexts
-% [margin]
-% [\vbox to \textheight{\placenotes[mynote]\vfill}]
-% []
-
-%D Compatibility macros:
-
- \def\setupfootnotedefinition{\setupnotedefinition [\v!footnote]}
- \def\setupfootnotes {\setupnote [\v!footnote]}
-\unexpanded \def\footnote {\setnote [\v!footnote]}
-\unexpanded \def\footnotetext {\setnotetext [\v!footnote]}
- \def\note {\dodoubleempty\notesymbol [\v!footnote]} % alleen footnote
- \def\placefootnotes {\dodoubleempty\doplacefootnotes [\v!footnote]}
- \def\placelocalfootnotes {\dodoubleempty\doplacelocalfootnotes[\v!footnote]}
- \def\startlocalfootnotes {\startlocalnotes}
- \def\stoplocalfootnotes {\stoplocalnotes }
-
-\def\doplacefootnotes [#1][#2]%
- {\ifsecondargument\placenotes [#1][#2,\c!height=\textheight]\else\placenotes [#1]\fi}
-
-\def\doplacelocalfootnotes[#1][#2]%
- {\ifsecondargument\placelocalnotes[#1][#2,\c!height=\textheight]\else\placelocalnotes[#1]\fi}
-
-%D Backward compatibility command:
-
-\def\footins {\noteinsertion\currentnote}
-\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
-% {\setgvalue{note:t:#1}%
-% {\setxvalue{note:l:#1}{\getvalue{note:n:#1}}%
-% \footnote[note:a:#1:\getvalue{note:l:#1}]{#2}}%
-% \setgvalue{note:n:#1}%
-% {1}%
-% \getvalue{note:t:#1}}%
-
-% \def\mynote[#1]%
-% {\removeunwantedspaces
-% \scratchcounter\getvalue{note:n:#1}\relax
-% \edef\NoteNumber{\the\scratchcounter}%
-% \doglobal\incrementvalue{note:n:#1}\relax
-% \doifreferencefoundelse{note:a:#1:1}
-% {\edef\NotePageA{\number\currentrealreference}%
-% \doifreferencefoundelse{note:a:#1:\getvalue{note:n:#1}}
-% {\edef\NotePageB{\number\currentrealreference}%
-% \doifreferencefoundelse{note:a:#1:\NoteNumber}
-% {\ifnum\currentrealreference=\NotePageB\relax
-% \pagereference[note:a:#1:\getvalue{note:n:#1}]%
-% \note[note:a:#1:\getvalue{note:l:#1}]%
-% \else\ifnum\NotePageA=\NotePageB\relax
-% \pagereference[note:a:#1:\getvalue{note:n:#1}]%
-% \note[note:a:#1:\getvalue{note:l:#1}]%
-% \else
-% \getvalue{note:t:#1}%
-% \fi\fi}
-% {\ifnum\NotePageA=\NotePageB\relax
-% \pagereference[note:a:#1:\getvalue{note:n:#1}]%
-% \note[note:a:#1:\getvalue{note:l:#1}]%
-% \else
-% \getvalue{note:t:#1}%
-% \fi}}
-% {\pagereference[note:a:#1:\getvalue{note:n:#1}]%
-% \note[note:a:#1:\getvalue{note:l:#1}]}}
-% {\pagereference[note:a:#1:\getvalue{note:n:#1}]%
-% \note[note:a:#1:\getvalue{note:l:#1}]}}
-
-% \starttext
-
-% funny \myfootnote[funny]{funny} funny \mynote[funny] \page
-
-% funny \mynote[funny] funny \mynote[funny] funny \mynote[funny] \page
-% funny \mynote[funny] funny \mynote[funny] \page
-% funny \mynote[funny] funny \mynote[funny] funny \mynote[funny] \page
-
-% \stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkii/strc-num.mkii b/Master/texmf-dist/tex/context/base/mkii/strc-num.mkii
deleted file mode 100644
index 99fb687c865..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/strc-num.mkii
+++ /dev/null
@@ -1,151 +0,0 @@
-%D \module
-%D [ file=strc-num,
-%D version=1997.03.31,
-%D title=\CONTEXT\ Structure Macros,
-%D subtitle=Numbering,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Structure Macros / Numbering}
-
-\unprotect
-
-% Commando's ten behoeve van nummeren:
-%
-% \definenumber[name]
-% \setupnumber[name][wijze=,blok=,tekst=,plaats=,conversie=,start=]
-% \setnumber[name]{value}
-% \resetnumber[name]
-% \incrementnumber[name]
-% \decrementnumber[name]
-% \convertednumber[name] % getnumber
-% \savenumber[name]
-% \restorenumber[name]
-% \convertednumber[name]
-% \rawnumber[name]
-
-% private (defined in core-des.tex)
-%
-% \nextnumber[name][tag][reference]
-% \currentnumber[name]
-
-\def\@@thenumber#1{\s!number\csname\s!number#1\c!number\endcsname}
-
-% this will be the new (public) one: \let\numberparameterprefix\@@thenumber
-
-\def\numberparameter#1#2{\csname\@@thenumber{#1}#2\endcsname} % sort of public
-
-\def\dosetupnumber[#1][#2]%
- {\@EA\let\@EA\savedstartnumber\csname\@@thenumber{#1}\c!start\endcsname
- \getparameters[\@@thenumber{#1}][\c!start=,#2]%
- \doifelsenothing{\numberparameter{#1}\c!start}
- {\letvalue{\@@thenumber{#1}\c!start}\savedstartnumber}
- {\setcounter{\@@thenumber{#1}}{\numberparameter{#1}\c!start}}}
-
-\def\setupnumber
- {\dodoubleargument\dosetupnumber}
-
-\def\definenumber
- {\dodoubleempty\dodefinenumber}
-
-\def\dodefinenumber[#1][#2]% ook overal class als localframed
- {\doifassignmentelse{#2}
- {\dododefinenumber[#1][#2]}
- {\doifelsenothing{#2} % can break on not yet defined macros in #2
- {\dododefinenumber[#1][#2]}
- {\setvalue{\s!number#1\c!number}{#2}}}}
-
-\def\dododefinenumber[#1][#2]%
- {\getparameters
- [\s!number#1]
- [\c!number=#1,
- \s!check=,
- \c!way=\@@nrway,
- \c!way\c!local=\numberparameter{#1}\c!way,
- \c!sectionnumber=\v!yes,
- \c!text=, % no longer used here, will go away
- \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%
- {\setcounter{\@@thenumber{#1}}{#2}}
-
-\def\resetnumber[#1]%
- {\setcounter{\@@thenumber{#1}}{0\numberparameter{#1}\c!start}}
-
-\def\savenumber[#1]%
- {\savecounter{\@@thenumber{#1}}}
-
-\def\restorenumber[#1]%
- {\restorecounter{\@@thenumber{#1}}}
-
-%D Bonus macro (we need to keep this one for downward
-%D compatibility reasons).
-
-\def\doreset[#1]%
- {\processcommalist[#1]\dodoreset}
-
-\def\dodoreset#1%
- {\getvalue{\s!reset#1}}%
-
-\def\reset
- {\dosingleargument\doreset}
-
-\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
- {\doif{\numberparameter{#1}\c!state}\v!start{\pluscounter{\@@thenumber{#1}}}}
- {\setcounter{\@@thenumber{#1}}{0\numberparameter{#1}\c!start}}}
-
-% \defineenumeration [test] [way=bypage,text=\lastchangedpage]
-%
-% \starttext \dorecurse{10}{\test \input tufte \par} \stoptext
-
-\def\decrementnumber[#1]%
- {\minuscounter{\@@thenumber{#1}}}
-
-\def\convertednumber[#1]%
- {\convertnumber
- {\numberparameter{#1}\c!conversion}
- {\countervalue{\@@thenumber{#1}}}}
-
-\def\rawnumber[#1]%
- {\countervalue{\@@thenumber{#1}}}
-
-\def\accumulatednumber[#1]%
- {\getvalue{\@@thenumber{#1}\c!n}}
-
-\let\getnumber\convertednumber
-
-\def\doifdefinednumber #1{\doifdefined {\csname\s!number#1\c!number\endcsname}}
-\def\doifundefinednumber #1{\doifundefined {\csname\s!number#1\c!number\endcsname}}
-\def\doifdefinednumberelse#1{\doifdefinedelse{\csname\s!number#1\c!number\endcsname}}
-
-\ifx\checknumber\undefined \def\checknumber[#1]{} \fi
-
-% ook de pag nummers hierheen halen ivm \@@nrwijze
-
-\def\setupnumbering
- {\dodoubleempty\getparameters[\??nr]}
-
-\setupnumbering
- [\c!way=\v!by\v!chapter,
- \c!blockway=,
- \c!sectionnumber=\v!yes,
- \c!state=\v!start]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/strc-pag.mkii b/Master/texmf-dist/tex/context/base/mkii/strc-pag.mkii
deleted file mode 100644
index 40e69b849b3..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/strc-pag.mkii
+++ /dev/null
@@ -1,534 +0,0 @@
-%D \module
-%D [ file=strc-num, % moved here from main-001
-%D version=1997.03.31,
-%D title=\CONTEXT\ Structure Macros,
-%D subtitle=Numbering,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Structure Macros / Numbering}
-
-% todo: {}{}{} ipv ...--...-...-...--... in pag ref
-
-\unprotect
-
-% \gotonextsubpage : voor de pagebody
-% \subpaginanummer : alleen in de voet/kopregels
-% \aantalsubpaginas : alleen in de voet/kopregels
-
-% \firstsubpage : eerste \realpageno, voor interne doeleinden
-% \prevsubpage : vorige \realpageno, voor interne doeleinden
-% \nextsubpage : volgende \realpageno, voor interne doeleinden
-% \lastsubpage : laatste \realpageno, voor interne doeleinden
-% \nofsubpages : laatste subpage (in berekeningen)
-% \subpageno : huidige subpage (in berekeningen)
-
-\newif\ifsubpaging
-\newif\ifshowingsubpage
-
-\definenumber
- [\s!subpage]
-
-\setupnumber
- [\s!subpage]
- [\c!way=\@@snway]
-
-% hard to sync
-%
-% \def\resetsubpagenumber
-% {\resetnumber[\s!subpage]%
-% \global\subpageno=\rawnumber[\s!subpage]}
-%
-% better sync
-
-\newif\ifresettingsubpagenumber
-
-\def\resetsubpagenumber
- {\global\resettingsubpagenumbertrue}
-
-% so far for sync, see \gotonext...
-
-\def\dosetupsubpagenumber[#1]%
- {\doifelse{#1}\v!reset
- \resetsubpagenumber % \resetnumber[\s!subpage]
- {\getparameters[\??sn][#1]%
- \processaction
- [\@@snstate]
- [ \v!stop=>\ifsubpaging
- \resetsubpagenumber % new, see sync
- \else
- \subpagingfalse
- \fi
- \showingsubpagefalse,
- \v!start=>\subpagingtrue
- \showingsubpagetrue,
- \v!none=>\subpagingtrue
- \showingsubpagefalse]}}
-
-\def\numberofsubpages
- {\ifshowingsubpage\nofsubpages\else0\fi}
-
-\def\subpagenumber
- {\ifshowingsubpage\the\subpageno\else0\fi}
-
-\def\setupsubpagenumber
- {\dosingleargument\dosetupsubpagenumber}
-
-\def\newnofsubpages{0}
-\def\nofsubpages {0}
-\def\firstsubpage {1}
-\def\prevsubpage {1}
-\def\nextsubpage {1}
-\def\lastsubpage {1}
-
-\def\nextpage {1}
-\def\prevpage {1}
-
-\definetwopasslist\s!subpage
-
-\def\savenofsubpages
- {\ifsubpaging
- \showmessage\m!layouts6{\newnofsubpages,\the\subpageno}%
- \immediatesavetwopassdata{\s!subpage}{\newnofsubpages}{\the\subpageno}%
- \fi}
-
-\def\setsubpagenumbers
- {\iftwopassdatafound
- \bgroup
- \xdef \nofsubpages {\twopassdata}%
- \xdef \firstsubpage {\realfolio}%
- \advance\realpageno \nofsubpages
- \advance\realpageno \minusone
- \xdef \lastsubpage {\realfolio}%
- \egroup
- \else
- \xdef \nofsubpages{0}%
- \fi}
-
-\def\gotonextsubpage % overlapt behoorlijk met realpage macro
- {\global\let\checksubpages\relax
- \ifresettingsubpagenumber
- \resetnumber[\s!subpage]%
- \global\resettingsubpagenumberfalse
- \fi
- \ifsubpaging
- \xdef\oldsubpage{\the\subpageno}%
- \incrementnumber[\s!subpage]%
- \global\subpageno\rawnumber[\s!subpage]\relax
- \ifnum\subpageno=\plusone
- \gettwopassdata\s!subpage
- \setsubpagenumbers
- \ifnum\oldsubpage>\zerocount
- \showmessage\m!layouts6{\newnofsubpages,\oldsubpage}%
- \savetwopassdata{\s!subpage}{\newnofsubpages}{\oldsubpage}%
- \fi
- \doglobal\increment\newnofsubpages\relax
- \fi
- \setglobalsystemreference\rt!page\v!firstsubpage\firstsubpage
- \setglobalsystemreference\rt!page\v!lastsubpage\lastsubpage
- \bgroup
- \ifnum\realpageno=\firstsubpage\relax
- \global\let\prevsubpage\firstsubpage
- \setglobalsystemreference\rt!page\v!subbackward\lastsubpage
- \else
- \xdef\prevsubpage{\realfolio}%
- \doglobal\decrement\prevsubpage
- \setglobalsystemreference\rt!page\v!subbackward\prevsubpage
- \fi
- \setglobalsystemreference\rt!page\v!previoussubpage\prevsubpage
- \ifnum\realpageno=\lastsubpage\relax
- \global\let\nextsubpage\lastsubpage
- \setglobalsystemreference\rt!page\v!subforward\firstsubpage
- \else
- \xdef\nextsubpage{\realfolio}%
- \doglobal\increment\nextsubpage
- \setglobalsystemreference\rt!page\v!subforward\nextsubpage
- \fi
- \setglobalsystemreference\rt!page\v!nextsubpage\nextsubpage
- \egroup
- \fi}
-
-\def\checksubpages
- {\getfromtwopassdata\s!subpage1%
- \setsubpagenumbers
- \global\let\checksubpages\relax}
-
-% Omdat \gotonextrealpage gebruik maakt van de hulpfile,
-% moet het initialiseren van \realpageno plaatsvinden in
-% een later stadium, namelijk zodra referenties worden
-% gebruikt (anders gaat het mis op nog niet gedefinieerde
-% lijstcommando's e.d.). De eerst aanroep vindt dan ook
-% plaats vlak nadat de hulpfile voor de eerste maal is
-% ingelezen.
-
-\countdef\realpageno = 0 \realpageno = 1
-\countdef\userpageno = 1 \userpageno = 1
-\countdef\subpageno = 2 \subpageno = 0 % !!
-\countdef\arrangeno = 3 \arrangeno = 0 % !!
-
-\let\pageno\userpageno
-
-% we don't want conflicts when \pageno is used by other
-% packages, like CWEB, so we redefine \pageno
-
-\newcount\pageno \pageno = 1
-
-\def\setuserpageno#1%
- {\global\userpageno#1\relax
- \global\pageno\userpageno}
-
-\def\realfolio {\the\realpageno}
-\def\folio {\the\userpageno}
-\def\firstpage {1}
-\def\lastpage {1}
-\def\currentpage {\the\realpageno}
-\def\lastpagenumber{1}
-
-\def\gotonextrealpage
- {\global\advance\realpageno \plusone\relax
- \ifnum\realpageno>\lastpage
- \xdef\lastpage{\realfolio}%
- \fi
- \setglobalsystemreference\rt!page\v!firstpage \firstpage
- \setglobalsystemreference\rt!page\v!lastpage\lastpage
- \bgroup
- \ifnum\realpageno>\plusone
- \advance\realpageno \minusone
- \xdef\prevpage{\realfolio}%
- \setglobalsystemreference\rt!page\v!backward\prevpage
- \else
- \global\let\prevpage\firstpage
- \setglobalsystemreference\rt!page\v!backward\lastpage
- \fi
- \setglobalsystemreference\rt!page\v!previouspage\prevpage
- \egroup
- \bgroup
- \ifnum\realpageno<\lastpage\relax
- \advance\realpageno \plusone
- \xdef\nextpage{\realfolio}%
- \setglobalsystemreference\rt!page\v!page\nextpage
- \setglobalsystemreference\rt!page\v!forward\nextpage
- \bgroup
- \xdef\nextnextpage{\realfolio}%
- \ifodd\realpageno
- \setglobalsystemreference\rt!page\v!nextoddpage\nextnextpage
- \else
- \setglobalsystemreference\rt!page\v!nextevenpage\nextnextpage
- \fi
- \advance\realpageno \plusone
- \xdef\nextnextpage{\realfolio}%
- \ifnum\realpageno>\lastpage\relax
- %\ifodd\realpageno
- % \setglobalsystemreference\rt!page\v!nextoddpage\lastpage
- %\else
- % \setglobalsystemreference\rt!page\v!nextevenpage\lastpage
- %\fi
- \else
- \ifodd\realpageno
- \setglobalsystemreference\rt!page\v!nextoddpage\nextnextpage
- \else
- \setglobalsystemreference\rt!page\v!nextevenpage\nextnextpage
- \fi
- \fi
- \egroup
- \else
- \global\let\nextpage\lastpage
- \setglobalsystemreference\rt!page\v!page\firstpage
- \setglobalsystemreference\rt!page\v!forward\firstpage
- \setglobalsystemreference\rt!page\v!nextoddpage\lastpage
- \setglobalsystemreference\rt!page\v!nextevenpage\lastpage
- \fi
- \setglobalsystemreference\rt!page\v!nextpage\realfolio
- \egroup}
-
-\def\checkrealpage
- {\global\realpageno\zerocount
- \gotonextrealpage
- \global\let\checkrealpage\relax}
-
-\def\savenofpages
- {\bgroup
- \advance\realpageno \minusone
- \savecurrentvalue\lastpage\realfolio
- \advance\userpageno \minusone
- \savecurrentvalue\lastpagenumber\folio
- \egroup}
-
-\def\totalnumberofpages
- {\lastpage}
-
-\def\setpagecounters
- {\setuserpageno{\rawnumber[\s!page]}%
- \doifelse\@@snstate\v!stop
- {\global\subpageno\zerocount}
- {\global\subpageno\rawnumber[\s!subpage]}\relax}
-
-% Standaard is \count0 in Plain TeX de paginateller. Omwille
-% van de afhandeling van lokaal nummeren, definieren we
-% echter een eigen nummer.
-
-\definenumber
- [\s!page]
- [\c!conversion=\@@nmconversion,
- \c!way=\@@nmway,
- \c!state=\@@nmstate,
- \c!start=1]
-
-% \@@pnstatus global, but \@@nmstatus local and only start/stop
-
-\global\let\@@pnstate\@@pnstate % brrr
-
-\def\pushpagestate{\globalpushmacro\@@pnstate}
-\def\poppagestate {\globalpopmacro \@@pnstate}
-
-\def\dosetuppagenumber[#1]%
- {\getparameters[\??pn][\c!number=,#1]%
- \global\let\@@pnstate\@@pnstate
- \doifsomething\@@pnnumber
- {\setnumber[\s!page]{\@@pnnumber}%
- \setuserpageno{\rawnumber[\s!page]}}%
- % this makes starting at an even page possible
- \ifnum\realpageno=1 \ifodd\pageno \else
- \global\shiftedrealpagenotrue
- \fi \fi}
-
-\def\setuppagenumber
- {\dosingleargument\dosetuppagenumber}
-
-\def\dodecrementpagenumber
- {\decrementnumber[\s!page]\setuserpageno{\rawnumber[\s!page]}}
-
-\def\doincrementpagenumber
- {\incrementnumber[\s!page]\setuserpageno{\rawnumber[\s!page]}}
-
-\def\dosynchronizepagenumber
- {\global\let\@@pnstate\v!start}
-
-\def\decrementpagenumber{\getvalue{\??pn-\@@pnstate}}
-\def\incrementpagenumber{\getvalue{\??pn+\@@pnstate}}
-
-\letvalue{\??pn-\v!start}\dodecrementpagenumber
-\letvalue{\??pn-\v!none }\dodecrementpagenumber
-\letvalue{\??pn-\v!empty}\dodecrementpagenumber
-
-\letvalue{\??pn+\v!start}\doincrementpagenumber
-\letvalue{\??pn+\v!none }\doincrementpagenumber
-\setvalue{\??pn+\v!empty}{\doincrementpagenumber\dosynchronizepagenumber}
-\letvalue{\??pn+\v!keep }\dosynchronizepagenumber
-
-% so far
-
-\def\checkpagecounter
- {\checknumber[\s!page]}
-
-% \getpagestatus
-% \ifrightpage als odd/singlesided
-
-\newif\ifrightpage \rightpagetrue
-
-\newcounter \nofpagesets
-
-\definetwopasslist\s!page
-
-\def\dopagesetreference
- {\doglobal\increment\nofpagesets\relax
- \lazysavetwopassdata{\s!page}{\nofpagesets}{\noexpand\realfolio}}
-
-\def\getpagestatus % hierboven gebruiken
- {\ifdoublesided
- \gettwopassdata\s!page
- \iftwopassdatafound \else
- \let\twopassdata\realpageno
- \fi
- \ifodd\twopassdata
- \global\rightpagetrue
- \else
- \global\rightpagefalse
- \fi
- \dopagesetreference
- \else
- \global\rightpagetrue
- \fi}
-
-\def\@@nmin {} % kan vervallen (upward compatibility)
-\def\@@nmlocation {} % mag {plaats, in} zijn
-
-\newcounter\@@pagenumberlocation
-
-\def\do@@plaatspaginanummer#1%
- {\ifnum#1=\@@pagenumberlocation\@@plaatspaginanummer\fi}
-
-\def\dodosetpagenumberlocation#1% tricky because of ...texts
- {\increment\@@pagenumberlocation
- \ifx\@@nmlocation\empty\else
- \def\dododosetpagenumberlocation##1%
- {\donetrue
- \setevalue{\??tk#1##1}{\noexpand\do@@plaatspaginanummer{\@@pagenumberlocation}}}%
- \donefalse
- \ExpandFirstAfter\processallactionsinset
- [\@@nmlocation]
- [ \v!middle=>\dododosetpagenumberlocation{\v!text\c!middletext},
- \v!left=>\dododosetpagenumberlocation{\v!text\c!lefttext},
- \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\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
- \dododosetpagenumberlocation{\v!text\c!middletext}% default
- \fi
- \fi}
-
-\def\dosetpagenumberlocation
- {\ExpandBothAfter\doifinsetelse\v!header{\@@nmlocation,\@@nmin}
- {\dodosetpagenumberlocation\v!header}
- {\dodosetpagenumberlocation\v!footer }}
-
-\def\dosetuppagenumbering[#1]%
- {\getparameters[\??nm][#1]%
- \preparepageprefix\??nm
- \singlesidedfalse
- \doublesidedfalse
- \ExpandFirstAfter\processallactionsinset
- [\@@nmalternative]
- [ \v!singlesided=>\singlesidedtrue,
- \v!doublesided=>\doublesidedtrue]%
- \ifx\trackingmarginnotestrue\undefined\else
- \ifdoublesided
- \trackingmarginnotestrue
- \else
- \trackingmarginnotesfalse
- \fi
- \fi
- \dosetpagenumberlocation
- \recalculatebackgrounds
- \recalculatelogos}
-
-\def\setuppagenumbering
- {\dosingleempty\dosetuppagenumbering}
-
-\let\stelnummeringin\setuppagenumbering
-
-% wrong
-%
-% \def\preparepageprefix#1%
-% {\def\dopreparepageprefix##1%
-% {\doifvalue{#1##1\c!number}{\v!yes}
-% {\setvalue{#1\getvalue{\??by##1}\c!nummer}{\v!yes}}}%
-% \processcommacommand[\@@kolijst]\dopreparepageprefix}
-%
-% more wrong
-%
-% \def\preparepageprefix#1%
-% {\def\dopreparepageprefix##1%
-% {\doifelsevalue{#1##1\v!number}{\v!yes} % v
-% {\setvalue{#1\getvalue{\??by##1}\v!nummer}{\v!yes}} % v
-% {\setvalue{#1\getvalue{\??by##1}\v!nummer}{\v!no}}}% % v
-% \processcommacommand[\@@kolijst]\dopreparepageprefix}
-%
-% best, beware, chapter (yes) can be followed by title (no)
-
-\def\preparepageprefix#1%
- {\def\dopreparepageprefix##1%
- {\ifcsname\??by##1\endcsname\letvalue{#1\csname\??by##1\endcsname\v!number}\v!no\fi}% %v
- \rawprocesscommalist[\@@kolist]\dopreparepageprefix
- \def\dopreparepageprefix##1%
- {\doifvalue{#1##1\v!number}\v!yes %v
- {\ifcsname\??by##1\endcsname\letvalue{#1\csname\??by##1\endcsname\v!number}\v!yes\fi}}%
- \rawprocesscommalist[\@@kolist]\dopreparepageprefix}
-
-\def\dodopageprefix#1% uti seperator --
- {\let\normaluchar\uchar \let\uchar\relax % ugly but needed
- \doifelsevalue{\pageprefixtype#1\v!number}\v!yes % \v! and no \c!
- {\edef\preprefix {\@@filterheadpart[\postprefix]}%
- \edef\postprefix{\@@filtertailpart[\postprefix]}%
- \let\uchar\normaluchar % ugly but needed
- \ifx\preprefix\empty \else
- \ifx\preprefix\zerocountervalue\else
- \preprefix\@@nmnumberseparator
- \fi
- \fi}
- {\edef\postprefix{\@@filtertailpart[\postprefix]}%
- \let\uchar\normaluchar}} % ugly but needed
-
-\def\dopageprefix#1%
- {\dodopageprefix{#1}%
- \donexttracklevel{#1}}
-
-\chardef\pageprefixmode\plusone
-
-\def\pageprefix#1[#2]%
- {\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
-%D oldstyle numbers are about as high as strutheight. Rather
-%D interesting that it went unnoticed for so long.
-
-\unexpanded\def\@@plaatspaginanummer % called in empty tests
- {\doif{\@@nmstate\@@pnstate}{\v!start\v!start}
- {{\doif\@@nmstrut\v!yes\strut
- \@@nmcommand{\doattributes\??nm\c!style\c!color{\completepagenumber}}}}}
-
-\def\userfolio {\convertednumber[\s!page]} % naast realfolio
-\def\pagenumber{\userfolio}
-
-\def\pageprefixes
- {\let\donexttrackcommando\dopageprefixes
- \donexttrackcommando\firstsection}
-
-\def\dopageprefixes#1%
- {\doifvalue{\??nm#1\v!number}\v!yes % v
- {\ifnum\countervalue{\??se#1}>\zerocount
- \getvalue{#1\c!number}\@@nmnumberseparator
- \fi}%
- \doifsomething\@@nmtext{\@@nmtext\@@nmnumberseparator}% strange option, what was the purpose of text?
- \donexttracklevel{#1}}
-
-\unexpanded\def\completepagenumber
- {\doif{\@@nmstate\@@pnstate}{\v!start\v!start}
- {\@@nmleft\labeltexts\v!pagenumber{\pageprefixes\pagenumber}\@@nmright}}
-
-\unexpanded\def\placepagenumber
- {\doif{\@@nmstate\@@pnstate}{\v!start\v!start}
- {\labeltexts\v!pagenumber{\pagenumber}}}
-
-% Nog een variant; wat is een goeie naam?
-
-% \unexpanded\def\placexxpagenumber
-% {\@@plaatspaginanummer}
-
-% \def\translatednumber[#1::#2::#3]{#3}
-
-\def\translatednumber{\@@filterpagepart}
-
-\unexpanded\def\referencepagenumber[#1]%
- {\doifelsenothing{#1}{?}%
- {\preparepageprefix\??rf
- \pageprefix\??rf[#1]\translatednumber[#1]}}
-
-\setuppagenumber
- [\c!state=\v!start,
- \c!number=1]
-
-\setupsubpagenumber
- [\c!way=\v!by\v!part,
- \c!state=\v!stop]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/strc-ref.mkii b/Master/texmf-dist/tex/context/base/mkii/strc-ref.mkii
deleted file mode 100644
index 8a135eb043e..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/strc-ref.mkii
+++ /dev/null
@@ -1,3025 +0,0 @@
-%D \module
-%D [ file=strc-ref,
-%D version=1998.01.15,
-%D title=\CONTEXT\ Structure Macros,
-%D subtitle=Cross Referencing,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% we will merge mkii code back in here
-
-\writestatus{loading}{ConTeXt Structure Macros / Cross Referencing}
-
-% todo : unknown/illegal reference no arg
-% todo : +n pages check on 'samepage' (contrastcolor)
-
-% Makes more sense to build action data first, especially now
-% openaction etc are supported.
-%
-% \definespecial\doexecuteactionchain w h
-% \definespecial\dosetgotolocation
-% \definespecial\dosetexecuteJScode
-% ...
-%
-% complication: what when direct? Two calls!
-
-% I considered to change / simplify
-%
-% rt!page -> \definereference
-% rt!list -> \definereference
-% rt!exec -> \definereference
-%
-% but for the moment will not do so, if only because
-% the current implementation permits us to determine
-% the page state and is also more efficient
-
-% the code is rather fuzzy (and will be redone some day); this is
-% due to the chaining (collect secondary and then hook that into
-% the primary etc
-
-\unprotect
-
-%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
-%D referencing should be as hidden as possible.
-%D
-%D In paper documents, referencing comes down to cross
-%D referencing, but in their interactive counterparts, is also
-%D involves navigation. Many features implemented here are
-%D therefore closely related to navigation.
-%D
-%D Many \CONTEXT\ commands can optionally be fed with a
-%D reference. Such a reference, when called upon, returns the
-%D number of a figure, table, chapter etc, a piece of text, or
-%D a pagenumber.
-%D
-%D There are three ways of defining a reference:
-%D
-%D \starttyping
-%D \pagereference[here]
-%D \textreference[here]{some text}
-%D \stoptyping
-%D
-%D the third alternative combines them in:
-%D
-%D \starttyping
-%D \reference[here]{some text}
-%D \stoptyping
-
-\def\textreference {\dosingleargument\dotextreference}
-\def\pagereference {\dosingleargument\dopagereference}
-\def\reference {\dosingleargument\doreference }
-
-%D These are implemented in a low level form as:
-%D
-%D \starttyping
-%D \def\dotextreference[#1]{\rawtextreference\s!txt{#1}} % #2
-%D \def\dopagereference[#1]{\rawpagereference\s!pag{#1}}
-%D \def\doreference [#1]{\rawreference \s!ref{#1}} % #2
-%D \stoptyping
-%D
-%D or without expansion problems:
-
-\def\dotextreference[#1]#2%
- {\bgroup
- \def\asciia{#1}%
- \defconvertexpanded\asciib\@@rfexpansion{#2}%
- \@EA\rawtextreference\@EA\s!txt\@EA\asciia\@EA{\asciib}%
- \egroup}
-
-\def\dopagereference[#1]%
- {\rawpagereference\s!pag{#1}}
-
-\def\doreference[#1]#2%
- {\bgroup
- \def\asciia{#1}%
- \defconvertexpanded\asciib\@@rfexpansion{#2}%
- \@EA\rawreference\@EA\s!ref\@EA\asciia\@EA{\asciib}%
- \egroup}
-
-%D Actually there is not much difference between a text and a
-%D full reference, but it's the concept that counts. The low
-%D level implementation is:
-
-\def\rawreference#1#2#3%
- {\bgroup
- \the\everyreference
- \makesectionformat
- \writereference{#2}
- {\sectionformat\sectionseparator\sectionseparator\noexpand\pagenumber}%
- {\noexpand\realfolio}%
- {#3}%
- \egroup}
-
-\def\rawpagereference#1#2%
- {\bgroup
- \the\everyreference
- \makesectionformat
- \writereference{#2}
- {\sectionformat\sectionseparator\sectionseparator\noexpand\pagenumber}%
- {\noexpand\realfolio}%
- {}%
- \egroup}
-
-\def\rawtextreference#1#2#3%
- {\bgroup
- \the\everyreference
- \writereference{#2}
- {}%
- {\noexpand\realfolio}%
- {#3}%
- \egroup}
-
-%D The last reference is saved in a macro named \type
-%D {\lastreference} (indeed). To keep track of the order of
-%D references, later we will see for what purpose, we maintain
-%D a counter.
-
-\newcount\crossreferencenumber \crossreferencenumber\plusone
-
-\let\lastreference\empty
-
-\def\writereference#1#2#3#4%
- {\ifreferencing
- \edef\!!stringa{#1}%
- \ifx\!!stringa\empty \else
- \def\dowritereference##1%
- {\xdef\lastreference{##1}%
- \@EA\dodowritereference\lastreference\empty\empty\end{#2}{#3}{#4}}%
- \rawprocesscommalist[\!!stringa]\dowritereference
- \fi
- \fi}
-
-%D Beware: \type {#2} gobbles space in references so that
-%D \typ {a nice ref} becomes \typ {anice ref}.
-
-\def\dodowritereference#1#2#3\end#4#5#6%
- {\bgroup
- \global\advance\crossreferencenumber \plusone\relax
- \if#1-\if#2:%
- \let\referenceprefix\empty
- \xdef\lastreference{#3}%
- \else
- % \xdef\lastreference{#1#2#3}% here we loose the space
- \fi\else
- % \xdef\lastreference{#1#2#3}% here we loose the space
- \fi
- \ifx\lastreference\empty \else
- \doiffirstreferenceoccurance\lastreference
- {\thisisdestination{\referenceprefix\lastreference}}%
- \referenceinfo>\lastreference
- \expanded{\writeutilitycommand{\noexpand\mainreference{\referenceprefix}{\lastreference}{#4}{#5}{#6}}}%
- \fi
- \egroup}
-
-%D We will implement \type {\doiffirstreferenceoccurance}
-%D later on.
-
-%D These macros depend on three other ones,
-%D \type {\makesectionformat}, that generated \type
-%D {\sectionformat}, \type {\pagenumber}. The not yet used
-%D argument \type{#1} is a tag that specifies the type of
-%D reference.
-
-%D \macros
-%D {everyreference}
-%D
-%D For rather tricky purposes, one can assign sanitizing
-%D macros to \type{\everyreference}.
-
-\newevery \everyreference \relax
-
-%D This is really needed, since for instance Polish has a
-%D different alphabet and needs accented entries in registers.
-
-\appendtoks
- \cleanupfeatures
-\to \everyreference
-
-%D Why do we have to write down references? \TEX, and therefore
-%D \CONTEXT\ is a batch processing system. During the
-%D typesetting process, pages are shipped out, which means that
-%D especially forward references are not yet known when the
-%D page is typeset. That's why we always need a second (and
-%D sometimes even a third) pass to get the cross references
-%D right. The same goes for lists and other pagenumber
-%D dependant data.
-%D
-%D Therefore, during a pass, \CONTEXT\ writes the references to
-%D a the utility file. The next macro does the job and
-%D generates entries like: (for mkii)
-%D
-%D \starttyping
-%D \mainreference{prefix}{reference}{page}{realpage}{text}
-%D \stoptyping
-%D
-%D We did not yet discuss prefixing. Especially in interactive
-%D documents, it's not always easy to keep track of duplicate
-%D references. The prefix mechanism, which we will describe
-%D later on, solves this problem. By (automatically) adding a
-%D prefix one keeps references local, but the global ones in
-%D view. To enable this feature, we explictly split the prefix
-%D from the reference.
-%D
-%D A former implementation used \type{\removesubstring} to get
-%D rid of the don't||use||a||prefix signal (\type{-:}), but the
-%D next one proved to be more than twice as fast.
-
-\let\referenceprefix=\empty
-\let\lastreference =\empty
-
-%D When (during a second pass over the document) references are
-%D loaded, they are saved in a macro, one for each reference.
-%D In practice this comes to giving \type {\mainreference} a
-%D appropriate meaning and loading the utility file.
-
-%D For a long time the only way to access an external file was
-%D to use the file prefix (\type {somefile::}. However, when
-%D you split up a document, redefining the references may be
-%D such a pain, that another approach is feasible. By setting
-%D the \type {autofile} variable to \type {yes} or \type
-%D {page}, you can access the reference directly. The latter
-%D case nills the prefix method, thereby saving some memory.
-%D
-%D \starttabulate[||||]
-%D \NC filename::tag \NC page(filename::pnum) \NC tag \NC\NR
-%D \NC $\star$ \NC \NC \NC\NR
-%D \NC $\star$ \NC $\star$ \NC $\star$ \NC\NR
-%D \NC \NC $\star$ \NC \NC\NR
-%D \stoptabulate
-
-\chardef\autocrossfilereferences=0
-
-\def\setreferences% some day, filename will be stored in ref record
- {\the\everyreference % we're grouped anyway
- \def\mainreference##1##2##3##4##5% can be made faster by indirect calls
- {\ifcsname\r!cross\fileprefix##1##2\endcsname
- \ifcase0##4\else
- \showmessage\m!references2{[##1][##2],##4 (\currentutilityfilename)}%
- \fi
- \else
- \ifcase\autocrossfilereferences
- \setglobalcrossreference{##1##2}{##3}{##4}{##5}%
- \or
- \setglobalcrossreference{##1##2}{##3}{##4}{##5}%
- \ifcsname\r!cross##1##2\endcsname
- \showmessage\m!references2{[##1][##2],##4 (auto \currentutilityfilename)}%
- \else
- \expanded{\definereference[##1##2][\fileprefix##1##2]}%
- \fi
- \or
- \ifcsname\r!cross##1##2\endcsname
- \showmessage\m!references2{[##1][##2],##4 (auto \currentutilityfilename)}%
- \else
- \expanded{\definereference[##1##2][\noexpand\v!page(\fileprefix##4)]}%
- \fi
- \fi
- \fi}}
-
-\def\resetreferences
- {\let\mainreference\gobblefivearguments}
-
-\resetreferences
-
-%D Here we see another kind of prefix surface: \type
-%D {\fileprefix}. This prefix enables us to use references from
-%D different files in one document. This is no really useful in
-%D paper documents, but many interactive ones cannot do
-%D without.
-
-\let\fileprefix=\empty
-
-%D Loading references is done using the normal utility file
-%D handling macros. The \type{\hbox} trick prevents spaces
-%D creeping in (references are set globally anyway).
-
-\newtoks\everycheckreferences
-
-%D When we load references, the file name is stored in a
-%D list.
-
-\let\loadedreferences\empty
-
-%D We only load references ones.
-
-\newconditional\jobreferencesloaded
-
-%D This token list is expanded after the references are loaded.
-%D This hook can be used to initialize mechanisms that depend
-%D on the reference mechsnism. An example can be found in the
-%D field module.
-
-\def\checkreferences
- {\bgroup
- \let\fileprefix\empty
- \global\let\checkreferences\relax
- \usereferences[\jobname]%
- \checkrealpage
- \egroup
- \the\everycheckreferences}
-
-\def\usereferences[#1]%
- {\startnointerference
- \checkreferences
- \doifparentfileelse{#1}
- {\ifconditional\jobreferencesloaded\else
- \doutilities{references}{#1}\empty\relax\relax
- \global\settrue\jobreferencesloaded
- \fi}
- {\ExpandBothAfter\doifnotinset{#1}{\loadedreferences}
- {\doutilities{references}{#1}\empty\relax\relax
- \ifx\fileprefix\empty\else
- \doglobal\addtocommalist{#1}\loadedreferences
- \fi}}
- \stopnointerference}
-
-%D As mentioned we will also use the cross reference mechanism
-%D for navigational purposes. The main reason for this is that
-%D we want to treat both categories alike:
-%D
-%D \starttyping
-%D \goto{go back}[PreviousJump]
-%D \goto{colofon}[colofon page]
-%D \stoptyping
-%D
-%D Here \type{PreviousJump} is handled by the viewer, while the
-%D \type{colofon page} reference is, apart from hyperlinking, a
-%D rather normal reference.
-%D
-%D We already saw that cross refences are written to and read
-%D from a file. The pure navigational ones don't need to be
-%D written to file, but both for fast processing and
-%D transparant integration, they are saved internally as a sort
-%D of reference. We can easily distinguish such system
-%D references from real cross reference ones by their tag:
-
-\chardef\rt!cross=0 % even means possible page reference
-\chardef\rt!done =1
-\chardef\rt!page =2 % and is used in \checkrealreferencepage
-\chardef\rt!exec =3
-\chardef\rt!list =4 % to determine the page state
-
-%D We also use the odd/even characteristic to determine the
-%D page state.
-
-%D Here the \type{\rt!exec} tags a viewer specific navigational
-%D reference, while for instance \type{\rt!page} gives fast
-%D access to for instance the previous or next page. The
-%D counter serves a purpose to be explained later. We use a
-%D token register to prevent expansion of the text component,
-%D which can contain all kind of \TEX\ commands.
-
-\newcount\crossreferenceorder
-
-% these are used often so we sped them up
-
-\def\setlocalcrossreference#1#2#3#4%
- {\scratchtoks{#4}%
- \@EA\edef\csname\r!cross\fileprefix#1\endcsname
- {\rt!cross{#2}{#3}{\the\scratchtoks}{0}}}
-
-\def\setglobalcrossreference#1#2#3#4%
- {\scratchtoks{#4}%
- \global\advance\crossreferenceorder \plusone
- \@EA\xdef\csname\r!cross\fileprefix#1\endcsname
- {\rt!cross{#2}{#3}{\the\scratchtoks}{\the\crossreferenceorder}}}
-
-\def\setlocalsystemreference#1#2#3%
- {\@EA\edef\csname\r!cross\fileprefix#2\endcsname{#1{#3}}}
-
-\def\setglobalsystemreference#1#2#3%
- {\@EA\xdef\csname\r!cross\fileprefix#2\endcsname{#1{#3}}}
-
-\def\copycrossreference#1#2#3% file from to / slow
- {\bgroup
- \doifelse{#1}{}
- {\let\fileprefix\empty}
- {\def\fileprefix{#1::}}%
- \def\rt!cross##1##2##3##4%
- {\setxvalue{\r!cross\fileprefix#3}%
- {\noexpand\rt!cross{##1}{##2}{##3}{##4}}}%
- \getvalue{\r!cross\fileprefix#2}%
- \egroup}
-
-%D References from other files are defined globally without
-%D ordering data. The first definition, the one without
-%D \type{#1}, is used as a signal that references are defined.
-
-\def\setoutercrossreference#1#2#3#4%
- {\toks0={#4}%
- \@EA\xdef\csname\r!cross\fileprefix \endcsname{\rt!cross{}{}{1}{0}}%
- \@EA\xdef\csname\r!cross\fileprefix#1\endcsname{\rt!cross{#2}{#3}{\the\toks0}{0}}}
-
-%D In practice accessing a reference comes down to:
-%D
-%D \startitemize[packed]
-%D \item checking the validity
-%D \item determining the type
-%D \item filtering the content
-%D \stopitemize
-%D
-%D We'll deal with the last two steps first. References are
-%D saved in the general format:
-%D
-%D \starttyping
-%D {\referenceclass{realpage}{page}{text}}
-%D {\referenceclass{type}{data}}
-%D \stoptyping
-%D
-%D When we filter the content, next macros are set when we
-%D meet a normal cross reference:
-
-\let\currentrealreference =\empty
-\let\currentpagereference =\empty
-\let\currenttextreference =\empty
-\let\currentsubtextreference =\empty
-\let\currentsubsubtextreference=\empty
-
-%D System references only have one component:
-
-\let\currentdatareference=\empty
-
-%D Because internally a reference comes in two disguises, one
-%D with four arguments and one with only two, we need a two
-%D step filter.
-
-\def\getreferenceelements#1% only one level expansion permitted!
- {\@EA\@EA\@EA\dogetreferenceelements\csname\r!cross\referenceprefix#1\endcsname\empty\empty\empty\empty}
-
-%D In the following step, the \type{\ifx#1} test is needed
-%D because we can access this macro directly, and therefore
-%D \type{#1} can be an undefined reference (in fact, this hack
-%D was needed for the line numbering mechanism).
-%D
-%D We already introduced a few counters. Here we see why we
-%D need those. The discrepancy between the cross reference
-%D definition order (determined by the utility file) and the
-%D moment the reference is defined in the text, is a measure
-%D for it's forward character. This enables references like
-%D {\em as we will see later on}.
-
-\chardef\currentreferencetype=0
-
-\newif\ifforwardreference
-
-\newif\ifrealreferencepage
-
-\def\docheckrealreferencepage#1%
- {\doifnumberelse{#1}
- {\ifnum#1=\realpageno
- \realreferencepagetrue
- \else
- \realreferencepagefalse
- \fi}
- {\realreferencepagefalse}}
-
-\def\currentfolioreference{0}
-
-\let\currentlocationreference\empty
-
-\def\dogetreferenceelements#1#2#3#4#5%
- {\chardef\currentreferencetype=\ifx#1\relax0\else#1\fi\relax
- \ifnum\currentreferencetype<\plustwo
- \edef\currentpagereference{#2}%
- \let \currentdatareference\empty
- \edef\currentlocationreference{#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
- \let \currentlocationreference\empty
- \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}
-
-\ifx\referencepagenumber\undefined
-
- \def\referencepagenumber[#1]{?}
-
-\fi
-
-%D Text references can contain more than one entry and
-%D therefore we check for
-%D
-%D \starttyping
-%D {entry}
-%D \stoptyping
-%D
-%D or
-%D
-%D \starttyping
-%D {{entry}{entry}{entry}}
-%D \stoptyping
-%D
-%D and split accordingly.
-
-\def\settextreferences
- {\futurelet\next\dosettextreferences}
-
-\def\dosettextreferences
- {\ifx\next\bgroup
- \expandafter\dotriplegroupempty\expandafter\dodosettextreferences
- \else
- \expandafter\donosettextreferences
- \fi}
-
-\def\donosettextreferences#1\end
- {\def\currenttextreference{#1}%
- \let\currentsubtextreference\empty
- \let\currentsubsubtextreference\empty}
-
-\def\dodosettextreferences#1#2#3#4\end
- {\def\currenttextreference{#1}%
- \def\currentsubtextreference{#2}%
- \def\currentsubsubtextreference{#3}}
-
-%D When inside this testing macro we can savely use:
-
-\def\doifforwardreferenceelse#1#2%
- {\ifforwardreference#1\else#2\fi}
-
-%D Duplicate references are reported while loading the utility
-%D file. To prevent problems with document viewers cq.
-%D preprocessors, one can enable a (bit time consuming) check.
-
-\newif\ifcheckduplicatereferences
-
-%D The next rather dirty trick is needed to preserve the
-%D meaning of the original cross reference. In fact,
-%D \type{\rt!cross} is toggled to \type{\rt!done}.
-
-\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 % no let !
- {\csname\r!cross\referenceprefix#1\endcsname}%
- \egroup}
-
-\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
- \fi}
-
-\def\doiffirstreferenceoccurance
- {\ifcheckduplicatereferences
- \@EA\checkfirstreferenceoccurance
- \else
- \@EA\secondoftwoarguments
- \fi}
-
-%D We still have to test for the existence of a reference, but
-%D before we come to that, we first look into the way a
-%D reference can be accessed. It will be no surprise that
-%D references can come in several forms.
-%D
-%D Cross references appear as numbers (figure~1.1, chapter~2)
-%D or pagenumbers (page~2, page 3--2), and are called with
-%D \type{\in} and \type{\at}. In interactive documents we also
-%D have \type{\goto}, \type{\button} and alike. These are more
-%D versatile and look like:
-%D
-%D \starttyping
-%D \goto[reference]
-%D \goto[outer reference::]
-%D \goto[outer reference::inner reference]
-%D \goto[operation(argument)]
-%D \goto[operation(action{argument,argument})]
-%D \goto[action]
-%D \goto[action{argument}]
-%D \stoptyping
-%D
-%D The first one is a normal reference, the second and third
-%D are references to a file or \URL. The brace delimited
-%D references for instance refer to a \JAVASCRIPT. The last
-%D example shows that we can pass arguments to the actions.
-%D
-%D When we split off the components of such a reference, the
-%D results are available in:
-%D
-%D \starttyping
-%D \currentreferencespecial
-%D \currentreferenceoperation
-%D \currentreferencearguments
-%D \currentinnerreference
-%D \currentouterreference
-%D \currentfullreference
-%D \stoptyping
-%D
-%D Splitting a reference is done by:
-%D
-%D \starttyping
-%D \splitofffullreference {reference}
-%D \splitoffreference {reference}
-%D \stoptyping
-%D
-%D The second alternative can be used in a second stage
-%D splitoff and only handles \type{::}.
-
-\newif\ifreferencefound
-
-\let\currentfullreference \empty
-\let\currentreferencespecial \empty
-\let\currentreferenceoperation\empty
-\let\currentreferencearguments\empty
-\let\currentouterreference \empty
-\let\currentinnerreference \empty
-
-\def\setreferencevariables#1#2#3#4#5%
- {\def\currentreferencespecial {#1}%
- \def\currentreferenceoperation{#2}%
- \def\currentreferencearguments{#3}%
- \def\currentouterreference {#4}%
- \def\currentinnerreference {#5}}
-
-\def\splitofffullreference#1%
- {\edef\currentfullreference{#1}%
- \@EA\dosplitofffullreference\currentfullreference\empty(\relax)\empty\end}
-
-\def\dosplitofffullreference#1(#2#3)#4#5\end
- {\ifx#2)%
- \let\currentreferenceoperation\empty
- \let\currentreferencearguments\empty
- \let\currentinnerreference \empty
- \dodosplitofffullreferenceA#1::::\empty\end
- \currentouterreference\currentreferencespecial
- \else\ifx#2\relax
- \let\currentreferencespecial \empty
- \let\currentreferenceoperation\empty
- \let\currentreferencearguments\empty
- \dodosplitofffullreferenceA#1::::\empty\end
- \currentouterreference\currentinnerreference
- \else
- \dosplitoffreferenceoperation#2#3{}\end
- \let\currentinnerreference\empty
- \dodosplitofffullreferenceB#1::::\empty\end
- \currentouterreference\currentreferencespecial
- \fi\fi}
-
-\def\dosplitoffreferenceoperation#1#%
- {\def\currentreferenceoperation{#1}%
- \dodosplitoffreferenceoperation}
-
-\def\dodosplitoffreferenceoperation#1#2\end
- {\def\currentreferencearguments{#1}}
-
-\def\dodosplitofffullreferenceA#1::#2::#3#4\end#5#6%
- {\if#3:%
- \dosetfullreferenceA#5#1{}\edef#6{#2}%
- \else
- \dosetfullreferenceA#6#1{}\let#5\empty
- \fi}
-
-\def\dosetfullreferenceA#1#2#%
- {\edef#1{#2}%
- \def\currentreferencearguments}
-
-\def\dodosplitofffullreferenceB#1::#2::#3#4\end#5#6%
- {\if#3:%
- \edef#5{#1}\edef#6{#2}%
- \else
- \let#5\empty\edef#6{#1}%
- \fi}
-
-\def\splitoffreference#1%
- {\expandafter\dodosplitofffullreferenceB#1::::\empty\end
- \currentouterreference\currentinnerreference}
-
-%D Although the previous split macros have a multistep
-%D character, there performance is quite reasonable.
-%D
-%D For debugging purposes we provide a showcase macro:
-
-\long\def\dodoshowcurrentreference#1\from#2\with#3%
- {\defconvertedcommand\ascii{#2}%
- \edef\currentreferenceshow{\currentreferenceshow/#1/\ascii/#3/}}
-
-\long\def\doshowcurrentreference#1%
- {\edef\currentreferenceshow{/\ifreferencefound+\else-\fi/#1}%
- \dodoshowcurrentreference ful\from\currentfullreference \with#1%
- \dodoshowcurrentreference spe\from\currentreferencespecial \with#1%
- \dodoshowcurrentreference ope\from\currentreferenceoperation\with#1%
- \dodoshowcurrentreference arg\from\currentreferencearguments\with#1%
- \dodoshowcurrentreference out\from\currentouterreference \with#1%
- \dodoshowcurrentreference inn\from\currentinnerreference \with#1}
-
-\def\showcurrentreference%
- {\bgroup\tttf\doshowcurrentreference\par\currentreferenceshow\egroup}
-
-%D We use this visualizer to demonstrate the way references are
-%D split.
-%D
-%D \hbox{\splitofffullreference{rr}\showcurrentreference}
-%D \hbox{\splitofffullreference{pp{rr}}\showcurrentreference}
-%D \hbox{\splitofffullreference{pp(qq)}\showcurrentreference}
-%D \hbox{\splitofffullreference{pp(qq{aa,bb})}\showcurrentreference}
-%D \hbox{\splitofffullreference{ff::}\showcurrentreference}
-%D \hbox{\splitofffullreference{ff::rr}\showcurrentreference}
-%D \hbox{\splitofffullreference{ff::pp()}\showcurrentreference}
-%D \hbox{\splitofffullreference{ff::pp(qq)}\showcurrentreference}
-%D \hbox{\splitofffullreference{ff::pp(qq{aa})}\showcurrentreference}
-
-%D Now we've come to the promissed testing step. As we can
-%D see, this macro does bit more than testing: it also resolves
-%D the reference. This means that whenever we test for the
-%D existance of a reference at an outer level, we have all the
-%D relevant properties of that reference avaliable inside the
-%D true branche~(\type{#2}).
-%D
-%D The prefix has to do with localizing references. When a
-%D prefix is set, looking for a reference comes to looking for
-%D the prefixed one, and when not found, looking for the non
-%D prefixed one. Consider for instance the prefix set to
-%D \type{sidetrack}.
-%D
-%D \starttyping
-%D \pagereference[important]
-%D \pagereference[unimportant]
-%D \setupreferencing[prefix=sidetrack]
-%D \pagereference[important]
-%D \stoptyping
-%D
-%D results in saving (writing) the references
-%D
-%D \starttyping
-%D ...{}{important}
-%D ...{}{unimportant}
-%D ...{sidetrack}{important}...
-%D \stoptyping
-%D
-%D Now when we call for \type{unimportant}, we will indeed get
-%D the pagenumber associated to this reference. But when we
-%D call for \type{important}, while the prefix is still set, we
-%D will get the pagenumber bound to the prefixed one.
-%D
-%D {\em Some day, when processing time and memory are no longer
-%D performance factors, we will introduce multi||level
-%D prefixes.}
-%D
-%D Before we start analyzing, I introduce a general
-%D definition macro. Consider:
-%D
-%D \starttyping
-%D \goto{do}[JS(My_Script{"test",123}),titlepage]
-%D \stoptyping
-%D
-%D This can also be achieved by:
-%D
-%D \starttyping
-%D \definereference[startup][JS(My_Script{"test",123}),titlepage]
-%D \goto{do}[REF(startup)]
-%D \stoptyping
-%D
-%D Now is this is a handy feature or not?
-%D
-%D \showsetup{definereference}
-%D
-%D We can trace references by setting the next switch to
-%D true.
-
-\newif\iftracereferences
-
-\let\tracereferences\tracereferencestrue
-
-\def\specialREFidentifier{REF}
-
-\def\dodefinereference[#1][#2]%
- {\ifsecondargument
- \doifelsenothing{#2}
- {\resetreference[#1]}%
- {\@EA\gdef\csname\specialREFidentifier#1\endcsname{#2}}%
- \else\iffirstargument
- \resetreference[#1]%
- \fi\fi}
-
-\def\definereference%
- {\dodoubleempty\dodefinereference}
-
-\def\resetreference[#1]%
- {\global\letbeundefined{\specialREFidentifier#1}}
-
-\newcount\nofexpandedreferences
-
-\def\dodoexpandreferences#1REF(#2#3)#4\relax
- {\ifx#2\relax
- \ifcsname\specialREFidentifier#1\endcsname
- \edef\expandedreference{\csname\specialREFidentifier#1\endcsname,}%
- \else
- \global\advance\nofexpandedreferences \plusone
- \@EA\xdef\csname REF::\number\nofexpandedreferences\endcsname{#1}%
- \fi
- \else
- \ifcsname\specialREFidentifier#2#3\endcsname
- \edef\expandedreference{\csname\specialREFidentifier#2#3\endcsname,}%
- \else
- % not set
- \fi
- \fi}
-
-\def\doexpandreferences#1,%
- {\if]#1\else
- \let\expandedreference\empty
- \dodoexpandreferences#1REF(\relax)\relax
- \@EAEAEA\doexpandreferences\@EA\expandedreference
- \fi}
-
-\def\expandreferences#1%
- {\global\nofexpandedreferences\zerocount
- \doexpandreferences#1,],}
-
-\def\dodoifreferencefoundelse#1%
- {\@EA\splitofffullreference\@EA{#1}%
- \ifx\currentreferencespecial\empty
- \ifx\currentouterreference\empty
- \docheckinnerreference
- \ifreferencefound \else
- \checkglobalfilereferences
- \fi
- \else
- \docheckouterreference
- \fi
- \ifreferencefound
- \ifx\currentreferencearguments\empty
- \getreferenceelements\currentfullreference
- \else
- \getreferenceelements\currentinnerreference
- \fi
- \fi
- \else
- \docheckspecialreference
- \fi
- \iftracereferences
- \doshowcurrentreference\space
- \writestatus\m!references\currentreferenceshow
- \fi}
-
-%D Although this can be considered a hack, we provide the
-%D option to locate unknown references in other (loaded) files.
-%D This can be dangerous, since there can be conflicting
-%D definitions.
-
-\newconditional\autoglobalfilereferences
-
-\def\checkglobalfilereferences% sloooow
- {\ifconditional\autoglobalfilereferences
-% \processcommacommand[\loadedreferences]\docheckglobalfilereference
- \rawprocesscommalist[\loadedreferences]\docheckglobalfilereference
- \fi}
-
-\def\docheckglobalfilereference#1%
- {\ifcsname\r!cross#1::\currentinnerreference\endcsname
- \def\currentouterreference{#1}%
- \edef\currentfullreference%
- {\currentouterreference::\currentinnerreference}%
- \global\referencefoundtrue
- \quitcommalist
- \fi}
-
-%D For most situations, we could use:
-%D
-%D \starttyping
-%D \let\doifreferencefoundelse=\dodoifreferencefoundelse
-%D \stoptyping
-%D
-%D But when we also want to support chained references, we need
-%D some more. Such a chained reference is defined as:
-%D
-%D \starttyping
-%D \goto{somewhere}[JS(somescript),nextpage,JS(anotherscript)]
-%D \stoptyping
-%D
-%D Actually supporting chains is up to the special driver. Here
-%D we only provide the hooks.
-
-%D \macros
-%D {ifenablereferencechains}
-%D
-%D First we provide a switch to turn this mechanism off:
-
-\newif\ifenablereferencechains \enablereferencechainstrue
-
-%D We don't use the general commalist processing macros,
-%D because we don't want to pay a speed penalty.
-
-\newif\ifsecondaryreference
-\newcount\nofsecondaryreferences
-
-% Aanpassen: eerst alle refs scannen en componenten opslaan in
-% lijst, dan de chain doorlopen. Momenteel mag alleen laatste
-% laatste undefined zijn, eigenlijk moet dat overal kunnen met
-% 'geen' zonder melding. Is wel trager. Dus niet.
-
-\def\doifreferencefoundelse#1#2#3% REF \cs / never more than one group (else \aftergroup usage problems)
- {\checkreferences
- % first we collect the secondary ones
- \bgroup
- \the\everyreference
- \let\referenceprefix\empty
- \expandreferences{#1}%
- \egroup
- \doresetgotowhereever
- \global\nofsecondaryreferences \zerocount
- \ifcase\nofexpandedreferences\relax % #1 can be number -)
- % no ref
- \or
- % one ref
- \or
- % two refs
- \ifenablereferencechains \iflocation
- \global\secondaryreferencetrue
- \xdef\secondaryreference{\csname REF::2\endcsname}%
- % test: \global\letcscsname\secondaryreference\csname REF::2\endcsname
- \bgroup
- %%\let\doifreferencefoundelse\localdoifreferencefoundelse
- \let\unharmedreferenceprefix\referenceprefix
- \dodoifreferencefoundelse\secondaryreference
- \ifreferencefound
- \global\nofsecondaryreferences \plusone
- #2%
- \else
- \dohandlenoto{#3}%
- \fi
- \egroup
- \fi \fi
- \else
- % more than two refs
- \ifenablereferencechains \iflocation
- \global\secondaryreferencetrue
- \scratchcounter\plustwo
- \loop
- \xdef\secondaryreference{\csname REF::\number\scratchcounter\endcsname}%
- % test: \global\letcscsname\secondaryreference\csname REF::\number\scratchcounter\endcsname
- \bgroup
- %%\let\doifreferencefoundelse\localdoifreferencefoundelse
- \let\unharmedreferenceprefix\referenceprefix
- \dodoifreferencefoundelse\secondaryreference
- \ifreferencefound
- \global\advance\nofsecondaryreferences \plusone
- #2%
- \else
- \dohandlenoto{#3}%
- \fi
- \egroup
- \ifnum\scratchcounter<\nofexpandedreferences\relax
- \advance\scratchcounter \plusone
- \repeat
- \fi \fi
- \fi
- \global\secondaryreferencefalse
- \xdef\primaryreference{\csname REF::1\endcsname}%
- % test: \global\letcscsname\secondaryreference\csname REF::1\endcsname
- \bgroup
- % now we handle the primary one
- %%\let\doifreferencefoundelse\localdoifreferencefoundelse
- \let\unharmedreferenceprefix\referenceprefix
- \dodoifreferencefoundelse\primaryreference
- \ifreferencefound#2\else#3\fi
- \egroup
- \doresetgotowhereever} % to prevent problems with direct goto's
-
-%D The following local redefinition permits the usage of
-%D nested \type {\doifreferencefoundelse}; see for an
-%D example the local test for file|/|url references. This is
-%D a fuzzy part of this mechanism and a result of the choice
-%D to let speed prevail over beauty in resolving chained
-%D references with symbolic (defined) references.
-
-\def\localdoifreferencefoundelse#1%
- {\dodoifreferencefoundelse{#1}%
- \ifreferencefound\@EA\firstoftwoarguments\else\@EA\secondoftwoarguments\fi}
-
-%D Somewhere else we will properly define \type {\dohandlegoto};
-%D the noto alternative takes care of undefined references in
-%D a sequence
-
-\ifx\dohandlenoto\undefined
-
- \def\dohandlenoto#1%
- {\ifsecondaryreference\else{#1}\fi}
-
-\fi
-
-\ifx\dohandlegoto\undefined
-
- \def\dohandlegoto#1#2#3%
- {\ifsecondaryreference\else{#1}\fi}
-
-\fi
-
-%D As one can see, while processing the references, the first
-%D one is handled last. While scanning the second and following
-%D ones, we increment a counter and set a boolean to true.
-
-%D The next fast one permits rather raw references with
-%D \type{()}'s and is used in the object reference mechanism.
-
-\def\doifrawreferencefoundelse#1#2#3%
- {\checkreferences
- \bgroup
- \edef\currentfullreference{#1}%
- \ifcsname\r!cross\currentfullreference\endcsname
- \getreferenceelements\currentfullreference
- \global\referencefoundtrue#2%
- \else
- \global\referencefoundfalse#3%
- \fi
- \egroup}
-
-%D The inner case is simple. Only two cases have to be taken
-%D care of:
-%D
-%D \starttyping
-%D \goto{some text}[reference]
-%D \goto{some text}[prefix:reference]
-%D \stoptyping
-
-\def\docheckinnerreference
- {\global\let\predefinedreference\currentinnerreference
- \ifx\currentreferencearguments\empty
- \ifcsname\r!cross\referenceprefix\currentfullreference\endcsname
- \global\referencefoundtrue
- \else
- \let\referenceprefix\empty
- \ifcsname\r!cross\currentfullreference\endcsname
- \global\referencefoundtrue
- \else
- \global\referencefoundfalse
- \fi
- \fi
- \else % [SomeThing{with,me}]
- \let\referenceprefix\empty
- \ifcsname\r!cross\currentinnerreference\endcsname
- \global\referencefoundtrue
- \else
- \global\referencefoundfalse
- \fi
- \fi
- \doifpredefinedreferenceelse{\global\referencefoundfalse}\donothing}
-
-%D References to other files however are treated strict or
-%D tolerant, depending on their loading and availability:
-%D
-%D \starttyping
-%D \useexternaldocument[somefile][filename][a nice description]
-%D
-%D \goto{checked reference}[somefile::reference]
-%D \goto{unchecked reference}[somefile::]
-%D \goto{unchecked reference}[anotherfile::reference]
-%D \stoptyping
-%D
-%D Here we use the dummy reference \type{somefile::} set in
-%D \type{\setouterreference} as a signal that indeed references
-%D are defined for the outer file.
-
-\newif\ifstrictouterreferences \strictouterreferencesfalse
-
-\def\dodocheckouterreference
- {\ifcsname\specialREFidentifier\currentfullreference\endcsname
- \@EA\@EA\@EA\splitofffullreference\@EA\@EA\@EA % 1 level
- {\csname\specialREFidentifier\currentfullreference\endcsname}%
- \docheckouterreference
- \else\ifstrictouterreferences
- \global\referencefoundfalse
- \else
- % already \global\referencefoundtrue % no checking done
- \fi\fi}
-
-\def\docheckouterreference
- {\let\referenceprefix\empty
- \let\unharmedreferenceprefix\empty
- \xdef\predefinedreference
- {\currentouterreference::\currentinnerreference}%
- \ifx\innerreference\empty
- \global\referencefoundtrue % no checking done
- \else
- \ifcsname\r!cross\currentouterreference::\endcsname
- \ifcsname\r!cross\currentfullreference\endcsname
- \global\referencefoundtrue
- \else
- \dodocheckouterreference
- \fi
- \else
- \ifstrictouterreferences
- \global\referencefoundfalse
- \else
- \global\referencefoundtrue % no checking done
- \fi
- \fi
- \fi
- \doifpredefinedreferenceelse{\global\referencefoundfalse}\donothing}
-
-%D Special references are only tested when some test routine is
-%D defined.
-
-\def\docheckspecialreference
- {\let\referenceprefix\empty
- \let\unharmedreferenceprefix\empty
- \xdef\predefinedreference
- {\currentreferencespecial::\currentreferenceoperation}%
- \executeifdefined{\s!do:\v!test:\currentreferencespecial}%
- {\global\referencefoundtrue\gobbletwoarguments}%
- {\global\referencefoundtrue}{\global\referencefoundfalse}%
- \doifpredefinedreferenceelse{\global\referencefoundfalse}\donothing}
-
-%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\predefinedreference
- \showmessage\m!references{#1}{[\unharmedreferenceprefix][#2]}}%
- \egroup}
-
-\def\unknownreference{\reportreferenceerror1}
-\def\illegalreference{\reportreferenceerror4}
-
-%D Although not actually needed, we default the unharmed
-%D reference prefix to the normal one.
-
-\def\unharmedreferenceprefix{\referenceprefix}
-
-%D When a reference is not found, we typeset a placeholder
-%D (two glyphs are often enough to represent the reference
-%D text).
-
-\def\dummyreference{{\tttf ??}}
-
-%D To prevent repetitive messages concerning a reference
-%D being defined, we set such an unknown reference to an empty
-%D one after the first encounter.
-
-\let\predefinedreference\s!unknown
-
-% 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\dummypredefinedreference{\rt!done{}{}{}{}}
-
-%D Testing on existance then becomes:
-
-\def\doifpredefinedreferenceelse % \referenceprefix added
- {\@EA\ifx\csname\r!cross\referenceprefix\predefinedreference\endcsname\dummypredefinedreference
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-%D Sometimes we want to temporary put a reference out of
-%D order. An example can be found in the menu macros.
-%D
-%D \starttyping
-%D \doifreferencepermittedelse{reference}{set}{true}{false}
-%D \stoptyping
-%D
-%D The second argument can be a comma seperated list.
-
-\let\permittedreferences\empty
-
-\def\doifreferencepermittedelse#1#2#3% ref found notfound
- {\doifreferencefoundelse{#1}
- {\donetrue
- \ifx\permittedreferences\empty \else
- \docheckifreferencepermitted{#1}%
- \fi
- \ifdone#2\else#3\fi}
- {#3\unknownreference{#1}}}
-
-\def\docheckifreferencepermitted#1%
- {\ifx\currentinnerreference\empty
- \ifx\currentouterreference\empty \else
- \doifinstring{\currentouterreference::}\permittedreferences\donefalse
- \fi
- \else\ifx\currentouterreference\empty
- \doifinstring{\currentinnerreference}\permittedreferences\donefalse
- \else
- \doifinstring{\currentouterreference::\currentinnerreference}\permittedreferences\donefalse
- \fi\fi}
-
-%D Apart from cross references supplied by the user, \CONTEXT\
-%D generates cross references itself. Most of them are not
-%D saved as a reference, but stored with their source, for
-%D instance a list or an index entry. Such automatically
-%D generated, for the user invisible, references are called
-%D {\em internal references}. The user supplied ones are
-%D labeled as {\em external references}.
-%D
-%D A second important characteristic is that when we want to
-%D support different backends (viewers), we need to support
-%D named destinations as well as page numbers. I invite readers
-%D to take a glance at the special driver modules to understand
-%D the fine points of this. As a result we will deal with {\em
-%D locations} as well as {\em real page numbers}. We explictly
-%D call this pagenumber a real one, because it is independant
-%D of the page numbering scheme used in the document.
-%D
-%D One of the reasons for \CONTEXT\ being the first \TEX\ base
-%D macropackage to support sophisticated interactive \PDF\
-%D files, lays in the mere fact that real page numbers are
-%D available in most two pass data, like references, list data
-%D and index entries.
-%D
-%D We will speak of \type{thisis...} when we are marking a
-%D location, and \type{goto...} when we point to such a
-%D location. The latter one can be seen as a hyperlink to the
-%D former one. In the next macros one we use constructs like:
-%D
-%D \starttyping
-%D \dostart...
-%D \dostop...
-%D \stoptyping
-%D
-%D Such macros are used to invoke the relevant specials from
-%D the special driver modules (see \type{spec-ini}). The flag
-%D \type{\iflocation} signals if we're in interactive mode.
-
-\def\thisisdestination#1% destination
- {\iflocation \ifusepagedestinations \else
- \dostartthisislocation{#1}\dostopthisislocation
- \fi \fi}
-
-\def\thisisrealpage#1% pagenumber
- {\iflocation
- \dostartthisisrealpage{#1}\dostopthisisrealpage
- \fi}
-
-%D The previous tho macros were easy ones, opposite to their
-%D counterparts. A common component in these is:
-%D
-%D \starttyping
-%D \dohandlegoto{..}{..}{..}
-%D \stoptyping
-%D
-%D Here data can be whatever needs highlighting, e.g. {\em
-%D figure 2.4}, and the start and stop entries handle the
-%D specials. The two \DIMENSIONS\ \type{\buttonwidth} and
-%D \type{\buttonheight} have to be set when handling the
-%D data~(\type{#2}).
-
-\ifx\buttonheight\undefined \newdimen\buttonheight \fi
-\ifx\buttonwidth \undefined \newdimen\buttonwidth \fi
-
-\def\gotodestination#1#2#3#4#5% url file destination page data
- {\iflocation
- \ifusepagedestinations
- \gotorealpage{#1}{#2}{\number#4}{#5}%
- \else
- \dohandlegoto
- {#5}%
- {\the\everyreference\dostartgotolocation\buttonwidth\buttonheight{#1}{#2}{#3}{\number#4}}%
- {\dostopgotolocation}%
- \fi
- \else
- {#5}%
- \fi}
-
-\def\gotorealpage#1#2#3#4% url file page data
- {\iflocation
- \dohandlegoto
- {#4}%
- {\dostartgotorealpage\buttonwidth\buttonheight{#1}{#2}{\number#3}}%
- {\dostopgotorealpage}%
- \else
- {#4}%
- \fi}
-
-%D \macros
-%D {setreferencefilename}
-%D
-%D This command can be used in the special drivers to
-%D uppercase filenames. This is needed when one wants to
-%D produce \CDROM's conforming to ISO9660. We consider is the
-%D savest to enable this feature by default. We cannot handle
-%D uppercase here, since the suffix is handled in the special
-%D driver. Conversion is taken care of by:
-%D
-%D \starttyping
-%D \setreferencefilename somefilename\to\SomeFileName
-%D \stoptyping
-
-% \def\setreferencefilename#1\to#2%
-% {\doifelse{\@@converteerfile}{\v!ja} % boolean is sneller
-% {\uppercasestring#1\to#2}
-% {\edef#2{#1}}}
-
-\chardef\referencefilecase=0
-
-\def\setreferencefilename#1\to#2%
- {\ifcase\referencefilecase
- \edef#2{#1}%
- \or
- \uppercasestring#1\to#2%
- \or
- \lowercasestring#1\to#2%
- \else
- \edef#2{#1}%
- \fi}
-
-%D Internal references can best be set using the next few
-%D macros. Setting such references to unique values is
-%D completely up to the macros that call them.
-%D
-%D \starttyping
-%D \thisissomeinternal{tag}{identifier}
-%D \gotosomeinternal {tag}{identifier}{pagenumber}{text}
-%D \stoptyping
-
-\def\thisissomeinternal#1#2% tag reference
- {\doifsomething{#2}{\thisisdestination{#1:#2}}}
-
-\def\gotosomeinternal#1#2% #3#4
- {\gotodestination\empty\empty{#1:#2}}
-
-%D An automatic mechanism is provided too:
-%D
-%D \starttyping
-%D \thisisnextinternal{tag}
-%D \gotonextinternal {tag}{number}{pagenumber}{text}
-%D \stoptyping
-%D
-%D The first macro increments a counter. The value of this
-%D counter is available in the macro \type{\nextinternalreference}
-%D and should be saved somewhere (for instance in a file) for
-%D future reference. The second argument of
-%D \type {\gotonextinternal} takes such a saved number. One can
-%D turn on tracing these references, in which case the
-%D references are a bit more verbose.
-
-\newcount\locationcount
-
-\newif\iftraceinternalreferences
-\newif\ifinternalnamedreferences \internalnamedreferencestrue
-
-\def\nextinternalreference
- {\the\locationcount}
-
-\def\thisisnextinternal#1%
- {\global\advance\locationcount \plusone
- \ifinternalnamedreferences
- \thisisdestination{\s!aut\iftraceinternalreferences:#1\fi:\nextinternalreference}%
- \fi}
-
-% beter:
-%
-% \def\thisisnextinternal#1%
-% {\iftrialtypesetting\else
-% \global\advance\locationcount \plusone
-% \ifinternalnamedreferences
-% \thisisdestination{\s!aut\iftraceinternalreferences:#1\fi:\nextinternalreference}%
-% \fi
-% \fi}
-
-\def\gotonextinternal#1#2#3#4%
- {\ifinternalnamedreferences
- \gotodestination\empty\empty{\s!aut\iftraceinternalreferences:#1\fi:#2}{#3}{#4}%
- \else
- \gotorealpage\empty\empty{#3}{#4}%
- \fi}
-
-%D We already went through a lot of problems to sort out what
-%D kind of reference we're dealing with. Sorting out the user
-%D supplied cross references (show/goto this or that) as well
-%D as user supplied system references (invoke this or that) is
-%D already taken care of in the test routine, but we still have
-%D to direct the request to the right (first) routine.
-
-\def\gotolocation% #1#2%
- {\ifx\currentreferencespecial\empty
- \ifx\currentouterreference\empty
- \ifnum\currentreferencetype<2
- \@EA\@EAEAEA\@EA\gotoinnerlocation
- \else
- \@EA\@EAEAEA\@EA\gotosystemlocation
- \fi
- \else
- \@EAEAEA\gotoouterlocation
- \fi
- \else
- \@EA\gotospeciallocation
- \fi} % {#1}{#2}
-
-%D An inner reference refers to some place in the document
-%D itself.
-
-\def\gotoinnerlocation#1% #2%
- {\gotodestination\empty\empty
- {\referenceprefix\currentinnerreference}\currentrealreference} % {#2}
-
-%D The outer location refers to another document, specified as
-%D file or \URL.
-
-\def\gotoouterlocation#1#2% % page checken!
- {\bgroup
- \let\referenceprefix\empty
- \setouterlocation\currentouterreference
- \ifx\currentinnerreference\empty
- \gotorealpage
- \otherURL\otherfile1{#2}%
- \else
- \gotodestination
- \otherURL\otherfile\currentinnerreference\currentrealreference{#2}%
- \fi
- \egroup}
-
-%D Special locations are those that are accessed by saying
-%D things like:
-%D
-%D \starttyping
-%D \goto{calculate total}[JS(summarize{10,23,56}]
-%D \stoptyping
-%D
-%D After several intermediate steps this finally arrives at
-%D the next macro and expands into (simplified):
-%D
-%D \starttyping
-%D \gotoJSlocation{total{summarize{10,23,56}}}{calculate total}
-%D \stoptyping
-%D
-%D The first argument is the full reference, the second one
-%D is the text, in some kind of manipulated form. In practice
-%D we split references, so we get:
-%D
-%D \starttyping
-%D \gotoJSlocation{summarize{10,23,56}}{calculate}
-%D \gotoJSlocation{summarize{10,23,56}}{total}
-%D \stoptyping
-%D
-%D where \type{calculate} and \type{total} are colored, boxed
-%D or whatever \type{\goto} is told to do.
-%D
-%D The macro \type{\gotoJSlocation} can use \type
-%D {\currentreferenceoperation} (in our example
-%D \type{summarize}) and \type{\currentreference} (here
-%D being \type {10,23,56}) to perform its task.
-
-\def\gotospeciallocation
- {\executeifdefined{goto\currentreferencespecial location}\gobbleoneargument}
-
-%D Such special macros can be defined by:
-
-\def\definespeciallocation#1%
- {\setvalue{goto#1location}}
-
-%D The associated test is to be defined by:
-
-\def\definespecialtest#1%
- {\setvalue{\s!do:\v!test:#1}}
-
-%D This \type{\def} alike macro is to be used as:
-%D
-%D \starttyping
-%D \definespeciallocation{JS}#1#2{... #1 ... #2 ...}
-%D \stoptyping
-%D
-%D In module \type {java-ini} one can see that \type
-%D {\gotoJSlocation} looks much like the previous goto
-%D definitions.
-
-%D A system location is not always a location, but for the
-%D consistency we also consider actions as such.
-
-\def\gotosystemlocation
- {\csname\r!syst\the\currentreferencetype\endcsname}
-
-\def\definesystemreferencehandler#1#2%
- {\setgvalue{\r!syst\the#1}{#2}}
-
-%D In this module we define three system references: one for
-%D handling navigational, viewer specific, commands, another
-%D for jumping to special pages, like the first or last one,
-%D and a third reference for linking tree like lists, like
-%D tables of contents. The latter two adapt themselves to the
-%D current state.
-
-\definesystemreferencehandler \rt!exec \handleexecreference
-\definesystemreferencehandler \rt!page \handlepagereference
-\definesystemreferencehandler \rt!list \handlelistreference
-
-\def\handleexecreference#1%
- {\checkexecutecommand\currentdatareference\currentreferencearguments
- \executecommand\currentdatareference\currentreferencearguments}
-
-\def\handlepagereference#1%
- {\gotorealpage\empty\empty\currentdatareference}
-
-\def\handlelistreference#1% is deze nog echt nodig?
- {\gotodestination\empty\empty\currentdatareference{\getvalue{\currentdatareference}}}
-
-%D \macros
-%D {setexecutecommandcheck}
-%D
-%D In case a command action needs to do some checking in
-%D advance, one can assign an check function by:
-%D
-%D \starttyping
-%D \setexecutecommandcheck{startsound}\checksoundtrack
-%D \stoptyping
-
-\def\setexecutecommandcheck#1#2% #2 permits \first \second
- {\setvalue{\s!do:\s!do:#1}{#2}}
-
-\def\checkexecutecommand#1#2% evt geen #1 en #2
- {\ifx#2\empty \else \ifcsname\s!do:\s!do:#1\endcsname
- \@EA\let\@EA\docheckexecutecommand\csname\s!do:\s!do:#1\endcsname
- \rawprocesscommalist[#2]\docheckexecutecommand
- \fi \fi }
-
-%D Command references (in dutch, english, german of
-%D whatever interface language) are translated into a bit
-%D shorter reference (\type{close}) and passed to the
-%D special driver (using \type{\executecommand}).
-
-% better: [action(name)] and \definereference[name][action(name)]
-
-\setglobalsystemreference \rt!exec \v!CloseDocument {close}
-\setglobalsystemreference \rt!exec \v!ExitViewer {exit}
-\setglobalsystemreference \rt!exec \v!FirstPage {first}
-\setglobalsystemreference \rt!exec \v!LastPage {last}
-\setglobalsystemreference \rt!exec \v!NextJump {forward}
-\setglobalsystemreference \rt!exec \v!NextPage {next}
-\setglobalsystemreference \rt!exec \v!PauseMovie {pausemovie}
-\setglobalsystemreference \rt!exec \v!PauseSound {pausesound}
-\setglobalsystemreference \rt!exec \v!PauseRendering {pauserendering}
-\setglobalsystemreference \rt!exec \v!PreviousJump {backward}
-\setglobalsystemreference \rt!exec \v!PreviousPage {previous}
-\setglobalsystemreference \rt!exec \v!PrintDocument {print}
-\setglobalsystemreference \rt!exec \v!SaveForm {exportform}
-\setglobalsystemreference \rt!exec \v!LoadForm {importform}
-\setglobalsystemreference \rt!exec \v!ResetForm {resetform}
-\setglobalsystemreference \rt!exec \v!ResumeMovie {resumemovie}
-\setglobalsystemreference \rt!exec \v!ResumeSound {resumesound}
-\setglobalsystemreference \rt!exec \v!ResumeRendering {resumerendering}
-\setglobalsystemreference \rt!exec \v!SaveDocument {save}
-\setglobalsystemreference \rt!exec \v!SaveNamedDocument{savenamed}
-\setglobalsystemreference \rt!exec \v!OpenNamedDocument{opennamed}
-\setglobalsystemreference \rt!exec \v!SearchDocument {search}
-\setglobalsystemreference \rt!exec \v!SearchAgain {searchagain}
-\setglobalsystemreference \rt!exec \v!StartMovie {startmovie}
-\setglobalsystemreference \rt!exec \v!StartSound {startsound}
-\setglobalsystemreference \rt!exec \v!StartRendering {startrendering}
-\setglobalsystemreference \rt!exec \v!StopMovie {stopmovie}
-\setglobalsystemreference \rt!exec \v!StopSound {stopsound}
-\setglobalsystemreference \rt!exec \v!StopRendering {stoprendering}
-\setglobalsystemreference \rt!exec \v!SubmitForm {submitform}
-\setglobalsystemreference \rt!exec \v!ToggleViewer {toggle}
-\setglobalsystemreference \rt!exec \v!ViewerHelp {help}
-\setglobalsystemreference \rt!exec \v!HideField {hide}
-\setglobalsystemreference \rt!exec \v!ShowField {show}
-\setglobalsystemreference \rt!exec \v!GotoPage {gotopage}
-\setglobalsystemreference \rt!exec \v!GotoPage {gotopage}
-\setglobalsystemreference \rt!exec \v!Query {query}
-\setglobalsystemreference \rt!exec \v!QueryAgain {queryagain}
-\setglobalsystemreference \rt!exec \v!FitWidth {fitwidth}
-\setglobalsystemreference \rt!exec \v!FitHeight {fitheight}
-
-\setglobalsystemreference \rt!exec \v!ShowThumbs {thumbnails}
-\setglobalsystemreference \rt!exec \v!ShowBookmarks {bookmarks}
-
-%D Executing the command looks alike the previous goto macros.
-
-\def\executecommand#1#2#3%
- {\iflocation
- \dohandlegoto
- {#3}%
- {\dostartexecutecommand\buttonwidth\buttonheight{#1}{#2}}%
- {\dostopexecutecommand}%
- \else
- {#3}%
- \fi}
-
-%D We could have done without the short tags and thereby saving
-%D some tokens, but the current approach leaves room for future
-%D extensions.
-
-%D It is possible to disable the writing of references to the
-%D utility file by setting:
-
-\newif\ifreferencing \referencingtrue
-
-%D One can also activate an automatic prefix mechanism. By
-%D setting the \type{\prefix} variable to \type{+}, the prefix
-%D is incremented, when set to \type{-} or empty, the prefix is
-%D reset. Other values become the prefix.
-
-\newcount\prefixcounter
-
-%D These settings are accomplished by:
-%D
-%D \showsetup{setupreferencing}
-%D
-%D In interactive documents verbose references don't always
-%D make sense (what is a page number in an unnumbered
-%D document). By setting the \type{interaction} variable, one
-%D can influences the way interactive references are set.
-
-% \newif\ifreferencestrut % some day an option
-
-\def\setupreferencing
- {\dosingleargument\dosetupreferencing}
-
-\def\dosetupreferencing[#1]%
- {\getparameters
- [\??rf]
- [\c!prefix=\s!unknown,#1]%
- \processaction
- [\@@rfstate]
- [ \v!stop=>\referencingfalse,
- \v!start=>\referencingtrue]%
- \processaction
- [\@@rfinteraction]
- [ \v!all=>\let\dowantedreference\docompletereference,
- \v!label=>\let\dowantedreference\dolabelonlyreference,
- \v!text=>\let\dowantedreference\dotextonlyreference,
- \v!symbol=>\let\dowantedreference\dosymbolreference]%
- \chardef\autocrossfilereferences\zerocount
- \processaction
- [\@@rfautofile]
- [ \v!yes=>\chardef\autocrossfilereferences\plusone,
- \v!page=>\chardef\autocrossfilereferences\plustwo]%
- \chardef\referencefilecase\zerocount
- \processaction[\@@rfconvertfile]
- [ \v!yes=>\chardef\referencefilecase\plusone,
- \v!big=>\chardef\referencefilecase\plusone,
- \v!small=>\chardef\referencefilecase\plustwo]%
- %\doifelse\@@rfstrut\v!yes % some day an option
- % \referencetruttrue\referencestrutfalse
- \setupreferenceprefix[\@@rfprefix]%
- \doifelse\@@rfglobal\v!yes
- {\settrue \autoglobalfilereferences}
- {\setfalse\autoglobalfilereferences}}
-
-\def\incrementreferenceprefix{+}
-\def\decrementreferenceprefix{-}
-
-\def\setupreferenceprefix[#1]%
- {\edef\@@rfprefix{#1}%
- \ifx\@@rfprefix\empty
- \let\referenceprefix\empty
- \else\ifx\@@rfprefix\incrementreferenceprefix
- \advance\prefixcounter \plusone % should be global
- \edef\referenceprefix{\the\prefixcounter:}%
- \let\@@rfprefix\s!unknown
- \else\ifx\@@rfprefix\decrementreferenceprefix
- \let\referenceprefix\empty
- \let\@@rfprefix\s!unknown
- \else\ifx\@@rfprefix\s!unknown
- % forget about it
- \else
- \edef\referenceprefix{\@@rfprefix:}%
- \fi\fi\fi\fi}
-
-%D \macros
-%D {handlereferenceactions,
-%D collectreferenceactions}
-%D
-%D Sometimes we need to pass the actions connected to
-%D references to variables instead of rectangular areas on
-%D which one can click. The next macro collects the actions
-%D and passes them to a handle. This is a rather dreadfull
-%D hack!
-%D
-%D \starttyping
-%D \handlereferenceactions{references}\handle
-%D \stoptyping
-%D
-%D So, \type {\handle} does the final job, which in for
-%D instance the \PDF\ drivers comes down to doing something
-%D with \type {\lastPDFaction}.
-
-\newif\ifcollectreferenceactions
-
-\def\handlereferenceactions#1#2%
- {\doifsomething{#1}
- {\bgroup
- \collectreferenceactionstrue
- \@EA\doifreferencefoundelse\@EA{#1}
- {\gotolocation{#1}{}\ifsecondaryreference\else#2\fi}
- {\unknownreference{#1}}%
- \egroup}}
-
-%D The most straightforward way of retrieving references is
-%D using \type{\ref}. Consider the reference:
-%D
-%D \startbuffer
-%D \reference[my ref]{{Look}{Here}{I am}}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \getbuffer
-%D
-%D We can ask for upto five reference components:
-%D
-%D \startbuffer
-%D user page reference: \ref[p][my ref]
-%D text reference: \ref[t][my ref]
-%D real page reference: \ref[r][my ref]
-%D sub text reference: \ref[s][my ref]
-%D extra text reference: \ref[e][my ref]
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D And get back:
-%D
-%D \startlines
-%D \getbuffer
-%D \stoplines
-
-\def\ref{\dodoubleargument\doref}
-
-\def\reftypep{\currentpagereference}
-\def\reftypet{\currenttextreference}
-\def\reftyper{\currentrealreference}
-\def\reftypes{\currentsubtextreference}
-\def\reftypee{\currentsubsubtextreference}
-
-\def\doref[#1][#2]%
- {\ifsecondargument
- \doifreferencefoundelse{#2}
- {\executeifdefined{reftype#1}\reftypep}
- {\unknownreference{#2}\dummyreference}%
- \else
- \dummyreference
- \fi}
-
-%D We can typeset a reference using \type{\in}, \type{\at} and
-%D \type{\about} and goto specific locations using
-%D \type{\goto}. The last one does not make that much sense in
-%D a paper document. To complicate things, \PLAIN\ \TEX\ also
-%D implements an \type {\in} but fortunately that one only
-%D makes sense in math mode.
-
-%D --- VANAF HIER NOG VERENGELSEN ---
-
-%\let\donormalin =\in
-%\let\donormalover=\over % about/oppassen beter nederlands dan engels!
-%
-%\def\in%
-% {\ifmmode
-% \expandafter\donormalin
-% \else
-% \expandafter\doinatreference\expandafter\currenttextreference
-% \fi}
-
-% we need to bypass math tokens
-
-% \let\normalover \over
-
-\definecommand in {\dospecialin}
-\definecommand at {\dospecialat}
-\definecommand about {\dospecialabout}
-\definecommand from {\dospecialfrom}
-\definecommand over {\dospecialabout} % needed here, else math problems
-
-\unexpanded\def\dospecialin{\doinatreference\currenttextreference}
-\unexpanded\def\dospecialat{\doinatreference\currentpagereference}
-
-\unexpanded\def\dospecialabout[#1]%
- {\dontleavehmode
- \bgroup
- \def\thecurrentsubtextreference
- {\limitatetext\currentsubtextreference\@@rfwidth\unknown}%
- %\leaveoutervmode % no
- \@@rfleft
- \doifreferencefoundelse{#1}
- {\let\crlf\space
- \let\\\space
- \let\dogotofixed\dogotospace
- \dogotospace{\thecurrentsubtextreference}[#1]}
- {\unknownreference{#1}\dummyreference}%
- \@@rfright
- \referenceinfo{<}{#1}%
- \egroup}
-
-%D Typesetting the reference is a bit more complicated than one
-%D would at first sight expect. This is due to the fact that we
-%D distinguish three (five) alternative calls:
-%D
-%D \placefigure
-%D [here][three calls]
-%D {Three alternatives reference calls.}
-%D {\startcombination[1*3]
-%D {\framed{\type{ \in }}} {a}
-%D {\framed{\type{ \at }}} {b}
-%D {\framed{\type{\goto}}} {c}
-%D \stopcombination}
-%D
-%D \startbuffer
-%D \in figure[fig:three calls]
-%D \in{figure}[fig:three calls]
-%D \in figure a[fig:three calls]
-%D \in{figure}{a}[fig:three calls]
-%D figure~\in[fig:three calls]
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D This turns up as:
-%D
-%D \startlines
-%D \getbuffer
-%D \stoplines
-%D
-%D The dual \type{{}} results in a split reference. In a
-%D document meant for paper, one is tempted to use the last
-%D (most straightforward) alternative. When a document is also
-%D meant voor electronic distribution, the former alternatives
-%D have preference, because everything between the \type{\in}
-%D and~\type{[} becomes active (and when asked for, typeset
-%D in a different color and typeface).
-
-\def\doinatreference#1%
- {\doifnextoptionalelse{\dodoinatreference{#1}{}}{\dodoinatreference{#1}}}
-
-\def\dodoinatreference#1%
- {\def\dododoinatreference{\dodododoinatreference{#1}}%
- \futurelet\next\dododoinatreference}
-
-% overloaded
-%
-% \def\dodododoinatreference#1#2#3[#4]%
-% {\ifx\next\bgroup
-% \dododododoinatreference{#1\ignorespaces#3}{#2}[#4]%
-% \else
-% \dododododoinatreference{#1}{#2#3}[#4]%
-% \fi}
-
-%D We arrived at the last step. Before we do the typesetting,
-%D we forget all previous (paragraph bound) settings and make
-%D sure that we remain in horizontal mode. Next we choose
-%D among the several representations.
-
-% overloaded
-%
-% \def\dododododoinatreference#1#2[#3]%
-% {\dontleavehmode
-% \bgroup
-% \forgetall
-% %\leaveoutervmode
-% \doifreferencefoundelse{#3}
-% {\bgroup
-% \let\ignorespaces\empty % rather dirty but ok
-% \doifelsenothing{#1}
-% {\egroup\dosymbolreference{#1}{#2}[#3]}
-% {\egroup\dowantedreference{#1}{#2}[#3]}}
-% {\dounknownreference{#1}{#2}[#3]}%
-% \referenceinfo{<}{#3}%
-% \egroup}
-
-%D The previously discussed setup macro lets us specify the
-%D representation of references. A symbol reference does not
-%D show the specific data, like the number of a figure, but
-%D shows one of: \hbox {$^\goforwardcharacter$
-%D $^\gobackwardcharacter$ $^\gonowherecharacter$}, depending
-%D on the direction to go.
-
-\def\dosymbolreference#1#2[#3]%
- {\bgroup
- \setupsymbolset[\@@iasymbolset]%
- \removelastskip
- \ifx\currentreferencespecial\empty
- \ifx\currentouterreference\empty
- \ifnum0\currentrealreference=\zerocount
- \ifhmode\strut\high{\symbol[\v!nowhere]}\fi
- \else\ifnum0\currentrealreference>\realpageno
- \dodosymbolreference{#2}{\high{\symbol[\v!next]}}%
- \else\ifnum0\currentrealreference<\realpageno
- \dodosymbolreference{#2}{\high{\symbol[\v!previous]}}%
- \else
- \ifhmode\strut\high{\symbol[\v!nowhere]}\fi
- \fi\fi\fi
- \else
- \gotoouterlocation{#3}{\showlocation{\high{\symbol[\v!somewhere]}}}%
- \fi
- \else
- \gotospeciallocation{#3}{\showlocation{\high{\symbol[\v!somewhere]}}}%
- \fi
- \egroup}
-
-\def\dodosymbolreference#1#2%
- {#1\hbox{\gotorealpage\empty\empty\currentrealreference
- {\dolocationattributes\??ia\c!style\c!color{#2}}}}
-
-%D The other alternatives just conform their names: only the
-%D label, only the text, or the label and the text.
-
-\def\dounknownreference#1#2[#3]%
- {\unknownreference{#3}\dotextprefix{#2}\dummyreference}%
-
-\def\docompletereference#1#2[#3]%
- {\iflocationsplit
- \doifsomespaceelse{#2}\dogotospace\dogotofixed{\dotextprefix{#2}#1}[#3]%
- \else
- \dogotofixed{\dotextprefix{#2}#1}[#3]%
- \fi}
-
-\def\dolabelonlyreference#1#2[#3]%
- {\doifsomespaceelse{#2}
- {\doifsomething{#2}{\dogotospace{#2}[#3]}}
- {\dogotofixed{\dotextprefix{#2}}[#3]}}
-
-\def\dotextonlyreference#1#2[#3]%
- {\dotextprefix{#2}\dogotofixed{#1}[#3]}
-
-\let\dowantedreference=\docompletereference
-
-%D \macros
-%D {definereferenceformat}
-%D
-%D The next few macros were made for for David Arnold and Taco
-%D Hoekwater. They can be used for predefining reference
-%D texts, and thereby stimulate efficiency.
-%D
-%D [more documentation will be added]
-%D
-%D \starttyping
-%D \definereferenceformat[informula] [left=(,right=),text=formula]
-%D \definereferenceformat[informulas] [left=(,right=),text=formulas]
-%D \definereferenceformat[andformula] [left=(,right=),text=and]
-%D \definereferenceformat[andformulas][left=(,right=),text=and]
-%D
-%D \informula [b] and \informula [for:c]
-%D the \informula {formulas}[b] \informula {and} [for:c]
-%D the \informulas {formulas}[b] \informula {and} [for:c]
-%D the \informulas [b] \informula {en} [for:c]
-%D the \informulas [b] \andformula [for:c]
-%D \stoptyping
-%D
-%D Instead of a text, one can specify a label, which should
-%D be defined with \type {\setuplabeltext}.
-
-\def\definereferenceformat%
- {\dodoubleargument\dodefinereferenceformat}
-
-\def\dodefinereferenceformat[#1][#2]%
- {\iffirstargument
- \getparameters[\??rf#1]
- [\c!left=, % of the number
- \c!right=, % of the number
- \c!text=, % before the number
- \c!label=, % can be {left}{right}
- \c!command=\in,
- #2]%
- \unexpanded\setvalue{#1}%
- {\dontleavehmode\doexecutereferenceformat{#1}}%
- \fi}
-
-\def\noexecutelabelreferenceformat#1%
- {\doifvaluesomething{\??rf#1\c!text}
- {\gdef\textofreference{\csname\??rf#1\c!text\endcsname}}%
- \csname\??rf#1\c!command\endcsname}
-
-\def\doexecutelabelreferenceformat#1%
- {\csname\??rf#1\c!command\endcsname
- {\leftlabeltext {\csname\??rf#1\c!label\endcsname}}%
- {\rightlabeltext{\csname\??rf#1\c!label\endcsname}}}
-
-\def\doexecutereferenceformat#1%
- {\gdef\leftofreference {\csname\??rf#1\c!left \endcsname}%
- \gdef\rightofreference{\csname\??rf#1\c!right\endcsname}%
- \global\let\textofreference\empty % otherwise ~ added
- \doifelsevaluenothing{\??rf#1\c!label}
- \noexecutelabelreferenceformat\doexecutelabelreferenceformat{#1}}
-
-\let\leftofreference \relax
-\let\rightofreference\relax
-\let\textofreference \relax
-
-\def\dodododoinatreference#1#2#3[#4]% \removeunwantedspaces added june 2004
- {\ifx\next\bgroup % but removed later, fails on metafun
- \dododododoinatreference
- % fails on metafun {\leftofreference#1\ignorespaces#3\removeunwantedspaces\rightofreference}{#2}[#4]%
- {\leftofreference#1\ignorespaces#3\rightofreference}{#2}[#4]%
- \else
- \dododododoinatreference
- {\leftofreference#1\rightofreference}{#2#3}[#4]%
- \fi}
-
-\def\dododododoinatreference#1#2[#3]%
- {\dontleavehmode % replaces \leaveoutervmode
- \bgroup
- \forgetall
- \postponenotes
- %\leaveoutervmode % replaced by \dontleavehmode
- \doifreferencefoundelse{#3}
- {\bgroup
- \let\ignorespaces \empty % rather dirty trick, but ok
- \let\leftofreference \empty % the same, again ok
- \let\rightofreference\empty % and once more
- \def\textofreference {#2}% % temporary value
- \ifx\textofreference\empty % simple expansion
- %\doifelsenothing{#1}
- % {\egroup\dosymbolreference{#1}{\textofreference}[#3]}
- % {\egroup\dowantedreference{#1}{\textofreference}[#3]}%
- \doifelsenothing{#1}%
- {\egroup\dosymbolreference}%
- {\egroup\dowantedreference}%
- {#1}{\textofreference}[#3]%
- \else
- %\doifelsenothing{#1}
- % {\egroup\dosymbolreference{#1}{#2}[#3]}
- % {\egroup\dowantedreference{#1}{#2}[#3]}%
- \doifelsenothing{#1}%
- {\egroup\dosymbolreference}%
- {\egroup\dowantedreference}%
- {#1}{#2}[#3]%
- \fi}
- {\dounknownreference{#1}{#2}[#3]}%
- \referenceinfo<{#3}%
- \global\let\leftofreference \empty
- \global\let\rightofreference\empty
- \global\let\textofreference \empty
- \egroup}
-
-%D In interactive documents going to a specific location is not
-%D bound to cross references. The \type{\goto} commands can be
-%D used to let users access another part of the document. In
-%D this respect, interactive tables of contents and registers
-%D can be considered goto's. Because in fact a \type{\goto} is
-%D just a reference without reference specific data, the
-%D previous macros are implemented using the goto
-%D functionality.
-%D
-%D \showsetup{goto}
-%D
-%D One important chaacteristic is that the first argument of
-%D \type{\goto} (and therefore \type{\at} and \type{\in} is
-%D split at spaces. This means that, although hyphenation is
-%D prevented, long references can cross line endings.
-
-
-\def\dogoto#1[#2]%
- {\dontleavehmode
- \bgroup
- \postponenotes
- \doifreferencefoundelse{#2}
- {\doifelsenothing{#1}
- {\dosymbolreference{}{}[#2]}
- {\dogotospace{#1}[#2]}}
- {\unknownreference{#2}#1\relax}% \relax catches lookahead
- \egroup
- \referenceinfo{<}{#2}}
-
-\unexpanded\def\goto#1#2%
- {\dogoto{#1}#2}
-
-\newif\ifsharesimilarreferences \sharesimilarreferencestrue
-\newcount\similarreference % 0=noppes 1=create/refer 2,3,..=refer
-
-\def\dogotospace#1[#2]%
- {\iflocationsplit
- \ifsecondaryreference\setbox0\hbox\fi % due to space insertion
- {\let\dogotospace\dogotofixed
- \iflocation
- \def\processisolatedword##1%
- {\ifisolatedwords\ifsharesimilarreferences
- \global\advance\similarreference \plusone
- \fi\fi
- \hbox{\gotolocation{#2}{##1\presetgoto}}}%
- \doattributes\??ia\c!style\c!color
- {\processisolatedwords{#1}\processisolatedword}%
- \else
- #1\relax % \relax prevents #1's next macros from gobbling \fi
- \fi}%
- \else
- \iflocation
- \doattributes\??ia\c!style\c!color
- {\gotolocation{#2}{#1\presetgoto}}%
- \else
- #1\relax % \relax prevents #1's next macros from gobbling \fi
- \fi
- \fi
- \global\similarreference\zerocount}
-
-\def\dogotofixed#1[#2]%
- {{\iflocation
- \hbox{\gotolocation{#2}{\doattributes\??ia\c!style\c!color
- {#1\presetgoto}}}%
- \else
- #1%
- \fi}}
-
-%D In case the auto split feature is not needed or even not
-%D even wanted, \type{\gotobox} can be used.
-
-%D --- NOG IN HANDLEIDING ---
-
-\unexpanded\def\gotobox#1[#2]%
- {\dontleavehmode
- \bgroup
- \locationstrutfalse
- %\leaveoutervmode
- \doifreferencefoundelse{#2}
- {\dogotofixed{#1}[#2]}
- {\hbox{\unknownreference{#2}#1}}%
- \referenceinfo{<}{#2}%
- \egroup}
-
-%D An reference to another document can be specified as a file
-%D or as an \URL. Both are handled by the same mechanism and
-%D can be issued by saying something like:
-%D
-%D \starttyping
-%D \goto[dictionary::the letter a]
-%D \stoptyping
-%D
-%D The macros that are responsible for handling these
-%D references, use the next six variables:
-
-\let\otherlabel = \empty
-\let\fileprefix = \empty
-\def\otherfile {\jobname}
-\let\otherURL = \empty
-\let\otherprefix = \empty
-\let\dowithdocdes = \empty
-
-%D One can imagine that many references to such a dictionary
-%D are made, so in most cases such a document reference in an
-%D indirect one.
-%D
-%D \showsetup{useexternaldocument}
-%D
-%D For example:
-%D
-%D \starttyping
-%D \useexternaldocument
-%D [dictionary][engldict]
-%D [The Famous English Dictionary]
-%D \stoptyping
-%D
-%D The next macro implements these relations, and also take
-%D care of loading the document specific references.
-
-\def\useexternaldocument%
- {\dotripleargument\douseexternaldocument}
-
-\def\douseexternaldocument[#1][#2][#3]%
- {\bgroup
- \ifsecondargument
- \doifelsenothing{#1}
- {\douseexternaldocument[#2][#2][#3]}
- {\doifelsenothing{#3}
- {\douseexternaldocument[#1][#2][#2]}
- {\doifsomething{#2}
- {\setgvalue{\v!file:::#1}{\doexternaldocument{}{#2}{#3}}% just \do
- \doif\@@rfstate\v!start
- {\doifparentfileelse{#2}
- {\showmessage\m!references{21}{#2}}
- {\dodouseexternaldocument{#1}{#2}}}}}}%
- \else
- \dodouseexternaldocument{#1}{#1}%
- \fi
- \egroup}
-
-\def\dodouseexternaldocument#1#2%
- {\bgroup % prevents wrong loading of \jobname
- \def\fileprefix{#1::}%
- \let\setglobalcrossreference\setoutercrossreference
- \usereferences[#2]%
- \egroup % when called nested
- \showmessage\m!references{21}{#2}}
-
-%D The \URL\ alternative takes four arguments:
-%D
-%D \showsetup{useURL}
-%D
-%D like:
-%D
-%D \starttyping
-%D \useURL
-%D [dictionary][http://www.publisher.com/public][engldict]
-%D [The Famous English Dictionary]
-%D \stoptyping
-%D
-%D Several specifications are possible:
-%D
-%D \starttyping
-%D \useURL [id] [url] [file] [description]
-%D \useURL [id] [url] [file]
-%D \useURL [id] [url]
-%D \stoptyping
-%D
-%D This time we don't load the references when no file is
-%D specified. This is logical when one keeps in mind that a
-%D valid \URL\ can also be a mail address.
-
-\def\useURL
- {\bgroup
- \protectlabels
- \catcode`\#=\@@other\catcode`\%=\@@other\catcode`\/=\@@other
- \catcode`\_=\@@other\catcode`\~=\@@other\catcode`\:=\@@other
- \dodoubleempty\douseURL}
-
-\def\douseURL[#1][#2]%
- {\egroup\doquadrupleempty\dodouseURL[#1][#2]}
-
-\let\useurl\useURL
-
-\def\dodouseURL[#1][#2][#3][#4]% to be redone: not too tricky redefs ad reuse
- {\iffirstargument
- \iffourthargument\setgvalue{\v!file:::#1}{\doexternaldocument{#2}{#3}{#4}}\else
- \ifthirdargument \setgvalue{\v!file:::#1}{\doexternalurl {#2}{#3}{#1}}\else
- \ifsecondargument\setgvalue{\v!file:::#1}{\doexternalurl {#2}{} {#1}}\fi\fi\fi
- \fi}
-
-\def\doexternalurl#1#2#3%
- {\bgroup
- \doifsomething\@@urstyle{\let\@@iastyle\@@urstyle\let\@@urstyle\empty}%
- \doifsomething\@@urcolor{\let\@@iacolor\@@urcolor\let\@@urcolor\empty}%
- \doexternaldocument{#1}{#2}{\url[#3]}%
- \egroup}
-
-\def\doifurldefinedelse #1{\doifdefinedelse{\v!file:::#1}}
-\def\doiffiledefinedelse#1{\doifdefinedelse{\v!file:::#1}}
-
-%D \macros
-%D {url,setupurl}
-%D
-%D We also have: \type{\url} for directly calling the
-%D description. So we can say:
-%D
-%D \starttyping
-%D \useURL [one] [http://www.test.nl]
-%D \useURL [two] [http://www.test.nl] [] [Some Site]
-%D
-%D \url[one] or \from[two] or \goto{Whatever Site}[URL(two)]
-%D \stoptyping
-%D
-%D An \URL\ can be set up with
-%D
-%D \showsetup{setupurl}
-
-\def\setupurl
- {\dodoubleargument\getparameters[\??ur]}
-
-\unexpanded\def\url[#1]% slow
- {\bgroup
- \processaction
- [\@@uralternative]
- [ \v!none=>\chardef\urlsplitmode\zerocount,
- \v!both=>\chardef\urlsplitmode\plusone,
- \v!after=>\chardef\urlsplitmode\plustwo,
- \v!before=>\chardef\urlsplitmode\plusthree]%
- \doifelse\@@urspace\v!yes
- {\setbetweenisolatedwords{\scratchskip\currentspaceskip\hskip\zeropoint\!!plus.2\scratchskip}}
- {\setbetweenisolatedwords\allowbreak}%
- \def\doexternaldocument##1##2##3{\hyphenatedurl{##1}}% awful hack
- \dostartattributes\??ur\c!style\c!color{}%
- \getvalue{\v!file:::#1}%
- \dostopattributes
- \egroup}
-
-%D This macro is hooked into a support macro, and thereby
-%D \URL's break ok, according to the setting of a switch,
-%D
-%D \startbuffer
-%D \useURL
-%D [test]
-%D [sentence_sentence%sentence#sentence~sentence/sentence//sentence:sentence.sentence]
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D Such an \URL\ is, depending on the settings, hyphenated as:
-%D
-%D \getbuffer
-%D
-%D \startlinecorrection
-%D \hbox to \hsize
-%D {\hss\en
-%D \setupreferencing[urlalternative=both]%
-%D \vbox{\hsize.25cm\hbox{\bf both}\prewordbreak\url[test]}%
-%D \hss
-%D \setupreferencing[urlalternative=before]%
-%D \vbox{\hsize.25cm\hbox{\bf before}\prewordbreak\url[test]}%
-%D \hss
-%D \setupreferencing[urlalternative=after]%
-%D \vbox{\hsize.25cm\hbox{\bf after}\prewordbreak\url[test]}%
-%D \hss}
-%D \stoplinecorrection
-%D
-%D By setting \type{urlspace=yes} one can get slightly better
-%D spacing when using very long \URL's.
-
-%D Many macro definitions ago we called for the auxiliary macro
-%D \type {\setouterlocation} and now is the time to define this
-%D one.
-
-\newconditional\forceURLlocation
-
-\def\setouterfilelocation#1#2#3%
- {\edef\otherURL{#1}%
- \edef\otherfile{#2}}%
-
-\def\setouterlocation#1%
- {\ifcsname\v!file:::#1\endcsname
- \let\doexternaldocument\setouterfilelocation % will change
- \let\doexternalurl \setouterfilelocation % will change
- \csname\v!file:::#1\endcsname
- \else
- \ifconditional\forceURLlocation
- \edef\otherURL{#1}%
- \let\otherfile\empty
- \else
- \let\otherURL\empty
- \edef\otherfile{#1}%
- \fi
- \fi
- \setfalse\forceURLlocation
- \doifparentfileelse\otherfile
- {\let\otherURL\empty
- \let\otherfile\empty
- \global\let\otherlabel\empty
- \let\otherprefix\empty}
- {\xdef\otherlabel{#1}%
- \edef\otherprefix{#1::}}}
-
-%D When defining the external source of information, one can
-%D also specify a suitable name (the last argument). This name
-%D can be called upon with:
-%D
-%D \showsetup{from}
-%D
-%D As can be expected, this macro used \type{\goto} to
-%D perform its task.
-
-\def\dospecialfrom % retest this one !
- {\dosingleempty\dodospecialfrom}
-
-\def\dodospecialfrom[#1]%
- {\dontleavehmode % added, but probably not needed
- \bgroup
- \protectlabels % needed for active french :'s
- \iffirstargument
- \edef\!!stringa{#1}%
- \doifincsnameelse{::}\!!stringa\donothing{\edef\!!stringa{#1::}}%
- \expanded{\redospecialfrom[\!!stringa]}%
- \else
- \expanded{\nodospecialfrom[\otherlabel]}%
- \fi
- \egroup}
-
-\def\redospecialfrom[#1::#2]%
- {\ifcsname\v!file:::#1\endcsname
- \def\doexternaldocument##1##2##3{\goto{##3}[#1::#2]}%
- \csname\v!file:::#1\endcsname
- \else
- \tttf[#1]%
- \fi}
-
-\def\nodospecialfrom[#1]%
- {\ifcsname\v!file:::#1\endcsname
- \def\doexternaldocument##1##2##3{##3}% different than ^
- \csname\v!file:::#1\endcsname
- \else
- \tttf[#1]%
- \fi}
-
-%D We also support:
-%D
-%D \starttyping
-%D \goto{some text}[file(identifier{location}]
-%D \stoptyping
-%D
-%D which is completely equivalent with
-%D
-%D \starttyping
-%D \goto{some text}[identifier::location]
-%D \stoptyping
-%D
-%D The fastest implementation would be:
-
-\definespecialtest\v!file {\setfalse\forceURLlocation\handlespecialFILEandURL}
-\definespecialtest\v!URL {\settrue \forceURLlocation\handlespecialFILEandURL}
-\definespecialtest\v!url {\settrue \forceURLlocation\handlespecialFILEandURL}
-
-\definespeciallocation\v!file{\setfalse\forceURLlocation\handlespecialallocationFILEandURL}
-\definespeciallocation\v!URL {\settrue \forceURLlocation\handlespecialallocationFILEandURL}
-\definespeciallocation\v!url {\settrue \forceURLlocation\handlespecialallocationFILEandURL}
-
-\def\handlespecialFILEandURL
- {\localdoifreferencefoundelse
- {\currentreferenceoperation::\currentreferencearguments}}
-
-\def\handlespecialallocationFILEandURL
- {\let\currentouterreference\currentreferenceoperation
- \let\currentinnerreference\currentreferencearguments
- \let\currentreferenceoperation\empty
- \let\currentreferencearguments\empty
- \gotoouterlocation}
-
-%D Now we have file references as special ones, it's rather
-%D logical to have the viewer specific ones available in a dual
-%D way too. At first glance we could do with:
-%D
-%D \starttyping
-%D \definespeciallocation\v!action
-%D {\getreferenceelements\currentreferenceoperation
-%D \handleexecreference}
-%D \stoptyping
-%D
-%D An better alternative, slower but error aware, is
-
-% \definespecialtest\v!actie
-% {\localdoifreferencefoundelse\currentreferenceoperation}
-
-\definespecialtest\v!action % rather ugly action(whatever{argument})
- {\expanded{\localdoifreferencefoundelse{\currentreferenceoperation
- \ifx\currentreferencearguments\empty\else{\currentreferencearguments}\fi}}}
-
-\definespeciallocation\v!action
- {\handleexecreference}
-
-%D So now we can say:
-%D
-%D \starttyping
-%D \goto{some action}[PreviousJump]
-%D \stoptyping
-%D
-%D as well as:
-%D
-%D \starttyping
-%D \goto{some text}[action(PreviousJump]
-%D \stoptyping
-
-%D A special case of references are those to programs. These,
-%D very system dependant references are implemented by abusing
-%D some of the previous macros.
-%D
-%D \showsetup{setupprograms}
-%D \showsetup{defineprogram}
-%D \showsetup{program}
-%D
-%D The latter gives access to the description of the program,
-%D being the last argument to the definition command.
-
-\def\setupprograms
- {\dodoubleargument\getparameters[\??pr]}
-
-\def\dodefineprogram[#1][#2][#3]%
- {\setgvalue{\v!program:::#1}{\doprogram{#2}{#3}}}
-
-\def\defineprogram
- {\dotripleargument\dodefineprogram}
-
-\def\program#1[#2]%
- {\bgroup
- \ifcsname\v!program:::#2\endcsname
- \def\doprogram##1##2{\goto{\doifelsenothing{#1}{##2}{#1}}[\v!program(#2)]}%
- \csname\v!program:::#2\endcsname
- \else
- {\tttf[#2]}%
- \fi
- \egroup}
-
-% needs an update: program(abc{arg})
-
-\definespeciallocation\v!program#1#2%
- {\bgroup
- \iflocation
- \ifcsname\v!program:::\currentreferenceoperation\endcsname
- \def\doprogram##1##2{\def\@@programfile{##1}}%
- \getvalue{\v!program:::\currentreferenceoperation}%
- \else
- \let\@@programfile\currentreferenceoperation
- \fi
- \defconvertedcommand\ascii\@@programfile
- \dohandlegoto
- {#2}%
- {\dostartrunprogram\buttonwidth\buttonheight{\@@prdirectory\ascii}\currentreferencearguments}%
- {\dostoprunprogram}%
- \else
- {#2}%
- \fi
- \egroup}
-
-%D As we can see, we directly use the special reference
-%D mechanism, which means that
-%D
-%D \starttyping
-%D \goto{some text}[program(name{args})]
-%D \stoptyping
-%D
-%D is valid.
-
-%D The next macro provides access to the actual pagenumbers.
-%D When documenting and sanitizing the original reference
-%D macros, I decided to keep the present meaning as well as to
-%D make this meaning available as a special reference method.
-%D So now one can use:
-%D
-%D \starttyping
-%D \gotopage{some text}[location]
-%D \gotopage{some text}[number]
-%D \gotopage{some text}[file::number]
-%D \stoptyping
-%D
-%D as well as:
-%D
-%D \starttyping
-%D \goto{some text}[page(location)]
-%D \goto{some text}[page(number)]
-%D \goto{some text}[file::page(number)]
-%D \stoptyping
-%D
-%D Here location is a keyword like \type{nextpage}.
-%D
-%D \showsetup{gotopage}
-
-\def\dodefinepage[#1][#2]%
- {\setvalue{\v!page:::#1}{#2}}
-
-\def\definepage
- {\dodoubleargument\dodefinepage}
-
-\definepage [\v!firstpage] [\firstpage]
-\definepage [\v!previouspage] [\prevpage]
-\definepage [\v!nextpage] [\nextpage]
-\definepage [\v!lastpage] [\lastpage]
-\definepage [\v!firstsubpage] [\firstsubpage]
-\definepage [\v!previoussubpage] [\prevsubpage]
-\definepage [\v!nextsubpage] [\nextsubpage]
-\definepage [\v!lastsubpage] [\lastsubpage]
-\definepage [\v!first] [\firstpage]
-\definepage [\v!previous] [\prevpage]
-\definepage [\v!next] [\nextpage]
-\definepage [\v!last] [\lastpage]
-\definepage [\v!first\v!sub] [\firstsubpage]
-\definepage [\v!previous\v!sub] [\prevsubpage]
-\definepage [\v!next\v!sub] [\nextsubpage]
-\definepage [\v!last\v!sub] [\lastsubpage]
-
-%D Because we combine both methods, we have to take care of
-%D the \type{file::page(n)} as well as \type{page(file::n)}.
-
-\definespeciallocation\v!page#1#2% page(n) page(+n) page(-n)
- {\iflocation
- \ifx\currentouterreference\empty
- \splitoffreference\currentreferenceoperation
- \else
- \let\currentinnerreference\currentreferenceoperation
- \fi
- \ifx\currentouterreference\empty
- \doifinstringelse+\currentinnerreference{\edef\currentinnerreference{\the\numexpr\realpageno\currentinnerreference}}
- {\doifinstring -\currentinnerreference{\edef\currentinnerreference{\the\numexpr\realpageno\currentinnerreference}}}%
- \doifnonzeropositiveelse\currentinnerreference\donothing{\edef\currentinnerreference{1}}%
- \docheckrealreferencepage\currentinnerreference % new
- \let\currentrealreference\currentinnerreference % handy to have this available
- \gotorealpage\empty\empty\currentinnerreference{#2}%
- \else
- \setouterlocation\currentouterreference
- \doifnonzeropositiveelse\currentinnerreference\donothing{\edef\currentinnerreference{\executeifdefined{\v!page:::\currentinnerreference}1}}%
- \gotorealpage\otherURL\otherfile\currentinnerreference{#2}%
- \fi
- \else
- {#2}%
- \fi}
-
-\def\gotopage#1[#2]%
- {\goto{#1}[\v!page(#2)]}
-
-%D A still very rudimentary|/|experimental forward|/|backward
-%D reference mechanism is provided by the macro \type{\atpage}:
-%D
-%D \starttyping
-%D ... \somewhere{backward text}{forward text}[someref] ...
-%D ... \atpage[someref] ...
-%D \stoptyping
-%D
-%D In future versions there will be more sophisticated
-
-%D support, also suitable for references to floating bodies.
-
-\unexpanded\def\somewhere#1#2#3[#4]% #3 gobbles space around #2
- {\dontleavehmode
- %\leaveoutervmode
- \doifreferencefoundelse{#4}
- {\ifforwardreference
- \doifelsenothing{#1}
- {\dosymbolreference{}{}[#4]}
- {\dogotospace{#1}[#4]}%
- \else
- \doifelsenothing{#2}
- {\dosymbolreference{}{}[#4]}
- {\dogotospace{#2}[#4]}%
- \fi}
- {\unknownreference{#4}#1/#2}%
- \referenceinfo{<}{#4}}
-
-\unexpanded\def\atpage[#1]%
- {\dontleavehmode
- %\leaveoutervmode
- \doifreferencefoundelse{#1}
- {\ifrealreferencepage
- \ifforwardreference
- \dogotofixed{\labeltext\v!hencefore}[#1]%
- \else
- \dogotofixed{\labeltext\v!hereafter}[#1]%
- \fi
- \else
- \dogotofixed{\labeltexts\v!atpage\currentpagereference}[#1]%
- \fi}
- {\unknownreference{#1}%
- \labeltexts\v!page\dummyreference}%
- \referenceinfo{<}{#1}}
-
-%D We can cross link documents by using:
-%D
-%D \showsetup{coupledocument}
-%D
-%D like:
-%D
-%D \starttyping
-%D \coupledocument[print][somefile][chapter,section]
-%D \stoptyping
-%D
-%D After which when applicable, we have available the
-%D references:
-%D
-%D \starttyping
-%D \goto{print version}[print::chapter]
-%D \stoptyping
-%D
-%D and alike. The title placement definition macros have a
-%D key \type{file}, which is interpreted as the file to jump
-%D to, that is, when one clicks on the title.
-
-\let\crossdocumentreferences\empty
-\let\crossdocumentelements\empty
-
-\newif\ifautocrossdocument
-
-\def\docoupledocument[#1][#2][#3][#4]% is this :/- safe ?
- {\ifthirdargument
- \begingroup
- \def\dolistelement##1##2##3##4##5##6% 2=aut 6=pag / 2 goes into text ref slot
- {\global\utilitydonetrue %{Watch the braces here below!}
- \setglobalcrossreference{{##1::\@@filterblocknumberpart[##5]}}{}{##6}{##2}}%
- \def\usereferences[##1]%
- %{\setbox0\vbox{\doutilities{#3}{##1}{#3}\relax\relax}}%
- {\startnointerference
- \doutilities{#3}{##1}{#3}\relax\relax
- \stopnointerference}%
- \douseexternaldocument[#1][#2][#4]%
- \doglobal\addtocommalist{#1}\crossdocumentreferences
- \def\docommand##1%
- {\letgvalue{\??rf##1\c!state}\v!start % for fast checking
- \doglobal\addtocommalist{##1}\crossdocumentelements}%
- \processcommalist[#3]\docommand
- \ifutilitydone
- \global\autocrossdocumenttrue
- \fi
- \endgroup
- \fi}
-
-\def\coupledocument
- {\doquadrupleempty\docoupledocument}
-
-%D --- STRANGE HERE, BETTER IN CORE-NAV ---
-
-\def\checkcontrastreference#1%
- {\ifnum\currentreferencetype=\rt!page\ifnum\currentdatareference=\realpageno
- \doifdefined{#1\c!contrastcolor}{\setevalue{#1\c!color}{\getvalue{#1\c!contrastcolor}}}%
- \fi\fi}
-
-\def\checkcontrastreference#1%
- {\ifnum\currentreferencetype=\rt!page\relax\ifnum\currentdatareference=\realpageno
- \copycsname#1\c!color\endcsname\csname#1\c!contrastcolor\endcsname
- \fi\fi}
-
-%D Buttons are just what their names says: things that can be
-%D clicked (pushed) on. They are similar to \type{\goto},
-%D except that the text argument is not interpreted.
-%D Furthermore one can apply anything to them that can be done
-%D with \type{\framed}.
-%D
-%D \startbuffer
-%D \button[width=3cm,height=1.5cm]{Exit}[ExitViewer]
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D gives
-%D
-%D \getbuffer
-%D
-%D This command is formally specified as:
-%D
-%D \showsetup{button}
-%D
-%D The characteristics can be set with:
-%D
-%D \showsetup{setupbuttons}
-
-\def\setupbuttons
- {\dodoubleargument\getparameters[\??bt]}
-
-\definecomplexorsimpleempty\button
-
-\def\complexbutton
- {\docomplexbutton\??bt}
-
-\presetlocalframed[\??bt]
-
-\long\def\docomplexbutton#1[#2]#3#4% get rid of possible space before [#4]
- {\dodocomplexbutton#1[#2]{#3}#4} % #4 == [
-
-\def\buttonframed{\dodoubleempty\localframed[\??bt]} % goodie
-
-\long\def\dodocomplexbutton#1[#2]#3[#4]% #3 can contain [] -> {#3} later
- {\bgroup
- \doifvalue{#1\c!state}\v!stop\locationfalse
- \iflocation
- \resetgoto
- \ConvertConstantAfter\doifelse{#3}\v!none\hphantom\hbox
- {\doifelsenothing{#4}
- {\setlocationboxnop#1[#2]{#3}[#4]}
- {\doifreferencefoundelse{#4}
- {\setlocationboxyes#1[#2]{#3}[#4]}
- {\unknownreference{#4}%
- \setlocationboxnop#1[#2]{#3}[#4]}}}%
- \fi
- \egroup}
-
-%D Interaction buttons, in fact a row of tiny buttons, are
-%D typically only used for navigational purposed. The next
-%D macro builds such a row based on a specification list.
-%D
-%D \startbuffer
-%D \interactionbuttons
-%D [width=\hsize][page,PreviousJump,ExitViewer]
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D gives
-%D
-%D \getbuffer
-%D
-%D Apart from individual entries, one can use \type{page} and
-%D \type {subpage} as shortcuts to their four associated buttons.
-%D The symbols are derived from the symbols linked to the
-%D entries.
-
-% does not work well with for instance SomeRef{whatever}
-
-\def\interactionbuttons
- {\dodoubleempty\dointeractionbuttons}
-
-\def\dointeractionbuttons[#1][#2]% er is een verdeel macro \horizontalfractions
- {\iflocation
- % BUG: fails when frame=off; best is to rewrite this macro
- \bgroup
- \doif\@@ibstate\v!stop\locationfalse
- \iflocation
- \ifsecondargument
- \setupinteractionbar[#1]%
- \checkinteractionbar{1.5em}\v!broad\!!zeropoint % brrrrr
- \setbox2\hbox
- {\localframed[\??ib][\c!background=]{\symbol[\@@iasymbolset][\v!previouspage]}}%
- \!!heighta\ht2 % needed because we default to nothing
- \setupinteractionbar[\c!strut=\v!no]%
- \setinteractionparameter\c!width\!!zeropoint
- \!!counta\zerocount % new, was 1
- \processallactionsinset
- [#2]
- [ \v!page=>\advance\!!counta 4,
- \v!subpage=>\advance\!!counta 4,
- \s!unknown=>\advance\!!counta 1]%
- \ifdim\@@ibwidth=\zeropoint
- \!!widtha2em
- \advance\!!widtha \@@ibdistance % new
- \!!widthb\!!counta\!!widtha
- \advance\!!widthb -\@@ibdistance % new
- \else
- \!!widtha\@@ibwidth
- \!!widthb\@@ibdistance % new
- \multiply\!!widthb \!!counta % new
- \advance\!!widthb -\@@ibdistance % new
- \advance\!!widtha -\!!widthb % new
- \divide\!!widtha \!!counta
- \!!widthb\@@ibwidth
- \fi
- \def\goto##1% clash ?
- {\setnostrut
- \edef\localreference{##1}%
- \expanded{\dodocomplexbutton\??ib[\c!height=\the\!!heighta,\c!width=\the\!!widtha]}%
- {\dontleavehmode\symbol[\@@iasymbolset][\localreference]}%
- [\localreference]%
- \hss}%
- \hbox to \!!widthb
- {\processallactionsinset
- [#2]
- [ \v!page=>\goto\v!firstpage
- \goto\v!nextpage
- \goto\v!previouspage
- \goto\v!lastpage,
- \v!subpage=>\goto\v!firstsubpage
- \goto\v!nextsubpage
- \goto\v!previoussubpage
- \goto\v!lastsubpage,
- \s!unknown=>\goto\commalistelement]%
- \unskip}%
- \else
- \interactionbuttons[][#1]%
- \fi
- \fi
- \egroup
- \fi}
-
-%D \macros
-%D {overlaybutton}
-%D
-%D For converience we provide:
-%D
-%D \starttyping
-%D \overlaybutton[reference]
-%D \stoptyping
-%D
-%D This command can be used to define overlays an/or can be
-%D used in the whatevertext areas, like:
-%D
-%D \starttyping
-%D \defineoverlay[PrevPage][\overlaybutton{PrevPage}]
-%D \setupbackgrounds[page][background=PrevPage]
-%D \setuptexttexts[\overlaybutton{NextPage}]
-%D \stoptyping
-%D
-%D For practical reasons, this macro accepts square brackets
-%D as well as braces.
-
-\definecomplexorsimple\overlaybutton
-
-\def\simpleoverlaybutton#1%
- {\complexoverlaybutton[#1]}
-
-\def\complexoverlaybutton[#1]%
- {\iflocation
- \doifreferencefoundelse{#1}
- {\overlayfakebox {#1}}
- {\unknownreference{#1}}%
- \fi}
-
-\def\overlayfakebox#1%
- {\hbox
- {\setbox\scratchbox\null
- \wd\scratchbox\overlaywidth
- \ht\scratchbox\overlayheight
- \locationstrutfalse
- \gotolocation{#1}{\box\scratchbox\presetgoto}}}
-
-%D \macros
-%D {dotextprefix}
-%D
-%D In previous macros we used \type {\dotextprefix} to
-%D generate a space between a label and a number.
-%D
-%D \starttyping
-%D \dotextprefix{text}
-%D \stoptyping
-%D
-%D Only when \type {text} is not empty, a space is inserted.
-
-\def\dotextprefix#1%
- {\bgroup
- \global\labeltextdonefalse % this is an ugly dependancy,
- \setbox\scratchbox\hbox{#1}% to be solved some day
- \ifdim\wd\scratchbox>\zeropoint
- \unhbox\scratchbox
- \iflabeltextdone\else\@@rfseparator\fi
- \else
- \unhbox\scratchbox
- \fi
- \egroup}
-
-%D Plugin code:
-
-%D In the next settings we see some variables that were not
-%D used here and that concern the way the pagenumbers refered
-%D to are typeset.
-
-\setupreferencing
- [\c!state=\v!start,
- \c!autofile=\v!no,
- \v!part\c!number=\v!yes,
- \v!chapter\c!number=\v!no,
- \c!interaction=\v!all,
- %\c!urlalternative=\v!both,
- %\c!urlspace=\v!no,
- %\c!urlletter=,
- %\c!urlkleur=,
- \c!convertfile=\v!no,
- %\c!strut=\v!no, % some day an option
- \c!prefix=,
- \c!width=.75\makeupwidth,
- \c!left=\quotation\bgroup,
- \c!right=\egroup,
- \c!global=\v!no,
- \c!expansion=\v!no,
- \c!separator=\nonbreakablespace]
-
-\setupurl
- [\c!alternative=\v!both,
- \c!space=\v!no,
- \c!style=\v!type,
- \c!color=]
-
-\setupprograms
- [\c!directory=]
-
-%D We cannot set up buttons (not yet, this one calls a menu macro):
-
-% under consideration:
-%
-% \setupinteraction[state=start]
-%
-% \unprotect
-%
-% \chardef\rt!extern=5
-%
-% \definesystemreferencehandler \rt!extern \handleexecreference
-%
-% \definespecialtest\v!extern
-% {\expanded{\localdoifreferencefoundelse{\currentreferenceoperation
-% \ifx\currentreferencearguments\empty\else{\currentreferencearguments}\fi}}}
-%
-% \definespeciallocation\v!extern
-% {\handleexecreference}
-%
-% \def\defineexternalreference[#1]%
-% {\setglobalsystemreference\rt!extern{#1}{#1}}
-%
-% \protect
-%
-% \defineexternalreference[NewOne]
-%
-% \def\PDFexecuteNewOne{/SomeNewAction /SomeParameter (\argumentA)}
-%
-% \starttext
-%
-% \goto{test}[AVDP{../../nach-dateipfad.pdf}]
-% \blank
-% \goto{test}[external(AVDP{../../nach-dateipfad.pdf})]
-% \blank
-% \goto{test}[AVDP{../../nach-dateipfad.pdf}]
-% \blank
-% \goto{test}[external(AVDP{../../nach-dateipfad.pdf})]
-% \blank
-% \goto{test}[CloseDocument]
-% \blank
-% \goto{test}[action(CloseDocument)]
-%
-% \stoptext
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/strc-reg.mkii b/Master/texmf-dist/tex/context/base/mkii/strc-reg.mkii
deleted file mode 100644
index a8d05fb7862..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/strc-reg.mkii
+++ /dev/null
@@ -1,1243 +0,0 @@
-%D \module
-%D [ file=strc-reg,
-%D version=1999.12.27,
-%D title=\CONTEXT\ Structure Macros,
-%D subtitle=Register Management,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Structure Macros / Register Management}
-
-\newif \ifautoregisterhack % for the moment a private hack
-
-% new: eigennummer=ja => eerste {} ipv pag nummer
-
-\unprotect
-
-%D Isolated but still indocumented.
-
-% Formaat tex-utility-input-file <jobname.tui>:
-%
-% i e {tag} {loc} {pure} {entry+..} {p:c:p:sp:ssp=>page} {realpage}
-% i s {tag} {loc} {pure} {entry+..} {other entry}
-%
-% In plaats van + kan een & worden gebruikt. Ook kan als
-% eerste karakter worden opgegeven wat de scheider is.
-%
-% \index {entry}
-% \index[key] {entry}
-% \index[pageclass::] {entry}
-% \index[pageclass::key]{entry}
-% \index {textclass::entry}
-% \index[key] {textclass::entry}
-% \index[pageclass::] {textclass::entry}
-% \index[pageclass::key]{textclass::entry}
-%
-% Deze file wordt met het Perl script TeXUtil omgezet in
-% een in te lezen file met de commando's:
-%
-% \registerentrya {tag} {ingang}
-% \registerentryb {tag} {subingang}
-% \registerentryc {tag} {subsubingang}
-%
-% \registerpage {tag} {pag,txt} {volgnummer} {paginanummer} {volgnummer}
-%
-% \registersee {tag} {pag,txt} {andere ingang}
-%
-% \registerentry {tag} {letter}
-
-\def\dosetupregister[#1][#2][#3]%
- {\ifthirdargument
- \def\dodosetupregister##1%
- {\getparameters[\??id##1#2][#3]%
- \preparepageprefix{\??id##1}}%
- \else
- \def\dodosetupregister##1%
- {\getparameters[\??id##1][#2]%
- \doifvalue{\??id##1\c!coupling}\v!yes
- {\appendtoks\coupleregister[##1][#2]\to\everystarttext}%
- \preparepageprefix{\??id##1}}%
- \fi
- \processcommalist[#1]\dodosetupregister}
-
-\def\setupregister
- {\dotripleempty\dosetupregister}
-
-\def\getlastregisterentry#1%
- {\def\docommand##1{\def\!!stringa{##1}}%
- \processseparatedlist[#1][+]\docommand
- \!!stringa}
-
-\def\registerparameter#1{\csname\??id\currentregister#1\endcsname}
-
-% \enableregime[windows] \setupregister[index][keyexpansion=strict]
-%
-% \index[Ätsch]{Ätsch} test \index{QÄtsch} test \index[ratsch]{RÄtsch} test
-
-\newif\ifwritetoregister \writetoregistertrue
-
-\chardef\registerpagestatus\zerocount
-
-\def\doprocesspageregister[#1]#2#3% key altnum entry
- {\ifwritetoregister
- \begingroup
- \thisisnextinternal\s!ind
- \ifduplicate\getlastregisterentry{#3}\fi
- \defconvertexpanded\asciiregisterentryA{\registerparameter\c!keyexpansion}{#1}%
- \defconvertexpanded\asciiregisterentryB{\registerparameter\c!expansion }{#3}%
- \doifsomething{\registerparameter\c!keyexpansion}
- {\ifx\asciiregisterentryA\empty
- \defconvertexpanded\asciiregisterentryA{\registerparameter\c!keyexpansion}{#3}%
- \fi}%
- \makesectionformat
- \doifelse{\registerparameter\c!ownnumber}\v!yes
- \donetrue\donefalse
- \expanded{\writeutility{r % spaces are essential
- \ifcase\registerpagestatus\space\or e\or f\or t\fi\space
- {\currentregister} %
- {\nextinternalreference} %
- {\asciiregisterentryA} %
- {\asciiregisterentryB} %
- {\sectionformat\sectionseparator\sectionseparator\ifdone#2\else\noexpand\pagenumber\fi} %
- {\noexpand\realfolio}}}%
- \getfirstcharacter\currentregister
- \registerinfo{> \firstcharacter}{#3}%
- \endgroup
- \fi}
-
-\def\doregister#1%
- {\chardef\registerpagestatus\plusone
- \def\currentregister{#1}%
- \doifelse{\registerparameter\c!ownnumber}\v!yes
- {\dosingleempty\dodoregister}
- {\dosingleempty\donoregister}}
-
-\def\donoregister[#1]%
- {\dodoregister[#1]{}}
-
-% \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%
- {\doflushatpar{\doprocesspageregister[#1]{#2}{#3}}}
-
-\def\writetoregister[#1]% to be documented
- {\doregister{#1}}
-
-% \def\startregister
-% {\dotripleempty\dostartregister}
-
-% \def\dostartregister[#1][#2][#3]#4%
-% {\chardef\registerpagestatus\plustwo
-% \def\currentregister{#1}%
-% \setgvalue{\??id#1\??id#2}{\dodostopregister[#1][#3]{#4}}%
-% \dodoregister[#3]{}{#4}}
-
-\def\startregister
- {\doquadrupleempty\dostartregister}
-
-\def\dostartregister[#1][#2][#3][#4]#5% % 3 args: #3 is sortkey
- {\chardef\registerpagestatus\plustwo % 4 args: #3 is type, #4 is sortkey
- \def\currentregister{#1}%
- \iffourthargument
- \setgvalue{\??id#1\??id#2}{\dodostopregister[#1][#4]{#5}}%
- \dodoregister[#4]{#3}{#5}%
- \else
- \setgvalue{\??id#1\??id#2}{\dodostopregister[#1][#3]{#5}}%
- \dodoregister[#3]{}{#5}%
- \fi}
-
-\def\stopregister
- {\dodoubleargument\dostopregister}
-
-\def\dostopregister[#1][#2]%
- {\getvalue{\??id#1\??id#2}\letgvalue{\??id#1\??id#2}\relax}
-
-\def\dodostopregister[#1][#2]#3%
- {\chardef\registerpagestatus\plusthree
- \def\currentregister{#1}%
- \dodoregister[#2]{}{#3}} % key altnum entry
-
-\def\doprocessseeregister[#1]#2#3%
- {\ifwritetoregister
- \begingroup
- \thisisnextinternal\s!ind
- \ifduplicate\getlastregisterentry{#2}\fi
- \defconvertexpanded\asciiregisterentryA{\registerparameter\c!keyexpansion}{#1}%
- \defconvertexpanded\asciiregisterentryB{\registerparameter\c!expansion }{#2}%
- \defconvertexpanded\asciiregisterentryC{\registerparameter\c!expansion }{#3}%
- \doifsomething{\registerparameter\c!keyexpansion}
- {\ifx\asciiregisterentryA\empty
- \defconvertexpanded\asciiregisterentryA{\registerparameter\c!keyexpansion}{#2}%
- \fi}%
- \makesectionformat
- \expanded{\writeutility{r s %
- {\currentregister} %
- {\nextinternalreference} %
- {\asciiregisterentryA} %
- {\asciiregisterentryB} %
- {\asciiregisterentryC} %
- {\sectionformat}}}%
- \endgroup
- \registerinfo{> see}{#2}%
- \fi}
-
-\def\complexdoseeregister[#1]#2#3%
- {\doflushatpar{\doprocessseeregister[#1]{#2}{#3}}}
-
-\def\doseeregister#1%
- {\def\currentregister{#1}%
- \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\writetoregister
- {\dodoubleempty\dowritetoregister}
-
-\def\ifregistergeplaatst{\ifutilitydone}
-
-\newif\iffirstregisterpage
-\newif\iffirstregisterentry
-
-\let\c!entrya\empty
-\let\c!entryb\empty
-\let\c!entryc\empty
-\let\c!entryd\empty
-
-\def\nextregisterpage
- {\iffirstregisterpage
- \doglobal\newcounter\registerpagenumber
- \fi
- \doglobal\increment\registerpagenumber}
-
-\def\doregisterpagelocation#1#2%
- {\nextregisterpage
- \hbox to 1em{\hss\doregisterpagehowto{#1}{#2}\hss}}
-
-% todo: \installregisterpagehandler
-
-\def\setregisterpage#1% todo: currentregister gebruiken
- {\let\registerpageseparator\empty
- \processaction
- [\getvalue{\??id#1\c!symbol}]
- [ \c!n=>{\def\doregisterpage##1[##2]%
- {\doregisterpagelocation{#1}{\registerpagenumber}\/}},
- \c!a=>{\def\doregisterpage##1[##2]%
- {\doregisterpagelocation{#1}{\character{\registerpagenumber}\/}}},
- 1=>{\def\doregisterpage##1[##2]%
- {\doregisterpagelocation{#1}{$\bullet$}}},
- 2=>{\def\doregisterpage##1[##2]%
- {\doregisterpagelocation{#1}{\vrule\!!width1em\!!height1ex\!!depth\zeropoint}}},
- \v!none=>{\def\doregisterpage##1[##2]{}},%
- \s!unknown=>{\def\registerpagesymbol{\getvalue{\??id#1\c!symbol}}%
- \def\doregisterpage##1[##2]%
- {\doregisterpagelocation{#1}{\registerpagesymbol}}},
- \s!default=>{\def\registerpageseparator{,}%
- \let\doregisterpage\doregisterpagedefault}]}
-
-\def\doregisterpagedefault#1[#2]%
- {\doregisterpagehowto{#1}{\strut\pageprefix{\??id#1}[#2]\translatednumber[#2]}}
-
-% test case
-%
-% \starttext
-% \placelist[section][criterium=all] \blank[2*big]
-% \placeregister[index][compress=no] \blank[2*big]
-% \placeregister[index][compress=no,sectionnumber=yes] \blank[2*big]
-% \placeregister[index][compress=yes] \page
-% test text \index{test index}
-% \section{heading}
-% more test text \index{test index}
-% \section{heading}
-% more test text \index{test index}
-% \page
-% \section{heading text \index{test index}}
-% more test text \index{test index}
-% \page
-% test text \index{test index}
-% \section{heading text \index{test index}}
-% more test text \index{test index}
-% \stoptext
-
-\let\registerpagehowto\empty
-\let\registertexthowto\empty
-
-\def\setregisterhowto[#1,#2]%
- {\def\registerpagehowto{#1}%
- \def\registertexthowto{#2}}%
-
-\def\doregistertexthowto#1#2%
- {\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\empty
- \getvalue{\??id#1\c!pagecommand}{#2}%
- \dostopattributes}
-
-\def\registerentry #1{\executeifdefined{#1\s!entry }\gobbleoneargument }
-\def\registerentrya#1{\executeifdefined{#1\s!entrya}\gobbleoneargument }
-\def\registerentryb#1{\executeifdefined{#1\s!entryb}\gobbleoneargument }
-\def\registerentryc#1{\executeifdefined{#1\s!entryc}\gobbleoneargument }
-\def\registerentryd#1{\executeifdefined{#1\s!entryd}\gobbleoneargument }
-\def\registersee #1{\executeifdefined{#1\s!see }\gobblethreearguments}
-\def\registerpage #1{\executeifdefined{#1\s!page }\gobblefourarguments }
-\def\registerfrom #1{\executeifdefined{#1\s!from }\gobblefourarguments }
-\def\registerto #1{\executeifdefined{#1\s!to }\gobblefourarguments }
-
-\def\doresetregister#1%
- {\letvalue{#1\s!entrya}\gobbleoneargument
- \letvalue{#1\s!entryb}\gobbleoneargument
- \letvalue{#1\s!entryc}\gobbleoneargument
- \letvalue{#1\s!entryd}\gobbleoneargument
- \letvalue{#1\s!see }\gobblethreearguments
- \letvalue{#1\s!page }\gobblefourarguments
- \letvalue{#1\s!from }\gobblefourarguments
- \letvalue{#1\s!to }\gobblefourarguments
- \letvalue{#1\s!entry }\gobbleoneargument}
-
-\newif\iffirstsubentry
-\newif\iffirstsubsubentry
-
-\newcounter\currententrylevel
-
-\let\c!entryletter =\empty
-\let\c!entryreference=\empty
-\let\c!entrya =\relax
-\let\c!entryb =\relax
-\let\c!entryc =\relax
-\let\c!entryd =\relax
-
-\def\limitedregisterentry#1#2%
- {\getvalue{\??id#1\c!textcommand}%
- {\doifelsenothing{\??id#1\c!maxwidth}
- {#2}
- {\limitatetext{#2}{\getvalue{\??id#1\c!maxwidth}}{\unknown}}}}
-
-\def\dosetpageregisterpage#1#2#3#4#5#6%
- {\doifreglevelelse[#5]{\dodosetpageregisterpage{#1}{#2}{#3}{#4}{#5}{#6}}{}}
-
-\def\dodosetpageregisterpageA#1#2#3#4#5#6%
- {\global\utilitydonetrue
- \c!entryletter
- \setregisterhowto[#3]%
- \def\dohandleregisterentry##1%
- {\bgroup
- \if!!donea % \strut nieuw
- \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\c!entryd \or
- \c!entrya\!!doneatrue\c!entryb\c!entryc\c!entryd \or
- \c!entrya\c!entryb\!!doneatrue\c!entryc\c!entryd \or
- \c!entrya\c!entryb\c!entryc\!!doneatrue\c!entryd \fi}
- {\c!entrya\c!entryb\c!entryc\c!entryd}%
- \global\let\c!entrya\relax
- \global\let\c!entryb\relax
- \global\let\c!entryc\relax
- \global\let\c!entryd\relax
- \global\let\c!entryletter\relax
- \global\let\c!entryreference\relax}
-
-% \def\dodosetpageregisterpageB#1#2#3#4#5#6%
-% {\iffirstregisterpage
-% \expandafter\hskip\getvalue{\??id#2\c!distance}\relax
-% \else\ifnum#1=3
-% \strut|--|\relax % -- !
-% \else
-% % \relax after space needed because | looks ahead
-% \strut\registerpageseparator|\space|\relax
-% \fi\fi
-% \iftrue % \iftrue ...\fi to preserve indentation, can be folded out
-% \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
-% \relax
-% \fi
-% \global\firstregisterpagefalse}
-
-\def\dodosetpageregisterpageB#1#2#3#4#5#6%
- {\iffirstregisterpage
- \expandafter\hskip\getvalue{\??id#2\c!distance}\relax
- \else\ifnum#1=3
- \strut|--|\relax % -- !
- \else
- % \relax after space needed because | looks ahead
-% TH: next line replaced
-% \strut\registerpageseparator|\space|\relax
- \strut \registerpageseparator{ }%
-% /TH
- \fi\fi
- \iftrue % \iftrue ...\fi to preserve indentation, can be folded out
- \begingroup
- %
- \doifelsevalue{\??id#2\c!prefix}\v!none % default v!both
- {\chardef\pageprefixmode\zerocount}%
- {\doifvalue{\??id#2\c!prefix}\v!first %
- {\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
- \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}%
- \ifx\firstseenregisterreal\relax
- % no range yet
- \global\let\firstseenregisterreal\currentseenregisterreal
- \global\let\firstseenregisterpage\currentseenregisterpage
- \global\let\lastseenregisterreal \currentseenregisterreal
- \global\let\lastseenregisterpage \currentseenregisterpage
- \else\ifnum\lastseenregisterreal=\currentseenregisterreal\relax
- % same page (catch error)
- \else\ifnum\numexpr\lastseenregisterreal+\plusone\relax=\currentseenregisterreal\relax
- \global\let\lastseenregisterreal \currentseenregisterreal
- \global\let\lastseenregisterpage \currentseenregisterpage
- \else
- \global\let\savedcurrentseenregisterreal\currentseenregisterreal
- \global\let\savedcurrentseenregisterpage\currentseenregisterpage
- \flushseenregisterpage
- \global\let\firstseenregisterreal\savedcurrentseenregisterreal
- \global\let\firstseenregisterpage\savedcurrentseenregisterpage
- \global\let\lastseenregisterreal \savedcurrentseenregisterreal
- \global\let\lastseenregisterpage \savedcurrentseenregisterpage
- \fi\fi\fi
- \gdef\flushseenregisterpage{\doflushseenregisterpage{#1}{#2}{#3}{#4}}}
-
-% \def\dodosetpageregisterpageC#1#2#3#4#5#6%
-% {\xdef\currentseenregisterpage{#5}%
-% \xdef\currentseenregisterreal{#6}%
-% \firstregisterpagefalse
-% \gdef\flushseenregisterpage{\doflushseenregisterpage{#1}{#2}{#3}{#4}}%
-% \ifx\firstseenregisterreal\relax
-% % no range yet
-% \global\let\firstseenregisterreal\currentseenregisterreal
-% \global\let\firstseenregisterpage\currentseenregisterpage
-% \global\let\lastseenregisterreal \currentseenregisterreal
-% \global\let\lastseenregisterpage \currentseenregisterpage
-% \else\ifnum\firstseenregisterreal=\currentseenregisterreal\relax
-% \global\let\firstseenregisterreal\currentseenregisterreal
-% \global\let\firstseenregisterpage\currentseenregisterpage
-% \global\let\lastseenregisterreal \currentseenregisterreal
-% \global\let\lastseenregisterpage \currentseenregisterpage
-% \else\ifnum\lastseenregisterreal=\currentseenregisterreal\relax
-% \global\let\lastseenregisterpage \currentseenregisterpage
-% \else\ifnum\numexpr\lastseenregisterreal+\plusone\relax=\currentseenregisterreal\relax
-% \global\let\lastseenregisterreal \currentseenregisterreal
-% \global\let\lastseenregisterpage \currentseenregisterpage
-% \else
-% % back up, flush, go on
-% \global\let\savedcurrentseenregisterreal\currentseenregisterreal
-% \global\let\savedcurrentseenregisterpage\currentseenregisterpage
-% \let\currentseenregisterpage\lastseenregisterpage
-% \let\currentseenregisterreal\lastseenregisterreal
-% \flushseenregisterpage
-% \global\let\firstseenregisterreal\savedcurrentseenregisterreal
-% \global\let\firstseenregisterpage\savedcurrentseenregisterpage
-% \global\let\lastseenregisterreal \savedcurrentseenregisterreal
-% \global\let\lastseenregisterpage \savedcurrentseenregisterpage
-% \fi\fi\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}}
-
-\def\dodosetpageregisterpagecollapsed#1#2#3#4#5#6%
- {\ifx\firstseenregisterreal\relax\flushseenregisterpage\fi
- \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
- {\flushseenregisterpage
- \expanded{\doifreglevelelse[#4\sectionseparator\sectionseparator0]}%
- {{\global\utilitydonetrue
- \setregisterhowto[#2]%
- \def\dohandleregisterentry##1% dubbelop | \strut nieuw
- {\doregistertexthowto{#1}{\strut\limitedregisterentry{#1}{##1}}}%
- \getvalue
- {#1\ifcase\currententrylevel\s!entrya\or\s!entryb\or\s!entryc\else\s!entryd\fi}%
- {\doregisterpagehowto{#1}{\labeltexts\v!see{#3}}}%
- \c!entryletter\c!entrya\c!entryb\c!entryc\c!entryd
- \global\let\c!entrya\relax
- \global\let\c!entryb\relax
- \global\let\c!entryc\relax
- \global\let\c!entryd\relax
- \global\let\c!entryletter\relax
- \global\let\c!entryreference\relax
- % \global\firstregisterentrytrue
- \global\firstregisterpagetrue}}
- {}}
-
-%D Extended with variant:
-
-\def\doregistercharacter[#1]#2%
- {\global\firstregisterentrytrue
- \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}%
- \goodbreak}
-
-% a = <before> <goodbreak> <character> <par> <after> <nobreak>
-
-\def\doregistercharactera[#1]#2%
- {\getvalue{\??id#1\c!before}%
- \vskip\lineheight\goodbreak\vskip-\lineheight
- \ifhmode\unskip\else\noindent\fi % brrr
- \getvalue{\??id#1\c!command}{\doattributes{\??id#1}\c!style\c!color{\strut\ignorespaces#2}}%
- \getvalue{\??id#1\c!after}%
- \par\nobreak}
-
-% b = <goodbreak> <before> <character> <after> <nobreak>
-
-\def\doregistercharacterb[#1]#2% here no lineheight hackery ! ! !
- {\getvalue{\??id#1\c!before}%
- \ifhmode\unskip\else\noindent\fi % brrr
- \getvalue{\??id#1\c!command}%
- {\doattributes{\??id#1}\c!style\c!color{\strut\ignorespaces#2}}%
- \getvalue{\??id#1\c!after}%
- \nobreak}
-
-\def\doregistercharacterA[#1]#2{\doregistercharactera[#1]{\WORD{#2}}}
-\def\doregistercharacterB[#1]#2{\doregistercharacterb[#1]{\WORD{#2}}}
-
-%D Don't use \type{\string#2}; another hack 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%
- {\doifsomething{#2}
- {\doifvalue{\??id#1\c!referencing}\v!on
- {\pagereference[#1:\strippedcsname#2]}}}
-
-\def\dosetpageregisterletter#1#2%
- {\flushseenregisterpage
- \gdef\c!entryreference
- {\global\let\c!entryreference\relax
- \doregisterreference[#1]{#2}}%
- \gdef\c!entryletter
- {\global\utilitydonetrue
- \global\let\c!entryletter\relax
- \doregistercharacter[#1]{#2}}}
-
-% \def\HowUgly #1{\doHowUgly#1\relax}
-% \def\doHowUgly#1#2\relax{\iffirstregisterentry{\bf#1}\else#1\fi#2} % unchecked
-%
-% \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%
- {\flushseenregisterpage
- \edef\currententrylevel{1}%
- \global\let\c!entryb\relax
- \global\let\c!entryc\relax
- \global\let\c!entryd\relax
- \gdef\c!entrya
- {\iffirstregisterentry\else\endgraf\fi % new
- \global\firstregisterpagetrue
- \hangindent1em\noindent\c!entryreference
- \dohandlepageregisterentry{#1}{#2}%
- \global\firstregisterentryfalse
- \global\firstsubentrytrue
- \global\firstsubsubentrytrue}}
-
-\def\dosetpageregisterentryb#1#2%
- {\flushseenregisterpage % redundant
- \edef\currententrylevel{2}%
- \global\let\c!entryd\relax
- \global\let\c!entryc\relax
- \global\def\c!entryb
- {\iffirstregisterentry\else\endgraf\fi % new
- \global\firstregisterpagetrue
- \global\let\c!entrya\relax
- \iffirstsubentry\nobreak\fi
- \hangindent2em\noindent\c!entryreference\hskip1em\relax
- \dohandlepageregisterentry{#1}{#2}%
- \global\firstregisterentryfalse
- \global\firstsubentryfalse
- \global\firstsubsubentrytrue}}
-
-\def\dosetpageregisterentryc#1#2%
- {\flushseenregisterpage % redundant
- \edef\currententrylevel{3}%
- \gdef\c!entryc
- {\iffirstregisterentry\else\endgraf\fi % new
- \global\firstregisterpagetrue
- \global\let\c!entrya\relax
- \global\let\c!entryb\relax
- \iffirstsubsubentry\nobreak\fi
- \hangindent3em\noindent\c!entryreference\hskip2em\relax
- \dohandlepageregisterentry{#1}{#2}%
- \global\firstregisterentryfalse
- \global\firstsubsubentryfalse}}
-
-\def\dosetpageregisterentryd#1#2%
- {\flushseenregisterpage % redundant
- \edef\currententrylevel{4}%
- \gdef\c!entryd
- {\iffirstregisterentry\else\endgraf\fi % new
- \global\firstregisterpagetrue
- \global\let\c!entrya\relax
- \global\let\c!entryb\relax
- \global\let\c!entryc\relax
- \iffirstsubsubentry\nobreak\fi
- \hangindent4em\noindent\c!entryreference\hskip3em\relax
- \dohandlepageregisterentry{#1}{#2}%
- \global\firstregisterentryfalse
- \global\firstsubsubentryfalse}}
-
-\def\dosetpageregister#1% \currentregister gebruiken
- {\dosetreglevel{#1}%
- \global\let\currentregisterentry\empty
- \global\firstsubentrytrue
- \global\firstsubsubentrytrue
- \setregisterpage{#1}%
- \setvalue{#1\s!entrya}{\dosetpageregisterentrya {#1}}%
- \setvalue{#1\s!entryb}{\dosetpageregisterentryb {#1}}%
- \setvalue{#1\s!entryc}{\dosetpageregisterentryc {#1}}%
- \setvalue{#1\s!entryd}{\dosetpageregisterentryd {#1}}%
- \setvalue{#1\s!page }{\dosetpageregisterpage{1}{#1}}%
- \setvalue{#1\s!from }{\dosetpageregisterpage{2}{#1}}%
- \setvalue{#1\s!to }{\dosetpageregisterpage{3}{#1}}%
- \setvalue{#1\s!see }{\dosetpageregistersee {#1}}%
- \setvalue{#1\s!entry }{\dosetpageregisterletter {#1}}}
-
-\def\dosetreglevel#1%
- {\dosetfilterlevel{\getvalue{\??id#1\c!criterium}}\empty}
-
-\def\getalllistreferences#1#2%
- {\gdefconvertexpanded\currentregisterentry{\getvalue{\??id#1\c!expansion}}{#2}%
- \doifdefinedelse{\??id#1\??id\currentregisterentry}
- {\edef\alllistreferences%
- {\getvalue{\??id#1\??id\currentregisterentry}}%
- \beforesplitstring\alllistreferences\at::\to\internallistreference
- \aftersplitstring \alllistreferences\at::\to\alllistreferences}
- {\let\alllistreferences\empty
- \def\internallistreference{0}}}
-
-\def\dosetlinkregister#1% is die page reference echt nodig?
- {\dosetreglevel{#1}%
- \setregisterpage{#1}%
- \global\let\currentregisterentry\empty
- \global\firstsubentrytrue % not needed
- \global\firstsubsubentrytrue % not needed too
- \setvalue{#1\s!entrya}##1{\dosetlinkregisterentrya{#1}{##1}}%
- \setvalue{#1\s!entry }##1{\dosetpageregisterletter{#1}{##1}}}
-
-\def\dosetlinkregisterentrya#1#2%
- {\global\utilitydonetrue
- \c!entryletter
- \iflocation
- \getalllistreferences{#1}{#2}%
- % no \endgraf
- \hangindent1em\noindent\c!entryreference
- %
- %\thisissomeinternal{\s!lin}{\internallistreference}%
- %
- \pagereference[-:\s!lin:\internallistreference]% -: added
- %
- \getcommacommandsize[\alllistreferences]%
- \getfromcommacommand[\alllistreferences][1]%
- \ifnum\commalistsize=1
- \let\firstlistreference\empty
- \let\midlistreference\commalistelement
- \let\lastlistreference\empty
- \else
- \let\firstlistreference\commalistelement
- \getfromcommacommand[\alllistreferences][\commalistsize]%
- \let\lastlistreference\commalistelement
- \ifnum\commalistsize=2
- \let\midlistreference\empty
- \else
- \!!counta\commalistsize
- \divide\!!counta 2
- \getfromcommacommand[\alllistreferences][\!!counta]%
- \let\midlistreference\commalistelement
- \fi
- \fi
- % aangepast
- \def\dodocommand[##1-##2]%
- {\gotonextinternal{\s!ind}{##1}{##2}{\box0}}%
- \doifelsevalue{\??id#1\c!interaction}\v!pagenumber
- {\limitedregisterentry{#1}{#2}} % paginanummer
- {{\setbox0\hbox{\limitedregisterentry{#1}{\begstrut#2}}%
- \ifx\firstlistreference\empty % tekst,alles
- \ifx\midlistreference\empty
- \box0
- \else
- \expandafter\dodocommand\expandafter[\midlistreference]%
- \fi
- \else
- \expandafter\dodocommand\expandafter[\firstlistreference]%
- \fi}}%
- \doifvalue{\??id#1\c!number}\v!yes
- {\hskip\getvalue{\??id#1\c!distance}(\commalistsize)}%
- \doifnotvalue{\??id#1\c!interaction}\v!text % paginanummer,alles
- {\def\docommand##1##2%
- {{\setbox0\hbox{\showlocation{\hbox to 1em{\hss\symbol[##2]\hss}}}%
- \ifx##1\empty
- % \hskip\wd0 % (optioneel maken)
- \else
- \expandafter\dodocommand\expandafter[##1]%
- \fi}}%
- \hskip\getvalue{\??id#1\c!distance}%
- \docommand\firstlistreference\v!previous
- \docommand\midlistreference\v!somewhere
- \docommand\lastlistreference\v!next}%
- % tot hier
- \else
- % no \endgraf
- \noindent\c!entryreference
- \limitedregisterentry{#1}{#2}%
- \fi
-\endgraf}
-
-\def\dosetregister#1%
- {\doifelsevalue{\??id#1\c!coupling}\v!yes
- {\ifautoregisterhack
- \dosetautoregister{#1}%
- \else
- \dosetlinkregister{#1}%
- \fi}
- {\dosetpageregister{#1}}}
-
-\newcounter\internallistreference
-
-\def\doloadregisterlinks#1%
- {\dosetreglevel{#1}%
- \setregisterpage{#1}%
- \global\let\currentregisterentry\empty
- \global\firstregisterpagetrue
- \setvalue{#1\s!entrya}##1%
- {\global\firstregisterpagetrue
- \gdefconvertedargument\currentregisterentry{##1}% global nodig?
- \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
- \@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
- \@EA\xdef\csname\??id#1\??id\currentregisterentry\endcsname
- {\csname\??id#1\??id\currentregisterentry\endcsname,##2-##4}%
- \fi
- \fi}
- {}}%
- \fi}
-
-\def\docoupleregister[#1][#2]%
- {\iflocation
- \ifcase0\countervalue{autolink:#1}\relax % only once
- \begingroup
- \let\dosetregister\doloadregisterlinks
- \def\currentregister{#1}%
- \setupregister[#1][#2]%
- \doutilities\currentregister{\registerparameter\c!file}\currentregister\dobeforeplaceregister\doafterplaceregister
- \endgroup
- \ifautoregisterhack
- \doinitializeautoregister{#1}%
- \else
- \doinitializelinkregister{#1}%
- \fi
- \fi
- \fi}
-
-\def\coupleregister
- {\dodoubleempty\docoupleregister}
-
-\def\dodocommandprolinrefAA[#1-#2]%
- {\def\lastlistreference{#1-#2}}
-
-\def\dodocommandprolinrefA[#1-#2]%
- {\def\lastlistreference{#1-#2}%
- \ifx\firstlistreference\empty
- \let\firstlistreference\lastlistreference
- \fi
- \ifnum#1<\nextinternalreference\relax
- \let\prevlistreference\lastlistreference
- \else\ifnum#1>\nextinternalreference\relax
- \let\nextlistreference\lastlistreference
- \let\dodocommandprolinrefA\dodocommandprolinrefAA
- \else
- \let\selflistreference\lastlistreference
- \fi\fi}
-
-\def\docommandprolinrefA#1%
- {\dodocommandprolinrefA[#1]}
-
-\def\dodocommandprolinrefB[#1-#2]%
- {\gotonextinternal{\s!ind}{#1}{#2}{\box0}}
-
-\def\docommandprolinrefB#1#2#3%
- {\bgroup
- \ifx#2\empty
- \doifvalue{\??id#1\c!unknownreference}\v!empty{\hskip1em}%
- \else
- \setbox0\hbox to 1em{\hss\showlocation{\symbol[#3]}\hss}%
- \expandafter\dodocommandprolinrefB\expandafter[#2]%
- \fi
- \egroup}
-
-\def\doprocesslinkregister[#1][#2]#3%
- {\hbox
- {\doprocesspageregister[#2]{}{#3}%
- \let\firstlistreference\empty
- \let\lastlistreference\empty
- \let\selflistreference\empty
- \let\prevlistreference\empty
- \let\nextlistreference\empty
- \getalllistreferences{#1}{#3}%
- \ifx\alllistreferences\empty \else
- \expanded{\rawprocesscommalist[\alllistreferences]}\docommandprolinrefA
- \fi
- \ifx\prevlistreference\empty
- \let\prevlistreference\lastlistreference
- \fi
- \ifx\nextlistreference\empty
- \let\nextlistreference\firstlistreference
- \fi
- \ifx\prevlistreference\selflistreference
- \let\prevlistreference\empty
- \let\nextlistreference\empty
- \fi
- \setalignmentswitch{\getvalue{\??id#1\c!location}}%
- \ifcase\alignmentswitch
- % links
- \docommandprolinrefB{#1}\prevlistreference\v!previous
- \docommandprolinrefB{#1}\nextlistreference\v!next
- \or
- % midden
- \docommandprolinrefB{#1}\prevlistreference\v!previous
- \or
- % rechts
- \fi
- \doifreferencefoundelse{\s!lin:\internallistreference}
- {\gotosomeinternal
- \s!lin \internallistreference \currentrealreference
- {\showlocation{\limitedregisterentry{#1}{#3}}}}
- {\hbox{\limitedregisterentry{#1}{#3}}}%
- \ifcase\alignmentswitch
- % links
- \or
- % midden
- \docommandprolinrefB{#1}\nextlistreference\v!next
- \or
- % rechts
- \docommandprolinrefB{#1}\prevlistreference\v!previous
- \docommandprolinrefB{#1}\nextlistreference\v!next
- \fi}}
-
-\def\doprocesslinkedregister[#1][#2]#3% page auto link
- {\bgroup
- \chardef\registerpagestatus\plusone
- \def\currentregister{#1}%
- \iflocation % \next is not needed
- \ifautoregisterhack
- \def\next{\doprocessautoregister[#1][#2]}%
- \else
- \def\next{\doprocesslinkregister[#1][#2]}%
- \fi
- \else
- \def\next{\doprocesspageregister[#2]{}}%
- \fi
- \next{#3}%
- \egroup}
-
-\def\dodolinkedregister[#1][#2]#3% page auto link
- {\doflushatpar{\doprocesslinkedregister[#1][#2]{#3}}}
-
-\def\dolinkedregister#1%
- {\dodoubleempty\dodolinkedregister[#1]}
-
-\def\dosetautoregister#1%
- {\makecounter{autolink:#1}%
- \dosetreglevel{#1}%
- \setregisterpage{#1}%
- \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}}}
-
-\def\dosetautoregisterentrya#1#2%
- {\global\utilitydonetrue
- \c!entryletter
- \iflocation
- \getalllistreferences{#1}{#2}%
- \endgraf\hangindent1em\noindent\c!entryreference
- \pagereference[-:\s!lin:\internallistreference]%
- \pluscounter{autolink:#1}%
- \bgroup
- %\setupinteraction[\c!color=,\c!contrastcolor=,\c!style=]% kan sneller
- \resetinteractionparameter\c!color
- \resetinteractionparameter\c!contrastcolor
- \resetinteractionparameter\c!style
- \gotobox
- {\limitedregisterentry{#1}{\begstrut#2}}%
- [JS(SetRegisterEntry{\v!register,\countervalue{autolink:#1},#2,{\alllistreferences}})]%
- \egroup
- \else
- \endgraf\noindent\c!entryreference
- \limitedregisterentry{#1}{#2}%
- \fi}
-
-\def\doprocessautoregister[#1][#2]#3%
- {\hbox
- {\doprocesspageregister[#2]{}{#3}%
- \doifreferencefoundelse{\s!lin:\internallistreference}
- {\gotosomeinternal \s!lin
- {\internallistreference}{\currentrealreference}
- {\showlocation{\limitedregisterentry{#1}{#3}}}}
- {\hbox{\limitedregisterentry{#1}{#3}}}}}
-
-% \appendmacro aan openpaginaactie (in shipout)
-
-%D The first implementation used one main field with clones.
-%D In a 2500 page document this resulted in a rather (anoying)
-%D long start||up time. This \quote {every page its own field}
-%D solution, combined with a \quote {page open action}, works
-%D much faster, but is conceptually pretty weak.
-
-\def\complexregisterfield[#1]%
- {\definefield[#1:\realfolio][line][\v!register]%
- \field[#1:\realfolio]}
-
-\def\simpleregisterfield
- {\complexregisterfield[\v!register]}
-
-\definecomplexorsimple\registerfield
-
-\setupfield
- [\v!register]
- [\c!width=10em,
- \c!height=3ex,
- \c!align=\v!middle,
- \c!option=\v!readonly,
- \c!location=\v!low]
-
-\def\doinitializeautoregister#1%
- {\useJSscripts[reg]%
- \useJSpreamblenow{LinkedRegisters}%
- \setupinteraction[\c!openpageaction=JS(UpdateRegisterField{\v!register})]%
- \definereference[\v!reset\v!register][JS(ResetRegisterEntry{\v!register})]%
- \definereference[\v!first\v!register][JS(GotoFirstRegisterEntry{\v!register})]%
- \definereference[\v!previous\v!register][JS(GotoPreviousRegisterEntry{\v!register})]%
- \definereference[\v!next\v!register][JS(GotoNextRegisterEntry{\v!register})]%
- \definereference[\v!last\v!register][JS(GotoLastRegisterEntry{\v!register})]}
-
-\def\doinitializelinkregister#1%
- {}
-
-% todo ruwe register
-
-\def\placeregister
- {\dodoubleempty\doplaceregister}
-
-\def\doplaceregister[#1][#2]%
- {\iffirstargument
- \begingroup
- \edef\currentregister{#1}%
- \setupregister[\currentregister][#2]%
- \doifelse{\registerparameter\c!compress}\v!yes % new
- {\chardef\collapseregisterpages\plusone}
- {\chardef\collapseregisterpages\zerocount}%
-% TH: disable next line
-% \raggedright
-% /TH
- \startcolumns
- [\c!n=\registerparameter\c!n,
- \c!balance=\registerparameter\c!balance,
- \c!align=\registerparameter\c!align,
- tolerance=stretch]%
- \dontcomplain
- \startpacked[\v!blank]%
- \doutilities\currentregister{\registerparameter\c!file}\currentregister\dobeforeplaceregister\doafterplaceregister
- \stoppacked
- \stopcolumns
- \endgroup
- \fi}
-\def\dobeforeplaceregister
- {\resetseenregisterpage
- \relax}
-
-\def\doafterplaceregister
- {\flushseenregisterpage
- \par}
-
-\def\completeregister
- {\dodoubleempty\docompleteregister}
-
-\def\docompleteregister[#1][#2]%
- {\iffirstargument
- \begingroup
- \edef\currentregister{#1}%
- % the expansion is needed because we don't want \v!'s in the tuo file (french)
- \expanded{\systemsuppliedchapter[\currentregister]{\noexpand\headtext{\currentregister}}}%
- \placeregister[\currentregister][#2]%
- \page[\v!yes]%
- \endgroup
- \fi}
-
-\def\doregisterregisterlanguage#1%
- {\savesortlanguage{\getvalue{\??id#1\s!language}}%
- \expanded{\immediatewriteutility{r l {#1} {\getvalue{\??id#1\s!language}}}}}
-
-\def\dodefineregister[#1][#2]%
- {\setupregister[#1]%
- [\c!n=2,
- \c!balance=\v!yes, % \v!no komt niet zo vaak voor
- \c!align=\v!flushleft,
- \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,
- \c!style=\v!bold,
- \c!pagestyle=\v!slanted,
- \c!indicator=\v!yes,
- \v!part\v!number=\v!yes, % v
- \v!chapter\c!number=\v!no,
- \c!criterium=\v!all,
- \c!command=,
- \c!referencing=\v!on,
- \c!location=\v!middle,
- \c!maxwidth=,
- \c!number=\v!no,
- \c!unknownreference=\v!empty,
- \c!prefix=\v!both,
- \c!expansion=,
- \c!keyexpansion=,
- \c!file=\jobname,
- %\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}{\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]}}
-
-\def\defineregister
- {\dodoubleargument\dodefineregister}
-
-\def\registerlengte{\utilityregisterlength}
-
-\def\utilityregisterlength{0}
-
-\def\dodetermineregistercharacteristics[#1][#2]%
- {\begingroup
- \def\currentregister{#1}%
- \setupregister[#1][#2]%
- \dosetreglevel{#1}%
- \setvalue{#1\s!from}%
- {\getvalue{#1\s!page}}%
- \setvalue{#1\s!page}##1##2##3##4%
- {\doifreglevelelse[##3]
- {\doglobal\increment\utilitylistlength
- \global\utilitydonetrue}
- {}}%
- \doglobal\newcounter\utilityregisterlength
- \setbox0\vbox{\doutilities\currentregister{\registerparameter\c!file}\currentregister\dobeforeplaceregister\doafterplaceregister}%
- \endgroup
- \ifregistergeplaatst
- \setsystemmode \v!register
- \else
- \resetsystemmode\v!register
- \fi}
-
-\def\determineregistercharacteristics
- {\dodoubleempty\dodetermineregistercharacteristics}
-
-%D Default index:
-
-\defineregister
- [\v!index]
- [\v!indices]
-
-% \setupregister[index][koppeling=ja]
-%
-% \stelveldenin
-% [register][achtergrond=raster,kader=uit]
-%
-% \stelvoettekstenin
-% [{\field[index]}]
-%
-% \stelhoofdtekstenin
-% [{\naar {first}[eersteindex]\quad
-% \naar{previous}[vorigeindex]\quad
-% \naar {next}[volgendeindex]\quad
-% \naar {last}[laatsteindex]\quad\quad
-% \naar {index}[index]}]
-%
-% \starttekst
-%
-% oeps~~~\gekoppeldeindex{oeps} \blanko
-% flop~~~\gekoppeldeindex{flop} \blanko
-% test~~~\gekoppeldeindex{test} \pagina
-% flop~~~\gekoppeldeindex{flop} \blanko
-% test~~~\gekoppeldeindex{test} \pagina
-% oeps~~~\gekoppeldeindex{oeps} \blanko
-% test~~~\gekoppeldeindex{test} \pagina
-% flop~~~\gekoppeldeindex{flop} \blanko
-% oeps~~~\gekoppeldeindex{oeps} \pagina
-%
-% \volledigeindex
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/strc-sec.mkii b/Master/texmf-dist/tex/context/base/mkii/strc-sec.mkii
deleted file mode 100644
index 01ca71eadbc..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/strc-sec.mkii
+++ /dev/null
@@ -1,2591 +0,0 @@
-%D \module
-%D [ file=strc-sec,
-%D version=1997.03.31,
-%D title=\CONTEXT\ Structure Macros,
-%D subtitle=Sectioning,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% start-stop per section en dan combineren met sectieblok; in dat geval
-% eenvoudiger per-* acties
-
-% nummeren per sectieblok implementeren
-
-% this module needs a clean up, currently some manipulations
-% take place multiple times; also, some clever recursive level
-% thing makes more sense
-
-% in manual (zie prikkels) : tussen=\blanko is enige hook om
-% met kop-in-hoofd een spatiering af te dwingen
-
-\writestatus{loading}{ConTeXt Structure Macros / Sectioning}
-
-\unprotect
-
-% new and to be tested
-
-\unexpanded\def\separatorlist#1%
- {\ifx\sepnumber\undefined\def\sepnumber{0}\fi
- \increment\sepnumber
- \getfromcommacommand[#1][\sepnumber]%
- \ifx\commalistelement\empty
- \getcommalistsize[#1]%
- \def\sepnumber{\number\commalistsize}%
- \getfromcommacommand[#1][\sepnumber]%
- \fi
- \commalistelement}
-
-% \setuphead[section] [separator=\separatorlist{?,!,*}]
-% \setuphead[subsection][separator=\separatorlist{??,!!,**}]
-%
-% \let\spr\separatorlist % this will enable this feature
-%
-% \setuphead[section] [separator={?,!,*}]
-% \setuphead[subsection][separator={??,!!,**}]
-%
-% \setupheads[separator={A,B,C,D,E,F}]
-% \chapter{test}
-% \section{test} \subsection{test} \subsection{test}
-% \section{test} \subsection{test} \subsection{test}
-
-% from now on, internaly numbers are separated by a period
-% and postprocessed on demand; this will change to {} {} {}
-
-\def\numberseparator {.} % reasonable default
-\def\sectionseparator{-} % was : but is now -
-
-\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\@@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\@@filterlevelpart[#1--#2--#3]{\@@dofilterlevelpart[#2-0-0-0-0]}
-
-\def\@@dofilterlevelpart[#1-0-0-0-#2]{#1}
-
-\def\gobbleuntilrelax#1\relax{}
-
-\def\separatednumber #1{\doseparatednumber #1.\empty\relax}
-\def\removefirstprefix#1{\doremovefirstprefix#1.\empty\relax}
-\def\removeallprefixes#1{\doremoveallprefixes#1.\empty\relax}
-
-\def\doseparatednumber#1.#2%
- {#1%
- \ifx#2\empty
- \@EA\gobbleuntilrelax
- \else \numberseparator
- \@EA\doseparatednumber
- \fi#2}
-
-\def\doremoveallprefixes#1.#2%
- {\ifx#2\empty
- #1\@EA\gobbleuntilrelax
- \else
- \@EA\doremoveallprefixes
- \fi#2}
-
-\def\doremovefirstprefix#1.#2%
- {\ifx#2\empty
- #1\@EA\gobbleuntilrelax
- \else
- \@EA\noremovefirstprefix
- \fi#2}
-
-\def\noremovefirstprefix#1.\empty\relax
- {#1}
-
-% we need to expand in order to get something separatable
-
-\def\dohandleheadnumber#1%
- {\expanded{\separatednumber{#1}}}
-
-\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
- \dochecknumber{#1}}} % tricky and ugly
- {\doifnotvalue{\@@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\dochecknumber#1%
- {\edef\currentsection{\csname\??by\csname\@@thenumber{#1}\c!way\endcsname\endcsname}%
- \ifx\currentsection\empty\else
- \dodochecknumber
- {#1}%
- {\csname\currentsection\c!number\endcsname}%
- {\v!by\previoussection\currentsection}%
- \fi}
-
-\def\checknumber[#1]%
- {\bgroup
- %\ifcase\blocklevel\else
- \ifdoingblocks
- \doifnotvalue{\@@thenumber{#1}\c!blockway}\v!no\setblockcounters
- \fi
- \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
- \ifsectionnumber
- \doifvalue{\??sb\@@sectionblock\c!number}\v!yes % added
- {\doifelsevalue{\@@thenumber{#1}\c!sectionnumber}\v!yes
- \donetrue\donefalse
- \doifvalue{\@@thenumber{#1}\c!sectionnumber}\v!number
- {\donetrue\let\@@sectionconversion\gobbleoneargument}%
- \ifdone
- \edef\currentsection
- {\getvalue{\??by\getvalue{\@@thenumber{#1}\c!way\c!local}}}%
- \doifnot\currentsection\zerosection
- {\doifnot{\@@sectionvalue\currentsection}{0}
- {\xdef\precedingsectionnumber
- {\getvalue{\currentsection\c!number}%
- \spr{\precedingseparator}}}}%
- \fi}%
- \fi
- \egroup}
-
-\def\makeprecedingsectionnumber[#1]%
- {\bgroup
- %\ifnum\blocklevel>0
- %\ifcase\blocklevel\else
- \ifdoingblocks
- \doifnotvalue{\@@thenumber{#1}\c!blockway}\v!no\setblockcounters
- \fi
- \domakeprecedingsectionnumber[#1]%
- \egroup}
-
-% \def\makesectionnumber[#1]%
-% {\makeprecedingsectionnumber[#1]%
-% \xdef\composedsectionnumber%
-% {\precedingsectionnumber\convertednumber[#1]}}%
-%
-% hack needed for chinese and oldstyle in normal tex, will change
-
-\def\makesectionnumber[#1]%
- {\bgroup
- \forceunexpanded % i don't like this hack
- \makeprecedingsectionnumber[#1]%
- \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{\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\sectionnumberonly[#1]%
- {\makesectionnumber[#1]%
- \composedsectionnumber}
-
-% sectioning
-
-\newcount\nofsections
-
-\let\zerosection \v!text
-\let\firstsection\empty
-\let\lastsection \empty
-\let\@@sectie \empty
-\let\@@koppeling \empty
-
-\makecounter{\??se\v!text}
-
-\letvalueempty{\??se\v!text\c!before}
-\letvalueempty{\??se\v!text\c!after }
-
-\setvalue {\v!text\c!number}{0}
-\letvalueempty{\v!text\s!format}
-
-\letvalueempty{\??sk\v!text}
-\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!by\v!all }\v!text
-\letvalue{\??by\v!by\v!page}\v!text % see footnotes
-
-\def\sectionofhead#1{\executeifdefined{\??ko#1\c!section}\s!unknown}
-
-\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}
- {\docouplemarking[#1][\getvalue{\??ko#2\c!section}]}
- {\def\donexttrackcommando##1%
- {\edef\coupledmarkings{\getvalue{\??se##1\c!marking}}%
- \doifelse{##1}{#2}
- {\addtocommalist{#1}\coupledmarkings}
- {\removefromcommalist{#1}\coupledmarkings}%
- \setevalue{\??se##1\c!marking}{\coupledmarkings}%
- \donexttracklevel{##1}}%
- \donexttracklevel{\zerosection}}} % \firstsection
-
-\def\couplemarking
- {\dodoubleargument\docouplemarking}
-
-\def\decouplemarking[#1]%
- {\couplemarking[#1][]}
-
-\def\definesection[#1]%
- {\doifundefined{\??se#1}
- {\doifelsenothing\firstsection
- {\def\firstsection{#1}%
- \setevalue{\??se#1\c!before}{\v!text}%
- \setevalue{\??se\v!text\c!after}{#1}}
- {\setevalue{\??se\commalistelement\c!after}{#1}% commalistelement ?
- \setevalue{\??se#1\c!before}{\lastsection}%
- \setevalue{\??se\lastsection\c!after}{#1}}%
- \advance\nofsections \plusone
- \setevalue{\??se#1\c!level}{\the\nofsections}%
- \letvalue{\??se#1\c!after}\empty
- \setvalue{\e!next#1}{\@@nextsectionnumber{#1}}%
- \setvalue{#1\c!number}{\@@longsectionnumber{#1}}%
- \setvalue{#1\s!format}{\@@longformatnumber{#1}}%
- \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
- \setupsection[#1][\c!previousnumber=\v!yes]}}%
-
-\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}%
- \checkpreservevalueafter{#1}% GB
- \resetsectioncounters{#1}%
- \checkpagecounter}
-
-\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}%
- \checkpreservevalueafter{#1}%
- \resetsectioncounters{#1}%
- \checkpagecounter}
-
-\def\@@sectionvalue#1% % nog niet overal doorgevoerd
- {\countervalue{\??se#1}} % zoeken op \??se
-
-% 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
- \convertnumber{\getvalue{\??se#1\c!conversion}}{#2}%
- \fi
- \else
- \convertnumber{\getvalue{\??se#1\@@sectionblock\c!conversion}}{#2}%
- \fi
- \fi}
-
-% \def\@@sectionlevel#1%
-% {\ifundefined{\??se#1\c!level}0\else\getvalue{\??se#1\c!level}\fi}
-
-\def\@@sectionlevel#1%
- {\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% can invoke a break
- {\ifundefined{\??se#1}%
- \fastresetmarker[\mainmarking{#1}]% % redundant \mainmarking
- \else
- \let\donexttrackcommando\doresetsectionmarks
- \donexttracklevel{#1}%
- \fi}
-
-\def\doresetsectionmarks#1%
- {\ifundefined{\??se#1\c!marking}\else % skip zero level
- \fastresetmarkerlist[\csname\??se#1\c!marking\endcsname]%
- \fi
- \donexttracklevel{#1}}
-
-% I'm not sure if the next one is better:
-%
-% \def\doresetsectionmarks#1%
-% {\ifundefined{\??se#1\c!markering}% skip zero level
-% \donexttracklevel{#1}%
-% \else
-% \fastresetmarkerlist[\csname\??se#1\c!markering\endcsname]%
-% \fi}
-%
-% and indeed, it isn't, actually, it does not work at all, so let's drop it.
-
-% packaged:
-%
-% \def\resetsectioncounters#1%
-% {\def\donexttrackcommando##1%
-% {\resetcounter{\??se##1}%
-% \donexttracklevel{##1}}%
-% \donexttracklevel{#1}}
-%
-% nicer
-%
-% \def\doresetsectioncounters#1%
-% {\resetcounter{\??se#1}%
-% \donexttracklevel{#1}}
-%
-% obey eigennummer
-
-\def\doresetsectioncounters#1%
- {\resetcounter{\??se#1}%
- \letgvalue{\??se#1\c!ownnumber}\relax
- \donexttracklevel{#1}}
-
-\def\resetsectioncounters % #1
- {\let\donexttrackcommando\doresetsectioncounters
- \donexttracklevel} % #1
-
-% bij checken kan geen prefix worden bekeken, anders vallen
-% er titels buiten de inhoudsopgave
-
-% evt ook level gaan opslaan tbv snelle selectie
-
-% \def\makesectionformat
-% {\edef\sectionformat
-% {\@@sectiontype\sectionseparator
-% \csname\lastsection\s!format\endcsname}}
-
-\unprotected \def\makesectionformat % we don't want eigennummers here
- {\pushmacro\@@shortsectionnumber
- \let\@@shortsectionnumber\@@sectionvalue
- \edef\sectionformat
- {\@@sectiontype\sectionseparator
- \csname\lastsection\s!format\endcsname}%
- \popmacro\@@shortsectionnumber}
-
-\def\dobacktracklevel#1%
- {\doifnot{\previoussection{#1}}\zerosection
- {\dobacktrackcommando{\previoussection{#1}}}}
-
-\def\donexttracklevel#1%
- {\doifnot{#1}\lastsection
- {\donexttrackcommando{\nextsection{#1}}}}
-
-\chardef\alltoclevels\zerocount
-
-\let\currentlevel\empty
-
-\def\dosetcurrentlevel#1%
- {\global\chardef\alltoclevels\zerocount
- \xdef\currentlevel{\getvalue{\lastsection\s!format}}}
-
-\def\dosetpreviouslevel#1%
- {\global\chardef\alltoclevels\plusone
- \globallet\currentlevel\empty
- \def\dobacktrackcommando##1%
- {\ifnum\countervalue{\??se##1}>\zerocount
- \global\chardef\alltoclevels\zerocount
- \xdef\currentlevel{\getvalue{\previoussection{##1}\s!format}}%
- \else
- \dobacktracklevel{##1}%
- \fi}%
- \dobacktrackcommando\lastsection}
-
-\def\dosettextlevel#1%
- {\global\chardef\alltoclevels\plusone
- \globallet\currentlevel\empty}
-
-\def\dosetotherlevel#1%
- {\doifdefinedelse{\??ko#1\c!section} % beter alteratief: ook
- {\edef\@@sectie{\getvalue{\??ko#1\c!section}}} % hoofdstuk\c!format
- {\edef\@@sectie{#1}}%
- \doifdefinedelse{\??se\@@sectie}
- {\global\chardef\alltoclevels\zerocount
- \xdef\currentlevel{\getvalue{\@@sectie\s!format}}}
- {\global\chardef\alltoclevels\plusone
- \globallet\currentlevel\empty
- \def\dobacktrackcommando##1%
- {\@EA\ifx\csname\??se##1\c!start\endcsname\relax
- \dobacktracklevel{##1}%
- \else
- \ifnum\countervalue{\??se##1}>\zerocount
- \global\chardef\alltoclevels\zerocount
- \xdef\currentlevel{\getvalue{##1\s!format}}%
- \else
- \dobacktracklevel{##1}%
- \fi
- \fi}%
- \dobacktrackcommando\lastsection}}
-
-% \def\ignoresectionconversion % brrr
-% {\let\@@sectionconversion\secondoftwoarguments}
-
-% todo: criterium=appendix|frontmatter|....
-
-\def\dosetfilterlevel#1#2% beware: this one is \let
- {\bgroup
- \let\@@shortsectionnumber\@@sectionvalue
-% \ignoresectionconversion
- \edef\askedlevel{#1}%
- \edef\askedfilter{#2}%
- \ifx\askedlevel\v!current
- \dosetcurrentlevel\askedlevel
- \else\ifx\askedlevel\v!previous
- \dosetpreviouslevel\askedlevel
- \else\ifx\askedlevel\v!all
- \global\chardef\alltoclevels\plusone
- \else\ifx\askedlevel\v!text
- \global\chardef\alltoclevels\plusone
- \else
- \edef\byaskedlevel{\csname\??by\askedlevel\endcsname}%
- \ifx\byaskedlevel\v!text
- \dosettextlevel\askedlevel
- \else
- \dosetotherlevel\askedlevel
- \fi
- \fi\fi\fi\fi
- % experiment
- \ifx\askedfilter\empty \else
- \xdef\currentlevel{\currentlevel\sectionseparator\askedfilter}%
- \fi
- \egroup}
-
-% \def\dontsetfilterlevel#1#2%
-% {\let\currentlevel\somesavedlevel
-% \chardef\alltoclevels\zerocount}
-
-\def\dontsetfilterlevel#1#2%
- {\let\currentlevel\somesavedlevel
- \let\@@sectiontype\@@tocsectiontype
- \chardef\alltoclevels\zerocount}
-
-\def\honorlocalfilterlevel % local lists will be real local
- {\let\dosetfilterlevel\dontsetfilterlevel}
-
-% cleaner
-%
-% \def\doifnextlevelelse[#1::#2]#3#4%
-% {\ifcase\alltoclevels
-% \doifelse{\@@sectiontype}{#1}
-% {\doifinstringelse{=\currentlevel:}{=:#2:}
-% {\doifinstringelse{=\currentlevel:0}{=:#2:}{#4}{#3}}
-% {#4}}
-% {#4}%
-% \else
-% #3%
-% \fi}
-%
-% \def\doifprevlevelelse[#1::#2]#3#4%
-% {\ifcase\alltoclevels
-% \doifelse{\@@sectiontype}{#1}
-% {\doifinstringelse{=\currentlevel:}{=:#2:}{#3}{#4}}
-% {#4}%
-% \else
-% #3%
-% \fi}
-%
-% faster
-%
-% \def\doifnextlevelelse[#1::#2]%
-% {\ifcase\alltoclevels
-% \doifelse{\@@sectiontype}{#1}
-% {\doifinstringelse{=\currentlevel:}{=:#2:}
-% {\doifinstringelse{=\currentlevel:0}{=:#2:}\donefalse\donetrue}
-% \donefalse}
-% \donefalse
-% \else
-% \donetrue
-% \fi
-% \ifdone
-% \expandafter\firstoftwoarguments
-% \else
-% \expandafter\secondoftwoarguments
-% \fi}
-%
-% \def\doifprevlevelelse[#1::#2]%
-% {\ifcase\alltoclevels
-% \doifelse{\@@sectiontype}{#1}
-% {\doifinstringelse{=\currentlevel:}{=:#2:}\donetrue\donefalse}
-% \donefalse
-% \else
-% \donetrue
-% \fi
-% \ifdone
-% \expandafter\firstoftwoarguments
-% \else
-% \expandafter\secondoftwoarguments
-% \fi}
-%
-% meaner
-%
-% \setuplist
-% [chapter]
-% [after={\startcolumns\placelist[section]\stopcolumns}]
-
-\def\somesavedlevel{0}
-
-% \def\dosavesomelevel[#1:0:0:0:#2]%
-% {\def\somesavedlevel{:#1}}
-
-% \def\doifnextlevelelse[#1::#2]%
-% {\dosavesomelevel[#2:0:0:0:0]%
-% \ifcase\alltoclevels
-% \doifelse{\@@sectiontype}{#1}
-% {\doifinstringelse{=\currentlevel:}{=:#2:}
-% {\doifinstringelse{=\currentlevel:0}{=:#2:}\donefalse\donetrue}
-% \donefalse}
-% \donefalse
-% \else
-% \donetrue
-% \fi
-% \ifdone
-% \expandafter\firstoftwoarguments
-% \else
-% \expandafter\secondoftwoarguments
-% \fi}
-%
-% \def\doifprevlevelelse[#1::#2]%
-% {\dosavesomelevel[#2:0:0:0:0]%
-% \ifcase\alltoclevels
-% \doifelse{\@@sectiontype}{#1}
-% {\doifinstringelse{=\currentlevel:}{=:#2:}\donetrue\donefalse}
-% \donefalse
-% \else
-% \donetrue
-% \fi
-% \ifdone
-% \expandafter\firstoftwoarguments
-% \else
-% \expandafter\secondoftwoarguments
-% \fi}
-%
-% again faster:
-
-% \def\doifnextlevelelse[#1::#2]% beware: this one is \let
-% {\dosavesomelevel[#2:0:0:0:0]%
-% \ifcase\alltoclevels
-% \ifnum\@@sectiontype=#1
-% \def\levelstring{=:#2:}%
-% \doifincsnameelse{=\currentlevel:}\levelstring
-% {\doifincsnameelse{=\currentlevel:0}\levelstring\donefalse\donetrue}
-% \donefalse
-% \else
-% \donefalse
-% \fi
-% \else
-% \donetrue
-% \fi
-% \ifdone
-% \expandafter\firstoftwoarguments
-% \else
-% \expandafter\secondoftwoarguments
-% \fi}
-%
-%\def\doifprevlevelelse[#1::#2]% beware: this one is \let
-% {\dosavesomelevel[#2:0:0:0:0]%
-% \ifcase\alltoclevels
-% \ifnum\@@sectiontype=#1
-% \doifinstringelse{=\currentlevel:}{=:#2:}\donetrue\donefalse
-% \else
-% \donefalse
-% \fi
-% \else
-% \donetrue
-% \fi
-% \ifdone
-% \expandafter\firstoftwoarguments
-% \else
-% \expandafter\secondoftwoarguments
-% \fi}
-%
-% \let\doiftoclevelelse\doifnextlevelelse
-% \let\doifreglevelelse\doifprevlevelelse
-% \let\doifblklevelelse\doifprevlevelelse
-%
-% we want to be able to overload them globally
-
-% This will be reimplemented some day soon
-%
-% {nn}{xx}{yy}
-%
-% -> \scan{..}{..}{0} met 0 als sentinel
-
-% still not perfect
-%
-% \def\doifnextlevelelse[#1]% !! this one is \let / uti seperator --
-% {\edef\somesavedlevel{\sectionseparator\@@filterlevelpart[#1]}%
-% \ifcase\alltoclevels
-% \ifnum\@@sectiontype=\@@filterblockpart[#1]\relax
-% \edef\levelstring{=\sectionseparator\@@filternumberpart[#1]\sectionseparator}%
-% \doifincsnameelse{=\currentlevel\sectionseparator}\levelstring
-% {\doifincsnameelse{=\currentlevel\sectionseparator0}\levelstring
-% \donefalse
-% \donetrue}
-% \donefalse
-% \else
-% \donefalse
-% \fi
-% \else
-% \donetrue
-% \fi
-% \ifdone
-% \expandafter\firstoftwoarguments
-% \else
-% \expandafter\secondoftwoarguments
-% \fi}
-%
-% \def\doifprevlevelelse[#1]% !! this one is \let / uti seperator --
-% {\edef\somesavedlevel{\sectionseparator\@@filterlevelpart[#1]}%
-% \ifcase\alltoclevels
-% \ifnum\@@sectiontype=\@@filterblockpart[#1]\relax
-% \doifinstringelse
-% {=\currentlevel\sectionseparator}
-% {=\sectionseparator\@@filternumberpart[#1]\sectionseparator}
-% \donetrue\donefalse
-% \else
-% \donefalse
-% \fi
-% \else
-% \donetrue
-% \fi
-% \ifdone
-% \expandafter\firstoftwoarguments
-% \else
-% \expandafter\secondoftwoarguments
-% \fi}
-
-\def\doifnextlevelelse[#1]% !! this one is \let / uti seperator --
- {\edef\somesavedlevel{\sectionseparator\@@filterlevelpart[#1]}%
- \edef\@@tocsectiontype{\@@filterblockpart[#1]}% needed for nested tocs
- \ifcase\alltoclevels
- \ifnum\@@sectiontype=\@@tocsectiontype\relax
- \edef\levelstring{=\sectionseparator\@@filternumberpart[#1]\sectionseparator}%
- \doifincsnameelse{=\currentlevel\sectionseparator}\levelstring
- {\doifincsnameelse{=\currentlevel\sectionseparator0}\levelstring
- \donefalse
- \donetrue}
- \donefalse
- \else
- \donefalse
- \fi
- \else
- \donetrue
- \fi
- \ifdone
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\def\doifprevlevelelse[#1]% !! this one is \let / uti seperator --
- {\edef\somesavedlevel{\sectionseparator\@@filterlevelpart[#1]}%
- \edef\@@tocsectiontype{\@@filterblockpart[#1]}% needed for nested tocs
- \ifcase\alltoclevels
- \ifnum\@@sectiontype=\@@tocsectiontype\relax
- \doifinstringelse
- {=\currentlevel\sectionseparator}
- {=\sectionseparator\@@filternumberpart[#1]\sectionseparator}
- \donetrue\donefalse
- \else
- \donefalse
- \fi
- \else
- \donetrue
- \fi
- \ifdone
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-% we need to cover the special case of nested lists in section blocks
-%
-% \starttext
-%
-% \def\ChapterEntry#1#2#3%
-% {chapter : \hbox to \hsize{\strut\bf#2\hss#3}\endgraf\placelist[section]}
-%
-% \startfrontmatter % optional
-% \placelist[chapter][alternative=command,command=\ChapterEntry,criterium=text] \page
-% \stopfrontmatter % optional
-%
-% \startbodymatter % optional
-% \chapter{first} \section{one} test \section{two} test \page
-% \chapter{second} \section{alpha} test \section{beta} test \page
-% \stopbodymatter % optional
-%
-% \stoptext
-
-\def\doiftoclevelelse{\doifnextlevelelse}
-\def\doifreglevelelse{\doifprevlevelelse}
-\def\doifblklevelelse{\doifprevlevelelse}
-
-\def\@@longformatnumber#1%
- {\csname\previoussection{#1}\s!format\endcsname
- \sectionseparator
- \@@shortsectionnumber{#1}}
-
-% \def\@@longsectionnumber#1%
-% {\ifnum\countervalue{\??se\previoussection{#1}}>\zerocount
-% \csname\previoussection{#1}\c!nummer\endcsname.%
-% \fi
-% \@@shortsectionnumber{#1}}
-
-\def\@@longsectionnumber#1%
- {\ifreversesectionnumbers
- \@@shortsectionnumber{#1}%
- \ifnum\countervalue{\??se\previoussection{#1}}>\zerocount
- .\csname\previoussection{#1}\c!number\endcsname
- \fi
- \else
- \ifnum\countervalue{\??se\previoussection{#1}}>\zerocount
- \csname\previoussection{#1}\c!number\endcsname.%
- \fi
- \@@shortsectionnumber{#1}%
- \fi}
-
-% suited for chinese too:
-%
-% \def\@@shortsectionnumber#1%
-% {\@EA\ifx\csname\??se#1\@@sectionblock\c!conversie\endcsname\relax
-% \@@sectionvalue{#1}%
-% \else
-% \@@sectionconversion{#1}{\@@sectionvalue{#1}}%
-% \fi}
-%
-% obey eigennummer
-%
-% \def\@@shortsectionnumber#1%
-% {\@EA\ifx\csname\??se#1\c!eigennummer\endcsname\relax
-% \@EA\ifx\csname\??se#1\@@sectionblock\c!conversie\endcsname\relax
-% \@EA\ifx\csname\??se#1\c!conversie\endcsname\relax
-% \@@sectionvalue{#1}%
-% \else
-% \@@sectionconversion{#1}{\@@sectionvalue{#1}}%
-% \fi
-% \else
-% \@@sectionconversion{#1}{\@@sectionvalue{#1}}%
-% \fi
-% \else
-% \csname\??se#1\c!eigennummer\endcsname
-% \fi}
-
-\def\@@shortsectionnumber#1%
- {\@EA\ifx\csname\??se#1\c!ownnumber\endcsname\relax
- \@EA\ifx\csname\??se#1\@@sectionblock\c!conversion\endcsname\relax
- \@EA\ifx\csname\??se#1\c!conversion\endcsname\relax
- \@@sectionvalue{#1}%
- \else
- \@@sectionconversion{#1}{\@@sectionvalue{#1}}%
- \fi
- \else
- \@@sectionconversion{#1}{\@@sectionvalue{#1}}%
- \fi
- \else
- \csname\??se#1\c!ownnumber\endcsname
- \fi}
-
-\def\dosetlocalsectionblock#1#2#3% new \edef's
- {\edef\@@sectiontype {#1}%
- \edef\@@sectionblock {#2}%
- \edef\@@sectionblocks{#3}}
-
-% beware, the \resetsectionmarks generates some nodes that
-% will result in an additional last page, which needs to be
-% captured at the end
-
-% \def\doaroundsectionblock#1%
-% {\doifvaluesomething{\??sb#1\c!page}
-% {\ExpandFirstAfter\page[\getvalue{\??sb#1\c!page}]}%
-% \resetsectioncounters\zerosection % was firstsection
-% \resetsectionmarks\zerosection}
-
-% \def\dostartsectionblock#1#2%
-% {\begingroup
-% \doaroundsectionblock{#1}% % going to a new page or so
-% \getvalue{\??sb#1}% % set name of section block
-% \getsectionblockenvironment{#1}% % special settings, grouped
-% %\expandafter\csname#2true\endcsname % obsolete
-% \setsystemmode{#1}% % can be used in conditionals
-% \getvalue{\??sb\@@sectionblock\c!before}% this one is not to be moved!
-% \showmessage\m!structures1\@@sectionblocks}
-
-% \def\dostopsectionblock
-% {\showmessage\m!structures2\@@sectionblocks
-% \getvalue{\??sb\@@sectionblock\c!after}% don't move
-% \doaroundsectionblock\@@sectionblock
-% \endgroup}
-
-\def\doaroundsectionblock
- {\doifvaluesomething{\??sb\@@sectionblock\c!page}
- {\page[\getvalue{\??sb\@@sectionblock\c!page}]}%
- \resetsectioncounters\zerosection % was firstsection
- \resetsectionmarks\zerosection}
-
-\def\dostartsectionblock#1#2%
- {\begingroup
- \getvalue{\??sb#1}%
- \doaroundsectionblock
-% \doifvaluesomething{\??sb\@@sectionblock\c!page}{\page[\getvalue{\??sb\@@sectionblock\c!page}]}%
-% \resetsectioncounters\zerosection % was firstsection
-% \resetsectionmarks\zerosection
- \getsectionblockenvironment\@@sectionblock
- \setsystemmode\@@sectionblock
- \getvalue{\??sb\@@sectionblock\c!before}%
- \showmessage\m!structures1\@@sectionblocks}
-
-\def\dostopsectionblock
- {\showmessage\m!structures2\@@sectionblocks
- \getvalue{\??sb\@@sectionblock\c!after}% don't move
- \doaroundsectionblock
-% \doifvaluesomething{\??sb\@@sectionblock\c!page}{\page[\getvalue{\??sb\@@sectionblock\c!page}]}%
-% \resetsectioncounters\zerosection % was firstsection
-% \resetsectionmarks\zerosection
- \endgroup}
-
-\def\dosetupsectionblock[#1]% [#2]
- {\getparameters[\??sb#1]}
-
-\def\setupsectionblock
- {\dodoubleargument\dosetupsectionblock}
-
-\long\def\setsectionblockenvironment#1#2%
- {\long\setvalue{\??sb\s!do#1}{\do{#2}}}
-
-\def\getsectionblockenvironment#1%
- {\let\do\firstofoneargument\getvalue{\??sb\s!do#1}}
-
-\setvalue{\e!start\v!sectionblockenvironment}%
- {\dosingleargument\dostartsectionblockenvironment}
-
-\def\dostartsectionblockenvironment[#1]% evt \pushendofline \popendofline
- {\long\def\do##1##2{\setsectionblockenvironment{#1}{##1##2}}%
- \grabuntil{\e!stop\v!sectionblockenvironment}{\getvalue{\??sb\s!do#1}}}
-
-%D \starttyping
-%D \startsectionblockenvironment[frontpart]
-%D \setuppagenumbering[conversion=romannumerals]
-%D \stopsectionblockenvironment
-%D
-%D \startsectionblockenvironment[bodypart]
-%D \setuppagenumber[number=1]
-%D \stopsectionblockenvironment
-%D
-%D \startsectionblockenvironment[frontpart]
-%D \setuppagenumbering[conversion=character]
-%D \stopsectionblockenvironment
-%D
-%D \starttext
-%D \startfrontmatter \chapter{test} \stopfrontmatter
-%D \startbodymatter \chapter{test} \stopbodymatter
-%D \startappendices \chapter{test} \stopappendices
-%D \stoptext
-%D \stoptyping
-
-% We used to use the first char as id, but a counter is
-% better, because in english we get a name clash.
-
-\newcounter\currentsectionblock
-
-\def\currentsection{\@@sectionblock}
-
-\def\dodefinesectionblock[#1][#2][#3]%
- {\getparameters
- [\??sb#1]
- [\c!number=\v!yes,
- \c!page=\v!right, % anders worden marks te vroeg gereset !
- %\c!before=,
- %\c!after=,
- #3]%
- \expandafter\newif\csname if#2\endcsname % better a mode
- \doglobal\increment\currentsectionblock
- \setsectionblockenvironment{#1}{}%
- \setevalue{\??sb #1}{\noexpand\dosetlocalsectionblock{\currentsectionblock}{#1}{#2}}%
- \setvalue {\e!start#2}{\dostartsectionblock{#1}{#2}}%
- \setvalue {\e!stop #2}{\dostopsectionblock}}
-
-\def\definesectionblock
- {\dotripleargument\dodefinesectionblock}
-
-\def\sectionblocklabel#1#2%
- {\@EA\ifx\csname\??ko#1\@@sectionblock\c!label\endcsname\relax
- \labeltexts{#1}{#2}%
- \else
- \labeltexts{\getvalue{\??ko#1\@@sectionblock\c!label}}{#2}%
- \fi}
-
-\dosetlocalsectionblock{2}{\v!bodypart}{\v!bodymatter} % hm, dirty
-
-\def\setsectiontype[#1]%
- {\getvalue{\??sb#1}}
-
-\def\writesection#1#2#3% #3 -> \asciititle
- {\bgroup
- \edef\!!stringa{#1}%
- \@EA\writestatus\@EA
- {\!!stringa}
- {\ifsectionnumber#2\else(#2)\fi\normalspace\asciititle}%
- \egroup}
-
-\def\@@kolevel{1} \def\headlevel{\@@kolevel}
-
-\def\dohandlepagebreakAA#1%
- {\ifnum\lastpenalty>0
- \global\pagebreakdisabledtrue
- \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)
-% {\doifnotvalue{\??ko#1\c!aligntitle}\v!float\flushsidefloats
-% \getvalue{\??ko#1\c!before}%
-% % \whitespace vervangen door \noindent elders
-% \relax
-% \ifpagebreakdisabled
-% \global\pagebreakdisabledfalse
-% \else
-% \!!countb\getvalue{\??se\@@sectie\c!level}\relax
-% \ifnum\!!countb>\@@kolevel\relax
-% \!!counta20000
-% \multiply\!!countb 500
-% \advance\!!counta \!!countb
-% \dosomebreak{\penalty\!!counta}%
-% \else
-% \dosomebreak\allowbreak
-% \fi
-% \fi
-% \doifvalue{\??ko#1\c!aligntitle}\v!float\indent
-% \xdef\@@kolevel{\getvalue{\??se\@@sectie\c!level}}}
-
-\chardef\somebreakmethod\plusone
-
-\def\dohandlepagebreakAB#1% will be replaced by a more clever (signaling) mechanism (in beta)
- {\doifnotvalue{\??ko#1\c!aligntitle}\v!float\flushsidefloats
- \getvalue{\??ko#1\c!before}%
- % \whitespace vervangen door \noindent elders
- \relax
- \ifpagebreakdisabled
- \global\pagebreakdisabledfalse
- \else
- \ifcase\somebreakmethod
- % 0 = nothing
- \or
- % 1 = old weighted version
- \!!countb\getvalue{\??se\@@sectie\c!level}\relax
- \ifnum\!!countb>\@@kolevel\relax
- \!!counta20000
- \multiply\!!countb 500
- \advance\!!counta \!!countb
- \dosomebreak{\penalty\!!counta}%
- \else
- \dosomebreak\allowbreak % brr
- \fi
- \or
- % 2 = strict version
- \dosomebreak{\penalty\maxdimen}%
- \else
- % nothing
- \fi
- \fi
- \doifvalue{\??ko#1\c!aligntitle}\v!float\indent
- \xdef\@@kolevel{\getvalue{\??se\@@sectie\c!level}}}
-
-\def\dohandlepagebreakBB#1#2#3%
- {%\doifinsetelse{\getvalue{\??tk#2\c!state}}{\v!normal,\v!start}
- \doifelselayouttextline{#2}
- {\doifvaluesomething{\??ko#1#3}
- {\setuplayouttext[#2][\c!state=\getvalue{\??ko#1#3}]}}
- \donothing}
-
-\def\dohandlepagebreakB#1%
- {\doifvaluesomething{\??ko#1\c!page}
- {\def\resetcurrentsectionmarks% toegevoegd, zie \page
- {\resetsectionmarks{\previoussection\@@sectie}}%
- \page[\getvalue{\??ko#1\c!page}]%
- \dohandlepagebreakBB{#1}\v!header\c!header
- \dohandlepagebreakBB{#1}\v!text \c!text
- \dohandlepagebreakBB{#1}\v!footer\c!footer}}
-
-\def\dohandlepagebreakX#1% zie doordefinieren / boven
- {\bgroup
- \!!countb\@@kolevel
- \advance\!!countb #1
- \multiply\!!countb 500
- \!!counta20000
- \advance\!!counta \!!countb
- \dosomebreak{\penalty\!!counta}%
- \egroup}
-
-\newconditional\ignorehandlepagebreak
-
-\def\handlepagebreak#1%
- {\ifconditional\ignorehandlepagebreak
- \setfalse\ignorehandlepagebreak
- \else
- \dohandlepagebreakAA{#1}%
- \ifnum\countervalue{\??se\previoussection\@@sectie}>\zerocount\relax
- \ifnum\countervalue{\??se\@@sectie}>\zerocount
- \dohandlepagebreakB{#1}%
- \else
- \doifnotvalue{\??ko#1\c!continue}\v!yes{\dohandlepagebreakB{#1}}%
- \fi
- \else
- \dohandlepagebreakB{#1}%
- \fi
- \dohandlepagebreakAB{#1}%
- \fi}
-
-\def\handlenopagebreak#1%
- {\ifconditional\ignorehandlepagebreak
- \setfalse\ignorehandlepagebreak
- \else
- \xdef\@@kolevel{\getvalue{\??se\@@sectie\c!level}}%
- \nobreak
- \fi}
-
-\def\localheadheight {\strutht}
-\def\localheaddepth {\strutdp}
-\def\localheadlineheight{\lineheight}
-
-\def\dolocalheadsetup#1% koppeling met standaard kopcommando / engels
- {\forgetall % traag dus ...
- \doifvaluesomething{\??ko#1\c!align} % wordt al expanded in spa
- {\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
-
-% todo: make them conditionals:
-
-\newif\ifincrementnumber
-\newif\ifreversesectionnumbers % todo: key/val
-\newif\ifsectionnumber \sectionnumbertrue
-\newif\ifdisplaysectionhead \displaysectionheadtrue
-\newif\ifplacehead
-\newif\ifemptyhead
-\newif\ifwritetolist
-\newif\ifheadnumber
-\newif\ifheadnumbercontent % niet meer wijzigen / wordt mode
-\newif\ifheadprefix
-\newif\ifsomeheadconversion
-
-% new
-
-\newconditional\@@resetsubheadnumbers
-
-\def\setsectieenkoppeling#1%
- {\edef\@@koppeling{\getvalue{\??ko#1\c!coupling}}%
- \edef\@@sectie{\getvalue{\??ko#1\c!section}}%
- \doifnothing\@@koppeling
- {\edef\@@koppeling{#1}}%
- \doifnothing\@@sectie
- {\edef\@@sectie{\getvalue{\??ko\@@koppeling\c!section}}}}
-
-% \handlepagebreak komt het eerst omdat eventueel
-% subpaginanummers moeten worden afgehandeld. Vervolgens
-% worden de nummers opgehoogd en referenties geset, dan
-% volgt de kop en tot slot de worden de marks en de prefix
-% geset.
-
-% \hoofdstuk {tekst}
-% \hoofdstuk tekst
-% \hoofdstuk <niets>
-
-\let\finalsectionnumber\empty
-
-\def\dofinalsectionnumber
- {\ifundefined{\@@sectie\c!number}\else
- \ifsomeheadconversion
- \@@shortsectionnumber\@@sectie
- \else
- \getvalue{\@@sectie\c!number}%
- \fi
- \fi}
-
-\def\findsectionnumber#1#2#3% class file title / uti seperator --
- {\begingroup
- \setsectieenkoppeling{#1}%
- \xdef\foundsectionnumber{1}%
- \def\dolistelement##1##2##3##4##5##6%
- {\doif{##1}{#1}
- {\ConvertConstantAfter\doif{##4}{#3}
- {\global\utilitydonetrue
- \scratchcounter=0\getvalue{\??se\@@sectie\c!level}%
- %
- %\advance\scratchcounter 2
- %\@EA\def\@EA\do\@EA####\@EA1\sectionseparator####2]%
- % {\advance\scratchcounter -1
- % \ifcase\scratchcounter
- % \xdef\foundsectionnumber{####1}%
- % \else
- % \do####2]%
- % \fi}%
- %\do##5]}}}%
- %
- \def\do####1\relax % :/- clean
- {\advance\scratchcounter \minusone
- \ifcase\scratchcounter
- \xdef\foundsectionnumber{\@@filterheadpart[####1]}%
- \else
- \@EAEAEA\do\@@filtertailpart[####1]\relax
- \fi}%
- \@EA\do\@@filternumberpart[##5]\relax}}}%
- \setbox0\vbox
- {\doutilities{#1}{#2}{#1}\relax\relax}%
- \endgroup
- \doifnumberelse\foundsectionnumber
- {\doif\foundsectionnumber\!!zerocount
- {\globallet\foundsectionnumber\!!plusone}}
- {\globallet\foundsectionnumber\!!plusone}% an appendix or so
- \setupheadnumber[#1][\foundsectionnumber]%
- \setupheadnumber[#1][-1]}
-
-% deal with eigennummer
-
-\def\setsomeheadconversion#1#2%
- {\someheadconversionfalse
- \doifelsevalue{\??ko#1\c!ownnumber}\v!yes
- {\setgvalue{\??se\@@sectie\c!ownnumber}{#2}%
- \def\someheadconversion{#2}}
- {\letgvalue{\??se\@@sectie\c!ownnumber}\relax
- \determineheadnumber[#1]%
- \@EA\ifx\csname\??se\@@sectie\@@sectionblock\c!headconversion\endcsname\relax
- \@EA\ifx\csname\??se\@@sectie\c!headconversion\endcsname\relax
- \def\someheadconversion{#2}%
- \else
- \@EA\ifx\csname\??se\@@sectie\c!headconversion\endcsname\empty
- \def\someheadconversion{#2}%
- \else
- \someheadconversiontrue
- \def\someheadconversion%
- {\fullsectionnumber{#1}{\getvalue{\??se\@@sectie\c!headconversion}}{#2}}%
- \fi
- \fi
- \else
- \@EA\ifx\csname\??se\@@sectie\@@sectionblock\c!headconversion\endcsname\empty
- \def\someheadconversion{#2}%
- \else
- \someheadconversiontrue
- \def\someheadconversion%
- {\fullsectionnumber{#1}{\getvalue{\??se\@@sectie\@@sectionblock\c!headconversion}}{#2}}%
- \fi
- \fi}}
-
-\def\writtenfullsectionnumber
- {\string\fullsectionnumber}
-
-\def\ignoredfullsectionnumber#1#2#3%
- {#3}
-
-\let\storedfullsectionnumber\relax
-
-\def\expandablefullsectionnumber#1#2#3%
- {\convertnumber{#2}{#3}}
-
-\unexpanded\def\naturalfullsectionnumber#1#2#3%
- {\sectionblocklabel{#1}{\convertnumber{#2}{#3}}}
-
-\unexpanded\def\limitedfullsectionnumber#1#2#3%
- {\convertnumber{#2}{#3}}
-
-\def\setfullsectionnumber#1%
- {\doifelsevalue{#1\c!headconversion}\v!yes
- {\doifelsevalue{#1\c!headlabel}\v!yes
- {\let\fullsectionnumber\naturalfullsectionnumber}
- {\let\fullsectionnumber\limitedfullsectionnumber}}
- {\let\fullsectionnumber\ignoredfullsectionnumber}}
-
-\let\fullsectionnumber\limitedfullsectionnumber
-
-% from cont-new:
-
-\def\expandifnonempty#1%
- {\@EA\ifx\csname#1\endcsname\empty
- \expandafter\secondoftwoarguments
- \else
- \expandafter\firstoftwoarguments
- \fi
- {\csname#1\endcsname}}
-
-\def\@@sectiekoppeling#1%
- {\expandifnonempty{\??ko#1\c!coupling}{#1}}
-
-\def\@@sectiesectie#1%
- {\expandifnonempty{\??ko#1\c!section}{\@@sectiekoppeling{#1}}}
-
-\def\sectioncountervalue#1%
- {\@@sectionvalue{\@@sectiesectie{#1}}}
-
-% \dodododoconstructhead IS NON GROUPED, SO WE NEED TO RESTORE !!!!
-%
-% dit kan dus beter \everyaroundhead zijn
-
-\let\currentheadnumber\empty
-\let\currentheadtext \empty
-
-\def\dodoconstructhead#1[#2]#3% [ref] {title}
- {\doifelsevalue{\??ko#1\c!ownnumber}\v!yes
- {\doquadruplegroupempty\dododoconstructhead{#1}{#2}{#3}}
- {\fourthargumentfalse \dododoconstructhead{#1}{#2}{#3}{}}}
-
-\def\dododoconstructhead#1#2#3#4% [ref] {own} {title}
- {\iffourthargument
- \def\next{\dodododoconstructhead{#1}[#2]{#3}{#4}}%
- \else
- \def\next{\dodododoconstructhead{#1}[#2]{\finalsectionnumber}{#3}}%
- \fi
- \next}
-
-% pas met \ExpandFirstAfter op bij twee||taligheid
-
-\ifx\dohandleheadnumber\undefined
- \let\dohandleheadnumber\firstofoneargument
-\fi
-
-\unexpanded\def\\{\space}
-
-\def\emptyheadcorrection % experimental, should work
- {\ifemptyhead % well with na=\blank
- \vskip-\lineheight
- \dosomebreak\nobreak
- \kern\zeropoint
- \prevdepth\strutdepth
- \fi}
-
-\let\localkopprefix\empty
-
-\def\headparameter#1% to do: everywhere in core-sec
- {\executeifdefined{\??ko\currenthead#1}\empty}
-
-% todo: write to list etc in both args or in enclosing h/vbox else it gets
-% lost when no #1 or #2 is typeset
-
-% we will use variables here
-
-\def\dodododoconstructhead#1[#2]#3#4% [ref] {number} {title}
- {\def\currenthead{#1}% dus #1 overal vervangen
- \let\finalsectionnumber\dofinalsectionnumber % overloaded ungrouped -)
- \unexpanded\def\\{\space}%
- \edef\numberseparator{\spr{\getvalue{\??ko\currenthead\c!separator}}}%
- \flushingcolumnfloatsfalse % {number} can be \finalsectionnumber
- \someheadconversionfalse
- \let\fullsectionnumber\limitedfullsectionnumber
- \setsectieenkoppeling{#1}%
- \doifelsevaluenothing{\??ko#1\c!prefix}
- \headprefixfalse\headprefixtrue
- \ifheadprefix
- \doifelsevalue{\??ko#1\c!prefix}{+}
- {\doifelsenothing{#2}
- {\def\localkopprefix{+}}
- {\def\localkopprefix{#2}}} % eigenlijk alleen eerste
- {\edef\localkoprefix{\getvalue{\??ko#1\c!prefix}}}%
- \else
- \let\localkoprefix\empty
- \fi
- \placeheadtrue
- \processaction
- [\getvalue{\??ko#1\c!placehead}]
- [ \v!yes=>\emptyheadfalse,
- \v!empty=>\emptyheadtrue,
- \v!no=>\emptyheadtrue\placeheadfalse]%
- \doifelsevalue{\??ko#1\c!resetnumber}\v!no
- {\setfalse\@@resetsubheadnumbers}%
- {\settrue \@@resetsubheadnumbers}%
- \writetolistfalse
- \processaction
- [\getvalue{\??ko#1\c!incrementnumber}]
- [ \v!yes=>\incrementnumbertrue,
- \v!no=>\incrementnumberfalse,
- \v!list=>\incrementnumberfalse
- % beware, since no numbers are used, no nested lists are
- % possible here
- \writetolisttrue,
- \s!unknown=>{\ifx\currentproduct\empty
- \findsectionnumber{#1}\commalistelement{#4}%
- \fi
- \incrementnumbertrue}]%
- \edef\numberheaddistance {\getvalue{\??ko#1\c!distance}}%
- \edef\numberheadalternative{\getvalue{\??ko#1\c!alternative}}%
- \doifelsevalue{\??ko:\numberheadalternative}\v!horizontal
- \displaysectionheadfalse
- \displaysectionheadtrue
- \ifsectionnumber
- \doifelsevalue{\??sb\@@sectionblock\c!number}\v!yes
- {\doifelsevalue{\??ko#1\c!number}\v!yes
- \headnumbertrue
- \headnumberfalse}
- {\headnumberfalse}%
- \else
- \headnumberfalse
- \fi
- \defconvertexpanded\asciititle{\getvalue{\??ko#1\c!expansion}}{#4}%
- %
- \gdef\currentheadtext{#4}% scheelt args
- \globallet\currentheadnumber\empty
- %
- \ifincrementnumber
- \ifplacehead
- \checknexthead\handlepagebreak{#1}%
- \setsectieenkoppeling{#1}% can be changed when [voor=\somehead{..}...]
- \ifheadprefix
- %\setupreferencing[\c!prefix=-]%
- \setupreferenceprefix[-]%
- \fi
- \getvalue{\e!next\@@sectie}%
- \ifheadnumber
- \setsomeheadconversion{#1}{#3}%
- \let\fullsectionnumber\expandablefullsectionnumber
- \xdef\currentheadnumber{\someheadconversion}%
- \getvalue{\??ko#1\c!inbetween}%
- \ifsomeheadconversion
- \let\fullsectionnumber\naturalfullsectionnumber
- \doplaceheadnumbertext
- {#1}
- {\setsectionlistreference{\@@sectie}{#1}%
- \pagetype[\@@koppeling]%
- \let\fullsectionnumber\writtenfullsectionnumber
- \rawreference\s!sec{#2}{{\someheadconversion}{\asciititle}}%
- \resetsectionmarks\@@sectie
- \setlistparameter\@@koppeling\c!expansion{\getvalue{\??ko#1\c!expansion}}%
- \let\fullsectionnumber\writtenfullsectionnumber
- \dowritetolist\@@koppeling\someheadconversion{#4}\v!head}%
- {\dohandleheadnumber\someheadconversion}% handle is new
- {#4}
- {\marking[#1]{#4}%
- \let\fullsectionnumber\storedfullsectionnumber
- \expanded{\marking[#1\v!number]{\someheadconversion}}}%
- \let\fullsectionnumber\ignoredfullsectionnumber
- \writesection{#1}{\someheadconversion}{#4}%
- \else
- \doplaceheadnumbertext
- {#1}
- {\setsectionlistreference{\@@sectie}{#1}%
- \pagetype[\@@koppeling]%
- \rawreference\s!sec{#2}{{#3}{\asciititle}}%
- \resetsectionmarks\@@sectie
- \setlistparameter\@@koppeling\c!expansion{\getvalue{\??ko#1\c!expansion}}%
- \dowritetolist\@@koppeling{#3}{#4}\v!head}
- {\sectionblocklabel{#1}{\dohandleheadnumber{#3}}}% handle is new
- {#4}
- {\marking[#1]{#4}%
- \doifelsevalue{\??ko#1\c!ownnumber}\v!yes % rommelig omdat
- {\edef\finalsectionnumber{#3}} % #3 al is toegekend
- {\determineheadnumber[#1]}% migreert naar 3e argument
- \expanded{\marking[#1\v!number]{\finalsectionnumber}}}%
- \writesection{#1}{#3}{#4}%
- \fi
- \else
- \getvalue{\??ko#1\c!inbetween}%
- \doplaceheadtext
- {#1}
- {\setsectionlistreference{\@@sectie}{#1}%
- \pagetype[\@@koppeling]%
- \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}
- {#4}
- {\marking[#1]{#4}%
- \doifelsevalue{\??ko#1\c!ownnumber}\v!yes % brrr
- {\edef\finalsectionnumber{#3}}
- {\determineheadnumber[#1]}%
- % todo : geen markering (leeg maken)
- \expanded{\marking[#1\v!number]{\finalsectionnumber}}}%
- \writesection{#1}{-}{#4}%
- \fi
- \ifheadprefix
- \setupreferenceprefix[\localkopprefix]%
- \fi
- \ifdisplaysectionhead
- \dosomebreak\nobreak
- \emptyheadcorrection
- \getvalue{\??ko#1\c!after}%
- \fi
- \else
- % Whatever future tex's will do with nodes,
- % we assume a node here, because other \c!after=\blank
- % will fail! See 'prikkels'
- %
- % so, maybe we need an explicit \kern
- %
- % do nothing / should be vbox to 0pt
- %
- \checknexthead\dohandlepagebreakB{#1}% toegevoegd ivm subpaginanr / tug sheets
- \setsectieenkoppeling{#1}% can be changed when [voor=\somehead{..}...]
- \ifheadprefix
- \setupreferenceprefix[-]%
- \fi
- \getvalue{\e!next\@@sectie}%
- \ifheadnumber
- \setsomeheadconversion{#1}{#3}%
- \let\fullsectionnumber\expandablefullsectionnumber
- \xdef\currentheadnumber{\someheadconversion}%
- \fi
- \getvalue{\??ko#1\c!inbetween}% documenteren, is enige hook
- \bgroup
- \setsectionlistreference{\@@sectie}{#1}%
- \resetsectionmarks\@@sectie
- \marking[#1]{#4}%
- \doifelsevalue{\??ko#1\c!ownnumber}\v!yes
- {\edef\finalsectionnumber{#3}}
- {\determineheadnumber[#1]}%
- \expanded{\marking[#1\v!number]{\finalsectionnumber}}%
- \pagetype[\@@koppeling]%
-% \bgroup
- \setlistparameter\@@koppeling\c!expansion{\getvalue{\??ko#1\c!expansion}}%
- \ifheadnumber
- \rawreference\s!sec{#2}{{#3}{\asciititle}}%
- \dowritetolist\@@koppeling{#3}{#4}\v!head
- \writesection{#1}{#3}{#4}%
- \else % hm, also no own number
- \rawreference\s!sec{#2}{{#3}{\asciititle}}%
- \dowritetolist\@@koppeling{}{#4}\v!head
- \writesection{#1}{-}{#4}%
- \fi
- \egroup
- \ifheadprefix
- \setupreferenceprefix[\localkopprefix]%
- \fi
- \fi
- \else
- % todo : ref prefix
- \ifplacehead
- \checknexthead\handlepagebreak{#1}%
- \setsectieenkoppeling{#1}% can be changed when [voor=\somehead{..}...]
- \getvalue{\??ko#1\c!inbetween}%
- \doplaceheadtext
- {#1}
- {\forcesectiontolist{#1}{#4}%
- \rawreference\s!sec{#2}{{#3}{\asciititle}}} % #3 ?
- {#4}
- %{}% new:
- {\marking[#1]{#4}%
- \marking[#1\v!number]{}}%
- \writesection{#1}{-}{#4}%
- \ifdisplaysectionhead
- \dosomebreak\nobreak
- \emptyheadcorrection
- \getvalue{\??ko#1\c!after}%
- \fi
- \else
- % do nothing / should be vbox to 0pt
- \checknexthead\handlepagebreak{#1}%
- \setsectieenkoppeling{#1}% can be changed when [voor=\somehead{..}...]
- \getvalue{\??ko#1\c!inbetween}%
- \forcesectiontolist{#1}{#4}%
- \rawreference\s!sec{#2}{{#3}{\asciititle}}% #3 ?
- \marking[#1]{#4}%
- \marking[#1\v!number]{}%
- \writesection{#1}{-}{#4}%
- \fi
- \fi
- \flushingcolumnfloatstrue
- \someheadconversionfalse
- \setfalse\ignorehandlepagebreak
- \let\fullsectionnumber\limitedfullsectionnumber
- % ignorespaces prevents spaces creeping in when after=\dontleavehmode
- \ifdisplaysectionhead\ignorespaces\else\expandafter\GotoPar\fi}
-
-\def\forcesectiontolist#1#2%
- {\ifwritetolist
- % we need to make sure that there is a number set (non
- % zero) else the list mechanism cannot determine the
- % level
- \bgroup
- \setupheadnumber[#1][+1]% traag, wordt \getvalue{\c!next...}
- \setlistparameter\@@koppeling\c!expansion{\getvalue{\??ko#1\c!expansion}}%
- \dowritetolist\@@koppeling{}{#2}\v!head
- \setupheadnumber[#1][-1]% traag, wordt \getvalue{\c!previous...}
- \egroup
- \fi}
-
-\let\previoussectionformat\empty
-\let\currentsectionformat \empty
-
-\let\updatelistreferences \relax
-\let\updatedlistreferences\empty
-
-\def\setsectionlistreference#1#2%
- {\ifnum\countervalue{\??se\previoussection{#1}}>0\relax
- \xdef\previoussectionformat{\@@longformatnumber{\previoussection{#1}}}%
- \else
- \globallet\previoussectionformat\empty
- \fi
- \xdef\currentsectionformat{\@@longformatnumber{#1}}}
-
-\def\startlistreferences#1%
- {\thisissomeinternal{\s!lst}{#1\currentsectionformat}%
- \setxvalue{\s!lst:#1}{\realfolio}% to be sure
- \setxvalue{\s!lst:#1\currentsectionformat}{\realfolio}%
- \setxvalue{\e!previouslocal#1}{\s!lst:#1\previoussectionformat}%
- \setxvalue{\e!currentlocal#1}{\s!lst:#1\currentsectionformat}%
- \doifelse{\currentsectionformat}{}
- {\setglobalcrossreference
- {\e!previous#1}{}{\realfolio}{}}
- {\setglobalsystemreference\rt!list
- {\e!previous#1}{\getvalue{\e!previouslocal#1}}}%
- \def\stoplistreferences{\dostoplistreferences{#1}}}
-
-\def\dostoplistreferences#1%
- {\ifutilitydone
- \addtocommalist{#1}\updatedlistreferences % nog global (\doglobal)
- \globallet\updatedlistreferences\updatedlistreferences % een noodverbandje
- \gdef\updatelistreferences%
- {\def\docommand####1%
- {\setglobalsystemreference\rt!list
- {\e!previous####1}{\getvalue{\e!currentlocal####1}}}%
- \processcommacommand[\updatedlistreferences]\docommand
- \globallet\updatelistreferences\relax
- \globallet\updatedlistreferences\empty}%
- \fi}
-
-\let\stoplistreferences\relax
-
-\appendtoks
- \updatelistreferences
-\to\aftereverypage
-
-% \prevdepth\strutdp % is belangrijk, vergelijk naast elkaar:
-%
-% \subject{test} \input tufte
-% \subject{test} \strut \input tufte
-% \subject{test} \placelist[...]
-
-% todo: kap
-
-% to be documented: \placeheadtext \placeheadnumber
-
-\unexpanded\def\placeheadtext
- {\doquintupleempty\doplaceheadtextornumber
- [\c!textstyle][\c!textcolor][\empty]}
-
-\unexpanded\def\placeheadnumber
- {\doquintupleempty\doplaceheadtextornumber
- [\c!numberstyle][\c!numbercolor][\v!number]}
-
-\def\doplaceheadtextornumber[#1][#2][#3][#4][#5]%
- {\bgroup
- \edef\@@sectie{\??ko\iffifthargument#5\else#4\fi}%
- \dostartattributes\@@sectie\c!style\c!color\empty
- \dontconvertfont
- \dostartattributes\@@sectie{#1}{#2}\empty
- \setupinterlinespace
- \begstrut\getmarking[\mainmarking{#4#3}]\endstrut
- \endgraf
- \dostopattributes
- \dostopattributes
- \egroup}
-
-\chardef\headtimingmode=0
-
-% \chardef\headtimingmode=1 % 0 also works ok now too
-%
-% Martin Kolarik's problem:
-%
-% \setuphead[section][command=\doTitle]
-%
-% \def\doTitle#1#2%
-% {\ruledvbox{\forgetall \hsize=4cm
-% \ruledhbox{\ruledvtop{#1}\ruledvtop{#2}}}}
-%
-% \section{test test test test test test test test test test
-% test test test test test test test}
-
-\newevery \everyheadstart \relax
-
-\def\placeheadmargintexts#1%
- {\the\everyheadstart
- \doifvalue{\??ko#1\c!margintext}\v!yes\placemargincontent}
-
-\def\doplaceheadtext#1#2#3#4%
- {\beginheadplacement{#1}%
- \ifemptyhead % = needed
- \setbox0=\ifvertical\vbox\else\hbox\fi to \zeropoint
- {\headnumbercontentfalse
- \resetsystemmode\v!sectionnumber
- #2}%
- \makestrutofbox0
- \else % = needed
- \setbox0=\ifvertical\vbox\else\hbox\fi % \vhbox
- {\headnumbercontentfalse
- \resetsystemmode\v!sectionnumber
- % less interfering
- \ifcase\headtimingmode\or#2\fi
- % 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
- \getvalue{\??ko#1\c!command}
- {} % no number
- {\dostartattributes{\??ko#1}\c!style\c!color\empty
- \dostartattributes{\??ko#1}\c!textstyle\c!textcolor\empty
- \dontconvertfont
- \ifdisplaysectionhead
- \setupinterlinespace
- \else
- \setupspacing
- \fi
- % \ifcase\headtimingmode#2\fi % can introduce cr
- \getvalue{\??ko#1\c!commandbefore}%
- \placeheadmargintexts{#1}% binnen #3?
- \ifdisplaysectionhead
- \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
- \else
- \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
- \dostopattributes
- \dostopattributes}}%
- \fi
- \endheadplacement{#1}{#4}}
-
-\def\doplaceheadnumbertext#1#2#3#4#5% maybe move modes outside box
- {\beginheadplacement{#1}%
- \ifemptyhead % = needed
- \setbox0=\ifvertical\vbox\else\hbox\fi to \zeropoint
- {\doiftextelse{#3}
- {\setsystemmode \v!sectionnumber\headnumbercontenttrue }
- {\resetsystemmode\v!sectionnumber\headnumbercontentfalse}%
- #2}%
- \makestrutofbox0
- \else % = needed
- \setbox0=\ifvertical\vbox\else\hbox\fi % \vhbox
- {\doiftextelse{#3}
- {\setsystemmode \v!sectionnumber\headnumbercontenttrue }
- {\resetsystemmode\v!sectionnumber\headnumbercontentfalse}%
- % less interfering
- \ifcase\headtimingmode\or#2\fi
- % outerside font determines distance
- \dosetfontattribute{\??ko#1}\c!style
- % but we don't want color to influence user commands
- \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}% strange, why here? moved 21/11/2005
- \placeheadmargintexts{#1}% binnen #3?
- \ifdisplaysectionhead
- % can be nilled with \setnostrut
- \getvalue{\??ko#1\c!numbercommand}%
- {\setstrut
- \begstrut
- \executeifdefined{\??ko#1\c!deepnumbercommand}\firstofoneargument{#3}%
- \endstrut}%
- \else
- \getvalue{\??ko#1\c!numbercommand}%
- {\executeifdefined{\??ko#1\c!deepnumbercommand}\firstofoneargument{#3}}%
- \fi
- \dostopattributes
- \dostopattributes}
- {\dostartattributes{\??ko#1}\c!style\c!color\empty
- \dostartattributes{\??ko#1}\c!textstyle\c!textcolor\empty
- \dontconvertfont
- \ifdisplaysectionhead
- \setupinterlinespace
- \else
- \setupspacing
- \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}% 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
- \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
- \dostopattributes
- \dostopattributes}}%
- \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][subject]
-%D \setuphead [MySubject][deeptextcommand=\StretchedBox]
-%D
-%D \MySubject{feeling stretched feeling stretched feeling stretched feeling stretched}
-%D \stoptyping
-
-\newsignal\headsignal
-\let\headlastlinewidth\!!zeropoint
-
-\def\beginheadplacement#1%
- {\bgroup
- \setsystemmode{#1}% to be documented
- \ifgridsnapping\iftracegridsnapping\showstruts\fi\fi
- \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
- \doifinsetelse{\getvalue{\??ko#1\c!aligntitle}}{\v!yes,\v!float}% new
- {\skip0 1\leftskip
- \skip2 1\rightskip
- \xdef\localheadskip{\the\skip0}%
- \forgetall
- \leftskip\skip0
- \rightskip\skip2
- \setlocalhsize\hsize\localhsize
- \forgetbothskips}
- {\globallet\localheadskip\!!zeropoint
- \forgetall}%
- \dontcomplain
- \postponenotes
- \iflocation\ifdisplaysectionhead\else\noninterferingmarks\fi\fi
- \resetinteractionparameter\c!style
- \resetinteractionparameter\c!color
- \resetinteractionparameter\c!contrastcolor
- \strictouterreferencestrue % tzt instelling
- \def\localheadsetup{\dolocalheadsetup{#1}}%
- \startsynchronization}
-
-% \setuphead[chapter] [style=\bfd,after=,hang=line] % fit broad 2
-% \setuphead[section] [style=\bfc,after=,hang=line]
-% \setuphead[subsection] [style=\bfb,after=,hang=line]
-% \setuphead[subsubsection] [style=\bfa,after=,hang=line]
-% \setuphead[subsubsubsection][style=\bf ,after=,hang=line]
-%
-% \chapter {Test} \input tufte \page
-% \section {Test} \input tufte \page
-% \subsection {Test} \input tufte \page
-% \subsubsection {Test} \input tufte \page
-% \subsubsubsection{Test} \input tufte \page
-%
-% \chapter {Test\\Test} \input tufte \page
-% \section {Test\\Test} \input tufte \page
-% \subsection {Test\\Test} \input tufte \page
-% \subsubsection {Test\\Test} \input tufte \page
-% \subsubsubsection{Test\\Test} \input tufte \page
-
-\def\hangheadplacement
- {\scratchdimen\localheadlineheight
- \bgroup
- \openlineheight\scratchdimen
- \scratchdimen\ht0
- \advance\scratchdimen\dp0
- \getnoflines\scratchdimen
- \advance\noflines\minusone
- \expanded{\egroup\noflines\the\noflines}% brrr
- \setbox0\hbox{\lower\noflines\scratchdimen\box0}%
- \scratchdimen\ht0
- \advance\scratchdimen\dp0
- \advance\scratchdimen-\localheadheight
- \advance\scratchdimen+\strutdp
- \ht0 \strutht
- \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
- \ifdisplaysectionhead
- % new (tod tight == one following line up)
- \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
- \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
- \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=\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}%
- \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}
-
-\def\checknexthead#1#2% nog optioneel
- {\ifhmode
- \scratchcounter=\lastpenalty\unpenalty % no beauty in this
- \ifdim\lastskip=\headsignal
- \handlenopagebreak{#1}%
- \global\settrue\continuoussectionhead
- \else
- \penalty\scratchcounter
- \global\setfalse\continuoussectionhead
- #1{#2}%
- \fi
- \else
- \global\setfalse\continuoussectionhead
- #1{#2}%
- \fi}
-
-\def\dosetupheadnumber[#1][#2#3]% todo: = (don't reset)
- {\bgroup
- \setsectieenkoppeling{#1}%
- \doifinstringelse{#2}{+-}
- {\doifelsenothing{#3}
- {\@@nextsectionnumber\@@sectie}
- {\!!counta=#2#3\relax
- \advance\!!counta \@@sectionvalue\@@sectie
- \@@setsectionnumber\@@sectie\!!counta}}
- {\@@setsectionnumber\@@sectie{#2#3}}%
- \egroup}
-
-\def\setupheadnumber
- {\dodoubleargument\dosetupheadnumber}
-
-\def\currentheadnumber{0}
-
-\def\determineheadnumber[#1]%
- {\bgroup
- \setsectieenkoppeling{#1}%
- \xdef\currentheadnumber{\@@sectionvalue{\@@sectie}}%
- \egroup}
-
-\def\complexheadnumber[#1]%
- {\bgroup
- \edef\currentheadnumber{#1}%
- \doifinsetelse{-}{#1} % br undocumented
- {\removefromcommalist{-}\currentheadnumber % br
- \setsectieenkoppeling\currentheadnumber
- \setupsection[\@@sectie][\c!previousnumber=\v!no]}%
- {\setsectieenkoppeling\currentheadnumber}%
- \xdef\currentheadnumber{\@@sectionvalue{\@@sectie}}%
- \doifnot{\currentheadnumber}{0}{\finalsectionnumber}%
- \egroup}
-
-\def\simpleheadnumber
- {\currentheadnumber}
-
-\definecomplexorsimple\headnumber
-
-\def\alinea
- {\par}
-
-% nice testcase
-%
-% \setupheads[aligntitle=yes]
-%
-% \startnarrower
-% \subject{\dorecurse{100}{x }}
-% \section{\dorecurse{100}{x }}
-% \input tufte \par
-% \setupheads[alternative=inmargin]
-% \subject{\dorecurse{100}{x }}
-% \section{\dorecurse{100}{x }}
-% \input tufte \par
-% \stopnarrower
-
-\let\numberheadalternative\v!normal
-
-\def\defineheadplacement
- {\dodoubleargument\dodefineheadplacement}
-
-\def\dodefineheadplacement[#1][#2]% #3#4
- {\setvalue{\??ko:#1}{#2}%
- \setvalue{\??ko::#1}}
-
-\def\normalplacehead
- {\executeifdefined
- {\??ko::\numberheadalternative}
- {\getvalue{\??ko::\v!normal}}}
-
-\defineheadplacement[\v!paragraph][\v!vertical]#1#2%
- {\vbox
- {\localheadsetup
- \begstrut\ifheadnumbercontent#1\hskip\numberheaddistance\fi#2}}
-
-% \defineheadplacement[\v!normal][\v!vertical]#1#2%
-% {\ifheadnumbercontent
-% \setbox0\hbox{{#1}\hskip\numberheaddistance}%
-% \vbox
-% {\localheadsetup
-% \hangindent 1\wd0
-% \hangafter 1
-% \noindent
-% \unhbox0 % don't use \strut's here!
-% #2}%
-% \else
-% \vbox
-% {\localheadsetup\noindent#2}%
-% \fi}
-%
-% enhanced version:
-
-% \setuphead
-% [chapter]
-% [numberwidth=2cm,hang=line,after={\blank[3*line]}]
-%
-% \chapter{Oeps oeps oeps} \input tufte \section{Oeps}
-% \chapter{Oeps oeps oeps} \section{Oeps} \input tufte
-
-\defineheadplacement[\v!normal][\v!vertical]#1#2%
- {\vbox
- {\localheadsetup
- \edef\headwidth {\headparameter\c!width }%
- \edef\headnumberwidth{\headparameter\c!numberwidth}%
- \edef\headtextwidth {\headparameter\c!textwidth }%
- \ifheadnumbercontent
- \ifx\headwidth\empty
- \else
- \ifx\headnumberwidth\empty
- \ifx\headtextwidth\empty\else
- \edef\headnumberwidth{\the\dimexpr\headwidth-\headtextwidth\relax}%
- \fi
- \else
- \ifx\headtextwidth\empty
- \edef\headtextwidth{\the\dimexpr\headwidth-\headnumberwidth\relax}%
- \fi
- \fi
- \hsize\headwidth
- \fi
- \ifx\headnumberwidth\empty\else
- \let\numberheaddistance\!!zeropoint
- \fi
- \setbox\scratchbox\hbox \ifx\headnumberwidth\empty\else to \headnumberwidth\fi{{#1}}%
- \scratchdimen\dimexpr\wd\scratchbox+\numberheaddistance\relax
- \ifx\headtextwidth\empty\else
- \hsize\dimexpr\scratchdimen+\headparameter\c!textwidth\relax
- \fi
- \hangindent\scratchdimen
- \hangafter \plusone
- \noindent
- \box\scratchbox\hskip\numberheaddistance
- \else
- \ifx\headtextwidth\empty
- \ifx\headwidth\empty
- \else
- \hsize\headwidth
- \fi
- \else
- \hsize\headtextwidth
- \fi
- \noindent
- \fi
- #2}}
-
-\def\placeheadmargin#1#2%
- {\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}}% introduces whitespace
- % maybe better:
- % \inleftmargin{\hbox{\hss{#1}\hskip\localheadskip}}%
- \fi
- {#2}}}
-
-\defineheadplacement[\v!inmargin][\v!vertical]#1#2{\placeheadmargin{#1}{#2}}
-\defineheadplacement[\v!margin] [\v!vertical]#1#2{\placeheadmargin{#1}{#2}}
-
-\defineheadplacement[\v!middle][\v!vertical]#1#2%
- {\vbox
- {\localheadsetup
- \veryraggedcenter
- \let\\\endgraf
- \let\crlf\endgraf
- \ifheadnumbercontent\strut#1\par\fi\begstrut#2}}
-
-\defineheadplacement[\v!text][\v!horizontal]#1#2%
- {\bgroup
- \localheadsetup % no stretch in distance
- \ifheadnumbercontent{#1}\kern\numberheaddistance\fi{\begstrut#2}%
- \egroup}
-
-\def\placeheadlohi#1#2#3%
- {\ifheadnumbercontent
- \setbox0\hbox{#2}
- \setbox2=#1{\localheadsetup\advance\hsize-\wd0\relax#3}%
- \hbox{\box0\hskip\numberheaddistance\box2}%
- \else
- #1{\localheadsetup\noindent#3}%
- \fi}
-
-% onder/boven lijnt het nummer op de onderste/bovenste regel
-% uit van een meerregelige kop
-
-\defineheadplacement[\v!bottom][\v!vertical]#1#2{\placeheadlohi\vbox{#1}{#2}}
-\defineheadplacement[\v!top] [\v!vertical]#1#2{\placeheadlohi\vtop{#1}{#2}}
-
-% default == instellingen
-% koppeling == koppen, breaks, marks, enz.
-% sectie == nummering
-
-\let\@@kolist=\empty
-
-\def\dododefinehead#1#2% % don't preset prefix to much
- {\presetlabeltext[#1=]%
- \getparameters
- [\??ko#1]
- [\c!numberstyle=\getvalue{\??ko#1\c!style},
- \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]
- [\c!section=\getvalue{\??ko\getvalue{\??ko#1\c!coupling}\c!section},
- \c!default=,
- \c!coupling=,
- \c!prefix=,
- \c!before=,
- \c!after=,
- \c!distance=\!!zeropoint,
- \c!page=,
- \c!header=,
- \c!text=,
- \c!footer=,
- \c!style=,
- \c!numbercommand=,
- \c!textcommand=,
- \c!ownnumber=\v!no,
- \c!number=\v!yes,
- \c!color=,
- \c!continue=\v!yes,
- \c!placehead=\v!yes,
- \c!resetnumber=\v!yes,
- \c!incrementnumber=\v!yes,
- \c!alternative=\@@koalternative,
- \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=,
- \c!grid=,
- \c!margintext=,
- \c!margin=\@@komargin,
- #2]%
- \ConvertToConstant\doifnot{#1}{\getvalue{\??ko#1\c!default}}
- {\doifsomething{\getvalue{\??ko#1\c!default}}
- {\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!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!strut,
- \c!numbercommand,\c!textcommand,\c!margintext,\c!margin]}}%
- \getparameters[\??ko#1][#2]%
- \doifsomething{\getvalue{\??ko#1\c!section}}
- {\doifelsemarking{#1}% \doifundefined{\??mk#1}
- {}% marking #1 already defined
- {\definemarking[#1]%
- \couplemarking[#1][\getvalue{\??ko#1\c!section}]%
- \definemarking[#1\v!number]%
- \couplemarking[#1\v!number][\getvalue{\??ko#1\c!section}]}}%
- \doifundefined{\??li#1}{\definelist[#1]}}
- {\ConvertToConstant\doifelse{#1}{#2}
- {\doifundefined{\??li#1}{\definelist[#1]}}
- {\copyparameters
- [\??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!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!strut,
- \c!numbercommand,\c!textcommand,\c!margintext,\c!margin]%
- \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]}}}%
- \addtocommalist{#1}\@@kolist
- \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\doconstructhead[#1]}}
-
-\def\dodefinehead[#1][#2]%
- {\doifelsenothing{#2}
- {% todo: message that it's an invalid definition
- \setvalue{#1}{\endgraf[#1]\kern.5em}}
- {\doifassignmentelse{#2}
- {\dododefinehead{#1}{#2}}
- {\doifdefined{\??ko#2\c!section}
- {\dododefinehead{#1}{#2}}}}}
-
-\def\definehead
- {\dodoubleemptywithset\dodefinehead}
-
-\def\doconstructhead[#1][#2]%
- {\dowithpargument{\dodoconstructhead{#1}[#2]}}
-
-\def\dosetuphead[#1][#2]%
- {\getparameters[\??ko#1][#2]%
- % The next check prevents hard to trace problems. I once
- % set \c!command to nothing and (quite natural) got the
- % wrong references etc. The whole bunch should be boxed!
- \expandafter\defconvertedcommand\expandafter\ascii\csname\??ko#1\c!command\endcsname
- \doifnothing\ascii{\setvalue{\??ko#1\c!command}{\normalplacehead}}}
-
-\def\setuphead
- {\dodoubleargumentwithset\dosetuphead}
-
-\def\dosetupheads[#1]%
- {\getparameters[\??ko][#1]%
- \doifelse{\@@kosectionnumber}\v!yes\sectionnumbertrue\sectionnumberfalse}
-
-\def\setupheads
- {\dosingleargument\dosetupheads}
-
-\def\systemsuppliedchapter {\getvalue{\v!chapter}}
-\def\systemsuppliedtitle {\getvalue{\v!title}}
-
-% a left over
-
-\def\complexbijlage[#1]#2%
- {\page[\v!right]
- \setuppagenumbering[\c!state=\v!stop]
- \systemsuppliedchapter[#1]{#2}
- \page[\v!right]
- \setuppagenumbering[\c!state=\v!start]
- \setuppagenumbering[\c!number=1]}
-
-\setvalue{\v!appendix}%
- {\complexorsimpleempty\bijlage}
-
-\setupheads
- [\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,
- \c!command=]
-
-\definesectionblock [\v!frontpart] [\v!frontmatter] [\c!number=\v!no]
-\definesectionblock [\v!bodypart] [\v!bodymatter] [\c!number=\v!yes]
-\definesectionblock [\v!appendix] [\v!appendices] [\c!number=\v!yes]
-\definesectionblock [\v!backpart] [\v!backmatter] [\c!number=\v!no]
-
-\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=\s!section-1,
- \c!ownnumber=\v!no]
-
-\definehead
- [\v!chapter]
- [\c!section=\s!section-2,
- \c!ownnumber=\v!no]
-
-\definehead
- [\v!section]
- [\c!section=\s!section-3,
- \c!ownnumber=\v!no]
-
-\definehead
- [\v!subsection]
- [\c!section=\s!section-4,
- \c!default=\v!section,
- \c!ownnumber=\v!no]
-
-\definehead
- [\v!subsubsection]
- [\c!section=\s!section-5,
- \c!default=\v!subsection,
- \c!ownnumber=\v!no]
-
-\definehead
- [\v!subsubsubsection]
- [\c!section=\s!section-6,
- \c!default=\v!subsubsection,
- \c!ownnumber=\v!no]
-
-\definehead
- [\v!subsubsubsubsection]
- [\c!section=\s!section-7,
- \c!default=\v!subsubsubsection,
- \c!ownnumber=\v!no]
-
-\definehead
- [\v!title]
- [\c!coupling=\v!chapter,
- \c!default=\v!chapter,
- \c!incrementnumber=\v!no]
-
-\definehead
- [\v!subject]
- [\c!coupling=\v!section,
- \c!default=\v!section,
- \c!incrementnumber=\v!no]
-
-\definehead
- [\v!subsubject]
- [\c!coupling=\v!subsection,
- \c!default=\v!subsection,
- \c!incrementnumber=\v!no]
-
-\definehead
- [\v!subsubsubject]
- [\c!coupling=\v!subsubsection,
- \c!default=\v!subsubsection,
- \c!incrementnumber=\v!no]
-
-\definehead
- [\v!subsubsubsubject]
- [\c!coupling=\v!subsubsubsection,
- \c!default=\v!subsubsubsection,
- \c!incrementnumber=\v!no]
-
-\definehead
- [\v!subsubsubsubsubject]
- [\c!coupling=\v!subsubsubsubsection,
- \c!default=\v!subsubsubsubsection,
- \c!incrementnumber=\v!no]
-
-\setupsection
- [\s!section-2]
- [\v!appendix\c!conversion=\v!Character,
- \c!previousnumber=\v!no]
-
-\setuphead
- [\v!part]
- [\c!placehead=\v!no]
-
-\setuphead
- [\v!chapter]
- [\v!appendix\c!label=\v!appendix,
- \v!bodypart\c!label=\v!chapter] % bijlageconversie=\Character
-
-\setuphead
- [\v!section]
- [\v!appendix\c!label=\v!section,
- \v!bodypart\c!label=\v!section] % bijlageconversie=\Character
-
-\setuphead
- [\v!subsection]
- [\v!appendix\c!label=\v!subsection,
- \v!bodypart\c!label=\v!subsection] % bijlageconversie=\Character
-
-\setuphead
- [\v!subsubsection]
- [\v!appendix\c!label=\v!subsubsection,
- \v!bodypart\c!label=\v!subsubsection] % bijlageconversie=\Character
-
-\setuphead
- [\v!part,\v!chapter]
- [%\c!align=,
- %\c!indentnext=\v!no,
- \c!continue=\v!no,
- \c!page=\v!right,
- \c!header=,
- \c!style=\tfc,
- \c!distance=.75em,
- \c!before={\blank[2*\v!big]},
- \c!after={\blank[2*\v!big]}]
-
-\setuphead
- [\v!section]
- [%\c!align=,
- %\c!indentnext=\v!no,
- \c!style=\tfa,
- \c!distance=.75em,
- \c!before={\blank[2*\v!big]},
- \c!after=\blank]
-
-\setuphead % nieuw
- [\v!subsection]
- [\c!page=]
-
-\definecombinedlist
- [\v!content]
- [\v!part,
- \v!chapter,
- \v!section,
- \v!subsection,
- \v!subsubsection,
- \v!subsubsubsection,
- \v!subsubsubsubsection]
- [\c!level=\v!subsubsubsubsection,
- \c!criterium=\v!local]
-
-\setuplist
- [\v!part]
- [\c!before={\blank\page[\v!preference]},
- \c!after=\blank,
- \c!label=\v!yes,
- \c!separator=:,
- \c!distance=1em]
-
-\setuplist
- [\v!chapter]
- [\c!before={\blank\page[\v!preference]},
- \c!after=]
-
-\setuplist [\v!part] [\c!width=0em]
-\setuplist [\v!chapter] [\c!width=2em]
-\setuplist [\v!section] [\c!width=3em]
-\setuplist [\v!subsection] [\c!width=4em]
-\setuplist [\v!subsubsection] [\c!width=5em]
-\setuplist [\v!subsubsubsection] [\c!width=6em]
-\setuplist [\v!subsubsubsubsection] [\c!width=7em]
-
-% hm
-
-\setuppagenumbering % na instellen hoofdteksten !
- [\c!alternative=\v!singlesided,
- \c!location={\v!header,\v!middle},
- \c!conversion=\v!numbers,
- \c!width=, % in geval van \v!marginedge
- \c!left=,
- \c!right=,
- \c!way=\v!by\v!part,
- \c!text=,
- \v!chapter\v!number=\v!no, % v
- \v!part\v!number=\v!yes, % v
- \c!numberseparator=--,
- \c!textseparator=\tfskip,
- \c!state=\v!start,
- \c!command=,
- \c!strut=\v!yes, % nieuw
- \c!style=, % \v!normal, % empty, otherwise conflict
- \c!color=]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/strc-swd.mkii b/Master/texmf-dist/tex/context/base/mkii/strc-swd.mkii
deleted file mode 100644
index 1525ab597a1..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/strc-swd.mkii
+++ /dev/null
@@ -1,127 +0,0 @@
-%D \module
-%D [ file=strc-swd,
-%D version=2007.08.14,
-%D title=\CONTEXT\ Structure Macros,
-%D subtitle=Section Worlds,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 a prelude to a rewrite of sectioning.
-
-% options : before after setups page text number label bookmark
-% dodo : listtext
-%
-% \startsectionworld[chapter][text={Test}]
-% \stopsectionworld
-
-\writestatus{loading}{ConTeXt Structure Macros / Sectionworlds}
-
-\unprotect
-
-\ifx\pushvalue\undefined
-
- \def\pushvalue#1{\expandafter\pushmacro\csname#1\endcsname}
- \def\popvalue #1{\expandafter\popmacro \csname#1\endcsname}
-
-\fi
-
-% brrr
-
-\def\csnameexpanded#1#2%
- {\@EA\@EA\@EA\@EA\@EA\@EA\@EA#1\@EA\@EA\@EA\@EA\@EA\@EA\@EA#2\@EA\@EA\@EA\@EA\@EA\@EA\@EA}
-
-\def\csnameexpandedoneargument#1#2%
- {\csnameexpanded\def\csexpandeda{#2}%
- \@EA#1\@EA{\csexpandeda}}
-
-\def\csnameexpandedtwoarguments#1#2#3%
- {\csnameexpanded\def\csexpandeda{#2}%
- \csnameexpanded\def\csexpandedb{#3}%
- \@EA\@EA\@EA#1\@EA\@EA\@EA{\@EA\csexpandeda\@EA}\@EA{\csexpandedb}}
-
-\def\csnameexpandedthreearguments#1#2#3#4%
- {\csnameexpanded\def\csexpandeda{#2}%
- \csnameexpanded\def\csexpandedb{#3}%
- \csnameexpanded\def\csexpandedc{#4}%
- \@EA\@EA\@EA\@EA\@EA\@EA\@EA#1\@EA\@EA\@EA\@EA\@EA\@EA\@EA{\@EA\@EA\@EA\csexpandeda\@EA\@EA\@EA}\@EA\@EA\@EA{\@EA\csexpandedb\@EA}\@EA{\csexpandedc}}
-
-% \def\xx{XX}\setvalue{xx:yy}{abc \xx def}\def\param#1{\csname xx:#1\endcsname}
-% \def\testa #1{\defconvertedargument\ascii{#1}{\tttf\ascii}}
-% \def\testb #1#2{\defconvertedargument\ascii{#1 #2}{\tttf\ascii}}
-% \def\testc#1#2#3{\defconvertedargument\ascii{#1 #2 #3}{\tttf\ascii}}
-% \noindent 1 \csnameexpandedoneargument \testa{\param{yy}}
-% \noindent 2 \csnameexpandedtwoarguments \testb{\param{yy}}{\param{yy}}
-% \noindent 3 \csnameexpandedthreearguments\testc{\param{yy}}{\param{yy}}{\param{yy}}
-
-% rewrite the sectioning to use the variables, a bit tricky because then
-% we need a special expansion trick
-
-\def\sectionworldparameter #1{\csname\??sw\currentsectionworldname#1\endcsname}
-\def\pushsectionworldparameter#1{\expandafter\pushmacro\csname\??sw\currentsectionworldname#1\endcsname}
-\def\popsectionworldparameter #1{\expandafter\popmacro \csname\??sw\currentsectionworldname#1\endcsname}
-
-\def\setupsectionworld
- {\dodoubleargument\dosetupsectionworld}
-
-\def\dosetupsectionworld[#1][#2]%
- {\getparameters[\??sw#1][#2]} % maybe some extra things
-
-\def\dochecksectionworld#1%
- {\ifcsname\??sw\currentsectionworldname\endcsname\else
- \getparameters
- [\??sw\currentsectionworldname]
- [\c!before=,
- \c!after=,
- \c!setups=,
- \c!page=]%
- \fi}
-
-\def\startsectionworld
- {\dodoubleargument\dostartsectionworld}
-
-\def\dostartsectionworld[#1][#2]%
- {\pushmacro\currentsectionworldname
- \def\currentsectionworldname{#1}%
- \dochecksectionworld\currentsectionworldname
- \pushsectionworldparameter\c!before
- \pushsectionworldparameter\c!after
- \pushsectionworldparameter\c!setups
- \getparameters
- [\??sw\currentsectionworldname]
- [\c!text=,\c!number=\finalsectionnumber,\c!label=,\c!bookmark=,#2]%
- \doifsomething{\sectionworldparameter\c!page}
- {\setsectieenkoppeling\currentsectionworldname
- %\handlepagebreak\currentsectionworldname
- \checknexthead\handlepagebreak\currentsectionworldname}%
- \sectionworldparameter\c!before
- \begingroup
- \doifsomething{\sectionworldparameter\c!page}
- {\settrue\ignorehandlepagebreak}%
- \doifsomething{\sectionworldparameter\c!setups}
- {\setups[\sectionworldparameter\c!setups]}%
- \csnameexpandedthreearguments \doconstructheadwithvars
- {\sectionworldparameter\c!label }%
- {\sectionworldparameter\c!number}%
- {\sectionworldparameter\c!text }%
- \doifsomething{\sectionworldparameter\c!bookmark}
- {\expanded{\bookmark[\sectionworldparameter\c!bookmark]}}%
- \ignorespaces} % for inline heads
-
-\def\doconstructheadwithvars#1%#2#3%
- {\dodododoconstructhead\currentsectionworldname[#1]}% {#2}{#3}}
-
-\def\stopsectionworld
- {\endgraf
- \endgroup
- \sectionworldparameter\c!after
- \popsectionworldparameter\c!setups
- \popsectionworldparameter\c!after
- \popsectionworldparameter\c!before
- \popmacro\currentsectionworldname}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/strc-syn.mkii b/Master/texmf-dist/tex/context/base/mkii/strc-syn.mkii
deleted file mode 100644
index 2ba5c94679e..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/strc-syn.mkii
+++ /dev/null
@@ -1,438 +0,0 @@
-%D \module
-%D [ file=strc-syn,
-%D version=1997.03.31,
-%D title=\CONTEXT\ Structure Macros,
-%D subtitle=Synonyms and Sorts,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Structure Macros / Synonyms and Sorts}
-
-\unprotect
-
-% \checkdefined kan hierheen
-
-% Formaat tex-utility-input-file <jobname.tui>:
-%
-% synonym entry {tag} {pure} {text} {synonym}
-%
-% Deze file wordt met het programma TeXUtil omgezet in een
-% in te lezen TeXFile met de commando's:
-%
-% \synonymentry {tag} {pure} {text} {synonym}
-
-\newif\ifsynonymmeaning
-
-% todo: \def\synonymparameter#1{\csname\??sm\currentsynonym#1\endcsname}
-
-\def\dosetupsynonyms[#1][#2]%
- {\getparameters[\??sm#1][#2]}
-
-\def\setupsynonyms
- {\dodoubleargument\dosetupsynonyms}
-
-\def\doresetsynonym#1%
- {\letvalue{#1\s!entry}\gobblethreearguments}
-
-\def\dohandlesynonymentry#1#2#3#4%
- {\bgroup
- \global\utilitydonetrue
- \syndef
- {\doattributes{\??sm#1}\c!textstyle\c!textcolor{#3}}
- \ConvertToConstant\doifelse{#4}{}{\unknown}{#4}\par
- \egroup}
-
-\def\synonymentry#1%
- {\executeifdefined{#1\s!entry}\gobblethreearguments}
-
-\def\dosetsynonym#1%
- {\doifdefinedelse{\??sm#1\c!command}
- {\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
- \def\currentsynonym{#1}%
- \definedescription % nog eens een class van maken, net als framed
- [syndef]
- [\c!location=\synonymparameter\c!location,
- \c!width=\synonymparameter\c!width,
- \c!distance=\synonymparameter\c!distance,
- \c!sample=\synonymparameter\c!sample,
- \c!hang=\synonymparameter\c!hang,
- \c!align=\synonymparameter\c!align,
- \c!before=\synonymparameter\c!before,
- \c!inbetween=\synonymparameter\c!inbetween,
- \c!after=\synonymparameter\c!after,
- \c!indentnext=\synonymparameter\c!indentnext,
- \c!headstyle=\synonymparameter\c!headstyle,
- \c!headcolor=\synonymparameter\c!headcolor,
- \c!style=,
- \c!color=]%
- \setupwhitespace[\v!none]%
- %doutilities{#1}\jobname{#2}\relax\par % no longer \par
- \doutilities{#1}\jobname{#1}\relax\relax
- \endgroup
- \ifutilitydone\else\nowhitespace\fi}
-
-\def\docompletelistofsynonyms#1#2% expansion needed to avoid v! (due to french active !)
- {\expanded{\systemsuppliedchapter[#1]{\noexpand\headtext{#2}}}%
- \doplacelistofsynonyms{#1}{#2}%
- \page[\v!yes]}
-
-\def\processsynonym#1#2#3%
- {\begingroup % anders in mathmode lege \hbox, zie eenheden
- \ifsynonymmeaning
- \synonymmeaningfalse
- \doattributes{\??sm#1}\c!synonymstyle\c!synonymcolor{#3}%
- \else
- \dontleavehmode
- \doattributes{\??sm#1}\c!textstyle\c!textcolor{#2}%
- \fi
- \endgroup}
-
-\def\getsynonymmeaning#1#2#3%
- {\bgroup
- \doifundefined{#2#3}
- {\setgvalue{#2#3}{{\tt[#3]}}%
- \showmessage\m!systems{18}{#1,#3}}%
- \synonymmeaningtrue
- \getvalue{#2#3}%
- \egroup}
-
-\def\dowritesynonym#1#2#3#4%
- {\begingroup % anders in mathmode lege \hbox
- \defconvertexpanded\asciisynonym{\getvalue{\??sm#1\c!expansion}}{#3}%
- \defconvertexpanded\asciimeaning{\getvalue{\??sm#1\c!expansion}}{#4}%
- \immediatewriteutility{s e {#1} {#2} {\asciisynonym} {\asciimeaning}}%
- \endgroup}
-
-\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}{\reprocesssynonym{#1}{#3}{#4}}%
- \fi}
-
-\def\executesynonym#1#2#3#4%
- {\preexecutesynonym{#1}{#2}{#3}{#4}%
- \processsynonym{#1}{#3}{#4}%
- \getvalue{\??sm#1\c!next}} % not formally documented
-
-\def\expandsynonym#1#2#3#4%
- {{\synonymmeaningtrue
- \processsynonym{#1}{#3}{#4}}}
-
-\def\dodoloadsynonym#1#2#3#4%
- {\setgvalue{#2}{\executesynonym{#1}{#2}{#3}{#4}}}
-
-\def\doloadsynonym#1%
- {\setvalue{#1\s!entry}##1##2##3%
- {\doifelsenothing{##1}
- {\dodoloadsynonym{#1}{##2}{##2}{##3}}
- {\dodoloadsynonym{#1}{##1}{##2}{##3}}%
- \global\utilitydonetrue}}
-
-\def\doloadsynonyms#1#2%
- {\bgroup
- \let\dosetsynonym\doloadsynonym
- \showmessage\m!systems{19}{#2}%
- \doutilities{#1}\jobname{#1}\relax\relax
- \egroup
- \setvalue{\s!check#1}##1{}}
-
-\def\dodocomplexsynonym[#1][#2]#3#4%
- {\doifsomething{#2}
- {\getvalue{\s!check#1}{#2}%
- \doglobal\appendtoks\setvalue{#2}{#2}\to\simplifiedcommands
- \doifelsevalue{\??sm#1\c!conversion}\v!yes
- {\unexpanded\setgvalue{#2}{\expandsynonym{#1}{#2}{#3}{#4}}}
- {\doifelsevalue{\??sm#1\c!state}\v!start
- {\doifelsevalue{\??sm#1\c!criterium}\v!all
- {\preexecutesynonym{#1}{#2}{#3}{#4}}
- {\unexpanded\setgvalue{#2}{\executesynonym{#1}{#2}{#3}{#4}}}}
- {\unexpanded\setgvalue{#2}{\processsynonym{#1}{#3}{#4}}}}}}
-
-\def\docomplexsynonym[#1][#2][#3]#4#5%
- {\ifthirdargument
- \dodocomplexsynonym[#2][#1#3]{#4}{#5}%
- \else
- \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}}%
- \ifthirdargument
- \unexpanded\def#3##1{\getvalue{\??sm:#1:##1}}%
- \fi
- \setvalue{#1}{\dotripleempty\docomplexsynonym[\??sm:#1:][#1]}%
- \else
- \ifthirdargument
- \unexpanded\def#3##1{\getsynonymmeaning{#1}{}{##1}}%
- \fi
- \setvalue{#1}{\dotripleempty\docomplexsynonym[][#1]}%
- \fi
- \dosetupsynonyms
- [#1]%
- [\c!synonymstyle=,\c!textstyle=,
- \c!headstyle=,\c!headcolor=,
- \c!state=\v!start,\c!criterium=,
- \c!location=\v!left,\c!width=5em,\c!distance=0pt,
- \c!sample=,\c!hang=,\c!align=,
- \c!before=,\c!inbetween=,\c!after=,
- \c!indentnext=\v!no,
- \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
- \setvalue{\s!set #1}{\dosetsynonym{#1}}%
- \setvalue{\s!reset #1}{\doresetsynonym{#1}}%
- \setvalue{\s!check #1}##1{\checkdefined{synonym}{#1}{##1}}%
- \setvalue{\e!load #2}{\doloadsynonyms{#1}{#2}}%
- \setvalue{\e!place\e!listof #2}{\doplacelistofsynonyms{#1}{#2}}%
- \setvalue{\e!complete\e!listof#2}{\docompletelistofsynonyms{#1}{#2}}}
-
-\def\definesynonyms
- {\doquadrupleempty\dodefinesynonyms}
-
-% Formaat tex-utility-input-file <jobname.tui>:
-%
-% synonym entry {tag} {pure} {text} {}
-%
-% Deze file wordt met het programma TeXUtil omgezet in een
-% in te lezen TeXFile met de commando's:
-%
-% \synonymentry {tag} {pure} {text} {}
-
-\def\dosetupsorting[#1][#2]%
- {\getparameters[\??so#1][#2]}
-
-\def\setupsorting
- {\dodoubleargument\dosetupsorting}
-
-\def\doresetsort#1%
- {\letvalue{#1\s!entry}\gobblethreearguments}
-
-\def\dosetsort#1%
- {\setvalue{#1\s!entry}##1##2##3%
- {\let\dowritesort\gobblethreearguments
- \global\utilitydonetrue
- \bgroup
- \doifdefinedelse{\??so#1\c!command}
- {\getvalue{\??so#1\c!command}{##2}} % 1 argument
- {\getvalue{\??so#1\c!before}%
- \doattributes{\??so#1}\c!style\c!color{##2}%
- \getvalue{\??so#1\c!after}}%
- \egroup}}
-
-\def\doplacelistofsorts#1% NOG EEN RUWE VERSIE MAKEN
- {\whitespace % ZONDER WITRUIMTE ETC ETC
- \begingroup
- \setupwhitespace[\v!none]%
- \doutilities{#1}\jobname{#1}\relax\relax
- \endgroup
- \ifutilitydone\else\nowhitespace\fi}
-
-% to be tested
-%
-% \def\doplacelistofsorts#1% NOG EEN RUWE VERSIE MAKEN
-% {\startpacked
-% %doutilities{#1}\jobname{#1}\relax\par
-% \doutilities{#1}\jobname{#1}\relax\relax
-% \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%
- {\dontleavehmode
- \begingroup % was \bgroup
- \doattributes{\??so#1}\c!style\c!color{#2}%
- \endgroup} % was \egroup
-
-\def\dowritesort#1#2#3%
- {\bgroup
- \defconvertexpanded\asciisynonym{\getvalue{\??so#1\c!expansion}}{#3}%
- \immediatewriteutility{s e {#1} {#2} {\asciisynonym} {}}%
- \egroup}
-
-\def\synonymentry#1%
- {\executeifdefined{#1\s!entry}\gobblethreearguments}
-
-\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}{\reprocesssort{#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
- \getvalue{\??so#1\c!next}} % not formally documented
-
-\def\doloadsort#1%
- {\setvalue{#1\s!entry}##1##2##3%
- {\setgvalue{##1}{##2}%
- \global\utilitydonetrue}}
-
-\def\doloadsort#1#2%
- {\bgroup
- \let\dosetsort\doloadsort
- \showmessage\m!systems{20}{#2}%
- \doutilities{#1}\jobname{#1}\relax\relax
- \egroup
- \setvalue{\s!check#1}##1{}}
-
-\def\dodocomplexsort[#1][#2]#3%
- {\doifsomething{#2}
- {\getvalue{\s!check#1}{#2}%
- \doglobal\appendtoks\setvalue{#2}{#2}\to\simplifiedcommands
- \doifelsevalue{\??so#1\c!state}\v!start
- {\doifelsevalue{\??so#1\c!criterium}\v!all
- {\preexecutesort{#1}{#2}{#3}}
- {\unexpanded\setgvalue{#2}{\executesort{#1}{#2}{#3}}}}
- {\unexpanded\setgvalue{#2}{\processsort{#1}{#3}{#2}}}}}
-
-\def\docomplexsort[#1][#2][#3]#4%
- {\ifthirdargument
- \dodocomplexsort[#2][#1#3]{#4}%
- \else
- \dowritesort{#2}{#4}{#4}%
- \fi}
-
-% 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 !
- \c!state=\v!start,
- \c!criterium=,
- \c!style=,
- \c!before=,
- \c!after=\endgraf,
- \c!expansion=,
- \s!language=\currentmainlanguage]%
- \doglobal\appendtoksonce
- \doregistersortinglanguage{#1}%
- \to \everysavesortkeys
- \ifthirdargument
- \ConvertConstantAfter\doifnot{#3}\v!none
- {\ifx#3\relax \else
- \def#3##1{\getvalue{\??so:#1:##1}}
- \fi}%
- \setvalue{#1}{\dotripleempty\docomplexsort[\??so:#1:][#1]}%
- \else
- \setvalue{#1}{\dotripleempty\docomplexsort[][#1]}%
- \fi
- \addutilityreset{#1}%
- \presetheadtext[#2=\Word{#2}]% after \ifthirdargument -)
- \setvalue{\e!setup#2\e!endsetup}[##1]{\getparameters[\??so#1][##1]}% to be obsolete
- \setvalue{\s!set#1}{\dosetsort{#1}}%
- \setvalue{\s!reset#1}{\doresetsort{#1}}%
- \setvalue{\e!load#2}{\doloadsort{#1}{#2}}%
- \setvalue{\s!check#1}##1{\checkdefined{sort}{#1}{##1}}%
- \setvalue{\e!place\e!listof#2}{\doplacelistofsorts{#1}}%
- \setvalue{\e!complete\e!listof#2}{\docompletelistofsorts{#1}{#2}}}
-
-\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}\relax\relax}
-
-\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
-
-%D Presets.
-
-\definesynonyms
- [\v!abbreviation]
- [\v!abbreviations]
- [\infull]
-
-\setupsynonyms
- [\v!abbreviation]
- [\c!textstyle=\v!capital,
- \c!textcolor=,
- \c!synonymstyle=,
- \c!synonymcolor=,
- \c!headstyle=,
- \c!headcolor=,
- \c!location=\v!left,
- \c!width=5em,
- \c!state=\v!start]
-
-\definesorting
- [\v!logo]
- [\v!logos]
-% no [\logogram]
-
-\definesynonyms
- [\v!unit]
- [\v!units]
- [\unitmeaning]
-
-\setupsynonyms
- [\v!unit]
- [\c!textstyle=\dimension]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/supp-ali.mkii b/Master/texmf-dist/tex/context/base/mkii/supp-ali.mkii
deleted file mode 100644
index c4a1aadc526..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/supp-ali.mkii
+++ /dev/null
@@ -1,173 +0,0 @@
-%D \module
-%D [ file=supp-ali,
-%D version=2000.04.17,
-%D title=\CONTEXT\ Support Macros,
-%D subtitle=Alignment,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Yet undocumented.
-
-% 0 = centered
-% 1 = left in before
-% 2 = right in before
-% 3 = left in after
-% 4 = right in after
-
-\unprotect
-
-% \starttabulate[|cg{.}|cg{,}|cg{,}|]
-% \NC period \NC comma \NC comma \NC\NR
-% \NG 100.000,00 \NG 100.000,00 \NG 100,00 \NC\NR
-% \NG 10.000,00 \NG 10.000,00 \NG 1000,00 \NC\NR
-% \NG 100,00 \NG 100,00 \NG 10,00 \NC\NR
-% \NG 100,00 \NG 100,00 \NG 10,00 \NC\NR
-% \NG 10\\ \NG 10\\ \NG 0,00 \NC\NR
-% \NG 10 \NG 10 \NG 0,00 \NC\NR
-% \NG 10 \NG 10 \NG 0,00 \NC\NR
-% \stoptabulate
-
-\chardef\characteralignmentmode=4
-\chardef\characteralignmentslot=1
-
-\newtoks\@@characteralignlst
-
-\let\afterassignwidth \!!zeropoint
-\let\beforeassignwidth\!!zeropoint
-
-\def\alignmentcharacter{.}
-
-\let\alignmentclass\s!default % can be used to handle multiple mixed ones
-
-\def\setfirstpasscharacteralign
- {\popcharacteralign
- \expanded{\dosetfirstpasscharacteralign{\alignmentcharacter}}}
-
-\def\dosetfirstpasscharacteralign#1%
- {\def\checkalignment##1%
- {\popcharacteralign
- \let\\\empty
- \setbox\scratchbox\hbox{#1}%
- \edef\characterassignwidth{\the\wd\scratchbox}%
- \setbox\scratchbox\null
- \docheckalignment##1#1\relax\relax
- \scratchdimen-\wd\scratchbox
- \setbox\scratchbox\hbox{\ignorespaces##1\unskip}%
- \advance\scratchdimen \wd\scratchbox
- \ifdim\scratchdimen>\beforeassignwidth\relax
- \edef\beforeassignwidth{\the\scratchdimen}%
- \fi
- \ifdim\scratchdimen=\zeropoint
- \setbox\scratchbox\hbox{\ignorespaces##1\unskip}%
- \scratchdimen\wd\scratchbox
- \ifcase\characteralignmentmode
- % do nothing
- \else\ifnum\characteralignmentmode<\plusthree
- \advance\scratchdimen \characterassignwidth
- \ifdim\scratchdimen>\beforeassignwidth\relax
- \edef\beforeassignwidth{\the\scratchdimen}%
- \fi
- \else
- \ifdim\scratchdimen>\afterassignwidth\relax
- \edef\afterassignwidth{\the\scratchdimen}%
- \fi
- \fi\fi
- \fi
- \pushcharacteralign}%
- \def\docheckalignment##1#1##2##3\relax
- {\ifx##2\relax
- \setbox\scratchbox\hbox{\ignorespaces##1\unskip}%
- \ifdim\wd\scratchbox>\afterassignwidth
- \edef\afterassignwidth{\the\wd\scratchbox}%
- \fi
- \else
- \docheckalignment##2##3\relax\relax
- \fi}}
-
-\def\setsecondpasscharacteralign
- {\popcharacteralign
- \expanded{\dosetsecondpasscharacteralign{\alignmentcharacter}}}
-
-\def\dosetsecondpasscharacteralign#1%
- {\def\checkalignment##1%
- {\popcharacteralign
- \let\\\empty % beware, no grouping
- \setbox\scratchbox\hbox{#1}%
- \edef\characterassignwidth{\the\wd\scratchbox}%
- \setbox\scratchbox\null
- % new 12,34 vs 10\\ where 10 aligns on 12 if #1 = ,
- \ifcase\characteralignmentslot
- \docheckalignment##1#1\relax\relax
- \scratchdimen\wd\scratchbox
- \setbox\scratchbox\hbox{\ignorespaces##1\unskip}%
- \else
- \def\\{#1}%
- \expanded{\docheckalignment##1#1\relax\relax}%
- \scratchdimen\wd\scratchbox
- \setbox\scratchbox\hbox{\def\\{\hphantom{#1}}\ignorespaces##1\unskip}%
- \fi
- \noindent
- \ifdim\scratchdimen=\wd\scratchbox
- \ifcase\characteralignmentmode
- \box\scratchbox
- \else
- \hbox
- {\dontcomplain
- \hbox to \beforeassignwidth
- {\ifcase\characteralignmentmode\or
- \box\scratchbox\hss
- \or
- \hss\box\scratchbox\hskip\characterassignwidth
- \or
- \hss\rlap{\box\scratchbox}%
- \or
- \hss\rlap{\hbox to \afterassignwidth{\hss\box\scratchbox}}%
- \fi}%
- \hskip\afterassignwidth}%
- \fi
- \else
- \hbox
- {\hbox to \beforeassignwidth
- {\hss\box\scratchbox\hskip-\scratchdimen}%
- \hskip\afterassignwidth}%
- \fi}%
- \def\docheckalignment##1#1##2##3\relax
- {\ifx##2\relax
- \setbox\scratchbox\hbox{\ignorespaces##1\unskip}%
- \else
- \docheckalignment##2##3\relax\relax
- \fi}}
-
-% provide a means to use multiple alignments mixed
-
-\def\pushcharacteralign
- {\ifundefined{@cac@\alignmentclass}%
- \doglobal\appendetoks\noexpand\do{\alignmentclass}\to\@@characteralignlst
- \fi
- \setxvalue{@cac@\alignmentclass}{\noexpand\do
- {\afterassignwidth}{\beforeassignwidth}{\alignmentcharacter}}}
-
-\def\popcharacteralign
- {\def\do##1##2##3%
- {\def\afterassignwidth {##1}%
- \def\beforeassignwidth {##2}%
- \def\alignmentcharacter{##3}}%
- \executeifdefined{@cac@\alignmentclass}\donothing}
-
-\def\resetcharacteralign % does not work well nested
- {\def\do##1{\global\letbeundefined{@cac@##1}}% global !
- \the\@@characteralignlst
- \global\@@characteralignlst\emptytoks}
-
-\long\def\startcharacteralign#1\stopcharacteralign
- {\bgroup
- \setfirstpasscharacteralign #1%
- \setsecondpasscharacteralign#1%
- \egroup}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/supp-box.mkii b/Master/texmf-dist/tex/context/base/mkii/supp-box.mkii
deleted file mode 100644
index 55641fd6336..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/supp-box.mkii
+++ /dev/null
@@ -1,3126 +0,0 @@
-%D \module
-%D [ file=supp-box,
-%D version=1995.10.10,
-%D title=\CONTEXT\ Support Macros,
-%D subtitle=Boxes,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 module implements some box manipulation macros. Some
-%D are quite simple, some are more advanced and when understood
-%D well, all can be of use.
-
-%D No longer generic, why bother.
-
-\writestatus{loading}{ConTeXt Support Macros / Boxes}
-
-\unprotect
-
-%D \macros
-%D {strutdp,strutht,strutwd}
-%D
-%D The next shortcuts save memory and keying. The width is
-%D normally zero points (if not, you're in trouble). These
-%D shortcuts can be used like a dimension, opposite to the
-%D core macros \type {\strutdepth} and alike, which are
-%D values.
-
-\def\strutdp{\dp\strutbox}
-\def\strutht{\ht\strutbox}
-\def\strutwd{\wd\strutbox}
-
-%D \macros
-%D {resetbox, emptybox}
-%D
-%D Let's start with an easy one. The next macro hides the
-%D ugly \type {@} in \type {\voidb@x}.
-
-\ifx\voidbox\undefined \newbox\voidbox \fi
-\ifx\voidb@x\undefined \let\voidb@x\voidbox \fi
-
-\def\emptybox {\box \voidbox}
-\def\unvoidbox {\unhbox\voidbox}
-\def\resetbox#1{\setbox#1\box\voidbox}
-
-%D \macros
-%D {nextdepth}
-%D
-%D Let's start with a rather simple declaration. Sometimes we
-%D need to save the \TEX\ \DIMENSION\ \type{\prevdepth} and
-%D append it later on. The name \type{\nextdepth} suits
-%D this purpose well.
-
-\newdimen\nextdepth
-
-%D \macros
-%D {smashbox, smashedbox}
-%D
-%D Smashing is introduced in \PLAIN\ \TEX, and stands for
-%D reducing the dimensions of a box to zero. The most resolute
-%D one is presented first.
-
-\def\smashbox#1%
- {\wd#1\zeropoint
- \ht#1\zeropoint
- \dp#1\zeropoint}
-
-\def\smashboxed#1%
- {\smashbox{#1}%
- \box#1\relax}
-
-%D \macros
-%D {hsmashbox,vsmashbox}
-%D
-%D Smashing can be used for overlaying boxes. Depending on
-%D the mode, horizontal or vertical, one can use:
-
-\def\hsmashbox#1%
- {\wd#1\zeropoint}
-
-\def\vsmashbox#1%
- {\ht#1\zeropoint
- \dp#1\zeropoint}
-
-%D The next implementation is less sensitive for spurious
-%D spaces.
-
-\newcount\registercount
-
-\def\smashbox
- {\afterassignment\dosmashbox\registercount}
-
-\def\dosmashbox
- {\wd\registercount\zeropoint
- \ht\registercount\zeropoint
- \dp\registercount\zeropoint}
-
-\def\smashedbox
- {\afterassignment\thesmashedbox\registercount}
-
-\def\thesmashedbox
- {\dosmashbox
- \box\registercount}
-
-\def\hsmashbox
- {\afterassignment\dohsmashbox\registercount}
-
-\def\dohsmashbox
- {\wd\registercount\zeropoint}
-
-\def\vsmashbox
- {\afterassignment\dovsmashbox\registercount}
-
-\def\dovsmashbox
- {\ht\registercount\zeropoint
- \dp\registercount\zeropoint}
-
-%D \macros
-%D {hsmash,vsmash,
-%D hsmashed,vsmashed}
-%D
-%D While the previous macros expected a \BOX, the next act on a
-%D content. They are some subtle differences betreen the smash
-%D and smashed alternatives. The later ones reduce all
-%D dimensions to zero.
-
-% Ok, but inefficient and/or catcode unsafe:
-%
-% \def\hsmash #1{\bgroup\setbox0=\normalhbox{#1}\hsmashbox0\box0\egroup}
-% \def\vsmash #1{\bgroup\setbox0=\normalvbox{#1}\vsmashbox0\box0\egroup}
-% \def\hsmashed#1{\bgroup\setbox0=\normalhbox{#1}\smashbox 0\box0\egroup}
-% \def\vsmashed#1{\bgroup\setbox0=\normalvbox{#1}\smashbox 0\box0\egroup}
-%
-% Better, but a waste of tokens:
-%
-% \def\hsmash {\bgroup\dowithnextbox{\hsmashbox\nextbox\flushnextbox\egroup}\normalhbox}
-% \def\vsmash {\bgroup\dowithnextbox{\vsmashbox\nextbox\flushnextbox\nextbox\egroup}\normalvbox}
-% \def\hsmashed{\bgroup\dowithnextbox{\smashbox \nextbox\flushnextbox\nextbox\egroup}\normalhbox}
-% \def\vsmashed{\bgroup\dowithnextbox{\smashbox \nextbox\flushnextbox\nextbox\egroup}\normalvbox}
-%
-% The best:
-
-\def\dosomesmash#1% (begin|end)group ipv (b|e)group ?
- {\bgroup\dowithnextbox{#1\nextbox\flushnextbox\egroup}}
-
-\def\hsmash {\dosomesmash\hsmashbox\normalhbox}
-\def\vsmash {\dosomesmash\vsmashbox\normalvbox}
-\def\hsmashed{\dosomesmash\smashbox \normalhbox}
-\def\vsmashed{\dosomesmash\smashbox \normalvbox}
-
-%D \macros
-%D {smashedhbox,smashedvbox}
-%D
-%D Also handy (all dimensions zeroed):
-%D
-%D \starttyping
-%D \smashedhbox to ... {...}
-%D \smashedvbox to ... {...}
-%D \stoptyping
-
-\def\dosmashedbox#1%
- %{#1\bgroup\dowithnextbox{\smashbox\nextbox\flushnextbox\egroup}#1}
- {#1\bgroup\dowithnextbox{\smashedbox\nextbox\egroup}#1}
-
-\def\smashedhbox{\dosmashedbox\hbox}
-\def\smashedvbox{\dosmashedbox\vbox}
-
-%D \macros
-%D {smash}
-%D
-%D This smash alternative takes an optional arg [whdtb] as
-%D well as is potentially catcode safer. It is needed by the
-%D math module (although the \type {\leavevmode} is not added
-%D here).
-
-\def\smash
- {\futurelet\nexttoken\dosmash}
-
-\def\dosmash
- {\ifx\nexttoken[\@EA\dodosmash\else\@EA\donosmash\fi}
-
-\def\donosmash
- {\dodosmash[hd]}
-
-\def\dodosmash[#1]%
- {\edef\@@smash{#1}\futurelet\nexttoken\dododosmash}
-
-\def\dododosmash % if needed we can avoid the \next
- {\ifmmode
- \def\next##1{\mathpalette\mathsm@sh{##1}}%
- \else\ifx\nexttoken\bgroup
- \let\next\finsm@sh
- \else
- \def\next##1{\finsm@sh{##1}}%
- \fi\fi
- \next}
-
-\def\mathsm@sh#1#2% redefined plain macro
- {\finsm@sh{$\mathsurround\zeropoint#1{#2}$}}
-
-\def\makesm@sh#1% redefined plain macro (handles t b h d w)
- {\if#1w\nextboxwd\zeropoint\else
- \if#1h\nextboxht\zeropoint\else
- \if#1d\nextboxdp\zeropoint\else
- \if#1t\nextboxht\zeropoint\else
- \if#1b\nextboxdp\zeropoint\fi\fi\fi\fi\fi}
-
-\def\finsm@sh % redefined plain macro
- {\dowithnextbox{\@EA\handletokens\@@smash\with\makesm@sh\flushnextbox}\normalhbox}
-
-%D \starttabulate[|l|l|]
-%D \NC w \NC \ruledhbox{\smash [w]{This is some great smashing, isn't it?}} \NC \NR
-%D \NC h \NC \ruledhbox{\smash [h]{This is some great smashing, isn't it?}} \NC \NR
-%D \NC d \NC \ruledhbox{\smash [d]{This is some great smashing, isn't it?}} \NC \NR
-%D \NC tb \NC \ruledhbox{\smash [tb]{This is some great smashing, isn't it?}} \NC \NR
-%D \NC whd \NC \ruledhbox{\smash[whd]{This is some great smashing, isn't it?}} \NC \NR
-%D \stoptabulate
-
-%D \macros
-%D {phantom, hphantom, vphantom, mathstrut}
-%D
-%D The next implementation of \type {\phantom} cum suis does
-%D not grab an argument in the non||math case, which is better.
-
-\unexpanded\def\phantom {\ph@nt\nextbox\nextbox\nextbox}
-\unexpanded\def\vphantom{\ph@nt\nextbox\nextbox\voidbox}
-\unexpanded\def\hphantom{\ph@nt\voidbox\voidbox\nextbox}
-
-%D Due to a complicated call to \type {\mathpallete} and
-%D thereby \type {\mathchoice}, the next macro looks ugly.
-%D We also take care of non||braced arguments.
-
-\def\ph@nt#1#2#3%
- {\def\doph@nt
- {\ifmmode
- \def\mathph@nt####1####2{\makeph@nt#1#2#3{$\mathsurround\zeropoint####1{####2}$}}%
- \def\nextph@nt{\mathpalette\mathph@nt}%
- \else\ifx\nextph@nt\bgroup
- \def\nextph@nt{\makeph@nt#1#2#3}%
- \else
- \def\nextph@nt####1{\makeph@nt#1#2#3{####1}}%
- \fi\fi
- \nextph@nt}%
- \futurelet\nextph@nt\doph@nt}
-
-\def\makeph@nt#1#2#3%
- {\begingroup
- \dowithnextbox
- {\setbox\scratchbox\null
- \ht\scratchbox\ht#1%
- \dp\scratchbox\dp#2%
- \wd\scratchbox\wd#3%
- \box\scratchbox
- \endgroup}
- \normalhbox}
-
-\let\finph@nt\undefined
-
-%D We also define plain's \type {\mathstrut}.
-
-\unexpanded\def\mathstrut{\vphantom{(}}
-
-%D \macros
-%D {getboxheight}
-%D
-%D Although often needed, \TEX\ does not support arithmics
-%D like:
-%D
-%D \starttyping
-%D \dimen0 = \ht0 + \dp0
-%D \stoptyping
-%D
-%D so we implemented:
-%D
-%D \starttyping
-%D \getboxheight ... \of \box...
-%D \stoptyping
-%D
-%D For instance,
-%D
-%D \starttyping
-%D \getboxheight \dimen0 \of \box0
-%D \getboxheight \someheight \of \box \tempbox
-%D \stoptyping
-%D
-%D The implementation is rather stupid:
-%D
-%D \starttyping
-%D \def\getboxheight#1\of#2\box#3%
-%D {#1\ht#3\advance#1\dp#3\relax}
-%D \stoptyping
-%D
-%D The next alternative is slightly more clever, since
-%D it accepts \type {{12}} as well as \type {12} as box
-%D number.
-
-\def\getboxheight#1\of#2\box#3%
- {\def\next{#1\dimexpr\ht\registercount+\dp\registercount\relax}%
- \afterassignment\next\registercount=#3}
-
-%D For a long time the following three macros were part of
-%D the grid snapping core module, but it makes more sense to
-%D have them here so that users can see them.
-%D
-%D \macros
-%D {getnoflines, getroundednoflines, getrawnoflines}
-%D
-%D Het commando \type{\getnoflines} converteert een hoogte
-%D (dimensie) in een aantal regels en kent dit toe aan
-%D \type{\noflines}.
-%D
-%D \starttyping
-%D \getnoflines{dimensie}
-%D \stoptyping
-%D
-%D Er wordt gedeeld door \type{\openlineheight} en een hoogte
-%D van~0pt komt overeen met 0~regels. The raw alternative
-%D does not round.
-
-%D For a long time we had:
-%D
-%D \starttyping
-%D \newcount\noflines
-%D \newdimen\noflinesheight
-%D
-%D \def\dogetnoflines#1#2%
-%D {\noflinesheight#2\relax
-%D \ifzeropt\noflinesheight % \ifdim\noflinesheight=\zeropoint
-%D \noflines\zerocount
-%D \else
-%D \divide\noflinesheight \openlineheight
-%D \noflines\noflinesheight
-%D #1\ifdim\noflines\openlineheight=#2\relax \else
-%D \advance\noflines\ifdim#2>\zeropoint\plusone\else\minusone\fi
-%D \fi\fi
-%D \fi}
-%D
-%D \def\getnoflines {\dogetnoflines\iftrue } % compensated
-%D \def\getrawnoflines{\dogetnoflines\iffalse} % no compensation
-%D \stoptyping
-%D
-%D A more recent variant is:
-
-\ifx\roundingeps\undefined \newdimen\roundingeps \roundingeps=10sp \fi
-
-\newcount\noflines
-\newdimen\noflinesheight
-
-% \def\getnoflines {\xdogetnoflines\plusone } % compensated
-% \def\getroundednoflines{\xdogetnoflines\plustwo } % rounded
-% \def\getrawnoflines {\xdogetnoflines\plusthree} % truncated
-%
-% \def\xdogetnoflines#1#2%
-% {\noflinesheight#2\relax
-% \ifzeropt\noflinesheight
-% \noflines\zerocount
-% \else\ifdim\noflinesheight>\zeropoint
-% \ifcase#1\or
-% \advance\noflinesheight-\roundingeps
-% \divide\noflinesheight\openlineheight
-% \noflines\noflinesheight
-% \advance\noflines\plusone
-% \or
-% \advance\noflinesheight\roundingeps
-% \divide\noflinesheight\openlineheight
-% \noflines\noflinesheight
-% \or
-% \advance\noflinesheight\roundingeps
-% \advance\noflinesheight.5\openlineheight
-% \divide\noflinesheight\openlineheight
-% \noflines\noflinesheight
-% \fi
-% \else
-% \ifcase#1\or
-% \advance\noflinesheight\roundingeps
-% \divide\noflinesheight\openlineheight
-% \noflines\noflinesheight
-% \advance\noflines\minusone
-% \or
-% \advance\noflinesheight-\roundingeps
-% \divide\noflinesheight\openlineheight
-% \noflines\noflinesheight
-% \or
-% \advance\noflinesheight-\roundingeps
-% \advance\noflinesheight-.5\openlineheight
-% \divide\noflinesheight\openlineheight
-% \noflines\noflinesheight
-% \fi
-% \fi\fi}
-
-\def\getnoflines#1%
- {\noflinesheight#1\relax
- \ifzeropt\noflinesheight
- \noflines\zerocount
- \else\ifdim\noflinesheight>\zeropoint
- \advance\noflinesheight-\roundingeps
- \divide\noflinesheight\openlineheight
- \noflines\noflinesheight
- \advance\noflines\plusone
- \else
- \advance\noflinesheight\roundingeps
- \divide\noflinesheight\openlineheight
- \noflines\noflinesheight
- \advance\noflines\minusone
- \fi\fi}
-
-\def\getroundednoflines#1%
- {\noflinesheight#1\relax
- \ifzeropt\noflinesheight
- \noflines\zerocount
- \else\ifdim\noflinesheight>\zeropoint
- \advance\noflinesheight\roundingeps
- \divide\noflinesheight\openlineheight
- \noflines\noflinesheight
- \else
- \advance\noflinesheight-\roundingeps
- \divide\noflinesheight\openlineheight
- \noflines\noflinesheight
- \fi\fi}
-
-\def\getrawnoflines#1%
- {\noflinesheight#1\relax
- \ifzeropt\noflinesheight
- \noflines\zerocount
- \else\ifdim\noflinesheight>\zeropoint
- \advance\noflinesheight\roundingeps
- \advance\noflinesheight.5\openlineheight
- \divide\noflinesheight\openlineheight
- \noflines\noflinesheight
- \else
- \advance\noflinesheight-\roundingeps
- \advance\noflinesheight-.5\openlineheight
- \divide\noflinesheight\openlineheight
- \noflines\noflinesheight
- \fi\fi}
-
-%D Let's proof that it works:
-%D
-%D \startbuffer
-%D \scratchdimen\dimexpr(3pt) \getnoflines\scratchdimen 1=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10\lineheight) \getnoflines\scratchdimen 10=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10.1\lineheight) \getnoflines\scratchdimen 11=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10.5\lineheight) \getnoflines\scratchdimen 11=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10.9\lineheight) \getnoflines\scratchdimen 11=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10\lineheight+3pt) \getnoflines\scratchdimen 11=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10\lineheight+3sp) \getnoflines\scratchdimen 10=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10\lineheight-3sp) \getnoflines\scratchdimen 10=\the\noflines \endgraf
-%D
-%D \scratchdimen\dimexpr(3pt) \getrawnoflines\scratchdimen 0=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10\lineheight) \getrawnoflines\scratchdimen 10=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10.1\lineheight) \getrawnoflines\scratchdimen 10=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10.5\lineheight) \getrawnoflines\scratchdimen 11=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10.9\lineheight) \getrawnoflines\scratchdimen 11=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10\lineheight+3pt) \getrawnoflines\scratchdimen 10=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10\lineheight+3sp) \getrawnoflines\scratchdimen 10=\the\noflines \endgraf
-%D \scratchdimen\dimexpr(10\lineheight-3sp) \getrawnoflines\scratchdimen 10=\the\noflines \endgraf
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-
-%D \macros
-%D {determinenoflines}
-%D
-%D The next macro determines the number of lines and
-%D returns it it \type {\noflines}. The macro works
-%D reasonable well as long as the content can be unboxed.
-%D
-%D \starttyping
-%D \determinenoflines{test\\test}
-%D \determinenoflines{\bfd test\\test}
-%D \determinenoflines{\definedfont[Sans at 40pt]test\\test}
-%D \stoptyping
-
-\def\determinenoflines % can be mkiv'd
- {\bgroup
- \forgetall
- \let\crlf\endgraf
- \let\\\endgraf
- \dowithnextbox
- {\beginofshapebox
- \unvbox\nextbox
- \endofshapebox
- % \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}
-%D
-%D When \type {\doifelse} cum suis hopelessly fail, for
-%D instance because we pass data, we can fall back on the next
-%D macro:
-%D
-%D \starttyping
-%D \doiftextelse {data} {then branch} {else branch}
-%D \doiftext {data} {then branch}
-%D \stoptyping
-
-\newif\iftrialtypesetting
-
-\def\doiftextelse#1%
- {\bgroup
- \setbox\scratchbox\normalhbox
- {\trialtypesettingtrue
- \ignorespaces#1\removeunwantedspaces}%
- \ifzeropt\wd\scratchbox
- \egroup\@EA\secondoftwoarguments
- \else
- \egroup\@EA\firstoftwoarguments
- \fi}
-
-\def\doiftext#1#2%
- {\doiftextelse{#1}{#2}\donothing}
-
-%D \macros
-%D {dowithnextbox,nextbox}
-%D
-%D Sometimes we want a macro to grab a box and do something
-%D on the content. One could pass an argument to a box, but
-%D this can violate the specific \CATCODES\ of its content and
-%D leads to unexpected results. The next macro treats the
-%D following braced text as the content of a box and
-%D manipulates it afterwards in a predefined way.
-%D
-%D The first argument specifies what to do with the content.
-%D This content is available in \type{\nextbox}. The second
-%D argument is one of \type{\hbox}, \type{\vbox} or
-%D \type{\vtop}. The third argument must be grouped with
-%D \type{\bgroup} and \type{\egroup}, \type{{...}} or can be
-%D a \type{\box} specification.
-%D
-%D In \CONTEXT\ this macro is used for picking up a box and
-%D treating it according to earlier specifications. We use for
-%D instance something like:
-%D
-%D \starttyping
-%D \def\getfloat%
-%D {\def\handlefloat{...\flushnextbox...}
-%D \dowithnextbox\handlefloat\normalvbox}
-%D \stoptyping
-%D
-%D instead of:
-%D
-%D \starttyping
-%D \def\getfloat#1%
-%D {...#1...}
-%D \stoptyping
-%D
-%D In this implementation the \type{\aftergroup} construction
-%D is needed because \type{\afterassignment} is executed inside
-%D the box.
-
-\ifx\nextbox\undefined \newbox\nextbox \fi
-
-\long\def\dowithnextbox#1%
- {\long\def\dodowithnextbox{#1}%
- \afterassignment\dododowithnextbox
- \setbox\nextbox}
-
-\def\dododowithnextbox
- {\aftergroup\dodowithnextbox}
-
-\long\def\dowithnextboxcs#1%
- {\let\dodowithnextbox#1%
- \afterassignment\dododowithnextbox
- \setbox\nextbox}
-
-\def\dododowithnextbox
- {\aftergroup\dodowithnextbox}
-
-%D So in fact we get:
-%D
-%D \starttyping
-%D \setbox\nextbox { \aftergroup\dodowithnextbox ... }
-%D \stoptyping
-%D
-%D or
-%D
-%D \starttyping
-%D \setbox\nextbox { ... } \dodowithnextbox
-%D \stoptyping
-%D
-%D A slower but more versatile implementation is:
-%D
-%D \starttyping
-%D \long\def\dowithnextbox#1#2%
-%D {\long\def\dodowithnextbox{#1}%
-%D \ifx#2\normalhbox
-%D \afterassignment\dododowithnextbox
-%D \else\ifx#2\normalvbox
-%D \afterassignment\dododowithnextbox
-%D \else\ifx#2\normalvtop
-%D \afterassignment\dododowithnextbox
-%D \else\ifx#2\normalvcenter
-%D \afterassignment\dododowithnextbox
-%D \else
-%D \afterassignment\dodowithnextbox
-%D \fi\fi\fi\fi
-%D \setbox\nextbox#2}
-%D \stoptyping
-%D
-%D This alternative also accepts \type{\box0} and alike, but
-%D we don't really need this functionality now.
-
-%D \macros
-%D {nextboxht,nextboxwd,nextboxdp,flushnextbox}
-%D
-%D The next couple of shortcuts saves us memory as well as
-%D \type {{}}'s in passing parameters.
-
-\def\nextboxht{\ht\nextbox}
-\def\nextboxwd{\wd\nextbox}
-\def\nextboxdp{\dp\nextbox}
-
-\def\flushnextbox{\box\nextbox}
-
-%D \macros
-%D {dowithnextboxcontent}
-%D
-%D But, occasionally we do need to pass some local settings
-%D without wanting to use additional grouping. Therefore we
-%D provide:
-%D
-%D \starttyping
-%D \dowithnextboxcontent{inside}{after}{box content}
-%D \stoptyping
-%D
-%D {\em todo: Search source for potential usage!}
-
-\long\def\dowithnextboxcontent#1#2% inside, after
- {\long\def\dodowithnextbox{#2}%
- \def\dododowithnextbox{#1\aftergroup\dodowithnextbox}%
- \afterassignment\dododowithnextbox
- \setbox\nextbox}
-
-%D Now we can redefine \type {\dowithnextbox} as follows:
-%D
-%D \starttyping
-%D \def\dowithnextbox{\dowithnextboxcontent\empty}
-%D \stoptyping
-%D
-%D But since this macro is used often and since this implementation
-%D is slower, we will not use that definition.
-
-% maybe:
-%
-% depending on the size of the action, about 10% faster
-%
-% \newtoks\nextboxtoks
-%
-% \def\dowithnextbox {\afterassignment\redowithnextbox\nextboxtoks}
-% \def\redowithnextbox {\afterassignment\dododowithnextbox\setbox\nextbox}
-% \def\dododowithnextbox{\aftergroup\dodowithnextbox}
-% \def\dodowithnextbox {\the\nextboxtoks}
-%
-% \long\def\dowithnextboxcontent#1% #2% inside, after
-% {\def\dododowithnextbox{#1\aftergroup\dodowithnextbox}%
-% \afterassignment\redowithnextboxcontent\nextboxtoks}
-%
-% \def\redowithnextboxcontent
-% {\afterassignment\dododowithnextbox\setbox\nextbox}
-
-%D \macros
-%D {llap, rlap, tlap, blap, clap}
-%D
-%D Some well known friends, but we implement them our own
-%D way. We want the macros to work in both math and text mode.
-
-\def\dodorlap{\normalhbox to \zeropoint{\flushnextbox\normalhss}\endgroup}
-\def\dodollap{\normalhbox to \zeropoint{\normalhss\flushnextbox}\endgroup}
-\def\dodoclap{\normalhbox to \zeropoint{\normalhss\flushnextbox\normalhss}\endgroup}
-
-\def\dorlap{\begingroup\dowithnextboxcs\dodorlap\normalhbox}
-\def\dollap{\begingroup\dowithnextboxcs\dodollap\normalhbox}
-\def\doclap{\begingroup\dowithnextboxcs\dodoclap\normalhbox}
-
-\def\domathclap{\mathpalette\dodomathclap} \def\dodomathclap#1#2{\doclap{$\mathsurround\zeropoint#1#2$}}
-\def\domathllap{\mathpalette\dodomathllap} \def\dodomathllap#1#2{\dollap{$\mathsurround\zeropoint#1#2$}}
-\def\domathrlap{\mathpalette\dodomathrlap} \def\dodomathrlap#1#2{\dorlap{$\mathsurround\zeropoint#1#2$}}
-
-\unexpanded\def\rlap{\mathortext\domathrlap\dorlap}
-\unexpanded\def\llap{\mathortext\domathllap\dollap}
-\unexpanded\def\clap{\mathortext\domathclap\doclap}
-
-\def\dodotlap{\normalvbox to \zeropoint{\normalvss\flushnextbox}\endgroup}
-\def\dodoblap{\normalvbox to \zeropoint{\flushnextbox\normalvss}\endgroup}
-
-\def\tlap{\begingroup\dowithnextboxcs\dodotlap\normalvbox}
-\def\blap{\begingroup\dowithnextboxcs\dodoblap\normalvbox}
-
-%D \macros
-%D {beginofshapebox,
-%D reshapebox, doreshapebox,
-%D flushshapebox,
-%D innerflushshapebox,
-%D shapebox,
-%D ifreshapingbox}
-%D
-%D The next utility macro originates from some linenumbering
-%D mechanism. Due to \TEX's advanced way of typesetting
-%D paragraphs, it's not easy to do things on a line||by||line
-%D basis. This macro is able to reprocess a given box and can
-%D act upon its vertical boxed components, such as lines. The
-%D unwinding sequence in this macro is inspired by a \NTG\
-%D workshop of David Salomon in June 1992.
-%D
-%D First we have to grab the piece of text we want to act
-%D upon. This is done by means of the duo macros:
-%D
-%D \starttyping
-%D \beginofshapebox
-%D a piece of text
-%D \endofshapebox
-%D \stoptyping
-%D
-%D When all texts is collected, we can call \type{\reshapebox}
-%D and do something with it's vertical components. We can make
-%D as much passes as needed. When we're done, the box can be
-%D unloaded with \type{\flushshapebox}. The only condition in
-%D this scheme is that \type{\reshapebox} must somehow unload
-%D the \BOX\ \type{\shapebox}.
-%D
-%D An important aspect is that the content is unrolled
-%D bottom||up. The next example illustrates this maybe
-%D unexpected characteristic.
-%D
-%D \startbuffer
-%D \beginofshapebox
-%D \em \input tufte
-%D \endofshapebox
-%D
-%D \newcounter\LineNumber
-%D
-%D \reshapebox
-%D {\doglobal\increment\LineNumber
-%D \normalhbox{\llap{\LineNumber\hskip2em}\box\shapebox}}
-%D
-%D \flushshapebox
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \getbuffer
-%D
-%D As we can see, when some kind of numbering is done, we have
-%D to add a second pass.
-%D
-%D \startbuffer
-%D \newcounter\LineNumber
-%D \newcounter\NumberOfLines
-%D
-%D \reshapebox
-%D {\doglobal\increment\NumberOfLines
-%D \box\shapebox}
-%D
-%D \reshapebox
-%D {\doglobal\increment\LineNumber
-%D \normalhbox
-%D {\llap{\LineNumber\ (\NumberOfLines)\hskip2em}%
-%D \box\shapebox}%
-%D \doglobal\decrement\NumberOfLines}
-%D
-%D \flushshapebox
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \getbuffer
-%D
-%D This example shows that the content of the box is still
-%D available after flushing. Another feature is that only the
-%D last reshaping counts. Multiple reshaping can be done by:
-%D
-%D \startbuffer
-%D \beginofshapebox
-%D \flushshapebox
-%D \endofshapebox
-%D
-%D \reshapebox
-%D {\doglobal\increment\LineNumber
-%D \normalhbox{\llap{$\star$\hskip1em}\box\shapebox}%
-%D \doglobal\decrement\NumberOfLines}
-%D
-%D \flushshapebox
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \getbuffer
-%D
-%D The macros are surprisingly easy to follow and in fact
-%D introduce no new concepts. Nearly all books on \TEX\ show
-%D similar solutions for unwinding \BOXES.
-%D
-%D Some macros, like footnote ones, can be sensitive for
-%D reshaping, which can result in an endless loop. We
-%D therefore offer:
-%D
-%D \starttyping
-%D \ifreshapingbox
-%D \stoptyping
-%D
-%D Some \CONTEXT\ commands are protected this way. Anyhow,
-%D reshaping is aborted after 100 dead cycles.
-%D
-%D By the way, changing the height and depth of \BOX\
-%D \type{\shapebox} results in bad spacing. This means that
-%D for instance linenumbers etc. should be given zero height
-%D and depth before being lapped into the margin. The
-%D previous examples ignore this side effect, but beware!
-
-\newif \ifsomeshapeleft
-\newif \ifreshapingbox
-
-\newbox \shapebox
-\newcount \shapepenalty
-\newdimen \shapekern
-\newskip \shapeskip
-
-\newbox \newshapebox
-\newbox \oldshapebox
-
-\newcount \shapecounter
-
-\newevery \everyshapebox \relax
-
-\def\shapesignal{.12345678pt} % or 12345sp
-
-% todo: in etex lastnode
-
-\def\reshapebox#1%
- {\doreshapebox
- {#1}%
- {\penalty\shapepenalty}%
- {\kern \shapekern }%
- {\vskip \shapeskip }}
-
-\newbox\tmpshapebox
-
-\newif\ifreshapingfailed % may save redundant runs
-
-\def\doreshapebox#1#2#3#4% \shapebox, \shapepenalty, \shapekern, \shapeskip
- {\global\reshapingfailedfalse
- \ifzeropt\ht\oldshapebox % \ifdim\ht\oldshapebox=\zeropoint
- \setbox\newshapebox\normalvbox{}%
- \else
- \setbox\newshapebox\normalvbox
- {\unvcopy\oldshapebox
- \resetbox\newshapebox
- \shapecounter\zerocount
- \doloop{\dodoreshapebox{#1}{#2}{#3}{#4}}}%
- \setbox\newshapebox\box\tmpshapebox
- \fi}
-
-\ifx\originalshapebox\undefined \let\originalshapebox\oldshapebox \fi
-
-% %D The old traditional tex variant:
-%
-% \def\insertshapesignal
-% {\normalhbox to \shapesignal{\strut\hss}% plus \strut
-% \prevdepth\strutdp} % never \nointerlineskip
-%
-% \def\restoreshapebox % compensates for the signal
-% {\global\setbox\tmpshapebox\vbox{\vskip-\lineheight\unvcopy\oldshapebox}}
-%
-% \def\shapeboxstrut % put this in front if needed !
-% {\vrule\!!width\zeropoint\!!height\ht\shapebox\!!depth\dp\shapebox}
-%
-% \def\dodoreshapebox#1#2#3#4% \shapebox, \shapepenalty, \shapekern, \shapeskip
-% {\ifzeropt\lastskip % \ifdim\lastskip=\zeropoint\relax
-% \ifzeropt\lastkern % \ifdim\lastkern=\zeropoint\relax
-% \ifcase\lastpenalty % \ifnum\lastpenalty=\zerocount
-% \setbox\shapebox\lastbox
-% \ifvoid\shapebox
-% \unskip\unpenalty\unkern
-% \else
-% \ifdim\wd\shapebox=\shapesignal\relax
-% \exitloop
-% \else
-% \shapecounter\zerocount
-% \global\setbox\tmpshapebox\normalvbox{#1\unvbox\tmpshapebox}%
-% \fi
-% \fi
-% \else
-% \shapepenalty\lastpenalty
-% \global\setbox\tmpshapebox\normalvbox{#2\unvbox\tmpshapebox}%
-% \unpenalty
-% \fi
-% \else
-% \shapekern\lastkern
-% \global\setbox\tmpshapebox\normalvbox{#3\unvbox\tmpshapebox}%
-% \unkern
-% \fi
-% \else
-% \shapeskip\lastskip
-% \global\setbox\tmpshapebox\normalvbox{#4\unvbox\tmpshapebox}%
-% \unskip
-% \fi
-% \ifnum\shapecounter>100 % can be less
-% \global\reshapingfailedtrue
-% \message{!!forced exit from shapebox!!}%
-% \restoreshapebox
-% \exitloop
-% \else
-% \advance\shapecounter \plusone
-% \fi}
-%
-% But now that the lastnode bugfixes are wide spread we can use:
-%
-% We will turn this into a \MKIV\ variant.
-
-\def\insertshapesignal
- {\normalhbox to \shapesignal{\strut\hss}% plus \strut
- \prevdepth\strutdp} % never \nointerlineskip
-
-\def\restoreshapebox % compensates for the signal
- {\global\setbox\tmpshapebox\vbox{\vskip-\lineheight\unvcopy\oldshapebox}}
-
-\def\dodoreshapebox#1#2#3#4% \shapebox, \shapepenalty, \shapekern, \shapeskip
- {\ifnum\lastnodetype=\@@gluenode
- \shapeskip\lastskip
- \global\setbox\tmpshapebox\normalvbox{#4\unvbox\tmpshapebox}%
- \unskip
- \else\ifnum\lastnodetype=\@@kernnode
- \shapekern\lastkern
- \global\setbox\tmpshapebox\normalvbox{#3\unvbox\tmpshapebox}%
- \unkern
- \else\ifnum\lastnodetype=\@@penaltynode
- \shapepenalty\lastpenalty
- \global\setbox\tmpshapebox\normalvbox{#2\unvbox\tmpshapebox}%
- \unpenalty
- \else\ifnum\lastnodetype<\zeropoint
- \exitloop
- \else
- \setbox\shapebox\lastbox
- \ifvoid\shapebox
- \else\ifdim\wd\shapebox=\shapesignal\relax
- \exitloop
- \else
- \shapecounter\zerocount
- \global\setbox\tmpshapebox\normalvbox{#1\unvbox\tmpshapebox}%
- \fi\fi
- \fi\fi\fi\fi
- \ifnum\shapecounter>100 % can be less
- \global\reshapingfailedtrue
- \message{!!forced exit from shapebox \the\lastnodetype !!}%
- \restoreshapebox
- \exitloop
- \else
- \advance\shapecounter \plusone
- \fi}
-
-\def\beginofshapebox
- {\setbox\oldshapebox\normalvbox
- \bgroup
- \reshapingboxtrue
- \the\everyshapebox
- \insertshapesignal}
-
-\def\endofshapebox
- {\endgraf
- \egroup}
-
-\let\beginshapebox\beginofshapebox
-\let\endshapebox \endofshapebox
-
-\def\flushshapebox
- {\bgroup
- \ifzeropt\ht\newshapebox % \ifdim\ht\newshapebox=\zeropoint
- \else
- % make \prevdepth legal
- % \par before the next \vskip gives far worse results
- \ifdim\parskip>\zeropoint\vskip\parskip\else\par\fi
- % and take a look
- \ifdim\prevdepth=-\thousandpoint
- \prevdepth\zeropoint
- \fi
- \ifdim\prevdepth<\zeropoint\relax
- % something like a line or a signal or ...
- \donetrue
- \else\ifinner
- % not watertight and not ok
- \donefalse
- \else\ifdim\pagegoal=\maxdimen
- \donetrue
- \else
- % give the previous line a normal depth
- \donetrue
- {\forgeteverypar\verticalstrut}\nobreak
- \kern-\struttotal % geen \vskip
- \kern-\parskip
- % \vskip-\strutdp
- \fi\fi\fi
- \scratchdimen\dp\newshapebox
- \unvbox\newshapebox
- % \prevdepth=0pt and \dp\newshapebox depend on last line
- \kern-\scratchdimen % ??
- % now \prevdepth=0pt
- \ifdone
- \kern\strutdp
- \prevdepth\strutdp
- \fi
- \fi
- \egroup}
-
-%D In real inner situations we can use:
-%D
-%D \starttyping
-%D \flushinnershapebox
-%D \stoptyping
-%D
-%D This one is used in \type{\framed}.
-
-% The kern fails on for instance:
-%
-% \omlijnd[offset=0pt,hoogte=8mm,uitlijnen={rechts,laho}]{\bfa test}
-
-\def\innerflushshapebox
- {\ifzeropt\ht\newshapebox \else
- \unvcopy\newshapebox\relax % unvcopy ! else spacing problem
- % \kern-\dp\newshapebox\relax
- \fi}
-
-%D For absolute control, one can use \type{\doreshapebox}
-%D directly. This macro takes four arguments, that take care
-%D of:
-%D
-%D \startitemize[n,packed]
-%D \item \type{\shapebox}
-%D \item \type{\shapepenalty}
-%D \item \type{\shapekern}
-%D \item \type{\shapeskip}
-%D \stopitemize
-
-%D \macros
-%D {shapedhbox}
-%D
-%D When constructing a new box, using the content of \type
-%D {\shapebox}, one can best use \type {\shapedhbox} instead
-%D of \type {\normalhbox}, since it manages the height and depth of
-%D the line.
-
-% \def\shapedhbox
-% {\dowithnextbox
-% {\nextboxht\zeropoint
-% \nextboxdp\zeropoint
-% \flushnextbox}
-% \normalhbox}
-
-\def\shapedhbox % lines with non strutted dimensions have
- {\expanded{\dowithnextbox % interlineskip so if we want the original
- {\nextboxht\the\ht\shapebox % spacing, we need to preserve the original
- \nextboxdp\the\dp\shapebox % height and depth which is definitely
- \noexpand\flushnextbox}} % needed if we apply struts to the 'new'
- \normalhbox} % box or do something that changed ist size
-
-%D \macros
-%D {hyphenatedword,
-%D hyphenatedpar,
-%D hyphenatedfile,
-%D dohyphenateword}
-%D
-%D The next one is a tricky one. \PLAIN\ \TEX\ provides
-%D \type{\showhyphens} for showing macros on the terminal. When
-%D preparing a long list of words we decided to show the
-%D hyphens, but had to find out that the \PLAIN\ alternative
-%D can hardly be used and|/|or adapted to typesetting. The next
-%D two macros do the job and a little more. First we define the
-%D (slightly adapted) plain variant:
-
-\def\showhyphens#1%
- {\begingroup
- \setbox\scratchbox\vbox
- {\parfillskip\zerocount
- \hsize\maxdimen
- %\tenrm
- \pretolerance\minusone
- \tolerance\minusone
- \hbadness\zerocount
- \showboxdepth\zerocount
- \ #1}%
- \endgroup}
-
-%D The simple command \type{\hyphenatedword} accepts one
-%D argument and gives the hyphenated word. This macro calls for
-%D
-%D \starttyping
-%D \dohyphenateword {n} {pre} {word}
-%D \stoptyping
-%D
-%D The next examples tell more than lots of words:
-%D
-%D \startbuffer
-%D \dohyphenateword{0} {} {dohyphenatedword}
-%D \dohyphenateword{1} {...} {dohyphenatedword}
-%D \dohyphenateword{2} {...} {dohyphenatedword}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D Here, \type{\hyphenatedword{dohyphenatedword}} is the
-%D shorter alternative for the first line.
-%D
-%D \startvoorbeeld
-%D \getbuffer
-%D \stopvoorbeeld
-%D
-%D These macros are slow but effective and not that hard to
-%D program at all.
-
-\ifx\scantokens\undefined \let\scantokens\firstofoneargument \fi
-
-\def\dohyphenateword#1#2#3%
- {\bgroup
- \setbox\scratchbox\normalhbox
- {\dontcomplain
- \nopenalties % \widowpenalty \clubpenalty \brokenpenalty \doublehyphendemerits \finalhyphendemerits \adjdemerits
- \hyphenpenalty \zerocount
- \exhyphenpenalty\zerocount
- \setbox0\normalvbox
- {\hsize\zeropoint
- \hskip\zeropoint\relax % really needed
- \ifnum#1<\zeropoint
- \obeyspaces
- \obeylines
- \def\obeyedspace{\hskip\zeropoint\hbox to \onepoint{}\hskip\zeropoint}%
- \let\obeyedline \obeyedspace
- \ifcase-#1\or
- \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
- #3%
- \fi
- \else
- #3%
- \fi}%
- \ifnum#1>\zerocount
- \dorecurse{#1}
- {\setbox2\normalhbox
- {\splittopskip\openstrutheight
- \vsplit0 to \baselineskip}}%
- #2%
- \fi
- \doloop
- {\setbox2\normalhbox
- {\splittopskip\openstrutheight
- \vsplit0 to \baselineskip}%
- \setbox2\normalhbox
- {\unhbox2
- \setbox2\lastbox
- \normalvbox
- {\unvbox2
- \setbox2\lastbox
- \normalhbox{\unhbox2}}}%
- \ifnum#1<\zeropoint\ifdim\wd2=\onepoint\space\else\box2\allowbreak\fi\else\box2\fi
- \ifzeropt\ht0 \exitloop\fi}% % \ifdim\ht0=\zeropoint\exitloop\fi}%
- \removeunwantedspaces}%
- \ifnum#1>\zerocount
- \ht\scratchbox\strutht
- \dp\scratchbox\strutdp
- \box\scratchbox
- \else
- \unhbox\scratchbox
- \fi
- \egroup}
-
-\def\hyphenatedword{\dohyphenateword\zerocount\empty}
-\def\hyphenatedpar {\dohyphenateword\minusone \empty}
-\def\hyphenatedfile{\dohyphenateword{-2}\empty}
-
-%D You may want to give the following call a try:
-%D
-%D \starttyping
-%D \hyphenatedpar{\readfile{zapf}{}{}}\endgraf
-%D \stoptyping
-
-%D \macros
-%D {processtokens}
-%D
-%D We fully agree with (most) typographers that inter||letter
-%D spacing is only permitted in fancy titles, we provide a
-%D macro that can be used to do so. Because this is
-%D (definitely and fortunately) no feature of \TEX, we have to
-%D step through the token list ourselves.
-%D
-%D \starttyping
-%D \processtokens {before} {between} {after} {space} {tokens}
-%D \stoptyping
-%D
-%D An example of a call is:
-%D
-%D \startbuffer
-%D \processtokens {[} {+} {]} {\space} {hello world}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D This results in:
-%D
-%D \getbuffer
-%D
-%D The list of tokens may contain spaces, while \type{\\},
-%D \type{{}} and \type{\ } are handled as space too.
-
-\def\dodoprocesstokens
- {\ifx\nextprocessedtoken\lastcharacter
- \after
- \let\nextprocessedtoken\relax
- \else\ifx\nextprocessedtoken\bgroup
- \def\nextprocessedtoken
- {\dowithnextbox
- {\before{\copy\nextbox}% \before can use nextbox several times
- \let\before\between
- \doprocesstokens}
- \hbox\bgroup}%
- \else
- \expandafter\if\space\nextprocessedtoken
- \after\white
- \let\before\savedbefore
- \else
- \before\nextprocessedtoken
- \let\before\between
- \fi
- \let\nextprocessedtoken\doprocesstokens
- \fi\fi
- \nextprocessedtoken}
-
-\def\doprocesstokens% the space after = is essential
- {\afterassignment\dodoprocesstokens\let\nextprocessedtoken= }
-
-\def\processtokens#1#2#3#4#5%
- {\begingroup
- \def\lastcharacter{\lastcharacter}%
- \def\space{ }%
- \let\\=\space
- \def\before {#1}%
- \def\between{#2}%
- \def\after {#3}%
- \def\white {#4}%
- \let\savedbefore\before
- \doprocesstokens#5\lastcharacter
- \endgroup}
-
-%D \macros
-%D {doboundtext}
-%D
-%D Sometimes there is not enough room to show the complete
-%D (line of) text. In such a situation we can strip of some
-%D characters by using \type{\doboundtext}. When the text is
-%D wider than the given width, it's split and the third
-%D argument is appended. When the text to be checked is packed
-%D in a command, we'll have to use \type{\expandafter}.
-%D
-%D \starttyping
-%D \doboundtext{a very, probably to long, text}{3cm}{...}
-%D \stoptyping
-%D
-%D When calculating the room needed, we take the width of the
-%D third argument into account, which leads to a bit more
-%D complex macro than needed at first sight.
-
-% \def\dodoboundtext#1%
-% {\setbox0=\normalhbox{\unhcopy0 #1}%
-% \ifdim\wd0>\dimen0
-% \let\dodoboundtext=\gobbleoneargument
-% \else
-% #1\relax
-% \fi}
-%
-% \def\doboundtext#1#2#3%
-% {\normalhbox
-% {\setbox0=\normalhbox{#1}%
-% \dimen0=#2\relax
-% \ifdim\wd0>\dimen0
-% \setbox2=\normalhbox{#3}%
-% \advance\dimen0 by -\wd2
-% \setbox0=\normalhbox{}%
-% \processtokens
-% {\dodoboundtext}
-% {\dodoboundtext}
-% {}
-% {\space}
-% {#1}%
-% \box2
-% \else
-% \box0
-% \fi}}
-
-\def\dodoboundtext#1%
- {\setbox0\normalhbox{#1}%
- \advance\scratchdimen -\wd0
- \ifdim\scratchdimen>\zeropoint\relax#1\fi}%
-
-\def\doboundtext#1#2#3%
- {\normalhbox
- {\setbox\scratchbox\normalhbox{#1}%
- \scratchdimen#2\relax
- \ifdim\wd\scratchbox>\scratchdimen
- \setbox\scratchbox\normalhbox{#3}%
- \advance\scratchdimen -\wd\scratchbox
- \handletokens#1\with\dodoboundtext
- \fi
- \box\scratchbox}}
-
-%D \macros
-%D {limitatetext}
-%D
-%D A bit more beautiful alternative for the previous command is
-%D the next one. This command is more robust because we let
-%D \TEX\ do most of the job. The previous command works better
-%D on text that cannot be hyphenated.
-%D
-%D \starttyping
-%D \limitatetext {text} {width} {sentinel}
-%D \limitatetext {text} {-width} {prelude}
-%D \stoptyping
-%D
-%D When no width is given, the whole text comes available. The
-%D sentinel is optional. This is about the third version.
-
-\ifx\fakecompoundhyphen\undefined \let\fakecompoundhyphen\relax \fi
-\ifx\veryraggedright \undefined \def\veryraggedright{\raggedright} \fi
-
-%D The simple alternative is as follows:
-%D
-%D \starttyping
-%D \unexpanded\def\limitatetext%
-%D {\bgroup % evt \setstrut
-%D \forgetall
-%D \fakecompoundhyphen % dangerous ! ! ! ! ! ! ! ! !
-%D \dowithnextbox\dolimitatetext\normalhbox}
-%D
-%D \def\dolimitatetext#1#2%
-%D {\doifelsenothing{#1}
-%D {\unhbox\nextbox}
-%D {\widowpenalty=0
-%D \clubpenalty=0
-%D \scratchdimen=#1\relax
-%D \ifdim\nextboxwd>\scratchdimen
-%D \setbox\scratchbox=\normalhbox{ #2}%
-%D \advance\scratchdimen by -\wd\scratchbox
-%D \setbox\nextbox=\normalvbox
-%D {\hsize=\scratchdimen
-%D \hfuzz\maxdimen
-%D \veryraggedright
-%D \strut\unhcopy\nextbox}%
-%D \ifdim\nextboxht>\strutht \else
-%D \setbox\scratchbox\null % overfull and not split
-%D \fi
-%D \setbox\nextbox=\normalvbox % if omitted: missing brace reported
-%D {\splittopskip=\openstrutheight
-%D \setbox\nextbox=\vsplit\nextbox to \strutht
-%D \unvbox\nextbox
-%D \setbox\nextbox=\lastbox
-%D \global\setbox1=\normalhbox
-%D {\unhbox\nextbox\unskip\kern\zeropoint\box\scratchbox\unskip}}%
-%D \unhbox1
-%D \else
-%D \unhbox\nextbox
-%D \fi}%
-%D \egroup}
-%D \stoptyping
-%D
-%D The next alternative accepts a negative width. A negative
-%D value crops the beginning. The macro thereby becomes less
-%D readable, which is why we kept the original here too.
-
-\unexpanded\def\limitatetext
- {\bgroup % evt \setstrut
- \forgetall % otherwise indentation and so
- %\def\limitatetext##1##2##3{##1}% \def !
- \let\limitatetext\firstofthreearguments
- \fakecompoundhyphen % dangerous ! ! ! ! ! ! ! ! !
- \dowithnextboxcs\dolimitatetext\normalhbox}
-
-\def\dolimitatetext#1#2%
- {\doifelsenothing{#1}
- {\unhbox\nextbox}
- {\nopenalties
- \scratchdimen#1\relax
- \ifdim\scratchdimen<\zeropoint\relax % we'll take the last line
- \donefalse
- \scratchdimen-\scratchdimen
- \else
- \donetrue
- \fi
- \ifdim\nextboxwd>\scratchdimen
- \setbox\scratchbox\normalhbox{\ifdone\space#2\else#2\space\fi}%
- \advance\scratchdimen -\wd\scratchbox
- \setbox0\flushnextbox
- \setbox\nextbox\normalvbox
- {\hsize\scratchdimen
- \hfuzz\maxdimen
- \veryraggedright
- \strut
- \ifdone \else
- \parfillskip\zeropoint
- \rightskip\zeropoint
- \hskip\zeropoint \!!plus 1\!!fill % \hsize
- \fi
- \unhcopy0}%
- \ifdim\nextboxht>\strutht
- \setbox\nextbox\normalvbox % if omitted: missing brace reported
- {\splittopskip\openstrutheight
- \ifdone
- \setbox\nextbox\vsplit\nextbox to \strutht
- \else
- \doloop
- {\setbox0\vsplit\nextbox to \strutht
- \ifdim\nextboxht>\strutht \else \exitloop \fi}%
- \fi
- \unvbox\nextbox
- \setbox\nextbox\lastbox
- \global\setbox1\normalhbox
- {\ifdone
- \unhbox\nextbox\unskip\kern\zeropoint\box\scratchbox
- \else
- \box\scratchbox\unhbox\nextbox
- \fi
- \unskip}}%
- \unhbox1
- \else
- \unhbox0
- \fi
- \else
- \unhbox\nextbox
- \fi}%
- \egroup}
-
-%D We can also limit a text with more control:
-%D
-%D \startbuffer
-%D \limitatetext {\input tufte } {2cm,5mm} {\unknown}
-%D \limitatetext {ton en hans} {2cm,5mm} {\unknown}
-%D \limitatetext {ton en hans zijn eikels} {2cm,5mm} {\unknown}
-%D \limitatetext {ton} {2cm,5mm} {\unknown}
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-%D
-%D We build this feature on top of the previous macro.
-
-\let\normallimitatetext\limitatetext
-
-\def\speciallimitatetext#1#2#3#4% text left right placeholder
- {%\dontleavehmode
- \bgroup
- %\def\speciallimitatetext##1##2##3##4{##1}% \def !
- \let\speciallimitatetext\firstoffourarguments
- \setbox0\normalhbox
- {\nohyphens
- \normallimitatetext{#1}{+#2}{}#4%
- \normallimitatetext{#1}{-#3}{}}%
- \setbox2\normalhbox
- {#1}%
- \ifdim\wd2<\wd0 #1\else\unhbox0\fi
- \egroup}
-
-\def\limitatetext#1#2#3% \expanded added 2003/01/16
- {\expanded{\beforesplitstring#2}\at,\to\leftlimit
- \expanded{\aftersplitstring #2}\at,\to\rightlimit
- \ifx\rightlimit\empty
- \normallimitatetext {#1}\leftlimit {#3}%
- \else
- \speciallimitatetext{#1}\leftlimit\rightlimit{#3}%
- \fi}
-
-%D Undocumented bonus (see wiki):
-%D
-%D \starttyping
-%D \limitatefirstline{\input tufte\relax}{10cm}{\unknown}
-%D \stoptyping
-
-\def\limitatefirstline#1#2#3%
- {\hbox\bgroup\strut
- \setbox\scratchbox\hbox{\begstrut#1\endstrut}%
- \ifdim\wd\scratchbox>#2\relax
- \setbox\scratchbox\hbox{#3}%
- \hsize#2\relax
- \advance\hsize-\wd\scratchbox
- \setbox\scratchbox\vbox{\forgetall\veryraggedright#1}%
- \setbox\scratchbox\vsplit\scratchbox to \lineheight
- \vbox
- {\unvbox\scratchbox
- \global\setbox\plusone\lastbox
- \global\setbox\plusone\hbox{\strut\unhbox\plusone}%
- \hbox % to #2
- {\ifx\clip\undefined
- \box\plusone
- \else\ifdim\wd\plusone>\hsize
- \lower\strutdepth\hbox{\clip[\c!width=\hsize,\c!height=\lineheight]{\hbox{\raise\strutdepth\box\plusone}}}%
- \else
- \box\plusone
- \fi\fi
- \removeunwantedspaces#3}}% \removeunwantedspaces\hss#3}}%
- \else
- #1%
- \fi
- \egroup}
-
-%D \macros
-%D {processisolatedwords,
-%D betweenisolatedwords,nothingbetweenisolatedwords}
-%D
-%D References are often made up of one word or a combination
-%D of tightly connected words. The typeset text {\bf
-%D chapter~5} is for instance the results of the character
-%D sequence:
-%D
-%D \starttyping
-%D The typeset text \in{chapter}[texniques] is for instance
-%D \stoptyping
-%D
-%D When such words are made active in interactive texts, the
-%D combination cannot longer be hyphenated. Normally this is no
-%D problem, because \TEX\ tries to prevent hyphenation as best
-%D as can.
-%D
-%D Sometimes however we need a few more words to make things
-%D clear, like when we want to refer to {\bf \TEX\ by Topic}.
-%D The macros that are responsible for typesetting hyperlinks,
-%D take care of such sub||sentences by breaking them up in
-%D words. Long ago we processed words using the space as a
-%D separator, but the more advanced our interactive text became,
-%D the more we needed a robust solution. Well, here it is and
-%D it called as:
-%D
-%D \starttyping
-%D \processisolatedwords{some words}\someaction
-%D \stoptyping
-%D
-%D The second argument \type{someactions} handles the
-%D individual words, like in:
-%D
-%D \startbuffer
-%D \processisolatedwords{some more words} \ruledhbox \par
-%D \processisolatedwords{and some $x + y = z$ math} \ruledhbox \par
-%D \processisolatedwords{and a \normalhbox{$x + y = z$}} \ruledhbox \par
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D which let the words turn up as:
-%D
-%D \startvoorbeeld
-%D \getbuffer
-%D \stopvoorbeeld
-%D
-%D The macro has been made a bit more clever than needed at
-%D first sight. This is due to the fact that we don't want to
-%D generate more overhead in terms of interactive commands than
-%D needed.
-%D
-%D \startbuffer
-%D \processisolatedwords{see this \ruledhskip1em} \ruledhbox
-%D \processisolatedwords{and \ruledhskip1em this one} \ruledhbox
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D becomes:
-%D
-%D \startvoorbeeld
-%D \startlines
-%D \getbuffer
-%D \stoplines
-%D \stopvoorbeeld
-%D
-%D Single word arguments are treated without further
-%D processing. This was needed because this command is used in
-%D the \type{\goto} command, to which we sometimes pass very
-%D strange and|/|or complicated arguments or simply boxes
-%D whose dimensions are to be left intact.
-%D
-%D First we build a \type{\normalhbox}. This enables us to save the
-%D last skip. Next we fill a \type{\normalvbox} without hyphenating
-%D words. After we've tested if there is more than one word, we
-%D start processing the individual lines (words). We need some
-%D splitting, packing and unpacking to get the spacing and
-%D dimensions right.
-%D
-%D Normally the isolated words are separated by space, but
-%D one can overrule this separator by changing the next macros.
-%D
-%D When needed, spacing can be suppressed by \type
-%D {\nothingbetweenisolatedwords}.
-
-\newif\ifisolatedwords % public, e.g. used in core-ref
-
-\def\betweenisolatedwords
- {\hskip\currentspaceskip}
-
-%D In order to prevent problems with nested isolated words, we
-%D do process them, but only split at the outermost level.
-
-\newskip\isolatedlastskip
-
-\chardef\isolatedwordsmode=0 % no nesting
-
-\def\processisolatedwords#1#2% todo: vbox ipv hbox ivm afbreken!
- {\bgroup % todo: doloop
- \fakecompoundhyphen
- \dontcomplain
- \forgetall
- \nopenalties
- \ifcase\isolatedwordsmode
- \def\processisolatedwords##1##2{##2{##1}}% we split only once
- \fi
- \global\let\localbetweenisolatedwords\betweenisolatedwords
- \setbox0\normalhbox % we default to spaces, but from inside out
- {\normallanguage\minusone % needed for mkiv
- \ignorespaces#1% \localbetweenisolatedwords can be overruled
- \global\isolatedlastskip\lastskip}%
- \setbox2\normalvbox
- {%\hyphenpenalty10000 % this one fails in \url breaking,
- \lefthyphenmin\maxcard % but this trick works ok, due to them
- \righthyphenmin\maxcard % total>63, when no hyphenation is done
- \hsize\zeropoint
- \unhcopy0}% == #1
- \ifdim\ht0=\ht2
- \isolatedwordsfalse
- #2{\unhbox0}% == #2{#1} % was \unhcopy0
- \else
- \isolatedwordstrue
- \setbox0\normalhbox
- {\ignorespaces
- \loop
- \setbox4\normalhbox
- {\splittopskip\openstrutheight
- \vsplit2 to \baselineskip}%
- \normalhbox
- {\unhbox4\unskip % recently added
- \setbox4\lastbox
- \normalvbox % outer \normalhbox needed
- {\unvbox4 % for nested use
- \setbox4\lastbox
- \normalhbox{#2{\normalhbox
- {\unhbox4
- \unskip\unpenalty % remove end of line stuff
- \global\dimen1\lastkern}}}}}%
- \ifdim\ht2>\zeropoint\relax
- \ifdim\dimen1=\compoundbreakpoint
- \allowbreak
- \else
- \localbetweenisolatedwords
- \fi
- \repeat
- \unskip}%
- \unhbox0\unskip
- \ifzeropt\isolatedlastskip\else % added % \ifdim\isolatedlastskip=\zeropoint\else % added
- \hskip\isolatedlastskip
- \fi
- \fi
- \egroup}
-
-%D One can use the next macro to change the intersplit
-%D material. An example can be found in the \type {\url}
-%D macro. The innermost setting is used. In the url case, it
-%D means that either very small spaces are used or no spaces
-%D at all. So, the innermost settings are used, while the
-%D outermost split takes place.
-
-\def\setbetweenisolatedwords#1%
- {\gdef\localbetweenisolatedwords{#1}}
-
-%D \macros
-%D {sbox}
-%D
-%D This is a rather strange command. It grabs some box content
-%D and and limits the size to the height and depth of a
-%D \type{\strut}. The resulting bottom||alligned box can be used
-%D aside other ones, without disturbing the normal baseline
-%D distance.
-%D
-%D \startbuffer
-%D \ruledhbox to .5\hsize{\sbox{eerste\par tweede \par derde}}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D Shows up as:
-%D
-%D \startvoorbeeld
-%D \vskip3\baselineskip
-%D \getbuffer
-%D \stopvoorbeeld
-%D
-%D Before displaying the result we added some skip, otherwise
-%D the first two lines would have ended up in the text. This
-%D macro can be useful when building complicated menus, headers
-%D and footers and|/|or margin material.
-
-\def\sbox% in handleiding, voorbeeld \inleft{xx} \extern..
- {\normalvbox\bgroup % new ! ! !
- \dowithnextbox
- {\setbox\scratchbox\normalhbox
- {\strut
- \nextboxdp\zeropoint
- \lower\strutdepth\flushnextbox}%
- \dp\scratchbox\strutdepth
- \ht\scratchbox\strutheight
- \box\scratchbox
- \egroup}%
- \normalvbox}
-
-%D \macros
-%D {struttedbox}
-%D
-%D This boxing macro limits the height and depth to those of
-%D a strut.
-
-\def\struttedbox
- {\normalhbox\bgroup % new ! ! !
- \dowithnextbox
- {\nextboxdp\strutdepth
- \nextboxht\strutheight
- \flushnextbox
- \egroup}%
- \normalhbox}
-
-%D \macros
-%D {topskippedbox}
-%D
-%D This macro compensates the difference between the topskip
-%D and strutheight. Watch how we preserve the depth when it
-%D equals strutdepth.
-
-\def\topskippedbox
- {\normalhbox\bgroup
- \dowithnextbox
- {\edef\next
- {\ifdim\strutdepth=\nextboxdp\nextboxdp\the\nextboxdp\fi}%
- \lower\topskip\normalhbox{\raise\strutheight\flushnextbox}%
- \next
- \egroup}%
- \normalhbox}
-
-%D \macros
-%D {centeredbox, centerednextbox}
-%D
-%D Here is another strange one. This one offers a sort of overlay
-%D with positive or negative offsets. This command can be used
-%D in well defined areas where no offset options are available.
-%D We first used it when building a button inside the margin
-%D footer, where the button should have a horizontal offset and
-%D should be centered with respect to the surrounding box. The
-%D last of the three examples we show below says:
-%D
-%D \starttyping
-%D \vsize=3cm
-%D \hsize=3cm
-%D \ruledvbox to \vsize
-%D {\centeredbox height .5cm width -1cm
-%D {\vrule width \hsize height \vsize}}}
-%D \stoptyping
-%D
-%D Here the \type{\ruledvbox} just shows the surrounding box
-%D and \type{\vrule} is used to show the centered box.
-%D
-%D \def\AnExample#1#2%
-%D {\vsize=3cm
-%D \hsize=3cm
-%D \ruledvbox to \vsize
-%D {\centeredbox height #1 width #2
-%D {\color[green]{\vrule width \hsize height \vsize}}}}
-%D
-%D \startlinecorrection
-%D \startcombination[3*1]
-%D {\AnExample {-1cm} {.5cm}} {}
-%D {\AnExample {.5cm} {-1cm}} {}
-%D {\AnExample {-1cm} {-.5cm}} {}
-%D \stopcombination
-%D \stoplinecorrection
-%D
-%D This command takes two optional arguments: \type{width} and
-%D \type{height}. Observing readers can see that we use \TEX's
-%D own scanner for grabbing these arguments: \type{#1#} reads
-%D everyting till the next brace and passes it to both rules.
-%D The setting of the box dimensions at the end is needed for
-%D special cases. The dimensions of the surrounding box are kept
-%D intact. This commands handles positive and negative
-%D dimensions (which is why we need two boxes with rules).
-
-\def\centeredbox#1#% height +/-dimen width +/-dimen
- {\bgroup
- \setbox0\normalvbox to \vsize
- \bgroup
- \dontcomplain
- \forgetall
- \setbox0\normalhbox{\vrule\!!width \zeropoint#1}%
- \setbox2\normalvbox{\hrule\!!height\zeropoint#1}%
- \advance\vsize \ht2
- \advance\hsize \wd0
- \normalvbox to \vsize
- \bgroup
- \vskip-\ht2
- \vss
- \normalhbox to \hsize
- \bgroup
- \dowithnextbox
- {\hskip-\wd0
- \hss
- \flushnextbox
- \hss
- \egroup
- \vss
- \egroup
- \egroup
- \wd0\hsize
- \ht0\vsize
- \box0
- \egroup}
- \normalhbox}
-
-%D For those who don't want to deal with \type {\hsize}
-%D and \type {\vsize}, we have:
-%D
-%D \starttyping
-%D \centerednextbox width 2bp height 2bp
-%D {\framed[width=100bp,height=100bp]{}}
-%D \stoptyping
-%D
-%D Do you see what we call this one \type {next}?
-
-\def\centerednextbox#1#%
- {\bgroup
- \dowithnextbox
- {\hsize\nextboxwd
- \vsize\nextboxht
- \centeredbox#1{\flushnextbox}%
- \egroup}
- \normalhbox}
-
-%D \macros
-%D {centerbox}
-%D
-%D Centering on the available space is done by:
-%D
-%D \starttyping
-%D \centerbox <optional specs> {content}
-%D \stoptyping
-%D
-%D When omitted, the current \type {\hsize} and \type
-%D {\vsize} are used. Local dimensions are supported.
-
-\long\def\centerbox#1#% optional height +/-dimen width +/-dimen
- {\bgroup
- \dowithnextbox
- {\setlocalhsize
- \setbox0\normalhbox{\vrule\!!width \zeropoint#1}%
- \setbox2\normalvbox{\hrule\!!height\zeropoint#1}%
- \ifzeropt\wd0\else\hsize\wd0\fi % \hsize\ifdim\wd0=\zeropoint\hsize\else\wd0\fi
- \ifzeropt\ht2\else\vsize\ht2\fi % \vsize\ifdim\ht2=\zeropoint\vsize\else\ht2\fi
- \normalvbox to \vsize{\vss\normalhbox to \hsize{\hss\flushnextbox\hss}\vss}%
- \egroup}%
- \normalhbox}
-
-%D \macros
-%D {setrigidcolumnhsize,rigidcolumnbalance,rigidcolumnlines}
-%D
-%D These macros are copied from the \TEX book, page~397, and
-%D extended by a macro that sets the \type{\hsize}.
-%D
-%D \starttyping
-%D \setrigidcolumnhsize {total width} {distance} {n}
-%D \rigidcolumnbalance {box}
-%D \stoptyping
-%D
-%D Both these macros are for instance used in typesetting
-%D footnotes.
-%D
-%D Men kan het proces van breken enigzins beinvloeden met de
-%D volgende twee switches:
-
-\newif\ifalignrigidcolumns
-\newif\ifstretchrigidcolumns
-\newif\iftightrigidcolumns % if true: just a vbox, no depth/noflines/gridsnap corrrections
-
-%D De eerste switch bepaald het uitlijnen, de tweede rekt de
-%D individuele kolommen op naar \type{\vsize}.
-
-\def\setrigidcolumnhsize#1#2#3% todo: \dimexpr
- {\xdef\savedrigidhsize{\the\hsize}%
- \hsize#1\relax
- \global\chardef\rigidcolumns#3\relax
- \scratchdimen -#2\relax
- \multiply\scratchdimen #3\relax
- \advance\scratchdimen #2\relax
- \advance\hsize \scratchdimen
- \divide\hsize #3\relax}
-
-% ==
-%
-% \def\setrigidcolumnhsize#1#2#3%
-% {\xdef\savedrigidhsize{\the\hsize}%
-% \global\chardef\rigidcolumns#3\relax
-% \hsize=\dimexpr(#1-\numexpr#3-1\relax\dimexpr#2\relax)/#3\relax}
-
-\newbox\rigidcolumnbox
-
-\let\rigidcolumnlines\!!zerocount
-
-\def\rigidcolumnbalance#1%
- {\ifnum\rigidcolumns=1 % tzt ook h/d correctie
- \ifinner\ifhmode\box\else\unvbox\fi\else\unvbox\fi#1\relax
- \else
- \normalvbox
- {\forgetall
- \nopenalties
- \dontcomplain
- \setbox\rigidcolumnbox\normalvbox
- {\line{}\goodbreak\unvbox#1\removebottomthings}%
- \splittopskip\openstrutheight
- \setbox\scratchbox\vsplit\rigidcolumnbox to \zeropoint
- \ifcase\rigidcolumnlines\relax
- % \iffalse
- % % maybe some day an option
- % \scratchskip\ht\rigidcolumnbox
- % \advance\scratchskip\dp\rigidcolumnbox
- % \getnoflines\scratchskip
- % \ifodd\noflines
- % \advance\noflines\plusone
- % \fi
- % \divide\noflines\rigidcolumns
- %\else
- \scratchdimen\ht\rigidcolumnbox
- \divide\scratchdimen \rigidcolumns
- \getnoflines\scratchdimen
- %\fi
- \else
- \noflines\rigidcolumnlines % to be sure
- \fi
- \scratchdimen\noflines\lineheight
- % new: we now loop so that we don't loose content
- % since in practice we also use this macro for
- % funny lineheights and border cases
- \setbox0=\box\rigidcolumnbox
- \doloop
- {\setbox\rigidcolumnbox=\copy0
- \setbox\scratchbox\normalhbox to \savedrigidhsize
- {\dorecurse\rigidcolumns
- {\setbox\scratchbox\vsplit\rigidcolumnbox to \scratchdimen
- \dp\scratchbox\openstrutdepth
- \setbox\scratchbox\normalvtop
- \ifalignrigidcolumns to
- \ifstretchrigidcolumns\vsize\else\scratchdimen\fi
- \fi
- {\unvbox\scratchbox}%
- \wd\scratchbox\hsize
- \box\scratchbox
- \hfill}%
- \hfillneg}%
- \ifvoid\rigidcolumnbox\exitloop\else\advance\scratchdimen\lineheight\fi}%
- \iftightrigidcolumns
- \setbox\scratchbox\normalhbox{\raise\dp\scratchbox\box\scratchbox}%
- \else
- \advance\scratchdimen -\openstrutdepth
- \setbox\scratchbox\normalhbox{\raise\scratchdimen\box\scratchbox}%
- \dp\scratchbox\openstrutdepth
- \ht\scratchbox\scratchdimen
- \fi
- \box\scratchbox}%
- \fi}
-
-%D \macros
-%D {startvboxtohbox,stopvboxtohbox,convertvboxtohbox}
-%D
-%D Here is another of Knuth's dirty tricks, as presented on
-%D pages 398 and 399 of the \TEX book. These macros can be used
-%D like:
-%D
-%D \starttyping
-%D \normalvbox
-%D \bgroup
-%D \startvboxtohbox ... \stopvboxtohbox
-%D \startvboxtohbox ... \stopvboxtohbox
-%D \startvboxtohbox ... \stopvboxtohbox
-%D \egroup
-%D
-%D \normalvbox
-%D \bgroup
-%D \convertvboxtohbox
-%D \egroup
-%D \stoptyping
-%D
-%D These macros are used in reformatting footnotes, so they do
-%D what they're meant for.
-
-\def\setvboxtohbox
- {\bgroup
- \ifdim\baselineskip<16pt \relax
- \scratchdimen\baselineskip
- \multiply\scratchdimen 1024
- \else
- \message{cropping \baselineskip to 16pt}%
- \scratchdimen\maxdimen
- \fi
- \divide\scratchdimen \hsize
- \multiply\scratchdimen 64
- \xdef\normalvboxtohboxfactor{\withoutpt\the\scratchdimen}%
- \egroup}
-
-\def\startvboxtohbox
- {\bgroup
- \setvboxtohbox
- \setbox\scratchbox\normalhbox\bgroup}
-
-\def\stopvboxtohbox
- {\egroup
- \dp\scratchbox\zeropoint
- \ht\scratchbox\normalvboxtohboxfactor\wd\scratchbox
- \box\scratchbox
- \egroup}
-
-% % to be done: start halfway a line combined with one line
-% % extra to start with (skip) and one line less than counted.
-%
-% \def\stopvboxtohbox%
-% {\egroup
-% \setbox2=\normalvbox
-% {\forgetall\unhcopy0\par\xdef\globalvhlines{\the\prevgraf}}%
-% \setbox2=\normalvbox
-% {\unvbox2
-% \setbox2=\lastbox
-% \setbox2=\normalhbox{\unhbox2}%
-% \xdef\globalvhwidth{\the\wd2}}%
-% \decrement\globalvhlines
-% \dimen0=\globalvhwidth
-% \dimen0=\normalvboxtohboxfactor\dimen0
-% \advance\dimen0 by \globalvhlines\lineheight
-% \dp0=\zeropoint
-% \ht0=\dimen0
-% %\writestatus{guessed size}
-% % {w:\the\wd0\space\space
-% % b:\the\baselineskip\space
-% % l:\globalvhlines\space
-% % e:\globalvhwidth\space
-% % h:\the\dimen0}%
-% \box0
-% \egroup}
-
-% todo: \scratchbox
-
-\def\convertvboxtohbox
- {\setvboxtohbox
- \makehboxofhboxes
- \setbox0\normalhbox{\unhbox0 \removehboxes}%
- \noindent\unhbox0\par}
-
-\def\makehboxofhboxes
- {\setbox0\normalhbox{}%
- \loop % \doloop { .. \exitloop .. }
- \setbox2\lastbox
- \ifhbox2
- \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
- {\removehboxes}\unhbox0
- \fi}
-
-%D \macros
-%D {unhhbox}
-%D
-%D The next macro is used in typesetting inline headings.
-%D Let's first look at the macro and then show an example.
-
-\newbox \unhhedbox
-\newbox \hhbox
-\newdimen \lasthhboxwidth
-\newskip \hhboxindent
-
-\def\unhhbox#1\with#2%
- {\bgroup
- \nopenalties
- \dontcomplain
- \forgetall
- \setbox\unhhedbox\normalvbox{\hskip\hhboxindent\strut\unhbox#1}% => \hsize
- \doloop
- {\setbox\hhbox\vsplit\unhhedbox to \lineheight
- \ifvoid\unhhedbox
- \setbox\hhbox\normalhbox{\strut\normalhboxofvbox\hhbox}%
- \fi
- \ht\hhbox\strutht
- \dp\hhbox\strutdp
- \ifzeropt\hhboxindent\else % \ifdim\hhboxindent=\zeropoint\else
- \setbox\hhbox\normalhbox{\hskip-\hhboxindent\box\hhbox}%
- \hhboxindent\zeropoint
- \fi
- \global\lasthhboxwidth\wd\hhbox
- #2\relax
- \ifvoid\unhhedbox
- \exitloop
- \else
- \hskip\zeropoint \!!plus \zeropoint
- \fi}%
- \egroup}
-
-\def\dohboxofvbox
- {\setbox0\normalvbox{\unvbox\scratchcounter\global\setbox1\lastbox}%
- \unhbox1
- \egroup}
-
-\def\normalhboxofvbox
- {\bgroup
- \afterassignment\dohboxofvbox
- \scratchcounter=}
-
-%D This macro can be used to break a paragraph apart and treat
-%D each line seperately, for instance, making it clickable. The
-%D main complication is that we want to be able to continue the
-%D paragraph, something that's needed in the in line section
-%D headers.
-%D
-%D \startbuffer
-%D \setbox0=\normalhbox{\input tufte \relax}
-%D \setbox2=\normalhbox{\input knuth \relax}
-%D \unhhbox0\with{\ruledhbox{\box\hhbox}}
-%D \hskip1em plus 1em minus 1em
-%D \hhboxindent=\lasthhboxwidth
-%D \advance\hhboxindent by \lastskip
-%D \unhhbox2\with{\ruledhbox{\box\hhbox}}
-%D \stopbuffer
-%D
-%D \getbuffer
-%D
-%D This piece of text was typeset by saying:
-%D
-%D \typebuffer
-%D
-%D Not that nice a definition, but effective. Note the stretch
-%D we've build in the line that connects the two paragraphs.
-
-%D \macros
-%D {doifcontent}
-%D
-%D When processing depends on the availability of content, one
-%D can give the next macro a try.
-%D
-%D \starttyping
-%D \doifcontent{pre content}{post content}{no content}\somebox
-%D \stoptyping
-%D
-%D Where \type{\somebox} is either a \type{\normalhbox} or
-%D \type{\normalvbox}. If the dimension of this box suggest some
-%D content, the resulting box is unboxed and surrounded by the
-%D first two arguments, else the third arguments is executed.
-
-\unexpanded\def\doifcontent#1#2#3%
- {\dowithnextbox
- {\ifhbox\nextbox
- \ifdim\nextboxwd>\zeropoint
- #1\unhbox\nextbox#2\relax
- \else
- #3\relax
- \fi
- \else
- \ifdim\nextboxht>\zeropoint
- #1\unvbox\nextbox#2\relax
- \else
- #3\relax
- \fi
- \fi}}
-
-%D So when we say:
-%D
-%D \startbuffer
-%D \doifcontent{[}{]}{}\normalhbox{content sensitive typesetting}
-%D
-%D \doifcontent{}{\page}{}\normalvbox{content sensitive typesetting}
-%D
-%D \doifcontent{}{}{\message{Didn't you forget something?}}\normalhbox{}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D We get:
-%D
-%D \getbuffer
-%D
-%D Where the last call of course does not show up in this
-%D document, but definitely generates a confusing message.
-
-%D \macros
-%D {processboxes}
-%D
-%D The next macro gobble boxes and is for instance used for
-%D overlays. First we show the general handler.
-
-\newbox\processbox
-
-\def\processboxes#1%
- {\bgroup
- \def\doprocessbox{#1}% #1 can be redefined halfway
- \resetbox\processbox
- \afterassignment\dogetprocessbox\let\next=}
-
-\def\endprocessboxes
- {\ifhmode\unskip\fi
- \box\processbox
- \next
- \egroup}
-
-\def\dogetprocessbox
- {\ifx\next\bgroup
- \expandafter\dodogetprocessbox
- \else
- \expandafter\endprocessboxes
- \fi}
-
-\def\dodogetprocessbox
- {\dowithnextbox
- {\ifhmode\unskip\fi\doprocessbox % takes \nextbox makes \processbox
- \afterassignment\dogetprocessbox\let\next=}
- \normalhbox\bgroup}
-
-%D \macros
-%D {startoverlay}
-%D
-%D We can overlay boxes by saying:
-%D
-%D \startbuffer
-%D \startoverlay
-%D {\framed{hans}}
-%D {\framed[width=3cm]{ton}}
-%D {\framed[height=2cm]{oeps}}
-%D \stopoverlay
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D shows up as:
-%D
-%D \leavevmode\getbuffer
-
-% \def\dooverlaybox%
-% {\ifhmode\unskip\fi
-% \ifdim\nextboxht>\ht\processbox
-% \setbox\processbox\normalvbox to \nextboxht
-% {\vss\box\processbox\vss}%
-% \else
-% \setbox\nextbox\normalvbox to \ht\processbox
-% {\vss\flushnextbox\vss}%
-% \fi
-% \scratchdimen=\wd
-% \ifdim\nextboxwd>\wd\processbox
-% \nextbox
-% \else
-% \processbox
-% \fi
-% \setbox\processbox=\normalhbox to \scratchdimen
-% {\normalhbox to \scratchdimen{\hss\box\processbox\hss}%
-% \hskip-\scratchdimen
-% \normalhbox to \scratchdimen{\hss\flushnextbox\hss}}}
-%
-% \def\startoverlay%
-% {\bgroup
-% \let\stopoverlay\egroup
-% \processboxes\dooverlaybox}
-
-\def\dooverlaybox
- {\ifhmode\unskip\fi
- \scratchdimen\dp
- \ifdim\nextboxdp>\dp\processbox
- \nextbox
- \else
- \processbox
- \fi
- \ifdim\nextboxht>\ht\processbox
- \setbox\processbox\normalvbox to \nextboxht
- {\dp\processbox\zeropoint\vss\box\processbox\vss}%
- \else
- \setbox\nextbox\normalvbox to \ht\processbox
- {\nextboxdp\zeropoint\vss\flushnextbox\vss}%
- \fi
- \nextboxdp\scratchdimen
- \dp\processbox\scratchdimen
- \scratchdimen\wd
- \ifdim\nextboxwd>\wd\processbox
- \nextbox
- \else
- \processbox
- \fi
- \setbox\processbox\normalhbox to \scratchdimen
- {\normalhbox to \scratchdimen{\hss\box\processbox\hss}%
- \hskip-\scratchdimen
- \normalhbox to \scratchdimen{\hss\flushnextbox\hss}}}
-
-\unexpanded\def\startoverlay
- {\bgroup
- \let\stopoverlay\egroup
- \processboxes\dooverlaybox}
-
-\let\stopoverlay\relax
-
-% %D \macros
-% %D {starthspread}
-% %D
-% %D In a similar way we can build a horizontal box, spread
-% %D over the available width.
-% %D
-% %D \startbuffer
-% %D \starthspread
-% %D {hans}
-% %D {ton}
-% %D {oeps}
-% %D \stophspread
-% %D
-% %D \stopbuffer
-% %D
-% %D \typebuffer
-% %D
-% %D shows up as:
-% %D
-% %D \leavevmode\getbuffer
-%
-% \def\dohspread
-% {\flushnextbox
-% \def\dohspread{\hfil\flushnextbox}}
-%
-% \def\starthspread
-% {\normalhbox to \hsize \bgroup
-% \let\stophspread\egroup
-% \processboxes\dohspread}
-
-%D \macros
-%D {fakebox}
-%D
-%D The next macro is a rather silly one, but saves space.
-%D
-%D \starttyping
-%D \normalhbox{\fakebox0}
-%D \stoptyping
-%D
-%D returns an empty box with the dimensions of the box
-%D specified, here being zero.
-
-\def\dofakebox
- {\setbox\scratchbox\null
- \wd\scratchbox\wd\scratchcounter
- \ht\scratchbox\ht\scratchcounter
- \dp\scratchbox\dp\scratchcounter
- \ifhbox\scratchcounter\normalhbox\else\normalvbox\fi{\box\scratchbox}%
- \egroup}
-
-\def\fakebox
- {\bgroup
- \afterassignment\dofakebox\scratchcounter}
-
-%D \macros
-%D {lbox,rbox,cbox,tbox,bbox}
-%D
-%D Here are some convenient alternative box types:
-%D
-%D \starttyping
-%D \lbox{text ...}
-%D \cbox{text ...}
-%D \rbox{text ...}
-%D \stoptyping
-%D
-%D Are similar to \type {\normalvbox}, which means that they also
-%D accept something like \type{to 3cm}, but align to the left,
-%D middle and right. These box types can be used to typeset
-%D paragraphs.
-
-\def\lbox{\makelrcbox\normalvbox\raggedleft}
-\def\cbox{\makelrcbox\normalvbox\raggedcenter}
-\def\rbox{\makelrcbox\normalvbox\raggedright}
-
-\def\ltop{\makelrcbox\normalvtop\raggedleft}
-\def\ctop{\makelrcbox\normalvtop\raggedcenter}
-\def\rtop{\makelrcbox\normalvtop\raggedright}
-
-\def\makelrcbox#1#2#3#%
- {#1#3\bgroup \forgetall \let\\=\endgraf #2\let\next=}
-
-%D The alternatives \type {\tbox} and \type {\bbox} can be used
-%D to properly align boxes, like in:
-%D
-%D \setupexternalfigures[directory={../sample}]
-%D \startbuffer
-%D \starttable[|||]
-%D \HL
-%D \VL \tbox{\externalfigure[cow][height=3cm,frame=on]} \VL top aligned \VL\SR
-%D \HL
-%D \VL \bbox{\externalfigure[cow][height=3cm,frame=on]} \VL bottom aligned \VL\SR
-%D \HL
-%D \stoptable
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D The positioning depends on the strut settings:
-%D
-%D \getbuffer
-
-\def\tbox{\tbbox\ht\dp}
-\def\bbox{\tbbox\dp\ht}
-
-\def\tbbox#1#2%
- {\normalhbox\bgroup
- \dowithnextbox
- {\scratchdimen\nextboxht
- \advance\scratchdimen\nextboxdp
- \advance\scratchdimen-#1\strutbox
- #1\nextbox#1\strutbox
- #2\nextbox\scratchdimen
- \setbox\nextbox\normalhbox
- {\lower\nextboxdp\flushnextbox}%
- #1\nextbox#1\strutbox
- #2\nextbox\scratchdimen
- \flushnextbox
- \egroup}
- \normalhbox}
-
-%D \macros
-%D {lhbox,mhbox,rhbox}
-%D
-%D A few more boxes.
-
-\def\dodolhbox{\normalhbox to \hsize{\flushnextbox\hss }}
-\def\dodomhbox{\normalhbox to \hsize{\hss\flushnextbox\hss}}
-\def\dodorhbox{\normalhbox to \hsize{\hss\flushnextbox }}
-
-\def\lhbox{\dowithnextboxcs\dodolhbox\normalhbox}
-\def\mhbox{\dowithnextboxcs\dodomhbox\normalhbox}
-\def\rhbox{\dowithnextboxcs\dodorhbox\normalhbox}
-
-\let\lefthbox \lhbox
-\let\midhbox \mhbox
-\let\righthbox\rhbox
-
-%D \macros
-%D {boxofsize}
-%D
-%D Sometimes we need to construct a box with a height or
-%D width made up of several dimensions. Instead of cumbersome
-%D additions, we can use:
-%D
-%D \starttyping
-%D \boxofsize \normalvbox 10cm 3cm -5cm {the text to be typeset}
-%D \stoptyping
-%D
-%D This example demonstrates that one can use positive and
-%D negative values. Dimension registers are also accepted.
-
-\newdimen\sizeofbox
-
-\def\boxofsize#1%
- {\bgroup
- \sizeofbox\zeropoint
- \scratchdimen\zeropoint
- \def\docommand
- {\advance\sizeofbox\scratchdimen
- \futurelet\next\dodocommand}%
- \def\dodocommand
- {\ifx\next\bgroup
- \expanded{\egroup#1 to \the\sizeofbox}%
- \else
- \@EA\afterassignment\@EA\docommand\@EA\scratchdimen
- \fi}%
- \docommand}
-
-%D Some new, still undocumented features:
-
-% limitatetext -> beter {text} als laatste !!
-%
-% \limitvbox
-% \limithbox
-
-\def\limitatelines#1#2% size sentinel
- {\dowithnextbox
- {\dimen0=#1\hsize
- \ifdim\nextboxwd>\dimen0
- \setbox\nextbox\normalhbox
- {\advance\dimen0 -.1\hsize
- \limitatetext{\unhbox\nextbox}{\dimen0}{\nobreak#2}}%
- \fi
- \unhbox\nextbox}
- \normalhbox}
-
-\def\fittoptobaselinegrid % weg hier
- {\dowithnextbox
- {\bgroup
- \par
- \dimen0\nextboxht
- \nextboxht\strutht
- \nextboxdp\strutdp
- \normalhbox{\flushnextbox}
- \prevdepth\strutdp
- \doloop
- {\advance\dimen0 -\lineheight
- \ifdim\dimen0<\zeropoint
- \exitloop
- \else
- \nobreak
- \normalhbox{\strut}
- \fi}
- \egroup}
- \normalvbox}
-
-%D Some more undocumented macros (used in m-chart).
-
-\newif\iftraceboxplacement % \traceboxplacementtrue
-
-\newbox\fakedboxcursor
-
-\setbox\fakedboxcursor\normalhbox
- {\vrule\!!width\zeropoint\!!height\zeropoint\!!depth\zeropoint}
-
-\def\boxcursor % overloaded in core-vis
- {\iftraceboxplacement
- \bgroup
- \scratchdimen2pt
- \setbox\scratchbox\normalhbox to \zeropoint
- {\hss
- \vrule
- \!!width \scratchdimen
- \!!height\scratchdimen
- \!!depth \scratchdimen
- \hss}%
- \smashedbox\scratchbox
- \egroup
- \else
- \copy\fakedboxcursor
- \fi}
-
-\def\placedbox
- {\iftraceboxplacement\ruledhbox\else\normalhbox\fi}
-
-\newdimen\boxoffset
-\newdimen\boxhdisplacement
-\newdimen\boxvdisplacement
-
-%\def\rightbox#1%
-% {\normalhbox
-% {\setbox0=\placedbox{#1}%
-% \dimen0=.5\ht0\advance\dimen0 -.5\dp0
-% \boxcursor\hskip\boxoffset\lower\dimen0\box0}}
-
-\def\rightbox#1%
- {\normalhbox
- {\setbox0\placedbox{#1}%
- \global\boxhdisplacement\boxoffset
- \global\boxvdisplacement.5\ht0
- \global\advance\boxvdisplacement-.5\dp0
- \boxcursor\hskip\boxhdisplacement\lower\boxvdisplacement\box0}}
-
-%\def\leftbox#1%
-% {\normalhbox
-% {\setbox0=\placedbox{#1}%
-% \dimen0=.5\ht0\advance\dimen0 -.5\dp0
-% \boxcursor\hskip-\wd0\hskip-\boxoffset\lower\dimen0\box0}}
-
-\def\leftbox#1%
- {\normalhbox
- {\setbox0\placedbox{#1}%
- \global\boxhdisplacement-\wd0
- \global\advance\boxhdisplacement-\boxoffset
- \global\boxvdisplacement.5\ht0
- \global\advance\boxvdisplacement-.5\dp0
- \boxcursor\hskip\boxhdisplacement\lower\boxvdisplacement\box0}}
-
-%\def\topbox#1%
-% {\normalhbox
-% {\setbox0=\placedbox{#1}%
-% \dimen0=\boxoffset\advance\dimen0 \dp0
-% \boxcursor\hskip-.5\wd0\raise\dimen0\box0}}
-
-\def\topbox#1%
- {\normalhbox
- {\setbox0\placedbox{#1}%
- \global\boxhdisplacement-.5\wd0
- \global\boxvdisplacement-\dp0
- \global\advance\boxvdisplacement-\boxoffset
- \boxcursor\hskip\boxhdisplacement\raise-\boxvdisplacement\box0}}
-
-%\def\bottombox#1%
-% {\normalhbox
-% {\setbox0=\placedbox{#1}%
-% \dimen0=\boxoffset\advance\dimen0 \ht0
-% \boxcursor\hskip-.5\wd0\lower\dimen0\box0}}
-
-\def\bottombox#1%
- {\normalhbox
- {\setbox0\placedbox{#1}%
- \global\boxhdisplacement-.5\wd0
- \global\boxvdisplacement\ht0
- \global\advance\boxvdisplacement\boxoffset
- \boxcursor\hskip\boxhdisplacement\lower\boxvdisplacement\box0}}
-
-%\def\lefttopbox#1%
-% {\normalhbox
-% {\setbox0=\placedbox{#1}%
-% \dimen0=\boxoffset\advance\dimen0 \dp0
-% \advance\boxoffset\wd0
-% \boxcursor\hskip-\boxoffset\raise\dimen0\box0}}
-
-\def\lefttopbox#1%
- {\normalhbox
- {\setbox0\placedbox{#1}%
- \global\boxhdisplacement-\wd0
- \global\advance\boxhdisplacement-\boxoffset
- \global\boxvdisplacement-\dp0
- \global\advance\boxvdisplacement-\boxoffset
- \boxcursor\hskip\boxhdisplacement\raise-\boxvdisplacement\box0}}
-
-%\def\righttopbox#1%
-% {\normalhbox
-% {\setbox0=\placedbox{#1}%
-% \dimen0=\boxoffset\advance\dimen0 \dp0
-% \boxcursor\hskip\boxoffset\raise\dimen0\box0}}
-
-\def\righttopbox#1%
- {\normalhbox
- {\setbox0\placedbox{#1}%
- \global\boxhdisplacement\boxoffset
- \global\boxvdisplacement-\dp0
- \global\advance\boxvdisplacement-\boxoffset
- \boxcursor\hskip\boxhdisplacement\raise-\boxvdisplacement\box0}}
-
-%\def\leftbottombox#1%
-% {\normalhbox
-% {\setbox0=\placedbox{#1}%
-% \dimen0=\boxoffset\advance\dimen0 \ht0
-% \advance\boxoffset\wd0
-% \boxcursor\hskip-\boxoffset\lower\dimen0\box0}}
-
-\def\leftbottombox#1%
- {\normalhbox
- {\setbox0\placedbox{#1}%
- \global\boxhdisplacement-\wd0
- \global\advance\boxhdisplacement-\boxoffset
- \global\boxvdisplacement\ht0
- \global\advance\boxvdisplacement\boxoffset
- \boxcursor\hskip\boxhdisplacement\lower\boxvdisplacement\box0}}
-
-%\def\rightbottombox#1%
-% {\normalhbox
-% {\setbox0=\placedbox{#1}%
-% \dimen0=\boxoffset\advance\dimen0 \ht0
-% \boxcursor\hskip\boxoffset\lower\dimen0\box0}}
-
-\def\rightbottombox#1%
- {\normalhbox
- {\setbox0\placedbox{#1}%
- \global\boxhdisplacement\boxoffset
- \global\boxvdisplacement\ht0
- \global\advance\boxvdisplacement\boxoffset
- \boxcursor\hskip\boxhdisplacement\lower\boxvdisplacement\box0}}
-
-\let\topleftbox \lefttopbox
-\let\toprightbox \righttopbox
-\let\bottomleftbox \leftbottombox
-\let\bottomrightbox\rightbottombox
-
-\def\middlebox#1%
- {\normalhbox{\setbox0\placedbox{#1}\boxoffset=-.5\wd0\rightbox{\box0}}}
-
-\def\baselinemiddlebox#1%
- {\normalhbox
- {\setbox0\placedbox{#1}%
- \global\boxhdisplacement-.5\wd0
- \global\advance\boxhdisplacement-\boxoffset
- \global\boxvdisplacement-\boxoffset
- \boxcursor\hskip\boxhdisplacement\raise-\boxvdisplacement\box0}}
-
-\def\baselineleftbox#1%
- {\normalhbox
- {\setbox0\placedbox{#1}%
- \global\boxhdisplacement-\wd0
- \global\advance\boxhdisplacement-\boxoffset
- \global\boxvdisplacement-\boxoffset
- \boxcursor\hskip\boxhdisplacement\raise-\boxvdisplacement\box0}}
-
-\def\baselinerightbox#1%
- {\normalhbox
- {\setbox0\placedbox{#1}%
- \global\boxhdisplacement\boxoffset
- \global\boxvdisplacement-\boxoffset
- \boxcursor\hskip\boxhdisplacement\raise-\boxvdisplacement\box0}}
-
-%D \macros
-%D {obox}
-%D
-%D Experimental, not yet frozen:
-
-\def\lrtbbox#1#2#3#4% l r t b
- {\bgroup
- \dowithnextboxcontent
- {\advance\hsize-#1\advance\hsize-#2\advance\vsize-#3\advance\vsize-#4\relax}
- {\forgetall\vbox to \vsize{\vskip#3\hbox to \hsize{\hskip#1\box\nextbox\hss}\vss}\egroup}
- \vbox}
-
-%D \macros
-%D {toplinebox}
-%D
-%D See core-tbl.tex for an example of its usage:
-
-\def\toplinebox
- {\dowithnextbox
- {\ifdim\nextboxdp>\strutdepth
- \scratchdimen\nextboxdp
- \advance\scratchdimen-\strutdepth
- \getnoflines\scratchdimen
- \struttedbox{\flushnextbox}%
- \dorecurse\noflines\verticalstrut
- \else
- \flushnextbox
- \fi}%
- \tbox}
-
-%D \macros
-%D {initializeboxstack,savebox,foundbox}
-%D
-%D At the cost of some memory, but saving box registers, we
-%D have implemented a box repository.
-%D
-%D \starttyping
-%D \initializeboxstack{one}
-%D
-%D \savebox{one}{a}{test a}
-%D \savebox{one}{p}{test p}
-%D \savebox{one}{q}{test q}
-%D
-%D \normalhbox{a:\foundbox{one}{a}} \par
-%D \normalhbox{q:\foundbox{one}{q}} \par
-%D \normalhbox{p:\foundbox{one}{p}} \par
-%D \normalhbox{x:\foundbox{one}{x}} \par
-%D \normalhbox{y:\foundbox{two}{a}} \par
-%D \stoptyping
-
-% we keep it around as a demonstration of good old tex code:
-%
-% \def\@@stackbox{boxstack:b:}
-% \def\@@stackmax{boxstack:m:}
-% \def\@@stacktag{boxstack:t:}
-% \def\@@stacklst{boxstack:l:}
-%
-% \def\initializeboxstack#1%
-% {\ifundefined{\@@stackbox#1}%
-% \@EA\newbox\csname\@@stackbox#1\endcsname
-% \else
-% \global\setbox\csname\@@stackbox#1\endcsname\normalvbox{}%
-% \def\docommand##1{\global\letbeundefined{\@@stacktag#1:##1}}%
-% \processcommacommand[\getvalue{\@@stacklst#1}]\docommand
-% \fi
-% \global\letvalue{\@@stacklst#1}\empty
-% \global\letvalue{\@@stackmax#1}\!!zeropoint}
-%
-% \def\savebox#1#2% stack name
-% {\dowithnextbox
-% {\doifdefined{\@@stackbox#1}
-% {\@EA\doglobal\@EA\increment\csname\@@stackmax#1\endcsname
-% \setxvalue{\@@stacktag#1:#2}{\csname\@@stackmax#1\endcsname}%
-% \setxvalue{\@@stacklst#1}{\getvalue{\@@stacklst#1},#2}%
-% \global\setbox\csname\@@stackbox#1\endcsname\normalvbox
-% {\forgetall
-% \setbox\scratchbox\normalvbox{\flushnextbox}
-% \ht\scratchbox\onepoint
-% \dp\scratchbox\zeropoint
-% \unvbox\csname\@@stackbox#1\endcsname
-% \offinterlineskip
-% \allowbreak
-% \box\scratchbox}}}%
-% \normalvbox}
-%
-% \def\foundbox#1#2%
-% {\normalvbox
-% {\doifdefined{\@@stackbox#1}
-% {\doifdefined{\@@stacktag#1:#2}
-% {\setbox\scratchbox\normalvbox
-% {\splittopskip\zeropoint
-% \setbox0\copy\csname\@@stackbox#1\endcsname
-% \dimen0=\getvalue{\@@stacktag#1:#2}\points
-% \advance\dimen0 -\onepoint
-% \setbox2\vsplit0 to \dimen0
-% \ifdim\ht0>\onepoint
-% \setbox0\vsplit0 to \onepoint
-% \fi
-% \unvbox0\setbox0\lastbox\unvbox0}%
-% \unvbox\scratchbox}}}}
-%
-% \def\doifboxelse#1#2%
-% {\doifdefinedelse{\@@stacktag#1:#2}}
-
-\def\@@stackbox{@box@}
-\def\@@stacklst{@xob@}
-
-\def\setstackbox#1#2%
- {\ifcsname\@@stackbox:#1:#2\endcsname\else
- \expandafter\newbox\csname\@@stackbox:#1:#2\endcsname
- \fi
- \global\setbox\csname\@@stackbox:#1:#2\endcsname\normalvbox}
-
-\def\initializeboxstack#1%
- {\def\docommand##1{\setstackbox{#1}{##1}{}}%
- \ifcsname\@@stacklst#1\endcsname
- \processcommacommand[\getvalue{\@@stacklst#1}]\docommand
- \fi
- \global\letvalue{\@@stacklst#1}\empty}
-
-\def\savebox#1#2% stack name
- {% beware, \setxvalue defines the cs beforehand so we cannot use the
- % test inside the { }
- \ifcsname\@@stacklst#1\endcsname
- \setxvalue{\@@stacklst#1}{\csname\@@stacklst#1\endcsname,#2}%
- \else
- \setxvalue{\@@stacklst#1}{#2}%
- \fi
- \setstackbox{#1}{#2}}
-
-\def\foundbox#1#2%
- {\normalvbox
- {\ifcsname\@@stackbox:#1:#2\endcsname
- \copy\csname\@@stackbox:#1:#2\endcsname
- \fi}}
-
-\long\def\doifboxelse#1#2#3#4%
- {\ifcsname\@@stackbox:#1:#2\endcsname
- \ifvoid\csname\@@stackbox:#1:#2\endcsname#4\else#3\fi
- \else
- #4%
- \fi}
-
-%D \macros
-%D {removedepth, obeydepth}
-%D
-%D While \type {\removedepth} removes the preceding depth,
-%D \type {\obeydepth} makes sure we have depth. Both macros
-%D leave the \type {\prevdepth} untouched.
-
-\def\removedepth
- {\ifvmode \ifdim\prevdepth>\zeropoint \kern-\prevdepth \fi \fi}
-
-\def\obeydepth
- {\par \removedepth \ifvmode \kern\strutdp \fi}
-
-\def\undepthed
- {\dowithnextbox{\nextboxdp\zeropoint\flushnextbox}\hbox}
-
-%D \macros
-%D {removebottomthings, removelastskip}
-%D
-%D A funny (but rather stupid) one, plus a redefinition.
-
-\def\removebottomthings
- {\dorecurse5{\unskip\unkern\unpenalty}}
-
-\def\removelastskip % \ifvmode the plain tex one \fi
-% {\ifvmode\ifdim\lastskip=\zeropoint\else\vskip-\lastskip\fi\fi}
- {\ifvmode\ifzeropt\lastskip\else\vskip-\lastskip\fi\fi}
-
-%D \macros
-%D {makestrutofbox}
-%D
-%D This macro sets the dimensions of a box to those of a
-%D strut.
-
-\def\domakestrutofbox
- {\ht\registercount\strutht
- \dp\registercount\strutdp
- \wd\registercount\zeropoint}
-
-\def\makestrutofbox
- {\afterassignment\domakestrutofbox\registercount}
-
-%D \macros
-%D {raisebox,lowerbox}
-%D
-%D Some more box stuff, related to positioning (under
-%D construction). Nice stuff for a tips and tricks maps
-%D article.
-%D
-%D \starttyping
-%D \raisebox{100pt}\normalhbox{test}
-%D \raisebox50pt\normalhbox{test}
-%D \hsmash{\raisebox{100pt}\normalhbox{test}}
-%D \stoptyping
-
-\def\doraiselowerbox#1#2% a nice trick us used to accept
- {\def\next % both direct and {} dimensions
- {\dowithnextbox
- {\setbox\nextbox\normalhbox{#1\scratchdimen\flushnextbox}%
- \nextboxht\strutht
- \nextboxdp\strutdp
- \flushnextbox}}%
- \afterassignment\next\scratchdimen=#2}
-
-\def\raisebox{\doraiselowerbox\raise}
-\def\lowerbox{\doraiselowerbox\lower}
-
-% maybe some day we need this
-%
-% \def\appendvbox#1% % uses \box8
-% {\bgroup
-% \ifdim\prevdepth<\zeropoint
-% \ifdim\pagetotal=\zeropoint
-% \setbox8=\normalvtop{\unvcopy#1}%
-% \hrule\c!!height\zeropoint
-% \kern-\ht8
-% \box#1\relax
-% \else
-% \box#1\relax
-% \fi
-% \else
-% \dimen0=\prevdepth
-% \hrule\c!!height\zeropoint
-% \setbox8=\normalvtop{\unvcopy#1}%
-% \dimen2=\baselineskip
-% \advance\dimen2 by -\dimen0
-% \advance\dimen2 by -\ht8
-% \kern\dimen2
-% \box#1\relax
-% \fi
-% \egroup}
-
-% %D Also new:
-% %D
-% %D \startbuffer
-% %D \normbox[1cm][bba]{m} % b(efore) a(fter) v(box) s(trut) f(rame)
-% %D \normbox[1cm][bba]{m}
-% %D \normbox[1cm][bba]{m}
-% %D \stopbuffer
-% %D
-% %D \typebuffer
-% %D \getbuffer
-%
-% \def\dodonormbox#1#2#3#4#5#6#7%
-% {\doifnumberelse{#1}
-% {\dimen0=#1}{\setbox0=#3{#1}\dimen0=#50}%
-% \doifinstringelse{f}{#2}
-% {\let\next#4}{\let\next#3}%
-% \next to \dimen0
-% {\counttoken b\in#2\to\!!counta\dorecurse{\!!counta}{#6}#6%
-% #7\nextbox
-% \counttoken a\in#2\to\!!counta\dorecurse{\!!counta}{#6}#6}}
-%
-% \def\donormbox[#1][#2]%
-% {\bgroup
-% \doifinstringelse{v}{#2}
-% {\let\next\normalvbox}
-% {\let\next\normalhbox}%
-% \dowithnextbox
-% {\ifvbox\nextbox
-% \let\\=\par
-% \dodonormbox{#1}{#2}\normalvbox\ruledvbox\ht\vfil\unvbox
-% \else
-% \let\\=\space
-% \dodonormbox{#1}{#2}\normalhbox\ruledhbox\wd\hfil\unhbox
-% \fi
-% \egroup}%
-% \next}
-%
-% \def\normbox
-% {\dodoubleempty\donormbox}
-
-% vcenter in text, we kunnen vcenter overloaden
-
-\def\halfwaybox
- {\dowithnextbox
- {\nextboxdp\zeropoint
- \setbox\nextbox\normalhbox{\lower.5\nextboxht\flushnextbox}%
- \flushnextbox}
- \normalhbox}
-
-%D New:
-
-\def\setdimentoatleast#1#2%
- {\ifdim#1>\zeropoint\else#1=#2\fi}
-
-%D And even rawer:
-
-\let\naturalhbox \normalhbox
-\let\naturalvbox \normalvbox
-\let\naturalvtop \normalvtop
-\let\naturalvcenter \normalvtop
-
-\ifdefined\textdir
-
- \def\naturalhbox{\normalhbox dir TLT}
- \def\naturalvbox{\normalvbox dir TLT}
- %def\naturalvtop{\normalvtop dir TLT}
-
-\fi
-
-%D \macros
-%D {vcenter}
-%D
-%D Also new: tex mode \type {\vcenter}.
-
-\let\verynormalvcenter \vcenter % since \vcenter can be visualized
-
-\def\vcenter
- {\normalvbox\bgroup
- \dowithnextbox{\normalhbox{$\verynormalvcenter{\flushnextbox}$}\egroup}
- \normalvbox}
-
-% could be \everymathematics
-
-\prependtoks \let\vcenter\normalvcenter \to \everymath
-\prependtoks \let\vcenter\normalvcenter \to \everydisplay
-
-%D \macros
-%D {frozenhbox}
-%D
-%D A not so well unhboxable bxo can be made with:
-
-\def\frozenhbox
- {\hbox\bgroup\dowithnextbox{\hbox{\hbox{\flushnextbox}}\egroup}\hbox}
-
-%D \macros
-%D {setboxllx,setboxlly,gsetboxllx,gsetboxlly,getboxllx,getboxlly}
-%D
-%D A prelude to an extended \TEX:
-
-% \def\setboxllx #1#2{\bgroup\scratchdimen#2\expanded{\egroup\noexpand\setevalue{b@@x\number#1}{\the\scratchdimen}}}
-% \def\setboxlly #1#2{\bgroup\scratchdimen#2\expanded{\egroup\noexpand\setevalue{b@@y\number#1}{\the\scratchdimen}}}
-%
-% \def\gsetboxllx#1#2{\bgroup\scratchdimen#2\setxvalue{b@@x\number#1}{\the\scratchdimen}\egroup}
-% \def\gsetboxlly#1#2{\bgroup\scratchdimen#2\setxvalue{b@@y\number#1}{\the\scratchdimen}\egroup}
-
-\def\setboxllx#1#2{\setevalue{b@@x\number#1}{\the\dimexpr#2\relax}}
-\def\setboxlly#1#2{\setevalue{b@@y\number#1}{\the\dimexpr#2\relax}}
-
-\def\gsetboxllx{\global\setboxllx}
-\def\gsetboxlly{\global\setboxlly}
-
-\def\getboxllx#1{\executeifdefined{b@@x\number#1}\zeropoint}
-\def\getboxlly#1{\executeifdefined{b@@y\number#1}\zeropoint}
-
-%D \macros
-%D {shownextbox}
-%D
-%D Handy for tracing
-%D
-%D \starttyping
-%D \shownextbox\vbox{test}
-%D \shownextbox\vbox{test\endgraf}
-%D \shownextbox\vbox{test\endgraf\strut\endgraf}
-%D \shownextbox\vbox{test\endgraf\thinrule}
-%D \shownextbox\vbox{\setupwhitespace[big]test\endgraf\thinrule}
-%D \stoptyping
-
-\def\shownextbox
- {\dowithnextbox
- {\bgroup
- \showboxbreadth\maxdimen
- \showboxdepth \maxdimen
- \scratchcounter\interactionmode
- \batchmode
- \showbox\nextbox
- \box\nextbox
- \interactionmode\scratchcounter
- \egroup}}
-
-\def\spreadhbox#1% rebuilds \hbox{<box><hss><box><hss><box>}
- {\bgroup
- \ifhbox#1\relax
- \setbox2\emptybox
- \unhbox#1%
- \doloop
- {\unpenalty\unskip\unpenalty\unskip\unpenalty\unskip
- \setbox0\lastbox
- \ifvoid0
- \exitloop
- \else
- \setbox2\hbox
- {\ifhbox0 \spreadhbox0\else\box0\fi
- \ifvoid2 \else\hss\unhbox2\fi}%
- \fi}%
- \ifvoid2\else\unhbox2\fi
- \else
- \box#1%
- \fi
- \egroup}
-
-% makes sense but too much log for overfull boxes:
-%
-% \showboxbreadth\maxdimen
-% \showboxdepth \maxdimen
-
-\protect \endinput
-
-% a bit of test code:
-
-\hbox \bgroup
- \ruledvbox {\hbox{\strut gans}}
- \ruledvbox to \lineheight {\hbox{\strut gans}}
- \ruledvbox to \lineheight {\hbox {gans}}
- \ruledvbox to \strutheight{\hbox {gans}}
- \ruledvbox to \strutheight{\hbox{\strut gans}}
- \ruledvbox to \strutheight{\vss\hbox{gans}}
-\egroup
diff --git a/Master/texmf-dist/tex/context/base/mkii/supp-dir.mkii b/Master/texmf-dist/tex/context/base/mkii/supp-dir.mkii
deleted file mode 100644
index f4f2949035b..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/supp-dir.mkii
+++ /dev/null
@@ -1,41 +0,0 @@
-%D \module
-%D [ file=supp-dir,
-%D version=2004.11.11,
-%D title=\CONTEXT\ Support Macros,
-%D subtitle=Directional Things,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Inspired by and needed for Adam Lindsay's \XETEX\ efforts:
-%D
-%D \starttyping
-%D \starttext
-%D \input tufte \par
-%D \pardir TRT \input tufte \par \input tufte \par
-%D \pardir TLT \input tufte \par
-%D \stoptext
-%D \stoptyping
-
-\unprotect
-
-\chardef\inlinedirection\zerocount % 0==notset 1==LR 2==RL
-
-\def\pardir#1#2#3% messages end up in a higher level command
- {\global\TeXXeTstate\plusone
- \if#2L\chardef\inlinedirection\plusone\else
- \if#2R\chardef\inlinedirection\plustwo\fi\fi
- \checkinlinedirection} % needed / added
-
-\def\checkinlinedirection
- {\ifcase\inlinedirection\or\beginL\or\beginR\fi}
-
-% see core-ini.tex
-%
-% \appendtoks \checkinlinedirection \to \everypar
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/supp-emp.mkii b/Master/texmf-dist/tex/context/base/mkii/supp-emp.mkii
deleted file mode 100644
index ba9e09e3a4c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/supp-emp.mkii
+++ /dev/null
@@ -1,398 +0,0 @@
-%D \module
-%D [ file=supp-emp,
-%D version=2000.08.09,
-%D title=\CONTEXT\ Support Macros,
-%D subtitle=\EMTEX\ specials to \PDF\ conversion,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-%M \input supp-emp
-
-%D When \THANH, the author of \PDFTEX, and I were exchanging
-%D some emails on \PDFTEX\ functionality, positional
-%D information popped up as potential extension. Actually, it
-%D did not take that much time to cook up the basic
-%D functionality and the author had implemented it before I
-%D could even start to think about real advanced applications.
-%D
-%D I'm sure that \TEX\ programmers can spend many days on how
-%D and what kind of information is needed if you want to have
-%D access to positions, but since high level macros will
-%D probably be used anyway, even things like multiple reference
-%D points have proved to be rather unimportant at the system
-%D level.
-%D
-%D Therefore, \PDFTEX\ provides just these three primitives:
-%D
-%D \starttabulate[|l|l|]
-%D \NC \type {\pdfsavepos} \NC marks the current position \NC \NR
-%D \NC \type {\pdflastxpos} \NC the last marked horizontal position \NC \NR
-%D \NC \type {\pdflastypos} \NC the last marked vertical position \NC \NR
-%D \stoptabulate
-%D
-%D Based on these three primitives, very advanced systems can
-%D be build, and for some time now, \CONTEXT\ has such a
-%D system in its core. However, not everyone uses \CONTEXT, so
-%D we will demonstrate position tracking in generic applications.
-%D
-%D Because \PDFTEX\ produces its output directly, many of those
-%D nice tricks provided by back||ends by means of \type
-%D {\special} fail when producing \PDF\ code directly. Take for
-%D instance \EMTEX\ specials. When someone sent me a mail
-%D asking if \PDFTEX\ did support those specials, the original
-%D answer was \quotation {no}, but in the last few years I have learned
-%D that you must never underestimate \TEX's capabilities.
-%D
-%D I must admit that I never use those specials myself, but
-%D from the way they were used in the macros I was sent, I
-%D learned that they depend on the back||end's capability to
-%D access the current position. For those who know \TEX\ this
-%D may be bad news, since pure \TEX\ does not provide any
-%D positional information. So in order to use those specials,
-%D you must be sure that they are supported by every driver you
-%D use. However, the good news is that \PDFTEX\ does support
-%D position tracking, so here is our generic example.
-%D
-%D The two \EMTEX\ specials we need to implement are packaged
-%D into the macros \type {\EMmoveto} and \type {\EMlineto},
-%D like:
-%D
-%D \starttyping
-%D \def\EMmoveto{\special{em:moveto}}
-%D \def\EMlineto{\special{em:lineto}}
-%D \stoptyping
-%D
-%D They are used in macro packages to draw lines, and the
-%D results are often boxes with content like the following:
-%D
-%D \startbuffer
-%D \vbox to 2cm
-%D {\offinterlineskip \EMmoveto
-%D \hskip 7cm \EMlineto
-%D \vskip 2cm \EMlineto
-%D \vskip-2cm \EMlineto}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D This box will contain a triangle, and when typeset, it should
-%D look like:
-%D
-%D \startlinecorrection[blank]
-%D \getbuffer
-%D \stoplinecorrection
-
-\def\EMlinewd{.4}
-
-\ifx\dosetpositionpt\undefined % non context part
-
-%D These two macros can be implemented as follows. When moving
-%D to a position, we only have to register the new coordinates.
-%D Once they are known, we use them to draw a line and
-%D afterwards we save these end coordinates as starting point
-%D for the next line segment. So, at each point specified by
-%D \type {\EMlineto} we need to know the coordinates.
-
-\def\EMmoveto
- {\EMgetposition\EMlastmovex\EMlastmovey}
-
-%D The primitives \type {\pdflastxpos} and \type
-%D {\pdflastypos} return a number, representing the $x$ and
-%D $y$ coordinate in scaled points, \TEX's smallest unit of
-%D length. We need to convert this number into base points as
-%D used by \POSTSCRIPT\ and \PDF. When done, we insert some
-%D literal \PDF\ code into the text using \type {\pdfliteral}.
-%D Here, the \type {m} means \quote {moveto}, the \type {l}
-%D means \quote {lineto} and the \type {S} operator \quote
-%D {strokes} (draws) the line. The macro \type {\EMlinewd}
-%D holds the linewidth in basepoints.
-
-\def\EMlineto
- {\bgroup
- \EMgetposition\EMlastlinex\EMlastliney
- \count0=\EMlastmovex \advance\count0 -\EMlastlinex
- \count2=\EMlastmovey \advance\count2 -\EMlastliney
- \divide\count0 65536
- \divide\count2 65536
- \PDFcode{\EMlinewd\space w 0 0 m \the\count0 \space\the\count2 \space l S}%
- \global\let\EMlastmovex\EMlastlinex
- \global\let\EMlastmovey\EMlastliney
- \egroup}
-
-%D We need a fresh start, so we first set the current position
-%D to zero.
-
-\def\resetEMspecials
- {\gdef\EMlastmovex{0}\gdef\EMlastmovey{0}}
-
-%D Next comes the macro that keeps track of the position. The
-%D current position is marked with \type {\pdfsavepos} and its
-%D coordinates are written to a file whenever the page is
-%D shipped out, since \type {\write} postpones its action
-%D until that moment. The file has entries like:
-%D
-%D \starttyping
-%D \EMsetpos 1 4661756 46651918
-%D \EMsetpos 2 5000359 46990521
-%D \EMsetpos 3 4661756 46313315
-%D \EMsetpos 4 5338962 46990521
-%D \EMsetpos 5 4661756 45974712
-%D \stoptyping
-%D
-%D These lines are written with the command:
-%D
-%D \starttyping
-%D \write\EMfile
-%D {\EMsetpos\number\EMcounter
-%D \space\number\pdflastxpos\space\number\pdflastypos}%
-%D \stoptyping
-%D
-%D In reality the argument to \type {\write} looks slightly
-%D more complicated, because we have to make sure that the
-%D number of the current position is frozen and \type
-%D {\EMsetpos} is not expanded. We do so by explicitly
-%D expanding the number beforehand and preventing expansion of
-%D \type {\EMsetpos}.
-
-\def\EMgetposition#1#2%
- {\bgroup
- \pdfsavepos
- \global\advance\EMcounter 1
- \expandafter\write\expandafter\EMfile\expandafter
- {\expandafter\noexpand\expandafter\EMsetpos\number\EMcounter
- \space\number\pdflastxpos\space\number\pdflastypos}%
- \EMsetcounters
- \xdef#1{\the\count0}%
- \xdef#2{\the\count2}%
- \egroup}
-
-%D The counter mentioned a few lines ago needs to be
-%D declared before it can be used.
-
-\newcount\EMcounter
-
-%D We also need a dedicated file slot.
-
-\newwrite\EMfile
-
-%D Before we open the file for writing, we read in the data
-%D written in the previous pass, but only if the file is
-%D present.
-
-\def\EMfilename{\jobname.emp}
-
-\def\startEMspecials%
- {\resetEMspecials
- \openin\scratchread=\EMfilename \relax
- \ifeof\scratchread\else \input \EMfilename \relax \fi
- \closein\scratchread
- \immediate\openout\EMfile=\EMfilename\relax}
-
-\def\stopEMspecials
- {\closeout\EMfile}
-
-%D Just to be sure, we test if \type {\scratchread} is defined,
-%D and if not, we allocate a slot.
-
-\ifx\undefined\scratchread \newread\scratchread \fi
-
-%D This leaves us two commands. The \type {\EMsetpos} command
-%D that ends up in the file stores each position in a macro.
-%D When this macro is expanded, it assigns the coordinates to
-%D two scratch counters.
-
-\def\EMsetpos#1 #2 #3 % number x y
- {\expandafter\xdef\csname EM:#1\endcsname{\count0=#2 \count2=#3}}
-
-%D This position is recalled with its companion macro. First we
-%D set the counters to zero. When the position is unknown,
-%D nothing happens since the \type {\csname...} will expand to
-%D \type {\relax}.
-
-\def\EMsetcounters
- {\count0=0 \count2=0
- \csname EM:\the\EMcounter\endcsname}
-
-%D These macros are rather independent of the macro package you
-%D use. For instance, in \CONTEXT\ the following works well:
-%D
-%D \startbuffer[pos-en]
-%D \setuppositioning[unit=ex]
-%D \startpositioning
-%D \dostepwiserecurse{-10}{10}{1}
-%D {\position(0,\recurselevel){\EMmoveto}
-%D \position(\recurselevel,0){\EMlineto}}
-%D \stoppositioning
-%D \stopbuffer
-%D
-%D \startbuffer[pos-nl]
-%D \setuppositioning[uniteenheid=ex]
-%D \startpositioning
-%D \dostepwiserecurse{-10}{10}{1}
-%D {\position(0,\recurselevel){\EMmoveto}
-%D \position(\recurselevel,0){\EMlineto}}
-%D \stoppositioning
-%D \stopbuffer
-%D
-%D \typebuffer[pos-en]
-%D
-%D Here, we hook the \EMTEX\ macros into an existing text
-%D positioning mechanism, which positions the commands
-%D using \TEX's skips and kerns.
-%D
-%D \startlinecorrection[blank]
-%D \getbuffer[pos-nl]
-%D \stoplinecorrection
-%D
-%D Of course one should start and end the file with:
-%D
-%D \starttyping
-%D \startEMspecials
-%D \stopEMspecials
-%D \stoptyping
-%D
-%D and, if needed, reset the begin position at each page using:
-%D
-%D \starttyping
-%D \resetEMspecials
-%D \stoptyping
-
-\fi % end of non context part
-
-\ifx\dosetpositionpt\undefined \else % context part
-
-% \edef\EMlinewd{\withoutpt\the\linewidth}
-
-%D A few pages ago, we mentioned that \CONTEXT\ has built||in
-%D position tracking. This means that when we want to implement
-%D this kind of trickery in this macro package, we can fall
-%D back on existing functionality. In the following alternative
-%D we will also use a few skips. This keeps the source readable
-%D and \CONTEXT\ has plenty of unused registers to accomodate
-%D this strategy.
-
-\newcount\EMcounter \def\EMvariable{EM:\the\EMcounter}
-
-\newskip \EMlastmovex \newskip \EMlastmovey
-\newskip \EMlastlinex \newskip \EMlastliney
-
-\def\resetEMspecials
- {\global\EMlastmovex=0pt \global\EMlastmovey=\EMlastmovex}
-
-\resetEMspecials \appendtoks\resetEMspecials\to\everyshipout
-
-%D Watch how we reset the specials after a page is flushed. We
-%D don't have to bother about files here, because saving and
-%D recalling is already implemented. Although not needed, we
-%D define the start||stop macros, so that \CONTEXT\ users who
-%D key them in are not confronted with error messages.
-
-\let\startEMspecials\relax \let\stopEMspecials\relax
-
-\def\EMgetposition#1#2%
- {\global\advance\EMcounter 1
- \setposition\EMvariable
- \global#1=\POSx\EMvariable
- \global#2=\POSy\EMvariable}
-
-\def\EMmoveto
- {\EMgetposition\EMlastmovex\EMlastmovey}
-
-\def\EMlineto
- {\EMgetposition\EMlastlinex\EMlastliney
- \global\advance\EMlastmovex -\EMlastlinex
- \global\advance\EMlastmovey -\EMlastliney
- \ScaledPointsToBigPoints{\number\EMlastmovex}\EMx
- \ScaledPointsToBigPoints{\number\EMlastmovey}\EMy
- \PDFcode{\EMlinewd\space w 0 0 m \EMx \space \EMy \space l S}%
- \global\EMlastmovex\EMlastlinex
- \global\EMlastmovey\EMlastliney}
-
-%D The command \type {\setposition} registers a position by
-%D name (here \type {\EMvariable}), while \type {\POSx} and
-%D \type {\POSy} give you access to the coordinates.
-%D
-%D These three commands are containes in a suite of low level
-%D commands that can be used to register and get access to
-%D positional information. The current mechanism is not yet
-%D complete, but already provides enough hooks for advanced
-%D embedded graphics. Its functionality is a natural extension
-%D to the \METAPOST\ support already present in \CONTEXT.
-%D Therefore, more advanced examples can be found in the
-%D \METAFUN\ manual, since they fall beyond the scope of this
-%D module.
-
-\fi % end of context part
-
-%D As a bonus, I will now provide a few macros that will make
-%D this mechanism transparant to \DVI\ as well as \PDF\
-%D output. We will use \type {\pdfiteral} as trigger.
-
-\ifx\PDFcode\undefined
- \ifx\pdfliteral\undefined
- \def\PDFcode#1{\special{PDF: #1}}
- \else
- \let\PDFcode\pdfliteral
- \fi
-\fi
-
-\ifx\PDFcode\undefined
- \def\EMpdfordvi#1#2{#2}
-\else\ifx\pdfoutput\undefined
- \def\EMpdfordvi#1#2{#2}
-\else
- \def\EMpdfordvi#1#2{\ifcase\pdfoutput#2\else#1\fi}
-\fi\fi
-
-
-%D We save some of the macros we defined previously:
-
-\let\pdfEMmoveto\EMmoveto \let\pdfstartEMspecials\startEMspecials
-\let\pdfEMlineto\EMlineto \let\pdfstopEMspecials \stopEMspecials
-
-%D We now redefine them to support \DVI\ and \PDF.
-
-\def\EMmoveto{\EMpdfordvi\pdfEMmoveto{\special{em:moveto}}}
-\def\EMlineto{\EMpdfordvi\pdfEMlineto{\special{em:lineto}}}
-
-\def\startEMspecials{\EMpdfordvi\pdfstartEMspecials\relax}
-\def\stopEMspecials {\EMpdfordvi\pdfstopEMspecials \relax}
-
-%D If there is any real demand for this in \CONTEXT, I will
-%D hook these macros in the special drivers, so that their
-%D support becomes more natural.
-
-%D You may want to change the default linewidth. The following
-%D macro does the job. Beware of the fact that \type
-%D {\special}'s may interfere with the typesetting process.
-%D
-%D \starttyping
-%D \setEMlinewidth{1pt}
-%D \stoptyping
-
-\def\setEMlinewidth#1% this could be done more efficient for
- {\bgroup % context alone, but it's a hack anyway
- \dimen0=#1\relax
- \count0=\dimen0
- \divide\count0 65536
- \pdfordvi\relax{\special{em:linewidth \the\dimen0}}%
- \xdef\EMlinewd{\the\count0}%
- \egroup}
-
-%D You may wonder to what extent positional tracking is
-%D \PDFTEX\ specific. In \CONTEXT, we also support position
-%D tracking in \DVI\ by using specials and analyzing the \DVI\
-%D file afterwards using \DVIPOS. Since many of the advanced
-%D \TEX\ features depend on some kind of back||end, we don't
-%D consider it to be a disadvantage. Of course, the \PDFTEX\
-%D way is not only cleaner, but also faster. It was more out
-%D of curiosity than out of need that we provided the \DVI\
-%D methods as well. Also, it is always good to have more roads
-%D to reach the same goal.
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/supp-eps.mkii b/Master/texmf-dist/tex/context/base/mkii/supp-eps.mkii
deleted file mode 100644
index fb99469c5d6..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/supp-eps.mkii
+++ /dev/null
@@ -1,202 +0,0 @@
-%D \module
-%D [ file=supp-eps,
-%D version=1998.05.06,
-%D title=\CONTEXT\ Support Macros,
-%D subtitle=\EPS\ tools,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 \undefined \writestatus \input supp-mis.tex \relax \fi
-
-%D The macros in this module are rather old and were originally
-%D part of the figure inclusion macros. When \PDFTEX\ started
-%D to support \PDF\ inclusion, where some accompanying macros
-%D were put in \type{supp-pdf}, I considered it more suitable
-%D to give the \EPS\ macros their own module.
-
-\writestatus{loading}{ConTeXt Support Macros / EPS}
-
-%D \macros
-%D {dogetEPSboundingbox}
-%D
-%D The predecessors of the following macro's are derived from
-%D Thomas Rockicky's macro's. They are rewritten to a more
-%D compact form, made a bit more robust and also handle the
-%D \type{HiResBoundingBox} and \type{ExactBoundingBox} that
-%D are sometimes present.
-%D
-%D A bounding box has the form:
-%D
-%D \starttyping
-%D %%BoundingBox: llx lly urx ury
-%D \stoptyping
-%D
-%D Before we scan the file, we have to reset special
-%D characters and set some others. The percentage symbol also
-%D needs special treatment. When a bounding box is
-%D encountered, we keep on scanning until no more directives
-%D are found, i.e. a line is found that does not start with a
-%D percentage symbol. We also abort scanning after finding a
-%D high resolution bounding box.
-%D
-%D This method also works inside verbatim mode (like when we
-%D are typesetting sources and putting eps coded logos into
-%D a heading. Temporary restoring the \CATCODES\ is done in
-%D the calling routine.
-%D
-%D The creator as well as external support for specials are
-%D analyzed as well and their status is available in \type
-%D {\EPScreator} and \type {\EPSshading}. The boundingbox
-%D components are available in \type {\EPSllx} etc.
-
-\unprotect
-
-\def\EPSllx{0} \let\MPllx\EPSllx % just in case these
-\def\EPSlly{0} \let\MPlly\EPSlly % are used while running
-\def\EPSurx{0} \let\MPurx\EPSurx % in fast mode we set
-\def\EPSury{0} \let\MPury\EPSury % them to 0.
-
-\chardef\EPSfound =0
-\chardef\EPScreator=0
-\chardef\EPSspecial=0
-\chardef\EPSstatus =0
-
-\let\EPScreatorstring\empty
-
-\newtoks\extraEPSpreambleresets
-\newtoks\extraEPSpreambleparsers
-
-\def\dofinishEPSfile{\dofinishfile} % no \let, can be overloaded
-
-\def\dogetEPSboundingbox#1#2#3#4#5%
- {\bgroup
- \global\chardef\EPSfound \zerocount
- \global\chardef\EPScreator\zerocount
- \global\chardef\EPSspecial\zerocount
- \global\chardef\EPSstatus \zerocount
- \global\let\EPScreatorstring\empty
- \the\extraEPSpreambleresets
- \uncatcodespecials
- \catcode`\^^M=\@@ignore
- \def\doprocessEPSline
- {\advance\scratchcounter\plusone
- \expandafter\checkEPSboundingbox\fileline\empty\empty:.:.\end}%
- \scratchcounter\zerocount
- \doprocessfile\scratchread{#1}\doprocessEPSline
- \egroup
- % Using \EPSllx bp instead of \dimen0=1bp and \EPSllx\dimen0 is more accurate (.005pt).
- \ifnum\EPSfound>\zerocount
- #2\dimexpr\EPSllx\onebasepoint \relax
- #3\dimexpr\EPSlly\onebasepoint \relax
- #4\dimexpr\EPSurx\onebasepoint-#2\relax
- #5\dimexpr\EPSury\onebasepoint-#3\relax
- \else
- #2\zeropoint
- #3\zeropoint
- #4\zeropoint
- #5\zeropoint
- \fi
- %\message{[bbox #1: \EPSllx\space\EPSurx\space\EPSlly\space\EPSury]}\wait
- \global\let\MPllx\EPSllx \global\let\MPlly\EPSlly
- \global\let\MPurx\EPSurx \global\let\MPury\EPSury}
-
-\bgroup \catcode`\%=\@@other \xdef\letterpercent{\string%} \egroup
-
-\def\EPSboundingboxtag {BoundingBox}
-\def\EPShiresboundingboxtag{HiResBoundingBox}
-\def\EPSexactboundingboxtag{ExactBoundingBox}
-\def\EPScreatortag {Creator}
-\def\EPSmetaposttag {MetaPost}
-\def\EPSmetapostspecialtag {MetaPostSpecial}
-\def\EPSmetapostspecialstag{MetaPostSpecials}
-\def\EPSpagetag {Page}
-
-\let\EPSspecialstring \empty
-\let\EPSspecialcontent\empty
-
-% new metapost construct (hires bb followed by creator + version)
-%
-%!PS
-%%BoundingBox: -71 -1 651 496
-%%HiResBoundingBox: -70.9945 -0.5 650.5 495.24907
-%%Creator: MetaPost 0.901
-%%CreationDate: 2005.06.02:1633
-%%Pages: 1
-
-\long\def\checkEPSboundingbox#1#2#3:#4:.#5\end
- {\if\string#1\letterpercent
- \if\string#2\letterpercent
- \edef\EPSspecialstring{#3}%
- \edef\EPSspecialcontent{#4}%
- \ifx\EPSspecialstring\EPScreatortag
- \getEPScreatorspec
- \else\ifx\EPSspecialstring\EPSboundingboxtag
- \getEPSboundingboxspec
- \global\chardef\EPSfound\plusone
- \else\ifx\EPSspecialstring\EPShiresboundingboxtag
- \getEPSboundingboxspec
- \global\chardef\EPSfound\plustwo
- \scratchcounter\zerocount
- \else\ifx\EPSspecialstring\EPSexactboundingboxtag
- \getEPSboundingboxspec
- \global\chardef\EPSfound\plustwo
- \scratchcounter\zerocount
- \else\ifx\EPSspecialstring\EPSmetapostspecialtag % only before finish!
- \global\chardef\EPSspecial\plusone % ah, we've met some MP extensions
- \else\ifx\EPSspecialstring\EPSmetapostspecialstag % only before finish!
- \global\chardef\EPSspecial\plusone % ah, we've met some MP extensions
- \else\ifx\EPSspecialstring\EPSpagetag
- \global\chardef\EPSstatus \plusone % we passed MP font defs
- \else
- \the\extraEPSpreambleparsers
- \fi\fi\fi\fi\fi\fi\fi
- \fi
- \else\ifnum\EPSfound>\zerocount
- % bb found
- \ifnum\EPScreator=\plusone % that is, we are dealing with MP output
- \ifcase\EPSstatus
- % we've run into MP fontdefs
- \or
- \dofinishEPSfile
- \fi
- \else\ifnum\scratchcounter>\plusthree
- % too late for mps creator (we don't want to run into crap data)
- \dofinishEPSfile
- \else
- \fi\fi
- \fi\fi}
-
-\def\getEPSboundingboxspec
- {\edef\EPSspecialstring{\EPSspecialcontent\space . . . . }%
- \expandafter\dogetEPSboundingboxspec\EPSspecialstring\end}
-
-\def\dogetEPSboundingboxspec#1 #2 #3 #4 #5\end
- {\gdef\EPSllx{#1}%
- \ifx\EPSllx\empty
- \dogetEPSboundingboxspec#2 #3 #4 #5\end
- \else
- \gdef\EPSlly{#2}%
- \gdef\EPSurx{#3}%
- \gdef\EPSury{#4}%
- \fi}
-
-\def\getEPScreatorspec
- {\edef\EPSspecialstring{\EPSspecialcontent\space . .}%
- \expandafter\dogetEPScreatorspec\EPSspecialstring\end}
-
-\def\dogetEPScreatorspec#1#2 #3\end
- {\edef\EPScreatorstring{#1#2}%
- \global\chardef\EPScreator\ifx\EPScreatorstring\EPSmetaposttag\plusone\else\zerocount\fi\relax}
-
-\def\dogetEPSpreambledata#1% can be combined with \extraEPSpreambleparsers
- {\bgroup
- \let\dofinishEPSfile\relax % dirty trick, read past all bboxes
- \dogetEPSboundingbox{#1}\!!widtha\!!heighta\!!widthb\!!heightb
- \egroup}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/supp-fil.mkii b/Master/texmf-dist/tex/context/base/mkii/supp-fil.mkii
deleted file mode 100644
index 9a981797e05..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/supp-fil.mkii
+++ /dev/null
@@ -1,722 +0,0 @@
-%D \module
-%D [ file=supp-fil,
-%D version=1995.10.10,
-%D title=\CONTEXT\ Support Macros,
-%D subtitle=Files,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 \TEX\ operates on files, so one wouldn't wonder that there
-%D is a separate module for file support. In \CONTEXT\ files
-%D are used for several purposes:
-%D
-%D \startitemize[packed]
-%D \item general textual input
-%D \item logging status information
-%D \item saving registers, lists and references
-%D \item buffering defered textual input
-%D \stopitemize
-%D
-%D When dealing with files we can load them as a whole, using
-%D the \type{\input} primitive or load them on a line||by||line
-%D basis, using \type{\read}. Writing is always done line by
-%D line, using \type{\write}.
-
-\writestatus{loading}{ConTeXt Support Macros / Files}
-
-\unprotect
-
-\ifx\undefined\f!pathseparator
- \def\f!pathseparator{/}
- \def\f!currentpath {.}
- \def\f!parentpath {..}
-\fi
-
-\ifnum\texengine=\luatexengine
- \def\openinputfile #1#2{\openin #1{#2}\relax}
- \def\openoutputfile#1#2{\immediate\openout#1{#2}\relax}
-\else
- \def\openinputfile #1#2{\openin #1 "#2"\relax}
- \def\openoutputfile#1#2{\immediate\openout#1 "#2"\relax}
-\fi
-
-\def\closeinputfile #1{\immediate\closein #1}
-\def\closeoutputfile#1{\immediate\closeout#1}
-
-%D \macros
-%D {pushendofline,popendofline}
-%D
-%D When we are loading files in the middle of the typesetting
-%D process, for instance when we load references, we have to be
-%D sure that the reading process does not generate so called
-%D 'spurious spaces'. This can be prevented by assigning the
-%D line ending character the \CATCODE\ comment. This is
-%D accomplished by
-%D
-%D \starttyping
-%D \pushendofline
-%D ... reading ...
-%D \popendofline
-%D \stoptyping
-%D
-%D Just to be sure, we save the current meaning of \type{^^M}
-%D in \type{\poppedendofline}.
-
-% \chardef\poppedendofline\catcode`\^^M
-%
-% \def\pushendofline
-% {\chardef\poppedendofline\catcode`\^^M\relax
-% \catcode`\^^M\@@comment\relax}
-%
-% \def\popendofline
-% {\catcode`\^^M\poppedendofline}
-%
-% support for nested usage:
-
-\newcount \endoflinelevel
-
-\ifx\newlinecode\undefined \chardef\newlinecode=`\^^M \fi
-
-\def\pushendofline
- {\advance\endoflinelevel\plusone
- \expandafter\chardef\csname :eol:\number\endoflinelevel\endcsname\catcode\newlinecode
- \catcode\newlinecode\@@comment\relax}
-
-\def\popendofline
- {\catcode\newlinecode\csname :eol:\number\endoflinelevel\endcsname
- \advance\endoflinelevel\minusone}
-
-\def\restoreendofline
- {\catcode\newlinecode\@@endofline}
-
-%D \macros
-%D {scratchread, scratchwrite}
-%D
-%D We define a scratch file for reading. Keep in mind that
-%D the number of files is limited to~16, so use this one when
-%D possible. We also define a scratch output file.
-
-\ifx\undefined\scratchread \newread \scratchread \fi
-\ifx\undefined\scratchwrite \newwrite\scratchwrite \fi
-
-%D \macros
-%D {unlinkfile}
-%D
-%D Sometimes we want to make sure a file is deleted, so here
-%D is a macro that does the job. It's named after the \PERL\
-%D one.
-
-\def\unlinkfile#1%
- {\openoutputfile \scratchwrite{#1}%
- \closeoutputfile\scratchwrite}
-
-%D \macros
-%D {writeln}
-%D
-%D This saves a few tokens:
-
-\def\writeln#1{\write#1{}}
-
-\def\doiffileexistselse#1%
- {\doifelsenothing{#1}
- {\secondoftwoarguments}
- {\openinputfile\scratchread{#1}%
- \ifeof\scratchread
- \closeinputfile\scratchread
- \expandafter\secondoftwoarguments
- \else
- \closeinputfile\scratchread
- \expandafter\firstoftwoarguments
- \fi}}
-
-%D \macros
-%D {doprocessfile,fileline,fileprocessedtrue,dofinishfile}
-%D
-%D The next macro offers a framework for processing files on a
-%D line by line basis.
-%D
-%D \starttyping
-%D \doprocessfile \identifier {name} \action
-%D \stoptyping
-%D
-%D The first argument can for instance be \type{\scratchread}.
-%D The action must do something with \type{\fileline}, which
-%D holds the current line. One can halfway step out using
-%D \type{\dofinishfile} and ise \type{\iffileprocessed} to
-%D see if indeed some content was found.
-
-\newif\iffileprocessed
-
-\let\fileline\empty
-
-\def\doprocessfile#1#2#3%
- {\openinputfile{#1}{#2}%
- \ifeof#1%
- \fileprocessedfalse
- \closeinputfile#1%
- \else
- \fileprocessedtrue
- \gdef\dofinishfile
- {\closeinputfile#1%
- \global\let\doprocessline\relax}%
- \gdef\doprocessline
- {\ifeof#1%
- \expandafter\dofinishfile
- \else
- \global\read#1 to \fileline
- #3\relax
- \expandafter\doprocessline
- \fi}%
- \expandafter\doprocessline
- \fi}
-
-%D \macros
-%D {pathplusfile,assignfullfilename,sanitizefilename}
-%D
-%D Use \type{\pathplusfile} to compose a full file name, like
-%D in:
-%D
-%D \starttyping
-%D \pathplusfile{path}{file}
-%D \stoptyping
-%D
-%D By default, this expands into {\tt \pathplusfile{path}{file}}.
-
-\def\pathplusfile#1#2{#1\f!pathseparator#2}
-
-%D This one constructs a filename from a (possible empty)
-%D path and filename.
-
-\def\assignfullfilename#1#2\to#3%
- {\doifelsenothing{#1}
- {\edef#3{#2}}
- {\edef#3{#1\f!pathseparator#2}}}
-
-%D For the moment, we limit sanitizing to taking care of
-%D active \type {/}.
-
-\bgroup % todo: _ cleanup
-
-\catcode`\/=\@@active
-\catcode`\:=\@@active
-\catcode`\~=\@@active
-\catcode`\_=\@@active
-
-\gdef\sanitizefilename#1\to#2%
- {\bgroup
- \edef/{\string/}%
- \edef:{\string:}%
- \edef~{\string~}%
- \edef_{\string_}%
- \retainlccodes
- \lccode`\\=`\/
- \lowercase{\expanded{\xdef\noexpand\sanitizedfilename{#1}}}%
- \egroup
- \let#2\sanitizedfilename}
-
-\egroup
-
-%D NEW:
-
-\chardef\kindoffile=0 % 0=normal 1=full path spec (or http)
-
-\def\checkfilename#1%
- {\doifinstringelse{@@/}{@@#1}% unix: /full/path
- {\chardef\kindoffile\plusone}
- {\doifinstringelse{:/}{#1}% windows: e:/full/path or http://
- {\chardef\kindoffile\plusone}
- {\chardef\kindoffile\zerocount}}}
-
-%D \macros
-%D {input, normalinput}
-%D
-%D Sometimes we run into troubles when \type {\input} wants to get
-%D expanded, e.g. in a \type {\write} (which happens in the metafun
-%D manual when we permit long MP lines). So, instead of fixing that,
-%D we go for a redefinition of \type {\input}. Of course it's better
-%D to use \type {\readfile} or \type {\processfile}.
-
-\unexpanded\def\input{\normalinput}
-
-\ifnum\texengine=\luatexengine
- \def\inputgivenfile#1{\normalinput{#1}\relax}
-\else
- \def\inputgivenfile#1{\normalinput"#1"\relax}
-\fi
-
-%D \macros
-%D {readfile,ReadFile,maxreadlevel}
-%D
-%D One cannot be sure if a file exists. When no file can be
-%D found, the \type{\input} primitive gives an error message
-%D and switches to interactive mode. The macro \type{\readfile}
-%D takes care of non||existing files. This macro has two faces.
-%D
-%D \starttyping
-%D \ReadFile {filename}
-%D \readfile {filename} {before loading} {not found}
-%D \stoptyping
-%D
-%D Many \TEX\ implementations have laid out some strategy for
-%D locating files. This can lead to unexpected results,
-%D especially when one loads files that are not found in the
-%D current directory. Let's give an example of this. In
-%D \CONTEXT\ illustrations can be defined in an external file.
-%D The resizing macro first looks if an illustration is defined
-%D in the local definitions file. When no such file is found,
-%D it searches for a global file and when this file is not
-%D found either, the illustration itself is scanned for
-%D dimensions. One can imagine what happens if an adapted,
-%D localy stored illustration, is scaled according to
-%D dimensions stored somewhere else.
-%D
-%D When some \TEX\ implementation starts looking for a file, it
-%D normally first looks in the current directory. When no file
-%D is found, \TEX\ starts searching on the path where format
-%D and|/|or style files are stored. Depending on the implementation
-%D this can considerably slow down processing speed.
-%D
-%D In \CONTEXT, we support a project||wise ordening of files.
-%D In such an approach it seems feasible to store common files
-%D in a lower directory. When for instance searching for a
-%D general layout file, we therefore have to backtrack.
-%D
-%D These three considerations have lead to a more advanced
-%D approach for loading files.
-%D
-%D We first present an earlier implementation of
-%D \type{\readfile}. This command backtracks parent
-%D directories, upto a predefined level. Users can change this
-%D level, but we default to~3.
-%D
-%D \starttyping
-%D \def\maxreadlevel {3}
-%D \stoptyping
-%D
-%D This is a pseudo \COUNTER.
-%D
-%D We use \type{\normalinput} instead of \type{\input}
-%D because we want to be able to redefine the original
-%D \type{\input} when needed, for instance when loading third
-%D party libraries.
-
-\newevery \everybeforereadfile \EveryBeforeReadFile
-\newevery \everyafterreadfile \EveryAfterReadFile
-
-\let \everyreadfile \everybeforereadfile
-
-\newif\iftracefiles
-
-\newcount\readlevel
-
-\def\maxreadlevel{3}
-
-\newconditional\trackfilenames
-\let\trackedfilename\empty
-
-% We need to postpone loading, else we got frozen type-* files and so when
-% a format is generated on a source path.
-
-\def\doreadfile#1#2#3#4%
- {\sanitizefilename#2\to\readfilename
- \ifx\readfilename\empty
- % silently ignore
- \else
- \let\trackedfilename\readfilename
- \ifconditional\trackfilenames
- \doifundefinedelse{fn..\trackedfilename}\donetrue\donefalse
- \else
- \donetrue
- \fi
- \ifdone
- \checkfilename\readfilename
- \ifcase\kindoffile
- \iftracefiles\writestatus\m!systems{searching for \readfilename\space on #1}\fi
- % not a full path or url, check for existence
- \doifelsenothing{#1}
- {\def\next{\redoreadfile\readfilename{#3}{#4}}}%
- {\def\next{\redoreadfile{\pathplusfile{#1}{\readfilename}}{#3}{#4}}}%
- \else
- % a full path or url, no further checking done
- \doiffileexistselse\readfilename
- {\iftracefiles\writestatus\m!systems{located \readfilename}\fi
- \def\next{#3\dodoreadfile}}%
- {\iftracefiles\writestatus\m!systems{not found \readfilename}\fi
- \def\next{#4}}%
- \fi
- \else
- \edef\readfilename{\getvalue{fn..\readfilename}}%
- \iftracefiles\writestatus\m!systems{already located \readfilename}\fi
- \def\next{#3\dodoreadfile}%
- \fi
- \expandafter\next
- \fi}
-
-\def\redoreadfile#1#2#3%
- {\doiffileexistselse{#1}%
- {\edef\readfilename{#1}%
- \iftracefiles\writestatus\m!systems{#1 located}\fi
- \def\next{#2\dodoreadfile}}%
- {\iftracefiles\writestatus\m!systems{cannot locate #1}\fi
- \advance\readlevel\minusone
- \ifnum\readlevel>\zerocount
- \edef\readfilename{\pathplusfile{\f!parentpath}{\readfilename}}%
- \def\next{\redoreadfile\readfilename{#2}{#3}}%
- \else
- \def\next{#3}%
- \fi}%
- \next}
-
-\def\dodoreadfile % we provide hooks, for instance for \enableXML
- {\ifconditional\trackfilenames
- \setxvalue{fn..\trackedfilename}{\readfilename}%
- \fi
- \the\everybeforereadfile
-% \normalinput\readfilename\relax
- \relax\inputgivenfile\readfilename\relax
- \the\everyafterreadfile}
-
-% too less:
-%
-% \unexpanded\def\readfile% #1%
-% {\readlevel\maxreadlevel
-% \doreadfile\empty} % {#1}
-%
-% too much:
-%
-% \unexpanded\def\readfile#1#2#3%
-% {\readlocfile{#1}{#2}
-% {\readjobfile{#1}{#2}
-% {\readsysfile{#1}{#2}{#3}}}}
-%
-% just ok:
-
-\unexpanded\def\readfile#1#2#3%
- {\readlocfile{#1}{#2}{\readsysfile{#1}{#2}{#3}}}
-
-\def\readtexfile#1#2#3%
- {\pushcatcodetable \catcodetable \ctxcatcodes
- \readfile{#1}{#2}{#3}%
- \popcatcodetable}
-
-\ifdefined\xmlcatcodes \else \let\xmlcatcodes\xmlcatcodesn \fi
-
-\def\readxmlfile#1#2#3%
- {\pushcatcodetable \catcodetable \xmlcatcodes
- \readfile{#1}{#2}{#3}%
- \popcatcodetable}
-
-\unexpanded\def\ReadFile#1%
- {\readfile{#1}\donothing\donothing}
-
-%D \macros
-%D {readjobfile,readlocfile,readsysfile,
-%D readfixfile,readsetfile}
-%D
-%D This implementation honnors the third situation, but we
-%D still can get unwanted files loaded and/or can get involved
-%D in extensive searching.
-%D
-%D Due to different needs, we decided to offer four alternative
-%D loading commands. With \type{\readjobfile} we load a local
-%D file and do no backtracking, while \type{\readlocfile}
-%D backtracks~\number\readlevel\ directories, including the current
-%D one.
-
-\unexpanded\def\readjobfile % #1% current path, no backtracking
- {\readlevel\zerocount
- \doreadfile\f!currentpath} % {#1}}
-
-\unexpanded\def\readlocfile % #1% current path, backtracking
- {\readlevel\maxreadlevel
- \doreadfile\f!currentpath} % {#1}}
-
-%D System files can be anywhere and therefore
-%D \type{\readsysfile} is not bound to the current directory
-%D and obeys the \TEX\ implementation.
-
-\unexpanded\def\readsysfile % #1% current path, obeys tex search
- {\readlevel\zerocount
- \doreadfile\empty} % {#1}}
-
-%D Of the last two, \type{\readfixfile} searches on the
-%D directory specified and backtracks too, while
-%D \type{\readsetfile} does only search on the specified path.
-
-\unexpanded\def\readfixfile % #1#2% specified path, backtracking
- {\readlevel\maxreadlevel
- \doreadfile} % {#1}{#2}}
-
-\unexpanded\def\readsetfile % #1#2% specified path, no backtracking
- {\readlevel\zerocount
- \doreadfile} % {#1}{#2}}
-
-%D After having defined this commands, we reconsidered the
-%D previously defined \type{\readfile}. This time we more or
-%D less impose the search order.
-
-\unexpanded\def\readfile#1#2#3%
- {\readlocfile{#1}{#2}
- {\readjobfile{#1}{#2}
- {\readsysfile{#1}{#2}{#3}}}}
-
-%D So now we've got ourselves five file loading commands:
-%D
-%D \starttyping
-%D \readfile {filename} {before loading} {not found}
-%D
-%D \readjobfile {filename} {before loading} {not found}
-%D \readlocfile {filename} {before loading} {not found}
-%D \readfixfile {filename} {before loading} {not found}
-%D \readsysfile {directory} {filename} {before loading} {not found}
-%D \stoptyping
-
-%D \macros
-%D {readjobfile,readlocfile,readsysfile,readfixfile}
-%D
-%D The next four alternatives can be used for opening files
-%D for reading on a line||by||line basis. These commands get
-%D an extra argument, the filetag. Explicit closing is done
-%D in the normal way by \type{\closein}.
-
-\def\doopenin#1#2%
- {\sanitizefilename#2\to\readfilename
- \checkfilename\readfilename
- \ifcase\kindoffile
- \advance\readlevel\plusone
- \openinputfile{#1}\readfilename
- \ifeof#1% \relax
- \ifnum\readlevel>\maxreadlevel % \relax
- \else
- \closeinputfile#1% \relax
- \doopenin{#1}{\pathplusfile\f!parentpath{#2}}%
- \fi
- \fi
- \fi}
-
-\def\openjobin#1#2%
- {\readlevel\zerocount
- \doopenin{#1}{\pathplusfile\f!currentpath{#2}}}
-
-\def\opensysin % #1#2%
- {\readlevel\maxreadlevel
- \doopenin} % {#1}{#2}}
-
-\def\openlocin#1#2%
- {\readlevel\maxreadlevel
- \doopenin{#1}{\pathplusfile\f!currentpath{#2}}}
-
-\def\openfixin#1#2#3%
- {\readlevel\maxreadlevel
- \doopenin{#1}{\pathplusfile{#2}{#3}}}
-
-%D \macros
-%D {doiffileelse,doiflocfileelse}
-%D
-%D The next alternative only looks if a file is present. No
-%D loading is done. This one obeys the standard \TEX\
-%D implementation method.
-%D
-%D \starttyping
-%D \doiffileelse {filename} {found} {not found}
-%D \stoptyping
-%D
-%D \starttyping
-%D \doiflocfileelse {filename} {before loading} {not found}
-%D \stoptyping
-
-\def\doiffileelse {\doiffileexistselse}
-\def\doiffile #1{\doiffileexistselse{#1}\firstofoneargument\gobbleoneargument}
-\def\doifnotfile #1{\doiffileexistselse{#1}\gobbleoneargument\firstofoneargument}
-
-\def\doiflocfileelse#1%
- {\makelocreadfilename{#1}%
- \doiffileelse\readfilename}
-
-\def\makelocreadfilename#1%
- {\sanitizefilename#1\to\readfilename
- \checkfilename\readfilename
- \ifcase\kindoffile
- \edef\readfilename{\pathplusfile\f!currentpath{#1}}%
- \fi}
-
-%D \macros
-%D {doonlyonce, doinputonce, doendinputonce}
-%D
-%D Especially macropackages need only be loaded once.
-%D Repetitive loading not only costs time, relocating registers
-%D often leads to abortion of the processing because \TEX's
-%D capacity is limited. One can prevent multiple execution and
-%D loading by using one of both:
-%D
-%D \starttyping
-%D \doonlyonce{actions}
-%D \doinputonce{filename}
-%D \doendinputonce{filename}
-%D \stoptyping
-%D
-%D This command obeys the standard method for locating files.
-
-\long\def\doonlyonce#1%
- {\doifundefinedelse{@@@#1@@@}
- {\letgvalue{@@@#1@@@}\empty
- \firstofoneargument}
- {\gobbleoneargument}}
-
-\def\doinputonce#1%
-% {\doonlyonce{#1}{\doiffileelse{#1}{\normalinput#1\relax}\donothing}}
- {\doonlyonce{#1}{\doiffileelse{#1}{\inputgivenfile{#1}}\donothing}}
-
-\def\doendinputonce#1%
- {\doifdefined{@@@#1@@@}\endinput}
-
-\def\forgetdoingonce#1%
- {\global\letbeundefined{@@@#1@@@}}
-
-%D \macros
-%D {doifparentfileelse}
-%D
-%D The test \type{\doifelse{\jobname}{filename}} does not give
-%D the desired result, simply because \type{\jobname} expands
-%D to characters with \CATCODE~12, while the characters in
-%D \type{filename} have \CATCODE~11. So we can better use:
-%D
-%D \starttyping
-%D \doifparentfileelse{filename}{yes}{no}
-%D \stoptyping
-%D
-%D Since \TEXEXEC\ (and thereby \CONTEXT) supports renaming of
-%D the outputfile, we also need to check on that alternative
-%D name.
-
-\ifx\outputfilename\undefined \def\outputfilename{\jobname} \fi
-
-\def\doifparentfileelse#1%
- {\doifsamestringelse{#1}{\jobname }\firstoftwoarguments
- {\doifsamestringelse{#1}{\jobname.\c!tex}\firstoftwoarguments
- {\doifsamestringelse{#1}{\outputfilename}\firstoftwoarguments\secondoftwoarguments}}}
-
-\def\normalless {<} % geen \let !
-\def\normalmore {>} % geen \let !
-\def\normalequal {=} % geen \let !
-\def\normaldblquote{"} % geen \let !
-
-\newcount\readingfilelevel
-
-\def\popfilecharacter#1#2%
- {\ifnum\catcode`#1=\@@other \ifnum#2=\@@other \else
- %\message{[popping catcode #1 to #2]}%
- \catcode`#1=#2\relax
- \fi \fi}
-
-\ifx\\\undefined \let\\\relax \fi
-
-%D This changing catcodes is a direct result from the fact
-%D that we support some long standing conventions with
-%D regards to active characters (german ", polish /,
-%D french : and ;).
-
-%D We need to redo this: catcode sets and such
-
-\newtoks \everystartreadingfile
-\newtoks \everystopreadingfile
-
-\def\startreadingfile% beter een every en \setnormalcatcodes
- {\global\advance\readingfilelevel\plusone
- \the\everystartreadingfile
- \beginrestorecatcodes
- \setcatcodetable\prtcatcodes}
-
-\def\stopreadingfile
- {\endrestorecatcodes
- \the\everystopreadingfile
- \global\advance\readingfilelevel\minusone}
-
-\let\normalstartreadingfile\startreadingfile
-\let\normalstopreadingfile \stopreadingfile
-
-%D \macros
-%D {splitfilename}
-%D
-%D I should have made this one sooner. This macro was first needed when
-%D ran into graphic with a period in the pathpart.
-%D
-%D \startbuffer
-%D \def\showfilesplit
-%D {\bgroup \tttf
-%D \hbox{(full: \splitofffull)}\space
-%D \hbox{(path: \splitoffpath)}\space
-%D \hbox{(base: \splitoffbase)}\space
-%D \hbox{(name: \splitoffname)}\space
-%D \hbox{(type: \splitofftype)}\space
-%D \egroup}
-%D
-%D \splitfilename{c:/aa/bb/cc/dd.ee.ff} \showfilesplit \endgraf
-%D \splitfilename{c:/aa/bb/cc/dd.ee} \showfilesplit \endgraf
-%D \splitfilename{c:/aa/bb/cc/dd} \showfilesplit \endgraf
-%D
-%D \splitfilename{dd.ee.ff} \showfilesplit \endgraf
-%D \splitfilename{dd.ee} \showfilesplit \endgraf
-%D \splitfilename{dd} \showfilesplit \endgraf
-%D \stopbuffer
-%D
-%D \start \typebuffer \getbuffer \stop
-
-\def\splitoffroot{.} \chardef\splitoffkind\zerocount
-
-\let\splitofffull\empty
-\let\splitoffpath\empty
-\let\splitoffbase\empty
-\let\splitoffname\empty
-\let\splitofftype\empty
-
-% \def\splitfilename#1%
-% {\edef\splitofffull{#1}% normally outside this call: \sanitizefilename#1\to\sanitizedfilename
-% \greedysplitstring\splitofffull\at/\to\splitoffpath\and\splitoffbase
-% \ifx\splitoffbase\empty
-% \let\splitoffpath\empty
-% \let\splitoffbase\splitofffull
-% \fi
-% \greedysplitstring\splitoffbase\at.\to\splitoffname\and\splitofftype
-% \chardef\splitoffkind % can be used to test if pathpart was empty
-% \ifx\splitoffpath\empty \zerocount \else
-% \ifx\splitoffpath\splitoffroot \plusone \else
-% \plustwo \fi\fi
-% \ifx\splitoffname\empty\let\splitoffname\splitoffbase\fi
-% \ifx\splitoffpath\empty\let\splitoffpath\splitoffroot\fi}
-%
-% better, since it also handles leading /'s
-%
-% \splitfilename{oeps/test.pdf} [\splitoffpath\quad\splitoffname\quad\splitofftype]
-% \splitfilename{/oeps/test.pdf} [\splitoffpath\quad\splitoffname\quad\splitofftype]
-% \splitfilename{/test.pdf} [\splitoffpath\quad\splitoffname\quad\splitofftype]
-
-\def\splitfilename#1%
- {\edef\splitofffull{#1}% normally outside this call: \sanitizefilename#1\to\sanitizedfilename
- \greedysplitstring\splitofffull\at/\to\splitoffpath\and\splitoffbase
- \ifx\splitoffpath\splitofffull
- \let\splitoffpath\empty
- \fi
- \ifx\splitoffbase\empty
- \let\splitoffpath\empty
- \let\splitoffbase\splitofffull
- \fi
- \greedysplitstring\splitoffbase\at.\to\splitoffname\and\splitofftype
- \chardef\splitoffkind % can be used to test if pathpart was empty
- \ifx\splitoffpath\empty \zerocount \else
- \ifx\splitoffpath\splitoffroot \plusone \else
- \plustwo \fi\fi
- \ifx\splitoffname\empty\let\splitoffname\splitoffbase\fi
- \ifx\splitoffpath\empty\let\splitoffpath\splitoffroot\fi}
-
-\def\splitfiletype#1%
- {\edef\splitofffull{#1}% normally outside this call: \sanitizefilename#1\to\sanitizedfilename
- \let\splitoffpath\empty
- \greedysplitstring\splitofffull\at.\to\splitoffname\and\splitofftype}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/supp-fun.mkii b/Master/texmf-dist/tex/context/base/mkii/supp-fun.mkii
deleted file mode 100644
index 9bba4f5a85f..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/supp-fun.mkii
+++ /dev/null
@@ -1,746 +0,0 @@
-%D \module
-%D [ file=supp-fun,
-%D version=1995.10.10,
-%D title=\CONTEXT\ Support Macros,
-%D subtitle=Fun Stuff,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\unprotect
-
-%D This module implements some typographics tricks that can
-%D be fun when designing document layouts. The examples use
-%D macros that are typical to \CONTEXT, but non \CONTEXT\
-%D users can use the drop caps and first line treatment
-%D macros without problems. This module will be extended
-%D when the need for more of such tricks arises.
-
-\ifx \undefined \writestatus \input supp-mis.tex \relax \fi
-
-\writestatus{loading}{ConTeXt Support Macros / Fun Stuff}
-
-\ifx\definefont\undefined
- \def\definedfont[#1]{\font\temp#1\relax\temp}
-\fi
-
-%D \macros
-%D {DroppedCaps, DroppedString, DroppedIndent, DroppedLines}
-%D
-%D \startbuffer
-%D \DroppedCaps
-%D {\color[green]} {cmbx12}
-%D {2.2\baselineskip} {2pt} {\baselineskip} {2}
-%D Let's start
-%D \stopbuffer
-%D
-%D \getbuffer with dropped caps, those blown up first
-%D characters of a paragraph. It's hard to implement a general
-%D mechanism that suits all situations, but dropped caps are so
-%D seldomly used that we can permit ourselves a rather user
-%D unfriendly implementation.
-%D
-%D \typebuffer
-%D
-%D As we will see, there are 7 different settings involved. The
-%D first argument takes a command that is used to do whatever
-%D fancy things we want to do, but normally this one will be
-%D empty. The second argument takes the font. Because we're
-%D dealing with something very typographic, there is no real
-%D reason to adopt complicated font switching schemes, a mere
-%D name will do. Font encodings can bring no harm, because the
-%D alphanumeric characters are nearly always located at their
-%D natural position in the encoding vector.
-%D
-%D \startbuffer
-%D \DroppedCaps
-%D {\color[red]} {cmbx12}
-%D {\baselineskip} {0pt} {0pt} {1}
-%D This simple
-%D \stopbuffer
-%D
-%D \getbuffer case shows us what happens when we apply minimal
-%D values. Here we used:
-%D
-%D \typebuffer
-%D
-%D \startbuffer
-%D \DroppedCaps
-%D {\color[red]} {cmbx12}
-%D {2\baselineskip} {0pt} {\baselineskip} {2}
-%D Is this ugly
-%D \stopbuffer
-%D
-%D \getbuffer example the third argument tells
-%D this macro that we want a dropped capital scaled to the
-%D baseline distance. The two zero point arguments are the
-%D horizontal and vertical offsets and the last arguments
-%D determines the hanging indentation. In this paragraph we
-%D set the height to two times the baselinedistance and use
-%D two hanging lines:
-%D
-%D \typebuffer
-%D
-%D Here, the first character is moved down one baseline. Here
-%D we also see why the horizontal offset is important. The
-%D first example (showing the~L) sets this to a few points and
-%D also used a slightly larger height.
-%D
-%D Of course common users (typist) are not supposed to see this
-%D kind of fuzzy definitions, but fortunately \TEX\ permits us
-%D to hide them in macros. Using a macro also enables us to
-%D garantee consistency throughout the document:
-%D
-%D \startbuffer
-%D \def\MyDroppedCaps%
-%D {\DroppedCaps
-%D {\color[green]} {cmbx12}
-%D {5\baselineskip} {3pt} {3\baselineskip} {4}}
-%D
-%D \MyDroppedCaps The implementation
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \getbuffer of the general macro is rather simple and only
-%D depends on the arguments given and the dimensions of the
-%D strut box. We explicitly load the font, which is no problem
-%D because \TEX\ does not load a font twice. We could have
-%D combined some arguments, like the height, vertical offset
-%D and the number of lines, but the current implementation
-%D proved to be the most flexible. One should be aware of the
-%D fact that the offsets depend on the design of the glyphs
-%D used.
-
-\let\DroppedIndent\!!zeropoint \def\DroppedLines{0}
-
-\def\DroppedString{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
-
-\let\globaldropcaps\global % will be an option, but on by default
-
-\def\localdropcaps{\let\globaldropcaps\relax}
-
-\chardef\DroppedStatus = 0 % 0=done 1=starting 2=doing 3=error
-\chardef\DropMode = 0 % 1 == marginhang
-
-\ifx\keeplinestogether\undefined
- \let\keeplinestogether\gobbleoneargument
-\fi
-
-\def\DroppedCaps#1#2#3#4#5#6#7% does not yet handle accented chars
- {\defconvertedargument\asciia{#7}%
- \defconvertedcommand \asciib{\DroppedString}%
- \ExpandBothAfter\doifinstringelse\asciia\asciib
- {\noindentation
- \dontleavehmode
- \checkindentation % redo this one
- %\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
- \setbox2\hbox{\raise\dp0\hbox{\lower\strutdp\copy0}}%
- \ht2\ht0
- \dp0\strutdp
- \setbox0\box2
- \fi
- \setbox0\hbox
- {\ifnum\DropMode=\plusone
- \hskip-\wd0\wd0\zeropoint
- \fi
- \lower#5\box0}%
- \ht0\strutht
- \dp0\strutdp
- \ifnum\DropMode=\plusone
- \globaldropcaps\let\DroppedIndent\!!zeropoint
- \globaldropcaps\edef\DroppedLines{\number\maxdimen}%
- \globaldropcaps\chardef\DroppedStatus\plusthree
- \else
- \globaldropcaps\edef\DroppedIndent{\the\wd0}%
- \globaldropcaps\edef\DroppedLines {\number#6}%
- \globaldropcaps\chardef\DroppedStatus\plustwo
- \globaldropcaps\hangindent\DroppedIndent
- \globaldropcaps\hangafter-\DroppedLines
-% \noindent
- \noindentation
- \checkindentation % redo this one
- \hskip-\DroppedIndent
- \fi
- \vbox{\forgetall\box0}%
- \nobreak
- \let\next\ignorespaces} % Could be a one character word !
- {\globaldropcaps\let\DroppedIndent\!!zeropoint
- \globaldropcaps\edef\DroppedLines{\number\maxdimen}%
- \globaldropcaps\chardef\DroppedStatus\plusthree
- \def\next{#7}}%
- \let\globaldropcaps\global
- \next}
-
-%D Before we go to the next topic, we summarize this command:
-%D
-%D \starttyping
-%D \DroppedCaps
-%D {command} {font}
-%D {height} {hoffset} {voffset} {lines}
-%D \stoptyping
-%D
-%D Sometimes you need to make sure that the global settings are
-%D kept local, as in:
-%D
-% %D \startbuffer
-% %D \defineparagraphs[SomePar][n=2,rule=on]
-% %D \setupparagraphs [SomePar][1][width=.5\textwidth]
-% %D \setupparagraphs [SomePar][2][width=.5\textwidth]
-%D \startbuffer
-%D \defineparagraphs[SomePar][n=2,rule=on]
-%D \setupparagraphs [SomePar][1][width=.5\textwidth]
-%D \setupparagraphs [SomePar][2][width=.5\textwidth]
-%D
-%D \startSomePar
-%D \localdropcaps\NiceDroppedCaps{}{cmr12}{0pt}{2}Here we need
-%D to explicitly keep the hanging indentation local, like it or
-%D not.
-%D \SomePar
-%D \localdropcaps\NiceDroppedCaps{}{cmr12}{0pt}{2}Here we need
-%D to explicitly keep the hanging indentation local, like it or
-%D not.
-%D \stopSomePar
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-
-%D \macros
-%D {AutoDroppedCaps, CheckDroppedCaps}
-%D
-%D {\em To be documented.}
-
-% example usage
-%
-% \def\bpar{\ifvmode\CheckDroppedCaps\fi}
-% \def\epar{\ifhmode\par\fi\CheckDroppedCaps}
-
-\newcount\lastprevgraf
-\newcount\droppedlines
-
-\def\CheckDroppedCaps
- {\global\lastprevgraf\prevgraf}
-
-\def\AutoDroppedCaps % will be proper core stuff since it
- {\globaldropcaps\chardef\DroppedStatus\plusone
- \global\lastprevgraf\zerocount
- \global\droppedlines\zerocount
- \EveryPar{\doAutoDroppedCaps}}
-
-\let\AutoDroppedNext\relax
-
-\ifx\AutoDroppedCapsCommand\undefined
- \def\AutoDroppedCapsCommand{\NiceDroppedCaps{}{SerifBold}{.125em}{3}}
-\fi
-
-\def\doAutoDroppedCaps
- {\ifcase\DroppedStatus % done
- \let\next\relax
- \or % starting
- % \ifnum\lastprevgraf>0 % tricky, probably a wrong par
- % \globaldropcaps\chardef\DroppedStatus=3 % and inhibits dropped
- % \let\next\relax % caps after titles and more than once
- % \else % so let's nill this rubishly code fragment
- \let\next\AutoDroppedCapsCommand
- % \fi % and hope for the best
- \or % doing
- \global\advance\droppedlines \lastprevgraf
- \ifnum\droppedlines=\zerocount
- \globaldropcaps\chardef\DroppedStatus\zerocount
- \let\next\relax
- \else\ifnum\droppedlines>\zerocount
- \ifnum\droppedlines<\DroppedLines\relax
- \globaldropcaps\hangindent\DroppedIndent
- \globaldropcaps\hangafter-\DroppedLines
- \globaldropcaps\advance\hangafter \droppedlines
- \hskip-\parindent % brrr
- \let\next\AutoDroppedNext
- \else
- \globaldropcaps\chardef\DroppedStatus\zerocount
- \let\next\relax
- \fi
- \else
- \globaldropcaps\chardef\DroppedStatus\zerocount
- \let\next\relax
- \fi\fi
- \or % error
- \globaldropcaps\chardef\DroppedStatus\zerocount
- \let\next\relax
- \fi
- \next}
-
-%D \macros
-%D {LineDroppedCaps, NiceDroppedCaps}
-%D
-%D To save definitions, we also provide:
-%D
-%D \starttyping
-%D \LineDroppedCaps {command} {font} {hoffset} {lines}
-%D \NiceDroppedCaps {command} {font} {hoffset} {lines}
-%D \stoptyping
-%D
-%D The first command scales the font to the exact height, while
-%D the second command scales the font to a nice 2.5 times the
-%D line height, a value that gives a pleasant grayness.
-
-\def\DoLineDroppedCaps#1#2#3#4#5% compensation command font offset lines
- {\scratchcounter#5%
- \advance\scratchcounter \minusone
- \scratchdimen\scratchcounter\baselineskip
- \advance\scratchdimen #1%
- \NormalizeFontHeight\DummyFont{W}\scratchdimen{#3}%
- \DroppedCaps{#2}{#3}\TheNormalizedFontSize{#4}
- {\scratchcounter\baselineskip}{#5}}
-
-\def\LineDroppedCaps% command font offset lines
- {\DoLineDroppedCaps{\strutht}}
-
-\def\NiceDroppedCaps% command font offset lines
- {\DoLineDroppedCaps{.5\baselineskip}}
-
-%D \macros
-%D {TreatFirstLine}
-%D
-%D \startbuffer
-%D \TreatFirstLine {\sc} {} {} {}
-%D Instead of limiting its action to one token, the next macro
-%D treats the whole first line. This paragraph was typeset by
-%D saying:
-%D \stopbuffer
-%D
-%D \getbuffer
-%D
-%D \typebuffer
-%D
-%D \startbuffer
-%D \TreatFirstLine {\startcolor[red]\bf} {\stopcolor} {} {}
-%D The combined color and font effect is also possible,
-%D although one must be careful in using macros that accumulate
-%D grouping, but the commands used here are pretty save in that
-%D respect.
-%D \stopbuffer
-%D
-%D \getbuffer
-%D
-%D \typebuffer
-%D
-%D Before we explain the third and fourth argument, we show the
-%D implementation. Those who know a bit about the way \TEX\
-%D treats tokens, will probably see in one glance that this
-%D alternative works all right for most text||only situations
-%D in which there is enough text available for the first line,
-%D but that more complicated things will blow. One has to live
-%D with that. A workaround is rather trivial but obscures the
-%D principles used.
-
-\def\TreatFirstLine#1#2#3#4% before, after, first, next
- {\leavevmode
- \bgroup
- \forgetall
- \bgroup
- #1%
- \setbox0\emptybox
- \setbox2\emptybox
- \def\grabfirstline##1 %
- {\setbox2\hbox
- {\ifvoid0
- {#3{\ignorespaces##1}}%
- \else
- \unhcopy0\ {#4{##1}}%
- \fi}%
- \ifdim\wd2=\zeropoint
- \setbox0\emptybox
- \setbox2\emptybox
- \@EA\grabfirstline
- \else\ifdim\wd2>\hsize
- \hbox to \hsize{\strut\unhbox0}#2\egroup
- \break##1\
- \egroup
- \else
- \setbox0\box2
- \@EAEAEA\grabfirstline
- \fi\fi}%
- \grabfirstline}
-
-%D \startbuffer
-%D \gdef\FunnyCommand
-%D {\getrandomfloat\FunnyR{0}{1}%
-%D \getrandomfloat\FunnyG{0}{1}%
-%D \getrandomfloat\FunnyB{0}{1}%
-%D \definecolor[FunnyColor][r=\FunnyR,g=\FunnyG,b=\FunnyB]%
-%D \color[FunnyColor]}
-%D
-%D %\TreatFirstLine {\bf} {} {\FunnyCommand} {\FunnyCommand}
-%D The third and fourth argument can be used to gain special
-%D effects on the individual words. Of course one needs ...
-%D \stopbuffer
-%D
-%D \getbuffer
-%D to know a bit more about the macro package used to get real
-%D nice effects, but this example probably demonstrates the
-%D principles well.
-%D
-%D \typebuffer
-%D
-%D Like in dropped caps case, one can hide such treatments in a
-%D macro, like:
-%D
-%D \starttyping
-%D \def\MyTreatFirstLine%
-%D {\TreatFirstLine{\bf}{}{\FunnyCommand}{\FunnyCommand}}
-%D \stoptyping
-
-%D \macros
-%D {reshapebox}
-%D
-%D \startbuffer
-%D \beginofshapebox
-%D When using \CONTEXT, one can also apply this funny command
-%D to whole lines by using the reshape mechanism. Describing
-%D this interesting mechanism falls outside the scope of this
-%D module, so we only show the trick. This is an example of
-%D low level \CONTEXT\ functionality: it's all there, and it's
-%D stable, but not entirely meant for novice users.
-%D \endofshapebox
-%D
-%D \reshapebox{\FunnyCommand{\box\shapebox}} \flushshapebox
-%D \stopbuffer
-%D
-%D \getbuffer
-%D
-%D \typebuffer
-%D
-%D This mechanism permits hyphenation and therefore gives
-%D better results than the previously discussed macro
-%D \type{\TreatFirstLine}.
-
-%D \macros
-%D {TreatFirstCharacter}
-%D
-%D \startbuffer
-%D \TreatFirstCharacter{\bf\color[green]} Just to be
-%D \stopbuffer
-%D
-%D \getbuffer complete we also offer a very simple one
-%D character alternative, that is not that hard to understand:
-
-\def\TreatFirstCharacter#1#2% command, character
- {{#1{#2}}}
-
-%D A previous paragraph started with:
-%D
-%D \typebuffer
-
-%D \macros
-%D {StackCharacters}
-%D
-%D The next hack deals with vertical stacking.
-
-\def\StackCharacters#1#2#3#4% sequence vsize vskip command
- {\vbox #2
- {\forgetall
- \baselineskip\zeropoint
- \def\StackCharacter##1{#4{##1}\cr\noalign{#3}}%
- \halign
- {\hss##\hss&##\cr
- \handletokens#1\with\StackCharacter\cr}}}
-
-%D \startbuffer
-%D \StackCharacters{CONTEXT}{}{\vskip.2ex}{\FunnyCommand}
-%D \stopbuffer
-%D
-%D Such a stack looks like:
-%D
-%D \startlinecorrection
-%D \hbox to \hsize
-%D {$\hss\bfd
-%D \vcenter{\StackCharacters{TEX} {}{\vskip.2ex}{\FunnyCommand}}%
-%D \hss
-%D \vcenter{\StackCharacters{CON} {}{\vskip.2ex}{\FunnyCommand}}
-%D \hss
-%D \vcenter{\StackCharacters{TEXT} {}{\vskip.2ex}{\FunnyCommand}}
-%D \hss
-%D \vcenter{\StackCharacters{CONTEXT}{}{\vskip.2ex}{\FunnyCommand}}
-%D \hss$}
-%D \stoplinecorrection
-%D
-%D and is typeset by saying:
-%D
-%D \typebuffer
-%D
-%D An alternative would have been
-%D
-%D \starttyping
-%D \StackCharacters {CONTEXT} {to 5cm} {\vfill} {\FunnyCommand}
-%D \stoptyping
-
-%D \macros
-%D {processtokens}
-%D
-%D At a lower level horizontal and vertical manipulations are
-%D already supported by:
-%D
-%D \starttyping
-%D \processtokens {begin} {between} {end} {space} {text}
-%D \stoptyping
-%D
-%D \startbuffer[a]
-%D \processtokens
-%D {\hbox to .5\hsize\bgroup} {\hfill}
-%D {\egroup} {\space} {LET'S HAVE}
-%D \stopbuffer
-%D
-%D \startbuffer[b]
-%D \processtokens
-%D {\vbox\bgroup\raggedcenter\hsize1em}
-%D {\vskip.25ex} {\egroup} {\strut} {FUN}
-%D \stopbuffer
-%D
-%D This macro is able to typeset:
-%D
-%D \leavevmode\hbox to \hsize
-%D {$\hfil\hfil
-%D \vcenter{\bf\getbuffer[a]}%
-%D \hfil
-%D \vcenter{\bfd\getbuffer[b]}%
-%D \hfil\hfil$}
-%D
-%D which was specified as:
-%D
-%D \typebuffer[a]
-%D \typebuffer[b]
-
-%D \macros
-%D {NormalizeFontHeight, NormalizeFontWidth,
-%D TheNormalizedFontSize}
-%D
-%D Next we introduce some font manipulation macros. When we
-%D want to typeset some text spread in a well defined area, it
-%D can be considered bad practice to manipulate character and
-%D word spacing. In such situations the next few macros can be
-%D of help:
-%D
-%D \starttyping
-%D \NormalizeFontHeight \name {sample text} {height} {font}
-%D \NormalizeFontWidth \name {sample text} {width} {font}
-%D \stoptyping
-%D
-%D These are implemented using an auxilliary macro:
-
-\def\NormalizeFontHeight{\NormalizeFontSize\ht}
-\def\NormalizeFontWidth {\NormalizeFontSize\wd}
-
-% \def\NormalizeFontSize#1#2#3#4#5%
-% {\bgroup
-% \dimen0=#4% #4 can be \ht0 or so
-% \setbox0\hbox{\definedfont[#5 at 10pt]#3}%
-% \ifdim\wd0>\zeropoint
-% \dimen2=#10 % #1 is \wd or \ht
-% \dimen4=10000pt
-% \divide\dimen4 \dimen2
-% \divide\dimen0 \plusthousand
-% \dimen0=\number\dimen4\dimen0
-% \xdef\TheNormalizedFontSize{\the\dimen0}%
-% \else
-% \dimen0\bodyfontsize
-% \fi
-% \definedfont[#5 at \the\dimen0]%
-% \expandafter
-% \egroup
-% \expandafter\font\expandafter#2\fontname\font\relax}
-%
-% the familiar struggle with accuracy forces us to use:
-
-\def\NormalizeFontSize#1#2#3#4#5%
- {\bgroup
- \dimen0=#4% #4 can be \ht0 or so
- \setbox0\hbox{\definedfont[#5 at 5pt]#3}% 10pt
- \ifdim\wd0>\zeropoint
- \dimen2=#10 % #1 is \wd or \ht
- \dimen4=\maxdimen % 10000pt
- \divide\dimen4 \dimen2
- \divide\dimen0 1638 % 1000
- \dimen0=\number\dimen4\dimen0
- \divide \dimen0 \plustwo % ...
- \xdef\TheNormalizedFontSize{\the\dimen0}%
- \else
- \dimen0\bodyfontsize
- \fi
- % mkii
- % \definedfont[#5 at \the\dimen0]%
- % \expandafter
- % \egroup
- % \expandafter\font\expandafter#2\fontname\font\relax}
- % mkiv safe (file: prefix etc)
- \expanded{\egroup\def\noexpand#2{\definedfont[#5 at \the\dimen0]}}}
-
-%D Afterwards, we have access to the calculated size by:
-
-\let\TheNormalizedFontSize\!!zeropoint
-
-%D Extra:
-
-\def\WidthSpanningText#1#2#3% text width font
- {\hbox{\NormalizeFontWidth\temp{#1}{#2}{#3}\temp\the\everydefinedfont#1}}
-
-%D Consider for instance:
-%D
-%D \startbuffer
-%D \NormalizeFontHeight \tmp {X} {2\baselineskip} {cmr10}
-%D
-%D {\tmp To Be Or Not To Be}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D This shows up as (we also show the baselines):
-%D
-%D {\showbaselines\getbuffer}
-%D
-%D The horizontal counterpart is:
-%D
-%D \startbuffer
-%D \NormalizeFontWidth \tmp {This Line Fits} {\hsize} {cmr10}
-%D
-%D \hbox{\tmp This Line Fits}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D The calculated font scale is avaliable in the macro
-%D \type{\NormalizedFontSize}.
-%D
-%D \startlinecorrection
-%D \ruledhbox{\getbuffer}
-%D \stoplinecorrection
-%D
-%D One can of course combine these macros with the ones
-%D described earlier, like in:
-%D
-%D \starttyping
-%D \NormalizeFontHeight {text} \DroppedFont {2\baselineskip} {cmbx12}
-%D
-%D \def\NicelyDroppedCaps
-%D {\DroppedCaps
-%D {\color[green]}
-%D {\DroppedFont}
-%D {2pt}
-%D {\baselineskip}
-%D {2}}
-%D \stoptyping
-%D
-%D It's up to the reader to test this one.
-
-\unexpanded\def\FirstNCharacters#1#2% \FirstNCharacters{3}{fr{\"o}beln}
- {\bgroup
- \scratchcounter\zerocount
- \def\docommand##1%
- {\ifnum\scratchcounter=#1\else
- ##1\relax % catches ##1 = \"e and alike
- \advance\scratchcounter\plusone
- \fi}
- \handletokens#2\with\docommand
- \egroup}
-
-%D \macros
-%D {FittingText}
-%D
-%D First used in Pascal (demo-bbv):
-%D
-%D \startbuffer
-%D \ruledvbox{\FittingText{3cm}{1cm}{Serif}{24pt}{1pt}{1}
-%D {\veryraggedright
-%D \hangindent1em\hangafter1\relax
-%D \begstrut \dorecurse{8}{Bram Marta }\unskip \endstrut}}
-%D
-%D \ruledvbox{\FittingText{3cm}{1cm}{Serif}{24pt}{1pt}{1}
-%D {\raggedleft\begstrut Bram\\Marta \unskip\endstrut}}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \startlinecorrection
-%D \getbuffer
-%D \stoplinecorrection
-
-% #1 width #2 height #3 font #4 size #5 step #6 interlinie #7 text
-
-\long\def\FittingText#1#2#3#4#5#6#7%
- {\bgroup
- \forgetall
- \dontcomplain
- \setuptolerance[\v!verytolerant]% == \tolerance4500
- \hsize#1%
- \def\\{\softbreak}%
- \!!heighta#4%
- \!!heightb#2%
- \doloop
- {\ifdim\!!heighta>\onepoint
- \expanded{\definefont[\s!dummy][#3 at \the\!!heighta][\c!interlinespace=#6]}%
- \getvalue\s!dummy
- \setbox\scratchbox\vbox{#7\endgraf}%
- \ifdim\ht\scratchbox>\!!heightb
- \advance\!!heighta-#5%
- \else
- \beginshapebox
- \unvcopy\scratchbox
- \endshapebox
- \global\dimen1\hsize
- \reshapebox
- {\setbox\shapebox\hbox{\unhbox\shapebox}%
- \ifdim\wd\shapebox>\dimen1
- \global\dimen1\wd\shapebox
- \fi}%
- \ifdim\dimen1>\hsize
- \advance\!!heighta-#5%
- \else
- \exitloop
- \fi
- \fi
- \else
- \exitloop
- \fi}%
- %\writestatus{\strippedcsname\FittingText}{height: \the\!!heighta}%
- \unvbox\scratchbox
- \egroup}
-
-%D New:
-
-% \font width gap font spec text
-
-\def\NormalizeFontWidthSpread#1#2#3#4#5#6%
- {\global\setfalse\NFSpread
- \scratchdimen#3%
- \scratchdimen-.5\scratchdimen
- \advance\scratchdimen#2\relax
- \NormalizeFontWidth
- #1%
- {\def\+{\global\settrue\NFSpread\gobbleuntil\relax}%
- \def\\{\gobbleuntil\relax}% newline
- \setupspacing
- #6\relax}%
- {\scratchdimen}%
- {#4}%
- \ifconditional\NFSpread
- % de gap valt in de binding
- \else
- \definefont[\strippedcsname#1][#4 #5]%
- \fi}
-
-\def\SpreadGapText#1#2%
- {{\def\+{\kern#1}#2}}
-
-\def\GapText#1#2#3#4#5% width distance font spec title
- {\bgroup
- \NormalizeFontWidthSpread\DummyFont{#1}{#2}{#3}{#4}{#5}%
- \DummyFont\setupspacing\SpreadGapText{#2}{#5}\endgraf
- \egroup}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/supp-lat.mkii b/Master/texmf-dist/tex/context/base/mkii/supp-lat.mkii
deleted file mode 100644
index 343a7674c27..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/supp-lat.mkii
+++ /dev/null
@@ -1,59 +0,0 @@
-%D \module
-%D [ file=syst-ltx,
-%D version=2009.10.13,
-%D title=\CONTEXT\ System Macros,
-%D subtitle=General,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 bib module assumes that sometimes this command is used but
-%D in \MKIV\ we no longer assume that.
-%D
-%D \macros
-%D {newcommand}
-%D
-%D This module replaces \type {t-bibltx} and implements the
-%D \LATEX\ newcommand (sort of). This command is not to be
-%D used directly but only is there for the occasional
-%D \BIBTEX\ file that uses it.
-%D
-%D \starttyping
-%D \newcommand\oeps {oeps}
-%D \newcommand\oeps[6] {oeps[#1]#6}
-%D \newcommand\oeps[6][whatever]{oeps[#1]#6}
-%D \stoptyping
-
-\unprotect
-
-\def\newcommand#1%
- {\dotripleempty\donewcommand[#1]}
-
-\def\donewcommand
- {\ifthirdargument
- \expandafter\donewcommandtwo
- \else\ifsecondargument
- \expandafter\expandafter\expandafter\donewcommandone
- \else
- \expandafter\expandafter\expandafter\donewcommandzero
- \fi\fi}
-
-\def\donewcommandzero[#1][#2][#3]%
- {\long\def#1}
-
-\def\donewcommandone[#1][#2][#3]%
- {\scratchtoks{\long\def#1}%
- \dorecurse{#2}{\scratchtoks\expandafter{\the\scratchtoks######1}}%
- \the\scratchtoks}
-
-\def\donewcommandtwo[#1][#2][#3]%
- {\long\def#1{\doifnextcharelse[{\getvalue{>>\string#1>>}}{\getvalue{>>\string#1>>}[#3]}}%
- \scratchtoks{\long\setvalue{>>\string#1>>}[##1]}%
- \dostepwiserecurse{2}{#2}{1}{\scratchtoks\expandafter{\the\scratchtoks######1}}%
- \the\scratchtoks}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/supp-mat.mkii b/Master/texmf-dist/tex/context/base/mkii/supp-mat.mkii
deleted file mode 100644
index e8a34fc90ee..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/supp-mat.mkii
+++ /dev/null
@@ -1,293 +0,0 @@
-%D \module
-%D [ file=supp-mat,
-%D version=1998.09.10,
-%D title=\CONTEXT\ Support Macros,
-%D subtitle=Math,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 For practical reasons, I decided to move some math things to
-%D a support module. There is nothing spectacular here. It may move
-%D back to math-ini.
-
-\writestatus{loading}{ConTeXt Support Macros / Math}
-
-\unprotect
-
-%D \macros
-%D {mathematics, math, nomathematics, startmathmode}
-%D
-%D The \type{$} can be both an begin and end math character.
-%D This can lead to confusing and errorprone situations when
-%D macros insert \type{$}. When for instance we have defined:
-%D
-%D \starttyping
-%D \def\MyPlus{$\,+\,$}
-%D \stoptyping
-%D
-%D the sequence \type{$x^2 \MyPlus y^2 = r^2$} will expand to:
-%D
-%D \starttyping
-%D $x^2 $\,+\,$ y^2 = r^2$
-%D \stoptyping
-%D
-%D Here the \type{\,} are given outside math mode and \TEX\ will
-%D definitely complain about this. A more save definition would
-%D have been:
-%D
-%D \starttyping
-%D \def\MyPlus{\mathematics{\,+\,}}
-%D \stoptyping
-%D
-%D Which is implemented as:
-
-\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{\dontleavehmode\relax\ifmmode#1\else $#1$\fi}
-
-\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%
- {\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}
- \def\inlinemathematics {\dontleavehmode\mathematics}
- \def\automathematics {\relax\ifhmode\@EA\inlinemathematics\else\@EA\displaymathematics\fi}
-
-% better, esp when used in bTABLE ... eTABLE
-
-\def\automathematics
- {\relax
- \ifhmode
- \expandafter\inlinemathematics
- \else\ifintable
- \expandafter\expandafter\expandafter\inlinemathematics
- \else
- \expandafter\expandafter\expandafter\displaymathematics
- \fi\fi}
-
-%D \macros
-%D {dimension, nodimension}
-%D
-%D The next few macros are used for typesetting dimensions in
-%D such a way that spacing is acceptable. I won't spend much
-%D words on these macros, because they will be overloaded in
-%D the units module.
-
-\newsignal\dimensionsignal
-
-\def\dimensiontypeface {\tf}
-\def\dimensionhalfspace {\,}
-
-\unexpanded\def\dimension#1%
- {\def\dodimensionsignal{\kern\dimensionsignal}%
- \ifdim\lastskip=\zeropoint\relax
- \ifdim\lastkern=\zeropoint\relax
- \ifmmode
- \mathematics{\dimensionhalfspace\dimensionhalfspace\dimensiontypeface#1}%
- \else
- \mathematics{\dimensiontypeface#1}%
- \fi
- \else\ifdim\lastkern=\dimensionsignal
- \mathematics{\dimensionhalfspace\dimensiontypeface#1}%
- \else
- \unkern\mathematics{\dimensionhalfspace\dimensionhalfspace\dimensiontypeface#1}%
- \fi\fi
- \else
- \unskip\mathematics{\dimensionhalfspace\dimensionhalfspace\dimensiontypeface#1}%
- \fi
- \dodimensionsignal}
-
-\unexpanded\def\nodimension#1%
- {\unskip#1\global\let\dodimensionsignal\relax}
-
-%D \macros
-%D {super, suber}
-%D
-%D \TEX\ uses \type{^} and \type{_} for entering super- and
-%D subscript mode. We want however a bit more control than
-%D normally provided, and therefore provide \type {\super}
-%D and \type{\suber} (\type {\sub} is already taken).
-
-\global\let\normalsuper=^
-\global\let\normalsuber=_
-
-\newcount\supersubmode
-
-\newevery\everysupersub \EverySuperSub
-
-\appendtoks \advance\supersubmode 1\relax \to \everysupersub
-
-% \def\dodosuper#1{\normalsuper{\the\everysupersub#1}}
-% \def\dodosuber#1{\normalsuber{\the\everysupersub#1}}
-%
-% \def\dosuper{\ifx\next\bgroup\expandafter\dodosuper\else\normalsuper\fi}
-% \def\dosuber{\ifx\next\bgroup\expandafter\dodosuber\else\normalsuber\fi}
-%
-% \def\super{\futurelet\next\dosuper}
-% \def\suber{\futurelet\next\dosuber}
-
-\def\super#1{\normalsuper{\the\everysupersub#1}}
-\def\suber#1{\normalsuber{\the\everysupersub#1}}
-
-%D \macros
-%D {enablesupsub}
-%D
-%D We can let \type {^} and \type {_} act like \type {\super}
-%D and \type {\suber} by saying \type {\enablesupsub}.
-
-\bgroup
-\catcode`\^=\@@active
-\catcode`\_=\@@active
-\gdef\enablesupsub
- {\catcode`\^=\@@active
- \def^{\ifmmode\expandafter\super\else\expandafter\normalsuper\fi}%
- \catcode`\_=\@@active
- \def_{\ifmmode\expandafter\suber\else\expandafter\normalsuber\fi}}
-\egroup
-
-%D \macros
-%D {restoremathstyle}
-%D
-%D We can pick up the current math style by calling \type
-%D {\restoremathstyle}.
-
-\def\restoremathstyle
- {\ifmmode
- \ifcase\supsubmode
- \textstyle
- \or
- \scriptstyle
- \else
- \scriptscriptstyle
- \fi
- \fi}
-
-%D \macros
-%D {cramped}
-%D
-%D \TEX provides no primitive to force in cramped math mode. Here is
-%D a macro that does so. It is based on a solution by Don Knuth (\useurl
-%D {http://www.ctan.org/tex-archive/digests/tex-implementors/042}).
-%D
-%D \startbuffer
-%D \ruledhbox{$\left\{{x^2\over y^2}\right\}$}
-%D \ruledhbox{$\cramped{\left\{ {x^2\over y^2}\right\}}$}
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-
-\def\cramped
- {\mathpalette\docramped}
-
-%D We force a cramped style by issuing a non||existing radical (box).
-%D After that we make sure the height is correct. (Comment taken from
-%D Morten Høgholm's mathtools package.) Macro suggested by AM and
-%D cleaned up a bit by HH.
-
-% original
-%
-% \def\docramped#1#2%
-% {\setbox\scratchbox\hbox
-% {\nulldelimiterspace\zeropoint
-% $\mathsurround\zeropoint#1\radical\zerocount{#2}$}%
-% \ifx#1\displaystyle
-% \scratchdimen\fontdimen8\textfont3
-% \advance\scratchdimen .25\fontdimen5\textfont2
-% \else
-% \scratchdimen1.25\fontdimen8
-% \ifx#1\textstyle\textfont
-% \else
-% \ifx#1\scriptstyle\scriptfont\else\scriptscriptfont\fi
-% \fi
-% 3
-% \fi
-% \advance\scratchdimen-\ht\scratchbox
-% \ht\scratchbox-\scratchdimen
-% \box\scratchbox}
-
-\def\docramped#1#2%
- {\begingroup % added HH, made even more cramped
- \setbox\scratchbox\hbox
- {\nulldelimiterspace\zeropoint
- $\mathsurround\zeropoint#1\radical\zerocount{#2}$}%
- \ht\scratchbox-\dimexpr
- \ifx#1\displaystyle
- \fontdimen8\textfont3
- +.25\fontdimen5\textfont2
- \else
- 1.25\fontdimen8
- \ifx#1\textstyle
- \textfont
- \else\ifx#1\scriptstyle
- \scriptfont
- \else
- \scriptscriptfont
- \fi \fi
- \plusthree
- \fi
- -\ht\scratchbox
- \relax
- \box\scratchbox
- \endgroup}
-
-%D \macros
-%D {cramedllap, crampedrlap, crampedclap}
-%D
-%D In many cases, one wants to use the \tex {clap} macro in
-%D math mode while using subscripts. Normally, subscripts are
-%D in cramped mode, and these macros allow you to go to
-%D cramped mode. For example:
-%D
-%D \startbuffer
-%D \startformula
-%D \sum_{a^2 < b^2 < c^2} \quad
-%D \sum_{\clap{a^2 < b^2 < c^2}} \quad
-%D \sum_{\crampedclap{a^2 < b^2 < c^2}}
-%D \stopformula
-%D \stopbuffer
-%D
-%D \start
-%D \typebuffer
-%D \switchtobodyfont[24pt]
-%D \getbuffer
-%D \stop
-%D
-%D Notice that \type {\clap{\cramped ... }} would also work,
-%D but it requires \TEX\ to typeset it arguments 16 times.
-
-\def\docrampedllap#1#2{{}\dollap{\docramped #1{#2}}}
-\def\docrampedrlap#1#2{{}\dorlap{\docramped #1{#2}}}
-\def\docrampedclap#1#2{{}\doclap{\docramped #1{#2}}}
-
-\def\crampedllap{\mathpalette\docrampedllap}
-\def\crampedrlap{\mathpalette\docrampedrlap}
-\def\crampedclap{\mathpalette\docrampedclap}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/supp-mis.tex b/Master/texmf-dist/tex/context/base/mkii/supp-mis.tex
deleted file mode 100644
index bda8d4f6fda..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/supp-mis.tex
+++ /dev/null
@@ -1,4 +0,0 @@
-% This file is not needed, for instance supp-pdf has the relevant code
-% built in and ppchtex is adapted.
-
-\input supp-mis.mkii
diff --git a/Master/texmf-dist/tex/context/base/mkii/supp-mpe.tex b/Master/texmf-dist/tex/context/base/mkii/supp-mpe.tex
deleted file mode 100644
index f4438133a2a..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/supp-mpe.tex
+++ /dev/null
@@ -1,4 +0,0 @@
-% This file is not needed as I don't expect other macro packages
-% to support the metafun extensions.
-
-\input supp-mpe.mkii
diff --git a/Master/texmf-dist/tex/context/base/mkii/supp-mps.mkii b/Master/texmf-dist/tex/context/base/mkii/supp-mps.mkii
deleted file mode 100644
index 3991280e6d4..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/supp-mps.mkii
+++ /dev/null
@@ -1,2134 +0,0 @@
-%D \module
-%D [ file=supp-mps,
-%D version=1997.07.05,
-%D title=\CONTEXT\ Support Macros,
-%D subtitle=\METAPOST\ Inclusion,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Forget about generic modules \unknown\ ...
-
-\ifx \undefined \contextversion \endinput \fi
-
-%D \METAPOST\ is John Hobbys alternative for \METAFONT\ and
-%D produces superior \POSTSCRIPT\ code. In this module we
-%D integrate \METAPOST\ support int \CONTEXT. We offer two
-%D tracks:
-%D
-%D \startitemize
-%D \item generating \METAPOST\ code, running this program from
-%D within \TEX\ using \type{\write18}, and importing the
-%D result
-%D \item generating \METAPOST\ code, processing the code
-%D afterward, and importing the result in a second pass
-%D \stopitemize
-%D
-%D The first approach uses a non standard \TEX\ feature,
-%D implemented in Web2c. I'm not going to discuss the pros and
-%D cons of running programs from within others, but all
-%D arguments against this can be overcome by implementing a
-%D \TEX\ worthy primitive:
-%D
-%D \starttyping
-%D \excuteMetaPost filename
-%D \stoptyping
-%D
-%D Ok then, let's start:
-
-\writestatus{loading}{ConTeXt Support Macros / MetaPost Inclusion}
-
-\unprotect
-
-\def\@@MPG{@MPG@}
-
-%D First we define a handy constant:
-
-\bgroup \catcode`\%=\@@other \xdef\letterpercent{\string%} \egroup
-
-% todo : sort out ^^M, \par and ; mess
-
-%D \macros
-%D {everyMPgraphic}
-%D
-%D Because some graphics interact with \TEX\ (i.e.\ \CONTEXT), we
-%D provide a hook for additional actions: \type {\everyMPgraphic}.
-
-\newtoks\everyMPgraphic \everyMPgraphic{\everyMPgraphic\emptytoks}
-
-%D \macros
-%D {startMPgraphic}
-%D
-%D From within \TEX\ one can execute \METAPOST\ code by putting
-%D it between the two commands
-%D
-%D \starttyping
-%D \startMPgraphic
-%D \stopMPgraphic
-%D \stoptyping
-%D
-%D This is implemented as:
-
-\let\stopMPgraphic\relax
-
-\long\def\startMPgraphic#1\stopMPgraphic
- {\startwritingMPgraphic
- \writecheckedMPgraphic{#1}% % potential speedup: pass #1 as macro
- \stopwritingMPgraphic}
-
-%D \macros
-%D {startMPrun}
-%D
-%D If we just want to run \METAPOST\ code, that is, not to
-%D explictly generate a figure in terms of \type{beginfig} and
-%D \type{endfig}, we can use:
-%D
-%D \starttyping
-%D \startMPgraphic
-%D \stopMPgraphic
-%D \stoptyping
-%D
-%D \starttyping
-%D \startMPrun
-%D \stopMPrun
-%D \stoptyping
-%D
-%D The next booleans are for internal purposes only.
-
-% some day a bit more more clear:
-%
-% run directly/run afterwards/run external defined
-% insert directly/insert whenever
-% use object/don't use objects
-
-\newif\ifMPgraphics \MPgraphicstrue
-\newif\ifMPrun \MPrunfalse
-\newif\ifMPwrapper \MPwrappertrue
-
-\let\stopMPrun\relax
-
-\ifCONTEXT
-
- \long\def\dostartMPrun#1#2\stopMPrun
- {\bgroup
- \MPruntrue
- \doifsomething{#1}{\def\MPgraphicfile{#1}}%
- \startwritingMPgraphic
- \writecheckedMPgraphic{#2}%
- \stopwritingMPgraphic
- \egroup}
-
- \def\startMPrun
- {\dosinglegroupempty\dostartMPrun}
-
-\else
-
- \long\def\startMPrun#1\stopMPrun
- {\MPruntrue
- \startwritingMPgraphic
- \writecheckedMPgraphic{#1}%
- \stopwritingMPgraphic
- \MPrunfalse}
-
-\fi
-
-%D \macros
-%D {startwritingMPgraphic,
-%D writeMPgraphic,
-%D stopwritingMPgraphic}
-%D
-%D If the writing process is divided into more steps, one can
-%D use the components of this macro directly.
-%D
-%D \starttyping
-%D \startwritingMPgraphic
-%D ...
-%D \writeMPgraphic{...}
-%D ...
-%D \writeMPgraphic{...}
-%D ...
-%D \stopwritingMPgraphic
-%D \stoptyping
-
-%D \macros
-%D {ifrunMPgraphics,ifrunMPTEXgraphics,ifinsertMPgraphics}
-%D
-%D These macros look a bit more complicated that one would
-%D expect at first sight. This is due to the two ways of
-%D processing these graphics, mentioned in a previous
-%D paragraph. Which method is used, the direct or indirect
-%D one, depends on a boolean.
-
-\newif\ifrunMPgraphics \runMPgraphicsfalse
-\newif\ifrunMPTEXgraphics \runMPTEXgraphicsfalse
-\newif\ifinsertMPgraphics \insertMPgraphicstrue
-
-%D If set to true, one can do with a single pass, else one must
-%D process the \METAPOST\ file \type{mpgraph} between two
-%D succesive \TEX\ runs.
-
-\ifx\MPgraphicfile\undefined
-
-\def\MPgraphicfile{mp\ifMPrun run\else graph\fi}
-\def\MPruntimefile{mprun}
-
-\fi
-
-%D \macros
-%D {MPgraphic}
-%D
-%D When we run \METAPOST\ from within \TEX, each graphic is
-%D processed at once, which means that we reuse this file many
-%D times. When however the execution is delayed, all graphics
-%D are saved in a separate figure. The current graphic is
-%D characterized bij a \COUNTER. This counter is available
-%D in \type{\MPgraphic}.
-
-\newcount\nofMPgraphics
-\newcount\currentMPgraphic
-
-\def\MPgraphic{0}
-
-% %D \macros
-% %D {ifreuseMPgraphics}
-% %D
-% %D If one want to reuse grapics, one can save much redundant
-% %D run time by setting the next switch to true.
-%
-% \newif\ifreuseMPgraphics \reuseMPgraphicstrue
-
-%D The three macros responsible for writing the graphic
-%D implement both schemes.
-
-%D \macros
-%D {MPinclusions, startMPinclusions, MPinitializations}
-%D
-%D One can include for instance common input commands by
-%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.
-
-%D The next hack prevents too long lines:
-
-\long\def\runtimeobeyMPlines
- {\catcode35=11\relax % goodie
- \ifx\rawcharacter\undefined
- \let\obeyedline\space
- \else
- \obeylines
- \ifx\outputnewlinechar\undefined
- \edef\obeyedline{\rawcharacter{\endlinechar}}%
- \else
- \let\obeyedline\outputnewlinechar
- \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}}
-
-\def\startMPinitializations % no text checking done here !
- {\begingroup
- \obeyMPlines
- \dostartMPinitializations}
-
-\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
-
-%D \macros
-%D {iflongMPlines}
-%D
-%D When grabbing a graphic deifnition, newlines are turned
-%D into spaces. By default we split the graphic definition
-%D at the colon, but long lines are still possible by
-%D setting the next boolean to true.
-
-\newwrite\MPwrite
-\newwrite\MPstaticwrite
-
-\newif\iflongMPlines \longMPlinestrue % we now have \obeyMPlines
-
-\ifx \overlaywidth \undefined \def \overlaywidth {4cm} \fi
-\ifx \overlayheight \undefined \def \overlayheight {3cm} \fi
-\ifx \overlaylinewidth \undefined \def \overlaylinewidth {0pt} \fi
-
-\def\presetMPdefinitions
- {\edef\overlaywidth {\overlaywidth \space}%
- \edef\overlayheight {\overlayheight \space}%
- \edef\overlaylinewidth {\overlaylinewidth\space}%
- \edef\currentwidth {\the\hsize \space}%
- \edef\currentheight {\the\vsize \space}}
-
-%D The \type {;} aware method (the \type {\else} branch) also
-%D takes care of \type {btex}||\type {etex}, \type
-%D {verbatimtex}||\type {etex}. The space after \type {tex}
-%D is essential, since it protects \type {text}.
-
-\newif\ifMPTEXgraphic
-
-\let\bufferedMPgraphicsline\empty
-
-\appendtoks
- \globallet\bufferedMPgraphicsline\empty
-\to \everyMPgraphic
-
-\chardef\MPgraphicsscanmode\plustwo % 0=no scanning, 1=simple scanning, 2=less simple, 3=even less
-
-% the next fails with \chardef\MPgraphicsscanmode\plusone
-%
-% \startMPextensions
-% gp_num_points_with_tex := 3 ;
-% \stopMPextensions
-
-\def\writeMPgraphic % no big #1 passing here
- {\iflongMPlines
- \ifMPTEXgraphic
- \ifcase\MPgraphicsscanmode
- \let\next\writeMPgraphiclongR
- \else
- \let\next\writeMPgraphiclongT
- \fi
- \else
- \let\next\writeMPgraphiclongN
- \fi
- \else
- \ifMPTEXgraphic
- \ifcase\MPgraphicsscanmode
- \let\next\writeMPgraphicshortN % we could \let \writeMPgraphicshortR\writeMPgraphicshortN
- \else
- \let\next\writeMPgraphicshortT
- \fi
- \else
- \let\next\writeMPgraphicshortN
- \fi
- \fi
- \next}
-
-\appendtoks \obeyMPlines \to \everyMPgraphic % more efficient than in each following grouped write
-
-\long\def\writeMPgraphiclongR#1% fast, no scanning
- {\bgroup
- \let\par\space
- \immediate\write\MPwrite{#1}%
- \egroup}
-
-\long\def\writeMPgraphiclongT#1%
- {\bgroup
- \let\par\space
- \longMPflushT#1\empty\par\relax\par
- \egroup}
-
-\long\def\writeMPgraphicshortT#1%
- {\bgroup
- \let\par\space
- \shortMPflushT#1\empty;\relax;%
- \egroup}
-
-\long\def\longMPflushT#1#2\par
- {\ifx#1\relax \else
- \dowriteMPgraphicline#1#2tex \relax etex\MPend
- \expandafter\longMPflushT
- \fi}
-
-\long\def\shortMPflushT#1#2;%
- {\ifx#1\relax \else
- \dowriteMPgraphicline#1#2tex \relax etex\MPend
- \expandafter\shortMPflushT
- \fi}
-
-\long\def\writeMPgraphiclongN#1%
- {\bgroup
- \let\par\space
- \longMPflushN#1\empty\par\relax\par
- \egroup}
-
-\long\def\writeMPgraphicshortN#1%
- {\bgroup
- \let\par\space
- \shortMPflushN#1\empty;\relax;%
- \egroup}
-
-\long\def\longMPflushN#1#2\par
- {\ifx#1\relax \else
- \nowriteMPgraphicline#1#2\MPend
- \expandafter\longMPflushN
- \fi}
-
-\long\def\shortMPflushN#1#2;%
- {\ifx#1\relax \else
- \nowriteMPgraphicline#1#2\MPend
- \expandafter\shortMPflushN
- \fi}
-
-\def\dowriteMPgraphicline{\futurelet\next\dodowriteMPgraphicline}
-\def\nowriteMPgraphicline{\futurelet\next\nonowriteMPgraphicline}
-
-%D Will move (check if next is needed):
-
-\long\def\nonowriteMPgraphicline#1\MPend
- {\ifx\next\empty\else\ifx\next\relax\else
- \bgroup
- \let\par\space
- \iflongMPlines
- %\immediate\write\MPwrite{#1;}% oeps, ; invalid
- \immediate\write\MPwrite{#1}%
- \else
- \long\edef\ascii{#1}%
- \expandafter\flushMPgraphicline\ascii\empty;\relax;%
- \fi
- \egroup
- \fi\fi}
-
-%D A first version:
-%D
-%D \starttyping
-%D \long\def\dodowriteMPgraphicline#1tex #2#3etex#4\MPend%
-%D {\ifx\next\empty\else\ifx\next\relax\else
-%D \bgroup
-%D \let\par=\space
-%D \ifx#2\relax
-%D \immediate\write\MPwrite{#1;}%
-%D \egroup
-%D \else
-%D \global\MPTEXgraphictrue
-%D \convertargument#2#3\to\ascii
-%D \immediate\write\MPwrite{#1tex \ascii etex}%
-%D \egroup
-%D \dowriteMPgraphicline#4tex \relax etex\MPend
-%D \fi
-%D \fi\fi}
-%D \stoptyping
-
-%D The next alternative also handles inclusions well.
-
-\newtoks \everyMPTEXgraphic
-
-\newif\ifforceMPTEXgraphic
-
-%D Before we supported the graph module, we had:
-%D
-%D \starttyping
-%D \convertargument etex\to\MPasciiB
-%D \convertargument textext\to\MPasciiC % geen "text"
-%D \convertargument graphictext\to\MPasciiD % geen "text"
-%D
-%D \long\def\checkMPTEXgraphic#1%
-%D {\ifforceMPTEXgraphic
-%D \global\MPTEXgraphictrue
-%D \else
-%D \expandafter\convertargument#1\to\MPasciia
-%D \doifstringinstringelse\MPasciiB\MPasciia{\global\MPTEXgraphictrue}
-%D {\doifstringinstringelse\MPasciiC\MPasciia{\global\MPTEXgraphictrue}
-%D {\doifstringinstringelse\MPasciiD\MPasciia{\global\MPTEXgraphictrue}
-%D {\global\MPTEXgraphicfalse}}}%
-%D \fi}
-%D \stoptyping
-%D
-%D The next alternative permits extensions in other modules
-%D without the need to know the details of testing.
-
-\newtoks\MPTEXgraphicchecks
-
-\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
- \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
-%D as efficient alternative. (The uglyness comes from
-%D expanding after the string \type {#1}).
-
-\let\MPTEXchecklist\empty
-
-\def\forceMPTEXcheck#1%
- {\addtocommalist{#1}\MPTEXchecklist
- \expanded{\convertargument#1\noexpand\to
- \@EA\noexpand\csname MPascii#1\endcsname}%
- \@EA\appendtoks
- \@EA\doifincsnameelse\csname MPascii#1\endcsname\MPascii
- {\global\MPTEXgraphictrue\gobbleuntil\relax}\donothing
- \to \MPTEXgraphicchecks}
-
-\forceMPTEXcheck{etex}
-\forceMPTEXcheck{textext}
-\forceMPTEXcheck{graphictext}
-
-%D \starttyping
-%D \forceMPTEXgraphictrue
-%D
-%D \forceMPTEXcheck{lintext}
-%D \forceMPTEXcheck{logtext}
-%D
-%D \startMPcode
-%D draw hlintext.lft(0, 20, 5, 20cm, "@3e") ;
-%D draw vlogtext.bot(0, 10, 9, 10cm, "@3e") ;
-%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;}%
- \fi}
-
-\long\def\flushMPgraphicline#1#2;%
- {\ifx#1\relax \else
- \immediate\write\MPwrite{#1#2;}%
- \expandafter\flushMPgraphicline
- \fi}
-
-% the next one fails on btex \vbox {\hbox .. leading to \vbox \hbox
-%
-% \long\def\dodowriteMPgraphicline#1tex #2#3etex#4\MPend
-% {\ifx\next\empty\else\ifx\next\relax\else
-% \bgroup
-% \let\par\space
-% \ifx#2\relax
-% \iflongMPlines
-% \immediate\write\MPwrite{#1;}%
-% \else
-% \edef\ascii{#1}%
-% \expandafter\flushMPgraphicline\ascii\empty;\relax;%
-% \fi
-% \egroup
-% \else
-% \convertargument#2#3\to\ascii
-% \immediate\write\MPwrite{#1tex \ascii etex}%
-% \egroup
-% \dowriteMPgraphicline#4tex \relax etex\MPend
-% \fi
-% \fi\fi}
-%
-% so we need a two step approach
-
-% \long\def\dodowriteMPgraphicline#1tex %
-% {\doifnextcharelse\relax
-% {\nododowriteMPgraphicline{#1}}
-% {\redodowriteMPgraphicline{#1}}}
-%
-% better and faster
-
-% \long\def\dodowriteMPgraphicline#1tex #2%
-% {\ifx#2\relax
-% \expandafter\nododowriteMPgraphicline
-% \else
-% \expandafter\redodowriteMPgraphicline
-% \fi{#1} #2}
-%
-% \long\def\redodowriteMPgraphicline#1#2etex#3\MPend
-% {\ifx\next\empty\else\ifx\next\relax\else
-% \bgroup
-% \let\par\space
-% \convertargument#2\to\ascii
-% \immediate\write\MPwrite{#1tex \ascii etex}%
-% \egroup
-% \dowriteMPgraphicline#3tex \relax etex\MPend
-% \fi\fi}
-%
-% \long\def\nododowriteMPgraphicline#1#2\MPend
-% {\ifx\next\empty\else\ifx\next\relax\else
-% \bgroup
-% \let\par\space
-% \iflongMPlines
-% \immediate\write\MPwrite{#1;}%
-% \else
-% \long\edef\ascii{#1}%
-% \expandafter\flushMPgraphicline\ascii\empty;\relax;%
-% \fi
-% \egroup
-% \fi\fi}
-
-% extra scanning
-
-\long\def\dodowriteMPgraphicline#1tex #2% kind of ok
- {\ifx#2\relax
- \expandafter\nododowriteMPgraphicline
- \else
- \ifcase\MPgraphicsscanmode
- % can't happen
- \or
- \@EAEAEA\redodowriteMPgraphicline
- \or
- \doifinstringelse{b$} {#1$}{\@EAEAEA\redodowriteMPgraphicline}%
- {\doifinstringelse{verbatim$}{#1$}{\@EAEAEA\redodowriteMPgraphicline}%
- {\@EAEAEA\dododowriteMPgraphicline}}%
- \else
- \doifinstringelse { b$}{#1$}{\@EAEAEA\redodowriteMPgraphicline}%
- {\doifinstringelse {(b$}{#1$}{\@EAEAEA\redodowriteMPgraphicline}%
- {\doifinstringelse {=b$}{#1$}{\@EAEAEA\redodowriteMPgraphicline}%
- {\doifinstringelse{verbatim$}{#1$}{\@EAEAEA\redodowriteMPgraphicline}%
- {\@EAEAEA\dododowriteMPgraphicline}}}}%
- \fi
- \fi{#1} #2}
-
-\def\dododowriteMPgraphicline#1#2\MPend
- {\doifsomething{#1}{\xdef\bufferedMPgraphicsline{\bufferedMPgraphicsline#1tex }}%
- \dowriteMPgraphicline#2tex \relax etex\MPend}
-
-\long\def\redodowriteMPgraphicline#1#2etex#3\MPend
- {\ifx\next\empty
- \else\ifx\next\relax
- \else
- \bgroup
- \let\par\space
- \convertargument#2\to\ascii
- \immediate\write\MPwrite{\bufferedMPgraphicsline#1tex \ascii etex}%
- \globallet\bufferedMPgraphicsline\empty
- \egroup
- \dowriteMPgraphicline#3tex \relax etex\MPend
- \fi\fi}
-
-\long\def\nododowriteMPgraphicline#1#2\MPend
- {\ifx\next\empty
- \else\ifx\next\relax
- \else
- \bgroup
- \let\par\space
- \iflongMPlines
- \immediate\write\MPwrite{\bufferedMPgraphicsline#1;}%
- \globallet\bufferedMPgraphicsline\empty
- \else
- \long\edef\ascii{\bufferedMPgraphicsline#1}%
- \expandafter\flushMPgraphicline\ascii\empty;\relax;%
- \fi
- \egroup
- \fi\fi}
-
-%D This stripper is suboptimal in the sense that more
-%D \type{;}'s are output than feasible. Anyhow, \METAPOST\
-%D can handle this and users may consider it being a sort
-%D of error prevention bonus.
-
-\ifx\blabelgroup\undefined
-
- \let\blabelgroup\bgroup
- \let\elabelgroup\egroup
-
-\fi
-
-\newconditional\firstMPgraphic \settrue\firstMPgraphic
-
-\appendtoks
- \let \# \letterhash
- \let \_ \letterunderscore
- \let \& \letterampersand
- \let \{ \letteropenbrace
- \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;}}
-
-\def\startwritingMPgraphic
- {\blabelgroup
- \global\advance\nofMPgraphics \plusone
- \ifMPrun \else
- \allocateMPslot\currentMPgraphic
- \fi
- \enableincludeMPgraphics
- \xdef\MPgraphic{\the\currentMPgraphic}%
- \the\everyMPgraphic
- \presetMPdefinitions % moved to here from \writeMPgraphic
- \ifrunMPgraphics
- \openMPgraphicfile1{runtime}%
- % no reset here !
- \theMPextensions
- \theMPinclusions
- \else
- \openMPgraphicfile0{collected}%
- % reset here ! global added (due to adding \blabelgroup)
- \theMPextensions
- \theMPinclusions
- \global\let\theMPextensions\relax
- \global\let\theMPinclusions\relax
- \fi
- \theMPinitializations % always
- \ifMPrun
- \else
- \ifMPwrapper
- \immediate\write\MPwrite{let mprunend = end ;}%
- \immediate\write\MPwrite{beginfig(\the\currentMPgraphic);}%
- \fi
- \fi
- \globallet\flushMPgraphics\closeMPgraphicfiles % \dodostopwritingMPgraphic
- \globallet\stopwritingMPgraphic\dostopwritingMPgraphic}
-
-\let\MPgraphicfiles\empty
-
-\let\MPinputtranslation\empty
-
-\def\openMPgraphicfile#1#2% #1=alwaysopen #2=message
- {\@EA\ifx\csname\@@MPG\@@MPG\MPgraphicfile\endcsname\relax
- \donetrue
- % \@EA\newwrite\csname\@@MPG\@@MPG\MPgraphicfile\endcsname
- % for the sake of plain usage
- \@EA\@EA\csname newwrite\endcsname\csname\@@MPG\@@MPG\MPgraphicfile\endcsname
- \doglobal\addtocommalist\MPgraphicfile\MPgraphicfiles
- \else
- \ifcase#1\relax\donefalse\else\donetrue\fi
- \fi
- \@EA\let\@EA\MPwrite\csname\@@MPG\@@MPG\MPgraphicfile\endcsname
- \ifdone
- \immediate\openout\MPwrite\MPgraphicfile.mp\relax
- \ifx\MPinputtranslation\empty\else
- \immediate\write\MPwrite{\MPinputtranslation}%
- \immediate\write\MPwrite{verbatimtex \MPinputtranslation etex ;}%
- \fi
- \immediate\write\MPwrite{\letterpercent\space #2 graphics of job "\jobname"}%
- \writeMPgraph
- \setMPrandomseed
- \fi}
-
-\def\dostopwritingMPgraphic
- {\ifMPrun \else
- \ifMPwrapper
- \immediate\write\MPwrite{endfig;}%
- \immediate\write\MPwrite{let end=mprunend;}%
- \fi
- \fi
- \ifrunMPgraphics
- \dodostopwritingMPgraphic
- \fi
- \elabelgroup}
-
-\def\dodostopwritingMPgraphic
- {\ifnum\currentMPgraphic>\zerocount
- \donetrue
- \else\ifMPrun
- \donetrue
- \else
- \donefalse
- \fi\fi
- \ifdone
- \finishwritingMPgraphics
- \runMPgraphic\MPgraphicfile
- \fi
- \globallet\flushMPgraphics\relax}
-
-\def\finishwritingMPgraphics
- {\ifMPwrapper\immediate\write\MPwrite{end.}\fi
- \immediate\closeout\MPwrite}
-
-\def\closeMPgraphicfiles
- {\ifrunMPgraphics \else \ifx\MPgraphicsfiles\empty\else
- \def\docommand##1%
- {\message{[flush and process ##1.mp afterwards]}%
- \@EA\let\@EA\MPwrite\csname\@@MPG\@@MPG##1\endcsname
- \finishwritingMPgraphics}%
- \processcommacommand[\MPgraphicfiles]\docommand
- \fi \fi}
-
-\let\stopwritingMPgraphic\relax
-\let\flushMPgraphics \relax
-
-%D By default each graphic gets its own slot (number). Later
-%D on we will define a recycle bin.
-
-\def \allocateMPslot#1{\global\advance#1\plusone}
-\def\deallocateMPslot#1{}
-
-%D \macros
-%D {translateMPinput}
-%D
-%D For my polish friends:
-%D
-%D \starttyping
-%D % translate=il2-pl
-%D
-%D \translateMPinput{il2-pl}
-%D
-%D \startMPenvironment[global]
-%D \setupbodyfont[plr]
-%D \stopMPenvironment
-%D
-%D \TeX: ± ¶
-%D
-%D \startMPcode
-%D draw btex MetaPost: ± ¶ etex scaled 5 ;
-%D \stopMPcode
-%D \stoptyping
-
-\def\translateMPinput#1%
-% {\xdef\MPinputtranslation{\letterpercent -translate-file=#1\space}} % at some point
-% {\xdef\MPinputtranslation{\letterpercent --8bit}} % some time later
- {\globallet\MPinputtranslation\empty} % the new mpost is 8 bit clean
-
-%D \macros
-%D {setMPrandomseed}
-%D
-%D Did you notice the random seed initialization? This is
-%D needed because \METAPOST\ has a rather poor initialization,
-%D which in some implementations depends on the time in
-%D minutes. So, in quick successive runs, random is not that
-%D random.
-
-\newif\ifsetMPrandomseed \setMPrandomseedtrue % false by default
-
-\def\setMPrandomseed
- {\ifsetMPrandomseed \ifx\getrandomnumber\undefined \else
- \getrandomnumber\localMPseed\zerocount{4095}%
- \writeMPgraphic{randomseed:=\localMPseed;}%
- \fi\fi}
-
-%D This feature has become optional. Thanks to Fabrice Popineau,
-%D \METAPOST\ can now do a far better job!
-
-%D \macros
-%D {flushMPgraphics}
-%D
-%D When we use the indirect method, all graphics are saved in
-%D one file. This means that we cannot close this file after
-%D every \type{\stopMPgraphic}. Therefore we need to say:
-%D
-%D \starttyping
-%D \flushMPgraphics
-%D \stoptyping
-%D
-%D else the file is closed without writing the \METAPOST\ end
-%D command. One will notice this fast enough when in indirect
-%D mode. When using the direct mode this command is not
-%D implicitly needed, but ommiting it makes files less
-%D portable.
-
-%D \macros
-%D {loadcurrentMPgraphic,
-%D placeMPgraphic}
-%D
-%D Once defined, we can call for this graphic by saying:
-%D
-%D \starttyping
-%D \loadcurrentMPgraphic{setups}
-%D \placeMPgraphic
-%D \stoptyping
-%D
-%D This two stage insert permits some intermediate manipulations
-%D of the graphic, which temporary saved in:
-
-\newbox\MPgraphicbox
-
-\def\doloadcurrentMPgraphic#1%
- {\loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{#1}%
- \deallocateMPslot\currentMPgraphic} % added
-
-\ifCONTEXT
- \def\loadcurrentMPgraphic{\dosinglegroupempty\doloadcurrentMPgraphic}
-\else
- \let\loadcurrentMPgraphic\doloadcurrentMPgraphic
-\fi
-
-\def\loadMPgraphic#1#2%
- {\setbox\MPgraphicbox\hbox{\ifinsertMPgraphics\insertMPfile{#1}{#2}\fi}}
-
-\def\MPllx{0}
-\def\MPlly{0}
-
-% \def\placeMPgraphic%
-% {\ifMPshiftdrawing
-% \hbox{\hskip\MPllx\onebasepoint\raise\MPlly\onebasepoint\box\MPgraphicbox}%
-% \else
-% \box\MPgraphicbox
-% \fi}
-%
-% experimental:
-
-\def\placeMPgraphic
- {\ifMPshiftdrawing
- \edef\next
- {\wd\MPgraphicbox\the\wd\MPgraphicbox
- \ht\MPgraphicbox\the\ht\MPgraphicbox
- \dp\MPgraphicbox\the\dp\MPgraphicbox}%
- \setbox\MPgraphicbox\hbox
- {\hskip\MPllx\onebasepoint\raise\MPlly\onebasepoint\box\MPgraphicbox}%
- \next
- \fi
- \box\MPgraphicbox}
-
-%D \macros
-%D {startreusableMPgraphic, reuseMPgraphic, useMPbox}
-%D
-%D One can use the next macro for defining graphics that are
-%D to be reused. When the next switch is set, graphics are
-%D cached.
-
-\newif\ifuseMPbox \useMPboxtrue
-
-%D We assume that one can set objects:
-%D
-%D \starttyping
-%D \def\douseMPbox#1%
-%D {\setobject{MP}{#1}\vbox
-%D {\forgetall
-%D \loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{}%
-%D \deallocateMPslot\currentMPgraphic
-%D \placeMPgraphic}%
-%D \setgvalue{#1}{\getobject{MP}{#1}}}
-%D \stoptyping
-%D
-%D More safe is to use a number for \type {{MP}{#1}} which permits
-%D redefinition. We also saves the boundingbox. This helps positioning
-%D reused graphics in layers.
-
-\newcount\MPobjectcounter
-
-\ifx\getobject\undefined \def\setobject#1#2{\setbox\scratchbox} \fi % makes dep check happy
-\ifx\getobject\undefined \def\getobject#1#2{\box \scratchbox} \fi % makes dep check happy
-
-\def\douseMPbox#1%
- {\global\advance\MPobjectcounter\plusone
- \setobject{MP}{\number\MPobjectcounter}\vbox
- {\forgetall
- \loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{}%
- \deallocateMPslot\currentMPgraphic
- \placeMPgraphic}%
- \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}%
- {\noexpand\forgetall
- \noexpand\loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{}%
- \noexpand\deallocateMPslot{\currentMPgraphic}%
- \noexpand\placeMPgraphic}}
-
-\ifCONTEXT \else \let\douseMPbox\nouseMPbox \fi
-\ifCONTEXT \else \let\doifobjectssupportedelse\relax \fi
-
-\long\def\handlereusableMPgraphic#1#2%
- {\blabelgroup
- \enableincludeMPgraphics
- \startMPgraphic#2\stopMPgraphic
- \doifobjectssupportedelse\donothing\useMPboxfalse
- \ifuseMPbox
- \expandafter \douseMPbox
- \else
- \expandafter \nouseMPbox
- \fi {\@@MPG#1}%
- \getvalue{\@@MPG#1}%
- \elabelgroup}
-
-% \long\def\startreusableMPgraphic#1#2\stopreusableMPgraphic
-% {\ifundefined{\@@MPG#1}%
-% \long\setgvalue{\@@MPG#1}{\handlereusableMPgraphic{#1}{#2}}%
-% \fi}
-
-\long\def\dostartreusableMPgraphic#1#2\stopreusableMPgraphic
- {\blabelgroup
- \long\setgvalue{\@@MPG#1}{\handlereusableMPgraphic{#1}{#2}}%
- \elabelgroup}
-
-\def\reuseMPgraphic#1%
- {\blabelgroup
- \getvalue{\@@MPG#1}%
- \elabelgroup}
-
-\let\stopreusableMPgraphic \relax % so that we can use it in \expanded
-
-%D \macros
-%D {startuseMPgraphic,useMPgraphic}
-%D
-%D The every||time||it's||used original one is defined below.
-%D This one makes sense when the graphic uses random numbers.
-%D
-%D We can run (process graphic) without including them at that
-%D particular place. Therefore we explicitly disable
-%D inclusions (resulting in an dummy figure) when we are in MP
-%D run mode (see mfun-004 for an example, we process an
-%D example buffer which produced graphics).
-
-\long\def\handleuseMPgraphic#1#2%
- {\bgroup
- \enableincludeMPgraphics
- \startMPgraphic#2\stopMPgraphic
- \ifMPrun \else
- \loadMPgraphic{\MPgraphicfile.\the\currentMPgraphic}{}%
- \placeMPgraphic
- \fi
- \deallocateMPslot\currentMPgraphic
- \egroup}
-
-\long\def\startuseMPgraphic
- {\blabelgroup
- \obeyMPlines
- \dostartuseMPgraphic}
-
-\long\def\dostartuseMPgraphic#1#2\stopuseMPgraphic
- {\long\setgvalue{\@@MPG#1}{\handleuseMPgraphic{#1}{#2}}%
- \elabelgroup}
-
-\long\def\startusableMPgraphic
- {\blabelgroup
- \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
-%D For (mainly internal) purposes we provide a test macro.
-
-% \def\doifMPgraphicelse#1%
-% {\doifdefinedelse{\@@MPG#1}}
-
-\def\doifMPgraphicelse#1%
- {\blabelgroup
- \doifdefinedelse{\@@MPG#1}%
- {\elabelgroup\firstoftwoarguments}
- {\elabelgroup\secondoftwoarguments}}
-
-%D \macros
-%D {includeMPgraphic}
-%D
-%D In a graphic one can call up another (predefined one)
-%D like:
-%D
-%D \starttyping
-%D \startuseMPgraphic{a}
-%D fill fullcircle scaled 100 ;
-%D \stopuseMPgraphic
-%D
-%D \startuseMPgraphic{b}
-%D \includeMPgraphic{a}
-%D fill fullsquare rotated 45 scaled 50 withcolor red ;
-%D \stopuseMPgraphic
-%D
-%D \useMPgraphic{b}
-%D \stoptyping
-
-\def\includeMPgraphic#1%
- {\executeifdefined{\@@MPG#1};} % ; if not found
-
-\def\enableincludeMPgraphics
- {\let\handleuseMPgraphic \secondoftwoarguments
- \let\handlereusableMPgraphic\secondoftwoarguments}
-
-%D We didn't yet define the macro responsible for processing
-%D the graphic from within \TEX.
-
-\def\runMPgraphic#1%
- {\ifrunMPgraphics
- \executeMETAPOST{#1}%
- \else
- % \message{[flush and process \MPgraphicfile.mp afterwards]}%
- \fi}
-
-%D \macros
-%D {useMETAFUNformat}
-%D
-%D For faster running, one can generate a format, saying
-%D
-%D \starttyping
-%D mpost -ini context
-%D \stoptyping
-%D
-%D (The resulting \type {mem} file should be moved to the
-%D right location. Watch out for misatching \type {progname}
-%D directives, since they can clutter memory.
-
-\newif\ifuseMETAFUNformat
-
-%D \macros
-%D {executeMetaPost, executeMETAPOST, executesystemcommand}
-%D
-%D With \type{\executeMETAPOST} being defined as:
-
-\ifx\undefined\executeMETAPOST
- \def\executeMETAPOST#1{\executesystemcommand{\executeMetaPost{#1}}}
-\fi
-
-%D There are two system dependant definitions:
-
-\ifx\undefined\executesystemcommand
- \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 {-interaction=batchmode} % was -int, but newer mpost does not support partial flags
- \def\MPOSTnonstopswitch {-interaction=nonstopmode} % was -int, but newer mpost does not support partial flags
- \def\MPOSTformatswitch {-progname=metafun -mem=}
- \def\MPOSTdriver {dvips}
-
- \def\executeMPOST#1% direct call
- {mpost
- \ifcase\interactionmode\MPOSTbatchswitch\or\MPOSTnonstopswitch\fi
- \space\ifuseMETAFUNformat \MPOSTformatswitch metafun \fi #1}
-
- \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}
-
- \def\executeMetaPost
- {\ifrunMPTEXgraphics
- \ifMPTEXgraphic
- \@EAEAEA\executeMPTEX
- \else
- \@EAEAEA\executeMPOST
- \fi
- \else
- \@EA\executeMPOST
- \fi}
-
-\fi
-
-%D The batchmode and nonstopmode (introduced in 2003 for
-%D Patrick Gundlach) switches may differ per binary and are
-%D supported by \TEXEXEC.
-
-%D \macros
-%D {insertMPfile}
-%D
-%D One can define this command in advance or redefine it after
-%D loading this module. The same goes for the forward
-%D reference to the figure loading macro:
-
-\ifx\undefined\insertMPfile
-
- \def\insertMPfile#1#2%
- {\ifx\undefined\externalfigure
- \message{[insert file #1 here]}%
- \else
- \externalfigure
- [#1]
- [\c!type=\c!mps,\c!object=\v!no,
- \c!symbol=\v!yes,\c!reset=\v!yes,
- \c!maxwidth=,\c!maxheight=,
- \c!frame=\v!off,\c!background=,
- #2]%
- \fi}
-
-\fi
-
-%D This macro takes {\em two} arguments, the second one can be
-%D used to pass info to the inclusion macro. Some examples
-%D of its use can be found in the modules \type{supp-tpi} and
-%D \type{prag-log}.
-
-%D This module can be used in \PLAIN\ \TEX too. When using
-%D \DVIPS, just try to process:
-%D
-%D \starttyping
-%D \input supp-mps
-%D
-%D \runMPgraphicstrue
-%D
-%D \def\insertMPfile#1#2%
-%D {\special{psfile=#1}}
-%D
-%D \startuseMPgraphic{1}
-%D prologues := 1;
-%D draw (0,0) withpen pencircle scaled 100;
-%D \stopuseMPgraphic
-%D
-%D \useMPgraphic{1}
-%D \stoptyping
-%D
-%D Don't forget to enable \type{\write18}. When does not say
-%D \type{\runMPgraphicstrue}, the \METAPOST\ scratch file
-%D must be closed by saying
-%D
-%D \starttyping
-%D \flushMPgraphics
-%D \stoptyping
-%D
-%D When using the indirect method, one has to process the file
-%D \type{mpgraph.mp} between two successive \TEX\ runs.
-%D
-%D \METAPOST\ needs the public domain \DVI\ to \POSTSCRIPT\
-%D converter \DVIPS. This symbiosis originates in the need to
-%D include the fonts (glyphs) that \METAPOST\ uses in the
-%D \POSTSCRIPT\ file. Driver independancy was one of my
-%D prerequisites for using \METAPOST, so I decided to build
-%D this kind of support myself. Personally I consider driver
-%D dependancy a drawback for the dissemination of such a
-%D package. The second part of this module more or less
-%D decouples \METAPOST\ and \DVIPS.
-%D
-%D The macros hereafter are copied from the module
-%D \type{m-metapost}. After writing module \type{supp-pdf} I
-%D added this method to the module named and after a while
-%D decided to hook it into module \type{spec-yy}. Therefore
-%D they made it into a support module, but in a slightly
-%D different way.
-
-%D \macros
-%D {includeMPfonts, ifincludeMPfonts}
-%D
-%D The method we use is both robust and simple: one can do
-%D with calling the next macro with the filename as argument:
-%D
-%D \starttyping
-%D \includeMPfonts{filename}
-%D \stoptyping
-%D
-%D We can turn of this mechanism with:
-%D
-%D \starttyping
-%D \includeMPfontsfalse
-%D \stoptyping
-%D
-%D {\em Currently this method fails for situations where the
-%D font definition is not on one line, which is he case when
-%D unkerned fonts are used along with long lines. One solution
-%D for this is to increase the value of \type {max_print_line}
-%D in \type {texmf.cnf}.}}
-
-\newif\ifincludeMPfonts \includeMPfontstrue
-
-\def\includeMPfonts#1%
- {\ifincludeMPfonts
- \bgroup
- \message{[MP fonts #1]}%
- %\uncatcodespecials
- \endlinechar\minusone
- \setMPspecials
- \obeyMPspecials
- \setbox\scratchbox\hbox
- {\hskip-\maxdimen
- \doprocessfile\scratchread{#1}\handleMPfont}%
- \smashbox\scratchbox
- \box\scratchbox
- \egroup
- \fi}
-
-\def\UseMetaPostGraphic {\includeMPfonts} % upward compatible
-\def\DontUseMetaPostGraphics {\includeMPfontsfalse} % upward compatible
-
-%D The characters are collected in a box and moved as far as
-%D possible into the left margin. The resulting box has no
-%D dimensions and can be prepended (appended) to the special
-%D that handles the inclusion. The characters are in the file
-%D but made invisible.
-%D
-%D In \CONTEXT\ font handling is intergrated in the figure
-%D inclusion macros. A decent plain \TEX\ alternative is:
-%D
-%D \starttyping
-%D \def\includeMPgraphic#1%
-%D {\hbox\bgroup
-%D \includeMPfonts{#1}%
-%D \dogetEPSboundingbox{#1}{\dimen2}{\dimen4}{\dimen6}{\dimen8}%
-%D \advance\dimen6 by -\dimen2
-%D \advance\dimen8 by -\dimen4
-%D \vbox to \dimen8
-%D {\forgetall
-%D \vfill
-%D \hsize\dimen6
-%D \special
-%D {PSfile="#1"\space
-%D llx=\EPSllx\space
-%D lly=\EPSlly\space
-%D urx=\EPSurx\space
-%D ury=\EPSury\space}}%
-%D \egroup}
-%D \stoptyping
-%D
-%D This macro needs \type {supp-eps.tex} and provided no
-%D scaling. For \LATEX\ users the next one will do:
-%D
-%D \starttyping
-%D \def\includeMPgraphic#1#%
-%D {\hbox\bgroup
-%D \def\includeMPgraphics##1%
-%D {\includeMPfonts{##1}%
-%D \includegraphics[typetype=mps,#1]{##1}% or whatever type they use
-%D \egroup}%
-%D \includeMPgraphics}
-%D \stoptyping
-
-%D We scan the graphics file for the \type{fshow} operator,
-%D that is, lines that start with \type{(}. If found it
-%D interprets the line, which looks like:
-%D
-%D \starttyping
-%D (string ... string) font size fshow
-%D \stoptyping
-%D
-%D Font definitions specified in the preamble are simply
-%D ignored. Only lines starting with \type{(} are interpreted.
-
-\def\dohandleMPfont#1#2\relax
- {\if#1(\expandafter\includeMPcharacters\fileline\relax\fi}
-
-\def\handleMPfont
- {\expandafter\dohandleMPfont\fileline\relax}
-
-%D Before we start scanning for data, we first change some
-%D \CATCODES. The first set of macro's is copied from module
-%D \type{supp-pdf}. This scheme is a bit overdone for this
-%D module, but using the same macros saves us some memory.
-
-\def\octalMPcharacter#1#2#3%
- {\char'#1#2#3\relax}
-
-\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 The lines starting with \type{(} are interpreted and
-%D handled by
-%D
-%D \starttyping
-%D \def\includeMPcharacters(#1) #2 #3 #4\relax%
-%D {\font\temp=#2 at #3bp\temp#1}
-%D \stoptyping
-%D
-%D While processing some \TUG~98 proceedings, I also had to
-%D deal with:
-%D
-%D \starttyping
-%D /nfont {10 div dup scale 10} def
-%D (T) ANTTB 7.13086 nfont fshow
-%D \stoptyping
-%D
-%D which comes to rounding sizes. This is something
-%D experimental. (The macro in supp-pdf.tex is more
-%D advanced.)
-
-\def\PSnfont{nfont}
-
-\def\includeMPcharacters(#1) #2 #3 #4#5#6#7#8#9\relax
- {\edef\temp{#4#5#6#7#8}%
- \ifx\temp\PSnfont % round font size (to pt)
- \scratchdimen#3\onepoint
- \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{#3bp}%
- \fi
- \font\temp=#2 at \size
- \temp\if#1 \char32\else#1\fi}
-
-%D This method is both robust and reasonable fast. The only
-%D disadvantage is that when not embedded properly in the
-%D graphics inclusion macros, one has to load all graphics by
-%D hand.
-
-%D Now let's see if things work all right and show the example
-%D files that are part of the \METAPOST\ distribution:
-%D
-%D \setupexternalfigures[directory={../sample}]
-%D \startlinecorrection
-%D \setupalign[middle]
-%D \leavevmode
-%D \startcombination[3*3]
-%D {\externalfigure[mp-exa-1][frame=on,width=.2\hsize]} {}
-%D {\externalfigure[mp-exa-2][frame=on,width=.2\hsize]} {}
-%D {\externalfigure[mp-exa-3][frame=on,width=.2\hsize]} {}
-%D {\externalfigure[mp-exa-4][frame=on,width=.2\hsize]} {}
-%D {\externalfigure[mp-exa-5][frame=on,width=.2\hsize]} {}
-%D {\externalfigure[mp-exa-6][frame=on,width=.2\hsize]} {}
-%D {\externalfigure[mp-exa-7][frame=on,width=.2\hsize]} {}
-%D {\externalfigure[mp-exa-8][frame=on,width=.2\hsize]} {}
-%D {\externalfigure[mp-exa-9][frame=on,width=.2\hsize]} {}
-%D \stopcombination
-%D \stoplinecorrection
-%D
-%D Here we used calls like:
-%D
-%D \starttyping
-%D \externalfigure[mp-exa-1][methode-mps,frame=on,width=.2\hsize]
-%D \stoptyping
-
-%D \macros
-%D {convertMPcolors,
-%D ifconvertMPcolors,ifreduceMPcolors,ifforceMPcolors}
-%D
-%D When I told the editors that I wanted to use colored
-%D \METAPOST\ graphics in the color issue of the \MAPS, I was
-%D asked to use the \cap{CMYK} colorspace instead of \cap{RGB}
-%D one. However, \METAPOST\ only supports \cap{RGB} colors. I
-%D decided to write a utility to convert the \type
-%D {setrgbcolor} operators into \type {setcmykcolor} ones, and
-%D some experiments showed me that I could best let \TEX\ do it
-%D itself. Here it is:
-%D
-%D There are two booleans that control the conversion process.
-%D These are false by default.
-
-\newif\ifconvertMPcolors
-\newif\ifreduceMPcolors
-\newif\ifforcegrayMPcolors
-
-%D The main macro is called as:
-%D
-%D \starttyping
-%D \convertMPcolors{filename}
-%D \stoptyping
-%D
-%D When active, this macro returns a message saying if indeed
-%D conversion took place. The old file is overwritten! This
-%D saves time in a succesive passes and can't harm, simply
-%D because MP can generate them anew.
-
-\def\convertMPcolorpath{}
-\def\convertMPcolorfile{metacmyk.tmp}
-
-\def\convertMPcolors#1% todo: open on local path, no copy
- {\bgroup
- \ifforcegrayMPcolors
- \donetrue
- \else\ifconvertMPcolors
- \donetrue
- \else
- \donefalse
- \fi\fi
- \ifdone
- \message{[MP color conversion #1}%
- \endlinechar\minusone
- \uncatcodespecials
- \donefalse
- \immediate\openout\scratchwrite\convertMPcolorpath\convertMPcolorfile\relax
- \doprocessfile\scratchread{#1}\handleMPcolor
- \immediate\closeout\scratchwrite
- \ifdone
- \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\closeout\scratchwrite
- \fi
- \egroup}
-
-%D The process is rather simple: read a line, look for the
-%D \type {setrgbcolor} operator, recalculate the components and
-%D check for gray reduction or black removal, write the result
-%D to a temporary file, and go on. Afterwards, the file is
-%D copied back. We don't have to reduce to gray scales;
-%D \METAPOST\ already takes care of that.
-
-%D The next macro is needed for forced conversion. This macro
-%D is copied from \type{colo-ini}, just in case one uses this
-%D module outside \CONTEXT.
-
-\ifx\@@cl@@s \undefined \def\@@cl@@s{0} \fi
-
-\ifx\convertRGBtoGRAY\undefined
-
-\def\convertRGBtoGRAY#1#2#3%
- {\scratchdimen#1\onepoint
- \scratchdimen300\scratchdimen
- \scratchcounter\scratchdimen
- \scratchdimen#2\onepoint
- \scratchdimen590\scratchdimen
- \advance\scratchcounter \scratchdimen
- \scratchdimen#3\onepoint
- \scratchdimen110\scratchdimen
- \advance\scratchcounter \scratchdimen
- \advance\scratchcounter \!!medcard
- \divide\scratchcounter \!!maxcard
- \edef\@@cl@@s{\realcolorvalue\scratchcounter}}
-
-\fi
-
-%D BTW, this code is quite old, and not as complete as the
-%D \PDF\ converter, which also handles spot colors and so.
-
-\def\handleMPcolor
- {\expandafter\dohandleMPcolor\fileline setrgbcolor*\\}
-
-\def\dohandleMPcolor#1setrgbcolor#2#3\\%
- {\if#2*%
- \immediate\write\scratchwrite{#1}%
- \else
- \dodohandleMPcolor#1setrgbcolor#2#3\\%
- \fi}
-
-\def\dodohandleMPcolor#1 #2 #3setrgbcolor#4setrgbcolor*\\% old and maybe broke
- {\bgroup
- \ifdim#1pt=.123pt
- \immediate\write\scratchwrite{#1 #2 #3 setrgbcolor}%
- \else
- \ifforcegrayMPcolors
- \convertRGBtoGRAY{#1}{#2}{#3}%
- \immediate\write\scratchwrite
- {\@@cl@@s \space setgray #4}%
- \else
- \dimen0=\onepoint \advance\dimen0 -#1\points
- \dimen2=\onepoint \advance\dimen2 -#2\points
- \dimen4=\onepoint \advance\dimen4 -#3\points
- \ifreduceMPcolors
- \dimen6\dimen0
- \ifdim\dimen2<\dimen6 \dimen6\dimen2 \fi
- \ifdim\dimen4<\dimen6 \dimen6\dimen4 \fi
- \advance\dimen0 -\dimen6
- \advance\dimen2 -\dimen6
- \advance\dimen4 -\dimen6
- \else
- \dimen6\zeropoint
- \fi
- \immediate\write\scratchwrite
- {\withoutpt\the\dimen0 \space
- \withoutpt\the\dimen2 \space
- \withoutpt\the\dimen4 \space
- \withoutpt\the\dimen6 \space setcmykcolor #4}%
- \fi
- \fi
- \egroup
- \donetrue} % needed for message
-
-\def\handleMPcopy
- {\immediate\write\scratchwrite{\fileline}}
-
-%D The next examples show the color conversion macros in
-%D action. These examples also demonstrate in||text \METAPOST\
-%D handling. As we will see, the conversion is hooked into the
-%D \CONTEXT\ color mechanism.
-%D
-%D By setting both \type{rgb} and \type{cmyk} to off, we force
-%D conversion to gray scales using:
-%D
-%D \placeformula[-]
-%D \startformula
-%D G = .30r + .59g + .11b
-%D \stopformula
-%D
-%D By using buffers, we keep the \ASCII\ layout clean:
-%D
-%D \startbuffer
-%D \startbuffer[rgb]
-%D \setupcolors[rgb=ja,cmyk=nee,reduction=no,conversion=no]
-%D \useMPgraphic{hans}
-%D \stopbuffer
-%D
-%D \startbuffer[cmyk]
-%D \setupcolors[rgb=nee,cmyk=ja,reduction=no,conversion=no]
-%D \useMPgraphic{hans}
-%D \stopbuffer
-%D
-%D \startbuffer[cmy]
-%D \setupcolors[rgb=nee,cmyk=ja,reduction=yes,conversion=no]
-%D \useMPgraphic{hans}
-%D \stopbuffer
-%D
-%D \startbuffer[gray]
-%D \setupcolors[rgb=nee,cmyk=nee,reduction=no,conversion=no]
-%D \useMPgraphic{hans}
-%D \stopbuffer
-%D \stopbuffer
-%D
-%D \typebuffer
-%D \getbuffer
-%D
-%D The graphic is rather simple and is generated each time
-%D it's called:
-%D
-%D \global\runMPgraphicstrue
-%D
-%D \startbuffer
-%D \startbuffer[graphic]
-%D \startuseMPgraphic{hans}
-%D width :=\the\textwidth/5;
-%D height := width/4;
-%D fill fullcircle
-%D xscaled width
-%D yscaled height
-%D withcolor (\RedGreenBlue);
-%D \stopuseMPgraphic
-%D \stopbuffer
-%D \stopbuffer
-%D
-%D \typebuffer
-%D \getbuffer
-%D
-%D Next we combine the four alternative interpretations in a
-%D combination:
-%D
-%D \startbuffer
-%D \startbuffer[result]
-%D \startcombination[4]
-%D {\getbuffer[rgb]} {\tfxx original}
-%D {\getbuffer[cmyk]} {\ttxx\string\convertMPcolorstrue}
-%D {\getbuffer[cmy]} {\ttxx\string\reduceMPcolorstrue}
-%D {\getbuffer[gray]} {\ttxx\string\forcegrayMPcolorstrue}
-%D \stopcombination
-%D \stopbuffer
-%D \stopbuffer
-%D
-%D \typebuffer
-%D \getbuffer
-%D
-%D Finally we call the buffers, using different setting:
-%D
-%D \startbuffer
-%D \placefigure
-%D {\METAPOST\ color conversions}
-%D {\def\RedGreenBlue{.1,.4,.6}\getbuffer[graphic]\getbuffer[result]\vskip6pt
-%D \def\RedGreenBlue{.1,.6,.4}\getbuffer[graphic]\getbuffer[result]\vskip6pt
-%D \def\RedGreenBlue{.4,.1,.6}\getbuffer[graphic]\getbuffer[result]\vskip6pt
-%D \def\RedGreenBlue{.4,.6,.1}\getbuffer[graphic]\getbuffer[result]\vskip6pt
-%D \def\RedGreenBlue{.6,.1,.4}\getbuffer[graphic]\getbuffer[result]\vskip6pt
-%D \def\RedGreenBlue{.6,.4,.1}\getbuffer[graphic]\getbuffer[result]}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D \getbuffer
-%D
-%D By the way, when the \POSTSCRIPT\ file resulting from
-%D this input is converted into \PDF\ and viewed in Acrobat
-%D Reader, one can quite different colors from those
-%D displayed in \GHOSTSCRIPT, which view equals the
-%D \POSTSCRIPT\ originals.
-
-%D \macros
-%D {experimental}
-%D
-%D Some experimental macros:
-%D
-%D \starttyping
-%D \startMPdrawing
-%D \stopMPdrawing
-%D \pushMPdrawing
-%D \popMPdrawing
-%D \resetMPdrawing
-%D \ifMPdrawingdone
-%D \getMPdrawing
-%D \MPdivten[number]
-%D \stoptyping
-%D
-%D These macros are used in \PPCHTEX.
-
-\let\MPdrawingdata\empty
-
-\newif\ifMPdrawingdone \MPdrawingdonefalse
-\newif\ifMPshiftdrawing \MPshiftdrawingfalse
-
-\def\resetMPdrawing
- {\globallet\MPdrawingdata\empty
- \global\MPdrawingdonefalse}
-
-% why global push/pop here?
-
-\def\pushMPdrawing
- {\globalpushmacro\MPdrawingdata
- \globallet\MPdrawingdata\empty}
-
-\def\popMPdrawing
- {\globalpopmacro\MPdrawingdata}
-
-\def\getMPdrawing
- {\ifMPdrawingdone
- \expandafter\startMPgraphic\MPdrawingdata\stopMPgraphic
- \loadcurrentMPgraphic{}%
- \deallocateMPslot\currentMPgraphic
- \placeMPgraphic
- \fi}
-
-\def\startMPdrawing
- {\dosingleempty\dostartMPdrawing}
-
-\long\def\dostartMPdrawing[#1]#2\stopMPdrawing
- {\relax
- \bgroup
- \enableincludeMPgraphics
- \presetMPdefinitions % in case #2 has measures
- \doifelse{#1}{-}{\convertargument#2\to\asciia}{\long\def\asciia{#2}}%
- \long\xdef\MPdrawingdata{\MPdrawingdata\asciia}%
- \egroup}
-
-\let\stopMPdrawing\relax
-
-\def\MPdivten[#1]%
- {\@EA\@EA\@EA\doMPdivten\@EA\@EA\@EA[\@EA#1]}
-
-\def\doMPdivten[#1]%
- {\ifnum#1> 9999 \dodoMPdivtenB#1\else
- \ifnum#1> 999 \dodoMPdivtenC#1\else
- \ifnum#1> 99 \dodoMPdivtenD#1\else
- \ifnum#1> 9 \dodoMPdivtenE#1\else
- \ifnum#1> 0 \dodoMPdivtenF#1\else
- \ifnum#1<-9999 \dodoMPdivtenA#1\else
- \ifnum#1< -999 \dodoMPdivtenB#1\else
- \ifnum#1< -99 \dodoMPdivtenC#1\else
- \ifnum#1< -9 \dodoMPdivtenD#1\else
- \ifnum#1< 0 \dodoMPdivtenE#1\else
- 0 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
-
-\def\dodoMPdivtenA#1#2#3#4#5#6{#1#2#3#4#5.#6}
-\def\dodoMPdivtenB #1#2#3#4#5{#1#2#3#4.#5}
-\def\dodoMPdivtenC #1#2#3#4{#1#2#3.#4}
-\def\dodoMPdivtenD #1#2#3{#1#2.#3}
-\def\dodoMPdivtenE #1#2{#1.#2}
-\def\dodoMPdivtenF #1{.#1}
-
-% if we assume etex ... \def\MPdivten[#1]{\withoutpt\the\dimexpr#1pt/10\relax}
-
-%D \macros
-%D {startMPclip,grabMPclippath}
-%D
-%D We can use \METAPOST\ to calculate arbitrary clipping
-%D paths. Such a path is defined by (for instance):
-%D
-%D \starttyping
-%D \startMPclip{window}
-%D clip currentpicture to fullcircle xscaled \width yscaled \height ;
-%D \stopMPclip
-%D \stoptyping
-%D
-%D Such a path can be extracted (processed) by:
-%D
-%D \starttyping
-%D \grabMPclippath{window}{method}{width}{height}{default path}
-%D \stoptyping
-%D
-%D Currently only method 1 makes sense; it produces \PDF\
-%D code. This macro only makes sense when hooked into a
-%D special routine.
-
-\let\MPclippath\empty
-
-\long\def\startMPclip#1#2\stopMPclip
- {\blabelgroup
- \long\setgvalue{MPC:#1}{\startMPgraphic#2\stopMPgraphic\dograbMPclippath}%
- \elabelgroup}
-
-\let\stopMPclip\relax
-
-\def\grabMPclippath#1#2#3#4#5%
- {\blabelgroup
- \edef\width {#3\space}\let\overlaywidth \width
- \edef\height{#4\space}\let\overlayheight\height
- \doifdefinedelse{MPC:#1}
- {\getvalue{MPC:#1}%
- \setxvalue{MPC:#1}{\noexpand\xdef\noexpand\MPclippath{\MPclippath}}}%
- {\xdef\MPclippath{#5}}%
- \ifcase#2\else % method 1 :
- \doglobal\stripcharacter urveto\from\MPclippath\to\MPclippath
- \doglobal\stripcharacter oveto\from\MPclippath\to\MPclippath
- \doglobal\stripcharacter ineto\from\MPclippath\to\MPclippath
- \fi
- \elabelgroup}
-
-%D We pose some restrictions to the \METAPOST\ code and pickup
-%D the clip path from the file.
-%D
-%D We turn the slash into a comment. The \type {\hbox} grabs spaces
-%D and the \type {%} triggers the grabber. Next we filter the
-%D clipping path, or actually, the first path.
-
-% \bgroup
-% \catcode`\%=\@@active
-% \catcode`\/=\@@comment
-% \gdef\dograbMPclippath/
-% {\setbox\scratchbox=\hbox\bgroup/
-% \catcode`\%=\@@active
-% \obeylines\let\obeyedline\space
-% \def\do##1newpath##2closepath##3\od/
-% {\xdef\MPclippath{##2}\endinput}/
-% \def%##1%%EOF/
-% {\do##1newpathclosepath\od\endinput}/
-% \readfile{\MPgraphicfile.\the\currentMPgraphic}{}{}/
-% \deallocateMPslot\currentMPgraphic / new
-% \egroup}
-% \egroup
-
-\bgroup
-\catcode`\%=\@@active
-\catcode`\/=\@@comment
-\gdef\dograbMPclippath/
- {\setbox\scratchbox=\hbox\bgroup/
- \catcode`\%=\@@active
- \obeylines\let\obeyedline\space
- \def\do##1q n##2p W##3\od/
- {\xdef\MPclippath{##2}\endinput}/
- \def%##1%%EOF/
- {\do##1q np W\od\endinput}/
- \readfile{\MPgraphicfile.\the\currentMPgraphic}{}{}/
- \ifx\MPclippath\empty
- \def\do##1newpath##2closepath##3\od/
- {\xdef\MPclippath{##2}\endinput}/
- \def%##1%%EOF/
- {\do##1newpathclosepath\od\endinput}/
- \readfile{\MPgraphicfile.\the\currentMPgraphic}{}{}/
- \fi
- \deallocateMPslot\currentMPgraphic / new
- \egroup}
-\egroup
-
-%D \macros
-%D {recycleMPslots}
-%D
-%D When coding and embedding many \METAPOST\ figures in a
-%D document, one can save quite some disk space by using
-%D \PDFTEX\ and setting the next switch:
-
-\newif\ifrecycleMPslots \recycleMPslotstrue
-
-%D When a graphic takes space in the text flow, we can run
-%D into deadlock typesetting. In the first pass, the graphic
-%D is not available, but in the second pass it is. The
-%D placeholder that was put there in the first pass in now
-%D replace by the real graphic and as a result the document
-%D shrinks or grows and pages are removed or added. This in
-%D turn can trigger generation of other graphics, like those
-%D in the background. Graphics start swapping place and again
-%D page breaks change. You can imagine the mess we en dup
-%D with.
-%D
-%D This is why we provide was to use a dedicate range if
-%D numbers for fixed graphcs. Such graphics will not en dup
-%D in the text flow (at least their dimensions don't
-%D contribute to the main vertical list, and thereby they
-%D cannot interfere. We use a rather safe maximum of 4000
-%D graphics here and 8000 in \type {meta-ini}.
-
-\newcount \maxnofMPgraphics \maxnofMPgraphics = 4000 % 8000
-\newcount \minnofMPgraphics \minnofMPgraphics = 1
-
-\newif \ifMPstaticgraphic \MPstaticgraphicfalse % determines slot allocation
-
-\def\locateMPslot#1% slightly faster on one slot, much faster on multiple slots
- {\ifundefined{\number#1MP}% no \ifcsname
- \letgvalueempty{\number#1MP}%
- \expandafter\gobbletwoarguments
- \else
- \global\advance#1\plusone
- \fi
- \locateMPslot#1}
-
-\def\allocateMPslot#1%
- {\ifrunMPgraphics
- \ifx\pdfliteral\undefined
- \recycleMPslotsfalse % quite certainly not pdftex
- \else\ifcase\pdfoutput
- \recycleMPslotsfalse % dvi mode or not pdftex (we need to handle dvipdfmx)
- \fi\fi
- \else
- \recycleMPslotsfalse
- \fi
- \ifrecycleMPslots
- % \doloop % slow but used seldom
- % {\doifundefined{\recurselevel MP}
- % {\letgvalueempty{\recurselevel MP}%
- % \global#1\recurselevel
- % \exitloop}}%
- \global#1\plusone
- \locateMPslot#1%
- % \message{[MP slot + \number#1]%
- \else\ifMPstaticgraphic % beware not the same as static graphics
- \global#1\maxnofMPgraphics
- \global\advance\maxnofMPgraphics \minusone
- \else
- \global#1\minnofMPgraphics
- \global\advance\minnofMPgraphics \plusone
- \fi\fi
- \ifnum\minnofMPgraphics<\maxnofMPgraphics \else
- \writestatus\m!systems{increase \string\maxnofMPgraphics}%
- \fi}
-
-\def\deallocateMPslot#1%
- {\ifrunMPgraphics
- \ifcase\pdfoutput \recycleMPslotsfalse \fi
- \else
- \recycleMPslotsfalse
- \fi
- \ifrecycleMPslots
- \global\letbeundefined{\number#1MP}%
- %\message{[MP slot - \number#1]}%
- \fi}
-
-%D Experimental and overloaded later, since we need to be
-%D more clever due to \METAPOST's limit of 4~open files.
-
-\def\MPdatafile
- {mp-\the\currentMPgraphic.mpd}
-
-\def\getMPdata
- {\input \MPdatafile\relax}
-
-%D \macros
-%D {MPtoks, MPbox}
-%D
-%D For convenience, we provide some scratch registers:
-
-\ifx\undefined\MPtoks \newtoks\MPtoks \fi
-\ifx\undefined\MPbox \newbox \MPbox \fi
-
-%D \macros
-%D {startMPcode}
-%D
-%D We can save some typing with:
-%D
-%D \starttyping
-%D \startMPcode whatever \stopMPcode
-%D \stoptyping
-%D
-%D this automatically places the graphic
-
-\long\def\startMPcode
- {\begingroup
- \obeyMPlines
- \dostartMPcode}
-
-\long\def\dostartMPcode#1\stopMPcode
- {\startuseMPgraphic{@@}#1\stopuseMPgraphic
- \useMPgraphic{@@}%
- \endgroup}
-
-\let\stopMPcode\relax
-
-%D \macros
-%D {startstaticMPgraphic}
-%D
-%D Dedicated to Aditya Mahajan. See meta-ini for usage.
-
-% \long\def\startstaticMPgraphic#1#2\stopstaticMPgraphic
-% {\bgroup
-% \MPstaticgraphictrue
-% \setMPrandomseedfalse
-% \def\MPgraphicfile{#1}% no \jobname here
-% \let\allocateMPslot \gobbleoneargument
-% \let\deallocateMPslot\gobbleoneargument
-% \let\runMPgraphic \gobbleoneargument
-% \MPextensions\emptytoks
-% \MPinitializations\emptytoks
-% \runMPgraphicstrue
-% \MPwrapperfalse
-% \enableincludeMPgraphics
-% \def\sometxt##1{\string\sometxt{##1}}%
-% \currentMPgraphic\plusone % hack, else no close
-% \startMPgraphic#2\stopMPgraphic
-% \executeMPgraphicfile
-% \egroup}
-
-% different version, less messy hooked into the rest
-
-\long\def\startstaticMPgraphic#1#2\stopstaticMPgraphic
- {\blabelgroup
- \def\MPgraphicfile{#1}% no \jobname here
- \let\MPwrite\MPstaticwrite
- \immediate\openout\MPwrite=\MPgraphicfile.mp
- \setMPrandomseedfalse
- \enableincludeMPgraphics
- \def\sometxt##1{\string\sometxt{##1}}%
- \the\everyMPgraphic
- \presetMPdefinitions
- \theMPinclusions % brrr
- \writeMPgraphic{\letterpercent mpenvironment: \the\everyMPTEXgraphic}%
- \writeMPgraphic{beginfig(1);}%
- \writeMPgraphic{#2}%
- \writeMPgraphic{endfig; end.}%
- \immediate\closeout\MPwrite
- \executeMPgraphicfile
- \elabelgroup}
-
-% this will go to meta-ini
-
-\def\delaysystemcommand
- {\ifx\installprogram\undefined
- \expandafter\executesystemcommand
- \else
- \expandafter\installprogram
- \fi}
-
-\def\MPgraphicfilerunner
- {texmfstart --ifchanged=\MPgraphicfile.mp texexec --mpstatic \MPgraphicfile.mp}
-
-\ifx\doifmode\undefined
- \def\executeMPgraphicfile
- {\ifrunMPgraphics\@EA\executesystemcommand\else\@EA\delaysystemcommand\fi{\MPgraphicfilerunner}}
-\else
- \def\executeMPgraphicfile{\doifmode{*\v!first}
- {\ifrunMPgraphics\@EA\executesystemcommand\else\@EA\delaysystemcommand\fi{\MPgraphicfilerunner}}}
-\fi
-
-%D Special for \XETEX\ (problem with newlines). This will go
-%D away once the version supporting \type {--8bit} is
-%D widespread.
-
-\ifnum\texengine=\xetexengine
- \let\obeyMPlines\relax
- \longMPlinesfalse % alas
-\fi
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/supp-mrk.mkii b/Master/texmf-dist/tex/context/base/mkii/supp-mrk.mkii
deleted file mode 100644
index b9d476c2a7c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/supp-mrk.mkii
+++ /dev/null
@@ -1,591 +0,0 @@
-%D \module
-%D [ file=supp-mrk,
-%D version=1995.10.10,
-%D title=\CONTEXT\ Support Macros,
-%D subtitle=Marks,
-%D author=Jim Fox / Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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: due to the lack of \type {\clearmark}, the \ETEX\
-%D dedicated mechanism is not yet operational.
-
-%D This module has deverted so much from the original that I
-%D can probably rewrite it to a more efficient one now and
-%D I will do so.
-
-%D There are 256 \COUNTERS, \DIMENSIONS, \SKIPS, \MUSKIPS\ and
-%D \BOXES, 16~in- and output buffers, but there is only one
-%D \MARK. In TugBoat~8 (1987, no~1) Jim Fox presents a set of
-%D macros that can be used to mimmick multiple marks. We
-%D gladly adopt them here. I may rewrite this module from
-%D scratch some day, since some low level \CONTEXT\ commands
-%D can be used.
-%D
-%D This module was changed on behalf of \ETEX. The main
-%D extension is that \type{\get..} and alike is used instead of
-%D direct calls. The \TEX\ based multiple marks needs to store
-%D the mark data but \ETEX\ uses a different approach.
-
-\writestatus{loading}{ConTeXt Support Macros / Marks}
-
-\unprotect
-
-%D We start with the presetting the interface macros.
-%D
-%D \starttabulate[|||]
-%D \NC \type{\getmarks} \NC sets the marks to their values \NC \NR
-%D \NC \type{\getallmarks} \NC sets all marks to their values \NC \NR
-%D \NC \type{\getsplitmarks} \NC sets the splitmarks to their values\NC \NR
-%D \NC \type{\getallsplitmarks} \NC sets all splitmarks to their values\NC \NR
-%D \NC \type{\setmarks} \NC synchronizes topmarks (\ETEX) \NC \NR
-%D \stoptabulate
-%D
-%D Later we will overload these, dependent of the brand of
-%D \TEX\ that we use.
-
-\let \getmarks \gobbleoneargument
-\let \getallmarks \relax
-\let \getsplitmarks \gobbleoneargument
-\let \getallsplitmarks \relax
-\let \setallmarks \relax
-
-\let \newmark \gobbleoneargument
-\let \newpersistentmark \gobbleoneargument
-\let \resetmark \gobbleoneargument
-\let \setmark \gobbletwoargument
-
-%D \macros
-%D {expandmarks}
-%D
-%D We can force expansion of marks with the following switch.
-
-\newif\ifexpandmarks \expandmarkstrue % hm, true indeed ?
-
-\beginTEX
-
-%D This implementation is more or less compatible with the
-%D other \type {\new} macros in \PLAIN\ \TEX. A mark is
-%D defined by:
-%D
-%D \starttyping
-%D \newmark\name
-%D \stoptyping
-%D
-%D and can be called upon with:
-%D
-%D \starttyping
-%D \gettopmark \name % or \topname
-%D \getbotmark \name % or \botname
-%D \getfirstmark\name % or \firstname
-%D \stoptyping
-%D
-%D The only drawback of his approach is that the marks must be
-%D preloaded in the output routine. This is accomplished by
-%D means of:
-%D
-%D \starttyping
-%D \getmarks\name
-%D \stoptyping
-%D
-%D The macros presented here are in most aspects copies of
-%D those presented by Jim Fox. We've taken the freedom to
-%D change a few things for more or less obvious reasons:
-%D
-%D \startitemize
-%D \item Because the original macros look quite complicated,
-%D which is mainly due to extensive use of
-%D \type{\expandafter}'s and \type{\csname}'s, we changed
-%D those in favor of \type{\getvalue}.
-%D \item To be more in line with the rest of \CONTEXT, we've
-%D changed some of the names of macros.
-%D \item Because we are already short on \COUNTERS\ we use
-%D macros when possible.
-%D \item We maintain a list of defined marks and use one
-%D call for getting them all at once.
-%D \item We have extended the mechanism to splitmarks (not
-%D perfected yet).
-%D \item We've introduced optional expansion of the contents
-%D of marks.
-%D \stopitemize
-%D
-%D Whatever changes we've made, the credits still go to Jim,
-%D whatever goes wrong is due to me. The method is described
-%D in the TugBoat mentioned before, so we won't go into
-%D details. All marks belonging to a group are packed in a
-%D list. In this list they are preceded by a macro that can
-%D be defined at will and a number concerning the position at
-%D which it was defined.
-%D
-%D \starttyping
-%D \def\somelist{... \domark5{this} ... \domark31{that} ...}
-%D \stoptyping
-%D
-%D The original \type{\mark} keeps track of the number and
-%D \type{\topmark} and \type{\botmark} are used to extract the
-%D actual marks from the list. The counting is done by
-%D
-%D \starttyping
-%D \currentmarker
-%D \stoptyping
-%D
-%D In \CONTEXT\ we use the mark mechanism to keep track of
-%D colors. In a complicated documents with many colors per
-%D page, \type{\currentmarker} can therefore get pretty high.
-%D (Well, this is not completely true, because we don't
-%D always have to use marks.)
-
-\newcount\currentmarker
-
-%D The original implementation used a few more \COUNTERS. Two
-%D have been substituted by macros, one has been replaced by
-%D our scratch counter.
-%D
-%D \starttyping
-%D \newcount\topmarker
-%D \newcount\botmarker
-%D \newcount\foundmarker
-%D \stoptyping
-%D
-%D We've also introduced some constants, one for the lists and
-%D three for composing the mark commands.
-
-\def\@@marklist@@ {*m*} % {marklist}
-\def\@@marktop@@ {*t*} % {top}
-\def\@@markbot@@ {*b*} % {bot}
-\def\@@markfirst@@ {*f*} % {first}
-\def\@@markcurrent@@ {*c*} % {current}
-
-%D The next one is new too. All defined marks are packed in a
-%D comma seperated list. This could of course have been a token
-%D list but \CONTEXT\ has some preference for comma lists.
-
-\let\allmarks=\empty
-
-%D The next macro replaces the multiple step expansion and
-%D command name constructors of Jim. This alternative leads to
-%D a more readable source (we hope).
-
-\def\makemarknames#1% kan genest werken
- {\bgroup
- \escapechar=-1
- \xdef\markname{\string#1}%
- \xdef\marklist{\@@marklist@@\markname}%
- \egroup}
-
-%D \macros
-%D {newmark,resetmark}
-%D
-%D A mark is defined by \type{\newmark}. At the same time,
-%D the name of the mark is added to a commalist. The
-%D three initializations were not in the original design, but
-%D make calls from outside the output routine a bit more
-%D robust.
-
-\let\domark\relax % saves a restore on the stack
-
-\def\definenewmark#1#2%
- {\bgroup
- \makemarknames{#1}%
- #2%
- \letgvalueempty{\@@markcurrent@@\markname}%
- \letgvalueempty{\@@marktop@@ \markname}%
- \letgvalueempty{\@@markfirst@@ \markname}%
- \letgvalueempty{\@@markbot@@ \markname}%
- \setgvalue{\marklist}{\domark0{}}% beware of halfway definitions
- \long\gdef#1{\addmarker#1}%
- \egroup}
-
-\def\newmark#1%
- {\definenewmark#1{\doglobal\addtocommalist\markname\allmarks}}
-
-%D Don't ask me, but sometimes we need more control over
-%D updating the marks, thereby we have:
-
-\def\newpersistentmark#1% for an example see core-grd.tex
- {\definenewmark#1\relax}
-
-\let\setmark \empty
-\let\resetmark\newmark
-
-%D Some more natural interfacing macros:
-
-\def\getcurrentmark #1{\getvalue{\@@markcurrent@@\strippedcsname#1}}
-\def\gettopmark #1{\getvalue{\@@marktop@@ \strippedcsname#1}}
-\def\getbottommark #1{\getvalue{\@@markbot@@ \strippedcsname#1}}
-\def\getfirstmark #1{\getvalue{\@@markfirst@@ \strippedcsname#1}}
-\def\getsplitbottommark#1{\getvalue{\@@markbot@@ \strippedcsname#1}}
-\def\getsplitfirstmark #1{\getvalue{\@@markfirst@@ \strippedcsname#1}}
-
-%D \macros
-%D {setmark}
-%D
-%D Setting a new mark and adding a mark to the designated
-%D list is done by \type{\addmarker}. This is an internal
-%D command, the user set a marks bij calling it's name:
-%D
-%D \starttyping
-%D \setmark\mymark{some text} % or \mymark{some text}
-%D \stoptyping
-%D
-%D Where \type{\mymark} is previously defined by
-%D \type{\newmark}.
-
-\long\def\addmarker#1#2%
- {\bgroup
- \makemarknames{#1}%
- \setgvalue{\@@markcurrent@@\markname}{#2}%
- \global\advance\currentmarker \plusone
- \normalmark{\the\currentmarker}%
- \!!toksa\@EA\@EA\@EA{\csname\marklist\endcsname}%
- \ifexpandmarks
- \setxvalue\marklist
- {\the\!!toksa
- \noexpand\domark
- \the\currentmarker{#2}}%
- \else
- \!!toksb\@EA{#2}% one level, why ? handy for cs
- \setxvalue\marklist
- {\the\!!toksa
- \noexpand\domark
- \the\currentmarker{\the\!!toksb}}%
- \fi
- \egroup}
-
-%D \macros
-%D {getmarks,getallmarks,
-%D getsplitmarks,getallsplitmarks}
-%D
-%D In fact, marks make only sense in the output routine. Marks
-%D are derived from their list by means of \type{\getmarks}.
-%D Only one call per mark is permitted in the output routine.
-%D Therefore, it's far more easy to get them all at once, by
-%D means of \type{\getallmarks}, which is not part of the
-%D original design.
-%D
-%D This grabbing is done by processing the list using the
-%D embedded \type{\domark} macros. When a relevant mark is
-%D found, this macro is reassigned and from then on serves
-%D in building the new list.
-
-% Hm, resetting \!!toksa got lost and took me a half a day to
-% trace down ([] showed up in the pagebody); I really have
-% to clean up this messy module (write it from scratch).
-
-\newif\ifnofirstmarker % an auxiliary switch
-
-\def\getmarks#1%
- {\bgroup
- \makemarknames{#1}%
- \edef\topmarker{0\normaltopmark}%
- \edef\botmarker{0\normalbotmark}%
- \!!toksa\emptytoks
- \!!toksb\emptytoks
- \nofirstmarkertrue
- % does more worse than good
- \let\fi\relax
- \let\or\relax
- \let\else\relax
- %
- \let\domark\doscanmarks
- \getvalue\marklist\lastmark
- %\message{markstatus : [\the\!!toksa\the\!!toksb\the\!!toksc]}%
- \long\setxvalue\marklist{\the\!!toksa\the\!!toksb\the\!!toksc}%
- \egroup}
-
-\def\getsplitmarks#1%
- {\bgroup
- \makemarknames{#1}%
- % \@EA\let\@EA\savedmarklist\@EA\csname\marklist\endcsname
- \edef\topmarker{0\normalsplitfirstmark}%
- \edef\botmarker{0\normalsplitbotmark}%
- \!!toksa\emptytoks
- \!!toksb\emptytoks
- \nofirstmarkertrue
- % does more worse than good
- \let\fi\relax
- \let\or\relax
- \let\else\relax
- %
- \let\domark\doscanmarks
- \getvalue\marklist\lastmark
- % \global\@EA\let\csname\marklist\endcsname\savedmarklist
- \egroup}
-
-\def\getallmarks {\processcommacommand[\allmarks]\getmarks}
-\def\getallsplitmarks{\processcommacommand[\allmarks]\getsplitmarks}
-
-\def\getallmarks {\@EA\processcommalist\@EA[\allmarks]\getmarks}
-\def\getallsplitmarks{\@EA\processcommalist\@EA[\allmarks]\getsplitmarks}
-
-\long\def\dodoscanmarks#1%
- {\ifnum\scratchcounter>\topmarker\relax
- \normalelse
- \long\setgvalue{\@@marktop@@\markname}{#1}%
- \normalfi
- \ifnum\scratchcounter>\botmarker\relax
- \let\domark\dorecovermarks
- \!!toksb\@EA{\@EA\domark\the\scratchcounter{#1}}%
- \normalelse
- \ifnofirstmarker
- \long\setgvalue{\@@markfirst@@\markname}{#1}%
- \ifnum\scratchcounter>\topmarker\relax
- \nofirstmarkerfalse
- \normalfi
- \normalfi
- \long\setgvalue{\@@markbot@@\markname}{#1}%
- \!!toksa\@EA{\@EA\domark\the\scratchcounter{#1}}%
- \normalfi}
-
-\def\doscanmarks
- {\afterassignment\dodoscanmarks\scratchcounter=}
-
-\long\def\dorecovermarks#1\lastmark% nice trick
- {\!!toksc{\domark#1}}
-
-\def\lastmark% rest of trick
- {\!!toksc\emptytoks}
-
-\endTEX
-
-%D The \ETEX\ way of doing things \unknown
-
-\beginETEX \marks cum suis
-
-\newtoks \listofmarks
-
-\def\@@prk{prk:}
-\def\@@mrk{mrk:}
-\def\@@trk{trk:}
-\def\@@frk{frk:}
-\def\@@brk{brk:}
-\def\@@crk{crk:}
-
-%D We will use two state variables per mark, one to signal
-%D that a new mark value is set, and one to trigger (on the
-%D next page) the setting of the top mark.
-
-\def\checkedtopmarks #1{\csname\@@trk\string#1\endcsname}
-\def\checkedfirstmarks#1{\csname\@@frk\string#1\endcsname}
-\def\checkedbotmarks #1{\csname\@@brk\string#1\endcsname}
-\def\thecurrentmarks #1{\csname\@@crk\string#1\endcsname}
-
-\long\def\setmark#1%
- {%\writestatus{marks}{setting \string#1}\wait
- \global\@EA\chardef\csname\@@mrk\string#1\endcsname\plusone
- %\@EA\normalmarks\csname\@@prk\string#1\endcsname{1}%
- \@EA\normalmarks\csname\@@prk\string#1\endcsname{\realfolio}%
- \ifexpandmarks\@EA\setexpandedmark\else\@EA\setnormalmark\fi#1}
-
-\def\setexpandedmark#1#2% % marks expand anyway
- {\@EA\xdef\csname\@@crk\string#1\endcsname{#2}%
- \normalmarks#1{#2}}
-
-\def\setnormalmark#1#2% using a tok prevents unwanted expansion in mark
- {\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
- \endgroup}
-
-\def\checktopmark#1%
- {%\writestatus{marks}{checking \string#1}\wait
- \ifcase\csname\@@mrk\string#1\endcsname\else\dochecktopmark#1\fi}
-
-%\def\dochecktopmark#1%
-% {\ifcase0\@EA\normalfirstmarks\csname\@@prk\string#1\endcsname\else
-% \@EA\ifx\csname\@@frk\string#1\endcsname\empty
-% \@EA\gdef\csname\@@frk\string#1\endcsname{\normalfirstmarks#1}%
-% \@EA\gdef\csname\@@brk\string#1\endcsname{\normalbotmarks #1}%
-% \else
-% \@EA\gdef\csname\@@trk\string#1\endcsname{\normaltopmarks #1}%
-% \global\@EA\chardef\csname\@@mrk\string#1\endcsname\zerocount
-% \fi
-% \fi}
-
-\def\dochecktopmark#1%
- {\ifx*\@EA\normalfirstmarks\csname\@@prk\string#1\endcsname*\else
- \@EA\ifx\csname\@@frk\string#1\endcsname\empty
- \@EA\gdef\csname\@@frk\string#1\endcsname{\normalfirstmarks#1}%
- \@EA\gdef\csname\@@brk\string#1\endcsname{\normalbotmarks #1}%
- \else
- \@EA\gdef\csname\@@trk\string#1\endcsname{\normaltopmarks #1}%
- \global\@EA\chardef\csname\@@mrk\string#1\endcsname\zerocount
- \fi
- \fi}
-
-%\def\resetmark#1% we cannot use \normalmarks#1{}
-% {\global\@EA\chardef\csname\@@mrk\string#1\endcsname\zerocount
-% \@EA\normalmarks\csname\@@prk\string#1\endcsname{0}%
-% \global\@EA\let\csname\@@trk\string#1\endcsname\empty
-% \global\@EA\let\csname\@@frk\string#1\endcsname\empty
-% \global\@EA\let\csname\@@brk\string#1\endcsname\empty
-% \global\@EA\let\csname\@@crk\string#1\endcsname\empty}
-
-\def\resetmark#1% we cannot use \normalmarks#1{}
- {\global\@EA\chardef\csname\@@mrk\string#1\endcsname\zerocount
- \@EA\normalmarks\csname\@@prk\string#1\endcsname{}% {0}%
- \global\@EA\let\csname\@@trk\string#1\endcsname\empty
- \global\@EA\let\csname\@@frk\string#1\endcsname\empty
- \global\@EA\let\csname\@@brk\string#1\endcsname\empty
- \global\@EA\let\csname\@@crk\string#1\endcsname\empty}
-
-\def\definenewmark#1%
- {\ifcsname\@@prk\string#1\endcsname\else % this is etex -)
- \newmarks#1\doglobal\appendtoks\checktopmark#1\to\listofmarks
- \@EA\newmarks\csname\@@prk\string#1\endcsname % status mark
- \fi
- \global\@EA\mathchardef\csname\@@mrk\string#1\endcsname\zerocount
- \global\@EA\let\csname\@@crk\string#1\endcsname\empty
- \@EA\gdef\csname\@@trk\string#1\endcsname{\normaltopmarks #1}%
- \@EA\gdef\csname\@@frk\string#1\endcsname{\normalfirstmarks#1}%
- \@EA\gdef\csname\@@brk\string#1\endcsname{\normalbotmarks #1}}
-
-\let \newmark \definenewmark
-\let \newpersistentmark \newmarks % \definenewmark
-\let \normalsetmark \setmark
-
-\def\getallmarks{\the\listofmarks} % \def\setallmarks{\the\listofmarks}
-
-%D In \type {page-ini} or \type {core-mar} we should say:
-%D
-%D \starttyping
-%D \appendtoks \getallmarks \to \everybeforepagebody
-%D \appendtoks \setallmarks \to \everyafterpagebody
-%D \stoptyping
-
-\let\getcurrentmark \thecurrentmarks
-\let\gettopmark \checkedtopmarks
-\let\getbottommark \checkedbotmarks % \normalbotmarks
-\let\getfirstmark \checkedfirstmarks % \normalfirstmarks
-\let\getsplitbottommark \normalsplitbotmarks
-\let\getsplitfirstmark \normalsplitfirstmarks
-
-\let\getbotmark \getbottommark
-\let\getsplitbotmark \normalsplitbotmarks
-\let\getsplittopmark \normalsplitfirstmarks
-
-\endETEX
-
-%D A couple of goodies:
-
-\let\getbotmark \getbottommark
-\let\getsplitbotmark\getsplitbottommark
-\let\getsplittopmark\getsplitfirstmark
-
-%D \macros
-%D {noninterferingmarks}
-%D
-%D Marks can interfere badly with for instance postprocessing
-%D paragraphs, for instance when we want to grab the last box
-%D using \type {\lastbox}, when at the same time using colors.
-
-\let\normalsetmark\setmark
-
-\def\noninterferingsetmark#1#2%
- {\ifhmode\prewordbreak\hbox\fi{\normalsetmark{#1}{#2}}}
-
-\def\noninterferingmarks
- {\let\noninterferingmarks\relax
- \let\setmark\noninterferingsetmark}
-
-%D This macro is for instance used in the inline headings
-%D postprocessing, as needed when we want to make those
-%D clickable.
-
-%D Right from the beginning, \CONTEXT\ supported more than one
-%D mark, using an extended version of Jim Fox multiple mark
-%D mechanism. In \ETEX\ we can however directly access more
-%D marks than we will ever need.
-
-%D Resetting marks in not compatible with the old method.
-%D Here a node is inserted, which can interfere badly. In
-%D fact, a real \type {\clearmarks\name} is needed.
-%D
-%D \starttyping
-%D \def\resetmark#1{\marks#1{}}
-%D \stoptyping
-%D
-%D A possible macro solution is presented here. When discussing
-%D \type {\clearmarks} on the \ETEX\ discussion list, Chris
-%D Rowley suggested to use a reset flag. Unfortunately this
-%D is not enough since we need to keep track of both set and
-%D reset state then. This means that we must postpone resetting
-%D to the page following the set, and as a result we need
-%D another auxiliary macro. The current solution is the best
-%D I could come up with so far, especially given that we
-%D need a fast mechanism.
-
-%D For those who want to know the story behind resetting
-%D marks, here are some examples of interference
-%D
-%D \startbuffer
-%D \setbox0=\vbox{test}
-%D \unvbox0\setbox0=\lastbox
-%D \ruledhbox{\unhbox0}
-%D \stopbuffer
-%D
-%D \typebuffer\blank\getbuffer\blank
-%D
-%D \startbuffer
-%D \setbox0=\vbox{test\normalmark{}}
-%D \unvbox0\setbox0=\lastbox
-%D \ruledhbox{\unhbox0}
-%D \stopbuffer
-%D
-%D \typebuffer\blank\getbuffer\blank
-%D
-%D \startbuffer
-%D \setbox0=\vbox{test\hbox{\normalmark{}}}
-%D \unvbox0\setbox0=\lastbox
-%D \ruledhbox{\unhbox0}
-%D \stopbuffer
-%D
-%D \typebuffer\blank\getbuffer\blank
-%D
-%D \startbuffer
-%D \setbox0=\vbox{test\vbox{\normalmark{}}}
-%D \unvbox0\setbox0=\lastbox
-%D \ruledhbox{\unhbox0}
-%D \stopbuffer
-%D
-%D \typebuffer\blank\getbuffer\blank
-
-%D One final advice. Use marks with care. When used in globally
-%D assigned boxes, the list can grow quite big, and processing
-%D can slow down considerably. This drawback is removed in
-%D \ETEX\ mode.
-
-\beginTEX
-
-\let\rawnewmark \newmark
-\let\rawdefinemark \newmark
-\let\rawsetmark \setmark
-\let\rawgettopmark \gettopmark
-\let\rawgetfirstmark \getfirstmark
-\let\rawgetbotmark \getbotmark
-\let\rawgetsplitbotmark \normalsplitbotmark
-\let\rawgetsplitfirstmark\normalsplitfirstmark
-\let\rawgetsplittopmark \normalsplitfirstmark
-
-\endTEX
-
-\beginETEX
-
-\let\rawnewmark \newmarks
-\let\rawdefinemark \newmarks
-\let\rawsetmark \normalmarks
-\let\rawgettopmark \normaltopmarks
-\let\rawgetfirstmark \normalfirstmarks
-\let\rawgetbotmark \normalbotmarks
-\let\rawgetsplitbotmark \normalsplitbotmarks
-\let\rawgetsplitfirstmark\normalsplitfirstmarks
-\let\rawgetsplittopmark \normalsplitfirstmarks
-
-\endETEX
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/supp-num.mkii b/Master/texmf-dist/tex/context/base/mkii/supp-num.mkii
deleted file mode 100644
index 5e35a20b07d..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/supp-num.mkii
+++ /dev/null
@@ -1,422 +0,0 @@
-%D \module
-%D [ file=supp-num,
-%D version=1998.05.15,
-%D title=\CONTEXT\ Support Macros,
-%D subtitle=Numbers,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 / Numbers}
-
-\unprotect
-
-%D \macros
-%D {digits, setdigitmode, setdigitsign}
-%D
-%D Depending on the digit mode the command \type {\digits}
-%D normalizes number patterns depending on the language set.
-%D
-%D \starttyping
-%D This will never be a \digits{1.000.000} seller.
-%D \stoptyping
-%D
-%D or
-%D
-%D \starttyping
-%D I will never grow longer than \digits 1.86 \Meter.
-%D \stoptyping
-%D
-%D The different modes are shown in:
-%D
-%D \startbuffer
-%D \setdigitmode 1 \digits 12.345,90 \digits 12.345.000 \digits 1,23
-%D \setdigitmode 2 \digits 12.345,90 \digits 12.345.000 \digits 1,23
-%D \setdigitmode 3 \digits 12.345,90 \digits 12.345.000 \digits 1,23
-%D \setdigitmode 4 \digits 12.345,90 \digits 12.345.000 \digits 1,23
-%D \setdigitmode 5 \digits 12.345,90 \digits 12.345.000 \digits 1,23
-%D \setdigitmode 6 \digits 12.345,90 \digits 12.345.000 \digits 1,23
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D This is typset as:
-%D
-%D \startlines
-%D \getbuffer
-%D \stoplines
-%D
-%D The sign can be typeset as is or within the space of a
-%D digit.
-%D
-%D \startbuffer
-%D \setdigitsign 0 \digits +12.345,90
-%D \setdigitmode 1 \digits +12.345,90
-%D \setdigitmode 2 \digits +12.345,90
-%D \setdigitmode 3 \digits +12.345,90
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D This is typset as:
-%D
-%D \startlines
-%D \getbuffer
-%D \stoplines
-
-\chardef\digitoutputmode=1 % 0..6
-\chardef\digitsignmode =0 % 0..3
-
-\def\setdigitmode{\chardef\digitoutputmode}
-\def\setdigitsign{\chardef\digitsignmode}
-
-%D The digit modes are:
-%D
-%D \startitemize[packed]
-%D \item periods \& comma
-%D \item commas \& period
-%D \item thinmuskips \& comma
-%D \item thinmuskips \& period
-%D \item thickmuskips \& comma
-%D \item thickmuskips \& period
-%D \stopitemize
-
-\let\collecteddigits \empty \chardef\digitinputmode =1
-\let\saveddigits \empty \chardef\skipdigit =0
-\let\savedpowerdigits\empty \chardef\powerdigits =0
-
-%D The first stage of the \type {\digit} macro takes care of
-%D the grouped call, the other branch handles the fuzzy
-%D delimited calls.
-
-\ifx\mbox\undefined \let\mbox\normalhbox \fi
-
-% \unexpanded\def\digits
-% {\bgroup\let~@\doifnextbgroupelse\dodigits\grabdigit}
-
-\unexpanded\def\digits
- {\bgroup
- \let~@%
- \doifnextbgroupelse\dodigits{\doifnextcharelse\normalmathshift\domathdigits\grabdigit}}
-
-\def\dodigits#1%
- {\grabdigit#1\relax}
-
-\def\domathdigits$#1$%
- {\mbox{\grabdigit#1\relax}} % adding $ $ goes wrong in tabulate
-
-\def\grabdigit
- {\futurelet\next\scandigit}
-
-%D Watch the test for \type {\nextobeyedline}, because the
-%D endofline token can be \type {\def'd}, not \type {\let}'d,
-%D we need to do an indirect test (see \type {verb-ini.tex})
-%D for details.
-%D
-%D \starttyping
-%D \def ^^M{\obeyedline}
-%D \def\nextbeyedline{\obeyedline}
-%D \stoptyping
-
-\ifx\normalmathshift\undefined \let\normalmathshift=$ \fi
-
-\def\scandigit
- {\ifx\next\blankspace
- \let\next\handledigits
- \else\ifx\next\nextobeyedline % the indirect one
- \let\next\handledigits
- \else\ifx\next\bgroup
- \let\next\handledigits
- \else\ifx\next\egroup
- \let\next\handledigits
- \else\ifx\next\normalmathshift
- \let\next\handledigits
- \else
- \let\next\collectdigit
- \fi\fi\fi\fi\fi
- \next}
-
-%D We store the power||of||ten (to be signaled by \type {^},
-%D \type {e} or~\type {E}) in a seperate macro so that we can
-%D typeset it in superscript. The space placeholders are
-%D replaced by a \type {@}.
-
-\def\savedigit#1#2%
- {\edef#1{#1\saveddigits#2}\let\saveddigits\empty}
-
-\long\def\collectdigit#1%
- {\ifx#1~%
- \savedigit\collecteddigits @%
- \else\if#1_%
- \savedigit\collecteddigits @%
- \else\if\noexpand#1\relax
- \let\grabdigit\handledigits
- \else\ifcase\powerdigits
- \if#1E%
- \chardef\powerdigits\plusone
- \else\if#1e%
- \chardef\powerdigits\plusone
- \else\if#1^%
- \chardef\powerdigits\plusone
- \else
- \savedigit\collecteddigits#1%
- %\doifnumberelse{#1}
- % {\savedigit\collecteddigits#1}
- % {\def\saveddigits{#1}}%
- \fi\fi\fi
- \else
- \savedigit\savedpowerdigits#1%
- %\doifnumberelse{#1}
- % {\savedigit\savedpowerdigits#1}
- % {\def\saveddigits{#1}}%
- \fi\fi\fi\fi
- \grabdigit}
-
-\let\handlemathdigits\firstofoneargument
-\let\handletextdigits\mathematics
-
-\def\handledigits
- {%\ifcase\powerdigits
- % \edef\collecteddigits{\collecteddigits\saveddigits}%
- %\else
- % \edef\savedpowerdigits{\savedpowerdigits\saveddigits}%
- %\fi
- \ifmmode
- \handlemathdigits{\dohandledigits}%
- \else
- \dontleavehmode\hbox{\handletextdigits{\dohandledigits}}%
- \fi
- \egroup}
-
-%D Although we could do with one pass, a second pass for
-%D handling the stored sequence is more readable.
-
-\ifnum\texengine=\luatexengine
-
- \def\dohandledigits
- {\mathcode`\,="002C \mathcode`\.="002E % pretty hard coded
- \expandafter\handletokens\collecteddigits\with\scandigits
- \ifcase\powerdigits\else\digitpowerseparator^{\savedpowerdigits}\fi}
-
- \chardef\mathaxisfontid\zerocount
-
-\else
-
- \def\dohandledigits
- {\mathcode`\,="013B \mathcode`\.="013A % pretty hard coded
- \expandafter\handletokens\collecteddigits\with\scandigits
- \ifcase\powerdigits\else\digitpowerseparator^{\savedpowerdigits}\fi}
-
- \chardef\mathaxisfontid\plustwo
-
-\fi
-
-\def\doscandigit#1%
- {\ifcase\skipdigit\@EA\hbox\else\@EA\hphantom\fi\bgroup
- \mathematics % brr, needed because of stored punctuation
- {\ifnum\digitinputmode=#1\relax
- \ifcase\digitoutputmode
- \or .%
- \or ,%
- \or \mskip\thinmuskip
- \or \mskip\thinmuskip
- \or \mskip\thickmuskip
- \or \mskip\thickmuskip
- \fi
- \else
- \ifodd\digitoutputmode,\else.\fi
- \fi}%
- \egroup}
-
-%D The signs can be made smaller and sqeezed into the width
-%D of a digit. Watch the \type {\mathaxisheight} trickery (this
-%D font related register stored the math axis).
-
-% 0,=
-% 0,== second = results in delta(00,=)
-% 0,- is invalid, should be =
-% 0,-- is invalid, should be ==
-
-\def\digitzeroamount
- {\digitsgn\zeroamount
- \def\digitzeroamount
- {\hphantom
- {00\setbox\scratchbox\hbox{$\zeroamount$}%
- \hskip-\wd\scratchbox}%
- \let\digitzeroamount\empty}}
-
-\def\scandigits#1%
- {\if#1.\digitsep1\else
- \if#1,\digitsep2\else
- \if#1@\digitnop \else
- \if#1_\digitnop \else
- \if#1/\digitsgn{\hphantom{+}}\chardef\skipdigit0\else
- \if#1-\ifcase\skipdigit\digitsgn-\else
- \box\digitsepbox\digitzeroamount \fi\chardef\skipdigit0\else
- \if#1+\digitsgn+\chardef\skipdigit0\else
- \if#1=\box\digitsepbox\digitzeroamount \chardef\skipdigit0\else
- \if#1s\digitsgn{\hphantom{\positive}}\chardef\skipdigit0\else
- \if#1p\digitsgn\positive\chardef\skipdigit0\else
- \if#1m\digitsgn\negative\chardef\skipdigit0\else
- \if#1n\digitsgn\negative\chardef\skipdigit0\else
- \box\digitsepbox #1\chardef\skipdigit0\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
-
-\newbox\digitsepbox \chardef\autodigitmode=1
-
-\def\digitsep#1%
- {\ifcase\autodigitmode
- \doscandigit#1%
- \else
- \setbox\digitsepbox\hbox{\doscandigit#1}%
- \fi
- \chardef\skipdigit0\relax}
-
-% strange, does not work
-%
-% \def\digitnop
-% {\hphantom{\box\digitsepbox}%
-% \hphantom{0}\chardef\skipdigit1\relax}
-%
-% while this works
-
-\def\digitnop
- {\hbox{\hphantom{\box\digitsepbox}}%
- \hphantom{0}\chardef\skipdigit1\relax}
-
-% but this doesn't
-%
-% \def\digitnop
-% {\hphantom{\box\digitsepbox0}%
-% \chardef\skipdigit1\relax}
-
-\def\digitsgn#1%
- {\ifcase\digitsignmode#1\else
- \hbox
- {\setbox\scratchbox\hbox{0}%
- \scratchdimen\mathaxisheight\textfont\mathaxisfontid
- \def\digitsgn##1##2%
- {\advance\scratchdimen-\mathaxisheight##1\mathaxisfontid
- \raise\scratchdimen
- \hbox to \wd\scratchbox{\hss$##2#1$\hss}}%
- \ifcase\digitsignmode\or
- \digitsgn\textfont \textstyle \or
- \digitsgn\scriptfont \scriptstyle \or
- \digitsgn\scriptscriptfont\scriptscriptstyle\fi}%
- \fi}
-
-\ifx\undefined\zeroamount \def\zeroamount{-} \fi
-\ifx\undefined\positive \def\positive {+} \fi
-\ifx\undefined\negative \def\negative {-} \fi
-
-%D The digit parser handles a bunch of special characters as
-%D well as different formats. We strongly suggest you to use
-%D the grouped call.
-%D
-%D \starttabulate[|l|l|l|]
-%D \NC \type{.} \NC , . \NC comma or period \NC \NR
-%D \NC \type{,} \NC , . \NC comma or period \NC \NR
-%D \NC \type{@} \NC \NC invisible space \NC \NR
-%D \NC \type{_} \NC \NC invisible space \NC \NR
-%D \NC \type{/} \NC \NC invisible sign \NC \NR
-%D \NC \type{-} \NC $-$ \NC minus sign \NC \NR
-%D \NC \type{+} \NC $+$ \NC plus sign \NC \NR
-%D \NC \type{s} \NC \NC invisible high sign \NC \NR
-%D \NC \type{p} \NC $\positive$ \NC high plus sign \NC \NR
-%D \NC \type{m} \NC $\negative$ \NC high minus sign \NC \NR
-%D \NC \type{n} \NC $\negative$ \NC high minus (negative) sign \NC \NR
-%D \NC \type{=} \NC $\zeroamount$ \NC zero padding \NC \NR
-%D \stoptabulate
-%D
-%D These triggers are used in the following examples.
-%D
-%D \startbuffer
-%D \digits 12
-%D \digits{~~~.~~~.~~~.68.712,34}
-%D \digits ~~~.~~~.~~~.68.712,34
-%D \digits ___.___.111.68.712,34
-%D \digits 111.111.111.68.712,34
-%D \digits 12.345,90
-%D \digits 12.345.000
-%D \digits 12,34
-%D \digits{392.857.230.68.712,34}
-%D {\digits1234}
-%D \digits{1234}
-%D \digits 1234\relax
-%D $\digits 123.222,00$
-%D \digits 123.222,00
-%D \digits 123.222,==
-%D \digits 123.222,00^10
-%D \digits 123.222,00e10
-%D \digits /123.222,00e-12
-%D \digits -123.222,00e-12
-%D \digits +123.222,00e-12
-%D \digits n123.222,00e-12
-%D \digits s123.222,00e-12
-%D \digits p123.222,00e-12
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \startlines
-%D \getbuffer
-%D \stoplines
-
-%D \macros
-%D {Digits}
-%D
-%D We also permit:
-
-\let\Digits\digits
-
-%D These macros are complicated by the fact that we also
-%D have to support cases like:
-%D
-%D \starttyping
-%D {\digits1234}
-%D \digits{1234}
-%D \digits 1234\whatever
-%D $\digits 123.222,00$
-%D \digits 123.222,00.
-%D \stoptyping
-%D
-%D The latter case shows us that trailing non digits are to
-%D be passed untreated.
-%D
-%D Another interesting case is:
-%D
-%D \starttyping
-%D \digits 123.222,00^10
-%D \stoptyping
-%D
-%D The separator is defined as:
-
-% \def\digitpowerseparator%
-% {\cdot10} % {\times10}
-
-\def\digitpowerseparator
- {\ifx\collecteddigits\empty\else\cdot\fi10}
-
-%D \macros
-%D {digittemplate}
-%D
-%D Users can specify the way they enter those digits by saying
-%D something like:
-%D
-%D \starttyping
-%D \digittemplate 12.000.000,00 % \digittemplate .,
-%D \stoptyping
-
-\def\digittemplate #1 %
- {\chardef\digitinputmode\zerocount
- \handletokens#1\with\scandigittemplate}
-
-\def\scandigittemplate#1%
- {\if #1.\ifcase\digitinputmode\chardef\digitinputmode\plusone \fi% period
- \else\if#1,\ifcase\digitinputmode\chardef\digitinputmode\plustwo \fi% comma
- \fi\fi}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/supp-pat.mkii b/Master/texmf-dist/tex/context/base/mkii/supp-pat.mkii
deleted file mode 100644
index 425eae215f6..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/supp-pat.mkii
+++ /dev/null
@@ -1,175 +0,0 @@
-%D \module
-%D [ file=supp-pat,
-%D version=2005.02.12,
-%D title=\CONTEXT\ Support Macros,
-%D subtitle=Patterns,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 We support:
-%D
-%D \starttyping
-%D \patterns {
-%D ...[namedglyphs]...
-%D }
-%D \stoptyping
-%D
-%D as well as:
-%D
-%D \starttyping
-%D <patterns>
-%D ...&namedglyphs;...
-%D </patterns>
-%D \stoptyping
-%D
-%D The \XML\ variant has very limited \XML\ parsing capabilities and
-%D is meant as an experiment.
-
-\ifx\writestatus\undefined \else
- \writestatus{loading}{ConTeXt Support Macros / Patterns}
-\fi
-
-%D \CONTEXT:
-
-\ifx\startmapping\undefined \else \ifx\startencoding\undefined \else
- \def\fetchpatterntoken#1{\csname#1\endcsname}
-\fi \fi
-
-%D First we define the \ETEX\ variant. We cannot do that inside
-%D the if statement because normal \TEX\ gets confused over the
-%D csname test (which it does not see as if but it does see the
-%D else's and fi's).
-
-\def\etexfetchpatterntoken#1%
- {\csname
- \ifcsname @pattok@#1\endcsname
- @pattok@#1%
- \else\ifcsname#1\endcsname
- #1%
- \else
- @pattok@default%
- \fi\fi
- \endcsname}
-
-\ifx \fetchpatterntoken \undefined
-
- \ifx \eTeXversion \undefined
-
- \def\fetchpatterntoken#1%
- {\csname
- \expandafter\ifx\csname @pattok@#1\endcsname\relax
- \expandafter\ifx\csname#1\endcsname\relax
- @pattok@default%
- \else
- #1%
- \fi
- \else
- @pattok@#1%
- \fi
- \endcsname}
-
- \else
-
- \let\fetchpatterntoken\etexfetchpatterntoken
-
- \fi
-
-\fi
-
-\def\definepatterntoken #1 #2 %
- {\expandafter\def\csname @pattok@#1\endcsname{#2}}
-
-%D \TEX\ based:
-
-\bgroup \catcode`\[=\active
-
- \gdef\enablepatterntokens
- {\catcode`\[=\active \let[\handlepatterntoken}
-
-\egroup
-
-\def\handlepatterntoken#1]%
- {\fetchpatterntoken{#1}}
-
-%D \XML\ based:
-
-\bgroup \catcode`\<=\active \catcode`\&=\active
-
- \gdef\enablepatternxml
- {\catcode`\<=\active
- \catcode`\&=\active
- \let&\handlepatternentity
- \let<\handlepatternxml}
-
-\egroup
-
-\def\handlepatternentity#1;%
- {\fetchpatterntoken{#1}}
-
-%D We use a very simple \XML\ parser, and we only trigger on the first
-%D two characters of the tag name. Consider this feature a playground
-%D (and a bit of a joke).
-
-\def\handlepatternxml#1#2% we only distinguish the first two chars
- {\csname @patxml@\ifcsname @patxml@#1#2\endcsname#1#2\else de\fi\endcsname}
-
-\def\definepatternxml #1#2#3 #4%
- {\expandafter\def\csname @patxml@#1#2\endcsname{#4}}
-
-\def\fetchpatternxml#1#2>%
- {\bgroup
- \long\def\next##1>{\egroup}%
- \catcode`\<=2 % \@@endgroup
- \afterassignment\next
- #1\bgroup}
-
-\def\gobblepatternxml
- {\bgroup
- \catcode`\%=11
- \dogobblepatternxml}
-
-\long\def\dogobblepatternxml#1>%
- {\egroup}
-
-%D Here are the default definitions. We don't catch empty elements.
-
-\definepatternxml patterns {\fetchpatternxml\patterns}
-\definepatternxml hyphenations {\fetchpatternxml\hyphenation}
-\definepatternxml pattern {\fetchpatternxml\patterns}
-\definepatternxml hyphenation {\fetchpatternxml\hyphenation}
-\definepatternxml default {\gobblepatternxml}
-
-\definepatterntoken default x
-
-\ifx\pattern \undefined \let\pattern \patterns \fi
-\ifx\hyphenations\undefined \let\hyphenations\hyphenation \fi
-
-%D An example of usage in another format than \CONTEXT:
-%D
-%D \starttyping
-%D \bgroup
-%D
-%D \lccode"E4="E4 \definepatterntoken adiaeresis ^^e4
-%D \lccode"F6="F6 \definepatterntoken odiaeresis ^^f6
-%D \lccode"FC="FC \definepatterntoken ediaeresis ^^fc
-%D \lccode"FF="FF \definepatterntoken ssharp ^^ff
-%D
-%D \enablepatterntokens
-%D \enablepatternxml
-%D
-%D \input lang-de.pat
-%D \input lang-de.hyp
-%D
-%D \egroup
-%D \stoptyping
-%D
-%D This is a minimal example for EC encoding, and of course
-%D a couple of more language related settings need to take
-%D place (like uc mappings).
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/supp-pdf.tex b/Master/texmf-dist/tex/context/base/mkii/supp-pdf.tex
deleted file mode 100644
index 2ae87806782..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/supp-pdf.tex
+++ /dev/null
@@ -1 +0,0 @@
-\input supp-pdf.mkii
diff --git a/Master/texmf-dist/tex/context/base/mkii/supp-ran.mkii b/Master/texmf-dist/tex/context/base/mkii/supp-ran.mkii
deleted file mode 100644
index 0a39026bfd3..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/supp-ran.mkii
+++ /dev/null
@@ -1,122 +0,0 @@
-%D \module
-%D [ file=supp-ran,
-%D version=1998.01.21,
-%D title=\CONTEXT\ Support Macros,
-%D subtitle=Random Number Generation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 / Random Number Generation}
-
-%D \macros
-%D {getrandomcount, getrandomdimen,
-%D getrandomfloat, getrandomnumber,
-%D setrandomseed, getrandomseed}
-%D
-%D This module load Donald Arseneau's generic file
-%D \type{random.tex}. A small shell is needed because we
-%D redefine some \TEX\ primitives. We also use different names
-%D for the two generators and add an extra one.
-%D
-%D \starttyping
-%D \getrandomcount \countregister {minimum} {maximum}
-%D \getrandomdimen \dimenregister {minimum} {maximum}
-%D \getrandomnumber \macroname {minimum} {maximum}
-%D \getrandomfloat \macroname {minimum} {maximum}
-%D \stoptyping
-%D
-%D Of course the file \type{random.tex} needs to be present.
-%D To prevent name clashes, the \CONTEXT\ distribution
-%D contains a copy in \type {thrd-ran.tex}.
-%D
-%D The randomseed can be set by:
-%D
-%D \starttyping
-%d \setrandomseed{number>0}
-%D \stoptyping
-%D
-%D and get by:
-%D
-%D \starttyping
-%D \getrandomseed\randomseed
-%D \stoptyping
-
-\input thrd-ran.mkii
-
-\ifx\uniformdeviate\undefined
-
- \let\verynormalnextrandom\nextrandom
-
- \def\normalnextrandom
- {\bgroup
- \let\time \normaltime
- \let\day \normalday
- \let\month\normalmonth
- \let\year \normalyear
- \verynormalnextrandom
- \egroup}
-
-\else
-
- \writestatus{loading}{using TeX's built in randomizer (overloading macro)}
-
- % For the meaning of the magic number, see \type {thrd-ran.tex}.
- %
- % Taco suggested to use the following alternative because \type
- % {\uniformdeviate} can return a zero (as expected) while
- % Donalds Arseneau's alternative has a minimum of~1.
-
- \def\nextrandom
- {\normalsetrandomseed\randomi\relax
- \global\randomi\numexpr\normaluniformdeviate2147483646+1\relax}
-
- \let\normalnextrandom\nextrandom
-
-\fi
-
-\def\nextrandom
- {\bgroup
- \normalnextrandom
- \gdef\nextrandom{\ifcase\randomseedfrozen\normalnextrandom\fi}%
- \egroup}
-
-\chardef\randomseedfrozen\zerocount
-
-\def\freezerandomseed
- {\ifcase\randomseedfrozen
- \nextrandom \global\chardef\randomseedfrozen\plusone
- \fi}
-
-\def\defrostrandomseed
- {\ifcase\randomseedfrozen\else
- \global\chardef\randomseedfrozen\zerocount \nextrandom
- \fi}
-
-\let\getrandomcount\setrannum
-\let\getrandomdimen\setrandim
-
-\def\getrandomnumber#1#2#3%
- {\getrandomcount\scratchcounter{#2}{#3}%
- \edef#1{\the\scratchcounter}}
-
-\def\getrandomfloat#1#2#3%
- {\getrandomdimen\scratchdimen{#2\points}{#3\points}%
- \edef#1{\withoutpt\the\scratchdimen}}
-
-\unexpanded \def\setrandomseed#1%
- {\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/mkii/supp-spe.mkii b/Master/texmf-dist/tex/context/base/mkii/supp-spe.mkii
deleted file mode 100644
index 4625695c7a2..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/supp-spe.mkii
+++ /dev/null
@@ -1,164 +0,0 @@
-%D \module
-%D [ file=supp-spe,
-%D version=1997.07.05,
-%D title=\CONTEXT\ Support Macros,
-%D subtitle=Specials,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 module implements some \type{\special} manipulation
-%D macros. I needed these when I implemented the code that
-%D handles the conversion of \TPIC\ specials to \PDF\ code.
-
-\ifx \undefined \writestatus \input supp-mis.tex \relax \fi
-\ifx \undefined \redefinespecial \else \expandafter \endinput \fi
-
-\writestatus{loading}{ConTeXt Support Macros / Specials}
-
-\unprotect
-
-%D When interpreting specials we need to do some basic scanning.
-%D For the moment we distinguish between three cases. We need
-%D
-%D \starttyping
-%D \special{tag: arguments}
-%D \special{tag arguments}
-%D \special{tag}
-%D \stoptyping
-%D
-%D We cannot be sure that the first case isn't
-%D
-%D \starttyping
-%D \special{tag:arguments}
-%D \stoptyping
-%D
-%D So we have to take care of that one too.
-
-%D \macros
-%D {redefinespecial}
-%D
-%D Specials that are to be interpreted are defined with
-%D commands like:
-%D
-%D \startbuffer[tmp-1]
-%D \redefinespecial a: \using#1\endspecial%
-%D {let's execute special 'a:' using '#1'}
-%D
-%D \redefinespecial a \using#1\endspecial%
-%D {let's execute special 'a' using '#1'}
-%D
-%D \redefinespecial a \using#1\endspecial%
-%D {let's execute special 'a' using nothing}
-%D \stopbuffer
-%D
-%D \typebuffer[tmp-1]
-%D
-%D The first two always take an argument, the last one not.
-%D The definition of this redefinition macro is not that
-%D complex. The names are internally tagged with \type{\@rds@}
-%D which saves both time and space.
-
-\def\@rds@{@rds@}
-
-\def\redefinespecial #1 {\setvalue{\@rds@#1}}
-
-%D \macros
-%D {mimmickspecials}
-%D
-%D Mimmicking specials is activated by saying:
-%D
-%D \starttyping
-%D \mimmickspecials
-%D \stoptyping
-%D
-%D This commands redefines the \PLAIN\ \TEX\ primitive
-%D \type{\special}.
-
-\def\mimmickspecials
- {\let\special\domimmickspecial}
-
-%D The special mimmicking macro first looks if it can find an
-%D colon terminated tag, next it searches for a tag that end
-%D with a space. If both cannot find, the tag itself is treated
-%D without argument.
-
-\def\domimmickspecial#1%
- {\domimmickcolonspecial#1:\relax/:\relax/\end}
-
-\def\domimmickcolonspecial#1:#2#3:\relax/#4\end
- {\ifx#2\relax
- \domimmickspacespecial#1 \relax/ \relax/\end
- \else
- \dodomimmickspecial#1:\using#2#3\endspecial
- \fi}
-
-\def\domimmickspacespecial#1 #2#3 \relax/#4\end
- {\ifx#2\relax
- \dodomimmickspecial#1\using\endspecial
- \else
- \dodomimmickspecial#1\using#2#3\endspecial
- \fi}
-
-\def\dodomimmickspecial#1\using#2\endspecial
- {\expandafter\ifx\csname\@rds@#1\endcsname\relax % \doifdefinedelse
- \defaultspecial{#1 #2}%
- \else
- %\message{[mimmick special #1 with #2]}%
- \getvalue{\@rds@#1}\using#2\endspecial
- \fi}
-
-%D Now let's show that things work the way we want, using the
-%D previous definitions of tag~a.
-%D
-%D \startbuffer[tmp-2]
-%D \mimmickspecials
-%D \special{a: 1 2 3 4 5}
-%D \special{a: 1 2 3 4 5}
-%D \special{a}
-%D \stopbuffer
-%D
-%D \typebuffer[tmp-2]
-%D
-%D Which results in:
-%D
-%D \startlines
-%D \getbuffer[tmp-1]
-%D \getbuffer[tmp-2]
-%D \stoplines
-
-%D \macros
-%D {mimmickspecial}
-%D
-%D When needed, one can call a mimmicked special directly by
-%D saying for instance:
-%D
-%D \starttyping
-%D \mimmickspecial a: \using...\endspecial
-%D \stoptyping
-%D
-%D This can be handy when specials have much in common.
-
-\def\mimmickspecial #1 {\getvalue{\@rds@#1}}
-
-%D \macros
-%D {normalspecial,defaultspecial}
-%D
-%D Unknown specials are passed to the default special handler.
-%D One can for instance ignore all further specials by saying
-%D \type{\normalspecial}:
-%D
-%D \starttyping
-%D \def\defaultspecial#1{}
-%D \stoptyping
-%D
-%D But here we default to idle.
-
-\let\normalspecial \special
-\let\defaultspecial\special
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/supp-tpi.mkii b/Master/texmf-dist/tex/context/base/mkii/supp-tpi.mkii
deleted file mode 100644
index 2c3e282e390..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/supp-tpi.mkii
+++ /dev/null
@@ -1,353 +0,0 @@
-%D \module
-%D [ file=supp-tpi,
-%D version=1997.07.05,
-%D title=\CONTEXT\ Support Macros,
-%D subtitle=\TPIC\ Conversion,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 modules implements the conversion of graphic \TPIC\
-%D specials using \METAPOST.
-%D
-%D We reimplement the \TPIC\ specials using the special
-%D mimmicking mechanism implemented in the support module
-%D \type{supp-spe} as well as the \METAPOST\ run||time support
-%D implemented in \type{supp-mps}.
-
-\ifnum\texengine=\luatexengine
- \expandafter \endinput
-\fi
-
-\ifx\undefined\writestatus \input supp-mis.mkii \relax \fi
-\ifx\undefined\mimmickspecials \input supp-spe.mkii \relax \fi
-\ifx\undefined\MPgraphicbox \input supp-mps.mkii \relax \fi
-\ifx\undefined\dogetEPSboundingbox \input supp-eps.mkii \relax \fi
-
-\writestatus{loading}{ConTeXt Support Macros / TPIC Conversion}
-
-%D Beware: we haven't activated both mechanism yet. This is
-%D to be done in the calling module.
-
-\unprotect
-
-%D When we want to mimmick \TPIC\ specials in \PDFTEX, we need
-%D to map its graphic primitives into \PDF\ ones. The main
-%D problem in doing so is that \PDF\ does not support b-splines
-%D directly and also does not offer us something to draw arcs.
-%D Of course all this scan be implemented in \TEX, and the
-%D first implementation of this module did so, but the results
-%D were not that satisfying. Not having used these specials
-%D before, I had for instance to find out that the \TPIC\
-%D specials were not that unambiguesly defined.
-%D
-%D Then, while discussing something else, Sebastian Ratz told
-%D me that the Web2c implementation that \PDFTEX\ is base upon,
-%D offers some rather discutable, but nevertheless handy
-%D feature:
-%D
-%D \starttyping
-%D \write18{execute program with arguments}
-%D \stoptyping
-%D
-%D Knowing this, I immediatelly decided to throw away the old
-%D conversion macros and use the marvelous \METAPOST, \TEX\
-%D related, drawing program to do the conversion in as high a
-%D quality as possible.
-%D
-%D implementation we're going to present here, not only uses
-%D for drawing purposes, but also uses the more efficient
-%D \METAPOST\ features to store the path.
-%D
-%D \in{Table}[tab:TPIC specials] lists the \TPIC\ specials as
-%D mentioned in the \LATEX\ Graphics Companion and the
-%D relevant part of the \DVIPS\ source. This list shows us
-%D that we have to store the path before we can use it, simply
-%D because we don't know in advance what actions to apply on
-%D it.
-%D
-%D \placetable[here][tab:TPIC specials]{The \TPIC\ special syntax.}
-%D \starttable[|||l|]
-%D \HL
-%D \NC \bf tag \NC \bf arguments \NC \bf meaning \NC\SR
-%D \HL
-%D \NC pn \NC $w$ \NC set linewidth \NC\FR
-%D \NC pa \NC $x$ $y$ \NC add point to path \NC\MR
-%D \NC fp \NC \NC draw/fill path \NC\MR
-%D \NC ip \NC \NC fill path \NC\MR
-%D \NC da \NC $l$ \NC draw dashed path \NC\MR
-%D \NC dt \NC $l$ \NC draw doted path \NC\MR
-%D \NC sp \NC $d$ \NC draw spline \NC\MR
-%D \NC ar \NC $x$ $y$ $r_x$ $r_y$ $b$ $e$ \NC draw (partial) arc \NC\MR
-%D \NC ia \NC $x$ $y$ $r_x$ $r_y$ $b$ $e$ \NC fill (partial) arc \NC\MR
-%D \NC sh \NC $s$ \NC fill next path \NC\LR
-%D \HL
-%D \stoptable
-
-%D The first problem we have to take care of is the fact that
-%D there is no decent begin or end of the drawing process
-%D defined. We can however be quite sure that writers of
-%D packages using these specials will put them into a box,
-%D simply because else this is the most common used way to
-%D treat something \TEX\ as as a whole, like:
-%D
-%D \starttyping
-%D \hbox{\special{}\special{}...}
-%D \stoptyping
-%D
-%D We just start a picture as soon as the first special is
-%D encountered, so this becomes:
-%D
-%D \starttyping
-%D \hbox{\openpicture\newspecial{}\newspecial{}...
-%D \stoptyping
-
-%D The first step in opening the picture is to start a group.
-%D Now we can savely use the egroup that closes the box to also
-%D end the picture.
-
-% BETER: check for context and include mp-tool.mp
-
-\def\startTPICspecials
- {\bgroup
- \let\startTPICspecials\relax
- \aftergroup\stopTPICspecials
- \resetMPdrawing
- \startMPdrawing
- input mp-tool.mpii ;
- pair p[];
- \stopMPdrawing}
-
-%D As soon as we begin a picture, we inhibit nesting by
-%D relaxing the start macro. The first \METAPOST\ action we
-%D take is declaring an array of pairs named $p$.
-
-%D Ending the picture is invoked by closing the current group.
-%D Because the \TPIC\ picture comes out mirrored, we have to
-%D reflect the current \METAPOST\ picture, stored in the system
-%D variable {\it currentpicture}, around the $x$-axis.
-
-\def\stopTPICspecials
- {\startMPdrawing
- currentpicture:=currentpicture reflectedabout ((0,0),(4095,0));
- \stopMPdrawing
- \MPdrawingdonetrue
- \setbox\MPgraphicbox\hbox
- {\getMPdrawing}%
- \setbox\MPgraphicbox\hbox to \zeropoint
- {\kern-\wd\MPgraphicbox
- \vbox to \zeropoint{\box\MPgraphicbox\vss}\hss}%
- \ht\MPgraphicbox\zeropoint
- \wd\MPgraphicbox\zeropoint
- \dp\MPgraphicbox\zeropoint
- \box\MPgraphicbox
- \egroup}
-
-%D Here the macro \type{\stopwritingMPgraphic} has to take care
-%D of executing and including the \METAPOST\ code.
-
-%D We need to keep track of the number of elements that form
-%D the path. This is needed because we don't know in advance
-%D how the points are to be connected.
-
-\newcount\TPICcounter
-
-%D When a path is draw, we can connect the points using a
-%D smooth curve of drawing straight lines. A closed path can be
-%D drawn or filled.
-
-\newif\ifTPICdraw
-\newif\ifTPICfill
-\newif\ifTPICcurve
-
-%D The \TPIC\ specials permit specifying the line and fill
-%D color as well as the linetype, which can be solid, dashed or
-%D dotted. We'll save those specifications as a \METAPOST\
-%D string, using:
-
-\let\TPIClinetype =\empty
-\let\TPICgrayscale=\empty
-
-%D The magic reduction factor $.07227$ is needed to map the
-%D \TPIC\ $1/1000$ of an inch to \POSTSCRIPT\ points. We cannot
-%D delegate this task to \METAPOST\ because this program does
-%D not accept values greater than 4095.
-
-%D I won't discuss all the specifics used in implementing
-%D the specials. The \METAPOST\ part is rather trivial. Many
-%D specials have much in common, so the amout of code is not
-%D that large.
-
-\redefinespecial pa \using#1 #2\endspecial
- {\startTPICspecials
- \bgroup
- \global\advance\TPICcounter 1
- \dimen0=#1pt \dimen0=.07227\dimen0
- \dimen2=#2pt \dimen2=.07227\dimen2
- \startMPdrawing
- p[\the\TPICcounter]:=(\the\dimen0,\the\dimen2);
- \stopMPdrawing
- \egroup}
-
-\redefinespecial pn \using#1\endspecial
- {\startTPICspecials
- \bgroup
- \dimen0=#1pt \dimen0=.07227\dimen0
- \startMPdrawing
- pickup pencircle scaled \the\dimen0;
- \stopMPdrawing
- \egroup}
-
-\redefinespecial sh \using#1\endspecial
- {\startTPICspecials
- \bgroup
- \edef\g{#1}%
- \edef\g{\ifx\g\empty.5\else#1\fi}%
- \xdef\TPICgrayscale{withcolor (\g,\g,\g)}%
- \egroup}
-
-\redefinespecial wh \using#1\endspecial
- {\mimmickspecial sh \using0\endspecial}
-
-\redefinespecial bk \using#1\endspecial
- {\mimmickspecial sh \using1\endspecial}
-
-\redefinespecial da \using#1\endspecial
- {\startTPICspecials
- \bgroup
- \edef\l{#1}%
- \ifx\l\empty
- \gdef\TPIClinetype{dashed evenly}%
- \else
- \dimen0=#1in
- \ifdim\dimen0<\!!zeropoint \dimen0=-\dimen0\fi
- \edef\f{\the\dimen0 \space}%
- \dimen0=.5\dimen0
- \edef\h{\the\dimen0 \space}%
- \xdef\TPIClinetype{dashed dashpattern (on \h off \f on \h)}%
- \fi
- \egroup
- \TPICcurvefalse\TPICdrawtrue
- \drawTPICpath\using#1\endspecial}
-
-\redefinespecial dt \using#1\endspecial
- {\startTPICspecials
- \bgroup
- \edef\l{#1}%
- \xdef\TPIClinetype{dashed withdots \ifx\l\empty\else scaled #1in\fi}%
- \egroup
- \TPICcurvefalse\TPICdrawtrue
- \drawTPICpath\using#1\endspecial}
-
-\redefinespecial fp \using#1\endspecial
- {\startTPICspecials
- \TPICcurvefalse\TPICdrawtrue
- \ifdim0#1pt=\!!zeropoint
- \drawTPICpath\using#1\endspecial
- \else\ifdim0#1pt<\!!zeropoint
- \mimmickspecial dt\using#1\endspecial
- \else
- \mimmickspecial da\using#1\endspecial
- \fi\fi}
-
-\redefinespecial sp
- {\startTPICspecials\TPICdrawtrue\TPICcurvetrue\drawTPICpath}
-
-\redefinespecial ip
- {\startTPICspecials\TPICfilltrue\drawTPICpath}
-
-\redefinespecial ar
- {\startTPICspecials\TPICdrawtrue\drawTPICarc}
-
-\redefinespecial ia
- {\startTPICspecials\TPICfilltrue\drawTPICarc}
-
-%D These substitutes use two auxiliary macros that take care of
-%D actually drawing the shape or arc. Here we use the stored
-%D linetype (solid, dashed, dotted) and color (grayscale).
-
-\def\drawTPICpath\using#1\endspecial
- {\bgroup
- \ifTPICdraw
- \def\TPICgrayscale{}%
- \fi
- \startMPdrawing
- \ifTPICfill fill\fi\ifTPICdraw draw\fi\space
- for i:=1 upto \the\TPICcounter-1:
- p[i]\ifTPICcurve..\else--\fi
- endfor
- p[\the\TPICcounter]
- \ifTPICfill\ifTPICcurve..\else--\fi cycle \fi
- \TPIClinetype\space\TPICgrayscale;
- \stopMPdrawing
- \resetTPICvariables
- \egroup}
-
-%D I have to admit that at the moment I wrote this macro, I
-%D could not write this piece of \METAPOST. Fortunately
-%D Thortsen Ohl promptly answered the question I posted to the
-%D \METAFONT\ discussion list.
-
-\def\drawTPICarc\using#1 #2 #3 #4 #5 #6\endspecial
- {\bgroup
- \ifTPICdraw
- \def\TPICgrayscale{}%
- \fi
- \dimen 0=#1pt\dimen 0=.07227\dimen 0
- \dimen 2=#2pt\dimen 2=.07227\dimen 2
- \dimen10=#3pt\dimen10=.14454\dimen10
- \dimen12=#4pt\dimen12=.14454\dimen12
- \dimen20=#5pt
- \dimen22=#6pt
- \startMPdrawing
- \ifTPICfill fill\fi\ifTPICdraw draw\fi \space
- \ifTPICfill\else subpath 4/3.14159*(\the\dimen20,\the\dimen22) of \fi
- fullcircle xscaled \the\dimen10 \space yscaled \the\dimen12 \space
- shifted (\the\dimen0,\the\dimen2)
- \TPIClinetype \space \TPICgrayscale;
- \stopMPdrawing
- \resetTPICvariables
- \egroup}
-
-%D Resetting the variables need to be done globally because we
-%D cannot be sure if any further grouping is used by the
-%D envelopping macros.
-
-\def\resetTPICvariables
- {\global\TPICcounter\zerocount
- \global\TPICfillfalse
- \global\TPICdrawfalse
- \global\let\TPIClinetype\empty
- \global\let\TPICgrayscale\empty}
-
-%D I have to admit that by using the \METAPOST\ B‚zier cubics
-%D routines these implementation does produce better curves
-%D then most \DVI\ drivers do using the \TPIC\ prescribed
-%D b-splines. Take for instance the sequence:
-%D
-%D \starttyping
-%D \special{pa 2000 1000}
-%D \special{pa 1000 2000}
-%D \special{pa 0000 1000}
-%D \special{pa 1000 0000}
-%D \special{pa 2000 1000}
-%D \special{sp}
-%D \stoptyping
-%D
-%D One would expect that this code produced a closed circle,
-%D but the curve that comes out using b-splines is far from
-%D round. We can however savely asume that the arc producing
-%D specials will be used for drawing circle fragments, while
-%D the path specials will be used for arbitraty curves. And for
-%D b-splines to produce nice curves, one will often use many
-%D points to get the desired results. Therefore, using the
-%D \METAPOST\ B‚zier curves will certainly produce similar and
-%D even better graphics, except in those rare cases where one
-%D uses delinberately the not that accurate features of
-%D b-splines. Hereby the user is warned.
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/supp-vis.mkii b/Master/texmf-dist/tex/context/base/mkii/supp-vis.mkii
deleted file mode 100644
index 22a745b1308..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/supp-vis.mkii
+++ /dev/null
@@ -1,1907 +0,0 @@
-%D \module
-%D [ file=supp-vis,
-%D version=1996.10.21,
-%D title=\CONTEXT\ Support Macros,
-%D subtitle=Visualization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% no longer generic, who cares ...
-
-%D \gdef\ShowBufferedExample% private typeseting macro
-%D {\startlinecorrection
-%D \bgroup
-%D \setuptyping[margin=0pt,option=color]
-%D \showmakeup
-%D \centeredvcuetrue
-%D \dontinterfere
-%D \baselinerulefalse
-%D \normalvbox
-%D {\normalhbox to \hsize
-%D {$\hsize=.5\hsize
-%D \advance\hsize by -.5em
-%D \normalvcenter{\vbox{\getbuffer}}\normalhss
-%D \normalvcenter{\vbox{\dontshowcomposition\typebuffer}}$}}
-%D \egroup
-%D \stoplinecorrection}
-%D
-%D \gdef\ShowBufferedExampleBox% private typeseting macro
-%D {\startlinecorrection
-%D \bgroup
-%D \setuptyping[margin=0pt,option=color]
-%D \showmakeup
-%D \centeredvcuetrue
-%D \dontinterfere
-%D \baselinerulefalse
-%D \normalvbox
-%D {\normalhbox to \hsize
-%D {$\hsize=.5\hsize
-%D \advance\hsize by -.5em
-%D \normalvcenter{\baselineruletrue\vbox{\getbuffer}}\normalhss
-%D \normalvcenter{\vbox{\dontshowcomposition\typebuffer}}$}}
-%D \egroup
-%D \stoplinecorrection}
-
-%D Although an integral part of \CONTEXT, this module is one
-%D of the support modules. Its stand alone character permits
-%D use in \PLAIN\ \TEX\ or \TEX\ based macropackages.
-%D \ifCONTEXT \else If in some examples the verbatim listings
-%D don't show up nice, this is due to processing by a system
-%D that does not support buffering. In \CONTEXT\ we show the
-%D commands in the margin, use bit more advanced way of
-%D numbering, and typeset the source in \TEX nicolored
-%D verbatim. Sorry for this inconvenience.\fi
-%D
-%D Depending on my personal needs and those of whoever uses it,
-%D the macros will be improved in terms of visualization,
-%D efficiency and compatibility. These rather low level
-%D visualization macros are supplemented by ones that can
-%D visualize baselines, the page layout and whatever deserves
-%D attention. Most of those macros can be found in \type
-%D {core-vis} and other core modules. Their integration in
-%D \CONTEXT\ prohibits generic applications.
-
-\ifx \undefined \writestatus \input supp-mis.tex \fi
-
-%D One of the strong points of \TEX\ is abstraction of textual
-%D input. When macros are defined well and do what we
-%D want them to do, we will seldom need the tools present in
-%D What You See Is What You Get systems. For instance, when
-%D entering text we don't need rulers, because no manual
-%D shifting and/or alignment of text is needed. On the other
-%D hand, when we are designing macros or specifying layout
-%D elements, some insight in \TEX's advanced spacing, kerning,
-%D filling, boxing and punishment abilities will be handy.
-%D That's why we've implemented a mechanism that shows some of
-%D the inner secrets of \TEX.
-
-\writestatus{loading}{ConTeXt Support Macros / Visualization}
-
-%D In this module we are going to redefine some \TEX\
-%D primitives and \PLAIN\ macro's. Their original meaning is
-%D saved in macros with corresponding names, preceded by
-%D \type{normal}. These original macros are (1)~used to
-%D temporary restore the old values when needed and
-%D (2)~used to prevent recursive calls in the macros that
-%D replace them.
-
-\unprotect
-
-\let\visualvrule\vrule
-\let\visualhrule\hrule
-
-%D \macros
-%D {dontinterfere}
-%D
-%D Indentation, left and/or right skips, redefinition of
-%D \type{\par} and assignments to \type{\everypar} can lead to
-%D unwanted results. We can therefore turn all those things
-%D off with \type{\dontinterfere}.
-
-\def\dontinterfere
- {\everypar \emptytoks
- \let\par \endgraf
- \parindent\zeropoint
- \parskip \zeropoint
- \leftskip \zeropoint
- \rightskip\zeropoint
- \relax}
-
-%D \macros
-%D {dontcomplain}
-%D
-%D In this module we do a lot of box manipulations. Because we
-%D don't want to be confronted with to many over- and underfull
-%D messages we introduce \type{\dontcomplain}.
-
-\def\dontcomplain
- {\hbadness\!!tenthousand \vbadness\hbadness
- \hfuzz \maxdimen \vfuzz \hfuzz}
-
-% This obsolete dutch name is sometimes uses in manual styles; when
-% cleaning up the codebase I decided to move this definition here.
-
-\let\mindermeldingen\dontcomplain
-
-%D \macros
-%D {normaloffinterlineskip}
-%D
-%D The next hack is needed because in \CONTEXT\ we redefine
-%D \type{\offinterlineskip}.
-
-\ifx\undefined\normaloffinterlineskip
- \let\normaloffinterlineskip\offinterlineskip
-\fi
-
-%D \macros
-%D {normalhbox,
-%D normalvbox,normalvtop}
-%D
-%D There are three types of boxes, one horizontal and two
-%D vertical in nature. As we will see later on, all three types
-%D are to be handled according to their orientation and
-%D baseline behavior. Especially \type{\vtop}'s need our
-%D special attention.
-
-% already saved
-
-%D \macros
-%D {normalhskip,
-%D normalvskip}
-%D
-%D Next come the flexible skips, which come in two flavors
-%D too. Like boxes these are handled with \TEX\ primitives.
-
-% already saved
-
-%D \macros
-%D {normalpenalty,
-%D normalkern}
-%D
-%D Both penalties and kerns are taken care of by mode sensitive
-%D primitives. This means that when making them visible, we
-%D have to take the current mode into account.
-
-% already saved
-
-%D \macros
-%D {normalhglue,
-%D normalvglue}
-%D
-%D Glues on the other hand are macro's defined in \PLAIN\ \TEX.
-%D As we will see, their definitions make the implementation of
-%D their visible counterparts a bit more \TeX{}nical.
-
-\let\normalhglue = \hglue
-\let\normalvglue = \vglue
-
-%D \macros
-%D {normalmkern,
-%D normalmskip}
-%D
-%D Math mode has its own spacing primitives, preceded by
-%D \type{m}. Due to the relation with the current font and the
-%D way math is typeset, their unit \type{mu} is not compatible
-%D with other dimensions. As a result, the visual appearance
-%D of these primitives is kept primitive too.
-
-% already saved
-
-%D \macros
-%D {hfilneg,
-%D vfilneg}
-%D
-%D Fills can be made visible quite easy. We only need some
-%D additional negation macros. Because \PLAIN\ \TEX\ only
-%D offers \type{\hfilneg} and \type{\vfilneg}, we define our
-%D own alternative double \type{ll}'ed ones.
-
-\def\hfilneg {\normalhskip\zeropoint \!!plus-1fil\relax}
-\def\vfilneg {\normalvskip\zeropoint \!!plus-1fil\relax}
-\def\hfillneg {\normalhskip\zeropoint \!!plus-1fill\relax}
-\def\vfillneg {\normalvskip\zeropoint \!!plus-1fill\relax}
-\def\hfilllneg{\normalhskip\zeropoint \!!plus-1filll\relax}
-\def\vfilllneg{\normalvskip\zeropoint \!!plus-1filll\relax}
-
-%D \macros
-%D {normalhss,normalhfil,normalhfill,
-%D normalvss,normalvfil,normalvfill}
-%D
-%D The positive stretch primitives are used independant and in
-%D combination with \type{\leaders}.
-
-% already saved
-
-%D \macros
-%D {normalhfilneg,normalhfillneg,
-%D normalvfilneg,normalvfillneg}
-%D
-%D Keep in mind that both \type{\hfillneg} and \type{\vfillneg}
-%D are not part of \PLAIN\ \TEX\ and therefore not documented
-%D in standard \TEX\ documentation. They can nevertheless be
-%D used at will.
-
-\let\normalhfillneg = \hfillneg
-\let\normalvfillneg = \vfillneg
-
-%D Visualization is not always wanted. Instead of turning this
-%D option off in those (unpredictable) situations, we just
-%D redefine a few \PLAIN\ macros.
-
-\ifx\tlap\undefined
-
- \def\rlap#1{\normalhbox to \zeropoint{#1\normalhss}}
- \def\llap#1{\normalhbox to \zeropoint{\normalhss#1}}
- \def\blap#1{\normalvbox to \zeropoint{#1\normalvss}}
- \def\tlap#1{\normalvbox to \zeropoint{\normalvss#1}}
-
-\fi
-
-\ifx\contextversion\undefined \def~{\normalpenalty\!!tenthousand\ } \fi
-
-%D \macros
-%D {makeruledbox}
-%D
-%D Ruled boxes can be typeset is many ways. Here we present
-%D just one alternative. This implementation may be a little
-%D complicated, but it supports all three kind of boxes. The
-%D next command expects a \BOX\ specification, like:
-%D
-%D \starttyping
-%D \makeruledbox0
-%D \stoptyping
-
-%D \macros
-%D {baselinerule,baselinefill}
-%D
-%D We can make the baseline of a box visible, both dashed and
-%D as a rule. The line is drawn on top of the baseline. All
-%D we have to say is:
-%D
-%D \starttyping
-%D \baselineruletrue
-%D \baselinefilltrue
-%D \stoptyping
-%D
-%D At the cost of some overhead these alternatives are
-%D implemented using \type{\if}'s:
-
-\newif\ifbaselinerule \baselineruletrue
-\newif\ifbaselinefill \baselinefillfalse
-
-%D \macros
-%D {iftoprule,ifbottomrule,ifleftrule,ifrightrule}
-%D
-%D Rules can be turned on and off, but by default we have:
-%D
-%D \starttyping
-%D \topruletrue
-%D \bottomruletrue
-%D \leftruletrue
-%D \rightruletrue
-%D \stoptyping
-%D
-%D As we see below:
-
-\newif\iftoprule \topruletrue
-\newif\ifbottomrule \bottomruletrue
-\newif\ifleftrule \leftruletrue
-\newif\ifrightrule \rightruletrue
-
-%D \macros
-%D {boxrulewidth}
-%D
-%D The width in the surrounding rules can be specified by
-%D assigning an apropriate value to the dimension used. This
-%D module defaults the width to:
-%D
-%D \starttyping
-%D \boxrulewidth=.2pt
-%D \stoptyping
-%D
-%D Although we are already low on \DIMENSIONS\ it's best to
-%D spend one here, mainly because it enables easy manipulation,
-%D like multiplication by a given factor.
-
-\newdimen\boxrulewidth \boxrulewidth=.2pt
-
-%D The core macro \type{\makeruledbox} looks a bit hefty. The
-%D manipulation at the end is needed because we want to
-%D preserve both the mode and the baseline. This means that
-%D \type{\vtop}'s and \type{\vbox}'es behave the way we expect
-%D them to do.
-%D
-%D \startlinecorrection
-%D \hbox
-%D {\ruledhbox to 5em{\strut test\normalhss}\hskip1em
-%D \ruledvbox{\hsize 5em\strut test \par test\strut}\hskip1em
-%D \ruledvtop{\hsize 5em\strut test \par test\strut}}
-%D \stoplinecorrection
-%D
-%D The \type{\cleaders} part of the macro is responsible for
-%D the visual baseline. The \type{\normalhfill} belongs to this
-%D primitive too. By storing and restoring the height and depth
-%D of box \type{#1}, we preserve the mode.
-
-\let\dowithruledbox\relax
-
-\let\ruledheight\!!zeropoint
-\let\ruleddepth \!!zeropoint
-\let\ruledwidth \!!zeropoint
-
-\def\makeruledbox#1%
- {\edef\ruledheight{\the\ht#1}%
- \edef\ruleddepth {\the\dp#1}%
- \edef\ruledwidth {\the\wd#1}%
- \setbox\scratchbox\normalvbox
- {\dontcomplain
- \normaloffinterlineskip
- \visualhrule
- \!!height\boxrulewidth
- \iftoprule\else\!!width\zeropoint\fi
- \normalvskip-\boxrulewidth
- \normalhbox to \ruledwidth
- {\visualvrule
- \!!height\ruledheight
- \!!depth\ruleddepth
- \!!width\ifleftrule\else0\fi\boxrulewidth
- \ifdim\ruledheight>\zeropoint \else \baselinerulefalse \fi
- \ifdim\ruleddepth>\zeropoint \else \baselinerulefalse \fi
- \ifbaselinerule
- \ifdim\ruledwidth<20\boxrulewidth
- \baselinefilltrue
- \fi
- \cleaders
- \ifbaselinefill
- \visualhrule
- \!!height\boxrulewidth
- \else
- \normalhbox
- {\normalhskip2.5\boxrulewidth
- \visualvrule
- \!!height\boxrulewidth
- \!!width5\boxrulewidth
- \normalhskip2.5\boxrulewidth}%
- \fi
- \fi
- \normalhfill
- \visualvrule
- \!!width\ifrightrule\else0\fi\boxrulewidth}%
- \normalvskip-\boxrulewidth
- \visualhrule
- \!!height\boxrulewidth
- \ifbottomrule\else\!!width\zeropoint\fi}%
- \wd#1\zeropoint
- \setbox#1=\ifhbox#1\normalhbox\else\normalvbox\fi
- {\normalhbox
- {\box#1%
- \lower\ruleddepth\normalhbox{\dowithruledbox{\box\scratchbox}}}}%
- \ht#1=\ruledheight
- \wd#1=\ruledwidth
- \dp#1=\ruleddepth}
-
-%D Just in case one didn't notice: the rules are in fact layed
-%D over the box. This way the contents of a box cannot
-%D visually interfere with the rules around (upon) it. A more
-%D advanced version of ruled boxes can be found in one of the
-%D core modules of \CONTEXT. There we take offsets, color,
-%D rounded corners, backgrounds and alignment into account too.
-
-%D \macros
-%D {ruledhbox,
-%D ruledvbox,ruledvtop,
-%D ruledvcenter}
-%D
-%D These macro's can be used instead of \type{\hbox},
-%D \type{\vbox}, \type{\vtop} and, when in math mode,
-%D \type{\vcenter}. They just do what their names state. Using
-%D an auxiliary macro would save us a few words of memory, but
-%D it would make their appearance even more obscure.
-%D
-%D \startbuffer
-%D \hbox
-%D {\strut
-%D one
-%D two
-%D \hbox{three}
-%D four
-%D five}
-%D \stopbuffer
-%D
-%D \ShowBufferedExampleBox
-
-\unexpanded\def\ruledhbox
- {\normalhbox\bgroup
- \dowithnextbox{\makeruledbox\nextbox\box\nextbox\egroup}%
- \normalhbox}
-
-%D \startbuffer
-%D \vbox
-%D {\strut
-%D first line \par
-%D second line \par
-%D third line \par
-%D fourth line \par
-%D fifth line
-%D \strut }
-%D \stopbuffer
-%D
-%D \ShowBufferedExampleBox
-
-\unexpanded\def\ruledvbox
- {\normalvbox\bgroup
- \dowithnextbox{\makeruledbox\nextbox\box\nextbox\egroup}%
- \normalvbox}
-
-%D \startbuffer
-%D \vtop
-%D {\strut
-%D first line \par
-%D second line \par
-%D third line \par
-%D fourth line \par
-%D fifth line
-%D \strut }
-%D \stopbuffer
-%D
-%D \ShowBufferedExampleBox
-
-\unexpanded\def\ruledvtop
- {\normalvtop\bgroup
- \dowithnextbox{\makeruledbox\nextbox\box\nextbox\egroup}%
- \normalvtop}
-
-%D \startbuffer
-%D \hbox
-%D {$\vcenter{\hsize.2\hsize
-%D alfa \par beta}$
-%D $\vcenter to 3cm{\hsize.2\hsize
-%D alfa \par beta \par gamma}$
-%D $\vcenter{\hsize.2\hsize
-%D alfa \par beta}$}
-%D \stopbuffer
-%D
-%D \ShowBufferedExampleBox
-
-\unexpanded\def\ruledvcenter
- {\normalvbox\bgroup
- \dontinterfere
- \dowithnextbox
- {\scratchdimen.5\ht\nextbox
- \advance\scratchdimen .5\dp\nextbox
- \ht\nextbox\scratchdimen
- \dp\nextbox\scratchdimen
- \ruledhbox{\box\nextbox}%
- \egroup}%
- \normalvbox}
-
-%D \macros
-%D {ruledbox,
-%D setruledbox}
-%D
-%D Of the next two macros the first can be used to precede a
-%D box of ones own choice. One can for instance prefix boxes
-%D with \type{\ruledbox} and afterwards --- when the macro
-%D satisfy the needs --- let it to \type{\relax}.
-%D
-%D \starttyping
-%D \ruledbox\hbox{What rules do you mean?}
-%D \stoptyping
-%D
-%D The macro \type{\setruledbox} can be used to directly
-%D rule a box.
-%D
-%D \starttyping
-%D \setruledbox12=\hbox{Who's talking about rules here?}
-%D \stoptyping
-%D
-%D At the cost of some extra macros we can implement a
-%D variant that does not need the~\type{=}, but we stick to:
-
-\unexpanded\def\ruledbox
- {\dowithnextbox{\makeruledbox\nextbox\box\nextbox}}
-
-\def\setruledbox#1=%
- {\dowithnextbox{\makeruledbox\nextbox\setbox#1\nextbox}}
-
-%D \macros
-%D {investigateskip,
-%D investigatecount,
-%D investigatemuskip}
-%D
-%D Before we meet the visualizing macro's, we first implement
-%D ourselves some handy utility ones. Just for the sake of
-%D efficiency and readability, we introduce some status
-%D variables, that tell us a bit more about the registers we
-%D use:
-%D
-%D \starttyping
-%D \ifflexible
-%D \ifzero
-%D \ifnegative
-%D \ifpositive
-%D \stoptyping
-%D
-%D These status variables are set when we call for one of the
-%D investigation macros, e.g.
-%D
-%D \starttyping
-%D \investigateskip\scratchskip
-%D \stoptyping
-%D
-%D We use some dirty trick to check stretchability of \SKIPS.
-%D Users of these macros are invited to study their exact
-%D behavior first. The positive and negative states both
-%D include zero and are in fact non-negative ($\geq0$) and
-%D non-positive ($\leq0$) .
-
-\newif\ifflexible
-\newif\ifzero
-\newif\ifnegative
-\newif\ifpositive
-
-\def\investigateskip#1%
- {\relax
- \scratchdimen#1\relax
- \edef\!!stringa{\the\scratchdimen}%
- \edef\!!stringb{\the#1}%
- \ifx\!!stringa\!!stringb \flexiblefalse \else \flexibletrue \fi
- \ifdim#1=\zeropoint\relax
- \zerotrue \else
- \zerofalse \fi
- \ifdim#1<\zeropoint\relax
- \positivefalse \else
- \positivetrue \fi
- \ifdim#1>\zeropoint\relax
- \negativefalse \else
- \negativetrue \fi}
-
-% etex
-%
-% \def\investigateskip#1%
-% {\relax
-% \ifdim\scratchskip=\zeropoint
-% \ifdim\gluestretch\scratchskip=\zeropoint
-% \ifdim\glueshrink\scratchskip=\zeropoint
-% \flexiblefalse
-% \else
-% \flexibletrue
-% \fi
-% \else
-% \flexibletrue
-% \fi
-% \else
-% \flexibletrue
-% \fi
-% \ifdim#1=\zeropoint\relax
-% \zerotrue \else
-% \zerofalse \fi
-% \ifdim#1<\zeropoint\relax
-% \positivefalse \else
-% \positivetrue \fi
-% \ifdim#1>\zeropoint\relax
-% \negativefalse \else
-% \negativetrue \fi}
-
-\def\investigatecount#1%
- {\relax
- \flexiblefalse
- \ifnum#1=\zerocount
- \zerotrue \else
- \zerofalse \fi
- \ifnum#1<\zerocount
- \positivefalse \else
- \positivetrue \fi
- \ifnum#1>\zerocount
- \negativefalse \else
- \negativetrue \fi}
-
-\def\investigatemuskip#1%
- {\relax
- \edef\!!stringa{\the\scratchmuskip}%
- \edef\!!stringb{0mu}%
- \def\!!stringc##1##2\\{##1}%
- \expandafter\edef\expandafter\!!stringc\expandafter
- {\expandafter\!!stringc\!!stringa\\}%
- \edef\!!stringd{-}%
- \flexiblefalse
- \ifx\!!stringa\!!stringb
- \zerotrue
- \negativefalse
- \positivefalse
- \else
- \zerofalse
- \ifx\!!stringc\!!stringd
- \positivefalse
- \negativetrue
- \else
- \positivetrue
- \negativefalse
- \fi
- \fi}
-
-%D Now the neccessary utility macros are defined, we can make a
-%D start with the visualizing ones. The implementation of these
-%D macros is a compromise between readability, efficiency of
-%D coding and processing speed. Sometimes we do in steps what
-%D could have been done in combination, sometimes we use a few
-%D boxes more or less then actually needed, and more than once
-%D one can find the same piece of rule drawing code twice.
-
-%D \macros
-%D {ifcenteredvcue,normalvcue}
-%D
-%D Depending on the context, one can force visual vertical cues
-%D being centered along \type{\hsize} or being put at the
-%D current position. Although centering often looks better,
-%D we've chosen the second alternative as default. The main
-%D reason for doing so is that often when we don't set the
-%D \type{\hsize} ourselves, \TEX\ takes the value of the
-%D surrounding box. As a result the visual cues can migrate
-%D outside the current context.
-%D
-%D This behavior is accomplished by a small but effective
-%D auxiliary macro, which behavior can be influenced by the
-%D boolean \type{\centeredvcue}. By saying
-%D
-%D \starttyping
-%D \centeredvcuetrue
-%D \stoptyping
-%D
-%D one turns centering on. As said, we turn it off.
-
-\newif\ifcenteredvcue \centeredvcuefalse
-
-\def\normalvcue#1%
- {\normalhbox \ifcenteredvcue to \hsize \fi {\normalhss#1\normalhss}}
-
-%D We could have used the more robust version
-%D
-%D \starttyping
-%D \def\normalvcue%
-%D {\normalhbox \ifcenteredvcue to \hsize \fi
-%D \bgroup\bgroup\normalhss
-%D \aftergroup\normalhss\aftergroup\egroup
-%D \let\next=}
-%D \stoptyping
-%D
-%D or the probably best one:
-%D
-%D \starttyping
-%D \def\normalvcue%
-%D {\hbox \ifcenteredvcue to \hsize
-%D \bgroup\bgroup\normalhss
-%D \aftergroup\normalhss\aftergroup\egroup
-%D \else
-%D \bgroup
-%D \fi
-%D \let\next=}
-%D \stoptyping
-%D
-%D Because we don't have to preserve \CATCODES\ and only use
-%D small arguments, we stick to the first alternative.
-
-%D \macros
-%D {testrulewidth}
-%D
-%D We build our visual cues out of rules. At the cost of a much
-%D bigger \DVI\ file, this is to be prefered over using
-%D characters (1)~because we cannot be sure of their
-%D availability and (2)~because their dimensions are fixed.
-%D
-%D As with ruled boxes, we use a \DIMENSION\ to specify the
-%D width of the ruled elements. This dimension defaults to:
-%D
-%D \starttyping
-%D \testrulewidth=\boxrulewidth
-%D \stoptyping
-%D
-%D Because we prefer whole numbers for specifying the
-%D dimensions, we often use even multiples of
-%D \type{\testrulewidth}.
-
-%D \macros
-%D {visiblestretch}
-%D
-%D A second variable is introduced because of the stretch
-%D components of \SKIPS. At the cost of some accuracy we can
-%D make this stretch visible.
-%D
-%D \starttyping
-%D \visiblestretchtrue
-%D \stoptyping
-
-\newdimen\testrulewidth \testrulewidth=\boxrulewidth
-\newif\ifvisiblestretch \visiblestretchfalse
-
-%D \macros
-%D {ruledhss,
-%D ruledhfil,ruledhfilneg,
-%D ruledhfill,ruledhfillneg}
-%D
-%D We start with the easiest part, the fills. The scheme we
-%D follow is {\em visual filling -- going back -- normal
-%D filling}. Visualizing is implemented using \type{\cleaders}.
-%D Because the \BOX\ that follows this command is constructed
-%D only once, the \type{\copy} is not really a prerequisite. We
-%D prefer using a \type{\normalhbox} here instead of a
-%D \type{\hbox}.
-
-\def\setvisiblehfilbox#1\to#2#3#4%
- {\setbox#1\normalhbox
- {\visualvrule
- \!!width #2\testrulewidth
- \!!height#3\testrulewidth
- \!!depth #4\testrulewidth}%
- \smashbox#1}
-
-\def\doruledhfiller#1#2#3#4%
- {#1#2%
- \bgroup
- \dontinterfere
- \dontcomplain
- \setvisiblehfilbox0\to{4}{#3}{#4}%
- \setvisiblehfilbox2\to422%
- \copy0\copy2
- \bgroup
- \setvisiblehfilbox0\to422%
- \cleaders
- \normalhbox to 12\testrulewidth
- {\normalhss\copy0\normalhss}%
- #1%
- \egroup
- \setbox0\normalhbox
- {\normalhskip-4\testrulewidth\copy0\copy2}%
- \smashbox0%
- \box0
- \egroup}
-
-%D The horizontal fillers differ in their boundary
-%D visualization. Watch the small dots. Fillers can be
-%D combined within reasonable margins.
-%D
-%D \startlinecorrection
-%D \baselinerulefalse
-%D \ruledhbox to \hsize
-%D {\strut\type{\hss}\ruledhss test}
-%D \stoplinecorrection
-%D
-%D \startlinecorrection
-%D \baselinerulefalse
-%D \ruledhbox to \hsize
-%D {\strut\type{\hfil}\ruledhfil test}
-%D \stoplinecorrection
-%D
-%D \startlinecorrection
-%D \baselinerulefalse
-%D \ruledhbox to \hsize
-%D {\strut\type{\hfill}\ruledhfill test}
-%D \stoplinecorrection
-%D
-%D \startlinecorrection
-%D \baselinerulefalse
-%D \ruledhbox to \hsize
-%D {\strut
-%D \type{\hfil}\type{\hfil}\ruledhfil\ruledhfil
-%D test%
-%D \ruledhfil\type{\hfil}}
-%D \stoplinecorrection
-%D
-%D The negative counterparts are visualizes, but seldom
-%D become visible, apart from their boundaries.
-%D
-%D \startlinecorrection
-%D \baselinerulefalse
-%D \ruledhbox to \hsize
-%D {\strut\type{\hfilneg}\ruledhfilneg test}
-%D \stoplinecorrection
-%D
-%D \startlinecorrection
-%D \baselinerulefalse
-%D \ruledhbox to \hsize
-%D {\strut\type{\hfillneg}\ruledhfillneg test}
-%D \stoplinecorrection
-%D
-%D Although leaders are used for visualizing, they are
-%D visualized themselves correctly as the next example shows.
-%D
-%D \startlinecorrection
-%D \baselinerulefalse
-%D \ruledhbox to \hsize
-%D {\strut\cleaders\normalhbox to 2em{\normalhss$\circ$\normalhss}\ruledhfill}
-%D \stoplinecorrection
-%D
-%D All five substitutions use the same auxiliary macro. Watch
-%D the positive first -- negative next approach.
-
-\unexpanded\def\ruledhss
- {\doruledhfiller\normalhss\normalhfilneg{0}{0}}
-
-\unexpanded\def\ruledhfil
- {\doruledhfiller\normalhfil\normalhfilneg{10}{-6}}
-
-\unexpanded\def\ruledhfill
- {\doruledhfiller\normalhfill\normalhfillneg{18}{-14}}
-
-\unexpanded\def\ruledhfilneg
- {\doruledhfiller\normalhfilneg\normalhfil{-6}{10}}
-
-\unexpanded\def\ruledhfillneg
- {\doruledhfiller\normalhfillneg\normalhfill{-14}{18}}
-
-%D \macros
-%D {ruledvss,
-%D ruledvfil,ruledvfilneg,
-%D ruledvfill,ruledvfillneg}
-%D
-%D The vertical mode commands adopt the same visualization
-%D scheme, but are implemented in a slightly different way.
-
-\def\setvisiblevfilbox#1\to#2#3#4%
- {\setbox#1\normalhbox
- {\visualvrule
- \!!width #2\testrulewidth
- \!!height#3\testrulewidth
- \!!depth #4\testrulewidth}%
- \smashbox#1}%
-
-\def\doruledvfiller#1#2#3%
- {#1#2%
- \bgroup
- \dontinterfere
- \dontcomplain
- \normaloffinterlineskip
- \setvisiblevfilbox0\to422%
- \setbox2\normalvcue
- {\normalhskip -#3\testrulewidth\copy0}%
- \smashbox2%
- \copy2
- \bgroup
- \setbox2\normalvcue
- {\normalhskip -2\testrulewidth\copy0}%
- \smashbox2%
- \copy2
- \cleaders
- \normalvbox to 12\testrulewidth
- {\normalvss\copy2\normalvss}%
- #1%
- \setbox2\normalvbox
- {\normalvskip-2\testrulewidth\copy2}%
- \smashbox2%
- \box2
- \egroup
- \box2
- \egroup}
-
-%D Because they act the same as their horizontal counterparts
-%D we only show a few examples.
-%D
-%D \startlinecorrection
-%D \hbox to \hsize
-%D {\dontinterfere
-%D \baselinerulefalse
-%D \centeredvcuetrue
-%D \ruledvbox to 10ex
-%D {\hsize.18\hsize
-%D \type{\vss}\ruledvss last line}\normalhss
-%D \ruledvbox to 10ex
-%D {\hsize.18\hsize
-%D \type{\vfil}\ruledvfil last line}\normalhss
-%D \ruledvbox to 10ex
-%D {\hsize.18\hsize
-%D \type{\vfill}\ruledvfill last line}\normalhss
-%D \ruledvbox to 10ex
-%D {\hsize.18\hsize
-%D \type{\vfilneg}\ruledvfilneg last line}\normalhss
-%D \ruledvbox to 10ex
-%D {\hsize.18\hsize
-%D \type{\vfillneg}\ruledvfillneg last line}}
-%D \stoplinecorrection
-%D
-%D Keep in mind that \type{\vfillneg} is not part of \PLAIN\
-%D \TEX, but are mimmicked by a macro.
-
-\unexpanded\def\ruledvss {\doruledvfiller\normalvss \normalvfilneg {2}}
-\unexpanded\def\ruledvfil {\doruledvfiller\normalvfil \normalvfilneg {-4}}
-\unexpanded\def\ruledvfill {\doruledvfiller\normalvfill \normalvfillneg{-12}}
-\unexpanded\def\ruledvfilneg {\doruledvfiller\normalvfilneg \normalvfil {8}}
-\unexpanded\def\ruledvfillneg{\doruledvfiller\normalvfillneg\normalvfill {16}}
-
-%D \macros
-%D {ruledhskip}
-%D
-%D Skips differ from kerns in two important aspects:
-%D
-%D \startitemize[packed]
-%D \item line and pagebreaks are allowed at a skip
-%D \item skips can have a positive and/or negative
-%D stretchcomponent
-%D \stopitemize
-%D
-%D Stated a bit different: kerns are fixed skips at which no
-%D line or pagebreak can occur. Because skips have a more open
-%D character, they are visualized in a open way.
-%D
-%D \startbuffer
-%D one
-%D \hskip +30pt plus 5pt
-%D two
-%D \hskip +30pt
-%D \hskip -10pt plus 5pt
-%D three
-%D \hskip 0pt
-%D four
-%D \hskip +30pt
-%D five
-%D \stopbuffer
-%D
-%D \ShowBufferedExample
-%D
-%D When skips have a stretch component, this is visualized by
-%D means of a dashed line. Positive skips are on top of the
-%D baseline, negative ones are below it. This way we can show
-%D the combined results. An alternative visualization of
-%D stretch could be drawing the mid line over a length of the
-%D stretch, in positive or negative direction.
-
-\def\doruledhskip
- {\relax
- \dontinterfere
- \dontcomplain
- \investigateskip\scratchskip
- \ifzero
- \setbox0\normalhbox
- {\normalhskip-\testrulewidth
- \visualvrule
- \!!width4\testrulewidth
- \!!height16\testrulewidth
- \!!depth16\testrulewidth}%
- \else
- \setbox0\normalhbox to \ifnegative-\fi\scratchskip
- {\visualvrule
- \!!width2\testrulewidth
- \ifnegative\!!depth\else\!!height\fi16\testrulewidth
- \cleaders
- \visualhrule
- \ifnegative
- \!!depth2\testrulewidth
- \!!height\zeropoint
- \else
- \!!height2\testrulewidth
- \!!depth\zeropoint
- \fi
- \normalhfill
- \ifflexible
- \normalhskip\ifnegative\else-\fi\scratchskip
- \normalhskip2\testrulewidth
- \cleaders
- \normalhbox
- {\normalhskip 2\testrulewidth
- \visualvrule
- \!!width2\testrulewidth
- \!!height\ifnegative-7\else9\fi\testrulewidth
- \!!depth\ifnegative9\else-7\fi\testrulewidth
- \normalhskip 2\testrulewidth}%
- \normalhfill
- \fi
- \visualvrule
- \!!width2\testrulewidth
- \ifnegative\!!depth\else\!!height\fi16\testrulewidth}%
- \setbox0\normalhbox
- {\ifnegative\else\normalhskip-\scratchskip\fi
- \box0}%
- \fi
- \smashbox0%
- \ifvisiblestretch \else
- \flexiblefalse
- \fi
- \ifflexible
- % breaks ok but small displacements can occur
- \skip2\scratchskip
- \advance\skip2 -1\scratchskip
- \divide\skip2 2
- \advance\scratchskip -\skip2
- \normalhskip\scratchskip
- \normalpenalty\!!tenthousand
- \box0
- \normalhskip\skip2
- \else
- \normalhskip\scratchskip
- \box0
- \fi
- \egroup}
-
-\unexpanded\def\ruledhskip
- {\bgroup
- \afterassignment\doruledhskip
- \scratchskip=}
-
-%D The visual skip is located at a feasible point. Normally
-%D this does not interfere with the normaltypesetting process.
-%D The next examples show (1)~the default behavior, (2)~the
-%D (not entirely correct) distributed stretch and (3)~the way
-%D the text is typeset without cues.
-%D
-%D \startbuffer
-%D \dorecurse
-%D {15}
-%D {test\hskip1em plus .5em minus .5em
-%D test\hskip2em
-%D test}
-%D \stopbuffer
-%D
-%D \startlinecorrection
-%D \showmakeup
-%D \getbuffer
-%D \stoplinecorrection
-%D
-%D \startlinecorrection
-%D \showmakeup
-%D \visiblestretchtrue
-%D \getbuffer
-%D \stoplinecorrection
-%D
-%D \startlinecorrection
-%D \getbuffer
-%D \stoplinecorrection
-
-%D \macros
-%D {ruledvskip}
-%D
-%D We are less fortunate when implementing the vertical skips.
-%D This is a direct result of interference between the boxes that
-%D visualize the skip and skip removal at a pagebreak. Normally
-%D skips disappear at the top of a page, but not of course when
-%D visualized in a \type{\vbox}. A quite perfect simulation
-%D could have been built if we would have had available two
-%D more primitives: \type{\hnop} and \type{\vnop}. These new
-%D primitives could stand for boxes that are visible but are
-%D not taken into account in any way. They are there for us,
-%D but not for \TEX.
-%D
-%D \startbuffer
-%D first line
-%D \vskip +30pt plus 5pt
-%D second line
-%D \vskip +30pt
-%D \vskip -10pt plus 5pt
-%D third line
-%D \par
-%D fourth line
-%D \vskip +30pt
-%D fifth line
-%D \vskip 0pt
-%D sixth line
-%D \stopbuffer
-%D
-%D \ShowBufferedExample
-%D
-%D We have to postpone \type{\prevdepth}. Although this
-%D precaution probably is not completely waterproof, it works
-%D quite well.
-
-\def\dodoruledvskip
- {\nextdepth\prevdepth
- \dontinterfere
- \dontcomplain
- \normaloffinterlineskip
- \investigateskip\scratchskip
- \ifzero
- \setbox0\normalvcue
- {\visualvrule
- \!!width32\testrulewidth
- \!!height2\testrulewidth
- \!!depth2\testrulewidth}%
- \else
- \setbox0\normalvbox to \ifnegative-\fi\scratchskip
- {\visualhrule
- \!!width16\testrulewidth
- \!!height2\testrulewidth
- \ifflexible
- \cleaders
- \normalhbox to 16\testrulewidth
- {\normalhss
- \normalvbox
- {\normalvskip 2\testrulewidth
- \visualhrule
- \!!width2\testrulewidth
- \!!height2\testrulewidth
- \normalvskip 2\testrulewidth}%
- \normalhss}%
- \normalvfill
- \else
- \normalvfill
- \fi
- \visualhrule
- \!!width16\testrulewidth
- \!!height2\testrulewidth}%
- \setbox2\normalvbox to \ht0
- {\visualhrule
- \!!width2\testrulewidth
- \!!height\ht0}%
- \ifnegative
- \ht0\zeropoint
- \setbox0\normalhbox
- {\normalhskip2\testrulewidth % will be improved
- \normalhskip-\wd0\box0}%
- \fi
- \smashbox0%
- \smashbox2%
- \setbox0\normalvcue
- {\box2\box0}%
- \setbox0\normalvbox
- {\ifnegative\normalvskip\scratchskip\fi\box0}%
- \smashbox0%
- \fi
- \ifvisiblestretch
- \ifflexible
- \skip2\scratchskip
- \advance\skip2 -1\scratchskip
- \divide\skip2 2
- \advance\scratchskip -\skip2
- \normalvskip\skip2
- \fi
- \fi
- \normalpenalty\!!tenthousand
- \box0
- \prevdepth\nextdepth % not \dp0=\nextdepth
- \normalvskip\scratchskip}
-
-%D We try to avoid interfering at the top of a page. Of course
-%D we only do so when we are in the main vertical list.
-
-\def\doruledvskip
- {\endgraf % \par
- \ifdim\pagegoal=\maxdimen
- \ifinner
- \dodoruledvskip
- \fi
- \else
- \dodoruledvskip
- \fi
- \egroup}
-
-\unexpanded\def\ruledvskip
- {\bgroup
- \afterassignment\doruledvskip
- \scratchskip=}
-
-%D \macros
-%D {ruledkern}
-%D
-%D The macros that implement the kerns are a bit more
-%D complicated than needed, because they also serve the
-%D visualization of glue, our \PLAIN\ defined kerns with
-%D stretch or shrink. We've implemented both horizontal and
-%D vertical kerns as ruled boxes.
-%D
-%D \startbuffer
-%D one
-%D \kern +30pt
-%D two
-%D \kern +30pt
-%D \kern -10pt
-%D three
-%D \kern 0pt
-%D four
-%D \kern +30pt
-%D five
-%D \stopbuffer
-%D
-%D \ShowBufferedExample
-%D
-%D Positive and negative kerns are placed on top or below the
-%D baseline, so we are able to track their added result. We
-%D didn't mention spacings of 0~pt yet. Zero values are
-%D visualized a bit different, because we want to see them
-%D anyhow.
-
-\def\doruledhkern
- {\dontinterfere
- \dontcomplain
- \baselinerulefalse
- \investigateskip\scratchskip
- \boxrulewidth2\testrulewidth
- \ifzero
- \setbox0\ruledhbox to 8\testrulewidth
- {\visualvrule
- \!!width\zeropoint
- \!!height16\testrulewidth
- \!!depth16\testrulewidth}%
- \setbox0\normalhbox
- {\normalhskip-4\testrulewidth\box0}%
- \else
- \setbox0\ruledhbox to \ifnegative-\fi\scratchskip
- {\visualvrule
- \!!width\zeropoint
- \ifnegative\!!depth\else\!!height\fi16\testrulewidth
- \ifflexible
- \normalhskip2\testrulewidth
- \cleaders
- \normalhbox
- {\normalhskip 2\testrulewidth
- \visualvrule
- \!!width2\testrulewidth
- \!!height\ifnegative-7\else9\fi\testrulewidth
- \!!depth\ifnegative9\else-7\fi\testrulewidth
- \normalhskip 2\testrulewidth}%
- \normalhfill
- \else
- \normalhfill
- \fi}%
- \testrulewidth2\testrulewidth
- \setbox0\ruledhbox{\box0}% \make...
- \fi
- \smashbox0%
- \normalpenalty\!!tenthousand
- \normalhbox to \zeropoint
- {\ifnegative\normalhskip1\scratchskip\fi
- \box0}%
- \afterwards\scratchskip
- \egroup}
-
-\unexpanded\def\ruledhkern#1%
- {\bgroup
- \let\afterwards#1%
- \afterassignment\doruledhkern
- \scratchskip=}
-
-%D After having seen the horizontal ones, the vertical kerns
-%D will not surprise us. In this example we use \type{\par} to
-%D switch to vertical mode.
-%D
-%D \startbuffer
-%D first line
-%D \par \kern +30pt
-%D second line
-%D \par \kern +30pt
-%D \par \kern -10pt
-%D third line
-%D \par
-%D fourth line
-%D \par \kern +30pt
-%D fifth line
-%D \par \kern 0pt
-%D sixth line
-%D \stopbuffer
-%D
-%D \ShowBufferedExample
-%D
-%D Like before, we have to postpone \type{\prevdepth}. If we
-%D leave out this trick, we got ourselves some wrong spacing.
-
-\def\dodoruledvkern
- {\nextdepth\prevdepth
- \dontinterfere
- \dontcomplain
- \baselinerulefalse
- \normaloffinterlineskip
- \investigateskip\scratchskip
- \boxrulewidth2\testrulewidth
- \ifzero
- \setbox0\ruledhbox to 32\testrulewidth
- {\visualvrule
- \!!width\zeropoint
- \!!height4\testrulewidth
- \!!depth4\testrulewidth}%
- \else
- \setbox0\ruledvbox to \ifnegative-\fi\scratchskip
- {\hsize16\testrulewidth
- \ifflexible
- \cleaders
- \normalhbox to 16\testrulewidth
- {\normalhss
- \normalvbox
- {\normalvskip 2\testrulewidth
- \visualhrule
- \!!width2\testrulewidth
- \!!height2\testrulewidth
- \normalvskip 2\testrulewidth}%
- \normalhss}%
- \normalvfill
- \else
- \visualvrule
- \!!width\zeropoint
- \!!height\ifnegative-\fi\scratchskip
- \normalhfill
- \fi}
- \fi
- \testrulewidth2\testrulewidth
- \setbox0\ruledvbox{\box0}% \make...
- \smashbox0%
- \setbox0\normalvbox
- {\ifnegative\normalvskip\scratchskip\fi
- \normalvcue
- {\ifnegative\normalhskip-16\testrulewidth\fi\box0}}%
- \smashbox0%
- \normalpenalty\!!tenthousand
- \box0
- \prevdepth\nextdepth} % not \dp0=\nextdepth
-
-\def\doruledvkern
- {\ifdim\pagegoal=\maxdimen
- \ifinner
- \dodoruledvkern
- \fi
- \else
- \dodoruledvkern
- \fi
- \afterwards\scratchskip
- \egroup}
-
-\unexpanded\def\ruledvkern#1%
- {\bgroup
- \let\afterwards#1\relax
- \afterassignment\doruledvkern
- \scratchskip=}
-
-\unexpanded\def\ruledkern
- {\ifvmode
- \expandafter\ruledvkern
- \else
- \expandafter\ruledhkern
- \fi
- \normalkern}
-
-%D A a bit more \TEX nice solution is:
-%D
-%D \starttyping
-%D \unexpanded\def\ruledkern%
-%D {\csname ruled\ifvmode v\else h\fi kern\endcsname\normalkern}
-%D \stoptyping
-
-%D \macros
-%D {ruledhglue,ruledvglue}
-%D
-%D The non-primitive glue commands are treated as kerns with
-%D stretch. This stretch is presented as a dashed line. I
-%D have to admit that until now, I've never used these glue
-%D commands.
-%D
-%D \startbuffer
-%D one
-%D \hglue +30pt plus 5pt
-%D two
-%D \hglue +30pt
-%D \hglue -10pt plus 5pt
-%D three
-%D \hglue 0pt
-%D four
-%D \hglue +30pt
-%D five
-%D \stopbuffer
-%D
-%D \ShowBufferedExample
-
-\def\doruledhglue
- {\leavevmode
- \scratchcounter\spacefactor
- \visualvrule\!!width\zeropoint
- \normalpenalty\!!tenthousand
- \ruledhkern\normalhskip\scratchskip
- \spacefactor\scratchcounter
- \egroup}
-
-\unexpanded\def\ruledhglue
- {\bgroup
- \afterassignment\doruledhglue\scratchskip=}
-
-%D \startbuffer
-%D first line
-%D \vglue +30pt plus 5pt
-%D second line
-%D \vglue +30pt
-%D \vglue -10pt plus 5pt
-%D third line
-%D \par
-%D fourth line
-%D \vglue +30pt
-%D fifth line
-%D \vglue 0pt
-%D sixth line
-%D \stopbuffer
-%D
-%D \ShowBufferedExample
-
-\def\doruledvglue
- {\endgraf % \par
- \nextdepth\prevdepth
- \visualhrule\!!height\zeropoint
- \normalpenalty\!!tenthousand
- \ruledvkern\normalvskip\scratchskip
- \prevdepth\nextdepth
- \egroup}
-
-\unexpanded\def\ruledvglue
- {\bgroup
- \afterassignment\doruledvglue\scratchskip=}
-
-%D \macros
-%D {ruledmkern,ruledmskip}
-%D
-%D Mathematical kerns and skips are specified in mu. This
-%D font related unit is incompatible with those of \DIMENSIONS\
-%D and \SKIPS. Because in math mode spacing is often a very
-%D subtle matter, we've used a very simple, not overloaded way
-%D to show them.
-
-\def\dodoruledmkern#1%
- {\dontinterfere
- \dontcomplain
- \setbox0\normalhbox
- {$\normalmkern\ifnegative-\fi\scratchmuskip$}%
- \setbox0\normalhbox to \wd0
- {\visualvrule
- \!!height16\testrulewidth
- \!!depth16\testrulewidth
- \!!width\testrulewidth
- \leaders
- \visualhrule
- \!!height\ifpositive16\else-14\fi\testrulewidth
- \!!depth\ifpositive-14\else16\fi\testrulewidth
- \normalhfill
- \ifflexible
- \normalhskip-\wd0
- \leaders
- \visualhrule
- \!!height\testrulewidth
- \!!depth\testrulewidth
- \normalhfill
- \fi
- \visualvrule
- \!!height16\testrulewidth
- \!!depth16\testrulewidth
- \!!width\testrulewidth}%
- \smashbox0%
- \ifnegative
- #1\scratchmuskip
- \box0
- \else
- \box0
- #1\scratchmuskip
- \fi
- \egroup}
-
-%D \startbuffer
-%D $a \mkern3mu = \mkern3mu
-%D b \quad
-%D \mkern-2mu + \mkern-2mu
-%D \quad c$
-%D \stopbuffer
-%D
-%D \ShowBufferedExample
-
-\def\doruledmkern
- {\investigatemuskip\scratchmuskip
- \flexiblefalse
- \dodoruledmkern\normalmkern}
-
-\unexpanded\def\ruledmkern
- {\bgroup
- \afterassignment\doruledmkern\scratchmuskip=}
-
-%D \startbuffer
-%D $a \mskip3mu = \mskip3mu
-%D b \quad
-%D \mskip-2mu + \mskip-2mu
-%D \quad c$
-%D \stopbuffer
-%D
-%D \ShowBufferedExample
-
-\def\doruledmskip
- {\investigatemuskip\scratchmuskip
- \flexibletrue
- \dodoruledmkern\normalmskip}
-
-\unexpanded\def\ruledmskip
- {\bgroup
- \afterassignment\doruledmskip\scratchmuskip=}
-
-%D \macros
-%D {penalty}
-%D
-%D After presenting fills, skip, kerns and glue we've come to
-%D see penalties. In the first implementation --- most of the
-%D time needed to develop this set of macros went into testing
-%D different types of visualization --- penalties were mere
-%D small blocks with one black half, depending on the sign.
-%D This most recent version also gives an indication of the
-%D amount of penalty. Penalties can go from less than $-10000$
-%D to over $+10000$, and their behavior is somewhat
-%D non-lineair, with some values having special meanings. We
-%D therefore decided not to use its value for a lineair
-%D indicator.
-%D
-%D \startbuffer
-%D one
-%D \penalty +100
-%D two
-%D \penalty +100
-%D \penalty -100
-%D three
-%D \penalty 0
-%D four
-%D \penalty +100
-%D five
-%D \stopbuffer
-%D
-%D \ShowBufferedExample
-%D
-%D The small sticks at the side of the penalty indicate it
-%D size. The next example shows the positive and negative
-%D penalties of 0, 1, 10, 100, 1000 and 10000.
-%D
-%D \startlinecorrection
-%D \hbox
-%D {test \ruledhpenalty0
-%D test \ruledhpenalty1
-%D test \ruledhpenalty10
-%D test \ruledhpenalty100
-%D test \ruledhpenalty1000
-%D test \ruledhpenalty10000
-%D test}
-%D \stoplinecorrection
-%D
-%D \blank
-%D
-%D \startlinecorrection
-%D \hbox
-%D {test \ruledhpenalty0
-%D test \ruledhpenalty-1
-%D test \ruledhpenalty-10
-%D test \ruledhpenalty-100
-%D test \ruledhpenalty-1000
-%D test \ruledhpenalty-10000
-%D test}
-%D \stoplinecorrection
-%D
-%D \blank
-%D
-%D This way stacked penalties of different severance can be
-%D shown in combination.
-%D
-%D test \ruledhpenalty10 \ruledhpenalty100
-%D test
-%D test \ruledhpenalty1000 \ruledhpenalty-1000
-%D test
-
-\def\setruledpenaltybox#1#2#3#4#5#6%
- {\setbox#1\normalhbox
- {\ifnum#2=0 \else
- \edef\sign
- {\ifnum#2>0 +\else-\fi}%
- \dimen0=\ifnum\sign#2>9999
- 28\else
- \ifnum\sign#2>999
- 22\else
- \ifnum\sign#2>99
- 16\else
- \ifnum\sign#2>9
- 10\else
- 4
- \fi\fi\fi\fi \testrulewidth
- \ifnum#2<0
- \normalhskip-\dimen0
- \normalhskip-2\testrulewidth
- \visualvrule
- \!!width2\testrulewidth
- \!!height#3\testrulewidth
- \!!depth#4\testrulewidth
- \fi
- \visualvrule
- \!!width\dimen0
- \!!height#5\testrulewidth
- \!!depth#6\testrulewidth
- \ifnum#2>0
- \visualvrule
- \!!width2\testrulewidth
- \!!height#3\testrulewidth
- \!!depth#4\testrulewidth
- \fi
- \fi}%
- \smashbox#1}
-
-\def\doruledhpenalty
- {\dontinterfere
- \dontcomplain
- \investigatecount\scratchcounter
- \testrulewidth2\testrulewidth
- \boxrulewidth\testrulewidth
- \setbox0\ruledhbox to 8\testrulewidth
- {\ifnegative\else\normalhss\fi
- \visualvrule
- \!!depth8\testrulewidth
- \!!width\ifzero0\else4\fi\testrulewidth
- \ifpositive\else\normalhss\fi}%
- \setruledpenaltybox{2}{\scratchcounter}{0}{8}{-3.5}{4.5}%
- \normalpenalty\!!tenthousand
- \setbox0\normalhbox
- {\normalhskip-4\testrulewidth
- \ifnegative
- \box2\box0
- \else
- \box0\box2
- \fi}%
- \smashbox0%
- \box0
- \normalpenalty\scratchcounter
- \egroup}
-
-\unexpanded\def\ruledhpenalty
- {\bgroup
- \afterassignment\doruledhpenalty
- \scratchcounter=}
-
-%D The size of a vertical penalty is also shown on the
-%D horizontal axis. This way there is less interference with
-%D the often preceding or following skips and kerns.
-%D
-%D \startbuffer
-%D first line
-%D \par \penalty +100
-%D second line
-%D \par \penalty +100
-%D \par \penalty -100
-%D third line
-%D \par \penalty 0
-%D fourth line
-%D \par \penalty +100
-%D fifth line
-%D \stopbuffer
-%D
-%D \ShowBufferedExample
-
-\def\doruledvpenalty
- {\ifdim\pagegoal=\maxdimen
- \else
- \nextdepth\prevdepth
- \dontinterfere
- \dontcomplain
- \investigatecount\scratchcounter
- \testrulewidth2\testrulewidth
- \boxrulewidth\testrulewidth
- \setbox0\ruledhbox
- {\visualvrule
- \!!height4\testrulewidth
- \!!depth4\testrulewidth
- \!!width\zeropoint
- \visualvrule
- \!!height\ifnegative.5\else4\fi\testrulewidth
- \!!depth\ifpositive.5\else4\fi\testrulewidth
- \!!width8\testrulewidth}%
- \setruledpenaltybox{2}{\scratchcounter}{4}{4}{.5}{.5}%
- \setbox0\normalhbox
- {\normalhskip-4\testrulewidth
- \ifnegative
- \box2\box0
- \else
- \box0\box2
- \fi
- \normalhss}%
- \smashbox0%
- \normalpenalty\!!tenthousand
- \nointerlineskip
- \dp0\nextdepth % not \prevdepth=\nextdepth
- \normalvbox
- {\normalvcue{\box0}}%
- \fi
- \normalpenalty\scratchcounter
- \egroup}
-
-\unexpanded\def\ruledvpenalty
- {\bgroup
- \afterassignment\doruledvpenalty
- \scratchcounter=}
-
-\unexpanded\def\ruledpenalty
- {\ifvmode
- \expandafter\ruledvpenalty
- \else
- \expandafter\ruledhpenalty
- \fi}
-
-%D At the cost of some more tokens, a bit more clever
-%D implementation would be:
-%D
-%D \starttyping
-%D \unexpanded\def\ruledpenalty%
-%D {\csname ruled\ifvmode v\else h\fi penalty\endcsname}
-%D \stoptyping
-
-%D \macros
-%D {showfils,dontshowfils,
-%D showboxes,dontshowboxes,
-%D showskips,dontshowskips,
-%D showpenalties,dontshowpenalties}
-%D
-%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
- {\showingcompositiontrue
- \let\hss \ruledhss
- \let\hfil \ruledhfil
- \let\hfill \ruledhfill
- \let\hfilneg \ruledhfilneg
- \let\hfillneg \ruledhfillneg
- \let\vss \ruledvss
- \let\vfil \ruledvfil
- \let\vfill \ruledvfill
- \let\vfilneg \ruledvfilneg
- \let\vfillneg \ruledvfillneg}
-
-\def\dontshowfils
- {\let\hss \normalhss
- \let\hfil \normalhfil
- \let\hfill \normalhfill
- \let\hfilneg \normalhfilneg
- \let\hfillneg \normalhfillneg
- \let\vss \normalvss
- \let\vfil \normalvfil
- \let\vfill \normalvfill
- \let\vfilneg \normalvfilneg
- \let\vfillneg \normalvfillneg}
-
-\def\showboxes
- {\showingcompositiontrue
- \baselineruletrue
- \let\hbox \ruledhbox
- \let\vbox \ruledvbox
- \let\vtop \ruledvtop
- \let\vcenter \ruledvcenter}
-
-\def\dontshowboxes
- {\let\hbox \normalhbox
- \let\vbox \normalvbox
- \let\vtop \normalvtop
- \let\vcenter \normalvcenter}
-
-\def\showskips
- {\showingcompositiontrue
- \let\hskip \ruledhskip
- \let\vskip \ruledvskip
- \let\kern \ruledkern
- \let\mskip \ruledmskip
- \let\mkern \ruledmkern
- \let\hglue \ruledhglue
- \let\vglue \ruledvglue}
-
-\def\dontshowskips
- {\let\hskip \normalhskip
- \let\vskip \normalvskip
- \let\kern \normalkern
- \let\mskip \normalmskip
- \let\mkern \normalmkern
- \let\hglue \normalhglue
- \let\vglue \normalvglue}
-
-\def\showpenalties
- {\showingcompositiontrue
- \let\penalty \ruledpenalty}
-
-\def\dontshowpenalties
- {\let\penalty \normalpenalty}
-
-%D \macros
-%D {showcomposition,dontshowcomposition,
-%D showingcomposition}
-%D
-%D All these nice options come together in three macros. One
-%D for turning the options on, one for turning them off, and a
-%D boolean for enabling the mechanism outside the scope of the
-%D user. The first two macros only do their job when we are
-%D actually showing the composition.
-%D
-%D \starttyping
-%D \showingcompositiontrue
-%D \showcomposition
-%D \stoptyping
-%D
-%D Because the output routine can do tricky things, like
-%D multiple column typesetting and manipulation of the
-%D pagebody, shifting things around and so on, the macro
-%D \type{\dontshowcomposition} best can be called when we enter
-%D this routine. Too much visual cues just don't make sense. In
-%D \CONTEXT\ this has been taken care of.
-
-\newif\ifshowingcomposition
-
-\def\showcomposition
- {\ifshowingcomposition
- \showfils
- \showboxes
- \showskips
- \showpenalties
- \fi}
-
-\def\dontshowcomposition
- {\ifshowingcomposition
- \dontshowfils
- \dontshowboxes
- \dontshowskips
- \dontshowpenalties
- \fi}
-
-%D \macros
-%D {showmakeup,
-%D defaulttestrulewidth}
-%D
-%D Just to make things even more easy, we have defined:
-%D
-%D \starttyping
-%D \showmakeup
-%D \stoptyping
-%D
-%D For the sake of those who don't (yet) use \CONTEXT\ we
-%D preset \type{\defaulttestrulewidth} to the already set
-%D value. Otherwise we default to a bodyfontsize related value.
-%D
-%D \starttyping
-%D \def\defaulttestrulewidth{.2pt}
-%D \stoptyping
-%D
-%D Beware, it's a macro not a \DIMENSION.
-
-\ifx\bodyfontsize\undefined
- \edef\defaulttestrulewidth{\the\testrulewidth}
-\else
- \def\defaulttestrulewidth{.02\bodyfontsize}
-\fi
-
-\def\showmakeup
- {\testrulewidth\defaulttestrulewidth
- \showingcompositiontrue
- \showcomposition}
-
-\protect
-
-%D \ifCONTEXT \let\next=\relax \else \let\next=\endinput
-%D The documented source you have been reading was processed
-%D using some surrogate makeup. When this file is processed
-%D in \CONTEXT, a few more examples show up here, like a local
-%D table of contents and a local register.
-%D \fi \next
-
-%D Lets end with some more advanced examples.
-%D Definitions and enumerations come in many flavors. The
-%D next one for instance is defined as:
-%D
-%D \starttyping
-%D \definedescription[test][place=left,hang=3,width=6em]
-%D \stoptyping
-%D
-%D When applied to some text, this would look like:
-%D
-%D \bgroup
-%D \showmakeup
-%D \definedescription[test][location=left,hang=3,width=6em]
-%D
-%D \test{visual\\debugger} I would be very pleased if \TEX\
-%D had two more primitives: \type{\vnop} and \type{\hnop}. Both
-%D should act and show up as normal boxes, but stay invisible
-%D for \TEX\ when it's doing calculations. The \type{\vnop}
-%D for instance should not interact with the internal mechanism
-%D responsible for the disappearing skips, kerns and penalties
-%D at a pagebreak. As long as we don't have these two boxtypes,
-%D visual debugging will never be perfect.
-%D
-%D \egroup
-%D
-%D The index to this section looks like:
-%D
-%D {\setupreferencing[prefixprefix=dummy]\showmakeup\placeindex[criterium=local]}
-%D
-%D Although not impressive examples or typesetting, both
-%D show us how and where things happen. When somehow the last
-%D lines in this two column index don't allign, then this is
-%D due to some still unknown interference.
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/symb-cow.mkii b/Master/texmf-dist/tex/context/base/mkii/symb-cow.mkii
deleted file mode 100644
index 933a00c45e7..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/symb-cow.mkii
+++ /dev/null
@@ -1,132 +0,0 @@
-%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 ADE \& \CONTEXT\ Development Team}]
-%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}}
-\def\CowContourLogo#1{\getglyph{CowsLogoContour}{\char#1\relax}}
-
-\chardef\CowPragmaNormal= 1
-\chardef\CowPragmaShaded=20
-
-\startsymbolset[cownormal]
-
- \definesymbol[CowPragmaADE] [\CowLogo{0}]
- \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[CowTEXComplete] [\CowLogo{18}]
- \definesymbol[CowWikiComplete] [\CowLogo{19}]
- \definesymbol[CowPragmaADEComplete][\CowLogo{20}]
- \definesymbol[CowPragmaComplete] [\CowLogo{21}]
- \definesymbol[CowExample] [\CowLogo{22}]
- \definesymbol[CowFoxet] [\CowLogo{23}]
- \definesymbol[CowTEX] [\CowLogo{24}]
- \definesymbol[CowWiki] [\CowLogo{25}]
- \definesymbol[CowCowTeXtComplete] [\CowLogo{26}]
- \definesymbol[CowCowTeXt] [\CowLogo{27}]
-
-\stopsymbolset
-
-\startsymbolset[cowcontour]
-
- \definesymbol[CowPragmaADE] [\CowContourLogo{0}]
- \definesymbol[CowPragma] [\CowContourLogo{1}]
- \definesymbol[CowConTeXt] [\CowContourLogo{2}]
- \definesymbol[CowConTeXtComplete] [\CowContourLogo{3}]
- \definesymbol[CowConTeXtShadow] [\CowContourLogo{4}]
- \definesymbol[CowConTeXtContour] [\CowContourLogo{5}]
- \definesymbol[CowConTeXtOutline] [\CowContourLogo{6}]
- \definesymbol[CowConTeXtDots] [\CowContourLogo{7}]
- \definesymbol[CowMP] [\CowContourLogo{8}]
- \definesymbol[CowMPComplete] [\CowContourLogo{9}]
- \definesymbol[CowTeX] [\CowContourLogo{10}]
- \definesymbol[CowTeXComplete] [\CowContourLogo{11}]
- \definesymbol[CowBoo] [\CowContourLogo{12}]
- \definesymbol[CowCow] [\CowContourLogo{13}]
- \definesymbol[CowExampleComplete] [\CowContourLogo{14}]
- \definesymbol[CowFoxetComplete] [\CowContourLogo{15}]
- \definesymbol[CowMetafun] [\CowContourLogo{16}]
- \definesymbol[CowMetafunComplete] [\CowContourLogo{17}]
- \definesymbol[CowTEXComplete] [\CowContourLogo{18}]
- \definesymbol[CowWikiComplete] [\CowContourLogo{19}]
- \definesymbol[CowPragmaADEComplete][\CowContourLogo{20}]
- \definesymbol[CowPragmaComplete] [\CowContourLogo{21}]
- \definesymbol[CowExample] [\CowContourLogo{22}]
- \definesymbol[CowFoxet] [\CowContourLogo{23}]
- \definesymbol[CowTEX] [\CowContourLogo{24}]
- \definesymbol[CowWiki] [\CowContourLogo{25}]
- \definesymbol[CowCowTeXtComplete] [\CowContourLogo{26}]
- \definesymbol[CowCowTeXt] [\CowContourLogo{27}]
-
-\stopsymbolset
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/symb-eur.mkii b/Master/texmf-dist/tex/context/base/mkii/symb-eur.mkii
deleted file mode 100644
index 67023ec91c0..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/symb-eur.mkii
+++ /dev/null
@@ -1,64 +0,0 @@
-%D \module
-%D [ file=symb-eur,
-%D version=2000.06.22,
-%D title=\CONTEXT\ Symbol Libraries,
-%D subtitle=Adobe Euro Symbols,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 [original-adobe-euro.map]
-
-\definefontsynonym [EuroSerif] [eurose]
-\definefontsynonym [EuroSerifBold] [euroseb]
-\definefontsynonym [EuroSerifItalic] [eurosei]
-\definefontsynonym [EuroSerifSlanted] [eurosei]
-\definefontsynonym [EuroSerifBoldItalic] [eurosebi]
-\definefontsynonym [EuroSerifBoldSlanted] [eurosebi]
-
-\definefontsynonym [EuroSans] [eurosa]
-\definefontsynonym [EuroSansBold] [eurosab]
-\definefontsynonym [EuroSansItalic] [eurosai]
-\definefontsynonym [EuroSansSlanted] [eurosai]
-\definefontsynonym [EuroSansBoldItalic] [eurosabi]
-\definefontsynonym [EuroSansBoldSlanted] [eurosabi]
-
-\definefontsynonym [EuroMono] [euromo]
-\definefontsynonym [EuroMonoBold] [euromob]
-\definefontsynonym [EuroMonoSlanted] [euromoi]
-\definefontsynonym [EuroMonoItalic] [euromoi]
-\definefontsynonym [EuroMonoBoldItalic] [euromobi]
-\definefontsynonym [EuroMonoBoldSlanted] [euromobi]
-
-\definesymbol [euro] [\getglyph{Euro}{\char160}]
-
-\startencoding[default]
- \definecharacter texteuro {\symbol[euro]}
-\stopencoding
-
-\unexpanded\def\euro{\doiftextelse\texteuro\texteuro{\symbol[euro]}}
-
-% ok for one font series, but not for mixed sets
-%
-% \unexpanded\def\euro
-% {\doiftextelse \texteuro \texteuro
-% {\unexpanded\def\euro{\symbol[euro]}\euro}
-
-%D The next table shows the complete set of symbols:
-%D
-%D \starttabulate[|l|c|c|c|c|c|c|]
-%D \NC \NC \tex{tf} \NC \tex{bf} \NC \tex{sl}
-%D \NC \tex{it} \NC \tex{bs} \NC \tex{bi} \NC\NR
-%D \NC \rm Serif \NC \rm\tf\euro \NC \rm\bf\euro \NC \rm\sl\euro
-%D \NC \rm\it\euro \NC \rm\bs\euro \NC \rm\bi\euro \NC\NR
-%D \NC \ss Sans \NC \ss\tf\euro \NC \ss\bf\euro \NC \ss\sl\euro
-%D \NC \ss\it\euro \NC \ss\bs\euro \NC \ss\bi\euro \NC\NR
-%D \NC \tt Mono \NC \tt\tf\euro \NC \tt\bf\euro \NC \tt\sl\euro
-%D \NC \tt\it\euro \NC \tt\bs\euro \NC \tt\bi\euro \NC\NR
-%D \stoptabulate
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/symb-glm.mkii b/Master/texmf-dist/tex/context/base/mkii/symb-glm.mkii
deleted file mode 100644
index ff94bfe7fc7..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/symb-glm.mkii
+++ /dev/null
@@ -1,79 +0,0 @@
-%D \module
-%D [ file=symb-glm,
-%D version=2002.05.07,
-%D title=\CONTEXT\ Symbol Libraries,
-%D subtitle=Guillemots,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Watch the \type {x} before the local symbols.
-
-% \loadmapfile [ec-public-lm.map]
-% \loadmapfile [ec-lm.map]
-\loadmapfile [lm-ec.map]
-
-% this used to be:
-%
-% \definefontsynonym [GuilSerif] [plr10] [encoding=ec]
-% \definefontsynonym [GuilSerifBold] [plbx10] [encoding=ec]
-% \definefontsynonym [GuilSerifItalic] [plti10] [encoding=ec]
-% \definefontsynonym [GuilSerifSlanted] [plsl10] [encoding=ec]
-% \definefontsynonym [GuilSerifBoldItalic] [plbxti10] [encoding=ec]
-% \definefontsynonym [GuilSerifBoldSlanted] [plbxsl10] [encoding=ec]
-%
-% \definefontsynonym [GuilSans] [plss10] [encoding=ec]
-% \definefontsynonym [GuilSansBold] [plssbx10] [encoding=ec]
-% \definefontsynonym [GuilSansItalic] [plssi10] [encoding=ec]
-% \definefontsynonym [GuilSansSlanted] [plssi10] [encoding=ec]
-% \definefontsynonym [GuilSansBoldItalic] [plssbi10] [encoding=ec]
-% \definefontsynonym [GuilSansBoldSlanted] [plssbi10] [encoding=ec]
-%
-% \definefontsynonym [GuilMono] [pltt10] [encoding=ec]
-%
-% but was also one of the reasons for triggering the lm project, so:
-
-\definefontsynonym [GuilSerif] [ec-lmr10] [encoding=ec]
-\definefontsynonym [GuilSerifBold] [ec-lmbx10] [encoding=ec]
-\definefontsynonym [GuilSerifItalic] [ec-lmti10] [encoding=ec]
-\definefontsynonym [GuilSerifSlanted] [ec-lmsl10] [encoding=ec]
-\definefontsynonym [GuilSerifBoldItalic] [ec-lmbxti10] [encoding=ec]
-\definefontsynonym [GuilSerifBoldSlanted] [ec-lmbxsl10] [encoding=ec]
-
-\definefontsynonym [GuilSans] [ec-lmss10] [encoding=ec]
-\definefontsynonym [GuilSansBold] [ec-lmssbx10] [encoding=ec]
-\definefontsynonym [GuilSansItalic] [ec-lmssi10] [encoding=ec]
-\definefontsynonym [GuilSansSlanted] [ec-lmssi10] [encoding=ec]
-\definefontsynonym [GuilSansBoldItalic] [ec-lmssbi10] [encoding=ec]
-\definefontsynonym [GuilSansBoldSlanted] [ec-lmssbi10] [encoding=ec]
-
-\definefontsynonym [GuilMono] [ec-lmtt10] [encoding=ec]
-%definefontsynonym [GuilMonoBold] [ec-lmtt10] [encoding=ec]
-%definefontsynonym [GuilMonoSlanted] [ec-lmtt10] [encoding=ec]
-%definefontsynonym [GuilMonoItalic] [ec-lmtt10] [encoding=ec]
-%definefontsynonym [GuilMonoBoldItalic] [ec-lmtt10] [encoding=ec]
-%definefontsynonym [GuilMonoBoldSlanted] [ec-lmtt10] [encoding=ec]
-
-\definesymbol [xleftguillemot] [\getglyph{Guil}{\char19}]
-\definesymbol [xrightguillemot] [\getglyph{Guil}{\char20}]
-
-\definesymbol [xguilsingleleft] [\getglyph{Guil}{\char14}]
-\definesymbol [xguilsingleright] [\getglyph{Guil}{\char15}]
-
-%D A strange place, but okay (the \type {\relax} prevents space gobbling)
-
-\startencoding [default]
-
- \definecharacter leftguillemot {\symbol[xleftguillemot]\relax}
- \definecharacter rightguillemot {\symbol[xrightguillemot]\relax}
-
- \definecharacter guilsingleleft {\symbol[xguilsingleleft]\relax}
- \definecharacter guilsingleright {\symbol[xguilsingleright]\relax}
-
-\stopencoding
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/symb-ini.mkii b/Master/texmf-dist/tex/context/base/mkii/symb-ini.mkii
deleted file mode 100644
index 3154c8a04c4..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/symb-ini.mkii
+++ /dev/null
@@ -1,282 +0,0 @@
-%D \module
-%D [ file=symb-ini,
-%D version=1998.07.20,
-%D title=\CONTEXT\ Symbol Libraries,
-%D subtitle=Basic Symbols Commands,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 macros described here used to be part of the \type
-%D {core-con} module. I decided to move them here when
-%D symbolsets saw the light. Let their light shine.
-
-\writestatus{loading}{ConTeXt Symbol Libraries / Initialization}
-
-\unprotect
-
-%D \macros
-%D {definesymbol, symbol}
-%D
-%D Converting numbers or levels into a character, romannumeral,
-%D symbol or something else, is supported by many \CONTEXT\
-%D commands. Therefore we need a mechanism for linking such
-%D numbers to their counterparts.
-%D
-%D First we take care of symbols. These are for instance used
-%D in enumerations and itemizations. We have:
-%D
-%D \showsetup{definesymbol}
-%D \showsetup{symbol}
-%D
-%D Symbols are simply linked to a tag. Such tags can be numbers
-%D or strings.
-%D
-%D \starttyping
-%D \definesymbol [1] [$\bullet$]
-%D \definesymbol [level 5] [$\star$]
-%D \stoptyping
-
-% ss:tag -> symbol
-% ss:set:tag -> symbol out of set
-% sstag -> list of symbols in set
-
-\def\definesymbol
- {\dotripleempty\dodefinesymbol}
-
-% \def\dodefinesymbol[#1][#2][#3]% class name meaning
-% {\ifthirdargument
-% \setvalue{\??ss:#1:#2}{#3}%
-% \doifsomething{#1}{\addvalue{\??ss*#1}{#2}}%
-% \else
-% \setvalue{\??ss:\currentsymboldef:#1}{#2}%
-% \fi}
-
-\def\dodefinesymbol[#1][#2][#3]% class name meaning
- {\ifthirdargument
- \setvalue{\??ss:#1:#2}{#3}%
- \doifsomething{#1}{\addvalue{\??ss*#1}{#2}}%
- \else
- \setvalue{\??ss:\currentsymboldef:#1}{#2}%
- \addvalue{\??ss*\currentsymboldef}{#1}%
- \fi}
-
-\def\doifinsymbolsetelse#1#2{\doifdefinedelse{\??ss:#1:#2}}
-\def\doifinsymbolset #1#2{\doifdefined {\??ss:#1:#2}}
-\def\doifsymbolsetelse #1{\doifdefinedelse{\??ss*#1}}
-
-\def\symbolset#1{\executeifdefined{\??ss*#1}\empty} % no [#1], to be used in commalists etc
-
-%D Since symbols are used frequently in interactive
-%D documents, we speed up this one. Well, that was history,
-%D since now we simplified things a bit, because the low
-%D level macros have been sped up now and then.
-
-\unexpanded\def\symbol % This one always gobbles spaces,
- {\dodoubleempty\dosymbol} % so never change it again!
-
-\newif\ifnosymbol \newtoks\everysymbol
-
-\def\dodosymbol#1#2% \relax's prevent lookahead problems
- {\nosymbolfalse{\the\everysymbol\csname\??ss:#1:#2\endcsname\relax}\relax}
-
-\def\directsymbol#1#2% no \relax, there can be an argument, see lists
- {\executeifdefined{\??ss:#1:#2}\firstofoneargument}
-
-% 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}%
- \doifinsymbolset{#1}{#2}{\dodosymbol{#1}{#2}}%
- \else
- \edef\currentsymbol{#1}%
- \fi
- \ifnosymbol
- \the\symbolsetups
- \ifnosymbol
- \redosymbol\currentsymbol
- \fi
- \fi}
-
-\def\fetchsymbol#1%
- {\ifnosymbol
- \doifinsymbolset{#1}\currentsymbol{\dodosymbol{#1}\currentsymbol}%
- \fi}
-
-\def\redosymbol#1%
-% {\doifinsymbolsetelse\empty{#1}{\dodosymbol\empty{#1}}{#1}} % more efficient:
- {\doifinsymbolsetelse\empty{#1}{\dodosymbol\empty}\firstofoneargument{#1}}
-
-% % % % %
-% this should go in symb-fig, to be loaded after core-fig
-
-%D \macros
-%D {definefiguresymbol}
-%D
-%D To simplify defining figure symbols, we offer:
-%D
-%D \showsetup{definefiguresymbol}
-%D
-%D By default, such symbols scale along the current bodyfont
-%D size or running font size (which is better).
-
-\def\defaultsymbolfactor{10}
-\def\defaultsymbolheight{1.25ex}
-
-\def\figuresymbol
- {\dodoubleempty\dofiguresymbol}
-
-\ifx\externalfigure \undefined \def\externalfigure[#1][#2]{#1} \fi
-\ifx\resetexternalfigures\undefined \let\resetexternalfigures\relax \fi
-
-\def\dofiguresymbol[#1][% #2]%
- {\externalfigure[#1][\c!reset=\v!yes,\c!symbol=\v!yes,\c!height=\defaultsymbolheight,}% #2]}
-
-\appendtoks \resetexternalfigures \to \everysymbol
-
-\def\definefiguresymbol
- {\dotripleempty\dodefinefiguresymbol}
-
-\def\dodefinefiguresymbol[#1][#2][#3]%
- {\ifsecondargument
- \definesymbol[#1][{\dofiguresymbol[#2][#3]}]%
- \fi}
-
-% but for the moment we keep it here
-% % % % % %
-
-%\def\objectsymbol[#1]%
-% {\dopresetfieldsymbol{#1}\dogetfieldsymbol{#1}}
-
-%D \macros
-%D {doifsymboldefinedelse}
-%D
-%D A handy private one:
-
-% a bit messy
-
-\def\xfetchsymbol#1%
- {\ifnosymbol
- \doifinsymbolset{#1}\currentsymbol\nosymbolfalse
- \fi}
-
-\def\xredosymbol#1%
- {\doifinsymbolset\empty\currentsymbol\nosymbolfalse}
-
-\def\doifsymboldefinedelse#1%
- {\bgroup
- \edef\currentsymbol{#1}%
- \let\fetchsymbol\xfetchsymbol
- \nosymboltrue
- \the\symbolsetups
- \ifnosymbol
- \xredosymbol\currentsymbol
- \ifnosymbol
- \egroup\@EAEAEA\secondoftwoarguments
- \else
- \egroup\@EAEAEA\firstoftwoarguments
- \fi
- \else
- \egroup\@EA\firstoftwoarguments
- \fi}
-
-%D \macros
-%D {setupsymbolset,startsymbolset}
-%D
-%D From these macro definitions one can deduce that symbols can
-%D be grouped in symbol sets:
-%D
-%D \starttyping
-%D \startsymbolset [navigation 1]
-%D \definefiguresymbol [Next] [mp-symb.1]
-%D \definefiguresymbol [Prev] [mp-symb.2]
-%D \stopsymbolset
-%D \stoptyping
-%D
-%D Such a symbol can be typeset with:
-%D
-%D \starttyping
-%D \setupsymbolset[navigation 1]\symbol[Next]
-%D \stoptyping
-%D
-%D or simply:
-%D
-%D \starttyping
-%D \symbol[navigation 1][Next]
-%D \stoptyping
-%D
-%D Formally:
-%D
-%D \showsetup{setupsymbolset}
-%D \showsetup{startsymbolset}
-
-\let\currentsymboldef\empty
-
-\def\startsymbolset[#1]%
- {\def\currentsymboldef{#1}}
-
-\def\stopsymbolset
- {\let\currentsymboldef\empty}
-
-\newtoks\symbolsetups
-
-\def\setupsymbolset[#1]%
- {\prependtoksonce\fetchsymbol{#1}\to\symbolsetups}
-
-\def\resetsymbolset
- {\symbolsetups\emptytoks}
-
-\def\forcesymbolset[#1]%
- {\symbolsetups{\fetchsymbol{#1}}}
-
-%D \macros
-%D {showsymbolset}
-%D
-%D \showsetup{showsymbolset}
-
-\fetchruntimecommand \showsymbolset {\f!symbolprefix\s!run}
-
-%D \macros
-%D {usesymbols}
-%D
-%D \showsetup{usesymbols}
-
-\def\dousesymbols#1%
- {\startreadingfile
- \readsysfile{\truefilename{\f!symbolprefix#1}.\mksuffix}
- {\showmessage\m!symbols1{#1}}
- {\readsysfile{\truefilename{\f!symbolprefix#1}}
- {\showmessage\m!symbols1{#1}}
- \donothing}%
- \stopreadingfile}
-
-\def\usesymbols[#1]%
- {\processcommalist[#1]\dousesymbols}
-
-%D As longs as symbols are linked to levels or numbers, we can
-%D also use the conversion mechanism, but in for instance the
-%D itemization macros, we prefer symbols because they can more
-%D easier be (partially) redefined.
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/symb-jmn.mkii b/Master/texmf-dist/tex/context/base/mkii/symb-jmn.mkii
deleted file mode 100644
index aea2dce7b0b..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/symb-jmn.mkii
+++ /dev/null
@@ -1,199 +0,0 @@
-%D \module
-%D [ file=symb-jmn,
-%D version=2004.08.02,
-%D title=\CONTEXT\ Symbol Libraries,
-%D subtitle=Special Navigational Symbols,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 file defines a few navigational symbol vectors. The font used
-%D here is designed by Janusz M.~Nowacki, one of the Polish Font
-%D Gurus who made this font specially for me, hence the name. If you
-%D you want to meet its designer, come to Bachotek! In case you're
-%D not familiar with his work, take a look at the Antikwa, Iwona and
-%D Kurier fonts!
-%D
-%D \usesymbols[jmn]
-%D
-%D \showsymbolset[navigation 1]
-%D \showsymbolset[navigation 3]
-%D \showsymbolset[navigation 2]
-%D \showsymbolset[navigation 4]
-%D
-%D \page
-%D \showfont[NavigationNormal]
-%D \page
-%D \showfont[NavigationShadowed]
-%D \page
-
-% needed:
-%
-% - inverted crossed
-% - curved diamond
-
-\unprotect
-
-\loadmapfile[original-base.map] % \loadmapfile [original-context-symbol.map]
-
-\definefontsynonym[NavigationNormal] [hans]
-\definefontsynonym[NavigationShadowed] [hans-sh]
-
-\definefontsynonym[NavigationFont] [NavigationNormal]
-%definefontsynonym[NavigationFont] [NavigationShadowed]
-
-\def\NavigationGlyph#1{\getglyph{NavigationFont}{\char#1}}
-
-\unprotect
-
-\startsymbolset [navigation 1]
-
- \definesymbol [\v!previouspage] [\NavigationGlyph {65}]
- \definesymbol [\v!PreviousJump] [\NavigationGlyph{128}]
- \definesymbol [\v!firstpage] [\NavigationGlyph{129}]
-
- \definesymbol [\v!nextpage] [\NavigationGlyph {66}]
- \definesymbol [\v!NextJump] [\NavigationGlyph{130}]
- \definesymbol [\v!lastpage] [\NavigationGlyph{131}]
-
- \definesymbol [\v!CloseDocument] [\NavigationGlyph{160}]
-
- \definesymbol [\v!firstsubpage] [\NavigationGlyph{178}]
- \definesymbol [\v!previoussubpage] [\NavigationGlyph{208}]
- \definesymbol [\v!nextsubpage] [\NavigationGlyph{209}]
- \definesymbol [\v!lastsubpage] [\NavigationGlyph{178}]
-
- \definesymbol [\v!StartSound] [\NavigationGlyph {66}]
- \definesymbol [\v!PauseSound] [\NavigationGlyph{168}]
- \definesymbol [\v!StopSound] [\NavigationGlyph{170}]
-
- \definesymbol [\v!StartMovie] [\NavigationGlyph {66}]
- \definesymbol [\v!PauseMovie] [\NavigationGlyph{168}]
- \definesymbol [\v!StopMovie] [\NavigationGlyph{170}]
-
- \definesymbol [\v!StartRendering] [\NavigationGlyph {66}]
- \definesymbol [\v!PauseRendering] [\NavigationGlyph{168}]
- \definesymbol [\v!StopRendering] [\NavigationGlyph{170}]
- \definesymbol [\v!ResumeRendering] [\NavigationGlyph {66}]
-
-\stopsymbolset
-
-\startsymbolset [navigation 2]
-
- \definesymbol [\v!previouspage] [\NavigationGlyph {67}]
- \definesymbol [\v!PreviousJump] [\NavigationGlyph{132}]
- \definesymbol [\v!firstpage] [\NavigationGlyph{133}]
-
- \definesymbol [\v!nextpage] [\NavigationGlyph {68}]
- \definesymbol [\v!NextJump] [\NavigationGlyph{134}]
- \definesymbol [\v!lastpage] [\NavigationGlyph{135}]
-
- \definesymbol [\v!CloseDocument] [\NavigationGlyph{160}]
-
- \definesymbol [\v!firstsubpage] [\NavigationGlyph{176}]
- \definesymbol [\v!previoussubpage] [\NavigationGlyph{210}]
- \definesymbol [\v!nextsubpage] [\NavigationGlyph{211}]
- \definesymbol [\v!lastsubpage] [\NavigationGlyph{176}]
-
- \definesymbol [\v!StartSound] [\NavigationGlyph {68}]
- \definesymbol [\v!PauseSound] [\NavigationGlyph{170}]
- \definesymbol [\v!StopSound] [\NavigationGlyph{168}]
-
- \definesymbol [\v!StartMovie] [\NavigationGlyph {68}]
- \definesymbol [\v!PauseMovie] [\NavigationGlyph{170}]
- \definesymbol [\v!StopMovie] [\NavigationGlyph{168}]
-
- \definesymbol [\v!StartRendering] [\NavigationGlyph {68}]
- \definesymbol [\v!PauseRendering] [\NavigationGlyph{170}]
- \definesymbol [\v!StopRendering] [\NavigationGlyph{168}]
- \definesymbol [\v!ResumeRendering] [\NavigationGlyph {68}]
-
-\stopsymbolset
-
-\startsymbolset [navigation 3]
-
- \definesymbol [\v!previouspage] [\NavigationGlyph {73}]
- \definesymbol [\v!PreviousJump] [\NavigationGlyph{144}]
- \definesymbol [\v!firstpage] [\NavigationGlyph{145}]
-
- \definesymbol [\v!nextpage] [\NavigationGlyph {74}]
- \definesymbol [\v!NextJump] [\NavigationGlyph{146}]
- \definesymbol [\v!lastpage] [\NavigationGlyph{147}]
-
- \definesymbol [\v!CloseDocument] [\NavigationGlyph{160}]
-
- \definesymbol [\v!firstsubpage] [\NavigationGlyph{178}]
- \definesymbol [\v!previoussubpage] [\NavigationGlyph{212}]
- \definesymbol [\v!nextsubpage] [\NavigationGlyph{213}]
- \definesymbol [\v!lastsubpage] [\NavigationGlyph{178}]
-
- \definesymbol [\v!StartSound] [\NavigationGlyph {73}]
- \definesymbol [\v!PauseSound] [\NavigationGlyph{168}]
- \definesymbol [\v!StopSound] [\NavigationGlyph{170}]
-
- \definesymbol [\v!StartMovie] [\NavigationGlyph {73}]
- \definesymbol [\v!PauseMovie] [\NavigationGlyph{168}]
- \definesymbol [\v!StopMovie] [\NavigationGlyph{170}]
-
- \definesymbol [\v!StartRendering] [\NavigationGlyph {73}]
- \definesymbol [\v!PauseRendering] [\NavigationGlyph{168}]
- \definesymbol [\v!StopRendering] [\NavigationGlyph{170}]
- \definesymbol [\v!ResumeRendering] [\NavigationGlyph {73}]
-
-\stopsymbolset
-
-% 1 left : 065 067 073 075
-% 2 left : 128 132 144 148
-% 3 left : 129 133 145 149
-
-% 1 right : 066 068 074 076
-% 2 right : 130 134 146 150
-% 3 right : 131 135 147 151
-
-% crossed : 160 160 160 160
-% opened : 152 152 156 156
-% closed : 154 154 158 158
-
-% larrow : 208 210 212 214
-% rarrow : 209 211 213 215
-% barrow : 178 178 178 178
-% ocircle : 168 168 168 168
-% ccircle : 170 170 170 170
-
-\startsymbolset [navigation 4]
-
- \definesymbol [\v!previouspage] [\NavigationGlyph {75}]
- \definesymbol [\v!PreviousJump] [\NavigationGlyph{148}]
- \definesymbol [\v!firstpage] [\NavigationGlyph{149}]
-
- \definesymbol [\v!nextpage] [\NavigationGlyph {76}]
- \definesymbol [\v!NextJump] [\NavigationGlyph{150}]
- \definesymbol [\v!lastpage] [\NavigationGlyph{151}]
-
- \definesymbol [\v!CloseDocument] [\NavigationGlyph{160}]
-
- \definesymbol [\v!firstsubpage] [\NavigationGlyph{176}]
- \definesymbol [\v!previoussubpage] [\NavigationGlyph{214}]
- \definesymbol [\v!nextsubpage] [\NavigationGlyph{215}]
- \definesymbol [\v!lastsubpage] [\NavigationGlyph{176}]
-
- \definesymbol [\v!StartSound] [\NavigationGlyph {75}]
- \definesymbol [\v!PauseSound] [\NavigationGlyph{170}]
- \definesymbol [\v!StopSound] [\NavigationGlyph{168}]
-
- \definesymbol [\v!StartMovie] [\NavigationGlyph {75}]
- \definesymbol [\v!PauseMovie] [\NavigationGlyph{170}]
- \definesymbol [\v!StopMovie] [\NavigationGlyph{168}]
-
- \definesymbol [\v!StartRendering] [\NavigationGlyph {75}]
- \definesymbol [\v!PauseRendering] [\NavigationGlyph{170}]
- \definesymbol [\v!StopRendering] [\NavigationGlyph{168}]
- \definesymbol [\v!ResumeRendering] [\NavigationGlyph {75}]
-
-\stopsymbolset
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/symb-mis.mkii b/Master/texmf-dist/tex/context/base/mkii/symb-mis.mkii
deleted file mode 100644
index dacb816b411..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/symb-mis.mkii
+++ /dev/null
@@ -1,139 +0,0 @@
-%D \module
-%D [ file=symb-mis,
-%D version=2002.05.07,
-%D title=\CONTEXT\ Symbol Libraries,
-%D subtitle=Miscelaneous,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 We predefine some common symbols and conversions that will
-%D be understood by many commands.
-
-% \mathematics no longer needed, although only math fonts might have these
-
-\definesymbol [\v!none] []
-\definesymbol [bullet] [\mathematics{\bullet}]
-\definesymbol [dash] [\mathematics{-}]
-\definesymbol [star] [\mathematics{\star}]
-\definesymbol [triangle] [\mathematics{\triangleright}]
-\definesymbol [circle] [\mathematics{\circ}]
-\definesymbol [square] [\mathematics{\square}]
-\definesymbol [diamond] [\mathematics{\diamond}]
-
-\definesymbol [smallcircle] [\hbox{\raise.1ex\hbox{\mathematics{\scriptscriptstyle\bigcirc}}}]
-\definesymbol [medcircle] [\hbox{\raise.1ex\hbox{\mathematics{\scriptstyle \bigcirc}}}]
-\definesymbol [bigcircle] [\mathematics{\bigcirc}]
-
-\definesymbol [1] [\symbol{bullet}]
-\definesymbol [2] [\symbol{dash}]
-\definesymbol [3] [\symbol{star}]
-\definesymbol [4] [\symbol{triangle}]
-\definesymbol [5] [\symbol{circle}]
-\definesymbol [6] [\symbol{medcircle}]
-\definesymbol [7] [\symbol{bigcircle}]
-\definesymbol [8] [\symbol{square}]
-
-%D Special hyperlinks, namely those to pages or navigational
-%D properties, are associated with symbols.
-
-\definesymbol [\v!firstpage] [\gotobegincharacter]
-\definesymbol [\v!previouspage] [\gobackwardcharacter]
-\definesymbol [\v!nextpage] [\goforwardcharacter]
-\definesymbol [\v!lastpage] [\gotoendcharacter]
-\definesymbol [\v!firstsubpage] [\gotobegincharacter]
-\definesymbol [\v!previoussubpage] [\gobackwardcharacter]
-\definesymbol [\v!nextsubpage] [\goforwardcharacter]
-\definesymbol [\v!lastsubpage] [\gotoendcharacter]
-\definesymbol [\v!PreviousJump] [\gobackjumpcharacter]
-\definesymbol [\v!NextJump] [\goforjumpcharacter]
-\definesymbol [\v!CloseDocument] [\closecharacter]
-
-\definesymbol [\v!first] [\symbol{\v!firstpage}]
-\definesymbol [\v!previous] [\symbol{\v!previouspage}]
-\definesymbol [\v!next] [\symbol{\v!nextpage}]
-\definesymbol [\v!last] [\symbol{\v!lastpage}]
-\definesymbol [\v!somewhere] [\gotosomewherecharacter]
-\definesymbol [\v!nowhere] [\gonowherecharacter]
-
-\definesymbol [\v!backward] [\symbol{\v!previouspage}]
-\definesymbol [\v!forward] [\symbol{\v!nextpage}]
-
-%D The next two symbols (\symbol[P] and \symbol[S]) are
-%D variations in their math counterparts. The following ones
-%D {\em do} scale.
-
-% todo : hook this into \textsection
-
-\definesymbol [S] [\getglyph{MathSymbol}{\char"78}]
-\definesymbol [P] [\getglyph{MathSymbol}{\char"7B}]
-
-%D These symbols are taken from the Computer Moders Roman
-%D symbol set or, when present, from the additional symbols of
-%D the American Mathematical Society. Of course one can use
-%D his or her own symbols by redefining them.
-
-\def\dogotocharacter#1#2#3%
- {\ifx#1\undefined#2\else#3\fi}
-
-\def\gotobegincharacter
- {\hbox
- {\dogotocharacter\blacktriangleleft
- {\setbox0\hbox{\mathematics{\triangleleft}}%
- \vrule\!!width.085ex\!!height1.075\ht0\!!depth\dp0
- \kern-.11ex\box0}
- {\setbox0\hbox{\mathematics{\blacktriangleleft}}%
- \setbox2\hbox{\vrule\!!height\ht0\!!depth\dp0\!!width.25ex}%
- \hbox{\lower.03ex\box2\kern-.35ex\box0}}}}
-
-\def\gotoendcharacter
- {\hbox
- {\dogotocharacter\blacktriangleright
- {\setbox0\hbox{\mathematics{\triangleright}}%
- \copy0\kern-.11ex
- \vrule\!!width.085ex\!!height1.075\ht0\!!depth\dp0}
- {\setbox0\hbox{\mathematics{\blacktriangleright}}%
- \setbox2\hbox{\vrule\!!height\ht0\!!depth\dp0\!!width.25ex}%
- \hbox{\box0\kern-.35ex\lower.03ex\box2}}}}
-
-\def\gobackwardcharacter
- {\mathematics{\dogotocharacter\blacktriangleright\triangleleft\blacktriangleleft}}
-
-\def\goforwardcharacter
- {\mathematics{\dogotocharacter\blacktriangleright\triangleright\blacktriangleright}}
-
-\def\gonowherecharacter
- {\mathematics{\bullet}}
-
-\def\gotosomewherecharacter
- {{\hbox{\hsmash{\symbol[\v!previous]}\symbol[\v!next]}}}
-
-\unexpanded\def\closecharacter
- {\dogotocharacter\boxtimes
- {\ruledhbox{\mathematics{\times}}}
- {\mathematics{\boxtimes}}}
-
-\def\goforjumpcharacter
- {\hbox{\goforwardcharacter \kern-.5em\goforwardcharacter}}
-
-\def\gobackjumpcharacter
- {\hbox{\gobackwardcharacter\kern-.5em\gobackwardcharacter}}
-
-%D The next two symbols are for Daniel Flipo:
-
-\ifx\high \undefined \let\high \firstofoneargument \fi % todo
-\ifx\notsmallcapped\undefined \let\notsmallcapped\firstofoneargument \fi % todo
-
-\definesymbol [Numero] [N\high{\notsmallcapped{o}\kern.2em}]
-\definesymbol [numero] [n\high{\notsmallcapped{o}\kern.2em}]
-
-\def\Numero{\symbol[Numero]}
-\def\numero{\symbol[numero]}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/symb-mvs.mkii b/Master/texmf-dist/tex/context/base/mkii/symb-mvs.mkii
deleted file mode 100644
index aae4e92d66c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/symb-mvs.mkii
+++ /dev/null
@@ -1,217 +0,0 @@
-%D \module
-%D [ file=symb-mvs,
-%D version=2000.03.30,
-%D title=\CONTEXT\ Symbol Libraries,
-%D subtitle=Martin Vogels Symbole,
-%D author=Tobias Burnus \& Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 module implements the Martin Vogel Symbole font
-%D (marvosym). The names are derived from the \LATEX\ package
-%D \type {marvosym} of Thomas Henlich. The symbols are
-%D available as Type~1 font and are included in \TETEX\ and
-%D \FPTEX\ distributions.
-%D
-%D This symbol font offers the signs of the zodiac, four
-%D alternative the euro signs, some general office signs and
-%D some more.
-%D
-%D The font was designed by Martin Vogel who can be reached at
-%D \hyphenatedurl {martin.vogel@fh-bochum.de}. More information
-%D can be found at \hyphenatedurl
-%D {http://www.fh-bochum.de/fb1/vogel/marvosym.html}. The
-%D conversion to Type~1 font was done by Thomas Henlich, who
-%D can be reached at \hyphenatedurl
-%D {thenlich@rcs.urz.tu-dresden.de}.
-%D
-%D This module is based on the current \CTAN\ version (as of
-%D March 30, 2000) and is older than the TrueType version at
-%D Martin Vogel's Homepage. The definitions in this module
-%D reflect the \CTAN\ version. The font conversion was done by
-%D Thomas Henlich using \type {ttf2pt1}, a program that can be
-%D found at \hyphenatedurl
-%D {http://www.netspace.net.au/~mheath/ttf2pt1/}.
-%D
-%D Using the new version of \type {marvosymb}, the MVzero will
-%D has a slash and the FHBOLOGO, (wo)manface, and (wo)manfront
-%D are replaced by other symbols.
-
-\loadmapfile[original-base.map] % \loadmapfile[original-vogel-symbol]
-
-\definefontsynonym [MartinVogel] [umvs]
-
-\def\MartinVogelSymbol#1{\getglyph{MartinVogel}{\char#1}}
-
-% Astro signs and signs of the zodiac
-
-\startsymbolset [astronomic]
-
- \definesymbol [Sun] [\MartinVogelSymbol{192}]
- \definesymbol [Moon] [\MartinVogelSymbol{193}]
- \definesymbol [Mercury] [\MartinVogelSymbol{194}]
- \definesymbol [Venus] [\MartinVogelSymbol{195}]
- \definesymbol [Mars] [\MartinVogelSymbol{196}]
- \definesymbol [Jupiter] [\MartinVogelSymbol{197}]
- \definesymbol [Saturn] [\MartinVogelSymbol{198}]
- \definesymbol [Uranus] [\MartinVogelSymbol{199}]
- \definesymbol [Neptune] [\MartinVogelSymbol{200}]
- \definesymbol [Pluto] [\MartinVogelSymbol{201}]
-
-\stopsymbolset
-
-\startsymbolset [zodiac]
-
- \definesymbol [Aries] [\MartinVogelSymbol{224}]
- \definesymbol [Taurus] [\MartinVogelSymbol{225}]
- \definesymbol [Gemini] [\MartinVogelSymbol{226}]
- \definesymbol [Cancer] [\MartinVogelSymbol{227}]
- \definesymbol [Leo] [\MartinVogelSymbol{228}]
- \definesymbol [Virgo] [\MartinVogelSymbol{229}]
- \definesymbol [Libra] [\MartinVogelSymbol{230}]
- \definesymbol [Scorpio] [\MartinVogelSymbol{231}]
- \definesymbol [Sagittarius] [\MartinVogelSymbol{232}]
- \definesymbol [Capricorn] [\MartinVogelSymbol{233}]
- \definesymbol [Aquarius] [\MartinVogelSymbol{234}]
- \definesymbol [Pisces] [\MartinVogelSymbol{235}]
-
-\stopsymbolset
-
-% Euro signs and CE
-
-\startsymbolset [europe]
-
- \definesymbol [EUR] [\MartinVogelSymbol{164}]
- \definesymbol [EURhv] [\MartinVogelSymbol {99}]
- \definesymbol [EURcr] [\MartinVogelSymbol{100}]
- \definesymbol [EURtm] [\MartinVogelSymbol{101}]
- \definesymbol [CEsign] [\MartinVogelSymbol {67}]
-
-\stopsymbolset
-
-\startencoding[default]
-
- \definecharacter texteuro {\symbol[europe][EUR]}
-
-\stopencoding
-
-\unexpanded\def\euro{\doiftextelse{\texteuro}{\texteuro}{\symbol[europe][EUR]}}
-
-% Numbers 0 to 9, @, A and p
-
-% taco: are these more general, like also in zapf dingbats?
-
-\startsymbolset [martinvogel 1]
-
- \definesymbol [MVZero] [\MartinVogelSymbol {48}]
- \definesymbol [MVOne] [\MartinVogelSymbol {49}]
- \definesymbol [MVTwo] [\MartinVogelSymbol {50}]
- \definesymbol [MVThree] [\MartinVogelSymbol {51}]
- \definesymbol [MVFour] [\MartinVogelSymbol {52}]
- \definesymbol [MVFive] [\MartinVogelSymbol {53}]
- \definesymbol [MVSix] [\MartinVogelSymbol {54}]
- \definesymbol [MVSeven] [\MartinVogelSymbol {55}]
- \definesymbol [MVEight] [\MartinVogelSymbol {56}]
- \definesymbol [MVNine] [\MartinVogelSymbol {57}]
- \definesymbol [MVAt] [\MartinVogelSymbol {64}]
- \definesymbol [MVA] [\MartinVogelSymbol{240}]
- \definesymbol [MVp] [\MartinVogelSymbol{241}]
-
-\stopsymbolset
-
-% Office signs, crosses, circles, arrows
-
-\startsymbolset [martinvogel 2]
-
- \definesymbol [CheckedBox] [\MartinVogelSymbol {86}]
- \definesymbol [CrossedBox] [\MartinVogelSymbol {88}]
- \definesymbol [PointingHand] [\MartinVogelSymbol {90}]
- \definesymbol [WritingHand] [\MartinVogelSymbol {98}]
- \definesymbol [Heart] [\MartinVogelSymbol{140}]
- \definesymbol [FlatSteel] [\MartinVogelSymbol{150}]
- \definesymbol [Squarepipe] [\MartinVogelSymbol{151}]
- \definesymbol [Rectpipe] [\MartinVogelSymbol{152}]
- \definesymbol [Lsteel] [\MartinVogelSymbol{153}]
- \definesymbol [TTsteel] [\MartinVogelSymbol{154}]
- \definesymbol [Circpipe] [\MartinVogelSymbol{155}]
- \definesymbol [Tsteel] [\MartinVogelSymbol{156}]
-
- \definesymbol [Stopsign] [\MartinVogelSymbol {33}]
- \definesymbol [Beam] [\MartinVogelSymbol {34}]
- \definesymbol [Bearing] [\MartinVogelSymbol {35}]
- \definesymbol [Loosebearing] [\MartinVogelSymbol {36}]
- \definesymbol [Fixedbearing] [\MartinVogelSymbol {37}]
- \definesymbol [Lefttorque] [\MartinVogelSymbol {38}]
- \definesymbol [Righttorque] [\MartinVogelSymbol {39}]
- \definesymbol [Force] [\MartinVogelSymbol {40}]
- \definesymbol [Lineload] [\MartinVogelSymbol {41}]
- \definesymbol [Circles] [\MartinVogelSymbol {46}]
- \definesymbol [Squaredot] [\MartinVogelSymbol{247}]
-
- \definesymbol [Correspondes] [\MartinVogelSymbol {61}]
- \definesymbol [Vectorarrowhigh] [\MartinVogelSymbol {80}]
- \definesymbol [Vectorarrow] [\MartinVogelSymbol{112}]
- \definesymbol [Rightarrow] [\MartinVogelSymbol {62}]
- \definesymbol [Lightning] [\MartinVogelSymbol {69}]
-
- \definesymbol [Snowflake] [\MartinVogelSymbol {42}]
- \definesymbol [Kross] [\MartinVogelSymbol {43}]
- \definesymbol [Cross] [\MartinVogelSymbol{134}]
- \definesymbol [Celtcross] [\MartinVogelSymbol{135}]
- \definesymbol [Ankh] [\MartinVogelSymbol{136}]
- \definesymbol [Yingyang] [\MartinVogelSymbol {77}]
-
- \definesymbol [Pickup] [\MartinVogelSymbol {0}] % ?
- \definesymbol [Letter] [\MartinVogelSymbol {66}] % ?
- \definesymbol [Mobilephone] [\MartinVogelSymbol {72}]
- \definesymbol [Telephone] [\MartinVogelSymbol {84}]
- \definesymbol [fax] [\MartinVogelSymbol{116}]
- \definesymbol [FAX] [\MartinVogelSymbol{117}]
- \definesymbol [Faxmachine] [\MartinVogelSymbol{118}]
-
- \definesymbol [Clocklogo] [\MartinVogelSymbol {85}]
- \definesymbol [Industry] [\MartinVogelSymbol {73}]
- \definesymbol [Coffeecup] [\MartinVogelSymbol {75}]
- \definesymbol [Info] [\MartinVogelSymbol{105}]
- \definesymbol [Football] [\MartinVogelSymbol{111}]
- \definesymbol [Frowny] [\MartinVogelSymbol{167}]
- \definesymbol [Smiley] [\MartinVogelSymbol{169}]
- \definesymbol [Bicycle] [\MartinVogelSymbol{174}]
-
- \definesymbol [Rightscissors] [\MartinVogelSymbol {81}]
- \definesymbol [Leftscissors] [\MartinVogelSymbol {83}]
- \definesymbol [Cutright] [\MartinVogelSymbol{113}]
- \definesymbol [Cutleft] [\MartinVogelSymbol{115}]
- \definesymbol [Kutline] [\MartinVogelSymbol {82}] % K ?
- \definesymbol [Cutline] [\MartinVogelSymbol{114}]
-
-\stopsymbolset
-
-% FHBO (Fachhochschule Bochum), face, humans, bat
-
-\startsymbolset [martinvogel 3]
-
- \definesymbol [FHBOlogo] [\MartinVogelSymbol {70}]
- \definesymbol [FHBOLOGO] [\MartinVogelSymbol{102}]
- \definesymbol [Womanside] [\MartinVogelSymbol{204}]
- \definesymbol [Manside] [\MartinVogelSymbol{205}]
- \definesymbol [Womanfront] [\MartinVogelSymbol{206}]
- \definesymbol [Manfront] [\MartinVogelSymbol{207}]
- \definesymbol [Bat] [\MartinVogelSymbol{253}]
- \definesymbol [Womanface] [\MartinVogelSymbol{254}]
- \definesymbol [MartinVogel] [\MartinVogelSymbol{255}]
-
-\stopsymbolset
-
-%D \showsymbolset[astronomic]
-%D \showsymbolset[zodiac]
-%D \showsymbolset[europe]
-%D \showsymbolset[martinvogel 1]
-%D \showsymbolset[martinvogel 2]
-%D \showsymbolset[martinvogel 3]
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/symb-nav.mkii b/Master/texmf-dist/tex/context/base/mkii/symb-nav.mkii
deleted file mode 100644
index c9d1aae1d73..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/symb-nav.mkii
+++ /dev/null
@@ -1,122 +0,0 @@
-%D \module
-%D [ file=symb-nav,
-%D version=1998.07.20,
-%D title=\CONTEXT\ Symbol Libraries,
-%D subtitle=Navigational Symbols,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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
-
-\loadmapfile[original-base.map] % \loadmapfile [original-context-symbol.map]
-
-\definefontsynonym [ContextNavigation] [contnav]
-
-\def\ContextNavigationGlyph#1{\getglyph{ContextNavigation}{\char#1}}
-
-\startsymbolset [navigation 1]
-
- \definesymbol [\v!firstpage] [\ContextNavigationGlyph{3}]
- \definesymbol [\v!previouspage] [\ContextNavigationGlyph{1}]
- \definesymbol [\v!nextpage] [\ContextNavigationGlyph{2}]
- \definesymbol [\v!lastpage] [\ContextNavigationGlyph{4}]
-
- \definesymbol [\v!PreviousJump] [\ContextNavigationGlyph{5}]
- \definesymbol [\v!NextJump] [\ContextNavigationGlyph{6}]
-
- \definesymbol [\v!CloseDocument] [\ContextNavigationGlyph{7}]
-
- \definesymbol [\v!firstsubpage] [\ContextNavigationGlyph{3}]
- \definesymbol [\v!previoussubpage] [\ContextNavigationGlyph{1}]
- \definesymbol [\v!nextsubpage] [\ContextNavigationGlyph{2}]
- \definesymbol [\v!lastsubpage] [\ContextNavigationGlyph{4}]
-
- \definesymbol [\v!StartSound] [\ContextNavigationGlyph{2}]
- \definesymbol [\v!PauseSound] [\ContextNavigationGlyph{8}]
- \definesymbol [\v!StopSound] [\ContextNavigationGlyph{7}]
-
- \definesymbol [\v!StartMovie] [\ContextNavigationGlyph{2}]
- \definesymbol [\v!PauseMovie] [\ContextNavigationGlyph{8}]
- \definesymbol [\v!StopMovie] [\ContextNavigationGlyph{7}]
-
- \definesymbol [\v!StartRendering] [\ContextNavigationGlyph{2}]
- \definesymbol [\v!PauseRendering] [\ContextNavigationGlyph{8}]
- \definesymbol [\v!StopRendering] [\ContextNavigationGlyph{7}]
- \definesymbol [\v!ResumeRendering] [\ContextNavigationGlyph{2}]
-
-\stopsymbolset
-
-\startsymbolset [navigation 2]
-
- \definesymbol [\v!firstpage] [\ContextNavigationGlyph{103}]
- \definesymbol [\v!previouspage] [\ContextNavigationGlyph{101}]
- \definesymbol [\v!nextpage] [\ContextNavigationGlyph{102}]
- \definesymbol [\v!lastpage] [\ContextNavigationGlyph{104}]
-
- \definesymbol [\v!PreviousJump] [\ContextNavigationGlyph{105}]
- \definesymbol [\v!NextJump] [\ContextNavigationGlyph{106}]
-
- \definesymbol [\v!CloseDocument] [\ContextNavigationGlyph{107}]
-
- \definesymbol [\v!firstsubpage] [\ContextNavigationGlyph{103}]
- \definesymbol [\v!previoussubpage] [\ContextNavigationGlyph{101}]
- \definesymbol [\v!nextsubpage] [\ContextNavigationGlyph{102}]
- \definesymbol [\v!lastsubpage] [\ContextNavigationGlyph{104}]
-
- \definesymbol [\v!StartSound] [\ContextNavigationGlyph{102}]
- \definesymbol [\v!PauseSound] [\ContextNavigationGlyph{108}]
- \definesymbol [\v!StopSound] [\ContextNavigationGlyph{107}]
-
- \definesymbol [\v!StartMovie] [\ContextNavigationGlyph{102}]
- \definesymbol [\v!PauseMovie] [\ContextNavigationGlyph{108}]
- \definesymbol [\v!StopMovie] [\ContextNavigationGlyph{107}]
-
- \definesymbol [\v!StartRendering] [\ContextNavigationGlyph{102}]
- \definesymbol [\v!PauseRendering] [\ContextNavigationGlyph{108}]
- \definesymbol [\v!StopRendering] [\ContextNavigationGlyph{107}]
- \definesymbol [\v!ResumeRendering] [\ContextNavigationGlyph{102}]
-
-\stopsymbolset
-
-\startsymbolset [navigation 3]
-
- \definesymbol [\v!firstpage] [\ContextNavigationGlyph{203}]
- \definesymbol [\v!previouspage] [\ContextNavigationGlyph{201}]
- \definesymbol [\v!nextpage] [\ContextNavigationGlyph{202}]
- \definesymbol [\v!lastpage] [\ContextNavigationGlyph{204}]
-
- \definesymbol [\v!PreviousJump] [\ContextNavigationGlyph{205}]
- \definesymbol [\v!NextJump] [\ContextNavigationGlyph{206}]
-
- \definesymbol [\v!CloseDocument] [\ContextNavigationGlyph{207}]
-
- \definesymbol [\v!firstsubpage] [\ContextNavigationGlyph{203}]
- \definesymbol [\v!previoussubpage] [\ContextNavigationGlyph{201}]
- \definesymbol [\v!nextsubpage] [\ContextNavigationGlyph{202}]
- \definesymbol [\v!lastsubpage] [\ContextNavigationGlyph{204}]
-
- \definesymbol [\v!StartSound] [\ContextNavigationGlyph{202}]
- \definesymbol [\v!PauseSound] [\ContextNavigationGlyph{208}]
- \definesymbol [\v!StopSound] [\ContextNavigationGlyph{207}]
-
- \definesymbol [\v!StartMovie] [\ContextNavigationGlyph{202}]
- \definesymbol [\v!PauseMovie] [\ContextNavigationGlyph{208}]
- \definesymbol [\v!StopMovie] [\ContextNavigationGlyph{207}]
-
- \definesymbol [\v!StartRendering] [\ContextNavigationGlyph{202}]
- \definesymbol [\v!PauseRendering] [\ContextNavigationGlyph{208}]
- \definesymbol [\v!StopRendering] [\ContextNavigationGlyph{207}]
- \definesymbol [\v!ResumeRendering] [\ContextNavigationGlyph{202}]
-
-\stopsymbolset
-
-%D \showsymbolset[navigation 1]
-%D \showsymbolset[navigation 2]
-%D \showsymbolset[navigation 3]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/symb-run.mkii b/Master/texmf-dist/tex/context/base/mkii/symb-run.mkii
deleted file mode 100644
index 8b8c62d8b55..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/symb-run.mkii
+++ /dev/null
@@ -1,54 +0,0 @@
-%D \module
-%D [ file=symb-run, % code moved from symb-ini
-%D version=1998.07.20,
-%D title=\CONTEXT\ Symbol Libraries,
-%D subtitle=Runtime Macros,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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
-
-\gdef\doshowsymbolset[#1][#2]% todo: make nicer, use legend or so
- {\vbox\bgroup
- \blank
- \getparameters[\??ss][\c!n=5,#2]%
- \forcesymbolset[#1]%
- \doifsymbolsetelse{#1}
- {\global\let\allfigures\empty
- \doglobal\newcounter\figurecounter
- \setupcolors[\c!state=\v!start]% to prevent mps color conversion
- \dontcomplain
- \def\doshowsymbols% global needed due to grouping in alignment
- {\expanded{\globalprocesscommalist[\symbolset{#1}]}\docommand}%
- \def\docommand##1%
- {\vbox
- {\forgetall
- \tttf
- \halign
- {\hss\quad####\strut\quad\hss\cr
- \symbol[##1]\quad{\red\ruledhbox{\black\symbol[##1]}}\cr
- \tfx##1\cr}}%
- \doglobal\increment\figurecounter
- \ifnum\figurecounter=\@@ssn
- \doglobal\newcounter\figurecounter
- \def\next{\crcr\noalign{\vskip1ex}}%
- \else
- \def\next{&}%
- \fi
- \next}%
- \tabskip\zeropoint \!!plus 1fill
- \halign to \hsize
- {&\hss##\hss\cr\doshowsymbols\crcr}}%
- {}%
- \blank
- \egroup}
-
-\gdef\showsymbolset
- {\dodoubleempty\doshowsymbolset}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/symb-uni.mkii b/Master/texmf-dist/tex/context/base/mkii/symb-uni.mkii
deleted file mode 100644
index f5435810f15..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/symb-uni.mkii
+++ /dev/null
@@ -1,1123 +0,0 @@
-%D \module
-%D [ file=symb-uni,
-%D version=2004.11.15,
-%D title=\CONTEXT\ Symbol Libraries,
-%D subtitle=Unicode Symbols,
-%D author=Adam T. Lindsay,
-%D date=\currentdate,
-%D copyright={Adam Lindsay \& Hans Hagen}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C prepared by Adam T. Lindsay.
-
-%D The content of this file originates from the Unicode standard, via some
-%D original XSLT scripts and some hand-editing. This file is open for use
-%D with the ConTeXt typesetting system.
-%D
-%D Adam considers the symbol names and categories to be stable, as they're
-%D directly derived from the Unicode standard.
-%D
-%D \startitemize[packed]
-%D \item Originated 2004-01-05 by Adam T. Lindsay
-%D \item Updated 2004-01-16 with Unicode vector 0x27xx and some in
-%D 215x and 246x
-%D \item Updated 2004-11-15 to include default fonts for MacOSX and
-%D \XETEX.
-%D \stopitemize
-%D
-%D The following macros adapt to default fonts (that contain the characters)
-%D in MacOSX. The font selection mechanism is likely to change once \XETEX\
-%D correctly supports \type{\doiffontcharelse}.
-
-\doifundefinedelse{XeTeXversion}
- {\let\USymbChar \uchar
- \let\USymbCharTwo \uchar
- \let\USymbCharZapf\uchar}
- {\def\USymbChar #1#2{\bgroup\UnicodeSymbolFont \uchar{#1}{#2}\relax\egroup}
- \def\USymbCharTwo #1#2{\bgroup\UnicodeSymbolFontTwo \uchar{#1}{#2}\relax\egroup}
- \def\USymbCharZapf#1#2{\bgroup\UnicodeSymbolFontZapf\uchar{#1}{#2}\relax\egroup}
- \doifundefined{UnicodeSymbolFont} {\definefont[UnicodeSymbolFont] ["Apple Symbols" sa *]}
- \doifundefined{UnicodeSymbolFontTwo} {\definefont[UnicodeSymbolFontTwo] ["Lucida Grande" sa *]}
- \doifundefined{UnicodeSymbolFontZapf}{\definefont[UnicodeSymbolFontZapf]["Zapf Dingbats" sa *]}}
-
-\startsymbolset[Unicode Additional Punctuation] % 0x2000: Requires UnicodeRegular20
-
- \definesymbol[Caret][\USymbChar{32}{56}] % CARET
- \definesymbol[ReferenceMark][\USymbChar{32}{59}] % REFERENCE MARK
- \definesymbol[DoubleExclamationMark][\USymbChar{32}{60}] % DOUBLE EXCLAMATION MARK
- \definesymbol[Interrobang][\USymbChar{32}{61}] % INTERROBANG
- \definesymbol[Overline][\USymbChar{32}{62}] % OVERLINE
- \definesymbol[Undertie][\USymbChar{32}{63}] % UNDERTIE
- \definesymbol[CharacterTie][\USymbChar{32}{64}] % CHARACTER TIE
- \definesymbol[CaretInsertionPoint][\USymbChar{32}{65}] % CARET INSERTION POINT
- \definesymbol[Asterism][\USymbChar{32}{66}] % ASTERISM
- \definesymbol[HyphenBullet][\USymbChar{32}{67}] % HYPHEN BULLET
- \definesymbol[FractionSlash][\USymbChar{32}{68}] % FRACTION SLASH
- \definesymbol[LeftSquareBracketWithQuill][\USymbChar{32}{69}] % LEFT SQUARE BRACKET WITH QUILL
- \definesymbol[RightSquareBracketWithQuill][\USymbChar{32}{70}] % RIGHT SQUARE BRACKET WITH QUILL
- \definesymbol[QuestionExclamationMark][\USymbChar{32}{72}] % QUESTION EXCLAMATION MARK
- \definesymbol[ExclamationQuestionMark][\USymbChar{32}{73}] % EXCLAMATION QUESTION MARK
- \definesymbol[TironianSignEt][\USymbChar{32}{74}] % TIRONIAN SIGN ET
- \definesymbol[ReversedPilcrowSign][\USymbChar{32}{75}] % REVERSED PILCROW SIGN
- \definesymbol[BlackLeftwardsBullet][\USymbChar{32}{76}] % BLACK LEFTWARDS BULLET
- \definesymbol[BlackRightwardsBullet][\USymbChar{32}{77}] % BLACK RIGHTWARDS BULLET
-
-\stopsymbolset
-
-\startsymbolset[Unicode Currency] % 0x20A0: Requires UnicodeRegular20
-
- \definesymbol[Euro-currencySign][\USymbChar{32}{160}] % EURO-CURRENCY SIGN
- \definesymbol[ColonSign][\USymbChar{32}{161}] % COLON SIGN
- \definesymbol[CruzeiroSign][\USymbChar{32}{162}] % CRUZEIRO SIGN
- \definesymbol[FrenchFrancSign][\USymbChar{32}{163}] % FRENCH FRANC SIGN
- \definesymbol[LiraSign][\USymbChar{32}{164}] % LIRA SIGN
- \definesymbol[MillSign][\USymbChar{32}{165}] % MILL SIGN
- \definesymbol[NairaSign][\USymbChar{32}{166}] % NAIRA SIGN
- \definesymbol[PesetaSign][\USymbChar{32}{167}] % PESETA SIGN
- \definesymbol[RupeeSign][\USymbChar{32}{168}] % RUPEE SIGN
- \definesymbol[WonSign][\USymbChar{32}{169}] % WON SIGN
- \definesymbol[NewSheqelSign][\USymbChar{32}{170}] % NEW SHEQEL SIGN
- \definesymbol[DongSign][\USymbChar{32}{171}] % DONG SIGN
- \definesymbol[EuroSign][\USymbChar{32}{172}] % EURO SIGN
- \definesymbol[KipSign][\USymbChar{32}{173}] % KIP SIGN
- \definesymbol[TugrikSign][\USymbChar{32}{174}] % TUGRIK SIGN
- \definesymbol[DrachmaSign][\USymbChar{32}{175}] % DRACHMA SIGN
- \definesymbol[GermanPennySign][\USymbChar{32}{176}] % [Unassigned U+20B0]
- \definesymbol[PfennigSign][\USymbChar{32}{176}] % Unofficial duplicate
- \definesymbol[PesoSign][\USymbChar{32}{177}] % [Unassigned U+20B1]
-
-\stopsymbolset
-
-
-\startsymbolset[Unicode Letterlike] % 0x2100: Requires UnicodeRegular21
-
- \definesymbol[DegreeCelsius][\USymbChar{33}{3}] % DEGREE CELSIUS
- \definesymbol[EulerConstant][\USymbChar{33}{7}] % EULER CONSTANT
- \definesymbol[Scruple][\USymbChar{33}{8}] % SCRUPLE
- \definesymbol[DegreeFahrenheit][\USymbChar{33}{9}] % DEGREE FAHRENHEIT
- \definesymbol[PlanckConstant][\USymbChar{33}{14}] % PLANCK CONSTANT
- \definesymbol[PlanckConstantOverTwoPi][\USymbChar{33}{15}] % PLANCK CONSTANT OVER TWO PI
- \definesymbol[LBBarSymbol][\USymbChar{33}{20}] % L B BAR SYMBOL
- \definesymbol[Versicle][\USymbChar{33}{35}] % VERSICLE
- \definesymbol[OunceSign][\USymbChar{33}{37}] % OUNCE SIGN
- \definesymbol[OhmSign][\USymbChar{33}{38}] % OHM SIGN
- \definesymbol[InvertedOhmSign][\USymbChar{33}{39}] % INVERTED OHM SIGN
- \definesymbol[KelvinSign][\USymbChar{33}{42}] % KELVIN SIGN
- \definesymbol[AngstromSign][\USymbChar{33}{43}] % ANGSTROM SIGN
- \definesymbol[EstimatedSymbol][\USymbChar{33}{46}] % ESTIMATED SYMBOL
-
-\stopsymbolset
-
-\startsymbolset[Unicode Letterlike Additional] % 0x2100: Requires UnicodeRegular21
-
- \definesymbol[AccountOf][\USymbChar{33}{0}] % ACCOUNT OF
- \definesymbol[AddressedToTheSubject][\USymbChar{33}{1}] % ADDRESSED TO THE SUBJECT
- \definesymbol[CareOf][\USymbChar{33}{5}] % CARE OF
- \definesymbol[CadaUna][\USymbChar{33}{6}] % CADA UNA
- \definesymbol[CentreLineSymbol][\USymbChar{33}{4}] % CENTRE LINE SYMBOL
- \definesymbol[NumeroSign][\USymbChar{33}{22}] % NUMERO SIGN
- \definesymbol[SoundRecordingCopyright][\USymbChar{33}{23}] % SOUND RECORDING COPYRIGHT
- \definesymbol[PrescriptionTake][\USymbChar{33}{30}] % PRESCRIPTION TAKE
- \definesymbol[Response][\USymbChar{33}{31}] % RESPONSE
- \definesymbol[ServiceMark][\USymbChar{33}{32}] % SERVICE MARK
- \definesymbol[TelephoneSign][\USymbChar{33}{33}] % TELEPHONE SIGN
- \definesymbol[TradeMarkSign][\USymbChar{33}{34}] % TRADE MARK SIGN
- \definesymbol[InformationSource][\USymbChar{33}{57}] % INFORMATION SOURCE
- \definesymbol[PropertyLine][\USymbChar{33}{74}] % [Unassigned U+214A]
-
-\stopsymbolset
-
-\startsymbolset[Unicode Script Letterlike] % 0x2100: Requires UnicodeRegular21
-
- \definesymbol[ScriptSmallG][\USymbChar{33}{10}] % SCRIPT SMALL G
- \definesymbol[ScriptCapitalH][\USymbChar{33}{11}] % SCRIPT CAPITAL H
- \definesymbol[ScriptCapitalI][\USymbChar{33}{16}] % SCRIPT CAPITAL I
- \definesymbol[ScriptCapitalL][\USymbChar{33}{18}] % SCRIPT CAPITAL L
- \definesymbol[ScriptSmallL][\USymbChar{33}{19}] % SCRIPT SMALL L
- \definesymbol[ScriptCapitalP][\USymbChar{33}{24}] % SCRIPT CAPITAL P
- \definesymbol[ScriptCapitalR][\USymbChar{33}{27}] % SCRIPT CAPITAL R
- \definesymbol[ScriptSmallE][\USymbChar{33}{47}] % SCRIPT SMALL E
- \definesymbol[ScriptCapitalE][\USymbChar{33}{48}] % SCRIPT CAPITAL E
- \definesymbol[ScriptCapitalF][\USymbChar{33}{49}] % SCRIPT CAPITAL F
- \definesymbol[ScriptCapitalB][\USymbChar{33}{44}] % SCRIPT CAPITAL B
- \definesymbol[ScriptCapitalM][\USymbChar{33}{51}] % SCRIPT CAPITAL M
- \definesymbol[ScriptSmallO][\USymbChar{33}{52}] % SCRIPT SMALL O
-
-\stopsymbolset
-
-\startsymbolset[Unicode Hebrew Letterlike] % 0x2100: Requires UnicodeRegular21
-
- \definesymbol[AlefSymbol][\USymbChar{33}{53}] % ALEF SYMBOL
- \definesymbol[BetSymbol][\USymbChar{33}{54}] % BET SYMBOL
- \definesymbol[GimelSymbol][\USymbChar{33}{55}] % GIMEL SYMBOL
- \definesymbol[DaletSymbol][\USymbChar{33}{56}] % DALET SYMBOL
-
-\stopsymbolset
-
-\startsymbolset[Unicode Turned Letterlike] % 0x2100: Requires UnicodeRegular21
-
- \definesymbol[RotatedCapitalQ][\USymbChar{33}{58}] % ROTATED CAPITAL Q
- \definesymbol[TurnedSansSerifCapitalG][\USymbChar{33}{65}] % [Unassigned U+2141]
- \definesymbol[TurnedSansSerifCapitalL][\USymbChar{33}{66}] % [Unassigned U+2142]
- \definesymbol[ReversedSansSerifCapitalL][\USymbChar{33}{67}] % [Unassigned U+2143]
- \definesymbol[TurnedSansSerifCapitalY][\USymbChar{33}{68}] % [Unassigned U+2144]
- \definesymbol[TurnedAmpersand][\USymbChar{33}{75}] % [Unassigned U+214B]
- \definesymbol[TurnedGreekSmallLetterIota][\USymbChar{33}{41}] % TURNED GREEK SMALL LETTER IOTA
- \definesymbol[TurnedCapitalF][\USymbChar{33}{50}] % TURNED CAPITAL F
-
-\stopsymbolset
-
-\startsymbolset[Unicode Black-letter Letterlike] % 0x2100: Requires UnicodeRegular21
-
- \definesymbol[BlackLetterCapitalH][\USymbChar{33}{12}] % BLACK-LETTER CAPITAL H
- \definesymbol[BlackLetterCapitalI][\USymbChar{33}{17}] % BLACK-LETTER CAPITAL I
- \definesymbol[BlackLetterCapitalR][\USymbChar{33}{28}] % BLACK-LETTER CAPITAL R
- \definesymbol[BlackLetterCapitalZ][\USymbChar{33}{40}] % BLACK-LETTER CAPITAL Z
- \definesymbol[BlackLetterCapitalC][\USymbChar{33}{45}] % BLACK-LETTER CAPITAL C
-
-\stopsymbolset
-
-\startsymbolset[Unicode Double-struck Letterlike Math] % 0x2100: Requires UnicodeRegular21
-
- \definesymbol[DoubleStruckCapitalC][\USymbChar{33}{2}] % DOUBLE-STRUCK CAPITAL C
- \definesymbol[DoubleStruckCapitalH][\USymbChar{33}{13}] % DOUBLE-STRUCK CAPITAL H
- \definesymbol[DoubleStruckCapitalN][\USymbChar{33}{21}] % DOUBLE-STRUCK CAPITAL N
- \definesymbol[DoubleStruckCapitalP][\USymbChar{33}{25}] % DOUBLE-STRUCK CAPITAL P
- \definesymbol[DoubleStruckCapitalQ][\USymbChar{33}{26}] % DOUBLE-STRUCK CAPITAL Q
- \definesymbol[DoubleStruckCapitalR][\USymbChar{33}{29}] % DOUBLE-STRUCK CAPITAL R
- \definesymbol[DoubleStruckCapitalZ][\USymbChar{33}{36}] % DOUBLE-STRUCK CAPITAL Z
- \definesymbol[DoubleStruckSmallGamma][\USymbChar{33}{61}] % [Unassigned U+213D]
- \definesymbol[DoubleStruckCapitalGamma][\USymbChar{33}{62}] % [Unassigned U+213E]
- \definesymbol[DoubleStruckCapitalPi][\USymbChar{33}{63}] % [Unassigned U+213F]
- \definesymbol[DoubleStruckNArySummation][\USymbChar{33}{64}] % [Unassigned U+2140]
- \definesymbol[DoubleStruckItalicCapitalD][\USymbChar{33}{69}] % [Unassigned U+2145]
- \definesymbol[DoubleStruckItalicSmallD][\USymbChar{33}{70}] % [Unassigned U+2146]
- \definesymbol[DoubleStruckItalicSmallE][\USymbChar{33}{71}] % [Unassigned U+2147]
- \definesymbol[DoubleStruckItalicSmallI][\USymbChar{33}{72}] % [Unassigned U+2148]
- \definesymbol[DoubleStruckItalicSmallJ][\USymbChar{33}{73}] % [Unassigned U+2149]
-
-\stopsymbolset
-
-\startsymbolset[Unicode Roman Numerals] % 0x2150: Requires UnicodeRegular21
-
- \definesymbol[RomanNumeralOne][\USymbCharTwo{33}{96}] % ROMAN NUMERAL ONE
- \definesymbol[RomanNumeralTwo][\USymbCharTwo{33}{97}] % ROMAN NUMERAL TWO
- \definesymbol[RomanNumeralThree][\USymbCharTwo{33}{98}] % ROMAN NUMERAL THREE
- \definesymbol[RomanNumeralFour][\USymbCharTwo{33}{99}] % ROMAN NUMERAL FOUR
- \definesymbol[RomanNumeralFive][\USymbCharTwo{33}{100}] % ROMAN NUMERAL FIVE
- \definesymbol[RomanNumeralSix][\USymbCharTwo{33}{101}] % ROMAN NUMERAL SIX
- \definesymbol[RomanNumeralSeven][\USymbCharTwo{33}{102}] % ROMAN NUMERAL SEVEN
- \definesymbol[RomanNumeralEight][\USymbCharTwo{33}{103}] % ROMAN NUMERAL EIGHT
- \definesymbol[RomanNumeralNine][\USymbCharTwo{33}{104}] % ROMAN NUMERAL NINE
- \definesymbol[RomanNumeralTen][\USymbCharTwo{33}{105}] % ROMAN NUMERAL TEN
- \definesymbol[RomanNumeralEleven][\USymbCharTwo{33}{106}] % ROMAN NUMERAL ELEVEN
- \definesymbol[RomanNumeralTwelve][\USymbCharTwo{33}{107}] % ROMAN NUMERAL TWELVE
- \definesymbol[RomanNumeralFifty][\USymbCharTwo{33}{108}] % ROMAN NUMERAL FIFTY
- \definesymbol[RomanNumeralOneHundred][\USymbCharTwo{33}{109}] % ROMAN NUMERAL ONE HUNDRED
- \definesymbol[RomanNumeralFiveHundred][\USymbCharTwo{33}{110}] % ROMAN NUMERAL FIVE HUNDRED
- \definesymbol[RomanNumeralOneThousand][\USymbCharTwo{33}{111}] % ROMAN NUMERAL ONE THOUSAND
- \definesymbol[RomanNumeralOneThousandCD][\USymbCharTwo{33}{128}] % ROMAN NUMERAL ONE THOUSAND C D
- \definesymbol[RomanNumeralFiveThousand][\USymbCharTwo{33}{129}] % ROMAN NUMERAL FIVE THOUSAND
- \definesymbol[RomanNumeralTenThousand][\USymbCharTwo{33}{130}] % ROMAN NUMERAL TEN THOUSAND
- \definesymbol[RomanNumeralReversedOneHundred][\USymbCharTwo{33}{131}] % ROMAN NUMERAL REVERSED ONE HUNDRED
-
-\stopsymbolset
-
-\startsymbolset[Unicode Small Roman Numerals] % 0x2150: Requires UnicodeRegular21
-
- \definesymbol[SmallRomanNumeralOne][\USymbCharTwo{33}{112}] % SMALL ROMAN NUMERAL ONE
- \definesymbol[SmallRomanNumeralTwo][\USymbCharTwo{33}{113}] % SMALL ROMAN NUMERAL TWO
- \definesymbol[SmallRomanNumeralThree][\USymbCharTwo{33}{114}] % SMALL ROMAN NUMERAL THREE
- \definesymbol[SmallRomanNumeralFour][\USymbCharTwo{33}{115}] % SMALL ROMAN NUMERAL FOUR
- \definesymbol[SmallRomanNumeralFive][\USymbCharTwo{33}{116}] % SMALL ROMAN NUMERAL FIVE
- \definesymbol[SmallRomanNumeralSix][\USymbCharTwo{33}{117}] % SMALL ROMAN NUMERAL SIX
- \definesymbol[SmallRomanNumeralSeven][\USymbCharTwo{33}{118}] % SMALL ROMAN NUMERAL SEVEN
- \definesymbol[SmallRomanNumeralEight][\USymbCharTwo{33}{119}] % SMALL ROMAN NUMERAL EIGHT
- \definesymbol[SmallRomanNumeralNine][\USymbCharTwo{33}{120}] % SMALL ROMAN NUMERAL NINE
- \definesymbol[SmallRomanNumeralTen][\USymbCharTwo{33}{121}] % SMALL ROMAN NUMERAL TEN
- \definesymbol[SmallRomanNumeralEleven][\USymbCharTwo{33}{122}] % SMALL ROMAN NUMERAL ELEVEN
- \definesymbol[SmallRomanNumeralTwelve][\USymbCharTwo{33}{123}] % SMALL ROMAN NUMERAL TWELVE
- \definesymbol[SmallRomanNumeralFifty][\USymbCharTwo{33}{124}] % SMALL ROMAN NUMERAL FIFTY
- \definesymbol[SmallRomanNumeralOneHundred][\USymbCharTwo{33}{125}] % SMALL ROMAN NUMERAL ONE HUNDRED
- \definesymbol[SmallRomanNumeralFiveHundred][\USymbCharTwo{33}{126}] % SMALL ROMAN NUMERAL FIVE HUNDRED
- \definesymbol[SmallRomanNumeralOneThousand][\USymbCharTwo{33}{127}] % SMALL ROMAN NUMERAL ONE THOUSAND
-
-\stopsymbolset
-
-\startsymbolset[Unicode Arrows] % 0x2190: Requires UnicodeRegular21
-
- \definesymbol[LeftwardsArrow][\USymbChar{33}{144}] % LEFTWARDS ARROW
- \definesymbol[UpwardsArrow][\USymbChar{33}{145}] % UPWARDS ARROW
- \definesymbol[RightwardsArrow][\USymbChar{33}{146}] % RIGHTWARDS ARROW
- \definesymbol[DownwardsArrow][\USymbChar{33}{147}] % DOWNWARDS ARROW
- \definesymbol[LeftRightArrow][\USymbChar{33}{148}] % LEFT RIGHT ARROW
- \definesymbol[UpDownArrow][\USymbChar{33}{149}] % UP DOWN ARROW
- \definesymbol[NorthWestArrow][\USymbChar{33}{150}] % NORTH WEST ARROW
- \definesymbol[NorthEastArrow][\USymbChar{33}{151}] % NORTH EAST ARROW
- \definesymbol[SouthEastArrow][\USymbChar{33}{152}] % SOUTH EAST ARROW
- \definesymbol[SouthWestArrow][\USymbChar{33}{153}] % SOUTH WEST ARROW
- \definesymbol[LeftwardsArrowWithStroke][\USymbChar{33}{154}] % LEFTWARDS ARROW WITH STROKE
- \definesymbol[RightwardsArrowWithStroke][\USymbChar{33}{155}] % RIGHTWARDS ARROW WITH STROKE
- \definesymbol[LeftwardsWaveArrow][\USymbChar{33}{156}] % LEFTWARDS WAVE ARROW
- \definesymbol[RightwardsWaveArrow][\USymbChar{33}{157}] % RIGHTWARDS WAVE ARROW
- \definesymbol[LeftwardsTwoHeadedArrow][\USymbChar{33}{158}] % LEFTWARDS TWO HEADED ARROW
- \definesymbol[UpwardsTwoHeadedArrow][\USymbChar{33}{159}] % UPWARDS TWO HEADED ARROW
- \definesymbol[RightwardsTwoHeadedArrow][\USymbChar{33}{160}] % RIGHTWARDS TWO HEADED ARROW
- \definesymbol[DownwardsTwoHeadedArrow][\USymbChar{33}{161}] % DOWNWARDS TWO HEADED ARROW
- \definesymbol[LeftwardsArrowWithTail][\USymbChar{33}{162}] % LEFTWARDS ARROW WITH TAIL
- \definesymbol[RightwardsArrowWithTail][\USymbChar{33}{163}] % RIGHTWARDS ARROW WITH TAIL
- \definesymbol[LeftwardsArrowFromBar][\USymbChar{33}{164}] % LEFTWARDS ARROW FROM BAR
- \definesymbol[UpwardsArrowFromBar][\USymbChar{33}{165}] % UPWARDS ARROW FROM BAR
- \definesymbol[RightwardsArrowFromBar][\USymbChar{33}{166}] % RIGHTWARDS ARROW FROM BAR
- \definesymbol[DownwardsArrowFromBar][\USymbChar{33}{167}] % DOWNWARDS ARROW FROM BAR
- \definesymbol[UpDownArrowWithBase][\USymbChar{33}{168}] % UP DOWN ARROW WITH BASE
- \definesymbol[LeftwardsArrowWithHook][\USymbChar{33}{169}] % LEFTWARDS ARROW WITH HOOK
- \definesymbol[RightwardsArrowWithHook][\USymbChar{33}{170}] % RIGHTWARDS ARROW WITH HOOK
- \definesymbol[LeftwardsArrowWithLoop][\USymbChar{33}{171}] % LEFTWARDS ARROW WITH LOOP
- \definesymbol[RightwardsArrowWithLoop][\USymbChar{33}{172}] % RIGHTWARDS ARROW WITH LOOP
- \definesymbol[LeftRightWaveArrow][\USymbChar{33}{173}] % LEFT RIGHT WAVE ARROW
- \definesymbol[LeftRightArrowWithStroke][\USymbChar{33}{174}] % LEFT RIGHT ARROW WITH STROKE
- \definesymbol[DownwardsZigzagArrow][\USymbChar{33}{175}] % DOWNWARDS ZIGZAG ARROW
- \definesymbol[UpwardsArrowWithTipLeftwards][\USymbChar{33}{176}] % UPWARDS ARROW WITH TIP LEFTWARDS
- \definesymbol[UpwardsArrowWithTipRightwards][\USymbChar{33}{177}] % UPWARDS ARROW WITH TIP RIGHTWARDS
- \definesymbol[DownwardsArrowWithTipLeftwards][\USymbChar{33}{178}] % DOWNWARDS ARROW WITH TIP LEFTWARDS
- \definesymbol[DownwardsArrowWithTipRightwards][\USymbChar{33}{179}] % DOWNWARDS ARROW WITH TIP RIGHTWARDS
- \definesymbol[RightwardsArrowWithCornerDownwards][\USymbChar{33}{180}] % RIGHTWARDS ARROW WITH CORNER DOWNWARDS
- \definesymbol[DownwardsArrowWithCornerLeftwards][\USymbChar{33}{181}] % DOWNWARDS ARROW WITH CORNER LEFTWARDS
- \definesymbol[AnticlockwiseTopSemicircleArrow][\USymbChar{33}{182}] % ANTICLOCKWISE TOP SEMICIRCLE ARROW
- \definesymbol[ClockwiseTopSemicircleArrow][\USymbChar{33}{183}] % CLOCKWISE TOP SEMICIRCLE ARROW
- \definesymbol[NorthWestArrowToLongBar][\USymbChar{33}{184}] % NORTH WEST ARROW TO LONG BAR
- \definesymbol[AnticlockwiseOpenCircleArrow][\USymbChar{33}{186}] % ANTICLOCKWISE OPEN CIRCLE ARROW
- \definesymbol[ClockwiseOpenCircleArrow][\USymbChar{33}{187}] % CLOCKWISE OPEN CIRCLE ARROW
- \definesymbol[LeftwardsHarpoonWithBarbUpwards][\USymbChar{33}{188}] % LEFTWARDS HARPOON WITH BARB UPWARDS
- \definesymbol[LeftwardsHarpoonWithBarbDownwards][\USymbChar{33}{189}] % LEFTWARDS HARPOON WITH BARB DOWNWARDS
- \definesymbol[UpwardsHarpoonWithBarbRightwards][\USymbChar{33}{190}] % UPWARDS HARPOON WITH BARB RIGHTWARDS
- \definesymbol[UpwardsHarpoonWithBarbLeftwards][\USymbChar{33}{191}] % UPWARDS HARPOON WITH BARB LEFTWARDS
- \definesymbol[RightwardsHarpoonWithBarbUpwards][\USymbChar{33}{192}] % RIGHTWARDS HARPOON WITH BARB UPWARDS
- \definesymbol[RightwardsHarpoonWithBarbDownwards][\USymbChar{33}{193}] % RIGHTWARDS HARPOON WITH BARB DOWNWARDS
- \definesymbol[DownwardsHarpoonWithBarbRightwards][\USymbChar{33}{194}] % DOWNWARDS HARPOON WITH BARB RIGHTWARDS
- \definesymbol[DownwardsHarpoonWithBarbLeftwards][\USymbChar{33}{195}] % DOWNWARDS HARPOON WITH BARB LEFTWARDS
- \definesymbol[LeftwardsSquiggleArrow][\USymbChar{33}{220}] % LEFTWARDS SQUIGGLE ARROW
- \definesymbol[RightwardsSquiggleArrow][\USymbChar{33}{221}] % RIGHTWARDS SQUIGGLE ARROW
- \definesymbol[UpwardsArrowWithDoubleStroke][\USymbChar{33}{222}] % UPWARDS ARROW WITH DOUBLE STROKE
- \definesymbol[DownwardsArrowWithDoubleStroke][\USymbChar{33}{223}] % DOWNWARDS ARROW WITH DOUBLE STROKE
- \definesymbol[LeftwardsDashedArrow][\USymbChar{33}{224}] % LEFTWARDS DASHED ARROW
- \definesymbol[UpwardsDashedArrow][\USymbChar{33}{225}] % UPWARDS DASHED ARROW
- \definesymbol[RightwardsDashedArrow][\USymbChar{33}{226}] % RIGHTWARDS DASHED ARROW
- \definesymbol[DownwardsDashedArrow][\USymbChar{33}{227}] % DOWNWARDS DASHED ARROW
- \definesymbol[LeftwardsArrowToBar][\USymbChar{33}{228}] % LEFTWARDS ARROW TO BAR
- \definesymbol[RightwardsArrowToBar][\USymbChar{33}{229}] % RIGHTWARDS ARROW TO BAR
- \definesymbol[LeftwardsWhiteArrow][\USymbChar{33}{230}] % LEFTWARDS WHITE ARROW
- \definesymbol[UpwardsWhiteArrow][\USymbChar{33}{231}] % UPWARDS WHITE ARROW
- \definesymbol[RightwardsWhiteArrow][\USymbChar{33}{232}] % RIGHTWARDS WHITE ARROW
- \definesymbol[DownwardsWhiteArrow][\USymbChar{33}{233}] % DOWNWARDS WHITE ARROW
- \definesymbol[UpwardsWhiteArrowFromBar][\USymbChar{33}{234}] % UPWARDS WHITE ARROW FROM BAR
- \definesymbol[UpwardsWhiteArrowOnPedestal][\USymbChar{33}{235}] % UPWARDS WHITE ARROW ON PEDESTAL
- \definesymbol[UpwardsWhiteArrowOnPedestalWithHorizontalBar][\USymbChar{33}{236}] % UPWARDS WHITE ARROW ON PEDESTAL WITH HORIZONTAL BAR
- \definesymbol[UpwardsWhiteArrowOnPedestalWithVerticalBar][\USymbChar{33}{237}] % UPWARDS WHITE ARROW ON PEDESTAL WITH VERTICAL BAR
- \definesymbol[RightwardsWhiteArrowFromWall][\USymbChar{33}{240}] % RIGHTWARDS WHITE ARROW FROM WALL
- \definesymbol[NorthWestArrowToCorner][\USymbChar{33}{241}] % NORTH WEST ARROW TO CORNER
- \definesymbol[SouthEastArrowToCorner][\USymbChar{33}{242}] % SOUTH EAST ARROW TO CORNER
- \definesymbol[UpDownWhiteArrow][\USymbChar{33}{243}] % UP DOWN WHITE ARROW
-
-\stopsymbolset
-
-\startsymbolset[Unicode Multi Arrows] % 0x2190: Requires UnicodeRegular21
-
- \definesymbol[LeftwardsArrowToBarOverRightwardsArrowToBar][\USymbChar{33}{185}] % LEFTWARDS ARROW TO BAR OVER RIGHTWARDS ARROW TO BAR
- \definesymbol[RightwardsArrowOverLeftwardsArrow][\USymbChar{33}{196}] % RIGHTWARDS ARROW OVER LEFTWARDS ARROW
- \definesymbol[UpwardsArrowLeftwardsOfDownwardsArrow][\USymbChar{33}{197}] % UPWARDS ARROW LEFTWARDS OF DOWNWARDS ARROW
- \definesymbol[LeftwardsArrowOverRightwardsArrow][\USymbChar{33}{198}] % LEFTWARDS ARROW OVER RIGHTWARDS ARROW
- \definesymbol[LeftwardsPairedArrows][\USymbChar{33}{199}] % LEFTWARDS PAIRED ARROWS
- \definesymbol[UpwardsPairedArrows][\USymbChar{33}{200}] % UPWARDS PAIRED ARROWS
- \definesymbol[RightwardsPairedArrows][\USymbChar{33}{201}] % RIGHTWARDS PAIRED ARROWS
- \definesymbol[DownwardsPairedArrows][\USymbChar{33}{202}] % DOWNWARDS PAIRED ARROWS
- \definesymbol[LeftwardsHarpoonOverRightwardsHarpoon][\USymbChar{33}{203}] % LEFTWARDS HARPOON OVER RIGHTWARDS HARPOON
- \definesymbol[RightwardsHarpoonOverLeftwardsHarpoon][\USymbChar{33}{204}] % RIGHTWARDS HARPOON OVER LEFTWARDS HARPOON
- \definesymbol[LeftwardsDoubleArrowWithStroke][\USymbChar{33}{205}] % LEFTWARDS DOUBLE ARROW WITH STROKE
- \definesymbol[LeftRightDoubleArrowWithStroke][\USymbChar{33}{206}] % LEFT RIGHT DOUBLE ARROW WITH STROKE
- \definesymbol[RightwardsDoubleArrowWithStroke][\USymbChar{33}{207}] % RIGHTWARDS DOUBLE ARROW WITH STROKE
- \definesymbol[LeftwardsDoubleArrow][\USymbChar{33}{208}] % LEFTWARDS DOUBLE ARROW
- \definesymbol[UpwardsDoubleArrow][\USymbChar{33}{209}] % UPWARDS DOUBLE ARROW
- \definesymbol[RightwardsDoubleArrow][\USymbChar{33}{210}] % RIGHTWARDS DOUBLE ARROW
- \definesymbol[DownwardsDoubleArrow][\USymbChar{33}{211}] % DOWNWARDS DOUBLE ARROW
- \definesymbol[LeftRightDoubleArrow][\USymbChar{33}{212}] % LEFT RIGHT DOUBLE ARROW
- \definesymbol[UpDownDoubleArrow][\USymbChar{33}{213}] % UP DOWN DOUBLE ARROW
- \definesymbol[NorthWestDoubleArrow][\USymbChar{33}{214}] % NORTH WEST DOUBLE ARROW
- \definesymbol[NorthEastDoubleArrow][\USymbChar{33}{215}] % NORTH EAST DOUBLE ARROW
- \definesymbol[SouthEastDoubleArrow][\USymbChar{33}{216}] % SOUTH EAST DOUBLE ARROW
- \definesymbol[SouthWestDoubleArrow][\USymbChar{33}{217}] % SOUTH WEST DOUBLE ARROW
- \definesymbol[LeftwardsTripleArrow][\USymbChar{33}{218}] % LEFTWARDS TRIPLE ARROW
- \definesymbol[RightwardsTripleArrow][\USymbChar{33}{219}] % RIGHTWARDS TRIPLE ARROW
- \definesymbol[UpwardsWhiteDoubleArrow][\USymbChar{33}{238}] % UPWARDS WHITE DOUBLE ARROW
- \definesymbol[UpwardsWhiteDoubleArrowOnPedestal][\USymbChar{33}{239}] % UPWARDS WHITE DOUBLE ARROW ON PEDESTAL
-
-\stopsymbolset
-
-
-\startsymbolset[Unicode Optical Character Recognition] % 0x2440: Requires UnicodeRegular24
-
- \definesymbol[OcrHook][\USymbChar{36}{64}] % OCR HOOK
- \definesymbol[OcrChair][\USymbChar{36}{65}] % OCR CHAIR
- \definesymbol[OcrFork][\USymbChar{36}{66}] % OCR FORK
- \definesymbol[OcrInvertedFork][\USymbChar{36}{67}] % OCR INVERTED FORK
- \definesymbol[OcrBeltBuckle][\USymbChar{36}{68}] % OCR BELT BUCKLE
- \definesymbol[OcrBowTie][\USymbChar{36}{69}] % OCR BOW TIE
- \definesymbol[OcrBranchBankIdentification][\USymbChar{36}{70}] % OCR BRANCH BANK IDENTIFICATION
- \definesymbol[OcrAmountOfCheck][\USymbChar{36}{71}] % OCR AMOUNT OF CHECK
- \definesymbol[OcrDash][\USymbChar{36}{72}] % OCR DASH
- \definesymbol[OcrCustomerAccountNumber][\USymbChar{36}{73}] % OCR CUSTOMER ACCOUNT NUMBER
- \definesymbol[OcrDoubleBackslash][\USymbChar{36}{74}] % OCR DOUBLE BACKSLASH
-
-\stopsymbolset
-
-
-\startsymbolset[Unicode Box Drawing] % 0x2500: Requires UnicodeRegular25
-
- \definesymbol[LightHorizontal][\USymbChar{37}{0}] % BOX DRAWINGS LIGHT HORIZONTAL
- \definesymbol[HeavyHorizontal][\USymbChar{37}{1}] % BOX DRAWINGS HEAVY HORIZONTAL
- \definesymbol[LightVertical][\USymbChar{37}{2}] % BOX DRAWINGS LIGHT VERTICAL
- \definesymbol[HeavyVertical][\USymbChar{37}{3}] % BOX DRAWINGS HEAVY VERTICAL
- \definesymbol[LightTripleDashHorizontal][\USymbChar{37}{4}] % BOX DRAWINGS LIGHT TRIPLE DASH HORIZONTAL
- \definesymbol[HeavyTripleDashHorizontal][\USymbChar{37}{5}] % BOX DRAWINGS HEAVY TRIPLE DASH HORIZONTAL
- \definesymbol[LightTripleDashVertical][\USymbChar{37}{6}] % BOX DRAWINGS LIGHT TRIPLE DASH VERTICAL
- \definesymbol[HeavyTripleDashVertical][\USymbChar{37}{7}] % BOX DRAWINGS HEAVY TRIPLE DASH VERTICAL
- \definesymbol[LightQuadrupleDashHorizontal][\USymbChar{37}{8}] % BOX DRAWINGS LIGHT QUADRUPLE DASH HORIZONTAL
- \definesymbol[HeavyQuadrupleDashHorizontal][\USymbChar{37}{9}] % BOX DRAWINGS HEAVY QUADRUPLE DASH HORIZONTAL
- \definesymbol[LightQuadrupleDashVertical][\USymbChar{37}{10}] % BOX DRAWINGS LIGHT QUADRUPLE DASH VERTICAL
- \definesymbol[HeavyQuadrupleDashVertical][\USymbChar{37}{11}] % BOX DRAWINGS HEAVY QUADRUPLE DASH VERTICAL
- \definesymbol[LightDownAndRight][\USymbChar{37}{12}] % BOX DRAWINGS LIGHT DOWN AND RIGHT
- \definesymbol[DownLightAndRightHeavy][\USymbChar{37}{13}] % BOX DRAWINGS DOWN LIGHT AND RIGHT HEAVY
- \definesymbol[DownHeavyAndRightLight][\USymbChar{37}{14}] % BOX DRAWINGS DOWN HEAVY AND RIGHT LIGHT
- \definesymbol[HeavyDownAndRight][\USymbChar{37}{15}] % BOX DRAWINGS HEAVY DOWN AND RIGHT
- \definesymbol[LightDownAndLeft][\USymbChar{37}{16}] % BOX DRAWINGS LIGHT DOWN AND LEFT
- \definesymbol[DownLightAndLeftHeavy][\USymbChar{37}{17}] % BOX DRAWINGS DOWN LIGHT AND LEFT HEAVY
- \definesymbol[DownHeavyAndLeftLight][\USymbChar{37}{18}] % BOX DRAWINGS DOWN HEAVY AND LEFT LIGHT
- \definesymbol[HeavyDownAndLeft][\USymbChar{37}{19}] % BOX DRAWINGS HEAVY DOWN AND LEFT
- \definesymbol[LightUpAndRight][\USymbChar{37}{20}] % BOX DRAWINGS LIGHT UP AND RIGHT
- \definesymbol[UpLightAndRightHeavy][\USymbChar{37}{21}] % BOX DRAWINGS UP LIGHT AND RIGHT HEAVY
- \definesymbol[UpHeavyAndRightLight][\USymbChar{37}{22}] % BOX DRAWINGS UP HEAVY AND RIGHT LIGHT
- \definesymbol[HeavyUpAndRight][\USymbChar{37}{23}] % BOX DRAWINGS HEAVY UP AND RIGHT
- \definesymbol[LightUpAndLeft][\USymbChar{37}{24}] % BOX DRAWINGS LIGHT UP AND LEFT
- \definesymbol[UpLightAndLeftHeavy][\USymbChar{37}{25}] % BOX DRAWINGS UP LIGHT AND LEFT HEAVY
- \definesymbol[UpHeavyAndLeftLight][\USymbChar{37}{26}] % BOX DRAWINGS UP HEAVY AND LEFT LIGHT
- \definesymbol[HeavyUpAndLeft][\USymbChar{37}{27}] % BOX DRAWINGS HEAVY UP AND LEFT
- \definesymbol[LightVerticalAndRight][\USymbChar{37}{28}] % BOX DRAWINGS LIGHT VERTICAL AND RIGHT
- \definesymbol[VerticalLightAndRightHeavy][\USymbChar{37}{29}] % BOX DRAWINGS VERTICAL LIGHT AND RIGHT HEAVY
- \definesymbol[UpHeavyAndRightDownLight][\USymbChar{37}{30}] % BOX DRAWINGS UP HEAVY AND RIGHT DOWN LIGHT
- \definesymbol[DownHeavyAndRightUpLight][\USymbChar{37}{31}] % BOX DRAWINGS DOWN HEAVY AND RIGHT UP LIGHT
- \definesymbol[VerticalHeavyAndRightLight][\USymbChar{37}{32}] % BOX DRAWINGS VERTICAL HEAVY AND RIGHT LIGHT
- \definesymbol[DownLightAndRightUpHeavy][\USymbChar{37}{33}] % BOX DRAWINGS DOWN LIGHT AND RIGHT UP HEAVY
- \definesymbol[UpLightAndRightDownHeavy][\USymbChar{37}{34}] % BOX DRAWINGS UP LIGHT AND RIGHT DOWN HEAVY
- \definesymbol[HeavyVerticalAndRight][\USymbChar{37}{35}] % BOX DRAWINGS HEAVY VERTICAL AND RIGHT
- \definesymbol[LightVerticalAndLeft][\USymbChar{37}{36}] % BOX DRAWINGS LIGHT VERTICAL AND LEFT
- \definesymbol[VerticalLightAndLeftHeavy][\USymbChar{37}{37}] % BOX DRAWINGS VERTICAL LIGHT AND LEFT HEAVY
- \definesymbol[UpHeavyAndLeftDownLight][\USymbChar{37}{38}] % BOX DRAWINGS UP HEAVY AND LEFT DOWN LIGHT
- \definesymbol[DownHeavyAndLeftUpLight][\USymbChar{37}{39}] % BOX DRAWINGS DOWN HEAVY AND LEFT UP LIGHT
- \definesymbol[VerticalHeavyAndLeftLight][\USymbChar{37}{40}] % BOX DRAWINGS VERTICAL HEAVY AND LEFT LIGHT
- \definesymbol[DownLightAndLeftUpHeavy][\USymbChar{37}{41}] % BOX DRAWINGS DOWN LIGHT AND LEFT UP HEAVY
- \definesymbol[UpLightAndLeftDownHeavy][\USymbChar{37}{42}] % BOX DRAWINGS UP LIGHT AND LEFT DOWN HEAVY
- \definesymbol[HeavyVerticalAndLeft][\USymbChar{37}{43}] % BOX DRAWINGS HEAVY VERTICAL AND LEFT
- \definesymbol[LightDownAndHorizontal][\USymbChar{37}{44}] % BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
- \definesymbol[LeftHeavyAndRightDownLight][\USymbChar{37}{45}] % BOX DRAWINGS LEFT HEAVY AND RIGHT DOWN LIGHT
- \definesymbol[RightHeavyAndLeftDownLight][\USymbChar{37}{46}] % BOX DRAWINGS RIGHT HEAVY AND LEFT DOWN LIGHT
- \definesymbol[DownLightAndHorizontalHeavy][\USymbChar{37}{47}] % BOX DRAWINGS DOWN LIGHT AND HORIZONTAL HEAVY
- \definesymbol[DownHeavyAndHorizontalLight][\USymbChar{37}{48}] % BOX DRAWINGS DOWN HEAVY AND HORIZONTAL LIGHT
- \definesymbol[RightLightAndLeftDownHeavy][\USymbChar{37}{49}] % BOX DRAWINGS RIGHT LIGHT AND LEFT DOWN HEAVY
- \definesymbol[LeftLightAndRightDownHeavy][\USymbChar{37}{50}] % BOX DRAWINGS LEFT LIGHT AND RIGHT DOWN HEAVY
- \definesymbol[HeavyDownAndHorizontal][\USymbChar{37}{51}] % BOX DRAWINGS HEAVY DOWN AND HORIZONTAL
- \definesymbol[LightUpAndHorizontal][\USymbChar{37}{52}] % BOX DRAWINGS LIGHT UP AND HORIZONTAL
- \definesymbol[LeftHeavyAndRightUpLight][\USymbChar{37}{53}] % BOX DRAWINGS LEFT HEAVY AND RIGHT UP LIGHT
- \definesymbol[RightHeavyAndLeftUpLight][\USymbChar{37}{54}] % BOX DRAWINGS RIGHT HEAVY AND LEFT UP LIGHT
- \definesymbol[UpLightAndHorizontalHeavy][\USymbChar{37}{55}] % BOX DRAWINGS UP LIGHT AND HORIZONTAL HEAVY
- \definesymbol[UpHeavyAndHorizontalLight][\USymbChar{37}{56}] % BOX DRAWINGS UP HEAVY AND HORIZONTAL LIGHT
- \definesymbol[RightLightAndLeftUpHeavy][\USymbChar{37}{57}] % BOX DRAWINGS RIGHT LIGHT AND LEFT UP HEAVY
- \definesymbol[LeftLightAndRightUpHeavy][\USymbChar{37}{58}] % BOX DRAWINGS LEFT LIGHT AND RIGHT UP HEAVY
- \definesymbol[HeavyUpAndHorizontal][\USymbChar{37}{59}] % BOX DRAWINGS HEAVY UP AND HORIZONTAL
- \definesymbol[LightVerticalAndHorizontal][\USymbChar{37}{60}] % BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
- \definesymbol[LeftHeavyAndRightVerticalLight][\USymbChar{37}{61}] % BOX DRAWINGS LEFT HEAVY AND RIGHT VERTICAL LIGHT
- \definesymbol[RightHeavyAndLeftVerticalLight][\USymbChar{37}{62}] % BOX DRAWINGS RIGHT HEAVY AND LEFT VERTICAL LIGHT
- \definesymbol[VerticalLightAndHorizontalHeavy][\USymbChar{37}{63}] % BOX DRAWINGS VERTICAL LIGHT AND HORIZONTAL HEAVY
- \definesymbol[UpHeavyAndDownHorizontalLight][\USymbChar{37}{64}] % BOX DRAWINGS UP HEAVY AND DOWN HORIZONTAL LIGHT
- \definesymbol[DownHeavyAndUpHorizontalLight][\USymbChar{37}{65}] % BOX DRAWINGS DOWN HEAVY AND UP HORIZONTAL LIGHT
- \definesymbol[VerticalHeavyAndHorizontalLight][\USymbChar{37}{66}] % BOX DRAWINGS VERTICAL HEAVY AND HORIZONTAL LIGHT
- \definesymbol[LeftUpHeavyAndRightDownLight][\USymbChar{37}{67}] % BOX DRAWINGS LEFT UP HEAVY AND RIGHT DOWN LIGHT
- \definesymbol[RightUpHeavyAndLeftDownLight][\USymbChar{37}{68}] % BOX DRAWINGS RIGHT UP HEAVY AND LEFT DOWN LIGHT
- \definesymbol[LeftDownHeavyAndRightUpLight][\USymbChar{37}{69}] % BOX DRAWINGS LEFT DOWN HEAVY AND RIGHT UP LIGHT
- \definesymbol[RightDownHeavyAndLeftUpLight][\USymbChar{37}{70}] % BOX DRAWINGS RIGHT DOWN HEAVY AND LEFT UP LIGHT
- \definesymbol[DownLightAndUpHorizontalHeavy][\USymbChar{37}{71}] % BOX DRAWINGS DOWN LIGHT AND UP HORIZONTAL HEAVY
- \definesymbol[UpLightAndDownHorizontalHeavy][\USymbChar{37}{72}] % BOX DRAWINGS UP LIGHT AND DOWN HORIZONTAL HEAVY
- \definesymbol[RightLightAndLeftVerticalHeavy][\USymbChar{37}{73}] % BOX DRAWINGS RIGHT LIGHT AND LEFT VERTICAL HEAVY
- \definesymbol[LeftLightAndRightVerticalHeavy][\USymbChar{37}{74}] % BOX DRAWINGS LEFT LIGHT AND RIGHT VERTICAL HEAVY
- \definesymbol[HeavyVerticalAndHorizontal][\USymbChar{37}{75}] % BOX DRAWINGS HEAVY VERTICAL AND HORIZONTAL
- \definesymbol[LightArcDownAndRight][\USymbChar{37}{109}] % BOX DRAWINGS LIGHT ARC DOWN AND RIGHT
- \definesymbol[LightArcDownAndLeft][\USymbChar{37}{110}] % BOX DRAWINGS LIGHT ARC DOWN AND LEFT
- \definesymbol[LightArcUpAndLeft][\USymbChar{37}{111}] % BOX DRAWINGS LIGHT ARC UP AND LEFT
- \definesymbol[LightArcUpAndRight][\USymbChar{37}{112}] % BOX DRAWINGS LIGHT ARC UP AND RIGHT
- \definesymbol[LightDiagonalUpperRightToLowerLeft][\USymbChar{37}{113}] % BOX DRAWINGS LIGHT DIAGONAL UPPER RIGHT TO LOWER LEFT
- \definesymbol[LightDiagonalUpperLeftToLowerRight][\USymbChar{37}{114}] % BOX DRAWINGS LIGHT DIAGONAL UPPER LEFT TO LOWER RIGHT
- \definesymbol[LightDiagonalCross][\USymbChar{37}{115}] % BOX DRAWINGS LIGHT DIAGONAL CROSS
- \definesymbol[LightLeft][\USymbChar{37}{116}] % BOX DRAWINGS LIGHT LEFT
- \definesymbol[LightUp][\USymbChar{37}{117}] % BOX DRAWINGS LIGHT UP
- \definesymbol[LightRight][\USymbChar{37}{118}] % BOX DRAWINGS LIGHT RIGHT
- \definesymbol[LightDown][\USymbChar{37}{119}] % BOX DRAWINGS LIGHT DOWN
- \definesymbol[HeavyLeft][\USymbChar{37}{120}] % BOX DRAWINGS HEAVY LEFT
- \definesymbol[HeavyUp][\USymbChar{37}{121}] % BOX DRAWINGS HEAVY UP
- \definesymbol[HeavyRight][\USymbChar{37}{122}] % BOX DRAWINGS HEAVY RIGHT
- \definesymbol[HeavyDown][\USymbChar{37}{123}] % BOX DRAWINGS HEAVY DOWN
- \definesymbol[LightLeftAndHeavyRight][\USymbChar{37}{124}] % BOX DRAWINGS LIGHT LEFT AND HEAVY RIGHT
- \definesymbol[LightUpAndHeavyDown][\USymbChar{37}{125}] % BOX DRAWINGS LIGHT UP AND HEAVY DOWN
- \definesymbol[HeavyLeftAndLightRight][\USymbChar{37}{126}] % BOX DRAWINGS HEAVY LEFT AND LIGHT RIGHT
- \definesymbol[HeavyUpAndLightDown][\USymbChar{37}{127}] % BOX DRAWINGS HEAVY UP AND LIGHT DOWN
-
-\stopsymbolset
-
-\startsymbolset[Unicode Circled Digits] % 0x2460: Requires UnicodeRegular24
-
- \definesymbol[CircledOne][\USymbCharZapf{36}{96}] % CIRCLED DIGIT ONE
- \definesymbol[CircledTwo][\USymbCharZapf{36}{97}] % CIRCLED DIGIT TWO
- \definesymbol[CircledThree][\USymbCharZapf{36}{98}] % CIRCLED DIGIT THREE
- \definesymbol[CircledFour][\USymbCharZapf{36}{99}] % CIRCLED DIGIT FOUR
- \definesymbol[CircledFive][\USymbCharZapf{36}{100}] % CIRCLED DIGIT FIVE
- \definesymbol[CircledSix][\USymbCharZapf{36}{101}] % CIRCLED DIGIT SIX
- \definesymbol[CircledSeven][\USymbCharZapf{36}{102}] % CIRCLED DIGIT SEVEN
- \definesymbol[CircledEight][\USymbCharZapf{36}{103}] % CIRCLED DIGIT EIGHT
- \definesymbol[CircledNine][\USymbCharZapf{36}{104}] % CIRCLED DIGIT NINE
- \definesymbol[CircledTen][\USymbCharZapf{36}{105}] % CIRCLED NUMBER TEN
-
-\stopsymbolset
-
-\startsymbolset[Unicode Double Box Drawing] % 0x2500: Requires UnicodeRegular25
-
- \definesymbol[LightDoubleDashHorizontal][\USymbChar{37}{76}] % BOX DRAWINGS LIGHT DOUBLE DASH HORIZONTAL
- \definesymbol[HeavyDoubleDashHorizontal][\USymbChar{37}{77}] % BOX DRAWINGS HEAVY DOUBLE DASH HORIZONTAL
- \definesymbol[LightDoubleDashVertical][\USymbChar{37}{78}] % BOX DRAWINGS LIGHT DOUBLE DASH VERTICAL
- \definesymbol[HeavyDoubleDashVertical][\USymbChar{37}{79}] % BOX DRAWINGS HEAVY DOUBLE DASH VERTICAL
- \definesymbol[DoubleHorizontal][\USymbChar{37}{80}] % BOX DRAWINGS DOUBLE HORIZONTAL
- \definesymbol[DoubleVertical][\USymbChar{37}{81}] % BOX DRAWINGS DOUBLE VERTICAL
- \definesymbol[DownSingleAndRightDouble][\USymbChar{37}{82}] % BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
- \definesymbol[DownDoubleAndRightSingle][\USymbChar{37}{83}] % BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
- \definesymbol[DoubleDownAndRight][\USymbChar{37}{84}] % BOX DRAWINGS DOUBLE DOWN AND RIGHT
- \definesymbol[DownSingleAndLeftDouble][\USymbChar{37}{85}] % BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
- \definesymbol[DownDoubleAndLeftSingle][\USymbChar{37}{86}] % BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
- \definesymbol[DoubleDownAndLeft][\USymbChar{37}{87}] % BOX DRAWINGS DOUBLE DOWN AND LEFT
- \definesymbol[UpSingleAndRightDouble][\USymbChar{37}{88}] % BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
- \definesymbol[UpDoubleAndRightSingle][\USymbChar{37}{89}] % BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
- \definesymbol[DoubleUpAndRight][\USymbChar{37}{90}] % BOX DRAWINGS DOUBLE UP AND RIGHT
- \definesymbol[UpSingleAndLeftDouble][\USymbChar{37}{91}] % BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
- \definesymbol[UpDoubleAndLeftSingle][\USymbChar{37}{92}] % BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
- \definesymbol[DoubleUpAndLeft][\USymbChar{37}{93}] % BOX DRAWINGS DOUBLE UP AND LEFT
- \definesymbol[VerticalSingleAndRightDouble][\USymbChar{37}{94}] % BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
- \definesymbol[VerticalDoubleAndRightSingle][\USymbChar{37}{95}] % BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
- \definesymbol[DoubleVerticalAndRight][\USymbChar{37}{96}] % BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
- \definesymbol[VerticalSingleAndLeftDouble][\USymbChar{37}{97}] % BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
- \definesymbol[VerticalDoubleAndLeftSingle][\USymbChar{37}{98}] % BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
- \definesymbol[DoubleVerticalAndLeft][\USymbChar{37}{99}] % BOX DRAWINGS DOUBLE VERTICAL AND LEFT
- \definesymbol[DownSingleAndHorizontalDouble][\USymbChar{37}{100}] % BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
- \definesymbol[DownDoubleAndHorizontalSingle][\USymbChar{37}{101}] % BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
- \definesymbol[DoubleDownAndHorizontal][\USymbChar{37}{102}] % BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
- \definesymbol[UpSingleAndHorizontalDouble][\USymbChar{37}{103}] % BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
- \definesymbol[UpDoubleAndHorizontalSingle][\USymbChar{37}{104}] % BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
- \definesymbol[DoubleUpAndHorizontal][\USymbChar{37}{105}] % BOX DRAWINGS DOUBLE UP AND HORIZONTAL
- \definesymbol[VerticalSingleAndHorizontalDouble][\USymbChar{37}{106}] % BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
- \definesymbol[VerticalDoubleAndHorizontalSingle][\USymbChar{37}{107}] % BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
- \definesymbol[DoubleVerticalAndHorizontal][\USymbChar{37}{108}] % BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
-
-\stopsymbolset
-
-\startsymbolset[Unicode Block Elements] % 0x2580: Requires UnicodeRegular25
-
- \definesymbol[UpperHalfBlock][\USymbChar{37}{128}] % UPPER HALF BLOCK
- \definesymbol[LowerOneEighthBlock][\USymbChar{37}{129}] % LOWER ONE EIGHTH BLOCK
- \definesymbol[LowerOneQuarterBlock][\USymbChar{37}{130}] % LOWER ONE QUARTER BLOCK
- \definesymbol[LowerThreeEighthsBlock][\USymbChar{37}{131}] % LOWER THREE EIGHTHS BLOCK
- \definesymbol[LowerHalfBlock][\USymbChar{37}{132}] % LOWER HALF BLOCK
- \definesymbol[LowerFiveEighthsBlock][\USymbChar{37}{133}] % LOWER FIVE EIGHTHS BLOCK
- \definesymbol[LowerThreeQuartersBlock][\USymbChar{37}{134}] % LOWER THREE QUARTERS BLOCK
- \definesymbol[LowerSevenEighthsBlock][\USymbChar{37}{135}] % LOWER SEVEN EIGHTHS BLOCK
- \definesymbol[FullBlock][\USymbChar{37}{136}] % FULL BLOCK
- \definesymbol[LeftSevenEighthsBlock][\USymbChar{37}{137}] % LEFT SEVEN EIGHTHS BLOCK
- \definesymbol[LeftThreeQuartersBlock][\USymbChar{37}{138}] % LEFT THREE QUARTERS BLOCK
- \definesymbol[LeftFiveEighthsBlock][\USymbChar{37}{139}] % LEFT FIVE EIGHTHS BLOCK
- \definesymbol[LeftHalfBlock][\USymbChar{37}{140}] % LEFT HALF BLOCK
- \definesymbol[LeftThreeEighthsBlock][\USymbChar{37}{141}] % LEFT THREE EIGHTHS BLOCK
- \definesymbol[LeftOneQuarterBlock][\USymbChar{37}{142}] % LEFT ONE QUARTER BLOCK
- \definesymbol[LeftOneEighthBlock][\USymbChar{37}{143}] % LEFT ONE EIGHTH BLOCK
- \definesymbol[RightHalfBlock][\USymbChar{37}{144}] % RIGHT HALF BLOCK
- \definesymbol[UpperOneEighthBlock][\USymbChar{37}{148}] % UPPER ONE EIGHTH BLOCK
- \definesymbol[RightOneEighthBlock][\USymbChar{37}{149}] % RIGHT ONE EIGHTH BLOCK
-
-\stopsymbolset
-
-\startsymbolset[Unicode Shade Characters] % 0x2580: Requires UnicodeRegular25
-
- \definesymbol[LightShade][\USymbChar{37}{145}] % LIGHT SHADE
- \definesymbol[MediumShade][\USymbChar{37}{146}] % MEDIUM SHADE
- \definesymbol[DarkShade][\USymbChar{37}{147}] % DARK SHADE
-
-\stopsymbolset
-
-\startsymbolset[Unicode Terminal Graphics] % 0x2580: Requires UnicodeRegular25
-
- \definesymbol[QuadrantLowerLeft][\USymbChar{37}{150}] % [Unassigned U+2596]
- \definesymbol[QuadrantLowerRight][\USymbChar{37}{151}] % [Unassigned U+2597]
- \definesymbol[QuadrantUpperLeft][\USymbChar{37}{152}] % [Unassigned U+2598]
- \definesymbol[QuadrantUpperLeftAndLowerLeftAndLowerRight][\USymbChar{37}{153}] % [Unassigned U+2599]
- \definesymbol[QuadrantUpperLeftAndLowerRight][\USymbChar{37}{154}] % [Unassigned U+259A]
- \definesymbol[QuadrantUpperLeftAndUpperRightandLowerLeft][\USymbChar{37}{155}] % [Unassigned U+259B]
- \definesymbol[QuadrantUpperLeftAndUpperRightAndLowerRight][\USymbChar{37}{156}] % [Unassigned U+259C]
- \definesymbol[QuadrantUpperRight][\USymbChar{37}{157}] % [Unassigned U+259D]
- \definesymbol[QuadrantUpperRightAndLowerLeft][\USymbChar{37}{158}] % [Unassigned U+259E]
- \definesymbol[QuadrantUpperRightAndLowerLeftAndLowerRight][\USymbChar{37}{159}] % [Unassigned U+259F]
-
-\stopsymbolset
-
-\startsymbolset[Unicode Geometric Shapes] % 0x25A0: Requires UnicodeRegular25
-
- \definesymbol[BlackSquare][\USymbChar{37}{160}] % BLACK SQUARE
- \definesymbol[WhiteSquare][\USymbChar{37}{161}] % WHITE SQUARE
- \definesymbol[WhiteSquareWithRoundedCorners][\USymbChar{37}{162}] % WHITE SQUARE WITH ROUNDED CORNERS
- \definesymbol[WhiteSquareContainingBlackSmallSquare][\USymbChar{37}{163}] % WHITE SQUARE CONTAINING BLACK SMALL SQUARE
- \definesymbol[SquareWithHorizontalFill][\USymbChar{37}{164}] % SQUARE WITH HORIZONTAL FILL
- \definesymbol[SquareWithVerticalFill][\USymbChar{37}{165}] % SQUARE WITH VERTICAL FILL
- \definesymbol[SquareWithOrthogonalCrosshatchFill][\USymbChar{37}{166}] % SQUARE WITH ORTHOGONAL CROSSHATCH FILL
- \definesymbol[SquareWithUpperLeftToLowerRightFill][\USymbChar{37}{167}] % SQUARE WITH UPPER LEFT TO LOWER RIGHT FILL
- \definesymbol[SquareWithUpperRightToLowerLeftFill][\USymbChar{37}{168}] % SQUARE WITH UPPER RIGHT TO LOWER LEFT FILL
- \definesymbol[SquareWithDiagonalCrosshatchFill][\USymbChar{37}{169}] % SQUARE WITH DIAGONAL CROSSHATCH FILL
- \definesymbol[BlackSmallSquare][\USymbChar{37}{170}] % BLACK SMALL SQUARE
- \definesymbol[WhiteSmallSquare][\USymbChar{37}{171}] % WHITE SMALL SQUARE
- \definesymbol[BlackRectangle][\USymbChar{37}{172}] % BLACK RECTANGLE
- \definesymbol[WhiteRectangle][\USymbChar{37}{173}] % WHITE RECTANGLE
- \definesymbol[BlackVerticalRectangle][\USymbChar{37}{174}] % BLACK VERTICAL RECTANGLE
- \definesymbol[WhiteVerticalRectangle][\USymbChar{37}{175}] % WHITE VERTICAL RECTANGLE
- \definesymbol[BlackParallelogram][\USymbChar{37}{176}] % BLACK PARALLELOGRAM
- \definesymbol[WhiteParallelogram][\USymbChar{37}{177}] % WHITE PARALLELOGRAM
- \definesymbol[BlackUpPointingTriangle][\USymbChar{37}{178}] % BLACK UP-POINTING TRIANGLE
- \definesymbol[WhiteUpPointingTriangle][\USymbChar{37}{179}] % WHITE UP-POINTING TRIANGLE
- \definesymbol[BlackUpPointingSmallTriangle][\USymbChar{37}{180}] % BLACK UP-POINTING SMALL TRIANGLE
- \definesymbol[WhiteUpPointingSmallTriangle][\USymbChar{37}{181}] % WHITE UP-POINTING SMALL TRIANGLE
- \definesymbol[BlackRightPointingTriangle][\USymbChar{37}{182}] % BLACK RIGHT-POINTING TRIANGLE
- \definesymbol[WhiteRightPointingTriangle][\USymbChar{37}{183}] % WHITE RIGHT-POINTING TRIANGLE
- \definesymbol[BlackRightPointingSmallTriangle][\USymbChar{37}{184}] % BLACK RIGHT-POINTING SMALL TRIANGLE
- \definesymbol[WhiteRightPointingSmallTriangle][\USymbChar{37}{185}] % WHITE RIGHT-POINTING SMALL TRIANGLE
- \definesymbol[BlackRightPointingPointer][\USymbChar{37}{186}] % BLACK RIGHT-POINTING POINTER
- \definesymbol[WhiteRightPointingPointer][\USymbChar{37}{187}] % WHITE RIGHT-POINTING POINTER
- \definesymbol[BlackDownPointingTriangle][\USymbChar{37}{188}] % BLACK DOWN-POINTING TRIANGLE
- \definesymbol[WhiteDownPointingTriangle][\USymbChar{37}{189}] % WHITE DOWN-POINTING TRIANGLE
- \definesymbol[BlackDownPointingSmallTriangle][\USymbChar{37}{190}] % BLACK DOWN-POINTING SMALL TRIANGLE
- \definesymbol[WhiteDownPointingSmallTriangle][\USymbChar{37}{191}] % WHITE DOWN-POINTING SMALL TRIANGLE
- \definesymbol[BlackLeftPointingTriangle][\USymbChar{37}{192}] % BLACK LEFT-POINTING TRIANGLE
- \definesymbol[WhiteLeftPointingTriangle][\USymbChar{37}{193}] % WHITE LEFT-POINTING TRIANGLE
- \definesymbol[BlackLeftPointingSmallTriangle][\USymbChar{37}{194}] % BLACK LEFT-POINTING SMALL TRIANGLE
- \definesymbol[WhiteLeftPointingSmallTriangle][\USymbChar{37}{195}] % WHITE LEFT-POINTING SMALL TRIANGLE
- \definesymbol[BlackLeftPointingPointer][\USymbChar{37}{196}] % BLACK LEFT-POINTING POINTER
- \definesymbol[WhiteLeftPointingPointer][\USymbChar{37}{197}] % WHITE LEFT-POINTING POINTER
- \definesymbol[BlackDiamond][\USymbChar{37}{198}] % BLACK DIAMOND
- \definesymbol[WhiteDiamond][\USymbChar{37}{199}] % WHITE DIAMOND
- \definesymbol[WhiteDiamondContainingBlackSmallDiamond][\USymbChar{37}{200}] % WHITE DIAMOND CONTAINING BLACK SMALL DIAMOND
- \definesymbol[Fisheye][\USymbChar{37}{201}] % FISHEYE
- \definesymbol[Lozenge][\USymbChar{37}{202}] % LOZENGE
- \definesymbol[WhiteCircle][\USymbChar{37}{203}] % WHITE CIRCLE
- \definesymbol[DottedCircle][\USymbChar{37}{204}] % DOTTED CIRCLE
- \definesymbol[CircleWithVerticalFill][\USymbChar{37}{205}] % CIRCLE WITH VERTICAL FILL
- \definesymbol[Bullseye][\USymbChar{37}{206}] % BULLSEYE
- \definesymbol[BlackCircle][\USymbChar{37}{207}] % BLACK CIRCLE
- \definesymbol[CircleWithLeftHalfBlack][\USymbChar{37}{208}] % CIRCLE WITH LEFT HALF BLACK
- \definesymbol[CircleWithRightHalfBlack][\USymbChar{37}{209}] % CIRCLE WITH RIGHT HALF BLACK
- \definesymbol[CircleWithLowerHalfBlack][\USymbChar{37}{210}] % CIRCLE WITH LOWER HALF BLACK
- \definesymbol[CircleWithUpperHalfBlack][\USymbChar{37}{211}] % CIRCLE WITH UPPER HALF BLACK
- \definesymbol[CircleWithUpperRightQuadrantBlack][\USymbChar{37}{212}] % CIRCLE WITH UPPER RIGHT QUADRANT BLACK
- \definesymbol[CircleWithAllButUpperLeftQuadrantBlack][\USymbChar{37}{213}] % CIRCLE WITH ALL BUT UPPER LEFT QUADRANT BLACK
- \definesymbol[LeftHalfBlackCircle][\USymbChar{37}{214}] % LEFT HALF BLACK CIRCLE
- \definesymbol[RightHalfBlackCircle][\USymbChar{37}{215}] % RIGHT HALF BLACK CIRCLE
- \definesymbol[InverseBullet][\USymbChar{37}{216}] % INVERSE BULLET
- \definesymbol[InverseWhiteCircle][\USymbChar{37}{217}] % INVERSE WHITE CIRCLE
- \definesymbol[UpperHalfInverseWhiteCircle][\USymbChar{37}{218}] % UPPER HALF INVERSE WHITE CIRCLE
- \definesymbol[LowerHalfInverseWhiteCircle][\USymbChar{37}{219}] % LOWER HALF INVERSE WHITE CIRCLE
- \definesymbol[UpperLeftQuadrantCircularArc][\USymbChar{37}{220}] % UPPER LEFT QUADRANT CIRCULAR ARC
- \definesymbol[UpperRightQuadrantCircularArc][\USymbChar{37}{221}] % UPPER RIGHT QUADRANT CIRCULAR ARC
- \definesymbol[LowerRightQuadrantCircularArc][\USymbChar{37}{222}] % LOWER RIGHT QUADRANT CIRCULAR ARC
- \definesymbol[LowerLeftQuadrantCircularArc][\USymbChar{37}{223}] % LOWER LEFT QUADRANT CIRCULAR ARC
- \definesymbol[LowerHalfCircle][\USymbChar{37}{225}] % LOWER HALF CIRCLE
- \definesymbol[BlackLowerRightTriangle][\USymbChar{37}{226}] % BLACK LOWER RIGHT TRIANGLE
- \definesymbol[BlackLowerLeftTriangle][\USymbChar{37}{227}] % BLACK LOWER LEFT TRIANGLE
- \definesymbol[BlackUpperLeftTriangle][\USymbChar{37}{228}] % BLACK UPPER LEFT TRIANGLE
- \definesymbol[BlackUpperRightTriangle][\USymbChar{37}{229}] % BLACK UPPER RIGHT TRIANGLE
- \definesymbol[WhiteBullet][\USymbChar{37}{230}] % WHITE BULLET
- \definesymbol[SquareWithLeftHalfBlack][\USymbChar{37}{231}] % SQUARE WITH LEFT HALF BLACK
- \definesymbol[SquareWithRightHalfBlack][\USymbChar{37}{232}] % SQUARE WITH RIGHT HALF BLACK
- \definesymbol[SquareWithUpperLeftDiagonalHalfBlack][\USymbChar{37}{233}] % SQUARE WITH UPPER LEFT DIAGONAL HALF BLACK
- \definesymbol[SquareWithLowerRightDiagonalHalfBlack][\USymbChar{37}{234}] % SQUARE WITH LOWER RIGHT DIAGONAL HALF BLACK
- \definesymbol[WhiteSquareWithVerticalBisectingLine][\USymbChar{37}{235}] % WHITE SQUARE WITH VERTICAL BISECTING LINE
- \definesymbol[WhiteUpPointingTriangleWithDot][\USymbChar{37}{236}] % WHITE UP-POINTING TRIANGLE WITH DOT
- \definesymbol[UpPointingTriangleWithLeftHalfBlack][\USymbChar{37}{237}] % UP-POINTING TRIANGLE WITH LEFT HALF BLACK
- \definesymbol[UpPointingTriangleWithRightHalfBlack][\USymbChar{37}{238}] % UP-POINTING TRIANGLE WITH RIGHT HALF BLACK
- \definesymbol[LargeCircle][\USymbChar{37}{239}] % LARGE CIRCLE
- \definesymbol[UpperLeftTriangle][\USymbChar{37}{248}] % [Unassigned U+25F8]
- \definesymbol[UpperRightTriangle][\USymbChar{37}{249}] % [Unassigned U+25F9]
- \definesymbol[LowerLeftTriangle][\USymbChar{37}{250}] % [Unassigned U+25FA]
- \definesymbol[WhiteMediumSquare][\USymbChar{37}{251}] % [Unassigned U+25FB]
- \definesymbol[BlackMediumSquare][\USymbChar{37}{252}] % [Unassigned U+25FC]
- \definesymbol[WhiteMediumSmallSquare][\USymbChar{37}{253}] % [Unassigned U+25FD]
- \definesymbol[BlackMediumSmallSquare][\USymbChar{37}{254}] % [Unassigned U+25FE]
- \definesymbol[LowerRightTriangle][\USymbChar{37}{255}] % [Unassigned U+25FF]
-
-\stopsymbolset
-
-\startsymbolset[Unicode Control Code Graphics] % 0x25A0: Requires UnicodeRegular25
-
- \definesymbol[WhiteSquareWithUpperLeftQuadrant][\USymbChar{37}{240}] % WHITE SQUARE WITH UPPER LEFT QUADRANT
- \definesymbol[WhiteSquareWithLowerLeftQuadrant][\USymbChar{37}{241}] % WHITE SQUARE WITH LOWER LEFT QUADRANT
- \definesymbol[WhiteSquareWithLowerRightQuadrant][\USymbChar{37}{242}] % WHITE SQUARE WITH LOWER RIGHT QUADRANT
- \definesymbol[WhiteSquareWithUpperRightQuadrant][\USymbChar{37}{243}] % WHITE SQUARE WITH UPPER RIGHT QUADRANT
- \definesymbol[WhiteCircleWithUpperLeftQuadrant][\USymbChar{37}{244}] % WHITE CIRCLE WITH UPPER LEFT QUADRANT
- \definesymbol[WhiteCircleWithLowerLeftQuadrant][\USymbChar{37}{245}] % WHITE CIRCLE WITH LOWER LEFT QUADRANT
- \definesymbol[WhiteCircleWithLowerRightQuadrant][\USymbChar{37}{246}] % WHITE CIRCLE WITH LOWER RIGHT QUADRANT
- \definesymbol[WhiteCircleWithUpperRightQuadrant][\USymbChar{37}{247}] % WHITE CIRCLE WITH UPPER RIGHT QUADRANT
-
-\stopsymbolset
-
-\startsymbolset[Unicode Weather and Astrological] % 0x2600: Requires UnicodeRegular26
-
- \definesymbol[BlackSunWithRays][\USymbChar{38}{0}] % BLACK SUN WITH RAYS
- \definesymbol[Cloud][\USymbChar{38}{1}] % CLOUD
- \definesymbol[Umbrella][\USymbChar{38}{2}] % UMBRELLA
- \definesymbol[Snowman][\USymbChar{38}{3}] % SNOWMAN
- \definesymbol[Comet][\USymbChar{38}{4}] % COMET
- \definesymbol[BlackStar][\USymbChar{38}{5}] % BLACK STAR
- \definesymbol[WhiteStar][\USymbChar{38}{6}] % WHITE STAR
- \definesymbol[Lightning][\USymbChar{38}{7}] % LIGHTNING
- \definesymbol[Thunderstorm][\USymbChar{38}{8}] % THUNDERSTORM
- \definesymbol[Sun][\USymbChar{38}{9}] % SUN
- \definesymbol[AscendingNode][\USymbChar{38}{10}] % ASCENDING NODE
- \definesymbol[DescendingNode][\USymbChar{38}{11}] % DESCENDING NODE
- \definesymbol[Conjunction][\USymbChar{38}{12}] % CONJUNCTION
- \definesymbol[Opposition][\USymbChar{38}{13}] % OPPOSITION
- \definesymbol[FirstQuarterMoon][\USymbChar{38}{61}] % FIRST QUARTER MOON
- \definesymbol[LastQuarterMoon][\USymbChar{38}{62}] % LAST QUARTER MOON
- \definesymbol[Mercury][\USymbChar{38}{63}] % MERCURY
- \definesymbol[FemaleSign][\USymbChar{38}{64}] % FEMALE SIGN
- \definesymbol[Earth][\USymbChar{38}{65}] % EARTH
- \definesymbol[MaleSign][\USymbChar{38}{66}] % MALE SIGN
- \definesymbol[Jupiter][\USymbChar{38}{67}] % JUPITER
- \definesymbol[Saturn][\USymbChar{38}{68}] % SATURN
- \definesymbol[Uranus][\USymbChar{38}{69}] % URANUS
- \definesymbol[Neptune][\USymbChar{38}{70}] % NEPTUNE
- \definesymbol[Pluto][\USymbChar{38}{71}] % PLUTO
-
-\stopsymbolset
-
-\startsymbolset[Unicode Miscellaneous] % 0x2600: Requires UnicodeRegular26
-
- \definesymbol[BlackTelephone][\USymbChar{38}{14}] % BLACK TELEPHONE
- \definesymbol[WhiteTelephone][\USymbChar{38}{15}] % WHITE TELEPHONE
- \definesymbol[BallotBox][\USymbChar{38}{16}] % BALLOT BOX
- \definesymbol[BallotBoxWithCheck][\USymbChar{38}{17}] % BALLOT BOX WITH CHECK
- \definesymbol[BallotBoxWithX][\USymbChar{38}{18}] % BALLOT BOX WITH X
- \definesymbol[Saltire][\USymbChar{38}{19}] % SALTIRE
- \definesymbol[ReversedRotatedFloralHeartBullet][\USymbChar{38}{25}] % REVERSED ROTATED FLORAL HEART BULLET
- \definesymbol[WheelOfDharma][\USymbChar{38}{56}] % WHEEL OF DHARMA
- \definesymbol[WhiteFrowningFace][\USymbChar{38}{57}] % WHITE FROWNING FACE
- \definesymbol[WhiteSmilingFace][\USymbChar{38}{58}] % WHITE SMILING FACE
- \definesymbol[BlackSmilingFace][\USymbChar{38}{59}] % BLACK SMILING FACE
- \definesymbol[WhiteSunWithRays][\USymbChar{38}{60}] % WHITE SUN WITH RAYS
- \definesymbol[HotSprings][\USymbChar{38}{104}] % HOT SPRINGS
-
-\stopsymbolset
-
-\startsymbolset[Unicode Japanese Chess] % 0x2600: Requires UnicodeRegular26
-
- \definesymbol[WhiteShogiPiece][\USymbChar{38}{22}] % [Unassigned U+2616]
- \definesymbol[BlackShogiPiece][\USymbChar{38}{23}] % [Unassigned U+2617]
-
-\stopsymbolset
-
-\startsymbolset[Unicode Pointing Hand] % 0x2600: Requires UnicodeRegular26
-
- \definesymbol[BlackLeftPointingIndex][\USymbChar{38}{26}] % BLACK LEFT POINTING INDEX
- \definesymbol[BlackRightPointingIndex][\USymbChar{38}{27}] % BLACK RIGHT POINTING INDEX
- \definesymbol[WhiteLeftPointingIndex][\USymbChar{38}{28}] % WHITE LEFT POINTING INDEX
- \definesymbol[WhiteUpPointingIndex][\USymbChar{38}{29}] % WHITE UP POINTING INDEX
- \definesymbol[WhiteRightPointingIndex][\USymbChar{38}{30}] % WHITE RIGHT POINTING INDEX
- \definesymbol[WhiteDownPointingIndex][\USymbChar{38}{31}] % WHITE DOWN POINTING INDEX
-
-\stopsymbolset
-
-\startsymbolset[Unicode Warning Signs] % 0x2600: Requires UnicodeRegular26
-
- \definesymbol[SkullAndCrossbones][\USymbChar{38}{32}] % SKULL AND CROSSBONES
- \definesymbol[CautionSign][\USymbChar{38}{33}] % CAUTION SIGN
- \definesymbol[RadioactiveSign][\USymbChar{38}{34}] % RADIOACTIVE SIGN
- \definesymbol[BiohazardSign][\USymbChar{38}{35}] % BIOHAZARD SIGN
-
-\stopsymbolset
-
-\startsymbolset[Unicode Healing Signs] % 0x2600: Requires UnicodeRegular26
- \definesymbol[Caduceus][\USymbChar{38}{36}] % CADUCEUS
- \definesymbol[Ankh][\USymbChar{38}{37}] % ANKH
-\stopsymbolset
-
-\startsymbolset[Unicode Religious and Political] % 0x2600: Requires UnicodeRegular26 and 27
-
- \definesymbol[OrthodoxCross][\USymbChar{38}{38}] % ORTHODOX CROSS
- \definesymbol[ChiRho][\USymbChar{38}{39}] % CHI RHO
- \definesymbol[CrossOfLorraine][\USymbChar{38}{40}] % CROSS OF LORRAINE
- \definesymbol[CrossOfJerusalem][\USymbChar{38}{41}] % CROSS OF JERUSALEM
- \definesymbol[StarAndCrescent][\USymbChar{38}{42}] % STAR AND CRESCENT
- \definesymbol[FarsiSymbol][\USymbChar{38}{43}] % FARSI SYMBOL
- \definesymbol[AdiShakti][\USymbChar{38}{44}] % ADI SHAKTI
- \definesymbol[HammerAndSickle][\USymbChar{38}{45}] % HAMMER AND SICKLE
- \definesymbol[PeaceSymbol][\USymbChar{38}{46}] % PEACE SYMBOL
- \definesymbol[YinYang][\USymbChar{38}{47}] % YIN YANG
- \definesymbol[WestSyriacCross][\USymbChar{38}{112}] % WEST SYRIAC CROSS
- \definesymbol[EastSyriacCross][\USymbChar{38}{113}] % EAST SYRIAC CROSS
-% 27xx starts here
- \definesymbol[OutlinedGreekCross][\USymbCharZapf{39}{25}] % OUTLINED GREEK CROSS
- \definesymbol[HeavyGreekCross][\USymbCharZapf{39}{26}] % HEAVY GREEK CROSS
- \definesymbol[OpenCentreCross][\USymbCharZapf{39}{27}] % OPEN CENTRE CROSS
- \definesymbol[HeavyOpenCentreCross][\USymbCharZapf{39}{28}] % HEAVY OPEN CENTRE CROSS
- \definesymbol[LatinCross][\USymbCharZapf{39}{29}] % LATIN CROSS
- \definesymbol[ShadowedWhiteLatinCross][\USymbCharZapf{39}{30}] % SHADOWED WHITE LATIN CROSS
- \definesymbol[OutlinedLatinCross][\USymbCharZapf{39}{31}] % OUTLINED LATIN CROSS
- \definesymbol[MalteseCross][\USymbCharZapf{39}{32}] % MALTESE CROSS
- \definesymbol[StarOfDavid][\USymbCharZapf{39}{33}] % STAR OF DAVID
-
-
-\stopsymbolset
-
-\startsymbolset[Unicode Trigram] % 0x2600: Requires UnicodeRegular26
-
- \definesymbol[TrigramForHeaven][\USymbChar{38}{48}] % TRIGRAM FOR HEAVEN
- \definesymbol[TrigramForLake][\USymbChar{38}{49}] % TRIGRAM FOR LAKE
- \definesymbol[TrigramForFire][\USymbChar{38}{50}] % TRIGRAM FOR FIRE
- \definesymbol[TrigramForThunder][\USymbChar{38}{51}] % TRIGRAM FOR THUNDER
- \definesymbol[TrigramForWind][\USymbChar{38}{52}] % TRIGRAM FOR WIND
- \definesymbol[TrigramForWater][\USymbChar{38}{53}] % TRIGRAM FOR WATER
- \definesymbol[TrigramForMountain][\USymbChar{38}{54}] % TRIGRAM FOR MOUNTAIN
- \definesymbol[TrigramForEarth][\USymbChar{38}{55}] % TRIGRAM FOR EARTH
-
-\stopsymbolset
-
-\startsymbolset[Unicode Zodiac] % 0x2600: Requires UnicodeRegular26
-
- \definesymbol[Aries][\USymbChar{38}{72}] % ARIES
- \definesymbol[Taurus][\USymbChar{38}{73}] % TAURUS
- \definesymbol[Gemini][\USymbChar{38}{74}] % GEMINI
- \definesymbol[Cancer][\USymbChar{38}{75}] % CANCER
- \definesymbol[Leo][\USymbChar{38}{76}] % LEO
- \definesymbol[Virgo][\USymbChar{38}{77}] % VIRGO
- \definesymbol[Libra][\USymbChar{38}{78}] % LIBRA
- \definesymbol[Scorpius][\USymbChar{38}{79}] % SCORPIUS
- \definesymbol[Sagittarius][\USymbChar{38}{80}] % SAGITTARIUS
- \definesymbol[Capricorn][\USymbChar{38}{81}] % CAPRICORN
- \definesymbol[Aquarius][\USymbChar{38}{82}] % AQUARIUS
- \definesymbol[Pisces][\USymbChar{38}{83}] % PISCES
-
-\stopsymbolset
-
-\startsymbolset[Unicode Chess] % 0x2600: Requires UnicodeRegular26
-
- \definesymbol[WhiteChessKing][\USymbChar{38}{84}] % WHITE CHESS KING
- \definesymbol[WhiteChessQueen][\USymbChar{38}{85}] % WHITE CHESS QUEEN
- \definesymbol[WhiteChessRook][\USymbChar{38}{86}] % WHITE CHESS ROOK
- \definesymbol[WhiteChessBishop][\USymbChar{38}{87}] % WHITE CHESS BISHOP
- \definesymbol[WhiteChessKnight][\USymbChar{38}{88}] % WHITE CHESS KNIGHT
- \definesymbol[WhiteChessPawn][\USymbChar{38}{89}] % WHITE CHESS PAWN
- \definesymbol[BlackChessKing][\USymbChar{38}{90}] % BLACK CHESS KING
- \definesymbol[BlackChessQueen][\USymbChar{38}{91}] % BLACK CHESS QUEEN
- \definesymbol[BlackChessRook][\USymbChar{38}{92}] % BLACK CHESS ROOK
- \definesymbol[BlackChessBishop][\USymbChar{38}{93}] % BLACK CHESS BISHOP
- \definesymbol[BlackChessKnight][\USymbChar{38}{94}] % BLACK CHESS KNIGHT
- \definesymbol[BlackChessPawn][\USymbChar{38}{95}] % BLACK CHESS PAWN
-
-\stopsymbolset
-
-\startsymbolset[Unicode Playing Card] % 0x2600: Requires UnicodeRegular26
-
- \definesymbol[BlackSpadeSuit][\USymbChar{38}{96}] % BLACK SPADE SUIT
- \definesymbol[WhiteHeartSuit][\USymbChar{38}{97}] % WHITE HEART SUIT
- \definesymbol[WhiteDiamondSuit][\USymbChar{38}{98}] % WHITE DIAMOND SUIT
- \definesymbol[BlackClubSuit][\USymbChar{38}{99}] % BLACK CLUB SUIT
- \definesymbol[WhiteSpadeSuit][\USymbChar{38}{100}] % WHITE SPADE SUIT
- \definesymbol[BlackHeartSuit][\USymbChar{38}{101}] % BLACK HEART SUIT
- \definesymbol[BlackDiamondSuit][\USymbChar{38}{102}] % BLACK DIAMOND SUIT
- \definesymbol[WhiteClubSuit][\USymbChar{38}{103}] % WHITE CLUB SUIT
-
-\stopsymbolset
-
-\startsymbolset[Unicode Musical] % 0x2600: Requires UnicodeRegular26
-
- \definesymbol[QuarterNote][\USymbChar{38}{105}] % QUARTER NOTE
- \definesymbol[EighthNote][\USymbChar{38}{106}] % EIGHTH NOTE
- \definesymbol[BeamedEighthNotes][\USymbChar{38}{107}] % BEAMED EIGHTH NOTES
- \definesymbol[BeamedSixteenthNotes][\USymbChar{38}{108}] % BEAMED SIXTEENTH NOTES
- \definesymbol[MusicFlatSign][\USymbChar{38}{109}] % MUSIC FLAT SIGN
- \definesymbol[MusicNaturalSign][\USymbChar{38}{110}] % MUSIC NATURAL SIGN
- \definesymbol[MusicSharpSign][\USymbChar{38}{111}] % MUSIC SHARP SIGN
-
-\stopsymbolset
-
-\startsymbolset[Unicode Recycling] % 0x2600: Requires UnicodeRegular26
-
- \definesymbol[UniversalRecycling][\USymbChar{38}{114}] % [Unassigned U+2672]
- \definesymbol[Type1Plastics][\USymbChar{38}{115}] % [Unassigned U+2673]
- \definesymbol[Type2Plastics][\USymbChar{38}{116}] % [Unassigned U+2674]
- \definesymbol[Type3Plastics][\USymbChar{38}{117}] % [Unassigned U+2675]
- \definesymbol[Type4Plastics][\USymbChar{38}{118}] % [Unassigned U+2676]
- \definesymbol[Type5Plastics][\USymbChar{38}{119}] % [Unassigned U+2677]
- \definesymbol[Type6Plastics][\USymbChar{38}{120}] % [Unassigned U+2678]
- \definesymbol[Type7Plastics][\USymbChar{38}{121}] % [Unassigned U+2679]
- \definesymbol[GenericMaterials][\USymbChar{38}{122}] % [Unassigned U+267A]
- \definesymbol[BlackUniversalRecycling][\USymbChar{38}{123}] % [Unassigned U+267B]
- \definesymbol[RecycledPaper][\USymbChar{38}{124}] % [Unassigned U+267C]
- \definesymbol[PartiallyRecycledPaper][\USymbChar{38}{125}] % [Unassigned U+267D]
-
-\stopsymbolset
-
-\startsymbolset[Unicode Dice] % 0x2600: Requires UnicodeRegular26
-
- \definesymbol[DieFace1][\USymbChar{38}{128}] % [Unassigned U+2680]
- \definesymbol[DieFace2][\USymbChar{38}{129}] % [Unassigned U+2681]
- \definesymbol[DieFace3][\USymbChar{38}{130}] % [Unassigned U+2682]
- \definesymbol[DieFace4][\USymbChar{38}{131}] % [Unassigned U+2683]
- \definesymbol[DieFace5][\USymbChar{38}{132}] % [Unassigned U+2684]
- \definesymbol[DieFace6][\USymbChar{38}{133}] % [Unassigned U+2685]
-
-\stopsymbolset
-
-\startsymbolset[Unicode Go Markers] % 0x2600: Requires UnicodeRegular26
-
- \definesymbol[WhiteCircleWithDotRight][\USymbChar{38}{134}] % [Unassigned U+2686]
- \definesymbol[WhiteCircleWithTwoDots][\USymbChar{38}{135}] % [Unassigned U+2687]
- \definesymbol[BlackCircleWithWhiteDotRight][\USymbChar{38}{136}] % [Unassigned U+2688]
- \definesymbol[BlackCircleWithTwoWhiteDots][\USymbChar{38}{137}] % [Unassigned U+2689]
-
-\stopsymbolset
-
-\startsymbolset[Unicode Scissors] % 0x2700: Requires UnicodeRegular27
-
- \definesymbol[UpperBladeScissors][\USymbCharZapf{39}{1}] % UPPER BLADE SCISSORS
- \definesymbol[BlackScissors][\USymbCharZapf{39}{2}] % BLACK SCISSORS
- \definesymbol[LowerBladeScissors][\USymbCharZapf{39}{3}] % LOWER BLADE SCISSORS
- \definesymbol[WhiteScissors][\USymbCharZapf{39}{4}] % WHITE SCISSORS
-
-\stopsymbolset
-
-\startsymbolset[Unicode Dingbats] % 0x2700: Requires UnicodeRegular27
-
- \definesymbol[TelephoneLocationSign][\USymbCharZapf{39}{6}] % TELEPHONE LOCATION SIGN
- \definesymbol[TapeDrive][\USymbCharZapf{39}{7}] % TAPE DRIVE
- \definesymbol[Airplane][\USymbCharZapf{39}{8}] % AIRPLANE
- \definesymbol[Envelope][\USymbCharZapf{39}{9}] % ENVELOPE
- \definesymbol[VictoryHand][\USymbCharZapf{39}{12}] % VICTORY HAND
- \definesymbol[WritingHand][\USymbCharZapf{39}{13}] % WRITING HAND
- \definesymbol[LowerRightPencil][\USymbCharZapf{39}{14}] % LOWER RIGHT PENCIL
- \definesymbol[Pencil][\USymbCharZapf{39}{15}] % PENCIL
- \definesymbol[UpperRightPencil][\USymbCharZapf{39}{16}] % UPPER RIGHT PENCIL
- \definesymbol[WhiteNib][\USymbCharZapf{39}{17}] % WHITE NIB
- \definesymbol[BlackNib][\USymbCharZapf{39}{18}] % BLACK NIB
- \definesymbol[BlackDiamondMinusWhiteX][\USymbCharZapf{39}{86}] % BLACK DIAMOND MINUS WHITE X
-
-\stopsymbolset
-
-\startsymbolset[Unicode Checks and Xs] % 0x2700: Requires UnicodeRegular27
-
- \definesymbol[CheckMark][\USymbCharZapf{39}{19}] % CHECK MARK
- \definesymbol[HeavyCheckMark][\USymbCharZapf{39}{20}] % HEAVY CHECK MARK
- \definesymbol[MultiplicationX][\USymbCharZapf{39}{21}] % MULTIPLICATION X
- \definesymbol[HeavyMultiplicationX][\USymbCharZapf{39}{22}] % HEAVY MULTIPLICATION X
- \definesymbol[BallotX][\USymbCharZapf{39}{23}] % BALLOT X
- \definesymbol[HeavyBallotX][\USymbCharZapf{39}{24}] % HEAVY BALLOT X
-
-\stopsymbolset
-
-\startsymbolset[Unicode Stars] % 0x2700: Requires UnicodeRegular27
-
- \definesymbol[FourTeardropSpokedAsterisk][\USymbCharZapf{39}{34}] % FOUR TEARDROP-SPOKED ASTERISK
- \definesymbol[FourBalloonSpokedAsterisk][\USymbCharZapf{39}{35}] % FOUR BALLOON-SPOKED ASTERISK
- \definesymbol[HeavyFourBalloonSpokedAsterisk][\USymbCharZapf{39}{36}] % HEAVY FOUR BALLOON-SPOKED ASTERISK
- \definesymbol[FourClubSpokedAsterisk][\USymbCharZapf{39}{37}] % FOUR CLUB-SPOKED ASTERISK
- \definesymbol[BlackFourPointedStar][\USymbCharZapf{39}{38}] % BLACK FOUR POINTED STAR
- \definesymbol[WhiteFourPointedStar][\USymbCharZapf{39}{39}] % WHITE FOUR POINTED STAR
- \definesymbol[StressOutlinedWhiteStar][\USymbCharZapf{39}{41}] % STRESS OUTLINED WHITE STAR
- \definesymbol[CircledWhiteStar][\USymbCharZapf{39}{42}] % CIRCLED WHITE STAR
- \definesymbol[OpenCentreBlackStar][\USymbCharZapf{39}{43}] % OPEN CENTRE BLACK STAR
- \definesymbol[BlackCentreWhiteStar][\USymbCharZapf{39}{44}] % BLACK CENTRE WHITE STAR
- \definesymbol[OutlinedBlackStar][\USymbCharZapf{39}{45}] % OUTLINED BLACK STAR
- \definesymbol[HeavyOutlinedBlackStar][\USymbCharZapf{39}{46}] % HEAVY OUTLINED BLACK STAR
- \definesymbol[PinwheelStar][\USymbCharZapf{39}{47}] % PINWHEEL STAR
- \definesymbol[ShadowedWhiteStar][\USymbCharZapf{39}{48}] % SHADOWED WHITE STAR
- \definesymbol[HeavyAsterisk][\USymbCharZapf{39}{49}] % HEAVY ASTERISK
- \definesymbol[OpenCentreAsterisk][\USymbCharZapf{39}{50}] % OPEN CENTRE ASTERISK
- \definesymbol[EightSpokedAsterisk][\USymbCharZapf{39}{51}] % EIGHT SPOKED ASTERISK
- \definesymbol[EightPointedBlackStar][\USymbCharZapf{39}{52}] % EIGHT POINTED BLACK STAR
- \definesymbol[EightPointedPinwheelStar][\USymbCharZapf{39}{53}] % EIGHT POINTED PINWHEEL STAR
- \definesymbol[SixPointedBlackStar][\USymbCharZapf{39}{54}] % SIX POINTED BLACK STAR
- \definesymbol[EightPointedRectilinearBlackStar][\USymbCharZapf{39}{55}] % EIGHT POINTED RECTILINEAR BLACK STAR
- \definesymbol[HeavyEightPointedRectilinearBlackStar][\USymbCharZapf{39}{56}] % HEAVY EIGHT POINTED RECTILINEAR BLACK STAR
- \definesymbol[TwelvePointedBlackStar][\USymbCharZapf{39}{57}] % TWELVE POINTED BLACK STAR
- \definesymbol[SixteenPointedAsterisk][\USymbCharZapf{39}{58}] % SIXTEEN POINTED ASTERISK
- \definesymbol[TeardropSpokedAsterisk][\USymbCharZapf{39}{59}] % TEARDROP-SPOKED ASTERISK
- \definesymbol[OpenCentreTeardropSpokedAsterisk][\USymbCharZapf{39}{60}] % OPEN CENTRE TEARDROP-SPOKED ASTERISK
- \definesymbol[HeavyTeardropSpokedAsterisk][\USymbCharZapf{39}{61}] % HEAVY TEARDROP-SPOKED ASTERISK
- \definesymbol[SixPetalledBlackAndWhiteFlorette][\USymbCharZapf{39}{62}] % SIX PETALLED BLACK AND WHITE FLORETTE
- \definesymbol[BlackFlorette][\USymbCharZapf{39}{63}] % BLACK FLORETTE
- \definesymbol[WhiteFlorette][\USymbCharZapf{39}{64}] % WHITE FLORETTE
- \definesymbol[EightPetalledOutlinedBlackFlorette][\USymbCharZapf{39}{65}] % EIGHT PETALLED OUTLINED BLACK FLORETTE
- \definesymbol[CircledOpenCentreEightPointedStar][\USymbCharZapf{39}{66}] % CIRCLED OPEN CENTRE EIGHT POINTED STAR
- \definesymbol[HeavyTeardropSpokedPinwheelAsterisk][\USymbCharZapf{39}{67}] % HEAVY TEARDROP-SPOKED PINWHEEL ASTERISK
- \definesymbol[Sparkle][\USymbCharZapf{39}{71}] % SPARKLE
- \definesymbol[HeavySparkle][\USymbCharZapf{39}{72}] % HEAVY SPARKLE
- \definesymbol[Balloon-spokedAsterisk][\USymbCharZapf{39}{73}] % BALLOON-SPOKED ASTERISK
- \definesymbol[EightTeardrop-spokedPropellerAsterisk][\USymbCharZapf{39}{74}] % EIGHT TEARDROP-SPOKED PROPELLER ASTERISK
- \definesymbol[HeavyEightTeardrop-spokedPropellerAsterisk][\USymbCharZapf{39}{75}] % HEAVY EIGHT TEARDROP-SPOKED PROPELLER ASTERISK
-
-\stopsymbolset
-
-\startsymbolset[Unicode Snowflakes] % 0x2700: Requires UnicodeRegular27
-
- \definesymbol[Snowflake][\USymbCharZapf{39}{68}] % SNOWFLAKE
- \definesymbol[TightTrifoliateSnowflake][\USymbCharZapf{39}{69}] % TIGHT TRIFOLIATE SNOWFLAKE
- \definesymbol[HeavyChevronSnowflake][\USymbCharZapf{39}{70}] % HEAVY CHEVRON SNOWFLAKE
-
-\stopsymbolset
-
-\startsymbolset[Unicode Shadowed Shapes] % 0x2700: Requires UnicodeRegular27
-
- \definesymbol[ShadowedWhiteCircle][\USymbCharZapf{39}{77}] % SHADOWED WHITE CIRCLE
- \definesymbol[LowerRightDrop-shadowedWhiteSquare][\USymbCharZapf{39}{79}] % LOWER RIGHT DROP-SHADOWED WHITE SQUARE
- \definesymbol[UpperRightDrop-shadowedWhiteSquare][\USymbCharZapf{39}{80}] % UPPER RIGHT DROP-SHADOWED WHITE SQUARE
- \definesymbol[LowerRightShadowedWhiteSquare][\USymbCharZapf{39}{81}] % LOWER RIGHT SHADOWED WHITE SQUARE
- \definesymbol[UpperRightShadowedWhiteSquare][\USymbCharZapf{39}{82}] % UPPER RIGHT SHADOWED WHITE SQUARE
-
-\stopsymbolset
-
-\startsymbolset[Unicode Bars] % 0x2700: Requires UnicodeRegular27
-
- \definesymbol[LightVerticalBar][\USymbCharZapf{39}{88}] % LIGHT VERTICAL BAR
- \definesymbol[MediumVerticalBar][\USymbCharZapf{39}{89}] % MEDIUM VERTICAL BAR
- \definesymbol[HeavyVerticalBar][\USymbCharZapf{39}{90}] % HEAVY VERTICAL BAR
-
-\stopsymbolset
-
-\startsymbolset[Unicode Dingbat Punctuation] % 0x2700: Requires UnicodeRegular27
-
- \definesymbol[HeavySingleTurnedCommaQuotationMark][\USymbCharZapf{39}{91}] % HEAVY SINGLE TURNED COMMA QUOTATION MARK ORNAMENT
- \definesymbol[HeavySingleCommaQuotationMark][\USymbCharZapf{39}{92}] % HEAVY SINGLE COMMA QUOTATION MARK ORNAMENT
- \definesymbol[HeavyDoubleTurnedCommaQuotationMark][\USymbCharZapf{39}{93}] % HEAVY DOUBLE TURNED COMMA QUOTATION MARK ORNAMENT
- \definesymbol[HeavyDoubleCommaQuotationMark][\USymbCharZapf{39}{94}] % HEAVY DOUBLE COMMA QUOTATION MARK ORNAMENT
- \definesymbol[CurvedStemParagraphSign][\USymbCharZapf{39}{97}] % CURVED STEM PARAGRAPH SIGN ORNAMENT
- \definesymbol[HeavyExclamationMark][\USymbCharZapf{39}{98}] % HEAVY EXCLAMATION MARK ORNAMENT
- \definesymbol[HeavyHeartExclamationMark][\USymbCharZapf{39}{99}] % HEAVY HEART EXCLAMATION MARK ORNAMENT
-
-\stopsymbolset
-
-\startsymbolset[Unicode Hearts] % 0x2700: Requires UnicodeRegular27
-
- \definesymbol[HeavyBlackHeart][\USymbCharZapf{39}{100}] % HEAVY BLACK HEART
- \definesymbol[RotatedHeavyBlackHeartBullet][\USymbCharZapf{39}{101}] % ROTATED HEAVY BLACK HEART BULLET
- \definesymbol[FloralHeart][\USymbCharZapf{39}{102}] % FLORAL HEART
- \definesymbol[RotatedFloralHeartBullet][\USymbCharZapf{39}{103}] % ROTATED FLORAL HEART BULLET
-
-\stopsymbolset
-
-\startsymbolset[Unicode Negative Circled Digits] % 0x2700: Requires UnicodeRegular27
-
- \definesymbol[CircledOne][\USymbCharZapf{39}{118}] % DINGBAT NEGATIVE CIRCLED DIGIT ONE
- \definesymbol[CircledTwo][\USymbCharZapf{39}{119}] % DINGBAT NEGATIVE CIRCLED DIGIT TWO
- \definesymbol[CircledThree][\USymbCharZapf{39}{120}] % DINGBAT NEGATIVE CIRCLED DIGIT THREE
- \definesymbol[CircledFour][\USymbCharZapf{39}{121}] % DINGBAT NEGATIVE CIRCLED DIGIT FOUR
- \definesymbol[CircledFive][\USymbCharZapf{39}{122}] % DINGBAT NEGATIVE CIRCLED DIGIT FIVE
- \definesymbol[CircledSix][\USymbCharZapf{39}{123}] % DINGBAT NEGATIVE CIRCLED DIGIT SIX
- \definesymbol[CircledSeven][\USymbCharZapf{39}{124}] % DINGBAT NEGATIVE CIRCLED DIGIT SEVEN
- \definesymbol[CircledEight][\USymbCharZapf{39}{125}] % DINGBAT NEGATIVE CIRCLED DIGIT EIGHT
- \definesymbol[CircledNine][\USymbCharZapf{39}{126}] % DINGBAT NEGATIVE CIRCLED DIGIT NINE
- \definesymbol[CircledTen][\USymbCharZapf{39}{127}] % DINGBAT NEGATIVE CIRCLED NUMBER TEN
-
-\stopsymbolset
-
-\startsymbolset[Unicode Circled Sans-serif Digits] % 0x2700: Requires UnicodeRegular27
-
- \definesymbol[CircledOne][\USymbCharZapf{39}{128}] % DINGBAT CIRCLED SANS-SERIF DIGIT ONE
- \definesymbol[CircledTwo][\USymbCharZapf{39}{129}] % DINGBAT CIRCLED SANS-SERIF DIGIT TWO
- \definesymbol[CircledThree][\USymbCharZapf{39}{130}] % DINGBAT CIRCLED SANS-SERIF DIGIT THREE
- \definesymbol[CircledFour][\USymbCharZapf{39}{131}] % DINGBAT CIRCLED SANS-SERIF DIGIT FOUR
- \definesymbol[CircledFive][\USymbCharZapf{39}{132}] % DINGBAT CIRCLED SANS-SERIF DIGIT FIVE
- \definesymbol[CircledSix][\USymbCharZapf{39}{133}] % DINGBAT CIRCLED SANS-SERIF DIGIT SIX
- \definesymbol[CircledSeven][\USymbCharZapf{39}{134}] % DINGBAT CIRCLED SANS-SERIF DIGIT SEVEN
- \definesymbol[CircledEight][\USymbCharZapf{39}{135}] % DINGBAT CIRCLED SANS-SERIF DIGIT EIGHT
- \definesymbol[CircledNine][\USymbCharZapf{39}{136}] % DINGBAT CIRCLED SANS-SERIF DIGIT NINE
- \definesymbol[CircledTen][\USymbCharZapf{39}{137}] % DINGBAT CIRCLED SANS-SERIF NUMBER TEN
-
-\stopsymbolset
-
-\startsymbolset[Unicode Negative Circled Sans-serif Digits] % 0x2700: Requires UnicodeRegular27
-
- \definesymbol[CircledOne][\USymbCharZapf{39}{138}] % DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT ONE
- \definesymbol[CircledTwo][\USymbCharZapf{39}{139}] % DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT TWO
- \definesymbol[CircledThree][\USymbCharZapf{39}{140}] % DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT THREE
- \definesymbol[CircledFour][\USymbCharZapf{39}{141}] % DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT FOUR
- \definesymbol[CircledFive][\USymbCharZapf{39}{142}] % DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT FIVE
- \definesymbol[CircledSix][\USymbCharZapf{39}{143}] % DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT SIX
- \definesymbol[CircledSeven][\USymbCharZapf{39}{144}] % DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT SEVEN
- \definesymbol[CircledEight][\USymbCharZapf{39}{145}] % DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT EIGHT
- \definesymbol[CircledNine][\USymbCharZapf{39}{146}] % DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT NINE
- \definesymbol[CircledTen][\USymbCharZapf{39}{147}] % DINGBAT NEGATIVE CIRCLED SANS-SERIF NUMBER TEN
-
-\stopsymbolset
-
-\startsymbolset[Unicode Dingbat Arrows] % 0x2700: Requires UnicodeRegular27
-
- \definesymbol[HeavyWideHeadedRightwardsArrow][\USymbCharZapf{39}{148}] % HEAVY WIDE-HEADED RIGHTWARDS ARROW
- \definesymbol[HeavySouthEastArrow][\USymbCharZapf{39}{152}] % HEAVY SOUTH EAST ARROW
- \definesymbol[HeavyRightwardsArrow][\USymbCharZapf{39}{153}] % HEAVY RIGHTWARDS ARROW
- \definesymbol[HeavyNorthEastArrow][\USymbCharZapf{39}{154}] % HEAVY NORTH EAST ARROW
- \definesymbol[DraftingPointRightwardsArrow][\USymbCharZapf{39}{155}] % DRAFTING POINT RIGHTWARDS ARROW
- \definesymbol[HeavyRoundTippedRightwardsArrow][\USymbCharZapf{39}{156}] % HEAVY ROUND-TIPPED RIGHTWARDS ARROW
- \definesymbol[TriangleHeadedRightwardsArrow][\USymbCharZapf{39}{157}] % TRIANGLE-HEADED RIGHTWARDS ARROW
- \definesymbol[HeavyTriangleHeadedRightwardsArrow][\USymbCharZapf{39}{158}] % HEAVY TRIANGLE-HEADED RIGHTWARDS ARROW
- \definesymbol[DashedTriangleHeadedRightwardsArrow][\USymbCharZapf{39}{159}] % DASHED TRIANGLE-HEADED RIGHTWARDS ARROW
- \definesymbol[HeavyDashedTriangleHeadedRightwardsArrow][\USymbCharZapf{39}{160}] % HEAVY DASHED TRIANGLE-HEADED RIGHTWARDS ARROW
- \definesymbol[BlackRightwardsArrow][\USymbCharZapf{39}{161}] % BLACK RIGHTWARDS ARROW
- \definesymbol[3DTopLightedRightwardsArrowhead][\USymbCharZapf{39}{162}] % THREE-D TOP-LIGHTED RIGHTWARDS ARROWHEAD
- \definesymbol[3DBottomLightedRightwardsArrowhead][\USymbCharZapf{39}{163}] % THREE-D BOTTOM-LIGHTED RIGHTWARDS ARROWHEAD
- \definesymbol[BlackRightwardsArrowhead][\USymbCharZapf{39}{164}] % BLACK RIGHTWARDS ARROWHEAD
- \definesymbol[HeavyBlackCurvedDownwardsAndRightwardsArrow][\USymbCharZapf{39}{165}] % HEAVY BLACK CURVED DOWNWARDS AND RIGHTWARDS ARROW
- \definesymbol[HeavyBlackCurvedUpwardsAndRightwardsArrow][\USymbCharZapf{39}{166}] % HEAVY BLACK CURVED UPWARDS AND RIGHTWARDS ARROW
- \definesymbol[SquatBlackRightwardsArrow][\USymbCharZapf{39}{167}] % SQUAT BLACK RIGHTWARDS ARROW
- \definesymbol[HeavyConcavePointedBlackRightwardsArrow][\USymbCharZapf{39}{168}] % HEAVY CONCAVE-POINTED BLACK RIGHTWARDS ARROW
- \definesymbol[CircledHeavyWhiteRightwardsArrow][\USymbCharZapf{39}{178}] % CIRCLED HEAVY WHITE RIGHTWARDS ARROW
- \definesymbol[OpenOutlinedRightwardsArrow][\USymbCharZapf{39}{190}] % OPEN-OUTLINED RIGHTWARDS ARROW
-
-\stopsymbolset
-
-\startsymbolset[Unicode Shadowed Arrows] % 0x2700: Requires UnicodeRegular27
-
- \definesymbol[RightShadedWhiteRightwardsArrow][\USymbCharZapf{39}{169}] % RIGHT-SHADED WHITE RIGHTWARDS ARROW
- \definesymbol[LeftShadedWhiteRightwardsArrow][\USymbCharZapf{39}{170}] % LEFT-SHADED WHITE RIGHTWARDS ARROW
- \definesymbol[BackTiltedShadowedWhiteRightwardsArrow][\USymbCharZapf{39}{171}] % BACK-TILTED SHADOWED WHITE RIGHTWARDS ARROW
- \definesymbol[FrontTiltedShadowedWhiteRightwardsArrow][\USymbCharZapf{39}{172}] % FRONT-TILTED SHADOWED WHITE RIGHTWARDS ARROW
- \definesymbol[HeavyLowerRightShadowedWhiteRightwardsArrow][\USymbCharZapf{39}{173}] % HEAVY LOWER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW
- \definesymbol[HeavyUpperRightShadowedWhiteRightwardsArrow][\USymbCharZapf{39}{174}] % HEAVY UPPER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW
- \definesymbol[NotchedLowerRightShadowedWhiteRightwardsArrow][\USymbCharZapf{39}{175}] % NOTCHED LOWER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW
- \definesymbol[NotchedUpperRightShadowedWhiteRightwardsArrow][\USymbCharZapf{39}{177}] % NOTCHED UPPER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW
-
-\stopsymbolset
-
-\startsymbolset[Unicode Tailed Arrows] % 0x2700: Requires UnicodeRegular27
-
- \definesymbol[WhiteFeatheredRightwardsArrow][\USymbCharZapf{39}{179}] % WHITE-FEATHERED RIGHTWARDS ARROW
- \definesymbol[BlackFeatheredSouthEastArrow][\USymbCharZapf{39}{180}] % BLACK-FEATHERED SOUTH EAST ARROW
- \definesymbol[BlackFeatheredRightwardsArrow][\USymbCharZapf{39}{181}] % BLACK-FEATHERED RIGHTWARDS ARROW
- \definesymbol[BlackFeatheredNorthEastArrow][\USymbCharZapf{39}{182}] % BLACK-FEATHERED NORTH EAST ARROW
- \definesymbol[HeavyBlack-featheredSouthEastArrow][\USymbCharZapf{39}{183}] % HEAVY BLACK-FEATHERED SOUTH EAST ARROW
- \definesymbol[HeavyBlackFeatheredRightwardsArrow][\USymbCharZapf{39}{184}] % HEAVY BLACK-FEATHERED RIGHTWARDS ARROW
- \definesymbol[HeavyBlackFeatheredNorthEastArrow][\USymbCharZapf{39}{185}] % HEAVY BLACK-FEATHERED NORTH EAST ARROW
- \definesymbol[TeardropBarbedRightwardsArrow][\USymbCharZapf{39}{186}] % TEARDROP-BARBED RIGHTWARDS ARROW
- \definesymbol[HeavyTeardropShankedRightwardsArrow][\USymbCharZapf{39}{187}] % HEAVY TEARDROP-SHANKED RIGHTWARDS ARROW
- \definesymbol[WedgeTailedRightwardsArrow][\USymbCharZapf{39}{188}] % WEDGE-TAILED RIGHTWARDS ARROW
- \definesymbol[HeavyWedgeTailedRightwardsArrow][\USymbCharZapf{39}{189}] % HEAVY WEDGE-TAILED RIGHTWARDS ARROW
-
-\stopsymbolset
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/symb-was.mkii b/Master/texmf-dist/tex/context/base/mkii/symb-was.mkii
deleted file mode 100644
index e131cf04dae..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/symb-was.mkii
+++ /dev/null
@@ -1,207 +0,0 @@
-%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]
-
-\unprotect
-
-% 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 {50}]
- \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]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/syst-con.mkii b/Master/texmf-dist/tex/context/base/mkii/syst-con.mkii
deleted file mode 100644
index c1ad788cfe5..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/syst-con.mkii
+++ /dev/null
@@ -1,243 +0,0 @@
-%D \module
-%D [ file=syst-con,
-%D version=2000.12.10, % actually very old -)
-%D title=\CONTEXT\ System Macros,
-%D subtitle=Conversions,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 System Macros / Conversions}
-
-\unprotect
-
-%D When the number of conversions grew, it did no longer make
-%D sense to spread them over multiple files. So, instead of
-%D defining these in \type {font-ini}, we now have a dedicated
-%D module.
-
-\catcode127=12 % other, just to be sure
-
-%D \macros
-%D {lchexnumber,uchexnumber,lchexnumbers,uchexnumbers}
-%D
-%D In addition to the uppercase hex conversion, as needed in
-%D math families, we occasionally need a lowercase one, for
-%D instance when we want to compose gbsong fontnames.
-%D
-%D The ugly indirectness is needed to get rid of \TEX\
-%D induced spaces and \type {\relax}'s.
-%D
-%D \starttyping
-%D [\uchexnumber{0}]
-%D [\uchexnumber\scratchcounter]
-%D [\uchexnumber\zerocount]
-%D [\uchexnumber{\number0}]
-%D [\uchexnumber{\number\scratchcounter}]
-%D [\uchexnumber{\number\zerocount}]
-%D [\uchexnumber{\the\scratchcounter}]
-%D [\uchexnumber{\the\zerocount}]
-%D [\expandafter\uchexnumber\expandafter{\number0}]
-%D [\expandafter\uchexnumber\expandafter{\number\scratchcounter}]
-%D [\expandafter\uchexnumber\expandafter{\number\zerocount}]
-%D [\expandafter\uchexnumber\expandafter{\the\scratchcounter}]
-%D [\expandafter\uchexnumber\expandafter{\the\zerocount}]
-%D \stoptyping
-%D
-%D These macros may look slow but are actually rather fast due to
-%D the fact that \TEX\ handles conditional pretty fast. We need
-%D a two step approach in order to stay relax clean in fully
-%D expandable macros.
-
-\def\dolchexnumber#1\relax
- {\ifcase#1 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or
- 8\or 9\or a\or b\or c\or d\or e\or f\else 0\fi}
-
-\def\douchexnumber#1\relax
- {\ifcase#1 0\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or
- 8\or 9\or A\or B\or C\or D\or E\or F\else 0\fi}
-
-\def\dolchexnumbers#1\relax
- {\ifcase#1
- 00\or 01\or 02\or 03\or 04\or 05\or 06\or 07\or 08\or 09\or 0a\or 0b\or 0c\or 0d\or 0e\or 0f\or
- 10\or 11\or 12\or 13\or 14\or 15\or 16\or 17\or 18\or 19\or 1a\or 1b\or 1c\or 1d\or 1e\or 1f\or
- 20\or 21\or 22\or 23\or 24\or 25\or 26\or 27\or 28\or 29\or 2a\or 2b\or 2c\or 2d\or 2e\or 2f\or
- 30\or 31\or 32\or 33\or 34\or 35\or 36\or 37\or 38\or 39\or 3a\or 3b\or 3c\or 3d\or 3e\or 3f\or
- 40\or 41\or 42\or 43\or 44\or 45\or 46\or 47\or 48\or 49\or 4a\or 4b\or 4c\or 4d\or 4e\or 4f\or
- 50\or 51\or 52\or 53\or 54\or 55\or 56\or 57\or 58\or 59\or 5a\or 5b\or 5c\or 5d\or 5e\or 5f\or
- 60\or 61\or 62\or 63\or 64\or 65\or 66\or 67\or 68\or 69\or 6a\or 6b\or 6c\or 6d\or 6e\or 6f\or
- 70\or 71\or 72\or 73\or 74\or 75\or 76\or 77\or 78\or 79\or 7a\or 7b\or 7c\or 7d\or 7e\or 7f\or
- 80\or 81\or 82\or 83\or 84\or 85\or 86\or 87\or 88\or 89\or 8a\or 8b\or 8c\or 8d\or 8e\or 8f\or
- 90\or 91\or 92\or 93\or 94\or 95\or 96\or 97\or 98\or 99\or 9a\or 9b\or 9c\or 9d\or 9e\or 9f\or
- a0\or a1\or a2\or a3\or a4\or a5\or a6\or a7\or a8\or a9\or aa\or ab\or ac\or ad\or ae\or af\or
- b0\or b1\or b2\or b3\or b4\or b5\or b6\or b7\or b8\or b9\or ba\or bb\or bc\or bd\or be\or bf\or
- c0\or c1\or c2\or c3\or c4\or c5\or c6\or c7\or c8\or c9\or ca\or cb\or cc\or cd\or ce\or cf\or
- d0\or d1\or d2\or d3\or d4\or d5\or d6\or d7\or d8\or d9\or da\or db\or dc\or dd\or de\or df\or
- e0\or e1\or e2\or e3\or e4\or e5\or e6\or e7\or e8\or e9\or ea\or eb\or ec\or ed\or ee\or ef\or
- f0\or f1\or f2\or f3\or f4\or f5\or f6\or f7\or f8\or f9\or fa\or fb\or fc\or fd\or fe\or ff\fi}
-
-\def\douchexnumbers#1\relax
- {\ifcase#1
- 00\or 01\or 02\or 03\or 04\or 05\or 06\or 07\or 08\or 09\or 0A\or 0B\or 0C\or 0D\or 0E\or 0F\or
- 10\or 11\or 12\or 13\or 14\or 15\or 16\or 17\or 18\or 19\or 1A\or 1B\or 1C\or 1D\or 1E\or 1F\or
- 20\or 21\or 22\or 23\or 24\or 25\or 26\or 27\or 28\or 29\or 2A\or 2B\or 2C\or 2D\or 2E\or 2F\or
- 30\or 31\or 32\or 33\or 34\or 35\or 36\or 37\or 38\or 39\or 3A\or 3B\or 3C\or 3D\or 3E\or 3F\or
- 40\or 41\or 42\or 43\or 44\or 45\or 46\or 47\or 48\or 49\or 4A\or 4B\or 4C\or 4D\or 4E\or 4F\or
- 50\or 51\or 52\or 53\or 54\or 55\or 56\or 57\or 58\or 59\or 5A\or 5B\or 5C\or 5D\or 5E\or 5F\or
- 60\or 61\or 62\or 63\or 64\or 65\or 66\or 67\or 68\or 69\or 6A\or 6B\or 6C\or 6D\or 6E\or 6F\or
- 70\or 71\or 72\or 73\or 74\or 75\or 76\or 77\or 78\or 79\or 7A\or 7B\or 7C\or 7D\or 7E\or 7F\or
- 80\or 81\or 82\or 83\or 84\or 85\or 86\or 87\or 88\or 89\or 8A\or 8B\or 8C\or 8D\or 8E\or 8F\or
- 90\or 91\or 92\or 93\or 94\or 95\or 96\or 97\or 98\or 99\or 9A\or 9B\or 9C\or 9D\or 9E\or 9F\or
- A0\or A1\or A2\or A3\or A4\or A5\or A6\or A7\or A8\or A9\or AA\or AB\or AC\or AD\or AE\or AF\or
- B0\or B1\or B2\or B3\or B4\or B5\or B6\or B7\or B8\or B9\or BA\or BB\or BC\or BD\or BE\or BF\or
- C0\or C1\or C2\or C3\or C4\or C5\or C6\or C7\or C8\or C9\or CA\or CB\or CC\or CD\or CE\or CF\or
- D0\or D1\or D2\or D3\or D4\or D5\or D6\or D7\or D8\or D9\or DA\or DB\or DC\or DD\or DE\or DF\or
- E0\or E1\or E2\or E3\or E4\or E5\or E6\or E7\or E8\or E9\or EA\or EB\or EC\or ED\or EE\or EF\or
- F0\or F1\or F2\or F3\or F4\or F5\or F6\or F7\or F8\or F9\or FA\or FB\or FC\or FD\or FE\or FF\fi}
-
-\def\lchexnumber #1{\@EA\dolchexnumber \number#1\relax}
-\def\uchexnumber #1{\@EA\douchexnumber \number#1\relax}
-\def\lchexnumbers#1{\@EA\dolchexnumbers\number#1\relax}
-\def\uchexnumbers#1{\@EA\douchexnumbers\number#1\relax}
-
-\let\hexnumber\uchexnumber
-
-%D \macros
-%D {octnumber}
-%D
-%D For unicode remapping purposes, we need octal numbers.
-
-\def\dooctnumber#1\relax
- {\ifcase#1
- 000\or 001\or 002\or 003\or 004\or 005\or 006\or 007\or
- 010\or 011\or 012\or 013\or 014\or 015\or 016\or 017\or
- 020\or 021\or 022\or 023\or 024\or 025\or 026\or 027\or
- 030\or 031\or 032\or 033\or 034\or 035\or 036\or 037\or
- 040\or 041\or 042\or 043\or 044\or 045\or 046\or 047\or
- 050\or 051\or 052\or 053\or 054\or 055\or 056\or 057\or
- 060\or 061\or 062\or 063\or 064\or 065\or 066\or 067\or
- 070\or 071\or 072\or 073\or 074\or 075\or 076\or 077\or
- 100\or 101\or 102\or 103\or 104\or 105\or 106\or 107\or
- 110\or 111\or 112\or 113\or 114\or 115\or 116\or 117\or
- 120\or 121\or 122\or 123\or 124\or 125\or 126\or 127\or
- 130\or 131\or 132\or 133\or 134\or 135\or 136\or 137\or
- 140\or 141\or 142\or 143\or 144\or 145\or 146\or 147\or
- 150\or 151\or 152\or 153\or 154\or 155\or 156\or 157\or
- 160\or 161\or 162\or 163\or 164\or 165\or 166\or 167\or
- 170\or 171\or 172\or 173\or 174\or 175\or 176\or 177\or
- 200\or 201\or 202\or 203\or 204\or 205\or 206\or 207\or
- 210\or 211\or 212\or 213\or 214\or 215\or 216\or 217\or
- 220\or 221\or 222\or 223\or 224\or 225\or 226\or 227\or
- 230\or 231\or 232\or 233\or 234\or 235\or 236\or 237\or
- 240\or 241\or 242\or 243\or 244\or 245\or 246\or 247\or
- 250\or 251\or 252\or 253\or 254\or 255\or 256\or 257\or
- 260\or 261\or 262\or 263\or 264\or 265\or 266\or 267\or
- 270\or 271\or 272\or 273\or 274\or 275\or 276\or 277\or
- 300\or 301\or 302\or 303\or 304\or 305\or 306\or 307\or
- 310\or 311\or 312\or 313\or 314\or 315\or 316\or 317\or
- 320\or 321\or 322\or 323\or 324\or 325\or 326\or 327\or
- 330\or 331\or 332\or 333\or 334\or 335\or 336\or 337\or
- 340\or 341\or 342\or 343\or 344\or 345\or 346\or 347\or
- 350\or 351\or 352\or 353\or 354\or 355\or 356\or 357\or
- 360\or 361\or 362\or 363\or 364\or 365\or 366\or 367\or
- 370\or 371\or 372\or 373\or 374\or 375\or 376\or 377\fi}
-
-\def\octnumber#1{\@EA\dooctnumber\number#1\relax}
-
-%D \macros
-%D {twodigits, threedigits}
-%D
-%D These macros provides two or three digits always:
-
-\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{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.
-
-\def\modulonumber#1#2%
- {\the\numexpr#2-((((#2+(#1/2))/#1)-1)*#1)\relax}
-
-%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.
-
-\def\modulatednumber#1#2%
- {\ifnum\the\numexpr\modulonumber{#1}{#2}\relax=0 #1%
- \else \the\numexpr\modulonumber{#1}{#2}\relax \fi}
-
-%D \macros
-%D {hexstringtonumber}
-%D
-%D This macro converts a two character hexadecimal number into
-%D a decimal number, thereby taking care of lowercase characters
-%D as well.
-
-\dostepwiserecurse{0}{9}{1}{\setevalue{@@uc@@\recurselevel}{\recurselevel}}
-
-\setvalue{@@uc@@a}{A} \setvalue{@@uc@@A}{A}
-\setvalue{@@uc@@b}{B} \setvalue{@@uc@@B}{B}
-\setvalue{@@uc@@c}{C} \setvalue{@@uc@@C}{C}
-\setvalue{@@uc@@d}{D} \setvalue{@@uc@@D}{D}
-\setvalue{@@uc@@e}{E} \setvalue{@@uc@@E}{E}
-\setvalue{@@uc@@f}{F} \setvalue{@@uc@@F}{F}
-
-\def\hexstringtonumber#1% {FF}
- {\dohexstringtonumber#1}
-
-\def\dohexstringtonumber#1#2% FF
- {"\csname @@uc@@#1\endcsname\csname @@uc@@#2\endcsname}
-
-%D \macros
-%D {rawcharacter}
-%D
-%D The next conversion macro produces raw characters. We have to
-%D construct the macro in a special way to avoid problems with
-%D characters with special meanings. So, we revert to the
-%D lowercase conversion trick to bypass \TEX's input parser.
-%D
-%D This macro can be used to produce proper 8 bit characters
-%D that we sometimes need in backends and round||trips.
-
-\bgroup
-
-\catcode`\^^@=12 % ascii null == ignored in plain
-\catcode`\^^?=12 % ascii delete == invalid in plain
-
-\let\or\relax
-
-\xdef\rawcharacter{ ^^00\or}
-
-\dorecurse{255}
- {\lccode`a=\recurselevel
- \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}
-
-\egroup
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/syst-ext.mkii b/Master/texmf-dist/tex/context/base/mkii/syst-ext.mkii
deleted file mode 100644
index 39f4145f278..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/syst-ext.mkii
+++ /dev/null
@@ -1,5025 +0,0 @@
-%D \module
-%D [ file=syst-ext,
-%D version=1995.10.10,
-%D title=\CONTEXT\ System Macros,
-%D subtitle=Extras,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 System Macros / Extras}
-
-%D In this second system module, we continue the definition of
-%D some handy commands.
-
-\unprotect
-
-%D \macros
-%D {rawgetparameters}
-%D
-%D A raw and dirty alternative for \type {\getparameters}; no
-%D checking is done!
-
-% \def\rawgetparameters[#1][#2]% scheelt 5\%
-% {\def\rawparameterprefix{#1}%
-% \expandafter\rawsetparameter#2,]=,}
-
-\def\rawsetparameter#1=#2,%
- {\if]#1\else
- \expandafter\def\csname\rawparameterprefix#1\endcsname{#2}%
- \expandafter\rawsetparameter
- \fi}
-
-% the next one handles empty #1 okay:
-
-\def\rawgetparameters[#1][#2% some 5-10% faster
- {\ifx#2]% test is needed, else bomb on [#1][]
- \expandafter\gobbleoneargument
- \else
- \def\rawparameterprefix{#1}%
- \expandafter\dorawgetparameters
- \fi#2}
-
-\def\dorawgetparameters#1]%
- {\expandafter\rawsetparameter#1,]=,}
-
-%D \macros
-%D {doglobal,
-%D redoglobal,dodoglobal,resetglobal}
-%D
-%D The two macros \type {\redoglobal} and \type{\dodoglobal} are
-%D used in this and some other modules to enforce a user
-%D specified \type {\doglobal} action. The last and often only
-%D global assignment in a macro is done with
-%D \type {\dodoglobal}, but all preceding ones with
-%D \type {\redoglobal}. When using only alternatives, one can
-%D reset this mechanism with \type {\resetglobal}.
-
-\def\doglobal
- {\let\redoglobal\global
- \def\dodoglobal{\resetglobal\global}}
-
-\def\resetglobal
- {\let\redoglobal\relax
- \let\dodoglobal\relax}
-
-\resetglobal
-
-%D New:
-
-\def\doglobal
- {\ifx\redoglobal\relax
- \let\redoglobal\global
- \let\dodoglobal\@@dodoglobal
- %\else
- % \writestatus{system}{global not reset, warn me!}%
- \fi}
-
-\def\@@dodoglobal
- {\resetglobal\global}
-
-\def\saveglobal
- {\let\@@dodoglobal\dodoglobal
- \let\@@redoglobal\redoglobal}
-
-\def\restoreglobal
- {\let\redoglobal\@@redoglobal
- \let\dodoglobal\@@dodoglobal}
-
-%D A very useful application of this macro is \type {\newif},
-%D \TEX's fake boolean type. Not being a primitive,
-%D \type {\global} hopelessly fails here. But a slight
-%D adaption of Knuth's original macro permits:
-%D
-%D \starttyping
-%D \doglobal\newif\iftest
-%D \stoptyping
-%D
-%D Of course one can still say:
-%D
-%D \starttyping
-%D \global\testtrue
-%D \global\testfalse
-%D \stoptyping
-%D
-%D Apart from the prefixes, a few more \type{\expandafters}
-%D are needed:
-
-\def\newif#1%
- {\scratchcounter\escapechar
- \escapechar\minusone
- \expandafter\expandafter\expandafter
- \redoglobal\expandafter\expandafter\expandafter
- \edef\@if#1{true}{\let\noexpand#1\noexpand\iftrue}%
- \expandafter\expandafter\expandafter
- \redoglobal\expandafter\expandafter\expandafter
- \edef\@if#1{false}{\let\noexpand#1\noexpand\iffalse}%
- \dodoglobal\@if#1{false}%
- \escapechar\scratchcounter}
-
-%D Also:
-
-\def\define#1%
- {\ifx#1\undefined
- \expandafter\long\expandafter\def
- \else
- \message{[\noexpand#1is already defined]}%
- \expandafter\long\expandafter\def\expandafter\gobbleddefinition
- \fi#1}
-
-\def\redefine#1%
- {\ifx#1\undefined\else
- \message{[\noexpand#1is redefined]}%
- \fi
- \long\def#1}
-
-% \define\hans{hans}
-% \redefine\hans{hans}
-% \define\hans#1[]#2#3{hans}
-
-%D The next variant fits nicely in the setups syntax:
-%D
-%D \starttyping
-%D \starttexdefinition bagger [#1] #2
-%D oeps
-%D #1
-%D oeps
-%D \stoptexdefinition
-%D
-%D \bagger [a] {b}
-%D \stoptyping
-
-\bgroup \obeylines
-
-\gdef\starttexdefinition%
- {\bgroup%
- \obeylines%
- \dostarttexdefinition}
-
-\gdef\dostarttexdefinition #1
- {\catcode13=\@@ignore%
- \doifinstringelse\letterhash{\detokenize{#1}}\dodostarttexdefinition\nonostarttexdefinition#1
- }
-
-\long\gdef\dodostarttexdefinition#1 #2
- {\dododostarttexdefinition{#1}{#2}}
-
-\long\gdef\dododostarttexdefinition#1#2#3\stoptexdefinition%
- {\egroup%
- \long\setvalue{#1}#2{#3}}
-
-\long\gdef\nonostarttexdefinition#1
- {\nononostarttexdefinition{#1}{}}
-
-\long\gdef\nononostarttexdefinition#1#2#3\stoptexdefinition%
- {\egroup%
- \long\setvalue{#1}{#3}}
-
-\egroup
-
-%D \macros
-%D {newcounter,
-%D increment,decrement}
-%D
-%D Unfortunately the number of \COUNTERS\ in \TEX\ is limited,
-%D but fortunately we can store numbers in a macro. We can
-%D increment such pseudo \COUNTERS\ with \type{\increment}.
-%D
-%D \starttyping
-%D \increment(\counter,20)
-%D \increment(\counter,-4)
-%D \increment(\counter)
-%D \increment\counter
-%D \stoptyping
-%D
-%D After this sequence of commands, the value of
-%D \type{\counter} is 20, 16, 17 and~18. Of course there is
-%D also the complementary command \type{\decrement}.
-%D
-%D Global assignments are possible too, using \type{\doglobal}:
-%D
-%D \starttyping
-%D \doglobal\increment\counter
-%D \stoptyping
-%D
-%D When \type{\counter} is undefined, it's value is initialized
-%D at~0. It is nevertheless better to define a \COUNTER\
-%D explicitly. One reason could be that the \COUNTER\ can be
-%D part of a test with \type{\ifnum} and this conditional does
-%D not accept undefined macro's. The \COUNTER\ in our example
-%D can for instance be defined with:
-%D
-%D \starttyping
-%D \newcounter\counter
-%D \stoptyping
-%D
-%D The command \type{\newcounter} must not be confused with
-%D \type{\newcount}! Of course this mechanism is much slower
-%D than using \TEX's \COUNTERS\ directly. In practice
-%D \COUNTERS\ (and therefore our pseudo counters too) are
-%D seldom the bottleneck in the processing of a text. Apart
-%D from some other incompatilities we want to mention a pitfal
-%D when using \type{\ifnum}.
-%D
-%D \starttyping
-%D \ifnum\normalcounter=\pseudocounter \doif \else \doelse \fi
-%D \ifnum\pseudocounter=\normalcounter \doif \else \doelse \fi
-%D \stoptyping
-%D
-%D In the first test, \TEX\ continues it's search for the
-%D second number after reading \type{\pseudocounter}, while
-%D in the second test, it stops reading after having
-%D encountered a real one. Tests like the first one therefore
-%D can give unexpected results, for instance execution
-%D of \type{\doif} even if both numbers are unequal.
-
-\def\zerocountervalue{0}
-
-\def\newcounter#1%
- {\dodoglobal\let#1\zerocountervalue}
-
-% This is the original implementation:
-%
-% \def\dodododoincrement(#1,#2)%
-% {\ifx#1\undefined
-% \redoglobal\let#1\zerocountervalue
-% \else\ifx#1\relax % \csname...\endcsname
-% \redoglobal\let#1\zerocountervalue
-% \fi\fi
-% \scratchcounter=#2\relax
-% \scratchcounter=\incrementsign\scratchcounter
-% \advance\scratchcounter #1\relax
-% \dodoglobal\edef#1{\the\scratchcounter}}
-%
-% \def\dododoincrement#1%
-% {\dodododoincrement(#1,1)}
-%
-% \def\dodoincrement(#1%
-% {\doifnextcharelse,%
-% {\dodododoincrement(#1}{\dodododoincrement(#1,1}}
-%
-% \def\doincrement#1%
-% {\def\incrementsign{#1}%
-% \doifnextcharelse(\dodoincrement\dododoincrement}
-%
-% \def\increment{\doincrement+}
-% \def\decrement{\doincrement-}
-%
-% And this is the one optimized for speed:
-
-% maxcounter = 2\maxdimen=1
-
-\def\!!zerocount {0} % alongside \zerocount
-\def\!!minusone {-1} % alongside \minusone
-\def\!!plusone {1} % alongside \plusone
-
-\beginTEX
-
-\def\dodoindecrement#1(#2,#3)%
- {\ifx#2\undefined
- \redoglobal\let#2\zerocountervalue
- \else\ifx#2\relax % \csname...\endcsname
- \redoglobal\let#2\zerocountervalue
- \fi\fi
- \scratchcounter#3\relax
- \scratchcounter#1\scratchcounter
- \advance\scratchcounter#2\relax
- \dodoglobal\edef#2{\the\scratchcounter}}
-
-\def\dodoincrement(#1%
- {\doifnextcharelse,{\dodoindecrement+(#1}{\dodoindecrement+(#1,1}}
-
-\def\dododecrement(#1%
- {\doifnextcharelse,{\dodoindecrement-(#1}{\dodoindecrement-(#1,1}}
-
-\def\doincrement#1% 10% faster alternative
- {\ifx#1\undefined
- \dodoglobal\let#1\!!plusone
- \else\ifx#1\relax % \csname...\endcsname
- \dodoglobal\let#1\!!plusone
- \else
- \fastincrement#1%
- \fi\fi}
-
-\def\dodecrement#1% 10% faster alternative
- {\ifx#1\undefined
- \dodoglobal\let#1\!!minusone
- \else\ifx#1\relax % \csname...\endcsname
- \dodoglobal\let#1\!!minusone
- \else
- \fastdecrement#1%
- \fi\fi}
-
-\def\fastdecrement#1% 50% faster alternative
- {\scratchcounter#1\advance\scratchcounter\minusone
- \dodoglobal\edef#1{\the\scratchcounter}}
-
-\def\fastincrement#1% 50% faster alternative
- {\scratchcounter#1\advance\scratchcounter\plusone
- \dodoglobal\edef#1{\the\scratchcounter}}
-
-\endTEX
-
-\beginETEX \numexpr
-
-% \def\doindecrement#1#2%
-% {\dodoglobal\edef#2%
-% {\the\numexpr(\ifx#2\undefined\else\ifx#2\relax\else#2\fi\fi#11)}}
-%
-% \def\doincrement{\doindecrement+}
-% \def\dodecrement{\doindecrement-}
-%
-% some 3\% faster:
-
-\def\doindecrement#1#2%
- {\dodoglobal\edef#2%
- {\the\numexpr\ifx#2\undefined\else\ifx#2\relax\else#2\fi\fi+#1\relax}}
-
-\def\doincrement{\doindecrement\plusone }
-\def\dodecrement{\doindecrement\minusone}
-
-\def\dodoindecrement#1#2,#3)%
- {\dodoglobal\edef#2%
- {\the\numexpr\ifx#2\undefined\else\ifx#2\relax\else#2\fi\fi#1#3\relax}}
-
-\def\dodoincrement(#1%
- {\doifnextcharelse,{\dodoindecrement+#1}{\dodoindecrement+#1,\plusone}}
-
-\def\dododecrement(#1%
- {\doifnextcharelse,{\dodoindecrement-#1}{\dodoindecrement-#1,\plusone}}
-
-\def\fastincrement#1{\dodoglobal\edef#1{\the\numexpr#1+\plusone \relax}}
-\def\fastdecrement#1{\dodoglobal\edef#1{\the\numexpr#1+\minusone\relax}}
-
-\endETEX
-
-\def\increment{\doifnextcharelse(\dodoincrement\doincrement}
-\def\decrement{\doifnextcharelse(\dododecrement\dodecrement}
-
-\def\incrementvalue#1{\expandafter\increment\csname#1\endcsname}
-\def\decrementvalue#1{\expandafter\decrement\csname#1\endcsname}
-
-%D \macros
-%D {newsignal}
-%D
-%D When writing advanced macros, we cannot do without
-%D signaling. A signal is a small (invisible) kern or penalty
-%D that signals the next macro that something just happened.
-%D This macro can take any action depending on the previous
-%D signal. Signals must be unique and the next macro takes care
-%D of that.
-%D
-%D \starttyping
-%D \newsignal\somesignal
-%D \stoptyping
-%D
-%D Signals old dimensions and can be used in skips, kerns and
-%D tests like \type{\ifdim}.
-
-\newdimen\maximumsignal % step is about 0.00025pt
-
-\def\newsignal#1%
- {\ifx#1\undefined
- \advance\maximumsignal 2sp % to be save in rounding
- \edef#1{\the\maximumsignal}%
- \fi}
-
-%D \macros
-%D {newskimen}
-%D
-%D \TEX\ offers 256 \DIMENSIONS\ and \SKIPS. Unfortunately this
-%D amount is too small to suit certain packages. Therefore when
-%D possible one should use:
-%D
-%D \starttyping
-%D \newskimen\tempskimen
-%D \stoptyping
-%D
-%D This commands allocates a \DIMENSION\ or a \SKIP, depending
-%D on the availability. One should be aware of the difference
-%D between both. When searching for some glue \TEX\ goes on
-%D searching till it's sure that no other glue component if
-%D found. This search can be canceled by using \type{\relax}
-%D when possible and needed.
-%D
-%D \starttyping
-%D \def\newskimen#1%
-%D {\ifx#1\undefined
-%D \ifnum\count11>\count12
-%D \newskip#1\relax
-%D \else
-%D \newdimen#1\relax
-%D \fi
-%D \fi}
-%D \stoptyping
-%D
-%D In order to make this macro work in plain \TEX\ too, we
-%D use the following alternative, which fools \TEX\ about
-%D the new commands being \type {\outer} ones.
-
-% \def\newskimen#1%
-% {\ifx#1\undefined
-% \csname new\ifnum\count11>\count12 skip\else dimen\fi\endcsname#1%
-% \fi}
-
-\let\newskimen\newdimen % it's all etex or later now
-
-%D \macros
-%D {strippedcsname}
-%D
-%D The next macro can be very useful when using \type{\csname}
-%D like in:
-%D
-%D \starttyping
-%D \csname if\strippedcsname\something\endcsname
-%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:
-
-\ifx\letterbackslash\undefined
- {\catcode`.=0 .catcode`.\ 12 .xdef.letterbackslash{.string\}} % hack
-\fi
-
-\def\strippedcsname#1% this permits \strippedcsname{\xxx} and \strippedcsname{xxx}
- {\expandafter\dostrippedcsname\string#1}
-
-\def\dostrippedcsname#1%
- {\if\noexpand#1\letterbackslash\else#1\fi}
-
-%D \macros
-%D {savenormalmeaning}
-%D
-%D We will use this one in:
-
-\def\savenormalmeaning#1%
- {\ifundefined{normal\strippedcsname#1}%
- \letvalue{normal\strippedcsname#1}#1%
- \fi}
-
-%D \macros
-%D {newconditional,
-%D settrue, setfalse,
-%D ifconditional,then}
-%D
-%D \TEX's lacks boolean variables, although the \PLAIN\ format
-%D implements \type{\newif}. The main disadvantage of this
-%D scheme is that it takes three hash table entries. A more
-%D memory saving alternative is presented here. A conditional
-%D is defined by:
-%D
-%D \starttyping
-%D \newconditional\doublesided
-%D \setfalse
-%D \stoptyping
-%D Setting a conditional is done by \type{\settrue} and
-%D \type{\setfalse}:
-%D
-%D \starttyping
-%D \settrue\doublesided
-%D \setfalse
-%D \stoptyping
-%D while testing is accomplished by:
-%D
-%D \starttyping
-%D \ifconditional\doublesided ... \else ... \fi
-%D \setfalse
-%D \stoptyping
-%D We cannot use the simple scheme:
-%D
-%D \starttyping
-%D \def\settrue #1{\let#1=\iftrue}
-%D \def\setfalse#1{\let#1=\iffalse}
-%D \stoptyping
-%D
-%D Such an implementation gives problems with nested
-%D conditionals. The next implementation is abaou as fast
-%D and just as straightforward:
-
-\def\settrue #1{\chardef#1\zerocount}
-\def\setfalse#1{\chardef#1\plusone}
-
-\let\newconditional = \setfalse
-\let\ifconditional = \ifcase
-
-\let\then\relax % so that we can say \ifnum1>2\then -)
-
-%D \macros
-%D {ifzeropt}
-%D
-%D The next macro is both cosmetic and byte saving. It is
-%D pretty \type{\if}||safe too. It can be used in cases
-%D like:
-%D
-%D \starttyping
-%D \ifzeropt \somedimen ... \else ... \fi
-%D \stoptyping
-
-\let\ifzeropt\ifcase
-
-%D \macros
-%D {dorecurse,recurselevel,recursedepth,
-%D dostepwiserecurse,
-%D for}
-%D
-%D \TEX\ does not offer us powerfull for||loop mechanisms. On
-%D the other hand its recursion engine is quite unique. We
-%D therefore identify the for||looping macros by this method.
-%D The most simple alternative is the one that only needs a
-%D number.
-%D
-%D \starttyping
-%D \dorecurse {n} {whatever we want}
-%D \stoptyping
-%D
-%D This macro can be nested without problems and therefore be
-%D used in situations where \PLAIN\ \TEX's \type{\loop} macro
-%D ungracefully fails. The current value of the counter is
-%D available in \type{\recurselevel}, before as well as after
-%D the \typ{whatever we wat} stuff.
-%D
-%D \starttyping
-%D \dorecurse % inner loop
-%D {10}
-%D {\recurselevel: % outer value
-%D \dorecurse % inner loop
-%D {\recurselevel} % outer value
-%D {\recurselevel} % inner value
-%D \dorecurse % inner loop
-%D {\recurselevel} % outer value
-%D {\recurselevel} % inner value
-%D \endgraf}
-%D \stoptyping
-%D
-%D In this example the first, second and fourth
-%D \type{\recurselevel} concern the outer loop, while the third
-%D and fifth one concern the inner loop. The depth of the
-%D nesting is available for inspection in \type{\recursedepth}.
-%D
-%D Both \type{\recurselevel} and \type{\recursedepth} are
-%D macros. The real \COUNTERS\ are hidden from the user because
-%D we don't want any interference.
-
-\newcount\outerrecurse
-\newcount\innerrecurse
-
-\def\recursedepth{\the\outerrecurse}
-\def\recurselevel{0}
-
-\let\nextrecurse\relax
-
-%D Acceptable:
-%D
-%D \starttyping
-%D \long\def\dostepwiserecurse#1#2#3%
-%D {\let\nextrecurse\gobblefourarguments
-%D \ifnum#3>0\relax\ifnum#2<#1\relax\else
-%D \def\nextrecurse{\dosetstepwiserecurse>}%
-%D \fi\fi
-%D \ifnum#3<0\relax\ifnum#1<#2\relax\else
-%D \def\nextrecurse{\dosetstepwiserecurse<}%
-%D \fi\fi
-%D \nextrecurse{#1}{#2}{#3}}
-%D \stoptyping
-%D
-%D Better:
-%D
-%D \starttyping
-%D \long\def\dostepwiserecurse#1#2#3%
-%D {\let\nextrecurse\gobblefourarguments
-%D \ifnum#3>0\relax \ifnum#2<#1\relax \else
-%D \def\nextrecurse{\dosetstepwiserecurse>}%
-%D \fi \else \ifnum#3<0\relax \ifnum#1<#2\relax \else
-%D \def\nextrecurse{\dosetstepwiserecurse<}%
-%D \fi \fi \fi
-%D \nextrecurse{#1}{#2}{#3}}
-%D
-%D \def\@@irecurse{@@irecurse} % stepper
-%D \def\@@nrecurse{@@nrecurse} % number of steps
-%D \def\@@srecurse{@@srecurse} % step
-%D \def\@@drecurse{@@drecurse} % direction, < or >
-%D \def\@@arecurse{@@arecurse} % action
-%D
-%D \long\def\dosetstepwiserecurse#1#2#3#4#5%
-%D {\global\advance\outerrecurse 1
-%D \setevalue{\@@drecurse\recursedepth}{#1}%
-%D \setevalue{\@@irecurse\recursedepth}{\number#2}%
-%D \setevalue{\@@nrecurse\recursedepth}{\number#3}%
-%D \setevalue{\@@srecurse\recursedepth}{\number#4}%
-%D \long\setvalue{\@@arecurse\recursedepth}{#5}%
-%D \dodorecurse}
-%D
-%D \def\donorecurse
-%D {}
-%D
-%D \def\dododorecurse
-%D {\edef\recurselevel{\csname\@@irecurse\recursedepth\endcsname}%
-%D \getvalue{\@@arecurse\recursedepth}%
-%D \edef\recurselevel{\csname\@@irecurse\recursedepth\endcsname}%
-%D \innerrecurse\recurselevel
-%D \advance\innerrecurse \csname\@@srecurse\recursedepth\endcsname
-%D \setevalue{\@@irecurse\recursedepth}{\the\innerrecurse}%
-%D \dodorecurse}
-%D
-%D \def\dodorecurse
-%D {\ifnum\csname\@@irecurse\recursedepth\endcsname
-%D \csname\@@drecurse\recursedepth\endcsname
-%D \csname\@@nrecurse\recursedepth\endcsname\relax
-%D \expandafter\nododorecurse
-%D \else
-%D \expandafter\dododorecurse
-%D \fi}
-%D
-%D \def\nododorecurse
-%D {\global\advance\outerrecurse -1
-%D \edef\recurselevel{\csname\@@irecurse\recursedepth\endcsname}}
-%D \stoptyping
-%D
-%D Cleaner and much faster:
-
-\def\@@irecurse{@@ir@@} % ecurse} % stepper
-\def\@@arecurse{@@ar@@} % ecurse} % action
-
-% \mathchardef
-
-\long\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4
- {\global\advance\outerrecurse \plusone
- \long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname{#4}%
- \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel
- \ifnum#3>0\relax
- \ifnum#2<#1\relax
- \let\nextrecurse\exitstepwiserecurse
- \else
- \let\nextrecurse\dodostepwiserecurse
- \fi
- \else
- \ifnum#3<0\relax
- \ifnum#1<#2\relax
- \let\nextrecurse\exitstepwiserecurse
- \else
- \let\nextrecurse\dodostepwisereverse
- \fi
- \else
- \let\nextrecurse\exitstepwiserecurse
- \fi
- \fi\expanded{\nextrecurse{\number#1}{\number#2}{\number#3}}}
-
-\beginETEX \numexpr
-
-\long\def\dodostepwiserecurse#1#2#3% from to step
- {\ifnum#1>#2\relax
- \@EA\nodostepwiserecurse
- \else
- \def\recurselevel{#1}%
- \@EAEAEA\redostepwiserecurse\@EA
- \fi\@EA{\the\numexpr\recurselevel+#3\relax}{#2}{#3}}
-
-\endETEX
-
-\beginTEX
-
-\long\def\dodostepwiserecurse#1#2#3% from to step
- {\ifnum#1>#2\relax
- \@EA\nodostepwiserecurse
- \else
- \def\recurselevel{#1}%
- \innerrecurse#1\advance\innerrecurse#3\relax
- \@EAEAEA\redostepwiserecurse\@EA
- \fi\@EA{\the\innerrecurse}{#2}{#3}}
-
-\endTEX
-
-\def\expandrecursecontent
- {\csname\@@arecurse\recursedepth\endcsname}
-
-\def\redostepwiserecurse
- {\expandrecursecontent\dodostepwiserecurse}
-
-\beginETEX \numexpr
-
-\long\def\dodostepwisereverse#1#2#3% from to step
- {\ifnum#1<#2\relax
- \@EA\nodostepwiserecurse
- \else
- \def\recurselevel{#1}%
- \@EAEAEA\redostepwisereverse\@EA
- \fi\@EA{\the\numexpr\recurselevel#3\relax}{#2}{#3}}
-
-\endETEX
-
-\beginTEX
-
-\long\def\dodostepwisereverse#1#2#3% from to step
- {\ifnum#1<#2\relax
- \@EA\nodostepwiserecurse
- \else
- \def\recurselevel{#1}%
- \innerrecurse#1\relax
- \advance\innerrecurse#3\relax
- \@EAEAEA\redostepwisereverse\@EA
- \fi\@EA{\the\innerrecurse}{#2}{#3}}
-
-\endTEX
-
-\def\redostepwisereverse
- {\expandrecursecontent\dodostepwisereverse}
-
-\def\exitstepwiserecurse
- {\nodostepwiserecurse\relax}
-
-\def\nodostepwiserecurse#1#2#3#4%
- {\@EA\let\@EA\recurselevel\csname\@@irecurse\recursedepth\endcsname
- \global\advance\outerrecurse \minusone}
-
-\def\nonostepwiserecurse#1#2#3%
- {\@EA\let\@EA\recurselevel\csname\@@irecurse\recursedepth\endcsname
- \global\advance\outerrecurse \minusone}
-
-\def\dorecurse#1%
- {\dostepwiserecurse1{#1}1}
-
-%D As we can see here, the simple command \type{\dorecurse} is
-%D a special case of the more general:
-%D
-%D \starttyping
-%D \dostepwiserecurse {from} {to} {step} {action}
-%D \stoptyping
-%D
-%D This commands accepts positive and negative steps. Illegal
-%D values are handles as good as possible and the macro accepts
-%D numbers and \COUNTERS.
-%D
-%D \starttyping
-%D \dostepwiserecurse {1} {10} {2} {...}
-%D \dostepwiserecurse {10} {1} {-2} {...}
-%D \stoptyping
-%D
-%D Because the simple case is used often, we implement it
-%D more efficiently:
-
-\long\def\dorecurse#1%
- {\ifcase#1\relax
- \expandafter\gobbletwoarguments
- \or
- \expandafter\ydorecurse
- \else
- \expandafter\xdorecurse
- \fi{#1}}
-
-\long\def\xdorecurse#1#2%
- {\global\advance\outerrecurse \plusone
- \long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname{#2}%
- \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel
- \@EA\dodorecurse\@EA1\@EA{\number#1}}
-
-\long\def\ydorecurse#1#2%
- {\global\advance\outerrecurse \plusone
- \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel
- \let\recurselevel\!!plusone
- #2%
- \@EA\let\@EA\recurselevel\csname\@@irecurse\recursedepth\endcsname
- \global\advance\outerrecurse \minusone}
-
-\beginETEX \numexpr
-
-\long\def\dodorecurse#1#2% from to
- {\ifnum#1>#2\relax
- \@EA\nodorecurse
- \else
- \def\recurselevel{#1}%
- \@EAEAEA\redorecurse
- \fi\@EA{\the\numexpr\recurselevel+\plusone\relax}{#2}}
-
-\endETEX
-
-\beginTEX
-
-\long\def\dodorecurse#1#2% from to
- {\ifnum#1>#2\relax
- \@EA\nodorecurse
- \else
- \def\recurselevel{#1}%
- \innerrecurse#1\advance\innerrecurse\plusone
- \@EAEAEA\redorecurse
- \fi\@EA{\the\innerrecurse}{#2}}
-
-\endTEX
-
-\def\redorecurse
- {\expandrecursecontent\dodorecurse}
-
-\def\nodorecurse#1#2#3%
- {\@EA\let\@EA\recurselevel\csname\@@irecurse\recursedepth\endcsname
- \global\advance\outerrecurse \minusone }
-
-%D \macros
-%D {doloop,exitloop}
-%D
-%D Sometimes loops are not determined by counters, but by
-%D (a combinations of) conditions. We therefore implement a
-%D straightforward loop, which can only be left when we
-%D explictly exit it. Nesting is supported. First we present
-%D a more extensive alternative.
-%D
-%D \starttyping
-%D \doloop
-%D {Some kind of typesetting punishment \par
-%D \ifnum\pageno>100 \exitloop \fi}
-%D \stoptyping
-%D
-%D When needed, one can call for \type{\looplevel} and
-%D \type{\loopdepth}.
-%D
-%D If we write this macros from scratch, we end up with
-%D something like the ones described above:
-%D
-%D \starttyping
-%D \def\@@eloop{@@eloop} % exit
-%D \def\@@iloop{@@iloop} % stepper
-%D \def\@@aloop{@@aloop} % action
-%D
-%D \newcount\outerloop
-%D
-%D \def\loopdepth%
-%D {\the\outerloop}
-%D
-%D \def\exitloop%
-%D {\setevalue{\@@eloop\loopdepth}{0}}
-%D
-%D \long\def\doloop#1%
-%D {\global\advance\outerloop by 1
-%D \setevalue{\@@iloop\loopdepth}{1}%
-%D \setevalue{\@@eloop\loopdepth}{1}%
-%D \long\setvalue{\@@aloop\loopdepth}{#1}%
-%D \dodoloop}
-%D
-%D \def\dodonoloop%
-%D {\global\advance\outerloop by -1\relax}
-%D
-%D \def\dododoloop%
-%D {\edef\looplevel{\getvalue{\@@iloop\loopdepth}}%
-%D \innerrecurse=\looplevel
-%D \advance\innerrecurse by 1
-%D \setevalue{\@@iloop\loopdepth}{\the\innerrecurse}%
-%D \getvalue{\@@aloop\loopdepth}%
-%D \edef\looplevel{\getvalue{\@@iloop\loopdepth}}%
-%D \dodoloop}
-%D
-%D \def\dodoloop%
-%D {\ifnum\getvalue{\@@eloop\loopdepth}=0
-%D \expandafter\dodonoloop
-%D \else
-%D \expandafter\dododoloop
-%D \fi}
-%D
-%D \def\doloop%
-%D {\dostepwiserecurse{1}{\maxdimen}{1}}
-%D
-%D \def\exitloop
-%D {\setvalue{\@@irecurse\recursedepth}{\maxdimen}}
-%D
-%D \def\looplevel{\recurselevel}
-%D \def\loopdepth{\recursedepth}
-%D \stoptyping
-%D
-%D We don't have to declare new counters for \type{\looplevel}
-%D and \type{\loopdepth} because we can use \type{\recurselevel}
-%D and \type{\recursedepth}.
-%D
-%D We prefer however a more byte saving implementation, that
-%D executes of course a bit slower.
-%D
-%D \starttyping
-%D \def\doloop%
-%D {\dostepwiserecurse1\maxdimen1}
-%D
-%D \def\exitloop%
-%D {\letvalue{\@@irecurse\recursedepth}\maxdimen}
-%D \stoptyping
-%D
-%D Although, the next version is faster because it used the
-%D simple loop.
-
-\let\endofloop\donothing
-
-\long\def\doloop#1%
- {\global\advance\outerrecurse \plusone
- \long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname{#1}%
- \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel
- \let\endofloop\dodoloop
- \dodoloop1} % no \plusone else \recurselevel wrong
-
-\beginETEX \numexpr
-
-\long\def\dodoloop#1%
- {\def\recurselevel{#1}%
- \@EA\redoloop\@EA{\the\numexpr\recurselevel+\plusone\relax}}
-
-\endETEX
-
-\beginTEX
-
-\long\def\dodoloop#1%
- {\def\recurselevel{#1}%
- \innerrecurse#1\advance\innerrecurse\plusone
- \@EA\redoloop\@EA{\the\innerrecurse}}
-
-\endTEX
-
-\def\redoloop
- {\expandrecursecontent\endofloop}
-
-\def\nodoloop#1%
- {\let\endofloop\dodoloop % new, permits nested \doloop's
- \@EA\let\@EA\recurselevel\csname\@@irecurse\recursedepth\endcsname
- \global\advance\outerrecurse\minusone}
-
-\def\exitloop % \exitloop quits at end
- {\let\endofloop\nodoloop}
-
-\long\def\exitloopnow#1\endofloop % \exitloopnow quits directly
- {\nodoloop}
-
-%D The loop is executed at least once, so beware of situations
-%D like:
-%D
-%D \starttyping
-%D \doloop {\exitloop some commands}
-%D \stoptyping
-%D
-%D It's just a matter of putting the text into the \type{\if}
-%D statement that should be there anyway, like in:
-%D
-%D \starttyping
-%D \doloop {\ifwhatever \exitloop \else some commands\fi}
-%D \stoptyping
-%D
-%D You can also quit a loop immediately, by using \type
-%D {\exitloopnow} instead. Beware, this is more sensitive
-%D for conditional errors.
-
-%D Krzysztof Leszczynski suggested to provide access to the level by
-%D means of a \type {#1}. I decided to pass the more frequently used
-%D level as \type {#1} and the less favoured depth as \type {#2}. The
-%D intended usage is:
-%D
-%D \starttyping
-%D \dorecurse{3}{\definesymbol[test-#1][xx-#1]}
-%D
-%D \def\test{\dorecurse{3}{\definesymbol[test-##1][xx-##1]}} \test
-%D
-%D \symbol[test-1]\quad\symbol[test-2]\quad\symbol[test-3]
-%D \stoptyping
-%D
-%D Since the hashed arguments are expanded, we don't need tricky
-%D expansion here.
-%D
-%D \starttyping
-%D \dorecurse{3}{\expanded{\definesymbol[test-\recurselevel][xx-\recurselevel]}}
-%D \stoptyping
-
-\def\expandrecursecontent
- {\csname\@@arecurse\recursedepth\@EA\@EA\@EA\endcsname\@EA\@EA\@EA{\@EA\recurselevel\@EA}\@EA{\recursedepth}}
-
-\long\def\xdorecurse#1#2%
- {\global\advance\outerrecurse \plusone
- \long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname##1##2{#2}%
- \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel
- \@EA\dodorecurse\@EA1\@EA{\number#1}}
-
-\long\def\ydorecurse#1#2%
- {\global\advance\outerrecurse \plusone
- \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel
- \let\recurselevel\!!plusone
- \long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname##1##2{#2}%
- \expandrecursecontent
- \@EA\let\@EA\recurselevel\csname\@@irecurse\recursedepth\endcsname
- \global\advance\outerrecurse \minusone}
-
-\long\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4
- {\global\advance\outerrecurse \plusone
- \long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname##1##2{#4}%
- \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel
- \ifnum#3>0\relax
- \ifnum#2<#1\relax
- \let\nextrecurse\exitstepwiserecurse
- \else
- \let\nextrecurse\dodostepwiserecurse
- \fi
- \else
- \ifnum#3<0\relax
- \ifnum#1<#2\relax
- \let\nextrecurse\exitstepwiserecurse
- \else
- \let\nextrecurse\dodostepwisereverse
- \fi
- \else
- \let\nextrecurse\exitstepwiserecurse
- \fi
- \fi\expanded{\nextrecurse{\number#1}{\number#2}{\number#3}}}
-
-\long\def\doloop#1%
- {\global\advance\outerrecurse \plusone
- \long\global\@EA\def\csname\@@arecurse\recursedepth\endcsname##1##2{#1}%
- \global\@EA\let\csname\@@irecurse\recursedepth\endcsname\recurselevel
- \let\endofloop\dodoloop
- \dodoloop1} % no \plusone else \recurselevel wrong
-
-%D For special purposes:
-
-\newcount\fastrecursecounter
-\newcount\lastrecursecounter
-\newcount\steprecursecounter
-
-\def\dofastrecurse#1#2#3#4%
- {\def\fastrecursebody{#4}%
- \fastrecursecounter#1\relax
- \lastrecursecounter#2\relax
- \steprecursecounter#3\relax
- \def\recurselevel{\number\fastrecursecounter}%
- \dodofastrecurse}
-
-\def\resetrecurselevel{\let\recurselevel\!!zerocount}
-
-\def\dodofastrecurse
- {\ifnum\fastrecursecounter>\lastrecursecounter
- % \resetrecurselevel % slows down
- \else
- \fastrecursebody
- \advance\fastrecursecounter\steprecursecounter
- \expandafter\dodofastrecurse
- \fi}
-
-% \appendtoks \resetrecurselevel \to \everydump
-
-\everydump\expandafter{\the\everydump\resetrecurselevel}
-
-%D This alternative looks a bit different and uses a
-%D pseudo counter. When this macro is nested, we have to use
-%D different counters. This time we use keywords.
-%D
-%D \starttyping
-%D \def\alfa{2} \def\beta{100} \def\gamma{3}
-%D
-%D \for \n=55 \to 100 \step 1 \do {... \n ...}
-%D \for \n=\alfa \to \beta \step \gamma \do {... \n ...}
-%D \for \n=\n \to 120 \step 1 \do {... \n ...}
-%D \for \n=120 \to 100 \step -3 \do {... \n ...}
-%D \for \n=55 \to 100 \step 2 \do {... \n ...}
-%D \stoptyping
-%D
-%D Only in the third example we need to predefine \type{\n}.
-%D The use of \type{\od} as a dilimiter would have made nested
-%D use more problematic.
-
-%D Don't use this one, it's kind of obsolete.
-
-\def\for#1=#2\to#3\step#4\do#5%
- {\dostepwiserecurse{#2}{#3}{#4}
- {\let#1\recurselevel#5\let#1\recurselevel}}
-
-%D \macros
-%D {newevery,everyline,EveryLine,EveryPar}
-%D
-%D Lets skip to something quite different. It's common use
-%D to use \type{\everypar} for special purposes. In \CONTEXT\
-%D we use this primitive for locating sidefloats. This means
-%D that when user assignments to \type{\everypar} can interfere
-%D with those of the package. We therefore introduce
-%D \type{\EveryPar}.
-%D
-%D The same goes for \type{\EveryLine}. Because \TEX\ offers
-%D no \type{\everyline} primitive, we have to call for
-%D \type{\everyline} when we are working on a line by line
-%D basis. Just by calling \type{\EveryPar{}} and
-%D \type{\EveryLine{}} we restore the old situation.
-%D
-%D The definition command \type{\DoWithEvery} will be quite
-%D unreadable, so let's first show an implementation that
-%D shows how things are done:
-%D
-%D \starttyping
-%D \newtoks \everyline
-%D \newtoks \oldeveryline
-%D \newif \ifeveryline
-%D
-%D \def\DoWithEvery#1#2#3#4%
-%D {#3\else\edef\next{\noexpand#2={\the#1}}\next\fi
-%D \edef\next{\noexpand#1={\the#2\the\scratchtoks}}\next
-%D #4}
-%D
-%D \def\doEveryLine%
-%D {\DoWithEvery\everyline\oldeveryline\ifeveryline\everylinetrue}
-%D
-%D \def\EveryLine%
-%D {\afterassignment\doEveryLine\scratchtoks}
-%D \stoptyping
-%D
-%D The real implementation is a bit more complicated but we
-%D prefer something more versatile.
-
-% the old one
-%
-% \def\DoWithEvery#1%
-% {\csname if\strippedcsname#1\endcsname \else
-% \edef\next%
-% {\@EA\noexpand\csname old\strippedcsname#1\endcsname=
-% {\the#1}}%
-% \next
-% \fi
-% \edef\next%
-% {\noexpand#1=
-% {\@EA\the\csname old\strippedcsname#1\endcsname\the\scratchtoks}}%
-% \next
-% \csname\strippedcsname#1true\endcsname}
-%
-% \def\dowithevery#1%
-% {\@EA\afterassignment\csname do\strippedcsname#1\endcsname\scratchtoks}
-%
-% \def\newevery#1#2%
-% {\ifx#1\undefined\newtoks#1\fi
-% \ifx#2\relax\else\ifx#2\undefined
-% \@EA\newtoks\csname old\strippedcsname#1\endcsname
-% \@EA\newif \csname if\strippedcsname#1\endcsname
-% \@EA\def \csname do\strippedcsname#2\endcsname{\DoWithEvery#1}%
-% \def#2{\dowithevery#2}%
-% \fi\fi}
-%
-% cleaner and more efficient
-
-%\def\dowithevery#1%
-% {\def\dodowithevery%
-% {\ifcase\csname c\strippedcsname#1\endcsname \expandafter\chardef
-% \csname c\strippedcsname#1\endcsname=1
-% \csname t\strippedcsname#1\endcsname=#1%
-% \fi
-% \edef\next%
-% {#1={\the\csname t\strippedcsname#1\endcsname\the\scratchtoks}}%
-% \next}%
-% \afterassignment\dodowithevery\scratchtoks}
-%
-% more efficient:
-
-\def\dodowithevery#1%
- {\ifcase\csname c\strippedcsname#1\endcsname \expandafter\chardef
- \csname c\strippedcsname#1\endcsname1
- \csname t\strippedcsname#1\endcsname#1%
- \fi
- \edef\next%
- {#1{\the\csname t\strippedcsname#1\endcsname\the\scratchtoks}}%
- \next}
-
-\def\dowithevery#1%
- {\def\next{\dodowithevery#1}%
- \afterassignment\next\scratchtoks}
-
-\bgroup \let\newtoks\relax % plain safe (\outer)
-
-\gdef\newevery#1#2%
- {\ifx#1\undefined\csname newtoks\endcsname#1\fi % plain safe (\outer)
- \ifx#2\relax\else\ifx#2\undefined
- \expandafter\newtoks\csname t\strippedcsname#1\endcsname
- \expandafter\chardef\csname c\strippedcsname#1\endcsname\zerocount
- \def#2{\dowithevery#1}%
- \fi\fi}
-
-\egroup
-
-%D The first \type {\outer} hack is needed to trick \TEX\
-%D into thinking that \type {\newtoks} is no outer macro,
-%D the second hack is needed due to some funny interaction
-%D between outer macros and \type {\if} at expansion time.
-
-%D This one permits definitions like:
-
-\newevery \everypar \EveryPar
-\newevery \everyline \EveryLine
-
-%D and how about:
-
-\newevery \neverypar \NeveryPar
-
-%D Which we're going to use indeed! When the second argument
-%D equals \type {\relax}, the first token list is created
-%D unless it is already defined.
-
-%D Technically spoken we could have used the method we are
-%D going to present in the visual debugger. First we save
-%D the primitive \type{\everypar}:
-%D
-%D \starttyping
-%D \let\normaleverypar=\everypar
-%D \stoptyping
-%D
-%D Next we allocate a \TOKENLIST\ named \type{\everypar},
-%D which means that \type{\everypar} is no longer a primitive
-%D but something like \type{\toks44}.
-%D
-%D \starttyping
-%D \newtoks\everypar
-%D \stoptyping
-%D
-%D Because \TEX\ now executes \type{\normaleverypar} instead
-%D of \type{\everypar}, we are ready to assign some tokens to
-%D this internally known and used \TOKENLIST.
-%D
-%D \starttyping
-%D \normaleverypar={all the things the system wants to do \the\everypar}
-%D \stoptyping
-%D
-%D Where the user can provide his own tokens to be expanded
-%D every time he expects them to expand.
-%D
-%D \starttyping
-%D \everypar={something the user wants to do}
-%D \stoptyping
-%D
-%D We don't use this method because it undoubtly leads to
-%D confusing situations, especially when other packages are
-%D used, but it's this kind of tricks that make \TEX\ so
-%D powerful.
-
-%D \macros
-%D {convertargument,convertcommand,convertvalue}
-%D
-%D Some persistent experimenting led us to the next macro. This
-%D macro converts a parameter or an expanded macro to it's
-%D textual meaning.
-%D
-%D \starttyping
-%D \convertargument ... \to \command
-%D \stoptyping
-%D
-%D For example,
-%D
-%D \starttyping
-%D \convertargument{one \two \three{four}}\to\ascii
-%D \stoptyping
-%D
-%D The resulting macro \type{\ascii} can be written to a file
-%D or the terminal without problems. In \CONTEXT\ we use this
-%D macro for generating registers and tables of contents.
-%D
-%D The second conversion alternative accepts a command:
-%D
-%D \starttyping
-%D \convertcommand\command\to\ascii
-%D \stoptyping
-%D
-%D Both commands accept the prefix \type{\doglobal} for global
-%D assignments.
-
-\beginTEX
-
-\def\doconvertargument#1>{}
-
-\def\convertedcommand
- {\expandafter\doconvertargument\meaning}
-
-\long\def\convertargument#1\to#2%
- {\long\def#2{#1}% saves a restore
- \dodoglobal\edef#2{\convertedcommand#2}}
-
-\long\def\convertcommand#1\to#2%
- {\dodoglobal\edef#2{\convertedcommand#1}}
-
-% no dodoglobal !
-
-\long\def\defconvertedargument#1#2% less sensitive for \to
- {\long\def#1{#2}% saves a restore
- \edef#1{\convertedcommand#1}}
-
-\long\def\defconvertedcommand#1#2% less sensitive for \to
- {\edef#1{\convertedcommand#2}}
-
-\long\def\gdefconvertedargument#1#2% less sensitive for \to
- {\long\gdef#1{#2}% saves a restore
- \xdef#1{\convertedcommand#1}}
-
-\long\def\gdefconvertedcommand#1#2% less sensitive for \to
- {\xdef#1{\convertedcommand#2}}
-
-\endTEX
-
-\def\convertvalue#1\to
- {\expandafter\convertcommand\csname#1\endcsname\to}
-
-\def\defconvertedvalue#1#2% less sensitive for \to
- {\@EA\defconvertedcommand\@EA#1\csname#2\endcsname}
-
-%D \macros
-%D {doifassignmentelse}
-%D
-%D A lot of \CONTEXT\ commands take optional arguments, for
-%D instance:
-%D
-%D \starttyping
-%D \dothisorthat[alfa,beta]
-%D \dothisorthat[first=foo,second=bar]
-%D \dothisorthat[alfa,beta][first=foo,second=bar]
-%D \stoptyping
-%D
-%D Although a combined solution is possible, we prefer a
-%D seperation. The next command takes care of propper
-%D handling of such multi||faced commands.
-%D
-%D \starttyping
-%D \doifassignmentelse {...} {then ...} {else ...}
-%D \stoptyping
-
-% not robust
-%
-% \def\doifassignmentelse%
-% {\doifinstringelse{=}}
-%
-% readable
-%
-% \def\doifassignmentelse#1%
-% {\convertargument#1\to\ascii
-% \doifinstringelse{=}{\ascii}}
-
-\def\doifassignmentelse#1%
- {\convertargument#1\to\ascii
- \doifinstringelse=\ascii}
-
-%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}.
-%D This macro is more robust than the pure \TEX\ one,
-%D something I found out when primitives like \type
-%D {\jobname} were fed (or something undefined).
-
-% command variant: one level expansion !
-
-\beginETEX \detokenize
-
-\long\def\convertargument#1\to#2{\dodoglobal\edef#2{\detokenize{#1}}}
-\long\def\convertcommand #1\to#2{\dodoglobal\edef#2{\@EA\detokenize\@EA{#1}}} % hm, only second is also ok
-
-\long\def\defconvertedargument #1#2{\edef#1{\detokenize {#2}}}
-\long\def\defconvertedcommand #1#2{\edef#1{\detokenize\@EA{#2}}}
-\long\def\edefconvertedargument#1#2{\edef#1{#2}%
- \edef#1{\detokenize\@EA{#1}}}
-\long\def\gdefconvertedargument#1#2{\xdef#1{\detokenize {#2}}}
-\long\def\gdefconvertedcommand #1#2{\xdef#1{\detokenize\@EA{#2}}}
-\long\def\xdefconvertedargument#1#2{\xdef#1{#2}%
- \xdef#1{\detokenize\@EA{#1}}}
-
-\endETEX
-
-%D When you try to convert a primitive command, you'll find
-%D out that the \ETEX\ method fails on for instance \type
-%D {\jobname} in the sense that it returns the filename
-%D instead of just \type {\jobname}. So far this does not
-%D give real problems.
-
-%D This is typically a macro that one comes to after reading
-%D the \TEX book carefully. Even then, the definite solution
-%D was found after rereading the \TEX book. The first
-%D implementation was:
-%D
-%D \starttyping
-%D \def\doconvertargument#1->#2\\\\{#2}
-%D \stoptyping
-%D
-%D The \type{-}, the delimiter \type{\\\\} and the the second
-%D argument are completely redundant.
-
-%D \macros
-%D {showvalue,showargument}
-%D
-%D Two handy macros for testing purposes only:
-
-\def\showvalue#1%
- {\expandafter\show\csname#1\endcsname}
-
-\beginETEX
-
-\def\showvalue#1%
- {\ifcsname#1\endcsname
- \expandafter\show\csname#1\endcsname
- \else
- \show\undefined
- \fi}
-
-\endETEX
-
-\long\def\showargument#1%
- {\defconvertedargument\ascii{#1}\ascii}
-
-%D \macros
-%D {doifmeaningelse}
-%D
-%D We can use both commands in testing, but alas, not all
-%D meanings expand to something \type {->}. This is no problem
-%D in the \ETEX\ implementation, but since we want
-%D compatibility, we need:
-%D
-%D \starttyping
-%D \doifmeaningelse {\next} {\something} {true} {false}
-%D \stoptyping
-%D
-%D Watch the one level expansion of the second argument.
-
-\def\doifmeaningelse#1#2%
- {\edef\!!stringa{\meaning#1}%
- \def\!!stringb{#2}\edef\!!stringb{\meaning\!!stringb}%
- \ifx\!!stringa\!!stringb
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-%D \macros
-%D {doifsamestringselse,doifsamestring,doifnotsamestring}
-%D
-%D The next comparison macro converts the arguments into
-%D expanded strings. This command can be used to compare for
-%D instance \type {\jobname} with a name stored in a macro.
-
-\def\@@doifsamestringelse#1#2%
- {\edef\!!stringa{#1}%
- \edef\!!stringb{#2}%
- \convertcommand\!!stringa\to\!!stringa
- \convertcommand\!!stringb\to\!!stringb
- \ifx\!!stringa\!!stringb}
-
-\def\doifsamestringelse#1#2%
- {\@@doifsamestringelse{#1}{#2}%
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\def\doifsamestring#1#2%
- {\@@doifsamestringelse{#1}{#2}%
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\def\doifnotsamestring#1#2%
- {\@@doifsamestringelse{#1}{#2}%
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-%D \macros
-%D {ExpandFirstAfter,ExpandSecondAfter,ExpandBothAfter}
-%D
-%D These three commands support expansion of arguments before
-%D executing the commands that uses them. We can best
-%D illustrate this with an example.
-%D
-%D \starttyping
-%D \def\first {alfa,beta,gamma}
-%D \def\second {alfa,epsilon,zeta}
-%D
-%D \ExpandFirstAfter \doifcommon {\first} {alfa} {\message{OK}}
-%D \ExpandSecondAfter \doifcommon {alfa} {\second} {\message{OK}}
-%D \ExpandBothAfter \doifcommon {\first} {\second} {\message{OK}}
-%D
-%D \ExpandFirstAfter\processcommalist[\first]\message
-%D
-%D \ExpandAfter \doifcommon {\first} {alfa} {\message{OK}}
-%D \stoptyping
-%D
-%D The first three calls result in the threefold message
-%D \type{OK}, the fourth one shows the three elements of
-%D \type{\first}. The command \type{\ExpandFirstAfter} takes
-%D care of (first) arguments that are delimited by \type{[ ]},
-%D but the faster \type{\ExpandAfter} does not.
-
-\def\simpleExpandFirstAfter#1%
- {\long\xdef\@@expanded{\noexpand\ExpandCommand{#1}}\@@expanded}
-
-\def\complexExpandFirstAfter[#1]%
- {\long\xdef\@@expanded{\noexpand\ExpandCommand[#1]}\@@expanded}
-
-\def\ExpandFirstAfter#1%
- {\let\ExpandCommand#1%
- \doifnextoptionalelse\complexExpandFirstAfter\simpleExpandFirstAfter}
-
-\def\ExpandSecondAfter#1#2#3%
- {\scratchtoks{#2}%
- \long\xdef\@@expanded{\noexpand#1{\the\scratchtoks}{#3}}\@@expanded}
-
-\def\ExpandBothAfter#1#2#3%
- {\long\xdef\@@expanded{\noexpand#1{#2}{#3}}\@@expanded}
-
-\def\ExpandAfter#1#2%
- {\long\xdef\@@expanded{\noexpand#1{#2}}\@@expanded}
-
-%D Now we can for instance define \type{\ifinstringelse} as:
-
-\def\ifinstringelse
- {\ExpandBothAfter\p!doifinstringelse}
-
-%D \macros
-%D {ConvertToConstant,ConvertConstantAfter}
-%D
-%D When comparing arguments with a constant, we can get into
-%D trouble when this argument consists of tricky expandable
-%D commands. One solution for this is converting the
-%D argument to a string of unexpandable characters. To make
-%D comparison possible, we have to convert the constant too
-%D
-%D \starttyping
-%D \ConvertToConstant\doifelse {...} {...} {then ...} {else ...}
-%D \stoptyping
-%D
-%D This construction is only needed when the first argument
-%D can give troubles. Misuse can slow down processing.
-%D
-%D \starttyping
-%D \ConvertToConstant\doifelse{\c!alfa} {\c!alfa}{...}{...}
-%D \ConvertToConstant\doifelse{alfa} {\c!alfa}{...}{...}
-%D \ConvertToConstant\doifelse{alfa} {alfa} {...}{...}
-%D \ConvertToConstant\doifelse{alfa \alfa test}{\c!alfa}{...}{...}
-%D \stoptyping
-%D
-%D In examples~2 and~3 both arguments equal, in~1 and~4
-%D they differ.
-
-\beginTEX
-
-\long\def\ConvertToConstant#1#2#3%
- {\expandafter\defconvertedargument\expandafter\!!stringa\expandafter{#2}%
- \expandafter\defconvertedargument\expandafter\!!stringb\expandafter{#3}%
- #1{\!!stringa}{\!!stringb}}
-
-\endTEX
-
-\beginETEX \detokenize
-
-\long\def\ConvertToConstant#1#2#3%
- {\edef\!!stringa{\expandafter\detokenize\expandafter{#2}}%
- \edef\!!stringb{\expandafter\detokenize\expandafter{#3}}%
- #1{\!!stringa}{\!!stringb}}
-
-\endETEX
-
-%D When the argument \type{#1} consists of commands, we had
-%D better use
-%D
-%D \starttyping
-%D \ConvertConstantAfter\processaction[#1][...]
-%D \ConvertConstantAfter\doifelse{#1}{\v!something}{}{}
-%D \stoptyping
-%D
-%D This commands accepts things like:
-%D
-%D \starttyping
-%D \v!constant
-%D constant
-%D \hbox to \hsize{\rubish}
-%D \stoptyping
-%D
-%D As we will see in the core modules, this macro permits
-%D constructions like:
-%D
-%D \starttyping
-%D \setupfootertexts[...][...]
-%D \setupfootertexts[margin][...][...]
-%D \setupfootertexts[\v!margin][...][...]
-%D \stoptyping
-%D
-%D where \type{...} can be anything legally \TEX.
-
-\def\CheckConstantAfter#1#2%
- {\@EA\convertargument\v!prefix!\to\ascii
- \convertargument#1\to#2\relax
- \doifinstringelse\ascii{#2}
- {\expandafter\convertargument#1\to#2}
- {}}
-
-\def\ConvertConstantAfter#1#2#3%
- {\CheckConstantAfter{#2}\asciia
- \CheckConstantAfter{#3}\asciib
- #1{\asciia}{\asciib}}
-
-%D \macros
-%D {assignifempty}
-%D
-%D We can assign a default value to an empty macro using:
-%D
-%D \starttyping
-%D \assignifempty \macros {default value}
-%D \stoptyping
-%D
-%D We don't explicitly test if the macro is defined.
-
-\def\assignifempty#1#2% can be sped up
- {\doifsomething{#1}{\def#1{#2}}} % {\doifnot{#1}{}{\def#1{#2}}}
-
-%D \macros
-%D {gobbleuntil,grabuntil,gobbleuntilrelax,
-%D processbetween,processuntil}
-%D
-%D In \TEX\ gobbling usually stand for skipping arguments, so
-%D here are our gobbling macros.
-%D
-%D In \CONTEXT\ we use a lot of \type{\start}||\type{\stop}
-%D like constructions. Sometimes, the \type{\stop} is used as a
-%D hard coded delimiter like in:
-%D
-%D \starttyping
-%D \def\startcommand#1\stopcommand%
-%D {... #1 ...}
-%D \stoptyping
-%D
-%D In many cases the \type{\start}||\type{\stop} pair is
-%D defined at format generation time or during a job. This
-%D means that we cannot hardcode the \type{\stop} criterium.
-%D Only after completely understanding \type{\csname} and
-%D \type{\expandafter} I was able to to implement a solution,
-%D starting with:
-%D
-%D \starttyping
-%D \grabuntil{stop}\command
-%D \stoptyping
-%D
-%D This commands executes, after having encountered
-%D \type {\stop} the command \type {\command}. This command
-%D receives as argument the text preceding the \type {\stop}.
-%D This means that:
-%D
-%D \starttyping
-%D \def\starthello%
-%D {\grabuntil{stophello}\message}
-%D
-%D \starthello Hello world!\stophello
-%D \stoptyping
-%D
-%D results in: \type{\message{Hello world!}}.
-
-\def\dograbuntil#1#2%
- {\long\def\next##1#1{#2{##1}}\next}
-
-\def\grabuntil#1%
- {\expandafter\dograbuntil\expandafter{\csname#1\endcsname}}
-
-%D The next command build on this mechanism:
-%D
-%D \starttyping
-%D \processbetween{string}\command
-%D \stoptyping
-%D
-%D Here:
-%D
-%D \starttyping
-%D \processbetween{hello}\message
-%D \starthello Hello again!\stophello
-%D \stoptyping
-%D
-%D leads to: \type{\message{Hello again!}}. The command
-%D
-%D \starttyping
-%D \gobbleuntil{sequence}
-%D \stoptyping
-%D
-%D is related to these commands. This one simply throws away
-%D everything preceding \type{\command}.
-
-\long\def\processbetween#1#2%
- {\setvalue{\s!start#1}{\grabuntil{\s!stop#1}{#2}}}
-
-\def\gobbleuntil#1%
- {\long\def\next##1#1{}\next}
-
-\def\gobbleuntilrelax#1\relax
- {}
-
-%D The next one simply expands the pickup up tokens.
-%D
-%D \starttyping
-%D \processuntil{sequence}
-%D \stoptyping
-
-\def\processuntil#1%
- {\long\def\next##1#1{##1}\next}
-
-%D \macros
-%D {groupedcommand}
-%D
-%D Commands often manipulate argument as in:
-%D
-%D \starttyping
-%D \def\doezomaarwat#1{....#1....}
-%D \stoptyping
-%D
-%D A disadvantage of this approach is that the tokens that
-%D form \type{#1} are fixed the the moment the argument is read
-%D in. Normally this is no problem, but for instance verbatim
-%D environments adapt the \CATCODES\ of characters and therefore
-%D are not always happy with already fixed tokens.
-%D
-%D Another problem arises when the argument is grouped not by
-%D \type{{}} but by \type{\bgroup} and \type{\egroup}. Such an
-%D argument fails, because the \type{\bgroup} is een as the
-%D argument (which is quite normal).
-%D
-%D The next macro offers a solution for both unwanted
-%D situations:
-%D
-%D \starttyping
-%D \groupedcommand {before} {after}
-%D \stoptyping
-%D
-%D Which can be used like:
-%D
-%D \starttyping
-%D \def\cite%
-%D {\groupedcommand{\rightquote\rightquote}{\leftquote\leftquote}}
-%D \stoptyping
-%D
-%D This command is equivalent to, but more 'robust' than:
-%D
-%D \starttyping
-%D \def\cite#1%
-%D {\rightquote\rightquote#1\leftquote\leftquote}
-%D \stoptyping
-%D
-%D One should say that the next implementation would suffice:
-%D
-%D \starttyping
-%D \def\groupedcommand#1#2%
-%D {\def\BeforeGroup{#1\ignorespaces}%
-%D \def\AfterGroup{\unskip#2\egroup}%
-%D \bgroup\bgroup
-%D \aftergroup\AfterGroup
-%D \afterassignment\BeforeGroup
-%D \let\next=}
-%D \stoptyping
-%D
-%D It did indeed, but one day we decided to support the
-%D processing of boxes too:
-%D
-%D \starttyping
-%D \def\rightword%
-%D {\groupedcommand{\hfill\hbox}{\parfillskip\!!zeropoint}}
-%D
-%D .......... \rightword{the right way}
-%D \stoptyping
-%D
-%D Here \TEX\ typesets \type{\bf the right way} unbreakable
-%D at the end of the line. The solution mentioned before does
-%D not work here.
-%D
-%D \starttyping
-%D \long\unexpanded\def\groupedcommand#1#2%
-%D {\bgroup
-%D \long\def\BeforeGroup%
-%D {\bgroup#1\bgroup\aftergroup\AfterGroup}%
-%D \long\def\AfterGroup%
-%D {#2\egroup\egroup}%
-%D \afterassignment\BeforeGroup
-%D \let\next=}
-%D \stoptyping
-%D
-%D We used this method some time until the next alternative
-%D was needed. From now on we support both
-%D
-%D \starttyping
-%D to be \bold{bold} or not, that's the question
-%D \stoptyping
-%D
-%D and
-%D
-%D \starttyping
-%D to be {\bold bold} or not, that's the question
-%D \stoptyping
-%D
-%D This alternative checks for a \type{\bgroup} token first.
-%D The internal alternative does not accept the box handling
-%D mentioned before, but further nesting works all right. The
-%D extra \type{\bgroup}||\type{\egroup} is needed to keep
-%D \type{\AfterGroup} both into sight and local.
-
-\long\def\HandleGroup#1#2%
- {\bgroup
- \long\def\BeforeGroup{\bgroup#1\bgroup\aftergroup\AfterGroup}%
- \long\def\AfterGroup {#2\egroup\egroup}%
- \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}
-
-%D These macros come together in:
-%D
-%D \starttyping
-%D \long\unexpanded\def\groupedcommand#1#2%
-%D {\def\dogroupedcommand%
-%D {\ifx\next\bgroup
-%D \let\next=\HandleGroup
-%D \else
-%D \let\next=\HandleNoGroup
-%D \fi
-%D \next{#1}{#2}}%
-%D \futurelet\next\dogroupedcommand}
-%D \stoptyping
-%D
-%D From the missing paragraph number one can deduce that the
-%D last macro is not the real one yet. I considered it a
-%D nuisance that
-%D
-%D \starttyping
-%D \color[green]
-%D {as grass}
-%D \stoptyping
-%D
-%D was not interpreted as one would expect. This is due to the
-%D fact that \type{\futurelet} obeys blank spaces, and a
-%D line||ending token is treated as a blank space. So the final
-%D implementation became:
-
-%\long\unexpanded\def\groupedcommand#1#2%
-% {\bgroup
-% \def\dogroupedcommand%
-% {\ifx\next\bgroup
-% \def\\{\egroup\HandleGroup{#1}{#2}}%
-% \else\ifx\next\blankspace
-% \def\\ {\egroup\groupedcommand{#1}{#2}}%
-% \else
-% \def\\{\egroup\HandleNoGroup{#1}{#2}}%
-% \fi\fi
-% \\}%
-% \futurelet\next\dogroupedcommand}
-%
-% compatible ?
-
-\long\unexpanded\def\groupedcommand#1#2%
- {\doifnextbgroupelse{\HandleGroup{#1}{#2}}{\HandleNoGroup{#1}{#2}}}
-
-\long\unexpanded\def\simplegroupedcommand#1#2%
- {\doifnextbgroupelse{\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
-%D explictly close the paragraph with \type{\par}, else the
-%D settings will be forgotten and not applied. So it's:
-%D
-%D \starttyping
-%D \def\BoldRaggedCenter%
-%D {\groupedcommand{\raggedcenter\bf}{\par}}
-%D \stoptyping
-
-%D \macros
-%D {checkdefined}
-%D
-%D The bigger the system, the greater the change that
-%D user defined commands collide with those that are part of
-%D the system. The next macro gives a warning when a command is
-%D already defined. We considered blocking the definition, but
-%D this is not always what we want.
-%D
-%D \starttyping
-%D \checkdefined {category} {class} {command}
-%D \stoptyping
-%D
-%D The user is warned with the suggestion to use
-%D \type{CAPITALS}. This suggestion is feasible, because
-%D \CONTEXT only defines lowcased macros.
-
-\def\showdefinederror#1#2%
- {\writestatus\m!systems{#1 #2 replaces a macro, use CAPITALS!}}
-
-\def\checkdefined#1#2#3%
- {\doifdefined{#3}{\showdefinederror{#2}{#3}}}
-
-%D \macros
-%D {GotoPar,GetPar}
-%D
-%D Typesetting a paragraph in a special way can be done by
-%D first grabbing the contents of the paragraph and processing
-%D this contents grouped. The next macro for instance typesets
-%D a paragraph in boldface.
-%D
-%D \starttyping
-%D \def\remark#1\par%
-%D {\bgroup\bf#1\egroup}
-%D \stoptyping
-%D
-%D This macro has to be called like
-%D
-%D \starttyping
-%D \remark some text ... ending with \par
-%D \stoptyping
-%D
-%D Instead of \type{\par} we can of course use an empty line.
-%D When we started typesetting with \TEX, we already had
-%D produced lots of text in plain \ASCII. In producing such
-%D simple formatted texts, we adopted an open layout, and when
-%D switching to \TEX, we continued this open habit. Although
-%D \TEX\ permits a cramped and badly formatted source, it adds
-%D to confusion and sometimes introduces errors. So we prefer:
-%D
-%D \starttyping
-%D \remark
-%D
-%D some text ... ending with an empty line
-%D \stoptyping
-%D
-%D We are going to implement a mechanism that allows such open
-%D specifications. The definition of the macro handling
-%D \type{\remark} becomes:
-%D
-%D \starttyping
-%D \def\remark%
-%D {\BeforePar{\bgroup\bf}%
-%D \AfterPar{\egroup}%
-%D \GetPar}
-%D \stoptyping
-%D
-%D A macro like \type{\GetPar} can be defined in several
-%D ways. The recent version, the fourth one in a row,
-%D originally was far more complicated, but some functionality
-%D has been moved to other macros.
-%D
-%D We start with the more simple but in some cases more
-%D appropriate alternative is \type{\GotoPar}. This one leaves
-%D \type{\par} unchanged and is therefore more robust. On the
-%D other hand, \type{\AfterPar} is not supported.
-
-\newtoks\BeforePar
-\newtoks\AfterPar
-
-\let\endoflinetoken=^^M
-
-%D The original definition was:
-%D
-%D \starttyping
-%D \def\doGotoPar
-%D {\ifx\nextchar\blankspace
-%D \@EA\GotoPar
-%D \else\ifx\nextchar\endoflinetoken
-%D \@EAEAEA\GotoPar
-%D \else
-%D \@EAEAEA\dodoGotoPar
-%D \fi\fi}
-%D
-%D \def\dodoGotoPar
-%D {\the\BeforePar
-%D \BeforePar\emptytoks
-%D \nextchar}
-%D
-%D \def\GotoPar
-%D {\afterassignment\doGotoPar\let\nextchar=}
-%D \stoptyping
-
-%D Its big brother \type{\GetPar} redefines the \type{\par}
-%D primitive, which can lead to unexpected results, depending
-%D in the context.
-%D
-%D \starttyping
-%D \def\GetPar
-%D {\expanded
-%D {\BeforePar
-%D {\the\BeforePar
-%D \BeforePar\emptytoks
-%D \bgroup
-%D \def\par
-%D {\egroup
-%D \par
-%D \the\AfterPar
-%D \BeforePar\emptytoks
-%D \AfterPar\emptytoks}}}%
-%D \GotoPar}
-%D \stoptyping
-
-%D However, we can implement a better alternative by using:
-%D
-%D \starttyping
-%D \def\dowithpar#1#2%
-%D {\def\handlepar##1\par{#1##1#2}%
-%D \def\gobblepar\par{\dowithpar{#1}{#2}}%
-%D \doifnextcharelse\par\gobblepar\handlepar}
-%D \stoptyping
-%D
-%D Or, nicer
-
-\def\redowithpar\par
- {\doifnextcharelse\par\redowithpar\dodowithpar}%
-
-\def\dowithpar#1#2%
- {\def\dodowithpar##1\par{#1##1#2}%
- \redowithpar\par}
-
-\def\redogotopar\par
- {\doifnextcharelse\par\redogotopar\dodogotopar}%
-
-\def\dogotopar#1%
- {\def\dodogotopar{#1}%
- \redogotopar\par}
-
-%D The previosuly defined macros now become:
-
-\def\GetPar
- {\expanded
- {\dowithpar
- {\the\BeforePar
- \BeforePar\emptytoks}
- {\the\AfterPar
- \BeforePar\emptytoks
- \AfterPar\emptytoks}}}
-
-\def\GotoPar
- {\expanded
- {\dogotopar
- {\the\BeforePar
- \BeforePar\emptytoks}}}
-
-%D \macros
-%D {dowithpargument,dowithwargument}
-%D
-%D The next macros are a variation on \type{\GetPar}. When
-%D macros expect an argument, it interprets a grouped sequence
-%D of characters a one token. While this adds to robustness and
-%D less ambiguous situations, we sometimes want to be a bit
-%D more flexible, or at least want to be a bit more tolerant
-%D to user input.
-%D
-%D We start with a commands that acts on paragraphs. This
-%D command is called as:
-%D
-%D \starttyping
-%D \dowithpargument\command
-%D \dowithpargument{\command ... }
-%D \stoptyping
-%D
-%D In \CONTEXT\ we use this one to read in the titles of
-%D chapters, sections etc. The commands responsible for these
-%D activities accept several alternative ways of argument
-%D passing. In these examples, the \type{\par} can be omitted
-%D when an empty line is present.
-%D
-%D \starttyping
-%D \command{...}
-%D \command ... \par
-%D \command
-%D {...}
-%D \command
-%D ... \par
-%D \stoptyping
-%D
-%D We show two implementations, of which for the moment the
-%D we prefier to use the second one:
-%D
-%D \starttyping
-%D \def\dowithpargument#1%
-%D {\def\dodowithpargument%
-%D {\ifx\next\bgroup
-%D \def\next{#1}%
-%D \else
-%D \def\next####1 \par{#1{####1}}%
-%D \fi
-%D \next}%
-%D \futurelet\next\dodowithpargument}
-%D \stoptyping
-%D
-%D A second and better implementation was:
-%D
-%D \starttyping
-%D \def\dowithpargument#1%
-%D {\def\nextpar##1 \par{#1{##1}}%
-%D \def\nextarg##1{#1{##1}}%
-%D \doifnextcharelse\bgroup
-%D {\nextarg}
-%D {\nextpar}}
-%D \stoptyping
-%D
-%D We ended up with an alternative that also accepts en empty
-%D argument. This command permits for instance chapters to
-%D have no title.
-
-%\def\dowithpargument#1%
-% {\def\nextpar##1 \par{#1{##1}}%
-% \def\nextarg##1{#1{##1}}%
-% \doifnextcharelse\bgroup
-% {\nextarg}
-% {\doifnextcharelse{\par}
-% {#1{}}
-% {\nextpar}}}
-
-\def\dowithpargument#1%
- {\def\nextpar##1 \par{#1{##1}}%
- \def\nextarg##1{#1{##1}}%
- \doifnextbgroupelse\nextarg{\doifnextcharelse\par{#1{}}\nextpar}}
-
-%D The \type{p} in the previous command stands for paragraph.
-%D When we want to act upon words we can use the \type{w}
-%D alternative.
-%D
-%D \starttyping
-%D \dowithwargument\command
-%D \dowithwargument{... \command ...}
-%D \stoptyping
-%D
-%D The main difference bwteen two alternatives is in the
-%D handling of \type{\par}'s. This time the space token acts
-%D as a delimiter.
-%D
-%D \starttyping
-%D \command{...}
-%D \command ...
-%D \command
-%D {...}
-%D \command
-%D ...
-%D \stoptyping
-%D
-%D Again there are two implementations possible:
-%D
-%D \starttyping
-%D \def\dowithwargument#1%
-%D {\def\dodowithwargument%
-%D {\ifx\next\bgroup
-%D \def\next{#1}%
-%D \else
-%D \def\next####1 {#1{####1}}%
-%D \fi
-%D \next}%
-%D \futurelet\next\dodowithwargument}
-%D \stoptyping
-%D
-%D We've chosen:
-
-%\def\dowithwargument#1%
-% {\def\nextwar##1 {#1{##1}}%
-% \def\nextarg##1{#1{##1}}%
-% \doifnextcharelse\bgroup
-% {\nextarg}
-% {\nextwar}}
-
-\def\dowithwargument#1%
- {\def\nextwar##1 {#1{##1}}%
- \def\nextarg##1{#1{##1}}%
- \doifnextbgroupelse\nextarg\nextwar}
-
-%D \macros
-%D {dorepeat,dorepeatwithcommand}
-%D
-%D When doing repetitive tasks, we stromgly advice to use
-%D \type{\dorecurse}. The next alternative however, suits
-%D better some of the \CONTEXT\ interface commands.
-%D
-%D \starttyping
-%D \dorepeat[n*\command]
-%D \stoptyping
-%D
-%D The value of the used \COUNTER\ can be called within
-%D \type{\command} by \type{\repeater}.
-%D
-%D A slightly different alternative is:
-%D
-%D \starttyping
-%D \dorepeatwithcommand[n*{...}]\command
-%D \stoptyping
-%D
-%D When we call for something like:
-%D
-%D \starttyping
-%D \dorepeatwithcommand[3*{Hello}]\message
-%D \stoptyping
-%D
-%D we get ourselves three \type{\message{Hello}} messages in
-%D a row. In both commands, the \type{n*} is optional. When this
-%D specification is missing, the command executes once.
-
-% this one is obsolete:
-
-\def\dorepeat[#1]%
- {\dodorepeat#1*\empty*\relax}
-
-\long\def\dodorepeat#1*#2#3*#4\relax
- {\ifx#2\empty#1\else\dorecurse{#1}{#2#3}\fi}
-
-\def\repeater
- {\recurselevel}
-
-% this one will be kept
-
-\def\dorepeatwithcommand[#1]%
- {\dodorepeatwithcommand#1*\empty*\relax}
-
-% \long\def\dodorepeatwithcommand#1*#2#3*#4\relax#5%
-% {\ifx#2\empty
-% #5{#1}%
-% \else
-% \dorecurse{#1}{#5{#2#3}}%
-% \fi}
-%
-% more complex but better:
-
-% \long\def\dodorepeatwithcommand#1*#2#3*#4\relax#5%
-% {\ifx#2\empty
-% #5{#1}%
-% \else\ifnum#1<\zerocount
-% % a la etex
-% % \dorecurse{-\numexpr(#1)}{#5{-#2#3}}%
-% % indirect
-% %\innerrecurse#1%
-% %\expanded{\dorecurse{\number-\innerrecurse}}{#5{-#2#3}}%
-% % safer:
-% \bgroup\scratchcounter#1%
-% \expanded{\egroup\noexpand\dorecurse{\number-\scratchcounter}}{#5{-#2#3}}%
-% \else\ifx#2+%
-% \dorecurse{#1}{#5{#3}}%
-% \else
-% \dorecurse{#1}{#5{#2#3}}%
-% \fi\fi\fi}
-
-\def\dorepeatwithcommand[#1]%
- {\dodorepeatwithcommand#1*\empty*\relax}
-
-\long\def\dodorepeatwithcommand#1*#2#3*#4\relax#5%
- {\ifx#2\empty\redorepeatwithcommand[#1]#5\else\dododorepeatwithcommand{#1}{#2}{#3}#5\fi}
-
-\long\def\dododorepeatwithcommand#1#2#3#4%
- {\ifx#2\empty % redundant but gives cleaner extensions
- #4{#1}%
- \else\ifnum#1<\zerocount
- \bgroup\scratchcounter#1%
- \expanded{\egroup\noexpand\dorecurse{\number-\scratchcounter}}{#4{-#2#3}}%
- \else\ifx#2+%
- \dorecurse{#1}{#4{#3}}%
- \else
- \dorecurse{#1}{#4{#2#3}}%
- \fi\fi\fi}
-
-\def\redorepeatwithcommand[#1]#2%
- {#2{#1}}
-
-%D The extension hook permits something like:
-%D
-%D \starttyping
-%D \bgroup
-%D
-%D \catcode`\*=\@@superscript
-%D
-%D \gdef\redorepeatwithcommand[#1]%
-%D {\redodorepeatwithcommand#1*\empty*\relax}
-%D
-%D \long\gdef\redodorepeatwithcommand#1*#2#3*#4\relax#5%
-%D {\dododorepeatwithcommand{#1}{#2}{#3}#5}
-%D
-%D \egroup
-%D \stoptyping
-%D
-%D although one may wonder if changing the catcode of \type {*} is wise.
-
-%D \macros
-%D {normalbgroup,normalgroup}
-%D
-%D No comment.
-
-\let\normalbgroup\bgroup
-\let\normalegroup\egroup
-
-%D \macros
-%D {doifstringinstringelse}
-%D
-%D The next macro is meant for situations where both strings
-%D are macros. This save some unneeded expansion.
-%D
-%D \starttyping
-%D \long\def\doifstringinstringelse#1#2%
-%D {\p!doifinstringelse#1#2%
-%D \@EA\firstoftwoarguments
-%D \else
-%D \@EA\secondoftwoarguments
-%D \fi}
-%D \stoptyping
-%D
-%D A bit faster is:
-
-\def\pp!doifstringinstringelse#1%
- {\if#1@%
- \@EA\secondoftwoarguments
- \else
- \@EA\firstoftwoarguments
- \fi}
-
-\long\def\doifstringinstringelse#1#2%
- {\long\@EA\def\@EA\p!doifstringinstringelse\@EA##\@EA1#1##2##3\war
- {\pp!doifstringinstringelse##2}%
- \@EA\@EA\@EA\p!doifstringinstringelse\@EA#2#1@@\war}
-
-%D \macros
-%D {appendtoks,prependtoks,appendtoksonce,prependtoksonce,
-%D doifintokselse,flushtoks,dotoks}
-%D
-%D We use \TOKENLISTS\ sparsely within \CONTEXT, because the
-%D comma separated lists are more suitable for the user
-%D interface. Nevertheless we have:
-%D
-%D \starttyping
-%D (\doglobal) \appendtoks ... \to\tokenlist
-%D (\doglobal) \prependtoks ... \to\tokenlist
-%D (\doglobal) \flushtoks\tokenlist
-%D \dotoks\tokenlist
-%D \stoptyping
-%D
-%D Er worden eerst enkele klad||registers gedefinieerd. These
-%D macros are clones of the ones implemented in page~378 of
-%D Knuth's \TeX book.
-%D
-%D A simple implementation, one that does not handle braces
-%D at the outer level, is:
-%D
-%D \starttyping
-%D \def\appendtoks#1\to#2%
-%D {\scratchtoks={#1}%
-%D \expanded{\dodoglobal\noexpand#2{\the#2\the\scratchtoks}}}
-%D
-%D \def\prependtoks#1\to#2%
-%D {\scratchtoks={#1}%
-%D \expanded{\dodoglobal\noexpand#2{\the\scratchtoks\the#2}}}
-%D \stoptyping
-%D
-%D But here we prefer:
-
-\newtoks\@@scratchtoks
-
-% before we had the once only alternatives, we had:
-%
-% \def\appendtoks {\doappendtoks \relax}
-% \def\prependtoks{\doprependtoks\relax}
-%
-% \long\def\doappendtoks#1\to#2%
-% {\@@scratchtoks\@EA{\gobbleoneargument#1}%
-% \expanded{\dodoglobal\noexpand#2{\the#2\the\@@scratchtoks}}}
-%
-% \long\def\doprependtoks#1\to#2%
-% {\@@scratchtoks\@EA{\gobbleoneargument#1}%
-% \expanded{\dodoglobal\noexpand#2{\the\@@scratchtoks\the#2}}}
-
-\def\appendtoks {\doappendtoks \relax}
-\def\prependtoks {\doprependtoks \relax}
-\def\appendtoksonce {\doappendtoksonce \relax}
-\def\prependtoksonce{\doprependtoksonce\relax}
-
-% \def\dodoappendtoks#1%
-% {\expanded{\dodoglobal\noexpand#1{\the#1\the\@@scratchtoks}}}
-%
-% \def\dodoprependtoks#1%
-% {\expanded{\dodoglobal\noexpand#1{\the\@@scratchtoks\the#1}}}
-%
-% \long\def\doappendtoks#1\to%
-% {\@@scratchtoks\@EA{\gobbleoneargument#1}\dodoappendtoks}
-%
-% \long\def\doprependtoks#1\to%
-% {\@@scratchtoks\@EA{\gobbleoneargument#1}\dodoprependtoks}
-%
-% \long\def\doappendtoksonce#1\to#2%
-% {\@@scratchtoks\@EA{\gobbleoneargument#1}%
-% \doifintokselse\@@scratchtoks{#2}{}{\dodoappendtoks{#2}}}
-%
-% \long\def\doprependtoksonce#1\to#2%
-% {\@@scratchtoks\@EA{\gobbleoneargument#1}%
-% \doifintokselse\@@scratchtoks{#2}{}{\dodoprependtoks{#2}}}
-%
-% A slightly (but in the case of large arguments
-% significantly) faster alternative is given below:
-
-\newtoks\@@toks
-
-\def\dodoappendtoks
- {\dodoglobal\@@toks\@EAEAEA{\@EA\the\@EA\@@toks\the\@@scratchtoks}}
-
-\def\dodoprependtoks
- {\dodoglobal\@@toks\@EAEAEA{\@EA\the\@EA\@@scratchtoks\the\@@toks}}
-
-\long\def\doappendtoks#1\to#2%
- {\def\@@toks{#2}%
- \@@scratchtoks\@EA{\gobbleoneargument#1}\dodoappendtoks}
-
-\long\def\doprependtoks#1\to#2%
- {\def\@@toks{#2}%
- \@@scratchtoks\@EA{\gobbleoneargument#1}\dodoprependtoks}
-
-\long\def\doappendtoksonce#1\to#2%
- {\def\@@toks{#2}%
- \@@scratchtoks\@EA{\gobbleoneargument#1}%
- \doifintokselse\@@scratchtoks\@@toks\donothing\dodoappendtoks}
-
-\long\def\doprependtoksonce#1\to#2%
- {\def\@@toks{#2}%
- \@@scratchtoks\@EA{\gobbleoneargument#1}%
- \doifintokselse\@@scratchtoks\@@toks\donothing\dodoprependtoks}
-
-%D The test macro:
-%D
-%D \starttyping
-%D \def\doifintokselse#1#2% #1 en #2 zijn toks
-%D {\edef\!!stringa{\the#1}\convertcommand\!!stringa\to\asciia
-%D \edef\!!stringb{\the#2}\convertcommand\!!stringb\to\asciib
-%D \doifinstringelse\asciia\asciib}
-%D \stoptyping
-%D
-%D Better:
-%D
-%D \starttyping
-%D \def\doifintokselse#1#2% #1 en #2 zijn toks
-%D {\edef\!!stringa{\the#1}\convertcommand\!!stringa\to\asciia
-%D \edef\!!stringb{\the#2}\convertcommand\!!stringb\to\asciib
-%D \doifstringinstringelse\asciia\asciib}
-%D \stoptyping
-%D
-%D Even better:
-
-\beginETEX
-
- \def\doifintokselse#1#2% #1 en #2 zijn toks
- {\@EA\convertargument\the#1\to\asciia
- \@EA\convertargument\the#2\to\asciib
- \doifstringinstringelse\asciia\asciib}
-
-\endETEX
-
-\beginTEX
-
- \def\doifintokselse#1#2% #1 en #2 zijn toks
- {\edef\asciia{\the#1}\convertcommand\asciia\to\asciia
- \edef\asciib{\the#2}\convertcommand\asciib\to\asciib
- \doifstringinstringelse\asciia\asciib}
-
-\endTEX
-
-%D Also:
-
-\def\appendetoks #1\to{\expanded{\appendtoks #1}\to}
-\def\prependetoks#1\to{\expanded{\prependtoks#1}\to}
-
-%D Hm.
-
-\def\flushtoks#1% nb: can reassing to #1 again, hence the indirectness
- {\@@scratchtoks#1\relax
- \dodoglobal#1\emptytoks
- \the\@@scratchtoks\relax}
-
-\let\dotoks\the
-
-%D \macros
-%D {makecounter,pluscounter,minuscounter,
-%D resetcounter,setcounter,countervalue}
-%D
-%D Declaring, setting and resetting \COUNTERS\ can be doen
-%D with the next set of commands.
-%D
-%D \starttyping
-%D \makecounter {name}
-%D \pluscounter {name}
-%D \minuscounter {name}
-%D \resetcounter {name}
-%D \setcounter {name} {value}
-%D \countervalue {name}
-%D \stoptyping
-%D
-%D We prefer the use of global counters. This means that we
-%D have to load \PLAIN\ \TEX\ in a bit different way:
-%D
-%D \starttyping
-%D \let\oldouter=\outer
-%D \let\outer=\relax
-%D \input plain.tex
-%D \let\outer=\oldouter
-%D
-%D \def\newcount%
-%D {\alloc@0\count\countdef\insc@unt}
-%D \stoptyping
-%D
-%D First we show a solution in which we use real \COUNTERS.
-%D Apart from some expansion, nothing special is done.
-%D
-%D \starttyping
-%D \def\makecounter#1%
-%D {\expandafter\newcount\csname#1\endcsname}
-%D
-%D \def\pluscounter#1%
-%D {\global\advance\csname#1\endcsname by 1 }
-%D
-%D \def\minuscounter#1%
-%D {\global\advance\csname#1\endcsname by -1 }
-%D
-%D \def\resetcounter#1%
-%D {\expandafter\global\csname#1\endcsname=0 }
-%D
-%D \def\setcounter#1#2%
-%D {\expandafter\global\csname#1\endcsname=#2 }
-%D
-%D \def\countervalue#1%
-%D {\the\getvalue{#1}}
-%D \stoptyping
-%D
-%D Because these macros are already an indirect way of working
-%D with counters, there is no harm in using pseudo \COUNTERS\
-%D here:
-
-\def\makecounter#1%
- {\letgvalue{#1}\zerocountervalue} % see earlier
-
-% \def\countervalue#1%
-% {\getvalue{#1}}
-
-\let\countervalue\getvalue
-
-\def\pluscounter#1%
- {\scratchcounter\getvalue{#1}%
- \advance\scratchcounter \plusone
- \setxvalue{#1}{\the\scratchcounter}}
-
-\def\minuscounter#1%
- {\scratchcounter\getvalue{#1}%
- \advance\scratchcounter \minusone
- \setxvalue{#1}{\the\scratchcounter}}
-
-\def\resetcounter#1%
- {\letgvalue{#1}\zerocountervalue}
-
-\def\setcounter#1#2% or: \setxvalue{#1}{\number#2}
- {\scratchcounter#2%
- \setxvalue{#1}{\the\scratchcounter}}
-
-\def\incrementcounter#1#2% #1 name #2 value
- {\setxvalue{#1}{\the\numexpr\csname#1\endcsname+#2\relax}}
-
-\def\decrementcounter#1#2% #1 name #2 value
- {\setxvalue{#1}{\the\numexpr\csname#1\endcsname-#2\relax}}
-
-%D \macros
-%D {savecounter,restorecounter}
-%D
-%D These two commands can be used to save and restore counter
-%D values. Only one level is saved.
-
-\def\savecounter#1%
- {{\scratchcounter\getvalue {#1}\setxvalue{!#1}{\the\scratchcounter}}}
-
-\def\restorecounter#1%
- {{\scratchcounter\getvalue{!#1}\setxvalue {#1}{\the\scratchcounter}}}
-
-% == {\setxvalue{#1}{\getvalue{!#1}}}
-
-%D The next \ETEX\ based solution is some 15\% faster, which
-%D goes unnoticed in any normal run, simply because these
-%D macros are not used milions of times.
-
-\beginETEX \numexpr
-
-\def\makecounter#1%
- {\global\@EA\let\csname#1\endcsname\zerocountervalue} % see earlier
-
-\def\countervalue#1%
- {\ifcsname#1\endcsname\csname#1\endcsname\fi}
-
-\def\pluscounter#1%
- {\@EA\xdef\csname#1\endcsname{\the\numexpr\csname#1\endcsname+\plusone\relax}}
-
-\def\minuscounter#1%
- {\@EA\xdef\csname#1\endcsname{\the\numexpr\csname#1\endcsname-\plusone\relax}}
-
-\def\resetcounter#1%
- {\global\@EA\let\csname#1\endcsname\zerocountervalue}
-
-\def\setcounter#1#2%
- {\@EA\xdef\csname#1\endcsname{\the\numexpr#2\relax}}
-
-\def\savecounter#1%
- {\@EA\xdef\csname !#1\endcsname{\the\numexpr\csname#1\endcsname\relax}}
-
-\def\restorecounter#1%
- {\@EA\xdef\csname#1\endcsname{\the\numexpr\csname !#1\endcsname\relax}}
-
-\endETEX
-
-%D \macros
-%D {beforesplitstring,aftersplitstring}
-%D
-%D These both commands split a string at a given point in two
-%D parts, so \type{x.y} becomes \type{x} or \type{y}.
-%D
-%D \starttyping
-%D \beforesplitstring test.tex\at.\to\filename
-%D \aftersplitstring test.tex\at.\to\extension
-%D \stoptyping
-%D
-%D The first routine looks (and is indeed) a bit simpler than
-%D the second one. The alternative looking more or less like
-%D the first one did not always give the results we needed.
-%D Both implementations show some insight in the manipulation
-%D of arguments.
-
-\def\beforesplitstring#1\at#2\to#3%
- {\def\dosplitstring##1#2##2#2##3\\%
- {\def#3{##1}}%
- \@EA\dosplitstring#1#2#2\\}
-
-\def\aftersplitstring#1\at#2\to#3%
- {\def\dosplitstring##1#2##2@@@##3\\%
- {\def#3{##2}}%
- \@EA\dosplitstring#1@@@#2@@@\\}
-
-%D \macros
-%D {splitstring,greedysplitstring}
-%D
-%D A bonus macro.
-
-\def\splitstring#1\at#2\to#3\and#4%
- {\def\dosplitstring##1#2##2\empty\empty\empty##3\\%
- {\def#3{##1}%
- \def\dosplitstring{##3}%
- \ifx\dosplitstring\empty
- \let#4\empty
- \else
- \def#4{##2}%
- \fi}%
- \@EA\dosplitstring#1\empty\empty\empty#2\empty\empty\empty\\}
-
-% Ok, but not for all cases:
-%
-% \def\greedysplitstring#1\at#2\to#3\and#4%
-% {\edef\asciib{#1}%
-% \let\asciic\asciib
-% \let#3\empty
-% \let#4\empty
-% \doloop
-% {\expandafter\splitstring\asciib\at#2\to\asciia\and\asciib
-% \ifx\asciib\empty
-% \exitloop
-% \else
-% \edef#3{\ifx#3\empty\else#3#2\fi\asciia}%
-% \let#4\asciib
-% \fi}%
-% \ifx#3\empty\let#3\asciic\fi}
-%
-% The next one is some 25\% faster, but it hardly matters because
-% we seldom use this macro.
-%
-% \def\greedysplitstring#1\at#2\to#3\and#4%
-% {\edef\asciib{#1}%
-% \let\asciic\asciib
-% \let#3\empty
-% \let#4\empty
-% \def\dogreedysplitstring
-% {\expandafter\splitstring\asciib\at#2\to\asciia\and\asciib
-% \ifx\asciib\empty
-% \expandafter\dogreedysplitstring
-% \else
-% \edef#3{\ifx#3\empty\else#3#2\fi\asciia}%
-% \let#4\asciib
-% \fi}%
-% \dogreedysplitstring
-% \ifx#3\empty\let#3\asciic\fi}
-%
-% The better alternative:
-
-\def\greedysplitstring#1\at#2\to#3\and#4%
- {\edef\asciib{#1}%
- \let\asciic\asciib
- \let#3\empty
- \let#4\empty
- \doloop
- {\expandafter\splitstring\asciib\at#2\to\asciia\and\asciib
- \ifx\asciib\empty
- \exitloop
- \else
- % not \edef#3{\ifx#3\empty\else#3#2\fi\asciia} else
- % /root/path fails because then #3==empty
- \edef#3{\ifcase\recurselevel\or\else#3#2\fi\asciia}%
- \let#4\asciib
- \fi}%
- \ifx#3\empty\let#3\asciic\fi}
-
-%D \macros
-%D {beforetestandsplitstring,
-%D aftertestandsplitstring,
-%D testandsplitstring}
-%D
-%D The next alternatives are for Simon Pepping. This time
-%D the result is empty when no split is done.
-
-% \def\beforetestandsplitstring#1\at#2\to#3%
-% {\def\dosplitstring##1#2##2#2##3\\{\doifelsenothing
-% {##3}{\let#3\empty}{\def#3{##1}}}%
-% \@EA\dosplitstring#1#2#2\\}
-%
-% \def\aftertestandsplitstring#1\at#2\to#3%
-% {\def\dosplitstring ##1#2##2@@@##3\\{\doifelsenothing
-% {##3}{\let#3\empty}{\def#3{##2}}}%
-% \@EA\dosplitstring #1@@@#2@@@\\}
-%
-% \def\testandsplitstring#1\at#2\to#3\and#4%
-% {\def\dosplitstring##1#2##2#2##3\\{\doifelsenothing
-% {##3}{\let#3\empty\let#4\empty}{\def#3{##1}\def#4{##2}}}%
-% \@EA\dosplitstring#1#2#2\\}
-%
-% faster:
-
-\def\beforetestandsplitstring#1\at#2\to#3%
- {\def\dosplitstring##1#2##2#2##3##4\\%
- {\ifx##3\empty\let#3\empty\else\def#3{##1}\fi}%
- \@EA\dosplitstring#1#2#2\empty\\}
-
-\def\aftertestandsplitstring#1\at#2\to#3%
- {\def\dosplitstring ##1#2##2@@@##3##4\\%
- {\ifx##3\empty\let#3\empty\else\def#3{##2}\fi}%
- \@EA\dosplitstring #1@@@#2@@@\empty\\}
-
-\def\testandsplitstring#1\at#2\to#3\and#4%
- {\def\dosplitstring##1#2##2#2##3##4\\%
- {\ifx##3\empty\let#3\empty\let#4\empty\else\def#3{##1}\def#4{##2}\fi}%
- \@EA\dosplitstring#1#2#2\empty\\}
-
-%D \macros
-%D {removesubstring}
-%D
-%D A first application of the two routines defined above is:
-%D
-%D \starttyping
-%D \removesubstring-\from first-last\to\nothyphenated
-%D \stoptyping
-%D
-%D Which in terms of \TEX\ looks like:
-
-%\def\removesubstring#1\from#2\to#3%
-% {\doifinstringelse{#1}{#2}
-% {\beforesplitstring#2\at#1\to\!!stringa
-% \aftersplitstring #2\at#1\to\!!stringb
-% \edef#3{\!!stringa\!!stringb}%
-% \removesubstring#1\from#3\to#3}
-% {}}
-
-\def\removesubstring#1\from#2\to#3%
- {\splitstring#2\to\!!stringa\and\!!stringb
- \dodoglobal#3{\!!stringa\!!stringb}}
-
-%D \macros
-%D {appendtocommalist,prependtocommalist,
-%D addtocommalist,removefromcommalist}
-%D
-%D When working with comma separated lists, one sooner or
-%D later want the tools to append or remove items from such a
-%D list. When we add an item, we first check if it's already
-%D there. This means that every item in the list is unique.
-%D
-%D \starttyping
-%D \addtocommalist {alfa} \name
-%D \addtocommalist {beta} \name
-%D \addtocommalist {gamma} \name
-%D \removefromcommalist {beta} \name
-%D \stoptyping
-%D
-%D These commands can be prefixed with \type{\doglobal}. The
-%D implementation of the second command is more complecated,
-%D because we have to take leading spaces into account. Keep in
-%D mind that users may provide lists with spaces after the
-%D commas. When one item is left, we also have to get rid of
-%D trailing spaces.
-%D
-%D \starttyping
-%D \def\words{alfa, beta, gamma, delta}
-%D \def\words{alfa,beta,gamma,delta}
-%D \stoptyping
-%D
-%D Removing an item takes more time than adding one.
-%D
-%D A fast appending alternative, without any testing, is
-%D also provided:
-%D
-%D \starttyping
-%D \appendtocommalist {something} \name
-%D \prependtocommalist {something} \name
-%D \stoptyping
-%D
-%D This can be implemented as follows:
-%D
-%D \starttyping
-%D \def\appendtocommalist#1#2%
-%D {\ifx#2\empty
-%D \dodoglobal\edef#2{#1}%
-%D \else % no test on empty
-%D \dodoglobal\edef#2{#2,#1}%
-%D \fi}
-%D
-%D \def\prependtocommalist#1#2%
-%D {\ifx#2\empty
-%D \dodoglobal\edef#2{#1}%
-%D \else % no test on empty
-%D \dodoglobal\edef#2{#1,#2}%
-%D \fi}
-%D \stoptyping
-%D
-%D The faster alternatives are:
-
-\def\appendtocommalist#1#2%
- {\dodoglobal\edef#2{\ifx#2\empty\else#2,\fi#1}}
-
-\def\prependtocommalist#1#2%
- {\dodoglobal\edef#2{#1\ifx#2\empty\else,#2\fi}}
-
-%D The old ones are:
-%D
-%D \starttyping
-%D \def\addtocommalist#1#2%
-%D {\ifx#2\empty
-%D \dodoglobal\edef#2{#1}%
-%D \else
-%D \edef\!!stringa{#2,,}%
-%D \beforesplitstring#2\at,,\to#2\relax
-%D \ExpandBothAfter\doifinsetelse{#1}{#2}
-%D {\resetglobal}
-%D {\dodoglobal\edef#2{#2,#1}}%
-%D \fi}
-%D
-%D \def\pretocommalist#1#2%
-%D {\ifx#2\empty
-%D \dodoglobal\edef#2{#1}%
-%D \else
-%D \edef\!!stringa{#2,,}%
-%D \beforesplitstring#2\at,,\to#2\relax
-%D \ExpandBothAfter\doifinsetelse{#1}{#2}
-%D {\resetglobal}
-%D {\dodoglobal\edef#2{#1,#2}}%
-%D \fi}
-%D
-%D \def\doremovefromcommalist#1#2#3% nog \doglobal
-%D {\edef\!!stringa{,,#3,,}%
-%D \beforesplitstring\!!stringa\at,#1#2,\to\!!stringb
-%D \aftersplitstring\!!stringa\at,#1#2,\to\!!stringc
-%D \edef#3{\!!stringb,\!!stringc}%
-%D \aftersplitstring#3\at,,\to#3\relax
-%D \beforesplitstring#3\at,,\to#3}
-%D
-%D \def\removefromcommalist#1#2%
-%D {\doremovefromcommalist{ }{#1}{#2}%
-%D \doremovefromcommalist{}{#1}{#2}%
-%D \dofrontstrip#2%
-%D \dodoglobal\edef#2{#2}}
-%D \stoptyping
-%D
-%D Significantly faster (especially for longer lists):
-
-\def\addtocommalist#1#2% {item} \cs
- {\rawdoifinsetelse{#1}#2\resetglobal
- {\dodoglobal\edef#2{\ifx#2\empty\else#2,\fi#1}}}
-
-\def\pretocommalist#1#2% {item} \cs
- {\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}%
- \edef\!!stringb{\acleanedupcommalist##2,,\relax}}%
- \@EA\dosplitstring\@EA,#1,,#2,,#2,\\}
-
-\def\bcleanedupcommalist#1#2#3\relax{\if#1,\else#1\fi\if#2,\else#2\fi#3}
-\def\bcleanedupcommalist#1#2\relax{\if#1,\else#1\fi#2}
-\def\acleanedupcommalist#1,,#2\relax{#1}
-
-% \def\removefromcommalist#1#2%
-% {\expanded{\xsplitstring\noexpand#2{#1}}%
-% \dodoglobal\edef#2%
-% {\ifx\!!stringa\empty
-% \!!stringb
-% \else
-% \@EA\acleanedupcommalist\!!stringa,,\relax
-% \ifx\!!stringb\empty\else,\!!stringb\fi
-% \fi}}
-
-\def\removefromcommalist#1#2%
- {\rawdoifinsetelse{#1}#2%
- {\expanded{\xsplitstring\noexpand#2{#1}}%
- \dodoglobal\edef#2%
- {\ifx\!!stringa\empty
- \!!stringb
- \else
- \!!stringa\ifx\!!stringb\empty\else,\!!stringb\fi
- \fi}}
- \resetglobal}
-
-%D \macros
-%D {substituteincommalist}
-%D
-%D Slow but seldom used, so for the moment we stick to this
-%D implementation.
-%D
-%D \starttyping
-%D \substituteincommalist{old}{new}{list}
-%D \stoptyping
-
-\def\substituteincommalist#1#2#3% old, new, list (slooow)
- {\edef\!!stringb{#1}%
- \edef\!!stringd{#2}%
- \let\!!stringa#3%
- \let#3\empty
- \def\dosubstituteincommalist##1%
- {\edef\!!stringc{##1}%
- \ifx\!!stringb\!!stringc
- \ifx\!!stringd\empty\else
- \edef#3{#3\ifx#3\empty\else,\fi\!!stringd}%
- \fi
- \def\docommand####1{\edef#3{#3,####1}}%
- \else
- \edef#3{#3\ifx#3\empty\else,\fi##1}%
- \fi}%
- \@EA\rawprocesscommacommand\@EA[\!!stringa]\dosubstituteincommalist}
-
-%D A not so useful macro:
-
-\def\dodofrontstrip[#1#2]#3%
- {\ifx#1\space
- \def#3{#2}%
- \else
- \def#3{#1#2}%
- \fi}
-
-\def\dofrontstrip#1%
- {\edef\!!stringa{#1}%
- \ifx\!!stringa\empty \else
- \@EA\dodofrontstrip\@EA[#1]#1%
- \fi}
-
-%D \macros
-%D {replaceincommalist}
-%D
-%D The next macro can be used to replace an indexed element
-%D in a commalist:
-%D
-%D \starttyping
-%D \replaceincommalist\MyList{2}
-%D \stoptyping
-%D
-%D Element~2 will be replaced by the current meaning of the macro
-%D \type {\newcommalistelement}. The old meaning is saved in
-%D \type {\commalistelement}. The replacement honors grouped items,
-%D like in:
-%D
-%D \starttyping
-%D \def\MyList{a,b,c,d,e,f} \replaceincommalist\MyList{3}
-%D \def\MyList{a,b,c,d,e,f} \replaceincommalist\MyList{3}
-%D \def\MyList{a,{b,c},d,e,f} \replaceincommalist\MyList{3}
-%D \def\MyList{a,b,c,{d,e,f}} \replaceincommalist\MyList{3}
-%D \stoptyping
-
-\let\newcommalistelement\empty
-
-\def\replaceincommalist#1#2% #1 = commalistelement #2 = position starts at 1
- {\def\doreplaceincommalist##1%
- {\ifnum\commalistcounter=#2\relax
- \ifx\newcommalistelement\empty\else
- \ifx\newcommalist\empty
- \let\newcommalist\newcommalistelement
- \else
- \@EA\@EA\@EA\def\@EA\@EA\@EA\newcommalist\@EA\@EA\@EA
- {\@EA\newcommalist\@EA,\newcommalistelement}%
- \fi
- \fi
- \def\commalistelement{##1}%
- \else
- \ifx\newcommalist\empty
- \ifx\nexttoken\bgroup % is known -)
- \def\newcommalist{{##1}}%
- \else
- \def\newcommalist{##1}%
- \fi
- \else
- \ifx\nexttoken\bgroup % is known -)
- \@EA\def\@EA\newcommalist\@EA{\newcommalist,{##1}}%
- \else
- \@EA\def\@EA\newcommalist\@EA{\newcommalist,##1}%
- \fi
- \fi
- \fi
- \advance\commalistcounter\plusone}%
- \let\commalistelement\empty
- \let\newcommalist\empty
- \commalistcounter\plusone
- \@EA\processcommalist\@EA[#1]\doreplaceincommalist
- \dodoglobal\let#1\newcommalist}
-
-%D \macros
-%D {globalprocesscommalist}
-%D
-%D The commalist processing commands are characterized by the
-%D fact that the way they handle expansion as well as the fact
-%D that they can be nested. This makes them kind of useless for
-%D handling comma lists in alignments. In these situations the
-%D next macro can be of use.
-
-\def\globalprocesscommaitem#1,%
- {\if]#1\else
- \globalcommacommand{#1}%
- \expandafter\globalprocesscommaitem
- \fi}
-
-\def\globalprocesscommalist[#1]#2%
- {\global\let\globalcommacommand#2%
- \expandafter\globalprocesscommaitem#1,],}
-
-%D \macros
-%D {startprocesscommalist,startprocesscommacommand}
-%D
-%D Two more:
-
-\long\def\startprocesscommalist[#1]#2\stopprocesscommalist
- {\long\def\currentcommalistcommand##1{\def\currentcommalistitem{##1}#2}%
- \processcommalist[#1]\currentcommalistcommand}
-
-\long\def\startprocesscommacommand[#1]#2\stopprocesscommacommand
- {\long\def\currentcommalistcommand##1{\def\currentcommalistitem{##1}#2}%
- \processcommacommand[#1]\currentcommalistcommand}
-
-%D \macros
-%D {withoutpt,PtToCm,
-%D numberofpoints,dimensiontocount}
-%D
-%D We can convert point into centimeters with:
-%D
-%D \starttyping
-%D \PtToCm{dimension}
-%D \stoptyping
-
-{\catcode`\.=\@@other
- \catcode`\p=\@@other
- \catcode`\t=\@@other
- \gdef\WITHOUTPT#1pt{#1}}
-
-\def\withoutpt#1%
- {\expandafter\WITHOUTPT#1}
-
-%D The capitals are needed because \type{p} and \type{t} have
-%D \CATCODE~12, while macronames only permit tokens with the
-%D \CATCODE~11. As a result we cannot use the \type{.group}
-%D primitives. Those who want to know more about this kind of
-%D manipulations, we advice to study the \TEX book in detail.
-%D Because this macro does not do any assignment, we can use it
-%D in the following way too.
-
-\def\PtToCm#1%
- {\begingroup
- \scratchdimen#1\relax
- \scratchdimen0.0351459804\scratchdimen % 2.54/72.27
- \withoutpt\the\scratchdimen cm%
- \endgroup}
-
-%D We also support:
-%D
-%D \starttyping
-%D \numberofpoints {dimension}
-%D \dimensiontocount {dimension} {\count}
-%D \stoptyping
-%D
-%D Both macros return a rounded number.
-
-% \dimensiontocount{10.49pt}\scratchcounter \the\scratchcounter / \numberofpoints{10.49pt}
-% \dimensiontocount{10.51pt}\scratchcounter \the\scratchcounter / \numberofpoints{10.51pt}
-
-\def\dimensiontocount#1#2{#2\numexpr\dimexpr#1\relax/\maxcard\relax}
-\def\numberofpoints #1{\the\numexpr\dimexpr#1\relax/\maxcard\relax}
-
-%D \macros
-%D {swapdimens,swapmacros}
-%D
-%D Simple but effective are the next two macros. There name
-%D exactly states their purpose. The \type{\scratchdimen} and
-%D \type{\!!stringa} can only be swapped when being the first
-%D argument.
-
-\def\swapdimens#1#2%
- {\scratchdimen #1\redoglobal #1#2\dodoglobal #2\scratchdimen}
-
-\def\swapmacros#1#2%
- {\let\!!stringa#1\redoglobal\let#1#2\dodoglobal\let#2\!!stringa}
-
-%D \macros
-%D {pushmacro,popmacro}
-%D
-%D Premature and a bit of beta, we offer:
-%D
-%D \starttyping
-%D \pushmacro\macro
-%D \popmacro\macro
-%D \stoptyping
-%D
-%D Beware: global!
-
-% \def\@s@{@s@}
-%
-% \beginTEX
-%
-% \def\globalpushmacro#1% we can use a faster incement here
-% {\@EA\doglobal\@EA\increment\csname\@s@*\string#1\endcsname
-% \global\@EA\let\csname\csname\@s@*\string#1\endcsname*\string#1\endcsname#1}
-%
-% \def\globalpopmacro#1% \global\let
-% {\global\@EA\let\@EA#1\csname\csname\@s@*\string#1\endcsname*\string#1\endcsname
-% \@EA\doglobal\@EA\decrement\csname\@s@*\string#1\endcsname}
-%
-% \def\localpushmacro#1% this one can be used to push a value over an \egroup
-% {\@EA\doglobal\@EA\increment\csname\@s@**\string#1\endcsname
-% \global\@EA\let\csname\csname\@s@**\string#1\endcsname**\string#1\endcsname#1}
-%
-% \def\localpopmacro#1% \local\let
-% {\@EA\let\@EA#1\csname\csname\@s@**\string#1\endcsname**\string#1\endcsname
-% \global\@EA\decrement\csname\@s@**\string#1\endcsname}
-%
-% \endTEX
-%
-% \beginETEX \newcount
-%
-% \def\globalpushmacro#1%
-% {\ifcsname\@s@*\string#1\endcsname \else
-% \@EA\newcount\csname\@s@*\string#1\endcsname
-% \fi
-% \global\advance\csname\@s@*\string#1\endcsname \plusone
-% \global\@EA\let\csname\the\csname\@s@*\string#1\endcsname*\string#1\endcsname#1}
-%
-% \def\globalpopmacro#1% \global\let
-% {\global\@EA\let\@EA#1\csname\the\csname\@s@*\string#1\endcsname*\string#1\endcsname
-% \global\advance\csname\@s@*\string#1\endcsname \minusone}
-%
-% \def\localpushmacro#1% this one can be used to push a value over an \egroup
-% {\ifcsname\@s@**\string#1\endcsname \else
-% \@EA\newcount\csname\@s@**\string#1\endcsname
-% \fi
-% \global\advance\csname\@s@**\string#1\endcsname \plusone
-% \global\@EA\let\csname\the\csname\@s@**\string#1\endcsname**\string#1\endcsname#1}
-%
-% \def\localpopmacro#1% \local\let
-% {\@EA\let\@EA#1\csname\the\csname\@s@**\string#1\endcsname**\string#1\endcsname
-% \global\advance\csname\@s@**\string#1\endcsname \minusone }
-%
-% \endETEX
-%
-% some 5% faster (used a lot in typescripts, so ...)
-
-\def\@sl@{@sl@}
-\def\@sg@{@sg@}
-
-\let\@@pushedmacro\empty
-
-\beginTEX
-
-\def\globalpushmacro#1% we can use a faster incement here
- {\xdef\@@pushedmacro{\string#1}%
- \@EA\doglobal\@EA\increment\csname\@sg@\@@pushedmacro\endcsname
- \global\@EA\let\csname\csname\@sg@\@@pushedmacro\endcsname\@@pushedmacro\endcsname#1}
-
-\def\globalpopmacro#1%
- {\xdef\@@pushedmacro{\string#1}%
- \global\@EA\let\@EA#1\csname\csname\@sg@\@@pushedmacro\endcsname\@@pushedmacro\endcsname
- \@EA\doglobal\@EA\decrement\csname\@sg@\@@pushedmacro\endcsname}
-
-\def\localpushmacro#1% this one can be used to push a value over an \egroup
- {\xdef\@@pushedmacro{\string#1}%
- \@EA\doglobal\@EA\increment\csname\@sl@\@@pushedmacro\endcsname
- \global\@EA\let\csname\csname\@sl@\@@pushedmacro\endcsname\@@pushedmacro\endcsname#1}
-
-\def\localpopmacro#1%
- {\xdef\@@pushedmacro{\string#1}%
- \@EA\let\@EA#1\csname\csname\@sl@\@@pushedmacro\endcsname\@@pushedmacro\endcsname
- \global\@EA\decrement\csname\@sl@\@@pushedmacro\endcsname}
-
-\endTEX
-
-\beginETEX
-
-\def\globalpushmacro#1%
- {\xdef\@@pushedmacro{\string#1}%
- \ifcsname\@sg@\@@pushedmacro\endcsname \else
- \@EA\newcount\csname\@sg@\@@pushedmacro\endcsname
- \fi
- \global\advance\csname\@sg@\@@pushedmacro\endcsname \plusone
- \global\@EA\let\csname\the\csname\@sg@\@@pushedmacro\endcsname\@@pushedmacro\endcsname#1}
-
-\def\globalpopmacro#1%
- {\xdef\@@pushedmacro{\string#1}%
- \global\@EA\let\@EA#1\csname\the\csname\@sg@\@@pushedmacro\endcsname\@@pushedmacro\endcsname
- \global\advance\csname\@sg@\@@pushedmacro\endcsname \minusone}
-
-\def\localpushmacro#1% this one can be used to push a value over an \egroup
- {\xdef\@@pushedmacro{\string#1}%
- \ifcsname\@sl@\@@pushedmacro\endcsname \else
- \@EA\newcount\csname\@sl@\@@pushedmacro\endcsname
- \fi
- \global\advance\csname\@sl@\@@pushedmacro\endcsname \plusone
- \global\@EA\let\csname\the\csname\@sl@\@@pushedmacro\endcsname\@@pushedmacro\endcsname#1}
-
-\def\localpopmacro#1%
- {\xdef\@@pushedmacro{\string#1}%
- \@EA\let\@EA#1\csname\the\csname\@sl@\@@pushedmacro\endcsname\@@pushedmacro\endcsname
- \global\advance\csname\@sl@\@@pushedmacro\endcsname \minusone }
-
-\endETEX
-
-% \let\pushmacro\globalpushmacro
-% \let\popmacro \globalpopmacro
-
-\let\pushmacro\localpushmacro
-\let\popmacro \localpopmacro
-
-%D \macros
-%D {setlocalhsize}
-%D
-%D Sometimes we need to work with the \type{\hsize} that is
-%D corrected for indentation and left and right skips. The
-%D corrected value is available in \type{\localhsize}, which
-%D needs to be calculated with \type{\setlocalhsize} first.
-%D
-%D \starttyping
-%D \setlocalhsize \hbox to \localhsize{...}
-%D \setlocalhsize[-1em] \hbox to \localhsize{...}
-%D \setlocalhsize[.5ex] \hbox to \localhsize{...}
-%D \stoptyping
-%D
-%D These examples show us that an optional can be used. The
-%D value provided is added to \type{\localhsize}.
-
-\newdimen\localhsize
-
-\def\complexsetlocalhsize[#1]% don't change !
- {\localhsize\hsize
- \ifnum\hangafter<\zerocount
- \advance\localhsize\ifdim\hangindent>\zeropoint-\fi\hangindent
- \fi
- \advance\localhsize -\leftskip
- \advance\localhsize -\rightskip
- \advance\localhsize #1\relax}
-
-\def\simplesetlocalhsize
- {\complexsetlocalhsize[\zeropoint]}
-
-\definecomplexorsimple\setlocalhsize
-
-%D \macros
-%D {doifvalue,doifnotvalue,doifelsevalue,
-%D doifnothing,doifsomething,doifelsenothing,
-%D doifvaluenothing,doifvaluesomething,doifelsevaluenothing}
-%D
-%D These long named \type{\if} commands can be used to access
-%D macros (or variables) that are normally accessed by using
-%D \type{\getvalue}. Using these alternatives safes us three
-%D tokens per call. Anyone familiar with the not||values
-%D ones, can derive their meaning from the definitions.
-
- \def\doifvalue#1{\doif {\csname#1\endcsname}}
- \def\doifnotvalue#1{\doifnot {\csname#1\endcsname}}
- \def\doifelsevalue#1{\doifelse{\csname#1\endcsname}}
-
- \def\doifnothing#1{\doif {#1}{}}
- \def\doifsomething#1{\doifnot {#1}{}}
- \def\doifelsenothing#1{\doifelse{#1}{}}
-
- \def\doifvaluenothing#1{\doif {\csname#1\endcsname}{}}
- \def\doifvaluesomething#1{\doifnot {\csname#1\endcsname}{}}
-\def\doifelsevaluenothing#1{\doifelse{\csname#1\endcsname}{}}
-
-%D Faster but spoiling inheritance (copying parameters):
-%D
-%D \starttyping
-%D \def\doifelsevaluesomething#1#2#3%
-%D {\expandafter\ifx\csname#1\endcsname\empty#3\else#2\fi}
-%D
-%D \def\doifvaluesomething#1#2%
-%D {\expandafter\ifx\csname#1\endcsname\empty\else#2\fi}
-%D
-%D \def\doifvaluenothing#1#2%
-%D {\expandafter\ifx\csname#1\endcsname\empty#2\fi}
-%D \stoptyping
-%D
-%D Slightly more efficient:
-
- \def\doifnothing{\doif \empty}
- \def\doifsomething{\doifnot \empty}
-\def\doifelsenothing{\doifelse\empty}
-
-%D The somewhat faster alternatives are:
-
-\long\def\doifvalue#1#2%
- {\edef\!!stringa{\csname#1\endcsname}\edef\!!stringb{#2}%
- \ifx\!!stringa\!!stringb
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\long\def\doifnotvalue#1#2%
- {\edef\!!stringa{\csname#1\endcsname}\edef\!!stringb{#2}%
- \ifx\!!stringa\!!stringb
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-\long\def\doifelsevalue#1#2%
- {\edef\!!stringa{\csname#1\endcsname}\edef\!!stringb{#2}%
- \ifx\!!stringa\!!stringb
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\long\def\doifnothing#1%
- {\edef\!!stringa{#1}%
- \ifx\!!stringa\empty
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\long\def\doifsomething#1%
- {\edef\!!stringa{#1}%
- \ifx\!!stringa\empty
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-\long\def\doifelsenothing#1%
- {\edef\!!stringa{#1}%
- \ifx\!!stringa\empty
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\long\def\doifsomethingelse#1%
- {\edef\!!stringa{#1}%
- \ifx\!!stringa\empty
- \expandafter\secondoftwoarguments
- \else
- \expandafter\firstoftwoarguments
- \fi}
-
-\long\def\doifvaluenothing#1%
- {\edef\!!stringa{\csname#1\endcsname}%
- \ifx\!!stringa\empty
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\long\def\doifvaluesomething#1%
- {\edef\!!stringa{\csname#1\endcsname}%
- \ifx\!!stringa\empty
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-\long\def\doifelsevaluenothing#1%
- {\edef\!!stringa{\csname#1\endcsname}%
- \ifx\!!stringa\empty
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-%D \macros
-%D {doifemptyelsevalue, doifemptyvalue, doifnotemptyvalue}
-%D
-%D Also handy:
-
-\def\doifemptyelsevalue#1%
- {\@EA\ifx\csname#1\endcsname\empty
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\def\doifemptyvalue#1%
- {\@EA\ifx\csname#1\endcsname\empty
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\def\doifnotemptyvalue#1%
- {\@EA\ifx\csname#1\endcsname\empty
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-%D \macros
-%D {doifallcommonelse}
-%D
-%D A complete match of two sets can be tested with
-%D \type {\doifallcommonelse}, where the first two
-%D arguments are sets.
-
-%\def\doifallcommonelse#1#2#3#4%
-% {\def\p!docommoncheck##1%
-% {\doifnotinset{##1}{#2}{\donefalse}%
-% \ifdone\else\quitcommalist\fi}%
-% \donetrue
-% \processcommalist[#1]\p!docommoncheck
-% \ifdone#3\else#4\fi}
-
-\def\@@doifallcommonelse#1#2#3#4% slow
- {\def\p!docommoncheck##1%
- {\doifnotinset{##1}{#4}\donefalse
- \ifdone\else\expandafter\quitcommalist\fi}%
- \donetrue
- \processcommalist[#3]\p!docommoncheck
- \ifdone\expandafter#1\else\expandafter#2\fi}
-
-\def\doifallcommonelse
- {\@@doifallcommonelse\firstoftwoarguments\secondoftwoarguments}
-
-\def\doifallcommon
- {\@@doifallcommonelse\firstofonearguments\gobbleoneargument}
-
-\def\doifnotallcommon
- {\@@doifallcommonelse\gobbleoneargument\firstofonearguments}
-
-%D \macros
-%D {DOIF,DOIFELSE,DOIFNOT}
-%D
-%D \TEX\ is case sensitive. When comparing arguments, this
-%D feature sometimes is less desirable, for instance when we
-%D compare filenames. The next three alternatives upcase their
-%D arguments before comparing them.
-%D
-%D \starttyping
-%D \DOIF {string1} {string2} {...}
-%D \DOIFNOT {string1} {string2} {...}
-%D \DOIFELSE {string1} {string2} {then ...}{else ...}
-%D \stoptyping
-%D
-%D We have to use a two||step implementation, because the
-%D expansion has to take place outside \type{\uppercase}.
-
-\def\p!DOIF#1#2%
- {\uppercase{\ifinstringelse{$#1$}{$#2$}}%
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\def\p!DOIFNOT#1#2%
- {\uppercase{\ifinstringelse{$#1$}{$#2$}}%
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-\def\p!DOIFELSE#1#2%
- {\uppercase{\ifinstringelse{$#1$}{$#2$}}%
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\def\p!DOIFINSTRINGELSE#1#2%
- {\uppercase{\ifinstringelse{#1}{#2}}%
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\def\DOIF {\ExpandBothAfter\p!DOIF}
-\def\DOIFNOT {\ExpandBothAfter\p!DOIFNOT}
-\def\DOIFELSE {\ExpandBothAfter\p!DOIFELSE}
-\def\DOIFINSTRINGELSE {\ExpandBothAfter\p!DOIFINSTRINGELSE}
-
-%D \macros
-%D {dosingleargumentwithset,
-%D dodoubleargumentwithset,dodoubleemptywithset,
-%D dotripleargumentwithset,dotripleemptywithset}
-%D
-%D These maybe too mysterious macros enable us to handle more
-%D than one setup at once.
-%D
-%D \starttyping
-%D \dosingleargumentwithset \command[#1]
-%D \dodoubleargumentwithset \command[#1][#2]
-%D \dotripleargumentwithset \command[#1][#2][#3]
-%D \dodoubleemptywithset \command[#1][#2]
-%D \dotripleemptywithset \command[#1][#2][#3]
-%D \stoptyping
-%D
-%D The first macro calls \type{\command[##1]} for each string
-%D in the set~\type{#1}. The second one calls for
-%D \type{\commando[##1][#2]} and the third, well one may guess.
-%D These commands support constructions like:
-%D
-%D \starttyping
-%D \def\dodefinesomething[#1][#2]%
-%D {\getparameters[\??xx#1][#2]}
-%D
-%D \def\definesomething%
-%D {\dodoubleargumentwithset\dodefinesomething}
-%D \stoptyping
-%D
-%D Which accepts calls like:
-%D
-%D \starttyping
-%D \definesomething[alfa,beta,...][variable=...,...]
-%D \stoptyping
-%D
-%D Now a whole bunch of variables like \type{\@@xxalfavariable}
-%D and \type{\@@xxbetavariable} is defined.
-
-\def\dodoublewithset#1#2%
- {\def\dododoublewithset[##1][##2]%
- {\doifsomething{##1}
- {\def\dodododoublewithset####1{#2[####1][##2]}%
- \processcommalist[##1]\dodododoublewithset}}%
- #1\dododoublewithset}
-
-\def\dodoubleemptywithset {\dodoublewithset\dodoubleempty}
-\def\dodoubleargumentwithset{\dodoublewithset\dodoubleargument}
-
-\def\dotriplewithset#1#2%
- {\def\dodotriplewithset[##1][##2][##3]%
- {\doifsomething{##1}
- {\def\dododotriplewithset####1{#2[####1][##2][##3]}%
- \processcommalist[##1]\dododotriplewithset}}%
- #1\dodotriplewithset}
-
-\def\dotripleemptywithset {\dotriplewithset\dotripleempty}
-\def\dotripleargumentwithset{\dotriplewithset\dotripleargument}
-
-%D \macros
-%D {stripcharacters,stripspaces}
-%D
-%D The next command was needed first when we implemented
-%D the \CONTEXT\ interactivity macros. When we use labeled
-%D destinations, we often cannot use all the characters we
-%D want. We therefore strip some of the troublemakers, like
-%D spaces, from the labels before we write them to the
-%D \DVI||file, which passes them to for instance a PostScript
-%D file.
-%D
-%D \starttyping
-%D \stripspaces\from\one\to\two
-%D \stoptyping
-%D
-%D Both the old string \type{\one} and the new one \type{\two}
-%D are expanded. This command is a special case of:
-%D
-%D \starttyping
-%D \stripcharacter\char\from\one\to\two
-%D \stoptyping
-%D
-%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}%
- \doifnotempty{##2}{\dostripcharacter##2\end}}%
- \let\!!strippedstring\empty
- \edef\!!stringa{#2}%
- \@EA\dostripcharacter\!!stringa#1\end
- \dodoglobal\let#3\!!strippedstring}
-
-\def\stripspaces\from#1\to#2% will become \unspacestring#1\from#2
- {\stripcharacter{ }\from#1\to#2}
-
-%D \macros
-%D {unspacestring}
-%D
-%D The next macro does the same but is more compatible with other macros,
-%D like \type {\convert...}.
-
-\def\unspacestring#1\to#2%
- {\stripcharacter{ }\from#1\to#2}
-
-%D \macros
-%D {executeifdefined}
-%D
-%D \CONTEXT\ uses one auxiliary file for all data concerning
-%D tables of contents, references, two||pass optimizations,
-%D sorted lists etc. This file is loaded as many times as
-%D needed. During such a pass we skip the commands thate are of
-%D no use at that moment. Because we don't want to come into
-%D trouble with undefined auxiliary commands, we call the
-%D macros in a way similar to \type{\getvalue}. The next macro
-%D take care of such executions and when not defined, gobbles
-%D the unwanted arguments.
-%D
-%D \starttyping
-%D \executeifdefined{name}\gobbleoneargument
-%D \stoptyping
-%D
-%D We can of course gobble more arguments using the
-%D appropriate gobbling command.
-
-\newif\ifexecuted % general purpose
-
-\def\executeifdefined#1#2%
- {\ifundefined{#1}%
- \def\next{#2}%
- \else
- \def\next{\getvalue{#1}}%
- \fi
- \next}
-
-%D Just for fun I times the next alternative: it was roughly
-%D timed about 15\% faster than the default (10+ sec to 9 sec)!
-
-\beginTEX
-
-\def\executeifdefined#1% #2 / never change this one again
- {\ifundefined{#1}%
- \expandafter\secondoftwoarguments
- \else
- \expandafter\firstoftwoarguments
- \fi
- {\csname#1\endcsname}}
-
-\endTEX
-
-\beginETEX
-
-% \def\executeifdefined#1% #2 / never change this one again
-% {\ifcsname#1\endcsname
-% \expandafter\firstoftwoarguments
-% \else
-% \expandafter\secondoftwoarguments
-% \fi
-% {\csname#1\endcsname}}
-
-\def\executeifdefined#1% #2 / never change this one again
- {\ifcsname#1\endcsname
- \csname#1\expandafter\expandafter\expandafter\endcsname\expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-\endETEX
-
-% \letvalue{f }\firstofoneargument \def\executeifdefined#1{\csname\ifcsname#1\endcsname#1\else f \fi\endcsname}
-
-%D This one also has the advantage that it is fully
-%D expandable and that it can be used after an assignment.
-
-%D \macros
-%D {executeifdefinedcs}
-%D
-%D An also fully expandable variant is the following:
-%D
-%D \starttyping
-%D \executeifdefinedcs{a}{b}
-%D \stoptyping
-%D
-%D In dit geval zijn beide argumenten csnames.
-
-\def\executeifdefinedcs#1#2%
- {\csname\ifundefined{#1}#2\else#1\fi\endcsname}
-
-%D We considered an alternative implementation accepting
-%D commands directly, like:
-%D
-%D \starttyping
-%D \executeifdefined\name\gobblefivearguments
-%D \stoptyping
-%D
-%D For the moment we don't need this one, so we stick to the
-%D faster one.
-
-%D \macros
-%D {executeandforget}
-%D
-%D The following macros were requested by Simon. Watch the
-%D global variant.
-%D
-%D \starttyping
-%D \executeandforget\SomeCommand
-%D \doglobal\executeandforget\AnotherCommand
-%D \stoptyping
-
-\def\executeandforget#1%
- {\global\let\@@expanded#1%
- \dodoglobal\let#1\relax
- \@@expanded}
-
-%D \macros
-%D {doifsomespaceelse}
-%D
-%D The next command checks a string on the presence of a space
-%D and executed a command accordingly.
-%D
-%D \starttyping
-%D \doifsomespaceelse {tekst} {then ...} {else ...}
-%D \stoptyping
-%D
-%D We use this command in \CONTEXT\ for determing if an
-%D argument must be broken into words when made interactive.
-%D Watch the use of \type{\noexpand}.
-
-%D Is this one still needed?
-
-% \long\def\doifsomespaceelse#1#2#3%
-% {\def\p!doifsomespaceelse##1 ##2##3\war%
-% {\if\noexpand##2@#3\else#2\fi}%
-% \p!doifsomespaceelse#1 @ @\war}
-
-\def\p!doifsomespaceelse#1 #2#3\war{\if\noexpand#2@}
-
-\long\def\doifsomespaceelse#1% % #2#3%
- {\p!doifsomespaceelse#1 @ @\war % #3\else#2\fi}
- \expandafter\secondoftwoarguments
- \else
- \expandafter\firstoftwoarguments
- \fi}
-
-%D \macros
-%D {adaptdimension,balancedimensions}
-%D
-%D Again we introduce some macros that are closely related to
-%D an interface aspect of \CONTEXT. The first command can be
-%D used to adapt a \DIMENSION.
-%D
-%D \starttyping
-%D \adaptdimension {dimension} {value}
-%D \stoptyping
-%D
-%D When the value is preceed by a \type{+} or minus, the
-%D dimension is advanced accordingly, otherwise it gets the
-%D value.
-
-% \def\doadaptdimension#1#2\\#3\\%
-% {\if#1+%
-% \dodoglobal\advance#3 #1#2\relax
-% \else\if#1-%
-% \dodoglobal\advance#3 #1#2\relax
-% \else
-% \dodoglobal#3=#1#2\relax
-% \fi\fi}
-%
-% more fuzzy but also more efficient
-
-\def\doadaptdimension#1#2\\#3\\%
- {\if#1+%
- \dodoglobal\advance
- \else\if#1-%
- \dodoglobal\advance
- \else
- \dodoglobal
- \fi\fi
- #3 #1#2\relax}
-
-\def\adaptdimension#1#2%
- {\expandafter\doadaptdimension#2\\#1\\}
-
-%D A second command takes two \DIMENSIONS. Both are adapted,
-%D depending on the sign of the given value.
-%D maat. This time we take the value as it is, and don't look
-%D explicitly at the preceding sign.
-%D
-%D \starttyping
-%D \balancedimensions {dimension 1} {dimension 2} {value}
-%D \stoptyping
-%D
-%D When a positive value is given, the first dimension is
-%D incremented, the second ond is decremented. A negative value
-%D has the opposite result.
-
-\def\balancedimensions#1#2#3%
- {\scratchdimen#3\relax
- \redoglobal\advance#1 \scratchdimen
- \dodoglobal\advance#2 -\scratchdimen}
-
-%D Both commands can be preceded by \type{\doglobal}. Here we
-%D use \type{\redo} first, because \type{\dodo} resets the
-%D global character.
-
-%D \macros
-%D {processseparatedlist}
-%D
-%D Maybe a bit late, but here is a more general version of the
-%D \type{\processcommalist} command. This time we don't handle
-%D nesting but accept arbitrary seperators.
-%D
-%D \starttyping
-%D \processseparatedlist[list][separator]\command
-%D \stoptyping
-%D
-%D One can think of things like:
-%D
-%D \starttyping
-%D \processseparatedlist[alfa+beta+gamma][+]\message
-%D \stoptyping
-
-%D First we show the simple alternative:
-%D
-%D \starttyping
-%D \def\processseparatedlist[#1][#2]#3%
-%D {\def\doprocessseparatedlist##1##2#2%
-%D {\if]##1%
-%D \let\next=\relax
-%D \else\if]##2%
-%D \let\next=\relax
-%D \else\ifx\blankspace##2%
-%D #3{##1}%
-%D \let\next=\doprocessseparatedlist
-%D \else
-%D #3{##1##2}%
-%D \let\next=\doprocessseparatedlist
-%D \fi\fi\fi
-%D \next}%
-%D \doprocessseparatedlist#1#2]#2}
-%D \stoptyping
-%D
-%D However, we want to handle all situations, like:
-%D
-%D \startbuffer
-%D \processseparatedlist[{aap noot}] [ ]{\def\xxx} \convertcommand\xxx\to\ascii {\tttf\ascii}
-%D \processseparatedlist[{aap} {noot}][ ]{\def\xxx} \convertcommand\xxx\to\ascii {\tttf\ascii}
-%D \processseparatedlist[aap {noot}] [ ]{\def\xxx} \convertcommand\xxx\to\ascii {\tttf\ascii}
-%D \processseparatedlist[aap noot] [ ]{\def\xxx} \convertcommand\xxx\to\ascii {\tttf\ascii}
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-%D
-%D Therefore we smuggle a \type {\relax} in front of the
-%D argument, which we remove afterwards.
-
-% \def\doprocessseparatedlist#1]#2[#3]#4%
-% {\def\dodoprocessseparatedlist##1##2#3%
-% {\if]##1%
-% \let\dodoprocessseparatedlist\relax
-% \else\if]##2%
-% \let\dodoprocessseparatedlist\relax
-% \else\ifx\blankspace##2%
-% #4{##1}%
-% \else
-% #4{##1##2}%
-% \fi\fi\fi
-% \dodoprocessseparatedlist}%
-% \@EA\dodoprocessseparatedlist\gobbleoneargument#1#3]#3}
-
-% testcase Vit Zyka:
-%
-% \def\Do#1{(#1)}
-% 1\processseparatedlist[{aap noot}] [ ]\Do \par
-% 2\processseparatedlist[{aap} {noot}][ ]\Do \par
-% 3\processseparatedlist[aap {noot}] [ ]\Do \par
-% 4\processseparatedlist[aap noot] [ ]\Do \par
-% 5\processseparatedlist[aap;noot;a noot;noot a; noot a noot][;]\Do \par
-% 6\processseparatedlist[][;]\Do \par
-% 7\processseparatedlist[;][;]\Do \par
-
-\def\doprocessseparatedlist#1]#2[#3]#4%
- {\def\dodoprocessseparatedlist##1##2#3%
- {\def\!!stringa{##2}% suggested by VZ
- \if]##1%
- \let\dodoprocessseparatedlist\relax
- \else\ifx\blankspace\!!stringa
- #4{##1}%
- \else\if]##2%
- \let\dodoprocessseparatedlist\relax
- \else
- #4{##1##2}%
- \fi\fi\fi
- \dodoprocessseparatedlist}%
- \@EA\dodoprocessseparatedlist\gobbleoneargument#1#3]#3}
-
-\def\processseparatedlist[%
- {\doprocessseparatedlist\relax}
-
-%D \macros
-%D {processlist}
-%D
-%D An even more general list processing macro is the
-%D following one:
-%D
-%D \starttyping
-%D \processlist{beginsym}{endsym}{separator}\docommand list
-%D \stoptyping
-%D
-%D This one supports arbitrary open and close symbols as well
-%D as user defined separators.
-%D
-%D \starttyping
-%D \processlist(){=>}\docommand(a=>b=>c=>d)
-%D \stoptyping
-
-\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
- #4{####1####2}%
- \fi\fi
- \dodoprocesslist}%
- \expandafter\dodoprocesslist\gobbleoneargument##1#3#2#3}%
- \def\dodoprocesslist#1%
- {\doprocesslist\relax}%
- \dodoprocesslist}
-
-% %D \macros
-% %D {dohonorgroupedargument}
-% %D
-% %D The previous macro uses yet another auxiliary macro to
-% %D handle the special case.
-%
-% \def\dohonorgroupedargument#1[%
-% {\doifnextbgroupelse{\dodohonorgroupedargument#1}{#1[}}
-%
-% \def\dodohonorgroupedargument#1#2%
-% {#1[{{#2}}}
-
-%D \macros
-%D {processassignlist}
-%D
-%D Is possible to combine an assignment list with one
-%D containing keywords. Assignments are treated accordingly,
-%D keywords are treated by \type{\command}.
-%D
-%D \starttyping
-%D \processassignlist[...=...,...=...,...]\commando
-%D \stoptyping
-%D
-%D This command can be integrated in \type{\getparameters}, but
-%D we decided best not to do so.
-
-\def\processassignlist#1[#2]#3%
- {\def\p!dodogetparameter[##1=##2=##3]%
- {\doifnot{##3}\relax{#3{##1}}}%
- \def\p!dogetparameter##1%
- {\p!dodogetparameter[##1==\relax]}%
- \processcommalist[#2]\p!dogetparameter}
-
-% too ugly
-%
-% %D \macros
-% %D {DoAfterFi,DoAfterFiFi}
-% %D
-% %D Sometimes \type{\fi}'s can get into the way. We can reach
-% %D over such a troublemaker with:
-% %D
-% %D \starttyping
-% %D \DoAfterFi{some commands}
-% %D \DoAfterFiFi{some commands}
-% %D \stoptyping
-% %D
-% %D It saves us a \type{\next} construction. Skipping
-% %D \type{\else...\fi} is more tricky, so this one is not
-% %D provided.
-%
-% \def\DoAfterFi#1\fi{\fi#1}
-% \def\DoAfterFiFi#1\fi#2\fi{\fi\fi#1}
-
-%D \macros
-%D {untextargument
-%D untexcommand}
-%D
-%D When manipulating data(bases) and for instance generating
-%D index entries, the next three macros can be of help:
-%D
-%D \starttyping
-%D \untextargument{...}\to\name
-%D \untexcommand {...}\to\name
-%D \stoptyping
-%D
-%D They remove braces and backslashes and give us something to
-%D sort.
-
-\def\untexsomething
- {\begingroup
- \catcode`\{=\@@ignore
- \catcode`\}=\@@ignore
- \escapechar\minusone
- \dountexsomething}
-
-\long\def\dountexsomething#1#2\to#3%
- {\doglobal#1#2\to\untexedargument
- \endgroup
- \let#3\untexedargument}
-
-\def\untexargument{\untexsomething\convertargument}
-\def\untexcommand {\untexsomething\convertcommand}
-
-%D \macros
-%D {ScaledPointsToBigPoints,ScaledPointsToWholeBigPoints}
-%D
-%D One characteristic of \POSTSCRIPT\ and \PDF\ is that both
-%D used big points (\TEX's bp). The next macros convert points
-%D and scaled points into big points.
-%D
-%D \starttyping
-%D \ScaledPointsToBigPoints {number} \target
-%D \ScaledPointsToWholeBigPoints {number} \target
-%D \stoptyping
-%D
-%D The magic factor $72/72.27$ can be found in most \TEX\
-%D related books.
-
-% \def\ScaledPointsToBigPoints #1{\PointsToBigPoints {#1sp}}
-% \def\ScaledPointsToWholeBigPoints#1{\PointsToWholeBigPoints{#1sp}}
-%
-% \def\PointsToBigPoints#1#2%
-% {\scratchdimen#1%
-% \scratchdimen.996264\scratchdimen
-% \edef#2{\withoutpt\the\scratchdimen}}
-%
-% \def\PointsToWholeBigPoints#1#2%
-% {\scratchdimen#1%
-% \scratchdimen.996264\scratchdimen
-% \scratchcounter\scratchdimen
-% \advance\scratchcounter \medcard
-% \divide\scratchcounter \maxcard
-% \edef#2{\the\scratchcounter}}
-
-% \PointsToBigPoints{10.53940pt}\test \test
-% \PointsToBigPoints{10.53941pt}\test \test
-% \PointsToBigPoints{10.53942pt}\test \test
-
-% \PointsToWholeBigPoints{10.53940pt}\test \test
-% \PointsToWholeBigPoints{10.53941pt}\test \test
-% \PointsToWholeBigPoints{10.53942pt}\test \test
-
-\beginTEX
-
- \def\PointsToBigPoints#1#2%
- {\scratchdimen#1%
- \scratchdimen.996264\scratchdimen
- \edef#2{\withoutpt\the\scratchdimen}}
-
- \def\PointsToWholeBigPoints#1#2%
- {\scratchdimen#1%
- \scratchdimen.996264\scratchdimen
- \scratchcounter\scratchdimen
- \advance\scratchcounter \medcard
- \divide\scratchcounter \maxcard
- \edef#2{\the\scratchcounter}}
-
-\endTEX
-
-\beginETEX \dimexpr \numexpr
-
-% \def\PointsToBigPoints#1#2%
-% {\edef#2{\withoutpt\the\dimexpr(.996264\dimexpr(#1))}}
-
-% \def\PointsToWholeBigPoints#1#2%
-% {\edef#2{\the\numexpr(\numexpr(\dimexpr(.996264\dimexpr(#1)))/\maxcard)}}
-
- \def\PointsToBigPoints#1#2%
- {\edef#2{\withoutpt\the\dimexpr.996264\dimexpr#1\relax\relax}}
-
- \def\PointsToWholeBigPoints#1#2%
- {\edef#2{\the\numexpr\dimexpr.996264\dimexpr#1\relax\relax/\maxcard\relax}}
-
-\endETEX
-
-\def\ScaledPointsToBigPoints #1{\PointsToBigPoints {\number#1\scaledpoint}}
-\def\ScaledPointsToWholeBigPoints#1{\PointsToWholeBigPoints{\number#1\scaledpoint}}
-
-%D \macros
-%D {PointsToReal}
-%D
-%D Points can be stripped from their suffix by using
-%D \type{\withoutpt}. The next macro enveloppes this macro.
-%D
-%D \starttyping
-%D \PointsToReal {dimension} \target
-%D \stoptyping
-
-\def\PointsToReal#1#2%
- {\scratchdimen#1%
- \edef#2{\withoutpt\the\scratchdimen}}
-
-%D \macros
-%D {dontleavehmode}
-%D
-%D Sometimes when we enter a paragraph with some command, the
-%D first token gets the whole first line. We can prevent this
-%D by saying:
-%D
-%D \starttyping
-%D \dontleavehmode
-%D \stoptyping
-%D
-%D This command is used in for instance the language module
-%D \type{lang-ini}. The first version was:
-%D
-%D \starttyping
-%D \def\dontleavehmode{\ifhmode\else\ifmmode\else$ $\fi\fi}
-%D \stoptyping
-%D
-%D Next, Taco came with a better alternative (using mathsurround):
-%D
-%D \starttyping
-%D \def\dontleavehmode
-%D {\ifhmode\else \ifmmode\else
-%D {\mathsurround\zeropoint\everymath\emptytoks$ $}%
-%D \fi \fi}
-%D \stoptyping
-%D
-%D And finaly we got the following alternative, one that avoids
-%D interfering grouping at the cost of a box.
-
-\newbox\@@dlhbox
-
-\unexpanded \def\dontleavehmode
- {\ifhmode\else \ifmmode\else
- \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:
-
-\ifx\normalquitvmode\undefined \else \let\dontleavehmode\normalquitvmode \fi
-
-%D \macros
-%D {uppercasestring,lowercasestring}
-%D
-%D The names tell what they do:
-%D
-%D \starttyping
-%D \uppercasestring somestring\to\somestring
-%D \lowercasestring somestring\to\somestring
-%D \stoptyping
-%D
-%D the first argument may be a \type{\macro}.
-
-\def\uppercasestring#1\to#2% first @EA redundant
- {\edef#2{#1}\@EA\uppercase\@EA{\@EA\dodoglobal\@EA\edef\@EA#2\@EA{#2}}}
-
-\def\lowercasestring#1\to#2% first @EA redundant
- {\edef#2{#1}\@EA\lowercase\@EA{\@EA\dodoglobal\@EA\edef\@EA#2\@EA{#2}}}
-
-%D \macros
-%D {handletokens}
-%D
-%D With the next macro we enter a critical area of macro
-%D expansion. What we want is a macro that looks like:
-%D
-%D \starttyping
-%D \handletokens some tokens\with \somemacro
-%D \stoptyping
-%D
-%D At first sight the next implementation will suffice, but
-%D running this one shows that we loose the spaces. This is no
-%D surprise because we grab arguments and spaces preceding those
-%D are just ignored.
-%D
-%D \starttyping
-%D \def\nohandletokens#1\end%
-%D {}
-%D
-%D \def\dohandletokens#1#2\end%
-%D {\ifx#1\endoftoken
-%D \expandafter\nohandletokens
-%D \else
-%D \docommand{#1}%
-%D \expandafter\dohandletokens
-%D \fi
-%D #2\end}
-%D
-%D \long\def\handletokens#1\with#2%
-%D {\let\docommand=#2\relax
-%D \dohandletokens#1\endoftoken\end}
-%D \stoptyping
-%D
-%D A second approach therefore grabs the individual characters
-%D by using \type{\afterassignment}, in which case the space is
-%D read in as space.
-%D
-%D \starttyping
-%D \def\dodohandletokens%
-%D {\ifx\next\end \else
-%D \docommand{\next}%
-%D \expandafter\dohandletokens
-%D \fi}
-%D
-%D \def\dohandletokens
-%D {\afterassignment\dodohandletokens\let\next= }
-%D
-%D \long\def\handletokens#1\with#2%
-%D {\let\docommand=#2%
-%D \dohandletokens#1\end}
-%D \stoptyping
-
-%D A bonus example:
-%D
-%D \starttyping
-%D \hbox{\handletokens tekst en meer tekst\with\ruledhbox}
-%D
-%D \def\weetikveel#1{\if#1\blankspace\space\else\ruledhbox{#1}\fi}
-%D
-%D \hbox{\handletokens tekst en meer tekst\with\weetikveel}
-%D \stoptyping
-
-%D \macros
-%D {counttoken,counttokens}
-%D
-%D For the few occasions that we want to know the number of
-%D specific tokens in a string, we can use:
-%D
-%D \starttyping
-%D \counttoken token\in string\to \count
-%D \counttokens string\to \count
-%D \stoptyping
-%D
-%D This macro, that for instance is used in \type{cont-tab},
-%D takes a real counter. The macro can be preceded by \type
-%D {\doglobal}.
-
-\def\counttoken#1\in#2\to#3%
- {\redoglobal#3\zerocount
- \def\!!stringa{#1}%
- \def\!!stringb{\end}%
- \def\docounttoken##1% obeys {}
- {\def\!!stringc{##1}%
- \ifx\!!stringb\!!stringc \else
- \ifx\!!stringa\!!stringc
- \dodoglobal\advance#3 \plusone
- \fi
- \expandafter\docounttoken
- \fi}%
- \docounttoken#2\end
- \resetglobal}
-
-% \def\counttoken#1\in#2\to#3%
-% {\redoglobal#3\zerocount
-% \def\!!stringa{#1}%
-% \def\docounttoken##1% obeys {}
-% {\def\!!stringb{##1}%
-% \ifx\!!stringa\!!stringb
-% \dodoglobal\advance#3\plusone
-% \fi}%
-% \handletokens#1\with\docounttoken
-% \resetglobal}
-
-\def\counttokens#1\to#2%
- {\redoglobal#2\zerocount
- \def\docounttoken##1{\dodoglobal\advance#2\plusone}%
- \handletokens#1\with\docounttoken
- \resetglobal}
-
-%D \macros
-%D {splitofftokens}
-%D
-%D Running this one not always gives the expected results.
-%D Consider for instance the macro for which I originally
-%D wrote this token handler.
-
-\long\def\splitofftokens#1\from#2\to#3%
- {\ifnum#1>\zerocount
- \scratchcounter#1\relax
- \def\dosplitofftokens##1%
- {\ifnum\scratchcounter>\zerocount
- \advance\scratchcounter \minusone
- \edef#3{#3##1}%
- \fi}%
- % \let#3\empty % #3 can be #2, so:
- \@EA\let\@EA#3\@EA\empty
- \@EA\handletokens#2\with\dosplitofftokens
- \else
- \edef#3{#2}%
- \fi}
-
-%D This macro can be called like:
-%D
-%D \startbuffer[example]
-%D \splitofftokens10\from01234567 890123456789\to\test [\test]
-%D \stopbuffer
-%D
-%D However, the characters that we expect to find in
-%D \type{\test} just don;t show up there. The reason for this
-%D is not that logical but follows from \TEX's sometimes
-%D mysterious way of expanding. Look at this:
-%D
-%D \startbuffer[next]
-%D \def\next{a} \edef\test{\next} [\test]
-%D \let\next=b \edef\test{\test\next} [\test]
-%D \let\next=c \edef\test{\next} [\test]
-%D \let\next=d \edef\test{\test\next} [\test]
-%D \let\next=e \@EA\edef\@EA\test\@EA{\test\next} [\test]
-%D \stopbuffer
-%D
-%D \typebuffer[next]
-%D
-%D Careful reading shows that inside an \type{\edef} macro's
-%D that are \type{\let} are not expanded!
-%D
-%D \unprotect\getbuffer[next]\protect
-%D
-%D That's why we finally end up with a macro that looks
-%D ahead by using an assignment, this time by using \type
-%D {\futurelet}, and grabbing an argument as well. That
-%D way we can handle the sentinal, a blank space and grouped
-%D tokens.
-
-\def\dohandletokens % \nexthandledtoken is part of interface
- {\futurelet\nexthandledtoken\dodohandletokens}
-
-\long\def\handletokens#1\with#2%
- {\gdef\dododohandletokens{#2}% permits more complex #2's
- \dohandletokens#1\end}
-
-%D A previous version said \type{\docommand=#2}, but to enable
-%D use in alignments, I decided to use another placeholder, one
-%D that is not sensitive to the global assignment.
-
-%D This alternatives does not handle grouped tokens well, so
-%D next we had (for a short moment):
-%D
-%D \starttyping
-%D \def\dodohandletokens#1%
-%D {\ifx\nexthandledtoken\blankspace
-%D \dododohandletokens{ }%
-%D \fi
-%D \ifx#1\end \else
-%D \dododohandletokens{#1}%
-%D \expandafter\dohandletokens
-%D \fi}
-%D \stoptyping
-%D
-%D This one failed on a trailing space, something we
-%D encounter in \JAVASCRIPT\ cleaning.
-%D
-%D \starttyping
-%D \def\dodohandletokens#1%
-%D {\ifx\nexthandledtoken\blankspace
-%D \dododohandletokens{ }%
-%D \fi
-%D \ifx\nexthandledtoken\end \else
-%D \dododohandletokens{#1}%
-%D \expandafter\dohandletokens
-%D \fi}
-%D \stoptyping
-%D
-%D So, now we have:
-
-\def\dodohandletokens % can be sped up
- {\ifx\nexthandledtoken\blankspace
- \def\next * {\dododohandletokens{ }\dohandletokens}%
- \else\ifx\nexthandledtoken\end
- \let\next\gobbletwoarguments
- \else
- \long\def\next *##1{\dododohandletokens{##1}\dohandletokens}%
- \fi\fi
- \next *}
-
-%D This macro is tested on:
-%D
-%D \def\xxx#1{[#1]}
-%D
-%D \startlines
-%D \handletokens abc\with\xxx
-%D \handletokens a b c\with\xxx
-%D \handletokens a b c\with\xxx
-%D \handletokens a{bc}d\with\xxx
-%D \handletokens a\space bc \with\xxx
-%D \stoplines
-%D
-%D And our previous example shows up as:
-%D
-%D \getbuffer[example]
-
-%D \macros
-%D {iftrialtypesetting, ifvisible}
-%D
-%D The next boolean is at first sight a strange one. Sometimes
-%D one does a trial typesetting run, for instance to determine
-%D dimensions. Some mechanisms, like object inclusion, can fail
-%D on such trials. Temporary setting the next boolean to true,
-%D helps a lot. The second boolena can be used to inhibit
-%D processing completely.
-
-\newif\iftrialtypesetting \trialtypesettingfalse
-\newif\ifvisible \visibletrue
-
-%D \macros
-%D {startlocal, startglobal}
-%D
-%D The next four macros are rather self explaining:
-%D
-%D \starttyping
-%D \startlocal
-%D whatever assignments
-%D \stoplocal
-%D
-%D \startglobal
-%D whatever assignments
-%D \stopglobal
-%D \stoptyping
-%D
-%D These macros are meant for those who know the difference
-%D between local and global assignments and are aware of the
-%D possible unwanted side effect
-
-\def\dostartglobaldefs#1#2%
- {\edef\!!stringa{\the\globaldefs}%
- \ifnum\globaldefs#10
- \globaldefs-\globaldefs
- \fi
- \advance\globaldefs#21
- \letvalue{@gd@\the\globaldefs}\!!stringa}
-
-\def\dostopglobaldefs%
- {\doifdefinedelse{@gd@\the\globaldefs}
- {\globaldefs\getvalue{@gd@\the\globaldefs}\relax}
- {\globaldefs\zerocount}}
-
-\def\startlocal {\dostartglobaldefs>-}
-\def\stoplocal {\dostopglobaldefs}
-\def\startglobal {\dostartglobaldefs<+}
-\def\stopglobal {\dostopglobaldefs}
-
-%D \macros
-%D {twodigitrounding}
-%D
-%D When using \type {\special}s or \type {\pdfliteral}s, it
-%D sometimes makes sense to limit the precission. The next
-%D macro rounds a real number to two digits. It takes one
-%D argument and only works in \ETEX.
-
-\beginTEX
-
- \let\integerrounding \firstofoneargument
- \let\onedigitrounding \firstofoneargument
- \let\twodigitrounding \firstofoneargument
- \let\threedigitrounding\firstofoneargument
-
-\endTEX
-
-\beginETEX \dimexpr
-
- \def\dointegerrounding #1.#2\relax {#1}
- \def\doonedigitrounding #1.#2#3\relax {\ifx#2*#1\else#1.#2\fi}
- \def\dotwodigitrounding #1.#2#3#4\relax {\ifx#2*#1\else#1.#2#3\fi}
- \def\dothreedigitrounding#1.#2#3#4#5\relax{\ifx#2*#1\else#1.#2#3#4\fi}
-
- \def\integerrounding#1%
- {\@EA\@EA\@EA\dointegerrounding \@EA\WITHOUTPT\the\dimexpr#1\points+.5\points \relax .\relax}
- \def\onedigitrounding#1%
- {\@EA\@EA\@EA\doonedigitrounding \@EA\WITHOUTPT\the\dimexpr#1\points+.05\points \relax 00.*0\relax}
- \def\twodigitrounding#1%
- {\@EA\@EA\@EA\dotwodigitrounding \@EA\WITHOUTPT\the\dimexpr#1\points+.005\points \relax 000.*00\relax}
- \def\threedigitrounding#1%
- {\@EA\@EA\@EA\dothreedigitrounding\@EA\WITHOUTPT\the\dimexpr#1\points+.0005\points\relax0000.*00\relax}
-
-% \def\dointegerrounding #1.#2\relax {#1}
-% \def\doonedigitrounding #1.#2#3\relax {#1.#2}
-% \def\dotwodigitrounding #1.#2#3#4\relax {#1.#2#3}
-% \def\dothreedigitrounding#1.#2#3#4#5\relax{#1.#2#3#4}
-
-% \def\integerrounding #1{\@EA\@EA\@EA\dointegerrounding \@EA\WITHOUTPT\the\dimexpr #1\points+.5\points\relax \relax}
-% \def\onedigitrounding #1{\@EA\@EA\@EA\doonedigitrounding \@EA\WITHOUTPT\the\dimexpr #1\points+.05\points\relax 0\relax}
-% \def\twodigitrounding #1{\@EA\@EA\@EA\dotwodigitrounding \@EA\WITHOUTPT\the\dimexpr #1\points+.005\points\relax 00\relax}
-% \def\threedigitrounding#1{\@EA\@EA\@EA\dothreedigitrounding\@EA\WITHOUTPT\the\dimexpr#1\points+.0005\points\relax000\relax}
-
-% \def\integerroundeddimen #1{\@EA\@EA\@EA\dointegerrounding \@EA\WITHOUTPT\the\dimexpr #1+.5\points\relax \relax}
-% \def\onedigitroundeddimen #1{\@EA\@EA\@EA\doonedigitrounding \@EA\WITHOUTPT\the\dimexpr #1+.05\points\relax 0\relax}
-% \def\twodigitroundeddimen #1{\@EA\@EA\@EA\dotwodigitrounding \@EA\WITHOUTPT\the\dimexpr #1+.005\points\relax 00\relax}
-% \def\threedigitroundeddimen#1{\@EA\@EA\@EA\dothreedigitrounding\@EA\WITHOUTPT\the\dimexpr#1+.0005\points\relax000\relax}
-
-\endETEX
-
-%D \macros
-%D {processcontent}
-%D
-%D This is the first occasion where \TEX\ and \ETEX\ are no
-%D longer compatible, although in many cases things go ok.
-%D Beware of verbatim, i.e. catcode changes.
-%D
-%D \starttyping
-%D \def\starthans%
-%D {\processcontent{stophans}\test{\message{\test}\wait}}
-%D \stoptyping
-%D
-%D This macro is first used in the tabulation macros.
-
-\def\processcontent#1%
- {\begingroup\@EA\doprocesscontent\csname#1\endcsname}
-
-%\beginTEX
-
-\def\doprocesscontent#1#2#3%
- {\long\def\doprocesscontent##1#1%
- {\endgroup\long\def#2{##1}#3}%
- \doprocesscontent}
-
-%\endTEX
-
-% Hm. Side effect, spaces after \type{\test} in verbatim.
-% must set eof token
-
-%\beginETEX \scantokens
-%
-%\def\doprocesscontent#1#2#3%
-% {\long\def\doprocesscontent##1#1%
-% {\egroup\long\def#2{\scantokens{##1}}#3}%
-% \doprocesscontent}
-%
-%\endETEX
-
-%D \macros
-%D {dogobblesingleempty, dogobbledoubleempty}
-%D
-%D These two macros savely grab and dispose two arguments.
-
-\def\dogobblesingleempty{\dosingleempty\dodogobblesingleempty}
-\def\dogobbledoubleempty{\dodoubleempty\dodogobbledoubleempty}
-
-\def\dodogobblesingleempty [#1]{}
-\def\dodogobbledoubleempty[#1][#2]{}
-
-\let\gobblesingleempty\dogobblesingleempty % also used
-\let\gobbledoubleempty\dogobbledoubleempty % also used
-
-%D \macros
-%D {sortcommalist,sortcommacommand,
-%D donumericcompare,comparedresult}
-%D
-%D Sometimes we need to sort a commalist, so here is Taco's
-%D solution. This will in many cases be a list that is stored
-%D in a \type{\csname}, so both commalist and commacommands are
-%D supported. The sorting algorithm is very simple, so the list
-%D should not be too long or sorting will be very slow.
-%D
-%D \starttyping
-%D \sortcommalist[10,2,4,5,6,1,2,3,4,10,20]\donumericcompare
-%D
-%D \def\test{10,2,4,5,6,1,2,3,4,10,20}
-%D
-%D \sortcommacommand[\test]\donumericcompare
-%D \stoptyping
-%D
-%D In both cases, the result is available in the macro \type
-%D {\sortedcommalist}.
-%D
-%D Parameter \type{#2} is a macro that should accept two
-%D parameters, and it has to decide which one is larger, by
-%D setting the counter \type{\comparedresult} to~0 (for equal),
-%D 1~(if it's first argument is larger), or~2 (if it's second
-%D argument is larger).
-%D
-%D As said, these macro are largely written by Taco, and are
-%D (maybe therefore) also the first application of \type
-%D {\replaceincommalist}.
-
-\newcount\comparedresult
-
-\def\sortcommacommand[#1]%
- {\@EA\sortcommalist\@EA[#1]}
-
-\def\sortcommalist[#1]#2%
- {\getcommalistsize[#1]%
- \ifnum\commalistsize>1
- \let\sortedcommalist\empty
- \let\comparecommand#2%
- \processcommalist[#1]\dosortcommacommand
- \else
- \def\sortedcommalist{#1}%
- \fi}
-
-\def\dosortcommacommand#1%
- {\ifx\sortedcommalist\empty
- \def\sortedcommalist{#1}%
- \else
- \def\!!tempa{#1}%
- \ifx\!!tempa\empty\else
- \scratchcounter\plusone
- \@EA\getcommalistsize\@EA[\sortedcommalist]%
- \@EA\processcommalist\@EA[\sortedcommalist]\docompareitems
- \fi
- \fi}
-
-%D All those \type{\expandafter}'s are there because I do not
-%D want to use \type{\edef}.
-
-\def\docompareitems#1%
- {\doifnotempty{#1}
- {\@EA\comparecommand\@EA{\!!tempa}{#1}\relax
- %\ifcase\compareresult % equal
- \ifnum\comparedresult<2
- \ifnum\scratchcounter=\commalistsize
- \@EA\@EA\@EA\def\@EA\@EA\@EA\sortedcommalist
- \@EA\@EA\@EA{\@EA\sortedcommalist\@EA,\!!tempa}%
- \fi
- %\or % new element larger
- % \ifnum\scratchcounter=\commalistsize
- % \@EA\@EA\@EA\def\@EA\@EA\@EA\sortedcommalist
- % \@EA\@EA\@EA{\@EA\sortedcommalist\@EA,\!!tempa}%
- % \fi
- \else % old element larger
- \@EA\def\@EA\newcommalistelement\@EA{\!!tempa,#1}%
- \replaceincommalist\sortedcommalist\scratchcounter
- \expandafter\quitcommalist
- \fi}%
- \advance\scratchcounter \plusone} % bug, was \minusone
-
-%D The macro \type{\donumericcompare} considers everything
-%D that is not a number to be larger than any number.
-
-\def\donumericcompare#1#2%
- {\doifnumberelse{#1}
- {\doifnumberelse{#2}
- {\ifnum#1>#2\relax
- \comparedresult\plusone % #1 is larger
- \else\ifnum#1<#2\relax
- \comparedresult\plustwo % #2 is larger
- \else
- \comparedresult\zerocount % both are equal
- \fi\fi}
- {\comparedresult\plustwo}}
- {\comparedresult\plusone}}
-
-%D \macros
-%D {@True, @False, @Not, @And}
-%D
-%D Some predicate logic functions, used in for instance the
-%D math module.
-
-\def\@True {00}
-\def\@False {01}
-\def\@Not #1{0\ifcase#11 \or\@EA 1\else \@EA 0\fi}
-\def\@And #1#2{0\ifcase#1#2 \@EA 0\else \@EA 1\fi}
-
-%D \macros
-%D {setdimensionwithunit, freezedimensionwithunit}
-%D
-%D The next assignments are all valid:
-%D
-%D \starttyping
-%D \setdimensionwithunit\scratchdimen{10} {cm}
-%D \setdimensionwithunit\scratchdimen{10cm}{cm}
-%D \setdimensionwithunit\scratchdimen{10cm}{}
-%D \freezedimensionwithunit\SomeWidth{\textwidth}
-%D \freezedimensionwithunit\SomeDepth{\dp\strutbox}
-%D \stoptyping
-%D
-%D As an alternative for the next macro we can use a global
-%D assignment inside a box. The \type{\empty}'s permits
-%D gobbling while preventing spurious \type{\relax}'s.
-
-\def\setdimensionwithunit#1#2#3% number unit dimension / nice trick
- {\afterassignment\gobblefourarguments#1=#2#3pt\relax\empty\empty\empty\empty}
-
-\def\freezedimensionwithunit#1#2%
- {\setdimensionwithunit\scratchdimen#1{#2}\edef#1{\the\scratchdimen}}
-
-%D \macros
-%D {doifsometokselse}
-%D
-%D Not that fast I guess, but here's a way to test for token
-%D registers being empty.
-
-\def\doifsometokselse#1% % #2#3%
- {\edef\!!stringa{\the#1}%
- \ifx\!!stringa\empty % #3\else#2\fi}
- \expandafter\secondoftwoarguments
- \else
- \expandafter\firstoftwoarguments
- \fi}
-
-%D \macros
-%D {startstrictinspectnextcharacter}
-%D
-%D This one if for Taco's bibliography module:
-
-\let\normalinspectnextcharacter\inspectnextcharacter
-
-\def\strictinspectnextcharacter% no user macro !
- {\ifx\nexttoken\charactertoken
- \expandafter\!!stringa
- \else
- \expandafter\!!stringb
- \fi}
-
-% better: push/pop
-
-\def\startstrictinspectnextcharacter
- {\let\inspectnextcharacter\strictinspectnextcharacter}
-
-\def\stopstrictinspectnextcharacter
- {\let\inspectnextcharacter\normalinspectnextcharacter}
-
-\def\strictdoifnextoptionalelse#1#2%
- {\startstrictinspectnextcharacter
- \doifnextcharelse[{\stopstrictinspectnextcharacter#1}{\stopstrictinspectnextcharacter#2}}
-
-%D \macros
-%D {gobblespacetokens}
-%D
-%D This macro needs a speed-up!
-
-%\def\gobblespacetokens
-% {\doifnextcharelse\empty\donothing\donothing} % no {}\do\do !
-
-\def\gobblespacetokens
- {\afterassignment\nexttoken\let\nexttoken=}
-
-%D \macros
-%D {verbatimargument}
-%D
-%D As the name says, this macro converts its argument to a
-%D (rather safe) string.
-
-\def\verbatimstring#1%
- {\convertargument#1\to\ascii\ascii}
-
-%D These are needed in ordinal number conversions:
-
-\def\lastdigit#1%
- {\@EA\thelastdigit\number#1\relax}
-
-\def\thelastdigit#1#2%
- {\ifx#2\relax#1\else\@EA\thelastdigit\@EA#2\fi}
-
-\def\lasttwodigits#1%
- {\@EA\thelasttwodigits\@EA0\number#1\relax}
-
-\def\thelasttwodigits#1#2#3% 0 dig ... \relax
- {\ifx#3\relax#1#2\else\@EA\thelasttwodigits\@EA#2\@EA#3\fi}
-
-%D \macros
-%D {serializecommalist}
-%D
-%D Concatenate commalists:
-
-\def\serializecommalist[#1]%
- {\let\serializedcommalist\empty
- \def\docommand##1{\edef\serializedcommalist{\serializedcommalist##1}}%
- \processcommacommand[#1]\docommand}
-
-%D \macros
-%D {purenumber}
-%D
-%D Sometimes we need control over when \TEX\ stops reading a
-%D number, especially in full expandable macros where using
-%D \type {\relax} would lead to disasters.
-%D
-%D \starttyping
-%D \ifodd\purenumber{...}\space ... \else ... \fi
-%D \stoptyping
-%D
-%D Here we use a space as number delimiter in combination
-%D with a space- and relax-less \type {\purenumber}. This
-%D macro works ok with \type {\the}, \type {\number} as well
-%D as \ETEX's \type {\numexpr}.
-
-\def\purenumber#1{\@EA\firstofoneargument\@EA{\number#1}}
-
-%D \macros
-%D {filterfromvalue}
-%D
-%D \starttyping
-%D \setvalue{xx}{{A}{B}{C}}
-%D
-%D \filterfromvalue{xx}{3}{3}
-%D \filterfromvalue{xx}{3}{2}
-%D \filterfromvalue{xx}{3}{1}
-%D \stoptyping
-%D
-%D An alternative is to store 'max' in the list, say:
-%D
-%D \starttyping
-%D \setvalue{xx}{3{A}{B}{C}}
-%D
-%D \filterfromvalues{3}{xx}{3}
-%D \filterfromvalues{3}{xx}{2}
-%D \filterfromvalues{3}{xx}{1}
-%D \stoptyping
-%D
-%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
- \dofilterfromstr{#2}{#3}%
- \fi
- \endcsname\csname#1\endcsname}
-
-\def\filterfromnext#1#2% max n {..}{..}{..}{..}
- {\csname\dofilterfromstr{#1}{#2}\endcsname}
-
-%D \macros
-%D {definemeasure}
-%D
-%D \starttyping
-%D \definemeasure[mywidth][\dimexpr(\textwidth-1cm)]
-%D
-%D ... \measure{mywidth} ...
-%D \stoptyping
-
-\def\??dm{@@dm} % brrr
-
-\def\definemeasure
- {\dodoubleargument\dodefinemeasure}
-
-\def\dodefinemeasure[#1][#2]%
- {\setvalue{\??dm#1}{#2}}
-
-% #2 could be omitted, but we want to support spaces
-%
-% \setmeasure {x} {1cm}
-% \setmeasure {xx} {1cm}
-% \setmeasure {xxx}{1cm}
-
-\def\setmeasure #1#2{\setvalue{\??dm#1}{#2}} % quick way
-\def\setemeasure#1#2{\setevalue{\??dm#1}{#2}} % quick way
-\def\setgmeasure#1#2{\setgvalue{\??dm#1}{#2}} % quick way
-\def\setxmeasure#1#2{\setxvalue{\??dm#1}{#2}} % quick way
-
-\def\measure#1%
- {\ifcsname\??dm#1\endcsname\csname\??dm#1\endcsname\else\zeropoint\fi}
-
-%D \macros
-%D {doifdimensionelse}
-%D
-%D This is a dirty one: we simply append a unit and discard it when needed.
-
-\def\doifdimensionelse#1%
- {\afterassignment\dodoifdimensionelse\scratchdimen#1pt\relax}
-
-\def\dodoifdimensionelse#1%
- {\ifx#1\relax
- \expandafter\secondoftwoarguments
- \else % #1=p ... t\relax
- \expandafter\thirdoffourarguments
- \fi}
-
-%D \macros
-%D {comparedimension,comparedimensioneps}
-%D
-%D This is a dirty one: we simply append a unit and discard it when needed.
-
-\newdimen\roundingeps \roundingeps=10sp
-
-\def\comparedimension#1#2%
- {\chardef\compresult
- \ifdim#1<#2%
- \zerocount
- \else\ifdim#1<#2%
- \plusone
- \else
- \plustwo
- \fi\fi}
-
-\beginETEX
-
-\def\comparedimensioneps#1#2%
- {\chardef\compresult
- \ifdim\dimexpr#1-#2\relax<\roudingeps
- \zerocount
- \else\ifdim\dimexpr#2-#1\relax<\roudingeps
- \zerocount
- \else\ifdim#1<#2%
- \plusone
- \else
- \plustwo
- \fi\fi\fi}
-
-\endETEX
-
-\beginTEX
-
-\newdimen\comparedimen
-
-\def\comparedimensioneps#1#2%
- {\comparedimen#1\advance\comparedimen-#2\relax
- \chardef\compresult
- \ifdim\comparedimen<\roudingeps
- \zerocount
- \else\ifdim-\comparedimen<\roudingeps
- \zerocount
- \else\ifdim#1<#2%
- \plusone
- \else
- \plustwo
- \fi\fi\fi}
-
-\endTEX
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/syst-fnt.mkii b/Master/texmf-dist/tex/context/base/mkii/syst-fnt.mkii
deleted file mode 100644
index 5669475a634..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/syst-fnt.mkii
+++ /dev/null
@@ -1,46 +0,0 @@
-%D \module
-%D [ file=syst-fnt,
-%D version=2006.08.11,
-%D title=\CONTEXT\ System Macros,
-%D subtitle=Font Things,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% formal names cf the tb \& tbt
-
-\unprotect
-
-\def\fontslantperpoint {\fontdimen\plusone }
-\def\fontinterwordspace {\fontdimen\plustwo }
-\def\fontinterwordstretch{\fontdimen\plusthree}
-\def\fontinterwordshrink {\fontdimen\plusfour }
-\def\fontexheight {\fontdimen\plusfive }
-\def\fontemwidth {\fontdimen\plussix }
-\def\fontextraspace {\fontdimen\plusseven}
-
-\def\slantperpoint {\fontdimen\plusone \font}
-\def\interwordspace {\fontdimen\plustwo \font}
-\def\interwordstretch {\fontdimen\plusthree\font}
-\def\interwordshrink {\fontdimen\plusfour \font}
-\def\exheight {\fontdimen\plusfive \font}
-\def\emwidth {\fontdimen\plussix \font}
-\def\extraspace {\fontdimen\plusseven\font}
-
-\def\mathsupdisplay {\fontdimen13 }
-\def\mathsupnormal {\fontdimen14 }
-\def\mathsupcramped {\fontdimen15 }
-\def\mathsubnormal {\fontdimen16 }
-\def\mathsubcombined {\fontdimen17 }
-\def\mathaxisheight {\fontdimen22 }
-
-\def\currentspaceskip {\interwordspace\!!plus\interwordstretch\!!minus\interwordshrink\relax}
-
-\def\mathstacktotal {\dimexpr\fontdimen10\scriptfont\plustwo+\fontdimen12\scriptfont\plustwo\relax}
-\def\mathstackvgap {\plusthree\fontdimen8\scriptfont\plusthree}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/syst-gen.mkii b/Master/texmf-dist/tex/context/base/mkii/syst-gen.mkii
deleted file mode 100644
index 8b71b77d5fc..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/syst-gen.mkii
+++ /dev/null
@@ -1,4459 +0,0 @@
-%D \module
-%D [ file=syst-gen,
-%D version=1996.03.20,
-%D title=\CONTEXT\ System Macros,
-%D subtitle=General,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% 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
-%D macros are optimized as far as possible within of course,
-%D the know how of the author.
-%D
-%D In this module we also show some of the optimizations,
-%D mainly because we don't want to forget them and start doing
-%D things over and over again. If showing them has a learing
-%D effect for others too, we've surved another purpose too.
-
-%D \macros
-%D {abortinputifdefined}
-%D
-%D Because this module can be used in a different context, we
-%D want to prevent it being loaded more than once. This can be
-%D done using:
-%D
-%D \starttyping
-%D \abortinputifdefined\command
-%D \stoptyping
-%D
-%D where \type{\command} is a command defined in the module
-%D to be loaded only once.
-%D
-%D \starttyping
-%D \def\abortinputifdefined#1%
-%D {\ifx#1\undefined
-%D \let\next=\relax
-%D \else
-%D \let\next=\endinput
-%D \fi
-%D \next}
-%D \stoptyping
-%D
-%D This macro can be speed up in terms of speed as well as
-%D memory. Because this is a nice example of a bit strange
-%D command (\type{\endinput}), we spend some more lines on this.
-%D
-%D If we perform such actions directly, we can say:
-%D
-%D \starttyping
-%D \ifx\somecommand\undefined
-%D \let\next=\relax
-%D \else
-%D \let\next=\endinput
-%D \fi
-%D \next
-%D \stoptyping
-%D
-%D We need the \type{\next} because we need to end the
-%D \type{\fi}. The efficient one is:
-%D
-%D \starttyping
-%D \ifx\somecommand\undefined
-%D \else
-%D \expandafter\endinput
-%D \fi
-%D \stoptyping
-%D
-%D Because \type{\endinput} comes into action after the current
-%D line, we can also say:
-%D
-%D \starttyping
-%D \ifx\somecommand\undefined \else \endinput \fi
-%D \stoptyping
-%D
-%D When we define a macro, we tend to use a format which
-%D shows as besat as can how things are done. \TEX\ however
-%D stores the definitions as a sequence of tokens, so in fact
-%D we can use a formatted definition:
-
-\def\abortinputifdefined#1%
- {\ifx#1\undefined \else
- \endinput
- \fi}
-
-%D which also works. Keep in mind that this is entirely due to
-%D the fact that \type{\endinput} after the line, i.e. at the
-%D end of the macro. We therefore can burry this primitive quite
-%D deep in code.
-
-%D And because this module implements \type{\writestatus}, we
-%D just say:
-
-% \abortinputifdefined\writestatus
-
-%D \macros
-%D {overloaded, superseded, forwarded, predefined}
-%D
-%D This prefix is used as signal for the \CONTEXT\ dependency
-%D checking features. The first four prefixes don't do anything
-%D useful, apart from signaling parsers.
-
-\def\overloaded{} % local change at the macro level
-\def\superseded{} % global change at the module level, replaces previous definitions
-\def\predefined{} % defined (first) here, but may be redefined anytime (no need for \overloaded)
-\def\forwarded {} % definition at the module level, only done when undefined
-
-\def\forwarded#1#2{\ifx#2\undefined\else\expandafter\gobbleforwarded\fi#1#2}
-
-\def\gobbleforwarded#1
- {}
-
-%D Normally we tell the users what module is being loaded.
-%D However, the command that is needed for this is not yet
-%D defined.
-%D
-%D \starttyping
-%D \writestatus{laden}{Context Systeem Macros (a)}
-%D \stoptyping
-
-%D The next few macros are needed in case this module is
-%D used outside \CONTEXT.
-
-\ifx\beginTEX\undefined
- \let\beginTEX\relax\let\endTEX\relax
- \long\def\beginETEX #1\endETEX {}
-\fi
-
-%D \macros
-%D [protecting]
-%D {protect,unprotect}
-%D
-%D We can shield macros from users by using some special
-%D characters in their names. Some characters that are normally
-%D no letters and therefore often used are: \type{@}, \type{!}
-%D and \type{?}. Before and after the definition of protected
-%D macros, we have to change the \CATCODE\ of these characters.
-%D This is done by \type{\unprotect} and \type{\protect}, for
-%D instance:
-%D
-%D \starttyping
-%D \unprotect
-%D \def\!test{test}
-%D \protect
-%D \stoptyping
-%D
-%D The defined command \type{\!test} can of course only be
-%D called upon when we are in the \type{\unprotect}'ed state,
-%D otherwise \TEX\ reads \type{\!} and probably complains
-%D loudly about not being in math mode.
-%D
-%D Both commands can be used nested, but only the \CATCODE\
-%D of the outermost level is saved. We make use of
-%D an auxilary macro \type{\doprotect} to prevent us from
-%D conflicts with existing macro's \type{\protect}. When
-%D nesting deeper than one level, the system shows the
-%D protection level.
-
-\ifx\protectionlevel\undefined \newcount\protectionlevel \fi
-
-\ifx\protect\undefined
- \def\protect{\writestatus{protection}{too much protection}}
-\else
- % a simple version is already defined
-\fi
-
-\let\normalprotect\protect % only for latex
-
-%D Although we don't need the \type{%} after commands that
-%D don't take arguments, unless lines are obeyed, I decided
-%D to put it there as a reminder. I only mention this once.
-
-\ifx\unprotect\undefined
-
- \chardef\protectionthreshold=10
-
- \def\saveprotectedcharacters
- {\edef\doprotectcharacters
- {\catcode`\noexpand @\the\catcode`@
- \catcode`\noexpand !\the\catcode`!
- \catcode`\noexpand ?\the\catcode`? }}
-
- \def\setprotectedcharacters
- {\catcode`@=11
- \catcode`!=11
- \catcode`?=11 }
-
- \def\unprotect
- {\ifcase\protectionlevel
- \saveprotectedcharacters
- \let\protect\doprotect
- \fi
- \setprotectedcharacters
- \advance\protectionlevel 1
- \ifnum\protectionlevel>\protectionthreshold
- \reportunprotection
- \fi}
-
- \def\doprotect
- {\ifcase\protectionlevel\or
- \doprotectcharacters
- \let\doprotectcharacters\relax
- \let\protect\normalprotect
- \fi
- \ifnum\protectionlevel>\protectionthreshold
- \reportprotection
- \fi
- \advance\protectionlevel -1 }
-
- \def\reportunprotection {\writestatus{protection}{unprotect \protectionstate}}
- \def\reportprotection {\writestatus{protection}{protect \protectionstate}}
- \def\reportprotectionstate{\writestatus{protection}{state \protectionstate}}
-
- \def\protectionstate
- {\the\protectionlevel
- \ifcase\protectionthreshold
- :\space
- @=\the\catcode`@\space\space
- !=\the\catcode`!\space\space
- ?=\the\catcode`?%
- \fi}
-
- \ifx\everyeof\undefined
- \let\checkprotection\relax
- \else
- \def\checkprotection{\everyeof{\writestatus{protection}{state: \protectionstate}}}
- \fi
-
-\else
-
- \let\reportprotectionstate\relax
-
-\fi
-
-%D Now it is defined, we can make use of this very useful
-%D macro.
-
-\unprotect
-
-%D \macros
-%D {@@escape,@@begingroup,@@endgroup,@@mathshift,@@alignment,
-%D @@endofline,@@parameter,@@superscript,@@subscript,
-%D @@ignore,@@space,@@letter,@@other,@@active,@@comment}
-%D
-%D In \CONTEXT\ we sometimes manipulate the \CATCODES\ of
-%D certain characters. Because we are not that good at numbers,
-%D we introduce some symbolic names.
-
-\chardef\@@escape = 0
-\chardef\@@begingroup = 1
-\chardef\@@endgroup = 2
-\chardef\@@mathshift = 3
-\chardef\@@alignment = 4
-\chardef\@@endofline = 5
-\chardef\@@parameter = 6
-\chardef\@@superscript = 7
-\chardef\@@subscript = 8
-\chardef\@@ignore = 9
-\chardef\@@space = 10
-\chardef\@@letter = 11
-\chardef\@@other = 12 \chardef\other = 12
-\chardef\@@active = 13 \chardef\active = 13
-\chardef\@@comment = 14
-
-%D \macros
-%D {normalspace}
-%D
-%D We often need a space as defined in \PLAIN\ \TEX. Because
-%D we cannot be sure of \type{\space} is redefined, we define:
-
-\def\normalspace{ }
-
-%D \macros
-%D {scratchcounter,
-%D scratchdimen,scratchskip,scratchmuskip,
-%D scratchbox,
-%D scratchtoks}
-%D
-%D Because we often need counters on a temporary basis, we
-%D define the \COUNTER\ \type{\scratchcounter}. This is a
-%D real \COUNTER, and not a pseudo one, as we will meet
-%D further on. We also define some other scratch registers.
-
-\chardef\newabovelimit=20
-
-\def\stripnewabove#1%
- {\ifnum10<9#1 #1\else\expandafter\stripnewabove\fi}%
-
-\def\newabove#1#2% \dimen \name
- {#1#2%
- \ifnum\expandafter\stripnewabove\meaning#2>\newabovelimit\else
- \expandafter\newabove\expandafter#1\expandafter#2%
- \fi}
-
-\newabove \newcount \scratchcounter \newabove \newcount \globalscratchcounter
-\newabove \newdimen \scratchdimen \newabove \newdimen \globalscratchdimen
-\newabove \newskip \scratchskip \newabove \newskip \globalscratchskip
-\newabove \newmuskip \scratchmuskip \newabove \newmuskip \globalscratchmuskip
-\newabove \newtoks \scratchtoks \newabove \newtoks \globalscratchtoks
- \newbox \scratchbox \newbox \globalscratchbox
-
-\newdimen\scratchdimenone \newbox\scratchboxone \newcount\scratchcounterone
-\newdimen\scratchdimentwo \newbox\scratchboxtwo \newcount\scratchcountertwo
-
-%D \macros
-%D {ifdone}
-
-\newif\ifdone
-
-%D \macros
-%D {ifCONTEXT}
-%D
-%D In the system and support modules we sometimes show examples
-%D that make use of core commands. We can skip those parts of
-%D the documentation when we use another macropackage. Of
-%D course we default to false.
-
-\newif \ifCONTEXT
-
-%D \macros
-%D {!!count, !!toks, !!dimen, !!box,
-%D !!width, !!height, !!depth, !!string, !!done}
-%D
-%D We define some more \COUNTERS\ and \DIMENSIONS. We also
-%D define some shortcuts to the local scatchregisters~0, 2, 4,
-%D 6 and~8.
-
-\newcount\!!counta \toksdef\!!toksa=0 \dimendef\!!dimena= 0 \chardef\!!boxa =0
-\newcount\!!countb \toksdef\!!toksb=2 \dimendef\!!dimenb= 2 \chardef\!!boxb =2
-\newcount\!!countc \toksdef\!!toksc=4 \dimendef\!!dimenc= 4 \chardef\!!boxc =4
-\newcount\!!countd \toksdef\!!toksd=6 \dimendef\!!dimend= 6 \chardef\!!boxd =6
-\newcount\!!counte \toksdef\!!tokse=8 \dimendef\!!dimene= 8 \chardef\!!boxe =8
-\newcount\!!countf \dimendef\!!dimenf=10 %skipdef\!!skipa=0
- \dimendef\!!dimeng=12 %skipdef\!!skipb=2
- \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
-
-\newdimen\!!widtha \newdimen\!!heighta \newdimen\!!deptha
-\newdimen\!!widthb \newdimen\!!heightb \newdimen\!!depthb
-\newdimen\!!widthc \newdimen\!!heightc \newdimen\!!depthc
-
-\newif\if!!donea \newif\if!!doneb \newif\if!!donec
-\newif\if!!doned \newif\if!!donee \newif\if!!donef
-
-\ifx\data\undefined \else \let\data \relax \fi % dep checker
-
-%D Beware: we don't reuse plain counters, too dangerous
-%D when <= 20 (e.g. in supp-pdf this messed up things).
-
-\ifx\undefined\zeroskip \newskip \zeroskip \fi
-\ifx\undefined\zeropoint \newdimen \zeropoint \fi
-\ifx\undefined\zerocount \newcount \zerocount \fi
-\ifx\undefined\minusone \newcount \minusone \fi \minusone = -1
-\ifx\undefined\minustwo \newcount \minustwo \fi \minustwo = -2
-\ifx\undefined\plusone \chardef \plusone = 1 \fi
-\ifx\undefined\plustwo \chardef \plustwo = 2 \fi
-\ifx\undefined\plusthree \chardef \plusthree = 3 \fi
-\ifx\undefined\plusfour \chardef \plusfour = 4 \fi
-\ifx\undefined\plusfive \chardef \plusfive = 5 \fi
-\ifx\undefined\plusten \mathchardef \plusten = 10 \fi
-\ifx\undefined\plushundred \mathchardef \plushundred = 100 \fi
-\ifx\undefined\plusthousand \mathchardef \plusthousand = 1000 \fi
-\ifx\undefined\plustenthousand \mathchardef \plustenthousand = 10000 \fi
-\ifx\undefined\plustwentythousand \mathchardef \plustwentythousand = 20000 \fi
-
-%D \macros
-%D {s!,c!,e!,p!,v!,@@,??}
-%D
-%D To save memory, we use constants (sometimes called
-%D variables). Redefining these constants can have desastrous
-%D results.
-
-\def\v!prefix! {v!} \def\c!prefix! {c!}
-\def\s!prefix! {s!} \def\p!prefix! {p!}
-
-\def\s!next {next} \def\s!default {default}
-\def\s!dummy {dummy} \def\s!unknown {unknown}
-
-\def\s!do {do} \def\s!dodo {dodo}
-
-\def\s!complex {complex} \def\s!start {start}
-\def\s!simple {simple} \def\s!stop {stop}
-
-\def\s!empty {empty}
-
-%D \macros
-%D {@EA,@EAEA,@EAEAEA,@EAEAEAEAEAEA,expanded,startexpanded}
-%D
-%D When in unprotected mode, to be entered with
-%D \type{\unprotect}, one can use \type{\@EA} as equivalent
-%D of \type{\expandafter}.
-
-\let\@NX\noexpand
-\let\@EA\expandafter
-
-\def\@EAEA {\expandafter\expandafter}
-\def\@EAEAEA{\expandafter\expandafter\expandafter}
-
-\def\@EAEAEAEAEAEA{\expandafter\@EAEAEA\expandafter}
-
-%D Sometimes we pass macros as arguments to commands that
-%D don't expand them before interpretation. Such commands can
-%D be enclosed with \type{\expanded}, like:
-%D
-%D \starttyping
-%D \expanded{\setupsomething[\alfa]}
-%D \stoptyping
-%D
-%D Such situations occur for instance when \type{\alfa} is a
-%D commalist or when data stored in macros is fed to index of
-%D list commands. If needed, one should use \type{\noexpand}
-%D inside the argument. Later on we will meet some more clever
-%D alternatives to this command.
-
-\long\def\@@expanded{} % always long; global (less restores)
-
-\long\def\expanded#1%
- {\long\xdef\@@expanded{\noexpand#1}\@@expanded}
-
-%D Beware, the next one has no \type {\noexpand} before its
-%D argument.
-
-\long\def\startexpanded#1\stopexpanded % see x-fo for example
- {\long\xdef\@@expanded{#1}\@@expanded}
-
-%D \macros
-%D {safeexpanded,everysafeexpanded}
-%D
-%D In addition we provide:
-
-\newtoks\everysafeexpanded
-
-\long\def\safeexpanded#1% why the \noexpand
- {\begingroup
- \the\everysafeexpanded\long\xdef\@@expanded{\noexpand#1}%
- \endgroup
- \@@expanded}
-
-\def\safeedef#1#2%
- {\begingroup
- \the\everysafeexpanded\long\xdef\@@expanded{\noexpand#2}%
- \endgroup
- \let#1\@@expanded}
-
-\def\safexdef#1#2%
- {\begingroup
- \the\everysafeexpanded\long\xdef\@@expanded{\noexpand#2}%
- \endgroup
- \global\let#1\@@expanded}
-
-%D You can append protective measures to the token register if
-%D needed, as we will do later.
-
-%D \macros
-%D {expandoneargafter,expandtwoargsafter}
-%D
-%D These two commands make macros more readable by hiding a
-%D lot of \type {\expandafter}'s. They expand the arguments
-%D after the first command.
-%D
-%D \starttyping
-%D \expandoneargafter \command{\abc}
-%D \expandtwoargsafter\command{\abc}{\def}
-%D \stoptyping
-%D
-%D These commands expect the arguments to be macros.
-
-\def\expandoneargafter #1{\@EA#1\@EA}
-\def\expandtwoargsafter#1#2{\@EA\@EA\@EA#1\@EA\@EA\@EA{\@EA#2\@EA}\@EA}
-
-%D These two do a full expansion:
-
-\def\fullexpandoneargafter #1#2{\long\xdef\@@expanded{\noexpand#1{#2}}\@@expanded}
-\def\fullexpandtwoargsafter#1#2#3{\long\xdef\@@expanded{\noexpand#1{#2}{#3}}\@@expanded}
-
-%D \macros
-%D {gobbleoneargument,gobble...arguments}
-%D
-%D The next set of macros just do nothing, except that they
-%D get rid of a number of arguments.
-
-\long\def\gobbleoneargument #1{}
-\long\def\gobbletwoarguments #1#2{}
-\long\def\gobblethreearguments #1#2#3{}
-\long\def\gobblefourarguments #1#2#3#4{}
-\long\def\gobblefivearguments #1#2#3#4#5{}
-\long\def\gobblesixarguments #1#2#3#4#5#6{}
-\long\def\gobblesevenarguments #1#2#3#4#5#6#7{}
-\long\def\gobbleeightarguments #1#2#3#4#5#6#7#8{}
-\long\def\gobbleninearguments #1#2#3#4#5#6#7#8#9{}
-\long\def\gobbletenarguments #1{\gobbleninearguments}
-
-%D \macros
-%D {doifnextcharelse}
-%D
-%D When we started using \TEX\ in the late eighties, our
-%D first experiences with programming concerned a simple shell
-%D around \LATEX. The commands probably use most at \PRAGMA,
-%D are the itemizing ones. One of those few shell commands took
-%D care of an optional argument, that enabled us to specify
-%D what kind of item symbol we wanted. Without understanding
-%D anything we were able to locate a \LATEX\ macro that could
-%D be used to inspect the next character.
-%D
-%D It's this macro that the ancester of the next one presented
-%D here. It executes one of two actions, dependant of the next
-%D character. Disturbing spaces and line endings, which are
-%D normally interpreted as spaces too, are skipped.
-%D
-%D \starttyping
-%D \doifnextcharelse {karakter} {then ...} {else ...}
-%D \stoptyping
-%D
-%D This macro differs from the original in the use of \type
-%D {\localnext} because we don't want clashes with \type
-%D {\next}.
-
-\long\def\doifnextcharelse#1#2#3% #1 should not be {} !
- {\let\charactertoken=#1% = needed here
- \def\!!stringa{#2}%
- \def\!!stringb{#3}%
- \futurelet\nexttoken\inspectnextcharacter}
-
-\def\inspectnextcharacter
- {\ifx\nexttoken\blankspace
- \@EA\reinspectnextcharacter
- \else\ifx\nexttoken\charactertoken
- \@EAEAEA\!!stringa
- \else
- \@EAEAEA\!!stringb
- \fi\fi}
-
-%D Because we will mostly use this macro for testing if the next
-%D character is \type {[}, we also make a slightly faster variant
-%D as it is not uncommon to have tens of thousands of calls to this
-%D test in a run. Of course it also is more convenient to read a
-%D trace then.
-
-\let\nextoptionalcharactertoken=[
-
-\long\def\doifnextoptionalelse#1#2%
- {\def\nextoptionalcommandyes{#1}%
- \def\nextoptionalcommandnop{#2}%
- \futurelet\nexttoken\inspectnextoptionalcharacter}
-
-\def\inspectnextoptionalcharacter
- {\ifx\nexttoken\blankspace
- \@EA\reinspectnextoptionalcharacter
- \else\ifx\nexttoken\nextoptionalcharactertoken
- \@EAEAEA\nextoptionalcommandyes
- \else
- \@EAEAEA\nextoptionalcommandnop
- \fi\fi}
-
-\let\nextbgroupcharactertoken\bgroup
-
-\long\def\doifnextbgroupelse#1#2%
- {\def\nextbgroupcommandyes{#1}%
- \def\nextbgroupcommandnop{#2}%
- \futurelet\nexttoken\inspectnextbgroupcharacter}
-
-\def\inspectnextbgroupcharacter
- {\ifx\nexttoken\blankspace
- \@EA\reinspectnextbgroupcharacter
- \else\ifx\nexttoken\nextbgroupcharactertoken
- \@EAEAEA\nextbgroupcommandyes
- \else
- \@EAEAEA\nextbgroupcommandnop
- \fi\fi}
-
-%D This macro uses some auxiliary macros. Although we were able
-%D to program quite complicated things, I only understood these
-%D after rereading the \TEX book. The trick is in using a
-%D command with a one character name. Such commands differ from
-%D the longer ones in the fact that trailing spaces are {\em
-%D not} skipped. This enables us to indirectly define a long
-%D named macro that gobbles a space.
-%D
-%D In the first line we define \type{\blankspace}. Next we
-%D make \type{\:} equivalent to \type{\reinspect...}. This
-%D one||character command is expanded before the next
-%D \type{\def} comes into action. This way the space after
-%D \type{\:} becomes a delimiter of the longer named
-%D \type{\reinspectnextcharacter}. The chain reaction is
-%D visually compatible with the next sequence:
-%D
-%D \starttyping
-%D \expandafter\def\reinspectnextcharacter %
-%D {\futurelet\nexttoken\inspectnextcharacter}
-%D \stoptyping
-%D
-%D However complicated it may look, I'm still glad I stumbled
-%D into this construction. Saving and restoring \type {\:} is
-%D needed when we use \PPCHTEX\ in \LATEX.
-
-\let\next\:
-
-\def\:{\let\blankspace= } \:
-
-\def\:{\reinspectnextcharacter}
-\expandafter\def\: {\futurelet\nexttoken\inspectnextcharacter}
-
-\def\:{\reinspectnextoptionalcharacter}
-\expandafter\def\: {\futurelet\nexttoken\inspectnextoptionalcharacter}
-
-\def\:{\reinspectnextbgroupcharacter}
-\expandafter\def\: {\futurelet\nexttoken\inspectnextbgroupcharacter}
-
-\let\:\next
-
-%D \macros
-%D {setvalue,setgvalue,setevalue,setxvalue,
-%D letvalue,
-%D getvalue,
-%D resetvalue}
-%D
-%D \TEX's primitive \type{\csname} can be used to construct
-%D all kind of commands that cannot be defined with
-%D \type{\def} and \type{\let}. Every macro programmer sooner
-%D or later wants macros like these.
-%D
-%D \starttyping
-%D \setvalue {name}{...} = \def\name{...}
-%D \setgvalue {name}{...} = \gdef\name{...}
-%D \setevalue {name}{...} = \edef\name{...}
-%D \setxvalue {name}{...} = \xdef\name{...}
-%D \letvalue {name}=\... = \let\name=\...
-%D \letgvalue {name}=\... = \global\let\name=\...
-%D \getvalue {name} = \name
-%D \resetvalue {name} = \def\name{}
-%D \stoptyping
-%D
-%D As we will see, \CONTEXT\ uses these commands many times,
-%D which is mainly due to its object oriented and parameter
-%D driven character.
-
-\def\setvalue #1{\expandafter \def\csname#1\endcsname}
-\def\setgvalue #1{\expandafter\gdef\csname#1\endcsname}
-\def\setevalue #1{\expandafter\edef\csname#1\endcsname}
-\def\setxvalue #1{\expandafter\xdef\csname#1\endcsname}
-\def\getvalue #1{\csname#1\endcsname}
-\def\letvalue #1{\expandafter\let\csname#1\endcsname}
-\def\letgvalue #1{\global\expandafter\let\csname#1\endcsname}
-\def\resetvalue #1{\expandafter\let\csname#1\endcsname\empty}
-\def\ignorevalue#1#2{\expandafter\let\csname#1\endcsname\empty}
-
-\def\setuvalue #1{\normalprotected\expandafter \def\csname#1\endcsname}
-\def\setuevalue #1{\normalprotected\expandafter\edef\csname#1\endcsname}
-\def\setugvalue #1{\normalprotected\expandafter\gdef\csname#1\endcsname}
-\def\setuxvalue #1{\normalprotected\expandafter\xdef\csname#1\endcsname}
-
-%D \macros
-%D {globallet,glet}
-%D
-%D In \CONTEXT\ of May 2000 using \type {\globallet}
-%D instead of the two tokens will save us some
-%D $300\times4=1200$ bytes of format file on a 32~bit
-%D system. So:
-
-\def\globallet{\global\let} \let\glet\globallet
-
-%D \macros
-%D {donottest,unexpanded}
-%D
-%D When expansion of a macro gives problems, we can precede it
-%D by \type{\donottest}. It seems that protection is one of the
-%D burdens of developers of packages, so maybe that's why in
-%D \ETEX\ protection is solved in a more robust way.
-%D
-%D Sometimes prefixing the macro with \type{\donottest} leads
-%D to defining an auxiliary macro, like
-%D
-%D \starttyping
-%D \def\dosomecommand {... ... ...}
-%D \def\somecommand {\donottest\dosomecommand}
-%D \stoptyping
-%D
-%D This double definition can be made transparant by using
-%D \type{\unexpanded}, as in:
-%D
-%D \starttyping
-%D \unexpanded\def\somecommand{... ... ...}
-%D \stoptyping
-%D
-%D The protection mechanism uses:
-
-\beginTEX
-
-\def\dontprocesstest#1{==}
-\def\doprocesstest #1{#1}
-
-\let\donottest=\doprocesstest
-
-\endTEX
-
-\beginETEX \detokenize
-
-\def\donottest#1{#1} % {\detokenize{#1}}
-
-\endETEX
-
-%D By the way, we use a placeholder because we don't want
-%D interference when testing on empty strings. Using a
-%D placeholder of 8~characters increases the processing time
-%D of simple \type{\doifelse} tests by about 10 \%. When we
-%D process the test, we have to remove the braces and
-%D therefore explictly gobble \type{#1}.
-
-%D \macros
-%D {honorunexpanded,forceunexpanded}
-%D
-%D The fact that many macros have the same prefix, could have
-%D a negative impact on searching in the hash table. Because
-%D some simple testing does not show differences, we just use:
-%D
-%D \starttyping
-%D \def\unexpanded#1#2%
-%D {\@EA#1\@EA#2\@EA{\@EA\donottest\csname\s!do\string#2\endcsname}%
-%D \@EA#1\csname\s!do\string#2\endcsname}
-%D \stoptyping
-%D
-%D Well, in fact we use the bit more versatile alternative. The
-%D \type {\honorunexpanded} can be used to \type {\string}
-%D the protected command, which by the way is seldom needed
-%D in \CONTEXT.
-
-\beginTEX
-
-\def\dosetunexpanded#1#2%
- {\@EA#1\@EA{\@EA#2\@EA}%
- \@EA{\@EA\donottest\csname\s!do\@EA\string\csname#2\endcsname\endcsname}%
- \@EA#1\@EA{\@EA\s!do\@EA\string\csname#2\endcsname}}
-
-\def\docomunexpanded#1#2%
- {\@EA#1\@EA#2\@EA{\@EA\donottest\csname\s!do\string#2\endcsname}%
- \@EA#1\csname\s!do\string#2\endcsname}
-
-\def\unexpanded#1%
- {\def\dounexpanded
- {\ifx\next\bgroup
- \@EA\dosetunexpanded
- \else
- \@EA\docomunexpanded
- \fi#1}%
- \futurelet\next\dounexpanded}
-
-\def\honorunexpanded% for writing to a file or message
- {\def\donottest##1{\expandafter\gobblethreearguments\string##1}}
-
-\def\forceunexpanded% for preventing expansion in \xdef
- {\def\donottest##1%
- {\expandafter\noexpand\csname\expandafter\gobblefourarguments\string##1\endcsname}}
-
-\def\resetunexpanded%
- {\let\donottest\doprocesstest}
-
-\endTEX
-
-\beginETEX \protected
-
-\let \unexpanded \normalprotected
-\let \honorunexpanded \empty % \relax
-\let \forceunexpanded \empty % \relax
-\let \resetunexpanded \empty % \relax
-
-\endETEX
-
-%D This one accepts the more direct \type{\def} and cousins
-%D as well as the \CONTEXT\ specific \type{\setvalue} ones.
-%D
-%D And so the definition in our example turns out to be:
-%D
-%D \starttyping
-%D \def\csname do\somecommand\endcsname{... ... ...}
-%D \def\somecommand{\donottest\csname do\somecommand\endcsname}
-%D \stoptyping
-%D
-%D In which \type{do\somecommand} is hidden from the user and
-%D cannot lead to confusion. It's still permitted to define
-%D auxiliary macros like \type{\dosomecommand}.
-%D
-%D When we are going to use e-\TEX, we'll probably end up
-%D redefining some commands, but we can probably keep the
-%D \type{\unexpanded} ones unchanged.
-
-%D \macros
-%D {doifundefined,doifdefined,
-%D doifundefinedelse,doifdefinedelse,
-%D doifalldefinedelse}
-%D
-%D The standard way of testing if a macro is defined is
-%D comparing its meaning with another undefined one, usually
-%D \type{\undefined}. To garantee correct working of the next
-%D set of macros, \type{\undefined} may never be defined!
-%D
-%D \starttyping
-%D \doifundefined {string} {...}
-%D \doifdefined {string} {...}
-%D \doifundefinedelse {string} {then ...} {else ...}
-%D \doifdefinedelse {string} {then ...} {else ...}
-%D \doifalldefinedelse {commalist} {then ...} {else ...}
-%D \stoptyping
-%D
-%D Every macroname that \TEX\ builds gets an entry in the hash
-%D table, which is of limited size. It is expected that e-\TeX\
-%D will offer a less memory||consuming alternative.
-
-%D Although it will probably never be a big problem, it is good
-%D to be aware of the difference between testing on a macro
-%D name to be build by using \type{\csname} and
-%D \type{\endcsname} and testing the \type{\name} directly.
-%D
-%D \starttyping
-%D \expandafter\ifx\csname NameA\endcsname\relax ... \else ... \fi
-%D
-%D \ifx\NameB\undefined ... \else ... \fi
-%D \stoptyping
-%D
-%D I became aware of this when I mistakenly testen the first
-%D one against \type{\undefined}. When \TEX\ build a name using
-%D \type{\csname} it automatically sets it to \type{\relax},
-%D which is definitely not the same as \type{\undefined}. The
-%D quickest way to check these things is asking \TEX\ to show
-%D the meaning of the names:
-%D
-%D \starttyping
-%D \expandafter\show\csname NameA\endcsname
-%D
-%D \show\NameB
-%D \stoptyping
-%D
-%D The main reason why this never will be a big problem is that
-%D when one uses the \type{\csname} way, one probably has to do
-%D with some macroname that always is dealt with that way.
-%D Confusion can however arise when one applies both testing
-%D methods to the same macroname. By the way, the assignment
-%D of \type{\relax} obeys grouping.
-
-%D The first one gets rid of \type{#1}, but still expands to
-%D something and the second one expands to \type{#1}. Because
-%D we accept arguments between \type{{}}, we have to get rid
-%D of one level of braces.
-%D
-%D Our first implementation of \type{\ifundefined} was
-%D straightforward and readable:
-%D
-%D \starttyping
-%D \def\ifundefined#1%
-%D {\expandafter\ifx\csname#1\endcsname\relax}%
-%D
-%D \def\doifundefinedelse#1#2#3%
-%D {\let\donottest=\dontprocesstest
-%D \ifundefined{#1}%
-%D \let\donottest=\doprocesstest#2%
-%D \else
-%D \let\donottest=\doprocesstest#3%
-%D \fi}
-%D
-%D \def\doifdefinedelse#1#2#3%
-%D {\doifundefinedelse{#1}{#3}{#2}}
-%D
-%D \def\doifundefined#1#2%
-%D {\doifundefinedelse{#1}{#2}{}}
-%D
-%D \def\doifdefined#1#2%
-%D {\doifundefinedelse{#1}{}{#2}}
-%D
-%D \def\doifalldefinedelse#1#2#3%
-%D {\begingroup
-%D \donetrue
-%D \def\checkcommand##1%
-%D {\doifundefined{##1}{\donefalse}}%
-%D \processcommalist[#1]\checkcommand
-%D \ifdone
-%D \endgroup#2%
-%D \else
-%D \endgroup#3%
-%D \fi}
-%D \stoptyping
-%D
-%D When this module was optimized, timing showed that the
-%D next alternative can be upto twice as fast, especially when
-%D longer arguments are used. Watch how we reach over the
-%D \type {\else} and \type {\fi}: this way they cannot get
-%D into the way (and we can avoid those \type {\next}
-%D hacks); I started using this method after I did some
-%D speed optimization tests in the xtag modules; the
-%D efficiency of such hacks depends on the length of the
-%D argument etc. etc.)
-
-\beginTEX
-
-\def\ifundefined#1%
- {\expandafter\ifx\csname#1\endcsname\relax}
-
-\def\p!doifundefined#1%
- {\let\donottest\dontprocesstest
- \expandafter\ifx\csname#1\endcsname\relax}
-
-\def\doifundefinedelse#1%
- {\p!doifundefined{#1}%
- \let\donottest\doprocesstest\@EA\firstoftwoarguments
- \else
- \let\donottest\doprocesstest\@EA\secondoftwoarguments
- \fi}
-
-\def\doifdefinedelse#1%
- {\p!doifundefined{#1}%
- \let\donottest\doprocesstest\@EA\secondoftwoarguments
- \else
- \let\donottest\doprocesstest\@EA\firstoftwoarguments
- \fi}
-
-\def\doifundefined#1%
- {\p!doifundefined{#1}%
- \let\donottest\doprocesstest\@EA\firstofoneargument
- \else
- \let\donottest\doprocesstest\@EA\gobbleoneargument
- \fi}
-
-\def\doifdefined#1%
- {\p!doifundefined{#1}%
- \let\donottest\doprocesstest\@EA\gobbleoneargument
- \else
- \let\donottest\doprocesstest\@EA\firstofoneargument
- \fi}
-
-\endTEX
-
-\beginETEX \ifcsname
-
-\def\ifundefined#1% ongelukkige naam
- {\unless\ifcsname#1\endcsname}
-
-\def\p!doifundefined#1%
- {\edef\p!defined{#1}%
- \unless\ifcsname\detokenize\@EA{\p!defined}\endcsname}
-
-\def\doifundefinedelse#1%
- {\edef\p!defined{#1}%
- \ifcsname\detokenize\@EA{\p!defined}\endcsname
- \expandafter\secondoftwoarguments
- \else
- \expandafter\firstoftwoarguments
- \fi}
-
-\def\doifdefinedelse#1%
- {\edef\p!defined{#1}%
- \ifcsname\detokenize\@EA{\p!defined}\endcsname
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\def\doifundefined#1%
- {\edef\p!defined{#1}%
- \ifcsname\detokenize\@EA{\p!defined}\endcsname
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-\def\doifdefined#1%
- {\edef\p!defined{#1}%
- \ifcsname\detokenize\@EA{\p!defined}\endcsname
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\endETEX
-
-%D \macros
-%D {letbeundefined}
-%D
-%D Testing for being undefined comes down to testing on \type
-%D {\relax} when we use \type {\csname}, but when using \type
-%D {\ifx}, we test on being \type {\undefined}! In \ETEX\ we
-%D have \type {\ifcsname} and that way of testing on existance
-%D is not the same as the one described here. Therefore we
-%D introduce:
-
-\beginTEX
-
-\def\letbeundefined#1%
- {\expandafter\let\csname#1\endcsname\relax}
-
-\endTEX
-
-\beginETEX \undefined
-
-\def\letbeundefined#1% potential stack buildup when used \global
- {\expandafter\let\csname#1\endcsname\undefined}
-
-\def\localundefine#1% conditional
- {\ifcsname#1\endcsname\expandafter\let\csname#1\endcsname\undefined\fi}
-\def\globalundefine#1% conditional
- {\ifcsname#1\endcsname\expandafter\global\let\csname#1\endcsname\undefined\fi}
-
-\endETEX
-
-%D Beware, being \type {\undefined} in \ETEX\ means that the macro
-%D {\em is} defined!
-
-%D Before we start using this variant, we used another one,
-%D which is even a bit faster. This one looked like:
-%D
-%D \starttyping
-%D \def\p!doifundefined%
-%D {\begingroup
-%D \let\donottest=\dontprocesstest
-%D \ifundefined}
-%D
-%D \def\doifundefinedelse#1#2#3%
-%D {\p!doifundefined{#1}%
-%D \endgroup#2%
-%D \else
-%D \endgroup#3%
-%D \fi}
-%D \stoptyping
-%D
-%D A even more previous version used \type{\bgroup} and
-%D \type {\egroup}. In math mode however, \type{$1{x}2$} differs
-%D from \type{$1x2$}. This can been seen when one compares the
-%D output of:
-%D
-%D \starttyping
-%D $\kern10pt\showthe\lastkern$
-%D $\kern10pt{\showthe\lastkern}$
-%D $\kern10pt\begingroup\showthe\lastkern\endgroup$
-%D \stoptyping
-%D
-%D Also in math mode, one can better use \type {\begingroup}
-%D and companion instead of \type {\bgroup}.
-%D
-%D When we were developing the scientific units module, we
-%D encountered different behavior in text and math mode, which
-%D was due to this grouping subtilities. We therefore decided
-%D to use \type{\begingroup} instead of \type{\bgroup}.
-%D Later, when we had optimized some macro's the grouped
-%D solution turned out to be unsafe when typesetting this
-%D documentation, especially when using \type{\globaldefs}.
-%D
-%D We still have to define \type{\doifalldefinedelse}. Watch
-%D the use of grouping, which garantees local use of the
-%D boolean \type{\ifdone}.
-
-\beginTEX
-
-\def\docheckonedefined#1%
- {\ifundefined{#1}%
- \donefalse
- \fi}
-
-\def\doifalldefinedelse#1%
- {\begingroup
- \let\donottest\dontprocesstest
- \donetrue
- \processcommalist[#1]\docheckonedefined
- \ifdone
- \endgroup\let\donottest\doprocesstest
- \expandafter\firstoftwoarguments
- \else
- \endgroup\let\donottest\doprocesstest
- \expandafter\secondoftwoarguments
- \fi}
-
-\endTEX
-
-\beginETEX \ifcsname
-
-\def\docheckonedefined#1%
- {\unless\ifcsname#1\endcsname
- \donefalse
- \fi}
-
-\def\doifalldefinedelse#1%
- {\begingroup
- \donetrue \processcommalist[#1]\docheckonedefined
- \ifdone
- \endgroup\expandafter\firstoftwoarguments
- \else
- \endgroup\expandafter\secondoftwoarguments
- \fi}
-
-\endETEX
-
-%D \macros
-%D {doif,doifelse,doifnot,
-%D donottest}
-%D
-%D Programming in \TEX\ differs from programming in procedural
-%D languages like \MODULA. This means that one --- well, let me
-%D speek for myself --- tries to do the things in the well
-%D known way. Therefore the next set of \type{\ifthenelse}
-%D commands were between the first ones we needed. A few years
-%D later, the opposite became true: when programming in
-%D \MODULA, I sometimes miss handy things like grouping,
-%D runtime redefinition, expansion etc. While \MODULA\ taught
-%D me to structure, \TEX\ taught me to think recursive.
-%D
-%D \starttyping
-%D \doif {string1} {string2} {...}
-%D \doifnot {string1} {string2} {...}
-%D \doifelse {string1} {string2} {then ...}{else ...}
-%D \stoptyping
-%D
-%D When expansion gives problems, we can precede the
-%D troublemaker with \type{\donottest}.
-%D
-%D This implementatie does not use the construction which is
-%D more robust for nested conditionals.
-%D
-%D \starttyping
-%D \ifx\!!stringa\!!stringb
-%D \def\next{#3}%
-%D \else
-%D \def\next{#4}%
-%D \fi
-%D \next
-%D \stoptyping
-%D
-%D In practice, this alternative is at least 20\% slower than
-%D the alternative used here. The few cases in which we
-%D really need the \type{\next} construction, often need some
-%D other precautions and or adaptions too.
-
-\beginTEX
-
-% \long\def\doif#1#2#3%
-% {\let\donottest\dontprocesstest
-% \edef\!!stringa{#1}%
-% \edef\!!stringb{#2}%
-% \let\donottest\doprocesstest
-% \ifx\!!stringa\!!stringb
-% #3%
-% \fi}
-%
-% \long\def\doifnot#1#2#3%
-% {\let\donottest\dontprocesstest
-% \edef\!!stringa{#1}%
-% \edef\!!stringb{#2}%
-% \let\donottest\doprocesstest
-% \ifx\!!stringa\!!stringb
-% \else
-% #3%
-% \fi}
-%
-% \long\def\doifelse#1#2#3#4%
-% {\let\donottest\dontprocesstest
-% \edef\!!stringa{#1}%
-% \edef\!!stringb{#2}%
-% \let\donottest\doprocesstest
-% \ifx\!!stringa\!!stringb
-% #3%
-% \else
-% #4%
-% \fi}
-
-%D Slightly faster on big arguments, as well as \type
-%D {\next} avoiding:
-
-\long\def\doif#1#2%
- {\let\donottest\dontprocesstest
- \edef\!!stringa{#1}%
- \edef\!!stringb{#2}%
- \let\donottest\doprocesstest
- \ifx\!!stringa\!!stringb
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\long\def\doifnot#1#2%
- {\let\donottest\dontprocesstest
- \edef\!!stringa{#1}%
- \edef\!!stringb{#2}%
- \let\donottest\doprocesstest
- \ifx\!!stringa\!!stringb
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-
-\long\def\doifelse#1#2%
- {\let\donottest\dontprocesstest
- \edef\!!stringa{#1}%
- \edef\!!stringb{#2}%
- \let\donottest\doprocesstest
- \ifx\!!stringa\!!stringb
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\endTEX
-
-\beginETEX \protected
-
-% \long\def\doif#1#2#3%
-% {\edef\!!stringa{#1}\edef\!!stringb{#2}%
-% \ifx\!!stringa\!!stringb#3\fi}
-%
-% \long\def\doifnot#1#2#3%
-% {\edef\!!stringa{#1}\edef\!!stringb{#2}%
-% \unless\ifx\!!stringa\!!stringb#3\fi}
-%
-% \long\def\doifelse#1#2#3#4%
-% {\edef\!!stringa{#1}\edef\!!stringb{#2}%
-% \ifx\!!stringa\!!stringb#3\else#4\fi}
-
-%D Slightly faster on big arguments, as well as \type
-%D {\next} avoiding:
-
-\long\def\doif#1#2%
- {\edef\!!stringa{#1}\edef\!!stringb{#2}%
- \ifx\!!stringa\!!stringb
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\long\def\doifnot#1#2%
- {\edef\!!stringa{#1}\edef\!!stringb{#2}%
- \ifx\!!stringa\!!stringb
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-\long\def\doifelse#1#2%
- {\edef\!!stringa{#1}\edef\!!stringb{#2}%
- \ifx\!!stringa\!!stringb
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\endETEX
-
-%D One could wonder why we don't follow the the same approach
-%D as in \type{\doifdefined} c.s.\ and use \type{\begingroup}
-%D and \type{\endgroup}. In this case, this alternative is
-%D slower, which is probably due to the fact that more meanings
-%D need to be restored.
-%D
-%D The in terms of memory more efficient alternative using a
-%D auxiliary macro also proved to be slower, so we definitely
-%D did not choose for:
-%D
-%D \starttyping
-%D \def\p!doifelse#1#2%
-%D {\let\donottest=\dontprocesstest
-%D \edef\!!stringa{#1}%
-%D \edef\!!stringb{#2}%
-%D \let\donottest=\doprocesstest
-%D \ifx\!!stringa\!!stringb}
-%D
-%D \long\def\doif#1#2#3%
-%D {\p!doifelse{#1}{#2}#3\fi}
-%D
-%D \long\def\doifnot#1#2#3%
-%D {\p!doifelse{#1}{#2}\else#3\fi}
-%D
-%D \long\def\doifelse#1#2#3#4%
-%D {\p!doifelse{#1}{#2}#3\else#4\fi}
-%D \stoptyping
-%D
-%D Optimizations like this are related of course to the
-%D bottlenecks in \TEX. It seems that restoring saved meanings
-%D and passing arguments takes some time.
-
-%D \macros
-%D {doifempty,doifemptyelse,doifnotempty}
-%D
-%D We complete our set of conditionals with:
-%D
-%D \starttyping
-%D \doifempty {string} {...}
-%D \doifnotempty {string} {...}
-%D \doifemptyelse {string} {then ...} {else ...}
-%D \stoptyping
-%D
-%D This time, the string is not expanded.
-
-\long\def\doifemptyelse#1%
- {\def\!!stringa{#1}%
- \ifx\!!stringa\empty
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\long\def\doifempty#1%
- {\def\!!stringa{#1}%
- \ifx\!!stringa\empty
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\long\def\doifnotempty#1%
- {\def\!!stringa{#1}%
- \ifx\!!stringa\empty
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-%D \macros
-%D {doifinset,doifnotinset,doifinsetelse}
-%D
-%D We can check if a string is present in a comma separated
-%D set of strings. Depending on the result, some action is
-%D taken.
-%D
-%D \starttyping
-%D \doifinset {string} {string,...} {...}
-%D \doifnotinset {string} {string,...} {...}
-%D \doifinsetelse {string} {string,...} {then ...} {else ...}
-%D \stoptyping
-%D
-%D The second argument is the comma separated set of strings.
-%D
-%D \starttyping
-%D \long\def\doifinsetelse#1#2#3#4%
-%D {\doifelse{#1}{}
-%D {#4}
-%D {\donefalse
-%D \def\p!checkiteminset##1%
-%D {\doif{#1}{##1}
-%D {\donetrue
-%D \let\p!checkiteminset=\gobbleoneargument}}%
-%D \processcommalist[#2]\p!checkiteminset
-%D \ifdone
-%D #3%
-%D \else
-%D #4%
-%D \fi}}
-%D
-%D \long\def\doifinset#1#2#3%
-%D {\doifinsetelse{#1}{#2}{#3}{}}
-%D
-%D \long\def\doifnotinset#1#2#3%
-%D {\doifinsetelse{#1}{#2}{}{#3}}
-%D \stoptyping
-%D
-%D Because this macro is called quite often we've spent some
-%D time optimizing it. This time, the gain in speed is due to
-%D (1)~defining an external auxiliary macro, (2)~not calling
-%D any other macros and (3)~minimizing the passing of
-%D arguments. The gain in speed is impressive.
-
-% \def\p!dodocheckiteminset#1%
-% {\edef\!!stringb{#1}%
-% \ifx\!!stringa\!!stringb
-% \donetrue
-% \let\p!docheckiteminset\gobbleoneargument
-% \fi}
-%
-% \beginTEX
-%
-% \def\p!doifinsetelse#1#2%
-% {\let\donottest\dontprocesstest
-% \donefalse
-% \edef\!!stringa{#1}%
-% \ifx\!!stringa\empty
-% \else
-% \let\p!docheckiteminset\p!dodocheckiteminset
-% \processcommalist[#2]\p!docheckiteminset
-% \fi
-% \let\donottest\doprocesstest
-% \ifdone}
-%
-% \endTEX
-%
-% \beginETEX \protected
-%
-% \def\p!doifinsetelse#1#2%
-% {\donefalse
-% \edef\!!stringa{#1}%
-% \ifx\!!stringa\empty
-% \else
-% \let\p!docheckiteminset\p!dodocheckiteminset
-% \processcommalist[#2]\p!docheckiteminset
-% \fi
-% \ifdone}
-%
-% \endETEX
-
-% then we had:
-%
-% \def\p!docheckiteminset#1%
-% {\edef\!!stringb{#1}%
-% \ifx\!!stringa\!!stringb
-% \donetrue
-% \expandafter\quitcommalist
-% \fi}
-%
-% \beginTEX
-%
-% \def\p!doifinsetelse#1#2%
-% {\let\donottest\dontprocesstest
-% \donefalse
-% \edef\!!stringa{#1}%
-% \ifx\!!stringa\empty
-% \else
-% \processcommalist[#2]\p!docheckiteminset
-% \fi
-% \let\donottest\doprocesstest
-% \ifdone}
-%
-% \endTEX
-%
-% % can be sped up with processnext...
-%
-% \beginETEX \protected
-%
-% \def\p!doifinsetelse#1#2%
-% {\donefalse
-% \edef\!!stringa{#1}%
-% \ifx\!!stringa\empty
-% \else
-% \processcommalist[#2]\p!docheckiteminset
-% \fi
-% \ifdone}
-%
-% \endETEX
-%
-% \long\def\doifinsetelse#1#2%
-% {\p!doifinsetelse{#1}{#2}%
-% \expandafter\firstoftwoarguments
-% \else
-% \expandafter\secondoftwoarguments
-% \fi}
-%
-% \long\def\doifinset#1#2%
-% {\p!doifinsetelse{#1}{#2}%
-% \expandafter\firstofoneargument
-% \else
-% \expandafter\gobbleoneargument
-% \fi}
-%
-% \long\def\doifnotinset#1#2%
-% {\p!doifinsetelse{#1}{#2}%
-% \expandafter\gobbleoneargument
-% \else
-% \expandafter\firstofoneargument
-% \fi}
-%
-% now we have
-
-\def\p!docheckiteminset#1%
- {\edef\!!stringb{#1}%
- \ifx\!!stringa\!!stringb
- \donetrue
- \expandafter\quitcommalist
- \fi}
-
-\beginTEX
-
-\def\p!doifinsetelse#1#2#3#4%
- {\let\donottest\dontprocesstest
- \donefalse
- \edef\!!stringa{#3}%
- \ifx\!!stringa\empty
- \else
- \processcommalist[#4]\p!docheckiteminset
- \fi
- \let\donottest\doprocesstest
- \ifdone\expandafter#1\else\expandafter#2\fi}
-
-\endTEX
-
-\beginETEX \protected
-
-\def\p!doifinsetelse#1#2#3#4%
- {\donefalse
- \edef\!!stringa{#3}%
- \ifx\!!stringa\empty
- \else
- \processcommalist[#4]\p!docheckiteminset
- \fi
- \ifdone\expandafter#1\else\expandafter#2\fi}
-
-\endETEX
-
-\long\def\doifinsetelse
- {\p!doifinsetelse\firstoftwoarguments\secondoftwoarguments}
-
-\long\def\doifinset
- {\p!doifinsetelse\firstofoneargument\gobbleoneargument}
-
-\long\def\doifnotinset
- {\p!doifinsetelse\gobbleoneargument\firstofoneargument}
-
-%D \macros
-%D {doifcommon,doifnotcommon,doifcommonelse}
-%D
-%D Probably the most time consuming tests are those that test
-%D for overlap in sets of strings.
-%D
-%D \starttyping
-%D \doifcommon {string,...} {string,...} {...}
-%D \doifnotcommon {string,...} {string,...} {...}
-%D \doifcommonelse {string,...} {string,...} {then ...} {else ...}
-%D \stoptyping
-%D
-%D We show the slower alternative first, because it shows us
-%D how things are done.
-%D
-%D \starttyping
-%D \long\def\doifcommonelse#1#2#3#4%
-%D {\donefalse
-%D \def\p!docommoncheck##1%
-%D {\def\p!dodocommoncheck####1%
-%D {\doif{####1}{##1}
-%D {\donetrue
-%D \def\commalistelement{##1}%
-%D \let\p!docommoncheck=\gobbleoneargument
-%D \let\p!dodocommoncheck=\gobbleoneargument}}%
-%D \processcommalist[#2]\p!dodocommoncheck}%
-%D \processcommalist[#1]\p!docommoncheck
-%D \ifdone
-%D #3%
-%D \else
-%D #4%
-%D \fi}
-%D
-%D \long\def\doifcommon#1#2#3%
-%D {\doifcommonelse{#1}{#2}{#3}{}}
-%D
-%D \long\def\doifnotcommon#1#2#3%
-%D {\doifcommonelse{#1}{#2}{}{#3}}
-%D \stoptyping
-%D
-%D The processing time is shortened by getting the auxiliary
-%D macro to the outermost level and using less \type{\edef}'s.
-%D Sometimes it makes more sence to define local macro's not
-%D only because this way we can be sure that they are not
-%D redefined, but also because it shows the dependance. In
-%D compiled languages, this is no problem at all. It can even
-%D save us bytes and processing time. In interpreted languages
-%D like \TEX\ it nearly always slows down processing.
-
-% \def\p!dododocommoncheck#1%
-% {\edef\!!stringb{#1}%
-% \ifx\!!stringa\!!stringb
-% \donetrue
-% \let\p!docommoncheck\gobbleoneargument
-% \let\p!dodocommoncheck\gobbleoneargument
-% \fi}
-%
-% \beginTEX
-%
-% \def\p!doifcommonelse#1#2%
-% {\donefalse
-% \let\donottest\dontprocesstest
-% \let\p!dodocommoncheck\p!dododocommoncheck
-% \def\p!docommoncheck##1%
-% {\edef\!!stringa{##1}%
-% \def\commalistelement{##1}%
-% \processcommalist[#2]\p!dodocommoncheck}%
-% \processcommalist[#1]\p!docommoncheck
-% \let\donottest\doprocesstest
-% \ifdone}
-%
-% \endTEX
-%
-% \beginETEX \protected
-%
-% \def\p!doifcommonelse#1#2%
-% {\donefalse
-% \let\p!dodocommoncheck\p!dododocommoncheck
-% \def\p!docommoncheck##1%
-% {\edef\!!stringa{##1}%
-% \def\commalistelement{##1}%
-% \processcommalist[#2]\p!dodocommoncheck}%
-% \processcommalist[#1]\p!docommoncheck
-% \ifdone}
-%
-% \endETEX
-
-% \def\p!dodocommoncheck#1%
-% {\edef\!!stringb{#1}%
-% \ifx\!!stringa\!!stringb
-% \donetrue
-% \expandafter\quitprevcommalist
-% \fi}
-%
-% \beginTEX
-%
-% \def\p!doifcommonelse#1#2%
-% {\donefalse
-% \let\donottest\dontprocesstest
-% \def\p!docommoncheck##1%
-% {\edef\!!stringa{##1}%
-% \def\commalistelement{##1}% no let to stringa
-% \processcommalist[#2]\p!dodocommoncheck}%
-% \processcommalist[#1]\p!docommoncheck
-% \let\donottest\doprocesstest
-% \ifdone}
-%
-% \endTEX
-%
-% \beginETEX \protected
-%
-% \def\p!doifcommonelse#1#2%
-% {\donefalse
-% \def\p!docommoncheck##1%
-% {\edef\!!stringa{##1}%
-% \def\commalistelement{##1}%
-% \processcommalist[#2]\p!dodocommoncheck}%
-% \processcommalist[#1]\p!docommoncheck
-% \ifdone}
-%
-% \endETEX
-%
-% \long\def\doifcommonelse#1#2% % #3#4%
-% {\p!doifcommonelse{#1}{#2}% % #3\else#4\fi}
-% \expandafter\firstoftwoarguments
-% \else
-% \expandafter\secondoftwoarguments
-% \fi}
-%
-% \long\def\doifcommon#1#2%
-% {\p!doifcommonelse{#1}{#2}%
-% \expandafter\firstofoneargument
-% \else
-% \expandafter\gobbleoneargument
-% \fi}
-%
-% \long\def\doifnotcommon#1#2%
-% {\p!doifcommonelse{#1}{#2}%
-% \expandafter\gobbleoneargument
-% \else
-% \expandafter\firstofoneargument
-% \fi}
-
-% todo: use dedicated done
-
-\def\p!dodocommoncheck#1%
- {\edef\!!stringb{#1}%
- \ifx\!!stringa\!!stringb
- \donetrue
- \expandafter\quitprevcommalist
- \fi}
-
-\beginTEX
-
-\def\p!doifcommonelse#1#2#3#4%
- {\donefalse
- \let\donottest\dontprocesstest
- \def\p!docommoncheck##1%
- {\edef\!!stringa{##1}%
- \def\commalistelement{##1}% no let to stringa
- \processcommalist[#4]\p!dodocommoncheck}%
- \processcommalist[#3]\p!docommoncheck
- \let\donottest\doprocesstest
- \ifdone\expandafter#1\else\expandafter#2\fi}
-
-\endTEX
-
-\beginETEX \protected
-
-\def\p!doifcommonelse#1#2#3#4%
- {\donefalse
- \def\p!docommoncheck##1%
- {\edef\!!stringa{##1}%
- \def\commalistelement{##1}%
- \processcommalist[#4]\p!dodocommoncheck}%
- \processcommalist[#3]\p!docommoncheck
- \ifdone\expandafter#1\else\expandafter#2\fi}
-
-\endETEX
-
-\def\doifcommonelse
- {\p!doifcommonelse\firstoftwoarguments\secondoftwoarguments}
-
-\def\doifcommon
- {\p!doifcommonelse\firstofoneargument \gobbleoneargument}
-
-\def\doifnotcommon
- {\p!doifcommonelse\gobbleoneargument \firstofoneargument}
-
-%D \macros
-%D {processcommalist,processcommacommand,quitcommalist,
-%D processcommalistwithparameters}
-%D
-%D We've already seen some macros that take care of comma
-%D separated lists. Such list can be processed with
-%D
-%D \starttyping
-%D \processcommalist[string,string,...]\commando
-%D \stoptyping
-%D
-%D The user supplied command \type{\commando} receives one
-%D argument: the string. This command permits nesting and
-%D spaces after commas are skipped. Empty sets are no problem.
-%D
-%D \startbuffer
-%D \def\dosomething#1{(#1)}
-%D
-%D 1: \processcommalist [\hbox{$a,b,c,d,e,f$}] \dosomething \par
-%D 2: \processcommalist [{a,b,c,d,e,f}] \dosomething \par
-%D 3: \processcommalist [{a,b,c},d,e,f] \dosomething \par
-%D 4: \processcommalist [a,b,{c,d,e},f] \dosomething \par
-%D 5: \processcommalist [a{b,c},d,e,f] \dosomething \par
-%D 6: \processcommalist [{a,b}c,d,e,f] \dosomething \par
-%D 7: \processcommalist [] \dosomething \par
-%D 8: \processcommalist [{[}] \dosomething \par
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D Before we show the result, we present the macro's:
-
-\newcount\commalevel
-
-\def\dododoprocesscommaitem
- {\csname\s!next\the\commalevel\endcsname}
-
-%\def\dodoprocesscommaitem%
-% {\ifx\nexttoken\blankspace
-% \let\nextcommaitem\redoprocesscommaitem
-% \else\ifx\nexttoken]%
-% \let\nextcommaitem\gobbleoneargument
-% \else
-% \let\nextcommaitem\dododoprocesscommaitem
-% \fi\fi
-% \nextcommaitem}
-%
-% faster ?
-
-\def\dodoprocesscommaitem
- {\ifx\nexttoken\blankspace
- \@EA\redoprocesscommaitem
- \else\ifx\nexttoken]%
- \@EAEAEA\gobbleoneargument
- \else
- \@EAEAEA\dododoprocesscommaitem
- \fi\fi}
-
-\def\doprocesscommaitem
- {\futurelet\nexttoken\dodoprocesscommaitem}
-
-%D Empty arguments are not processed. Empty items (\type{,,})
-%D however are treated. We have to check for the special case
-%D \type{[{a,b,c}]}.
-%D
-%D \starttyping
-%D \def\processcommalist[%
-%D {\futurelet\nexttoken\docheckcommaitem}
-%D
-%D \def\docheckcommaitem%
-%D {\ifx\nexttoken]%
-%D \let\nextcommaitem\gobbletwoarguments
-%D \else\ifx\nexttoken\bgroup
-%D \let\nextcommaitem\doprocesscommalistA
-%D \else
-%D \let\nextcommaitem\doprocesscommalistB
-%D \fi\fi
-%D \nextcommaitem}
-%D
-%D \def\doprocesscommalistA#1#2]#3%
-%D {\global\advance\commalevel 1
-%D \long\expandafter\def\csname\s!next\the\commalevel\endcsname##1,%
-%D {#3{##1}\doprocesscommaitem}%
-%D \doprocesscommaitem{#1}#2,]\relax
-%D \global\advance\commalevel -1 }
-%D
-%D \def\doprocesscommalistB#1]#2%
-%D {\global\advance\commalevel 1
-%D \long\expandafter\def\csname\s!next\the\commalevel\endcsname##1,%
-%D {#2{##1}\doprocesscommaitem}%
-%D \doprocesscommaitem#1,]\relax
-%D \global\advance\commalevel -1 }
-%D \stoptyping
-%D
-%D However, this is not a the most straightforward solution!
-%D We can misuse one of \TEX's hidden features, and prepend
-%D and remove a \type {\relax}. By the way, although it
-%D involves less testing, this cleaner alternative is not
-%D faster.
-
-\def\processcommalist[%
- {\futurelet\nexttoken\docheckcommaitem}
-
-\def\docheckcommaitem
- {\ifx\nexttoken]%
- \expandafter\gobblethreearguments
- \else
- \expandafter\doprocesscommalist
- \fi
- \relax} % this one preserved the next {}
-
-\def\doprocesscommalist#1]#2%
- {\global\advance\commalevel \plusone
- \long\expandafter\def\csname\s!next\the\commalevel\endcsname##1,%
- {#2{##1}\doprocesscommaitem}%
- \@EA\dodoprocesscommaitem\gobbleoneargument#1,]\relax
- \global\advance\commalevel \minusone }
-
-%D One way of quitting a commalist halfway is:
-
-\def\quitcommalist
- {\begingroup\let\doprocesscommaitem\doquitcommalist}
-
-\def\doquitcommalist#1]%
- {\endgroup}
-
-\def\quitprevcommalist
- {\begingroup\let\doprocesscommaitem\doquitprevcommalist}
-
-\def\doquitprevcommalist#1]%
- {\let\doprocesscommaitem\doquitcommalist}
-
-%D The hack we used for checking the next character
-%D \type {\doifnextcharelse} is also used here.
-
-\def\:{\redoprocesscommaitem}
-
-\expandafter\def\: {\futurelet\nexttoken\dodoprocesscommaitem}
-
-%D The previous examples lead to:
-%D
-%D \getbuffer
-
-%D When a list is saved in a macro, we can use a construction
-%D like:
-%D
-%D \starttyping
-%D \expandafter\processcommalist\expandafter[\list]\command
-%D \stoptyping
-%D
-%D Such solutions suit most situations, but we wanted a bit
-%D more.
-%D
-%D \starttyping
-%D \processcommacommand[string,\stringset,string]\commando
-%D \stoptyping
-%D
-%D where \type{\stringset} is a predefined set, like:
-%D
-%D \starttyping
-%D \def\first{aap,noot,mies}
-%D \def\second{laatste}
-%D
-%D \processcommacommand[\first]\message
-%D \processcommacommand[\first,second,third]\message
-%D \processcommacommand[\first,between,\second]\message
-%D \stoptyping
-%D
-%D Commands that are part of the list are expanded, so the
-%D use of this macro has its limits.
-
-\def\processcommacommand[#1]%
- {\expanded{\processcommalist[#1]}}
-
-%D The argument to \type{\command} is not delimited. Because
-%D we often use \type{[]} as delimiters, we also have:
-%D
-%D \starttyping
-%D \processcommalistwithparameters[string,string,...]\command
-%D \stoptyping
-%D
-%D where \type{\command} looks like:
-%D
-%D \starttyping
-%D \def\command[#1]{... #1 ...}
-%D \stoptyping
-
-\def\processcommalistwithparameters[#1]#2%
- {\def\docommand##1{#2[##1]}%
- \processcommalist[#1]\docommand}
-
-%D \macros
-%D {processaction,
-%D processfirstactioninset,
-%D processallactionsinset}
-%D
-%D \CONTEXT\ makes extensive use of a sort of case or switch
-%D command. Depending of the presence of one or more provided
-%D items, some actions is taken. These macros can be nested
-%D without problems.
-%D
-%D \starttyping
-%D \processaction [x] [a=>\a,b=>\b,c=>\c]
-%D \processfirstactioninset [x,y,z] [a=>\a,b=>\b,c=>\c]
-%D \processallactionsinset [x,y,z] [a=>\a,b=>\b,c=>\c]
-%D \stoptyping
-%D
-%D We can supply both a \type{default} action and an action
-%D to be undertaken when an \type{unknown} value is met:
-%D
-%D \starttyping
-%D \processallactionsinset
-%D [x,y,z]
-%D [ a=>\a,
-%D b=>\b,
-%D c=>\c,
-%D default=>\default,
-%D unknown=>\unknown{... \commalistelement ...}]
-%D \stoptyping
-%D
-%D When \type{#1} is empty, this macro scans list \type{#2} for
-%D the keyword \type{default} and executed the related action
-%D if present. When \type{#1} is non empty and not in the list,
-%D the action related to \type{unknown} is executed. Both
-%D keywords must be at the end of list \type{#2}. Afterwards,
-%D the actually found keyword is available in
-%D \type{\commalistelement}. An advanced example of the use of
-%D this macro can be found in \PPCHTEX, where we completely
-%D rely on \TEX\ for interpreting user supplied keywords like
-%D \type{SB}, \type{SB1..6}, \type{SB125} etc.
-%D
-%D Even a quick glance at the macros below show some overlap,
-%D which means that more efficient alternatives are possible.
-%D Because these macro's are very sensitive to subtle changes,
-%D we've decided to present the readable originals first
-%D Maybe these these macros look complicated, but this is a
-%D direct result of the support of nesting. Protection is only
-%D applied in \type{\processaction}.
-%D
-%D \starttyping
-%D \newcount\processlevel
-%D
-%D \def\processaction[#1]#2[#3]%
-%D {\doifelse{#1}{}
-%D {\def\p!compareprocessaction[##1=>##2]%
-%D {\edef\!!stringa{##1}%
-%D \ifx\!!stringa\s!default
-%D \def\commalistelement{#1}%
-%D ##2%
-%D \fi}}
-%D {\let\donottest=\dontprocesstest
-%D \edef\!!stringb{#1}%
-%D \let\donottest=\doprocesstest
-%D \def\p!compareprocessaction[##1=>##2]%
-%D {\edef\!!stringa{##1}%
-%D \ifx\!!stringa\!!stringb
-%D \def\commalistelement{#1}%
-%D ##2%
-%D \let\p!doprocessaction=\gobbleoneargument
-%D \else\ifx\!!stringa\s!unknown
-%D \def\commalistelement{#1}%
-%D ##2%
-%D \fi\fi}}%
-%D \def\p!doprocessaction##1%
-%D {\p!compareprocessaction[##1]}%
-%D \processcommalist[#3]\p!doprocessaction}
-%D
-%D \def\processfirstactioninset[#1]#2[#3]%
-%D {\doifelse{#1}{}
-%D {\processaction[][#3]}
-%D {\def\p!compareprocessaction[##1=>##2][##3]%
-%D {\edef\!!stringa{##1}%
-%D \edef\!!stringb{##3}%
-%D \ifx\!!stringa\!!stringb
-%D \def\commalistelement{##3}%
-%D ##2%
-%D \let\p!doprocessaction=\gobbleoneargument
-%D \let\p!dodoprocessaction=\gobbleoneargument
-%D \else\ifx\!!stringa\s!unknown
-%D \def\commalistelement{##3}%
-%D ##2%
-%D \fi\fi}%
-%D \def\p!doprocessaction##1%
-%D {\def\p!dodoprocessaction####1%
-%D {\p!compareprocessaction[####1][##1]}%
-%D \processcommalist[#3]\p!dodoprocessaction}%
-%D \processcommalist[#1]\p!doprocessaction}}
-%D
-%D \def\processallactionsinset[#1]#2[#3]%
-%D {\doifelse{#1}{}
-%D {\processaction[][#3]}
-%D {\advance\processlevel by 1
-%D \def\p!compareprocessaction[##1=>##2][##3]%
-%D {\edef\!!stringa{##1}%
-%D \edef\!!stringb{##3}%
-%D \ifx\!!stringa\!!stringb
-%D \def\commalistelement{##3}%
-%D ##2%
-%D \let\p!dodoprocessaction=\gobbleoneargument
-%D \else\ifx\!!stringa\s!unknown
-%D \def\commalistelement{##3}%
-%D ##2%
-%D \fi\fi}%
-%D \setvalue{\s!do\the\processlevel}##1%
-%D {\def\p!dodoprocessaction####1%
-%D {\p!compareprocessaction[####1][##1]}%
-%D \processcommalist[#3]\p!dodoprocessaction}%
-%D \processcommalist[#1]{\getvalue{\s!do\the\processlevel}}%
-%D \advance\processlevel by -1 }}
-%D \stoptyping
-%D
-%D The gain of speed in the (again) next implementation is
-%D around 20\%, depending on the application.
-
-\newcount\processlevel
-
-\def\p!compareprocessactionA[#1=>#2][#3]%
- {\edef\!!stringb{#1}%
- \ifx\!!stringb\s!default
- \let\commalistelement\empty
- #2%
- \fi}
-
-% \def\p!compareprocessactionB[#1=>#2][#3]%
-% {\expandedaction\!!stringb{#1}%
-% \ifx\!!stringa\!!stringb
-% \def\commalistelement{#3}%
-% #2%
-% \let\p!doprocessaction\gobbleoneargument
-% \else
-% \edef\!!stringb{#1}%
-% \ifx\!!stringb\s!unknown
-% \def\commalistelement{#3}% beware of loops
-% #2%
-% \fi
-% \fi}
-
-% met \quitcommalist tot meer dan 25\% sneller
-
-\def\p!compareprocessactionB[#1=>#2][#3]%
- {\expandedaction\!!stringb{#1}%
- \ifx\!!stringa\!!stringb
- \def\commalistelement{#3}%
- #2%
- \expandafter\quitcommalist
- \else
- \edef\!!stringb{#1}%
- \ifx\!!stringb\s!unknown
- \def\commalistelement{#3}% beware of loops
- #2%
- \fi
- \fi}
-
-\beginTEX
-
-\def\processaction[#1]#2[#3]%
- {\let\donottest\dontprocesstest
- \expandedaction\!!stringa{#1}%
- \let\donottest\doprocesstest
- \ifx\!!stringa\empty
- \let\p!compareprocessaction\p!compareprocessactionA
- \else
- \let\p!compareprocessaction\p!compareprocessactionB
- \fi
- \def\p!doprocessaction##1%
- {\p!compareprocessaction[##1][#1]}%
- \processcommalist[#3]\p!doprocessaction
- \expandactions}
-
-\endTEX
-
-\beginETEX \protected
-
-\def\processaction[#1]#2[#3]% faster version follows
- {\expandedaction\!!stringa{#1}%
- \ifx\!!stringa\empty
- \let\p!compareprocessaction\p!compareprocessactionA
- \else
- \let\p!compareprocessaction\p!compareprocessactionB
- \fi
- \def\p!doprocessaction##1%
- {\p!compareprocessaction[##1][#1]}%
- \processcommalist[#3]\p!doprocessaction
- \expandactions}
-
-\endETEX
-
-% \def\p!compareprocessactionC[#1=>#2][#3]%
-% {\expandedaction\!!stringa{#1}%
-% \expandedaction\!!stringb{#3}%
-% \ifx\!!stringa\!!stringb
-% \def\commalistelement{#3}%
-% #2%
-% \let\p!doprocessaction\gobbleoneargument
-% \let\p!dodoprocessaction\gobbleoneargument
-% \else
-% \edef\!!stringa{#1}%
-% \ifx\!!stringa\s!unknown
-% \def\commalistelement{#3}%
-% #2%
-% \fi
-% \fi}
-
-\def\p!compareprocessactionC[#1=>#2][#3]%
- {\expandedaction\!!stringa{#1}%
- \expandedaction\!!stringb{#3}%
- \ifx\!!stringa\!!stringb
- \def\commalistelement{#3}%
- #2%
- \expandafter\quitprevcommalist
- \else
- \edef\!!stringa{#1}%
- \ifx\!!stringa\s!unknown
- \def\commalistelement{#3}%
- #2%
- \fi
- \fi}
-
-\def\processfirstactioninset[#1]#2[#3]% faster version follows
- {\expandedaction\!!stringa{#1}%
- \ifx\!!stringa\empty
- \processaction[][#3]%
- \else
- \def\p!doprocessaction##1%
- {\def\p!dodoprocessaction####1%
- {\p!compareprocessactionC[####1][##1]}%
- \processcommalist[#3]\p!dodoprocessaction}%
- \processcommalist[#1]\p!doprocessaction
- \fi
- \expandactions}
-
-% \def\p!compareprocessactionD[#1=>#2][#3]%
-% {\expandedaction\!!stringa{#1}%
-% \expandedaction\!!stringb{#3}%
-% \ifx\!!stringa\!!stringb
-% \def\commalistelement{#3}%
-% #2%
-% \let\p!dodoprocessaction\gobbleoneargument
-% \else
-% \edef\!!stringa{#1}%
-% \ifx\!!stringa\s!unknown
-% \def\commalistelement{#3}%
-% #2%
-% \fi
-% \fi}
-
-\def\p!compareprocessactionD[#1=>#2][#3]%
- {\expandedaction\!!stringa{#1}%
- \expandedaction\!!stringb{#3}%
- \ifx\!!stringa\!!stringb
- \def\commalistelement{#3}%
- #2%
- \expandafter\quitcommalist
- \else
- \edef\!!stringa{#1}%
- \ifx\!!stringa\s!unknown
- \def\commalistelement{#3}%
- #2%
- \fi
- \fi}
-
-\def\doprocessallactionsinset
- {\csname\s!do\the\processlevel\endcsname}
-
-\def\processallactionsinset[#1]#2[#3]% faster version follows
- {\expandedaction\!!stringa{#1}%
- \ifx\!!stringa\empty
- \processaction[][#3]%
- \else
- \advance\processlevel \plusone
- \expandafter\def\csname\s!do\the\processlevel\endcsname##1%
- {\def\p!dodoprocessaction####1%
- {\p!compareprocessactionD[####1][##1]}%
- \processcommalist[#3]\p!dodoprocessaction}%
- \processcommalist[#1]\doprocessallactionsinset
- \advance\processlevel \minusone
- \fi
- \expandactions}
-
-%D We can speed up these macros a bit when we use a dedicated
-%D commalist processor, one that avoids passing the (often)
-%D big action list.
-
-\beginTEX
-
-\def\processaction[#1]#2[%
- {\let\donottest\dontprocesstest
- \expandedaction\!!stringa{#1}%
- \let\donottest\doprocesstest
- \ifx\!!stringa\empty
- \let\p!compareprocessaction\p!compareprocessactionA
- \else
- \let\p!compareprocessaction\p!compareprocessactionB
- \fi
- \def\p!doprocessaction##1%
- {\p!compareprocessaction[##1][#1]}%
- \processnextcommalist\relax\expandactions\p!doprocessaction[}
-
-\endTEX
-
-\beginETEX
-
-\def\processaction[#1]#2[%
- {\expandedaction\!!stringa{#1}%
- \ifx\!!stringa\empty
- \let\p!compareprocessaction\p!compareprocessactionA
- \else
- \let\p!compareprocessaction\p!compareprocessactionB
- \fi
- \def\p!doprocessaction##1%
- {\p!compareprocessaction[##1][#1]}%
- \processnextcommalist\relax\expandactions\p!doprocessaction[}
-
-\endETEX
-
-\def\processfirstactionsinset[#1]%
- {\expandedaction\!!stringa{#1}%
- \ifx\!!stringa\empty
- \expandafter\processaction
- \else
- \expandafter\processfirstactionsinsetindeed
- \fi
- [#1]}
-
-\def\processfirstactioninsetindeed[#1]#2[#3]%
- {\def\p!doprocessaction##1%
- {\def\p!dodoprocessaction####1%
- {\p!compareprocessactionC[####1][##1]}%
- \processcommalist[#3]\p!dodoprocessaction}%
- \processcommalist[#1]\p!doprocessaction
- \expandactions}
-
-\def\processallactionsinset[#1]%
- {\expandedaction\!!stringa{#1}%
- \ifx\!!stringa\empty
- \expandafter\processaction
- \else
- \expandafter\processallactionsinsetindeed
- \fi
- [#1]}
-
-\def\processallactionsinsetindeed[#1]#2[#3]%
- {\advance\processlevel \plusone
- \expandafter\def\csname\s!do\the\processlevel\endcsname##1%
- {\def\p!dodoprocessaction####1%
- {\p!compareprocessactionD[####1][##1]}%
- \processcommalist[#3]\p!dodoprocessaction}%
- \processcommalist[#1]\doprocessallactionsinset
- \advance\processlevel \minusone
- \expandactions}
-
-\def\processnextcommalist#1#2#3[#4#5]%
- {#1%
- \let\nexttoken#4%
- \global\advance\commalevel \plusone
- \long\expandafter\def\csname\s!next\the\commalevel\endcsname##1,%
- {#3{##1}\doprocesscommaitem}%
- \dodoprocesscommaitem#4#5,]\relax
- \global\advance\commalevel \minusone
- #2}
-
-%D I do have an even faster version (saving 3 sec on a 13
-%D sec run for 50K invocations, but normally we don't have
-%D that many calls and that alternative uses more macros and is
-%D even less readable. What we did add, was \type {\@EA}, so
-%D that we can pass a command.
-
-%D \macros
-%D {unexpandedprocessaction,
-%D unexpandedprocessfirstactioninset,
-%D unexpandedprocessallactionsinset}
-%D
-%D Now what are those expansion commands doing there. Well,
-%D sometimes we want to compare actions that may consist off
-%D commands (i.e. are no constants). In such occasions we can
-%D use the a bit slower alternatives:
-
-\def\unexpandedprocessfirstactioninset{\dontexpandactions\processfirstactioninset}
-\def\unexpandedprocessaction {\dontexpandactions\processaction}
-\def\unexpandedprocessallactionsinset {\dontexpandactions\processallactionsinset}
-
-%D By default we expand actions:
-
-\def\expandactions{\let\expandedaction\edef} \expandactions
-
-%D But when needed we convert the strings to meaningful
-%D sequences of characters.
-
-\def\unexpandedaction#1>{}
-
-\def\noexpandedaction#1#2%
- {\def\@@convertedargument{#2}%
- \@EA\edef\@EA#1\@EA{\@EA\unexpandedaction\meaning\@@convertedargument}}
-
-\def\dontexpandactions%
- {\let\expandedaction\noexpandedaction}
-
-%D \macros
-%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
-%D \type{\firstcharacter}.
-%D
-%D \starttyping
-%D \getfirstcharacter {string}
-%D \stoptyping
-%D
-%D A two step expansion is used to prevent problems with
-%D complicated arguments, for instance arguments that
-%D consist of two or more expandable tokens.
-
-\def\dogetfirstcharacter#1#2\relax
- {\def\firstcharacter{#1}%
- \def\remainingcharacters{#2}}
-
-\def\getfirstcharacter#1%
- {\edef\!!stringa{#1}%
- \expandafter\dogetfirstcharacter\!!stringa\relax}
-
-\def\doiffirstcharelse#1#2% char string
-% kort (maar onleesbaar)
-% {\expanded{\dogetfirstcharacter#2}\\\doifelse{#1}\firstcharacter}
-% korter (en begrijpelijk))
- {\getfirstcharacter{#2}\doifelse{#1}\firstcharacter}
-% snel (maar zelden gebruikt, dus niet zo belangrijk)
-% {\getfirstcharacter{#2}%
-% \edef\!!stringa{#1}%
-% \ifx\!!stringa\firstcharacter
-% \expandafter\firstoftwoarguments
-% \else
-% \expandafter\secondoftwoarguments
-% \fi}
-
-%D \macros
-%D {doifinstringelse, doifincsnameelse}
-%D
-%D We can check for the presence of a substring in a given
-%D sequence of characters.
-%D
-%D \starttyping
-%D \doifinsetelse {substring} {string} {then ...} {else ...}
-%D \stoptyping
-%D
-%D An application of this command can be found further on.
-%D Like before, we first show some alternatives, like the one
-%D we started with:
-%D
-%D \starttyping
-%D \long\def\p!doifinstringelse#1#2#3#4%
-%D {\def\pp!doifinstringelse##1#1##2##3\war%
-%D {\if##2@%
-%D #4%
-%D \else
-%D #3%
-%D \fi}%
-%D \pp!doifinstringelse#2#1@@\war}
-%D
-%D \def\doifinstringelse%
-%D {\ExpandBothAfter\p!doifinstringelse}
-%D \stoptyping
-%D
-%D After this we came to:
-%D
-%D \starttyping
-%D \def\p!doifinstringelse#1#2%
-%D {\def\pp!doifinstringelse##1#1##2##3\war%
-%D {\if##2@}%
-%D \pp!doifinstringelse#2#1@@\war}
-%D
-%D \def\doifinstringelse#1#2#3#4%
-%D {\ExpandBothAfter\p!doifinstringelse{#1}{#2}%
-%D #4%
-%D \else
-%D #3%
-%D \fi}
-%D \stoptyping
-%D
-%D Sometimes the second argument is passed as a macro. By
-%D postponing the expansion of this macro, we gain quite some
-%D run time, simply because the less tokens we pass, the faster
-%D \TEX\ runs. So finally the definition became:
-
-% \long\def\rawdoifinstringelse#1#2% ##2 can be {abc}
-% {\long\def\pp!doifinstringelse##1#1##2##3\war{\if##2@}%
-% \pp!doifinstringelse#2#1@@\war
-% \expandafter\secondoftwoarguments
-% \else
-% \expandafter\firstoftwoarguments
-% \fi}
-
-\long\def\doifinstringelse#1%
- {\edef\@@@instring{#1}% expand #1 here
- \ifx\@@@instring\empty
- \@EA\thirdofthreearguments
- \else
- \@EA\dodoifinstringelse
- \fi}
-
-\long\def\dodoifinstringelse#1%
- {\p!doifinstringelse\@@@instring{#1}%
- \@EA\firstoftwoarguments
- \else
- \@EA\secondoftwoarguments
- \fi}
-
-\long\def\doifinstring#1%%
- {\edef\@@@instring{#1}% expand #1 here
- \ifx\@@@instring\empty
- \@EA\gobbletwoarguments
- \else
- \@EA\dodoifinstring
- \fi}
-
-\long\def\dodoifinstring#1%
- {\p!doifinstringelse\@@@instring{#1}%
- \@EA\firstofoneargument
- \else
- \@EA\gobbleoneargument
- \fi}
-
-\long\def\doifnotinstring#1%%
- {\edef\@@@instring{#1}% expand #1 here
- \ifx\@@@instring\empty
- \@EA\gobbletwoarguments
- \else
- \@EA\dodoifnotinstring
- \fi}
-
-\long\def\dodoifnotinstring#1%
- {\p!doifinstringelse\@@@instring{#1}%
- \@EA\gobbleoneargument
- \else
- \@EA\firstofoneargument
- \fi}
-
-%D \starttyping
-%D \beginTEX
-%D
-%D \long\def\p!doifinstringelse#1#2%
-%D {\long\def\pp!doifinstringelse##1#1##2##3\war%
-%D {\csname if\if##2@fals\else tru\fi e\endcsname}%
-%D \expanded{\pp!doifinstringelse#2#1@@\noexpand\war}} % expand #2 here
-%D
-%D \endTEX
-%D
-%D \beginETEX \unless
-%D
-%D \long\def\p!doifinstringelse#1#2%
-%D {\long\def\pp!doifinstringelse##1#1##2##3\war%
-%D {\unless\if##2@}%
-%D \expanded{\pp!doifinstringelse#2#1@@\noexpand\war}} % expand #2 here
-%D
-%D \endETEX
-%D \stoptyping
-%D
-%D And then \unknown\ after a couple of years, we ran into a
-%D situation where \type {##2} was something \type {{bla}}. So
-%D finally we need to use an auxiliary macro, otherwise we get
-%D funny strings in the output.
-
-% \long\def\p!doifinstringelse#1#2% ##2 can be {abc}
-% {\long\@EA\def\@EA\pp!doifinstringelse\@EA##\@EA1#1##2##3\war % expand #1 here
-% {\ppp!doifinstringelse##2\war}%
-% \expanded{\pp!doifinstringelse#2#1@@\noexpand\war}} % expand #2 here
-%
-% \beginTEX
-%
-% \def\ppp!doifinstringelse#1#2\war%
-% {\csname if\ifx#1@fals\else tru\fi e\endcsname}%
-%
-% \endTEX
-%
-% \beginETEX \unless
-%
-% \def\ppp!doifinstringelse#1#2\war%
-% {\unless\ifx#1@}
-%
-% \endETEX
-
-\beginETEX
-
-\long\def\p!doifinstringelse#1#2% ##2 can be {abc}
- {\long\@EA\def\@EA\pp!doifinstringelse\@EA##\@EA1#1##2##3\war % expand #1 here
- {\unless\if##2@}%
-% \expanded{\pp!doifinstringelse#2#1@@\noexpand\war}} % expand #2 here
- \expanded{\pp!doifinstringelse#2#1}@@\war} % expand #2 here
-
-\endETEX
-
-\beginTEX
-
-\long\def\p!doifinstringelse#1#2% ##2 can be {abc}
- {\long\@EA\def\@EA\pp!doifinstringelse\@EA##\@EA1#1##2##3\war % expand #1 here
- {\csname if\if##2@fals\else tru\fi e\endcsname}%
- %\expanded{\pp!doifinstringelse#2#1@@\noexpand\war}} % expand #2 here
- \expanded{\pp!doifinstringelse#2#1}@@\war} % expand #2 here
-
-\endTEX
-
-%D The next alternative proved to be upto twice as fast on
-%D tasks like checking reserved words in pretty verbatim
-%D typesetting! This is mainly due to the fact that passing
-%D (expanded) strings is much slower that passing a macro.
-%D
-%D \starttyping
-%D \doifincsnameelse {substring} {\string} {then ...} {else ...}
-%D \stoptyping
-%D
-%D Where \type{\doifinstringelse} does as much expansion as
-%D possible, the latter alternative does minimal (one level)
-%D expansion.
-
-\beginTEX
-
-\long\def\p!doifincsnameelse#1#2%
- {\long\def\pp!doifincsnameelse##1#1##2##3\war
- {\csname if\if##2@fals\else tru\fi e\endcsname}%
- \@EA\pp!doifincsnameelse#2#1@@\war}
-
-\endTEX
-
-\beginETEX \unless
-
-\long\def\p!doifincsnameelse#1#2%
- {\long\def\pp!doifincsnameelse##1#1##2##3\war
- {\unless\if##2@}%
- \@EA\pp!doifincsnameelse#2#1@@\war}
-
-\endETEX
-
-\long\def\doifincsnameelse#1#2% % #3#4%
- {\edef\@@@instring{#1}%
- \@EA\p!doifincsnameelse\@EA{\@@@instring}{#2}% % #3\else#4\fi}
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-%D \macros
-%D {doifnumberelse}
-%D
-%D The next macro executes a command depending of the outcome
-%D of a test on numerals. This is probably one of the fastest
-%D test possible, exept from a less robust 10||step
-%D \type{\if}||ladder or some tricky \type{\lcode} checking.
-%D
-%D \starttyping
-%D \doifnumberelse {string} {then ...} {else ...}
-%D \stoptyping
-%D
-%D The macro accepts \type{123}, \type{abc}, \type{{}},
-%D \type{\getal} and \type{\the\count...}. This macro is a
-%D rather dirty one.
-%D
-%D \starttyping
-%D \long\def\doifnumberelse#1#2#3%
-%D {\begingroup\donefalse
-%D \ifcase1#1\or\or\or\or\or\or\or\or\or\else\donetrue\fi
-%D \ifdone\endgroup#2\else\endgroup#3\fi}
-%D \stoptyping
-%D
-%D Or better:
-%D
-%D \starttyping
-%D \long\def\doifnumberelse#1%
-%D {\begingroup\donefalse
-%D \ifcase1#1\or\or\or\or\or\or\or\or\or\else\donetrue\fi
-%D \ifdone
-%D \endgroup\expandafter\firstoftwoarguments
-%D \else
-%D \endgroup\expandafter\secondoftwoarguments
-%D \fi}
-%D \stoptyping
-%D
-%D A previous implementation was:
-%D
-%D \starttyping
-%D \long\def\doifnumberelse#1#2#3%
-%D {\getfirstcharacter{#1}%
-%D \@EA\p!doifinstringelse\@EA{\firstcharacter}{1234567890}%
-%D #2%
-%D \else
-%D #3%
-%D \fi}
-%D \stoptyping
-%D
-%D And before we had \type{\p!doifinstringelse} available, we
-%D used:
-%D
-%D \starttyping
-%D \def\doifnumberelse#1%
-%D {\getfirstcharacter{#1}%
-%D \rawdoifinsetelse{\firstcharacter}{1,2,3,4,5,6,7,8,9,0}}
-%D \stoptyping
-%D
-%D The implementation using \type {\ifcase} is much faster, but
-%D the next one is not, not even when testing milion calls.
-%D
-%D \starttyping
-%D \newif\ifitsanumber
-%D
-%D \long\def\isitanumber#1%
-%D {\itsanumberfalse
-%D \ifcase1#1\or\or\or\or\or\or\or\or\or\else\itsanumbertrue\fi}
-%D
-%D \long\def\doifnumberelse#1#2#3%
-%D {\isitanumber{#1}\ifitsanumber#2\else#3\fi}
-%D \stoptyping
-%D
-%D After a while the next evolved and this one is the one we
-%D will use. This one is some 5\% faster than the group/done
-%D one (partly because it does not have to pass arguments).
-%D Even more important is that this alternative is fully
-%D expandable!
-
-\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
- \expandafter\firstoftwoarguments
- \fi}
-
-%D \macros
-%D {makerawcommalist,
-%D rawdoinsetelse,
-%D rawprocesscommalist,
-%D rawprocessaction}
-%D
-%D Some of the commands mentioned earlier are effective but
-%D slow. When one is desperately in need of faster alternatives
-%D and when the conditions are predictable safe, the \type{\raw}
-%D alternatives come into focus. A major drawback is that
-%D they do not take \type{\c!constants} into account, simply
-%D because no expansion is done. This is no problem with
-%D \type{\rawprocesscommalist}, because this macro does not
-%D compare anything. Expandable macros are permitted as search
-%D string.
-%D
-%D \starttyping
-%D \makerawcommalist[string,string,...]\stringlist
-%D \rawdoifinsetelse{string}{string,...}{...}{...}
-%D \rawprocesscommalist[string,string,...]\commando
-%D \rawprocessaction[x][a=>\a,b=>\b,c=>\c]
-%D \stoptyping
-%D
-%D Spaces embedded in the list, for instance after commas,
-%D spoil the search process. The gain in speed depends on the
-%D length of the argument (the longer the argument, the less
-%D we gain).
-%D
-%D The slow alternative looks like:
-%D
-%D \starttyping
-%D \def\makerawcommalist[#1]#2%
-%D {\def\appendtocommalist##1%
-%D {\doifelse{#2}{}
-%D {\edef#2{##1}}
-%D {\edef#2{#2,##1}}}%
-%D \def#2{}%
-%D \processcommalist[#1]\appendtocommalist}
-%D \stoptyping
-%D
-%D But we prefer:
-
-% \appendtocommalist is defined in syst-ext
-
-\def\makerawcommalist[#1]#2% use \processnext ... here
- {\def\domakerawcommalist##1% we don't expand ##1
- {\ifx#2\empty
- \def#2{##1}%
- \else
- \@EA\def\@EA#2\@EA{#2,##1}%
- \fi}%
- \let#2\empty
- \processcommalist[#1]\domakerawcommalist}
-
-\def\rawprocesscommaitem#1,#2% #2 eats up preceding space
- {\if]#1\else
- \csname\s!next\the\commalevel\endcsname{#1}%
- \expandafter\rawprocesscommaitem
- \fi#2}
-
-\def\rawprocesscommalist[#1]#2% accepteert ook [\cs]
- {\global\advance\commalevel \plusone
- \expandafter\let\csname\s!next\the\commalevel\endcsname#2%
- \expandafter\rawprocesscommaitem#1,],% \relax
- \global\advance\commalevel \minusone }
-
-\def\rawprocesscommacommand[#1]% not really needed
- {\expanded{\rawprocesscommalist[#1]}}
-
-% \def\rawdoifinsetelse#1#2{\doifinstringelse{,#1,}{,#2,}}
-% \def\rawdoifinset #1#2{\doifinstring {,#1,}{,#2,}}
-
-\def\@@rawempty{,,}
-
-\long\def\rawdoifinsetelse#1%
- {\edef\@@@instring{,#1,}% expand #1 here
- \ifx\@@@instring\@@rawempty
- \@EA\thirdofthreearguments
- \else
- \@EA\rawdodoifinsetelse
- \fi}
-
-\long\def\rawdodoifinsetelse#1%
- {\p!doifinstringelse\@@@instring{,#1,}%
- \@EA\firstoftwoarguments
- \else
- \@EA\secondoftwoarguments
- \fi}
-
-\long\def\rawdoifinset#1%
- {\edef\@@@instring{,#1,}% expand #1 here
- \ifx\@@@instring\@@rawempty
- \@EA\gobbletwoarguments
- \else
- \@EA\rawdodoifinset
- \fi}
-
-\long\def\rawdodoifinset#1%%
- {\p!doifinstringelse\@@@instring{,#1,}%
- \@EA\firstofoneargument
- \else
- \@EA\gobbleoneargument
- \fi}
-
-%D Some more raw material:
-
-\def\p!rawprocessaction[#1][#2]%
- {\def\pp!rawprocessaction##1,#1=>##2,##3\war%
- {\if##3@\else
- \def\!!processaction{##2}%
- \fi}%
- \pp!rawprocessaction,#2,#1=>,@\war}
-
-\def\rawprocessaction[#1]#2[#3]%
- {\edef\!!stringa{#1}%
- \edef\!!stringb{undefined}% better \!!undefined
- \let\!!processaction\!!stringb
- \ifx\!!stringa\empty
- \@EA\p!rawprocessaction\@EA[\s!default][#3]%
- \else
- \expandafter\p!rawprocessaction\expandafter[\!!stringa][#3]%
- \ifx\!!processaction\!!stringb
- \@EA\p!rawprocessaction\@EA[\s!unknown][#3]%
- \fi
- \fi
- \ifx\!!processaction\!!stringb
- \else
- \!!processaction
- \fi}
-
-% not needed
-%
-% \def\rawprocessallactionsinset[#1]#2[#3]%
-% {\def\docommand##1%
-% {\rawprocessaction[##1][#3]}%
-% \processcommalist[#1]\docommand}
-
-%D When we process the list \type{a,b,c,d,e}, the raw routine
-%D takes over 30\% less time, when we feed $20+$ character
-%D strings we gain about 20\%. Alternatives which use
-%D \type{\futurelet} perform worse. Part of the speedup is
-%D due to the \type{\let} and \type{\expandafter} in the test.
-
-% %D \macros
-% %D {processunexpandedcommalist}
-% %D
-% %D When processing commalists, the arguments are expanded. The
-% %D main reason for doing so lays in the fact that these
-% %D macros are used for interfacing. The next alternative can be used
-% %D for
-% %D
-% %D \starttyping
-% %D \processunexpandedcommalist
-% %D [\alfa\beta,\gamma,\delta\epsilon]
-% %D \handleitem
-% %D \stoptyping
-% %D
-% %D This time nesting is not supported.
-%
-% %\def\processunexpandedcommaitem#1,%
-% % {\if]\noexpand#1%
-% % \let\nextcommaitem\relax
-% % \else
-% % \handleunexpandedcommaitem{#1}%
-% % \let\nextcommaitem\processunexpandedcommaitem
-% \fi
-% \nextcommaitem}
-%
-% faster:
-%
-% \def\processunexpandedcommaitem#1,%
-% {\if]\noexpand#1\else
-% \handleunexpandedcommaitem{#1}%
-% \expandafter\processunexpandedcommaitem
-% \fi}
-%
-% \def\processunexpandedcommalist[#1]#2%
-% {\def\handleunexpandedcommaitem{#2}%
-% \processunexpandedcommaitem#1,],}% \relax}
-%
-% %D Or faster:
-%
-% \def\processunexpandedcommaitem#1,%
-% {\if]\noexpand#1\else
-% \handleunexpandedcommaitem{#1}%
-% \expandafter\processunexpandedcommaitem
-% \fi}
-
-%D \macros
-%D {dosetvalue,dosetevalue,dosetgvalue,docopyvalue,doresetvalue,
-%D dogetvalue}
-%D
-%D When we are going to do assignments, we have to take
-%D multi||linguality into account. For the moment we keep
-%D things simple and single||lingual.
-%D
-%D \starttyping
-%D \dosetvalue {label} {variable} {value}
-%D \dosetevalue {label} {variable} {value}
-%D \dosetgvalue {label} {variable} {value}
-%D \docopyvalue {to label} {from label} {variable}
-%D \doresetvalue {label} {variable}
-%D \stoptyping
-%D
-%D These macros are in fact auxiliary ones and are not meant
-%D for use outside the assignment macros.
-
-\def\dosetvalue#1#2% #3
- {\@EA\def\csname#1#2\endcsname} % {#3}}
-
-\def\dosetevalue#1#2% #3
- {\@EA\edef\csname#1#2\endcsname} % {#3}}
-
-\def\dosetgvalue#1#2% #3
- {\@EA\gdef\csname#1#2\endcsname} % {#3}}
-
-\def\doresetvalue#1#2%
- {\@EA\let\csname#1#2\endcsname\empty}
-
-\def\doignorevalue#1#2#3%
- {\@EA\let\csname#1#2\endcsname\empty}
-
-\def\docopyvalue#1#2#3%
- {\@EA\def\csname#1#3\endcsname{\csname#2#3\endcsname}}
-
-%D \macros
-%D {doassign,undoassign,doassignempty}
-%D
-%D Assignments are the backbone of \CONTEXT. Abhorred by the
-%D concept of style file hacking, we took a considerable effort
-%D in building a parameterized system. Unfortunately there is a
-%D price to pay in terms of speed. Compared to other packages
-%D and taking the functionality of \CONTEXT\ into account, the
-%D total size of the format file is still very acceptable. Now
-%D how are these assignments done.
-%D
-%D Assignments can be realized with:
-%D
-%D \starttyping
-%D \doassign[label][variable=value]
-%D \undoassign[label][variable=value]
-%D \stoptyping
-%D
-%D and:
-%D
-%D \starttyping
-%D \doassignempty[label][variable=value]
-%D \stoptyping
-%D
-%D Assignments like \type{\doassign} are compatible with:
-%D
-%D \starttyping
-%D \def\labelvariable{value}
-%D \stoptyping
-%D
-%D We do check for the presence of an \type{=} and loudly
-%D complain of it's missed. We will redefine this macro later
-%D on, when a more advanced message mechanism is implemented.
-
-\newif\iferrorisfatal
-
-\def\waitonfatalerror
- {\iferrorisfatal\wait\fi}
-
-\def\showassignerror#1#2%
- {\writestatus{setup}{missing or ungrouped '=' after '#1' in line #2}%
- \waitonfatalerror}
-
-%\def\p!doassign#1[#2][#3=#4=#5]%
-% {\let\donottest\dontprocesstest
-% \edef\!!stringa{#5}%
-% \let\!!stringb\relax
-% \let\donottest\doprocesstest
-% \ifx\!!stringa\!!stringb
-% \showassignerror{#3}%
-% \else
-% #1{#2}{#3}{#4}%
-% \fi}
-
-\def\p!doassign#1[#2][#3=#4=#5]%
- {\ifx\empty#3\else % and definitely not \ifx#3\empty
- \ifx\relax#5%
- \showassignerror{#3}{\the\inputlineno\space(#2)}%
- \else
- #1{#2}{#3}{#4}%
- \fi
- \fi}
-
-\def\doassign [#1][#2]{\p!doassign\dosetvalue [#1][#2==\relax]}
-\def\doeassign [#1][#2]{\p!doassign\dosetevalue [#1][#2==\relax]}
-\def\undoassign[#1][#2]{\p!doassign\doresetvalue[#1][#2==\relax]}
-
-\def\doassignempty[#1][#2=#3]%
- {\ifundefined{#1#2}\dosetvalue{#1}{#2}{#3}\fi}
-
-%D \macros
-%D {processassignmentlist,processassignmentcommand,
-%D startprocessassignmentlist,startprocessassignmentcommand}
-%D
-%D For Wolfgang:
-%D
-%D \starttyping
-%D \def\showpair#1#2{key:#1, value:#2\par}
-%D \processassignmentlist[a=1,b=2]\showpair
-%D \stoptyping
-
-\def\processassignmentlist[#1]#2% #2 == \command{key}{value]
- {\def\doprocessassignmententry##1{#2}% {##2}{##3} % namespace is ignored
- \dogetparameters\doprocessassignmententry[][#1]}
-
-\def\processassignmentcommand[#1]%
- {\normalexpanded{\noexpand\processassignmentlist[#1]}}
-
-\long\def\startprocessassignmentlist[#1]#2\stopprocessassignmentlist
- {\long\def\currentassignmentlistcommand##1##2{\def\currentassignmentlistkey{##1}\def\currentassignmentlistvalue{##2}#2}%
- \processassignmentlist[#1]\currentassignmentlistcommand}
-
-\long\def\startprocessassignmentcommand[#1]#2\stopprocessassignmentcommand
- {\long\def\currentassignmentlistcommand##1##2{\def\currentassignmentlistkey{##1}\def\currentassignmentlistvalue{##2}#2}%
- \normalexpanded{\noexpand\processassignmentlist[#1]}\currentassignmentlistcommand}
-
-%D \macros
-%D {getparameters,geteparameters,getgparameters,
-%D forgetparameters}
-%D
-%D Using the assignment commands directly is not our
-%D ideal of user friendly interfacing, so we take some further
-%D steps.
-%D
-%D \starttyping
-%D \getparameters [label] [...=...,...=...]
-% %D \forgetparameters [label] [...=...,...=...]
-%D \stoptyping
-%D
-%D Again, the label identifies the category a variable
-%D belongs to. The second argument can be a comma separated
-%D list of assignments.
-%D
-%D \starttyping
-%D \getparameters
-%D [demo]
-%D [alfa=1,
-%D beta=2]
-%D \stoptyping
-%D
-%D is equivalent to
-%D
-%D \starttyping
-%D \def\demoalfa{1}
-%D \def\demobeta{2}
-%D \stoptyping
-%D
-%D
-%D In the pre||multi||lingual stadium \CONTEXT\ took the next
-%D approach. With
-%D
-%D \starttyping
-%D \def\??demo {@@demo}
-%D \def\!!alfa {alfa}
-%D \def\!!beta {beta}
-%D \stoptyping
-%D
-%D calling
-%D
-%D \starttyping
-%D \getparameters
-%D [\??demo]
-%D [\!!alfa=1,
-%D \!!beta=2]
-%D \stoptyping
-%D
-%D lead to:
-%D
-%D \starttyping
-%D \def\@@demoalfa{1}
-%D \def\@@demobeta{2}
-%D \stoptyping
-%D
-%D Because we want to be able to distinguish the \type{!!}
-%D pre||tagged user supplied variables from internal
-%D counterparts, we will introduce a slightly different tag in
-%D the multi||lingual modules. There we will use \type{c!} or
-%D \type{v!}, depending on the context.
-%D
-%D By calling \type{\p!doassign} directly, we save ourselves
-%D some argument passing and gain some speed. Whatever
-%D optimizations we do, this command will always be one of the
-%D bigger bottlenecks.
-%D
-%D The alternative \type{\geteparameters} --- it's funny to
-%D see that this alternative saw the light so lately --- can be
-%D used to do expanded assigments.
-
-\def\dogetparameters#1[#2]#3[#4]%
- {\def\p!dogetparameter##1%
- {\p!doassign#1[#2][##1==\relax]}%
- \processcommalist[#4]\p!dogetparameter}
-
-\def\getparameters {\dogetparameters\dosetvalue}
-\def\geteparameters {\dogetparameters\dosetevalue}
-\def\getgparameters {\dogetparameters\dosetgvalue}
-\def\forgetparameters{\dogetparameters\doignorevalue}
-
-\let\getexpandedparameters=\geteparameters
-
-%D This one is slightly faster:
-
-\def\dogetparameters#1[#2]#3[#4%
- {\if\noexpand#4]%
- \expandafter\gobbleoneargument
- \else
- \def\p!dogetparameter##1{\p!doassign#1[#2][##1==\relax]}%
- \expandafter\xdogetparameters
- \fi#4}
-
-\def\xdogetparameters#1]%
- {\processcommalist[#1]\p!dogetparameter}
-
-%D The next alternative is much faster but also uglier. Because
-%D in \XML\ processing we will probably set much more parameters
-%D than normally we need this faster one.
-
-\def\dogetparameters#1[#2]#3[#4%
- {\if\noexpand#4]%
- \expandafter\gobbleoneargument
- \else
- \def\p!dogetparameter{\p!doassign#1#2}%
- \expandafter\xdogetparameters
- \fi#4}
-
-\def\xdogetparameters#1]%
- {\xprocesscommaitem#1,],\@relax@}
-
-% \long\def\xprocesscommaitem#1,#2% #2 takes space before ,
-% {\if]#1%
-% \expandafter\gobbleoneargument
-% \else
-% \p!dogetparameter\@relax@#1==\@relax@
-% \expandafter\xprocesscommaitem
-% \fi#2}
-
-\long\def\xprocesscommaitem#1,#2% #2 takes space before ,
- {\if,#1,% dirty trick for testing #1=empty
- \@EA\xprocesscommaitem
- \else\if]#1%
- \@EAEAEA\gobbleoneargument
- \else
- \p!dogetparameter\@relax@#1==\empty\@relax@
- \@EAEAEA\xprocesscommaitem
- \fi\fi#2}
-
-%D Here we use a slightly different assignment macro:
-
-% \def\p!doassign#1#2\@relax@#3=#4=#5\@relax@
-% {\ifx\@relax@#5\@EA\xshowassignerror\else\@EA#1\fi{#2}{#3}{#4}}
-
-% \def\p!doassign#1#2\@relax@#3=#4=#5\@relax@
-% {\ifx#5\empty\@EA\xshowassignerror\else\@EA#1\fi{#2}{#3}{#4}}
-
-\def\p!doassign#1#2\@relax@#3=#4=#5#6\@relax@
- {\ifx#5\empty
- \@EA\xshowassignerror
- \else\ifx#5=%
- \@EAEAEA#1%
- \else
- \@EAEAEA\xshowassignerror
- \fi\fi
- {#2}{#3}{#4}}
-
-\def\xshowassignerror#1#2#3%
- {\showassignerror{#2}{\the\inputlineno\space(#1)}}
-
-%D Now we also have to change the other macros that depend
-%D on this low level one.
-
-% \def\doassign [#1][#2]{\p!doassign\dosetvalue #1\@relax@#2==\@relax@}
-% \def\doeassign [#1][#2]{\p!doassign\dosetevalue #1\@relax@#2==\@relax@}
-% \def\undoassign[#1][#2]{\p!doassign\doresetvalue#1\@relax@#2==\@relax@}
-
-\def\doassign [#1][#2]{\p!doassign\dosetvalue #1\@relax@#2==\empty\@relax@}
-\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}}
-
-\def\p!n!doassign#1#2\@relax@#3=#4=#5#6\@relax@
- {\ifx\empty#3\empty
- \@EA\xshowassignerror
- \else\ifx#5\empty
- \@EAEAEA\xshowassignerror
- \else
- \@EAEAEA#1%
- \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}}
-
-\def\p!e!doassign#1#2\@relax@#3=#4=#5#6\@relax@
- {\ifx\empty#3\empty
- \@EA\xshowassignerror
- \else\ifx#5\empty
- \@EAEAEA\xshowassignerror
- \else
- \@EA\ifx\csname#2#3\endcsname\relax
- \let\currentvalue\empty
- \else
- \@EA\let\@EA\currentvalue\csname#2#3\endcsname
- \fi
- \@EAEAEA#1%
- \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}}
-
-\def\p!e!doassign#1#2\@relax@#3=#4=#5#6\@relax@
- {\ifx\empty#3\empty
- \@EA\xshowassignerror
- \else\ifx#5\empty
- \@EAEAEA\xshowassignerror
- \else
- \ifcsname#2#3\endcsname
- \@EA\let\@EA\currentvalue\csname#2#3\endcsname
- \else
- \let\currentvalue\empty
- \fi
- \@EAEAEA#1%
- \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
-%D Sometimes we explicitly want variables to default to an
-%D empty string, so we welcome:
-%D
-%D \starttyping
-%D \getemptyparameters [label] [...=...,...=...]
-%D \stoptyping
-
-\def\getemptyparameters[#1]#2[#3]%
- {\def\p!dogetemptyparameter##1%
- {\doassignempty[#1][##1]}%
- \processcommalist[#3]\p!dogetemptyparameter}
-
-%D \macros
-%D {copyparameters}
-%D
-%D Some \CONTEXT\ commands take their default setups from
-%D others. All commands that are able to provide backgounds
-%D or rules around some content, for instance default to the
-%D standard command for ruled boxes. Is situations like this
-%D we can use:
-%D
-%D \starttyping
-%D \copyparameters [to-label] [from-label] [name1,name2,...]
-%D \stoptyping
-%D
-%D For instance
-%D
-%D \starttyping
-%D \copyparameters
-%D [internal][external]
-%D [alfa,beta]
-%D \stoptyping
-%D
-%D Leads to:
-%D
-%D \starttyping
-%D \def\internalalfa {\externalalfa}
-%D \def\internalbeta {\externalbeta}
-%D \stoptyping
-%D
-%D By using \type{\docopyvalue} we've prepared this command
-%D for use in a multi||lingual environment.
-
-\def\copyparameters[#1]#2[#3]#4[#5]%
- {\doifnot{#1}{#3}
- {\def\docopyparameter{\docopyvalue{#1}{#3}}%
- %\def\docopyparameter##1{\docopyvalue{#1}{#3}{##1}}%
- \processcommalist[#5]\docopyparameter}}
-
-%D \macros
-%D {ifparameters,checkparameters}
-%D
-%D A slightly different one is \type{\checkparameters}, which
-%D also checks on the presence of a~\type{=}.
-%D
-%D The boolean \type{\ifparameters} can be used afterwards.
-%D Combining both in one \type{\if}||macro would lead to
-%D problems with nested \type{\if}'s.
-%D
-%D \starttyping
-%D \checkparameters[argument]
-%D \stoptyping
-
-\newif\ifparameters
-
-\def\p!checkparameters#1=#2#3\war%
- {\if#2@\parametersfalse\else\parameterstrue\fi}
-
-\def\checkparameters[#1]%
- {\p!checkparameters#1=@@\war}
-
-%D \macros
-%D {getfromcommalist,getfromcommacommand,
-%D commalistelement,
-%D getcommalistsize,getcommacommandsize}
-%D
-%D It's possible to get an element from a commalist or a
-%D command representing a commalist.
-%D
-%D \starttyping
-%D \getfromcommalist [string] [n]
-%D \getfromcommacommand [string,\strings,string,...] [n]
-%D \stoptyping
-%D
-%D The difference betwee the two of them is the same as the
-%D difference between \type{\processcomma...}. The found string
-%D is stored in \type{\commalistelement}.
-%D
-%D We can calculate the size of a comma separated list by
-%D using:
-%D
-%D \starttyping
-%D \getcommalistsize [string,string,...]
-%D \getcommacommandsize [string,\strings,string,...]
-%D \stoptyping
-%D
-%D Afterwards, the length is available in the macro
-%D \type{\commalistsize} (not a \COUNTER).
-
-\newcount\commalistcounter
-
-\def\commalistsize{0}
-
-\def\p!dogetcommalistsize#1%
- {\advance\commalistcounter\plusone}
-
-\def\getcommalistsize#1]% don't loose [{#1}]
- {\commalistcounter\zerocount
- \processcommalist#1]\p!dogetcommalistsize % was [{#1}]
- \edef\commalistsize{\the\commalistcounter}}
-
-\def\getcommacommandsize[#1]%
- {\edef\commacommand{#1}%
- \scratchtoks\expandafter{\expandafter[\commacommand]}%
- \expandafter\getcommalistsize\the\scratchtoks }
-
-% to be tested first
-%
-% \def\getcommacommandsize[#1]%
-% {\expanded{\getcommalistsize[#1]}}
-
-% \def\p!dogetfromcommalist#1%
-% {\advance\commalistcounter \minusone
-% \ifcase\commalistcounter
-% \def\commalistelement{#1}%
-% \begingroup\def\doprocesscommaitem##1]{\endgroup}%
-% \fi}
-
-\def\p!dogetfromcommalist#1%
- {\advance\commalistcounter \minusone
- \ifcase\commalistcounter
- \def\commalistelement{#1}%
- \expandafter\quitcommalist
- \fi}
-
-\def\getfromcommalist[#1]#2[#3]%
- {\let\commalistelement\empty
- \commalistcounter#3\relax
- \processcommalist[#1]\p!dogetfromcommalist}
-
-% \def\getfromcommacommand[#1]% why so complicated, still needed?
-% {\edef\commacommand{#1}%
-% \toks0=\expandafter{\expandafter[\commacommand]}%
-% \expandafter\getfromcommalist\the\toks0 }
-
-\def\getfromcommacommand[#1]%
- {\expanded{\getfromcommalist[#1]}}
-
-%D Because 0, 1 and~2 are often asked for, we optimize this
-%D macro for those cases. The indirect call however slows
-%D down the other cases.
-%D
-%D \starttyping
-%D \def\p!dogetfirstfromcommalist [#1,#2]{\def\commalistelement{#1}}
-%D \def\p!dogetsecondfromcommalist[#1,#2,#3]{\def\commalistelement{#2}}
-%D \let\p!dogetotherfromcommalist=\getfromcommalist
-%D
-%D \def\getfromcommalist[#1]#2[#3]% optimized for 0,1,2
-%D {\ifcase#3\relax
-%D \let\commalistelement\empty
-%D \or
-%D \p!dogetfirstfromcommalist[#1,]%
-%D \or
-%D \p!dogetsecondfromcommalist[#1,,]%
-%D \else
-%D \p!dogetotherfromcommalist[#1][#3]%
-%D \fi}
-%D \stoptyping
-%D
-%D Even worse, this alternative does not strip preceding
-%D spaces, which is what we want. So, we stick to the slow
-%D alternative.
-
-%D Watertight (and efficient) solutions are hard to find, due
-%D to the handling of braces during parameters passing and
-%D scanning. Nevertheless:
-%D
-%D \startbuffer
-%D \def\dosomething#1{(#1=\commalistsize) }
-%D
-%D \getcommalistsize [\hbox{$a,b,c,d,e,f$}] \dosomething 1
-%D \getcommalistsize [{a,b,c,d,e,f}] \dosomething 1
-%D \getcommalistsize [{a,b,c},d,e,f] \dosomething 4
-%D \getcommalistsize [a,b,{c,d,e},f] \dosomething 4
-%D \getcommalistsize [a{b,c},d,e,f] \dosomething 4
-%D \getcommalistsize [{a,b}c,d,e,f] \dosomething 4
-%D \getcommalistsize [] \dosomething 0
-%D \getcommalistsize [{[}] \dosomething 1
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D reports:
-%D
-%D \getbuffer
-
-%D \macros
-%D {dogetcommalistelement,dogetcommacommandelement}
-%D
-%D For low level (fast) purposes, we can also use the next
-%D alternative, which can handle 8~elements at most.
-%D
-%D \starttyping
-%D \dogetcommalistelement1\from a,b,c\to\commalistelement
-%D \stoptyping
-
-\def\dodogetcommalistelement#1\from#2,#3,#4,#5,#6,#7,#8\to#9%
- {\edef#9{\ifcase#1\relax\or#2\or#3\or#4\or#5\or#6\or#7\or#8\fi}}
-
-% maybe better:
-%
-% {\@EA\edef\@EA#9\@EA{\ifcase#1\relax\or#2\or#3\or#4\or#5\or#6\or#7\or#8\fi}}
-
-\def\dogetcommalistelement#1\from#2\to%
- {\dodogetcommalistelement#1\from#2,,,,,,\to}
-
-% check sources
-
-\def\dogetcommacommandelement#1\from#2\to%
- {\@EA\dodogetcommalistelement\@EA#1\@EA\from#2,,,,,,\to}
-
-%D \macros
-%D {dosingleargument,dodoubleargument,dotripleargument,
-%D doquadrupleargument,doquintupleargument,dosixtupleargument,
-%D doseventupleargument}
-%D
-%D When working with delimited arguments, spaces and
-%D lineendings can interfere. The next set of macros uses
-%D \TEX' internal scanner for grabbing everything between
-%D arguments. Forgive me the funny names.
-%D
-%D \starttyping
-%D \dosingleargument\commando = \commando[#1]
-%D \dodoubleargument\commando = \commando[#1][#2]
-%D \dotripleargument\commando = \commando[#1][#2][#3]
-%D \doquadrupleargument\commando = \commando[#1][#2][#3][#4]
-%D \doquintupleargument\commando = \commando[#1][#2][#3][#4][#5]
-%D \dosixtupleargument\commando = \commando[#1][#2][#3][#4][#5][#6]
-%D \doseventupleargument\command= \commando[#1][#2][#3][#4][#5][#6][#7]
-%D \stoptyping
-%D
-%D These macros are used in the following way:
-%D
-%D \starttyping
-%D \def\dosetupsomething[#1][#2]%
-%D {... #1 ... #2 ...}
-%D
-%D \def\setupsomething%
-%D {\dodoubleargument\dosetupsomething}
-%D \stoptyping
-%D
-%D The implementation can be surprisingly simple and needs no
-%D further explanation, like:
-%D
-%D \starttyping
-%D \def\dosingleargument#1[#2]%
-%D {#1[#2]}
-%D \def\dotripleargument#1[#2]#3[#4]#5[#6]%
-%D {#1[#2][#4][#6]}
-%D \def\doquintupleargument#1%
-%D {\def\dodoquintupleargument[##1]##2[##3]##4[##5]##6[##7]##8[##9]%
-%D {#1[##1][##3][##5][##7][##9]}%
-%D \dodoquintupleargument}
-%D \stoptyping
-%D
-%D Because \TEX\ accepts 9~arguments at most, we have to use
-%D two||step solution when getting five or more arguments.
-%D
-%D When developing more and more of the real \CONTEXT, we
-%D started using some alternatives that provided empty
-%D arguments (in fact optional ones) whenever the user failed
-%D to supply them. Because this more complicated macros enable
-%D us to do some checking, we reimplemented the non||empty
-%D ones.
-
-\def\dosingleargument {\chardef\expectedarguments 1 \dosingleempty }
-\def\dodoubleargument {\chardef\expectedarguments 2 \dodoubleempty }
-\def\dotripleargument {\chardef\expectedarguments 3 \dotripleempty }
-\def\doquadrupleargument {\chardef\expectedarguments 4 \doquadrupleempty }
-\def\doquintupleargument {\chardef\expectedarguments 5 \doquintupleempty }
-\def\dosixtupleargument {\chardef\expectedarguments 6 \dosixtupleempty }
-\def\doseventupleargument{\chardef\expectedarguments 7 \doseventupleempty}
-
-%D \macros
-%D {iffirstagument,ifsecondargument,ifthirdargument,
-%D iffourthargument,iffifthargument,ifsixthargument,
-%D ifseventhargument}
-%D
-%D We use some signals for telling the calling macros if all
-%D wanted arguments are indeed supplied by the user.
-
-\newif\iffirstargument
-\newif\ifsecondargument
-\newif\ifthirdargument
-\newif\iffourthargument
-\newif\iffifthargument
-\newif\ifsixthargument
-\newif\ifseventhargument
-
-%D \macros
-%D {dosingleempty,dodoubleempty,dotripleempty,
-%D doquadrupleempty,doquintupleempty,dosixtupeempty,
-%D doseventupleempty}
-%D
-%D The empty argument supplying macros mentioned before, look
-%D like:
-%D
-%D \starttyping
-%D \dosingleempty \command
-%D \dodoubleempty \command
-%D \dotripleempty \command
-%D \doquadrupleempty \command
-%D \doquintupleempty \command
-%D \dosixtupleempty \command
-%D \doseventupleempty\command
-%D \stoptyping
-%D
-%D So \type{\dodoubleempty} leades to:
-%D
-%D \starttyping
-%D \command[#1][#2]
-%D \command[#1][]
-%D \command[][]
-%D \stoptyping
-%D
-%D Depending of the generousity of the user. Afterwards one can
-%D use the \type{\if...argument} boolean. For novice: watch
-%D the stepwise doubling of \type{#}'s
-
-% idea: \ignorespaces afterwards
-
-\chardef\noexpectedarguments=0
-\chardef\expectedarguments =0
-
-\def\showargumenterror#1#2%
- {\writestatus{systems}{#1 argument(s) expected in line #2}}
-
-% \long\def\dogetargument#1#2#3#4% redefined in mult-ini
-% {\doifnextcharelse{#1}
-% {\let\expectedarguments\noexpectedarguments
-% #3\dodogetargument}
-% {\ifnum\expectedarguments>\noexpectedarguments
-% \showargumenterror{\expectedarguments}
-% \fi
-% \let\expectedarguments\noexpectedarguments
-% #4\dodogetargument#1#2}}
-%
-% less to pass
-
-\def\doshowargumenterror
- {\ifnum\expectedarguments>\noexpectedarguments
- \showargumenterror{\number\expectedarguments}{\number\inputlineno}%
- \fi
- \noshowargumenterror}
-
-\def\noshowargumenterror
- {\let\expectedarguments\noexpectedarguments}
-
-% \long\def\dogetargument#1#2#3#4%
-% {\doifnextcharelse#1%
-% {\noshowargumenterror#3\dodogetargument}
-% {\doshowargumenterror#4\dodogetargument#1#2}}
-%
-% faster ?
-
-\long\def\dogetargument#1#2#3#4%
- {\let\charactertoken=#1%
- \def\!!stringa{\noshowargumenterror#3\dodogetargument}%
- \def\!!stringb{\doshowargumenterror#4\dodogetargument#1#2}%
- \futurelet\nexttoken\inspectnextcharacter}
-
-\def\getsingleempty#1#2#3%
- {\def\dodogetargument%
- {#3}%
- \dogetargument#1#2\firstargumenttrue\firstargumentfalse}
-
-\def\getdoubleempty#1#2#3%
- {\def\dodogetargument#1##1#2%
- {\def\dodogetargument%
- {#3#1{##1}#2}%
- \dogetargument#1#2\secondargumenttrue\secondargumentfalse}%
- \dogetargument#1#2\firstargumenttrue\firstargumentfalse}
-
-\def\gettripleempty#1#2#3%
- {\def\dodogetargument#1##1#2%
- {\def\dodogetargument#1####1#2%
- {\def\dodogetargument%
- {#3#1{##1}#2%
- #1{####1}#2}%
- \dogetargument#1#2\thirdargumenttrue\thirdargumentfalse}%
- \dogetargument#1#2\secondargumenttrue\secondargumentfalse}%
- \dogetargument#1#2\firstargumenttrue\firstargumentfalse}
-
-\def\getquadrupleempty#1#2#3%
- {\def\dodogetargument#1##1#2%
- {\def\dodogetargument#1####1#2%
- {\def\dodogetargument#1########1#2%
- {\def\dodogetargument%
- {#3#1{##1}#2%
- #1{####1}#2%
- #1{########1}#2}%
- \dogetargument#1#2\fourthargumenttrue\fourthargumentfalse}%
- \dogetargument#1#2\thirdargumenttrue\thirdargumentfalse}%
- \dogetargument#1#2\secondargumenttrue\secondargumentfalse}%
- \dogetargument#1#2\firstargumenttrue\firstargumentfalse}
-
-\def\getquintupleempty#1#2#3%
- {\def\dodogetargument#1##1#2%
- {\def\dodogetargument#1####1#2%
- {\def\dodogetargument#1########1#2%
- {\def\dodogetargument#1################1#2%
- {\def\dodogetargument%
- {#3#1{##1}#2%
- #1{####1}#2%
- #1{########1}#2%
- #1{################1}#2}%
- \dogetargument#1#2\fifthargumenttrue\fifthargumentfalse}%
- \dogetargument#1#2\fourthargumenttrue\fourthargumentfalse}%
- \dogetargument#1#2\thirdargumenttrue\thirdargumentfalse}%
- \dogetargument#1#2\secondargumenttrue\secondargumentfalse}%
- \dogetargument#1#2\firstargumenttrue\firstargumentfalse}
-
-\def\getsixtupleempty#1#2#3%
- {\def\dodogetargument#1##1#2%
- {\def\dodogetargument#1####1#2%
- {\def\dodogetargument#1########1#2%
- {\def\dodogetargument#1################1#2%
- {\def\dodogetargument#1################################1#2%
- {\def\dodogetargument%
- {#3#1{##1}#2%
- #1{####1}#2%
- #1{########1}#2%
- #1{################1}#2%
- #1{################################1}#2}%
- \dogetargument#1#2\sixthargumenttrue\sixthargumentfalse}%
- \dogetargument#1#2\fifthargumenttrue\fifthargumentfalse}%
- \dogetargument#1#2\fourthargumenttrue\fourthargumentfalse}%
- \dogetargument#1#2\thirdargumenttrue\thirdargumentfalse}%
- \dogetargument#1#2\secondargumenttrue\secondargumentfalse}%
- \dogetargument#1#2\firstargumenttrue\firstargumentfalse}
-
-\def\getseventupleempty#1#2#3%
- {\def\dodogetargument#1##1#2%
- {\def\dodogetargument#1####1#2%
- {\def\dodogetargument#1########1#2%
- {\def\dodogetargument#1################1#2%
- {\def\dodogetargument#1################################1#2%
- {\def\dodogetargument#1################################%
- ################################1#2%
- {\def\dodogetargument%
- {#3#1{##1}#2%
- #1{####1}#2%
- #1{########1}#2%
- #1{################1}#2%
- #1{################################1}#2%
- #1{################################%
- ################################1}#2}%
- \dogetargument#1#2\seventhargumenttrue\seventhargumentfalse}%
- \dogetargument#1#2\sixthargumenttrue\sixthargumentfalse}%
- \dogetargument#1#2\fifthargumenttrue\fifthargumentfalse}%
- \dogetargument#1#2\fourthargumenttrue\fourthargumentfalse}%
- \dogetargument#1#2\thirdargumenttrue\thirdargumentfalse}%
- \dogetargument#1#2\secondargumenttrue\secondargumentfalse}%
- \dogetargument#1#2\firstargumenttrue\firstargumentfalse}
-
-\def\dosingleempty {\getsingleempty []}
-\def\dodoubleempty {\getdoubleempty []}
-\def\dotripleempty {\gettripleempty []}
-\def\doquadrupleempty {\getquadrupleempty []}
-\def\doquintupleempty {\getquintupleempty []}
-\def\dosixtupleempty {\getsixtupleempty []}
-\def\doseventupleempty{\getseventupleempty[]}
-
-%D Because some of these are called quite often, we will now
-%D replace the more general version by alternatives tuned for
-%D speed.
-
-\def\dosingleempty#1%
- {\noshowargumenterror % \relax % prevents lookahead, brr
- \doifnextoptionalelse
- {\firstargumenttrue#1}
- {\dosinglefakeempty#1}}
-
-\def\dodoubleempty#1%
- {\noshowargumenterror % \relax % prevents lookahead, brr
- \doifnextoptionalelse
- {\dodoubletestempty#1}
- {\dodoublefakeempty#1}}
-
-\def\dotripleempty#1%
- {\noshowargumenterror % \relax % prevents lookahead, brr
- \doifnextoptionalelse
- {\dotripletestempty#1}
- {\dotriplefakeempty#1}}
-
-\def\dosinglefakeempty#1%
- {\firstargumentfalse#1[]}
-
-\def\dodoublefakeempty#1%
- {\firstargumentfalse\secondargumentfalse#1[][]}
-
-\def\dotriplefakeempty#1%
- {\firstargumentfalse\secondargumentfalse\thirdargumentfalse#1[][][]}
-
-\long\def\dodoubletestempty#1[#2]%
- {\firstargumenttrue
- \doifnextoptionalelse
- {\secondargumenttrue #1[{#2}]}
- {\secondargumentfalse#1[{#2}][]}}
-
-\long\def\dotripletestempty#1[#2]%
- {\firstargumenttrue
- \doifnextoptionalelse
- {\dotripletestemptyx #1[{#2}]}
- {\secondargumentfalse
- \thirdargumentfalse #1[{#2}][][]}}
-
-\long\def\dotripletestemptyx#1[#2][#3]%
- {\secondargumenttrue
- \doifnextoptionalelse
- {\thirdargumenttrue #1[{#2}][{#3}]}
- {\thirdargumentfalse#1[{#2}][{#3}][]}}
-
-%D \macros
-%D {strippedcsname}
-%D
-%D The next macro can be very useful when using \type{\csname}
-%D like in:
-%D
-%D \starttyping
-%D \csname if\strippedcsname\something\endcsname
-%D \stoptyping
-%D
-%D This expands to \type{\ifsomething}.
-
-\def\strippedcsname%
- {\expandafter\gobbleoneargument\string}
-
-%D \macros
-%D {complexorsimple,complexorsimpleempty}
-%D
-%D Setups can be optional. A command expecting a setup is
-%D prefixed by \type{\complex}, a command without one gets the
-%D prefix \type{\simple}. Commands like this can be defined by:
-%D
-%D \starttyping
-%D \complexorsimple\command
-%D \stoptyping
-%D
-%D When \type{\command} is followed by a \type{[setup]}, then
-%D
-%D \starttyping
-%D \complexcommand [setup]
-%D \stoptyping
-%D
-%D executes, else we get
-%D
-%D \starttyping
-%D \simplecommand
-%D \stoptyping
-%D
-%D An alternative for \type{\complexorsimple} is:
-%D
-%D \starttyping
-%D \complexorsimpleempty {command}
-%D \stoptyping
-%D
-%D Depending on the presence of \type{[setup]}, this one
-%D leads to one of:
-%D
-%D \starttyping
-%D \complexcommando [setup]
-%D \complexcommando []
-%D \stoptyping
-%D
-%D Many \CONTEXT\ commands started as complex or simple ones,
-%D but changed into more versatile (more object oriented) ones
-%D using the \type{\get..argument} commands.
-
-% This method is needed when traditional tex is used with
-% the efficient definition (marked **) below.
-
-% an old one:
-%
-% \def\setnameofcommand#1% handles {abc} as well as \abc
-% {\begingroup
-% \escapechar=-1
-% \globaldefs=0 % pretty important!
-% \xdef\nameofcommand{\string#1}%
-% \endgroup}
-%
-% \def\complexorsimple#1%
-% {\setnameofcommand{#1}%
-% \doifnextcharelse{[}
-% {\firstargumenttrue \getvalue{\s!complex\nameofcommand}}
-% {\firstargumentfalse\getvalue{\s!simple \nameofcommand}}}
-%
-% \def\complexorsimpleempty#1%
-% {\setnameofcommand{#1}%
-% \doifnextcharelse{[}
-% {\firstargumenttrue \getvalue{\s!complex\nameofcommand}}
-% {\firstargumentfalse\getvalue{\s!complex\nameofcommand}[]}}
-%
-% a newer one:
-
-\def\complexorsimple#1%
- {% \relax % prevents lookahead, brrr
- \doifnextoptionalelse
- {\firstargumenttrue \csname\s!complex\strippedcsname#1\endcsname}
- {\firstargumentfalse\csname\s!simple \strippedcsname#1\endcsname}}
-
-\def\complexorsimpleempty#1%
- {% \relax % prevents lookahead, brrr
- \doifnextoptionalelse
- {\firstargumenttrue \csname\s!complex\strippedcsname#1\endcsname}
- {\firstargumentfalse\csname\s!complex\strippedcsname#1\endcsname[]}}
-
-%D \macros
-%D {definecomplexorsimple,definecomplexorsimpleempty}
-%D
-%D The previous commands are used that often that we found it
-%D worthwile to offer two more alternatives. Watch the build
-%D in protection.
-
-% See earlier. Because we don't want \type {\simple..} and
-% \type {\complex..} commands to show up in expansions, we need
-% to pass them as \type {simple..} and \type {complex..}.
-
-% \beginTEX
-%
-% \def\definewithnameofcommand#1#2%
-% {\setnameofcommand{#2}%
-% \@EA\def\@EA#2\@EA{\@EA\donottest\@EA#1\@EA{\nameofcommand}}}
-%
-% \def\definecomplexorsimple%
-% {\definewithnameofcommand\complexorsimple}
-%
-% \def\definecomplexorsimpleempty%
-% {\definewithnameofcommand\complexorsimpleempty}
-%
-% \endTEX
-%
-% \beginETEX \protected
-%
-% \def\definecomplexorsimple#1%
-% {\normalprotected\def#1{\complexorsimple#1}}
-%
-% \def\definecomplexorsimpleempty#1%
-% {\normalprotected\def#1{\complexorsimpleempty#1}}
-%
-% \endETEX
-
-% However, since this one uses an idirect method, things go
-% okay (at the cost of extra macros).
-
-% \def\definecomplexorsimple#1%
-% {\unexpanded\def#1{\complexorsimple#1}}
-%
-% \def\definecomplexorsimpleempty#1%
-% {\unexpanded\def#1{\complexorsimpleempty#1}}
-%
-% faster, since no \strippedcsname needed in call, but more spacy
-
-\def\docomplexorsimple#1#2%
- {\doifnextoptionalelse{\firstargumenttrue#1}{\firstargumentfalse#2}}
-
-\def\docomplexorsimpleempty#1%
- {\doifnextoptionalelse{\firstargumenttrue#1}{\firstargumentfalse#1[]}}
-
-\def\definecomplexorsimple#1%
- {\unexpanded\edef#1%
- {\noexpand\docomplexorsimple
- \@EA\noexpand\csname\s!complex\strippedcsname#1\endcsname
- \@EA\noexpand\csname\s!simple \strippedcsname#1\endcsname}}
-
-\def\definecomplexorsimpleempty#1%
- {\unexpanded\edef#1%
- {\noexpand\docomplexorsimpleempty
- \@EA\noexpand\csname\s!complex\strippedcsname#1\endcsname}}
-
-%D These commands are called as:
-%D
-%D \starttyping
-%D \definecomplexorsimple\command
-%D \stoptyping
-%D
-%D Of course, we must have available
-%D
-%D \starttyping
-%D \def\complexcommand[#1]{...}
-%D \def\simplecommand {...}
-%D \stoptyping
-%D
-%D Using this construction saves a few string now and then.
-
-%D \macros
-%D {definestartstopcommand}
-%D
-%D Those who get the creeps of expansion may skip the next
-%D one. It's one of the most recent additions and concerns
-%D \type{\start}||\type{\stop} pairs with complicated
-%D arguments.
-%D
-%D We won't go into details here, but the general form of
-%D this using this command is:
-%D
-%D \starttyping
-%D \definestartstopcommand\somecommand\e!specifier{arg}{arg}%
-%D {do something with arg}
-%D \stoptyping
-%D
-%D This expands to something like:
-%D
-%D \starttyping
-%D \def\somecommand arg \startspecifier arg \stopspecifier%
-%D {do something with arg}
-%D \stoptyping
-%D
-%D The arguments can be anything reasonable, but double
-%D \type{#}'s are needed in the specification part, like:
-%D
-%D \starttyping
-%D \definestartstopcommand\somecommand\e!specifier{[##1][##2]}{##3}%
-%D {do #1 something #2 with #3 arg}
-%D \stoptyping
-%D
-%D which becomes:
-%D
-%D \starttyping
-%D \def\somecommand[#1][#2]\startspecifier#3\stopspecifier%
-%D {do #1 something #2 with #3 arg}
-%D \stoptyping
-%D
-%D We will see some real applications of this command in the
-%D core modules.
-
-\def\definestartstopcommand#1#2#3#4% can be done with \expanded ot better, toks
- {\def\!stringa{#3}% % but let's keep this unused one crappy
- \def\!stringb{\e!start#2}%
- \def\!stringc{#4}%
- \def\!stringd{\e!stop#2}%
- \@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA
- \def\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA\@EA
- #1\@EA\@EA\@EA\@EA\@EA\@EA\@EA
- \!stringa\@EA\@EA\@EA
- \csname\@EA\@EA\@EA\!stringb\@EA\@EA\@EA\endcsname\@EA
- \!stringc
- \csname\!stringd\endcsname}
-
-%D \macros
-%D {dosinglegroupempty,dodoublegroupempty,dotriplegroupempty,
-%D doquadruplegroupempty, doquintuplegroupempty}
-%D
-%D We've already seen some commands that take care of
-%D optional arguments between \type{[]}. The next two commands
-%D handle the ones with \type{{}}. They are called as:
-%D
-%D \starttyping
-%D \dosinglegroupempty \ineedONEargument
-%D \dodoublegroupempty \ineedTWOarguments
-%D \dotriplegroupempty \ineedTHREEarguments
-%D \doquadruplegroupempty \ineedFOURarguments
-%D \doquintuplegroupempty \ineedFIVEarguments
-%D \stoptyping
-%D
-%D where \type{\ineedONEargument} takes one and the others
-%D two and three arguments. These macro's were first needed in
-%D \PPCHTEX.
-%D
-%D \starttyping
-%D \def\dogetgroupargument#1#2% redefined in mult-ini
-%D {\def\nextnextargument%
-%D {\ifx\nextargument\bgroup
-%D \let\expectedarguments\noexpectedarguments
-%D \def\nextargument{#1\dodogetargument}%
-%D %\else\ifx\nextargument\lineending % this can be an option
-%D % \def\nextargument{\begingroup\def\\ {\endgroup\dogetgroupargument#1#2}\\}%
-%D %\else\ifx\nextargument\blankspace % but it may never be default
-%D % \def\nextargument{\begingroup\def\\ {\endgroup\dogetgroupargument#1#2}\\}%
-%D \else
-%D \ifnum\expectedarguments>\noexpectedarguments
-%D \writestatus
-%D {setup}
-%D {\the\expectedarguments\space argument(s) expected
-%D in line \the\inputlineno\space}%
-%D \fi
-%D \let\expectedarguments\noexpectedarguments
-%D \def\nextargument{#2\dodogetargument{}}%
-%D \fi%\fi\fi % so let's get rid of it
-%D \nextargument}%
-%D \futurelet\nextargument\nextnextargument}
-%D \stoptyping
-%D
-%D In order to catch \type {\nextargument}'s that expand to
-%D \type {\if} and friends, in practice we will use a
-%D slightly more complicated macro.
-
-\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
- \the\everyrobusttest}
-
-\let\endrobusttest\endgroup
-
-%D We can add additional definitions later when we have defined
-%D \type {\appendtoks}.
-
-\def \permitspacesbetweengroups{\chardef\@@permitspacesbetweengroups=0 }
-\def\dontpermitspacesbetweengroups{\chardef\@@permitspacesbetweengroups=1 }
-
-\dontpermitspacesbetweengroups
-
-% \def\dogetgroupargument#1#2%
-% {\def\nextnextargument%
-% {\normalifx\nextargument\bgroup
-% \endrobusttest
-% \noshowargumenterror
-% \def\nextargument{#1\dodogetargument}%
-% \normalelse
-% \normalifcase\@@permitspacesbetweengroups
-% \normalifx\nextargument\lineending
-% \endrobusttest
-% \def\nextargument{\begingroup\def\\ {\endgroup\dogetgroupargument#1#2}\\}%
-% \normalelse\normalifx\nextargument\blankspace
-% \endrobusttest
-% \def\nextargument{\begingroup\def\\ {\endgroup\dogetgroupargument#1#2}\\}%
-% \normalelse
-% \endrobusttest
-% \doshowargumenterror
-% \def\nextargument{#2\dodogetargument{}}%
-% \normalfi\normalfi
-% \normalelse
-% \endrobusttest
-% \doshowargumenterror
-% \def\nextargument{#2\dodogetargument{}}%
-% \normalfi
-% \normalfi
-% \nextargument}%
-% \beginrobusttest
-% \futurelet\nextargument\nextnextargument}
-
-\def\dodogetgroupargument
- {\normalifx\nextargument\bgroup
- \endrobusttest
- \noshowargumenterror
- \def\nextargument{\dogroupargumentyes\dodogetargument}%
- \normalelse
- \normalifcase\@@permitspacesbetweengroups
- \normalifx\nextargument\lineending
- \endrobusttest
- \def\nextargument{\begingroup\def\\ {\endgroup\dogetgroupargument\dogroupargumentyes\dogroupargumentnop}\\}%
- \normalelse\normalifx\nextargument\blankspace
- \endrobusttest
- \def\nextargument{\begingroup\def\\ {\endgroup\dogetgroupargument\dogroupargumentyes\dogroupargumentnop}\\}%
- \normalelse
- \endrobusttest
- \doshowargumenterror
- \def\nextargument{\dogroupargumentnop\dodogetargument{}}%
- \normalfi\normalfi
- \normalelse
- \endrobusttest
- \doshowargumenterror
- \def\nextargument{\dogroupargumentnop\dodogetargument{}}%
- \normalfi
- \normalfi
- \nextargument}%
-
-\def\dogetgroupargument#1#2%
- {\let\dogroupargumentyes#1%
- \let\dogroupargumentnop#2%
- \beginrobusttest\futurelet\nextargument\dodogetgroupargument}
-
-\def\dosinglegroupempty#1%
- {\def\dodogetargument%
- {\dontpermitspacesbetweengroups
- #1}%
- \dogetgroupargument\firstargumenttrue\firstargumentfalse}
-
-\def\dodoublegroupempty#1%
- {\def\dodogetargument##1%
- {\def\dodogetargument%
- {\dontpermitspacesbetweengroups
- #1{##1}}%
- \dogetgroupargument\secondargumenttrue\secondargumentfalse}%
- \dogetgroupargument\firstargumenttrue\firstargumentfalse}
-
-\def\dotriplegroupempty#1%
- {\def\dodogetargument##1%
- {\def\dodogetargument####1%
- {\def\dodogetargument%
- {\dontpermitspacesbetweengroups
- #1{##1}{####1}}%
- \dogetgroupargument\thirdargumenttrue\thirdargumentfalse}%
- \dogetgroupargument\secondargumenttrue\secondargumentfalse}%
- \dogetgroupargument\firstargumenttrue\firstargumentfalse}
-
-\def\doquadruplegroupempty#1%
- {\def\dodogetargument##1%
- {\def\dodogetargument####1%
- {\def\dodogetargument########1%
- {\def\dodogetargument%
- {\dontpermitspacesbetweengroups
- #1{##1}{####1}{########1}}%
- \dogetgroupargument\fourthargumenttrue\fourthargumentfalse}%
- \dogetgroupargument\thirdargumenttrue\thirdargumentfalse}%
- \dogetgroupargument\secondargumenttrue\secondargumentfalse}%
- \dogetgroupargument\firstargumenttrue\firstargumentfalse}
-
-\def\doquintuplegroupempty#1%
- {\def\dodogetargument##1%
- {\def\dodogetargument####1%
- {\def\dodogetargument########1%
- {\def\dodogetargument################1%
- {\def\dodogetargument%
- {\dontpermitspacesbetweengroups
- #1{##1}{####1}{########1}{################1}}%
- \dogetgroupargument\fifthargumenttrue\fifthargumentfalse}%
- \dogetgroupargument\fourthargumenttrue\fourthargumentfalse}%
- \dogetgroupargument\thirdargumenttrue\thirdargumentfalse}%
- \dogetgroupargument\secondargumenttrue\secondargumentfalse}%
- \dogetgroupargument\firstargumenttrue\firstargumentfalse}
-
-%D These macros can explictly take care of spaces, which means
-%D that the next definition and calls are valid:
-%D
-%D \starttyping
-%D \def\test#1#2#3{[#1#2#3]}
-%D
-%D \dotriplegroupempty\test {a}{b}{c}
-%D \dotriplegroupempty\test {a}{b}
-%D \dotriplegroupempty\test {a}
-%D \dotriplegroupempty\test
-%D \dotriplegroupempty\test {a} {b} {c}
-%D \dotriplegroupempty\test {a} {b}
-%D \dotriplegroupempty\test
-%D {a}
-%D {b}
-%D \stoptyping
-%D
-%D And alike.
-
-%D \macros
-%D {firstofoneargument, firstoftwoarguments, firstofthreearguments
-%D secondoftwoarguments, secondofthreearguments,
-%D thirdofthreearguments}
-%D
-%D The next six macros (dedicated to Taco) can conveniently
-%D used to select arguments. Their names explain their
-%D functionality.
-
-\long\def\firstofoneargument#1{#1}
-
-\long\def\firstoftwoarguments #1#2{#1}
-\long\def\secondoftwoarguments#1#2{#2}
-
-\long\def\firstofthreearguments #1#2#3{#1}
-\long\def\secondofthreearguments#1#2#3{#2}
-\long\def\thirdofthreearguments #1#2#3{#3}
-
-\long\def\firstoffourarguments #1#2#3#4{#1}
-\long\def\secondoffourarguments#1#2#3#4{#2}
-\long\def\thirdoffourarguments #1#2#3#4{#3}
-\long\def\fourthoffourarguments#1#2#3#4{#4}
-
-\long\def\firstoffivearguments #1#2#3#4#5{#1}
-\long\def\secondoffivearguments#1#2#3#4#5{#2}
-\long\def\thirdoffivearguments #1#2#3#4#5{#3}
-\long\def\fourthoffivearguments#1#2#3#4#5{#4}
-\long\def\fifthoffivearguments #1#2#3#4#5{#5}
-
-\long\def\firstofsixarguments #1#2#3#4#5#6{#1}
-\long\def\secondofsixarguments#1#2#3#4#5#6{#2}
-\long\def\thirdofsixarguments #1#2#3#4#5#6{#3}
-\long\def\fourthofsixarguments#1#2#3#4#5#6{#4}
-\long\def\fifthofsixarguments #1#2#3#4#5#6{#5}
-\long\def\sixthofsixarguments #1#2#3#4#5#6{#6}
-
-%D \macros
-%D {globalletempty,letempty,letvalueempty,letgvalueempty}
-%D
-%D Trivial:
-
-\def\letempty #1{\let#1\empty}
-\def\globalletempty#1{\global\let#1\empty}
-
-\def\letvalueempty #1{\expandafter\let\csname#1\endcsname\empty}
-\def\letgvalueempty#1{\global\expandafter\let\csname#1\endcsname\empty}
-
-%D \macros
-%D {wait}
-%D
-%D The next macro hardly needs explanation. Because no
-%D nesting is to be expected, we can reuse \type{\wait} within
-%D \type{\wait} itself.
-
-\def\wait
- {\begingroup
- \read16 to \wait
- \endgroup}
-
-%D \macros
-%D {writestring,writeline,writebanner,
-%D writestatus,statuswidth,normalwritestatus}
-%D
-%D Maybe one didn't notice, but we've already introduced a
-%D macro for showing messages. In the multi||lingual modules,
-%D we will also introduce a mechanism for message passing. For
-%D the moment we stick to the core macros:
-%D
-%D \starttyping
-%D \writestring {string}
-%D \writeline
-%D \writestatus {category} {message}
-%D \stoptyping
-%D
-%D Messages are formatted. One can provide the maximum with
-%D of the identification string with the macro \type
-%D {\statuswidth}.
-
-\chardef\statuswidth=15
-\chardef\statuswrite=16
-
-\ifx\writestring\undefined
-
- \newtoks\everywritestring
-
- \def\writedirect {\immediate\write\statuswrite}
- \def\writeline {\writedirect{}}
- \def\writestring#1{\begingroup\the\everywritestring\writedirect{#1}\endgroup}
-
-\fi
-
-%D First we present the normal \TEX\ variant, later we will
-%D show the \ETEX-way.
-
-
-\beginTEX
-
- \newcount\statuscounter
-
- \def\dosplitstatus#1%
- {\advance\statuscounter \minusone
- \ifcase\statuscounter
- \expandafter\nosplitstatus
- \else
- \scratchtoks\@EA{\the\scratchtoks#1}%
- \expandafter\dosplitstatus
- \fi}
-
- \def\nosplitstatus#1\end
- {}
-
- \def\writestatus#1#2%
- {\begingroup
- \scratchtoks\emptytoks
- \statuscounter\statuswidth
- \expandafter\dosplitstatus#1%
- \space\space\space\space\space\space\space
- \space\space\space\space\space\space\space
- \space\space\space\space\space\space\end
- \@EA\writestring\@EA{\the\scratchtoks\space:\space#2}%
- \endgroup}
-
-\endTEX
-
-%D Because we're grouped, we could have initialized at forehand:
-%D
-%D \starttyping
-%D \statuscounter\statuswidth
-%D \stoptyping
-%D
-%D The next implementation saves only some 10 words of format
-%D memory, but we hardly gain any speed.
-%D
-%D \starttyping
-%D \def\dosplitstatus#1#2#3#4#5#6#7#8#9%
-%D {#1#2#3#4#5#6#7#8#9\dodosplitstatus}
-%D
-%D \def\dodosplitstatus#1#2#3#4#5#6\end
-%D {#1#2#3#4#5}
-%D
-%D \def\writestatus#1#2%
-%D {\writestring
-%D {\expandafter\dosplitstatus#1%
-%D \space\space\space\space\space
-%D \space\space\space\space\space
-%D \space\space\space\space\space\end
-%D \space:\space#2}}
-%D \stoptyping
-
-%D Okay then, more obscure but slightly faster: no split grabs
-%D the do split part and skipping the else branch has to happen
-%D anyway, so:
-
-\beginTEX
-
- \def\dosplitstatus#1%
- {\advance\statuscounter \minusone
- \ifcase\statuscounter
- \expandafter\nosplitstatus
- \fi
- \scratchtoks\@EA{\the\scratchtoks#1}%
- \dosplitstatus}
-
-\endTEX
-
-%D The next (\ETEX\ specific) variant is twice as fast in 5/40
-%D situations, only gains some speed when multiple runs of large docs
-%D are done; fully expandable, no statuscounter needed, no restore (due
-%D to grouping) needed etc.
-
-\beginETEX \numexpr
-
- \def\normalwritestatus#1#2%
- {\writestring{\expandafter\dosplitstatus\expandafter\statuswidth#1%
- \space\space\space\space\space\space\space
- \space\space\space\space\space\space\space
- \space\space\space\space\space\space\end
- \space:\space#2}}
-
- \def\dosplitstatus#1#2%
- {\ifcase#1 \expandafter\nosplitstatus\fi#2%
- \expandafter\dosplitstatus\expandafter{\the\numexpr#1+\minusone\relax}}
-
- \def\nosplitstatus#1\end
- {}
-
-\endETEX
-
-%D \macros
-%D {emptytoks}
-%D
-%D For this we need an empty token register, analogous
-%D to \type {\empty}.
-
-\newtoks\emptytoks
-
-%D \macros
-%D {debuggerinfo}
-%D
-%D For debugging purposes we can enhance macros with the
-%D next alternative. Here \type{debuggerinfo} stands for both
-%D a macro accepting two arguments and a boolean (in fact a
-%D few macro's too).
-
-\newif\ifdebuggerinfo
-
-\def\debuggerinfo#1#2%
- {\ifdebuggerinfo
- \writestatus{debugger}{#1:: #2}%
- \fi}
-
-%D Finally we do what from now on will be done at the top of
-%D the files: we tell the user what we are loading.
-
-% \ifx\writestatus\undefined \let\writestatus\normalwritestatus \fi
-% \ifx\writebanner\undefined \def\writebanner{\writestring} \fi
-
-\ifx\normalwritestatus\undefined
- % for use within latex
- \ifx\writestatus\undefined
- \def\writestatus#1#2{\immediate\write16{#1 : #2}}
- \fi
-\else
- \let\writestatus\normalwritestatus
-\fi
-
-\def\writebanner{\writestring}
-
-\writestatus{loading}{ConTeXt System Macros / General}
-
-%D Well, the real final command is the one that resets the
-%D unprotected characters \type{@}, \type{?} and \type{!}.
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/syst-ini.mkii b/Master/texmf-dist/tex/context/base/mkii/syst-ini.mkii
deleted file mode 100644
index f3c357941bb..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/syst-ini.mkii
+++ /dev/null
@@ -1,1067 +0,0 @@
-%D \module
-%D [ file=syst-ini,
-%D version=2008.11.04, % 2001.11.16, % 1999.03.17, % an oldie: 1995.10.10
-%D title=\CONTEXT\ System Macros,
-%D subtitle=Bootstrapping \TEX,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 We used to load plain \TEX\ in a special way, but redefining
-%D a couple of primitives so that for instance font loading was
-%D ignored. For those interested, this loader is found in
-%D \type {syst-tex.tex}. Some of the comment's are Don Knuth's
-%D and more of it can be found in the plain \TEX\ format.
-
-%D Characters can have special states, that can be triggered
-%D by setting their category coded. Some are preset, others
-%D are to be set as soon as possible, otherwise we cannot
-%D define any useful macros.
-
-%catcode`\^^@ = 9 % ascii null is ignored
-%catcode`\\ = 0 % backslash is TeX escape character
-
-\catcode`\{ = 1 % left brace is begin-group character
-\catcode`\} = 2 % right brace is end-group character
-\catcode`\$ = 3 % dollar sign is math shift
-\catcode`\& = 4 % ampersand is alignment tab
-\catcode`\# = 6 % hash mark is macro parameter character
-\catcode`\^ = 7 % circumflex and uparrow are for superscripts
-\catcode`\_ = 8 % underline and downarrow are for subscripts
-\catcode`\^^I = 10 % ascii tab is a blank space
-
-%catcode`\^^M = 5 % ascii return is end-line
-%catcode`\% = 14 % percent sign is comment character
-%catcode`\ = 10 % ascii space is blank space
-%catcode`\^^? = 15 % ascii delete is invalid
-
-\catcode`\~ = 13 % tilde is active
-\catcode`\^^L = 13 % ascii form-feed
-
-%catcode`\A = 11
-%.......
-%catcode`\Z = 11
-
-%catcode`\a = 11
-%.......
-%catcode`\z = 11
-
-\chardef\activecatcode = 13 % later this will become a counter
-
-\def ^^L{\par}
-\def\^^M{\ } % control <return> = control <space>
-\def\^^I{\ } % same for <tab>
-
-%D In \CONTEXT, we simply ignore end||of||file tokens:
-
-\catcode`\^^Z=9
-
-%D It makes sense to know what engine we're running so let's
-%D try to deduce it.
-
-\chardef\unknownengine = 0
-\chardef\pdftexengine = 1
-\chardef\xetexengine = 2
-\chardef\luatexengine = 3
-
-\ifx\directlua\undefined
- \ifx\XeTeXversion\undefined
- \ifx\pdftexversion\undefined
- \let\texengine\unknownengine
- \else
- \let\texengine\pdftexengine
- \fi
- \else
- \let\texengine\xetexengine
- \fi
-\else
- \let\texengine\luatexengine
-\fi
-
-\ifnum\texengine=\unknownengine
- \immediate\write16{>>>}
- \immediate\write16{>>> only pdftex, xetex and luatex are supported}
- \immediate\write16{>>>}
- \let\dump\relax
- \expandafter\end
-\fi
-
-\ifnum\texengine=\luatexengine
- \directlua 0 { % this info is stored in the format
- % kpse.set_program_name("context")
- lua.name[0] = "main ctx instance"
- local extraprimitives = tex.extraprimitives
- local enableprimitives = tex.enableprimitives
- local core = extraprimitives('core')
- local btex = extraprimitives('tex')
- local etex = extraprimitives('etex')
- local pdftex = extraprimitives('pdftex')
- local luatex = extraprimitives('luatex')
- local omega = {
- "textdir", "pagedir", "mathdir", "pardir", "bodydir",
- "leftghost", "rightghost", "localleftbox", "localrightbox",
- "localinterlinepenalty", "localbrokenpenalty",
- }
- local aleph = {
- "boxdir", "pagebottomoffset", "pagerightoffset",
- }
- for _, subset in next, { etex, pdftex, luatex, omega, aleph } do
- enableprimitives('',subset)
- end
- for _, subset in next, { core, btex, etex, pdftex, luatex, omega, aleph } do
- enableprimitives('normal',subset)
- end
- }
-\fi
-
-\ifdefined\pdfextension
-
- % promoted
-
- \let\pdfpagewidth \pagewidth
- \let\pdfpageheight \pageheight
-
- \let\pdfadjustspacing \adjustspacing
- \let\pdfprotrudechars \protrudechars
- \let\pdfnoligatures \ignoreligaturesinfont
- \let\pdffontexpand \expandglyphsinfont
- \let\pdfcopyfont \copyfont
-
- \let\pdfxform \saveboxresource
- \let\pdflastxform \lastsavedboxresourceindex
- \let\pdfrefxform \useboxresource
-
- \let\pdfximage \saveimageresource
- \let\pdflastximage \lastsavedimageresourceindex
- \let\pdflastximagepages\lastsavedimageresourcepages
- \let\pdfrefximage \useimageresource
-
- \let\pdfsavepos \savepos
- \let\pdflastxpos \lastxpos
- \let\pdflastypos \lastypos
-
- % \let\pdftexversion \luatexversion
- % \let\pdftexrevision \luatexrevision
- \let\pdftexbanner \luatexbanner
-
- \let\pdfoutput \outputmode
- \let\pdfdraftmode \draftmode
-
- \let\pdfpxdimen \pxdimen
-
- \let\pdfinsertht \insertht
-
- % also promoted
-
- % \let\pdfnormaldeviate \normaldeviate
- % \let\pdfuniformdeviate \uniformdeviate
- % \let\pdfsetrandomseed \setrandomseed
- % \let\pdfrandomseed \randomseed
- %
- % \let\pdfprimitive \primitive
- %
- % \let\expandafter\csname ifpdfabsnum\expandafter\endcsname\csname ifabsnum\endcsname
- % \let\expandafter\csname ifpdfabsdim\expandafter\endcsname\csname ifabsdim\endcsname
- % \let\expandafter\csname ifpdfprimitive\expandafter\endcsname\csname ifprimitive\endcsname
-
- % removed (also some others but already long ago)
-
- \newdimen\pdfeachlineheight
- \newdimen\pdfeachlinedepth
- \newdimen\pdflastlinedepth
- \newdimen\pdffirstlineheight
- \newdimen\pdfignoreddimen
-
- % grouped
-
- \protected\def\pdfliteral {\pdfextension literal}
- \protected\def\pdfcolorstack {\pdfextension colorstack}
- \protected\def\pdfsetmatrix {\pdfextension setmatrix}
- \protected\def\pdfsave {\pdfextension save\relax}
- \protected\def\pdfrestore {\pdfextension restore\relax}
- \protected\def\pdfobj {\pdfextension obj }
- \protected\def\pdfrefobj {\pdfextension refobj }
- \protected\def\pdfannot {\pdfextension annot }
- \protected\def\pdfstartlink {\pdfextension startlink }
- \protected\def\pdfendlink {\pdfextension endlink\relax}
- \protected\def\pdfoutline {\pdfextension outline }
- \protected\def\pdfdest {\pdfextension dest }
- \protected\def\pdfthread {\pdfextension thread }
- \protected\def\pdfstartthread {\pdfextension startthread }
- \protected\def\pdfendthread {\pdfextension endthread\relax}
- \protected\def\pdfinfo {\pdfextension info }
- \protected\def\pdfcatalog {\pdfextension catalog }
- \protected\def\pdfnames {\pdfextension names }
- \protected\def\pdfincludechars {\pdfextension includechars }
- \protected\def\pdffontattr {\pdfextension fontattr }
- \protected\def\pdfmapfile {\pdfextension mapfile }
- \protected\def\pdfmapline {\pdfextension mapline }
- \protected\def\pdftrailer {\pdfextension trailer }
- \protected\def\pdfglyphtounicode {\pdfextension glyphtounicode }
-
- % grouped
-
- \def\pdftexversion {\numexpr\pdffeedback version}
- \def\pdftexrevision {\pdffeedback revision}
- \def\pdflastlink {\numexpr\pdffeedback lastlink}
- \def\pdfretval {\numexpr\pdffeedback retval}
- \def\pdflastobj {\numexpr\pdffeedback lastobj}
- \def\pdflastannot {\numexpr\pdffeedback lastannot}
- \def\pdfxformname {\numexpr\pdffeedback xformname}
- \def\pdfcreationdate {\pdffeedback creationdate}
- \def\pdffontname {\numexpr\pdffeedback fontname}
- \def\pdffontobjnum {\numexpr\pdffeedback fontobjnum}
- \def\pdffontsize {\dimexpr\pdffeedback fontsize}
- \def\pdfpageref {\numexpr\pdffeedback pageref}
- \def\pdfcolorstackinit {\pdffeedback colorstackinit}
-
- % used when defined
-
- \edef\pdfcompresslevel {\pdfvariable compresslevel} \pdfcompresslevel 9
- \edef\pdfobjcompresslevel {\pdfvariable objcompresslevel} \pdfobjcompresslevel 1
- \edef\pdfdecimaldigits {\pdfvariable decimaldigits} \pdfdecimaldigits 3
- \edef\pdfgamma {\pdfvariable gamma} \pdfgamma 1000
- \edef\pdfimageresolution {\pdfvariable imageresolution} \pdfimageresolution 71
- \edef\pdfimageapplygamma {\pdfvariable imageapplygamma} \pdfimageapplygamma 0
- \edef\pdfimagegamma {\pdfvariable imagegamma} \pdfimagegamma 2200
- \edef\pdfimagehicolor {\pdfvariable imagehicolor} \pdfimagehicolor 1
- \edef\pdfimageaddfilename {\pdfvariable imageaddfilename} \pdfimageaddfilename 1
- \edef\pdfpkresolution {\pdfvariable pkresolution} \pdfpkresolution 72
- \edef\pdfinclusioncopyfonts {\pdfvariable inclusioncopyfonts} \pdfinclusioncopyfonts 0
- \edef\pdfinclusionerrorlevel {\pdfvariable inclusionerrorlevel} \pdfinclusionerrorlevel 0
- \edef\pdfgentounicode {\pdfvariable gentounicode} \pdfgentounicode 0
- \edef\pdfpagebox {\pdfvariable pagebox} \pdfpagebox 0
- \edef\pdfminorversion {\pdfvariable minorversion} \pdfminorversion 4
- \edef\pdfuniqueresname {\pdfvariable uniqueresname} \pdfuniqueresname 0
-
- \edef\pdfhorigin {\pdfvariable horigin} \pdfhorigin 1in
- \edef\pdfvorigin {\pdfvariable vorigin} \pdfvorigin 1in
- \edef\pdflinkmargin {\pdfvariable linkmargin} \pdflinkmargin 0pt
- \edef\pdfdestmargin {\pdfvariable destmargin} \pdfdestmargin 0pt
- \edef\pdfthreadmargin {\pdfvariable threadmargin} \pdfthreadmargin 0pt
-
- \edef\pdfpagesattr {\pdfvariable pagesattr}
- \edef\pdfpageattr {\pdfvariable pageattr}
- \edef\pdfpageresources {\pdfvariable pageresources}
- \edef\pdfxformattr {\pdfvariable xformattr}
- \edef\pdfxformresources {\pdfvariable xformresources}
- \edef\pdfpkmode {\pdfvariable pkmode}
-
-\fi
-
-%D \ETEX\ has a not so handy way of telling you the version number,
-%D i.e. the revision number has a period in it:
-
-\long\def\gobbleoneargument#1{} % will be defined later on anyway
-
-\mathchardef\etexversion =
- \numexpr\eTeXversion*100+\expandafter\gobbleoneargument\eTeXrevision\relax
-
-%D First we define a simplified version of the \CONTEXT\
-%D protection mechanism.
-
-\def\unprotect{\catcode`@=11 }
-\def\protect {\catcode`@=12 }
-
-\unprotect
-
-%D Some pretty important definitions:
-
-\let\bgroup={
-\let\egroup=}
-
-%D Allocation of registers is done slightly different than in plain
-%D \TEX. First of all we use different reserved counters. We also
-%D don't implement a family handler because users are not supposed
-%D to implement their own math. We reserve the lowest 31 registers
-%D for scratch purposes. Keep in mind that in the core engine
-%D some registers are reserved: counters 0 upto 9, and counter 255.
-%D
-%D As with plain \TEX\ we recommend that macro designers always use
-%D \type {\global} assignments with respect to registers numbered 1,
-%D 3, 5 \unknown\ 31, and always non||\type {\global} assignments
-%D with respect to registers 0, 2, 4, \unknown\ 30. This will prevent
-%D \quote {save stack buildup} that might otherwise occur.
-%D
-%D We reserve some registers for special (management) purposes:
-
-% 0 - 20 : scratch
-% 21 - 127 : internal
-% 128 - 254 : inserts
-% 255 : page
-% 256 - : user
-
-\countdef \minallocatedregister = 52 \minallocatedregister = 256
-\countdef \maxallocatedregister = 53 \maxallocatedregister = 32767
-\countdef \minallocatediochannel = 54 \minallocatediochannel = -1
-\countdef \maxallocatediochannel = 55 \maxallocatediochannel = 16
-\countdef \minallocatedlanguage = 56 \minallocatedlanguage = 0
-\countdef \maxallocatedlanguage = 57 \maxallocatedlanguage = 255
-\countdef \maxallocatedinsert = 58 \maxallocatedinsert = 254
-\countdef \minallocatedinsert = 59 \minallocatedinsert = 128
-\countdef \minallocatedfamily = 60 \minallocatedfamily = 128
-\countdef \maxallocatedfamily = 61 \maxallocatedfamily = 255
-
-\countdef \lastallocatedcount = 32 \lastallocatedcount = \minallocatedregister
-\countdef \lastallocateddimen = 33 \lastallocateddimen = \minallocatedregister
-\countdef \lastallocatedskip = 34 \lastallocatedskip = \minallocatedregister
-\countdef \lastallocatedmuskip = 35 \lastallocatedmuskip = \minallocatedregister
-\countdef \lastallocatedbox = 36 \lastallocatedbox = \minallocatedregister
-\countdef \lastallocatedtoks = 37 \lastallocatedtoks = \minallocatedregister
-\countdef \lastallocatedread = 38 \lastallocatedread = \minallocatediochannel
-\countdef \lastallocatedwrite = 39 \lastallocatedwrite = \minallocatediochannel
-\countdef \lastallocatedmarks = 40 \lastallocatedmarks = \minallocatedregister
-\countdef \lastallocatedlanguage = 41 \lastallocatedlanguage = \minallocatedlanguage % not used in context
-\countdef \lastallocatedinsertion = 42 \lastallocatedinsertion = \minallocatedinsert
-\countdef \lastallocatedfamily = 43 \lastallocatedfamily = \minallocatedfamily % not used in context
-\countdef \lastallocatedattribute = 44 \lastallocatedattribute = \minallocatedregister
-
-\countdef \mincountervalue = 125 \mincountervalue = -"7FFFFFFF % beware, we use index 125 at the lua end
-\countdef \maxcountervalue = 126 \maxcountervalue = "7FFFFFFF % beware, we use index 126 at the lua end
-
-%countdef \minusone = 127 \minusone = -1
-%chardef \zerocount = 0
-%chardef \plusone = 1
-
-\countdef \zerocount = 120 \zerocount = 0
-\countdef \plusone = 121 \plusone = 1
-\countdef \minusone = 122 \minusone = -1
-
-%chardef \normalpagebox = 255
-\countdef \normalpagebox = 127 \normalpagebox = 255 % hardcoded in pdftex/xetex
-
-% A few traditional allocations:
-
-\countdef \count@ = 255 % hm, used in \newif .. todo: replace it there
-\dimendef \dimen@ = 0
-\dimendef \dimen@i = 1 % global only
-\dimendef \dimen@ii = 2
-
-%D So, effectively we start allocating from 256 and upwards. The
-%D inserts sit in the range 128 upto 254. Page numbers use the
-%D counters 0 upto 9 and the pagebox is 255. Users can use the
-%D scratch registers upto 31 without problem but all others are
-%D reserved.
-
-\def\wlog#1{} % \def\wlog{\immediate\write\minusone} % write on log file (only)
-
-%D The allocators share a common helper macro.
-
-\def\newcount {\allocateregister\lastallocatedcount \count \countdef \maxallocatedregister}
-\def\newdimen {\allocateregister\lastallocateddimen \dimen \dimendef \maxallocatedregister}
-\def\newskip {\allocateregister\lastallocatedskip \skip \skipdef \maxallocatedregister}
-\def\newmuskip {\allocateregister\lastallocatedmuskip \muskip \muskipdef \maxallocatedregister}
-\def\newbox {\allocateregister\lastallocatedbox \box \mathchardef\maxallocatedregister}
-\def\newtoks {\allocateregister\lastallocatedtoks \toks \toksdef \maxallocatedregister}
-\def\newread {\allocateregister\lastallocatedread \read \chardef \maxallocatediochannel}
-\def\newwrite {\allocateregister\lastallocatedwrite \write \chardef \maxallocatediochannel}
-\def\newmarks {\allocateregister\lastallocatedmarks \marks \mathchardef\maxallocatedregister}
-\def\newinsert {\allocateregister\lastallocatedinsertion\insert \chardef \maxallocatedinsert}
-
-%D We don't need these in \CONTEXT:
-
-\def\newlanguage{\allocateregister\lastallocatedlanguage \language\chardef \maxallocatedlanguage}
-\def\newfamily {\allocateregister\lastallocatedfamily \fam \chardef \maxallocatedfamily}
-
-\let\newfam\newfamily
-
-% Watch out, for the moment we disable the check for already being defined
-% later we will revert this but first all chardefs must be replaced.
-
-\def\newconstant #1{\ifdefined#1\let#1\undefined\fi\newcount#1}
-\def\setnewconstant#1{\ifdefined#1\let#1\undefined\fi\newcount#1#1} % just a number
-
-% maybe setconstant with check
-
-% %D The next definitions are really needed (in \CONTEXT):
-
-%newlinechar=10 \def\outputnewlinechar{\rawcharacter{10}}
-\newlinechar=10 \edef\outputnewlinechar{^^J}
-
-%D One reason to start high with allocation is that it permits us to
-%D allocate consecutive ranges more easily, for instance in \MPLIB\
-%D we want to allocate a continuous range of boxes. It also permits us
-%D to do a proper upward allocation for inserts. The current code
-%D evolved from code that dealt with older engines but as all engines
-%D now provide many registers we removed all traces.
-
-\def\writestatus#1#2{\immediate\write16{#1: #2}} \def\space { }
-
-\def\allocateregisteryes#1#2#3#4#5% last class method max name
- {\ifnum#1<#4\relax
- \global\advance#1\plusone
- \global#3#5=#1\relax
- \else
- \writestatus{warning}{no room for \string#2\space \string#5\space (max: \number#4)}%
- \fi}
-
-\def\allocateregisternop#1#2#3#4#5% last class method max name
- {\writestatus{warning}{\string#2 \string#5 is already defined (\string\relax\space it first)}}
-
-\def\allocateregister#1#2#3#4#5% last class method max name
- {\ifx#5\undefined
- \expandafter\allocateregisteryes
- \else\ifx#5\relax
- \expandafter\expandafter\expandafter\allocateregisteryes
- \else
- \expandafter\expandafter\expandafter\allocateregisternop
- \fi\fi
- #1#2#3#4#5}
-
-%D Goodie:
-
-\ifnum\texengine=\luatexengine
- \input luatex-pdf \relax
-\fi
-
-%D Since the number of chars exceed 256 now, we can use \type
-%D {\chardef} instead of the more limited \type {\mathchardef}.
-
-\ifnum\texengine>\pdftexengine
- \def\newbox {\allocateregister\lastallocatedbox \box \chardef\maxallocatedregister}
- \def\newmarks{\allocateregister\lastallocatedmarks\marks\chardef\maxallocatedregister}
-\fi
-
-%D Attributes are something very \LUATEX. In \CONTEXT\ you are not
-%D supposed to use the attributes directly but always allocate then
-%D first. For instance attribute~0 is reserved for special purposes
-%D (this might change).
-
-\ifnum\texengine=\luatexengine
- \let\attributeunsetvalue\mincountervalue % used to be \minusone
- \def\newattribute{\allocateregister\lastallocatedattribute\attribute\attributedef\maxallocatedregister}
-\fi
-
-%D Not used by \CONTEXT\ but for instance \PICTEX\ needs it. It's a
-%D trick to force strings instead of tokens that take more memory.
-%D It's a trick to trick to force strings.
-
-\def\newhelp#1#2{\newtoks#1#1\expandafter{\csname#2\endcsname}}
-
-%D \macros
-%D {scratchcounter,
-%D scratchdimen,scratchskip,scratchmuskip,
-%D scratchbox,
-%D scratchtoks}
-%D
-%D We now define a few scratch registers, so that successive
-%D loads at least have some available.
-
-\newcount \scratchcounter \newcount \globalscratchcounter
-\newdimen \scratchdimen \newdimen \globalscratchdimen
-\newskip \scratchskip \newskip \globalscratchskip
-\newmuskip \scratchmuskip \newmuskip \globalscratchmuskip
-\newtoks \scratchtoks \newtoks \globalscratchtoks
-\newbox \scratchbox \newbox \globalscratchbox
-
-\newcount\scratchcounterone \newcount\scratchcountertwo \newcount\scratchcounterthree
-\newdimen \scratchdimenone \newdimen \scratchdimentwo \newdimen \scratchdimenthree
-\newdimen \scratchskipone \newdimen \scratchskiptwo \newdimen \scratchskipthree
-\newbox \scratchmuskipone \newbox \scratchmuskiptwo \newbox \scratchmuskipthree
-\newtoks \scratchtoksone \newtoks \scratchtokstwo \newtoks \scratchtoksthree
-\newbox \scratchboxone \newbox \scratchboxtwo \newbox \scratchboxthree
-
-%D More allocations:
-
-\newskip \zeroskip \zeroskip = 0pt plus 0pt minus 0pt
-\newdimen\zeropoint \zeropoint = 0pt
-\newdimen\onepoint \onepoint = 1pt
-\newdimen\maxdimen \maxdimen = 16383.99999pt
-\newdimen\onebasepoint \onebasepoint = 1bp
-\newdimen\scaledpoint \scaledpoint = 1sp
-\newdimen\thousandpoint\thousandpoint= 1000pt
-
-\let\points\onepoint
-
-\newtoks \emptytoks
-
-%D And even more: (todo: countdefs 60+)
-
-%newcount \minusone \minusone = -1
-\newcount \minustwo \minustwo = -2
-%chardef \zerocount = 0
-%chardef \plusone = 1
-\chardef \plustwo = 2
-\chardef \plusthree = 3
-\chardef \plusfour = 4
-\chardef \plusfive = 5
-\chardef \plussix = 6
-\chardef \plusseven = 7
-\chardef \pluseight = 8
-\chardef \plusnine = 9
-\chardef \plusten = 10
-\chardef \plussixteen = 16
-\chardef \plushundred = 100
-\chardef \pluscxxvii = 127
-\chardef \pluscxxviii = 128
-\chardef \pluscclv = 255
-
-\ifnum\texengine=\luatexengine
- \chardef \pluscclvi = 256
- \chardef \plusthousand = 1000
- \chardef \plustenthousand = 10000
- \chardef \plustwentythousand = 20000
- \chardef \medcard = 32768
- \chardef \maxcard = 65536 % pdftex has less mathchars
-\else
- \mathchardef\pluscclvi = 256
- \mathchardef\plusthousand = 1000
- \mathchardef\plustenthousand = 10000
- \mathchardef\plustwentythousand = 20000
- \newcount \medcard \medcard = 32768 % pdftex has less mathchars
- \newcount \maxcard \maxcard = 65536 % pdftex has less mathchars
-\fi
-
-%D We prefer the more readable variant than in plain
-%D \TEX. User should only use \type {\emptybox}:
-
-\newbox\voidbox % public
-
-\let\normalhbox\hbox
-\let\normalvbox\vbox
-
-\def\unvoidbox{\unhbox\voidbox}
-\def\emptybox {\box \voidbox} % used in initializations so no attributes
-\def\emptyvbox{\normalvbox{}} % no copy as we need to set attributes
-\def\emptyhbox{\normalhbox{}} % no copy as we need to set attributes
-
-\let\leavevmode\unvoidbox % we prefer to use \dontleavehmode
-
-%D Some expected plain variants follow. We don't reuse registers
-%D because we don't want clashes.
-
-\newdimen\p@ \p@ \onepoint
-\newcount\m@ne \m@ne \minusone
-\newdimen\z@ \z@ \zeropoint
-\let \@ne \plusone
-\let \tw@ \plustwo
-\let \thr@@ \plusthree
-\let \sixt@@n \sixteen
-\let \@cclv \pluscclv
-\let \@cclvi \pluscclvi
-\newbox \voidb@x
-\newtoks \toks@
-
-%D We define \type {\newif} a la plain \TEX, but will
-%D redefine it later. As Knuth says:
-%D
-%D \startnarrower
-%D And here's a different sort of allocation: for example,
-%D
-%D \starttyping
-%D \newif\iffoo
-%D \stoptyping
-%D
-%D creates \type {\footrue}, \type {\foofalse} to go
-%D with \type {\iffoo}.
-%D \stopnarrower
-
-\def\newif#1%
- {\count@\escapechar
- \escapechar\minusone
- \expandafter\expandafter\expandafter\def\@if #1{true}{\let#1\iftrue }%
- \expandafter\expandafter\expandafter\def\@if#1{false}{\let#1\iffalse}%
- \@if#1{false}% the condition starts out false
- \escapechar\count@}
-
-\def\@if#1#2%
- {\csname\expandafter\if@\string#1#2\endcsname}
-
-\bgroup % `if' is required
-
- \uccode`1=`i \uccode`2=`f \uppercase{\gdef\if@12{}}
-
-\egroup
-
-%D Let's test this one:
-
-\newif\ifdone
-
-%D Potential primitive in \LUATEX:
-
-\ifdefined\htdp \else \def\htdp#1{\dimexpr\ht#1+\dp#1\relax} \fi
-
-%D \macros
-%D {@@escape,@@begingroup,@@endgroup,@@mathshift,@@alignment,
-%D @@endofline,@@parameter,@@superscript,@@subscript,
-%D @@ignore,@@space,@@letter,@@other,@@active,@@comment}
-%D
-%D In \CONTEXT\ we sometimes manipulate the \CATCODES\ of certain
-%D characters. Because we are not that good at remembering numbers,
-%D we introduce some symbolic names.
-
-%D As we now have catc-* files, we also have more readable names but
-%D We will keep the following around for a while.
-
-\chardef\@@escape = 0
-\chardef\@@begingroup = 1
-\chardef\@@endgroup = 2
-\chardef\@@mathshift = 3
-\chardef\@@alignment = 4
-\chardef\@@endofline = 5
-\chardef\@@parameter = 6
-\chardef\@@superscript = 7
-\chardef\@@subscript = 8
-\chardef\@@ignore = 9
-\chardef\@@space = 10
-\chardef\@@letter = 11
-\chardef\@@other = 12
-\chardef\@@active = 13
-\chardef\@@comment = 14
-
-%D Constants to be used with \type {\currentgrouptype}.
-
-\chardef\@@bottomlevelgroup = 0
-\chardef\@@simplegroup = 1
-\chardef\@@hboxgroup = 2
-\chardef\@@adjustedhboxgroup = 3
-\chardef\@@vboxgroup = 4
-\chardef\@@vtopgroup = 5
-\chardef\@@aligngroup = 6
-\chardef\@@noaligngroup = 7
-\chardef\@@outputgroup = 8
-\chardef\@@mathgroup = 9
-\chardef\@@discretionarygroup = 10
-\chardef\@@insertgroup = 11
-\chardef\@@vcentergroup = 12
-\chardef\@@mathchoicegroup = 13
-\chardef\@@semisimplegroup = 14
-\chardef\@@mathshiftgroup = 15
-\chardef\@@mathleftgroup = 16
-
-\chardef\@@vadjustgroup = \@@insertgroup
-
-%D Constants to be used with \type {\interactionmode}.
-
-\chardef\@@batchmode = 0
-\chardef\@@nonstopmode = 1
-\chardef\@@scrollmode = 2
-\chardef\@@errorstopmode = 3
-
-%D Constants to be used with \type {\lastnodetype}. The \type
-%D {\lastnodetype} primitive is \ETEX\ compliant. The valid range is
-%D still -1 .. 15 and glyph nodes have number 0 (used to be char
-%D node) and ligature nodes are mapped to 7. That way macro packages
-%D can use the same symbolic names as in traditional \ETEX. Keep in
-%D mind that the internal node numbers are different and that there
-%D are more node types that 15.
-
-\chardef\@@charnode = 0
-\chardef\@@hlistnode = 1
-\chardef\@@vlistnode = 2
-\chardef\@@rulenode = 3
-\chardef\@@insertnode = 4
-\chardef\@@marknode = 5
-\chardef\@@adjustnode = 6
-\chardef\@@ligaturenode = 7
-\chardef\@@discretionarynode = 8
-\chardef\@@whatsitnode = 9
-\chardef\@@mathnode = 10
-\chardef\@@gluenode = 11
-\chardef\@@kernnode = 12
-\chardef\@@penaltynode = 13
-\chardef\@@unsetnode = 14
-\chardef\@@mathsnode = 15
-
-%D Constants to be used with \type {\currentiftype}.
-
-\chardef\@@charif = 1
-\chardef\@@catif = 2
-\chardef\@@numif = 3
-\chardef\@@dimif = 4
-\chardef\@@oddif = 5
-\chardef\@@vmodeif = 6
-\chardef\@@hmodeif = 7
-\chardef\@@mmodeif = 8
-\chardef\@@innerif = 9
-\chardef\@@voidif = 10
-\chardef\@@hboxif = 11
-\chardef\@@vboxif = 12
-\chardef\@@xif = 13
-\chardef\@@eofif = 14
-\chardef\@@trueif = 15
-\chardef\@@falseif = 16
-\chardef\@@caseif = 17
-\chardef\@@definedif = 18
-\chardef\@@csnameif = 19
-\chardef\@@fontcharif = 20
-
-%D Of course we want even bigger log files, so we copied this
-%D from the \ETEX\ source files.
-%D
-%D When watching such logs, beware of nasty side effects of
-%D \type {\scantokens}, as in:
-%D
-%D \starttyping
-%D \bgroup
-%D \lccode`a=12\lowercase{\xdef\whatever{a}}\egroup
-%D \def\whatever{test \whatever test}
-%D \scantokens\expandafter{\whatever}
-%D \egroup
-%D \stoptyping
-%D
-%D In \LUATEX\ we have ways around this.
-
-\def\tracingall
- {\tracingonline \plusone
- \tracingcommands \plusthree
- \tracingstats \plustwo
- \tracingpages \plusone
- \tracingoutput \plusone
- \tracinglostchars \plustwo
- \tracingmacros \plustwo
- \tracingparagraphs\plusone
- \tracingrestores \plusone
- \showboxbreadth \maxdimen
- \showboxdepth \maxdimen
- \tracinggroups \plusone
- \tracingifs \plusone
- \tracingscantokens\plusone
- \tracingnesting \plusone
- \tracingassigns \plustwo
- \errorstopmode}
-
-\def\loggingall
- {\tracingall
- \tracingonline \zerocount}
-
-\def\tracingnone
- {\tracingassigns \zerocount
- \tracingnesting \zerocount
- \tracingscantokens\zerocount
- \tracingifs \zerocount
- \tracinggroups \zerocount
- \showboxdepth \plusthree
- \showboxbreadth \plusfive
- \tracingrestores \zerocount
- \tracingparagraphs\zerocount
- \tracingmacros \zerocount
- \tracinglostchars \plusone
- \tracingoutput \zerocount
- \tracingpages \zerocount
- \tracingstats \zerocount
- \tracingcommands \zerocount
- \tracingonline \zerocount}
-
-%D Just for tracing purposes we set:
-
-\tracingstats\plusone
-
-%D Here we also save \type {\input}, more will be saved later.
-
-\ifdefined\normalinput \else \let\normalinput\input \fi
-
-%D We don't like outer commands, and we always want access
-%D to the original \type {\input} primitive.
-
-\let\normalouter\outer \def\outer{} % no longer \relax
-
-%D To circumvent dependencies, we can postpone certain
-%D initializations to dumping time, by appending them to the
-%D \type {\everydump} token register.
-
-\ifdefined\normaldump \else \let\normaldump\dump \fi
-
-\newtoks\everydump
-
-\def\dump{\the\everydump\normaldump}
-
-%D The same applies for the startup actions.
-
-\ifdefined\normaleveryjob \else \let\normaleveryjob\everyjob \fi
-
-\let\everyjob\relax \newtoks\everyjob
-
-\normaleveryjob{\the\everyjob}
-
-\def\appendtotoks #1{\def\temp{#1}\afterassignment\doappendtotoks \scratchtoks=}
-\def\prependtotoks#1{\def\temp{#1}\afterassignment\doprependtotoks\scratchtoks=}
-
-\def\doappendtotoks {\expandafter\expandafter\expandafter{\expandafter\the\expandafter\temp\the\scratchtoks}}
-\def\doprependtotoks{\expandafter\expandafter\expandafter{\expandafter\the\expandafter\scratchtoks\the\temp}}
-
-%D \macros
-%D {begcsname}
-%D
-%D Handy for \ETEX-only usage (avoids making \type {\relax}'s:
-
-\def\begcsname#1\endcsname{\ifcsname#1\endcsname\csname#1\endcsname\fi}
-
-%D Now come a few macros that might be needed in successive loading:
-
-\let\endgraf\par
-\let\endline\cr
-
-\def\space{ }
-\def\empty{}
-\def\null {\hbox{}}
-
-%D The following two might be overloaded later on but some modules need
-%D then earlier. These functionality is reflected in the name and will not
-%D change.
-
-\bgroup
- \catcode`\^^M=\activecatcode%
- \gdef\obeylines{\catcode`\^^M\activecatcode \let^^M\par}%
- \global\let^^M\par%
-\egroup
-
-\bgroup
- \gdef\obeyspaces{\catcode`\ \activecatcode}%
- \obeyspaces\global\let =\space%
-\egroup
-
-%D A constant:
-
-\let\endoflinetoken=^^M
-
-%D Also needed might be a simple loop structure and we borrow
-%D plain \TEX's one as it is often expected to be present and
-%D it is about the fastest you can get. Beware: this macro
-%D does not support nested loops. We use a namespace prefix
-%D \type {@@pln}.
-
-\long\def\loop#1\repeat{\long\def\@@plnbody{#1}\@@plniterate}
-
-%D The following makes \type {\loop} \unknown\ \type {\if}
-%D \unknown\ \type {\repeat} skippable (clever trick):
-
-\let\repeat\fi % so both \loop and \repeat are reserved words!
-
-%D The original (no \type {@@pln} there):
-%D
-%D \starttyping
-%D \def\@@plniterate{\@@plnbody\let\next\@@plniterate\else\let\next\relax\fi\next}
-%D \stoptyping
-%D
-%D A more efficient alternative:
-%D
-%D \starttyping
-%D \def\@@plniterate{\@@plnbody\expandafter\@@plniterate\else\expandafter\relax\fi}
-%D \stoptyping
-%D
-%D An even more efficient one:
-
-\def\@@plniterate{\@@plnbody\expandafter\@@plniterate\else\fi}
-
-%D We don't define a real output routine yet but at least get rid
-%D of pages:
-
-\output{\shipout\box\normalpagebox}
-
-%D Although we don't add pagenumbers yet we alias the default
-%D register used for counting pages:
-
-\countdef\pageno=0 \pageno=1 % first page is number 1
-
-%D Beside the raw counter \type {\pageno} the \type {\folio}
-%D macro provides the value.
-
-\def\folio{\the\pageno} % kind of expected and therefore reserved
-
-%D The following registers are kind of standard and (for the moment)
-%D we define them here. This might change.
-
-\newskip \bigskipamount \bigskipamount = 12pt plus 4pt minus 4pt
-\newskip \medskipamount \medskipamount = 6pt plus 2pt minus 2pt
-\newskip \smallskipamount \smallskipamount = 3pt plus 1pt minus 1pt
-
-\baselineskip = 12pt
-\lineskip = 1pt
-\lineskiplimit = 0pt
-
-%D Again a few kind-of-extensions the core:
-
-\newskip \hideskip \hideskip = -1000pt plus 1fill
-\newskip \centering \centering = 0pt plus 1000pt minus 1000pt
-
-\def\hidewidth % for alignment entries that can stick out
- {\hskip\hideskip}
-
-\def\ialign % initialized \halign
- {\everycr{}%
- \tabskip\zeroskip
- \halign}
-
-\newcount \mscount
-
-\def\spanomit{\span\omit} % bypass error message
-
-\def\multispan#1%
- {\omit
- \mscount#1\relax
- \loop
- \ifnum\mscount>\plusone
- \spanomit \advance\mscount\minusone
- \repeat}
-
-%D The next section deals with selective definitions in
-%D later modules. One can of course use the \type {\texengine}
-%D number that we defined earlier instead.
-
-\bgroup \obeylines
- \gdef\pickupSOMETEX#1%
- {\expandafter\gdef\csname begin#1\endcsname{\bgroup\obeylines\dopickupSOMETEX{#1}}}
- \gdef\dopickupSOMETEX#1#2
- % {\egroup\immediate\write16{special code for #1 -> [line \the\inputlineno] \detokenize{#2}}}
- {\egroup}
-\egroup
-
-\let\endTEX \relax \long\def\beginTEX #1\endTEX {}
-\let\endETEX \relax \long\def\beginETEX #1\endETEX {}
-\let\endXETEX \relax \long\def\beginXETEX #1\endXETEX {}
-\let\endLUATEX\relax \long\def\beginLUATEX#1\endLUATEX{}
-\let\endOLDTEX\relax \long\def\beginOLDTEX#1\endOLDTEX{}
-\let\endNEWTEX\relax \long\def\beginNEWTEX#1\endNEWTEX{}
-
-\pickupSOMETEX{ETEX}
-
-\ifnum\texengine=\xetexengine
- \pickupSOMETEX{XETEX}
-\fi
-\ifnum\texengine=\luatexengine
- \pickupSOMETEX{LUATEX}
-\fi
-\ifnum\texengine<\xetexengine
- \pickupSOMETEX{OLDTEX}
-\else
- \pickupSOMETEX{NEWTEX}
-\fi
-
-%D \macros
-%D {bindprimitive}
-%D
-%D We can remap primitives (which is needed because of changes in
-%D for instance \PDFTEX).
-
-\def\bindprimitive#1 #2 % new old
- {\ifcsname#1\endcsname \else \ifcsname#2\endcsname
- \expandafter\let\csname#1\expandafter\endcsname\csname#2\endcsname
- \fi \fi}
-
-%D Because \XETEX\ also implements some \PDFTEX\ functionality, we take
-%D care of this here instead of a dedicated module. Later modules need
-%D to handle the undefined cases.
-
-%D These messy checks will disappear.
-
-% new after 1.10, watch the change in prefix
-
-\bindprimitive quitvmode ptexquitvmode
-\bindprimitive noligatures ptexnoligatures
-\bindprimitive setrandomseed ptexsetrandomseed
-\bindprimitive uniformdeviate ptexuniformdeviate
-
-\bindprimitive quitvmode pdfquitvmode
-\bindprimitive noligatures pdfnoligatures
-\bindprimitive setrandomseed pdfsetrandomseed
-\bindprimitive uniformdeviate pdfuniformdeviate
-
-\bindprimitive resettimer pdfresettimer
-\bindprimitive elapsedtime pdfelapsedtime
-
-% new per 1.40
-
-\bindprimitive ifprimitive ifpdfprimitive
-\bindprimitive primitive pdfprimitive
-\bindprimitive ifabsdim ifpdfabsdim
-\bindprimitive ifabsnum ifpdfabsnum
-
-\ifnum\texengine=\xetexengine
-
- \let\normalsetrandomseed \setrandomseed
- \let\normaluniformdeviate\uniformdeviate
-\else
-
- \pdfminorversion \plusfive
-
- \ifdefined\pdfcompresslevel \else \newcount\pdfcompresslevel \fi
- \ifdefined\pdfobjcompresslevel \else \newcount\pdfobjcompresslevel \fi
- \ifdefined\pdfgentounicode \else \newcount\pdfgentounicode \fi \pdfgentounicode \plusone
- \ifdefined\pdfinclusioncopyfonts\else \newcount\pdfinclusioncopyfonts \fi \pdfinclusioncopyfonts\plusone
-
- \def\nopdfcompression {\pdfobjcompresslevel\zerocount \pdfcompresslevel\zerocount}
- \def\maximumpdfcompression{\pdfobjcompresslevel\plusnine \pdfcompresslevel\plusnine }
- \def\normalpdfcompression {\pdfobjcompresslevel\plusthree \pdfcompresslevel\plusthree}
-
- \normalpdfcompression
-
- \let\normalsetrandomseed \setrandomseed
- \let\normaluniformdeviate\uniformdeviate
-
-\fi
-
-%D Handy.
-
-\ifnum\texengine=\luatexengine
- \ifdefined\suppresslongerror % for the moment test
- \suppresslongerror\plusone
- \fi
-\fi
-
-%D Basic status stuff.
-
-\newif\ifproductionrun
-
-%D We need to make sure that we start up in \DVI\ mode, so,
-%D after testing for running \PDFTEX, we default to \DVI.
-
-\ifx\pdftexversion\undefined \newcount\pdfoutput \fi \pdfoutput=0
-
-%D For those who expect this \unknown
-
-\ifx\fmtname \undefined \def\fmtname {ConTeXt Minimized Plain TeX} \fi
-\ifx\fmtversion\undefined \def\fmtversion{3.1415926} \fi
-
-\let\normalfmtversion\fmtversion
-
-%D A few bonus macros:
-
-\def\modulonumber#1#2{\the\numexpr#2-((((#2+(#1/2))/#1)-1)*#1)\relax}
-\def\dividonumber#1#2{\the\numexpr(#2-(#1/2))/#1\relax}
-
-\ifnum\texengine=\xetexengine
- \edef\xetexversion {\numexpr\XeTeXversion*100+(\expandafter\gobbleoneargument\XeTeXrevision-5)/10\relax}
- \edef\xetexrevision {\the\numexpr(\expandafter\gobbleoneargument\XeTeXrevision-50)/100\relax}
-\fi
-
-\ifcase\texengine
- \def\texenginename {impossible}
- \edef\texengineversion{0}
-\or
- \def\texenginename {pdfTeX}
- \edef\texengineversion{\dividonumber{100}\pdftexversion.\modulonumber{100}\pdftexversion.\pdftexrevision}
-\or
- \def\texenginename {XeTeX}
- \edef\texengineversion{\dividonumber{100}\xetexversion .\modulonumber{100}\xetexversion .\xetexrevision}
-\or
- \def\texenginename {LuaTeX}
- \edef\texengineversion{\dividonumber{100}\luatexversion.\modulonumber{100}\luatexversion.\luatexrevision}
-\else
- \def\texenginename {impossible}
- \edef\texengineversion{0}
-\fi
-
-%D While cleaning this code up a bit I was listening to Heather
-%D Nova's \CD\ Redbird. The first song on that \CD\ ends with
-%D a few lines suitable for ending this initialization module:
-%D
-%D \startlines
-%D And there's so much I can do for you
-%D Given time I know that I can prove
-%D Now my world is opened up to you
-%D Come inside
-%D
-%D Welcome to my life
-%D Welcome to my world
-%D Come inside
-%D \stoplines
-%D
-%D So let's see what \TEX\ can do now that we've opened up
-%D the basic machinery.
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/syst-new.mkii b/Master/texmf-dist/tex/context/base/mkii/syst-new.mkii
deleted file mode 100644
index 5a515dbab0e..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/syst-new.mkii
+++ /dev/null
@@ -1,886 +0,0 @@
-%D \module
-%D [ file=syst-new,
-%D version=1997.01.03,
-%D title=\CONTEXT\ Support Macros,
-%D subtitle=New Ones,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Code from this module will move. For instance to
-%D syst-dat.tex (datastructures).
-
-\unprotect
-
-% pretty ugly but fast
-
-% \copycsname xxx\endcsname\csname ..\endcsname
-
-\def\copycsname{\@EA\@EA\@EA\let\@EA\@EA\csname}
-
-% \letcscsname \crap \csname ..\endcsname
-% \letcsnamecs \csname ..\endcsname\crap
-% \letcsnamecsname\csname ..\endcsname\csname ..\endcsname
-
-\def\letcscsname {\@EA\let\@EA}
-\def\letcsnamecs {\@EA\let}
-\def\letcsnamecsname{\@EA\@EA\@EA\let\@EA\@EA}
-
-% another one, add an item to a commalist
-
-\def\addvalue#1#2% cs item
- {\ifundefined{#1}\@EA\let\csname#1\endcsname\empty\fi
- \expanded{\addtocommalist{#2}\@EA\noexpand\csname#1\endcsname}}
-
-% faster, and looks okay
-
-\def\unspaced#1%
- {\dounspaced#1\end}
-
-\def\dounspaced#1%
- {\ifx#1\end
- \@EA\gobbleoneargument
- \else
- \ifx#1\blankspace\else#1\fi
- \fi
- \dounspaced}
-
-\def\unspaceargument#1\to#2%
- {\defconvertedargument#2{#1}%
- \@EA\edef\@EA#2\@EA{\@EA\unspaced\@EA{#2}}}
-
-\def\unspaceafter#1#2%
- {\edef\ascii{\dounspaced#2\end}\@EA#1\@EA{\ascii}}
-
-% etex, much faster
-%
-% \def\unspaceargument#1\to#2%
-% {\scratchcounter\catcode'32\catcode32=\@@ignore
-% \scantokens{\edef#2{#1}}%
-% \catcode32=\scratchcounter}
-
-\def\unspaceafter#1#2%
- {\edef\ascii{\dounspaced#2\end}\@EA#1\@EA{\ascii}}
-
-% sometimes handy:
-
-\def\doifhasspaceelse#1%
- {\edef\!!stringa{#1}%
- \expanded{\dodoifhasspaceelse#1\space}\empty\relax}
-
-\def\dodoifhasspaceelse#1 #2#3\relax % \space\empty\relax
- {\ifx\!!stringa\space
- \@EA\firstoftwoarguments
- \else\ifx#2\empty
- \@EAEAEA\secondoftwoarguments
- \else
- \@EAEAEA\firstoftwoarguments
- \fi\fi}
-
-% this will replace loadfile once and alike !!! todo
-
-\def\@flg@{@flg@}
-
-\def\setflag#1%
- {\@EA\dodoglobal\@EA\chardef\csname\@flg@#1\endcsname\zerocount}
-
-\def\resetflag#1%
- {\@EA\dodoglobal\@EA\chardef\csname\@flg@#1\endcsname\plusone}
-
-\let\ifflagged\ifcase
-
-\def\flag#1{\csname\@flg@#1\endcsname}
-
-\def\doifelseflagged#1%
- {\@EA\ifx\csname\@flg@#1\endcsname\relax
- \@EA\secondoftwoarguments
- \else\ifcase\csname\@flg@#1\endcsname
- \@EAEAEA\firstoftwoarguments
- \else
- \@EAEAEA\secondoftwoarguments
- \fi\fi}
-
-\def\doifnotflagged#1%
- {\@EA\ifx\csname\@flg@#1\endcsname\relax
- \@EA\firstofoneargument
- \else\ifcase\csname\@flg@#1\endcsname
- \@EAEAEA\gobbleoneargument
- \else
- \@EAEAEA\firstofoneargument
- \fi\fi}
-
-\def\inheritparameter[#1]#2[#3]#4[#5]% tag tokey fromkey % [bypasses k!prefix]
- {\@EAEAEA\def\@EA\csname\@EA#1\@EA#3\@EA\endcsname\@EA
- {\csname#1#5\endcsname}}
-
-% \buildarray[test][aa,bb,cc,dd,ee,ff]
-% \setarrayelement{test}{1}{qq}
-% \arrayelement{test}{1}
-% \arraylength{test}
-%
-% \def\buildarray[#1][#2]%
-% {\scratchcounter=0
-% \def\docommand##1%
-% {\advance\scratchcounter by 1
-% \setvalue{@@aa#1\the\scratchcounter}{##1}}%
-% \processcommalist[#2]\docommand
-% \setevalue{@@aa#1}{\the\scratchcounter}}%
-%
-% \def\setarrayelement#1#2{\setvalue{@@aa#1#2}}
-% \def\arrayelement #1#2{\getvalue{@@aa#1#2}}
-% \def\arraylength #1{\getvalue{@@aa#1}}
-
-% \newsignal\junksignal
-%
-% \def\setjunksignal%
-% {\ifhmode
-% \hskip\junksignal
-% \let\removejunkspaces\doremovejunkspaces
-% \else
-% \let\removejunkspaces\relax
-% \fi}
-%
-% \def\doremovejunkspaces%
-% {\doloop{\ifdim\lastskip=\junksignal\unskip\else\exitloop\fi}}
-
-% \def\doifnonzeropositiveelse#1#2#3%
-% {\bgroup
-% \setbox\scratchbox=\hbox{\scratchcounter=0#1}%
-% \ifdim\wd\scratchbox=\!!zeropoint\egroup#2\else\egroup#3\fi}
-%
-% \def\dodoifnonzeropositiveelse#1#2\end#3#4%
-% {\egroup
-% \ifx#1\relax#3\else#4\fi}
-%
-% \def\doifnonzeropositiveelse#1%
-% {\bgroup
-% \afterassignment\dodoifnonzeropositiveelse\scratchcounter=0#1\relax\empty\end}
-
-\def\dodoifnonzeropositiveelse#1#2\end % #3#4%
- {\ifx#1\relax
- \ifcase\scratchcounter
- \endgroup
- \@EAEAEA\secondoftwoarguments
- \else
- \endgroup
- \@EAEAEA\firstoftwoarguments
- \fi
- \else
- \endgroup
- \@EA\secondoftwoarguments
- \fi}
-
-\def\doifnonzeropositiveelse#1%
- {\begingroup\afterassignment\dodoifnonzeropositiveelse\scratchcounter=0#1\relax\empty\end}
-
-% here ?
-
-\def\dosetrawvalue #1#2#3{\@EA \def\csname#1#2\endcsname{#3}}
-\def\dosetrawevalue#1#2#3{\@EA\edef\csname#1#2\endcsname{#3}}
-\def\dosetrawgvalue#1#2#3{\@EA\gdef\csname#1#2\endcsname{#3}}
-\def\dosetrawxvalue#1#2#3{\@EA\xdef\csname#1#2\endcsname{#3}}
-
-\def\getrawparameters {\dogetparameters\dosetrawvalue }
-\def\getraweparameters {\dogetparameters\dosetrawevalue}
-\def\getrawgparameters {\dogetparameters\dosetrawgvalue}
-\def\getrawxparameters {\dogetparameters\dosetrawxvalue}
-
-\def\globalgetrawparameters{\dogetparameters\dosetrawgvalue} % obsolete
-
-\def\splitskip#1%
- {\scratchskip\zeropoint \!!plus \onepoint \!!minus \onepoint
- \advance\scratchskip#1\relax % \relax is realy needed here
- \expandafter\SPLITSKIP\the\scratchskip}
-
-{\catcode`\.=\@@other
- \catcode`\p=\@@other
- \catcode`\l=\@@other
- \catcode`\u=\@@other
- \catcode`\s=\@@other
- \catcode`\m=\@@other
- \catcode`\i=\@@other
- \catcode`\n=\@@other
- \catcode`\t=\@@other
- \gdef\SPLITSKIP#1pt plus #2pt minus #3pt%
- {\DOSPLITSKIP#1 #2 #3 }}
-
-% \def\DOSPLITSKIP#1 #2 #3
-% {\dimen0=#1pt\dimen2=#2pt\dimen4=#3pt
-% \advance\dimen2 -\onepoint
-% \advance\dimen4 -\onepoint}
-
-\def\DOSPLITSKIP#1 #2 #3
- {\dimen0=#1\onepoint
- \dimen2=\dimexpr#2\onepoint-\onepoint\relax
- \dimen4=\dimexpr#3\onepoint-\onepoint\relax}
-
-% \def\minimaxskip#1#2%
-% {\splitskip#2\relax
-% \scratchdimen=#2\relax
-% #2=\scratchdimen
-% \advance#2 by #1\relax}
-%
-% \def\maximizeskip%
-% {\minimaxskip{-\dimen4}}
-%
-% \def\maximizeskip%
-% {\minimaxskip{\dimen2}}
-%
-% \def\maximizespacing%
-% {\maximizeskip\blankskipamount
-% \maximizeskip\parskip
-% \maximizeskip\ctxparskip
-% \maximizeskip\baselineskip
-% \maximizeskip\bigskipamount
-% \maximizeskip\medskipamount
-% \maximizeskip\smallskipamount}
-
-\newcount\modcounter
-
-%\def\DoMod #1by#2to#3%
-% {\modcounter#1\divide\modcounter#2\multiply\modcounter#2%
-% #3#1\advance#3 -\modcounter}
-%
-%\def\DoDiv #1by#2to#3%
-% {#3#1\divide#3 #2\relax}
-
-\def\dosetmodulo#1#2#3%
- {\modcounter#1\divide\modcounter#2\multiply\modcounter#2%
- #3#1\advance#3-\modcounter}
-
-\def\dosetdivision#1#2#3%
- {#3#1\divide#3 #2\relax}
-
-\def\DoMod#1by#2to#3{\dosetmodulo {#1}{#2}{#3}}
-\def\DoDiv#1by#2to#3{\dosetdivision{#1}{#2}{#3}}
-
-\def\dounprotected#1\par
- {#1\protect}
-
-\def\unprotected
- {\unprotect\dounprotected}
-
-%D Standaard kan een spatie (zoals ~) uitrekken. Dit is in
-%D overzichten niet altijd de bedoeling, vandaar:
-
-% \def\fixedspace{\hskip\interwordspace\relax}
-
-%\def\ExpandSecondAfter#1#2#3%
-% {\!!toksa={#2}%
-% \edef\!!stringa{#3}%
-% \edef\expanded%
-% {\noexpand#1{\the\!!toksa}{\!!stringa}}%
-% \expanded}
-%
-%\def\ExpandThirdAfter#1#2#3#4%
-% {\!!toksa={#2}%
-% \!!toksb={#3}%
-% \edef\!!stringa{#4}%
-% \edef\expanded%
-% {\noexpand#1{\the\!!toksa}{\the\!!toksb}{\!!stringa}}%
-% \expanded}
-
-%\def\indirect#1#2#3%
-% {\@EA#1\@EA#2\@EA{\@EA#3\csname\s!do\string#2\endcsname}%
-% \@EA#1\csname\s!do\string#2\endcsname}
-%
-%\def\doubleemptied#1#2#3%
-% {\indirect#1#2\dodoublempty}
-%
-%\indirect\def\stelietsin\dodoubleempty[#1][#2]%
-% {...}
-%
-%\doubleemptied\def\stelietsin[#1][#2]%
-% {...}
-
-% in mult-set
-%
-%\def\defaultsetup{def}
-%
-%\def\selectdefaultsetup#1#2%
-% {\writestatus{setup}{choose #1 setupfile}%
-% \bgroup
-% \endlinechar=-1
-% \global\read16 to \usersetup
-% \egroup
-% \ifx\usersetup\empty
-% \let\usersetup=\defaultsetup
-% \fi
-% \readfile{#2\usersetup}{}{}%
-% \writestatus{setup}{loading #1 setupfile #2\usersetup}}
-
-% awaiting the definitive implementation
-
-\let\normalelapsedtime\elapsedtime
-
-\ifx\resettimer\undefined
- \let\resettimer \relax
- \newcount\elapsedtime
-\fi
-
-\newcount\featuretest
-\newcount\noffeaturetest
-\newcount\featuretesttime
-
-\def\testfeature#1#2% brought in sync with mkiv
- {\noffeaturetest#1\relax
- \def\dotestfeature
- {\advance\featuretest\plusone
- \ifnum\featuretest>\noffeaturetest\else#2\expandafter\dotestfeature\fi}%
- \def\notestfeature
- {\advance\featuretest\plusone
- \ifnum\featuretest>\noffeaturetest\else\expandafter\notestfeature\fi}%
- \retestfeature}
-
-\def\retestfeature % timer support is new per 10/5/2005
- {\bgroup
- \ifcase\interactionmode\let\wait\relax\fi
- \writestatus\m!systems{starting feature test}\wait
- \resettimer
- \bgroup
- \featuretest\zerocount \notestfeature
- \global\featuretesttime\normalelapsedtime
- \egroup
- \resettimer
- \bgroup
- \featuretest\zerocount \dotestfeature
- \egroup
- \global\featuretesttime\numexpr\normalelapsedtime-\featuretesttime\relax
- \writestatus\m!systems{feature test done (used: \elapsedseconds s)}%
- \wait
- \egroup}
-
-\def\elapsedseconds{\expandafter\withoutpt\the\dimexpr\featuretesttime sp\relax}
-
-\let\elapsedtime\elapsedseconds
-
-\def\showtimer#1%
- {\writestatus{runtime}{\elapsedseconds\space s / #1}}
-
-% \edef\elapsedtime{\expandafter\withoutpt\the\dimexpr\elapsedtime\relax s}%
-% \writestatus\m!systems{feature test done (\elapsedtime)}%
-
-\def\testfeatureonce#1#2%
- {\let\wait\relax\testfeature{#1}{#2}\end}
-
-%D \macros
-%D {adddimenregister,adddimenmacro}
-%D
-%D Instead of using numerous \type {\advance}'s, one can use
-%D the next macros to add|/|subtract a series of dimensions
-%D to a register or macro.
-%D
-%D \starttyping
-%D \adddimenregister 10pt 5pt \paperwidth \to \somedimen
-%D \adddimenmacro 10pt 5pt \paperwidth \to \bagger
-%D \stoptyping
-
-% \newdimen\dimentoaddto
-
-% \def\adddimenregister#1\to#2% will be obsolete once full etex
-% {\begingroup
-% #2=\zeropoint
-% \dimentoaddto\zeropoint
-% \def\docommand%
-% {\advance#2 \dimentoaddto
-% \futurelet\next\dodocommand}%
-% \def\dodocommand%
-% {\ifx\next\relax
-% \expanded{\endgroup#2=\the#2}%
-% \else
-% \@EA\afterassignment\@EA\docommand\@EA\dimentoaddto
-% \fi}%
-% \docommand#1\relax}
-
-% \def\adddimenmacro#1\to#2%
-% {\adddimenregister#1\to\scratchdimen
-% \edef#2{\the\scratchdimen}}
-
-%D \macros
-%D {freezedimenmacro}
-%D
-%D This macro is use as:
-%D
-%D \starttyping
-%D \freezedimenmacro\leftmargindistance
-%D \stoptyping
-
-% \def\freezedimenmacro#1%
-% {\scratchdimen#1\edef#1{\the\scratchdimen}}
-
-\def\freezedimenmacro#1%
- {\edef#1{\the\dimexpr#1}}
-
-%D The next one is slower:
-%D
-%D \starttyping
-%D \def\freezedimenmacro#1{\edef#1{\the\dimexpr(#1)}}
-%D \stoptyping
-
-% \newcount\rawrecursecounter
-%
-% \def\rawrecurselevel{\the\rawrecursecounter}%
-%
-% \def\dorawrecurse#1#2%
-% {\rawrecursecounter\plusone
-% \let\oldrecurselevel\recurselevel
-% \let\recurselevel\rawrecurselevel
-% \def\dodorawrecurse
-% {\ifnum\rawrecursecounter>#1\relax
-% \let\recurselevel\oldrecurselevel
-% \else
-% #2\advance\rawrecursecounter \plusone
-% \expandafter\dodorawrecurse
-% \fi}%
-% \dodorawrecurse}
-
-%D The next macro negates a macro (dimension or number, or actually, whatever.
-%D It's a typical example of \type {\if} usage:
-%D
-%D \starttyping
-%D \if-\whatever \else-\whatever\fi => else => -whatever
-%D \if--\whatever\else-\whatever\fi => then => whatever
-%D \stoptyping
-
-\def\negated#1{\if-#1\else-#1\fi} % does only work in macros or text
-
-% This permits things like ^\index{hans}^, where hans is
-% duplicated in the text.
-
-\newif\ifduplicate
-
-\bgroup
-
-\gdef\checkduplication % in line with Knuth
- {\ifmmode\expandafter^\else\expandafter\startduplication\fi}
-
-\gdef\insideduplication
- {\ifmmode\expandafter^\else\expandafter\egroup\fi}
-
-\catcode`\^=\@@active
-
-\gdef\enableduplication
- {\catcode`\^=\@@active \let^\checkduplication}
-
-\gdef\disableduplication
- {\catcode`\^=\@@superscript}
-
-\gdef\startduplication
- {\bgroup \duplicatetrue \let^\insideduplication}
-
-\egroup
-
-\def\gobbleassigndimen#1\\{}
-
-\def\assigndimen#1#2%
- {\afterassignment\gobbleassigndimen#1=#2\!!zeropoint\\}
-
-\def\setusage#1%
- {\@EA\let\csname#1\endcsname\iftrue}
-
-\def\resetusage#1%
- {\@EA\let\csname#1\endcsname\iffalse}
-
-\beginTEX
-
-\def\ifusage#1%
- {\@EA\ifx\csname#1\endcsname\relax
- \resetusage{#1}%
- \fi
- \csname#1\endcsname}
-
-\endTEX
-
-\beginETEX \ifcsname
-
-\def\ifusage#1%
- {\ifcsname#1\endcsname\else
- \resetusage{#1}%
- \fi
- \csname#1\endcsname}
-
-\endETEX
-
-%D Very handy, more efficient than \type{{}}, and more readable
-%D than \type {\empty}.
-
-\let\donothing\empty
-
-% The following macros are used in XML handling.
-
-% \long\def\dowithstringed#1#2#3#4% " ' space
-% {\if#4"\@EA#1\else\if#4'\@EAEAEA#2\else\@EAEAEA#3\fi\fi#4}
-%
-% \def\unstringed
-% {\dowithstringed\unstringdouble\unstringsingle\unstringspaced}
-%
-% \long\def\unstringdouble"#1"{#1}
-% \long\def\unstringsingle'#1'{#1}
-% \long\def\unstringspaced #1 {#1}
-%
-% \def\grabstring
-% {\dowithstringed\grabstringdouble\grabstringsingle\grabstringspaced}
-%
-% \def\dowithgrabbedstring#1%
-% {\def\@@dowithgrabbedstring{#1}%
-% \afterassignment\@@dowithgrabbedstring\grabstring}
-%
-% \long\def\grabstringdouble"#1"{\scratchtoks{#1}}
-% \long\def\grabstringsingle'#1'{\scratchtoks{#1}}
-% \long\def\grabstringspaced #1 {\scratchtoks{#1}}
-
-\long\setvalue{@u@s@"}#1#2"{#2} \long\setvalue{@g@s@"}#1#2"{\scratchtoks{#2}}
-\long\setvalue{@u@s@'}#1#2'{#2} \long\setvalue{@g@s@'}#1#2'{\scratchtoks{#2}}
-\long\setvalue{@u@s@ }#1#2 {#2} \long\setvalue{@g@s@ }#1#2 {\scratchtoks{#2}}
-
-\long\def\unstringed#1{\csname\ifcsname @u@s@#1\endcsname @u@s@#1\else\s!empty\fi\endcsname#1}
-\long\def\grabstring#1{\csname\ifcsname @g@s@#1\endcsname @g@s@#1\else\s!empty\fi\endcsname#1}
-
-\def\dowithgrabbedstring#1%
- {\def\@@dowithgrabbedstring{#1}%
- \afterassignment\@@dowithgrabbedstring\grabstring}
-
-\def\expifequalelse#1#2%
- {\@@ifequal#1\relax\relax\@@and#2\relax\relax\@@then}
-
-\def\@@ifequal#1#2\@@and#3%
- {\ifx#1\relax
- \ifx#3\relax
- \@EAEAEA\@@if@@equal@@true
- \else
- \@EAEAEA\@@if@@equal@@false
- \fi
- \else
- \ifx#3\relax
- \@EAEAEAEAEAEA\@@if@@equal@@false
- \else\ifx#1#3%
- % go on
- \else
- \@EAEAEAEAEAEA\@@if@@equal@@false
- \fi\fi
- \fi
- \@@ifequal#2\@@and}
-
-\long\def\@@if@@equal@@true #1\@@then#2#3{#2}
-\long\def\@@if@@equal@@false#1\@@then#2#3{#3}
-
-%D new stuff :
-
-\def\partialexpanded#1%
- {\let\@@notexpanded\noexpand
- \long\xdef\@@expanded{\noexpand#1}%
- \let\@@notexpanded\empty
- \@@expanded}
-
-% for Simon ; watch how we make them fully expandable (i.e.
-% no \type {\relax}es) popping up
-
-\def\@do@the@number@#1\relax#2\end{#1}
-
-\def\@the@number@#1{\@EA\@do@the@number@\number#1\relax\end}
-
-\def\doifnum#1#2%
- {\ifnum#1=\@the@number@{#2} % space needed
- \expandafter\firstofoneargument
- \else
- \expandafter\gobbleoneargument
- \fi}
-
-\def\doifnotnum#1#2%
- {\ifnum#1=\@the@number@{#2} % space needed
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-\def\doifelsenum#1#2%
- {\ifnum#1=\@the@number@{#2} % space needed
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-% \edef\xxxx{\doifnum{1}{2}{no}} \show \xxxx
-% \edef\xxxx{\doifnum{2}{2}{yes}} \show \xxxx
-% \scratchcounter0 \edef\xxxx{\doifnum{1}{\scratchcounter}{no}} \show \xxxx
-% \scratchcounter1 \edef\xxxx{\doifnum{1}{\scratchcounter}{yes}} \show \xxxx
-
-\def\appended#1#2#3{\@EA#1\@EA#2\@EA{#2#3}}
-\def\appendvalue #1{\@EA\appended\@EA \def\csname#1\endcsname}
-\def\appendgvalue#1{\@EA\appended\@EA\gdef\csname#1\endcsname}
-
-\def\prepended#1#2#3{\scratchtoks{#3}\@EA\@EA\@EA#1\@EA\@EA\@EA#2\@EA\@EA\@EA{\@EA\the\@EA\scratchtoks#2}}
-\def\prependvalue #1{\@EA\prepended\@EA \def\csname#1\endcsname}
-\def\prependgvalue#1{\@EA\prepended\@EA\gdef\csname#1\endcsname}
-
-%D \macros
-%D {compresscommacommandnrs,compresscommalistnrs,compressedcommalistnrs,
-%D compresscommacommand,compresscommalist,compressedcommalist,
-%D reversecommacommand,reversecommalist,reversedcommalist}
-%D
-%D The following two list processing macros are needed by Taco's
-%D bibliography module. The numbers compressor converts the
-%D list in a list of ranges. The normal compressor remove duplicate
-%D and empty entries.
-
-\def\compresscommalistnrs[#1]%
- {\let\compressedlist\empty
- \!!counta\maxdimen
- \!!countb\maxdimen
- \processcommalist[#1]\docompresslistnrs
- \ifnum\!!counta=\maxdimen\else\dodocompresslistnrs\fi}
-
-\def\compresscommacommandnrs[#1]%
- {\expanded{\compresscommalistnrs[#1]}}
-
-\def\docompresslistnrs#1%
- {\edef\commalistelement{#1}%
- \ifx\commalistelement\empty\else
- \ifnum\!!counta=\maxdimen
- \!!counta\commalistelement\relax
- \!!countb\!!counta
- \else
- \advance\!!countb\plusone
- \ifnum\commalistelement>\!!countb
- \advance\!!countb\minusone
- \dodocompresslistnrs
- \!!counta\commalistelement\relax
- \!!countb\!!counta
- \fi
- \fi
- \fi}
-
-\def\dodocompresslistnrs
- {\edef\compressedlist
- {\ifx\compressedlist\empty\else\compressedlist,\fi
- {\the\!!counta}{\ifnum\!!countb>\!!counta\the\!!countb\fi}}}
-
-%D \def\test#1{{\tttf#1->\compresscommalistnrs[#1]\defconvertedcommand\ascii\compressedlist\ascii}}
-%D \startlines
-%D \test{}
-%D \test{1}
-%D \test{1,3}
-%D \test{1,3,4}
-%D \test{1,3,3,4,5}
-%D \test{1,3,3,4,5,8}
-%D \test{1,3,3,4,5,5,8,10}
-%D \test{1,3,4,5,8,10,11}
-%D \test{1,,3,,4,,5,,8,,10,,11,}
-%D \stoplines
-
-\def\compresscommalist[#1]%
- {\let\compressedlist\empty
- \let\!!stringa\empty
- \processcommalist[#1]\docompresslist}
-
-\def\compresscommacommand[#1]%
- {\expanded{\compresscommalist[#1]}}
-
-\def\docompresslist#1%
- {\edef\commalistelement{#1}%
- \ifx\commalistelement\empty \else
- \ifx\!!stringa\commalistelement \else
- \ifx\compressedlist\empty
- \def\compressedlist{#1}%
- \else
- \appended\def\compressedlist{,#1}%
- \fi
- \let\!!stringa\commalistelement
- \fi
- \fi}
-
-%D \def\test#1{{\tttf#1->\compresscommalist[#1]\defconvertedcommand\ascii\compressedlist\ascii}}
-%D \startlines
-%D \test{}
-%D \test{1}
-%D \test{1,3}
-%D \test{1,3,4}
-%D \test{1,3,3,4,5}
-%D \test{1,3,3,4,5,8}
-%D \test{1,3,3,4,5,5,8,10}
-%D \test{1,3,4,5,8,10,11}
-%D \test{1,,3,,4,,5,,8,,10,,11,}
-%D \stoplines
-
-\def\reversecommalist[#1]%
- {\let\reversedlist\empty
- \processcommalist[#1]\doreverselist}
-
-\def\doreverselist#1%
- {\ifx\reversedlist\empty
- \def\reversedlist{#1}%
- \else
- \prepended\def\reversedlist{#1,}%
- \fi}
-
-\def\reversecommacommand[#1]%
- {\expanded{\reversecommalist[#1]}}
-
-%D \def\test#1{{\tttf#1->\reversecommalist[#1]\defconvertedcommand\ascii\reversedlist\ascii}}
-%D \startlines
-%D \test{}
-%D \test{1}
-%D \test{1,3}
-%D \test{1,3,4}
-%D \test{1,3,3,4,5}
-%D \test{1,3,3,4,5,8}
-%D \test{1,3,3,4,5,5,8,10}
-%D \test{1,3,4,5,8,10,11}
-%D \test{1,,3,,4,,5,,8,,10,,11,}
-%D \stoplines
-
-%D \macros
-%D {stripstring}
-%D
-%D Needed in bookmarks:
-%D
-%D \starttyping
-%D {\sanitizePDFdocencoding test \CONTEXT\ test \to\oeps\stripstring\oeps\tttf[\oeps]}
-%D \stoptyping
-
-\def\stripstring#1% #1 is \cs
- {\bgroup
- \defconvertedcommand\ascii{#1}%
- \global\let\globalascii\empty
- \donefalse
- \expandafter\handletokens\ascii\with\dostripstring
- \egroup
- \let#1\globalascii}
-
-\def\dostripstring#1%
- {\ifx#1\blankspace
- \donetrue
- \else
- \ifdone\ifx\globalascii\empty\else
- \xdef\globalascii{\globalascii\space}%
- \donefalse
- \fi\fi
- \xdef\globalascii{\globalascii#1}%
- \fi}
-
-%D \macros
-%D {dowithrange}
-%D
-%D This one is for Mojca Miklavec, who made me aware of the fact that
-%D \type {page-imp.tex} was not the best place to hide it.
-
-\def\dowithrange#1#2% #2 takes number
- {\splitstring#1\at:\to\fromrange\and\torange
- \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}
-
-% new
-%
-% \startnointerference
-% all kind of code
-% \stopnointerference
-
-\newbox\nointerferencebox
-
-\def\startnointerference
- {\setbox\nointerferencebox\vbox
- \bgroup}
-
-\def\stopnointerference
- {\egroup
- \setbox\nointerferencebox\emptybox}
-
-\protect \endinput
-
-
-% \def\appendtovaluelist#1#2%
-% {\ifcsname#1\endcsname
-% \expandafter\ifx\csname#1\endcsname\empty
-% \expandafter\def\csname#1\endcsname{#2}%
-% \else
-% \expandafter\def\csname#1\expandafter\expandafter\expandafter\endcsname
-% \expandafter\expandafter\expandafter{\csname#1\endcsname,#2}%
-% \fi
-% \else
-% \expandafter\def\csname#1\endcsname{#2}%
-% \fi}
-%
-% or
-%
-% \def\appendtovaluelist#1%
-% {\ifcsname#1\endcsname
-% \expandafter\ifx\csname#1\endcsname\empty
-% \expandafter\noappendtovaluelist\csname#1\expandafter\expandafter\expandafter\endcsname
-% \else
-% \expandafter\doappendtovaluelist\csname#1\expandafter\expandafter\expandafter\endcsname
-% \fi
-% \else
-% \expandafter\noappendtovaluelist\csname#1\expandafter\endcsname
-% \fi}
-
-% \def\doappendtovaluelist#1#2{\expandafter\def\expandafter#1\expandafter{#1,#2}}
-% \def\noappendtovaluelist#1#2{\def#1{#2}}
-
-% \appendtovaluelist{mylist}{aap}
-% \appendtovaluelist{mylist}{noot}
-% \appendtovaluelist{mylist}{mies}
-
-% \showvalue{mylist}
diff --git a/Master/texmf-dist/tex/context/base/mkii/syst-pln.mkii b/Master/texmf-dist/tex/context/base/mkii/syst-pln.mkii
deleted file mode 100644
index 1032b40b595..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/syst-pln.mkii
+++ /dev/null
@@ -1,118 +0,0 @@
-%D \module
-%D [ file=syst-pln,
-%D version=2001.11.16, % 1999.03.17, % an oldie: 1995.10.10
-%D title=\CONTEXT\ System Macros,
-%D subtitle=Efficient \PLAIN\ \TEX\ loading,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\unprotect
-
-%D This module set a couple of variables to the plain \TEX\
-%D values. Later they might be overloaded.
-
-%D Build||in numeric variables.
-
-\adjdemerits = 10000
-\binoppenalty = 700
-\brokenpenalty = 100
-\clubpenalty = 150
-%day = 0
-\defaulthyphenchar = `\-
-\defaultskewchar = -1
-\delimiterfactor = 901
-\displaywidowpenalty = 50
-\doublehyphendemerits = 10000
-%endlinechar = `\^^M
-\errorcontextlines = 5
-%escapechar = `\\
-\exhyphenpenalty = 50
-%fam = 0
-\finalhyphendemerits = 5000
-%floatingpenalty = 0
-%globaldefs = 0
-%hangafter = 1
-\hbadness = 1000
-%holdinginserts = 0
-\hyphenpenalty = 50
-%interlinepenalty = 0
-%language = 0
-\lefthyphenmin = 2
-\linepenalty = 10
-%looseness = 0
-%mag = 1000
-%maxdeadcycles = 25
-%month = 0
-%newlinechar = -1 % commented i.e. no plain value
-%outputpenalty = 0
-%pausing = 0
-%postdisplaypenalty = 0
-\predisplaypenalty = 10000
-\pretolerance = 100
-\relpenalty = 500
-\righthyphenmin = 3
-\showboxbreadth = 5
-\showboxdepth = 3
-%time = 0
-\tolerance = 200
-%tracingcommands = 0
-\tracinglostchars = 1
-%tracingmacros = 0
-%tracingonline = 0
-%tracingoutput = 0
-%tracingpages = 0
-%tracingparagraphs = 0
-%tracingrestores = 0
-%tracingstats = 0
-\uchyph = 1
-\vbadness = 1000
-\widowpenalty = 150
-%year = 0
-
-%D Build in dimension variables.
-
-\abovedisplayshortskip = 0pt plus 3pt
-\abovedisplayskip = 12pt plus 3pt minus 9pt
-%baselineskip = 0pt
-\belowdisplayshortskip = 7pt plus 3pt minus 4pt
-\belowdisplayskip = 12pt plus 3pt minus 9pt
-\boxmaxdepth = \maxdimen
-\delimitershortfall = 5pt
-%displayindent = 0pt
-%displaywidth = 0pt
-%hangindent = 0pt
-\hfuzz = 0.1pt
-%hoffset = 0pt
-\hsize = 6.5in
-%leftskip = 0pt
-%lineskip = 0pt
-%lineskiplimit = 0pt
-%mathsurround = 0pt
-\maxdepth = 4pt
-\medmuskip = 4mu plus 2mu minus 4mu
-\nulldelimiterspace = 1.2pt
-\overfullrule = 5pt
-\parfillskip = 0pt plus 1fil
-\parindent = 20pt
-\parskip = 0pt plus 1pt
-%predisplaysize = 0pt
-%rightskip = 0pt
-\scriptspace = 0.5pt
-%spaceskip = 0pt
-\splitmaxdepth = \maxdimen
-\splittopskip = 10pt
-%tabskip = 0pt
-\thickmuskip = 5mu plus 5mu
-\thinmuskip = 3mu
-\topskip = 10pt
-\vfuzz = 0.1pt
-%voffset = 0pt
-\vsize = 8.9in
-%xspaceskip = 0pt
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/syst-rtp.mkii b/Master/texmf-dist/tex/context/base/mkii/syst-rtp.mkii
deleted file mode 100644
index fc0f503b062..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/syst-rtp.mkii
+++ /dev/null
@@ -1,18 +0,0 @@
-%D \module
-%D [ file=syst-rtp, % copied from core-job
-%D version=1997.03.31,
-%D title=\CONTEXT\ Core Macros,
-%D subtitle=Run Time Processes,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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
-
-\def\executesystemcommand{\immediate\write18}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/syst-str.mkii b/Master/texmf-dist/tex/context/base/mkii/syst-str.mkii
deleted file mode 100644
index aacb70ec742..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/syst-str.mkii
+++ /dev/null
@@ -1,124 +0,0 @@
-%D \module
-%D [ file=syst-str,
-%D version=2006.09.18,
-%D title=\CONTEXT\ System Macros,
-%D subtitle=String Processing,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 We need a convenient way to change lccode vectors.
-
-\dostepwiserecurse{0}{255}{1}
- {\@EA\chardef\csname-\recurselevel\endcsname\recurselevel}
-
-\newtoks\withminorcharacters
-\newtoks\withlowercharacters
-\newtoks\withuppercharacters
-
-\dostepwiserecurse{0}{31}{1}
- {\expanded
- {\appendtoks\noexpand\withcharacter\csname-\recurselevel\endcsname
- \noexpand\to\withminorcharacters}}
-
-\dostepwiserecurse{32}{127}{1}
- {\expanded
- {\appendtoks\noexpand\withcharacter\csname-\recurselevel\endcsname
- \noexpand\to\withlowercharacters}}
-
-\dostepwiserecurse{128}{255}{1}
- {\expanded
- {\appendtoks\noexpand\withcharacter\csname-\recurselevel\endcsname
- \noexpand\to\withuppercharacters}}
-
-\chardef\obeyedlccode=`. % so <32 and >127 chars become .
-
-%D \macros
-%D {retainlccodes}
-%D
-%D One way of manipulating characters is changing the their
-%D \type{\lccode} and applying \type{\lowcase}. An example of
-%D this can be found in \type{spec-mis}.
-
-\def\setownlccode #1{\lccode#1#1}
-\def\setobeyedlccode#1{\lccode#1\obeyedlccode}
-
-\def\obeylccodes
- {\let\withcharacter\setownlccode
- \the\withlowercharacters
- \let\withcharacter\setobeyedlccode
- \the\withminorcharacters
- \the\withuppercharacters
- \relax}
-
-\def\retainlccodes
- {\let\withcharacter\setownlccode
- \the\withlowercharacters
- \the\withminorcharacters
- \the\withuppercharacters
- \relax}
-
-%D I got tired of making dedicated clean up macros using the
-%D same mechanism again and again, so now we have:
-%D
-%D \starttyping
-%D \def\xxxx{abc.d} \replacecharacters\xxxx{a.}{-} \xxxx
-%D \stoptyping
-
-\def\replacecharacters#1#2#3% macro characters replacement
- {\bgroup
- \edef\ascii{#1}%
- \retainlccodes
- \def\docommand##1{\lccode\expandafter`\csname##1\endcsname=\expandafter`\csname#3\endcsname}%
- \handletokens#2\with\docommand
- \lowercase\@EA{\@EA\xdef\@EA\globalascii\@EA{\ascii}}%
- \egroup
- \dodoglobal\let#1\globalascii}
-
-% \bgroup
-% \catcode`\ =\@@other % needed in order to get it visible
-% \lccode`\ =`\-
-% \lowercase{\xdef\globalascii{aap noot}}%
-% \egroup
-%
-% [\globalascii] {\tttf [\globalascii]}
-%
-% interesting:
-%
-% \setvalue{xxx}{oeps}
-% \setvalue{test-test}{\getvalue{xxx}oeps}
-% \bgroup\lccode`\ =`\-\lowercase{\egroup\csname test test\endcsname}
-%
-% \setvalue{test\string~test}{\getvalue{xxx}oeps}
-% \bgroup\lccode`\ =`\~\lowercase{\egroup\csname test test\endcsname}
-%
-% \bgroup\catcode`\~=\@@letter\lowercase{\egroup\csname test~test\endcsname}
-
-\def\separatestring#1\to#2%
- {\bgroup
- \retainlccodes
- \lccode `\ =`\,%
- % when typesetting: \catcode`\ =\@@other
- \edef\ascii{#1}%
- \lowercase\@EA{\@EA\xdef\@EA\globalascii\@EA{\ascii}}%
- \egroup
- \let#2\globalascii}
-
-\def\unspacefilename#1\to#2%
- {\bgroup
- \def\obeyedspace{-}%
- \sanitizefilename#1\to\ascii
- \retainlccodes
- \lccode `\ =`\-%
- % when typesetting: \catcode`\ =\@@other
- \lowercase\@EA{\@EA\xdef\@EA\globalascii\@EA{\ascii}}%
- \egroup
- \let#2\globalascii}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/tabl-ltb.mkii b/Master/texmf-dist/tex/context/base/mkii/tabl-ltb.mkii
deleted file mode 100644
index bac2b589376..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/tabl-ltb.mkii
+++ /dev/null
@@ -1,866 +0,0 @@
-%D \module
-%D [ file=tabl-ltb,
-%D version=2002.10.31,
-%D title=\CONTEXT\ Table Macros,
-%D subtitle=Line Tables,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% testfile: tfmetrics.tex
-
-% todo: als nx>1, dan in geval van rek tussenruimte berekenen en optellen
-% bij breedte, dus: nx nog niet gebruiken in combinatie met rek ! ! ! ! !
-
-% This module is experimental, undocumented, and currently only set up
-% eTeX. It provides a mechanism for typesetting very large tables,
-% spanning many pages horizontally and vertically, with repeated
-% header lines and (entry) columns, tab tracking, color, etc. In does
-% two passes over a table, which is why the table goes into a
-% buffer or file. As said, tables can be real huge.
-
-% \BH \BC .. \EC \BC .. \EC \EH % append
-% \BR \BC .. \EC \BC .. \EC \ER
-%
-% or
-%
-% \NC .. \NC .. \NC \NR (todo: optional last \NC)
-
-% alternative:
-%
-% (1) direct run, save content in macro, but only if needed
-%
-% todo
-%
-% (2) buffered table content
-%
-% \startbuffer
-% \startlinetablehead
-% \stoplinetablehead
-% \startlinetablebody
-% \stoplinetablebody
-% \stopbuffer
-%
-% \processlinetablebuffer[buffer]
-%
-% in buffer : head and body
-%
-% (3) unbuffered run, multipass
-%
-% - run with starting width zero / prev run
-% - clip on prev run
-% - flush real widths
-
-\writestatus{loading}{ConTeXt Table Macros / Line Tables}
-
-\unprotect
-
-\chardef\linetablesplitstate\zerocount
-\chardef\linetableheadstate \zerocount
-
-\edef\??ler{\??le:r:}
-\edef\??lec{\??le:c:}
-\edef\??lew{\??le:w:}
-\edef\??leh{\??le:h:}
-\edef\??led{\??le:d:}
-
-\newif\iflinetablepreroll
-\newif\ifinlinetable
-
-\newcount\linetablecolumn
-\newcount\linetablesubcol
-\newdimen\linetablewidth
-\newdimen\linetableheight
-\newbox \linetablecell
-
-\let\noflinetablecolumns\!!zerocount
-\let\noflinetablerows \!!zerocount
-\let\noflinetablelines \!!zerocount
-\let\noflinetableparts \!!zerocount
-\let\linetablepart \!!plusone
-\let\linetablestep \!!plusone
-\let\linetableline \!!zerocount
-\let\linetablerow \!!zerocount
-\let\linetablerows \!!zerocount
-
-\initializetablebox \zerocount % holds repeater
-
-\chardef\linetablehmode \zerocount
-\chardef\linetablepage \zerocount
-\chardef\linetablerepeat\zerocount
-
-\def\setuplinetable
- {\dotripleempty\dosetuplinetable}
-
-\def\dosetuplinetable[#1][#2][#3]%
- {\ifthirdargument
- \getparameters[\??le:#1:#2][#3]%
- \else\ifsecondargument
- \getparameters[\??lec#1][#2]%
- \else
- \getparameters[\??le][#1]%
- \fi\fi}
-
-\setuplinetable
- [\c!n=\!!maxcard,
- \c!lines=\!!maxcard,
- \c!nx=\plusone,
- \c!nleft=0,
- \c!repeat=\v!yes, % when \c!nleft>0, repeat on both pages
- \c!before=,
- \c!after=,
- \c!inbetween=\page,
- \c!distance=\zeropoint,
- \c!stretch=\v!no,
- \c!align=\c!right,
- \c!leftoffset=.25ex,
- \c!rightoffset=\linetableparameter\c!leftoffset,
- \c!maxwidth=\zeropoint,
- \c!width=5em,
- \c!height=\v!fit, % \v!line = faster
- \c!background=,
- \c!backgroundcolor=]
-
-\def\linetableparameter#1%
- {\csname\??le#1\endcsname}
-
-\def\doifelselinetablecparameter#1%
- {\ifcsname\??lec\number\linetablecolumn#1\endcsname
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\def\linetablecparameter#1%
- {\csname
- \ifcsname\??lec\number\linetablecolumn#1\endcsname
- \??lec\number\linetablecolumn
- \else
- \??le
- \fi
- #1\endcsname}
-
-\def\linetablerparameter#1% faster, leaner and meaner
- {\csname
- \ifnum\linetablerow=\zerocount % geen ifcase
- \ifcsname\??ler\v!header#1\endcsname
- \??ler\v!header#1%
- \else\ifcsname\??ler0#1\endcsname
- \??ler0#1%
- \else
- \s!empty
- \fi\fi
- \else
- \ifcsname\??ler\number\linetablerow#1\endcsname
- \??ler\number\linetablerow#1%
- \else\ifcsname\??ler\v!oddeven\linetablerow#1\endcsname
- \??ler\v!oddeven\linetablerow#1%
- \else
- \s!empty
- \fi\fi
- \fi
- \endcsname}
-
-\def\setnoftableslines
- {\doifelse{\linetableparameter\c!lines}\v!fit
- {% whitespace already added by vertical strut
- \ifdim\pagegoal<\maxdimen
- \scratchdimen\pagegoal
- \advance\scratchdimen -\pagetotal
- \else
- \scratchdimen\textheight
- \fi
- \getrawnoflines\scratchdimen
- \xdef\noflinetablelines{\the\noflines}
-\iflinetablepreroll \else \ifnum\noflinetablelines<\plustwo
- \page \setnoftableslines
-\fi \fi
-}
- {\xdef\noflinetablelines{\linetableparameter\c!lines}}}
-
-\def\startlinetablecell
- {\dosingleempty\dostartlinetablecell}
-
-\def\dostartlinetablecell[#1]%
- {\global\setbox\linetablecell\hbox\bgroup
- \iffirstargument
- \getparameters[\??lec\number\linetablecolumn][#1]%
- \fi
- \xdef\linetablestep{\linetablecparameter\c!nx}%
- \ifcase\linetablestep\or
- \scratchdimen\linetablecparameter\c!width
- \scratchskip \linetablecparameter\c!distance
- \else
- \scratchdimen \zeropoint
- \scratchskip \zeropoint
- \scratchcounter\linetablecolumn
- \dorecurse\linetablestep
- {\advance\scratchdimen\linetablecparameter\c!width
- %\advance\scratchskip \linetablecparameter\c!distance
- \global\advance \linetablecolumn\plusone
- \advance\scratchskip \linetablecparameter\c!distance
- }%
- \global\linetablecolumn\scratchcounter
- \fi
- \chardef\linetablemode
- \iflinetablepreroll
- \ifdim\scratchdimen>\zeropoint \zerocount \else \plustwo \fi
- \else
- \zerocount
- \fi
- \ifcase\linetablemode
- \ifcase\linetablehmode
- % nothing
- \or
- % fit, keep it simple
- \or
- \chardef\linetablemode\plusone % line
- \else
- % some already calculated height
- \fi
- \fi
- \setbox\scratchbox\hbox
- \bgroup
- \dontcomplain
- \hskip\linetablecparameter\c!leftoffset\relax
- % 0 = width, unknown height
- % 1 = width, fixed height
- % 2 = no width, auto hsize
- \ifnum\linetablemode<\plustwo
- \advance\scratchdimen-\linetablecparameter\c!leftoffset
- \advance\scratchdimen-\linetablecparameter\c!rightoffset
- \fi
- \ifcase\linetablemode
- \dosetraggedcommand{\linetablecparameter\c!align}%
- \vtop \ifdim\linetableheight>\zeropoint to\linetableheight \fi \bgroup
- \hsize\scratchdimen
- \raggedcommand
- \else
- \setalignmentswitch{\linetablecparameter\c!align}%
- \hbox \ifcase\linetablemode \or to\scratchdimen \fi \bgroup
- \ifcase\alignmentswitch\hss\or\hss\fi
- \fi
- \dostartattributes{\??lec\number\linetablecolumn}\c!style\c!color\empty
- \begstrut \ignorespaces}
-
-% \def\stoplinetablecell
-% {\unskip \endstrut
-% \dostopattributes
-% \ifcase\linetablemode
-% \endgraf
-% \else
-% \ifcase\alignmentswitch\else\hss\fi
-% \fi
-% \egroup
-% \hskip\linetablecparameter\c!rightoffset
-% \egroup
-% \iflinetablepreroll
-% \box\scratchbox
-% \else
-% \doif{\linetablecparameter\c!background}\v!color
-% {\backgroundline[\linetablecparameter\c!backgroundcolor]}%
-% {\box\scratchbox}%
-% \fi
-% \egroup}
-
-\newconditional\linetableautoheight \settrue\linetableautoheight
-
-\def\stoplinetablecell
- {\unskip \endstrut
- \dostopattributes
- \ifcase\linetablemode
- \endgraf
- \else
- \ifcase\alignmentswitch\else\hss\fi
- \fi
- \egroup
- \hskip\linetablecparameter\c!rightoffset
- \egroup
- \iflinetablepreroll
- \box\scratchbox
- \else
- \doifelse{\linetablecparameter\c!background}\v!color
- {\ifconditional\linetableautoheight
- \hbox{\blackrule
- [ \c!color=\linetablecparameter\c!backgroundcolor,
- \c!height=\linetablerparameter{x\c!height},
- \c!depth=\linetablerparameter{x\c!depth},
- \c!width=\wd\scratchbox]%
- \hskip-\wd\scratchbox\box\scratchbox}%
- \else
- \backgroundline[\linetablecparameter\c!backgroundcolor]{\box\scratchbox}%
- \fi}%
- {\box\scratchbox}%
- \fi
- \egroup}
-
-% \def\stoplinetablecell
-% {\unskip \endstrut
-% \dostopattributes
-% \ifcase\linetablemode
-% \endgraf
-% \else
-% \ifcase\alignmentswitch\else\hss\fi
-% \fi
-% \egroup
-% \hskip\linetablecparameter\c!rightoffset
-% \egroup
-% \iflinetablepreroll
-% \box\scratchbox
-% \else
-% \doifelse{\linetablecparameter\c!background}\v!color
-% {\ifconditional\linetableautoheight
-% % \hbox{\blackrule
-% % [ \c!color=\linetablecparameter\c!backgroundcolor,
-% % \c!height=\linetablerparameter{x\c!height},
-% % \c!depth=\linetablerparameter{x\c!depth},
-% % \c!width=\wd\scratchbox]%
-% % \hskip-\wd\scratchbox\box\scratchbox}%
-% \dp\scratchbox\linetablerparameter{x\c!depth}%
-% \ht\scratchbox\linetablerparameter{x\c!height}%
-% \framed
-% [\c!offset=\v!overlay,
-% \c!frameoffset=.5\linewidth,
-% \c!leftframe=\v!off,\c!rightframe=\v!off,
-% \c!background=\v!color,
-% \c!backgroundcolor=\linetablecparameter\c!backgroundcolor%
-% ]{\box\scratchbox}%
-% \else
-% \backgroundline[\linetablecparameter\c!backgroundcolor]{\box\scratchbox}%
-% \fi}%
-% {\box\scratchbox}%
-% \fi
-% \egroup}
-
-\def\savelinetablepart
- {\global\setbox\tablebox\linetablepart
- \ifnum\linetablepart=\zerocount
- \box\scratchbox % just storing
- \else
- \vbox
- {\ifvoid\tablebox\linetablepart\else\unvbox\tablebox\linetablepart\fi
- \doif{\linetablerparameter\c!background}\v!color
- {\backgroundline[\linetablerparameter\c!backgroundcolor]}%
- {\box\scratchbox}% is also arg to \backgroundline
- \endgraf
- \linetablerparameter\c!after}%
- \fi}
-
-\def\flushlinetableparts
- {\doglobal\increment\linetableline
- \ifnum\linetableline<\noflinetablelines
- % keep collecting
- \else
- \iflinetablepreroll
- % forget about them
- \else
- \dorecurse\noflinetableparts
- {\let\linetablepart\recurselevel
- \dp\tablebox\linetablepart\strutdepth
- % noindent en endgraf needed else whitespace mess-up!
- \whitespace % here not after verticalstrut
- \ifdim\topskipgap=\zeropoint\else
- \verticalstrut\nobreak\kern-\struttotal\kern-\parskip\nobreak\nointerlineskip % fix topskip
- \fi
- \noindent\strut\hbox to \hsize{\box\tablebox\linetablepart\hss}\endgraf
- \ifnum\linetablepart<\noflinetableparts\relax
- \linetableparameter\c!inbetween
- \fi}%
- \ifnum\linetablerows<\noflinetablerows\relax
- \linetableparameter\c!inbetween
- \else
- % after, later
- \fi
- \chardef\linetableheadstate\plusthree
- \global\setbox\tablebox\zerocount\emptybox % here
- \fi
- % reset \linetablerow will be an option, currently
- % starts at zero after split
- \globallet\linetablerow\!!zerocount
- \globallet\linetableline\!!zerocount
- \global\chardef\linetablepage\zerocount
- \global\linetablewidth\zeropoint
- \setnoftableslines
- \fi}
-
-\def\startlinetablepart
- {\global\linetablesubcol\zerocount
- \setbox\scratchbox\hbox\bgroup
- \doconvertfont{\linetablerparameter\c!style}%
- \startcolor[\linetablerparameter\c!color]%
- \ignorespaces}
-
-\def\stoplinetablepart
- {\ifnum\linetablepart>\zerocount
- \unskip \unskip % remove last intercolumn skip (distance+fill)
- \fi
- \stopcolor
- \egroup
- \iflinetablepreroll \else
- \ifcase\linetablepart
- % we're collecting the repeater
- \else
- \scratchdimen\hsize \advance\scratchdimen-\wd\scratchbox\relax
- \ifdim\scratchdimen>\linetableparameter\c!stretch\else
- \setbox\scratchbox\hbox to \hsize{\unhbox\scratchbox}%
- \fi
- \fi
- \fi}
-
-\def\checklinetablepart
- {\global\advance\linetablewidth\wd\linetablecell
- \global\advance\linetablecolumn\linetablestep
- \global\advance\linetablesubcol\linetablestep
- \relax
- %\message{\the\linetablecolumn,\the\linetablesubcol}\wait
- % from now on the column counter is already incremented
- \ifcase\linetablesplitstate
- \iflinetablepreroll \else
- \box\linetablecell
- % the columncounter is one ahead !
-% \hskip\linetablecparameter\c!afstand
- \hskip\scratchskip
- \fi
- %%%
- \donefalse
- \ifcase\linetablerepeat\else
- % van te voren berekenen
- \scratchcounter\linetablecolumn\advance\scratchcounter-\plustwo
- \ifnum\linetablerepeat=\scratchcounter
- \donetrue % collecting repeater
- \fi
- \fi
- %%%%
- \ifdone
- % collecting repeater
- \else
- \ifnum\linetablecolumn>\getvalue{\??le::\linetablepart}\relax
- \donetrue
- \fi
- \fi
- \ifdone
- \stoplinetablepart
- \iflinetablepreroll \else
- \savelinetablepart
- \fi
- \ifcase\linetablepage \or
- \global\chardef\linetablepage \plustwo
- \else
- \global\chardef\linetablepage \plusone
- \fi
- \doglobal\increment\linetablepart
- \global\linetablewidth\wd\tablebox\zerocount
- \startlinetablepart
- \fi
- \else
- \donefalse
- \!!doneafalse
- \ifcase\linetablerepeat\else
- % van te voren berekenen
- \scratchcounter\linetablecolumn \advance\scratchcounter-\plustwo
- \ifnum\linetablerepeat=\scratchcounter
- \donetrue % collecting repeater
- \fi
- \fi
- \ifdone
- \!!doneatrue
- % collecting repeater
- \else\ifdim\linetablewidth>\hsize
- \donetrue
- \else
-% \global\advance\linetablewidth\linetablecparameter\c!afstand\relax
- \global\advance\linetablewidth\scratchskip
- \ifdim\linetablewidth>\hsize % ?
- \donetrue
- \fi
- \fi\fi
- \ifdone
- \stoplinetablepart
- \savelinetablepart
- \ifcase\linetablepage \or
- \global\chardef\linetablepage \plustwo
- \else
- \global\chardef\linetablepage \plusone
- \fi
- \doglobal\increment\linetablepart
- \ifnum\linetablepart>\noflinetableparts
- \globallet\noflinetableparts\linetablepart
- \initializetablebox\linetablepart
- \fi
- \global\linetablewidth\wd\linetablecell
- \startlinetablepart
- \if!!doneb \else \ifcase\linetablerepeat \else
- % check for left/right page
- \ifcase\linetablepage\donetrue\or\donetrue\or\donefalse\fi\ifdone
- % insert repeater
- \global\advance\linetablewidth\wd\tablebox\zerocount
- \iflinetablepreroll\kern\wd\else\unhcopy\fi\tablebox\zerocount
- \fi
- \fi \fi
- \fi
- \iflinetablepreroll \else
- \box\linetablecell
- % the columncounter is one ahead !
-% \hskip\linetablecparameter\c!afstand
-% \hskip\scratchskip
-\dorecurse\linetablestep{\strut\hfil}%
- \hskip\scratchskip
- \fi
- \fi}
-
-% \linetableparameter\c!var -> \@@levar (when no classes)
-
-\def\startlinetablerun % to do: quit when nested
- {\bgroup
- \inlinetabletrue
- % autowidth
- \doif{\linetableparameter\c!maxwidth}\v!fit
- {\setuplinetable[\c!maxwidth=\zeropoint]}%
- \processaction
- [\linetableparameter\c!stretch]
- [ \v!no=>{\setuplinetable[\c!stretch=\maxdimen]},% no stretch
- \v!yes=>{\setuplinetable[\c!stretch=\zeropoint]}]% max stretch
- \chardef\linetablerepeat\linetableparameter\c!nleft
- \chardef\linetablesplitstate % =
- \ifdim\linetableparameter\c!maxwidth>\zeropoint
- \zerocount \else \plusone
- \fi
- % optional prevdepth correction
- \iflinetablepreroll
- \globallet\noflinetablerows\!!zerocount
- \else
- \linetableparameter\c!before
- \fi
- \globallet\linetablerows\!!zerocount
- \globallet\noflinetablecolumns\!!zerocount
- \globallet\noflinetableparts\!!zerocount
- \!!counta\zerocount
- \def\docommand##1%
- {\doglobal\increment\noflinetableparts
- \advance\!!counta##1%
- \setxvalue{\??le::\noflinetableparts}{\the\!!counta}}%
- \processcommacommand[\linetableparameter\c!n]\docommand
- \initializetableboxes\noflinetableparts
- \ifcase\linetablerepeat
- \globallet\linetablepart\!!plusone
- \else
- \globallet\linetablepart\!!zerocount % repeater
- \fi
- \globallet\linetablestep\!!plusone
- \globallet\linetableline\!!zerocount
- \globallet\linetablerow \!!zerocount
- \global\linetablecolumn \zerocount
- \global\linetablesubcol \zerocount
- \global\linetablewidth \zeropoint
-\iflinetablepreroll \else \ifdim\pagetotal>\zeropoint
- \verticalstrut\kern-\struttotal
-\fi \fi
- \setnoftableslines
- \checklinetablepage
- \let\BR\linetableBR
- \let\ER\linetableER
- \let\BH\linetableBR
- \let\EH\linetableER
- \let\BC\linetableBC
- \let\EC\linetableEC
- \let\NC\linetableNC
- \let\NR\linetableNR
- \flushlinetablehead}
-
-\def\stoplinetablerun
- {\globallet\linetableline\!!maxcard
- \chardef\linetableheadstate\zerocount % blocked
- \flushlinetableparts
- \iflinetablepreroll \else
- \linetableparameter\c!after
- \fi
- \globallet\linetablepart \!!zerocount
- \globallet\noflinetableparts\!!zerocount
- \egroup}
-
-% \def\checklinecolumnwidth
-% {\ifundefined{\??lew\number\linetablecolumn}%
-% \donetrue
-% \else\ifdim\getvalue{\??lew\number\linetablecolumn}<\wd\linetablecell
-% \donetrue
-% \else
-% \donefalse
-% \fi\fi
-% \ifdone
-% \setxvalue{\??lew\number\linetablecolumn}{\the\wd\linetablecell}%
-% \fi}
-%
-% \def\checklinecolumnwidth
-% {\ifcsname\??lew\number\linetablecolumn\endcsname
-% \ifdim\csname\??lew\number\linetablecolumn\endcsname<\wd\linetablecell
-% \donetrue
-% \else
-% \donefalse
-% \fi
-% \else
-% \donetrue
-% \fi
-% \ifdone
-% \setxvalue{\??lew\number\linetablecolumn}{\the\wd\linetablecell}%
-% \fi}
-
-% \def\checklinecolumnwidth
-% {\expandafter\xdef\csname\??lew\number\linetablecolumn\endcsname
-% {\expandafter\ifx\csname\??lew\number\linetablecolumn\endcsname\relax
-% \the\wd\linetablecell
-% \else\ifdim\csname\??lew\number\linetablecolumn\endcsname<\wd\linetablecell
-% \the\wd\linetablecell
-% \else
-% \csname\??lew\number\linetablecolumn\endcsname
-% \fi\fi}}
-
-\def\checklinecolumndimension#1#2#3%
- {\expandafter\xdef\csname#1\number#3\endcsname
- {\expandafter\ifx\csname#1\number#3\endcsname\relax
- \the#2\linetablecell
- \else\ifdim\csname#1\number#3\endcsname<#2\linetablecell
- \the#2\linetablecell
- \else
- \csname#1\number#3\endcsname
- \fi\fi}}
-
-\def\checklinecolumnwidth {\checklinecolumndimension\??lew\wd\linetablecolumn}
-\def\checklinecolumnheight{\checklinecolumndimension\??leh\ht\linetablerow}
-\def\checklinecolumndepth {\checklinecolumndimension\??led\dp\linetablerow}
-
-\def\linetableBR
- {\dosingleempty\dolinetableBR}
-
-\def\dolinetableBR[#1]% #1 not yet implemented
- {\ifnum\linetableheadstate=1\else
- \doglobal\increment\linetablerow
- \doglobal\increment\linetablerows
- \fi
- \global\linetablecolumn\plusone
- \global\linetablesubcol\plusone
-% \linetableheight\linetablerparameter\c!height
-%
-% \ifx\linetableheight\empty
-% % nothing
-% \else\ifx\linetableheight\v!fit
-% % keep it simple
-% \else\ifx\linetableheight\v!line
-% \chardef\linetablemode\plusone
-% \else
-% \!!heighta\linetableheight
-% \advance\!!heighta-\strutdepth
-% \fi\fi\fi
-%
- \linetableheight\zeropoint
- \edef\!!stringa{\linetablerparameter\c!height}%
- \ifx\!!stringa\empty
- \chardef\linetablehmode\zerocount
- \else\ifx\!!stringa\v!fit
- \chardef\linetablehmode\plusone
- \else\ifx\!!stringa\v!line
- \chardef\linetablehmode\plustwo
- \else
- \linetableheight\!!stringa
- \advance\linetableheight-\strutdepth
- \fi\fi\fi
-%
- \startlinetablepart}
-
-\def\linetableBC
- {\startlinetablecell}
-
-\def\linetableEC
- {\stoplinetablecell
- \iflinetablepreroll
- \checklinecolumnwidth
- \checklinecolumnheight
- \checklinecolumndepth
- \fi
- \checklinetablepart}
-
-\def\linetableER
- {% \stoplinetablecell
- % no \box\linetablecell, i.e. dummy columnn, last \NC \NR
- \stoplinetablepart
- \savelinetablepart
- \advance\linetablecolumn \minusone
- \ifnum\linetablecolumn>\noflinetablecolumns
- \xdef\noflinetablecolumns{\number\linetablecolumn}%
- \fi
- \flushlinetableparts
- \global\linetablecolumn\zerocount
- \global\linetablewidth \zeropoint
- \ifcase\linetablerepeat
- \globallet\linetablepart\!!plusone
- \else
- \globallet\linetablepart\!!zerocount % repeater
- \fi
- \checklinetablepage
- \flushlinetablehead}
-
-\def\checklinetablepage
- {\global\chardef\linetablepage\zerocount
- \ifcase\linetablerepeat \else \ifcase\linetablepage
- \doif{\linetableparameter\c!repeat}\v!no
- {\global\chardef\linetablepage\doifoddpageelse\plusone\plustwo}%
- \fi \fi}
-
-\def\flushlinetablehead
- {\ifcase\linetableheadstate
- % 0 blocked
- \or
- % 1 doing head
- \or
- % 2 head done
- \or
- % 3 trigger flush
- \chardef\linetableheadstate\plusone
- \the\@@linetablehead\relax
- \chardef\linetableheadstate\plustwo
- \fi}
-
-\def\linetableNC % first time special treatment
- {\relax
- \ifcase\linetablecolumn
- \linetableBR
- \else
- \linetableEC
- \fi
- \linetableBC} % beware, this will result in BR BC EC BC NR
-
-\def\linetableNR
- {\stoplinetablecell % dummy
- \linetableER}
-
-\def\startlinetable
- {\startlinetablerun}
-
-\def\stoplinetable
- {\stoplinetablerun}
-
-\def\startlinetableanalysis
- {\bgroup
- \linetableprerolltrue
- \trialtypesettingtrue
- \startlinetablerun}
-
-\def\stoplinetableanalysis
- {\stoplinetablerun
- \egroup
- \globallet\noflinetablerows\linetablerows
- \dorecurse\noflinetablerows % global, from last run {\linetableparameter\c!n}
- {%\writestatus{linetable}{\recurselevel->\getvalue{\??lew\recurselevel}}%
- \setevalue{\??ler\recurselevel x\c!height}{\getvalue{\??leh\recurselevel}}%
- \setevalue{\??ler\recurselevel x\c!depth }{\getvalue{\??led\recurselevel}}%
- \letgvalue{\??leh\recurselevel}\!!zeropoint
- \letgvalue{\??led\recurselevel}\!!zeropoint}
- \dorecurse\noflinetablecolumns % global, from last run {\linetableparameter\c!n}
- {%\writestatus{linetable}{\recurselevel->\getvalue{\??lew\recurselevel}}%
- \setevalue{\??lec\recurselevel\c!width}{\getvalue{\??lew\recurselevel}}%
- \letgvalue{\??lew\recurselevel}\!!zeropoint}} % init next table
-
-% todo: store in box instead of macro
-
-\newtoks \@@linetablehead
-
-\long\def\startlinetablehead#1\stoplinetablehead
- {\ifinlinetable
- \@@linetablehead\emptytoks
- \fi
- \chardef\linetableheadstate3 % full
- \@@linetablehead{#1}%
- \ifinlinetable
- \flushlinetablehead
- \fi}
-
-\def\linetableBH
- {\ifx\EC\relax
- % signal, grabbing lines
- \else
- \@@linetablehead\emptytoks
- \fi
- \pushmacro\BC
- \pushmacro\EC
- \def\BC##1\EC{\appendtoks##1\to\@@linetablehead}%
- \let\EC\relax} % signal
-
-\def\linetableEH
- {\popmacro\EC
- \popmacro\BC
- \@EA\startlinetablehead\the\@@linetablehead\stoplinetablehead}
-
-\let\startlinetablebody\donothing
-\let\stoplinetablebody \donothing
-
-\def\processlinetablebuffer
- {\dosingleempty\doprocesslinetablebuffer}
-
-\def\doprocesslinetablebuffer[#1]%
- {\bgroup
- \let\startlinetable\donothing
- \let\stoplinetable \donothing
- \startlinetableanalysis\getbuffer[#1]\stoplinetableanalysis
- \startlinetablerun \getbuffer[#1]\stoplinetablerun
- \egroup}
-
-\def\processlinetablefile#1%
- {\bgroup
- \let\startlinetable\donothing
- \let\stoplinetable \donothing
- \startlinetableanalysis\readfile{#1}\donothing\donothing\stoplinetableanalysis
- \startlinetablerun \readfile{#1}\donothing\donothing\stoplinetablerun
- \egroup}
-
-% will go away:
-
-\def\processlinetableXMLfile#1%
- {\bgroup
- \let\startlinetable\donothing
- \let\stoplinetable \donothing
- \startlinetableanalysis\processXMLfile{#1}\stoplinetableanalysis
- \startlinetablerun \processXMLfile{#1}\stoplinetablerun
- \egroup}
-
-\protect \endinput
-
-\doifnotmode{demo}{\endinput}
-
-\setuplinetable[n=6,m={2,2,2},lines=25] % m ?
-
-\setuplinetable[c][1] [width=2cm,background=color,backgroundcolor=red]
-\setuplinetable[c][4] [width=3cm,background=color,backgroundcolor=yellow]
-\setuplinetable[c][6] [width=3cm,background=color,backgroundcolor=magenta]
-\setuplinetable[r][odd] [background=color,backgroundcolor=gray]
-\setuplinetable[r][even][background=color,backgroundcolor=green]
-
-\starttext
-
-\showframe \showstruts
-
-\setupcolors[state=start]
-
-\setuppagenumbering[alternative=doublesided]\page[left]
-
-\startlinetable
-\NC aaa\crlf aaa \NC bb \NC c \NC ddddd \NC eeee \NC ff \NC \NR
-\dorecurse{100}{\NC aaa \NC bb \NC c \NC ddddd \NC eeee \NC ff \NC \NR}
-\stoplinetable
-
-\startlinetable
-\NC[style=slanted,color=green,background=color,backgroundcolor=darkred,nx=2,uitlijnen=middle] xxx
- \NC yy \NC ddddd \NC eeee \NC ff \NC \NR
-\dorecurse{100}{\NC aaa \NC bb \NC c \NC ddddd \NC eeee \NC ff \NC \NR}
-\stoplinetable
-
-% \startbuffer[lt]
-% \NC aaa\crlf aaa \NC bb \NC c \NC ddddd \NC ee \NC ff \NC \NR
-% \NC aaa\crlf aaa \NC b \NC cc \NC ddd \NC eeee \NC f \NC \NR
-% \stopbuffer
-%
-% \processlinetablebuffer[lt]
-
-\stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkii/tabl-ntb.mkii b/Master/texmf-dist/tex/context/base/mkii/tabl-ntb.mkii
deleted file mode 100644
index fbf43eb1edc..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/tabl-ntb.mkii
+++ /dev/null
@@ -1,1611 +0,0 @@
-%D \module
-%D [ file=core-ntb,
-%D version=2000.04.18,
-%D title=\CONTEXT\ Table Macros,
-%D subtitle=Natural Tables,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 an unfinished, preliminary module. At least two
-%D runs are needed to get the table fixed. Ugly code.
-
-% todo: special parsetb for argless variant
-% todo: protect \tbl...
-% todo: tblnx also count
-% todo: get rid of recurse
-% todo: fast if
-% todo: avoid halign (just do it manual) and thereby globals
-
-% optie=rek beschrijven
-
-\writestatus{loading}{ConTeXt Table Macros / Natural Tables}
-
-%D As always, this is the nth version. Much time went in
-%D trying to speed up the many cell calculations, some
-%D optimizations were rejected in order not to complicate this
-%D module too much (and in order to prevail extensibility).
-
-% shapebox fails here in mkii
-%
-% \setupcolors[state=start]
-% \bTABLE
-% \bTR [align=middle]\bTH Range\eTH{}\bTH Value\eTH{}\eTR
-% \bTR \bTD \type{<} 12\eTD{}\bTD 3\eTD{}\eTR
-% \bTR \bTD 12--16\eTD{}\bTD 2\eTD{}\eTR
-% \bTR \bTD \type{>}16\eTD{}\bTD 1\eTD{}\eTR
-% \eTABLE
-
-% \starttext
-% \placefigure[left]{}{}
-% \startlinecorrection \dontleavehmode \bTABLE
-% \bTR \bTD oeps \eTD \eTR
-% \eTABLE
-% \stoplinecorrection
-% \placefigure[right]{}{}
-% \startlinecorrection \dontleavehmode \bTABLE
-% \bTR \bTD oeps \eTD \eTR
-% \eTABLE
-% \stoplinecorrection
-% \stoptext
-
-%D To Do:
-%D
-%D \starttyping
-%D splitsen = ja | herhaal => als nofTH>1 then ja als herhaal
-%D \stoptyping
-
-%D To Do:
-%D
-%D \starttyping
-%D break over pagina
-%D kop herhalen
-%D reset settings
-%D
-%D \setupTABLE [c|column|x] [nx|odd|even|first|last][a=b]
-%D \setupTABLE [r|row |y] [nx|odd|even|first|last][a=b]
-%D \setupTABLE [nx|odd|even|first|last][ny|odd|even|first|last][a=b]
-%D \setupTABLE [nx|odd|even|first|last] [a=b]
-%D \setupTABLE [a=b]
-%D
-%D \bTH \eTH
-%D \stoptyping
-
-% the section setup does not work yet, data needs to be stored,
-% i.e.each row should know if it's a head/body/foot, and there
-% should be \setupTABLE[head]... and alike
-
-\unprotect
-
-%D A simple way to force equal line spacing is to say:
-%D
-%D \starttyping
-%D \def\bTBLCELL{\begstrut}
-%D \def\eTBLCELL{\endstrut}
-%D \stoptyping
-
-%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 \stopbuffer
-%D
-%D \typebuffer \getbuffer
-
-\def\bTBLCELL % why not \doinhibitblank
- {\inhibitblank
- \doconvertfont\tbltblstyle\empty
- \everypar{\tbltblleft\delayedbegstrut}}
-
-\def\eTBLCELL
- {\ifhmode
- \delayedendstrut
- \tbltblright
- \par % added 13/4/2006
- \else
- % not sure yet:\tbltblright
- \par
- \ifdim\prevdepth<\zeropoint % =-1000pt ?
- \vskip-\strutdp
- \else
- \removebottomthings
- \fi
- \fi}
-
-\newcount\currenttbl
-
-\def\@@tbl{tbl} \def\tblcell{1} \def\tblnone{2}
-
-\def\@@tblprefix{tbl:} \let\@@rawtblprefix\@@tblprefix
-
-%D This should be done more efficient: soon
-
-% \let as well as \expandafter\edef's
-
-\newcounter\TBLlevel
-
-\def\@@tblprefix{\@@tbl:\ifnum\TBLlevel>1 :\TBLlevel:\fi}
-
-% \def\tblsetprefix % not yet used, figure out when .. may interfere with setup
-% {\edef\@@tblprefix{\@@tbl:\ifnum\TBLlevel>1 :\TBLlevel:\fi}}
-
-\def\settblnob#1{\expandafter\let\csname\@@tblprefix\number#1:b\endcsname\plusone}
-\def\gettblnob#1{\ifcsname\@@tblprefix\number#1:b\endcsname\plusone\else\zerocount\fi}
-
-\def\settbltag#1#2{\expandafter\edef\csname\@@tblprefix\number#1:\number#2:s\endcsname}
-\def\settblcol#1#2{\expandafter\edef\csname\@@tblprefix\number#1:\number#2:c\endcsname}
-\def\settblrow#1#2{\expandafter\edef\csname\@@tblprefix\number#1:\number#2:r\endcsname}
-
-\def\lettbltag#1#2{\expandafter\let\csname\@@tblprefix\number#1:\number#2:s\endcsname}
-\def\lettblcol#1#2{\expandafter\let\csname\@@tblprefix\number#1:\number#2:c\endcsname}
-\def\lettblrow#1#2{\expandafter\let\csname\@@tblprefix\number#1:\number#2:r\endcsname}
-
-\def\settblwd#1#2{\expandafter\xdef\csname\@@tblprefix\number#1:\number#2:wd\endcsname} % global !
-\def\settblht#1#2{\expandafter\xdef\csname\@@tblprefix\number#1:\number#2:ht\endcsname} % global !
-\def\lettblwd#1#2{\global\expandafter\let\csname\@@tblprefix\number#1:\number#2:wd\endcsname} % global !
-\def\lettblht#1#2{\global\expandafter\let\csname\@@tblprefix\number#1:\number#2:ht\endcsname} % global !
-
-\def\gettbltag#1#2{\csname\@@tblprefix\number#1:\number#2:s\endcsname}
-\def\gettblcol#1#2{\csname\@@tblprefix\number#1:\number#2:c\endcsname}
-\def\gettblrow#1#2{\csname\@@tblprefix\number#1:\number#2:r\endcsname}
-
-\def\gettblwd #1#2{\csname\@@tblprefix\number#1:\number#2:wd\endcsname}
-\def\gettblht #1#2{\csname\@@tblprefix\number#1:\number#2:ht\endcsname}
-
-\def\settblwid#1{\expandafter\xdef\csname\@@tblprefix\number#1:w\endcsname} % {#2} global !
-\def\settblhei#1{\expandafter\xdef\csname\@@tblprefix\number#1:h\endcsname} % {#2} global !
-\def\settbldis#1{\expandafter\xdef\csname\@@tblprefix\number#1:d\endcsname} % {#2} global !
-\def\settblaut#1{\expandafter\xdef\csname\@@tblprefix\number#1:a\endcsname} % {#2} global !
-
-\def\lettblwid#1{\global\expandafter\let\csname\@@tblprefix\number#1:w\endcsname} % {#2} global !
-\def\lettblhei#1{\global\expandafter\let\csname\@@tblprefix\number#1:h\endcsname} % {#2} global !
-\def\lettbldis#1{\global\expandafter\let\csname\@@tblprefix\number#1:d\endcsname} % {#2} global !
-\def\lettblaut#1{\global\expandafter\let\csname\@@tblprefix\number#1:a\endcsname} % {#2} global !
-
-\def\gettblwid#1{\ifcsname\@@tblprefix\number#1:w\endcsname\csname\@@tblprefix\number#1:w\endcsname\else\zeropoint\fi}
-\def\gettblhei#1{\ifcsname\@@tblprefix\number#1:h\endcsname\csname\@@tblprefix\number#1:h\endcsname\else\zeropoint\fi}
-\def\gettbldis#1{\ifcsname\@@tblprefix\number#1:d\endcsname\csname\@@tblprefix\number#1:d\endcsname\else\zeropoint\fi}
-\def\gettblaut#1{\csname \@@tblprefix\number#1:a\endcsname}
-
-\def\doiftbltag #1#2{\ifcsname\@@tblprefix\number#1:\number#2:s\endcsname\@EA\firstofoneargument \else\@EA\gobbleoneargument \fi}
-\def\doifnottbltag #1#2{\ifcsname\@@tblprefix\number#1:\number#2:s\endcsname\@EA\gobbleoneargument \else\@EA\firstofoneargument \fi}
-\def\doifelsetbltag#1#2{\ifcsname\@@tblprefix\number#1:\number#2:s\endcsname\@EA\firstoftwoarguments\else\@EA\secondoftwoarguments\fi}
-\def\doiftblrow #1#2{\ifcsname\@@tblprefix\number#1:\number#2:r\endcsname\@EA\firstofoneargument \else\@EA\gobbleoneargument \fi}
-\def\doiftblcol #1#2{\ifcsname\@@tblprefix\number#1:\number#2:c\endcsname\@EA\firstofoneargument \else\@EA\gobbleoneargument \fi}
-\def\doifnottblcol #1#2{\ifcsname\@@tblprefix\number#1:\number#2:c\endcsname\@EA\gobbleoneargument \else\@EA\firstofoneargument \fi}
-
-\def\tbltagstate#1#2{\ifcsname\@@tblprefix\number#1:\number#2:s\endcsname\zerocount\else\plusone\fi}
-\def\tblrowstate#1#2{\ifcsname\@@tblprefix\number#1:\number#2:r\endcsname\zerocount\else\plusone\fi}
-\def\tblcolstate#1#2{\ifcsname\@@tblprefix\number#1:\number#2:c\endcsname\zerocount\else\plusone\fi}
-
-\def\settblspn #1{\expandafter\let\csname\@@tblprefix\number#1:s\endcsname \!!plusone}
-\def\doifelsetblspn#1{\doifelse {\csname\@@tblprefix\number#1:s\endcsname}\!!plusone}
-% \def\doifelsetblspn#1{\@EA\ifx\csname\@@tblprefix\number#1:s\endcsname\plusone\@EA\firstoftwoarguments\else\@EA\secondoftwoarguments\fi}
-
-\def\settblspn #1{\setvalue {\@@tblprefix\number#1:s}{1}}
-\def\doifelsetblspn#1{\doifelsevalue{\@@tblprefix\number#1:s}{1}}
-
-% \long\def\settbltxt#1#2#3%
-% {\setxvalue{\@@tblprefix#1:#2:l}{\TBLlevel}%
-% \long\setvalue{\@@tblprefix#1:#2:t}%
-% {\doifdefined{\@@tblprefix#1:#2:l}
-% {\edef\TBLlevel{\getvalue{\@@tblprefix#1:#2:l}}}%
-% #3}}
-
-\long\def\settbltxt#1#2#3%
- {\long\@EA\def\csname\@@tblprefix\number#1:\number#2:t\@EA\endcsname\@EA{\@EA\def\@EA\TBLlevel\@EA{\TBLlevel}#3}}
-
-\def\gettbltxt#1#2%
- {\csname\@@tblprefix\number#1:\number#2:t\endcsname}
-
-\newtoks\tbltoks
-\newtoks\tblrowtoks
-
-\let\pushTBLparameters\relax
-\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
-\newif\ifautoTBLemptycell \autoTBLemptycelltrue
-\newif\ifautoTBLcheckwidth \autoTBLcheckwidthtrue
-\newif\ifappendTBLsetups \appendTBLsetupstrue
-\newif\ifenableTBLbreak \enableTBLbreakfalse
-\newif\ifmultipleTBLheads \multipleTBLheadsfalse
-
-\newif\iftraceTABLE \traceTABLEfalse
-
-\def\noftblheadlines{0}
-\def\noftblnextlines{0}
-\def\noftblhdnxlines{0}
-
-\presetlocalframed[\@@tbl\@@tbl]
-
-\long\def\handleTBLcell#1#2[#3]{}
-
-\long\def\bTC#1\eTC{\bTD#1\eTD}
-\long\def\bTX#1\eTX{\bTD#1\eTD}
-\long\def\bTY#1\eTY{\bTR#1\eTR}
-
-\let\getTABLEparameters\getparameters
-
-\unexpanded\def\setupTABLE
- {\dotripleempty\dosetupTABLE}
-
-\def\dosetupTABLE[#1][#2][#3]%
- {\ifthirdargument
- \processaction
- [#1]
- [ \v!row=>{\dosetupTABLExy[\c!y][#2][#3]},%
- \v!column=>{\dosetupTABLExy[\c!x][#2][#3]},%
- r=>{\dosetupTABLExy[\c!y][#2][#3]},%
- c=>{\dosetupTABLExy[\c!x][#2][#3]},%
- y=>{\dosetupTABLExy[\c!y][#2][#3]},%
- x=>{\dosetupTABLExy[\c!x][#2][#3]},%
- \v!start=>{\dosetupTABLExy[#1][#2][#3]},%
- \v!header=>{\dosetupTABLExy[#1][#2][#3]},%
- \s!unknown=>{\dosetupTABLEzz[#1][#2][#3]}]%
- \else\ifsecondargument
- \processaction
- [#1]
- [ \v!row=>{\dosetupTABLExy[\c!y][\v!each][#2]},%
- \v!column=>{\dosetupTABLExy[\c!x][\v!each][#2]},%
- r=>{\dosetupTABLExy[\c!y][\v!each][#2]},%
- c=>{\dosetupTABLExy[\c!x][\v!each][#2]},%
- y=>{\dosetupTABLExy[\c!y][\v!each][#2]},%
- x=>{\dosetupTABLExy[\c!x][\v!each][#2]},%
- \v!start=>{\dosetupTABLExy[#1][\v!each][#2]},%
- \v!header=>{\dosetupTABLExy[#1][\v!each][#2]},%
- \s!unknown=>{\dosetupTABLEzz[\c!x][#1][#2]}]%
- \else
- \getparameters[\@@tbl\@@tbl][#1]%
- \fi\fi}
-
-\def\dosetupTABLExy[#1][#2][#3]%
- {\def\dodosetupTABLE##1{\setTABLEparameters[#1##1][#3]}%
- \processcommalist[#2]\dodosetupTABLE}
-
-\def\dosetupTABLEzz[#1][#2][#3]%
- {\def\dodosetupTABLE##1%
- {\def\dododosetupTABLE####1{\setTABLEparameters[\c!x##1\c!y####1][#3]}%
- \processcommalist[#2]\dododosetupTABLE}%
- \processcommalist[#1]\dodosetupTABLE}
-
-\def\nopTABLEparameters[#1][#2]%
- {\letvalue{\@@tblprefix#1}\empty}
-
-\def\setTABLEparameters[#1][#2]%
- {\pushTBLparameters
- \ifappendTBLsetups
- \doifdefinedelse{\@@tblprefix#1}
- {\def\getTABLEparameters[##1][##2]%
- {\setvalue{\@@tblprefix#1}{\getTABLEparameters[\@@tbl\@@tbl][##2,#2]}}%
- \getvalue{\@@tblprefix#1}%
- \let\getTABLEparameters\getparameters}
- {\setvalue{\@@tblprefix#1}{\getTABLEparameters[\@@tbl\@@tbl][#2]}}%
- \else
- \setvalue{\@@tblprefix#1}{\getTABLEparameters[\@@tbl\@@tbl][#2]}%
- \fi
- \popTBLparameters}
-
-\let\setupTBLsection\relax
-
-% % \setupTABLE [y] [first][background=color,backgroundcolor=blue,frame=off,bottomframe=on,topframe=on,framecolor=white]
-% \setupTABLE [first][first][backgroundcorner=2,corner=10,frame=on]
-% \setupTABLE [last] [first][backgroundcorner=4,corner=12,frame=on]
-%
-% \setupTABLE [row] [each] [background=color,backgroundcolor=blue,frame=on,framecolor=white]
-% \setupTABLE [first][2] [corner=8]
-% \setupTABLE [last] [2] [corner=5]
-% \setupTABLE [first][last] [corner=7]
-% \setupTABLE [last] [last] [corner=6]
-%
-% \startTEXpage
-% \bTABLE[frame=off,align=middle]
-% \bTR \bTD one \eTD \bTD two \eTD \bTD three \eTD \eTR
-% \bTR \bTD first \eTD \bTD second \eTD \bTD third \eTD \eTR
-% \bTR \bTD alpha \eTD \bTD beta \eTD \bTD gamma \eTD \eTR
-% \eTABLE
-% \stopTEXpage
-%
-% \setupTABLE [first] [two][corner=2] % special case
-% \setupTABLE [last] [two][corner=4] % special case
-%
-% % % \setupTABLE [one] [first] ... special case of span
-%
-% \startTEXpage
-% \bTABLE[frame=off,align=middle]
-% \bTR \bTD one \eTD \bTD two \eTD \bTD three \eTD \eTR
-% \bTR \bTD first \eTD \bTD second \eTD \bTD third \eTD \eTR
-% \eTABLE
-% \stopTEXpage
-
-\def\setupTBLcell#1#2% cell over col over row
- {\setupTBLsection % already forgotten
- \edef\positiverow{\number#1}%
- \edef\positivecol{\number#2}%
- \edef\negativerow{\the\numexpr-\maximumrow+#1+\minusone\relax}%
- \edef\negativecol{\the\numexpr-\maximumcol+#2+\minusone\relax}%
- % each each
- \csname\@@tblprefix\c!x\v!each\c!y\v!each\endcsname
- \csname\@@tblprefix\c!y\v!each\endcsname
- \csname\@@tblprefix\c!x\v!each\endcsname
- % odd even
- \csname\@@tblprefix\c!y\v!oddeven\positiverow\endcsname
- \csname\@@tblprefix\c!x\v!oddeven\positivecol\endcsname
- \csname\@@tblprefix\c!x\v!oddeven\positivecol\c!y\v!oddeven\positiverow\endcsname
- % row/col number combinations
- \ifcsname\@@tblprefix\c!y\positiverow\endcsname\csname\@@tblprefix\c!y\positiverow\endcsname\fi
- \ifcsname\@@tblprefix\c!y\negativerow\endcsname\csname\@@tblprefix\c!y\negativerow\endcsname\fi
- \csname\@@tbl\@@tbl\c!extras\endcsname
- \@EA\let\csname\@@tbl\@@tbl\c!extras\endcsname\relax % new, see x-fo
- \ifcsname\@@tblprefix\c!x\positivecol\endcsname\csname\@@tblprefix\c!x\positivecol\endcsname\fi
- \ifcsname\@@tblprefix\c!x\negativecol\endcsname\csname\@@tblprefix\c!x\negativecol\endcsname\fi
- \csname\@@tbl\@@tbl\c!extras\endcsname
- \@EA\let\csname\@@tbl\@@tbl\c!extras\endcsname\relax % new, see x-fo
- % first/last combinations
- \ifnum\positiverow=\plusone
- \csname\@@tblprefix\c!y\v!first\endcsname
- \ifcsname\@@tblprefix\c!x\positivecol\c!y\v!first\endcsname\csname\@@tblprefix\c!x\positivecol\c!y\v!first\endcsname\fi
- \fi
- \ifnum\positivecol=\plusone
- \csname\@@tblprefix\c!x\v!first\endcsname
- \ifcsname\@@tblprefix\c!x\v!first\c!y\positiverow\endcsname\csname\@@tblprefix\c!x\v!first\c!y\positiverow\endcsname\fi
- \fi
- \ifnum\positiverow=\maximumrow\relax
- \csname\@@tblprefix\c!y\v!last\endcsname
- \ifcsname\@@tblprefix\c!x\positivecol\c!y\v!last\endcsname\csname\@@tblprefix\c!x\positivecol\c!y\v!last\endcsname\fi
- \fi
- \ifnum\positivecol=\maximumcol\relax
- \csname\@@tblprefix\c!x\v!last\endcsname
- \ifcsname\@@tblprefix\c!x\v!last\c!y\positiverow\endcsname\csname\@@tblprefix\c!x\v!last\c!y\positiverow\endcsname\fi
- \fi
- \ifnum\positiverow=\maximumrow\relax \ifnum\positivecol=\maximumcol\relax
- \csname\@@tblprefix\c!x\v!last\c!y\v!last\endcsname
- \fi\fi
- \ifnum\positiverow=\plusone \ifnum\positivecol=\plusone
- \csname\@@tblprefix\c!x\v!first\c!y\v!first\endcsname
- \fi\fi
- \ifnum\positiverow=\plusone \ifnum\positivecol=\maximumcol\relax
- \csname\@@tblprefix\c!x\v!last\c!y\v!first\endcsname
- \fi\fi
- \ifnum\positiverow=\maximumrow\relax \ifnum\positivecol=\plusone
- \csname\@@tblprefix\c!x\v!first\c!y\v!last\endcsname
- \fi\fi
- % special case: two rows and last row : two&first and two&last (round corners)
- \ifnum\maximumrow=\plustwo\relax
- \ifnum\positiverow=\maximumrow\relax \ifnum\positivecol=\plusone
- \csname\@@tblprefix\c!x\v!first\c!y\v!two\endcsname
- \fi\fi
- \ifnum\positiverow=\maximumrow\relax \ifnum\positivecol=\maximumcol\relax
- \csname\@@tblprefix\c!x\v!last\c!y\v!two\endcsname
- \fi\fi
- \fi
- \ifnum\gettblcol\positiverow\positivecol=\maximumcol\relax % top span over whole width
- \ifnum\positiverow=\plusone
- \csname\@@tblprefix\c!x\v!one\c!y\v!first\endcsname
- \fi
- \ifnum\positiverow=\maximumrow\relax
- \csname\@@tblprefix\c!x\v!one\c!y\v!last\endcsname
- \fi
- \fi
- % header things
- \ifnum#1>\noftblhdnxlines\else
- \ifcsname\@@tblprefix\v!header\v!each \endcsname\csname\@@tblprefix\v!header\v!each \endcsname\fi
- \ifcsname\@@tblprefix\v!header\positivecol\endcsname\csname\@@tblprefix\v!header\positivecol\endcsname\fi
- \fi
- % explicit cells
- \ifcsname\@@tblprefix\c!x\positivecol\c!y\positiverow\endcsname\csname\@@tblprefix\c!x\positivecol\c!y\positiverow\endcsname\fi
- \ifcsname\@@tblprefix\c!x\negativecol\c!y\negativerow\endcsname\csname\@@tblprefix\c!x\negativecol\c!y\negativerow\endcsname\fi
- % done
- \global\letcscsname\@@tblsplitafter \csname\@@tbl\@@tbl\c!after \endcsname
- \global\letcscsname\@@tblsplitbefore \csname\@@tbl\@@tbl\c!before \endcsname
- \global\letcscsname\@@tblsplitsamepage\csname\@@tbl\@@tbl\c!samepage\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
-\globallet\@@tblsplitbefore \relax
-\globallet\@@tblsplitsamepage\relax
-
-% split + page:
-%
-% \bTABLE[split=yes]
-% \bTR \bTD left \eTD\bTD right \eTD\eTR
-% \bTR[after=\page] \bTD left \eTD\bTD right \eTD\eTR
-% \bTR \bTD left \eTD\bTD right \eTD\eTR
-% \eTABLE
-
-% todo: protect counters
-
-\newcount\row \newcount\col
-\newcount\xrow \newcount\xcol
-\newcount\xxrow \newcount\xxcol
-\newcount\maximumrow \newcount\maximumcol \newcount\maximumrowspan
- \newcount\currentcol
-\newcount\tblspn
-
-\def\parseTR[#1][#2]% [#2] is dummy that kills spaces / no #3 argument
- {\currentcol\zerocount
- \advance\maximumrow\plusone
- \iffirstargument\setTABLEparameters[\c!y\number\maximumrow][#1]\fi}
-
-\def\settblref#1#2{\expandafter\xdef\csname\@@tblprefix\number#1:\number#2:x\endcsname}
-\def\gettblref#1#2{\ifcsname\@@tblprefix\number#1:\number#2:x\endcsname\csname\@@tblprefix\number#1:\number#2:x\endcsname\fi}
-
-\long\def\parseTD[#1][#2]#3\eTD % [#2] is dummy that kills spaces
- {\def\tblny{\tblnr}%
- \def\tblnx{\tblnc}%
- \let\tblnc\plusone
- \let\tblnr\plusone
- \let\tbln\currentcol
- \let\tblm\empty
- \iffirstargument
- \getparameters[\@@tbl][#1]%
- \fi
- % goto first cell % NEW, n/m=cellnumber
- \edef\@@tblnindeed{\csname\@@tbl\c!n\endcsname}%
- \ifx\@@tblnindeed\empty
- \global\advance\tblspn\tblnx\relax
- \else\ifnum\@@tblnindeed=\currentcol\else
- \scratchcounter\numexpr\@@tblnindeed-\currentcol+\minusone-\tblspn\relax
- \ifnum\scratchcounter>\zerocount
- \expanded{\parseTD[\c!nx=\the\scratchcounter,\c!n=,\c!m=,*sq=\v!no][]}\eTD
- \fi
- % can also be made faster
- \getparameters[\@@tbl][\c!ny=\tblnr,\c!nx=\tblnc,nc=1,nr=1,#1,\c!n=,\c!m=]%
- \fi\fi
- \edef\@@tblmindeed{\csname\@@tbl\c!m\endcsname}%
- \ifx\@@tblmindeed\empty \else
- \ifnum\@@tblmindeed=\currentcol \else
- \scratchcounter\numexpr\@@tblmindeed-\currentcol+\minusone-\tblspn\relax
- \dorecurse\scratchcounter{\expanded{\parseTD[\c!n=,\c!m=][]}\eTD}%
- % can be sped up
- \getparameters[\@@tbl][\c!ny=\tblnr,\c!nx=\tblnc,nc=1,nr=1,#1,\c!n=,\c!m=]%
- \fi
- \fi
- \doloop % skip over columns that result from earlier span
- {\advance\currentcol\plusone
- \doifnottbltag\maximumrow\currentcol\exitloop}%
- % == \def\next{\advance\currentcol\plusone\doiftbltag\maximumrow\currentcol\next}\next
- % fill r*c cells and set span
- \ifnum\tblnx=\plusone
- \ifnum\tblny=\plusone
- \ifnum\currentcol>\maximumcol\relax
- \maximumcol\currentcol
- \fi
- \else
- \presetTBLcell
- \fi
- \else
- \presetTBLcell
- \fi
- % set values
- \lettbltag\maximumrow\currentcol\tblcell
- \settblcol\maximumrow\currentcol{\number\tblnx}%
- \settblrow\maximumrow\currentcol{\number\tblny}%
- \settblref\maximumrow\currentcol{\ifcsname\@@tbl\c!action\endcsname\csname\@@tbl\c!action\endcsname\fi}%
- % save text
- \edef\celltag{{\number\maximumrow}{\number\currentcol}}%
- \@EA\settbltxt\@EA\maximumrow\@EA\currentcol\@EA{\@EA\handleTBLcell\celltag[#1]{#3}}}
-
-\def\presetTBLcell
- {\row\maximumrow
- \col\currentcol
- \dorecurse\tblny
- {\col\currentcol
- \settblcol\row\col{\number\tblnx}%
- \ifnum\tblnx>\maximumrowspan\relax
- \maximumrowspan\tblnx
- \fi
- \dorecurse\tblnx
- {\lettbltag\row\col\tblnone
- \advance\col\plusone}%
- \advance\row\plusone}%
- % check max column
- \advance\col\minusone
- \ifnum\col>\maximumcol\relax
- \maximumcol\col
- \fi}
-
-%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}
-
-%D new
-
-\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
-\newtoks\TBLfoot
-
-% to be done: head <raw> foot, dus state var
-
-\unexpanded\def\bTABLEhead{\dosingleempty\doTABLEhead} \let\eTABLEhead\relax
-\unexpanded\def\bTABLEnext{\dosingleempty\doTABLEnext} \let\eTABLEnext\relax
-\unexpanded\def\bTABLEbody{\dosingleempty\doTABLEbody} \let\eTABLEbody\relax
-\unexpanded\def\bTABLEfoot{\dosingleempty\doTABLEfoot} \let\eTABLEfoot\relax
-
-\long\def\doTABLEhead[#1]#2\eTABLEhead{\appendtoks\doTABLEsection[#1]{#2}\to\TBLhead}
-\long\def\doTABLEnext[#1]#2\eTABLEnext{\appendtoks\doTABLEsection[#1]{#2}\to\TBLnext}
-\long\def\doTABLEbody[#1]#2\eTABLEbody{\appendtoks\doTABLEsection[#1]{#2}\to\TBLbody}
-\long\def\doTABLEfoot[#1]#2\eTABLEfoot{\appendtoks\doTABLEsection[#1]{#2}\to\TBLfoot}
-
-
-\long\def\doTABLEsection[#1]#2%
- {\def\setupTBLsection{\getparameters[\@@tbl\@@tbl][#1]}%
- #2%
- \let\setupTBLsection\relax}
-
-\let\pushTBL\relax
-\let\popTBL \relax
-
-\chardef\tblpass=0
-
-\def\presetallTABLEparameters% each odd|even level / can be sped up but only once per table
- {\executeifdefined{\@@rawtblprefix\v!start\v!each}\relax
- \executeifdefined{\@@rawtblprefix\v!start\v!oddeven\TBLlevel}\relax
- \executeifdefined{\@@rawtblprefix\v!start\number\TBLlevel}\relax}
-
-\def\bTABLE
- {\dosingleempty\dobTABLE}
-
-\def\dobTABLE[#1]%
- {\pushTBL
- % box not here
- \bgroup
- \TBLhead\emptytoks
- \TBLnext\emptytoks
- \TBLbody\emptytoks
- \TBLfoot\emptytoks
- \ifhmode\kern\zeropoint\fi % blocks \removeunwantedspaces: check this on icare handelingsschema
- \resetcharacteralign % new
- \getparameters
- [\@@tbl\@@tbl]
- [\c!align={\v!right,\v!broad,\v!high},#1]%
- \hsize\tbltbltextwidth
- \processaction
- [\tbltblsplit]
- [ \v!yes=>\enableTBLbreaktrue,
- \v!repeat=>\enableTBLbreaktrue\multipleTBLheadstrue,
- \v!auto=>\ifinsidesplitfloat\enableTBLbreaktrue\fi]
- \processaction
- [\tbltblheader]
- [\v!repeat=>\multipleTBLheadstrue]%
- \localcolortrue
- \presetallTABLEparameters
- \ExpandFirstAfter\processallactionsinset
- [\tbltbloption]
- [\v!stretch=>\autoTBLspreadtrue]%
- \linewidth\tbltblrulethickness % needs to be frozen
- \dontcomplain
- \currentcol\zerocount
- \maximumrowspan\plusone
- \maximumcol\zerocount
- \maximumrow\zerocount
- \let\bTR\dobTR
- \let\bTD\dobTD
- \let\bTH\dobTH
- \let\bTN\dobTN}
-
-\unexpanded\def\dobTR{\dodoubleempty\parseTR}
-\unexpanded\def\dobTD{\dodoubleempty\parseTD}
-\unexpanded\def\dobTH{\dodoubleempty\parseTH}
-\unexpanded\def\dobTN{\dodoubleempty\parseTN}
-
-% permits \expanded{\bTD ... \eTD}
-
-\unexpanded\def\eTR{\ignorespaces}
-\unexpanded\def\eTD{\ignorespaces}
-\unexpanded\def\eTH{\ignorespaces}
-\unexpanded\def\eTN{\ignorespaces}
-
-\def\eTABLE % beware, we need to get rid of spurious spaces when in hmode
- {% tricky and dirty order -)
- \doifsometokselse\TBLhead % slow, better a flag
- {\the\TBLhead
- \edef\noftblheadlines{\number\maximumrow}%
- \doifsometokselse\TBLnext
- {\the\TBLnext
- \edef\noftblnextlines{\number\numexpr\maximumrow-\noftblheadlines\relax}}%
- {\let\noftblnextlines\zerocount}% was 1
- \edef\noftblhdnxlines{\number\maximumrow}}
- {\let\noftblheadlines\zerocount % was 1
- \let\noftblnextlines\zerocount
- \let\noftblhdnxlines\zerocount}%
- \the\TBLbody
- \the\TBLfoot
- \removeunwantedspaces % only if hmode
- % finish cells
- \dorecurse\maximumrow
- {\row\recurselevel\relax
- \dorecurse\maximumcol
- {\col\recurselevel\relax
- \doifnottbltag\row\col
- {\xxcol\col
- \xxrow\row
- \xrow\row
- \doloop
- {\xcol\col
- \doloop
- {\doifelsetbltag\xrow\xcol \exitloop
- {\advance\xcol\plusone
- \ifnum\xcol>\maximumcol\relax \exitloop \fi}}%
- \doifelsetbltag\xrow\xcol \exitloop
- {\xxrow\xrow \xxcol\xcol \advance\xrow\plusone
- \ifnum\xrow>\maximumrow \exitloop \fi}}%
- \ifnum\xxrow>\maximumrow\xxrow\maximumrow\fi
- \ifnum\xxcol>\maximumcol\xxcol\maximumcol\fi
- \xxrow\numexpr\xxrow-\row+\plusone\relax
- \xxcol\numexpr\xxcol-\col+\plusone\relax
- \xrow\row
- \dorecurse\xxrow
- {\xcol\col \settblcol\xrow\xcol{\number\xxcol}%
- \dorecurse\xxcol
- {\lettbltag\xrow\xcol\tblnone \advance\xcol\plusone}%
- \advance\xrow\plusone}%
- \lettbltag\row\col\tblcell
- \settblcol\row\col{\the\xxcol}%
- \settblrow\row\col{\the\xxrow}%
- \ifautoTBLemptycell
- \edef\celltag{{\number\row}{\number\col}}%
- \@EA\settbltxt\@EA\row\@EA\col\@EA{\@EA\handleTBLcell\celltag[]{\strut}}%
- \fi}}}%
- % to be sure
- \dorecurse\maximumrow
- {\row\recurselevel\relax
- \dorecurse\maximumcol
- {\col\recurselevel\relax
- \doiftblrow\row\col
- {\scratchcounter\numexpr\maximumrow-\row+\plusone\relax
- \ifnum\gettblrow\row\col>\scratchcounter
- \settblrow\row\col{\the\scratchcounter}%
- \fi}%
- \lettblht\row\col\zeropoint
- \lettblwd\row\col\zeropoint
- \doifnottblcol\row\col{\lettblcol\row\col\zerocount}%
- \doifnottbltag\row\col{\lettbltag\row\col\tblnone}}}%
- % check and do
- \ifcase\maximumcol\else
- \startTBLprocessing
- \begTBL
- \dorecurse\maximumrow
- {\bTBL
- \row\recurselevel\relax
- \dorecurse\maximumcol
- {\col\recurselevel\relax
- \expanded{\doTBL{\number\row}{\number\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}
-
-\let\startTBLprocessing\relax
-\let\stopTBLprocessing \relax
-
-\newcount\prelocatedTBLrows % \prelocateTBLrows{1000} may speed up large tables
-
-\def\bTBL{\tblrowtoks\emptytoks}
-\def\eTBL{\tbltoks\@EA\@EA\@EA{\@EA\the\@EA\tbltoks\@EA\begintblrow\the\tblrowtoks\endtblrow}}%
-
-\def\prelocateTBLerror
- {\writestatus\m!systems{fatal error: use \string\prelocateTBLrows\space to increase table memory (now: \number\prelocatedTBLrows)}}
-
-\def\prelocateTBLrows#1% we start at zero so we have one to much, better play safe anyway
- {\dostepwiserecurse\prelocatedTBLrows{#1}\plusone{\expandafter\newtoks\csname tbl:\recurselevel\endcsname}%
- \def\bTBL
- {\ifnum\tblrow<\prelocatedTBLrows\relax
- \@EA\let\@EA\tblrowtoks\csname tbl:\the\tblrow\endcsname\tblrowtoks\emptytoks
- \else
- \prelocateTBLerror
- \fi}%
- \def\eTBL
- {\tbltoks\@EA\@EA\@EA{\@EA\the\@EA\tbltoks\@EA\begintblrow\@EA\the\csname tbl:\the\tblrow\endcsname\endtblrow}}%
- \global\prelocatedTBLrows#1\relax}
-
-% \prelocateTBLrows{1000} % may speed up large tables
-
-% We use aligments to handle the empty (skipped) columns, so
-% that we don't have to (re|)|calculate these.
-
-\def\skiptblcol
- {\global\advance\tblcol\plusone}
-
-\def\nexttblcol
- {\global\advance\tblcol\plusone
- \kern\tbltblcolumndistance
- &}
-
-\def\spantblcol
- {\span}
-
-\newcount\tblrow
-\newcount\tblcol
-
-\let\savedtblrow\!!zerocount
-\let\savedtblcol\!!zerocount
-
-\def\begintblrow
- {\noalign
- {\global\advance\tblrow\plusone
- \global\tblcol\zerocount
- \global\tblspn\zerocount
- \bgroup % protect local vars
- \@@tblsplitbefore
- \egroup
- \ifx\@@tblsplitsamepage\v!before
- \unpenalty
- \nobreak
- \else\ifx\@@tblsplitsamepage\v!both
- \unpenalty
- \nobreak
- \fi\fi}%
- \nexttblcol
- \kern\dimexpr\tbltblleftmargindistance-\tbltblcolumndistance\relax}
-
-\def\endtblrow
- {\kern\dimexpr\tbltblrightmargindistance-\tbltblcolumndistance\relax
- \crcr
- \noalign
- {\nointerlineskip
- \ifnum\tblrow>\noftblheadlines
- \ifnum\gettblnob\tblrow=\zerocount
- \unpenalty
- \ifx\@@tblsplitsamepage\v!after
- \nobreak
- \else\ifx\@@tblsplitsamepage\v!both
- \nobreak
- \else
- \allowbreak
- \fi\fi
- \fi
- \else
- \allowbreak % else no proper head split off
- \fi
- \bgroup % protect local vars
- \@@tblsplitafter
- \egroup
- \bgroup % protect local vars
- \scratchcounter\numexpr\tblrow+\plusone\relax
- \ifnum\scratchcounter>\noftblhdnxlines\relax
- \ifnum\scratchcounter<\maximumrow\relax
- \doifsomething\tbltblspaceinbetween{\blank[\tbltblspaceinbetween]}%
- \fi
- \fi
- \egroup}}
-
-\def\begintbl
- {\global\tblspn\zerocount
- \global\tblcol\zerocount
- \global\tblrow\zerocount
- \global\advance\tblrow\minusone
- \tabskip\zeropoint
- \halign\bgroup
- \registerparoptions % new
- \ignorespaces##\unskip&&\ignorespaces##\unskip\cr}
-
-\def\endtbl
- {\egroup}
-
-\setvalue{\tblnone TBL}#1#2%
- {\spanTBL{#1}{#2}}
-
-\setvalue{\tblcell TBL}#1#2%
- {\tblrowtoks\expandafter{\the\tblrowtoks\makeTBL #1 #2 }% space delimited -> less tokens
- \spanTBL{#1}{#2}}
-
-\def\spanTBL#1#2%
- {\scratchcounter\gettblcol{#1}{#2}\relax
- \ifnum\scratchcounter>\zerocount
- \advance\scratchcounter \minusone
- \dorecurse\scratchcounter{\tblrowtoks\expandafter{\the\tblrowtoks\spantblcol}}%
- \dorecurse\scratchcounter{\tblrowtoks\expandafter{\the\tblrowtoks\skiptblcol}}%
- \tblrowtoks\expandafter{\the\tblrowtoks\nexttblcol}%
- \fi}
-
-\def\doTBL#1#2%
- {\csname\gettbltag{#1}{#2}TBL\endcsname{#1}{#2}}
-
-\def\begTBL
- {\global\tblspn\zerocount
- \global\tblrow\zerocount
- \global\tblcol\zerocount
- \chardef\tblpass\zerocount
- \tbltoks\emptytoks}
-
-\def\flushtbltoks{\begintbl\the\tbltoks\endtbl}
-
-\def\domakeTBLone#1 #2 %
- {\gettbltxt{#1}{#2}}%
-
-\def\domakeTBLtwo#1 #2 % meer in cellD
- {\scratchdimen\zeropoint
- \scratchcounter\tblcol
- \!!counta\gettblcol{#1}{#2}\relax
- \dorecurse\!!counta
- {\advance\scratchdimen\dimexpr\gettblwid\scratchcounter+\tbltblcolumndistance\relax
- \ifnum\recurselevel<\!!counta \advance\scratchdimen \gettbldis\scratchcounter\fi
- \advance\scratchcounter\plusone}%
- \edef\widthTBL{\the\dimexpr\scratchdimen-\tbltblcolumndistance\relax}%
- \setbox\scratchbox\hbox{\gettbltxt{#1}{#2}}%
- \settblht{#1}{#2}{\the\ht\scratchbox}%
- \settblwd{#1}{#2}{\the\wd\scratchbox}%
- \ifdim\ht\scratchbox>\gettblhei{#1}\relax
- \settblhei{#1}{\the\ht\scratchbox}%
- \fi}%
-
-\def\domakeTBLthree#1 #2 %
- {% height
- \!!counta \gettblcol{#1}{#2}\relax
- \!!countb \gettblrow{#1}{#2}\relax
- \!!heighta\gettblht {#1}{#2}\relax
- \scratchdimen\zeropoint
- \ifnum\!!counta=\maximumcol\relax
- % case: nc=maxcolumns
- \else
- \scratchcounter#1\relax
- \dorecurse\!!countb
- {\advance\scratchdimen
- \gettblhei\scratchcounter
- \advance\scratchcounter\plusone}%
- \ifdim\scratchdimen<\!!heighta\relax
- \scratchdimen\!!heighta
- \fi
- \fi
- \edef\heightTBL{\the\scratchdimen}%
- % width
- \scratchdimen\zeropoint
- \scratchcounter\tblcol
- \dorecurse\!!counta
- {\advance\scratchdimen\dimexpr\gettblwid\scratchcounter+\tbltblcolumndistance\relax
- \ifnum\recurselevel<\!!counta \advance\scratchdimen \gettbldis\scratchcounter\fi
- \advance\scratchcounter\plusone}%
- \edef\widthTBL{\the\dimexpr\scratchdimen-\tbltblcolumndistance\relax}%
- % cell
- \setbox\scratchbox\hbox{\gettbltxt{#1}{#2}}%
- \ifnum\!!counta=\maximumcol\relax
- % case: nc=maxcolumns
- \else
- \scratchdimen\gettblhei{#1}%
- \setbox\scratchbox\hbox
- {\lower\ht\scratchbox\hbox{\raise\scratchdimen\box\scratchbox}}%
- \ht\scratchbox\scratchdimen
- \fi
- \dp\scratchbox\zeropoint
- \edef\!!stringa{\gettblref{#1}{#2}}%
- \ifx\!!stringa\empty
- \box\scratchbox
- \else
- \expanded{\gotobox{\box\scratchbox}[\!!stringa]}%
- \fi
- \box\scratchbox}
-
-\def\inTBLcell#1#2% hm, do we need #1 #2 ? we use tblcol anyway
- {\ExpandBothAfter\doifinsetelse\localwidth{\v!fit,\v!broad} % user set
- {}
- {\scratchdimen\gettblaut\tblcol\relax
- \ifdim\localwidth>\scratchdimen
- \settblaut\tblcol{\the\dimexpr\localwidth\relax}%
- \fi}}%
-
-\def\endTBL
- {\setbox\scratchbox\hbox
- {\localframed
- [\@@tbl\@@tbl]
- [\c!frame=\v!off,\c!background=,\c!align=\v!no]
- {\strut}}%
- \edef\minimalcellheight{\the\ht\scratchbox}%
- \dorecurse\maximumcol
- {\lettblaut\recurselevel\zeropoint
- % new
- \xcol\recurselevel\relax
- \dorecurse\maximumrow
- {\lettblwd\recurselevel\xcol\zeropoint
- \lettblht\recurselevel\xcol\zeropoint}%
- % till here
- \lettblwid\recurselevel\zeropoint
- \lettbldis\recurselevel\zeropoint}%
- \dorecurse\maximumrow
- {\lettblhei\recurselevel\maxdimen}%
- \chardef\tblpass\plusone
- \let\makeTBL\domakeTBLone
- \let\handleTBLcell\dohandleTBLcellA
- \setbox0\vbox{\trialtypesettingtrue \flushtbltoks}%
-% \setbox\scratchbox\vbox{\trialtypesettingtrue \flushtbltoks}%
- \lettbldis\maximumcol\zeropoint
- \ifautoTBLspread
- % experimental, stretch non fixed cells to \hsize
- \checktblwidthsone % trial run
- \checktblwidthstwo % real run
- \stretchtblwidths
- \let\handleTBLcell\dohandleTBLcellB
- \setbox\scratchbox\vbox{\trialtypesettingtrue \flushtbltoks}%
- \else\ifdim\wd0>\hsize
- \ifautoTBLhsize
- \checktblwidthsone % trial run
- \checktblwidthstwo % real run
- \let\handleTBLcell\dohandleTBLcellB
- \setbox\scratchbox\vbox{\trialtypesettingtrue \flushtbltoks}%
- \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 \flushtbltoks}%
- \fi\fi\fi\fi
- \let\handleTBLcell\dohandleTBLcellD
- \chardef\tblpass\plustwo
- \let\makeTBL\domakeTBLtwo
- \setbox\scratchbox\vbox{\trialtypesettingtrue \flushtbltoks}%
- \checktblheightsone
- \checktblheightstwo
- \let\handleTBLcell\dohandleTBLcellE
- \chardef\tblpass\plusthree
- \let\makeTBL\domakeTBLthree
- \ifnum\TBLlevel>\plusone
- \@EA\notsplittblbox
- \else\ifenableTBLbreak
- \@EAEAEA\splittblbox
- \else
- \@EAEAEA\notsplittblbox
- \fi\fi{\flushtbltoks}}
-
-\def\stretchtblwidths % more variants, e.g. a max to \dimend
- {\ifcase\maximumcol\else % else division by zero
- \!!dimend\zeropoint
- \!!dimene\hsize
- \dorecurse\maximumcol
- {\advance\!!dimend\dimexpr\gettblwid\recurselevel+\tbltblcolumndistance\relax
- \advance\!!dimene-\gettbldis\recurselevel}%
- \advance\!!dimend\dimexpr-\tbltblcolumndistance+\tbltblleftmargindistance+\tbltblrightmargindistance\relax
- % distribute width (stretch)
- \ifdim\!!dimend<\!!dimene
- \advance\!!dimend-\!!dimene
- \!!dimend-\!!dimend
- \divide\!!dimend\maximumcol
- \dorecurse\maximumcol
- {\settblwid\recurselevel{\the\dimexpr\gettblwid\recurselevel+\!!dimend\relax}}%
- \fi
- \fi}
-
-\newbox\finaltblbox
-
-\def\notsplittblbox#1%
- {\setbox\finaltblbox\vbox{#1}%
- \postprocessTABLEbox\finaltblbox
- \beforeTABLEbox
- \box\finaltblbox
- \afterTABLEbox}
-
-\def\splittblbox#1%
- {\ifinsidesplitfloat
- \donetrue
- \else\ifinsidefloat
- \donefalse
- \else
- \donetrue
- \fi\fi
- \ifdone
- \executeifdefined{dosplittblbox\tbltblsplitmethod}\dosplittblbox{#1}%
- \else
- \notsplittblbox{#1}%
- \fi}
-
-\newbox\TABLEsplitbox % public, don't change
-
-\let\extratblsplitheight\zeropoint % additional space taken by before/afterTABLEsplitbox
-
-\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}%
- \ifmultipleTBLheads
- \dorecurse\noftblheadlines
- {\setbox\scratchbox\vsplit\tsplitcontent to \lineheight
- \setbox\tsplithead\vbox{\unvcopy\tsplithead\unvcopy\scratchbox}}%
- \dorecurse\noftblnextlines
- {\setbox\scratchbox\vsplit\tsplitcontent to \lineheight
- \setbox\tsplitnext\vbox{\unvcopy\tsplitnext\unvcopy\scratchbox}}%
- \fi
- \doifsomething\tbltblspaceinbetween
- {\def\tsplitinbetween{\blank[\tbltblspaceinbetween]}}%
- \def\postprocesstsplit{\postprocessTABLEsplitbox{\box\tsplitresult}}%
- \handletsplit}
-
-% ! ! ! ! TODO: naast \postprocessTABLEsplitbox ook evt \postprocessTABLEbox voor niet split
-
-\let\postprocessTABLEsplitbox\gobbleoneargument
-\let\postprocessTABLEbox \gobbleoneargument
-
-\let\beforeTABLEsplitbox\relax
-\let\afterTABLEsplitbox \relax
-\let\beforeTABLEbox \relax
-\let\afterTABLEbox \relax
-
-\def\checktblwidthsone{\dochecktblwidths0} % 0 = trial run
-\def\checktblwidthstwo{\dochecktblwidths1} % 1 = real run
-
-\def\dochecktblwidths#1%
- {\iftraceTABLE\showtblwids{B#1}\fi
- \!!counta\zerocount
- \!!dimena\dimexpr\hsize-\tbltblleftmargindistance-\tbltblrightmargindistance-\tbltblcolumndistance\relax
- \dorecurse\maximumcol
- {\scratchdimen\gettblaut\recurselevel\relax
- \advance\!!dimena-\gettbldis\recurselevel\relax
- \ifdim\scratchdimen>\zeropoint\relax
- \advance\!!dimena -\scratchdimen
- \else
- \scratchdimen\gettblwid\recurselevel\relax
- \ifdim\scratchdimen>\tbltblmaxwidth\relax
- \ifcase#1\else\lettblwid\recurselevel\zeropoint\fi
- \advance\!!counta \plusone
- \else
- \ifdim\scratchdimen>\zeropoint\relax
- \advance\!!dimena -\scratchdimen
- \else
- % eigenlijk moet dit alleen als de kolom wordt overspannen door een
- % vorige, maw extra dubbele loop en status var
- \advance\!!counta \plusone
- \fi
- \fi
- \fi}%
- \ifcase\!!counta \else \divide\!!dimena \!!counta \fi
- \dorecurse\maximumcol
- {\scratchdimen\gettblwid\recurselevel\relax
- \ifcase#1\relax
- \ifdim\scratchdimen<\!!dimena % take natural width
- \settblaut\recurselevel{\the\scratchdimen}%
- \fi
- \else
- \ifdim\scratchdimen=\zeropoint % auto set width
- \settblwid\recurselevel{\the\!!dimena}%
- \fi
- \fi}%
- \iftraceTABLE\showtblwids{E#1}\fi}
-
-\newcount\xrowTBL
-\newcount\xcolTBL
-\newcount\xxrowTBL
-
-% dikke arg naar recurse wegwerken
-
-\def\dochecktblheightsone
- {\!!countb\gettblrow\xrowTBL\xcolTBL\relax
- % check row span
- \ifnum\!!countb>\plusone
- % current height in row
- \dimen0=\gettblht\xrowTBL\xcolTBL
- % find nearest height in row
- \dimen2=\zeropoint
- \dorecurse\maximumcol
- {\ifnum\recurselevel=\xcolTBL\else
- \doiftblrow\xrowTBL\recurselevel
- {\!!countc=\gettblrow\xrowTBL\recurselevel\relax
- \ifnum\!!countc=\plusone
- \dimen4=\gettblht\xrowTBL\recurselevel\relax
- \ifdim\dimen2<\dimen4
- \dimen2=\dimen4
- \fi
- \fi}%
- \fi}%
- \xxrowTBL\xrowTBL
- % calculate cummulative height
- \dimen4=\dimen2
- \!!countc\xrowTBL
- \advance\!!countc\minusone
- \dorecurse\!!countb
- {\ifnum\xxrowTBL=\xrowTBL\else
- \advance\dimen4 \gettblhei\xxrowTBL
- \fi
- \ifnum\recurselevel=\!!countb\else
- \settblnob\!!countc
- \advance\!!countc\plusone
- \fi
- \advance\xxrowTBL\plusone}%
- % distribute overshoot equally
-\ifdim\dimen2>\zeropoint % see natural-003
- \ifdim\dimen4<\dimen0
- \advance\dimen0 -\dimen4
- \divide\dimen0 \!!countb
- \xxrowTBL\xrowTBL
- \settblhei\xrowTBL{\the\dimen2}%
- \dorecurse\!!countb
- {\dorecurse\maximumcol
- {\ifnum\recurselevel=\xcolTBL\else
- \scratchdimen\dimexpr\gettblht\xxrowTBL\recurselevel+\dimen0\relax
- \settblht\xxrowTBL\recurselevel{\the\scratchdimen}%
- \ifdim\gettblhei\xxrowTBL<\scratchdimen
- \settblhei\xxrowTBL{\the\scratchdimen}%
- \fi
- \fi}%
- \advance\xxrowTBL\plusone}%
- \else\ifdim\dimen4>\dimen0
- \settblhei\xrowTBL{\the\dimen2}%
- \fi\fi
-\fi
- \fi}
-
-\def\checktblheightsone
- {\dorecurse\maximumrow
- {\xrowTBL\recurselevel\relax
- \dorecurse\maximumcol
- {\xcolTBL\recurselevel\relax
- \doiftblrow\xrowTBL\xcolTBL\dochecktblheightsone}}}
-
-\def\checktblheightstwo
- {}
-
-\def\showtblwids#1%
- {\vbox
- {\forgetall\tttf[#1]\dorecurse\maximumcol
- {\scratchdimen\gettblwid\recurselevel\relax
- [\recurselevel:\the\scratchdimen]}}}
-
-\def\TBLcharalign
- {\doifelse\tbltblaligncharacter\v!yes
- \doTBLcharalign\gobbleoneargument}
-
-\long\def\doTBLcharalign#1#2% column data
- {\edef\alignmentclass{#1}%
- \edef\alignmentcharacter{\tbltblalignmentcharacter}%
- \ifcase\tblpass\or
- \setfirstpasscharacteralign\checkalignment{#2}% {\strut#2\unskip}%
- \fi % force hsize, so always a second
- \setsecondpasscharacteralign \checkalignment{#2}% {\strut#2\unskip}%
- \ignorespaces}
-
-% new, needed for icare first col of 'doeltabel', experimental
-
-\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
- {\bTBLCELL\TBLcharalign{#2}{#4}\eTBLCELL\inTBLcell{#1}{#2}}}%
- \scratchdimen\gettblwid\tblcol\relax
- \ifdim\wd\scratchbox>\scratchdimen
- \ifsqueezeTBLspan
- \ifautosqueezeTBLspan
- \doifinsetelse\tbltblwidth{\v!fit,\v!fixed,\v!broad,\v!local}
- \donetrue \donefalse
- \else
- \donetrue
- \fi
- \ifdone % brr, 0
- \ifnum\number\gettblcol{#1}{#2}>\plusone \settblspn\tblcol\fi
- \fi
- \fi
- \doifelsetblspn\tblcol
- \donothing
- {\ifdim\gettblwid\tblcol<\wd\scratchbox
- \settblwid\tblcol{\the\wd\scratchbox}%
- \fi}% auto set
- \fi
- \scratchcounter\numexpr\tblrow+\plusone\relax
- \scratchdimen\gettblhei\scratchcounter\relax
- \ifdim\ht\scratchbox<\scratchdimen
- \settblhei\scratchcounter{\the\ht\scratchbox}% auto set
- \fi
- \settblht{#1}{#2}{\the\ht\scratchbox}%
- \settblwd{#1}{#2}{\the\wd\scratchbox}%
- \ifautoTBLcheckwidth
- \ifdim\wd\scratchbox<.75\hsize
- \ifdim\ht\scratchbox>2\openlineheight % honor width since this
- \scratchdimen\gettblaut\tblcol\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
- \settblaut\tblcol{\the\scratchdimen}%
- \else\ifdim\wd\scratchbox>\scratchdimen
- % unless span
- \settblaut\tblcol{\the\wd\scratchbox}%
- % to be translated
- \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
- \egroup}
-
-\long\def\dohandleTBLcellBC#1#2#3[#4]#5%
- {\setbox\scratchbox\hbox
- {\setupTBLcell{#2}{#3}%
- \localframed
- [\@@tbl\@@tbl]
- [#4,#1,\c!frame=\v!off,\c!background=]
- {\bTBLCELL#5\eTBLCELL}}%
- \setbox2\null
- \wd2\wd\scratchbox \ht2\ht\scratchbox \dp2\dp\scratchbox
- \ifautoTBLrowspan
- \scratchcounter\numexpr\tblrow+\plusone\relax
- \doiftblrow\scratchcounter\tblcol
- {\scratchdimen\gettblhei\scratchcounter\relax % moved inside test
- \ifnum\gettblrow\scratchcounter\tblcol>\plusone \ifdim\ht\scratchbox>\scratchdimen
- \scratchdimen-\scratchdimen \advance\scratchdimen -\ht\scratchbox
- \ht2\scratchdimen
- \fi \fi}%
- \fi
- \box2 }
-
-\long\def\dohandleTBLcellB#1#2[#3]#4%
- {\scratchdimen\gettblaut\tblcol\relax
- \ifdim\scratchdimen>\zeropoint\relax
- \let\tblwidthkey\c!width
- \edef\tblwidth{\the\scratchdimen}%
- \else
- \scratchdimen\gettblwid\tblcol\relax
- \ifdim\scratchdimen>\zeropoint\relax
- \ifnum\gettblcol{#1}{#2}=\maximumcol\relax
- \scratchdimen\hsize
- \fi
- \let\tblwidthkey\c!width
- \edef\tblwidth{\the\scratchdimen}%
- \else
- \let\tblwidthkey\s!unknown
- \let\tblwidth\zeropoint
- \fi
- \fi
- \dohandleTBLcellBC{\tblwidthkey=\tblwidth}{#1}{#2}[#3]{\TBLcharalign{#2}{#4}}}
-
-\long\def\dohandleTBLcellC
- {\dohandleTBLcellBC{}}
-
-\long\def\dohandleTBLcellD#1#2[#3]#4%
- {\setupTBLcell{#1}{#2}%
- \bgroup
- \localframed
- [\@@tbl\@@tbl]
- [#3,\c!width=\widthTBL,\c!background=,\c!frame=\v!off]% 25% faster
- {\bTBLCELL\TBLcharalign{#2}{#4}\eTBLCELL}%
- \egroup}
-
-\long\def\dohandleTBLcellE#1#2[#3]#4%
- {\setupTBLcell{#1}{#2}%
- \getparameters[\@@tbl\@@tbl][#3]% to get the color right, the way we
- \color % handle color here prevents interference due to whatsit nodes
- [\tbltblcolor] % as well as permits local colors to take precedence
- {\ifdim\heightTBL=\zeropoint\relax % case: nc=maxcolumns
- \localframed
- [\@@tbl\@@tbl]
- [\c!color=,\c!width=\widthTBL]
- {\bTBLCELL\TBLcharalign{#2}{#4}\eTBLCELL}%
- \else
- \localframed
- [\@@tbl\@@tbl]
- [\c!color=,\c!width=\widthTBL,\c!height=\heightTBL]
- {\bTBLCELL\TBLcharalign{#2}{#4}\eTBLCELL}%
- \fi}%
- \hskip\gettbldis{#2}}
-
-\setupTABLE
- [\c!frameoffset=.5\linewidth,
- \c!backgroundoffset=\v!frame,
- \c!framecolor=\s!black,
- \c!color=,
- \c!style=,
- \c!headstyle=\v!bold,
- \c!headcolor=,
- \c!strut=\v!yes,
- \c!autostrut=\v!no,
- \c!aligncharacter=\v!no,
- \c!alignmentcharacter={,},
- \c!option=, % \v!stretch
- \c!header=,
- \c!spaceinbetween=,
- \c!maxwidth=8em,
- \c!textwidth=\hsize,
- \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,
-%D so we only have to pop in the right ones:
-
-%D New:
-
-\def\pushTBLparameters
- {\globalpushmacro\TBLlevel
- \ifcase\tblpass
- % we're just after \bTABLE
- \else\ifnum\TBLlevel>\zerocount
- \doglobal\increment\TBLlevel\relax
- \fi\fi}
-
-\def\popTBLparameters
- {\globalpopmacro\TBLlevel}
-
-\def\pushTBL
- {\ifnum\TBLlevel=\zerocount
- \global\advance\currenttbl\plusone
- \fi
- \doglobal\increment\TBLlevel\relax
- \ifnum\TBLlevel>\plusone
- \resetallTABLEparameters
- % we need a proper count push/pop
- \xdef\savedtblrow{\the\tblrow}\globalpushmacro\savedtblrow
- \xdef\savedtblcol{\the\tblcol}\globalpushmacro\savedtblcol
- \else
- \global\intabletrue
- \fi}
-
-\def\popTBL
- {\ifnum\TBLlevel>\plusone
- \globalpopmacro\savedtblrow\global\tblrow\savedtblrow
- \globalpopmacro\savedtblcol\global\tblcol\savedtblcol
- \else
- \global\intablefalse
- \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
- {\ifnum\TBLlevel>\plusone % in ieder geval
- \ifconditional\resetTABLEmode
- \presetlocalframed % breedte hoogte diepte offset
- [\@@tbl\@@tbl]% % achtergrond, achtergrondraster, achtergrondkleur
- % not ok yet
- \setupTABLE [%
- \c!frameoffset=.5\linewidth,
- \c!backgroundoffset=\v!frame,
- \c!framecolor=\s!black,
- \c!width=fit,
- \c!height=fit,
-\c!autowidth=\v!yes,
-% \c!rulethickness=\linewidth,
-% \c!strut=\v!no,
-\c!strut=\v!yes, % needed for mathml, but ... maybe we need another resetTABLEmode
-\c!autostrut=\v!no,
- \c!color=,
- \c!style=,
- \c!headstyle=,
- \c!headcolor=,
- \c!aligncharacter=\v!no,
- \c!alignmentcharacter={,},
- \c!maxwidth=8em]%
- \else
- \setupTABLE
- [\c!width=\v!fit,
- \c!height=\v!fit]%
- \fi
- \fi}
-
-%D Spacing:
-%
-% \starttabulate
-% \NC text \NC text \NC \NR
-% \TB[small]
-% \NC text \NC text \NC \NR
-% \TB[4*big]
-% \NC text \NC text \NC \NR
-% \stoptabulate
-%
-% \starttable[|||]
-% \VL text \VL text \VL \AR
-% \TB[small]
-% \VL text \VL text \VL \AR
-% \TB[4*big]
-% \VL text \VL text \VL \AR
-% \stoptable
-
-\def\complexTableTB[#1]{\TABLEnoalign{\blank[#1]}}
-\def\simpleTableTB {\TABLEnoalign{\blank}}
-
-\def\TabulateTB
- {\complexorsimpleTable{TB}}
-
-\def\doTableinterline% #1
- {\ifnum\currentTABLEcolumn>\maxTABLEcolumn
- \chuckTABLEautorow
- \else\ifnum\currentTABLEcolumn=\zerocount
- \TABLEnoalign
- {\globalletempty\checkTABLEautorow
- \globalletempty\chuckTABLEautorow}%
- \else
- \setTABLEerror\TABLEmissingcolumn
- \handleTABLEerror
- \fi\fi
- \complexorsimpleTable} % {#1}
-
-\def\TableHL{\doTableinterline{HL}}
-\def\TableTB{\doTableinterline{TB}}
-
-\appendtoks\let\TB\TableTB \to\everytable
-\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
-
-% todo: mode: first|next (of niets)
diff --git a/Master/texmf-dist/tex/context/base/mkii/tabl-nte.mkii b/Master/texmf-dist/tex/context/base/mkii/tabl-nte.mkii
deleted file mode 100644
index 6a5391f243b..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/tabl-nte.mkii
+++ /dev/null
@@ -1,107 +0,0 @@
-%D \module
-%D [ file=core-nte,
-%D version=2009.03.08,
-%D title=\CONTEXT\ Table Macros,
-%D subtitle=Natural Tables Extensions,
-%D author=Hans Hagen \& Wolfgang Schuster,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Table Module / Natural Tables Extensions}
-
-\unprotect
-
-%D This module is suggested by Wolfgang Schuster who also prototyped
-%D it and came up with the rationale:
-%D
-%D This module provides an easy way to use natural in a similiar
-%D way as the older table module (based on the \TABLE\ macros) and
-%D the newer tabulate module.
-%D
-%D You can see the advantage in the following table, once created
-%D with the new macros and once with the normal macros provided
-%D with the natural table module.
-%D
-%D Let us start with the original macros:
-%D
-%D \starttyping
-%D \bTABLE
-%D \bTR
-%D \bTD Text 1 \eTD
-%D \bTD Text 2 \eTD
-%D \eTR
-%D \bTR
-%D \bTD Text 3 \eTD
-%D \bTD Text 4 \eTD
-%D \eTR
-%D \eTABLE
-%D \stoptyping
-%D
-%D Watch how the new macros use less code:
-%D
-%D \starttyping
-%D \startTABLE
-%D \NC Text 1 \NC Text 2 \NC\NR
-%D \NC Text 3 \NC Text 4 \NC\NR
-%D \stopTABLE
-%D \stoptyping
-%D
-%D The actual code differs from the prototype that it does not need
-%D to collect whole rows and parse them but looks ahead instead.
-
-\def\startTABLE
- {\dosingleempty\dostartTABLE}
-
-\def\dostartTABLE[#1]%
- {\bgroup
- \bTABLE[#1]%
- \let\NC\doTABLENC
- \let\NR\doTABLENR
- \let\bTR\relax
- \let\bTD\relax
- \let\bTH\relax
- \let\bTN\relax}
-
-\def\stopTABLE
- {\eTABLE
- \egroup}
-
-\newconditional\inTABLEnc
-
-\unexpanded\def\doTABLENR
- {\eTR
- \setfalse\inTABLEnc}
-
-\unexpanded\def\doTABLENC
- {\futurelet\next\dodoTABLENC}
-
-\def\dodoTABLENC
- {\ifx\next\doTABLENR \else
- \expandafter\dododoTABLENC
- \fi}
-
-% \long\def\dododoTABLENC#1\NC
-% {\ifconditional\inTABLEnc\else\settrue\inTABLEnc\parseTR[][]\fi
-% \parseTD[][]#1\eTD\NC}
-
-\long\def\dododoTABLENC#1\NC
- {\ifconditional\inTABLEnc\else\settrue\inTABLEnc\parseTR[][]\fi
- \dodoubleempty\parseTD#1\eTD\NC}
-
-%D The related structure commands are also available:
-
-\unexpanded\def\startTABLEhead{\dosingleempty\dostartTABLEhead} \let\stopTABLEhead\relax
-\unexpanded\def\startTABLEnext{\dosingleempty\dostartTABLEnext} \let\stopTABLEnext\relax
-\unexpanded\def\startTABLEbody{\dosingleempty\dostartTABLEbody} \let\stopTABLEbody\relax
-\unexpanded\def\startTABLEfoot{\dosingleempty\dostartTABLEfoot} \let\stopTABLEfoot\relax
-
-\long\def\dostartTABLEhead[#1]#2\stopTABLEhead{\appendtoks\doTABLEsection[#1]{#2}\to\TBLhead}
-\long\def\dostartTABLEnext[#1]#2\stopTABLEnext{\appendtoks\doTABLEsection[#1]{#2}\to\TBLnext}
-\long\def\dostartTABLEbody[#1]#2\stopTABLEbody{\appendtoks\doTABLEsection[#1]{#2}\to\TBLbody}
-\long\def\dostartTABLEfoot[#1]#2\stopTABLEfoot{\appendtoks\doTABLEsection[#1]{#2}\to\TBLfoot}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/tabl-pln.mkii b/Master/texmf-dist/tex/context/base/mkii/tabl-pln.mkii
deleted file mode 100644
index 39bb50f2329..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/tabl-pln.mkii
+++ /dev/null
@@ -1,91 +0,0 @@
-%D The following bunch of macros come from plain \TEX\ by
-%D Don Knuth and deal with basic alignment. We just include
-%D them here so that they can be used if needed. Normally,
-%D \CONTEXT\ users will fall back on one of the three table
-%D environments.
-%D
-%D The hidden names are somewhat adapted and we use other
-%D local variables.
-
-\writestatus{loading}{ConTeXt Table Macros / Plain Tabular}
-
-\unprotect
-
-\newif \if@@plnusetab
-\newif \if@@plncr
-\newbox \@@plntabs
-\newbox \@@plntabsyet
-\newbox \@@plntabsdone
-\newdimen \@@plntabdimen
-
-\def\cleartabs % visible
- {\global\setbox\@@plntabsyet\null
- \setbox\@@plntabs\null}
-
-\def\settabs % visible
- {\setbox\@@plntabs\null
- \futurelet\next\@@plnsettabs}
-
-\def\tabalign % visible
- {\@@plnusetabtrue\@@plnmaketabbox}
-
-\let\+\tabalign % no outer here (can be overloaded)
-
-\def\@@plnsettabs
- {\ifx\next\+%
- \def\nxt{\afterassignment\@@plnsettab\let\nxt}%
- \else
- \let\nxt\@@plnsetcols
- \fi
- \let\next\relax
- \nxt}
-
-\def\@@plnsettab
- {\let\nxt\relax
- \@@plnusetabfalse\@@plnmaketabbox}
-
-\def\@@plnsetcols#1\columns
- {\scratchcounter#1%
- \@@plntabdimen\hsize
- \loop
- \ifnum\scratchcounter>\zerocount \@nother
- \repeat}
-
-\def\@nother
- {\scratchdimen\@@plntabdimen
- \divide\scratchdimen\scratchcounter
- \setbox\@@plntabs\hbox{\hbox to\scratchdimen{}\unhbox\@@plntabs}%
- \advance\@@plntabdimen-\scratchdimen
- \advance\scratchcounter\minusone}
-
-\def\@@plnmaketabbox
- {\begingroup
- \global\setbox\@@plntabsyet\copy\@@plntabs
- \global\setbox\@@plntabsdone\null
- \def\cr
- {\@@plncrtrue\crcr\egroup\egroup
- \if@@plnusetab\unvbox\zerocount\lastbox\fi\endgroup
- \setbox\@@plntabs\hbox{\unhbox\@@plntabsyet\unhbox\@@plntabsdone}}%
- \setbox\zerocount\vbox\bgroup\@@plncrfalse
- \ialign\bgroup&\@@plnbegintabbox##\@@plnendtabbox\crcr}
-
-\def\@@plnbegintabbox
- {\setbox\zerocount\hbox\bgroup}
-
-\def\@@plnendtabbox
- {\if@@plncr
- \egroup % now \box\zerocount holds the column
- \else
- \hss\egroup
- \global\setbox\@@plntabsyet\hbox
- {\unhbox\@@plntabsyet\global\setbox\plusone\lastbox}% now \box\plusone holds its size
- \ifvoid\plusone
- \global\setbox\plusone\hbox to\wd\zerocount{}%
- \else
- \setbox\zerocount\hbox to\wd\plusone{\unhbox\zerocount}%
- \fi
- \global\setbox\@@plntabsdone\hbox{\box\plusone\unhbox\@@plntabsdone}%
- \fi
- \box\zerocount}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/tabl-tab.mkii b/Master/texmf-dist/tex/context/base/mkii/tabl-tab.mkii
deleted file mode 100644
index 7909e509284..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/tabl-tab.mkii
+++ /dev/null
@@ -1,2515 +0,0 @@
-%D \module
-%D [ file=core-tab,
-%D version=1997.10.10,
-%D title=\CONTEXT\ Table Macros,
-%D subtitle=\TABLE\ Embedding,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Table Macros / TaBlE Embedding}
-
-% By now it makes more sense to merge the patches into the original
-% and clean that one up too.
-
-% \starttable[|||]
-% \HL
-% \VL test \VS test \VL \FR
-% \VL test \VD test \VL \MR
-% \VL test \VT test \VL \LR
-% \HL
-% \stoptable
-
-% Don't change the splitter:
-%
-% ... \NR
-% \TABLEnoalign{\page}\TABLEhead
-% \NC ...
-
-% e-tex: reverse rows or vadjust or ... in tables
-% \ifalign
-% \xhrule : calls for 'special' with width
-% BUG:
-%
-% \starttable[|l|l|]
-% \HL
-% \RL\FR \VL Head 1 \VL Head 2 \VL\FR
-% \RL\LR \VL Head A \VL Head B \VL\LR % niet grijs ??
-% \HL
-% \VL 1 \VL 2 \VL\FR
-% \VL a \VL b \VL\LR
-% \HL
-% \stoptable
-
-% melden als in kleur conflict, uitgestelde test op \SR\SR
-
-% verengelsen
-% interface
-
-% footnotes flushen
-% \......TABLE........ namen
-% kolommen testen
-% unbreakable kop definieren
-% voetnoten
-% meldingen
-% als direct \use{max} dan fout
-% \BREAKPOINT
-% breedte lijn telt
-% errors: ook gray in handle
-
-% \AR -> als in DL dan \DR
-
-% nieuw:
-%
-% \NL / \NL[blanko] is skip, nog default?
-% geen \HL in a row
-% \HL[n]
-% \VL[n] + remembers
-% c{colorspec} key
-% \HC[color][width]
-% \VC[color]
-% meldingen row, column, use, advise
-% \AR: UITSTELLEN / EXPERIMENTEEL
-
-% WAARDELOZE ERROR HANDLER
-% THIS RENEWED MODULE WORKS OK BUT STILL LOOKS BAD
-
-%D We felt no need to write our own table building macros,
-%D simply because Michael Wichura made a terrific one. This
-%D package is quite complete and well documented. In \CONTEXT\
-%D we provide a shell for consistent spacing as well as color
-%D support. Implementing these features without adapting the
-%D original macros is not trivial. One easilly gets conflicts
-%D with \type{\omit}, \type{\span} and \type{\noalign}, which
-%D means that we end up postponing and overloading macros,
-%D mostly global. Now, let's start with loading the main
-%D macros:
-
-\doifundefined{BeginTable}{\doinputonce{table.tex}}
-
-\unprotect
-
-%D \macros
-%D {inintable, ifsplittables}
-%D
-%D First we declare some variables. These show a bit what we
-%D are dealing with. First we introdoce some booleans that
-%D enable us, inside as well as outside this module, to
-%D determine in what mode we are.
-
-\newif\ifintable
-\newif\ifsplittables
-
-%D \macros
-%D {tracetablestrue}
-%D
-%D When I documented this module, I felt the need for tracing
-%D options. After implementing this feature, I also added
-%D warnings, error recovery and automatic spacing.
-
-\newif\iftracetables
-
-%D We show this feature in an eample that also shows some of
-%D the basic table typesetting commands.
-%D
-%D \startbuffer
-%D \starttable[|||]
-%D \HL
-%D \VL first \VL second \VL\AR
-%D \HL
-%D \VL alfa \VL 1 \VL\AR
-%D \VL beta \VL 2 \VL\AR
-%D \VL gamma \VL 3 \VL\AR
-%D \HL
-%D \stoptable
-%D \stopbuffer
-%D
-%D \startcombination
-%D {\tracetablesfalse\getbuffer} {\type{\tracetablesfalse}}
-%D {\tracetablestrue\getbuffer} {\type{\tracetablestrue}}
-%D \stopcombination
-%D
-%D This table is specified as:
-%D
-%D \typebuffer
-%D
-%D This examples shows about the minimum of commands needed to
-%D typeset such a table. In this table, the \type {\AR} is
-%D automatically translated into the more primitive (but more
-%D verbose) commands \type {\SR}, \type {\FR}, \type {\MR} and
-%D \type {\LR} commands.
-%D
-%D \startbuffer
-%D \starttables[|||]
-%D \HL
-%D \VL first \VL second \VL\AR
-%D \HL
-%D \VL alfa \VL 1 \VL\AR
-%D \VL beta \VL 2 \VL\AR
-%D \VL gamma \VL 3 \VL\AR
-%D \HL
-%D \stoptable
-%D \stopbuffer
-%D
-%D When we use the split table feature, we get a bit more
-%D information.
-%D
-%D {\tracetablesfalse\getbuffer}
-%D
-%D Sometimes in tables information shows up that is not typed
-%D in by the user. These messages give a cue in what aspect a
-%D table definition is wrong.
-%D
-%D \startbuffer
-%D \starttable[||||]
-%D \HL
-%D \VL first second \VL third \VL\AR
-%D \HL
-%D \VL alfa \VL 1 \VL a \VL\AR
-%D \VL beta \VL 2 \VL b \VL
-%D \VL gamma \VL \THREE{3} c \VL\AR
-%D \HL
-%D \stoptable
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D Those terrible table has three errors, which all show up in
-%D typeset messages. Errors cannot always recovered 100\% and
-%D therefore can result in two or more succesive messages, like
-%D in the last row.
-%D
-%D \getbuffer
-
-%D Bringing color into tables is complicated by the mere fact
-%D that color is not part of \TEX. The main complication is
-%D that we don't know in advance how wide a column will be. I
-%D implemented color support in tables in the early 90's
-%D because I needed it for some articles on color. I have to
-%D admit that I seldom use the mechanism.
-%D
-%D Most color support in \CONTEXT\ makes use of colored rules.
-%D At first sight, one is tempted to implement colors in tables
-%D in a similar way, but as said, we don't know the dimensions
-%D in advance. It turns out however that we don't have to,
-%D simply because alignments take care of stretching rules to
-%D the appropritate dimensions. This means that we can provide
-%D backgrounds by coloring rules with the height of a row,
-%D skipping upwards and finally drawing the content, like in:
-%D
-%D \gdef\ShowExample
-%D {\startfiguretext
-%D {none}
-%D {\getbuffer}
-%D \typebuffer
-%D \stopfiguretext}
-%D
-%D \startbuffer
-%D \starttable[|c|c|]
-%D \HL
-%D \BL[2] \SR
-%D \VL test \VL test \VL\SR
-%D \HL
-%D \VL test \VL test \VL\FR
-%D \VL test \VL test \VL\MR
-%D \VL test \VL test \VL\LR
-%D \HL
-%D \stoptable
-%D \stopbuffer
-%D
-%D \ShowExample
-%D
-%D Just to be complete we show how the other columns can be
-%D given a background. Later we will provide more details over
-%D the commands used.
-%D
-%D \startbuffer
-%D \starttable[|c|c|c|]
-%D \HL
-%D \BL[3] \SR
-%D \VL test \VL test \VL test \VL\SR
-%D \HL
-%D \stoptable
-%D \stopbuffer
-%D
-%D \ShowExample
-%D
-%D \startbuffer
-%D \starttable[|c|c|c|]
-%D \HL
-%D \BC \BL[2] \SR
-%D \VL test \VL test \VL test \VL\SR
-%D \HL
-%D \stoptable
-%D \stopbuffer
-%D
-%D \ShowExample
-%D
-%D \startbuffer
-%D \starttable[|c|c|c|]
-%D \HL
-%D \BC \BC \BL \SR
-%D \VL test \VL test \VL test \VL\SR
-%D \HL
-%D \stoptable
-%D \stopbuffer
-%D
-%D \ShowExample
-%D
-%D \startbuffer
-%D \starttable[|c|c|c|]
-%D \HL
-%D \BC \BL \SR
-%D \VL test \VL test \VL test \VL\SR
-%D \HL
-%D \stoptable
-%D \stopbuffer
-%D
-%D \ShowExample
-%D
-%D \startbuffer
-%D \starttable[|c|c|c|]
-%D \BL \BL \SR
-%D \HL
-%D \VL test \VL test \VL test \VL\SR
-%D \HL
-%D \stoptable
-%D \stopbuffer
-%D
-%D \ShowExample
-
-%D In these examples we can clearly see that for being a real
-%D background, the color or gray specification has to precede
-%D the content. Just to keep things simple, we can recall this
-%D specification later on:
-%D
-%D \startbuffer
-%D \starttable[|c|c|c|]
-%D \BC \BL \SR
-%D \HL
-%D \VL test \VL test \VL test \VL\SR
-%D \HL
-%D \BR\FR
-%D \VL test \VL test \VL test \VL\FR
-%D \BR\MR
-%D \VL test \VL test \VL test \VL\MR
-%D \BR\LR
-%D \VL test \VL test \VL test \VL\LR
-%D \HL
-%D \stoptable
-%D \stopbuffer
-%D
-%D \ShowExample
-%D
-%D Close study learns that we can put the specification
-%D before or after the \type{\HL}, whatever suits best. Keeping
-%D track of these specifications is taken care of by the next
-%D variables:
-
-\newif \ifTABLEgrayline % executing gray line
-\newif \ifTABLEgraydone % gray line executed
-\newtoks \TABLEgraytoks % gray line specification
-
-\newif\ifTABLEinbreak
-
-%D Nog vervangen:
-
-\def\c!Table{Table}
-\def\m!TABLE{TABLE}
-
-%D We already saw that the table macros report errors and
-%D provide automatic spacing. These features can only be
-%D implemented by keeping track of the state, often the last
-%D command on a row.
-
-\chardef\TABLEunknown = 0
-
-\chardef\TABLEseparaterow = 1
-\chardef\TABLEfirstrow = 2
-\chardef\TABLEmidrow = 3
-\chardef\TABLElastrow = 4
-\chardef\TABLErule = 5
-\chardef\TABLEskip = 6
-\chardef\TABLEautorow = 7
-
-\chardef\TABLEforcefirstrow = 1
-\chardef\TABLEforcelastrow = 2
-
-\chardef\TABLEmissingrow = 1
-\chardef\TABLEmissingcolumn = 2
-\chardef\TABLEspanoverflow = 3
-\chardef\TABLEdivisionoverflow = 4
-
-%D We store these states using efficient \type {\chardef}'s.
-%D Like most variables, these are global ones. When needed,
-%D especially when we flush the backgrounds, we can temporary
-%D disable the assignment.
-
-\newif\ifsetTABLEaction
-
-\def\setTABLEaction#1%
- {\ifsetTABLEaction\global\chardef\TABLEaction#1\fi}
-
-\def\setTABLEforce#1%
- {\ifsetTABLEaction\global\chardef\TABLEforce#1\fi}
-
-\def\setTABLEerror#1%
- {\global\chardef\TABLEerror#1}
-
-%D Before we come to using these variables, we redefine and/or
-%D adapt some \TABLE\ macros. Within \TABLE's the \type{|} and
-%D \type{"} have special meanings in templates and are active
-%D during. Their meaning can therefore conflict with those
-%D elsewhere defined. To be compatible with traditional \TABLE\
-%D as well as \CONTEXT's \type{||} and the active \type{"}
-%D extensions for my german friends, we do some catcode magic.
-
-\newif\ifForgetTableBarAndQuote \ForgetTableBarAndQuotetrue
-
-% \bgroup
-
-% \catcode`\|=\@@active
-% \catcode`\"=\@@active
-%
-% \gdef\pushouterbarandquote
-% {\ifForgetTableBarAndQuote
-% \ifnum\catcode`\|=\@@active \let\outertablebar |\else\let\outertablebar \relax\fi
-% \ifnum\catcode`\"=\@@active \let\outertablequote"\else\let\outertablequote\relax\fi
-% \let|\letterbar
-% \let"\letterdoublequote
-% \fi}
-%
-% \gdef\popouterbarandquote
-% {\ifForgetTableBarAndQuote
-% \ifx\outertablebar \relax\else\let|\outertablebar \fi
-% \ifx\outertablequote\relax\else\let"\outertablequote\fi
-% \else
-% \redefinetablebarandquote
-% \fi}
-%
-% \egroup
-%
-% \def\ObeyTableBarAndQuote
-% {\ForgetTableBarAndQuotefalse
-% \ifintable
-% \redefinetablebarandquote
-% \fi}
-
-\let\ActivateBarAndQuote \relax
-\let\ObeyTableBarAndQuote\relax
-\let\pushouterbarandquote\relax
-\let\popouterbarandquote \relax
-
-%D \macros
-%D {ObeyTableBarAndQuote}
-%D
-%D As said, the \type{|} and \type{"} active characters are
-%D often used for other purposes. By default, the outside
-%D meanings are therefore preserved and available inside
-%D tables. If for some reason one wants to use the \TABLE\
-%D primitives, one can say:
-%D
-%D \starttyping
-%D \ObeyTableBarAndQuote
-%D \stoptyping
-%D
-%D To keep things verbose, as well as to show what \TABLE\
-%D commands we affect, we show some meanings.
-
-\def\normalTABLEshortrule {\!ttShortHrule} % \-
-\def\normalTABLElongrule {\!ttLongHrule} % \=
-\def\normalTABLEfullrule {\!ttFullHrule} % \_
-\def\normalTABLEendofrow {\!ttEndOfRow} % \\
-\def\normalTABLEsimplebar {\unskip\!ttRightGlue&&} % |
-\def\normalTABLEcomplexbar {\unskip\!ttRightGlue&\omit\!ttAlternateVrule} % \|
-\def\normalTABLEquote {\unskip\!ttRightGlue&\omit&} % "
-\def\normalTABLElineformat {\normalTABLEendofrow+}
-\def\normalTABLElineending {\normalTABLEendofrow0 }
-\def\normalTABLEsinglerule {&\normalTABLElongrule&}
-\def\normalTABLEmultirule#1{&\use{#1}\normalTABLElongrule&}
-
-%D The next hack is dedicated to Tobias, who found out that
-%D paragraph entries don't break well.
-
-\def\TABLEhack{\hskip\zeropoint}
-
-%D The first attemp to solve this problem was:
-%D
-%D \starttyping
-%D \def\normalTABLEquote%
-%D {\unskip\TABLEhack\!ttRightGlue&\omit&\TABLEhack}
-%D \stoptyping
-%D
-%D But, as usual, this interfered with \type {\omit}.
-%D
-%D The next attempt is redefining some core \TABLE\ macro:.
-%D This works ok, but breaks for instance the~\type{b}
-%D key handling.
-%D
-%D \starttyping
-%D \def\!tfAdjoinPriorColumn%
-%D {\ifnum\!taColumnNumber=0
-%D \!taPreamble=\!taRuleColumnTemplate
-%D ...
-%D \if!taOnceOnlyTabskip
-%D \!thToksEdef\!taDataColumnTemplate=
-%D {\TABLEhack####\TABLEhack\tabskip\the\!taLastRegularTabskip}
-%D \else
-%D \!taDataColumnTemplate{\TABLEhack##\TABLEhack}%
-%D \fi
-%D ...
-%D \ReadFormatKeys}
-%D \stoptyping
-
-% \newdimen\TABLEparheight
-
-\def\BeginTableParBox#1%
- {\setbox\scratchbox\vtop\bgroup % \setbox added
- \hsize#1\relax
- \dontcomplain
- \restoretablelineskips
- \normalbaselines
- \let~\!ttTie
- \let\-\!ttDH
- \blank[\v!disable]% % added
- \the\EveryTableParBox}
-
-\def\EndTableParBox
- {\removelastskip % itemize or so
- \endgraf
- \ifnum\prevgraf>\zerocount % we want at least
- \verticalstrut \nowhitespace \vskip-\struttotal % one line of text
- \egroup
- \ifdim\dp\scratchbox>\lineheight % see (*) for an
- \getnoflines{\dp\scratchbox}% % example of where
- \dp\scratchbox\zeropoint % saving can go
- \setbox\scratchbox % terrible wrong
- \vtop to \noflines\lineheight{\box\scratchbox}%
- \fi % esp between rows
- \else % of paragraphs
- \egroup
- \fi
-% \getboxheight\scratchdimen\of\box\scratchbox\relax% compensate for
-% \ifdim\scratchdimen>\TABLEparheight % funny depth of
-% \global\TABLEparheight\scratchdimen % multi-line box
-% \fi % i.e. vtop
- \box\scratchbox}
-
-% We also need to patch away the interfering math switch:
-
-% \mathpunctuationtrue
-
-% test, test
-% \starttable[|c|]
-% \NC1,,10\NC\AR
-% \stoptable
-% test, test
-
-\def\!ttBeginTableA[#1]{%
- \if #1u% % "unboxed" table
- \ifmmode
- \def\!ttEndTable{% % user had better be in display math mode
- \relax}% % and have only one table at the outer level
- \else % user had better be in vertical mode
- \bgroup
- \def\!ttEndTable{%
- \egroup}%
- \fi
- \else
- %\hbox\bgroup $
- %\def\!ttEndTable{%
- % \egroup % for the \vtop, \vbox, or \vcenter, yet to come
- % $% for math mode
- % \egroup}% for the \hbox
- %\if #1t%
- % \vtop
- %\else
- % \if #1b%
- % \vbox
- % \else
- % \vcenter % math mode was essential for this
- % \fi
- %\fi
- %
- \hbox\bgroup
- \def\!ttEndTable{\egroup\egroup}%
- \if#1t%
- \vtop
- \else\if#1b%
- \vbox
- \else
- \def\!ttEndTable{\egroup$\egroup}%
- %$\vcenter
- \scratchtoks\everymath\everymath\emptytoks$\everymath\scratchtoks\vcenter
- \fi\fi
- %
- \bgroup % for the \vtop, \vbox, or \vcenter
- \fi
- \advance\!taRecursionLevel 1 % RecursionLevel governs initialization
- \let\!ttRightGlue=\relax % This may be changed by \JustCenter, etc
- \everycr\emptytoks % ={}
- \ifnum \!taRecursionLevel=1
- \!ttInitializeTable
- \fi}
-
-%D The next redefinition is more robust than the original:
-
-\def\SetTableToWidth#1%
- {\doifelsenothing{#1}{\!taTableSpread\emptytoks}{\!taTableSpread{to #1}}}
-
-% (*) Try this one with \type {direction} and {girection};
-% the \PPCHTEX\ manual is a nice testcase.
-%
-% \startoverlay
-% {\starttable[ | l w(2cm) | w(8cm) | ]
-% \HL
-% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \FR
-% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \MR
-% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \LR
-% \HL
-% \stoptable}
-% {\starttable[ | l w(2cm) | p(8cm) | ]
-% \HL
-% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \FR
-% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \MR
-% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \LR
-% \HL
-% \stoptable}
-% \stopoverlay
-% \vskip2cm
-% \starttable[ | l w(2cm) | p(8cm) | ]
-% \HL
-% \VL direction \VL \showbaselines \dorecurse{3}{direction }\VL \FR
-% \VL direction \VL \showbaselines \dorecurse{8}{direction }\VL \LR
-% \HL
-% \stoptable
-% \vskip2cm
-% \starttable[ | l w(2cm) | p(8cm) | ]
-% \HL
-% \VL direction \VL \showbaselines \dorecurse{8}{direction }\VL \FR
-% \VL direction \VL \showbaselines \dorecurse{8}{direction }\VL \LR
-% \HL
-% \stoptable
-
-%D To give an impression of what the (well documented) source
-%D of \TABLE\ looks like, we first implement an alternative for
-%D the numeric keys. The quantity keys (\type{q} and \type{Q})
-%D support the more european way of writing numbers:
-%D
-%D \startnarrower
-%D 100.000.000,00 instead of 100,000,000.00
-%D \stopnarrower
-%D
-%D The next table shows how to use these keys. We use braces
-%D instead of brackets because we need brackets to specify the
-%D format.
-%D
-%D \startbuffer
-%D \starttable{|q[00,000]|Q[00,00]|}
-%D \HL
-%D \VL -1,2 \VL 12,35 \VL\FR
-%D \VL 11,203 \VL 2,4 \VL\LR
-%D \HL
-%D \stoptable
-%D \stopbuffer
-%D
-%D \ShowExample
-%D
-%D Although a more efficient implementation is possible |<|we
-%D can for instance share common macros|>| we just adapt a copy
-%D of the numeric ones. To permit double loading of this
-%D module, we check for the existence of one of the macros.
-
-\letvalue{!tk<\string q>}=\undefined
-\letvalue{!tk<\string Q>}=\undefined
-
-%D We just copy the original {\em comments}.
-%D
-%D \em Key \type{q}: quantity item, non||math mode.
-
-\NewFormatKey q%
- {\letempty\!tqStyle
- \futurelet\!tnext\!tqTestForBracket}
-
-%D \em Key \type{Q}: quantity item, math mode.
-
-\NewFormatKey Q%
- {\def\!tqStyle{$}%
- \futurelet\!tnext\!tqTestForBracket}
-
-%D \em Note: the space between a quantity entry and the
-%D following \type{|}, \type{"}, or \type{\|} is mandatory.
-%D empty quantity entries are not allowed: use \type{{}} or
-%D \type{\omit} instead.
-%D
-%D \em Test for bracket: invoked by the keys \type{q} and
-%D \type{Q}.
-
-\def\!tqTestForBracket
- {\ifx[\!tnext
- \!thx\!tqGetArgument
- \else
- \!thx\!tqGetCode
- \fi}
-
-%D \em Get code: e.g. \type{4}, or \type{4,0}, \type{0,4}, or
-%D \type{10,2}.
-
-\def\!tqGetCode#1 % note the blank
- {\!tqConvertCode #1,,!}
-
-%D \em Convert code: e.g. converts above to \type{[0000]},
-%D \type{[0000,]}, \type{[,0000]}, \type{[0000000000,00]}.
-
-\def\!tqConvertCode #1,#2,#3!%
- {\begingroup
- \aftergroup\edef
- \aftergroup\!ttemp
- \aftergroup{%
- \aftergroup[%
- \!taCountA #1
- \!thLoop
- \ifnum \!taCountA>\zerocount
- \advance\!taCountA \minusone
- \aftergroup0
- \repeat
- \def\!ttemp{#3}%
- \ifx\!ttemp\empty
- \else
- \aftergroup,
- \!taCountA #2
- \!thLoop
- \ifnum\!taCountA>\zerocount
- \advance\!taCountA \minusone
- \aftergroup0
- \repeat
- \fi
- \aftergroup]\aftergroup}%
- \endgroup\relax
- \!thx\!tqGetArgument\!ttemp}
-
-%D \em Get argument:
-%D
-%D \starttyping
-%D <sample left field> <optional, sample right field>
-%D \stoptyping
-
-\def\!tqGetArgument[#1]%
- {\!tqMakeQuantityTemplate\!tqStyle#1,,!}
-
-%D \em Make quantity template.
-
-\def\!tqMakeQuantityTemplate#1#2,#3,#4!% #1=<empty> or $
- {\def\!ttemp{#4}%
- \ifx\!ttemp\empty
- \!taDimenC\zeropoint
- \else
- \setbox0\hbox{\mathsurround\zeropoint #1,#3#1}%
- \!taDimenC\wd0
- \fi
- \setbox0\hbox{\mathsurround\zeropoint #1#2#1}%
- \!thToksEdef\!taDataColumnTemplate
- ={\noexpand\!tqSetQuantityItem{\the\wd0 }{\the\!taDimenC}{#1}%
- \the\!taDataColumnTemplate}%
- \ReadFormatKeys}
-
-%D \em Set numeric item.
-
-\def\!tqSetQuantityItem #1#2#3#4 %
- {\!tqSetQuantityItemA{#1}{#2}{#3}#4,,!}
-
-\def\!tqSetQuantityItemA #1#2#3#4,#5,#6!%
- {\def\!ttemp{#6}%
- \hbox to #1{\hss\mathsurround\zeropoint#3#4#3}%
- \hbox to #2{\ifx\!ttemp\empty\else\mathsurround\zeropoint#3,#5#3\fi\hss}}
-
-%D Here ends the Q||extension. Did you watch the clever use
-%D of aftergroup in \type{\!tqConvertCode}.
-
-% %D We also (have to) define a key for \type{\cap}:
-%
-% \letvalue{!tk<\string K>}=\undefined
-%
-% \NewFormatKey K%
-% {\ReadFormatKeys b\smallcapped}
-
-%D A few pages back we saw backgrounds, further on we will see
-%D colored rules, and here we provide a means to color the
-%D entries in a column. (We can of course always use the normal
-%D color commands for individual entries.) We could not use the
-%D lowercase~\type{c}, because that one is used to force {\em
-%D centering}.
-%D
-%D \startbuffer
-%D \starttable[|C{red}|C{green}|C{blue}|]
-%D \VL R(ed) \VL G(reen) \VL B(lue) \VL\SR
-%D \stoptable
-%D \stopbuffer
-%D
-%D \ShowExample
-
-\letvalue{!tk<\string C>}=\undefined
-
-\NewFormatKey C#1%
- {\ReadFormatKeys b{\localstartcolor[#1]} a{\localstopcolor}}
-
-%D So now we have three new keys:
-%D
-%D \starttable[|||]
-%D \HL
-%D \NC \bf key \NC \bf meaning \NC\AR
-%D \HL
-%D \NC Q[x,y] \NC math mode formatted numbers \NC\AR
-%D \NC q[x,y] \NC text mode formatted numbers \NC\AR
-%D \NC C{identifier} \NC column entry color \NC\AR
-%D \HL
-%D \stoptable
-
-%D To be compatible with the tabulate environment, we also
-%D support the \type {l}, \type {c} and \type {r} keys for
-%D paragraph entries.
-
-\letvalue{!tk<\string l>}=\undefined
-\letvalue{!tk<\string c>}=\undefined
-\letvalue{!tk<\string r>}=\undefined
-\letvalue{!tk<\string x>}=\undefined % not that needed
-
-\NewFormatKey c%
- {\prependtoks\raggedcenter\to\!taDataColumnTemplate
- \ReadFormatKeys \LeftGlue\hfil \RightGlue\hfil}
-
-\NewFormatKey l%
- {\prependtoks\raggedright\to\!taDataColumnTemplate
- \ReadFormatKeys \LeftGlue\empty \RightGlue\hfil}
-
-\NewFormatKey r%
- {\prependtoks\raggedleft\to\!taDataColumnTemplate
- \ReadFormatKeys \LeftGlue\hfil \RightGlue\empty}
-
-\NewFormatKey x%
- {\prependtoks\notragged\to\!taDataColumnTemplate
- \ReadFormatKeys \LeftGlue\hfil \RightGlue\empty}
-
-\appendtoks \TABLEparalignment \to \EveryTableParBox
-
-\def\!tfReFormat#1%
- {\the \!taLeftGlue
- \vbox{\forgetall\ialign{\span\the\!taDataColumnTemplate\cr#1\cr}}%
- \the \!taRightGlue
- \kern\zeropoint} % prevents \unskip / really needed
-
-%D Later on, we're going to implement multiple page table
-%D support, therefore the next \TABLE\ macro needs to be
-%D slightly adapted, i.c. the penalty is removed. We also
-%D add basic color support.
-
-\def\!ttFullHruleA
- {\!ttGetHalfRuleThickness
- \startglobalTABLEcolor % added
- \hrule\!thHeight\dimen0\!thDepth\dimen0
- \stopglobalTABLEcolor % added
- %\penalty0 % removed
- \egroup}
-
-%D We'll see that when we want to give a vertical rule a color,
-%D we have to set and reset states. After heavy testing it
-%D proved most useful to extend a \TABLE\ primitive with some
-%D hooks. One thing to keep in mind is that \type{&} keeps
-%D assignments local. Again, we add basic color support.
-
-\let\TABLEbeforebar\empty
-\let\TABLEafterbar \empty
-
-\def\@VLn{1}
-\def\@VLd{.125em}
-
-\def\do!ttInsertVrule % will be merged in 2005
- {\vrule \!thWidth
- \ifnum\!tgCode=\plusone
- \ifx\!tgValue\empty
- \LineThicknessFactor
- \else
- \!tgValue
- \fi
- \LineThicknessUnit
- \else
- \!tgValue
- \fi
- \hskip\@VLd}
-
-\def\!ttInsertVrule
- {\hfil
- \TABLEbeforebar % added
- \startglobalTABLEcolor % added
- % we could do without this speedup, some day merge 'm
- \ifcase\@VLn\or
- \do!ttInsertVrule
- \unskip
- \else
- \dorecurse\@VLn\do!ttInsertVrule
- \gdef\@VLn{1}%
- \unskip
- \fi
- \stopglobalTABLEcolor % added
- \TABLEafterbar % added
- \hfil
- &}
-
-%D The next two macros are only adapted to basis rule
-%D color support.
-
-\def\!tfSetVrule
- {\!thToksEdef\!taRuleColumnTemplate=
- {\noexpand\hfil
- \noexpand\startglobalTABLEcolor % added
- \noexpand\vrule
- \noexpand\!thWidth
- \ifnum\!tgCode=\plusone
- \ifx\!tgValue\empty
- \the\LineThicknessFactor
- \else
- \!tgValue
- \fi
- \!taLTU
- \else
- \!tgValue
- \fi
- ####%
- \noexpand\hfil
- \noexpand\stopglobalTABLEcolor % added
- \the\!taRuleColumnTemplate}%
- \!tfAdjoinPriorColumn}
-
-\def\!ttShortHruleA
- {\!ttGetHalfRuleThickness
- \startglobalTABLEcolor % added
- \leaders\hrule\!thHeight\dimen0\!thDepth\dimen0\hfill
- \stopglobalTABLEcolor % added
- \null
- \ignorespaces}
-
-%D We already showed the next one, but here we slightly adapt
-%D the macro by adding an \type{\expandafter}. The space after
-%D \type{#1} is crucial!
-
-\def\normalTABLEcomplexbar#1%
- {\unskip\!ttRightGlue&\omit\expandafter\!ttAlternateVrule#1 }
-
-%D To get rid of interfering \type{\omit}'s when we are
-%D checking the number of columns and reporting problems. The
-%D extensions concern the second level check, the first
-%D subbranch and advancing the column.
-
-\ifx\mscount\undefined \newcount\mscount \fi
-
-\def\!ttuse#1%
- {\ifnum#1>\plusone
- \omit
- \global\TABLEdivisionfalse
- \scratchcounter\currentTABLEcolumn % added
- \advance\scratchcounter #1% % added
- \advance\scratchcounter \minusone % added
- \ifnum\scratchcounter>\maxTABLEcolumn % added
- \def\next % added
- {\setTABLEerror\TABLEspanoverflow % added
- \handleTABLEerror}% % added
- \else % added
- \def\next % added
- {\global\advance\currentTABLEcolumn #1% % added
- \global\advance\currentTABLEcolumn \minusone % added
- \mscount#1% \mscount is in Plain
- \advance\mscount \minusone
- \advance\mscount \mscount
- \!thLoop
- \ifnum\mscount>\plusone
- \spanomit \advance\mscount\minusone
- \repeat
- \span}%
- \fi % added
- \else % added
- \def\next % conflicts with possible next \omit % added
- {\global\advance\currentTABLEcolumn \plusone}% % added
- \fi
- \next} % added
-
-% \starttable[|c|c|c|c|]
-% \HL
-% \VL {test} \VL \TWO{} \VL test \VL\FR
-% \DL \DC \DL\DR
-% \VL {test} \VL \TWO{} \VL test \VL\LR
-% \HL
-% \stoptable
-
-%D All commands that are executed between rows are to be put in
-%D \type {\noalign}. We can however not verify if we (that is
-%D \TABLE) does or did not enter this mode. A moderate dirty
-%D but useful trick is using our own alternative:\footnote{Once
-%D one has entered the stage of redefining \TEX\ primitives,
-%D such hacks become a second nature. However, redefining \type
-%D {\omit} and \type{\span} is not that easy.}
-
-\def\TABLEnoalign
- {\noalign\bgroup\let\noalign\relax\let\next=}
-
-%D \macros
-%D {starttable}
-%D
-%D The rest of this module is not easy to comprehend, mainly
-%D because we have to take care of:
-%D
-%D \startitemize[packed]
-%D \item \type{\startitemize[template]}
-%D \item \type{\startitemize{template}}
-%D \item \type{\startitemize[predefined]}
-%D \stopitemize
-%D
-%D as well as:
-%D
-%D \startitemize[continue]
-%D \item restart after table break
-%D \stopitemize
-%D
-%D The official specification of the start command is:
-%D
-%D \showsetup{starttable}
-
-\newconditional\tablerepeathead
-\newconditional\tablerepeattail
-
-\def\starttable
- {\bgroup
- \doif\@@tisplit\v!auto
- {\ifinsidesplitfloat\let\@@tisplit\v!yes\fi}%
- \doifinsetelse\@@tisplit{\v!yes,\v!repeat}
- {\def\stoptable{\stoptables\egroup}%
- \starttables}
- {\doifelsenothing\@@tiframe
- {\ifinsidefloat\else\startbaselinecorrection\fi}
- {\startframedcontent[\@@tiframe]}%
- \postponenotes
- \firststagestartTABLE}}
-
-\def\stoptable
- {\chuckTABLEautorow % before the tail, else noalign problem
- \insertTABLEtail
- \TABLEnoalign{\globalletempty\@@TABLEhead}%
- \TABLEnoalign{\globalletempty\@@TABLEtail}%
- \finishTABLE
- \doifelsenothing\@@tiframe
- {\ifinsidefloat\else
- \stopbaselinecorrection
- \goodbreak % compensates all the nobreaks
- \fi}
- \stopframedcontent
- \egroup}
-
-%D Before we can grab the argument, we have to make sure that
-%D the \CATCODES\ are set. The first stage takes care of that.
-
-\def\firststagestartTABLE
- {\bgroup % kan-ie weg?
- \global\intabletrue
- \pushouterbarandquote
- %catcode`\|=\@@other
- \complexorsimple\secondstagestartTABLE}
-
-\def\simplesecondstagestartTABLE#1%
- {\complexsecondstagestartTABLE[{#1}]}
-
-%D \macros
-%D {definetabletemplate}
-%D
-%D The complex (and main) start macro first takes care of the
-%D predefined case. Such a predefined setup looks like:
-%D
-%D \starttyping
-%D \definetabletemplate[test][|||]
-%D
-%D \starttable[test]
-%D \VL test \VL test \VL\AR
-%D \VL test \VL test \VL\AR
-%D \VL test \VL test \VL\AR
-%D \stoptable
-%D \stoptyping
-%D
-%D The implementation of the definition macro is not that
-%D complicated:
-
-\def\definetabletemplate % to be redone
- {\bgroup
- \catcode`\|=\@@other
- \doquadrupleempty\dodefinetabletemplate}
-
-\def\dodefinetabletemplate[#1][#2][#3][#4]%
- {\ifsecondargument
- \setgvalue{\c!Table#1}{\douseTABLEtemplate{#2}{#3}{#4}}%
- \fi
- \egroup}
-
-\def\douseTABLEtemplate#1#2#3%
- {\gdef\TABLEhead{\getvalue{@@TABLEhead#2}}%
- \gdef\TABLEtail{\getvalue{@@TABLEtail#3}}%
- \complexsecondstagestartTABLE[#1]}
-
-%D The optional third and fourth arguments define which table
-%D head and tail to use.
-%D
-%D \starttyping
-%D \definetabletemplate[test][|||][before][after]
-%D \stoptyping
-%D
-%D This also means that one can define table heads and tails
-%D by name!
-%D
-%D \starttyping
-%D \starttablehead[before]
-%D \HL \VL first \VL second \VL \SR \HL
-%D \stoptablehead
-%D \stoptyping
-%D
-%D Templates defined this way get protected names, that cannot
-%D conflict with existing commands.
-%D
-%D \showsetup{definetabletemplate}
-%D
-%D The second half of the next macro prepares table
-%D splitting.
-
-\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\verysimpleTableHL
- {\TABLEnoalign{\expandafter\normalTABLEfullrule\@@tiHLheight}}
-
-\def\dorestartTABLE#1%
- {\gdef\restartTABLE{#1}%
- \restartTABLE
- \TABLEnoalign{\globalpushmacro\simpleTableHL\global\let\simpleTableHL\verysimpleTableHL}%
- \insertTABLEhead
- \ifsplittables \ifconditional \tablerepeattail
- \TABLEnoalign{\goodbreak}%
- \insertTABLEtail
- \TABLEnoalign{\goodbreak}%
- \fi \fi
- \TABLEnoalign{\globalpopmacro\simpleTableHL}}
-
-\bgroup \catcode`|=\@@other \catcode`"=\@@other
-
-\gdef\complexsecondstagestartTABLE#1[#2]% brr nested mess
- {\bgroup
- \@@useotherbar
- \@@useotherquote
- \global\setfalse\someTABLEhead
- \global\setfalse\someTABLEtail
- \expanded{\doifinstringelse{|}{#2}}
- {\xdef\restartTABLE{\noexpand\dorestartTABLE{\noexpand\thirdstagestartTABLE{#2}}}}
- {\doifdefinedelse{\c!Table#2}
- {\gdef\restartTABLE{\getvalue{\c!Table#2}}}
- {\gdef\restartTABLE{\dorestartTABLE{\getvalue{#2}}}}}%
- \egroup
- \restartTABLE}
-
-\egroup
-
-%D The third stage involves a lot of (re)sets, which we will
-%D explain later.
-
-%D The next definition is convenient and more in tune with
-%D \CONTEXT.
-
-\let \everytable \EveryTable
-
-%D We immediately use this register:
-
-\appendtoks
- \fixedspaces
- \let\_\normalunderscore
-\to \everytable
-
-%D Now we can start the table.
-
-\def\thirdstagestartTABLE#1%
- {\global\setTABLEactiontrue
- \setTABLEaction\TABLEunknown
- \setTABLEforce\TABLEunknown
- \setTABLEerror\TABLEunknown
- \global\TABLEgraylinefalse
- \global\TABLEgraydonefalse
- \globalletempty\TABLEgrayline
- \globalletempty\nextTABLEgrayline
- \globalletempty\TABLEgraylineerror
- \globalletempty\TABLEgraylinestatus
- \resetVLvalues
- \appendtoks\popouterbarandquote\to\EveryTable
- \appendtoks\localTABLEsetup\to\EveryTable
- \BeginTable[\ifsplittables u\else b\fi]%
- \defineTABLEunits
- \defineTABLEsteps
- \defineTABLErules
- \defineTABLEdivisions
- \defineTABLEshorthands
- \defineTABLEbackgrounds
- \defineTABLEendings
- \forgetall % added
- \doifsomething{#1}
- {\def\TABLEformat{#1}%
- \getTABLEnofcolumns\TABLEformat
- % more modern is to use catcode tables
- \expandafter\BeginFormat\TABLEformat\EndFormat}}
-
-\def\finishTABLE
- {\chuckTABLEautorow
- \unskip\crcr
- \EndTable
- \global\intablefalse
- \egroup}
-
-%D \macros
-%D {starttables}
-%D
-%D Split tables are specified using the plural form of the
-%D start and stop commands.
-%D
-%D \showsetup{starttables}
-%D
-%D For example:
-%D
-%D \starttyping
-%D \starttables[|||]
-%D \HL
-%D \VL element \VL atom weight \VL\AR
-%D \HL
-%D \VL ....... \VL ........... \VL\AR
-%D \VL ....... \VL ........... \VL\AR
-%D \HL
-%D \stoptables
-%D \stoptyping
-
-\newbox\tablecontentbox
-
-\def\starttables
- {\bgroup
- \splittablestrue
- \doifelse\@@tisplit\v!repeat
- {\settrue \tablerepeathead\settrue \tablerepeattail}
- {\setfalse\tablerepeathead\setfalse\tablerepeattail}%
- \flushnotes
- \setbox\tablecontentbox\vbox\bgroup
- \forgetall
- \global\TABLEinbreakfalse
- \firststagestartTABLE}
-
-% \def\stoptables
-% {\ifconditional\tablerepeattail\else\insertTABLEtail\fi
-% \finishTABLE
-% \egroup
-% \dosplittablebox\tablecontentbox
-% \flushnotes
-% \egroup}
-
-\def\stoptables
- {\chuckTABLEautorow % AM: before the tail, else noalign problem
- \ifconditional\tablerepeattail\else\insertTABLEtail\fi
- \finishTABLE
- \egroup
-\dontcomplain
- \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
- \def\tsplitbeforeresult{\startbaselinecorrection}%
- \def\tsplitafterresult {\stopbaselinecorrection}%
- \fi
- \handletsplit}
-
-%D When the table in the previous example is split across
-%D pages, only the first gets a head. We could have said
-%D something like:
-%D
-%D \starttyping
-%D \starttablekop
-%D \HL
-%D \VL element \VL atom weight \VL\AR
-%D \HL
-%D \stoptablekop
-%D
-%D \starttablestaart
-%D \HL
-%D \stoptablestaart
-%D
-%D \starttables[|||]
-%D \VL ....... \VL ........... \VL\AR
-%D \VL ....... \VL ........... \VL\AR
-%D \stoptables
-%D \stoptyping
-%D
-%D This time each split table gets a head line and ends with
-%D a rule. Keep in mind that such heads also apply to the
-%D unbroken ones and should be defined local (grouped) if
-%D needed. The rather complicated definition below is due to
-%D the fact that the stopcondition is interface language
-%D dependant.
-
-\let\@@TABLEhead\empty \def\TABLEhead{\@@TABLEhead}
-\let\@@TABLEtail\empty \def\TABLEtail{\@@TABLEtail}
-
-\letvalue{\e!start\v!tablehead}=\undefined
-\letvalue{\e!stop \v!tablehead}=\undefined
-\letvalue{\e!start\v!tabletail}=\undefined
-\letvalue{\e!stop \v!tabletail}=\undefined
-
-\expanded
- {\def\csname\e!start\v!tablehead\endcsname##1\csname\e!stop\v!tablehead\endcsname%
- {\noexpand\setTABLEhead##1\noexpand\end}}
-
-\expanded
- {\def\csname\e!start\v!tabletail\endcsname##1\csname\e!stop\v!tabletail\endcsname%
- {\noexpand\setTABLEtail##1\noexpand\end}}
-
-%D The second argument is a dummy one, by scanning for it, we
-%D get rid of interfering spaces.
-
-\def\setTABLEhead{\dodoubleempty\dosetTABLEhead}
-\def\setTABLEtail{\dodoubleempty\dosetTABLEtail}
-
-\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 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%
- {\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
-%D the next grouping.
-
-\def\docomplexorsimpleTable#1#2%
- {\ifx\next\bgroup\@EA#2\else\@EA\dodocomplexorsimpleTable\@EA#1\@EA#2\fi}
-
-\def\dodocomplexorsimpleTable#1#2#3%
- {\if[\noexpand#3\@EA#1\else\@EA#2\fi#3}
-
-%D The order of the next macros is more or less random. First
-%D we implement error recovery. Errors are reported to the
-%D screen and log file as well as visualized in the table in
-%D teletype.
-
-\def\handleTABLEerror
- {\ifTABLEgrayline \else
- \ifnum\TABLEerror=\TABLEunknown \else
- \setTABLEaction\TABLEunknown
- \globalletempty\checkTABLEautorow
- \globalletempty\chuckTABLEautorow
- \fi
- \ifcase\TABLEerror
- % no error
- \or
- % \TABLEmissingrow
- \tttf [missing row]%
- \writestatus\m!TABLE{missing row}%
- \SR
- \or
- % \TABLEmissingcolumn
- \fillTABLEcolumns
- \tttf [missing column]%
- \writestatus\m!TABLE{missing column}%
- \SR
- \or
- % \TABLEspanoverflow
- \fillTABLEcolumns
- \tttf [columnspan too large]%
- \writestatus\m!TABLE{columnspan too large}%
- \SR
- \or
- % \TABLEdivisionoverflow
- \fillTABLEcolumns
- \tttf [division line too long]%
- \writestatus\m!TABLE{division line too long}%
- \SR
- \fi
- \fi
- \ifnum\TABLEerror=\TABLEunknown \else
- \finishTABLErow
- \fi}
-
-\def\finishTABLErow
- {\crcr
- \TABLEnoalign
- {\nobreak
- \setTABLEaction\TABLEunknown
- \setTABLEerror\TABLEunknown
- \globalletempty\checkTABLEautorow
- \globalletempty\chuckTABLEautorow
- \global\currentTABLEcolumn\zerocount}}
-
-\def\fillTABLEcolumns
- {\ifnum\currentTABLEcolumn>\maxTABLEcolumn \else
- \global\advance\currentTABLEcolumn \plusone
- \normalTABLEquote
- \expandafter\fillTABLEcolumns
- \fi}
-
-%D Next we enter the more complicated area of column and row
-%D switching. I won't go into much detail from now on, but just
-%D mention the general principles.
-%D
-%D \startitemize[3*ruim]
-%D \sym{\type{\SR}} end a separate row (between rules)
-%D \sym{\type{\FR}} end a first row (after a rule)
-%D \sym{\type{\MR}} end a mid row (between text lines)
-%D \sym{\type{\LR}} end a last row (before a rule)
-%D \stopitemize
-%D
-%D and best of all:
-%D
-%D \startitemize[continue]
-%D \sym{\type{\AR}} end a row with automatic spacing
-%D \stopitemize
-%D
-%D As far as possible, we report confusing situations. In
-%D most cases one can use \type{\AR}, which transfigurates
-%D itself into one of the other types.
-%D
-%D \starttyping
-%D \starttable[||]
-%D \HL
-%D \VL a separate row \VL\SR
-%D \HL
-%D \VL a first row \VL\FR
-%D \VL a mid row \VL\MR
-%D \VL a last row \VL\LR
-%D \HL
-%D \stoptable
-%D \stoptyping
-%D
-%D In this example we could have used \type{\AR} without
-%D problems.
-%D
-%D Color or gray scale backgrounds precede the content. They
-%D are passed over horizontal (division) lines when needed.
-%D Errors in the color template are traced elsewhere. Here we
-%D only check for inconsistent spacing. Due to the way \TEX\
-%D handles alignments, we cannot automate spacing for colored
-%D rows and columns.
-
-\chardef\TABLErowzero=0
-
-\def\checkTABLErow#1% pure for message purposes
- {\unskip % added
- \ifTABLEgraydone
- \defconvertedargument\asciia{#1}%
- \defconvertedcommand \asciib\TABLEendBCL
- \ifx\asciia\asciib \else
- \writestatus\m!TABLE{confusing \asciia\space and \asciib}%
- \gdef\TABLEgraylineerror%
- {\globalletempty\TABLEgraylineerror
- [\asciia\unskip<->\asciib\unskip]}%
- \fi
- \global\TABLEgraydonefalse
- \fi}
-
-\def\defineTABLEendings
- {\let\SR\TableSR
- \let\FR\TableFR
- \let\MR\TableMR
- \let\LR\TableLR
- \let\AR\TableAR}
-
-\def\TableSR
- {\ifTABLEgrayline \else
- \ifnum\TABLEaction=\TABLEfirstrow
- \writestatus\m!TABLE{change \string\SR\space into \string\MR/\string\LR}%
- \else\ifnum\TABLEaction=\TABLEmidrow
- \writestatus\m!TABLE{change \string\SR\space into \string\MR/\string\LR}%
- \else\ifnum\TABLEaction=\TABLEmidrow
- \writestatus\m!TABLE{change \string\SR\space into \string\MR/\string\LR}%
- \fi\fi\fi
- \fi
- \checkTABLErow\SR
- \endTABLErow\TABLEseparaterow\TABLErowfactor\TABLErowfactor}
-
-\def\TableFR
- {\ifTABLEgrayline \else
- \ifnum\TABLEaction=\TABLEmidrow
- \writestatus\m!TABLE{change \string\FR\space into \string\MR/\string\LR}%
- \else\ifnum\TABLEaction=\TABLElastrow
- \writestatus\m!TABLE{change \string\FR\space into \string\MR/\string\LR}%
- \fi\fi
- \fi
- \checkTABLErow\FR
- \endTABLErow\TABLEfirstrow\TABLErowfactor\TABLErowzero}
-
-\def\TableMR
- {\ifTABLEgrayline \else
- \ifnum\TABLEaction=\TABLErule
- \writestatus\m!TABLE{change \string\MR\space into \string\FR/\string\SR}%
- \else\ifnum\TABLEaction=\TABLElastrow
- \writestatus\m!TABLE{change \string\MR\space into \string\FR}%
- \fi\fi
- \fi
- \checkTABLErow\MR
- \endTABLErow\TABLEmidrow00}
-
-\def\TableLR
- {\ifTABLEgrayline \else
- \ifnum\TABLEaction=\TABLErule
- \writestatus\m!TABLE{change \string\LR\space into \string\FR/\string\SR}%
- \fi
- \fi
- \checkTABLErow\LR
- \endTABLErow\TABLElastrow\TABLErowzero\TABLErowfactor}
-
-%D \macros
-%D {ifcheckTABLEcolums}
-%D
-%D
-%D The next macros handle the actual row ending. This macro
-%D also take care of space corrections due to table splitting
-%D when \type{\MR} and collegues are used. When tracing is
-%D enabled, the corrections as well as the values used to
-%D determine the available space are shown (in color). By default
-%D checking is off.
-
-\newif\ifcheckTABLEcolumns
-
-\let\beforeTABLEline\empty
-\let\afterTABLEline \empty
-
-\def\doendTABLErow#1#2#3%
- {\handleTABLEbreak#2#3%
- \beforeTABLEline
- \ifcase#1\relax
- % unknown
- \or
- \endofTABLEline[blue][\SR->\SR]\TABLErowfactor\TABLErowfactor
- \or
- \endofTABLEline[red][\FR->\FR]\TABLErowfactor\TABLErowzero
- \or
- \ifnum\TABLEforce=\TABLEforcelastrow
- \endofTABLEline[red][\MR->\LR]\TABLErowzero\TABLErowfactor
- \else\ifnum\TABLEforce=\TABLEforcefirstrow
- \endofTABLEline[red][\MR->\FR]\TABLErowfactor\TABLErowzero
- \else
- \endofTABLEline[green][\MR->\MR]\TABLErowzero\TABLErowzero
- \fi\fi
- \or
- \endofTABLEline[red][\LR->\LR]\TABLErowzero\TABLErowfactor
- \fi
- \TABLEnoalign
- {\setTABLEforce\TABLEunknown
- \global\currentTABLEcolumn\zerocount}%
- \afterTABLEline}
-
-\def\endTABLErow#1#2#3%
- {\setTABLEaction#1%
- \ifTABLEgrayline
- \finishTABLErow
- \else
- \ifnum\currentTABLEcolumn>\maxTABLEcolumn
- \doendTABLErow{#1}{#2}{#3}%
- \else\ifcheckTABLEcolumns
- \setTABLEerror\TABLEmissingcolumn
- \handleTABLEerror
- \else
- \doendTABLErow{#1}{#2}{#3}%
- \fi\fi
- \fi}
-
-%D Handling \type{\AR} is postponed till the next row. The
-%D check takes care of the first and mid rows, the chuck macro
-%D |<|how about that name|>| handles the last row.
-
-\def\TableAR
- {\ifTABLEgraydone
- \globalletempty\checkTABLEautorow
- \globalletempty\chuckTABLEautorow
- \global\TABLEgraydonefalse
- \TABLEendBCL
- \else
- \globallet\checkTABLEautorow\docheckTABLEautorow
- \globallet\chuckTABLEautorow\dochuckTABLEautorow
- \fi}
-
-\let\checkTABLEautorow\empty
-\let\chuckTABLEautorow\empty
-
-\def\docheckTABLEautorow
- {\globallet\checkTABLEautorow\empty
- \ifnum\TABLEaction=\TABLErule \FR
- \else\ifnum\TABLEaction=\TABLEunknown \FR
- \else \MR
- \fi\fi}
-
-\def\dochuckTABLEautorow
- {\globalletempty\checkTABLEautorow
- \globalletempty\chuckTABLEautorow
- \ifnum\TABLEaction=\TABLErule \SR
- \else\ifnum\TABLEaction=\TABLEunknown \SR
- \else \LR
- \fi\fi}
-
-%D When a table is split, we also add a tail and when present
-%D we repeat the table head.
-
-\def\handleTABLEbreak#1#2%
- {\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.
-
-\def\endofTABLEline[#1][#2->#3]#4#5%
- {\ifx#2#3\else
- \writestatus\m!TABLE{\string#2\space changed into \string#3}%
- \fi
- \iftracetables
- \bgroup
- \tttf\space
- \ifnum\TABLEerror=\TABLEunknown
- \ifx#2#3\else\string#2->\fi
- \else
- ->%
- \fi
- \color[#1]{\string#3}%
- \ifx\TABLEgraylineerror\empty
- \space\TABLEgraylinestatus
- \else
- \space\TABLEgraylineerror
- \fi
- \egroup
- \else\ifx\TABLEgraylineerror\empty \else
- % \bgroup
- % \tttf\space\TABLEgraylineerror
- % \egroup
- \fi\fi
- \globalletempty\TABLEgraylinestatus
- \globalletempty\TABLEgraylineerror
- \expandafter\normalTABLElineformat#4#5\crcr % \crcr nodig ?
- \TABLEnoalign{\nobreak\global\setTABLEactiontrue}}
-
-%D In order to prevent (as good as possible) alignment overflow
-%D and therefore \TEX\ error messages, we check the maximum
-%D number of columns. We keep track of the current column and
-%D maximum column by means of two \COUNTERS. Keep in mind that
-%D the number of \type{|}'s and \type{\VL}'s or alike is always
-%D one more than the number of columns.
-
-\newcount\currentTABLEcolumn
-\newcount\maxTABLEcolumn
-
-%D While defining this macro we change the \CATCODE\ of
-%D \type{|}. When counting the bars, we use a non active
-%D representation of the bar, simply because we cannot be sure
-%D if the bar is active or not.\footnote{Normally it is, but
-%D \TABLE\ changes the catcode when needed.}
-
-\bgroup
- \catcode`\|=\@@other \gdef\@@otherbar {|}
- \catcode`\"=\@@other \gdef\@@otherquote {"}
- \catcode`\|=\@@active \gdef\@@useotherbar {\let|\@@otherbar}
- \catcode`\"=\@@active \gdef\@@useotherquote{\let"\@@otherquote}
-\egroup
-
-\bgroup \catcode`\|=\@@other
-
-\gdef\getTABLEnofcolumns#1%
- {\bgroup
- \cleanupfeatures % needed !
- \@@useotherbar
- \@@useotherquote
- \expanded{\defconvertedargument\noexpand\ascii{#1}}%
- \@EA\doglobal\@EA\counttoken\@EA|\@EA\in\ascii\to\maxTABLEcolumn
- \global\advance\maxTABLEcolumn \minusone
- % in case of & counting, divide by 2
- \egroup}
-
-\egroup
-
-\def\!ttDoHalign
- {\edef\restoretablelineskips
- {\baselineskip \the\baselineskip
- \lineskiplimit\the\lineskiplimit
- \lineskip \the\lineskip
- \tabskip \the\tabskip}%
- \baselineskip \zeropoint
- \lineskiplimit\zeropoint
- \lineskip \zeropoint
- \tabskip \zeropoint
- % does not work in normal tex
- % \expanded{\getTABLEnofcolumns{\the\!taPreamble}}% added
- \halign \the\!taTableSpread \bgroup
- \span\the\!taPreamble
- \ifx \!tfRowOfWidths \empty \else \!tfRowOfWidths \cr \fi}
-
-%D \startitemize[3*ruim]
-%D \sym{\type{\VL}} a vertical line
-%D \sym{\type{\VC}} a vertical colored line
-%D \sym{\type{\HL}} a horizontal line
-%D \sym{\type{\HC}} a horizontal colored line
-%D \stopitemize
-
-% \def\defineTABLErules
-% {\let\VL\TableVL
-% \let\VC\TableVC
-% \let\HL\TableHL
-% \let\HC\TableHC}
-
-\def\defineTABLErules
- {\let\VL\TableVL
- \let\VC\TableVC
- \let\HL\TableHL
- \let\HC\TableHC
- \let\VS\TableVS
- \let\VD\TableVD
- \let\VT\TableVT
- \let\VN\TableVN}
-
-\def\TableVL
- {\checkTABLEautorow
- \nextTABLEgrayline
- \ifnum\currentTABLEcolumn>\maxTABLEcolumn
- \setTABLEerror\TABLEmissingrow
- \handleTABLEerror
- \else
- \global\advance\currentTABLEcolumn \plusone
- \expandafter\doTableVL
- \fi}
-
-\def\doTableVL
- {\futurelet\next\dodoTableVL}
-
-\def\dodoTableVL
- {\docomplexorsimpleTable\complexTableVL\simpleTableVL}
-
-\def\complexTableVL[#1]%
- {\scratchcounter=0#1%
- \multiply\scratchcounter \@@tiVLwidth
- \setxvalue{wVL\the\currentTABLEcolumn}{\the\scratchcounter}%
- \simpleTableVL}
-
-\def\simpleTableVL
- {\doifundefined{wVL\the\currentTABLEcolumn}%
- {\setgvalue{wVL\the\currentTABLEcolumn}{\@@tiVLwidth}}%
- \gdef\TABLEbeforebar
- {\getvalue{bVL\the\currentTABLEcolumn}%
- \letgvalueempty{bVL\the\currentTABLEcolumn}}%
- \gdef\TABLEafterbar
- {\getvalue{eVL\the\currentTABLEcolumn}%
- \letgvalueempty{eVL\the\currentTABLEcolumn}}%
- \edef\@@tiVLwidth{\getvalue{wVL\the\currentTABLEcolumn}}%
- \expanded{\normalTABLEcomplexbar\@@tiVLwidth\space}}% \relax breaks \use
-
-% \starttable[|||]
-% \HL
-% \VL test \VS test \VL \FR
-% \VL test \VD test \VL \MR
-% \VL test \VT test \VL \LR
-% \HL
-% \stoptable
-
-\def\TableVS {\VN1}
-\def\TableVD {\VN2}
-\def\TableVT {\VN3}
-\def\TableVN#1{\gdef\@VLn{#1}\VL}
-
-\def\resetVLvalues
- {\dostepwiserecurse\zerocount\maxTABLEcolumn\plusone
- {\setgvalue{wVL\recurselevel}{\@@tiVLwidth}%
- \letgvalueempty{bVL\recurselevel}%
- \letgvalueempty{eVL\recurselevel}}%
- \global\currentTABLEcolumn\zerocount}
-
-\def\TableVC
- {\checkTABLEautorow
- \nextTABLEgrayline
- \ifnum\currentTABLEcolumn>\maxTABLEcolumn
- \setTABLEerror\TABLEmissingrow
- \handleTABLEerror
- \else
- \global\advance\currentTABLEcolumn \plusone
- \expandafter\doTableVC
- \fi}
-
-\def\doTableVC
- {\futurelet\next\dodoTableVC}
-
-\def\dodoTableVC
- {\docomplexorsimpleTable\complexTableVC\simpleTableVC}
-
-\def\complexTableVC[#1]%
- {\global\setvalue{bVC\the\currentTABLEcolumn}{\localstartcolor[#1]}%
- \global\setvalue{eVC\the\currentTABLEcolumn}{\localstopcolor}%
- \simpleTableVC}
-
-\def\simpleTableVC
- {\global\setvalue{bVL\the\currentTABLEcolumn}%
- {\getvalue{bVC\the\currentTABLEcolumn}}%
- \global\setvalue{eVL\the\currentTABLEcolumn}%
- {\getvalue{eVC\the\currentTABLEcolumn}}%
- \doTableVL}
-
-\def\TableHL
- {\ifnum\currentTABLEcolumn>\maxTABLEcolumn
- \chuckTABLEautorow
- \else\ifnum\currentTABLEcolumn=\zerocount
- %\chuckTABLEautorow
- \TABLEnoalign
- {\globalletempty\checkTABLEautorow
- \globalletempty\chuckTABLEautorow}%
- \else
- \setTABLEerror\TABLEmissingcolumn
- \handleTABLEerror
- \fi\fi
- \complexorsimpleTable{HL}}
-
-\def\complexTableHL[#1]%
- {\TABLEnoalign
- {\scratchcounter0#1%
- \multiply\scratchcounter \@@tiHLheight
- \edef\@@tiHLheight{\the\scratchcounter}%
- \simpleTableHL}}
-
-\def\simpleTableHL
- {\TABLEnoalign
- {\nobreak
- \ifnum\TABLEaction=\TABLErule
- \writestatus\m!TABLE{skipping \string\HL}% \statusmessage
- \else
- \ifnum\TABLEaction=\TABLEmidrow
- \writestatus\m!TABLE{change \string\MR\space into \string\LR/\string\SR}%
- \else\ifnum\TABLEaction=\TABLEfirstrow
- \writestatus\m!TABLE{change \string\MR\space into \string\SR}%
- \fi\fi
- \startHLcommand
- \expandafter\normalTABLEfullrule\@@tiHLheight
- \stopHLcommand
- \globalletempty\startHLcommand
- \globalletempty\stopHLcommand
- \accountTABLElinewidth
- \fi
- \setTABLEaction\TABLErule
- \nobreak}}
-
-\let\startHLcommand\empty
-\let\stopHLcommand \empty
-
-\def\TableHC
- {\complexorsimpleTable{HC}}
-
-\def\complexTableHC[#1]%
- {\TABLEnoalign
- {\gdef\startHCcommand{\localstartcolor[#1]}%
- \gdef\stopHCcommand {\localstopcolor}}%
- \simpleTableHC}
-
-\def\simpleTableHC
- {\TABLEnoalign
- {\globallet\startHLcommand\startHCcommand
- \globallet\stopHLcommand \stopHCcommand}%
- \HL}
-
-%D \startitemize[3*ruim]
-%D \sym{\type{\NL}} a vertical skip
-%D \sym{\type{\NR}} goto the next row
-%D \sym{\type{\NC}} goto the next column
-%D \sym{\type{\FC}} a first column
-%D \sym{\type{\MC}} a mid column
-%D \sym{\type{\LC}} a last column
-%D \stopitemize
-
-% n+1 uitleggen
-
-\def\defineTABLEsteps
- {\let\NL\TableNL
- \let\NR\TableNR
- \let\NC\TableNC
- \let\FC\TableNC
- \let\MC\TableNC
- \let\LC\TableNC}
-
-\def\TableNL
- {\complexorsimpleTable{NL}}
-
-\def\complexTableNL[#1]%
- {\TABLEnoalign
- {\edef\@@tiNL{#1}%
- \simpleTableNL}}%
-
-\def\simpleTableNL
- {\TABLEnoalign
- {\nobreak
- \setbox0\vbox{\blank[\@@tiNL]}%
- \vskip\ht0
- \nobreak}}
-
-\def\TableNR
- {\ifnum\currentTABLEcolumn>\maxTABLEcolumn
- \global\currentTABLEcolumn\zerocount
- \normalTABLElineending
- \else
- \setTABLEerror\TABLEmissingcolumn
- \handleTABLEerror
- \fi
- \TABLEnoalign
- {\nobreak
- \setTABLEaction\TABLEunknown}}
-
-\def\TableNC
- {\checkTABLEautorow
- \nextTABLEgrayline
- \ifnum\currentTABLEcolumn>\maxTABLEcolumn
- \setTABLEerror\TABLEmissingrow
- \handleTABLEerror
- \else
- \global\advance\currentTABLEcolumn \plusone
- \normalTABLEquote
- \fi}
-
-% \bgroup
-% \catcode`\|=\@@active
-% \catcode`\"=\@@active
-% \gdef\redefinetablebarandquote
-% {\def|{\VL}% % \normalTABLEsimplebar
-% \def\|##1{\VL[##1]}% % \normalTABLEcomplexbar
-% \def"{\NC}} % \normalTABLEquote
-% \egroup
-
-\let\redefinetablebarandquote\relax
-
-%D \startitemize[3*ruim]
-%D \sym{\type{\DL}}
-%D \sym{\type{\DV}} (\type{\VD})
-%D \sym{\type{\DC}}
-%D \sym{\type{\DR}}
-%D \stopitemize
-
-\newif\ifTABLEdivision
-
-% \def\defineTABLEdivisions
-% {\global\TABLEdivisionfalse % in start
-% \let\DL\TableDL
-% \let\DC\TableDC
-% \let\DV\TableDV
-% \let\VD\TableDV
-% \let\DR\TableDR}
-
-\def\defineTABLEdivisions
- {\global\TABLEdivisionfalse % in start
- \let\DL\TableDL
- \let\DC\TableDC
- \let\DV\TableDV
- \let\DR\TableDR}
-
-\def\checkTABLEdivision
- {\ifTABLEdivision \else
- \chuckTABLEautorow
- \global\currentTABLEcolumn\zerocount
- \global\TABLEdivisiontrue
- \fi}
-
-\def\TableDL
- {\checkTABLEdivision
- \complexorsimpleTable{DL}}
-
-\def\simpleTableDL
- {\complexTableDL[1]}
-
-\def\complexTableDL[#1]%
- {\ifnum\TABLEaction=\TABLErule
- \writestatus\m!TABLE{skipping \string\DL}%
- \else
- \ifnum\TABLEaction=\TABLEmidrow
- \writestatus\m!TABLE{change \string\MR\space into \string\LR/\string\SR}%
- \else\ifnum\TABLEaction=\TABLEfirstrow
- \writestatus\m!TABLE{change \string\MR\space into \string\SR}%
- \fi\fi
- \setTABLEaction=\TABLEunknown
- \ifnum\currentTABLEcolumn>\maxTABLEcolumn
- \setTABLEerror\TABLEmissingrow
- \handleTABLEerror
- \fi
- %\startHLcommand
- \ifnum#1=\plusone
- \global\advance\currentTABLEcolumn \plustwo
- \let\next\normalTABLEsinglerule
- \else
- \ifnum#1<\maxTABLEcolumn
- \global\advance\currentTABLEcolumn \plusone
- \def\next{\normalTABLEmultirule{#1}}%
- \else
- \setTABLEerror\TABLEdivisionoverflow
- \let\next\handleTABLEerror
- \fi
- \fi
- \next
- %\stopHLcommand
- %\globalletempty\startHLcommand
- %\globalletempty\stopHLcommand
- \fi}
-
-\def\TableDV
- {\TableDCV\normalTABLEsimplebar}
-
-\def\TableDC
- {\TableDCV\normalTABLEquote}
-
-\def\TableDCV#1%
- {\checkTABLEdivision
- \checkTABLEautorow
- \ifnum\currentTABLEcolumn>\maxTABLEcolumn
- \setTABLEerror\TABLEmissingrow
- \handleTABLEerror
- \else
- \global\advance\currentTABLEcolumn \plusone
- #1%
- \fi}
-
-\def\TableDR
- {\ifnum\currentTABLEcolumn<\maxTABLEcolumn % silent recovery
- %\setTABLEerror\TABLEmissingcolumn % some day warning
- %\handleTABLEerror
- \finishTABLErow
- \else
- \global\currentTABLEcolumn\zerocount % nog check
- \normalTABLElineending
- \fi
- \TABLEnoalign
- {\nobreak
- \global\TABLEdivisionfalse
- \accountTABLElinewidth % temporary solution
- \setTABLEaction\TABLErule}}
-
-\def\accountTABLElinewidth
- {\scratchdimen\LineThicknessUnit}
-
-%D \startitemize[3*ruim]
-%D \sym{\type{\BC}}
-%D \sym{\type{\BR}}
-%D \sym{\type{\BACKGROUND}}
-%D \sym{\type{\CL}}
-%D \sym{\type{\RL}}
-%D \sym{\type{\BL}}
-%D \sym{\type{\RASTER}}
-%D \sym{\type{\COLOR}}
-%D \stopitemize
-
-% definieer: \BC \BL
-% herhaal: \BR
-% definieer: \CL \RL (eerste \CL[green] = hele row! / \CL[1,green])
-% dus: \CL en \RL mix tussen \HL en \BL
-
-\def\defineTABLEbackgrounds
- {\let\BC \TableBC
- \let\BL \TableBL
- \let\BR \TableBR
- \let\BACKGROUND\TableBR
- \let\CL \TableCL
- \let\RL \TableRL
- \let\COLOR \TableCOLOR
- \let\RASTER \TableRASTER
- \globallet\lastTABLEc\@@tibackgroundcolor
- \globallet\lastTABLEr\@@tibackgroundscreen
- \doifinsetelse\@@tibackground{c,color} % \v!color
- {\global\chardef\TABLEcr\plusone}
- {\global\chardef\TABLEcr\plustwo}}
-
-\def\TableBC
- {\ifTABLEgrayline
- \normalTABLEquote
- \else
- \TABLEnoalign\bgroup
- \globallet\nextTABLEgrayline\executeTABLEgrayline
- \globalletempty\TABLEgrayline % new
- \let\BL\doTableBL
- \let\BC\doTableBC
- \expandafter\doTableBC
- \fi}
-
-\def\doTableBC
- {\addtoTABLEgrayline{\BC}%
- \gobbleTableBCL}
-
-\def\TableBL
- {\TABLEnoalign\bgroup
- \globallet\nextTABLEgrayline\executeTABLEgrayline
- \globalletempty\TABLEgrayline % new
- \let\BL\doTableBL
- \let\CL\doTableCL
- \let\RL\doTableRL
- \let\BC\doTableBC
- \doTableBL}
-
-\def\doTableBL
- {\complexorsimpleTable{BL}}
-
-\def\simpleTableBL
- {\complexTableBL[,]}
-
-\def\complexTableBL[#1]%
- {\analyzeTABLEcr[#1]%
- \handleTABLEcr}
-
-\def\TableBR#1%
- {\TABLEnoalign
- {\globallet\nextTABLEgrayline\executeTABLEgrayline
- \checkTABLEgrayline#1\BR
- \global\TABLEgraylinetrue}}
-
-\def\analyzeTABLEcr[#1]%
- {\doanalyzeTABLEcr[#1,,]}
-
-\def\doanalyzeTABLEcr[#1,#2,#3]%
- {\doifnumberelse{#1x} % Is the x still needed here?
- {\dodoanalyzeTABLEcr[#1,#2,#3]}
- {\dodoanalyzeTABLEcr[1,#1,#2]}}
-
-\def\dodoanalyzeTABLEcr[#1,#2,#3]%
- {\global\chardef\TABLEn#1\relax
- \processaction
- [#2]
- [ c=>\global\chardef\TABLEcr1,%
- color=>\global\chardef\TABLEcr1,%
- r=>\global\chardef\TABLEcr2,%
- raster=>\global\chardef\TABLEcr2]%
- \ifcase\TABLEcr \or
- \doifsomething{#3}{\xdef\lastTABLEc{#3}}%
- \or
- \doifsomething{#3}{\xdef\lastTABLEr{#3}}%
- \fi}
-
-\def\handleTABLEcr
- {\relax % else funny side effect
- \ifcase\TABLEcr
- % Can't happen!
- \or
- \addtoTABLEgrayline{\complexTableCOLOR[\the\TABLEn,\lastTABLEc]}%
- \else
- \addtoTABLEgrayline{\complexTableRASTER[\the\TABLEn,\lastTABLEr]}%
- \fi
- \gobbleTableBCL}
-
-\def\analyzeTABLEcrl#1[#2]%
- {\doanalyzeTABLEcrl#1[#2,,]}
-
-\def\doanalyzeTABLEcrl#1[#2,#3,#4]%
- {\doifnumberelse{#2x} % x ????????????????????
- {\dodoanalyzeTABLEcr[#2,#1,#3]}
- {\dodoanalyzeTABLEcr[\ifTABLEgrayline1\else\maxTABLEcolumn\fi,#1,#2]}}
-
-\def\TableCL
- {\TABLEnoalign\bgroup
- \globallet\nextTABLEgrayline\executeTABLEgrayline
- \globalletempty\TABLEgrayline % new
- \let\BL\doTableBL
- \let\CL\doTableCL
- \let\RL\doTableRL
- \let\BC\doTableBC
- \doTableCL}
-
-\def\doTableCL
- {\complexorsimpleTable{CL}}
-
-\def\simpleTableCL% nog eens \'e\'en lijn van maken
- {\BL[\the\maxTABLEcolumn,c,\lastTABLEc]}
-
-\def\complexTableCL[#1]%
- {\analyzeTABLEcrl{c}[#1]%
- \handleTABLEcr}
-
-\def\TableRL
- {\TABLEnoalign\bgroup
- \globallet\nextTABLEgrayline\executeTABLEgrayline
- \globalletempty\TABLEgrayline % new
- \let\BL\doTableBL
- \let\CL\doTableCL
- \let\RL\doTableRL
- \let\BC\doTableBC
- \doTableRL}
-
-\def\doTableRL
- {\complexorsimpleTable{RL}}
-
-\def\simpleTableRL
- {\BL[\the\maxTABLEcolumn,r,\lastTABLEr]}
-
-\def\complexTableRL[#1]%
- {\analyzeTABLEcrl{r}[#1]%
- \handleTABLEcr}
-
-\def\checkTABLEgrayline#1#2%
- {\!!doneatrue
- \ifx#1\AR
- \!!doneafalse
- \else\ifx#1\SR\else\ifx#1\FR\else\ifx#1\MR\else\ifx#1\LR\else
- \!!doneafalse
- \fi\fi\fi\fi\fi
- \if!!donea
- \gdef\TABLEgraylinestatus
- {[\string#1]}%
- \gdef\TABLEendBCL
- {#1}%
- \else
- \gdef\TABLEgraylineerror
- {[\string#2\string#1->\string#2\string\SR]}%
- \gdef\TABLEendBCL
- {\SR}%
- \fi}
-
-\def\endTABLErowGL#1#2#3%
- {\ifcase#1\relax
- % unknown
- \or
- \doPreTableGL\TABLErowfactor\TABLErowfactor
- \or
- \doPreTableGL\TABLErowfactor\TABLErowzero
- \or
- \ifnum\TABLEforce=\TABLEforcelastrow
- \doPreTableGL\TABLErowzero\TABLErowfactor
- \else\ifnum\TABLEforce=\TABLEforcefirstrow
- \doPreTableGL\TABLErowfactor\TABLErowzero
- \else
- \doPreTableGL\TABLErowzero\TABLErowzero
- \fi\fi
- \or
- \doPreTableGL\TABLErowzero\TABLErowfactor
- \fi}
-
-\def\doPreTableGL#1#2% betere namen
- {\xdef\OldLineThicknessFactor{\the\LineThicknessFactor}%
- \xdef\OldLineThicknessUnit{\the\LineThicknessUnit}%
- \global\LineThicknessFactor\plusone
- \setbox0\hbox{\AugmentedTableStrut{#1}{#2}}%
- \getboxheight\dimen0\of\box0\relax
- \xdef\TABLEgraylineHeight{\the\dimen0}%
- \global\LineThicknessUnit\TABLEgraylineHeight}
-
-\def\doPostTableGL
- {\global\LineThicknessFactor\OldLineThicknessFactor
- \global\LineThicknessUnit \OldLineThicknessUnit}
-
-% kan simpeler
-
-\def\docomplexTableCOLOR[#1]%
- {\dodocomplexTableGL\localstartcolor \localstopcolor [#1,\lastTABLEc,,]}
-
-\gdef\docomplexTableRASTER[#1]%
- {\dodocomplexTableGL\localstartraster\localstopraster[#1,\lastTABLEr,,]}
-
-\def\dodocomplexTableGL#1#2[#3,#4,#5,#6]%
- {\doifelsenothing{#4}{#1[#5]}{#1[#4]}%
- \doPreTableGL\TABLEendofrowheight\TABLEendofrowdepth
- \ifnum#3=\plusone % else conflict with \omit in \=
- \let\next\normalTABLEsinglerule
- \else
- \def\next{\normalTABLEmultirule{#3}}%
- \fi
- \next
- \doPostTableGL
- #2}
-
-\def\TableBACKGROUND
- {\TableBR}
-
-\def\simpleTableRASTER #1{\docomplexTableRASTER[1]#1}
-\def\complexTableRASTER[#1]{\docomplexTableRASTER[#1]}
-\def\simpleTableCOLOR {\docomplexTableCOLOR [1]}
-\def\complexTableCOLOR [#1]{\docomplexTableCOLOR [#1]}
-
-\def\TableRASTER{\complexorsimpleTable{RASTER}}
-\def\TableCOLOR {\complexorsimpleTable{COLOR}}
-
-\def\addtoTABLEgrayline#1%
- {\TABLEgraytoks\expandafter{\TABLEgrayline}%
- \xdef\TABLEgrayline{\the\TABLEgraytoks\noexpand#1}}
-
-\def\setTableBCL#1#2%
- {\ifx#1#2%
- \gdef\TABLEgraylinestatus{[\string#1]}%
- \gdef\TABLEendBCL{#1}%
- \addtoTABLEgrayline{#1}%
- \else
- \gdef\TABLEgraylineerror{[\string#1->\string#2]}%
- \gdef\TABLEendBCL{#2}%
- \addtoTABLEgrayline{#2}%
- \fi}
-
-\def\gobbleTableBCL#1%
- {\ifx#1\BC \let\next\doTableBC \else
- \ifx#1\BL \let\next\doTableBL \else
- \ifx#1\SR \setTableBCL\SR\SR \let\next\egroup \else
- \ifx#1\FR \setTableBCL\FR\FR \let\next\egroup \else
- \ifx#1\MR \setTableBCL\MR\MR \let\next\egroup \else
- \ifx#1\LR \setTableBCL\LR\LR \let\next\egroup \else
- \setTableBCL #1\SR \let\next\egroup
- \fi\fi\fi\fi\fi\fi
- \next}
-
-\def\executeTABLEgrayline
- {\TABLEnoalign
- {\def\BC
- {\advance\currentTABLEcolumn \plusone}%
- \def\dodocomplexTableGL##1##2[##3,##4,##5,##6]%
- {\BC\advance\currentTABLEcolumn ##3 }%
- \let\endTABLErow\endTABLEgrayrow
- \currentTABLEcolumn\zerocount
- \TABLEgrayline\TABLEendBCL % determine n of columns and height
- \advance\currentTABLEcolumn \minusone
- \ifnum\currentTABLEcolumn>\maxTABLEcolumn
- % error message too long line
- \globalletempty\TABLEgrayline
- \else
- % \message{n of color columns: \the\currentTABLEcolumn}\wait
- \global\TABLEgraylinetrue % vanaf hier nog checken
- \fi
- \global\currentTABLEcolumn\zerocount}%
- \unskip\TABLEgrayline\TABLEendBCL
- \TABLEnoalign
- {\nobreak
- \vskip-\TABLEgraylineHeight
- \nobreak
- \global\setTABLEactiontrue
- \global\currentTABLEcolumn\zerocount
- \globalletempty\nextTABLEgrayline
- \global\TABLEgraydonetrue
- \global\TABLEgraylinefalse}}
-
-\def\endTABLEgrayrow#1#2#3%
- {\ifcase#1\relax
- \global\chardef\TABLEendofrowheight\TABLErowfactor
- \global\chardef\TABLEendofrowdepth \TABLErowfactor
- \or
- \global\chardef\TABLEendofrowheight\TABLErowfactor
- \global\chardef\TABLEendofrowdepth \TABLErowfactor
- \or
- \global\chardef\TABLEendofrowheight\TABLErowfactor
- \global\chardef\TABLEendofrowdepth \TABLErowzero
- \or
- \ifnum\TABLEforce=\TABLEforcelastrow
- \global\chardef\TABLEendofrowheight\TABLErowzero
- \global\chardef\TABLEendofrowdepth \TABLErowfactor
- \else\ifnum\TABLEforce=\TABLEforcefirstrow
- \global\chardef\TABLEendofrowheight\TABLErowfactor
- \global\chardef\TABLEendofrowdepth \TABLErowzero
- \else
- \global\chardef\TABLEendofrowheight\TABLErowzero
- \global\chardef\TABLEendofrowdepth \TABLErowzero
- \fi\fi
- \or
- \global\chardef\TABLEendofrowheight\TABLErowzero
- \global\chardef\TABLEendofrowdepth \TABLErowfactor
- \fi}
-
-\def\defineTABLEshorthands%
- {\def\SPAN##1{\use{##1}}%
- \def\TWO {\use2}%
- \def\THREE {\use3}%
- \def\FOUR {\use4}%
- \def\FIVE {\use5}%
- \def\SIX {\use6}%
- \def\REF {\ReFormat}}
-
-\def\defineTABLEunits
- {\processaction
- [\@@tidistance]
- [ \v!none=>\OpenUp00\def\LOW{\Lower6 },
- \v!small=>\OpenUp00\def\LOW{\Lower6 }, % == baseline
- \v!medium=>\OpenUp11\def\LOW{\Lower7 },
- \v!big=>\OpenUp22\def\LOW{\Lower8 }]%
- \doifelse\@@tidistance\v!none
- {\chardef\TABLErowfactor\zerocount}
- {\chardef\TABLErowfactor\plustwo }}
-
-\def\dohandlebar % here ?
- {\ifmmode
- \@EA\domathmodebar
- \else\ifintable
- \@EAEAEA\domathmodebar
- \else
- \@EAEAEA\dotextmodebar
- \fi\fi}
-
-% De macro's t.b.v. instellingen.
-
-\def\setuptables
- {\dosingleargument\dosetuptables}
-
-\def\dosetuptables[#1]%
- {\getparameters[\??ti][#1]%
- \processaction
- [\@@tialign]
- [ \v!right=>\def\TABLEparalignment{\raggedright},
- \v!left=>\def\TABLEparalignment{\raggedleft},
- \v!middle=>\def\TABLEparalignment{\raggedcenter},
- \s!default=>\def\TABLEparalignment{\notragged},
- \s!unknown=>\def\TABLEparalignment{\notragged}]%
- \assignalfadimension\@@tiVL\@@tiVLwidth 246%
- \assignalfadimension\@@tiHL\@@tiHLheight246}
-
-\def\localTABLEsetup
- {\@@ticommands\relax
- \expanded{\switchtobodyfont[\@@tibodyfont]}%
- \StrutHeightFactor 8
- \StrutDepthFactor 4
- \LineThicknessFactor4
- \NormalTLTU {.1pt}%
- \NormalTSU {\normalbaselineskip\divide\StrutUnit 12 }%
- \NormalTableUnits}
-
-%D And then I wrote the tabulate environment. That
-%D alternative supports setting the rule thickness and color,
-%D so here is the table alternative.
-
-\let\startglobalTABLEcolor\empty
-\let\stopglobalTABLEcolor \empty
-
-\def\localTABLEsetup
- {\@@ticommands\relax
- % bodyfont
- \expanded{\switchtobodyfont[\@@tibodyfont]}%
- % linecolor
- \doifsomething\@@tirulecolor
- {\def\startglobalTABLEcolor{\localstartcolor[\@@tirulecolor]}%
- \def\stopglobalTABLEcolor {\localstopcolor}}%
- % linethickness
- \LineThicknessFactor4
- \scratchdimen\@@tirulethickness
- \divide\scratchdimen \LineThicknessFactor
- \expanded{\NormalTLTU{\the\scratchdimen}}%
- % spacing, was depth=4 height=8 (counters, sigh, now macros)
- \doifelse\@@tiheight\v!strut
- {\let\StrutHeightFactor\@@itheight}
- {\let\StrutHeightFactor\@@tiheight}%
- \doifelse\@@tidepth\v!strut
- {\let\StrutDepthFactor\@@itdepth}
- {\let\StrutDepthFactor\@@tidepth}%
- \scratchdimen\StrutHeightFactor\points \multiply\scratchdimen 10%
- \edef\StrutHeightFactor{\withoutpt\the\scratchdimen}%
- \scratchdimen\StrutDepthFactor \points \multiply\scratchdimen 10%
- \edef\StrutDepthFactor{\withoutpt\the\scratchdimen}%
- % units
- \NormalTSU{\normalbaselineskip\divide\StrutUnit 12 }%
- \NormalTableUnits}
-
-\def\OpenUp#1#2%
- {\scratchdimen\StrutHeightFactor \points \advance\scratchdimen #1\points
- \edef\StrutHeightFactor{\withoutpt\the\scratchdimen}%
- \scratchdimen\StrutDepthFactor \points \advance\scratchdimen #2\points
- \edef\StrutDepthFactor{\withoutpt\the\scratchdimen}}
-
-%D As one can see, we didn't only add color, but also more
-%D control over spacing.
-%D
-%D \startbuffer[a]
-%D \starttable[|c|]
-%D \HL
-%D \VL \strut test \VL \FR
-%D \VL \strut test \VL \MR
-%D \VL \strut test \VL \MR
-%D \VL \strut test \VL \LR
-%D \HL
-%D \stoptable
-%D \stopbuffer
-%D
-%D \startbuffer[b]
-%D \starttabulate[|c|]
-%D \HL
-%D \NC test \NC \NR
-%D \NC test \NC \NR
-%D \NC test \NC \NR
-%D \NC test \NC \NR
-%D \HL
-%D \stoptabulate
-%D \stopbuffer
-%D
-%D In the next example, the first table is defined as:
-%D
-%D \typebuffer[a]
-%D
-%D and the second one as:
-%D
-%D \typebuffer[b]
-%D
-%D The first table is typeset using the default height and
-%D depth factors .8 and .4. The second table has both factors
-%D set to \type {strut}, and the third table shows what
-%D happens when we set the values to zero. The rightmost table
-%D is typeset using the tabulate environment.
-%D
-%D \startcombination[4*1]
-%D {$\vcenter{\getbuffer[a]}$}
-%D {\hbox{h=.8 d=.4}}
-%D {\setuptables[height=strut,depth=strut]$\vcenter{\getbuffer[a]}$}
-%D {\hbox{h=d=\type{strut}}}
-%D {\setuptables[height=0,depth=0]$\vcenter{\getbuffer[a]}$}
-%D {\hbox{h=d=0}}
-%D {$\vcenter{\getbuffer[b]}$}
-%D {\hbox{tabulate}}
-%D \stopcombination
-
-\setuptables
- [HL=\v!medium,
- VL=\v!medium,
- NL=\v!small,
- \c!frame=,
- \c!align=\v!right,
- \c!depth=.40, % \v!strut
- \c!height=.80, % \v!strut
- \c!rulethickness=\linewidth,
- \c!rulecolor=,
- \c!distance=\v!medium,
- \c!bodyfont=\the\bodyfontsize,
- \c!commands=,
- \c!background=\v!screen,
- \c!backgroundscreen=\@@rsscreen,
- \c!backgroundcolor=,
- \c!split=\v!auto]
-
-\def\ifintabel{\ifintable} % upward compatible
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/tabl-tbl.mkii b/Master/texmf-dist/tex/context/base/mkii/tabl-tbl.mkii
deleted file mode 100644
index 9f2d7df475c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/tabl-tbl.mkii
+++ /dev/null
@@ -1,1440 +0,0 @@
-%D \module
-%D [ file=core-tbl,
-%D version=1998.11.03,
-%D title=\CONTEXT\ Table Macros,
-%D subtitle=Text Flow Tabulation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Table Macros / Tabulation}
-
-% \processbetween gebruiken in head/tail macros
-
-\unprotect
-
-% WATCH OUT: don't change this model else trialtypesetting
-% compatibility problems
-
-% watch out, cells expand pretty late on a per row basis
-
-% |p2|p3| 2:3
-% spanning
-
-% Be careful with changing the hsize calculation in p mode;
-% the following code works quite well:
-%
-% \setupfield [line][location=low,height=1.2\lineheight,width=\hsize]
-% \definefield [test] [line] [line] []
-%
-% \starttabulate[|l|p|]
-% \NC test \NC \field [test] \NC \NR
-% \stoptabulate
-
-% In-text tabbing environment
-%
-% \starttabulate[| separated template] % eg [|l|p|] or [|l|p|p|]
-% \NC ... \NC ... \NC\NR
-% \stoptabulate
-%
-% with: two pass auto width calculation when no p-width
-% specified, even with multiple p's, see examples.
-
-% TaBlE compatible specifications:
-%
-% l align column/paragraph left
-% r align column/paragraph right
-% c align column/paragraph center
-% p p(dimen) of automatisch als alleen p
-% w column width
-% f font#1
-% B bold
-% I italic
-% S slanted
-% T type
-% R roman
-% m math
-% M display math
-% h hook (inner level or par lines)
-% b before (may be command#1)
-% a after
-% i i<n> skip left of column
-% j i<n> skip right of column
-% k i<n> skip around column
-
-% s setups
-
-% g g{char} align at char
-% . align at .
-% , align at ,
-
-% Still to be done
-
-% N math numbers (best hook into existing digits mechanism)
-% n numbers (best hook into existing digits mechanism)
-% Q math numbers (best hook into existing digits mechanism)
-% q numbers (best hook into existing digits mechanism)
-% ~ \hskip.5em
-% | check
-
-% nesting
-
-% 10 evt auto stack; dan wel andere signal dan void nodig
-
-% present but not yet 100% ok
-%
-% \FL top hrule
-% \ML mid hrule (with auto split)
-% \LL bottom hrule
-% \HL
-
-% \VL as soon as needed
-% color as soon as needed
-
-% \EQ \RQ \HQ equal (raw, hook)
-% \NC \RC \HC normal (raw, hook)
-%
-% \NR
-
-% \HR : rule with lineheight
-
-% \autotabulaterule : with lineheight, not first/last
-% \autotabulateline : spaced, not first/last
-% \tabulaterule : with lineheight
-% \tabulateline : spaced
-
-% tricky: align scans ahead, over # and expands ones before
-% while doing
-
-% new:
-%
-% \starttabulate[|cg{.}|cg{,}|cg{,}|]
-% \NC period \NC comma \NC comma \NC\NR
-% \NG 100.000,00 \NG 100.000,00 \NG 100,00 \NC\NR
-% \NG 10.000,00 \NG 10.000,00 \NG 1000,00 \NC\NR
-% \NG 100,00 \NG 100,00 \NG 10,00 \NC\NR
-% \NG 10 \NG 10 \NG 0,00 \NC\NR
-% \stoptabulate
-%
-% \starttabulate[|c.|c,|c,|]
-% \NC period \NC comma \NC comma \NC\NR
-% \NG 100.000,00 \NG 100.000,00 \NG 100,00 \NC\NR
-% \NG 10.000,00 \NG 10.000,00 \NG 1000,00 \NC\NR
-% \NG 100,00 \NG 100,00 \NG 10,00 \NC\NR
-% \NG 10 \NG 10 \NG 0,00 \NC\NR
-% \stoptabulate
-
-% nice demo (for BG)
-%
-% \starttabulate[|r|b{$\star$}|ra{\percent}|b{=}|r|]
-% \NC 500 \NC \NC 60 \NC \NC 300 \NC \NR
-% \NC 500 \NC \NC 55 \NC \NC 275 \NC \NR
-% \NC 500 \NC \NC 50 \NC \NC 250 \NC \NR
-% \NC 500 \NC \NC 45 \NC \NC 225 \NC \NR
-% \NC 500 \NC \NC 40 \NC \NC 200 \NC \NR
-% \NC 500 \NC \NC 35 \NC \NC 175 \NC \NR
-% \NC 500 \NC \NC 30 \NC \NC 150 \NC \NR
-% \NC 500 \NC \NC 25 \NC \NC 125 \NC \NR
-% \NC 500 \NC \NC 20 \NC \NC 100 \NC \NR
-% \stoptabulate
-
-\newtoks \tabulatepreamble
-\newtoks \tabulatebefore
-\newtoks \tabulateafter
-\newtoks \tabulatebmath
-\newtoks \tabulateemath
-\newtoks \tabulatefont
-\newtoks \tabulatesettings
-\newtoks \tabulatedummy
-
-\newcount \nofautotabulate
-\newcount \tabulatecolumns
-\newcount \tabulatecolumn
-
-\newcount \tabulateminplines
-\newcount \tabulatemaxplines
-
-\newif \ifautotabulate
-\newif \ifsplittabulate \splittabulatetrue
-
-\newif \ifhandletabulatepbreak \handletabulatepbreaktrue
-\newif \iftabulatenopbreak \tabulatenopbreakfalse
-
-\newif \iftabulateequal
-\newif \iftracetabulate
-\newif \ifframedtabulate
-
-\newdimen \tabulatepwidth
-\newdimen \tabulatewidth
-\newdimen \tabulateunit
-\newdimen \tabulatemaxpheight
-
-\newbox \tabulatebox
-
-% [|lg{.}|] => \NG 12.34 \NC
-
-\gdef\handletabulatecharalign#1 % space delimited !
- {\edef\alignmentclass{\the\tabulatecolumn}%
- \edef\alignmentcharacter{\getvalue{\@@tabalign@@\the\tabulatecolumn}}%
- \ifcase\tabulatepass\or
- \setfirstpasscharacteralign\checkalignment{#1}%
- \fi % force hsize
- \setsecondpasscharacteralign\checkalignment{#1}}
-
-\def\noftabcolumns{16}
-
-\def\@@tabbox@@ {@@tabbox@}
-\def\@@tabhook@@ {@@tabhook@}
-\def\@@tabalign@@ {@@tabalign@}
-\def\@@tabsetups@@{@@tabsetups@}
-
-% \dorecurse\noftabcolumns % quick and dirty stack
-% {\@EA\newbox\csname\@@tabbox@@\recurselevel\endcsname}
-
-\def\tablebox#1%
- {\csname\@@tabbox@@\number#1\endcsname}
-
-% \def\checktablebox#1%
-% {\ifundefinedelse{\@@tabbox@@\number#1}%
-% \expandafter\newbox\csname\@@tabbox@@\number#1\endcsname
-% \fi}
-
-\def\initializetablebox#1% also used elsewhere
- {\ifcsname\@@tabbox@@\number#1\endcsname
- \global\setbox\csname\@@tabbox@@\number#1\endcsname\emptybox
- \else
- \expandafter\newbox\csname\@@tabbox@@\number#1\endcsname
- \fi}
-
-% \def\initializetableboxes#1% hm, not that efficient, best make a simple dedicated tail recurser
-% {\dorecurse#1{\initializetablebox\recurselevel}}
-
-\def\initializetableboxes#1%
- {\scratchcounter#1\relax
- \doinitializetableboxes}
-
-\def\doinitializetableboxes
- {\ifnum\scratchcounter>\zerocount
- \initializetablebox\scratchcounter
- \advance\scratchcounter\minusone
- \expandafter\doinitializetableboxes
- \fi}
-
-\initializetableboxes\noftabcolumns
-
-\def\dotabulatenobreak
- {\noalign
- {\nobreak
- \iftracetabulate
- \red\hrule\!!height.5\linewidth\!!depth.5\linewidth
- \par
- \kern-\linewidth
- \nobreak
- \fi}}
-
-\let\notabulatehook\empty
-
-\def\checktabulatehook
- {\ifnum\tabulatetype<\plustwo
- \global\let\tabulatehook\notabulatehook
- \else
- \global\let\tabulatehook\dotabulatehook
- \fi}
-
-\def\checktabulatesetups
- {\getvalue{\@@tabsetups@@\the\tabulatecolumn}}
-
-\let\pretabrule \donothing
-\let\posttabrule\donothing
-
-\def\dodosettabulatepreamble#1#2%
- {\ifzeropt\tabulatewidth
- \ifcase\tabulatemodus\relax
- \let\preamblebox\empty
- \else
- \def\preamblebox{\autotabulatetrue}%
- \fi
- \else
- \ifcase\tabulatemodus\relax
- \edef\preamblebox{\hbox to \the\tabulatewidth}%
- \else
- \edef\preamblebox{\hsize\the\tabulatewidth}%
- \fi
- \fi
- %
- % less bytes
- %
- %\edef\preamblebox%
- % {\ifcase\tabulatewidth
- % \ifcase\tabulatemodus\relax\else\noexpand\autotabulatetrue\fi
- % \els
- % \ifcase\tabulatemodus\relax\hbox to\else\hsize\fi\the\tabulatewidth
- % \fi}%
- %
- % 0 = NC column next EQ equal column
- % 1 = RC column raw RQ equal column raw
- % 2 = HC column hook HQ equal column hook
- % some entries can be left out if we test for them being set
- \@EA\appendtoks \@EA&\@EA\hskip\pretabskip\pretabrule##&\to\!!toksa
- \appendtoks \ignorespaces\to\!!toksa
- \@EA\appendtoks\@EA\global\@EA\tabulatecolumn\the\tabulatecolumns\relax\to\!!toksa
- \appendtoks \checktabulatesetups\to\!!toksa
- \appendtoks \checktabulatehook\to\!!toksa
- \@EA\appendtoks \preamblebox\to\!!toksa
- \appendtoks \bgroup\bbskip\bgroup#1\to\!!toksa
- \appendtoks\ifnum\tabulatetype=\plusone \else \to\!!toksa
- \@EA\appendtoks \the\tabulatebmath\to\!!toksa
- \@EA\appendtoks \the\tabulatefont\to\!!toksa
- \@EA\appendtoks \the\tabulatesettings\to\!!toksa
- \@EA\appendtoks \the\tabulatebefore\to\!!toksa
- \appendtoks\fi \to\!!toksa
- \appendtoks \bgroup\ignorespaces\to\!!toksa
- %
- \appendtoks \tabulatehook##\to\!!toksa
- %
- %%\doifdefinedelse{\@@tabalign@@\tabulatecolumns}
- %\doifdefinedelse{\@@tabalign@@\the\tabulatecolumns}
- % {\appendtoks\handletabulatecharalign## \to\!!toksa}
- % {\appendtoks\tabulatehook ##\to \!!toksa}%
- % waarom kan ik hier geen \xx{##} geven, om een of
- % andere reden passeert dan tex de hele regel (incl \NC's)
- % als argument; elke delimiter <> space gaat trouwens fout
- \appendtoks \unskip\unskip\ifmmode\else\endgraf\fi\egroup\to\!!toksa
- \appendtoks\ifnum\tabulatetype=1 \else \to\!!toksa
- \@EA\appendtoks \the\tabulateafter\to\!!toksa
- \@EA\appendtoks \the\tabulateemath\to\!!toksa
- \appendtoks\fi \to\!!toksa
- \appendtoks #2\egroup\egroup\to\!!toksa
- \@EA\appendtoks \@EA&\@EA\posttabrule\@EA\hskip\postabskip##\to\!!toksa
- \appendtoks\NC\to\tabulatedummy
- \let\bbskip\empty
- \def\pretabskip{.5\tabulateunit}%
- \let\postabskip\pretabskip
- \let\gettabulateexit\dogettabulateexit
- \tabulatewidth\zeropoint}
-
-% todo: we can speed up this module a bit
-%
-% \expanded{\!!toksa{\the\!!toksa
-% &\hskip\pretabskip\noexpand\pretabrule####&
-% \ignorespaces
-% \global\tabulatecolumn\the\tabulatecolumns
-% \noexpand\checktabulatesetups
-% \noexpand\checktabulatehook
-% \preamblebox
-% \bgroup\noexpand\bbskip\bgroup\normalunexpanded{#1}%
-% \noexpand\ifnum\tabulatetype=\plusone \noexpand\else
-% \the\tabulatebmath
-% \the\tabulatefont
-% \the\tabulatesettings
-% \the\tabulatebefore
-% \noexpand\fi
-% \bgroup\ignorespaces
-% \noexpand\tabulatehook####%
-% \unskip\unskip\noexpand\ifmmode\noexpand\else\endgraf\noexpand\fi\egroup
-% \noexpand\ifnum\noexpand\tabulatetype=1 \noexpand\else
-% \the\tabulateafter
-% \the\tabulateemath
-% \noexpand\fi
-% \normalunexpanded{#2}\egroup\egroup
-% &\noexpand\posttabrule\hskip\noexpand\postabskip####}}%
-
-\def\dosettabulatepreamble
- {\ifx\next\relax
- \let\nextnext\relax % == \expandafter\gobbleoneargument
- \else
- \let\nextnext\settabulatepreamble
- \ifx x\next \let\tabulatealign\zerocount % internal
- \else\ifx l\next \let\tabulatealign\plusone
- \else\ifx r\next \let\tabulatealign\plustwo
- \else\ifx c\next \let\tabulatealign\plusthree
- \else\ifx p\next \let\nextnext\gettabulateparagraph
- \else\ifx s\next \let\nextnext\gettabulatesetups
- \else\ifx w\next \let\nextnext\gettabulatewidth
- \else\ifx f\next \let\nextnext\gettabulatefont
- \else\ifx B\next \tabulatefont{\bf}%
- \else\ifx I\next \tabulatefont{\it}%
- \else\ifx S\next \tabulatefont{\sl}%
- \else\ifx T\next \tabulatefont{\tt}%
- \else\ifx R\next \tabulatefont{\rm}%
- \else\ifx m\next \tabulatebmath{$}\tabulateemath{$}%
- \else\ifx M\next \tabulatebmath{$\displaystyle}\tabulateemath{$}%
- \else\ifx h\next \let\nextnext\gettabulatehook
- \else\ifx b\next \let\nextnext\gettabulatebefore
- \else\ifx a\next \let\nextnext\gettabulateafter
- \else\ifx i\next \let\nextnext\gettabulatepreskip
- \else\ifx j\next \let\nextnext\gettabulateposskip
- \else\ifx k\next \let\nextnext\gettabulatepreposskip
- \else\ifx X\next \let\nextnext\gettabulateexit % internal
- \else\ifx e\next \appendtoks\global\tabulateequaltrue\to\tabulatesettings
- \else\ifx ~\next \appendtoks\fixedspaces\to\tabulatesettings
- \else\ifx g\next \let\nextnext\gettabulatealign
- \else\ifx .\next \def\nextnext{\gettabulatealign.}%
- \else\ifx ,\next \def\nextnext{\gettabulatealign,}%
- \else \message{unknown preamble key [\meaning\next]}%
- \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
- \nextnext}
-
-\def\dogettabulateexit
- {\let\postabskip\!!zeropoint
- \settabulatepreamble}
-
-\let\gettabulateexit\dogettabulateexit
-
-\def\gettabulatepreskip#1%
- {\doifnumberelse{#1}
- {\scratchdimen#1\tabulateunit\let\next\empty}
- {\scratchdimen.5\tabulateunit\def\next{#1}}%
- \edef\pretabskip{\the\scratchdimen}%
- \@EA\settabulatepreamble\next}
-
-\def\gettabulateposskip#1%
- {\doifnumberelse{#1}
- {\scratchdimen#1\tabulateunit\let\next\empty}
- {\scratchdimen.5\tabulateunit\def\next{#1}}%
- \edef\postabskip{\the\scratchdimen}%
- \let\gettabulateexit\settabulatepreamble
- \@EA\settabulatepreamble\next}
-
-\def\gettabulatepreposskip#1%
- {\doifnumberelse{#1}
- {\scratchdimen#1\tabulateunit\let\next\empty}
- {\scratchdimen.5\tabulateunit\def\next{#1}}%
- \edef\pretabskip{\the\scratchdimen}%
- \let\postabskip\pretabskip
- \let\gettabulateexit\settabulatepreamble
- \@EA\settabulatepreamble\next}
-
-\def\gettabulatesetups#1%
- {\setvalue{\@@tabsetups@@\the\tabulatecolumns}{\setups[#1]}%
- \settabulatepreamble}
-
-\def\gettabulatehook#1%
- {\setvalue{\@@tabhook@@\the\tabulatecolumns}{#1}%
- \settabulatepreamble}
-
-\def\gettabulatealign#1%
- {\setvalue{\@@tabalign@@\the\tabulatecolumns}{#1}%
- \settabulatepreamble}
-
-\def\gettabulatebefore#1%
- {\tabulatebefore{#1}%
- \settabulatepreamble}
-
-\def\gettabulateafter#1%
- {\tabulateafter{#1}%
- \settabulatepreamble}
-
-\def\gettabulatefont#1%
- {\tabulatefont{#1}%
- \settabulatepreamble}
-
-\def\gettabulatewidth
- {\let\tabulatemodus\zerocount
- \let\tabulatedimen\zerocount
- \doifnextcharelse(\dogettabulatewidth\settabulatepreamble}
-
-\def\gettabulateparagraph
- {\doifnextcharelse{(}
- {\let\tabulatemodus\plusone
- \let\tabulatedimen\plusone
- \dogettabulatewidth}
- {\let\tabulatemodus\plustwo
- \let\tabulatedimen\zerocount
- \settabulatepreamble}}
-
-% \def\dogettabulatewidth(#1)%
-% {\tabulatewidth#1\relax
-% \ifnum\tabulatedimen=\plusone
-% \global\advance\tabulatepwidth\tabulatewidth
-% \fi
-% \settabulatepreamble}
-
-% \def\dogettabulatewidth(#1)%
-% {\doifelse{#1}\v!passend
-% {\let\tabulatemodus\plusthree}
-% {\tabulatewidth#1\relax}%
-% \ifnum\tabulatedimen=\plusone
-% \global\advance\tabulatepwidth\tabulatewidth
-% \fi
-% \settabulatepreamble}
-
-% \startbuffer
-% \toplinebox{\framed[width=3cm,height=2cm]{tufte}}
-% \stopbuffer
-% \starttabulate[|p(fixed)|p|]
-% \dorecurse{100}{\NC \getbuffer \NC test \par test \par \NC \NR}
-% \stoptabulate
-% \starttabulate[|p(fit)|p|]
-% \dorecurse{100}{\NC \getbuffer \NC test \par test \par \NC \NR}
-% \stoptabulate
-
-\def\dogettabulatewidth(#1)%
- {\processallactionsinset
- [#1]%
- [ \v!fit=>\let\tabulatemodus\plusthree,
- \v!fixed=>\let\tabulatemodus\plusthree
- \tabulatenopbreaktrue,
- \s!unknown=>\tabulatewidth#1\relax]%
- \ifnum\tabulatedimen=\plusone
- \global\advance\tabulatepwidth\tabulatewidth
- \fi
- \settabulatepreamble}
-
-\def\settabulatepreamble
- {\afterassignment\dosettabulatepreamble\let\next=}
-
-\def\tabulateraggedright {\ifnum\tabulatetype=\plusone \else\raggedright \fi}
-\def\tabulateraggedcenter{\ifnum\tabulatetype=\plusone \else\raggedcenter\fi}
-\def\tabulateraggedleft {\ifnum\tabulatetype=\plusone \else\raggedleft \fi}
-\def\tabulatenotragged {\ifnum\tabulatetype=\plusone \else\notragged \fi}
-\def\tabulatehss {\ifnum\tabulatetype=\plusone \else\hss \fi} % never change this to a fill
-
-\bgroup \catcode`\|=\@@other
-
-\gdef\nexttabulate#1|%
- {\let\tabulatealign\@@tabulatealign
- \let\tabulatemodus\zerocount
- \let\tabulatedimen\zerocount
- \tabulatebefore \emptytoks
- \tabulateafter \emptytoks
- \tabulatebmath \emptytoks
- \tabulateemath \emptytoks
- \tabulatefont \emptytoks
- \tabulatesettings\emptytoks
- \global\advance\tabulatecolumns\plusone
- \letvalue{\@@tabsetups@@\the\tabulatecolumns}\donothing
- \settabulatepreamble#1\relax\relax % permits i without n
- \ifcase\tabulatemodus\relax
- \ifcase\tabulatealign\relax
- \dodosettabulatepreamble\empty \tabulatehss \or
- \dodosettabulatepreamble\empty \tabulatehss \or
- \dodosettabulatepreamble\tabulatehss\empty \or
- \dodosettabulatepreamble\tabulatehss\tabulatehss \fi
- \or % fixed width
- \ifcase\tabulatealign\relax
- \dodosettabulatepreamble \bskip \eskip \or
- \dodosettabulatepreamble{\bskip\tabulateraggedright }\eskip \or
- \dodosettabulatepreamble{\bskip\tabulateraggedleft }\eskip \or
- \dodosettabulatepreamble{\bskip\tabulateraggedcenter}\eskip \fi
- \or % auto width
- \global\advance\nofautotabulate\plusone
- \ifcase\tabulatealign\relax
- \dodosettabulatepreamble \bskip \eskip \or
- \dodosettabulatepreamble{\bskip\tabulateraggedright }\eskip \or
- \dodosettabulatepreamble{\bskip\tabulateraggedleft }\eskip \or
- \dodosettabulatepreamble{\bskip\tabulateraggedcenter}\eskip \fi
- \or % simple
- \dodosettabulatepreamble \xbskip \xeskip
- \fi
- \futurelet\next\donexttabulate}
-
-\egroup
-
-\def\donexttabulate
- {\ifx\next\relax\else
- \expandafter\nexttabulate
- \fi}
-
-\def\splitofftabulatebox % overloaded in anch-pgr
- {\dontcomplain
- \global\setbox\tabulatebox % % % global ? % % %
- \vsplit\tablebox\tabulatecolumn to \lineheight
- \setbox\tabulatebox\normalvbox
- {\unvbox\tabulatebox}%
- \setbox\tabulatebox\hbox to \wd\tabulatebox
- {\hss\dotabulatehook{\box\tabulatebox}\hss}%
- \ht\tabulatebox\strutht
- \dp\tabulatebox\strutdp
- \box\tabulatebox}
-
-\def\dotabulatehook {\getvalue{\@@tabhook@@ \the\tabulatecolumn}}
-\def\dotabulatealign {\getvalue{\@@tabalign@@ \the\tabulatecolumn}}
-
-\def\resettabulatepheight
- {\global\tabulateminplines\plusone
- \getnoflines\tabulatemaxpheight
- \global\tabulatemaxplines\noflines
- \global\tabulatemaxpheight\zeropoint}
-
-\def\settabulatepheight
- {\scratchdimen\ht\tablebox\tabulatecolumn\relax
- \ifdim\scratchdimen>\tabulatemaxpheight
- \global\tabulatemaxpheight\scratchdimen
- \fi}
-
-\def\handletabulatepbreak
- {\TABLEnoalign
- {\ifhandletabulatepbreak
- \iftabulatenopbreak
- \dotabulatenobreak
- \else\ifnum\tabulatemaxplines>\plusone
- \ifnum\tabulateminplines=\plusone
- \dotabulatenobreak
- \fi
- \global\advance\tabulateminplines\plusone
- \ifnum\tabulateminplines=\tabulatemaxplines\relax
- \dotabulatenobreak
- \fi
- \fi \fi
- \fi}}
-
-%D \startbuffer
-%D \starttabulate[|c|p|p|]
-%D \NC \bf Alpha \NC \bf Beta \NC \bf Gamma \NC\NR
-%D \NC 1 \NC right indeed \NC definitely wrong \NC\NR
-%D \NC 2 \NC \thinrules[n=3] \NC \thinrules[n=3] \NC\NR
-%D \NC 3 \NC oh yes \NC simply no \NC\NR
-%D \NC 4 \NC very true \NC as false as can be \NC\NR
-%D \NC 5 \NC \thinrules[n=5] \NC \thinrules[n=5] \NC\NR
-%D \NC 6 \NC \thinrules[n=3] \NC \thinrules[n=4] \NC\NR
-%D \stoptabulate
-%D \stopbuffer
-%D
-%D \typebuffer {\tracetabulatetrue\getbuffer}
-%D
-%D \startbuffer
-%D \starttabulate[|c|p|p|]
-%D \NC \bf Alpha \NC \bf Beta \NC \bf Gamma \NC\NR
-%D \NC 1 \NC right indeed \NC definitely wrong \NC\NR
-%D \NC 2 \NC oh yes \NC simply no \NC\NR
-%D \NC 3 \NC very true \NC as false as can be \NC\NR
-%D \NC 4 \NC the whole truth \NC but the truth \NC\NR
-%D \stoptabulate
-%D \stopbuffer
-%D
-%D \typebuffer {\tracetabulatetrue\getbuffer}
-
-% \definetabulate
-% \redefinetabulate
-% \starttabulate[preamble]
-% \starttabulate -> \starttabulate[|l|p|]
-
-\bgroup \catcode`\|=\@@other
-
-\gdef\definetabulate
- {\dotripleempty\dodefinetabulate}
-
-\gdef\dodefinetabulate[#1][#2][#3]%
- {\ifthirdargument
- \doifundefined{\??tt#1::\c!unit}
- {\copyparameters
- [\??tt#1::][\??tt\v!tabulate::]%
- [\c!frame,\c!distance,\c!unit,\c!before,\c!bodyfont,\c!after,
- \c!inner,\c!indenting,\c!margin,\c!align,\c!header,\c!title,
- \c!rulecolor,\c!rulethickness,\c!split,EQ]}%
- \copyparameters
- [\??tt#1::#2][\??tt#1::]%
- [\c!unit,\c!distance,\c!before,\c!bodyfont,\c!after,
- \c!inner,\c!indenting,\c!frame,\c!split,\c!header,\c!title,
- \c!margin,\c!align,\c!rulecolor,\c!rulethickness,EQ]%
- \setvalue{\e!start#1::#2}{\dofinalstarttabulate[#1][#2][#3]}%
- \setvalue{\e!start#1}{\bgroup\dosubstarttabulate[#1]}%
- \letvalue{\??tt#1-\v!header}\empty
- \letvalue{\??tt#1-\v!footer }\empty
- \else\ifsecondargument
- \definetabulate[#1][][#2]%
- \else
- \definetabulate[#1][][|l|p|]%
- \fi\fi}
-
-\egroup
-
-\let\tabulateheadcontent\empty
-\let\tabulatetailcontent\empty
-
-\newconditional\tabulatesomeamble
-
-\def\checkfulltabulatecontent % - needed, else confusion with \c!header
- {\ifundefined{\??tt\currenttabulate-\v!header}%
- \let\tabulateheadcontent\empty
- \else
- \def\tabulateheadcontent
- {\TABLEnoalign{\global\settrue\tabulatesomeamble}%
- \csname\??tt\currenttabulate-\v!header\endcsname
- \TABLEnoalign{\global\setfalse\tabulatesomeamble}}%
- \fi
- \ifundefined{\??tt\currenttabulate-\v!footer}%
- \let\tabulatetailcontent\empty
- \else
- \def\tabulatetailcontent
- {\TABLEnoalign{\global\settrue\tabulatesomeamble}%
- \csname\??tt\currenttabulate-\v!footer\endcsname
- \TABLEnoalign{\global\setfalse\tabulatesomeamble}}%
- \fi}
-
-% \def\fulltabulatecontent
-% {\tabulateheadcontent
-% \tabulatecontent
-% \tabulatetailcontent}
-
-\def\fulltabulatecontent
- {\tabulateheadcontent
- \tabulatecontent
- \tabulatetailcontent
- \removefunnytabulateline}
-
-\def\removefunnytabulateline
- {\ifhmode
- \strut\crcr
- \TABLEnoalign{\kern-\lineheight}%
- \fi}
-
-\setvalue{\e!start\v!tabulatehead}%
- {\dosingleempty\dostartstarttabulatehead}
-
-\def\dostartstarttabulatehead[#1]%
- {\processcontent{\e!stop\v!tabulatehead}\next
- {\letvalue{\??tt\iffirstargument#1\else\v!tabulate\fi::-\v!header}\next}}
-
-\setvalue{\e!start\v!tabulatetail}%
- {\dosingleempty\dostartstarttabulatetail}
-
-\def\dostartstarttabulatetail[#1]%
- {\processcontent{\e!stop\v!tabulatetail}\next
- {\letvalue{\??tt\iffirstargument#1\else\v!tabulate\fi::-\v!footer}\next}}
-
-\def\dosubstarttabulate
- {\dodoubleempty\dodosubstarttabulate}
-
-\def\dodosubstarttabulate[#1][#2]%
- {\getvalue{\e!start#1::\ifundefined{\e!start#1::#2}\else#2\fi}}
-
-\setvalue{\e!start\v!tabulate}%
- {\bgroup\dodoubleempty\donormalstarttabulate}
-
-\bgroup
-
-\gdef\donormalstarttabulate[#1][#2]%
- {\ifsecondargument
- \getparameters[\??tt\v!tabulate::][#2]%
- \fi
- \iffirstargument
- \def\next{\dofinalstarttabulate[\v!tabulate][][#1]}%
- \else
- \def\next{\dofinalstarttabulate[\v!tabulate][][|l|p|]}%
- \fi
- \next}
-
-\egroup
-
-% The much neede hook:
-
-\newtoks\everytabulate
-
-% An example of its usage:
-
-\appendtoks \optimizeverbatimfalse \to \everytabulate
-\appendtoks \let\recodeverbatimmode\plustwo \to \everytabulate
-
-% A status variable:
-
-\chardef\tabulatepass=0
-
-\def\tabulateparameter#1{\csname\??tt\currenttabulate#1\endcsname}
-
-\bgroup
- \catcode`\|=\@@other \gdef\@@otherbar{|}
- \catcode`\|=\@@active \gdef\@@useotherbar{\let|\@@otherbar}
-\egroup
-
-\def\dofinalstarttabulate[#1][#2][#3]% identifier sub preamble
- {\edef\currenttabulate{#1::#2}%
- \ifinsidefloat \else
- \whitespace
- \tabulateparameter\c!before
- \fi
- \bgroup
- \resetcharacteralign
- % todo: spacing around tabulate when bodyfont is set
- % expansion en test needed ?
- \splittabulatetrue
- \processaction
- [\tabulateparameter\c!split]
- [% \v!yes=>\splittabulatetrue,
- % \v!repeat=>\splittabulatetrue, % todo, default yes
- \v!no=>\splittabulatefalse,
- \v!auto=>\ifinsidefloat\ifinsidesplitfloat\else\splittabulatefalse\fi\fi]%
- \doifvaluesomething{\??tt\currenttabulate\c!bodyfont}
- {\expanded{\switchtobodyfont[\tabulateparameter\c!bodyfont]}}%
- \postponenotes % new, to be tested / will be configurable
- \let\tabulatepass\plusone
- \widowpenalty\zerocount % otherwise lines are not broken
- \clubpenalty \zerocount % but overlap in funny ways
- \the\everytabulate
- \tabulateparameter\c!inner
- \scratchdimen\leftskip
- \advance\scratchdimen \hangindent
- \doifvalue{\??tt\currenttabulate\c!indenting}\v!yes
- {\advance\scratchdimen \parindent}% \ctxparindent
- \edef\tabulateindent{\the\scratchdimen}%
- \!!toksb\emptytoks
- \def\dorepeat*##1##2%
- {\dorecurse{##1}{\appendtoks##2\to\!!toksb}\do}%
- \def\do
- {\futurelet\next\dodo}%
- \def\dodo % \@EAEAEA gebruiken
- {\ifx\next\relax
- % exit
- \else\ifx*\next
- \let\next\dorepeat
- \else\ifx\bgroup\next
- \let\next\dododo
- \else
- \let\next\dodododo
- \fi\fi\fi
- \next}%
- \def\dododo##1%
- {\appendtoks{##1}\to\!!toksb\do}%
- \def\dodododo##1%
- {\appendtoks##1\to\!!toksb\do}%
- \global\tabulatecolumn\zerocount
-% \do#3\relax
-\bgroup\@@useotherbar\expanded{\egroup\noexpand\do#3\relax}%
- \processcontent
- {\e!stop#1}% \currenttabulate}
- \tabulatecontent
- {\@EA\processtabulate\@EA[\the\!!toksb]}}
-
-\chardef\tabulatetype=0
-
-% 0 = NC column next EQ equal column
-% 1 = RC column raw RQ equal column raw
-% 2 = HC column hook HQ equal column hook
-
-\newif\iftabulatefirstflushed
-
-\def\tabulateEQ
- {\iftabulatefirstflushed\else\tabulateparameter{EQ}\fi
- \global\tabulateequalfalse}
-
-% \def\tabulatenormalcolumn#1%
-% {&\iftabulateequal\tabulateEQ\fi&\global\chardef\tabulatetype#1&}
-%
-% \def\tabulateequalcolumn#1%
-% {&\tabulateEQ&\global\chardef\tabulatetype#1&}
-%
-% however, \unskip en \ignorespaces permit usage in complex XML/\starttabulate
-
-\def\tabulatenormalcolumn#1%
- {\unskip&\iftabulateequal\tabulateEQ\fi&\global\chardef\tabulatetype#1&%
- \ignorespaces}
-
-\def\tabulateequalcolumn#1%
- {\unskip&\tabulateEQ&\global\chardef\tabulatetype#1&%
- \ignorespaces}
-
-\def\tabulateautocolumn
- {\tabulatenormalcolumn\zerocount
- \ifnum\tabulatecolumn>\tabulatecolumns\relax
- \expandafter\NR
- \else
- \expandafter\ignorespaces % interferes with the more tricky hooks
- \fi}
-
-\def\setquicktabulate#1% see \startlegend \startgiven
- {\let#1\tabulateautocolumn
- \let\\\tabulateautocolumn}
-
-%\def\dotabulateruleseperator
-% {\vskip\strutdp}
-
-\def\dotabulateruleseperator % can be sped up
- {\bgroup
- \let\factor\!!plusone
- \scratchskip\strutdp
- \ExpandFirstAfter\processallactionsinset
- [\tabulateparameter\c!distance]
- [ \v!blank=>\scratchskip\bigskipamount,
- \v!depth=>\scratchskip\strutdp,
- \v!small=>\def\factor{.25},
- \v!medium=>\def\factor{.5},
- \v!big=>,
- \v!none=>\scratchskip\zeropoint\def\factor{0},
- \v!grid=>\scratchskip\zeropoint\def\factor{0},
- \s!unknown=>\scratchskip\commalistelement]%
- \scratchdimen\factor\scratchskip
- \ifconditional\tabulatesomeamble\kern\else\vskip\fi\scratchdimen % new
- \egroup}
-
-\def\dodotabulaterule#1%
- {\color
- [\tabulateparameter\c!rulecolor]
- {\scratchdimen\tabulateparameter\c!rulethickness#1}}
-
-\def\dotabulaterule
- {\dodotabulaterule
- {\hrule\!!height.5\scratchdimen\!!depth.5\scratchdimen\relax
- \doifvalue{\??tt\currenttabulate\c!distance}\v!grid
- {\kern-\scratchdimen}}} % experimental tm-prikkels
-
-\def\dotabulatelinerule
- {\multispan\totaltabulatecolumns % \multispan is a plain macro
- % for the moment this one
- \strut\hskip\tabulateparameter\c!margin
- % neg values are ok !
- \hskip\tabulateindent % new august 2003
- \dodotabulaterule
- {\!!heighta.5\lineheight
- \advance\!!heighta-\strutdepth
- \!!deptha-\!!heighta
- \advance\!!deptha\scratchdimen
- \leaders\hrule\!!height\!!heighta\!!depth\!!deptha\hfill}%
- \cr}
-
-%D When set to true, no (less) break optimization is done.
-
-\newif\iftolerantTABLEbreak
-
-%D The main processing macro is large but splitting it up
-%D would make things less clear.
-
-\def\doregistertabulateparoptions
- {\iftrialtypesetting \else
- \registerparoptions
- \ifinsidefloat
- % that is, an unbreakable one
- \global\let\registertabulateparoptions\empty
- \else
- % unsafe in crossing pages, at each b...
- % \global\let\registertabulateparoptions\empty
- \fi
- \fi}
-
-\appendtoks
- \global\let\registertabulateparoptions\doregistertabulateparoptions
-\to \everytabulate
-
-\newtoks\everytabulaterow
-
-\appendtoks
- \registertabulateparoptions
-\to \everytabulaterow
-
-\def\flushtabulateindent
- {\ifnum\tabulatecolumn=\zerocount
- \hbox to \tabulateindent
- {% we now have a local hsize, and since we want to
- % register positional info (i.e. real hsizes) we
- % need to reconstitute the original hsize
- \advance\hsize\tabulateindent
- % this is indeed rather messy and took a few hours
- % to dis/uncover
- \the\everytabulaterow
- \hss}%
- \fi}
-
-\def\totaltabulatecolumns{0}
-
-\def\handletabulatedigits{\digits}
-
-%D Beware, we cannot use \type {\unexpanded} on \type {\HL}
-%D cum suis, since \TEX's hard coded noalign lookahead fails
-%D on it! I mistakenly added this for a while.
-
-\chardef\tabulaterepeathead\zerocount
-
-\newcount\noftabulatelines
-\newcount\totalnoftabulatelines
-\newcount\minusnoftabulatelines
-
-\setvalue{\??tt:\c!align:\v!normal}{0}
-\setvalue{\??tt:\c!align:\v!right }{1}
-\setvalue{\??tt:\c!align:\v!left }{2}
-\setvalue{\??tt:\c!align:\v!middle}{3}
-
-\setvalue{\??tt:\c!header:\v!repeat}{\plusone}
-\setvalue{\??tt:\c!header:\v!text }{\plustwo}
-
-\bgroup \catcode`\|=\@@other
-
-\newtoks\everyaftertabulaterow
-
-\gdef\processtabulate[|#1|]% in the process of optimizing
- {\tabulateunit\tabulateparameter\c!unit
- \checkfulltabulatecontent
- \globallet\tabulateruledepth \!!zeropoint
- \globallet\tabulateruleheight\!!zeropoint
- \edef\@@tabulatealign{\executeifdefined{\??tt:\c!align:\tabulateparameter\c!align}0}%
-% \ExpandFirstAfter\processaction % use \setalignmentswitch instead
-% [\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}]%
- \let\pretabskip\!!zeropoint
- \def\postabskip{.5\tabulateunit}%
- \global\tabulatecolumns\zerocount
- \global\nofautotabulate\zerocount
- \global\noftabulatelines\zerocount
- \totalnoftabulatelines\noftabulatelines
- \minusnoftabulatelines\noftabulatelines
- \global\tabulatepwidth\zeropoint
- \global\tabulateequalfalse
- \resettabulatepheight
- \ifinsidesplitfloat
- \donetrue
- \else\ifinsidefloat
- \donefalse
- \else
- \donetrue
- \fi\fi
- \ifdone
- \chardef\tabulaterepeathead\executeifdefined{\??tt:\c!header:\tabulateparameter\c!header}\zerocount
-% \processaction
-% [\tabulateparameter\c!header]
-% [\v!repeat=>\let\tabulaterepeathead\plusone,
-% \v!text=>\let\tabulaterepeathead\plustwo]%
- \fi
- \unexpanded \def\NC{\tabulatenormalcolumn0}%
- \unexpanded \def\RC{\tabulatenormalcolumn1}%
- \unexpanded \def\HC{\tabulatenormalcolumn2}%
- \unexpanded \def\EQ{\tabulateequalcolumn 0}%
- \unexpanded \def\RQ{\tabulateequalcolumn 1}%
- \unexpanded \def\HQ{\tabulateequalcolumn 2}%
- \unexpanded \def\NG{\NC\handletabulatecharalign}%
- \unexpanded \def\NN{\NC\handletabulatedigits}% new, undocumented, test first
- \unexpanded \def\ND{\NC\handletabulatedigits}% same, for old times sake
- \def\tabulaterule{\HR}% a rule with lineheight
- \def\tabulateline{\HL}% just a spaced rule
- \def\tabulateautorule{\doHR\plusone}%
- \def\tabulateautoline{\doHL\plusone}%
- \def\HR{\doHR\zerocount}
- \def\HL{\doHL\zerocount}
- \unexpanded \def\NR % next row
- {\global\advance\noftabulatelines\plusone
- \global\tabulatefirstflushedfalse
- \global\tabulateequalfalse
- \global\tabulatecolumn\zerocount
- \resettabulatepheight
- \unskip\unskip\crcr\flushtabulated
-\TABLEnoalign
- {\the\everyaftertabulaterow}%
- \TABLEnoalign
- {\iftolerantTABLEbreak\else
- \ifconditional\tabulatesomeamble \ifcase\tabulaterepeathead \else
- \allowbreak
- \fi \fi
- \ifnum\noftabulatelines=\plusone
- \dotabulatenobreak
- \else\ifnum\noftabulatelines=\minusnoftabulatelines
- \ifnum\tabulatemaxplines<\plustwo
- \dotabulatenobreak
- \else
- \allowbreak % needed with pbreak prevention
- \fi
- \else
- \allowbreak % needed with pbreak prevention
- \fi\fi
- \fi
- \global\tabulatefirstflushedfalse}}%
- \let\HL\empty % not needed
- \let\SR\NR \let\AR\NR
- \let\FL\empty \let\FR\NR
- \let\ML\empty \let\MR\NR
- \let\LL\empty \let\LR\NR
- \let\doHR\gobbleoneargument
- \let\doHL\gobbleoneargument
- \global\let\flushtabulated\empty
-% \let\savedbar|\let|\nexttabulate
- \tabskip\zeropoint
- \ifdim\tabulateparameter\c!margin>\zeropoint
- \!!toksa{&\flushtabulateindent\strut##%
- \tabskip\tabulateparameter\c!margin\strut
- &##\tabskip\zeropoint}%
- \else
- \!!toksa{&\flushtabulateindent\strut##%
- &##\tabskip\zeropoint}%
- \fi
- \tabulatewidth\zeropoint
- % |#1X|\relax
- \nexttabulate #1X|\relax
- \scratchcounter\tabulatecolumns
- \multiply\scratchcounter3%
- \advance\scratchcounter4%
- \edef\totaltabulatecolumns{\the\scratchcounter}%
- \tabulatewidth\zeropoint
- % \dorecurse\tabulatecolumns % can be made faster
- % {\doifundefinedelse{\@@tabbox@@\recurselevel}
- % {\expandafter\newbox\csname\@@tabbox@@\recurselevel\endcsname}%
- % {\global\setbox\csname\@@tabbox@@\recurselevel\endcsname\emptybox}}%
- \initializetableboxes\tabulatecolumns
- \appendtoks&##\to\!!toksa
- \appendtoks\global\advance\tabulatecolumn\plusone\to\!!toksa
- \appendtoks\NC\unskip\unskip\crcr\flushtabulated\to\tabulatedummy % no count
- \global\tabulatecolumn\zerocount
- \resettabulatepheight
- \def\bskip
- {\setbox\tabulatebox\vbox\bgroup
- \global\let\tabulatehook\notabulatehook}%
- \def\eskip
- {\par\egroup
- \global\let\tabulatehook\dotabulatehook}%
- \def\xbskip
- {\hbox\bgroup\vbox\bgroup
- \global\let\tabulatehook\notabulatehook}%
- \def\xeskip
- {\par\egroup\egroup
- \global\let\tabulatehook\dotabulatehook}%
- % \let|\savedbar
- \global\let\tabulatehook\dotabulatehook
- \doifvalue{\??tt\currenttabulate\c!indenting}\v!no\forgetparindent
- \ifinsidefloat
- \let\tabulateindent\!!zeropoint
- \else
- \setlocalhsize \hsize\localhsize
- \fi
- \dontcomplain
- \forgetall % hm, interference with \forgetparindent ^^^ probably bug, to be solved
- \setbox0\vbox % outside \if because of line counting
- {\notesenabledfalse
- \let\tabulateindent\!!zeropoint
- \trialtypesettingtrue % very important
- \@EA\halign\@EA{\the\!!toksa\crcr\fulltabulatecontent\crcr}}%
- \ifnum\nofautotabulate>\zerocount
- % so, even if the natural size is larger, in the final
- % run, we force the calculated width
- \tabulatewidth\hsize
- \advance\tabulatewidth -\wd0
- \advance\tabulatewidth -\tabulatepwidth
- \ifnum\nofautotabulate>\zerocount
- \divide\tabulatewidth \nofautotabulate\relax
- \fi
- \fi
- \def\xbskip{\bskip}%
- \def\xeskip{\eskip}%
- \ifsplittabulate
- \splittopskip\strutht
- \global\let\flushtabulatedindeed\empty
- \long\def\bbskip
- {\ifvoid\tablebox\tabulatecolumn
- \ifx\flushtabulatedindeed\empty\else
- \setbox0\hbox
- \fi
- \fi}%
- \def\bskip
- {\ifvoid\tablebox\tabulatecolumn
- \global\setbox\tablebox\tabulatecolumn\vbox
- \bgroup
- \global\let\tabulatehook\notabulatehook
- \ifautotabulate\hsize\tabulatewidth\fi
- % \begstrut % interferes with pre-\pars
- % evt: \appendtoks\begstrut\to\everypar
- \ignorespaces
- \def\eskip
- {\par\egroup
- \settabulatepheight
- \global\let\tabulatehook\dotabulatehook
- \splitofftabulatebox}%
- \else
- \let\eskip\empty
- \dontcomplain
- \global\let\tabulatehook\dotabulatehook
- \expandafter\splitofftabulatebox
- \fi}%
- \gdef\flushtabulated
- {\TABLEnoalign % noalign % no interference !
- {\global\let\flushtabulatedindeed\empty
- \global\tabulatecolumn\zerocount
- \handletabulatepbreak
- \dorecurse\tabulatecolumns % was: \noftabcolumns
- {\ifvoid\tablebox\recurselevel\else
- \gdef\flushtabulatedindeed{\the\tabulatedummy}%
- \fi}%
- \global\tabulatefirstflushedtrue}%
- \flushtabulatedindeed}%
- \else
- % tabhook op alles ?
- \def\bskip
- {\vtop\bgroup
- \ifautotabulate\hsize\tabulatewidth\fi
- % \begstrut % interferes with pre-\pars
- % evt: \appendtoks\begstrut\to\everypar
- \ignorespaces}%
- \def\eskip % vertical strut added august 2003
- {\par\verticalstrut\vskip-\struttotal\egroup}%
- \fi
- \totalnoftabulatelines\noftabulatelines
- \minusnoftabulatelines\numexpr\noftabulatelines+\minusone\relax
- \global\noftabulatelines\zerocount
- \def\doHL##1% ##1 ignored
- {\TABLEnoalign
- {\csname
- \ifnum\noftabulatelines=\zerocount F\else
- \ifnum\noftabulatelines=\totalnoftabulatelines L\else
- M\fi\fi
- L\endcsname}}%
- \def\doHR##1% horizontal rule line (break untested)
- {\TABLEnoalign
- {\globallet\TABLEautoline\dotabulatelinerule
- \ifcase##1\or
- \ifnum\noftabulatelines=\zerocount
- \gdef\TABLEautoline{\TABLEnoalign{}}%
- \else\ifnum\noftabulatelines=\totalnoftabulatelines
- \gdef\TABLEautoline{\TABLEnoalign{}}%
- \fi\fi
- \fi
- \dotabulatenobreak}%
- \TABLEautoline
- \TABLEnoalign
- {\nobreak
- \ifx\TABLEautoline\dotabulatelinerule\kern-\lineheight\fi
- \ifnum\noftabulatelines=\totalnoftabulatelines
- \@EA\dotabulatenobreak
- \else
- \@EA\allowbreak
- \fi}%
- \TABLEautoline
- \TABLEnoalign
- {\dotabulatenobreak}}%
- \doifelsevalue{\??tt\currenttabulate\c!rule}\v!line
- {\let\HL \HR
- \let\tabulateautoline\tabulateautorule
- \let\tabulateline \tabulaterule}%
- {\def\HL{\doHL\zerocount}}%
- \def\tablebaselinecorrection
- {\def\dobaselinecorrection
- {\vskip-\prevdepth
- \vskip\strutdp
- \vskip\strutdp}%
- \baselinecorrection}%
- \def\FL{\TABLEnoalign
- {\ifinsidefloat\else
- \doifemptyvalue{\??tt\currenttabulate\c!before} % no expansion
- {\tablebaselinecorrection}%
- \fi
- \dotabulaterule
- \dotabulatenobreak
- \dotabulateruleseperator
- \prevdepth\strutdp
- \dotabulatenobreak}}%
- \def\ML{\TABLEnoalign
- {\dotabulateruleseperator
- \dotabulaterule
- \ifnum\noftabulatelines>\plusone
- \ifnum\noftabulatelines<\minusnoftabulatelines
- % \vskip \topskip\allowbreak \vskip-\topskip
- \vskip1\topskip\allowbreak\vskip-1\topskip
- \vskip-\tabulateparameter\c!rulethickness
- \dotabulaterule
- \fi
- \fi
- \dotabulateruleseperator}}%
- \def\LL{\TABLEnoalign
- {\dotabulatenobreak
- \dotabulateruleseperator
- \dotabulatenobreak
- \dotabulaterule
- \ifinsidefloat\else
- \doifemptyvalue{\??tt\currenttabulate\c!after} % no expansion
- {\vskip\strutdp
- \verticalstrut
- \vskip-\struttotal}%
- \fi}}%
- \let\tabulatepass\plustwo
- %
- \ifcase\tabulaterepeathead
- \ifinsidesplitfloat
- \setbox\tabulatebox\vbox \bgroup
- \else
- \startframedcontent[\tabulateparameter\c!frame]%
- \fi
- \else
- \setbox\tabulatebox\vbox \bgroup
- \fi
- %
- \@EA\halign\@EA{\the\!!toksa\crcr\fulltabulatecontent\crcr}%
- \prevdepth\strutdp % nog eens beter, temporary hack
- \doifvalue{\??tt\currenttabulate\c!distance}\v!grid
- {\vskip-\strutdp}% experimental tm-prikkels
- %
- \ifcase\tabulaterepeathead
- \ifinsidesplitfloat
- \egroup \splittabulatebox\tabulatebox
- \else
- \stopframedcontent
- \fi
- \else
- \egroup \splittabulatebox\tabulatebox
- \fi
- %
- \egroup
- \ifinsidefloat \else
- \tabulateparameter\c!after
- \fi
- \egroup}
-
-\egroup
-
-% \setuptabulate[split=yes,header=text,title=Vervolg van Tabel]
-%
-% % \starttabulatehead
-% % \NC test \NC hans\NC \NR
-% % \stoptabulatehead
-%
-% \starttabulate
-% \NC test \NC \input tufte \relax \NC \NR
-% \NC test \NC \input knuth \relax \NC \NR
-% \NC test \NC \input knuth \relax \NC \NR
-% \NC test \NC \input tufte \relax \NC \NR
-% \NC test \NC \input tufte \relax \NC \NR
-% \NC test \NC \input tufte \relax \NC \NR
-% \stoptabulate
-
-% \def\splittabulatebox#1% #1 <> 0/2 / derived from the one in core-ntb.tex
-% {\ifinsidefloat
-% \unvbox#1%
-% \else
-% \ifcase\tabulaterepeathead\or
-% \setbox2\copy#1%
-% \setbox2\vsplit2 to \lineheight
-% \setbox2\vbox{\unvbox2}%
-% \fi
-% \doloop
-% {\setbox0\vsplit#1 to \onepoint % \lineheight
-% \ifdim\pagegoal<\maxdimen
-% \donetrue
-% \else\ifdim\pagetotal=\zeropoint
-% \donetrue
-% \else
-% \donefalse
-% \fi\fi
-% \ifdone
-% \setbox0\vbox{\unvbox0}%
-% \dimen0\pagetotal
-% \advance\dimen0\dp0
-% \advance\dimen0\ht0
-% \ifdim\dimen0>\pagegoal
-% \bgroup \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
- {\ifinsidesplitfloat
- \dosplittabulatebox#1%
- \else\ifinsidefloat
- \unvbox#1%
- \else
- \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]
-%D
-%D \starttabulate
-%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule
-%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule
-%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule
-%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule
-%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule
-%D \NC tufte \NC \input tufte \NC \NR \tabulateautorule
-%D \stoptabulate
-%D \stoptyping
-
-% \starttabulatie[|mc|]
-% \NC \digits{100.000,00} \NC\NR
-% \NC \digits{@10.000,00} \NC\NR
-% \NC \digits{@@@.100,00} \NC\NR
-% \NC \digits{@@@.@10,@@} \NC\NR
-% \NC \digits{@@@.@@1,@@} \NC\NR
-% \stoptabulatie
-%
-% \starttabulatie[|mc|]
-% \ND 100.000,00 \NC\NR
-% \ND @10.000,00 \NC\NR
-% \ND @@@.100,00 \NC\NR
-% \ND @@@.@10,@@ \NC\NR
-% \ND @@@.@@1,@@ \NC\NR
-% \stoptabulatie
-%
-% \starttabulatie[|c|]
-% \ND $100.000,00$ \NC\NR
-% \ND $@10.000,00$ \NC\NR
-% \ND $@@@.100,00$ \NC\NR
-% \ND $@@@.@10,@@$ \NC\NR
-% \ND $@@@.@@1,@@$ \NC\NR
-% \stoptabulatie
-%
-% \starttabulatie[|c|]
-% \NC $\digits 100.000,00 $ \NC\NR
-% \NC $\digits @10.000,00 $ \NC\NR
-% \NC $\digits @@@.100,00 $ \NC\NR
-% \NC $\digits @@@.@10,@@ $ \NC\NR
-% \NC $\digits @@@.@@1,@@ $ \NC\NR
-% \stoptabulatie
-%
-% \starttabulatie[|c|]
-% \NC \digits $100.000,00$ \NC\NR
-% \NC \digits $@10.000,00$ \NC\NR
-% \NC \digits $@@@.100,00$ \NC\NR
-% \NC \digits $@@@.@10,@@$ \NC\NR
-% \NC \digits $@@@.@@1,@@$ \NC\NR
-% \stoptabulatie
-
-\def\setuptabulate
- {\dotripleempty\dosetuptabulate}
-
-\def\dosetuptabulate[#1][#2][#3]%
- {\ifthirdargument
- \getparameters[\??tt#1::#2][#3]%
- \else\ifsecondargument
- \getparameters[\??tt#1::][#2]%
- \else
- \getparameters[\??tt\v!tabulate::][#1]%
- \fi\fi}
-
-\setuptabulate
- [\c!unit=1em,
- EQ={:},
- \c!frame=\v!off,
- \c!bodyfont=,
- \c!rule=\v!normal,
- \c!rulecolor=,
- \c!rulethickness=\linewidth,
- \c!inner=,
- \c!before=\blank,
- \c!after=\blank,
- \c!distance={\v!depth,\v!medium},
- \c!align=\v!normal,
- \c!margin=\!!zeropoint,
- \c!split=\v!auto,
- \c!header=\v!yes,
- \c!title=,
- \c!indenting=\v!no]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/tabl-tsp.mkii b/Master/texmf-dist/tex/context/base/mkii/tabl-tsp.mkii
deleted file mode 100644
index 59e9185e81d..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/tabl-tsp.mkii
+++ /dev/null
@@ -1,427 +0,0 @@
-%D \module
-%D [ file=tabl-tsp,
-%D version=2000.10.20,
-%D title=\CONTEXT\ Table Macros,
-%D subtitle=Splitting,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Table Macros / Splitting}
-
-%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}
-
-\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
-\notesenabledfalse % best here, experimental, brrr; test with note in caption
- \else
- \setfalse\retainfloatnumber
- \fi
- \splitfloatcommand{\box\nextbox}%
- \egroup
- \ifconditional\somenextplitofffloat
- \doifelsenothing\@@siinbetween
- {\ifconditional\splitfloatfirstdone\else\page\fi}
- \@@siinbetween
- \else
- \@@siafter
- \dopopsavedfloats
- \doflushsavedfloats
- \fi
- \global\settrue\splitfloatfirstdone}%
- \vbox}
-
-\def\nodowithsplitofffloat
- {\dowithnextbox
- {\forgetall
- \dontcomplain
- \box\nextbox % maybe an option to unvbox
- \global\settrue\splitfloatfirstdone}%
- \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% depends on 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{% only \def's starting a a new line are seen by the dep checker
- \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\splitfloatfirstdone
-
-\def\handletsplit
- {\analyzesplitfloatcaption\tsplitcontent
- \global\setfalse\splitfloatfirstdone
- \testpagesync % new, sync, but still tricky
- [\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\splitfloatfirstdone
- \scratchdimen\textheight
- \!!donectrue
- \else
- \ifconditional\splitfloatfirstdone
- \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
- \splittopskip\zeropoint
- \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
- \tsplitinbetween
- \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
- \tsplitinbetween
- \unvbox\scratchbox}%
- \exitloop
- \else
- \setbox\tsplitcontent\vbox
- {\unvbox\scratchbox
- \tsplitinbetween
- \ifvoid\tsplitcontent\else\unvbox\tsplitcontent\fi}%
- \exitloop
- \fi\fi\fi
- \!!donedfalse
- \!!donecfalse}%
- \postprocesstsplit
- \dochecksplitofffloat\tsplitcontent
- \ifvoid\tsplitcontent
- \setbox\tsplitresult\vbox
- {\unvbox\tsplitresult
- \tsplitinbetween
- \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
- \tsplitinbetween
- \unvcopy\tsplittail}%
- \dowithsplitofffloat{\tsplitbeforeresult\box\tsplitresult\tsplitafterresult}%
- \doifnotinsidesplitfloat\tsplitafter
- \endgraf
- \fi
- \ifinsidecolumns
- \doifnotinsidesplitfloat\goodbreak
- \else
- \doifnotinsidesplitfloat\page
- \fi
- \fi}%
- \global\setfalse\splitfloatfirstdone} % we can use this one for tests
-
-\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/mkii/thrd-pic.mkii b/Master/texmf-dist/tex/context/base/mkii/thrd-pic.mkii
deleted file mode 100644
index 3c25d8a81d1..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/thrd-pic.mkii
+++ /dev/null
@@ -1,3694 +0,0 @@
-% Since this file is not available in every distribution, we
-% have copied the original in this file. The manuals to
-% Wichura's PiCTeX and TaBlE packages are not available on
-% line and are distributed by respectively the TeX Users Group
-% and Personal TeX Inc.
-
-% We've patched this file for catcode ! because in luatex we use
-% catcode tables and using unprotect/protect is cleaner.
-
-% This is PiCTeX, Version 1.1 9/21/87
-
-% CAVEAT: The PiCTeX manual often has a more lucid explanation
-% of any given topic than you will find in the internal documentation
-% of the macros.
-
-% PiCTeX's commands can be classified into two groups: (1) public (or
-% external), and (2) private (or internal). The public macros are
-% discussed at length in the manual. The only discussion of the private
-% macros is the internal documentation. The private macros all have
-% names beginning with an exclamation point (!) of category code 11.
-% Since in normal usage "!" has category code 12, these macros can't
-% be accessed or modified by the general user.
-
-% The macros are organized into thematically related groups. For example,
-% the macros dealing with dots & dashes are all in the DASHPATTERN group.
-% The table below shows which macros are in which groups. The table
-% covers all public macros, and many (but not all) of PiCTeX's upper level
-% private macros. Following the table, the various groups are listed
-% in the order in which they appear in the table.
-
-% *********************** TABLE OF GROUPS OF MACROS **********************
-
-% HACKS: Utility macros
-% \PiC
-% \PiCTeX
-% \placevalueinpts
-% \!!loop
-% \!cfor
-% \!copylist
-% \!ecfor
-% \!etfor
-% \!getnext
-% \!getnextvalueof
-% \!ifempty
-% \!ifnextchar
-% \!leftappend
-% \!listaddon
-% \!loop
-% \!lop
-% \!mlap
-% \!not
-% \!removept
-% \!rightappend
-% \!tfor
-% \!vmlap
-% \!wlet
-
-% ALLOCATION: Allocates registers
-
-% AREAS: Deals with plot areas
-% \axis
-% \grid
-% \invisibleaxes
-% \normalgraphs
-% \plotheading
-% \setplotarea
-% \visibleaxes
-
-% ARROWS: Draws arrows
-% \arrow
-% \betweenarrows
-
-% BARS: Draws bars
-% \putbar
-% \setbars
-
-% BOXES: Draws rectangles
-% \frame
-% \putrectangle
-% \rectangle
-% \shaderectangleson
-% \shaderectanglesoff
-
-% CURVES: Upper level plot commands
-% \hshade
-% \plot
-% \sethistograms
-% \setlinear
-% \setquadratic
-% \vshade
-
-% DASHPATTERNS: Sets up dash patterns
-% \findlength
-% \setdashes
-% \setdashesnear
-% \setdashpattern
-% \setdots
-% \setdotsnear
-% \setsolid
-% \!dashingoff
-% \!dashingon
-
-% DIVISION: Does long division of dimension registers
-% \Divide
-% \!divide
-
-% ELLIPSES: Draws ellipses and circles
-% \circulararc
-% \ellipticalarc
-
-% RULES: Draws rules, i.e., horizontal & vertical lines
-% \putrule
-% \!putdashedhline
-% \!putdashedvline
-% \!puthline
-% \!putsolidhline
-% \!putsolidvline
-% \!putvline
-
-% LINEAR ARC: Draws straight lines -- solid and dashed
-% \inboundscheckoff
-% \inboundscheckon
-% \!advancedashing
-% \!drawlinearsegment
-% \!initinboundscheck
-% \!linearsolid
-% \!lineardashed
-% \!ljoin
-% \!plotifinbounds
-% \!start
-
-% LOGTEN: Log_10 function
-% \!logten
-
-% PICTURES: Basic setups for PiCtures; \put commands
-% \accountingoff
-% \accountingon
-% \beginpicture
-% \endpicture
-% \endpicturesave
-% \lines
-% \multiput
-% \put
-% \setcoordinatemode
-% \setcoordinatesystem
-% \setdimensionmode
-% \stack
-% \Lines
-% \Xdistance
-% \Ydistance
-% \!dimenput
-% \!ifcoordmode
-% \!ifdimenmode
-% \!setcoordmode
-% \!setdimenmode
-% \!setputobject
-
-% PLOTTING: Things to do with plotting
-% \dontsavelinesandcurves
-% \replot
-% \savelinesandcurves
-% \setplotsymbol
-% \writesavefile
-% \!plot
-
-% PYTHAGORAS: Euclidean distance function
-% \placehypotenuse
-% \!Pythag
-
-% QUADRATIC ARC: Draws a quadratic arc
-% \!qjoin
-
-% ROTATIONS: Handles rotations
-% \startrotation
-% \stoprotation
-% \!rotateaboutpivot
-% \!rotateonly
-
-% SHADING: Handles shading
-% \setshadegrid
-% \setshadesymbol
-% \!lshade
-% \!qshade
-% \!starthshade
-% \!startvshade
-
-% TICKS: Draws ticks on graphs
-% \gridlines
-% \loggedticks
-% \nogridlines
-% \ticksin
-% \ticksout
-% \unloggesticks
-
-% ***************** END OF TABLE OF GROUPS OF MACROS ********************
-
-
-% \catcode`!=11 % ***** THIS MUST NEVER BE OMITTED
-
-\unprotect
-
-% *******************************
-% *** HACKS (Utility macros) ***
-% *******************************
-
-% ** User commands
-% ** \PiC{P\kern-.12em\lower.5ex\hbox{I}\kern-.075emC}
-% ** \PiCTeX{\PiC\kern-.11em\TeX}
-% ** \placevalueinpts of <DIMENSION REGISTER> in {CONTROL SEQUENCE}
-
-% ** Internal commands
-% ** \!ifnextchar{CHARACTER}{TRUE ACTION}{FALSE ACTION}
-% ** \!tfor NAME := LIST \do {BODY}
-% ** \!etfor NAME:= LIST \do {BODY}
-% ** \!cfor NAME := LIST \do {BODY}
-% ** \!ecfor NAME:= LIST \do {BODY}
-% ** \!ifempty{MACRO}{TRUE ACTION}{FALSE ACTION}
-% ** \!getnext\\ITEMfrom\LIST
-% ** \!getnextvalueof\DIMEN\from\LIST
-% ** \!copylist\LISTMACRO_A\to\LISTMACRO_B
-% ** \!wlet\CONTROL_SEQUENCE_A=\CONTROL_SEQUENCE_B
-% ** \!listaddon ITEM LIST
-% ** \!rightappendITEM\withCS\to\LISTMACRO
-% ** \!leftappendITEM\withCS\to\LISTMACRO
-% ** \!lop\LISTMACRO\to\ITEM
-% ** \!loop ... repeat
-% ** \!!loop ... repeat
-% ** \!removept{DIMENSION REGISTER}{CONTROL SEQUENCE}
-% ** \!mlap{...}
-% ** \!vmlap{...}
-% ** \!not{TEK if-CONDITION}
-
-% ** First, here are the the PiCTeX logo, and the syllable PiC:
-\def\PiC{P\kern-.12em\lower.5ex\hbox{I}\kern-.075emC}
-\def\PiCTeX{\PiC\kern-.11em\TeX}
-
-% ** The following macro expands to parameter #2 or parameter #3 according to
-% ** whether the next non-blank character following the macro is or is not #1.
-% ** Blanks following the macro are gobbled.
-\def\!ifnextchar#1#2#3{%
- \let\!testchar=#1%
- \def\!first{#2}%
- \def\!second{#3}%
- \futurelet\!nextchar\!testnext}
-\def\!testnext{%
- \ifx \!nextchar \!spacetoken
- \let\!next=\!skipspacetestagain
- \else
- \ifx \!nextchar \!testchar
- \let\!next=\!first
- \else
- \let\!next=\!second
- \fi
- \fi
- \!next}
-\def\\{\!skipspacetestagain}
- \expandafter\def\\ {\futurelet\!nextchar\!testnext}
-\def\\{\let\!spacetoken= } \\ % ** set \spacetoken to a space token
-
-
-% ** Borrow the "tfor" macro from Latex:
-% ** \!tfor NAME := LIST \do {BODY}
-% ** if, before expansion, LIST = T1 ... Tn, where each Ti is a token
-% ** or {...}, then executes BODY n times, with NAME = Ti on the
-% ** i-th iteration. Works for n=0.
-\def\!tfor#1:=#2\do#3{%
- \edef\!fortemp{#2}%
- \ifx\!fortemp\!empty
- \else
- \!tforloop#2\!nil\!nil\!!#1{#3}%
- \fi}
-\def\!tforloop#1#2\!!#3#4{%
- \def#3{#1}%
- \ifx #3\!nnil
- \let\!nextwhile=\!fornoop
- \else
- #4\relax
- \let\!nextwhile=\!tforloop
- \fi
- \!nextwhile#2\!!#3{#4}}
-
-
-% ** \!etfor NAME:= LIST\do {BODY}
-% ** This is like \!cfor, but LIST is any balanced token list whose complete
-% ** expansion has the form T1 ... Tn
-\def\!etfor#1:=#2\do#3{%
- \def\!!tfor{\!tfor#1:=}%
- \edef\!!!tfor{#2}%
- \expandafter\!!tfor\!!!tfor\do{#3}}
-
-
-% ** modify the Latex \tfor (token-for) loop to a \cfor (comma-for) loop.
-% ** \!cfor NAME := LIST \do {BODY}
-% ** if, before expansion, LIST = a1,a2,...an, then executes BODY n times,
-% ** with NAME = ai on the i-th iteration. Works for n=0.
-\def\!cfor#1:=#2\do#3{%
- \edef\!fortemp{#2}%
- \ifx\!fortemp\!empty
- \else
- \!cforloop#2,\!nil,\!nil\!!#1{#3}%
- \fi}
-\def\!cforloop#1,#2\!!#3#4{%
- \def#3{#1}%
- \ifx #3\!nnil
- \let\!nextwhile=\!fornoop
- \else
- #4\relax
- \let\!nextwhile=\!cforloop
- \fi
- \!nextwhile#2\!!#3{#4}}
-
-
-% ** \!ecfor NAME:= LIST\do {BODY}
-% ** This is like \!cfor, but LIST is any balanced token list whose complete
-% ** expansion has the form a1,a2,...,an.
-\def\!ecfor#1:=#2\do#3{%
- \def\!!cfor{\!cfor#1:=}%
- \edef\!!!cfor{#2}%
- \expandafter\!!cfor\!!!cfor\do{#3}}
-
-
-\def\!empty{}
-\def\!nnil{\!nil}
-\def\!fornoop#1\!!#2#3{}
-
-
-% ** \!ifempty{ARG}{TRUE ACTION}{FALSE ACTION}
-\def\!ifempty#1#2#3{%
- \edef\!emptyarg{#1}%
- \ifx\!emptyarg\!empty
- #2%
- \else
- #3%
- \fi}
-
-% ** \!getnext\\ITEMfrom\LIST
-% ** \LIST has the form \\{item1}\\{item2}\\{item3}...\\{itemk}
-% ** This routine sets \ITEM to item1, and cycles \LIST to
-% ** \\{item2}\\{item3}...\\{itemk}\\{item1}
-\def\!getnext#1\from#2{%
- \expandafter\!gnext#2\!#1#2}%
-\def\!gnext\\#1#2\!#3#4{%
- \def#3{#1}%
- \def#4{#2\\{#1}}%
- \ignorespaces}
-
-
-% ** \!getnextvalueof\DIMEN\from\LIST
-% ** Similar to !getnext.
-% ** \LIST has the form \\{dimen1}\\{dimen2}\\{dimen3} ...
-% ** \DIMEN is a dimension register
-% ** Works also for counts
-%
-\def\!getnextvalueof#1\from#2{%
- \expandafter\!gnextv#2\!#1#2}%
-\def\!gnextv\\#1#2\!#3#4{%
- #3=#1%
- \def#4{#2\\{#1}}%
- \ignorespaces}
-
-
-% ** \!copylist\LISTMACROA\to\LISTMACROB
-% ** makes the replacement text of LISTMACRO B identical to that of
-% ** list macro A.
-\def\!copylist#1\to#2{%
- \expandafter\!!copylist#1\!#2}
-\def\!!copylist#1\!#2{%
- \def#2{#1}\ignorespaces}
-
-
-% ** \!wlet\CSA=\CSB
-% ** lets control sequence \CSB = control sequence \CSA, and writes a
-% ** message to that effect in the log file using plain TEK's \wlog
-\def\!wlet#1=#2{%
- \let#1=#2
- \wlog{\string#1=\string#2}}
-
-% ** \!listaddon ITEM LIST
-% ** LIST <-- LIST \\ ITEM
-\def\!listaddon#1#2{%
- \expandafter\!!listaddon#2\!{#1}#2}
-\def\!!listaddon#1\!#2#3{%
- \def#3{#1\\#2}}
-
-% ** \!rightappendITEM\to\LISTMACRO
-% ** \LISTMACRO --> \LISTMACRO\\{ITEM}
-%\def\!rightappend#1\to#2{\expandafter\!!rightappend#2\!{#1}#2}
-%\def\!!rightappend#1\!#2#3{\def#3{#1\\{#2}}}
-
-
-% ** \!rightappendITEM\withCS\to\LISTMACRO
-% ** \LISTMACRO --> \LISTMACRO||CS||{ITEM}
-\def\!rightappend#1\withCS#2\to#3{\expandafter\!!rightappend#3\!#2{#1}#3}
-\def\!!rightappend#1\!#2#3#4{\def#4{#1#2{#3}}}
-
-
-% ** \!leftappendITEM\withCS\to\LISTMACRO
-% ** \LISTMACRO --> CS||{ITEM}||\LISTMACRO
-\def\!leftappend#1\withCS#2\to#3{\expandafter\!!leftappend#3\!#2{#1}#3}
-\def\!!leftappend#1\!#2#3#4{\def#4{#2{#3}#1}}
-
-
-% ** \!lop\LISTMACRO\to\ITEM
-% ** \\{item1}\\{item2}\\{item3} ... --> \\{item2}\\{item3} ...
-% ** item1 --> \ITEM
-\def\!lop#1\to#2{\expandafter\!!lop#1\!#1#2}
-\def\!!lop\\#1#2\!#3#4{\def#4{#1}\def#3{#2}}
-
-
-% ** \!placeNUMBER\of\LISTMACRO\in\ITEM
-% ** the NUMBERth item of \LISTMACRO --> replacement text of \ITEM
-%\def\!place#1\of#2\in#3{\def#3{\outofrange}%
-%{\count0=#1\def\\##1{\advance\count0-1 \ifnum\count0=0 \gdef#3{##1}\fi}#2}}
-
-
-% ** Following code converts a commalist to a list macro, with all items
-% ** fully expanded.
-%\!ecfor\item:=\commalist\do{\expandafter\!rightappend\item\to\list}
-
-
-% ** \!loop ... repeat
-% ** This is exactly like TEX's \loop ... repeat. It can be used in nesting
-% ** two loops, without puting the inner one inside a group.
-\def\!loop#1\repeat{\def\!body{#1}\!iterate}
-\def\!iterate{\!body\let\!next=\!iterate\else\let\!next=\relax\fi\!next}
-
-% ** \!!loop ... repeat
-% ** This is exactly like TEX's \loop ... repeat. It can be used in nesting
-% ** two loops, without puting the inner one inside a group.
-\def\!!loop#1\repeat{\def\!!body{#1}\!!iterate}
-\def\!!iterate{\!!body\let\!!next=\!!iterate\else\let\!!next=\relax\fi\!!next}
-% (\multiput uses \!!loop)
-
-% ** \!removept{DIMENREG}{\CS}
-% ** Defines the control sequence CS to be the value (in points) in the
-% ** dimension register DIMENREG (but without the "pt" TEK usually adds)
-% ** E.g., after \dimen0=12.3pt \!removept\dimen0\A, \A expands to 12.3
-\def\!removept#1#2{\edef#2{\expandafter\!!removePT\the#1}}
-{\catcode`p=12 \catcode`t=12 \gdef\!!removePT#1pt{#1}}
-
-% ** \pladevalueinpts of <DIMENSION REGISTER> in {CONTROL SEQUENCE}
-\def\placevalueinpts of <#1> in #2 {%
- \!removept{#1}{#2}}
-
-% ** \!mlap{...} \!vmlap{...}
-% ** Center ... in a box of width 0.
-\def\!mlap#1{\hbox to 0pt{\hss#1\hss}}
-\def\!vmlap#1{\vbox to 0pt{\vss#1\vss}}
-
-% ** \!not{TEK if-CONDITION}
-% ** By a TEK if-CONDITION is meant something like
-% ** \ifnum\N<0, or \ifdim\A>\B
-% ** \!not produces an if-condition which is false if the original condition
-% ** is true, and true if the original condition is false.
-\def\!not#1{%
- #1\relax
- \!switchfalse
- \else
- \!switchtrue
- \fi
- \if!switch
- \ignorespaces}
-
-
-% *******************
-% *** ALLOCATIONS ***
-% *******************
-
-% This section allocates all the registers PiCTeX uses. Following
-% each allocation is a string of the form ....N.D...L......... ;
-% the various letters show which sections of PiCTeX make explicit
-% reference to that register, according to the following code:
-
-% H Hacks
-% A Areas
-% W arroWs
-% B Bars
-% X boXes
-% C Curves
-% D Dashpattterns
-% V diVision
-% E Ellipses
-% U rUles
-% L Linear arc
-% G loGten
-% P Pictures
-% O plOtting
-% Y pYthagoras
-% Q Quadratic arc
-% R Rotations
-% S Shading
-% T Ticks
-
-% Turn off messages from TeX's allocation macros
-\let\!!!wlog=\wlog % "\wlog" is defined in plain TeX
-\def\wlog#1{}
-
-\newdimen\headingtoplotskip %.A.................
-\newdimen\linethickness %.A..X....U........T
-\newdimen\longticklength %.A................T
-\newdimen\plotsymbolspacing %......D...L....Q...
-\newdimen\shortticklength %.A................T
-\newdimen\stackleading %.A..........P......
-\newdimen\tickstovaluesleading %.A................T
-\newdimen\totalarclength %......D...L....Q...
-\newdimen\valuestolabelleading %.A.................
-
-\newbox\!boxA %.AW...............T
-\newbox\!boxB %..W................
-\newbox\!picbox %............P......
-\newbox\!plotsymbol %..........L..O.....
-\newbox\!putobject %............PO...S.
-\newbox\!shadesymbol %.................S.
-
-\newcount\!countA %.A....D..UL....Q.ST
-\newcount\!countB %......D..U.....Q.ST
-\newcount\!countC %...............Q..T
-\newcount\!countD %...................
-\newcount\!countE %.............O....T
-\newcount\!countF %.............O....T
-\newcount\!countG %..................T
-\newcount\!fiftypt %.........U.........
-\newcount\!intervalno %..........L....Q...
-\newcount\!npoints %..........L........
-\newcount\!nsegments %.........U.........
-\newcount\!ntemp %............P......
-\newcount\!parity %.................S.
-\newcount\!scalefactor %..................T
-\newcount\!tfs %.......V...........
-\newcount\!tickcase %..................T
-
-\newdimen\!Xleft %............P......
-\newdimen\!Xright %............P......
-\newdimen\!Xsave %.A................T
-\newdimen\!Ybot %............P......
-\newdimen\!Ysave %.A................T
-\newdimen\!Ytop %............P......
-\newdimen\!angle %........E..........
-\newdimen\!arclength %..W......UL....Q...
-\newdimen\!areabloc %.A........L........
-\newdimen\!arealloc %.A........L........
-\newdimen\!arearloc %.A........L........
-\newdimen\!areatloc %.A........L........
-\newdimen\!bshrinkage %.................S.
-\newdimen\!checkbot %..........L........
-\newdimen\!checkleft %..........L........
-\newdimen\!checkright %..........L........
-\newdimen\!checktop %..........L........
-\newdimen\!dimenA %.AW.X.DVEUL..OYQRST
-\newdimen\!dimenB %....X.DVEU...O.QRS.
-\newdimen\!dimenC %..W.X.DVEU......RS.
-\newdimen\!dimenD %..W.X.DVEU....Y.RS.
-\newdimen\!dimenE %..W........G..YQ.S.
-\newdimen\!dimenF %...........G..YQ.S.
-\newdimen\!dimenG %...........G..YQ.S.
-\newdimen\!dimenH %...........G..Y..S.
-\newdimen\!dimenI %...BX.........Y....
-\newdimen\!distacross %..........L....Q...
-\newdimen\!downlength %..........L........
-\newdimen\!dp %.A..X.......P....S.
-\newdimen\!dshade %.................S.
-\newdimen\!dxpos %..W......U..P....S.
-\newdimen\!dxprime %...............Q...
-\newdimen\!dypos %..WB.....U..P......
-\newdimen\!dyprime %...............Q...
-\newdimen\!ht %.A..X.......P....S.
-\newdimen\!leaderlength %......D..U.........
-\newdimen\!lshrinkage %.................S.
-\newdimen\!midarclength %...............Q...
-\newdimen\!offset %.A................T
-\newdimen\!plotheadingoffset %.A.................
-\newdimen\!plotsymbolxshift %..........L..O.....
-\newdimen\!plotsymbolyshift %..........L..O.....
-\newdimen\!plotxorigin %..........L..O.....
-\newdimen\!plotyorigin %..........L..O.....
-\newdimen\!rootten %...........G.......
-\newdimen\!rshrinkage %.................S.
-\newdimen\!shadesymbolxshift %.................S.
-\newdimen\!shadesymbolyshift %.................S.
-\newdimen\!tenAa %...........G.......
-\newdimen\!tenAc %...........G.......
-\newdimen\!tenAe %...........G.......
-\newdimen\!tshrinkage %.................S.
-\newdimen\!uplength %..........L........
-\newdimen\!wd %....X.......P....S.
-\newdimen\!wmax %...............Q...
-\newdimen\!wmin %...............Q...
-\newdimen\!xB %...............Q...
-\newdimen\!xC %...............Q...
-\newdimen\!xE %..W.....E.L....Q.S.
-\newdimen\!xM %..W.....E......Q.S.
-\newdimen\!xS %..W.....E.L....Q.S.
-\newdimen\!xaxislength %.A................T
-\newdimen\!xdiff %..........L........
-\newdimen\!xleft %............P......
-\newdimen\!xloc %..WB.....U.......S.
-\newdimen\!xorigin %.A........L.P....S.
-\newdimen\!xpivot %................R..
-\newdimen\!xpos %..........L.P..Q.ST
-\newdimen\!xprime %...............Q...
-\newdimen\!xright %............P......
-\newdimen\!xshade %.................S.
-\newdimen\!xshift %..W.........PO...S.
-\newdimen\!xtemp %............P......
-\newdimen\!xunit %.AWBX...EUL.P..QRS.
-\newdimen\!xxE %........E..........
-\newdimen\!xxM %........E..........
-\newdimen\!xxS %........E..........
-\newdimen\!xxloc %..WB....EU.........
-\newdimen\!yB %...............Q...
-\newdimen\!yC %...............Q...
-\newdimen\!yE %..W.....E.L....Q...
-\newdimen\!yM %..W.....E......Q...
-\newdimen\!yS %..W.....E.L....Q...
-\newdimen\!yaxislength %.A................T
-\newdimen\!ybot %............P......
-\newdimen\!ydiff %..........L........
-\newdimen\!yloc %..WB.....U.......S.
-\newdimen\!yorigin %.A........L.P....S.
-\newdimen\!ypivot %................R..
-\newdimen\!ypos %..........L.P..Q.ST
-\newdimen\!yprime %...............Q...
-\newdimen\!yshade %.................S.
-\newdimen\!yshift %..W.........PO...S.
-\newdimen\!ytemp %............P......
-\newdimen\!ytop %............P......
-\newdimen\!yunit %.AWBX...EUL.P..QRS.
-\newdimen\!yyE %........E..........
-\newdimen\!yyM %........E..........
-\newdimen\!yyS %........E..........
-\newdimen\!yyloc %..WB....EU.........
-\newdimen\!zpt %.AWBX.DVEULGP.YQ.ST
-
-\newif\if!axisvisible %.A.................
-\newif\if!gridlinestoo %..................T
-\newif\if!keepPO %...................
-\newif\if!placeaxislabel %.A.................
-\newif\if!switch %H..................
-\newif\if!xswitch %.A................T
-
-\newtoks\!axisLaBeL %.A.................
-\newtoks\!keywordtoks %.A.................
-
-\newwrite\!replotfile %.............O.....
-
-\newhelp\!keywordhelp{The keyword mentioned in the error message in unknown.
-Replace NEW KEYWORD in the indicated response by the keyword that
-should have been specified.} %.A.................
-
-% The following commands assign alternate names to some of the
-% above registers. "\!wlet" is defined in Hacks.
-\!wlet\!!origin=\!xM %.A................T
-\!wlet\!!unit=\!uplength %.A................T
-\!wlet\!Lresiduallength=\!dimenG %.........U.........
-\!wlet\!Rresiduallength=\!dimenF %.........U.........
-\!wlet\!axisLength=\!distacross %.A................T
-\!wlet\!axisend=\!ydiff %.A................T
-\!wlet\!axisstart=\!xdiff %.A................T
-\!wlet\!axisxlevel=\!arclength %.A................T
-\!wlet\!axisylevel=\!downlength %.A................T
-\!wlet\!beta=\!dimenE %...............Q...
-\!wlet\!gamma=\!dimenF %...............Q...
-\!wlet\!shadexorigin=\!plotxorigin %.................S.
-\!wlet\!shadeyorigin=\!plotyorigin %.................S.
-\!wlet\!ticklength=\!xS %..................T
-\!wlet\!ticklocation=\!xE %..................T
-\!wlet\!ticklocationincr=\!yE %..................T
-\!wlet\!tickwidth=\!yS %..................T
-\!wlet\!totalleaderlength=\!dimenE %.........U.........
-\!wlet\!xone=\!xprime %....X..............
-\!wlet\!xtwo=\!dxprime %....X..............
-\!wlet\!ySsave=\!yM %...................
-\!wlet\!ybB=\!yB %.................S.
-\!wlet\!ybC=\!yC %.................S.
-\!wlet\!ybE=\!yE %.................S.
-\!wlet\!ybM=\!yM %.................S.
-\!wlet\!ybS=\!yS %.................S.
-\!wlet\!ybpos=\!yyloc %.................S.
-\!wlet\!yone=\!yprime %....X..............
-\!wlet\!ytB=\!xB %.................S.
-\!wlet\!ytC=\!xC %.................S.
-\!wlet\!ytE=\!downlength %.................S.
-\!wlet\!ytM=\!arclength %.................S.
-\!wlet\!ytS=\!distacross %.................S.
-\!wlet\!ytpos=\!xxloc %.................S.
-\!wlet\!ytwo=\!dyprime %....X..............
-
-
-% Initial values for registers
-\!zpt=0pt % static
-\!xunit=1pt
-\!yunit=1pt
-\!arearloc=\!xunit
-\!areatloc=\!yunit
-\!dshade=5pt
-\!leaderlength=24in
-\!tfs=256 % static
-\!wmax=5.3pt % static
-\!wmin=2.7pt % static
-\!xaxislength=\!xunit
-\!xpivot=\!zpt
-\!yaxislength=\!yunit
-\!ypivot=\!zpt
-\plotsymbolspacing=.4pt
- \!dimenA=50pt \!fiftypt=\!dimenA % static
-
-\!rootten=3.162278pt % static
-\!tenAa=8.690286pt % static (A5)
-\!tenAc=2.773839pt % static (A3)
-\!tenAe=2.543275pt % static (A1)
-
-% Initial values for control sequences
-\def\!cosrotationangle{1} %................R..
-\def\!sinrotationangle{0} %................R..
-\def\!xpivotcoord{0} %................R..
-\def\!xref{0} %............P......
-\def\!xshadesave{0} %.................S.
-\def\!ypivotcoord{0} %................R..
-\def\!yref{0} %............P......
-\def\!yshadesave{0} %.................S.
-\def\!zero{0} %..................T
-
-% Reset TeX to report allocations
-\let\wlog=\!!!wlog
-% *************************************
-% *** AREAS: Deals with plot areas ***
-% *************************************
-%
-% ** User commands
-% ** \setplotarea x from LEFT XCOORD to RIGTH XCOORD, y from BOTTOM YCOORD
-% ** to TOP YCOORD
-% ** \axis BOTTOM-LEFT-TOP-RIGHT [SHIFTEDTO xy=COORD] [VISIBLE-INVISIBLE]
-% ** [LABEL {label}] [TICKS] /
-% ** \visibleaxes
-% ** \invisibleaxes
-% ** \plotheading {HEADING}
-% ** \grid {# of columns} {# of rows}
-% ** \normalgraphs
-
-% ** \normalgraphs
-% ** Sets defaults for graph setup. See Subsection 3.4 of manual.
-\def\normalgraphs{%
- \longticklength=.4\baselineskip
- \shortticklength=.25\baselineskip
- \tickstovaluesleading=.25\baselineskip
- \valuestolabelleading=.8\baselineskip
- \linethickness=.4pt
- \stackleading=.17\baselineskip
- \headingtoplotskip=1.5\baselineskip
- \visibleaxes
- \ticksout
- \nogridlines
- \unloggedticks}
-%
-% ** \setplotarea x from LEFT XCOORD to RIGTH XCOORD, y from BOTTOM YCOORD
-% ** to TOP YCOORD
-% ** Reserves space in PICBOX for a rectangular box with the indicated
-% ** coordinates. Must be specified before calls to \axis,
-% ** \grid, \plotheading.
-% ** See Subsection 3.1 of the manual.
-\def\setplotarea x from #1 to #2, y from #3 to #4 {%
- \!arealloc=\!M{#1}\!xunit \advance \!arealloc -\!xorigin
- \!areabloc=\!M{#3}\!yunit \advance \!areabloc -\!yorigin
- \!arearloc=\!M{#2}\!xunit \advance \!arearloc -\!xorigin
- \!areatloc=\!M{#4}\!yunit \advance \!areatloc -\!yorigin
- \!initinboundscheck
- \!xaxislength=\!arearloc \advance\!xaxislength -\!arealloc
- \!yaxislength=\!areatloc \advance\!yaxislength -\!areabloc
- \!plotheadingoffset=\!zpt
- \!dimenput {{\setbox0=\hbox{}\wd0=\!xaxislength\ht0=\!yaxislength\box0}}
- [bl] (\!arealloc,\!areabloc)}
-%
-% ** \visibleaxes, \invisibleaxes
-% ** Switches for setting visibility of subsequent axes.
-% ** See Subsection 3.2 of the manual.
-\def\visibleaxes{%
- \def\!axisvisibility{\!axisvisibletrue}}
-\def\invisibleaxes{%
- \def\!axisvisibility{\!axisvisiblefalse}}
-%
-% ** The next few macros enable the user to fix up an erroneous keyword
-% ** in the \axis command.
-% \newhelp is in ALLOCATIONS
-% \newhelp\!keywordhelp{The keyword mentioned in the error message in unknown.
-% Replace NEW KEYWORD in the indicated response by the keyword that
-% should have been specified.}
-
-\def\!fixkeyword#1{%
- \errhelp=\!keywordhelp
- \errmessage{Unrecognized keyword `#1': \the\!keywordtoks{NEW KEYWORD}'}}
-
-% \newtoks\!keywordtoks In ALLOCATIONS.
-\!keywordtoks={enter `i\fixkeyword}
-
-\def\fixkeyword#1{%
- \!nextkeyword#1 }
-
-% ** \axis BOTTOM-LEFT-TOP-RIGHT [SHIFTEDTO xy=COORD] [VISIBLE-INVISIBLE]
-% ** [LABEL {label}] [TICKS] /
-% ** Exactly one of the keywords BOTTOM, LEFT, TOP, RIGHT must be
-% ** specified. Axis is drawn along the indicated edge of the current
-% ** plot area, shifted if the SHIFTEDTO option is used, visible or
-% ** invisible according the selected option, with an optional LABEL,
-% ** and optional TICKS (see ticks.tex for the options avialabel with
-% ** TICKS). The TICKS option must be the last one specified. The \axis
-% ** MUST be terminated with a / followed by a space.
-% ** See Subsection 3.2 of the manual for more information.
-
-% ** The various options of the \axis command are processed by the
-% ** \!nextkeyword macro defined below. For example,
-% ** `\!nextkeyword shiftedto ' expands to `\!axisshiftedto'.
-\def\axis {%
- \def\!nextkeyword##1 {%
- \expandafter\ifx\csname !axis##1\endcsname \relax
- \def\!next{\!fixkeyword{##1}}%
- \else
- \def\!next{\csname !axis##1\endcsname}%
- \fi
- \!next}%
- \!offset=\!zpt
- \!axisvisibility
- \!placeaxislabelfalse
- \!nextkeyword}
-
-% ** This and the various macros that follow handle the keyword
-% ** specifications on the \axis command
-% ** See Subsection 3.2 of the manual.
-\def\!axisbottom{%
- \!axisylevel=\!areabloc
- \def\!tickxsign{0}%
- \def\!tickysign{-}%
- \def\!axissetup{\!axisxsetup}%
- \def\!axislabeltbrl{t}%
- \!nextkeyword}
-
-\def\!axistop{%
- \!axisylevel=\!areatloc
- \def\!tickxsign{0}%
- \def\!tickysign{+}%
- \def\!axissetup{\!axisxsetup}%
- \def\!axislabeltbrl{b}%
- \!nextkeyword}
-
-\def\!axisleft{%
- \!axisxlevel=\!arealloc
- \def\!tickxsign{-}%
- \def\!tickysign{0}%
- \def\!axissetup{\!axisysetup}%
- \def\!axislabeltbrl{r}%
- \!nextkeyword}
-
-\def\!axisright{%
- \!axisxlevel=\!arearloc
- \def\!tickxsign{+}%
- \def\!tickysign{0}%
- \def\!axissetup{\!axisysetup}%
- \def\!axislabeltbrl{l}%
- \!nextkeyword}
-
-\def\!axisshiftedto#1=#2 {%
- \if 0\!tickxsign
- \!axisylevel=\!M{#2}\!yunit
- \advance\!axisylevel -\!yorigin
- \else
- \!axisxlevel=\!M{#2}\!xunit
- \advance\!axisxlevel -\!xorigin
- \fi
- \!nextkeyword}
-
-\def\!axisvisible{%
- \!axisvisibletrue
- \!nextkeyword}
-
-\def\!axisinvisible{%
- \!axisvisiblefalse
- \!nextkeyword}
-
-\def\!axislabel#1 {%
- \!axisLaBeL={#1}%
- \!placeaxislabeltrue
- \!nextkeyword}
-
-\expandafter\def\csname !axis/\endcsname{%
- \!axissetup % This could done already by "ticks"; if so, now \relax
- \if!placeaxislabel
- \!placeaxislabel
- \fi
- \if +\!tickysign % ** (A "top" axis)
- \!dimenA=\!axisylevel
- \advance\!dimenA \!offset % ** dimA = top of the axis structure
- \advance\!dimenA -\!areatloc % ** dimA = excess over the plot area
- \ifdim \!dimenA>\!plotheadingoffset
- \!plotheadingoffset=\!dimenA % ** Greatest excess over the plot area
- \fi
- \fi}
-
-% ** \grid {c} {r}
-% ** Partitions the plot area into c columns and r rows; see Subsection 3.3
-% ** of the manual.
-% ** (Other grid patterns can be drawn with the TICKS option of the \axis
-% ** command.
-\def\grid #1 #2 {%
- \!countA=#1\advance\!countA 1
- \axis bottom invisible ticks length <\!zpt> andacross quantity {\!countA} /
- \!countA=#2\advance\!countA 1
- \axis left invisible ticks length <\!zpt> andacross quantity {\!countA} / }
-
-% ** \plotheading{HEADING}
-% ** Places HEADING centered above the top of the plotarea (and above
-% ** any top axis ticks marks, tick labels, and axis label); see
-% ** Subsection 3.3 of the manual.
-\def\plotheading#1 {%
- \advance\!plotheadingoffset \headingtoplotskip
- \!dimenput {#1} [B] <.5\!xaxislength,\!plotheadingoffset>
- (\!arealloc,\!areatloc)}
-
-% ** From here on, the routines are internal.
-\def\!axisxsetup{%
- \!axisxlevel=\!arealloc
- \!axisstart=\!arealloc
- \!axisend=\!arearloc
- \!axisLength=\!xaxislength
- \!!origin=\!xorigin
- \!!unit=\!xunit
- \!xswitchtrue
- \if!axisvisible
- \!makeaxis
- \fi}
-
-\def\!axisysetup{%
- \!axisylevel=\!areabloc
- \!axisstart=\!areabloc
- \!axisend=\!areatloc
- \!axisLength=\!yaxislength
- \!!origin=\!yorigin
- \!!unit=\!yunit
- \!xswitchfalse
- \if!axisvisible
- \!makeaxis
- \fi}
-
-\def\!makeaxis{%
- \setbox\!boxA=\hbox{% (Make a pseudo-y[x] tick for an x[y]-axis)
- \beginpicture
- \!setdimenmode
- \setcoordinatesystem point at {\!zpt} {\!zpt}
- \putrule from {\!zpt} {\!zpt} to
- {\!tickysign\!tickysign\!axisLength}
- {\!tickxsign\!tickxsign\!axisLength}
- \endpicturesave <\!Xsave,\!Ysave>}%
- \wd\!boxA=\!zpt
- \!placetick\!axisstart}
-
-\def\!placeaxislabel{%
- \advance\!offset \valuestolabelleading
- \if!xswitch
- \!dimenput {\the\!axisLaBeL} [\!axislabeltbrl]
- <.5\!axisLength,\!tickysign\!offset> (\!axisxlevel,\!axisylevel)
- \advance\!offset \!dp % ** advance offset by the "tallness"
- \advance\!offset \!ht % ** of the label
- \else
- \!dimenput {\the\!axisLaBeL} [\!axislabeltbrl]
- <\!tickxsign\!offset,.5\!axisLength> (\!axisxlevel,\!axisylevel)
- \fi
- \!axisLaBeL={}}
-
-
-% *******************************
-% *** ARROWS (Draws arrows) ***
-% *******************************
-%
-% ** User commands
-% ** \arrow <ARROW HEAD LENGTH> [MID FRACTION, BASE FRACTION]
-% ** [<XSHIFT,YSHIFT>] from XFROM YFROM to XTO YTO
-% ** \betweenarrows {TEXT} [orientation & shift] from XFROM YFROM to XTO YTO
-
-% ** \arrow <ARROW HEAD LENGTH> [MID FRACTION, BASE FRACTION]
-% ** [<XSHIFT,YSHIFT>] from XFROM YFROM to XTO YTO
-% ** Draws an arrow from (XFROM,YFROM) to (XTO,YTO). The arrow head
-% ** is constructed two quadratic arcs, which extend back a distance
-% ** ARROW HEAD LENGTH (a dimension) on both sides of the arrow shaft.
-% ** All the way back the arcs are a distance BASE FRACTION*ARROW HEAD
-% ** LENGTH apart, while half-way back they are a distance MID FRACTION*
-% ** ARROW HEAD LENGTH apart. <XSHIFT,YSHIFT> is optional, and has
-% ** its usual interpreation. See Subsection 5.4 of the manual.
-
-\def\arrow <#1> [#2,#3]{%
- \!ifnextchar<{\!arrow{#1}{#2}{#3}}{\!arrow{#1}{#2}{#3}<\!zpt,\!zpt> }}
-
-\def\!arrow#1#2#3<#4,#5> from #6 #7 to #8 #9 {%
-%
-% ** convert to dimensions
- \!xloc=\!M{#8}\!xunit
- \!yloc=\!M{#9}\!yunit
- \!dxpos=\!xloc \!dimenA=\!M{#6}\!xunit \advance \!dxpos -\!dimenA
- \!dypos=\!yloc \!dimenA=\!M{#7}\!yunit \advance \!dypos -\!dimenA
- \let\!MAH=\!M% ** save current c/d mode
- \!setdimenmode% ** go into dimension mode
-%
- \!xshift=#4\relax \!yshift=#5\relax% ** pick up shift
- \!reverserotateonly\!xshift\!yshift% ** back rotate shift
- \advance\!xshift\!xloc \advance\!yshift\!yloc
-%
-% ** draw shaft of arrow
- \!xS=-\!dxpos \advance\!xS\!xshift
- \!yS=-\!dypos \advance\!yS\!yshift
- \!start (\!xS,\!yS)
- \!ljoin (\!xshift,\!yshift)
-%
-% ** find 32*cosine and 32*sine of angle of rotation
- \!Pythag\!dxpos\!dypos\!arclength
- \!divide\!dxpos\!arclength\!dxpos
- \!dxpos=32\!dxpos \!removept\!dxpos\!!cos
- \!divide\!dypos\!arclength\!dypos
- \!dypos=32\!dypos \!removept\!dypos\!!sin
-%
-% ** construct arrowhead
- \!halfhead{#1}{#2}{#3}% ** draw half of arrow head
- \!halfhead{#1}{-#2}{-#3}% ** draw other half
-%
- \let\!M=\!MAH% ** restore old c/d mode
- \ignorespaces}
-%
-% ** draw half of arrow head
- \def\!halfhead#1#2#3{%
- \!dimenC=-#1%
- \divide \!dimenC 2 % ** half way back
- \!dimenD=#2\!dimenC% ** half the mid width
- \!rotate(\!dimenC,\!dimenD)by(\!!cos,\!!sin)to(\!xM,\!yM)
- \!dimenC=-#1% ** all the way back
- \!dimenD=#3\!dimenC
- \!dimenD=.5\!dimenD% ** half the full width
- \!rotate(\!dimenC,\!dimenD)by(\!!cos,\!!sin)to(\!xE,\!yE)
- \!start (\!xshift,\!yshift)
- \advance\!xM\!xshift \advance\!yM\!yshift
- \advance\!xE\!xshift \advance\!yE\!yshift
- \!qjoin (\!xM,\!yM) (\!xE,\!yE)
- \ignorespaces}
-
-
-% ** \betweenarrows {TEXT} [orientation & shift] from XFROM YFROM to XTO YTO
-% ** Makes things like <--- text --->, using arrow heads from TeX's fonts.
-% ** See Subsection 5.4 of the manual.
-\def\betweenarrows #1#2 from #3 #4 to #5 #6 {%
- \!xloc=\!M{#3}\!xunit \!xxloc=\!M{#5}\!xunit%
- \!yloc=\!M{#4}\!yunit \!yyloc=\!M{#6}\!yunit%
- \!dxpos=\!xxloc \advance\!dxpos by -\!xloc
- \!dypos=\!yyloc \advance\!dypos by -\!yloc
- \advance\!xloc .5\!dxpos
- \advance\!yloc .5\!dypos
-%
- \let\!MBA=\!M% ** save current coord\dimen mode
- \!setdimenmode% ** express locations in dimens
- \ifdim\!dypos=\!zpt
- \ifdim\!dxpos<\!zpt \!dxpos=-\!dxpos \fi
- \put {\!lrarrows{\!dxpos}{#1}}#2{} at {\!xloc} {\!yloc}
- \else
- \ifdim\!dxpos=\!zpt
- \ifdim\!dypos<\!zpt \!dypos=-\!zpt \fi
- \put {\!udarrows{\!dypos}{#1}}#2{} at {\!xloc} {\!yloc}
- \fi
- \fi
- \let\!M=\!MBA% ** restore previous c/d mode
- \ignorespaces}
-
-% ** Subroutine for left-right between arrows
-\def\!lrarrows#1#2{% #1=width, #2=text
- {\setbox\!boxA=\hbox{$\mkern-2mu\mathord-\mkern-2mu$}%
- \setbox\!boxB=\hbox{$\leftarrow$}\!dimenE=\ht\!boxB
- \setbox\!boxB=\hbox{}\ht\!boxB=2\!dimenE
- \hbox to #1{$\mathord\leftarrow\mkern-6mu
- \cleaders\copy\!boxA\hfil
- \mkern-6mu\mathord-$%
- \kern.4em $\vcenter{\box\!boxB}$$\vcenter{\hbox{#2}}$\kern.4em
- $\mathord-\mkern-6mu
- \cleaders\copy\!boxA\hfil
- \mkern-6mu\mathord\rightarrow$}}}
-
-% ** Subroutine for up-down between arrows
-\def\!udarrows#1#2{% #1=width, #2=text
- {\setbox\!boxB=\hbox{#2}%
- \setbox\!boxA=\hbox to \wd\!boxB{\hss$\vert$\hss}%
- \!dimenE=\ht\!boxA \advance\!dimenE \dp\!boxA \divide\!dimenE 2
- \vbox to #1{\offinterlineskip
- \vskip .05556\!dimenE
- \hbox to \wd\!boxB{\hss$\mkern.4mu\uparrow$\hss}\vskip-\!dimenE
- \cleaders\copy\!boxA\vfil
- \vskip-\!dimenE\copy\!boxA
- \vskip\!dimenE\copy\!boxB\vskip.4em
- \copy\!boxA\vskip-\!dimenE
- \cleaders\copy\!boxA\vfil
- \vskip-\!dimenE \hbox to \wd\!boxB{\hss$\mkern.4mu\downarrow$\hss}
- \vskip .05556\!dimenE}}}
-
-
-% ***************************
-% *** BARS (Draws bars) ***
-% ***************************
-%
-% ** User commands:
-% ** \putbar [<XSHIFT,YSHIFT>] breadth <BREADTH> from XSTART YSTART
-% ** to XEND YEND
-% ** \setbars [<XSHIFT,YSHIFT>] breadth <BREADTH> baseline at XY = COORD
-% ** [baselabels ([B_ORIENTATION_x,B_ORIENTATION_y] <B_XSHIFT,B_YSHIFT>)]
-% ** [endlabels ([E_ORIENTATION_x,E_ORIENTATION_y] <E_XSHIFT,E_YSHIFT>)]
-
-
-% ** \putbar [<XSHIFT,YSHIFT>] breadth <BREADTH> from XSTART YSTART
-% ** to XEND YEND
-% ** Either XSTART=XEND or YSTART=YEND. Draws a rectangle between
-% ** (XSTART,YSTART) & (XEND,YEND). The "depth" of the rectangle
-% ** is determined by those two plot positions; its other
-% ** dimension "breadth" is specified by the dimension BREADTH.
-% ** See Subsection 4.2 of the manual.
-\def\putbar#1breadth <#2> from #3 #4 to #5 #6 {%
- \!xloc=\!M{#3}\!xunit \!xxloc=\!M{#5}\!xunit%
- \!yloc=\!M{#4}\!yunit \!yyloc=\!M{#6}\!yunit%
- \!dypos=\!yyloc \advance\!dypos by -\!yloc
- \!dimenI=#2
-%
- \ifdim \!dimenI=\!zpt % ** If 0 breadth
- \putrule#1from {#3} {#4} to {#5} {#6} % ** Then draw line
- \else % ** Else, put in a rectangle
- \let\!MBar=\!M% ** save current c/d mode
- \!setdimenmode % ** go into dimension mode
- \divide\!dimenI 2
- \ifdim \!dypos=\!zpt
- \advance \!yloc -\!dimenI % ** Equal y coordinates
- \advance \!yyloc \!dimenI
- \else
- \advance \!xloc -\!dimenI % ** Equal x coordinates
- \advance \!xxloc \!dimenI
- \fi
- \putrectangle#1corners at {\!xloc} {\!yloc} and {\!xxloc} {\!yyloc}
- \let\!M=\!MBar % ** restore c/d mode
- \fi
- \ignorespaces}
-
-
-% ** \setbars [<XSHIFT,YSHIFT>] breadth <BREADTH> baseline at XY = COORD
-% ** [baselabels ([B_ORIENTATION_x,B_ORIENTATION_y] <B_XSHIFT,B_YSHIFT>)]
-% ** [endlabels ([E_ORIENTATION_x,E_ORIENTATION_y] <E_XSHIFT,E_YSHIFT>)]
-% ** This command puts PiCTeX into the bar graph drawing mode described
-% ** in Subsection 4.4 of the manual.
-\def\setbars#1breadth <#2> baseline at #3 = #4 {%
- \edef\!barshift{#1}%
- \edef\!barbreadth{#2}%
- \edef\!barorientation{#3}%
- \edef\!barbaseline{#4}%
- \def\!bardobaselabel{\!bardoendlabel}%
- \def\!bardoendlabel{\!barfinish}%
- \let\!drawcurve=\!barcurve
- \!setbars}
-\def\!setbars{%
- \futurelet\!nextchar\!!setbars}
-\def\!!setbars{%
- \if b\!nextchar
- \def\!!!setbars{\!setbarsbget}%
- \else
- \if e\!nextchar
- \def\!!!setbars{\!setbarseget}%
- \else
- \def\!!!setbars{\relax}%
- \fi
- \fi
- \!!!setbars}
-\def\!setbarsbget baselabels (#1) {%
- \def\!barbaselabelorientation{#1}%
- \def\!bardobaselabel{\!!bardobaselabel}%
- \!setbars}
-\def\!setbarseget endlabels (#1) {%
- \edef\!barendlabelorientation{#1}%
- \def\!bardoendlabel{\!!bardoendlabel}%
- \!setbars}
-
-% ** \!barcurve
-% ** Draws a bargraph with preset values of barshift, barbreadth,
-% ** barorientation (x or y) and barbaseline (coordinate)
-\def\!barcurve #1 #2 {%
- \if y\!barorientation
- \def\!basexarg{#1}%
- \def\!baseyarg{\!barbaseline}%
- \else
- \def\!basexarg{\!barbaseline}%
- \def\!baseyarg{#2}%
- \fi
- \expandafter\putbar\!barshift breadth <\!barbreadth> from {\!basexarg}
- {\!baseyarg} to {#1} {#2}
- \def\!endxarg{#1}%
- \def\!endyarg{#2}%
- \!bardobaselabel}
-
-\def\!!bardobaselabel "#1" {%
- \put {#1}\!barbaselabelorientation{} at {\!basexarg} {\!baseyarg}
- \!bardoendlabel}
-
-\def\!!bardoendlabel "#1" {%
- \put {#1}\!barendlabelorientation{} at {\!endxarg} {\!endyarg}
- \!barfinish}
-
-\def\!barfinish{%
- \!ifnextchar/{\!finish}{\!barcurve}}
-
-
-% ********************************
-% *** BOXES (Draws rectangles) ***
-% ********************************
-%
-% ** User commands:
-% ** \putrectangle [<XSHIFT,YSHIFT>] corners at XCOORD1 YCOORD1
-% ** and XCOORD2 YCOORD2
-% ** \shaderectangleson
-% ** \shaderectanglesoff
-% ** \frame [<SEPARATION>] {TEXT}
-% ** \rectangle <WIDTH> <HEIGHT>
-%
-%
-% ** \putrectangle [<XSHIFT,YSHIFT>] corners at XCOORD1 YCOORD1
-% ** and XCOORD2 YCOORD2
-% ** Draws a rectangle with corners at (X1,Y1), (X2,Y1), (X1,Y2), (X2,Y2)
-% ** Lines have thickness \linethickness, and overlap at the corners.
-% ** The optional field <XSHIFT,YSHIFT> functions as with a \put command.
-% ** See Subsection 4.2 of the manual.
-\def\putrectangle{%
- \!ifnextchar<{\!putrectangle}{\!putrectangle<\!zpt,\!zpt> }}
-\def\!putrectangle<#1,#2> corners at #3 #4 and #5 #6 {%
-%
-% ** get locations
- \!xone=\!M{#3}\!xunit \!xtwo=\!M{#5}\!xunit%
- \!yone=\!M{#4}\!yunit \!ytwo=\!M{#6}\!yunit%
- \ifdim \!xtwo<\!xone
- \!dimenI=\!xone \!xone=\!xtwo \!xtwo=\!dimenI
- \fi
- \ifdim \!ytwo<\!yone
- \!dimenI=\!yone \!yone=\!ytwo \!ytwo=\!dimenI
- \fi
- \!dimenI=#1\relax \advance\!xone\!dimenI \advance\!xtwo\!dimenI
- \!dimenI=#2\relax \advance\!yone\!dimenI \advance\!ytwo\!dimenI
- \let\!MRect=\!M% ** save current coord/dimen mode
- \!setdimenmode
-%
-% ** shade rectangle if appropriate
- \!shaderectangle
-%
-% ** draw horizontal edges
- \!dimenI=.5\linethickness
- \advance \!xone -\!dimenI% ** adjust x-location to overlap corners
- \advance \!xtwo \!dimenI% ** ditto
- \putrule from {\!xone} {\!yone} to {\!xtwo} {\!yone}
- \putrule from {\!xone} {\!ytwo} to {\!xtwo} {\!ytwo}
-%
-% ** draw vertical edges
- \advance \!xone \!dimenI% ** restore original x-values
- \advance \!xtwo -\!dimenI%
- \advance \!yone -\!dimenI% ** adjust y-location to overlap corners
- \advance \!ytwo \!dimenI% ** ditto
- \putrule from {\!xone} {\!yone} to {\!xone} {\!ytwo}
- \putrule from {\!xtwo} {\!yone} to {\!xtwo} {\!ytwo}
-%
- \let\!M=\!MRect% ** restore coord/dimen mode
- \ignorespaces}
-
-% ** \shaderectangleson
-% ** Subsequent rectangles will be shaded according to
-% ** the current shading pattern. Affects \putrectangle, \putbar,
-% ** \frame, \sethistograms, and \setbars. See Subsection 7.5 of the manual.
-\def\shaderectangleson{%
- \def\!shaderectangle{\!!shaderectangle}%
- \ignorespaces}
-% ** \shaderectanglesoff
-% ** Suppresses \shaderectangleson. The default.
-\def\shaderectanglesoff{%
- \def\!shaderectangle{}%
- \ignorespaces}
-
-\shaderectanglesoff
-
-% ** The following internal routine shades the current rectangle, when
-% ** \!shaderectangle = \!!shaderectangle .
-\def\!!shaderectangle{%
- \!dimenA=\!xtwo \advance \!dimenA -\!xone
- \!dimenB=\!ytwo \advance \!dimenB -\!yone
- \ifdim \!dimenA<\!dimenB
- \!startvshade (\!xone,\!yone,\!ytwo)
- \!lshade (\!xtwo,\!yone,\!ytwo)
- \else
- \!starthshade (\!yone,\!xone,\!xtwo)
- \!lshade (\!ytwo,\!xone,\!xtwo)
- \fi
- \ignorespaces}
-
-% ** \frame [<SEPARATION>] {TEXT}
-% ** Draws a frame of thickness linethickness about the box enclosing
-% ** TEXT; the frame is separated from the box by a distance of
-% ** SEPARATION. The result is an hbox with the same baseline as TEXT.
-% ** If <SEPARATION> is omitted, you get the effect of <0pt>.
-% ** See Subsection 4.2 of the manual.
-\def\frame{%
- \!ifnextchar<{\!frame}{\!frame<\!zpt> }}
-\long\def\!frame<#1> #2{%
- \beginpicture
- \setcoordinatesystem units <1pt,1pt> point at 0 0
- \put {#2} [Bl] at 0 0
- \!dimenA=#1\relax
- \!dimenB=\!wd \advance \!dimenB \!dimenA
- \!dimenC=\!ht \advance \!dimenC \!dimenA
- \!dimenD=\!dp \advance \!dimenD \!dimenA
- \let\!MFr=\!M
- \!setdimenmode
- \putrectangle corners at {-\!dimenA} {-\!dimenD} and {\!dimenB} {\!dimenC}
- \!setcoordmode
- \let\!M=\!MFr
- \endpicture
- \ignorespaces}
-
-% ** \rectangle <WIDTH> <HEIGHT>
-% ** Constructs a rectangle of width WIDTH and heigth HEIGHT.
-% ** See Subsection 4.2 of the manual.
-\def\rectangle <#1> <#2> {%
- \setbox0=\hbox{}\wd0=#1\ht0=#2\frame {\box0}}
-
-
-% *********************************************
-% *** CURVES (Upper level \plot commands) ***
-% *********************************************
-%
-% ** User commands
-% ** \plot DATA /
-% ** \plot "FILE NAME"
-% ** \setquadratic
-% ** \setlinear
-% ** \sethistograms
-% ** \vshade ...
-% ** \hshade ...
-
-% \plot: multi-purpose command. Draws histograms, bar graphs, piecewise-linear
-% or piecewise quadratic curves, depending on the setting of \!drawcurve.
-% See Subsections 4.3-4.5, 5.1, 5.2 of the manual.
-\def\plot{%
- \!ifnextchar"{\!plotfromfile}{\!drawcurve}}
-\def\!plotfromfile"#1"{%
- \expandafter\!drawcurve \normalinput #1 /}
-
-% Command to set piecewise quadratic mode
-% See Subsections 5.1, 7.3, and 7.4 of the manual.
-\def\setquadratic{%
- \let\!drawcurve=\!qcurve
- \let\!!Shade=\!!qShade
- \let\!!!Shade=\!!!qShade}
-
-% Command to set piecewise linear mode
-% See Subsections 5.1, 7.3, and 7.4 of the manual.
-\def\setlinear{%
- \let\!drawcurve=\!lcurve
- \let\!!Shade=\!!lShade
- \let\!!!Shade=\!!!lShade}
-
-% Command to set histogram mode
-% See Subsection 4.3 of the manual.
-\def\sethistograms{%
- \let\!drawcurve=\!hcurve}
-
-% Commands to cycle through list of coordinates in piecewise quadratic
-% interpolation mode
-\def\!qcurve #1 #2 {%
- \!start (#1,#2)
- \!Qjoin}
-\def\!Qjoin#1 #2 #3 #4 {%
- \!qjoin (#1,#2) (#3,#4) % \!qjoin is defined in QUADRATIC
- \!ifnextchar/{\!finish}{\!Qjoin}}
-
-% Commands to cycle through list of coordinates in piecewise linear
-% interpolation mode
-\def\!lcurve #1 #2 {%
- \!start (#1,#2)
- \!Ljoin}
-\def\!Ljoin#1 #2 {%
- \!ljoin (#1,#2) % \!ljoin is defined in LINEAR
- \!ifnextchar/{\!finish}{\!Ljoin}}
-
-\def\!finish/{\ignorespaces}
-
-% Command to cycle through list of coordinates in histogram mode
-\def\!hcurve #1 #2 {%
- \edef\!hxS{#1}%
- \edef\!hyS{#2}%
- \!hjoin}
-\def\!hjoin#1 #2 {%
- \putrectangle corners at {\!hxS} {\!hyS} and {#1} {#2}
- \edef\!hxS{#1}%
- \!ifnextchar/{\!finish}{\!hjoin}}
-
-
-% \vshade: See Subsection 7.3 of the manual.
-\def\vshade #1 #2 #3 {%
- \!startvshade (#1,#2,#3)
- \!Shadewhat}
-
-% \hshade: See Subsection 7.4 of the manual.
-\def\hshade #1 #2 #3 {%
- \!starthshade (#1,#2,#3)
- \!Shadewhat}
-
-% Commands to cycle through coordinates and optional "edge effect"
-% fields while shading.
-\def\!Shadewhat{%
- \futurelet\!nextchar\!Shade}
-\def\!Shade{%
- \if <\!nextchar
- \def\!nextShade{\!!Shade}%
- \else
- \if /\!nextchar
- \def\!nextShade{\!finish}%
- \else
- \def\!nextShade{\!!!Shade}%
- \fi
- \fi
- \!nextShade}
-\def\!!lShade<#1> #2 #3 #4 {%
- \!lshade <#1> (#2,#3,#4) % \!lshade is defined in SHADING
- \!Shadewhat}
-\def\!!!lShade#1 #2 #3 {%
- \!lshade (#1,#2,#3)
- \!Shadewhat}
-\def\!!qShade<#1> #2 #3 #4 #5 #6 #7 {%
- \!qshade <#1> (#2,#3,#4) (#5,#6,#7) % \!qshade is defined in SHADING
- \!Shadewhat}
-\def\!!!qShade#1 #2 #3 #4 #5 #6 {%
- \!qshade (#1,#2,#3) (#4,#5,#6)
- \!Shadewhat}
-
-% ** Set default interpolation mode
-\setlinear
-
-
-% ********************************************
-% *** DASHPATTERNS (Sets up dash patterns) ***
-% ********************************************
-
-% ** User commands:
-% ** \setdashpattern <DIMEN1,DIMEN2,DIMEN3,...>
-% ** \setdots <INTRADOT_DISTANCE>
-% ** \setdotsnear <INTRADOT_DISTANCE> for <ARC LENGTH>
-% ** \setdashes <DASH/SKIP_DISTANCE>
-% ** \setdashesnear <DASH/SKIP_DISTANCE> for <ARC LENGTH>
-% ** \setsolid
-% ** \findlength {CURVE CMDS}
-
-% ** Internal commands:
-% ** \!dashingon
-% ** \!dashingoff
-
-% ** Dash patterns are specified by a balanced token list whose complete
-% ** expansion has the form: DIMEN1,DIMEN2,DIMEN3,DIMEN4,... ; this produces
-% ** an arc of length DIMEN1, a skip of length DIMEN2, an arc of length
-% ** DIMEN3, a skip of length DIMEN4, ... . Any number of DIMEN values may
-% ** be given. The pattern is repeated as many times (perhaps fractional)
-% ** as necessary to draw the curve.
-% ** A dash pattern remains in effect until it is overridden by a call to
-% ** \setdashpattern, or to \setdots, \setdotsnear ... , \setdashes,
-% ** \setdashesnear ... , or \setsolid.
-% ** Solid lines are the default.
-
-
-% ** \def\setdashpattern <DIMEN1,DIMEN2,DIMEN3,...>
-% ** The following routine converts a balanced list of tokens whose
-% ** complete expansion has the form DIMEN1,DIMEN2, ... , DIMENk into
-% ** three list macros that are used in drawing dashed rules and curves:
-% ** !Flist: \!Rule{DIMEN1}\!Skip{DIMEN2}\!Rule{DIMEN3}\!Skip{DIMEN4} ...
-% ** !Blist: ...\!Skip{DIMEN4}\!Rule{DIMEN3}\!Skip{DIMEN2}\!Rule{DIMEN1}
-% ** !UDlist: \\{DIMEN1}\\{DIMEN2}\\{DIMEN3}\\{DIMEN4} ...;
-% ** calculates \!leaderlength := DIMEN1 + ... + DIMENk; and
-% ** sets the curve drawing routines to dash mode.
-% ** Those lists are used by the curve drawing routines.
-% ** Dimenj ... may be given as an explicit dimension (e.g., 5pt), or
-% ** as an expression involving a dimension register (e.g., -2.5\dimen0).
-% ** See Subsection 6.2 of the manual
-\def\setdashpattern <#1>{%
- \def\!Flist{}\def\!Blist{}\def\!UDlist{}%
- \!countA=0
- \!ecfor\!item:=#1\do{%
- \!dimenA=\!item\relax
- \expandafter\!rightappend\the\!dimenA\withCS{\\}\to\!UDlist%
- \advance\!countA 1
- \ifodd\!countA
- \expandafter\!rightappend\the\!dimenA\withCS{\!Rule}\to\!Flist%
- \expandafter\!leftappend\the\!dimenA\withCS{\!Rule}\to\!Blist%
- \else
- \expandafter\!rightappend\the\!dimenA\withCS{\!Skip}\to\!Flist%
- \expandafter\!leftappend\the\!dimenA\withCS{\!Skip}\to\!Blist%
- \fi}%
- \!leaderlength=\!zpt
- \def\!Rule##1{\advance\!leaderlength ##1}%
- \def\!Skip##1{\advance\!leaderlength ##1}%
- \!Flist%
- \ifdim\!leaderlength>\!zpt
- \else
- \def\!Flist{\!Skip{24in}}\def\!Blist{\!Skip{24in}}\ignorespaces
- \def\!UDlist{\\{\!zpt}\\{24in}}\ignorespaces
- \!leaderlength=24in
- \fi
- \!dashingon}
-
-
-% ** \!dashingon -- puts the curve drawing routines into dash mode
-% ** \!dashingoff -- puts the curve drawing routines into solid mode
-% ** These are internal commands, invoked by \setdashpattern and \setsolid
-\def\!dashingon{%
- \def\!advancedashing{\!!advancedashing}%
- \def\!drawlinearsegment{\!lineardashed}%
- \def\!puthline{\!putdashedhline}%
- \def\!putvline{\!putdashedvline}%
-% \def\!putsline{\!putdashedsline}%
- \ignorespaces}%
-\def\!dashingoff{%
- \def\!advancedashing{\relax}%
- \def\!drawlinearsegment{\!linearsolid}%
- \def\!puthline{\!putsolidhline}%
- \def\!putvline{\!putsolidvline}%
-% \def\!putsline{\!putsolidsline}%
- \ignorespaces}
-
-
-% ** \setdots <LENGTH> -- sets up a dot/skip pattern where dot (actually
-% ** the current plotsymbol) is plunked down once for every LENGTH
-% ** traveled along the curve. LENGTH defaults to 5pt.
-% ** See Subsection 6.1 of the manual.
-\def\setdots{%
- \!ifnextchar<{\!setdots}{\!setdots<5pt>}}
-\def\!setdots<#1>{%
- \!dimenB=#1\advance\!dimenB -\plotsymbolspacing
- \ifdim\!dimenB<\!zpt
- \!dimenB=\!zpt
- \fi
-\setdashpattern <\plotsymbolspacing,\!dimenB>}
-
-% ** \setdotsnear <LENGTH> for <ARC LENGTH>
-% ** sets up a dot pattern where the dots are approximately LENGTH apart,
-% ** the total length of the pattern is ARC LENGTH, and the pattern
-% ** begins and ends with a dot. See Subsection 6.3 of the manual.
-\def\setdotsnear <#1> for <#2>{%
- \!dimenB=#2\relax \advance\!dimenB -.05pt
- \!dimenC=#1\relax \!countA=\!dimenC
- \!dimenD=\!dimenB \advance\!dimenD .5\!dimenC \!countB=\!dimenD
- \divide \!countB \!countA
- \ifnum 1>\!countB
- \!countB=1
- \fi
- \divide\!dimenB \!countB
- \setdots <\!dimenB>}
-
-% ** \setdashes <LENGTH> -- sets up a dash/skip pattern where the dash
-% ** and the skip are each of length LENGTH (the dash is formed by
-% ** plunking down the current plotsymbol over an arc of length LENGTH
-% ** and so may actually be longer than LENGTH. LENGTH defaults to 5pt.
-% ** See Subsection 6.1 of the manual.
-\def\setdashes{%
- \!ifnextchar<{\!setdashes}{\!setdashes<5pt>}}
-\def\!setdashes<#1>{\setdashpattern <#1,#1>}
-
-% ** \setdashesnear ...
-% ** Like \setdotsnear; the pattern begins and ends with a dash.
-% ** See Subsection 6.3 of the manual.
-\def\setdashesnear <#1> for <#2>{%
- \!dimenB=#2\relax
- \!dimenC=#1\relax \!countA=\!dimenC
- \!dimenD=\!dimenB \advance\!dimenD .5\!dimenC \!countB=\!dimenD
- \divide \!countB \!countA
- \ifodd \!countB
- \else
- \advance \!countB 1
- \fi
- \divide\!dimenB \!countB
- \setdashes <\!dimenB>}
-
-% ** \setsolid -- puts the curve drawing routines in "solid line" mode,
-% ** the default mode. See Subsection 6.1 of the manual.
-\def\setsolid{%
- \def\!Flist{\!Rule{24in}}\def\!Blist{\!Rule{24in}}%
- \def\!UDlist{\\{24in}\\{\!zpt}}%
- \!dashingoff}
-\setsolid
-
-% ** \findlength {CURVE CMDS}
-% ** PiCTeX executes the \start, \ljoin, and \qjoin cmds comprising
-% ** CURVE CMDS without plotting anything, but stashes the length
-% ** of the phantom curve away in \totalarclength.
-% ** See Subsection 6.3 of the manual.
-\def\findlength#1{%
- \begingroup
- \setdashpattern <0pt, \maxdimen>
- \setplotsymbol ({})
- \dontsavelinesandcurves
- #1%
- \endgroup
- \ignorespaces}
-
-
-% *************************************************************
-% *** DIVISION (Does long division of dimension registers) ***
-% *************************************************************
-
-% ** User command:
-% ** \Divide {DIVIDEND} by {DIVISOR} forming {RESULT}
-
-% ** Internal command
-% ** \!divide{DIVIDEND}{DIVISOR}{RESULT}
-
-% ** \!divide DIVIDEND [by] DIVISOR [to get] ANSWER
-% ** Divides the dimension DIVIDEND by the dimension DIVISOR, placing the
-% ** quotient in the dimension register ANSWER. Values are understood to
-% ** be in points. E.g. 12.5pt/1.4pt=8.92857pt.
-% ** Quotient is accurate to 1/65536pt=2**[-16]pt
-% ** |DIVISOR| should be < 2048pt (about 28 inches).
-\def\!divide#1#2#3{%
- \!dimenB=#1% ** dimB holds current remainder (r)
- \!dimenC=#2% ** dimC holds divisor (d)
- \!dimenD=\!dimenB% ** dimD holds quotient q=r/d for this
- \divide \!dimenD \!dimenC% ** step, in units of scaled pts
- \!dimenA=\!dimenD% ** dimA eventually holds answer (a)
- \multiply\!dimenD \!dimenC% ** r <-- r - dq
- \advance\!dimenB -\!dimenD% ** First step complete. Have integer part
-% ** of a, and corresponding remainder.
- \!dimenD=\!dimenC% ** Temporarily use dimD to hold |d|
- \ifdim\!dimenD<\!zpt \!dimenD=-\!dimenD
- \fi
- \ifdim\!dimenD<64pt% ** Branch on the magnitude of |d|
- \!divstep[\!tfs]\!divstep[\!tfs]%
- \else
- \!!divide
- \fi
- #3=\!dimenA\ignorespaces}
-
-% ** The following code handles divisors d with
-% ** (1) .88in = 64pt <= d < 256pt = 3.54in
-% ** (2) 3.54in = 256pt <= d < 2048pt = 28.34in
-% ** Anything bigger than that may result in an overflow condition.
-% ** For our purposes, we should never even see case (2).
-\def\!!divide{%
- \ifdim\!dimenD<256pt
- \!divstep[64]\!divstep[32]\!divstep[32]%
- \else
- \!divstep[8]\!divstep[8]\!divstep[8]\!divstep[8]\!divstep[8]%
- \!dimenA=2\!dimenA
- \fi}
-
-
-% ** The following macro does the real long division work.
-\def\!divstep[#1]{% ** #1 = "B"
- \!dimenB=#1\!dimenB% ** r <-- B*r
- \!dimenD=\!dimenB% ** dimD holds quotient q=r/d for this
- \divide \!dimenD by \!dimenC% ** step, in units of scaled pts
- \!dimenA=#1\!dimenA% ** a <-- B*a + q
- \advance\!dimenA by \!dimenD%
- \multiply\!dimenD by \!dimenC% ** r <-- r - dq
- \advance\!dimenB by -\!dimenD}
-
-% ** \Divide: See Subsection 9.3 of the manual.
-\def\Divide <#1> by <#2> forming <#3> {%
- \!divide{#1}{#2}{#3}}
-
-
-% *********************************************
-% *** ELLIPSES (Draws ellipses and circles) ***
-% *********************************************
-
-% ** User commands
-% ** \ellipticalarc axes ratio A:B DEGREES degrees from XSTART YSTART
-% ** center at XCENTER YCENTER
-% ** \circulararc DEGREES degrees from XSTART YSTART
-% ** center at XCENTER YCENTER
-
-% ** Internal command
-% ** \!sinandcos{32*ANGLE in radians}{32*SIN}{32*COS}
-
-
-% ** \ellipticalarc axes ratio A:B DEGREES degrees from XSTART YSTART
-% ** center at XCENTER YCENTER
-% ** Draws a elliptical arc starting at the coordinate point (XSTART,YSTART).
-% ** The center of the ellipse of which the arc is a segment is at
-% ** (XCENTER,YCENTER).
-% ** The arc extends through an angle of DEGREES degrees (may be + or -).
-% ** A:B is the ratio of the length of the xaxis to the length of
-% ** the yaxis of the ellipse
-% ** Sqrt{[(XSTART-XCENTER)/A]**2 + [(YSTART-YCENTER)/B]**2}
-% ** must be < 512pt (about 7in).
-% ** Doesn't modify the dimensions (ht, dp, wd) of the PiCture under
-% ** construction.
-
-% ** \circulararc -- See Subsection 5.3 of the manual.
-\def\circulararc{%
- \ellipticalarc axes ratio 1:1 }
-
-% ** \ellipticalarc -- See Subsection 5.3 of the manual.
-\def\ellipticalarc axes ratio #1:#2 #3 degrees from #4 #5 center at #6 #7 {%
- \!angle=#3pt\relax% ** get angle
- \ifdim\!angle>\!zpt
- \def\!sign{}% ** counterclockwise
- \else
- \def\!sign{-}\!angle=-\!angle% ** clockwise
- \fi
- \!xxloc=\!M{#6}\!xunit% ** convert CENTER to dimension
- \!yyloc=\!M{#7}\!yunit
- \!xxS=\!M{#4}\!xunit% ** get STARTing point on rim of ellipse
- \!yyS=\!M{#5}\!yunit
- \advance\!xxS -\!xxloc% ** make center of ellipse (0,0)
- \advance\!yyS -\!yyloc
- \!divide\!xxS{#1pt}\!xxS % ** scale point on ellipse to point on
- \!divide\!yyS{#2pt}\!yyS % corresponding circle
-%
- \let\!MC=\!M% ** save current c/d mode
- \!setdimenmode% ** go into dimension mode
-%
- \!xS=#1\!xxS \advance\!xS\!xxloc
- \!yS=#2\!yyS \advance\!yS\!yyloc
- \!start (\!xS,\!yS)%
- \!loop\ifdim\!angle>14.9999pt% ** draw in major portion of ellipse
- \!rotate(\!xxS,\!yyS)by(\!cos,\!sign\!sin)to(\!xxM,\!yyM)
- \!rotate(\!xxM,\!yyM)by(\!cos,\!sign\!sin)to(\!xxE,\!yyE)
- \!xM=#1\!xxM \advance\!xM\!xxloc \!yM=#2\!yyM \advance\!yM\!yyloc
- \!xE=#1\!xxE \advance\!xE\!xxloc \!yE=#2\!yyE \advance\!yE\!yyloc
- \!qjoin (\!xM,\!yM) (\!xE,\!yE)
- \!xxS=\!xxE \!yyS=\!yyE
- \advance \!angle -15pt
- \repeat
- \ifdim\!angle>\!zpt% ** complete remaining arc, if any
- \!angle=100.53096\!angle% ** convert angle to radians, divide
- \divide \!angle 360 % ** by 2, and multiply by 32
- \!sinandcos\!angle\!!sin\!!cos% ** get 32*sin & 32*cos
- \!rotate(\!xxS,\!yyS)by(\!!cos,\!sign\!!sin)to(\!xxM,\!yyM)
- \!rotate(\!xxM,\!yyM)by(\!!cos,\!sign\!!sin)to(\!xxE,\!yyE)
- \!xM=#1\!xxM \advance\!xM\!xxloc \!yM=#2\!yyM \advance\!yM\!yyloc
- \!xE=#1\!xxE \advance\!xE\!xxloc \!yE=#2\!yyE \advance\!yE\!yyloc
- \!qjoin (\!xM,\!yM) (\!xE,\!yE)
- \fi
-%
- \let\!M=\!MC% ** restore c/d mode
- \ignorespaces}% ** if appropriate
-
-
-% ** \!rotate(XREG,YREG)by(32cos,32sin)to(XXREG,YYREG)
-% ** rotates (XREG,YREG) by angle with specfied scaled cos & sin to
-% ** (XXREG,YYREG). Uses \!dimenA & \!dimenB as scratch registers.
-\def\!rotate(#1,#2)by(#3,#4)to(#5,#6){%
- \!dimenA=#3#1\advance \!dimenA -#4#2% ** Rcos(x+t)=Rcosx*cost - Rsinx*sint
- \!dimenB=#3#2\advance \!dimenB #4#1% ** Rsin(x+t)=Rsinx*cost + Rcosx*sint
- \divide \!dimenA 32 \divide \!dimenB 32
- #5=\!dimenA #6=\!dimenB
- \ignorespaces}
-\def\!sin{4.17684}% ** 32*sin(pi/24) (pi/24=7.5deg)
-\def\!cos{31.72624}% ** 32*cos(pi/24)
-
-
-% ** \!sinandcos{32*ANGLE in radians}{\SINCS}{\COSCS}
-% ** Computes the 32*sine and 32*cosine of a small ANGLE expressed in
-% ** radians/32 and puts these values in the replacement texts of
-% ** \SINCS and \COSCS
-\def\!sinandcos#1#2#3{%
- \!dimenD=#1% ** angle is expressed in radians/32: 1pt = 1/32rad
- \!dimenA=\!dimenD% ** dimA will eventually contain 32sin(angle)in pts
- \!dimenB=32pt% ** dimB will eventually contain 32cos(angle)in pts
- \!removept\!dimenD\!value% ** get value of 32*angle, without "pt"
- \!dimenC=\!dimenD% ** holds 32*angle**i/i! in pts
- \!dimenC=\!value\!dimenC \divide\!dimenC by 64 % ** now 32*angle**2/2
- \advance\!dimenB by -\!dimenC% ** 32-32*angle**2/2
- \!dimenC=\!value\!dimenC \divide\!dimenC by 96 % ** now 32*angle**3/3!
- \advance\!dimenA by -\!dimenC% ** now 32*(angle-angle**3/6)
- \!dimenC=\!value\!dimenC \divide\!dimenC by 128 % ** now 32*angle**4/4!
- \advance\!dimenB by \!dimenC%
- \!removept\!dimenA#2% ** set 32*sin(angle)
- \!removept\!dimenB#3% ** set 32*cos(angle)
- \ignorespaces}
-
-
-% *****************************************************************
-% *** RULES (Draws rules, i.e., horizontal & vertical lines) ***
-% *****************************************************************
-
-% ** User command:
-% ** \putrule [<XDIMEN,YDIMEN>] from XCOORD1 YCOORD1
-% ** to XCOORD2 YCOORD2
-
-% ** Internal commands:
-% ** \!puthline [<XDIMEN,YDIMEN>] (h = horizontal)
-% ** Set by dashpat to either: \!putsolidhline or \!putdashedhline
-% ** \!putvline [<XDIMEN,YDIMEN>] (v = vertical)
-% ** Either: \!putsolidvline or \!putdashedvline
-
-
-% ** \putrule [<XDIMEN,YDIMEN>] from XCOORD1 YCOORD1
-% ** to XCOORD2 YCOORD2
-% ** Draws a rule -- dashed or solid depending on the current dash pattern --
-% ** from (X1,Y1) to (X2,Y2). Uses TEK's \hrule & \vrule & \leaders
-% ** constructions to handle horizontal & vertical lines efficiently both
-% ** in terms of execution time and space in the DVI file.
-% ** See Subsection 4.1 of the manual.
-\def\putrule#1from #2 #3 to #4 #5 {%
- \!xloc=\!M{#2}\!xunit \!xxloc=\!M{#4}\!xunit%
- \!yloc=\!M{#3}\!yunit \!yyloc=\!M{#5}\!yunit%
- \!dxpos=\!xxloc \advance\!dxpos by -\!xloc
- \!dypos=\!yyloc \advance\!dypos by -\!yloc
-%
- \ifdim\!dypos=\!zpt
- \def\!!Line{\!puthline{#1}}\ignorespaces
- \else
- \ifdim\!dxpos=\!zpt
- \def\!!Line{\!putvline{#1}}\ignorespaces
- \else
- \def\!!Line{}
- \fi
- \fi
- \let\!ML=\!M% ** save current coord\dimen mode
- \!setdimenmode% ** express locations in dimens
- \!!Line%
- \let\!M=\!ML% ** restore previous c/d mode
- \ignorespaces}
-
-
-% ** \!putsolidhline [<XDIMEN,YDIMEN>]
-% ** Place horizontal solid line
-\def\!putsolidhline#1{%
- \ifdim\!dxpos>\!zpt
- \put{\!hline\!dxpos}#1[l] at {\!xloc} {\!yloc}
- \else
- \put{\!hline{-\!dxpos}}#1[l] at {\!xxloc} {\!yyloc}
- \fi
- \ignorespaces}
-
-% ** \!putsolidvline [shifted <XDIMEN,YDIMEN>]
-% ** Place vertical solid line
-\def\!putsolidvline#1{%
- \ifdim\!dypos>\!zpt
- \put{\!vline\!dypos}#1[b] at {\!xloc} {\!yloc}
- \else
- \put{\!vline{-\!dypos}}#1[b] at {\!xxloc} {\!yyloc}
- \fi
- \ignorespaces}
-
-\def\!hline#1{\hbox to #1{\leaders \hrule height\linethickness\hfill}}
-\def\!vline#1{\vbox to #1{\leaders \vrule width\linethickness\vfill}}
-
-
-% ** \!putdashedhline [<XDIMEN,YDIMEN>]
-% ** Place dashed horizontal line
-\def\!putdashedhline#1{%
- \ifdim\!dxpos>\!zpt
- \!DLsetup\!Flist\!dxpos
- \put{\hbox to \!totalleaderlength{\!hleaders}\!hpartialpattern\!Rtrunc}
- #1[l] at {\!xloc} {\!yloc}
- \else
- \!DLsetup\!Blist{-\!dxpos}
- \put{\!hpartialpattern\!Ltrunc\hbox to \!totalleaderlength{\!hleaders}}
- #1[r] at {\!xloc} {\!yloc}
- \fi
- \ignorespaces}
-
-% ** \!putdashedhline [<XDIMEN,YDIMEN>]
-% ** Place dashed vertical line
-\def\!putdashedvline#1{%
- \!dypos=-\!dypos% ** vertical leaders go from top to bottom
- \ifdim\!dypos>\!zpt
- \!DLsetup\!Flist\!dypos
- \put{\vbox{\vbox to \!totalleaderlength{\!vleaders}
- \!vpartialpattern\!Rtrunc}}#1[t] at {\!xloc} {\!yloc}
- \else
- \!DLsetup\!Blist{-\!dypos}
- \put{\vbox{\!vpartialpattern\!Ltrunc
- \vbox to \!totalleaderlength{\!vleaders}}}#1[b] at {\!xloc} {\!yloc}
- \fi
- \ignorespaces}
-
-
-% ** The rest of the macros in this section are subroutines used by
-% ** \!putdashedhline and \!putdashedvline.
-\def\!DLsetup#1#2{% ** Dashed-Line set up
- \let\!RSlist=#1% ** set !Rule-Skip list
- \!countB=#2% ** convert rule length to integer (number of sps)
- \!countA=\!leaderlength% ** ditto, leaderlength
- \divide\!countB by \!countA% ** number of complete leader units
- \!totalleaderlength=\!countB\!leaderlength
- \!Rresiduallength=#2%
- \advance \!Rresiduallength by -\!totalleaderlength% \** excess length
- \!Lresiduallength=\!leaderlength
- \advance \!Lresiduallength by -\!Rresiduallength
- \ignorespaces}
-
-\def\!hleaders{%
- \def\!Rule##1{\vrule height\linethickness width##1}%
- \def\!Skip##1{\hskip##1}%
- \leaders\hbox{\!RSlist}\hfill}
-
-\def\!hpartialpattern#1{%
- \!dimenA=\!zpt \!dimenB=\!zpt
- \def\!Rule##1{#1{##1}\vrule height\linethickness width\!dimenD}%
- \def\!Skip##1{#1{##1}\hskip\!dimenD}%
- \!RSlist}
-
-\def\!vleaders{%
- \def\!Rule##1{\hrule width\linethickness height##1}%
- \def\!Skip##1{\vskip##1}%
- \leaders\vbox{\!RSlist}\vfill}
-
-\def\!vpartialpattern#1{%
- \!dimenA=\!zpt \!dimenB=\!zpt
- \def\!Rule##1{#1{##1}\hrule width\linethickness height\!dimenD}%
- \def\!Skip##1{#1{##1}\vskip\!dimenD}%
- \!RSlist}
-
-\def\!Rtrunc#1{\!trunc{#1}>\!Rresiduallength}
-\def\!Ltrunc#1{\!trunc{#1}<\!Lresiduallength}
-
-\def\!trunc#1#2#3{%
- \!dimenA=\!dimenB
- \advance\!dimenB by #1%
- \!dimenD=\!dimenB \ifdim\!dimenD#2#3\!dimenD=#3\fi
- \!dimenC=\!dimenA \ifdim\!dimenC#2#3\!dimenC=#3\fi
- \advance \!dimenD by -\!dimenC}
-
-
-% ****************************************************************
-% *** LINEAR ARC (Draws straight lines -- solid and dashed) ***
-% ****************************************************************
-
-% ** User commands
-% ** \inboundscheckoff
-% ** \inboundscheckon
-
-% ** Internal commands
-% ** \!start (XCOORD,YCOORD)
-% ** \!ljoin (XCOORD,YCOORD)
-% ** \!drawlinearsegment -- set by \dashpat to either
-% ** \!linearsolid or \!lineardashed
-% ** \!advancedashing -- set by \dashpat to either
-% ** \relax or \!!advancedashing
-% ** \!plotifinbounds -- set by \inboundscheck off/on to either
-% ** \!plot or \!!plotifinbounds
-% ** \!initinboundscheck -- set by \inboundscheck off/on to either
-% ** \relax or \!!initinboundscheck
-
-
-% \plotsymbolspacing ** distance between consecutive plot positions
-% \!xS ** starting x
-% \!yS ** starting y
-% \!xE ** ending x
-% \!yE ** ending y
-% \!xdiff ** x_end - x_start
-% \!ydiff ** y_end - y_start
-% \!distacross ** how far along curve next point to be plotted is
-% \!arclength ** approximate length of arc for current interval
-% \!downlength ** remaining length for "pen" to be down
-% \!uplength ** length for "pen" to be down
-% \!intervalno ** counts segments to curve
-% \totalarclength ** cumulative distance along curve
-% \!npoints ** approximately (arc length / plotsymbolspacing)
-
-% ** Calls -- \!Pythag, \!divide, \!plot
-
-
-% ** \!start (XCOORD,YCOORD)
-% ** Sets initial point for linearly (or quadratically) interpolated curve
-\def\!start (#1,#2){%
- \!plotxorigin=\!xorigin \advance \!plotxorigin by \!plotsymbolxshift
- \!plotyorigin=\!yorigin \advance \!plotyorigin by \!plotsymbolyshift
- \!xS=\!M{#1}\!xunit \!yS=\!M{#2}\!yunit
- \!rotateaboutpivot\!xS\!yS
- \!copylist\!UDlist\to\!!UDlist% **\!UDlist has the form \\{dimen1}\\{dimen2}..
-% ** Routine will draw dashed line with pen
-% ** down for dimen1, up for dimen2, ...
- \!getnextvalueof\!downlength\from\!!UDlist
- \!distacross=\!zpt% ** 1st point goes at start of curve
- \!intervalno=0 % ** initialize interval counter
- \global\totalarclength=\!zpt% ** initialize distance traveled along curve
- \ignorespaces}
-
-
-% ** \!ljoin (XCOORD,YCOORD)
-% ** Draws a straight line starting at the last point specified
-% ** by the most recent \!start, \!ljoin, or \!qjoin, and
-% ** ending at (XCOORD,YCOORD).
-\def\!ljoin (#1,#2){%
- \advance\!intervalno by 1
- \!xE=\!M{#1}\!xunit \!yE=\!M{#2}\!yunit
- \!rotateaboutpivot\!xE\!yE
- \!xdiff=\!xE \advance \!xdiff by -\!xS%** xdiff = xE - xS
- \!ydiff=\!yE \advance \!ydiff by -\!yS%** ydiff = yE - yS
- \!Pythag\!xdiff\!ydiff\!arclength% ** arclength = sqrt(xdiff**2+ydiff**2)
- \global\advance \totalarclength by \!arclength%
- \!drawlinearsegment% ** set by dashpat to \!linearsolid or \!lineardashed
- \!xS=\!xE \!yS=\!yE% ** shift ending points to starting points
- \ignorespaces}
-
-
-% ** The following routine is used to draw a "solid" line between (xS,yS)
-% ** and (xE,yE). Points are spaced nearly every \plotsymbolspacing length
-% ** along the line.
-\def\!linearsolid{%
- \!npoints=\!arclength
- \!countA=\plotsymbolspacing
- \divide\!npoints by \!countA% ** now #pts =. arclength/plotsymbolspacing
- \ifnum \!npoints<1
- \!npoints=1
- \fi
- \divide\!xdiff by \!npoints
- \divide\!ydiff by \!npoints
- \!xpos=\!xS \!ypos=\!yS
-%
- \loop\ifnum\!npoints>-1
- \!plotifinbounds
- \advance \!xpos by \!xdiff
- \advance \!ypos by \!ydiff
- \advance \!npoints by -1
- \repeat
- \ignorespaces}
-
-
-% ** The following routine is used to draw a dashed line between (xS,yS)
-% ** and (xE,yE). The dash pattern continues from the previous segment.
-\def\!lineardashed{%
-% **
- \ifdim\!distacross>\!arclength
- \advance \!distacross by -\!arclength %nothing to plot in this interval
-%
- \else
-%
- \loop\ifdim\!distacross<\!arclength
-% ** plot point, interpolating linearly in x and y
- \!divide\!distacross\!arclength\!dimenA% ** dimA = across/arclength
- \!removept\!dimenA\!t% ** \!t holds value in dimA, without the "pt"
- \!xpos=\!t\!xdiff \advance \!xpos by \!xS
- \!ypos=\!t\!ydiff \advance \!ypos by \!yS
- \!plotifinbounds
- \advance\!distacross by \plotsymbolspacing
- \!advancedashing
- \repeat
-%
- \advance \!distacross by -\!arclength% ** prepare for next interval
- \fi
- \ignorespaces}
-
-
-\def\!!advancedashing{%
- \advance\!downlength by -\plotsymbolspacing
- \ifdim \!downlength>\!zpt
- \else
- \advance\!distacross by \!downlength
- \!getnextvalueof\!uplength\from\!!UDlist
- \advance\!distacross by \!uplength
- \!getnextvalueof\!downlength\from\!!UDlist
- \fi}
-
-
-% ** \inboundscheckoff & \inboundscheckon: See Subsection 5.5 of the manual.
-\def\inboundscheckoff{%
- \def\!plotifinbounds{\!plot(\!xpos,\!ypos)}%
- \def\!initinboundscheck{\relax}\ignorespaces}
-\def\inboundscheckon{%
- \def\!plotifinbounds{\!!plotifinbounds}%
- \def\!initinboundscheck{\!!initinboundscheck}%
- \!initinboundscheck\ignorespaces}
-\inboundscheckoff
-
-% ** The following code plots the current point only if it falls in the
-% ** current plotarea. It doesn't matter if the coordinate system has
-% ** changed since the plotarea was set up. However, shifts of the plot
-% ** are ignored (how the plotsymbol stands relative to its plot position is
-% ** unknown anyway).
-\def\!!plotifinbounds{%
- \ifdim \!xpos<\!checkleft
- \else
- \ifdim \!xpos>\!checkright
- \else
- \ifdim \!ypos<\!checkbot
- \else
- \ifdim \!ypos>\!checktop
- \else
- \!plot(\!xpos,\!ypos)
- \fi
- \fi
- \fi
- \fi}
-
-
-\def\!!initinboundscheck{%
- \!checkleft=\!arealloc \advance\!checkleft by \!xorigin
- \!checkright=\!arearloc \advance\!checkright by \!xorigin
- \!checkbot=\!areabloc \advance\!checkbot by \!yorigin
- \!checktop=\!areatloc \advance\!checktop by \!yorigin}
-
-
-% *********************************
-% *** LOGTEN (Log_10 function) ***
-% *********************************
-%
-% ** \!logten{X}
-% ** Calculates log_10 of X. X and LOG10(X) are in fixed point notation.
-% ** X must be positive; it may have an optional `+' sign; any number
-% ** of digits may be specified for X. The absolute error in LOG10(X) is
-% ** less than .0001 (probably < .00006). That's about as good as you
-% ** hope for, since TEX only operates to 5 figures after the decimal
-% ** point anyway.
-
-% \!rootten=3.162278pt **** These are values are set in ALLOCATIONS
-% \!tenAe=2.543275pt (=A5)
-% \!tenAc=2.773839pt (=A3)
-% \!tenAa=8.690286pt (=A1)
-
-\def\!logten#1#2{%
- \expandafter\!!logten#1\!nil
- \!removept\!dimenF#2%
- \ignorespaces}
-
-\def\!!logten#1#2\!nil{%
- \if -#1%
- \!dimenF=\!zpt
- \def\!next{\ignorespaces}%
- \else
- \if +#1%
- \def\!next{\!!logten#2\!nil}%
- \else
- \if .#1%
- \def\!next{\!!logten0.#2\!nil}%
- \else
- \def\!next{\!!!logten#1#2..\!nil}%
- \fi
- \fi
- \fi
- \!next}
-
-\def\!!!logten#1#2.#3.#4\!nil{%
- \!dimenF=1pt % ** DimF holds log10 original argument
- \if 0#1%
- \!!logshift#3pt % ** Argument < 1
- \else % ** Argument >= 1
- \!logshift#2/% ** Shift decimal pt as many places
- \!dimenE=#1.#2#3pt % ** as there are figures in #2
- \fi % ** Now dimE holds revised X want log10 of
- \ifdim \!dimenE<\!rootten% ** Transform X to XX between sqrt(10)
- \multiply \!dimenE 10 % ** and 10*sqrt(10)
- \advance \!dimenF -1pt
- \fi
- \!dimenG=\!dimenE% ** dimG <- (XX + 10)
- \advance\!dimenG 10pt
- \advance\!dimenE -10pt % ** dimE <- (XX - 10)
- \multiply\!dimenE 10 % ** dimE = 10*(XX-10)
- \!divide\!dimenE\!dimenG\!dimenE% ** Now dimE=10t==10*(XX-10)/(XX+10)
- \!removept\!dimenE\!t% ** !t=10t, with "pt" removed
- \!dimenG=\!t\!dimenE% ** dimG=100t**2
- \!removept\!dimenG\!tt% ** !tt=100t**2, with "pt" removed
- \!dimenH=\!tt\!tenAe% ** dimH=10*a5*(10t)**2 /100
- \divide\!dimenH 100
- \advance\!dimenH \!tenAc% ** ditto + 10*a3
- \!dimenH=\!tt\!dimenH% ** ditto * (10t)**2 /100
- \divide\!dimenH 100
- \advance\!dimenH \!tenAa% ** ditto + 10*a1
- \!dimenH=\!t\!dimenH% ** ditto * 10t / 100
- \divide\!dimenH 100 % ** Now dimH = log10(XX) - 1
- \advance\!dimenF \!dimenH}% ** dimF = log10(X)
-
-\def\!logshift#1{%
- \if #1/%
- \def\!next{\ignorespaces}%
- \else
- \advance\!dimenF 1pt
- \def\!next{\!logshift}%
- \fi
- \!next}
-
- \def\!!logshift#1{%
- \advance\!dimenF -1pt
- \if 0#1%
- \def\!next{\!!logshift}%
- \else
- \if p#1%
- \!dimenF=1pt
- \def\!next{\!dimenE=1p}%
- \else
- \def\!next{\!dimenE=#1.}%
- \fi
- \fi
- \!next}
-
-
-% ***********************************************************
-% *** PICTURES (Basic setups for PiCtures; \put commands) ***
-% ***********************************************************
-
-% ** User Commands:
-% ** \beginpicture
-% ** \endpicture
-% ** \endpicturesave <XREG,YREG>
-% ** \setcoordinatesystem units <XUNIT,YUNIT> point at XREF YREF
-% ** \put {OBJECT} [ORIENTATION] <XSHIFT,YSHIFT> at XCOORD YCOORD
-% ** \multiput {OJBECT} [ORIENTATION] <XSHIFT,YSHIFT>) at
-% ** XCOORD YCOORD
-% ** *NUMBER_OF_TIMES DXCOORD DYCOORD /
-% ** \accountingon
-% ** \accountingoff
-% ** \stack [ORIENTATION] <LEADING> {LIST OF ITEMS}
-% ** \lines [ORIENTATION] {LINES}
-% ** \Lines [ORIENTATION] {LINES}
-% ** \setdimensionmode
-% ** \setcoordinatemode
-% ** \Xdistance
-% ** \Ydistance
-
-% ** Internal commands:
-% ** \!setputobject{OBJECT}{[ORIENTATION]<XSHIFT,YSHIFT>}
-% ** \!dimenput{OBJECT}[ORIENTATION]<XSHIFT,YSHIFT>(XDIMEN,YDIMEN)
-% ** \!setdimenmode
-% ** \!setcoordmode
-% ** \!ifdimenmode
-% ** \!ifcoordmode
-
-
-% ** \beginpicture
-% ** \endpicture
-% ** \endpicturesave <XREG,YREG>
-% ** \beginpicture ... \endpicture creates an hbox. Objects are
-% ** placed in this box using the \put command and the like (see below).
-% ** The location of an object is specified in terms of coordinate system(s)
-% ** established by \setcoordinatesystem. Each coordinate system (there
-% ** might be just one) specifies the length of 1 horizontal unit, the length
-% ** of 1 vertical unit, and the coordinates of a "reference point". The
-% ** reference points of various coordinate systems will be in the same
-% ** physical location. The macros keep track of the size of the objects
-% ** and their locations. The resulting hbox is the smallest hbox which
-% ** encloses all the objects, and whose TEK reference point is the point
-% ** on the left edge of the box closest vertically to the PICTEX reference
-% ** point. Using \endpicturesave, you can (globally) save the distance TEK's
-% ** reference point is to the right (respectively, up from) PICTEX's
-% ** reference point in the dimension register \XREG (respectively \YREG).
-% ** You can then \put the picture OBJECT into a larger picture so that its
-% ** reference point is at (XCOORD,YCOORD) with the command
-% ** \put {picture OBJECT} [Bl] <\XREG, \YREG> at XCOORD YCOORD
-
-% ** \beginpicture : See Subsection 1.1 of the manual.
-\def\beginpicture{%
- \setbox\!picbox=\hbox\bgroup%
- \!xleft=\maxdimen
- \!xright=-\maxdimen
- \!ybot=\maxdimen
- \!ytop=-\maxdimen}
-
-% ** \endpicture : See Subsection 1.1 of the manual.
-\def\endpicture{%
- \ifdim\!xleft=\maxdimen% ** check if nothing was put in picbox
- \!xleft=\!zpt \!xright=\!zpt \!ybot=\!zpt \!ytop=\!zpt
- \fi
- \global\!Xleft=\!xleft \global\!Xright=\!xright
- \global\!Ybot=\!ybot \global\!Ytop=\!ytop
- \egroup%
- \ht\!picbox=\!Ytop \dp\!picbox=-\!Ybot
- \ifdim\!Ybot>\!zpt
- \else
- \ifdim\!Ytop<\!zpt
- \!Ybot=\!Ytop
- \else
- \!Ybot=\!zpt
- \fi
- \fi
- \hbox{\kern-\!Xleft\lower\!Ybot\box\!picbox\kern\!Xright}}
-
-% ** \endpicturesave : See Subsection 8.4 of the manual.
-\def\endpicturesave <#1,#2>{%
- \endpicture \global #1=\!Xleft \global #2=\!Ybot \ignorespaces}
-
-
-% ** \setcoordinatesystem units <XUNIT,YUNIT>
-% ** point at XREF YREF
-% ** Each of `units <XUNIT,YUNIT>' and `point at XREF YREF'
-% ** are optional.
-% ** Unit lengths must be given in dimensions (e.g., <10pt,1in>).
-% ** Default unit lengths are 1pt, 1pt, or previous unit lengths.
-% ** Reference point is specified in current units (e.g., 3 5 ).
-% ** Default reference point is 0 0 , or previous reference point.
-% ** Unit lengths and reference points obey TEX's scoping rules.
-% ** See Subsection 1.2 of the manual.
-\def\setcoordinatesystem{%
- \!ifnextchar{u}{\!getlengths }
- {\!getlengths units <\!xunit,\!yunit>}}
-\def\!getlengths units <#1,#2>{%
- \!xunit=#1\relax
- \!yunit=#2\relax
- \!ifcoordmode
- \let\!SCnext=\!SCccheckforRP
- \else
- \let\!SCnext=\!SCdcheckforRP
- \fi
- \!SCnext}
-\def\!SCccheckforRP{%
- \!ifnextchar{p}{\!cgetreference }
- {\!cgetreference point at {\!xref} {\!yref} }}
-\def\!cgetreference point at #1 #2 {%
- \edef\!xref{#1}\edef\!yref{#2}%
- \!xorigin=\!xref\!xunit \!yorigin=\!yref\!yunit
- \!initinboundscheck % ** See linear.tex
- \ignorespaces}
-\def\!SCdcheckforRP{%
- \!ifnextchar{p}{\!dgetreference}%
- {\ignorespaces}}
-\def\!dgetreference point at #1 #2 {%
- \!xorigin=#1\relax \!yorigin=#2\relax
- \ignorespaces}
-
-
-% ** \put {OBJECT} [XY] <XDIMEN,YDIMEN> at (XCOORD,YCOORD)
-% ** `[XY]' and `<XDIMEN,YDIMEN>' are optional.
-% ** First OBJECT is placed in an hbox (the "objectbox") and then a
-% ** "reference point" is assigned to the objectbox as follows:
-% ** [1] first, the reference point is taken to be the center of the box;
-% ** [2] next, centering is overridden by the specifications
-% ** X=l -- reference point along the left edge of the objectbox
-% ** X=r -- reference point along the right edge of the objectbox
-% ** Y=b -- reference point along the bottom edge of the objectbox
-% ** Y=B -- reference point along the Baseline of the objectbox
-% ** Y=t -- reference point along the top edge of the objectbox;
-% ** [3] finally the reference point is shifted left by XDIMEN, down
-% ** by YDIMEN (both default to 0pt).
-% ** The objectbox is placed within PICBOX with its reference point at
-% ** (XCOORD,YCOORD).
-% ** If OBJECT is a saved box, say box0, you have to write
-% ** \put{\box0}... or \put{\copy0}...
-% ** The objectbox is void after the put.
-% ** See Subsection 2.1 of the manual.
-\long\def\put#1#2 at #3 #4 {%
- \!setputobject{#1}{#2}%
- \!xpos=\!M{#3}\!xunit \!ypos=\!M{#4}\!yunit
- \!rotateaboutpivot\!xpos\!ypos%
- \advance\!xpos -\!xorigin \advance\!xpos -\!xshift
- \advance\!ypos -\!yorigin \advance\!ypos -\!yshift
- \kern\!xpos\raise\!ypos\box\!putobject\kern-\!xpos%
- \!doaccounting\ignorespaces}
-
-% ** \multiput etc. Like \put. The objectbox is not voided until the
-% ** termininating /, and is placed repeatedly with:
-% ** XCOORD YCOORD -- the objectbox is put down with its reference point
-% ** at (XCOORD,YCOORD);
-% ** *N DXCOORD DYCOORD -- each of N times the current
-% ** (xcoord,ycoord) is incremented by (DXCOORD,DYCOORD), and the
-% ** objectbox is put down with its reference point at (xcoord,ycoord)
-% ** (This specification has to follow an XCOORD YCOORD pair)
-% ** See Subsection 2.2 of the manual.
-\long\def\multiput #1#2 at {%
- \!setputobject{#1}{#2}%
- \!ifnextchar"{\!putfromfile}{\!multiput}}
-\def\!putfromfile"#1"{%
- \expandafter\!multiput \normalinput #1 /}
-\def\!multiput{%
- \futurelet\!nextchar\!!multiput}
-\def\!!multiput{%
- \if *\!nextchar
- \def\!nextput{\!alsoby}%
- \else
- \if /\!nextchar
- \def\!nextput{\!finishmultiput}%
- \else
- \def\!nextput{\!alsoat}%
- \fi
- \fi
- \!nextput}
-\def\!finishmultiput/{%
- \setbox\!putobject=\hbox{}%
- \ignorespaces}
-
-% ** \!alsoat XCOORD YCOORD
-% ** The objectbox is put down with reference point at XCOORD,YCOORD
-\def\!alsoat#1 #2 {%
- \!xpos=\!M{#1}\!xunit \!ypos=\!M{#2}\!yunit
- \!rotateaboutpivot\!xpos\!ypos%
- \advance\!xpos -\!xorigin \advance\!xpos -\!xshift
- \advance\!ypos -\!yorigin \advance\!ypos -\!yshift
- \kern\!xpos\raise\!ypos\copy\!putobject\kern-\!xpos%
- \!doaccounting
- \!multiput}
-
-% ** \!alsoby*N DXCOORD DYCOORD
-% ** N times, the current (XCOORD,YCOORD) is advanced by (DXCOORD,DYCOORD),
-% ** and the current (shifted, oriented) OBJECT is put down.
-\def\!alsoby*#1 #2 #3 {%
- \!dxpos=\!M{#2}\!xunit \!dypos=\!M{#3}\!yunit
- \!rotateonly\!dxpos\!dypos
- \!ntemp=#1%
- \!!loop\ifnum\!ntemp>0
- \advance\!xpos by \!dxpos \advance\!ypos by \!dypos
- \kern\!xpos\raise\!ypos\copy\!putobject\kern-\!xpos%
- \advance\!ntemp by -1
- \repeat
- \!doaccounting
- \!multiput}
-
-% ** \accountingoff : Suspends PiCTeX's accounting of the aggregate
-% ** size of the picture box.
-% ** \accounting on : Reinstates accounting.
-% ** See Subsection 8.2 of the manual.
-\def\accountingon{\def\!doaccounting{\!!doaccounting}\ignorespaces}
-\def\accountingoff{\def\!doaccounting{}\ignorespaces}
-\accountingon
-\def\!!doaccounting{%
- \!xtemp=\!xpos
- \!ytemp=\!ypos
- \ifdim\!xtemp<\!xleft
- \!xleft=\!xtemp
- \fi
- \advance\!xtemp by \!wd
- \ifdim\!xright<\!xtemp
- \!xright=\!xtemp
- \fi
- \advance\!ytemp by -\!dp
- \ifdim\!ytemp<\!ybot
- \!ybot=\!ytemp
- \fi
- \advance\!ytemp by \!dp
- \advance\!ytemp by \!ht
- \ifdim\!ytemp>\!ytop
- \!ytop=\!ytemp
- \fi}
-
-\long\def\!setputobject#1#2{%
- \setbox\!putobject=\hbox{#1}%
- \!ht=\ht\!putobject \!dp=\dp\!putobject \!wd=\wd\!putobject
- \wd\!putobject=\!zpt
- \!xshift=.5\!wd \!yshift=.5\!ht \advance\!yshift by -.5\!dp
- \edef\!putorientation{#2}%
- \expandafter\!SPOreadA\!putorientation[]\!nil%
- \expandafter\!SPOreadB\!putorientation<\!zpt,\!zpt>\!nil\ignorespaces}
-
-\def\!SPOreadA#1[#2]#3\!nil{\!etfor\!orientation:=#2\do\!SPOreviseshift}
-
-\def\!SPOreadB#1<#2,#3>#4\!nil{\advance\!xshift by -#2\advance\!yshift by -#3}
-
-\def\!SPOreviseshift{%
- \if l\!orientation
- \!xshift=\!zpt
- \else
- \if r\!orientation
- \!xshift=\!wd
- \else
- \if b\!orientation
- \!yshift=-\!dp
- \else
- \if B\!orientation
- \!yshift=\!zpt
- \else
- \if t\!orientation
- \!yshift=\!ht
- \fi
- \fi
- \fi
- \fi
- \fi}
-
-
-% ** \!dimenput{OBJECT} <XDIMEN,YDIMEN> [XY] (XLOC,YLOC)
-% ** This is an internal put routine, similar to \put, except that
-% ** XLOC=distance right from reference point, YLOC=distance up from
-% ** reference point. XLOC and YLOC are dimensions, so this routine
-% ** is completely independent of the current coordinate system.
-% ** This routine does NOT do ROTATIONS.
-\long\def\!dimenput#1#2(#3,#4){%
- \!setputobject{#1}{#2}%
- \!xpos=#3\advance\!xpos by -\!xshift
- \!ypos=#4\advance\!ypos by -\!yshift
- \kern\!xpos\raise\!ypos\box\!putobject\kern-\!xpos%
- \!doaccounting\ignorespaces}
-
-
-% ** The following macros permit the picture drawing routines to be used
-% ** either in the default "coordinate mode", or in "dimension mode".
-% ** In coordinate mode \!M(1.5,\!xunit) expands to 1.5\!xunit
-% ** In dimension mode \!M(1.5pt,\!xunit) expands to 1.5pt
-% ** Dimension mode is useful in coding macros.
-% ** Any special purpose picture macro that sets dimension mode should
-% ** reset coordinate mode before completion.
-% ** See Subsection 9.2 of the manual.
-\def\!setdimenmode{%
- \let\!M=\!M!!\ignorespaces}
-\def\!setcoordmode{%
- \let\!M=\!M!\ignorespaces}
-\def\!ifcoordmode{%
- \ifx \!M \!M!}
-\def\!ifdimenmode{%
- \ifx \!M \!M!!}
-\def\!M!#1#2{#1#2}
-\def\!M!!#1#2{#1}
-\!setcoordmode
-\let\setdimensionmode=\!setdimenmode
-\let\setcoordinatemode=\!setcoordmode
-
-% ** \Xdistance{XCOORD}, \Ydistance{YCOORD} are the horizontal and
-% ** vertical distances from the origin (0,0) to the point
-% ** (XCOORD,YCOORD) in the current coordinate system.
-% ** See Subsection 9.2 of the manual.
-\def\Xdistance#1{%
- \!M{#1}\!xunit
- \ignorespaces}
-\def\Ydistance#1{%
- \!M{#1}\!yunit
- \ignorespaces}
-
-% ** The following macros -- \stack, \line, and \Lines -- are useful for
-% ** annotating PiCtures. They can be used outside the \beginpicture ...
-% ** \endpicture environment.
-
-% ** \stack [POSITIONING] <LEADING> {VALUESLIST}
-% ** Builds a vertical stack of the values in VALUESLIST. Values in
-% ** VALUESLIST are separated by commas. In the resulting stack, values are
-% ** centered by default, and positioned flush left (right) if
-% ** POSITIONING = l (r). Values are separated vertically by LEADING,
-% ** which defaults to \stackleading.
-% ** See Subsection 2.3 of the manual.
-\def\stack{%
- \!ifnextchar[{\!stack}{\!stack[c]}}
-\def\!stack[#1]{%
- \let\!lglue=\hfill \let\!rglue=\hfill
- \expandafter\let\csname !#1glue\endcsname=\relax
- \!ifnextchar<{\!!stack}{\!!stack<\stackleading>}}
-\def\!!stack<#1>#2{%
- \vbox{\def\!valueslist{}\!ecfor\!value:=#2\do{%
- \expandafter\!rightappend\!value\withCS{\\}\to\!valueslist}%
- \!lop\!valueslist\to\!value
- \let\\=\cr\lineskiplimit=\maxdimen\lineskip=#1%
- \baselineskip=-1000pt\halign{\!lglue##\!rglue\cr \!value\!valueslist\cr}}%
- \ignorespaces}
-
-% ** \lines [POSITIONING] {LINES}
-% ** Builds a vertical array of the lines in LINES. Each line in LINES
-% ** is terminated by a \cr. In the resulting array, lines are
-% ** centered by default, and positioned flush left (right) if
-% ** POSITIONING = l (r). The lines in the array are subject to TeX's
-% ** usual spacing rules: in particular the baselines are ordinarily an equal
-% ** distance apart. The baseline of the array is the baseline of the
-% ** the bottom line.
-% ** See Subsection 2.3 of the manual.
-\def\lines{%
- \!ifnextchar[{\!lines}{\!lines[c]}}
-\def\!lines[#1]#2{%
- \let\!lglue=\hfill \let\!rglue=\hfill
- \expandafter\let\csname !#1glue\endcsname=\relax
- \vbox{\halign{\!lglue##\!rglue\cr #2\crcr}}%
- \ignorespaces}
-
-% ** \Lines [POSITIONING] {LINES}
-% ** Like \lines, but the baseline of the array is the baseline of the
-% ** top line. See Subsection 2.3 of the manual.
-\def\Lines{%
- \!ifnextchar[{\!Lines}{\!Lines[c]}}
-\def\!Lines[#1]#2{%
- \let\!lglue=\hfill \let\!rglue=\hfill
- \expandafter\let\csname !#1glue\endcsname=\relax
- \vtop{\halign{\!lglue##\!rglue\cr #2\crcr}}%
- \ignorespaces}
-
-
-% *********************************************
-% *** PLOTTING (Things to do with plotting) ***
-% *********************************************
-
-% ** User commands
-% ** \setplotsymbol ({PLOTSYMBOL} [ORIENTATION] <XSHIFT,YSHIFT>)
-% ** \savelinesandcurves on "FILE_NAME"
-% ** \dontsavelinesandcurves
-% ** \writesavefile {MESSAGE}
-% ** \replot {FILE_NAME}
-
-% ** Internal command
-% ** \!plot(XDIMEN,YDIMEN)
-
-% ** \setplotsymbol ({PLOTSYMBOL} [ ] < , >)
-% ** Save PLOTSYMBOL away in an hbox for use with curve plotting routines
-% ** See Subsection 5.2 of the manual.
-\def\setplotsymbol(#1#2){%
- \!setputobject{#1}{#2}
- \setbox\!plotsymbol=\box\!putobject%
- \!plotsymbolxshift=\!xshift
- \!plotsymbolyshift=\!yshift
- \ignorespaces}
-
-\setplotsymbol({\fiverm .})% ** initialize plotsymbol
-
-
-% ** \!plot is either \!!plot (when no lines and curves are being saved) or
-% ** \!!!plot (when lines and curves are being saved)
-
-% ** \!!plot(XDIMEN,YDIMEN)
-% ** Places the current plotsymbol a horizontal distance=XDIMEN-xorigin
-% ** and a vertical distance=YDIMEN-yorigin from the current
-% ** reference point.
-\def\!!plot(#1,#2){%
- \!dimenA=-\!plotxorigin \advance \!dimenA by #1% ** over
- \!dimenB=-\!plotyorigin \advance \!dimenB by #2% ** up
- \kern\!dimenA\raise\!dimenB\copy\!plotsymbol\kern-\!dimenA%
- \ignorespaces}
-
-% ** \!!!plot(XDIMEN,YDIMEN)
-% ** Like \!!plot, but also saves the plot location in units of
-% ** scaled point, on file `replotfile'
-\def\!!!plot(#1,#2){%
- \!dimenA=-\!plotxorigin \advance \!dimenA by #1% ** over
- \!dimenB=-\!plotyorigin \advance \!dimenB by #2% ** up
- \kern\!dimenA\raise\!dimenB\copy\!plotsymbol\kern-\!dimenA%
- \!countE=\!dimenA
- \!countF=\!dimenB
- \immediate\write\!replotfile{\the\!countE,\the\!countF.}%
- \ignorespaces}
-
-
-% ** \savelinesandcurves on "FILE_NAME"
-% ** Switch to save locations used for plotting lines and curves
-% ** (No advantage in saving locations for solid lines; however
-% ** replotting curve locations speeds things up by a factor of about 4.
-% ** \dontsavelinesandcurves
-% ** Terminates \savelinesandcurves. The default.
-% ** See Subsection 5.6 of the manual.
-\def\savelinesandcurves on "#1" {%
- \immediate\closeout\!replotfile
- \immediate\openout\!replotfile=#1%
- \let\!plot=\!!!plot}
-
-\def\dontsavelinesandcurves {%
- \let\!plot=\!!plot}
-\dontsavelinesandcurves
-
-% ** \writesavefile {MESSAGE}
-% ** The message is preceded by a "%", so that it won't interfere
-% ** with replotting.
-% ** See Subsection 5.6 of the manual.
-{\catcode`\%=11\xdef\!Commentsignal{%}}
-\def\writesavefile#1 {%
- \immediate\write\!replotfile{\!Commentsignal #1}%
- \ignorespaces}
-
-% ** \replot "FILE_NAME"
-% ** Replots the locations saved earlier under \savelinesandcurves
-% ** on "FILE_NAME"
-% ** See Subsection 5.6 of the manual.
-\def\replot"#1" {%
- \expandafter\!replot\normalinput #1 /}
-\def\!replot#1,#2. {%
- \!dimenA=#1sp
- \kern\!dimenA\raise#2sp\copy\!plotsymbol\kern-\!dimenA
- \futurelet\!nextchar\!!replot}
-\def\!!replot{%
- \if /\!nextchar
- \def\!next{\!finish}%
- \else
- \def\!next{\!replot}%
- \fi
- \!next}
-% **************************************************
-% *** PYTHAGORAS (Euclidean distance function) ***
-% **************************************************
-
-% ** User command:
-% ** \placehypotenuse for <dimension1> and <dimension2> in <register>
-
-% ** Internal command:
-% ** \!Pythag{X}{Y}{Z}
-% ** Input X,Y are dimensions, or dimension registers.
-% ** Output Z == sqrt(X**2+Y**2) must be a dimension register.
-% ** Assumes that |X|+|Y| < 2048pt (about 28in).
-
-% ** Without loss of generality, suppose x>0, y>0. Put s = x+y,
-% ** z = sqrt(x**2+y**2). Then z = s*f, where f = sqrt(t**2 + (1-t)**2)
-% ** = sqrt((1+tau**2)/2), where t = x/s and tau = 2(t-1/2) .
-
-% ** Uses the \!divide macro (which uses registers \!dimenA--\!dimenD.
-% ** Uses the \!removept macro (e.g., 123.45pt --> 123.45)
-% ** Uses registers \!dimenE--\!dimenI.
-\def\!Pythag#1#2#3{%
- \!dimenE=#1\relax
- \ifdim\!dimenE<\!zpt
- \!dimenE=-\!dimenE
- \fi% ** dimE = |x|
- \!dimenF=#2\relax
- \ifdim\!dimenF<\!zpt
- \!dimenF=-\!dimenF
- \fi% ** dimF = |y|
- \advance \!dimenF by \!dimenE% ** dimF = s = |x|+|y|
- \ifdim\!dimenF=\!zpt
- \!dimenG=\!zpt% ** dimG = z = sqrt(x**2+y**2)
- \else
- \!divide{8\!dimenE}\!dimenF\!dimenE% ** now dimE = 8t = (8|x|)/s
- \advance\!dimenE by -4pt% ** 8tau = (8t-4)*2
- \!dimenE=2\!dimenE% ** (tau = 2*t - 1)
- \!removept\!dimenE\!!t% ** 8tau, without "pt"
- \!dimenE=\!!t\!dimenE% ** (8tau)**2, in pts
- \advance\!dimenE by 64pt% ** u = [64 + (8tau)**2]/2
- \divide \!dimenE by 2% ** [u = (8f)**2]
- \!dimenH=7pt% ** initial guess g at sqrt(u)
- \!!Pythag\!!Pythag\!!Pythag% ** 3 iterations give sqrt(u)
- \!removept\!dimenH\!!t% ** 8f=sqrt(u), without "pt"
- \!dimenG=\!!t\!dimenF% ** z = (8f)*s/8
- \divide\!dimenG by 8
- \fi
- #3=\!dimenG
- \ignorespaces}
-
-\def\!!Pythag{% ** Newton-Raphson for sqrt
- \!divide\!dimenE\!dimenH\!dimenI% ** v = u/g
- \advance\!dimenH by \!dimenI% ** g <-- (g + u/g)/2
- \divide\!dimenH by 2}
-
-% ** \placehypotenuse for <XI> and <ETA> in <ZETA>
-% ** See Subsection 9.3 of the manual.
-\def\placehypotenuse for <#1> and <#2> in <#3> {%
- \!Pythag{#1}{#2}{#3}}
-
-
-% **********************************************
-% *** QUADRATIC ARC (Draws a quadratic arc) ***
-% **********************************************
-
-% ** Internal command
-% ** \!qjoin (XCOORD1,YCOORD1) (XCOORD2,YCOORD2)
-
-% ** \!qjoin (XCOORD1,YCOORD1) (XCOORD2,YCOORD2)
-% ** Draws an arc starting at the (last) point specified by the most recent
-% ** \!qjoin, or \!ljoin, or \!start and passing through (X_1,Y_1), (X_2,Y_2).
-% ** Uses quadratic interpolation in both x and y:
-% ** x(t), 0 <= t <= 1, interpolates x_0, x_1, x_2 at t=0, .5, 1
-% ** y(t), 0 <= t <= 1, interpolates y_0, y_1, y_2 at t=0, .5, 1
-
-\def\!qjoin (#1,#2) (#3,#4){%
- \advance\!intervalno by 1
- \!ifcoordmode
- \edef\!xmidpt{#1}\edef\!ymidpt{#2}%
- \else
- \!dimenA=#1\relax \edef\!xmidpt{\the\!dimenA}%
- \!dimenA=#2\relax \edef\!xmidpt{\the\!dimenA}%
- \fi
- \!xM=\!M{#1}\!xunit \!yM=\!M{#2}\!yunit \!rotateaboutpivot\!xM\!yM
- \!xE=\!M{#3}\!xunit \!yE=\!M{#4}\!yunit \!rotateaboutpivot\!xE\!yE
-%
-% ** Find coefficients for x(t)=a_x + b_x*t + c_x*t**2
- \!dimenA=\!xM \advance \!dimenA by -\!xS% ** dimA = I = xM - xS
- \!dimenB=\!xE \advance \!dimenB by -\!xM% ** dimB = II = xE-xM
- \!xB=3\!dimenA \advance \!xB by -\!dimenB% ** b=3I-II
- \!xC=2\!dimenB \advance \!xC by -2\!dimenA% ** c=2(II-I)
-%
-% ** Find coefficients for y(t)=y_x + b_y*t + c_y*t**2
- \!dimenA=\!yM \advance \!dimenA by -\!yS%
- \!dimenB=\!yE \advance \!dimenB by -\!yM%
- \!yB=3\!dimenA \advance \!yB by -\!dimenB%
- \!yC=2\!dimenB \advance \!yC by -2\!dimenA%
-%
-% ** Use Simpson's rule to calculate arc length over [0,1/2]:
-% ** arc length = 1/2[1/6 f(0) + 4/6 f(1/4) + 1/6 f(1/2)]
-% ** with f(t) = sqrt(x'(t)**2 + y'(t)**2).
- \!xprime=\!xB \!yprime=\!yB% ** x'(t) = b + 2ct
- \!dxprime=.5\!xC \!dyprime=.5\!yC% ** dt=1/4 ==> dx'(t) = c/2
- \!getf \!midarclength=\!dimenA
- \!getf \advance \!midarclength by 4\!dimenA
- \!getf \advance \!midarclength by \!dimenA
- \divide \!midarclength by 12
-%
-% ** Get arc length over [0,1].
- \!arclength=\!dimenA
- \!getf \advance \!arclength by 4\!dimenA
- \!getf \advance \!arclength by \!dimenA
- \divide \!arclength by 12% ** Now have arc length over [1/2,1]
- \advance \!arclength by \!midarclength
- \global\advance \totalarclength by \!arclength
-%
-%
-% ** Check to see if there's anything to plot in this interval
- \ifdim\!distacross>\!arclength
- \advance \!distacross by -\!arclength% ** nothing
-%
- \else
- \!initinverseinterp% ** initialize for inverse interpolation on arc length
- \loop\ifdim\!distacross<\!arclength% ** loop over points on arc
- \!inverseinterp% ** find t such that arc length[0,t] = distacross,
-% ** using inverse quadratic interpolation
-% ** now evaluate x(t)=(c*t + b)*t + a
- \!xpos=\!t\!xC \advance\!xpos by \!xB
- \!xpos=\!t\!xpos \advance \!xpos by \!xS
-% ** evaluate y(t)
- \!ypos=\!t\!yC \advance\!ypos by \!yB
- \!ypos=\!t\!ypos \advance \!ypos by \!yS
- \!plotifinbounds% ** plot point if in bounds
- \advance\!distacross \plotsymbolspacing%** advance arc length for next pt
- \!advancedashing% ** see "linear"
- \repeat
-%
- \advance \!distacross by -\!arclength% ** prepare for next interval
- \fi
-%
- \!xS=\!xE% ** shift ending points to starting points
- \!yS=\!yE
- \ignorespaces}
-
-
-% ** \!getf -- Calculates sqrt(x'(t)**2 + y'(t)**2) and advances
-% ** x'(t) and y'(t)
-\def\!getf{\!Pythag\!xprime\!yprime\!dimenA%
- \advance\!xprime by \!dxprime
- \advance\!yprime by \!dyprime}
-
-
-% ** \!initinverseinterp -- initializes for inverse quadratic interpolation
-% ** of arc length provided 1/3 < midarclength/arclength < 2/3; otherwise
-% ** initializes for inverse linear interpolation.
-\def\!initinverseinterp{%
- \ifdim\!arclength>\!zpt
- \!divide{8\!midarclength}\!arclength\!dimenE% ** dimE=8w=8r/s, where r
-% ** = midarclength, s=arclength
-% ** Test for w out of range: w<1/3 or w>2/3
- \ifdim\!dimenE<\!wmin \!setinverselinear
- \else
- \ifdim\!dimenE>\!wmax \!setinverselinear
- \else% ** w in range: initialize
- \def\!inverseinterp{\!inversequad}\ignorespaces
-%
-% ** Calculate the coefficients \!beta and \!gamma of the quadratic
-% ** t = \!beta*v + \!gamma*v**2
-% ** taking the values t=0, 1/2, 1 at v=0, w==r/s, 1 respectively:
-% ** \!beta = (1/2 - w**2)/[w(1-w)]
-% ** \!gamma = 1 - beta.
-%
- \!removept\!dimenE\!Ew% ** 8w, without "pt"
- \!dimenF=-\!Ew\!dimenE% ** -(8w)**2
- \advance\!dimenF by 32pt% ** 32 - (8w)**2
- \!dimenG=8pt
- \advance\!dimenG by -\!dimenE% ** 8 - 8w
- \!dimenG=\!Ew\!dimenG% ** (8w)*(8-8w)
- \!divide\!dimenF\!dimenG\!beta% ** beta = (32-(8w)**2)/(8w(8-8w))
-% ** = (1/2 - w**2)/(w(1-w))
- \!gamma=1pt
- \advance \!gamma by -\!beta% ** gamma = 1-beta
- \fi% ** end of the \ifdim\!dimenE>\!wmax
- \fi% ** end of the \ifdim\!dimenE<\!wmin
- \fi% ** end of the \ifdim\!arclength>\!zpt
- \ignorespaces}
-
-
-% ** For 0 <= t <= 1, let AL(t) = arclength[0,t]/arclength[0,1]; note
-% ** AL(0)=0, AL(1/2)=midarclength/arclength, AL(1)=1. This routine
-% ** calculates an approximation to AL^{-1}(distance across/arclength),
-% ** using the assumption that AL^{-1} is quadratic. Specifically,
-% ** it finds t such that
-% ** AL^{-1}(v) =. t = v*(\!beta + \!gamma*v)
-% ** where \!beta and \!gamma are set by \!initinv, and where
-% ** v=distance across/arclength
-\def\!inversequad{%
- \!divide\!distacross\!arclength\!dimenG% ** dimG = v = distacross/arclength
- \!removept\!dimenG\!v% ** v, without "pt"
- \!dimenG=\!v\!gamma% ** gamma*v
- \advance\!dimenG by \!beta% ** beta + gamma*v
- \!dimenG=\!v\!dimenG% ** t = v*(beta + gamma*v)
- \!removept\!dimenG\!t}% ** t, without "pt"
-
-
-% ** When w <= 1/3 or w >= 2/3, the following routine writes (using
-% ** plain TEK's \wlog command) a warning message on the user's log file,
-% ** and initializes for inverse linear interpolation on arc length.
-\def\!setinverselinear{%
- \def\!inverseinterp{\!inverselinear}%
- \divide\!dimenE by 8 \!removept\!dimenE\!t
- \!countC=\!intervalno \multiply \!countC 2
- \!countB=\!countC \advance \!countB -1
- \!countA=\!countB \advance \!countA -1
- \wlog{\the\!countB th point (\!xmidpt,\!ymidpt) being plotted
- doesn't lie in the}%
- \wlog{ middle third of the arc between the \the\!countA th
- and \the\!countC th points:}%
- \wlog{ [arc length \the\!countA\space to \the\!countB]/[arc length
- \the \!countA\space to \the\!countC]=\!t.}%
- \ignorespaces}
-
-% ** Inverse linear interpolation
-\def\!inverselinear{%
- \!divide\!distacross\!arclength\!dimenG
- \!removept\!dimenG\!t}
-
-
-% **************************************
-% ** ROTATIONS (Handles rotations) ***
-% **************************************
-
-% ** User commands
-% ** \startrotation [by COS_OF_ANGLE SIN_OF_ANGLE] [about XPIVOT YPIVOT]
-% ** \stoprotation
-
-% ** \startrotation [by COS_OF_ANGLE SIN_OF_ANGLE] [about XPIVOT YPIVOT]
-% ** Future (XCOORD,YCOORD)'s will be rotated about (XPIVOT,YPIVOT)
-% ** by the angle with the give COS and SIN. Both fields are optional.
-% ** [COS,SIN] defaults to previous value, or (1,0).
-% ** (XPIVOT,YPIVOT) defaults to previous value, or (0,0)
-% ** You can't change the coordinate system in the scope of a rotation.
-% ** See Subsection 9.1 of the manual.
-\def\startrotation{%
- \let\!rotateaboutpivot=\!!rotateaboutpivot
- \let\!rotateonly=\!!rotateonly
- \!ifnextchar{b}{\!getsincos }%
- {\!getsincos by {\!cosrotationangle} {\!sinrotationangle} }}
-\def\!getsincos by #1 #2 {%
- \edef\!cosrotationangle{#1}%
- \edef\!sinrotationangle{#2}%
- \!ifcoordmode
- \let\!ROnext=\!ccheckforpivot
- \else
- \let\!ROnext=\!dcheckforpivot
- \fi
- \!ROnext}
-\def\!ccheckforpivot{%
- \!ifnextchar{a}{\!cgetpivot}%
- {\!cgetpivot about {\!xpivotcoord} {\!ypivotcoord} }}
-\def\!cgetpivot about #1 #2 {%
- \edef\!xpivotcoord{#1}%
- \edef\!ypivotcoord{#2}%
- \!xpivot=#1\!xunit \!ypivot=#2\!yunit
- \ignorespaces}
-\def\!dcheckforpivot{%
- \!ifnextchar{a}{\!dgetpivot}{\ignorespaces}}
-\def\!dgetpivot about #1 #2 {%
- \!xpivot=#1\relax \!ypivot=#2\relax
- \ignorespaces}
-
-
-% ** Following terminates rotation.
-% ** See Subsection 9.1 of the manual.
-\def\stoprotation{%
- \let\!rotateaboutpivot=\!!!rotateaboutpivot
- \let\!rotateonly=\!!!rotateonly
- \ignorespaces}
-
-% ** !!rotateaboutpivot{XREG}{YREG}
-% ** XREG <-- xpvt + cos(angle)*(XREG-xpvt) - sin(angle)*(YREG-ypvt)
-% ** YREG <-- ypvt + cos(angle)*(YREG-ypvt) + sin(angle)*(XREG-xpvt)
-% ** XREG,YREG are dimension registers. Can't be \!dimenA to \!dimenD
-\def\!!rotateaboutpivot#1#2{%
- \!dimenA=#1\relax \advance\!dimenA -\!xpivot
- \!dimenB=#2\relax \advance\!dimenB -\!ypivot
- \!dimenC=\!cosrotationangle\!dimenA
- \advance \!dimenC -\!sinrotationangle\!dimenB
- \!dimenD=\!cosrotationangle\!dimenB
- \advance \!dimenD \!sinrotationangle\!dimenA
- \advance\!dimenC \!xpivot \advance\!dimenD \!ypivot
- #1=\!dimenC #2=\!dimenD
- \ignorespaces}
-
-% ** \!!rotateonly{XREG}{YREG}
-% ** Like \!!rotateaboutpivot, but with a pivot of (0,0)
-\def\!!rotateonly#1#2{%
- \!dimenA=#1\relax \!dimenB=#2\relax
- \!dimenC=\!cosrotationangle\!dimenA
- \advance \!dimenC -\!rotsign\!sinrotationangle\!dimenB
- \!dimenD=\!cosrotationangle\!dimenB
- \advance \!dimenD \!rotsign\!sinrotationangle\!dimenA
- #1=\!dimenC #2=\!dimenD
- \ignorespaces}
-\def\!rotsign{}
-\def\!!!rotateaboutpivot#1#2{\relax}
-\def\!!!rotateonly#1#2{\relax}
-\stoprotation
-
-\def\!reverserotateonly#1#2{%
- \def\!rotsign{-}%
- \!rotateonly{#1}{#2}%
- \def\!rotsign{}%
- \ignorespaces}
-
-
-% **********************************
-% *** SHADING (Handles shading) ***
-% **********************************
-
-% ** User commands
-% ** \setshadegrid [span <SPAN>] [point at XSHADE YSHADE]
-% ** \setshadesymbol [<LS, RS, BS, TS>] ({SHADESYMBOL}
-% ** <XDIMEN,YDIMEN> [ORIENTATION])
-
-% ** Internal commands:
-% ** \!startvshade (xS,ybS,ytS)
-% ** \!starthshade (yS,xlS,xrS)
-% ** \!lshade [<LS,RS,BS,TS>]
-% ** ** when shading vertically:
-% ** [the region from (xS,ybS,ytS) to] (xE,ybE,ytE)
-% ** ** when shading horizontally:
-% ** [the region from (yS,xlS,xrS) to] (yE,xlE,xrE)
-% ** \!qshade [<LS,RS,BS,TS>]
-% ** ** when shading vertically:
-% ** [the region from (xS,ybS,ytS) to] (xM,ybM,ytM) (xE,ybE,ytE)
-% ** ** when shading horizontally:
-% ** [the region from (yS,xlS,xrS) to] (yM,xlM,xrM) (yE,xlE,xrE)
-% ** \!lattice{ANCHOR}{SPAN}{LOCATION}{INDEX}{LATTICE LOCATION}
-% ** \!override{NOMINAL DIMEN}{REPLACEMENT DIMEN}{DIMEN}
-
-
-% ** The shading routine can operate either in a "vertical mode" or a
-% ** "horizontal mode". In vertical mode, the region to be shaded is specified
-% ** in the form
-% ** {(x,y): xl <= x <= xr & yb(x) <= y <= yt(x)}
-% ** where yb and yt are functions of x. In horizontal mode, the region
-% ** is specified in the form
-% ** {(x,y): yb <= y <= yt & xl(y) <= x <= xr(y)}.
-% ** The functions yb and yt may be either both linear or both quadratic;
-% ** similarly for xl and xr. A region with say, piecewise quadratic bottom
-% ** and top boundaries, can be shaded by consecutive (vertical) \!qshades,
-% ** proceeding from left to right. Similarly, a region with piecewise
-% ** quadratic left and right boundaries can be shaded by consecutive
-% ** (horizontal) \!qshades, proceeding from bottom to top. More complex
-% ** regions can be shaded by partitioning them into appropriate subregions,
-% ** and shading those.
-
-% ** Shading is accomplished by placing a user-selected shading symbol at
-% ** those points of a regular grid which fall within the region to be
-% ** shaded. This region can be "shrunk" so that a largish shading symbol
-% ** will not extend outside it. Shrinking is accomplished by specifying
-% ** shrinkages for the left, right, bottom, and top boundaries, in a manner
-% ** discussed further below.
-
-% ** \shades and \!joins MUST NOT be intermingled. Finish drawing a curve
-% ** before starting to shade a region, and finish shading a region before
-% ** starting to draw a curve.
-
-
-% ** \setshadegrid [span <SPAN>] [point at XSHADE YSHADE]
-% ** The shading symbol is placed down on the points of a grid centered
-% ** at the coordinate point (XSHADE,YSHADE). The grid points are of the
-% ** form (j*SPAN,k*SPAN), with j+k even. SPAN is specified
-% ** as a dimension.
-% ** (XSHADE,YSHADE) defaults to previous (XSHADE,YSHADE) (or (0,0) if none)
-% ** SPAN defaults to previous span (or 5pt if none)
-% ** See Subsection 7.2 of the manual.
-\def\setshadegrid{%
- \!ifnextchar{s}{\!getspan }
- {\!getspan span <\!dshade>}}
-\def\!getspan span <#1>{%
- \!dshade=#1\relax
- \!ifcoordmode
- \let\!GRnext=\!GRccheckforAP
- \else
- \let\!GRnext=\!GRdcheckforAP
- \fi
- \!GRnext}
-\def\!GRccheckforAP{%
- \!ifnextchar{p}{\!cgetanchor }
- {\!cgetanchor point at {\!xshadesave} {\!yshadesave} }}
-\def\!cgetanchor point at #1 #2 {%
- \edef\!xshadesave{#1}\edef\!yshadesave{#2}%
- \!xshade=\!xshadesave\!xunit \!yshade=\!yshadesave\!yunit
- \ignorespaces}
-\def\!GRdcheckforAP{%
- \!ifnextchar{p}{\!dgetanchor}%
- {\ignorespaces}}
-\def\!dgetanchor point at #1 #2 {%
- \!xshade=#1\relax \!yshade=#2\relax
- \ignorespaces}
-
-% ** \setshadesymbol [<LS, RS, BS, TS>] ({SHADESYMBOL}
-% ** <XDIMEN,YDIMEN> [ORIENTATION])
-% ** Saves SHADESYMBOL away in an hbox for use with shading routines.
-% ** A shade symbol will not be plotted if its plot position comes within
-% ** distance LS of the left boundary, RS of the right boundary, TS of the
-% ** top boundary, BS of the bottom boundary. These parameters have
-% ** default values that should work in most cases (see below).
-% ** To override a default value, specify the replacement value
-% ** in the appropriate subfield of the shrinkages field.
-% ** 0pt may be coded as "z" (without the quotes). To accept a
-% ** default value, leave the field empty. Thus
-% ** [,z,,5pt] sets LS=default, RS=0pt, BS=default, TS=5pt .
-% ** Skipping the shrinkages field accepts all the defaults.
-% ** See Subsection 7.1 of the manual.
-\def\setshadesymbol{%
- \!ifnextchar<{\!setshadesymbol}{\!setshadesymbol<,,,> }}
-
-\def\!setshadesymbol <#1,#2,#3,#4> (#5#6){%
-% ** set the shadesymbol
- \!setputobject{#5}{#6}%
- \setbox\!shadesymbol=\box\!putobject%
- \!shadesymbolxshift=\!xshift \!shadesymbolyshift=\!yshift
-%
-% ** set the shrinkages
- \!dimenA=\!xshift \advance\!dimenA \!smidge% ** default LS = xshift - smidge
- \!override\!dimenA{#1}\!lshrinkage%
- \!dimenA=\!wd \advance \!dimenA -\!xshift% ** default RS = width - xshift
- \advance\!dimenA \!smidge% - smidge
- \!override\!dimenA{#2}\!rshrinkage
- \!dimenA=\!dp \advance \!dimenA \!yshift% ** default BS = depth + yshift
- \advance\!dimenA \!smidge% - smidge
- \!override\!dimenA{#3}\!bshrinkage
- \!dimenA=\!ht \advance \!dimenA -\!yshift% ** default TS = height - yshift
- \advance\!dimenA \!smidge% - smidge
- \!override\!dimenA{#4}\!tshrinkage
- \ignorespaces}
-\def\!smidge{-.2pt}%
-
-% ** \!override{NOMINAL DIMEN}{REPLACEMENT DIMEN}{DIMEN}
-% ** Overrides the NOMINAL DIMEN by the REPLACEMENT DIMEN to produce DIMEN,
-% ** according to the following rules:
-% ** REPLACEMENT DIMEN empty: DIMEN <-- NOMINAL DIMEN
-% ** REPLACEMENT DIMEN z: DIMEN <-- 0pt
-% ** otherwise: DIMEN <-- REPLACEMENT DIMEN
-% ** DIMEN must be a dimension register
-\def\!override#1#2#3{%
- \edef\!!override{#2}%
- \ifx \!!override\empty
- #3=#1\relax
- \else
- \if z\!!override
- #3=\!zpt
- \else
- \ifx \!!override\!blankz
- #3=\!zpt
- \else
- #3=#2\relax
- \fi
- \fi
- \fi
- \ignorespaces}
-\def\!blankz{ z}
-
-\setshadesymbol ({\fiverm .})% ** initialize plotsymbol
-% ** \fivesy ^^B is a small cross
-
-
-% ** \!startvshade [at] (xS,ybS,ytS)
-% ** Initiates vertical shading mode
-\def\!startvshade#1(#2,#3,#4){%
- \let\!!xunit=\!xunit%
- \let\!!yunit=\!yunit%
- \let\!!xshade=\!xshade%
- \let\!!yshade=\!yshade%
- \def\!getshrinkages{\!vgetshrinkages}%
- \let\!setshadelocation=\!vsetshadelocation%
- \!xS=\!M{#2}\!!xunit
- \!ybS=\!M{#3}\!!yunit
- \!ytS=\!M{#4}\!!yunit
- \!shadexorigin=\!xorigin \advance \!shadexorigin \!shadesymbolxshift
- \!shadeyorigin=\!yorigin \advance \!shadeyorigin \!shadesymbolyshift
- \ignorespaces}
-
-% ** \!starthshade [at] (yS,xlS,xrS)
-% ** Initiates horizontal shading mode
-\def\!starthshade#1(#2,#3,#4){%
- \let\!!xunit=\!yunit%
- \let\!!yunit=\!xunit%
- \let\!!xshade=\!yshade%
- \let\!!yshade=\!xshade%
- \def\!getshrinkages{\!hgetshrinkages}%
- \let\!setshadelocation=\!hsetshadelocation%
- \!xS=\!M{#2}\!!xunit
- \!ybS=\!M{#3}\!!yunit
- \!ytS=\!M{#4}\!!yunit
- \!shadexorigin=\!xorigin \advance \!shadexorigin \!shadesymbolxshift
- \!shadeyorigin=\!yorigin \advance \!shadeyorigin \!shadesymbolyshift
- \ignorespaces}
-
-
-% ** \!lattice{ANCHOR}{SPAN}{LOCATION}{INDEX}{LATTICE LOCATION}
-% ** Consider the lattice with points ANCHOR + j*SPAN. This routine determines
-% ** the index k of the smallest lattice point >= LOCATION, and sets
-% ** LATTICE LOCATION = ANCHOR + k*SPAN.
-% ** INDEX is assumed to be a count register, LATTICE LOCATION a dimen reg.
-\def\!lattice#1#2#3#4#5{%
- \!dimenA=#1% ** dimA = ANCHOR
- \!dimenB=#2% ** dimB = SPAN (assumed > 0pt)
- \!countB=\!dimenB% ** ctB = SPAN, as a count
-%
-% ** Determine index of smallest lattice point >= LOCATION
- \!dimenC=#3% ** dimC = LOCATION
- \advance\!dimenC -\!dimenA% ** now dimC = LOCATION-ANCHOR
- \!countA=\!dimenC% ** ctA = above, as a count
- \divide\!countA \!countB% ** now ctA = desired index, if dimC <= 0
- \ifdim\!dimenC>\!zpt
- \!dimenD=\!countA\!dimenB% ** (tentative k)*span
- \ifdim\!dimenD<\!dimenC% ** if this is false, ctA = desired index
- \advance\!countA 1 % ** if true, have to add 1
- \fi
- \fi
-%
- \!dimenC=\!countA\!dimenB% ** lattice location = anchor + ctA*span
- \advance\!dimenC \!dimenA
- #4=\!countA% ** the desired index
- #5=\!dimenC% ** corresponding lattice location
- \ignorespaces}
-
-
-% ** \!qshade [with shrinkages] [[LS,RS,BS,TS]]
-% ***** during vertical shading:
-% ** [the region from (xS,ybS,ytS) to] (xM,ybM,ytM) [and] (xE,ybE,ytE)
-% ** Shades the region {(x,y): xS <= x <= xE, yb(x) <= y <= yt(x)}, where
-% ** yb is the quadratic thru (xS,ybS) & (xM,ybM) & (xE,ybE)
-% ** yt is the quadratic thru (xS,ytS) & (xM,ybM) & (xE,ytE)
-% ** xS,ybS,ytS are either given by \!startvshade or carried over
-% ** as the ending values of the immediately preceding \!qshade.
-% ** For the interpretation of LS, RS, BS, & TS, see \setshadesymbol. The
-% ** values set there can be overridden, for the course of this \!qshade
-% ** only, in the same manner as overrides are specified for
-% ** \setshadesymbol.
-% ***** during horizontal shading:
-% ** [the region from (yS,xlS,xrS) to] (yM,xlM,xrM) [and] (yE,xlE,xrE)
-\def\!qshade#1(#2,#3,#4)#5(#6,#7,#8){%
- \!xM=\!M{#2}\!!xunit
- \!ybM=\!M{#3}\!!yunit
- \!ytM=\!M{#4}\!!yunit
- \!xE=\!M{#6}\!!xunit
- \!ybE=\!M{#7}\!!yunit
- \!ytE=\!M{#8}\!!yunit
- \!getcoeffs\!xS\!ybS\!xM\!ybM\!xE\!ybE\!ybB\!ybC%**Get coefficients B & C for
- \!getcoeffs\!xS\!ytS\!xM\!ytM\!xE\!ytE\!ytB\!ytC%**y=y0 + B(x-X0) + C(x-X0)**2
- \def\!getylimits{\!qgetylimits}%
- \!shade{#1}\ignorespaces}
-
-% ** \!lshade ... (xE,ybE,ytE)
-% ** This is like \!qshade, but the top and bottom boundaries are linear,
-% ** rather than quadratic.
-\def\!lshade#1(#2,#3,#4){%
- \!xE=\!M{#2}\!!xunit
- \!ybE=\!M{#3}\!!yunit
- \!ytE=\!M{#4}\!!yunit
- \!dimenE=\!xE \advance \!dimenE -\!xS% ** xE-xS
- \!dimenC=\!ytE \advance \!dimenC -\!ytS% ** ytE-ytS
- \!divide\!dimenC\!dimenE\!ytB% ** ytB = (ytE-ytS)/(xE-xS)
- \!dimenC=\!ybE \advance \!dimenC -\!ybS% ** ybE-ybS
- \!divide\!dimenC\!dimenE\!ybB% ** ybB = (ybE-ybS)/(xE-xS)
- \def\!getylimits{\!lgetylimits}%
- \!shade{#1}\ignorespaces}
-
-% ** \!getcoeffs{X0}{Y0}{X1}{Y1}{X2}{Y2}{B}{C}
-% ** Finds B and C such that the quadratic y = Y0 + B(x-X0) + C(x-X0)**2
-% ** passes through (X1,Y1) and (X2,Y2): when X0=0=Y0, the formulas are:
-% ** B = S1 - X1*C, C = (S2-S1)/X2
-% ** with
-% ** S1 = Y1/X1, S2 = (Y2-Y1)/(X2-X1).
-\def\!getcoeffs#1#2#3#4#5#6#7#8{%
- \!dimenC=#4\advance \!dimenC -#2% ** dimC=Y1-Y0
- \!dimenE=#3\advance \!dimenE -#1% ** dimE=X1-X0
- \!divide\!dimenC\!dimenE\!dimenF% ** dimF=S1
- \!dimenC=#6\advance \!dimenC -#4% ** dimC=Y2-Y1
- \!dimenH=#5\advance \!dimenH -#3% ** dimH=X2-X1
- \!divide\!dimenC\!dimenH\!dimenG% ** dimG=S2
- \advance\!dimenG -\!dimenF% ** dimG=S2-S1
- \advance \!dimenH \!dimenE% ** dimH=X2-X0
- \!divide\!dimenG\!dimenH#8% ** C=(S2-S1)/(X2-X0)
- \!removept#8\!t% ** C, without "pt"
- #7=-\!t\!dimenE% ** -C*(X1-X0)
- \advance #7\!dimenF% ** B=S1-C*(X1-X0)
- \ignorespaces}
-
-
-\def\!shade#1{%
-% ** Get LS,RS,BS,TS for this panel
- \!getshrinkages#1<,,,>\!nil% % ** now effective LS=dimE, RS=dimF,
-% ** BS=dimG, TS=dimH
- \advance \!dimenE \!xS% ** now dimE=xS+LS
- \!lattice\!!xshade\!dshade\!dimenE% ** set parity=index of left-mst x-lattice
- \!parity\!xpos% ** point >= xS+LS, xpos=its location
- \!dimenF=-\!dimenF% ** set dimF=xE-RS
- \advance\!dimenF \!xE
-%
- \!loop\!not{\ifdim\!xpos>\!dimenF}% ** loop over x-lattice points <= xE-RS
- \!shadecolumn%
- \advance\!xpos \!dshade% ** move over to next column
- \advance\!parity 1% ** increase index of x-point
- \repeat
-%
- \!xS=\!xE% ** shift ending values to starting values
- \!ybS=\!ybE
- \!ytS=\!ytE
- \ignorespaces}
-
-
-\def\!vgetshrinkages#1<#2,#3,#4,#5>#6\!nil{%
- \!override\!lshrinkage{#2}\!dimenE
- \!override\!rshrinkage{#3}\!dimenF
- \!override\!bshrinkage{#4}\!dimenG
- \!override\!tshrinkage{#5}\!dimenH
- \ignorespaces}
-\def\!hgetshrinkages#1<#2,#3,#4,#5>#6\!nil{%
- \!override\!lshrinkage{#2}\!dimenG
- \!override\!rshrinkage{#3}\!dimenH
- \!override\!bshrinkage{#4}\!dimenE
- \!override\!tshrinkage{#5}\!dimenF
- \ignorespaces}
-
-
-\def\!shadecolumn{%
- \!dxpos=\!xpos
- \advance\!dxpos -\!xS% ** dx = x - xS
- \!removept\!dxpos\!dx% ** ditto, without "pt"
- \!getylimits% ** get top and bottom y-values
- \advance\!ytpos -\!dimenH% ** less TS
- \advance\!ybpos \!dimenG% ** plus BS
- \!yloc=\!!yshade% ** get anchor point for this column
- \ifodd\!parity
- \advance\!yloc \!dshade
- \fi
- \!lattice\!yloc{2\!dshade}\!ybpos%
- \!countA\!ypos% ** ypos=smallest y point for this column
- \!dimenA=-\!shadexorigin \advance \!dimenA \!xpos% ** over
- \loop\!not{\ifdim\!ypos>\!ytpos}% ** loop over ypos <= yt(t)
- \!setshadelocation% ** vmode: xloc=xpos, yloc=ypos
-% ** hmode: xloc=ypos, yloc=xpos
- \!rotateaboutpivot\!xloc\!yloc%
- \!dimenA=-\!shadexorigin \advance \!dimenA \!xloc% ** over
- \!dimenB=-\!shadeyorigin \advance \!dimenB \!yloc% ** up
- \kern\!dimenA \raise\!dimenB\copy\!shadesymbol \kern-\!dimenA
- \advance\!ypos 2\!dshade
- \repeat
- \ignorespaces}
-
-\def\!qgetylimits{%
- \!dimenA=\!dx\!ytC
- \advance\!dimenA \!ytB% ** yt(t)=ytS + dx*(Bt + dx*Ct)
- \!ytpos=\!dx\!dimenA
- \advance\!ytpos \!ytS
- \!dimenA=\!dx\!ybC
- \advance\!dimenA \!ybB% ** yb(t)=ybS + dx*(Bb + dx*Cb)
- \!ybpos=\!dx\!dimenA
- \advance\!ybpos \!ybS}
-
-\def\!lgetylimits{%
- \!ytpos=\!dx\!ytB% ** yt(t)=ytS + dx*Bt
- \advance\!ytpos \!ytS
- \!ybpos=\!dx\!ybB% ** yb(t)=ybS + dx*Bb
- \advance\!ybpos \!ybS}
-
-\def\!vsetshadelocation{% ** vmode: xloc=xpos, yloc=ypos
- \!xloc=\!xpos
- \!yloc=\!ypos}
-\def\!hsetshadelocation{% ** hmode: xloc=ypos, yloc=xpos
- \!xloc=\!ypos
- \!yloc=\!xpos}
-
-
-% **************************************
-% *** TICKS (Draws ticks on graphs) ***
-% **************************************
-
-% ** User commands
-% ** \ticksout
-% ** \ticksin
-% ** \gridlines
-% ** \nogridlines
-% ** \loggedticks
-% ** \unloggesticks
-% ** See Subsection 3.4 of the manual
-
-% ** The following is an option of the \axis command
-% ** ticks
-% ** [in] [out]
-% ** [long] [short] [length <LENGTH>]
-% ** [width <WIDTH>]
-% ** [andacross] [butnotacross]
-% ** [logged] [unlogged]
-% ** [unlabeled] [numbered] [withvalues VALUE1 VALUE2 ... VALUEk / ]
-% ** [quantity Q] [at LOC1 LOC2 ... LOCk / ] [from LOC1 to LOC2 by
-% ** LOC_INCREMENT]
-% ** See Subsection 3.2 of the manual for the rules.
-
-% ** The various options of the tick field are processed by the
-% ** \!nextkeyword command defined below.
-% ** For example, `\!nextkeyword short ' expands to `\!ticksshort',
-% ** while `\!nextkeyword withvalues' expands to `\!tickswithvalues'.
-
-\def\!axisticks {%
- \def\!nextkeyword##1 {%
- \expandafter\ifx\csname !ticks##1\endcsname \relax
- \def\!next{\!fixkeyword{##1}}%
- \else
- \def\!next{\csname !ticks##1\endcsname}%
- \fi
- \!next}%
- \!axissetup
- \def\!axissetup{\relax}%
- \edef\!ticksinoutsign{\!ticksinoutSign}%
- \!ticklength=\longticklength
- \!tickwidth=\linethickness
- \!gridlinestatus
- \!setticktransform
- \!maketick
- \!tickcase=0
- \def\!LTlist{}%
- \!nextkeyword}
-
-\def\ticksout{%
- \def\!ticksinoutSign{+}}
-\def\ticksin{%
- \def\!ticksinoutSign{-}}
-\ticksout
-
-\def\gridlines{%
- \def\!gridlinestatus{\!gridlinestootrue}}
-\def\nogridlines{%
- \def\!gridlinestatus{\!gridlinestoofalse}}
-\nogridlines
-
-\def\loggedticks{%
- \def\!setticktransform{\let\!ticktransform=\!logten}}
-\def\unloggedticks{%
- \def\!setticktransform{\let\!ticktransform=\!donothing}}
-\def\!donothing#1#2{\def#2{#1}}
-\unloggedticks
-
-% ** \!ticks/ : terminates read of tick options
-\expandafter\def\csname !ticks/\endcsname{%
- \!not {\ifx \!LTlist\empty}
- \!placetickvalues
- \fi
- \def\!tickvalueslist{}%
- \def\!LTlist{}%
- \expandafter\csname !axis/\endcsname}
-
-\def\!maketick{%
- \setbox\!boxA=\hbox{%
- \beginpicture
- \!setdimenmode
- \setcoordinatesystem point at {\!zpt} {\!zpt}
- \linethickness=\!tickwidth
- \ifdim\!ticklength>\!zpt
- \putrule from {\!zpt} {\!zpt} to
- {\!ticksinoutsign\!tickxsign\!ticklength}
- {\!ticksinoutsign\!tickysign\!ticklength}
- \fi
- \if!gridlinestoo
- \putrule from {\!zpt} {\!zpt} to
- {-\!tickxsign\!xaxislength} {-\!tickysign\!yaxislength}
- \fi
- \endpicturesave <\!Xsave,\!Ysave>}%
- \wd\!boxA=\!zpt}
-
-\def\!ticksin{%
- \def\!ticksinoutsign{-}%
- \!maketick
- \!nextkeyword}
-
-\def\!ticksout{%
- \def\!ticksinoutsign{+}%
- \!maketick
- \!nextkeyword}
-
-\def\!tickslength<#1> {%
- \!ticklength=#1\relax
- \!maketick
- \!nextkeyword}
-
-\def\!tickslong{%
- \!tickslength<\longticklength> }
-
-\def\!ticksshort{%
- \!tickslength<\shortticklength> }
-
-\def\!tickswidth<#1> {%
- \!tickwidth=#1\relax
- \!maketick
- \!nextkeyword}
-
-\def\!ticksandacross{%
- \!gridlinestootrue
- \!maketick
- \!nextkeyword}
-
-\def\!ticksbutnotacross{%
- \!gridlinestoofalse
- \!maketick
- \!nextkeyword}
-
-\def\!tickslogged{%
- \let\!ticktransform=\!logten
- \!nextkeyword}
-
-\def\!ticksunlogged{%
- \let\!ticktransform=\!donothing
- \!nextkeyword}
-
-\def\!ticksunlabeled{%
- \!tickcase=0
- \!nextkeyword}
-
-\def\!ticksnumbered{%
- \!tickcase=1
- \!nextkeyword}
-
-\def\!tickswithvalues#1/ {%
- \edef\!tickvalueslist{#1! /}%
- \!tickcase=2
- \!nextkeyword}
-
-\def\!ticksquantity#1 {%
- \ifnum #1>1
- \!updatetickoffset
- \!countA=#1\relax
- \advance \!countA -1
- \!ticklocationincr=\!axisLength
- \divide \!ticklocationincr \!countA
- \!ticklocation=\!axisstart
- \loop \!not{\ifdim \!ticklocation>\!axisend}
- \!placetick\!ticklocation
- \ifcase\!tickcase
- \relax % Case 0: no labels
- \or
- \relax % Case 1: numbered -- not available here
- \or
- \expandafter\!gettickvaluefrom\!tickvalueslist
- \edef\!tickfield{{\the\!ticklocation}{\!value}}%
- \expandafter\!listaddon\expandafter{\!tickfield}\!LTlist%
- \fi
- \advance \!ticklocation \!ticklocationincr
- \repeat
- \fi
- \!nextkeyword}
-
-\def\!ticksat#1 {%
- \!updatetickoffset
- \edef\!Loc{#1}%
- \if /\!Loc
- \def\next{\!nextkeyword}%
- \else
- \!ticksincommon
- \def\next{\!ticksat}%
- \fi
- \next}
-
-\def\!ticksfrom#1 to #2 by #3 {%
- \!updatetickoffset
- \edef\!arg{#3}%
- \expandafter\!separate\!arg\!nil
- \!scalefactor=1
- \expandafter\!countfigures\!arg/
- \edef\!arg{#1}%
- \!scaleup\!arg by\!scalefactor to\!countE
- \edef\!arg{#2}%
- \!scaleup\!arg by\!scalefactor to\!countF
- \edef\!arg{#3}%
- \!scaleup\!arg by\!scalefactor to\!countG
- \loop \!not{\ifnum\!countE>\!countF}
- \ifnum\!scalefactor=1
- \edef\!Loc{\the\!countE}%
- \else
- \!scaledown\!countE by\!scalefactor to\!Loc
- \fi
- \!ticksincommon
- \advance \!countE \!countG
- \repeat
- \!nextkeyword}
-
-\def\!updatetickoffset{%
- \!dimenA=\!ticksinoutsign\!ticklength
- \ifdim \!dimenA>\!offset
- \!offset=\!dimenA
- \fi}
-
-\def\!placetick#1{%
- \if!xswitch
- \!xpos=#1\relax
- \!ypos=\!axisylevel
- \else
- \!xpos=\!axisxlevel
- \!ypos=#1\relax
- \fi
- \advance\!xpos \!Xsave
- \advance\!ypos \!Ysave
- \kern\!xpos\raise\!ypos\copy\!boxA\kern-\!xpos
- \ignorespaces}
-
-\def\!gettickvaluefrom#1 #2 /{%
- \edef\!value{#1}%
- \edef\!tickvalueslist{#2 /}%
- \ifx \!tickvalueslist\!endtickvaluelist
- \!tickcase=0
- \fi}
-\def\!endtickvaluelist{! /}
-
-\def\!ticksincommon{%
- \!ticktransform\!Loc\!t
- \!ticklocation=\!t\!!unit
- \advance\!ticklocation -\!!origin
- \!placetick\!ticklocation
- \ifcase\!tickcase
- \relax % Case 0: no labels
- \or % Case 1: numbered
- \ifdim\!ticklocation<-\!!origin
- \edef\!Loc{$\!Loc$}%
- \fi
- \edef\!tickfield{{\the\!ticklocation}{\!Loc}}%
- \expandafter\!listaddon\expandafter{\!tickfield}\!LTlist%
- \or % Case 2: labeled
- \expandafter\!gettickvaluefrom\!tickvalueslist
- \edef\!tickfield{{\the\!ticklocation}{\!value}}%
- \expandafter\!listaddon\expandafter{\!tickfield}\!LTlist%
- \fi}
-
-\def\!separate#1\!nil{%
- \!ifnextchar{-}{\!!separate}{\!!!separate}#1\!nil}
-\def\!!separate-#1\!nil{%
- \def\!sign{-}%
- \!!!!separate#1..\!nil}
-\def\!!!separate#1\!nil{%
- \def\!sign{+}%
- \!!!!separate#1..\!nil}
-\def\!!!!separate#1.#2.#3\!nil{%
- \def\!arg{#1}%
- \ifx\!arg\!empty
- \!countA=0
- \else
- \!countA=\!arg
- \fi
- \def\!arg{#2}%
- \ifx\!arg\!empty
- \!countB=0
- \else
- \!countB=\!arg
- \fi}
-
-\def\!countfigures#1{%
- \if #1/%
- \def\!next{\ignorespaces}%
- \else
- \multiply\!scalefactor 10
- \def\!next{\!countfigures}%
- \fi
- \!next}
-
-\def\!scaleup#1by#2to#3{%
- \expandafter\!separate#1\!nil
- \multiply\!countA #2\relax
- \advance\!countA \!countB
- \if -\!sign
- \!countA=-\!countA
- \fi
- #3=\!countA
- \ignorespaces}
-
-\def\!scaledown#1by#2to#3{%
- \!countA=#1\relax% ** get original #
- \ifnum \!countA<0 % ** take abs value,
- \def\!sign{-}% ** remember sign
- \!countA=-\!countA
- \else
- \def\!sign{}%
- \fi
- \!countB=\!countA% ** copy |#|
- \divide\!countB #2\relax% ** integer part (|#|/sf)
- \!countC=\!countB% ** get sf * (|#|/sf)
- \multiply\!countC #2\relax
- \advance \!countA -\!countC% ** ctA is now remainder
- \edef#3{\!sign\the\!countB.}% ** +- integerpart.
- \!countC=\!countA % ** Tack on proper number
- \ifnum\!countC=0 % ** of zeros after .
- \!countC=1
- \fi
- \multiply\!countC 10
- \!loop \ifnum #2>\!countC
- \edef#3{#3\!zero}%
- \multiply\!countC 10
- \repeat
- \edef#3{#3\the\!countA}% ** Add on rest of remainder
- \ignorespaces}
-
-\def\!placetickvalues{%
- \advance\!offset \tickstovaluesleading
- \if!xswitch
- \setbox\!boxA=\hbox{%
- \def\\##1##2{%
- \!dimenput {##2} [B] (##1,\!axisylevel)}%
- \beginpicture
- \!LTlist
- \endpicturesave <\!Xsave,\!Ysave>}%
- \!dimenA=\!axisylevel
- \advance\!dimenA -\!Ysave
- \advance\!dimenA \!tickysign\!offset
- \if -\!tickysign
- \advance\!dimenA -\ht\!boxA
- \else
- \advance\!dimenA \dp\!boxA
- \fi
- \advance\!offset \ht\!boxA
- \advance\!offset \dp\!boxA
- \!dimenput {\box\!boxA} [Bl] <\!Xsave,\!Ysave> (\!zpt,\!dimenA)
- \else
- \setbox\!boxA=\hbox{%
- \def\\##1##2{%
- \!dimenput {##2} [r] (\!axisxlevel,##1)}%
- \beginpicture
- \!LTlist
- \endpicturesave <\!Xsave,\!Ysave>}%
- \!dimenA=\!axisxlevel
- \advance\!dimenA -\!Xsave
- \advance\!dimenA \!tickxsign\!offset
- \if -\!tickxsign
- \advance\!dimenA -\wd\!boxA
- \fi
- \advance\!offset \wd\!boxA
- \!dimenput {\box\!boxA} [Bl] <\!Xsave,\!Ysave> (\!dimenA,\!zpt)
- \fi}
-
-
-\normalgraphs
-
-% \catcode`!=12 % ***** THIS MUST NEVER BE OMITTED
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/thrd-ran.mkii b/Master/texmf-dist/tex/context/base/mkii/thrd-ran.mkii
deleted file mode 100644
index 276a4f6249f..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/thrd-ran.mkii
+++ /dev/null
@@ -1,168 +0,0 @@
-% Since we cannot be sure that this file is available at any
-% system, we have copied the original in this file. These
-% macros are encapsulates and extended in supp-ran.tex.
-%
-% This module is slightly recoded to bring it more in tune
-% with \CONTEXT's scratch registers and protection mechanisms.
-
-% RANDOM.TEX v.1 (Donald Arseneau)
-% Generating "random" numbers in TeX.
-%
-% Random integers are generated in the range 1 to 2147483646 by the
-% macro \nextrandom. The result is returned in the counter \randomi.
-% Do not change \randomi except, perhaps, to initialize it at some
-% random value. If you do not initialize it, it will be initialized
-% using the time and date. (This is a sparse initialization, giving
-% fewer than a million different starting values, but you should use
-% other sources of numbers if they are available--just remember that
-% most of the numbers available to TeX are not at all random.)
-%
-% The \nextrandom command is not very useful by itself, unless you
-% have exactly 2147483646 things to choose from. Much more useful
-% is the \setrannum command which sets a given counter to a random
-% value within a specified range. There are three parameters:
-% \setrannum {<counter>} {<minimum>} {<maximum>}. For example, to
-% simulate a die-roll: \setrannum{\die}{1}{6} \ifcase\die... .
-%
-% If you need random numbers that are not integers, you will have to
-% use dimen registers and \setrandimen. For example, to set a random
-% page width: \setrandimen \hsize{3in}{6.5in}. The "\pointless" macro
-% will remove the "pt" that TeX gives so you can use the dimensions
-% as pure `real' numbers. In that case, specify the range in pt units.
-% For example,
-%
-% \setrandimen\answer{2.71828pt}{3.14159pt}
-% The answer is \pointless\answer.
-%
-% The random number generator is the one by Lewis, Goodman, and Miller
-% (1969) and used as "ran0" in "Numerical Recipies" using Schrage's
-% method for avoiding overflows. The multiplier is 16807 (7^5), the
-% added constant is 0, and the modulus is 2147483647 (2^{31}-1). The
-% range of integers generated is 1 - 2147483646. A smaller range would
-% reduce the complexity of the macros a bit, but not much--most of the
-% code deals with initialization and type-conversion. On the other hand,
-% the large range may be wasted due to the sparse seed initialization.
-
-% original code
-%
-% \newcount\randomi % the random number seed (while executing)
-% \global\randomi\catcode`\@ % scratch variable during definitions
-% \catcode`\@=11
-%
-% \def\nextrandom{\begingroup
-% \ifnum\randomi<\plusone % then initialize with time
-% \global\randomi\time
-% \global\multiply\randomi388 \global\advance\randomi\year
-% \global\multiply\randomi31 \global\advance\randomi\day
-% \global\multiply\randomi97 \global\advance\randomi\month
-% \message{Randomizer initialized to \the\randomi.}%
-% \nextrandom \nextrandom \nextrandom
-% \fi
-% \count@ii\randomi
-% \divide\count@ii 127773 % modulus = multiplier * 127773 + 2836
-% \count@\count@ii
-% \multiply\count@ii 127773
-% \global\advance\randomi-\count@ii % random mod 127773
-% \global\multiply\randomi 16807
-% \multiply\count@ 2836
-% \global\advance\randomi-\count@
-% \ifnum\randomi<\z@ \global\advance\randomi 2147483647\relax\fi
-% \endgroup
-% }
-%
-% \countdef\count@ii=2 % use only in boxes!
-% \ifx\@tempcnta\undefined \csname newcount\endcsname \@tempcnta \fi
-% \ifx\@tempcntb\undefined \csname newcount\endcsname \@tempcntb \fi
-%
-% \def\setrannum#1#2#3{% count register, minimum, maximum
-% \@tempcnta#3\advance\@tempcnta-#2\advance\@tempcnta\@ne
-% \@tempcntb 2147483645 % = m - 2 = 2^{31} - 3
-% \divide\@tempcntb\@tempcnta
-% \getr@nval
-% \advance\ranval#2\relax
-% #1\ranval
-% }
-%
-% \def\setrandim#1#2#3{% dimen register, minimum length, maximum length
-% \dimen@#2\dimen@ii#3\relax
-% \setrannum\ranval\dimen@\dimen@ii
-% #1\ranval sp\relax
-% }
-%
-% \def\getr@nval{% The values in \@tempcnta and \@tempcntb are parameters
-% \nextrandom
-% \ranval\randomi \advance\ranval\m@ne \divide\ranval\@tempcntb
-% \ifnum\ranval<\@tempcnta\else \expandafter\getr@nval \fi
-% }
-%
-% %D The next macro is not needed in \CONTEXT, which provides
-% %D the \type {\withoutpt} macro.
-% %D
-% %D \starttyping
-% %D \def\pointless{\expandafter\PoinTless\the}
-% %D {\catcode`p=12 \catcode`t=12 \gdef\PoinTless#1pt{#1}}
-% %D \stoptyping
-%
-% \catcode`\@=\randomi
-% \global\randomi=0
-% \newcount\ranval
-
-% the recoded version, using \CONTEXT\ methods and variables;
-% the magic is kept untouched
-
-\unprotect
-
-\newcount\randomi % the random number seed (while executing)
-\newcount\ranval
-
-\ifx\m!systems\undefined \def\m!systems{systems} \fi
-
-\def\nextrandom
- {\begingroup
- \ifnum\randomi<\plusone % then initialize with time
- \global\randomi\time
- \global\multiply\randomi388 \global\advance\randomi\year
- \global\multiply\randomi 31 \global\advance\randomi\day
- \global\multiply\randomi 97 \global\advance\randomi\month
- \writestatus\m!systems{randomizer starts with \the\randomi}%
- \nextrandom \nextrandom \nextrandom
- \fi
- \!!countd\randomi
- \divide\!!countd 127773 % modulus = multiplier * 127773 + 2836
- \!!countc\!!countd
- \multiply\!!countd 127773
- \global\advance\randomi-\!!countd % random mod 127773
- \global\multiply\randomi 16807
- \multiply\!!countc 2836
- \global\advance\randomi-\!!countc\relax
- \ifnum\randomi<\zerocount
- \global\advance\randomi 2147483647
- \fi
- \endgroup}
-
-\def\setrannum#1#2#3% count register, minimum, maximum
- {\!!counta#3%
- \advance\!!counta-#2%
- \advance\!!counta\plusone
- \!!countb 2147483645 % = m - 2 = 2^{31} - 3
- \divide\!!countb\!!counta
- \getr@nval
- \advance\ranval#2%
- #1\ranval}
-
-\def\setrandim#1#2#3% dimen register, minimum length, maximum length
- {\!!dimenc#2%
- \!!dimend#3%
- \setrannum\ranval\!!dimenc\!!dimend
- #1\ranval\s!sp\relax} % \s!sp not needed
-
-\def\getr@nval % The values in \!!counta and \!!countb are parameters
- {\nextrandom
- \ranval\randomi
- \advance\ranval\minusone
- \divide\ranval\!!countb
- \ifnum\ranval<\!!counta \else
- \expandafter\getr@nval
- \fi}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/thrd-tab.mkii b/Master/texmf-dist/tex/context/base/mkii/thrd-tab.mkii
deleted file mode 100644
index dd3838ce2d4..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/thrd-tab.mkii
+++ /dev/null
@@ -1,2006 +0,0 @@
-% Since this file is not available in every distribution, we
-% have copied the original in this file. The manuals to
-% Wichura's PiCTeX and TaBlE packages are not available on
-% line and are distributed by respectively the TeX Users Group
-% and Personal TeX Inc. Many macros of TaBlE are overloaded
-% and/or extended in core-tab.tex. The extensions concern
-% splitting over pages, color and consistent spacing.
-
-% We've patched this file for catcode ! because in luatex we use
-% catcode tables and using unprotect/protect is cleaner. Late
-% 2007 we also decided no longer to treat quotes and bars the
-% TaBLe way and instead of messy pushing and popping of catcodes
-% we commented a couple of lines here. We just assume that the
-% template has no active bar and quote. Inside tables we now
-% have the regular meaning of active bars in ConTeXt. More
-% drastic extensions and patched can be found in core-tab.tex.
-
-% TABLE 1.0
-% Copyright Michael J. Wichura August 1988 (patched by Hans Hagen)
-
-% The TABLE macros are divided into sections, roughly according to
-% function:
-
-% Section Name Function
-% a Allocation Allocates storage registers for parameters.
-% f Format Reads format section; builds preamble for \halign;
-% processes \ReFormat command.
-% g Get Value Converts "spec"'s (as in spec_{LT}) to
-% corresponding "values"'s (as in value_{LT}).
-% h Hacks Utility macros; error messages; miscellaneous commands.
-% k Keys Definition and scanning of format keys.
-% n Numeric Macros for TABLE's numeric format.
-% s Struts Macros for struts.
-% t Tables Sets up \halign for table; end-of-row processing;
-% alternate vertical rules; spanning; horizontal
-% lines; stretching and shrinking; repositioning
-% commands.
-
-% The name of each internal macro begins with the prefix "\!t", the
-% "!" having category code 11, followed by the letter of the section
-% in which the macro is defined. For example, a macro beginning "\!th"
-% is defined in Section h (Hacks). There a few exceptions:
-% the general purpose macros "\!ttemp", "\!ttempa", "\!ttempb", and
-% "\!tnext" are repeatedly defined on the spot as the need arises.
-
-% External macros (and active characters) are defined in the following
-% sections:
-% Macro Section
-% " t
-% \- t
-% \= t
-% \ActivateBarAndQuote h
-% \AugmentedTableStrut s
-% \BackSpace h
-% \BeginFormat f
-% \BeginTable t
-% \BeginTableParBox a
-% \Center t
-% \ColumnWidthFactor a
-% \ColumnWidthUnit a
-% \DQuote h
-% \EndFormat k (\EndFormat is actually a key)
-% \EndTable t
-% \EndTableParBox a
-% \Enlarge s
-% \enlarge s
-% \EveryTable a
-% \EveryTableParBox a
-% \Expand t
-% \InterColumnSpaceFactor a
-% \InterColumnSpaceUnit a
-% \JustCenter t
-% \JustLeft t
-% \JustRight t
-% \KernFactor a
-% \KernUnit a
-% \Left t
-% \LeftTabskip a
-% \LineThicknessFactor a
-% \LineThicknessUnit a
-% \LongLines t
-% \Lower h
-% \MakeStrut s
-% \NewFormatKey k
-% \NormalCWU a
-% \NormalICSU a
-% \NormalKU a
-% \NormalLTU a
-% \NormalSU a
-% \NormalTableUnits a
-% \OpenUp s
-% \PseudoVrule t
-% \Raise h
-% \ReadFormatKeys k
-% \ReFormat f
-% \Right t
-% \RightTabskip a
-% \SetTableToWidth t
-% \Smash h
-% \StandardTableStrut s
-% \StrutDepthFactor a
-% \StrutHeightFactor a
-% \StrutUnit a
-% \TaBlE h
-% \TracingFormats a
-% \TracingKeys a
-% \Use t
-% \use t
-% \VBar h
-% \Vspace h
-% \VspaceFactor a
-% \WidenTableBy t
-% \\ t
-% \_ t
-% \| t
-% | t
-% ~ t
-
-\unprotect
-
-% \catcode `\!=11
-% \catcode `\@=11
-
-\newif\ifh@ % normally in plain tex
-\newif\ifv@ % normally in plain tex
-
-% Don't try to read the TABLE macros until after you've read the
-% TABLE manual. The internal documentation of the macros is
-% sketchy; you need the manual to understand what's going on.
-% You should also review the material on \halign s in the TeXbook,
-% since TABLE uses an \halign to perform its alignments.
-
-% In studying the TABLE macros, you should start by skimming the
-% macros in the "miscellaneous hacks", "error messages", and "loops"
-% subsections of Section h, as well as the "\GetValue" macro in
-% Section g; these macros are called many times by the other macros.
-% To continue with a "bottom-up" approach, read next Sections k,
-% f, and t. (Top-downers should reverse the order.) The other
-% Sections can be looked at as the need arises.
-
-% *********************************************************************
-% SECTION A: ALLOCATION
-% *********************************************************************
-
-\let\!tacr=\\ % Save meaning of \\ (Needed if TABLE is used with LaTeX
-
-% *********************************************************************
-% TABLE PARAMETERS: Units
-% *********************************************************************
-
-\newdimen\LineThicknessUnit
-\newdimen\StrutUnit
-\newskip \InterColumnSpaceUnit
-\newdimen\ColumnWidthUnit
-\newdimen\KernUnit
-
-\let\!taLTU=\LineThicknessUnit % Used in preamble
-\let\!taCWU=\ColumnWidthUnit % Used in preamble
-\let\!taKU =\KernUnit % Used in preamble
-
-\newtoks\NormalTLTU
-\newtoks\NormalTSU
-\newtoks\NormalTICSU
-\newtoks\NormalTCWU
-\newtoks\NormalTKU
-
-% NOTE: The user should modify the following DEFAULTS to suit his/her
-% taste, and output device:
-%\def\PixelsPerInch{300}
-\NormalTLTU={1in \divide \LineThicknessUnit by 300 }
-\NormalTSU ={\normalbaselineskip
- \divide \StrutUnit by 11 } % 11 = 8+3 = NormalT Height+Depth Factors
-\NormalTICSU={.5em plus 1fil minus .25em} % .5em = width of a digit
-\NormalTCWU ={.5em}
-\NormalTKU ={.5em}
-
-\def\NormalTableUnits{%
- \LineThicknessUnit =\the\NormalTLTU
- \StrutUnit =\the\NormalTSU
- \InterColumnSpaceUnit=\the\NormalTICSU
- \ColumnWidthUnit =\the\NormalTCWU
- \KernUnit =\the\NormalTKU}
-
-\NormalTableUnits
-
-% The user should issue \NormalTableUnits when setting a table
-% in a different point size, since the Table...Units themselves
-% are static while the Normal...Units vary with the point size.
-
-
-% *********************************************************************
-% TABLE PARAMETERS: Factors
-% *********************************************************************
-
-\newcount\LineThicknessFactor
-\newcount\StrutHeightFactor
-\newcount\StrutDepthFactor
-\newcount\InterColumnSpaceFactor
-\newcount\ColumnWidthFactor
-\newcount\KernFactor
-\newcount\VspaceFactor
-
-% DEFAULTS:
-\LineThicknessFactor =2
-\StrutHeightFactor =8
-\StrutDepthFactor =3
-\InterColumnSpaceFactor =3
-\ColumnWidthFactor =10
-\KernFactor =1
-\VspaceFactor =2
-
-
-% *********************************************************************
-% DIAGNOSTIC PARAMETERS
-% *********************************************************************
-
-\newcount\TracingKeys % >=1 reports new keys, >=2 reports key usage
-\newcount\TracingFormats % >=1 reports templates for columns
- % >=2 reports \halign preamble
-
-
-% *********************************************************************
-% PARBLOCK PARAMETERS
-% *********************************************************************
-
-\def\BeginTableParBox#1{%
- \vtop\bgroup
- \hsize=#1
- \normalbaselines
- \let~=\!ttTie
- \let\-=\!ttDH
- \the\EveryTableParBox}
-
-\def\EndTableParBox{%
- \MakeStrut{0pt}{\StrutDepthFactor\StrutUnit}
- \egroup} % finishes the \vtop begun by \BeginTableParbox
-
-\newtoks\EveryTableParBox
-\EveryTableParBox={%
- \parindent=0pt
- \raggedright
- \rightskip=0pt plus 4em % Provide more stretch
- \relax}
-
-
-% *********************************************************************
-% EVERY TABLE TOKENS
-% *********************************************************************
-
-\newtoks\EveryTable
-\newtoks\!taTableSpread
-
-
-% *********************************************************************
-% Extreme left- and right- tabskips
-% *********************************************************************
-
-\newskip\LeftTabskip
-\newskip\RightTabskip
-
-
-% *********************************************************************
-% INTERNAL VARIABLES
-% *********************************************************************
-
-\newcount\!taCountA
-\newcount\!taColumnNumber
-\newcount\!taRecursionLevel % (Initially 0)
-
-\newdimen\!taDimenA % used by \Enlarge
-\newdimen\!taDimenB % used by \Enlarge
-\newdimen\!taDimenC % used by numeric.tex
-\newdimen\!taMinimumColumnWidth
-
-\newtoks\!taToksA
-
-\newtoks\!taPreamble
-\newtoks\!taDataColumnTemplate
-\newtoks\!taRuleColumnTemplate
-\newtoks\!taOldRuleColumnTemplate
-\newtoks\!taLeftGlue
-\newtoks\!taRightGlue
-
-\newskip\!taLastRegularTabskip
-
-\newif\if!taDigit
-\newif\if!taBeginFormat
-\newif\if!taOnceOnlyTabskip
-
-
-
-% *********************************************************************
-% SECTION H: HACKS
-% *********************************************************************
-
-% ****************************************************************
-% TABLE LOGO
-% ****************************************************************
-\def\TaBlE{%
- T\kern-.27em\lower.5ex\hbox{A}\kern-.18em B\kern-.1em
- \lower.5ex\hbox{L}\kern-.075em E}
-
-
-% ****************************************************************
-% ACTIVE CHARACTERS
-% ****************************************************************
-
-% ACTIVATE BAR AND QUOTE: Makes | and " active if they aren't
-% already active (in which case the user will probably have given
-% them special meanings); definitions are provided which effectively
-% undoes the activeness outside a Table.
-
-{\catcode`\|=13 \catcode`\"=13
- \gdef\ActivateBarAndQuote{%
- \ifnum \catcode`\|=13
- \else
- \catcode`\|=13
- \def|{%
- \ifmmode
- \vert
- \else
- \char`\|
- \fi}%
- \fi
- \ifnum \catcode`\"=13
- \else
- \catcode`\"=13
- \def"{\char`\"}%
- \fi}}
-
-% ****************************************************************
-% Macros for | and " having category code 12.
-% ****************************************************************
-{\catcode `\|=12 \catcode `\"=12
-\gdef\VBar{|}
-\gdef\DQuote{"}}
-
-
-% ****************************************************************
-% MISCELANEOUS HACKS
-% ****************************************************************
-
-% MESSAGE <Message>: Writes out <Message> to terminal and log file.
-\def\!thMessage#1{\immediate\write16{#1}\ignorespaces}
-
-% X: Abbreviation for expandafter
-\let\!thx=\expandafter
-
-% GOBBLE: Eats next token
-\def\!thGobble#1{}
-
-% SPACE TOKEN
-\def\\{\let\!thSpaceToken= }\\
-
-% HEIGHT, DEPTH, AND WIDTH
-\def\!thHeight{height}
-\def\!thDepth{depth}
-\def\!thWidth{width}
-
-% TOKSEDEF <token register>=<replacement text>: Places <replacement
-% text>, fully expanded a la \edef, in the specified <token register>.
-\def\!thToksEdef#1=#2{%
- \edef\!ttemp{#2}%
- #1\!thx{\!ttemp}%
- \ignorespaces}
-
-
-% ****************************************************************
-% ERROR MESSAGES
-% ****************************************************************
-
-% STORE ERROR MSG <Control Sequence> <Message>
-% Replacement text of <Control Sequence> is a macro with Message
-% as its name. E.g., after \StoreErrorMsg\Help{Type <CR>},
-% \Help expands to "\Type <CR>"
-\def\!thStoreErrorMsg#1#2{%
- \toks0 =\!thx{\csname #2\endcsname}%
- \edef#1{\the\toks0 }}
-
-% READ ERROR MSG <Control sequence>
-% Continuing the above example, \ReadErrorMsg\Help produces "Type <CR>"
-\def\!thReadErrorMsg#1{%
- \!thx\!thx\!thx\!thGobble\!thx\string #1}
-
-% ERROR <Error Message> <Error Help>
-\def\!thError#1#2{%
- \begingroup
- \newlinechar=`\^^J%
- \edef\!ttemp{#2}%
- \errhelp=\!thx{\!ttemp}%
- \!thMessage{%
- ^^J\!thReadErrorMsg\!thErrorMsgA
- ^^J\!thReadErrorMsg\!thErrorMsgB}%
- \errmessage{#1}%
- \endgroup}
-
-% TEXT FOR ERROR MESSAGE
-\!thStoreErrorMsg\!thErrorMsgA{%
- TABLE error; see manual for explanation.}
-\!thStoreErrorMsg\!thErrorMsgB{%
- Type \space H <return> \space for immediate help.}
-
-% GET REPLACEMENT <Prompt Message> <Replacement Value>
-% <Replacement Vale> must be a control sequence
-\def\!thGetReplacement#1#2{%
- \begingroup
- \!thMessage{#1}
- \endlinechar=-1
- \global\read16 to#2%
- \endgroup}
-
-
-% ****************************************************************
-% LOOP MACRO
-% ****************************************************************
-
-% LOOP ... REPEAT macro from TUGboat Vol 8 #2: 1987
-% Syntax is like that of plain TeX's \loop ... \repeat macro
-\def\!thLoop#1\repeat{%
- \def\!thIterate{%
- #1%
- \!thx \!thIterate
- \fi}%
- \!thIterate
- \let\!thIterate\relax}
-
-
-% ***************************************************************
-% VERTICALLY-CENTERED SMASH
-% ***************************************************************
-
-% SMASH: Like TeX's \smash, only the argument
-% is centered vertically before its height and depth are smashed to 0pt.
-\def\Smash{%
- \relax
- \ifmmode
- \expandafter\mathpalette
- \expandafter\!thDoMathVCS
- \else
- \expandafter\!thDoVCS
- \fi}
-
-% DO VCS
-\def\!thDoVCS#1{%
- \setbox\zerocount\hbox{#1}%
- \!thFinishVCS}
-
-% DO MATH VCS
-\def\!thDoMathVCS#1#2{%
- \setbox\zerocount\hbox{$\mathsurround\zeropoint#1{#2}$}%
- \!thFinishVCS}
-
-% FINISH VCS
-\def\!thFinishVCS{%
- \vbox to\zeropoint{\vss\box\zerocount\vss}}
-
-
-% ***************************************************************
-% RAISE AND LOWER
-% ***************************************************************
-
-% Like TeX's \raise and \lower, except: (1) The first argument
-% to these commands is a dimension expressed in TABLE's usual conventions;
-% the default is (StrutHeightFactor+StrutDepthFactor)*StrutUnit/2
-% (2) like \smash, these commands function in math mode as well
-% as horizontal mode; (3) again like \smash, the result is declared
-% to have height and depth 0pt
-
-% Examples \Raise2{Stuff}: "Stuff" is raised 2*StrutUnit
-% \Raise {Stuff}: "Stuff" is raised a half-line
-% $\Lower(10pt){\alpha}$: "$\alpha$" is lowered 10 points
-
-% RAISE
-\def\Raise{%
- \def\!thSign{+}%
- \!tgGetValue\!thSetDimen}
-
-% LOWER
-\def\Lower{%
- \def\!thSign{-}%
- \!tgGetValue\!thSetDimen}
-
-% SET DIMEN
-\def\!thSetDimen{%
- \ifnum \!tgCode=1
- \ifx \!tgValue\empty
- \!taDimenA \StrutHeightFactor\StrutUnit
- \advance \!taDimenA \StrutDepthFactor\StrutUnit
- \divide \!taDimenA 2
- \else
- \!taDimenA \!tgValue\StrutUnit
- \fi
- \else
- \!taDimenA \!tgValue
- \fi
- \!taDimenA=\!thSign\!taDimenA\relax
- %
- % BRANCH ON MODE
- \ifmmode
- \expandafter\mathpalette
- \expandafter\!thDoMathRaise
- \else
- \expandafter\!thDoSimpleRaise
- \fi}
-
-% DO SIMPLE RAISE
-\def\!thDoSimpleRaise#1{%
- \setbox\zerocount\hbox{\raise \!taDimenA\hbox{#1}}%
- \!thFinishRaise} % From Plain TeX: \ht0=0pt \dp0=0pt \box0
-
-% DO MATH RAISE
-\def\!thDoMathRaise#1#2{%
- \setbox\zerocount\hbox{\raise \!taDimenA\hbox{$\mathsurround\zeropoint#1{#2}$}}%
- \!thFinishRaise}
-
-% FINISH RAISE. This is the same as Plain's \finsm@sh; some macro
-% packages redefine \finsm@sh.
-\def\!thFinishRaise{%
- \ht\zerocount\zeropoint
- \dp\zerocount\zeropoint
- \box\zerocount}
-
-
-% ***************************************************************
-% BACK SPACE
-% ***************************************************************
-\def\BackSpace{%
- \!tgGetValue\!thKernBack}
-
-\def\!thKernBack{%
- \kern -
- \ifnum \!tgCode=1
- \ifx \!tgValue\empty
- \the\KernFactor
- \else
- \!tgValue % user-specified integer
- \fi
- \KernUnit
- \else
- \!tgValue % user-specified dimension
- \fi
- \ignorespaces}%
-
-
-% ***************************************************************
-% Vspace
-% ***************************************************************
-\def\Vspace{%
- \noalign
- \bgroup
- \!tgGetValue\!thVspace}
-
-\def\!thVspace{%
- \vskip
- \ifnum \!tgCode=1
- \ifx \!tgValue\empty
- \the\VspaceFactor
- \else
- \!tgValue % user-specified integer
- \fi
- \StrutUnit
- \else
- \!tgValue % user-specified skip
- \fi
- \egroup} % Ends the \noalign
-
-% *********************************************************************
-% SECTION F: FORMAT
-% *********************************************************************
-
-% As explained in Section 3.3 of the manual, TABLE alternates each
-% of the user's "data" columns with a "rule" column; moreover, TABLE
-% places a "dummy data" column at the left and right of a table.
-% A table with n nominal data columns therefore actually has a
-% total of
-% n (nominal data columns)
-% +(n+1) (rule columns)
-% + 2 (dummy data columns)
-% ____
-% 2n+3
-% columns.
-
-% FORMATs job is to create an \halign preamble for the alignment
-% of these (2n+3) columns. The preamble consists of templates
-% for the various columns, strung together with &'s and interlaced
-% with \tabskip glue specifications.
-
-% FORMAT constructs the template for a nomimal data column according
-% to the user-specified format keys. As the keys are read from left
-% to right, the template is built up "from the inside out" (as
-% illustrated in Section 3.1.9 of the manual), the inner-most part
-% being the "#" sign. A "|" in the format terminates template
-% building; the completed template is adjoined to preamble along
-% with the template for the following rule column.
-
-% Minimum column widths, if specified, are implemented by creating
-% an "artificial row" with data entries of the form
-% \hskip <minimum column width>.
-% This row has zero height and depth and is completely invisible.
-
-
-% BEGIN FORMAT
-\def\BeginFormat{%
- %catcode`\|=12 % Inhibit expansion if | immediately follows a <number>
- %catcode`\"=12 % read by \getvalue.
- \!taPreamble={}%
- \!taColumnNumber=0
- \skip0 =\InterColumnSpaceUnit
- \multiply\skip0 \InterColumnSpaceFactor
- \divide\skip0 2
- \!taRuleColumnTemplate=\!thx{%
- \!thx\tabskip\the\skip0 }%
- \!taLastRegularTabskip=\skip0
- \!taOnceOnlyTabskipfalse
- \!taBeginFormattrue % Used to intercept key "]"
- \def\!tfRowOfWidths{}% Artificial Table Row with horizontal struts
- % to enforce specified minimum column widths
- \ReadFormatKeys}
-
-% SET (MINIMUM COLUMN) WIDTH: Invoked by the key "w".
-\def\!tfSetWidth{%
- \ifx \!tfRowOfWidths \empty % true if no prior "w" keys
- \ifnum \!taColumnNumber>0 % true if "w" key is to right of first "|"
- \begingroup % RowOfWidths={&\omit || n copies of
- % &\omit&\omit}, where n = number of columns
- \!taCountA=1 % to the left of this one
- \aftergroup \edef \aftergroup \!tfRowOfWidths \aftergroup {%
- \aftergroup &\aftergroup \omit
- \!thLoop
- \ifnum \!taCountA<\!taColumnNumber
- \advance\!taCountA 1
- \aftergroup \!tfAOAO
- \repeat
- \aftergroup }%
- \endgroup
- \fi
- \fi
- \ifx [\!ttemp % \!tgGetValue sets \!ttemp = token after w
- \!thx\!tfSetWidthText
- \else
- \!thx\!tfSetWidthValue
- \fi}
-
-% AOAO = (Apersand Omit Ampersand Omit)
-\def\!tfAOAO{%
- &\omit&\omit}
-
-% SET WIDTH TEXT
-\def\!tfSetWidthText [#1]{% #1 = specified text
- \def\!tfWidthText{#1}%
- \ReadFormatKeys}
-
-% SET WIDTH VALUE
-\def\!tfSetWidthValue{%
- \!taMinimumColumnWidth =
- \ifnum \!tgCode=1
- \ifx\!tgValue\empty % Use default multiplier if user didn't specify one
- \ColumnWidthFactor
- \else
- \!tgValue
- \fi
- \ColumnWidthUnit
- \else
- \!tgValue
- \fi
- \def\!tfWidthText{}% Override possible prior `w[sample entry]'
- \ReadFormatKeys}
-
-
-% SET TABSKIP: Invoked by the tabskip keys "t" and "o"
-\def\!tfSetTabskip{%
- \ifnum \!tgCode=1
- \skip0 =\InterColumnSpaceUnit
- \multiply\skip0
- \ifx \!tgValue\empty
- \InterColumnSpaceFactor % Default integer
- \else
- \!tgValue % User-specified integer
- \fi
- \else
- \skip0 =\!tgValue % User-specified <skip>
- \fi
- \divide\skip0 by 2
- \ifnum\!taColumnNumber=0
- \!thToksEdef\!taRuleColumnTemplate={%
- \the\!taRuleColumnTemplate
- \tabskip \the\skip0 }
- \else
- \!thToksEdef\!taDataColumnTemplate={%
- \the\!taDataColumnTemplate
- \tabskip \the\skip0 }
- \fi
- \if!taOnceOnlyTabskip
- % % Tabskip used at right of this col only
- \else
- \!taLastRegularTabskip=\skip0 % Remember this Tabskip, for possible
- \fi % restoration after a subsequent"OnceOnly"
- \ReadFormatKeys}
-
-
-% SET VRULE: Invoked by the key "|"
-\def\!tfSetVrule{%
- \!thToksEdef\!taRuleColumnTemplate={%
- \noexpand\hfil
- \noexpand\vrule
- \noexpand\!thWidth
- \ifnum \!tgCode=1
- \ifx \!tgValue\empty
- \the\LineThicknessFactor % Default integer
- \else
- \!tgValue % User-specified integer
- \fi
- \!taLTU % \LineThicknessUnit
- \else
- \!tgValue % User-specified dimension
- \fi
- ####%
- \noexpand\hfil
- \the\!taRuleColumnTemplate} % has \tabskips, when column number=0
- \!tfAdjoinPriorColumn}
-
-% SET ALTERNATE VRULE: Invoked by the key "\|", in the form
-% \|{<template for (rule) column>}. The "{" and "}" are mandatory,
-% and the <template for column> must contain a "#". The key system
-% CAN'T be used to set up this template. The <template> can have the
-% form "\span\macro".
-\def\!tfSetAlternateVrule{%
- \afterassignment\!tfSetAlternateA
- \toks0 =} % Put template into \toks0
-
-\def\!tfSetAlternateA{%
- \!thToksEdef\!taRuleColumnTemplate={%
- \the\toks0 \the\!taRuleColumnTemplate} % RCT may have \tabskips
- \!tfAdjoinPriorColumn}
-
-% ADJOIN PRIOR COLUMN
-\def\!tfAdjoinPriorColumn{%
- \ifnum \!taColumnNumber=0
- \!taPreamble=\!taRuleColumnTemplate % New \tabskip may have been added
- \ifnum \TracingFormats>0
- \!tfShowRuleTemplate
- \fi
- \else
- \ifx\!tfRowOfWidths\empty % no "w" keys specified yet, not even this col
- \else
- \!tfUpdateRowOfWidths
- \fi
- % Adjoin positioning glues to left and right of template
- \!thToksEdef\!taDataColumnTemplate={%
- \the \!taLeftGlue
- \the \!taDataColumnTemplate
- \the \!taRightGlue}
- \ifnum \TracingFormats>0
- \!tfShowTemplates
- \fi
- % Adjoin data- and rule-column templates to preamble
- \!thToksEdef\!taPreamble={%
- \the\!taPreamble
- &
- \the\!taDataColumnTemplate
- &
- \the\!taRuleColumnTemplate}
- \fi
-%
-% START NEW COLUMN
- \advance \!taColumnNumber 1
- % Initialize data-column template, restoring last "regular" tabskip
- % after a "once only" tabskip
- \if!taOnceOnlyTabskip
- \!thToksEdef\!taDataColumnTemplate={%
- ####\tabskip \the\!taLastRegularTabskip}
- \else
- \!taDataColumnTemplate{##}%
- \fi
- % Remaining initializations
- \!taRuleColumnTemplate{}% # is inserted by \SetVrule, or \SetAlternateVrule
- \!taLeftGlue{\hfil}% % Default positioning is "center"
- \!taRightGlue{\hfil}%
- \!taMinimumColumnWidth=0pt
- \def\!tfWidthText{}%
- \!taOnceOnlyTabskipfalse % Set true by key "o"
- \ReadFormatKeys}
-
-% UPDATE ROW OF WIDTHS
-\def\!tfUpdateRowOfWidths{%
- % If user had a "w[<Text>]" key, set <Text> according to the
- % template for this column, and find the width of the result
- \ifx \!tfWidthText\empty
- \else % set specified text according to current template & find width
- \!tfComputeMinColWidth
- \fi
- \edef\!tfRowOfWidths{%
- \!tfRowOfWidths
- &%
- \omit % Data Column
- \ifdim \!taMinimumColumnWidth>0pt
- \hskip \the\!taMinimumColumnWidth
- \fi
- &
- \omit}} % Rule Column
-
-% COMPUTE MINIMUM COLUMN WIDTH (from specified WidthText)
-\def\!tfComputeMinColWidth{%
- \setbox0 =\vbox{%
- \ialign{% Plain's initialized \halign; \tabskip=0pt \everycr={}
- \span\the\!taDataColumnTemplate\cr
- \!tfWidthText\cr}}%
- \!taMinimumColumnWidth=\wd0 }
-
-% SHOW (INITIAL) RULE TEMPLATE
-\def\!tfShowRuleTemplate{%
- \!thMessage{}
- \!thMessage{TABLE FORMAT}
- \!thMessage{Column: Template}
- \!thMessage{%
- \space *c: ##\tabskip \the\LeftTabskip}
- \!taOldRuleColumnTemplate=\!taRuleColumnTemplate}
-
-% SHOW TEMPLATES
-\def\!tfShowTemplates{%
- \!thMessage{%
- \space \space r: \the\!taOldRuleColumnTemplate}
- \!taOldRuleColumnTemplate=\!taRuleColumnTemplate
- \!thMessage{%
- \ifnum \!taColumnNumber<10
- \space
- \fi
- \the\!taColumnNumber c: \the\!taDataColumnTemplate}
- \ifdim\!taMinimumColumnWidth>0pt
- \!thMessage{%
- \space \space w: \the\!taMinimumColumnWidth}
- \fi}
-
-
-% FINISH UP: Invoked by the keys "." and \EndFormat
-\def\!tfFinishFormat{%
- \ifnum \TracingFormats>0
- \!thMessage{%
- \space \space r: \the\!taOldRuleColumnTemplate
- \tabskip \the\RightTabskip}%
- \!thMessage{%
- \space *c: ##\tabskip 0pt}
- \fi
- \ifnum \!taColumnNumber<2
- \!thError{%
- \ifnum \!taColumnNumber=0
- No
- \else
- Only 1
- \fi
- "|"}%
- {\!thReadErrorMsg\!tfTooFewBarsA
- ^^J\!thReadErrorMsg\!tfTooFewBarsB
- ^^J\!thReadErrorMsg\!tkFixIt}%
- \fi
- \!thToksEdef\!taPreamble={%
- ####\tabskip\LeftTabskip
- &
- \the\!taPreamble \tabskip\RightTabskip
- &
- ####\tabskip 0pt \cr}
- \ifnum \TracingFormats>1
- \!thMessage{Preamble=\the\!taPreamble}
- \fi
- \ifnum \TracingFormats>2
- \!thMessage{Row Of Widths="\!tfRowOfWidths"}
- \fi
- \!taBeginFormatfalse % Intercepts "|", tabskips, and "."
- %\catcode`\|=13
- %\catcode`\"=13
- \!ttDoHalign}
-
-% ERROR MESSAGE FOR NOT ENOUGH "|"'s
-\!thStoreErrorMsg\!tfTooFewBarsA{%
- There must be at least 2 "\string|"'s (and/or "\string \|"'s)}
-\!thStoreErrorMsg\!tfTooFewBarsB{%
- between \string\BeginFormat\space and \string\EndFormat\space (or ".").}
-
-
-% REFORMAT [<key letters>]{<text>}: Formats <text> according to
-% <key letters>. Used to override the template for a column,
-% or columns when used after \use.
-\def\ReFormat[#1]{%
- \omit
- \!taDataColumnTemplate{##}%
- \!taLeftGlue{}%
- \!taRightGlue{}%
- %\catcode`\|=12 % Inhibit expansion if | immediately follows a <number>
- %\catcode`\"=12 % read by \getvalue. Actually, '|' and '"' shouldn't
- \begingroup
- \@@useotherbar
- \@@useotherquote
- \expanded{\endgroup\noexpand\ReadFormatKeys#1]}}% appear in a \ReFormat cmd; this is here as a safeguard.
-
-% END REFORMAT: Invoked by the key "]"
-\def\!tfEndReFormat{%
- \ifnum \TracingFormats>0
- \!thMessage{ReF:
- \the\!taLeftGlue
- \hbox{\the\!taDataColumnTemplate}% White lie
- \the\!taRightGlue}
- \fi
- %\catcode`\|=13
- %\catcode`\"=13
- \!tfReFormat}
-
-\def\!tfReFormat#1{%
- \the \!taLeftGlue
- \vbox{%
- \ialign{%
- \span\the\!taDataColumnTemplate\cr
- #1\cr}}%
- \the \!taRightGlue}
-
-
-
-% *********************************************************************
-% SECTION G: GET VALUE
-% *********************************************************************
-
-% GET_VALUE{<return macro>}<tokens> functions as follows:
-
-% If <tokens> has the form <(stuff)>, then
-% code=2 and value=<stuff>
-
-% Otherwise <tokens> has the form <DDDXYZ> where <DDD> denotes (a possibly
-% empty) string of consecutive digits (0,1,2,...,9) terminated by the first
-% character <X> (possibly a blank) that is not a digit. In this case
-% code=1 and value=<DDD> (= <null>, if <DDD> is non-empty).
-
-% Examples: Code Value
-% "\GetValue{\macro} 3" 1 null
-% "\GetValue{\macro}A " 1 null
-% "\GetValue{\macro}1 " 1 1
-% "\GetValue{\macro}25A" 1 25
-% "\GetValue{\macro}25012 " 1 25012
-% "\GetValue{\macro}(10pt)" 2 10pt
-% "\GetValue{\macro}(1in)" 2 1in
-% "\GetValue{\macro} (1in)" 1 null
-
-
-% GET_VALUE{<macro to execute after value is found>}
-\def\!tgGetValue#1{%
- \def\!tgReturn{#1}% Set return
- \futurelet\!ttemp\!tgCheckForParen}% Now \!ttemp is the token
- % immediately after {}
-
-% CHECK_PAREN: See if \!ttemp is a (
-\def\!tgCheckForParen{%
- \ifx\!ttemp (%
- \!thx \!tgDoParen
- \else
- \!thx \!tgCheckForSpace
- \fi}
-
-% DO_PAREN: Set code to 2, value to stuff inside ( )'s
-\def\!tgDoParen(#1){%
- \def\!tgCode{2}%
- \def\!tgValue{#1}% NOTE #1 MUST BE A LEGITIMATE VALUE
- \!tgReturn}
-
-% CHECK_SPACE: See if \!ttemp is a <blank space>
-\def\!tgCheckForSpace{%
- \def\!tgCode{1}%
- \def\!tgValue{}% Initialize value to <null>
- \ifx\!ttemp\!thSpaceToken
- \!thx \!tgReturn % <blank space> means no value was specified
- \else
- \!thx \!tgCheckForDigit
- \fi}
-
-% CHECK_DIGIT: \!ttemp is not a <blank space>; if its a digit (0,1,...,9)
-% get the <number> starting with that digit.
-\def\!tgCheckForDigit{%
- \!taDigitfalse
- \ifx 0\!ttemp
- \!taDigittrue
- \else
- \ifx 1\!ttemp
- \!taDigittrue
- \else
- \ifx 2\!ttemp
- \!taDigittrue
- \else
- \ifx 3\!ttemp
- \!taDigittrue
- \else
- \ifx 4\!ttemp
- \!taDigittrue
- \else
- \ifx 5\!ttemp
- \!taDigittrue
- \else
- \ifx 6\!ttemp
- \!taDigittrue
- \else
- \ifx 7\!ttemp
- \!taDigittrue
- \else
- \ifx 8\!ttemp
- \!taDigittrue
- \else
- \ifx 9\!ttemp
- \!taDigittrue
- \fi
- \fi
- \fi
- \fi
- \fi
- \fi
- \fi
- \fi
- \fi
- \fi
- \if!taDigit
- \!thx \!tgGetNumber
- \else
- \!thx \!tgReturn
- \fi}
-
-% GET_NUMBER
-\def\!tgGetNumber{%
- \afterassignment\!tgGetNumberA
- \!taCountA=}
-\def\!tgGetNumberA{%
- \edef\!tgValue{\the\!taCountA}%
- \!tgReturn}
-
-
-% ********************************************************************
-% MISCELANEOUS "RETURNS" FROM \getvalue
-% ********************************************************************
-
-% SET UP PAR BOX: Puts \BeginTableParBox{<user-specified \hsize>}
-% to the left of "#" and \EndTableParBox to the right of "#".
-\def\!tgSetUpParBox{%
- \edef\!ttemp{%
- \noexpand \ReadFormatKeys
- b{\noexpand \BeginTableParBox{%
- \ifnum \!tgCode=1
- \ifx \!tgValue\empty
- \the\ColumnWidthFactor
- \else
- \!tgValue % user-specified integer
- \fi
- \!taCWU % \ColumnWidthUnit
- \else
- \!tgValue % user-specified dimension
- \fi}}}%
- \!ttemp
- a{\EndTableParBox}}
-
-% SET KERNS
-\def\!tgInsertKern{%
- \edef\!ttemp{%
- \kern
- \ifnum \!tgCode=1
- \ifx \!tgValue\empty
- \the\KernFactor
- \else
- \!tgValue % user-specified integer
- \fi
- \!taKU % \KernUnit
- \else
- \!tgValue % user-specified dimension
- \fi}%
- \edef\!ttemp{%
- \noexpand\ReadFormatKeys
- \ifh@ % true if kern goes to left of "#"
- b{\!ttemp}
- \fi
- \ifv@ % true if kern goes to right of "#"
- a{\!ttemp}
- \fi}%
- \!ttemp}
-
-% *********************************************************************
-% SECTION K: KEYS
-% *********************************************************************
-
-% ****************************************************************
-% DEFINING NEW KEYS
-% ****************************************************************
-
-% NEW FORMAT KEY <Key Letter>: Must be followed by
-% <Parameter Text> <Replacement Text>
-% Sets up a new key letter command by expanding (essentially) to
-% \expandafter \def \csname !tk<Key Letter>\endcsname
-% <Parameter Text>{<Replacement Text>}
-% A warning message is issued if <Key Letter> is already in use.
-\def\NewFormatKey#1{%
- \!thx\def\!thx\!ttempa\!thx{\string #1}%
- \!thx\def\!thx\!ttempb\!thx{\csname !tk<\!ttempa>\endcsname}%
- \ifnum \TracingKeys>0
- \!tkReportNewKey
- \fi
- \!thx\ifx \!ttempb \relax
- \!thx\!tkDefineKey
- \else
- \!thx\!tkRejectKey
- \fi}
-
-% REPORT NEW KEY
-\def\!tkReportNewKey{%
- \!taToksA\!thx{\!ttempa}%
- \!thMessage{NEW KEY: "\the\!taToksA"}}
-
-% DEFINE KEY
-\def\!tkDefineKey{%
- \!thx\def\!ttempb}%
-
-% DUPLICATE KEY
-\def\!tkRejectKey{%
- \!taToksA\!thx{\!ttempa}%
- \!thError{Key letter "\the\!taToksA" already used}
- {\!thReadErrorMsg\!tkFixIt}
- \def\!tkGarbage}%
-
-% ERROR MESSAGE FOR DUPLICATE KEY
-\!thStoreErrorMsg\!tkFixIt{%
- You'd better type \space 'E' \space and fix your file.}
-
-
-% ****************************************************************
-% READING FORMAT KEYS
-% ****************************************************************
-
-% READ FORMAT KEYS
-\def\ReadFormatKeys#1{%
- \!thx\def\!thx\!ttempa\!thx{\string #1}%
- \!thx\def\!thx\!ttempb\!thx{\csname !tk<\!ttempa>\endcsname}%
- \ifnum \TracingKeys>1
- \!tkReportKey
- \fi
- \!thx\ifx \!ttempb\relax
- \!thx\!tkReplaceKey
- \else
- \!thx\!ttempb
- \fi}
-
-% REPORT KEY
-\def\!tkReportKey{%
- \!taToksA\!thx{\!ttempa}%
- \!thMessage{KEY: "\the\!taToksA"}}
-
-% REPLACE KEY
-\def\!tkReplaceKey{%
- \!taToksA\!thx{\!ttempa}%
- \!thError {Undefined format key "\the\!taToksA"}
- {\!thReadErrorMsg\!tkUndefined ^^J\!thReadErrorMsg\!tkBadKey}
- \!tkReplaceKeyA}
-
-\def\!tkReplaceKeyA{%
- \!thGetReplacement{\!thReadErrorMsg\!tkReplace}\!tkReplacement
- \!thx\ReadFormatKeys\!tkReplacement}
-
-% ERROR MESSAGES FOR KEY RELACEMENT
-\!thStoreErrorMsg\!tkUndefined{%
- The format key in " "'s on the next to top line is undefined.}
-\!thStoreErrorMsg\!tkBadKey{%
- Type \space E \space to quit now, or
- \space<CR> \space and respond to next prompt.}
-\!thStoreErrorMsg\!tkReplace{%
- Type \space<replacement key><CR> \space,
- or simply \space<CR> \space to skip offending key:}
-
-
-% ****************************************************************
-% PRIMITIVE KEYS
-% ****************************************************************
-
-% Key "b": b{TOKENS} adds TOKENS to the left of (before) the template
-\NewFormatKey b#1{%
- \!thx\!tkJoin\!thx{\the\!taDataColumnTemplate}{#1}%
- \ReadFormatKeys}
-
-\def\!tkJoin#1#2{%
- \!taDataColumnTemplate{#2#1}}%
-
-% Key "a": a{TOKENS} adds TOKENS to the right of (after) the template
-\NewFormatKey a#1{%
- \!taDataColumnTemplate\!thx{\the\!taDataColumnTemplate #1}%
- \ReadFormatKeys}
-
-% Key "\{": Enclose template in braces.
-\NewFormatKey \{{%
- \!taDataColumnTemplate=\!thx{\!thx{\the\!taDataColumnTemplate}}%
- \ReadFormatKeys}
-
-% Key "*": "*{N}{KEY LETTERS}" is equivalent to specifying
-% <KEY LETTERS> N times.
-% KEY LETTERS may contain further * specifications
-\NewFormatKey *#1#2{%
- \!taCountA=#1\relax
- \!taToksA={}%
- \!thLoop
- \ifnum \!taCountA > 0
- \!taToksA\!thx{\the\!taToksA #2}%
- \advance\!taCountA -1
- \repeat
- \!thx\ReadFormatKeys\the\!taToksA}
-
-
-% ****************************************************************
-% POSITIONING KEYS
-% ****************************************************************
-
-% Key "\LeftGlue": Specifies the glue (usually \hfil, or nothing) to be
-% added to extreme left of the template to position a column
-\NewFormatKey \LeftGlue#1{%
- \!taLeftGlue{#1}%
- \ReadFormatKeys}
-
-% Key "\RightGlue": Specifies the glue (usually \hfil, or nothing) to be
-% added to the extreme right of the template to position a column
-\NewFormatKey \RightGlue#1{%
- \!taRightGlue{#1}%
- \ReadFormatKeys}
-
-% Key "c": Centered column.
-\NewFormatKey c{%
- \ReadFormatKeys
- \LeftGlue\hfil
- \RightGlue\hfil}
-
-% Key "l": Left-adjusted column.
-\NewFormatKey l{%
- \ReadFormatKeys
- \LeftGlue{} % In case more than one positioning key is specified.
- \RightGlue\hfil}
-
-% Key "r": Right-adjusted column.
-\NewFormatKey r{%
- \ReadFormatKeys
- \LeftGlue\hfil
- \RightGlue{}}
-
-% Key "k": Adds kerns to left and right of "#"
-% This key and the two below use Plain TeX's \if@h as if it were \if@left,
-% and \if@v as if it were \if@right. Table making goes on in a group,
-% so even in the unlikely circumstance that a \phantom is currently under
-% construction, there's no problem.
-\NewFormatKey k{%
- \h@true
- \v@true
- \!tgGetValue{\!tgInsertKern}}
-
-% Key "i": Adds a kern to the left of "#"
-\NewFormatKey i{%
- \h@true
- \v@false
- \!tgGetValue{\!tgInsertKern}}
-
-% Key "j": Adds a kern to the right of "#"
-\NewFormatKey j{%
- \h@false
- \v@true
- \!tgGetValue{\!tgInsertKern}}
-
-
-% ****************************************************************
-% NUMERIC ITEM KEYS
-% ****************************************************************
-
-% Key "n": numeric item , non-math mode.
-\NewFormatKey n{%
- \def\!tnStyle{}%
- \futurelet\!tnext\!tnTestForBracket}
-
-% Key "N": numeric item, math mode.
-\NewFormatKey N{%
- \def\!tnStyle{$}%
- \futurelet\!tnext\!tnTestForBracket}
-
-
-% ****************************************************************
-% ATTRIBUTE KEYS
-% ****************************************************************
-
-% Key "m": Math mode.
-\NewFormatKey m{%
- \ReadFormatKeys b$ a$}
-
-% Key "M": Displaymath mode.
-\NewFormatKey M{%
- \ReadFormatKeys \{ b{$\displaystyle} a$}
-
-% Key "\m": Template ${}#\hfil$
-\NewFormatKey \m{%
- \ReadFormatKeys l b{{}} m}
-
-% Key "\M": Template $\displaystyle{{}#\hfil}$
-\NewFormatKey \M{%
- \ReadFormatKeys l b{{}} M}
-
-% Key "f": Set font (E.g., f\it sets up italic font (assuming \it
-% has its usual meaning)
-\NewFormatKey f#1{%
- \ReadFormatKeys b{#1}}
-
-% Key "B": abbreviation for f\bf
-\NewFormatKey B{%
- \ReadFormatKeys f\bf}
-
-% Key "I": abbreviation for f\it
-\NewFormatKey I{%
- \ReadFormatKeys f\it}
-
-% Key "S": abbreviation for f\sl
-\NewFormatKey S{%
- \ReadFormatKeys f\sl}
-
-% Key "R": abbreviation for f\rm
-\NewFormatKey R{%
- \ReadFormatKeys f\rm}
-
-% Key "T": abbreviation for f\tt
-\NewFormatKey T{%
- \ReadFormatKeys f\tt}
-
-% Key "p": ParBox
-\NewFormatKey p{%
- \!tgGetValue{\!tgSetUpParBox}}
-
-
-% ****************************************************************
-% MINIMUM COLUMN WIDTH KEY
-% ****************************************************************
-
-% Key "w": minimum column width
-\NewFormatKey w{%
- \!tkTestForBeginFormat w{\!tgGetValue{\!tfSetWidth}}}
-
-
-% ****************************************************************
-% TABSKIP KEYS
-% ****************************************************************
-
-% Key "s": Set tabskip for the inter-column space to the right
-% of the current column, and all subsequent spaces, until overriden
-% by a new "s" or "o" key.
-\NewFormatKey s{%
- \!taOnceOnlyTabskipfalse % in case same column has a prior "o" key
- \!tkTestForBeginFormat t{\!tgGetValue{\!tfSetTabskip}}}
-
-% Key "o": Apply the \tabskip stated for this column ONLY to the
-% inter-column space just to the right of this column; restore the
-% the previous \tabskip for subsequent columns.
-\NewFormatKey o{%
- \!taOnceOnlyTabskiptrue
- \!tkTestForBeginFormat o{\!tgGetValue{\!tfSetTabskip}}}
-
-
-% ****************************************************************
-% RULE KEYS
-% ****************************************************************
-
-% Key "|": Standard rule column designator
-\NewFormatKey |{%
- \!tkTestForBeginFormat |{\!tgGetValue{\!tfSetVrule}}}
-
-% Key "\|": Non-standard rule column designator
-\NewFormatKey \|{%
- \!tkTestForBeginFormat \|{\!tfSetAlternateVrule}}
-
-
-% ****************************************************************
-% END-OF-FORMAT KEYS
-% ****************************************************************
-
-% Key ".": PERIOD -- end of \BeginFormat section.
-\NewFormatKey .{%
- \!tkTestForBeginFormat.{\!tfFinishFormat}}
-
-% Key "\EndFormat": Equivalent to "."
-\NewFormatKey \EndFormat{%
- \!tkTestForBeginFormat\EndFormat{\!tfFinishFormat}}
-
-% Key "]": End of \ReFormat section
-\NewFormatKey ]{%
- \!tkTestForReFormat ] \!tfEndReFormat}
-
-
-% ****************************************************************
-% VALIDITY CHECKS
-% ****************************************************************
-
-% TEST FOR BEGIN FORMAT{<Key>}{Intended Action}: This test is run
-% on keys that can only be used by \BeginFormat --- "s", "o",
-% "|", "\|", "w", ".", and "\EndFormat".
-\def\!tkTestForBeginFormat#1#2{%
- \if!taBeginFormat
- \def\!ttemp{#2}%
- \!thx \!ttemp
- \else
- \toks0={#1}%
- \toks2=\!thx{\string\ReFormat}%
- \!thx \!tkImproperUse
- \fi}
-
-% TEST FOR RE FORMAT{<Key>}{Intended Action}: This test is run
-% on the key "]", which can only be used by \ReFormat.
-\def\!tkTestForReFormat#1#2{%
- \if!taBeginFormat
- \toks0={#1}%
- \toks2=\!thx{\string\BeginFormat}%
- \!thx \!tkImproperUse
- \else
- \def\!ttemp{#2}%
- \!thx \!ttemp
- \fi}
-
-% IMPROPER USE OF KEY
-\def\!tkImproperUse{%
- \!thError{\!thReadErrorMsg\!tkBadUseA "\the\toks0 "}%
- {\!thReadErrorMsg\!tkBadUseB \the\toks2 \space command.
- ^^J\!thReadErrorMsg\!tkBadKey}%
- \!tkReplaceKeyA}
-
-% ERROR MESSAGES FOR IMPROPER USE OF KEY
-\!thStoreErrorMsg\!tkBadUseA{Improper use of key }
-\!thStoreErrorMsg\!tkBadUseB{%
- The key mentioned above can't be used in a }
-
-
-
-% *********************************************************************
-% SECTION n: NUMERIC
-% *********************************************************************
-
-% NOTE: THE SPACE BETWEEN A NUMERIC ENTRY AND THE FOLLOWING '|', '"',
-% OR '\|' IS MANDATORY.
-% EMPTY NUMERIC ENTRIES ARE NOT ALLOWED: USE '{}' OR '\omit' INSTEAD.
-
-% TEST FOR BRACKET: Invoked by the keys "n" and "N".
-\def\!tnTestForBracket{%
- \ifx [\!tnext
- \!thx\!tnGetArgument
- \else
- \!thx\!tnGetCode
- \fi}
-
-% GET CODE: E.g. "4", or "4.0", "0.4", or "10.2"
-\def\!tnGetCode#1 {% NOTE THE BLANK
- \!tnConvertCode #1..!}
-
-% CONVERT CODE: E.g. converts above to [0000], [0000.], [.0000],
-% [0000000000.00]
-\def\!tnConvertCode #1.#2.#3!{%
- \begingroup
- \aftergroup\edef \aftergroup\!ttemp \aftergroup{%
- \aftergroup[%
- \!taCountA #1
- \!thLoop
- \ifnum \!taCountA>0
- \advance\!taCountA -1
- \aftergroup0
- \repeat
- \def\!ttemp{#3}%
- \ifx\!ttemp \empty
- \else
- \aftergroup.
- \!taCountA #2
- \!thLoop
- \ifnum \!taCountA>0
- \advance\!taCountA -1
- \aftergroup0
- \repeat
- \fi
- \aftergroup]\aftergroup}%
- \endgroup\relax
- \!thx\!tnGetArgument\!ttemp}
-
-% GET ARGUMENT: [<sample left field> <optional .<sample right field>>
-\def\!tnGetArgument[#1]{%
- \!tnMakeNumericTemplate\!tnStyle#1..!}
-
-% MAKE NUMERIC TEMPLATE
-\def\!tnMakeNumericTemplate#1#2.#3.#4!{% #1=<empty> or $
- \def\!ttemp{#4}%
- \ifx\!ttemp\empty
- \!taDimenC=0pt
- \else
- \setbox0=\hbox{\mathsurround\zeropoint #1.#3#1}%
- \!taDimenC=\wd0
- \fi
- \setbox0 =\hbox{\mathsurround\zeropoint #1#2#1}%
- \!thToksEdef\!taDataColumnTemplate={%
- \noexpand\!tnSetNumericItem
- {\the\wd0 }%
- {\the\!taDimenC}%
- {#1}%
- \the\!taDataColumnTemplate} % Might have tabskip glue in here
- \ReadFormatKeys}
-
-% SET NUMERIC ITEM
-\def\!tnSetNumericItem #1#2#3#4 {% NOTE THE BLANK
- \!tnSetNumericItemA {#1}{#2}{#3}#4..!}
-
-\def\!tnSetNumericItemA #1#2#3#4.#5.#6!{%
- \def\!ttemp{#6}%
- \hbox to #1{\hss \mathsurround\zeropoint #3#4#3}%
- \hbox to #2{%
- \ifx\!ttemp\empty
- \else
- \mathsurround\zeropoint #3.#5#3%
- \fi
- \hss}}
-
-
-
-% *********************************************************************
-% SECTION S: STRUTS
-% *********************************************************************
-
-% The following are in ALLOCATIONS
- %\newdimen\StrutUnit (normal value \normalbaselineskip / 11)
- %\newcount\StrutHeightFactor (normal value 8)
- %\newcount\StrutDepthFactor (normal value 3)
-
-% MAKE STRUT OF SPECIFIED HEIGHT AND DIMENSION
-% \MakeStrut <height><depth>; height and depth are <dimen>'s
-\def\MakeStrut#1#2{%
- \vrule width0pt height #1 depth #2}
-
-% STANDARD VERTICAL STRUT
-% Makes a strut of height=StrutHeightFactor*StrutUnit
-% depth =StrutDepthFactor *StrutUnit
-\def\StandardTableStrut{%
- \MakeStrut{\StrutHeightFactor\StrutUnit}
- {\StrutDepthFactor\StrutUnit}}
-
-
-% STANDARD VERTICAL STRUT, WITH EXTRA HEIGHT/DEPTH
-% \AugmentedTableStrut<multiple for extra height><multiple for extra depth>
-% makes a strut of height=(StrutHeightFactor+#1)*StrutUnit
-% depth =(StrutDepthFactor+#2)*StrutUnit
-\def\AugmentedTableStrut#1#2{%
- \dimen@=\StrutHeightFactor\StrutUnit
- \advance\dimen@ #1\StrutUnit
- \dimen@ii=\StrutDepthFactor\StrutUnit
- \advance\dimen@ii #2\StrutUnit
- \MakeStrut{\dimen@}{\dimen@ii}}
-
-
-% ENLARGE<extra height><extra depth><original>
-% Enlarges "original" by extra height and extra depth.
-% Extra height and extra depth are <dimen>'s.
-% Works for various math styles, and takes into account
-% \spacefactor in horizontal mode
-\def\Enlarge#1#2{% 3rd argument is picked up later
- % #1=extra height
- % #2=extra depth
- \!taDimenA=#1\relax
- \!taDimenB=#2\relax
- \let\!TsSpaceFactor=\empty
- \ifmmode
- \!thx \mathpalette
- \!thx \!TsEnlargeMath
- \else
- \!thx \!TsEnlargeOther
- \fi}
-
-\def\!TsEnlargeOther#1{%
- \ifhmode
- \setbox\zerocount\hbox{#1%
- \xdef\!TsSpaceFactor{\spacefactor=\the\spacefactor}}%
- \else
- \setbox\zerocount\hbox{#1}%
- \fi
- \!TsFinishEnlarge}
-
-\def\!TsEnlargeMath#1#2{%
- \setbox\zerocount\hbox{$\mathsurround\zeropoint#1{#2}$}%
- \!TsFinishEnlarge}
-
-\def\!TsFinishEnlarge{%
- \dimen@\ht\zerocount
- \advance \dimen@ \!taDimenA
- \ht\zerocount\dimen@
- \dimen@\dp\zerocount
- \advance \dimen@ \!taDimenB
- \dp\zerocount\dimen@
- \box\zerocount \!TsSpaceFactor{}}
-
-
-% ENLARGE BY MULTIPLES OF StrutUnit
-% \enlarge<multiple for extra height><multiple for extra depth><original>
-% Enlarges by (multiple for extra height)*StrutUnit
-% and (multiple for extra depth) *StrutUnit
-\def\enlarge#1#2{% 3rd argument is picked up later
- \Enlarge{#1\StrutUnit}{#2\StrutUnit}}
-
-
-% OPENUP#1#2: increases strut height and depth factors by #1 and #2.
-\def\OpenUp#1#2{%
- \advance \StrutHeightFactor #1\relax
- \advance \StrutDepthFactor #2\relax}
-
-
-
-% *********************************************************************
-% SECTION T: TABLES
-% *********************************************************************
-
-% Table-making is initiated by \BeginTable. After processing that
-% command, TeX absorbs the instructions in the prologue to the table
-% until it gets to \BeginFormat. \BeginFormat sets up the preamble
-% for the \halign that will be used to create the table. \EndFormat
-% initiates the \halign-ment, which is terminated by \EndTable.
-
-
-% *********************************************************************
-% BEGIN TABLE, (DO HALIGN), END TABLE
-% *********************************************************************
-% BEGIN TABLE
-\def\BeginTable{%
- \futurelet\!tnext\!ttBeginTable}
-
-\def\!ttBeginTable{%
- \ifx [\!tnext
- \def\!tnext{\!ttBeginTableA}%
- \else
- \def\!tnext{\!ttBeginTableA[c]}%
- \fi
- \!tnext}
-
-\def\!ttBeginTableA[#1]{%
- \if #1u% % "unboxed" table
- \ifmmode
- \def\!ttEndTable{% % user had better be in display math mode
- \relax}% % and have only one table at the outer level
- \else % user had better be in vertical mode
- \bgroup
- \def\!ttEndTable{%
- \egroup}%
- \fi
- \else
- \hbox\bgroup $
- \def\!ttEndTable{%
- \egroup % for the \vtop, \vbox, or \vcenter, yet to come
- $% for math mode
- \egroup}% for the \hbox
- \if #1t%
- \vtop
- \else
- \if #1b%
- \vbox
- \else
- \vcenter % math mode was essential for this
- \fi
- \fi
- \bgroup % for the \vtop, \vbox, or \vcenter
- \fi
- \advance\!taRecursionLevel 1 % RecursionLevel governs initialization
- \let\!ttRightGlue=\relax % This may be changed by \JustCenter, etc
- \everycr={}
- \ifnum \!taRecursionLevel=1
- \!ttInitializeTable
- \fi}
-
-% INITIALIZE TABLE
-% \bgroup
-% \catcode`\|=13
-% \catcode`\"=13
-% \catcode`\~=13
-% \gdef\!ttInitializeTable{%
-% \let\!ttTie=~ % Meanings of ~ and \- are
-% \let\!ttDH=\- % restored by \BeginTableParBox
-% \catcode`\|=\active
-% \catcode`\"=\active
-% \catcode`\~=\active
-% \def |{\unskip\!ttRightGlue&&}% Use rule-column template
-% \def\|{\unskip\!ttRightGlue&\omit\!ttAlternateVrule}%
-% % Override rule-column template
-% \def"{\unskip\!ttRightGlue&\omit&}% Omit rule-column template
-% \def~{\kern .5em}% ~ now has the width of a digit
-% \def\\{\!ttEndOfRow}%
-% \def\-{\!ttShortHrule}%
-% \def\={\!ttLongHrule}%
-% \def\_{\!ttFullHrule}%
-% \def\Left##1{##1\hfill\null}% \null prevents \unskip from
-% \def\Center##1{\hfill##1\hfill\null}% killing the \hfill
-% \def\Right##1{\hfill##1}%
-% \def\use{\!ttuse}%
-% \def\Use{\!ttUse}%
-% \the\EveryTable}
-% \egroup
-
-\bgroup
- %catcode`\|=13
- %catcode`\"=13
- \catcode`\~=13
- \gdef\!ttInitializeTable{%
- \let\!ttTie=~ %
- \let\!ttDH=\- %
- %catcode`\|=\active
- %catcode`\"=\active
- \catcode`\~=\active
- %def |{\unskip\!ttRightGlue&&}%
- %def\|{\unskip\!ttRightGlue&\omit\!ttAlternateVrule}%
- %def"{\unskip\!ttRightGlue&\omit&}%
- \def~{\kern .5em}%
- %def\\{\!ttEndOfRow}%
- \def\\{\par}
- %def\-{\!ttShortHrule}%
- %def\={\!ttLongHrule}%
- %def\_{\!ttFullHrule}%
- \def\Left ##1{##1\hfill\null}% % \null prevents \unskip from
- \def\Center##1{\hfill##1\hfill\null}% % killing the \hfill
- \def\Right ##1{\hfill##1}%
- \def\use{\!ttuse}%
- \def\Use{\!ttUse}%
- \the\EveryTable}% comes too soon
-\egroup
-
-\let\!ttRightGlue=\relax % This may be changed, in a group, by
- % \JustCenter, etc
-
-% DO HALIGN: Invoked by END FORMAT (or the key ".")
-\def\!ttDoHalign{%
- \baselineskip=0pt \lineskiplimit=0pt \lineskip=0pt %
- \tabskip=0pt
- \halign \the\!taTableSpread \bgroup
- \span\the\!taPreamble
- \ifx \!tfRowOfWidths \empty
- \else
- \!tfRowOfWidths \cr %
- \fi}
-
-% END TABLE
-\def\EndTable{%
- \egroup % finishes the \halign
- \!ttEndTable}% closes off the table envirnoment set up by \BeginTable
-
-
-% *********************************************************************
-% END OF ROW PROCESSING
-% *********************************************************************
-
-% END OF ROW: When followed by
-% 0, inserts no strut
-% +, inserts an AugmentedTableStrut (with <x-height> and <x-depth>
-% as arguments
-% anything else, inserts a StandardTableStrut,
-% and finished off the row with a \cr.
-\def\!ttEndOfRow{%
- \futurelet\!tnext\!ttTestForBlank}
-
-% TEST FOR BLANK
-\def\!ttTestForBlank{%
-% \!thMessage{At Test For Blank: \meaning\!tnext}
- \ifx \!tnext\!thSpaceToken % the "usual" case
- \!thx\!ttDoStandard
- \else
- \!thx\!ttTestForZero
- \fi}
-
-% TEST FOR ZERO
-\def\!ttTestForZero{%
- \ifx 0\!tnext
- \!thx \!ttDoZero
- \else
- \!thx \!ttTestForPlus
- \fi}
-
-% TEST FOR PLUS
-\def\!ttTestForPlus{%
- \ifx +\!tnext
- \!thx \!ttDoPlus
- \else
- \!thx \!ttDoStandard
- \fi}
-
-% DO ZERO: No strut
-\def\!ttDoZero#1{% #1 eats the 0
- \cr}
-
-% DO PLUS: Insert "Extra" strut; #2=extra height, #3=extra depth, both
-% as integers (units of \StrutUnit)
-\def\!ttDoPlus#1#2#3{% #1 eats the +
- \AugmentedTableStrut{#2}{#3}%
- \cr}
-
-% DO STANDARD: Insert standard table strut
-\def\!ttDoStandard{%
- \StandardTableStrut
- \cr}
-
-
-% *********************************************************************
-% ALTERNATE VRULES
-% *********************************************************************
-
-% A '\|' can appear in a rule-column in place of a '|', '"', or '&'.
-
-% If '\|' is immediately followed by a blank, a string of digits, or
-% (...) [... had better be a <dimen>], a \vrule is placed in the
-% rule column; the thickness of the \vrule follows TABLE's usual
-% conventions. Be sure to put a blank after a string of digits.
-
-% If '\|' is immediately followed by a '*', a user-specified default
-% "pseudo"-rule is placed in the rule column. This P.R. is specified
-% by the parameterless macro \PseudoVrule. For example,
-% to place a "double rule" into a rule column, you could make the definition
-% \def\PseudoVrule{\hfil\vrule \hskip1pt \vrule\hfil}
-
-% If none of the above cases applies, a non-space token follows '\|':
-% that token is placed in the rule-column. To put a '*' in a
-% rule-column, enter '\|{*}'. '\|\PseudoVrule' has the same effect
-% as '\|*'.
-
-% ALTERNATE VRULE
-\def\!ttAlternateVrule{%
- \!tgGetValue{\!ttAVTestForCode}} % AV == Alternate Vrule
-
-% TEST FOR CODE (2)
-\def\!ttAVTestForCode{%
- \ifnum \!tgCode=2 % (...) follows "\|"
- \!thx\!ttInsertVrule % \InsertVrule ends with "&"
- \else
- \!thx\!ttAVTestForEmpty
- \fi}
-
-% TEST FOR EMPTY (VALUE)
-\def\!ttAVTestForEmpty{%
- \ifx \!tgValue\empty % non-digit after "\|"
- \!thx\!ttAVTestForBlank
- \else
- \!thx\!ttInsertVrule % integer after "\|"
- \fi}
-
-% TEST FOR BLANK
-\def\!ttAVTestForBlank{%
- \ifx \!ttemp\!thSpaceToken % blank after "\|"
- \!thx\!ttInsertVrule
- \else
- \!thx\!ttAVTestForStar
- \fi}
-
-% TEST FOR STAR
-\def\!ttAVTestForStar{%
- \ifx *\!ttemp % "*" after "\|"
- \!thx\!ttInsertDefaultPR % PR == pseudo-rule
- \else
- \!thx\!ttGetPseudoVrule % "Anything else" after "\|"
- \fi}
-
-% INSERT VRULE
-\def\!ttInsertVrule{%
- \hfil
- \vrule \!thWidth
- \ifnum \!tgCode=1
- \ifx \!tgValue\empty
- \LineThicknessFactor
- \else
- \!tgValue
- \fi
- \LineThicknessUnit
- \else
- \!tgValue
- \fi
- \hfil
- &}
-
-% INSERT DEFAULT PSEUDO-RULE
-\def\!ttInsertDefaultPR*{%
- \PseudoVrule % User-specified default pseudo-rule
- &}
-
-% GET PSEUDO-RULE
-\def\!ttGetPseudoVrule#1{%
- \toks0={#1}%
- #1&}
-
-% DEFAULT PSEUDO-RULE
-\def\PseudoVrule{}
-
-
-% *********************************************************************
-% USE: Version of \multispan for rule-&-column tables
-% *********************************************************************
-
-% USE
-% \use <number> spans the next <number> data columns.
-
-\def\!ttuse#1{%
- \ifnum #1>\plusone
- \omit
- \mscount=#1 % \mscount is in Plain
- \advance\mscount by \minusone
- \advance\mscount by \mscount
- \!thLoop
- \ifnum\mscount>\plusone
- % \sp@n: from plain
- \spanomit \advance\mscount\minusone
- \repeat
- \span
- \fi}
-
-\def\!ttUse#1[{%
- \!ttuse{#1}%
- \ReFormat[}
-
-
-% *********************************************************************
-% HRULES
-% *********************************************************************
-
-% FULL HORIZONTAL RULE: Draws a rule across the table,
-% using \noalign{\hrule}
-\def\!ttFullHrule{%
- \noalign
- \bgroup
- \!tgGetValue{\!ttFullHruleA}}
-
-\def\!ttFullHruleA{%
- \!ttGetHalfRuleThickness % Sets \dimen0 to half of specified thickness
- \hrule \!thHeight \dimen0 \!thDepth \dimen0
- \penalty0 % so can break an ``unboxed'' table after a horizontal rule.
- \egroup} % ends the \noalign
-
-% SHORT HORIZONTAL RULE: Draws a rule across 1 (or more) columns,
-% using \leaders; this rule doesn't extend across the neighboring
-% tabskip glues to join up with adjacent rule columns. By contrast
-% the LONG HORIZONTAL RULE below does just that.
-\def\!ttShortHrule{%
- \omit
- \!tgGetValue{\!ttShortHruleA}}
-
-\def\!ttShortHruleA{%
- \!ttGetHalfRuleThickness % Sets \dimen0 to half of specified thickness
- \leaders \hrule \!thHeight \dimen0 \!thDepth \dimen0 \hfill
- \null % prevents an \unskip from annihilating the \leaders
- \ignorespaces}
-
-% LONG HORIZONTAL RULE: This rule requires special coding.
-% It must be preceded and followed by '&', instead of the usual
-% '|' or '"'. However, '\_' can follow '\use' in the usual manner.
-% And in fact, to insert long-rules in two or more contiguous columns,
-% '\use' MUST be used with an argument = total number of columns involved.
-\def\!ttLongHrule{%
- \omit\span\omit\span \!ttShortHrule}
-
-% GET RULE THICKNESS
-\def\!ttGetHalfRuleThickness{%
- \dimen0 =
- \ifnum \!tgCode=1
- \ifx \!tgValue\empty
- \LineThicknessFactor
- \else
- \!tgValue % user-specified integer
- \fi
- \LineThicknessUnit
- \else
- \!tgValue % user-specified dimension
- \fi
- \divide\dimen0 2 }
-
-
-% *********************************************************************
-% STRETCHING AND SHRINKING A TABLE
-% *********************************************************************
-
-% SET TABLE TO WIDTH <dimen>
-\def\SetTableToWidth#1{%
- \!taTableSpread={to #1}}
-
-% WIDEN TABLE BY <dimen>
-\def\WidenTableBy#1{%
- \ifdim #1=0pt
- \!taTableSpread={}%
- \else
- \!taTableSpread={spread #1}%
- \fi}
-
-\def\Expand{%
- \SetTableToWidth{\hsize}}%
-
-\def\LongLines{%
- \LeftTabskip =0pt plus 1fill
- \RightTabskip=\LeftTabskip
- \Expand}
-
-
-% *********************************************************************
-% REPOSITIONING COMMANDS (\JUSTLEFT, etc.)
-% *********************************************************************
-
-\def\JustLeft{%
- \omit \let\!ttRightGlue=\hfill}
-\def\JustCenter{%
- \omit \hfill\null \let\!ttRightGlue=\hfill}
-\def\JustRight{%
- \omit \hfill\null}
-
-
-% *********************************************************************
-% Restore meaning of \\, and reset category codes
-% *********************************************************************
-\let\\=\!tacr
-
-% \catcode`\!=12
-% \catcode`\@=12
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/thrd-trg.mkii b/Master/texmf-dist/tex/context/base/mkii/thrd-trg.mkii
deleted file mode 100644
index c0106f5a3f1..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/thrd-trg.mkii
+++ /dev/null
@@ -1,127 +0,0 @@
-%D In order to support rotation over arbitrary angles, we need a sine
-%D and cosine calculator. For this purpose we borrow a few macros by
-%D David Carlisle (his trig package). Because local variables are
-%D used, I patched the macros a bit. Also, I used a few different names
-%D for variabels and macros and use existing auxiliary macros.
-
-\unprotect
-
-% compare: \number 0.5 \number -0.5 \number 1.5 \number -1.5
-%
-% so we need:
-
-\def\realnumber#1{\withoutpt\the\dimexpr#1\points\relax} % brrr
-
-\chardef \@iv = 4
-\chardef \@xc = 90 % was \nin@ty
-\chardef \@clxx = 180
-\chardef \@lxxi = 71
-\mathchardef \@mmmmlxviii = 4068
-\mathchardef \@xvi@k = 16384
-
-\chardef \tr@coeffz = 72
-\chardef \tr@coefb = 42
-\mathchardef \tr@coefc = 840
-\mathchardef \tr@coefd = 5040
-
-\def\tg@series
- {\!!dimena\@lxxi\!!dimena
- \divide\!!dimena\@mmmmlxviii
- \edef\!!stringa{\withoutpt\the\!!dimena}%
- \!!dimena\!!stringa\!!dimena
- \edef\!!stringb{\withoutpt\the\!!dimena}%
- \divide\!!dimena\tr@coeffz
- \advance\!!dimena\minusone\onepoint
- \!!dimena\!!stringb\!!dimena
- \advance\!!dimena \tr@coefb\onepoint
- \!!dimena\!!stringb\!!dimena
- \advance\!!dimena -\tr@coefc\onepoint
- \!!dimena\!!stringb\!!dimena
- \advance\!!dimena \tr@coefd\onepoint
- \!!dimena\!!stringa\!!dimena
- \divide\!!dimena \tr@coefd}
-
-\def\tg@reduce#1#2%
- {\!!dimena#1#2\@xc\onepoint
- \advance\!!dimena#2-\@clxx\onepoint
- \!!dimena-\!!dimena
- \tg@@sin}
-
-\def\tg@@sin
- {\ifdim\tg@reduce>+\else\ifdim\tg@reduce<-\else
- \tg@series
- \fi\fi}
-
-%D Calculating a sine is a two step process: first a value is
-%D calculated, and afterwards it can be used. This saves redundant
-%D calculations.
-
-\def\calculatesin#1%
- {{\expandafter\ifx\csname sin \realnumber{#1}\endcsname\relax
- \!!dimena#1\onepoint
- \tg@@sin
- \expandafter\xdef\csname sin \realnumber{#1}\endcsname{\withoutpt\the\!!dimena}%
- \fi}}
-
-\def\calculatecos#1%
- {{\expandafter\ifx\csname cos \realnumber{#1}\endcsname\relax
- \!!dimena\@xc\onepoint
- \advance\!!dimena-#1\onepoint
- \tg@@sin
- \expandafter\xdef\csname cos \realnumber{#1}\endcsname{\withoutpt\the\!!dimena}%
- \fi}}
-
-\def\calculatetan#1%
- {{\expandafter\ifx\csname tan \realnumber{#1}\endcsname\relax
- \calculatesin{#1}%
- \calculatecos{#1}%
- \!!dimena\calculatedcos{#1}\onepoint
- \divide\!!dimena\@iv
- \!!dimenb\calculatedsin{#1}\onepoint
- \!!dimenb\@xvi@k\!!dimenb
- \divide\!!dimenb\!!dimena
- \expandafter\xdef\csname tan \realnumber{#1}\endcsname{\withoutpt\the\!!dimenb}%
- \fi}}
-
-%D The results are accessed with:
-
-\def\calculatedsin#1{\csname sin \realnumber{#1}\endcsname}
-\def\calculatedcos#1{\csname cos \realnumber{#1}\endcsname}
-\def\calculatedtan#1{\csname tan \realnumber{#1}\endcsname}
-
-%D A more save implementation would be:
-
-\def\calculatedsin#1{\executeifdefined{sin \realnumber{#1}}\!!zerocount}
-\def\calculatedcos#1{\executeifdefined{cos \realnumber{#1}}\!!plusone }
-\def\calculatedtan#1{\executeifdefined{tan \realnumber{#1}}\!!zerocount}
-
-%D The following permits cleaner overloading (\MKIV\ will only have
-%D these):
-
-\def\setcalculatedsin#1#2{\calculatesin{#2}\edef#1{\calculatedsin{#2}}}
-\def\setcalculatedcos#1#2{\calculatecos{#2}\edef#1{\calculatedcos{#2}}}
-\def\setcalculatedtan#1#2{\calculatetan{#2}\edef#1{\calculatedtan{#2}}}
-
-%D A few values are predefined, although, on todays systems there
-%D is no real reason for that. I've added the 270 ones and changed
-%D the -90 tan. Also, I prefer text (\type {\!!..} instead of
-%D counters \type {\..}.
-
-\expandafter\let\csname sin \realnumber{ 0}\endcsname\!!zerocount
-\expandafter\let\csname cos \realnumber{ 0}\endcsname\!!plusone
-\expandafter\let\csname sin \realnumber{ 90}\endcsname\!!plusone
-\expandafter\let\csname cos \realnumber{ 90}\endcsname\!!zerocount
-\expandafter\let\csname sin \realnumber{180}\endcsname\!!zerocount
-\expandafter\let\csname cos \realnumber{180}\endcsname\!!minusone
-\expandafter\let\csname sin \realnumber{270}\endcsname\!!minusone
-\expandafter\let\csname cos \realnumber{270}\endcsname\!!zerocount
-
-\expandafter\let\csname sin \realnumber{-90}\endcsname\!!minusone
-\expandafter\let\csname cos \realnumber{-90}\endcsname\!!zerocount
-
-\expandafter\def\csname tan \realnumber{ 90}\endcsname{\writestatus\m!systems{infinite tan +90}}
-\expandafter\def\csname tan \realnumber{-90}\endcsname{\writestatus\m!systems{infinite tan -90}}
-
-%D Usage: \type {\calculatesin{10}} and \type {\calculatedsin{10}}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/trac-vis.mkii b/Master/texmf-dist/tex/context/base/mkii/trac-vis.mkii
deleted file mode 100644
index be7a204ec1d..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/trac-vis.mkii
+++ /dev/null
@@ -1,748 +0,0 @@
-%D \module
-%D [ file=trac-vis, % was core-vis,
-%D version=1996.06.01,
-%D title=\CONTEXT\ Tracking Macros,
-%D subtitle=Visualization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 module adds some more visualization cues to the ones
-%D supplied in the support module.
-%D
-%D %\everypar dual character, \the\everypar and \everypar=
-%D %\hrule cannot be grabbed in advance, switches mode
-%D %\vrule cannot be grabbed in advance, switches mode
-%D %
-%D %\indent only explicit ones
-%D %\noindent only explicit ones
-%D %\par only explicit ones
-%D
-%D %\leftskip only if explicit one
-%D %\rightskip only if explicit one
-
-\writestatus{loading}{ConTeXt Tracking Macros / Visualization}
-
-\unprotect
-
-%D \macros
-%D {indent, noindent, par}
-%D
-%D \TeX\ acts upon paragraphs. In mosts documents paragraphs
-%D are separated by empty lines, which internally are handled as
-%D \type{\par}. Paragraphs can be indented or not, depending on
-%D the setting of \type{\parindent}, the first token of a
-%D paragraph and/or user suppressed or forced indentation.
-%D
-%D Because the actual typesetting is based on both explicit
-%D user and implicit system actions, visualization is only
-%D possible for the user supplied \type{\indent},
-%D \type{\noindent}, and \type{\par}. Other
-%D 'clever' tricks will quite certainly lead to more failures
-%D than successes, so we only support these three explicit
-%D primitives and one macro:
-
-\def\showparagraphcue#1#2#3#4#5%
- {\bgroup
- \scratchdimen#1\relax
- \dontinterfere
- \dontcomplain
- \boxrulewidth5\testrulewidth
- #3#4\relax
- \setbox\scratchbox\normalhbox to \scratchdimen
- {#2{\ruledhbox to \scratchdimen
- {\vrule #5 20\testrulewidth \!!width \zeropoint
- \normalhss}}}%
- \smashbox\scratchbox
- \normalpenalty\!!tenthousand
- \box\scratchbox
- \egroup}
-
-\def\ruledhanging
- {\ifdim\hangindent>\zeropoint
- \ifnum\hangafter<\zerocount
- \normalhbox
- {\boxrulewidth5\testrulewidth
- \setbox\scratchbox\ruledhbox to \hangindent
- {\scratchdimen\strutht
- \advance\scratchdimen \strutdp
- \vrule
- \!!width \zeropoint
- \!!height \zeropoint
- \!!depth -\hangafter\scratchdimen}%
- \normalhskip-\hangindent
- \smashbox\scratchbox
- \raise\strutht\box\scratchbox}%
- \fi
- \fi}
-
-\def\ruledparagraphcues
- {\bgroup
- \dontcomplain
- \normalhbox to \zeropoint
- {\ifdim\leftskip>\zeropoint\relax
- \showparagraphcue\leftskip\llap\relax\relax\!!depth
- \normalhskip-\leftskip
- \fi
- \ruledhanging
- \normalhskip\hsize
- \ifdim\rightskip>\zeropoint\relax
- \normalhskip-\rightskip
- \showparagraphcue\rightskip\relax\relax\relax\!!depth
- \fi}%
- \egroup}
-
-\def\ruledpar
- {\relax
- \ifhmode
- \showparagraphcue{40\testrulewidth}\relax\rightrulefalse\relax\!!height
- \fi
- \normalpar}
-
-\def\rulednoindent
- {\relax
- \normalnoindent
- \ruledparagraphcues
- \showparagraphcue{40\testrulewidth}\llap\leftrulefalse\relax\!!height}
-
-\def\ruledindent
- {\relax
- \normalnoindent
- \ruledparagraphcues
- \ifdim\parindent>\zeropoint
- \showparagraphcue\parindent\relax\relax\relax\!!height
- \else
- \showparagraphcue{40\testrulewidth}\llap\relax\relax\!!height
- \fi
- \normalhskip\parindent}
-
-\def\dontshowimplicits
- {\let\noindent \normalnoindent
- \let\indent \normalindent
- \let\par \normalpar}
-
-\def\showimplicits
- {\testrulewidth \defaulttestrulewidth
- \let\noindent \rulednoindent
- \let\indent \ruledindent
- \let\par \ruledpar}
-
-%D The next few||line examples show the four cues. Keep in
-%D mind that we only see them when we explicitly open or close
-%D a paragraph.
-%D
-%D \bgroup
-%D \def\voorbeeld#1%
-%D {#1Visualizing some \TeX\ primitives and Plain \TeX\
-%D macros can be very instructive, at least it is to me.
-%D Here we see {\tt\string#1} and {\tt\string\ruledpar} in
-%D action, while {\tt\string\parindent} equals
-%D {\tt\the\parindent}.\ruledpar}
-%D
-%D \showimplicits
-%D
-%D \voorbeeld \indent
-%D \voorbeeld \noindent
-%D
-%D \parindent=60pt
-%D
-%D \voorbeeld \indent
-%D \voorbeeld \noindent
-%D
-%D \startnarrower
-%D \voorbeeld \indent
-%D \voorbeeld \noindent
-%D \stopnarrower
-%D \egroup
-%D
-%D These examples also demonstrate the visualization of
-%D \type {\leftskip} and \type {\rightskip}. The macro
-%D \type {\nofruledbaselines} determines the number of lines
-%D shown.
-
-\newcounter\ruledbaselines
-
-\def\nofruledbaselines{3}
-
-\def\debuggertext#1%
- {\ifx\ttxx\undefined
- $\scriptscriptstyle#1$%
- \else
- {\ttxx#1}%
- \fi}
-
-\def\ruledbaseline
- {\vrule \!!width \zeropoint
- \bgroup
- \dontinterfere
- \doglobal\increment\ruledbaselines
- \scratchdimen\nofruledbaselines\baselineskip
- \setbox\scratchbox\normalvbox to 2\scratchdimen
- {\leaders
- \normalhbox
- {\strut
- \vrule
- \!!height \testrulewidth
- \!!depth \testrulewidth
- \!!width 120\points}
- \normalvfill}%
- \smashbox\scratchbox
- \advance\scratchdimen \strutheightfactor\baselineskip
- \setbox\scratchbox\normalhbox
- {\normalhskip -48\points
- \normalhbox to 24\points
- {\normalhss\debuggertext\ruledbaselines\normalhskip6\points}%
- \raise\scratchdimen\box\scratchbox}%
- \smashbox\scratchbox
- \box\scratchbox
- \egroup}
-
-\def\showbaselines
- {\testrulewidth\defaulttestrulewidth
- \EveryPar{\ruledbaseline}}
-
-%D \macros
-%D {showpagebuilder}
-%D
-%D The next tracing option probaly is only of use to me and a
-%D few \CONTEXT\ hackers.
-
-\def\showpagebuilder
- {\EveryPar{\doshowpagebuilder}}
-
-\def\doshowpagebuilder
- {\strut\llap
- {\startcolor[blue]\vl
- \high{\infofont v:\the\vsize }\vl
- \high{\infofont g:\the\pagegoal }\vl
- \high{\infofont t:\the\pagetotal}\vl
- \stopcolor}}
-
-%D \macros
-%D {makecutbox, cuthbox, cutvbox, cutvtop}
-%D
-%D Although mainly used for marking the page, these macros can
-%D also serve local use.
-%D
-%D \startbuffer
-%D \setbox0=\vbox{a real \crlf vertical box} \makecutbox0
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D This marked \type{\vbox} shows up as:
-%D
-%D \startlinecorrection
-%D \getbuffer
-%D \stoplinecorrection
-%D
-%D The alternative macros are used as:
-%D
-%D \startbuffer
-%D \cuthbox{a made cut box}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D This is typeset as:
-%D
-%D \startlinecorrection
-%D \getbuffer
-%D \stoplinecorrection
-%D
-%D By setting the next macros one can influence the length of
-%D the marks as well as the horizontal and vertical divisions.
-
-\def\cutmarklength {2\bodyfontsize}
-\chardef\horizontalcutmarks = 2
-\chardef\verticalcutmarks = 2
-\chardef\cutmarkoffset = 1
-\let\cutmarksymbol = \relax
-\let\cutmarktoptext = \empty
-\let\cutmarkbottomtext = \empty
-
-\def\horizontalcuts
- {\normalhbox to \ruledwidth
- {\dorecurse\horizontalcutmarks
- {\vrule\!!width\boxrulewidth\!!height\cutmarklength\normalhfill}%
- \unskip}}
-
-\def\verticalcuts
- {\scratchdimen\ruledheight
- \advance\scratchdimen \ruleddepth
- \normalvbox to \scratchdimen
- {\hsize\cutmarklength
- \dorecurse\verticalcutmarks
- {\vrule\!!height\boxrulewidth\!!width\hsize\normalvfill}%
- \unskip}}
-
-\def\baselinecuts
- {\ifdim\ruleddepth>\zeropoint
- \scratchdimen\ruledheight
- \advance\scratchdimen \ruleddepth
- \normalvbox to \scratchdimen
- {\scratchdimen\cutmarklength
- \divide\scratchdimen 2
- \hsize\scratchdimen
- \normalvskip\zeropoint\!!plus\ruledheight
- \vrule\!!height\boxrulewidth\!!width\hsize
- \normalvskip\zeropoint\!!plus\ruleddepth}%
- \fi}
-
-\def\cutmarksymbols#1%
- {\normalhbox to \ruledwidth
- {\setbox\scratchbox\normalhbox to \cutmarklength
- {\normalhss\infofont\cutmarksymbol\normalhss}%
- \normalhss
- \normalvbox to \cutmarklength
- {\scratchdimen\cutmarklength
- \divide\scratchdimen \plustwo
- \normalvss
- \hbox to \ruledwidth
- {\llap{\copy\scratchbox\normalhskip\cutmarkoffset\scratchdimen}%
- \normalhskip\scratchdimen\hss\infofont#1\hss\normalhskip\scratchdimen
- \rlap{\normalhskip\cutmarkoffset\scratchdimen\copy\scratchbox}}%
- \normalvss}%
- \normalhss}}
-
-\def\makecutbox#1% simplier with layers, todo
- {\edef\ruledheight{\the\ht#1}%
- \edef\ruleddepth {\the\dp#1}%
- \edef\ruledwidth {\the\wd#1}%
- \setbox#1\normalhbox
- {\dontcomplain
- \forgetall
- \boxmaxdepth\maxdimen
- \offinterlineskip
- \scratchdimen\cutmarklength
- \divide\scratchdimen \plustwo
- \hsize\ruledwidth
- \setbox\scratchbox\normalvbox
- {\setbox\scratchbox\normalhbox{\horizontalcuts}%
- \normalvskip-\cutmarkoffset\scratchdimen
- \normalvskip-2\scratchdimen
- \copy\scratchbox
- \normalvskip\cutmarkoffset\scratchdimen
- \hbox to \ruledwidth
- {\setbox\scratchbox\normalhbox{\verticalcuts}%
- \llap{\copy\scratchbox\normalhskip\cutmarkoffset\scratchdimen}%
- \bgroup
- \setbox\scratchbox\normalhbox{\baselinecuts}%
- \llap{\copy\scratchbox\normalhskip\cutmarkoffset\scratchdimen}%
- \normalhfill
- \rlap{\normalhskip\cutmarkoffset\scratchdimen\copy\scratchbox}%
- \egroup
- \rlap{\normalhskip\cutmarkoffset\scratchdimen\copy\scratchbox}}%
- \normalvskip\cutmarkoffset\scratchdimen
- \copy\scratchbox}%
- \ht\scratchbox\ruledheight
- \dp\scratchbox\ruleddepth
- \wd\scratchbox\zeropoint
- \resetcolorseparation
- \localstartcolor[\defaulttextcolor]%
- \box\scratchbox
- \ifx\cutmarksymbol\relax \else
- \setbox\scratchbox\normalvbox
- {\vskip-\cutmarkoffset\scratchdimen
- \vskip-\cutmarklength
- \normalhbox{\cutmarksymbols\cutmarktoptext}%
- \vskip\cutmarkoffset\scratchdimen
- \vskip\ruledheight
- \vskip\ruleddepth
- \vskip\cutmarkoffset\scratchdimen
- \normalhbox{\cutmarksymbols\cutmarkbottomtext}}%
- \ht\scratchbox\ruledheight
- \dp\scratchbox\ruleddepth
- \wd\scratchbox\zeropoint
- \box\scratchbox
- \fi
- \localstopcolor
- \box#1}%
- \wd#1=\ruledwidth
- \ht#1=\ruledheight
- \dp#1=\ruleddepth}
-
-\def\cuthbox
- {\normalhbox\bgroup
- \dowithnextbox{\makecutbox\nextbox\flushnextbox\egroup}\normalhbox}
-
-\def\cutvbox
- {\normalvbox\bgroup
- \dowithnextbox{\makecutbox\nextbox\flushnextbox\egroup}\normalvbox}
-
-\def\cutvtop
- {\normalvtop\bgroup
- \dowithnextbox{\makecutbox\nextbox\flushnextbox\egroup}\normalvtop}
-
-%D \macros
-%D {colormarkbox,rastermarkbox}
-%D
-%D This macro is used in the pagebody routine. No other use
-%D is advocated here.
-%D
-%D \starttyping
-%D \colormarkbox0
-%D \stoptyping
-
-\def\colormarkoffset{\cutmarkoffset}
-\def\colormarklength{\cutmarklength}
-
-\def\colorrangeA#1#2#3#4%
- {\vbox
- {\scratchdimen-\colormarklength
- \multiply\scratchdimen 4
- \advance\scratchdimen \ruledheight
- \advance\scratchdimen \ruleddepth
- \divide\scratchdimen 21
- \def\docommand##1%
- {\vbox
- {\hsize3em % \scratchdimen
- \definecolor
- [\s!dummy]
- [\c!c=#2##1\else0\fi,
- \c!m=#3##1\else0\fi,
- \c!y=#4##1\else0\fi,
- \c!k=0]%
- \localstartcolor[\s!dummy]%
- \hrule
- \!!width 3em
- \!!height \scratchdimen
- \!!depth \zeropoint
- \localstopcolor
- \ifdim\scratchdimen>1ex
- \vskip-\scratchdimen
- \vbox to \scratchdimen
- {\vss
- \hbox to 3em
- {\hss
- \localstartcolor[\s!white]%
- \ifdim##1\points=\zeropoint#1\else##1\fi
- \localstopcolor
- \hss}%
- \vss}%
- \fi}}%
- \offinterlineskip
- \processcommalist[1.00,0.95,0.75,0.50,0.25,0.05,0.00]\docommand}}
-
-\def\colorrangeB
- {\hbox
- {\scratchdimen-\colormarklength
- \multiply\scratchdimen \plustwo
- \advance\scratchdimen \ruledwidth
- \divide\scratchdimen 11
- \def\docommand ##1 ##2 ##3##4##5##6%
- {\definecolor
- [\s!dummy]
- [\c!c=##3##2\else0\fi,
- \c!m=##4##2\else0\fi,
- \c!y=##5##2\else0\fi,
- \c!k=##6##2\else0\fi]%
- \localstartcolor[\s!dummy]%
- \vrule
- \!!width \scratchdimen
- \!!height \colormarklength
- \!!depth \zeropoint
- \localstopcolor
- \ifdim\scratchdimen>2em
- \hskip-\scratchdimen
- \vbox to \colormarklength
- {\vss
- \hbox to \scratchdimen
- {\hss
- \localstartcolor[\s!white]%
- \ifdim##2\points=.5\points##2~\fi##1%
- \localstopcolor
- \hss}
- \vss}%
- \fi}%
- \docommand C .5 \iftrue \iffalse\iffalse\iffalse
- \docommand M .5 \iffalse\iftrue \iffalse\iffalse
- \docommand Y .5 \iffalse\iffalse\iftrue \iffalse
- \docommand K .5 \iffalse\iffalse\iffalse\iftrue
- \docommand C 1 \iftrue \iffalse\iffalse\iffalse
- \docommand G 1 \iftrue \iffalse\iftrue \iffalse
- \docommand Y 1 \iffalse\iffalse\iftrue \iffalse
- \docommand R 1 \iffalse\iftrue \iftrue \iffalse
- \docommand M 1 \iffalse\iftrue \iffalse\iffalse
- \docommand B 1 \iftrue \iftrue \iffalse\iffalse
- \docommand K 1 \iffalse\iffalse\iffalse\iftrue}}
-
-\def\colorrangeC
- {\hbox
- {\resetcolorseparation
- \scratchdimen-\colormarklength
- \multiply\scratchdimen 2
- \advance\scratchdimen \ruledwidth
- \divide\scratchdimen 14
- \def\docommand##1%
- {\definecolor[\s!dummy][\c!s=##1]%
- \localstartcolor[\s!dummy]%
- \vrule
- \!!width \scratchdimen
- \!!height \colormarklength
- \!!depth \zeropoint
- \localstopcolor
- \ifdim\scratchdimen>2em
- \hskip-\scratchdimen
- \vbox to \colormarklength
- {\vss
- \localstartcolor[\s!white]%
- \hbox to \scratchdimen{\hss##1\hss}
- \localstopcolor
- \vss}%
- \fi}%
- \processcommalist[1,.95,.9,.85,.8,.75,.7,.6,.5,.4,.3,.2,.1,0]\docommand}}
-
-\def\docolormarkbox#1#2%
- {\edef\ruledheight{\the\ht#2}%
- \edef\ruleddepth {\the\dp#2}%
- \edef\ruledwidth {\the\wd#2}%
- \setbox#2\hbox
- {\scratchdimen\colormarklength
- \divide\scratchdimen \plustwo
- \forgetall
- \ssxx
- \setbox\scratchbox\vbox
- {\offinterlineskip
- \vskip-\colormarkoffset\scratchdimen
- \vskip-2\scratchdimen\relax % relax needed
- % beware: no \ifcase, due to nested \iftrue/\iffalse
- % and lacking \fi's
- \doifelse{#1}{0}%
- {\vskip\colormarklength
- \vskip\colormarkoffset\scratchdimen
- \vskip\ruledheight}
- {\hbox to \ruledwidth{\hss\hbox{\colorrangeB}\hss}%
- \vskip\colormarkoffset\scratchdimen
- \vbox to \ruledheight
- {\vss
- \hbox to \ruledwidth
- {\llap{\colorrangeA C\iftrue\iffalse\iffalse\hskip\colormarkoffset\scratchdimen}%
- \hfill
- \rlap{\hskip\colormarkoffset\scratchdimen\colorrangeA R\iffalse\iftrue\iftrue}}%
- \vss
- \hbox to \ruledwidth
- {\llap{\colorrangeA M\iffalse\iftrue\iffalse\hskip\colormarkoffset\scratchdimen}%
- \hfill
- \rlap{\hskip\colormarkoffset\scratchdimen\colorrangeA G\iftrue\iffalse\iftrue}}%
- \vss
- \hbox to \ruledwidth
- {\llap{\colorrangeA Y\iffalse\iffalse\iftrue\hskip\colormarkoffset\scratchdimen}%
- \hfill
- \rlap{\hskip\colormarkoffset\scratchdimen\colorrangeA B\iftrue\iftrue\iffalse}}%
- \vss}}%
- \vskip\colormarkoffset\scratchdimen
- \hbox to \ruledwidth
- {\hss\lower\ruleddepth\hbox{\colorrangeC}\hss}}%
- \ht\scratchbox\ruledheight
- \dp\scratchbox\ruleddepth
- \wd\scratchbox\zeropoint
- \box\scratchbox
- \box#2}%
- \wd#2=\ruledwidth
- \ht#2=\ruledheight
- \dp#2=\ruleddepth}
-
-\def\colormarkbox % #1
- {\ifincolor\@EA\docolormarkbox\else\@EA\gobbletwoarguments\fi1}
-
-\def\rastermarkbox % #1
- {\ifincolor\@EA\docolormarkbox\else\@EA\gobbletwoarguments\fi0}
-
-%D \macros
-%D {showwhatsits, dontshowwhatsits}
-%D
-%D \TEX\ has three so called whatsits: \type {\mark}, \type
-%D {\write} and \type {\special}. The first one keeps track of
-%D the current state at page boundaries, the last two are used
-%D to communicate to the outside world. Due to fact that
-%D especially \type {\write} is often used in conjunction with
-%D \type {\edef}, we can only savely support that one in \ETEX.
-%D
-%D \bgroup \showwhatsits \setupcolors[state=start]
-%D
-%D Whatsits show up \color[blue]{in color} and are
-%D characterized bij their first character.\footnote [some note]
-%D {So we may encounter \type {w}, \type {m} and \type{s}.}
-%D They are \writestatus{dummy}{demo}\color[yellow]{stacked}.
-%D
-%D \egroup
-
-\newif\ifimmediatewrite
-
-\ifx\eTeXversion\undefined
-
- \let\showwhatsits \relax
- \let\dontshowwhatsits\relax
-
-\else
-
- \let\supernormalmark \normalmark % mark may already been superseded
- \let\supernormalmarks \normalmarks % mark may already been superseded
-
- \def\showwhatsits
- {\protected\def\normalmark {\visualwhatsit100+m\supernormalmark }%
- \protected\def\normalmarks{\visualwhatsit100+m\supernormalmarks}%
- \protected\def\special {\visualwhatsit0100s\normalspecial }%
- \protected\def\write {\visualwhatsit001-w\normalwrite }%
- \let\immediate\immediatewhatsit
- \appendtoks\dontshowwhatsits\to\everystoptext}
-
- \def\immediatewhatsit
- {\bgroup\futurelet\next\doimmediatewhatsit}
-
- \def\doimmediatewhatsit
- {\ifx\next\write
- \egroup\immediatewritetrue
- \else
- \egroup\expandafter\normalimmediate
- \fi}
-
- \def\dontshowwhatsits
- {\let\immediate \normalimmediate
- \let\normalmark\supernormalmark
- \let\special \normalspecial
- \let\write \normalwrite}
-
- \def\visualwhatsit#1#2#3#4#5%
- {\bgroup
- \pushwhatsit
- \dontinterfere
- \dontcomplain
- \dontshowcomposition
- \dontshowwhatsits
- \ttx
- \ifvmode\donetrue\else\donefalse\fi
- \setbox\scratchbox\hbox
- {\ifdone\dostartgraycolormode0\else\dostartrgbcolormode#1#2#3\fi
- #5\dostopcolormode}%
- \setbox\scratchbox\hbox
- {\ifdone\dostartrgbcolormode#1#2#3\else\dostartgraycolormode0\fi
- \vrule\!!width\wd\scratchbox\dostopcolormode
- \hskip-\wd\scratchbox\box\scratchbox}%
- \scratchdimen1ex
- \setbox\scratchbox\hbox
- {\ifdone\hskip\else\raise#4\fi\scratchdimen\box\scratchbox}%
- \smashbox\scratchbox
- \ifdone\nointerlineskip\fi
- \box\scratchbox
- \ifvmode\nointerlineskip\fi
- \popwhatsit
- \egroup
- \ifimmediatewrite
- \immediatewritefalse
- \expandafter\normalimmediate
- \fi}
-
- \def\pushwhatsit
- {\ifzeropt\lastskip
- \ifcase\lastpenalty
- \ifzeropt\lastkern
- \ifhmode
- \let\popwhatsit\relax
- \else
- \edef\popwhatsit{\prevdepth\the\prevdepth}%
- \fi
- \else
- \ifhmode
- \edef\popwhatsit{\kern\the\lastkern}\unkern
- \else
- \edef\popwhatsit{\kern\the\lastkern\prevdepth\the\prevdepth}%
- \kern-\lastkern
- \fi
- \fi
- \else
- \ifhmode
- \edef\popwhatsit{\the\lastpenalty}%
- \unpenalty
- \else
- \edef\popwhatsit{\penalty\the\lastpenalty\prevdepth\the\prevdepth}%
- %\nobreak
- \fi
- \fi
- \else
- \ifhmode
- \edef\popwhatsit{\hskip\the\lastskip}\unskip
- \else
- \edef\popwhatsit{\vskip\the\lastskip\prevdepth\the\prevdepth}%
- \vskip-\lastskip
- \fi
- \fi}
-
-\fi
-
-%D The next macro can be used to keep track of classes of
-%D boxes (handy for development cq.\ tracing).
-
-\def\dodotagbox#1#2#3% can be reimplemented
- {\def\next##1##2##3##4%
- {\vbox to \ht#2{##3\hbox to \wd#2{##1#3##2}##4}}%
- \processaction
- [#1]
- [ l=>\next\relax\hfill\vfill\vfill,
- r=>\next\hfill\relax\vfill\vfill,
- t=>\next\hfill\hfill\relax\vfill,
- b=>\next\hfill\hfill\vfill\relax,
- lt=>\next\relax\hfill\relax\vfill,
- lb=>\next\relax\hfill\vfill\relax,
- rt=>\next\hfill\relax\relax\vfill,
- rb=>\next\hfill\relax\vfill\relax,
- tl=>\next\relax\hfill\relax\vfill,
- bl=>\next\relax\hfill\vfill\relax,
- tr=>\next\hfill\relax\relax\vfill,
- br=>\next\hfill\relax\vfill\relax,
- \s!default=>\next\hfill\hfill\vfill\vfill,
- \s!unknown=>\next\hfill\hfill\vfill\vfill]}
-
-\def\dotagbox[#1]#2%
- {\bgroup
- \dowithnextbox
- {\setbox\scratchbox\flushnextbox
- \setbox\nextbox\ifhbox\nextbox\hbox\else\vbox\fi
- \bgroup
- \startoverlay
- {\copy\scratchbox}
- {\dodotagbox{#1}\scratchbox{\framed
- [\c!background=\v!screen,\c!backgroundscreen=1]{#2}}}
- \stopoverlay
- \egroup
- \nextboxwd\the\wd\scratchbox
- \nextboxht\the\ht\scratchbox
- \nextboxdp\the\dp\scratchbox
- \flushnextbox
- \egroup}}
-
-\def\tagbox
- {\dosingleempty\dotagbox}
-
-%D \macros
-%D {coloredhbox,coloredvbox,coloredvtop,
-%D coloredstrut}
-%D
-%D The following visualizations are used in some of the manuals:
-
-\definecolor[boxcolor:ht][r=.5,g=.75,b=.5]
-\definecolor[boxcolor:dp][r=.5,g=.5,b=.75]
-\definecolor[boxcolor:wd][r=.75,g=.5,b=.5]
-\definecolor[strutcolor] [r=.5,g=.25,b=.25]
-
-\def\coloredbox#1%
- {\dowithnextbox{#1{\hbox
- {\blackrule[\c!width=\nextboxwd,\c!height=\nextboxht,\c!depth=\zeropoint,\c!color=boxcolor:ht]%
- \hskip-\nextboxwd
- \blackrule[\c!width=\nextboxwd,\c!height=\zeropoint,\c!depth=\nextboxdp,\c!color=boxcolor:dp]%
- \hskip-\nextboxwd
- \box\nextbox}}}#1}
-
-\def\coloredhbox{\coloredbox\hbox}
-\def\coloredvbox{\coloredbox\vbox}
-\def\coloredvtop{\coloredbox\vtop}
-
-\def\coloredstrut
- {\color[strutcolor]{\def\strutwidth{2\points}\setstrut\strut}}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/type-def.mkii b/Master/texmf-dist/tex/context/base/mkii/type-def.mkii
deleted file mode 100644
index 0ff1e0b7d8f..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/type-def.mkii
+++ /dev/null
@@ -1,86 +0,0 @@
-%D \module
-%D [ file=type-def,
-%D version=2005.02.04,
-%D title=\CONTEXT\ Typescript Macros,
-%D subtitle=Default Definitions,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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[simplification]
-
-\starttypescript [serif] [simple] [name]
- \definefontsynonym [Serif] [Simple]
- \definefontsynonym [SerifBold] [Serif]
- \definefontsynonym [SerifItalic] [Serif]
- \definefontsynonym [SerifSlanted] [Serif]
- \definefontsynonym [SerifBoldItalic] [Serif]
- \definefontsynonym [SerifBoldSlanted] [Serif]
- \definefontsynonym [SerifCaps] [Serif]
-\stoptypescript
-
-\starttypescript [sans] [simple] [name]
- \definefontsynonym [Sans] [Simple]
- \definefontsynonym [SansBold] [Sans]
- \definefontsynonym [SansItalic] [Sans]
- \definefontsynonym [SansSlanted] [Sans]
- \definefontsynonym [SansBoldItalic] [Sans]
- \definefontsynonym [SansBoldSlanted] [Sans]
- \definefontsynonym [SansCaps] [Sans]
-\stoptypescript
-
-\starttypescript [mono] [simple] [name]
- \definefontsynonym [Mono] [Simple]
- \definefontsynonym [MonoBold] [Mono]
- \definefontsynonym [MonoItalic] [Mono]
- \definefontsynonym [MonoSlanted] [Mono]
- \definefontsynonym [MonoBoldItalic] [Mono]
- \definefontsynonym [MonoBoldSlanted] [Mono]
- \definefontsynonym [MonoCaps] [Mono]
-\stoptypescript
-
-\stoptypescriptcollection
-
-% handy
-
-% \starttypescript [serif] [simple] [name]
-% \definefontsynonym [Simple] [cmvtt10]
-% \setupfontsynonym [Simple] [handling=pure]
-% \stoptypescript
-
-\starttypescriptcollection[handling-and-hz]
-
-\starttypescript [serif,sans,mono] [handling,hanging] [pure,normal]
- \setupfontsynonym [\typescriptprefix\typescriptone ] [handling=\typescriptthree]
- \setupfontsynonym [\typescriptprefix\typescriptone Bold] [handling=\typescriptthree bold]
- \setupfontsynonym [\typescriptprefix\typescriptone Slanted] [handling=\typescriptthree slanted]
- \setupfontsynonym [\typescriptprefix\typescriptone Italic] [handling=\typescriptthree italic]
- \setupfontsynonym [\typescriptprefix\typescriptone BoldSlanted] [handling=\typescriptthree boldslanted]
- \setupfontsynonym [\typescriptprefix\typescriptone BoldItalic] [handling=\typescriptthree bolditalic]
-\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
-
-\stoptypescriptcollection
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/type-ini.mkii b/Master/texmf-dist/tex/context/base/mkii/type-ini.mkii
deleted file mode 100644
index c6b0a8931d9..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/type-ini.mkii
+++ /dev/null
@@ -1,726 +0,0 @@
-%D \module
-%D [ file=type-ini,
-%D version=2001.03.05,
-%D title=\CONTEXT\ Typescript Macros,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Typescript Macros / Initialization}
-
-%D The default fontclass is empty. We could demand always using fontclasses,
-%D and then make the calling macros simplier (always assume fontclass) but
-%D apart from downward compatibility issues, it would make global, class
-%D spanning definitions a pain. Some day we will introduce a default class.
-
-% torture test : proper typefaces (and namespace)
-%
-% \starttext
-% \usetypescript[modern][default] default: \setupbodyfont[modern] \eacute \eogonek \zcaron \acircumflexgrave
-% \usetypescript[modern][texnansi] texnansi: \setupbodyfont[modern] \eacute \eogonek \zcaron \acircumflexgrave
-% \usetypescript[modern][ec] ec: \setupbodyfont[modern] \eacute \eogonek \zcaron \acircumflexgrave
-% \usetypescript[modern][qx] qx: \setupbodyfont[modern] \eacute \eogonek \zcaron \acircumflexgrave
-% \usetypescript[modern][t5] t5: \setupbodyfont[modern] \eacute \eogonek \zcaron \acircumflexgrave
-% \stoptext
-%
-% torture test : no typeface, just definitions
-%
-% \starttext
-% {\setupbodyfont[reset] \setupbodyfont[cmr] cmr: \eacute \eogonek \zcaron \acircumflexgrave \endgraf}
-% {\setupbodyfont[reset] \setupbodyfont[plr] plr: \eacute \eogonek \zcaron \acircumflexgrave \endgraf}
-% {\setupbodyfont[reset] \setupbodyfont[csr] csr: \eacute \eogonek \zcaron \acircumflexgrave \endgraf}
-% {\setupbodyfont[reset] \setupbodyfont[vnr] vnr: \eacute \eogonek \zcaron \acircumflexgrave \endgraf}
-% {\setupbodyfont[reset] \setupbodyfont[aer] aer: \eacute \eogonek \zcaron \acircumflexgrave \endgraf}
-% \stoptext
-
-% \usetypescript [modern] [texnansi]
-%
-% normal : 1450 ms
-% exa quit : 1300 ms (150 ms)
-% preload : 825 ms (635 ms) (40-50%)
-%
-% \usetypescript [modern] [texnansi]
-% \usetypescript [palatino][texnansi]
-% \usetypescript [times] [texnansi]
-%
-% normal : 3200 ms
-% exa quit : 2700 ms ( 500 ms)
-% preload : 1300 ms (1900 ms) (60-70%)
-
-% \usetypescript [modern][\defaultencoding]
-% \usetypescript [map] [latin-modern-os] [\defaultencoding]
-% \setupbodyfont[modern]
-% test 1234 test
-
-\unprotect
-
-\def\starttypescriptcollection
- {\dosingleempty\dostarttypescriptcollection}
-
-\def\dostarttypescriptcollection[#1]%
- {}
-
-\def\stoptypescriptcollection
- {}
-
-\let\typescriptfiles\empty
-
-\unexpanded\def\usetypescriptfile[#1]%
- {\doifelse{#1}\v!reset
- {\let\typescriptfiles\empty}
- {\splitfiletype{#1}%
- \addtocommalist\splitoffname\typescriptfiles}}
-
-% SO FAR
-
-\let\currenttypescripts\empty
-
-\newif\iftypescriptfound
-
-\let\@@typescriptone \empty \let\typescriptone \empty
-\let\@@typescripttwo \empty \let\typescripttwo \empty
-\let\@@typescriptthree\empty \let\typescriptthree\empty
-
-% method 2 is for Hans van der Meer
-
-\newtoks\documenttypescripts
-
-\chardef\typescriptmethod\plusone % 1: empty==all==true 2: empty==false
-\chardef\typescriptstate \plustwo % 1: process 2: store
-
-\unexpanded\def\usetypescript {\chardef\typescriptmethod\plusone\dotripleempty\dousetypescript}
-\unexpanded\def\usetypescriptexact{\chardef\typescriptmethod\plustwo\dotripleempty\dousetypescript}
-
-\def\dousetypescript[#1][#2][#3]%
- {\expanded{\dodousetypescript[#1][#2][#3]}}
-
-\def\dodousetypescript[#1][#2][#3]% also loads type-loc, a user file
- {\pushmacro\@@typescriptone \edef\@@typescriptone {\truetypescript{#1}}%
- \pushmacro\@@typescripttwo \edef\@@typescripttwo {\truetypescript{#2}}%
- \pushmacro\@@typescriptthree\edef\@@typescriptthree{\truetypescript{#3}}%
- \pushmacro\typescriptone
- \pushmacro\typescripttwo
- \pushmacro\typescriptthree
- \pushmacro\typescriptmethod
- \pushmacro\typescriptstate \chardef\typescriptstate\plusone % process
- \pushmacro\stoptypescript
- \typescriptfoundfalse
- \iftracetypescripts\writestatus\m!fonts{request: [\@@typescriptone] [\@@typescripttwo] [\@@typescriptthree]}\fi
- \processcommacommand[\typescriptfiles]\dododousetypescript
- \the\documenttypescripts
- \firsttypescriptpassfalse % testen
- \popmacro\stoptypescript
- \popmacro\typescriptstate
- \popmacro\typescriptmethod
- \popmacro\typescriptthree
- \popmacro\typescripttwo
- \popmacro\typescriptone
- \popmacro\@@typescriptthree
- \popmacro\@@typescripttwo
- \popmacro\@@typescriptone}
-
-% simple version:
-%
-% \def\dododousetypescript#1%
-% {\startreadingfile
-% \pushmacro\currenttypefile
-% \def\currenttypefile{#1}%
-% \def\currenttypefile{#1}%
-% \readfile\currenttypefile\donothing\donothing
-% \popmacro\currenttypefile
-% \stopreadingfile}
-%
-% tricky version:
-
-\newconditional\preloadingtypescripts
-
-\def\preloadtypescripts{\ifproductionrun\settrue\preloadingtypescripts\fi}
-
-\def\dododousetypescript#1%
- {\setfalse\quittingtypescript
- \pushmacro\currenttypefile
- \def\currenttypefile{#1}%
- \ifconditional\preloadingtypescripts
- % load files once, and use saved data
- \def\loadedtypescripts{\csname\??ts:\c!file:#1\endcsname}%
- \@EAEAEA\ifx\loadedtypescripts\relax
- \@EAEAEA\newtoks\loadedtypescripts
- \bgroup
- \long\def\starttypescript##1\stoptypescript
- {\global\loadedtypescripts\@EA{\the\loadedtypescripts\starttypescript##1\stoptypescript}}%
- \long\def\starttypescriptcollection##1\stoptypescriptcollection
- {\global\loadedtypescripts\@EA{\the\loadedtypescripts\starttypescriptcollection##1\stoptypescriptcollection}}%
- \startreadingfile
- \pushendofline
- \unprotect
- \readfile{\currenttypefile.\mksuffix}\donothing{\readfile\currenttypefile\donothing\donothing}%
- \protect
- \popendofline
- \stopreadingfile
- \egroup
- \fi
- %\message{[\space\currenttypefile}%
- \the\loadedtypescripts
- %\message{\ifconditional\quittingtypescript quit\space\fi]}%
- \else
- % process files each time
- \startreadingfile
- \pushendofline
- \unprotect
- \readfile{\currenttypefile.\mksuffix}\donothing{\readfile\currenttypefile\donothing\donothing}%
- \protect
- \popendofline
- \stopreadingfile
- \fi
- \popmacro\currenttypefile
- \ifconditional\quittingtypescript
- \quitcommalist
- \setfalse\quittingtypescript
- \fi}
-
-% % not faster, unless maybe toks
-%
-% \newcount\nofloadedtypescripts
-%
-% \def\startloadedtypescript
-% {\dotripleempty\dostartloadedtypescript}
-%
-% \let\stoploadedtypescript\relax
-%
-% \long\def\dostartloadedtypescript[#1][#2][#3]#4\stoptypescript
-% {\global\advance\nofloadedtypescripts\plusone
-% \long\setgvalue{\??ts=>\the\nofloadedtypescripts}{#4}%
-% \edef\temp%
-% {\iffirstargument [#1]\fi
-% \ifsecondargument[#2]\fi
-% \ifthirdargument [#3]\fi
-% \noexpand\csname\??ts=>\the\nofloadedtypescripts\noexpand\endcsname}%
-% \global\loadedtypescripts\@EA\@EA\@EA{\@EA\the\@EA\loadedtypescripts\@EA\starttypescript\temp\stoptypescript}}
-%
-% \def\startloadedtypescriptcollection
-% {\dosingleempty\dostartloadedtypescriptcollection}
-%
-% \def\dostartloadedtypescriptcollection[#1]{}
-% \def\stoploadedtypescriptcollection {}
-%
-% \def\dododousetypescript#1%
-% {\setfalse\quittingtypescript
-% \pushmacro\currenttypefile
-% \def\currenttypefile{#1}%
-% \ifconditional\preloadingtypescripts
-% % load files once, and use saved data
-% \def\loadedtypescripts{\csname\??ts:\c!file:#1\endcsname}%
-% \@EAEAEA\ifx\loadedtypescripts\relax
-% \@EAEAEA\newtoks\loadedtypescripts
-% \bgroup
-% %
-% \let\starttypescript \startloadedtypescript
-% \let\stoptypescript \stoploadedtypescript
-% \let\starttypescriptcollection\startloadedtypescriptcollection
-% \let\stoptypescriptcollection \stoploadedtypescriptcollection
-% %
-% \startreadingfile
-% \pushendofline
-% \unprotect
-% \readfile\currenttypefile\donothing\donothing
-% \protect
-% \popendofline
-% \stopreadingfile
-% \egroup
-% \fi
-% %\message{[\space\currenttypefile}%
-% \the\loadedtypescripts
-% %\message{\ifconditional\quittingtypescript quit\space\fi]}%
-% \else
-% % process files each time
-% \startreadingfile
-% \pushendofline
-% \unprotect
-% \readfile\currenttypefile\donothing\donothing
-% \protect
-% \popendofline
-% \stopreadingfile
-% \fi
-% \popmacro\currenttypefile
-% \ifconditional\quittingtypescript
-% \quitcommalist
-% \setfalse\quittingtypescript
-% \fi}
-
-\def\usetypescriptonce
- {\dotripleempty\dousetypescriptonce}
-
-\def\dousetypescriptonce[#1][#2][#3]%
- {\doifelseflagged{ts:#1:#2:#3}%
- {\writestatus\m!fonts{once (#1) (#2) (#3)}}
- {\setflag{ts:#1:#2:#3}%
- \expanded{\dodousetypescript[#1][#2][#3]}}}
-
-% \definetypescriptsynonym[lbr][cmr]
-
-\def\definetypescriptsynonym
- {\dodoubleempty\dodefinetypescriptsynonym}
-
-\def\dodefinetypescriptsynonym[#1][#2]%
- {\ifsecondargument\setevalue{\??tm#1}{#2}\fi}
-
-\def\truetypescript#1%
- {\ifcsname\??tm#1\endcsname
- \@EA\truetypescript\csname\??tm#1\endcsname\else#1%
- \fi}
-
-% script [serif] [default] [size]
-% script [serif] [computer-modern] [size]
-% script [serif] [computer-modern] [ec]
-% script [serif] [computer-modern] [name]
-% script [serif] [computer-modern] [special]
-
-% todo, make firsttypescriptpass conditional
-
-\newif\iffirsttypescriptpass \firsttypescriptpasstrue
-
-\prependtoks\firsttypescriptpasstrue\to\everyjob
-
-\def\typescript@@all{all}
-
-\newif\iftracetypescripts
-
-\def\starttypescript
- {\ifcase\typescriptstate
- % 0 = skip
- \@EA\gobbleuntil\@EA\stoptypescript
- \or
- % 1 = process
- \expandafter\dostarttypescript
- \or
- % 2 = store
- \expandafter\nostarttypescript
- \else
- % ? = skip
- \@EA\gobbleuntil\@EA\stoptypescript
- \fi}
-
-\long\def\nostarttypescript#1\stoptypescript
- {\appendtoks\starttypescript#1\stoptypescript\to\documenttypescripts}
-
-\def\dostarttypescript
- {\let\typescriptone \@@typescriptone
- \let\typescripttwo \@@typescripttwo
- \let\typescriptthree\@@typescriptthree
- \let\typescriptmatch\empty
- \doifnextoptionalelse\dostarttypescriptone\dostarttypescriptall}
-
-\long\def\dostarttypescriptall
- {\iffirsttypescriptpass
- \expandafter\doprocesstypescript
- \else
- % skip this since it may do unwanted resets, like
- % setting symbolic font names to unknown, especially
- % in run time user type scripts
- \expandafter\noprocesstypescript
- \fi}
-
-\long\def\dostarttypescriptyes
- {\ifdone
- \typescriptfoundtrue
- \iftracetypescripts\writestatus\m!fonts{match:\ifx\currenttypefile\relax\space *\fi \typescriptmatch}\fi
- \expandafter\doprocesstypescript
- \else
- \expandafter\noprocesstypescript
- \fi}
-
-\long\def\dostarttypescriptone
- {\dochecktypescript\@@typescriptone\typescriptone\redostarttypescriptone}
-
-\long\def\dostarttypescripttwo
- {\dochecktypescript\@@typescripttwo\typescripttwo\redostarttypescripttwo}
-
-\long\def\dostarttypescriptthree
- {\dochecktypescript\@@typescriptthree\typescriptthree\redostarttypescriptthree}
-
-\long\def\redostarttypescriptone
- {\doifnextoptionalelse\dostarttypescripttwo\dostarttypescriptyes}
-
-\long\def\redostarttypescripttwo
- {\doifnextoptionalelse\dostarttypescriptthree\dostarttypescriptyes}
-
-\long\def\redostarttypescriptthree
- {\dostarttypescriptyes}
-
-\def\doprocesstypescript
- {\pushmacro\fontclass}
-
-\def\stoptypescript
- {\popmacro\fontclass}
-
-\long\def\noprocesstypescript#1\stoptypescript
- {}
-
-\let\typescriptmatch\empty
-
-\def\dochecktypescript#1#2#3[#4]% script use value next
- {\donefalse
- \def\@@typescriptcheck{#4}%
- \ifx\@@typescriptcheck\empty % no longer needed / met
- \ifcase\typescriptmethod\or\donetrue\else\donefalse\fi
- \else\ifx#1\typescript@@all
- \donetrue
- \else\ifx\@@typescriptcheck\typescript@@all
- \donetrue
- \else\expanded{\doifcommonelse{\@@typescriptcheck}{#1}}\donetrue\donefalse\ifdone
- \let#2\commalistelement
- \fi\fi\fi\fi
- \ifdone
- \edef\typescriptmatch{\typescriptmatch\space[#4]}%
- \expandafter#3%
- \else
- \expandafter\noprocesstypescript
- \fi}
-
-%D Yet another speed up: when issued inside typescript, the call
-%D
-%D \starttyping
-%D \quittypescriptscanning
-%D \stoptyping
-%D
-%D quits further loading. For an example, see type-exa:
-
-\newconditional\quittingtypescript \setfalse\quittingtypescript
-
-\def\quittypescriptscanning{\settrue\quittingtypescript}
-
-% status
-%
-% 1 loaded
-% 2 reported
-% 3 preloaded
-
-% flags ipv \c!state, more flag values
-
-\def\dopreloadmapfile#1%
- {\splitfiletype{#1}%
- \writestatus\m!fonts{assuming map file: \splitoffname}%
- \setxvalue{\splitoffname \c!state}{3}%
- \doglobal\removefromcommalist\splitoffname\allfontmapsfiles}
-
-\def\preloadmapfile[#1]{\expanded{\processcommalist[#1]}\dopreloadmapfile}
-\def\loadmapfile [#1]{\expanded{\processcommalist[#1]}\loadthemapfile}
-\def\unloadmapfile [#1]{\expanded{\processcommalist[#1]}\unloadthemapfile}
-
-% too soon, no driver known, \ifproductionrun \loadallfontmapfiles \fi
-
-% temp hack, will become just \addto
-
-\ifx\pdftexversion\undefined
-
- \def\loadthemapfile#1%
- {\splitfiletype{#1}%
- \doglobal\addtocommalist\splitoffname\allfontmapsfiles}
-
-\else\ifnum\pdftexversion<120 % no overloading
-
- \def\loadthemapfile#1%
- {\splitfiletype{#1}%
- \doglobal\pretocommalist\splitoffname\allfontmapsfiles}
-
-\else
-
- \def\loadthemapfile#1%
- {\splitfiletype{#1}%
- \doglobal\addtocommalist\splitoffname\allfontmapsfiles}
-
-\fi \fi
-
-\def\unloadthemapfile#1%
- {\splitfiletype{#1}%
- \doglobal\removefromcommalist\splitoffname\allfontmapsfiles}
-
-\let\usedmapfile\gobbletwoarguments
-\let\usedmapline\gobbletwoarguments
-
-\def\doregisterloadedmapfile#1%
- {\immediatewriteutilitycommand{\usedmapfile{=}{#1}}}
-
-\def\doloadfontmapfile#1%
- {\ifundefined{#1\c!state}%
- \writestatus\m!fonts{using map file: #1}%
- \doregisterloadedmapfile{#1}%
- \doloadmapfile{=}{#1.\f!fontmapextension}% +/add =/replace -/remove
- \setxvalue{#1\c!state}{1}%
- \fi}
-
-\def\doreportfontmapfile#1%
- {\ifundefined{#1\c!state}%
- \writestatus\m!fonts{needs map file: #1}%
- \setxvalue{#1\c!state}{2}%
- \fi}
-
-\def\loadallfontmapfiles
- {%\message{[\allfontmapsfiles]}%
- \ifconditional\resettingmapfile
- \writestatus\m!fonts{resetting map file list}%
- \doresetmapfilelist
- \global\setfalse\resettingmapfile
- \fi
- \ifx\allfontmapsfiles\empty \else
- \ifautoloadmapfiles
- \processcommacommand[\allfontmapsfiles]\doloadfontmapfile
- \else
- \processcommacommand[\allfontmapsfiles]\doreportfontmapfile
- \fi
- \forgetmapfiles
- \fi}
-
-\def\loadmapline
- {\dodoubleempty\dodoloadmapline}
-
-\def\dodoloadmapline[#1][#2]%
- {\loadallfontmapfiles % ! ! !
- \ifsecondargument
- \immediatewriteutilitycommand{\usedmapline{#1}{#2}}%
- \doloadmapline{#1}{#2}% special
- \else
- \loadmapline[=][#1]%
- %\immediatewriteutilitycommand{\usedmapline{=}{#2}}%
- %\doloadmapline{=}{#1}% special
- \fi}
-
-% since this is driver dependent, and since we may set map files
-% before an output format is defined, we need to postpone it; we
-% cannot use starttext as hook because an output switch can be part
-% of a style; an alternative is to no longer permit driver switching
-% after the first \starttext, but that will break compatibility
-% because \startcomponent ... \environment ... is pretty legal.
-
-% 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
-
-\everybeforeshipout \expandafter
- {\expandafter\appendtoks
- \expandafter\loadallfontmapfiles
- \expandafter\to
- \expandafter\pageboundsettings
- \the\everybeforeshipout}
-
-\newif\ifautoloadmapfiles
-
-\let\allfontmapsfiles\empty
-
-\def\forgetmapfiles
- {\globallet\allfontmapsfiles\empty}
-
-\newconditional\resettingmapfile
-
-\def\resetmapfiles
- {\global\settrue\resettingmapfile}
-
-\def\disablemapfiles
- {\resetmapfiles
- \forgetmapfiles}
-
-%D A handy shortcut:
-
-% \definetypescriptprefix[serif][Serif]
-% \definetypescriptprefix[sans] [Sans]
-% \definetypescriptprefix[mono] [Mono]
-%
-%\starttypescript [serif,sans,mono] [handling,hanging,hz] [pure,normal,hz,quality]
-% \setupfontsynonym [\typescriptprefix\typescriptone] [handling=\typescriptthree]
-% \stoptypescript
-
-\def\definetypescriptprefix
- {\dodoubleargument\dodefinetypescriptprefix}
-
-\def\dodefinetypescriptprefix[#1][#2]%
- {\setgvalue{\??ts::#1}{#2}} % made global
-
-% without testing:
-%
-% \def\typescriptprefix#1%
-% {\csname\??ts::#1\endcsname}
-%
-% with testing:
-
-\def\typescriptprefix#1%
- {\executeifdefined{\??ts::#1}{#1}}
-
-% defining typefaces:
-%
-% \definetypeface [#1:joke] [#2:rm]
-% \definetypeface [#1:joke] [#2:rm] [#3:...]
-% \definetypeface [#1:joke] [#2:rm] [#3:serif] [#4:lucida] [#5:size] [#6:...]
-
-\def\definetypeface
- {\dosixtupleargument\dodefinetypeface}
-
-\def\tsvar#1#2% \executeifdefined{\??ts#1}{#2}
- {\@EA\ifx\csname\??ts#1\endcsname\empty
- #2%
- \else
- \csname\??ts#1\endcsname
- \fi}
-
-% #1=main #2=rm #3=serif #4=fontname #5=size #6=settings
-
-\def\typefaceencoding{\defaultencoding}
-
-% 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,\s!features=,\s!fallbacks=,\s!text=,#6]}% \geteparameters
- \expanded{\getparameters[\??ts][\s!rscale=\plusone,\s!encoding=\defaultencoding,\s!features=,\s!text=,#6]}% \geteparameters
- \pushmacro\relativefontsize
- \pushmacro\typefaceencoding
- \pushmacro\fontclass
- \let\relativefontsize\@@tsrscale
- \let\typefaceencoding\@@tsencoding
- \setcurrentfontclass{#1}%
-% \letvalue{\fontclass\s!features }\@@tsfeatures % new per 16/6/2007
-% \letvalue{\fontclass\s!fallbacks}\@@tsfallbacks % new per 12/10/2008
- \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[#3,\t!map][#4][\t!name,\t!default,\typefaceencoding,\t!special]% map is needed for backward cmp
- \usetypescript[#3][#5][\t!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}
-
-\def\dododefinetypeface[#1][#2]% saveguard against redefinition
- {\doifsomething{#1}
- {\ifcsname\??tf#1\s!default\endcsname \else
- \registerfontclass{#1}%
- \setgvalue{\??tf#1\s!default}{#2}%
- \fi
- \ifcsname#1\endcsname \else
- \unexpanded\setgvalue{#1}{\switchtotypeface[#1][#2]}%
- \fi}}
-
-\def\setuptypeface% [class] [settings]
- {\doquadrupleempty\doswitchtotypeface[\setupbodyfont][\fontclass]}
-
-\unexpanded\def\switchtotypeface% [class] [settings]
- {\doquadrupleempty\doswitchtotypeface[\switchtobodyfont][\globalfontclass]}
-
-\def\doswitchtotypeface[#1][#2][#3][#4]%
- {%\doifinsetelse{\s!default,\v!reset}{#3}
- % {\setcurrentfontclass\empty}
- % {\setcurrentfontclass{#3}}%
- \setcurrentfontclass{#3}%
- \let\globalfontclass#2%
- \iffourthargument
- #1[#4]%
- \else\ifx\fontclass\empty
- #1[\c!rm]%
- \else
- \doifdefinedelse{\??tf\fontclass\s!default}
- {#1[\getvalue{\??tf\fontclass\s!default}]}
- {#1[\c!rm]}%
- \fi \fi
- \ifmmode\mr\else\tf\fi} % needed ?
-
-\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 \stoptyping
-
-\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.
-
-\ifx\normaldoreadfontdefinitionfile\undefined
- \let\normaldoreadfontdefinitionfile\doreadfontdefinitionfile
-\fi
-
-% old and obsolete
-%
-% \def\doreadfontdefinitionfile#1#2% #1 = set/switch state
-% {\ifundefined{\??tf#2\c!default}%
-% \pushmacro\fontclass
-% \setcurrentfontclass\empty
-% \pushmacro\@@typescriptone \edef\@@typescriptone {\truetypescript{#2}}%
-% \pushmacro\@@typescripttwo \let\@@typescripttwo \empty
-% \pushmacro\@@typescriptthree\let\@@typescriptthree\empty
-% \typescriptfoundfalse
-% \dododousetypescript{\f!typeprefix pre}%
-% \popmacro\@@typescriptthree
-% \popmacro\@@typescripttwo
-% \popmacro\@@typescriptone
-% \iftypescriptfound \else
-% \normaldoreadfontdefinitionfile{#1}{#2}%
-% \fi
-% \setcurrentfontclass\empty
-% \popmacro\fontclass
-% \else\ifcase#1\relax
-% \switchtotypeface[#2]%
-% \else
-% \setuptypeface[#2]%
-% \fi\fi}
-%
-% new and obeying fontclasses (but still obsolete)
-
-\def\doreadfontdefinitionfile#1#2% #1 = set/switch state
- {\ifcsname\??tf#2\c!default\endcsname
- \ifcase#1\relax
- \switchtotypeface[#2]%
- \else
- \setuptypeface[#2]%
- \fi
- \else
- \pushmacro\starttypescript
- \scratchtoks\emptytoks
- % locate downward compatibility definitions, one argument !
- \long\def\starttypescript[##1]##2\stoptypescript
- {\doif{##1}{#2}{\scratchtoks{##2}}}
- \startreadingfile
- \readfile{\f!typeprefix pre}\donothing\donothing
- \stopreadingfile
- \popmacro\starttypescript
- \the\scratchtoks
- \fi}
-
-\fetchruntimecommand \typetypescript {\f!typeprefix\s!run}
-
-% \usetypescript [berry] [ec]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/type-one.mkii b/Master/texmf-dist/tex/context/base/mkii/type-one.mkii
deleted file mode 100644
index 4f6e437457c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/type-one.mkii
+++ /dev/null
@@ -1,2917 +0,0 @@
-%D \module
-%D [ file=type-one,
-%D version=2007.07.30,
-%D title=\CONTEXT\ Typescript Macros,
-%D subtitle=Type One Definitions,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 file merges the traditional enc, syn and map files into one. If
-%D you think that it looks messy you're right. It shows some history of
-%D \TEX\ fonts and the development towards latin modern.
-
-% texfont --ven=public --col=antt --enc=ec --sou=auto
-% texfont --ven=public --col=antp --enc=ec --sou=auto
-% texfont --ven=urw --col=palatino --enc=ec --sou=auto
-% texfont --ven-lucas --col=sun --enc=ec --sou=.
-
-% \usetypescript [all] [modern] [texnansi]
-% \setupbodyfont[reset] \setupbodyfont[cmr]
-% \starttext \showfont[Serif] \stoptext
-
-\starttypescriptcollection[latinmodern]
-
- \starttypescript [map] [all]
- \loadmapfile[original-base.map]
- \loadmapfile[original-ams-base.map]
- \stoptypescript
-
- \starttypescript[all][modern,latin-modern][all]
- % fallbacks, no math in latin modern
- \definefontsynonym[lmdunh10][cmdunh10]
- \definefontsynonym[lmff10] [cmff10]
- \definefontsynonym[lmfi10] [cmfi10]
- \definefontsynonym[lmfib8] [cmfib8]
- \definefontsynonym[lmtex10] [cmtex10]
- \definefontsynonym[lmtex8] [cmtex8]
- \definefontsynonym[lmtex9] [cmtex9]
- \loadmapfile[original-public-lm.map]
- \stoptypescript
-
- \starttypescript [serif] [modern,latin-modern] [texnansi,ec,qx,t5]
- \definefontsynonym [LMRoman5-Regular] [\typescriptthree-lmr5] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman6-Regular] [\typescriptthree-lmr6] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman7-Regular] [\typescriptthree-lmr7] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman8-Regular] [\typescriptthree-lmr8] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman9-Regular] [\typescriptthree-lmr9] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman10-Regular] [\typescriptthree-lmr10] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman12-Regular] [\typescriptthree-lmr12] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman17-Regular] [\typescriptthree-lmr17] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman5-Bold] [\typescriptthree-lmbx5] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman6-Bold] [\typescriptthree-lmbx6] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman7-Bold] [\typescriptthree-lmbx7] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman8-Bold] [\typescriptthree-lmbx8] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman9-Bold] [\typescriptthree-lmbx9] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman10-Bold] [\typescriptthree-lmbx10] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman12-Bold] [\typescriptthree-lmbx12] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman7-Italic] [\typescriptthree-lmri7] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman8-Italic] [\typescriptthree-lmri8] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman9-Italic] [\typescriptthree-lmri9] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman10-Italic] [\typescriptthree-lmri10] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman12-Italic] [\typescriptthree-lmri12] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman10-BoldItalic] [\typescriptthree-lmbxi10] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman8-Oblique] [\typescriptthree-lmro8] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman9-Oblique] [\typescriptthree-lmro9] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman10-Oblique] [\typescriptthree-lmro10] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman12-Oblique] [\typescriptthree-lmro12] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman17-Oblique] [\typescriptthree-lmro17] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman10-BoldOblique] [\typescriptthree-lmbxo10] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman10-Demi] [\typescriptthree-lmb10] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman10-DemiOblique] [\typescriptthree-lmbo10] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman10-CapsRegular] [\typescriptthree-lmcsc10] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman10-CapsOblique] [\typescriptthree-lmcsco10] [encoding=\typescriptthree]
-
- \definefontsynonym [LMRoman10-Dunhill] [\typescriptthree-lmdunh10] [encoding=\typescriptthree]
- \definefontsynonym [LMRoman10-DunhillOblique] [\typescriptthree-lmduno10] [encoding=\typescriptthree]
- \loadmapfile[lm-\typescriptthree.map]
- \stoptypescript
-
- \starttypescript [sans] [modern,latin-modern] [texnansi,ec,qx,t5]
- \definefontsynonym [LMSans8-Regular] [\typescriptthree-lmss8] [encoding=\typescriptthree]
- \definefontsynonym [LMSans9-Regular] [\typescriptthree-lmss9] [encoding=\typescriptthree]
- \definefontsynonym [LMSans10-Regular] [\typescriptthree-lmss10] [encoding=\typescriptthree]
- \definefontsynonym [LMSans12-Regular] [\typescriptthree-lmss12] [encoding=\typescriptthree]
- \definefontsynonym [LMSans17-Regular] [\typescriptthree-lmss17] [encoding=\typescriptthree]
- \definefontsynonym [LMSans10-Bold] [\typescriptthree-lmssbx10] [encoding=\typescriptthree]
- \definefontsynonym [LMSans8-Oblique] [\typescriptthree-lmsso8] [encoding=\typescriptthree]
- \definefontsynonym [LMSans9-Oblique] [\typescriptthree-lmsso9] [encoding=\typescriptthree]
- \definefontsynonym [LMSans10-Oblique] [\typescriptthree-lmsso10] [encoding=\typescriptthree]
- \definefontsynonym [LMSans12-Oblique] [\typescriptthree-lmsso12] [encoding=\typescriptthree]
- \definefontsynonym [LMSans17-Oblique] [\typescriptthree-lmsso17] [encoding=\typescriptthree]
- \definefontsynonym [LMSans10-BoldOblique] [\typescriptthree-lmssbo10] [encoding=\typescriptthree]
- \definefontsynonym [LMSans10-DemiCondensed] [\typescriptthree-lmssdc10] [encoding=\typescriptthree]
- \definefontsynonym [LMSans10-DemiCondensedOblique] [\typescriptthree-lmssdo10] [encoding=\typescriptthree]
- \definefontsynonym [LMSansQuotation8-Regular] [\typescriptthree-lmssq8] [encoding=\typescriptthree]
- \definefontsynonym [LMSansQuotation8-Bold] [\typescriptthree-lmssqbx8] [encoding=\typescriptthree]
- \definefontsynonym [LMSansQuotation8-Oblique] [\typescriptthree-lmssqo8] [encoding=\typescriptthree]
- \definefontsynonym [LMSansQuotation8-BoldOblique] [\typescriptthree-lmssqbo8] [encoding=\typescriptthree]
- \loadmapfile[lm-\typescriptthree.map]
- \stoptypescript
-
- \starttypescript [mono] [modern,latin-modern,modern-vari,latin-modern-vari,modern-cond,latin-modern-cond] [texnansi,ec,qx,t5]
- \definefontsynonym [LMTypewriter8-Regular] [\typescriptthree-lmtt8] [encoding=\typescriptthree]
- \definefontsynonym [LMTypewriter9-Regular] [\typescriptthree-lmtt9] [encoding=\typescriptthree]
- \definefontsynonym [LMTypewriter10-Regular] [\typescriptthree-lmtt10] [encoding=\typescriptthree]
- \definefontsynonym [LMTypewriter12-Regular] [\typescriptthree-lmtt12] [encoding=\typescriptthree]
- \definefontsynonym [LMTypewriter10-Italic] [\typescriptthree-lmtti10] [encoding=\typescriptthree]
- \definefontsynonym [LMTypewriter10-Oblique] [\typescriptthree-lmtto10] [encoding=\typescriptthree]
- \definefontsynonym [LMTypewriter10-CapsRegular] [\typescriptthree-lmtcsc10] [encoding=\typescriptthree]
- \definefontsynonym [LMTypewriter10-CapsOblique] [\typescriptthree-lmtcso10] [encoding=\typescriptthree]
- \definefontsynonym [LMTypewriter10-Light] [\typescriptthree-lmtl10] [encoding=\typescriptthree]
- \definefontsynonym [LMTypewriter10-LightOblique] [\typescriptthree-lmtlo10] [encoding=\typescriptthree]
- \definefontsynonym [LMTypewriter10-LightCondensed] [\typescriptthree-lmtlc10] [encoding=\typescriptthree]
- \definefontsynonym [LMTypewriter10-LightCondensedOblique] [\typescriptthree-lmtlco10] [encoding=\typescriptthree]
- \definefontsynonym [LMTypewriter10-Dark] [\typescriptthree-lmtk10] [encoding=\typescriptthree]
- \definefontsynonym [LMTypewriter10-DarkOblique] [\typescriptthree-lmtko10] [encoding=\typescriptthree]
- \definefontsynonym [LMTypewriter10-Unslanted] [\typescriptthree-lmu10] [encoding=\typescriptthree]
- \definefontsynonym [LMTypewriterVarWd10-Regular] [\typescriptthree-lmvtt10] [encoding=\typescriptthree]
- \definefontsynonym [LMTypewriterVarWd10-Oblique] [\typescriptthree-lmvtto10] [encoding=\typescriptthree]
- \definefontsynonym [LMTypewriterVarWd10-Light] [\typescriptthree-lmvtl10] [encoding=\typescriptthree]
- \definefontsynonym [LMTypewriterVarWd10-LightOblique] [\typescriptthree-lmvtlo10] [encoding=\typescriptthree]
- \definefontsynonym [LMTypewriterVarWd10-Dark] [\typescriptthree-lmvtk10] [encoding=\typescriptthree]
- \definefontsynonym [LMTypewriterVarWd10-DarkOblique] [\typescriptthree-lmvtko10] [encoding=\typescriptthree]
- \loadmapfile[lm-\typescriptthree.map]
- \stoptypescript
-
- \starttypescript [math] [modern,latin-modern]
- \definefontsynonym [LMMathRoman5-Regular] [rm-lmr5]
- \definefontsynonym [LMMathRoman6-Regular] [rm-lmr6]
- \definefontsynonym [LMMathRoman7-Regular] [rm-lmr7]
- \definefontsynonym [LMMathRoman8-Regular] [rm-lmr8]
- \definefontsynonym [LMMathRoman9-Regular] [rm-lmr9]
- \definefontsynonym [LMMathRoman10-Regular] [rm-lmr10]
- \definefontsynonym [LMMathRoman12-Regular] [rm-lmr12]
- \definefontsynonym [LMMathRoman17-Regular] [rm-lmr17]
- \definefontsynonym [LMMathRoman5-Bold] [rm-lmbx5]
- \definefontsynonym [LMMathRoman6-Bold] [rm-lmbx6]
- \definefontsynonym [LMMathRoman7-Bold] [rm-lmbx7]
- \definefontsynonym [LMMathRoman8-Bold] [rm-lmbx8]
- \definefontsynonym [LMMathRoman9-Bold] [rm-lmbx9]
- \definefontsynonym [LMMathRoman10-Bold] [rm-lmbx10]
- \definefontsynonym [LMMathRoman12-Bold] [rm-lmbx12]
- \definefontsynonym [LMMathSymbols5-BoldItalic] [lmbsy5]
- \definefontsynonym [LMMathSymbols7-BoldItalic] [lmbsy7]
- \definefontsynonym [LMMathSymbols10-BoldItalic][lmbsy10]
- \definefontsynonym [LMMathSymbols5-Italic] [lmsy5]
- \definefontsynonym [LMMathSymbols6-Italic] [lmsy6]
- \definefontsynonym [LMMathSymbols7-Italic] [lmsy7]
- \definefontsynonym [LMMathSymbols8-Italic] [lmsy8]
- \definefontsynonym [LMMathSymbols9-Italic] [lmsy9]
- \definefontsynonym [LMMathSymbols10-Italic] [lmsy10]
- \definefontsynonym [LMMathExtension10-Regular] [lmex10]
- \definefontsynonym [LMMathItalic5-Italic] [lmmi5]
- \definefontsynonym [LMMathItalic6-Italic] [lmmi6]
- \definefontsynonym [LMMathItalic7-Italic] [lmmi7]
- \definefontsynonym [LMMathItalic8-Italic] [lmmi8]
- \definefontsynonym [LMMathItalic9-Italic] [lmmi9]
- \definefontsynonym [LMMathItalic10-Italic] [lmmi10]
- \definefontsynonym [LMMathItalic12-Italic] [lmmi12]
- \definefontsynonym [LMMathItalic5-BoldItalic] [lmmib5]
- \definefontsynonym [LMMathItalic7-BoldItalic] [lmmib7]
- \definefontsynonym [LMMathItalic10-BoldItalic] [lmmib10]
- \usemathcollection[default]
- \loadmapfile[lm-math.map]
- \loadmapfile[lm-rm.map]
- \stoptypescript
-
- %D {\em Comments by Victor Figurnov:} the wcmb10, wcmbx10,
- %D \unknown\ fonts below are taken from the Paradissa
- %D collection by Basil Malyshev. These fonts don't conform t2a
- %D encoding but are in MS Windows Cyrillic codepage 1251
- %D encoding. These fonts contain only 33 russian letters in
- %D upper and lower case, the number sign, and guillemots. But
- %D even among these characters only the basic 32 russian
- %D letters (in upper and lower case) will be typeset correctly
- %D with this definition. The letters cyrillicYO and
- %D cyrillicyo, as well as number sign (textnumero) and
- %D guillemots won't be typeset properly, because these symbols
- %D have different positions in t2a and MS CP1251 encodings.
- %D
- %D I think that the russian lh fonts and|/|or cm-super provide
- %D better alternatives (type1). Therefore, the names below
- %D match those of cm-super (\type {0NNN} instead of \type
- %D {NNN}, i.e.\ four digit numbers).
-
- \starttypescript [serif] [computer-modern] [cyr]
- \definefontsynonym [cmb10] [wcmb10] [encoding=t2a]
- \definefontsynonym [cmbsy10] [wcmbsy10] [encoding=t2a]
- \definefontsynonym [cmbx10] [wcmbx10] [encoding=t2a]
- \definefontsynonym [cmbx12] [wcmbx12] [encoding=t2a]
- \definefontsynonym [cmbx5] [wcmbx5] [encoding=t2a]
- \definefontsynonym [cmbx6] [wcmbx6] [encoding=t2a]
- \definefontsynonym [cmbx7] [wcmbx7] [encoding=t2a]
- \definefontsynonym [cmbx8] [wcmbx8] [encoding=t2a]
- \definefontsynonym [cmbx9] [wcmbx9] [encoding=t2a]
- \definefontsynonym [cmbxsl10] [wcmbxsl10] [encoding=t2a]
- \definefontsynonym [cmbxti10] [wcmbxti10] [encoding=t2a]
- \definefontsynonym [cmcsc10] [wcmcsc10] [encoding=t2a]
- %definefontsynonym [cmdunh10] [wcmdunh10] [encoding=t2a]
- \definefontsynonym [cminch] [wcminch] [encoding=t2a]
- \definefontsynonym [cmr10] [wcmr10] [encoding=t2a]
- \definefontsynonym [cmr12] [wcmr12] [encoding=t2a]
- \definefontsynonym [cmr17] [wcmr17] [encoding=t2a]
- \definefontsynonym [cmr5] [wcmr5] [encoding=t2a]
- \definefontsynonym [cmr6] [wcmr6] [encoding=t2a]
- \definefontsynonym [cmr7] [wcmr7] [encoding=t2a]
- \definefontsynonym [cmr8] [wcmr8] [encoding=t2a]
- \definefontsynonym [cmr9] [wcmr9] [encoding=t2a]
- \definefontsynonym [cmsl10] [wcmsl10] [encoding=t2a]
- \definefontsynonym [cmsl12] [wcmsl12] [encoding=t2a]
- \definefontsynonym [cmsl8] [wcmsl8] [encoding=t2a]
- \definefontsynonym [cmsl9] [wcmsl9] [encoding=t2a]
- \definefontsynonym [cmti10] [wcmti10] [encoding=t2a]
- \definefontsynonym [cmti12] [wcmti12] [encoding=t2a]
- \definefontsynonym [cmti7] [wcmti7] [encoding=t2a]
- \definefontsynonym [cmti8] [wcmti8] [encoding=t2a]
- \definefontsynonym [cmti9] [wcmti9] [encoding=t2a]
- \definefontsynonym [cmu10] [wcmu10] [encoding=t2a]
- \stoptypescript
-
- \starttypescript [sans] [computer-modern] [cyr]
- \definefontsynonym [cmss10] [wcmss10] [encoding=t2a]
- \definefontsynonym [cmss12] [wcmss12] [encoding=t2a]
- \definefontsynonym [cmss17] [wcmss17] [encoding=t2a]
- \definefontsynonym [cmss8] [wcmss8] [encoding=t2a]
- \definefontsynonym [cmss9] [wcmss9] [encoding=t2a]
- %definefontsynonym [cmssbi10] [wcmssbi10] [encoding=t2a]
- \definefontsynonym [cmssbx10] [wcmssbx10] [encoding=t2a]
- \definefontsynonym [cmssdc10] [wcmssdc10] [encoding=t2a]
- \definefontsynonym [cmssi10] [wcmssi10] [encoding=t2a]
- \definefontsynonym [cmssi12] [wcmssi12] [encoding=t2a]
- \definefontsynonym [cmssi17] [wcmssi17] [encoding=t2a]
- \definefontsynonym [cmssi8] [wcmssi8] [encoding=t2a]
- \definefontsynonym [cmssi9] [wcmssi9] [encoding=t2a]
- \definefontsynonym [cmssq8] [wcmssq8] [encoding=t2a]
- \definefontsynonym [cmssqi8] [wcmssqi8] [encoding=t2a]
- \stoptypescript
-
- \starttypescript [mono] [computer-modern] [cyr]
- \definefontsynonym [cmitt10] [wcmitt10] [encoding=t2a]
- \definefontsynonym [cmsltt10] [wcmsltt10] [encoding=t2a]
- \definefontsynonym [cmtt10] [wcmtt10] [encoding=t2a]
- \definefontsynonym [cmtt12] [wcmtt12] [encoding=t2a]
- \definefontsynonym [cmtt8] [wcmtt8] [encoding=t2a]
- \definefontsynonym [cmtt9] [wcmtt9] [encoding=t2a]
- %definefontsynonym [cmvtt10] [wcmvtt10] [encoding=t2a]
- \stoptypescript
-
- \definetypescriptprefix [c:t2a] [la]
- \definetypescriptprefix [c:t2b] [lb]
- \definetypescriptprefix [c:t2c] [lc]
- \definetypescriptprefix [c:x2] [rx]
-
- \starttypescript [all] [computer-modern] [t2a,t2b,t2c,x2]
- \loadmapfile[subset-cmsuper-\typescriptthree.map]
- \loadmapfile[subset-cmsuper-\typescriptthree.map]
- \loadmapfile[cm-super-\typescriptthree.map]
- \stoptypescript
-
- \starttypescript [serif] [computer-modern] [t2a,t2b,t2c,x2]
- \definefontsynonym [cmb10] [\typescriptprefix{c:\typescriptthree}rb1000] [encoding=\typescriptthree]
- \definefontsynonym [cmbx10] [\typescriptprefix{c:\typescriptthree}bx1000] [encoding=\typescriptthree]
- \definefontsynonym [cmbx12] [\typescriptprefix{c:\typescriptthree}bx1200] [encoding=\typescriptthree]
- \definefontsynonym [cmbx5] [\typescriptprefix{c:\typescriptthree}bx0500] [encoding=\typescriptthree]
- \definefontsynonym [cmbx6] [\typescriptprefix{c:\typescriptthree}bx0600] [encoding=\typescriptthree]
- \definefontsynonym [cmbx7] [\typescriptprefix{c:\typescriptthree}bx0700] [encoding=\typescriptthree]
- \definefontsynonym [cmbx8] [\typescriptprefix{c:\typescriptthree}bx0800] [encoding=\typescriptthree]
- \definefontsynonym [cmbx9] [\typescriptprefix{c:\typescriptthree}bx0900] [encoding=\typescriptthree]
- \definefontsynonym [cmbxsl10] [\typescriptprefix{c:\typescriptthree}bl1000] [encoding=\typescriptthree]
- \definefontsynonym [cmbxti10] [\typescriptprefix{c:\typescriptthree}bi1000] [encoding=\typescriptthree]
- \definefontsynonym [cmcsc10] [\typescriptprefix{c:\typescriptthree}cc1000] [encoding=\typescriptthree]
- \definefontsynonym [cmdunh10] [\typescriptprefix{c:\typescriptthree}dh1000] [encoding=\typescriptthree]
- \definefontsynonym [cmff10] [\typescriptprefix{c:\typescriptthree}ff1000] [encoding=\typescriptthree]
- \definefontsynonym [cmfi10] [\typescriptprefix{c:\typescriptthree}fi1000] [encoding=\typescriptthree]
- \definefontsynonym [cmfib8] [\typescriptprefix{c:\typescriptthree}fb0800] [encoding=\typescriptthree]
- %\definefontsynonym [cminch] [\typescriptprefix{c:\typescriptthree}inch00] [encoding=\typescriptthree]
- \definefontsynonym [cmr10] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
- \definefontsynonym [cmr12] [\typescriptprefix{c:\typescriptthree}rm1200] [encoding=\typescriptthree]
- \definefontsynonym [cmr17] [\typescriptprefix{c:\typescriptthree}rm1700] [encoding=\typescriptthree]
- \definefontsynonym [cmr5] [\typescriptprefix{c:\typescriptthree}rm0500] [encoding=\typescriptthree]
- \definefontsynonym [cmr6] [\typescriptprefix{c:\typescriptthree}rm0600] [encoding=\typescriptthree]
- \definefontsynonym [cmr7] [\typescriptprefix{c:\typescriptthree}rm0700] [encoding=\typescriptthree]
- \definefontsynonym [cmr8] [\typescriptprefix{c:\typescriptthree}rm0800] [encoding=\typescriptthree]
- \definefontsynonym [cmr9] [\typescriptprefix{c:\typescriptthree}rm0900] [encoding=\typescriptthree]
- \definefontsynonym [cmsl10] [\typescriptprefix{c:\typescriptthree}sl1000] [encoding=\typescriptthree]
- \definefontsynonym [cmsl12] [\typescriptprefix{c:\typescriptthree}sl1200] [encoding=\typescriptthree]
- \definefontsynonym [cmsl8] [\typescriptprefix{c:\typescriptthree}sl0800] [encoding=\typescriptthree]
- \definefontsynonym [cmsl9] [\typescriptprefix{c:\typescriptthree}sl0900] [encoding=\typescriptthree]
- \definefontsynonym [cmtcsc10] [\typescriptprefix{c:\typescriptthree}tc1000] [encoding=\typescriptthree]
- \definefontsynonym [cmti10] [\typescriptprefix{c:\typescriptthree}ti1000] [encoding=\typescriptthree]
- \definefontsynonym [cmti12] [\typescriptprefix{c:\typescriptthree}ti1200] [encoding=\typescriptthree]
- \definefontsynonym [cmti7] [\typescriptprefix{c:\typescriptthree}ti0700] [encoding=\typescriptthree]
- \definefontsynonym [cmti8] [\typescriptprefix{c:\typescriptthree}ti0800] [encoding=\typescriptthree]
- \definefontsynonym [cmti9] [\typescriptprefix{c:\typescriptthree}ti0900] [encoding=\typescriptthree]
- \definefontsynonym [cmu10] [\typescriptprefix{c:\typescriptthree}ui1000] [encoding=\typescriptthree]
- \stoptypescript
-
- \starttypescript [sans] [computer-modern] [t2a,t2b,t2c,x2]
- \definefontsynonym [cmss10] [\typescriptprefix{c:\typescriptthree}ss1000] [encoding=\typescriptthree]
- \definefontsynonym [cmss12] [\typescriptprefix{c:\typescriptthree}ss1200] [encoding=\typescriptthree]
- \definefontsynonym [cmss17] [\typescriptprefix{c:\typescriptthree}ss1700] [encoding=\typescriptthree]
- \definefontsynonym [cmss8] [\typescriptprefix{c:\typescriptthree}ss0800] [encoding=\typescriptthree]
- \definefontsynonym [cmss9] [\typescriptprefix{c:\typescriptthree}ss0900] [encoding=\typescriptthree]
- \definefontsynonym [cmssbx10] [\typescriptprefix{c:\typescriptthree}sx1000] [encoding=\typescriptthree]
- %\definefontsynonym [cmssdc10] [\typescriptprefix{c:\typescriptthree}ssdc1000] [encoding=\typescriptthree]
- \definefontsynonym [cmssi10] [\typescriptprefix{c:\typescriptthree}si1000] [encoding=\typescriptthree]
- \definefontsynonym [cmssi12] [\typescriptprefix{c:\typescriptthree}si1200] [encoding=\typescriptthree]
- \definefontsynonym [cmssi17] [\typescriptprefix{c:\typescriptthree}si1700] [encoding=\typescriptthree]
- \definefontsynonym [cmssi8] [\typescriptprefix{c:\typescriptthree}si0800] [encoding=\typescriptthree]
- \definefontsynonym [cmssi9] [\typescriptprefix{c:\typescriptthree}si0900] [encoding=\typescriptthree]
- \definefontsynonym [cmssq8] [\typescriptprefix{c:\typescriptthree}ss0800] [encoding=\typescriptthree]
- \definefontsynonym [cmssqi8] [\typescriptprefix{c:\typescriptthree}si0800] [encoding=\typescriptthree]
- \stoptypescript
-
- \starttypescript [mono] [computer-modern] [t2a,t2b,t2c,x2]
- \definefontsynonym [cmitt10] [\typescriptprefix{c:\typescriptthree}it1000] [encoding=\typescriptthree]
- \definefontsynonym [cmsltt10] [\typescriptprefix{c:\typescriptthree}st1000] [encoding=\typescriptthree]
- \definefontsynonym [cmtt10] [\typescriptprefix{c:\typescriptthree}tt1000] [encoding=\typescriptthree]
- \definefontsynonym [cmtt12] [\typescriptprefix{c:\typescriptthree}tt1200] [encoding=\typescriptthree]
- \definefontsynonym [cmtt8] [\typescriptprefix{c:\typescriptthree}tt0800] [encoding=\typescriptthree]
- \definefontsynonym [cmtt9] [\typescriptprefix{c:\typescriptthree}tt0900] [encoding=\typescriptthree]
- \definefontsynonym [cmvtt10] [\typescriptprefix{c:\typescriptthree}vt1000] [encoding=\typescriptthree]
- \stoptypescript
-
- \starttypescript [serif] [computer-modern] [lcy]
- \definefontsynonym [cmb10] [lhb10] [encoding=lcy]
- \definefontsynonym [cmbx10] [lhbx10] [encoding=lcy]
- \definefontsynonym [cmbx12] [lhbx12] [encoding=lcy]
- \definefontsynonym [cmbx5] [lhbx5] [encoding=lcy]
- \definefontsynonym [cmbx6] [lhbx6] [encoding=lcy]
- \definefontsynonym [cmbx7] [lhbx7] [encoding=lcy]
- \definefontsynonym [cmbx8] [lhbx8] [encoding=lcy]
- \definefontsynonym [cmbx9] [lhbx9] [encoding=lcy]
- \definefontsynonym [cmbxsl10] [lhbxsl10] [encoding=lcy]
- \definefontsynonym [cmbxti10] [lhbxti10] [encoding=lcy]
- \definefontsynonym [cmcsc10] [lhcsc10] [encoding=lcy]
- \definefontsynonym [cmdunh10] [lhdunh10] [encoding=lcy]
- \definefontsynonym [cmff10] [lhff10] [encoding=lcy]
- \definefontsynonym [cmfi10] [lhfi10] [encoding=lcy]
- \definefontsynonym [cmfib8] [lhfib8] [encoding=lcy]
- \definefontsynonym [cminch] [lhinch] [encoding=lcy]
- \definefontsynonym [cmr10] [lhr10] [encoding=lcy]
- \definefontsynonym [cmr12] [lhr12] [encoding=lcy]
- \definefontsynonym [cmr17] [lhr17] [encoding=lcy]
- \definefontsynonym [cmr5] [lhr5] [encoding=lcy]
- \definefontsynonym [cmr6] [lhr6] [encoding=lcy]
- \definefontsynonym [cmr7] [lhr7] [encoding=lcy]
- \definefontsynonym [cmr8] [lhr8] [encoding=lcy]
- \definefontsynonym [cmr9] [lhr9] [encoding=lcy]
- \definefontsynonym [cmsl10] [lhsl10] [encoding=lcy]
- \definefontsynonym [cmsl12] [lhsl12] [encoding=lcy]
- \definefontsynonym [cmsl8] [lhsl8] [encoding=lcy]
- \definefontsynonym [cmsl9] [lhsl9] [encoding=lcy]
- \definefontsynonym [cmtcsc10] [lhtcsc10] [encoding=lcy]
- \definefontsynonym [cmtex10] [lhtex10] [encoding=lcy]
- \definefontsynonym [cmtex8] [lhtex8] [encoding=lcy]
- \definefontsynonym [cmtex9] [lhtex9] [encoding=lcy]
- \definefontsynonym [cmti10] [lhti10] [encoding=lcy]
- \definefontsynonym [cmti12] [lhti12] [encoding=lcy]
- \definefontsynonym [cmti7] [lhti7] [encoding=lcy]
- \definefontsynonym [cmti8] [lhti8] [encoding=lcy]
- \definefontsynonym [cmti9] [lhti9] [encoding=lcy]
- \definefontsynonym [cmu10] [lhu10] [encoding=lcy]
- \stoptypescript
-
- \starttypescript [sans] [computer-modern] [lcy]
- \definefontsynonym [cmss10] [lhss10] [encoding=lcy]
- \definefontsynonym [cmss12] [lhss12] [encoding=lcy]
- \definefontsynonym [cmss17] [lhss17] [encoding=lcy]
- \definefontsynonym [cmss8] [lhss8] [encoding=lcy]
- \definefontsynonym [cmss9] [lhss9] [encoding=lcy]
- \definefontsynonym [cmssbi10] [lhssbi10] [encoding=lcy]
- \definefontsynonym [cmssbx10] [lhssbx10] [encoding=lcy]
- \definefontsynonym [cmssdc10] [lhssdc10] [encoding=lcy]
- \definefontsynonym [cmssi10] [lhssi10] [encoding=lcy]
- \definefontsynonym [cmssi12] [lhssi12] [encoding=lcy]
- \definefontsynonym [cmssi17] [lhssi17] [encoding=lcy]
- \definefontsynonym [cmssi8] [lhssi8] [encoding=lcy]
- \definefontsynonym [cmssi9] [lhssi9] [encoding=lcy]
- \definefontsynonym [cmssq8] [lhssq8] [encoding=lcy]
- \definefontsynonym [cmssqi8] [lhssqi8] [encoding=lcy]
- \stoptypescript
-
- \starttypescript [mono] [computer-modern] [lcy]
- \definefontsynonym [cmitt10] [lhitt10] [encoding=lcy]
- \definefontsynonym [cmsltt10] [lhsltt10] [encoding=lcy]
- \definefontsynonym [cmtt10] [lhtt10] [encoding=lcy]
- \definefontsynonym [cmtt12] [lhtt12] [encoding=lcy]
- \definefontsynonym [cmtt8] [lhtt8] [encoding=lcy]
- \definefontsynonym [cmtt9] [lhtt9] [encoding=lcy]
- \definefontsynonym [cmvtt10] [lhvtt10] [encoding=lcy]
- \stoptypescript
-
- %
-
- \starttypescript [math] [modern,computer-modern,latin-modern] % [default]
- % watch the space, it prevents remapping
- \definefontsynonym [ComputerModernMath-Roman] [rm-lmr10]% [lmr10 ]
- \definefontsynonym [ComputerModernMath-Extension] [lmex10]
- \definefontsynonym [ComputerModernMath-Italic] [lmmi10]
- \definefontsynonym [ComputerModernMath-Symbol] [lmsy10]
- \stoptypescript
-
- \starttypescript [boldmath,bfmath] [modern,computer-modern,latin-modern] % [default]
- % watch the space, it prevents remapping
- \definefontsynonym [ComputerModernMath-Roman-Bold] [rm-lmb10] % [lmb10 ]
- \definefontsynonym [ComputerModernMath-Extension] [lmex10]
- \definefontsynonym [ComputerModernMath-Italic-Bold] [lmmib10]
- \definefontsynonym [ComputerModernMath-Symbol-Bold] [lmbsy10]
- \stoptypescript
-
- % Till we have cyrilic in lm:
-
- % \usetypescript[modern-base][t2a]
- % \setupbodyfont[modern,10pt]
-
- \starttypescript [serif] [computer-modern] [t2a,t2b,t2c,x2]
- \definefontsynonym [Serif] [\typescriptprefix{c:\typescriptthree}rm1000] [encoding=\typescriptthree]
- \definefontsynonym [SerifItalic] [\typescriptprefix{c:\typescriptthree}ti1000] [encoding=\typescriptthree]
- \definefontsynonym [SerifSlanted] [\typescriptprefix{c:\typescriptthree}sl1000] [encoding=\typescriptthree]
- \definefontsynonym [SerifBold] [\typescriptprefix{c:\typescriptthree}bx1000] [encoding=\typescriptthree]
- \definefontsynonym [SerifBoldItalic] [\typescriptprefix{c:\typescriptthree}bi1000] [encoding=\typescriptthree]
- \definefontsynonym [SerifBoldSlanted] [\typescriptprefix{c:\typescriptthree}bl1000] [encoding=\typescriptthree]
- \definefontsynonym [SerifCaps] [\typescriptprefix{c:\typescriptthree}cc1000] [encoding=\typescriptthree]
- \definefontsynonym [SerifCapsSlanted] [\typescriptprefix{c:\typescriptthree}sc1000] [encoding=\typescriptthree]
- \stoptypescript
-
- \starttypescript [sans] [computer-modern] [t2a,t2b,t2c,x2]
- \definefontsynonym [Sans] [\typescriptprefix{c:\typescriptthree}ss1000] [encoding=\typescriptthree]
- \definefontsynonym [SansItalic] [\typescriptprefix{c:\typescriptthree}si1000] [encoding=\typescriptthree]
- \definefontsynonym [SansSlanted] [\typescriptprefix{c:\typescriptthree}si1000] [encoding=\typescriptthree]
- \definefontsynonym [SansBold] [\typescriptprefix{c:\typescriptthree}sx1000] [encoding=\typescriptthree]
- \definefontsynonym [SansBoldItalic] [\typescriptprefix{c:\typescriptthree}so1000] [encoding=\typescriptthree]
- \definefontsynonym [SansBoldSlanted] [\typescriptprefix{c:\typescriptthree}so1000] [encoding=\typescriptthree]
- \definefontsynonym [SansCaps] [\typescriptprefix{c:\typescriptthree}ss1000] [encoding=\typescriptthree]
- \definefontsynonym [SansCapsSlanted] [\typescriptprefix{c:\typescriptthree}si1000] [encoding=\typescriptthree]
- \stoptypescript
-
- \starttypescript [mono] [computer-modern] [t2a,t2b,t2c,x2]
- \definefontsynonym [Mono] [\typescriptprefix{c:\typescriptthree}tt1000] [encoding=\typescriptthree]
- \definefontsynonym [MonoItalic] [\typescriptprefix{c:\typescriptthree}it1000] [encoding=\typescriptthree]
- \definefontsynonym [MonoSlanted] [\typescriptprefix{c:\typescriptthree}st1000] [encoding=\typescriptthree]
- \definefontsynonym [MonoBold] [\typescriptprefix{c:\typescriptthree}tt1000] [encoding=\typescriptthree]
- \definefontsynonym [MonoBoldItalic] [\typescriptprefix{c:\typescriptthree}it1000] [encoding=\typescriptthree]
- \definefontsynonym [MonoBoldSlanted] [\typescriptprefix{c:\typescriptthree}st1000] [encoding=\typescriptthree]
- \definefontsynonym [MonoCaps] [\typescriptprefix{c:\typescriptthree}tc1000] [encoding=\typescriptthree]
- \definefontsynonym [MonoCapsSlanted] [\typescriptprefix{c:\typescriptthree}tc1000] [encoding=\typescriptthree]
- \stoptypescript
-
- % Computer Concrete (AMS)
-
- \starttypescript [serif] [concrete] [default]
- \definefontsynonym [ComputerConcrete] [ccr10]
- \definefontsynonym [ComputerConcrete-Italic] [ccti10]
- \definefontsynonym [ComputerConcrete-Slanted] [ccsl10]
- \definefontsynonym [ComputerConcrete-Bold] [ComputerConcrete]
- \definefontsynonym [ComputerConcrete-BoldItalic] [ComputerConcrete-Italic]
- \definefontsynonym [ComputerConcrete-BoldSlanted] [ComputerConcrete-Slanted]
- \definefontsynonym [ComputerConcrete-Caps] [cccsc10]
- \stoptypescript
-
- \starttypescript [serif] [modern,computer-modern,latin-modern] [name]
- \definefontsynonym [Serif] [LMRoman-Regular]
- \definefontsynonym [SerifBold] [LMRoman-Bold]
- \definefontsynonym [SerifItalic] [LMRoman-Italic]
- \definefontsynonym [SerifSlanted] [LMRoman-Oblique]
- \definefontsynonym [SerifBoldItalic] [LMRoman-BoldItalic]
- \definefontsynonym [SerifBoldSlanted] [LMRoman-BoldOblique]
- \definefontsynonym [SerifCaps] [LMRoman-CapsRegular]
- \definefontsynonym [SerifCapsSlanted] [LMRoman-CapsOblique]
- \stoptypescript
-
- \starttypescript [sans] [modern,computer-modern,latin-modern] [name]
- \definefontsynonym [Sans] [LMSans-Regular]
- \definefontsynonym [SansBold] [LMSans-Bold]
- \definefontsynonym [SansItalic] [LMSans-Oblique]
- \definefontsynonym [SansSlanted] [LMSans-Oblique]
- \definefontsynonym [SansBoldItalic] [LMSans-BoldOblique]
- \definefontsynonym [SansBoldSlanted] [LMSans-BoldOblique]
- \definefontsynonym [SansCaps] [LMSans-Regular]
- \definefontsynonym [SansCapsSlanted] [LMSans-Oblique]
- \stoptypescript
-
- \starttypescript [mono] [modern,computer-modern,latin-modern] [name]
- \definefontsynonym [Mono] [LMTypewriter-Regular]
- \definefontsynonym [MonoBold] [LMTypewriter-Dark]
- \definefontsynonym [MonoItalic] [LMTypewriter-Italic]
- \definefontsynonym [MonoSlanted] [LMTypewriter-Oblique]
- \definefontsynonym [MonoBoldItalic] [LMTypewriter-DarkOblique]
- \definefontsynonym [MonoBoldSlanted] [LMTypewriter-DarkOblique]
- \definefontsynonym [MonoCaps] [LMTypewriter-CapsRegular]
- \definefontsynonym [MonoCapsSlanted] [LMTypewriter-CapsOblique]
- \definefontsynonym [MonoVariable] [LMTypewriterVarWd-Regular]
- \stoptypescript
-
- \starttypescript [math] [modern,computer-modern,latin-modern] [name]
- \definefontsynonym [MathRoman] [LMMathRoman-Regular]
- \definefontsynonym [MathExtension] [LMMathExtension-Regular]
- \definefontsynonym [MathItalic] [LMMathItalic-Italic]
- \definefontsynonym [MathSymbol] [LMMathSymbols-Italic]
- \stoptypescript
-
- \starttypescript [boldmath] [modern,computer-modern,latin-modern] [name]
- \definefontsynonym [MathRoman] [LMMathRoman-Bold]
- \definefontsynonym [MathExtension] [LMMathExtension-Regular]
- \definefontsynonym [MathItalic] [LMMathItalic-BoldItalic]
- \definefontsynonym [MathSymbol] [LMMathSymbols-BoldItalic]
- \stoptypescript
-
- \starttypescript [bfmath] [modern,computer-modern,latin-modern] [name]
- \definefontsynonym [MathRomanBold] [LMMathRoman-Bold]
- \definefontsynonym [MathExtension] [LMMathExtension-Regular]
- \definefontsynonym [MathItalicBold] [LMMathItalic-BoldItalic]
- \definefontsynonym [MathSymbolBold] [LMMathSymbols-BoldItalic]
- \stoptypescript
-
- \starttypescript [math,boldmath,bfmath] [modern,computer-modern,latin-modern] [name]
- \usemathcollection[default]
- \stoptypescript
-
- \starttypescript [serif] [modern-vari,computer-modern-vari,latin-modern-vari] [name]
- \definefontsynonym [Serif] [LMTypewriterVarWd-Regular]
- \definefontsynonym [SerifBold] [LMTypewriterVarWd-Oblique]
- \definefontsynonym [SerifItalic] [LMTypewriterVarWd-Oblique]
- \definefontsynonym [SerifSlanted] [LMTypewriterVarWd-Dark]
- \definefontsynonym [SerifBoldItalic] [LMTypewriterVarWd-DarkOblique]
- \definefontsynonym [SerifBoldSlanted] [LMTypewriterVarWd-DarkOblique]
- \definefontsynonym [SerifCaps] [LMTypewriterVarWd-Regular]
- \definefontsynonym [SerifCapsSlanted] [LMTypewriterVarWd-Oblique]
- \stoptypescript
-
- \starttypescript [mono] [modern-cond,computer-modern-cond,latin-modern-cond,modern-lightcond,computer-modern-lightcond,latin-modern-lightcond] [name]
- \definefontsynonym [Mono] [LMTypewriter-LightCondensed]
- \definefontsynonym [MonoBold] [LMTypewriter-LightCondensed]
- \definefontsynonym [MonoItalic] [LMTypewriter-LightCondensedOblique]
- \definefontsynonym [MonoSlanted] [LMTypewriter-LightCondensedOblique]
- \definefontsynonym [MonoBoldItalic] [LMTypewriter-LightCondensed]
- \definefontsynonym [MonoBoldSlanted] [LMTypewriter-LightCondensed]
- \definefontsynonym [MonoCaps] [LMTypewriter-LightCondensed]
- \definefontsynonym [MonoCapsSlanted] [LMTypewriter-LightCondensed]
- \stoptypescript
-
- \starttypescript [mono] [modern-light,computer-modern-light,latin-modern-light] [name]
- \definefontsynonym [Mono] [LMTypewriter-Light]
- \definefontsynonym [MonoBold] [LMTypewriter-Light]
- \definefontsynonym [MonoItalic] [LMTypewriter-LightOblique]
- \definefontsynonym [MonoSlanted] [LMTypewriter-LightOblique]
- \definefontsynonym [MonoBoldItalic] [LMTypewriter-Light]
- \definefontsynonym [MonoBoldSlanted] [LMTypewriter-Light]
- \definefontsynonym [MonoCaps] [LMTypewriter-Light]
- \definefontsynonym [MonoCapsSlanted] [LMTypewriter-Light]
- \stoptypescript
-
- % Later we will map the real fonts, here we just map synonyms.
-
- \starttypescript [serif] [modern,latin-modern]
- \definefontsynonym [LMRoman-DemiOblique] [LMRoman10-DemiOblique]
- \definefontsynonym [LMRoman-Bold] [LMRoman10-Bold]
- \definefontsynonym [LMRoman-BoldItalic] [LMRoman10-BoldItalic]
- \definefontsynonym [LMRoman-BoldOblique] [LMRoman10-BoldOblique]
- \definefontsynonym [LMRoman-CapsRegular] [LMRoman10-CapsRegular]
- \definefontsynonym [LMRoman-CapsOblique] [LMRoman10-CapsOblique]
- \definefontsynonym [LMRoman-Regular] [LMRoman10-Regular]
- \definefontsynonym [LMRoman-Italic] [LMRoman10-Italic]
- \definefontsynonym [LMRoman-Oblique] [LMRoman10-Oblique]
- \stoptypescript
-
- \starttypescript [sans] [modern,latin-modern]
- \definefontsynonym [LMSans-Regular] [LMSans10-Regular]
- \definefontsynonym [LMSans-BoldOblique] [LMSans10-BoldOblique]
- \definefontsynonym [LMSans-Bold] [LMSans10-Bold]
- \definefontsynonym [LMSans-DemiCondensed] [LMSans10-DemiCondensed]
- \definefontsynonym [LMSans-DemiCondensedOblique] [LMSans10-DemiCondensedOblique]
- \definefontsynonym [LMSans-Oblique] [LMSans10-Oblique]
- \stoptypescript
-
- \starttypescript [mono] [modern,latin-modern,modern-vari,latin-modern-vari,modern-cond,latin-modern-cond]
- \definefontsynonym [LMTypewriter-CapsRegular] [LMTypewriter10-CapsRegular]
- \definefontsynonym [LMTypewriter-CapsOblique] [LMTypewriter10-CapsOblique]
- \definefontsynonym [LMTypewriter-Light] [LMTypewriter10-Light]
- \definefontsynonym [LMTypewriter-LightOblique] [LMTypewriter10-LightOblique]
- \definefontsynonym [LMTypewriter-LightCondensed] [LMTypewriter10-LightCondensed]
- \definefontsynonym [LMTypewriter-LightCondensedOblique] [LMTypewriter10-LightCondensedOblique]
- \definefontsynonym [LMTypewriter-Dark] [LMTypewriter10-Dark]
- \definefontsynonym [LMTypewriter-DarkOblique] [LMTypewriter10-DarkOblique]
- \definefontsynonym [LMTypewriter-Regular] [LMTypewriter10-Regular]
- \definefontsynonym [LMTypewriter-Italic] [LMTypewriter10-Italic]
- \definefontsynonym [LMTypewriter-Oblique] [LMTypewriter10-Oblique]
- \definefontsynonym [LMTypewriterVarWd-Regular] [LMTypewriterVarWd10-Regular]
- \definefontsynonym [LMTypewriterVarWd-Oblique] [LMTypewriterVarWd10-Oblique]
- \definefontsynonym [LMTypewriterVarWd-Light] [LMTypewriterVarWd10-Light]
- \definefontsynonym [LMTypewriterVarWd-LightOblique] [LMTypewriterVarWd10-LightOblique]
- \definefontsynonym [LMTypewriterVarWd-Dark] [LMTypewriterVarWd10-Dark]
- \definefontsynonym [LMTypewriterVarWd-DarkOblique] [LMTypewriterVarWd10-DarkOblique]
- \stoptypescript
-
- \starttypescript [serif] [modern,computer-modern,latin-modern]
- \definefontsynonym [ComputerModern] [LMRoman-Regular]
- \definefontsynonym [ComputerModern-Italic] [LMRoman-Italic]
- \definefontsynonym [ComputerModern-Slanted] [LMRoman-Oblique]
- \definefontsynonym [ComputerModern-Bold] [LMRoman-Bold]
- \definefontsynonym [ComputerModern-BoldItalic] [LMRoman-BoldItalic]
- \definefontsynonym [ComputerModern-BoldSlanted] [LMRoman-BoldOblique]
- \definefontsynonym [ComputerModern-Caps] [LMRoman-CapsRegular]
- \definefontsynonym [ComputerModern-CapsSlanted] [LMRoman-CapsOblique]
- \stoptypescript
-
- \starttypescript [sans] [modern,computer-modern,latin-modern]
- \definefontsynonym [ComputerModernSans] [LMSans-Regular]
- \definefontsynonym [ComputerModernSans-Italic] [LMSans-Oblique]
- \definefontsynonym [ComputerModernSans-Slanted] [LMSans-Oblique]
- \definefontsynonym [ComputerModernSans-Bold] [LMSans-Bold]
- \definefontsynonym [ComputerModernSans-BoldItalic] [LMSans-BoldOblique]
- \definefontsynonym [ComputerModernSans-BoldSlanted] [LMSans-BoldOblique]
- \definefontsynonym [ComputerModernSans-Caps] [LMSans-Regular] % [LMSans-CapsRegular]
- \definefontsynonym [ComputerModernSans-CapsSlanted] [LMSans-Oblique] % [LMSans-CapsOblique]
- \stoptypescript
-
- \starttypescript [mono] [modern,computer-modern,latin-modern]
- \definefontsynonym [ComputerModernMono] [LMTypewriter-Regular]
- \definefontsynonym [ComputerModernMono-Italic] [LMTypewriter-Italic]
- \definefontsynonym [ComputerModernMono-Slanted] [LMTypewriter-Oblique]
- \definefontsynonym [ComputerModernMono-Bold] [LMTypewriter-Dark]
- \definefontsynonym [ComputerModernMono-BoldItalic] [LMTypewriter-DarkOblique] % !
- \definefontsynonym [ComputerModernMono-BoldSlanted] [LMTypewriter-DarkOblique]
- \definefontsynonym [ComputerModernMono-Caps] [LMTypewriter-CapsRegular]
- \definefontsynonym [ComputerModernMono-CapsSlanted] [LMTypewriter-CapsOblique]
- \definefontsynonym [ComputerModernMono-Variable] [LMTypewriterVarWd-Regular]
- \stoptypescript
-
- \starttypescript [serif] [modern-vari,computer-modern-vari,latin-modern-vari]
- \definefontsynonym [ComputerModernVariable] [LMTypewriterVarWd-Regular]
- \definefontsynonym [ComputerModernVariable-Italic] [LMTypewriterVarWd-Oblique]
- \definefontsynonym [ComputerModernVariable-Slanted] [LMTypewriterVarWd-Oblique]
- \definefontsynonym [ComputerModernVariable-Bold] [LMTypewriterVarWd-Dark]
- \definefontsynonym [ComputerModernVariable-BoldItalic] [LMTypewriterVarWd-DarkOblique]
- \definefontsynonym [ComputerModernVariable-BoldSlanted] [LMTypewriterVarWd-DarkOblique]
- \definefontsynonym [ComputerModernVariable-Caps] [LMTypewriterVarWd-Regular]
- \definefontsynonym [ComputerModernVariable-CapsSlanted] [LMTypewriterVarWd-Oblique]
- \stoptypescript
-
- \starttypescript [math] [modern,latin-modern]
- \definefontsynonym [LMMathRoman-Regular] [LMMathRoman10-Regular]
- \definefontsynonym [LMMathRoman-Bold] [LMMathRoman10-Bold]
- \definefontsynonym [LMMathSymbols-BoldItalic] [LMMathSymbols10-BoldItalic]
- \definefontsynonym [LMMathSymbols-Italic] [LMMathSymbols10-Italic]
- \definefontsynonym [LMMathExtension-Regular] [LMMathExtension10-Regular]
- \definefontsynonym [LMMathItalic-Italic] [LMMathItalic10-Italic]
- \definefontsynonym [LMMathItalic-BoldItalic] [LMMathItalic10-BoldItalic]
- \stoptypescript
-
- % can boldmath and bfmath be joined?
- \starttypescript [boldmath] [modern,computer-modern,latin-modern] [name]
- \definefontsynonym [LMMathRoman-Bold] [LMMathRoman10-Bold]
- \definefontsynonym [LMMathExtension-Regular] [LMMathExtension10-Regular]
- \definefontsynonym [LMMathItalic-BoldItalic] [LMMathItalic10-BoldItalic]
- \definefontsynonym [LMMathSymbols-BoldItalic] [LMMathSymbols10-BoldItalic]
- \stoptypescript
-
- \starttypescript [bfmath] [modern,computer-modern,latin-modern] [name]
- \definefontsynonym [LMMathRoman-Bold] [LMMathRoman10-Bold]
- \definefontsynonym [LMMathExtension-Regular] [LMMathExtension10-Regular]
- \definefontsynonym [LMMathItalic-BoldItalic] [LMMathItalic10-BoldItalic]
- \definefontsynonym [LMMathSymbols-BoldItalic] [LMMathSymbols10-BoldItalic]
- \stoptypescript
-
- \starttypescript [serif] [modern,latin-modern,computer-modern]
- \definefontsynonym [cmr5] [LMRoman5-Regular]
- \definefontsynonym [cmr6] [LMRoman6-Regular]
- \definefontsynonym [cmr7] [LMRoman7-Regular]
- \definefontsynonym [cmr8] [LMRoman8-Regular]
- \definefontsynonym [cmr9] [LMRoman9-Regular]
- \definefontsynonym [cmr10] [LMRoman10-Regular]
- \definefontsynonym [cmr12] [LMRoman12-Regular]
- \definefontsynonym [cmr17] [LMRoman17-Regular]
- \definefontsynonym [cmbx5] [LMRoman5-Bold]
- \definefontsynonym [cmbx6] [LMRoman6-Bold]
- \definefontsynonym [cmbx7] [LMRoman7-Bold]
- \definefontsynonym [cmbx8] [LMRoman8-Bold]
- \definefontsynonym [cmbx9] [LMRoman9-Bold]
- \definefontsynonym [cmbx10] [LMRoman10-Bold]
- \definefontsynonym [cmbx12] [LMRoman12-Bold]
- \definefontsynonym [cmsl10] [LMRoman10-Oblique]
- \definefontsynonym [cmsl12] [LMRoman12-Oblique]
- \definefontsynonym [cmsl17] [LMRoman17-Oblique]
- \definefontsynonym [cmsl8] [LMRoman8-Oblique]
- \definefontsynonym [cmsl9] [LMRoman9-Oblique]
- \definefontsynonym [cmti7] [LMRoman7-Italic]
- \definefontsynonym [cmti8] [LMRoman8-Italic]
- \definefontsynonym [cmti9] [LMRoman9-Italic]
- \definefontsynonym [cmti10] [LMRoman10-Italic]
- \definefontsynonym [cmti12] [LMRoman12-Italic]
- \definefontsynonym [cmbsl10] [LMRoman10-DemiOblique]
- \definefontsynonym [cmbxsl10] [LMRoman10-BoldOblique]
- \definefontsynonym [cmbxti10] [LMRoman10-BoldItalic]
- \definefontsynonym [cmcsc10] [LMRoman10-CapsRegular]
- \definefontsynonym [cmcscsl10][LMRoman10-CapsOblique]
-
- %definefontsynonym [cmb10]
- \stoptypescript
-
- \starttypescript [sans] [modern,latin-modern,computer-modern]
- \definefontsynonym [cmss8] [LMSans8-Regular]
- \definefontsynonym [cmss9] [LMSans9-Regular]
- \definefontsynonym [cmss10] [LMSans10-Regular]
- \definefontsynonym [cmss12] [LMSans12-Regular]
- \definefontsynonym [cmss17] [LMSans17-Regular]
- \definefontsynonym [cmssi10] [LMSans10-Oblique]
- \definefontsynonym [cmssi12] [LMSans12-Oblique]
- \definefontsynonym [cmssi17] [LMSans17-Oblique]
- \definefontsynonym [cmssi8] [LMSans8-Oblique]
- \definefontsynonym [cmssi9] [LMSans9-Oblique]
- \definefontsynonym [cmssq8] [LMSansQuotation8-Regular]
- \definefontsynonym [cmssqb8] [LMSansQuotation8-Bold]
- \definefontsynonym [cmssqbi8] [LMSansQuotation8-BoldOblique]
- \definefontsynonym [cmssqi8] [LMSansQuotation8-Oblique]
- \definefontsynonym [cmssbx10] [LMSans10-Bold]
- \definefontsynonym [cmssdc10] [LMSans10-DemiCondensed]
- \definefontsynonym [cmssbi10] [LMSans10-BoldOblique]
- \definefontsynonym [cmssdi10] [LMSans10-DemiCondensedOblique]
- \stoptypescript
-
- \starttypescript [mono] [modern,latin-modern,computer-modern]
- \definefontsynonym [cmtt8] [LMTypewriter8-Regular]
- \definefontsynonym [cmtt9] [LMTypewriter9-Regular]
- \definefontsynonym [cmtt10] [LMTypewriter10-Regular]
- \definefontsynonym [cmtt12] [LMTypewriter12-Regular]
- \definefontsynonym [cmitt10] [LMTypewriter10-Italic]
- \definefontsynonym [cmsltt10] [LMTypewriter10-Oblique]
- \definefontsynonym [cmvtt10] [LMTypewriterVarWd10-Regular]
- \definefontsynonym [cmvtti10] [LMTypewriterVarWd10-Oblique]
- \definefontsynonym [cmtcsc10] [LMTypewriter10-CapsRegular]
- \stoptypescript
-
- \starttypescript [math] [modern,latin-modern,computer-modern]
- \definefontsynonym [cmbsy5] [LMMathSymbols5-BoldItalic]
- \definefontsynonym [cmbsy7] [LMMathSymbols7-BoldItalic]
- \definefontsynonym [cmbsy10] [LMMathSymbols10-BoldItalic]
- \definefontsynonym [cmsy5] [LMMathSymbols5-Italic]
- \definefontsynonym [cmsy6] [LMMathSymbols6-Italic]
- \definefontsynonym [cmsy7] [LMMathSymbols7-Italic]
- \definefontsynonym [cmsy8] [LMMathSymbols8-Italic]
- \definefontsynonym [cmsy9] [LMMathSymbols9-Italic]
- \definefontsynonym [cmsy10] [LMMathSymbols10-Italic]
- \definefontsynonym [cmex10] [LMMathExtension10-Regular]
- \definefontsynonym [cmmi5] [LMMathItalic5-Italic]
- \definefontsynonym [cmmi6] [LMMathItalic6-Italic]
- \definefontsynonym [cmmi7] [LMMathItalic7-Italic]
- \definefontsynonym [cmmi8] [LMMathItalic8-Italic]
- \definefontsynonym [cmmi9] [LMMathItalic9-Italic]
- \definefontsynonym [cmmi10] [LMMathItalic10-Italic]
- \definefontsynonym [cmmi12] [LMMathItalic12-Italic]
- \definefontsynonym [cmmib5] [LMMathItalic5-BoldItalic]
- \definefontsynonym [cmmib7] [LMMathItalic7-BoldItalic]
- \definefontsynonym [cmmib10] [LMMathItalic10-BoldItalic]
- \stoptypescript
-
- % This will change some day.
-
- \starttypescript [math] [modern,computer-modern,latin-modern] [name]
- \definefontsynonym [OldStyle] [MathItalic]
- \definefontsynonym [Fraktur] [eufm10]
- \definefontsynonym [Blackboard] [msbm10]
- \definefontsynonym [Gothic] [eufm10]
- \definefontsynonym [Calligraphic] [cmsy10]
- \stoptypescript
-
- \starttypescript [fallback] [texnansi,ec,qx,t5,default]
- \definetypeface [] [rm] [serif] [modern] [computer-modern] [encoding=\typescripttwo]
- \definetypeface [] [ss] [sans] [modern] [computer-modern] [encoding=\typescripttwo]
- \definetypeface [] [tt] [mono] [modern] [computer-modern] [encoding=\typescripttwo]
- \definetypeface [] [mm] [math] [modern] [computer-modern] [encoding=\typescripttwo]
- \quittypescriptscanning
- \stoptypescript
-
- \starttypescript [modern] [texnansi,ec,qx,t5,default]
- \definetypeface [modern] [rm] [serif] [modern] [computer-modern] [encoding=\typescripttwo]
- \definetypeface [modern] [ss] [sans] [modern] [computer-modern] [encoding=\typescripttwo]
- \definetypeface [modern] [tt] [mono] [modern] [computer-modern] [encoding=\typescripttwo]
- \definetypeface [modern] [mm] [math] [modern] [computer-modern] [encoding=\typescripttwo]
- \quittypescriptscanning
- \stoptypescript
-
- \starttypescript [modern-base] [texnansi,ec,qx,t5,default]
- \definetypeface [modern] [rm] [serif] [modern] [default] [encoding=\typescripttwo]
- \definetypeface [modern] [ss] [sans] [modern] [default] [encoding=\typescripttwo]
- \definetypeface [modern] [tt] [mono] [modern] [default] [encoding=\typescripttwo]
- \definetypeface [modern] [mm] [math] [modern] [default] [encoding=\typescripttwo]
- \quittypescriptscanning
- \stoptypescript
-
- \starttypescript [modern-base] [t2a,t2b,t2c,x2]
- \definetypeface [modern] [rm] [serif] [computer-modern] [default] [encoding=\typescripttwo]
- \definetypeface [modern] [ss] [sans] [computer-modern] [default] [encoding=\typescripttwo]
- \definetypeface [modern] [tt] [mono] [computer-modern] [default] [encoding=\typescripttwo]
- \definetypeface [modern] [mm] [math] [computer-modern] [default] [encoding=\typescripttwo]
- \quittypescriptscanning
- \stoptypescript
-
- \starttypescript [modernvariable] [texnansi,ec,qx,8r,t5]
- \definetypeface [modernvariable] [rm] [serif] [simple] [default] [encoding=\typescripttwo]
- \definetypeface [modernvariable] [ss] [sans] [modern] [default] [encoding=\typescripttwo]
- \definetypeface [modernvariable] [tt] [mono] [modern] [default] [encoding=\typescripttwo]
- \definetypeface [modernvariable] [mm] [math] [modern] [default]
- \quittypescriptscanning
- \stoptypescript
-
- \starttypescript [serif] [simple] [name] % bad, will be changed but in sycn with manuals that use it
- \definefontsynonym [Simple] [cmvtt10]
- \setupfontsynonym [Simple] [handling=pure]
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[concrete]
-
- \starttypescript [serif] [concrete] [name]
- \definefontsynonym [Serif] [ComputerConcrete]
- \definefontsynonym [SerifBold] [ComputerConcrete]
- \definefontsynonym [SerifItalic] [ComputerConcrete-Italic]
- \definefontsynonym [SerifSlanted] [ComputerConcrete-Slanted]
- \definefontsynonym [SerifBoldItalic] [ComputerConcrete-Italic]
- \definefontsynonym [SerifBoldSlanted] [ComputerConcrete-Slanted]
- \definefontsynonym [SerifCaps] [ComputerConcrete-Caps]
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[euler]
-
- \starttypescript [math] [euler] [default]
- \definefontsynonym [Euler-Roman] [zeurm10]
- \definefontsynonym [Euler-Extension] [zeuex10]
- \definefontsynonym [Euler-Symbol] [zeusm10]
- \definefontsynonym [Euler-Fraktur] [eufm10]
- \usemathcollection[eul]
- \loadmapfile[original-ams-euler.map]
- \stoptypescript
-
- \starttypescript [boldmath,bfmath] [euler] [default]
- \definefontsynonym [Euler-Roman-Bold] [zeurb10]
- \definefontsynonym [Euler-Extension] [zeuex10]
- \definefontsynonym [Euler-Symbol-Bold] [zeusb10]
- \definefontsynonym [Euler-Fraktur-Bold] [eufb10]
- \usemathcollection[eul]
- \loadmapfile[original-ams-euler.map]
- \stoptypescript
-
- \starttypescript [math] [euler] [name]
- \definefontsynonym [MathRoman] [Euler-Roman] % mr
- \definefontsynonym [MathItalic] [Euler-Fraktur] % mi
- \definefontsynonym [MathExtension] [Euler-Extension] % ex
- \definefontsynonym [MathSymbol] [Euler-Symbol] % sy
- \stoptypescript
-
- \starttypescript [boldmath] [euler] [name]
- \definefontsynonym [MathRoman] [Euler-Roman-Bold] % mr
- \definefontsynonym [MathItalic] [Euler-Fraktur-Bold] % mi
- \definefontsynonym [MathExtension] [Euler-Extension] % ex
- \definefontsynonym [MathSymbol] [Euler-Symbol-Bold] % sy
- \stoptypescript
-
- \starttypescript [bfmath] [euler] [name]
- \definefontsynonym [MathRomanBold] [Euler-Roman-Bold] % mr
- \definefontsynonym [MathItalicBold] [Euler-Fraktur-Bold] % mi
- \definefontsynonym [MathExtension] [Euler-Extension] % ex
- \definefontsynonym [MathSymbolBold] [Euler-Symbol-Bold] % sy
- \stoptypescript
-
- \starttypescript [math] [euler] [name]
- \definefontsynonym [OldStyle] [MathItalic]
- \definefontsynonym [Fraktur] [MathItalic]
- \definefontsynonym [Gothic] [MathItalic]
- \definefontsynonym [Calligraphic] [MathSymbol]
- \stoptypescript
-
- \starttypescript [boldmath] [euler] [name]
- \definefontsynonym [OldStyle] [MathItalicBold]
- \definefontsynonym [Fraktur] [MathItalicBold]
- \definefontsynonym [Gothic] [MathItalicBold]
- \definefontsynonym [Calligraphic] [MathSymbolBold]
- \stoptypescript
-
- \starttypescript [math,boldmath,bfmath] [euler] [name]
- \usemathcollection[eul]
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[amssymbols]
-
- \starttypescript [math] [modern,computer-modern,latin-modern,ams] [default]
- \definefontsynonym [AMS-SymbolA] [msam10]
- \definefontsynonym [AMS-SymbolB] [msbm10]
- \usemathcollection[default]
- \stoptypescript
-
- \starttypescript [math] [modern,computer-modern,latin-modern,ams] [name]
- \definefontsynonym [MathAlpha] [AMS-SymbolA]
- \definefontsynonym [MathBeta] [AMS-SymbolB]
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[utopia]
-
- \starttypescript [math] [fourier] [default,ec]
- \definefontsynonym [Fourier-Math-Letters] [futr8t] [encoding=ec]
- %definefontsynonym [Fourier-Math-Letters] [futmi]
- \definefontsynonym [Fourier-Math-Letters-Italic] [futmii]
- \definefontsynonym [Fourier-Math-Symbols] [futsy]
- \definefontsynonym [Fourier-Math-Extension] [fourier-mex]
- \usemathcollection[fou]
- \loadmapfile[fourier.map]
- \stoptypescript
-
- \starttypescript [serif] [utopia] [name]
- \definefontsynonym [Serif] [Utopia-Regular]
- \definefontsynonym [SerifItalic] [Utopia-Italic]
- \definefontsynonym [SerifBold] [Utopia-Bold]
- \definefontsynonym [SerifBoldItalic] [Utopia-BoldItalic]
- \definefontsynonym [SerifSlanted] [Utopia-Slanted]
- \definefontsynonym [SerifBoldSlanted] [Utopia-BoldSlanted]
- \definefontsynonym [SerifCaps] [Utopia-Regular-Caps]
- \stoptypescript
-
- \starttypescript [serif] [fourier] [ec]
- \definefontsynonym [Fourier-Regular] [futr8t] [encoding=ec]
- \definefontsynonym [Fourier-Slanted] [futro8t] [encoding=ec]
- \definefontsynonym [Fourier-Italic] [futri8t] [encoding=ec]
- \definefontsynonym [Fourier-RegularCaps] [futrc8t] [encoding=ec]
- \definefontsynonym [Fourier-Bold] [futb8t] [encoding=ec]
- \definefontsynonym [Fourier-BoldSlanted] [futbo8t] [encoding=ec]
- \definefontsynonym [Fourier-BoldItalic] [futbi8t] [encoding=ec]
- \definefontsynonym [Fourier-BoldCaps] [futbc8t] [encoding=ec]
- \definefontsynonym [Fourier-Regular-Expert] [futr9e] [encoding=ec]
- \definefontsynonym [Fourier-Slanted-Expert] [futro9e] [encoding=ec]
- \definefontsynonym [Fourier-Italic-Expert] [futri9e] [encoding=ec]
- \definefontsynonym [Fourier-RegularCaps-Expert] [futrc9e] [encoding=ec]
- \definefontsynonym [Fourier-Semi-Expert] [futs9e] [encoding=ec]
- \definefontsynonym [Fourier-SemiSlanted-Expert] [futso9e] [encoding=ec]
- \definefontsynonym [Fourier-SemiItalic-Expert] [futsi9e] [encoding=ec]
- \definefontsynonym [Fourier-SemiCaps-Expert] [futsc9e] [encoding=ec]
- \definefontsynonym [Fourier-Bold-Expert] [futb9e] [encoding=ec]
- \definefontsynonym [Fourier-BoldSlanted-Expert] [futbo9e] [encoding=ec]
- \definefontsynonym [Fourier-BoldItalic-Expert] [futbi9e] [encoding=ec]
- \definefontsynonym [Fourier-Black-Expert] [futc9e] [encoding=ec]
- \definefontsynonym [Fourier-Regular-OldStyle] [futr9d] [encoding=ec]
- \definefontsynonym [Fourier-Slanted-OldStyle] [futro9d] [encoding=ec]
- \definefontsynonym [Fourier-Italic-OldStyle] [futri9d] [encoding=ec]
- \definefontsynonym [Fourier-RegularCaps-OldStyle] [futrc9d] [encoding=ec]
- \definefontsynonym [Fourier-Semi-OldStyle] [futs9d] [encoding=ec]
- \definefontsynonym [Fourier-SemiSlanted-OldStyle] [futso9d] [encoding=ec]
- \definefontsynonym [Fourier-SemiItalic-OldStyle] [futsi9d] [encoding=ec]
- \definefontsynonym [Fourier-SemiCaps-OldStyle] [futsc9d] [encoding=ec]
- \definefontsynonym [Fourier-Bold-OldStyle] [futb9d] [encoding=ec]
- \definefontsynonym [Fourier-BoldSlanted-OldStyle] [futbo9d] [encoding=ec]
- \definefontsynonym [Fourier-BoldItalic-OldStyle] [futbi9d] [encoding=ec]
- \definefontsynonym [Fourier-Black-OldStyle] [futc9d] [encoding=ec]
- \loadmapfile[fourier.map]
- \loadmapfile[fourier-utopia-expert.map]
- \stoptypescript
-
- \starttypescript [serif] [fourier] [name]
- \definefontsynonym [Serif] [Fourier-Regular]
- \definefontsynonym [SerifSlanted] [Fourier-Slanted]
- \definefontsynonym [SerifItalic] [Fourier-Italic]
- \definefontsynonym [SerifCaps] [Fourier-RegularCaps]
- \definefontsynonym [SerifBold] [Fourier-Bold]
- \definefontsynonym [SerifBoldSlanted] [Fourier-BoldSlanted]
- \definefontsynonym [SerifBoldItalic] [Fourier-BoldItalic]
- \definefontsynonym [SerifBoldCaps] [Fourier-BoldCaps]
-
- \definefontsynonym [Serif-Expert] [Fourier-Regular-Expert]
- \definefontsynonym [SerifSlanted-Expert] [Fourier-Slanted-Expert]
- \definefontsynonym [SerifItalic-Expert] [Fourier-Italic-Expert]
- \definefontsynonym [SerifCaps-Expert] [Fourier-RegularCaps-Expert]
- \definefontsynonym [SerifSemiBold-Expert] [Fourier-Semi-Expert]
- \definefontsynonym [SerifSemiSlanted-Expert] [Fourier-SemiSlanted-Expert]
- \definefontsynonym [SerifSemiItalic-Expert] [Fourier-SemiItalic-Expert]
- \definefontsynonym [SerifSemiCaps-Expert] [Fourier-SemiCaps-Expert]
- \definefontsynonym [SerifBold-Expert] [Fourier-Bold-Expert]
- \definefontsynonym [SerifBoldSlanted-Expert] [Fourier-BoldSlanted-Expert]
- \definefontsynonym [SerifBoldItalic-Expert] [Fourier-BoldItalic-Expert]
- \definefontsynonym [SerifBlack-Expert] [Fourier-Black-Expert]
-
- \definefontsynonym [Serif-OldStyle] [Fourier-Regular-OldStyle]
- \definefontsynonym [SerifSlanted-OldStyle] [Fourier-Slanted-OldStyle]
- \definefontsynonym [SerifItalic-OldStyle] [Fourier-Italic-OldStyle]
- \definefontsynonym [SerifCaps-OldStyle] [Fourier-RegularCaps-OldStyle]
- \definefontsynonym [SerifSemiBold-OldStyle] [Fourier-Semi-OldStyle]
- \definefontsynonym [SerifSemiSlanted-OldStyle] [Fourier-SemiSlanted-OldStyle]
- \definefontsynonym [SerifSemiItalic-OldStyle] [Fourier-SemiItalic-OldStyle]
- \definefontsynonym [SerifSemiCaps-OldStyle] [Fourier-SemiCaps-OldStyle]
- \definefontsynonym [SerifBold-OldStyle] [Fourier-Bold-OldStyle]
- \definefontsynonym [SerifBoldSlanted-OldStyle] [Fourier-BoldSlanted-OldStyle]
- \definefontsynonym [SerifBoldItalic-OldStyle] [Fourier-BoldItalic-OldStyle]
- \definefontsynonym [SerifBlack-OldStyle] [Fourier-Black-OldStyle]
- \definefontsynonym [SerifBlackSlanted-OldStyle] [Fourier-BlackSlanted-OldStyle]
- \stoptypescript
-
- \starttypescript [math] [fourier] [name]
- \definefontsynonym [MathRoman] [Fourier-Math-Letters]
- \definefontsynonym [MathItalic] [Fourier-Math-Letters-Italic]
- \definefontsynonym [MathSymbol] [Fourier-Math-Symbols]
- \definefontsynonym [MathExtension] [Fourier-Math-Extension]
- \stoptypescript
-
- \starttypescript [math] [fourier] [name] % todo
- \definefontsynonym [OldStyle] [Serif-OldStyle] % strange, no oldstyles
- \definefontsynonym [Fraktur] [eufm10]
- \definefontsynonym [Blackboard] [msbm10]
- \definefontsynonym [Gothic] [eufm10]
- \definefontsynonym [Calligraphic] [eusm10]
- \stoptypescript
-
- \starttypescript [serif] [utopia] [ec,texnansi]
- \definefontsynonym [Utopia-Regular] [\typescriptthree-putr8a] [encoding=\typescriptthree]
- \definefontsynonym [Utopia-Italic] [\typescriptthree-putri8a] [encoding=\typescriptthree]
- \definefontsynonym [Utopia-Bold] [\typescriptthree-putb8a] [encoding=\typescriptthree]
- \definefontsynonym [Utopia-BoldItalic] [\typescriptthree-putbi8a] [encoding=\typescriptthree]
- \definefontsynonym [Utopia-Slanted] [\typescriptthree-putr8a-slanted-167] [encoding=\typescriptthree]
- \definefontsynonym [Utopia-BoldSlanted] [\typescriptthree-putb8a-slanted-167] [encoding=\typescriptthree]
- \definefontsynonym [Utopia-Regular-Caps][\typescriptthree-putr8a-capitalized-800] [encoding=\typescriptthree]
- \loadmapfile[\typescriptthree-adobe-utopia.map]
- \stoptypescript
-
- \starttypescript [fourier] [ec]
- \definetypeface [fourier] [rm] [serif] [fourier] [default] [encoding=ec]
- \definetypeface [fourier] [ss] [sans] [modern] [default] [encoding=ec,rscale=1.07]
- \definetypeface [fourier] [tt] [mono] [modern] [default] [encoding=ec,rscale=1.07]
- \definetypeface [fourier] [mm] [math] [fourier] [default] [encoding=default]
- \quittypescriptscanning
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[antykwa]
-
- % Antykwa Torunska (GUST)
-
- % \starttypescript [serif] [antykwa-torunska] [texnansi,ec,8r]
- % \definefontsynonym [AntykwaTorunska-Regular] [\typescriptthree-anttr] [encoding=\typescriptthree]
- % \definefontsynonym [AntykwaTorunska-Bold] [\typescriptthree-anttb] [encoding=\typescriptthree]
- % \definefontsynonym [AntykwaTorunska-Italic] [\typescriptthree-anttri] [encoding=\typescriptthree]
- % \stoptypescript
-
- \starttypescript [serif] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond] [texnansi,qx,t5,ec,t2a,t2b,t2c,greek]
- \definefontsynonym [AntykwaTorunska-Regular] [\typescriptthree-anttr] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-Italic] [\typescriptthree-anttri] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-Bold] [\typescriptthree-anttb] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-BoldItalic] [\typescriptthree-anttbi] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-Light] [\typescriptthree-anttl] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-LightItalic] [\typescriptthree-anttli] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-Medium] [\typescriptthree-anttm] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-MedItalic] [\typescriptthree-anttmi] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondRegular] [\typescriptthree-anttcr] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondItalic] [\typescriptthree-anttcri] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondBold] [\typescriptthree-anttcb] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondBoldItalic] [\typescriptthree-anttcbi] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondLight] [\typescriptthree-anttcl] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondLightItalic][\typescriptthree-anttcli] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondMedium] [\typescriptthree-anttcm] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondMedItalic] [\typescriptthree-anttcmi] [encoding=\typescriptthree]
- \loadmapfile[antt-\typescriptthree.map]
- \stoptypescript
-
- \starttypescript [serif] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond] [texnansi,qx,t5,ec]
- \definefontsynonym [AntykwaTorunska-Cap] [\typescriptthree-anttrcap] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-ItalicCap] [\typescriptthree-anttricap] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-BoldCap] [\typescriptthree-anttbcap] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-BoldItalicCap] [\typescriptthree-anttbicap] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-LightCap] [\typescriptthree-anttlcap] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-LightItalicCap] [\typescriptthree-anttlicap] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-MediumCap] [\typescriptthree-anttmcap] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-MedItalicCap] [\typescriptthree-anttmicap] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondCap] [\typescriptthree-anttcrcap] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondItalicCap] [\typescriptthree-anttcricap] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondBoldCap] [\typescriptthree-anttcbcap] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondBoldItalicCap] [\typescriptthree-anttcbicap] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondLightCap] [\typescriptthree-anttclcap] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondLightItalicCap][\typescriptthree-anttclicap] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondMediumCap] [\typescriptthree-anttcmcap] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondMedItalicCap] [\typescriptthree-anttcmicap] [encoding=\typescriptthree]
- \loadmapfile[antt-\typescriptthree.map]
- \stoptypescript
-
- % duplicates ? ?
- % atl: no: fallbacks for the named variants
-
- \starttypescript [serif] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond] [t2a,t2b,t2c,greek]
- \definefontsynonym [AntykwaTorunska-BoldCap] [\typescriptthree-anttb] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-BoldItalicCap] [\typescriptthree-anttbi] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-LightCap] [\typescriptthree-anttl] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-LightItalicCap] [\typescriptthree-anttli] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-MediumCap] [\typescriptthree-anttm] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-MedItalicCap] [\typescriptthree-anttmi] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-Cap] [\typescriptthree-anttr] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-ItalicCap] [\typescriptthree-anttri] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondBoldCap] [\typescriptthree-anttcb] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondBoldItalicCap] [\typescriptthree-anttcbi] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondLightCap] [\typescriptthree-anttcl] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondLightItalicCap][\typescriptthree-anttcli] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondMediumCap] [\typescriptthree-anttcm] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondMedItalicCap] [\typescriptthree-anttcmi] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondCap] [\typescriptthree-anttcr] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondItalicCap] [\typescriptthree-anttcri] [encoding=\typescriptthree]
- \loadmapfile[antt-\typescriptthree.map]
- \stoptypescript
-
- \starttypescript [serif] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond] [t2a,t2b,t2c]
- \definefontsynonym [AntykwaTorunska-BoldCap] [\typescriptthree-anttb] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-BoldItalicCap] [\typescriptthree-anttbi] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-LightCap] [\typescriptthree-anttl] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-LightItalicCap] [\typescriptthree-anttli] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-MediumCap] [\typescriptthree-anttm] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-MedItalicCap] [\typescriptthree-anttmi] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-Cap] [\typescriptthree-anttr] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-ItalicCap] [\typescriptthree-anttri] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondBoldCap] [\typescriptthree-anttcb] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondBoldItalicCap] [\typescriptthree-anttcbi] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondLightCap] [\typescriptthree-anttcl] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondLightItalicCap][\typescriptthree-anttcli] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondMediumCap] [\typescriptthree-anttcm] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondMedItalicCap] [\typescriptthree-anttcmi] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondCap] [\typescriptthree-anttcr] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaTorunska-CondItalicCap] [\typescriptthree-anttcri] [encoding=\typescriptthree]
- \loadmapfile[antt-\typescriptthree.map]
- \stoptypescript
-
- % mabye no -Regular etc
- % dunny reverse of condlight lightcond
-
- \starttypescript [math] [antykwa-torunska] [default]
- \definefontsynonym [AntykwaTorunska-Math-Letters-Regular] [rm-anttr]
- \definefontsynonym [AntykwaTorunska-Math-Letters-Italic] [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-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-CondItalic] [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-anttcli]
- \definefontsynonym [AntykwaTorunska-Math-Symbols-CondLight] [sy-anttclz]
- \definefontsynonym [AntykwaTorunska-Math-Extension-CondLight] [ex-anttcl]
- \stoptypescript
-
- \starttypescript [math] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond] [default]
- \usemathcollection[default]
- \loadmapfile[antt-rm.map]
- \loadmapfile[antt-mi.map]
- \loadmapfile[antt-sy.map]
- \loadmapfile[antt-ex.map]
- \stoptypescript
-
- \starttypescript [serif] [antykwa-torunska] [name]
- \definefontsynonym [Serif] [AntykwaTorunska-Regular]
- \definefontsynonym [SerifBold] [AntykwaTorunska-Bold]
- \definefontsynonym [SerifItalic] [AntykwaTorunska-Italic]
- \definefontsynonym [SerifSlanted] [AntykwaTorunska-Italic]
- \definefontsynonym [SerifBoldItalic] [AntykwaTorunska-BoldItalic]
- \definefontsynonym [SerifBoldSlanted] [AntykwaTorunska-BoldItalic]
- \definefontsynonym [SerifCaps] [AntykwaTorunska-Cap]
- \stoptypescript
-
- \starttypescript [serif] [antykwa-torunska-light] [name]
- \definefontsynonym [Serif] [AntykwaTorunska-Light]
- \definefontsynonym [SerifBold] [AntykwaTorunska-Medium]
- \definefontsynonym [SerifItalic] [AntykwaTorunska-LightItalic]
- \definefontsynonym [SerifSlanted] [AntykwaTorunska-LightItalic]
- \definefontsynonym [SerifBoldItalic] [AntykwaTorunska-MedItalic]
- \definefontsynonym [SerifBoldSlanted] [AntykwaTorunska-MedItalic]
- \definefontsynonym [SerifCaps] [AntykwaTorunska-LightCap]
- \stoptypescript
-
- \starttypescript [serif] [antykwa-torunska-cond] [name]
- \definefontsynonym [Serif] [AntykwaTorunska-CondRegular]
- \definefontsynonym [SerifBold] [AntykwaTorunska-CondBold]
- \definefontsynonym [SerifItalic] [AntykwaTorunska-CondItalic]
- \definefontsynonym [SerifSlanted] [AntykwaTorunska-CondItalic]
- \definefontsynonym [SerifBoldItalic] [AntykwaTorunska-CondBoldItalic]
- \definefontsynonym [SerifBoldSlanted] [AntykwaTorunska-CondBoldItalic]
- \definefontsynonym [SerifCaps] [AntykwaTorunska-CondCap]
- \stoptypescript
-
- \starttypescript [serif] [antykwa-torunska-lightcond] [name]
- \definefontsynonym [Serif] [AntykwaTorunska-CondLight]
- \definefontsynonym [SerifBold] [AntykwaTorunska-CondMedium]
- \definefontsynonym [SerifItalic] [AntykwaTorunska-CondLightItalic]
- \definefontsynonym [SerifSlanted] [AntykwaTorunska-CondLightItalic]
- \definefontsynonym [SerifBoldItalic] [AntykwaTorunska-CondMedItalic]
- \definefontsynonym [SerifBoldSlanted] [AntykwaTorunska-CondMedItalic]
- \definefontsynonym [SerifCaps] [AntykwaTorunska-CondLightCap]
- \stoptypescript
-
- \starttypescript [serif] [antykwa-torunska] [name]
- \definefontsynonym [SerifRegular] [Serif]
- \definefontsynonym [SerifRegularCaps] [AntykwaTorunska-Cap]
- \definefontsynonym [SerifBoldCaps] [AntykwaTorunska-BoldCap]
- \definefontsynonym [SerifItalicCaps] [AntykwaTorunska-ItalicCap]
- \definefontsynonym [SerifSlantedCaps] [AntykwaTorunska-ItalicCap]
- \definefontsynonym [SerifBoldItalicCaps] [AntykwaTorunska-BoldItalicCap]
- \definefontsynonym [SerifBoldSlantedCaps] [AntykwaTorunska-BoldItalicCap]
- \definefontsynonym [SerifCapsCaps] [AntykwaTorunska-Cap]
-
- \definefontvariant [Serif][osf][Caps]
- \definefontvariant [Serif][sc] [Caps]
-
- \definefontsynonym [SerifRegularLight] [AntykwaTorunska-Light]
- \definefontsynonym [SerifBoldLight] [AntykwaTorunska-Medium]
- \definefontsynonym [SerifItalicLight] [AntykwaTorunska-LightItalic]
- \definefontsynonym [SerifSlantedLight] [AntykwaTorunska-LightItalic]
- \definefontsynonym [SerifBoldItalicLight] [AntykwaTorunska-MedItalic]
- \definefontsynonym [SerifBoldSlantedLight] [AntykwaTorunska-MedItalic]
- \definefontsynonym [SerifCapsLight] [AntykwaTorunska-LightCap]
-
- \definefontvariant [Serif][lt][Light]
-
- \definefontsynonym [SerifRegularCond] [AntykwaTorunska-CondRegular]
- \definefontsynonym [SerifBoldCond] [AntykwaTorunska-CondBold]
- \definefontsynonym [SerifItalicCond] [AntykwaTorunska-CondItalic]
- \definefontsynonym [SerifSlantedCond] [AntykwaTorunska-CondItalic]
- \definefontsynonym [SerifBoldItalicCond] [AntykwaTorunska-CondBoldItalic]
- \definefontsynonym [SerifBoldSlantedCond] [AntykwaTorunska-CondBoldItalic]
- \definefontsynonym [SerifCapsCond] [AntykwaTorunska-CondCap]
-
- \definefontvariant [Serif][cond][Cond]
-
- \stoptypescript
-
- \starttypescript [serif] [antykwa-torunska-light] [name]
- \definefontsynonym [SerifRegular] [Serif]
- \definefontsynonym [SerifRegularCaps] [AntykwaTorunska-LightCap]
- \definefontsynonym [SerifBoldCaps] [AntykwaTorunska-MediumCap]
- \definefontsynonym [SerifItalicCaps] [AntykwaTorunska-LightItalicCap]
- \definefontsynonym [SerifSlantedCaps] [AntykwaTorunska-LightItalicCap]
- \definefontsynonym [SerifBoldItalicCaps] [AntykwaTorunska-MedItalicCap]
- \definefontsynonym [SerifBoldSlantedCaps] [AntykwaTorunska-MedItalicCap]
- \definefontsynonym [SerifCapsCaps] [AntykwaTorunska-LightCap]
-
- \definefontvariant [Serif][osf][Caps]
- \definefontvariant [Serif][sc] [Caps]
-
- \definefontsynonym [SerifRegularDark] [AntykwaTorunska-Regular]
- \definefontsynonym [SerifBoldDark] [AntykwaTorunska-Bold]
- \definefontsynonym [SerifItalicDark] [AntykwaTorunska-Italic]
- \definefontsynonym [SerifSlantedDark] [AntykwaTorunska-Italic]
- \definefontsynonym [SerifBoldItalicDark] [AntykwaTorunska-BoldItalic]
- \definefontsynonym [SerifBoldSlantedDark] [AntykwaTorunska-BoldItalic]
- \definefontsynonym [SerifCapsDark] [AntykwaTorunska-Cap]
-
- \definefontvariant [Serif][dk][Dark]
-
- \definefontsynonym [SerifRegularCond] [AntykwaTorunska-CondLight]
- \definefontsynonym [SerifBoldCond] [AntykwaTorunska-CondMedium]
- \definefontsynonym [SerifItalicCond] [AntykwaTorunska-CondLightItalic]
- \definefontsynonym [SerifSlantedCond] [AntykwaTorunska-CondLightItalic]
- \definefontsynonym [SerifBoldItalicCond] [AntykwaTorunska-CondMedItalic]
- \definefontsynonym [SerifBoldSlantedCond] [AntykwaTorunska-CondMedItalic]
- \definefontsynonym [SerifCapsCond] [AntykwaTorunska-CondLightCap]
-
- \definefontvariant [Serif][cond][Cond]
-
- \stoptypescript
-
- \starttypescript [serif] [antykwa-torunska-cond] [name]
- \definefontsynonym [SerifRegular] [Serif]
- \definefontsynonym [SerifRegularCaps] [AntykwaTorunska-CondCap]
- \definefontsynonym [SerifBoldCaps] [AntykwaTorunska-CondBoldCap]
- \definefontsynonym [SerifItalicCaps] [AntykwaTorunska-CondItalicCap]
- \definefontsynonym [SerifSlantedCaps] [AntykwaTorunska-CondItalicCap]
- \definefontsynonym [SerifBoldItalicCaps] [AntykwaTorunska-CondBoldItalicCap]
- \definefontsynonym [SerifBoldSlantedCaps] [AntykwaTorunska-CondBoldItalicCap]
- \definefontsynonym [SerifCapsCaps] [AntykwaTorunska-CondCap]
-
- \definefontvariant [Serif][osf][Caps]
- \definefontvariant [Serif][sc] [Caps]
-
- \definefontsynonym [SerifRegularLight] [AntykwaTorunska-CondLight]
- \definefontsynonym [SerifBoldLight] [AntykwaTorunska-CondMedium]
- \definefontsynonym [SerifItalicLight] [AntykwaTorunska-CondLightItalic]
- \definefontsynonym [SerifSlantedLight] [AntykwaTorunska-CondLightItalic]
- \definefontsynonym [SerifBoldItalicLight] [AntykwaTorunska-CondMedItalic]
- \definefontsynonym [SerifBoldSlantedLight] [AntykwaTorunska-CondMedItalic]
- \definefontsynonym [SerifCapsLight] [AntykwaTorunska-CondLightCap]
-
- \definefontvariant [Serif][lt][Light]
-
- \definefontsynonym [SerifRegularExp] [AntykwaTorunska-Regular]
- \definefontsynonym [SerifBoldExp] [AntykwaTorunska-Bold]
- \definefontsynonym [SerifItalicExp] [AntykwaTorunska-Italic]
- \definefontsynonym [SerifSlantedExp] [AntykwaTorunska-Italic]
- \definefontsynonym [SerifBoldItalicExp] [AntykwaTorunska-BoldItalic]
- \definefontsynonym [SerifBoldSlantedExp] [AntykwaTorunska-BoldItalic]
- \definefontsynonym [SerifCapsExp] [AntykwaTorunska-Cap]
-
- \definefontvariant [Serif][exp][Exp]
-
- \stoptypescript
-
- \starttypescript [serif] [antykwa-torunska-lightcond] [name]
- \definefontsynonym [SerifRegular] [Serif]
- \definefontsynonym [SerifRegularCaps] [AntykwaTorunska-CondLightCap]
- \definefontsynonym [SerifBoldCaps] [AntykwaTorunska-CondMediumCap]
- \definefontsynonym [SerifItalicCaps] [AntykwaTorunska-CondLightItalicCap]
- \definefontsynonym [SerifSlantedCaps] [AntykwaTorunska-CondLightItalicCap]
- \definefontsynonym [SerifBoldItalicCaps] [AntykwaTorunska-CondMedItalicCap]
- \definefontsynonym [SerifBoldSlantedCaps] [AntykwaTorunska-CondMedItalicCap]
- \definefontsynonym [SerifCapsCaps] [AntykwaTorunska-CondLightCap]
-
- \definefontvariant [Serif][osf][Caps]
- \definefontvariant [Serif][sc] [Caps]
-
- \definefontsynonym [SerifRegularDark] [AntykwaTorunska-CondRegular]
- \definefontsynonym [SerifBoldDark] [AntykwaTorunska-CondBold]
- \definefontsynonym [SerifItalicDark] [AntykwaTorunska-CondItalic]
- \definefontsynonym [SerifSlantedDark] [AntykwaTorunska-CondItalic]
- \definefontsynonym [SerifBoldItalicDark] [AntykwaTorunska-CondBoldItalic]
- \definefontsynonym [SerifBoldSlantedDark] [AntykwaTorunska-CondBoldItalic]
- \definefontsynonym [SerifCapsDark] [AntykwaTorunska-CondCap]
-
- \definefontvariant [Serif][dk][Dark]
-
- \definefontsynonym [SerifRegularExp] [AntykwaTorunska-Light]
- \definefontsynonym [SerifBoldExp] [AntykwaTorunska-Medium]
- \definefontsynonym [SerifItalicExp] [AntykwaTorunska-LightItalic]
- \definefontsynonym [SerifSlantedExp] [AntykwaTorunska-LightItalic]
- \definefontsynonym [SerifBoldItalicExp] [AntykwaTorunska-MedItalic]
- \definefontsynonym [SerifBoldSlantedExp] [AntykwaTorunska-MedItalic]
- \definefontsynonym [SerifCapsExp] [AntykwaTorunska-LightCap]
-
- \definefontvariant [Serif][exp][Exp]
-
- \stoptypescript
-
- % maybe no -Regular etc
-
- \starttypescript [math] [antykwa-torunska-light] [name]
- \definefontsynonym [MathRoman] [AntykwaTorunska-Math-Letters-Light]
- \definefontsynonym [MathItalic] [AntykwaTorunska-Math-Letters-LightItalic]
- \definefontsynonym [MathSymbol] [AntykwaTorunska-Math-Symbols-Light]
- \definefontsynonym [MathExtension] [AntykwaTorunska-Math-Extension-Light]
- \stoptypescript
-
- \starttypescript [math] [antykwa-torunska] [name]
- \definefontsynonym [MathRoman] [AntykwaTorunska-Math-Letters-Regular]
- \definefontsynonym [MathItalic] [AntykwaTorunska-Math-Letters-Italic]
- \definefontsynonym [MathSymbol] [AntykwaTorunska-Math-Symbols-Regular]
- \definefontsynonym [MathExtension] [AntykwaTorunska-Math-Extension-Regular]
- \stoptypescript
-
- \starttypescript [math] [antykwa-torunska-cond] [name]
- \definefontsynonym [MathRoman] [AntykwaTorunska-Math-Letters-CondRegular]
- \definefontsynonym [MathItalic] [AntykwaTorunska-Math-Letters-CondItalic]
- \definefontsynonym [MathSymbol] [AntykwaTorunska-Math-Symbols-CondRegular]
- \definefontsynonym [MathExtension] [AntykwaTorunska-Math-Extension-CondRegular]
- \stoptypescript
-
- \starttypescript [math] [antykwa-torunska-lightcond] [name]
- \definefontsynonym [MathRoman] [AntykwaTorunska-Math-Letters-CondLight]
- \definefontsynonym [MathItalic] [AntykwaTorunska-Math-Letters-CondLightItalic]
- \definefontsynonym [MathSymbol] [AntykwaTorunska-Math-Symbols-CondLight]
- \definefontsynonym [MathExtension] [AntykwaTorunska-Math-Extension-CondLight]
- \stoptypescript
-
- \starttypescript [antykwa-torunska] [texnansi,ec,8r,uc,t5,t2a]
- \definetypeface[antykwa][rm][serif][antykwa-torunska] [default][encoding=\typescripttwo]
- \definetypeface[antykwa][ss][sans] [modern] [default][encoding=\typescripttwo,rscale=1.05]
- \definetypeface[antykwa][tt][mono] [modern] [default][encoding=\typescripttwo,rscale=1.1]
- \definetypeface[antykwa][mm][math] [antykwa-torunska] [default][encoding=\typescripttwo]
- \quittypescriptscanning
- \stoptypescript
-
- % Antykwa Poltawskiego (GUST)
-
- \starttypescript [serif] [antykwa-poltawskiego,antykwa-poltawskiego-light] [ec,texnansi,qx,t5]
-
- \definefontsynonym [AntykwaPoltawskiego-Condensed-Light] [\typescriptthree-antpl17] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-LightItalic] [\typescriptthree-antpli17] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-Regular] [\typescriptthree-antpr17] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-Italic] [\typescriptthree-antpri17] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-Medium] [\typescriptthree-antpm17] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-MediumItalic] [\typescriptthree-antpmi17] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-Bold] [\typescriptthree-antpb17] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-BoldItalic] [\typescriptthree-antpbi17] [encoding=\typescriptthree]
-
- \definefontsynonym [AntykwaPoltawskiego-Condensed-CapsLight] [\typescriptthree-antpl17-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-CapsLightItalic] [\typescriptthree-antpli17-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-CapsRegular] [\typescriptthree-antpr17-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-CapsItalic] [\typescriptthree-antpri17-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-CapsMedium] [\typescriptthree-antpm17-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-CapsMediumItalic] [\typescriptthree-antpmi17-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-CapsBold] [\typescriptthree-antpb17-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-CapsBoldItalic] [\typescriptthree-antpbi17-sc] [encoding=\typescriptthree]
-
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-Regular] [\typescriptthree-antpl12] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-Italic] [\typescriptthree-antpli12] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-Regular] [\typescriptthree-antpr12] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-Italic] [\typescriptthree-antpri12] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-Medium] [\typescriptthree-antpm12] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-MediumItalic] [\typescriptthree-antpmi12] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-Bold] [\typescriptthree-antpb12] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-BoldItalic] [\typescriptthree-antpbi12] [encoding=\typescriptthree]
-
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-CapsRegular] [\typescriptthree-antpl12-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-CapsItalic] [\typescriptthree-antpli12-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-CapsRegular] [\typescriptthree-antpr12-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-CapsItalic] [\typescriptthree-antpri12-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-CapsMedium] [\typescriptthree-antpm12-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-CapsMediumItalic] [\typescriptthree-antpmi12-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-CapsBold] [\typescriptthree-antpb12-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-CapsBoldItalic] [\typescriptthree-antpbi12-sc] [encoding=\typescriptthree]
-
- \definefontsynonym [AntykwaPoltawskiego-Light] [\typescriptthree-antpl10] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-LightItalic] [\typescriptthree-antpli10] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Regular] [\typescriptthree-antpr10] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Italic] [\typescriptthree-antpri10] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Medium] [\typescriptthree-antpm10] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-MediumItalic] [\typescriptthree-antpmi10] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Bold] [\typescriptthree-antpb10] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-BoldItalic] [\typescriptthree-antpbi10] [encoding=\typescriptthree]
-
- \definefontsynonym [AntykwaPoltawskiego-CapsLight] [\typescriptthree-antpl10-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-CapsLightItalic] [\typescriptthree-antpli10-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-CapsRegular] [\typescriptthree-antpr10-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-CapsItalic] [\typescriptthree-antpri10-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-CapsMedium] [\typescriptthree-antpm10-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-CapsMediumItalic] [\typescriptthree-antpmi10-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-CapsBold] [\typescriptthree-antpb10-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-CapsBoldItalic] [\typescriptthree-antpbi10-sc] [encoding=\typescriptthree]
-
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-Light] [\typescriptthree-antpl8] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-LightItalic] [\typescriptthree-antpli8] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-Regular] [\typescriptthree-antpr8] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-Italic] [\typescriptthree-antpri8] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-Medium] [\typescriptthree-antpm8] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-MediumItalic] [\typescriptthree-antpmi8] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-Bold] [\typescriptthree-antpb8] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-BoldItalic] [\typescriptthree-antpbi8] [encoding=\typescriptthree]
-
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-CapsLight] [\typescriptthree-antpl8-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-CapsLightItalic] [\typescriptthree-antpli8-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-CapsRegular] [\typescriptthree-antpr8-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-CapsItalic] [\typescriptthree-antpri8-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-CapsMedium] [\typescriptthree-antpm8-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-CapsMediumItalic] [\typescriptthree-antpmi8-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-CapsBold] [\typescriptthree-antpb8-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-CapsBoldItalic] [\typescriptthree-antpbi8-sc] [encoding=\typescriptthree]
-
- \definefontsynonym [AntykwaPoltawskiego-Expanded-Light] [\typescriptthree-antpl6] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-LightItalic] [\typescriptthree-antpli6] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-Regular] [\typescriptthree-antpr6] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-Italic] [\typescriptthree-antpri6] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-Medium] [\typescriptthree-antpm6] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-MediumItalic] [\typescriptthree-antpmi6] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-Bold] [\typescriptthree-antpb6] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-BoldItalic] [\typescriptthree-antpbi6] [encoding=\typescriptthree]
-
- \definefontsynonym [AntykwaPoltawskiego-Expanded-CapsLight] [\typescriptthree-antpl6-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-CapsLightItalic] [\typescriptthree-antpli6-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-CapsRegular] [\typescriptthree-antpr6-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-CapsItalic] [\typescriptthree-antpri6-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-CapsMedium] [\typescriptthree-antpm6-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-CapsMediumItalic] [\typescriptthree-antpmi6-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-CapsBold] [\typescriptthree-antpb6-sc] [encoding=\typescriptthree]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-CapsBoldItalic] [\typescriptthree-antpbi6-sc] [encoding=\typescriptthree]
-
- % \loadmapfile[poltawski-\typescriptthree.map]
- \loadmapfile[ap-\typescriptthree.map]
- \stoptypescript
-
- \starttypescript [serif] [antykwa-poltawskiego] [name]
- \definefontsynonym [Serif] [AntykwaPoltawskiego-Regular]
- \definefontsynonym [SerifBold] [AntykwaPoltawskiego-Bold]
- \definefontsynonym [SerifItalic] [AntykwaPoltawskiego-Italic]
- \definefontsynonym [SerifSlanted] [AntykwaPoltawskiego-Italic]
- \definefontsynonym [SerifBoldItalic] [AntykwaPoltawskiego-BoldItalic]
- \definefontsynonym [SerifBoldSlanted] [AntykwaPoltawskiego-BoldItalic]
- \definefontsynonym [SerifCaps] [AntykwaPoltawskiego-CapsRegular]
- \stoptypescript
-
- \starttypescript [serif] [antykwa-poltawskiego-light] [name]
- \definefontsynonym [Serif] [AntykwaPoltawskiego-Light]
- \definefontsynonym [SerifBold] [AntykwaPoltawskiego-Medium]
- \definefontsynonym [SerifItalic] [AntykwaPoltawskiego-LightItalic]
- \definefontsynonym [SerifSlanted] [AntykwaPoltawskiego-LightItalic]
- \definefontsynonym [SerifBoldItalic] [AntykwaPoltawskiego-MediumItalic]
- \definefontsynonym [SerifBoldSlanted] [AntykwaPoltawskiego-MediumItalic]
- \definefontsynonym [SerifCaps] [AntykwaPoltawskiego-CapsLight]
- \stoptypescript
-
- % condensed and extended variants are still missing
-
- \starttypescript [antykwa-poltawskiego,antykwa-poltawskiego-light] [ec,texnansi,qx,t5]
- \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default] [encoding=\typescripttwo]
- \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [encoding=\typescripttwo,rscale=1.05] % scaling?
- \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [encoding=\typescripttwo,rscale=1.05] % scaling?
- \definetypeface [\typescriptone] [mm] [math] [modern] [default] [encoding=\typescripttwo,rscale=1.05] % scaling?
- \quittypescriptscanning
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[iwona]
-
- % maybe this will change in Iwona-Math-Letters and Iwona-Math-Letters-Italic
-
- \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-Regular] [\typescriptthree-iwonar] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-Italic] [\typescriptthree-iwonari] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-Bold] [\typescriptthree-iwonab] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-BoldItalic] [\typescriptthree-iwonabi] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-Light-Regular] [\typescriptthree-iwonal] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-Light-Italic] [\typescriptthree-iwonali] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-Medium-Regular] [\typescriptthree-iwonam] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-Medium-Italic] [\typescriptthree-iwonami] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-Heavy-Regular] [\typescriptthree-iwonah] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-Heavy-Italic] [\typescriptthree-iwonahi] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsRegular] [\typescriptthree-iwonar-sc] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsItalic] [\typescriptthree-iwonari-sc] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsBold] [\typescriptthree-iwonab-sc] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsBoldItalic] [\typescriptthree-iwonabi-sc] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsLight-Regular] [\typescriptthree-iwonal-sc] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsLight-Italic] [\typescriptthree-iwonali-sc] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsMedium-Regular] [\typescriptthree-iwonam-sc] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsMedium-Italic] [\typescriptthree-iwonami-sc] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsHeavy-Regular] [\typescriptthree-iwonah-sc] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsHeavy-Italic] [\typescriptthree-iwonahi-sc] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CondRegular] [\typescriptthree-iwonacr] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CondItalic] [\typescriptthree-iwonacri] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CondBold] [\typescriptthree-iwonacb] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CondBoldItalic] [\typescriptthree-iwonacbi] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CondLight-Regular] [\typescriptthree-iwonacl] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CondLight-Italic] [\typescriptthree-iwonacli] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CondMedium-Regular] [\typescriptthree-iwonacm] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CondMedium-Italic] [\typescriptthree-iwonacmi] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CondHeavy-Regular] [\typescriptthree-iwonach] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CondHeavy-Italic] [\typescriptthree-iwonachi] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsCondRegular] [\typescriptthree-iwonacr-sc] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsCondItalic] [\typescriptthree-iwonacri-sc] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsCondBold] [\typescriptthree-iwonacb-sc] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsCondBoldItalic] [\typescriptthree-iwonacbi-sc] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsCondLight-Regular] [\typescriptthree-iwonacl-sc] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsCondLight-Italic] [\typescriptthree-iwonacli-sc] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsCondMedium-Regular][\typescriptthree-iwonacm-sc] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsCondMedium-Italic] [\typescriptthree-iwonacmi-sc] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsCondHeavy-Regular] [\typescriptthree-iwonach-sc] [encoding=\typescriptthree]
- \definefontsynonym[Iwona-CapsCondHeavy-Italic] [\typescriptthree-iwonachi-sc] [encoding=\typescriptthree]
- \loadmapfile[iwona-\typescriptthree.map]
- \stoptypescript
-
- \starttypescript [math] [iwona] [default]
- \definefontsynonym [Iwona-Math-Letters-Regular] [rm-iwonar]
- \definefontsynonym [Iwona-Math-Letters-Italic] [mi-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-Regular] [rm-iwonal]
- \definefontsynonym [Iwona-Math-Letters-Light-Italic] [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-Regular][rm-iwonam]
- \definefontsynonym [Iwona-Math-Letters-Medium-Italic] [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-Regular] [rm-iwonah]
- \definefontsynonym [Iwona-Math-Letters-Heavy-Italic] [mi-iwonahi]
- \definefontsynonym [Iwona-Math-Symbols-Heavy] [sy-iwonahz]
- \definefontsynonym [Iwona-Math-Extension-Heavy] [ex-iwonah]
- \stoptypescript
-
- \starttypescript [math] [iwona,iwona-light,iwona-medium,iwona-heavy] [default]
- \usemathcollection[default]
- \loadmapfile[iwona-rm.map]
- \loadmapfile[iwona-mi.map]
- \loadmapfile[iwona-sy.map]
- \loadmapfile[iwona-ex.map]
- \stoptypescript
-
- \starttypescript [sans] [iwona-light] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-Light-Regular]
- \definefontsynonym [SansItalic] [Iwona-Light-Italic]
- \definefontsynonym [SansBold] [Iwona-Medium-Regular]
- \definefontsynonym [SansBoldItalic] [Iwona-Medium-Italic]
- \definefontsynonym [SansCaps] [Iwona-CapsLight]
- \definefontsynonym [SansItalicCaps] [Iwona-CapsLightItalic]
- \definefontsynonym [SansBoldCaps] [Iwona-CapsMedium]
- \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsMediumItalic]
- \stoptypescript
-
- \starttypescript [sans] [iwona-light-caps] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-CapsLight-Regular]
- \definefontsynonym [SansItalic] [Iwona-CapsLight-Italic]
- \definefontsynonym [SansBold] [Iwona-CapsMedium-Regular]
- \definefontsynonym [SansBoldItalic] [Iwona-CapsMedium-Italic]
- \stoptypescript
-
- \starttypescript [sans] [iwona] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-Regular]
- \definefontsynonym [SansItalic] [Iwona-Italic]
- \definefontsynonym [SansBold] [Iwona-Bold]
- \definefontsynonym [SansBoldItalic] [Iwona-BoldItalic]
- \definefontsynonym [SansCaps] [Iwona-CapsRegular]
- \definefontsynonym [SansItalicCaps] [Iwona-CapsItalic]
- \definefontsynonym [SansBoldCaps] [Iwona-CapsBold]
- \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsBoldItalic]
- \stoptypescript
-
- \starttypescript [sans] [iwona-caps] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-CapsRegular]
- \definefontsynonym [SansItalic] [Iwona-CapsItalic]
- \definefontsynonym [SansBold] [Iwona-CapsBold]
- \definefontsynonym [SansBoldItalic] [Iwona-CapsBoldItalic]
- \stoptypescript
-
- \starttypescript [sans] [iwona-medium] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-Medium-Regular]
- \definefontsynonym [SansItalic] [Iwona-Medium-Italic]
- \definefontsynonym [SansBold] [Iwona-Heavy-Regular]
- \definefontsynonym [SansBoldItalic] [Iwona-Heavy-Italic]
- \definefontsynonym [SansCaps] [Iwona-CapsHeavy-Regular]
- \definefontsynonym [SansItalicCaps] [Iwona-CapsMedium-Italic]
- \definefontsynonym [SansBoldCaps] [Iwona-CapsHeavy-Regular]
- \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsHeavy-Italic]
- \stoptypescript
-
- \starttypescript [sans] [iwona-medium-caps] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-CapsHeavy-Regular]
- \definefontsynonym [SansItalic] [Iwona-CapsMedium-Italic]
- \definefontsynonym [SansBold] [Iwona-CapsHeavy-Regular]
- \definefontsynonym [SansBoldItalic] [Iwona-CapsHeavy-Italic]
- \stoptypescript
-
- \starttypescript [sans] [iwona-heavy] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-Heavy-Regular]
- \definefontsynonym [SansItalic] [Iwona-Heavy-Italic]
- \definefontsynonym [SansBold] [Iwona-Heavy-Regular]
- \definefontsynonym [SansBoldItalic] [Iwona-Heavy-Italic]
- \definefontsynonym [SansCaps] [Iwona-CapsHeavy-Regular]
- \definefontsynonym [SansItalicCaps] [Iwona-CapsHeavy-Italic]
- \definefontsynonym [SansBoldCaps] [Iwona-CapsHeavy-Regular]
- \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsHeavy-Italic]
- \stoptypescript
-
- \starttypescript [sans] [iwona-heavy-caps] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [SansCaps] [Iwona-CapsHeavy-Regular]
- \definefontsynonym [SansItalicCaps] [Iwona-CapsHeavy-Italic]
- \definefontsynonym [SansBoldCaps] [Iwona-CapsHeavy-Regular]
- \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsHeavy-Italic]
- \stoptypescript
-
- \starttypescript [sans] [iwona-light-cond] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-CondLight-Regular]
- \definefontsynonym [SansItalic] [Iwona-CondLight-Italic]
- \definefontsynonym [SansBold] [Iwona-CondMedium-Regular]
- \definefontsynonym [SansBoldItalic] [Iwona-CondMedium-Italic]
- \definefontsynonym [SansCaps] [Iwona-CapsCondLight-Regular]
- \definefontsynonym [SansItalicCaps] [Iwona-CapsCondLight-Italic]
- \definefontsynonym [SansBoldCaps] [Iwona-CapsCondMedium-Regular]
- \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsCondMedium-Italic]
- \stoptypescript
-
- \starttypescript [sans] [iwona-light-cond-caps,iwona-light-caps-cond] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-CapsCondLight-Regular]
- \definefontsynonym [SansItalic] [Iwona-CapsCondLight-Italic]
- \definefontsynonym [SansBold] [Iwona-CapsCondMedium-Regular]
- \definefontsynonym [SansBoldItalic] [Iwona-CapsCondMedium-Italic]
- \stoptypescript
-
- \starttypescript [sans] [iwona-cond] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-CondRegular]
- \definefontsynonym [SansItalic] [Iwona-CondItalic]
- \definefontsynonym [SansBold] [Iwona-CondBold]
- \definefontsynonym [SansBoldItalic] [Iwona-CondBoldItalic]
- \definefontsynonym [SansCaps] [Iwona-CapsCondRegular]
- \definefontsynonym [SansItalicCaps] [Iwona-CapsCondItalic]
- \definefontsynonym [SansBoldCaps] [Iwona-CapsCondBold]
- \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsCondBoldItalic]
- \stoptypescript
-
- \starttypescript [sans] [iwona-cond-caps,iwona-caps-cond] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-CapsCondRegular]
- \definefontsynonym [SansItalic] [Iwona-CapsCondItalic]
- \definefontsynonym [SansBold] [Iwona-CapsCondBold]
- \definefontsynonym [SansBoldItalic] [Iwona-CapsCondBoldItalic]
- \stoptypescript
-
- \starttypescript [sans] [iwona-medium-cond] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-CondMedium-Regular]
- \definefontsynonym [SansItalic] [Iwona-CondMedium-Italic]
- \definefontsynonym [SansBold] [Iwona-CondHeavy-Regular]
- \definefontsynonym [SansBoldItalic] [Iwona-CondHeavy-Italic]
- \definefontsynonym [SansCaps] [Iwona-CapsCondHeavy-Regular]
- \definefontsynonym [SansItalicCaps] [Iwona-CapsCondMedium-Italic]
- \definefontsynonym [SansBoldCaps] [Iwona-CapsCondHeavy-Regular]
- \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsCondHeavy-Italic]
- \stoptypescript
-
- \starttypescript [sans] [iwona-medium-cond-caps,iwona-medium-caps-cond] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-CapsCondHeavy-Regular]
- \definefontsynonym [SansItalic] [Iwona-CapsCondMedium-Italic]
- \definefontsynonym [SansBold] [Iwona-CapsCondHeavy-Regular]
- \definefontsynonym [SansBoldItalic] [Iwona-CapsCondHeavy-Italic]
- \stoptypescript
-
- \starttypescript [math] [iwona-light] [name]
- \definefontsynonym [MathRoman] [Iwona-Math-Letters-Light-Regular]
- \definefontsynonym [MathItalic] [Iwona-Math-Letters-Light-Italic]
- \definefontsynonym [MathSymbol] [Iwona-Math-Symbols-Light]
- \definefontsynonym [MathExtension] [Iwona-Math-Extension-Light]
- \stoptypescript
-
- \starttypescript [math] [iwona] [name]
- \definefontsynonym [MathRoman] [Iwona-Math-Letters-Regular]
- \definefontsynonym [MathItalic] [Iwona-Math-Letters-Italic]
- \definefontsynonym [MathSymbol] [Iwona-Math-Symbols-Regular]
- \definefontsynonym [MathExtension] [Iwona-Math-Extension-Regular]
- \stoptypescript
-
- \starttypescript [math] [iwona-medium] [name]
- \definefontsynonym [MathRoman] [Iwona-Math-Letters-Medium-Regular]
- \definefontsynonym [MathItalic] [Iwona-Math-Letters-Medium-Italic]
- \definefontsynonym [MathSymbol] [Iwona-Math-Symbols-Medium]
- \definefontsynonym [MathExtension] [Iwona-Math-Extension-Medium]
- \stoptypescript
-
- \starttypescript [math] [iwona-heavy] [name]
- \definefontsynonym [MathRoman] [Iwona-Math-Letters-Heavy-Regular]
- \definefontsynonym [MathItalic] [Iwona-Math-Letters-Heavy-Italic]
- \definefontsynonym [MathSymbol] [Iwona-Math-Symbols-Heavy]
- \definefontsynonym [MathExtension] [Iwona-Math-Extension-Heavy]
- \stoptypescript
-
- \starttypescript [iwona,iwona-light,iwona-heavy,iwona-medium] [texnansi,ec,8r,uc,t2a]
- \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]
- \quittypescriptscanning
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[kurier]
-
- \starttypescript [sans] [kurier-light,kurier,kurier-medium] [texnansi,ec,qx,t5]
- \definefontsynonym[Kurier-Regular] [\typescriptthree-kurierr] [encoding=\typescriptthree]
- \definefontsynonym[Kurier-Italic] [\typescriptthree-kurierri] [encoding=\typescriptthree]
- \definefontsynonym[Kurier-RegularItalic] [Kurier-Italic]
- \definefontsynonym[Kurier-Bold] [\typescriptthree-kurierb] [encoding=\typescriptthree]
- \definefontsynonym[Kurier-BoldItalic] [\typescriptthree-kurierbi] [encoding=\typescriptthree]
- \definefontsynonym[Kurier-Light] [\typescriptthree-kurierl] [encoding=\typescriptthree]
- \definefontsynonym[Kurier-LightItalic] [\typescriptthree-kurierli] [encoding=\typescriptthree]
- \definefontsynonym[Kurier-Medium] [\typescriptthree-kurierm] [encoding=\typescriptthree]
- \definefontsynonym[Kurier-MediumItalic] [\typescriptthree-kuriermi] [encoding=\typescriptthree]
- \definefontsynonym[Kurier-Heavy] [\typescriptthree-kurierh] [encoding=\typescriptthree]
- \definefontsynonym[Kurier-HeavyItalic] [\typescriptthree-kurierhi] [encoding=\typescriptthree]
- \loadmapfile[kurier-\typescriptthree.map]
- \stoptypescript
-
- \starttypescript [math] [kurier] [default]
- \definefontsynonym [Kurier-Math-Letters-Regular] [rm-kurierr]
- \definefontsynonym [Kurier-Math-Letters-Italic] [mi-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-Regular] [rm-kurierl]
- \definefontsynonym [Kurier-Math-Letters-Light-Italic] [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-Regular][rm-kurierm]
- \definefontsynonym [Kurier-Math-Letters-Medium-Italic] [mi-kuriermi]
- \definefontsynonym [Kurier-Math-Symbols-Medium] [sy-kuriermz]
- \definefontsynonym [Kurier-Math-Extension-medium] [ex-kurierm]
- \stoptypescript
-
- \starttypescript [math] [kurier,kurier-light,kurier-medium] [default]
- \usemathcollection[default]
- \loadmapfile[kurier-rm.map]
- \loadmapfile[kurier-mi.map]
- \loadmapfile[kurier-sy.map]
- \loadmapfile[kurier-ex.map]
- \stoptypescript
-
- \starttypescript [sans] [kurier-light] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Kurier-Light-Regular]
- \definefontsynonym [SansItalic] [Kurier-Light-Italic]
- \definefontsynonym [SansBold] [Kurier-Medium-Regular]
- \definefontsynonym [SansBoldItalic] [Kurier-Medium-Italic]
- \stoptypescript
-
- \starttypescript [sans] [kurier] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Kurier-Regular]
- \definefontsynonym [SansItalic] [Kurier-Italic]
- \definefontsynonym [SansBold] [Kurier-Bold]
- \definefontsynonym [SansBoldItalic] [Kurier-BoldItalic]
- \stoptypescript
-
- \starttypescript [sans] [kurier-medium] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Kurier-Medium-Regular]
- \definefontsynonym [SansItalic] [Kurier-Medium-Italic]
- \definefontsynonym [SansBold] [Kurier-Heavy-Regular]
- \definefontsynonym [SansBoldItalic] [Kurier-Heavy-Italic]
- \stoptypescript
-
- \starttypescript [math] [kurier-light] [name]
- \definefontsynonym [MathRoman] [Kurier-Math-Letters-Light-Regular]
- \definefontsynonym [MathItalic] [Kurier-Math-Letters-Light-Italic]
- \definefontsynonym [MathSymbol] [Kurier-Math-Symbols-Light]
- \definefontsynonym [MathExtension] [Kurier-Math-Extension-Light]
- \stoptypescript
-
- \starttypescript [math] [kurier] [name]
- \definefontsynonym [MathRoman] [Kurier-Math-Letters-Regular]
- \definefontsynonym [MathItalic] [Kurier-Math-Letters-Italic]
- \definefontsynonym [MathSymbol] [Kurier-Math-Symbols-Regular]
- \definefontsynonym [MathExtension] [Kurier-Math-Extension-Regular]
- \stoptypescript
-
- \starttypescript [math] [kurier-medium] [name]
- \definefontsynonym [MathRoman] [Kurier-Math-Letters-Medium-Regular]
- \definefontsynonym [MathItalic] [Kurier-Math-Letters-Medium-Italic]
- \definefontsynonym [MathSymbol] [Kurier-Math-Symbols-Medium]
- \definefontsynonym [MathExtension] [Kurier-Math-Extension-Medium]
- \stoptypescript
-
- \starttypescript [kurier-light,kurier,kurier-medium] [texnansi,ec,qx,t5]
- \definetypeface[\typescriptone][ss][sans] [\typescriptone] [default][encoding=\typescripttwo]
- \definetypeface[\typescriptone][rm][serif][modern] [default][encoding=\typescripttwo]
- \definetypeface[\typescriptone][tt][mono] [modern] [default][encoding=\typescripttwo,rscale=1.05]
- \definetypeface[\typescriptone][mm][math] [\typescriptone] [default][encoding=\typescripttwo,text=ss]
- \quittypescriptscanning
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[charter]
-
- \starttypescript [serif] [charter] [ec,texnansi,8r]
- \definefontsynonym [Charter-Roman] [\typescriptthree-bchr8a] [encoding=\typescriptthree]
- \definefontsynonym [Charter-Italic] [\typescriptthree-bchri8a] [encoding=\typescriptthree]
- \definefontsynonym [Charter-Bold] [\typescriptthree-bchb8a] [encoding=\typescriptthree]
- \definefontsynonym [Charter-BoldItalic] [\typescriptthree-bchbi8a] [encoding=\typescriptthree]
- \definefontsynonym [Charter-Slanted] [\typescriptthree-bchr8a-slanted-167] [encoding=\typescriptthree]
- \definefontsynonym [Charter-BoldSlanted][\typescriptthree-bchb8a-slanted-167] [encoding=\typescriptthree]
- \definefontsynonym [Charter-Roman-Caps] [\typescriptthree-bchr8a-capitalized-800] [encoding=\typescriptthree]
- \loadmapfile[\typescriptthree-bitstrea-charter.map]
- \stoptypescript
-
- \starttypescript [serif] [charter] [name]
- \definefontsynonym [Serif] [Charter-Roman]
- \definefontsynonym [SerifItalic] [Charter-Italic]
- \definefontsynonym [SerifBold] [Charter-Bold]
- \definefontsynonym [SerifBoldItalic] [Charter-BoldItalic]
- \definefontsynonym [SerifSlanted] [Charter-Slanted]
- \definefontsynonym [SerifBoldSlanted] [Charter-BoldSlanted]
- \definefontsynonym [SerifCaps] [Charter-Roman-Caps]
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[symbols]
-
- \starttypescript
- \definefontsynonym [ZapfDingbats] [uzdr]
- \definefontsynonym [RalfSmithFormalScript] [rsfs10]
- \definefontsynonym [MartinVogel] [umvs]
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[texgyre]
-
- \definetypescriptprefix [f:pagella] [pl] \definetypescriptprefix [f:palatino] [pl]
- \definetypescriptprefix [f:termes] [tm] \definetypescriptprefix [f:times] [tm]
- \definetypescriptprefix [f:heros] [hv] \definetypescriptprefix [f:helvetica] [hv]
- \definetypescriptprefix [f:bonum] [bk] \definetypescriptprefix [f:bookman] [bk]
- \definetypescriptprefix [f:schola] [cs] \definetypescriptprefix [f:schoolbook] [cs]
- \definetypescriptprefix [f:adventor][ag] %definetypescriptprefix [f:adventor] [ag]
- \definetypescriptprefix [f:cursor] [cr] \definetypescriptprefix [f:courier] [cr]
- \definetypescriptprefix [f:chorus] [zc] \definetypescriptprefix [f:chancery] [zc] % not the full set
-
- \starttypescript [serif,sans,mono] [pagella,palatino,termes,times,adventor,bonum,bookman,cursor,courier,heros,helvetica,schola,schoolbook] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x]
- \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Regular] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}r] [encoding=\typescriptthree]
- \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Italic] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}ri] [encoding=\typescriptthree]
- \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Bold] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}b] [encoding=\typescriptthree]
- \definefontsynonym [\typescriptprefix{n:\typescripttwo}-BoldItalic] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}bi] [encoding=\typescriptthree]
- \loadmapfile[q\typescriptprefix{f:\typescripttwo}-\typescriptthree.map]
- \stoptypescript
-
- \starttypescript [serif,sans,mono] [pagella,palatino,termes,times,adventor,bonum,bookman,cursor,courier,heros,helvetica,schola,schoolbook] [ec,texnansi,cs,qx,rm,t5,l7x]
- \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Caps] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}r-sc] [encoding=\typescriptthree]
- \definefontsynonym [\typescriptprefix{n:\typescripttwo}-ItalicCaps] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}ri-sc] [encoding=\typescriptthree]
- \definefontsynonym [\typescriptprefix{n:\typescripttwo}-BoldCaps] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}b-sc] [encoding=\typescriptthree]
- \definefontsynonym [\typescriptprefix{n:\typescripttwo}-BoldItalicCaps] [\typescriptthree-q\typescriptprefix{f:\typescripttwo}bi-sc] [encoding=\typescriptthree]
- \loadmapfile[q\typescriptprefix{f:\typescripttwo}-\typescriptthree.map]
- \stoptypescript
-
- \starttypescript [serif,calligraphy] [chorus,chancery] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x]
- \definefontsynonym [TeXGyreChorus-MediumItalic] [\typescriptthree-qzcmi] [encoding=\typescriptthree]
- \loadmapfile[qzc-\typescriptthree.map]
- \stoptypescript
-
- \definetypescriptprefix [n:pagella] [TeXGyrePagella] \definetypescriptprefix [n:palatino] [TeXGyrePagella]
- \definetypescriptprefix [n:termes] [TeXGyreTermes] \definetypescriptprefix [n:times] [TeXGyreTermes]
- \definetypescriptprefix [n:heros] [TeXGyreHeros] \definetypescriptprefix [n:helvetica] [TeXGyreHeros]
- \definetypescriptprefix [n:bonum] [TeXGyreBonum] \definetypescriptprefix [n:bookman] [TeXGyreBonum]
- \definetypescriptprefix [n:schola] [TeXGyreSchola] \definetypescriptprefix [n:schoolbook] [TeXGyreSchola]
- \definetypescriptprefix [n:adventor] [TeXGyreAdventor] %definetypescriptprefix [n:adventor] [TeXGyreAdventor]
- \definetypescriptprefix [n:cursor] [TeXGyreCursor] \definetypescriptprefix [n:courier] [TeXGyreCursor]
- \definetypescriptprefix [n:chorus] [TeXGyreChorus] \definetypescriptprefix [n:chancery] [TeXGyreChorus] % not the full set
-
- \starttypescript [serif] [pagella,palatino,termes,times,bonum,bookman,schola,schoolbook] [name]
- \definefontsynonym [Serif] [\typescriptprefix{n:\typescripttwo}-Regular]
- \definefontsynonym [SerifItalic] [\typescriptprefix{n:\typescripttwo}-Italic]
- \definefontsynonym [SerifBold] [\typescriptprefix{n:\typescripttwo}-Bold]
- \definefontsynonym [SerifBoldItalic] [\typescriptprefix{n:\typescripttwo}-BoldItalic]
- \definefontsynonym [SerifSlanted] [SerifItalic]
- \definefontsynonym [SerifBoldSlanted] [SerifBoldItalic]
- \definefontsynonym [SerifCaps] [\typescriptprefix{n:\typescripttwo}-Caps]
-
- \definefontvariant [Serif][osf][Caps]
- \definefontvariant [Serif][sc] [Caps]
-
- \definefontsynonym [SerifRegular] [Serif]
- \definefontsynonym [SerifRegularCaps] [SerifCaps]
- \definefontsynonym [SerifItalicCaps] [\typescriptprefix{n:\typescripttwo}-ItalicCaps]
- \definefontsynonym [SerifBoldCaps] [\typescriptprefix{n:\typescripttwo}-BoldCaps]
- \definefontsynonym [SerifBoldItalicCaps] [\typescriptprefix{n:\typescripttwo}-BoldItalicCaps]
- \definefontsynonym [SerifSlantedCaps] [SerifItalicCaps]
- \definefontsynonym [SerifBoldSlantedCaps] [SerifBoldItalicCaps]
- \definefontsynonym [SerifCapsCaps] [SerifCaps]
- \stoptypescript
-
- \starttypescript [serif] [chorus,chancery] [name]
- \definefontsynonym [SerifMediumItalic] [TeXGyreChorus-MediumItalic]
- \definefontsynonym [Serif] [SerifMediumItalic]
- \definefontsynonym [SerifItalic] [SerifMediumItalic]
- \definefontsynonym [SerifBold] [SerifMediumItalic]
- \definefontsynonym [SerifBoldItalic] [SerifMediumItalic]
- \definefontsynonym [SerifSlanted] [SerifMediumItalic]
- \definefontsynonym [SerifBoldSlanted] [SerifMediumItalic]
- \definefontsynonym [SerifCaps] [SerifMediumItalic]
- \stoptypescript
-
- \starttypescript [calligraphy] [chorus,chancery] [name]
- \definefontsynonym [Calligraphy] [TeXGyreChorus-MediumItalic]
- \stoptypescript
-
- \starttypescript [sans] [heros,helvetica,adventor] [name]
- \definefontsynonym [Sans] [\typescriptprefix{n:\typescripttwo}-Regular]
- \definefontsynonym [SansItalic] [\typescriptprefix{n:\typescripttwo}-Italic]
- \definefontsynonym [SansBold] [\typescriptprefix{n:\typescripttwo}-Bold]
- \definefontsynonym [SansBoldItalic] [\typescriptprefix{n:\typescripttwo}-BoldItalic]
- \definefontsynonym [SansSlanted] [SansItalic]
- \definefontsynonym [SansBoldSlanted] [SansBoldItalic]
- \definefontsynonym [SansCaps] [\typescriptprefix{n:\typescripttwo}-Caps]
-
- \definefontvariant [Sans][osf][Caps]
- \definefontvariant [Sans][sc] [Caps]
-
- \definefontsynonym [SansRegular] [Sans]
- \definefontsynonym [SansRegularCaps] [SansCaps]
- \definefontsynonym [SansItalicCaps] [\typescriptprefix{n:\typescripttwo}-ItalicCaps]
- \definefontsynonym [SansBoldCaps] [\typescriptprefix{n:\typescripttwo}-BoldCaps]
- \definefontsynonym [SansBoldItalicCaps] [\typescriptprefix{n:\typescripttwo}-BoldItalicCaps]
- \definefontsynonym [SansSlantedCaps] [SansItalicCaps]
- \definefontsynonym [SansBoldSlantedCaps] [SansBoldItalicCaps]
- \definefontsynonym [SansCapsCaps] [SansCaps]
- \stoptypescript
-
- \starttypescript [mono] [cursor,courier] [name]
- \definefontsynonym [Mono] [\typescriptprefix{n:\typescripttwo}-Regular]
- \definefontsynonym [MonoItalic] [\typescriptprefix{n:\typescripttwo}-Italic]
- \definefontsynonym [MonoBold] [\typescriptprefix{n:\typescripttwo}-Bold]
- \definefontsynonym [MonoBoldItalic] [\typescriptprefix{n:\typescripttwo}-BoldItalic]
- \definefontsynonym [MonoSlanted] [MonoItalic]
- \definefontsynonym [MonoBoldSlanted] [MonoBoldItalic]
-
- \definefontvariant [Mono][osf][Caps]
- \definefontvariant [Mono][sc] [Caps]
-
- \definefontsynonym [MonoRegular] [Mono]
- \definefontsynonym [MonoRegularCaps] [MonoCaps]
- \definefontsynonym [MonoItalicCaps] [\typescriptprefix{n:\typescripttwo}-ItalicCaps]
- \definefontsynonym [MonoBoldCaps] [\typescriptprefix{n:\typescripttwo}-BoldCaps]
- \definefontsynonym [MonoBoldItalicCaps] [\typescriptprefix{n:\typescripttwo}-BoldItalicCaps]
- \definefontsynonym [MonoSlantedCaps] [MonoItalicCaps]
- \definefontsynonym [MonoBoldSlantedCaps] [MonoBoldItalicCaps]
- \definefontsynonym [MonoCapsCaps] [MonoCaps]
- \stoptypescript
-
- % bonus definitions
-
- % when these fonts are in tex live ...
- %
- % \definefontsynonym [Palatino-Caps] [TeXPalladioL-SC] [encoding=\typescriptthree]
- %
- % \starttypescript [serif] [palatino] [ec,texnansi]
- % \definefontsynonym[TeXPalladioL-BoldItalicOsF][\typescriptthree-fplbij8a][encoding=\typescriptthree]
- % \definefontsynonym[TeXPalladioL-BoldOsF] [\typescriptthree-fplbj8a] [encoding=\typescriptthree]
- % \definefontsynonym[TeXPalladioL-SC] [\typescriptthree-fplrc8a] [encoding=\typescriptthree]
- % \definefontsynonym[TeXPalladioL-ItalicOsF] [\typescriptthree-fplrij8a][encoding=\typescriptthree]
- % \loadmapfile[\typescriptthree-urw-palatino.map]
- % \stoptypescript
-
- % Faces:
-
- \starttypescript [times,termes] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x]
- \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default] [encoding=\typescripttwo]
- \definetypeface [\typescriptone] [ss] [sans] [helvetica] [default] [encoding=\typescripttwo,rscale=0.9]
- \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [encoding=\typescripttwo,rscale=1.05]
- \definetypeface [\typescriptone] [mm] [math] [times] [default] [encoding=\typescripttwo]
- \quittypescriptscanning
- \stoptypescript
-
- \starttypescript [palatino,pagella] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x]
- \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default] [encoding=\typescripttwo]
- \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [encoding=\typescripttwo,rscale=1.075]
- \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [encoding=\typescripttwo,rscale=1.075]
- \definetypeface [\typescriptone] [mm] [math] [palatino] [default] [encoding=default]
- \quittypescriptscanning
- \stoptypescript
-
- \starttypescript [schoolbook,schola] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x]
- \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default] [encoding=\typescripttwo]
- \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [encoding=\typescripttwo]
- \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [encoding=\typescripttwo]
- \definetypeface [\typescriptone] [mm] [math] [modern] [default] [encoding=default]
- \quittypescriptscanning
- \stoptypescript
-
- \starttypescript [bookman,bonum] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x]
- \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default] [encoding=\typescripttwo]
- \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [encoding=\typescripttwo]
- \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [encoding=\typescripttwo]
- \definetypeface [\typescriptone] [mm] [math] [modern] [default] [encoding=default]
- \quittypescriptscanning
- \stoptypescript
-
- \starttypescript [chancery,chorus] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x]
- \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default] [encoding=\typescripttwo]
- \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [encoding=\typescripttwo]
- \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [encoding=\typescripttwo]
- \definetypeface [\typescriptone] [mm] [math] [modern] [default] [encoding=default]
- \quittypescriptscanning
- \stoptypescript
-
- \starttypescript [helvetica,heros] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x]
- \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default] [encoding=\typescripttwo]
- \definetypeface [\typescriptone] [rm] [serif] [modern] [default] [encoding=\typescripttwo,rscale=1.15]
- \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [encoding=\typescripttwo,rscale=1.15]
- \definetypeface [\typescriptone] [mm] [math] [modern] [default] [encoding=default,rscale=1.15]
- \quittypescriptscanning
- \stoptypescript
-
- \starttypescript [avantgarde,adventor] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x]
- \definetypeface [\typescriptone] [ss] [sans] [adventor] [default] [encoding=\typescripttwo]
- \definetypeface [\typescriptone] [rm] [serif] [modern] [default] [encoding=\typescripttwo,rscale=1.15]
- \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [encoding=\typescripttwo,rscale=1.15]
- \definetypeface [\typescriptone] [mm] [math] [modern] [default] [encoding=default]
- \quittypescriptscanning
- \stoptypescript
-
- \starttypescript [courier,cursor] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x]
- \definetypeface [\typescriptone] [tt] [mono] [\typescriptone] [default] [encoding=\typescripttwo]
- \definetypeface [\typescriptone] [rm] [serif] [modern] [default] [encoding=\typescripttwo]
- \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [encoding=\typescripttwo]
- \definetypeface [\typescriptone] [mm] [math] [modern] [default] [encoding=default]
- \quittypescriptscanning
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[xmath]
-
- \starttypescript [math] [palatino] [all]
- \definefontsynonym [Palatino-Roman-Upright] [pxr]
- \definefontsynonym [Palatino-Roman-Italic] [pxi]
- \definefontsynonym [Palatino-Roman-Slanted] [pxsl]
- \definefontsynonym [Palatino-Roman-Caps] [pxsc]
- \definefontsynonym [Palatino-Companion-Upright] [pcxr]
- \definefontsynonym [Palatino-Companion-Italic] [pcxi]
- \definefontsynonym [Palatino-Companion-Slanted] [pcxsl]
- \definefontsynonym [Palatino-Math-Italic] [pxmi]
- \definefontsynonym [Palatino-Math-Symbols] [pxsy]
- \definefontsynonym [Palatino-Math-Extension] [pxex]
- \definefontsynonym [Palatino-Math-SymbolsA] [pxsya]
- \definefontsynonym [Palatino-Math-SymbolsB] [pxsyb]
- \definefontsynonym [Palatino-Math-SymbolsC] [pxsyc]
- \definefontsynonym [Palatino-Math-Italic-A] [pxmia]
- \definefontsynonym [Palatino-Math-Extension-A] [pxexa]
- \usemathcollection[default]
- \loadmapfile[original-youngryu-px.map]
- \stoptypescript
-
- \starttypescript [math] [times] [all]
- \definefontsynonym [Times-Roman-Upright] [txr]
- \definefontsynonym [Times-Roman-Italic] [txi]
- \definefontsynonym [Times-Roman-Slanted] [txsl]
- \definefontsynonym [Times-Roman-Caps] [txsc]
- \definefontsynonym [Times-Companion-Upright] [tcxr]
- \definefontsynonym [Times-Companion-Italic] [tcxi]
- \definefontsynonym [Times-Companion-Slanted] [tcxsl]
- \definefontsynonym [Times-Math-Italic] [txmi]
- \definefontsynonym [Times-Math-Symbols] [txsy]
- \definefontsynonym [Times-Math-Extension] [txex]
- \definefontsynonym [Times-Math-SymbolsA] [txsya]
- \definefontsynonym [Times-Math-SymbolsB] [txsyb]
- \definefontsynonym [Times-Math-SymbolsC] [txsyc]
- \definefontsynonym [Times-Math-Italic-A] [txmia]
- \definefontsynonym [Times-Math-Extension-A] [txexa]
- \usemathcollection[default]
- \loadmapfile[original-youngryu-tx.map]
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[pregyre]
-
- %D These are just fallbacks in case anyone stil uses the
- %D old names (might also be removed?).
-
- % TeXGyrePagella
-
- \starttypescript [serif] [palatino]
- \definefontsynonym [Palatino] [TeXGyrePagella-Regular]
- \definefontsynonym [Palatino-Italic] [TeXGyrePagella-Italic]
- \definefontsynonym [Palatino-Bold] [TeXGyrePagella-Bold]
- \definefontsynonym [Palatino-BoldItalic] [TeXGyrePagella-BoldItalic]
- \definefontsynonym [Palatino-Slanted] [TeXGyrePagella-Italic]
- \definefontsynonym [Palatino-BoldSlanted] [TeXGyrePagella-BoldItalic]
- \definefontsynonym [Palatino-Caps] [TeXGyrePagella-Caps]
- \stoptypescript
-
- \starttypescript [serif] [palatino] [name]
- \definefontsynonym [Serif] [Palatino]
- \definefontsynonym [SerifBold] [Palatino-Bold]
- \definefontsynonym [SerifItalic] [Palatino-Italic]
- \definefontsynonym [SerifSlanted] [Palatino-Slanted]
- \definefontsynonym [SerifBoldItalic] [Palatino-BoldItalic]
- \definefontsynonym [SerifBoldSlanted] [Palatino-BoldSlanted]
- \definefontsynonym [SerifCaps] [Palatino-Caps]
- \stoptypescript
-
- \starttypescript [math] [palatino] [name]
- \definefontsynonym [MathRoman] [Palatino-Roman-Upright]
- \definefontsynonym [MathExtension] [Palatino-Math-Extension]
- \definefontsynonym [MathItalic] [Palatino-Math-Italic]
- \definefontsynonym [MathSymbol] [Palatino-Math-Symbols]
- \definefontsynonym [MathAlpha] [Palatino-Math-SymbolsA]
- \definefontsynonym [MathBeta] [Palatino-Math-SymbolsB]
- \stoptypescript
-
- \starttypescript [math] [palatino] [name]
- \definefontsynonym [OldStyle] [MathItalic]
- \definefontsynonym [Fraktur] [eufm10]
- \definefontsynonym [Blackboard] [MathBeta]
- \definefontsynonym [Gothic] [eufm10]
- \definefontsynonym [Calligraphic] [eusm10]
- \stoptypescript
-
- % TeXGyreTermes
-
- \starttypescript [serif] [times]
- \definefontsynonym [Times-Roman] [TeXGyreTermes-Regular]
- \definefontsynonym [Times-Italic] [TeXGyreTermes-Italic]
- \definefontsynonym [Times-Bold] [TeXGyreTermes-Bold]
- \definefontsynonym [Times-BoldItalic] [TeXGyreTermes-BoldItalic]
- \definefontsynonym [Times-Slanted] [TeXGyreTermes-Italic]
- \definefontsynonym [Times-BoldSlanted] [TeXGyreTermes-BoldItalic]
- \definefontsynonym [Times-Caps] [TeXGyreTermes-Caps]
- \stoptypescript
-
- \starttypescript [serif] [times] [name]
- \definefontsynonym [Serif] [Times-Roman]
- \definefontsynonym [SerifBold] [Times-Bold]
- \definefontsynonym [SerifItalic] [Times-Italic]
- \definefontsynonym [SerifSlanted] [Times-Italic]
- \definefontsynonym [SerifBoldItalic] [Times-BoldItalic]
- \definefontsynonym [SerifBoldSlanted] [Times-BoldItalic]
- \definefontsynonym [SerifCaps] [Times-Caps]
- \stoptypescript
-
- \starttypescript [math] [times] [name]
- \definefontsynonym [MathRoman] [Times-Roman-Upright]
- \definefontsynonym [MathExtension] [Times-Math-Extension]
- \definefontsynonym [MathItalic] [Times-Math-Italic]
- \definefontsynonym [MathSymbol] [Times-Math-Symbols]
- \definefontsynonym [MathAlpha] [Times-Math-SymbolsA]
- \definefontsynonym [MathBeta] [Times-Math-SymbolsB]
- \stoptypescript
-
- \starttypescript [math] [times] [name]
- \definefontsynonym [OldStyle] [MathItalic]
- \definefontsynonym [Fraktur] [eufm10]
- \definefontsynonym [Blackboard] [MathBeta]
- \definefontsynonym [Gothic] [eufm10]
- \definefontsynonym [Calligraphic] [eusm10]
- \stoptypescript
-
- % TeXGyreHeros
-
- \starttypescript [sans] [helvetica]
- \definefontsynonym [Helvetica] [TeXGyreHeros-Regular]
- \definefontsynonym [Helvetica-Oblique] [TeXGyreHeros-Italic]
- \definefontsynonym [Helvetica-Bold] [TeXGyreHeros-Bold]
- \definefontsynonym [Helvetica-BoldOblique] [TeXGyreHeros-BoldItalic]
- \definefontsynonym [Helvetica-Caps] [TeXGyreHeros-Caps]
- \stoptypescript
-
- \starttypescript [sans] [helvetica] [name]
- \definefontsynonym [Sans] [Helvetica]
- \definefontsynonym [SansBold] [Helvetica-Bold]
- \definefontsynonym [SansItalic] [Helvetica-Oblique]
- \definefontsynonym [SansSlanted] [Helvetica-Oblique]
- \definefontsynonym [SansBoldItalic] [Helvetica-BoldOblique]
- \definefontsynonym [SansBoldSlanted] [Helvetica-BoldOblique]
- \definefontsynonym [SansCaps] [Helvetica-Caps]
- \stoptypescript
-
- \starttypescript [math] [helvetica] [name]
- \definefontsynonym [MathRoman] [Helvetica-MathRoman]
- \definefontsynonym [MathExtension] [Helvetica-MathExtendedSymbols]
- \definefontsynonym [MathItalic] [Helvetica-MathItalics]
- \definefontsynonym [MathSymbol] [Helvetica-MathSymbols]
- \stoptypescript
-
- % TeXGyreBonum
-
- \starttypescript [serif] [bookman]
- \definefontsynonym [Bookman-Light] [TeXGyreBonum-Regular]
- \definefontsynonym [Bookman-LightItalic] [TeXGyreBonum-Italic]
- \definefontsynonym [Bookman-DemiBold] [TeXGyreBonum-Bold]
- \definefontsynonym [Bookman-DemiBoldItalic] [TeXGyreBonum-BoldItalic]
- \definefontsynonym [Bookman-LightSlanted] [TeXGyreBonum-Italic]
- \definefontsynonym [Bookman-DemiBoldSlanted] [TeXGyreBonum-BoldItalic]
- \definefontsynonym [Bookman-Light-Caps] [TeXGyreBonum-Caps]
- \stoptypescript
-
- \starttypescript [serif] [bookman] [name]
- \definefontsynonym [Serif] [Bookman-Light]
- \definefontsynonym [SerifItalic] [Bookman-LightItalic]
- \definefontsynonym [SerifBold] [Bookman-DemiBold]
- \definefontsynonym [SerifBoldItalic] [Bookman-DemiBoldItalic]
- \definefontsynonym [SerifSlanted] [Bookman-LightSlanted]
- \definefontsynonym [SerifBoldSlanted] [Bookman-DemiBoldSlanted]
- \definefontsynonym [SerifCaps] [Bookman-Light-Caps]
- \stoptypescript
-
- % TeXGyreScola
-
- \starttypescript [serif] [schoolbook]
- \definefontsynonym [Schoolbook-Roman] [TeXGyreScola-Regular]
- \definefontsynonym [Schoolbook-Italic] [TeXGyreScola-Italic]
- \definefontsynonym [Schoolbook-Bold] [TeXGyreScola-Bold]
- \definefontsynonym [Schoolbook-BoldItalic] [TeXGyreScola-BoldItalic]
- \definefontsynonym [Schoolbook-Slanted] [TeXGyreScola-Italic]
- \definefontsynonym [Schoolbook-BoldSlanted] [TeXGyreScola-BoldItalic]
- \definefontsynonym [Schoolbook-Roman-Caps] [TeXGyreScola-Caps]
- \stoptypescript
-
- \starttypescript [serif] [schoolbook] [name]
- \definefontsynonym [Serif] [Schoolbook-Roman]
- \definefontsynonym [SerifItalic] [Schoolbook-Italic]
- \definefontsynonym [SerifBold] [Schoolbook-Bold]
- \definefontsynonym [SerifBoldItalic] [Schoolbook-BoldItalic]
- \definefontsynonym [SerifSlanted] [Schoolbook-RomanSlanted]
- \definefontsynonym [SerifBoldSlanted] [Schoolbook-BoldSlanted]
- \definefontsynonym [SerifCaps] [Schoolbook-Roman-Caps]
- \stoptypescript
-
- % TeXGyreAdventor
-
- % TeXGyreCursor
-
- \starttypescript [mono] [courier]
- \definefontsynonym [Courier] [TeXGyreCursor-Regular]
- \definefontsynonym [Courier-Bold] [TeXGyreCursor-Bold]
- \definefontsynonym [Courier-Oblique] [TeXGyreCursor-Italic]
- \definefontsynonym [Courier-BoldOblique] [TeXGyreCursor-BoldItalic]
- \fakecontrolspace
- \stoptypescript
-
- \starttypescript [mono] [courier] [name]
- \definefontsynonym [Mono] [Courier]
- \definefontsynonym [MonoBold] [Courier-Bold]
- \definefontsynonym [MonoItalic] [Courier-Oblique]
- \definefontsynonym [MonoSlanted] [Courier-Oblique]
- \definefontsynonym [MonoBoldItalic] [Courier-BoldOblique]
- \definefontsynonym [MonoBoldSlanted] [Courier-BoldOblique]
- \definefontsynonym [MonoCaps] [Courier]
- \stoptypescript
-
- % TeXGyreChorus
-
- \starttypescript [calligraphy] [chancery]
- \definefontsynonym [Chancery] [TeXGyreChorus-MediumItalic]
- \stoptypescript
-
- \starttypescript [calligraphy] [chancery] [name]
- \definefontsynonym [Calligraphy] [Chancery]
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[Lucida]
-
- % We can remove the intermediate names as no one will use them.
-
- \definetypescriptprefix [e:ec] [8t]
- \definetypescriptprefix [e:texnansi] [8y]
- \definetypescriptprefix [e:8r] [8r]
-
- % Lucida Bright
-
- \starttypescript [serif] [lucida] [ec,texnansi,8r]
- \definefontsynonym [\typescriptthree-lbr] [hlhr\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaBright
- \definefontsynonym [\typescriptthree-lbd] [hlhb\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaBright-Demi
- \definefontsynonym [\typescriptthree-lbi] [hlhri\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaBright-Italic
- \definefontsynonym [\typescriptthree-lbdi] [hlhbi\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaBright-DemiItalic
- \definefontsynonym [\typescriptthree-lbsl] [hlhro\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaBright-Oblique
- \definefontsynonym [\typescriptthree-lbrsc] [hlhrc\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaBrightSmallcaps
- \definefontsynonym [\typescriptthree-lbdsc] [hlhbc\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaBrightSmallcaps-Demi
-
- \definefontsynonym [LucidaBright] [\typescriptthree-lbr] [encoding=\typescriptthree]
- \definefontsynonym [LucidaBright-Demi] [\typescriptthree-lbd] [encoding=\typescriptthree]
- \definefontsynonym [LucidaBright-Italic] [\typescriptthree-lbi] [encoding=\typescriptthree]
- \definefontsynonym [LucidaBright-DemiItalic] [\typescriptthree-lbdi] [encoding=\typescriptthree]
- \definefontsynonym [LucidaBright-Oblique] [\typescriptthree-lbsl] [encoding=\typescriptthree]
- \definefontsynonym [LucidaBrightSmallcaps] [\typescriptthree-lbrsc] [encoding=\typescriptthree]
- \definefontsynonym [LucidaBrightSmallcaps-Demi] [\typescriptthree-lbdsc] [encoding=\typescriptthree]
-
- \loadmapfile[lucida.map]
- \stoptypescript
-
- % Lucida Bright Sans
-
- \starttypescript [sans] [lucida] [ec,texnansi,8r]
- \definefontsynonym [\typescriptthree-lsr] [hlsr\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaSans
- \definefontsynonym [\typescriptthree-lsd] [hlsb\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaSans-Demi
- \definefontsynonym [\typescriptthree-lsb] [hlsu\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaSans-Bold
- \definefontsynonym [\typescriptthree-lsi] [hlsri\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaSans-Italic
- \definefontsynonym [\typescriptthree-lsdi] [hlsbi\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaSans-DemiItalic
- \definefontsynonym [\typescriptthree-lsbi] [hlsui\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaSans-BoldItalic
-
- \definefontsynonym [LucidaSans] [\typescriptthree-lsr] [encoding=\typescriptthree]
- \definefontsynonym [LucidaSans-Demi] [\typescriptthree-lsd] [encoding=\typescriptthree]
- \definefontsynonym [LucidaSans-Bold] [\typescriptthree-lsb] [encoding=\typescriptthree]
- \definefontsynonym [LucidaSans-Italic] [\typescriptthree-lsi] [encoding=\typescriptthree]
- \definefontsynonym [LucidaSans-DemiItalic] [\typescriptthree-lsdi] [encoding=\typescriptthree]
- \definefontsynonym [LucidaSans-BoldItalic] [\typescriptthree-lsbi] [encoding=\typescriptthree]
-
- \loadmapfile[lucida.map]
- \stoptypescript
-
- % Lucida Bright Typewriter
-
- \starttypescript [mono] [lucida] [ec,texnansi,8r]
- \definefontsynonym [\typescriptthree-lbtr] [hlcrt\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaTypewriter
- \definefontsynonym [\typescriptthree-lbtb] [hlcbt\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaTypewriterBold
- \definefontsynonym [\typescriptthree-lbto] [hlcrot\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaTypewriterOblique
- \definefontsynonym [\typescriptthree-lbtbo] [hlcbot\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaTypewriterBoldOblique
-
- \definefontsynonym [LucidaTypewriter] [\typescriptthree-lbtr] [encoding=\typescriptthree]
- \definefontsynonym [LucidaTypewriterBold] [\typescriptthree-lbtb] [encoding=\typescriptthree]
- \definefontsynonym [LucidaTypewriterOblique] [\typescriptthree-lbto] [encoding=\typescriptthree]
- \definefontsynonym [LucidaTypewriterBoldOblique] [\typescriptthree-lbtbo] [encoding=\typescriptthree]
-
- \loadmapfile[lucida.map]
- \stoptypescript
-
- % Lucida Bright Sans Typewriter
-
- \starttypescript [mono] [lucida] [ec,texnansi,8r]
- \definefontsynonym [\typescriptthree-lstr] [hlsrt\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaSans-Typewriter
- \definefontsynonym [\typescriptthree-lstb] [hlsbt\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaSans-TypewriterBold
- \definefontsynonym [\typescriptthree-lsto] [hlsrot\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaSans-TypewriterOblique
- \definefontsynonym [\typescriptthree-lstbo] [hlsbot\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaSans-TypewriterBoldOblique
-
- \definefontsynonym [LucidaSans-Typewriter] [\typescriptthree-lstr] [encoding=\typescriptthree]
- \definefontsynonym [LucidaSans-TypewriterBold] [\typescriptthree-lstb] [encoding=\typescriptthree]
- \definefontsynonym [LucidaSans-TypewriterOblique] [\typescriptthree-lsto] [encoding=\typescriptthree]
- \definefontsynonym [LucidaSans-TypewriterBoldOblique] [\typescriptthree-lstbo] [encoding=\typescriptthree]
-
- \loadmapfile[lucida.map]
- \stoptypescript
-
- % Lucida Calligraphy
-
- \starttypescript [calligraphy] [lucida] [texnansi,ec,8r]
- \definefontsynonym [\typescriptthree-lbc] [hlcrie\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaCalligraphy-Italic
-
- \definefontsynonym [LucidaCalligraphy-Italic] [\typescriptthree-lbc] [encoding=\typescriptthree]
-
- \loadmapfile[lucida.map]
- \stoptypescript
-
- % Lucida Casual
-
- \starttypescript [casual] [lucida] [texnansi,ec,8r]
- \definefontsynonym [\typescriptthree-lbkr] [hlcrn\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaCasual
- \definefontsynonym [\typescriptthree-lbki] [hlcrin\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaCasual-Italic
-
- \definefontsynonym [LucidaCasual] [\typescriptthree-lbkr] [encoding=\typescriptthree]
- \definefontsynonym [LucidaCasual-Italic] [\typescriptthree-lbki] [encoding=\typescriptthree]
-
- \loadmapfile[lucida.map]
- \stoptypescript
-
- % Lucida Handwriting
-
- \starttypescript [handwriting] [lucida] [texnansi,ec,8r]
- \definefontsynonym [\typescriptthree-lbh] [hlcriw\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaHandwriting-Italic
-
- \definefontsynonym [LucidaHandwriting-Italic] [\typescriptthree-lbh] [encoding=\typescriptthree]
-
- \loadmapfile[lucida.map]
- \stoptypescript
-
- % Lucida Fax
-
- \starttypescript [fax] [lucida] [texnansi,ec,8r]
- \definefontsynonym [\typescriptthree-lfr] [hlxr\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaFax
- \definefontsynonym [\typescriptthree-lfd] [hlxb\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaFax-Demi
- \definefontsynonym [\typescriptthree-lfi] [hlxri\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaFax-Italic
- \definefontsynonym [\typescriptthree-lfdi] [hlxbi\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaFax-DemiItalic
-
- \definefontsynonym [LucidaFax] [\typescriptthree-lfr] [encoding=\typescriptthree] % LucidaFax
- \definefontsynonym [LucidaFax-Demi] [\typescriptthree-lfd] [encoding=\typescriptthree] % LucidaFax-Demi
- \definefontsynonym [LucidaFax-Italic] [\typescriptthree-lfi] [encoding=\typescriptthree] % LucidaFax-Italic
- \definefontsynonym [LucidaFax-DemiItalic] [\typescriptthree-lfdi] [encoding=\typescriptthree] % LucidaFax-DemiItalic
-
- \loadmapfile[lucida.map]
- \stoptypescript
-
- \starttypescript [blackletter] [lucida] [texnansi,ec,8r]
- \definefontsynonym [\typescriptthree-lbl] [hlcrf\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree] % LucidaBlackletter
-
- \definefontsynonym [LucidaBlackletter] [\typescriptthree-lbl] [encoding=\typescriptthree]
-
- \loadmapfile[lucida.map]
- \stoptypescript
-
- \starttypescript [lucida,lucidabfm,lucidaboldmath] [texnansi,ec,8r]
- \definetypeface [lucida] [rm] [serif] [lucida] [default] [encoding=\typescripttwo]
- \definetypeface [lucida] [ss] [sans] [lucida] [default] [encoding=\typescripttwo]
- \definetypeface [lucida] [tt] [mono] [lucida] [default] [encoding=\typescripttwo]
- \definetypeface [lucida] [hw] [handwriting] [lucida] [default] [encoding=\typescripttwo]
- \definetypeface [lucida] [cg] [calligraphy] [lucida] [default] [encoding=\typescripttwo]
-
- \loadmapfile[lucida.map]
- \stoptypescript
-
- \starttypescript [math] [lucida] [default]
- \definefontsynonym [LucidaNewMath-AltItalic] [hlcrima]
- \definefontsynonym [LucidaNewMath-Arrows] [hlcra]
- \definefontsynonym [LucidaNewMath-Extension] [hlcrv]
- \definefontsynonym [LucidaNewMath-Roman] [hlcrm]
- \definefontsynonym [LucidaNewMath-Italic] [hlcrim]
- \definefontsynonym [LucidaNewMath-Symbol] [hlcry]
- \definefontsynonym [LucidaBlackletter] [hlcrf8y] % what a mess
- \usemathcollection[lbr]
- \loadmapfile [lucida.map]
- \stoptypescript
-
- \starttypescript [boldmath,bfmath] [lucida] [default]
- \definefontsynonym [LucidaNewMath-AltDemiItalic] [hlcdima]
- \definefontsynonym [LucidaNewMath-Arrows-Demi] [hlcda]
- \definefontsynonym [LucidaNewMath-Extension] [hlcrv]
- \definefontsynonym [LucidaNewMath-Demi] [hlcdm]
- \definefontsynonym [LucidaNewMath-DemiItalic] [hlcdim]
- \definefontsynonym [LucidaNewMath-Symbol-Demi] [hlcdy]
- \loadmapfile [lucida.map]
- \stoptypescript
-
- % Lucida Bright
-
- \starttypescript [serif] [lucida] [name]
- \definefontsynonym [Serif] [LucidaBright]
- \definefontsynonym [SerifBold] [LucidaBright-Demi]
- \definefontsynonym [SerifItalic] [LucidaBright-Italic]
- \definefontsynonym [SerifBoldItalic] [LucidaBright-DemiItalic]
- \definefontsynonym [SerifSlanted] [LucidaBright-Oblique]
- \definefontsynonym [SerifBoldSlanted] [LucidaBright-DemiItalic]
- \definefontsynonym [SerifCaps] [LucidaBrightSmallcaps]
- \definefontsynonym [SerifBoldCaps] [LucidaBrightSmallcaps-Demi]
- \stoptypescript
-
- % Lucida Bright Sans
-
- \starttypescript [sans] [lucida] [name]
- \definefontsynonym [Sans] [LucidaSans]
- \definefontsynonym [SansBold] [LucidaSans-Demi]
- \definefontsynonym [SansItalic] [LucidaSans-Italic]
- \definefontsynonym [SansBoldItalic] [LucidaSans-DemiItalic]
- \definefontsynonym [SansSlanted] [LucidaSans-Italic]
- \definefontsynonym [SansBoldSlanted] [LucidaSans-DemiItalic]
- \definefontsynonym [SansCaps] [LucidaSans]
- \stoptypescript
-
- % Lucida Bright Typewriter
-
- % only one family may be used as mono; sans used to be that since the beginning,
- % so we keep using that as default
-
- % \starttypescript [mono] [lucida] [name]
- % \definefontsynonym [Mono] [LucidaTypewriter]
- % \definefontsynonym [MonoBold] [LucidaTypewriterBold]
- % \definefontsynonym [MonoItalic] [LucidaTypewriterOblique]
- % \definefontsynonym [MonoBoldItalic] [LucidaTypewriterBoldOblique]
- % \definefontsynonym [MonoSlanted] [LucidaTypewriterOblique]
- % \definefontsynonym [MonoBoldSlanted] [LucidaTypewriterBoldOblique]
- % \definefontsynonym [MonoCaps] [LucidaTypewriter]
- % \stoptypescript
-
- % Lucida Bright Sans Typewriter
-
- \starttypescript [mono] [lucida] [name]
- \definefontsynonym [Mono] [LucidaSans-Typewriter]
- \definefontsynonym [MonoBold] [LucidaSans-TypewriterBold]
- \definefontsynonym [MonoItalic] [LucidaSans-TypewriterOblique]
- \definefontsynonym [MonoBoldItalic] [LucidaSans-TypewriterBoldOblique]
- \definefontsynonym [MonoSlanted] [LucidaSans-TypewriterOblique]
- \definefontsynonym [MonoBoldSlanted] [LucidaSans-TypewriterBoldOblique]
- \definefontsynonym [MonoCaps] [LucidaSans-Typewriter]
- \stoptypescript
-
- % Lucida Calligraphy
-
- \starttypescript [calligraphy] [lucida] [name]
- \definefontsynonym [Calligraphy] [LucidaCalligraphy-Italic]
- \stoptypescript
-
- % Lucida Casual
-
- % \starttypescript [casual] [lucida] [name]
- % % LucidaCasual
- % % LucidaCasual-Italic
- % \stoptypescript
-
- % Lucida Handwriting
-
- \starttypescript [handwriting] [lucida] [name]
- \definefontsynonym [Handwriting] [LucidaHandwriting-Italic]
- \stoptypescript
-
- % Lucida Fax
- %
- % \starttypescript [fax] [lucida] [name]
- % \definefontsynonym [FaksRegular] [LucidaFax]
- % \definefontsynonym [FaksBold] [LucidaFax-Demi]
- % \definefontsynonym [FaksItalic] [LucidaFax-Italic]
- % \definefontsynonym [FaksBoldItalic] [LucidaFax-DemiItalic]
- % \stoptypescript
-
- % Lucida Black Letter
- %
- % \starttypescript [blackletter] [lucida] [name]
- % \definefontsynonym [Blackletter] [LucidaBlackletter]
- % \stoptypescript
-
- % Lucida Math
-
- \starttypescript [math] [lucida] [name]
- % \definefontsynonym [MathRoman] [LucidaBright]
- \definefontsynonym [MathRoman] [LucidaNewMath-Roman]
- \definefontsynonym [MathExtension] [LucidaNewMath-Extension]
- \definefontsynonym [MathItalic] [LucidaNewMath-AltItalic]
- \definefontsynonym [MathSymbol] [LucidaNewMath-Symbol]
- \definefontsynonym [MathAlpha] [LucidaNewMath-Arrows]
- \definefontsynonym [MathBeta] [LucidaNewMath-Roman]
- \stoptypescript
-
- \starttypescript [math] [lucida] [name]
- \definefontsynonym [OldStyle] [MathItalic]
- \definefontsynonym [Fraktur] [eufm10]
- \definefontsynonym [Blackboard] [MathAlpha]
- \definefontsynonym [Gothic] [eufm10]
- \definefontsynonym [Calligraphic] [MathSymbol] % math caligraphic !
- \stoptypescript
-
- \starttypescript [boldmath] [lucida] [name]
- \definefontsynonym [MathRoman] [LucidaBright-Demi]
- \definefontsynonym [MathExtension] [LucidaNewMath-Extension]
- \definefontsynonym [MathItalic] [LucidaNewMath-AltDemiItalic]
- \definefontsynonym [MathSymbol] [LucidaNewMath-Symbol-Demi]
- \definefontsynonym [MathAlpha] [LucidaNewMath-Arrows-Demi]
- \definefontsynonym [MathBeta] [LucidaNewMath-Demi]
- \stoptypescript
-
- \starttypescript [bfmath] [lucida] [name]
- \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-Demi]
- \stoptypescript
-
- \starttypescript [lucida,lucidabfm,lucidaboldmath] [texnansi,ec,8r,uc]
- \definetypeface [lucida] [rm] [serif] [lucida] [default] [encoding=\typescripttwo]
- \definetypeface [lucida] [ss] [sans] [lucida] [default] [encoding=\typescripttwo]
- \definetypeface [lucida] [tt] [mono] [lucida] [default] [encoding=\typescripttwo]
- \definetypeface [lucida] [hw] [handwriting] [lucida] [default] [encoding=\typescripttwo]
- \definetypeface [lucida] [cg] [calligraphy] [lucida] [default] [encoding=\typescripttwo]
- \loadmapfile [lucida.map]
- \stoptypescript
-
- \starttypescript [lucida] [texnansi,ec,8r]
- \definetypeface [lucida] [mm] [math] [lucida] [default] [encoding=\typescripttwo]
- \stoptypescript
-
- \starttypescript [lucidabfm] [texnansi,ec,8r]
- \definetypeface [lucida] [mm] [bfmath] [lucida] [default] [encoding=\typescripttwo]
- \stoptypescript
-
- \starttypescript [lucidaboldmath] [texnansi,ec,8r]
- \definetypeface [lucida] [mm] [boldmath] [lucida] [default] [encoding=\typescripttwo]
- \stoptypescript
-
- \starttypescript [lucidabfm] [texnansi,ec,8r,uc]
- \definetypeface [lucidabfm] [rm] [serif] [lucida] [default] [encoding=\typescripttwo]
- \definetypeface [lucidabfm] [ss] [sans] [lucida] [default] [encoding=\typescripttwo]
- \definetypeface [lucidabfm] [tt] [mono] [lucida] [default] [encoding=\typescripttwo]
- \definetypeface [lucidabfm] [hw] [handwriting] [lucida] [default] [encoding=\typescripttwo]
- \definetypeface [lucidabfm] [cg] [calligraphy] [lucida] [default] [encoding=\typescripttwo]
- \definetypeface [lucidabfm] [mm] [bfmath] [lucida] [default] [encoding=\typescripttwo]
- \loadmapfile [lucida.map]
- \stoptypescript
-
- \starttypescript [lucidaboldmath] [texnansi,ec,8r,uc]
- \definetypeface [lucidaboldmath] [rm] [serif] [lucida] [default] [encoding=\typescripttwo]
- \definetypeface [lucidaboldmath] [ss] [sans] [lucida] [default] [encoding=\typescripttwo]
- \definetypeface [lucidaboldmath] [tt] [mono] [lucida] [default] [encoding=\typescripttwo]
- \definetypeface [lucidaboldmath] [hw] [handwriting] [lucida] [default] [encoding=\typescripttwo]
- \definetypeface [lucidaboldmath] [cg] [calligraphy] [lucida] [default] [encoding=\typescripttwo]
- \definetypeface [lucidaboldmath] [mm] [boldmath] [lucida] [default] [encoding=\typescripttwo]
- \loadmapfile [bh-lucida.map]
- \stoptypescript
-
- \starttypescript [lucida,lucidabfm,lucidaboldmath] [texnansi,ec,8r]
- \usemathcollection[lbr]
- \quittypescriptscanning % last in the row
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[postscript]
-
- \starttypescript [postscript] [ec,texnansi,cs,qx,rm,t5,t2a,t2b,t2c,l7x]
- \definetypeface [postscript] [rm] [serif] [times] [default] [encoding=\typescripttwo]
- \definetypeface [postscript] [ss] [sans] [helvetica] [default] [encoding=\typescripttwo,rscale=0.9]
- \definetypeface [postscript] [tt] [mono] [courier] [default] [encoding=\typescripttwo,rscale=1.1]
- \definetypeface [postscript] [mm] [math] [times] [default] [encoding=\typescripttwo]
- \quittypescriptscanning
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[libertine]
-
- \starttypescript [serif] [libertine] [ec]
- \definefontsynonym [Libertine-Regular] [fxlr-t1] [encoding=ec]
- \definefontsynonym [Libertine-Italic] [fxlri-t1] [encoding=ec]
- \definefontsynonym [Libertine-Bold] [fxlb-t1] [encoding=ec]
- \definefontsynonym [Libertine-BoldItalic] [fxlbi-t1] [encoding=ec]
- \definefontsynonym [Libertine-SmallCaps] [fxlrc-t1] %[encoding=ec]
- \loadmapfile [libertine.map]
- \stoptypescript
-
- \starttypescript [serif] [libertine] [name]
- \definefontsynonym [Serif] [Libertine-Regular]
- \definefontsynonym [SerifItalic] [Libertine-Italic]
- \definefontsynonym [SerifSlanted] [Libertine-Italic]
- \definefontsynonym [SerifBold] [Libertine-Bold]
- \definefontsynonym [SerifBoldItalic] [Libertine-BoldItalic]
- \definefontsynonym [SerifBoldSlanted][Libertine-BoldItalic]
- \definefontsynonym [SerifCaps] [Libertine-SmallCaps]
- \stoptypescript
-
- \starttypescript [libertine] [ec]
- \definetypeface [libertine] [tt] [mono] [default] [default] [encoding=ec]
- \definetypeface [libertine] [ss] [sans] [default] [default] [encoding=ec]
- \definetypeface [libertine] [rm] [serif] [libertine] [default] [encoding=ec]
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[inconsolata]
-
- \starttypescript [mono] [inconsolata] [ec]
- \definefontsynonym [Inconsolata] [ec-inconsolata] [encoding=ec]
- \pdfmapline{ec-inconsolata Inconsolata "fi4ECEncoding ReEncodeFont" <[fi4-ec.enc <Inconsolata.pfb}
- \stoptypescript
-
- \starttypescript [mono] [inconsolata] [name]
- \definefontsynonym [Mono] [Inconsolata]
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[dejavu]
-
- \definetypescriptprefix [e:ec] [t1]
- \definetypescriptprefix [e:qx] [qx]
- \definetypescriptprefix [e:t2a] [t2a]
-
- \starttypescript [serif] [dejavu] [ec,qx,t2a]
- \definefontsynonym [DejaVuSerif] [DejaVuSerif-tlf-\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree]
- \definefontsynonym [DejaVuSerif-Italic] [DejaVuSerif-Italic-tlf-\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree]
- \definefontsynonym [DejaVuSerif-Bold] [DejaVuSerif-Bold-tlf-\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree]
- \definefontsynonym [DejaVuSerif-BoldItalic] [DejaVuSerif-BoldItalic-tlf-\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree]
-
- \loadmapfile[dejavu-truetype.map]
- \stoptypescript
-
- \starttypescript [serif] [dejavu-condensed] [ec,qx,t2a]
- \definefontsynonym [DejaVuSerifCondensed] [DejaVuSerifCondensed-tlf-\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree]
- \definefontsynonym [DejaVuSerifCondensed-Italic] [DejaVuSerifCondensed-Italic-tlf-\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree]
- \definefontsynonym [DejaVuSerifCondensed-Bold] [DejaVuSerifCondensed-Bold-tlf-\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree]
- \definefontsynonym [DejaVuSerifCondensed-BoldItalic] [DejaVuSerifCondensed-BoldItalic-tlf-\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree]
-
- \loadmapfile[dejavu-truetype.map]
- \stoptypescript
-
- \starttypescript [sans] [dejavu] [ec,qx,t2a]
- \definefontsynonym [DejaVuSans] [DejaVuSans-tlf-\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree]
- \definefontsynonym [DejaVuSans-Italic] [DejaVuSans-Italic-tlf-\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree]
- \definefontsynonym [DejaVuSans-Bold] [DejaVuSans-Bold-tlf-\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree]
- \definefontsynonym [DejaVuSans-BoldItalic] [DejaVuSans-BoldItalic-tlf-\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree]
-
- \loadmapfile[dejavu-truetype.map]
- \stoptypescript
-
- \starttypescript [sans] [dejavu-condensed] [ec,qx,t2a]
- \definefontsynonym [DejaVuSansCondensed] [DejaVuSansCondensed-tlf-\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree]
- \definefontsynonym [DejaVuSansCondensed-Italic] [DejaVuSansCondensed-Italic-tlf-\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree]
- \definefontsynonym [DejaVuSansCondensed-Bold] [DejaVuSansCondensed-Bold-tlf-\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree]
- \definefontsynonym [DejaVuSansCondensed-BoldItalic] [DejaVuSansCondensed-BoldItalic-tlf-\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree]
-
- \loadmapfile[dejavu-truetype.map]
- \stoptypescript
-
- \starttypescript [mono] [dejavu,dejavu-condensed] [ec,qx,t2a]
- \definefontsynonym [DejaVuSansMono] [DejaVuSansMono-tlf-\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree]
- \definefontsynonym [DejaVuSansMono-Italic] [DejaVuSansMono-Italic-tlf-\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree]
- \definefontsynonym [DejaVuSansMono-Bold] [DejaVuSansMono-Bold-tlf-\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree]
- \definefontsynonym [DejaVuSansMono-BoldItalic] [DejaVuSansMono-BoldItalic-tlf-\typescriptprefix{e:\typescriptthree}] [encoding=\typescriptthree]
-
- \loadmapfile[dejavu-truetype.map]
- \stoptypescript
-
- \starttypescript [serif] [dejavu] [name]
- \definefontsynonym [Serif] [DejaVuSerif]
- \definefontsynonym [SerifItalic] [DejaVuSerif-Italic]
- \definefontsynonym [SerifBold] [DejaVuSerif-Bold]
- \definefontsynonym [SerifBoldItalic] [DejaVuSerif-BoldItalic]
-
- \definefontsynonym [SerifSlanted] [SerifItalic]
- \definefontsynonym [SerifBoldSlanted] [SerifBoldItalic]
- \definefontsynonym [SerifCaps] [Serif]
- \stoptypescript
-
- \starttypescript [serif] [dejavu-condensed] [name]
- \definefontsynonym [Serif] [DejaVuSerifCondensed]
- \definefontsynonym [SerifItalic] [DejaVuSerifCondensed-Italic]
- \definefontsynonym [SerifBold] [DejaVuSerifCondensed-Bold]
- \definefontsynonym [SerifBoldItalic] [DejaVuSerifCondensed-BoldItalic]
-
- \definefontsynonym [SerifSlanted] [SerifItalic]
- \definefontsynonym [SerifBoldSlanted] [SerifBoldItalic]
- \definefontsynonym [SerifCaps] [Serif]
- \stoptypescript
-
- \starttypescript [sans] [dejavu] [name]
- \definefontsynonym [Sans] [DejaVuSans]
- \definefontsynonym [SansItalic] [DejaVuSans-Italic]
- \definefontsynonym [SansBold] [DejaVuSans-Bold]
- \definefontsynonym [SansBoldItalic] [DejaVuSans-BoldItalic]
-
- \definefontsynonym [SansSlanted] [SansItalic]
- \definefontsynonym [SansBoldSlanted] [SansBoldItalic]
- \definefontsynonym [SansCaps] [Sans]
- \stoptypescript
-
- \starttypescript [sans] [dejavu-condensed] [name]
- \definefontsynonym [Sans] [DejaVuSansCondensed]
- \definefontsynonym [SansItalic] [DejaVuSansCondensed-Italic]
- \definefontsynonym [SansBold] [DejaVuSansCondensed-Bold]
- \definefontsynonym [SansBoldItalic] [DejaVuSansCondensed-BoldItalic]
-
- \definefontsynonym [SansSlanted] [SansItalic]
- \definefontsynonym [SansBoldSlanted] [SansBoldItalic]
- \definefontsynonym [SansCaps] [Sans]
- \stoptypescript
-
- \starttypescript [mono] [dejavu,dejavu-condensed] [name]
- \definefontsynonym [Mono] [DejaVuSansMono]
- \definefontsynonym [MonoItalic] [DejaVuSansMono-Italic]
- \definefontsynonym [MonoBold] [DejaVuSansMono-Bold]
- \definefontsynonym [MonoBoldItalic] [DejaVuSansMono-BoldItalic]
-
- \definefontsynonym [MonoSlanted] [MonoItalic]
- \definefontsynonym [MonoBoldSlanted] [MonoBoldItalic]
- \definefontsynonym [MonoCaps] [Mono]
- \stoptypescript
-
- \starttypescript [dejavu] [ec,qx,t2a]
- \definetypeface [dejavu] [rm] [serif] [dejavu] [default] [encoding=\typescripttwo]
- \definetypeface [dejavu] [ss] [sans] [dejavu] [default] [encoding=\typescripttwo]
- \definetypeface [dejavu] [tt] [mono] [dejavu] [default] [encoding=\typescripttwo]
- \definetypeface [dejavu] [mm] [math] [xits] [default] [rscale=auto]
- \loadmapfile [dejavu-truetype.map]
- \stoptypescript
-
- \starttypescript [dejavu-condensed] [ec,qx,t2a]
- \definetypeface [dejavu-condensed] [rm] [serif] [dejavu-condensed] [default] [encoding=\typescripttwo]
- \definetypeface [dejavu-condensed] [ss] [sans] [dejavu-condensed] [default] [encoding=\typescripttwo]
- \definetypeface [dejavu-condensed] [tt] [mono] [dejavu-condensed] [default] [encoding=\typescripttwo]
- \definetypeface [dejavu-condensed] [mm] [math] [xits] [default] [rscale=auto]
- \loadmapfile [dejavu-truetype.map]
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[gentium]
-
- \starttypescript [serif] [gentium] [ec,texnansi,qx,t5,l7x]
- \definefontsynonym [Gentium-Roman] [\typescriptthree-gentiumplus-regular] [encoding=\typescriptthree]
- \definefontsynonym [Gentium-Italic] [\typescriptthree-gentiumplus-italic] [encoding=\typescriptthree]
- \definefontsynonym [Gentium-Bold] [\typescriptthree-gentiumbasic-bold] [encoding=\typescriptthree]
- \definefontsynonym [Gentium-BoldItalic] [\typescriptthree-gentiumbasic-bolditalic] [encoding=\typescriptthree]
- \definefontsynonym [Gentium-RomanCaps] [\typescriptthree-gentiumplus-regular-sc] [encoding=\typescriptthree]
- \definefontsynonym [Gentium-Slanted] [Gentium-Italic]
- \definefontsynonym [Gentium-BoldSlanted] [Gentium-BoldItalic]
- \loadmapfile[gentium-\typescriptthree.map]
- \stoptypescript
-
- \starttypescript [serif] [gentium] [agr,t2a]
- \definefontsynonym [Gentium-Roman] [\typescriptthree-gentiumplus-regular] [encoding=\typescriptthree]
- \definefontsynonym [Gentium-Italic] [\typescriptthree-gentiumplus-italic] [encoding=\typescriptthree]
- \definefontsynonym [Gentium-RomanCaps] [\typescriptthree-gentiumplus-regular-sc] [encoding=\typescriptthree]
- \definefontsynonym [Gentium-Bold] [Gentium-Roman]
- \definefontsynonym [Gentium-BoldItalic] [Gentium-Italic]
- \definefontsynonym [Gentium-Slanted] [Gentium-Italic]
- \definefontsynonym [Gentium-BoldSlanted] [Gentium-Italic]
- \loadmapfile[gentium-\typescriptthree.map]
- \stoptypescript
-
- \starttypescript [serif] [gentium] [name]
- \usetypescript[serif][fallback]
- \definefontsynonym [Serif] [Gentium-Roman]
- \definefontsynonym [SerifItalic] [Gentium-Italic]
- \definefontsynonym [SerifBold] [Gentium-Bold]
- \definefontsynonym [SerifBoldItalic] [Gentium-BoldItalic]
- \definefontsynonym [SerifSlanted] [Gentium-Slanted]
- \definefontsynonym [SerifBoldSlanted] [Gentium-BoldSlanted]
- \definefontsynonym [SerifCaps] [Gentium-RomanCaps]
- \definefontsynonym [OldStyle] [Serif]
- \stoptypescript
-
- \starttypescript [gentium] [ec,texnansi,qx,t5,t2a,agr,l7x]
- \definetypeface [gentium] [rm] [serif] [gentium] [default] [encoding=\typescripttwo]
- \stoptypescript
-
-\stoptypescriptcollection
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/type-otf.mkii b/Master/texmf-dist/tex/context/base/mkii/type-otf.mkii
deleted file mode 100644
index d15994f6aed..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/type-otf.mkii
+++ /dev/null
@@ -1,1734 +0,0 @@
-%D \module
-%D [ file=type-otf,
-%D version=2007.07.30,
-%D title=\CONTEXT\ Typescript Macros,
-%D subtitle=Opentype Definitions,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Actually, \LUATEX\ does not need all these definitions since it can
-%D consult its database. However, here we use the names that we used
-%D in good old \TEX, and these may differ a bit. Here we also see
-%D some oldstyle definitions which normally are done with features.
-
-\starttypescriptcollection[fallback]
-
-\starttypescript [fallback]
- \definetypeface [] [rm] [serif] [modern] [computer-modern] [features=default]
- \definetypeface [] [ss] [sans] [modern] [computer-modern] [features=default]
- \definetypeface [] [tt] [mono] [modern] [computer-modern] [features=default]
- \definetypeface [] [mm] [math] [modern] [computer-modern]
- \quittypescriptscanning
-\stoptypescript
-
-% faster
-%
-% \starttypescript [fallback]
-% \definetypeface [] [rm] [serif] [modern] [default] [features=default]
-% \definetypeface [] [ss] [sans] [modern] [default] [features=default]
-% \definetypeface [] [tt] [mono] [modern] [default] [features=default]
-% \definetypeface [] [mm] [math] [modern] [default]
-% \quittypescriptscanning
-% \stoptypescript
-
-\stoptypescriptcollection
-
-% if a fontname equals the filename, then use
-%
-% \setupfontsynonym [LMRoman10-DemiOblique] [features=default] % file is lowercase, so fails
-% \definefontsynonym [LMRoman10-DemiOblique] [name:LMRoman10-DemiOblique] [features=default]
-% \definefontsynonym [LMRoman10-DemiOblique] [lmroman10-demioblique] [features=default]
-
-\starttypescriptcollection[latinmodern]
-
- %D The names have changed (again) ... but I will not change the symbolic names
- %D any more. Filename changes will be catched in luatex (fallbacks) but not in
- %D other tex's.
-
- \starttypescript [serif] [modern,latin-modern]
- \definefontsynonym [LMRoman5-Regular] [file:lmroman5-regular] [features=default]
- \definefontsynonym [LMRoman6-Regular] [file:lmroman6-regular] [features=default]
- \definefontsynonym [LMRoman7-Regular] [file:lmroman7-regular] [features=default]
- \definefontsynonym [LMRoman8-Regular] [file:lmroman8-regular] [features=default]
- \definefontsynonym [LMRoman9-Regular] [file:lmroman9-regular] [features=default]
- \definefontsynonym [LMRoman10-Regular] [file:lmroman10-regular] [features=default]
- \definefontsynonym [LMRoman12-Regular] [file:lmroman12-regular] [features=default]
- \definefontsynonym [LMRoman17-Regular] [file:lmroman17-regular] [features=default]
- \definefontsynonym [LMRoman5-Bold] [file:lmroman5-bold] [features=default]
- \definefontsynonym [LMRoman6-Bold] [file:lmroman6-bold] [features=default]
- \definefontsynonym [LMRoman7-Bold] [file:lmroman7-bold] [features=default]
- \definefontsynonym [LMRoman8-Bold] [file:lmroman8-bold] [features=default]
- \definefontsynonym [LMRoman9-Bold] [file:lmroman9-bold] [features=default]
- \definefontsynonym [LMRoman10-Bold] [file:lmroman10-bold] [features=default]
- \definefontsynonym [LMRoman12-Bold] [file:lmroman12-bold] [features=default]
- \definefontsynonym [LMRoman7-Italic] [file:lmroman7-italic] [features=default]
- \definefontsynonym [LMRoman8-Italic] [file:lmroman8-italic] [features=default]
- \definefontsynonym [LMRoman9-Italic] [file:lmroman9-italic] [features=default]
- \definefontsynonym [LMRoman10-Italic] [file:lmroman10-italic] [features=default]
- \definefontsynonym [LMRoman12-Italic] [file:lmroman12-italic] [features=default]
- \definefontsynonym [LMRoman10-BoldItalic] [file:lmroman10-bolditalic] [features=default]
- \definefontsynonym [LMRoman8-Oblique] [file:lmromanslant8-regular] [features=default]
- \definefontsynonym [LMRoman9-Oblique] [file:lmromanslant9-regular] [features=default]
- \definefontsynonym [LMRoman10-Oblique] [file:lmromanslant10-regular][features=default]
- \definefontsynonym [LMRoman12-Oblique] [file:lmromanslant12-regular][features=default]
- \definefontsynonym [LMRoman17-Oblique] [file:lmromanslant17-regular][features=default]
- \definefontsynonym [LMRoman10-BoldOblique] [file:lmromanslant10-bold] [features=default]
- \definefontsynonym [LMRoman10-Demi] [file:lmromandemi10-regular] [features=default]
- \definefontsynonym [LMRoman10-DemiOblique] [file:lmromandemi10-oblique] [features=default]
- \definefontsynonym [LMRoman10-CapsRegular] [file:lmromancaps10-regular] [features=default] % features=smallcaps?
- \definefontsynonym [LMRoman10-CapsOblique] [file:lmromancaps10-oblique] [features=default]
-
- \definefontsynonym [LMRoman10-Dunhill] [file:lmromandunh10-regular] [features=default]
- \definefontsynonym [LMRoman10-DunhillOblique] [file:lmromandunh10-oblique] [features=default]
- \definefontsynonym [LMRoman10-Unslanted] [file:lmromanunsl10-regular] [features=default]
- \stoptypescript
-
- \starttypescript [sans] [modern,latin-modern]
- \definefontsynonym [LMSans8-Regular] [file:lmsans8-regular] [features=default]
- \definefontsynonym [LMSans9-Regular] [file:lmsans9-regular] [features=default]
- \definefontsynonym [LMSans10-Regular] [file:lmsans10-regular] [features=default]
- \definefontsynonym [LMSans12-Regular] [file:lmsans12-regular] [features=default]
- \definefontsynonym [LMSans17-Regular] [file:lmsans17-regular] [features=default]
- \definefontsynonym [LMSans10-Bold] [file:lmsans10-bold] [features=default]
- \definefontsynonym [LMSans8-Oblique] [file:lmsans8-oblique] [features=default]
- \definefontsynonym [LMSans9-Oblique] [file:lmsans9-oblique] [features=default]
- \definefontsynonym [LMSans10-Oblique] [file:lmsans10-oblique] [features=default]
- \definefontsynonym [LMSans12-Oblique] [file:lmsans12-oblique] [features=default]
- \definefontsynonym [LMSans17-Oblique] [file:lmsans17-oblique] [features=default]
- \definefontsynonym [LMSans10-BoldOblique] [file:lmsans10-boldoblique] [features=default]
-
- \definefontsynonym [LMSans10-DemiCondensed] [file:lmsansdemicond10-regular] [features=default]
- \definefontsynonym [LMSans10-DemiCondensedOblique] [file:lmsansdemicond10-oblique] [features=default]
-
- \definefontsynonym [LMSansQuotation8-Regular] [file:lmsansquot8-regular] [features=default]
- \definefontsynonym [LMSansQuotation8-Bold] [file:lmsansquot8-bold] [features=default]
- \definefontsynonym [LMSansQuotation8-Oblique] [file:lmsansquot8-oblique] [features=default]
- \definefontsynonym [LMSansQuotation8-BoldOblique] [file:lmsansquot8-boldoblique] [features=default]
- \stoptypescript
-
- \starttypescript [mono] [modern,latin-modern,modern-vari,latin-modern-vari,modern-cond,latin-modern-cond]
- \definefontsynonym [LMTypewriter8-Regular] [file:lmmono8-regular] [features=none]
- \definefontsynonym [LMTypewriter9-Regular] [file:lmmono9-regular] [features=none]
- \definefontsynonym [LMTypewriter10-Regular] [file:lmmono10-regular] [features=none]
- \definefontsynonym [LMTypewriter12-Regular] [file:lmmono12-regular] [features=none]
- \definefontsynonym [LMTypewriter10-Italic] [file:lmmono10-italic] [features=none]
- \definefontsynonym [LMTypewriter10-Oblique] [file:lmmonoslant10-regular] [features=none]
- \definefontsynonym [LMTypewriter10-CapsRegular] [file:lmmonocaps10-regular] [features=none] % features=smallcaps?
- \definefontsynonym [LMTypewriter10-CapsOblique] [file:lmmonocaps10-oblique] [features=none]
-
- \definefontsynonym [LMTypewriter10-Light] [file:lmmonolt10-regular] [features=none]
- \definefontsynonym [LMTypewriter10-LightOblique] [file:lmmonolt10-oblique] [features=none]
- \definefontsynonym [LMTypewriter10-LightCondensed] [file:lmmonoltcond10-regular] [features=none]
- \definefontsynonym [LMTypewriter10-LightCondensedOblique] [file:lmmonoltcond10-oblique] [features=none]
-
- \definefontsynonym [LMTypewriter10-Dark] [file:lmmonolt10-bold] [features=none]
- \definefontsynonym [LMTypewriter10-DarkOblique] [file:lmmonolt10-boldoblique] [features=none]
-
- \definefontsynonym [LMTypewriterVarWd10-Regular] [file:lmmonoproplt10-regular] [features=default]
- \definefontsynonym [LMTypewriterVarWd10-Oblique] [file:lmmonoproplt10-oblique] [features=default]
- \definefontsynonym [LMTypewriterVarWd10-Light] [file:lmmonoprop10-regular] [features=default]
- \definefontsynonym [LMTypewriterVarWd10-LightOblique] [file:lmmonoprop10-oblique] [features=default]
- \definefontsynonym [LMTypewriterVarWd10-Dark] [file:lmmonoproplt10-bold] [features=default]
- \definefontsynonym [LMTypewriterVarWd10-DarkOblique] [file:lmmonoproplt10-boldoblique] [features=default]
- \stoptypescript
-
- \starttypescript [math] [modern,latin-modern]
- \definefontsynonym [LMMathRoman5-Regular] [rm-lmr5]
- \definefontsynonym [LMMathRoman6-Regular] [rm-lmr6]
- \definefontsynonym [LMMathRoman7-Regular] [rm-lmr7]
- \definefontsynonym [LMMathRoman8-Regular] [rm-lmr8]
- \definefontsynonym [LMMathRoman9-Regular] [rm-lmr9]
- \definefontsynonym [LMMathRoman10-Regular] [rm-lmr10]
- \definefontsynonym [LMMathRoman12-Regular] [rm-lmr12]
- \definefontsynonym [LMMathRoman17-Regular] [rm-lmr17]
- \definefontsynonym [LMMathRoman5-Bold] [rm-lmbx5]
- \definefontsynonym [LMMathRoman6-Bold] [rm-lmbx6]
- \definefontsynonym [LMMathRoman7-Bold] [rm-lmbx7]
- \definefontsynonym [LMMathRoman8-Bold] [rm-lmbx8]
- \definefontsynonym [LMMathRoman9-Bold] [rm-lmbx9]
- \definefontsynonym [LMMathRoman10-Bold] [rm-lmbx10]
- \definefontsynonym [LMMathRoman12-Bold] [rm-lmbx12]
- \definefontsynonym [LMMathSymbols5-BoldItalic] [lmbsy5]
- \definefontsynonym [LMMathSymbols7-BoldItalic] [lmbsy7]
- \definefontsynonym [LMMathSymbols10-BoldItalic][lmbsy10]
- \definefontsynonym [LMMathSymbols5-Italic] [lmsy5]
- \definefontsynonym [LMMathSymbols6-Italic] [lmsy6]
- \definefontsynonym [LMMathSymbols7-Italic] [lmsy7]
- \definefontsynonym [LMMathSymbols8-Italic] [lmsy8]
- \definefontsynonym [LMMathSymbols9-Italic] [lmsy9]
- \definefontsynonym [LMMathSymbols10-Italic] [lmsy10]
- \definefontsynonym [LMMathExtension10-Regular] [lmex10]
- \definefontsynonym [LMMathItalic5-Italic] [lmmi5]
- \definefontsynonym [LMMathItalic6-Italic] [lmmi6]
- \definefontsynonym [LMMathItalic7-Italic] [lmmi7]
- \definefontsynonym [LMMathItalic8-Italic] [lmmi8]
- \definefontsynonym [LMMathItalic9-Italic] [lmmi9]
- \definefontsynonym [LMMathItalic10-Italic] [lmmi10]
- \definefontsynonym [LMMathItalic12-Italic] [lmmi12]
- \definefontsynonym [LMMathItalic5-BoldItalic] [lmmib5]
- \definefontsynonym [LMMathItalic7-BoldItalic] [lmmib7]
- \definefontsynonym [LMMathItalic10-BoldItalic] [lmmib10]
-
- \loadmapfile[lm-math.map]
- \loadmapfile[lm-rm.map]
- \stoptypescript
-
- \starttypescript [serif] [modern,computer-modern,latin-modern] [name]
- \definefontsynonym [Serif] [LMRoman-Regular]
- \definefontsynonym [SerifBold] [LMRoman-Bold]
- \definefontsynonym [SerifItalic] [LMRoman-Italic]
- \definefontsynonym [SerifSlanted] [LMRoman-Oblique]
- \definefontsynonym [SerifBoldItalic] [LMRoman-BoldItalic]
- \definefontsynonym [SerifBoldSlanted] [LMRoman-BoldOblique]
- \definefontsynonym [SerifCaps] [LMRoman-CapsRegular]
- \definefontsynonym [SerifCapsSlanted] [LMRoman-CapsOblique]
- \stoptypescript
-
- \starttypescript [sans] [modern,computer-modern,latin-modern] [name]
- \definefontsynonym [Sans] [LMSans-Regular]
- \definefontsynonym [SansBold] [LMSans-Bold]
- \definefontsynonym [SansItalic] [LMSans-Oblique]
- \definefontsynonym [SansSlanted] [LMSans-Oblique]
- \definefontsynonym [SansBoldItalic] [LMSans-BoldOblique]
- \definefontsynonym [SansBoldSlanted] [LMSans-BoldOblique]
- \definefontsynonym [SansCaps] [LMSans-Regular]
- \definefontsynonym [SansCapsSlanted] [LMSans-Oblique]
- \stoptypescript
-
- \starttypescript [mono] [modern,computer-modern,latin-modern] [name]
- \definefontsynonym [Mono] [LMTypewriter-Regular]
- \definefontsynonym [MonoBold] [LMTypewriter-Dark]
- \definefontsynonym [MonoItalic] [LMTypewriter-Italic]
- \definefontsynonym [MonoSlanted] [LMTypewriter-Oblique]
- \definefontsynonym [MonoBoldItalic] [LMTypewriter-DarkOblique]
- \definefontsynonym [MonoBoldSlanted] [LMTypewriter-DarkOblique]
- \definefontsynonym [MonoCaps] [LMTypewriter-CapsRegular]
- \definefontsynonym [MonoCapsSlanted] [LMTypewriter-CapsOblique]
- \definefontsynonym [MonoVariable] [LMTypewriterVarWd-Regular]
- \stoptypescript
-
- \starttypescript [math] [modern,computer-modern,latin-modern] [name]
- \definefontsynonym [MathRoman] [LMMathRoman-Regular]
- \definefontsynonym [MathExtension] [LMMathExtension-Regular]
- \definefontsynonym [MathItalic] [LMMathItalic-Italic]
- \definefontsynonym [MathSymbol] [LMMathSymbols-Italic]
- \stoptypescript
-
- \starttypescript [boldmath] [modern,computer-modern,latin-modern] [name]
- \definefontsynonym [MathRoman] [LMMathRoman-Bold]
- \definefontsynonym [MathExtension] [LMMathExtension-Regular]
- \definefontsynonym [MathItalic] [LMMathItalic-BoldItalic]
- \definefontsynonym [MathSymbol] [LMMathSymbols-BoldItalic]
- \stoptypescript
-
- \starttypescript [bfmath] [modern,computer-modern,latin-modern] [name]
- \definefontsynonym [MathRomanBold] [LMMathRoman-Bold]
- \definefontsynonym [MathExtension] [LMMathExtension-Regular]
- \definefontsynonym [MathItalicBold] [LMMathItalic-BoldItalic]
- \definefontsynonym [MathSymbolBold] [LMMathSymbols-BoldItalic]
- \stoptypescript
-
- \starttypescript [math,boldmath,bfmath] [modern,computer-modern,latin-modern] [name]
- \usemathcollection[default]
- \stoptypescript
-
- \starttypescript [serif] [modern-vari,computer-modern-vari,latin-modern-vari] [name]
- \definefontsynonym [Serif] [LMTypewriterVarWd-Regular]
- \definefontsynonym [SerifBold] [LMTypewriterVarWd-Oblique]
- \definefontsynonym [SerifItalic] [LMTypewriterVarWd-Oblique]
- \definefontsynonym [SerifSlanted] [LMTypewriterVarWd-Dark]
- \definefontsynonym [SerifBoldItalic] [LMTypewriterVarWd-DarkOblique]
- \definefontsynonym [SerifBoldSlanted] [LMTypewriterVarWd-DarkOblique]
- \definefontsynonym [SerifCaps] [LMTypewriterVarWd-Regular]
- \definefontsynonym [SerifCapsSlanted] [LMTypewriterVarWd-Oblique]
- \stoptypescript
-
- \starttypescript [mono] [modern-cond,computer-modern-cond,latin-modern-cond,modern-lightcond,computer-modern-lightcond,latin-modern-lightcond] [name]
- \definefontsynonym [Mono] [LMTypewriter-LightCondensed]
- \definefontsynonym [MonoBold] [LMTypewriter-LightCondensed]
- \definefontsynonym [MonoItalic] [LMTypewriter-LightCondensedOblique]
- \definefontsynonym [MonoSlanted] [LMTypewriter-LightCondensedOblique]
- \definefontsynonym [MonoBoldItalic] [LMTypewriter-LightCondensed]
- \definefontsynonym [MonoBoldSlanted] [LMTypewriter-LightCondensed]
- \definefontsynonym [MonoCaps] [LMTypewriter-LightCondensed]
- \definefontsynonym [MonoCapsSlanted] [LMTypewriter-LightCondensed]
- \stoptypescript
-
- \starttypescript [mono] [modern-light,computer-modern-light,latin-modern-light] [name]
- \definefontsynonym [Mono] [LMTypewriter-Light]
- \definefontsynonym [MonoBold] [LMTypewriter-Light]
- \definefontsynonym [MonoItalic] [LMTypewriter-LightOblique]
- \definefontsynonym [MonoSlanted] [LMTypewriter-LightOblique]
- \definefontsynonym [MonoBoldItalic] [LMTypewriter-Light]
- \definefontsynonym [MonoBoldSlanted] [LMTypewriter-Light]
- \definefontsynonym [MonoCaps] [LMTypewriter-Light]
- \definefontsynonym [MonoCapsSlanted] [LMTypewriter-Light]
- \stoptypescript
-
- % Later we will map the real fonts, here we just map synonyms.
-
- \starttypescript [serif] [modern,latin-modern]
- \definefontsynonym [LMRoman-DemiOblique] [LMRoman10-DemiOblique]
- \definefontsynonym [LMRoman-Bold] [LMRoman10-Bold]
- \definefontsynonym [LMRoman-BoldItalic] [LMRoman10-BoldItalic]
- \definefontsynonym [LMRoman-BoldOblique] [LMRoman10-BoldOblique]
- \definefontsynonym [LMRoman-CapsRegular] [LMRoman10-CapsRegular]
- \definefontsynonym [LMRoman-CapsOblique] [LMRoman10-CapsOblique]
- \definefontsynonym [LMRoman-Regular] [LMRoman10-Regular]
- \definefontsynonym [LMRoman-Italic] [LMRoman10-Italic]
- \definefontsynonym [LMRoman-Oblique] [LMRoman10-Oblique]
- \stoptypescript
-
- \starttypescript [sans] [modern,latin-modern]
- \definefontsynonym [LMSans-Regular] [LMSans10-Regular]
- \definefontsynonym [LMSans-BoldOblique] [LMSans10-BoldOblique]
- \definefontsynonym [LMSans-Bold] [LMSans10-Bold]
- \definefontsynonym [LMSans-DemiCondensed] [LMSans10-DemiCondensed]
- \definefontsynonym [LMSans-DemiCondensedOblique] [LMSans10-DemiCondensedOblique]
- \definefontsynonym [LMSans-Oblique] [LMSans10-Oblique]
- \stoptypescript
-
- \starttypescript [mono] [modern,latin-modern,modern-vari,latin-modern-vari,modern-cond,latin-modern-cond]
- \definefontsynonym [LMTypewriter-CapsRegular] [LMTypewriter10-CapsRegular]
- \definefontsynonym [LMTypewriter-CapsOblique] [LMTypewriter10-CapsOblique]
- \definefontsynonym [LMTypewriter-Light] [LMTypewriter10-Light]
- \definefontsynonym [LMTypewriter-LightOblique] [LMTypewriter10-LightOblique]
- \definefontsynonym [LMTypewriter-LightCondensed] [LMTypewriter10-LightCondensed]
- \definefontsynonym [LMTypewriter-LightCondensedOblique] [LMTypewriter10-LightCondensedOblique]
- \definefontsynonym [LMTypewriter-Dark] [LMTypewriter10-Dark]
- \definefontsynonym [LMTypewriter-DarkOblique] [LMTypewriter10-DarkOblique]
- \definefontsynonym [LMTypewriter-Regular] [LMTypewriter10-Regular]
- \definefontsynonym [LMTypewriter-Italic] [LMTypewriter10-Italic]
- \definefontsynonym [LMTypewriter-Oblique] [LMTypewriter10-Oblique]
- \definefontsynonym [LMTypewriterVarWd-Regular] [LMTypewriterVarWd10-Regular]
- \definefontsynonym [LMTypewriterVarWd-Oblique] [LMTypewriterVarWd10-Oblique]
- \definefontsynonym [LMTypewriterVarWd-Light] [LMTypewriterVarWd10-Light]
- \definefontsynonym [LMTypewriterVarWd-LightOblique] [LMTypewriterVarWd10-LightOblique]
- \definefontsynonym [LMTypewriterVarWd-Dark] [LMTypewriterVarWd10-Dark]
- \definefontsynonym [LMTypewriterVarWd-DarkOblique] [LMTypewriterVarWd10-DarkOblique]
- \stoptypescript
-
- \starttypescript [serif] [modern,computer-modern,latin-modern]
- \definefontsynonym [ComputerModern] [LMRoman-Regular]
- \definefontsynonym [ComputerModern-Italic] [LMRoman-Italic]
- \definefontsynonym [ComputerModern-Slanted] [LMRoman-Oblique]
- \definefontsynonym [ComputerModern-Bold] [LMRoman-Bold]
- \definefontsynonym [ComputerModern-BoldItalic] [LMRoman-BoldItalic]
- \definefontsynonym [ComputerModern-BoldSlanted] [LMRoman-BoldOblique]
- \definefontsynonym [ComputerModern-Caps] [LMRoman-CapsRegular]
- \definefontsynonym [ComputerModern-CapsSlanted] [LMRoman-CapsOblique]
- \stoptypescript
-
- \starttypescript [sans] [modern,computer-modern,latin-modern]
- \definefontsynonym [ComputerModernSans] [LMSans-Regular]
- \definefontsynonym [ComputerModernSans-Italic] [LMSans-Oblique]
- \definefontsynonym [ComputerModernSans-Slanted] [LMSans-Oblique]
- \definefontsynonym [ComputerModernSans-Bold] [LMSans-Bold]
- \definefontsynonym [ComputerModernSans-BoldItalic] [LMSans-BoldOblique]
- \definefontsynonym [ComputerModernSans-BoldSlanted] [LMSans-BoldOblique]
- \definefontsynonym [ComputerModernSans-Caps] [LMSans-Regular] % [LMSans-CapsRegular]
- \definefontsynonym [ComputerModernSans-CapsSlanted] [LMSans-Oblique] % [LMSans-CapsOblique]
- \stoptypescript
-
- \starttypescript [mono] [modern,computer-modern,latin-modern]
- \definefontsynonym [ComputerModernMono] [LMTypewriter-Regular]
- \definefontsynonym [ComputerModernMono-Italic] [LMTypewriter-Italic]
- \definefontsynonym [ComputerModernMono-Slanted] [LMTypewriter-Oblique]
- \definefontsynonym [ComputerModernMono-Bold] [LMTypewriter-Dark]
- \definefontsynonym [ComputerModernMono-BoldItalic] [LMTypewriter-DarkOblique] % !
- \definefontsynonym [ComputerModernMono-BoldSlanted] [LMTypewriter-DarkOblique]
- \definefontsynonym [ComputerModernMono-Caps] [LMTypewriter-CapsRegular]
- \definefontsynonym [ComputerModernMono-CapsSlanted] [LMTypewriter-CapsOblique]
- \definefontsynonym [ComputerModernMono-Variable] [LMTypewriterVarWd-Regular]
- \stoptypescript
-
- \starttypescript [serif] [modern-vari,computer-modern-vari,latin-modern-vari]
- \definefontsynonym [ComputerModernVariable] [LMTypewriterVarWd-Regular]
- \definefontsynonym [ComputerModernVariable-Italic] [LMTypewriterVarWd-Oblique]
- \definefontsynonym [ComputerModernVariable-Slanted] [LMTypewriterVarWd-Oblique]
- \definefontsynonym [ComputerModernVariable-Bold] [LMTypewriterVarWd-Dark]
- \definefontsynonym [ComputerModernVariable-BoldItalic] [LMTypewriterVarWd-DarkOblique]
- \definefontsynonym [ComputerModernVariable-BoldSlanted] [LMTypewriterVarWd-DarkOblique]
- \definefontsynonym [ComputerModernVariable-Caps] [LMTypewriterVarWd-Regular]
- \definefontsynonym [ComputerModernVariable-CapsSlanted] [LMTypewriterVarWd-Oblique]
- \stoptypescript
-
- \starttypescript [math] [modern,latin-modern]
- \definefontsynonym [LMMathRoman-Regular] [LMMathRoman10-Regular]
- \definefontsynonym [LMMathRoman-Bold] [LMMathRoman10-Bold]
- \definefontsynonym [LMMathSymbols-BoldItalic] [LMMathSymbols10-BoldItalic]
- \definefontsynonym [LMMathSymbols-Italic] [LMMathSymbols10-Italic]
- \definefontsynonym [LMMathExtension-Regular] [LMMathExtension10-Regular]
- \definefontsynonym [LMMathItalic-Italic] [LMMathItalic10-Italic]
- \definefontsynonym [LMMathItalic-BoldItalic] [LMMathItalic10-BoldItalic]
- \stoptypescript
-
- % can boldmath and bfmath be joined?
- \starttypescript [boldmath] [modern,computer-modern,latin-modern] [name]
- \definefontsynonym [LMMathRoman-Bold] [LMMathRoman10-Bold]
- \definefontsynonym [LMMathExtension-Regular] [LMMathExtension10-Regular]
- \definefontsynonym [LMMathItalic-BoldItalic] [LMMathItalic10-BoldItalic]
- \definefontsynonym [LMMathSymbols-BoldItalic] [LMMathSymbols10-BoldItalic]
- \stoptypescript
-
- \starttypescript [bfmath] [modern,computer-modern,latin-modern] [name]
- \definefontsynonym [LMMathRoman-Bold] [LMMathRoman10-Bold]
- \definefontsynonym [LMMathExtension-Regular] [LMMathExtension10-Regular]
- \definefontsynonym [LMMathItalic-BoldItalic] [LMMathItalic10-BoldItalic]
- \definefontsynonym [LMMathSymbols-BoldItalic] [LMMathSymbols10-BoldItalic]
- \stoptypescript
-
- \starttypescript [serif] [modern,latin-modern,computer-modern]
- \definefontsynonym [cmr5] [LMRoman5-Regular]
- \definefontsynonym [cmr6] [LMRoman6-Regular]
- \definefontsynonym [cmr7] [LMRoman7-Regular]
- \definefontsynonym [cmr8] [LMRoman8-Regular]
- \definefontsynonym [cmr9] [LMRoman9-Regular]
- \definefontsynonym [cmr10] [LMRoman10-Regular]
- \definefontsynonym [cmr12] [LMRoman12-Regular]
- \definefontsynonym [cmr17] [LMRoman17-Regular]
- \definefontsynonym [cmbx5] [LMRoman5-Bold]
- \definefontsynonym [cmbx6] [LMRoman6-Bold]
- \definefontsynonym [cmbx7] [LMRoman7-Bold]
- \definefontsynonym [cmbx8] [LMRoman8-Bold]
- \definefontsynonym [cmbx9] [LMRoman9-Bold]
- \definefontsynonym [cmbx10] [LMRoman10-Bold]
- \definefontsynonym [cmbx12] [LMRoman12-Bold]
- \definefontsynonym [cmsl10] [LMRoman10-Oblique]
- \definefontsynonym [cmsl12] [LMRoman12-Oblique]
- \definefontsynonym [cmsl17] [LMRoman17-Oblique]
- \definefontsynonym [cmsl8] [LMRoman8-Oblique]
- \definefontsynonym [cmsl9] [LMRoman9-Oblique]
- \definefontsynonym [cmti7] [LMRoman7-Italic]
- \definefontsynonym [cmti8] [LMRoman8-Italic]
- \definefontsynonym [cmti9] [LMRoman9-Italic]
- \definefontsynonym [cmti10] [LMRoman10-Italic]
- \definefontsynonym [cmti12] [LMRoman12-Italic]
- \definefontsynonym [cmbsl10] [LMRoman10-DemiOblique]
- \definefontsynonym [cmbxsl10] [LMRoman10-BoldOblique]
- \definefontsynonym [cmbxti10] [LMRoman10-BoldItalic]
- \definefontsynonym [cmcsc10] [LMRoman10-CapsRegular]
- \definefontsynonym [cmcscsl10][LMRoman10-CapsOblique]
-
- %definefontsynonym [cmb10]
- \stoptypescript
-
- \starttypescript [sans] [modern,latin-modern,computer-modern]
- \definefontsynonym [cmss8] [LMSans8-Regular]
- \definefontsynonym [cmss9] [LMSans9-Regular]
- \definefontsynonym [cmss10] [LMSans10-Regular]
- \definefontsynonym [cmss12] [LMSans12-Regular]
- \definefontsynonym [cmss17] [LMSans17-Regular]
- \definefontsynonym [cmssi10] [LMSans10-Oblique]
- \definefontsynonym [cmssi12] [LMSans12-Oblique]
- \definefontsynonym [cmssi17] [LMSans17-Oblique]
- \definefontsynonym [cmssi8] [LMSans8-Oblique]
- \definefontsynonym [cmssi9] [LMSans9-Oblique]
- \definefontsynonym [cmssq8] [LMSansQuotation8-Regular]
- \definefontsynonym [cmssqb8] [LMSansQuotation8-Bold]
- \definefontsynonym [cmssqbi8] [LMSansQuotation8-BoldOblique]
- \definefontsynonym [cmssqi8] [LMSansQuotation8-Oblique]
- \definefontsynonym [cmssbx10] [LMSans10-Bold]
- \definefontsynonym [cmssdc10] [LMSans10-DemiCondensed]
- \definefontsynonym [cmssbi10] [LMSans10-BoldOblique]
- \definefontsynonym [cmssdi10] [LMSans10-DemiCondensedOblique]
- \stoptypescript
-
- \starttypescript [mono] [modern,latin-modern,computer-modern]
- \definefontsynonym [cmtt8] [LMTypewriter8-Regular]
- \definefontsynonym [cmtt9] [LMTypewriter9-Regular]
- \definefontsynonym [cmtt10] [LMTypewriter10-Regular]
- \definefontsynonym [cmtt12] [LMTypewriter12-Regular]
- \definefontsynonym [cmitt10] [LMTypewriter10-Italic]
- \definefontsynonym [cmsltt10] [LMTypewriter10-Oblique]
- \definefontsynonym [cmvtt10] [LMTypewriterVarWd10-Regular]
- \definefontsynonym [cmvtti10] [LMTypewriterVarWd10-Oblique]
- \definefontsynonym [cmtcsc10] [LMTypewriter10-CapsRegular]
- \stoptypescript
-
- \starttypescript [math] [modern,latin-modern,computer-modern]
- \definefontsynonym [cmbsy5] [LMMathSymbols5-BoldItalic]
- \definefontsynonym [cmbsy7] [LMMathSymbols7-BoldItalic]
- \definefontsynonym [cmbsy10] [LMMathSymbols10-BoldItalic]
- \definefontsynonym [cmsy5] [LMMathSymbols5-Italic]
- \definefontsynonym [cmsy6] [LMMathSymbols6-Italic]
- \definefontsynonym [cmsy7] [LMMathSymbols7-Italic]
- \definefontsynonym [cmsy8] [LMMathSymbols8-Italic]
- \definefontsynonym [cmsy9] [LMMathSymbols9-Italic]
- \definefontsynonym [cmsy10] [LMMathSymbols10-Italic]
- \definefontsynonym [cmex10] [LMMathExtension10-Regular]
- \definefontsynonym [cmmi5] [LMMathItalic5-Italic]
- \definefontsynonym [cmmi6] [LMMathItalic6-Italic]
- \definefontsynonym [cmmi7] [LMMathItalic7-Italic]
- \definefontsynonym [cmmi8] [LMMathItalic8-Italic]
- \definefontsynonym [cmmi9] [LMMathItalic9-Italic]
- \definefontsynonym [cmmi10] [LMMathItalic10-Italic]
- \definefontsynonym [cmmi12] [LMMathItalic12-Italic]
- \definefontsynonym [cmmib5] [LMMathItalic5-BoldItalic]
- \definefontsynonym [cmmib7] [LMMathItalic7-BoldItalic]
- \definefontsynonym [cmmib10] [LMMathItalic10-BoldItalic]
- \stoptypescript
-
- % This will change some day.
-
- \starttypescript [math] [modern,computer-modern,latin-modern] [name]
- \definefontsynonym [OldStyle] [MathItalic]
- \definefontsynonym [Fraktur] [eufm10]
- \definefontsynonym [Blackboard] [msbm10]
- \definefontsynonym [Gothic] [eufm10]
- \definefontsynonym [Calligraphic] [cmsy10]
- \stoptypescript
-
- % Concrete Modern Roman : Donald Knuth
-
- \starttypescript [serif] [concrete] [name]
- \definefontsynonym [Serif] [ComputerConcrete]
- \definefontsynonym [SerifBold] [ComputerConcrete]
- \definefontsynonym [SerifItalic] [ComputerConcrete-Italic]
- \definefontsynonym [SerifSlanted] [ComputerConcrete-Slanted]
- \definefontsynonym [SerifBoldItalic] [ComputerConcrete-Italic]
- \definefontsynonym [SerifBoldSlanted] [ComputerConcrete-Slanted]
- \definefontsynonym [SerifCaps] [ComputerConcrete-Caps]
- \stoptypescript
-
- \starttypescript [math] [modern,computer-modern,latin-modern]
- \definefontsynonym [ComputerModernMath-Roman] [rm-lmr10]
- \definefontsynonym [ComputerModernMath-Extension] [lmex10]
- \definefontsynonym [ComputerModernMath-Italic] [lmmi10]
- \definefontsynonym [ComputerModernMath-Symbol] [lmsy10]
- \stoptypescript
-
- \starttypescript [boldmath,bfmath] [modern,computer-modern,latin-modern]
- \definefontsynonym [ComputerModernMath-Roman-Bold] [rm-lmb10]
- \definefontsynonym [ComputerModernMath-Extension] [lmex10]
- \definefontsynonym [ComputerModernMath-Italic-Bold] [lmmib10]
- \definefontsynonym [ComputerModernMath-Symbol-Bold] [lmbsy10]
- \stoptypescript
-
- \starttypescript [modern]
- \definetypeface [modern] [rm] [serif] [modern] [computer-modern] [features=default]
- \definetypeface [modern] [ss] [sans] [modern] [computer-modern] [features=default]
- \definetypeface [modern] [tt] [mono] [modern] [computer-modern] [features=default]
- \definetypeface [modern] [mm] [math] [modern] [computer-modern]
- \quittypescriptscanning
- \stoptypescript
-
- \starttypescript [modern-base]
- \definetypeface [modern] [rm] [serif] [modern] [default] [features=default]
- \definetypeface [modern] [ss] [sans] [modern] [default] [features=default]
- \definetypeface [modern] [tt] [mono] [modern] [default] [features=default]
- \definetypeface [modern] [mm] [math] [modern] [default]
- \quittypescriptscanning
- \stoptypescript
-
- \starttypescript [modernvariable]
- \definetypeface [modernvariable] [rm] [serif] [simple] [default] [features=default]
- \definetypeface [modernvariable] [ss] [sans] [modern] [default] [features=default]
- \definetypeface [modernvariable] [tt] [mono] [modern] [default] [features=default]
- \definetypeface [modernvariable] [mm] [math] [modern] [default]
- \quittypescriptscanning
- \stoptypescript
-
- \starttypescript [serif] [simple] [name] % bad, will be changed but in sycn with manuals that use it
- \definefontsynonym [Simple] [cmvtt10]
- \setupfontsynonym [Simple] [handling=pure]
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[concrete]
-
- % Computer Concrete (AMS)
-
- \starttypescript [serif] [concrete]
- \definefontsynonym [ComputerConcrete] [ccr10]
- \definefontsynonym [ComputerConcrete-Italic] [ccti10]
- \definefontsynonym [ComputerConcrete-Slanted] [ccsl10]
- \definefontsynonym [ComputerConcrete-Bold] [ComputerConcrete]
- \definefontsynonym [ComputerConcrete-BoldItalic] [ComputerConcrete-Italic]
- \definefontsynonym [ComputerConcrete-BoldSlanted] [ComputerConcrete-Slanted]
- \definefontsynonym [ComputerConcrete-Caps] [cccsc10]
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[euler]
-
- \starttypescript [math] [euler]
- \definefontsynonym [Euler-Roman] [zeurm10]
- \definefontsynonym [Euler-Extension] [zeuex10]
- \definefontsynonym [Euler-Symbol] [zeusm10]
- \definefontsynonym [Euler-Fraktur] [eufm10]
-
- \loadmapfile[original-ams-euler.map]
- \stoptypescript
-
- \starttypescript [boldmath,bfmath] [euler]
- \definefontsynonym [Euler-Roman-Bold] [zeurb10]
- \definefontsynonym [Euler-Extension] [zeuex10]
- \definefontsynonym [Euler-Symbol-Bold] [zeusb10]
- \definefontsynonym [Euler-Fraktur-Bold] [eufb10]
-
- \loadmapfile[original-ams-euler.map]
- \stoptypescript
-
- \starttypescript [math] [euler] [name]
- \definefontsynonym [MathRoman] [Euler-Roman] % mr
- \definefontsynonym [MathItalic] [Euler-Fraktur] % mi
- \definefontsynonym [MathExtension] [Euler-Extension] % ex
- \definefontsynonym [MathSymbol] [Euler-Symbol] % sy
- \stoptypescript
-
- \starttypescript [boldmath] [euler] [name]
- \definefontsynonym [MathRoman] [Euler-Roman-Bold] % mr
- \definefontsynonym [MathItalic] [Euler-Fraktur-Bold] % mi
- \definefontsynonym [MathExtension] [Euler-Extension] % ex
- \definefontsynonym [MathSymbol] [Euler-Symbol-Bold] % sy
- \stoptypescript
-
- \starttypescript [bfmath] [euler] [name]
- \definefontsynonym [MathRomanBold] [Euler-Roman-Bold] % mr
- \definefontsynonym [MathItalicBold] [Euler-Fraktur-Bold] % mi
- \definefontsynonym [MathExtension] [Euler-Extension] % ex
- \definefontsynonym [MathSymbolBold] [Euler-Symbol-Bold] % sy
- \stoptypescript
-
- \starttypescript [math] [euler] [name]
- \definefontsynonym [OldStyle] [MathItalic]
- \definefontsynonym [Fraktur] [MathItalic]
- \definefontsynonym [Gothic] [MathItalic]
- \definefontsynonym [Calligraphic] [MathSymbol]
- \stoptypescript
-
- \starttypescript [boldmath] [euler] [name]
- \definefontsynonym [OldStyle] [MathItalicBold]
- \definefontsynonym [Fraktur] [MathItalicBold]
- \definefontsynonym [Gothic] [MathItalicBold]
- \definefontsynonym [Calligraphic] [MathSymbolBold]
- \stoptypescript
-
- \starttypescript [math,boldmath,bfmath] [euler] [name]
- \usemathcollection[eul]
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[amssymbols]
-
- \starttypescript [math] [modern,computer-modern,latin-modern,ams] [name]
- \definefontsynonym [MathAlpha] [AMS-SymbolA]
- \definefontsynonym [MathBeta] [AMS-SymbolB]
- \stoptypescript
-
- \starttypescript [math] [modern,computer-modern,latin-modern,ams]
- \definefontsynonym [AMS-SymbolA] [msam10]
- \definefontsynonym [AMS-SymbolB] [msbm10]
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[texgyre]
-
- \definetypescriptprefix [f:pagella] [pagella] \definetypescriptprefix [f:palatino] [pagella]
- \definetypescriptprefix [f:termes] [termes] \definetypescriptprefix [f:times] [termes]
- \definetypescriptprefix [f:heros] [heros] \definetypescriptprefix [f:helvetica] [heros]
- \definetypescriptprefix [f:bonum] [bonum] \definetypescriptprefix [f:bookman] [bonum]
- \definetypescriptprefix [f:schola] [schola] \definetypescriptprefix [f:schoolbook] [schola]
- \definetypescriptprefix [f:adventor][adventor] %definetypescriptprefix [f:adventor] [adventor]
- \definetypescriptprefix [f:cursor] [cursor] \definetypescriptprefix [f:courier] [cursor]
- \definetypescriptprefix [f:chorus] [chorus] \definetypescriptprefix [f:chancery] [chorus] % not the full set
-
- % \starttypescript [serif,sans,mono] [adventor,bonum,cursor,heros,pagella,palatino,schola,termes]
- % \starttypescript [serif] [pagella,palatino,termes,times,bonum,bookman,schola,schoolbook] [name]
-
- \starttypescript [serif,sans,mono] [adventor,bonum,bookman,cursor,courier,heros,helvetica,pagella,palatino,schola,schoolbook,termes,times]
- \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Regular] [file:texgyre\typescriptprefix{f:\typescripttwo}-regular] [features=default]
- \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Italic] [file:texgyre\typescriptprefix{f:\typescripttwo}-italic] [features=default]
- \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Bold] [file:texgyre\typescriptprefix{f:\typescripttwo}-bold] [features=default]
- \definefontsynonym [\typescriptprefix{n:\typescripttwo}-BoldItalic] [file:texgyre\typescriptprefix{f:\typescripttwo}-bolditalic] [features=default]
- \definefontsynonym [\typescriptprefix{n:\typescripttwo}-Caps] [file:texgyre\typescriptprefix{f:\typescripttwo}-regular] [features=smallcaps]
- \definefontsynonym [\typescriptprefix{n:\typescripttwo}-ItalicCaps] [file:texgyre\typescriptprefix{f:\typescripttwo}-italic] [features=smallcaps]
- \definefontsynonym [\typescriptprefix{n:\typescripttwo}-BoldCaps] [file:texgyre\typescriptprefix{f:\typescripttwo}-bold] [features=smallcaps]
- \definefontsynonym [\typescriptprefix{n:\typescripttwo}-BoldItalicCaps] [file:texgyre\typescriptprefix{f:\typescripttwo}-bolditalic] [features=smallcaps]
- \stoptypescript
-
- \starttypescript [serif,calligraphy] [chorus,chancery]
- \definefontsynonym [TeXGyreChorus-MediumItalic] [file:texgyrechorus-mediumitalic] [features=default]
- \stoptypescript
-
- \definetypescriptprefix [n:pagella] [TeXGyrePagella] \definetypescriptprefix [n:palatino] [TeXGyrePagella]
- \definetypescriptprefix [n:termes] [TeXGyreTermes] \definetypescriptprefix [n:times] [TeXGyreTermes]
- \definetypescriptprefix [n:heros] [TeXGyreHeros] \definetypescriptprefix [n:helvetica] [TeXGyreHeros]
- \definetypescriptprefix [n:bonum] [TeXGyreBonum] \definetypescriptprefix [n:bookman] [TeXGyreBonum]
- \definetypescriptprefix [n:schola] [TeXGyreSchola] \definetypescriptprefix [n:schoolbook] [TeXGyreSchola]
- \definetypescriptprefix [n:adventor] [TeXGyreAdventor] %definetypescriptprefix [n:adventor] [TeXGyreAdventor]
- \definetypescriptprefix [n:cursor] [TeXGyreCursor] \definetypescriptprefix [n:courier] [TeXGyreCursor]
- \definetypescriptprefix [n:chorus] [TeXGyreChorus] \definetypescriptprefix [n:chancery] [TeXGyreChorus] % not the full set
-
- \starttypescript [serif] [pagella,palatino,termes,times,bonum,bookman,schola,schoolbook] [name]
- \definefontsynonym [Serif] [\typescriptprefix{n:\typescripttwo}-Regular]
- \definefontsynonym [SerifItalic] [\typescriptprefix{n:\typescripttwo}-Italic]
- \definefontsynonym [SerifBold] [\typescriptprefix{n:\typescripttwo}-Bold]
- \definefontsynonym [SerifBoldItalic] [\typescriptprefix{n:\typescripttwo}-BoldItalic]
- \definefontsynonym [SerifSlanted] [SerifItalic]
- \definefontsynonym [SerifBoldSlanted] [SerifBoldItalic]
- \definefontsynonym [SerifCaps] [\typescriptprefix{n:\typescripttwo}-Caps]
-
- \definefontvariant [Serif][osf][Caps]
- \definefontvariant [Serif][sc] [Caps]
-
- \definefontsynonym [SerifRegular] [Serif]
- \definefontsynonym [SerifRegularCaps] [SerifCaps]
- \definefontsynonym [SerifItalicCaps] [\typescriptprefix{n:\typescripttwo}-ItalicCaps]
- \definefontsynonym [SerifBoldCaps] [\typescriptprefix{n:\typescripttwo}-BoldCaps]
- \definefontsynonym [SerifBoldItalicCaps] [\typescriptprefix{n:\typescripttwo}-BoldItalicCaps]
- \definefontsynonym [SerifSlantedCaps] [SerifItalicCaps]
- \definefontsynonym [SerifBoldSlantedCaps] [SerifBoldItalicCaps]
- \definefontsynonym [SerifCapsCaps] [SerifCaps]
- \stoptypescript
-
- \starttypescript [serif] [chorus,chancery] [name]
- \definefontsynonym [SerifMediumItalic] [TeXGyreChorus-MediumItalic]
- \definefontsynonym [Serif] [SerifMediumItalic]
- \definefontsynonym [SerifItalic] [SerifMediumItalic]
- \definefontsynonym [SerifBold] [SerifMediumItalic]
- \definefontsynonym [SerifBoldItalic] [SerifMediumItalic]
- \definefontsynonym [SerifSlanted] [SerifMediumItalic]
- \definefontsynonym [SerifBoldSlanted] [SerifMediumItalic]
- \definefontsynonym [SerifCaps] [SerifMediumItalic]
- \stoptypescript
-
- \starttypescript [calligraphy] [chorus,chancery] [name]
- \definefontsynonym [Calligraphy] [TeXGyreChorus-MediumItalic]
- \stoptypescript
-
- \starttypescript [sans] [heros,helvetica,adventor] [name]
- \definefontsynonym [Sans] [\typescriptprefix{n:\typescripttwo}-Regular]
- \definefontsynonym [SansItalic] [\typescriptprefix{n:\typescripttwo}-Italic]
- \definefontsynonym [SansBold] [\typescriptprefix{n:\typescripttwo}-Bold]
- \definefontsynonym [SansBoldItalic] [\typescriptprefix{n:\typescripttwo}-BoldItalic]
- \definefontsynonym [SansSlanted] [SansItalic]
- \definefontsynonym [SansBoldSlanted] [SansBoldItalic]
- \definefontsynonym [SansCaps] [\typescriptprefix{n:\typescripttwo}-Caps]
-
- \definefontvariant [Sans][osf][Caps]
- \definefontvariant [Sans][sc] [Caps]
-
- \definefontsynonym [SansRegular] [Sans]
- \definefontsynonym [SansRegularCaps] [SansCaps]
- \definefontsynonym [SansItalicCaps] [\typescriptprefix{n:\typescripttwo}-ItalicCaps]
- \definefontsynonym [SansBoldCaps] [\typescriptprefix{n:\typescripttwo}-BoldCaps]
- \definefontsynonym [SansBoldItalicCaps] [\typescriptprefix{n:\typescripttwo}-BoldItalicCaps]
- \definefontsynonym [SansSlantedCaps] [SansItalicCaps]
- \definefontsynonym [SansBoldSlantedCaps] [SansBoldItalicCaps]
- \definefontsynonym [SansCapsCaps] [SansCaps]
- \stoptypescript
-
- \starttypescript [mono] [cursor,courier] [name]
- \definefontsynonym [Mono] [\typescriptprefix{n:\typescripttwo}-Regular]
- \definefontsynonym [MonoItalic] [\typescriptprefix{n:\typescripttwo}-Italic]
- \definefontsynonym [MonoBold] [\typescriptprefix{n:\typescripttwo}-Bold]
- \definefontsynonym [MonoBoldItalic] [\typescriptprefix{n:\typescripttwo}-BoldItalic]
- \definefontsynonym [MonoSlanted] [MonoItalic]
- \definefontsynonym [MonoBoldSlanted] [MonoBoldItalic]
-
- \definefontvariant [Mono][osf][Caps]
- \definefontvariant [Mono][sc] [Caps]
-
- \definefontsynonym [MonoRegular] [Mono]
- \definefontsynonym [MonoRegularCaps] [MonoCaps]
- \definefontsynonym [MonoItalicCaps] [\typescriptprefix{n:\typescripttwo}-ItalicCaps]
- \definefontsynonym [MonoBoldCaps] [\typescriptprefix{n:\typescripttwo}-BoldCaps]
- \definefontsynonym [MonoBoldItalicCaps] [\typescriptprefix{n:\typescripttwo}-BoldItalicCaps]
- \definefontsynonym [MonoSlantedCaps] [MonoItalicCaps]
- \definefontsynonym [MonoBoldSlantedCaps] [MonoBoldItalicCaps]
- \definefontsynonym [MonoCapsCaps] [MonoCaps]
- \stoptypescript
-
- \starttypescript [times,termes]
- \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default] [features=default]
- \definetypeface [\typescriptone] [ss] [sans] [helvetica] [default] [features=default,rscale=0.9]
- \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [features=default,rscale=1.05]
- \definetypeface [\typescriptone] [mm] [math] [times] [default]
- \quittypescriptscanning
- \stoptypescript
-
- \starttypescript [palatino,pagella]
- \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default] [features=default]
- \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [features=default,rscale=1.075]
- \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [features=default,rscale=1.075]
- \definetypeface [\typescriptone] [mm] [math] [palatino] [default]
- \quittypescriptscanning
- \stoptypescript
-
- \starttypescript [schoolbook,schola]
- \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default] [features=default]
- \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [features=default,rscale=1.1]
- \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [features=default,rscale=1.1]
- \definetypeface [\typescriptone] [mm] [math] [modern] [default] [rscale=1.1]
- \quittypescriptscanning
- \stoptypescript
-
- \starttypescript [bookman,bonum]
- \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default] [features=default]
- \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [features=default,rscale=1.1]
- \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [features=default,rscale=1.1]
- \definetypeface [\typescriptone] [mm] [math] [modern] [default] [rscale=1.1]
- \quittypescriptscanning
- \stoptypescript
-
- \starttypescript [chancery,chorus]
- \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default] [features=default]
- \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [features=default]
- \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [features=default]
- \definetypeface [\typescriptone] [mm] [math] [modern] [default]
- \quittypescriptscanning
- \stoptypescript
-
- \starttypescript [helvetica,heros]
- \definetypeface [\typescriptone] [ss] [sans] [\typescriptone] [default] [features=default]
- \definetypeface [\typescriptone] [rm] [serif] [modern] [default] [features=default,rscale=1.15]
- \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [features=default,rscale=1.15]
- \definetypeface [\typescriptone] [mm] [math] [modern] [default] [rscale=1.15]
- \quittypescriptscanning
- \stoptypescript
-
- \starttypescript [avantgarde,adventor]
- \definetypeface [\typescriptone] [ss] [sans] [adventor] [default] [features=default]
- \definetypeface [\typescriptone] [rm] [serif] [modern] [default] [features=default,rscale=1.15]
- \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [features=default,rscale=1.15]
- \definetypeface [\typescriptone] [mm] [math] [modern] [default]
- \quittypescriptscanning
- \stoptypescript
-
- \starttypescript [courier,cursor]
- \definetypeface [\typescriptone] [tt] [mono] [\typescriptone] [default] [features=default]
- \definetypeface [\typescriptone] [rm] [serif] [modern] [default] [features=default]
- \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [features=default]
- \definetypeface [\typescriptone] [mm] [math] [modern] [default]
- \quittypescriptscanning
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[xmath]
-
- \starttypescript [math] [times] [all]
- \definefontsynonym [Times-Roman-Upright] [txr]
- \definefontsynonym [Times-Roman-Italic] [txi]
- \definefontsynonym [Times-Roman-Slanted] [txsl]
- \definefontsynonym [Times-Roman-Caps] [txsc]
- \definefontsynonym [Times-Companion-Upright] [tcxr]
- \definefontsynonym [Times-Companion-Italic] [tcxi]
- \definefontsynonym [Times-Companion-Slanted] [tcxsl]
- \definefontsynonym [Times-Math-Italic] [txmi]
- \definefontsynonym [Times-Math-Symbols] [txsy]
- \definefontsynonym [Times-Math-Extension] [txex]
- \definefontsynonym [Times-Math-SymbolsA] [txsya]
- \definefontsynonym [Times-Math-SymbolsB] [txsyb]
- \definefontsynonym [Times-Math-SymbolsC] [txsyc]
- \definefontsynonym [Times-Math-Italic-A] [txmia]
- \definefontsynonym [Times-Math-Extension-A] [txexa]
-
- \loadmapfile[original-youngryu-tx.map]
- \usemathcollection[default]
- \stoptypescript
-
- \starttypescript [math] [times] [name]
- \definefontsynonym [MathRoman] [Times-Roman-Upright]
- \definefontsynonym [MathExtension] [Times-Math-Extension]
- \definefontsynonym [MathItalic] [Times-Math-Italic]
- \definefontsynonym [MathSymbol] [Times-Math-Symbols]
- \definefontsynonym [MathAlpha] [Times-Math-SymbolsA]
- \definefontsynonym [MathBeta] [Times-Math-SymbolsB]
- \stoptypescript
-
- \starttypescript [math] [times] [name]
- \definefontsynonym [OldStyle] [MathItalic]
- \definefontsynonym [Fraktur] [eufm10]
- \definefontsynonym [Blackboard] [MathBeta]
- \definefontsynonym [Gothic] [eufm10]
- \definefontsynonym [Calligraphic] [eusm10]
- \stoptypescript
-
- \starttypescript [math] [palatino] [all]
- \definefontsynonym [Palatino-Roman-Upright] [pxr]
- \definefontsynonym [Palatino-Roman-Italic] [pxi]
- \definefontsynonym [Palatino-Roman-Slanted] [pxsl]
- \definefontsynonym [Palatino-Roman-Caps] [pxsc]
- \definefontsynonym [Palatino-Companion-Upright] [pcxr]
- \definefontsynonym [Palatino-Companion-Italic] [pcxi]
- \definefontsynonym [Palatino-Companion-Slanted] [pcxsl]
- \definefontsynonym [Palatino-Math-Italic] [pxmi]
- \definefontsynonym [Palatino-Math-Symbols] [pxsy]
- \definefontsynonym [Palatino-Math-Extension] [pxex]
- \definefontsynonym [Palatino-Math-SymbolsA] [pxsya]
- \definefontsynonym [Palatino-Math-SymbolsB] [pxsyb]
- \definefontsynonym [Palatino-Math-SymbolsC] [pxsyc]
- \definefontsynonym [Palatino-Math-Italic-A] [pxmia]
- \definefontsynonym [Palatino-Math-Extension-A] [pxexa]
-
- \loadmapfile[original-youngryu-px.map]
- \usemathcollection[default]
- \stoptypescript
-
- \starttypescript [math] [palatino] [name]
- \definefontsynonym [MathRoman] [Palatino-Roman-Upright]
- \definefontsynonym [MathExtension] [Palatino-Math-Extension]
- \definefontsynonym [MathItalic] [Palatino-Math-Italic]
- \definefontsynonym [MathSymbol] [Palatino-Math-Symbols]
- \definefontsynonym [MathAlpha] [Palatino-Math-SymbolsA]
- \definefontsynonym [MathBeta] [Palatino-Math-SymbolsB]
- \stoptypescript
-
- \starttypescript [math] [palatino] [name]
- \definefontsynonym [OldStyle] [MathItalic]
- \definefontsynonym [Fraktur] [eufm10]
- \definefontsynonym [Blackboard] [MathBeta]
- \definefontsynonym [Gothic] [eufm10]
- \definefontsynonym [Calligraphic] [eusm10]
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[antykwa]
-
- % Antykwa Torunska (GUST)
-
- \starttypescript [serif] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond]
- \definefontsynonym [AntykwaTorunska-Regular] [file:AntykwaTorunska-Regular] [features=default]
- \definefontsynonym [AntykwaTorunska-Italic] [file:AntykwaTorunska-Italic] [features=default]
- \definefontsynonym [AntykwaTorunska-Bold] [file:AntykwaTorunska-Bold] [features=default]
- \definefontsynonym [AntykwaTorunska-BoldItalic] [file:AntykwaTorunska-BoldItalic] [features=default]
- \definefontsynonym [AntykwaTorunska-Light] [file:AntykwaTorunskaLight-Regular] [features=default]
- \definefontsynonym [AntykwaTorunska-LightItalic] [file:AntykwaTorunskaLight-Italic] [features=default]
- \definefontsynonym [AntykwaTorunska-Medium] [file:AntykwaTorunskaMed-Regular] [features=default]
- \definefontsynonym [AntykwaTorunska-MedItalic] [file:AntykwaTorunskaMed-Italic] [features=default]
- \definefontsynonym [AntykwaTorunska-CondRegular] [file:AntykwaTorunskaCond-Regular] [features=default]
- \definefontsynonym [AntykwaTorunska-CondItalic] [file:AntykwaTorunskaCond-Italic] [features=default]
- \definefontsynonym [AntykwaTorunska-CondBold] [file:AntykwaTorunskaCond-Bold] [features=default]
- \definefontsynonym [AntykwaTorunska-CondBoldItalic] [file:AntykwaTorunskaCond-BoldItalic] [features=default]
- \definefontsynonym [AntykwaTorunska-CondLight] [file:AntykwaTorunskaCondLight-Regular] [features=default]
- \definefontsynonym [AntykwaTorunska-CondLightItalic] [file:AntykwaTorunskaCondLight-Italic] [features=default]
- \definefontsynonym [AntykwaTorunska-CondMedium] [file:AntykwaTorunskaCondMed-Regular] [features=default]
- \definefontsynonym [AntykwaTorunska-CondMedItalic] [file:AntykwaTorunskaCondMed-Italic] [features=default]
-
- \definefontsynonym [AntykwaTorunska-Cap] [file:AntykwaTorunska-Regular] [features=smallcaps]
- \definefontsynonym [AntykwaTorunska-ItalicCap] [file:AntykwaTorunska-Italic] [features=smallcaps]
- \definefontsynonym [AntykwaTorunska-BoldCap] [file:AntykwaTorunska-Bold] [features=smallcaps]
- \definefontsynonym [AntykwaTorunska-BoldItalicCap] [file:AntykwaTorunska-BoldItalic] [features=smallcaps]
- \definefontsynonym [AntykwaTorunska-LightCap] [file:AntykwaTorunskaLight-Regular] [features=smallcaps]
- \definefontsynonym [AntykwaTorunska-LightItalicCap] [file:AntykwaTorunskaLight-Italic] [features=smallcaps]
- \definefontsynonym [AntykwaTorunska-MediumCap] [file:AntykwaTorunskaMed-Regular] [features=smallcaps]
- \definefontsynonym [AntykwaTorunska-MedItalicCap] [file:AntykwaTorunskaMed-Italic] [features=smallcaps]
- \definefontsynonym [AntykwaTorunska-CondCap] [file:AntykwaTorunskaCond-Regular] [features=smallcaps]
- \definefontsynonym [AntykwaTorunska-CondItalicCap] [file:AntykwaTorunskaCond-Italic] [features=smallcaps]
- \definefontsynonym [AntykwaTorunska-CondBoldCap] [file:AntykwaTorunskaCond-Bold] [features=smallcaps]
- \definefontsynonym [AntykwaTorunska-CondBoldItalicCap] [file:AntykwaTorunskaCond-BoldItalic] [features=smallcaps]
- \definefontsynonym [AntykwaTorunska-CondLightCap] [file:AntykwaTorunskaCondLight-Regular] [features=smallcaps]
- \definefontsynonym [AntykwaTorunska-CondLightItalicCap][file:AntykwaTorunskaCondLight-Italic] [features=smallcaps]
- \definefontsynonym [AntykwaTorunska-CondMediumCap] [file:AntykwaTorunskaCondMed-Regular] [features=smallcaps]
- \definefontsynonym [AntykwaTorunska-CondMedItalicCap] [file:AntykwaTorunskaCondMed-Italic] [features=smallcaps]
- \stoptypescript
-
- \starttypescript [math] [antykwa-torunska] [default]
- \definefontsynonym [AntykwaTorunska-Math-Letters-Regular] [rm-anttr]
- \definefontsynonym [AntykwaTorunska-Math-Letters-Italic] [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-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-CondItalic] [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-anttcli]
- \definefontsynonym [AntykwaTorunska-Math-Symbols-CondLight] [sy-anttclz]
- \definefontsynonym [AntykwaTorunska-Math-Extension-CondLight] [ex-anttcl]
- \stoptypescript
-
- \starttypescript [math] [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond]
- \usemathcollection[default]
- \loadmapfile[antt-rm.map]
- \loadmapfile[antt-mi.map]
- \loadmapfile[antt-sy.map]
- \loadmapfile[antt-ex.map]
- \stoptypescript
-
- \starttypescript [antykwa-torunska,antykwa-torunska-light,antykwa-torunska-cond,antykwa-torunska-lightcond]
- \definetypeface[antykwa][rm][serif][\typescriptone] [default] [features=default]
- \definetypeface[antykwa][ss][sans] [modern] [default] [features=default,rscale=1.05]
- \definetypeface[antykwa][tt][mono] [modern] [default] [features=default,rscale=1.05]
- \definetypeface[antykwa][mm][math] [\typescriptone] [default]
- \quittypescriptscanning
- \stoptypescript
-
- \starttypescript [serif] [antykwa-torunska] [name]
- \definefontsynonym [Serif] [AntykwaTorunska-Regular]
- \definefontsynonym [SerifBold] [AntykwaTorunska-Bold]
- \definefontsynonym [SerifItalic] [AntykwaTorunska-Italic]
- \definefontsynonym [SerifSlanted] [AntykwaTorunska-Italic]
- \definefontsynonym [SerifBoldItalic] [AntykwaTorunska-BoldItalic]
- \definefontsynonym [SerifBoldSlanted] [AntykwaTorunska-BoldItalic]
- \definefontsynonym [SerifCaps] [AntykwaTorunska-Cap]
- \stoptypescript
-
- \starttypescript [serif] [antykwa-torunska-light] [name]
- \definefontsynonym [Serif] [AntykwaTorunska-Light]
- \definefontsynonym [SerifBold] [AntykwaTorunska-Medium]
- \definefontsynonym [SerifItalic] [AntykwaTorunska-LightItalic]
- \definefontsynonym [SerifSlanted] [AntykwaTorunska-LightItalic]
- \definefontsynonym [SerifBoldItalic] [AntykwaTorunska-MedItalic]
- \definefontsynonym [SerifBoldSlanted] [AntykwaTorunska-MedItalic]
- \definefontsynonym [SerifCaps] [AntykwaTorunska-LightCap]
- \stoptypescript
-
- \starttypescript [serif] [antykwa-torunska-cond] [name]
- \definefontsynonym [Serif] [AntykwaTorunska-CondRegular]
- \definefontsynonym [SerifBold] [AntykwaTorunska-CondBold]
- \definefontsynonym [SerifItalic] [AntykwaTorunska-CondItalic]
- \definefontsynonym [SerifSlanted] [AntykwaTorunska-CondItalic]
- \definefontsynonym [SerifBoldItalic] [AntykwaTorunska-CondBoldItalic]
- \definefontsynonym [SerifBoldSlanted] [AntykwaTorunska-CondBoldItalic]
- \definefontsynonym [SerifCaps] [AntykwaTorunska-CondCap]
- \stoptypescript
-
- \starttypescript [serif] [antykwa-torunska-lightcond] [name]
- \definefontsynonym [Serif] [AntykwaTorunska-CondLight]
- \definefontsynonym [SerifBold] [AntykwaTorunska-CondMedium]
- \definefontsynonym [SerifItalic] [AntykwaTorunska-CondLightItalic]
- \definefontsynonym [SerifSlanted] [AntykwaTorunska-CondLightItalic]
- \definefontsynonym [SerifBoldItalic] [AntykwaTorunska-CondMedItalic]
- \definefontsynonym [SerifBoldSlanted] [AntykwaTorunska-CondMedItalic]
- \definefontsynonym [SerifCaps] [AntykwaTorunska-CondLightCap]
- \stoptypescript
-
- \starttypescript [serif] [antykwa-torunska] [name]
- \definefontsynonym [SerifRegular] [Serif]
- \definefontsynonym [SerifRegularCaps] [AntykwaTorunska-Cap]
- \definefontsynonym [SerifBoldCaps] [AntykwaTorunska-BoldCap]
- \definefontsynonym [SerifItalicCaps] [AntykwaTorunska-ItalicCap]
- \definefontsynonym [SerifSlantedCaps] [AntykwaTorunska-ItalicCap]
- \definefontsynonym [SerifBoldItalicCaps] [AntykwaTorunska-BoldItalicCap]
- \definefontsynonym [SerifBoldSlantedCaps] [AntykwaTorunska-BoldItalicCap]
- \definefontsynonym [SerifCapsCaps] [AntykwaTorunska-Cap]
-
- \definefontvariant [Serif][osf][Caps]
- \definefontvariant [Serif][sc] [Caps]
-
- \definefontsynonym [SerifRegularLight] [AntykwaTorunska-Light]
- \definefontsynonym [SerifBoldLight] [AntykwaTorunska-Medium]
- \definefontsynonym [SerifItalicLight] [AntykwaTorunska-LightItalic]
- \definefontsynonym [SerifSlantedLight] [AntykwaTorunska-LightItalic]
- \definefontsynonym [SerifBoldItalicLight] [AntykwaTorunska-MedItalic]
- \definefontsynonym [SerifBoldSlantedLight] [AntykwaTorunska-MedItalic]
- \definefontsynonym [SerifCapsLight] [AntykwaTorunska-LightCap]
-
- \definefontvariant [Serif][lt][Light]
-
- \definefontsynonym [SerifRegularCond] [AntykwaTorunska-CondRegular]
- \definefontsynonym [SerifBoldCond] [AntykwaTorunska-CondBold]
- \definefontsynonym [SerifItalicCond] [AntykwaTorunska-CondItalic]
- \definefontsynonym [SerifSlantedCond] [AntykwaTorunska-CondItalic]
- \definefontsynonym [SerifBoldItalicCond] [AntykwaTorunska-CondBoldItalic]
- \definefontsynonym [SerifBoldSlantedCond] [AntykwaTorunska-CondBoldItalic]
- \definefontsynonym [SerifCapsCond] [AntykwaTorunska-CondCap]
-
- \definefontvariant [Serif][cond][Cond]
-
- \stoptypescript
-
- \starttypescript [serif] [antykwa-torunska-light] [name]
- \definefontsynonym [SerifRegular] [Serif]
- \definefontsynonym [SerifRegularCaps] [AntykwaTorunska-LightCap]
- \definefontsynonym [SerifBoldCaps] [AntykwaTorunska-MediumCap]
- \definefontsynonym [SerifItalicCaps] [AntykwaTorunska-LightItalicCap]
- \definefontsynonym [SerifSlantedCaps] [AntykwaTorunska-LightItalicCap]
- \definefontsynonym [SerifBoldItalicCaps] [AntykwaTorunska-MedItalicCap]
- \definefontsynonym [SerifBoldSlantedCaps] [AntykwaTorunska-MedItalicCap]
- \definefontsynonym [SerifCapsCaps] [AntykwaTorunska-LightCap]
-
- \definefontvariant [Serif][osf][Caps]
- \definefontvariant [Serif][sc] [Caps]
-
- \definefontsynonym [SerifRegularDark] [AntykwaTorunska-Regular]
- \definefontsynonym [SerifBoldDark] [AntykwaTorunska-Bold]
- \definefontsynonym [SerifItalicDark] [AntykwaTorunska-Italic]
- \definefontsynonym [SerifSlantedDark] [AntykwaTorunska-Italic]
- \definefontsynonym [SerifBoldItalicDark] [AntykwaTorunska-BoldItalic]
- \definefontsynonym [SerifBoldSlantedDark] [AntykwaTorunska-BoldItalic]
- \definefontsynonym [SerifCapsDark] [AntykwaTorunska-Cap]
-
- \definefontvariant [Serif][dk][Dark]
-
- \definefontsynonym [SerifRegularCond] [AntykwaTorunska-CondLight]
- \definefontsynonym [SerifBoldCond] [AntykwaTorunska-CondMedium]
- \definefontsynonym [SerifItalicCond] [AntykwaTorunska-CondLightItalic]
- \definefontsynonym [SerifSlantedCond] [AntykwaTorunska-CondLightItalic]
- \definefontsynonym [SerifBoldItalicCond] [AntykwaTorunska-CondMedItalic]
- \definefontsynonym [SerifBoldSlantedCond] [AntykwaTorunska-CondMedItalic]
- \definefontsynonym [SerifCapsCond] [AntykwaTorunska-CondLightCap]
-
- \definefontvariant [Serif][cond][Cond]
-
- \stoptypescript
-
- \starttypescript [serif] [antykwa-torunska-cond] [name]
- \definefontsynonym [SerifRegular] [Serif]
- \definefontsynonym [SerifRegularCaps] [AntykwaTorunska-CondCap]
- \definefontsynonym [SerifBoldCaps] [AntykwaTorunska-CondBoldCap]
- \definefontsynonym [SerifItalicCaps] [AntykwaTorunska-CondItalicCap]
- \definefontsynonym [SerifSlantedCaps] [AntykwaTorunska-CondItalicCap]
- \definefontsynonym [SerifBoldItalicCaps] [AntykwaTorunska-CondBoldItalicCap]
- \definefontsynonym [SerifBoldSlantedCaps] [AntykwaTorunska-CondBoldItalicCap]
- \definefontsynonym [SerifCapsCaps] [AntykwaTorunska-CondCap]
-
- \definefontvariant [Serif][osf][Caps]
- \definefontvariant [Serif][sc] [Caps]
-
- \definefontsynonym [SerifRegularLight] [AntykwaTorunska-CondLight]
- \definefontsynonym [SerifBoldLight] [AntykwaTorunska-CondMedium]
- \definefontsynonym [SerifItalicLight] [AntykwaTorunska-CondLightItalic]
- \definefontsynonym [SerifSlantedLight] [AntykwaTorunska-CondLightItalic]
- \definefontsynonym [SerifBoldItalicLight] [AntykwaTorunska-CondMedItalic]
- \definefontsynonym [SerifBoldSlantedLight] [AntykwaTorunska-CondMedItalic]
- \definefontsynonym [SerifCapsLight] [AntykwaTorunska-CondLightCap]
-
- \definefontvariant [Serif][lt][Light]
-
- \definefontsynonym [SerifRegularExp] [AntykwaTorunska-Regular]
- \definefontsynonym [SerifBoldExp] [AntykwaTorunska-Bold]
- \definefontsynonym [SerifItalicExp] [AntykwaTorunska-Italic]
- \definefontsynonym [SerifSlantedExp] [AntykwaTorunska-Italic]
- \definefontsynonym [SerifBoldItalicExp] [AntykwaTorunska-BoldItalic]
- \definefontsynonym [SerifBoldSlantedExp] [AntykwaTorunska-BoldItalic]
- \definefontsynonym [SerifCapsExp] [AntykwaTorunska-Cap]
-
- \definefontvariant [Serif][exp][Exp]
-
- \stoptypescript
-
- \starttypescript [serif] [antykwa-torunska-lightcond] [name]
- \definefontsynonym [SerifRegular] [Serif]
- \definefontsynonym [SerifRegularCaps] [AntykwaTorunska-CondLightCap]
- \definefontsynonym [SerifBoldCaps] [AntykwaTorunska-CondMediumCap]
- \definefontsynonym [SerifItalicCaps] [AntykwaTorunska-CondLightItalicCap]
- \definefontsynonym [SerifSlantedCaps] [AntykwaTorunska-CondLightItalicCap]
- \definefontsynonym [SerifBoldItalicCaps] [AntykwaTorunska-CondMedItalicCap]
- \definefontsynonym [SerifBoldSlantedCaps] [AntykwaTorunska-CondMedItalicCap]
- \definefontsynonym [SerifCapsCaps] [AntykwaTorunska-CondLightCap]
-
- \definefontvariant [Serif][osf][Caps]
- \definefontvariant [Serif][sc] [Caps]
-
- \definefontsynonym [SerifRegularDark] [AntykwaTorunska-CondRegular]
- \definefontsynonym [SerifBoldDark] [AntykwaTorunska-CondBold]
- \definefontsynonym [SerifItalicDark] [AntykwaTorunska-CondItalic]
- \definefontsynonym [SerifSlantedDark] [AntykwaTorunska-CondItalic]
- \definefontsynonym [SerifBoldItalicDark] [AntykwaTorunska-CondBoldItalic]
- \definefontsynonym [SerifBoldSlantedDark] [AntykwaTorunska-CondBoldItalic]
- \definefontsynonym [SerifCapsDark] [AntykwaTorunska-CondCap]
-
- \definefontvariant [Serif][dk][Dark]
-
- \definefontsynonym [SerifRegularExp] [AntykwaTorunska-Light]
- \definefontsynonym [SerifBoldExp] [AntykwaTorunska-Medium]
- \definefontsynonym [SerifItalicExp] [AntykwaTorunska-LightItalic]
- \definefontsynonym [SerifSlantedExp] [AntykwaTorunska-LightItalic]
- \definefontsynonym [SerifBoldItalicExp] [AntykwaTorunska-MedItalic]
- \definefontsynonym [SerifBoldSlantedExp] [AntykwaTorunska-MedItalic]
- \definefontsynonym [SerifCapsExp] [AntykwaTorunska-LightCap]
-
- \definefontvariant [Serif][exp][Exp]
-
- \stoptypescript
-
- % maybe no -Regular etc
-
- \starttypescript [math] [antykwa-torunska-light] [name]
- \definefontsynonym [MathRoman] [AntykwaTorunska-Math-Letters-Light]
- \definefontsynonym [MathItalic] [AntykwaTorunska-Math-Letters-LightItalic]
- \definefontsynonym [MathSymbol] [AntykwaTorunska-Math-Symbols-Light]
- \definefontsynonym [MathExtension] [AntykwaTorunska-Math-Extension-Light]
- \stoptypescript
-
- \starttypescript [math] [antykwa-torunska] [name]
- \definefontsynonym [MathRoman] [AntykwaTorunska-Math-Letters-Regular]
- \definefontsynonym [MathItalic] [AntykwaTorunska-Math-Letters-Italic]
- \definefontsynonym [MathSymbol] [AntykwaTorunska-Math-Symbols-Regular]
- \definefontsynonym [MathExtension] [AntykwaTorunska-Math-Extension-Regular]
- \stoptypescript
-
- \starttypescript [math] [antykwa-torunska-cond] [name]
- \definefontsynonym [MathRoman] [AntykwaTorunska-Math-Letters-CondRegular]
- \definefontsynonym [MathItalic] [AntykwaTorunska-Math-Letters-CondItalic]
- \definefontsynonym [MathSymbol] [AntykwaTorunska-Math-Symbols-CondRegular]
- \definefontsynonym [MathExtension] [AntykwaTorunska-Math-Extension-CondRegular]
- \stoptypescript
-
- \starttypescript [math] [antykwa-torunska-lightcond] [name]
- \definefontsynonym [MathRoman] [AntykwaTorunska-Math-Letters-CondLight]
- \definefontsynonym [MathItalic] [AntykwaTorunska-Math-Letters-CondLightItalic]
- \definefontsynonym [MathSymbol] [AntykwaTorunska-Math-Symbols-CondLight]
- \definefontsynonym [MathExtension] [AntykwaTorunska-Math-Extension-CondLight]
- \stoptypescript
-
- % Antykwa Poltawskiego (GUST)
-
- % \starttypescript [serif] [antykwa-poltawskiego]
- % \definefontsynonym [AntykwaPoltawskiego-Regular] [antpr]
- % \definefontsynonym [AntykwaPoltawskiego-Bold] [antpb]
- % \definefontsynonym [AntykwaPoltawskiego-Italic] [antpri]
- % \definefontsynonym [AntykwaPoltawskiego-BoldItalic] [antpbi]
- % \stoptypescript
-
- % \starttypescript [serif] [antykwa-poltawskiego] [name]
- % \definefontsynonym [Serif] [AntykwaPoltawskiego-Regular]
- % \definefontsynonym [SerifBold] [AntykwaPoltawskiego-Bold]
- % \definefontsynonym [SerifItalic] [AntykwaPoltawskiego-Italic]
- % \definefontsynonym [SerifSlanted] [AntykwaPoltawskiego-Italic]
- % \definefontsynonym [SerifBoldItalic] [AntykwaPoltawskiego-Bold]
- % \definefontsynonym [SerifBoldSlanted] [AntykwaPoltawskiego-Bold]
- % \definefontsynonym [SerifCaps] [AntykwaPoltawskiego-Regular]
- % \stoptypescript
-
- % names of "Caps" may still change
- \starttypescript [serif] [antykwa-poltawskiego,antykwa-poltawskiego-light]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-Light] [\s!file:antpoltltcond-regular] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-LightItalic] [\s!file:antpoltltcond-italic] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-Regular] [\s!file:antpoltcond-regular] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-Italic] [\s!file:antpoltcond-italic] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-Medium] [\s!file:antpoltltcond-bold] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-MediumItalic] [\s!file:antpoltltcond-bolditalic] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-Bold] [\s!file:antpoltcond-bold] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-BoldItalic] [\s!file:antpoltcond-bolditalic] [\s!features=\s!default]
-
- \definefontsynonym [AntykwaPoltawskiego-Condensed-CapsLight] [\s!file:antpoltltcond-regular] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-CapsLightItalic] [\s!file:antpoltltcond-italic] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-CapsRegular] [\s!file:antpoltcond-regular] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-CapsItalic] [\s!file:antpoltcond-italic] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-CapsMedium] [\s!file:antpoltltcond-bold] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-CapsMediumItalic] [\s!file:antpoltltcond-bolditalic] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-CapsBold] [\s!file:antpoltcond-bold] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-Condensed-CapsBoldItalic] [\s!file:antpoltcond-bolditalic] [\s!features=\s!smallcaps]
-
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-Light] [\s!file:antpoltltsemicond-regular] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-LightItalic] [\s!file:antpoltltsemicond-italic] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-Regular] [\s!file:antpoltsemicond-regular] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-Italic] [\s!file:antpoltsemicond-italic] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-Medium] [\s!file:antpoltltsemicond-bold] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-MediumItalic] [\s!file:antpoltltsemicond-bolditalic] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-Bold] [\s!file:antpoltsemicond-bold] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-BoldItalic] [\s!file:antpoltsemicond-bolditalic] [\s!features=\s!default]
-
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-CapsLight] [\s!file:antpoltltsemicond-regular] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-CapsLightItalic] [\s!file:antpoltltsemicond-italic] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-CapsRegular] [\s!file:antpoltsemicond-regular] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-CapsItalic] [\s!file:antpoltsemicond-italic] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-CapsMedium] [\s!file:antpoltltsemicond-bold] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-CapsMediumItalic] [\s!file:antpoltltsemicond-bolditalic] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-CapsBold] [\s!file:antpoltsemicond-bold] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-SemiCondensed-CapsBoldItalic] [\s!file:antpoltsemicond-bolditalic] [\s!features=\s!smallcaps]
-
- \definefontsynonym [AntykwaPoltawskiego-Light] [\s!file:antpoltlt-regular] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-LightItalic] [\s!file:antpoltlt-italic] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-Regular] [\s!file:antpolt-regular] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-Italic] [\s!file:antpolt-italic] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-Medium] [\s!file:antpoltlt-bold] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-MediumItalic] [\s!file:antpoltlt-bolditalic] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-Bold] [\s!file:antpolt-bold] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-BoldItalic] [\s!file:antpolt-bolditalic] [\s!features=\s!default]
-
- \definefontsynonym [AntykwaPoltawskiego-CapsLight] [\s!file:antpoltcond-regular] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-CapsLightItalic] [\s!file:antpoltcond-italic] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-CapsRegular] [\s!file:antpolt-regular] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-CapsItalic] [\s!file:antpolt-italic] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-CapsMedium] [\s!file:antpoltcond-bold] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-CapsMediumItalic] [\s!file:antpoltcond-bolditalic] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-CapsBold] [\s!file:antpolt-bold] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-CapsBoldItalic] [\s!file:antpolt-bolditalic] [\s!features=\s!smallcaps]
-
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-Light] [\s!file:antpoltltsemiexpd-regular] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-LightItalic] [\s!file:antpoltltsemiexpd-italic] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-Regular] [\s!file:antpoltsemiexpd-regular] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-Italic] [\s!file:antpoltsemiexpd-italic] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-Medium] [\s!file:antpoltltsemiexpd-bold] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-MediumItalic] [\s!file:antpoltltsemiexpd-bolditalic] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-Bold] [\s!file:antpoltsemiexpd-bold] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-BoldItalic] [\s!file:antpoltsemiexpd-bolditalic] [\s!features=\s!default]
-
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-CapsLight] [\s!file:antpoltltsemiexpd-regular] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-CapsLightItalic] [\s!file:antpoltltsemiexpd-italic] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-CapsRegular] [\s!file:antpoltsemiexpd-regular] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-CapsItalic] [\s!file:antpoltsemiexpd-italic] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-CapsMedium] [\s!file:antpoltltsemiexpd-bold] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-CapsMediumItalic] [\s!file:antpoltltsemiexpd-bolditalic] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-CapsBold] [\s!file:antpoltsemiexpd-bold] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-SemiExpanded-CapsBoldItalic] [\s!file:antpoltsemiexpd-bolditalic] [\s!features=\s!smallcaps]
-
- \definefontsynonym [AntykwaPoltawskiego-Expanded-Light] [\s!file:antpoltltexpd-regular] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-LightItalic] [\s!file:antpoltltexpd-italic] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-Regular] [\s!file:antpoltexpd-regular] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-Italic] [\s!file:antpoltexpd-italic] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-Medium] [\s!file:antpoltltexpd-bold] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-MediumItalic] [\s!file:antpoltltexpd-bolditalic] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-Bold] [\s!file:antpoltexpd-bold] [\s!features=\s!default]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-BoldItalic] [\s!file:antpoltexpd-bolditalic] [\s!features=\s!default]
-
- \definefontsynonym [AntykwaPoltawskiego-Expanded-CapsLight] [\s!file:antpoltltexpd-regular] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-CapsLightItalic] [\s!file:antpoltltexpd-italic] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-CapsRegular] [\s!file:antpoltexpd-regular] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-CapsItalic] [\s!file:antpoltexpd-italic] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-CapsMedium] [\s!file:antpoltltexpd-bold] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-CapsMediumItalic] [\s!file:antpoltltexpd-bolditalic] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-CapsBold] [\s!file:antpoltexpd-bold] [\s!features=\s!smallcaps]
- \definefontsynonym [AntykwaPoltawskiego-Expanded-CapsBoldItalic] [\s!file:antpoltexpd-bolditalic] [\s!features=\s!smallcaps]
- \stoptypescript
-
- \starttypescript [serif] [antykwa-poltawskiego] [name]
- \definefontsynonym [Serif] [AntykwaPoltawskiego-Regular]
- \definefontsynonym [SerifBold] [AntykwaPoltawskiego-Bold]
- \definefontsynonym [SerifItalic] [AntykwaPoltawskiego-Italic]
- \definefontsynonym [SerifSlanted] [AntykwaPoltawskiego-Italic]
- \definefontsynonym [SerifBoldItalic] [AntykwaPoltawskiego-BoldItalic]
- \definefontsynonym [SerifBoldSlanted] [AntykwaPoltawskiego-BoldItalic]
- \definefontsynonym [SerifCaps] [AntykwaPoltawskiego-CapsRegular]
- \stoptypescript
-
- \starttypescript [serif] [antykwa-poltawskiego-light] [name]
- \definefontsynonym [Serif] [AntykwaPoltawskiego-Light]
- \definefontsynonym [SerifBold] [AntykwaPoltawskiego-Medium]
- \definefontsynonym [SerifItalic] [AntykwaPoltawskiego-LightItalic]
- \definefontsynonym [SerifSlanted] [AntykwaPoltawskiego-LightItalic]
- \definefontsynonym [SerifBoldItalic] [AntykwaPoltawskiego-MediumItalic]
- \definefontsynonym [SerifBoldSlanted] [AntykwaPoltawskiego-MediumItalic]
- \definefontsynonym [SerifCaps] [AntykwaPoltawskiego-CapsLight]
- \stoptypescript
-
- % condensed and extended variants are still missing
-
- \starttypescript [antykwa-poltawskiego,antykwa-poltawskiego-light]
- \definetypeface [\typescriptone] [rm] [serif] [\typescriptone] [default] [features=default]
- \definetypeface [\typescriptone] [ss] [sans] [modern] [default] [features=default,rscale=1.05]
- \definetypeface [\typescriptone] [tt] [mono] [modern] [default] [features=default,rscale=1.05]
- \definetypeface [\typescriptone] [mm] [math] [modern] [default] [rscale=1.05]
- \quittypescriptscanning
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[iwona]
-
- % maybe this will change in Iwona-Math-Letters and Iwona-Math-Letters-Italic
-
- % These names are a depressing mess. They have changed over time and are
- % still not consistent. I'd expect Bold-Regular and Bold-Italic.
-
- \starttypescript [sans] [iwona-light,iwona,iwona-medium,iwona-heavy,iwona-light-cond,iwona-cond,iwona-medium-cond,iwona-heavy-cond]
-
- \definefontsynonym [Iwona-Regular] [file:Iwona-Regular] [features=default]
- \definefontsynonym [Iwona-Italic] [file:Iwona-Italic] [features=default]
- \definefontsynonym [Iwona-Bold] [file:Iwona-Bold] [features=default]
- \definefontsynonym [Iwona-BoldItalic] [file:Iwona-BoldItalic] [features=default]
- \definefontsynonym [Iwona-Light-Regular] [file:IwonaLight-Regular] [features=default]
- \definefontsynonym [Iwona-Light-Italic] [file:IwonaLight-Italic] [features=default]
- \definefontsynonym [Iwona-Medium-Regular] [file:IwonaMedium-Regular] [features=default]
- \definefontsynonym [Iwona-Medium-Italic] [file:IwonaMedium-Italic] [features=default]
- \definefontsynonym [Iwona-Heavy-Regular] [file:IwonaHeavy-Regular] [features=default]
- \definefontsynonym [Iwona-Heavy-Italic] [file:IwonaHeavy-Italic] [features=default]
-
- \definefontsynonym [Iwona-CapsRegular] [file:Iwona-Regular] [features=smallcaps]
- \definefontsynonym [Iwona-CapsItalic] [file:Iwona-Italic] [features=smallcaps]
- \definefontsynonym [Iwona-CapsBold] [file:Iwona-Bold] [features=smallcaps]
- \definefontsynonym [Iwona-CapsBoldItalic] [file:Iwona-BoldItalic] [features=smallcaps]
- \definefontsynonym [Iwona-CapsLight] [file:IwonaLight-Regular] [features=smallcaps]
- \definefontsynonym [Iwona-CapsLight-Italic] [file:IwonaLight-Italic] [features=smallcaps]
- \definefontsynonym [Iwona-CapsMedium] [file:IwonaMedium-Regular] [features=smallcaps]
- \definefontsynonym [Iwona-CapsMedium-Italic] [file:IwonaMedium-Italic] [features=smallcaps]
- \definefontsynonym [Iwona-CapsHeavy] [file:IwonaHeavy-Regular] [features=smallcaps]
- \definefontsynonym [Iwona-CapsHeavy-Italic] [file:IwonaHeavy-Italic] [features=smallcaps]
-
- \definefontsynonym [Iwona-CondRegular] [file:IwonaCond-Regular] [features=default]
- \definefontsynonym [Iwona-CondItalic] [file:IwonaCond-Italic] [features=default]
- \definefontsynonym [Iwona-CondBold] [file:IwonaCond-Bold] [features=default]
- \definefontsynonym [Iwona-CondBoldItalic] [file:IwonaCond-BoldItalic] [features=default]
- \definefontsynonym [Iwona-CondLight-Regular] [file:IwonaCondLight-Regular] [features=default]
- \definefontsynonym [Iwona-CondLight-Italic] [file:IwonaCondLight-Italic] [features=default]
- \definefontsynonym [Iwona-CondMedium-Regular] [file:IwonaCondMedium-Regular] [features=default]
- \definefontsynonym [Iwona-CondMedium-Italic] [file:IwonaCondMedium-Italic] [features=default]
- \definefontsynonym [Iwona-CondHeavy-Regular] [file:IwonaCondHeavy-Regular] [features=default]
- \definefontsynonym [Iwona-CondHeavy-Italic] [file:IwonaCondHeavy-Italic] [features=default]
-
- \definefontsynonym [Iwona-CapsCondRegular] [file:IwonaCond-Regular] [features=smallcaps]
- \definefontsynonym [Iwona-CapsCondItalic] [file:IwonaCond-Italic] [features=smallcaps]
- \definefontsynonym [Iwona-CapsCondBold] [file:IwonaCond-Bold] [features=smallcaps]
- \definefontsynonym [Iwona-CapsCondBoldItalic] [file:IwonaCond-BoldItalic] [features=smallcaps]
- \definefontsynonym [Iwona-CapsCondLight-Regular] [file:IwonaCondLight-Regular] [features=smallcaps]
- \definefontsynonym [Iwona-CapsCondLight-Italic] [file:IwonaCondLight-Italic] [features=smallcaps]
- \definefontsynonym [Iwona-CapsCondMedium-Regular][file:IwonaCondMedium-Regular] [features=smallcaps]
- \definefontsynonym [Iwona-CapsCondMedium-Italic] [file:IwonaCondMedium-Italic] [features=smallcaps]
- \definefontsynonym [Iwona-CapsCondHeavy-Regular] [file:IwonaCondHeavy-Regular] [features=smallcaps]
- \definefontsynonym [Iwona-CapsCondHeavy-Italic] [file:IwonaCondHeavy-Italic] [features=smallcaps]
-
- \stoptypescript
-
- \starttypescript [math] [iwona] [default]
- \definefontsynonym [Iwona-Math-Letters-Regular] [rm-iwonar]
- \definefontsynonym [Iwona-Math-Letters-Italic] [mi-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-Regular] [rm-iwonal]
- \definefontsynonym [Iwona-Math-Letters-Light-Italic] [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-Regular][rm-iwonam]
- \definefontsynonym [Iwona-Math-Letters-Medium-Italic] [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-Regular] [rm-iwonah]
- \definefontsynonym [Iwona-Math-Letters-Heavy-Italic] [mi-iwonahi]
- \definefontsynonym [Iwona-Math-Symbols-Heavy] [sy-iwonahz]
- \definefontsynonym [Iwona-Math-Extension-Heavy] [ex-iwonah]
- \stoptypescript
-
- \starttypescript [math] [iwona,iwona-light,iwona-medium,iwona-heavy] [default]
- \usemathcollection[default]
- \loadmapfile[iwona-rm.map]
- \loadmapfile[iwona-mi.map]
- \loadmapfile[iwona-sy.map]
- \loadmapfile[iwona-ex.map]
- \stoptypescript
-
- \starttypescript [sans] [iwona-light] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-Light-Regular]
- \definefontsynonym [SansItalic] [Iwona-Light-Italic]
- \definefontsynonym [SansBold] [Iwona-Medium-Regular]
- \definefontsynonym [SansBoldItalic] [Iwona-Medium-Italic]
- \definefontsynonym [SansCaps] [Iwona-CapsLight-Regular]
- \definefontsynonym [SansItalicCaps] [Iwona-CapsLight-Italic]
- \definefontsynonym [SansBoldCaps] [Iwona-CapsMedium]
- \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsMediumItalic]
- \stoptypescript
-
- \starttypescript [sans] [iwona-light-caps] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-CapsLight-Regular]
- \definefontsynonym [SansItalic] [Iwona-CapsLight-Italic]
- \definefontsynonym [SansBold] [Iwona-CapsMedium-Regular]
- \definefontsynonym [SansBoldItalic] [Iwona-CapsMedium-Italic]
- \stoptypescript
-
- \starttypescript [sans] [iwona] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-Regular]
- \definefontsynonym [SansItalic] [Iwona-Italic]
- \definefontsynonym [SansBold] [Iwona-Bold]
- \definefontsynonym [SansBoldItalic] [Iwona-BoldItalic]
- \definefontsynonym [SansCaps] [Iwona-CapsRegular]
- \definefontsynonym [SansItalicCaps] [Iwona-CapsItalic]
- \definefontsynonym [SansBoldCaps] [Iwona-CapsBold]
- \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsBoldItalic]
- \stoptypescript
-
- \starttypescript [sans] [iwona-caps] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-CapsRegular]
- \definefontsynonym [SansItalic] [Iwona-CapsItalic]
- \definefontsynonym [SansBold] [Iwona-CapsBold]
- \definefontsynonym [SansBoldItalic] [Iwona-CapsBoldItalic]
- \stoptypescript
-
- \starttypescript [sans] [iwona-medium] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-Medium-Regular]
- \definefontsynonym [SansItalic] [Iwona-Medium-Italic]
- \definefontsynonym [SansBold] [Iwona-Heavy-Regular]
- \definefontsynonym [SansBoldItalic] [Iwona-Heavy-Italic]
- \definefontsynonym [SansCaps] [Iwona-CapsHeavy-Regular]
- \definefontsynonym [SansItalicCaps] [Iwona-CapsMedium-Italic]
- \definefontsynonym [SansBoldCaps] [Iwona-CapsHeavy-Regular]
- \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsHeavy-Italic]
- \stoptypescript
-
- \starttypescript [sans] [iwona-medium-caps] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-CapsHeavy-Regular]
- \definefontsynonym [SansItalic] [Iwona-CapsMedium-Italic]
- \definefontsynonym [SansBold] [Iwona-CapsHeavy-Regular]
- \definefontsynonym [SansBoldItalic] [Iwona-CapsHeavy-Italic]
- \stoptypescript
-
- \starttypescript [sans] [iwona-heavy] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-Heavy-Regular]
- \definefontsynonym [SansItalic] [Iwona-Heavy-Italic]
- \definefontsynonym [SansBold] [Iwona-Heavy-Regular]
- \definefontsynonym [SansBoldItalic] [Iwona-Heavy-Italic]
- \definefontsynonym [SansCaps] [Iwona-CapsHeavy-Regular]
- \definefontsynonym [SansItalicCaps] [Iwona-CapsHeavy-Italic]
- \definefontsynonym [SansBoldCaps] [Iwona-CapsHeavy-Regular]
- \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsHeavy-Italic]
- \stoptypescript
-
- \starttypescript [sans] [iwona-heavy-caps] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [SansCaps] [Iwona-CapsHeavy-Regular]
- \definefontsynonym [SansItalicCaps] [Iwona-CapsHeavy-Italic]
- \definefontsynonym [SansBoldCaps] [Iwona-CapsHeavy-Regular]
- \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsHeavy-Italic]
- \stoptypescript
-
- \starttypescript [sans] [iwona-light-cond] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-CondLight-Regular]
- \definefontsynonym [SansItalic] [Iwona-CondLight-Italic]
- \definefontsynonym [SansBold] [Iwona-CondMedium-Regular]
- \definefontsynonym [SansBoldItalic] [Iwona-CondMedium-Italic]
- \definefontsynonym [SansCaps] [Iwona-CapsCondLight-Regular]
- \definefontsynonym [SansItalicCaps] [Iwona-CapsCondLight-Italic]
- \definefontsynonym [SansBoldCaps] [Iwona-CapsCondMedium-Regular]
- \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsCondMedium-Italic]
- \stoptypescript
-
- \starttypescript [sans] [iwona-light-cond-caps,iwona-light-caps-cond] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-CapsCondLight-Regular]
- \definefontsynonym [SansItalic] [Iwona-CapsCondLight-Italic]
- \definefontsynonym [SansBold] [Iwona-CapsCondMedium-Regular]
- \definefontsynonym [SansBoldItalic] [Iwona-CapsCondMedium-Italic]
- \stoptypescript
-
- \starttypescript [sans] [iwona-cond] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-CondRegular]
- \definefontsynonym [SansItalic] [Iwona-CondItalic]
- \definefontsynonym [SansBold] [Iwona-CondBold]
- \definefontsynonym [SansBoldItalic] [Iwona-CondBoldItalic]
- \definefontsynonym [SansCaps] [Iwona-CapsCondRegular]
- \definefontsynonym [SansItalicCaps] [Iwona-CapsCondItalic]
- \definefontsynonym [SansBoldCaps] [Iwona-CapsCondBold]
- \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsCondBoldItalic]
- \stoptypescript
-
- \starttypescript [sans] [iwona-cond-caps,iwona-caps-cond] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-CapsCondRegular]
- \definefontsynonym [SansItalic] [Iwona-CapsCondItalic]
- \definefontsynonym [SansBold] [Iwona-CapsCondBold]
- \definefontsynonym [SansBoldItalic] [Iwona-CapsCondBoldItalic]
- \stoptypescript
-
- \starttypescript [sans] [iwona-medium-cond] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-CondMedium-Regular]
- \definefontsynonym [SansItalic] [Iwona-CondMedium-Italic]
- \definefontsynonym [SansBold] [Iwona-CondHeavy-Regular]
- \definefontsynonym [SansBoldItalic] [Iwona-CondHeavy-Italic]
- \definefontsynonym [SansCaps] [Iwona-CapsCondHeavy-Regular]
- \definefontsynonym [SansItalicCaps] [Iwona-CapsCondMedium-Italic]
- \definefontsynonym [SansBoldCaps] [Iwona-CapsCondHeavy-Regular]
- \definefontsynonym [SansBoldItalicCaps] [Iwona-CapsCondHeavy-Italic]
- \stoptypescript
-
- \starttypescript [sans] [iwona-medium-cond-caps,iwona-medium-caps-cond] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Iwona-CapsCondHeavy-Regular]
- \definefontsynonym [SansItalic] [Iwona-CapsCondMedium-Italic]
- \definefontsynonym [SansBold] [Iwona-CapsCondHeavy-Regular]
- \definefontsynonym [SansBoldItalic] [Iwona-CapsCondHeavy-Italic]
- \stoptypescript
-
- \starttypescript [math] [iwona-light] [name]
- \definefontsynonym [MathRoman] [Iwona-Math-Letters-Light-Regular]
- \definefontsynonym [MathItalic] [Iwona-Math-Letters-Light-Italic]
- \definefontsynonym [MathSymbol] [Iwona-Math-Symbols-Light]
- \definefontsynonym [MathExtension] [Iwona-Math-Extension-Light]
- \stoptypescript
-
- \starttypescript [math] [iwona] [name]
- \definefontsynonym [MathRoman] [Iwona-Math-Letters-Regular]
- \definefontsynonym [MathItalic] [Iwona-Math-Letters-Italic]
- \definefontsynonym [MathSymbol] [Iwona-Math-Symbols-Regular]
- \definefontsynonym [MathExtension] [Iwona-Math-Extension-Regular]
- \stoptypescript
-
- \starttypescript [math] [iwona-medium] [name]
- \definefontsynonym [MathRoman] [Iwona-Math-Letters-Medium-Regular]
- \definefontsynonym [MathItalic] [Iwona-Math-Letters-Medium-Italic]
- \definefontsynonym [MathSymbol] [Iwona-Math-Symbols-Medium]
- \definefontsynonym [MathExtension] [Iwona-Math-Extension-Medium]
- \stoptypescript
-
- \starttypescript [math] [iwona-heavy] [name]
- \definefontsynonym [MathRoman] [Iwona-Math-Letters-Heavy-Regular]
- \definefontsynonym [MathItalic] [Iwona-Math-Letters-Heavy-Italic]
- \definefontsynonym [MathSymbol] [Iwona-Math-Symbols-Heavy]
- \definefontsynonym [MathExtension] [Iwona-Math-Extension-Heavy]
- \stoptypescript
-
- \starttypescript [iwona,iwona-light,iwona-heavy,iwona-medium]
- \definetypeface[\typescriptone][ss][sans] [\typescriptone] [default] [features=default]
- \definetypeface[\typescriptone][rm][serif][modern] [default] [features=default]
- \definetypeface[\typescriptone][tt][mono] [modern] [default] [features=default]
- \definetypeface[\typescriptone][mm][math] [\typescriptone] [default] [features=default,text=ss]
- \quittypescriptscanning
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[kurier]
-
- \starttypescript [sans] [kurier-light,kurier,kurier-medium]
- \definefontsynonym[Kurier-Light] [kurierl]
- \definefontsynonym[Kurier-Regular] [kurierr]
- \definefontsynonym[Kurier-Medium] [kurierm]
- \definefontsynonym[Kurier-Bold] [kurierb]
- \definefontsynonym[Kurier-Heavy] [kurierh]
- \definefontsynonym[Kurier-LightItalic] [kurierli]
- \definefontsynonym[Kurier-Italic] [kurierri]
- \definefontsynonym[Kurier-MediumItalic] [kuriermi]
- \definefontsynonym[Kurier-BoldItalic] [kurierbi]
- \definefontsynonym[Kurier-HeavyItalic] [kurierhi]
- \stoptypescript
-
- \starttypescript [math] [kurier] [default]
- \definefontsynonym [Kurier-Math-Letters-Regular] [rm-kurierr]
- \definefontsynonym [Kurier-Math-Letters-Italic] [mi-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-Regular] [rm-kurierl]
- \definefontsynonym [Kurier-Math-Letters-Light-Italic] [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-Regular] [rm-kurierm]
- \definefontsynonym [Kurier-Math-Letters-Medium-Italic] [mi-kuriermi]
- \definefontsynonym [Kurier-Math-Symbols-Medium-Regular] [sy-kuriermz]
- \definefontsynonym [Kurier-Math-Extension-Medium] [ex-kurierm]
- \stoptypescript
-
- \starttypescript [math] [kurier,kurier-light,kurier-medium] [default]
- \loadmapfile[kurier-rm.map]
- \loadmapfile[kurier-mi.map]
- \loadmapfile[kurier-sy.map]
- \loadmapfile[kurier-ex.map]
- \stoptypescript
-
- \starttypescript [sans] [kurier-light] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Kurier-Light-Regular]
- \definefontsynonym [SansItalic] [Kurier-Light-Italic]
- \definefontsynonym [SansBold] [Kurier-Medium-Regular]
- \definefontsynonym [SansBoldItalic] [Kurier-Medium-Italic]
- \stoptypescript
-
- \starttypescript [sans] [kurier] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Kurier-Regular]
- \definefontsynonym [SansItalic] [Kurier-Italic]
- \definefontsynonym [SansBold] [Kurier-Bold]
- \definefontsynonym [SansBoldItalic] [Kurier-BoldItalic]
- \stoptypescript
-
- \starttypescript [sans] [kurier-medium] [name]
- \setups[font:fallback:sans]
- \definefontsynonym [Sans] [Kurier-Medium-Regular]
- \definefontsynonym [SansItalic] [Kurier-Medium-Italic]
- \definefontsynonym [SansBold] [Kurier-Heavy-Regular]
- \definefontsynonym [SansBoldItalic] [Kurier-Heavy-Italic]
- \stoptypescript
-
- \starttypescript [math] [kurier-light] [name]
- \definefontsynonym [MathRoman] [Kurier-Math-Letters-Light-Regular]
- \definefontsynonym [MathItalic] [Kurier-Math-Letters-Light-Italic]
- \definefontsynonym [MathSymbol] [Kurier-Math-Symbols-Light]
- \definefontsynonym [MathExtension] [Kurier-Math-Extension-Light]
- \stoptypescript
-
- \starttypescript [math] [kurier] [name]
- \definefontsynonym [MathRoman] [Kurier-Math-Letters-Regular]
- \definefontsynonym [MathItalic] [Kurier-Math-Letters-Italic]
- \definefontsynonym [MathSymbol] [Kurier-Math-Symbols-Regular]
- \definefontsynonym [MathExtension] [Kurier-Math-Extension-Regular]
- \stoptypescript
-
- \starttypescript [math] [kurier-medium] [name]
- \definefontsynonym [MathRoman] [Kurier-Math-Letters-Medium-Regular]
- \definefontsynonym [MathItalic] [Kurier-Math-Letters-Medium-Italic]
- \definefontsynonym [MathSymbol] [Kurier-Math-Symbols-Medium]
- \definefontsynonym [MathExtension] [Kurier-Math-Extension-Medium]
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[symbols]
-
- \starttypescript
- \definefontsynonym [ZapfDingbats] [uzdr]
- \definefontsynonym [RalfSmithFormalScript] [rsfs10]
- \definefontsynonym [MartinVogel] [umvs]
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[charter]
-
- % is this ok?
-
- \starttypescript [serif] [charter]
- \definefontsynonym [Charter-Roman] [name:CharterBT-Roman] % or: [bchr8a]
- \definefontsynonym [Charter-Italic] [name:CharterBT-Italic] % or: [bchri8a]
- \definefontsynonym [Charter-Bold] [name:CharterBT-Bold] % or: [bchb8a]
- \definefontsynonym [Charter-BoldItalic] [name:CharterBT-BoldItalic] % or: [bchbi8a]
- \definefontsynonym [Charter-Slanted] [name:CharterBT-Italic] % or: [bchri8a]
- \definefontsynonym [Charter-BoldSlanted] [name:CharterBT-BoldItalic] % or: [bchbi8a]
- \definefontsynonym [Charter-Roman-Caps] [Charter-Roman] % not present
- \stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[postscript]
-
- \starttypescript [postscript]
- \definetypeface [postscript] [rm] [serif] [times] [default] [features=default]
- \definetypeface [postscript] [ss] [sans] [helvetica] [default] [features=default,rscale=0.9]
- \definetypeface [postscript] [tt] [mono] [courier] [default] [features=default,rscale=1.1]
- \definetypeface [postscript] [mm] [math] [times] [default]
- \quittypescriptscanning
- \stoptypescript
-
-\stoptypescriptcollection
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/type-run.mkii b/Master/texmf-dist/tex/context/base/mkii/type-run.mkii
deleted file mode 100644
index 51a9f2a885d..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/type-run.mkii
+++ /dev/null
@@ -1,51 +0,0 @@
-%D \module
-%D [ file=type-run,
-%D version=2001.04.20,
-%D title=\CONTEXT\ Typescript Macros,
-%D subtitle=Runtime Macros,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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
-
-\gdef\typetypescript
- {\dotripleempty\dotypetypescript}
-
-\gdef\dotypetypescript[#1][#2][#3]%
- {\bgroup
- \def\dochecktypescript##1##2% script use
- {\doifelsenothing{##1##2}
- {\donetrue}
- {\ExpandBothAfter\doifcommonelse{##1}{##2}\donetrue\donefalse}}
- \edef\typescriptone {\truetypescript{#1}}%
- \edef\typescripttwo {\truetypescript{#2}}%
- \edef\typescriptthree{\truetypescript{#3}}%
- \def\starttypescript
- {\bgroup
- \obeylines % else we loose the first line due to lookahead
- \dotripleempty\dostarttypescript}
- \def\dostarttypescript[##1][##2][##3]%
- {\long\def\next####1\stoptypescript{\egroup}
- \dochecktypescript{##1}\typescriptone \ifdone
- \dochecktypescript{##2}\typescripttwo \ifdone
- \dochecktypescript{##3}\typescriptthree\ifdone
- \def\next%
- {\def\stoptypescript{\egroup\type{\stoptypescript}}
- % what follows now is quite ugly
- \skipfirstverbatimlinefalse
- \type{\starttypescript}
- \doifsomething{##1}{\type{[##1]}}
- \doifsomething{##2}{\type{[##2]}}
- \doifsomething{##3}{\type{[##3]}}
- \processdisplayverbatim{\stoptypescript}}%
- \fi\fi\fi
- \next}
- \processcommacommand[\typescriptfiles]\ReadFile % \dodousetypescript
- \egroup}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/type-set.mkii b/Master/texmf-dist/tex/context/base/mkii/type-set.mkii
deleted file mode 100644
index 7f34deadaad..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/type-set.mkii
+++ /dev/null
@@ -1,81 +0,0 @@
-%D \module
-%D [ file=type-set,
-%D version=2005.02.04, % moved from ini/def
-%D title=\CONTEXT\ Typescript Macros,
-%D subtitle=Default Settings,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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
-
-\definetypescriptprefix [serif] [Serif]
-\definetypescriptprefix [sans] [Sans]
-\definetypescriptprefix [mono] [Mono]
-
-\definefontsynonym [DefaultFont] [cmvtt10]
-
-\startsetups [font:fallback:serif]
- \definefontsynonym [Serif] [DefaultFont]
- \definefontsynonym [SerifBold] [Serif]
- \definefontsynonym [SerifItalic] [Serif]
- \definefontsynonym [SerifSlanted] [SerifItalic]
- \definefontsynonym [SerifBoldItalic] [Serif]
- \definefontsynonym [SerifBoldSlanted] [SerifBoldItalic]
- \definefontsynonym [SerifCaps] [Serif]
-\stopsetups
-
-\startsetups [font:fallback:sans]
- \definefontsynonym [Sans] [DefaultFont]
- \definefontsynonym [SansBold] [Sans]
- \definefontsynonym [SansItalic] [Sans]
- \definefontsynonym [SansSlanted] [SansItalic]
- \definefontsynonym [SansBoldItalic] [Sans]
- \definefontsynonym [SansBoldSlanted] [SansBoldItalic]
- \definefontsynonym [SansCaps] [Sans]
-\stopsetups
-
-\startsetups [font:fallback:mono]
- \definefontsynonym [Mono] [DefaultFont]
- \definefontsynonym [MonoBold] [Mono]
- \definefontsynonym [MonoItalic] [Mono]
- \definefontsynonym [MonoSlanted] [MonoItalic]
- \definefontsynonym [MonoBoldItalic] [Mono]
- \definefontsynonym [MonoBoldSlanted] [MonoBoldItalic]
- \definefontsynonym [MonoCaps] [Mono]
-\stopsetups
-
-\startsetups [font:allbold:serif]
- \definefontsynonym [Serif] [SerifBold]
- \definefontsynonym [SerifItalic] [SerifBoldItalic]
- \definefontsynonym [SerifSlanted] [SerifBoldSlanted]
- %definefontsynonym [SerifCaps] [SerifBold]
-\stopsetups
-
-\startsetups [font:allbold:sans]
- \definefontsynonym [Sans] [SansBold]
- \definefontsynonym [SansItalic] [SansBoldItalic]
- \definefontsynonym [SansSlanted] [SansBoldSlanted]
- %definefontsynonym [SansCaps] [SansBold]
-\stopsetups
-
-\ifnum\texengine=\xetexengine
- %usetypescriptfile[\f!typeprefix def] % preloaded in context.mkii
- %usetypescriptfile[\f!typeprefix tmf] % replaced
- \usetypescriptfile[\f!typeprefix siz]
- \usetypescriptfile[\f!typeprefix otf]
- \usetypescriptfile[\f!typeprefix xtx]
- \usetypescriptfile[\f!typeprefix loc]
-\else
- %usetypescriptfile[\f!typeprefix def] % preloaded in context.mkii
- %usetypescriptfile[\f!typeprefix tmf] % replaced
- \usetypescriptfile[\f!typeprefix siz]
- \usetypescriptfile[\f!typeprefix one]
- \usetypescriptfile[\f!typeprefix loc]
-\fi
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/type-siz.mkii b/Master/texmf-dist/tex/context/base/mkii/type-siz.mkii
deleted file mode 100644
index 4c3cfb28b0e..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/type-siz.mkii
+++ /dev/null
@@ -1,748 +0,0 @@
-%D \module
-%D [ file=type-siz,
-%D version=2001.04.12,
-%D title=\CONTEXT\ Typescript Macros,
-%D subtitle=Sizing scripts,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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[size]
-
-\starttypescript [serif] [default] [size]
- \definebodyfont
- [4pt,5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,14.4pt,17.3pt]
- [rm] [default]
-\stoptypescript
-
-\starttypescript [sans] [default] [size]
- \definebodyfont
- [4pt,5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,14.4pt,17.3pt]
- [ss] [default]
-\stoptypescript
-
-\starttypescript [mono] [default] [size]
- \definebodyfont
- [4pt,5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,14.4pt,17.3pt]
- [tt] [default]
-\stoptypescript
-
-\starttypescript [math,boldmath] [default] [size]
- \definebodyfont
- [4pt,5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,14.4pt,17.3pt]
- [mm] [default]
-\stoptypescript
-
-\starttypescript [bfmath] [default] [size]
- \definebodyfont
- [4pt,5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,14.4pt,17.3pt]
- [mm] [bfmath]
-\stoptypescript
-
-\starttypescript [handwriting] [default] [size]
- \definebodyfont
- [4pt,5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,14.4pt,17.3pt]
- [hw] [default]
-\stoptypescript
-
-\starttypescript [calligraphy] [default] [size]
- \definebodyfont
- [4pt,5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,14.4pt,17.3pt]
- [cg] [default]
-\stoptypescript
-
-\starttypescript [casual] [default] [size] % maps onto rm !
- \definebodyfont
- [4pt,5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,14.4pt,17.3pt]
- [rm] [default]
-\stoptypescript
-
-\starttypescript [all] [dtp] [size]
-
- \definebodyfontenvironment
- [4pt]
- [\s!text=4pt,\s!script=4pt,\s!scriptscript=4pt,
- \c!x=4pt,\c!xx=4pt,\c!big=6pt,\c!small=4pt]
-
- \definebodyfontenvironment
- [5pt]
- [\s!text=5pt,\s!script=5pt,\s!scriptscript=5pt,
- \c!x=5pt,\c!xx=5pt,\c!big=7pt,\c!small=5pt]
-
- \definebodyfontenvironment
- [6pt]
- [\s!text=6pt,\s!script=5pt,\s!scriptscript=5pt,
- \c!x=5pt,\c!xx=5pt,\c!big=8pt,\c!small=5pt]
-
- \definebodyfontenvironment
- [7pt]
- [\s!text=7pt,\s!script=6pt,\s!scriptscript=5pt,
- \c!x=6pt,\c!xx=5pt,\c!big=9pt,\c!small=5pt]
-
- \definebodyfontenvironment
- [8pt]
- [\s!text=8pt,\s!script=6pt,\s!scriptscript=5pt,
- \c!x=6pt,\c!xx=5pt,\c!big=10pt,\c!small=6pt]
-
- \definebodyfontenvironment
- [9pt]
- [\s!text=9pt,\s!script=7pt,\s!scriptscript=5pt,
- \c!x=7pt,\c!xx=5pt,\c!big=11pt,\c!small=7pt]
-
- \definebodyfontenvironment
- [10pt]
- [\s!text=10pt,\s!script=7pt,\s!scriptscript=5pt,
- \c!x=8pt,\c!xx=6pt,\c!big=12pt,\c!small=8pt]
-
- \definebodyfontenvironment
- [11pt]
- [\s!text=11pt,\s!script=8pt,\s!scriptscript=6pt,
- \c!x=9pt,\c!xx=7pt,\c!big=13pt,\c!small=9pt]
-
- \definebodyfontenvironment
- [12pt]
- [\s!text=12pt,\s!script=9pt,\s!scriptscript=7pt,
- \c!x=10pt,\c!xx=8pt,\c!big=14pt,\c!small=10pt]
-
- \definebodyfontenvironment
- [13pt]
- [\s!text=13pt,\s!script=10pt,\s!scriptscript=8pt,
- \c!x=11pt,\c!xx=9pt,\c!big=16pt,\c!small=11pt]
-
- \definebodyfontenvironment
- [14pt]
- [\s!text=14pt,\s!script=10pt,\s!scriptscript=7pt,
- \c!x=12pt,\c!xx=10pt,\c!big=16pt,\c!small=12pt]
-
- \definebodyfontenvironment
- [16pt]
- [\s!text=16pt,\s!script=12pt,\s!scriptscript=9pt,
- \c!x=13pt,\c!xx=11pt,\c!big=18pt,\c!small=14pt]
-
- % suboptimal math sizes
-
- \definebodyfontenvironment
- [18pt]
- [\s!text=18pt,\s!script=16pt,\s!scriptscript=14pt,
- \c!x=16pt,\c!xx=14pt,\c!big=22pt,\c!small=16pt]
-
- \definebodyfontenvironment
- [22pt]
- [\s!text=22pt,\s!script=22pt,\s!scriptscript=18pt,
- \c!x=18pt,\c!xx=16pt,\c!big=28pt,\c!small=18pt]
-
- \definebodyfontenvironment
- [28pt]
- [\s!text=28pt,\s!script=22pt,\s!scriptscript=18pt,
- \c!x=22pt,\c!xx=18pt,\c!big=28pt,\c!small=22pt]
-
-\stoptypescript
-
-\starttypescript [serif] [dtp] [size]
- \definebodyfont
- [5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,13pt,14pt,16pt,18pt,22pt,28pt]
- [rm] [default]
-\stoptypescript
-
-\starttypescript [sans] [dtp] [size]
- \definebodyfont
- [5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,13pt,14pt,16pt,18pt,22pt,28pt]
- [ss] [default]
-\stoptypescript
-
-\starttypescript [mono] [dtp] [size]
- \definebodyfont
- [5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,13pt,14pt,16pt,18pt,22pt,28pt]
- [tt] [default]
-\stoptypescript
-
-\starttypescript [math,boldmath] [dtp] [size]
- \definebodyfont
- [5pt,6pt,7pt,8pt,9pt,10pt,11pt,12pt,13pt,14pt,16pt,18pt,22pt,28pt]
- [mm] [default]
-\stoptypescript
-
-\stoptypescriptcollection
-
-\starttypescriptcollection[size-mkii]
-
-% todo: instead of assuming designsize we will set it explicitly (saves these
-% -1000 problems at the lua end)
-
-% cmr
-
-\starttypescript [serif] [computer-modern] [size]
-
- \definebodyfont [12pt] [rm]
- [tf=cmr12,
- bf=cmbx12,
- it=cmti12,
- sl=cmsl12,
- bi=cmbxti10 at 12pt,
- bs=cmbxsl10 at 12pt,
- sc=cmcsc10 at 12pt]
-
- \definebodyfont [11pt] [rm]
- [tf=cmr10 at 11pt,
- bf=cmbx10 at 11pt,
- sl=cmsl10 at 11pt,
- it=cmti10 at 11pt,
- bi=cmbxti10 at 11pt,
- bs=cmbxsl10 at 11pt,
- sc=cmcsc10 at 11pt]
-
- \definebodyfont [10pt] [rm]
- [tf=cmr10,
- bf=cmbx10,
- it=cmti10,
- sl=cmsl10,
- bi=cmbxti10,
- bs=cmbxsl10,
- sc=cmcsc10]
-
- \definebodyfont [9pt] [rm]
- [tf=cmr9,
- bf=cmbx9,
- it=cmti9,
- sl=cmsl9,
- bi=cmbxti10 at 9pt,
- bs=cmbxsl10 at 9pt,
- sc=cmcsc10 at 9pt]
-
- \definebodyfont [8pt] [rm]
- [tf=cmr8,
- bf=cmbx8,
- it=cmti8,
- sl=cmsl8,
- bi=cmbxti10 at 8pt,
- bs=cmbxsl10 at 8pt,
- sc=cmcsc10 at 8pt]
-
- \definebodyfont [7pt] [rm]
- [tf=cmr7,
- bf=cmbx7,
- it=cmti10 at 7pt,
- sl=cmsl10 at 7pt,
- bi=cmbxti10 at 7pt,
- bs=cmbxsl10 at 7pt,
- sc=cmcsc10 at 7pt]
-
- \definebodyfont [6pt] [rm]
- [tf=cmr6,
- bf=cmbx6,
- it=cmti10 at 6pt,
- sl=cmsl10 at 6pt,
- bi=cmbxti10 at 6pt,
- bs=cmbxsl10 at 6pt,
- sc=cmcsc10 at 6pt]
-
- \definebodyfont [5pt] [rm]
- [tf=cmr5,
- bf=cmbx5,
- it=cmti10 at 5pt,
- sl=cmsl10 at 5pt,
- bi=cmbxti10 at 5pt,
- bs=cmbxsl10 at 5pt,
- sc=cmcsc10 at 5pt]
-
- \definebodyfont [4pt] [rm]
- [tf=cmr10 at 4pt,
- bf=cmbx10 at 4pt,
- it=cmti10 at 4pt,
- sl=cmsl10 at 4pt,
- bi=cmbxti10 at 4pt,
- bs=cmbxsl10 at 4pt,
- sc=cmr10 at 4pt]
-
- \definebodyfont [14.4pt,17.3pt,20.7pt] [rm]
- [tf=cmr12 sa 1,
- bf=cmbx12 sa 1,
- it=cmti12 sa 1,
- sl=cmsl12 sa 1,
- bi=cmbxti10 sa 1,
- bs=cmbxsl10 sa 1,
- sc=cmcsc10 sa 1]
-
-\stoptypescript
-
-\starttypescript [sans] [computer-modern] [size]
-
- \definebodyfont [12pt] [ss]
- [tf=cmss12,
- bf=cmssbx10 at 12pt,
- it=cmssi12,
- sl=cmssi12,
- bi=cmssbx10 at 12pt,
- bs=cmssbx10 at 12pt,
- sc=cmss10 at 12pt]
-
- \definebodyfont [11pt] [ss]
- [tf=cmss10 at 11pt,
- bf=cmssbx10 at 11pt,
- it=cmssi10 at 11pt,
- sl=cmssi10 at 11pt,
- bi=cmssbx10 at 11pt,
- bs=cmssbx10 at 11pt,
- sc=cmss10 at 11pt]
-
- \definebodyfont [10pt] [ss]
- [tf=cmss10,
- bf=cmssbx10,
- it=cmssi10,
- sl=cmssi10,
- bi=cmssbx10,
- bs=cmssbx10,
- sc=cmss10]
-
- \definebodyfont [9pt] [ss]
- [tf=cmss9,
- bf=cmssbx10 at 9pt,
- it=cmssi9,
- sl=cmssi9,
- bi=cmssbx10 at 9pt,
- bs=cmssbx10 at 9pt,
- sc=cmss9]
-
- \definebodyfont [8pt] [ss]
- [tf=cmss8,
- bf=cmssbx10 at 8pt,
- it=cmssi8,
- sl=cmssi8,
- bi=cmssbx10 at 8pt,
- bs=cmssbx10 at 8pt,
- sc=cmss8]
-
- \definebodyfont [7pt] [ss]
- [tf=cmss10 at 7pt,
- bf=cmssbx10 at 7pt,
- it=cmssi10 at 7pt,
- sl=cmssi10 at 7pt,
- bs=cmssbx10 at 7pt,
- bi=cmssbx10 at 7pt,
- sc=cmss10 at 7pt]
-
- \definebodyfont [6pt] [ss]
- [tf=cmss10 at 6pt,
- bf=cmssbx10 at 6pt,
- it=cmssi10 at 6pt,
- sl=cmssi10 at 6pt,
- bs=cmssbx10 at 6pt,
- bi=cmssbx10 at 6pt,
- sc=cmss10 at 6pt]
-
- \definebodyfont [5pt] [ss]
- [tf=cmss10 at 5pt,
- bf=cmssbx10 at 5pt,
- it=cmssi10 at 5pt,
- sl=cmssi10 at 5pt,
- bs=cmssbx10 at 5pt,
- bi=cmssbx10 at 5pt,
- sc=cmss10 at 5pt]
-
- \definebodyfont [4pt] [ss]
- [tf=cmss10 at 4pt,
- bf=cmssbx10 at 4pt,
- it=cmssi10 at 4pt,
- sl=cmssi10 at 4pt,
- bs=cmssbx10 at 4pt,
- bi=cmssbx10 at 4pt,
- sc=cmss10 at 4pt]
-
- \definebodyfont [14.4pt,17.3pt,20.7pt] [ss]
- [tf=cmss12 sa 1,
- bf=cmssbx10 sa 1,
- it=cmssi12 sa 1,
- sl=cmssi12 sa 1,
- bi=cmssbx10 sa 1,
- bs=cmssbx10 sa 1,
- sc=cmss12 sa 1]
-
-\stoptypescript
-
-\starttypescript [mono] [computer-modern] [size]
-
- \definebodyfont [12pt] [tt]
- [tf=cmtt12,
- sl=cmsltt10 at 12pt,
- it=cmitt10 at 12pt,
- sc=cmtcsc10 at 12pt]
-
- \definebodyfont [9pt] [tt]
- [tf=cmtt9,
- sl=cmsltt10 at 9pt,
- it=cmitt10 at 9pt,
- sc=cmtcsc10 at 9pt]
-
- \definebodyfont [8pt] [tt]
- [tf=cmtt8,
- sl=cmsltt10 at 8pt,
- it=cmitt10 at 8pt,
- sc=cmtcsc10 at 8pt]
-
- \definebodyfont [11pt,10pt,7pt,6pt,5pt,4pt] [tt]
- [tf=cmtt10 sa 1,
- sl=cmsltt10 sa 1,
- it=cmitt10 sa 1,
- sc=cmtcsc10 sa 1]
-
- \definebodyfont [14.4pt,17.3pt,20.7pt] [tt]
- [tf=cmtt12 sa 1,
- sl=cmsltt10 sa 1,
- it=cmitt10 sa 1,
- sc=cmtcsc10 sa 1]
-
-\stoptypescript
-
-\starttypescript [math] [modern,computer-modern,latin-modern] [size]
-
- % hack to prevent mapping of filenames, watch the space! before
- % latin modern came aroudn we needed this trick to make sure that
- % we loaded the raw cmr12 etc instead of the ones mapped onto
- % an encoding (this trick is no longer needed with lm)
- %
- % \definefontsynonym[xcmr12][cmr12 ]
- % \definefontsynonym[xcmr10][cmr10 ]
- % \definefontsynonym[xcmr9] [cmr9 ]
- % \definefontsynonym[xcmr8] [cmr8 ]
- % \definefontsynonym[xcmr7] [cmr7 ]
- % \definefontsynonym[xcmr6] [cmr6 ]
- % \definefontsynonym[xcmr5] [cmr5 ]
-
- \definefontsynonym[xcmr12][rm-lmr12]
- \definefontsynonym[xcmr10][rm-lmr10]
- \definefontsynonym[xcmr9] [rm-lmr9]
- \definefontsynonym[xcmr8] [rm-lmr8]
- \definefontsynonym[xcmr7] [rm-lmr7]
- \definefontsynonym[xcmr6] [rm-lmr6]
- \definefontsynonym[xcmr5] [rm-lmr5]
-
- \definebodyfont [12pt] [mm]
- [mr=xcmr12,
- ex=cmex10 at 12pt,
- mi=cmmi12,
- sy=cmsy10 at 12pt]
-
- \definebodyfont [11pt] [mm]
- [mr=xcmr10 at 11pt,
- ex=cmex10 at 11pt,
- mi=cmmi10 at 11pt,
- sy=cmsy10 at 11pt]
-
- \definebodyfont [10pt] [mm]
- [mr=xcmr10,
- ex=cmex10,
- mi=cmmi10,
- sy=cmsy10]
-
- \definebodyfont [9pt] [mm]
- [mr=xcmr9,
- ex=cmex10 at 9pt,
- mi=cmmi9,
- sy=cmsy9]
-
- \definebodyfont [8pt] [mm]
- [mr=xcmr8,
- ex=cmex10 at 8pt,
- mi=cmmi8,
- sy=cmsy8]
-
- \definebodyfont [7pt] [mm]
- [mr=xcmr7,
- ex=cmex10 at 7pt,
- mi=cmmi7,
- sy=cmsy7]
-
- \definebodyfont [6pt] [mm]
- [mr=xcmr6,
- ex=cmex10 at 6pt,
- mi=cmmi6,
- sy=cmsy6]
-
- \definebodyfont [5pt] [mm]
- [mr=xcmr5,
- ex=cmex10 at 5pt,
- mi=cmmi5,
- sy=cmsy5]
-
- \definebodyfont [4pt] [mm]
- [mr=xcmr5 at 4pt,
- ex=cmex10 at 4pt,
- mi=cmmi5 at 4pt,
- sy=cmsy5 at 4pt]
-
- \definebodyfont [14.4pt,17.3pt,20.7pt] [mm]
- [mr=xcmr12 sa 1,
- ex=cmex10 sa 1,
- mi=cmmi12 sa 1,
- sy=cmsy10 sa 1]
-
-\stoptypescript
-
-\starttypescript [boldmath] [modern,computer-modern,latin-modern] [size]
-
-% hack to prevent mapping of filenames, watch the space!
-
- \definefontsynonym[xcmb12][cmbx12 ]
- \definefontsynonym[xcmb10][cmbx10 ]
- \definefontsynonym[xcmb9] [cmbx9 ]
- \definefontsynonym[xcmb8] [cmbx8 ]
- \definefontsynonym[xcmb7] [cmbx7 ]
- \definefontsynonym[xcmb6] [cmbx6 ]
- \definefontsynonym[xcmb5] [cmbx5 ]
-
- \definebodyfont [12pt] [mm]
- [mr=xcmb12,
- ex=cmex10 at 12pt,
- mi=cmmib10 at 12pt,
- sy=cmbsy10 at 12pt]
-
- \definebodyfont [11pt] [mm]
- [mr=xcmb10 at 11pt,
- ex=cmex10 at 11pt,
- mi=cmmib10 at 11pt,
- sy=cmbsy10 at 11pt]
-
- \definebodyfont [10pt] [mm]
- [mr=xcmb10,
- ex=cmex10,
- mi=cmmib10,
- sy=cmbsy10]
-
- \definebodyfont [9pt] [mm]
- [mr=xcmb9,
- ex=cmex10 at 9pt,
- mi=cmmib10 at 9pt,
- sy=cmbsy10 at 9pt]
-
- \definebodyfont [8pt] [mm]
- [mr=xcmb8,
- ex=cmex10 at 8pt,
- mi=cmmib7 at 8pt,
- sy=cmbsy7 at 8pt]
-
- \definebodyfont [7pt] [mm]
- [mr=xcmb7,
- ex=cmex10 at 7pt,
- mi=cmmib7,
- sy=cmbsy7]
-
- \definebodyfont [6pt] [mm]
- [mr=xcmb6,
- ex=cmex10 at 6pt,
- mi=cmmib5 at 6pt,
- sy=cmbsy5 at 6pt]
-
- \definebodyfont [5pt] [mm]
- [mr=xcmb5,
- ex=cmex10 at 5pt,
- mi=cmmib5,
- sy=cmbsy5]
-
- \definebodyfont [4pt] [mm]
- [mr=xcmb5 at 4pt,
- ex=cmex10 at 4pt,
- mi=cmmib5 at 4pt,
- sy=cmbsy5 at 4pt]
-
- \definebodyfont [14.4pt,17.3pt,20.7pt] [mm]
- [mr=xcmb12 sa 1,
- ex=cmex10 sa 1,
- mi=cmmib10 sa 1,
- sy=cmbsy10 sa 1]
-
-\stoptypescript
-
-\starttypescript [bfmath] [modern,computer-modern,latin-modern] [size]
-
-% hack to prevent mapping of filenames, watch the space!
-
- \definefontsynonym[xcmb12][cmbx12 ]
- \definefontsynonym[xcmb10][cmbx10 ]
- \definefontsynonym[xcmb9] [cmbx9 ]
- \definefontsynonym[xcmb8] [cmbx8 ]
- \definefontsynonym[xcmb7] [cmbx7 ]
- \definefontsynonym[xcmb6] [cmbx6 ]
- \definefontsynonym[xcmb5] [cmbx5 ]
-
- \definebodyfont [12pt] [mm]
- [mrbf=xcmb12,
- exbf=cmex10 at 12pt,
- mibf=cmmib10 at 12pt,
- sybf=cmbsy10 at 12pt]
-
- \definebodyfont [11pt] [mm]
- [mrbf=xcmb10 at 11pt,
- exbf=cmex10 at 11pt,
- mibf=cmmib10 at 11pt,
- sybf=cmbsy10 at 11pt]
-
- \definebodyfont [10pt] [mm]
- [mrbf=xcmb10,
- exbf=cmex10,
- mibf=cmmib10,
- sybf=cmbsy10]
-
- \definebodyfont [9pt] [mm]
- [mrbf=xcmb9,
- exbf=cmex10 at 9pt,
- mibf=cmmib10 at 9pt,
- sybf=cmbsy10 at 9pt]
-
- \definebodyfont [8pt] [mm]
- [mrbf=xcmb8,
- exbf=cmex10 at 8pt,
- mibf=cmmib7 at 8pt,
- sybf=cmbsy7 at 8pt]
-
- \definebodyfont [7pt] [mm]
- [mrbf=xcmb7,
- exbf=cmex10 at 7pt,
- mibf=cmmib7,
- sybf=cmbsy7]
-
- \definebodyfont [6pt] [mm]
- [mrbf=xcmb6,
- exbf=cmex10 at 6pt,
- mibf=cmmib5 at 6pt,
- sybf=cmbsy5 at 6pt]
-
- \definebodyfont [5pt] [mm]
- [mrbf=xcmb5,
- exbf=cmex10 at 5pt,
- mibf=cmmib5,
- sybf=cmbsy5]
-
- \definebodyfont [4pt] [mm]
- [mrbf=xcmb5 at 4pt,
- exbf=cmex10 at 4pt,
- mibf=cmmib5 at 4pt,
- sybf=cmbsy5 at 4pt]
-
- \definebodyfont [14.4pt,17.3pt,20.7pt] [mm]
- [mrbf=xcmb12 sa 1,
- exbf=cmex10 sa 1,
- mibf=cmmib10 sa 1,
- sybf=cmbsy10 sa 1]
-
-\stoptypescript
-
-\starttypescript [serif] [concrete] [size]
-
- \definebodyfont [10pt,11pt,12pt,14.4pt,17.3pt] [rm]
- [tf=ccr10 sa 1,
- it=ccti10 sa 1,
- sl=ccsl10 sa 1,
- sc=cccsc10 sa 1]
-
- \definebodyfont [5pt,6pt,7pt,8pt,9pt] [rm]
- [it=ccr9 sa 1,
- sl=ccr9 sa 1,
- sc=ccr9 sa 1]
-
- \definebodyfont [9pt] [rm] [tf=ccr9]
- \definebodyfont [8pt] [rm] [tf=ccr8]
- \definebodyfont [7pt] [rm] [tf=ccr7]
- \definebodyfont [6pt] [rm] [tf=ccr6]
- \definebodyfont [5pt] [rm] [tf=ccr5]
-
-\stoptypescript
-
-\starttypescript [math] [euler] [size]
-
- \definebodyfont [9pt,10pt,11pt,12pt,14.4pt,17.3pt,20.7pt] [mm]
- [mr=zeurm10 sa 1,
- ex=zeuex10 sa 1,
- sy=zeusm10 sa 1,
- mi=eufm10 sa 1]
-
- \definebodyfont [6pt,7pt,8pt] [mm]
- [mr=zeurm7 sa 1,
- sy=zeusm7 sa 1,
- mi=eufm7 sa 1,
- ex=zeuex10 sa 1]
-
- \definebodyfont [5pt] [mm]
- [mr=zeurm5,
- sy=zeusm5,
- mi=eufm5,
- ex=zeuex10 at 5pt]
-
-\stoptypescript
-
-\starttypescript [bfmath] [euler] [size]
-
- \definebodyfont [9pt,10pt,11pt,12pt,14.4pt,17.3pt,20.7pt] [mm]
- [mrbf=zeurb10 sa 1,
- exbf=zeuex10 sa 1,
- sybf=zeusb10 sa 1,
- mibf=eufb10 sa 1]
-
- \definebodyfont [6pt,7pt,8pt] [mm]
- [mrbf=zeurb7 sa 1,
- sybf=zeusb7 sa 1,
- mibf=eufb7 sa 1,
- exbf=zeuex10 sa 1]
-
- \definebodyfont [5pt] [mm]
- [mrbf=zeurb5,
- sybf=zeusb5,
- mibf=eufb5,
- exbf=zeuex10 at 5pt]
-
-\stoptypescript
-
-\starttypescript [boldmath] [euler] [size]
-
- \definebodyfont [9pt,10pt,11pt,12pt,14.4pt,17.3pt,20.7pt] [mm]
- [mr=zeurb10 sa 1,
- ex=zeuex10 sa 1,
- sy=zeusb10 sa 1,
- mi=eufb10 sa 1]
-
- \definebodyfont [6pt,7pt,8pt] [mm]
- [mr=zeurb7 sa 1,
- sy=zeusb7 sa 1,
- mi=eufb7 sa 1,
- ex=zeuex10 sa 1]
-
- \definebodyfont [5pt] [mm]
- [mr=zeurb5,
- sy=zeusb5,
- mi=eufb5,
- ex=zeuex10 at 5pt]
-
-\stoptypescript
-
-\starttypescript [math] [modern,computer-modern,latin-modern,ams] [size]
- \definebodyfont [17.3pt,14.4pt,12pt,11pt,10pt,9pt] [mm]
- [ma=msam10 sa 1,
- mb=msbm10 sa 1]
- \definebodyfont [8pt,7pt] [mm]
- [ma=msam7 sa 1,
- mb=msbm7 sa 1]
- \definebodyfont [6pt,5pt,4pt] [mm]
- [ma=msam5 sa 1,
- mb=msbm5 sa 1]
-\stoptypescript
-
-\starttypescript [math] [times] [size]
-
- \mapfontsize [5pt] [6.0pt]
- \mapfontsize [6pt] [6.8pt]
- \mapfontsize [7pt] [7.6pt]
- \mapfontsize [8pt] [8.4pt]
- \mapfontsize [9pt] [9.2pt]
- \mapfontsize [10pt] [10pt]
- \mapfontsize [11pt] [10.8pt]
- \mapfontsize [12pt] [11.6pt]
- \mapfontsize [14.4pt] [13.2pt]
-
-\stoptypescript
-
-\stoptypescriptcollection
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/type-tmf.mkii b/Master/texmf-dist/tex/context/base/mkii/type-tmf.mkii
deleted file mode 100644
index 829b6baec99..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/type-tmf.mkii
+++ /dev/null
@@ -1,14 +0,0 @@
-%D \module
-%D [ file=type-tmf,
-%D version=2007.07.30,
-%D title=\CONTEXT\ Typescript Macros,
-%D subtitle=Core \TEX\ Fonts,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/typo-ini.mkii b/Master/texmf-dist/tex/context/base/mkii/typo-ini.mkii
deleted file mode 100644
index 6e19fb9b670..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/typo-ini.mkii
+++ /dev/null
@@ -1,40 +0,0 @@
-%D \module
-%D [ file=typo-ini,
-%D version=2000.16.09,
-%D title=\CONTEXT\ Typographic Macros,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Since \CONTEXT\ is dealing with typographics, isn't
-%D September 2000 a bit late to start writing this module? It
-%D may seem so, but since more and more languages are
-%D supported, we think it is time to isolate language specific
-%D typographic extensions in modules. The first language that
-%D demands this is Chinese, and more will follow.
-
-\writestatus{loading}{ConTeXt Typographic Macros / Initialization}
-
-\unprotect
-
-%D \macros
-%D {ifvertical}
-%D
-%D The following switch can be used to signal macros that they
-%D should adapt their behaviour.
-
-\newif\ifvertical % maybe also ifreverse
-
-%D \macros
-%D {vhbox}
-%D
-%D A stupid but useful macro.
-
-\def\vhbox{\ifvertical\vbox\else\hbox\fi}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/unic-000.mkii b/Master/texmf-dist/tex/context/base/mkii/unic-000.mkii
deleted file mode 100644
index 4ef57044520..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/unic-000.mkii
+++ /dev/null
@@ -1,135 +0,0 @@
-%D \module
-%D [ file=unic-000,
-%D version=2002.12.03,
-%D title=\CONTEXT\ \UNICODE\ Macros,
-%D subtitle=Vector 0,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 0
-% \ifcase\numexpr(#1-159)
-% \@@unknownchar\or
-% \@@unknownchar\or
-% exclamdown\or
-% textcent\or
-% textsterling\or
-% textcurrency\or
-% ydiaeresis\else
-% \@@unknownchar
-% \fi
-% \stopunicodevector
-%
-% 20\% faster:
-
-\startunicodevector 0
- \expandafter\strippedcsname
- \ifcase\numexpr#1-159\relax
- \unknownchar \or
- \nonbreakablespace \or
- \exclamdown \or
- \textcent \or
- \textsterling \or
- \textcurrency \or
- \textyen \or
- \textbrokenbar \or
- \sectionmark \or
- \textdiaeresis \or
- \copyright \or
- \ordfeminine \or % FEMININE ORDINAL INDICATOR
- \leftguillemot \or % LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
- \textlognot \or
- \softhyphen \or
- \registered \or
- \textmacron \or
- \textdegree \or
- \textpm \or
- \twosuperior \or
- \threesuperior \or
- \textacute \or
- \textmu \or % MICRO SIGN
- \paragraphmark \or % PILCROW SIGN
- \periodcentered \or
- \textcedilla \or
- \onesuperior \or
- \ordmasculine \or % MASCULINE ORDINAL INDICATOR
- \rightguillemot \or % RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
- \onequarter \or
- \onehalf \or
- \threequarter \or
- \questiondown \or
- \Agrave \or
- \Aacute \or
- \Acircumflex \or
- \Atilde \or
- \Adiaeresis \or
- \Aring \or
- \AEligature \or
- \Ccedilla \or
- \Egrave \or
- \Eacute \or
- \Ecircumflex \or
- \Ediaeresis \or
- \Igrave \or
- \Iacute \or
- \Icircumflex \or
- \Idiaeresis \or
- \Eth \or % \Eth \or
- \Ntilde \or
- \Ograve \or
- \Oacute \or
- \Ocircumflex \or
- \Otilde \or
- \Odiaeresis \or
- \textmultiply \or
- \Ostroke \or
- \Ugrave \or
- \Uacute \or
- \Ucircumflex \or
- \Udiaeresis \or
- \Yacute \or
- \Thorn \or
- \ssharp \or
- \agrave \or
- \aacute \or
- \acircumflex \or
- \atilde \or
- \adiaeresis \or
- \aring \or
- \aeligature \or
- \ccedilla \or
- \egrave \or
- \eacute \or
- \ecircumflex \or
- \ediaeresis \or
- \igrave \or
- \iacute \or
- \icircumflex \or
- \idiaeresis \or
- \eth \or % \eth \or
- \ntilde \or
- \ograve \or
- \oacute \or
- \ocircumflex \or
- \otilde \or
- \odiaeresis \or
- \textdiv \or
- \ostroke \or
- \ugrave \or
- \uacute \or
- \ucircumflex \or
- \udiaeresis \or
- \yacute \or
- \thorn \or
- \ydiaeresis \else
- \unknownchar
- \fi
-\stopunicodevector
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/unic-001.mkii b/Master/texmf-dist/tex/context/base/mkii/unic-001.mkii
deleted file mode 100644
index 198a8d98d1b..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/unic-001.mkii
+++ /dev/null
@@ -1,220 +0,0 @@
-%D \module
-%D [ file=unic-001,
-%D version=2002.12.03,
-%D title=\CONTEXT\ \UNICODE\ Macros,
-%D subtitle=Vector 1,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Readable:
-%D
-%D \starttyping
-%D \startunicodevector 1
-%D \ifcase#1\or
-%D unknownchar\or Abreve\or abreve\or
-%D ....
-%D Zcaron\or zcaron\else unknownchar\fi
-%D \stopunicodevector
-%D
-%D \stoptyping
-%D But we can speed things up, watch how we avoid zero and \TEX's
-%D automatically added \type {\relax}.
-
-% remark:
-% - gcommaaccent, kcomaaccent, lcomaaccent, ncomaaccent, rcomaaccent
-% bear the name "WITH CEDILLA" in Unicode
-% - scomaaccent and tcomaaccent point to the "WITH CEDILLA" in the
-% Adobe Glyph List
-
-\startunicodevector 1
- \expandafter\strippedcsname
- \ifcase\numexpr#1\relax
- \Amacron \or
- \amacron \or
- \Abreve \or
- \abreve \or
- \Aogonek \or
- \aogonek \or
- \Cacute \or
- \cacute \or
- \Ccircumflex \or
- \ccircumflex \or
- \Cdotaccent \or
- \cdotaccent \or
- \Ccaron \or
- \ccaron \or
- \Dcaron \or
- \dcaron \or
- \Dstroke \or
- \dstroke \or
- \Emacron \or
- \emacron \or
- \Ebreve \or
- \ebreve \or
- \Edotaccent \or
- \edotaccent \or
- \Eogonek \or
- \eogonek \or
- \Ecaron \or
- \ecaron \or
- \Gcircumflex \or
- \gcircumflex \or
- \Gbreve \or
- \gbreve \or
- \Gdotaccent \or
- \gdotaccent \or
- \Gcommaaccent \or % WITH CEDILLA
- \gcommaaccent \or % WITH CEDILLA
- \Hcircumflex \or
- \hcircumflex \or
- \Hstroke \or
- \hstroke \or
- \Itilde \or
- \itilde \or
- \Imacron \or
- \imacron \or
- \Ibreve \or
- \ibreve \or
- \Iogonek \or
- \iogonek \or
- \Idotaccent \or
- \dotlessi \or
- \IJligature \or
- \ijligature \or
- \Jcircumflex \or
- \jcircumflex \or
- \Kcommaaccent \or % WITH CEDILLA
- \kcommaaccent \or % WITH CEDILLA
- \kkra \or % \kkra \or
- \Lacute \or
- \lacute \or
- \Lcommaaccent \or % WITH CEDILLA
- \lcommaaccent \or % WITH CEDILLA
- \Lcaron \or
- \lcaron \or
- \Ldotmiddle \or % \Ldotmiddle \or
- \ldotmiddle \or % \ldotmiddle \or
- \Lstroke \or
- \lstroke \or
- \Nacute \or
- \nacute \or
- \Ncommaaccent \or % WITH CEDILLA
- \ncommaaccent \or % WITH CEDILLA
- \Ncaron \or
- \ncaron \or
- \napostrophe \or
- \Neng \or
- \neng \or
- \Omacron \or
- \omacron \or
- \Obreve \or
- \obreve \or
- \Ohungarumlaut \or
- \ohungarumlaut \or
- \OEligature \or
- \oeligature \or
- \Racute \or
- \racute \or
- \Rcommaaccent \or % WITH CEDILLA
- \rcommaaccent \or % WITH CEDILLA
- \Rcaron \or
- \rcaron \or
- \Sacute \or
- \sacute \or
- \Scircumflex \or
- \scircumflex \or
- \Scedilla \or
- \scedilla \or
- \Scaron \or
- \scaron \or
- \Tcedilla \or
- \tcedilla \or
- \Tcaron \or
- \tcaron \or
- \Tstroke \or
- \tstroke \or
- \Utilde \or
- \utilde \or
- \Umacron \or
- \umacron \or
- \Ubreve \or
- \ubreve \or
- \Uring \or
- \uring \or
- \Uhungarumlaut \or
- \uhungarumlaut \or
- \Uogonek \or
- \uogonek \or
- \Wcircumflex \or
- \wcircumflex \or
- \Ycircumflex \or
- \ycircumflex \or
- \Ydiaeresis \or
- \Zacute \or
- \zacute \or
- \Zdotaccent \or
- \zdotaccent \or
- \Zcaron \or
- \zcaron \or
- \slong \or % 127 \slong \else
- \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
- \textflorin \or % 146
- \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
- \Ohorn \or % 160
- \ohorn \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
- \Uhorn \or % 175
- \uhorn \else
- \unknownchar
- \fi
-\stopunicodevector
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/unic-002.mkii b/Master/texmf-dist/tex/context/base/mkii/unic-002.mkii
deleted file mode 100644
index 906975f8691..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/unic-002.mkii
+++ /dev/null
@@ -1,104 +0,0 @@
-%D \module
-%D [ file=unic-002,
-%D version=2006.08.02,
-%D title=\CONTEXT\ \UNICODE\ Macros,
-%D subtitle=Vector 2,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 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
- \textcircumflex \or
- \textcaron \else
- \ifcase\numexpr#1-216\relax
- \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/mkii/unic-003.mkii b/Master/texmf-dist/tex/context/base/mkii/unic-003.mkii
deleted file mode 100644
index 91512ea546d..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/unic-003.mkii
+++ /dev/null
@@ -1,147 +0,0 @@
-%D \module
-%D [ file=unic-003,
-%D version=2005.01.26,
-%D title=\CONTEXT\ \UNICODE\ Macros,
-%D subtitle=Vector 3,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 3
- \ifcase\numexpr#1-126\relax
- % special greek
- \strippedcsname \greekquestionmark \or
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or
- \strippedcsname \greektonos \or
- \strippedcsname \greekdialytikatonos \or
- \strippedcsname \greekAlphatonos \or
- \strippedcsname \greekanoteleia \or
- \strippedcsname \greekEpsilontonos \or
- \strippedcsname \greekEtatonos \or
- \strippedcsname \greekIotatonos \or
- \strippedcsname \unknownchar \or
- \strippedcsname \greekOmicrontonos \or
- \strippedcsname \unknownchar \or
- \strippedcsname \greekUpsilontonos \or
- \strippedcsname \greekOmegatonos \or
- \strippedcsname \greekiotadialytikatonos \or
- % normal greek
- \strippedcsname \greekAlpha \or
- \strippedcsname \greekBeta \or
- \strippedcsname \greekGamma \or
- \strippedcsname \greekDelta \or
- \strippedcsname \greekEpsilon \or
- \strippedcsname \greekZeta \or
- \strippedcsname \greekEta \or
- \strippedcsname \greekTheta \or
- \strippedcsname \greekIota \or
- \strippedcsname \greekKappa \or
- \strippedcsname \greekLambda \or
- \strippedcsname \greekMu \or
- \strippedcsname \greekNu \or
- \strippedcsname \greekXi \or
- \strippedcsname \greekOmicron \or
- \strippedcsname \greekPi \or
- \strippedcsname \greekRho \or
- \strippedcsname \unknownchar \or
- \strippedcsname \greekSigma \or
- \strippedcsname \greekTau \or
- \strippedcsname \greekUpsilon \or
- \strippedcsname \greekPhi \or
- \strippedcsname \greekChi \or
- \strippedcsname \greekPsi \or
- \strippedcsname \greekOmega \or
- % special greek
- \strippedcsname \greekIotadialytika \or
- \strippedcsname \greekUpsilondialytika \or
- \strippedcsname \greekalphatonos \or
- \strippedcsname \greekepsilontonos \or
- \strippedcsname \greeketatonos \or
- \strippedcsname \greekiotatonos \or
- \strippedcsname \greekupsilondialytikatonos \or
- % normal greek
- \strippedcsname \greekalpha \or
- \strippedcsname \greekbeta \or
- \strippedcsname \greekgamma \or
- \strippedcsname \greekdelta \or
- \strippedcsname \greekepsilon \or
- \strippedcsname \greekzeta \or
- \strippedcsname \greeketa \or
- \strippedcsname \greektheta \or
- \strippedcsname \greekiota \or
- \strippedcsname \greekkappa \or
- \strippedcsname \greeklambda \or
- \strippedcsname \greekmu \or
- \strippedcsname \greeknu \or
- \strippedcsname \greekxi \or
- \strippedcsname \greekomicron \or
- \strippedcsname \greekpi \or
- \strippedcsname \greekrho \or
- \strippedcsname \greekfinalsigma \or
- \strippedcsname \greeksigma \or
- \strippedcsname \greektau \or
- \strippedcsname \greekupsilon \or
- \strippedcsname \greekphi \or
- \strippedcsname \greekchi \or
- \strippedcsname \greekpsi \or
- \strippedcsname \greekomega \or
- % special greek
- \strippedcsname \greekiotadialytika \or
- \strippedcsname \greekupsilondialytika \or
- \strippedcsname \greekomicrontonos \or
- \strippedcsname \greekupsilontonos \or
- \strippedcsname \greekomegatonos \or
- \strippedcsname \unknownchar \or
- \strippedcsname \greekbetaalt \or
- \strippedcsname \greekthetaalt \or
- \strippedcsname \unknownchar \or % upsilon hook
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or
- \strippedcsname \greekphialt \or
- \strippedcsname \greekpialt \or
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or % Sampi
- \strippedcsname \unknownchar \or % sampi
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or % kappa alt
- \strippedcsname \greekrhoalt \or
- \strippedcsname \greeksigmalunate \or
- \strippedcsname \unknownchar \or
- \strippedcsname \unknownchar \or
- \strippedcsname \greekepsilonalt \else
- \strippedcsname \unknownchar
- \fi
-\stopunicodevector
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/unic-004.mkii b/Master/texmf-dist/tex/context/base/mkii/unic-004.mkii
deleted file mode 100644
index 7b413cdb91f..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/unic-004.mkii
+++ /dev/null
@@ -1,291 +0,0 @@
-%D \module
-%D [ file=unic-004,
-%D version=2005.01.27,
-%D title=\CONTEXT\ \UNICODE\ Macros,
-%D subtitle=Vector 4,
-%D author=Mikael Persson \& Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 4
- \expandafter\strippedcsname
- \ifcase\numexpr#1\relax
- \cyrillicEgrave \or % 04-00 \uchar0{200} aswell
- \cyrillicYO \or % 04-01 Capital YO (or IO)
- \cyrillicDJE \or % 04-02
- \cyrillicGJE \or % 04-03 not in enco-uc.tex
- \cyrillicIE \or % 04-04 Ukrainian IE
- \cyrillicDZE \or % 04-05
- \cyrillicII \or % 04-06 Byelorussian-ukrainian I
- \cyrillicYI \or % 04-07
- \cyrillicJE \or % 04-08 same letter as latin J?
- \cyrillicLJE \or % 04-09
- \cyrillicNJE \or % 04-0A
- \cyrillicTSHE \or % 04-0B
- \cyrillicKJE \or % 04-0C
- \cyrillicIgrave \or % 04-0D I with grave
- \cyrillicUSHRT \or % 04-0E
- \cyrillicDZHE \or % 04-0F
- \cyrillicA \or % 04-10
- \cyrillicB \or
- \cyrillicV \or
- \cyrillicG \or
- \cyrillicD \or
- \cyrillicE \or
- \cyrillicZH \or
- \cyrillicZ \or
- \cyrillicI \or
- \cyrillicISHRT \or
- \cyrillicK \or
- \cyrillicL \or
- \cyrillicM \or
- \cyrillicN \or
- \cyrillicO \or
- \cyrillicP \or
- \cyrillicR \or
- \cyrillicS \or
- \cyrillicT \or
- \cyrillicU \or
- \cyrillicF \or
- \cyrillicH \or
- \cyrillicC \or
- \cyrillicCH \or
- \cyrillicSH \or
- \cyrillicSHCH \or
- \cyrillicHRDSN \or
- \cyrillicERY \or
- \cyrillicSFTSN \or
- \cyrillicEREV \or
- \cyrillicYU \or
- \cyrillicYA \or
- \cyrillica \or % 04-30
- \cyrillicb \or
- \cyrillicv \or
- \cyrillicg \or
- \cyrillicd \or
- \cyrillice \or
- \cyrilliczh \or
- \cyrillicz \or
- \cyrillici \or
- \cyrillicishrt \or
- \cyrillick \or
- \cyrillicl \or
- \cyrillicm \or
- \cyrillicn \or
- \cyrillico \or
- \cyrillicp \or
- \cyrillicr \or
- \cyrillics \or
- \cyrillict \or
- \cyrillicu \or
- \cyrillicf \or
- \cyrillich \or
- \cyrillicc \or
- \cyrillicch \or
- \cyrillicsh \or
- \cyrillicshch \or
- \cyrillichrdsn \or
- \cyrillicery \or
- \cyrillicsftsn \or
- \cyrillicerev \or
- \cyrillicyu \or
- \cyrillicya \or % 044F
- \cyrillicegrave \or % 0450 not i enco-uc.tex but same as \uchar0{232}
- \cyrillicyo \or % 0451 small yo (or io)
- \cyrillicdje \or % 0452 serbian letter
- \cyrillicgje \or % 0453 macedonian letter not in enco-uc.tex
- \cyrillicie \or % 0454 ukrainian ie
- \cyrillicdze \or % 0455 macedonian zelo
- \cyrillicii \or % 0456 byelorussian-ukrainian i.
- \cyrillicyi \or % 0457
- \cyrillicje \or % 0458 not in enco-uc.tex same as latin j?
- \cyrilliclje \or % 0459
- \cyrillicnje \or % 045A
- \cyrillictshe \or % 045B
- \cyrillickje \or % 045C macedonian, not in enco-uc.tex
- \cyrillicigrave \or % 045D macedonian, cyr i with grave not in enco-uc.tex
- \cyrillicushrt \or % 045E
- \cyrillicdzhe \or % 045F
- \cyrillicOMEGA \or % 0460 Omega not in enco-uc.tex
- \cyrillicomega \or % 0461 omega not in enco-uc.tex
- \cyrillicYAT \or % 0462 Yat not in enco-uc.tex
- \cyrillicyat \or % 0463 Yat not in enco-uc.tex
- \cyrillicEiotified \or % 0464 iotified E not in enco-uc.tex
- \cyrilliceiotified \or % 0465 iotified e not in enco-uc.tex
- \cyrillicLITTLEYUS \or % 0466 Little Yus not in enco-enc.tex
- \cyrilliclittleyus \or % 0467 Little yus not in enco-enc.tex
- \cyrillicLITTLEYUSiotified \or % 0468 Little Yus iotified not in enco-enc.tex
- \cyrilliclittleyusiotified \or % 0469 Little yus iotified not in enco-enc.tex
- \cyrillicBIGYUS \or % 046A Big Yus not in enco-enc.tex
- \cyrillicbigyus \or % 046B Big yus not in enco-enc.tex
- \cyrillicBIGYUSiotified \or % 046C Big Yus iotified not in enco-enc.tex
- \cyrillicbigyusiotified \or % 046D Big yus iotified not in enco-enc.tex
- \cyrillicKSI \or % 046E Ksi not in enco-enc.tex
- \cyrillicksi \or % 046F ksi not in enco-enc.tex
- \cyrillicPSI \or % 0470 Psi not in enco-enc.tex
- \cyrillicpsi \or % 0471 psi not in enco-enc.tex
- \cyrillicFITA \or % 0472 Fita not in enco-enc.tex
- \cyrillicfita \or % 0473 fita not in enco-enc.tex
- \cyrillicIZHITSA \or % 0474 Izhitsa not in enco-enc.tex
- \cyrillicizhitsa \or % 0475 izhitsa not in enco-enc.tex
- \cyrillicIZHITSAdoublegrave \or % 0476 Izhitsa double grave not in enco-enc.tex
- \cyrillicizhitsadoublegrave \or % 0477 izhitsa double grave not in enco-enc.tex
- \cyrillicUK \or % 0478 UK not in enco-enc.tex
- \cyrillicuk \or % 0479 uk not in enco-enc.tex
- \cyrillicOMEGAround \or % 047A Round Omega not in enco-enc.tex
- \cyrillicomegaround \or % 047B Round omega not in enco-enc.tex
- \cyrillicOMEGAtitlo \or % 047C Omega with titlo not in enco-enc.tex
- \cyrillicomegatitlo \or % 047D omega with titlo not in enco-enc.tex
- \cyrillicOT \or % 047E OT not in enco-enc.tex
- \cyrillicot \or % 047F ot not in enco-enc.tex
- \cyrillicKOPPA \or % 0480 KOPPA not in enco-enc.tex
- \cyrillickoppa \or % 0481 koppa not in enco-enc.tex
- \unknownchar \or % 0482
- \cyrillicTITLO \or % 0483 TITLO not in enco-enc.tex
- \cyrillicPALATALIZATION \or % 0484 PALATALIZATION not in enco-enc.tex
- \cyrillicDASIAPNEUMATA \or % 0485 DASIA PNEUMATA not in enco-enc.tex
- \cyrillicPSILIPNEUMATA \or % 0486 PSILI PNEUMATA not in enco-enc.tex
- \unknownchar \or % 0487
- \unknownchar \or % 0488
- \unknownchar \or % 0489
- \cyrillicISHRTtail \or % 048A ISHRT with tail not in enco-enc.tex
- \cyrillicishrttail \or % 048B ishrt with tail not in enco-enc.tex
- \cyrillicSEMISOFT \or % 048C SEMISOFT not in enco-enc.tex
- \cyrillicsemisoft \or % 048D semisoft not in enco-enc.tex
- \cyrillicERtick \or % 048E ER with tick not in enco-enc.tex
- \cyrillicertick \or % 048F er with tick not in enco-enc.tex
- \cyrillicGHEupturn \or % 0490 GHE with upturn not in enco-enc.tex
- \cyrillicgheupturn \or % 0491 ghe with upturn not in enco-enc.tex
- \cyrillicGHEstroke \or % 0492 GHE with stroke not in enco-enc.tex
- \cyrillicghestroke \or % 0493 ghe with stroke not in enco-enc.tex
- \cyrillicGHEmidhook \or % 0494 GHE with middle hook
- \cyrillicghemidhook \or % 0495 ghe with middle hook
- \cyrillicZHEdescender \or % 0496 ZHE with descender
- \cyrilliczhedescender \or % 0497 zhe with descender
- \cyrillicZDSC \or % 0498 ZE with descender
- \cyrilliczdsc \or % 0499 ze with descender
- \cyrillicKADC \or % 049A KA with descender
- \cyrillickadc \or % 049B ka with descender
- \cyrillicKAvertstroke \or % 049C KA with vertical stroke
- \cyrillickavertstroke \or % 049D ka with vertical stroke
- \cyrillicKAstroke \or % 049E KA with stroke
- \cyrillickastroke \or % 049F ka with stroke
- \cyrillicKAbashkir \or % 04A0 KA bashkir
- \cyrillickabashkir \or % 04A1 ka bashkir
- \cyrillicENDC \or % 04A2 EN with descender
- \cyrillicendc \or % 04A3 en with descender
- \cyrillicENGHE \or % 04A4 EN GHE
- \cyrillicenghe \or % 04A5 en ghe
- \cyrillicPEmidhook \or % 04A6 PE with middle hook
- \cyrillicpemidhook \or % 04A7 pe with middle hook
- \cyrillicHA \or % 04A8 Abkhasian HA
- \cyrillicha \or % 04A9 Abkhasian ha
- \cyrillicSDSC \or % 04AA S with descender
- \cyrilliccdsc \or % 04AB s with descender
- \cyrillicTEDC \or % 04AC TE with descender
- \cyrillictedc \or % 04AD te with descender
- \cyrillicYstr \or % 04AE Y straight
- \cyrillicystr \or % 04AF y straight
- \cyrillicYstrstroke \or % 04B0 Y straight with stroke
- \cyrillicystrstroke \or % 04B1 y straight with stroke
- \cyrillicHADC \or % 04B2 HA with descender
- \cyrillichadc \or % 04B3 ha with descender
- \cyrillicTETSE \or % 04B4 TE TSE
- \cyrillictetse \or % 04B5 te tse
- \cyrillicCHEDC \or % 04B6 CHE with descender
- \cyrillicchedc \or % 04B7 che with descender
- \cyrillicCHEvertstroke \or % 04B8 CHE with vertical stroke
- \cyrillicchevertstroke \or % 04B9 che with vertical stroke
- \cyrillicSHHA \or % 04BA SHHA
- \cyrillicshha \or % 04BB
- \cyrillicCHEabkhasian \or % 04BC Abkhasian CHE
- \cyrilliccheabkhasian \or % 04BD Abkhasian che
- \cyrillicCHEDCabkhasian \or % 04BE Abkhasian CHE with descender
- \cyrillicchedcabkhasian \or % 04BF Abkhasian che with descender
- \cyrillicPALOCHKA \or % 04C0 PALOCHKA
- \cyrillicZHEbreve \or % 04C1 ZHE with breve
- \cyrilliczhebreve \or % 04C2 zhe with breve
- \cyrillicKAhook \or % 04C3 KA with hook
- \cyrillickahook \or % 04C4 ka with hook
- \cyrillicELtail \or % 04C5 EL with tail
- \cyrilliceltail \or % 04C6 el with tail
- \cyrillicENhook \or % 04C7 EN with hook
- \cyrillicenhook \or % 04C8 en with hook
- \cyrillicENtail \or % 04C9 EN with tail
- \cyrillicentail \or % 04CA en with tail
- \cyrillicCHEkhakassian \or % 04CB Khakassian CHE
- \cyrillicchekhakassian \or % 04CC Khakassian che
- \cyrillicEMtail \or % 04CD EM with tail
- \cyrillicemtail \or % 04CE em with tail
- \unknownchar \or % 04CF Added to fix off-by-1 error
- \cyrillicAbreve \or % 04D0 A with breve (\uchar1{2})
- \cyrillicabreve \or % 04D1 a with breve (\uchar1{3})
- \cyrillicAdiaeresis \or % 04D2 A with diaeresis (\uchar0{196})
- \cyrillicadiaeresis \or % 04D3 a with diaeresis (\uchar0{228})
- \cyrillicAE \or % 04D4 AE (\uchar0{198})
- \cyrillicae \or % 04D5 ae (\uchar0{230})
- \cyrillicEbreve \or % 04D6
- \cyrillicebreve \or % 04D7
- \cyrillicSCHWA \or % 04D8
- \cyrillicschwa \or % 04D9
- \cyrillicSCHWAdiaeresis \or % 04DA
- \cyrillicschwadiaeresis \or % 04DB
- \cyrillicZHEdiaeresis \or % 04DC
- \cyrilliczhediaeresis \or % 04DD
- \cyrillicZEdiaeresis \or % 04DE
- \cyrilliczediaeresis \or % 04DF
- \cyrillicDZEabkhasian \or % 04E0
- \cyrillicdzeabkhasian \or % 04E1
- \cyrillicImacron \or % 04E2
- \cyrillicimacron \or % 04E3
- \cyrillicIdiaeresis \or % 04E4
- \cyrillicidiaeresis \or % 04E5
- \cyrillicOdiaeresis \or % 04E6
- \cyrillicodiaeresis \or % 04E7
- \cyrillicObarred \or % 04E8
- \cyrillicobarred \or % 04E9
- \cyrillicObarreddiaeresis \or % 04EA
- \cyrillicobarreddiaeresis \or % 04EB
- \cyrillicEdiaeresis \or % 04EC
- \cyrillicediaeresis \or % 04ED
- \cyrillicUmacron \or % 04EE
- \cyrillicumacron \or % 04EF
- \cyrillicUdiaeresis \or % 04F0
- \cyrillicudiaeresis \or % 04F1
- \cyrillicUdoubleacute \or % 04F2
- \cyrillicudoubleacute \or % 04F3
- \cyrillicCHEdiaeresis \or % 04F4
- \cyrillicchediaeresis \or % 04F5
- \unknownchar \or % 04F6
- \unknownchar \or % 04F7
- \cyrillicYERUdiaeresis \or % 04F8
- \cyrillicyerudiaeresis \else
- \unknownchar
- \fi
-\stopunicodevector
-
-\protect \endinput
-
-% \enableregime[utf]
-%
-% \definetypeface [russian] [rm] [serif] [computer-modern] [default] [encoding=t2a]
-%
-% \setupbodyfont[russian]
-%
-% \starttext
-%
-% \startbuffer
-% Мама и Папа % Some russian characters
-% \stopbuffer
-%
-% \utfunicodetracer=0 \blank \getbuffer \blank
-% \utfunicodetracer=2 \blank \getbuffer \blank
-% \utfunicodetracer=7 \blank \getbuffer \blank
-%
-% \stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkii/unic-005.mkii b/Master/texmf-dist/tex/context/base/mkii/unic-005.mkii
deleted file mode 100644
index e21edb20584..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/unic-005.mkii
+++ /dev/null
@@ -1,50 +0,0 @@
-%D \module
-%D [ file=unic-005,
-%D version=2005.01.27,
-%D title=\CONTEXT\ \UNICODE\ Macros,
-%D subtitle=Vector 5,
-%D author=Adam Lindsay,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 5
- \expandafter\strippedcsname
- \ifcase\numexpr#1-208\relax % Was 224 - changed to fix off-by-16 error
- \hebrewAlef \or % 05D0
- \hebrewBet \or
- \hebrewGimel \or
- \hebrewDalet \or
- \hebrewHe \or
- \hebrewVav \or
- \hebrewZayin \or
- \hebrewHet \or
- \hebrewTet \or
- \hebrewYod \or
- \hebrewKaffinal \or
- \hebrewKaf \or
- \hebrewLamed \or
- \hebrewMemfinal \or
- \hebrewMem \or
- \hebrewNunfinal \or
- \hebrewNun \or
- \hebrewSamekh \or
- \hebrewAyin \or
- \hebrewPefinal \or
- \hebrewPe \or
- \hebrewTsadifinal \or
- \hebrewTsadi \or
- \hebrewQof \or
- \hebrewResh \or
- \hebrewShin \or
- \hebrewTav \else % 05EA
- \unknownchar
- \fi
-\stopunicodevector
-
-\protect \endinput \ No newline at end of file
diff --git a/Master/texmf-dist/tex/context/base/mkii/unic-030.mkii b/Master/texmf-dist/tex/context/base/mkii/unic-030.mkii
deleted file mode 100644
index 0065a738a3b..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/unic-030.mkii
+++ /dev/null
@@ -1,113 +0,0 @@
-%D \module
-%D [ file=unic-030,
-%D version=2004.11.18,
-%D title=\CONTEXT\ \UNICODE\ Macros,
-%D subtitle=Vector 30,
-%D author=Adam Lindsay,
-%D date=\currentdate,
-%D copyright={Adam Lindsay \& Hans Hagen}]
-%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 30
- \expandafter\strippedcsname
- \ifcase\numexpr#1-160\relax
- \Adotbelow \or
- \adotbelow \or
- \Ahook \or
- \ahook \or
- \Acircumflexacute \or
- \acircumflexacute \or
- \Acircumflexgrave \or
- \acircumflexgrave \or
- \Acircumflexhook \or
- \acircumflexhook \or
- \Acircumflextilde \or
- \acircumflextilde \or
- \Acircumflexdotbelow \or
- \acircumflexdotbelow \or
- \Abreveacute \or
- \abreveacute \or
- \Abrevegrave \or
- \abrevegrave \or
- \Abrevehook \or
- \abrevehook \or
- \Abrevetilde \or
- \abrevetilde \or
- \Abrevedotbelow \or
- \abrevedotbelow \or
- \Edotbelow \or
- \edotbelow \or
- \Ehook \or
- \ehook \or
- \Etilde \or
- \etilde \or
- \Ecircumflexacute \or
- \ecircumflexacute \or
- \Ecircumflexgrave \or
- \ecircumflexgrave \or
- \Ecircumflexhook \or
- \ecircumflexhook \or
- \Ecircumflextilde \or
- \ecircumflextilde \or
- \Ecircumflexdotbelow \or
- \ecircumflexdotbelow \or
- \Ihook \or
- \ihook \or
- \Idotbelow \or
- \idotbelow \or
- \Odotbelow \or
- \odotbelow \or
- \Ohook \or
- \ohook \or
- \Ocircumflexacute \or
- \ocircumflexacute \or
- \Ocircumflexgrave \or
- \ocircumflexgrave \or
- \Ocircumflexhook \or
- \ocircumflexhook \or
- \Ocircumflextilde \or
- \ocircumflextilde \or
- \Ocircumflexdotbelow \or
- \ocircumflexdotbelow \or
- \Ohornacute \or
- \ohornacute \or
- \Ohorngrave \or
- \ohorngrave \or
- \Ohornhook \or
- \ohornhook \or
- \Ohorntilde \or
- \ohorntilde \or
- \Ohorndotbelow \or
- \ohorndotbelow \or
- \Udotbelow \or
- \udotbelow \or
- \Uhook \or
- \uhook \or
- \Uhornacute \or
- \uhornacute \or
- \Uhorngrave \or
- \uhorngrave \or
- \Uhornhook \or
- \uhornhook \or
- \Uhorntilde \or
- \uhorntilde \or
- \Uhorndotbelow \or
- \uhorndotbelow \or
- \Ygrave \or
- \ygrave \or
- \Ydotbelow \or
- \ydotbelow \or
- \Yhook \or
- \yhook \or
- \Ytilde \or
- \ytilde \else
- \unknownchar
- \fi
-\stopunicodevector
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/unic-031.mkii b/Master/texmf-dist/tex/context/base/mkii/unic-031.mkii
deleted file mode 100644
index 68d1633249b..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/unic-031.mkii
+++ /dev/null
@@ -1,274 +0,0 @@
-%D \module
-%D [ file=unic-031,
-%D version=2005.02.20,
-%D title=\CONTEXT\ \UNICODE\ Macros,
-%D subtitle=Vector 31,
-%D author=Thomas A. Schmitz,
-%D date=\currentdate,
-%D copyright={Thomas A. Schmitz}]
-
-\unprotect
-
-\startunicodevector 31
- \expandafter\strippedcsname
- \ifcase\numexpr#1\relax
- \greekalphapsili \or %1f00
- \greekalphadasia \or
- \greekalphapsilivaria \or
- \greekalphadasiavaria \or
- \greekalphapsilitonos \or
- \greekalphadasiatonos \or
- \greekalphapsiliperispomeni \or
- \greekalphadasiaperispomeni \or
- \greekAlphapsili \or
- \greekAlphadasia \or
- \greekAlphapsilivaria \or
- \greekAlphadasiavaria \or
- \greekAlphapsilitonos \or
- \greekAlphadasiatonos \or
- \greekAlphapsiliperispomeni \or
- \greekAlphadasiaperispomeni \or
- \greekepsilonpsili \or %1f10
- \greekepsilondasia \or
- \greekepsilonpsilivaria \or
- \greekepsilondasiavaria \or
- \greekepsilonpsilitonos \or
- \greekepsilondasiatonos \or
- \unknownchar \or
- \unknownchar \or
- \greekEpsilonpsili \or
- \greekEpsilondasia \or
- \greekEpsilonpsilivaria \or
- \greekEpsilondasiavaria \or
- \greekEpsilonpsilitonos \or
- \greekEpsilondasiatonos \or
- \unknownchar \or
- \unknownchar \or
- \greeketapsili \or %1f20
- \greeketadasia \or
- \greeketapsilivaria \or
- \greeketadasiavaria \or
- \greeketapsilitonos \or
- \greeketadasiatonos \or
- \greeketapsiliperispomeni \or
- \greeketadasiaperispomeni \or
- \greekEtapsili \or
- \greekEtadasia \or
- \greekEtapsilivaria \or
- \greekEtadasiavaria \or
- \greekEtapsilitonos \or
- \greekEtadasiatonos \or
- \greekEtapsiliperispomeni \or
- \greekEtadasiaperispomeni \or
- \greekiotapsili \or %1f30
- \greekiotadasia \or
- \greekiotapsilivaria \or
- \greekiotadasiavaria \or
- \greekiotapsilitonos \or
- \greekiotadasiatonos \or
- \greekiotapsiliperispomeni \or
- \greekiotadasiaperispomeni \or
- \greekIotapsili \or
- \greekIotadasia \or
- \greekIotapsilivaria \or
- \greekIotadasiavaria \or
- \greekIotapsilitonos \or
- \greekIotadasiatonos \or
- \greekIotapsiliperispomeni \or
- \greekIotadasiaperispomeni \or
- \greekomicronpsili \or %1f40
- \greekomicrondasia \or
- \greekomicronpsilivaria \or
- \greekomicrondasiavaria \or
- \greekomicronpsilitonos \or
- \greekomicrondasiatonos \or
- \unknownchar \or
- \unknownchar \or
- \greekOmicronpsili \or
- \greekOmicrondasia \or
- \greekOmicronpsilivaria \or
- \greekOmicrondasiavaria \or
- \greekOmicronpsilitonos \or
- \greekOmicrondasiatonos \or
- \unknownchar \or
- \unknownchar \or
- \greekupsilonpsili \or %1f50
- \greekupsilondasia \or
- \greekupsilonpsilivaria \or
- \greekupsilondasiavaria \or
- \greekupsilonpsilitonos \or
- \greekupsilondasiatonos \or
- \greekupsilonpsiliperispomeni \or
- \greekupsilondasiaperispomeni \or
- \unknownchar \or
- \greekUpsilondasia \or
- \unknownchar \or
- \greekUpsilondasiavaria \or
- \unknownchar \or
- \greekUpsilondasiatonos \or
- \unknownchar \or
- \greekUpsilondasiaperispomeni \or
- \greekomegapsili \or %1f60
- \greekomegadasia \or
- \greekomegapsilivaria \or
- \greekomegadasiavaria \or
- \greekomegapsilitonos \or
- \greekomegadasiatonos \or
- \greekomegapsiliperispomeni \or
- \greekomegadasiaperispomeni \or
- \greekOmegapsili \or
- \greekOmegadasia \or
- \greekOmegapsilivaria \or
- \greekOmegadasiavaria \or
- \greekOmegapsilitonos \or
- \greekOmegadasiatonos \or
- \greekOmegapsiliperispomeni \or
- \greekOmegadasiaperispomeni \or
- \greekalphavaria \or %1f70
- \greekalphaoxia \or
- \greekepsilonvaria \or
- \greekepsilonoxia \or
- \greeketavaria \or
- \greeketaoxia \or
- \greekiotavaria \or
- \greekiotaoxia \or
- \greekomicronvaria \or
- \greekomicronoxia \or
- \greekupsilonvaria \or
- \greekupsilonoxia \or
- \greekomegavaria \or
- \greekomegaoxia \or
- \unknownchar \or
- \unknownchar \or
- \greekalphaiotasubpsili \or %1f80
- \greekalphaiotasubdasia \or
- \greekalphaiotasubpsilivaria \or
- \greekalphaiotasubdasiavaria \or
- \greekalphaiotasubpsilitonos \or
- \greekalphaiotasubdasiatonos \or
- \greekalphaiotasubpsiliperispomeni \or
- \greekalphaiotasubdasiaperispomeni \or
- \greekAlphaiotasubpsili \or
- \greekAlphaiotasubdasia \or
- \greekAlphaiotasubpsilivaria \or
- \greekAlphaiotasubdasiavaria \or
- \greekAlphaiotasubpsilitonos \or
- \greekAlphaiotasubdasiatonos \or
- \greekAlphaiotasubpsiliperispomeni \or
- \greekAlphaiotasubdasiaperispomeni \or
- \greeketaiotasubpsili \or %1f90
- \greeketaiotasubdasia \or
- \greeketaiotasubpsilivaria \or
- \greeketaiotasubdasiavaria \or
- \greeketaiotasubpsilitonos \or
- \greeketaiotasubdasiatonos \or
- \greeketaiotasubpsiliperispomeni \or
- \greeketaiotasubdasiaperispomeni \or
- \greekEtaiotasubpsili \or
- \greekEtaiotasubdasia \or
- \greekEtaiotasubpsilivaria \or
- \greekEtaiotasubdasiavaria \or
- \greekEtaiotasubpsilitonos \or
- \greekEtaiotasubdasiatonos \or
- \greekEtaiotasubpsiliperispomeni \or
- \greekEtaiotasubdasiaperispomeni \or
- \greekomegaiotasubpsili \or %1fa0
- \greekomegaiotasubdasia \or
- \greekomegaiotasubpsilivaria \or
- \greekomegaiotasubdasiavaria \or
- \greekomegaiotasubpsilitonos \or
- \greekomegaiotasubdasiatonos \or
- \greekomegaiotasubpsiliperispomeni \or
- \greekomegaiotasubdasiaperispomeni \or
- \greekOmegaiotasubpsili \or
- \greekOmegaiotasubdasia \or
- \greekOmegaiotasubpsilivaria \or
- \greekOmegaiotasubdasiavaria \or
- \greekOmegaiotasubpsilitonos \or
- \greekOmegaiotasubdasiatonos \or
- \greekOmegaiotasubpsiliperispomeni \or
- \greekOmegaiotasubdasiaperispomeni \or
- \greekalphavrachy \or %1fb0
- \greekalphamacron \or
- \greekalphaiotasubvaria \or
- \greekalphaiotasub \or
- \greekalphaiotasubtonos \or
- \unknownchar \or
- \greekalphaperispomeni \or
- \greekalphaiotasubperispomeni \or
- \greekAlphavrachy \or
- \greekAlphamacron \or
- \greekAlphavaria \or
- \greekAlphaoxia \or
- \greekAlphaiotasub \or
- \greekCoronis \or
- \greekprosgegrammeni \or
- \greekpsili \or
- \greekperispomeni \or %1fc0
- \greekdialytikaperispomeni \or
- \greeketaiotasubvaria \or
- \greeketaiotasub \or
- \greeketaiotasubtonos \or
- \unknownchar \or
- \greeketaperispomeni \or
- \greeketaiotasubperispomeni \or
- \greekEpsilonvaria \or
- \greekEpsilonoxia \or
- \greekEtavaria \or
- \greekEtaoxia \or
- \greekEtaiotasub \or
- \greekpsilivaria \or
- \greekpsilitonos \or
- \greekpsiliperispomeni \or
- \greekiotavrachy \or %1fd0
- \greekiotamacron \or
- \greekiotadialytikavaria \or
- \greekiotadialytikatonos \or
- \unknownchar \or
- \unknownchar \or
- \greekiotaperispomeni \or
- \greekiotadialytikaperispomeni \or
- \greekIotavrachy \or
- \greekIotamacron \or
- \greekIotavaria \or
- \greekIotaoxia \or
- \unknownchar \or
- \greekdasiavaria \or
- \greekdasiatonos \or
- \greekdasiaperispomeni \or
- \greekupsilonvrachy \or %1fe0
- \greekupsilonmacron \or
- \greekupsilondialytikavaria \or
- \greekupsilondialytikatonos \or
- \greekrhopsili \or
- \greekrhodasia \or
- \greekupsilonperispomeni \or
- \greekupsilondialytikaperispomeni \or
- \greekUpsilonvrachy \or
- \greekUpsilonmacron \or
- \greekUpsilonvaria \or
- \greekUpsilonoxia \or
- \greekRhodasia \or
- \greekdialytikavaria \or
- \greekdialytikaoxia \or
- \greekvaria \or
- \unknownchar \or %1ff0
- \unknownchar \or
- \greekomegaiotasubvaria \or
- \greekomegaiotasub \or
- \greekomegaiotasubtonos \or
- \unknownchar \or
- \greekomegaperispomeni \or
- \greekomegaiotasubperispomeni \or
- \greekOmicronvaria \or
- \greekOmicronoxia \or
- \greekOmegavaria \or
- \greekOmegaoxia \or
- \greekOmegaiotasub \or
- \greekoxia \or
- \greekdasia \else
- \unknownchar
- \fi
-\stopunicodevector
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/unic-032.mkii b/Master/texmf-dist/tex/context/base/mkii/unic-032.mkii
deleted file mode 100644
index 6bd176c8071..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/unic-032.mkii
+++ /dev/null
@@ -1,278 +0,0 @@
-%D \module
-%D [ file=unic-032,
-%D version=2006.03.30,
-%D title=\CONTEXT\ \UNICODE\ Macros,
-%D subtitle=Vector 32,
-%D author={Hans Hagen \& Taco Hoekwater},
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 32
- \expandafter\strippedcsname
- \ifcase\numexpr#1\relax
- \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/mkii/unic-033.mkii b/Master/texmf-dist/tex/context/base/mkii/unic-033.mkii
deleted file mode 100644
index ad7a3b11ff0..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/unic-033.mkii
+++ /dev/null
@@ -1,275 +0,0 @@
-%D \module
-%D [ file=unic-033,
-%D version=2006.03.29,
-%D title=\CONTEXT\ \UNICODE\ Macros,
-%D subtitle=Vector 33,
-%D author={Nikolai Weibull \& Hans Hagen \& Taco Hoekwater},
-%D date=\currentdate,
-%D copyright={Nikolai Weibull \& Hans Hagen}]
-
-\unprotect
-
-\startunicodevector 33
- \expandafter\strippedcsname
- \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
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/unic-034.mkii b/Master/texmf-dist/tex/context/base/mkii/unic-034.mkii
deleted file mode 100644
index f998c517070..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/unic-034.mkii
+++ /dev/null
@@ -1,274 +0,0 @@
-%D \module
-%D [ file=unic-034,
-%D version=2005.06.11,
-%D title=\CONTEXT\ \UNICODE\ Macros,
-%D subtitle=Vector 34,
-%D author=Nikolai Weibull,
-%D date=\currentdate,
-%D copyright={Nikolai Weibull \& Hans Hagen}]
-
-\unprotect
-
-\startunicodevector 34
- \expandafter\strippedcsname
- \ifcase\numexpr#1\relax
- \forall \or % FOR ALL
- \complement \or % COMPLEMENT
- \partial \or % PARTIAL DIFFERENTIAL
- \exists \or % THERE EXISTS
- \nexists \or % THERE DOES NOT EXIST
- \emptyset \or % EMPTY SET
- \vartriangle \or % INCREMENT
- \nabla \or % NABLA
- \unic@in \or % ELEMENT OF
- \unic@nin \or % NOT AN ELEMENT OF
- \unknownchar \or % SMALL ELEMENT OF
- \ni \or % CONTAINS AS MEMBER
- \unic@nni \or % DOES NOT CONTAIN AS MEMBER
- \unknownchar \or % SMALL CONTAINS AS MEMBER
- \QED \or % END OF PROOF
- \prod \or % N-ARY PRODUCT
- \coprod \or % N-ARY COPRODUCT
- \sum \or % N-ARY SUMMATION
- \unic@minus \or % MINUS SIGN
- \mp \or % MINUS-OR-PLUS SIGN
- \dotplus \or % DOT PLUS
- \unic@divisionslash \or % DIVISION SLASH
- \setminus \or % SET MINUS
- \ast \or % ASTERISK OPERATOR
- \circ \or % RING OPERATOR
- \bullet \or % BULLET OPERATOR
- \unic@sqrt \or % SQUARE ROOT
- \unic@cubesqrt \or % CUBE ROOT
- \unic@fourthsqrt \or % FOURTH ROOT
- \propto \or % PROPORTIONAL TO
- \infty \or % INFINITY
- \unknownchar \or % RIGHT ANGLE
- \angle \or % ANGLE
- \measuredangle \or % MEASURED ANGLE
- \sphericalangle \or % SPHERICAL ANGLE
- \unic@divides \or % DIVIDES
- \unic@ndivides \or % DOES NOT DIVIDE
- \parallel \or % PARALLEL TO
- \nparallel \or % NOT PARALLEL TO
- \land \or % LOGICAL AND
- \lor \or % LOGICAL OR
- \unic@cap \or % INTERSECTION
- \cup \or % UNION
- \int \or % INTEGRAL
- \unic@dblint \or % DOUBLE INTEGRAL
- \unic@triint \or % TRIPLE INTEGRAL
- \oint \or % CONTOUR INTEGRAL
- \unknownchar \or % SURFACE INTEGRAL
- \unknownchar \or % VOLUME INTEGRAL
- \unknownchar \or % CLOCKWISE INTEGRAL
- \unknownchar \or % CLOCKWISE CONTOUR INTEGRAL
- \unknownchar \or % ANTICLOCKWISE CONTOUR INTEGRAL
- \therefore \or % THEREFORE
- \because \or % BECAUSE
- \unic@ratio \or % RATIO
- \unic@proportion \or % PROPORTION
- \unknownchar \or % DOT MINUS
- \unic@excess \or % EXCESS
- \unic@geompropr \or % GEOMETRIC PROPORTION
- \unic@homothetic \or % HOMOTHETIC
- \sim \or % TILDE OPERATOR
- \backsim \or % REVERSED TILDE
- \unknownchar \or % INVERTED LAZY S
- \unknownchar \or % SINE WAVE
- \wr \or % WREATH PRODUCT
- \nsim \or % NOT TILDE
- \eqsim \or % MINUS TILDE
- \simeq \or % ASYMPTOTICALLY EQUAL TO
- \nsimeq \or % NOT ASYMPTOTICALLY EQUAL TO
- \approxeq \or % APPROXIMATELY EQUAL TO
- \unic@cong \or % APPROXIMATELY BUT NOT ACTUALLY EQUAL TO
- \unic@napproxeq \or % NEITHER APPROXIMATELY NOR ACTUALLY EQUAL TO
- \approx \or % ALMOST EQUAL TO
- \unic@napprox \or % NOT ALMOST EQUAL TO
- \approxeq \or % ALMOST EQUAL OR EQUAL TO
- \unknownchar \or % TRIPLE TILDE
- \unknownchar \or % ALL EQUAL TO
- \asymp \or % EQUIVALENT TO
- \Bumpeq \or % GEOMETRICALLY EQUIVALENT TO
- \bumpeq \or % DIFFERENCE BETWEEN
- \unic@doteq \or % APPROACHES THE LIMIT
- \doteqdot \or % GEOMETRICALLY EQUAL TO
- \fallingdotseq \or % APPROXIMATELY EQUAL TO OR THE IMAGE OF
- \risingdotseq \or % IMAGE OF OR APPROXIMATELY EQUAL TO
- \unknownchar \or % COLON EQUALS
- \unknownchar \or % EQUALS COLON
- \eqcirc \or % RING IN EQUAL TO
- \circeq \or % RING EQUAL TO
- \unic@correspondsto \or % CORRESPONDS TO
- \unic@estimates \or % ESTIMATES
- \unic@equiangularto \or % EQUIANGULAR TO
- \unic@stareq \or % STAR EQUALS
- \unic@triangleq \or % DELTA EQUAL TO
- \unic@eqbydef \or % EQUAL TO BY DEFINITION
- \unic@measuredby \or % MEASURED BY
- \unic@questionedeq \or % QUESTIONED EQUAL TO
- \neq \or % NOT EQUAL TO
- \equiv \or % IDENTICAL TO
- \unic@nequiv \or % NOT IDENTICAL TO
- \unknownchar \or % STRICTLY EQUIVALENT TO
- \leq \or % LESS-THAN OR EQUAL TO
- \geq \or % GREATER-THAN OR EQUAL TO
- \leqq \or % LESS-THAN OVER EQUAL TO
- \geqq \or % GREATER-THAN OVER EQUAL TO
- \lneqq \or % LESS-THAN BUT NOT EQUAL TO
- \gneqq \or % GREATER-THAN BUT NOT EQUAL TO
- \ll \or % MUCH LESS-THAN
- \gg \or % MUCH GREATER-THAN
- \between \or % BETWEEN
- \nasymp \or % NOT EQUIVALENT TO
- \nless \or % NOT LESS-THAN
- \ngtr \or % NOT GREATER-THAN
- \nleq \or % NEITHER LESS-THAN NOR EQUAL TO
- \ngeq \or % NEITHER GREATER-THAN NOR EQUAL TO
- \lesssim \or % LESS-THAN OR EQUIVALENT TO
- \gtrsim \or % GREATER-THAN OR EQUIVALENT TO
- \unic@nlesssim \or % NEITHER LESS-THAN NOR EQUIVALENT TO
- \unic@ngtrsim \or % NEITHER GREATER-THAN NOR EQUIVALENT TO
- \lessgtr \or % LESS-THAN OR GREATER-THAN
- \gtrless \or % GREATER-THAN OR LESS-THAN
- \unic@nlessgtr \or % NEITHER LESS-THAN NOR GREATER-THAN
- \unic@ngtrless \or % NEITHER GREATER-THAN NOR LESS-THAN
- \prec \or % PRECEDES
- \succ \or % SUCCEEDS
- \preceq \or % PRECEDES OR EQUAL TO
- \succeq \or % SUCCEEDS OR EQUAL TO
- \precsim \or % PRECEDES OR EQUIVALENT TO
- \succsim \or % SUCCEEDS OR EQUIVALENT TO
- \nprec \or % DOES NOT PRECEDE
- \nsucc \or % DOES NOT SUCCEED
- \subset \or % SUBSET OF
- \supset \or % SUPERSET OF
- \unic@nsubset \or % NOT A SUBSET OF
- \unic@nsupset \or % NOT A SUPERSET OF
- \subseteq \or % SUBSET OF OR EQUAL TO
- \supseteq \or % SUPERSET OF OR EQUAL TO
- \nsubseteq \or % NEITHER A SUBSET OF NOR EQUAL TO
- \nsupseteq \or % NEITHER A SUPERSET OF NOR EQUAL TO
- \subsetneq \or % SUBSET OF WITH NOT EQUAL TO
- \supsetneq \or % SUPERSET OF WITH NOT EQUAL TO
- \unknownchar \or % MULTISET
- \unknownchar \or % MULTISET MULTIPLICATION
- \biguplus \or % MULTISET UNION
- \sqsubset \or % SQUARE IMAGE OF
- \sqsupset \or % SQUARE ORIGINAL OF
- \sqsubseteq \or % SQUARE IMAGE OF OR EQUAL TO
- \sqsupseteq \or % SQUARE ORIGINAL OF OR EQUAL TO
- \sqcap \or % SQUARE CAP
- \sqcup \or % SQUARE CUP
- \oplus \or % CIRCLED PLUS
- \ominus \or % CIRCLED MINUS
- \otimes \or % CIRCLED TIMES
- \oslash \or % CIRCLED DIVISION SLASH
- \odot \or % CIRCLED DOT OPERATOR
- \circledcirc \or % CIRCLED RING OPERATOR
- \circledast \or % CIRCLED ASTERISK OPERATOR
- \unknownchar \or % CIRCLED EQUALS
- \circleddash \or % CIRCLED DASH
- \boxplus \or % SQUARED PLUS
- \boxminus \or % SQUARED MINUS
- \boxtimes \or % SQUARED TIMES
- \boxdot \or % SQUARED DOT OPERATOR
- \vdash \or % RIGHT TACK
- \dashv \or % LEFT TACK
- \top \or % DOWN TACK
- \bot \or % UP TACK
- \unknownchar \or % ASSERTION
- \models \or % MODELS
- \vDash \or % TRUE
- \unknownchar \or % FORCES
- \Vvdash \or % TRIPLE VERTICAL BAR RIGHT TURNSTILE
- \unknownchar \or % DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE
- \nvdash \or % DOES NOT PROVE
- \nvDash \or % NOT TRUE
- \unknownchar \or % DOES NOT FORCE
- \unknownchar \or % NEGATED DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE
- \unknownchar \or % PRECEDES UNDER RELATION
- \unknownchar \or % SUCCEEDS UNDER RELATION
- \lhd \or % NORMAL SUBGROUP OF
- \rhd \or % CONTAINS AS NORMAL SUBGROUP
- \unlhd \or % NORMAL SUBGROUP OF OR EQUAL TO
- \unrhd \or % CONTAINS AS NORMAL SUBGROUP OR EQUAL TO
- \unknownchar \or % ORIGINAL OF
- \unknownchar \or % IMAGE OF
- \unknownchar \or % MULTIMAP
- \unknownchar \or % HERMITIAN CONJUGATE MATRIX
- \unknownchar \or % INTERCALATE
- \veebar \or % XOR
- \barwedge \or % NAND
- \unknownchar \or % NOR
- \unknownchar \or % RIGHT ANGLE WITH ARC
- \unknownchar \or % RIGHT TRIANGLE
- \bigwedge \or % N-ARY LOGICAL AND
- \bigvee \or % N-ARY LOGICAL OR
- \bigcap \or % N-ARY INTERSECTION
- \bigcup \or % N-ARY UNION
- \diamond \or % DIAMOND OPERATOR
- \cdot \or % DOT OPERATOR
- \star \or % STAR OPERATOR
- \divideontimes \or % DIVISION TIMES
- \bowtie \or % BOWTIE
- \ltimes \or % LEFT NORMAL FACTOR SEMIDIRECT PRODUCT
- \rtimes \or % RIGHT NORMAL FACTOR SEMIDIRECT PRODUCT
- \leftthreetimes \or % LEFT SEMIDIRECT PRODUCT
- \rightthreetimes \or % RIGHT SEMIDIRECT PRODUCT
- \backsimeq \or % REVERSED TILDE EQUALS
- \unknownchar \or % CURLY LOGICAL OR
- \unknownchar \or % CURLY LOGICAL AND
- \Subset \or % DOUBLE SUBSET
- \Supset \or % DOUBLE SUPERSET
- \Cap \or % DOUBLE INTERSECTION
- \Cup \or % DOUBLE UNION
- \pitchfork \or % PITCHFORK
- \unknownchar \or % EQUAL AND PARALLEL TO
- \unknownchar \or % LESS-THAN WITH DOT
- \unknownchar \or % GREATER-THAN WITH DOT
- \lll \or % VERY MUCH LESS-THAN
- \ggg \or % VERY MUCH GREATER-THAN
- \lesseqgtr \or % LESS-THAN EQUAL TO OR GREATER-THAN
- \gtreqless \or % GREATER-THAN EQUAL TO OR LESS-THAN
- \unknownchar \or % EQUAL TO OR LESS-THAN
- \unknownchar \or % EQUAL TO OR GREATER-THAN
- \curlyeqprec \or % EQUAL TO OR PRECEDES
- \curlyeqsucc \or % EQUAL TO OR SUCCEEDS
- \npreceq \or % DOES NOT PRECEDE OR EQUAL
- \nsucceq \or % DOES NOT SUCCEED OR EQUAL
- \unic@nsqsubseteq \or % NOT SQUARE IMAGE OF OR EQUAL TO
- \unic@nsqsupseteq \or % NOT SQUARE ORIGINAL OF OR EQUAL TO
- \unknownchar \or % SQUARE IMAGE OF OR NOT EQUAL TO
- \unknownchar \or % SQUARE ORIGINAL OF OR NOT EQUAL TO
- \lnsim \or % LESS-THAN BUT NOT EQUIVALENT TO
- \gnsim \or % GREATER-THAN BUT NOT EQUIVALENT TO
- \precnsim \or % PRECEDES BUT NOT EQUIVALENT TO
- \succnsim \or % SUCCEEDS BUT NOT EQUIVALENT TO
- \ntriangleleft \or % NOT NORMAL SUBGROUP OF
- \ntriangleright \or % DOES NOT CONTAIN AS NORMAL SUBGROUP
- \ntrianglelefteq \or % NOT NORMAL SUBGROUP OF OR EQUAL TO
- \ntrianglerighteq \or % DOES NOT CONTAIN AS NORMAL SUBGROUP OR EQUAL
- \vdots \or % VERTICAL ELLIPSIS
- \cdots \or % MIDLINE HORIZONTAL ELLIPSIS
- \unknownchar \or % UP RIGHT DIAGONAL ELLIPSIS
- \ddots \or % DOWN RIGHT DIAGONAL ELLIPSIS
- \unknownchar \or % ELEMENT OF WITH LONG HORIZONTAL STROKE
- \unknownchar \or % ELEMENT OF WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
- \unknownchar \or % SMALL ELEMENT OF WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
- \unknownchar \or % ELEMENT OF WITH DOT ABOVE
- \unknownchar \or % ELEMENT OF WITH OVERBAR
- \unknownchar \or % SMALL ELEMENT OF WITH OVERBAR
- \unknownchar \or % ELEMENT OF WITH UNDERBAR
- \unknownchar \or % ELEMENT OF WITH TWO HORIZONTAL STROKES
- \unknownchar \or % CONTAINS WITH LONG HORIZONTAL STROKE
- \unknownchar \or % CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
- \unknownchar \or % SMALL CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
- \unknownchar \or % CONTAINS WITH OVERBAR
- \unknownchar \else % SMALL CONTAINS WITH OVERBAR
- \unknownchar % Z NOTATION BAG MEMBERSHIP
- \fi
-\stopunicodevector
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/unic-035.mkii b/Master/texmf-dist/tex/context/base/mkii/unic-035.mkii
deleted file mode 100644
index 0c949017468..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/unic-035.mkii
+++ /dev/null
@@ -1,32 +0,0 @@
-%D \module
-%D [ file=unic-035,
-%D version=2009.05.25,
-%D title=\CONTEXT\ \UNICODE\ Macros,
-%D subtitle=Vector 35,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-
-\unprotect
-
-\startunicodevector 35
- \expandafter\strippedcsname
- \ifcase\numexpr#1\relax
- \varnothing \or % DIAMETER SIGN
- \unknownchar \or % ELECTRIC ARROW
- \unknownchar \or % HOUSE
- \unknownchar \or % UP ARROWHEAD
- \unknownchar \or % DOWN ARROWHEAD
- \unknownchar \or % PROJECTIVE
- \unknownchar \or % PERSPECTIVE
- \unknownchar \or % WAVY LINE
- \lceil \or % LEFT CEILING
- \rceil \or % RIGHT CEILING
- \lfloor \or % LEFT FLOOR
- \rfloor \or % RIGHT FLOOR
- \unknownchar \else
- \unknownchar %
- \fi
-\stopunicodevector
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/unic-037.mkii b/Master/texmf-dist/tex/context/base/mkii/unic-037.mkii
deleted file mode 100644
index 646a4afb299..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/unic-037.mkii
+++ /dev/null
@@ -1,278 +0,0 @@
-%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 ADE \& \CONTEXT\ Development Team}]
-%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/mkii/unic-039.mkii b/Master/texmf-dist/tex/context/base/mkii/unic-039.mkii
deleted file mode 100644
index 02d5d3af24f..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/unic-039.mkii
+++ /dev/null
@@ -1,68 +0,0 @@
-%D \module
-%D [ file=unic-039,
-%D version=2005.06.16,
-%D title=\CONTEXT\ \UNICODE\ Macros,
-%D subtitle=Vector 39,
-%D author=Nikolai Weibull,
-%D date=\currentdate,
-%D copyright={Nikolai Weibull \& Hans Hagen}]
-
-\unprotect
-
-\startunicodevector 39
- \expandafter\strippedcsname
- \ifcase\numexpr#1-192\relax
- \unknownchar \or % THREE DIMENSIONAL ANGLE
- \unknownchar \or % WHITE TRIANGLE CONTAINING SMALL WHITE TRIANGLE
- \perp \or % PERPENDICULAR
- \unknownchar \or % OPEN SUBSET
- \unknownchar \or % OPEN SUPERSET
- \lbag \or % LEFT S-SHAPED BAG DELIMITER
- \rbag \or % RIGHT S-SHAPED BAG DELIMITER
- \unknownchar \or % <reserved>
- \unknownchar \or % <reserved>
- \unknownchar \or % <reserved>
- \unknownchar \or % <reserved>
- \unknownchar \or % <reserved>
- \unknownchar \or % <reserved>
- \unknownchar \or % <reserved>
- \unknownchar \or % <reserved>
- \unknownchar \or % <reserved>
- \unknownchar \or % WHITE DIAMOND WITH CENTRED DOT
- \unknownchar \or % AND WITH DOT
- \unknownchar \or % ELEMENT OF OPENING UPWARDS
- \unknownchar \or % LOWER RIGHT CORNER WITH DOT
- \unknownchar \or % UPPER LEFT CORNER WITH DOT
- \unknownchar \or % LEFT OUTER JOIN
- \unknownchar \or % RIGHT OUTER JOIN
- \unknownchar \or % FULL OUTER JOIN
- \unknownchar \or % LARGE UP TACK
- \unknownchar \or % LARGE DOWN TACK
- \unknownchar \or % LEFT AND RIGHT DOUBLE TURNSTILE
- \unknownchar \or % LEFT AND RIGHT TACK
- \unknownchar \or % LEFT MULTIMAP
- \unknownchar \or % LONG RIGHT TACK
- \unknownchar \or % LONG LEFT TACK
- \unknownchar \or % UP TACK WITH CIRCLE ABOVE
- \unknownchar \or % LOZENGE DIVIDED BY HORIZONTAL RULE
- \unknownchar \or % WHITE CONCAVE-SIDED DIAMOND
- \unknownchar \or % WHITE CONCAVE-SIDED DIAMOND WITH LEFTWARDS TICK
- \unknownchar \or % WHITE CONCAVE-SIDED DIAMOND WITH RIGHTWARDS TICK
- \unknownchar \or % WHITE SQUARE WITH LEFTWARDS TICK
- \unknownchar \or % WHITE SQUARE WITH RIGHTWARDS TICK
- \unic@Lbracket \or % MATHEMATICAL LEFT WHITE SQUARE BRACKET
- \unic@Rbracket \or % MATHEMATICAL RIGHT WHITE SQUARE BRACKET
- \langle \or % MATHEMATICAL LEFT ANGLE BRACKET
- \rangle \or % MATHEMATICAL RIGHT ANGLE BRACKET
- \unic@Langle \or % MATHEMATICAL LEFT DOUBLE ANGLE BRACKET
- \unic@Rangle \or % MATHEMATICAL RIGHT DOUBLE ANGLE BRACKET
- \unknownchar \or % <reserved>
- \unknownchar \or % <reserved>
- \unknownchar \or % <reserved>
- \unknownchar \or % <reserved>
- \unknownchar \else % <reserved>
- \unknownchar
- \fi
-\stopunicodevector
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/unic-251.mkii b/Master/texmf-dist/tex/context/base/mkii/unic-251.mkii
deleted file mode 100644
index 909cf5e9473..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/unic-251.mkii
+++ /dev/null
@@ -1,34 +0,0 @@
-%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 \& \CONTEXT\ Development Team}]
-
-\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/mkii/unic-cjk.mkii b/Master/texmf-dist/tex/context/base/mkii/unic-cjk.mkii
deleted file mode 100644
index dc06e912ceb..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/unic-cjk.mkii
+++ /dev/null
@@ -1,22 +0,0 @@
-%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 ADE \& \CONTEXT\ Development Team}]
-%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}}
-\dostepwiserecurse{172}{215}{1}{\expanded{\defineunicodecommand{\recurselevel}} {\lookaheaduchar}}
-\dostepwiserecurse{249}{250}{1}{\expanded{\defineunicodecommand{\recurselevel}} {\lookaheaduchar}}
-
-% special chars
-
-\dostepwiserecurse{255}{255}{1}{\expanded{\defineunicodecommand{\recurselevel}} {\lookaheaduchar}}
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/unic-exp.mkii b/Master/texmf-dist/tex/context/base/mkii/unic-exp.mkii
deleted file mode 100644
index 4bdda3f6fe8..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/unic-exp.mkii
+++ /dev/null
@@ -1,82 +0,0 @@
-%D \module
-%D [ file=unic-exp,
-%D version=2002.12.05,
-%D title=\CONTEXT\ \UNICODE\ Support,
-%D subtitle=Expansion,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Unicode Support / Expansion)}
-
-%D \macros
-%D {expandunivector}
-%D
-%D The \type {\expandunivector} macro can be used to expand
-%D vectors, which leads to a faster run in case of documents
-%D with lots of \UTF-8 code.
-
-\unprotect
-
-\def\expandunivector[#1]%
- {\processcommalist[#1]\doexpandunivector}
-
-\def\doexpandunivector#1%
- {\ifcsname\@@univector#1\endcsname
- \ifcsname\@@univector\@@univector#1\endcsname\else
- \writestatus{unicode}{expanding vector #1}%
- \setvalue{\@@univector\@@univector#1}{\expandedunivector{#1}}%
- \dorecurse{255}
- {\@EA\ifx\csname\csname\@@univector#1\endcsname\recurselevel\endcsname\unknownchar
- % skip
- \else
- \@EA\let\csname\@@univector\@@univector#1:\recurselevel\@EA\endcsname
- \csname\csname\@@univector#1\endcsname\recurselevel\endcsname
- \fi}%
- \letbeundefined{\@@univector#1}%
- \fi
- \fi}
-
-\def\expandedunivector#1#2%
- {\ifcsname\@@univector\@@univector#1:\number#2\endcsname
- \@@univector\@@univector#1:\number#2%
- \else
- \@@unknownchar
- \fi}
-
-%D For this purpose, we need to redefine the resolver.
-
-\def\doutfunihash#1#2%
- {\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}}
-
-\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
-
-%D Let's use it:
-
-\expandunivector[0,1,2,3,4,5,30,31,32,33,34,37,39]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/unic-ini.mkii b/Master/texmf-dist/tex/context/base/mkii/unic-ini.mkii
deleted file mode 100644
index 96aed77bcd8..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/unic-ini.mkii
+++ /dev/null
@@ -1,777 +0,0 @@
-%D \module
-%D [ file=unic-ini,
-%D version=2002.12.03,
-%D title=\CONTEXT\ \UNICODE\ Support,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Unicode Support / Initialization}
-
-%D Sorry, we only support his in \ETEX.
-
-\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
-%D macros below deal with conversions. Thanks to Taco for
-%D providing the following conversion rules.
-%D
-%D \starttabulate[|c|c|c|c|c|]
-%D \NC $b_1$ \NC $b_2$ \NC $b_3$ \NC $b_4$ \NC unicode \NC \NR
-%D \NC192---223\NC128---191\NC \NC \NC 0x80---0x7FF \NC \NR
-%D \NC224---239\NC128---191\NC128---191\NC \NC 0x800---0xFFFF \NC \NR
-%D \NC240---247\NC128---191\NC128---191\NC128---191\NC0x10000---0x1FFFF\NC \NR
-%D \stoptabulate
-%D
-%D In \UTF-8 the characters in the range 128---191 are illegal
-%D as first characters. The characters 254 and 255 are
-%D completely illegal and should not appear at all (they are
-%D related to UTF-16).
-%D
-%D The unicode number for an \UTF-8 sequence can be calculated
-%D as follows:
-%D
-%D \starttabulate[|mc|m|mc|m|mc|m|mc|m|]
-%D \NC b_1 \NC \NC \NC \NC \NC \NC \NC if b_1<=127\NC \NR
-%D \NC 64(b_1-192)\NC+\NC (b_2-128)\NC \NC \NC \NC \NC if 192<=b1<=223\NC \NR
-%D \NC 4096(b_1-224)\NC+\NC 64(b_2-128)\NC+\NC (b_3-128)\NC \NC \NC if 224<=b1<=239\NC \NR
-%D \NC262144(b_1-240)\NC+\NC4096(b_2-128)\NC+\NC64(b_3-128)\NC+\NC(b_4-128)\NC if 240<=b1<=247\NC \NR
-%D \stoptabulate
-%D
-%D A lot of information about unicode can be found on the
-%D web (search for Markus Kuhn and unicode and you'll
-%D probably end up at the right place).
-
-%D In \ETEX\ vocabulary such a conversion looks as follows.
-%D We need the \type {`} in order to turn a character into a
-%D number.
-%D
-%D \starttyping
-%D \def\utftwounicode#1#2%
-%D {\number\numexpr (64*(\numexpr (#1-192))+%
-%D (\numexpr(`#2-128)))}
-%D
-%D \def\utfthreeunicode#1#2#3%
-%D {\number\numexpr (4096*(\numexpr (#1-224))+
-%D 64*(\numexpr(`#2-128))+%
-%D (\numexpr(`#3-128)))}
-%D
-%D \def\utffourunicode#1#2#3#4%
-%D {\number\numexpr(262144*(\numexpr (#1-240))+
-%D 4096*(\numexpr(`#1-128))+
-%D 64*(\numexpr(`#2-128))+%
-%D (\numexpr(`#3-128)))}
-%D \stoptyping
-%D
-%D When we map the unicode number on one of the 256 char wide
-%D unicode tables, we need to do a bit of div and mod. Watch
-%D out: an \ETEX\ \type {/} is not the same as \TEX's \type
-%D {\divide}. The former rounds, while the later truncates, so
-%D we need to trucate ourselves. In case you wonder why we
-%D use \type {\numexpr}: this is not only more convenient, but
-%D also makes it possible to avoid scratch counters, so that we
-%D get fast and fully expandable conversions.
-%D
-%D \starttyping
-%D \def\utfdiv#1{\number\numexpr((#1-128)/256)}
-%D \def\utfmod#1{\number\numexpr((#1)-(256*(\utfdiv{#1})))}
-%D \stoptyping
-%D
-%D So far for the readable alternatives. When using \type
-%D {\numexpr} you should be aware of rather unexpected look
-%D ahead effects. The next implementation uses registers,
-%D which saves tokens and is faster. In this case we gain
-%D some 10\% time.
-
-\chardef \utf@a= 64
-\mathchardef \utf@b= 4096
-\newcount\utf@c\utf@c=262144
-\chardef \utf@d= 192
-\chardef \utf@e= 224
-\chardef \utf@f= 240
-\chardef \utf@g= 128
-\mathchardef \utf@h= 256
-\chardef \utf@i= 127
-\mathchardef \utf@j= 2048
-
-%D The definitions now become:
-%D
-%D \starttyping
-%D \def\utftwounicode#1#2%
-%D {\number\numexpr(\utf@a*(\numexpr (#1-\utf@d))+%
-%D (\numexpr(`#2-\utf@g)))}
-%D
-%D \def\utfthreeunicode#1#2#3%
-%D {\number\numexpr(\utf@b*(\numexpr (#1-\utf@e))+
-%D \utf@a*(\numexpr(`#2-\utf@g))+%
-%D (\numexpr(`#3-\utf@g)))}
-%D
-%D \def\utffourunicode#1#2#3#4%
-%D {\number\numexpr(\utf@c*(\numexpr (#1-\utf@f))+
-%D \utf@b*(\numexpr(`#2-\utf@g))+
-%D \utf@a*(\numexpr(`#3-\utf@g))+%
-%D (\numexpr(`#4-\utf@g)))}
-%D \stoptyping
-%D
-%D And:
-%D
-%D \starttyping
-%D \def\utfdiv#1{\number\numexpr((#1-\utf@g)/\utf@h)}
-%D \def\utfmod#1{\number\numexpr((#1)-(\utf@h*(\utfdiv{#1})))}
-%D \stoptyping
-%D
-%D Depending on the usage, you can rely on parenthesis only:
-%D
-%D \starttyping
-%D \def\utftwounicode#1#2%
-%D {\numexpr(\utf@a*(#1-\utf@d)+%
-%D `#2-\utf@g)}
-%D
-%D \def\utfthreeunicode#1#2#3%
-%D {\numexpr(\utf@b*(#1-\utf@e)+%
-%D \utf@a*(`#2-\utf@g)+%
-%D `#3-\utf@g)}
-%D
-%D \def\utffourunicode#1#2#3#4%
-%D {\numexpr(\utf@c*(#1-\utf@f)+%
-%D \utf@b*(`#2-\utf@g)+%
-%D \utf@a*(`#3-\utf@g)+%
-%D `#4-\utf@g)}
-%D \stoptyping
-
-% beware, unless surrounded by \numexpr .. \relax, a division
-% results in a float until the final result is calculated
-
-\def\utfdiv#1{\the\numexpr (#1-\utf@g)/\utf@h \relax}
-\def\utfmod#1{\the\numexpr#1-\utf@h*((#1-\utf@g)/\utf@h)\relax}
-
-%D The next one also handles the zero case well: (not really utf specific btw)
-
-\def\utfdiv#1{\the\numexpr\ifcase\numexpr#1\relax0\else (#1-\utf@g)/\utf@h \fi\relax}
-\def\utfmod#1{\the\numexpr\ifcase\numexpr#1\relax0\else#1-\utf@h*((#1-\utf@g)/\utf@h)\fi\relax}
-
-% or
-%
-% \def\utfdiv#1{\ifcase\numexpr#1\relax0\else\the\numexpr(#1-\utf@g)/\utf@h\relax\fi}
-% \def\utfmod#1{\ifcase\numexpr#1\relax0\else\the\numexpr#1-\utf@h*((#1-\utf@g)/\utf@h)\relax\fi}
-
-%D When tracing we also need:
-
-\def\utfvid#1{\the\numexpr(#1-\medcard)/\maxcard\relax}
-
-%D Using the three conversion macros, we can now implement
-%D a few handlers. They all call the general \type
-%D {\unicodechar} conversion macro.
-%D
-%D \starttyping
-%D \def\utftwouniglph#1#2%
-%D {\unicodechar{\utftwounicode {#1}{#2}}}
-%D
-%D \def\utfthreeuniglph#1#2#3%
-%D {\unicodechar{\utfthreeunicode{#1}{#2}{#3}}}
-%D
-%D \def\utffouruniglph#1#2#3#4%
-%D {\unicodechar{\utffourunicode {#1}{#2}{#3}{#4}}}
-%D \stoptyping
-%D
-%D Because the unicode number is used a few times per
-%D conversion, we can expand it once (\type {\the} and \type
-%D {\number} make sure of this). This saves us another 10\%.
-%D
-%D \starttyping
-%D \def\utftwouniglph#1#2%
-%D {\@EA\unicodechar\@EA{\the\utftwounicode{#1}{#2}}}
-%D
-%D \def\utfthreeuniglph#1#2#3%
-%D {\@EA\unicodechar\@EA{\the\utfthreeunicode{#1}{#2}{#3}}}
-%D
-%D \def\utffouruniglph#1#2#3#4%
-%D {\@EA\unicodechar\@EA{\the\utffourunicode{#1}{#2}{#3}{#4}}}
-%D \stoptyping
-%D
-%D We can rewrite these macros to faster alternatives: the
-%D less arguments we pass, the faster the conversion will be,
-%D but at the price of readability. So we have:
-%D
-%D \starttyping
-%D \def\utftwouniglph#1#2%
-%D {\@EA\unicodechar\@EA{\the\numexpr(\utf@a*(#1-\utf@d)+%
-%D `#2-\utf@g)}}
-%D
-%D \def\utfthreeuniglph#1#2#3%
-%D {\@EA\unicodechar\@EA{\the\numexpr(\utf@b*(#1-\utf@e)+%
-%D \utf@a*(`#2-\utf@g)+`#3-\utf@g)}}
-%D
-%D \def\utffouruniglph#1#2#3#4%
-%D {\@EA\unicodechar\@EA{\the\numexpr(\utf@c*(#1-\utf@f)+%
-%D \utf@b*(`#2-\utf@g)+\utf@a*(`#3-\utf@g)+`#4-\utf@g)}}
-%D \stoptyping
-%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}}
-
-\def\utfthreeuniglph#1#2#3%
- {\@EA\unicodechar\@EA{\the\numexpr\utf@b*(#1-\utf@e)+\utf@a*(`#2-\utf@g)+`#3-\utf@g\relax}}
-
-\def\utffouruniglph#1#2#3#4%
- {\@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
-%D actual conversion does not take place here, but is done by
-%D macros in \type{unic-nnn} files. There we map a range onto
-%D named glyphs, so that they fit well into the rest of
-%D \CONTEXT.
-
-%D \macros
-%D {utfunicodetracer}
-%D
-%D By default, the converter produces a character representation,
-%D but for tracing purposes, you can set a trace option.
-
-\newconstant\utfunicodetracer
-
-%D \def\TraceUnic#1%
-%D {\utfunicodetracer#1\relax\enableregime[utf]Å°}
-%D
-%D \starttabulate[|c|c|c|c|c|c|]
-%D \NC option \NC number\NC mapping\NC glyph\NC string\NC example \NC \NR
-%D \NC 0 \NC \NC \NC \star\NC \NC \TraceUnic0\NC \NR
-%D \NC 1 \NC \star \NC \NC \NC \NC \TraceUnic1\NC \NR
-%D \NC 2 \NC \NC \star \NC \NC \NC \TraceUnic2\NC \NR
-%D \NC 3 \NC \star \NC \star \NC \NC \NC \TraceUnic3\NC \NR
-%D \NC 4 \NC \star \NC \NC \star\NC \NC \TraceUnic4\NC \NR
-%D \NC 5 \NC \NC \star \NC \star\NC \NC \TraceUnic5\NC \NR
-%D \NC 6 \NC \star \NC \star \NC \star\NC \NC \TraceUnic6\NC \NR
-%D \NC 7 \NC \NC \NC \NC \star \NC \TraceUnic7\NC \NR
-%D \NC 8 \NC \star \NC \NC \NC \NC \TraceUnic8\NC \NR
-%D \NC otherwise\NC \NC \NC \star\NC \NC \TraceUnic9\NC \NR
-%D \stoptabulate
-
-%D \macros
-%D {unicodechar}
-%D
-%D Next we implement the character handler:
-
-\def\unicodechar
- {\ifcase\utfunicodetracer
- \expandafter\utfunihash \or
- \expandafter\utfunichar \or
- \expandafter\utfunisplit \or
- \expandafter\utfuniboth \or
- \expandafter\utfunihashchar \or
- \expandafter\utfunihashsplit \or
- \expandafter\utfunihashboth \or
- \expandafter\utfuniglyphname \or
- \expandafter\utfunientity \else
- \expandafter\utfunihash
- \fi}
-
-%D \startbuffer
-%D \enableregime[utf] \dostepwiserecurse{0}{8}{1}
-%D {\recurselevel:
-%D \utfunicodetracer\recurselevel aap‒noot coördinatie – één
-%D \crlf}
-%D \stopbuffer
-%D
-%D \typebuffer \start \getbuffer \stop
-
-%D \macros
-%D {unicodehexnumber}
-%D
-%D A few auxiliary macros, producing the range||char pair:
-
-\def\unicodepair#1%
- {\utfdiv{#1}:\utfmod{#1}}
-
-\def\unicodenumber#1{\number#1}
-
-\def\unicodehexnumber#1%
- {\ifnum#1>\maxcard
- \expanded{\uchexnumbers{\utfvid{#1}}}%
- \expanded{\uchexnumbers{\utfdiv{\utfdiv{#1}}}}%
- \else
- 00%
- \expanded{\uchexnumbers{\utfdiv{#1}}}%
- \fi
- \expanded{\uchexnumbers{\utfmod{#1}}}}
-
-%D The following macros visualize the unicode character. The
-%D \type {\relax} in front of the \type {-} prevents lookahead
-%D problems; somehow \type {\numexpr} cannot look beyond this
-%D sign, and expects a number.
-
-\ifx\tttf\undefined \let\tttf\relax \fi
-
-\def\utfunichar #1{{\tttf U\low{\tx\unicodenumber{#1}}}}
-\def\utfunisplit #1{{\tttf U\low{\tx\unicodepair{#1}}}}
-\def\utfuniboth #1{{\tttf U\low{\tx\unicodenumber{#1}->\unicodepair{#1}}}}
-\def\utfunientity #1{{\tttf\&\#x\unicodehexnumber{#1};}}
-
-%D The character itself is accessed and typeset by:
-%D
-%D \starttyping
-%D \def\utfunihash#1%
-%D {\executeifdefined{\@@univector\utfdiv{#1}}%
-%D \gobbleoneargument{\utfmod{#1}}}
-%D \stoptyping
-%D
-%D Again, we can provide a faster alternative, because inside
-%D the conditional executer, the argument is expanded twice,
-%D and therefore the calculation done once more than needed.
-%D So, we make sure that the argument is expansion on
-%D forehand. Just to remind you: \type {#1} is the \UNICODE\
-%D number.
-%D
-%D \starttyping
-%D \def\utfunihash#1%
-%D {\@EA\executeifdefined\@EA{\@EA\@@univector\number\utfdiv{#1}}%
-%D {\unknownchar\gobbleoneargument}{\utfmod{#1}}}
-%D \stoptyping
-%D
-%D In order to save calculation time, I decided to change
-%D this definition into:
-
-%D \starttyping
-%D \def\utfunihash#1%
-%D {\@EA\doutfunihash\@EA{\number\utfdiv{#1}}{#1}}
-%D
-%D \def\doutfunihash#1#2%
-%D {\ifcsname\@@univector\number#1\endcsname
-%D \csname\csname\@@univector#1\endcsname{\utfmod{#2}}\endcsname
-%D \else
-%D \unknownchar
-%D \fi}
-%D \stoptyping
-%D
-%D Or leaner and meaner:
-%D
-%D \starttyping
-%D \def\doutfunihash#1#2%
-%D {\csname
-%D \ifcsname\@@univector\number#1\endcsname
-%D \csname\@@univector#1\endcsname{\utfmod{#2}}%
-%D \else
-%D \@@unknownchar
-%D \fi
-%D \endcsname}
-%D \stoptyping
-%D
-%D And finaly it became:
-
-\def\doutfunihash#1#2%
- {\ifcsname\@@univector\number#1\endcsname
- \csname\@@univector#1\endcsname{\utfmod{#2}}%
- \else
- \@@unknownchar
- \fi}
-
-\def\utfunihashglyph#1%
- {\csname\@EA\doutfunihash\@EA{\number\utfdiv{#1}}{#1}\endcsname}
-
-\def\utfunihashcommand
- {\@EAEAEA\string\utfunihashglyph}
-
-%D For practical purposes, we handle the normal \ASCII\
-%D characters here:
-
-\def\utfunihashglyph#1%
- {\csname
- \ifnum#1<\utf@i
- \strippedcsname\unicodeasciicharacter\endcsname{#1}%
- \else
- \@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 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
-
-%D We also need:
-
-\def\utfuniglyphname#1%
- {{\tttf
- \ifnum#1<\utf@i
- \unicodeasciicharacter{#1}%
- \else
- \expandafter\string\csname\doutfunihash{\number\utfdiv{#1}}{#1}\endcsname
- \fi}}
-
-%D The combined presentation is implemented by:
-
-\def\utfunihashchar #1%
- {\utfunihash{#1}\low{\infofont\unicodenumber{#1}}}
-
-\def\utfunihashsplit#1%
- {\utfunihash{#1}\low{\infofont\unicodepair{#1}}}
-
-\def\utfunihashboth #1%
- {\utfunihash{#1}\low{\infofont\unicodenumber{#1}->\unicodepair{#1}}}
-
-%D Unknown characters get a placeholder.
-
-\unexpanded\def\unknownchar % {} prevents problems with arguments
- {{\hbox{\vrule\!!width.5em\!!height1ex\!!depth\zeropoint}}}
-
-%D So far for the conversion macros. The optimizations we
-%D did, brought down the runtime some 50\%, which, given that
-%D the majority of characters will be normal \ASCII\
-%D characters, the penalty of conversion is not that large.
-
-%D \macros
-%D {useunicodevector}
-%D
-%D Since we end up with many encodings, it starts making
-%D sense to postpone loading, so let's start doing this
-%D with \UNICODE.
-
-\def\doifunicodevector#1%
- {\doifdefined{\@@univector#1}}
-
-\def\useunicodevector[#1]%
- {\processcommalist[#1]\douseunicodevector}
-
-\def\douseunicodevector#1%
- {\ifundefined{\@@univector#1}%
- % \readsysfile{\f!unicprefix\threedigits{#1}}
- \readsysfile{\f!unicprefix\doifnumberelse{#1}{\threedigits{#1}}{#1}.mkii}
- {\writestatus{unicode}{loading vector #1}}
- {\writestatus{unicode}{unknown vector #1}}%
- \fi}
-
-%D \macros
-%D {startunicodevector}
-%D
-%D A vector roughly looks as follows. By putting the text
-%D inside the name constructor, we prevent problems with
-%D partial expansion in macros and special cases.
-%D
-%D \starttyping
-%D \startunicodevector 0
-%D \ifcase\numexpr(#1-159)\or
-%D \@@unknownchar\or % NO-BREAK SPACE
-%D exclamdown\or
-%D textcent\or
-%D ....\else
-%D \@@unknowncharacter
-%D \fi
-%D \stopunicodevector
-%D \stoptyping
-%D
-%D In vector \type {unix-000} you will find another
-%D optimizations. By using as less tokens as possible, we limit
-%D the time skipping branches in the test, and save upto 20\%
-%D runtime.
-
-\def\startunicodevector #1 #2\stopunicodevector
- {\setgvalue{\@@univector#1}##1{#2}}
-
-%D We define (as a practical example) the utf signal FEFF:
-
-\ifx\zwnbsp\undefined
- \let\zwnbsp\relax % zerowidthnonbreakablespace
-\fi
-
-\startunicodevector 254
- \expandafter\strippedcsname\ifnum#1<255 \unknownchar\else\zwnbsp\fi
-\stopunicodevector
-
-%D Here we provide another auxiliary macro:
-%D
-%D \startbuffer
-%D \unicodeinfoline{196}{Ä}{LATIN CAPITAL LETTER A WITH DIAERESIS}
-%D \unicodeinfoline{197}{Ã…}{LATIN CAPITAL LETTER A WITH RING ABOVE}
-%D \unicodeinfoline{198}{Æ}{LATIN CAPITAL LETTER AE}
-%D \unicodeinfoline{199}{Ç}{LATIN CAPITAL LETTER C WITH CEDILLA}
-%D \unicodeinfoline{200}{È}{LATIN CAPITAL LETTER E WITH GRAVE}
-%D \unicodeinfoline{201}{É}{LATIN CAPITAL LETTER E WITH ACUTE}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D \start \enableregime[utf]\getbuffer \stop
-
-\def\unicodeinfoline#1#2#3%
- {\ifnum#1>\utf@g % 128
- \noindent \hbox
- {\hbox to 4em{\tttf\unicodehexnumber{#1}\hss}\quad
- \hbox to 1em{#2\hss}\quad
- \hbox to 9em{\tttf\unicodenumber{#1}->\unicodepair{#1}\hss}\quad
- \hbox to 9em{\tttf\let\utfunihash\utfunihashcommand#2\hss}\quad % tricky
- \lowercase {\tttf#3}}\par
- \fi}
-
-%D The next code permits utf code in hyperlinks:
-
-\def\cleanunicodechar#1{.#1.}
-
-\appendtoks \let\unicodechar\cleanunicodechar \to \everycleanupfeatures
-
-%D We will now hook this mechanism in the existing font
-%D handler. More documentation will follow. Probably, some
-%D features in \type {font-uni.tex} will be generalized
-%D and moved here.
-
-\def\unidiv{0} \def\unimod{0}
-
-\chardef\utfunihashmode=0 % 0=hash glyph / 1=font glyph
-
-\def\utfunifontglyph#1%
- {\xdef\unidiv{\number\utfdiv{#1}}%
- \xdef\unimod{\number\utfmod{#1}}%
- \ifnum#1<\utf@i
- \char\unimod % \unicodeascii\unimod
- \else\ifcsname\@@univector\unidiv\endcsname
- \csname\doutfunihash{\unidiv}{#1}\endcsname
- \else % so, these can be different fonts !
- \unicodeglyph\unidiv\unimod % no \uchar (yet)
- \fi\fi}
-
-\chardef\utfunicommandmode=0 % 1 = hex
-
-\def\unicodecommandchar#1#2%
- {\string\char
- \ifcase\utfunicommandmode
- #1:#2\else\lchexnumbers#1:\lchexnumbers#2%
- \fi}
-
-\def\utfunifontcommand#1%
- {\xdef\unidiv{\number\utfdiv{#1}}%
- \xdef\unimod{\number\utfmod{#1}}%
- \ifnum#1<\utf@i
- \unicodecommandchar\unidiv\unimod
- \else\ifcsname\@@univector\unidiv\endcsname
- \@EA\string\csname\doutfunihash{\unidiv}{#1}\endcsname
- \else
- \unicodecommandchar\unidiv\unimod
- \fi\fi}
-
-\def\utfunihash
- {\ifcase\utfunihashmode
- \@EA\utfunihashglyph
- \else
- \@EA\utfunifontglyph
- \fi}
-
-\def\utfunihushcommand
- {\@EAEAEA\string\utfunihashglyph}
-
-\def\utfunihashcommand
- {\ifcase\utfunihashmode
- \@EA\utfunihushcommand
- \else
- \@EA\utfunifontcommand
- \fi}
-
-%D We can convert from a number to some UTF code with the folowing
-%D conversion macro.
-
-% The first, na\"ive version:
-%
-% \def\numbertoutf#1%
-% {\ifnum#1<128
-% \rawcharacter{#1}%
-% \else\ifnum#1<2048
-% \rawcharacter{\the\numexpr192+#1/64\relax}%
-% \rawcharacter{\the\numexpr128+#1-(#1/64)*64\relax}%
-% \else % 3 bytes
-% \rawcharacter{\the\numexpr224+#1/4096\relax}%
-% \rawcharacter{\the\numexpr128+(#1-(#1/4096)*4096)/128\relax}%
-% \rawcharacter{\the\numexpr128+(#1-(#1/4096)*4096)+(#1-(#1/4096)*4096)/128\relax}%
-% \fi\fi}
-
-% We have to compensate for etex's rounding (thanks to Taco and
-% Nanning) for pointing/sorting this out:
-
-\chardef \utf@a= 64
-\mathchardef \utf@b= 4096
-\newcount\utf@c\utf@c=262144
-\chardef \utf@d= 192
-\chardef \utf@e= 224
-\chardef \utf@f= 240
-\chardef \utf@g= 128
-\mathchardef \utf@h= 256
-\chardef \utf@i= 127
-\mathchardef \utf@j= 2048
-\chardef \utf@k= 32
-
-% div: \numexp#1/#2\relax
-% mod: \numexp#1-(#1/#2)*#2\relax
-
-% \def\numbertoutf#1%
-% {\ifnum#1<\utf@g
-% \rawcharacter{#1}%
-% \else\ifnum#1<2048
-% \rawcharacter{\numexpr192+(#1/64)\relax}% 192 + (ud div 64)
-% \rawcharacter{\numexpr128+(#1-(#1/64)*64)\relax}% 128 + (ud mod 64)
-% \else\ifnum#1<2097152
-% \rawcharacter{\numexpr224+(#1-(#1/4096)\relax}% 224 + (ud div 4096)
-% \rawcharacter{\numexpr128+(#1-((#1/64)-((#1/64)/64)*64)\relax}% 128 + ((ud div 64) mod 64)
-% \rawcharacter{\numexpr128+(#1-(#1-(#1/64)*64)\relax}% 128 + (ud mod 64)
-% \else
-% % todo
-% \fi\fi}
-
-\def\numbertoutf#1% okay?
- {\ifnum#1<\utf@g
- \rawcharacter{#1}%
- \else\ifnum#1<\utf@j
- \rawcharacter{\the\numexpr\utf@d+(#1-\utf@k)/\utf@a\relax}%
- \rawcharacter{\the\numexpr\utf@g+(#1-((#1-\utf@k)/\utf@a)*\utf@a)\relax}%
- \else
- \rawcharacter{\the\numexpr\utf@e+(#1-\utf@j)/\utf@b\relax}%
- \rawcharacter{\the\numexpr\utf@g+(#1-(((#1-\utf@j)/\utf@b)*\utf@b)-\utf@k)/\utf@a\relax}%
- \rawcharacter{\the\numexpr\utf@g+(#1-(((#1-\utf@j)/\utf@b)*\utf@b)-((#1-(((#1-\utf@j)/\utf@b)*\utf@b)-\utf@k)/\utf@a)*\utf@a)\relax}%
- \fi\fi}
-
-\def\numbertohexstring#1{0x\uchexnumbers{\utfdiv{#1}}\uchexnumbers{\utfmod{#1}}}
-
-\ifnum\texengine=\xetexengine
- \let\numbertoutf\numbertohexstring
-\fi
-
-\def\uchartoutf#1#2%
- {\expandafter\numbertoutf\expandafter{\the\numexpr#1*\utf@h+#2\relax}}
-
-%D Here is a mapping trick. By mapping the tex specific characters to
-%D private ones, we can prevent problems with utility files.
-
-\defineunicodecommand{240} {\doprivateunicodechar}
-
-\def\doprivateunicodechar#1#2{\char#2\relax}
-
-\def\registerprivateunicodechar#1 {\letvalue{puc::\number#1}\relax}
-
-\registerprivateunicodechar `\%
-\registerprivateunicodechar `\$
-\registerprivateunicodechar `\{
-\registerprivateunicodechar `\}
-\registerprivateunicodechar `\~
-\registerprivateunicodechar `\_
-\registerprivateunicodechar `\^
-\registerprivateunicodechar `\#
-
-\def\numbertoutp#1{\numbertoutf{\the\numexpr#1\ifcsname puc::\number#1\endcsname+"F000\fi\relax}}
-
-%D In the \XML\ expander we will do:
-%D
-%D \starttyping
-%D \def\getXMLhexcharacter##1{\numbertoutp{"##1}}%
-%D \def\getXMLdeccharacter##1{\numbertoutp {##1}}%
-%D \stoptyping
-
-%D Goodies:
-
-\fetchruntimecommand \showunicodevector {\f!unicprefix\s!run}
-\fetchruntimecommand \showunicodetable {\f!unicprefix\s!run}
-
-%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,31,32,33,34,35,37,39,251]
-\useunicodevector[cjk]
-
-\useregime[utf]
-
-% 31, text mem usage first
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/unic-run.mkii b/Master/texmf-dist/tex/context/base/mkii/unic-run.mkii
deleted file mode 100644
index 96348d8a792..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/unic-run.mkii
+++ /dev/null
@@ -1,130 +0,0 @@
-%D \module
-%D [ file=unic-run,
-%D version=2005.06.22,
-%D title=\CONTEXT\ \UNICODE\ Support,
-%D subtitle=Goodies,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 \macros
-%D {showunicodevector}
-%D
-%D Original version by Nikolai Weibull. Adapted a bit (no local count
-%D definitions, stepwiserecurse instead of -1 calculations, a bit less
-%D code and such). BTW, this is kind of tricky and somehow we don't
-%D have align interference.
-
-\gdef\doshowunicodevectorrow#1#2%
- {\NC
- \ttx\uchexnumber{#2}%
- \VL
- \dostepwiserecurse{0}{15}{1}{\unicodechar{\numexpr#1*256+#2+\recurselevel*16\relax}\VL}%
- \AR}
-
-\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
- \dostepwiserecurse{0}{15}{1}
- {\expanded{\doshowunicodevectorrow{#1}{\recurselevel}}%
- \DC\DL[16]\DR}
- \NC \use{17}{\hfill \ttx unicode table hex:\uchexnumbers{#1} dec:\threedigits{#1}\kern-.25em}\NC \AR
- \stoptable}
-
-%D \starttyping
-%D \utfunicodetracer=0
-%D \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 \stoptyping
-
-%D \macros
-%D {showunicodetable}
-%D
-%D A more verbose variant:
-
-\gdef\doshowunicodetablerow#1#2%
- {\bTR
- \bTD\uchexnumber{#2}\eTD
- \dostepwiserecurse{0}{15}{1}
- {\bTD
- \edef\entrypoint{\the\numexpr#1*256+#2+##1*16\relax}%
- \utfunicodetracer\zerocount{\dontleavehmode \strut\unicodechar\entrypoint\endgraf}%
- \tt
- \utfunicodetracer\plusseven{\dontleavehmode\txx\strut\unicodechar\entrypoint\endgraf}%
- \utfunicodetracer\plusthree{\dontleavehmode\txx\strut\unicodechar\entrypoint\endgraf}%
- \utfunicodetracer\pluseight{\dontleavehmode\txx\strut\unicodechar\entrypoint\endgraf}%
- \eTD}%
- \bTD\uchexnumber{#2}\eTD
- \eTR}
-
-\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]%
- \setupTABLE[c] [\v!last] [\c!background=\v!screen,\c!backgroundscreen=.85,\c!style=\tt\tfa]%
- \setupTABLE[r] [\v!first][\c!background=\v!screen,\c!backgroundscreen=.85,\c!style=\tt\tfa]%
- \setupTABLE[r] [\v!last] [\c!background=\v!screen,\c!backgroundscreen=.85,\c!style=\tt\tfa]%
- \setupTABLE[r] [\v!odd] [\c!background=\v!screen,\c!backgroundscreen=.80]%
- \setupTABLE[c] [\v!odd] [\c!background=\v!screen,\c!backgroundscreen=.80]%
- \setupTABLE[\v!odd][\v!odd] [\c!background=\v!screen,\c!backgroundscreen=.90]%
- \bTABLE
- \bTR
- \bTD dec: \numbers{#1}\endgraf hex: \uchexnumbers{#1}\eTD
- \dostepwiserecurse{0}{15}{1}{\bTD\uchexnumber{##1}\eTD}%
- \bTD dec: \numbers{#1}\endgraf hex: \uchexnumbers{#1}\eTD
- \eTR
- \dostepwiserecurse{0}{15}{1}{\doshowunicodetablerow{#1}{##1}}%
- \bTR
- \bTD dec: \numbers{#1}\endgraf hex: \uchexnumbers{#1}\eTD
- \dostepwiserecurse{0}{15}{1}{\bTD\uchexnumber{##1}\eTD}%
- \bTD dec: \numbers{#1}\endgraf hex: \uchexnumbers{#1}\eTD
- \eTR
- \eTABLE
- \egroup}
-
-\protect \endinput
-
-% alternative
-%
-% \gdef\doshowunicodevectorrowa#1#2#3#4%
-% {\NC
-% \ttx\uchexnumber{#2}%
-% \VL
-% \dostepwiserecurse{#3}{#4}{1}{\unicodechar{\numexpr#1*256+#2+\recurselevel*16\relax}\VL}%
-% \AR}
-%
-% \gdef\doshowunicodevectorrowb#1#2#3#4%
-% {\NC
-% \relax
-% \VL
-% \dostepwiserecurse{#3}{#4}{1}{\unicodechar{\numexpr#1*256+#2+\recurselevel*16\relax}\VL}%
-% \AR}
-%
-% \gdef\showunicodevector#1%
-% {\starttable[|c|c|c|c|c|c|c|c|c|]
-% \NC\NC\dostepwiserecurse{0}{7}{1}{\ttx\uchexnumber\recurselevel/\uchexnumber{\the\numexpr2*\recurselevel\relax}\NC}\AR\DC\DL[8]\DR
-% \dostepwiserecurse{0}{15}{1}
-% {\expanded{\doshowunicodevectorrowa{#1}{\recurselevel}{0} {7}}\DC\DL[8]\DR%
-% \expanded{\doshowunicodevectorrowb{#1}{\recurselevel}{8}{15}}\DC\DL[8]\DR}%
-% \NC \use{9}{\hfill \ttx unicode table hex:\uchexnumbers{#1} dec:\threedigits{#1}\kern-.25em}\NC \AR
-% \stoptable}
diff --git a/Master/texmf-dist/tex/context/base/mkii/verb-c.mkii b/Master/texmf-dist/tex/context/base/mkii/verb-c.mkii
deleted file mode 100644
index 930977ca4f6..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/verb-c.mkii
+++ /dev/null
@@ -1,484 +0,0 @@
-%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 \& \CONTEXT\ Development Team}]
-%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 Verbatim 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/mkii/verb-eif.mkii b/Master/texmf-dist/tex/context/base/mkii/verb-eif.mkii
deleted file mode 100644
index 68c84d4bef4..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/verb-eif.mkii
+++ /dev/null
@@ -1,211 +0,0 @@
-%D \module
-%D [ file=verb-eif,
-%D version=2000.08.23,
-%D title=\CONTEXT\ Verbatim Macros,
-%D subtitle=Pretty Eiffel Verbatim,
-%D author={Berend de Boer \& Hans Hagen},
-%D date=\currentdate,
-%D copyright={Berend de Boer \& Hans Hagen}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% This module will be cleaned up a bit in the process of more
-% flexible verbatim options.
-
-\writestatus{loading}{ConTeXt Verbatim Macros / Pretty EIFFEL Verbatim}
-
-%D \startbuffer
-%D \startEIFFEL
-%D class TEST
-%D
-%D creation
-%D make
-%D
-%D feature -- creation
-%D
-%D make is
-%D do
-%D print ("hello world")
-%D end
-%D
-%D end
-%D \stopEIFFEL
-%D \stopbuffer
-%D
-%D
-%D If a variable in a comment is quoted with `..', it is typeset
-%D as a variable (common Eiffel convention for pretty typesetters):
-%D
-%D \startbuffer
-%D \startEIFFEL
-%D class TEST
-%D
-%D feature
-%D
-%D say (something: STRING) is
-%D -- say `something' to stdout
-%D do
-%D print (something)
-%D end
-%D
-%D end -- class TEST
-%D \stopEIFFEL
-%D \stopbuffer
-%D
-%D
-%D Recommended, OOSC2 style setting is:
-%D
-%D \setuptyping
-%D [EIFFEL]
-%D [margin=1em,palet=,color=blue,style=\it,icommand=\bf,ccommand=\tf]
-%D
-
-%D We borrow most of the macros from the \PERL\ driver.
-
-\ifdefined\setupprettyPLtype \else \loadmarkfile{verb-pl} \fi
-
-\unprotect
-
-%D \EIFFEL\ has only the one line comment sequence \type{--}.
-
-\gdef\EIFsetspecials%
- {\PLsetspecials
- \setpretty`\#=32
- \setpretty`\{=33 \setpretty`\}=33
- \setpretty`\[=33 \setpretty`\]=33 \setpretty`\(=33 \setpretty`\)=33
- \setpretty`\;=33 \setpretty`\:=33
- \setpretty`\!=33 \setpretty`\?=33
- \setpretty`\==33 \setpretty`\~=33 \setpretty`\<=33 \setpretty`\>=33
- \setpretty`\-=33 \setpretty`\+=33 \setpretty`\/=33 \setpretty`\*=33
- \setpretty`\^=33
- \setpretty`\%=41 \setpretty`\-=45
- \setpretty`\`=81 \setpretty`\'=82 }
-
-\gdef\EIFsethandlers%
- {\PLsethandlers
- \installprettyhandler 33 \EIFtypesymbol
- \installprettyhandler 45 \EIFtypefourfive
- \installprettyhandler 81 \EIFtypeeightone
- \installprettyhandler 82 \EIFtypeeighttwo
- \installprettyhandler 90 \EIFtypenine }
-
-\gdef\EIFsetcontrols%
- {\PLsetcontrols
- \def\flushrestofverbatimline%
- {\endPLtypesix
- \inPLcommentfalse
- \verbatimfont
- \PLverbosefalse
- \PLverboseskipped=0}}
-
-\gdef\EIFsetvariables
- {\PLsetvariables}
-
-\gdef\setupprettyEIFtype%
- {\def\prettyidentifier{EIF}%
- \let\PLidentifiers=\EIFidentifiers
- \let\PLvariables=\EIFvariables
- \EIFsetvariables
- \EIFsetcontrols
- \EIFsethandlers
- \EIFsetspecials
- \PLsetdiagnostics}
-
-% symbols should appear in roman
-
-\gdef\EIFtypesymbol#1%
- {\endPLtypesix
- \ifinPLcomment
- \getpretty{#1}%
- \else
- {\prettynaturalfont\/%
- \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty}%
- \fi}
-
-% recognize comments
-
-\gdef\EIFtypefourfive%
- {\handlenextnextpretty\doEIFtypefourfive\PLtypefourtwo}
-
-\gdef\doEIFtypefourfive#1#2%
- {\endPLtypesix
- \getprettydata{#2}%
- \ifnum\prettytype=45
- \let\next=\dodoEIFtypefourfive
- \else
- \let\next=\PLtypefourtwo
- \fi
- \next{#1}#2}
-
-\gdef\dodoEIFtypefourfive% #1%
- {\endPLtypesix
- \handlenextnextpretty\dododoEIFtypefourfive\dodododoPLtypefourfive}
-
-\gdef\dododoEIFtypefourfive%
- {\ifnewpretty\expandafter\handlenewpretty\fi\dodododoEIFtypefourfive}
-
-\gdef\dodododoEIFtypefourfive#1#2%
- {\ifinPLcomment
- \getpretties{#1}{#2}%
- \else
- \ifinPLdouble
- \getpretties{#1}{#2}%
- \else
- \global\inPLcommenttrue
- \PLverbosecorrection
- \def\next{\beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty\prettynaturalfont}%
- \expandafter\next
- \fi
- \fi}
-
-% recognize `name' in comments and format them like variables
-
-\gdef\EIFtypeeightone#1%
- {\endPLtypesix
- \ifinPLcomment
- \verbatimfont
- \else
- \getpretty{#1}%
- \fi}
-
-\gdef\EIFtypeeighttwo#1%
- {\endPLtypesix
- \ifinPLcomment
- \prettynaturalfont
- \else
- {\prettynaturalfont\/%
- \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty}%
- \fi}
-
-% double quote
-
-\gdef\EIFtypenine#1%
- {\endPLtypesix
- \ifinPLcomment
- \getpretty{#1}%
- \else\ifinPLsingle
- \getpretty{#1}%
- \else\ifinPLdouble
- \global\inPLdoublefalse
- {\prettynaturalfont\/%
- \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty}%
- \else
- \global\inPLdoubletrue
- {\prettynaturalfont
- \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty}%
- \fi\fi\fi}
-
-\useprettyidentifiers \EIFidentifiers \EIFsetspecials
- alias all and as check class create creation debug deferred do else
- elseif end ensure expanded export external false feature from frozen
- if implies indexing infix inherit inspect invariant is like local
- loop not obsolete old once or prefix redefine rename require rescue
- precursor retry select separate strip then true undefine unique
- until variant when xor
-
-\useprettyidentifiers \EIFvariables \EIFsetspecials
- not-yet-defined
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/verb-ini.mkii b/Master/texmf-dist/tex/context/base/mkii/verb-ini.mkii
deleted file mode 100644
index 5a817b4bb91..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/verb-ini.mkii
+++ /dev/null
@@ -1,1789 +0,0 @@
-%D \module
-%D [ file=verb-ini,
-%D version=1997.12.22,
-%D title=\CONTEXT\ Verbatim Macros,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Today I would implement the pretty handler slightly
-%D different, using stack and intermediate flushing. Maybe
-%D even without active chars. So, someday \unknown. Also
-%D I think that there are better ways (the current approach
-%D is an accumulation; for instance, we could save a second
-%D argument by turning chars into numbers and vise versa.
-
-%D Because this module is quite independant of system macros,
-%D it can be used as a stand||alone verbatim environment.
-%D
-%D This is a sort of second release of \type{supp-ver} and
-%D therefore differs in some aspects from the implementation
-%D published in the \MAPS. The first change concern
-%D optimization of breaks, that is, the first and last two
-%D lines of verbatim blocks are kept together. The second
-%D adaption is due to the fact that I wanted to support pretty
-%D printing not only for \TEX\ sources, but also for \PERL,
-%D \METAPOST\ and probably more. The \JAVASCRIPT\ module is
-%D closely related to \PERL, so we will not mention that one
-%D again.
-
-\ifx \undefined \writestatus \input supp-mis.tex \fi
-
-%D Verbatim typesetting, especially of \TEX\ sources, is a
-%D non||trivial task. This is a direct results of the fact that
-%D characters can have \CATCODES\ other than~11 and such
-%D characters needs a special treatment. What for instance is
-%D \TEX\ supposed to do when it encounters a \type{$} or an
-%D \type{#}? This module deals with these matters.
-
-\writestatus{loading}{ConTeXt Verbatim Macros / Initialization}
-
-%D The verbatim environment has some features, like coloring
-%D \TEX\ text, seldom found in other environments. Especially
-%D when the output of \TEX\ is viewed on an electronic medium,
-%D coloring has a positive influence on the readability of
-%D \TEX\ sources, so we found it very acceptable to dedicate
-%D half of this module to typesetting \TEX\ specific character
-%D sequences in color. In this module we'll also present some
-%D macro's for typesetting inline, display and file verbatim.
-%D The macro's are capable of handling \TAB\ too.
-%D
-%D This module shows a few tricks that are often overseen by
-%D novice, like the use of the \TEX\ primitive \type{\meaning}.
-%D First I'll show in what way the users are confronted with
-%D verbatim typesetting. Because we want to be able to test for
-%D symmetry and because we hate the method of closing down the
-%D verbatim mode with some strange active character, we will
-%D use the following construction for display verbatim:
-%D
-%D \starttyping
-%D The Dutch word 'typen' stands for 'typing', therefore in the Dutch version
-%D one will not find the word 'verbatim'.
-%D \stoptyping
-%D
-%D In \CONTEXT\ files can be typed with \type{\typefile} and
-%D inline verbatim can be accomplished with \type{\type}. This
-%D last command comes in many flavors:
-%D
-%D \starttyping
-%D We can say \type<<something>> or \type{something}. The first one is a bit
-%D longer but also supports slanted typing, which accomplished by typing
-%D \type<<a <<slanted>> word>>. We can also use commands to enhance the text
-%D \type<<with <</bf boldfaced>> text>>. Just to be complete, we decided
-%D to accept also \LaTeX\ alike verbatim, which means that \type+something+
-%D and \type|something| are valid commands too. Of course we want the grouped
-%D alternatives to process \type{hello {\bf big} world} with braces.
-%D \stoptyping
-%D
-%D In the core modules, we will build this support on top of
-%D this module. There these commands can be tuned with
-%D accompanying setup commands. There we can enable commands,
-%D slanted typing, control spaces, \TAB||handling and (here we
-%D are:) coloring. We can also setup surrounding white space
-%D and indenting. Here we'll only show some examples.
-
-\unprotect
-
-%D \macros
-%D {verbatimfont}
-%D
-%D When we are typesetting verbatim we use a non||proportional
-%D (mono spaced) font. Normally this font is available by
-%D calling \type{\tt}. In \CONTEXT\ this command does a
-%D complete font||style switch. There we could have stuck with
-%D \type{\tttf}.
-
-\ifx\verbatimfont\undefined \def\verbatimfont{\tt\normalnoligatures\font} \fi
-
-\ifx\normalnoligatures\undefined \let\normalnoligatures\gobbleoneargument \fi
-
-%D \macros
-%D {obeyedspace, obeyedtab, obeyedline, obeyedpage}
-%D
-%D We have followed Knuth in naming macros that make \SPACE,
-%D \NEWLINE\ and \NEWPAGE\ active and assigning them
-%D \type{\obeysomething}, but first we set some default values.
-
-\def\obeyedspace {\hbox{ }}
-\def\obeyedtab {\obeyedspace}
-\def\obeyedline {\par}
-\def\obeyedpage {\vfill\eject}
-
-%D Because we will introduce a status variable, we can define
-%D a better \type {\obeyedspace}.
-
-\def\obeyedspace {\ifprocessingverbatim\hbox{ }\else\space\fi}
-
-%D \macros
-%D {controlspace,setcontrolspaces}
-%D
-%D First we define \type{\obeyspaces}. When we want visible
-%D spaces (control spaces) we only have to adapt the definition
-%D of \type{\obeyedspace} to:
-
-\def\controlspace{\hbox{\char32}}
-\def\normalspace { }
-\def\normalspaces{\catcode`\ =\@@space}
-
-\bgroup
-\catcode`\ =\@@active
-\gdef\obeyspaces{\catcode`\ =\@@active\def {\obeyedspace}}
-\gdef\setcontrolspaces{\catcode`\ =\@@active\def {\controlspace}}
-\egroup
-
-%D \macros
-%D {obeytabs, obeylines, obeypages,
-%D ignoretabs, ignorelines, ignorepages}
-%D
-%D Next we take care of \NEWLINE\ and \NEWPAGE\ and because we
-%D want to be able to typeset listings that contain \TAB, we
-%D have to handle those too. Because we have to redefine the
-%D \NEWPAGE\ character locally, we redefine the meaning of
-%D this (often already) active character.
-
-\catcode`\^^L=\@@active \def^^L{\par}
-
-%D The following indirect definitions enable us to implement
-%D all kind of \type{\obeyed} handlers.
-
-\bgroup
-
-\catcode`\^^I=\@@active
-\catcode`\^^M=\@@active
-\catcode`\^^L=\@@active
-
-\gdef\obeytabs {\catcode`\^^I=\@@active\def^^I{\obeyedtab}}
-\gdef\obeylines {\catcode`\^^M=\@@active\def^^M{\obeyedline}}
-\gdef\obeypages {\catcode`\^^L=\@@active\def^^L{\obeyedpage}}
-
-\gdef\ignoretabs {\catcode`\^^I=\@@active\def^^I{\obeyedspace}}
-\gdef\ignorelines {\catcode`\^^M=\@@active\def^^M{\obeyedspace}}
-\gdef\ignorepages {\catcode`\^^L=\@@ignore} % \@@active\def^^L{\obeyedline}}
-\gdef\ignoreeofs {\catcode`\^^Z=\@@ignore}
-
-%D For testing (see digit parser) we need an indirect macro
-%D in order to compare the next (\type {\next}) token
-%D (possibly \type {^^M}) being \type {\obeyedline}.
-
-\gdef\nextobeyedline{\obeyedline}
-
-\egroup
-
-%D \macros
-%D {obeycharacters}
-%D
-%D We also predefine \type{\obeycharacters}, which will
-%D enable us to implement character||specific behavior, like
-%D colored verbatim.
-
-\let\obeycharacters=\relax
-
-%D \macros
-%D {settabskips}
-%D
-%D The macro \type{\settabskip} can be used to enable tab
-%D handling. Processing tabs is sometimes needed when one
-%D processes a plain \ASCII\ listing. Tab handling slows down
-%D verbatim typesetting considerably.
-
-\bgroup
-
-\catcode`\^^I=\@@active
-
-\gdef\settabskips
- {\let\processverbatimline\doprocesstabskipline
- \catcode`\^^I\@@active
- \let^^I\doprocesstabskip}
-
-\gdef\setfixedtabskips#1%
- {\catcode`\^^I\@@active
- \def^^I{\kern#1\spaceskip}}
-
-\egroup
-
-%D \macros
-%D {processingverbatim}
-%D
-%D Typesetting a file in most cases results in more than one
-%D page. Because we don't want problems with files that are
-%D read in during the construction of the page, we set \type
-%D {\ifprocessingverbatim}, so the output routine can adapt
-%D its behavior. Originally we used \type {\scratchread}, but
-%D because we want to support nesting, we decided to use a
-%D separate input file.
-
-\newif\ifprocessingverbatim
-
-%D \macros
-%D {processinlineverbatim}
-%D
-%D Although the inline verbatim commands presented here will be
-%D extended and embedded in the core modules of \CONTEXT,
-%D they can be used separately. Both grouped and character
-%D alternatives are provided but \type{<<} and nested
-%D braces are implemented in the core module. This commands
-%D takes one argument: the closing command.
-%D
-%D \starttyping
-%D \processinlineverbatim{\closingcommand}
-%D \stoptyping
-%D
-%D One can define his own verbatim commands, which can be very
-%D simple:
-%D
-%D \starttyping
-%D \def\Verbatim {\processinlineverbatim\relax}
-%D \stoptyping
-%D
-%D or a bit more more complex:
-%D
-%D \starttyping
-%D \def\GroupedVerbatim%
-%D {\bgroup
-%D \dosomeusefullthings
-%D \processinlineverbatim\egroup}
-%D \stoptyping
-%D
-%D Before entering inline verbatim mode, we take care of the
-%D unwanted \TAB, \NEWLINE\ and \NEWPAGE\ characters and
-%D turn them into \SPACE. We need the double \type{\bgroup}
-%D construction to keep the closing command local.
-
-\def\setverbatimspaceskip
- {\setbox\scratchbox\hbox{x}%
- \spaceskip\wd\scratchbox
- \xspaceskip\spaceskip}
-
-\def\setupinlineverbatim
- {\verbatimfont
- \setverbatimspaceskip
- \let\obeytabs\ignoretabs
- \let\obeylines\ignorelines
- \let\obeypages\ignorepages
- \setupcopyverbatim}
-
-\def\doprocessinlineverbatim
- {\ifx\next\bgroup
- \setupinlineverbatim
- \catcode`\{\@@begingroup
- \catcode`\}\@@endgroup
- \def\next{\let\next=}%
- \else
- \setupinlineverbatim
- \def\next##1{\catcode`##1=\@@endgroup}%
- \fi
- \next}
-
-\def\processinlineverbatim#1%
- {\bgroup
- \processingverbatimtrue
- \localcatcodestrue % TeX processes paragraph's
- \def\endofverbatimcommand{#1\egroup}%
- \bgroup
- \aftergroup\endofverbatimcommand
- \futurelet\next\doprocessinlineverbatim}
-
-%D The closing command is executed afterwards as an internal
-%D command and therefore should not be given explicitly when
-%D typesetting inline verbatim.
-
-%D \macros
-%D {optimizeverbatim}
-%D
-%D One day, a collegue asked me why I didn't prevent breaking
-%D after a first or before a last verbatim line. At first sight
-%D I thought of using the two pass mechanism, but because we're
-%D already keeping track of individual lines, a more direct
-%D solution is possible: we just keep track of in what line
-%D we are. One can turn this feature off.
-
-\newif\ifoptimizeverbatim \optimizeverbatimtrue
-
-%D Before we implement display and file verbatim, we define
-%D some macros that deal with typesetting the individual lines.
-%D We keep track of the status by means of a character
-%D specification. This status variable tells us if we're
-%D skipping a first line or placing a first or last line.
-%D The next few examples show us where breaks are inserted.
-%D
-%D \bgroup
-%D
-%D \def\doverbatimnobreak
-%D {\nobreak\hrule width 10cm\par\penalty500} % == \nobreak
-%D
-%D \def\doverbatimgoodbreak
-%D {\nobreak\hrule width 3cm \par\penalty\linepenalty}
-%D
-%D \starttyping
-%D test
-%D test
-%D \stoptyping
-%D
-%D or
-%D
-%D \starttyping
-%D test
-%D test
-%D test
-%D test
-%D \stoptyping
-%D
-%D or
-%D
-%D \starttyping
-%D test
-%D
-%D test
-%D test
-%D test
-%D \stoptyping
-%D
-%D \egroup
-%D
-%D The long ones are \type{\nobreaks} and the short ones
-%D \type{\goodbreaks}. And this is how it's done:
-
-\def\doverbatimnobreak
- {\ifoptimizeverbatim\penalty500 \fi}
-
-\def\doverbatimgoodbreak
- {\ifoptimizeverbatim\penalty\linepenalty\fi}
-
-\def\doflushverbatimline
- {\expandafter\dodoverbatimline\expandafter{\savedverbatimline}}
-
-\def\doverbatimbeginofline#1% linenumber (optional provided by mkiv / todo)
- {\dontleavehmode
- \strut
- \the\everyline}
-
-\def\doverbatimendofline
- {\par}
-
-\def\doverbatimemptyline
- {\strut
- \par}
-
-\let\handleverbatimline=\relax
-
-% \def\initializeverbatimline%
-% {\global\let\savedverbatimline=\empty
-% \ifskipfirstverbatimline
-% \global\chardef\verbatimstatus=0
-% \else
-% \global\chardef\verbatimstatus=1
-% \fi}
-%
-% more efficient
-
-\global\chardef\verbatimstatus0
-
-\def\initializeverbatimline
- {\global\let\savedverbatimline\empty
- \global\chardef\verbatimstatus\ifskipfirstverbatimline0 \else1 \fi}
-
-\chardef\verbatimemptylinemode\zerocount
-
-\def\presetemptyverbatimline
- {\ifcase\verbatimstatus
- \global\chardef\verbatimstatus\plusone
- \or
- \ifcase\verbatimemptylinemode\or\or
- \doemptyverbatimline
- \fi
- \or
- \ifcase\verbatimemptylinemode\else
- \doemptyverbatimline
- \fi
- \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}
-
-\def\presetnormalverbatimline
- {\ifcase\verbatimstatus
- \global\chardef\verbatimstatus\plustwo
- \or
- \global\chardef\verbatimstatus\plusthree
- \or
- \global\chardef\verbatimstatus\plusthree
- \or
- \doflushverbatimline
- \global\chardef\verbatimstatus\plusfour
- \or
- \kern\zeropoint
- \doverbatimnobreak
- \doflushverbatimline
- \global\chardef\verbatimstatus\plusfive
- \or
- \doverbatimgoodbreak
- \doflushverbatimline
- \fi
- \global\let\savedverbatimline\verbatimline}
-
-\def\presetlastverbatimline
- {\ifcase \verbatimstatus
- \or
- \or
- \or
- \doflushverbatimline
- \else
- \kern \zeropoint
- \doverbatimnobreak
- \doflushverbatimline
- \fi
- \ifcase\verbatimemptylinemode\or\else
- \kern \zeropoint
- \fi}
-
-%D \macros
-%D {skipfirstverbatimline}
-%D
-%D By default the rest of the first line is ignored. We can
-%D turn this feature off by saying:
-%D
-%D \starttyping
-%D \skipfirstverbatimlinefalse
-%D \stoptyping
-
-\newif\ifskipfirstverbatimline \skipfirstverbatimlinetrue
-
-%D \macros
-%D {processdisplayverbatim}
-%D
-%D We can define a display verbatim environment with the
-%D command \type{\processdisplayverbatim} in the following way:
-%D
-%D \starttyping
-%D \processdisplayverbatim{\closingcommand}
-%D \stoptyping
-%D
-%D \noindent For instance, we can define a simple command like:
-%D
-%D \starttyping
-%D \def\BeginVerbatim {\processdisplayverbatim{EndVerbatim}}
-%D \stoptyping
-%D
-%D \noindent But we can also do more advance things like:
-%D
-%D \starttyping
-%D \def\BeginVerbatim {\bigskip \processdisplayverbatim{\EndVerbatim}}
-%D \def\EndVerbatim {\bigskip}
-%D \stoptyping
-%D
-%D When we compare these examples, we see that the backslash in
-%D the closing command is optional. One is free in actually
-%D defining a closing command. If one is defined, the command
-%D is executed after ending verbatim mode.
-
-\def\processdisplayverbatim#1%
- {\par
- \bgroup
- \escapechar=-1
- \xdef\verbatimname{\string#1}%
- \egroup
- \def\endofdisplayverbatim{\csname\verbatimname\endcsname}%
- \bgroup
- \parindent\zeropoint
- \ifdim\lastskip<\parskip
- \removelastskip
- \vskip\parskip
- \fi
- \parskip\zeropoint
- \processingverbatimtrue
- \global\linepartrue
- \expandafter\let\csname\verbatimname\endcsname\relax
- \edef\endofverbatimcommand{\csname\verbatimname\endcsname}%
- \edef\endofverbatimcommand{\meaning\endofverbatimcommand}%
- \verbatimfont
- \setverbatimspaceskip
- \global\linepartrue % needed for paragraph numbering
- \setupcopyverbatim
- \initializeverbatimline
- \copyverbatimline}
-
-%D We save the closing sequence in \type{\endofverbatimcommand}
-%D in such a way that it can be compared on a line by line
-%D basis. For the conversion we use \type{\meaning}, which
-%D converts the line to non||expandable tokens. We reset
-%D \type{\parskip}, because we don't want inter||paragraph
-%D skips to creep into the verbatim source. Furthermore we
-%D \type{\relax} the line||processing macro while getting the
-%D rest of the first line. The initialization command
-%D \type{\setupcopyverbatim} does just what we expect it to do:
-%D it assigns all characters \CATCODE~11. Next we switch to
-%D french spacing and call for obeyance.
-
-\newevery \everysetupverbatim \relax
-
-\def\setupcopyverbatim
- {\uncatcodecharacters
- \frenchspacing
- \obeyspaces
- \obeytabs
- \obeylines
- \obeypages
- \obeycharacters
- \the\everysetupverbatim}
-
-%D The main copying routine of display verbatim does an
-%D ordinary string||compare on the saved closing command and
-%D the current line. The space after \type{#1} in the
-%D definition of \type{\next} is essential! As a result of
-%D using \type{\obeylines}, we have to use \type{%}'s after
-%D each line but none after the first \type{#1}.
-
-{\obeylines%
- \long\gdef\copyverbatimline#1
- {\def\next{#1 }%
- \gdef\verbatimline{#1}%
- \ifx\next\emptyspace%
- \presetemptyverbatimline%
- \else%
- \edef\next{\meaning\next}%
- \ifx\next\endofverbatimcommand%
- \presetlastverbatimline%
- \def\copyverbatimline{\egroup\endofdisplayverbatim}%
- \else%
- \presetnormalverbatimline%
- \fi%
- \fi%
- \handleverbatimline%
- \copyverbatimline}}
-
-%D The actual typesetting of a line is done by a separate
-%D macro, which enables us to implement \TAB\ handling. The
-%D \type{\do} and \type{\dodo} macros take care of the
-%D preceding \type{\parskip}, while skipping the rest of the
-%D first line. The \type{\relax} is used as an signal.
-
-%D \macros
-%D {iflinepar}
-%D
-%D A careful reader will see that \type{\linepar} is reset.
-%D This boolean can be used to determine if the current line is
-%D the first line in a pseudo paragraph and this boolean is set
-%D after each empty line. The \type{\relax} can be used to
-%D determine the end of the line when one implements a scanner
-%D routine.
-
-\newif\iflinepar
-
-\let\doopenupverbatimline=\empty
-
-\let\beginverbatimline\relax
-\let\endverbatimline \relax
-
-\long\def\dodoverbatimline#1% we don't want to group
- {\bgroup % due to pretty status
- \iflinepar\else\EveryPar{}\fi
- \dontleavehmode % \leavevmode
- \xdef\dokeepverbatimlinedata % why was this?
- {\parindent \the\parindent
- \hangindent\the\hangindent
- \hangafter \the\hangafter
- \leftskip \the\leftskip
- \rightskip \the\rightskip}%
- \egroup
- \dokeepverbatimlinedata
- \doopenupverbatimline
- \the\everyline\strut
- \beginverbatimline
- \processverbatimline{#1\relax\flushrestofverbatimline}%
- \endverbatimline
- \global\lineparfalse
- \obeyedline\par}
-
-%D \macros
-%D {flushrestofverbatimline}
-%D
-%D Some pretty drivers will collect tokens for the sake of
-%D testing on keywords. This collected string needs to be
-%D flushed. The \type {\relax} can serve as signal that there
-%D is nothing more to be interpreted.
-
-\let\flushrestofverbatimline\empty
-
-%D \macros
-%D {obeyemptylines,verbatimbaselineskip}
-%D
-%D Empty lines in verbatim can lead to white space on top of
-%D a new page. Because this is not what we want, we turn
-%D them into vertical skips. This default behavior can be
-%D overruled by:
-%D
-%D \starttyping
-%D \obeyemptylines
-%D \stoptyping
-%D
-%D Although it would cost us only a few lines of code, we
-%D decided not to take care of multiple empty lines. When a
-%D (display) verbatim text contains more successive empty
-%D lines, this probably suits some purpose. When applicable,
-%D one can set the verbatim baselineskip.
-
-\bgroup
-\catcode`\^^L=\@@active \gdef\emptypage {^^L}
-\catcode`\^^M=\@@active \gdef\emptyline {^^M}
- \gdef\emptyspace { }
-\egroup
-
-\def\verbatimbaselineskip% We don't use \let here!
- {\baselineskip}
-
-\def\doemptyverbatimline
- {\vskip\verbatimbaselineskip
- {\setbox0\hbox{\the\everyline}}%
- \global\linepartrue}
-
-% \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
-%D mechanism. Because in verbatim mode paragraphs and lines are
-%D more or less equal, we can easily implement our own simple
-%D \type{\everyline} support.
-
-%D \macros
-%D {EveryPar, EveryLine}
-%D
-%D In this module we've reserved \type{\everypar} for the
-%D things to be done with paragraphs and \type{\everyline} for
-%D line specific actions. In \CONTEXT\ however, we use
-%D \type{\everypar} for placing side- and columnfloats,
-%D inhibiting indentation and some other purposes. In verbatim
-%D mode, every line becomes a paragraph, which means that
-%D \type{\everypar} is executed frequently. To be sure, the
-%D user specific use of both \type{\everyline} and
-%D \type{\everypar} is implemented by means of
-%D \type{\EveryLine} and \type{\EveryPar}.
-%D
-%D We still have to take care of the \TAB. A \TAB\ takes eight
-%D spaces and a \SPACE\ normally has a width of 0.5~em. Because
-%D we can be halfway a tabulation, we must keep track of the
-%D position. This takes time, especially when we print complete
-%D files, therefore we \type{\relax} this mechanism by default.
-
-\chardef\spacespertab=7
-
-\def\doprocesstabskip
- {\obeyedspace % \hskip.5em or \hbox to .5em{}
- \ifdone
- \donefalse
- \advance\scratchcounter \plusone
- \@EA\doprocesstabskip
- \else\ifnum\scratchcounter>\spacespertab
- % nothing
- \else
- \advance\scratchcounter \plusone
- \@EAEAEA\doprocesstabskip
- \fi\fi}
-
-\let\endoftabskipping=\relax % will become obsolete
-
-\def\doprocesstabskipline#1%
- {\bgroup
- \scratchcounter\plusone
- \dodoprocesstabskipline#1\relax
- \egroup}
-
-\def\dodoprocesstabskipline#1%
- {\ifnum\scratchcounter>\spacespertab\relax
- \donetrue \else \donefalse \advance
- \fi \scratchcounter \plusone
- \ifx#1\relax \else
- \ifcase\tabskipmode
- % can't happen
- \or
- % go on
- \else\ifnum`#1<128
- % ok, no special character
- \else\ifnum\catcode`#1=\active
- % quits parsing, else utf lookahead problems
- \chardef\tabskipmode\zerocount
- \fi\fi\fi
- \ifcase\tabskipmode
- \@EAEAEA#1%
- \else
- \@EAEAEA#1\@EAEAEA\dodoprocesstabskipline
- \fi
- \fi}
-
-% ^ will be replaced
-
-\chardef\tabskipmode=1 % 0=quit 1=no test 2=test on active>128
-
-\long\def\processverbatimline#1{#1} % remove the fake grouping
-
-%D \macros
-%D {processfileverbatim}
-%D
-%D The verbatim typesetting of files is done on a bit different
-%D basis. This time we don't check for a closing command, but
-%D look for \EOF\ and when we've met, we make sure it does not
-%D turn into an empty line.
-%D
-%D \starttyping
-%D \processfileverbatim{filename}
-%D \stoptyping
-%D
-%D We reserve a dedicated file handle.
-
-\newread\verbatiminput
-
-\newcount\verbatimlinenumber
-
-\let \beginofverbatimlines \relax
-\let \endofverbatimlines \relax
-
-\def\processfileverbatim#1%
- {\par
- \bgroup
- \processingverbatimtrue
- \global\verbatimlinenumber\zerocount
- \global\linepartrue
- \beginofverbatimlines
- \bgroup
- \parindent\zeropoint
- \ifdim\lastskip<\parskip
- \removelastskip
- \vskip\parskip
- \fi
- \parskip\zeropoint
- \verbatimfont
- \uncatcodecharacters
- \setverbatimspaceskip
- \frenchspacing
- \obeyspaces
- \obeytabs
- \obeylines
- \obeypages
- \obeycharacters
- \ignoreeofs
- \catcode`\^^M=\@@ignore % \par is already taken care of
-% \openin\verbatiminput=#1\relax
- \openinputfile\verbatiminput{#1}%
- \skipfirstverbatimlinefalse
- \initializeverbatimline
- \def\readline%
- {\ifeof\verbatiminput \else
- \ifx\firstverbatimfileline\empty
- \global\advance\verbatimlinenumber\plusone
- \read\verbatiminput to \verbatimline
- \else
- \let\verbatimline\firstverbatimfileline
- \let\firstverbatimfileline\empty
- \fi
- \fi
- \ifeof\verbatiminput
- \ifx\lastverbatimfileline\empty
- \presetlastverbatimline
- \let\readline\relax
- \else % we will re-enter the \ifeof branch twice
- \presetnormalverbatimline
- \def\readline%
- {\let\verbatimline\lastverbatimfileline
- \let\lastverbatimfileline\empty}%
- \fi
- \else\ifx\verbatimline\empty
- \presetemptyverbatimline
- \else\ifx\verbatimline\emptyline
- \presetemptyverbatimline
- \else\ifx\verbatimline\emptypage
- \presetemptyverbatimline
- \else
- \presetnormalverbatimline
- \fi\fi\fi\fi
- \handleverbatimline
- \readline}%
- \ifeof\verbatiminput \else
- \expandafter\readline
- \fi
- \closein\verbatiminput
- \egroup
- \endofverbatimlines
- \egroup
- \ignorespaces}
-
-%D Something new:
-
-\def\processfilelinesverbatim#1#2#3%
- {\bgroup
- \let\saveddoflushverbatimline\doflushverbatimline
- \let\saveddoemptyverbatimline\doemptyverbatimline
- \def\checkverbatimfileline##1%
- {\ifnum\verbatimlinenumber<#2\else
- \ifnum\verbatimlinenumber>#3\else
- ##1%
- \fi\fi}%
- \def\doflushverbatimline
- {\checkverbatimfileline\saveddoflushverbatimline}%
- \def\doemptyverbatimline
- {\checkverbatimfileline\saveddoemptyverbatimline}%
- \processfileverbatim{#1}%
- \egroup}
-
-%D \macros
-%D {firstverbatimfileline, lastverbatimfileline}
-%D
-%D The following two macros can be set to achieve special
-%D effects, like:
-%D
-%D \starttyping
-%D \convertargument\StartFake{something}\to\firstverbatimfileline
-%D \convertargument\StopFake\to\firstverbatimfileline
-%D \stoptyping
-%D
-%D These hooks were needed for typesetting flowchart
-%D definitions verbatim, since the temporary files does not
-%D have the start and stop commands embedded.
-
-\let\firstverbatimfileline\empty
-\let\lastverbatimfileline \empty
-
-%D One can use the different \type{\obeysomething} commands to
-%D influence the behavior of these macro's. We use for instance
-%D \type{\obeycharacters} for making \type{/} an active
-%D character when we want to include typesetting commands.
-
-%D The next part of this module deals with pretty printing. The
-%D best way to understand how pretty verbatim typeseting works
-%D is to take a look at the output produced by the \TEX, \PERL\
-%D and \METAPOST\ modules first. Each of these modules has a
-%D few setup macros that tag the individual characters with a
-%D number that itself is associated to a interpretation macro.
-%D A previous implementation linked characters (after making
-%D them active) directly to such interpreters, but the more
-%D indirect way makes it possible to inspect the next
-%D character(s) without much expansion problems and/or
-%D increasing run time.
-
-%D By the way, \TEX\ defines \type{\+} as an outer macro, so we
-%D have to redefine this one to keep ourselves out of complaints.
-
-\def\+{\tabalign}
-
-%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\!!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:
-%D
-%D \starttyping
-%D \setpretty \`A 21
-%D \stoptyping
-%D
-%D Here the macro \type{\setpretty} makes the character
-%D \type{A} active, and sets it meaning to the auxiliary macro
-%D \type{\handleprettytoken}. This auxiliary macro takes the
-%D character code (a number) and the interpretation number. The
-%D three step implementation uses the \TEX book \type{~} trick.
-
-\def\dodosetpretty
- {\!!countb=\uccode`~\relax
- \catcode\!!countb=\@@active
- \uppercase{\edef~{\noexpand\handleprettytoken{\the\!!counta}{\the\!!countb}}}}
-
-\def\dosetpretty
- {\afterassignment\dodosetpretty\!!counta}
-
-\def\setpretty
- {\afterassignment\dosetpretty\uccode`~=}
-
-%D The macro \type{\handleprettytoken} is rather trivial and
-%D calls for an interpreter macro.
-
-\def\handleprettytoken#1%
- {\csname\!!PRETTY#1\endcsname} % \getvalue{\!!PRETTY#1}}
-
-%D This interpreter is installed by saying
-%D
-%D \starttyping
-%D \installprettyhandler 21 \SOMEprettyone
-%D \stoptyping
-
-\def\installprettyhandler#1 #2%
- {\letvalue{\!!PRETTY#1}#2}
-
-%D Such an interpreter gets the character number:
-%D
-%D \starttyping
-%D \def\SOMEprettyone#1{...\getpretty{#1}...}
-%D \stoptyping
-%D
-%D where \type{\getpretty} equals \type{\char}. We can't
-%D use \type{\let} here because we have to get rid of the
-%D braces.
-
-\def\getpretty#1%
- {\char#1}
-
-%D Sometimes the action depends on the next token. This token
-%D can be passed to the macro \type{\getprettydata}, that sets
-%D \type{\prettytype} to the interpreter code. The character
-%D code is saved in \type{\prettychar}.
-
-\def\setprettydata#1#2%
- {\global\chardef\prettytype#1%
- \global\chardef\prettychar#2\relax}
-
-\def\getprettydata#1%
- {\global\chardef\prettytype\zerocount
- \global\chardef\prettychar\zerocount
- \bgroup
- \let\handleprettytoken\setprettydata
- \setbox0\hbox{#1}% expands #1 and ignores space
- \egroup}
-
-%D If needed the current and next token can be handled alongside:
-
-\def\getpretties#1#2%
- {\char#1\bgroup\let\handleprettytoken\getsecondpretty#2\egroup}
-
-\def\getsecondpretty#1#2%
- {\char#2}
-
-%D When needed, one can reassign an interpreter by using
-%D \type{\newpretty} and its associates.
-%D
-%D \bgroup
-%D \setuptyping[file][optionoptie=tex,paletpalet=colorpretty]
-%D
-%D \startbuffer
-%D \bgroup
-%D \catcode`\|=\@@escape %%\|\
-%D \catcode`\\=\@@active %%\\+
-%D |gdef|dohandlenewpretty#1%
-%D {|def|dodohandlenewpretty##1%
-%D {|def|oldprettychar{#1}%
-%D |getprettydata{##1}%
-%D |ifnum|oldprettychar=|prettychar
-%D |def|dododohandlenewpretty####1%
-%D {|getprettydata{\}%
-%D |let|oldprettytype=|prettytype
-%D |getprettydata{####1}%
-%D |ifnum|prettytype=|oldprettytype
-%D |let|next=|newpretty
-%D |else
-%D |def|next{|newprettycommand{#1}##1####1}%
-%D |fi
-%D |next}%
-%D |let|next=|dododohandlenewpretty
-%D |else
-%D |def|next{|newprettycommand{#1}##1}%
-%D |fi
-%D |next}%
-%D |def|donohandlenewpretty##1%
-%D {|newprettycommand{#1}##1}%
-%D |handlenextnextpretty|dodohandlenewpretty|donohandlenewpretty}
-%D |egroup
-%D \stopbuffer
-%D
-%D {\newprettytrue\typebuffer}
-%D
-%D In this example we see that the colors differ from what we
-%D expect, but conform the definitions in the macro. This kind
-%D of recoloring can be achieved by saying:
-%D
-%D \typebuffer
-%D
-%D We'll show some more examples:
-%D
-%D \startbuffer[pretty]
-%D \installnewpretty r \red
-%D \installnewpretty g \green
-%D \installnewpretty b \blue
-%D \stopbuffer
-%D
-%D \getbuffer[pretty]
-%D
-%D \startbuffer
-%D %%\ r{Red
-%D %%\ g\Green
-%D %%\ b[Blue
-%D \stopbuffer
-%D
-%D {\newprettytrue\typebuffer}
-%D
-%D Watch the green \type{\Green}! This lines are specified as:
-%D
-%D \typebuffer
-%D
-%D along with:
-%D
-%D \typebuffer[pretty]
-%D
-%D When needed, one can use grouping.
-%D
-%D \startbuffer
-%D {yes} %%\ B %%\{[ %%\}]
-%D {no}
-%D {no} %%\ E
-%D {yes}
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D Here we tell the visualizer that the \type +{+ should be
-%D treated like a \type +[+ so we get:
-%D
-%D {\newprettytrue\typebuffer}
-%D
-%D I won't explain the details of this mechanism. Those who
-%D want to build their own pretty interpreters have to close
-%D read the source anyway.
-%D
-%D Last we show an example of mixed pretty typesetting:
-%D
-%D \startbuffer
-%D \ziezo{test} %%\ P ##\ B##\ T % enter PERL mode %%\ E
-%D if $test eq "test" ##\ B ##\ B##\ T % begin group (\bgroup) %%\ E
-%D if $test eq "test"; ##\ T %%\ B%%\ T % enter TEX mode %%\ E
-%D \ziezo{test} %%\ M %%\ B%%\ T % enter METAPOST mode %%\ E
-%D draw (0,0)--(10,10); %%\ E ##\ B##\ T % end group (\egroup) %%\ E
-%D if $test eq "test";
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D Here we use \type{%%\ T}, \type{%%\ P} and \type{%%\ M} for
-%D switching between \TEX, \PERL\ and \METAPOST\ mode.
-%D
-%D {\newprettytrue\typebuffer}
-%D
-%D \egroup
-%D
-%D Don't forget to set:
-
-\newif\ifnewpretty
-
-\def\installnewpretty
- {\def\doinstallnewpretty##1%
- {\setvalue{NP::\the\scratchcounter}{##1}}%
- \afterassignment\doinstallnewpretty\scratchcounter=`}
-
-%D Let's define the options we used here:
-
-\newevery\everyprettyend\relax
-
-\let\prettyend=\relax
-
-\def\prettybegin
- {\bgroup\def\prettyend{\the\everyprettyend\egroup}}
-
-\installnewpretty B \prettybegin
-\installnewpretty E \prettyend
-
-\installnewpretty J \setupprettyJVtype
-\installnewpretty M \setupprettyMPtype
-\installnewpretty P \setupprettyPLtype
-\installnewpretty T \setupprettyTEXtype
-
-%D \macros
-%D {ifnaturaltextext}
-%D
-%D When one uses \ETEX, switching to normal \TEX\ is possible
-%D too. We also introduce a switch that can be used in the
-%D drivers and set in higher level shell macros.
-
-\newif\ifnaturaltextext
-
-% \starttyping
-% test /naturaltextext\hpos{word}{test}/relax test
-% \stoptyping
-%
-% \MPxy{word}
-
-\def\naturaltextext#1\relax
- {\bgroup
- \prettynaturalfont{\restorecatcodes\scantokens{\ignorespaces#1}}%
- \egroup}
-
-\def\naturaltextext#1\relax
- {\bgroup
- \def\ascii{#1}%
- \setnormalcatcodes
- \restorecatcodes
- \prettynaturalfont{\scantokens\expandafter{\ascii}\ifhmode\unskip\fi}%
- \egroup}
-
-\installnewpretty N \naturaltextext
-
-%D When seen in action this gives:
-%D
-%D \startbuffer
-%D \startTEX
-%D \def\mathematics#1% %%\ N usage: \type {\mathematics{x^2}}
-%D {\ifmmode#1\else$#1$\fi} %%\ N becomes: \mathematics{X^2}
-%D \stopTEX
-%D \stopbuffer
-%D
-%D \getbuffer
-%D
-%D This is keyed in as:
-%D
-%D \typebuffer
-
-%D This means that when the interpreter modules support this
-%D mechanism, by default we have some keys already available.
-
-\def\newpretty#1%
- {\getprettydata{#1}%
- \ifcase\prettytype
- \expandafter\nonewpretty
- \else
- \expandafter\donewpretty
- \fi
- #1}
-
-\def\nonewpretty#1#2%
- {\getprettydata{#2}%
- \getvalue{NP::\the\prettychar}}
-
-\def\donewpretty#1%
- {\bgroup
- \def\handleprettytoken##1##2##3%
- {\getprettydata{##3}%
- \egroup
- \ifcase\prettytype\else
- \setpretty##2=\prettytype\relax
- \fi}%
- #1}
-
-%D When implementing new pretty macros, one only needs to
-%D define something like:
-%D
-%D \starttyping
-%D \def\TEXtypezero%
-%D {\handlenewpretty\TEXtypethree}
-%D \stoptyping
-%D
-%D Here the number states the category (in our examples the
-%D backslash). The second argument takes care of normal
-%D situations.
-
-\def\handlenewpretty#1%
- {\let\newprettycommand=#1%
- \handlenextnextpretty\dohandlenewpretty\newprettycommand}
-
-%D The previous shown implementation only interprets single
-%D comments, but the final one also accepts double ones. The
-%D main reason for this is that in \JAVA\ we have to deal with
-%D \type{//}. Personally I prefer the double \type{%%} because
-%D is stands out and is more symmetrical with the double
-%D slash.
-
-\bgroup
-\catcode`\|=\@@escape
-\catcode`\\=\@@active
-|gdef|dohandlenewpretty#1%
- {|def|dodohandlenewpretty##1%
- {|def|oldprettychar{#1}%
- |getprettydata{##1}%
- |ifnum|oldprettychar=|prettychar
- |def|dododohandlenewpretty####1%
- {|getprettydata{\}%
- |let|oldprettytype=|prettytype
- |getprettydata{####1}%
- |ifnum|prettytype=|oldprettytype
- |let|next|newpretty
- |else
- |def|next{|newprettycommand{#1}##1####1}%
- |fi
- |next}%
- |let|next|dododohandlenewpretty
- |else
- |def|next{|newprettycommand{#1}##1}%
- |fi
- |next}%
- |def|donohandlenewpretty##1%
- {|newprettycommand{#1}##1}%
- |handlenextnextpretty|dodohandlenewpretty|donohandlenewpretty}
-|egroup
-
-%D The `nextnext' macro we used in the previous definition
-%D looks ahead. This is needed because individual lines are
-%D handles by macro's and the next character can be something
-%D that ends the line and/or does not belong to the verbatim
-%D data.
-
-\def\handlenextnextpretty#1#2#3%
- {\def\dohandlenextnextpretty%
- {\ifx\next\bgroup % something {}
- \@EA#2%
- \else\ifx\next\relax % end of line / signal
- \@EAEAEA#2%
- \else
- \@EAEAEA#1%
- \fi\fi
- {#3}}%
- \futurelet\next\dohandlenextnextpretty}
-
-%D The pretty interpreters can (and will) change the meaning of
-%D some controls. To enable them calling the originals we save
-%D their meanings and to enable nesting we permit this only
-%D once.
-
-\def\saveprettycontrols
- {\global\let\oldobeyedspace \obeyedspace
- \global\let\oldobeyedline \obeyedline
- \global\let\oldobeyedpage \obeyedpage
- \let\saveprettycontrols \relax}
-
-%D The \PERL\ and \METAPOST\ interpreters will also handle
-%D reserved words. Sets of identifiers are defined like:
-%D
-%D \starttyping
-%D \useprettyidentifiers \MODULAidentifiers \MODULAsetspecials
-%D if then else elsif case while do repeat until ...
-%D \stoptyping
-%D
-%D New entries can be added to existing sets by repeatedly
-%D using this command.
-
-\def\useprettyidentifiers#1#2% \variable \presetcatcodes
- {\bgroup
- \ifx#1\undefined
- \global\let#1=\empty
- \fi
- \def\handleprettytoken##1##2{\char##2}%
- #2\relax
- \def\douseprettyidentifiers##1\par%
- {\xdef#1{\space#1\space##1}%
- \egroup}%
- \douseprettyidentifiers}
-
-%D We can test om identifiers with:
-
-\def\doifprettyidentifierelse#1%
- {\doifincsnameelse{\space#1\space}}
-
-%D \macros
-%D {prettyidentifierfont,prettyvariablefont,prettynaturalfont}
-%D
-%D When one want to typeset identifiers and system variables
-%D in a different typeface, one has to set the next two
-%D variables.
-
-\let\prettyidentifierfont=\relax
-\let\prettyvariablefont =\relax
-\let\prettynaturalfont =\relax
-
-%D The interpreter macros are loaded at run time. The main
-%D reason lays in the fact that we don't want to have the
-%D identifier lists hard coded in the format file. To prevent
-%D repetitive loading, one should load the modules before the
-%D first call to the macros.
-%D
-%D \starttyping
-%D \input verb-tex.tex
-%D \input verb-pl.tex
-%D \input verb-mp.tex
-%D \input verb-jv.tex
-%D \stoptyping
-%D
-%D In \CONTEXT\ we follow a different thread, and therefore all
-%D macros in the additional modules use \type {\gdef}'s and
-%D \type {\doglobal}'s. Manipulating \type {\globaldef} is
-%D possible but leads to fuzzy situations.
-
-%D \macros
-%D {ifdisablepretty,disableprettynow,disableprettyafterwards}
-%D
-%D Although for pretty printing \PERL\ and \JAVASCRIPT\ code
-%D one has to implement a bit more clever mechanism, the next
-%D switches can be used to turn off pretty printing. The
-%D boolean turns on this feature.
-
-\newif\ifdisablepretty \disableprettyfalse
-\newif\ifprettydisabled \prettydisabledfalse
-
-\def\disableprettynow
- {\ifdisablepretty\ifprettydisabled\else
- \let\prettyidentifierfont\relax
- \let\prettyvariablefont\relax
- \let\prettycomment\relax
- \def\beginofpretty[##1]{}%
- \let\endofpretty\relax
- \prettydisabledtrue
- \fi\fi}
-
-\def\disableprettyafterwards
- {\ifdisablepretty\ifprettydisabled\else
- \def\endofpretty{\normalendofpretty\disableprettynow}%
- \fi\fi}
-
-\def\enableprettynow
- {\prettydisabledfalse
- \let\prettyidentifierfont\normalprettyidentifierfont
- \let\prettyvariablefont \normalprettyvariablefont
- \let\prettynaturalfont \normalprettynaturalfont
- \let\beginofpretty \normalbeginofpretty
- \let\endofpretty \normalendofpretty}
-
-%D This feature is hooked into the verbatim line handling
-%D routine with:
-
-\def\beginverbatimline
- {\prettydisabledfalse
- \ifnewpretty\else\let\handlenewpretty\empty\fi % moved
- \let\normalprettyidentifierfont\prettyidentifierfont
- \let\normalprettyvariablefont \prettyvariablefont
- \let\normalprettynaturalfont \prettynaturalfont
- \let\normalbeginofpretty \beginofpretty
- \let\normalendofpretty \endofpretty}
-
-\def\endverbatimline
- {\enableprettynow}
-
-%D The rest of this module is dedicated to non \CONTEXT\ users
-%D and shows an example of an verbatim environment based on the
-%D previous macros.
-%D
-%D The macro's can be used to construct the commands we
-%D mentioned in the beginning of this documentation. We leave
-%D this to the fantasy of the reader and only show some \PLAIN\
-%D \TEX\ alternatives for display verbatim and listings. We
-%D define three commands for typesetting inline text, display
-%D text and files verbatim. The inline alternative also accepts
-%D user supplied delimiters.
-%D
-%D
-%D \type{text}
-%D
-%D \starttyping
-%D ... verbatim text ...
-%D \stoptyping
-%D
-%D \typefile{filename}
-%D
-%D We can turn on the options by:
-%D
-%D \starttyping
-%D \controlspacetrue
-%D \verbatimtabstrue
-%D \prettyverbatimtrue
-%D \stoptyping
-%D
-%D Here is the implementation:
-
-\newif\ifcontrolspace
-\newif\ifverbatimtabs
-\newif\ifprettyverbatim
-
-\ifCONTEXT \else
-
- \def\presettyping
- {\ifcontrolspace \let\obeyspace \setcontrolspace \fi
- \ifverbatimtabs \let\obeytabs \settabskips \fi
- \ifprettyverbatim \let\obeycharacters\setupprettytype \fi}
-
- \def\type
- {\bgroup
- \def\_{\string_}%
- \def\^{\string^}%
- \presettyping
- \processinlineverbatim\egroup}
-
- \def\starttyping
- {\bgroup
- \presettyping
- \processdisplayverbatim\stoptyping}
-
- \def\stoptyping
- {\egroup}
-
- \def\typefile#1%
- {\bgroup
- \presettyping
- \processfileverbatim{#1}%
- \egroup}
-
-\fi
-
-%D In \CONTEXT\ users say things like:
-%D
-%D \starttyping
-%D \definetyping [TEX] [option=TEX]
-%D \definetyping [MP] [option=MP]
-%D \definetyping [PL] [option=PL]
-%D \definetyping [JV] [option=JV]
-%D \stoptyping
-%D
-%D or
-%D
-%D \starttyping
-%D \setuptyping[file][option=color]
-%D \stoptyping
-%D
-%D That way \CONTEXT\ selects the appropriate interpreter
-%D itself, but more on that in another module. In other
-%D packages one can define:
-
-\ifCONTEXT \else
-
- \input verb-tex.mkii
- \input verb-mp.mkii
-
- \def\startTEX
- {\bgroup \everypar{}%
- \let\obeycharacters\setupprettyTEXtype
- \processdisplayverbatim{\stopTEX}}
-
- \def\startMP
- {\bgroup \everypar{}%
- \let\obeycharacters\setupprettyMPtype
- \processdisplayverbatim{\stopMP}}
-
- \let\stopTEX=\egroup
- \let\stopMP =\egroup
-
-\fi
-
-%D This following poor mans implementation of color is based on
-%D PostScript. One can of course use grayscales too. In the
-%D core modules these macros are redefined to using the color
-%D mechanism present in \CONTEXT.
-
-\ifCONTEXT \else
-
- \def\setcolorverbatim
- {\def\prettyone {.9 .0 .0 } % red
- \def\prettytwo {.0 .8 .0 } % green
- \def\prettythree {.0 .0 .9 } % blue
- \def\prettyfour {.8 .8 .6 } % yellow
- \def\beginofpretty[##1]%
- {\special{ps:: \csname##1\endcsname setrgbcolor}}
- \def\endofpretty%
- {\special{ps:: 0 0 0 setrgbcolor}}} % black
-
- \def\setgrayverbatim
- {\def\prettyone {.30 } % gray
- \def\prettytwo {.45 } % gray
- \def\prettythree {.60 } % gray
- \def\prettyfour {.75 } % gray
- \def\beginofpretty[##1]%
- {\special{ps:: \csname##1\endcsname setgray}}
- \def\endofpretty%
- {\special{ps:: 0 setgray}}} % black
-
-\fi
-
-%D One can redefine these two commands after loading this
-%D module. When available, one can also use appropriate
-%D font||switch macro's. We default to color.
-
-\ifCONTEXT \else \setcolorverbatim \fi
-
-%D Here come the commands that are responsible for entering and
-%D leaving the two states. As we can see, they've got much in
-%D common.
-
-%D The previous version of this module was published in the
-%D \MAPS\ of the dutch \TEX\ users group \NTG. In that article,
-%D the verbatim part of the text was typeset with the following
-%D commands for the examples:
-%D
-%D \starttyping
-%D \def\starttyping% We simplify the \ConTeXt\ macro.
-%D {\bgroup
-%D \everypar{} % We disable some troublesome mechanisms.
-%D \advance\leftskip by 1em
-%D \processdisplayverbatim{\stoptyping}}
-%D
-%D \let\stoptyping=\egroup
-%D \stoptyping
-%D
-%D We also used:
-%D
-%D \starttyping
-%D \def\startdefinition%
-%D {\bgroup
-%D \everypar{} % Again we disable some troublesome mechanisms.
-%D \let\obeycharacters=\setupprettyTEXtype % See verb-tex.tex!
-%D \EveryPar{\showparagraphcounter}%
-%D \EveryLine{\showlinecounter}%
-%D \verbatimbodyfont
-%D \processdisplayverbatim{\stopdefinition}}
-%D
-%D \def\stopdefinition%
-%D {\egroup}
-%D \stoptyping
-%D
-%D And because we have both \type{\EveryPar} and
-%D \type{\EveryLine} available, we can implement a dual
-%D numbering mechanism:
-%D
-%D \starttyping
-%D \newcount\paragraphcounter
-%D \newcount\linecounter
-%D
-%D \def\showparagraphcounter%
-%D {\llap
-%D {\bgroup
-%D \counterfont
-%D \hbox to 4em
-%D {\global\advance\paragraphcounter by 1
-%D \hss \the\paragraphcounter \hskip2em}%
-%D \egroup
-%D \hskip1em}}
-%D
-%D \def\showlinecounter%
-%D {\llap
-%D {\bgroup
-%D \counterfont
-%D \hbox to 2em
-%D {\global\advance\linecounter by 1
-%D \hss \the\linecounter}%
-%D \egroup
-%D \hskip1em}}
-%D \stoptyping
-%D
-%D One may have noticed that the \type{\EveryPar} is only
-%D executed once, because we consider each piece of verbatim
-%D as one paragraph. When one wants to take the empty lines
-%D into account, the following assignments are appropriate:
-%D
-%D \starttyping
-%D \EveryLine
-%D {\iflinepar
-%D \showparagraphcounter
-%D \fi
-%D \showlinecounter}
-%D \stoptyping
-%D
-%D In this case, nothing has to be assigned to \type{\EveryPar},
-%D maybe except of just another extra numbering scheme. The
-%D macros used to typeset this documentation are a bit more
-%D complicated, because we have to take take 'long' margin
-%D lists into account. When such a list exceeds the previous
-%D pargraph we postpone placement of the paragraph number till
-%D there's room. This way so it does not clash with the margin
-%D words.
-
-%D Normally such commands have to be embedded in a decent setup
-%D structure, where options can be set at will.
-%D
-%D Now let's summarize the most important commands.
-%D
-%D \starttyping
-%D \processinlineverbatim{\closingcommand}
-%D \processdisplayverbatim{\closingcommand}
-%D \processfileverbatim{filename}
-%D \stoptyping
-%D
-%D We can satisfy our own specific needs with the following
-%D interfacing macro's:
-%D
-%D \starttyping
-%D \obeyspaces \obeytabs \obeylines \obeypages \obeycharacters
-%D \stoptyping
-%D
-%D We can influence the verbatim environment with the following
-%D macro:
-%D
-%D \starttyping
-%D \obeyemptylines
-%D \stoptyping
-%D
-%D Some needs are fulfilled already with:
-%D
-%D \starttyping
-%D \setcontrolspace \settabskips
-%D \stoptyping
-%D
-%D lines can be enhanced with ornaments using:
-%D
-%D \starttyping
-%D \everypar \everyline \iflinepar
-%D \stoptyping
-%D
-%D and pretty verbatim support is implemented by:
-%D
-%D \starttyping
-%D \beginofpretty[#1] ... \endofpretty
-%D \stoptyping
-%D
-%D and some setup macro, like:
-%D
-%D \starttyping
-%D \setupprettyIDENTIFIERtype
-%D \stoptyping
-%D
-%D The color support macro can be redefined by the user. The
-%D parameter \type{#1} can be one of the four 'fixed'
-%D identifiers {\em prettyone}, {\em prettytwo}, {\em
-%D prettythree} and {\em prettyfour}. We have implemented a
-%D more or less general PostScript color support mechanism,
-%D using \type{specials}. One can toggle between color and
-%D grayscale with:
-%D
-%D \starttyping
-%D \setgrayverbatim \setcolorverbatim
-%D \stoptyping
-
-%D \macros
-%D {permitshiftedendofverbatim}
-%D
-%D We did not mention one drawback of the mechanism described
-%D here. The closing command must start at the first position
-%D of the line. In \CONTEXT\ we will not have this drawback,
-%D because we can test if the end command is a substring of the
-%D current line. The testing is done by two of the support
-%D macros, which of course are not available in a stand alone
-%D application of this module.
-
-\ifCONTEXT
-
- \let\doifendofverbatim=\doifelse
-
- \def\permitshiftedendofverbatim
- {\let\doifendofverbatim\doifinstringelse}
-
- {\obeylines%
- \long\gdef\copyverbatimline#1
- {\convertargument#1 \to\next%
- \gdef\verbatimline{#1}%
- \ifx\next\emptyspace%
- \presetemptyverbatimline%
- \else%
- \doifendofverbatim{\endofverbatimcommand}{\next}%
- {\presetlastverbatimline%
- \def\copyverbatimline{\egroup\endofdisplayverbatim}}%
- {\presetnormalverbatimline}%
- \fi%
- \handleverbatimline%
- \copyverbatimline}}
-
-%D As a bonus, we provide the next alternative, which takes
-%D end tags like \type {Hello World!}.
-
- \def\doprocessdisplayverbatim#1#2%
- {\par
- \beginofverbatimlines
- \bgroup
- \escapechar-1
- \xdef\verbatimname{\string#2}%
- \egroup
- \ifcase#1%
- \let\endofdisplayverbatim\relax
- \else
- \def\endofdisplayverbatim{\endofverbatimlines\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\processdisplayverbatim {\doprocessdisplayverbatim1}
- \def\processtaggeddisplayverbatim{\doprocessdisplayverbatim0}
-
-\fi
-
-%D \macros
-%D {installprettyescape}
-%D
-%D The next feature is dedicated to Fabrice Popineau who
-%D wanted math inside verbatim.
-
-\def\prettyescapecnt{255}
-
-\def\installprettyescape
- {\dodoubleempty\doinstallprettyescape}
-
-\def\doinstallprettyescape[#1][#2]#3 #4%
- {\bgroup
- \doglobal\decrement\prettyescapecnt
- \def\docommand##1%
- {\def\next{\dodoinstallprettyescape{##1}{#3}{#4}}%
- \catcode`#3=\@@active
- \@EA\scantokens\@EA{\next}}%
- \iffirstargument
- \processcommalist[#1]\docommand
- \else
- \docommand\empty
- \fi}
-
-\def\dodoinstallprettyescape#1#2#3%
- {\unexpanded\setgvalue{PRETTY@#1@\prettyescapecnt}##1##2#2{#3{##2}}%
- \expanded % we need to freeze the counter
- {\doglobal\noexpand\appendtoks
- \noexpand\doif{#1}\noexpand\prettyidentifier
- {\noexpand\setpretty`\string#2=\prettyescapecnt
- \noexpand\installprettyhandler \prettyescapecnt\space\getvalue{PRETTY@#1@\prettyescapecnt}}%
- }\to \everysetupverbatim
- \egroup}
-
-%D An example of its usage is:
-%D
-%D \startbuffer
-%D \def\xverbatimmath#1#2{\naturaltextext\mathematics{#1}\relax}
-%D \def\yverbatimmath#1#2{\naturaltextext\mathematics{[[#1]]}\relax}
-%D \def\zverbatimmath#1#2{\naturaltextext\mathematics{(#1)}\relax}
-%D
-%D \installprettyescape [MP] $ \xverbatimmath
-%D \installprettyescape [MP] ~ \yverbatimmath
-%D \installprettyescape [MP] * \zverbatimmath
-%D
-%D \startMP
-%D if $x>10$ :
-%D $x := 20$
-%D ~x := 20~
-%D *x := 20*
-%D end
-%D \stopMP
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/verb-js.mkii b/Master/texmf-dist/tex/context/base/mkii/verb-js.mkii
deleted file mode 100644
index c249bd9bb2c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/verb-js.mkii
+++ /dev/null
@@ -1,171 +0,0 @@
-%D \module
-%D [ file=verb-js,
-%D version=1998.02.07,
-%D title=\CONTEXT\ Verbatim Macros,
-%D subtitle=Pretty \JAVASCRIPT\ Verbatim,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Verbatim Macros / Pretty JavaScript Verbatim}
-
-%D In \CONTEXT\ we support \JAVASCRIPT\ inclusion in \PDF\
-%D documents and thereby enter the field of authoring. Of
-%D course we also want to pretty print such scripts, that look
-%D like:
-%D
-%D \startJS
-%D alfa = beta*2 ; // both alfa and beta are numbers // indeed
-%D if (odd(alfa))
-%D { do_something() }
-%D else
-%D { do_nothing() } /* As we can see /* in this example */ there
-%D how_about(alfa) ; is no fi needed. Also no semicolons are
-%D or_about(beta) ; needed after a right brace. */
-%D \stopJS
-%D
-%D Because \JAVASCRIPT\ looks much like \PERL, we will use
-%D a slightly adapted \PERL\ visualization. First we load the
-%D \PERL\ module:
-
-\ifdefined\setupprettyPLtype \else \loadmarkfile{verb-pl} \fi
-
-\unprotect
-
-%D The main difference between the \JAVASCRIPT\ and \PERL\
-%D interpreters concern comments. Where \TEX, \METAPOST\ and
-%D \PERL\ have one comment symbol (\type{%}, \type{%} and
-%D \type{#}), \JAVA\ has the one line comment sequence
-%D \type{//} and the multi line comment delimiters \type{/*}
-%D and \type{*/}.
-%D
-%D We need a counter to keep track of multi line comment
-%D nesting.
-
-\newcount\JScommentlevel
-
-%D We handle both \type{%} and \type{#} a bit different:
-
-\gdef\JSsetspecials%
- {\PLsetspecials
- \setpretty`\#=32
- \setpretty`\%=41
- \setpretty`\/=43
- \setpretty`\*=44 }
-
-%D We also need a few more handlers: one for \type{//} and
-%D \type{/*} and one for \type{*/}.
-
-\gdef\JSsethandlers%
- {\PLsethandlers
- \installprettyhandler 43 \JStypefourthree
- \installprettyhandler 44 \JStypefourfour }
-
-%D We can inherit most of the settings:
-
-\gdef\JSsetcontrols%
- {\PLsetcontrols
- \def\flushrestofverbatimline%
- {\endPLtypesix
- \ifcase\JScommentlevel \inPLcommentfalse \fi
- \PLverbosefalse
- \PLverboseskipped=0}}
-
-\gdef\JSsetvariables
- {\PLsetvariables
- \global\JScommentlevel=0 }
-
-\gdef\setupprettyJStype%
- {\def\prettyidentifier{JS}%
- \let\PLidentifiers=\JSidentifiers
- \let\PLvariables=\JSvariables
- \JSsetvariables
- \JSsetcontrols
- \JSsethandlers
- \JSsetspecials
- \PLsetdiagnostics}
-
-%D The main complication is that we have to look upto four
-%D characters ahead. Such macros are hard to understand but
-%D they do work!
-
-\gdef\JStypefourthree%
- {\handlenextnextpretty\doJStypefourthree\PLtypefourtwo}
-
-\gdef\doJStypefourthree#1#2%
- {\getprettydata{#2}%
- \ifnum\prettytype=43
- \let\next=\dodoJStypefourthree
- \else\ifnum\prettytype=44
- \global\advance\JScommentlevel by 1
- \global\inPLcommenttrue
- \PLverbosecorrection
- \let\next=\JStogglecomment
- \else
- \let\next=\PLtypefourtwo
- \fi\fi
- \next{#1}#2}
-
-\gdef\JStogglecomment#1#2%
- {\ifnum\JScommentlevel=1
- \beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty
- \else
- \getpretties{#1}{#2}%
- \fi}
-
-\gdef\dodoJStypefourthree% #1%
- {\endPLtypesix
- \handlenextnextpretty\dododoJStypefourthree\dodododoPLtypefourthree}
-
-\gdef\dododoJStypefourthree%
- {\ifnewpretty\expandafter\handlenewpretty\fi\dodododoJStypefourthree}
-
-\gdef\dodododoJStypefourthree#1#2%
- {\ifinPLcomment
- \getpretties{#1}{#2}%
- \else
- \global\inPLcommenttrue
- \PLverbosecorrection
- \ifnaturaltextext
- \let\next\naturaltextext
- \else
- \def\next{\beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty}%
- \fi
- \expandafter\next
- \fi}
-
-\gdef\JStypefourfour%
- {\handlenextnextpretty\doJStypefourfour\PLtypefourtwo}
-
-\gdef\doJStypefourfour#1#2%
- {\getprettydata{#2}%
- \ifnum\prettytype=43
- \JStogglecomment{#1}#2%
- \global\advance\JScommentlevel by -1
- \ifcase\JScommentlevel \global\inPLcommentfalse \fi
- \else
- \endPLtypesix
- \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty
- \expandafter#2%
- \fi}
-
-%D We need different (less) reserved words. This list replaces
-%D the \PERL\ one.
-
-\useprettyidentifiers \JSidentifiers \JSsetspecials
- abstract boolean break byte case catch char class const
- continue default delete do double else extends false final
- finally float for function goto if implements import in
- instanceof int interface long native new null package
- private protected public return short static super switch
- synchronized this throw throws transient true try var void
- while with
-
-\useprettyidentifiers \JSvariables \JSsetspecials
- not-yet-defined
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/verb-jv.mkii b/Master/texmf-dist/tex/context/base/mkii/verb-jv.mkii
deleted file mode 100644
index 2149c3a4abc..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/verb-jv.mkii
+++ /dev/null
@@ -1,222 +0,0 @@
-%D \module
-%D [ file=verb-jv,
-%D version=2002.02.27,
-%D title=\CONTEXT\ Verbatim Macros,
-%D subtitle=Pretty \JAVA\ Verbatim,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Verbatim Macros / Pretty Java Verbatim}
-
-%D This module differs from the \JAVASCRIPT\ driver in its
-%D handling of comments. We also need a few more handlers: one
-%D for \type {//} and \type {/*} and one for \type {*/} as
-%D well as the \JAVA doc trigger \type {/**}.
-
-%D We build this driver on top of the \PERL\ one. Since this
-%D driver looks much like the \JAVASCRIPT\ one, we don't
-%D comment it extensively.
-
-\ifdefined\setupprettyPLtype \else \loadmarkfile{verb-pl} \fi
-
-\unprotect
-
-\newcount\JVcommentlevel
-
-\gdef\JVsetspecials
- {\PLsetspecials
- \setpretty`\#=32
- \setpretty`\%=41
- \setpretty`\-=45
- \setpretty`\/=43
- \setpretty`\*=44 }
-
-\gdef\JVsethandlers
- {\PLsethandlers
- \installprettyhandler 43 \JVtypefourthree
- \installprettyhandler 44 \JVtypefourfour
- \installprettyhandler 45 \JVtypefourfive }
-
-\gdef\JVsetcontrols
- {\PLsetcontrols
- \def\flushrestofverbatimline
- {\endPLtypesix
- \ifcase\JVcommentlevel \inPLcommentfalse \fi
- \PLverbosefalse
- \PLverboseskipped=0}}
-
-\gdef\JVsetvariables
- {\PLsetvariables
- \global\JVcommentlevel=0 }
-
-\gdef\setupprettyJVtype
- {\def\prettyidentifier{JV}%
- \let\PLidentifiers\JVidentifiers
- \let\PLvariables\JVvariables
- \JVsetvariables
- \JVsetcontrols
- \JVsethandlers
- \JVsetspecials
- \PLsetdiagnostics}
-
-\gdef\JVtypefourthree
- {\handlenextnextpretty\doJVtypefourthree\PLtypefourtwo}
-
-\gdef\doJVtypefourthree#1#2#3%
- {\getprettydata{#2}%
- \ifnum\prettytype=43
- \let\next\dodoJVtypefourthree
- \else\ifnum\prettytype=44
- \global\advance\JVcommentlevel 1
- \global\inPLcommenttrue
- \PLverbosecorrection
- \getprettydata{#3}%
- \ifnum\prettytype=44
- \inPLdoctrue
- \fi
- \let\next\JVtogglecomment
- \else
- \let\next\PLtypefourtwo
- \fi\fi
- \next{#1}#2#3}
-
-\gdef\JVtogglecomment#1#2%
- {\ifnum\JVcommentlevel=1
- \beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty
- \else
- \getpretties{#1}{#2}%
- \fi}
-
-\gdef\dodoJVtypefourthree
- {\endPLtypesix
- \handlenextnextpretty\dododoJVtypefourthree\dodododoPLtypefourthree}
-
-\gdef\dododoJVtypefourthree
- {\ifnewpretty\expandafter\handlenewpretty\fi\dodododoJVtypefourthree}
-
-\gdef\dodododoJVtypefourthree#1#2%
- {\ifinPLcomment
- \getpretties{#1}{#2}%
- \else
- \global\inPLcommenttrue
- \PLverbosecorrection
- \ifnaturaltextext
- \let\next\naturaltextext
- \else
- \def\next{\beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty}%
- \fi
- \expandafter\next
- \fi}
-
-\gdef\JVtypefourfour
- {\ifinPLdoc
- \@EA\noJVtypefourfour
- \else
- \@EA\handlenextnextpretty\@EA\doJVtypefourfour\@EA\PLtypefourtwo
- \fi}
-
-\gdef\noJVtypefourfour#1#2%
- {\getprettydata{#2}%
- \ifnum\prettytype=43
- \JVtogglecomment{#1}#2%
- \inPLdocfalse
- \global\advance\JVcommentlevel -1
- \ifcase\JVcommentlevel \global\inPLcommentfalse \fi
- \else
- \ifPLdocdone
- \getpretty{#1}%
- \else
- \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty
- \PLdocdonetrue
- \fi
- \expandafter#2%
- \fi}
-
-\gdef\doJVtypefourfour#1#2%
- {\getprettydata{#2}%
- \ifnum\prettytype=43
- \JVtogglecomment{#1}#2%
- \inPLdocfalse
- \global\advance\JVcommentlevel -1
- \ifcase\JVcommentlevel \global\inPLcommentfalse \fi
- \else
- \endPLtypesix
- \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty
- \expandafter#2%
- \fi}
-
-\gdef\JVtypefourfive % permit - in javadoc @tags
- {\ifinPLdoc
- \@EA\PLtypesixtwo
- \else
- \@EA\PLtypefourone
- \fi}
-
-\useprettyidentifiers \JVidentifiers \JVsetspecials
- abstract assert boolean break byte case catch char class const
- continue default do double else extends false final
- finally float for goto if implements import instanceof
- int interface long native new null package private protected
- public return short static strictfp super switch synchronized
- this throw throws transient true try void volatile while
-
-\useprettyidentifiers \JVvariables \JVsetspecials
- @author @docRoot @deprecated @exception @inheritDoc @link
- @linkplain @param @return @see @serial @serialData @serialField
- @since @throws @value @version
-
-%D The \JAVA doc feature was requested by Robert F.~Beeger,
-%D who also provided this test class:
-%D
-%D \startJV
-%D package de.jwamalpha.handling.web.rbdipl;
-%D
-%D import java.io.IOException;
-%D import java.io.PrintWriter;
-%D import javax.servlet.http.HttpServlet;
-%D import javax.servlet.http.HttpServletRequest;
-%D import javax.servlet.http.HttpServletResponse;
-%D import javax.servlet.ServletException;
-%D
-%D /**
-%D * The simple login servlet
-%D *
-%D * @author Robert F. Beeger
-%D * @version 1.0
-%D */
-%D
-%D public class LoginServlet extends HttpServlet
-%D {
-%D //
-%D // public interface
-%D //
-%D /**
-%D * Process the get-request.
-%D *
-%D * @param request the request
-%D * @param response the response.
-%D */
-%D protected void doGet (HttpServletRequest request, HttpServletResponse response)
-%D throws ServletException, IOException
-%D {
-%D response.setContentType("text/html");
-%D PrintWriter writer = response.getWriter();
-%D writer.println("<html>");
-%D writer.println(" <head>");
-%D writer.println(" <title>Login</title>");
-%D writer.println(" </head>");
-%D writer.println(" <body>");
-%D writer.println(" Hallo, Benutzer " + request.getParameter("username") + "!");
-%D writer.println(" </body>");
-%D writer.println("</html>");
-%D writer.flush();
-%D }
-%D }
-%D \stopJV
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/verb-mp.mkii b/Master/texmf-dist/tex/context/base/mkii/verb-mp.mkii
deleted file mode 100644
index aef52217d8c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/verb-mp.mkii
+++ /dev/null
@@ -1,364 +0,0 @@
-%D \module
-%D [ file=verb-mp,
-%D version=1997.12.22,
-%D title=\CONTEXT\ Verbatim Macros,
-%D subtitle=Pretty \METAPOST\ Verbatim,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Verbatim Macros / Pretty METAPOST Verbatim}
-
-% bug: in mp-char.mp the char should not be highlighted
-
-% can be simplified
-
-%D This module was first used when I documented our new
-%D company logo. This interpreter is modeled after the \PERL\
-%D one.
-%D
-%D \startMP
-%D beginfig(1);
-%D z1 = (0,0);
-%D z2 = (100,0);
-%D z3 = (0,100);
-%D draw z1--z2--z3--cycle;
-%D endfig;
-%D \stopMP
-%D
-%D Of course we cannot (yet) provide a nice layout, so some
-%D formatting is still needed.
-
-\unprotect
-
-%D \macros
-%D {prettyMPvariables}
-%D
-%D Identifiers and system variables are typeset in a different
-%D style. One can turn of this mechanism for the variables by
-%D setting th enext boolean.
-%D
-
-\doglobal\newif\ifprettyMPvariables
-
-\global\prettyMPvariablestrue
-
-%D We support \METAFONT\ as well as \METAPOST.
-
-\gdef\MPsetcontrols
- {\saveprettycontrols
- \everyprettyend
- {\endMPtypesix}%
- \def\obeyedspace%
- {\endMPtypesix
- \oldobeyedspace}%
- \def\flushrestofverbatimline%
- {\endMPtypesix}%
- \let\obeytabs=\ignoretabs}
-
-\gdef\setupprettyMPtype
- {\def\prettyidentifier{MP}%
- \global\inMPtexmodefalse
- \MPsetvariables
- \MPsetcontrols
- \MPsethandlers
- \MPsetspecials}
-
-\doglobal\newif\ifinMPtexmode
-
-\gdef\MPsetvariables
- {\global\inMPtexmodefalse
- \global\let\MPsequence=\empty}
-
-\gdef\MPsetspecials
- {\setpretty`\;=11 \setpretty`\$=12 \setpretty`\@=12 \setpretty`\#=12
- \setpretty`\%=20
- \setpretty`\[=31 \setpretty`\]=31 \setpretty`\(=32 \setpretty`\)=32
- \setpretty`\:=33 \setpretty`\==34 \setpretty`\<=34 \setpretty`\>=34
- \setpretty`\-=41 \setpretty`\+=41 \setpretty`\/=41 \setpretty`\*=41
- \setpretty`\|=41 \setpretty`\`=41 \setpretty`\!=41 \setpretty`\?=41
- \setpretty`\^=41 \setpretty`\&=42
- \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`\'=81 \setpretty`\"=82
- \setpretty`\{=90 \setpretty`\}=90 }
-
-\gdef\MPsethandlers
- {\installprettyhandler 11 \MPtypeone
- \installprettyhandler 12 \MPtypeone
- \installprettyhandler 20 \MPtypetwo
- \installprettyhandler 31 \MPtypethreeA
- \installprettyhandler 32 \MPtypethreeA
- \installprettyhandler 33 \MPtypethreeB
- \installprettyhandler 34 \MPtypethreeB
- \installprettyhandler 41 \MPtypefour
- \installprettyhandler 42 \MPtypefour
- \installprettyhandler 50 \MPtypefive
- \installprettyhandler 61 \MPtypesixone
- \installprettyhandler 62 \MPtypesixtwo
- \installprettyhandler 70 \MPtypeseven
- \installprettyhandler 81 \MPtypeeightone
- \installprettyhandler 82 \MPtypeeighttwo
- \installprettyhandler 90 \MPtypenine }
-
-\gdef\MPtypeone#1%
- {\endMPtypesix
- \ifinMPtexmode
- \getpretty{#1}%
- \else
- \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty%
- \fi}
-
-\gdef\doMPtypetwo#1%
- {\ifnaturaltextext
- \let\next\naturaltextext
- \else
- \disableprettytrue\disableprettyafterwards
- \def\next{\beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty}%
- \fi
- \next}
-
-\gdef\MPtypetwo
- {\endMPtypesix
- \ifnewpretty\expandafter\handlenewpretty\fi\doMPtypetwo}
-
-\gdef\MPtypethreeA#1%
- {\endMPtypesix
- \ifinMPtexmode
- \getpretty{#1}%
- \else
- \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty
- \fi}
-
-\gdef\MPtypethreeB#1%
- {\endMPtypesix
- \ifinMPtexmode
- \getpretty{#1}%
- \else
- \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty
- \fi}
-
-\gdef\MPtypefour#1%
- {\endMPtypesix
- \ifinMPtexmode
- \getpretty{#1}%
- \else
- \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty
- \fi}
-
-\gdef\MPtypefive#1%
- {\endMPtypesix
- \ifinMPtexmode
- \getpretty{#1}%
- \else
- \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty
- \fi}
-
-\gdef\endMPtypesix
- {\ifx\MPsequence\empty\else
- \doifprettyidentifierelse{\MPsequence}{\MPidentifiers}
- {\doifprettyidentifierelse{\MPsequence}{\MPbtex}
- {\beginofpretty[\!!prettytwo]%
- {\prettyidentifierfont\MPsequence}%
- \endofpretty
- \global\inMPtexmodetrue}
- {\ifinMPtexmode
- \doifprettyidentifierelse{\MPsequence}{\MPetex}
- {\global\inMPtexmodefalse}{}%
- \fi
- \beginofpretty[\!!prettytwo]%
- {\prettyidentifierfont\MPsequence}%
- \endofpretty}}
- {\ifprettyMPvariables
- \doifprettyidentifierelse{\MPsequence}{\MPvariables}
- {\beginofpretty[\!!prettytwo]%
- {\prettyvariablefont\MPsequence}%
- \endofpretty}
- {\MPsequence}%
- \else
- \MPsequence
- \fi}%
- \global\let\MPsequence=\empty
- \fi}
-
-\gdef\MPtypesixone
- {\endMPtypesix
- \getpretty}
-
-\gdef\MPtypesixtwo#1%
- {\xdef\MPsequence{\MPsequence\getpretty{#1}}}
-
-\gdef\MPtypeseven#1%
- {\endMPtypesix
- \ifinMPtexmode
- \getpretty{#1}%
- \else
- \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty
- \fi}
-
-\gdef\MPtypeeightone#1%
- {\endMPtypesix
- \ifinMPtexmode
- \getpretty{#1}%
- \else
- \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty
- \fi}
-
-\gdef\MPtypeeighttwo#1%
- {\endMPtypesix
- \ifinMPtexmode
- \getpretty{#1}%
- \else
- \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty
- \fi}
-
-\gdef\MPtypenine#1%
- {\endMPtypesix
- \ifinMPtexmode
- \getpretty{#1}%
- \else
- \getpretty{#1}%
- \fi}
-
-%D \METAPOST\ \TEX||ies:
-
-\useprettyidentifiers \MPbtex \MPsetspecials
- btex verbatimtex
-
-\useprettyidentifiers \MPetex \MPsetspecials
- etex
-
-\useprettyidentifiers \MPidentifiers \MPsetspecials
- btex etex verbatimtex
-
-%D \METAPOST\ internal variables \& predefined variables:
-
-\useprettyidentifiers \MPidentifiers \MPsetspecials
- charcode day linecap linejoin miterlimit month pausing
- prologues showstopping time tracingcapsules tracingchoices mpprocset
- tracingcommands tracingequations tracinglostchars
- tracingmacros tracingonline tracingoutput tracingrestores
- tracingspecs tracingstats tracingtitles truecorners
- warningcheck year
-
-\useprettyidentifiers \MPvariables \MPsetspecials
- ahangle ahlength bboxmargin defaultpen defaultscale
- labeloffset background currentpen currentpicture cuttings
- defaultfont extra_beginfig extra_endfig
-
-%D \METAPOST\ predefined constants:
-
-\useprettyidentifiers \MPidentifiers \MPsetspecials
- false nullpicture pencircle true
-
-\useprettyidentifiers \MPvariables \MPsetspecials
- beveled black blue bp butt cc cm dd ditto down epsilon
- evenly fullcircle green halfcircle identity in infinity left
- mitered mm origin pensquare pt quartercircle red right
- rounded squared unitsquare up white withdots
-
-%D \METAPOST\ operators:
-
-\useprettyidentifiers \MPidentifiers \MPsetspecials
- and angle arclength arctime ASCII bluepart boolean bot
- char color cosd cycle decimal directiontime floor fontsize
- greenpart hex infont intersectiontimes known length llcorner
- lrcorner makepath makepen mexp mlog normaldeviate not
- numeric oct odd or path pair pen penoffset picture point
- postcontrol precontrol redpart reverse rotated scaled
- shifted sind slanted sqrt str string subpath substring
- transform transformed ulcorner uniformdeviate unknown
- urcorner xpart xscaled xxpart xypart ypart yscaled yxpart
- yypart zscaled
-
-\useprettyidentifiers \MPvariables \MPsetspecials
- abs bbox ceiling center cutafter cutbefore dir
- directionpoint div dotprod intersectionpoint inverse mod lft
- round rt unitvector whatever
-
-%D \METAPOST\ commands:
-
-\useprettyidentifiers \MPidentifiers \MPsetspecials
- addto clip input interim let newinternal save setbounds
- shipout show showdependencies showtoken showvariable
- special
-
-\useprettyidentifiers \MPvariables \MPsetspecials
- cutdraw draw drawarrow drawdblarrow fill filldraw
- loggingall pickup tracingall tracingnone undraw unfill
- unfilldraw drawdot
-
-%D \METAPOST\ macro||like functions:
-
-\useprettyidentifiers \MPvariables \MPsetspecials
- buildcycle dashpattern decr dotlabel dotlabels drawoptions
- incr label labels max min thelabel z
-
-%D More \METAPOST:
-
-\useprettyidentifiers \MPidentifiers \MPsetspecials
- begingroup endgroup of curl tension and controls
- reflectedabout rotatedaround interpath on off beginfig
- endfig def vardef enddef epxr suffix text primary secondary
- tertiary primarydef secondarydef tertiarydef top bottom
- ulft urt llft lrt randomseed also contour doublepath
- withcolor withpen dashed if else elseif fi for endfor
- forsuffixes forever downto upto step until end
-
-%D \METAFONT\ stuff:
-
-\useprettyidentifiers \MPidentifiers \MPsetspecials
- charlist extensible fontdimen headerbyte kern ligtable
- boundarychar chardp charext charht charic charwd designsize
- fontmaking charexists
-
-\useprettyidentifiers \MPvariables \MPsetspecials
- beginchar blacker capsule_end change_width
- define_blacker_pixels define_corrected_pixels
- define_good_x_pixels define_good_y_pixels
- define_horizontal_corrected_pixels define_pixels
- define_whole_blacker_pixels define_whole_pixels
- define_whole_vertical_blacker_pixels
- define_whole_vertical_pixels endchar extra_beginchar
- extra_endchar extra_setup font_coding_scheme
- font_extra_space
-
-%D \METAFONT\ no||op stuff:
-
-\useprettyidentifiers \MPidentifiers \MPsetspecials
- cullit currenttransform gfcorners grayfont hround
- imagerules lowres_fix nodisplays notransforms openit
- displaying currentwindow screen_rows screen_cols
- pixels_per_inch cull display openwindow numspecial
- totalweight autorounding fillin proofing tracingpens
- xoffset chardx granularity smoothing turningcheck yoffset
- chardy hppp tracingedges vppp
-
-%D \METAPOST\ goodies:
-
-\useprettyidentifiers \MPidentifiers \MPsetspecials
- extra_beginfig extra_endfig mpxbreak
-
-\protect
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/verb-pas.mkii b/Master/texmf-dist/tex/context/base/mkii/verb-pas.mkii
deleted file mode 100644
index 71c0b5a1252..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/verb-pas.mkii
+++ /dev/null
@@ -1,266 +0,0 @@
-%D \module
-%D [ file=verb-pas,
-%D version=1999.12.09,
-%D title=\CONTEXT\ Verbatim Macros,
-%D subtitle=Pretty \PASCAL\ and \MODULA\ Verbatim,
-%D author=Berend de Boer,
-%D date=\currentdate,
-%D copyright={Berend de Boer \& Hans Hagen}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% This module will be cleaned up a bit in the process of more
-% flexible verbatim options.
-
-\writestatus{loading}{ConTeXt Verbatim Macros / Pretty PASCAL Verbatim}
-
-%D Typeset Pascal(-like) code:
-%D
-%D \startbuffer
-%D \startPAS
-%D program Hello;
-%D
-%D begin
-%D writeln('hello world.');
-%D end.
-%D \stopPAS
-%D \stopbuffer
-%D
-%D Berend's preferences:
-%D
-%D \startbuffer[setup]
-%D \setuptyping
-%D [DELPHI]
-%D [palet=,icommand=\bf,vcommand=,ccommand=\it]
-%D \stopbuffer
-
-\ifdefined\setupprettyPLtype \else \loadmarkfile{verb-pl} \fi
-
-\unprotect
-
-\doglobal\newif\ifinPASbracketcomment
-\doglobal\newif\ifinPASslashstarcomment
-\doglobal\newif\ifinPASslashslashcomment
-
-
-\gdef\PASsetspecials%
- {\PLsetspecials
- \setpretty`\#=32
- \setpretty`\%=41
- \setpretty`\:=41
- \setpretty`\/=43
- \setpretty`\*=44
- \setpretty`\{=45 \setpretty`\}=46 }
-
-\gdef\PASsethandlers%
- {\PLsethandlers
- \installprettyhandler 43 \PAStypefourthree
- \installprettyhandler 44 \PAStypefourfour
- \installprettyhandler 45 \PAStypefourfive
- \installprettyhandler 46 \PAStypefoursix }
-
-\gdef\PASsetcontrols%
- {\PLsetcontrols
- \def\flushrestofverbatimline%
- {\endPLtypesix
- \ifinPASslashslashcomment
- \PASstopslashslashcomment
- \fi
- \PLverbosefalse
- \PLverboseskipped=0}}
-
-\gdef\PASsetvariables
- {\PLsetvariables
- \global\inPASbracketcommentfalse
- \global\inPASslashstarcommentfalse
- \global\inPASslashslashcommentfalse}
-
-\gdef\setupprettyPAStype%
- {\def\prettyidentifier{PAS}%
- \let\PLidentifiers=\PASidentifiers
- \let\PLvariables=\PASvariables
- \PASsetvariables
- \PASsetcontrols
- \PASsethandlers
- \PASsetspecials
- \PLsetdiagnostics}
-
-% the // and /* comments
-
-\gdef\PAStypefourthree%
- {\handlenextnextpretty\doPAStypefourthree\PLtypefourtwo}
-
-\gdef\doPAStypefourthree#1#2%
- {\endPLtypesix
- \ifinPLcomment
- \let\next=\PLtypefourtwo
- \else
- \ifinPLsingle
- \let\next=\PLtypefourtwo
- \else
- \getprettydata{#2}%
- \ifnum\prettytype=43
- \PLverbosecorrection
- \let\next=\PASstartslashslashcomment
- \else\ifnum\prettytype=44
- \PLverbosecorrection
- \let\next=\PASstartslashstarcomment
- \else
- \let\next=\PLtypefourtwo
- \fi\fi
- \fi
- \fi
- \next{#1}#2}
-
-\gdef\PASstartslashstarcomment#1#2%
- {\global\inPLcommenttrue
- \global\inPASslashstarcommenttrue
- \prettynaturalfont
- \beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty}
-
-\gdef\PASstopslashstarcomment#1#2%
- {\beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty
- \verbatimfont
- \global\inPLcommentfalse
- \global\inPASslashstarcommentfalse}
-
-\gdef\PASstartslashslashcomment#1#2%
- {\global\inPLcommenttrue
- \global\inPASslashslashcommenttrue
- \prettynaturalfont
- \beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty}
-
-\gdef\PASstopslashslashcomment%
- {\verbatimfont
- \inPLcommentfalse
- \inPASslashslashcommentfalse}
-
-% \gdef\dodoPAStypefourthree% #1%
-% {\endPLtypesix
-% \handlenextnextpretty\dododoPAStypefourthree\dodododoPLtypefourthree}
-
-% \gdef\dododoPAStypefourthree%
-% {\ifnewpretty\expandafter\handlenewpretty\fi\dodododoPAStypefourthree}
-
-% \gdef\dodododoPAStypefourthree#1#2%
-% {\ifinPLcomment
-% \getpretties{#1}{#2}%
-% \else
-% \global\inPLcommenttrue
-% \PLverbosecorrection
-% \beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty
-% \fi}
-
-\gdef\PAStypefourfour%
- {\handlenextnextpretty\doPAStypefourfour\PLtypefourtwo}
-
-\gdef\doPAStypefourfour#1#2%
- {\ifinPASslashstarcomment
- \getprettydata{#2}%
- \ifnum\prettytype=43
- \PASstopslashstarcomment{#1}#2%
- \else
- \endPLtypesix
- \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty
- \expandafter#2%
- \fi
- \else
- \endPLtypesix
- \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty
- \expandafter#2%
- \fi}
-
-
-% the { and } comments
-% we assume { is closed by } and do not follow the braindead Standard
-% Pascal standard in this respect
-% Note: brackets are not output correctly if natural font is \tf.
-% Therefore natural font is default to \tttf now (Hans is this ok??)
-% You have to use postscript fonts it seems to get brackets in that case.
-
-\gdef\PAStypefourfive#1%
- {\endPLtypesix
- \ifinPLcomment
- \getpretty{#1}%
- \else
- \ifinPLsingle
- \getpretty{#1}%
- \else
- \global\inPLcommenttrue
- \global\inPASbracketcommenttrue
- \prettynaturalfont
- \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty
- \fi
- \fi}
-
-\gdef\PAStypefoursix#1%
- {\endPLtypesix
- \ifinPASbracketcomment
- \prettynaturalfont\beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty
- \verbatimfont
- \global\inPLcommentfalse
- \global\inPASbracketcommentfalse
- \else
- \getpretty{#1}%
- \fi}
-
-
-% Standard Pascal keywords (ISO/IEC 7185)
-
-\useprettyidentifiers \PASidentifiers \PASsetspecials
- and array begin case const div do downto else end file
- for function goto if in label mod nil not of or packed
- procedure program record repeat set then to type until
- var while with
-
-% Standard Pascal directives (ISO/IEC 7185)
-
-\useprettyidentifiers \PASidentifiers \PASsetspecials
- forward
-
-% Extended Pascal keywords (ISO/IEC 10206)
-
-\useprettyidentifiers \PASidentifiers \PASsetspecials
- and_then bindable export import module only or_else
- otherwise pow protected qualified restricted
-
-% Extended Pascal directives (ISO/IEC 10206)
-
-\useprettyidentifiers \PASidentifiers \PASsetspecials
- implementation interface
-
-% Object Pascal keywords (draft September 20, 1993)
-
-\useprettyidentifiers \PASidentifiers \PASsetspecials
- abstract class constructor destructor inherited is
- property view
-
-% Object Pascal directives (draft September 20, 1993)
-
-\useprettyidentifiers \PASidentifiers \PASsetspecials
- override
-
-% Delphi keywords
-
-\useprettyidentifiers \PASidentifiers \PASsetspecials
- as asm dispinterface except exports finalization finally
- initialization inline library object out raise resourcestring
- shl shr string threadvar try unit uses xor
-
-% Delphi directives
-% the read and write directive have been skipped
-% as they're pretty common procedure calls too
-
-\useprettyidentifiers \PASidentifiers \PASsetspecials
- absolute assembler automated cdecl contains default dispid
- dynamic external far implements index message name near
- nodefault overload override package pascal private protected
- public published readonly register reintroduce requires
- resident safecall stdcall stored virtual writeonly
-
-\useprettyidentifiers \PASvariables \PASsetspecials
- not-yet-defined
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/verb-pl.mkii b/Master/texmf-dist/tex/context/base/mkii/verb-pl.mkii
deleted file mode 100644
index 634a0a3142a..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/verb-pl.mkii
+++ /dev/null
@@ -1,547 +0,0 @@
-%D \module
-%D [ file=verb-pl,
-%D version=1997.12.22,
-%D title=\CONTEXT\ Verbatim Macros,
-%D subtitle=Pretty \PERL\ Verbatim,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Verbatim Macros / Pretty PERL Verbatim}
-
-%D When I rewrote \TEXUTIL\ in \PERL\ I decided to write a
-%D pretty \PERL\ interpreter too. In fact, this was the main
-%D reason for rewriting the pretty verbatim mechanisms to
-%D handle more that \TEX.
-%D
-%D \startPL
-%D $alfa = $beta{gamma};
-%D if ($alfa="delta")
-%D { print "epsilon" }
-%D \stopPL
-%D
-%D When looking at the macros, watch the \type{\doglobal}'s!
-%D They're something \CONTEXT\ specific.
-
-\unprotect
-
-%D \macros
-%D {prettyPLvariables}
-%D
-%D Identifiers and system variables get a special treatment.
-%D One can disable this option for the variables by resetting
-%D the next switch.
-
-\doglobal\newif\ifprettyPLvariables
-
-\global\prettyPLvariablestrue
-
-%D As said before, the global assignment is needed in
-%D \CONTEXT\ (for once||only loading on demand).
-
-\doglobal\newif\ifinPLsingle
-\doglobal\newif\ifinPLdouble
-\doglobal\newif\ifinPLcomment
-\doglobal\newif\ifinPLdoc % only used in java filter
-\doglobal\newif\ifPLdocdone % only used in java filter
-\doglobal\newif\ifPLverbose
-
-\newcount\PLverboseskipped
-
-\gdef\PLverbosecorrection%
- {\ifnum\PLverboseskipped>0
- \obeyedspace
- \advance\PLverboseskipped -1
- \@EA\PLverbosecorrection
- \fi}
-
-\gdef\PLsetcontrols%
- {\saveprettycontrols
- \def\obeyedspace%
- {\endPLtypesix
- \ifPLverbose
- \advance\PLverboseskipped 1
- \else
- \oldobeyedspace
- \fi}%
- \def\flushrestofverbatimline%
- {\endPLtypesix
- \global\inPLcommentfalse}%
- \def\obeyedline%
- {\PLverbosefalse
- \PLverboseskipped=0
- \PLdocdonefalse
- \oldobeyedline}%
- \let\obeytabs=\ignoretabs}
-
-\gdef\JVsetcontrols%
- {\PLsetcontrols
- {\endPLtypesix
- \ifcase\JVcommentlevel \inPLcommentfalse \fi
- \PLverbosefalse
- \PLverboseskipped=0}}
-
-\gdef\setupprettyPLtype%
- {\def\prettyidentifier{PL}%
- \PLsetvariables
- \PLsetcontrols
- \PLsethandlers
- \PLsetspecials
- \PLsetdiagnostics}
-
-\gdef\PLsetvariables%
- {\global\inPLsinglefalse
- \global\inPLdoublefalse
- \global\inPLcommentfalse
- \global\let\PLsequence=\empty
- \global\let\PLprefix=\empty}
-
-\gdef\PLsetspecials%
- {\setpretty`\{=10 \setpretty`\}=10
- \setpretty`\$=21 \setpretty`\@=21 \setpretty`\%=22
- \setpretty`\[=31 \setpretty`\]=31 \setpretty`\(=32 \setpretty`\)=32
- \setpretty`\==32 \setpretty`\~=32 \setpretty`\<=32 \setpretty`\>=32
- \setpretty`\-=41 \setpretty`\+=41 \setpretty`\/=41 \setpretty`\*=41
- \setpretty`\|=41 \setpretty`\`=41 \setpretty`\!=41 \setpretty`\?=41
- \setpretty`\^=41 \setpretty`\&=42
- \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`\_=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`\;=71 \setpretty`\:=72 \setpretty`\,=71 \setpretty`\.=71
- \setpretty`\'=80
- \setpretty`\"=90
- \setpretty`\#= 0 }
-
-\gdef\PLsethandlers%
- {\installprettyhandler 10 \PLtypeone
- \installprettyhandler 21 \PLtypetwo
- \installprettyhandler 22 \PLtypetwo
- \installprettyhandler 31 \PLtypethree
- \installprettyhandler 32 \PLtypethree
- \installprettyhandler 41 \PLtypefourone
- \installprettyhandler 42 \PLtypefourtwo
- \installprettyhandler 50 \PLtypefive
- \installprettyhandler 61 \PLtypesixone
- \installprettyhandler 62 \PLtypesixtwo
- \installprettyhandler 71 \PLtypesevenone
- \installprettyhandler 72 \PLtypeseventwo
- \installprettyhandler 80 \PLtypeeight
- \installprettyhandler 90 \PLtypenine
- \installprettyhandler 0 \PLtypezero}
-
-\gdef\PLtypeone#1%
- {\ifinPLdouble
- \PLverbosefalse
- \ifinPLcomment
- \endPLtypesix
- \getpretty{#1}%
- \else\ifx\PLprefix\empty
- \endPLtypesix
- \getpretty{#1}%
- \else
- \endPLtypesix
- \xdef\PLprefix{\getpretty{#1}}%
- \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty
- \fi\fi
- \else
- \endPLtypesix
- \ifinPLcomment
- \getpretty{#1}%
- \else\ifinPLsingle
- \getpretty{#1}%
- \else
- \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty
- \fi\fi
- \fi}
-
-% \gdef\PLtypetwo#1%
-% {\endPLtypesix
-% \xdef\PLprefix{\getpretty{#1}}%
-% \ifinPLcomment
-% \getpretty{#1}%
-% \else\ifinPLsingle
-% \getpretty{#1}%
-% \else\ifinPLdouble
-% \getprettydata{#1}%
-% \ifnum\prettytype=21
-% \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty
-% \else
-% \getpretty{#1}%
-% \fi
-% \else
-% \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty
-% \fi\fi\fi}
-
-\gdef\PLtypetwo#1%
- {\endPLtypesix
- \ifinPLdoc
- \xdef\PLsequence{\PLsequence\getpretty{#1}}%
- \else\ifinPLcomment
- \getpretty{#1}%
- \else\ifinPLsingle
- \getpretty{#1}%
- \else\ifinPLdouble
- \getprettydata{#1}%
- \ifnum\prettytype=21
- \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty
- \else
- \getpretty{#1}%
- \fi
- \else
- \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty
- \fi\fi\fi\fi}
-
-\gdef\PLtypethree#1%
- {\endPLtypesix
- \ifinPLcomment
- \getpretty{#1}%
- \else\ifinPLsingle
- \getpretty{#1}%
- \else\ifinPLdouble
- \getprettydata{#1}%
- \ifnum\prettytype=31
- \ifx\PLprefix\empty
- \getpretty{#1}%
- \else
- \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty
- \fi
- \else
- \getpretty{#1}%
- \fi
- \else
- \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty
- \fi\fi\fi}
-
-\gdef\PLtypefourone#1%
- {\endPLtypesix
- \ifinPLcomment
- \getpretty{#1}%
- \else\ifinPLsingle
- \getpretty{#1}%
- \else\ifinPLdouble
- \getpretty{#1}%
- \else
- \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty
- \fi\fi\fi}
-
-\gdef\doPLtypefourtwo#1#2%
- {\PLverbosefalse
- \getprettydata{#2}%
- \ifnum\prettytype=62
- \expandafter\PLtypetwo
- \else
- \expandafter\PLtypefourone
- \fi
- {#1}#2}
-
-\gdef\PLtypefourtwo%
- {\handlenextnextpretty\doPLtypefourtwo\PLtypefourone}
-
-\gdef\doPLtypefiveA#1#2%
- {\endPLtypesix
- \ifinPLcomment
- \getpretties{#1}{#2}%
- \else\ifinPLsingle
- \getprettydata{#2}%
- \ifnum\prettytype=50
- \beginofpretty[\!!prettytwo]\getpretties{#1}{#2}\endofpretty
- \else\ifnum\prettytype=80
- \beginofpretty[\!!prettytwo]\getpretties{#1}{#2}\endofpretty
- \else
- \getpretties{#1}{#2}%
- \fi\fi
- \else
- \beginofpretty[\!!prettytwo]\getpretties{#1}{#2}\endofpretty
- \fi\fi}
-
-\gdef\doPLtypefiveB#1%
- {\endPLtypesix
- \ifinPLcomment
- \getpretty{#1}%
- \else\ifinPLsingle
- \getpretty{#1}%
- \else
- \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty
- \fi\fi}
-
-\gdef\PLtypefive%
- {\ifPLverbose
- \expandafter\PLtypesixtwo
- \else
- \expandafter\handlenextnextpretty\expandafter\doPLtypefiveA\expandafter\doPLtypefiveB
- \fi}
-
-% \gdef\endPLtypesix%
-% {\ifx\PLsequence\empty\else
-% \ifinPLcomment
-% \PLsequence
-% \else\ifinPLsingle
-% \PLsequence
-% \else\ifinPLdouble
-% \PLsequence
-% \else\ifPLverbose
-% \beginofpretty[\!!prettytwo]\PLsequence\endofpretty
-% \PLverbosefalse
-% \else\ifx\PLprefix\empty
-% \doifprettyidentifierelse{\PLsequence}{\PLverboses}
-% {\PLverbosetrue\PLverboseskipped=3 }
-% {\doifprettyidentifierelse{\PLsequence}{\PLidentifiers}
-% {\beginofpretty[\!!prettytwo]%
-% {\prettyidentifierfont\PLsequence}%
-% \endofpretty}
-% {\ifprettyPLvariables
-% \doifprettyidentifierelse{\PLsequence}{\PLvariables}
-% {\beginofpretty[\!!prettytwo]%
-% {\prettyvariablefont\PLsequence}%
-% \endofpretty}
-% {\PLsequence}%
-% \else
-% \PLsequence
-% \fi}}%
-% \else\ifprettyPLvariables
-% \doifprettyidentifierelse{\PLprefix\PLsequence}{\PLvariables}
-% {\beginofpretty[\!!prettytwo]%
-% {\prettyvariablefont\PLsequence}%
-% \endofpretty}
-% {\PLsequence}%
-% \else
-% \PLsequence
-% \fi\fi\fi\fi\fi\fi
-% \global\let\PLsequence=\empty
-% \global\let\PLprefix=\empty
-% \fi}
-
-\gdef\endPLtypesix
- {\ifx\PLsequence\empty\else
- \ifinPLdoc
- \doendPLtypesixvar\!!prettythree
- \else\ifinPLcomment
- \PLsequence
- \else\ifinPLsingle
- \PLsequence
- \else\ifinPLdouble
- \PLsequence
- \else\ifPLverbose
- \beginofpretty[\!!prettytwo]\PLsequence\endofpretty
- \PLverbosefalse
- \else\ifx\PLprefix\empty
- \doendPLtypesix\!!prettytwo
- \else\ifprettyPLvariables
- \doendPLtypesixvar\!!prettytwo
- \else
- \PLsequence
- \fi\fi\fi\fi\fi\fi\fi
- \global\let\PLsequence\empty
- \global\let\PLprefix\empty
- \fi}
-
-\gdef\doendPLtypesix#1%
- {\doifprettyidentifierelse{\PLsequence}{\PLverboses}
- {\PLverbosetrue\PLverboseskipped=3 }
- {\doifprettyidentifierelse{\PLsequence}{\PLidentifiers}
- {\beginofpretty[#1]%
- {\prettyidentifierfont\PLsequence}%
- \endofpretty}
- {\ifprettyPLvariables
- \doifprettyidentifierelse{\PLsequence}{\PLvariables}
- {\beginofpretty[#1]%
- {\prettyvariablefont\PLsequence}%
- \endofpretty}
- {\PLsequence}%
- \else
- \PLsequence
- \fi}}}
-
-\gdef\doendPLtypesixvar#1%
- {\doifprettyidentifierelse{\PLprefix\PLsequence}{\PLvariables}
- {\beginofpretty[#1]%
- {\prettyvariablefont\PLsequence}%
- \endofpretty}
- {\PLsequence}}
-
-\gdef\PLtypesixone
- {\ifx\PLsequence\empty
- \expandafter\getpretty
- \else
- \expandafter\PLtypesixtwo
- \fi}
-
-% \gdef\PLtypesixtwo#1%
-% {\ifinPLcomment
-% \getpretty{#1}%
-% \else\ifinPLsingle
-% \getpretty{#1}%
-% \else\ifinPLdouble
-% \ifx\PLprefix\empty
-% \getpretty{#1}%
-% \else
-% \xdef\PLsequence{\PLsequence\getpretty{#1}}%
-% \fi
-% \else
-% \xdef\PLsequence{\PLsequence\getpretty{#1}}%
-% \fi\fi\fi}
-
-\gdef\PLtypesixtwo#1%
- {\ifinPLdoc
- \xdef\PLsequence{\PLsequence\getpretty{#1}}%
- \else\ifinPLcomment
- \getpretty{#1}%
- \else\ifinPLsingle
- \getpretty{#1}%
- \else\ifinPLdouble
- \ifx\PLprefix\empty
- \getpretty{#1}%
- \else
- \xdef\PLsequence{\PLsequence\getpretty{#1}}%
- \fi
- \else
- \xdef\PLsequence{\PLsequence\getpretty{#1}}%
- \fi\fi\fi\fi}
-
-\gdef\PLtypesevenone#1%
- {\endPLtypesix
- \getpretty{#1}}
-
-\gdef\PLtypeseventwo%
- {\handlenextnextpretty\doPLtypeseventwo\PLtypesevenone}
-
-\gdef\doPLtypeseventwo#1#2%
- {\getprettydata{#2}%
- \ifnum\prettytype=72
- \PLtypesixtwo{#1}\PLtypesixtwo{#1}%
- \else
- \PLtypesevenone{#1}\expandafter#2%
- \fi}
-
-\gdef\PLtypeeight#1% single quote
- {\endPLtypesix
- \ifinPLcomment
- \getpretty{#1}%
- \else\ifinPLdouble
- \getpretty{#1}%
- \else\ifinPLsingle
- \global\inPLsinglefalse
- \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty
- \else
- \global\inPLsingletrue
- \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty
- \fi\fi\fi}
-
-\gdef\PLtypenine#1% double quote
- {\endPLtypesix
- \ifinPLcomment
- \getpretty{#1}%
- \else\ifinPLsingle
- \getpretty{#1}%
- \else\ifinPLdouble
- \global\inPLdoublefalse
- \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty
- \else
- \global\inPLdoubletrue
- \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty
- \fi\fi\fi}
-
-\gdef\PLtypezero%
- {\endPLtypesix
- \ifnewpretty\expandafter\handlenewpretty\fi\doPLtypezero}
-
-\gdef\doPLtypezero#1%
- {\ifinPLcomment
- \getpretty{#1}%
- \else
- \global\inPLcommenttrue
- \PLverbosecorrection
- \ifnaturaltextext % non tested yet
- \let\next\naturaltextext
- \else
- \def\next{\beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty}%
- \fi
- \expandafter\next
- \fi}
-
-\gdef\doreportprettyPLtype#1#2#3#4%
- {#1%
- [PERL \string#2 typing conflict, use \string#3 instead]
- \writestatus
- {PERL typing}
- {use \string#3 instead of \string#2 to enable propper visualization}%
- \global#4%
- \expandafter\doemptyverbatimline
- \fi}
-
-\gdef\reportprettyPLtype%
- {\doreportprettyPLtype\ifinPLsingle'\'\inPLsinglefalse
- \doreportprettyPLtype\ifinPLdouble"\"\inPLdoublefalse}
-
-\gdef\PLsetdiagnostics%
- {\let\normaldoemptyverbatimline=\doemptyverbatimline
- \def\doemptyverbatimline%
- {\normaldoemptyverbatimline
- \reportprettyPLtype}}
-
-%D The official \PERL\ version 5 keywords:
-
-\useprettyidentifiers \PLidentifiers \PLsetspecials
- abs accept alarm and atan atan2 bind binmode bless caller
- chdir chmod chomp chop chown chr chroot close closedir cmp
- connect continue cos crypt dbmclose dbmopen defined delete
- die do dump each echo else elsif endgrent endhostent
- endnetent endprotoend endpwent endservent eof eq eval exec
- exists exit exp fcntl fileno flock for foreach fork format
- formline getc getgrent getgrgid getgrnam gethostbyaddr
- gethostbyname gethostent getlogin getnetbyaddr getnetbyname
- getnetent getpeername getpgrp getppid getpriority
- getprotobyname getprotobynumber getprotoent getpwent
- getpwnam getpwuid getservbyname getservbyport getservent
- getsockname getsockopt glob gmtime goto grep gt hex if
- import index int integer ioctl join keys kill last lc
- lcfirst le length lib link listen local localtime log lstat
- lt map method mkdir msgctl msgget msgrcv msgsnd my ne next
- no not oct open opendir or ord pack package pipe pop pos
- print printf process prompt push quotemeta rand read readdir
- readlink recv redo ref rename require reset return reverse
- rewinddir rindex rmdir scalar seek seekdir select semctl
- semget semop send setgrent sethostent setnetent setpgrp
- setpriority setprotoent setpwent setservent setsockopt shift
- shmctl shmget shmread shmwrite shutdown sin sleep socket
- socketpair sort splice split sprintf sqrt srand stat strict
- study sub subs substr symlink syscall sysopen sysread system
- syswrite tell telldir tie tied time times times truncate uc
- ucfirst ucmask umask unary undef unless unlink unpack
- unshift untie until use utime values vars vec wait waitpid
- wantarray warn warn while write xor
-
-%D Additional module keywords (still incomplete):
-
-\useprettyidentifiers \PLvariables \PLsetspecials
- Getopt::Long
- $Getopt::Long::passthrough
- $Getopt::Long::autoabbrev
- &GetOptions
-
-%D A funny hack. When prefixes by \type{TEX}, a \type{\csname}
-%D is typeset as \TEX\ sequence.
-
-\useprettyidentifiers \PLverboses \PLsetspecials
- TEX
-
-\protect
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/verb-raw.mkii b/Master/texmf-dist/tex/context/base/mkii/verb-raw.mkii
deleted file mode 100644
index 43a0891a039..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/verb-raw.mkii
+++ /dev/null
@@ -1,7 +0,0 @@
-\ifdefined\setupprettyPLtype \else \loadmarkfile{verb-pl} \fi
-
-\gdef\setupprettyRAWtype%
- {\setupprettyTEXtype
- \def\prettyidentifier{RAW}}
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/verb-sql.mkii b/Master/texmf-dist/tex/context/base/mkii/verb-sql.mkii
deleted file mode 100644
index f145607f819..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/verb-sql.mkii
+++ /dev/null
@@ -1,230 +0,0 @@
-%D \module
-%D [ file=verb-sql,
-%D version=2000.05.09,
-%D title=\CONTEXT\ Verbatim Macros,
-%D subtitle=Pretty \SQL\ Verbatim,
-%D author={Berend de Boer \& Hans Hagen},
-%D date=\currentdate,
-%D copyright={Berend de Boer \& Hans Hagen}]
-%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 Verbatim Macros / Pretty SQL Verbatim}
-
-%D \quotation {He, I want pretty pretting too!}, Berend cried out
-%D one day, \quotation {But now for \SQL.}. This query language
-%D shows code like:
-%D
-%D \startbuffer
-%D \startSQL
-%D select * -- some comment
-%D from tableA
-%D where 1 = 2
-%D \stopSQL
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D and this should become something pretty like:
-%D
-%D \getbuffer
-%D
-%D or, with Berend's preferences:
-%D
-%D \startbuffer[setup]
-%D \setuptyping
-%D [SQL]
-%D [text=yes,palet=,icommand=\bf,vcommand=,ccommand=\it]
-%D \stopbuffer
-%D
-%D \getbuffer[setup]
-%D \getbuffer
-%D
-%D This kind of pretty printing is accomplished by:
-%D
-%D \typebuffer
-
-%D Like we did with the \JAVASCRIPT\ driver, we will borrow
-%D most of the macros from the \PERL\ driver.
-
-\ifdefined\setupprettyPLtype \else \loadmarkfile{verb-pl} \fi
-
-\unprotect
-
-%D \SQL\ has the one line comment sequence \type{--} and the
-%D multi line comment delimiters \type{/*} and \type{*/}. The
-%D next counter keeps track of multi line comment nesting.
-
-\newcount\SQLcommentlevel
-
-%D We need to handle \type{%}, \type{#} and \type{-} a bit
-%D different than in the \PERL\ driver. Compared to the
-%D \JAVASCRIPT\ driver |<|we copied most of the code from
-%D that one|>|, we now also have type~45.
-
-\gdef\SQLsetspecials%
- {\PLsetspecials
- \setpretty`\#=32
- \setpretty`\:=41
- \setpretty`\%=41
- \setpretty`\/=43
- \setpretty`\*=44
- \setpretty`\-=45 }
-
-%D We need three additional handlers:
-
-\gdef\SQLsethandlers%
- {\PLsethandlers
- \installprettyhandler 43 \SQLtypefourthree
- \installprettyhandler 44 \SQLtypefourfour
- \installprettyhandler 45 \SQLtypefourfive }
-
-%D Next we have to do some general housekeeping.
-
-\gdef\SQLsetcontrols%
- {\PLsetcontrols
- \def\flushrestofverbatimline%
- {\endPLtypesix
- \ifcase\SQLcommentlevel
- \inPLcommentfalse
- \verbatimfont
- \fi
- \PLverbosefalse
- \PLverboseskipped=0}}
-
-\gdef\SQLsetvariables
- {\PLsetvariables
- \global\SQLcommentlevel=0 }
-
-\gdef\setupprettySQLtype%
- {\def\prettyidentifier{SQL}%
- \let\PLidentifiers=\SQLidentifiers
- \let\PLvariables=\SQLvariables
- \SQLsetvariables
- \SQLsetcontrols
- \SQLsethandlers
- \SQLsetspecials
- \PLsetdiagnostics}
-
-%D We have to look upto four characters ahead. If you don't
-%D grab the picture, just skip reading these macros.
-
-\gdef\SQLtypefourthree%
- {\handlenextnextpretty\doSQLtypefourthree\PLtypefourtwo}
-
-\gdef\doSQLtypefourthree#1#2%
- {\getprettydata{#2}%
- \ifnum\prettytype=43
- \let\next=\dodoSQLtypefourthree
- \else\ifnum\prettytype=44
- \global\advance\SQLcommentlevel by 1
- \global\inPLcommenttrue
- \PLverbosecorrection
- \let\next=\SQLtogglecomment
- \else
- \let\next=\PLtypefourtwo
- \fi\fi
- \next{#1}#2}
-
-\gdef\SQLtogglecomment#1#2%
- {\ifnum\SQLcommentlevel=1
- \prettynaturalfont
- \beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty
- \else
- \getpretties{#1}{#2}%
- \fi}
-
-\gdef\dodoSQLtypefourthree% #1%
- {\endPLtypesix
- \handlenextnextpretty\dododoSQLtypefourthree\dodododoPLtypefourthree}
-
-\gdef\dododoSQLtypefourthree%
- {\ifnewpretty\expandafter\handlenewpretty\fi\dodododoSQLtypefourthree}
-
-\gdef\dodododoSQLtypefourthree#1#2%
- {\ifinPLcomment
- \getpretties{#1}{#2}%
- \else
- \global\inPLcommenttrue
- \PLverbosecorrection
- \beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty
- \fi}
-
-\gdef\SQLtypefourfour%
- {\handlenextnextpretty\doSQLtypefourfour\PLtypefourtwo}
-
-\gdef\doSQLtypefourfour#1#2%
- {\getprettydata{#2}%
- \ifnum\prettytype=43
- \SQLtogglecomment{#1}#2%
- \global\advance\SQLcommentlevel by -1
- \ifcase\SQLcommentlevel
- \global\inPLcommentfalse
- \prettyverbatimfont
- \fi
- \else
- \endPLtypesix
- \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty
- \expandafter#2%
- \fi}
-
-%D Much of the indirect calls (\type {dodo..}) is due to
-%D looking ahead as well as midway pretty print changing.
-
-\gdef\SQLtypefourfive%
- {\handlenextnextpretty\doSQLtypefourfive\PLtypefourtwo}
-
-\gdef\doSQLtypefourfive#1#2%
- {\getprettydata{#2}%
- \ifnum\prettytype=45
- \let\next=\dodoSQLtypefourfive
- \else
- \let\next=\PLtypefourtwo
- \fi
- \next{#1}#2}
-
-\gdef\dodoSQLtypefourfive% #1%
- {\endPLtypesix
- \handlenextnextpretty\dododoSQLtypefourfive\dodododoPLtypefourfive}
-
-\gdef\dododoSQLtypefourfive%
- {\ifnewpretty\expandafter\handlenewpretty\fi\dodododoSQLtypefourfive}
-
-\gdef\dodododoSQLtypefourfive#1#2%
- {\ifinPLcomment
- \getpretties{#1}{#2}%
- \else
- \global\inPLcommenttrue
- \PLverbosecorrection
- \ifnaturaltextext
- \let\next\naturaltextext
- \else
- \prettynaturalfont
- \def\next{\beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty}%
- \fi
- \expandafter\next
- \fi}
-
-%D We need a different list of reserved words. This list
-%D replaces the \PERL\ one.
-
-\useprettyidentifiers \SQLidentifiers \SQLsetspecials
- add all alter and any as asc avg begin between break
- browse bulk by cascade case check close clustered coalesce
- column commit constraint contains count create cross
- cursor database default delete desc distinct drop else end
- exec execute exists exit fetch for foreign from grant
- group having if in index inner insert into is join key
- left like max min nocheck nonclustered not null of on open
- or order outer over plan prepare proc procedure public
- references return revoce right rollback rule select set
- sum table then to tran transaction trigger truncate
- uncommited union unique update use values varying view
- when where while with work primary
-
-\useprettyidentifiers \SQLvariables \SQLsetspecials
- not-yet-defined
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/verb-tex.mkii b/Master/texmf-dist/tex/context/base/mkii/verb-tex.mkii
deleted file mode 100644
index 98655cc2d8a..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/verb-tex.mkii
+++ /dev/null
@@ -1,294 +0,0 @@
-%D \module
-%D [ file=verb-tex,
-%D version=1997.12.22,
-%D title=\CONTEXT\ Verbatim Macros,
-%D subtitle=Pretty \TEX\ verbatim,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 Verbatim Macros / Pretty TEX Verbatim}
-
-%D The original module \type{supp-ver} had the \TEX\
-%D interpreter built in. The current implementation is more
-%D natural and less complicated.
-
-%D \startTEX
-%D \definetyping[niceTEX][option=TEX,paletpalet=graypretty]
-%D
-%D \startniceTEX
-%D \message{A vivid look at TeX}
-%D \stopniceTEX
-%D \stopTEX
-
-\unprotect
-
-%D \macros
-%D {ifsplitTEXparameters}
-%D
-%D The mechanism described here, is meant to be used with
-%D color. It is nevertheless possible to use different fonts
-%D instead of distinctive colors. When using color, it's better
-%D to end parameter mode after the \type{#}. When on the
-%D other hand we use a slanted typeface for the hashmark, then
-%D a slanted number looks better.
-
-\doglobal\newif\ifsplitTEXparameters \global\splitTEXparameterstrue
-
-%D \macros
-%D {ifsplitTEXcontrols}
-%D
-%D With \type{\splittexcontrols} we can influence the way
-%D control characters are processed in macro names. By default,
-%D the \type{^^} part is uncolored. When this boolean is set to
-%D false, they get the same color as the other characters.
-
-\doglobal\newif\ifsplitTEXcontrols \global\splitTEXcontrolstrue
-
-%D The next boolean is used for internal purposes only and
-%D keeps track of the length of the name. Because two||character
-%D sequences starting with a backslash are always seen as a
-%D command.
-
-\doglobal\newif\iffirstinTEXcommand
-
-%D We use a maximum of four colors because more colors will
-%D distract too much. In the following table we show the
-%D logical names of the colors, their color and \cap{RGB} values.
-%D
-%D \placetable{geen}
-%D \starttable[|l|l|c|c|c|c|]
-%D \HL
-%D \FC\bf identifier \MC\bf color \MC\bf r \MC\bf g \MC\bf b \MC\bf bw \LC\SR
-%D \HL
-%D \FC prettyone \MC red \MC 0.9 \MC 0.0 \MC 0.0 \MC 0.30 \LC\FR
-%D \FC prettytwo \MC green \MC 0.0 \MC 0.8 \MC 0.0 \MC 0.45 \LC\MR
-%D \FC prettythree \MC yellow \MC 0.0 \MC 0.0 \MC 0.9 \MC 0.60 \LC\MR
-%D \FC prettyfour \MC blue \MC 0.8 \MC 0.8 \MC 0.6 \MC 0.75 \LC\LR
-%D \HL
-%D \stoptable
-%D
-%D Outside \CONTEXT\ these colors are defined in
-%D \type{verb-ini}, in \CONTEXT\ their definitions can be found
-%D in \type{core-ver}, where in fact we use the color palet
-%D mechanism. That way we can use different schemes i a quite
-%D natural way.
-
-\gdef\setupprettyTEXtype
- {\def\prettyidentifier{TEX}%
- \global\inTEXcommandfalse
- \global\firstinTEXcommandfalse
- \global\inTEXparameterfalse
- \TEXsetcontrols
- \TEXsethandlers
- \TEXsetspecials}
-
-\gdef\TEXsetcontrols
- {\saveprettycontrols
- \everyprettyend
- {\TEXendofcommand
- \TEXendofparameter}%
- \def\obeyedspace
- {\TEXendofcommand
- \TEXendofparameter
- \oldobeyedspace}%
- \def\flushrestofverbatimline
- {\TEXendofcommand
- \TEXendofparameter}%
- \let\obeytabs=\ignoretabs}
-
-\gdef\TEXsetspecials
- {\setpretty`\$=1 \setpretty`\{=1 \setpretty`\}=1
- \setpretty`\[=2 \setpretty`\]=2 \setpretty`\(=2 \setpretty`\)=2
- \setpretty`\==2 \setpretty`\<=2 \setpretty`\>=2 \setpretty`\"=2
- \setpretty`\-=3 \setpretty`\+=3 \setpretty`\/=3
- \setpretty`\|=3 \setpretty`\%=3 \setpretty`\'=3 \setpretty`\`=3
- \setpretty`\_=3 \setpretty`\&=3 \setpretty`\~=3
- \setpretty`\.=4 \setpretty`\,=4 \setpretty`\:=4 \setpretty`\;=4 \setpretty`\*=4
- \setpretty`\#=5
- \setpretty`\1=6 \setpretty`\2=6 \setpretty`\3=6 \setpretty`\4=6 \setpretty`\5=6
- \setpretty`\6=6 \setpretty`\7=6 \setpretty`\8=6 \setpretty`\9=6 \setpretty`\0=6
- \setpretty`\\=7
- \setpretty`\^=8
- \setpretty`\A=9 \setpretty`\B=9 \setpretty`\C=9 \setpretty`\D=9 \setpretty`\E=9
- \setpretty`\F=9 \setpretty`\G=9 \setpretty`\H=9 \setpretty`\I=9 \setpretty`\J=9
- \setpretty`\K=9 \setpretty`\L=9 \setpretty`\M=9 \setpretty`\N=9 \setpretty`\O=9
- \setpretty`\P=9 \setpretty`\Q=9 \setpretty`\R=9 \setpretty`\S=9 \setpretty`\T=9
- \setpretty`\U=9 \setpretty`\V=9 \setpretty`\W=9 \setpretty`\X=9 \setpretty`\Y=9
- \setpretty`\Z=9
- \setpretty`\a=9 \setpretty`\b=9 \setpretty`\c=9 \setpretty`\d=9 \setpretty`\e=9
- \setpretty`\f=9 \setpretty`\g=9 \setpretty`\h=9 \setpretty`\i=9 \setpretty`\j=9
- \setpretty`\k=9 \setpretty`\l=9 \setpretty`\m=9 \setpretty`\n=9 \setpretty`\o=9
- \setpretty`\p=9 \setpretty`\q=9 \setpretty`\r=9 \setpretty`\s=9 \setpretty`\t=9
- \setpretty`\u=9 \setpretty`\v=9 \setpretty`\w=9 \setpretty`\x=9 \setpretty`\y=9
- \setpretty`\z=9
- \setpretty`\?=9 \setpretty`\!=9 \setpretty`\@=9
- \setpretty`\%=0 }
-
-\gdef\TEXsethandlers
- {\installprettyhandler 1 \TEXtypeone
- \installprettyhandler 2 \TEXtypetwo
- \installprettyhandler 3 \TEXtypethree
- \installprettyhandler 4 \TEXtypefour
- \installprettyhandler 5 \TEXtypefive
- \installprettyhandler 6 \TEXtypesix
- \installprettyhandler 7 \TEXtypeseven
- \installprettyhandler 8 \TEXtypeeight
- \installprettyhandler 9 \TEXtypenine
- \installprettyhandler 0 \TEXtypezero}
-
-\doglobal\newif\ifinTEXcommand
-\doglobal\newif\ifinTEXparameter
-
-\gdef\TEXbeginofcommand
- {\TEXendofparameter
- \ifinTEXcommand
- \else
- \global\inTEXcommandtrue
- \global\firstinTEXcommandtrue
- \beginofpretty[\!!prettytwo]%
- \fi}
-
-\gdef\TEXendofcommand
- {\ifinTEXcommand
- \endofpretty
- \global\inTEXcommandfalse
- \global\firstinTEXcommandfalse
- \fi}
-
-\gdef\TEXbeginofparameter
- {\TEXendofcommand
- \ifinTEXparameter
- \else
- \global\inTEXparametertrue
- \beginofpretty[\!!prettythree]%
- \fi}
-
-\gdef\TEXendofparameter
- {\ifinTEXparameter
- \endofpretty
- \global\inTEXparameterfalse
- \fi}
-
-\gdef\ifnotfirstinTEXcommand#1
- {\iffirstinTEXcommand
- \getpretty{#1}%
- \TEXendofcommand
- \else}
-
-\gdef\TEXtypeone#1%
- {\ifnotfirstinTEXcommand#1
- \TEXendofcommand
- \TEXendofparameter
- \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty
- \fi}
-
-\gdef\TEXtypetwo#1%
- {\ifnotfirstinTEXcommand#1
- \TEXendofcommand
- \TEXendofparameter
- \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty
- \fi}
-
-\gdef\TEXtypethree#1%
- {\ifnotfirstinTEXcommand#1
- \TEXendofcommand
- \TEXendofparameter
- \beginofpretty[\!!prettyfour]\getpretty{#1}\endofpretty
- \fi}
-
-\gdef\TEXtypefour#1%
- {\ifnotfirstinTEXcommand#1
- \TEXendofcommand
- \TEXendofparameter
- \getpretty{#1}%
- \fi}
-
-\gdef\TEXtypefive#1%
- {\ifnotfirstinTEXcommand#1
- \TEXbeginofparameter
- \getpretty{#1}%
- \fi}
-
-\gdef\TEXtypesix#1%
- {\ifnotfirstinTEXcommand#1
- \ifinTEXparameter
- \ifsplitTEXparameters
- \TEXendofparameter
- \getpretty{#1}%
- \else
- \getpretty{#1}%
- \TEXendofparameter
- \fi
- \else
- \TEXendofcommand
- \getpretty{#1}%
- \fi
- \fi}
-
-\gdef\TEXtypeseven#1%
- {\ifnotfirstinTEXcommand#1
- \TEXbeginofcommand
- \getpretty{#1}%
- \fi}
-
-\gdef\TEXtypeeightA#1#2%
- {\getprettydata{#2}%
- \ifnum\prettytype=80
- \TEXendofparameter
- \ifsplitTEXcontrols
- \ifinTEXcommand
- \def\next{\TEXendofcommand\getpretty{#1}\getpretty{#1}\TEXbeginofcommand}%
- \else
- \def\next{\getpretty{#1}\getpretty{#1}}%
- \fi
- \else
- \def\next{\getpretty{#1}\getpretty{#1}}%
- \fi
- \else
- \def\next{\TEXtypeeightB{#1}#2}%
- \fi
- \next}
-
-\gdef\TEXtypeeightB
- {\TEXendofparameter
- \ifinTEXcommand
- \firstinTEXcommandfalse
- \expandafter\getpretty
- \else
- \expandafter\TEXtypethree
- \fi}
-
-\gdef\TEXtypeeight
- {\handlenextnextpretty\TEXtypeeightA\TEXtypeeightB}
-
-\gdef\TEXtypenine
- {\TEXendofparameter
- \global\firstinTEXcommandfalse
- \getpretty}
-
-%\gdef\TEXtypezero
-% {\disableprettyafterwards % only when enabled of course
-% \ifnewpretty\expandafter\handlenewpretty\fi\TEXtypethree}
-
-\long\gdef\naturalTEXtext#1#2\relax% local alternative for \naturaltextext
- {\convertargument#2\to\ascii
- \doifinstringelse{\letterpercent}{\ascii}
- {\long\def\next{\TEXtypethree{#1}#2\relax}}
- %{\long\def\next{\bgroup\prettynaturalfont\restorecatcodes\scantokens{\ignorespaces#2}\egroup}}%
- {\long\def\next{\bgroup\prettynaturalfont{\restorecatcodes\scantokens{\ignorespaces#2}}\egroup}}%
- \next}
-
-\gdef\TEXtypezero
- {\ifnaturaltextext
- \expandafter\naturalTEXtext
- \else
- \disableprettyafterwards % only when enabled of course
- \expandafter\handlenewpretty\expandafter\TEXtypethree
- \fi}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/verb-xml.mkii b/Master/texmf-dist/tex/context/base/mkii/verb-xml.mkii
deleted file mode 100644
index dbf6635f655..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/verb-xml.mkii
+++ /dev/null
@@ -1,441 +0,0 @@
-%D \module
-%D [ file=verb-xml,
-%D version=2000.05.09,
-%D title=\CONTEXT\ Verbatim Macros,
-%D subtitle=Pretty XML verbatim,
-%D author=Berend de Boer,
-%D date=2000.05.08,
-%D copyright={Berend de Boer \& Hans Hagen}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% This module will be cleaned up a bit in the process of more
-% flexible verbatim options.
-
-\writestatus{loading}{ConTeXt Verbatim Macros / Pretty XML Verbatim}
-
-\unprotect
-
-%D Formats XML more or less like XMLWriter (http://XMLwriter.net)
-%D does.
-%D
-%D Known bugs:
-%D - CDATA not handled yet.
-%D
-%D Expects well-formed XML. Else parsing errors may occur, because
-%D this XML state machine is not robust.
-%D
-%D Examples:
-%D
-%D \startXML
-%D <?xml version="1.0" encoding="ISO-8859-1" ?>
-%D <!-- comment: example of a <resource> tag -->
-%D <resources>
-%D <resource id="5">
-%D <capacity>
-%D <kind>1</kind>
-%D <value>100</value>
-%D </capacity>
-%D </resource>
-%D </resources>
-%D \stopXML
-%D
-%D Another format:
-%D
-%D \startXML
-%D <?xml version="1.0" encoding="ISO-8859-1" ?>
-%D <address id="10"/>
-%D \stopXML
-%D
-%D A typical setup:
-%D
-%D \setuptyping[XML]
-%D [margin=1cm,
-%D before={\switchtobodyfont[9pt]\blank[medium]},
-%D after={\switchtobodyfont[11pt]\blank[medium]},
-%D style=\ss]
-%D
-
-\ifx\XMLlinebreak\undefined
- \gdef\XMLlinebreak{\ifhmode\allowbreak\fi} % new, often long lines
-\fi
-
-\doglobal\newif\ifXMLmarkkeys \global\XMLmarkkeystrue
-
-\gdef\setupprettyXMLtype%
- {\def\prettyidentifier{XML}%
- \XMLsetvariables
- \XMLsetcontrols
- \XMLsetspecials
- \XMLsethandlers}
-
-\gdef\XMLsetvariables
- {\global\inXMLpifalse
- \global\inXMLtagfalse
- \global\inXMLvaluefalse
- \global\inXMLspecialfalse
- \global\inXMLcommentfalse
- \global\inXMLtagnamefalse
- \global\inXMLattributefalse
- \global\inXMLentityfalse}
-
-\gdef\XMLsetcontrols%
- {\saveprettycontrols
- \def\obeyedspace%
- {\ifinXMLvalue
- \else % more tests ?
- \XMLstartattribute
- \fi
- \oldobeyedspace
- \XMLlinebreak}%
- \def\flushrestofverbatimline%
- {\endXMLtagname}%
- \let\obeytabs=\ignoretabs}
-
-\gdef\XMLsetspecials%
- {\setpretty`\<=10 \setpretty`\>=11
- \setpretty`\?=12 \setpretty`\/=13
- \setpretty`\!=14 \setpretty`\-=15
- \setpretty`\\=17
- \setpretty`\0=17
- \setpretty`\1=17 \setpretty`\2=17 \setpretty`\3=17
- \setpretty`\4=17 \setpretty`\5=17 \setpretty`\6=17
- \setpretty`\7=17 \setpretty`\8=17 \setpretty`\9=17
- \setpretty`\==16
- \setpretty`\"=20
- \setpretty`\(=31 \setpretty`\)=31 \setpretty`\,=31
- \setpretty`\*=31 \setpretty`\+=31 \setpretty`\#=31
- \setpretty`\:=32
- \setpretty`\&=41 \setpretty`\;=42 }
-
-\gdef\XMLsethandlers%
- {\installprettyhandler 17 \XMLnormal
- \installprettyhandler 10 \XMLwhattag
- \installprettyhandler 11 \XMLstoptag
- \installprettyhandler 12 \XMLtypeonetwo
- \installprettyhandler 13 \XMLtypeonethree
- \installprettyhandler 14 \XMLtypeonefour
- \installprettyhandler 15 \XMLtypeonefive
- \installprettyhandler 16 \XMLtypeonesix
- \installprettyhandler 20 \XMLdoublequote
- \installprettyhandler 31 \XMLtypethreeone
- \installprettyhandler 32 \XMLtypethreetwo
- \installprettyhandler 41 \XMLbampersand
- \installprettyhandler 42 \XMLeampersand }
-
-\doglobal\newif\ifinXMLpi
-\doglobal\newif\ifinXMLtag
-\doglobal\newif\ifinXMLvalue
-\doglobal\newif\ifinXMLspecial
-\doglobal\newif\ifinXMLcomment
-\doglobal\newif\ifinXMLtagname
-\doglobal\newif\ifinXMLattribute
-\doglobal\newif\ifinXMLentity
-
-% the list of actions to be executed per state
-
-% test if we have a normal tag, processing instruction or a special,
-% i.e. <, <? or <!
-
-\gdef\XMLnormal#1{\getpretty{#1}}
-
-\gdef\XMLwhattag%
- {\handlenextnextpretty\XMLdowhattag\XMLstarttag}
-
-\gdef\XMLdowhattag#1#2%
- {\ifinXMLcomment
- \let\next=\getpretties
- \else
- \getprettydata{#2}%
- \ifnum\prettytype=12 % ?
- \let\next=\XMLstartpi
- \else\ifnum\prettytype=14 % !
- \let\next=\XMLstartspecial
- \else
- \let\next=\XMLstarttag
- \fi\fi
- \fi
- \next{#1}{#2}}
-
-% formats <?
-
-\gdef\XMLstartpi#1#2%
- {\beginofpretty[\!!prettythree]\getpretties{#1}{#2}\endofpretty%
- \global\inXMLtagtrue
- \global\inXMLpitrue
- \global\inXMLtagnametrue
- \beginofpretty[\!!prettyone]}
-
-% format <!, <!--, <!DOCTYPE, <![CDATA[ and such
-
-\gdef\XMLstartspecial#1#2%
- {\beginofpretty[\!!prettythree]\getpretties{#1}{#2}\endofpretty%
- \global\inXMLtagtrue
- \global\inXMLspecialtrue
- \global\inXMLtagnametrue
- \beginofpretty[\!!prettyone]}
-
-% formats plain <
-
-\gdef\XMLstarttag#1%
- {\XMLlinebreak
- \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty
- \global\inXMLtagtrue
- \global\inXMLtagnametrue
- \beginofpretty[\!!prettyone]}
-
-
-% catch >
-
-\gdef\XMLstoptag#1%
- {\ifinXMLcomment
- \getpretty{#1}%
- \else
- \ifinXMLvalue
- \getpretty{#1}%
- \else
- \endXMLtagname
- \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty
- \doXMLstoptag
- \XMLlinebreak
- \fi
- \fi}
-
-\gdef\doXMLstoptag%
- {\global\inXMLpifalse % either end process instruction
- \global\inXMLspecialfalse % or special
- \global\inXMLtagfalse % tag ends always
- \global\inXMLtagnamefalse} % just to be sure
-
-% end typeset name of tag
-% because called often, we also use it to end the default
-% attribute color.
-
-\gdef\endXMLtagname%
- {\ifinXMLtagname
- \endofpretty
- \inXMLtagnamefalse
- \else
- \XMLstopattribute
- \fi}
-
-% start attribute formatting inside a tag if applicable
-
-\gdef\XMLstartattribute%
- {\ifinXMLcomment \else
- \ifinXMLpi
- \ifXMLmarkkeys\else\endXMLtagname\fi % option
- \else
- \endXMLtagname
- \ifinXMLtag
- \doXMLstartattribute
- \fi
- \fi
- \fi}
-
-\gdef\XMLstopattribute%
- {\ifinXMLattribute
- \endofpretty
- \inXMLattributefalse
- \fi}
-
-\gdef\doXMLstartattribute
- {\inXMLattributetrue
- \beginofpretty[\!!prettythree]}
-
-% `?' character, needed to recognize ?>
-
-\gdef\XMLtypeonetwo%
- {\endXMLtagname
- \handlenextnextpretty\doXMLtypeonetwo\doXMLout}
-
-\gdef\doXMLtypeonetwo#1#2%
- {\getprettydata{#2}%
- \ifnum\prettytype=11 % >
- \expandafter\dododoXMLtypeonetwo
- \else % treat as `green' character
- \expandafter\XMLtypethreeone
- \fi
- {#1}#2}
-
-\gdef\dododoXMLtypeonetwo#1#2%
- {\ifinXMLcomment
- \getpretties{#1}{#2}%
- \else
- \ifinXMLtag
- \ifinXMLvalue
- \getpretties{#1}{#2}%
- \else
- \ifinXMLpi
- \beginofpretty[\!!prettythree]\getpretties{#1}{#2}\endofpretty
- \else % treat as green character
- \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty
- \beginofpretty[\!!prettythree]#2\endofpretty
- \fi
- \doXMLstoptag
- \fi
- \else
- \getpretties{#1}{#2}%
- \fi
- \fi}
-
-% '/' character, catch /> and </, do nothing else
-
-\gdef\XMLtypeonethree#1%
- {\ifinXMLcomment
- \getpretty{#1}%
- \else
- \ifinXMLtag
- \ifinXMLvalue
- \getpretty{#1}%
- \else
- \endofpretty
- \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty
- \beginofpretty[\!!prettyone]%
- \fi
- \else
- \getpretty{#1}%
- \fi
- \fi}
-
-% used to parse <!
-
-\gdef\XMLtypeonefour#1%
- {\getpretty{#1}}
-
-% used to parse <!-- and -->
-% when <! is parsed we already assumed this is a comment
-% when -- is encountered, we only need to see if --> is ahead
-% so the comment can stop.
-
-\gdef\XMLtypeonefive%
- {\handlenextnextpretty\doXMLtypeonefive\doXMLout}
-
-\gdef\doXMLtypeonefive#1#2%
- {\getprettydata{#2}%
- \ifnum\prettytype=15
- \ifinXMLcomment
- \let\next=\dodoXMLtypeonefive
- \else
- \ifinXMLspecial
- \let\next=\startXMLcomment
- \else
- \let\next=\doXMLouttwo
- \fi
- \fi
- \else
- \let\next=\doXMLouttwo
- \fi
- \next{#1}#2}
-
-\gdef\startXMLcomment#1#2%
- {\beginofpretty[\!!prettythree]\getpretties{#1}{#2}\endofpretty
- \beginofpretty[\!!prettyfour]%
- \global\inXMLcommenttrue}
-
-\gdef\dodoXMLtypeonefive#1% encountered -
- {\def\prev{#1}\handlenextnextpretty\dododoXMLtypeonefive\doXMLout}
-
-\gdef\nodoXMLtypeonefive% encountered -
- {\getpretty{\prev}\doXMLout}
-
-\gdef\dododoXMLtypeonefive#1#2%
- {\getprettydata{#2}%
- \ifnum\prettytype=11
- \endofpretty\getpretty{\prev}#1\empty\global\inXMLcommentfalse#2%
- \else
- \getpretty{\prev}#1#2%
- \fi}
-
-\global\let\doXMLout \getpretty
-\global\let\doXMLouttwo\getpretties
-
-% '=' inside tags needs to be blue
-
-\gdef\XMLtypeonesix#1%
- {\ifinXMLtag
- \endofpretty
- \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty
- \beginofpretty[\!!prettyone]%
- \else
- \getpretty{#1}%
- \fi}
-
-% catch attribute value parts
-
-\gdef\XMLdoublequote#1%
- {\ifinXMLcomment
- \getpretty{#1}%
- \else
- \ifinXMLtag
- \ifinXMLvalue
- \global\inXMLvaluefalse
- \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty
- \ifXMLmarkkeys\beginofpretty[\!!prettyone]\fi
- \else
- \endofpretty
- \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty
- \global\inXMLvaluetrue
- \fi
- \else
- \getpretty{#1}%
- \fi
- \fi}
-
-% symbols like `(', `)' and `,' should be green
-
-\gdef\XMLtypethreeone#1%
- {\ifinXMLcomment
- \getpretty{#1}%
- \else
- \ifinXMLtag
- \endXMLtagname
- \ifinXMLvalue
- \getpretty{#1}%
- \else
- \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty
- \XMLstartattribute% again
- \fi
- \else
- \getpretty{#1}%
- \fi
- \fi}
-
-% \gdef\XMLtypethreetwo#1%
-% {\ifinXMLcomment
-% \getpretty{#1}%
-% \else
-% \ifinXMLtagname
-% \endofpretty
-% \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty
-% \beginofpretty[\!!prettyone]%
-% \else
-% \getpretty{#1}%
-% \fi
-% \fi}
-
-\gdef\XMLtypethreetwo#1%
- {\getpretty{#1}}
-
-% special characters with `&'
-
-\gdef\XMLbampersand#1%
- {\ifinXMLcomment
- \getpretty{#1}%
- \else
- \endXMLtagname
- \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty
- \global\inXMLentitytrue
- \fi}
-
-\gdef\XMLeampersand#1%
- {\ifinXMLcomment
- \getpretty{#1}%
- \else
- \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty
- \global\inXMLentityfalse
- \fi}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/xetx-chr.mkii b/Master/texmf-dist/tex/context/base/mkii/xetx-chr.mkii
deleted file mode 100644
index 66ae0d63603..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xetx-chr.mkii
+++ /dev/null
@@ -1,1154 +0,0 @@
-% filename : xetx-chr.mkii
-% comment : generated by mtxrun --script chars --xtx
-% author : Hans Hagen, PRAGMA-ADE, Hasselt NL
-% copyright: PRAGMA ADE / ConTeXt Development Team
-% license : see context related readme files
-
-% named characters mapped onto utf (\\char is needed for accents)
-
-\def\textbackslash {\char"0005C } % REVERSE SOLIDUS: \
-\def\textasciicircum {\char"0005E } % CIRCUMFLEX ACCENT: ^
-\def\textunderscore {\char"0005F } % LOW LINE: _
-\def\textgrave {\char"00060 } % GRAVE ACCENT: `
-\def\idotaccent {\char"00069 } % LATIN SMALL LETTER I: i
-\def\textbraceleft {\char"0007B } % LEFT CURLY BRACKET: {
-\def\textbar {\char"0007C } % VERTICAL LINE: |
-\def\textbraceright {\char"0007D } % RIGHT CURLY BRACKET: }
-\def\textasciitilde {\char"0007E } % TILDE: ~
-\def\exclamdown {\char"000A1 } % INVERTED EXCLAMATION MARK: ¡
-\def\textcent {\char"000A2 } % CENT SIGN: ¢
-\def\textsterling {\char"000A3 } % POUND SIGN: £
-\def\textcurrency {\char"000A4 } % CURRENCY SIGN: ¤
-\def\textyen {\char"000A5 } % YEN SIGN: ¥
-\def\textbrokenbar {\char"000A6 } % BROKEN BAR: ¦
-\def\sectionmark {\char"000A7 } % SECTION SIGN: §
-\def\textdiaeresis {\char"000A8 } % DIAERESIS: ¨
-\def\copyright {\char"000A9 } % COPYRIGHT SIGN: ©
-\def\ordfeminine {\char"000AA } % FEMININE ORDINAL INDICATOR: ª
-\def\leftguillemot {\char"000AB } % LEFT-POINTING DOUBLE ANGLE QUOTATION MARK: «
-\def\textlognot {\char"000AC } % NOT SIGN: ¬
-\def\softhyphen {\char"000AD } % SOFT HYPHEN: ­
-\def\registered {\char"000AE } % REGISTERED SIGN: ®
-\def\textmacron {\char"000AF } % MACRON: ¯
-\def\textdegree {\char"000B0 } % DEGREE SIGN: °
-\def\textpm {\char"000B1 } % PLUS-MINUS SIGN: ±
-\def\twosuperior {\char"000B2 } % SUPERSCRIPT TWO: ²
-\def\threesuperior {\char"000B3 } % SUPERSCRIPT THREE: ³
-\def\textacute {\char"000B4 } % ACUTE ACCENT: ´
-\def\textmu {\char"000B5 } % MICRO SIGN: µ
-\def\paragraphmark {\char"000B6 } % PILCROW SIGN: ¶
-\def\periodcentered {\char"000B7 } % MIDDLE DOT: ·
-\def\textcedilla {\char"000B8 } % CEDILLA: ¸
-\def\onesuperior {\char"000B9 } % SUPERSCRIPT ONE: ¹
-\def\ordmasculine {\char"000BA } % MASCULINE ORDINAL INDICATOR: º
-\def\rightguillemot {\char"000BB } % RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK: »
-\def\onequarter {\char"000BC } % VULGAR FRACTION ONE QUARTER: ¼
-\def\onehalf {\char"000BD } % VULGAR FRACTION ONE HALF: ½
-\def\threequarter {\char"000BE } % VULGAR FRACTION THREE QUARTERS: ¾
-\def\questiondown {\char"000BF } % INVERTED QUESTION MARK: ¿
-\def\Agrave {\char"000C0 } % LATIN CAPITAL LETTER A WITH GRAVE: À
-\def\Aacute {\char"000C1 } % LATIN CAPITAL LETTER A WITH ACUTE: Ã
-\def\Acircumflex {\char"000C2 } % LATIN CAPITAL LETTER A WITH CIRCUMFLEX: Â
-\def\Atilde {\char"000C3 } % LATIN CAPITAL LETTER A WITH TILDE: Ã
-\def\Adiaeresis {\char"000C4 } % LATIN CAPITAL LETTER A WITH DIAERESIS: Ä
-\def\Aring {\char"000C5 } % LATIN CAPITAL LETTER A WITH RING ABOVE: Ã…
-\def\AEligature {\char"000C6 } % LATIN CAPITAL LETTER AE: Æ
-\def\Ccedilla {\char"000C7 } % LATIN CAPITAL LETTER C WITH CEDILLA: Ç
-\def\Egrave {\char"000C8 } % LATIN CAPITAL LETTER E WITH GRAVE: È
-\def\Eacute {\char"000C9 } % LATIN CAPITAL LETTER E WITH ACUTE: É
-\def\Ecircumflex {\char"000CA } % LATIN CAPITAL LETTER E WITH CIRCUMFLEX: Ê
-\def\Ediaeresis {\char"000CB } % LATIN CAPITAL LETTER E WITH DIAERESIS: Ë
-\def\Igrave {\char"000CC } % LATIN CAPITAL LETTER I WITH GRAVE: Ì
-\def\Iacute {\char"000CD } % LATIN CAPITAL LETTER I WITH ACUTE: Ã
-\def\Icircumflex {\char"000CE } % LATIN CAPITAL LETTER I WITH CIRCUMFLEX: ÃŽ
-\def\Idiaeresis {\char"000CF } % LATIN CAPITAL LETTER I WITH DIAERESIS: Ã
-\def\Eth {\char"000D0 } % LATIN CAPITAL LETTER ETH: Ã
-\def\Ntilde {\char"000D1 } % LATIN CAPITAL LETTER N WITH TILDE: Ñ
-\def\Ograve {\char"000D2 } % LATIN CAPITAL LETTER O WITH GRAVE: Ã’
-\def\Oacute {\char"000D3 } % LATIN CAPITAL LETTER O WITH ACUTE: Ó
-\def\Ocircumflex {\char"000D4 } % LATIN CAPITAL LETTER O WITH CIRCUMFLEX: Ô
-\def\Otilde {\char"000D5 } % LATIN CAPITAL LETTER O WITH TILDE: Õ
-\def\Odiaeresis {\char"000D6 } % LATIN CAPITAL LETTER O WITH DIAERESIS: Ö
-\def\textmultiply {\char"000D7 } % MULTIPLICATION SIGN: ×
-\def\Ostroke {\char"000D8 } % LATIN CAPITAL LETTER O WITH STROKE: Ø
-\def\Ugrave {\char"000D9 } % LATIN CAPITAL LETTER U WITH GRAVE: Ù
-\def\Uacute {\char"000DA } % LATIN CAPITAL LETTER U WITH ACUTE: Ú
-\def\Ucircumflex {\char"000DB } % LATIN CAPITAL LETTER U WITH CIRCUMFLEX: Û
-\def\Udiaeresis {\char"000DC } % LATIN CAPITAL LETTER U WITH DIAERESIS: Ü
-\def\Yacute {\char"000DD } % LATIN CAPITAL LETTER Y WITH ACUTE: Ã
-\def\Thorn {\char"000DE } % LATIN CAPITAL LETTER THORN: Þ
-\def\ssharp {\char"000DF } % LATIN SMALL LETTER SHARP S: ß
-\def\agrave {\char"000E0 } % LATIN SMALL LETTER A WITH GRAVE: à
-\def\aacute {\char"000E1 } % LATIN SMALL LETTER A WITH ACUTE: á
-\def\acircumflex {\char"000E2 } % LATIN SMALL LETTER A WITH CIRCUMFLEX: â
-\def\atilde {\char"000E3 } % LATIN SMALL LETTER A WITH TILDE: ã
-\def\adiaeresis {\char"000E4 } % LATIN SMALL LETTER A WITH DIAERESIS: ä
-\def\aring {\char"000E5 } % LATIN SMALL LETTER A WITH RING ABOVE: å
-\def\aeligature {\char"000E6 } % LATIN SMALL LETTER AE: æ
-\def\ccedilla {\char"000E7 } % LATIN SMALL LETTER C WITH CEDILLA: ç
-\def\egrave {\char"000E8 } % LATIN SMALL LETTER E WITH GRAVE: è
-\def\eacute {\char"000E9 } % LATIN SMALL LETTER E WITH ACUTE: é
-\def\ecircumflex {\char"000EA } % LATIN SMALL LETTER E WITH CIRCUMFLEX: ê
-\def\ediaeresis {\char"000EB } % LATIN SMALL LETTER E WITH DIAERESIS: ë
-\def\igrave {\char"000EC } % LATIN SMALL LETTER I WITH GRAVE: ì
-\def\iacute {\char"000ED } % LATIN SMALL LETTER I WITH ACUTE: í
-\def\icircumflex {\char"000EE } % LATIN SMALL LETTER I WITH CIRCUMFLEX: î
-\def\idiaeresis {\char"000EF } % LATIN SMALL LETTER I WITH DIAERESIS: ï
-\def\ntilde {\char"000F1 } % LATIN SMALL LETTER N WITH TILDE: ñ
-\def\ograve {\char"000F2 } % LATIN SMALL LETTER O WITH GRAVE: ò
-\def\oacute {\char"000F3 } % LATIN SMALL LETTER O WITH ACUTE: ó
-\def\ocircumflex {\char"000F4 } % LATIN SMALL LETTER O WITH CIRCUMFLEX: ô
-\def\otilde {\char"000F5 } % LATIN SMALL LETTER O WITH TILDE: õ
-\def\odiaeresis {\char"000F6 } % LATIN SMALL LETTER O WITH DIAERESIS: ö
-\def\textdiv {\char"000F7 } % DIVISION SIGN: ÷
-\def\ostroke {\char"000F8 } % LATIN SMALL LETTER O WITH STROKE: ø
-\def\ugrave {\char"000F9 } % LATIN SMALL LETTER U WITH GRAVE: ù
-\def\uacute {\char"000FA } % LATIN SMALL LETTER U WITH ACUTE: ú
-\def\ucircumflex {\char"000FB } % LATIN SMALL LETTER U WITH CIRCUMFLEX: û
-\def\udiaeresis {\char"000FC } % LATIN SMALL LETTER U WITH DIAERESIS: ü
-\def\yacute {\char"000FD } % LATIN SMALL LETTER Y WITH ACUTE: ý
-\def\thorn {\char"000FE } % LATIN SMALL LETTER THORN: þ
-\def\ydiaeresis {\char"000FF } % LATIN SMALL LETTER Y WITH DIAERESIS: ÿ
-\def\Amacron {\char"00100 } % LATIN CAPITAL LETTER A WITH MACRON: Ā
-\def\amacron {\char"00101 } % LATIN SMALL LETTER A WITH MACRON: Ä
-\def\Abreve {\char"00102 } % LATIN CAPITAL LETTER A WITH BREVE: Ä‚
-\def\abreve {\char"00103 } % LATIN SMALL LETTER A WITH BREVE: ă
-\def\Aogonek {\char"00104 } % LATIN CAPITAL LETTER A WITH OGONEK: Ä„
-\def\aogonek {\char"00105 } % LATIN SMALL LETTER A WITH OGONEK: Ä…
-\def\Cacute {\char"00106 } % LATIN CAPITAL LETTER C WITH ACUTE: Ć
-\def\cacute {\char"00107 } % LATIN SMALL LETTER C WITH ACUTE: ć
-\def\Ccircumflex {\char"00108 } % LATIN CAPITAL LETTER C WITH CIRCUMFLEX: Ĉ
-\def\ccircumflex {\char"00109 } % LATIN SMALL LETTER C WITH CIRCUMFLEX: ĉ
-\def\Cdotaccent {\char"0010A } % LATIN CAPITAL LETTER C WITH DOT ABOVE: ÄŠ
-\def\cdotaccent {\char"0010B } % LATIN SMALL LETTER C WITH DOT ABOVE: Ä‹
-\def\Ccaron {\char"0010C } % LATIN CAPITAL LETTER C WITH CARON: Č
-\def\ccaron {\char"0010D } % LATIN SMALL LETTER C WITH CARON: Ä
-\def\Dcaron {\char"0010E } % LATIN CAPITAL LETTER D WITH CARON: ÄŽ
-\def\dcaron {\char"0010F } % LATIN SMALL LETTER D WITH CARON: Ä
-\def\Dstroke {\char"00110 } % LATIN CAPITAL LETTER D WITH STROKE: Ä
-\def\dstroke {\char"00111 } % LATIN SMALL LETTER D WITH STROKE: Ä‘
-\def\Emacron {\char"00112 } % LATIN CAPITAL LETTER E WITH MACRON: Ä’
-\def\emacron {\char"00113 } % LATIN SMALL LETTER E WITH MACRON: Ä“
-\def\Ebreve {\char"00114 } % LATIN CAPITAL LETTER E WITH BREVE: Ä”
-\def\ebreve {\char"00115 } % LATIN SMALL LETTER E WITH BREVE: Ä•
-\def\Edotaccent {\char"00116 } % LATIN CAPITAL LETTER E WITH DOT ABOVE: Ä–
-\def\edotaccent {\char"00117 } % LATIN SMALL LETTER E WITH DOT ABOVE: Ä—
-\def\Eogonek {\char"00118 } % LATIN CAPITAL LETTER E WITH OGONEK: Ę
-\def\eogonek {\char"00119 } % LATIN SMALL LETTER E WITH OGONEK: Ä™
-\def\Ecaron {\char"0011A } % LATIN CAPITAL LETTER E WITH CARON: Äš
-\def\ecaron {\char"0011B } % LATIN SMALL LETTER E WITH CARON: Ä›
-\def\Gcircumflex {\char"0011C } % LATIN CAPITAL LETTER G WITH CIRCUMFLEX: Ĝ
-\def\gcircumflex {\char"0011D } % LATIN SMALL LETTER G WITH CIRCUMFLEX: Ä
-\def\Gbreve {\char"0011E } % LATIN CAPITAL LETTER G WITH BREVE: Äž
-\def\gbreve {\char"0011F } % LATIN SMALL LETTER G WITH BREVE: ÄŸ
-\def\Gdotaccent {\char"00120 } % LATIN CAPITAL LETTER G WITH DOT ABOVE: Ä 
-\def\gdotaccent {\char"00121 } % LATIN SMALL LETTER G WITH DOT ABOVE: Ä¡
-\def\Gcommaaccent {\char"00122 } % LATIN CAPITAL LETTER G WITH CEDILLA: Ģ
-\def\gcommaaccent {\char"00123 } % LATIN SMALL LETTER G WITH CEDILLA: ģ
-\def\Hcircumflex {\char"00124 } % LATIN CAPITAL LETTER H WITH CIRCUMFLEX: Ĥ
-\def\hcircumflex {\char"00125 } % LATIN SMALL LETTER H WITH CIRCUMFLEX: ĥ
-\def\Hstroke {\char"00126 } % LATIN CAPITAL LETTER H WITH STROKE: Ħ
-\def\hstroke {\char"00127 } % LATIN SMALL LETTER H WITH STROKE: ħ
-\def\Itilde {\char"00128 } % LATIN CAPITAL LETTER I WITH TILDE: Ĩ
-\def\itilde {\char"00129 } % LATIN SMALL LETTER I WITH TILDE: Ä©
-\def\Imacron {\char"0012A } % LATIN CAPITAL LETTER I WITH MACRON: Ī
-\def\imacron {\char"0012B } % LATIN SMALL LETTER I WITH MACRON: Ä«
-\def\Ibreve {\char"0012C } % LATIN CAPITAL LETTER I WITH BREVE: Ĭ
-\def\ibreve {\char"0012D } % LATIN SMALL LETTER I WITH BREVE: Ä­
-\def\Iogonek {\char"0012E } % LATIN CAPITAL LETTER I WITH OGONEK: Ä®
-\def\iogonek {\char"0012F } % LATIN SMALL LETTER I WITH OGONEK: į
-\def\Idotaccent {\char"00130 } % LATIN CAPITAL LETTER I WITH DOT ABOVE: Ä°
-\def\dotlessi {\char"00131 } % LATIN SMALL LETTER DOTLESS I: ı
-\def\IJligature {\char"00132 } % LATIN CAPITAL LIGATURE IJ: IJ
-\def\ijligature {\char"00133 } % LATIN SMALL LIGATURE IJ: ij
-\def\Jcircumflex {\char"00134 } % LATIN CAPITAL LETTER J WITH CIRCUMFLEX: Ä´
-\def\jcircumflex {\char"00135 } % LATIN SMALL LETTER J WITH CIRCUMFLEX: ĵ
-\def\Kcommaaccent {\char"00136 } % LATIN CAPITAL LETTER K WITH CEDILLA: Ķ
-\def\kcommaaccent {\char"00137 } % LATIN SMALL LETTER K WITH CEDILLA: Ä·
-\def\kkra {\char"00138 } % LATIN SMALL LETTER KRA: ĸ
-\def\Lacute {\char"00139 } % LATIN CAPITAL LETTER L WITH ACUTE: Ĺ
-\def\lacute {\char"0013A } % LATIN SMALL LETTER L WITH ACUTE: ĺ
-\def\Lcommaaccent {\char"0013B } % LATIN CAPITAL LETTER L WITH CEDILLA: Ä»
-\def\lcommaaccent {\char"0013C } % LATIN SMALL LETTER L WITH CEDILLA: ļ
-\def\Lcaron {\char"0013D } % LATIN CAPITAL LETTER L WITH CARON: Ľ
-\def\lcaron {\char"0013E } % LATIN SMALL LETTER L WITH CARON: ľ
-\def\Ldotmiddle {\char"0013F } % LATIN CAPITAL LETTER L WITH MIDDLE DOT: Ä¿
-\def\ldotmiddle {\char"00140 } % LATIN SMALL LETTER L WITH MIDDLE DOT: ŀ
-\def\Lstroke {\char"00141 } % LATIN CAPITAL LETTER L WITH STROKE: Å
-\def\lstroke {\char"00142 } % LATIN SMALL LETTER L WITH STROKE: Å‚
-\def\Nacute {\char"00143 } % LATIN CAPITAL LETTER N WITH ACUTE: Ń
-\def\nacute {\char"00144 } % LATIN SMALL LETTER N WITH ACUTE: Å„
-\def\Ncommaaccent {\char"00145 } % LATIN CAPITAL LETTER N WITH CEDILLA: Å…
-\def\ncommaaccent {\char"00146 } % LATIN SMALL LETTER N WITH CEDILLA: ņ
-\def\Ncaron {\char"00147 } % LATIN CAPITAL LETTER N WITH CARON: Ň
-\def\ncaron {\char"00148 } % LATIN SMALL LETTER N WITH CARON: ň
-\def\napostrophe {\char"00149 } % LATIN SMALL LETTER N PRECEDED BY APOSTROPHE: ʼn
-\def\Neng {\char"0014A } % LATIN CAPITAL LETTER ENG: ÅŠ
-\def\neng {\char"0014B } % LATIN SMALL LETTER ENG: Å‹
-\def\Omacron {\char"0014C } % LATIN CAPITAL LETTER O WITH MACRON: Ō
-\def\omacron {\char"0014D } % LATIN SMALL LETTER O WITH MACRON: Å
-\def\Obreve {\char"0014E } % LATIN CAPITAL LETTER O WITH BREVE: ÅŽ
-\def\obreve {\char"0014F } % LATIN SMALL LETTER O WITH BREVE: Å
-\def\Ohungarumlaut {\char"00150 } % LATIN CAPITAL LETTER O WITH DOUBLE ACUTE: Å
-\def\ohungarumlaut {\char"00151 } % LATIN SMALL LETTER O WITH DOUBLE ACUTE: Å‘
-\def\OEligature {\char"00152 } % LATIN CAPITAL LIGATURE OE: Å’
-\def\oeligature {\char"00153 } % LATIN SMALL LIGATURE OE: Å“
-\def\Racute {\char"00154 } % LATIN CAPITAL LETTER R WITH ACUTE: Å”
-\def\racute {\char"00155 } % LATIN SMALL LETTER R WITH ACUTE: Å•
-\def\Rcommaaccent {\char"00156 } % LATIN CAPITAL LETTER R WITH CEDILLA: Å–
-\def\rcommaaccent {\char"00157 } % LATIN SMALL LETTER R WITH CEDILLA: Å—
-\def\Rcaron {\char"00158 } % LATIN CAPITAL LETTER R WITH CARON: Ř
-\def\rcaron {\char"00159 } % LATIN SMALL LETTER R WITH CARON: Å™
-\def\Sacute {\char"0015A } % LATIN CAPITAL LETTER S WITH ACUTE: Åš
-\def\sacute {\char"0015B } % LATIN SMALL LETTER S WITH ACUTE: Å›
-\def\Scircumflex {\char"0015C } % LATIN CAPITAL LETTER S WITH CIRCUMFLEX: Ŝ
-\def\scircumflex {\char"0015D } % LATIN SMALL LETTER S WITH CIRCUMFLEX: Å
-\def\Scedilla {\char"0015E } % LATIN CAPITAL LETTER S WITH CEDILLA: Åž
-\def\scedilla {\char"0015F } % LATIN SMALL LETTER S WITH CEDILLA: ÅŸ
-\def\Scaron {\char"00160 } % LATIN CAPITAL LETTER S WITH CARON: Å 
-\def\scaron {\char"00161 } % LATIN SMALL LETTER S WITH CARON: Å¡
-\def\Tcedilla {\char"00162 } % LATIN CAPITAL LETTER T WITH CEDILLA: Ţ
-\def\tcedilla {\char"00163 } % LATIN SMALL LETTER T WITH CEDILLA: ţ
-\def\Tcaron {\char"00164 } % LATIN CAPITAL LETTER T WITH CARON: Ť
-\def\tcaron {\char"00165 } % LATIN SMALL LETTER T WITH CARON: ť
-\def\Tstroke {\char"00166 } % LATIN CAPITAL LETTER T WITH STROKE: Ŧ
-\def\tstroke {\char"00167 } % LATIN SMALL LETTER T WITH STROKE: ŧ
-\def\Utilde {\char"00168 } % LATIN CAPITAL LETTER U WITH TILDE: Ũ
-\def\utilde {\char"00169 } % LATIN SMALL LETTER U WITH TILDE: Å©
-\def\Umacron {\char"0016A } % LATIN CAPITAL LETTER U WITH MACRON: Ū
-\def\umacron {\char"0016B } % LATIN SMALL LETTER U WITH MACRON: Å«
-\def\Ubreve {\char"0016C } % LATIN CAPITAL LETTER U WITH BREVE: Ŭ
-\def\ubreve {\char"0016D } % LATIN SMALL LETTER U WITH BREVE: Å­
-\def\Uring {\char"0016E } % LATIN CAPITAL LETTER U WITH RING ABOVE: Å®
-\def\uring {\char"0016F } % LATIN SMALL LETTER U WITH RING ABOVE: ů
-\def\Uhungarumlaut {\char"00170 } % LATIN CAPITAL LETTER U WITH DOUBLE ACUTE: Å°
-\def\uhungarumlaut {\char"00171 } % LATIN SMALL LETTER U WITH DOUBLE ACUTE: ű
-\def\Uogonek {\char"00172 } % LATIN CAPITAL LETTER U WITH OGONEK: Ų
-\def\uogonek {\char"00173 } % LATIN SMALL LETTER U WITH OGONEK: ų
-\def\Wcircumflex {\char"00174 } % LATIN CAPITAL LETTER W WITH CIRCUMFLEX: Å´
-\def\wcircumflex {\char"00175 } % LATIN SMALL LETTER W WITH CIRCUMFLEX: ŵ
-\def\Ycircumflex {\char"00176 } % LATIN CAPITAL LETTER Y WITH CIRCUMFLEX: Ŷ
-\def\ycircumflex {\char"00177 } % LATIN SMALL LETTER Y WITH CIRCUMFLEX: Å·
-\def\Ydiaeresis {\char"00178 } % LATIN CAPITAL LETTER Y WITH DIAERESIS: Ÿ
-\def\Zacute {\char"00179 } % LATIN CAPITAL LETTER Z WITH ACUTE: Ź
-\def\zacute {\char"0017A } % LATIN SMALL LETTER Z WITH ACUTE: ź
-\def\Zdotaccent {\char"0017B } % LATIN CAPITAL LETTER Z WITH DOT ABOVE: Å»
-\def\zdotaccent {\char"0017C } % LATIN SMALL LETTER Z WITH DOT ABOVE: ż
-\def\Zcaron {\char"0017D } % LATIN CAPITAL LETTER Z WITH CARON: Ž
-\def\zcaron {\char"0017E } % LATIN SMALL LETTER Z WITH CARON: ž
-\def\slong {\char"0017F } % LATIN SMALL LETTER LONG S: Å¿
-\def\bstroke {\char"00180 } % LATIN SMALL LETTER B WITH STROKE: ƀ
-\def\Bhook {\char"00181 } % LATIN CAPITAL LETTER B WITH HOOK: Æ
-\def\Chook {\char"00187 } % LATIN CAPITAL LETTER C WITH HOOK: Ƈ
-\def\chook {\char"00188 } % LATIN SMALL LETTER C WITH HOOK: ƈ
-\def\Dafrican {\char"00189 } % LATIN CAPITAL LETTER AFRICAN D: Ɖ
-\def\Dhook {\char"0018A } % LATIN CAPITAL LETTER D WITH HOOK: ÆŠ
-\def\Schwa {\char"0018F } % LATIN CAPITAL LETTER SCHWA: Æ
-\def\Fhook {\char"00191 } % LATIN CAPITAL LETTER F WITH HOOK: Æ‘
-\def\fhook {\char"00192 } % LATIN SMALL LETTER F WITH HOOK: Æ’
-\def\Ghook {\char"00193 } % LATIN CAPITAL LETTER G WITH HOOK: Æ“
-\def\Istroke {\char"00197 } % LATIN CAPITAL LETTER I WITH STROKE: Æ—
-\def\Khook {\char"00198 } % LATIN CAPITAL LETTER K WITH HOOK: Ƙ
-\def\khook {\char"00199 } % LATIN SMALL LETTER K WITH HOOK: Æ™
-\def\lbar {\char"0019A } % LATIN SMALL LETTER L WITH BAR: Æš
-\def\Ohorn {\char"001A0 } % LATIN CAPITAL LETTER O WITH HORN: Æ 
-\def\ohorn {\char"001A1 } % LATIN SMALL LETTER O WITH HORN: Æ¡
-\def\Phook {\char"001A4 } % LATIN CAPITAL LETTER P WITH HOOK: Ƥ
-\def\phook {\char"001A5 } % LATIN SMALL LETTER P WITH HOOK: ƥ
-\def\Thook {\char"001AC } % LATIN CAPITAL LETTER T WITH HOOK: Ƭ
-\def\thook {\char"001AD } % LATIN SMALL LETTER T WITH HOOK: Æ­
-\def\Uhorn {\char"001AF } % LATIN CAPITAL LETTER U WITH HORN: Ư
-\def\uhorn {\char"001B0 } % LATIN SMALL LETTER U WITH HORN: Æ°
-\def\Uhook {\char"001B2 } % LATIN CAPITAL LETTER V WITH HOOK: Ʋ
-\def\Yhook {\char"001B3 } % LATIN CAPITAL LETTER Y WITH HOOK: Ƴ
-\def\yhook {\char"001B4 } % LATIN SMALL LETTER Y WITH HOOK: Æ´
-\def\Zstroke {\char"001B5 } % LATIN CAPITAL LETTER Z WITH STROKE: Ƶ
-\def\zstroke {\char"001B6 } % LATIN SMALL LETTER Z WITH STROKE: ƶ
-\def\DZcaronligature {\char"001C4 } % LATIN CAPITAL LETTER DZ WITH CARON: Ç„
-\def\Dzcaronligature {\char"001C5 } % LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON: Ç…
-\def\dzcaronligature {\char"001C6 } % LATIN SMALL LETTER DZ WITH CARON: dž
-\def\LJligature {\char"001C7 } % LATIN CAPITAL LETTER LJ: LJ
-\def\Ljligature {\char"001C8 } % LATIN CAPITAL LETTER L WITH SMALL LETTER J: Lj
-\def\ljligature {\char"001C9 } % LATIN SMALL LETTER LJ: lj
-\def\NJligature {\char"001CA } % LATIN CAPITAL LETTER NJ: ÇŠ
-\def\Njligature {\char"001CB } % LATIN CAPITAL LETTER N WITH SMALL LETTER J: Ç‹
-\def\njligature {\char"001CC } % LATIN SMALL LETTER NJ: nj
-\def\Acaron {\char"001CD } % LATIN CAPITAL LETTER A WITH CARON: Ç
-\def\acaron {\char"001CE } % LATIN SMALL LETTER A WITH CARON: ÇŽ
-\def\Icaron {\char"001CF } % LATIN CAPITAL LETTER I WITH CARON: Ç
-\def\icaron {\char"001D0 } % LATIN SMALL LETTER I WITH CARON: Ç
-\def\Ocaron {\char"001D1 } % LATIN CAPITAL LETTER O WITH CARON: Ç‘
-\def\ocaron {\char"001D2 } % LATIN SMALL LETTER O WITH CARON: Ç’
-\def\Ucaron {\char"001D3 } % LATIN CAPITAL LETTER U WITH CARON: Ç“
-\def\ucaron {\char"001D4 } % LATIN SMALL LETTER U WITH CARON: Ç”
-\def\Udiaeresismacron {\char"001D5 } % LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON: Ç•
-\def\udiaeresismacron {\char"001D6 } % LATIN SMALL LETTER U WITH DIAERESIS AND MACRON: Ç–
-\def\Udiaeresisacute {\char"001D7 } % LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE: Ç—
-\def\udiaeresisacute {\char"001D8 } % LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE: ǘ
-\def\Udiaeresiscaron {\char"001D9 } % LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON: Ç™
-\def\udiaeresiscaron {\char"001DA } % LATIN SMALL LETTER U WITH DIAERESIS AND CARON: Çš
-\def\Udiaeresisgrave {\char"001DB } % LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE: Ç›
-\def\udiaeresisgrave {\char"001DC } % LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE: ǜ
-\def\Adiaeresismacron {\char"001DE } % LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON: Çž
-\def\adiaeresismacron {\char"001DF } % LATIN SMALL LETTER A WITH DIAERESIS AND MACRON: ÇŸ
-\def\Adotaccentmacron {\char"001E0 } % LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON: Ç 
-\def\adotaccentmacron {\char"001E1 } % LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON: Ç¡
-\def\AEmacron {\char"001E2 } % LATIN CAPITAL LETTER AE WITH MACRON: Ǣ
-\def\aemacron {\char"001E3 } % LATIN SMALL LETTER AE WITH MACRON: ǣ
-\def\Gstroke {\char"001E4 } % LATIN CAPITAL LETTER G WITH STROKE: Ǥ
-\def\gstroke {\char"001E5 } % LATIN SMALL LETTER G WITH STROKE: ǥ
-\def\Gcaron {\char"001E6 } % LATIN CAPITAL LETTER G WITH CARON: Ǧ
-\def\gcaron {\char"001E7 } % LATIN SMALL LETTER G WITH CARON: ǧ
-\def\Kcaron {\char"001E8 } % LATIN CAPITAL LETTER K WITH CARON: Ǩ
-\def\kcaron {\char"001E9 } % LATIN SMALL LETTER K WITH CARON: Ç©
-\def\Oogonek {\char"001EA } % LATIN CAPITAL LETTER O WITH OGONEK: Ǫ
-\def\oogonek {\char"001EB } % LATIN SMALL LETTER O WITH OGONEK: Ç«
-\def\Oogonekmacron {\char"001EC } % LATIN CAPITAL LETTER O WITH OGONEK AND MACRON: Ǭ
-\def\oogonekmacron {\char"001ED } % LATIN SMALL LETTER O WITH OGONEK AND MACRON: Ç­
-\def\jcaron {\char"001F0 } % LATIN SMALL LETTER J WITH CARON: Ç°
-\def\DZligature {\char"001F1 } % LATIN CAPITAL LETTER DZ: DZ
-\def\Dzligature {\char"001F2 } % LATIN CAPITAL LETTER D WITH SMALL LETTER Z: Dz
-\def\dzligature {\char"001F3 } % LATIN SMALL LETTER DZ: dz
-\def\Gacute {\char"001F4 } % LATIN CAPITAL LETTER G WITH ACUTE: Ç´
-\def\gacute {\char"001F5 } % LATIN SMALL LETTER G WITH ACUTE: ǵ
-\def\Ngrave {\char"001F8 } % LATIN CAPITAL LETTER N WITH GRAVE: Ǹ
-\def\ngrave {\char"001F9 } % LATIN SMALL LETTER N WITH GRAVE: ǹ
-\def\Aringacute {\char"001FA } % LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE: Ǻ
-\def\aringacute {\char"001FB } % LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE: Ç»
-\def\AEacute {\char"001FC } % LATIN CAPITAL LETTER AE WITH ACUTE: Ǽ
-\def\aeacute {\char"001FD } % LATIN SMALL LETTER AE WITH ACUTE: ǽ
-\def\Ostrokeacute {\char"001FE } % LATIN CAPITAL LETTER O WITH STROKE AND ACUTE: Ǿ
-\def\ostrokeacute {\char"001FF } % LATIN SMALL LETTER O WITH STROKE AND ACUTE: Ç¿
-\def\Adoublegrave {\char"00200 } % LATIN CAPITAL LETTER A WITH DOUBLE GRAVE: Ȁ
-\def\adoublegrave {\char"00201 } % LATIN SMALL LETTER A WITH DOUBLE GRAVE: È
-\def\Ainvertedbreve {\char"00202 } % LATIN CAPITAL LETTER A WITH INVERTED BREVE: È‚
-\def\ainvertedbreve {\char"00203 } % LATIN SMALL LETTER A WITH INVERTED BREVE: ȃ
-\def\Edoublegrave {\char"00204 } % LATIN CAPITAL LETTER E WITH DOUBLE GRAVE: È„
-\def\edoublegrave {\char"00205 } % LATIN SMALL LETTER E WITH DOUBLE GRAVE: È…
-\def\Einvertedbreve {\char"00206 } % LATIN CAPITAL LETTER E WITH INVERTED BREVE: Ȇ
-\def\einvertedbreve {\char"00207 } % LATIN SMALL LETTER E WITH INVERTED BREVE: ȇ
-\def\Idoublegrave {\char"00208 } % LATIN CAPITAL LETTER I WITH DOUBLE GRAVE: Ȉ
-\def\idoublegrave {\char"00209 } % LATIN SMALL LETTER I WITH DOUBLE GRAVE: ȉ
-\def\Iinvertedbreve {\char"0020A } % LATIN CAPITAL LETTER I WITH INVERTED BREVE: ÈŠ
-\def\iinvertedbreve {\char"0020B } % LATIN SMALL LETTER I WITH INVERTED BREVE: È‹
-\def\Odoublegrave {\char"0020C } % LATIN CAPITAL LETTER O WITH DOUBLE GRAVE: Ȍ
-\def\odoublegrave {\char"0020D } % LATIN SMALL LETTER O WITH DOUBLE GRAVE: È
-\def\Oinvertedbreve {\char"0020E } % LATIN CAPITAL LETTER O WITH INVERTED BREVE: ÈŽ
-\def\oinvertedbreve {\char"0020F } % LATIN SMALL LETTER O WITH INVERTED BREVE: È
-\def\Rdoublegrave {\char"00210 } % LATIN CAPITAL LETTER R WITH DOUBLE GRAVE: È
-\def\rdoublegrave {\char"00211 } % LATIN SMALL LETTER R WITH DOUBLE GRAVE: È‘
-\def\Rinvertedbreve {\char"00212 } % LATIN CAPITAL LETTER R WITH INVERTED BREVE: È’
-\def\rinvertedbreve {\char"00213 } % LATIN SMALL LETTER R WITH INVERTED BREVE: È“
-\def\Udoublegrave {\char"00214 } % LATIN CAPITAL LETTER U WITH DOUBLE GRAVE: È”
-\def\udoublegrave {\char"00215 } % LATIN SMALL LETTER U WITH DOUBLE GRAVE: È•
-\def\Uinvertedbreve {\char"00216 } % LATIN CAPITAL LETTER U WITH INVERTED BREVE: È–
-\def\uinvertedbreve {\char"00217 } % LATIN SMALL LETTER U WITH INVERTED BREVE: È—
-\def\Scommaaccent {\char"00218 } % LATIN CAPITAL LETTER S WITH COMMA BELOW: Ș
-\def\scommaaccent {\char"00219 } % LATIN SMALL LETTER S WITH COMMA BELOW: È™
-\def\Tcommaaccent {\char"0021A } % LATIN CAPITAL LETTER T WITH COMMA BELOW: Èš
-\def\tcommaaccent {\char"0021B } % LATIN SMALL LETTER T WITH COMMA BELOW: È›
-\def\Hcaron {\char"0021E } % LATIN CAPITAL LETTER H WITH CARON: Èž
-\def\hcaron {\char"0021F } % LATIN SMALL LETTER H WITH CARON: ÈŸ
-\def\dcurl {\char"00221 } % LATIN SMALL LETTER D WITH CURL: È¡
-\def\Zhook {\char"00224 } % LATIN CAPITAL LETTER Z WITH HOOK: Ȥ
-\def\zhook {\char"00225 } % LATIN SMALL LETTER Z WITH HOOK: ȥ
-\def\Adotaccent {\char"00226 } % LATIN CAPITAL LETTER A WITH DOT ABOVE: Ȧ
-\def\adotaccent {\char"00227 } % LATIN SMALL LETTER A WITH DOT ABOVE: ȧ
-\def\Ecedilla {\char"00228 } % LATIN CAPITAL LETTER E WITH CEDILLA: Ȩ
-\def\ecedilla {\char"00229 } % LATIN SMALL LETTER E WITH CEDILLA: È©
-\def\Odiaeresismacron {\char"0022A } % LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON: Ȫ
-\def\odiaeresismacron {\char"0022B } % LATIN SMALL LETTER O WITH DIAERESIS AND MACRON: È«
-\def\Otildemacron {\char"0022C } % LATIN CAPITAL LETTER O WITH TILDE AND MACRON: Ȭ
-\def\otildemacron {\char"0022D } % LATIN SMALL LETTER O WITH TILDE AND MACRON: È­
-\def\Odotaccent {\char"0022E } % LATIN CAPITAL LETTER O WITH DOT ABOVE: È®
-\def\odotaccent {\char"0022F } % LATIN SMALL LETTER O WITH DOT ABOVE: ȯ
-\def\Odotaccentmacron {\char"00230 } % LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON: È°
-\def\odotaccentmacron {\char"00231 } % LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON: ȱ
-\def\Ymacron {\char"00232 } % LATIN CAPITAL LETTER Y WITH MACRON: Ȳ
-\def\ymacron {\char"00233 } % LATIN SMALL LETTER Y WITH MACRON: ȳ
-\def\lcurl {\char"00234 } % LATIN SMALL LETTER L WITH CURL: È´
-\def\ncurl {\char"00235 } % LATIN SMALL LETTER N WITH CURL: ȵ
-\def\tcurl {\char"00236 } % LATIN SMALL LETTER T WITH CURL: ȶ
-\def\dotlessj {\char"00237 } % LATIN SMALL LETTER DOTLESS J: È·
-\def\Astroke {\char"0023A } % LATIN CAPITAL LETTER A WITH STROKE: Ⱥ
-\def\Cstroke {\char"0023B } % LATIN CAPITAL LETTER C WITH STROKE: È»
-\def\cstroke {\char"0023C } % LATIN SMALL LETTER C WITH STROKE: ȼ
-\def\Lbar {\char"0023D } % LATIN CAPITAL LETTER L WITH BAR: Ƚ
-\def\bhook {\char"00253 } % LATIN SMALL LETTER B WITH HOOK: É“
-\def\ccurl {\char"00255 } % LATIN SMALL LETTER C WITH CURL: É•
-\def\dtail {\char"00256 } % LATIN SMALL LETTER D WITH TAIL: É–
-\def\dhook {\char"00257 } % LATIN SMALL LETTER D WITH HOOK: É—
-\def\schwa {\char"00259 } % LATIN SMALL LETTER SCHWA: É™
-\def\schwahook {\char"0025A } % LATIN SMALL LETTER SCHWA WITH HOOK: Éš
-\def\dotlessjstroke {\char"0025F } % LATIN SMALL LETTER DOTLESS J WITH STROKE: ÉŸ
-\def\textcircumflex {\char"002C6 } % MODIFIER LETTER CIRCUMFLEX ACCENT: ˆ
-\def\textcaron {\char"002C7 } % CARON: ˇ
-\def\textbreve {\char"002D8 } % BREVE: ˘
-\def\textdotaccent {\char"002D9 } % DOT ABOVE: Ë™
-\def\textring {\char"002DA } % RING ABOVE: Ëš
-\def\textogonek {\char"002DB } % OGONEK: Ë›
-\def\texttilde {\char"002DC } % SMALL TILDE: ˜
-\def\texthungarumlaut {\char"002DD } % DOUBLE ACUTE ACCENT: Ë
-\def\textbottomdot {\char"00323 } % COMBINING DOT BELOW: ̣
-\def\textbottomcomma {\char"00326 } % COMBINING COMMA BELOW: ̦
-\def\greektonos {\char"00384 } % GREEK TONOS: ΄
-\def\greekdialytikatonos {\char"00385 } % GREEK DIALYTIKA TONOS: Î…
-\def\greekAlphatonos {\char"00386 } % GREEK CAPITAL LETTER ALPHA WITH TONOS: Ά
-\def\greekEpsilontonos {\char"00388 } % GREEK CAPITAL LETTER EPSILON WITH TONOS: Έ
-\def\greekEtatonos {\char"00389 } % GREEK CAPITAL LETTER ETA WITH TONOS: Ή
-\def\greekIotatonos {\char"0038A } % GREEK CAPITAL LETTER IOTA WITH TONOS: Ί
-\def\greekOmicrontonos {\char"0038C } % GREEK CAPITAL LETTER OMICRON WITH TONOS: Ό
-\def\greekUpsilontonos {\char"0038E } % GREEK CAPITAL LETTER UPSILON WITH TONOS: ÎŽ
-\def\greekOmegatonos {\char"0038F } % GREEK CAPITAL LETTER OMEGA WITH TONOS: Î
-\def\greekiotadialytikatonos {\char"00390 } % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS: Î
-\def\greekAlpha {\char"00391 } % GREEK CAPITAL LETTER ALPHA: Α
-\def\greekBeta {\char"00392 } % GREEK CAPITAL LETTER BETA: Î’
-\def\greekGamma {\char"00393 } % GREEK CAPITAL LETTER GAMMA: Γ
-\def\greekDelta {\char"00394 } % GREEK CAPITAL LETTER DELTA: Δ
-\def\greekEpsilon {\char"00395 } % GREEK CAPITAL LETTER EPSILON: Ε
-\def\greekZeta {\char"00396 } % GREEK CAPITAL LETTER ZETA: Ζ
-\def\greekEta {\char"00397 } % GREEK CAPITAL LETTER ETA: Η
-\def\greekTheta {\char"00398 } % GREEK CAPITAL LETTER THETA: Θ
-\def\greekIota {\char"00399 } % GREEK CAPITAL LETTER IOTA: Ι
-\def\greekKappa {\char"0039A } % GREEK CAPITAL LETTER KAPPA: Κ
-\def\greekLambda {\char"0039B } % GREEK CAPITAL LETTER LAMDA: Λ
-\def\greekMu {\char"0039C } % GREEK CAPITAL LETTER MU: Μ
-\def\greekNu {\char"0039D } % GREEK CAPITAL LETTER NU: Î
-\def\greekXi {\char"0039E } % GREEK CAPITAL LETTER XI: Ξ
-\def\greekOmicron {\char"0039F } % GREEK CAPITAL LETTER OMICRON: Ο
-\def\greekPi {\char"003A0 } % GREEK CAPITAL LETTER PI: Π
-\def\greekRho {\char"003A1 } % GREEK CAPITAL LETTER RHO: Ρ
-\def\greekSigma {\char"003A3 } % GREEK CAPITAL LETTER SIGMA: Σ
-\def\greekTau {\char"003A4 } % GREEK CAPITAL LETTER TAU: Τ
-\def\greekUpsilon {\char"003A5 } % GREEK CAPITAL LETTER UPSILON: Υ
-\def\greekPhi {\char"003A6 } % GREEK CAPITAL LETTER PHI: Φ
-\def\greekChi {\char"003A7 } % GREEK CAPITAL LETTER CHI: Χ
-\def\greekPsi {\char"003A8 } % GREEK CAPITAL LETTER PSI: Ψ
-\def\greekOmega {\char"003A9 } % GREEK CAPITAL LETTER OMEGA: Ω
-\def\greekIotadialytika {\char"003AA } % GREEK CAPITAL LETTER IOTA WITH DIALYTIKA: Ϊ
-\def\greekUpsilondialytika {\char"003AB } % GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA: Ϋ
-\def\greekalphatonos {\char"003AC } % GREEK SMALL LETTER ALPHA WITH TONOS: ά
-\def\greekepsilontonos {\char"003AD } % GREEK SMALL LETTER EPSILON WITH TONOS: έ
-\def\greeketatonos {\char"003AE } % GREEK SMALL LETTER ETA WITH TONOS: ή
-\def\greekiotatonos {\char"003AF } % GREEK SMALL LETTER IOTA WITH TONOS: ί
-\def\greekupsilondialytikatonos {\char"003B0 } % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS: ΰ
-\def\greekalpha {\char"003B1 } % GREEK SMALL LETTER ALPHA: α
-\def\greekbeta {\char"003B2 } % GREEK SMALL LETTER BETA: β
-\def\greekgamma {\char"003B3 } % GREEK SMALL LETTER GAMMA: γ
-\def\greekdelta {\char"003B4 } % GREEK SMALL LETTER DELTA: δ
-\def\greekepsilon {\char"003B5 } % GREEK SMALL LETTER EPSILON: ε
-\def\greekzeta {\char"003B6 } % GREEK SMALL LETTER ZETA: ζ
-\def\greeketa {\char"003B7 } % GREEK SMALL LETTER ETA: η
-\def\greektheta {\char"003B8 } % GREEK SMALL LETTER THETA: θ
-\def\greekiota {\char"003B9 } % GREEK SMALL LETTER IOTA: ι
-\def\greekkappa {\char"003BA } % GREEK SMALL LETTER KAPPA: κ
-\def\greeklambda {\char"003BB } % GREEK SMALL LETTER LAMDA: λ
-\def\greekmu {\char"003BC } % GREEK SMALL LETTER MU: μ
-\def\greeknu {\char"003BD } % GREEK SMALL LETTER NU: ν
-\def\greekxi {\char"003BE } % GREEK SMALL LETTER XI: ξ
-\def\greekomicron {\char"003BF } % GREEK SMALL LETTER OMICRON: ο
-\def\greekpi {\char"003C0 } % GREEK SMALL LETTER PI: π
-\def\greekrho {\char"003C1 } % GREEK SMALL LETTER RHO: Ï
-\def\greekfinalsigma {\char"003C2 } % GREEK SMALL LETTER FINAL SIGMA: Ï‚
-\def\greeksigma {\char"003C3 } % GREEK SMALL LETTER SIGMA: σ
-\def\greektau {\char"003C4 } % GREEK SMALL LETTER TAU: Ï„
-\def\greekupsilon {\char"003C5 } % GREEK SMALL LETTER UPSILON: Ï…
-\def\greekphi {\char"003C6 } % GREEK SMALL LETTER PHI: φ
-\def\greekchi {\char"003C7 } % GREEK SMALL LETTER CHI: χ
-\def\greekpsi {\char"003C8 } % GREEK SMALL LETTER PSI: ψ
-\def\greekomega {\char"003C9 } % GREEK SMALL LETTER OMEGA: ω
-\def\greekiotadialytika {\char"003CA } % GREEK SMALL LETTER IOTA WITH DIALYTIKA: ÏŠ
-\def\greekupsilondiaeresis {\char"003CB } % GREEK SMALL LETTER UPSILON WITH DIALYTIKA: Ï‹
-\def\greekomicrontonos {\char"003CC } % GREEK SMALL LETTER OMICRON WITH TONOS: ό
-\def\greekupsilontonos {\char"003CD } % GREEK SMALL LETTER UPSILON WITH TONOS: Ï
-\def\greekomegatonos {\char"003CE } % GREEK SMALL LETTER OMEGA WITH TONOS: ÏŽ
-\def\greekbetaalt {\char"003D0 } % GREEK BETA SYMBOL: Ï
-\def\greekthetaalt {\char"003D1 } % GREEK THETA SYMBOL: Ï‘
-\def\greekphialt {\char"003D5 } % GREEK PHI SYMBOL: Ï•
-\def\greekpialt {\char"003D6 } % GREEK PI SYMBOL: Ï–
-\def\greekkoppa {\char"003D9 } % GREEK SMALL LETTER ARCHAIC KOPPA: Ï™
-\def\greekstigma {\char"003DB } % GREEK SMALL LETTER STIGMA: Ï›
-\def\greekdigamma {\char"003DD } % GREEK SMALL LETTER DIGAMMA: Ï
-\def\greeknumkoppa {\char"003DF } % GREEK SMALL LETTER KOPPA: ÏŸ
-\def\greeksampi {\char"003E1 } % GREEK SMALL LETTER SAMPI: Ï¡
-\def\greekrhoalt {\char"003F1 } % GREEK RHO SYMBOL: ϱ
-\def\greeksigmalunate {\char"003F2 } % GREEK LUNATE SIGMA SYMBOL: ϲ
-\def\greekepsilonalt {\char"003F5 } % GREEK LUNATE EPSILON SYMBOL: ϵ
-\def\greekSigmalunate {\char"003F9 } % GREEK CAPITAL LUNATE SIGMA SYMBOL: Ϲ
-\def\cyrillicEgrave {\char"00400 } % CYRILLIC CAPITAL LETTER IE WITH GRAVE: Ѐ
-\def\cyrillicYO {\char"00401 } % CYRILLIC CAPITAL LETTER IO: Ð
-\def\cyrillicDJE {\char"00402 } % CYRILLIC CAPITAL LETTER DJE: Ђ
-\def\cyrillicGJE {\char"00403 } % CYRILLIC CAPITAL LETTER GJE: Ѓ
-\def\cyrillicIE {\char"00404 } % CYRILLIC CAPITAL LETTER UKRAINIAN IE: Є
-\def\cyrillicDZE {\char"00405 } % CYRILLIC CAPITAL LETTER DZE: Ð…
-\def\cyrillicII {\char"00406 } % CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I: І
-\def\cyrillicYI {\char"00407 } % CYRILLIC CAPITAL LETTER YI: Ї
-\def\cyrillicJE {\char"00408 } % CYRILLIC CAPITAL LETTER JE: Ј
-\def\cyrillicLJE {\char"00409 } % CYRILLIC CAPITAL LETTER LJE: Љ
-\def\cyrillicNJE {\char"0040A } % CYRILLIC CAPITAL LETTER NJE: Њ
-\def\cyrillicTSHE {\char"0040B } % CYRILLIC CAPITAL LETTER TSHE: Ћ
-\def\cyrillicKJE {\char"0040C } % CYRILLIC CAPITAL LETTER KJE: Ќ
-\def\cyrillicIgrave {\char"0040D } % CYRILLIC CAPITAL LETTER I WITH GRAVE: Ð
-\def\cyrillicUSHRT {\char"0040E } % CYRILLIC CAPITAL LETTER SHORT U: ÐŽ
-\def\cyrillicDZHE {\char"0040F } % CYRILLIC CAPITAL LETTER DZHE: Ð
-\def\cyrillicA {\char"00410 } % CYRILLIC CAPITAL LETTER A: Ð
-\def\cyrillicB {\char"00411 } % CYRILLIC CAPITAL LETTER BE: Б
-\def\cyrillicV {\char"00412 } % CYRILLIC CAPITAL LETTER VE: Ð’
-\def\cyrillicG {\char"00413 } % CYRILLIC CAPITAL LETTER GHE: Г
-\def\cyrillicD {\char"00414 } % CYRILLIC CAPITAL LETTER DE: Д
-\def\cyrillicE {\char"00415 } % CYRILLIC CAPITAL LETTER IE: Е
-\def\cyrillicZH {\char"00416 } % CYRILLIC CAPITAL LETTER ZHE: Ж
-\def\cyrillicZ {\char"00417 } % CYRILLIC CAPITAL LETTER ZE: З
-\def\cyrillicI {\char"00418 } % CYRILLIC CAPITAL LETTER I: И
-\def\cyrillicISHRT {\char"00419 } % CYRILLIC CAPITAL LETTER SHORT I: Й
-\def\cyrillicK {\char"0041A } % CYRILLIC CAPITAL LETTER KA: К
-\def\cyrillicL {\char"0041B } % CYRILLIC CAPITAL LETTER EL: Л
-\def\cyrillicM {\char"0041C } % CYRILLIC CAPITAL LETTER EM: М
-\def\cyrillicN {\char"0041D } % CYRILLIC CAPITAL LETTER EN: Ð
-\def\cyrillicO {\char"0041E } % CYRILLIC CAPITAL LETTER O: О
-\def\cyrillicP {\char"0041F } % CYRILLIC CAPITAL LETTER PE: П
-\def\cyrillicR {\char"00420 } % CYRILLIC CAPITAL LETTER ER: Р
-\def\cyrillicS {\char"00421 } % CYRILLIC CAPITAL LETTER ES: С
-\def\cyrillicT {\char"00422 } % CYRILLIC CAPITAL LETTER TE: Т
-\def\cyrillicU {\char"00423 } % CYRILLIC CAPITAL LETTER U: У
-\def\cyrillicF {\char"00424 } % CYRILLIC CAPITAL LETTER EF: Ф
-\def\cyrillicH {\char"00425 } % CYRILLIC CAPITAL LETTER HA: Х
-\def\cyrillicC {\char"00426 } % CYRILLIC CAPITAL LETTER TSE: Ц
-\def\cyrillicCH {\char"00427 } % CYRILLIC CAPITAL LETTER CHE: Ч
-\def\cyrillicSH {\char"00428 } % CYRILLIC CAPITAL LETTER SHA: Ш
-\def\cyrillicSHCH {\char"00429 } % CYRILLIC CAPITAL LETTER SHCHA: Щ
-\def\cyrillicHRDSN {\char"0042A } % CYRILLIC CAPITAL LETTER HARD SIGN: Ъ
-\def\cyrillicERY {\char"0042B } % CYRILLIC CAPITAL LETTER YERU: Ы
-\def\cyrillicSFTSN {\char"0042C } % CYRILLIC CAPITAL LETTER SOFT SIGN: Ь
-\def\cyrillicEREV {\char"0042D } % CYRILLIC CAPITAL LETTER E: Э
-\def\cyrillicYU {\char"0042E } % CYRILLIC CAPITAL LETTER YU: Ю
-\def\cyrillicYA {\char"0042F } % CYRILLIC CAPITAL LETTER YA: Я
-\def\cyrillica {\char"00430 } % CYRILLIC SMALL LETTER A: а
-\def\cyrillicb {\char"00431 } % CYRILLIC SMALL LETTER BE: б
-\def\cyrillicv {\char"00432 } % CYRILLIC SMALL LETTER VE: в
-\def\cyrillicg {\char"00433 } % CYRILLIC SMALL LETTER GHE: г
-\def\cyrillicd {\char"00434 } % CYRILLIC SMALL LETTER DE: д
-\def\cyrillice {\char"00435 } % CYRILLIC SMALL LETTER IE: е
-\def\cyrilliczh {\char"00436 } % CYRILLIC SMALL LETTER ZHE: ж
-\def\cyrillicz {\char"00437 } % CYRILLIC SMALL LETTER ZE: з
-\def\cyrillici {\char"00438 } % CYRILLIC SMALL LETTER I: и
-\def\cyrillicishrt {\char"00439 } % CYRILLIC SMALL LETTER SHORT I: й
-\def\cyrillick {\char"0043A } % CYRILLIC SMALL LETTER KA: к
-\def\cyrillicl {\char"0043B } % CYRILLIC SMALL LETTER EL: л
-\def\cyrillicm {\char"0043C } % CYRILLIC SMALL LETTER EM: м
-\def\cyrillicn {\char"0043D } % CYRILLIC SMALL LETTER EN: н
-\def\cyrillico {\char"0043E } % CYRILLIC SMALL LETTER O: о
-\def\cyrillicp {\char"0043F } % CYRILLIC SMALL LETTER PE: п
-\def\cyrillicr {\char"00440 } % CYRILLIC SMALL LETTER ER: р
-\def\cyrillics {\char"00441 } % CYRILLIC SMALL LETTER ES: Ñ
-\def\cyrillict {\char"00442 } % CYRILLIC SMALL LETTER TE: Ñ‚
-\def\cyrillicu {\char"00443 } % CYRILLIC SMALL LETTER U: у
-\def\cyrillicf {\char"00444 } % CYRILLIC SMALL LETTER EF: Ñ„
-\def\cyrillich {\char"00445 } % CYRILLIC SMALL LETTER HA: Ñ…
-\def\cyrillicc {\char"00446 } % CYRILLIC SMALL LETTER TSE: ц
-\def\cyrillicch {\char"00447 } % CYRILLIC SMALL LETTER CHE: ч
-\def\cyrillicsh {\char"00448 } % CYRILLIC SMALL LETTER SHA: ш
-\def\cyrillicshch {\char"00449 } % CYRILLIC SMALL LETTER SHCHA: щ
-\def\cyrillichrdsn {\char"0044A } % CYRILLIC SMALL LETTER HARD SIGN: ÑŠ
-\def\cyrillicery {\char"0044B } % CYRILLIC SMALL LETTER YERU: Ñ‹
-\def\cyrillicsftsn {\char"0044C } % CYRILLIC SMALL LETTER SOFT SIGN: ь
-\def\cyrillicerev {\char"0044D } % CYRILLIC SMALL LETTER E: Ñ
-\def\cyrillicyu {\char"0044E } % CYRILLIC SMALL LETTER YU: ÑŽ
-\def\cyrillicya {\char"0044F } % CYRILLIC SMALL LETTER YA: Ñ
-\def\cyrillicegrave {\char"00450 } % CYRILLIC SMALL LETTER IE WITH GRAVE: Ñ
-\def\cyrillicyo {\char"00451 } % CYRILLIC SMALL LETTER IO: Ñ‘
-\def\cyrillicdje {\char"00452 } % CYRILLIC SMALL LETTER DJE: Ñ’
-\def\cyrillicgje {\char"00453 } % CYRILLIC SMALL LETTER GJE: Ñ“
-\def\cyrillicie {\char"00454 } % CYRILLIC SMALL LETTER UKRAINIAN IE: Ñ”
-\def\cyrillicdze {\char"00455 } % CYRILLIC SMALL LETTER DZE: Ñ•
-\def\cyrillicii {\char"00456 } % CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I: Ñ–
-\def\cyrillicyi {\char"00457 } % CYRILLIC SMALL LETTER YI: Ñ—
-\def\cyrillicje {\char"00458 } % CYRILLIC SMALL LETTER JE: ј
-\def\cyrilliclje {\char"00459 } % CYRILLIC SMALL LETTER LJE: Ñ™
-\def\cyrillicnje {\char"0045A } % CYRILLIC SMALL LETTER NJE: Ñš
-\def\cyrillictshe {\char"0045B } % CYRILLIC SMALL LETTER TSHE: Ñ›
-\def\cyrillickje {\char"0045C } % CYRILLIC SMALL LETTER KJE: ќ
-\def\cyrillicigrave {\char"0045D } % CYRILLIC SMALL LETTER I WITH GRAVE: Ñ
-\def\cyrillicushrt {\char"0045E } % CYRILLIC SMALL LETTER SHORT U: Ñž
-\def\cyrillicdzhe {\char"0045F } % CYRILLIC SMALL LETTER DZHE: ÑŸ
-\def\cyrillicOMEGA {\char"00460 } % CYRILLIC CAPITAL LETTER OMEGA: Ñ 
-\def\cyrillicomega {\char"00461 } % CYRILLIC SMALL LETTER OMEGA: Ñ¡
-\def\cyrillicYAT {\char"00462 } % CYRILLIC CAPITAL LETTER YAT: Ѣ
-\def\cyrillicyat {\char"00463 } % CYRILLIC SMALL LETTER YAT: ѣ
-\def\cyrillicEiotified {\char"00464 } % CYRILLIC CAPITAL LETTER IOTIFIED E: Ѥ
-\def\cyrilliceiotified {\char"00465 } % CYRILLIC SMALL LETTER IOTIFIED E: ѥ
-\def\cyrillicLITTLEYUS {\char"00466 } % CYRILLIC CAPITAL LETTER LITTLE YUS: Ѧ
-\def\cyrilliclittleyus {\char"00467 } % CYRILLIC SMALL LETTER LITTLE YUS: ѧ
-\def\cyrillicLITTLEYUSiotified {\char"00468 } % CYRILLIC CAPITAL LETTER IOTIFIED LITTLE YUS: Ѩ
-\def\cyrilliclittleyusiotified {\char"00469 } % CYRILLIC SMALL LETTER IOTIFIED LITTLE YUS: Ñ©
-\def\cyrillicBIGYUS {\char"0046A } % CYRILLIC CAPITAL LETTER BIG YUS: Ѫ
-\def\cyrillicbigyus {\char"0046B } % CYRILLIC SMALL LETTER BIG YUS: Ñ«
-\def\cyrillicBIGYUSiotified {\char"0046C } % CYRILLIC CAPITAL LETTER IOTIFIED BIG YUS: Ѭ
-\def\cyrillicbigyusiotified {\char"0046D } % CYRILLIC SMALL LETTER IOTIFIED BIG YUS: Ñ­
-\def\cyrillicKSI {\char"0046E } % CYRILLIC CAPITAL LETTER KSI: Ñ®
-\def\cyrillicksi {\char"0046F } % CYRILLIC SMALL LETTER KSI: ѯ
-\def\cyrillicPSI {\char"00470 } % CYRILLIC CAPITAL LETTER PSI: Ñ°
-\def\cyrillicpsi {\char"00471 } % CYRILLIC SMALL LETTER PSI: ѱ
-\def\cyrillicFITA {\char"00472 } % CYRILLIC CAPITAL LETTER FITA: Ѳ
-\def\cyrillicfita {\char"00473 } % CYRILLIC SMALL LETTER FITA: ѳ
-\def\cyrillicIZHITSA {\char"00474 } % CYRILLIC CAPITAL LETTER IZHITSA: Ñ´
-\def\cyrillicizhitsa {\char"00475 } % CYRILLIC SMALL LETTER IZHITSA: ѵ
-\def\cyrillicIZHITSAdoublegrave {\char"00476 } % CYRILLIC CAPITAL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT: Ѷ
-\def\cyrillicizhitsadoublegrave {\char"00477 } % CYRILLIC SMALL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT: Ñ·
-\def\cyrillicUK {\char"00478 } % CYRILLIC CAPITAL LETTER UK: Ѹ
-\def\cyrillicuk {\char"00479 } % CYRILLIC SMALL LETTER UK: ѹ
-\def\cyrillicOMEGAround {\char"0047A } % CYRILLIC CAPITAL LETTER ROUND OMEGA: Ѻ
-\def\cyrillicomegaround {\char"0047B } % CYRILLIC SMALL LETTER ROUND OMEGA: Ñ»
-\def\cyrillicOMEGAtitlo {\char"0047C } % CYRILLIC CAPITAL LETTER OMEGA WITH TITLO: Ѽ
-\def\cyrillicomegatitlo {\char"0047D } % CYRILLIC SMALL LETTER OMEGA WITH TITLO: ѽ
-\def\cyrillicOT {\char"0047E } % CYRILLIC CAPITAL LETTER OT: Ѿ
-\def\cyrillicot {\char"0047F } % CYRILLIC SMALL LETTER OT: Ñ¿
-\def\cyrillicKOPPA {\char"00480 } % CYRILLIC CAPITAL LETTER KOPPA: Ò€
-\def\cyrillickoppa {\char"00481 } % CYRILLIC SMALL LETTER KOPPA: Ò
-\def\cyrillicTITLO {\char"00483 } % COMBINING CYRILLIC TITLO: Òƒ
-\def\cyrillicPALATALIZATION {\char"00484 } % COMBINING CYRILLIC PALATALIZATION: Ò„
-\def\cyrillicDASIAPNEUMATA {\char"00485 } % COMBINING CYRILLIC DASIA PNEUMATA: Ò…
-\def\cyrillicPSILIPNEUMATA {\char"00486 } % COMBINING CYRILLIC PSILI PNEUMATA: Ò†
-\def\cyrillicISHRTtail {\char"0048A } % CYRILLIC CAPITAL LETTER SHORT I WITH TAIL: ÒŠ
-\def\cyrillicishrttail {\char"0048B } % CYRILLIC SMALL LETTER SHORT I WITH TAIL: Ò‹
-\def\cyrillicSEMISOFT {\char"0048C } % CYRILLIC CAPITAL LETTER SEMISOFT SIGN: Ҍ
-\def\cyrillicsemisoft {\char"0048D } % CYRILLIC SMALL LETTER SEMISOFT SIGN: Ò
-\def\cyrillicERtick {\char"0048E } % CYRILLIC CAPITAL LETTER ER WITH TICK: ÒŽ
-\def\cyrillicertick {\char"0048F } % CYRILLIC SMALL LETTER ER WITH TICK: Ò
-\def\cyrillicGHEupturn {\char"00490 } % CYRILLIC CAPITAL LETTER GHE WITH UPTURN: Ò
-\def\cyrillicgheupturn {\char"00491 } % CYRILLIC SMALL LETTER GHE WITH UPTURN: Ò‘
-\def\cyrillicGHEstroke {\char"00492 } % CYRILLIC CAPITAL LETTER GHE WITH STROKE: Ò’
-\def\cyrillicghestroke {\char"00493 } % CYRILLIC SMALL LETTER GHE WITH STROKE: Ò“
-\def\cyrillicGHEmidhook {\char"00494 } % CYRILLIC CAPITAL LETTER GHE WITH MIDDLE HOOK: Ò”
-\def\cyrillicghemidhook {\char"00495 } % CYRILLIC SMALL LETTER GHE WITH MIDDLE HOOK: Ò•
-\def\cyrillicZHEdescender {\char"00496 } % CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER: Ò–
-\def\cyrilliczhedescender {\char"00497 } % CYRILLIC SMALL LETTER ZHE WITH DESCENDER: Ò—
-\def\cyrillicZDSC {\char"00498 } % CYRILLIC CAPITAL LETTER ZE WITH DESCENDER: Ò˜
-\def\cyrilliczdsc {\char"00499 } % CYRILLIC SMALL LETTER ZE WITH DESCENDER: Ò™
-\def\cyrillicKADC {\char"0049A } % CYRILLIC CAPITAL LETTER KA WITH DESCENDER: Òš
-\def\cyrillickadc {\char"0049B } % CYRILLIC SMALL LETTER KA WITH DESCENDER: Ò›
-\def\cyrillicKAvertstroke {\char"0049C } % CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE: Ҝ
-\def\cyrillickavertstroke {\char"0049D } % CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE: Ò
-\def\cyrillicKAstroke {\char"0049E } % CYRILLIC CAPITAL LETTER KA WITH STROKE: Òž
-\def\cyrillickastroke {\char"0049F } % CYRILLIC SMALL LETTER KA WITH STROKE: ÒŸ
-\def\cyrillicKAbashkir {\char"004A0 } % CYRILLIC CAPITAL LETTER BASHKIR KA: Ò 
-\def\cyrillickabashkir {\char"004A1 } % CYRILLIC SMALL LETTER BASHKIR KA: Ò¡
-\def\cyrillicENDC {\char"004A2 } % CYRILLIC CAPITAL LETTER EN WITH DESCENDER: Ò¢
-\def\cyrillicendc {\char"004A3 } % CYRILLIC SMALL LETTER EN WITH DESCENDER: Ò£
-\def\cyrillicENGHE {\char"004A4 } % CYRILLIC CAPITAL LIGATURE EN GHE: Ò¤
-\def\cyrillicenghe {\char"004A5 } % CYRILLIC SMALL LIGATURE EN GHE: Ò¥
-\def\cyrillicPEmidhook {\char"004A6 } % CYRILLIC CAPITAL LETTER PE WITH MIDDLE HOOK: Ò¦
-\def\cyrillicpemidhook {\char"004A7 } % CYRILLIC SMALL LETTER PE WITH MIDDLE HOOK: Ò§
-\def\cyrillicHA {\char"004A8 } % CYRILLIC CAPITAL LETTER ABKHASIAN HA: Ò¨
-\def\cyrillicha {\char"004A9 } % CYRILLIC SMALL LETTER ABKHASIAN HA: Ò©
-\def\cyrillicSDSC {\char"004AA } % CYRILLIC CAPITAL LETTER ES WITH DESCENDER: Òª
-\def\cyrillicsdsc {\char"004AB } % CYRILLIC SMALL LETTER ES WITH DESCENDER: Ò«
-\def\cyrillicTEDC {\char"004AC } % CYRILLIC CAPITAL LETTER TE WITH DESCENDER: Ò¬
-\def\cyrillictedc {\char"004AD } % CYRILLIC SMALL LETTER TE WITH DESCENDER: Ò­
-\def\cyrillicYstr {\char"004AE } % CYRILLIC CAPITAL LETTER STRAIGHT U: Ò®
-\def\cyrillicystr {\char"004AF } % CYRILLIC SMALL LETTER STRAIGHT U: Ò¯
-\def\cyrillicYstrstroke {\char"004B0 } % CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE: Ò°
-\def\cyrillicystrstroke {\char"004B1 } % CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE: Ò±
-\def\cyrillicHADC {\char"004B2 } % CYRILLIC CAPITAL LETTER HA WITH DESCENDER: Ò²
-\def\cyrillichadc {\char"004B3 } % CYRILLIC SMALL LETTER HA WITH DESCENDER: Ò³
-\def\cyrillicTETSE {\char"004B4 } % CYRILLIC CAPITAL LIGATURE TE TSE: Ò´
-\def\cyrillictetse {\char"004B5 } % CYRILLIC SMALL LIGATURE TE TSE: Òµ
-\def\cyrillicCHEDC {\char"004B6 } % CYRILLIC CAPITAL LETTER CHE WITH DESCENDER: Ò¶
-\def\cyrillicchedc {\char"004B7 } % CYRILLIC SMALL LETTER CHE WITH DESCENDER: Ò·
-\def\cyrillicCHEvertstroke {\char"004B8 } % CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE: Ò¸
-\def\cyrillicchevertstroke {\char"004B9 } % CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE: Ò¹
-\def\cyrillicSHHA {\char"004BA } % CYRILLIC CAPITAL LETTER SHHA: Òº
-\def\cyrillicshha {\char"004BB } % CYRILLIC SMALL LETTER SHHA: Ò»
-\def\cyrillicCHEabkhasian {\char"004BC } % CYRILLIC CAPITAL LETTER ABKHASIAN CHE: Ò¼
-\def\cyrilliccheabkhasian {\char"004BD } % CYRILLIC SMALL LETTER ABKHASIAN CHE: Ò½
-\def\cyrillicCHEDCabkhasian {\char"004BE } % CYRILLIC CAPITAL LETTER ABKHASIAN CHE WITH DESCENDER: Ò¾
-\def\cyrillicchedcabkhasian {\char"004BF } % CYRILLIC SMALL LETTER ABKHASIAN CHE WITH DESCENDER: Ò¿
-\def\cyrillicPALOCHKA {\char"004C0 } % CYRILLIC LETTER PALOCHKA: Ó€
-\def\cyrillicZHEbreve {\char"004C1 } % CYRILLIC CAPITAL LETTER ZHE WITH BREVE: Ó
-\def\cyrilliczhebreve {\char"004C2 } % CYRILLIC SMALL LETTER ZHE WITH BREVE: Ó‚
-\def\cyrillicKAhook {\char"004C3 } % CYRILLIC CAPITAL LETTER KA WITH HOOK: Óƒ
-\def\cyrillickahook {\char"004C4 } % CYRILLIC SMALL LETTER KA WITH HOOK: Ó„
-\def\cyrillicELtail {\char"004C5 } % CYRILLIC CAPITAL LETTER EL WITH TAIL: Ó…
-\def\cyrilliceltail {\char"004C6 } % CYRILLIC SMALL LETTER EL WITH TAIL: Ó†
-\def\cyrillicENhook {\char"004C7 } % CYRILLIC CAPITAL LETTER EN WITH HOOK: Ó‡
-\def\cyrillicenhook {\char"004C8 } % CYRILLIC SMALL LETTER EN WITH HOOK: Óˆ
-\def\cyrillicENtail {\char"004C9 } % CYRILLIC CAPITAL LETTER EN WITH TAIL: Ó‰
-\def\cyrillicentail {\char"004CA } % CYRILLIC SMALL LETTER EN WITH TAIL: ÓŠ
-\def\cyrillicCHEkhakassian {\char"004CB } % CYRILLIC CAPITAL LETTER KHAKASSIAN CHE: Ó‹
-\def\cyrillicchekhakassian {\char"004CC } % CYRILLIC SMALL LETTER KHAKASSIAN CHE: ӌ
-\def\cyrillicEMtail {\char"004CD } % CYRILLIC CAPITAL LETTER EM WITH TAIL: Ó
-\def\cyrillicemtail {\char"004CE } % CYRILLIC SMALL LETTER EM WITH TAIL: ÓŽ
-\def\cyrillicAbreve {\char"004D0 } % CYRILLIC CAPITAL LETTER A WITH BREVE: Ó
-\def\cyrillicabreve {\char"004D1 } % CYRILLIC SMALL LETTER A WITH BREVE: Ó‘
-\def\cyrillicAdiaeresis {\char"004D2 } % CYRILLIC CAPITAL LETTER A WITH DIAERESIS: Ó’
-\def\cyrillicadiaeresis {\char"004D3 } % CYRILLIC SMALL LETTER A WITH DIAERESIS: Ó“
-\def\cyrillicAE {\char"004D4 } % CYRILLIC CAPITAL LIGATURE A IE: Ó”
-\def\cyrillicae {\char"004D5 } % CYRILLIC SMALL LIGATURE A IE: Ó•
-\def\cyrillicEbreve {\char"004D6 } % CYRILLIC CAPITAL LETTER IE WITH BREVE: Ó–
-\def\cyrillicebreve {\char"004D7 } % CYRILLIC SMALL LETTER IE WITH BREVE: Ó—
-\def\cyrillicSCHWA {\char"004D8 } % CYRILLIC CAPITAL LETTER SCHWA: Ó˜
-\def\cyrillicschwa {\char"004D9 } % CYRILLIC SMALL LETTER SCHWA: Ó™
-\def\cyrillicSCHWAdiaeresis {\char"004DA } % CYRILLIC CAPITAL LETTER SCHWA WITH DIAERESIS: Óš
-\def\cyrillicschwadiaeresis {\char"004DB } % CYRILLIC SMALL LETTER SCHWA WITH DIAERESIS: Ó›
-\def\cyrillicZHEdiaeresis {\char"004DC } % CYRILLIC CAPITAL LETTER ZHE WITH DIAERESIS: Ӝ
-\def\cyrilliczhediaeresis {\char"004DD } % CYRILLIC SMALL LETTER ZHE WITH DIAERESIS: Ó
-\def\cyrillicZEdiaeresis {\char"004DE } % CYRILLIC CAPITAL LETTER ZE WITH DIAERESIS: Óž
-\def\cyrilliczediaeresis {\char"004DF } % CYRILLIC SMALL LETTER ZE WITH DIAERESIS: ÓŸ
-\def\cyrillicDZEabkhasian {\char"004E0 } % CYRILLIC CAPITAL LETTER ABKHASIAN DZE: Ó 
-\def\cyrillicdzeabkhasian {\char"004E1 } % CYRILLIC SMALL LETTER ABKHASIAN DZE: Ó¡
-\def\cyrillicImacron {\char"004E2 } % CYRILLIC CAPITAL LETTER I WITH MACRON: Ó¢
-\def\cyrillicimacron {\char"004E3 } % CYRILLIC SMALL LETTER I WITH MACRON: Ó£
-\def\cyrillicIdiaeresis {\char"004E4 } % CYRILLIC CAPITAL LETTER I WITH DIAERESIS: Ó¤
-\def\cyrillicidiaeresis {\char"004E5 } % CYRILLIC SMALL LETTER I WITH DIAERESIS: Ó¥
-\def\cyrillicOdiaeresis {\char"004E6 } % CYRILLIC CAPITAL LETTER O WITH DIAERESIS: Ó¦
-\def\cyrillicodiaeresis {\char"004E7 } % CYRILLIC SMALL LETTER O WITH DIAERESIS: Ó§
-\def\cyrillicObarred {\char"004E8 } % CYRILLIC CAPITAL LETTER BARRED O: Ó¨
-\def\cyrillicobarred {\char"004E9 } % CYRILLIC SMALL LETTER BARRED O: Ó©
-\def\cyrillicObarreddiaeresis {\char"004EA } % CYRILLIC CAPITAL LETTER BARRED O WITH DIAERESIS: Óª
-\def\cyrillicobarreddiaeresis {\char"004EB } % CYRILLIC SMALL LETTER BARRED O WITH DIAERESIS: Ó«
-\def\cyrillicEdiaeresis {\char"004EC } % CYRILLIC CAPITAL LETTER E WITH DIAERESIS: Ó¬
-\def\cyrillicediaeresis {\char"004ED } % CYRILLIC SMALL LETTER E WITH DIAERESIS: Ó­
-\def\cyrillicUmacron {\char"004EE } % CYRILLIC CAPITAL LETTER U WITH MACRON: Ó®
-\def\cyrillicumacron {\char"004EF } % CYRILLIC SMALL LETTER U WITH MACRON: Ó¯
-\def\cyrillicUdiaeresis {\char"004F0 } % CYRILLIC CAPITAL LETTER U WITH DIAERESIS: Ó°
-\def\cyrillicudiaeresis {\char"004F1 } % CYRILLIC SMALL LETTER U WITH DIAERESIS: Ó±
-\def\cyrillicUdoubleacute {\char"004F2 } % CYRILLIC CAPITAL LETTER U WITH DOUBLE ACUTE: Ó²
-\def\cyrillicudoubleacute {\char"004F3 } % CYRILLIC SMALL LETTER U WITH DOUBLE ACUTE: Ó³
-\def\cyrillicCHEdiaeresis {\char"004F4 } % CYRILLIC CAPITAL LETTER CHE WITH DIAERESIS: Ó´
-\def\cyrillicchediaeresis {\char"004F5 } % CYRILLIC SMALL LETTER CHE WITH DIAERESIS: Óµ
-\def\cyrillicYERUdiaeresis {\char"004F8 } % CYRILLIC CAPITAL LETTER YERU WITH DIAERESIS: Ó¸
-\def\cyrillicyerudiaeresis {\char"004F9 } % CYRILLIC SMALL LETTER YERU WITH DIAERESIS: Ó¹
-\def\hebrewAlef {\char"005D0 } % HEBREW LETTER ALEF: ×
-\def\hebrewBet {\char"005D1 } % HEBREW LETTER BET: ב
-\def\hebrewGimel {\char"005D2 } % HEBREW LETTER GIMEL: ×’
-\def\hebrewDalet {\char"005D3 } % HEBREW LETTER DALET: ד
-\def\hebrewHe {\char"005D4 } % HEBREW LETTER HE: ×”
-\def\hebrewVav {\char"005D5 } % HEBREW LETTER VAV: ו
-\def\hebrewZayin {\char"005D6 } % HEBREW LETTER ZAYIN: ×–
-\def\hebrewHet {\char"005D7 } % HEBREW LETTER HET: ×—
-\def\hebrewTet {\char"005D8 } % HEBREW LETTER TET: ט
-\def\hebrewYod {\char"005D9 } % HEBREW LETTER YOD: ×™
-\def\hebrewKaffinal {\char"005DA } % HEBREW LETTER FINAL KAF: ך
-\def\hebrewKaf {\char"005DB } % HEBREW LETTER KAF: ×›
-\def\hebrewLamed {\char"005DC } % HEBREW LETTER LAMED: ל
-\def\hebrewMemfinal {\char"005DD } % HEBREW LETTER FINAL MEM: ×
-\def\hebrewMem {\char"005DE } % HEBREW LETTER MEM: מ
-\def\hebrewNunfinal {\char"005DF } % HEBREW LETTER FINAL NUN: ן
-\def\hebrewNun {\char"005E0 } % HEBREW LETTER NUN: × 
-\def\hebrewSamekh {\char"005E1 } % HEBREW LETTER SAMEKH: ס
-\def\hebrewAyin {\char"005E2 } % HEBREW LETTER AYIN: ×¢
-\def\hebrewPefinal {\char"005E3 } % HEBREW LETTER FINAL PE: ×£
-\def\hebrewPe {\char"005E4 } % HEBREW LETTER PE: פ
-\def\hebrewTsadifinal {\char"005E5 } % HEBREW LETTER FINAL TSADI: ×¥
-\def\hebrewTsadi {\char"005E6 } % HEBREW LETTER TSADI: צ
-\def\hebrewQof {\char"005E7 } % HEBREW LETTER QOF: ק
-\def\hebrewResh {\char"005E8 } % HEBREW LETTER RESH: ר
-\def\hebrewShin {\char"005E9 } % HEBREW LETTER SHIN: ש
-\def\hebrewTav {\char"005EA } % HEBREW LETTER TAV: ת
-\def\Adotbelow {\char"01EA0 } % LATIN CAPITAL LETTER A WITH DOT BELOW: Ạ
-\def\adotbelow {\char"01EA1 } % LATIN SMALL LETTER A WITH DOT BELOW: ạ
-\def\Ahook {\char"01EA2 } % LATIN CAPITAL LETTER A WITH HOOK ABOVE: Ả
-\def\ahook {\char"01EA3 } % LATIN SMALL LETTER A WITH HOOK ABOVE: ả
-\def\Acircumflexacute {\char"01EA4 } % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE: Ấ
-\def\acircumflexacute {\char"01EA5 } % LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE: ấ
-\def\Acircumflexgrave {\char"01EA6 } % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE: Ầ
-\def\acircumflexgrave {\char"01EA7 } % LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE: ầ
-\def\Acircumflexhook {\char"01EA8 } % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE: Ẩ
-\def\acircumflexhook {\char"01EA9 } % LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE: ẩ
-\def\Acircumflextilde {\char"01EAA } % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE: Ẫ
-\def\acircumflextilde {\char"01EAB } % LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE: ẫ
-\def\Acircumflexdotbelow {\char"01EAC } % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW: Ậ
-\def\acircumflexdotbelow {\char"01EAD } % LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW: ậ
-\def\Abreveacute {\char"01EAE } % LATIN CAPITAL LETTER A WITH BREVE AND ACUTE: Ắ
-\def\abreveacute {\char"01EAF } % LATIN SMALL LETTER A WITH BREVE AND ACUTE: ắ
-\def\Abrevegrave {\char"01EB0 } % LATIN CAPITAL LETTER A WITH BREVE AND GRAVE: Ằ
-\def\abrevegrave {\char"01EB1 } % LATIN SMALL LETTER A WITH BREVE AND GRAVE: ằ
-\def\Abrevehook {\char"01EB2 } % LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE: Ẳ
-\def\abrevehook {\char"01EB3 } % LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE: ẳ
-\def\Abrevetilde {\char"01EB4 } % LATIN CAPITAL LETTER A WITH BREVE AND TILDE: Ẵ
-\def\abrevetilde {\char"01EB5 } % LATIN SMALL LETTER A WITH BREVE AND TILDE: ẵ
-\def\Abrevedotbelow {\char"01EB6 } % LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW: Ặ
-\def\abrevedotbelow {\char"01EB7 } % LATIN SMALL LETTER A WITH BREVE AND DOT BELOW: ặ
-\def\Edotbelow {\char"01EB8 } % LATIN CAPITAL LETTER E WITH DOT BELOW: Ẹ
-\def\edotbelow {\char"01EB9 } % LATIN SMALL LETTER E WITH DOT BELOW: ẹ
-\def\Ehook {\char"01EBA } % LATIN CAPITAL LETTER E WITH HOOK ABOVE: Ẻ
-\def\ehook {\char"01EBB } % LATIN SMALL LETTER E WITH HOOK ABOVE: ẻ
-\def\Etilde {\char"01EBC } % LATIN CAPITAL LETTER E WITH TILDE: Ẽ
-\def\etilde {\char"01EBD } % LATIN SMALL LETTER E WITH TILDE: ẽ
-\def\Ecircumflexacute {\char"01EBE } % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE: Ế
-\def\ecircumflexacute {\char"01EBF } % LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE: ế
-\def\Ecircumflexgrave {\char"01EC0 } % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE: Ề
-\def\ecircumflexgrave {\char"01EC1 } % LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE: á»
-\def\Ecircumflexhook {\char"01EC2 } % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE: Ể
-\def\ecircumflexhook {\char"01EC3 } % LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE: ể
-\def\Ecircumflextilde {\char"01EC4 } % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE: Ễ
-\def\ecircumflextilde {\char"01EC5 } % LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE: á»…
-\def\Ecircumflexdotbelow {\char"01EC6 } % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW: Ệ
-\def\ecircumflexdotbelow {\char"01EC7 } % LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW: ệ
-\def\Ihook {\char"01EC8 } % LATIN CAPITAL LETTER I WITH HOOK ABOVE: Ỉ
-\def\ihook {\char"01EC9 } % LATIN SMALL LETTER I WITH HOOK ABOVE: ỉ
-\def\Idotbelow {\char"01ECA } % LATIN CAPITAL LETTER I WITH DOT BELOW: Ị
-\def\idotbelow {\char"01ECB } % LATIN SMALL LETTER I WITH DOT BELOW: ị
-\def\Odotbelow {\char"01ECC } % LATIN CAPITAL LETTER O WITH DOT BELOW: Ọ
-\def\odotbelow {\char"01ECD } % LATIN SMALL LETTER O WITH DOT BELOW: á»
-\def\Ohook {\char"01ECE } % LATIN CAPITAL LETTER O WITH HOOK ABOVE: Ỏ
-\def\ohook {\char"01ECF } % LATIN SMALL LETTER O WITH HOOK ABOVE: á»
-\def\Ocircumflexacute {\char"01ED0 } % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE: á»
-\def\ocircumflexacute {\char"01ED1 } % LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE: ố
-\def\Ocircumflexgrave {\char"01ED2 } % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE: á»’
-\def\ocircumflexgrave {\char"01ED3 } % LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE: ồ
-\def\Ocircumflexhook {\char"01ED4 } % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE: á»”
-\def\ocircumflexhook {\char"01ED5 } % LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE: ổ
-\def\Ocircumflextilde {\char"01ED6 } % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE: á»–
-\def\ocircumflextilde {\char"01ED7 } % LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE: á»—
-\def\Ocircumflexdotbelow {\char"01ED8 } % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW: Ộ
-\def\ocircumflexdotbelow {\char"01ED9 } % LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW: á»™
-\def\Ohornacute {\char"01EDA } % LATIN CAPITAL LETTER O WITH HORN AND ACUTE: Ớ
-\def\ohornacute {\char"01EDB } % LATIN SMALL LETTER O WITH HORN AND ACUTE: á»›
-\def\Ohorngrave {\char"01EDC } % LATIN CAPITAL LETTER O WITH HORN AND GRAVE: Ờ
-\def\ohorngrave {\char"01EDD } % LATIN SMALL LETTER O WITH HORN AND GRAVE: á»
-\def\Ohornhook {\char"01EDE } % LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE: Ở
-\def\ohornhook {\char"01EDF } % LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE: ở
-\def\Ohorntilde {\char"01EE0 } % LATIN CAPITAL LETTER O WITH HORN AND TILDE: á» 
-\def\ohorntilde {\char"01EE1 } % LATIN SMALL LETTER O WITH HORN AND TILDE: ỡ
-\def\Ohorndotbelow {\char"01EE2 } % LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW: Ợ
-\def\ohorndotbelow {\char"01EE3 } % LATIN SMALL LETTER O WITH HORN AND DOT BELOW: ợ
-\def\Udotbelow {\char"01EE4 } % LATIN CAPITAL LETTER U WITH DOT BELOW: Ụ
-\def\udotbelow {\char"01EE5 } % LATIN SMALL LETTER U WITH DOT BELOW: ụ
-\def\Uhook {\char"01EE6 } % LATIN CAPITAL LETTER U WITH HOOK ABOVE: Ủ
-\def\uhook {\char"01EE7 } % LATIN SMALL LETTER U WITH HOOK ABOVE: ủ
-\def\Uhornacute {\char"01EE8 } % LATIN CAPITAL LETTER U WITH HORN AND ACUTE: Ứ
-\def\uhornacute {\char"01EE9 } % LATIN SMALL LETTER U WITH HORN AND ACUTE: ứ
-\def\Uhorngrave {\char"01EEA } % LATIN CAPITAL LETTER U WITH HORN AND GRAVE: Ừ
-\def\uhorngrave {\char"01EEB } % LATIN SMALL LETTER U WITH HORN AND GRAVE: ừ
-\def\Uhornhook {\char"01EEC } % LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE: Ử
-\def\uhornhook {\char"01EED } % LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE: á»­
-\def\Uhorntilde {\char"01EEE } % LATIN CAPITAL LETTER U WITH HORN AND TILDE: á»®
-\def\uhorntilde {\char"01EEF } % LATIN SMALL LETTER U WITH HORN AND TILDE: ữ
-\def\Uhorndotbelow {\char"01EF0 } % LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW: á»°
-\def\uhorndotbelow {\char"01EF1 } % LATIN SMALL LETTER U WITH HORN AND DOT BELOW: á»±
-\def\Ygrave {\char"01EF2 } % LATIN CAPITAL LETTER Y WITH GRAVE: Ỳ
-\def\ygrave {\char"01EF3 } % LATIN SMALL LETTER Y WITH GRAVE: ỳ
-\def\Ydotbelow {\char"01EF4 } % LATIN CAPITAL LETTER Y WITH DOT BELOW: á»´
-\def\ydotbelow {\char"01EF5 } % LATIN SMALL LETTER Y WITH DOT BELOW: ỵ
-\def\Yhook {\char"01EF6 } % LATIN CAPITAL LETTER Y WITH HOOK ABOVE: Ỷ
-\def\yhook {\char"01EF7 } % LATIN SMALL LETTER Y WITH HOOK ABOVE: á»·
-\def\Ytilde {\char"01EF8 } % LATIN CAPITAL LETTER Y WITH TILDE: Ỹ
-\def\ytilde {\char"01EF9 } % LATIN SMALL LETTER Y WITH TILDE: ỹ
-\def\greekalphapsili {\char"01F00 } % GREEK SMALL LETTER ALPHA WITH PSILI: á¼€
-\def\greekalphadasia {\char"01F01 } % GREEK SMALL LETTER ALPHA WITH DASIA: á¼
-\def\greekalphapsilivaria {\char"01F02 } % GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA: ἂ
-\def\greekalphadasiavaria {\char"01F03 } % GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA: ἃ
-\def\greekalphapsilitonos {\char"01F04 } % GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA: ἄ
-\def\greekalphadasiatonos {\char"01F05 } % GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA: á¼…
-\def\greekalphapsiliperispomeni {\char"01F06 } % GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI: ἆ
-\def\greekalphadasiaperispomeni {\char"01F07 } % GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI: ἇ
-\def\greekAlphapsili {\char"01F08 } % GREEK CAPITAL LETTER ALPHA WITH PSILI: Ἀ
-\def\greekAlphadasia {\char"01F09 } % GREEK CAPITAL LETTER ALPHA WITH DASIA: Ἁ
-\def\greekAlphapsilivaria {\char"01F0A } % GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA: Ἂ
-\def\greekAlphadasiavaria {\char"01F0B } % GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA: Ἃ
-\def\greekAlphapsilitonos {\char"01F0C } % GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA: Ἄ
-\def\greekAlphadasiatonos {\char"01F0D } % GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA: á¼
-\def\greekAlphapsiliperispomeni {\char"01F0E } % GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI: Ἆ
-\def\greekAlphadasiaperispomeni {\char"01F0F } % GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI: á¼
-\def\greekepsilonpsili {\char"01F10 } % GREEK SMALL LETTER EPSILON WITH PSILI: á¼
-\def\greekepsilondasia {\char"01F11 } % GREEK SMALL LETTER EPSILON WITH DASIA: ἑ
-\def\greekepsilonpsilivaria {\char"01F12 } % GREEK SMALL LETTER EPSILON WITH PSILI AND VARIA: á¼’
-\def\greekepsilondasiavaria {\char"01F13 } % GREEK SMALL LETTER EPSILON WITH DASIA AND VARIA: ἓ
-\def\greekepsilonpsilitonos {\char"01F14 } % GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA: á¼”
-\def\greekepsilondasiatonos {\char"01F15 } % GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA: ἕ
-\def\greekEpsilonpsili {\char"01F18 } % GREEK CAPITAL LETTER EPSILON WITH PSILI: Ἐ
-\def\greekEpsilondasia {\char"01F19 } % GREEK CAPITAL LETTER EPSILON WITH DASIA: á¼™
-\def\greekEpsilonpsilivaria {\char"01F1A } % GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA: Ἒ
-\def\greekEpsilondasiavaria {\char"01F1B } % GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA: á¼›
-\def\greekEpsilonpsilitonos {\char"01F1C } % GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA: Ἔ
-\def\greekEpsilondasiatonos {\char"01F1D } % GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA: á¼
-\def\greeketapsili {\char"01F20 } % GREEK SMALL LETTER ETA WITH PSILI: á¼ 
-\def\greeketadasia {\char"01F21 } % GREEK SMALL LETTER ETA WITH DASIA: ἡ
-\def\greeketapsilivaria {\char"01F22 } % GREEK SMALL LETTER ETA WITH PSILI AND VARIA: á¼¢
-\def\greeketadasiavaria {\char"01F23 } % GREEK SMALL LETTER ETA WITH DASIA AND VARIA: á¼£
-\def\greeketapsilitonos {\char"01F24 } % GREEK SMALL LETTER ETA WITH PSILI AND OXIA: ἤ
-\def\greeketadasiatonos {\char"01F25 } % GREEK SMALL LETTER ETA WITH DASIA AND OXIA: á¼¥
-\def\greeketapsiliperispomeni {\char"01F26 } % GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI: ἦ
-\def\greeketadasiaperispomeni {\char"01F27 } % GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI: ἧ
-\def\greekEtapsili {\char"01F28 } % GREEK CAPITAL LETTER ETA WITH PSILI: Ἠ
-\def\greekEtadasia {\char"01F29 } % GREEK CAPITAL LETTER ETA WITH DASIA: Ἡ
-\def\greekEtapsilivaria {\char"01F2A } % GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA: Ἢ
-\def\greekEtadasiavaria {\char"01F2B } % GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA: Ἣ
-\def\greekEtapsilitonos {\char"01F2C } % GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA: Ἤ
-\def\greekEtadasiatonos {\char"01F2D } % GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA: á¼­
-\def\greekEtapsiliperispomeni {\char"01F2E } % GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI: á¼®
-\def\greekEtadasiaperispomeni {\char"01F2F } % GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI: Ἧ
-\def\greekiotapsili {\char"01F30 } % GREEK SMALL LETTER IOTA WITH PSILI: á¼°
-\def\greekiotadasia {\char"01F31 } % GREEK SMALL LETTER IOTA WITH DASIA: á¼±
-\def\greekiotapsilivaria {\char"01F32 } % GREEK SMALL LETTER IOTA WITH PSILI AND VARIA: á¼²
-\def\greekiotadasiavaria {\char"01F33 } % GREEK SMALL LETTER IOTA WITH DASIA AND VARIA: á¼³
-\def\greekiotapsilitonos {\char"01F34 } % GREEK SMALL LETTER IOTA WITH PSILI AND OXIA: á¼´
-\def\greekiotadasiatonos {\char"01F35 } % GREEK SMALL LETTER IOTA WITH DASIA AND OXIA: á¼µ
-\def\greekiotapsiliperispomeni {\char"01F36 } % GREEK SMALL LETTER IOTA WITH PSILI AND PERISPOMENI: ἶ
-\def\greekiotadasiaperispomeni {\char"01F37 } % GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI: á¼·
-\def\greekIotapsili {\char"01F38 } % GREEK CAPITAL LETTER IOTA WITH PSILI: Ἰ
-\def\greekIotadasia {\char"01F39 } % GREEK CAPITAL LETTER IOTA WITH DASIA: á¼¹
-\def\greekIotapsilivaria {\char"01F3A } % GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA: Ἲ
-\def\greekIotadasiavaria {\char"01F3B } % GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA: á¼»
-\def\greekIotapsilitonos {\char"01F3C } % GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA: á¼¼
-\def\greekIotadasiatonos {\char"01F3D } % GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA: á¼½
-\def\greekIotapsiliperispomeni {\char"01F3E } % GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI: á¼¾
-\def\greekIotadasiaperispomeni {\char"01F3F } % GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI: Ἷ
-\def\greekomicronpsili {\char"01F40 } % GREEK SMALL LETTER OMICRON WITH PSILI: á½€
-\def\greekomicrondasia {\char"01F41 } % GREEK SMALL LETTER OMICRON WITH DASIA: á½
-\def\greekomicronpsilivaria {\char"01F42 } % GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA: ὂ
-\def\greekomicrondasiavaria {\char"01F43 } % GREEK SMALL LETTER OMICRON WITH DASIA AND VARIA: ὃ
-\def\greekomicronpsilitonos {\char"01F44 } % GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA: ὄ
-\def\greekomicrondasiatonos {\char"01F45 } % GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA: á½…
-\def\greekOmicronpsili {\char"01F48 } % GREEK CAPITAL LETTER OMICRON WITH PSILI: Ὀ
-\def\greekOmicrondasia {\char"01F49 } % GREEK CAPITAL LETTER OMICRON WITH DASIA: Ὁ
-\def\greekOmicronpsilivaria {\char"01F4A } % GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA: Ὂ
-\def\greekOmicrondasiavaria {\char"01F4B } % GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA: Ὃ
-\def\greekOmicronpsilitonos {\char"01F4C } % GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA: Ὄ
-\def\greekOmicrondasiatonos {\char"01F4D } % GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA: á½
-\def\greekupsilonpsili {\char"01F50 } % GREEK SMALL LETTER UPSILON WITH PSILI: á½
-\def\greekupsilondasia {\char"01F51 } % GREEK SMALL LETTER UPSILON WITH DASIA: ὑ
-\def\greekupsilonpsilivaria {\char"01F52 } % GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA: á½’
-\def\greekupsilondasiavaria {\char"01F53 } % GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA: ὓ
-\def\greekupsilonpsilitonos {\char"01F54 } % GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA: á½”
-\def\greekupsilondasiatonos {\char"01F55 } % GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA: ὕ
-\def\greekupsilonpsiliperispomeni {\char"01F56 } % GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI: á½–
-\def\greekupsilondasiaperispomeni {\char"01F57 } % GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI: á½—
-\def\greekUpsilondasia {\char"01F59 } % GREEK CAPITAL LETTER UPSILON WITH DASIA: á½™
-\def\greekUpsilondasiavaria {\char"01F5B } % GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA: á½›
-\def\greekUpsilondasiatonos {\char"01F5D } % GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA: á½
-\def\greekUpsilondasiaperispomeni {\char"01F5F } % GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI: Ὗ
-\def\greekomegapsili {\char"01F60 } % GREEK SMALL LETTER OMEGA WITH PSILI: á½ 
-\def\greekomegadasia {\char"01F61 } % GREEK SMALL LETTER OMEGA WITH DASIA: ὡ
-\def\greekomegapsilivaria {\char"01F62 } % GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA: á½¢
-\def\greekomegadasiavaria {\char"01F63 } % GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA: á½£
-\def\greekomegapsilitonos {\char"01F64 } % GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA: ὤ
-\def\greekomegadasiatonos {\char"01F65 } % GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA: á½¥
-\def\greekomegapsiliperispomeni {\char"01F66 } % GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI: ὦ
-\def\greekomegadasiaperispomeni {\char"01F67 } % GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI: ὧ
-\def\greekOmegapsili {\char"01F68 } % GREEK CAPITAL LETTER OMEGA WITH PSILI: Ὠ
-\def\greekOmegadasia {\char"01F69 } % GREEK CAPITAL LETTER OMEGA WITH DASIA: Ὡ
-\def\greekOmegapsilivaria {\char"01F6A } % GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA: Ὢ
-\def\greekOmegadasiavaria {\char"01F6B } % GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA: Ὣ
-\def\greekOmegapsilitonos {\char"01F6C } % GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA: Ὤ
-\def\greekOmegadasiatonos {\char"01F6D } % GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA: á½­
-\def\greekOmegapsiliperispomeni {\char"01F6E } % GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI: á½®
-\def\greekOmegadasiaperispomeni {\char"01F6F } % GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI: Ὧ
-\def\greekalphavaria {\char"01F70 } % GREEK SMALL LETTER ALPHA WITH VARIA: á½°
-\def\greekalphaoxia {\char"01F71 } % GREEK SMALL LETTER ALPHA WITH OXIA: á½±
-\def\greekepsilonvaria {\char"01F72 } % GREEK SMALL LETTER EPSILON WITH VARIA: á½²
-\def\greekepsilonoxia {\char"01F73 } % GREEK SMALL LETTER EPSILON WITH OXIA: á½³
-\def\greeketavaria {\char"01F74 } % GREEK SMALL LETTER ETA WITH VARIA: á½´
-\def\greeketaoxia {\char"01F75 } % GREEK SMALL LETTER ETA WITH OXIA: á½µ
-\def\greekiotavaria {\char"01F76 } % GREEK SMALL LETTER IOTA WITH VARIA: ὶ
-\def\greekiotaoxia {\char"01F77 } % GREEK SMALL LETTER IOTA WITH OXIA: á½·
-\def\greekomicronvaria {\char"01F78 } % GREEK SMALL LETTER OMICRON WITH VARIA: ὸ
-\def\greekomicronoxia {\char"01F79 } % GREEK SMALL LETTER OMICRON WITH OXIA: á½¹
-\def\greekupsilonvaria {\char"01F7A } % GREEK SMALL LETTER UPSILON WITH VARIA: ὺ
-\def\greekupsilonoxia {\char"01F7B } % GREEK SMALL LETTER UPSILON WITH OXIA: á½»
-\def\greekomegavaria {\char"01F7C } % GREEK SMALL LETTER OMEGA WITH VARIA: á½¼
-\def\greekomegaoxia {\char"01F7D } % GREEK SMALL LETTER OMEGA WITH OXIA: á½½
-\def\greekalphaiotasubpsili {\char"01F80 } % GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI: á¾€
-\def\greekalphaiotasubdasia {\char"01F81 } % GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI: á¾
-\def\greekalphaiotasubpsilivaria {\char"01F82 } % GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI: ᾂ
-\def\greekalphaiotasubdasiavaria {\char"01F83 } % GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI: ᾃ
-\def\greekalphaiotasubpsilitonos {\char"01F84 } % GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI: ᾄ
-\def\greekalphaiotasubdasiatonos {\char"01F85 } % GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI: á¾…
-\def\greekalphaiotasubpsiliperispomeni{\char"01F86 } % GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI: ᾆ
-\def\greekalphaiotasubdasiaperispomeni{\char"01F87 } % GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI: ᾇ
-\def\greekAlphaiotasubpsili {\char"01F88 } % GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI: ᾈ
-\def\greekAlphaiotasubdasia {\char"01F89 } % GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI: ᾉ
-\def\greekAlphaiotasubpsilivaria {\char"01F8A } % GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI: ᾊ
-\def\greekAlphaiotasubdasiavaria {\char"01F8B } % GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI: ᾋ
-\def\greekAlphaiotasubpsilitonos {\char"01F8C } % GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI: ᾌ
-\def\greekAlphaiotasubdasiatonos {\char"01F8D } % GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI: á¾
-\def\greekAlphaiotasubpsiliperispomeni{\char"01F8E } % GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI: ᾎ
-\def\greekAlphaiotasubdasiaperispomeni{\char"01F8F } % GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI: á¾
-\def\greeketaiotasubpsili {\char"01F90 } % GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI: á¾
-\def\greeketaiotasubdasia {\char"01F91 } % GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI: ᾑ
-\def\greeketaiotasubpsilivaria {\char"01F92 } % GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI: á¾’
-\def\greeketaiotasubdasiavaria {\char"01F93 } % GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI: ᾓ
-\def\greeketaiotasubpsilitonos {\char"01F94 } % GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI: á¾”
-\def\greeketaiotasubdasiatonos {\char"01F95 } % GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI: ᾕ
-\def\greeketaiotasubpsiliperispomeni {\char"01F96 } % GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI: á¾–
-\def\greeketaiotasubdasiaperispomeni {\char"01F97 } % GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI: á¾—
-\def\greekEtaiotasubpsili {\char"01F98 } % GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI: ᾘ
-\def\greekEtaiotasubdasia {\char"01F99 } % GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI: á¾™
-\def\greekEtaiotasubpsilivaria {\char"01F9A } % GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI: ᾚ
-\def\greekEtaiotasubdasiavaria {\char"01F9B } % GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI: á¾›
-\def\greekEtaiotasubpsilitonos {\char"01F9C } % GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI: ᾜ
-\def\greekEtaiotasubdasiatonos {\char"01F9D } % GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI: á¾
-\def\greekEtaiotasubpsiliperispomeni {\char"01F9E } % GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI: ᾞ
-\def\greekEtaiotasubdasiaperispomeni {\char"01F9F } % GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI: ᾟ
-\def\greekomegaiotasubpsili {\char"01FA0 } % GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI: á¾ 
-\def\greekomegaiotasubdasia {\char"01FA1 } % GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI: ᾡ
-\def\greekomegaiotasubpsilivaria {\char"01FA2 } % GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI: á¾¢
-\def\greekomegaiotasubdasiavaria {\char"01FA3 } % GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI: á¾£
-\def\greekomegaiotasubpsilitonos {\char"01FA4 } % GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI: ᾤ
-\def\greekomegaiotasubdasiatonos {\char"01FA5 } % GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI: á¾¥
-\def\greekomegaiotasubpsiliperispomeni{\char"01FA6 } % GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI: ᾦ
-\def\greekomegaiotasubdasiaperispomeni{\char"01FA7 } % GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI: ᾧ
-\def\greekOmegaiotasubpsili {\char"01FA8 } % GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI: ᾨ
-\def\greekOmegaiotasubdasia {\char"01FA9 } % GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI: ᾩ
-\def\greekOmegaiotasubpsilivaria {\char"01FAA } % GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI: ᾪ
-\def\greekOmegaiotasubdasiavaria {\char"01FAB } % GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI: ᾫ
-\def\greekOmegaiotasubpsilitonos {\char"01FAC } % GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI: ᾬ
-\def\greekOmegaiotasubdasiatonos {\char"01FAD } % GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI: á¾­
-\def\greekOmegaiotasubpsiliperispomeni{\char"01FAE } % GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI: á¾®
-\def\greekOmegaiotasubdasiaperispomeni{\char"01FAF } % GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI: ᾯ
-\def\greekalphavrachy {\char"01FB0 } % GREEK SMALL LETTER ALPHA WITH VRACHY: á¾°
-\def\greekalphamacron {\char"01FB1 } % GREEK SMALL LETTER ALPHA WITH MACRON: á¾±
-\def\greekalphaiotasubvaria {\char"01FB2 } % GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI: á¾²
-\def\greekalphaiotasub {\char"01FB3 } % GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI: á¾³
-\def\greekalphaiotasubtonos {\char"01FB4 } % GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI: á¾´
-\def\greekalphaperispomeni {\char"01FB6 } % GREEK SMALL LETTER ALPHA WITH PERISPOMENI: ᾶ
-\def\greekalphaiotasubperispomeni {\char"01FB7 } % GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI: á¾·
-\def\greekAlphavrachy {\char"01FB8 } % GREEK CAPITAL LETTER ALPHA WITH VRACHY: Ᾰ
-\def\greekAlphamacron {\char"01FB9 } % GREEK CAPITAL LETTER ALPHA WITH MACRON: á¾¹
-\def\greekAlphavaria {\char"01FBA } % GREEK CAPITAL LETTER ALPHA WITH VARIA: Ὰ
-\def\greekAlphatonos {\char"01FBB } % GREEK CAPITAL LETTER ALPHA WITH OXIA: á¾»
-\def\greekAlphaiotasub {\char"01FBC } % GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI: á¾¼
-\def\greekCoronis {\char"01FBD } % GREEK KORONIS: á¾½
-\def\greekprosgegrammeni {\char"01FBE } % GREEK PROSGEGRAMMENI: á¾¾
-\def\greekpsili {\char"01FBF } % GREEK PSILI: ᾿
-\def\greekperispomeni {\char"01FC0 } % GREEK PERISPOMENI: á¿€
-\def\greekdialytikaperispomeni {\char"01FC1 } % GREEK DIALYTIKA AND PERISPOMENI: á¿
-\def\greeketaiotasubvaria {\char"01FC2 } % GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI: á¿‚
-\def\greeketaiotasub {\char"01FC3 } % GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI: ῃ
-\def\greeketaiotasubtonos {\char"01FC4 } % GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI: á¿„
-\def\greeketaperispomeni {\char"01FC6 } % GREEK SMALL LETTER ETA WITH PERISPOMENI: ῆ
-\def\greeketaiotasubperispomeni {\char"01FC7 } % GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI: ῇ
-\def\greekEpsilonvaria {\char"01FC8 } % GREEK CAPITAL LETTER EPSILON WITH VARIA: Ὲ
-\def\greekEpsilontonos {\char"01FC9 } % GREEK CAPITAL LETTER EPSILON WITH OXIA: Έ
-\def\greekEtavaria {\char"01FCA } % GREEK CAPITAL LETTER ETA WITH VARIA: á¿Š
-\def\greekEtatonos {\char"01FCB } % GREEK CAPITAL LETTER ETA WITH OXIA: á¿‹
-\def\greekEtaiotasub {\char"01FCC } % GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI: ῌ
-\def\greekpsilivaria {\char"01FCD } % GREEK PSILI AND VARIA: á¿
-\def\greekpsilitonos {\char"01FCE } % GREEK PSILI AND OXIA: á¿Ž
-\def\greekpsiliperispomeni {\char"01FCF } % GREEK PSILI AND PERISPOMENI: á¿
-\def\greekiotavrachy {\char"01FD0 } % GREEK SMALL LETTER IOTA WITH VRACHY: á¿
-\def\greekiotamacron {\char"01FD1 } % GREEK SMALL LETTER IOTA WITH MACRON: á¿‘
-\def\greekiotadialytikavaria {\char"01FD2 } % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA: á¿’
-\def\greekiotadialytikatonos {\char"01FD3 } % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA: á¿“
-\def\greekiotaperispomeni {\char"01FD6 } % GREEK SMALL LETTER IOTA WITH PERISPOMENI: á¿–
-\def\greekiotadialytikaperispomeni {\char"01FD7 } % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI: á¿—
-\def\greekIotavrachy {\char"01FD8 } % GREEK CAPITAL LETTER IOTA WITH VRACHY: Ῐ
-\def\greekIotamacron {\char"01FD9 } % GREEK CAPITAL LETTER IOTA WITH MACRON: á¿™
-\def\greekIotavaria {\char"01FDA } % GREEK CAPITAL LETTER IOTA WITH VARIA: á¿š
-\def\greekIotatonos {\char"01FDB } % GREEK CAPITAL LETTER IOTA WITH OXIA: á¿›
-\def\greekdasiavaria {\char"01FDD } % GREEK DASIA AND VARIA: á¿
-\def\greekdasiatonos {\char"01FDE } % GREEK DASIA AND OXIA: á¿ž
-\def\greekdasiaperispomeni {\char"01FDF } % GREEK DASIA AND PERISPOMENI: á¿Ÿ
-\def\greekupsilonvrachy {\char"01FE0 } % GREEK SMALL LETTER UPSILON WITH VRACHY: á¿ 
-\def\greekupsilonmacron {\char"01FE1 } % GREEK SMALL LETTER UPSILON WITH MACRON: á¿¡
-\def\greekupsilondialytikavaria {\char"01FE2 } % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA: á¿¢
-\def\greekupsilondialytikatonos {\char"01FE3 } % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA: á¿£
-\def\greekrhopsili {\char"01FE4 } % GREEK SMALL LETTER RHO WITH PSILI: ῤ
-\def\greekrhodasia {\char"01FE5 } % GREEK SMALL LETTER RHO WITH DASIA: á¿¥
-\def\greekupsilonperispomeni {\char"01FE6 } % GREEK SMALL LETTER UPSILON WITH PERISPOMENI: ῦ
-\def\greekupsilondialytikaperispomeni {\char"01FE7 } % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI: ῧ
-\def\greekUpsilonvrachy {\char"01FE8 } % GREEK CAPITAL LETTER UPSILON WITH VRACHY: Ῠ
-\def\greekUpsilonmacron {\char"01FE9 } % GREEK CAPITAL LETTER UPSILON WITH MACRON: á¿©
-\def\greekUpsilonvaria {\char"01FEA } % GREEK CAPITAL LETTER UPSILON WITH VARIA: Ὺ
-\def\greekUpsilontonos {\char"01FEB } % GREEK CAPITAL LETTER UPSILON WITH OXIA: á¿«
-\def\greekRhodasia {\char"01FEC } % GREEK CAPITAL LETTER RHO WITH DASIA: Ῥ
-\def\greekdialytikavaria {\char"01FED } % GREEK DIALYTIKA AND VARIA: á¿­
-\def\greekdialytikatonos {\char"01FEE } % GREEK DIALYTIKA AND OXIA: á¿®
-\def\greekvaria {\char"01FEF } % GREEK VARIA: `
-\def\greekomegaiotasubvaria {\char"01FF2 } % GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI: ῲ
-\def\greekomegaiotasub {\char"01FF3 } % GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI: ῳ
-\def\greekomegaiotasubtonos {\char"01FF4 } % GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI: á¿´
-\def\greekomegaperispomeni {\char"01FF6 } % GREEK SMALL LETTER OMEGA WITH PERISPOMENI: ῶ
-\def\greekomegaiotasubperispomeni {\char"01FF7 } % GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI: á¿·
-\def\greekOmicronvaria {\char"01FF8 } % GREEK CAPITAL LETTER OMICRON WITH VARIA: Ὸ
-\def\greekOmicrontonos {\char"01FF9 } % GREEK CAPITAL LETTER OMICRON WITH OXIA: Ό
-\def\greekOmegavaria {\char"01FFA } % GREEK CAPITAL LETTER OMEGA WITH VARIA: Ὼ
-\def\greekOmegatonos {\char"01FFB } % GREEK CAPITAL LETTER OMEGA WITH OXIA: á¿»
-\def\greekOmegaiotasub {\char"01FFC } % GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI: ῼ
-\def\greekoxia {\char"01FFD } % GREEK OXIA: ´
-\def\greekdasia {\char"01FFE } % GREEK DASIA: ῾
-\def\zwnj {\char"0200C } % ZERO WIDTH NON-JOINER: ‌
-\def\zwj {\char"0200D } % ZERO WIDTH JOINER: â€
-\def\textminus {\char"02012 } % FIGURE DASH: ‒
-\def\endash {\char"02013 } % EN DASH: –
-\def\emdash {\char"02014 } % EM DASH: —
-\def\texthorizontalbar {\char"02015 } % HORIZONTAL BAR: ―
-\def\quoteleft {\char"02018 } % LEFT SINGLE QUOTATION MARK: ‘
-\def\quoteright {\char"02019 } % RIGHT SINGLE QUOTATION MARK: ’
-\def\quotesinglebase {\char"0201A } % SINGLE LOW-0x0009 QUOTATION MARK: ‚
-\def\quotedblleft {\char"0201C } % LEFT DOUBLE QUOTATION MARK: “
-\def\quotedblright {\char"0201D } % RIGHT DOUBLE QUOTATION MARK: â€
-\def\quotedblbase {\char"0201E } % DOUBLE LOW-0x0009 QUOTATION MARK: „
-\def\textdag {\char"02020 } % DAGGER: †
-\def\textddag {\char"02021 } % DOUBLE DAGGER: ‡
-\def\textbullet {\char"02022 } % BULLET: •
-\def\textellipsis {\char"02026 } % HORIZONTAL ELLIPSIS: …
-\def\perthousand {\char"02030 } % PER MILLE SIGN: ‰
-\def\guilsingleleft {\char"02039 } % SINGLE LEFT-POINTING ANGLE QUOTATION MARK: ‹
-\def\guilsingleright {\char"0203A } % SINGLE RIGHT-POINTING ANGLE QUOTATION MARK: ›
-\def\textfraction {\char"02044 } % FRACTION SLASH: â„
-\def\textdong {\char"020AB } % DONG SIGN: â‚«
-\def\texteuro {\char"020AC } % EURO SIGN: €
-\def\textcelsius {\char"02103 } % DEGREE CELSIUS: ℃
-\def\textnumero {\char"02116 } % NUMERO SIGN: â„–
-\def\textcircledP {\char"02117 } % SOUND RECORDING COPYRIGHT: â„—
-\def\trademark {\char"02122 } % TRADE MARK SIGN: â„¢
-\def\textounce {\char"02125 } % OUNCE SIGN: â„¥
-\def\textohm {\char"02126 } % OHM SIGN: Ω
-\def\textmho {\char"02127 } % INVERTED OHM SIGN: ℧
-\def\textkelvin {\char"0212A } % KELVIN SIGN: K
-\def\textAngstrom {\char"0212B } % ANGSTROM SIGN: â„«
-\def\onethird {\char"02153 } % VULGAR FRACTION ONE THIRD: â…“
-\def\twothirds {\char"02154 } % VULGAR FRACTION TWO THIRDS: â…”
-\def\onefifth {\char"02155 } % VULGAR FRACTION ONE FIFTH: â…•
-\def\twofifths {\char"02156 } % VULGAR FRACTION TWO FIFTHS: â…–
-\def\threefifths {\char"02157 } % VULGAR FRACTION THREE FIFTHS: â…—
-\def\fourfifths {\char"02158 } % VULGAR FRACTION FOUR FIFTHS: â…˜
-\def\onesixth {\char"02159 } % VULGAR FRACTION ONE SIXTH: â…™
-\def\fivesixths {\char"0215A } % VULGAR FRACTION FIVE SIXTHS: â…š
-\def\oneeighth {\char"0215B } % VULGAR FRACTION ONE EIGHTH: â…›
-\def\threeeighths {\char"0215C } % VULGAR FRACTION THREE EIGHTHS: ⅜
-\def\fiveeighths {\char"0215D } % VULGAR FRACTION FIVE EIGHTHS: â…
-\def\seveneighths {\char"0215E } % VULGAR FRACTION SEVEN EIGHTHS: â…ž
-\def\romanI {\char"02160 } % ROMAN NUMERAL ONE: â… 
-\def\romanII {\char"02161 } % ROMAN NUMERAL TWO: â…¡
-\def\romanIII {\char"02162 } % ROMAN NUMERAL THREE: â…¢
-\def\romanIV {\char"02163 } % ROMAN NUMERAL FOUR: â…£
-\def\romanV {\char"02164 } % ROMAN NUMERAL FIVE: â…¤
-\def\romanVI {\char"02165 } % ROMAN NUMERAL SIX: â…¥
-\def\romanVII {\char"02166 } % ROMAN NUMERAL SEVEN: â…¦
-\def\romanVIII {\char"02167 } % ROMAN NUMERAL EIGHT: â…§
-\def\romanIX {\char"02168 } % ROMAN NUMERAL NINE: â…¨
-\def\romanX {\char"02169 } % ROMAN NUMERAL TEN: â…©
-\def\romanXI {\char"0216A } % ROMAN NUMERAL ELEVEN: â…ª
-\def\romanXII {\char"0216B } % ROMAN NUMERAL TWELVE: â…«
-\def\romanL {\char"0216C } % ROMAN NUMERAL FIFTY: â…¬
-\def\romanC {\char"0216D } % ROMAN NUMERAL ONE HUNDRED: â…­
-\def\romanD {\char"0216E } % ROMAN NUMERAL FIVE HUNDRED: â…®
-\def\romanM {\char"0216F } % ROMAN NUMERAL ONE THOUSAND: â…¯
-\def\romani {\char"02170 } % SMALL ROMAN NUMERAL ONE: â…°
-\def\romanii {\char"02171 } % SMALL ROMAN NUMERAL TWO: â…±
-\def\romaniii {\char"02172 } % SMALL ROMAN NUMERAL THREE: â…²
-\def\romaniv {\char"02173 } % SMALL ROMAN NUMERAL FOUR: â…³
-\def\romanv {\char"02174 } % SMALL ROMAN NUMERAL FIVE: â…´
-\def\romanvi {\char"02175 } % SMALL ROMAN NUMERAL SIX: â…µ
-\def\romanvii {\char"02176 } % SMALL ROMAN NUMERAL SEVEN: â…¶
-\def\romanviii {\char"02177 } % SMALL ROMAN NUMERAL EIGHT: â…·
-\def\romanix {\char"02178 } % SMALL ROMAN NUMERAL NINE: â…¸
-\def\romanx {\char"02179 } % SMALL ROMAN NUMERAL TEN: â…¹
-\def\romanxi {\char"0217A } % SMALL ROMAN NUMERAL ELEVEN: â…º
-\def\romanxii {\char"0217B } % SMALL ROMAN NUMERAL TWELVE: â…»
-\def\romanl {\char"0217C } % SMALL ROMAN NUMERAL FIFTY: â…¼
-\def\romanc {\char"0217D } % SMALL ROMAN NUMERAL ONE HUNDRED: â…½
-\def\romand {\char"0217E } % SMALL ROMAN NUMERAL FIVE HUNDRED: â…¾
-\def\romanm {\char"0217F } % SMALL ROMAN NUMERAL ONE THOUSAND: â…¿
-\def\carriagereturn {\char"021B5 } % DOWNWARDS ARROW WITH CORNER LEFTWARDS: ↵
-\def\ffligature {\char"0FB00 } % LATIN SMALL LIGATURE FF: ff
-\def\filigature {\char"0FB01 } % LATIN SMALL LIGATURE FI: ï¬
-\def\flligature {\char"0FB02 } % LATIN SMALL LIGATURE FL: fl
-\def\ffiligature {\char"0FB03 } % LATIN SMALL LIGATURE FFI: ffi
-\def\fflligature {\char"0FB04 } % LATIN SMALL LIGATURE FFL: ffl
-\def\stligature {\char"0FB06 } % LATIN SMALL LIGATURE ST: st
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/xetx-cls.mkii b/Master/texmf-dist/tex/context/base/mkii/xetx-cls.mkii
deleted file mode 100644
index 9142f39e5c7..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xetx-cls.mkii
+++ /dev/null
@@ -1,511 +0,0 @@
-% filename : xetx-cls.mkii
-% comment : generated by mtxrun --script chars --xtx
-% author : Hans Hagen, PRAGMA-ADE, Hasselt NL
-% copyright: PRAGMA ADE / ConTeXt Development Team
-% license : see context related readme files
-
-% some character classes for xetex; seems to be rather hard coded, these numbers
-% and also a mix of several classes; here we do linebreaks
-
-\defineXTXcharinjectionclass[lb:id]
-\defineXTXcharinjectionclass[lb:cl]
-\defineXTXcharinjectionclass[lb:cm]
-\defineXTXcharinjectionclass[lb:is]
-\defineXTXcharinjectionclass[lb:ex]
-\defineXTXcharinjectionclass[lb:op]
-\defineXTXcharinjectionclass[lb:ns]
-
-\dofastrecurse{"00000}{"00008}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"0000E}{"0001F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"00021}{lb:ex}
-\dosetXTXcharacterclass{"00028}{lb:op}
-\dosetXTXcharacterclass{"0002C}{lb:is}
-\dosetXTXcharacterclass{"0002E}{lb:is}
-\dofastrecurse{"0003A}{"0003B}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:is}}
-\dosetXTXcharacterclass{"0003F}{lb:ex}
-\dosetXTXcharacterclass{"0005B}{lb:op}
-\dosetXTXcharacterclass{"0007B}{lb:op}
-\dosetXTXcharacterclass{"0007D}{lb:cl}
-\dofastrecurse{"0007F}{"00084}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00086}{"0009F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"000A1}{lb:op}
-\dosetXTXcharacterclass{"000BF}{lb:op}
-\dofastrecurse{"00300}{"0034E}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00350}{"0035B}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00363}{"0036F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"0037E}{lb:is}
-\dofastrecurse{"00483}{"00489}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"00589}{lb:is}
-\dofastrecurse{"00591}{"005BD}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"005BF}{lb:cm}
-\dofastrecurse{"005C1}{"005C2}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"005C4}{"005C5}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"005C6}{lb:ex}
-\dosetXTXcharacterclass{"005C7}{lb:cm}
-\dofastrecurse{"0060C}{"0060D}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:is}}
-\dofastrecurse{"00610}{"0061A}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"0061B}{lb:ex}
-\dosetXTXcharacterclass{"0061C}{lb:cm}
-\dofastrecurse{"0061E}{"0061F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ex}}
-\dofastrecurse{"0064B}{"0065F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"00670}{lb:cm}
-\dosetXTXcharacterclass{"006D4}{lb:ex}
-\dofastrecurse{"006D6}{"006DC}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"006DF}{"006E4}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"006E7}{"006E8}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"006EA}{"006ED}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"00711}{lb:cm}
-\dofastrecurse{"00730}{"0074A}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"007A6}{"007B0}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"007EB}{"007F3}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"007F8}{lb:is}
-\dosetXTXcharacterclass{"007F9}{lb:ex}
-\dofastrecurse{"00816}{"00819}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"0081B}{"00823}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00825}{"00827}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00829}{"0082D}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00859}{"0085B}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"008E3}{"00903}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"0093A}{"0093C}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"0093E}{"0094F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00951}{"00957}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00962}{"00963}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00981}{"00983}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"009BC}{lb:cm}
-\dofastrecurse{"009BE}{"009CD}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"009D7}{lb:cm}
-\dofastrecurse{"009E2}{"009E3}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00A01}{"00A03}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00A3C}{"00A51}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00A70}{"00A71}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00A75}{"00A83}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"00ABC}{lb:cm}
-\dofastrecurse{"00ABE}{"00ACD}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00AE2}{"00AE3}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00B01}{"00B03}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"00B3C}{lb:cm}
-\dofastrecurse{"00B3E}{"00B57}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00B62}{"00B63}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"00B82}{lb:cm}
-\dofastrecurse{"00BBE}{"00BCD}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"00BD7}{lb:cm}
-\dofastrecurse{"00C00}{"00C03}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00C3E}{"00C56}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00C62}{"00C63}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00C81}{"00C83}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"00CBC}{lb:cm}
-\dofastrecurse{"00CBE}{"00CD6}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00CE2}{"00CE3}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00D01}{"00D03}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00D3E}{"00D4D}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"00D57}{lb:cm}
-\dofastrecurse{"00D62}{"00D63}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00D82}{"00D83}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00DCA}{"00DDF}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00DF2}{"00DF3}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00F0D}{"00F11}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ex}}
-\dosetXTXcharacterclass{"00F14}{lb:ex}
-\dofastrecurse{"00F18}{"00F19}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"00F35}{lb:cm}
-\dosetXTXcharacterclass{"00F37}{lb:cm}
-\dosetXTXcharacterclass{"00F39}{lb:cm}
-\dosetXTXcharacterclass{"00F3A}{lb:op}
-\dosetXTXcharacterclass{"00F3B}{lb:cl}
-\dosetXTXcharacterclass{"00F3C}{lb:op}
-\dosetXTXcharacterclass{"00F3D}{lb:cl}
-\dofastrecurse{"00F3E}{"00F3F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00F71}{"00F7E}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00F80}{"00F84}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00F86}{"00F87}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"00F8D}{"00FBC}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"00FC6}{lb:cm}
-\dofastrecurse{"0135D}{"0135F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"0169B}{lb:op}
-\dosetXTXcharacterclass{"0169C}{lb:cl}
-\dofastrecurse{"01712}{"01714}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"01732}{"01734}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"01752}{"01753}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"01772}{"01773}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"017D6}{lb:ns}
-\dofastrecurse{"01802}{"01803}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ex}}
-\dofastrecurse{"01808}{"01809}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ex}}
-\dofastrecurse{"0180B}{"0180D}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"018A9}{lb:cm}
-\dofastrecurse{"01920}{"0193B}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"01944}{"01945}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ex}}
-\dofastrecurse{"01A17}{"01A1B}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"01A7F}{lb:cm}
-\dofastrecurse{"01AB0}{"01B04}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"01B34}{"01B44}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"01B6B}{"01B73}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"01B80}{"01B82}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"01BA1}{"01BAD}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"01BE6}{"01BF3}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"01C24}{"01C37}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"01CD0}{"01CD2}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"01CD4}{"01CE8}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"01CED}{lb:cm}
-\dofastrecurse{"01CF2}{"01CF4}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"01CF8}{"01CF9}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"01DC0}{"01DFF}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"0200C}{"0200F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"0201A}{lb:op}
-\dosetXTXcharacterclass{"0201E}{lb:op}
-\dofastrecurse{"0202A}{"0202E}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"0203C}{"0203D}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}}
-\dosetXTXcharacterclass{"02044}{lb:is}
-\dosetXTXcharacterclass{"02045}{lb:op}
-\dosetXTXcharacterclass{"02046}{lb:cl}
-\dofastrecurse{"02047}{"02049}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}}
-\dofastrecurse{"02066}{"0206F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"0207D}{lb:op}
-\dosetXTXcharacterclass{"0207E}{lb:cl}
-\dosetXTXcharacterclass{"0208D}{lb:op}
-\dosetXTXcharacterclass{"0208E}{lb:cl}
-\dofastrecurse{"020D0}{"020F0}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"02308}{lb:op}
-\dosetXTXcharacterclass{"02309}{lb:cl}
-\dosetXTXcharacterclass{"0230A}{lb:op}
-\dosetXTXcharacterclass{"0230B}{lb:cl}
-\dofastrecurse{"0231A}{"0231B}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"02329}{lb:op}
-\dosetXTXcharacterclass{"0232A}{lb:cl}
-\dofastrecurse{"023F0}{"023F3}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"02600}{"02603}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"02614}{"02615}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"02618}{lb:id}
-\dofastrecurse{"0261A}{"0261F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"02639}{"0263B}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"02668}{lb:id}
-\dosetXTXcharacterclass{"0267F}{lb:id}
-\dofastrecurse{"026BD}{"026C8}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"026CD}{lb:id}
-\dofastrecurse{"026CF}{"026D1}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"026D3}{"026D4}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"026D8}{"026D9}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"026DC}{lb:id}
-\dofastrecurse{"026DF}{"026E1}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"026EA}{lb:id}
-\dofastrecurse{"026F1}{"026F5}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"026F7}{"026FA}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"026FD}{"02704}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"02708}{"0270D}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"02762}{"02763}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ex}}
-\dosetXTXcharacterclass{"02768}{lb:op}
-\dosetXTXcharacterclass{"02769}{lb:cl}
-\dosetXTXcharacterclass{"0276A}{lb:op}
-\dosetXTXcharacterclass{"0276B}{lb:cl}
-\dosetXTXcharacterclass{"0276C}{lb:op}
-\dosetXTXcharacterclass{"0276D}{lb:cl}
-\dosetXTXcharacterclass{"0276E}{lb:op}
-\dosetXTXcharacterclass{"0276F}{lb:cl}
-\dosetXTXcharacterclass{"02770}{lb:op}
-\dosetXTXcharacterclass{"02771}{lb:cl}
-\dosetXTXcharacterclass{"02772}{lb:op}
-\dosetXTXcharacterclass{"02773}{lb:cl}
-\dosetXTXcharacterclass{"02774}{lb:op}
-\dosetXTXcharacterclass{"02775}{lb:cl}
-\dosetXTXcharacterclass{"027C5}{lb:op}
-\dosetXTXcharacterclass{"027C6}{lb:cl}
-\dosetXTXcharacterclass{"027E6}{lb:op}
-\dosetXTXcharacterclass{"027E7}{lb:cl}
-\dosetXTXcharacterclass{"027E8}{lb:op}
-\dosetXTXcharacterclass{"027E9}{lb:cl}
-\dosetXTXcharacterclass{"027EA}{lb:op}
-\dosetXTXcharacterclass{"027EB}{lb:cl}
-\dosetXTXcharacterclass{"027EC}{lb:op}
-\dosetXTXcharacterclass{"027ED}{lb:cl}
-\dosetXTXcharacterclass{"027EE}{lb:op}
-\dosetXTXcharacterclass{"027EF}{lb:cl}
-\dosetXTXcharacterclass{"02983}{lb:op}
-\dosetXTXcharacterclass{"02984}{lb:cl}
-\dosetXTXcharacterclass{"02985}{lb:op}
-\dosetXTXcharacterclass{"02986}{lb:cl}
-\dosetXTXcharacterclass{"02987}{lb:op}
-\dosetXTXcharacterclass{"02988}{lb:cl}
-\dosetXTXcharacterclass{"02989}{lb:op}
-\dosetXTXcharacterclass{"0298A}{lb:cl}
-\dosetXTXcharacterclass{"0298B}{lb:op}
-\dosetXTXcharacterclass{"0298C}{lb:cl}
-\dosetXTXcharacterclass{"0298D}{lb:op}
-\dosetXTXcharacterclass{"0298E}{lb:cl}
-\dosetXTXcharacterclass{"0298F}{lb:op}
-\dosetXTXcharacterclass{"02990}{lb:cl}
-\dosetXTXcharacterclass{"02991}{lb:op}
-\dosetXTXcharacterclass{"02992}{lb:cl}
-\dosetXTXcharacterclass{"02993}{lb:op}
-\dosetXTXcharacterclass{"02994}{lb:cl}
-\dosetXTXcharacterclass{"02995}{lb:op}
-\dosetXTXcharacterclass{"02996}{lb:cl}
-\dosetXTXcharacterclass{"02997}{lb:op}
-\dosetXTXcharacterclass{"02998}{lb:cl}
-\dosetXTXcharacterclass{"029D8}{lb:op}
-\dosetXTXcharacterclass{"029D9}{lb:cl}
-\dosetXTXcharacterclass{"029DA}{lb:op}
-\dosetXTXcharacterclass{"029DB}{lb:cl}
-\dosetXTXcharacterclass{"029FC}{lb:op}
-\dosetXTXcharacterclass{"029FD}{lb:cl}
-\dofastrecurse{"02CEF}{"02CF1}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"02CF9}{lb:ex}
-\dosetXTXcharacterclass{"02CFE}{lb:ex}
-\dosetXTXcharacterclass{"02D7F}{lb:cm}
-\dofastrecurse{"02DE0}{"02DFF}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"02E18}{lb:op}
-\dosetXTXcharacterclass{"02E22}{lb:op}
-\dosetXTXcharacterclass{"02E23}{lb:cl}
-\dosetXTXcharacterclass{"02E24}{lb:op}
-\dosetXTXcharacterclass{"02E25}{lb:cl}
-\dosetXTXcharacterclass{"02E26}{lb:op}
-\dosetXTXcharacterclass{"02E27}{lb:cl}
-\dosetXTXcharacterclass{"02E28}{lb:op}
-\dosetXTXcharacterclass{"02E29}{lb:cl}
-\dosetXTXcharacterclass{"02E2E}{lb:ex}
-\dosetXTXcharacterclass{"02E42}{lb:op}
-\dofastrecurse{"02E80}{"02FFB}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"03001}{"03002}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cl}}
-\dofastrecurse{"03003}{"03004}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"03005}{lb:ns}
-\dofastrecurse{"03006}{"03007}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"03008}{lb:op}
-\dosetXTXcharacterclass{"03009}{lb:cl}
-\dosetXTXcharacterclass{"0300A}{lb:op}
-\dosetXTXcharacterclass{"0300B}{lb:cl}
-\dosetXTXcharacterclass{"0300C}{lb:op}
-\dosetXTXcharacterclass{"0300D}{lb:cl}
-\dosetXTXcharacterclass{"0300E}{lb:op}
-\dosetXTXcharacterclass{"0300F}{lb:cl}
-\dosetXTXcharacterclass{"03010}{lb:op}
-\dosetXTXcharacterclass{"03011}{lb:cl}
-\dofastrecurse{"03012}{"03013}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"03014}{lb:op}
-\dosetXTXcharacterclass{"03015}{lb:cl}
-\dosetXTXcharacterclass{"03016}{lb:op}
-\dosetXTXcharacterclass{"03017}{lb:cl}
-\dosetXTXcharacterclass{"03018}{lb:op}
-\dosetXTXcharacterclass{"03019}{lb:cl}
-\dosetXTXcharacterclass{"0301A}{lb:op}
-\dosetXTXcharacterclass{"0301B}{lb:cl}
-\dosetXTXcharacterclass{"0301C}{lb:ns}
-\dosetXTXcharacterclass{"0301D}{lb:op}
-\dofastrecurse{"0301E}{"0301F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cl}}
-\dofastrecurse{"03020}{"03029}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"0302A}{"0302F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"03030}{"03034}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"03035}{lb:cm}
-\dofastrecurse{"03036}{"0303A}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"0303B}{"0303C}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}}
-\dofastrecurse{"0303D}{"0303F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"03042}{lb:id}
-\dosetXTXcharacterclass{"03044}{lb:id}
-\dosetXTXcharacterclass{"03046}{lb:id}
-\dosetXTXcharacterclass{"03048}{lb:id}
-\dofastrecurse{"0304A}{"03062}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"03064}{"03082}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"03084}{lb:id}
-\dosetXTXcharacterclass{"03086}{lb:id}
-\dofastrecurse{"03088}{"0308D}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"0308F}{"03094}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"03099}{"0309A}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"0309B}{"0309E}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}}
-\dosetXTXcharacterclass{"0309F}{lb:id}
-\dosetXTXcharacterclass{"030A0}{lb:ns}
-\dosetXTXcharacterclass{"030A2}{lb:id}
-\dosetXTXcharacterclass{"030A4}{lb:id}
-\dosetXTXcharacterclass{"030A6}{lb:id}
-\dosetXTXcharacterclass{"030A8}{lb:id}
-\dofastrecurse{"030AA}{"030C2}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"030C4}{"030E2}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"030E4}{lb:id}
-\dosetXTXcharacterclass{"030E6}{lb:id}
-\dofastrecurse{"030E8}{"030ED}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"030EF}{"030F4}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"030F7}{"030FA}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"030FB}{lb:ns}
-\dofastrecurse{"030FD}{"030FE}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}}
-\dofastrecurse{"030FF}{"031E3}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"03200}{"03247}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"03250}{"033FF}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"0A000}{"0A014}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"0A015}{lb:ns}
-\dofastrecurse{"0A016}{"0A4C6}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"0A60E}{lb:ex}
-\dofastrecurse{"0A66F}{"0A672}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"0A674}{"0A67D}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"0A69E}{"0A69F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"0A6F0}{"0A6F1}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"0A802}{lb:cm}
-\dosetXTXcharacterclass{"0A806}{lb:cm}
-\dosetXTXcharacterclass{"0A80B}{lb:cm}
-\dofastrecurse{"0A823}{"0A827}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"0A876}{"0A877}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ex}}
-\dofastrecurse{"0A880}{"0A881}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"0A8B4}{"0A8C4}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"0A8E0}{"0A8F1}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"0A926}{"0A92D}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"0A947}{"0A953}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"0A980}{"0A983}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"0A9B3}{"0A9C0}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"0AA29}{"0AA36}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"0AA43}{lb:cm}
-\dofastrecurse{"0AA4C}{"0AA4D}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"0AAEB}{"0AAEF}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"0AAF5}{"0AAF6}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"0ABE3}{"0ABEA}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"0ABEC}{"0ABED}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"0F900}{"0FAD9}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"0FB1E}{lb:cm}
-\dosetXTXcharacterclass{"0FD3E}{lb:cl}
-\dosetXTXcharacterclass{"0FD3F}{lb:op}
-\dofastrecurse{"0FE00}{"0FE0F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"0FE10}{lb:is}
-\dofastrecurse{"0FE11}{"0FE12}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cl}}
-\dofastrecurse{"0FE13}{"0FE14}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:is}}
-\dofastrecurse{"0FE15}{"0FE16}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ex}}
-\dosetXTXcharacterclass{"0FE17}{lb:op}
-\dosetXTXcharacterclass{"0FE18}{lb:cl}
-\dofastrecurse{"0FE20}{"0FE2F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"0FE30}{"0FE34}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"0FE35}{lb:op}
-\dosetXTXcharacterclass{"0FE36}{lb:cl}
-\dosetXTXcharacterclass{"0FE37}{lb:op}
-\dosetXTXcharacterclass{"0FE38}{lb:cl}
-\dosetXTXcharacterclass{"0FE39}{lb:op}
-\dosetXTXcharacterclass{"0FE3A}{lb:cl}
-\dosetXTXcharacterclass{"0FE3B}{lb:op}
-\dosetXTXcharacterclass{"0FE3C}{lb:cl}
-\dosetXTXcharacterclass{"0FE3D}{lb:op}
-\dosetXTXcharacterclass{"0FE3E}{lb:cl}
-\dosetXTXcharacterclass{"0FE3F}{lb:op}
-\dosetXTXcharacterclass{"0FE40}{lb:cl}
-\dosetXTXcharacterclass{"0FE41}{lb:op}
-\dosetXTXcharacterclass{"0FE42}{lb:cl}
-\dosetXTXcharacterclass{"0FE43}{lb:op}
-\dosetXTXcharacterclass{"0FE44}{lb:cl}
-\dofastrecurse{"0FE45}{"0FE46}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"0FE47}{lb:op}
-\dosetXTXcharacterclass{"0FE48}{lb:cl}
-\dofastrecurse{"0FE49}{"0FE4F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"0FE50}{lb:cl}
-\dosetXTXcharacterclass{"0FE51}{lb:id}
-\dosetXTXcharacterclass{"0FE52}{lb:cl}
-\dofastrecurse{"0FE54}{"0FE55}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}}
-\dofastrecurse{"0FE56}{"0FE57}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ex}}
-\dosetXTXcharacterclass{"0FE58}{lb:id}
-\dosetXTXcharacterclass{"0FE59}{lb:op}
-\dosetXTXcharacterclass{"0FE5A}{lb:cl}
-\dosetXTXcharacterclass{"0FE5B}{lb:op}
-\dosetXTXcharacterclass{"0FE5C}{lb:cl}
-\dosetXTXcharacterclass{"0FE5D}{lb:op}
-\dosetXTXcharacterclass{"0FE5E}{lb:cl}
-\dofastrecurse{"0FE5F}{"0FE68}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"0FE6B}{lb:id}
-\dosetXTXcharacterclass{"0FF01}{lb:ex}
-\dofastrecurse{"0FF02}{"0FF03}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"0FF06}{"0FF07}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"0FF08}{lb:op}
-\dosetXTXcharacterclass{"0FF09}{lb:cl}
-\dofastrecurse{"0FF0A}{"0FF0B}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"0FF0C}{lb:cl}
-\dosetXTXcharacterclass{"0FF0D}{lb:id}
-\dosetXTXcharacterclass{"0FF0E}{lb:cl}
-\dofastrecurse{"0FF0F}{"0FF19}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"0FF1A}{"0FF1B}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}}
-\dofastrecurse{"0FF1C}{"0FF1E}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"0FF1F}{lb:ex}
-\dofastrecurse{"0FF20}{"0FF3A}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"0FF3B}{lb:op}
-\dosetXTXcharacterclass{"0FF3C}{lb:id}
-\dosetXTXcharacterclass{"0FF3D}{lb:cl}
-\dofastrecurse{"0FF3E}{"0FF5A}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"0FF5B}{lb:op}
-\dosetXTXcharacterclass{"0FF5C}{lb:id}
-\dosetXTXcharacterclass{"0FF5D}{lb:cl}
-\dosetXTXcharacterclass{"0FF5E}{lb:id}
-\dosetXTXcharacterclass{"0FF5F}{lb:op}
-\dofastrecurse{"0FF60}{"0FF61}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cl}}
-\dosetXTXcharacterclass{"0FF62}{lb:op}
-\dofastrecurse{"0FF63}{"0FF64}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cl}}
-\dosetXTXcharacterclass{"0FF65}{lb:ns}
-\dofastrecurse{"0FF9E}{"0FF9F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}}
-\dofastrecurse{"0FFE2}{"0FFE4}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"0FFF9}{"0FFFB}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"101FD}{lb:cm}
-\dosetXTXcharacterclass{"102E0}{lb:cm}
-\dofastrecurse{"10376}{"1037A}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"10A01}{"10A0F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"10A38}{"10A3F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"10AE5}{"10AE6}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"11000}{"11002}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"11038}{"11046}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"1107F}{"11082}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"110B0}{"110BA}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"11100}{"11102}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"11127}{"11134}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"11173}{lb:cm}
-\dofastrecurse{"11180}{"11182}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"111B3}{"111C0}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"111CA}{"111CC}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"1122C}{"11237}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"112DF}{"112EA}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"11300}{"11303}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"1133C}{lb:cm}
-\dofastrecurse{"1133E}{"1134D}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"11357}{lb:cm}
-\dofastrecurse{"11362}{"11374}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"114B0}{"114C3}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"115AF}{"115C0}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"115C4}{"115C5}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ex}}
-\dofastrecurse{"115DC}{"115DD}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"11630}{"11640}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"116AB}{"116B7}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"13258}{"1325A}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:op}}
-\dofastrecurse{"1325B}{"1325D}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cl}}
-\dosetXTXcharacterclass{"13282}{lb:cl}
-\dosetXTXcharacterclass{"13286}{lb:op}
-\dosetXTXcharacterclass{"13287}{lb:cl}
-\dosetXTXcharacterclass{"13288}{lb:op}
-\dosetXTXcharacterclass{"13289}{lb:cl}
-\dosetXTXcharacterclass{"13379}{lb:op}
-\dofastrecurse{"1337A}{"1337B}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cl}}
-\dosetXTXcharacterclass{"145CE}{lb:op}
-\dosetXTXcharacterclass{"145CF}{lb:cl}
-\dofastrecurse{"16AF0}{"16AF4}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"16B30}{"16B36}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"16F51}{"16F92}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"1B000}{"1B001}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"1BC9D}{"1BC9E}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"1BCA0}{"1BCA3}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"1D165}{"1D169}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"1D16D}{"1D182}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"1D185}{"1D18B}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"1D1AA}{"1D1AD}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"1D242}{"1D244}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"1DA00}{"1DA36}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"1DA3B}{"1DA6C}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dosetXTXcharacterclass{"1DA75}{lb:cm}
-\dosetXTXcharacterclass{"1DA84}{lb:cm}
-\dofastrecurse{"1DA9B}{"1DAAF}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"1E8D0}{"1E8D6}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-\dofastrecurse{"1F000}{"1F0F5}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"1F200}{"1F39B}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"1F39E}{"1F3B4}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"1F3B7}{"1F3BB}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"1F3BD}{"1F3FA}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"1F400}{"1F49F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"1F4A1}{lb:id}
-\dosetXTXcharacterclass{"1F4A3}{lb:id}
-\dofastrecurse{"1F4A5}{"1F4AE}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dosetXTXcharacterclass{"1F4B0}{lb:id}
-\dofastrecurse{"1F4B3}{"1F4FF}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"1F507}{"1F516}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"1F525}{"1F531}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"1F54A}{"1F5D3}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"1F5DC}{"1F5F3}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"1F5FA}{"1F64F}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"1F679}{"1F67B}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:ns}}
-\dofastrecurse{"1F680}{"1F6F3}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"1F910}{"2FA1D}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:id}}
-\dofastrecurse{"E0001}{"E01EF}{1}{\dosetXTXcharacterclass\fastrecursecounter{lb:cm}}
-
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/xetx-ini.mkii b/Master/texmf-dist/tex/context/base/mkii/xetx-ini.mkii
deleted file mode 100644
index 55155fa1af2..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xetx-ini.mkii
+++ /dev/null
@@ -1,132 +0,0 @@
-%D \module
-%D [ file=xetx-ini,
-%D version=2004.09.11,
-%D title=\CONTEXT\ System Macros,
-%D subtitle=\XETEX\ Initializations,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 We moved some code around and now have reorganized the xetex
-%D code in the \type {xetx} module namespace.
-
-\unprotect
-
-%D Some defaults.
-
-\ifdefined\XeTeXuseglyphmetrics
- \XeTeXuseglyphmetrics\plusone
-\fi
-
-%D Character classes.
-
-\newcount\nofXTXcharinjections
-
-\def\defineXTXcharinjectionclass[#1]%
- {\global\advance\nofXTXcharinjections\plusone
- \setxvalue{@xtx@cc@#1}{\number\nofXTXcharinjections}}
-
-\setxvalue{@xtx@cc@\s!default}{0}
-
-\def\getXTXcharinjectionclass#1%
- {\csname @xtx@cc@\ifcsname @xtx@cc@#1\endcsname#1\else\s!default\fi\endcsname}
-
-\let\currentXTXcharinjection\s!default
-
-\def\startXTXcharinjecxtions[#1]%
- {\pushmacro\currentXTXcharinjection
- \def\currentXTXcharinjection{#1}}
-
-\def\stopXTXcharinjections
- {\popmacro\currentXTXcharinjection}
-
-\def\defineXTXcharinjection #1 #2 %
- {\doifnumberelse{#1}{\edef\XTXclassone{\number#1}}{\edef\XTXclassone{\getXTXcharinjectionclas{#1}}}%
- \doifnumberelse{#2}{\edef\XTXclasstwo{\number#2}}{\edef\XTXclasstwo{\getXTXcharinjectionclas{#2}}}%
- \expanded{\dodefineXTXcharinjection{\XTXclassone}{\XTXclasstwo}}}
-
-\def\setXTXcharcodes #1 #2 #3 % encoding syntax
- {\catcode#1=11 \lccode #1=#2 \uccode #1=#3 }
-
-\def\dosetXTXcharcodes#1#2#3% compact syntax
- {\catcode#1=11 \lccode #1=#2 \uccode #1=#3 }
-
-\ifdefined\XeTeXinterchartoks
-
- \long\def\dodefineXTXcharinjection#1#2#3%
- {\XeTeXinterchartoks #1 #2 {\XTXcharinjection{#1}{#2}}%
- \setvalue{@xtx@ch@\currentXTXcharinjection @#1@#2@}{#3}}
-
- \def\setXTXcharacterclass #1 #2 %
- {\doifnumberelse{#2}
- {\XeTeXcharclass#1=#2\relax}
- {\XeTeXcharclass#1=\getXTXcharinjectionclass{#2}\relax}}
-
- \def\dosetXTXcharacterclass#1% #2 fast one
- {\XeTeXcharclass#1=\getXTXcharinjectionclass}
-
-\else
-
- \long\def\dodefineXTXcharinjection#1#2#3%
- {\setvalue{@xtx@ch@\currentXTXcharinjection @#1@#2@}{#3}}
-
- \def\setXTXcharacterclass #1 #2 %
- {}
-
-\fi
-
-\chardef\XTXcharinjectionsmode=1
-
-\letvalue{@xtx@ch@\s!empty}\empty
-
-\def\XTXcharinjection#1#2%
- {\csname @xtx@ch@%
- \ifcase\XTXcharinjectionsmode
- \s!empty
- \or
- \ifcsname @xtx@ch@\currentXTXcharinjection @#1@#2@\endcsname \currentXTXcharinjection @#1@#2@\fi
- \or
- \ifcsname @xtx@ch@\currentXTXcharinjection @#1@#2@\endcsname \currentXTXcharinjection @#1@#2@\else
- \ifcsname @xtx@ch@\s!default @#1@#2@\endcsname \s!default @#1@#2@\else
- \s!empty
- \fi\fi
- \else
- \s!empty
- \fi
- \endcsname}
-
-\def\enableXTXcharinjections[#1]%
- {\def\currentXTXcharinjection{#1}}
-
-\protect \endinput
-
-\starttext
-
-\startXTXcharinjecxtions[default]
- \defineXTXcharinjection 10 40 {[default]}
-\stopXTXcharinjections
-
-\startXTXcharinjecxtions[whatever]
- \defineXTXcharinjection 20 40 {[whatever]}
-\stopXTXcharinjections
-
-\chardef\XTXcharinjectionsmode=0
-
-\enableXTXcharinjections[default] A\XTXcharinjection{10}{40}B\XTXcharinjection{20}{40}C
-\enableXTXcharinjections[whatever] A\XTXcharinjection{10}{40}B\XTXcharinjection{20}{40}C
-
-\chardef\XTXcharinjectionsmode=1
-
-\enableXTXcharinjections[default] A\XTXcharinjection{10}{40}B\XTXcharinjection{20}{40}C
-\enableXTXcharinjections[whatever] A\XTXcharinjection{10}{40}B\XTXcharinjection{20}{40}C
-
-\chardef\XTXcharinjectionsmode=2
-
-\enableXTXcharinjections[default] A\XTXcharinjection{10}{40}B\XTXcharinjection{20}{40}C
-\enableXTXcharinjections[whatever] A\XTXcharinjection{10}{40}B\XTXcharinjection{20}{40}C
-
-\stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkii/xetx-utf.mkii b/Master/texmf-dist/tex/context/base/mkii/xetx-utf.mkii
deleted file mode 100644
index a157a2d11e4..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xetx-utf.mkii
+++ /dev/null
@@ -1,2414 +0,0 @@
-% filename : xetx-utf.mkii
-% comment : generated by mtxrun --script chars --xtx
-% author : Hans Hagen, PRAGMA-ADE, Hasselt NL
-% copyright: PRAGMA ADE / ConTeXt Development Team
-% license : see context related readme files
-
-% lc/uc/catcode mappings
-
-\setXTXcharcodes "00041 "00061 "00041 % LATIN CAPITAL LETTER A
-\setXTXcharcodes "00042 "00062 "00042 % LATIN CAPITAL LETTER B
-\setXTXcharcodes "00043 "00063 "00043 % LATIN CAPITAL LETTER C
-\setXTXcharcodes "00044 "00064 "00044 % LATIN CAPITAL LETTER D
-\setXTXcharcodes "00045 "00065 "00045 % LATIN CAPITAL LETTER E
-\setXTXcharcodes "00046 "00066 "00046 % LATIN CAPITAL LETTER F
-\setXTXcharcodes "00047 "00067 "00047 % LATIN CAPITAL LETTER G
-\setXTXcharcodes "00048 "00068 "00048 % LATIN CAPITAL LETTER H
-\setXTXcharcodes "00049 "00069 "00049 % LATIN CAPITAL LETTER I
-\setXTXcharcodes "0004A "0006A "0004A % LATIN CAPITAL LETTER J
-\setXTXcharcodes "0004B "0006B "0004B % LATIN CAPITAL LETTER K
-\setXTXcharcodes "0004C "0006C "0004C % LATIN CAPITAL LETTER L
-\setXTXcharcodes "0004D "0006D "0004D % LATIN CAPITAL LETTER M
-\setXTXcharcodes "0004E "0006E "0004E % LATIN CAPITAL LETTER N
-\setXTXcharcodes "0004F "0006F "0004F % LATIN CAPITAL LETTER O
-\setXTXcharcodes "00050 "00070 "00050 % LATIN CAPITAL LETTER P
-\setXTXcharcodes "00051 "00071 "00051 % LATIN CAPITAL LETTER Q
-\setXTXcharcodes "00052 "00072 "00052 % LATIN CAPITAL LETTER R
-\setXTXcharcodes "00053 "00073 "00053 % LATIN CAPITAL LETTER S
-\setXTXcharcodes "00054 "00074 "00054 % LATIN CAPITAL LETTER T
-\setXTXcharcodes "00055 "00075 "00055 % LATIN CAPITAL LETTER U
-\setXTXcharcodes "00056 "00076 "00056 % LATIN CAPITAL LETTER V
-\setXTXcharcodes "00057 "00077 "00057 % LATIN CAPITAL LETTER W
-\setXTXcharcodes "00058 "00078 "00058 % LATIN CAPITAL LETTER X
-\setXTXcharcodes "00059 "00079 "00059 % LATIN CAPITAL LETTER Y
-\setXTXcharcodes "0005A "0007A "0005A % LATIN CAPITAL LETTER Z
-\setXTXcharcodes "00061 "00061 "00041 % LATIN SMALL LETTER A
-\setXTXcharcodes "00062 "00062 "00042 % LATIN SMALL LETTER B
-\setXTXcharcodes "00063 "00063 "00043 % LATIN SMALL LETTER C
-\setXTXcharcodes "00064 "00064 "00044 % LATIN SMALL LETTER D
-\setXTXcharcodes "00065 "00065 "00045 % LATIN SMALL LETTER E
-\setXTXcharcodes "00066 "00066 "00046 % LATIN SMALL LETTER F
-\setXTXcharcodes "00067 "00067 "00047 % LATIN SMALL LETTER G
-\setXTXcharcodes "00068 "00068 "00048 % LATIN SMALL LETTER H
-\setXTXcharcodes "00069 "00069 "00049 % LATIN SMALL LETTER I
-\setXTXcharcodes "0006A "0006A "0004A % LATIN SMALL LETTER J
-\setXTXcharcodes "0006B "0006B "0004B % LATIN SMALL LETTER K
-\setXTXcharcodes "0006C "0006C "0004C % LATIN SMALL LETTER L
-\setXTXcharcodes "0006D "0006D "0004D % LATIN SMALL LETTER M
-\setXTXcharcodes "0006E "0006E "0004E % LATIN SMALL LETTER N
-\setXTXcharcodes "0006F "0006F "0004F % LATIN SMALL LETTER O
-\setXTXcharcodes "00070 "00070 "00050 % LATIN SMALL LETTER P
-\setXTXcharcodes "00071 "00071 "00051 % LATIN SMALL LETTER Q
-\setXTXcharcodes "00072 "00072 "00052 % LATIN SMALL LETTER R
-\setXTXcharcodes "00073 "00073 "00053 % LATIN SMALL LETTER S
-\setXTXcharcodes "00074 "00074 "00054 % LATIN SMALL LETTER T
-\setXTXcharcodes "00075 "00075 "00055 % LATIN SMALL LETTER U
-\setXTXcharcodes "00076 "00076 "00056 % LATIN SMALL LETTER V
-\setXTXcharcodes "00077 "00077 "00057 % LATIN SMALL LETTER W
-\setXTXcharcodes "00078 "00078 "00058 % LATIN SMALL LETTER X
-\setXTXcharcodes "00079 "00079 "00059 % LATIN SMALL LETTER Y
-\setXTXcharcodes "0007A "0007A "0005A % LATIN SMALL LETTER Z
-\setXTXcharcodes "000AA "000AA "000AA % FEMININE ORDINAL INDICATOR
-\setXTXcharcodes "000B5 "000B5 "0039C % MICRO SIGN
-\setXTXcharcodes "000BA "000BA "000BA % MASCULINE ORDINAL INDICATOR
-\setXTXcharcodes "000C0 "000E0 "000C0 % LATIN CAPITAL LETTER A WITH GRAVE
-\setXTXcharcodes "000C1 "000E1 "000C1 % LATIN CAPITAL LETTER A WITH ACUTE
-\setXTXcharcodes "000C2 "000E2 "000C2 % LATIN CAPITAL LETTER A WITH CIRCUMFLEX
-\setXTXcharcodes "000C3 "000E3 "000C3 % LATIN CAPITAL LETTER A WITH TILDE
-\setXTXcharcodes "000C4 "000E4 "000C4 % LATIN CAPITAL LETTER A WITH DIAERESIS
-\setXTXcharcodes "000C5 "000E5 "000C5 % LATIN CAPITAL LETTER A WITH RING ABOVE
-\setXTXcharcodes "000C6 "000E6 "000C6 % LATIN CAPITAL LETTER AE
-\setXTXcharcodes "000C7 "000E7 "000C7 % LATIN CAPITAL LETTER C WITH CEDILLA
-\setXTXcharcodes "000C8 "000E8 "000C8 % LATIN CAPITAL LETTER E WITH GRAVE
-\setXTXcharcodes "000C9 "000E9 "000C9 % LATIN CAPITAL LETTER E WITH ACUTE
-\setXTXcharcodes "000CA "000EA "000CA % LATIN CAPITAL LETTER E WITH CIRCUMFLEX
-\setXTXcharcodes "000CB "000EB "000CB % LATIN CAPITAL LETTER E WITH DIAERESIS
-\setXTXcharcodes "000CC "000EC "000CC % LATIN CAPITAL LETTER I WITH GRAVE
-\setXTXcharcodes "000CD "000ED "000CD % LATIN CAPITAL LETTER I WITH ACUTE
-\setXTXcharcodes "000CE "000EE "000CE % LATIN CAPITAL LETTER I WITH CIRCUMFLEX
-\setXTXcharcodes "000CF "000EF "000CF % LATIN CAPITAL LETTER I WITH DIAERESIS
-\setXTXcharcodes "000D0 "000F0 "000D0 % LATIN CAPITAL LETTER ETH
-\setXTXcharcodes "000D1 "000F1 "000D1 % LATIN CAPITAL LETTER N WITH TILDE
-\setXTXcharcodes "000D2 "000F2 "000D2 % LATIN CAPITAL LETTER O WITH GRAVE
-\setXTXcharcodes "000D3 "000F3 "000D3 % LATIN CAPITAL LETTER O WITH ACUTE
-\setXTXcharcodes "000D4 "000F4 "000D4 % LATIN CAPITAL LETTER O WITH CIRCUMFLEX
-\setXTXcharcodes "000D5 "000F5 "000D5 % LATIN CAPITAL LETTER O WITH TILDE
-\setXTXcharcodes "000D6 "000F6 "000D6 % LATIN CAPITAL LETTER O WITH DIAERESIS
-\setXTXcharcodes "000D8 "000F8 "000D8 % LATIN CAPITAL LETTER O WITH STROKE
-\setXTXcharcodes "000D9 "000F9 "000D9 % LATIN CAPITAL LETTER U WITH GRAVE
-\setXTXcharcodes "000DA "000FA "000DA % LATIN CAPITAL LETTER U WITH ACUTE
-\setXTXcharcodes "000DB "000FB "000DB % LATIN CAPITAL LETTER U WITH CIRCUMFLEX
-\setXTXcharcodes "000DC "000FC "000DC % LATIN CAPITAL LETTER U WITH DIAERESIS
-\setXTXcharcodes "000DD "000FD "000DD % LATIN CAPITAL LETTER Y WITH ACUTE
-\setXTXcharcodes "000DE "000FE "000DE % LATIN CAPITAL LETTER THORN
-\setXTXcharcodes "000DF "000DF "000DF % LATIN SMALL LETTER SHARP S
-\setXTXcharcodes "000E0 "000E0 "000C0 % LATIN SMALL LETTER A WITH GRAVE
-\setXTXcharcodes "000E1 "000E1 "000C1 % LATIN SMALL LETTER A WITH ACUTE
-\setXTXcharcodes "000E2 "000E2 "000C2 % LATIN SMALL LETTER A WITH CIRCUMFLEX
-\setXTXcharcodes "000E3 "000E3 "000C3 % LATIN SMALL LETTER A WITH TILDE
-\setXTXcharcodes "000E4 "000E4 "000C4 % LATIN SMALL LETTER A WITH DIAERESIS
-\setXTXcharcodes "000E5 "000E5 "000C5 % LATIN SMALL LETTER A WITH RING ABOVE
-\setXTXcharcodes "000E6 "000E6 "000C6 % LATIN SMALL LETTER AE
-\setXTXcharcodes "000E7 "000E7 "000C7 % LATIN SMALL LETTER C WITH CEDILLA
-\setXTXcharcodes "000E8 "000E8 "000C8 % LATIN SMALL LETTER E WITH GRAVE
-\setXTXcharcodes "000E9 "000E9 "000C9 % LATIN SMALL LETTER E WITH ACUTE
-\setXTXcharcodes "000EA "000EA "000CA % LATIN SMALL LETTER E WITH CIRCUMFLEX
-\setXTXcharcodes "000EB "000EB "000CB % LATIN SMALL LETTER E WITH DIAERESIS
-\setXTXcharcodes "000EC "000EC "000CC % LATIN SMALL LETTER I WITH GRAVE
-\setXTXcharcodes "000ED "000ED "000CD % LATIN SMALL LETTER I WITH ACUTE
-\setXTXcharcodes "000EE "000EE "000CE % LATIN SMALL LETTER I WITH CIRCUMFLEX
-\setXTXcharcodes "000EF "000EF "000CF % LATIN SMALL LETTER I WITH DIAERESIS
-\setXTXcharcodes "000F0 "000F0 "000D0 % LATIN SMALL LETTER ETH
-\setXTXcharcodes "000F1 "000F1 "000D1 % LATIN SMALL LETTER N WITH TILDE
-\setXTXcharcodes "000F2 "000F2 "000D2 % LATIN SMALL LETTER O WITH GRAVE
-\setXTXcharcodes "000F3 "000F3 "000D3 % LATIN SMALL LETTER O WITH ACUTE
-\setXTXcharcodes "000F4 "000F4 "000D4 % LATIN SMALL LETTER O WITH CIRCUMFLEX
-\setXTXcharcodes "000F5 "000F5 "000D5 % LATIN SMALL LETTER O WITH TILDE
-\setXTXcharcodes "000F6 "000F6 "000D6 % LATIN SMALL LETTER O WITH DIAERESIS
-\setXTXcharcodes "000F8 "000F8 "000D8 % LATIN SMALL LETTER O WITH STROKE
-\setXTXcharcodes "000F9 "000F9 "000D9 % LATIN SMALL LETTER U WITH GRAVE
-\setXTXcharcodes "000FA "000FA "000DA % LATIN SMALL LETTER U WITH ACUTE
-\setXTXcharcodes "000FB "000FB "000DB % LATIN SMALL LETTER U WITH CIRCUMFLEX
-\setXTXcharcodes "000FC "000FC "000DC % LATIN SMALL LETTER U WITH DIAERESIS
-\setXTXcharcodes "000FD "000FD "000DD % LATIN SMALL LETTER Y WITH ACUTE
-\setXTXcharcodes "000FE "000FE "000DE % LATIN SMALL LETTER THORN
-\setXTXcharcodes "000FF "000FF "00178 % LATIN SMALL LETTER Y WITH DIAERESIS
-\setXTXcharcodes "00100 "00101 "00100 % LATIN CAPITAL LETTER A WITH MACRON
-\setXTXcharcodes "00101 "00101 "00100 % LATIN SMALL LETTER A WITH MACRON
-\setXTXcharcodes "00102 "00103 "00102 % LATIN CAPITAL LETTER A WITH BREVE
-\setXTXcharcodes "00103 "00103 "00102 % LATIN SMALL LETTER A WITH BREVE
-\setXTXcharcodes "00104 "00105 "00104 % LATIN CAPITAL LETTER A WITH OGONEK
-\setXTXcharcodes "00105 "00105 "00104 % LATIN SMALL LETTER A WITH OGONEK
-\setXTXcharcodes "00106 "00107 "00106 % LATIN CAPITAL LETTER C WITH ACUTE
-\setXTXcharcodes "00107 "00107 "00106 % LATIN SMALL LETTER C WITH ACUTE
-\setXTXcharcodes "00108 "00109 "00108 % LATIN CAPITAL LETTER C WITH CIRCUMFLEX
-\setXTXcharcodes "00109 "00109 "00108 % LATIN SMALL LETTER C WITH CIRCUMFLEX
-\setXTXcharcodes "0010A "0010B "0010A % LATIN CAPITAL LETTER C WITH DOT ABOVE
-\setXTXcharcodes "0010B "0010B "0010A % LATIN SMALL LETTER C WITH DOT ABOVE
-\setXTXcharcodes "0010C "0010D "0010C % LATIN CAPITAL LETTER C WITH CARON
-\setXTXcharcodes "0010D "0010D "0010C % LATIN SMALL LETTER C WITH CARON
-\setXTXcharcodes "0010E "0010F "0010E % LATIN CAPITAL LETTER D WITH CARON
-\setXTXcharcodes "0010F "0010F "0010E % LATIN SMALL LETTER D WITH CARON
-\setXTXcharcodes "00110 "00111 "00110 % LATIN CAPITAL LETTER D WITH STROKE
-\setXTXcharcodes "00111 "00111 "00110 % LATIN SMALL LETTER D WITH STROKE
-\setXTXcharcodes "00112 "00113 "00112 % LATIN CAPITAL LETTER E WITH MACRON
-\setXTXcharcodes "00113 "00113 "00112 % LATIN SMALL LETTER E WITH MACRON
-\setXTXcharcodes "00114 "00115 "00114 % LATIN CAPITAL LETTER E WITH BREVE
-\setXTXcharcodes "00115 "00115 "00114 % LATIN SMALL LETTER E WITH BREVE
-\setXTXcharcodes "00116 "00117 "00116 % LATIN CAPITAL LETTER E WITH DOT ABOVE
-\setXTXcharcodes "00117 "00117 "00116 % LATIN SMALL LETTER E WITH DOT ABOVE
-\setXTXcharcodes "00118 "00119 "00118 % LATIN CAPITAL LETTER E WITH OGONEK
-\setXTXcharcodes "00119 "00119 "00118 % LATIN SMALL LETTER E WITH OGONEK
-\setXTXcharcodes "0011A "0011B "0011A % LATIN CAPITAL LETTER E WITH CARON
-\setXTXcharcodes "0011B "0011B "0011A % LATIN SMALL LETTER E WITH CARON
-\setXTXcharcodes "0011C "0011D "0011C % LATIN CAPITAL LETTER G WITH CIRCUMFLEX
-\setXTXcharcodes "0011D "0011D "0011C % LATIN SMALL LETTER G WITH CIRCUMFLEX
-\setXTXcharcodes "0011E "0011F "0011E % LATIN CAPITAL LETTER G WITH BREVE
-\setXTXcharcodes "0011F "0011F "0011E % LATIN SMALL LETTER G WITH BREVE
-\setXTXcharcodes "00120 "00121 "00120 % LATIN CAPITAL LETTER G WITH DOT ABOVE
-\setXTXcharcodes "00121 "00121 "00120 % LATIN SMALL LETTER G WITH DOT ABOVE
-\setXTXcharcodes "00122 "00123 "00122 % LATIN CAPITAL LETTER G WITH CEDILLA
-\setXTXcharcodes "00123 "00123 "00122 % LATIN SMALL LETTER G WITH CEDILLA
-\setXTXcharcodes "00124 "00125 "00124 % LATIN CAPITAL LETTER H WITH CIRCUMFLEX
-\setXTXcharcodes "00125 "00125 "00124 % LATIN SMALL LETTER H WITH CIRCUMFLEX
-\setXTXcharcodes "00126 "00127 "00126 % LATIN CAPITAL LETTER H WITH STROKE
-\setXTXcharcodes "00127 "00127 "00126 % LATIN SMALL LETTER H WITH STROKE
-\setXTXcharcodes "00128 "00129 "00128 % LATIN CAPITAL LETTER I WITH TILDE
-\setXTXcharcodes "00129 "00129 "00128 % LATIN SMALL LETTER I WITH TILDE
-\setXTXcharcodes "0012A "0012B "0012A % LATIN CAPITAL LETTER I WITH MACRON
-\setXTXcharcodes "0012B "0012B "0012A % LATIN SMALL LETTER I WITH MACRON
-\setXTXcharcodes "0012C "0012D "0012C % LATIN CAPITAL LETTER I WITH BREVE
-\setXTXcharcodes "0012D "0012D "0012C % LATIN SMALL LETTER I WITH BREVE
-\setXTXcharcodes "0012E "0012F "0012E % LATIN CAPITAL LETTER I WITH OGONEK
-\setXTXcharcodes "0012F "0012F "0012E % LATIN SMALL LETTER I WITH OGONEK
-\setXTXcharcodes "00130 "00069 "00130 % LATIN CAPITAL LETTER I WITH DOT ABOVE
-\setXTXcharcodes "00131 "00131 "00049 % LATIN SMALL LETTER DOTLESS I
-\setXTXcharcodes "00132 "00133 "00132 % LATIN CAPITAL LIGATURE IJ
-\setXTXcharcodes "00133 "00133 "00132 % LATIN SMALL LIGATURE IJ
-\setXTXcharcodes "00134 "00135 "00134 % LATIN CAPITAL LETTER J WITH CIRCUMFLEX
-\setXTXcharcodes "00135 "00135 "00134 % LATIN SMALL LETTER J WITH CIRCUMFLEX
-\setXTXcharcodes "00136 "00137 "00136 % LATIN CAPITAL LETTER K WITH CEDILLA
-\setXTXcharcodes "00137 "00137 "00136 % LATIN SMALL LETTER K WITH CEDILLA
-\setXTXcharcodes "00138 "00138 "00138 % LATIN SMALL LETTER KRA
-\setXTXcharcodes "00139 "0013A "00139 % LATIN CAPITAL LETTER L WITH ACUTE
-\setXTXcharcodes "0013A "0013A "00139 % LATIN SMALL LETTER L WITH ACUTE
-\setXTXcharcodes "0013B "0013C "0013B % LATIN CAPITAL LETTER L WITH CEDILLA
-\setXTXcharcodes "0013C "0013C "0013B % LATIN SMALL LETTER L WITH CEDILLA
-\setXTXcharcodes "0013D "0013E "0013D % LATIN CAPITAL LETTER L WITH CARON
-\setXTXcharcodes "0013E "0013E "0013D % LATIN SMALL LETTER L WITH CARON
-\setXTXcharcodes "0013F "00140 "0013F % LATIN CAPITAL LETTER L WITH MIDDLE DOT
-\setXTXcharcodes "00140 "00140 "0013F % LATIN SMALL LETTER L WITH MIDDLE DOT
-\setXTXcharcodes "00141 "00142 "00141 % LATIN CAPITAL LETTER L WITH STROKE
-\setXTXcharcodes "00142 "00142 "00141 % LATIN SMALL LETTER L WITH STROKE
-\setXTXcharcodes "00143 "00144 "00143 % LATIN CAPITAL LETTER N WITH ACUTE
-\setXTXcharcodes "00144 "00144 "00143 % LATIN SMALL LETTER N WITH ACUTE
-\setXTXcharcodes "00145 "00146 "00145 % LATIN CAPITAL LETTER N WITH CEDILLA
-\setXTXcharcodes "00146 "00146 "00145 % LATIN SMALL LETTER N WITH CEDILLA
-\setXTXcharcodes "00147 "00148 "00147 % LATIN CAPITAL LETTER N WITH CARON
-\setXTXcharcodes "00148 "00148 "00147 % LATIN SMALL LETTER N WITH CARON
-\setXTXcharcodes "00149 "00149 "00149 % LATIN SMALL LETTER N PRECEDED BY APOSTROPHE
-\setXTXcharcodes "0014A "0014B "0014A % LATIN CAPITAL LETTER ENG
-\setXTXcharcodes "0014B "0014B "0014A % LATIN SMALL LETTER ENG
-\setXTXcharcodes "0014C "0014D "0014C % LATIN CAPITAL LETTER O WITH MACRON
-\setXTXcharcodes "0014D "0014D "0014C % LATIN SMALL LETTER O WITH MACRON
-\setXTXcharcodes "0014E "0014F "0014E % LATIN CAPITAL LETTER O WITH BREVE
-\setXTXcharcodes "0014F "0014F "0014E % LATIN SMALL LETTER O WITH BREVE
-\setXTXcharcodes "00150 "00151 "00150 % LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
-\setXTXcharcodes "00151 "00151 "00150 % LATIN SMALL LETTER O WITH DOUBLE ACUTE
-\setXTXcharcodes "00152 "00153 "00152 % LATIN CAPITAL LIGATURE OE
-\setXTXcharcodes "00153 "00153 "00152 % LATIN SMALL LIGATURE OE
-\setXTXcharcodes "00154 "00155 "00154 % LATIN CAPITAL LETTER R WITH ACUTE
-\setXTXcharcodes "00155 "00155 "00154 % LATIN SMALL LETTER R WITH ACUTE
-\setXTXcharcodes "00156 "00157 "00156 % LATIN CAPITAL LETTER R WITH CEDILLA
-\setXTXcharcodes "00157 "00157 "00156 % LATIN SMALL LETTER R WITH CEDILLA
-\setXTXcharcodes "00158 "00159 "00158 % LATIN CAPITAL LETTER R WITH CARON
-\setXTXcharcodes "00159 "00159 "00158 % LATIN SMALL LETTER R WITH CARON
-\setXTXcharcodes "0015A "0015B "0015A % LATIN CAPITAL LETTER S WITH ACUTE
-\setXTXcharcodes "0015B "0015B "0015A % LATIN SMALL LETTER S WITH ACUTE
-\setXTXcharcodes "0015C "0015D "0015C % LATIN CAPITAL LETTER S WITH CIRCUMFLEX
-\setXTXcharcodes "0015D "0015D "0015C % LATIN SMALL LETTER S WITH CIRCUMFLEX
-\setXTXcharcodes "0015E "0015F "0015E % LATIN CAPITAL LETTER S WITH CEDILLA
-\setXTXcharcodes "0015F "0015F "0015E % LATIN SMALL LETTER S WITH CEDILLA
-\setXTXcharcodes "00160 "00161 "00160 % LATIN CAPITAL LETTER S WITH CARON
-\setXTXcharcodes "00161 "00161 "00160 % LATIN SMALL LETTER S WITH CARON
-\setXTXcharcodes "00162 "00163 "00162 % LATIN CAPITAL LETTER T WITH CEDILLA
-\setXTXcharcodes "00163 "00163 "00162 % LATIN SMALL LETTER T WITH CEDILLA
-\setXTXcharcodes "00164 "00165 "00164 % LATIN CAPITAL LETTER T WITH CARON
-\setXTXcharcodes "00165 "00165 "00164 % LATIN SMALL LETTER T WITH CARON
-\setXTXcharcodes "00166 "00167 "00166 % LATIN CAPITAL LETTER T WITH STROKE
-\setXTXcharcodes "00167 "00167 "00166 % LATIN SMALL LETTER T WITH STROKE
-\setXTXcharcodes "00168 "00169 "00168 % LATIN CAPITAL LETTER U WITH TILDE
-\setXTXcharcodes "00169 "00169 "00168 % LATIN SMALL LETTER U WITH TILDE
-\setXTXcharcodes "0016A "0016B "0016A % LATIN CAPITAL LETTER U WITH MACRON
-\setXTXcharcodes "0016B "0016B "0016A % LATIN SMALL LETTER U WITH MACRON
-\setXTXcharcodes "0016C "0016D "0016C % LATIN CAPITAL LETTER U WITH BREVE
-\setXTXcharcodes "0016D "0016D "0016C % LATIN SMALL LETTER U WITH BREVE
-\setXTXcharcodes "0016E "0016F "0016E % LATIN CAPITAL LETTER U WITH RING ABOVE
-\setXTXcharcodes "0016F "0016F "0016E % LATIN SMALL LETTER U WITH RING ABOVE
-\setXTXcharcodes "00170 "00171 "00170 % LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
-\setXTXcharcodes "00171 "00171 "00170 % LATIN SMALL LETTER U WITH DOUBLE ACUTE
-\setXTXcharcodes "00172 "00173 "00172 % LATIN CAPITAL LETTER U WITH OGONEK
-\setXTXcharcodes "00173 "00173 "00172 % LATIN SMALL LETTER U WITH OGONEK
-\setXTXcharcodes "00174 "00175 "00174 % LATIN CAPITAL LETTER W WITH CIRCUMFLEX
-\setXTXcharcodes "00175 "00175 "00174 % LATIN SMALL LETTER W WITH CIRCUMFLEX
-\setXTXcharcodes "00176 "00177 "00176 % LATIN CAPITAL LETTER Y WITH CIRCUMFLEX
-\setXTXcharcodes "00177 "00177 "00176 % LATIN SMALL LETTER Y WITH CIRCUMFLEX
-\setXTXcharcodes "00178 "000FF "00178 % LATIN CAPITAL LETTER Y WITH DIAERESIS
-\setXTXcharcodes "00179 "0017A "00179 % LATIN CAPITAL LETTER Z WITH ACUTE
-\setXTXcharcodes "0017A "0017A "00179 % LATIN SMALL LETTER Z WITH ACUTE
-\setXTXcharcodes "0017B "0017C "0017B % LATIN CAPITAL LETTER Z WITH DOT ABOVE
-\setXTXcharcodes "0017C "0017C "0017B % LATIN SMALL LETTER Z WITH DOT ABOVE
-\setXTXcharcodes "0017D "0017E "0017D % LATIN CAPITAL LETTER Z WITH CARON
-\setXTXcharcodes "0017E "0017E "0017D % LATIN SMALL LETTER Z WITH CARON
-\setXTXcharcodes "0017F "0017F "00053 % LATIN SMALL LETTER LONG S
-\setXTXcharcodes "00180 "00180 "00243 % LATIN SMALL LETTER B WITH STROKE
-\setXTXcharcodes "00181 "00253 "00181 % LATIN CAPITAL LETTER B WITH HOOK
-\setXTXcharcodes "00182 "00183 "00182 % LATIN CAPITAL LETTER B WITH TOPBAR
-\setXTXcharcodes "00183 "00183 "00182 % LATIN SMALL LETTER B WITH TOPBAR
-\setXTXcharcodes "00184 "00185 "00184 % LATIN CAPITAL LETTER TONE SIX
-\setXTXcharcodes "00185 "00185 "00184 % LATIN SMALL LETTER TONE SIX
-\setXTXcharcodes "00186 "00254 "00186 % LATIN CAPITAL LETTER OPEN O
-\setXTXcharcodes "00187 "00188 "00187 % LATIN CAPITAL LETTER C WITH HOOK
-\setXTXcharcodes "00188 "00188 "00187 % LATIN SMALL LETTER C WITH HOOK
-\setXTXcharcodes "00189 "00256 "00189 % LATIN CAPITAL LETTER AFRICAN D
-\setXTXcharcodes "0018A "00257 "0018A % LATIN CAPITAL LETTER D WITH HOOK
-\setXTXcharcodes "0018B "0018C "0018B % LATIN CAPITAL LETTER D WITH TOPBAR
-\setXTXcharcodes "0018C "0018C "0018B % LATIN SMALL LETTER D WITH TOPBAR
-\setXTXcharcodes "0018D "0018D "0018D % LATIN SMALL LETTER TURNED DELTA
-\setXTXcharcodes "0018E "001DD "0018E % LATIN CAPITAL LETTER REVERSED E
-\setXTXcharcodes "0018F "00259 "0018F % LATIN CAPITAL LETTER SCHWA
-\setXTXcharcodes "00190 "0025B "00190 % LATIN CAPITAL LETTER OPEN E
-\setXTXcharcodes "00191 "00192 "00191 % LATIN CAPITAL LETTER F WITH HOOK
-\setXTXcharcodes "00192 "00192 "00191 % LATIN SMALL LETTER F WITH HOOK
-\setXTXcharcodes "00193 "00260 "00193 % LATIN CAPITAL LETTER G WITH HOOK
-\setXTXcharcodes "00194 "00263 "00194 % LATIN CAPITAL LETTER GAMMA
-\setXTXcharcodes "00195 "00195 "001F6 % LATIN SMALL LETTER HV
-\setXTXcharcodes "00196 "00269 "00196 % LATIN CAPITAL LETTER IOTA
-\setXTXcharcodes "00197 "00268 "00197 % LATIN CAPITAL LETTER I WITH STROKE
-\setXTXcharcodes "00198 "00199 "00198 % LATIN CAPITAL LETTER K WITH HOOK
-\setXTXcharcodes "00199 "00199 "00198 % LATIN SMALL LETTER K WITH HOOK
-\setXTXcharcodes "0019A "0019A "0023D % LATIN SMALL LETTER L WITH BAR
-\setXTXcharcodes "0019B "0019B "0019B % LATIN SMALL LETTER LAMBDA WITH STROKE
-\setXTXcharcodes "0019C "0026F "0019C % LATIN CAPITAL LETTER TURNED M
-\setXTXcharcodes "0019D "00272 "0019D % LATIN CAPITAL LETTER N WITH LEFT HOOK
-\setXTXcharcodes "0019E "0019E "00220 % LATIN SMALL LETTER N WITH LONG RIGHT LEG
-\setXTXcharcodes "0019F "00275 "0019F % LATIN CAPITAL LETTER O WITH MIDDLE TILDE
-\setXTXcharcodes "001A0 "001A1 "001A0 % LATIN CAPITAL LETTER O WITH HORN
-\setXTXcharcodes "001A1 "001A1 "001A0 % LATIN SMALL LETTER O WITH HORN
-\setXTXcharcodes "001A2 "001A3 "001A2 % LATIN CAPITAL LETTER OI
-\setXTXcharcodes "001A3 "001A3 "001A2 % LATIN SMALL LETTER OI
-\setXTXcharcodes "001A4 "001A5 "001A4 % LATIN CAPITAL LETTER P WITH HOOK
-\setXTXcharcodes "001A5 "001A5 "001A4 % LATIN SMALL LETTER P WITH HOOK
-\setXTXcharcodes "001A6 "00280 "001A6 % LATIN LETTER YR
-\setXTXcharcodes "001A7 "001A8 "001A7 % LATIN CAPITAL LETTER TONE TWO
-\setXTXcharcodes "001A8 "001A8 "001A7 % LATIN SMALL LETTER TONE TWO
-\setXTXcharcodes "001A9 "00283 "001A9 % LATIN CAPITAL LETTER ESH
-\setXTXcharcodes "001AA "001AA "001AA % LATIN LETTER REVERSED ESH LOOP
-\setXTXcharcodes "001AB "001AB "001AB % LATIN SMALL LETTER T WITH PALATAL HOOK
-\setXTXcharcodes "001AC "001AD "001AC % LATIN CAPITAL LETTER T WITH HOOK
-\setXTXcharcodes "001AD "001AD "001AC % LATIN SMALL LETTER T WITH HOOK
-\setXTXcharcodes "001AE "00288 "001AE % LATIN CAPITAL LETTER T WITH RETROFLEX HOOK
-\setXTXcharcodes "001AF "001B0 "001AF % LATIN CAPITAL LETTER U WITH HORN
-\setXTXcharcodes "001B0 "001B0 "001AF % LATIN SMALL LETTER U WITH HORN
-\setXTXcharcodes "001B1 "0028A "001B1 % LATIN CAPITAL LETTER UPSILON
-\setXTXcharcodes "001B2 "0028B "001B2 % LATIN CAPITAL LETTER V WITH HOOK
-\setXTXcharcodes "001B3 "001B4 "001B3 % LATIN CAPITAL LETTER Y WITH HOOK
-\setXTXcharcodes "001B4 "001B4 "001B3 % LATIN SMALL LETTER Y WITH HOOK
-\setXTXcharcodes "001B5 "001B6 "001B5 % LATIN CAPITAL LETTER Z WITH STROKE
-\setXTXcharcodes "001B6 "001B6 "001B5 % LATIN SMALL LETTER Z WITH STROKE
-\setXTXcharcodes "001B7 "00292 "001B7 % LATIN CAPITAL LETTER EZH
-\setXTXcharcodes "001B8 "001B9 "001B8 % LATIN CAPITAL LETTER EZH REVERSED
-\setXTXcharcodes "001B9 "001B9 "001B8 % LATIN SMALL LETTER EZH REVERSED
-\setXTXcharcodes "001BA "001BA "001BA % LATIN SMALL LETTER EZH WITH TAIL
-\setXTXcharcodes "001BC "001BD "001BC % LATIN CAPITAL LETTER TONE FIVE
-\setXTXcharcodes "001BD "001BD "001BC % LATIN SMALL LETTER TONE FIVE
-\setXTXcharcodes "001BE "001BE "001BE % LATIN LETTER INVERTED GLOTTAL STOP WITH STROKE
-\setXTXcharcodes "001BF "001BF "001F7 % LATIN LETTER WYNN
-\setXTXcharcodes "001C4 "001C6 "001C5 % LATIN CAPITAL LETTER DZ WITH CARON
-\setXTXcharcodes "001C5 "001C6 "001C4 % LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON
-\setXTXcharcodes "001C6 "001C6 "001C4 % LATIN SMALL LETTER DZ WITH CARON
-\setXTXcharcodes "001C7 "001C9 "001C8 % LATIN CAPITAL LETTER LJ
-\setXTXcharcodes "001C8 "001C9 "001C7 % LATIN CAPITAL LETTER L WITH SMALL LETTER J
-\setXTXcharcodes "001C9 "001C9 "001C7 % LATIN SMALL LETTER LJ
-\setXTXcharcodes "001CA "001CC "001CB % LATIN CAPITAL LETTER NJ
-\setXTXcharcodes "001CB "001CC "001CA % LATIN CAPITAL LETTER N WITH SMALL LETTER J
-\setXTXcharcodes "001CC "001CC "001CA % LATIN SMALL LETTER NJ
-\setXTXcharcodes "001CD "001CE "001CD % LATIN CAPITAL LETTER A WITH CARON
-\setXTXcharcodes "001CE "001CE "001CD % LATIN SMALL LETTER A WITH CARON
-\setXTXcharcodes "001CF "001D0 "001CF % LATIN CAPITAL LETTER I WITH CARON
-\setXTXcharcodes "001D0 "001D0 "001CF % LATIN SMALL LETTER I WITH CARON
-\setXTXcharcodes "001D1 "001D2 "001D1 % LATIN CAPITAL LETTER O WITH CARON
-\setXTXcharcodes "001D2 "001D2 "001D1 % LATIN SMALL LETTER O WITH CARON
-\setXTXcharcodes "001D3 "001D4 "001D3 % LATIN CAPITAL LETTER U WITH CARON
-\setXTXcharcodes "001D4 "001D4 "001D3 % LATIN SMALL LETTER U WITH CARON
-\setXTXcharcodes "001D5 "001D6 "001D5 % LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON
-\setXTXcharcodes "001D6 "001D6 "001D5 % LATIN SMALL LETTER U WITH DIAERESIS AND MACRON
-\setXTXcharcodes "001D7 "001D8 "001D7 % LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
-\setXTXcharcodes "001D8 "001D8 "001D7 % LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
-\setXTXcharcodes "001D9 "001DA "001D9 % LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON
-\setXTXcharcodes "001DA "001DA "001D9 % LATIN SMALL LETTER U WITH DIAERESIS AND CARON
-\setXTXcharcodes "001DB "001DC "001DB % LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE
-\setXTXcharcodes "001DC "001DC "001DB % LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE
-\setXTXcharcodes "001DD "001DD "0018E % LATIN SMALL LETTER TURNED E
-\setXTXcharcodes "001DE "001DF "001DE % LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON
-\setXTXcharcodes "001DF "001DF "001DE % LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
-\setXTXcharcodes "001E0 "001E1 "001E0 % LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON
-\setXTXcharcodes "001E1 "001E1 "001E0 % LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
-\setXTXcharcodes "001E2 "001E3 "001E2 % LATIN CAPITAL LETTER AE WITH MACRON
-\setXTXcharcodes "001E3 "001E3 "001E2 % LATIN SMALL LETTER AE WITH MACRON
-\setXTXcharcodes "001E4 "001E5 "001E4 % LATIN CAPITAL LETTER G WITH STROKE
-\setXTXcharcodes "001E5 "001E5 "001E4 % LATIN SMALL LETTER G WITH STROKE
-\setXTXcharcodes "001E6 "001E7 "001E6 % LATIN CAPITAL LETTER G WITH CARON
-\setXTXcharcodes "001E7 "001E7 "001E6 % LATIN SMALL LETTER G WITH CARON
-\setXTXcharcodes "001E8 "001E9 "001E8 % LATIN CAPITAL LETTER K WITH CARON
-\setXTXcharcodes "001E9 "001E9 "001E8 % LATIN SMALL LETTER K WITH CARON
-\setXTXcharcodes "001EA "001EB "001EA % LATIN CAPITAL LETTER O WITH OGONEK
-\setXTXcharcodes "001EB "001EB "001EA % LATIN SMALL LETTER O WITH OGONEK
-\setXTXcharcodes "001EC "001ED "001EC % LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
-\setXTXcharcodes "001ED "001ED "001EC % LATIN SMALL LETTER O WITH OGONEK AND MACRON
-\setXTXcharcodes "001EE "001EF "001EE % LATIN CAPITAL LETTER EZH WITH CARON
-\setXTXcharcodes "001EF "001EF "001EE % LATIN SMALL LETTER EZH WITH CARON
-\setXTXcharcodes "001F0 "001F0 "001F0 % LATIN SMALL LETTER J WITH CARON
-\setXTXcharcodes "001F1 "001F3 "001F2 % LATIN CAPITAL LETTER DZ
-\setXTXcharcodes "001F2 "001F3 "001F1 % LATIN CAPITAL LETTER D WITH SMALL LETTER Z
-\setXTXcharcodes "001F3 "001F3 "001F1 % LATIN SMALL LETTER DZ
-\setXTXcharcodes "001F4 "001F5 "001F4 % LATIN CAPITAL LETTER G WITH ACUTE
-\setXTXcharcodes "001F5 "001F5 "001F4 % LATIN SMALL LETTER G WITH ACUTE
-\setXTXcharcodes "001F6 "00195 "001F6 % LATIN CAPITAL LETTER HWAIR
-\setXTXcharcodes "001F7 "001BF "001F7 % LATIN CAPITAL LETTER WYNN
-\setXTXcharcodes "001F8 "001F9 "001F8 % LATIN CAPITAL LETTER N WITH GRAVE
-\setXTXcharcodes "001F9 "001F9 "001F8 % LATIN SMALL LETTER N WITH GRAVE
-\setXTXcharcodes "001FA "001FB "001FA % LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
-\setXTXcharcodes "001FB "001FB "001FA % LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
-\setXTXcharcodes "001FC "001FD "001FC % LATIN CAPITAL LETTER AE WITH ACUTE
-\setXTXcharcodes "001FD "001FD "001FC % LATIN SMALL LETTER AE WITH ACUTE
-\setXTXcharcodes "001FE "001FF "001FE % LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
-\setXTXcharcodes "001FF "001FF "001FE % LATIN SMALL LETTER O WITH STROKE AND ACUTE
-\setXTXcharcodes "00200 "00201 "00200 % LATIN CAPITAL LETTER A WITH DOUBLE GRAVE
-\setXTXcharcodes "00201 "00201 "00200 % LATIN SMALL LETTER A WITH DOUBLE GRAVE
-\setXTXcharcodes "00202 "00203 "00202 % LATIN CAPITAL LETTER A WITH INVERTED BREVE
-\setXTXcharcodes "00203 "00203 "00202 % LATIN SMALL LETTER A WITH INVERTED BREVE
-\setXTXcharcodes "00204 "00205 "00204 % LATIN CAPITAL LETTER E WITH DOUBLE GRAVE
-\setXTXcharcodes "00205 "00205 "00204 % LATIN SMALL LETTER E WITH DOUBLE GRAVE
-\setXTXcharcodes "00206 "00207 "00206 % LATIN CAPITAL LETTER E WITH INVERTED BREVE
-\setXTXcharcodes "00207 "00207 "00206 % LATIN SMALL LETTER E WITH INVERTED BREVE
-\setXTXcharcodes "00208 "00209 "00208 % LATIN CAPITAL LETTER I WITH DOUBLE GRAVE
-\setXTXcharcodes "00209 "00209 "00208 % LATIN SMALL LETTER I WITH DOUBLE GRAVE
-\setXTXcharcodes "0020A "0020B "0020A % LATIN CAPITAL LETTER I WITH INVERTED BREVE
-\setXTXcharcodes "0020B "0020B "0020A % LATIN SMALL LETTER I WITH INVERTED BREVE
-\setXTXcharcodes "0020C "0020D "0020C % LATIN CAPITAL LETTER O WITH DOUBLE GRAVE
-\setXTXcharcodes "0020D "0020D "0020C % LATIN SMALL LETTER O WITH DOUBLE GRAVE
-\setXTXcharcodes "0020E "0020F "0020E % LATIN CAPITAL LETTER O WITH INVERTED BREVE
-\setXTXcharcodes "0020F "0020F "0020E % LATIN SMALL LETTER O WITH INVERTED BREVE
-\setXTXcharcodes "00210 "00211 "00210 % LATIN CAPITAL LETTER R WITH DOUBLE GRAVE
-\setXTXcharcodes "00211 "00211 "00210 % LATIN SMALL LETTER R WITH DOUBLE GRAVE
-\setXTXcharcodes "00212 "00213 "00212 % LATIN CAPITAL LETTER R WITH INVERTED BREVE
-\setXTXcharcodes "00213 "00213 "00212 % LATIN SMALL LETTER R WITH INVERTED BREVE
-\setXTXcharcodes "00214 "00215 "00214 % LATIN CAPITAL LETTER U WITH DOUBLE GRAVE
-\setXTXcharcodes "00215 "00215 "00214 % LATIN SMALL LETTER U WITH DOUBLE GRAVE
-\setXTXcharcodes "00216 "00217 "00216 % LATIN CAPITAL LETTER U WITH INVERTED BREVE
-\setXTXcharcodes "00217 "00217 "00216 % LATIN SMALL LETTER U WITH INVERTED BREVE
-\setXTXcharcodes "00218 "00219 "00218 % LATIN CAPITAL LETTER S WITH COMMA BELOW
-\setXTXcharcodes "00219 "00219 "00218 % LATIN SMALL LETTER S WITH COMMA BELOW
-\setXTXcharcodes "0021A "0021B "0021A % LATIN CAPITAL LETTER T WITH COMMA BELOW
-\setXTXcharcodes "0021B "0021B "0021A % LATIN SMALL LETTER T WITH COMMA BELOW
-\setXTXcharcodes "0021C "0021D "0021C % LATIN CAPITAL LETTER YOGH
-\setXTXcharcodes "0021D "0021D "0021C % LATIN SMALL LETTER YOGH
-\setXTXcharcodes "0021E "0021F "0021E % LATIN CAPITAL LETTER H WITH CARON
-\setXTXcharcodes "0021F "0021F "0021E % LATIN SMALL LETTER H WITH CARON
-\setXTXcharcodes "00220 "0019E "00220 % LATIN CAPITAL LETTER N WITH LONG RIGHT LEG
-\setXTXcharcodes "00221 "00221 "00221 % LATIN SMALL LETTER D WITH CURL
-\setXTXcharcodes "00222 "00223 "00222 % LATIN CAPITAL LETTER OU
-\setXTXcharcodes "00223 "00223 "00222 % LATIN SMALL LETTER OU
-\setXTXcharcodes "00224 "00225 "00224 % LATIN CAPITAL LETTER Z WITH HOOK
-\setXTXcharcodes "00225 "00225 "00224 % LATIN SMALL LETTER Z WITH HOOK
-\setXTXcharcodes "00226 "00227 "00226 % LATIN CAPITAL LETTER A WITH DOT ABOVE
-\setXTXcharcodes "00227 "00227 "00226 % LATIN SMALL LETTER A WITH DOT ABOVE
-\setXTXcharcodes "00228 "00229 "00228 % LATIN CAPITAL LETTER E WITH CEDILLA
-\setXTXcharcodes "00229 "00229 "00228 % LATIN SMALL LETTER E WITH CEDILLA
-\setXTXcharcodes "0022A "0022B "0022A % LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON
-\setXTXcharcodes "0022B "0022B "0022A % LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
-\setXTXcharcodes "0022C "0022D "0022C % LATIN CAPITAL LETTER O WITH TILDE AND MACRON
-\setXTXcharcodes "0022D "0022D "0022C % LATIN SMALL LETTER O WITH TILDE AND MACRON
-\setXTXcharcodes "0022E "0022F "0022E % LATIN CAPITAL LETTER O WITH DOT ABOVE
-\setXTXcharcodes "0022F "0022F "0022E % LATIN SMALL LETTER O WITH DOT ABOVE
-\setXTXcharcodes "00230 "00231 "00230 % LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON
-\setXTXcharcodes "00231 "00231 "00230 % LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
-\setXTXcharcodes "00232 "00233 "00232 % LATIN CAPITAL LETTER Y WITH MACRON
-\setXTXcharcodes "00233 "00233 "00232 % LATIN SMALL LETTER Y WITH MACRON
-\setXTXcharcodes "00234 "00234 "00234 % LATIN SMALL LETTER L WITH CURL
-\setXTXcharcodes "00235 "00235 "00235 % LATIN SMALL LETTER N WITH CURL
-\setXTXcharcodes "00236 "00236 "00236 % LATIN SMALL LETTER T WITH CURL
-\setXTXcharcodes "00237 "00237 "00237 % LATIN SMALL LETTER DOTLESS J
-\setXTXcharcodes "00238 "00238 "00238 % LATIN SMALL LETTER DB DIGRAPH
-\setXTXcharcodes "00239 "00239 "00239 % LATIN SMALL LETTER QP DIGRAPH
-\setXTXcharcodes "0023A "02C65 "0023A % LATIN CAPITAL LETTER A WITH STROKE
-\setXTXcharcodes "0023B "0023C "0023B % LATIN CAPITAL LETTER C WITH STROKE
-\setXTXcharcodes "0023C "0023C "0023B % LATIN SMALL LETTER C WITH STROKE
-\setXTXcharcodes "0023D "0019A "0023D % LATIN CAPITAL LETTER L WITH BAR
-\setXTXcharcodes "0023E "02C66 "0023E % LATIN CAPITAL LETTER T WITH DIAGONAL STROKE
-\setXTXcharcodes "0023F "0023F "0023F % LATIN SMALL LETTER S WITH SWASH TAIL
-\setXTXcharcodes "00240 "00240 "00240 % LATIN SMALL LETTER Z WITH SWASH TAIL
-\setXTXcharcodes "00241 "00242 "00241 % LATIN CAPITAL LETTER GLOTTAL STOP
-\setXTXcharcodes "00242 "00242 "00241 % LATIN SMALL LETTER GLOTTAL STOP
-\setXTXcharcodes "00243 "00180 "00243 % LATIN CAPITAL LETTER B WITH STROKE
-\setXTXcharcodes "00244 "00289 "00244 % LATIN CAPITAL LETTER U BAR
-\setXTXcharcodes "00245 "0028C "00245 % LATIN CAPITAL LETTER TURNED V
-\setXTXcharcodes "00246 "00247 "00246 % LATIN CAPITAL LETTER E WITH STROKE
-\setXTXcharcodes "00247 "00247 "00246 % LATIN SMALL LETTER E WITH STROKE
-\setXTXcharcodes "00248 "00249 "00248 % LATIN CAPITAL LETTER J WITH STROKE
-\setXTXcharcodes "00249 "00249 "00248 % LATIN SMALL LETTER J WITH STROKE
-\setXTXcharcodes "0024A "0024B "0024A % LATIN CAPITAL LETTER SMALL Q WITH HOOK TAIL
-\setXTXcharcodes "0024B "0024B "0024A % LATIN SMALL LETTER Q WITH HOOK TAIL
-\setXTXcharcodes "0024C "0024D "0024C % LATIN CAPITAL LETTER R WITH STROKE
-\setXTXcharcodes "0024D "0024D "0024C % LATIN SMALL LETTER R WITH STROKE
-\setXTXcharcodes "0024E "0024F "0024E % LATIN CAPITAL LETTER Y WITH STROKE
-\setXTXcharcodes "0024F "0024F "0024E % LATIN SMALL LETTER Y WITH STROKE
-\setXTXcharcodes "00250 "00250 "00250 % LATIN SMALL LETTER TURNED A
-\setXTXcharcodes "00251 "00251 "00251 % LATIN SMALL LETTER ALPHA
-\setXTXcharcodes "00252 "00252 "00252 % LATIN SMALL LETTER TURNED ALPHA
-\setXTXcharcodes "00253 "00253 "00181 % LATIN SMALL LETTER B WITH HOOK
-\setXTXcharcodes "00254 "00254 "00186 % LATIN SMALL LETTER OPEN O
-\setXTXcharcodes "00255 "00255 "00255 % LATIN SMALL LETTER C WITH CURL
-\setXTXcharcodes "00256 "00256 "00189 % LATIN SMALL LETTER D WITH TAIL
-\setXTXcharcodes "00257 "00257 "0018A % LATIN SMALL LETTER D WITH HOOK
-\setXTXcharcodes "00258 "00258 "00258 % LATIN SMALL LETTER REVERSED E
-\setXTXcharcodes "00259 "00259 "0018F % LATIN SMALL LETTER SCHWA
-\setXTXcharcodes "0025A "0025A "0025A % LATIN SMALL LETTER SCHWA WITH HOOK
-\setXTXcharcodes "0025B "0025B "00190 % LATIN SMALL LETTER OPEN E
-\setXTXcharcodes "0025C "0025C "0025C % LATIN SMALL LETTER REVERSED OPEN E
-\setXTXcharcodes "0025D "0025D "0025D % LATIN SMALL LETTER REVERSED OPEN E WITH HOOK
-\setXTXcharcodes "0025E "0025E "0025E % LATIN SMALL LETTER CLOSED REVERSED OPEN E
-\setXTXcharcodes "0025F "0025F "0025F % LATIN SMALL LETTER DOTLESS J WITH STROKE
-\setXTXcharcodes "00260 "00260 "00193 % LATIN SMALL LETTER G WITH HOOK
-\setXTXcharcodes "00261 "00261 "00261 % LATIN SMALL LETTER SCRIPT G
-\setXTXcharcodes "00262 "00262 "00262 % LATIN LETTER SMALL CAPITAL G
-\setXTXcharcodes "00263 "00263 "00194 % LATIN SMALL LETTER GAMMA
-\setXTXcharcodes "00264 "00264 "00264 % LATIN SMALL LETTER RAMS HORN
-\setXTXcharcodes "00265 "00265 "00265 % LATIN SMALL LETTER TURNED H
-\setXTXcharcodes "00266 "00266 "00266 % LATIN SMALL LETTER H WITH HOOK
-\setXTXcharcodes "00267 "00267 "00267 % LATIN SMALL LETTER HENG WITH HOOK
-\setXTXcharcodes "00268 "00268 "00197 % LATIN SMALL LETTER I WITH STROKE
-\setXTXcharcodes "00269 "00269 "00196 % LATIN SMALL LETTER IOTA
-\setXTXcharcodes "0026A "0026A "0026A % LATIN LETTER SMALL CAPITAL I
-\setXTXcharcodes "0026B "0026B "02C62 % LATIN SMALL LETTER L WITH MIDDLE TILDE
-\setXTXcharcodes "0026C "0026C "0026C % LATIN SMALL LETTER L WITH BELT
-\setXTXcharcodes "0026D "0026D "0026D % LATIN SMALL LETTER L WITH RETROFLEX HOOK
-\setXTXcharcodes "0026E "0026E "0026E % LATIN SMALL LETTER LEZH
-\setXTXcharcodes "0026F "0026F "0019C % LATIN SMALL LETTER TURNED M
-\setXTXcharcodes "00270 "00270 "00270 % LATIN SMALL LETTER TURNED M WITH LONG LEG
-\setXTXcharcodes "00271 "00271 "00271 % LATIN SMALL LETTER M WITH HOOK
-\setXTXcharcodes "00272 "00272 "0019D % LATIN SMALL LETTER N WITH LEFT HOOK
-\setXTXcharcodes "00273 "00273 "00273 % LATIN SMALL LETTER N WITH RETROFLEX HOOK
-\setXTXcharcodes "00274 "00274 "00274 % LATIN LETTER SMALL CAPITAL N
-\setXTXcharcodes "00275 "00275 "0019F % LATIN SMALL LETTER BARRED O
-\setXTXcharcodes "00276 "00276 "00276 % LATIN LETTER SMALL CAPITAL OE
-\setXTXcharcodes "00277 "00277 "00277 % LATIN SMALL LETTER CLOSED OMEGA
-\setXTXcharcodes "00278 "00278 "00278 % LATIN SMALL LETTER PHI
-\setXTXcharcodes "00279 "00279 "00279 % LATIN SMALL LETTER TURNED R
-\setXTXcharcodes "0027A "0027A "0027A % LATIN SMALL LETTER TURNED R WITH LONG LEG
-\setXTXcharcodes "0027B "0027B "0027B % LATIN SMALL LETTER TURNED R WITH HOOK
-\setXTXcharcodes "0027C "0027C "0027C % LATIN SMALL LETTER R WITH LONG LEG
-\setXTXcharcodes "0027D "0027D "02C64 % LATIN SMALL LETTER R WITH TAIL
-\setXTXcharcodes "0027E "0027E "0027E % LATIN SMALL LETTER R WITH FISHHOOK
-\setXTXcharcodes "0027F "0027F "0027F % LATIN SMALL LETTER REVERSED R WITH FISHHOOK
-\setXTXcharcodes "00280 "00280 "001A6 % LATIN LETTER SMALL CAPITAL R
-\setXTXcharcodes "00281 "00281 "00281 % LATIN LETTER SMALL CAPITAL INVERTED R
-\setXTXcharcodes "00282 "00282 "00282 % LATIN SMALL LETTER S WITH HOOK
-\setXTXcharcodes "00283 "00283 "001A9 % LATIN SMALL LETTER ESH
-\setXTXcharcodes "00284 "00284 "00284 % LATIN SMALL LETTER DOTLESS J WITH STROKE AND HOOK
-\setXTXcharcodes "00285 "00285 "00285 % LATIN SMALL LETTER SQUAT REVERSED ESH
-\setXTXcharcodes "00286 "00286 "00286 % LATIN SMALL LETTER ESH WITH CURL
-\setXTXcharcodes "00287 "00287 "00287 % LATIN SMALL LETTER TURNED T
-\setXTXcharcodes "00288 "00288 "001AE % LATIN SMALL LETTER T WITH RETROFLEX HOOK
-\setXTXcharcodes "00289 "00289 "00244 % LATIN SMALL LETTER U BAR
-\setXTXcharcodes "0028A "0028A "001B1 % LATIN SMALL LETTER UPSILON
-\setXTXcharcodes "0028B "0028B "001B2 % LATIN SMALL LETTER V WITH HOOK
-\setXTXcharcodes "0028C "0028C "00245 % LATIN SMALL LETTER TURNED V
-\setXTXcharcodes "0028D "0028D "0028D % LATIN SMALL LETTER TURNED W
-\setXTXcharcodes "0028E "0028E "0028E % LATIN SMALL LETTER TURNED Y
-\setXTXcharcodes "0028F "0028F "0028F % LATIN LETTER SMALL CAPITAL Y
-\setXTXcharcodes "00290 "00290 "00290 % LATIN SMALL LETTER Z WITH RETROFLEX HOOK
-\setXTXcharcodes "00291 "00291 "00291 % LATIN SMALL LETTER Z WITH CURL
-\setXTXcharcodes "00292 "00292 "001B7 % LATIN SMALL LETTER EZH
-\setXTXcharcodes "00293 "00293 "00293 % LATIN SMALL LETTER EZH WITH CURL
-\setXTXcharcodes "00295 "00295 "00295 % LATIN LETTER PHARYNGEAL VOICED FRICATIVE
-\setXTXcharcodes "00296 "00296 "00296 % LATIN LETTER INVERTED GLOTTAL STOP
-\setXTXcharcodes "00297 "00297 "00297 % LATIN LETTER STRETCHED C
-\setXTXcharcodes "00298 "00298 "00298 % LATIN LETTER BILABIAL CLICK
-\setXTXcharcodes "00299 "00299 "00299 % LATIN LETTER SMALL CAPITAL B
-\setXTXcharcodes "0029A "0029A "0029A % LATIN SMALL LETTER CLOSED OPEN E
-\setXTXcharcodes "0029B "0029B "0029B % LATIN LETTER SMALL CAPITAL G WITH HOOK
-\setXTXcharcodes "0029C "0029C "0029C % LATIN LETTER SMALL CAPITAL H
-\setXTXcharcodes "0029D "0029D "0029D % LATIN SMALL LETTER J WITH CROSSED-TAIL
-\setXTXcharcodes "0029E "0029E "0029E % LATIN SMALL LETTER TURNED K
-\setXTXcharcodes "0029F "0029F "0029F % LATIN LETTER SMALL CAPITAL L
-\setXTXcharcodes "002A0 "002A0 "002A0 % LATIN SMALL LETTER Q WITH HOOK
-\setXTXcharcodes "002A1 "002A1 "002A1 % LATIN LETTER GLOTTAL STOP WITH STROKE
-\setXTXcharcodes "002A2 "002A2 "002A2 % LATIN LETTER REVERSED GLOTTAL STOP WITH STROKE
-\setXTXcharcodes "002A3 "002A3 "002A3 % LATIN SMALL LETTER DZ DIGRAPH
-\setXTXcharcodes "002A4 "002A4 "002A4 % LATIN SMALL LETTER DEZH DIGRAPH
-\setXTXcharcodes "002A5 "002A5 "002A5 % LATIN SMALL LETTER DZ DIGRAPH WITH CURL
-\setXTXcharcodes "002A6 "002A6 "002A6 % LATIN SMALL LETTER TS DIGRAPH
-\setXTXcharcodes "002A7 "002A7 "002A7 % LATIN SMALL LETTER TESH DIGRAPH
-\setXTXcharcodes "002A8 "002A8 "002A8 % LATIN SMALL LETTER TC DIGRAPH WITH CURL
-\setXTXcharcodes "002A9 "002A9 "002A9 % LATIN SMALL LETTER FENG DIGRAPH
-\setXTXcharcodes "002AA "002AA "002AA % LATIN SMALL LETTER LS DIGRAPH
-\setXTXcharcodes "002AB "002AB "002AB % LATIN SMALL LETTER LZ DIGRAPH
-\setXTXcharcodes "002AC "002AC "002AC % LATIN LETTER BILABIAL PERCUSSIVE
-\setXTXcharcodes "002AD "002AD "002AD % LATIN LETTER BIDENTAL PERCUSSIVE
-\setXTXcharcodes "002AE "002AE "002AE % LATIN SMALL LETTER TURNED H WITH FISHHOOK
-\setXTXcharcodes "002AF "002AF "002AF % LATIN SMALL LETTER TURNED H WITH FISHHOOK AND TAIL
-\setXTXcharcodes "00370 "00370 "00370 % GREEK CAPITAL LETTER HETA
-\setXTXcharcodes "00371 "00371 "00371 % GREEK SMALL LETTER HETA
-\setXTXcharcodes "00372 "00372 "00372 % GREEK CAPITAL LETTER ARCHAIC SAMPI
-\setXTXcharcodes "00373 "00373 "00373 % GREEK SMALL LETTER ARCHAIC SAMPI
-\setXTXcharcodes "00376 "00376 "00376 % GREEK CAPITAL LETTER PAMPHYLIAN DIGAMMA
-\setXTXcharcodes "00377 "00377 "00377 % GREEK SMALL LETTER PAMPHYLIAN DIGAMMA
-\setXTXcharcodes "0037B "0037B "003FD % GREEK SMALL REVERSED LUNATE SIGMA SYMBOL
-\setXTXcharcodes "0037C "0037C "003FE % GREEK SMALL DOTTED LUNATE SIGMA SYMBOL
-\setXTXcharcodes "0037D "0037D "003FF % GREEK SMALL REVERSED DOTTED LUNATE SIGMA SYMBOL
-\setXTXcharcodes "0037F "0037F "0037F % GREEK CAPITAL LETTER YOT
-\setXTXcharcodes "00386 "003AC "00386 % GREEK CAPITAL LETTER ALPHA WITH TONOS
-\setXTXcharcodes "00388 "003AD "00388 % GREEK CAPITAL LETTER EPSILON WITH TONOS
-\setXTXcharcodes "00389 "003AE "00389 % GREEK CAPITAL LETTER ETA WITH TONOS
-\setXTXcharcodes "0038A "003AF "0038A % GREEK CAPITAL LETTER IOTA WITH TONOS
-\setXTXcharcodes "0038C "003CC "0038C % GREEK CAPITAL LETTER OMICRON WITH TONOS
-\setXTXcharcodes "0038E "003CD "0038E % GREEK CAPITAL LETTER UPSILON WITH TONOS
-\setXTXcharcodes "0038F "003CE "0038F % GREEK CAPITAL LETTER OMEGA WITH TONOS
-\setXTXcharcodes "00390 "00390 "00390 % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
-\setXTXcharcodes "00391 "003B1 "00391 % GREEK CAPITAL LETTER ALPHA
-\setXTXcharcodes "00392 "003B2 "00392 % GREEK CAPITAL LETTER BETA
-\setXTXcharcodes "00393 "003B3 "00393 % GREEK CAPITAL LETTER GAMMA
-\setXTXcharcodes "00394 "003B4 "00394 % GREEK CAPITAL LETTER DELTA
-\setXTXcharcodes "00395 "003B5 "00395 % GREEK CAPITAL LETTER EPSILON
-\setXTXcharcodes "00396 "003B6 "00396 % GREEK CAPITAL LETTER ZETA
-\setXTXcharcodes "00397 "003B7 "00397 % GREEK CAPITAL LETTER ETA
-\setXTXcharcodes "00398 "003B8 "00398 % GREEK CAPITAL LETTER THETA
-\setXTXcharcodes "00399 "003B9 "00399 % GREEK CAPITAL LETTER IOTA
-\setXTXcharcodes "0039A "003BA "0039A % GREEK CAPITAL LETTER KAPPA
-\setXTXcharcodes "0039B "003BB "0039B % GREEK CAPITAL LETTER LAMDA
-\setXTXcharcodes "0039C "003BC "0039C % GREEK CAPITAL LETTER MU
-\setXTXcharcodes "0039D "003BD "0039D % GREEK CAPITAL LETTER NU
-\setXTXcharcodes "0039E "003BE "0039E % GREEK CAPITAL LETTER XI
-\setXTXcharcodes "0039F "003BF "0039F % GREEK CAPITAL LETTER OMICRON
-\setXTXcharcodes "003A0 "003C0 "003A0 % GREEK CAPITAL LETTER PI
-\setXTXcharcodes "003A1 "003C1 "003A1 % GREEK CAPITAL LETTER RHO
-\setXTXcharcodes "003A3 "003C3 "003A3 % GREEK CAPITAL LETTER SIGMA
-\setXTXcharcodes "003A4 "003C4 "003A4 % GREEK CAPITAL LETTER TAU
-\setXTXcharcodes "003A5 "003C5 "003A5 % GREEK CAPITAL LETTER UPSILON
-\setXTXcharcodes "003A6 "003C6 "003A6 % GREEK CAPITAL LETTER PHI
-\setXTXcharcodes "003A7 "003C7 "003A7 % GREEK CAPITAL LETTER CHI
-\setXTXcharcodes "003A8 "003C8 "003A8 % GREEK CAPITAL LETTER PSI
-\setXTXcharcodes "003A9 "003C9 "003A9 % GREEK CAPITAL LETTER OMEGA
-\setXTXcharcodes "003AA "003CA "003AA % GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
-\setXTXcharcodes "003AB "003CB "003AB % GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
-\setXTXcharcodes "003AC "003AC "00386 % GREEK SMALL LETTER ALPHA WITH TONOS
-\setXTXcharcodes "003AD "003AD "00388 % GREEK SMALL LETTER EPSILON WITH TONOS
-\setXTXcharcodes "003AE "003AE "00389 % GREEK SMALL LETTER ETA WITH TONOS
-\setXTXcharcodes "003AF "003AF "0038A % GREEK SMALL LETTER IOTA WITH TONOS
-\setXTXcharcodes "003B0 "003B0 "003B0 % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
-\setXTXcharcodes "003B1 "003B1 "00391 % GREEK SMALL LETTER ALPHA
-\setXTXcharcodes "003B2 "003B2 "00392 % GREEK SMALL LETTER BETA
-\setXTXcharcodes "003B3 "003B3 "00393 % GREEK SMALL LETTER GAMMA
-\setXTXcharcodes "003B4 "003B4 "00394 % GREEK SMALL LETTER DELTA
-\setXTXcharcodes "003B5 "003B5 "00395 % GREEK SMALL LETTER EPSILON
-\setXTXcharcodes "003B6 "003B6 "00396 % GREEK SMALL LETTER ZETA
-\setXTXcharcodes "003B7 "003B7 "00397 % GREEK SMALL LETTER ETA
-\setXTXcharcodes "003B8 "003B8 "00398 % GREEK SMALL LETTER THETA
-\setXTXcharcodes "003B9 "003B9 "00399 % GREEK SMALL LETTER IOTA
-\setXTXcharcodes "003BA "003BA "0039A % GREEK SMALL LETTER KAPPA
-\setXTXcharcodes "003BB "003BB "0039B % GREEK SMALL LETTER LAMDA
-\setXTXcharcodes "003BC "003BC "0039C % GREEK SMALL LETTER MU
-\setXTXcharcodes "003BD "003BD "0039D % GREEK SMALL LETTER NU
-\setXTXcharcodes "003BE "003BE "0039E % GREEK SMALL LETTER XI
-\setXTXcharcodes "003BF "003BF "0039F % GREEK SMALL LETTER OMICRON
-\setXTXcharcodes "003C0 "003C0 "003A0 % GREEK SMALL LETTER PI
-\setXTXcharcodes "003C1 "003C1 "003A1 % GREEK SMALL LETTER RHO
-\setXTXcharcodes "003C2 "003C2 "003A3 % GREEK SMALL LETTER FINAL SIGMA
-\setXTXcharcodes "003C3 "003C3 "003A3 % GREEK SMALL LETTER SIGMA
-\setXTXcharcodes "003C4 "003C4 "003A4 % GREEK SMALL LETTER TAU
-\setXTXcharcodes "003C5 "003C5 "003A5 % GREEK SMALL LETTER UPSILON
-\setXTXcharcodes "003C6 "003C6 "003A6 % GREEK SMALL LETTER PHI
-\setXTXcharcodes "003C7 "003C7 "003A7 % GREEK SMALL LETTER CHI
-\setXTXcharcodes "003C8 "003C8 "003A8 % GREEK SMALL LETTER PSI
-\setXTXcharcodes "003C9 "003C9 "003A9 % GREEK SMALL LETTER OMEGA
-\setXTXcharcodes "003CA "003CA "003AA % GREEK SMALL LETTER IOTA WITH DIALYTIKA
-\setXTXcharcodes "003CB "003CB "003AB % GREEK SMALL LETTER UPSILON WITH DIALYTIKA
-\setXTXcharcodes "003CC "003CC "0038C % GREEK SMALL LETTER OMICRON WITH TONOS
-\setXTXcharcodes "003CD "003CD "0038E % GREEK SMALL LETTER UPSILON WITH TONOS
-\setXTXcharcodes "003CE "003CE "0038F % GREEK SMALL LETTER OMEGA WITH TONOS
-\setXTXcharcodes "003CF "003CF "003CF % GREEK CAPITAL KAI SYMBOL
-\setXTXcharcodes "003D0 "003D0 "00392 % GREEK BETA SYMBOL
-\setXTXcharcodes "003D1 "003D1 "00398 % GREEK THETA SYMBOL
-\setXTXcharcodes "003D2 "003D2 "003D2 % GREEK UPSILON WITH HOOK SYMBOL
-\setXTXcharcodes "003D3 "003D3 "003D3 % GREEK UPSILON WITH ACUTE AND HOOK SYMBOL
-\setXTXcharcodes "003D4 "003D4 "003D4 % GREEK UPSILON WITH DIAERESIS AND HOOK SYMBOL
-\setXTXcharcodes "003D5 "003D5 "003A6 % GREEK PHI SYMBOL
-\setXTXcharcodes "003D6 "003D6 "003A0 % GREEK PI SYMBOL
-\setXTXcharcodes "003D7 "003D7 "003D7 % GREEK KAI SYMBOL
-\setXTXcharcodes "003D8 "003D9 "003D8 % GREEK LETTER ARCHAIC KOPPA
-\setXTXcharcodes "003D9 "003D9 "003D8 % GREEK SMALL LETTER ARCHAIC KOPPA
-\setXTXcharcodes "003DA "003DB "003DA % GREEK LETTER STIGMA
-\setXTXcharcodes "003DB "003DB "003DA % GREEK SMALL LETTER STIGMA
-\setXTXcharcodes "003DC "003DD "003DC % GREEK LETTER DIGAMMA
-\setXTXcharcodes "003DD "003DD "003DC % GREEK SMALL LETTER DIGAMMA
-\setXTXcharcodes "003DE "003DF "003DE % GREEK LETTER KOPPA
-\setXTXcharcodes "003DF "003DF "003DE % GREEK SMALL LETTER KOPPA
-\setXTXcharcodes "003E0 "003E1 "003E0 % GREEK LETTER SAMPI
-\setXTXcharcodes "003E1 "003E1 "003E0 % GREEK SMALL LETTER SAMPI
-\setXTXcharcodes "003E2 "003E3 "003E2 % COPTIC CAPITAL LETTER SHEI
-\setXTXcharcodes "003E3 "003E3 "003E2 % COPTIC SMALL LETTER SHEI
-\setXTXcharcodes "003E4 "003E5 "003E4 % COPTIC CAPITAL LETTER FEI
-\setXTXcharcodes "003E5 "003E5 "003E4 % COPTIC SMALL LETTER FEI
-\setXTXcharcodes "003E6 "003E7 "003E6 % COPTIC CAPITAL LETTER KHEI
-\setXTXcharcodes "003E7 "003E7 "003E6 % COPTIC SMALL LETTER KHEI
-\setXTXcharcodes "003E8 "003E9 "003E8 % COPTIC CAPITAL LETTER HORI
-\setXTXcharcodes "003E9 "003E9 "003E8 % COPTIC SMALL LETTER HORI
-\setXTXcharcodes "003EA "003EB "003EA % COPTIC CAPITAL LETTER GANGIA
-\setXTXcharcodes "003EB "003EB "003EA % COPTIC SMALL LETTER GANGIA
-\setXTXcharcodes "003EC "003ED "003EC % COPTIC CAPITAL LETTER SHIMA
-\setXTXcharcodes "003ED "003ED "003EC % COPTIC SMALL LETTER SHIMA
-\setXTXcharcodes "003EE "003EF "003EE % COPTIC CAPITAL LETTER DEI
-\setXTXcharcodes "003EF "003EF "003EE % COPTIC SMALL LETTER DEI
-\setXTXcharcodes "003F0 "003F0 "0039A % GREEK KAPPA SYMBOL
-\setXTXcharcodes "003F1 "003F1 "003A1 % GREEK RHO SYMBOL
-\setXTXcharcodes "003F2 "003F2 "003F9 % GREEK LUNATE SIGMA SYMBOL
-\setXTXcharcodes "003F3 "003F3 "003F3 % GREEK LETTER YOT
-\setXTXcharcodes "003F4 "003B8 "003F4 % GREEK CAPITAL THETA SYMBOL
-\setXTXcharcodes "003F5 "003F5 "00395 % GREEK LUNATE EPSILON SYMBOL
-\setXTXcharcodes "003F7 "003F8 "003F7 % GREEK CAPITAL LETTER SHO
-\setXTXcharcodes "003F8 "003F8 "003F7 % GREEK SMALL LETTER SHO
-\setXTXcharcodes "003F9 "003F2 "003F9 % GREEK CAPITAL LUNATE SIGMA SYMBOL
-\setXTXcharcodes "003FA "003FB "003FA % GREEK CAPITAL LETTER SAN
-\setXTXcharcodes "003FB "003FB "003FA % GREEK SMALL LETTER SAN
-\setXTXcharcodes "003FC "003FC "003FC % GREEK RHO WITH STROKE SYMBOL
-\setXTXcharcodes "003FD "0037B "003FD % GREEK CAPITAL REVERSED LUNATE SIGMA SYMBOL
-\setXTXcharcodes "003FE "0037C "003FE % GREEK CAPITAL DOTTED LUNATE SIGMA SYMBOL
-\setXTXcharcodes "003FF "0037D "003FF % GREEK CAPITAL REVERSED DOTTED LUNATE SIGMA SYMBOL
-\setXTXcharcodes "00400 "00450 "00400 % CYRILLIC CAPITAL LETTER IE WITH GRAVE
-\setXTXcharcodes "00401 "00451 "00401 % CYRILLIC CAPITAL LETTER IO
-\setXTXcharcodes "00402 "00452 "00402 % CYRILLIC CAPITAL LETTER DJE
-\setXTXcharcodes "00403 "00453 "00403 % CYRILLIC CAPITAL LETTER GJE
-\setXTXcharcodes "00404 "00454 "00404 % CYRILLIC CAPITAL LETTER UKRAINIAN IE
-\setXTXcharcodes "00405 "00455 "00405 % CYRILLIC CAPITAL LETTER DZE
-\setXTXcharcodes "00406 "00456 "00406 % CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
-\setXTXcharcodes "00407 "00457 "00407 % CYRILLIC CAPITAL LETTER YI
-\setXTXcharcodes "00408 "00458 "00408 % CYRILLIC CAPITAL LETTER JE
-\setXTXcharcodes "00409 "00459 "00409 % CYRILLIC CAPITAL LETTER LJE
-\setXTXcharcodes "0040A "0045A "0040A % CYRILLIC CAPITAL LETTER NJE
-\setXTXcharcodes "0040B "0045B "0040B % CYRILLIC CAPITAL LETTER TSHE
-\setXTXcharcodes "0040C "0045C "0040C % CYRILLIC CAPITAL LETTER KJE
-\setXTXcharcodes "0040D "0045D "0040D % CYRILLIC CAPITAL LETTER I WITH GRAVE
-\setXTXcharcodes "0040E "0045E "0040E % CYRILLIC CAPITAL LETTER SHORT U
-\setXTXcharcodes "0040F "0045F "0040F % CYRILLIC CAPITAL LETTER DZHE
-\setXTXcharcodes "00410 "00430 "00410 % CYRILLIC CAPITAL LETTER A
-\setXTXcharcodes "00411 "00431 "00411 % CYRILLIC CAPITAL LETTER BE
-\setXTXcharcodes "00412 "00432 "00412 % CYRILLIC CAPITAL LETTER VE
-\setXTXcharcodes "00413 "00433 "00413 % CYRILLIC CAPITAL LETTER GHE
-\setXTXcharcodes "00414 "00434 "00414 % CYRILLIC CAPITAL LETTER DE
-\setXTXcharcodes "00415 "00435 "00415 % CYRILLIC CAPITAL LETTER IE
-\setXTXcharcodes "00416 "00436 "00416 % CYRILLIC CAPITAL LETTER ZHE
-\setXTXcharcodes "00417 "00437 "00417 % CYRILLIC CAPITAL LETTER ZE
-\setXTXcharcodes "00418 "00438 "00418 % CYRILLIC CAPITAL LETTER I
-\setXTXcharcodes "00419 "00439 "00419 % CYRILLIC CAPITAL LETTER SHORT I
-\setXTXcharcodes "0041A "0043A "0041A % CYRILLIC CAPITAL LETTER KA
-\setXTXcharcodes "0041B "0043B "0041B % CYRILLIC CAPITAL LETTER EL
-\setXTXcharcodes "0041C "0043C "0041C % CYRILLIC CAPITAL LETTER EM
-\setXTXcharcodes "0041D "0043D "0041D % CYRILLIC CAPITAL LETTER EN
-\setXTXcharcodes "0041E "0043E "0041E % CYRILLIC CAPITAL LETTER O
-\setXTXcharcodes "0041F "0043F "0041F % CYRILLIC CAPITAL LETTER PE
-\setXTXcharcodes "00420 "00440 "00420 % CYRILLIC CAPITAL LETTER ER
-\setXTXcharcodes "00421 "00441 "00421 % CYRILLIC CAPITAL LETTER ES
-\setXTXcharcodes "00422 "00442 "00422 % CYRILLIC CAPITAL LETTER TE
-\setXTXcharcodes "00423 "00443 "00423 % CYRILLIC CAPITAL LETTER U
-\setXTXcharcodes "00424 "00444 "00424 % CYRILLIC CAPITAL LETTER EF
-\setXTXcharcodes "00425 "00445 "00425 % CYRILLIC CAPITAL LETTER HA
-\setXTXcharcodes "00426 "00446 "00426 % CYRILLIC CAPITAL LETTER TSE
-\setXTXcharcodes "00427 "00447 "00427 % CYRILLIC CAPITAL LETTER CHE
-\setXTXcharcodes "00428 "00448 "00428 % CYRILLIC CAPITAL LETTER SHA
-\setXTXcharcodes "00429 "00449 "00429 % CYRILLIC CAPITAL LETTER SHCHA
-\setXTXcharcodes "0042A "0044A "0042A % CYRILLIC CAPITAL LETTER HARD SIGN
-\setXTXcharcodes "0042B "0044B "0042B % CYRILLIC CAPITAL LETTER YERU
-\setXTXcharcodes "0042C "0044C "0042C % CYRILLIC CAPITAL LETTER SOFT SIGN
-\setXTXcharcodes "0042D "0044D "0042D % CYRILLIC CAPITAL LETTER E
-\setXTXcharcodes "0042E "0044E "0042E % CYRILLIC CAPITAL LETTER YU
-\setXTXcharcodes "0042F "0044F "0042F % CYRILLIC CAPITAL LETTER YA
-\setXTXcharcodes "00430 "00430 "00410 % CYRILLIC SMALL LETTER A
-\setXTXcharcodes "00431 "00431 "00411 % CYRILLIC SMALL LETTER BE
-\setXTXcharcodes "00432 "00432 "00412 % CYRILLIC SMALL LETTER VE
-\setXTXcharcodes "00433 "00433 "00413 % CYRILLIC SMALL LETTER GHE
-\setXTXcharcodes "00434 "00434 "00414 % CYRILLIC SMALL LETTER DE
-\setXTXcharcodes "00435 "00435 "00415 % CYRILLIC SMALL LETTER IE
-\setXTXcharcodes "00436 "00436 "00416 % CYRILLIC SMALL LETTER ZHE
-\setXTXcharcodes "00437 "00437 "00417 % CYRILLIC SMALL LETTER ZE
-\setXTXcharcodes "00438 "00438 "00418 % CYRILLIC SMALL LETTER I
-\setXTXcharcodes "00439 "00439 "00419 % CYRILLIC SMALL LETTER SHORT I
-\setXTXcharcodes "0043A "0043A "0041A % CYRILLIC SMALL LETTER KA
-\setXTXcharcodes "0043B "0043B "0041B % CYRILLIC SMALL LETTER EL
-\setXTXcharcodes "0043C "0043C "0041C % CYRILLIC SMALL LETTER EM
-\setXTXcharcodes "0043D "0043D "0041D % CYRILLIC SMALL LETTER EN
-\setXTXcharcodes "0043E "0043E "0041E % CYRILLIC SMALL LETTER O
-\setXTXcharcodes "0043F "0043F "0041F % CYRILLIC SMALL LETTER PE
-\setXTXcharcodes "00440 "00440 "00420 % CYRILLIC SMALL LETTER ER
-\setXTXcharcodes "00441 "00441 "00421 % CYRILLIC SMALL LETTER ES
-\setXTXcharcodes "00442 "00442 "00422 % CYRILLIC SMALL LETTER TE
-\setXTXcharcodes "00443 "00443 "00423 % CYRILLIC SMALL LETTER U
-\setXTXcharcodes "00444 "00444 "00424 % CYRILLIC SMALL LETTER EF
-\setXTXcharcodes "00445 "00445 "00425 % CYRILLIC SMALL LETTER HA
-\setXTXcharcodes "00446 "00446 "00426 % CYRILLIC SMALL LETTER TSE
-\setXTXcharcodes "00447 "00447 "00427 % CYRILLIC SMALL LETTER CHE
-\setXTXcharcodes "00448 "00448 "00428 % CYRILLIC SMALL LETTER SHA
-\setXTXcharcodes "00449 "00449 "00429 % CYRILLIC SMALL LETTER SHCHA
-\setXTXcharcodes "0044A "0044A "0042A % CYRILLIC SMALL LETTER HARD SIGN
-\setXTXcharcodes "0044B "0044B "0042B % CYRILLIC SMALL LETTER YERU
-\setXTXcharcodes "0044C "0044C "0042C % CYRILLIC SMALL LETTER SOFT SIGN
-\setXTXcharcodes "0044D "0044D "0042D % CYRILLIC SMALL LETTER E
-\setXTXcharcodes "0044E "0044E "0042E % CYRILLIC SMALL LETTER YU
-\setXTXcharcodes "0044F "0044F "0042F % CYRILLIC SMALL LETTER YA
-\setXTXcharcodes "00450 "00450 "00400 % CYRILLIC SMALL LETTER IE WITH GRAVE
-\setXTXcharcodes "00451 "00451 "00401 % CYRILLIC SMALL LETTER IO
-\setXTXcharcodes "00452 "00452 "00402 % CYRILLIC SMALL LETTER DJE
-\setXTXcharcodes "00453 "00453 "00403 % CYRILLIC SMALL LETTER GJE
-\setXTXcharcodes "00454 "00454 "00404 % CYRILLIC SMALL LETTER UKRAINIAN IE
-\setXTXcharcodes "00455 "00455 "00405 % CYRILLIC SMALL LETTER DZE
-\setXTXcharcodes "00456 "00456 "00406 % CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
-\setXTXcharcodes "00457 "00457 "00407 % CYRILLIC SMALL LETTER YI
-\setXTXcharcodes "00458 "00458 "00408 % CYRILLIC SMALL LETTER JE
-\setXTXcharcodes "00459 "00459 "00409 % CYRILLIC SMALL LETTER LJE
-\setXTXcharcodes "0045A "0045A "0040A % CYRILLIC SMALL LETTER NJE
-\setXTXcharcodes "0045B "0045B "0040B % CYRILLIC SMALL LETTER TSHE
-\setXTXcharcodes "0045C "0045C "0040C % CYRILLIC SMALL LETTER KJE
-\setXTXcharcodes "0045D "0045D "0040D % CYRILLIC SMALL LETTER I WITH GRAVE
-\setXTXcharcodes "0045E "0045E "0040E % CYRILLIC SMALL LETTER SHORT U
-\setXTXcharcodes "0045F "0045F "0040F % CYRILLIC SMALL LETTER DZHE
-\setXTXcharcodes "00460 "00461 "00460 % CYRILLIC CAPITAL LETTER OMEGA
-\setXTXcharcodes "00461 "00461 "00460 % CYRILLIC SMALL LETTER OMEGA
-\setXTXcharcodes "00462 "00463 "00462 % CYRILLIC CAPITAL LETTER YAT
-\setXTXcharcodes "00463 "00463 "00462 % CYRILLIC SMALL LETTER YAT
-\setXTXcharcodes "00464 "00465 "00464 % CYRILLIC CAPITAL LETTER IOTIFIED E
-\setXTXcharcodes "00465 "00465 "00464 % CYRILLIC SMALL LETTER IOTIFIED E
-\setXTXcharcodes "00466 "00467 "00466 % CYRILLIC CAPITAL LETTER LITTLE YUS
-\setXTXcharcodes "00467 "00467 "00466 % CYRILLIC SMALL LETTER LITTLE YUS
-\setXTXcharcodes "00468 "00469 "00468 % CYRILLIC CAPITAL LETTER IOTIFIED LITTLE YUS
-\setXTXcharcodes "00469 "00469 "00468 % CYRILLIC SMALL LETTER IOTIFIED LITTLE YUS
-\setXTXcharcodes "0046A "0046B "0046A % CYRILLIC CAPITAL LETTER BIG YUS
-\setXTXcharcodes "0046B "0046B "0046A % CYRILLIC SMALL LETTER BIG YUS
-\setXTXcharcodes "0046C "0046D "0046C % CYRILLIC CAPITAL LETTER IOTIFIED BIG YUS
-\setXTXcharcodes "0046D "0046D "0046C % CYRILLIC SMALL LETTER IOTIFIED BIG YUS
-\setXTXcharcodes "0046E "0046F "0046E % CYRILLIC CAPITAL LETTER KSI
-\setXTXcharcodes "0046F "0046F "0046E % CYRILLIC SMALL LETTER KSI
-\setXTXcharcodes "00470 "00471 "00470 % CYRILLIC CAPITAL LETTER PSI
-\setXTXcharcodes "00471 "00471 "00470 % CYRILLIC SMALL LETTER PSI
-\setXTXcharcodes "00472 "00473 "00472 % CYRILLIC CAPITAL LETTER FITA
-\setXTXcharcodes "00473 "00473 "00472 % CYRILLIC SMALL LETTER FITA
-\setXTXcharcodes "00474 "00475 "00474 % CYRILLIC CAPITAL LETTER IZHITSA
-\setXTXcharcodes "00475 "00475 "00474 % CYRILLIC SMALL LETTER IZHITSA
-\setXTXcharcodes "00476 "00477 "00476 % CYRILLIC CAPITAL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT
-\setXTXcharcodes "00477 "00477 "00476 % CYRILLIC SMALL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT
-\setXTXcharcodes "00478 "00479 "00478 % CYRILLIC CAPITAL LETTER UK
-\setXTXcharcodes "00479 "00479 "00478 % CYRILLIC SMALL LETTER UK
-\setXTXcharcodes "0047A "0047B "0047A % CYRILLIC CAPITAL LETTER ROUND OMEGA
-\setXTXcharcodes "0047B "0047B "0047A % CYRILLIC SMALL LETTER ROUND OMEGA
-\setXTXcharcodes "0047C "0047D "0047C % CYRILLIC CAPITAL LETTER OMEGA WITH TITLO
-\setXTXcharcodes "0047D "0047D "0047C % CYRILLIC SMALL LETTER OMEGA WITH TITLO
-\setXTXcharcodes "0047E "0047F "0047E % CYRILLIC CAPITAL LETTER OT
-\setXTXcharcodes "0047F "0047F "0047E % CYRILLIC SMALL LETTER OT
-\setXTXcharcodes "00480 "00481 "00480 % CYRILLIC CAPITAL LETTER KOPPA
-\setXTXcharcodes "00481 "00481 "00480 % CYRILLIC SMALL LETTER KOPPA
-\setXTXcharcodes "0048A "0048B "0048A % CYRILLIC CAPITAL LETTER SHORT I WITH TAIL
-\setXTXcharcodes "0048B "0048B "0048A % CYRILLIC SMALL LETTER SHORT I WITH TAIL
-\setXTXcharcodes "0048C "0048D "0048C % CYRILLIC CAPITAL LETTER SEMISOFT SIGN
-\setXTXcharcodes "0048D "0048D "0048C % CYRILLIC SMALL LETTER SEMISOFT SIGN
-\setXTXcharcodes "0048E "0048F "0048E % CYRILLIC CAPITAL LETTER ER WITH TICK
-\setXTXcharcodes "0048F "0048F "0048E % CYRILLIC SMALL LETTER ER WITH TICK
-\setXTXcharcodes "00490 "00491 "00490 % CYRILLIC CAPITAL LETTER GHE WITH UPTURN
-\setXTXcharcodes "00491 "00491 "00490 % CYRILLIC SMALL LETTER GHE WITH UPTURN
-\setXTXcharcodes "00492 "00493 "00492 % CYRILLIC CAPITAL LETTER GHE WITH STROKE
-\setXTXcharcodes "00493 "00493 "00492 % CYRILLIC SMALL LETTER GHE WITH STROKE
-\setXTXcharcodes "00494 "00495 "00494 % CYRILLIC CAPITAL LETTER GHE WITH MIDDLE HOOK
-\setXTXcharcodes "00495 "00495 "00494 % CYRILLIC SMALL LETTER GHE WITH MIDDLE HOOK
-\setXTXcharcodes "00496 "00497 "00496 % CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER
-\setXTXcharcodes "00497 "00497 "00496 % CYRILLIC SMALL LETTER ZHE WITH DESCENDER
-\setXTXcharcodes "00498 "00499 "00498 % CYRILLIC CAPITAL LETTER ZE WITH DESCENDER
-\setXTXcharcodes "00499 "00499 "00498 % CYRILLIC SMALL LETTER ZE WITH DESCENDER
-\setXTXcharcodes "0049A "0049B "0049A % CYRILLIC CAPITAL LETTER KA WITH DESCENDER
-\setXTXcharcodes "0049B "0049B "0049A % CYRILLIC SMALL LETTER KA WITH DESCENDER
-\setXTXcharcodes "0049C "0049D "0049C % CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE
-\setXTXcharcodes "0049D "0049D "0049C % CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE
-\setXTXcharcodes "0049E "0049F "0049E % CYRILLIC CAPITAL LETTER KA WITH STROKE
-\setXTXcharcodes "0049F "0049F "0049E % CYRILLIC SMALL LETTER KA WITH STROKE
-\setXTXcharcodes "004A0 "004A1 "004A0 % CYRILLIC CAPITAL LETTER BASHKIR KA
-\setXTXcharcodes "004A1 "004A1 "004A0 % CYRILLIC SMALL LETTER BASHKIR KA
-\setXTXcharcodes "004A2 "004A3 "004A2 % CYRILLIC CAPITAL LETTER EN WITH DESCENDER
-\setXTXcharcodes "004A3 "004A3 "004A2 % CYRILLIC SMALL LETTER EN WITH DESCENDER
-\setXTXcharcodes "004A4 "004A5 "004A4 % CYRILLIC CAPITAL LIGATURE EN GHE
-\setXTXcharcodes "004A5 "004A5 "004A4 % CYRILLIC SMALL LIGATURE EN GHE
-\setXTXcharcodes "004A6 "004A7 "004A6 % CYRILLIC CAPITAL LETTER PE WITH MIDDLE HOOK
-\setXTXcharcodes "004A7 "004A7 "004A6 % CYRILLIC SMALL LETTER PE WITH MIDDLE HOOK
-\setXTXcharcodes "004A8 "004A9 "004A8 % CYRILLIC CAPITAL LETTER ABKHASIAN HA
-\setXTXcharcodes "004A9 "004A9 "004A8 % CYRILLIC SMALL LETTER ABKHASIAN HA
-\setXTXcharcodes "004AA "004AB "004AA % CYRILLIC CAPITAL LETTER ES WITH DESCENDER
-\setXTXcharcodes "004AB "004AB "004AA % CYRILLIC SMALL LETTER ES WITH DESCENDER
-\setXTXcharcodes "004AC "004AD "004AC % CYRILLIC CAPITAL LETTER TE WITH DESCENDER
-\setXTXcharcodes "004AD "004AD "004AC % CYRILLIC SMALL LETTER TE WITH DESCENDER
-\setXTXcharcodes "004AE "004AF "004AE % CYRILLIC CAPITAL LETTER STRAIGHT U
-\setXTXcharcodes "004AF "004AF "004AE % CYRILLIC SMALL LETTER STRAIGHT U
-\setXTXcharcodes "004B0 "004B1 "004B0 % CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE
-\setXTXcharcodes "004B1 "004B1 "004B0 % CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE
-\setXTXcharcodes "004B2 "004B3 "004B2 % CYRILLIC CAPITAL LETTER HA WITH DESCENDER
-\setXTXcharcodes "004B3 "004B3 "004B2 % CYRILLIC SMALL LETTER HA WITH DESCENDER
-\setXTXcharcodes "004B4 "004B5 "004B4 % CYRILLIC CAPITAL LIGATURE TE TSE
-\setXTXcharcodes "004B5 "004B5 "004B4 % CYRILLIC SMALL LIGATURE TE TSE
-\setXTXcharcodes "004B6 "004B7 "004B6 % CYRILLIC CAPITAL LETTER CHE WITH DESCENDER
-\setXTXcharcodes "004B7 "004B7 "004B6 % CYRILLIC SMALL LETTER CHE WITH DESCENDER
-\setXTXcharcodes "004B8 "004B9 "004B8 % CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE
-\setXTXcharcodes "004B9 "004B9 "004B8 % CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE
-\setXTXcharcodes "004BA "004BB "004BA % CYRILLIC CAPITAL LETTER SHHA
-\setXTXcharcodes "004BB "004BB "004BA % CYRILLIC SMALL LETTER SHHA
-\setXTXcharcodes "004BC "004BD "004BC % CYRILLIC CAPITAL LETTER ABKHASIAN CHE
-\setXTXcharcodes "004BD "004BD "004BC % CYRILLIC SMALL LETTER ABKHASIAN CHE
-\setXTXcharcodes "004BE "004BF "004BE % CYRILLIC CAPITAL LETTER ABKHASIAN CHE WITH DESCENDER
-\setXTXcharcodes "004BF "004BF "004BE % CYRILLIC SMALL LETTER ABKHASIAN CHE WITH DESCENDER
-\setXTXcharcodes "004C0 "004CF "004C0 % CYRILLIC LETTER PALOCHKA
-\setXTXcharcodes "004C1 "004C2 "004C1 % CYRILLIC CAPITAL LETTER ZHE WITH BREVE
-\setXTXcharcodes "004C2 "004C2 "004C1 % CYRILLIC SMALL LETTER ZHE WITH BREVE
-\setXTXcharcodes "004C3 "004C4 "004C3 % CYRILLIC CAPITAL LETTER KA WITH HOOK
-\setXTXcharcodes "004C4 "004C4 "004C3 % CYRILLIC SMALL LETTER KA WITH HOOK
-\setXTXcharcodes "004C5 "004C6 "004C5 % CYRILLIC CAPITAL LETTER EL WITH TAIL
-\setXTXcharcodes "004C6 "004C6 "004C5 % CYRILLIC SMALL LETTER EL WITH TAIL
-\setXTXcharcodes "004C7 "004C8 "004C7 % CYRILLIC CAPITAL LETTER EN WITH HOOK
-\setXTXcharcodes "004C8 "004C8 "004C7 % CYRILLIC SMALL LETTER EN WITH HOOK
-\setXTXcharcodes "004C9 "004CA "004C9 % CYRILLIC CAPITAL LETTER EN WITH TAIL
-\setXTXcharcodes "004CA "004CA "004C9 % CYRILLIC SMALL LETTER EN WITH TAIL
-\setXTXcharcodes "004CB "004CC "004CB % CYRILLIC CAPITAL LETTER KHAKASSIAN CHE
-\setXTXcharcodes "004CC "004CC "004CB % CYRILLIC SMALL LETTER KHAKASSIAN CHE
-\setXTXcharcodes "004CD "004CE "004CD % CYRILLIC CAPITAL LETTER EM WITH TAIL
-\setXTXcharcodes "004CE "004CE "004CD % CYRILLIC SMALL LETTER EM WITH TAIL
-\setXTXcharcodes "004CF "004CF "004C0 % CYRILLIC SMALL LETTER PALOCHKA
-\setXTXcharcodes "004D0 "004D1 "004D0 % CYRILLIC CAPITAL LETTER A WITH BREVE
-\setXTXcharcodes "004D1 "004D1 "004D0 % CYRILLIC SMALL LETTER A WITH BREVE
-\setXTXcharcodes "004D2 "004D3 "004D2 % CYRILLIC CAPITAL LETTER A WITH DIAERESIS
-\setXTXcharcodes "004D3 "004D3 "004D2 % CYRILLIC SMALL LETTER A WITH DIAERESIS
-\setXTXcharcodes "004D4 "004D5 "004D4 % CYRILLIC CAPITAL LIGATURE A IE
-\setXTXcharcodes "004D5 "004D5 "004D4 % CYRILLIC SMALL LIGATURE A IE
-\setXTXcharcodes "004D6 "004D7 "004D6 % CYRILLIC CAPITAL LETTER IE WITH BREVE
-\setXTXcharcodes "004D7 "004D7 "004D6 % CYRILLIC SMALL LETTER IE WITH BREVE
-\setXTXcharcodes "004D8 "004D9 "004D8 % CYRILLIC CAPITAL LETTER SCHWA
-\setXTXcharcodes "004D9 "004D9 "004D8 % CYRILLIC SMALL LETTER SCHWA
-\setXTXcharcodes "004DA "004DB "004DA % CYRILLIC CAPITAL LETTER SCHWA WITH DIAERESIS
-\setXTXcharcodes "004DB "004DB "004DA % CYRILLIC SMALL LETTER SCHWA WITH DIAERESIS
-\setXTXcharcodes "004DC "004DD "004DC % CYRILLIC CAPITAL LETTER ZHE WITH DIAERESIS
-\setXTXcharcodes "004DD "004DD "004DC % CYRILLIC SMALL LETTER ZHE WITH DIAERESIS
-\setXTXcharcodes "004DE "004DF "004DE % CYRILLIC CAPITAL LETTER ZE WITH DIAERESIS
-\setXTXcharcodes "004DF "004DF "004DE % CYRILLIC SMALL LETTER ZE WITH DIAERESIS
-\setXTXcharcodes "004E0 "004E1 "004E0 % CYRILLIC CAPITAL LETTER ABKHASIAN DZE
-\setXTXcharcodes "004E1 "004E1 "004E0 % CYRILLIC SMALL LETTER ABKHASIAN DZE
-\setXTXcharcodes "004E2 "004E3 "004E2 % CYRILLIC CAPITAL LETTER I WITH MACRON
-\setXTXcharcodes "004E3 "004E3 "004E2 % CYRILLIC SMALL LETTER I WITH MACRON
-\setXTXcharcodes "004E4 "004E5 "004E4 % CYRILLIC CAPITAL LETTER I WITH DIAERESIS
-\setXTXcharcodes "004E5 "004E5 "004E4 % CYRILLIC SMALL LETTER I WITH DIAERESIS
-\setXTXcharcodes "004E6 "004E7 "004E6 % CYRILLIC CAPITAL LETTER O WITH DIAERESIS
-\setXTXcharcodes "004E7 "004E7 "004E6 % CYRILLIC SMALL LETTER O WITH DIAERESIS
-\setXTXcharcodes "004E8 "004E9 "004E8 % CYRILLIC CAPITAL LETTER BARRED O
-\setXTXcharcodes "004E9 "004E9 "004E8 % CYRILLIC SMALL LETTER BARRED O
-\setXTXcharcodes "004EA "004EB "004EA % CYRILLIC CAPITAL LETTER BARRED O WITH DIAERESIS
-\setXTXcharcodes "004EB "004EB "004EA % CYRILLIC SMALL LETTER BARRED O WITH DIAERESIS
-\setXTXcharcodes "004EC "004ED "004EC % CYRILLIC CAPITAL LETTER E WITH DIAERESIS
-\setXTXcharcodes "004ED "004ED "004EC % CYRILLIC SMALL LETTER E WITH DIAERESIS
-\setXTXcharcodes "004EE "004EF "004EE % CYRILLIC CAPITAL LETTER U WITH MACRON
-\setXTXcharcodes "004EF "004EF "004EE % CYRILLIC SMALL LETTER U WITH MACRON
-\setXTXcharcodes "004F0 "004F1 "004F0 % CYRILLIC CAPITAL LETTER U WITH DIAERESIS
-\setXTXcharcodes "004F1 "004F1 "004F0 % CYRILLIC SMALL LETTER U WITH DIAERESIS
-\setXTXcharcodes "004F2 "004F3 "004F2 % CYRILLIC CAPITAL LETTER U WITH DOUBLE ACUTE
-\setXTXcharcodes "004F3 "004F3 "004F2 % CYRILLIC SMALL LETTER U WITH DOUBLE ACUTE
-\setXTXcharcodes "004F4 "004F5 "004F4 % CYRILLIC CAPITAL LETTER CHE WITH DIAERESIS
-\setXTXcharcodes "004F5 "004F5 "004F4 % CYRILLIC SMALL LETTER CHE WITH DIAERESIS
-\setXTXcharcodes "004F6 "004F7 "004F6 % CYRILLIC CAPITAL LETTER GHE WITH DESCENDER
-\setXTXcharcodes "004F7 "004F7 "004F6 % CYRILLIC SMALL LETTER GHE WITH DESCENDER
-\setXTXcharcodes "004F8 "004F9 "004F8 % CYRILLIC CAPITAL LETTER YERU WITH DIAERESIS
-\setXTXcharcodes "004F9 "004F9 "004F8 % CYRILLIC SMALL LETTER YERU WITH DIAERESIS
-\setXTXcharcodes "004FA "004FB "004FA % CYRILLIC CAPITAL LETTER GHE WITH STROKE AND HOOK
-\setXTXcharcodes "004FB "004FB "004FA % CYRILLIC SMALL LETTER GHE WITH STROKE AND HOOK
-\setXTXcharcodes "004FC "004FD "004FC % CYRILLIC CAPITAL LETTER HA WITH HOOK
-\setXTXcharcodes "004FD "004FD "004FC % CYRILLIC SMALL LETTER HA WITH HOOK
-\setXTXcharcodes "004FE "004FF "004FE % CYRILLIC CAPITAL LETTER HA WITH STROKE
-\setXTXcharcodes "004FF "004FF "004FE % CYRILLIC SMALL LETTER HA WITH STROKE
-\setXTXcharcodes "00500 "00501 "00500 % CYRILLIC CAPITAL LETTER KOMI DE
-\setXTXcharcodes "00501 "00501 "00500 % CYRILLIC SMALL LETTER KOMI DE
-\setXTXcharcodes "00502 "00503 "00502 % CYRILLIC CAPITAL LETTER KOMI DJE
-\setXTXcharcodes "00503 "00503 "00502 % CYRILLIC SMALL LETTER KOMI DJE
-\setXTXcharcodes "00504 "00505 "00504 % CYRILLIC CAPITAL LETTER KOMI ZJE
-\setXTXcharcodes "00505 "00505 "00504 % CYRILLIC SMALL LETTER KOMI ZJE
-\setXTXcharcodes "00506 "00507 "00506 % CYRILLIC CAPITAL LETTER KOMI DZJE
-\setXTXcharcodes "00507 "00507 "00506 % CYRILLIC SMALL LETTER KOMI DZJE
-\setXTXcharcodes "00508 "00509 "00508 % CYRILLIC CAPITAL LETTER KOMI LJE
-\setXTXcharcodes "00509 "00509 "00508 % CYRILLIC SMALL LETTER KOMI LJE
-\setXTXcharcodes "0050A "0050B "0050A % CYRILLIC CAPITAL LETTER KOMI NJE
-\setXTXcharcodes "0050B "0050B "0050A % CYRILLIC SMALL LETTER KOMI NJE
-\setXTXcharcodes "0050C "0050D "0050C % CYRILLIC CAPITAL LETTER KOMI SJE
-\setXTXcharcodes "0050D "0050D "0050C % CYRILLIC SMALL LETTER KOMI SJE
-\setXTXcharcodes "0050E "0050F "0050E % CYRILLIC CAPITAL LETTER KOMI TJE
-\setXTXcharcodes "0050F "0050F "0050E % CYRILLIC SMALL LETTER KOMI TJE
-\setXTXcharcodes "00510 "00511 "00510 % CYRILLIC CAPITAL LETTER REVERSED ZE
-\setXTXcharcodes "00511 "00511 "00510 % CYRILLIC SMALL LETTER REVERSED ZE
-\setXTXcharcodes "00512 "00513 "00512 % CYRILLIC CAPITAL LETTER EL WITH HOOK
-\setXTXcharcodes "00513 "00513 "00512 % CYRILLIC SMALL LETTER EL WITH HOOK
-\setXTXcharcodes "00514 "00514 "00514 % CYRILLIC CAPITAL LETTER LHA
-\setXTXcharcodes "00515 "00515 "00515 % CYRILLIC SMALL LETTER LHA
-\setXTXcharcodes "00516 "00516 "00516 % CYRILLIC CAPITAL LETTER RHA
-\setXTXcharcodes "00517 "00517 "00517 % CYRILLIC SMALL LETTER RHA
-\setXTXcharcodes "00518 "00518 "00518 % CYRILLIC CAPITAL LETTER YAE
-\setXTXcharcodes "00519 "00519 "00519 % CYRILLIC SMALL LETTER YAE
-\setXTXcharcodes "0051A "0051A "0051A % CYRILLIC CAPITAL LETTER QA
-\setXTXcharcodes "0051B "0051B "0051B % CYRILLIC SMALL LETTER QA
-\setXTXcharcodes "0051C "0051C "0051C % CYRILLIC CAPITAL LETTER WE
-\setXTXcharcodes "0051D "0051D "0051D % CYRILLIC SMALL LETTER WE
-\setXTXcharcodes "0051E "0051E "0051E % CYRILLIC CAPITAL LETTER ALEUT KA
-\setXTXcharcodes "0051F "0051F "0051F % CYRILLIC SMALL LETTER ALEUT KA
-\setXTXcharcodes "00520 "00520 "00520 % CYRILLIC CAPITAL LETTER EL WITH MIDDLE HOOK
-\setXTXcharcodes "00521 "00521 "00521 % CYRILLIC SMALL LETTER EL WITH MIDDLE HOOK
-\setXTXcharcodes "00522 "00522 "00522 % CYRILLIC CAPITAL LETTER EN WITH MIDDLE HOOK
-\setXTXcharcodes "00523 "00523 "00523 % CYRILLIC SMALL LETTER EN WITH MIDDLE HOOK
-\setXTXcharcodes "00524 "00524 "00524 % CYRILLIC CAPITAL LETTER PE WITH DESCENDER
-\setXTXcharcodes "00525 "00525 "00525 % CYRILLIC SMALL LETTER PE WITH DESCENDER
-\setXTXcharcodes "00526 "00526 "00526 % CYRILLIC CAPITAL LETTER SHHA WITH DESCENDER
-\setXTXcharcodes "00527 "00527 "00527 % CYRILLIC SMALL LETTER SHHA WITH DESCENDER
-\setXTXcharcodes "00528 "00528 "00528 % CYRILLIC CAPITAL LETTER EN WITH LEFT HOOK
-\setXTXcharcodes "00529 "00529 "00529 % CYRILLIC SMALL LETTER EN WITH LEFT HOOK
-\setXTXcharcodes "0052A "0052A "0052A % CYRILLIC CAPITAL LETTER DZZHE
-\setXTXcharcodes "0052B "0052B "0052B % CYRILLIC SMALL LETTER DZZHE
-\setXTXcharcodes "0052C "0052C "0052C % CYRILLIC CAPITAL LETTER DCHE
-\setXTXcharcodes "0052D "0052D "0052D % CYRILLIC SMALL LETTER DCHE
-\setXTXcharcodes "0052E "0052E "0052E % CYRILLIC CAPITAL LETTER EL WITH DESCENDER
-\setXTXcharcodes "0052F "0052F "0052F % CYRILLIC SMALL LETTER EL WITH DESCENDER
-\setXTXcharcodes "00531 "00561 "00531 % ARMENIAN CAPITAL LETTER AYB
-\setXTXcharcodes "00532 "00562 "00532 % ARMENIAN CAPITAL LETTER BEN
-\setXTXcharcodes "00533 "00563 "00533 % ARMENIAN CAPITAL LETTER GIM
-\setXTXcharcodes "00534 "00564 "00534 % ARMENIAN CAPITAL LETTER DA
-\setXTXcharcodes "00535 "00565 "00535 % ARMENIAN CAPITAL LETTER ECH
-\setXTXcharcodes "00536 "00566 "00536 % ARMENIAN CAPITAL LETTER ZA
-\setXTXcharcodes "00537 "00567 "00537 % ARMENIAN CAPITAL LETTER EH
-\setXTXcharcodes "00538 "00568 "00538 % ARMENIAN CAPITAL LETTER ET
-\setXTXcharcodes "00539 "00569 "00539 % ARMENIAN CAPITAL LETTER TO
-\setXTXcharcodes "0053A "0056A "0053A % ARMENIAN CAPITAL LETTER ZHE
-\setXTXcharcodes "0053B "0056B "0053B % ARMENIAN CAPITAL LETTER INI
-\setXTXcharcodes "0053C "0056C "0053C % ARMENIAN CAPITAL LETTER LIWN
-\setXTXcharcodes "0053D "0056D "0053D % ARMENIAN CAPITAL LETTER XEH
-\setXTXcharcodes "0053E "0056E "0053E % ARMENIAN CAPITAL LETTER CA
-\setXTXcharcodes "0053F "0056F "0053F % ARMENIAN CAPITAL LETTER KEN
-\setXTXcharcodes "00540 "00570 "00540 % ARMENIAN CAPITAL LETTER HO
-\setXTXcharcodes "00541 "00571 "00541 % ARMENIAN CAPITAL LETTER JA
-\setXTXcharcodes "00542 "00572 "00542 % ARMENIAN CAPITAL LETTER GHAD
-\setXTXcharcodes "00543 "00573 "00543 % ARMENIAN CAPITAL LETTER CHEH
-\setXTXcharcodes "00544 "00574 "00544 % ARMENIAN CAPITAL LETTER MEN
-\setXTXcharcodes "00545 "00575 "00545 % ARMENIAN CAPITAL LETTER YI
-\setXTXcharcodes "00546 "00576 "00546 % ARMENIAN CAPITAL LETTER NOW
-\setXTXcharcodes "00547 "00577 "00547 % ARMENIAN CAPITAL LETTER SHA
-\setXTXcharcodes "00548 "00578 "00548 % ARMENIAN CAPITAL LETTER VO
-\setXTXcharcodes "00549 "00579 "00549 % ARMENIAN CAPITAL LETTER CHA
-\setXTXcharcodes "0054A "0057A "0054A % ARMENIAN CAPITAL LETTER PEH
-\setXTXcharcodes "0054B "0057B "0054B % ARMENIAN CAPITAL LETTER JHEH
-\setXTXcharcodes "0054C "0057C "0054C % ARMENIAN CAPITAL LETTER RA
-\setXTXcharcodes "0054D "0057D "0054D % ARMENIAN CAPITAL LETTER SEH
-\setXTXcharcodes "0054E "0057E "0054E % ARMENIAN CAPITAL LETTER VEW
-\setXTXcharcodes "0054F "0057F "0054F % ARMENIAN CAPITAL LETTER TIWN
-\setXTXcharcodes "00550 "00580 "00550 % ARMENIAN CAPITAL LETTER REH
-\setXTXcharcodes "00551 "00581 "00551 % ARMENIAN CAPITAL LETTER CO
-\setXTXcharcodes "00552 "00582 "00552 % ARMENIAN CAPITAL LETTER YIWN
-\setXTXcharcodes "00553 "00583 "00553 % ARMENIAN CAPITAL LETTER PIWR
-\setXTXcharcodes "00554 "00584 "00554 % ARMENIAN CAPITAL LETTER KEH
-\setXTXcharcodes "00555 "00585 "00555 % ARMENIAN CAPITAL LETTER OH
-\setXTXcharcodes "00556 "00586 "00556 % ARMENIAN CAPITAL LETTER FEH
-\setXTXcharcodes "00561 "00561 "00531 % ARMENIAN SMALL LETTER AYB
-\setXTXcharcodes "00562 "00562 "00532 % ARMENIAN SMALL LETTER BEN
-\setXTXcharcodes "00563 "00563 "00533 % ARMENIAN SMALL LETTER GIM
-\setXTXcharcodes "00564 "00564 "00534 % ARMENIAN SMALL LETTER DA
-\setXTXcharcodes "00565 "00565 "00535 % ARMENIAN SMALL LETTER ECH
-\setXTXcharcodes "00566 "00566 "00536 % ARMENIAN SMALL LETTER ZA
-\setXTXcharcodes "00567 "00567 "00537 % ARMENIAN SMALL LETTER EH
-\setXTXcharcodes "00568 "00568 "00538 % ARMENIAN SMALL LETTER ET
-\setXTXcharcodes "00569 "00569 "00539 % ARMENIAN SMALL LETTER TO
-\setXTXcharcodes "0056A "0056A "0053A % ARMENIAN SMALL LETTER ZHE
-\setXTXcharcodes "0056B "0056B "0053B % ARMENIAN SMALL LETTER INI
-\setXTXcharcodes "0056C "0056C "0053C % ARMENIAN SMALL LETTER LIWN
-\setXTXcharcodes "0056D "0056D "0053D % ARMENIAN SMALL LETTER XEH
-\setXTXcharcodes "0056E "0056E "0053E % ARMENIAN SMALL LETTER CA
-\setXTXcharcodes "0056F "0056F "0053F % ARMENIAN SMALL LETTER KEN
-\setXTXcharcodes "00570 "00570 "00540 % ARMENIAN SMALL LETTER HO
-\setXTXcharcodes "00571 "00571 "00541 % ARMENIAN SMALL LETTER JA
-\setXTXcharcodes "00572 "00572 "00542 % ARMENIAN SMALL LETTER GHAD
-\setXTXcharcodes "00573 "00573 "00543 % ARMENIAN SMALL LETTER CHEH
-\setXTXcharcodes "00574 "00574 "00544 % ARMENIAN SMALL LETTER MEN
-\setXTXcharcodes "00575 "00575 "00545 % ARMENIAN SMALL LETTER YI
-\setXTXcharcodes "00576 "00576 "00546 % ARMENIAN SMALL LETTER NOW
-\setXTXcharcodes "00577 "00577 "00547 % ARMENIAN SMALL LETTER SHA
-\setXTXcharcodes "00578 "00578 "00548 % ARMENIAN SMALL LETTER VO
-\setXTXcharcodes "00579 "00579 "00549 % ARMENIAN SMALL LETTER CHA
-\setXTXcharcodes "0057A "0057A "0054A % ARMENIAN SMALL LETTER PEH
-\setXTXcharcodes "0057B "0057B "0054B % ARMENIAN SMALL LETTER JHEH
-\setXTXcharcodes "0057C "0057C "0054C % ARMENIAN SMALL LETTER RA
-\setXTXcharcodes "0057D "0057D "0054D % ARMENIAN SMALL LETTER SEH
-\setXTXcharcodes "0057E "0057E "0054E % ARMENIAN SMALL LETTER VEW
-\setXTXcharcodes "0057F "0057F "0054F % ARMENIAN SMALL LETTER TIWN
-\setXTXcharcodes "00580 "00580 "00550 % ARMENIAN SMALL LETTER REH
-\setXTXcharcodes "00581 "00581 "00551 % ARMENIAN SMALL LETTER CO
-\setXTXcharcodes "00582 "00582 "00552 % ARMENIAN SMALL LETTER YIWN
-\setXTXcharcodes "00583 "00583 "00553 % ARMENIAN SMALL LETTER PIWR
-\setXTXcharcodes "00584 "00584 "00554 % ARMENIAN SMALL LETTER KEH
-\setXTXcharcodes "00585 "00585 "00555 % ARMENIAN SMALL LETTER OH
-\setXTXcharcodes "00586 "00586 "00556 % ARMENIAN SMALL LETTER FEH
-\setXTXcharcodes "00587 "00587 "00587 % ARMENIAN SMALL LIGATURE ECH YIWN
-\setXTXcharcodes "010A0 "02D00 "010A0 % GEORGIAN CAPITAL LETTER AN
-\setXTXcharcodes "010A1 "02D01 "010A1 % GEORGIAN CAPITAL LETTER BAN
-\setXTXcharcodes "010A2 "02D02 "010A2 % GEORGIAN CAPITAL LETTER GAN
-\setXTXcharcodes "010A3 "02D03 "010A3 % GEORGIAN CAPITAL LETTER DON
-\setXTXcharcodes "010A4 "02D04 "010A4 % GEORGIAN CAPITAL LETTER EN
-\setXTXcharcodes "010A5 "02D05 "010A5 % GEORGIAN CAPITAL LETTER VIN
-\setXTXcharcodes "010A6 "02D06 "010A6 % GEORGIAN CAPITAL LETTER ZEN
-\setXTXcharcodes "010A7 "02D07 "010A7 % GEORGIAN CAPITAL LETTER TAN
-\setXTXcharcodes "010A8 "02D08 "010A8 % GEORGIAN CAPITAL LETTER IN
-\setXTXcharcodes "010A9 "02D09 "010A9 % GEORGIAN CAPITAL LETTER KAN
-\setXTXcharcodes "010AA "02D0A "010AA % GEORGIAN CAPITAL LETTER LAS
-\setXTXcharcodes "010AB "02D0B "010AB % GEORGIAN CAPITAL LETTER MAN
-\setXTXcharcodes "010AC "02D0C "010AC % GEORGIAN CAPITAL LETTER NAR
-\setXTXcharcodes "010AD "02D0D "010AD % GEORGIAN CAPITAL LETTER ON
-\setXTXcharcodes "010AE "02D0E "010AE % GEORGIAN CAPITAL LETTER PAR
-\setXTXcharcodes "010AF "02D0F "010AF % GEORGIAN CAPITAL LETTER ZHAR
-\setXTXcharcodes "010B0 "02D10 "010B0 % GEORGIAN CAPITAL LETTER RAE
-\setXTXcharcodes "010B1 "02D11 "010B1 % GEORGIAN CAPITAL LETTER SAN
-\setXTXcharcodes "010B2 "02D12 "010B2 % GEORGIAN CAPITAL LETTER TAR
-\setXTXcharcodes "010B3 "02D13 "010B3 % GEORGIAN CAPITAL LETTER UN
-\setXTXcharcodes "010B4 "02D14 "010B4 % GEORGIAN CAPITAL LETTER PHAR
-\setXTXcharcodes "010B5 "02D15 "010B5 % GEORGIAN CAPITAL LETTER KHAR
-\setXTXcharcodes "010B6 "02D16 "010B6 % GEORGIAN CAPITAL LETTER GHAN
-\setXTXcharcodes "010B7 "02D17 "010B7 % GEORGIAN CAPITAL LETTER QAR
-\setXTXcharcodes "010B8 "02D18 "010B8 % GEORGIAN CAPITAL LETTER SHIN
-\setXTXcharcodes "010B9 "02D19 "010B9 % GEORGIAN CAPITAL LETTER CHIN
-\setXTXcharcodes "010BA "02D1A "010BA % GEORGIAN CAPITAL LETTER CAN
-\setXTXcharcodes "010BB "02D1B "010BB % GEORGIAN CAPITAL LETTER JIL
-\setXTXcharcodes "010BC "02D1C "010BC % GEORGIAN CAPITAL LETTER CIL
-\setXTXcharcodes "010BD "02D1D "010BD % GEORGIAN CAPITAL LETTER CHAR
-\setXTXcharcodes "010BE "02D1E "010BE % GEORGIAN CAPITAL LETTER XAN
-\setXTXcharcodes "010BF "02D1F "010BF % GEORGIAN CAPITAL LETTER JHAN
-\setXTXcharcodes "010C0 "02D20 "010C0 % GEORGIAN CAPITAL LETTER HAE
-\setXTXcharcodes "010C1 "02D21 "010C1 % GEORGIAN CAPITAL LETTER HE
-\setXTXcharcodes "010C2 "02D22 "010C2 % GEORGIAN CAPITAL LETTER HIE
-\setXTXcharcodes "010C3 "02D23 "010C3 % GEORGIAN CAPITAL LETTER WE
-\setXTXcharcodes "010C4 "02D24 "010C4 % GEORGIAN CAPITAL LETTER HAR
-\setXTXcharcodes "010C5 "02D25 "010C5 % GEORGIAN CAPITAL LETTER HOE
-\setXTXcharcodes "010C7 "010C7 "010C7 % GEORGIAN CAPITAL LETTER YN
-\setXTXcharcodes "010CD "010CD "010CD % GEORGIAN CAPITAL LETTER AEN
-\setXTXcharcodes "013F5 "013F5 "013F5 % CHEROKEE LETTER MV
-\setXTXcharcodes "013F8 "013F8 "013F8 % CHEROKEE SMALL LETTER YE
-\setXTXcharcodes "013F9 "013F9 "013F9 % CHEROKEE SMALL LETTER YI
-\setXTXcharcodes "013FA "013FA "013FA % CHEROKEE SMALL LETTER YO
-\setXTXcharcodes "013FB "013FB "013FB % CHEROKEE SMALL LETTER YU
-\setXTXcharcodes "013FC "013FC "013FC % CHEROKEE SMALL LETTER YV
-\setXTXcharcodes "013FD "013FD "013FD % CHEROKEE SMALL LETTER MV
-\setXTXcharcodes "01D00 "01D00 "01D00 % LATIN LETTER SMALL CAPITAL A
-\setXTXcharcodes "01D01 "01D01 "01D01 % LATIN LETTER SMALL CAPITAL AE
-\setXTXcharcodes "01D02 "01D02 "01D02 % LATIN SMALL LETTER TURNED AE
-\setXTXcharcodes "01D03 "01D03 "01D03 % LATIN LETTER SMALL CAPITAL BARRED B
-\setXTXcharcodes "01D04 "01D04 "01D04 % LATIN LETTER SMALL CAPITAL C
-\setXTXcharcodes "01D05 "01D05 "01D05 % LATIN LETTER SMALL CAPITAL D
-\setXTXcharcodes "01D06 "01D06 "01D06 % LATIN LETTER SMALL CAPITAL ETH
-\setXTXcharcodes "01D07 "01D07 "01D07 % LATIN LETTER SMALL CAPITAL E
-\setXTXcharcodes "01D08 "01D08 "01D08 % LATIN SMALL LETTER TURNED OPEN E
-\setXTXcharcodes "01D09 "01D09 "01D09 % LATIN SMALL LETTER TURNED I
-\setXTXcharcodes "01D0A "01D0A "01D0A % LATIN LETTER SMALL CAPITAL J
-\setXTXcharcodes "01D0B "01D0B "01D0B % LATIN LETTER SMALL CAPITAL K
-\setXTXcharcodes "01D0C "01D0C "01D0C % LATIN LETTER SMALL CAPITAL L WITH STROKE
-\setXTXcharcodes "01D0D "01D0D "01D0D % LATIN LETTER SMALL CAPITAL M
-\setXTXcharcodes "01D0E "01D0E "01D0E % LATIN LETTER SMALL CAPITAL REVERSED N
-\setXTXcharcodes "01D0F "01D0F "01D0F % LATIN LETTER SMALL CAPITAL O
-\setXTXcharcodes "01D10 "01D10 "01D10 % LATIN LETTER SMALL CAPITAL OPEN O
-\setXTXcharcodes "01D11 "01D11 "01D11 % LATIN SMALL LETTER SIDEWAYS O
-\setXTXcharcodes "01D12 "01D12 "01D12 % LATIN SMALL LETTER SIDEWAYS OPEN O
-\setXTXcharcodes "01D13 "01D13 "01D13 % LATIN SMALL LETTER SIDEWAYS O WITH STROKE
-\setXTXcharcodes "01D14 "01D14 "01D14 % LATIN SMALL LETTER TURNED OE
-\setXTXcharcodes "01D15 "01D15 "01D15 % LATIN LETTER SMALL CAPITAL OU
-\setXTXcharcodes "01D16 "01D16 "01D16 % LATIN SMALL LETTER TOP HALF O
-\setXTXcharcodes "01D17 "01D17 "01D17 % LATIN SMALL LETTER BOTTOM HALF O
-\setXTXcharcodes "01D18 "01D18 "01D18 % LATIN LETTER SMALL CAPITAL P
-\setXTXcharcodes "01D19 "01D19 "01D19 % LATIN LETTER SMALL CAPITAL REVERSED R
-\setXTXcharcodes "01D1A "01D1A "01D1A % LATIN LETTER SMALL CAPITAL TURNED R
-\setXTXcharcodes "01D1B "01D1B "01D1B % LATIN LETTER SMALL CAPITAL T
-\setXTXcharcodes "01D1C "01D1C "01D1C % LATIN LETTER SMALL CAPITAL U
-\setXTXcharcodes "01D1D "01D1D "01D1D % LATIN SMALL LETTER SIDEWAYS U
-\setXTXcharcodes "01D1E "01D1E "01D1E % LATIN SMALL LETTER SIDEWAYS DIAERESIZED U
-\setXTXcharcodes "01D1F "01D1F "01D1F % LATIN SMALL LETTER SIDEWAYS TURNED M
-\setXTXcharcodes "01D20 "01D20 "01D20 % LATIN LETTER SMALL CAPITAL V
-\setXTXcharcodes "01D21 "01D21 "01D21 % LATIN LETTER SMALL CAPITAL W
-\setXTXcharcodes "01D22 "01D22 "01D22 % LATIN LETTER SMALL CAPITAL Z
-\setXTXcharcodes "01D23 "01D23 "01D23 % LATIN LETTER SMALL CAPITAL EZH
-\setXTXcharcodes "01D24 "01D24 "01D24 % LATIN LETTER VOICED LARYNGEAL SPIRANT
-\setXTXcharcodes "01D25 "01D25 "01D25 % LATIN LETTER AIN
-\setXTXcharcodes "01D26 "01D26 "01D26 % GREEK LETTER SMALL CAPITAL GAMMA
-\setXTXcharcodes "01D27 "01D27 "01D27 % GREEK LETTER SMALL CAPITAL LAMDA
-\setXTXcharcodes "01D28 "01D28 "01D28 % GREEK LETTER SMALL CAPITAL PI
-\setXTXcharcodes "01D29 "01D29 "01D29 % GREEK LETTER SMALL CAPITAL RHO
-\setXTXcharcodes "01D2A "01D2A "01D2A % GREEK LETTER SMALL CAPITAL PSI
-\setXTXcharcodes "01D2B "01D2B "01D2B % CYRILLIC LETTER SMALL CAPITAL EL
-\setXTXcharcodes "01D62 "01D62 "01D62 % LATIN SUBSCRIPT SMALL LETTER I
-\setXTXcharcodes "01D63 "01D63 "01D63 % LATIN SUBSCRIPT SMALL LETTER R
-\setXTXcharcodes "01D64 "01D64 "01D64 % LATIN SUBSCRIPT SMALL LETTER U
-\setXTXcharcodes "01D65 "01D65 "01D65 % LATIN SUBSCRIPT SMALL LETTER V
-\setXTXcharcodes "01D66 "01D66 "01D66 % GREEK SUBSCRIPT SMALL LETTER BETA
-\setXTXcharcodes "01D67 "01D67 "01D67 % GREEK SUBSCRIPT SMALL LETTER GAMMA
-\setXTXcharcodes "01D68 "01D68 "01D68 % GREEK SUBSCRIPT SMALL LETTER RHO
-\setXTXcharcodes "01D69 "01D69 "01D69 % GREEK SUBSCRIPT SMALL LETTER PHI
-\setXTXcharcodes "01D6A "01D6A "01D6A % GREEK SUBSCRIPT SMALL LETTER CHI
-\setXTXcharcodes "01D6B "01D6B "01D6B % LATIN SMALL LETTER UE
-\setXTXcharcodes "01D6C "01D6C "01D6C % LATIN SMALL LETTER B WITH MIDDLE TILDE
-\setXTXcharcodes "01D6D "01D6D "01D6D % LATIN SMALL LETTER D WITH MIDDLE TILDE
-\setXTXcharcodes "01D6E "01D6E "01D6E % LATIN SMALL LETTER F WITH MIDDLE TILDE
-\setXTXcharcodes "01D6F "01D6F "01D6F % LATIN SMALL LETTER M WITH MIDDLE TILDE
-\setXTXcharcodes "01D70 "01D70 "01D70 % LATIN SMALL LETTER N WITH MIDDLE TILDE
-\setXTXcharcodes "01D71 "01D71 "01D71 % LATIN SMALL LETTER P WITH MIDDLE TILDE
-\setXTXcharcodes "01D72 "01D72 "01D72 % LATIN SMALL LETTER R WITH MIDDLE TILDE
-\setXTXcharcodes "01D73 "01D73 "01D73 % LATIN SMALL LETTER R WITH FISHHOOK AND MIDDLE TILDE
-\setXTXcharcodes "01D74 "01D74 "01D74 % LATIN SMALL LETTER S WITH MIDDLE TILDE
-\setXTXcharcodes "01D75 "01D75 "01D75 % LATIN SMALL LETTER T WITH MIDDLE TILDE
-\setXTXcharcodes "01D76 "01D76 "01D76 % LATIN SMALL LETTER Z WITH MIDDLE TILDE
-\setXTXcharcodes "01D77 "01D77 "01D77 % LATIN SMALL LETTER TURNED G
-\setXTXcharcodes "01D79 "01D79 "01D79 % LATIN SMALL LETTER INSULAR G
-\setXTXcharcodes "01D7A "01D7A "01D7A % LATIN SMALL LETTER TH WITH STRIKETHROUGH
-\setXTXcharcodes "01D7B "01D7B "01D7B % LATIN SMALL CAPITAL LETTER I WITH STROKE
-\setXTXcharcodes "01D7C "01D7C "01D7C % LATIN SMALL LETTER IOTA WITH STROKE
-\setXTXcharcodes "01D7D "01D7D "02C63 % LATIN SMALL LETTER P WITH STROKE
-\setXTXcharcodes "01D7E "01D7E "01D7E % LATIN SMALL CAPITAL LETTER U WITH STROKE
-\setXTXcharcodes "01D7F "01D7F "01D7F % LATIN SMALL LETTER UPSILON WITH STROKE
-\setXTXcharcodes "01D80 "01D80 "01D80 % LATIN SMALL LETTER B WITH PALATAL HOOK
-\setXTXcharcodes "01D81 "01D81 "01D81 % LATIN SMALL LETTER D WITH PALATAL HOOK
-\setXTXcharcodes "01D82 "01D82 "01D82 % LATIN SMALL LETTER F WITH PALATAL HOOK
-\setXTXcharcodes "01D83 "01D83 "01D83 % LATIN SMALL LETTER G WITH PALATAL HOOK
-\setXTXcharcodes "01D84 "01D84 "01D84 % LATIN SMALL LETTER K WITH PALATAL HOOK
-\setXTXcharcodes "01D85 "01D85 "01D85 % LATIN SMALL LETTER L WITH PALATAL HOOK
-\setXTXcharcodes "01D86 "01D86 "01D86 % LATIN SMALL LETTER M WITH PALATAL HOOK
-\setXTXcharcodes "01D87 "01D87 "01D87 % LATIN SMALL LETTER N WITH PALATAL HOOK
-\setXTXcharcodes "01D88 "01D88 "01D88 % LATIN SMALL LETTER P WITH PALATAL HOOK
-\setXTXcharcodes "01D89 "01D89 "01D89 % LATIN SMALL LETTER R WITH PALATAL HOOK
-\setXTXcharcodes "01D8A "01D8A "01D8A % LATIN SMALL LETTER S WITH PALATAL HOOK
-\setXTXcharcodes "01D8B "01D8B "01D8B % LATIN SMALL LETTER ESH WITH PALATAL HOOK
-\setXTXcharcodes "01D8C "01D8C "01D8C % LATIN SMALL LETTER V WITH PALATAL HOOK
-\setXTXcharcodes "01D8D "01D8D "01D8D % LATIN SMALL LETTER X WITH PALATAL HOOK
-\setXTXcharcodes "01D8E "01D8E "01D8E % LATIN SMALL LETTER Z WITH PALATAL HOOK
-\setXTXcharcodes "01D8F "01D8F "01D8F % LATIN SMALL LETTER A WITH RETROFLEX HOOK
-\setXTXcharcodes "01D90 "01D90 "01D90 % LATIN SMALL LETTER ALPHA WITH RETROFLEX HOOK
-\setXTXcharcodes "01D91 "01D91 "01D91 % LATIN SMALL LETTER D WITH HOOK AND TAIL
-\setXTXcharcodes "01D92 "01D92 "01D92 % LATIN SMALL LETTER E WITH RETROFLEX HOOK
-\setXTXcharcodes "01D93 "01D93 "01D93 % LATIN SMALL LETTER OPEN E WITH RETROFLEX HOOK
-\setXTXcharcodes "01D94 "01D94 "01D94 % LATIN SMALL LETTER REVERSED OPEN E WITH RETROFLEX HOOK
-\setXTXcharcodes "01D95 "01D95 "01D95 % LATIN SMALL LETTER SCHWA WITH RETROFLEX HOOK
-\setXTXcharcodes "01D96 "01D96 "01D96 % LATIN SMALL LETTER I WITH RETROFLEX HOOK
-\setXTXcharcodes "01D97 "01D97 "01D97 % LATIN SMALL LETTER OPEN O WITH RETROFLEX HOOK
-\setXTXcharcodes "01D98 "01D98 "01D98 % LATIN SMALL LETTER ESH WITH RETROFLEX HOOK
-\setXTXcharcodes "01D99 "01D99 "01D99 % LATIN SMALL LETTER U WITH RETROFLEX HOOK
-\setXTXcharcodes "01D9A "01D9A "01D9A % LATIN SMALL LETTER EZH WITH RETROFLEX HOOK
-\setXTXcharcodes "01E00 "01E01 "01E00 % LATIN CAPITAL LETTER A WITH RING BELOW
-\setXTXcharcodes "01E01 "01E01 "01E00 % LATIN SMALL LETTER A WITH RING BELOW
-\setXTXcharcodes "01E02 "01E03 "01E02 % LATIN CAPITAL LETTER B WITH DOT ABOVE
-\setXTXcharcodes "01E03 "01E03 "01E02 % LATIN SMALL LETTER B WITH DOT ABOVE
-\setXTXcharcodes "01E04 "01E05 "01E04 % LATIN CAPITAL LETTER B WITH DOT BELOW
-\setXTXcharcodes "01E05 "01E05 "01E04 % LATIN SMALL LETTER B WITH DOT BELOW
-\setXTXcharcodes "01E06 "01E07 "01E06 % LATIN CAPITAL LETTER B WITH LINE BELOW
-\setXTXcharcodes "01E07 "01E07 "01E06 % LATIN SMALL LETTER B WITH LINE BELOW
-\setXTXcharcodes "01E08 "01E09 "01E08 % LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
-\setXTXcharcodes "01E09 "01E09 "01E08 % LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
-\setXTXcharcodes "01E0A "01E0B "01E0A % LATIN CAPITAL LETTER D WITH DOT ABOVE
-\setXTXcharcodes "01E0B "01E0B "01E0A % LATIN SMALL LETTER D WITH DOT ABOVE
-\setXTXcharcodes "01E0C "01E0D "01E0C % LATIN CAPITAL LETTER D WITH DOT BELOW
-\setXTXcharcodes "01E0D "01E0D "01E0C % LATIN SMALL LETTER D WITH DOT BELOW
-\setXTXcharcodes "01E0E "01E0F "01E0E % LATIN CAPITAL LETTER D WITH LINE BELOW
-\setXTXcharcodes "01E0F "01E0F "01E0E % LATIN SMALL LETTER D WITH LINE BELOW
-\setXTXcharcodes "01E10 "01E11 "01E10 % LATIN CAPITAL LETTER D WITH CEDILLA
-\setXTXcharcodes "01E11 "01E11 "01E10 % LATIN SMALL LETTER D WITH CEDILLA
-\setXTXcharcodes "01E12 "01E13 "01E12 % LATIN CAPITAL LETTER D WITH CIRCUMFLEX BELOW
-\setXTXcharcodes "01E13 "01E13 "01E12 % LATIN SMALL LETTER D WITH CIRCUMFLEX BELOW
-\setXTXcharcodes "01E14 "01E15 "01E14 % LATIN CAPITAL LETTER E WITH MACRON AND GRAVE
-\setXTXcharcodes "01E15 "01E15 "01E14 % LATIN SMALL LETTER E WITH MACRON AND GRAVE
-\setXTXcharcodes "01E16 "01E17 "01E16 % LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
-\setXTXcharcodes "01E17 "01E17 "01E16 % LATIN SMALL LETTER E WITH MACRON AND ACUTE
-\setXTXcharcodes "01E18 "01E19 "01E18 % LATIN CAPITAL LETTER E WITH CIRCUMFLEX BELOW
-\setXTXcharcodes "01E19 "01E19 "01E18 % LATIN SMALL LETTER E WITH CIRCUMFLEX BELOW
-\setXTXcharcodes "01E1A "01E1B "01E1A % LATIN CAPITAL LETTER E WITH TILDE BELOW
-\setXTXcharcodes "01E1B "01E1B "01E1A % LATIN SMALL LETTER E WITH TILDE BELOW
-\setXTXcharcodes "01E1C "01E1D "01E1C % LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
-\setXTXcharcodes "01E1D "01E1D "01E1C % LATIN SMALL LETTER E WITH CEDILLA AND BREVE
-\setXTXcharcodes "01E1E "01E1F "01E1E % LATIN CAPITAL LETTER F WITH DOT ABOVE
-\setXTXcharcodes "01E1F "01E1F "01E1E % LATIN SMALL LETTER F WITH DOT ABOVE
-\setXTXcharcodes "01E20 "01E21 "01E20 % LATIN CAPITAL LETTER G WITH MACRON
-\setXTXcharcodes "01E21 "01E21 "01E20 % LATIN SMALL LETTER G WITH MACRON
-\setXTXcharcodes "01E22 "01E23 "01E22 % LATIN CAPITAL LETTER H WITH DOT ABOVE
-\setXTXcharcodes "01E23 "01E23 "01E22 % LATIN SMALL LETTER H WITH DOT ABOVE
-\setXTXcharcodes "01E24 "01E25 "01E24 % LATIN CAPITAL LETTER H WITH DOT BELOW
-\setXTXcharcodes "01E25 "01E25 "01E24 % LATIN SMALL LETTER H WITH DOT BELOW
-\setXTXcharcodes "01E26 "01E27 "01E26 % LATIN CAPITAL LETTER H WITH DIAERESIS
-\setXTXcharcodes "01E27 "01E27 "01E26 % LATIN SMALL LETTER H WITH DIAERESIS
-\setXTXcharcodes "01E28 "01E29 "01E28 % LATIN CAPITAL LETTER H WITH CEDILLA
-\setXTXcharcodes "01E29 "01E29 "01E28 % LATIN SMALL LETTER H WITH CEDILLA
-\setXTXcharcodes "01E2A "01E2B "01E2A % LATIN CAPITAL LETTER H WITH BREVE BELOW
-\setXTXcharcodes "01E2B "01E2B "01E2A % LATIN SMALL LETTER H WITH BREVE BELOW
-\setXTXcharcodes "01E2C "01E2D "01E2C % LATIN CAPITAL LETTER I WITH TILDE BELOW
-\setXTXcharcodes "01E2D "01E2D "01E2C % LATIN SMALL LETTER I WITH TILDE BELOW
-\setXTXcharcodes "01E2E "01E2F "01E2E % LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE
-\setXTXcharcodes "01E2F "01E2F "01E2E % LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
-\setXTXcharcodes "01E30 "01E31 "01E30 % LATIN CAPITAL LETTER K WITH ACUTE
-\setXTXcharcodes "01E31 "01E31 "01E30 % LATIN SMALL LETTER K WITH ACUTE
-\setXTXcharcodes "01E32 "01E33 "01E32 % LATIN CAPITAL LETTER K WITH DOT BELOW
-\setXTXcharcodes "01E33 "01E33 "01E32 % LATIN SMALL LETTER K WITH DOT BELOW
-\setXTXcharcodes "01E34 "01E35 "01E34 % LATIN CAPITAL LETTER K WITH LINE BELOW
-\setXTXcharcodes "01E35 "01E35 "01E34 % LATIN SMALL LETTER K WITH LINE BELOW
-\setXTXcharcodes "01E36 "01E37 "01E36 % LATIN CAPITAL LETTER L WITH DOT BELOW
-\setXTXcharcodes "01E37 "01E37 "01E36 % LATIN SMALL LETTER L WITH DOT BELOW
-\setXTXcharcodes "01E38 "01E39 "01E38 % LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON
-\setXTXcharcodes "01E39 "01E39 "01E38 % LATIN SMALL LETTER L WITH DOT BELOW AND MACRON
-\setXTXcharcodes "01E3A "01E3B "01E3A % LATIN CAPITAL LETTER L WITH LINE BELOW
-\setXTXcharcodes "01E3B "01E3B "01E3A % LATIN SMALL LETTER L WITH LINE BELOW
-\setXTXcharcodes "01E3C "01E3D "01E3C % LATIN CAPITAL LETTER L WITH CIRCUMFLEX BELOW
-\setXTXcharcodes "01E3D "01E3D "01E3C % LATIN SMALL LETTER L WITH CIRCUMFLEX BELOW
-\setXTXcharcodes "01E3E "01E3F "01E3E % LATIN CAPITAL LETTER M WITH ACUTE
-\setXTXcharcodes "01E3F "01E3F "01E3E % LATIN SMALL LETTER M WITH ACUTE
-\setXTXcharcodes "01E40 "01E41 "01E40 % LATIN CAPITAL LETTER M WITH DOT ABOVE
-\setXTXcharcodes "01E41 "01E41 "01E40 % LATIN SMALL LETTER M WITH DOT ABOVE
-\setXTXcharcodes "01E42 "01E43 "01E42 % LATIN CAPITAL LETTER M WITH DOT BELOW
-\setXTXcharcodes "01E43 "01E43 "01E42 % LATIN SMALL LETTER M WITH DOT BELOW
-\setXTXcharcodes "01E44 "01E45 "01E44 % LATIN CAPITAL LETTER N WITH DOT ABOVE
-\setXTXcharcodes "01E45 "01E45 "01E44 % LATIN SMALL LETTER N WITH DOT ABOVE
-\setXTXcharcodes "01E46 "01E47 "01E46 % LATIN CAPITAL LETTER N WITH DOT BELOW
-\setXTXcharcodes "01E47 "01E47 "01E46 % LATIN SMALL LETTER N WITH DOT BELOW
-\setXTXcharcodes "01E48 "01E49 "01E48 % LATIN CAPITAL LETTER N WITH LINE BELOW
-\setXTXcharcodes "01E49 "01E49 "01E48 % LATIN SMALL LETTER N WITH LINE BELOW
-\setXTXcharcodes "01E4A "01E4B "01E4A % LATIN CAPITAL LETTER N WITH CIRCUMFLEX BELOW
-\setXTXcharcodes "01E4B "01E4B "01E4A % LATIN SMALL LETTER N WITH CIRCUMFLEX BELOW
-\setXTXcharcodes "01E4C "01E4D "01E4C % LATIN CAPITAL LETTER O WITH TILDE AND ACUTE
-\setXTXcharcodes "01E4D "01E4D "01E4C % LATIN SMALL LETTER O WITH TILDE AND ACUTE
-\setXTXcharcodes "01E4E "01E4F "01E4E % LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS
-\setXTXcharcodes "01E4F "01E4F "01E4E % LATIN SMALL LETTER O WITH TILDE AND DIAERESIS
-\setXTXcharcodes "01E50 "01E51 "01E50 % LATIN CAPITAL LETTER O WITH MACRON AND GRAVE
-\setXTXcharcodes "01E51 "01E51 "01E50 % LATIN SMALL LETTER O WITH MACRON AND GRAVE
-\setXTXcharcodes "01E52 "01E53 "01E52 % LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
-\setXTXcharcodes "01E53 "01E53 "01E52 % LATIN SMALL LETTER O WITH MACRON AND ACUTE
-\setXTXcharcodes "01E54 "01E55 "01E54 % LATIN CAPITAL LETTER P WITH ACUTE
-\setXTXcharcodes "01E55 "01E55 "01E54 % LATIN SMALL LETTER P WITH ACUTE
-\setXTXcharcodes "01E56 "01E57 "01E56 % LATIN CAPITAL LETTER P WITH DOT ABOVE
-\setXTXcharcodes "01E57 "01E57 "01E56 % LATIN SMALL LETTER P WITH DOT ABOVE
-\setXTXcharcodes "01E58 "01E59 "01E58 % LATIN CAPITAL LETTER R WITH DOT ABOVE
-\setXTXcharcodes "01E59 "01E59 "01E58 % LATIN SMALL LETTER R WITH DOT ABOVE
-\setXTXcharcodes "01E5A "01E5B "01E5A % LATIN CAPITAL LETTER R WITH DOT BELOW
-\setXTXcharcodes "01E5B "01E5B "01E5A % LATIN SMALL LETTER R WITH DOT BELOW
-\setXTXcharcodes "01E5C "01E5D "01E5C % LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON
-\setXTXcharcodes "01E5D "01E5D "01E5C % LATIN SMALL LETTER R WITH DOT BELOW AND MACRON
-\setXTXcharcodes "01E5E "01E5F "01E5E % LATIN CAPITAL LETTER R WITH LINE BELOW
-\setXTXcharcodes "01E5F "01E5F "01E5E % LATIN SMALL LETTER R WITH LINE BELOW
-\setXTXcharcodes "01E60 "01E61 "01E60 % LATIN CAPITAL LETTER S WITH DOT ABOVE
-\setXTXcharcodes "01E61 "01E61 "01E60 % LATIN SMALL LETTER S WITH DOT ABOVE
-\setXTXcharcodes "01E62 "01E63 "01E62 % LATIN CAPITAL LETTER S WITH DOT BELOW
-\setXTXcharcodes "01E63 "01E63 "01E62 % LATIN SMALL LETTER S WITH DOT BELOW
-\setXTXcharcodes "01E64 "01E65 "01E64 % LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE
-\setXTXcharcodes "01E65 "01E65 "01E64 % LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE
-\setXTXcharcodes "01E66 "01E67 "01E66 % LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE
-\setXTXcharcodes "01E67 "01E67 "01E66 % LATIN SMALL LETTER S WITH CARON AND DOT ABOVE
-\setXTXcharcodes "01E68 "01E69 "01E68 % LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE
-\setXTXcharcodes "01E69 "01E69 "01E68 % LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE
-\setXTXcharcodes "01E6A "01E6B "01E6A % LATIN CAPITAL LETTER T WITH DOT ABOVE
-\setXTXcharcodes "01E6B "01E6B "01E6A % LATIN SMALL LETTER T WITH DOT ABOVE
-\setXTXcharcodes "01E6C "01E6D "01E6C % LATIN CAPITAL LETTER T WITH DOT BELOW
-\setXTXcharcodes "01E6D "01E6D "01E6C % LATIN SMALL LETTER T WITH DOT BELOW
-\setXTXcharcodes "01E6E "01E6F "01E6E % LATIN CAPITAL LETTER T WITH LINE BELOW
-\setXTXcharcodes "01E6F "01E6F "01E6E % LATIN SMALL LETTER T WITH LINE BELOW
-\setXTXcharcodes "01E70 "01E71 "01E70 % LATIN CAPITAL LETTER T WITH CIRCUMFLEX BELOW
-\setXTXcharcodes "01E71 "01E71 "01E70 % LATIN SMALL LETTER T WITH CIRCUMFLEX BELOW
-\setXTXcharcodes "01E72 "01E73 "01E72 % LATIN CAPITAL LETTER U WITH DIAERESIS BELOW
-\setXTXcharcodes "01E73 "01E73 "01E72 % LATIN SMALL LETTER U WITH DIAERESIS BELOW
-\setXTXcharcodes "01E74 "01E75 "01E74 % LATIN CAPITAL LETTER U WITH TILDE BELOW
-\setXTXcharcodes "01E75 "01E75 "01E74 % LATIN SMALL LETTER U WITH TILDE BELOW
-\setXTXcharcodes "01E76 "01E77 "01E76 % LATIN CAPITAL LETTER U WITH CIRCUMFLEX BELOW
-\setXTXcharcodes "01E77 "01E77 "01E76 % LATIN SMALL LETTER U WITH CIRCUMFLEX BELOW
-\setXTXcharcodes "01E78 "01E79 "01E78 % LATIN CAPITAL LETTER U WITH TILDE AND ACUTE
-\setXTXcharcodes "01E79 "01E79 "01E78 % LATIN SMALL LETTER U WITH TILDE AND ACUTE
-\setXTXcharcodes "01E7A "01E7B "01E7A % LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS
-\setXTXcharcodes "01E7B "01E7B "01E7A % LATIN SMALL LETTER U WITH MACRON AND DIAERESIS
-\setXTXcharcodes "01E7C "01E7D "01E7C % LATIN CAPITAL LETTER V WITH TILDE
-\setXTXcharcodes "01E7D "01E7D "01E7C % LATIN SMALL LETTER V WITH TILDE
-\setXTXcharcodes "01E7E "01E7F "01E7E % LATIN CAPITAL LETTER V WITH DOT BELOW
-\setXTXcharcodes "01E7F "01E7F "01E7E % LATIN SMALL LETTER V WITH DOT BELOW
-\setXTXcharcodes "01E80 "01E81 "01E80 % LATIN CAPITAL LETTER W WITH GRAVE
-\setXTXcharcodes "01E81 "01E81 "01E80 % LATIN SMALL LETTER W WITH GRAVE
-\setXTXcharcodes "01E82 "01E83 "01E82 % LATIN CAPITAL LETTER W WITH ACUTE
-\setXTXcharcodes "01E83 "01E83 "01E82 % LATIN SMALL LETTER W WITH ACUTE
-\setXTXcharcodes "01E84 "01E85 "01E84 % LATIN CAPITAL LETTER W WITH DIAERESIS
-\setXTXcharcodes "01E85 "01E85 "01E84 % LATIN SMALL LETTER W WITH DIAERESIS
-\setXTXcharcodes "01E86 "01E87 "01E86 % LATIN CAPITAL LETTER W WITH DOT ABOVE
-\setXTXcharcodes "01E87 "01E87 "01E86 % LATIN SMALL LETTER W WITH DOT ABOVE
-\setXTXcharcodes "01E88 "01E89 "01E88 % LATIN CAPITAL LETTER W WITH DOT BELOW
-\setXTXcharcodes "01E89 "01E89 "01E88 % LATIN SMALL LETTER W WITH DOT BELOW
-\setXTXcharcodes "01E8A "01E8B "01E8A % LATIN CAPITAL LETTER X WITH DOT ABOVE
-\setXTXcharcodes "01E8B "01E8B "01E8A % LATIN SMALL LETTER X WITH DOT ABOVE
-\setXTXcharcodes "01E8C "01E8D "01E8C % LATIN CAPITAL LETTER X WITH DIAERESIS
-\setXTXcharcodes "01E8D "01E8D "01E8C % LATIN SMALL LETTER X WITH DIAERESIS
-\setXTXcharcodes "01E8E "01E8F "01E8E % LATIN CAPITAL LETTER Y WITH DOT ABOVE
-\setXTXcharcodes "01E8F "01E8F "01E8E % LATIN SMALL LETTER Y WITH DOT ABOVE
-\setXTXcharcodes "01E90 "01E91 "01E90 % LATIN CAPITAL LETTER Z WITH CIRCUMFLEX
-\setXTXcharcodes "01E91 "01E91 "01E90 % LATIN SMALL LETTER Z WITH CIRCUMFLEX
-\setXTXcharcodes "01E92 "01E93 "01E92 % LATIN CAPITAL LETTER Z WITH DOT BELOW
-\setXTXcharcodes "01E93 "01E93 "01E92 % LATIN SMALL LETTER Z WITH DOT BELOW
-\setXTXcharcodes "01E94 "01E95 "01E94 % LATIN CAPITAL LETTER Z WITH LINE BELOW
-\setXTXcharcodes "01E95 "01E95 "01E94 % LATIN SMALL LETTER Z WITH LINE BELOW
-\setXTXcharcodes "01E96 "01E96 "01E96 % LATIN SMALL LETTER H WITH LINE BELOW
-\setXTXcharcodes "01E97 "01E97 "01E97 % LATIN SMALL LETTER T WITH DIAERESIS
-\setXTXcharcodes "01E98 "01E98 "01E98 % LATIN SMALL LETTER W WITH RING ABOVE
-\setXTXcharcodes "01E99 "01E99 "01E99 % LATIN SMALL LETTER Y WITH RING ABOVE
-\setXTXcharcodes "01E9A "01E9A "01E9A % LATIN SMALL LETTER A WITH RIGHT HALF RING
-\setXTXcharcodes "01E9B "01E9B "01E60 % LATIN SMALL LETTER LONG S WITH DOT ABOVE
-\setXTXcharcodes "01E9C "01E9C "01E9C % LATIN SMALL LETTER LONG S WITH DIAGONAL STROKE
-\setXTXcharcodes "01E9D "01E9D "01E9D % LATIN SMALL LETTER LONG S WITH HIGH STROKE
-\setXTXcharcodes "01E9E "01E9E "01E9E % LATIN CAPITAL LETTER SHARP S
-\setXTXcharcodes "01E9F "01E9F "01E9F % LATIN SMALL LETTER DELTA
-\setXTXcharcodes "01EA0 "01EA1 "01EA0 % LATIN CAPITAL LETTER A WITH DOT BELOW
-\setXTXcharcodes "01EA1 "01EA1 "01EA0 % LATIN SMALL LETTER A WITH DOT BELOW
-\setXTXcharcodes "01EA2 "01EA3 "01EA2 % LATIN CAPITAL LETTER A WITH HOOK ABOVE
-\setXTXcharcodes "01EA3 "01EA3 "01EA2 % LATIN SMALL LETTER A WITH HOOK ABOVE
-\setXTXcharcodes "01EA4 "01EA5 "01EA4 % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
-\setXTXcharcodes "01EA5 "01EA5 "01EA4 % LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
-\setXTXcharcodes "01EA6 "01EA7 "01EA6 % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE
-\setXTXcharcodes "01EA7 "01EA7 "01EA6 % LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE
-\setXTXcharcodes "01EA8 "01EA9 "01EA8 % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
-\setXTXcharcodes "01EA9 "01EA9 "01EA8 % LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
-\setXTXcharcodes "01EAA "01EAB "01EAA % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE
-\setXTXcharcodes "01EAB "01EAB "01EAA % LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE
-\setXTXcharcodes "01EAC "01EAD "01EAC % LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW
-\setXTXcharcodes "01EAD "01EAD "01EAC % LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW
-\setXTXcharcodes "01EAE "01EAF "01EAE % LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
-\setXTXcharcodes "01EAF "01EAF "01EAE % LATIN SMALL LETTER A WITH BREVE AND ACUTE
-\setXTXcharcodes "01EB0 "01EB1 "01EB0 % LATIN CAPITAL LETTER A WITH BREVE AND GRAVE
-\setXTXcharcodes "01EB1 "01EB1 "01EB0 % LATIN SMALL LETTER A WITH BREVE AND GRAVE
-\setXTXcharcodes "01EB2 "01EB3 "01EB2 % LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE
-\setXTXcharcodes "01EB3 "01EB3 "01EB2 % LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE
-\setXTXcharcodes "01EB4 "01EB5 "01EB4 % LATIN CAPITAL LETTER A WITH BREVE AND TILDE
-\setXTXcharcodes "01EB5 "01EB5 "01EB4 % LATIN SMALL LETTER A WITH BREVE AND TILDE
-\setXTXcharcodes "01EB6 "01EB7 "01EB6 % LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
-\setXTXcharcodes "01EB7 "01EB7 "01EB6 % LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
-\setXTXcharcodes "01EB8 "01EB9 "01EB8 % LATIN CAPITAL LETTER E WITH DOT BELOW
-\setXTXcharcodes "01EB9 "01EB9 "01EB8 % LATIN SMALL LETTER E WITH DOT BELOW
-\setXTXcharcodes "01EBA "01EBB "01EBA % LATIN CAPITAL LETTER E WITH HOOK ABOVE
-\setXTXcharcodes "01EBB "01EBB "01EBA % LATIN SMALL LETTER E WITH HOOK ABOVE
-\setXTXcharcodes "01EBC "01EBD "01EBC % LATIN CAPITAL LETTER E WITH TILDE
-\setXTXcharcodes "01EBD "01EBD "01EBC % LATIN SMALL LETTER E WITH TILDE
-\setXTXcharcodes "01EBE "01EBF "01EBE % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
-\setXTXcharcodes "01EBF "01EBF "01EBE % LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
-\setXTXcharcodes "01EC0 "01EC1 "01EC0 % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE
-\setXTXcharcodes "01EC1 "01EC1 "01EC0 % LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE
-\setXTXcharcodes "01EC2 "01EC3 "01EC2 % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
-\setXTXcharcodes "01EC3 "01EC3 "01EC2 % LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
-\setXTXcharcodes "01EC4 "01EC5 "01EC4 % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE
-\setXTXcharcodes "01EC5 "01EC5 "01EC4 % LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE
-\setXTXcharcodes "01EC6 "01EC7 "01EC6 % LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW
-\setXTXcharcodes "01EC7 "01EC7 "01EC6 % LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW
-\setXTXcharcodes "01EC8 "01EC9 "01EC8 % LATIN CAPITAL LETTER I WITH HOOK ABOVE
-\setXTXcharcodes "01EC9 "01EC9 "01EC8 % LATIN SMALL LETTER I WITH HOOK ABOVE
-\setXTXcharcodes "01ECA "01ECB "01ECA % LATIN CAPITAL LETTER I WITH DOT BELOW
-\setXTXcharcodes "01ECB "01ECB "01ECA % LATIN SMALL LETTER I WITH DOT BELOW
-\setXTXcharcodes "01ECC "01ECD "01ECC % LATIN CAPITAL LETTER O WITH DOT BELOW
-\setXTXcharcodes "01ECD "01ECD "01ECC % LATIN SMALL LETTER O WITH DOT BELOW
-\setXTXcharcodes "01ECE "01ECF "01ECE % LATIN CAPITAL LETTER O WITH HOOK ABOVE
-\setXTXcharcodes "01ECF "01ECF "01ECE % LATIN SMALL LETTER O WITH HOOK ABOVE
-\setXTXcharcodes "01ED0 "01ED1 "01ED0 % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
-\setXTXcharcodes "01ED1 "01ED1 "01ED0 % LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
-\setXTXcharcodes "01ED2 "01ED3 "01ED2 % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE
-\setXTXcharcodes "01ED3 "01ED3 "01ED2 % LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE
-\setXTXcharcodes "01ED4 "01ED5 "01ED4 % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
-\setXTXcharcodes "01ED5 "01ED5 "01ED4 % LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
-\setXTXcharcodes "01ED6 "01ED7 "01ED6 % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE
-\setXTXcharcodes "01ED7 "01ED7 "01ED6 % LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE
-\setXTXcharcodes "01ED8 "01ED9 "01ED8 % LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW
-\setXTXcharcodes "01ED9 "01ED9 "01ED8 % LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW
-\setXTXcharcodes "01EDA "01EDB "01EDA % LATIN CAPITAL LETTER O WITH HORN AND ACUTE
-\setXTXcharcodes "01EDB "01EDB "01EDA % LATIN SMALL LETTER O WITH HORN AND ACUTE
-\setXTXcharcodes "01EDC "01EDD "01EDC % LATIN CAPITAL LETTER O WITH HORN AND GRAVE
-\setXTXcharcodes "01EDD "01EDD "01EDC % LATIN SMALL LETTER O WITH HORN AND GRAVE
-\setXTXcharcodes "01EDE "01EDF "01EDE % LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE
-\setXTXcharcodes "01EDF "01EDF "01EDE % LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE
-\setXTXcharcodes "01EE0 "01EE1 "01EE0 % LATIN CAPITAL LETTER O WITH HORN AND TILDE
-\setXTXcharcodes "01EE1 "01EE1 "01EE0 % LATIN SMALL LETTER O WITH HORN AND TILDE
-\setXTXcharcodes "01EE2 "01EE3 "01EE2 % LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW
-\setXTXcharcodes "01EE3 "01EE3 "01EE2 % LATIN SMALL LETTER O WITH HORN AND DOT BELOW
-\setXTXcharcodes "01EE4 "01EE5 "01EE4 % LATIN CAPITAL LETTER U WITH DOT BELOW
-\setXTXcharcodes "01EE5 "01EE5 "01EE4 % LATIN SMALL LETTER U WITH DOT BELOW
-\setXTXcharcodes "01EE6 "01EE7 "01EE6 % LATIN CAPITAL LETTER U WITH HOOK ABOVE
-\setXTXcharcodes "01EE7 "01EE7 "01EE6 % LATIN SMALL LETTER U WITH HOOK ABOVE
-\setXTXcharcodes "01EE8 "01EE9 "01EE8 % LATIN CAPITAL LETTER U WITH HORN AND ACUTE
-\setXTXcharcodes "01EE9 "01EE9 "01EE8 % LATIN SMALL LETTER U WITH HORN AND ACUTE
-\setXTXcharcodes "01EEA "01EEB "01EEA % LATIN CAPITAL LETTER U WITH HORN AND GRAVE
-\setXTXcharcodes "01EEB "01EEB "01EEA % LATIN SMALL LETTER U WITH HORN AND GRAVE
-\setXTXcharcodes "01EEC "01EED "01EEC % LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE
-\setXTXcharcodes "01EED "01EED "01EEC % LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE
-\setXTXcharcodes "01EEE "01EEF "01EEE % LATIN CAPITAL LETTER U WITH HORN AND TILDE
-\setXTXcharcodes "01EEF "01EEF "01EEE % LATIN SMALL LETTER U WITH HORN AND TILDE
-\setXTXcharcodes "01EF0 "01EF1 "01EF0 % LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW
-\setXTXcharcodes "01EF1 "01EF1 "01EF0 % LATIN SMALL LETTER U WITH HORN AND DOT BELOW
-\setXTXcharcodes "01EF2 "01EF3 "01EF2 % LATIN CAPITAL LETTER Y WITH GRAVE
-\setXTXcharcodes "01EF3 "01EF3 "01EF2 % LATIN SMALL LETTER Y WITH GRAVE
-\setXTXcharcodes "01EF4 "01EF5 "01EF4 % LATIN CAPITAL LETTER Y WITH DOT BELOW
-\setXTXcharcodes "01EF5 "01EF5 "01EF4 % LATIN SMALL LETTER Y WITH DOT BELOW
-\setXTXcharcodes "01EF6 "01EF7 "01EF6 % LATIN CAPITAL LETTER Y WITH HOOK ABOVE
-\setXTXcharcodes "01EF7 "01EF7 "01EF6 % LATIN SMALL LETTER Y WITH HOOK ABOVE
-\setXTXcharcodes "01EF8 "01EF9 "01EF8 % LATIN CAPITAL LETTER Y WITH TILDE
-\setXTXcharcodes "01EF9 "01EF9 "01EF8 % LATIN SMALL LETTER Y WITH TILDE
-\setXTXcharcodes "01EFA "01EFA "01EFA % LATIN CAPITAL LETTER MIDDLE-WELSH LL
-\setXTXcharcodes "01EFB "01EFB "01EFB % LATIN SMALL LETTER MIDDLE-WELSH LL
-\setXTXcharcodes "01EFC "01EFC "01EFC % LATIN CAPITAL LETTER MIDDLE-WELSH V
-\setXTXcharcodes "01EFD "01EFD "01EFD % LATIN SMALL LETTER MIDDLE-WELSH V
-\setXTXcharcodes "01EFE "01EFE "01EFE % LATIN CAPITAL LETTER Y WITH LOOP
-\setXTXcharcodes "01EFF "01EFF "01EFF % LATIN SMALL LETTER Y WITH LOOP
-\setXTXcharcodes "01F00 "01F00 "01F08 % GREEK SMALL LETTER ALPHA WITH PSILI
-\setXTXcharcodes "01F01 "01F01 "01F09 % GREEK SMALL LETTER ALPHA WITH DASIA
-\setXTXcharcodes "01F02 "01F02 "01F0A % GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA
-\setXTXcharcodes "01F03 "01F03 "01F0B % GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA
-\setXTXcharcodes "01F04 "01F04 "01F0C % GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA
-\setXTXcharcodes "01F05 "01F05 "01F0D % GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA
-\setXTXcharcodes "01F06 "01F06 "01F0E % GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI
-\setXTXcharcodes "01F07 "01F07 "01F0F % GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI
-\setXTXcharcodes "01F08 "01F00 "01F08 % GREEK CAPITAL LETTER ALPHA WITH PSILI
-\setXTXcharcodes "01F09 "01F01 "01F09 % GREEK CAPITAL LETTER ALPHA WITH DASIA
-\setXTXcharcodes "01F0A "01F02 "01F0A % GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA
-\setXTXcharcodes "01F0B "01F03 "01F0B % GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA
-\setXTXcharcodes "01F0C "01F04 "01F0C % GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA
-\setXTXcharcodes "01F0D "01F05 "01F0D % GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA
-\setXTXcharcodes "01F0E "01F06 "01F0E % GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI
-\setXTXcharcodes "01F0F "01F07 "01F0F % GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI
-\setXTXcharcodes "01F10 "01F10 "01F18 % GREEK SMALL LETTER EPSILON WITH PSILI
-\setXTXcharcodes "01F11 "01F11 "01F19 % GREEK SMALL LETTER EPSILON WITH DASIA
-\setXTXcharcodes "01F12 "01F12 "01F1A % GREEK SMALL LETTER EPSILON WITH PSILI AND VARIA
-\setXTXcharcodes "01F13 "01F13 "01F1B % GREEK SMALL LETTER EPSILON WITH DASIA AND VARIA
-\setXTXcharcodes "01F14 "01F14 "01F1C % GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA
-\setXTXcharcodes "01F15 "01F15 "01F1D % GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA
-\setXTXcharcodes "01F18 "01F10 "01F18 % GREEK CAPITAL LETTER EPSILON WITH PSILI
-\setXTXcharcodes "01F19 "01F11 "01F19 % GREEK CAPITAL LETTER EPSILON WITH DASIA
-\setXTXcharcodes "01F1A "01F12 "01F1A % GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA
-\setXTXcharcodes "01F1B "01F13 "01F1B % GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA
-\setXTXcharcodes "01F1C "01F14 "01F1C % GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA
-\setXTXcharcodes "01F1D "01F15 "01F1D % GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA
-\setXTXcharcodes "01F20 "01F20 "01F28 % GREEK SMALL LETTER ETA WITH PSILI
-\setXTXcharcodes "01F21 "01F21 "01F29 % GREEK SMALL LETTER ETA WITH DASIA
-\setXTXcharcodes "01F22 "01F22 "01F2A % GREEK SMALL LETTER ETA WITH PSILI AND VARIA
-\setXTXcharcodes "01F23 "01F23 "01F2B % GREEK SMALL LETTER ETA WITH DASIA AND VARIA
-\setXTXcharcodes "01F24 "01F24 "01F2C % GREEK SMALL LETTER ETA WITH PSILI AND OXIA
-\setXTXcharcodes "01F25 "01F25 "01F2D % GREEK SMALL LETTER ETA WITH DASIA AND OXIA
-\setXTXcharcodes "01F26 "01F26 "01F2E % GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI
-\setXTXcharcodes "01F27 "01F27 "01F2F % GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI
-\setXTXcharcodes "01F28 "01F20 "01F28 % GREEK CAPITAL LETTER ETA WITH PSILI
-\setXTXcharcodes "01F29 "01F21 "01F29 % GREEK CAPITAL LETTER ETA WITH DASIA
-\setXTXcharcodes "01F2A "01F22 "01F2A % GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA
-\setXTXcharcodes "01F2B "01F23 "01F2B % GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA
-\setXTXcharcodes "01F2C "01F24 "01F2C % GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA
-\setXTXcharcodes "01F2D "01F25 "01F2D % GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA
-\setXTXcharcodes "01F2E "01F26 "01F2E % GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI
-\setXTXcharcodes "01F2F "01F27 "01F2F % GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI
-\setXTXcharcodes "01F30 "01F30 "01F38 % GREEK SMALL LETTER IOTA WITH PSILI
-\setXTXcharcodes "01F31 "01F31 "01F39 % GREEK SMALL LETTER IOTA WITH DASIA
-\setXTXcharcodes "01F32 "01F32 "01F3A % GREEK SMALL LETTER IOTA WITH PSILI AND VARIA
-\setXTXcharcodes "01F33 "01F33 "01F3B % GREEK SMALL LETTER IOTA WITH DASIA AND VARIA
-\setXTXcharcodes "01F34 "01F34 "01F3C % GREEK SMALL LETTER IOTA WITH PSILI AND OXIA
-\setXTXcharcodes "01F35 "01F35 "01F3D % GREEK SMALL LETTER IOTA WITH DASIA AND OXIA
-\setXTXcharcodes "01F36 "01F36 "01F3E % GREEK SMALL LETTER IOTA WITH PSILI AND PERISPOMENI
-\setXTXcharcodes "01F37 "01F37 "01F3F % GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI
-\setXTXcharcodes "01F38 "01F30 "01F38 % GREEK CAPITAL LETTER IOTA WITH PSILI
-\setXTXcharcodes "01F39 "01F31 "01F39 % GREEK CAPITAL LETTER IOTA WITH DASIA
-\setXTXcharcodes "01F3A "01F32 "01F3A % GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA
-\setXTXcharcodes "01F3B "01F33 "01F3B % GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA
-\setXTXcharcodes "01F3C "01F34 "01F3C % GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA
-\setXTXcharcodes "01F3D "01F35 "01F3D % GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA
-\setXTXcharcodes "01F3E "01F36 "01F3E % GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI
-\setXTXcharcodes "01F3F "01F37 "01F3F % GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI
-\setXTXcharcodes "01F40 "01F40 "01F48 % GREEK SMALL LETTER OMICRON WITH PSILI
-\setXTXcharcodes "01F41 "01F41 "01F49 % GREEK SMALL LETTER OMICRON WITH DASIA
-\setXTXcharcodes "01F42 "01F42 "01F4A % GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA
-\setXTXcharcodes "01F43 "01F43 "01F4B % GREEK SMALL LETTER OMICRON WITH DASIA AND VARIA
-\setXTXcharcodes "01F44 "01F44 "01F4C % GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA
-\setXTXcharcodes "01F45 "01F45 "01F4D % GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA
-\setXTXcharcodes "01F48 "01F40 "01F48 % GREEK CAPITAL LETTER OMICRON WITH PSILI
-\setXTXcharcodes "01F49 "01F41 "01F49 % GREEK CAPITAL LETTER OMICRON WITH DASIA
-\setXTXcharcodes "01F4A "01F42 "01F4A % GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA
-\setXTXcharcodes "01F4B "01F43 "01F4B % GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA
-\setXTXcharcodes "01F4C "01F44 "01F4C % GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA
-\setXTXcharcodes "01F4D "01F45 "01F4D % GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA
-\setXTXcharcodes "01F50 "01F50 "01F50 % GREEK SMALL LETTER UPSILON WITH PSILI
-\setXTXcharcodes "01F51 "01F51 "01F59 % GREEK SMALL LETTER UPSILON WITH DASIA
-\setXTXcharcodes "01F52 "01F52 "01F52 % GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA
-\setXTXcharcodes "01F53 "01F53 "01F5B % GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA
-\setXTXcharcodes "01F54 "01F54 "01F54 % GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA
-\setXTXcharcodes "01F55 "01F55 "01F5D % GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA
-\setXTXcharcodes "01F56 "01F56 "01F56 % GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI
-\setXTXcharcodes "01F57 "01F57 "01F5F % GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI
-\setXTXcharcodes "01F59 "01F51 "01F59 % GREEK CAPITAL LETTER UPSILON WITH DASIA
-\setXTXcharcodes "01F5B "01F53 "01F5B % GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA
-\setXTXcharcodes "01F5D "01F55 "01F5D % GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA
-\setXTXcharcodes "01F5F "01F57 "01F5F % GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI
-\setXTXcharcodes "01F60 "01F60 "01F68 % GREEK SMALL LETTER OMEGA WITH PSILI
-\setXTXcharcodes "01F61 "01F61 "01F69 % GREEK SMALL LETTER OMEGA WITH DASIA
-\setXTXcharcodes "01F62 "01F62 "01F6A % GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA
-\setXTXcharcodes "01F63 "01F63 "01F6B % GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA
-\setXTXcharcodes "01F64 "01F64 "01F6C % GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA
-\setXTXcharcodes "01F65 "01F65 "01F6D % GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA
-\setXTXcharcodes "01F66 "01F66 "01F6E % GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI
-\setXTXcharcodes "01F67 "01F67 "01F6F % GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI
-\setXTXcharcodes "01F68 "01F60 "01F68 % GREEK CAPITAL LETTER OMEGA WITH PSILI
-\setXTXcharcodes "01F69 "01F61 "01F69 % GREEK CAPITAL LETTER OMEGA WITH DASIA
-\setXTXcharcodes "01F6A "01F62 "01F6A % GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA
-\setXTXcharcodes "01F6B "01F63 "01F6B % GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA
-\setXTXcharcodes "01F6C "01F64 "01F6C % GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA
-\setXTXcharcodes "01F6D "01F65 "01F6D % GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA
-\setXTXcharcodes "01F6E "01F66 "01F6E % GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI
-\setXTXcharcodes "01F6F "01F67 "01F6F % GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI
-\setXTXcharcodes "01F70 "01F70 "01FBA % GREEK SMALL LETTER ALPHA WITH VARIA
-\setXTXcharcodes "01F71 "01F71 "01FBB % GREEK SMALL LETTER ALPHA WITH OXIA
-\setXTXcharcodes "01F72 "01F72 "01FC8 % GREEK SMALL LETTER EPSILON WITH VARIA
-\setXTXcharcodes "01F73 "01F73 "01FC9 % GREEK SMALL LETTER EPSILON WITH OXIA
-\setXTXcharcodes "01F74 "01F74 "01FCA % GREEK SMALL LETTER ETA WITH VARIA
-\setXTXcharcodes "01F75 "01F75 "01FCB % GREEK SMALL LETTER ETA WITH OXIA
-\setXTXcharcodes "01F76 "01F76 "01FDA % GREEK SMALL LETTER IOTA WITH VARIA
-\setXTXcharcodes "01F77 "01F77 "01FDB % GREEK SMALL LETTER IOTA WITH OXIA
-\setXTXcharcodes "01F78 "01F78 "01FF8 % GREEK SMALL LETTER OMICRON WITH VARIA
-\setXTXcharcodes "01F79 "01F79 "01FF9 % GREEK SMALL LETTER OMICRON WITH OXIA
-\setXTXcharcodes "01F7A "01F7A "01FEA % GREEK SMALL LETTER UPSILON WITH VARIA
-\setXTXcharcodes "01F7B "01F7B "01FEB % GREEK SMALL LETTER UPSILON WITH OXIA
-\setXTXcharcodes "01F7C "01F7C "01FFA % GREEK SMALL LETTER OMEGA WITH VARIA
-\setXTXcharcodes "01F7D "01F7D "01FFB % GREEK SMALL LETTER OMEGA WITH OXIA
-\setXTXcharcodes "01F80 "01F80 "01F88 % GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI
-\setXTXcharcodes "01F81 "01F81 "01F89 % GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI
-\setXTXcharcodes "01F82 "01F82 "01F8A % GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-\setXTXcharcodes "01F83 "01F83 "01F8B % GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-\setXTXcharcodes "01F84 "01F84 "01F8C % GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-\setXTXcharcodes "01F85 "01F85 "01F8D % GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-\setXTXcharcodes "01F86 "01F86 "01F8E % GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-\setXTXcharcodes "01F87 "01F87 "01F8F % GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-\setXTXcharcodes "01F88 "01F80 "01F88 % GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI
-\setXTXcharcodes "01F89 "01F81 "01F89 % GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI
-\setXTXcharcodes "01F8A "01F82 "01F8A % GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-\setXTXcharcodes "01F8B "01F83 "01F8B % GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-\setXTXcharcodes "01F8C "01F84 "01F8C % GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-\setXTXcharcodes "01F8D "01F85 "01F8D % GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-\setXTXcharcodes "01F8E "01F86 "01F8E % GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-\setXTXcharcodes "01F8F "01F87 "01F8F % GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-\setXTXcharcodes "01F90 "01F90 "01F98 % GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI
-\setXTXcharcodes "01F91 "01F91 "01F99 % GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI
-\setXTXcharcodes "01F92 "01F92 "01F9A % GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-\setXTXcharcodes "01F93 "01F93 "01F9B % GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-\setXTXcharcodes "01F94 "01F94 "01F9C % GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-\setXTXcharcodes "01F95 "01F95 "01F9D % GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-\setXTXcharcodes "01F96 "01F96 "01F9E % GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-\setXTXcharcodes "01F97 "01F97 "01F9F % GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-\setXTXcharcodes "01F98 "01F90 "01F98 % GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI
-\setXTXcharcodes "01F99 "01F91 "01F99 % GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI
-\setXTXcharcodes "01F9A "01F92 "01F9A % GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-\setXTXcharcodes "01F9B "01F93 "01F9B % GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-\setXTXcharcodes "01F9C "01F94 "01F9C % GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-\setXTXcharcodes "01F9D "01F95 "01F9D % GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-\setXTXcharcodes "01F9E "01F96 "01F9E % GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-\setXTXcharcodes "01F9F "01F97 "01F9F % GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-\setXTXcharcodes "01FA0 "01FA0 "01FA8 % GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI
-\setXTXcharcodes "01FA1 "01FA1 "01FA9 % GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI
-\setXTXcharcodes "01FA2 "01FA2 "01FAA % GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-\setXTXcharcodes "01FA3 "01FA3 "01FAB % GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-\setXTXcharcodes "01FA4 "01FA4 "01FAC % GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-\setXTXcharcodes "01FA5 "01FA5 "01FAD % GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-\setXTXcharcodes "01FA6 "01FA6 "01FAE % GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-\setXTXcharcodes "01FA7 "01FA7 "01FAF % GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-\setXTXcharcodes "01FA8 "01FA0 "01FA8 % GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI
-\setXTXcharcodes "01FA9 "01FA1 "01FA9 % GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI
-\setXTXcharcodes "01FAA "01FA2 "01FAA % GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-\setXTXcharcodes "01FAB "01FA3 "01FAB % GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-\setXTXcharcodes "01FAC "01FA4 "01FAC % GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-\setXTXcharcodes "01FAD "01FA5 "01FAD % GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-\setXTXcharcodes "01FAE "01FA6 "01FAE % GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-\setXTXcharcodes "01FAF "01FA7 "01FAF % GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-\setXTXcharcodes "01FB0 "01FB0 "01FB8 % GREEK SMALL LETTER ALPHA WITH VRACHY
-\setXTXcharcodes "01FB1 "01FB1 "01FB9 % GREEK SMALL LETTER ALPHA WITH MACRON
-\setXTXcharcodes "01FB2 "01FB2 "01FB2 % GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI
-\setXTXcharcodes "01FB3 "01FB3 "01FBC % GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI
-\setXTXcharcodes "01FB4 "01FB4 "01FB4 % GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI
-\setXTXcharcodes "01FB6 "01FB6 "01FB6 % GREEK SMALL LETTER ALPHA WITH PERISPOMENI
-\setXTXcharcodes "01FB7 "01FB7 "01FB7 % GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI
-\setXTXcharcodes "01FB8 "01FB0 "01FB8 % GREEK CAPITAL LETTER ALPHA WITH VRACHY
-\setXTXcharcodes "01FB9 "01FB1 "01FB9 % GREEK CAPITAL LETTER ALPHA WITH MACRON
-\setXTXcharcodes "01FBA "01F70 "01FBA % GREEK CAPITAL LETTER ALPHA WITH VARIA
-\setXTXcharcodes "01FBB "01F71 "01FBB % GREEK CAPITAL LETTER ALPHA WITH OXIA
-\setXTXcharcodes "01FBC "01FB3 "01FBC % GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI
-\setXTXcharcodes "01FBE "01FBE "00399 % GREEK PROSGEGRAMMENI
-\setXTXcharcodes "01FC2 "01FC2 "01FC2 % GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI
-\setXTXcharcodes "01FC3 "01FC3 "01FCC % GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI
-\setXTXcharcodes "01FC4 "01FC4 "01FC4 % GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI
-\setXTXcharcodes "01FC6 "01FC6 "01FC6 % GREEK SMALL LETTER ETA WITH PERISPOMENI
-\setXTXcharcodes "01FC7 "01FC7 "01FC7 % GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI
-\setXTXcharcodes "01FC8 "01F72 "01FC8 % GREEK CAPITAL LETTER EPSILON WITH VARIA
-\setXTXcharcodes "01FC9 "01F73 "01FC9 % GREEK CAPITAL LETTER EPSILON WITH OXIA
-\setXTXcharcodes "01FCA "01F74 "01FCA % GREEK CAPITAL LETTER ETA WITH VARIA
-\setXTXcharcodes "01FCB "01F75 "01FCB % GREEK CAPITAL LETTER ETA WITH OXIA
-\setXTXcharcodes "01FCC "01FC3 "01FCC % GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI
-\setXTXcharcodes "01FD0 "01FD0 "01FD8 % GREEK SMALL LETTER IOTA WITH VRACHY
-\setXTXcharcodes "01FD1 "01FD1 "01FD9 % GREEK SMALL LETTER IOTA WITH MACRON
-\setXTXcharcodes "01FD2 "01FD2 "01FD2 % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA
-\setXTXcharcodes "01FD3 "01FD3 "01FD3 % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA
-\setXTXcharcodes "01FD6 "01FD6 "01FD6 % GREEK SMALL LETTER IOTA WITH PERISPOMENI
-\setXTXcharcodes "01FD7 "01FD7 "01FD7 % GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI
-\setXTXcharcodes "01FD8 "01FD0 "01FD8 % GREEK CAPITAL LETTER IOTA WITH VRACHY
-\setXTXcharcodes "01FD9 "01FD1 "01FD9 % GREEK CAPITAL LETTER IOTA WITH MACRON
-\setXTXcharcodes "01FDA "01F76 "01FDA % GREEK CAPITAL LETTER IOTA WITH VARIA
-\setXTXcharcodes "01FDB "01F77 "01FDB % GREEK CAPITAL LETTER IOTA WITH OXIA
-\setXTXcharcodes "01FE0 "01FE0 "01FE8 % GREEK SMALL LETTER UPSILON WITH VRACHY
-\setXTXcharcodes "01FE1 "01FE1 "01FE9 % GREEK SMALL LETTER UPSILON WITH MACRON
-\setXTXcharcodes "01FE2 "01FE2 "01FE2 % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA
-\setXTXcharcodes "01FE3 "01FE3 "01FE3 % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA
-\setXTXcharcodes "01FE4 "01FE4 "01FE4 % GREEK SMALL LETTER RHO WITH PSILI
-\setXTXcharcodes "01FE5 "01FE5 "01FEC % GREEK SMALL LETTER RHO WITH DASIA
-\setXTXcharcodes "01FE6 "01FE6 "01FE6 % GREEK SMALL LETTER UPSILON WITH PERISPOMENI
-\setXTXcharcodes "01FE7 "01FE7 "01FE7 % GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI
-\setXTXcharcodes "01FE8 "01FE0 "01FE8 % GREEK CAPITAL LETTER UPSILON WITH VRACHY
-\setXTXcharcodes "01FE9 "01FE1 "01FE9 % GREEK CAPITAL LETTER UPSILON WITH MACRON
-\setXTXcharcodes "01FEA "01F7A "01FEA % GREEK CAPITAL LETTER UPSILON WITH VARIA
-\setXTXcharcodes "01FEB "01F7B "01FEB % GREEK CAPITAL LETTER UPSILON WITH OXIA
-\setXTXcharcodes "01FEC "01FE5 "01FEC % GREEK CAPITAL LETTER RHO WITH DASIA
-\setXTXcharcodes "01FF2 "01FF2 "01FF2 % GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI
-\setXTXcharcodes "01FF3 "01FF3 "01FFC % GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI
-\setXTXcharcodes "01FF4 "01FF4 "01FF4 % GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI
-\setXTXcharcodes "01FF6 "01FF6 "01FF6 % GREEK SMALL LETTER OMEGA WITH PERISPOMENI
-\setXTXcharcodes "01FF7 "01FF7 "01FF7 % GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI
-\setXTXcharcodes "01FF8 "01F78 "01FF8 % GREEK CAPITAL LETTER OMICRON WITH VARIA
-\setXTXcharcodes "01FF9 "01F79 "01FF9 % GREEK CAPITAL LETTER OMICRON WITH OXIA
-\setXTXcharcodes "01FFA "01F7C "01FFA % GREEK CAPITAL LETTER OMEGA WITH VARIA
-\setXTXcharcodes "01FFB "01F7D "01FFB % GREEK CAPITAL LETTER OMEGA WITH OXIA
-\setXTXcharcodes "01FFC "01FF3 "01FFC % GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI
-\setXTXcharcodes "02071 "02071 "02071 % SUPERSCRIPT LATIN SMALL LETTER I
-\setXTXcharcodes "0207F "0207F "0207F % SUPERSCRIPT LATIN SMALL LETTER N
-\setXTXcharcodes "02102 "02102 "02102 % DOUBLE-STRUCK CAPITAL C
-\setXTXcharcodes "02107 "02107 "02107 % EULER CONSTANT
-\setXTXcharcodes "0210A "0210A "0210A % SCRIPT SMALL G
-\setXTXcharcodes "0210B "0210B "0210B % SCRIPT CAPITAL H
-\setXTXcharcodes "0210C "0210C "0210C % BLACK-LETTER CAPITAL H
-\setXTXcharcodes "0210D "0210D "0210D % DOUBLE-STRUCK CAPITAL H
-\setXTXcharcodes "0210E "0210E "0210E % PLANCK CONSTANT
-\setXTXcharcodes "0210F "0210F "0210F % PLANCK CONSTANT OVER TWO PI
-\setXTXcharcodes "02110 "02110 "02110 % SCRIPT CAPITAL I
-\setXTXcharcodes "02111 "02111 "02111 % BLACK-LETTER CAPITAL I
-\setXTXcharcodes "02112 "02112 "02112 % SCRIPT CAPITAL L
-\setXTXcharcodes "02113 "02113 "02113 % SCRIPT SMALL L
-\setXTXcharcodes "02115 "02115 "02115 % DOUBLE-STRUCK CAPITAL N
-\setXTXcharcodes "02119 "02119 "02119 % DOUBLE-STRUCK CAPITAL P
-\setXTXcharcodes "0211A "0211A "0211A % DOUBLE-STRUCK CAPITAL Q
-\setXTXcharcodes "0211B "0211B "0211B % SCRIPT CAPITAL R
-\setXTXcharcodes "0211C "0211C "0211C % BLACK-LETTER CAPITAL R
-\setXTXcharcodes "0211D "0211D "0211D % DOUBLE-STRUCK CAPITAL R
-\setXTXcharcodes "02124 "02124 "02124 % DOUBLE-STRUCK CAPITAL Z
-\setXTXcharcodes "02126 "003C9 "02126 % OHM SIGN
-\setXTXcharcodes "02128 "02128 "02128 % BLACK-LETTER CAPITAL Z
-\setXTXcharcodes "0212A "0006B "0212A % KELVIN SIGN
-\setXTXcharcodes "0212B "000E5 "0212B % ANGSTROM SIGN
-\setXTXcharcodes "0212C "0212C "0212C % SCRIPT CAPITAL B
-\setXTXcharcodes "0212D "0212D "0212D % BLACK-LETTER CAPITAL C
-\setXTXcharcodes "0212F "0212F "0212F % SCRIPT SMALL E
-\setXTXcharcodes "02130 "02130 "02130 % SCRIPT CAPITAL E
-\setXTXcharcodes "02131 "02131 "02131 % SCRIPT CAPITAL F
-\setXTXcharcodes "02132 "0214E "02132 % TURNED CAPITAL F
-\setXTXcharcodes "02133 "02133 "02133 % SCRIPT CAPITAL M
-\setXTXcharcodes "02134 "02134 "02134 % SCRIPT SMALL O
-\setXTXcharcodes "02139 "02139 "02139 % INFORMATION SOURCE
-\setXTXcharcodes "0213C "0213C "0213C % DOUBLE-STRUCK SMALL PI
-\setXTXcharcodes "0213D "0213D "0213D % DOUBLE-STRUCK SMALL GAMMA
-\setXTXcharcodes "0213E "0213E "0213E % DOUBLE-STRUCK CAPITAL GAMMA
-\setXTXcharcodes "0213F "0213F "0213F % DOUBLE-STRUCK CAPITAL PI
-\setXTXcharcodes "02145 "02145 "02145 % DOUBLE-STRUCK ITALIC CAPITAL D
-\setXTXcharcodes "02146 "02146 "02146 % DOUBLE-STRUCK ITALIC SMALL D
-\setXTXcharcodes "02147 "02147 "02147 % DOUBLE-STRUCK ITALIC SMALL E
-\setXTXcharcodes "02148 "02148 "02148 % DOUBLE-STRUCK ITALIC SMALL I
-\setXTXcharcodes "02149 "02149 "02149 % DOUBLE-STRUCK ITALIC SMALL J
-\setXTXcharcodes "0214E "0214E "02132 % TURNED SMALL F
-\setXTXcharcodes "02183 "02184 "02183 % ROMAN NUMERAL REVERSED ONE HUNDRED
-\setXTXcharcodes "02184 "02184 "02183 % LATIN SMALL LETTER REVERSED C
-\setXTXcharcodes "02C00 "02C30 "02C00 % GLAGOLITIC CAPITAL LETTER AZU
-\setXTXcharcodes "02C01 "02C31 "02C01 % GLAGOLITIC CAPITAL LETTER BUKY
-\setXTXcharcodes "02C02 "02C32 "02C02 % GLAGOLITIC CAPITAL LETTER VEDE
-\setXTXcharcodes "02C03 "02C33 "02C03 % GLAGOLITIC CAPITAL LETTER GLAGOLI
-\setXTXcharcodes "02C04 "02C34 "02C04 % GLAGOLITIC CAPITAL LETTER DOBRO
-\setXTXcharcodes "02C05 "02C35 "02C05 % GLAGOLITIC CAPITAL LETTER YESTU
-\setXTXcharcodes "02C06 "02C36 "02C06 % GLAGOLITIC CAPITAL LETTER ZHIVETE
-\setXTXcharcodes "02C07 "02C37 "02C07 % GLAGOLITIC CAPITAL LETTER DZELO
-\setXTXcharcodes "02C08 "02C38 "02C08 % GLAGOLITIC CAPITAL LETTER ZEMLJA
-\setXTXcharcodes "02C09 "02C39 "02C09 % GLAGOLITIC CAPITAL LETTER IZHE
-\setXTXcharcodes "02C0A "02C3A "02C0A % GLAGOLITIC CAPITAL LETTER INITIAL IZHE
-\setXTXcharcodes "02C0B "02C3B "02C0B % GLAGOLITIC CAPITAL LETTER I
-\setXTXcharcodes "02C0C "02C3C "02C0C % GLAGOLITIC CAPITAL LETTER DJERVI
-\setXTXcharcodes "02C0D "02C3D "02C0D % GLAGOLITIC CAPITAL LETTER KAKO
-\setXTXcharcodes "02C0E "02C3E "02C0E % GLAGOLITIC CAPITAL LETTER LJUDIJE
-\setXTXcharcodes "02C0F "02C3F "02C0F % GLAGOLITIC CAPITAL LETTER MYSLITE
-\setXTXcharcodes "02C10 "02C40 "02C10 % GLAGOLITIC CAPITAL LETTER NASHI
-\setXTXcharcodes "02C11 "02C41 "02C11 % GLAGOLITIC CAPITAL LETTER ONU
-\setXTXcharcodes "02C12 "02C42 "02C12 % GLAGOLITIC CAPITAL LETTER POKOJI
-\setXTXcharcodes "02C13 "02C43 "02C13 % GLAGOLITIC CAPITAL LETTER RITSI
-\setXTXcharcodes "02C14 "02C44 "02C14 % GLAGOLITIC CAPITAL LETTER SLOVO
-\setXTXcharcodes "02C15 "02C45 "02C15 % GLAGOLITIC CAPITAL LETTER TVRIDO
-\setXTXcharcodes "02C16 "02C46 "02C16 % GLAGOLITIC CAPITAL LETTER UKU
-\setXTXcharcodes "02C17 "02C47 "02C17 % GLAGOLITIC CAPITAL LETTER FRITU
-\setXTXcharcodes "02C18 "02C48 "02C18 % GLAGOLITIC CAPITAL LETTER HERU
-\setXTXcharcodes "02C19 "02C49 "02C19 % GLAGOLITIC CAPITAL LETTER OTU
-\setXTXcharcodes "02C1A "02C4A "02C1A % GLAGOLITIC CAPITAL LETTER PE
-\setXTXcharcodes "02C1B "02C4B "02C1B % GLAGOLITIC CAPITAL LETTER SHTA
-\setXTXcharcodes "02C1C "02C4C "02C1C % GLAGOLITIC CAPITAL LETTER TSI
-\setXTXcharcodes "02C1D "02C4D "02C1D % GLAGOLITIC CAPITAL LETTER CHRIVI
-\setXTXcharcodes "02C1E "02C4E "02C1E % GLAGOLITIC CAPITAL LETTER SHA
-\setXTXcharcodes "02C1F "02C4F "02C1F % GLAGOLITIC CAPITAL LETTER YERU
-\setXTXcharcodes "02C20 "02C50 "02C20 % GLAGOLITIC CAPITAL LETTER YERI
-\setXTXcharcodes "02C21 "02C51 "02C21 % GLAGOLITIC CAPITAL LETTER YATI
-\setXTXcharcodes "02C22 "02C52 "02C22 % GLAGOLITIC CAPITAL LETTER SPIDERY HA
-\setXTXcharcodes "02C23 "02C53 "02C23 % GLAGOLITIC CAPITAL LETTER YU
-\setXTXcharcodes "02C24 "02C54 "02C24 % GLAGOLITIC CAPITAL LETTER SMALL YUS
-\setXTXcharcodes "02C25 "02C55 "02C25 % GLAGOLITIC CAPITAL LETTER SMALL YUS WITH TAIL
-\setXTXcharcodes "02C26 "02C56 "02C26 % GLAGOLITIC CAPITAL LETTER YO
-\setXTXcharcodes "02C27 "02C57 "02C27 % GLAGOLITIC CAPITAL LETTER IOTATED SMALL YUS
-\setXTXcharcodes "02C28 "02C58 "02C28 % GLAGOLITIC CAPITAL LETTER BIG YUS
-\setXTXcharcodes "02C29 "02C59 "02C29 % GLAGOLITIC CAPITAL LETTER IOTATED BIG YUS
-\setXTXcharcodes "02C2A "02C5A "02C2A % GLAGOLITIC CAPITAL LETTER FITA
-\setXTXcharcodes "02C2B "02C5B "02C2B % GLAGOLITIC CAPITAL LETTER IZHITSA
-\setXTXcharcodes "02C2C "02C5C "02C2C % GLAGOLITIC CAPITAL LETTER SHTAPIC
-\setXTXcharcodes "02C2D "02C5D "02C2D % GLAGOLITIC CAPITAL LETTER TROKUTASTI A
-\setXTXcharcodes "02C2E "02C5E "02C2E % GLAGOLITIC CAPITAL LETTER LATINATE MYSLITE
-\setXTXcharcodes "02C30 "02C30 "02C00 % GLAGOLITIC SMALL LETTER AZU
-\setXTXcharcodes "02C31 "02C31 "02C01 % GLAGOLITIC SMALL LETTER BUKY
-\setXTXcharcodes "02C32 "02C32 "02C02 % GLAGOLITIC SMALL LETTER VEDE
-\setXTXcharcodes "02C33 "02C33 "02C03 % GLAGOLITIC SMALL LETTER GLAGOLI
-\setXTXcharcodes "02C34 "02C34 "02C04 % GLAGOLITIC SMALL LETTER DOBRO
-\setXTXcharcodes "02C35 "02C35 "02C05 % GLAGOLITIC SMALL LETTER YESTU
-\setXTXcharcodes "02C36 "02C36 "02C06 % GLAGOLITIC SMALL LETTER ZHIVETE
-\setXTXcharcodes "02C37 "02C37 "02C07 % GLAGOLITIC SMALL LETTER DZELO
-\setXTXcharcodes "02C38 "02C38 "02C08 % GLAGOLITIC SMALL LETTER ZEMLJA
-\setXTXcharcodes "02C39 "02C39 "02C09 % GLAGOLITIC SMALL LETTER IZHE
-\setXTXcharcodes "02C3A "02C3A "02C0A % GLAGOLITIC SMALL LETTER INITIAL IZHE
-\setXTXcharcodes "02C3B "02C3B "02C0B % GLAGOLITIC SMALL LETTER I
-\setXTXcharcodes "02C3C "02C3C "02C0C % GLAGOLITIC SMALL LETTER DJERVI
-\setXTXcharcodes "02C3D "02C3D "02C0D % GLAGOLITIC SMALL LETTER KAKO
-\setXTXcharcodes "02C3E "02C3E "02C0E % GLAGOLITIC SMALL LETTER LJUDIJE
-\setXTXcharcodes "02C3F "02C3F "02C0F % GLAGOLITIC SMALL LETTER MYSLITE
-\setXTXcharcodes "02C40 "02C40 "02C10 % GLAGOLITIC SMALL LETTER NASHI
-\setXTXcharcodes "02C41 "02C41 "02C11 % GLAGOLITIC SMALL LETTER ONU
-\setXTXcharcodes "02C42 "02C42 "02C12 % GLAGOLITIC SMALL LETTER POKOJI
-\setXTXcharcodes "02C43 "02C43 "02C13 % GLAGOLITIC SMALL LETTER RITSI
-\setXTXcharcodes "02C44 "02C44 "02C14 % GLAGOLITIC SMALL LETTER SLOVO
-\setXTXcharcodes "02C45 "02C45 "02C15 % GLAGOLITIC SMALL LETTER TVRIDO
-\setXTXcharcodes "02C46 "02C46 "02C16 % GLAGOLITIC SMALL LETTER UKU
-\setXTXcharcodes "02C47 "02C47 "02C17 % GLAGOLITIC SMALL LETTER FRITU
-\setXTXcharcodes "02C48 "02C48 "02C18 % GLAGOLITIC SMALL LETTER HERU
-\setXTXcharcodes "02C49 "02C49 "02C19 % GLAGOLITIC SMALL LETTER OTU
-\setXTXcharcodes "02C4A "02C4A "02C1A % GLAGOLITIC SMALL LETTER PE
-\setXTXcharcodes "02C4B "02C4B "02C1B % GLAGOLITIC SMALL LETTER SHTA
-\setXTXcharcodes "02C4C "02C4C "02C1C % GLAGOLITIC SMALL LETTER TSI
-\setXTXcharcodes "02C4D "02C4D "02C1D % GLAGOLITIC SMALL LETTER CHRIVI
-\setXTXcharcodes "02C4E "02C4E "02C1E % GLAGOLITIC SMALL LETTER SHA
-\setXTXcharcodes "02C4F "02C4F "02C1F % GLAGOLITIC SMALL LETTER YERU
-\setXTXcharcodes "02C50 "02C50 "02C20 % GLAGOLITIC SMALL LETTER YERI
-\setXTXcharcodes "02C51 "02C51 "02C21 % GLAGOLITIC SMALL LETTER YATI
-\setXTXcharcodes "02C52 "02C52 "02C22 % GLAGOLITIC SMALL LETTER SPIDERY HA
-\setXTXcharcodes "02C53 "02C53 "02C23 % GLAGOLITIC SMALL LETTER YU
-\setXTXcharcodes "02C54 "02C54 "02C24 % GLAGOLITIC SMALL LETTER SMALL YUS
-\setXTXcharcodes "02C55 "02C55 "02C25 % GLAGOLITIC SMALL LETTER SMALL YUS WITH TAIL
-\setXTXcharcodes "02C56 "02C56 "02C26 % GLAGOLITIC SMALL LETTER YO
-\setXTXcharcodes "02C57 "02C57 "02C27 % GLAGOLITIC SMALL LETTER IOTATED SMALL YUS
-\setXTXcharcodes "02C58 "02C58 "02C28 % GLAGOLITIC SMALL LETTER BIG YUS
-\setXTXcharcodes "02C59 "02C59 "02C29 % GLAGOLITIC SMALL LETTER IOTATED BIG YUS
-\setXTXcharcodes "02C5A "02C5A "02C2A % GLAGOLITIC SMALL LETTER FITA
-\setXTXcharcodes "02C5B "02C5B "02C2B % GLAGOLITIC SMALL LETTER IZHITSA
-\setXTXcharcodes "02C5C "02C5C "02C2C % GLAGOLITIC SMALL LETTER SHTAPIC
-\setXTXcharcodes "02C5D "02C5D "02C2D % GLAGOLITIC SMALL LETTER TROKUTASTI A
-\setXTXcharcodes "02C5E "02C5E "02C2E % GLAGOLITIC SMALL LETTER LATINATE MYSLITE
-\setXTXcharcodes "02C60 "02C61 "02C60 % LATIN CAPITAL LETTER L WITH DOUBLE BAR
-\setXTXcharcodes "02C61 "02C61 "02C60 % LATIN SMALL LETTER L WITH DOUBLE BAR
-\setXTXcharcodes "02C62 "0026B "02C62 % LATIN CAPITAL LETTER L WITH MIDDLE TILDE
-\setXTXcharcodes "02C63 "01D7D "02C63 % LATIN CAPITAL LETTER P WITH STROKE
-\setXTXcharcodes "02C64 "0027D "02C64 % LATIN CAPITAL LETTER R WITH TAIL
-\setXTXcharcodes "02C65 "02C65 "0023A % LATIN SMALL LETTER A WITH STROKE
-\setXTXcharcodes "02C66 "02C66 "0023E % LATIN SMALL LETTER T WITH DIAGONAL STROKE
-\setXTXcharcodes "02C67 "02C68 "02C67 % LATIN CAPITAL LETTER H WITH DESCENDER
-\setXTXcharcodes "02C68 "02C68 "02C67 % LATIN SMALL LETTER H WITH DESCENDER
-\setXTXcharcodes "02C69 "02C6A "02C69 % LATIN CAPITAL LETTER K WITH DESCENDER
-\setXTXcharcodes "02C6A "02C6A "02C69 % LATIN SMALL LETTER K WITH DESCENDER
-\setXTXcharcodes "02C6B "02C6C "02C6B % LATIN CAPITAL LETTER Z WITH DESCENDER
-\setXTXcharcodes "02C6C "02C6C "02C6B % LATIN SMALL LETTER Z WITH DESCENDER
-\setXTXcharcodes "02C6D "02C6D "02C6D % LATIN CAPITAL LETTER ALPHA
-\setXTXcharcodes "02C6E "02C6E "02C6E % LATIN CAPITAL LETTER M WITH HOOK
-\setXTXcharcodes "02C6F "02C6F "02C6F % LATIN CAPITAL LETTER TURNED A
-\setXTXcharcodes "02C70 "02C70 "02C70 % LATIN CAPITAL LETTER TURNED ALPHA
-\setXTXcharcodes "02C71 "02C71 "02C71 % LATIN SMALL LETTER V WITH RIGHT HOOK
-\setXTXcharcodes "02C72 "02C72 "02C72 % LATIN CAPITAL LETTER W WITH HOOK
-\setXTXcharcodes "02C73 "02C73 "02C73 % LATIN SMALL LETTER W WITH HOOK
-\setXTXcharcodes "02C74 "02C74 "02C74 % LATIN SMALL LETTER V WITH CURL
-\setXTXcharcodes "02C75 "02C76 "02C75 % LATIN CAPITAL LETTER HALF H
-\setXTXcharcodes "02C76 "02C76 "02C75 % LATIN SMALL LETTER HALF H
-\setXTXcharcodes "02C77 "02C77 "02C77 % LATIN SMALL LETTER TAILLESS PHI
-\setXTXcharcodes "02C78 "02C78 "02C78 % LATIN SMALL LETTER E WITH NOTCH
-\setXTXcharcodes "02C79 "02C79 "02C79 % LATIN SMALL LETTER TURNED R WITH TAIL
-\setXTXcharcodes "02C7A "02C7A "02C7A % LATIN SMALL LETTER O WITH LOW RING INSIDE
-\setXTXcharcodes "02C7B "02C7B "02C7B % LATIN LETTER SMALL CAPITAL TURNED E
-\setXTXcharcodes "02C7C "02C7C "02C7C % LATIN SUBSCRIPT SMALL LETTER J
-\setXTXcharcodes "02C7E "02C7E "02C7E % LATIN CAPITAL LETTER S WITH SWASH TAIL
-\setXTXcharcodes "02C7F "02C7F "02C7F % LATIN CAPITAL LETTER Z WITH SWASH TAIL
-\setXTXcharcodes "02C80 "02C81 "02C80 % COPTIC CAPITAL LETTER ALFA
-\setXTXcharcodes "02C81 "02C81 "02C80 % COPTIC SMALL LETTER ALFA
-\setXTXcharcodes "02C82 "02C83 "02C82 % COPTIC CAPITAL LETTER VIDA
-\setXTXcharcodes "02C83 "02C83 "02C82 % COPTIC SMALL LETTER VIDA
-\setXTXcharcodes "02C84 "02C85 "02C84 % COPTIC CAPITAL LETTER GAMMA
-\setXTXcharcodes "02C85 "02C85 "02C84 % COPTIC SMALL LETTER GAMMA
-\setXTXcharcodes "02C86 "02C87 "02C86 % COPTIC CAPITAL LETTER DALDA
-\setXTXcharcodes "02C87 "02C87 "02C86 % COPTIC SMALL LETTER DALDA
-\setXTXcharcodes "02C88 "02C89 "02C88 % COPTIC CAPITAL LETTER EIE
-\setXTXcharcodes "02C89 "02C89 "02C88 % COPTIC SMALL LETTER EIE
-\setXTXcharcodes "02C8A "02C8B "02C8A % COPTIC CAPITAL LETTER SOU
-\setXTXcharcodes "02C8B "02C8B "02C8A % COPTIC SMALL LETTER SOU
-\setXTXcharcodes "02C8C "02C8D "02C8C % COPTIC CAPITAL LETTER ZATA
-\setXTXcharcodes "02C8D "02C8D "02C8C % COPTIC SMALL LETTER ZATA
-\setXTXcharcodes "02C8E "02C8F "02C8E % COPTIC CAPITAL LETTER HATE
-\setXTXcharcodes "02C8F "02C8F "02C8E % COPTIC SMALL LETTER HATE
-\setXTXcharcodes "02C90 "02C91 "02C90 % COPTIC CAPITAL LETTER THETHE
-\setXTXcharcodes "02C91 "02C91 "02C90 % COPTIC SMALL LETTER THETHE
-\setXTXcharcodes "02C92 "02C93 "02C92 % COPTIC CAPITAL LETTER IAUDA
-\setXTXcharcodes "02C93 "02C93 "02C92 % COPTIC SMALL LETTER IAUDA
-\setXTXcharcodes "02C94 "02C95 "02C94 % COPTIC CAPITAL LETTER KAPA
-\setXTXcharcodes "02C95 "02C95 "02C94 % COPTIC SMALL LETTER KAPA
-\setXTXcharcodes "02C96 "02C97 "02C96 % COPTIC CAPITAL LETTER LAULA
-\setXTXcharcodes "02C97 "02C97 "02C96 % COPTIC SMALL LETTER LAULA
-\setXTXcharcodes "02C98 "02C99 "02C98 % COPTIC CAPITAL LETTER MI
-\setXTXcharcodes "02C99 "02C99 "02C98 % COPTIC SMALL LETTER MI
-\setXTXcharcodes "02C9A "02C9B "02C9A % COPTIC CAPITAL LETTER NI
-\setXTXcharcodes "02C9B "02C9B "02C9A % COPTIC SMALL LETTER NI
-\setXTXcharcodes "02C9C "02C9D "02C9C % COPTIC CAPITAL LETTER KSI
-\setXTXcharcodes "02C9D "02C9D "02C9C % COPTIC SMALL LETTER KSI
-\setXTXcharcodes "02C9E "02C9F "02C9E % COPTIC CAPITAL LETTER O
-\setXTXcharcodes "02C9F "02C9F "02C9E % COPTIC SMALL LETTER O
-\setXTXcharcodes "02CA0 "02CA1 "02CA0 % COPTIC CAPITAL LETTER PI
-\setXTXcharcodes "02CA1 "02CA1 "02CA0 % COPTIC SMALL LETTER PI
-\setXTXcharcodes "02CA2 "02CA3 "02CA2 % COPTIC CAPITAL LETTER RO
-\setXTXcharcodes "02CA3 "02CA3 "02CA2 % COPTIC SMALL LETTER RO
-\setXTXcharcodes "02CA4 "02CA5 "02CA4 % COPTIC CAPITAL LETTER SIMA
-\setXTXcharcodes "02CA5 "02CA5 "02CA4 % COPTIC SMALL LETTER SIMA
-\setXTXcharcodes "02CA6 "02CA7 "02CA6 % COPTIC CAPITAL LETTER TAU
-\setXTXcharcodes "02CA7 "02CA7 "02CA6 % COPTIC SMALL LETTER TAU
-\setXTXcharcodes "02CA8 "02CA9 "02CA8 % COPTIC CAPITAL LETTER UA
-\setXTXcharcodes "02CA9 "02CA9 "02CA8 % COPTIC SMALL LETTER UA
-\setXTXcharcodes "02CAA "02CAB "02CAA % COPTIC CAPITAL LETTER FI
-\setXTXcharcodes "02CAB "02CAB "02CAA % COPTIC SMALL LETTER FI
-\setXTXcharcodes "02CAC "02CAD "02CAC % COPTIC CAPITAL LETTER KHI
-\setXTXcharcodes "02CAD "02CAD "02CAC % COPTIC SMALL LETTER KHI
-\setXTXcharcodes "02CAE "02CAF "02CAE % COPTIC CAPITAL LETTER PSI
-\setXTXcharcodes "02CAF "02CAF "02CAE % COPTIC SMALL LETTER PSI
-\setXTXcharcodes "02CB0 "02CB1 "02CB0 % COPTIC CAPITAL LETTER OOU
-\setXTXcharcodes "02CB1 "02CB1 "02CB0 % COPTIC SMALL LETTER OOU
-\setXTXcharcodes "02CB2 "02CB3 "02CB2 % COPTIC CAPITAL LETTER DIALECT-P ALEF
-\setXTXcharcodes "02CB3 "02CB3 "02CB2 % COPTIC SMALL LETTER DIALECT-P ALEF
-\setXTXcharcodes "02CB4 "02CB5 "02CB4 % COPTIC CAPITAL LETTER OLD COPTIC AIN
-\setXTXcharcodes "02CB5 "02CB5 "02CB4 % COPTIC SMALL LETTER OLD COPTIC AIN
-\setXTXcharcodes "02CB6 "02CB7 "02CB6 % COPTIC CAPITAL LETTER CRYPTOGRAMMIC EIE
-\setXTXcharcodes "02CB7 "02CB7 "02CB6 % COPTIC SMALL LETTER CRYPTOGRAMMIC EIE
-\setXTXcharcodes "02CB8 "02CB9 "02CB8 % COPTIC CAPITAL LETTER DIALECT-P KAPA
-\setXTXcharcodes "02CB9 "02CB9 "02CB8 % COPTIC SMALL LETTER DIALECT-P KAPA
-\setXTXcharcodes "02CBA "02CBB "02CBA % COPTIC CAPITAL LETTER DIALECT-P NI
-\setXTXcharcodes "02CBB "02CBB "02CBA % COPTIC SMALL LETTER DIALECT-P NI
-\setXTXcharcodes "02CBC "02CBD "02CBC % COPTIC CAPITAL LETTER CRYPTOGRAMMIC NI
-\setXTXcharcodes "02CBD "02CBD "02CBC % COPTIC SMALL LETTER CRYPTOGRAMMIC NI
-\setXTXcharcodes "02CBE "02CBF "02CBE % COPTIC CAPITAL LETTER OLD COPTIC OOU
-\setXTXcharcodes "02CBF "02CBF "02CBE % COPTIC SMALL LETTER OLD COPTIC OOU
-\setXTXcharcodes "02CC0 "02CC1 "02CC0 % COPTIC CAPITAL LETTER SAMPI
-\setXTXcharcodes "02CC1 "02CC1 "02CC0 % COPTIC SMALL LETTER SAMPI
-\setXTXcharcodes "02CC2 "02CC3 "02CC2 % COPTIC CAPITAL LETTER CROSSED SHEI
-\setXTXcharcodes "02CC3 "02CC3 "02CC2 % COPTIC SMALL LETTER CROSSED SHEI
-\setXTXcharcodes "02CC4 "02CC5 "02CC4 % COPTIC CAPITAL LETTER OLD COPTIC SHEI
-\setXTXcharcodes "02CC5 "02CC5 "02CC4 % COPTIC SMALL LETTER OLD COPTIC SHEI
-\setXTXcharcodes "02CC6 "02CC7 "02CC6 % COPTIC CAPITAL LETTER OLD COPTIC ESH
-\setXTXcharcodes "02CC7 "02CC7 "02CC6 % COPTIC SMALL LETTER OLD COPTIC ESH
-\setXTXcharcodes "02CC8 "02CC9 "02CC8 % COPTIC CAPITAL LETTER AKHMIMIC KHEI
-\setXTXcharcodes "02CC9 "02CC9 "02CC8 % COPTIC SMALL LETTER AKHMIMIC KHEI
-\setXTXcharcodes "02CCA "02CCB "02CCA % COPTIC CAPITAL LETTER DIALECT-P HORI
-\setXTXcharcodes "02CCB "02CCB "02CCA % COPTIC SMALL LETTER DIALECT-P HORI
-\setXTXcharcodes "02CCC "02CCD "02CCC % COPTIC CAPITAL LETTER OLD COPTIC HORI
-\setXTXcharcodes "02CCD "02CCD "02CCC % COPTIC SMALL LETTER OLD COPTIC HORI
-\setXTXcharcodes "02CCE "02CCF "02CCE % COPTIC CAPITAL LETTER OLD COPTIC HA
-\setXTXcharcodes "02CCF "02CCF "02CCE % COPTIC SMALL LETTER OLD COPTIC HA
-\setXTXcharcodes "02CD0 "02CD1 "02CD0 % COPTIC CAPITAL LETTER L-SHAPED HA
-\setXTXcharcodes "02CD1 "02CD1 "02CD0 % COPTIC SMALL LETTER L-SHAPED HA
-\setXTXcharcodes "02CD2 "02CD3 "02CD2 % COPTIC CAPITAL LETTER OLD COPTIC HEI
-\setXTXcharcodes "02CD3 "02CD3 "02CD2 % COPTIC SMALL LETTER OLD COPTIC HEI
-\setXTXcharcodes "02CD4 "02CD5 "02CD4 % COPTIC CAPITAL LETTER OLD COPTIC HAT
-\setXTXcharcodes "02CD5 "02CD5 "02CD4 % COPTIC SMALL LETTER OLD COPTIC HAT
-\setXTXcharcodes "02CD6 "02CD7 "02CD6 % COPTIC CAPITAL LETTER OLD COPTIC GANGIA
-\setXTXcharcodes "02CD7 "02CD7 "02CD6 % COPTIC SMALL LETTER OLD COPTIC GANGIA
-\setXTXcharcodes "02CD8 "02CD9 "02CD8 % COPTIC CAPITAL LETTER OLD COPTIC DJA
-\setXTXcharcodes "02CD9 "02CD9 "02CD8 % COPTIC SMALL LETTER OLD COPTIC DJA
-\setXTXcharcodes "02CDA "02CDB "02CDA % COPTIC CAPITAL LETTER OLD COPTIC SHIMA
-\setXTXcharcodes "02CDB "02CDB "02CDA % COPTIC SMALL LETTER OLD COPTIC SHIMA
-\setXTXcharcodes "02CDC "02CDD "02CDC % COPTIC CAPITAL LETTER OLD NUBIAN SHIMA
-\setXTXcharcodes "02CDD "02CDD "02CDC % COPTIC SMALL LETTER OLD NUBIAN SHIMA
-\setXTXcharcodes "02CDE "02CDF "02CDE % COPTIC CAPITAL LETTER OLD NUBIAN NGI
-\setXTXcharcodes "02CDF "02CDF "02CDE % COPTIC SMALL LETTER OLD NUBIAN NGI
-\setXTXcharcodes "02CE0 "02CE1 "02CE0 % COPTIC CAPITAL LETTER OLD NUBIAN NYI
-\setXTXcharcodes "02CE1 "02CE1 "02CE0 % COPTIC SMALL LETTER OLD NUBIAN NYI
-\setXTXcharcodes "02CE2 "02CE3 "02CE2 % COPTIC CAPITAL LETTER OLD NUBIAN WAU
-\setXTXcharcodes "02CE3 "02CE3 "02CE2 % COPTIC SMALL LETTER OLD NUBIAN WAU
-\setXTXcharcodes "02CE4 "02CE4 "02CE4 % COPTIC SYMBOL KAI
-\setXTXcharcodes "02CEB "02CEB "02CEB % COPTIC CAPITAL LETTER CRYPTOGRAMMIC SHEI
-\setXTXcharcodes "02CEC "02CEC "02CEC % COPTIC SMALL LETTER CRYPTOGRAMMIC SHEI
-\setXTXcharcodes "02CED "02CED "02CED % COPTIC CAPITAL LETTER CRYPTOGRAMMIC GANGIA
-\setXTXcharcodes "02CEE "02CEE "02CEE % COPTIC SMALL LETTER CRYPTOGRAMMIC GANGIA
-\setXTXcharcodes "02CF2 "02CF2 "02CF2 % COPTIC CAPITAL LETTER BOHAIRIC KHEI
-\setXTXcharcodes "02CF3 "02CF3 "02CF3 % COPTIC SMALL LETTER BOHAIRIC KHEI
-\setXTXcharcodes "02D00 "02D00 "010A0 % GEORGIAN SMALL LETTER AN
-\setXTXcharcodes "02D01 "02D01 "010A1 % GEORGIAN SMALL LETTER BAN
-\setXTXcharcodes "02D02 "02D02 "010A2 % GEORGIAN SMALL LETTER GAN
-\setXTXcharcodes "02D03 "02D03 "010A3 % GEORGIAN SMALL LETTER DON
-\setXTXcharcodes "02D04 "02D04 "010A4 % GEORGIAN SMALL LETTER EN
-\setXTXcharcodes "02D05 "02D05 "010A5 % GEORGIAN SMALL LETTER VIN
-\setXTXcharcodes "02D06 "02D06 "010A6 % GEORGIAN SMALL LETTER ZEN
-\setXTXcharcodes "02D07 "02D07 "010A7 % GEORGIAN SMALL LETTER TAN
-\setXTXcharcodes "02D08 "02D08 "010A8 % GEORGIAN SMALL LETTER IN
-\setXTXcharcodes "02D09 "02D09 "010A9 % GEORGIAN SMALL LETTER KAN
-\setXTXcharcodes "02D0A "02D0A "010AA % GEORGIAN SMALL LETTER LAS
-\setXTXcharcodes "02D0B "02D0B "010AB % GEORGIAN SMALL LETTER MAN
-\setXTXcharcodes "02D0C "02D0C "010AC % GEORGIAN SMALL LETTER NAR
-\setXTXcharcodes "02D0D "02D0D "010AD % GEORGIAN SMALL LETTER ON
-\setXTXcharcodes "02D0E "02D0E "010AE % GEORGIAN SMALL LETTER PAR
-\setXTXcharcodes "02D0F "02D0F "010AF % GEORGIAN SMALL LETTER ZHAR
-\setXTXcharcodes "02D10 "02D10 "010B0 % GEORGIAN SMALL LETTER RAE
-\setXTXcharcodes "02D11 "02D11 "010B1 % GEORGIAN SMALL LETTER SAN
-\setXTXcharcodes "02D12 "02D12 "010B2 % GEORGIAN SMALL LETTER TAR
-\setXTXcharcodes "02D13 "02D13 "010B3 % GEORGIAN SMALL LETTER UN
-\setXTXcharcodes "02D14 "02D14 "010B4 % GEORGIAN SMALL LETTER PHAR
-\setXTXcharcodes "02D15 "02D15 "010B5 % GEORGIAN SMALL LETTER KHAR
-\setXTXcharcodes "02D16 "02D16 "010B6 % GEORGIAN SMALL LETTER GHAN
-\setXTXcharcodes "02D17 "02D17 "010B7 % GEORGIAN SMALL LETTER QAR
-\setXTXcharcodes "02D18 "02D18 "010B8 % GEORGIAN SMALL LETTER SHIN
-\setXTXcharcodes "02D19 "02D19 "010B9 % GEORGIAN SMALL LETTER CHIN
-\setXTXcharcodes "02D1A "02D1A "010BA % GEORGIAN SMALL LETTER CAN
-\setXTXcharcodes "02D1B "02D1B "010BB % GEORGIAN SMALL LETTER JIL
-\setXTXcharcodes "02D1C "02D1C "010BC % GEORGIAN SMALL LETTER CIL
-\setXTXcharcodes "02D1D "02D1D "010BD % GEORGIAN SMALL LETTER CHAR
-\setXTXcharcodes "02D1E "02D1E "010BE % GEORGIAN SMALL LETTER XAN
-\setXTXcharcodes "02D1F "02D1F "010BF % GEORGIAN SMALL LETTER JHAN
-\setXTXcharcodes "02D20 "02D20 "010C0 % GEORGIAN SMALL LETTER HAE
-\setXTXcharcodes "02D21 "02D21 "010C1 % GEORGIAN SMALL LETTER HE
-\setXTXcharcodes "02D22 "02D22 "010C2 % GEORGIAN SMALL LETTER HIE
-\setXTXcharcodes "02D23 "02D23 "010C3 % GEORGIAN SMALL LETTER WE
-\setXTXcharcodes "02D24 "02D24 "010C4 % GEORGIAN SMALL LETTER HAR
-\setXTXcharcodes "02D25 "02D25 "010C5 % GEORGIAN SMALL LETTER HOE
-\setXTXcharcodes "02D27 "02D27 "02D27 % GEORGIAN SMALL LETTER YN
-\setXTXcharcodes "02D2D "02D2D "02D2D % GEORGIAN SMALL LETTER AEN
-\setXTXcharcodes "0A640 "0A640 "0A640 % CYRILLIC CAPITAL LETTER ZEMLYA
-\setXTXcharcodes "0A641 "0A641 "0A641 % CYRILLIC SMALL LETTER ZEMLYA
-\setXTXcharcodes "0A642 "0A642 "0A642 % CYRILLIC CAPITAL LETTER DZELO
-\setXTXcharcodes "0A643 "0A643 "0A643 % CYRILLIC SMALL LETTER DZELO
-\setXTXcharcodes "0A644 "0A644 "0A644 % CYRILLIC CAPITAL LETTER REVERSED DZE
-\setXTXcharcodes "0A645 "0A645 "0A645 % CYRILLIC SMALL LETTER REVERSED DZE
-\setXTXcharcodes "0A646 "0A646 "0A646 % CYRILLIC CAPITAL LETTER IOTA
-\setXTXcharcodes "0A647 "0A647 "0A647 % CYRILLIC SMALL LETTER IOTA
-\setXTXcharcodes "0A648 "0A648 "0A648 % CYRILLIC CAPITAL LETTER DJERV
-\setXTXcharcodes "0A649 "0A649 "0A649 % CYRILLIC SMALL LETTER DJERV
-\setXTXcharcodes "0A64A "0A64A "0A64A % CYRILLIC CAPITAL LETTER MONOGRAPH UK
-\setXTXcharcodes "0A64B "0A64B "0A64B % CYRILLIC SMALL LETTER MONOGRAPH UK
-\setXTXcharcodes "0A64C "0A64C "0A64C % CYRILLIC CAPITAL LETTER BROAD OMEGA
-\setXTXcharcodes "0A64D "0A64D "0A64D % CYRILLIC SMALL LETTER BROAD OMEGA
-\setXTXcharcodes "0A64E "0A64E "0A64E % CYRILLIC CAPITAL LETTER NEUTRAL YER
-\setXTXcharcodes "0A64F "0A64F "0A64F % CYRILLIC SMALL LETTER NEUTRAL YER
-\setXTXcharcodes "0A650 "0A650 "0A650 % CYRILLIC CAPITAL LETTER YERU WITH BACK YER
-\setXTXcharcodes "0A651 "0A651 "0A651 % CYRILLIC SMALL LETTER YERU WITH BACK YER
-\setXTXcharcodes "0A652 "0A652 "0A652 % CYRILLIC CAPITAL LETTER IOTIFIED YAT
-\setXTXcharcodes "0A653 "0A653 "0A653 % CYRILLIC SMALL LETTER IOTIFIED YAT
-\setXTXcharcodes "0A654 "0A654 "0A654 % CYRILLIC CAPITAL LETTER REVERSED YU
-\setXTXcharcodes "0A655 "0A655 "0A655 % CYRILLIC SMALL LETTER REVERSED YU
-\setXTXcharcodes "0A656 "0A656 "0A656 % CYRILLIC CAPITAL LETTER IOTIFIED A
-\setXTXcharcodes "0A657 "0A657 "0A657 % CYRILLIC SMALL LETTER IOTIFIED A
-\setXTXcharcodes "0A658 "0A658 "0A658 % CYRILLIC CAPITAL LETTER CLOSED LITTLE YUS
-\setXTXcharcodes "0A659 "0A659 "0A659 % CYRILLIC SMALL LETTER CLOSED LITTLE YUS
-\setXTXcharcodes "0A65A "0A65A "0A65A % CYRILLIC CAPITAL LETTER BLENDED YUS
-\setXTXcharcodes "0A65B "0A65B "0A65B % CYRILLIC SMALL LETTER BLENDED YUS
-\setXTXcharcodes "0A65C "0A65C "0A65C % CYRILLIC CAPITAL LETTER IOTIFIED CLOSED LITTLE YUS
-\setXTXcharcodes "0A65D "0A65D "0A65D % CYRILLIC SMALL LETTER IOTIFIED CLOSED LITTLE YUS
-\setXTXcharcodes "0A65E "0A65E "0A65E % CYRILLIC CAPITAL LETTER YN
-\setXTXcharcodes "0A65F "0A65F "0A65F % CYRILLIC SMALL LETTER YN
-\setXTXcharcodes "0A660 "0A660 "0A660 % CYRILLIC CAPITAL LETTER REVERSED TSE
-\setXTXcharcodes "0A661 "0A661 "0A661 % CYRILLIC SMALL LETTER REVERSED TSE
-\setXTXcharcodes "0A662 "0A662 "0A662 % CYRILLIC CAPITAL LETTER SOFT DE
-\setXTXcharcodes "0A663 "0A663 "0A663 % CYRILLIC SMALL LETTER SOFT DE
-\setXTXcharcodes "0A664 "0A664 "0A664 % CYRILLIC CAPITAL LETTER SOFT EL
-\setXTXcharcodes "0A665 "0A665 "0A665 % CYRILLIC SMALL LETTER SOFT EL
-\setXTXcharcodes "0A666 "0A666 "0A666 % CYRILLIC CAPITAL LETTER SOFT EM
-\setXTXcharcodes "0A667 "0A667 "0A667 % CYRILLIC SMALL LETTER SOFT EM
-\setXTXcharcodes "0A668 "0A668 "0A668 % CYRILLIC CAPITAL LETTER MONOCULAR O
-\setXTXcharcodes "0A669 "0A669 "0A669 % CYRILLIC SMALL LETTER MONOCULAR O
-\setXTXcharcodes "0A66A "0A66A "0A66A % CYRILLIC CAPITAL LETTER BINOCULAR O
-\setXTXcharcodes "0A66B "0A66B "0A66B % CYRILLIC SMALL LETTER BINOCULAR O
-\setXTXcharcodes "0A66C "0A66C "0A66C % CYRILLIC CAPITAL LETTER DOUBLE MONOCULAR O
-\setXTXcharcodes "0A66D "0A66D "0A66D % CYRILLIC SMALL LETTER DOUBLE MONOCULAR O
-\setXTXcharcodes "0A680 "0A680 "0A680 % CYRILLIC CAPITAL LETTER DWE
-\setXTXcharcodes "0A681 "0A681 "0A681 % CYRILLIC SMALL LETTER DWE
-\setXTXcharcodes "0A682 "0A682 "0A682 % CYRILLIC CAPITAL LETTER DZWE
-\setXTXcharcodes "0A683 "0A683 "0A683 % CYRILLIC SMALL LETTER DZWE
-\setXTXcharcodes "0A684 "0A684 "0A684 % CYRILLIC CAPITAL LETTER ZHWE
-\setXTXcharcodes "0A685 "0A685 "0A685 % CYRILLIC SMALL LETTER ZHWE
-\setXTXcharcodes "0A686 "0A686 "0A686 % CYRILLIC CAPITAL LETTER CCHE
-\setXTXcharcodes "0A687 "0A687 "0A687 % CYRILLIC SMALL LETTER CCHE
-\setXTXcharcodes "0A688 "0A688 "0A688 % CYRILLIC CAPITAL LETTER DZZE
-\setXTXcharcodes "0A689 "0A689 "0A689 % CYRILLIC SMALL LETTER DZZE
-\setXTXcharcodes "0A68A "0A68A "0A68A % CYRILLIC CAPITAL LETTER TE WITH MIDDLE HOOK
-\setXTXcharcodes "0A68B "0A68B "0A68B % CYRILLIC SMALL LETTER TE WITH MIDDLE HOOK
-\setXTXcharcodes "0A68C "0A68C "0A68C % CYRILLIC CAPITAL LETTER TWE
-\setXTXcharcodes "0A68D "0A68D "0A68D % CYRILLIC SMALL LETTER TWE
-\setXTXcharcodes "0A68E "0A68E "0A68E % CYRILLIC CAPITAL LETTER TSWE
-\setXTXcharcodes "0A68F "0A68F "0A68F % CYRILLIC SMALL LETTER TSWE
-\setXTXcharcodes "0A690 "0A690 "0A690 % CYRILLIC CAPITAL LETTER TSSE
-\setXTXcharcodes "0A691 "0A691 "0A691 % CYRILLIC SMALL LETTER TSSE
-\setXTXcharcodes "0A692 "0A692 "0A692 % CYRILLIC CAPITAL LETTER TCHE
-\setXTXcharcodes "0A693 "0A693 "0A693 % CYRILLIC SMALL LETTER TCHE
-\setXTXcharcodes "0A694 "0A694 "0A694 % CYRILLIC CAPITAL LETTER HWE
-\setXTXcharcodes "0A695 "0A695 "0A695 % CYRILLIC SMALL LETTER HWE
-\setXTXcharcodes "0A696 "0A696 "0A696 % CYRILLIC CAPITAL LETTER SHWE
-\setXTXcharcodes "0A697 "0A697 "0A697 % CYRILLIC SMALL LETTER SHWE
-\setXTXcharcodes "0A698 "0A698 "0A698 % CYRILLIC CAPITAL LETTER DOUBLE O
-\setXTXcharcodes "0A699 "0A699 "0A699 % CYRILLIC SMALL LETTER DOUBLE O
-\setXTXcharcodes "0A69A "0A69A "0A69A % CYRILLIC CAPITAL LETTER CROSSED O
-\setXTXcharcodes "0A69B "0A69B "0A69B % CYRILLIC SMALL LETTER CROSSED O
-\setXTXcharcodes "0A722 "0A722 "0A722 % LATIN CAPITAL LETTER EGYPTOLOGICAL ALEF
-\setXTXcharcodes "0A723 "0A723 "0A723 % LATIN SMALL LETTER EGYPTOLOGICAL ALEF
-\setXTXcharcodes "0A724 "0A724 "0A724 % LATIN CAPITAL LETTER EGYPTOLOGICAL AIN
-\setXTXcharcodes "0A725 "0A725 "0A725 % LATIN SMALL LETTER EGYPTOLOGICAL AIN
-\setXTXcharcodes "0A726 "0A726 "0A726 % LATIN CAPITAL LETTER HENG
-\setXTXcharcodes "0A727 "0A727 "0A727 % LATIN SMALL LETTER HENG
-\setXTXcharcodes "0A728 "0A728 "0A728 % LATIN CAPITAL LETTER TZ
-\setXTXcharcodes "0A729 "0A729 "0A729 % LATIN SMALL LETTER TZ
-\setXTXcharcodes "0A72A "0A72A "0A72A % LATIN CAPITAL LETTER TRESILLO
-\setXTXcharcodes "0A72B "0A72B "0A72B % LATIN SMALL LETTER TRESILLO
-\setXTXcharcodes "0A72C "0A72C "0A72C % LATIN CAPITAL LETTER CUATRILLO
-\setXTXcharcodes "0A72D "0A72D "0A72D % LATIN SMALL LETTER CUATRILLO
-\setXTXcharcodes "0A72E "0A72E "0A72E % LATIN CAPITAL LETTER CUATRILLO WITH COMMA
-\setXTXcharcodes "0A72F "0A72F "0A72F % LATIN SMALL LETTER CUATRILLO WITH COMMA
-\setXTXcharcodes "0A730 "0A730 "0A730 % LATIN LETTER SMALL CAPITAL F
-\setXTXcharcodes "0A731 "0A731 "0A731 % LATIN LETTER SMALL CAPITAL S
-\setXTXcharcodes "0A732 "0A732 "0A732 % LATIN CAPITAL LETTER AA
-\setXTXcharcodes "0A733 "0A733 "0A733 % LATIN SMALL LETTER AA
-\setXTXcharcodes "0A734 "0A734 "0A734 % LATIN CAPITAL LETTER AO
-\setXTXcharcodes "0A735 "0A735 "0A735 % LATIN SMALL LETTER AO
-\setXTXcharcodes "0A736 "0A736 "0A736 % LATIN CAPITAL LETTER AU
-\setXTXcharcodes "0A737 "0A737 "0A737 % LATIN SMALL LETTER AU
-\setXTXcharcodes "0A738 "0A738 "0A738 % LATIN CAPITAL LETTER AV
-\setXTXcharcodes "0A739 "0A739 "0A739 % LATIN SMALL LETTER AV
-\setXTXcharcodes "0A73A "0A73A "0A73A % LATIN CAPITAL LETTER AV WITH HORIZONTAL BAR
-\setXTXcharcodes "0A73B "0A73B "0A73B % LATIN SMALL LETTER AV WITH HORIZONTAL BAR
-\setXTXcharcodes "0A73C "0A73C "0A73C % LATIN CAPITAL LETTER AY
-\setXTXcharcodes "0A73D "0A73D "0A73D % LATIN SMALL LETTER AY
-\setXTXcharcodes "0A73E "0A73E "0A73E % LATIN CAPITAL LETTER REVERSED C WITH DOT
-\setXTXcharcodes "0A73F "0A73F "0A73F % LATIN SMALL LETTER REVERSED C WITH DOT
-\setXTXcharcodes "0A740 "0A740 "0A740 % LATIN CAPITAL LETTER K WITH STROKE
-\setXTXcharcodes "0A741 "0A741 "0A741 % LATIN SMALL LETTER K WITH STROKE
-\setXTXcharcodes "0A742 "0A742 "0A742 % LATIN CAPITAL LETTER K WITH DIAGONAL STROKE
-\setXTXcharcodes "0A743 "0A743 "0A743 % LATIN SMALL LETTER K WITH DIAGONAL STROKE
-\setXTXcharcodes "0A744 "0A744 "0A744 % LATIN CAPITAL LETTER K WITH STROKE AND DIAGONAL STROKE
-\setXTXcharcodes "0A745 "0A745 "0A745 % LATIN SMALL LETTER K WITH STROKE AND DIAGONAL STROKE
-\setXTXcharcodes "0A746 "0A746 "0A746 % LATIN CAPITAL LETTER BROKEN L
-\setXTXcharcodes "0A747 "0A747 "0A747 % LATIN SMALL LETTER BROKEN L
-\setXTXcharcodes "0A748 "0A748 "0A748 % LATIN CAPITAL LETTER L WITH HIGH STROKE
-\setXTXcharcodes "0A749 "0A749 "0A749 % LATIN SMALL LETTER L WITH HIGH STROKE
-\setXTXcharcodes "0A74A "0A74A "0A74A % LATIN CAPITAL LETTER O WITH LONG STROKE OVERLAY
-\setXTXcharcodes "0A74B "0A74B "0A74B % LATIN SMALL LETTER O WITH LONG STROKE OVERLAY
-\setXTXcharcodes "0A74C "0A74C "0A74C % LATIN CAPITAL LETTER O WITH LOOP
-\setXTXcharcodes "0A74D "0A74D "0A74D % LATIN SMALL LETTER O WITH LOOP
-\setXTXcharcodes "0A74E "0A74E "0A74E % LATIN CAPITAL LETTER OO
-\setXTXcharcodes "0A74F "0A74F "0A74F % LATIN SMALL LETTER OO
-\setXTXcharcodes "0A750 "0A750 "0A750 % LATIN CAPITAL LETTER P WITH STROKE THROUGH DESCENDER
-\setXTXcharcodes "0A751 "0A751 "0A751 % LATIN SMALL LETTER P WITH STROKE THROUGH DESCENDER
-\setXTXcharcodes "0A752 "0A752 "0A752 % LATIN CAPITAL LETTER P WITH FLOURISH
-\setXTXcharcodes "0A753 "0A753 "0A753 % LATIN SMALL LETTER P WITH FLOURISH
-\setXTXcharcodes "0A754 "0A754 "0A754 % LATIN CAPITAL LETTER P WITH SQUIRREL TAIL
-\setXTXcharcodes "0A755 "0A755 "0A755 % LATIN SMALL LETTER P WITH SQUIRREL TAIL
-\setXTXcharcodes "0A756 "0A756 "0A756 % LATIN CAPITAL LETTER Q WITH STROKE THROUGH DESCENDER
-\setXTXcharcodes "0A757 "0A757 "0A757 % LATIN SMALL LETTER Q WITH STROKE THROUGH DESCENDER
-\setXTXcharcodes "0A758 "0A758 "0A758 % LATIN CAPITAL LETTER Q WITH DIAGONAL STROKE
-\setXTXcharcodes "0A759 "0A759 "0A759 % LATIN SMALL LETTER Q WITH DIAGONAL STROKE
-\setXTXcharcodes "0A75A "0A75A "0A75A % LATIN CAPITAL LETTER R ROTUNDA
-\setXTXcharcodes "0A75B "0A75B "0A75B % LATIN SMALL LETTER R ROTUNDA
-\setXTXcharcodes "0A75C "0A75C "0A75C % LATIN CAPITAL LETTER RUM ROTUNDA
-\setXTXcharcodes "0A75D "0A75D "0A75D % LATIN SMALL LETTER RUM ROTUNDA
-\setXTXcharcodes "0A75E "0A75E "0A75E % LATIN CAPITAL LETTER V WITH DIAGONAL STROKE
-\setXTXcharcodes "0A75F "0A75F "0A75F % LATIN SMALL LETTER V WITH DIAGONAL STROKE
-\setXTXcharcodes "0A760 "0A760 "0A760 % LATIN CAPITAL LETTER VY
-\setXTXcharcodes "0A761 "0A761 "0A761 % LATIN SMALL LETTER VY
-\setXTXcharcodes "0A762 "0A762 "0A762 % LATIN CAPITAL LETTER VISIGOTHIC Z
-\setXTXcharcodes "0A763 "0A763 "0A763 % LATIN SMALL LETTER VISIGOTHIC Z
-\setXTXcharcodes "0A764 "0A764 "0A764 % LATIN CAPITAL LETTER THORN WITH STROKE
-\setXTXcharcodes "0A765 "0A765 "0A765 % LATIN SMALL LETTER THORN WITH STROKE
-\setXTXcharcodes "0A766 "0A766 "0A766 % LATIN CAPITAL LETTER THORN WITH STROKE THROUGH DESCENDER
-\setXTXcharcodes "0A767 "0A767 "0A767 % LATIN SMALL LETTER THORN WITH STROKE THROUGH DESCENDER
-\setXTXcharcodes "0A768 "0A768 "0A768 % LATIN CAPITAL LETTER VEND
-\setXTXcharcodes "0A769 "0A769 "0A769 % LATIN SMALL LETTER VEND
-\setXTXcharcodes "0A76A "0A76A "0A76A % LATIN CAPITAL LETTER ET
-\setXTXcharcodes "0A76B "0A76B "0A76B % LATIN SMALL LETTER ET
-\setXTXcharcodes "0A76C "0A76C "0A76C % LATIN CAPITAL LETTER IS
-\setXTXcharcodes "0A76D "0A76D "0A76D % LATIN SMALL LETTER IS
-\setXTXcharcodes "0A76E "0A76E "0A76E % LATIN CAPITAL LETTER CON
-\setXTXcharcodes "0A76F "0A76F "0A76F % LATIN SMALL LETTER CON
-\setXTXcharcodes "0A771 "0A771 "0A771 % LATIN SMALL LETTER DUM
-\setXTXcharcodes "0A772 "0A772 "0A772 % LATIN SMALL LETTER LUM
-\setXTXcharcodes "0A773 "0A773 "0A773 % LATIN SMALL LETTER MUM
-\setXTXcharcodes "0A774 "0A774 "0A774 % LATIN SMALL LETTER NUM
-\setXTXcharcodes "0A775 "0A775 "0A775 % LATIN SMALL LETTER RUM
-\setXTXcharcodes "0A776 "0A776 "0A776 % LATIN LETTER SMALL CAPITAL RUM
-\setXTXcharcodes "0A777 "0A777 "0A777 % LATIN SMALL LETTER TUM
-\setXTXcharcodes "0A778 "0A778 "0A778 % LATIN SMALL LETTER UM
-\setXTXcharcodes "0A779 "0A779 "0A779 % LATIN CAPITAL LETTER INSULAR D
-\setXTXcharcodes "0A77A "0A77A "0A77A % LATIN SMALL LETTER INSULAR D
-\setXTXcharcodes "0A77B "0A77B "0A77B % LATIN CAPITAL LETTER INSULAR F
-\setXTXcharcodes "0A77C "0A77C "0A77C % LATIN SMALL LETTER INSULAR F
-\setXTXcharcodes "0A77D "0A77D "0A77D % LATIN CAPITAL LETTER INSULAR G
-\setXTXcharcodes "0A77E "0A77E "0A77E % LATIN CAPITAL LETTER TURNED INSULAR G
-\setXTXcharcodes "0A77F "0A77F "0A77F % LATIN SMALL LETTER TURNED INSULAR G
-\setXTXcharcodes "0A780 "0A780 "0A780 % LATIN CAPITAL LETTER TURNED L
-\setXTXcharcodes "0A781 "0A781 "0A781 % LATIN SMALL LETTER TURNED L
-\setXTXcharcodes "0A782 "0A782 "0A782 % LATIN CAPITAL LETTER INSULAR R
-\setXTXcharcodes "0A783 "0A783 "0A783 % LATIN SMALL LETTER INSULAR R
-\setXTXcharcodes "0A784 "0A784 "0A784 % LATIN CAPITAL LETTER INSULAR S
-\setXTXcharcodes "0A785 "0A785 "0A785 % LATIN SMALL LETTER INSULAR S
-\setXTXcharcodes "0A786 "0A786 "0A786 % LATIN CAPITAL LETTER INSULAR T
-\setXTXcharcodes "0A787 "0A787 "0A787 % LATIN SMALL LETTER INSULAR T
-\setXTXcharcodes "0A78B "0A78B "0A78B % LATIN CAPITAL LETTER SALTILLO
-\setXTXcharcodes "0A78C "0A78C "0A78C % LATIN SMALL LETTER SALTILLO
-\setXTXcharcodes "0A78D "0A78D "0A78D % LATIN CAPITAL LETTER TURNED H
-\setXTXcharcodes "0A78E "0A78E "0A78E % LATIN SMALL LETTER L WITH RETROFLEX HOOK AND BELT
-\setXTXcharcodes "0A790 "0A790 "0A790 % LATIN CAPITAL LETTER N WITH DESCENDER
-\setXTXcharcodes "0A791 "0A791 "0A791 % LATIN SMALL LETTER N WITH DESCENDER
-\setXTXcharcodes "0A792 "0A792 "0A792 % LATIN CAPITAL LETTER C WITH BAR
-\setXTXcharcodes "0A793 "0A793 "0A793 % LATIN SMALL LETTER C WITH BAR
-\setXTXcharcodes "0A794 "0A794 "0A794 % LATIN SMALL LETTER C WITH PALATAL HOOK
-\setXTXcharcodes "0A795 "0A795 "0A795 % LATIN SMALL LETTER H WITH PALATAL HOOK
-\setXTXcharcodes "0A796 "0A796 "0A796 % LATIN CAPITAL LETTER B WITH FLOURISH
-\setXTXcharcodes "0A797 "0A797 "0A797 % LATIN SMALL LETTER B WITH FLOURISH
-\setXTXcharcodes "0A798 "0A798 "0A798 % LATIN CAPITAL LETTER F WITH STROKE
-\setXTXcharcodes "0A799 "0A799 "0A799 % LATIN SMALL LETTER F WITH STROKE
-\setXTXcharcodes "0A79A "0A79A "0A79A % LATIN CAPITAL LETTER VOLAPUK AE
-\setXTXcharcodes "0A79B "0A79B "0A79B % LATIN SMALL LETTER VOLAPUK AE
-\setXTXcharcodes "0A79C "0A79C "0A79C % LATIN CAPITAL LETTER VOLAPUK OE
-\setXTXcharcodes "0A79D "0A79D "0A79D % LATIN SMALL LETTER VOLAPUK OE
-\setXTXcharcodes "0A79E "0A79E "0A79E % LATIN CAPITAL LETTER VOLAPUK UE
-\setXTXcharcodes "0A79F "0A79F "0A79F % LATIN SMALL LETTER VOLAPUK UE
-\setXTXcharcodes "0A7A0 "0A7A0 "0A7A0 % LATIN CAPITAL LETTER G WITH OBLIQUE STROKE
-\setXTXcharcodes "0A7A1 "0A7A1 "0A7A1 % LATIN SMALL LETTER G WITH OBLIQUE STROKE
-\setXTXcharcodes "0A7A2 "0A7A2 "0A7A2 % LATIN CAPITAL LETTER K WITH OBLIQUE STROKE
-\setXTXcharcodes "0A7A3 "0A7A3 "0A7A3 % LATIN SMALL LETTER K WITH OBLIQUE STROKE
-\setXTXcharcodes "0A7A4 "0A7A4 "0A7A4 % LATIN CAPITAL LETTER N WITH OBLIQUE STROKE
-\setXTXcharcodes "0A7A5 "0A7A5 "0A7A5 % LATIN SMALL LETTER N WITH OBLIQUE STROKE
-\setXTXcharcodes "0A7A6 "0A7A6 "0A7A6 % LATIN CAPITAL LETTER R WITH OBLIQUE STROKE
-\setXTXcharcodes "0A7A7 "0A7A7 "0A7A7 % LATIN SMALL LETTER R WITH OBLIQUE STROKE
-\setXTXcharcodes "0A7A8 "0A7A8 "0A7A8 % LATIN CAPITAL LETTER S WITH OBLIQUE STROKE
-\setXTXcharcodes "0A7A9 "0A7A9 "0A7A9 % LATIN SMALL LETTER S WITH OBLIQUE STROKE
-\setXTXcharcodes "0A7AA "0A7AA "0A7AA % LATIN CAPITAL LETTER H WITH HOOK
-\setXTXcharcodes "0A7AB "0A7AB "0A7AB % LATIN CAPITAL LETTER REVERSED OPEN E
-\setXTXcharcodes "0A7AC "0A7AC "0A7AC % LATIN CAPITAL LETTER SCRIPT G
-\setXTXcharcodes "0A7AD "0A7AD "0A7AD % LATIN CAPITAL LETTER L WITH BELT
-\setXTXcharcodes "0A7B0 "0A7B0 "0A7B0 % LATIN CAPITAL LETTER TURNED K
-\setXTXcharcodes "0A7B1 "0A7B1 "0A7B1 % LATIN CAPITAL LETTER TURNED T
-\setXTXcharcodes "0A7B2 "0A7B2 "0A7B2 % LATIN CAPITAL LETTER J WITH CROSSED-TAIL
-\setXTXcharcodes "0A7B3 "0A7B3 "0A7B3 % LATIN CAPITAL LETTER CHI
-\setXTXcharcodes "0A7B4 "0A7B4 "0A7B4 % LATIN CAPITAL LETTER BETA
-\setXTXcharcodes "0A7B5 "0A7B5 "0A7B5 % LATIN SMALL LETTER BETA
-\setXTXcharcodes "0A7B6 "0A7B6 "0A7B6 % LATIN CAPITAL LETTER OMEGA
-\setXTXcharcodes "0A7B7 "0A7B7 "0A7B7 % LATIN SMALL LETTER OMEGA
-\setXTXcharcodes "0A7FA "0A7FA "0A7FA % LATIN LETTER SMALL CAPITAL TURNED M
-\setXTXcharcodes "0AB30 "0AB30 "0AB30 % LATIN SMALL LETTER BARRED ALPHA
-\setXTXcharcodes "0AB31 "0AB31 "0AB31 % LATIN SMALL LETTER A REVERSED-SCHWA
-\setXTXcharcodes "0AB32 "0AB32 "0AB32 % LATIN SMALL LETTER BLACKLETTER E
-\setXTXcharcodes "0AB33 "0AB33 "0AB33 % LATIN SMALL LETTER BARRED E
-\setXTXcharcodes "0AB34 "0AB34 "0AB34 % LATIN SMALL LETTER E WITH FLOURISH
-\setXTXcharcodes "0AB35 "0AB35 "0AB35 % LATIN SMALL LETTER LENIS F
-\setXTXcharcodes "0AB36 "0AB36 "0AB36 % LATIN SMALL LETTER SCRIPT G WITH CROSSED-TAIL
-\setXTXcharcodes "0AB37 "0AB37 "0AB37 % LATIN SMALL LETTER L WITH INVERTED LAZY S
-\setXTXcharcodes "0AB38 "0AB38 "0AB38 % LATIN SMALL LETTER L WITH DOUBLE MIDDLE TILDE
-\setXTXcharcodes "0AB39 "0AB39 "0AB39 % LATIN SMALL LETTER L WITH MIDDLE RING
-\setXTXcharcodes "0AB3A "0AB3A "0AB3A % LATIN SMALL LETTER M WITH CROSSED-TAIL
-\setXTXcharcodes "0AB3B "0AB3B "0AB3B % LATIN SMALL LETTER N WITH CROSSED-TAIL
-\setXTXcharcodes "0AB3C "0AB3C "0AB3C % LATIN SMALL LETTER ENG WITH CROSSED-TAIL
-\setXTXcharcodes "0AB3D "0AB3D "0AB3D % LATIN SMALL LETTER BLACKLETTER O
-\setXTXcharcodes "0AB3E "0AB3E "0AB3E % LATIN SMALL LETTER BLACKLETTER O WITH STROKE
-\setXTXcharcodes "0AB3F "0AB3F "0AB3F % LATIN SMALL LETTER OPEN O WITH STROKE
-\setXTXcharcodes "0AB40 "0AB40 "0AB40 % LATIN SMALL LETTER INVERTED OE
-\setXTXcharcodes "0AB41 "0AB41 "0AB41 % LATIN SMALL LETTER TURNED OE WITH STROKE
-\setXTXcharcodes "0AB42 "0AB42 "0AB42 % LATIN SMALL LETTER TURNED OE WITH HORIZONTAL STROKE
-\setXTXcharcodes "0AB43 "0AB43 "0AB43 % LATIN SMALL LETTER TURNED O OPEN-O
-\setXTXcharcodes "0AB44 "0AB44 "0AB44 % LATIN SMALL LETTER TURNED O OPEN-O WITH STROKE
-\setXTXcharcodes "0AB45 "0AB45 "0AB45 % LATIN SMALL LETTER STIRRUP R
-\setXTXcharcodes "0AB46 "0AB46 "0AB46 % LATIN LETTER SMALL CAPITAL R WITH RIGHT LEG
-\setXTXcharcodes "0AB47 "0AB47 "0AB47 % LATIN SMALL LETTER R WITHOUT HANDLE
-\setXTXcharcodes "0AB48 "0AB48 "0AB48 % LATIN SMALL LETTER DOUBLE R
-\setXTXcharcodes "0AB49 "0AB49 "0AB49 % LATIN SMALL LETTER R WITH CROSSED-TAIL
-\setXTXcharcodes "0AB4A "0AB4A "0AB4A % LATIN SMALL LETTER DOUBLE R WITH CROSSED-TAIL
-\setXTXcharcodes "0AB4B "0AB4B "0AB4B % LATIN SMALL LETTER SCRIPT R
-\setXTXcharcodes "0AB4C "0AB4C "0AB4C % LATIN SMALL LETTER SCRIPT R WITH RING
-\setXTXcharcodes "0AB4D "0AB4D "0AB4D % LATIN SMALL LETTER BASELINE ESH
-\setXTXcharcodes "0AB4E "0AB4E "0AB4E % LATIN SMALL LETTER U WITH SHORT RIGHT LEG
-\setXTXcharcodes "0AB4F "0AB4F "0AB4F % LATIN SMALL LETTER U BAR WITH SHORT RIGHT LEG
-\setXTXcharcodes "0AB50 "0AB50 "0AB50 % LATIN SMALL LETTER UI
-\setXTXcharcodes "0AB51 "0AB51 "0AB51 % LATIN SMALL LETTER TURNED UI
-\setXTXcharcodes "0AB52 "0AB52 "0AB52 % LATIN SMALL LETTER U WITH LEFT HOOK
-\setXTXcharcodes "0AB53 "0AB53 "0AB53 % LATIN SMALL LETTER CHI
-\setXTXcharcodes "0AB54 "0AB54 "0AB54 % LATIN SMALL LETTER CHI WITH LOW RIGHT RING
-\setXTXcharcodes "0AB55 "0AB55 "0AB55 % LATIN SMALL LETTER CHI WITH LOW LEFT SERIF
-\setXTXcharcodes "0AB56 "0AB56 "0AB56 % LATIN SMALL LETTER X WITH LOW RIGHT RING
-\setXTXcharcodes "0AB57 "0AB57 "0AB57 % LATIN SMALL LETTER X WITH LONG LEFT LEG
-\setXTXcharcodes "0AB58 "0AB58 "0AB58 % LATIN SMALL LETTER X WITH LONG LEFT LEG AND LOW RIGHT RING
-\setXTXcharcodes "0AB59 "0AB59 "0AB59 % LATIN SMALL LETTER X WITH LONG LEFT LEG WITH SERIF
-\setXTXcharcodes "0AB5A "0AB5A "0AB5A % LATIN SMALL LETTER Y WITH SHORT RIGHT LEG
-\setXTXcharcodes "0AB60 "0AB60 "0AB60 % LATIN SMALL LETTER SAKHA YAT
-\setXTXcharcodes "0AB61 "0AB61 "0AB61 % LATIN SMALL LETTER IOTIFIED E
-\setXTXcharcodes "0AB62 "0AB62 "0AB62 % LATIN SMALL LETTER OPEN OE
-\setXTXcharcodes "0AB63 "0AB63 "0AB63 % LATIN SMALL LETTER UO
-\setXTXcharcodes "0AB64 "0AB64 "0AB64 % LATIN SMALL LETTER INVERTED ALPHA
-\setXTXcharcodes "0AB65 "0AB65 "0AB65 % GREEK LETTER SMALL CAPITAL OMEGA
-\setXTXcharcodes "0AB70 "0AB70 "0AB70 % CHEROKEE SMALL LETTER A
-\setXTXcharcodes "0AB71 "0AB71 "0AB71 % CHEROKEE SMALL LETTER E
-\setXTXcharcodes "0AB72 "0AB72 "0AB72 % CHEROKEE SMALL LETTER I
-\setXTXcharcodes "0AB73 "0AB73 "0AB73 % CHEROKEE SMALL LETTER O
-\setXTXcharcodes "0AB74 "0AB74 "0AB74 % CHEROKEE SMALL LETTER U
-\setXTXcharcodes "0AB75 "0AB75 "0AB75 % CHEROKEE SMALL LETTER V
-\setXTXcharcodes "0AB76 "0AB76 "0AB76 % CHEROKEE SMALL LETTER GA
-\setXTXcharcodes "0AB77 "0AB77 "0AB77 % CHEROKEE SMALL LETTER KA
-\setXTXcharcodes "0AB78 "0AB78 "0AB78 % CHEROKEE SMALL LETTER GE
-\setXTXcharcodes "0AB79 "0AB79 "0AB79 % CHEROKEE SMALL LETTER GI
-\setXTXcharcodes "0AB7A "0AB7A "0AB7A % CHEROKEE SMALL LETTER GO
-\setXTXcharcodes "0AB7B "0AB7B "0AB7B % CHEROKEE SMALL LETTER GU
-\setXTXcharcodes "0AB7C "0AB7C "0AB7C % CHEROKEE SMALL LETTER GV
-\setXTXcharcodes "0AB7D "0AB7D "0AB7D % CHEROKEE SMALL LETTER HA
-\setXTXcharcodes "0AB7E "0AB7E "0AB7E % CHEROKEE SMALL LETTER HE
-\setXTXcharcodes "0AB7F "0AB7F "0AB7F % CHEROKEE SMALL LETTER HI
-\setXTXcharcodes "0AB80 "0AB80 "0AB80 % CHEROKEE SMALL LETTER HO
-\setXTXcharcodes "0AB81 "0AB81 "0AB81 % CHEROKEE SMALL LETTER HU
-\setXTXcharcodes "0AB82 "0AB82 "0AB82 % CHEROKEE SMALL LETTER HV
-\setXTXcharcodes "0AB83 "0AB83 "0AB83 % CHEROKEE SMALL LETTER LA
-\setXTXcharcodes "0AB84 "0AB84 "0AB84 % CHEROKEE SMALL LETTER LE
-\setXTXcharcodes "0AB85 "0AB85 "0AB85 % CHEROKEE SMALL LETTER LI
-\setXTXcharcodes "0AB86 "0AB86 "0AB86 % CHEROKEE SMALL LETTER LO
-\setXTXcharcodes "0AB87 "0AB87 "0AB87 % CHEROKEE SMALL LETTER LU
-\setXTXcharcodes "0AB88 "0AB88 "0AB88 % CHEROKEE SMALL LETTER LV
-\setXTXcharcodes "0AB89 "0AB89 "0AB89 % CHEROKEE SMALL LETTER MA
-\setXTXcharcodes "0AB8A "0AB8A "0AB8A % CHEROKEE SMALL LETTER ME
-\setXTXcharcodes "0AB8B "0AB8B "0AB8B % CHEROKEE SMALL LETTER MI
-\setXTXcharcodes "0AB8C "0AB8C "0AB8C % CHEROKEE SMALL LETTER MO
-\setXTXcharcodes "0AB8D "0AB8D "0AB8D % CHEROKEE SMALL LETTER MU
-\setXTXcharcodes "0AB8E "0AB8E "0AB8E % CHEROKEE SMALL LETTER NA
-\setXTXcharcodes "0AB8F "0AB8F "0AB8F % CHEROKEE SMALL LETTER HNA
-\setXTXcharcodes "0AB90 "0AB90 "0AB90 % CHEROKEE SMALL LETTER NAH
-\setXTXcharcodes "0AB91 "0AB91 "0AB91 % CHEROKEE SMALL LETTER NE
-\setXTXcharcodes "0AB92 "0AB92 "0AB92 % CHEROKEE SMALL LETTER NI
-\setXTXcharcodes "0AB93 "0AB93 "0AB93 % CHEROKEE SMALL LETTER NO
-\setXTXcharcodes "0AB94 "0AB94 "0AB94 % CHEROKEE SMALL LETTER NU
-\setXTXcharcodes "0AB95 "0AB95 "0AB95 % CHEROKEE SMALL LETTER NV
-\setXTXcharcodes "0AB96 "0AB96 "0AB96 % CHEROKEE SMALL LETTER QUA
-\setXTXcharcodes "0AB97 "0AB97 "0AB97 % CHEROKEE SMALL LETTER QUE
-\setXTXcharcodes "0AB98 "0AB98 "0AB98 % CHEROKEE SMALL LETTER QUI
-\setXTXcharcodes "0AB99 "0AB99 "0AB99 % CHEROKEE SMALL LETTER QUO
-\setXTXcharcodes "0AB9A "0AB9A "0AB9A % CHEROKEE SMALL LETTER QUU
-\setXTXcharcodes "0AB9B "0AB9B "0AB9B % CHEROKEE SMALL LETTER QUV
-\setXTXcharcodes "0AB9C "0AB9C "0AB9C % CHEROKEE SMALL LETTER SA
-\setXTXcharcodes "0AB9D "0AB9D "0AB9D % CHEROKEE SMALL LETTER S
-\setXTXcharcodes "0AB9E "0AB9E "0AB9E % CHEROKEE SMALL LETTER SE
-\setXTXcharcodes "0AB9F "0AB9F "0AB9F % CHEROKEE SMALL LETTER SI
-\setXTXcharcodes "0ABA0 "0ABA0 "0ABA0 % CHEROKEE SMALL LETTER SO
-\setXTXcharcodes "0ABA1 "0ABA1 "0ABA1 % CHEROKEE SMALL LETTER SU
-\setXTXcharcodes "0ABA2 "0ABA2 "0ABA2 % CHEROKEE SMALL LETTER SV
-\setXTXcharcodes "0ABA3 "0ABA3 "0ABA3 % CHEROKEE SMALL LETTER DA
-\setXTXcharcodes "0ABA4 "0ABA4 "0ABA4 % CHEROKEE SMALL LETTER TA
-\setXTXcharcodes "0ABA5 "0ABA5 "0ABA5 % CHEROKEE SMALL LETTER DE
-\setXTXcharcodes "0ABA6 "0ABA6 "0ABA6 % CHEROKEE SMALL LETTER TE
-\setXTXcharcodes "0ABA7 "0ABA7 "0ABA7 % CHEROKEE SMALL LETTER DI
-\setXTXcharcodes "0ABA8 "0ABA8 "0ABA8 % CHEROKEE SMALL LETTER TI
-\setXTXcharcodes "0ABA9 "0ABA9 "0ABA9 % CHEROKEE SMALL LETTER DO
-\setXTXcharcodes "0ABAA "0ABAA "0ABAA % CHEROKEE SMALL LETTER DU
-\setXTXcharcodes "0ABAB "0ABAB "0ABAB % CHEROKEE SMALL LETTER DV
-\setXTXcharcodes "0ABAC "0ABAC "0ABAC % CHEROKEE SMALL LETTER DLA
-\setXTXcharcodes "0ABAD "0ABAD "0ABAD % CHEROKEE SMALL LETTER TLA
-\setXTXcharcodes "0ABAE "0ABAE "0ABAE % CHEROKEE SMALL LETTER TLE
-\setXTXcharcodes "0ABAF "0ABAF "0ABAF % CHEROKEE SMALL LETTER TLI
-\setXTXcharcodes "0ABB0 "0ABB0 "0ABB0 % CHEROKEE SMALL LETTER TLO
-\setXTXcharcodes "0ABB1 "0ABB1 "0ABB1 % CHEROKEE SMALL LETTER TLU
-\setXTXcharcodes "0ABB2 "0ABB2 "0ABB2 % CHEROKEE SMALL LETTER TLV
-\setXTXcharcodes "0ABB3 "0ABB3 "0ABB3 % CHEROKEE SMALL LETTER TSA
-\setXTXcharcodes "0ABB4 "0ABB4 "0ABB4 % CHEROKEE SMALL LETTER TSE
-\setXTXcharcodes "0ABB5 "0ABB5 "0ABB5 % CHEROKEE SMALL LETTER TSI
-\setXTXcharcodes "0ABB6 "0ABB6 "0ABB6 % CHEROKEE SMALL LETTER TSO
-\setXTXcharcodes "0ABB7 "0ABB7 "0ABB7 % CHEROKEE SMALL LETTER TSU
-\setXTXcharcodes "0ABB8 "0ABB8 "0ABB8 % CHEROKEE SMALL LETTER TSV
-\setXTXcharcodes "0ABB9 "0ABB9 "0ABB9 % CHEROKEE SMALL LETTER WA
-\setXTXcharcodes "0ABBA "0ABBA "0ABBA % CHEROKEE SMALL LETTER WE
-\setXTXcharcodes "0ABBB "0ABBB "0ABBB % CHEROKEE SMALL LETTER WI
-\setXTXcharcodes "0ABBC "0ABBC "0ABBC % CHEROKEE SMALL LETTER WO
-\setXTXcharcodes "0ABBD "0ABBD "0ABBD % CHEROKEE SMALL LETTER WU
-\setXTXcharcodes "0ABBE "0ABBE "0ABBE % CHEROKEE SMALL LETTER WV
-\setXTXcharcodes "0ABBF "0ABBF "0ABBF % CHEROKEE SMALL LETTER YA
-\setXTXcharcodes "0FB00 "0FB00 "0FB00 % LATIN SMALL LIGATURE FF
-\setXTXcharcodes "0FB01 "0FB01 "0FB01 % LATIN SMALL LIGATURE FI
-\setXTXcharcodes "0FB02 "0FB02 "0FB02 % LATIN SMALL LIGATURE FL
-\setXTXcharcodes "0FB03 "0FB03 "0FB03 % LATIN SMALL LIGATURE FFI
-\setXTXcharcodes "0FB04 "0FB04 "0FB04 % LATIN SMALL LIGATURE FFL
-\setXTXcharcodes "0FB05 "0FB05 "0FB05 % LATIN SMALL LIGATURE LONG S T
-\setXTXcharcodes "0FB06 "0FB06 "0FB06 % LATIN SMALL LIGATURE ST
-\setXTXcharcodes "0FB13 "0FB13 "0FB13 % ARMENIAN SMALL LIGATURE MEN NOW
-\setXTXcharcodes "0FB14 "0FB14 "0FB14 % ARMENIAN SMALL LIGATURE MEN ECH
-\setXTXcharcodes "0FB15 "0FB15 "0FB15 % ARMENIAN SMALL LIGATURE MEN INI
-\setXTXcharcodes "0FB16 "0FB16 "0FB16 % ARMENIAN SMALL LIGATURE VEW NOW
-\setXTXcharcodes "0FB17 "0FB17 "0FB17 % ARMENIAN SMALL LIGATURE MEN XEH
-\setXTXcharcodes "0FF21 "0FF41 "0FF21 % FULLWIDTH LATIN CAPITAL LETTER A
-\setXTXcharcodes "0FF22 "0FF42 "0FF22 % FULLWIDTH LATIN CAPITAL LETTER B
-\setXTXcharcodes "0FF23 "0FF43 "0FF23 % FULLWIDTH LATIN CAPITAL LETTER C
-\setXTXcharcodes "0FF24 "0FF44 "0FF24 % FULLWIDTH LATIN CAPITAL LETTER D
-\setXTXcharcodes "0FF25 "0FF45 "0FF25 % FULLWIDTH LATIN CAPITAL LETTER E
-\setXTXcharcodes "0FF26 "0FF46 "0FF26 % FULLWIDTH LATIN CAPITAL LETTER F
-\setXTXcharcodes "0FF27 "0FF47 "0FF27 % FULLWIDTH LATIN CAPITAL LETTER G
-\setXTXcharcodes "0FF28 "0FF48 "0FF28 % FULLWIDTH LATIN CAPITAL LETTER H
-\setXTXcharcodes "0FF29 "0FF49 "0FF29 % FULLWIDTH LATIN CAPITAL LETTER I
-\setXTXcharcodes "0FF2A "0FF4A "0FF2A % FULLWIDTH LATIN CAPITAL LETTER J
-\setXTXcharcodes "0FF2B "0FF4B "0FF2B % FULLWIDTH LATIN CAPITAL LETTER K
-\setXTXcharcodes "0FF2C "0FF4C "0FF2C % FULLWIDTH LATIN CAPITAL LETTER L
-\setXTXcharcodes "0FF2D "0FF4D "0FF2D % FULLWIDTH LATIN CAPITAL LETTER M
-\setXTXcharcodes "0FF2E "0FF4E "0FF2E % FULLWIDTH LATIN CAPITAL LETTER N
-\setXTXcharcodes "0FF2F "0FF4F "0FF2F % FULLWIDTH LATIN CAPITAL LETTER O
-\setXTXcharcodes "0FF30 "0FF50 "0FF30 % FULLWIDTH LATIN CAPITAL LETTER P
-\setXTXcharcodes "0FF31 "0FF51 "0FF31 % FULLWIDTH LATIN CAPITAL LETTER Q
-\setXTXcharcodes "0FF32 "0FF52 "0FF32 % FULLWIDTH LATIN CAPITAL LETTER R
-\setXTXcharcodes "0FF33 "0FF53 "0FF33 % FULLWIDTH LATIN CAPITAL LETTER S
-\setXTXcharcodes "0FF34 "0FF54 "0FF34 % FULLWIDTH LATIN CAPITAL LETTER T
-\setXTXcharcodes "0FF35 "0FF55 "0FF35 % FULLWIDTH LATIN CAPITAL LETTER U
-\setXTXcharcodes "0FF36 "0FF56 "0FF36 % FULLWIDTH LATIN CAPITAL LETTER V
-\setXTXcharcodes "0FF37 "0FF57 "0FF37 % FULLWIDTH LATIN CAPITAL LETTER W
-\setXTXcharcodes "0FF38 "0FF58 "0FF38 % FULLWIDTH LATIN CAPITAL LETTER X
-\setXTXcharcodes "0FF39 "0FF59 "0FF39 % FULLWIDTH LATIN CAPITAL LETTER Y
-\setXTXcharcodes "0FF3A "0FF5A "0FF3A % FULLWIDTH LATIN CAPITAL LETTER Z
-\setXTXcharcodes "0FF41 "0FF41 "0FF21 % FULLWIDTH LATIN SMALL LETTER A
-\setXTXcharcodes "0FF42 "0FF42 "0FF22 % FULLWIDTH LATIN SMALL LETTER B
-\setXTXcharcodes "0FF43 "0FF43 "0FF23 % FULLWIDTH LATIN SMALL LETTER C
-\setXTXcharcodes "0FF44 "0FF44 "0FF24 % FULLWIDTH LATIN SMALL LETTER D
-\setXTXcharcodes "0FF45 "0FF45 "0FF25 % FULLWIDTH LATIN SMALL LETTER E
-\setXTXcharcodes "0FF46 "0FF46 "0FF26 % FULLWIDTH LATIN SMALL LETTER F
-\setXTXcharcodes "0FF47 "0FF47 "0FF27 % FULLWIDTH LATIN SMALL LETTER G
-\setXTXcharcodes "0FF48 "0FF48 "0FF28 % FULLWIDTH LATIN SMALL LETTER H
-\setXTXcharcodes "0FF49 "0FF49 "0FF29 % FULLWIDTH LATIN SMALL LETTER I
-\setXTXcharcodes "0FF4A "0FF4A "0FF2A % FULLWIDTH LATIN SMALL LETTER J
-\setXTXcharcodes "0FF4B "0FF4B "0FF2B % FULLWIDTH LATIN SMALL LETTER K
-\setXTXcharcodes "0FF4C "0FF4C "0FF2C % FULLWIDTH LATIN SMALL LETTER L
-\setXTXcharcodes "0FF4D "0FF4D "0FF2D % FULLWIDTH LATIN SMALL LETTER M
-\setXTXcharcodes "0FF4E "0FF4E "0FF2E % FULLWIDTH LATIN SMALL LETTER N
-\setXTXcharcodes "0FF4F "0FF4F "0FF2F % FULLWIDTH LATIN SMALL LETTER O
-\setXTXcharcodes "0FF50 "0FF50 "0FF30 % FULLWIDTH LATIN SMALL LETTER P
-\setXTXcharcodes "0FF51 "0FF51 "0FF31 % FULLWIDTH LATIN SMALL LETTER Q
-\setXTXcharcodes "0FF52 "0FF52 "0FF32 % FULLWIDTH LATIN SMALL LETTER R
-\setXTXcharcodes "0FF53 "0FF53 "0FF33 % FULLWIDTH LATIN SMALL LETTER S
-\setXTXcharcodes "0FF54 "0FF54 "0FF34 % FULLWIDTH LATIN SMALL LETTER T
-\setXTXcharcodes "0FF55 "0FF55 "0FF35 % FULLWIDTH LATIN SMALL LETTER U
-\setXTXcharcodes "0FF56 "0FF56 "0FF36 % FULLWIDTH LATIN SMALL LETTER V
-\setXTXcharcodes "0FF57 "0FF57 "0FF37 % FULLWIDTH LATIN SMALL LETTER W
-\setXTXcharcodes "0FF58 "0FF58 "0FF38 % FULLWIDTH LATIN SMALL LETTER X
-\setXTXcharcodes "0FF59 "0FF59 "0FF39 % FULLWIDTH LATIN SMALL LETTER Y
-\setXTXcharcodes "0FF5A "0FF5A "0FF3A % FULLWIDTH LATIN SMALL LETTER Z
-
-
-% patch needed for turkish
-
-\setXTXcharcodes "201C "201C "201C
-\setXTXcharcodes "201D "201D "201D
-
-% patch needed for french
-
-\setXTXcharcodes "2019 "2019 "2019
-
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-cml.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-cml.mkii
deleted file mode 100644
index 6da7fd26f87..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-cml.mkii
+++ /dev/null
@@ -1,228 +0,0 @@
-% see mathml, == \defineXMLdirective [mathml] \setupMMLappearance
-
-% will be rewritten avoiding the mapper
-
-\useXMLfilter[map]
-
-\unprotect
-
-\def\setupCMLappearance[#1]{\dodoubleargument\getparameters[@@CML#1]}
-
-\defineXMLdirective [chemml] \setupCMLappearance
-
-\defineXMLargument [chem] \doXMLchem
-\defineXMLargument [ichem] \doXMLichem
-\defineXMLargument [dchem] \doXMLdchem
-
-\unexpanded\def\doXMLchem {\ifhmode\@EA\doXMLichem\else\@EA\doXMLdchem\fi}
-\unexpanded\def\doXMLichem{\XMLremapdata[cml]{$\rm}{$}}
-\unexpanded\def\doXMLdchem{\XMLremapdata[cml]{\dostartformula{}\rm}{\dostopformula}}
-
-\startXMLmapping [cml]
-
-\remapXMLsequence [molecule] [CPA] \doCMLmolecule
-\remapXMLsequence [ion] [CPA] \doCMLion
-\remapXMLsequence [atom] [CPA] \doCMLatom
-
-\setupCMLappearance [ion] [\c!alternative=\v!a]
-
-\let\CMLtopcaption\empty
-\let\CMLbotcaption\empty
-
-\def\someCMLtext#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$}
-
-\def\doifnotXMLzero#1#2#3%
- {\ifcase\XMLpar{#1}{#2}{0}\else#3{\XMLpar{#1}{#2}{0}}\fi}
-
-\newcounter\currentCMLatom
-\newcounter\nofCMLatoms
-
-\def\doCMLmolecule#1#2%
- {\resetCMLcaption
- \processXMLRchild{caption}{#2}%
- \someCMLtext
- {\bgroup
- \newcounter\currentCMLatom
- \newcounter\nofCMLatoms
- \getXMLarguments{cml-m}{n="0" #1}%
- \doifnotXMLzero{cml-m}{n}\firstofoneargument
- \ignorespaces
- \processXMLRchild{atom,ion,bond/,singlebond/,doublebond/,triplebond/}{#2}%
- \unskip
- \egroup}%
- \ignorespaces}
-
-\def\doCMLion#1#2%
- {\resetCMLcaption
- \processXMLRchild{caption}{#2}%
- \someCMLtext
- {\bgroup
- \newcounter\currentCMLatom
- \newcounter\nofCMLatoms
- \getXMLarguments{cml-i}{n="0" charge="0" #1}%
- \doifnotXMLzero{cml-i}{n}\firstofoneargument
- \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
- \ignorespaces
- \processXMLRchild{atom,bond/,singlebond/,doublebond/,triplebond/}{#2}%
- \unskip}%
- \egroup}%
- \ignorespaces}
-
-\def\doCMLatom#1#2%
- {\getXMLarguments{cml-a}{n="0" weight="0" protons="0" charge="0" #1}%
- \increment\currentCMLatom
- \resetCMLcaption
- \someCMLtext
- {\bgroup
- \lohi
- {\doifnotXMLzero{cml-a}{protons}\CMLscript}
- {\doifnotXMLzero{cml-a}{weight}\CMLscript}%
- \ignorespaces#2\unskip
- \lohi
- {\doifnotXMLzero{cml-a}{n}\CMLscript}
- {\ifnum\nofCMLatoms=\currentCMLatom\relax
- \doifnotXMLzero{cml-i}{charge}\CMLscript
- \else
- \doifnotXMLzero{cml-a}{charge}\CMLscript
- \fi}%
- \egroup}%
- \ignorespaces}
-
-\remapXMLsequence [reaction] [CPA] \doCMLreaction
-
-\let\someCMLsymbol\gobbleoneargument
-\let\someCMLarrow \gobblethreearguments
-
-\def\doCMLreaction#1#2%
- {\begingroup
- \let\someCMLsymbol\dosomeCMLsymbol
- \let\someCMLarrow \dosomeCMLarrow
- #2%
- \endgroup}
-
-\remapXMLsequence [plus] [CPA] \doCMLplus
-\remapXMLsingular [plus] [CPA] \doCMLplus
-\remapXMLsequence [minus] [CPA] \doCMLminus
-\remapXMLsingular [minus] [CPA] \doCMLminus
-\remapXMLsequence [equal] [CPA] \doCMLequal
-\remapXMLsingular [equal] [CPA] \doCMLequal
-
-\def\doCMLplus #1#2{\someCMLsymbol{+}}
-\def\doCMLminus#1#2{\someCMLsymbol{-}}
-\def\doCMLequal#1#2{\someCMLsymbol{=}}
-
-\def\dosomeCMLsymbol#1%
- {\quad\mathop{#1}\quad}
-
-\remapXMLsequence [gives] [CPA] \doCMLgives
-\remapXMLsingular [gives] [CPA] \doCMLgives
-\remapXMLsequence [equilibrium] [CPA] \doCMLequilibrium
-\remapXMLsingular [equilibrium] [CPA] \doCMLequilibrium
-\remapXMLsequence [mesomeric] [CPA] \doCMLmesomeric
-\remapXMLsingular [mesomeric] [CPA] \doCMLmesomeric
-
-\def\doCMLgives #1#2{\resetCMLcaption#2\someCMLgives }
-\def\doCMLequilibrium#1#2{\resetCMLcaption#2\someCMLequilibrium}
-\def\doCMLmesomeric #1#2{\resetCMLcaption#2\someCMLmesomeric }
-
-\def\dosomeCMLarrow#1%
- {\quad
- \someCMLtext
- {$\vcenter{\offinterlineskip\halign{##\cr\hskip3em\cr#1\cr}}$}%
- \quad}
-
-\def\someCMLgives
- {\someCMLarrow{\rightarrowfill}}
-
-\def\someCMLequilibrium
- {\someCMLarrow{\rightarrowfill\cr\noalign{\nointerlineskip}\leftarrowfill}}
-
-\def\someCMLmesomeric
- {\someCMLarrow{$\leftarrow\hskip-1em$\rightarrowfill}}
-
-\remapXMLsequence [cml] [caption] [CPA] \doCMLcaption
-
-\let\CMLtopcaption\empty
-\let\CMLbotcaption\empty
-
-\def\dodoCMLcaption#1#2%
- {\def\CMLbotcaption{#2}%
- \def\doCMLcaption##1##2%
- {\def\CMLtopcaption{##2}%
- \let\doCMLcaption\gobbletwoarguments}}
-
-\def\resetCMLcaption
- {\let\CMLtopcaption\empty
- \let\CMLbotcaption\empty
- \let\doCMLcaption\dodoCMLcaption}
-
-\resetCMLcaption
-
-\remapXMLsingular [bond] [CPA] \doCMLbond
-\remapXMLsingular [singlebond] [CPA] \doCMLsinglebond
-\remapXMLsingular [doublebond] [CPA] \doCMLdoublebond
-\remapXMLsingular [triplebond] [CPA] \doCMLtriplebond
-
-\def\doCMLbond#1#2%
- {\getXMLarguments{cml-b}{n="0" #1}%
- \ifcase\XMLpar{cml-b}{n}{0}\relax
- \doCMLsinglebond
- \or
- \doCMLdoublebond
- \or
- \doCMLtriplebond
- \fi}
-
-\def\someCMLbond
- {\hrule \!!width \hsize \!!height .1ex} % .4pt
-
-\def\dosomeCMLbond#1#2#3%
- {{\setbox\scratchbox=\hbox{$M$}%
- \vbox to \ht\scratchbox
- {\hsize\wd\scratchbox
- \vskip.1\wd\scratchbox
- #1\vfill#2\vfill#3%
- \vskip.1\wd\scratchbox}}}
-
-\def\doCMLsinglebond
- {\dosomeCMLbond\relax\someCMLbond\relax}
-
-\def\doCMLdoublebond
- {\dosomeCMLbond\someCMLbond\relax\someCMLbond}
-
-\def\doCMLtriplebond
- {\dosomeCMLbond\someCMLbond\someCMLbond\someCMLbond}
-
-\stopXMLmapping
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-ent.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-ent.mkii
deleted file mode 100644
index 09051d0b435..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-ent.mkii
+++ /dev/null
@@ -1,117 +0,0 @@
-%D \module
-%D [ file=xtag-ent,
-%D version=2000.12.20,
-%D title=\CONTEXT\ XML Macros,
-%D subtitle=A bunch of Entities,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% We need this for French and Hungarian.
-
-\defineXMLentity [colon] {\directdiscretionary{:}}
-\defineXMLentity [semicolon] {\directdiscretionary{;}}
-\defineXMLentity [questionmark] {\directdiscretionary{?}}
-\defineXMLentity [exclamationmark] {\directdiscretionary{!}}
-
-% These will fall back to the raw encoding vector
-
-\defineXMLentity [Aacute] {\Aacute}
-\defineXMLentity [aacute] {\aacute}
-\defineXMLentity [Cacute] {\Cacute} % unofficial
-\defineXMLentity [cacute] {\cacute} % unofficial
-\defineXMLentity [Eacute] {\Eacute}
-\defineXMLentity [eacute] {\eacute}
-\defineXMLentity [Iacute] {\Iacute}
-\defineXMLentity [iacute] {\iacute}
-\defineXMLentity [Oacute] {\Oacute}
-\defineXMLentity [oacute] {\oacute}
-\defineXMLentity [Uacute] {\Uacute}
-\defineXMLentity [uacute] {\uacute}
-\defineXMLentity [Yacute] {\Yacute}
-\defineXMLentity [yacute] {\yacute}
-\defineXMLentity [Nacute] {\Nacute}
-\defineXMLentity [nacute] {\nacute}
-
-\defineXMLentity [Ccedil] {\Ccedilla}
-\defineXMLentity [ccedil] {\ccedilla}
-
-\defineXMLentity [AElig] {\AEligature}
-\defineXMLentity [aelig] {\aeligature}
-
-\defineXMLentity [Agrave] {\Agrave}
-\defineXMLentity [agrave] {\agrave}
-\defineXMLentity [Egrave] {\Egrave}
-\defineXMLentity [egrave] {\egrave}
-\defineXMLentity [Igrave] {\Igrave}
-\defineXMLentity [igrave] {\igrave}
-\defineXMLentity [Ograve] {\Ograve}
-\defineXMLentity [ograve] {\ograve}
-\defineXMLentity [Ugrave] {\Ugrave}
-\defineXMLentity [ugrave] {\ugrave}
-
-\defineXMLentity [THORN] {\Thorn}
-\defineXMLentity [thorn] {\thorn}
-
-\defineXMLentity [Aring] {\Aring}
-\defineXMLentity [aring] {\aring}
-
-\defineXMLentity [Oslash] {\Oslash} % stroke
-\defineXMLentity [oslash] {\oslash}
-\defineXMLentity [Lslash] {\Lslash} % unofficial
-\defineXMLentity [lslash] {\lslash} % unofficial
-
-\defineXMLentity [eth] {\eth} % ?
-\defineXMLentity [ETH] {\Eth} % ?
-
-\defineXMLentity [Atilde] {\Atilde}
-\defineXMLentity [atilde] {\atilde}
-\defineXMLentity [Etilde] {\Etilde}
-\defineXMLentity [etilde] {\etilde}
-\defineXMLentity [Itilde] {\Itilde}
-\defineXMLentity [itilde] {\itilde}
-\defineXMLentity [Ntilde] {\Ntilde}
-\defineXMLentity [ntilde] {\ntilde}
-\defineXMLentity [Otilde] {\Otilde}
-\defineXMLentity [otilde] {\otilde}
-\defineXMLentity [Utilde] {\Utilde}
-\defineXMLentity [utilde] {\utilde}
-
-\defineXMLentity [Auml] {\Adiaeresis}
-\defineXMLentity [auml] {\adiaeresis}
-\defineXMLentity [Euml] {\Ediaeresis}
-\defineXMLentity [euml] {\ediaeresis}
-\defineXMLentity [Iuml] {\Idiaeresis}
-\defineXMLentity [iuml] {\idiaeresis}
-\defineXMLentity [Ouml] {\Odiaeresis}
-\defineXMLentity [ouml] {\odiaeresis}
-\defineXMLentity [Uuml] {\Udiaeresis}
-\defineXMLentity [uuml] {\udiaeresis}
-\defineXMLentity [Yuml] {\Ydiaeresis}
-\defineXMLentity [yuml] {\ydiaeresis}
-
-\defineXMLentity [szlig] {\Ssharp}
-
-\defineXMLentity [Acirc] {\Acircumflex}
-\defineXMLentity [acirc] {\acircumflex}
-\defineXMLentity [Ecirc] {\Ecircumflex}
-\defineXMLentity [ecirc] {\ecircumflex}
-\defineXMLentity [Icirc] {\Icircumflex}
-\defineXMLentity [icirc] {\icircumflex}
-\defineXMLentity [Ocirc] {\Ocircumflex}
-\defineXMLentity [ocirc] {\ocircumflex}
-\defineXMLentity [Ucirc] {\Ucircumflex}
-\defineXMLentity [ucirc] {\ucircumflex}
-
-\defineXMLentity [ccaron] {\ccaron} % unofficial
-\defineXMLentity [rcaron] {\rcaron} % unofficial
-\defineXMLentity [scaron] {\scaron} % unofficial
-\defineXMLentity [zcaron] {\zcaron} % unofficial
-
-\defineXMLentity [dots] {\unknown}
-\defineXMLentity [amp] {\&}
-\defineXMLentity [nbsp] {\nonbreakablespace}
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-exp.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-exp.mkii
deleted file mode 100644
index 9ecfcc5b124..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-exp.mkii
+++ /dev/null
@@ -1,90 +0,0 @@
-%D \module
-%D [ file=xtag-exp,
-%D version=2001.08.20,
-%D title=\CONTEXT\ XML Macros,
-%D subtitle=Expansion,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 / Expansion}
-
-\ifnum\texengine=\luatexengine \endinput \fi
-
-\unprotect
-
-%D Files
-
-\newcounter\XMLfilenesting \let\restoreXMLelements\relax
-
-\def\startXMLreading
- {\increment \XMLfilenesting \relax
- \ifcase\XMLfilenesting\or
- \ifprocessingXML
- \let\restoreXMLelements\relax
- \else
- \let\restoreXMLelements\disableXMLelements
- \enableXMLelements
- \fi
- \fi}
-
-\def\stopXMLreading
- {\ifcase\XMLfilenesting\or
- \restoreXMLelements
- \let\restoreXMLelements\relax
- \fi
- \decrement \XMLfilenesting \relax}
-
-\ifnum\texengine=\luatexengine
- \def\enableXMLfiledata
- {\prependtoks \enableXMLelements \to \mainoutput % brrr, will change
- \appendtoks \forcefileexpansiontrue \to \everyenableXML
- \let\enableXMLfiledata\relax}
-\else
- \def\enableXMLfiledata
- {\prependtoks \enableXMLelements \to \mainoutput % brrr, will change
- \appendtoks \startXMLreading \to \everybeforeutilityread
- \appendtoks \stopXMLreading \to \everyafterutilityread
- \appendtoks \forcefileexpansiontrue \to \everyenableXML
- \let\enableXMLfiledata\relax}
-\fi
-
-\setupXMLprocessing[\c!state=\v!start]
-
-\appendtoks
- \ifproductionrun \enableXMLfiledata \fi
-\to \aftersetupXMLprocessing
-
-%D Here we overload the mark handler.
-
-\ifnum\texengine=\luatexengine \else
-
- \def\XMLexpanded#1%
- {\bgroup
- \honorunexpanded
- \dontexpandencoding
- \xdef\@@globalexpanded{\noexpand#1}% why \noexpand?
- \egroup
- \@@globalexpanded}
-
- \let\normalsetnormalmark\setnormalmark
-
- \long\def\setnormalmark#1% overloaded
- {\ifprocessingXML
- \expandafter\setXMLexpandedmark
- \else
- \expandafter\normalsetnormalmark
- \fi#1}
-
- \def\setXMLexpandedmark#1#2% using a tok prevents unwanted expansion in mark
- {\XMLexpanded{\scratchtoks{\enableXMLelements#2}}%
- \setxvalue{\@@crk\string#1}{\the\scratchtoks}%
- \normalmarks#1{\the\scratchtoks}}
-
-\fi
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-ext.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-ext.mkii
deleted file mode 100644
index 60615b1c241..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-ext.mkii
+++ /dev/null
@@ -1,439 +0,0 @@
-%D \module
-%D [ file=xtag-ext,
-%D version=2001.03.21,
-%D title=\CONTEXT\ XML Macros,
-%D subtitle=Extra Macros,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 / Extras}
-
-\unprotect
-
-%D \macros
-%D {startXMLmapping}
-%D
-%D You can define macros within a namespace, so that they
-%D will not conflict (don't confuse this with \XML\
-%D namespaces.)
-%D
-%D \starttyping
-%D \startXMLmapping [tag] | [-] [tag] | [+] [tag]
-%D definitions
-%D \stopXMLmapping
-%D \stoptyping
-%D
-%D When a \type {[+]} is specified, the mappings will
-%D nest.
-
-\def\resetXMLmapping
- {\let\@@XMLelement\normal@@XMLelement
- \let\@@XMLmapping\empty}
-
-\resetXMLmapping
-
-\def\startXMLmapping
- {\dodoubleempty\dostartXMLmapping}
-
-% \def\dostartXMLmapping[#1][#2]% sneller maken
-% {\pushmacro\@@XMLelement
-% \pushmacro\@@XMLmapping
-% \ifsecondargument
-% \doifelse{#1}{-}
-% {\donostartXMLmapping{#2}}
-% {\doifelse{#1}{+}
-% {\dodostartXMLmapping{#2}}
-% {\donostartXMLmapping{#2}}}%
-% \else
-% \donostartXMLmapping{#1}%
-% \fi
-% \unprotect}
-
-\def\dostartXMLmapping[#1#2][#3]%
- {\pushmacro\@@XMLelement
- \pushmacro\@@XMLmapping
- \ifsecondargument
- \if\noexpand#1-%
- \@EA\donostartXMLmapping
- \else\if\noexpand#1+%
- \@EAEAEA\dodostartXMLmapping
- \else
- \@EAEAEA\donostartXMLmapping
- \fi\fi{#3}%
- \else
- \donostartXMLmapping{#1#2}%
- \fi
- \unprotect}
-
-\def\donostartXMLmapping#1%
- {\let\@@XMLprevelement\@@XMLelement
- \edef\@@XMLmapping{#1}%
- \edef\@@XMLelement{\normal@@XMLelement+#1}}
-
-\def\dodostartXMLmapping#1%
- {\let\@@XMLprevelement\@@XMLelement
- \edef\@@XMLmapping{\@@XMLmapping+#1}%
- \edef\@@XMLelement{\@@XMLelement+#1}}
-
-\def\stopXMLmapping
- {\protect
- \popmacro\@@XMLmapping
- \popmacro\@@XMLelement}
-
-%D \macros
-%D {startXMLmappinggroup}
-%D
-%D Imagine something:
-%D
-%D \starttyping
-%D \defineXMLenvironment [something]
-%D {\startXMLmapping[whatever]}
-%D {\stopXMLmapping}
-%D \stoptyping
-%D
-%D Here the \type {\stopXMLmapping} will never be reached
-%D because we are in a mapping. Therefore we need:
-
-\def\startXMLmappinggroup
- {\dodoubleempty\dostartXMLmappinggroup}
-
-\def\dostartXMLmappinggroup[#1][#2]%
- {\bgroup
- \letcscsname\savedXMLmeaning\csname\@@XMLelement:/\currentXMLelement\endcsname
- \dostartXMLmapping[#1][#2]% do ! else wrong !
- \letcsnamecs\csname\@@XMLelement:/\currentXMLelement\endcsname\savedXMLmeaning}
-
-\def\stopXMLmappinggroup
- {\stopXMLmapping
- \egroup}
-
-%D Context Directives:
-
-\def\@@CTXML{@@CTXML}
-
-\def\defineXMLdirective
- {\dodoubleempty\dodefineXMLdirective}
-
-\long\def\dodefineXMLdirective[#1][#2]#3%
- {\defineXMLprocessor[context-#1-directive]{\dohandleXMLdirective{#1}{#3}}%
- \ifsecondargument
- \long\setvalue{\@@CTXML-#1-#2}{#3}%
- \fi}
-
-\def\dohandleXMLdirective#1#2#3%
- {\dodohandleXMLdirective#3 @ @ @\end{#1}{#2}}
-
-%\def\dodohandleXMLdirective#1 #2 #3 #4\end#5#6%
-% {\doifdefinedelse{\@@CTXML-#5-#1}
-% {\getvalue{\@@CTXML-#5-#1}[#2=#3]}
-% {#6[#1][#2=#3]}}
-
-\def\dodohandleXMLdirective#1 #2 #3 #4\end#5#6%
- {\executeifdefined{\@@CTXML-#5-#1}{#6[#1]}[#2=#3]}
-
-% \defineXMLdirective [mathml] \setupMMLappearance % [#1][#2=#3]
-% \defineXMLdirective [flowchart] [shapes] \setupFLOWshapes % [#2=#3]
-% \defineXMLdirective [flowchart] [lines] \setupFLOWlines % [#2=#3]
-
-\defineXMLprocessor [context-begin-group] {\bgroup\gobbleoneargument}
-\defineXMLprocessor [context-end-group] {\egroup\gobbleoneargument}
-
-% \def\XMLnspart#1:#2\empty{#1} % call ...:\empty\empty
-% \def\XMLidpart#1:#2#3\empty{\ifx#2\empty#1\else\XMLidpart#2#3\empty\empty\fi}
-
-% trial macros (used in setupx), to be sped up !
-
-\bgroup \catcode`\<=\activecatcode
-
-\gdef\saveXMLasdata#1#2% name raw data
- {\dodoglobal\setevalue{\@@XMLsave:#1}{#2}} % \edef!
-
-\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
- {\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
- {\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}
-\gdef\gsaveXMLdatainelement{\doglobal\saveXMLdatainelement}
-\gdef\gsaveXMLdatastructure{\doglobal\saveXMLdatastructure}
-
-\gdef\doifelseXMLelement#1%
- {\doifdefinedelse{\@@XMLsave:#1}}
-
-\gdef\doifelseXMLelementcontent#1%
- {\ifcsname\@@XMLsave:#1\endcsname
- \bgroup
- \@EA\defconvertedcommand\@EA\ascii\csname\@@XMLsave:#1\endcsname
- \setbox\scratchbox\hbox{\ignorespaces\ascii\unskip\unskip\unskip}%
- \ifdim\wd\scratchbox>\zeropoint
- \egroup\@EAEAEA\firstoftwoarguments
- \else
- \egroup\@EAEAEA\secondoftwoarguments
- \fi
- \else
- \@EA\secondoftwoarguments
- \fi}
-
-\gdef\doifelseXMLelementequals#1#2%
- {\ifcsname\@@XMLsave:#1\endcsname
- \bgroup
- \@EA\defconvertedcommand\@EA\asciia\csname\@@XMLsave:#1\endcsname
- \defconvertedargument\asciib{#2}%
- \ifx\asciia\asciib
- \egroup\@EAEAEA\firstoftwoarguments
- \else
- \egroup\@EAEAEA\secondoftwoarguments
- \fi
- \else
- \@EA\secondoftwoarguments
- \fi}
-
-\gdef\doifXMLtextelse#1% new
- {\doiftextelse{\simplifyXMLelements#1}}
-
-\gdef\doifXMLtext#1#2% new
- {\doiftextelse{\simplifyXMLelements#1}{#2}\donothing}
-
-\gdef\convertXMLelement#1\to#2%
- {\ifcsname\@@XMLsave:#1\endcsname
- \@EA\defconvertedcommand\@EA#2\csname\@@XMLsave:#1\endcsname
- \else
- \let#2\ascii
- \fi}
-
-\gdef\flushXMLelement#1%
- {\csname
- \@@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%
- {\showvalue{\@@XMLsave:#1}}
-
-\gdef\eraseXMLelement#1%
- {\dodoglobal\letbeundefined{\@@XMLsave:#1}}
-
-\gdef\geraseXMLelement
- {\doglobal\eraseXMLelement}
-
-\gdef\processXMLelement#1%
- {\bgroup
- \enableXMLelements
- \getvalue{\@@XMLsave:#1}%
- \egroup}
-
-\gdef\texXMLelement#1%
- {\begingroup
-% \setnormalcatcodes
- \disableXML
- \scantokens\@EA\@EA\@EA{\csname\@@XMLsave:#1\endcsname}%
- \endgroup}
-
-\gdef\reduceXMLescapeentities
- {\setXMLentity{amp}{\string&}%
- \setXMLentity{lt}{\string<}%
- \setXMLentity{gt}{\string>}%
- \setXMLentity{quot}{\string'}%
- \setXMLentity{dquot}{\string"}}
-
-\gdef\reduceXMLelement#1\to#2%
- {\ifcsname\@@XMLsave:#1\endcsname
- \bgroup
- \reduceXMLescapetokens
- \reduceXMLescapeentities
- \expanded{\egroup\noexpand\def\noexpand#2{\csname\@@XMLsave:#1\endcsname}}%
- \else
- \let#2\empty
- \fi}
-
-\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}}
-
-% \def\XMLnoschema{standalone='yes'}
-
-\def\writtenXMLelement #1#2{<#1>#2</#1>}
-\def\writtenXMLstart #1{<#1>}
-\def\writtenXMLend #1{</#1>}
-\def\writtenXMLempty #1{<#1/>}
-\def\writtenXMLelementcs#1#2{\ifx#2\empty\else<#1>#2</#1>\fi}
-\def\writtenXMLemptycs #1#2{\ifx#2\empty<#1/>\else<#1>#2</#1>\fi}
-
-%D This one can be used to get sound tuo files.
-%D
-%D \starttyping
-%D \setuphead[chapter][expansion=xml]
-%D % \setuplist[chapter][textcommand=\enableXML]
-%D
-%D \enableregime[utf] \autoXMLentitiestrue
-%D \stoptyping
-%D
-%D with:
-%D
-%D \starttyping
-%D <chapter>test &#xEB; test &ediaeresis; test <e>ediaeresis</e></chapter>
-%D \stoptyping
-%D
-%D This gives:
-%D
-%D \starttyping
-%D test ë test</b> <e>ediaeresis</e> test <e>ediaeresis</e>
-%D \stoptyping
-
-\def\XMLprocessingparameter#1%
- {\csname\??xp#1\endcsname}
-
-\appendtoks
- \defineXMLargument[\XMLprocessingparameter\c!escape]\getXMLentity
-\to \aftersetupXMLprocessing
-
-\setupXMLprocessing
- [\c!escape=e]
-
-\bgroup \catcode`\<=\activecatcode
-
-\long\gdef\defexpandedxmlargument#1#2#3%
- {\begingroup
- \let\uppercase\firstofoneargument
- \def\getXMLhexcharacter##1{\numbertoutp{"##1}}% maps to private if needed
- \def\getXMLdeccharacter##1{\numbertoutp {##1}}% maps to private if needed
- \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{#3}%
- \endgroup
- #1#2\@@globalexpanded}
-
-\egroup
-
-% test.xml: <test>test % test</test>
-%
-% \starttext
-% \enableregime[utf] \chardef\XMLtokensreduction=0
-% \setuphead[chapter][expansion=xml]
-% \defineXMLargument[test]{\chapter}
-% \placelist[chapter][criterium=text]
-% \processXMLfilegrouped{test.xml}
-% \stoptext
-
-% obsolete in mkiv
-
-\chardef\xmlexpandmode\plusone
-
-\def\defexpandedxmlargumentcmd {\chardef\xmlexpandmode\plusone\defexpandedxmlargument\defconvertedcommand}
-\def\defexpandedxmlargumentutf {\chardef\xmlexpandmode\plustwo\defexpandedxmlargument\defconvertedcommand}
-\def\gdefexpandedxmlargumentcmd{\chardef\xmlexpandmode\plusone\defexpandedxmlargument\gdefconvertedcommand}
-\def\gdefexpandedxmlargumentutf{\chardef\xmlexpandmode\plustwo\defexpandedxmlargument\gdefconvertedcommand}
-
-\installexpander {xml} \defexpandedxmlargumentcmd \gdefexpandedxmlargumentcmd
-\installexpander {xml:cmd} \defexpandedxmlargumentcmd \gdefexpandedxmlargumentcmd
-\installexpander {xml:utf} \defexpandedxmlargumentutf \gdefexpandedxmlargumentutf
-
-\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]
-
-%D Undocumented ...
-
-\def\defineXMLstore {\doquadrupleargument\dodefineXMLstore[\saveXMLasdata]}
-\def\defineXMLgstore{\doquadrupleargument\dodefineXMLstore[\gsaveXMLasdata]}
-
-\def\dodefineXMLstore[#1][#2][#3][#4]% element attribute prefix % will become faster
- {\defineXMLargument[#2][#3=\s!dummy]{#1{#4:\XMLop{#3}}}}
-
-\def\countXMLchildren[#1]#2%
- {\startnointerference
- \doglobal\newcounter\nofXMLchildren
- \defineXMLargument[#1]{\doglobal\increment\nofXMLchildren}%
- \startXMLignore
- #2%
- \stopXMLignore
- \stopnointerference}
-
-% Typical \MKII. We will not explore this route any further as in \MKIV\ we
-% have better ways.
-
-\prependtoks \setnormalcatcodes \to \everyTEXinputmode
-\appendtoks \processingXMLfalse \to \everyTEXinputmode
-
-\let\normalenableXML\enableXML % some day we move the normal \enableXML into the toks
-
-\prependtoks \normalenableXML \to \everyXMLinputmode
-\appendtoks \processingXMLtrue \to \everyXMLinputmode
-
-\unexpanded\def\enableXML {\setinputmode[XML]} % \enableXML is used in edef's and marks
-\unexpanded\def\disableXML{\setinputmode[TEX]}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-hyp.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-hyp.mkii
deleted file mode 100644
index 105f1a1e373..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-hyp.mkii
+++ /dev/null
@@ -1,69 +0,0 @@
-%D \module
-%D [ file=xtag-hyp,
-%D version=2003.11.24,
-%D title=\CONTEXT\ XML MAcros,
-%D subtitle=Hyphenation,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-\writestatus{loading}{ConTeXt XML Macros / Hyphenation}
-
-%D This filter is kind of obsolete, since \UTF\ is not
-%D limited to \XML. So, here we only enable \UTF\ support.
-
-\ifnum\texengine=\luatexengine
- \defineXMLenvironment [hyphenations] [language=\currentlanguage,regime=utf,encoding=\defaultencoding]
- {\startnointerference
- \defineXMLargument [hyphenation] \hyphenation
- \language[\XMLop{language}]}
- {\stopnointerference}
-\else
- \defineXMLenvironment [hyphenations] [language=\currentlanguage,regime=utf,encoding=\defaultencoding]
- {\startnointerference
- \defineXMLargument [hyphenation] \hyphenation
- \language[\XMLop{language}]%
- \enableregime[\XMLop{regime}]%
- \enableencoding[\XMLop{encoding}]}
- {\stopnointerference}
-\fi
-
-\defineXMLsingular [hyphenate]
- {\-}
-
-\defineXMLgrouped [language] [code=\currentlanguage,scope=local]
- {\doifelse{\XMLop{scope}}{global}\mainlanguage\language[\XMLop{code}]}
-
-\defineXMLsingular [language] [code=\currentlanguage]
- {\doifelse{\XMLop{scope}}{global}\mainlanguage\language[\XMLop{code}]}
-
-\defineXMLsingular [compound] [token=-]
- {\expanded{\directdiscretionary{\XMLop{token}}}}
-
-\endinput
-
-% \mainlanguage[nl] \setupbodyfont[pos] \useXMLfilter[utf,hyp]
-%
-% \starttext
-%
-% \hyphenatedword{pati\ediaeresis nten}
-% \hyphenatedword{pati\ediaeresis ntenorganisatie}
-% \hyphenatedword{pati\ediaeresis ntenplatform}
-%
-% \startXMLdata
-% <hyphenations language='nl' regime='utf'>
-% <hyphenation>pa-tiën-ten</hyphenation>
-% <hyphenation>pa-tiën-ten-or-ga-ni-sa-tie</hyphenation>
-% <hyphenation>pa-tiën-ten-plat-form</hyphenation>
-% </hyphenations>
-% \stopXMLdata
-%
-% \hyphenatedword{pati\ediaeresis nten}
-% \hyphenatedword{pati\ediaeresis ntenorganisatie}
-% \hyphenatedword{pati\ediaeresis ntenplatform}
-%
-% \stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-ini.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-ini.mkii
deleted file mode 100644
index ce3cbacd0b1..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-ini.mkii
+++ /dev/null
@@ -1,3026 +0,0 @@
-%D \module
-%D [ file=xtag-ini,
-%D version=2000.12.20,
-%D title=\CONTEXT\ XML Macros,
-%D subtitle=Initialization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 / Initialization}
-
-%D Beware: don't rely on \longempty things, since this may
-%D change!
-
-\ifdefined\keeputfcharacters \else \let\keeputfcharacters\relax \fi % for mkiv
-\ifdefined\utfunicodetracer \else \newconstant\utfunicodetracer \fi % for mkiv
-
-%D \macros
-%D {defineinputmode,setinputmode}
-%D
-%D For old times sake we still support:
-
-\unexpanded\def\defineinputmode[#1]{\expandafter\newtoks\csname every#1inputmode\endcsname}
-\unexpanded\def\setinputmode [#1]{\the\executeifdefined{every#1inputmode}\emptytoks}
-
-\defineinputmode [TEX]
-\defineinputmode [XML]
-
-\setinputmode [TEX]
-
-%D Finally we make sure that the compound handler keeps doingits job.
-
-\ifx\normalcompound\undefined \let\normalcompound=| \fi
-
-\appendtoks \catcode`|=\activecatcode \let|\normalcompound \to \everyTEXinputmode
-\appendtoks \catcode`|=\lettercatcode \to \everyXMLinputmode
-
-%D This module is highly optimized for speed, which sometimes
-%D leads to rather unreadable code. Sorry for this.
-
-\bgroup \obeylines
-
-\gdef\startXMLdefinitions% keep %
- {\bgroup\obeylines\dostartXMLdefinitions}
-
-\gdef\dostartXMLdefinitions #1
- {\egroup\doifsomething{#1}{\writestatus{XML}{loading #1 support}}}
-
-\global\let\stopXMLdefinitions\relax
-
-\egroup
-
-% todo: XMLfullsave == also attributes
-% csnames
-% XMLelse -> elseXML
-
-%D Remark: some hard coded character things will be replaced
-%D by named glyphs as soon as the upgraded encoding modules
-%D are released. At that moment, unicode support will be
-%D provided in accordance with the normal support in \CONTEXT.
-
-%D Like it or not, this module deals with angle bracketed
-%D input. Processing \XML\ alike input in \CONTEXT\ has been
-%D possible since 1995, and till 2000 several methods ran in
-%D parallel. These were implemented in modules like the semi
-%D public \type {m-sgml}.
-%D
-%D There is not one optimal solution for processing \XML\ data.
-%D The oldest method was based on a very simple preprocessor
-%D written in \MODULA\ and later \PERL: \type {<command>} was
-%D converted into \type {\begSGML[command]} and optional
-%D parameters were passed.
-%D
-%D A second method uses a \PERL\ or \XSL\ transformation
-%D script that produces \CONTEXT\ commands. This method is
-%D much slower, mainly because the whole document is read into
-%D memory and a document tree is to be build. The advantage is
-%D that processing of the resulting document is fast.
-%D
-%D The third method uses a basic parser written in the \TEX\
-%D language, and apart from a few pitfalls, this method is
-%D clean and efficient, but not always robust. Because errors
-%D in the input are not catched on forehand, processing in
-%D \TEX\ may fail due to errors. But, given that a document
-%D can be validated on forehand, this is no big problem.
-%D
-%D Each method has its advantage, but especially the third
-%D method puts some demands on \CONTEXT, since no interference
-%D between the parser and the core commands may occur. What
-%D method is used, depends on the situation.
-%D
-%D All three methods introduce some problems in interfacing to
-%D core \CONTEXT\ functionality. This is due to the fact that
-%D sometimes we want to typeset content directly, while in
-%D other cases we just want to pick up data for later usage,
-%D either or not using delimited arguments. And, when moving
-%D data around, there is always the expansion problem to deal
-%D with.
-%D
-%D As can be expected, we have to map begin and end tags onto
-%D \CONTEXT's start- and stopcommands. This is the easy part.
-%D When we have to pass the content of an element to a macro
-%D as argument, we need to do a delimited grab. Such mappings
-%D are not that hard to implement and were part of \type
-%D {m-sgml.tex} already. New in this core module is nested
-%D grabbing. Also new here is the support for namespaces and
-%D extensive attribute handling. On the other hand, recursive
-%D traceback of attributes is no longer supported. Because
-%D this feature was not really used, we can hereby safely we
-%D declare the \type {m-sgml.tex} module obsolete.
-%D
-%D In order to be able to incorporate \XML\ style definitions
-%D into basic \TEX\ styles, we will provide some basic
-%D functionality in the core itself. Some of the functionality
-%D can be set up with this general command. We use a token
-%D list register to handle post||setup actions. This permits
-%D us to extend this command.
-
-\unprotect
-
-\newtoks\aftersetupXMLprocessing
-
-\def\setupXMLprocessing
- {\dosingleargument\dosetupXMLprocessing}
-
-\def\dosetupXMLprocessing[#1]%
- {\getparameters[\??xp][#1]\the\aftersetupXMLprocessing}
-
-\def\XMLprocessingparameter#1%
- {\csname\??xp#1\endcsname}
-
-\protect
-
-%D Formally an \XML\ file starts with an unique sequence
-%D \type {<?xml}, but in most of the unilities that come with
-%D \CONTEXT\ we will be more tolerant, and gobble preceding
-%D spaces.
-
-\def\XMLbanner#1{\string<\string ?xml version='1.0' #1\string ?\string>}
-
-%D We will be dealing with elements, which means that we have
-%D to take care of \type {<this>} and \type {</that>}, but
-%D also with \type {<such/>} and \type {<so />}. In some cases
-%D the upper and lowercase alternatives need to be dealt with,
-%D although this is not realy needed since XML is case
-%D sensitive.
-%D
-%D We also have to handle entities, like \type {&you;} and
-%D \type {&me;}. These are quite easy to deal with and need to
-%D be hooked into the encoding and abbreviation mechanisms.
-%D
-%D And then there are the parameters to be taken care of. Here
-%D we meet \type {key="value"} but also \type {key='eulav'}
-%D and even the spacy \typ {key = "value"}.
-%D
-%D Since we have to handlers for each element and entity, we
-%D will create a few namespaces. Special care has to be
-%D given to preformated code.
-%D
-%D There are two namespace mechanisms in place: one for
-%D \TEX, and one for \XML. The later mechanism permits
-%D remapping and ignoring.
-
-\unprotect
-
-\def \@@XML {XML:}
-\edef\@@XMLentity {\@@XML ent} % &crap;
-\edef\@@XMLelement {\@@XML ele} % <this> </this> <that/>
-\edef\@@XMLvariable {\@@XML var} % key="val"
-\edef\@@XMLvalue {\@@XML val} % key="val"
-\edef\@@XMLpars {\@@XML par} %
-\edef\@@XMLdata {\@@XML dat} % mem buffer
-\edef\@@XMLcode {\@@XML cod} % named mem buffers
-\edef\@@XMLinstruction {\@@XML ins} % <?
-\edef\@@XMLmap {\@@XML map} % mapping on context attr
-\edef\@@XMLlist {\@@XML lst} %
-\edef\@@XMLnamespace {\@@XML nam} % namespace:element
-\edef\@@XMLurlspace {\@@XML url} %
-\edef\@@XMLescape {\@@XML esc} % <!
-\edef\@@XMLdepth {\@@XML dep} % used to track nesting
-\edef\@@XMLdopth {\@@XML dop} % used to track nesting
-\edef\@@XMLsave {\@@XML sav} % namespace for saved elements
-
-\iffalse % slightly faster
-
-\edef\@@XML {*}
-\edef\@@XMLentity {\@@XML a} % &crap;
-\edef\@@XMLelement {\@@XML b} % <this> </this> <that/>
-\edef\@@XMLvariable {\@@XML c} % key="val"
-\edef\@@XMLvalue {\@@XML d} % key="val"
-\edef\@@XMLpars {\@@XML e} %
-\edef\@@XMLdata {\@@XML f} % mem buffer
-\edef\@@XMLcode {\@@XML g} % named mem buffers
-\edef\@@XMLinstruction {\@@XML h} % <?
-\edef\@@XMLmap {\@@XML i} % mapping on context attr
-\edef\@@XMLlist {\@@XML j} %
-\edef\@@XMLnamespace {\@@XML k} % namespace:element
-\edef\@@XMLurlspace {\@@XML l} %
-\edef\@@XMLescape {\@@XML m} % <!
-\edef\@@XMLdepth {\@@XML n} % used to track nesting
-\edef\@@XMLdopth {\@@XML o} % used to track nesting
-\edef\@@XMLsave {\@@XML p} % namespace for saved elements
-
-\fi
-
-\let\normal@@XMLelement\@@XMLelement % we may overload this one later inside a group
-
-\newtoks\XMLtoks
-\newtoks\XMLresetlist
-
-\newif\ifignoreXMLspaces
-\newif\iffixedXMLfont
-\newif\iftraceXMLelements
-\newif\ifprocessingXML
-
-\newcount\XMLlevel % scratchcounter
-\newcount\XMLdepth % used here
-
-\newtoks\everyenableXML
-
-%D We will implement the parser by making a few characters
-%D active. For that reason we also have to save their
-%D original meaning.
-
-%D \macros
-%D {enableXML}
-%D
-%D The macro \type {\enableXML} will be used to turn on the
-%D parser. This means that after that, \TEX\ commands starting
-%D with a backslash will not longer be read as such. There is
-%D a way around this, but for convenience \TEXEXEC\ will take
-%D care of processing raw \XML\ files in a transparant way.
-
-% cmr -- best for tui and such
-%
-% \chardef\XMLtokensreduction\zerocount
-%
-% lmr -- best but problematic for tui file:
-
-\chardef\XMLtokensreduction\plustwo
-
-% \def\alwaysreduceXMLtokens {\XMLtokensreduction\plusone}
-% \def\permanentreduceXMLtokens{\XMLtokensreduction\plustwo}
-
-% part of this should move to a low level module
-
-% we predefine some macros, just to satisfy the dep parser
-
-\let\enableXMLexpansion \relax
-\let\disableXMLexpansion \relax
-\let\enableXML \relax
-\let\activateXMLescapetokens\relax
-\let\entitleXMLescapetokens \relax
-\let\reduceXMLescapetokens \relax
-\let\ignoreXMLescapetokens \relax
-\let\enableXMLelements \relax
-\let\disableXMLelements \relax
-
-% \bgroup
-% \catcode`\*=\commentcatcode
-% \catcode`\.=\escapecatcode
-% .catcode`.B=.begingroupcatcode
-% .catcode`.E=.endgroupcatcode
-% .catcode`.P=.parametercatcode
-%
-% .catcode`.&=.activecatcode
-% .catcode`.<=.activecatcode
-%
-% .catcode`.#=.activecatcode
-% .catcode`.$=.activecatcode
-% .catcode`.%=.activecatcode
-% .catcode`.\=.activecatcode
-% .catcode`.^=.activecatcode
-% .catcode`._=.activecatcode
-% .catcode`.{=.activecatcode
-% .catcode`.}=.activecatcode
-% .catcode`.|=.activecatcode
-% .catcode`.~=.activecatcode
-%
-% .gdef.enableXMLexpansion
-% B.def<B.doXMLelementE.let&=.doXMLentityE
-%
-% .gdef.disableXMLexpansion
-% B.unexpanded.def<B.doXMLelementE.let&=.doXMLentityE
-%
-% * internally the # becomes two #'s (before expanding, during
-% * the parsing stage) which is why we let the first # gobble
-% * the second one
-% *
-% * since this only takes place when reading arguments, as in
-% * \startXMLdata ... cum, suis, we can take place of it
-% * there; this is needed because reading from file goes wrong
-% * (eating up argument)
-%
-% .unexpanded.gdef.enableXML
-% B.catcode`.!=.othercatcode
-% .catcode`.?=.othercatcode
-% .catcode`.:=.othercatcode * active in french
-% .catcode`.;=.othercatcode * active in french
-% .catcode`.&=.activecatcode
-% .catcode`.<=.activecatcode
-% .catcode`.>=.othercatcode
-% .catcode`."=.othercatcode
-% .catcode`./=.othercatcode
-% .catcode`.'=.othercatcode
-% .catcode`.~=.othercatcode
-% .catcode`.#=.othercatcode
-% .let &=.doXMLentity
-% .unexpanded.def<B.doXMLelementE*
-% .ifcase.XMLtokensreduction
-% .entitleXMLescapetokens
-% .or
-% .reduceXMLescapetokens
-% .else
-% .ignoreXMLescapetokens
-% .fi
-% .processingXMLtrue
-% .the.everyenableXML
-% E
-%
-% .gdef.activateXMLescapetokens
-% B.catcode`.$=.activecatcode
-% .catcode`.%=.activecatcode
-% .catcode`.\=.activecatcode
-% .catcode`.^=.activecatcode
-% .catcode`._=.activecatcode
-% .catcode`.{=.activecatcode
-% .catcode`.}=.activecatcode
-% .catcode`.|=.activecatcode
-% E
-%
-% .xdef.entitleXMLescapetokens
-% B.noexpand.activateXMLescapetokens
-% .noexpand.def.noexpand#B.noexpand&.string#035;E*
-% .noexpand.def.noexpand$B.noexpand&.string#036;E*
-% .noexpand.def.noexpand%B.noexpand&.string#037;E*
-% .noexpand.def.noexpand\B.noexpand&.string#092;E*
-% .noexpand.def.noexpand^B.noexpand&.string#094;E*
-% .noexpand.def.noexpand_B.noexpand&.string#095;E*
-% .noexpand.def.noexpand{B.noexpand&.string#123;E*
-% .noexpand.def.noexpand}B.noexpand&.string#125;E*
-% .noexpand.def.noexpand|B.noexpand&.string#124;E*
-% E
-%
-% .gdef.reduceXMLescapetokens
-% B.activateXMLescapetokens
-% .def#B.string#E*
-% .def$B.string$E*
-% .def%B.string%E*
-% .def\B.string\E*
-% .def^B.string^E*
-% .def_B.string_E*
-% .def{B.string{E*
-% .def}B.string}E*
-% .def|B.string|E*
-% E
-%
-% .gdef.ignoreXMLescapetokens
-% B.catcode`.$=.othercatcode
-% .catcode`.%=.othercatcode
-% .catcode`.\=.othercatcode
-% .catcode`.^=.othercatcode
-% .catcode`._=.othercatcode
-% .catcode`.{=.othercatcode
-% .catcode`.}=.othercatcode
-% .catcode`.|=.othercatcode
-% E
-%
-% * The following macro can be invokes when reading from
-% * an auxiliary file.
-%
-% .unexpanded.gdef.enableXMLelements
-% B.catcode60=.activecatcode * .catcode`.<=.activecatcode
-% .catcode62=.othercatcode * .catcode`.>=.other
-% .unexpanded.def<B.doXMLelementE*
-% .processingXMLtrue
-% E
-%
-% .unexpanded.gdef.disableXMLelements
-% B.catcode60=.activecatcode * .catcode`.<=.activecatcode
-% .catcode62=.othercatcode * .catcode`.>=.othercatcode
-% .let<.relax * new
-% .processingXMLfalse
-% E
-%
-% .global.let<.relax * new
-% .global.let&.relax * new
-%
-% .egroup
-%
-% \def\disableXML
-% {\setnormalcatcodes\processingXMLfalse}
-
-\defcatcodecommand\xmlcatcodese 046 \doXMLentity
-\defcatcodecommand\xmlcatcodese 060 \doXMLelement
-\defcatcodecommand\xmlcatcodesr 046 \doXMLentity
-\defcatcodecommand\xmlcatcodesr 060 \doXMLelement
-\defcatcodecommand\xmlcatcodesn 046 \doXMLentity
-\defcatcodecommand\xmlcatcodesn 060 \doXMLelement
-
-\letcatcodecommand\xmlcatcodesr 035 \letterhash
-\letcatcodecommand\xmlcatcodesr 036 \letterdollar
-\letcatcodecommand\xmlcatcodesr 037 \letterpercent
-\letcatcodecommand\xmlcatcodesr 092 \letterbackslash
-\letcatcodecommand\xmlcatcodesr 094 \letterhat
-\letcatcodecommand\xmlcatcodesr 095 \letterunderscore
-\letcatcodecommand\xmlcatcodesr 123 \letterleftbrace
-\letcatcodecommand\xmlcatcodesr 125 \letterrightbrace
-\letcatcodecommand\xmlcatcodesr 124 \letterbar
-
-\bgroup \catcode`\&=13 \let&\relax
-
-\xdef\entityhash {&\string#035;}
-\xdef\entitydollar {&\string#036;}
-\xdef\entitypercent {&\string#037;}
-\xdef\entitybackslash {&\string#092;}
-\xdef\entityhat {&\string#094;}
-\xdef\entityunderscore{&\string#095;}
-\xdef\entityleftbrace {&\string#123;}
-\xdef\entityrightbrace{&\string#125;}
-\xdef\entitybar {&\string#124;}
-
-\egroup
-
-\letcatcodecommand\xmlcatcodese 035 \entityhash
-\letcatcodecommand\xmlcatcodese 036 \entitydollar
-\letcatcodecommand\xmlcatcodese 037 \entitypercent
-\letcatcodecommand\xmlcatcodese 092 \entitybackslash
-\letcatcodecommand\xmlcatcodese 094 \entityhat
-\letcatcodecommand\xmlcatcodese 095 \entityunderscore
-\letcatcodecommand\xmlcatcodese 123 \entityleftbrace
-\letcatcodecommand\xmlcatcodese 125 \entityrightbrace
-\letcatcodecommand\xmlcatcodese 124 \entitybar
-
-% we speed things up by explicitly setting the active char's < &
-
-\doifmodeelse {mkiv} {
-
- \def\mksetXMLtokensreduction % mkiv
- {\setcatcodetable\xmlcatcodesn}
-
-} {
-
- \def\mksetXMLtokensreduction % mkii
- {\ifcase\XMLtokensreduction
- \setcatcodetable\xmlcatcodese \or
- \setcatcodetable\xmlcatcodesr \else
- \setcatcodetable\xmlcatcodesn
- \fi}
-
-}
-
-\bgroup \catcode`\<=13 \catcode`\&=13
-
-\gdef\enableXML
- {\mksetXMLtokensreduction
- \let&\doXMLentity
- \unexpanded\def<{\doXMLelement}%
- \processingXMLtrue
- \the\everyenableXML}
-
-\gdef\disableXML
- {\setcatcodetable\ctxcatcodes % maybe \texcatcodes
- \processingXMLfalse}
-
-\gdef\enableXMLexpansion
- {\def<{\doXMLelement}%
- \let&\doXMLentity}
-
-\gdef\disableXMLexpansion
- {\unexpanded\def<{\doXMLelement}%
- \let&\doXMLentity}
-
-\unexpanded\gdef\enableXMLelements
- {\catcode60=\activecatcode
- \catcode62=\othercatcode
- \unexpanded\def<{\doXMLelement}%
- \processingXMLtrue}
-
-\unexpanded\gdef\disableXMLelements
- {\catcode60=\activecatcode
- \catcode62=\othercatcode
- \let<\relax
- \processingXMLfalse}
-
-\global\let<\relax
-\global\let&\relax
-
-\egroup
-
-%D An element can be singular or paired. A singular element is
-%D called an empty element. The following definitions are
-%D equivalent:
-%D
-%D \starttyping
-%D <eerste></eerste> <eerste/> <eerste />
-%D \stoptyping
-%D
-%D Empty elements can have arguments too. Conforming the
-%D standard, each key must have a value. These are separated
-%D by an \type {=} sign and the value is delimited by either
-%D \type {"} or \type {'}. There may be spaces around the
-%D equal sign.
-%D
-%D \starttyping
-%D <eerste a= "b" c ="d" /> <eerste a = "b" c="d"/>
-%D \stoptyping
-%D
-%D Officially the following definition is not valid:
-%D
-%D \starttyping
-%D <eerste>some text</eerste> <eerste/> <eerste />
-%D \stoptyping
-%D
-%D Although we can handle both cases independently, this is
-%D seldom needed.
-%D
-%D Processing instructions are identified by a~\type {?} and are
-%D like empty elements.
-%D
-%D \starttyping
-%D <?doel a="b" c="d"?> <?doel a="b" c="d" ?>
-%D \stoptyping
-%D
-%D Comment is formatted as follows.
-%D
-%D \starttyping
-%D <!-- comment -->
-%D \stoptyping
-%D
-%D Verbatim code inits purest form is called \type {CDATA} and
-%D is embedded in the following ugly and therefore recognizable
-%D way:
-%D
-%D \starttyping
-%D <![CDATA[
-%D Dit is nogal verbatim !
-%D Dit is nogal verbatim !
-%D Dit is nogal verbatim !
-%D ]]>
-%D \stoptyping
-
-%D The parser is implemented as a multi||step macro. Because
-%D \type {!} and \type {?} should be picked up correctly, we
-%D need to define a few macros in unprotected mode!
-%D
-%D Because \XML\ is defined with some restrictions in mind,
-%D parsing the elements is not that complicated. First we have
-%D to determine if we're dealing with a comment or processing
-%D instruction. We need a bit of grouping because we have to
-%D mess up with catcodes. We probably have to treat a few
-%D more catcode and first character cases. We need to use
-%D \type {\begingroup} here, otherwise we get funny spaces in
-%D math.
-
-%D Maybe I will remove grouping here and introduce \type
-%D {\obeyXMLlines}.
-
-%D By using a few {\expandafter}'s we can avoid a \type {\next}
-%D construction. We could speed the first char test up a bit
-%D by using an installer and something \typ {\getvalue
-%D {#1doXMLelement}} (todo).
-
-\protect % we need an normal ! ?
-
-% \long\def\doXMLelement#1%
-% {\if#1!\expandafter \xparseXMLescape \else
-% \if#1?\expandafter\expandafter\expandafter \xparseXMLprocess \else
-% \expandafter\expandafter\expandafter \xparseXMLelement \fi\fi
-% #1}
-
-\def\expandthree{\expandafter\expandafter\expandafter}
-
-\long\def\doXMLelement#1%
- {\if#1!\expandafter \xparseXMLescape \else
- \if#1?\expandthree \xparseXMLprocess \else
- \expandthree \xparseXMLelement \fi\fi
- #1}
-
-% does it end with ? or ?>
-
-\long\def\xparseXMLescape !#1 {\parseXMLescape{#1}}
-\long\def\xparseXMLprocess ?#1 #2>{\parseXMLprocess{#1}{#2}}
-\long\def\xparseXMLelement #1>{\parseXMLelement #1 >}
-
-%D The escape handler takes care of the fuzzy \type {<!}
-%D constructs. Unfortunately, we need to catch \type {<--text}
-%D too, so we need another handler:
-
-\long\def\xparseXMLescape !#1#2%
- {\if#1-%
- \if#2-%
- \expandafter\expandafter\expandafter\xxparseXMLescape
- \else
- \expandafter\expandafter\expandafter\xyparseXMLescape
- \fi
- \else
- \if#1[%
- \expandafter\expandafter\expandafter\xzparseXMLescape
- \else
- \expandafter\expandafter\expandafter\xyparseXMLescape
- \fi
- \fi#1#2}
-
-\long\def\xxparseXMLescape--#1{\parseXMLescape{--}#1}
-\long\def\xyparseXMLescape#1 {\parseXMLescape{#1}}
-\long\def\xzparseXMLescape[#1[{\parseXMLescape{#1}}
-
-%D Now the real work can begin.
-
-\unprotect
-
-\def\defineXMLescape[#1]#2%
- {\unspaceargument#1\to\ascii % get rid of {}, like in {CDATA[}
- \long\setvalue{\@@XMLescape:\ascii}{#2}}
-
-\def\parseXMLescape#1% #2> parsing takes place in macros
- {\executeifdefined{\@@XMLescape:#1}{\csname\@@XMLescape:\s!default\endcsname}}
-
-%D In our case, processing instructions are only needed if
-%D we want specific \CONTEXT\ support. This may be useful in
-%D applications where the data is generated by an
-%D application. We will implement a \CONTEXT\ code handler
-%D later.
-
-%D The processing instructions handler is implemented as
-%D follows.
-
-\long\def\defineXMLprocessor[#1]#2%
- {\long\setvalue{\@@XMLinstruction:#1}{#2}}
-
-% \def\parseXMLprocess#1#2%
-% {\executeifdefined{\@@XMLinstruction:#1}\gobbleoneargument{#2}}
-
-%D Because we support \type {.. ?>} as well as \type {.. >}
-%D end||of||pi situations, we need to clean up the ending
-%D \type {?}.
-
-\protect
-
-\long\def\cleanupXMLprocess#1%
- {\docleanupXMLprocess#1 ? \relax}
-
-\long\def\docleanupXMLprocess#1? #2\relax
- {\def\currentXMLprocess{#1}}
-
-\unprotect
-
-\def\parseXMLprocess#1#2%
- {\cleanupXMLprocess{#2}%
- \defconvertedcommand\ascii{#1}%
- %\writestatus{xml-process}{\ascii}
- \expanded
- {\executeifdefined
- {\@@XMLinstruction:\ascii}
- \noexpand\gobbleoneargument
- {\expandafter\noexpand\currentXMLprocess}}}
-
-%D One never knows:
-
-\let\normalparseXMLescape \parseXMLescape
-\let\normalparseXMLelement\parseXMLelement
-\let\normalparseXMLprocess\parseXMLprocess
-
-%D Next we will implement the normal element handler. This
-%D piece of code is complicated by the fact that we need to
-%D handle namespaces.
-
-\let\currentXMLarguments \empty
-\let\currentXMLelement \empty % name
-\let\currentXMLidentifier\empty % name or name/
-\let\currentXMLnamespace \empty % the (remapped) namespace
-\let\originalXMLnamespace\empty % the unremapped namespace
-\let\rawXMLidentifier \empty
-
-\def\rawXMLnamespace
- {\ifx\currentXMLnamespace\empty\else\currentXMLnamespace:\fi}
-
-\def\rawXMLelement{\rawXMLnamespace\rawXMLidentifier}
-
-%D The following token list register provided the user a hook
-%D for extensions.
-
-\newtoks\everyXMLelement
-
-%D We try to keep track of the nature of an element. This
-%D flag can be used for special purposes (as in the pretty
-%D printing macros).
-
-\chardef\kindofXMLelement=0
-
-\chardef\beginXMLtag=1
-\chardef\endXMLtag =2
-\chardef\emptyXMLtag=3
-
-%D We do a rather hard coded scan for the namespace attribute. This
-%D is needed because its value determines further namespace related
-%D actions.
-
-\def\openXMLargument{ /}
-
-\long\def\parseXMLelement#1#2 #3>%
- {\def\currentXMLarguments{#3}% including end /
- \if#1/%
- \chardef\kindofXMLelement\endXMLtag
- \def\currentXMLelement{#2}%
- \else
- \docleanupXMLelement#1#2/\empty\relax
- \fi
- \ifx\currentXMLarguments\openXMLargument
- \chardef\kindofXMLelement\emptyXMLtag
- \fi
- \@EA\splitoffXMLnamespace\currentXMLelement::\relax
- \ifcase\kindofXMLelement
- % can't happen
- \or
- % begintag or emptytag with arguments or space before /
- \the\everyXMLelement % only for begin/empty tag !
- \ifx\currentXMLarguments\empty \else
- \dogetXMLarguments\rawXMLelement#3>%
- \fi
- \or
- % no arguments
- \or
- % empty element without arguments (but possible presets)
- \the\everyXMLelement
- \fi
- \ifcase\kindofXMLelement\or
- \let \currentXMLidentifier \rawXMLidentifier
- \edef\currentXMLfullidentifier {\rawXMLelement }%
- \or
- \edef\currentXMLidentifier {/\rawXMLidentifier }%
- \edef\currentXMLfullidentifier{/\rawXMLelement }%
- \or
- \edef\currentXMLidentifier {\rawXMLidentifier/}%
- \edef\currentXMLfullidentifier {\rawXMLelement /}%
- \fi
- \iftraceXMLelements\traceXMLelement\fi
- \executeXMLelement}
-
-\long\def\docleanupXMLelement#1/#2#3\relax
- {\def\currentXMLelement{#1}% watch out: \empty == begin or empty tag
- \chardef\kindofXMLelement\ifx#2\empty\beginXMLtag\else\emptyXMLtag\fi}
-
-\def\@@traceXMLelement
- {\originalXMLfullidentifier
- \ifx\originalXMLfullidentifier\currentXMLfullidentifier\else
- \space=>\space\currentXMLfullidentifier
- \fi
- \ifx\currentXMLarguments\empty\else
- \space\string|\space\currentXMLarguments
- \fi}
-
-\long\def\traceXMLelement
- {\edef\originalXMLfullidentifier{\someXMLelementID\currentXMLelement}%
- \cleanupXMLarguments\writestatus{xml-element}{\@@traceXMLelement}}
-
-%D We split off the namespace part, construct the
-%D identifier, and remap the namespace if needed.
-
-\def\splitoffXMLnamespace#1:#2:#3\relax
- {\def\rawXMLidentifier{#2}%
- \ifx\rawXMLidentifier\empty
- \let\currentXMLnamespace\empty
- \edef\rawXMLidentifier{#1}%
- \else
- \edef\currentXMLnamespace{#1}%
- \fi
- \let\originalXMLnamespace\currentXMLnamespace
- \checkXMLnamespace\rawXMLidentifier}
-
-\def\xsplitoffXMLnamespace% fast resplit
- {\ifcsname\@@XMLnamespace:\currentXMLnamespace\endcsname
- \csname\@@XMLnamespace:\currentXMLnamespace\endcsname
- \fi}
-
-%D We will implement this macro later.
-
-\let\checkXMLnamespace\gobbleoneargument % see below
-
-%D The namespace attribute checking is part of the element
-%D parser, since the value of \type {xmlns} may influence other
-%D namespace mapping.
-
-\def\@@XMLns{xmlns}
-
-\def\checkXMLnamespaceattr#1% xmlns:\@@XMLname="\XMLns"
- {\edef\XMLns{#1}%
- \ifx\XMLns\empty \else
- \ifcsname\@@XMLurlspace:\XMLns\endcsname
- % get remapped namespace (from url)
- % \edef\XMLns{\csname\@@XMLurlspace:\XMLns\endcsname}%
- \@EA\let\@EA\XMLns\csname\@@XMLurlspace:\XMLns\endcsname
- % remap this one
- \ifx\@@XMLname\empty
- % not watertight since no implicit grouping
- \xautoXMLnamespace\XMLns
- \else
- \xremapXMLnamespace\@@XMLname\XMLns
- % redo namespace remapping of self if needed
- \ifx\XMLns\currentXMLnamespace
- % i'm still not sure if this is ok
- \else
- \xsplitoffXMLnamespace
- \fi
- \fi
- \fi
- \fi}
-
-%D Although not really needed, we clean up the arguments.
-
-% \long\def\cleanupXMLarguments
-% {\ifnum\kindofXMLelement=\emptyXMLtag
-% \ifx\currentXMLarguments\empty \else
-% \@EA\docleanupXMLarguments\currentXMLarguments/\empty
-% \fi
-% \fi}
-%
-% \long\def\docleanupXMLarguments#1/#2\empty
-% {\edef\currentXMLarguments{#1}}
-%
-% we need to be ...="/" .... /> safe
-
-\long\def\cleanupXMLarguments
- {\ifnum\kindofXMLelement=\emptyXMLtag
- \ifx\currentXMLarguments\empty \else
- \@EA\docleanupXMLarguments\currentXMLarguments/ \relax
- \fi
- \else\ifnum\kindofXMLelement=\beginXMLtag
- \ifx\currentXMLarguments\space
- \let\currentXMLarguments\empty
- \fi
- \fi\fi}
-
-% \long\def\docleanupXMLarguments#1/ #2\relax % space added earlier
-% {\edef\currentXMLarguments{#1}}
-%
-% \startbuffer
-% <xsl:value-of select="map[@att=$variable]/@att2"/>
-% \stopbuffer
-%
-% \showXMLbuffer
-%
-% No \type {\edef} in the following, else \showXMLbuffer fails:
-
-\long\def\docleanupXMLarguments#1/ #2\relax % space added earlier
- {\def\currentXMLarguments{#1}} % no \edef, goes wrong in \showXML
-
-\def\executeXMLelementA % no fallback
- {\ifcsname\@@XMLelement:\currentXMLfullidentifier\endcsname
- \csname\@@XMLelement:\currentXMLfullidentifier\endcsname
- \fi}
-
-\def\executeXMLelementB % default fallback
- {\csname \@@XMLelement:%
- \ifcsname\@@XMLelement:\currentXMLfullidentifier\endcsname
- \currentXMLfullidentifier
- \else
- \defaultXMLelementID % was \s!default
- \fi
- \endcsname}
-
-\def\executeXMLelementC % no namespace of default fallback
- {\csname \@@XMLelement:%
- \ifcsname\@@XMLelement:\currentXMLfullidentifier\endcsname
- \currentXMLfullidentifier
- \else\ifcsname\@@XMLelement:\currentXMLidentifier\endcsname
- \currentXMLidentifier
- \else
- \defaultXMLelementID % was \s!default
- \fi\fi
- \endcsname}
-
-\def\executeXMLelementD
- {\csname
- \ifcsname\@@XMLelement:\currentXMLfullidentifier\endcsname
- \@@XMLelement:\currentXMLfullidentifier
- \else\ifcsname\@@XMLelement:\currentXMLidentifier\endcsname
- \@@XMLelement:\currentXMLidentifier
- \else
- \executeXMLelementDD % less skipping and thereby faster
- \fi\fi
- \endcsname}
-
-\def\executeXMLelementDD % now forget about tex mapping
- {\ifcsname\normal@@XMLelement:\currentXMLfullidentifier\endcsname
- \normal@@XMLelement:\currentXMLfullidentifier
- \else\ifcsname\normal@@XMLelement:\currentXMLidentifier\endcsname
- \normal@@XMLelement:\currentXMLidentifier
- \else
- \normal@@XMLelement:\defaultXMLelementID % was \@@XMLelement:\s!default
- \fi\fi}
-
-\def\setXMLfallbackmode#1%
- {\ifcase#1\relax
- \let\executeXMLelement \executeXMLelementA
- \let\automateXMLnamespace\automateXMLnamespaceA
- \or % 1
- \let\executeXMLelement \executeXMLelementB
- \let\automateXMLnamespace\automateXMLnamespaceB
- \or % 2
- \let\executeXMLelement \executeXMLelementC
- \let\automateXMLnamespace\automateXMLnamespaceC
- \or % 3
- \let\executeXMLelement \executeXMLelementD
- \let\automateXMLnamespace\automateXMLnamespaceD
- \fi}
-
-\setXMLfallbackmode3 % was 2
-
-%D An example of fall back modes is given below.
-
-%D The automated namespace stuff is new and yet undocumented
-%D (see resource libraries for usage).
-
-\def\xautoXMLnamespace#1% fast internal one
- {\ifcsname\@@XMLnamespace-#1\endcsname\else
- \@EA\appendtoks\csname\@@XMLnamespace-#1\endcsname\to\autoXMLnamespaces
- \fi
- \@EA\edef\csname\@@XMLnamespace-#1\endcsname
- {\noexpand\edef\noexpand\@axmlns@{#1}% quicker #1 -> \#1
- \noexpand\doautoXMLnamespace\noexpand\@axmlns@}}
-
-\def\doautoXMLnamespace#1% \done is set before list
- {\ifdone\else\automateXMLnamespace#1\fi}
-
-\def\automateXMLnamespaceA#1%
- {\ifcsname\@@XMLelement:#1:\checkedXMLnamespace\endcsname
- \let\currentXMLnamespace#1%
- \else\ifcsname\@@XMLelement:#1:\checkedXMLnamespace/\endcsname
- \let\currentXMLnamespace#1%
- \fi\fi}
-
-\let\automateXMLnamespaceB\automateXMLnamespaceA
-\let\automateXMLnamespaceC\automateXMLnamespaceA
-
-\def\automateXMLnamespaceD#1%
- {\ifcsname\@@XMLelement:#1:\checkedXMLnamespace\endcsname
- \let\currentXMLnamespace#1%
- \else\ifcsname\normal@@XMLelement:#1:\checkedXMLnamespace\endcsname
- \let\currentXMLnamespace#1%
- \else
- \automateXMLnamespaceDD#1%
- \fi\fi}
-
-\def\automateXMLnamespaceDD#1%
- {\ifcsname\@@XMLelement:#1:\checkedXMLnamespace/\endcsname
- \let\currentXMLnamespace#1%
- \else\ifcsname\normal@@XMLelement:#1:\checkedXMLnamespace/\endcsname
- \let\currentXMLnamespace#1%
- \fi\fi}
-
-%D Later we will implement the error handler, here we handle
-%D the default case.
-
-\def\someXMLelementID#1%
- {\ifnum\kindofXMLelement=\endXMLtag /\fi
- #1%
- \ifnum\kindofXMLelement=\emptyXMLtag/\fi}
-
-\def\defaultXMLelementID
- {\someXMLelementID\s!default}
-
-%D It is possible to keep track of nesting automatically,
-%D but this would kind of prohibit things like \type
-%D {\ignorespaces}. In the future we may provide an
-%D automatic depth tracking as an alternative (exclusive)
-%D mode of operation combined with space grabbing.
-
-\def\beginXMLelement
- {\global\advance\XMLdepth\plusone
- \global\@EA\let\csname\@@XMLdepth:\the\XMLdepth\endcsname\currentXMLelement
- }%\writestatus{XML TRACE}{[begin] [\the\XMLdepth] [\XMLself]}}
-
-\def\endXMLelement
- {%\writestatus{XML TRACE}{[end] [\the\XMLdepth] [\XMLself]}%
- \global\@EA\let\csname\@@XMLdepth:\the\XMLdepth\endcsname\undefined
- \global\advance\XMLdepth\minusone}
-
-% 0 = nothing
-% 1 = unknown
-% 2 = current element
-
-\chardef\XMLancestormode=2 % never change this one globally
-
-% \def\XMLancestor#1%
-% {\ifnum\numexpr(\XMLdepth-#1)>0
-% \csname\@@XMLdepth:\the\numexpr(\XMLdepth-#1)\endcsname
-% \else
-% \ifcase\XMLancestormode\or\s!unknown\or\currentXMLelement\fi
-% \fi}
-
-\def\XMLancestor#1%
- {\ifnum\numexpr\XMLdepth-#1\relax>\zerocount
- \csname\@@XMLdepth:\the\numexpr\XMLdepth-#1\relax\endcsname
- \else
- \ifcase\XMLancestormode\or\s!unknown\or\currentXMLelement\fi
- \fi}
-
-% \def\XMLpureancestor#1%
-% {\ifnum\numexpr(\XMLdepth-#1)>0
-% \csname\@@XMLdepth:\the\numexpr(\XMLdepth-#1)\endcsname
-% \fi}
-
-\def\XMLpureancestor#1%
- {\ifcase\numexpr\XMLdepth-#1\relax\or
- \csname\@@XMLdepth:\the\numexpr\XMLdepth-#1\relax\endcsname
- \fi}
-
-\def\XMLparent {\XMLancestor \plusone }
-\def\XMLself {\XMLancestor \zerocount}
-\def\XMLpureparent{\XMLpureancestor\plusone }
-\def\XMLpureself {\XMLpureancestor\zerocount}
-
-% \def\XMLpureancestor#1%
-% {\csname
-% \ifnum\numexpr(\XMLdepth-#1)>\zerocount
-% \@@XMLdepth:\the\numexpr(\XMLdepth-#1)%
-% \else
-% \s!empty
-% \fi
-% \endcsname}
-
-\def\XMLpureparent
- {\XMLpureancestor\plusone}
-
-% probleem: depth is vast en dus ook ancestor
-
-% \XMLinh{...} will backtrack definitions (given that the elements
-% use begin/end, the backtracking stops when a non-empty value is
-% encountered; maybe we will add some keyword (inherit) some day
-
-\def\XMLinhpar#1#2%
- {\@EA\ifx\csname\@@XMLvariable:#1:#2\endcsname\empty
- \@EA\pXMLinh
- \else
- \csname\@@XMLvariable:#1:#2\endcsname
- \@EA\gobbletwoarguments
- \fi\XMLdepth{#2}}
-
-\def\XMLinh
- {\XMLinhpar\currentXMLelement}
-
-% \def\pXMLinh#1%
-% {\@EA\ppXMLinh\@EA{\the\numexpr(#1-\plusone)}}
-
-\def\pXMLinh#1%
- {\@EA\ppXMLinh\@EA{\the\numexpr#1-\plusone\relax}}
-
-\def\ppXMLinh#1#2%
- {\@EA\ifx\csname\@@XMLvariable:#1:#2\endcsname\empty
- \ifnum#1>\plusone
- \@EAEAEA\pXMLinh
- \else
- \@EAEAEA\gobbletwoarguments
- \fi
- \else
- \csname\@@XMLvariable:#1:#2\endcsname
- \@EA\gobbletwoarguments
- \fi{#1}{#2}}
-
-% better
-%
-% \def\XMLpureancestor#1%
-% {\ifcsname\@@XMLdepth:\the\numexpr(\XMLdepth-#1)\endcsname
-% \csname\@@XMLdepth:\the\numexpr(\XMLdepth-#1)\endcsname
-% \fi}
-
-% replaces macro in xtag-ini: ! ! !
-
-\def\edefXMLop#1#2% \macro{att}
- {\edef#1%
- {\csname\ifcsname\@@XMLvariable:\ownXMLelement:#2\endcsname
- \@@XMLvariable:\ownXMLelement:#2\else\s!empty
- \fi\endcsname}}
-
-\def\edefXMLinh#1#2% \macro{att}
- {\edef#1{\XMLinh{#2}}}
-
-\def\edefXMLinhpar#1#2#3% \macro{tag}{att}
- {\edef#1{\XMLinhpar{#2}{#3}}}
-
-% \def\doifXMLopdef#1#2% \macro{att}
-% {\ifcsname\@@XMLvariable:\ownXMLelement:#1\endcsname
-% \@EA\let\@EA#1\csname\@@XMLvariable:\ownXMLelement:#1\endcsname
-% \expandafter\firstofoneargument
-% \else
-% \expandafter\gobbleoneargument
-% \fi}
-
-\fetchruntimecommand \tracebackXMLattribute {\f!xtagprefix\s!run}
-\fetchruntimecommand \showXMLinh {\f!xtagprefix\s!run}
-
-% \defineXMLenvironment[one]
-% {\beginXMLelement}
-% {\endXMLelement}
-%
-% \defineXMLenvironment[two]
-% {\beginXMLelement
-% \starttabulatie
-% \NC ancestor 1 \NC \XMLancestor{1} \NC \NR
-% \NC ancestor 2 \NC \XMLancestor{2} \NC \NR
-% \NC ancestor 3 \NC \XMLancestor{3} \NC \NR
-% \NC ancestor 4 \NC \XMLancestor{4} \NC \NR
-% \stoptabulatie}
-% {\endXMLelement}
-%
-% \startbuffer
-% <x:one> <x:two> <one> <two> </two> </one> </x:two> </x:one>
-% \stopbuffer
-%
-% {fallback A: \setXMLfallbackmode 0 \processXMLbuffer}\par
-% {fallback B: \setXMLfallbackmode 1 \processXMLbuffer}\par
-% {fallback C: \setXMLfallbackmode 2 \processXMLbuffer}\par
-
-% todo: split #1 into raws en reconstruct, set current etc, push and pop
-%
-% \def\beginXMLelement
-% {\dosingleempty\dobeginXMLelement}
-%
-% \def\dobeginXMLelement[#1]%
-% {\global\advance\XMLdepth 1
-% \global\@EA\let\csname\@@XMLdepth:\the\XMLdepth\endcsname\currentXMLelement
-% \global\@EA\edef\csname\@@XMLdopth:\the\XMLdepth\endcsname{\ownXMLelement}%
-% \iffirstargument\edef\ownXMLelement{#1}\fi}
-%
-% \def\endXMLelement
-% {\@EA\let\@EA\ownXMLelement\csname\@@XMLdopth:\the\XMLdepth\endcsname
-% \global\advance\XMLdepth -1 }
-
-%D \defineXMLenvironment[one]
-%D {\beginXMLelement}
-%D {\endXMLelement}
-%D
-%D \defineXMLenvironment[two]
-%D {\beginXMLelement
-%D \starttabulate
-%D \NC parent 1 \NC \XMLancestor{1} \NC \NR
-%D \NC parent 2 \NC \XMLancestor{2} \NC \NR
-%D \NC parent 3 \NC \XMLancestor{3} \NC \NR
-%D \NC parent 4 \NC \XMLancestor{4} \NC \NR
-%D \stoptabulate}
-%D {\endXMLelement}
-%D
-%D \startbuffer
-%D <x:one> <x:two> <one> <two> </two> </one> </x:two> </x:one>
-%D \stopbuffer
-%D
-%D fallback A: \setXMLfallbackmode0 \processXMLbuffer
-%D fallback B: \setXMLfallbackmode1 \processXMLbuffer
-%D fallback C: \setXMLfallbackmode2 \processXMLbuffer
-
-%D Here we do the namespace (re)mapping. More examples are
-%D provided in the manual.
-%D
-%D \starttyping
-%D \supportXMLnamespace [test] % needed to get a namespace working
-%D \skipXMLnamespace [test] % slow
-%D \ignoreXMLnamespace [test] % faster
-%D \defineXMLenvironment [rubish:itemize] {[} {]}
-%D \defineXMLenvironment [rubish:item] {(} {)}
-%D \remapXMLnamespace [crap] [rubish]
-%D \remapXMLnamespace [con] [context]
-%D \remapXMLurlspace [http://www.pragma-ade.com/dtd/context] [context]
-%D \autoXMLnamespace [context] % fallback
-%D \autoXMLnamespace [whatever] % second fall back
-%D \stoptyping
-
-\newtoks\autoXMLnamespaces
-
-%D The automatically mapped namespaces (the fallbacks so to
-%D day) are collected in a token list.
-
-\let\checkedXMLnamespace\empty
-
-\def\checkXMLnamespace#1%
- {\edef\checkedXMLnamespace{#1}%
- \ifcsname\@@XMLnamespace:\currentXMLnamespace\endcsname
- \csname\@@XMLnamespace:\currentXMLnamespace\endcsname
- % forced namespace
- \else\ifcsname\@@XMLelement:\currentXMLelement\endcsname
- % natural element
- \else\ifcsname\@@XMLelement:\currentXMLelement/\endcsname
- % natural element
- \else
- % locate fallback
- \donefalse\the\autoXMLnamespaces
- \fi\fi\fi}
-
-\def\skipXMLnamespace[#1]%
- {\letvalue{\@@XMLnamespace:#1}\doXMLskipnamespace}
-
-\def\doXMLskipnamespace
- {\long\@EA\def\csname\@@XMLelement:\checkedXMLnamespace\endcsname
- {\getXMLgroupedignore\checkedXMLnamespace}}
-
-\def\hideXMLnamespace[#1]%
- {\letvalue{\@@XMLnamespace:#1}\doXMLhidenamespace}
-
-\def\doXMLhidenamespace
- {\long\@EA\def\csname\@@XMLelement:\checkedXMLnamespace\endcsname
- {\redoXMLignore\checkedXMLnamespace}}
-
-\def\ignoreXMLnamespace[#1]%
- {\letvalue{\@@XMLnamespace:#1}\doXMLignorenamespace}
-
-\def\doXMLignorenamespace % \let binnen def
- {\long\@EA\def\csname\@@XMLelement:\checkedXMLnamespace\endcsname
- {\@EA\redoXMLignore\@EA{\checkedXMLnamespace}}} % EA ?
-
-\def\remapXMLnamespace
- {\dodoubleargument\doremapXMLnamespace}
-
-\def\doremapXMLnamespace[#1][#2]%
- {\ifsecondargument
- \setvalue{\@@XMLnamespace:#1}{\def\currentXMLnamespace{#2}}%
- \else
- \letvalue{\@@XMLnamespace:#1}\relax
- \fi}
-
-\def\supportXMLnamespace%
- {\dosingleargument\dosupportXMLnamespace}
-
-\def\dosupportXMLnamespace[#1]%
- {\setvalue{\@@XMLnamespace:#1}{\def\currentXMLnamespace{#1}}}
-
-\def\xremapXMLnamespace#1#2% fast internal one
- {\@EA\edef\csname\@@XMLnamespace:#1\endcsname
- {\def\noexpand\currentXMLnamespace{#2}}}
-
-\def\autoXMLnamespace[#1]%
- {\xautoXMLnamespace{#1}}
-
-\def\xautoXMLnamespace#1% fast internal one
- {\ifcsname\@@XMLnamespace-#1\endcsname\else
- \@EA\appendtoks\csname\@@XMLnamespace-#1\endcsname\to\autoXMLnamespaces
- \fi
- \@EA\edef\csname\@@XMLnamespace-#1\endcsname
- {\noexpand\doautoXMLnamespace{#1}}}
-
-\def\doautoXMLnamespace#1% \done is set before list
- {\ifdone\else
- \ifcsname\@@XMLelement:#1:\checkedXMLnamespace\endcsname
- \def\currentXMLnamespace{#1}%
- \else\ifcsname\@@XMLelement:#1:\checkedXMLnamespace/\endcsname
- \def\currentXMLnamespace{#1}%
- \fi\fi
- \fi}
-
-\def\resetXMLnamespace[#1]%
- {\letvalue{\@@XMLnamespace-#1}\gobbleoneargument
- \letvalue{\@@XMLnamespace:#1}\gobbleoneargument}
-
-\def\remapXMLurlspace
- {\dodoubleargument\doremapXMLurlspace}
-
-\def\doremapXMLurlspace[#1][#2]%
- {\setvalue{\@@XMLurlspace:#1}{#2}}
-
-%D Entities needs a bit more work, as well as a connection
-%D with the encoding handlers.
-
-% we need to be able to do:
-%
-% \defineXMLentity[amp] {\FunnyAmp} \def\FunnyAmp#1;{\getXMLentity{#1}}
-%
-% \defineXMLentity [pound] {(why not use euro's?)}
-%
-% \startXMLdata
-% test &amp;pound; test
-% \stopXMLdata
-%
-% so we need an ifless implementation
-%
-% also .. this should work:
-%
-% \defineXMLentity[ctx-var-textwidth] {\textwidth}
-%
-% \defineXMLcommand[test][width=\textwidth]
-% {\the\dimexpr\XMLop{width}\relax}
-%
-% \startXMLdata
-% <test width=".45&ctx-var-textwidth;"/>
-% <test width="&ctx-var-textwidth;"/>
-% \stopXMLdata
-
-% \eacute -> simplified -> e (via raw encoding)
-% -> raw -> eacute (via handler)
-%
-% naming sucks
-
-\newif\ifXMLrawentities % proper fallback
-\newif\ifXMLsimpleentities % last resort
-
-\def\simpleXMLencoding{raw}
-
-\ifnum\texengine=\luatexengine
- \def\simplifyXMLentities
- {\XMLsimpleentitiestrue}
-\else
- \def\simplifyXMLentities
- {\fastenableencoding\simpleXMLencoding
- \XMLsimpleentitiestrue}
-\fi
-
-\def\defineXMLentity
- {\dodoubleempty\dodefineXMLentity}
-
-\def\dodefineXMLentity[#1][#2]#3%
- {\ifsecondargument
- \defineXMLentities[#1]{#2}{#3}%
- \else
- \dododefineXMLentity{#1}{#3}%
- \fi}
-
-\def\defineXMLentities[#1]#2#3%
- {\dododefineXMLentity{#1}{\ifXMLsimpleentities#2\else#3\fi}}
-
-\def\dododefineXMLentity#1#2%
- {\unspaceargument#1\to\ascii % #1 can be {[} or so
- \long\setvalue{\@@XMLentity:\@EA\firstofoneargument\ascii}{#2}}
-
-\def\setXMLentity#1% fast one
- {\long\@EA\def\csname\@@XMLentity:#1\endcsname}
-
-%D May this wile become dodo (more in tune with rest);
-%D beware: also remapped in xtag-map.
-
-\def\doXMLentity#1#2;% interesting: # is now ##
- {\if\string#1\letterhash
- \@EA\parseXMLcharacter
- \else\ifXMLrawentities
- \@EAEAEA\firstofoneargument
- \else
- \@EAEAEA\executeXMLentity
- \fi\fi{#1#2}}
-
-%D Here we need to get rid of the double hash and act upon the
-%D number. Proper hex/oct number support can be implemented by
-%D redefining \type {\executeXMLcharacter}.
-
-% \def\parseXMLcharacter#1% gobble the ##x
-% {\@EA\executeXMLcharacter\@EA{\gobblethreearguments#1}}
-%
-% single hash now
-%
-% \def\parseXMLcharacter#1%
-% {\@EA\executeXMLcharacter\@EA{\gobbleoneargument#1}}
-%
-% \def\executeXMLcharacter#1% can be overloaded
-% {\ifnum"#1<256
-% \@EA\getXMLcharacter
-% \else\ifXMLrawentities
-% \@EAEAEA\firstofoneargument
-% \else
-% \@EAEAEA\unknownXMLcharacter
-% \fi\fi{\number"#1}}
-%
-% \unexpanded\def\getXMLcharacter#1{\rawcharacter{#1}}
-
-\def\parseXMLcharacter#1%
- {\@EA\executeXMLcharacter\gobbleoneargument#1\empty\relax}
-
-\def\executeXMLcharacter#1#2\relax
- {\if#1x%
- \@EA\noexecuteXMLhexcharacter
- \else
- \@EA\doexecuteXMLdeccharacter
- \fi#1#2\relax}
-
-\def\noexecuteXMLhexcharacter x#1\relax
- {\uppercase{\doexecuteXMLhexcharacter#1\relax}}
-
-% \unexpanded\def\getXMLcharacter#1%
-% {\ifXMLrawentities
-% \@EA\firstofoneargument
-% \else\ifcsname\@@XMLentity:#1\endcsname
-% \@EAEAEA\getXMLentity
-% \else
-% \@EAEAEA\unicodechar % was: \rawcharacter
-% \fi\fi{#1}}
-%
-% \def\doexecuteXMLhexcharacter#1\relax{\getXMLcharacter{"#1}}
-% \def\doexecuteXMLdeccharacter#1\relax{\getXMLcharacter {#1}}
-%
-% if we want to support x in entity overloading, we prefer:
-
-\unexpanded\def\getXMLdeccharacter#1%
- {\ifXMLrawentities
- \@EA\rawXMLdecentity
- \else\ifcsname\@@XMLentity:#1\endcsname
- \@EAEAEA\getXMLdecentity
- \else
- \@EAEAEA\unicodechar
- \fi\fi{#1}}
-
-\unexpanded\def\getXMLhexcharacter#1%
- {\ifXMLrawentities
- \@EA\rawXMLhexentity
- \else\ifcsname\@@XMLentity:x#1\endcsname
- \@EAEAEA\getXMLhexentity
- \else
- \@EAEAEA\unicodehexchar
- \fi\fi{#1}}
-
-\def\unicodehexchar#1{\unicodechar{"#1}}
-
-\let\getXMLcharacter\getXMLdeccharacter
-
-\def\getXMLdecentity#1{\getXMLentity {#1}}
-\def\getXMLhexentity#1{\getXMLentity{x#1}}
-
-\def\rawXMLdecentity#1{#1}
-\def\rawXMLhexentity#1{x#1}
-
-\def\doexecuteXMLhexcharacter#1\relax{\getXMLhexcharacter{#1}}
-\def\doexecuteXMLdeccharacter#1\relax{\getXMLdeccharacter{#1}}
-
-% \defineXMLentity[8218] {Adam}
-% \defineXMLentity[x007D]{Eve}
-%
-% \startbuffer
-% &#64; &#8216; &#8218; &#8220; &#8221; &#8222;&#8226;
-% &amp;
-% &#x0024; &#x007B; &#x007D; &#x00A0; &#x2026;
-% \stopbuffer
-%
-% \typebuffer \processXMLbuffer
-
-% left overs
-
-\def\unknownXMLcharacter#1{[#1]}
-
-\ifx\unicodechar\undefined\let\unicodechar\rawcharacter\fi % brrrr
-
-% \useXMLfilter[ent]
-%
-% \defineXMLsingular[test]{{\simplifyXMLentities\XMLpar{test}{bla}{}}}
-%
-% \startXMLdata
-% <test bla="&#xD3;bla&eacute;bla&tex;and$and&#xFC;ziezo&#xF99;" />
-% \stopXMLdata
-%
-% \defineXMLentity[45]{|it works|} % {|-|}
-%
-% \startXMLdata
-% text&#045;&#046;text
-% text&#x045;&#x046;text
-% \stopXMLdata
-
-%D May be this will change a bit ...
-
-\def\executeXMLentity#1% named one
- {\getXMLentity{#1}}
-
-%\def\expandedXMLentity#1%
-% {\ifcsname\@@XMLentity:#1\endcsname\csname\@@XMLentity:#1\endcsname\fi}
-%
-%\unexpanded\def\getXMLentity#1%
-% {\ifcsname\@@XMLentity:#1\endcsname\csname\@@XMLentity:#1\endcsname\fi}
-%
-%\def\expandedXMLentity#1%
-% {\csname\@@XMLentity:#1\endcsname}
-%
-%\unexpanded\def\getXMLentity#1%
-% {\csname\@@XMLentity:#1\endcsname}
-
-\doifundefined{autoXMLentitiestrue}{\expandafter\newif\csname ifautoXMLentities\endcsname} % fall back on context commands
-
-\def\expandedXMLentity#1%
- {\ifcsname\@@XMLentity:#1\endcsname \@EA \execXMLentity
- \else\ifautoXMLentities \@EAEAEA \autoXMLentity
- \else \@EAEAEA \crapXMLentity
- \fi\fi{#1}}
-
-\def\execXMLentity#1{\csname\@@XMLentity:#1\endcsname}
-\def\crapXMLentity#1{\inframed[\c!offset=.1ex]{\tttf#1}}
-\def\autoXMLentity#1{\ifcsname#1\endcsname\csname#1\endcsname\fi}
-
-\unexpanded\def\getXMLentity{\expandedXMLentity}
-
-%\def\doifXMLentityelse#1#2#3%
-% {\ifcsname\@@XMLentity:#1\endcsname#2\else#3\fi}
-
-\def\doifXMLentityelse#1%
- {\ifcsname\@@XMLentity:#1\endcsname
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-% \letvalue{1@2}\firstoftwoarguments
-% \letvalue{2@2}\secondoftwoarguments
-%
-% \def\doifXMLentityelse#1%
-% {\csname\ifcsname\@@XMLentity:#1\endcsname1\else2\fi @2\endcsname}
-
-% see \defineXML... commands:
-%
-% [key=val] => \presetXMLarguments{element} => default key/vals
-% [blabla] => \theXMLarguments{blabla} => user key/vals
-% [blabla] [key=val] => \presetXMLarguments{element} => default key/vals
-% \theXMLarguments{blabla} => user key/vals
-%
-% <element key="val"> stored in case of [blabla] else set as \XMLpar
-%
-% see m-steps for an example of usage
-
-\let\@@XMLmapmap\empty
-\newif\ifXMLnamespace
-
-\long\def\getXMLarguments#1#2%
- {\XMLnamespacefalse
- \dogetXMLarguments{#1}#2>}
-
-\let\dosetXMLattributeA\gobbleoneargument
-
-\def\dosetXMLattributeB#1%
- {\ifx\@@XMLspac\originalXMLnamespace
- \@EA\def\csname\@@XMLvariable:\@@XMLclass:\@@XMLname\endcsname{#1}%
- % maybe some day global handling here as well
- \fi}
-
-\def\dosetXMLattributeC
- {\@EA\def\csname\@@XMLvariable:\@@XMLclass\ifx\@@XMLspac
- \originalXMLnamespace\else:\@@XMLspac\fi:\@@XMLname\endcsname}
-
-\def\dosetXMLattributeD
- {\@EA\def\csname\@@XMLvariable:\@@XMLclass:\ifx\@@XMLspac
- \originalXMLnamespace\currentXMLnamespace\else\@@XMLspac\fi:\@@XMLname\endcsname}
-
-\def\setXMLattributemode#1%
- {\ifcase#1\relax
- \let\dosetXMLattribute\dosetXMLattributeA
- \or
- \let\dosetXMLattribute\dosetXMLattributeB
- \or
- \let\dosetXMLattribute\dosetXMLattributeC
- \or
- \let\dosetXMLattribute\dosetXMLattributeD
- \fi}
-
-\setXMLattributemode{2} % a reasonable default
-
-\let\@@XMLspac\empty % argumentnamespace
-
-\long\def\dogetXMLarguments#1%
- {\XMLtoks\emptytoks
- \ifcsname\@@XMLmap:#1\endcsname
- \let\dodosetXMLargument\dodosetXMLargumentB
- \else
- \def\@@XMLclass{#1}%
- \let\dodosetXMLargument\dodosetXMLargumentA
- \fi
- \let\dodoparseXMLarguments\doparseXMLarguments
- \doparseXMLarguments}
-
-% \long\def\doparseXMLarguments#1% space goes ok
-% {\if#1>%
-% \let\dodoparseXMLarguments\empty
-% \else\if#1=%
-% \edef\@@XMLname{\the\XMLtoks}%
-% \XMLtoks\emptytoks
-% \else\if#1"%
-% \let\dodoparseXMLarguments\dodoparseXMLargumentsD
-% \else\if#1'%
-% \let\dodoparseXMLarguments\dodoparseXMLargumentsS
-% \else\if#1:%
-% \XMLnamespacetrue
-% \edef\@@XMLspac{\the\XMLtoks}%
-% \XMLtoks\emptytoks
-% \else\if#1/%
-% \chardef\kindofXMLelement\emptyXMLtag
-% \else
-% \XMLtoks\@EA{\the\XMLtoks#1}%
-% \fi\fi\fi\fi\fi\fi
-% \dodoparseXMLarguments}
-%
-% The next speed optimization is suggested by Taco. Since we
-% are dealing with validated code, we can grab larger chunks.
-%
-% \long\def\doparseXMLarguments#1% space goes ok
-% {\if#1>%
-% \let\dodoparseXMLarguments\empty
-% \else\if#1/%
-% \chardef\kindofXMLelement\emptyXMLtag
-% \else
-% \XMLtoks{#1}%
-% \let\dodoparseXMLarguments\dodoparseXMLargumentsX
-% \fi\fi
-% \dodoparseXMLarguments}
-%
-% we can get rid of one more assignment
-
-\long\def\doparseXMLarguments#1% space goes ok
- {\if#1>%
- %\let\dodoparseXMLarguments\empty
- \expandafter\gobbleoneargument % speedup
- \else\if#1/%
- \chardef\kindofXMLelement\emptyXMLtag
- \else
- \XMLtoks{#1}%
- \let\dodoparseXMLarguments\dodoparseXMLargumentsX
- \fi\fi
- \dodoparseXMLarguments}
-
-% slightly faster:
-%
-% \long\def\doparseXMLarguments#1% space goes ok
-% {\if#1>%
-% \@EA\gobbleoneargument
-% \else\if#1/%
-% \chardef\kindofXMLelement\emptyXMLtag
-% \@EAEAEA\gobbletwoarguments
-% \else
-% \@EAEAEA\dodoparseXMLargumentsX
-% \fi\fi#1}
-%
-% \def\dodoparseXMLargumentsX#1=#2%
-% {\def\@@XMLname{#1}%
-% \getXMLNSSSS#1:\relax
-% \if#2"%
-% \expandafter\dodoparseXMLargumentsD
-% \else
-% \expandafter\dodoparseXMLargumentsS
-% \fi}
-
-\def\dodoparseXMLargumentsX#1=#2%
- {\edef\@@XMLname{\the\XMLtoks#1}%
- \@EA\getXMLNSSSS\@@XMLname:\relax
- \XMLtoks\emptytoks
- \if#2"%
- \let\dodoparseXMLarguments\dodoparseXMLargumentsD
- \else
- \let\dodoparseXMLarguments\dodoparseXMLargumentsS
- \fi
- \dodoparseXMLarguments}
-
-\def\gobbleuntilcolon#1:{#1}
-
-\def\getXMLNSSSS#1:#2\relax
- {\def\!!stringa{#2}%
- \ifx\!!stringa\empty \else
- \XMLnamespacetrue
- \edef\@@XMLname{\gobbleuntilcolon#2}%
- \edef\@@XMLspac{#1}%
- \fi}
-
-% ok ?
-%
-% \def\dodoparseXMLargumentsX#1=#2%
-% {\edef\@@XMLname{\the\XMLtoks#1}%
-% \@EA\getXMLNSSSS\@@XMLname:\relax
-% \XMLtoks\emptytoks
-% \if#2"%
-% \@EA\dodoparseXMLargumentsD
-% \else
-% \@EA\dodoparseXMLargumentsS
-% \fi}
-
-% Storing \type {#1} in a macro in order to minimize the
-% amount of data passed as argument does not improve
-% performance, so we keep the readable form.
-
-\def\dodoparseXMLargumentsD#1"{\dosetXMLargument{#1}}
-\def\dodoparseXMLargumentsS#1'{\dosetXMLargument{#1}}
-
-% the readable version
-%
-% \def\dosetXMLargument#1%
-% {\ifXMLnamespace
-% \ifx\@@XMLspac\@@XMLns
-% \checkXMLnamespaceattr{#1}% xmlns:\@@XMLname="#1"
-% \else
-% \dosetXMLattribute{#1}% some:\@@XMLname="#1"
-% \fi
-% \XMLnamespacefalse
-% \else\ifx\@@XMLname\@@XMLns
-% \checkXMLnamespaceattr{#1}% xmlns="#1"
-% \else
-% \dodosetXMLargument{#1}%
-% \fi\fi
-% \let\dodoparseXMLarguments\doparseXMLarguments
-% \dodoparseXMLarguments}
-%
-% the ugly alternative
-
-% \def\dosetXMLargument#1% ugly alternative
-% {\ifXMLnamespace
-% \XMLnamespacefalse
-% \ifx\@@XMLspac\@@XMLns
-% \@EAEAEA\checkXMLnamespaceattr % xmlns:\@@XMLname="#1"
-% \else
-% \@EAEAEA\dosetXMLattribute % some:\@@XMLname="#1"
-% \fi
-% \else\ifx\@@XMLname\@@XMLns
-% \@EAEAEA\checkXMLnamespaceattr % xmlns="#1"
-% \else
-% \@EAEAEA\dodosetXMLargument
-% \fi\fi{#1}%
-% \let\dodoparseXMLarguments\doparseXMLarguments
-% \dodoparseXMLarguments}
-
-\def\dosetXMLargument#1% ugly alternative
- {\ifXMLnamespace
- \XMLnamespacefalse
- \ifx\@@XMLspac\@@XMLns
- \@EAEAEA\checkXMLnamespaceattr % xmlns:\@@XMLname="#1"
- \else
- \@EAEAEA\dosetXMLattribute % some:\@@XMLname="#1"
- \fi
- \else\ifx\@@XMLname\@@XMLns
- \@EAEAEA\checkXMLnamespaceattr % xmlns="#1"
- \else
- \@EAEAEA\dodosetXMLargument
- \fi\fi{#1}%
- \dodocopyXMLargument
- \let\dodoparseXMLarguments\doparseXMLarguments
- \dodoparseXMLarguments}
-
-\let\dodocopyXMLargument\relax
-
-% \def\dododocopyXMLargument
-% {\@EA\let\csname\@@XMLvariable:\the\numexpr(\XMLdepth+1):\@@XMLname\@EA\endcsname
-% \csname\@@XMLvariable:\@@XMLclass:\@@XMLname\endcsname}
-
-\def\dododocopyXMLargument
- {\@EA\let\csname\@@XMLvariable:\the\numexpr\XMLdepth+\plusone\relax:\@@XMLname\@EA\endcsname
- \csname\@@XMLvariable:\@@XMLclass:\@@XMLname\endcsname}
-
-\def\copyXMLargumentindeed
- {\let\dodocopyXMLargument\dododocopyXMLargument
- \let\copyXMLargumentindeed\relax}
-
-\def\dodosetXMLargumentA
- {\@EA\def\csname\@@XMLvariable:\@@XMLclass:\@@XMLname\endcsname}
-
-% \def\dodosetXMLargumentB#1%
-% {\@EA\edef\csname\@@XMLmap:\@@XMLmapmap\endcsname
-% {\@EA\ifx\csname\@@XMLmap:\@@XMLmapmap\endcsname\empty\else
-% \csname\@@XMLmap:\@@XMLmapmap\endcsname,%
-% \fi
-% \@@XMLname=#1}}
-
-\def\dodosetXMLargumentB#1%
- {\@EA\edef\csname\@@XMLmap:\@@XMLmapmap\endcsname
- {\@EA\ifx\csname\@@XMLmap:\@@XMLmapmap\endcsname\empty\else
- \csname\@@XMLmap:\@@XMLmapmap\endcsname,%
- \fi
- \@@XMLname={#1}}} % {} is needed for aa='bb,cc'
-
-\appendtoks
- \resetXMLarguments{\rawXMLnamespace\rawXMLidentifier}%
-\to \everyXMLelement
-
-\def\resetXMLarguments#1%
- {\ifcsname\@@XMLmap:#1\endcsname
- \@EA\let\@EA\@@XMLmapmap\csname\@@XMLmap:#1\endcsname
- \@EA\let\csname\@@XMLmap:\@@XMLmapmap\endcsname\empty
- \fi}
-
-\def\theXMLarguments#1%
- {\ifcsname\@@XMLmap:#1\endcsname\csname\@@XMLmap:#1\endcsname\fi}
-
-\def\doexpandXMLvalue#1#2%
- {\ifcsname#2\endcsname
- \bgroup
- \enableXMLexpansion
- \let\getXMLentity\expandedXMLentity
- #1% simplify maps entities back to _ and alike
- \expanded{\global\globalscratchtoks{\csname#2\endcsname}}%
- \egroup
- \@EA\edef\csname#2\endcsname{\the\globalscratchtoks}%
- \fi}
-
-\def\expandXMLvalue {\doexpandXMLvalue\relax}
-\def\simplifyXMLvalue{\doexpandXMLvalue\XMLsimpleentitiestrue}
-
-\def\expandTEXpar #1#2{\expandXMLvalue{#1\interfaced{#2}}}
-\def\expandXMLpar #1#2{\expandXMLvalue{\@@XMLvariable:#1:#2}}
-\def\expandXMLarguments #1{\expandXMLvalue{\@@XMLmap:#1}}
-
-\def\simplifyTEXpar #1#2{\simplifyXMLvalue{#1\interfaced{#2}}}
-\def\simplifyXMLpar #1#2{\simplifyXMLvalue{\@@XMLvariable:#1:#2}}
-\def\simplifyXMLarguments#1{\simplifyXMLvalue{\@@XMLmap:#1}}
-
-%D \startbuffer[tex]
-%D \defineXMLsingular [fx:root]
-%D {\XMLNSpar{fx:root}{xml}{lang}{}
-%D \XMLpar{fx:root}{xml:lang}{}
-%D \starttabulate[||||]
-%D \HL
-%D \NC \bf mode \NC \bf call \NC \bf result \NC\NR
-%D \HL
-%D \NC 0\NC\asciistr{\XMLpar {fx:root} {crap} {}} \NC dirt \NC\NR
-%D \NC \NC\asciistr{\XMLpar {fx:root} {junk} {}} \NC \NC\NR
-%D \NC \NC\asciistr{\XMLNSpar {fx:root} {fx} {crap} {}}\NC \NC\NR
-%D \NC \NC\asciistr{\XMLNSpar {fx:root} {xml} {lang} {}}\NC \NC\NR
-%D \HL
-%D \NC 1\NC\asciistr{\XMLpar {fx:root} {crap} {}} \NC dirt \NC\NR
-%D \NC \NC\asciistr{\XMLpar {fx:root} {junk} {}} \NC junk \NC\NR
-%D \NC \NC\asciistr{\XMLNSpar {fx:root} {fx} {crap} {}}\NC \NC\NR
-%D \NC \NC\asciistr{\XMLNSpar {fx:root} {xml} {lang} {}}\NC \NC\NR
-%D \HL
-%D \NC 2\NC\asciistr{\XMLpar {fx:root} {crap} {}} \NC dirt \NC\NR
-%D \NC \NC\asciistr{\XMLpar {fx:root} {junk} {}} \NC junk \NC\NR
-%D \NC \NC\asciistr{\XMLNSpar {fx:root} {fx} {crap} {}}\NC \NC\NR
-%D \NC \NC\asciistr{\XMLNSpar {fx:root} {xml} {lang} {}}\NC en \NC\NR
-%D \HL
-%D \NC 3\NC\asciistr{\XMLpar {fx:root} {crap} {}} \NC dirt \NC\NR
-%D \NC \NC\asciistr{\XMLpar {fx:root} {junk} {}} \NC junk \NC\NR
-%D \NC \NC\asciistr{\XMLNSpar {fx:root} {fx} {crap} {}}\NC rubish\NC\NR
-%D \NC \NC\asciistr{\XMLNSpar {fx:root} {xml} {lang} {}}\NC en \NC\NR
-%D \HL
-%D \stoptabulate}
-%D
-%D \remapXMLurlspace [http://www.w3.org/1999/XSL/Format] [fx]
-%D \stopbuffer
-%D
-%D \startbuffer[xml]
-%D <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
-%D fo:crap="rubish"
-%D fo:junk="junk"
-%D xml:lang="en"
-%D crap="dirt" />
-%D \stopbuffer
-%D
-%D \typebuffer[tex] \processTEXbuffer[tex]
-%D \typebuffer[xml] \processXMLbuffer[xml]
-
-%D The previous macros were the basic parser and their working
-%D is left to the imagination of the reader. These macros
-%D will be improved over time. We use rather low level
-%D definitions so that the mappings will run as fast as
-%D possible.
-
-\bgroup \catcode`<=\activecatcode
-
-\long\gdef\dododefineXMLsingular#1#2%
- {\long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2}}
-
-\long\gdef\dododefineXMLcommand#1#2%
- {\long\@EA\def\csname\@@XMLelement:#1\endcsname{#2}%
- \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
- \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2}}
-
-\long\gdef\dododefineXMLgrouped#1#2%
- {\long\@EA\def\csname\@@XMLelement:#1\endcsname{\groupedcommand{#2}\donothing\bgroup}%
- \@EA\let\csname\@@XMLelement:/#1\endcsname\egroup
- \@EA\let\csname\@@XMLelement:#1/\endcsname\donothing}
-
-\long\gdef\dododefineXMLargument#1#2% watch the {} around ##1
- {\long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLargument{#1}{#2}}
- \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
- \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2{}}}
-
-\long\gdef\redoXMLargument#1#2% potential optimization: globalnext
- {\long\@EA\gdef\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>{#2{##1}}%
- \next}
-
-\long\gdef\dododefineXMLignore#1%
- {\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLignore{#1}}
- \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
- \@EA\let\csname\@@XMLelement:#1/\endcsname\donothing}
-
-\long\gdef\redoXMLignore#1%
- {\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>{}%
- \next}
-
-\long\gdef\dododefineXMLpickup#1#2#3%
- {\long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLpickup{#1}{#2}{#3}}
- \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
- \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2#3}}
-
-\long\gdef\redoXMLpickup#1#2#3%
- {\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>{#2##1#3}%
- \next}
-
-\long\gdef\dododefineXMLenvironment#1#2#3%
- {\long\@EA\def\csname\@@XMLelement:#1\endcsname{#2}%
- \long\@EA\def\csname\@@XMLelement:/#1\endcsname{#3}%
- \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2#3}}
-
-\long\gdef\dododefineXMLsave#1%
- {\@EA\let\csname\@@XMLdata:#1\endcsname\longempty
- \long\@EA\def\csname\@@XMLelement:#1\endcsname {\redoXMLsave{#1}}%
- \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
- \long\@EA\def\csname\@@XMLelement:#1/\endcsname{\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}}
-
-\long\gdef\dododefineXMLsavecontent#1#2%
- {\long\@EA\def\csname\@@XMLdata:#1\endcsname{#2}%
- \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLsave{#1}}%
- \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
- \long\@EA\def\csname\@@XMLelement:#1/\endcsname{\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}}
-
-\long\gdef\redoXMLsave#1%
- {\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>%
- {\long\@EA\def\csname\@@XMLdata:#1\endcsname{##1}}%
- \next}
-
-\long\gdef\dododefineXMLgsave#1%
- {\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty
- \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLgsave{#1}}%
- \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
- \long\@EA\def\csname\@@XMLelement:#1/\endcsname{\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}}
-
-\long\gdef\dododefineXMLgsavecontent#1#2%
- {\long\@EA\gdef\csname\@@XMLdata:#1\endcsname{#2}%
- \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLgsave{#1}}%
- \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
- \long\@EA\def\csname\@@XMLelement:#1/\endcsname{\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}}
-
-\long\gdef\redoXMLgsave#1%
- {\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>%
- {\long\@EA\gdef\csname\@@XMLdata:#1\endcsname{##1}}%
- \next}
-
-\long\gdef\dododefineXMLenvironmentsave#1#2#3%
- {\@EA\let\csname\@@XMLdata:#1\endcsname\longempty
- \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLenvironmentsave{#1}{#2}{#3}}%
- \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
- \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2\@EA\let\csname\@@XMLdata:#1\endcsname\longempty#3}}
-
-% maybe \globalnext
-
-\long\gdef\redoXMLenvironmentsave#1#2#3%
- {\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>%
- {#2\long\@EA\def\csname\@@XMLdata:#1\endcsname{##1}#3}%
- \next}
-
-\long\gdef\dododefineXMLenvironmentgsave#1#2#3%
- {\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty
- \long\@EA\def\csname\@@XMLelement:#1\endcsname{\redoXMLenvironmentgsave{#1}{#2}{#3}}%
- \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
- \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2\global\@EA\let\csname\@@XMLdata:#1\endcsname\longempty#3}}
-
-\long\gdef\redoXMLenvironmentgsave#1#2#3%
- {\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>%
- {#2\long\@EA\gdef\csname\@@XMLdata:#1\endcsname{##1}#3}%
- \next}
-
-\long\gdef\dododefineXMLprocess#1%
- {\@EA\let\csname\@@XMLelement:#1\endcsname\donothing
- \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
- \@EA\let\csname\@@XMLelement:#1/\endcsname\donothing}
-
-\long\gdef\dododefineXMLnestedenvironment#1#2#3%
- {\long\@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}}%
- \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
- \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2{}}}
-
-\long\gdef\dododefineXMLnestedsave#1%
- {\@EA\let\csname\@@XMLdata:#1\endcsname\longempty
- \long\@EA\def\csname\@@XMLelement:#1\endcsname {\getXMLgroupednestedsave{#1}}%
- \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
- \long\@EA\def\csname\@@XMLelement:#1/\endcsname{\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}}
-
-\long\unexpanded\gdef\getXMLgroupednestedsave#1%
- {\collectXMLgroupedtrue
- \long\def\dodogetgrouped{\long\@EA\edef\csname\@@XMLdata:#1\endcsname{\the\groupedtoks}}%
- \getXMLgrouped{#1}}
-
-\long\gdef\dododefineXMLnestedenvironmentsave#1#2#3%
- {\@EA\let\csname\@@XMLdata:#1\endcsname\longempty
- \long\@EA\def\csname\@@XMLelement:#1\endcsname {\getXMLgroupednestedenvironmentsave{#1}{#2}{#3}}%
- \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
- \long\@EA\def\csname\@@XMLelement:#1/\endcsname{#2\@EA\let\csname\@@XMLdata:#1\endcsname\longempty#3}}
-
-\long\unexpanded\gdef\getXMLgroupednestedenvironmentsave#1#2#3%
- {\collectXMLgroupedtrue
- \long\def\dodogetgrouped{#2\long\@EA\edef\csname\@@XMLdata:#1\endcsname{\the\groupedtoks}#3}%
- \getXMLgrouped{#1}}
-
-\egroup
-
-%D The high level definition macros.
-
-\def\defineXMLsingular {\dotripleempty\dodefineXMLsingular}
-\def\defineXMLcommand {\dotripleempty\dodefineXMLcommand}
-\def\defineXMLgrouped {\dotripleempty\dodefineXMLgrouped}
-\def\defineXMLargument {\dotripleempty\dodefineXMLargument}
-\def\defineXMLignore {\dotripleempty\dodefineXMLignore}
-\def\defineXMLpickup {\dotripleempty\dodefineXMLpickup}
-\def\defineXMLenvironment {\dotripleempty\dodefineXMLenvironment}
-\def\defineXMLsave {\dotripleempty\dodefineXMLsave}
-\def\defineXMLsavecontent {\dotripleempty\dodefineXMLsavecontent}
-\def\defineXMLgsave {\dotripleempty\dodefineXMLgsave}
-\def\defineXMLgsavecontent {\dotripleempty\dodefineXMLgsavecontent}
-\def\defineXMLenvironmentsave {\dotripleempty\dodefineXMLenvironmentsave}
-\def\defineXMLenvironmentgsave {\dotripleempty\dodefineXMLenvironmentgsave}
-\def\defineXMLprocess {\dotripleempty\dodefineXMLprocess}
-\def\defineXMLnested {\dotripleempty\dodefineXMLnestedenvironment}
-\def\defineXMLnestedenvironment {\dotripleempty\dodefineXMLnestedenvironment}
-\def\defineXMLnestedargument {\dotripleempty\dodefineXMLnestedargument}
-\def\defineXMLnestedsave {\dotripleempty\dodefineXMLnestedsave}
-\def\defineXMLnestedenvironmentsave{\dotripleempty\dodefineXMLnestedenvironmentsave}
-
-%D We can nill definitions with:
-
-\def\resetXMLelement[#1]{\dododefineXMLprocess{#1}}
-
-%D This is equivalent to:
-%D
-%D \starttyping
-%D \def\resetXMLelement[#1]% handy in case only singular
-%D {\@EA\let\csname\@@XMLelement:#1\endcsname \donothing
-%D \@EA\let\csname\@@XMLelement:/#1\endcsname\donothing
-%D \@EA\let\csname\@@XMLelement:#1/\endcsname\donothing}
-%D \stoptyping
-
-% push is (not yet) a real push, so:
-
-\def\defineXMLpush {\dotripleempty\dodefineXMLsave}
-\def\defineXMLenvironmentpush{\dotripleempty\dodefineXMLenvironmentsave}
-
-% goes for all types
-
-\long\def\dodefineXMLsingular[#1][#2][#3]#4%
- {\defineXMLmethod\dododefineXMLsingular{#1}{#2}{#3}{#4}{}}
-
-\long\def\dodefineXMLcommand[#1][#2][#3]#4%
- {\defineXMLmethod\dododefineXMLcommand{#1}{#2}{#3}{#4}{}}
-
-\long\def\dodefineXMLgrouped[#1][#2][#3]#4%
- {\defineXMLmethod\dododefineXMLgrouped{#1}{#2}{#3}{#4}{}}
-
-\long\def\dodefineXMLargument[#1][#2][#3]#4%
- {\defineXMLmethod\dododefineXMLargument{#1}{#2}{#3}{#4}{}}
-
-\long\def\dodefineXMLignore[#1][#2][#3]%
- {\defineXMLmethod\dododefineXMLignore{#1}{#2}{#3}{}{}}
-
-\long\def\dodefineXMLpickup[#1][#2][#3]#4#5%
- {\defineXMLmethod\dododefineXMLpickup{#1}{#2}{#3}{#4}{#5}}
-
-\long\def\dodefineXMLenvironment[#1][#2][#3]#4#5%
- {\defineXMLmethod\dododefineXMLenvironment{#1}{#2}{#3}{#4}{#5}}
-
-\long\def\dodefineXMLsave[#1][#2][#3]%
- {\defineXMLmethod\dododefineXMLsave{#1}{#2}{#3}{}{}}
-
-\long\def\dodefineXMLsavecontent[#1][#2][#3]#4%
- {\defineXMLmethod\dododefineXMLsavecontent{#1}{#2}{#3}{#4}{}}
-
-\long\def\dodefineXMLgsave[#1][#2][#3]%
- {\defineXMLmethod\dododefineXMLgsave{#1}{#2}{#3}{}{}}
-
-\long\def\dodefineXMLgsavecontent[#1][#2][#3]#4%
- {\defineXMLmethod\dododefineXMLgsavecontent{#1}{#2}{#3}{#4}{}}
-
-\long\def\dodefineXMLenvironmentsave[#1][#2][#3]#4#5%
- {\defineXMLmethod\dododefineXMLenvironmentsave{#1}{#2}{#3}{#4}{#5}}
-
-\long\def\dodefineXMLenvironmentgsave[#1][#2][#3]#4#5%
- {\defineXMLmethod\dododefineXMLenvironmentgsave{#1}{#2}{#3}{#4}{#5}}
-
-\long\def\dodefineXMLprocess[#1][#2][#3]%
- {\defineXMLmethod\dododefineXMLprocess{#1}{#2}{#3}{}{}}
-
-\long\def\dodefineXMLnestedenvironment[#1][#2][#3]#4#5%
- {\defineXMLmethod\dododefineXMLnestedenvironment{#1}{#2}{#3}{#4}{#5}}
-
-\long\def\dodefineXMLnestedargument[#1][#2][#3]#4%
- {\defineXMLmethod\dododefineXMLnestedargument{#1}{#2}{#3}{#4}{}}
-
-\long\def\dodefineXMLnestedsave[#1][#2][#3]%
- {\defineXMLmethod\dododefineXMLnestedsave{#1}{#2}{#3}{}{}}
-
-\long\def\dodefineXMLnestedenvironmentsave[#1][#2][#3]#4#5%
- {\defineXMLmethod\dododefineXMLnestedenvironmentsave{#1}{#2}{#3}{#4}{#5}}
-
-% [key=val] => \presetXMLarguments{element} => default key/vals
-% [blabla] => \theXMLarguments{blabla} => user key/vals
-% [blabla] [key=val] => \presetXMLarguments{element} => default key/vals
-% \theXMLarguments{blabla} => user key/vals
-
-% command element [map] [parlst] begin end
-
-\long\def\defineXMLmethod#1#2#3#4#5#6%
- {\ifsecondargument
- \setXMLarguments{#2}{#3}{#4}%
- \else
- \resetXMLarguments{#2}% new
- \fi
- #1{#2}{#5}{#6}}
-
-%D Arguments (attributes) \unknown
-
-% \long\def\setXMLarguments#1#2#3% element [tag] settings
-% {\doifassignmentelse{#2}
-% {\long\setvalue{\@@XMLpars:#1}{\getrawparameters[\@@XMLvariable:#1:][#2]}}
-% {\long\setvalue{\@@XMLmap :#1}{#2}% later we can init vars by this name
-% \doifsomething{#3}{\long\setvalue{\@@XMLpars:#1}{\getrawparameters[#2][#3]}}}}
-
-\long\def\setXMLarguments#1#2#3% element [tag] settings
- {\doifassignmentelse{#2} % ROOM FOR OPTIMIZATION
- {\letbeundefined{\@@XMLmap:#1}%
- \long\setvalue{\@@XMLpars:#1}{\getrawparameters[\@@XMLvariable:#1:][#2]}}
- {\long\setvalue{\@@XMLmap:#1}{#2}% later we can init vars by this name
- \doifsomething{#3}{\long\setvalue{\@@XMLpars:#1}{\getrawparameters[#2][#3]}}}}
-
-\def\presetXMLarguments#1%
- {\csname\@@XMLpars:\rawXMLnamespace#1\endcsname} % == \getvalue{}
-
-\prependtoks
- \presetXMLarguments\rawXMLidentifier
-\to \everyXMLelement
-
-%D We now overload the previously defined argument setter by one
-%D that is faster when definitions are surrounded by
-%D
-%D \starttyping
-%D \startXMLcompiling ... \stopXMLcompiling
-%D \stoptyping
-%D
-%D This method is twice as fast on (for instance) 100K calls to
-%D an empty element with 10 arguments.
-
-% \long\def\prepareXMLargument#1#2#3%
-% {\scratchtoks\expandafter{\the\scratchtoks\@EA\def\csname#1#2\endcsname{#3}}}
-
-% \long\def\prepareXMLargument#1#2#3%
-% {\scratchtoks\@EA\@EA\@EA{\@EA\the\@EA\scratchtoks\@EA\def\csname\@@XMLvariable:#1:#2\endcsname{#3}}}
-
-% \let\@@globalprefix\empty
-
-% \long\def\prepareXMLargument#1#2#3%
-% {\expanded{\scratchtoks
-% {\the\scratchtoks
-% \def\@EA\noexpand\csname\@@XMLvariable:#1:#2\endcsname{#3}%
-% \noexpand\@EA\let\noexpand\csname\@@XMLvariable:\noexpand\the\numexpr(\XMLdepth+1):#2\endcsname
-% \@EA\noexpand\csname\@@XMLvariable:#1:#2\endcsname}}}
-
-\long\def\prepareXMLargument#1#2#3%
- {\expanded{\scratchtoks
- {\the\scratchtoks
- \def\@EA\noexpand\csname\@@XMLvariable:#1:#2\endcsname{#3}%
- \noexpand\@EA\let\noexpand\csname\@@XMLvariable:\noexpand\the\numexpr\XMLdepth+\plusone\relax:#2\endcsname
- \@EA\noexpand\csname\@@XMLvariable:#1:#2\endcsname}}}
-
-\long\def\setXMLargumentsN#1#2#3% element [tag] settings
- {\doifassignmentelse{#2}
- {\letbeundefined{\@@XMLmap:#1}%
- \long\setvalue{\@@XMLpars:#1}{\getrawparameters[\@@XMLvariable:#1:][#2]}}
- {\long\setvalue{\@@XMLmap:#1}{#2}% later we can init vars by this name
- \doifsomething{#3}{\long\setvalue{\@@XMLpars:#1}{\getrawparameters[#2][#3]}}}}
-
-\long\def\setXMLargumentsP#1#2#3% element settings empty (we cannot test for assignment)
- {\letbeundefined{\@@XMLmap:#1}%
- \bgroup
- %def\XMLinheritance{\noexpand\XMLinheritance}
- \def\XMLop##1{\noexpand\XMLpar{#1}{##1}{}}%
- \def\XMLpar{\noexpand\XMLpar}%
- \def\XMLanc{\noexpand\XMLanc}%
- \def\XMLinh{\noexpand\XMLinh}%
- \xdef\!!XMLattr{[#1][#2]}%
- \scratchtoks\emptytoks
- \@EA\dogetparameters\@EA\prepareXMLargument\!!XMLattr
- \xdef\globalnext{\the\scratchtoks}%
- \egroup
- \letvalue{\@@XMLpars:#1}\globalnext
- \globallet\globalnext\relax}
-
-\def\defineXMLattributeset{\dodoubleargument\dodefineXMLattributeset}
-\def\extendXMLattributeset{\dodoubleargument\doextendXMLattributeset}
-
-\def\dodefineXMLattributeset[#1][#2]{\setvalue {\@@XMLpars::#1}{#2}}
-\def\doextendXMLattributeset[#1][#2]{\appendvalue{\@@XMLpars::#1}{,#2}}
-
-\def\XMLattributeset #1{\executeifdefined{\@@XMLpars::#1}\empty}
-%def\XMLinheritance #1{\executeifdefined{\@@XMLpars:#1}\empty}
-\def\showXMLattributes#1{\showvalue{\@@XMLpars:#1}}
-
-\chardef\@@precompile\zerocount
-
-\def\setXMLarguments
- {\ifcase\@@precompile
- \expandafter\setXMLargumentsN
- \else
- \expandafter\setXMLargumentsP
- \fi}
-
-\def\startXMLcompiling
- {\dosingleargument\dostartXMLcompiling}
-
-% \def\dostartXMLcompiling[#1]%
-% {\iffirstargument
-% \copyXMLargumentindeed % when needed, from now on -)
-% \def\@@globalprefix{#1}%
-% \fi
-% \chardef\@@precompile\plusone}
-
-\def\dostartXMLcompiling[#1]%
- {\doif{#1}\v!inherit
- \copyXMLargumentindeed
- \chardef\@@precompile\plusone}
-
-\def\stopXMLcompiling
- {\chardef\@@precompile\zerocount} % no \let\@@globalprefix\empty
-
-%D Interesting what kind of things are needed \unknown
-
-\appendtoks
- \ifdefined\disablelanguagespecifics\disablelanguagespecifics\fi
-\to \everyenableXML
-
-\long\def\longempty{}
-\long\def\longspace{ }
-
-% \def\doifelseXMLdata#1% always empty at start [gets a long assignment]
-% {\@EA\ifx\csname\@@XMLdata:#1\endcsname\longempty
-% \expandafter\secondoftwoarguments
-% \else
-% \expandafter\firstoftwoarguments
-% \fi}
-%
-% \def\doifXMLdata#1% always empty at start [gets a long assignment]
-% {\@EA\ifx\csname\@@XMLdata:#1\endcsname\longempty
-% \expandafter\gobbleoneargument
-% \else
-% \expandafter\firstofoneargument
-% \fi}
-%
-% \let\doifXMLdataelse\doifelseXMLdata
-
-\def\doifelseXMLdata#1% always empty at start [gets a long assignment]
- {\@EA\ifx\csname\@@XMLdata:#1\endcsname\longempty
- \expandafter\secondoftwoarguments
- \else
- \expandafter\firstoftwoarguments
- \fi}
-
-\def\doifXMLdata#1% always empty at start [gets a long assignment]
- {\@EA\ifx\csname\@@XMLdata:#1\endcsname\longempty
- \expandafter\gobbleoneargument
- \else
- \expandafter\firstofoneargument
- \fi}
-
-\let\doifXMLdataelse\doifelseXMLdata
-
-\def\doifelseXMLempty#1%
- {\@EA\ifx\csname\@@XMLdata:#1\endcsname\longempty
- \expandafter\firstoftwoarguments
- \else\@EA\ifx\csname\@@XMLdata:#1\endcsname\longspace
- \expandthree\firstoftwoarguments
- \else
- \expandthree\secondoftwoarguments
- \fi\fi}
-
-% test case:
-%
-% \defineXMLenvironmentsave[test]
-% {}
-% {\message{[\XMLflush{test}]}
-% \message{\doifelseXMLdata {test}{}{no }data}
-% \message{/}
-% \message{\doifelseXMLempty{test}{}{not }empty}
-% \wait}
-%
-% \startXMLdata
-% <test>xxx</test>
-% <test></test>
-% <test> </test>
-% <test> </test>
-% <test> </test>
-% <test> x </test>
-% \stopXMLdata
-
-% \def\XMLflush#1% one level
-% {\csname\@@XMLdata:#1\endcsname}
-
-% evt meer van dit gedoe en alle \longempty's vervangen
-
-\def\XMLflush#1% one level
- {\csname\ifcsname\@@XMLdata:#1\endcsname\@@XMLdata:#1\else\s!empty\fi\endcsname}
-
-%D \starttyping
-%D \defineXMLenvironmentsave[formula]{}{$\XMLtexdata{formula}$}
-%D
-%D \startXMLdata
-%D <formula>t+3+x+t\neq m\alpha\frac\theta\hbar</formula>
-%D \stopXMLdata
-%D \stoptyping
-
-\def\XMLtexdata#1%
- {\begingroup
- \disableXML
- \scantokens\@EA\@EA\@EA{\csname\@@XMLdata:#1\endcsname}%
- \endgroup}
-
-\def\XMLflushdata#1% see m-steps for usage
- {\@EA\ifx\csname\@@XMLdata:#1\endcsname\longempty\else
- %\@EAEAEA\XMLdata\@EA\@EA\@EA{\csname\@@XMLdata:#1\endcsname}%
- \@EA\XMLdata\csname\@@XMLdata:#1\endcsname
- \fi}
-
-\def\XMLflushasis#1%
- {\detokenize\@EAEAEA{\csname\@@XMLdata:#1\endcsname}}
-
-\let\XMLpop \XMLflush
-\let\XMLpopdata\XMLflushdata
-
-\def\XMLappend#1#2% let to empty expands to nothing -)
- {\long\@EA\edef\csname\@@XMLdata:#1\endcsname{\csname\@@XMLdata:#1\endcsname#2}}
-
-\def\XMLprepend#1#2% let to empty expands to nothing -)
- {\long\@EA\edef\csname\@@XMLdata:#1\endcsname{#2\csname\@@XMLdata:#1\endcsname}}
-
-\def\XMLerase#1%
- {\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}
-
-\def\XMLassign#1%
- {\long\@EA\def\csname\@@XMLdata:#1\endcsname}
-
-\def\dontparseXMLelement#1>{}
-
-\def\simplifyXMLelements{\let\parseXMLelement\dontparseXMLelement}
-
-\def\defXMLstring#1#2%
- {\bgroup
- \enableXMLexpansion
- \simplifyXMLelements
- \let\getXMLentity\firstofoneargument
- \XMLrawentitiestrue
- \utfunicodetracer\plusseven % new
- \xdef\@@XML@@string{\csname\@@XMLdata:#2\endcsname}%
- \egroup
- \defconvertedcommand#1\@@XML@@string}
-
-% this has to expand nicely:
-%
-% <!DOCTYPE XXX SYSTEM "xxx" [ <!ENTITY aaa "../www/"> <!ENTITY bbb SYSTEM "&aaa;mmm.eps"> ]>
-%
-% so keep the following as is!
-
-\def\defXMLclean#1#2%
- {\bgroup
- \enableXMLexpansion
- \simplifyXMLelements
- \simplifyXMLentities
- \utfunicodetracer\plusseven % new
- \let\getXMLentity\expandedXMLentity % should this go in \simplify ?
- \xdef\@@XML@@string{\csname\@@XMLdata:#2\endcsname}%
- \egroup
- \defconvertedcommand#1\@@XML@@string}
-
-\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}}
-
-\def\XMLunspace#1% kan sneller
- {\@EA\ifx\csname\@@XMLdata:#1\endcsname\longempty\else
- \long\@EA\edef\csname\@@XMLdata:#1\endcsname
- {\@EAEAEA\dounspaced\csname\@@XMLdata:#1\endcsname\end}%
- \fi}
-
-\chardef\asciispacecode=32
-
-\def\defXMLlowerclean#1% lowercase ! evt tzt upper too
- {\bgroup
- \lccode`\#\asciispacecode
- \lccode`\$\asciispacecode
- \lccode`\%\asciispacecode
- \lccode`\\\asciispacecode
- \lccode`\^\asciispacecode
- \lccode`\_\asciispacecode
- \lccode`\{\asciispacecode
- \lccode`\}\asciispacecode
- \lccode`\|\asciispacecode
- \lccode`\~\asciispacecode
- \@EA\lowercase\@EA{\@EA\xdef\@EA#1\@EA{#1}}%
- \egroup}
-
-\def\processXMLparelse#1#2#3#4%
- {\processaction
- [\XMLpar{#1}{#2}{}]
- [#3,\s!unknown=>{#4},\s!default={#4}]}
-
-%D We can pick up key|/|value pairs, but we still need a way
-%D to process these.
-
-% bugged
-%
-% \def\mapXMLvalue#1#2#3% td align center -> middle
-% {\setvalue{\@@XMLvalue:#1:#2:#3}}
-
-\def\mapXMLvalue#1#2#3% td:align center -> middle
- {\setvalue{\@@XMLvalue:#1:#2}{#3}} % keep #3 to grab spaces
-
-\def\XMLvar#1#2#3% td align center
- {\ifcsname\@@XMLvariable:#1:#2\endcsname
- \XMLval{#1}{#2}{\csname\@@XMLvariable:#1:#2\endcsname}%
- \else
- \XMLval{#1}{#2}{#3}% evt inline code
- \fi}
-
-% \def\XMLvar#1#2#3% td align center
-% {\XMLval{#1}{#2}{\ifcsname\@@XMLvariable:#1:#2\endcsname
-% \csname\@@XMLvariable:#1:#2\endcsname\else#3\fi}}
-
-% \def\XMLval#1#2#3% td:align value default
-% {\ifcsname\@@XMLvalue:#1:#2\endcsname
-% \csname\@@XMLvalue:#1:#2\endcsname
-% \else
-% #3%
-% \fi}
-%
-% The next one permits commands instead of strings in #3
-
-\def\XMLval#1#2% #1=td:align #2=value #3=default
- {\ifcsname\@@XMLvalue:#1:#2\endcsname
- \@EA\firstoftwoarguments
- \else
- \@EA\secondoftwoarguments
- \fi
- {\csname\@@XMLvalue:#1:#2\endcsname}}
-
-\def\XMLpar#1#2#3%
- {\ifcsname\@@XMLvariable:#1:#2\endcsname
- \csname\@@XMLvariable:#1:#2\endcsname
- \else
- #3%
- \fi}
-
-\def\XMLNSpar#1#2#3#4% element namespace name default
- {\ifcsname\@@XMLvariable:#1:#2:#3\endcsname
- \csname\@@XMLvariable:#1:#2:#3\endcsname
- \else
- #4%
- \fi}
-
-% \def\setXMLpar#1#2%
-% {\@EA\def\csname\@@XMLvariable:#1:#2\endcsname}
-
-\def\letXMLpar #1#2{\@EA \let\csname\@@XMLvariable:#1:#2\endcsname}
-\def\setXMLpar #1#2{\@EA \def\csname\@@XMLvariable:#1:#2\endcsname}
-\def\setXMLepar#1#2{\@EA\edef\csname\@@XMLvariable:#1:#2\endcsname}
-
-% ancestor arguments:
-%
-% \defineXMLenvironment
-% [fo:root]
-% [test=unset]
-% {\beginXMLelement}
-% {\endXMLelement}
-%
-% \defineXMLenvironment
-% [fo:block-container]
-% [test=oeps]
-% {\beginXMLelement}
-% {\endXMLelement}
-%
-% \defineXMLenvironment
-% [fo:block]
-% {\beginXMLelement
-% \begingroup}
-% {\endgroup
-% \XMLanc{test}{}
-% \endXMLelement}
-%
-% \startXMLdata
-% <fo:root>
-% <fo:block-container test='first'><fo:block test='second'>second:</fo:block></fo:block-container>
-% <fo:block>unset:</fo:block>
-% <fo:block test='outer'><fo:block test='nested'><fo:block>deep:</fo:block>nested:</fo:block>outer:</fo:block>
-% <fo:block test='last'>last:</fo:block>
-% </fo:root>
-% \stopXMLdata
-%
-% \startXMLdata
-% <fo:root>
-% <fo:block-container test='first'><fo:block>second:</fo:block></fo:block-container>
-% <fo:block>unset:</fo:block>
-% <fo:block test='second'><fo:block><fo:block>deep:</fo:block>nested:</fo:block>outer:</fo:block>
-% <fo:block>last:</fo:block>
-% </fo:root>
-% \stopXMLdata
-%
-% \startXMLdata
-% <fo:root>
-% <fo:block-container test='first'><fo:block>second:</fo:block></fo:block-container>
-% <fo:block>unset:</fo:block>
-% <fo:block><fo:block><fo:block>deep:</fo:block>nested:</fo:block>outer:</fo:block>
-% <fo:block>last:</fo:block>
-% </fo:root>
-% \stopXMLdata
-
-% dit werkt alleen ok in niet <a> <b> <b> ... situaties omdat anders
-% de laatste b de attributen van de vorige heeft:
-
-\def\XMLanc#1%
- {\ifcsname\@@XMLvariable:\currentXMLelement:#1\endcsname % \ownXMLelement
- \csname\@@XMLvariable:\currentXMLelement:#1\endcsname % \ownXMLelement
- \@EA\gobblethreearguments
- \else
- \@EA\pXMLanc
- \fi\XMLdepth{#1}}
-
-% \def\pXMLanc#1%
-% {\@EA\ppXMLanc\@EA{\the\numexpr(#1-\plusone)}}
-
-\def\pXMLanc#1%
- {\@EA\ppXMLanc\@EA{\the\numexpr#1-\plusone\relax}}
-
-\def\ppXMLanc#1#2#3%
- {\ifcsname\@@XMLdepth:#1\endcsname % is er altijd dus redundant
- \ifcsname\@@XMLvariable:\csname\@@XMLdepth:#1\endcsname:#2\endcsname
- \csname\@@XMLvariable:\csname\@@XMLdepth:#1\endcsname:#2\endcsname
- \@EAEAEA\gobblethreearguments
- \else
- \@EAEAEA\pppXMLanc
- \fi
- \else
- \@EA\pppXMLanc
- \fi{#1}{#2}{#3}}
-
-\def\pppXMLanc#1%
- {\ifnum#1>\zerocount
- \@EA\pXMLanc
- \else
- \@EA\thirdofthreearguments
- \fi{#1}}
-
-%D Experimental (not sure if this will stay):
-%D
-%D \starttyping
-%D \startdefineXMLhandlers[one,two]
-%D
-%D \defineXMLenvironment[a=b,c=\XMLop{a}]
-%D {}{}
-%D
-%D \stopdefineXMLhandlers
-%D \stoptyping
-
-\long\def\startdefineXMLhandlers
- {\bgroup\catcode\endoflineasciicode\spacecatcode
- \dodoubleempty\dostartdefineXMLhandlers}
-
-\long\def\dostartdefineXMLhandlers[#1][#2]#3#4\stopdefineXMLhandlers % #2 is dummy
- {\egroup
- \long\def\dodefineXMLhandlers##1{#3[##1]#4}%
- \processcommalist[#1]\dodefineXMLhandlers}
-
-\let\currentXMLhandler\s!unknown
-
-% \long\def\dostartdefineXMLhandlers[#1][#2]#3#4[#5]#6\stopdefineXMLhandlers % #2 is dummy
-% {\egroup
-% \pushmacro\XMLop
-% \pushmacro\XMLpar
-% \pushmacro\currentXMLhandler
-% \long\def\dodefineXMLhandlers##1%
-% {\edef\currentXMLhandler{##1}%
-% \def\XMLop####1{\noexpand\XMLpar{##1}{####1}{}}%
-% \def\XMLpar{\noexpand\XMLpar}%
-% \def\XMLanc{\noexpand\XMLanc}%
-% \edef\!!stringa{[##1][#5]}%
-% \expandafter#3\!!stringa#6}%
-% \processcommalist[#1]\dodefineXMLhandlers
-% \popmacro\currentXMLhandler
-% \popmacro\XMLpar
-% \popmacro\XMLop}
-
-\long\def\dostartdefineXMLhandlers[#1][#2]#3#4[#5]#6\stopdefineXMLhandlers % #2 is dummy
- {\egroup
- \long\def\dodefineXMLhandlers##1%
- {\bgroup
- \edef\currentXMLhandler{##1}%
- \def\XMLop####1{\noexpand\XMLpar{##1}{####1}{}}%
- \def\XMLpar{\noexpand\XMLpar}%
- \def\XMLanc{\noexpand\XMLanc}%
- \def\XMLinh{\noexpand\XMLinh}%
- \xdef\!!XMLattr{[##1][#5]}%
- \egroup
- \expandafter#3\!!XMLattr#6}%
- \processcommalist[#1]\dodefineXMLhandlers}
-
-\def\XMLpav#1#2#3#4%
- {\XMLval{#1}{\XMLpar{#2}{#3}{}}{#4}}
-
-%D A few weird ones:
-
-\def\TEXpar#1#2%
- {\csname#1\interfaced{#2}\endcsname}
-
-\let\texXMLpar\TEXpar % soon obsolete
-
-\let\XMLtex\TEXpar
-
-% handy one
-
-\def\XMLtyp#1#2#3%
- {\ifcsname\@@XMLvariable:#1:#2\endcsname
- \@EA\defconvertedcommand\@EA\ascii\csname\@@XMLvariable:#1:#2\endcsname
- \else
- \defconvertedargument\ascii{#3}%
- \fi
- \ascii}
-
-\defineXMLsingular [begingroup] {\begingroup}
-\defineXMLsingular [endgroup] {\endgroup}
-\defineXMLsingular [gobblespacetokens] {\gobblespacetokens}
-\defineXMLsingular [disableXML] {\disableXML}
-
-\long\def\XMLstr#1%
- {{\enableXML\scantokens{#1}\unskip}}
-
-\long\def\XMLstr#1% test, does not work
- {\ifprocessingXML
- % \begingroup\enableXML\scantokens{#1<endgroup/><gobblespacetokens/>}%
- \scantokens{#1<gobblespacetokens/>}%
- \else
- \begingroup\enableXML\scantokens{#1<endgroup/>\ignorespaces}%
- \fi}
-
-\def\XMLgetvariable#1#2% hooks into generic \getvariable and setvariables
- {\expanded{\XMLstr{\getvariable{#1}{#2}}}}
-
-\long\def\XMLstrpar#1#2#3% test
- {\ifcsname\@@XMLvariable:#1:#2\endcsname
- \scantokens\@EAEAEA{\@EA\begingroup\@EA\enableXML
- \csname\@@XMLvariable:#1:#2\endcsname<endgroup/>}%
- \else
- \scantokens{\begingroup\enableXML#3<endgroup/>}%
- \fi}
-
-\def\doifXMLvarelse#1#2% geen etex, \relax too
- {\ifcsname\@@XMLvariable:#1:#2\endcsname
- \expandafter\ifx\csname\@@XMLvariable:#1:#2\endcsname\empty
- \@EAEAEA\secondoftwoarguments
- \else
- \@EAEAEA\firstoftwoarguments
- \fi
- \else
- \@EA\secondoftwoarguments
- \fi}
-
-\def\doifXMLvar#1#2% geen etex, \relax too
- {\ifcsname\@@XMLvariable:#1:#2\endcsname
- \expandafter\ifx\csname\@@XMLvariable:#1:#2\endcsname\empty
- \@EAEAEA\gobbleoneargument
- \else
- \@EAEAEA\firstofoneargument
- \fi
- \else
- \@EA\gobbleoneargument
- \fi}
-
-\def\doifXMLvalelse#1#2% geen etex, \relax too
- {\ifcsname\@@XMLvalue:#1:#2\endcsname
- \expandafter\ifx\csname\@@XMLvalue:#1:#2\endcsname\empty
- \@EAEAEA\secondoftwoarguments
- \else
- \@EAEAEA\firstoftwoarguments
- \fi
- \else
- \@EA\secondoftwoarguments
- \fi}
-
-\let\doifXMLparelse\doifXMLvarelse
-\let\doifXMLpar \doifXMLvar
-
-%D Used in x-fo: I really need to document this!
-
-\bgroup \catcode`\<=\activecatcode
-
-% usage: \expanded{\rescanXMLatttributes{fo:table-cell}}
-
-\gdef\rescanXMLattributes #1{\noexpand\dogetXMLarguments{#1}\currentXMLarguments>}
-\gdef\parseXMLattributes #1#2{\dogetXMLarguments{#1}#2>}
-
-\egroup
-
-\def\defXMLattributestring#1#2#3#4%
- {\ifcsname\@@XMLvariable:#2:#3\endcsname
- \@EA\defconvertedcommand\@EA#1\csname\@@XMLvariable:#2:#3\endcsname
- \else
- \defconvertedargument#1{#4}%
- \fi}
-
-\def\XMLprocess#1%
- {\begingroup\enableXML\XMLflush{#1}\endgroup}
-
-\bgroup \catcode`<=\activecatcode
-
-\long\gdef\ignoreuntilXMLelement#1<{<}
-\long\gdef\grabuntilXMLelement #1<\to#2{\def#2{#1}<}
-
-\egroup
-
-%D Saves tokens and typing.
-
-\def\XMLownvar {\XMLvar {\rawXMLnamespace\rawXMLidentifier}}
-\def\XMLownval {\XMLval {\rawXMLnamespace\rawXMLidentifier}}
-\def\XMLownpar {\XMLpar {\rawXMLnamespace\rawXMLidentifier}}
-\def\XMLownstrpar {\XMLstrpar {\rawXMLnamespace\rawXMLidentifier}}
-\def\doifXMLownvarelse{\doifXMLvarelse{\rawXMLnamespace\rawXMLidentifier}}
-\def\doifXMLownvalelse{\doifXMLvalelse{\rawXMLnamespace\rawXMLidentifier}}
-\def\doifXMLownparelse{\doifXMLparelse{\rawXMLnamespace\rawXMLidentifier}}
-
-\def\letXMLpar #1#2{\@EA \let\csname\@@XMLvariable:#1:#2\endcsname}
-\def\setXMLpar #1#2{\@EA \def\csname\@@XMLvariable:#1:#2\endcsname}
-\def\setXMLepar#1#2{\@EA\edef\csname\@@XMLvariable:#1:#2\endcsname}
-
-\def\ownXMLelement{\rawXMLnamespace\rawXMLidentifier}
-
-\def\XMLop#1% ownpar
- {\csname\ifcsname\@@XMLvariable:\ownXMLelement:#1\endcsname
- \@@XMLvariable:\ownXMLelement:#1\else\s!empty
- \fi\endcsname}
-
-\def\XMLtp#1% texpar
- {\csname\ifcsname\@@XMLmapmap\interfaced{#1}\endcsname
- \@@XMLmapmap\interfaced{#1}\else\s!empty
- \fi\endcsname}
-
-\def\doifelseXMLop#1{\doifelse{\XMLop{#1}}}
-\def\doifXMLop #1{\doif {\XMLop{#1}}}
-\def\doifnotXMLop #1{\doifnot {\XMLop{#1}}}
-
-\def\doifelsenothingXMLop#1{\doifelsenothing{\XMLop{#1}}}
-\def\doifsomethingXMLop #1{\doifsomething {\XMLop{#1}}}
-\def\doifnothingXMLop #1{\doifnothing {\XMLop{#1}}}
-
-\def\doifelseXMLtp#1{\doifelse{\XMLtp{#1}}}
-\def\doifXMLtp #1{\doif {\XMLtp{#1}}}
-\def\doifnotXMLtp #1{\doifnot {\XMLtp{#1}}}
-
-\def\doifelsenothingXMLtp#1{\doifelsenothing{\XMLtp{#1}}}
-\def\doifsomethingXMLtp #1{\doifsomething {\XMLtp{#1}}}
-\def\doifnothingXMLtp #1{\doifnothing {\XMLtp{#1}}}
-
-\def\XMLflushself{\csname\@@XMLdata:\ownXMLelement\endcsname}
-
-\def\showXMLdata#1{\showvalue{\@@XMLdata:#1}}
-
-\def\XMLta {\theXMLarguments\@@XMLmapmap}
-\def\getXMLta {\expanded{\getparameters[\@@XMLmapmap][\XMLta]}}
-\def\expandXMLta{\expandXMLarguments\@@XMLmapmap}
-\def\expandXMLtp{\expandTEXpar\@@XMLmapmap} % #1
-
-\def\getXMLparameters[#1]% faster than \rawgetparameters[#1][\theXMLar..]
- {\ifcsname\@@XMLmap:#1\endcsname
- \expanded{\rawgetparameters[#1][\csname\@@XMLmap:#1\endcsname]}%
- \fi}
-
-\def\defXMLop#1#2{\@EA\let\@EA#1\csname\@@XMLvariable:\ownXMLelement:#2\endcsname}
-\def\defXMLtp#1#2{\@EA\let\@EA#1\csname\@@XMLmapmap\interfaced{#2}\endcsname}
-
-%D ...
-
-\def\protectXMLdata
- {\catcode\tabasciicode \spacecatcode
- \catcode\endoflineasciicode\spacecatcode
- \catcode\formfeedasciicode \spacecatcode
- \catcode\endoffileasciicode\spacecatcode
- \catcode`\#\othercatcode}
-
-\long\def\startXMLcode
- {\begingroup
- \protectXMLdata
- \dostartXMLcode}
-
-\long\def\dostartXMLcode[#1] #2 \stopXMLcode
- {\@EA\gdef\csname\@@XMLcode:#1\endcsname{\startXMLdata#2\stopXMLdata}%
- \endgroup}
-
-\def\getXMLcode[#1]% \expandXMLcode
- {\csname\@@XMLcode:#1\endcsname}
-
-% \long\def\startXMLdata#1\stopXMLdata%
-% {\begingroup\enableXML\scantokens{#1}\endgroup}
-%
-% \defineXMLentity[tex-backslash] {\catchXMLpar}
-%
-% \def\catchXMLpar#1#2#3
-% {\if#1p\if#2a\if#3r\ifmmode\else\endgraf\fi
-% \else\texescape\fi\else\texescape\fi\else\texescape\fi}
-
-\long\def\startXMLdata
- {\begingroup
- \protectXMLdata
- \dostartXMLdata}
-
-\long\def\dostartXMLdata#1\stopXMLdata % evt \everyeof{}
- {\enableXML\scantokens{#1<gobblespacetokens/>}%
- \endgroup
- \ifhmode\unskip\unskip\fi}
-
-% suboptimal:
-%
-% \unexpanded\def\XMLdata#1% % \unexpanded added 22/5/2001
-% {\begingroup
-% \enableXML\scantokens{#1}\ifhmode\unskip\unskip\fi
-% \endgroup}
-%
-% better but does not work in tables:
-%
-% \unexpanded\def\XMLdata#1% % grouping changed 20/5/2001
-% {\scantokens{\begingroup\enableXML#1<endgroup/>\gobblespacetokens}}
-%
-% currently:
-
-\unexpanded\def\XMLdata % # safe
- {\begingroup
- \protectXMLdata
- \doXMLdata}
-
-\def\doXMLdata#1%
- {\enableXML
- \scantokens{#1<gobblespacetokens/>}%
- \endgroup}
-
-%D
-
-\def\bXMLs{\ifignoreXMLspaces\ignorespaces\fi}
-\def\eXMLs{\ifignoreXMLspaces\ifhmode\unskip\fi\fi}
-
-\protect
-
-% \defineXMLcommand{placeindex/}
-% {\placeindex[criterium=all]}
-%
-% \defineXMLargument{index}
-% {\index[\XMLvar{index}{key}{}]}
-
-%D Here we implement the handling of preformatted code.
-
-\unprotect
-
-\def\startXMLpreformatted#1%
- {\startpacked
- #1%
- \fixedXMLfonttrue
- \obeylines
- \obeyspaces
- \setbox\scratchbox=\hbox{x}%
- \edef\obeyedspace{\noindent\noexpand\kern\the\wd\scratchbox}}
-
-\def\stopXMLpreformatted#1%
- {\stoppacked}
-
-%D
-
-\def\XMLinput{\enableXML\input} \global\let\inputXML\XMLinput
-
-% options
-
-\def\processXMLfile #1{\enableXML\processfile{#1}}
-\def\processXMLfilegrouped#1{{\enableXML\processfile{#1}\relax\ifmmode\else\par\fi}}
-
-%D \type
-%D {processXMLbuffer}
-%D
-%D For illustrative purposes, we need to be able to reuse
-%D definitions, which is why we implement a buffer processor
-%D here. The macro \type {\processXMLbuffer} behaves like
-%D any buffer processor.
-
-\def\processXMLbuffer
- {\dosingleempty\doprocessXMLbuffer}
-
-\def\doprocessXMLbuffer[#1]%
- {\doifelsenothing{#1}
- {\doprocessXMLbuffer[\jobname]}
- {\begingroup
- \enableXML
- \def\dodoprocessXMLbuffer##1{\getbuffer[##1]}%
- \processcommalist[#1]\dodoprocessXMLbuffer
- \endgroup}}
-
-%D Loading specific modules takes place with \type
-%D {\useXMLfilters}.
-
-% todo: flag
-
-\def\useXMLfilter[#1]%
- {\processcommalist[#1]\douseXMLfilter}
-
-\def\douseXMLfilter#1%
- {\doifundefined{\c!file\f!xtagprefix#1}
- {\letvalue{\c!file\f!xtagprefix#1}\empty
- \startreadingfile
- % \truefilename removed
- \readsysfile{\f!xtagprefix#1.mkii}
- {\writestatus{xml}{loading module #1.mkii}}
- {\readsysfile{\f!xtagprefix#1.tex}
- {\writestatus{xml}{loading module #1.tex}}
- \donothing}%
- \stopreadingfile}}
-
-%D Temporarily here.
-
-\newtoks\groupedtoks
-\newif\ifcollectXMLgrouped
-
-\bgroup \catcode`\<=\activecatcode
-
-\newtoks\XMLgtoks
-
-\long\unexpanded\gdef\getXMLgroupedenvironment#1#2#3%
- {\collectXMLgroupedtrue
- \XMLgtoks{#2}%
- \long\def\dodogetgrouped{\@EA\the\@EA\XMLgtoks\the\groupedtoks#3}%
- \getXMLgrouped{#1}}
-
-\long\unexpanded\gdef\getXMLgroupedargument#1#2%
- {\collectXMLgroupedtrue
- \XMLgtoks{#2}%
- \long\def\dodogetgrouped{\@EA\the\@EA\XMLgtoks\@EA{\the\groupedtoks}}%
- \getXMLgrouped{#1}}
-
-\long\unexpanded\gdef\getXMLgroupedignore#1%
- {\collectXMLgroupedfalse
- \let\dodogetgrouped\relax
- \getXMLgrouped{#1}}
-
-\long\gdef\docountXMLgrouped#1\end#2\end % 1 relax is enough since it's
- {\long\def\dosplitXMLstring##1#1##2\relax\relax##3\end % another regime
- {\def\ascii{##2}%
- \ifx\ascii\empty \else
- \advance\scratchcounter \plusone
- \dosplitXMLstring##2\relax\relax#1\relax\relax\end
- \fi}%
- \dosplitXMLstring#2\relax\relax#1\relax\relax\end}
-
-\long\unexpanded\gdef\getXMLgrouped#1% #1 kan weg % klopt dit nu?
- {\groupedtoks\emptytoks
- \scratchcounter\zerocount
- \edef\theXMLnamespace
- {\ifx\originalXMLnamespace\empty\else\originalXMLnamespace:\fi
- \currentXMLidentifier}%
- \expanded{\long\noexpand\def\noexpand\dogetgrouped####1\noexpand</\currentXMLelement>}%
- {\ifcollectXMLgrouped\appendtoks##1\to\groupedtoks\fi
- \@EA\docountXMLgrouped\@EA<\theXMLnamespace>\end##1\end
- \@EAEAEA\docountXMLgrouped\@EA\@EA\@EA<\@EA\theXMLnamespace\space \end##1\end
- \ifcase\scratchcounter
- \let\dogetgrouped\dodogetgrouped
- \else
- \advance\scratchcounter \minusone
- \ifcollectXMLgrouped\@EA\appendtoks\@EA<\@EA/\currentXMLelement>\to\groupedtoks\fi
- \fi
- \dogetgrouped}%
- \dogetgrouped}
-
-\egroup
-
-% interesting and fully expandable
-
-\def\XMLownifequalelse#1#2%
- {\@EAEAEA\@@ifequal\csname\@@XMLvariable:\ownXMLelement:#1\endcsname\relax\@@and#2\relax\@@then}
-
-% \def\XMLifequalelse#1#2#3%
-% {\@EAEAEA\@@ifequal\csname\@@XMLvariable:#1:#2\endcsname\relax\@@and#3\relax\@@then}
-
-\def\XMLifequalelse#1#2%
- {\ifcsname\@@XMLvariable:#1:#2\endcsname
- % \@EAEAEA\doXMLifequalelse\@EA\@EA\csname\@@XMLvariable:#1:#2\endcsname
- \@EA\doXMLifequalelse\csname\@@XMLvariable:#1:#2\@EA\endcsname
- \else
- \@EA\secondoftwoarguments
- \fi}
-
-\def\doXMLifequalelse#1#2%
- {\@EA\@@ifequal#1\relax\@@and#2\relax\@@then}
-
-%D \starttyping
-%D \defineXMLenvironment[test][a=1]
-%D {\XMLownifequalelse{a}{2}{YES}{NO}}
-%D {}
-%D
-%D \defineXMLenvironment[test][a=1]
-%D {\XMLifequalelse{test}{a}{1}{YES}{NO}}
-%D {}
-%D
-%D \startXMLdata
-%D <test a="1">test</test>
-%D \stopXMLdata
-%D \stoptyping
-
-\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`\<\activecatcode
-\catcode`\&\activecatcode
-
-\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
-
-\def\defXMLexpanded#1#2%
- {\begingroup
- \let\getXMLentity\expandedXMLentity
- \expanded{\endgroup\edef\noexpand#1{#2}}}
-
-\def\gdefXMLexpanded#1#2%
- {\begingroup
- \let\getXMLentity\expandedXMLentity
- \expanded{\endgroup\xdef\noexpand#1{#2}}}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-map.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-map.mkii
deleted file mode 100644
index 4f639bf0183..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-map.mkii
+++ /dev/null
@@ -1,746 +0,0 @@
-%D \module
-%D [ file=xtag-map,
-%D version=2000.12.20,
-%D title=\CONTEXT\ XML Macros,
-%D subtitle=Remapping,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 There is a more versatile mapper available in \type {xtag-rem.tex}!
-
-%D We also need something that lets content as-is, like for
-%D instance XML embedded in a chemical caption.
-
-\writestatus{loading}{ConTeXt XML Macros / Remapping}
-
-%D A fundamental characteristic of \TEX\ is that much
-%D processing depends on picking up one or more arguments and
-%D acting upon them. In \type {xtag-ini} we have implemented
-%D the normal (high) level interface between \XML\ and
-%D \CONTEXT, and there we already saw some ways to pick up an
-%D element as argument.
-%D
-%D In this module we will implement a preprocessor. An element
-%D that feeds its content to the preprocessor, becomes a token
-%D list consisting of \TEX\ macros, which in turn may expand to
-%D their meanings.
-%D
-%D This module is only tested with \ETEX. In principle we can
-%D make it work with good old \TEX, but we see no objection
-%D against using \ETEX, especially since it's part of every
-%D grown up \TEX\ distribution.
-
-\unprotect
-
-\let\normalparseXMLescape \parseXMLescape
-\let\normalparseXMLelement\parseXMLelement
-\let\normalparseXMLprocess\parseXMLprocess
-
-\let\normaldoXMLelement \doXMLelement
-\let\normaldoXMLentity \doXMLentity
-
-\def\setnormalXMLhandler
- {\let\doXMLelement \normaldoXMLelement
- \let\parseXMLelement\normalparseXMLelement
- \let\parseXMLescape \normalparseXMLescape
- \let\parseXMLprocess\normalparseXMLprocess
- \let\doXMLentity \normaldoXMLentity}
-
-%D A careful reader will notice that we do a full expansion of
-%D the content of the element, although commands that are
-%D protected will stay untouched. In this stage we also
-%D collect key|/|value pairs and pass them onto the \TEX\
-%D macros if needed. Again, we need a fully expandable parser
-%D to handle this, which make the core macros slightly
-%D unreadable.
-%D
-%D The interface presented here evolved from an older module,
-%D written on top of \type {m-sgml}, that could take care of
-%D \MATHML\ (version 1). The implementation here is more
-%D advanced in the sense that it permits all kind of parsers.
-
-\def\findendofXMLelement#1% space after 0/1 prevents auto \relax
- {\if#1>0 \else
- \if#1/1 \endofXMLelementE\else
- \if#1"\endofXMLelementD \else
- \if#1'\endofXMLelementS \else
- \endofXMLelementN \fi\fi\fi\fi}
-
-\def\endofXMLelementE#1\fi\fi\fi\fi#2>{\fi\fi}
-\def\endofXMLelementD#1\fi\fi\fi\fi#2"{\fi\fi\fi \findendofXMLelement}
-\def\endofXMLelementS#1\fi\fi\fi\fi#2'{\fi\fi\fi\fi\findendofXMLelement}
-\def\endofXMLelementN \fi\fi\fi\fi {\fi\fi\fi\fi\findendofXMLelement}
-
-% not faster
-%
-% \def\findendofXMLelement#1%
-% {\csname**\if#1>>\else\if#1//\else\if#1""\else\if#1''\else.\fi\fi\fi\fi\endcsname}
-%
-% \def\findendofXMLelement#1%
-% {\csname**\ifcsname**#1\endcsname#1\else.\fi\endcsname}
-%
-% \setvalue{**>}{0 }
-% \setvalue{**/}#1>{1 }
-% \setvalue{**"}#1"{\findendofXMLelement}
-% \setvalue{**'}#1'{\findendofXMLelement}
-% \letvalue{**.}\findendofXMLelement
-
-\newif\ifremapXMLunknown
-
-%D We need three steps to avoid namespace: tag since comment
-%D and processing instructions don't have a namespace. The
-%D first step distinguishes between comment, processing
-%D instructions and elements. The second step (which is
-%D defined in the main mapping macro) either or not grabs the
-%D namespace. We may extend this model later to a more
-%D versatile one, using remapping.
-
-%D Parsing escapes is done by specific macros. For the
-%D moment we assume that the sequence ends with an \type {>}
-%D (which is definietly not the case for \type {CDATA}).
-
-\long\def\remapXMLescape#1#2>{}
-
-%D Processing instructions are remapped and only certain
-%D cases are handled.
-
-\long\def\remapXMLprocess#1#2{\xmlp{procins/}{X}{#1}{#2}}
-
-%D This one is more efficient (although no one will notice
-%D this since this macro is used seldom).
-
-\long\def\remapXMLprocess{\xmlp{procins/}{X}}
-
-%D Element need a bit more work; \type {#4} consumes spaces.
-
-% \def\remapXMLunknownONE#1#2% name args
-% {\ifremapXMLunknown\remapXMLone{\s!unknown}{#1 #2}\fi}
-%
-% \def\remapXMLunknownTWO#1#2% name args
-% {\ifremapXMLunknown\remapXMLtwo{\s!unknown}{#1 #2}\fi}
-%
-% \def\remapXMLunknownTHREE#1#2% name args
-% {\ifremapXMLunknown\remapXMLthree{\s!unknown/}{#1 #2}\fi}
-%
-% \long\def\remapXMLelement#1#2 #3>#4% todo: we need to get rid of the end /
-% {\ifcase\findendofXMLelement#2#3>%
-% \if#1/%
-% \expandafter\ifx\csname\@@XML\@@XMLmapping:#2:M\endcsname\relax
-% \remapXMLunknownONE{#2}{}%
-% \else
-% \remapXMLone{#2}{}%
-% \fi
-% \else
-% \expandafter\ifx\csname\@@XML\@@XMLmapping:#1#2:M\endcsname\relax
-% \remapXMLunknownTWO{#1#2}{#3}%
-% \else
-% \remapXMLtwo{#1#2}{#3}%
-% \fi
-% \fi
-% \else
-% \expandafter\ifx\csname\@@XML\@@XMLmapping:#1#2:M\endcsname\relax
-% \expandafter\ifx\csname\@@XML\@@XMLmapping:#1#2/:M\endcsname\relax
-% \remapXMLunknownTHREE{#1#2}{#3}%
-% \else
-% \remapXMLthree{#1#2/}{#3}%
-% \fi
-% \else
-% \remapXMLthree{#1#2}{#3}%
-% \fi
-% \fi#4}
-
-\def\remapXMLthreeempty#1%
- {\remapXMLthree{#1/}}
-
-\def\remapXMLunknownONE#1#2% name args
- {\ifremapXMLunknown\remapXMLone\s!unknown{#1 #2}\fi}
-
-\def\remapXMLunknownTWO#1#2% name args
- {\ifremapXMLunknown\remapXMLtwo\s!unknown{#1 #2}\fi}
-
-\def\remapXMLunknownTHREE#1#2% name args
- {\ifremapXMLunknown\remapXMLthreeempty\s!unknown{#1 #2}\fi}
-
-\long\def\remapXMLelement#1#2 #3>#4% todo: we need to get rid of the end /
- {\ifcase\findendofXMLelement#2#3>%
- \if#1/%
- \expandafter\ifx\csname\@@XML\@@XMLmapping:#2:M\endcsname\relax
- \@EA\remapXMLunknownONE
- \else
- \@EA\remapXMLone
- \fi{#2}\empty
- \else
- \expandafter\ifx\csname\@@XML\@@XMLmapping:#1#2:M\endcsname\relax
- \@EA\remapXMLunknownTWO
- \else
- \@EA\remapXMLtwo
- \fi{#1#2}{#3}%
- \fi
- \else
- \expandafter\ifx\csname\@@XML\@@XMLmapping:#1#2:M\endcsname\relax
- \expandafter\ifx\csname\@@XML\@@XMLmapping:#1#2/:M\endcsname\relax
- \@EAEAEA\remapXMLunknownTHREE
- \else
- \@EAEAEA\remapXMLthreeempty
- \fi
- \else
- \@EA\remapXMLthree
- \fi{#1#2}{#3}%
- \fi#4}
-
-\unexpanded\def\xmlr#1#2{\csname\@@XML\@@XMLmapping:#1:#2\endcsname}
-\unexpanded\def\xmlp#1#2{\csname\@@XML :#1:#2\endcsname}
-\def \expandedxmlr#1#2{\csname\@@XML\@@XMLmapping:#1:#2\endcsname}
-
-\def\expandXMLremapping{\let\xmlr\expandedxmlr}
-
-\def\@@XMLremap{XMLremap}
-
-\def\remapXMLone#1#2%
- {\ifcase\csname\@@XMLremap\csname\@@XML\@@XMLmapping:#1:M\endcsname\endcsname
- \or % GCPA
- \XMLeg\XMLeg
- \or % GCP-
- \XMLeg
- \or % GC-A
- \XMLeg\XMLeg
- \or % GC--
- \XMLeg
- \or % -CPA
- \XMLeg
- \or % -CP-
- %
- \or % -C-A
- \XMLeg
- \or % -C--
- %
- \or % G---
- \XMLeg
- \or % GLR-
- \xmlr{#1}{R}\XMLeg
- \or % -LR-
- \xmlr{#1}{R}%
- \fi}
-
-\def\remapXMLtwo#1#2%
- {\ifcase\csname\@@XMLremap\csname\@@XML\@@XMLmapping:#1:M\endcsname\endcsname
- \or % GCPA
- \XMLbg\xmlr{#1}{X}{#2}\XMLbg
- \or % GCP-
- \XMLbg\xmlr{#1}{X}{#2}%
- \or % GC-A
- \XMLbg\xmlr{#1}{X}\XMLbg
- \or % GC--
- \XMLbg\xmlr{#1}{X}%
- \or % -CPA
- \xmlr{#1}{X}{#2}\XMLbg
- \or % -CP-
- \xmlr{#1}{X}{#2}%
- \or % -C-A
- \xmlr{#1}{X}\XMLbg
- \or % -C--
- \xmlr{#1}{X}%
- \or % G---
- \XMLbg
- \or % GLR-
- \XMLbg\xmlr{#1}{L}%
- \or % -LR-
- \xmlr{#1}{L}%
- \fi}
-
-\def\remapXMLthree#1#2%
- {\ifcase\csname\@@XMLremap\csname\@@XML\@@XMLmapping:#1:M\endcsname\endcsname
- \or % GCPA
- \XMLbg\xmlr{#1}{X}{#2}\XMLbg\XMLeg\XMLeg
- \or % GCP-
- \XMLbg\xmlr{#1}{X}{#2}\XMLeg
- \or % GC-A
- \XMLbg\xmlr{#1}{X}\XMLbg\XMLeg\XMLeg
- \or % GC--
- \XMLbg\xmlr{#1}{X}\XMLeg
- \or % -CPA
- \xmlr{#1}{X}{#2}\XMLbg\XMLeg
- \or % -CP-
- \xmlr{#1}{X}{#2}%
- \or % -C-A
- \xmlr{#1}{X}\XMLbg\XMLeg
- \or % -C--
- \xmlr{#1}{X}%
- \or % G---
- \XMLbg\XMLeg
- \fi}
-
-\scratchtoks\@EA{\string{} \edef\XMLbg{\the\scratchtoks}
-\scratchtoks\@EA{\string}} \edef\XMLeg{\the\scratchtoks}
-
-\chardef\XMLremapGCPA = 1 % {\command {arg} { } }
-\chardef\XMLremapGCP = 2 % {\command {arg} } %
-\chardef\XMLremapGCA = 3 % {\command { } }
-\chardef\XMLremapGC = 4 % {\command } %
-\chardef\XMLremapCPA = 5 % \command {arg} { }
-\chardef\XMLremapCP = 6 % \command {arg} %
-\chardef\XMLremapCA = 7 % \command { }
-\chardef\XMLremapC = 8 % \command %
-\chardef\XMLremapG = 9 % { }
-\chardef\XMLremapGLR = 10 % { \bcom \ecom }
-\chardef\XMLremapLR = 11 % \bcom \ecom
-
-%D The remapping is controlled by only a few definition
-%D macros, that both deal with elements. We distinguish
-%D between normal and empty elements.
-%D
-%D \starttyping
-%D \remapXMLsequence [name] [result map] \unexpandablecommand
-%D \remapXMLsequence [name] [result map] \unexpandablecommand
-%D \stoptyping
-%D
-%D The \MATHML\ module demonstrates how these can be used.
-%D The element is converted into a sequence with one or more
-%D of the following components.
-%D
-%D \starttyping
-%D { \command {parameters} {argument} }
-%D \stoptyping
-%D
-%D The following combinations are supported.
-%D
-%D \starttabulate[|c|c|c|c|c|]
-%D \NC GCPA \NC grouped \NC command \NC parameters \NC argument \NC \NR
-%D \NC GCP \NC grouped \NC command \NC parameters \NC \NC \NR
-%D \NC GCA \NC grouped \NC command \NC \NC argument \NC \NR
-%D \NC GC \NC grouped \NC command \NC \NC \NC \NR
-%D \NC CPA \NC \NC command \NC parameters \NC argument \NC \NR
-%D \NC CP \NC \NC command \NC parameters \NC \NC \NR
-%D \NC CA \NC \NC command \NC \NC argument \NC \NR
-%D \NC C \NC \NC command \NC \NC \NC \NR
-%D \NC G \NC grouped \NC \NC \NC \NC \NR
-%D \stoptabulate
-%D
-%D Empty elements (singular ones) never get an argument,
-%D which makes sense, since they have at most parameters.
-
-\def\remapXMLsequence{\doquadrupleargument\doremapXML []}
-\def\remapXMLsingular{\doquadrupleargument\doremapXML[/]}
-
-\def\doremapXML[#1][#2][#3][#4]%
- {\iffourthargument
- \def\next{\dodoremapXML[#2][#1][#3][#4]}%
- \else
- \def\next{\dodoremapXML[\@@XMLmapping][#1][#2][#3]}%
- \fi
- \next}
-
-%\def\dodoremapXML[#1][#2][#3][#4]% class / name pattern
-% {\doifinstringelse{LR}{#4}
-% {\let\next\doremapXMLtwo}
-% {\let\next\doremapXMLone}%
-% \next[#1][#2][#3][#4]}%
-
-\def\dodoremapXML[#1][#2][#3][#4]% class / name pattern
- {\doifinstringelse{LR}{#4}\doremapXMLtwo\doremapXMLone[#1][#2][#3][#4]}
-
-\def\doremapXMLone[#1][#2][#3][#4]#5%
- {\setvalue{\@@XML#1:#3#2:M}{#4}%
- \setvalue{\@@XML#1:#3#2:X}{#5}}
-
-\def\doremapXMLtwo[#1][#2][#3][#4]#5#6%
- {\setvalue{\@@XML#1:#3:M}{#4}%
- \setvalue{\@@XML#1:#3:L}{#5}%
- \setvalue{\@@XML#1:#3:R}{#6}}
-
-\let\dowithentity\empty
-
-%D We handle processing instructions and unknown elements with:
-
-\remapXMLsingular [procins] [CPA] \normalparseXMLprocess
-\remapXMLsingular [\s!unknown] [CPA] \doXMLunknownSI
-\remapXMLsequence [\s!unknown] [CPA] \doXMLunknownSE
-
-\def\doXMLunknownSI#1#2{{\tttf[#1 #2]}}
-\def\doXMLunknownSE#1#2{{\tttf[#1 #2]}}
-
-%D In a similar way, we can remap entities.
-
-\def\remapXMLentity#1;#2%
- {\doremapXMLentity{#1}#2}%
-
-\def\doremapXMLentity
- {\xmlrent}
-
-% \unexpanded\def\xmlrent#1%
-% {\getXMLentity{#1}}
-%
-% replaced by:
-
-\unexpanded\def\xmlrent#1%
- {\doXMLentity#1;}
-
-%D The remapping is taken care of by the following macro,
-%D which takes three arguments.
-%D
-%D \starttyping
-%D \XMLremapdata{before}{after}{content}
-%D \stoptyping
-%D
-%D After the remapping, the content is executed (expanded)
-%D under the normal \TEX\ catcode regime. The intermediate
-%D result can be traced by turning on the following switch.
-
-\newif\iftraceXMLremapping
-
-\newtoks \everyXMLremapping
-
-\appendtoks
- \defineXMLentity[tex-hash]{\letterhash}%
- \defineXMLentity[tex-bar]{\myspecialnormalvert}%
-\to \everyXMLremapping
-
-\def\setnormalXMLentities% will change ! ! ! ! !
- {\defineXMLentity[tex-hash]\letterhash
- \defineXMLentity[tex-dollar]\letterdollar
- \defineXMLentity[tex-percent]\letterpercent
- \defineXMLentity[tex-backslash]\letterbackslash
- \defineXMLentity[tex-hat]\letterhat
- \defineXMLentity[tex-underscore]\letterunderscore
- \defineXMLentity[tex-leftbrace]\letterbgroup
- \defineXMLentity[tex-rightbrace]\letteregroup
- \defineXMLentity[tex-bar]\letterbar}
-
-\let\XMLremappedpar\empty
-
-%D Here we implement the second step in the element grabber.
-
-\long\def\XMLremapdata
- {\dosingleempty\doXMLremapdata}
-
-\long\def\doXMLremapdata[#1]#2#3#4%
- {\bgroup
- \startXMLmapping[#1]%
- % enable unknown elements (should be macro)
- \doifsomething{#1}
- {\doifdefinedelse{\@@XML#1:\s!unknown:M}
- {\remapXMLunknowntrue}{\remapXMLunknownfalse}}%
- %
- \pushmacro\doXMLentity % needed ?
- % this will change, proper split in element itself
- \ifx\currentXMLnamespace\empty
- \let\parseXMLelement\remapXMLelement
- \else
- % here we need to get rid of the namespace; we also
- % have to preserve the leading / if present
- \@EA\long\@EA\def\@EA\parseXMLelement\@EA
- ##\@EA1\currentXMLnamespace:{\remapXMLelement##1}%
- % ##2 removes leading spaces
- \fi
- %
- \let\parseXMLescape \remapXMLescape
- \let\parseXMLprocess\remapXMLprocess
- %
- \let\doXMLentity \remapXMLentity
- %
- \enableXML % sets entities
- \enableXMLexpansion
- \let\par\XMLremappedpar
- \the\everyXMLremapping
- %\ignorelines
- \catcode\tabasciicode \spacecatcode
- \catcode\endoflineasciicode\spacecatcode
- \catcode\formfeedasciicode \spacecatcode
- \catcode\endoffileasciicode\spacecatcode
- \pushmacro\unicodechar
- \let\unicodechar\relax
- \xdef\remappedXMLdata{#4\empty}%
- \popmacro\unicodechar
- \let\par\endgraf
- \popmacro\doXMLentity % needed ?
- \disableXMLexpansion
- \catcode`\{=\begingroupcatcode
- \catcode`\}=\endgroupcatcode
- \catcode`\\=\escapecatcode
- \iftraceXMLremapping
- \ifmmode\vbox\fi\bgroup
- \defconvertedcommand\ascii\remappedXMLdata
- \tttf\veryraggedright\ascii\par
- \writestatus{xml-remap}{\ascii}%
- \egroup
- \fi
- #2\scantokens\@EA{\remappedXMLdata\empty\empty}#3%
- \stopXMLmapping
- \egroup}
-
-% testcase:
-%
-% aap‒noot coördinatie – één
-%
-% \startXMLdata
-% aap‒noot coördinatie – één
-% <formula><math><mtext>aap‒noot coördinatie – één</mtext></math></formula>
-% \stopXMLdata
-%
-% weird case:
-%
-% \chardef\XMLtokensreduction\zerocount
-% \startXMLdata
-% <formula><math><mtext>\"{a}\"{o}\"{u}\v{c}\v{s}\v{z}</mtext></math></formula>
-% \stopXMLdata
-%
-% \chardef\XMLtokensreduction\plustwo
-% \startXMLdata
-% <formula><math><mtext>\"{a}\"{o}\"{u}\v{c}\v{s}\v{z}</mtext></math></formula>
-% \stopXMLdata
-
-% rename to better names
-
-\newtoks \XMLRtoks
-\newcount \nofXMLRchildren
-
-\def\naturalxmlr#1#2{\getvalue{\@@XML\@@XMLmapping:#1:#2}}
-
-\def\ignoreXMLRelement#1#2{}
-\def\normalXMLRelement#1#2{#2}
-
-\let\nextXMLRelement \empty
-\let\firstXMLRelement \empty
-\let\secondXMLRelement\empty
-
-% \def\withnextXMLRelement#1%
-% {\pushmacro\dowithnextXMLRelement
-% \def\dowithnextXMLRelement##1##2##3##4##5%
-% {\popmacro\dowithnextXMLRelement
-% \def\nextXMLRelement{##1{##2}{##3}{##4}{##5}}%
-% #1}%
-% \doifnextcharelse\empty\empty\dowithnextXMLRelement}
-%
-% better and faster:
-
-\def\dowithnextXMLRelement#1#2#3#4#5#6%
- {\def\nextXMLRelement{#2{#3}{#4}{#5}{#6}}#1}%
-
-\def\withnextXMLRelement#1%
- {\doifnextcharelse\empty\empty{\dowithnextXMLRelement{#1}}}
-
-\def\withnexttwoXMLRelements#1%
- {\pushmacro\firstXMLRelement
- \pushmacro\secondXMLRelement
- \withnextXMLRelement
- {\let\firstXMLRelement\nextXMLRelement
- \withnextXMLRelement
- {\let\secondXMLRelement\nextXMLRelement
- #1%
- \popmacro\secondXMLRelement
- \popmacro\firstXMLRelement}}}
-
-\def\withnextthreeXMLRelements#1% korter, met two
- {\pushmacro\firstXMLRelement
- \pushmacro\secondXMLRelement
- \pushmacro\thirdXMLRelement
- \withnextXMLRelement
- {\let\firstXMLRelement\nextXMLRelement
- \withnextXMLRelement
- {\let\secondXMLRelement\nextXMLRelement
- \withnextXMLRelement
- {\let\thirdXMLRelement\nextXMLRelement
- #1%
- \popmacro\thirdXMLRelement
- \popmacro\secondXMLRelement
- \popmacro\firstXMLRelement}}}}
-
-\def\doifXMLRchildelse#1#2#3#4%
- {\pushmacro\xmlr
- \def\next{#4}%
- \def\xmlr##1##2##3##4% the / should be sorted out in the mapper
- {\rawdoifinsetelse{##1}{#1}
- {\def\next{#3}}
- {\doif{##1}{#1/}{\def\next{#3}}}}%
- #2\empty
- \popmacro\xmlr
- \next}
-
-\def\doifXMLRchild#1#2#3%
- {\pushmacro\xmlr
- \let\next\empty
- \def\xmlr##1##2##3##4% the / should be sorted out in the mapper
- {\rawdoifinsetelse{##1}{#1}
- {\def\next{#3}}
- {\doif{##1}{#1/}{\def\next{#3}}}}%
- #2\empty
- \popmacro\xmlr
- \next}
-
-\def\encapsulateXMLRchild#1#2#3#4#5%
- {\pushmacro\xmlr
- \def\xmlr##1##2##3##4%
- {\doifelse{##1}{#1}
- {\def\next{\doencapsulateXMLRchild{#2}{#3}{#4}{##4}}}
- {\let\next\empty}%
- \next}%
- #5\empty
- \popmacro\xmlr}
-
-\def\encapsulateXMLRchildren#1#2#3#4#5%
- {\pushmacro\xmlr
- \pushmacro\betweenXMLRchild
- \def\betweenXMLRchild{\def\betweenXMLRchild{#3}}%
- \def\xmlr##1##2##3##4%
- {\rawdoifinsetelse{##1}{#1}
- {\pushmacro\xmlr
- \let\xmlr\naturalxmlr
- \betweenXMLRchild\xmlr{##1}{##2}{##3}{##4}%
- \popmacro\xmlr}
- {}}%
- #2#5\empty#4%
- \popmacro\betweenXMLRchild
- \popmacro\xmlr}
-
-\def\doencapsulateXMLRchild#1#2#3#4%
- {\pushmacro\xmlr
- \pushmacro\betweenXMLRchild
- \def\betweenXMLRchild{\def\betweenXMLRchild{#2}}%
- \def\xmlr##1##2##3##4%
- {\pushmacro\xmlr
- \let\xmlr\naturalxmlr
- \betweenXMLRchild\xmlr{##1}{##2}{##3}{##4}%
- \popmacro\xmlr}%
- #1#4\empty#3%
- \popmacro\betweenXMLRchild
- \popmacro\xmlr}
-
-\let\encapsulateXMLR\doencapsulateXMLRchild
-
-\def\withnextXMLRelementelse#1#2%
- {\def\xdowithnextXMLRelement##1##2##3##4##5%
- {\def\nextXMLRelement{##1{##2}{##3}{##4}{##5}}#1}%
- \def\xnowithnextXMLRelement%
- {\let\nextXMLRelement\empty#2}%
- \doifnextcharelse\xmlr\xdowithnextXMLRelement\xnowithnextXMLRelement}
-
-\def\encapsulatenextXMLRelements#1#2#3#4% oude bewaren
- {\pushmacro\betweenXMLRchild
- \pushmacro\afterXMLRchild
- \def\betweenXMLRchild{#1\def\betweenXMLRchild{#2}}%
- \let\afterXMLRchild\empty
- \withnextXMLRelementelse
- {\betweenXMLRchild
- \def\afterXMLRchild{#3}%
- \nextXMLRelement
- \doifnextcharelse\empty\xnowithnextXMLRelement\xdowithnextXMLRelement}
- {\afterXMLRchild
- \popmacro\afterXMLRchild
- \popmacro\betweenXMLRchild}%
- #4}
-
-\def\collectXMLRchild#1#2%
- {\XMLRtoks\emptytoks
- \pushmacro\xmlr
- \def\xmlr##1##2##3##4%
- {\doif{##1}{#1}{\appendtoks##4\to\XMLRtoks}}%
- #2\empty
- \popmacro\xmlr}
-
-\def\doifelseXMLRneighbors#1#2%
- {\XMLRtoks\emptytoks
- \pushmacro\xmlr
- \donefalse
- \let\prevXMLRchild\empty
- \def\xmlr##1##2##3##4%
- {\doif{##1}{#1}{\doif{##1}\prevXMLRchild{\donetrue}}%
- \def\prevXMLRchild{##1}}%
- #2\empty
- \popmacro\xmlr
- \ifdone
- \expandafter\firstoftwoarguments
- \else
- \expandafter\secondoftwoarguments
- \fi}
-
-\def\collectbetweenXMLRchild#1#2#3%
- {\XMLRtoks\emptytoks
- \pushmacro\xmlr
- \pushmacro\betweenXMLRchild
- \def\betweenXMLRchild{\def\betweenXMLRchild{\appendtoks#2\to\XMLRtoks}}%
- \def\xmlr##1##2##3##4%
- {\rawdoifinsetelse{##1}{#1}
- {\betweenXMLRchild\appendtoks\xmlr{##1}{##2}{##3}{##4}\to\XMLRtoks}{}}%
- #3\empty
- \popmacro\betweenXMLRchild
- \popmacro\xmlr}
-
-\def\dorawcollectbetweenXMLR#1#2%
- {\pushmacro\xmlr
- \pushmacro\betweenXMLRchild
- \def\betweenXMLRchild{\def\betweenXMLRchild{#1}}%
- \def\xmlr##1##2##3##4%
- {\betweenXMLRchild\appendtoks\xmlr{##1}{##2}{##3}{##4}\to\XMLRtoks}%
- #2\empty
- \popmacro\betweenXMLRchild
- \popmacro\xmlr}
-
-\def\rawcollectbetweenXMLR%
- {\XMLRtoks\emptytoks\dorawcollectbetweenXMLR}
-
-\def\docollectbetweenXMLR#1%
- {\dorawcollectbetweenXMLR{\appendtoks#1\to\XMLRtoks}}
-
-\def\collectbetweenXMLR%
- {\XMLRtoks\emptytoks\docollectbetweenXMLR}
-
-\def\processXMLRchildren#1%
- {\pushmacro\xmlr
- \let\xmlr\naturalxmlr
- #1\empty
- \popmacro\xmlr}
-
-\def\processXMLRchild#1#2% slow but more versatile
- {\pushmacro\xmlr
- \XMLRtoks\emptytoks
- \def\xmlr##1##2##3##4%
- {\rawdoifinsetelse{##1}{#1}
- {\appendtoks\xmlr{##1}{##2}{##3}{##4}\to\XMLRtoks}{}}%
- #2%
- \popmacro\xmlr
- \the\XMLRtoks\empty}
-
-\def\countXMLRchildren#1%
- {\pushmacro\xmlr
- \nofXMLRchildren=0
- \def\xmlr##1##2##3##4{\advance\nofXMLRchildren\plusone}
- #1\empty
- \popmacro\xmlr}
-
-\def\countXMLRchild#1#2%
- {\pushmacro\xmlr
- \nofXMLRchildren=0
- \def\xmlr##1##2##3##4%
- {\rawdoifinsetelse{##1}{#1}{\advance\nofXMLRchildren\plusone}{}}
- #2\empty
- \popmacro\xmlr}
-
-\def\installXMLunknownremapping
- {\remapXMLsingular[\s!unknown][CPA]\doXMLunknownSI
- \remapXMLsequence[\s!unknown][CPA]\doXMLunknownSE}
-
-\bgroup \catcode`<=\activecatcode
-
-\gdef\revertXMLremapping
- {\gdef\doXMLunknownSE##1##2{<##1>##2</##1>}%
- \gdef\doXMLunknownSI##1##2{<##1>}}
-
-\gdef\unmapXMLdata#1#2% todo: singular, evt ##2 space ervoor en ##1##2
- {\bgroup
- \revertXMLremapping
- \expandXMLremapping % now we can roll back
- \setnormalXMLhandler % using the normal parser
- \resetXMLmapping % and leaving the mapping namespace
- \xdef\unmappedXMLdata{#2}% recreate the original
- \enableXMLelements % enable normal handler
- \unmappedXMLdata % off we go ...
- \egroup}
-
-\egroup
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-mea.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-mea.mkii
deleted file mode 100644
index d56d6c54ba9..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-mea.mkii
+++ /dev/null
@@ -1,152 +0,0 @@
-% filtered from html files by Patrick Ion
-%
-% ISOAMSA Characters Extended
-%
-% Added Math Symbols: Arrow Relations
-
-\defineMMLentity angzarr E248 {unknown} angle with down zig-zag arrow
-\defineMMLentity cirmid E250 {unknown} circle, mid below
-\defineMMLentity cudarrl E23E {unknown} left, curved, down arrow
-\defineMMLentity cudarrr E400 {unknown} right, curved, down arrow
-\defineMMLentity cularr 21B6 {unknown} left curved arrow
-\defineMMLentity cularrp E24A {unknown} curved left arrow with plus
-\defineMMLentity curarr 21B7 {unknown} right curved arrow
-\defineMMLentity curarrm E249 {unknown} curved right arrow with minus
-\defineMMLentity Darr 21A1 {unknown} down two-headed arrow
-\defineMMLentity dArr 21D3 {\Downarrow} down double arrow
-\defineMMLentity ddarr 21CA {unknown} two down arrows
-\defineMMLentity DDotrahd E238 {unknown} right arrow with dotted stem
-\defineMMLentity dfisht E24C {unknown} down fish tail
-\defineMMLentity dHar E227 {unknown} down harpoon-left, down harpoon-right
-\defineMMLentity dharl 21C3 {unknown} down harpoon-left
-\defineMMLentity dharr 21C2 {unknown} down harpoon-rt
-\defineMMLentity duarr E216 {unknown} down arrow, up arrow
-\defineMMLentity duhar E217 {unknown} down harp, up harp
-\defineMMLentity dzigrarr 21DD {unknown} right long zig-zag arrow
-\defineMMLentity erarr E236 {unknown} equal, right arrow below
-\defineMMLentity hArr 21D4 {\Leftrightarrow} left and right double arrow
-\defineMMLentity harr 2194 {\leftrightarrow} left and right arrow
-\defineMMLentity harrcir E240 {unknown} left and right arrow with a circle
-\defineMMLentity harrw 21AD {unknown} left and right arr-wavy
-\defineMMLentity hoarr E243 {unknown} horizontal open arrow
-\defineMMLentity imof 22B7 {unknown} image of
-\defineMMLentity lAarr 21DA {unknown} left triple arrow
-\defineMMLentity Larr 219E {unknown} twoheadleftarrow
-\defineMMLentity larrbfs E220 {unknown} left arrow-bar, filled square
-\defineMMLentity larrfs E222 {unknown} left arrow, filled square
-\defineMMLentity larrhk 21A9 {unknown} left arrow-hooked
-\defineMMLentity larrlp 21AB {unknown} left arrow-looped
-\defineMMLentity larrpl E23F {unknown} left arrow, plus
-\defineMMLentity larrsim E24E {unknown} left arrow, similar
-\defineMMLentity larrtl 21A2 {unknown} left arrow-tailed
-\defineMMLentity lAtail E23D {unknown} left double arrow-tail
-\defineMMLentity latail E23C {unknown} left arrow-tail
-\defineMMLentity lBarr E206 {unknown} left doubly broken arrow
-\defineMMLentity lbarr E402 {unknown} left broken arrow
-\defineMMLentity ldca E21A {unknown} left down curved arrow
-\defineMMLentity ldrdhar E22C {unknown} left harpoon-down over right harpoon-down
-\defineMMLentity ldrushar E228 {unknown} left-down-right-up harpoon
-\defineMMLentity ldsh 21B2 {unknown} left down angled arrow
-\defineMMLentity lfisht E214 {unknown} left fish tail
-\defineMMLentity lHar E225 {unknown} left harpoon-up over left harpoon-down
-\defineMMLentity lhard 21BD {\leftharpoondown} left harpoon-down
-\defineMMLentity lharu 21BC {\leftharpoonup} left harpoon-up
-\defineMMLentity lharul E22E {unknown} left harpoon-up over long dash
-\defineMMLentity llarr 21C7 {unknown} two left arrows
-\defineMMLentity llhard E231 {unknown} left harpoon-down below long dash
-\defineMMLentity loarr E242 {unknown} left open arrow
-\defineMMLentity lrarr 21C6 {unknown} left arr over right arr
-\defineMMLentity lrhar 21CB {unknown} left harp over r
-\defineMMLentity lrhard E22F {unknown} right harpoon-down below long dash
-\defineMMLentity lsh 21B0 {\Lsh} Lsh
-\defineMMLentity lurdshar E229 {unknown} left-up-right-down harpoon
-\defineMMLentity luruhar E22B {unknown} left harpoon-up over right harpoon-up
-\defineMMLentity Map E212 {unknown} twoheaded mapsto
-\defineMMLentity map 21A6 {\mapsto} mapsto
-\defineMMLentity midcir E20F {unknown} mid, circle below
-\defineMMLentity mumap 22B8 {unknown} multimap
-\defineMMLentity nearhk E20D {unknown} NE arrow-hooked
-\defineMMLentity neArr 21D7 {unknown} NE pointing double arrow
-\defineMMLentity nearr 2197 {\nearrow} NE pointing arrow
-\defineMMLentity nesear E20E {unknown} NE \& SE arrows
-\defineMMLentity nhArr 21CE {unknown} not left and right double arr
-\defineMMLentity nharr 21AE {unknown} not left and right arrow
-\defineMMLentity nlArr 21CD {unknown} not implied by
-\defineMMLentity nlarr 219A {unknown} not left arrow
-\defineMMLentity nrArr 21CF {unknown} not implies
-\defineMMLentity nrarr 219B {unknown} not right arrow
-\defineMMLentity nrarrc E21D {unknown} not right arrow-curved
-\defineMMLentity nrarrw E21B {unknown} not right arrow-wavy
-\defineMMLentity nvhArr* 21CE {unknown} not, vert, left and right double arrow
-\defineMMLentity nvlArr 21CD {unknown} not, vert, left double arrow
-\defineMMLentity nvrArr 21CF {unknown} not, vert, right double arrow
-\defineMMLentity nwarhk E20C {unknown} NW arrow-hooked
-\defineMMLentity nwArr 21D6 {unknown} NW pointing double arrow
-\defineMMLentity nwarr 2196 {\nwarrow} NW pointing arrow
-\defineMMLentity nwnear E211 {unknown} NW \& NE arrows
-\defineMMLentity olarr 21BA {unknown} left arr in circle
-\defineMMLentity orarr 21BB {unknown} right arr in circle
-\defineMMLentity origof 22B6 {unknown} original of
-\defineMMLentity rAarr 21DB {unknown} right triple arrow
-\defineMMLentity Rarr 21A0 {unknown} twoheadrightarrow
-\defineMMLentity rarrap E235 {unknown} approximate, right arrow above
-\defineMMLentity rarrbfs E221 {unknown} right arrow-bar, filled square
-\defineMMLentity rarrc E21C {unknown} right arrow-curved
-\defineMMLentity rarrfs E223 {unknown} right arrow, filled square
-\defineMMLentity rarrhk 21AA {\hookrightarrow} right arrow-hooked
-\defineMMLentity rarrlp 21AC {unknown} right arrow-looped
-\defineMMLentity rarrpl E21E {unknown} right arrow, plus
-\defineMMLentity rarrsim E24D {unknown} right arrow, similar
-\defineMMLentity Rarrtl E239 {unknown} right two-headed arrow with tail
-\defineMMLentity rarrtl 21A3 {unknown} right arrow-tailed
-\defineMMLentity rarrw 219D {unknown} right arrow-wavy
-\defineMMLentity rAtail E23B {unknown} right double arrow-tail
-\defineMMLentity ratail 21A3 {unknown} right arrow-tail
-\defineMMLentity RBarr E209 {unknown} twoheaded right broken arrow
-\defineMMLentity rBarr E207 {unknown} right doubly broken arrow
-\defineMMLentity rbarr E405 {unknown} right broken arrow
-\defineMMLentity rdca E219 {unknown} right down curved arrow
-\defineMMLentity rdldhar E22D {unknown} right harpoon-down over left harpoon-down
-\defineMMLentity rdsh 21B3 {unknown} right down angled arrow
-\defineMMLentity rfisht E215 {unknown} right fish tail
-\defineMMLentity rHar E224 {unknown} right harpoon-up over right harpoon-down
-\defineMMLentity rhard 21C1 {\rightharpoondown} right harpoon-down
-\defineMMLentity rharu 21C0 {\rightharpoonup} right harpoon-up
-\defineMMLentity rharul E230 {unknown} right harpoon-up over long dash
-\defineMMLentity rlarr 21C4 {unknown} right arr over left arr
-\defineMMLentity rlhar 21CC {unknown} right harp over l
-\defineMMLentity roarr E241 {unknown} right open arrow
-\defineMMLentity rrarr 21C9 {unknown} two right arrows
-\defineMMLentity rsh 21B1 {\Rsh} Rsh
-\defineMMLentity ruluhar E22A {unknown} right harpoon-up over left harpoon-up
-\defineMMLentity searhk E20B {unknown} SE arrow-hooked
-\defineMMLentity seArr 21D8 {unknown} SE pointing double arrow
-\defineMMLentity searr 2198 {\searrow} SE pointing arrow
-\defineMMLentity seswar E406 {unknown} SE \& SW arrows
-\defineMMLentity simrarr E234 {unknown} similar, right arrow below
-\defineMMLentity slarr E233 {unknown} short left arrow
-\defineMMLentity srarr E232 {unknown} short right arrow
-\defineMMLentity swarhk E20A {unknown} SW arrow-hooked
-\defineMMLentity swArr 21D9 {unknown} SW pointing double arrow
-\defineMMLentity swarr 2199 {\swarrow} SW pointing arrow
-\defineMMLentity swnwar E210 {unknown} SW \& NW arrows
-\defineMMLentity Uarr 219F {unknown} up two-headed arrow
-\defineMMLentity uArr 21D1 {\Uparrow} up double arrow
-\defineMMLentity Uarrocir E237 {unknown} up two-headed arrow above circle
-\defineMMLentity udarr 21C5 {unknown} up arrow, down arrow
-\defineMMLentity udhar E218 {unknown} up harp, down harp
-\defineMMLentity ufisht E24B {unknown} up fish tail
-\defineMMLentity uHar E226 {unknown} up harpoon-left, up harpoon-right
-\defineMMLentity uharl 21BF {unknown} up harpoon-left
-\defineMMLentity uharr 21BE {unknown} up harp-r
-\defineMMLentity uuarr 21C8 {unknown} two up arrows
-\defineMMLentity vArr 21D5 {\Updownarrow} up \& down double arrow
-\defineMMLentity varr 2195 {\updownarrow} up \& down arrow
-\defineMMLentity xhArr E202 {unknown} long left and right double arr
-\defineMMLentity xharr E203 {unknown} long left and right arr
-\defineMMLentity xlArr E200 {unknown} long left double arrow
-\defineMMLentity xlarr E201 {unknown} long left arrow
-\defineMMLentity xmap E208 {unknown} longmapsto
-\defineMMLentity xrArr E204 {unknown} long right double arr
-\defineMMLentity xrarr E205 {unknown} long right arrow
-\defineMMLentity zigrarr E244 {unknown} right zig-zag arrow
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-meb.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-meb.mkii
deleted file mode 100644
index ba370cadf94..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-meb.mkii
+++ /dev/null
@@ -1,124 +0,0 @@
-% filtered from html files by Patrick Ion
-%
-% ISOAMSB Characters Extended
-%
-% Added Math Symbols: Binary Operators
-
-\defineMMLentity ac E207 {unknown} most positive
-\defineMMLentity acE E290 {unknown} most positive, two lines below
-\defineMMLentity amalg E251 {\amalg} amalgamation or coproduct
-\defineMMLentity barvee 22BD {unknown} bar, vee
-\defineMMLentity Barwed 2306 {unknown} logical and, double bar above
-\defineMMLentity barwed 22BC {unknown} logical and, bar above
-\defineMMLentity bsolb E280 {unknown} reverse solidus in square
-\defineMMLentity Cap 22D2 {unknown} double intersection
-\defineMMLentity capand E281 {unknown} intersection, and
-\defineMMLentity capbrcup E271 {unknown} intersection, bar, union
-\defineMMLentity capcap E273 {unknown} intersection, intersection, joined
-\defineMMLentity capcup E26F {unknown} intersection above union
-\defineMMLentity capdot E261 {unknown} intersection, with dot
-\defineMMLentity caps E275 {unknown} intersection, serifs
-\defineMMLentity ccaps E279 {unknown} closed intersection, serifs
-\defineMMLentity ccups E278 {unknown} closed union, serifs
-\defineMMLentity ccupssm E27A {unknown} closed union, serifs, smash product
-\defineMMLentity coprod 2210 {\coprod} coproduct operator
-\defineMMLentity Cup 22D3 {unknown} double union
-\defineMMLentity cupbrcap E270 {unknown} union, bar, intersection
-\defineMMLentity cupcap E26E {unknown} union above intersection
-\defineMMLentity cupcup E272 {unknown} union, union, joined
-\defineMMLentity cupdot 228D {unknown} union, with dot
-\defineMMLentity cupor E282 {unknown} union, or
-\defineMMLentity cups E274 {unknown} union, serifs
-\defineMMLentity cuvee 22CE {unknown} curly logical or
-\defineMMLentity cuwed 22CF {unknown} curly logical and
-\defineMMLentity Dagger 2021 {\ddagger} double dagger relation
-\defineMMLentity dagger 2020 {\dagger} dagger relation
-\defineMMLentity diam 22C4 {unknown} open diamond
-\defineMMLentity divonx 22C7 {unknown} division on times
-\defineMMLentity eplus E268 {unknown} equal, plus
-\defineMMLentity hercon 22B9 {unknown} hermitian conjugate matrix
-\defineMMLentity intcal 22BA {\intercal} intercal
-\defineMMLentity iprod E259 {unknown} interior product
-\defineMMLentity loplus E25C {unknown} plus sign in left half circle
-\defineMMLentity lotimes E25E {unknown} multiply sign in left half circle
-\defineMMLentity lthree 22CB {unknown} leftthreetimes
-\defineMMLentity ltimes 22C9 {unknown} times sign, left closed
-\defineMMLentity midast 2217 {\ast} centered asterisk
-\defineMMLentity minusb 229F {unknown} minus sign in box
-\defineMMLentity minusd 2238 {unknown} minus sign, dot above
-\defineMMLentity minusdu E25B {unknown} minus sign, dot below
-\defineMMLentity ncap E284 {unknown} bar, intersection
-\defineMMLentity ncup E283 {unknown} bar, union
-\defineMMLentity oast 229B {unknown} asterisk in circle
-\defineMMLentity ocir 229A {unknown} small circle in circle
-\defineMMLentity odash 229D {unknown} hyphen in circle
-\defineMMLentity odiv E285 {unknown} divide in circle
-\defineMMLentity odot 2299 {\odot} middle dot in circle
-\defineMMLentity odsold E286 {unknown} dot, solidus, dot in circle
-\defineMMLentity ofcir E287 {unknown} filled circle in circle
-\defineMMLentity ogt E289 {unknown} greater-than in circle
-\defineMMLentity ohbar E260 {unknown} circle with horizontal bar
-\defineMMLentity olcir E409 {unknown} large circle in circle
-\defineMMLentity olt E288 {unknown} less-than in circle
-\defineMMLentity omid E40A {unknown} vertical bar in circle
-\defineMMLentity ominus 2296 {\ominus} minus sign in circle
-\defineMMLentity opar E28A {unknown} parallel in circle
-\defineMMLentity operp E28B {unknown} perpendicular in circle
-\defineMMLentity oplus 2295 {\oplus} plus sign in circle
-\defineMMLentity osol 2298 {unknown} solidus in circle
-\defineMMLentity Otimes E28C {unknown} multiply sign in double circle
-\defineMMLentity otimes 2297 {\otimes} multiply sign in circle
-\defineMMLentity otimesas E28D {unknown} multiply sign in circle, circumflex accent
-\defineMMLentity ovbar E40B {unknown} circle with vertical bar
-\defineMMLentity plusacir E26A {unknown} plus, circumflex accent above
-\defineMMLentity plusb 229E {unknown} plus sign in box
-\defineMMLentity pluscir E266 {unknown} plus, small circle above
-\defineMMLentity plusdo 2214 {unknown} plus sign, dot above
-\defineMMLentity plusdu E25A {unknown} plus sign, dot below
-\defineMMLentity pluse E267 {unknown} plus, equals
-\defineMMLentity plussim E26C {unknown} plus, similar below
-\defineMMLentity plustwo E269 {unknown} plus, two; Nim-addition
-\defineMMLentity race E40C {unknown} reverse most positive, line below
-\defineMMLentity roplus E25D {unknown} plus sign in right half circle
-\defineMMLentity rotimes E40D {unknown} multiply sign in right half circle
-\defineMMLentity rthree 22CC {unknown} rightthreetimes
-\defineMMLentity rtimes 22CA {unknown} times sign, right closed
-\defineMMLentity sdot 22C5 {\cdot} small middle dot
-\defineMMLentity sdotb 22A1 {unknown} small dot in box
-\defineMMLentity setmn 2216 {unknown} reverse solidus
-\defineMMLentity simplus E26B {unknown} plus, similar above
-\defineMMLentity smashp E264 {unknown} smash product
-\defineMMLentity solb E27F {unknown} solidus in square
-\defineMMLentity sqcap 2293 {\sqcap} square intersection
-\defineMMLentity sqcaps E277 {unknown} square intersection, serifs
-\defineMMLentity sqcup 2294 {\sqcup} square union
-\defineMMLentity sqcups E276 {unknown} square union, serifs
-\defineMMLentity ssetmn E844 {unknown} sm reverse solidus
-\defineMMLentity sstarf 22C6 {\star} small star, filled, low
-\defineMMLentity subdot E262 {unknown} subset, with dot
-\defineMMLentity sum 2211 {\sum} summation operator
-\defineMMLentity supdot E263 {unknown} superset, with dot
-\defineMMLentity timesb 22A0 {unknown} multiply sign in box
-\defineMMLentity timesbar E28E {unknown} multiply sign, bar below
-\defineMMLentity timesd E26D {unknown} times, dot
-\defineMMLentity tridot 25EC {unknown} dot in triangle
-\defineMMLentity triminus E27C {unknown} minus in triangle
-\defineMMLentity triplus E27B {unknown} plus in triangle
-\defineMMLentity trisb E27E {unknown} triangle, serifs at bottom
-\defineMMLentity tritime E27D {unknown} multiply in triangle
-\defineMMLentity uplus 228E {\uplus} plus sign in union
-\defineMMLentity veebar 22BB {unknown} logical or, bar below
-\defineMMLentity wedbar E265 {unknown} wedge, bar below
-\defineMMLentity wreath 2240 {unknown} wreath product
-\defineMMLentity xcap 22C2 {\bigcap} intersection operator
-\defineMMLentity xcirc 25CB {\bigcirc} large circle
-\defineMMLentity xcup 22C3 {\bigcup} union operator
-\defineMMLentity xdtri 25BD {\bigtriangledown} big down triangle, open
-\defineMMLentity xodot 2299 {\bigodot} circle dot operator
-\defineMMLentity xoplus 2295 {\bigoplus} circle plus operator
-\defineMMLentity xotime 2297 {\bigotimes} circle times operator
-\defineMMLentity xsqcup 2294 {\bigsqcup} square union operator
-\defineMMLentity xuplus 228E {\biguplus} biguplus
-\defineMMLentity xutri 25B3 {\bigtriangleup} big up triangle, open
-\defineMMLentity xvee 22C1 {\bigvee} logical and operator
-\defineMMLentity xwedge 22C0 {\bigwedge} logical or operator
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-mec.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-mec.mkii
deleted file mode 100644
index 9e941897c61..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-mec.mkii
+++ /dev/null
@@ -1,28 +0,0 @@
-% filtered from html files by Patrick Ion
-%
-% ISOAMSC Characters Extended
-%
-% Added Math Symbols: Delimiters
-
-\defineMMLentity dlcorn 231E {unknown} lower left corner
-\defineMMLentity drcorn 231F {unknown} lower right corner
-\defineMMLentity gtlPar E296 {unknown} double left parenthesis, greater
-\defineMMLentity langd E297 {unknown} left angle, dot
-\defineMMLentity lbrke E299 {unknown} left bracket, equal
-\defineMMLentity lbrksld E29D {unknown} left bracket, solidus bottom corner
-\defineMMLentity lbrkslu E29B {unknown} left bracket, solidus top corner
-\defineMMLentity lceil 2308 {\lceil} left ceiling
-\defineMMLentity lfloor 230A {\lfloor} left floor
-\defineMMLentity lmoust E294 {\lmoustache} left moustache
-\defineMMLentity lparlt E292 {unknown} left parenthesis, lt
-\defineMMLentity ltrPar E295 {unknown} double right parenthesis, less
-\defineMMLentity rangd E298 {unknown} right angle, dot
-\defineMMLentity rbrke E29A {unknown} right bracket, equal
-\defineMMLentity rbrksld E29C {unknown} right bracket, solidus bottom corner
-\defineMMLentity rbrkslu E29E {unknown} right bracket, solidus top corner
-\defineMMLentity rceil 2309 {\rceil} right ceiling
-\defineMMLentity rfloor 230B {\rfloor} right floor
-\defineMMLentity rmoust E293 {\rmoustache} right moustache
-\defineMMLentity rpargt E291 {unknown} right paren, gt
-\defineMMLentity ulcorn 231C {unknown} upper left corner
-\defineMMLentity urcorn 231D {unknown} upper right corner
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-meh.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-meh.mkii
deleted file mode 100644
index 1636f2a2b9d..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-meh.mkii
+++ /dev/null
@@ -1,166 +0,0 @@
-% filtered from html files by Patrick Ion
-%
-% ISOTECH Characters Extended
-%
-% General Technical
-
-\defineMMLentity acd E3A6 {unknown} ac current
-\defineMMLentity aleph 2135 {\aleph} aleph, Hebrew
-\defineMMLentity And E374 {unknown} double logical and
-\defineMMLentity and 2227 {\wedge} logical and
-\defineMMLentity andand E36E {unknown} two logical and
-\defineMMLentity andd E394 {unknown} and, horizontal dash
-\defineMMLentity andslope E50A {unknown} sloping large and
-\defineMMLentity andv E391 {unknown} and with middle stem
-\defineMMLentity angrt 221F {unknown} right (90 degree) angle
-\defineMMLentity angsph 2222 {unknown} angle-spherical
-\defineMMLentity angst 212B {\Angstrom} Angstrom capital A, ring
-\defineMMLentity ap 2248 {\approx} approximate
-\defineMMLentity apacir E38C {unknown} approximate, circumflex accent
-\defineMMLentity awconint 2233 {unknown} contour integral, anti-clockwise
-\defineMMLentity awint E39B {unknown} anti clock-wise integration
-\defineMMLentity becaus 2235 {unknown} because
-\defineMMLentity bernou 212C {unknown} Bernoulli function (script capital B)
-\defineMMLentity bne E388 {unknown} reverse not equal
-\defineMMLentity bnequiv E387 {unknown} reverse not equivalent
-\defineMMLentity bNot E3AD {unknown} reverse not with two horizontal strokes
-\defineMMLentity bnot 2310 {unknown} reverse not
-\defineMMLentity bottom 22A5 {unknown} bottom
-\defineMMLentity cap 2229 {\cap} intersection
-\defineMMLentity Cconint 2230 {unknown} triple contour integral operator
-\defineMMLentity cirfnint E395 {unknown} circulation function
-\defineMMLentity compfn 2218 {\circ} composite function (small circle)
-\defineMMLentity cong 2245 {\cong} congruent with
-\defineMMLentity Conint 222F {unknown} double contour integral operator
-\defineMMLentity conint 222E {\oint} contour integral operator
-\defineMMLentity ctdot 22EF {\cdots} three dots, centered
-\defineMMLentity cup 222A {\cup} union or logical sum
-\defineMMLentity cwconint 2232 {unknown} contour integral, clockwise
-\defineMMLentity cwint 2231 {unknown} clockwise integral
-\defineMMLentity cylcty 232D {unknown} cylindricity
-\defineMMLentity disin E3A0 {unknown} set membership, long horizontal stroke
-\defineMMLentity Dot 0308 {unknown} dieresis or umlaut mark
-\defineMMLentity DotDot 20DC {unknown} four dots above
-\defineMMLentity dsol E3A9 {unknown} solidus, bar above
-\defineMMLentity dtdot 22F1 {\ddots} three dots, descending
-\defineMMLentity dwangle E3AA {unknown} large downward pointing angle
-\defineMMLentity elinters E3A7 {unknown} electrical intersection
-\defineMMLentity epar 22D5 {unknown} parallel, equal; equal or parallel
-\defineMMLentity eparsl E384 {unknown} parallel, slanted, equal; homothetically co
-\defineMMLentity equiv 2261 {\equiv} identical with
-\defineMMLentity eqvparsl E386 {unknown} equivalent, equal; congruent and parallel
-\defineMMLentity exist 2203 {\exists} at least one exists
-\defineMMLentity fltns E381 {unknown} flatness
-\defineMMLentity forall 2200 {\forall} for all
-\defineMMLentity fpartint E396 {unknown} finite part integral
-\defineMMLentity ge 2265 {\geq} greater-than-or-equal
-\defineMMLentity hamilt 210B {unknown} Hamiltonian (script capital H)
-\defineMMLentity iff E365 {unknown} if and only if
-\defineMMLentity iinfin E372 {unknown} infinity sign, incomplete
-\defineMMLentity imped E50B {unknown} impedance
-\defineMMLentity infin 221E {\infty} infinity
-\defineMMLentity infintie E50C {unknown} tie, infinity
-\defineMMLentity Int 222C {unknown} double integral operator
-\defineMMLentity int 222B {\int} integral operator
-\defineMMLentity intlarhk E39A {unknown} integral, left arrow with hook
-\defineMMLentity isin 220A {\in} set membership
-\defineMMLentity isindot E39C {unknown} set membership, dot above
-\defineMMLentity isinE E39E {unknown} set membership, two horizontal strokes
-\defineMMLentity isins E3A4 {unknown} set membership, vertical bar on horizontal
-\defineMMLentity isinsv E3A2 {unknown} large set membership, vertical bar on horiz
-\defineMMLentity isinv 2208 {unknown} set membership, variant
-\defineMMLentity lagran 2112 {unknown} Lagrangian (script capital L)
-\defineMMLentity Lang 300A {unknown} left angle bracket, double
-\defineMMLentity lang 3008 {\langle} left angle bracket
-\defineMMLentity lArr 21D0 {\Leftarrow} is implied by
-\defineMMLentity lbbrk 3014 {unknown} left broken bracket
-\defineMMLentity le 2264 {\leq} less-than-or-equal
-\defineMMLentity loang 3018 {unknown} left open angular bracket
-\defineMMLentity lobrk 301A {unknown} left open bracket
-\defineMMLentity lopar E379 {unknown} left open parenthesis
-\defineMMLentity lowast 2217 {unknown} low asterisk
-\defineMMLentity minus 2212 {unknown} minus sign
-\defineMMLentity mnplus 2213 {\mp} minus-or-plus sign
-\defineMMLentity nabla 2207 {\nabla} del, Hamilton operator
-\defineMMLentity ne 2260 {\ne} not equal
-\defineMMLentity nedot E38A {unknown} not equal, dot
-\defineMMLentity nhpar E38D {unknown} not, horizontal, parallel
-\defineMMLentity ni 220D {unknown} contains
-\defineMMLentity nis E3A5 {unknown} contains, vertical bar on horizontal stroke
-\defineMMLentity nisd E3A1 {unknown} contains, long horizontal stroke
-\defineMMLentity niv 220B {\ni} contains, variant
-\defineMMLentity Not E3AC {unknown} not with two horizontal strokes
-\defineMMLentity notin 2209 {\notin} negated set membership
-\defineMMLentity notindot E39D {unknown} negated set membership, dot above
-\defineMMLentity notinE E50D {unknown} negated set membership, two horizontal strokes
-\defineMMLentity notinva E370 {unknown} negated set membership, variant
-\defineMMLentity notinvb E37B {unknown} negated set membership, variant
-\defineMMLentity notinvc E37C {unknown} negated set membership, variant
-\defineMMLentity notni 220C {unknown} negated contains
-\defineMMLentity notniva 220C {unknown} negated contains, variant
-\defineMMLentity notnivb E37D {unknown} contains, variant
-\defineMMLentity notnivc E37E {unknown} contains, variant
-\defineMMLentity nparsl E389 {unknown} not parallel, slanted
-\defineMMLentity npart E390 {unknown} not partial differential
-\defineMMLentity npolint E399 {unknown} line integration, not including the pole
-\defineMMLentity nvinfin E38E {unknown} not, vert, infinity
-\defineMMLentity olcross E3A8 {unknown} circle, cross
-\defineMMLentity Or E375 {unknown} double logical or
-\defineMMLentity or 2228 {\vee} logical or
-\defineMMLentity ord E393 {unknown} or, horizontal dash
-\defineMMLentity order 2134 {unknown} order of (script small o)
-\defineMMLentity oror E50E {unknown} two logical or
-\defineMMLentity orslope E3AE {unknown} sloping large or
-\defineMMLentity orv E392 {unknown} or with middle stem
-\defineMMLentity par 2225 {\parallel} parallel
-\defineMMLentity parsl E382 {unknown} parallel, slanted
-\defineMMLentity part 2202 {\partial} partial differential
-\defineMMLentity permil 2030 {unknown} per thousand
-\defineMMLentity perp 22A5 {\perp} perpendicular
-\defineMMLentity pertenk 2031 {unknown} per 10 thousand
-\defineMMLentity phmmat 2133 {unknown} physics M-matrix (script capital M)
-\defineMMLentity pointint E376 {unknown} integral around a point operator
-\defineMMLentity Prime 2033 {unknown} double prime or second
-\defineMMLentity prime 2032 {\prime} prime or minute
-\defineMMLentity profalar 232E {unknown} all-around profile
-\defineMMLentity profline 2312 {unknown} profile of a line
-\defineMMLentity profsurf 2313 {unknown} profile of a surface
-\defineMMLentity prop 221D {\propto} is proportional to
-\defineMMLentity qint E378 {unknown} quadruple integral operator
-\defineMMLentity qprime E371 {unknown} quadruple prime
-\defineMMLentity quatint E377 {unknown} quaternion integral operator
-\defineMMLentity radic 221A {\surd} radical
-\defineMMLentity Rang 300B {unknown} right angle bracket, double
-\defineMMLentity rang 3009 {\rangle} right angle bracket
-\defineMMLentity rArr 21D2 {\Rightarrow} implies
-\defineMMLentity rbbrk 3015 {unknown} right broken bracket
-\defineMMLentity roang 3019 {unknown} right open angular bracket
-\defineMMLentity robrk 301B {unknown} right open bracket
-\defineMMLentity ropar E37A {unknown} right open parenthesis
-\defineMMLentity rppolint E397 {unknown} line integration, rectangular path around pole
-\defineMMLentity scpolint E398 {unknown} line integration, semi-circular path around pole
-\defineMMLentity sim 223C {\sim} similar
-\defineMMLentity simdot E38B {unknown} similar, dot
-\defineMMLentity sime 2243 {\simeq} similar, equals
-\defineMMLentity smeparsl E385 {unknown} similar, parallel, slanted, equal
-\defineMMLentity square 25A1 {\square} square
-\defineMMLentity squarf 25A0 {unknown} square, filled
-\defineMMLentity strns E380 {unknown} straightness
-\defineMMLentity sub 2282 {\subset} subset or is implied by
-\defineMMLentity sube 2286 {\subseteq} subset, equals
-\defineMMLentity sup 2283 {\supset} superset or implies
-\defineMMLentity supe 2287 {\supseteq} superset, equals
-\defineMMLentity tdot 20DB {unknown} three dots above
-\defineMMLentity there4 2234 {unknown} therefore
-\defineMMLentity tint 222D {unknown} triple integral operator
-\defineMMLentity top 22A4 {\top} top
-\defineMMLentity topbot 2336 {unknown} top and bottom
-\defineMMLentity topcir E383 {unknown} top, circle below
-\defineMMLentity tprime 2034 {unknown} triple prime
-\defineMMLentity utdot 22F0 {unknown} three dots, ascending
-\defineMMLentity uwangle E3AB {unknown} large upward pointing angle
-\defineMMLentity vangrt 22BE {unknown} right angle, variant (with arc)
-\defineMMLentity veeeq 225A {unknown} logical or, equals
-\defineMMLentity Verbar 2016 {\Vert} double vertical bar
-\defineMMLentity wedgeq 2259 {unknown} corresponds to (wedge, equals)
-\defineMMLentity xnis E3A3 {unknown} large contains, vertical bar on horizontal stroke
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-men.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-men.mkii
deleted file mode 100644
index d548c83940e..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-men.mkii
+++ /dev/null
@@ -1,98 +0,0 @@
-% filtered from html files by Patrick Ion
-%
-% ISOAMSN Characters Extended
-%
-% Added Math Symbols: Negated Relations
-
-\defineMMLentity gnap E411 {unknown} greater, not approximate
-\defineMMLentity gnE 2269 {unknown} greater, not double equals
-\defineMMLentity gne 2269 {unknown} greater, not equals
-\defineMMLentity gnsim 22E7 {unknown} greater, not similar
-\defineMMLentity gvnE E2A1 {unknown} gt, vert, not double equals
-\defineMMLentity lnap E2A2 {unknown} less, not approximate
-\defineMMLentity lnE 2268 {unknown} less, not double equals
-\defineMMLentity lne 2268 {unknown} less, not equals
-\defineMMLentity lnsim 22E6 {unknown} less, not similar
-\defineMMLentity lvnE E2A4 {unknown} less, vert, not double equals
-\defineMMLentity nap 2249 {unknown} not approximate
-\defineMMLentity napE E2C7 {unknown} not approximately equal or equal to
-\defineMMLentity napid E2BC {unknown} not approximately identical to
-\defineMMLentity ncong 2247 {unknown} not congruent with
-\defineMMLentity ncongdot E2C5 {unknown} not congruent, dot
-\defineMMLentity nequiv 2262 {unknown} not identical with
-\defineMMLentity ngE 2271 {unknown} not greater, double equals
-\defineMMLentity nge E2A6 {unknown} not greater-than-or-equal
-\defineMMLentity nges 2271 {unknown} not gt-or-equals, slanted
-\defineMMLentity nGg E2CE {unknown} not triple greater than
-\defineMMLentity ngsim 2275 {unknown} not greater, similar
-\defineMMLentity nGt E2CA {unknown} not, vert, much greater than
-\defineMMLentity ngt 226F {unknown} not greater-than
-\defineMMLentity nGtv E2CC {unknown} not much greater than, variant
-\defineMMLentity nlE 2270 {unknown} not less, double equals
-\defineMMLentity nle E2A7 {unknown} not less-than-or-equal
-\defineMMLentity nles 2270 {unknown} not less-or-equals, slant
-\defineMMLentity nLl E2CD {unknown} not triple less than
-\defineMMLentity nlsim 2274 {unknown} not less, similar
-\defineMMLentity nLt E2C9 {unknown} not, vert, much less than
-\defineMMLentity nlt 226E {unknown} not less-than
-\defineMMLentity nltri 22EA {unknown} not left triangle
-\defineMMLentity nltrie 22EC {unknown} not left triangle, equals
-\defineMMLentity nLtv E2CB {unknown} not much less than, variant
-\defineMMLentity nmid 2224 {unknown} negated mid
-\defineMMLentity npar 2226 {unknown} not parallel
-\defineMMLentity npr 2280 {unknown} not precedes
-\defineMMLentity nprcue 22E0 {unknown} not curly precedes, equals
-\defineMMLentity npre E412 {unknown} not precedes, equals
-\defineMMLentity nrtri 22EB {unknown} not right triangle
-\defineMMLentity nrtrie 22ED {unknown} not right triangle, equals
-\defineMMLentity nsc 2281 {unknown} not succeeds
-\defineMMLentity nsccue 22E1 {unknown} not succeeds, curly equals
-\defineMMLentity nsce E413 {unknown} not succeeds, equals
-\defineMMLentity nsim 2241 {unknown} not similar
-\defineMMLentity nsime 2244 {unknown} not similar, equals
-\defineMMLentity nsmid E2AA {unknown} negated short mid
-\defineMMLentity nspar E2AB {unknown} not short par
-\defineMMLentity nsqsube 22E2 {unknown} not, square subset, equals
-\defineMMLentity nsqsupe 22E3 {unknown} not, square superset, equals
-\defineMMLentity nsub 2284 {unknown} not subset
-\defineMMLentity nsubE 2288 {unknown} not subset, double equals
-\defineMMLentity nsube 2288 {unknown} not subset, equals
-\defineMMLentity nsup 2285 {unknown} not superset
-\defineMMLentity nsupE 2289 {unknown} not superset, double equals
-\defineMMLentity nsupe 2289 {unknown} not superset, equals
-\defineMMLentity ntgl 2279 {unknown} not greater, less
-\defineMMLentity ntlg 2278 {unknown} not less, greater
-\defineMMLentity ntvgl 2279 {unknown} not, vert, greater, less
-\defineMMLentity ntvlg 2278 {unknown} not, vert, less, greater
-\defineMMLentity nvap E2C6 {unknown} not, vert, approximate
-\defineMMLentity nVDash 22AF {unknown} not double vert, double dash
-\defineMMLentity nVdash 22AE {unknown} not double vertical, dash
-\defineMMLentity nvDash 22AD {unknown} not vertical, double dash
-\defineMMLentity nvdash 22AC {unknown} not vertical, dash
-\defineMMLentity nvge 2271 {unknown} not, vert, greater-than-or-equal
-\defineMMLentity nvgt 226F {unknown} not, vert, greater-than
-\defineMMLentity nvle 2270 {unknown} not, vert, less-than-or-equal
-\defineMMLentity nvlt 226E {unknown} not, vert, less-than
-\defineMMLentity nvltrie E2D0 {unknown} not, vert, left triangle, equals
-\defineMMLentity nvrtrie E2CF {unknown} not, vert, right triangle, equals
-\defineMMLentity nvsim E415 {unknown} not, vert, similar
-\defineMMLentity parsim E2C8 {unknown} parallel, similar
-\defineMMLentity prnap 22E8 {unknown} precedes, not approx
-\defineMMLentity prnE E2B3 {unknown} precedes, not double equals
-\defineMMLentity prnsim 22E8 {unknown} precedes, not similar
-\defineMMLentity rnmid E2D1 {unknown} reverse nmid
-\defineMMLentity scnap 22E9 {unknown} succeeds, not approx
-\defineMMLentity scnE E2B5 {unknown} succeeds, not double equals
-\defineMMLentity scnsim 22E9 {unknown} succeeds, not similar
-\defineMMLentity simne 2246 {unknown} similar, not equals
-\defineMMLentity solbar E416 {unknown} solidus, bar through
-\defineMMLentity subnE 228A {unknown} subset, not double equals
-\defineMMLentity subne 228A {unknown} subset, not equals
-\defineMMLentity supnE 228B {unknown} superset, not double equals
-\defineMMLentity supne 228B {unknown} superset, not equals
-\defineMMLentity vnsub 2284 {unknown} not subset, variant
-\defineMMLentity vnsup 2285 {unknown} not superset, variant
-\defineMMLentity vsubnE E2B8 {unknown} subset not double equals, variant
-\defineMMLentity vsubne E2B9 {unknown} subset, not equals, variant
-\defineMMLentity vsupnE E2BB {unknown} super not double equals, variant
-\defineMMLentity vsupne E2BA {unknown} superset, not equals, variant
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-meo.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-meo.mkii
deleted file mode 100644
index f19f80fbe30..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-meo.mkii
+++ /dev/null
@@ -1,58 +0,0 @@
-% filtered from html files by Patrick Ion
-%
-% ISOAMSO Characters Extended
-%
-% Added Math Symbols: Ordinary
-
-\defineMMLentity ang 2220 {\angle} angle
-\defineMMLentity ange E2D6 {unknown} angle, equal
-\defineMMLentity angmsd 2221 {unknown} angle-measured
-\defineMMLentity angmsdaa E2D9 {unknown} angle-measured, arrow, up, right
-\defineMMLentity angmsdab E2DA {unknown} angle-measured, arrow, up, left
-\defineMMLentity angmsdac E2DB {unknown} angle-measured, arrow, down, right
-\defineMMLentity angmsdad E2DC {unknown} angle-measured, arrow, down, left
-\defineMMLentity angmsdae E2DD {unknown} angle-measured, arrow, right, up
-\defineMMLentity angmsdaf E2DE {unknown} angle-measured, arrow, left, up
-\defineMMLentity angmsdag E2DF {unknown} angle-measured, arrow, right, down
-\defineMMLentity angmsdah E2E0 {unknown} angle-measured, arrow, left, down
-\defineMMLentity angrtvb E418 {unknown} right angle-measured
-\defineMMLentity angrtvbd E2E1 {unknown} right angle-measured, dot
-\defineMMLentity bbrk E2EE {unknown} bottom square bracket
-\defineMMLentity bbrktbrk E419 {unknown} bottom above top square bracket
-\defineMMLentity bemptyv E41A {unknown} reversed circle, slash
-\defineMMLentity beth 2136 {unknown} beth, Hebrew
-\defineMMLentity boxbox E2E6 {unknown} two joined squares
-\defineMMLentity bprime 2035 {unknown} reverse prime
-\defineMMLentity bsemi E2ED {unknown} reverse semi-colon
-\defineMMLentity cemptyv E2E8 {unknown} circle, slash, small circle above
-\defineMMLentity cirE E41B {unknown} circle, two horizontal stroked to the right
-\defineMMLentity cirscir E41C {unknown} circle, small circle to the right
-\defineMMLentity comp 2201 {unknown} complement sign
-\defineMMLentity daleth 2138 {unknown} daleth, Hebrew
-\defineMMLentity demptyv E2E7 {unknown} circle, slash, bar above
-\defineMMLentity ell 2113 {\ell} cursive small l
-\defineMMLentity empty E2D3 {unknown} letter O slashed
-\defineMMLentity emptyv 2205 {unknown} circle, slash
-\defineMMLentity gimel 2137 {unknown} gimel, Hebrew
-\defineMMLentity iiota 2129 {unknown} inverted iota
-\defineMMLentity image 2111 {\Im} imaginary
-\defineMMLentity imath 0131 {\imath} small i, no dot
-\defineMMLentity jmath E2D4 {unknown} small j, no dot
-\defineMMLentity laemptyv E2EA {unknown} circle, slash, left arrow above
-\defineMMLentity lltri E2E5 {unknown} lower left triangle
-\defineMMLentity lrtri E2E3 {unknown} lower right triangle
-\defineMMLentity mho 2127 {unknown} conductance
-\defineMMLentity nang E2D8 {unknown} not, vert, angle
-\defineMMLentity nexist 2204 {unknown} negated exists
-\defineMMLentity oS E41D {unknown} capital S in circle
-\defineMMLentity plank E2D5 {unknown} Planck's over 2pi
-\defineMMLentity plankv 210F {unknown} variant Planck's over 2pi
-\defineMMLentity raemptyv E2E9 {unknown} circle, slash, right arrow above
-\defineMMLentity range E2D7 {unknown} reverse angle, equal
-\defineMMLentity real 211C {\Re} real
-\defineMMLentity tbrk E2EF {unknown} top square bracket
-\defineMMLentity trpezium E2EC {unknown} trapezium
-\defineMMLentity ultri E2E4 {unknown} upper left triangle
-\defineMMLentity urtri E2E2 {unknown} upper right triangle
-\defineMMLentity vzigzag E2EB {unknown} vertical zig-zag line
-\defineMMLentity weierp 2118 {\wp} Weierstrass p
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-mer.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-mer.mkii
deleted file mode 100644
index becff584a9c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-mer.mkii
+++ /dev/null
@@ -1,185 +0,0 @@
-% filtered from html files by Patrick Ion
-%
-% ISOAMSR Characters Extended
-%
-% Added Math Symbols: Relations
-
-\defineMMLentity apE E315 {unknown} approximately equal or equal to
-\defineMMLentity ape 224A {unknown} approximate, equals
-\defineMMLentity apid 224B {unknown} approximately identical to
-\defineMMLentity asymp 224D {\asymp} asymptotically equal to
-\defineMMLentity Barv E311 {unknown} vert, double bar (over)
-\defineMMLentity bcong 224C {unknown} reverse congruent
-\defineMMLentity bepsi E420 {unknown} such that
-\defineMMLentity bowtie 22C8 {unknown} bowtie
-\defineMMLentity bsim 223D {unknown} reverse similar
-\defineMMLentity bsime 22CD {unknown} reverse similar, equals
-\defineMMLentity bsolhsub E34D {unknown} reverse solidus, subset
-\defineMMLentity bump 224E {unknown} bumpy equals
-\defineMMLentity bumpe 224F {unknown} bumpy equals, equals
-\defineMMLentity cire 2257 {unknown} circle, equals
-\defineMMLentity Colon 2237 {unknown} two colons
-\defineMMLentity Colone E30E {unknown} double colon, equals
-\defineMMLentity colone 2254 {unknown} colon, equals
-\defineMMLentity congdot E314 {unknown} congruent, dot
-\defineMMLentity csub E351 {unknown} subset, closed
-\defineMMLentity csube E353 {unknown} subset, closed, equals
-\defineMMLentity csup E352 {unknown} superset, closed
-\defineMMLentity csupe E354 {unknown} superset, closed, equals
-\defineMMLentity cuepr 22DE {unknown} curly equals, precedes
-\defineMMLentity cuesc 22DF {unknown} curly equals, succeeds
-\defineMMLentity Dashv E30F {unknown} double dash, vertical
-\defineMMLentity dashv 22A3 {\dashv} dash, vertical
-\defineMMLentity easter 225B {unknown} equal, asterisk above
-\defineMMLentity ecir 2256 {unknown} circle on equals sign
-\defineMMLentity ecolon 2255 {unknown} equals, colon
-\defineMMLentity eDDot E309 {unknown} equal with four dots
-\defineMMLentity eDot 2251 {unknown} equals, even dots
-\defineMMLentity efDot 2252 {unknown} equals, falling dots
-\defineMMLentity eg E328 {unknown} equal-or-greater
-\defineMMLentity egs 22DD {unknown} equal-or-gtr, slanted
-\defineMMLentity egsdot E324 {unknown} equal-or-greater, slanted, dot inside
-\defineMMLentity el E327 {unknown} equal-or-less
-\defineMMLentity els 22DC {unknown} eq-or-less, slanted
-\defineMMLentity elsdot E323 {unknown} equal-or-less, slanted, dot inside
-\defineMMLentity equest 225F {unknown} equal with questionmark
-\defineMMLentity equivDD E318 {unknown} equivalent, four dots above
-\defineMMLentity erDot 2253 {unknown} equals, rising dots
-\defineMMLentity esdot 2250 {unknown} equals, single dot above
-\defineMMLentity Esim E317 {unknown} equal, similar
-\defineMMLentity esim 2242 {unknown} equals, similar
-\defineMMLentity fork 22D4 {unknown} pitchfork
-\defineMMLentity forkv E31B {unknown} fork, variant
-\defineMMLentity frown 2322 {\frown} down curve
-\defineMMLentity gap 2273 {unknown} greater, approximate
-\defineMMLentity gE 2267 {unknown} greater, double equals
-\defineMMLentity gEl 22DB {unknown} gt, double equals, less
-\defineMMLentity gel 22DB {unknown} greater, equals, less
-\defineMMLentity ges E421 {unknown} gt-or-equal, slanted
-\defineMMLentity gescc E358 {unknown} greater than, closed by curve, equal, slanted
-\defineMMLentity gesdot E31E {unknown} greater-than-or-equal, slanted, dot inside
-\defineMMLentity gesdoto E320 {unknown} greater-than-or-equal, slanted, dot above
-\defineMMLentity gesdotol E322 {unknown} greater-than-or-equal, slanted, dot above left
-\defineMMLentity gesl E32C {unknown} greater, equal, slanted, less
-\defineMMLentity gesles E332 {unknown} greater, equal, slanted, less, equal, slanted
-\defineMMLentity Gg 22D9 {unknown} triple gtr-than
-\defineMMLentity gl 2277 {unknown} greater, less
-\defineMMLentity gla E330 {unknown} greater, less, apart
-\defineMMLentity glE E32E {unknown} greater, less, equal
-\defineMMLentity glj E32F {unknown} greater, less, overlapping
-\defineMMLentity gsim 2273 {unknown} greater, similar
-\defineMMLentity gsime E334 {unknown} greater, similar, equal
-\defineMMLentity gsiml E336 {unknown} greater, similar, less
-\defineMMLentity Gt 226B {unknown} double greater-than sign
-\defineMMLentity gtcc E356 {unknown} greater than, closed by curve
-\defineMMLentity gtcir E326 {unknown} greater than, circle inside
-\defineMMLentity gtdot 22D7 {unknown} greater than, with dot
-\defineMMLentity gtquest E32A {unknown} greater than, questionmark above
-\defineMMLentity gtrarr E35F {unknown} greater than, right arrow
-\defineMMLentity homtht 223B {unknown} homothetic
-\defineMMLentity lap 2272 {unknown} less, approximate
-\defineMMLentity lat E33A {unknown} larger than
-\defineMMLentity late E33C {unknown} larger than or equal
-\defineMMLentity lates E33E {unknown} larger than or equal, slanted
-\defineMMLentity lE 2266 {unknown} less, double equals
-\defineMMLentity lEg 22DA {unknown} less, double equals, greater
-\defineMMLentity leg 22DA {unknown} less, equals, greater
-\defineMMLentity les E425 {unknown} less-than-or-equals, slant
-\defineMMLentity lescc E357 {unknown} less than, closed by curve, equal, slanted
-\defineMMLentity lesdot E31D {unknown} less-than-or-equal, slanted, dot inside
-\defineMMLentity lesdoto E31F {unknown} less-than-or-equal, slanted, dot above
-\defineMMLentity lesdotor E321 {unknown} less-than-or-equal, slanted, dot above right
-\defineMMLentity lesg E32B {unknown} less, equal, slanted, greater
-\defineMMLentity lesges E331 {unknown} less, equal, slanted, greater, equal, slanted
-\defineMMLentity lg 2276 {unknown} less, greater
-\defineMMLentity lgE E32D {unknown} less, greater, equal
-\defineMMLentity Ll 22D8 {unknown} triple less-than
-\defineMMLentity lsim 2272 {unknown} less, similar
-\defineMMLentity lsime E333 {unknown} less, similar, equal
-\defineMMLentity lsimg E335 {unknown} less, similar, greater
-\defineMMLentity Lt 226A {unknown} double less-than sign
-\defineMMLentity ltcc E355 {unknown} less than, closed by curve
-\defineMMLentity ltcir E325 {unknown} less than, circle inside
-\defineMMLentity ltdot 22D6 {unknown} less than, with dot
-\defineMMLentity ltlarr E35E {unknown} less than, left arrow
-\defineMMLentity ltquest E329 {unknown} less than, questionmark above
-\defineMMLentity ltrie 22B4 {unknown} left triangle, equals
-\defineMMLentity mcomma E31A {unknown} minus, comma above
-\defineMMLentity mDDot 223A {unknown} minus with four dots, geometric properties
-\defineMMLentity mid 2223 {\mid} mid
-\defineMMLentity mlcp E30A {unknown} transversal intersection
-\defineMMLentity models 22A7 {\models} models
-\defineMMLentity mstpos 223E {unknown} most positive
-\defineMMLentity Pr E35C {unknown} double precedes
-\defineMMLentity pr 227A {\prec} precedes
-\defineMMLentity prap 227E {unknown} precedes, approximate
-\defineMMLentity prcue 227C {unknown} precedes, curly equals
-\defineMMLentity prE 227C {unknown} precedes, double equals
-\defineMMLentity pre 227C {\preceq} precedes, equals
-\defineMMLentity prsim 227E {unknown} precedes, similar
-\defineMMLentity prurel 22B0 {unknown} element precedes under relation
-\defineMMLentity ratio 2236 {unknown} ratio
-\defineMMLentity rtrie 22B5 {unknown} right triangle, equals
-\defineMMLentity rtriltri E359 {unknown} right triangle above left triangle
-\defineMMLentity Sc E35D {unknown} double succeeds
-\defineMMLentity sc 227B {\succ} succeeds
-\defineMMLentity scap 227F {unknown} succeeds, approximate
-\defineMMLentity sccue 227D {unknown} succeeds, curly equals
-\defineMMLentity scE 227E {unknown} succeeds, double equals
-\defineMMLentity sce 227D {\succeq} succeeds, equals
-\defineMMLentity scsim 227F {unknown} succeeds, similar
-\defineMMLentity sdote E319 {unknown} equal, dot below
-\defineMMLentity sfrown E426 {unknown} small down curve
-\defineMMLentity simg E30C {unknown} similar, greater
-\defineMMLentity simgE E338 {unknown} similar, greater, equal
-\defineMMLentity siml E30B {unknown} similar, less
-\defineMMLentity simlE E337 {unknown} similar, less, equal
-\defineMMLentity smid E301 {unknown} shortmid
-\defineMMLentity smile 2323 {\smile} up curve
-\defineMMLentity smt E339 {unknown} smaller than
-\defineMMLentity smte E33B {unknown} smaller than or equal
-\defineMMLentity smtes E33D {unknown} smaller than or equal, slanted
-\defineMMLentity spar E302 {unknown} short parallel
-\defineMMLentity sqsub 228F {unknown} square subset
-\defineMMLentity sqsube 2291 {\sqsubseteq} square subset, equals
-\defineMMLentity sqsup 2290 {unknown} square superset
-\defineMMLentity sqsupe 2292 {\sqsupseteq} square superset, equals
-\defineMMLentity ssmile E303 {unknown} small up curve
-\defineMMLentity Sub 22D0 {unknown} double subset
-\defineMMLentity subE 2286 {unknown} subset, double equals
-\defineMMLentity subedot E34F {unknown} subset, equals, dot
-\defineMMLentity submult E343 {unknown} subset, multiply
-\defineMMLentity subplus E341 {unknown} subset, plus
-\defineMMLentity subrarr E33F {unknown} subset, right arrow
-\defineMMLentity subsim E345 {unknown} subset, similar
-\defineMMLentity subsub E349 {unknown} subset above subset
-\defineMMLentity subsup E347 {unknown} subset above superset
-\defineMMLentity Sup 22D1 {unknown} double superset
-\defineMMLentity supdsub E34C {unknown} superset, subset, dash joining them
-\defineMMLentity supE 2287 {unknown} superset, double equals
-\defineMMLentity supedot E350 {unknown} superset, equals, dot
-\defineMMLentity suphsol E34E {unknown} superset, solidus
-\defineMMLentity suphsub E34B {unknown} superset, subset
-\defineMMLentity suplarr E340 {unknown} superset, left arrow
-\defineMMLentity supmult E344 {unknown} superset, multiply
-\defineMMLentity supplus E342 {unknown} superset, plus
-\defineMMLentity supsim E346 {unknown} superset, similar
-\defineMMLentity supsub E348 {unknown} superset above subset
-\defineMMLentity supsup E34A {unknown} superset above superset
-\defineMMLentity thkap E306 {unknown} thick approximate
-\defineMMLentity thksim E429 {unknown} thick similar
-\defineMMLentity topfork E31C {unknown} fork with top
-\defineMMLentity trie 225C {unknown} triangle, equals
-\defineMMLentity twixt 226C {unknown} between
-\defineMMLentity Vbar E30D {unknown} double vert, bar (under)
-\defineMMLentity vBar E310 {unknown} vert, double bar (under)
-\defineMMLentity vBarv E312 {unknown} double bar, vert over and under
-\defineMMLentity VDash 22AB {unknown} double vert, double dash
-\defineMMLentity Vdash 22A9 {unknown} double vertical, dash
-\defineMMLentity vDash 22A8 {unknown} vertical, double dash
-\defineMMLentity vdash 22A2 {\vdash} vertical, dash
-\defineMMLentity Vdashl E313 {unknown} vertical, dash (long)
-\defineMMLentity vltri 22B2 {\triangleleft} left triangle, open, variant
-\defineMMLentity vprop 221D {unknown} proportional, variant
-\defineMMLentity vrtri 22B3 {\triangleright} right triangle, open, variant
-\defineMMLentity Vvdash 22AA {unknown} triple vertical, dash
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-mmc.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-mmc.mkii
deleted file mode 100644
index 9da7fef8411..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-mmc.mkii
+++ /dev/null
@@ -1,1265 +0,0 @@
-%D \module
-%D [ file=xtag-mmc,
-%D version=2000.12.20,
-%D title=\CONTEXT\ XML Macros,
-%D subtitle=Content MathML,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 / Content MathML}
-
-% this is the first, experimental, shabby implementation, as
-% always, the third will do -)
-
-% okay, now this is the second one, with a more kid based
-% approach, which we needed for proper nesting, but the
-% code is still too ugly
-
-\startXMLmapping[mml]
-
-\unprotect
-
-\def\MMLccomma{{,}}
-
-\def\getmmlarguments#1#2#3#4#5#6% {class} {defaults} mmlargs
- {\getXMLarguments{#1}{#2 #5}}%
-
-\def\doifMMLoperatorelse#1#2#3% temp hack
- {\pushmacro\xmlrent
- \let\xmlrent\firstofoneargument
- \edef\mmloperator{#1}%
- \@EA\unspaceargument\mmloperator\to\mmloperator
- \popmacro\xmlrent
- \doifXMLentityelse\mmloperator
- {\doifdefinedelse{doMMLcFN\mmloperator}{#2}{#3}}
- {#3}}
-
-\remapXMLsequence [ci] [CPA] \MMLcCI
-\remapXMLsequence [cn] [CPA] \MMLcCN
-\remapXMLsequence [csymbol] [CPA] \MMLcCSYMBOL
-
-\setupMMLappearance[polar][\c!alternative=\v!a] % a|b|c
-
-\def\MMLcpolar#1%
- {\doifdefinedelse{MMLcdopolar\@@MMLpolaralternative}
- {\getvalue{MMLcdopolar\@@MMLpolaralternative}{#1}}
- {#1}}
-
-\def\MMLcdopolara#1%
- {\def\MMLcsep{\MMLccomma}\getXMLentity{polar}\left(#1\right)}
-
-\def\MMLcdopolarb#1%
- {\def\MMLcsep##1\empty%
- {\getXMLentity{exponentiale}^{##1\mskip2mu\getXMLentity{imaginaryi}}}#1}
-
-\def\MMLcdopolarc#1%
- {\def\MMLcsep##1\empty%
- {\getXMLentity{exp}\left(##1\mskip2mu\getXMLentity{imaginaryi}\right)}#1}
-
-\def\MMLccartesian#1%
- {\def\MMLcsep{+}#1\getXMLentity{imaginaryi}}
-
-% float will be obsolete, an is replace by e-notation
-
-\setupMMLappearance[float][\c!symbol=\v!no] % \v!yes|dot
-
-\def\MMLcfloat#1%
- {\doifelse\@@MMLfloatsymbol\v!no
- {{\rm#1}} % make sure that e shows up ok
- {% we should ignore \entities !
- \beforesplitstring#1\at e\to\first
- \aftersplitstring #1\at e\to\last
- \ifx\first\empty #1\else
- \ifx\last \empty #1\else
- \first
- \doifelse\@@MMLfloatsymbol{dot}\cdot\times
- 10^{\last}%
- \fi\fi}}
-
-% we now have:
-
-\setupMMLappearance[enotation][\c!symbol=\v!no] % \v!yes|dot
-
-\def\MMLcenotation#1%
- {\doifelse\@@MMLenotationsymbol\v!no
- {\def\MMLcsep {\unskip{\rm e}\ignorespaces}}
- {\def\MMLcsep##1\empty{\doifelse\@@MMLenotationsymbol{dot}\cdot\times10^{##1}}}%
- #1\empty}
-
-\def\MMLcCI#1% #2% can be sped up with \doifundefined ...
- {\getXMLarguments{ci}{type="" #1}%
- \doifXMLparelse{ci}{type}
- {\processaction
- [\XMLpar{ci}{type}{}]
- [ set=>\let\next\MMLcCIset,
- vector=>\let\next\MMLcCIvector,
- matrix=>\let\next\MMLcCImatrix,
- function=>\let\next\MMLcCIfunction,
-complex-cartesian=>\let\next\MMLccartesian,
- complex=>\let\next\MMLccartesian,
- complex-polar=>\let\next\MMLcpolar,
- polar=>\let\next\MMLcpolar,
- fn=>\let\next\MMLcCIfunction,
- unknown=>\let\next\firstofoneargument]} % integer constant real float
- {\let\next\firstofoneargument}%
- \next}
-
-\def\MMLcCIset#1%
- {{\bbd#1}}
-
-\def\widevec#1%
- {\vbox{\mathsurround\zeropoint\ialign{##\crcr
- \rightarrowfill\crcr\noalign{\nointerlineskip}%
- $\hfil\displaystyle{#1}\hfil$\crcr}}}
-
-\def\MMLcCIvector#1%
- {\widevec{#1}}
-
-\def\MMLcCImatrix#1%
- {{\bi#1}}
-
-\def\MMLcCIfunction#1%
- {\doifMMLoperatorelse{#1}\MMLcCIdefault\MMLcFNdefault{}{#1}}
-
-\def\MMLcCIdefault#1#2% #1=dummy
- {#2%\!% \getXMLentity{NegThinSpace}% looks bad in A(x)
- \doifnextcharelse\xmlr
- {\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}
- {\processaction
- [\XMLpar{cn}{type}{}]
- [ integer=>\let\next\MMLcCNinteger,
- logical=>\let\next\MMLcCNlogical,
- rational=>\let\next\MMLcCNrational,
-complex-cartesian=>\let\next\MMLccartesian,
- complex=>\let\next\MMLccartesian,
- complex-polar=>\let\next\MMLcpolar,
- polar=>\let\next\MMLcpolar,
- e-notation=>\let\next\MMLcenotation, % new
- float=>\let\next\MMLcfloat, % obsolete
- real=>\let\next\MMLcfloat, % ?
- unknown=>\let\next\firstofoneargument]}
- {\let\next\firstofoneargument}
- \next}
-
-\setupMMLappearance[base][\c!symbol=\v!numbers] % cijfers|letters|tekst|nee
-
-\def\MMLcCNinteger#1%
- {\doifXMLparelse{cn}{base}
- {\def\MMLcCNbase{\XMLpar{cn}{base}{}}%
- \doifelse\@@MMLbasesymbol\v!no
- {\MMLcCNbasedata{#1}}
- {\MMLcCNbasedata{#1}_{\hbox{$\rm\scriptscriptstyle
- \processaction
- [\@@MMLbasesymbol]
- [\v!characters=>\MMLcCNbasestring BODH,
- \v!text=>\MMLcCNbasestring{BIN}{OCT}{DEC}{HEX},
- \s!unknown=>\MMLcCNbase]$}}}}
- {#1}}
-
-\def\MMLcCNbasedata#1%
- {\ifnum\MMLcCNbase>10{\rm#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%
- {{\rm#1}}
-
-\def\MMLcCNrational#1%
- {\ConvertConstantAfter\doifinstringelse{sep}{#1}
- {\doMMLcCNrational#1\empty}
- {#1}}
-
-\def\doMMLcCNrational#1\xmlr#2#3#4#5\empty
- {\hbox{$\frac{#1}{#5}$}}
-
-\def\MMLcCSYMBOL#1#2% TO DO
- {\getXMLarguments{csymbol}{encoding="text" #1}%
- \doifelse{\XMLpar{csymbol}{encoding}{}}{text}
- {{\rm#2}}{#2}}
-
-%%% basic content elements
-
-\remapXMLsequence [apply] [CPA] \MMLcAPPLY
-
-\newcount\@MMLlevel \def\MMLcreset{\@MMLlevel=0 }
-
-\let\MMLctempresetlist\empty \def\setMMLcreset{\edef\MMLctempresetlist}
-
-\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)
-
-% better: no () here but explicitly when needed, which is in
-% less cases
-
-\def\MMLcAPPLY#1#2%
- {\mathinner{\begingroup % new, else 1/2(1+2) problem / inner: ask taco
- \pushmacro\xmlr
- \@EA\@EA\@EA\doifXMLRchild\@EA\@EA\@EA{\@EA\MMLcmainresetlist\@EA,\MMLctempresetlist}{#2}
- {\MMLcreset}%
- \ifcase\@MMLlevel
- \getXMLarguments{apply}{open="" close="" #1}%
- \else
- \getXMLarguments{apply}{open="(" close=")" #1}%
- \fi
- \doifXMLparelse{apply}{open}{\left\XMLpar{apply}{open}{}}{}%
- \advance\@MMLlevel+1
- \begingroup
- \let\MMLctempresetlist\empty
- \let\xmlr\naturalxmlr % beter een \pushmacro\xmlr
- #2\empty
- \endgroup % ook level push
- \advance\@MMLlevel-1
- \doifXMLparelse{apply}{close}{\right\XMLpar{apply}{close}{}}{}%
- \popmacro\xmlr
- \endgroup}}
-
-\remapXMLsequence [reln] [CPA] \MMLcRELN
-
-\def\MMLcRELN%
- {\writestatus{XML}{MathML element "reln" is obsolete}\MMLcAPPLY}
-
-\remapXMLsequence [fn] [CPA] \MMLcFN
-
-\def\MMLcFN#1#2% neg space needed because of \left
- {\doifXMLRchildelse{ci}{#2}
- {\collectXMLRchild{ci}{#2}%
- \@EA\doifMMLoperatorelse\@EA{\the\XMLRtoks}
- \MMLcFNoperator\MMLcFNdefault}
- {\MMLcFNdefault}%
- {#1}{#2}}
-
-\def\MMLcFNdefault#1#2% neg space needed because of \left
- {#2\!% \getXMLentity{NegThinSpace}%
- \MMLcreset\encapsulatenextXMLRelements{\left(}{\MMLccomma}{\right)}}
-
-% special function handlers
-
-\def\MMLcFNoperator
- {\getvalue{doMMLcFN\mmloperator}}
-
-% \def\doMMLcFNplusminus#1#2#3\empty
-% {\countXMLRchildren{#3}%
-% \ifcase\nofXMLRchildren\or
-% #2#3%
-% \else % suboptimal for instance under root
-% \encapsulateXMLR{\left(}{#2}{\right)}{\MMLcreset#3}%
-% \fi}
-
-\def\doMMLcFNplusminus#1#2#3\empty
- {\countXMLRchildren{#3}%
- \ifcase\nofXMLRchildren\or
- \def\next{#2#3}%
- \else
- \def\next
- {\doifnextcharelse\xmlr
- {\encapsulateXMLR{\left(}{#2}{\right)}{\MMLcreset#3}}%
- {\encapsulateXMLR{}{#2}{}{\MMLcreset#3}}}%
- \fi
- \next}
-
-\let\doMMLcFNminusplus\doMMLcFNplusminus
-
-\def\doMMLcFNcontinued#1#2#3\empty
- {#3\getXMLentity{continued}}
-
-% so far for the special handlers
-
-\remapXMLsequence [interval] [CPA] \MMLcINTERVAL
-
-\def\MMLcINTERVAL#1#2%
- {\withnexttwoXMLRelements
- {\getXMLarguments{interval}{closure="closed" #1}%
- \processaction
- [\XMLpar{interval}{closure}{closed}]
- [ closed=>{[\firstXMLRelement,\secondXMLRelement]},
- open-closed=>{(\firstXMLRelement,\secondXMLRelement]},
- closed-open=>{[\firstXMLRelement,\secondXMLRelement)},
- open=>{(\firstXMLRelement,\secondXMLRelement)},
- \s!unknown=>{[\firstXMLRelement,\secondXMLRelement]}]}%
- #2\empty}
-
-\remapXMLsingular [inverse] [CPA] \MMLcINVERSE
-
-\def\MMLcINVERSE#1#2%
- {\withnextXMLRelement
- {\nextXMLRelement\empty^{-1}% \empty kills MMLcfunction lookahead
- \withnextXMLRelement
- {\ifx\nextXMLRelement\empty \else
- \left[\nextXMLRelement\right]%
- \fi}}}
-
-\remapXMLsingular [sep] [CPA] \MMLcSEP
-
-\def\MMLcSEP#1#2{\MMLcsep} \def\MMLcsep{\,}
-
-\remapXMLsequence [condition] [CPA] \MMLcCONDITION
-
-\def\MMLcCONDITION#1#2%
- {\pushmacro\MMLcBVAR
- \doifXMLRchild{bvar}{#2}{\processXMLRchild{bvar}{#2}\mid}%
- \let\MMLcBVAR\ignoreXMLRelement
- \processXMLRchildren{#2}%
- \popmacro\MMLcBVAR}
-
-\remapXMLsequence [declare] [CPA] \MMLcDECLARE
-
-\setupMMLappearance[declare][\c!state=\v!start]
-
-\def\MMLcDECLARE#1#2%
- {\doif\@@MMLdeclarestate\v!start
- {\withnextXMLRelement
- {\getXMLentity{declare}\nextXMLRelement
- \countXMLRchildren{#2}%
- \ifnum\nofXMLRchildren>1
- \;% \getXMLentity{ThickSpace}%
- \getXMLentity{as}%
- \;% \getXMLentity{ThickSpace}%
- \fi}%
- #2\empty}}
-
-\remapXMLsequence [lambda] [CPA] \MMLcLAMBDA
-
-\setupMMLappearance[lambda][\c!alternative=b]
-
-\def\MMLcLAMBDA#1#2%
- {\doifelse\@@MMLlambdaalternative\v!a
- {\encapsulateXMLR{\getXMLentity{lambda}(}{\MMLccomma}{)}{#2}}
- {\countXMLRchild{bvar}{#2}%
- \ifnum\nofXMLRchildren>1
- \collectXMLRchild{bvar}{#2}%
- \encapsulateXMLR{\left(}{\MMLccomma}{\right)}{\the\XMLRtoks}%
- \else
- \processXMLRchild{bvar}{#2}%
- \fi
- \getXMLentity{mapsto}%
- \processXMLRchild{apply,reln,ci,cn}{#2}}}
-
-\remapXMLsingular [compose] [CPA] \MMLcCOMPOSE
-
-\def\MMLcCOMPOSE#1#2#3\empty
- {\doifMMLfunctionelse{#3}
- {\encapsulateXMLR{\left(}{\circ}{\right)}{#3}}
- {\encapsulateXMLR{}{\circ}{}{#3}}}
-
-\remapXMLsingular [ident] [CPA] \MMLcIDENT
-
-\def\MMLcIDENT#1#2{\getXMLentity{identity}}
-
-\remapXMLsingular [domain] [CPA] \MMLcDOMAIN
-\remapXMLsingular [codomain] [CPA] \MMLcCODOMAIN
-
-\def\MMLcDOMAIN #1#2#3\empty
- {\getXMLentity{domain}(\MMLcreset\processXMLRchildren{#3})}
-
-\def\MMLcCODOMAIN#1#2#3\empty
- {\getXMLentity{codomain}(\MMLcreset\processXMLRchildren{#3})}
-
-\remapXMLsingular [image] [CPA] \MMLcIMAGE
-
-\def\MMLcIMAGE#1#2%
- {\withnextXMLRelement{\getXMLentity{image}(\nextXMLRelement)}}
-
-\remapXMLsequence [domainofapplication] [CPA] \MMLcDOMAINOFAPPLICATION
-
-\def\MMLcDOMAINOFAPPLICATION#1#2{#2}
-
-\remapXMLsequence [piecewise] [CPA] \MMLcPIECEWISE
-\remapXMLsequence [piece] [CPA] \MMLcPIECE
-\remapXMLsequence [otherwise] [CPA] \MMLcOTHERWISE
-
-\setupMMLappearance[piece][\c!separator=]
-
-\def\MMLcPIECEWISE#1#2%
- {\cases{#2}}
-
-\def\MMLcPIECEseparator{\doif\@@MMLpieceseparator\v!yes,}
-
-\def\MMLcPIECE#1#2%
- {\withnexttwoXMLRelements
- {\@EA\XMLRtoks\@EA{\firstXMLRelement\MMLcPIECEseparator\@col@amp@}%
- \@EA\appendtoks\@EA\mathematics\@EA{\secondXMLRelement}\to\XMLRtoks
- \the\XMLRtoks\crcr}%
- #2}
-
-\def\MMLcOTHERWISE#1#2%
- {#2\MMLcPIECEseparator\@col@amp@\mathematics{\getXMLentity{otherwise}}\crcr}
-
-%%% arithmic, algebra and logic
-
-\remapXMLsingular [quotient] [CPA] \MMLcQUOTIENT
-
-\def\MMLcQUOTIENT#1#2%
- {\withnexttwoXMLRelements{\lfloor\firstXMLRelement/\secondXMLRelement\rfloor}}
-
-\remapXMLsingular [factorial] [CPA] \MMLcFACTORIAL
-
-\def\MMLcFACTORIAL#1#2%
- {\withnextXMLRelement{\nextXMLRelement !}}
-
-\remapXMLsingular [divide] [CPA] \MMLcDIVIDE
-
-\setupMMLappearance [divide] [\c!level=\!!maxcard]
-
-\def\MMLcDIVIDE#1#2%
- {\withnexttwoXMLRelements
- {\increment\MMLcDIVIDElevel
- \ifnum\MMLcDIVIDElevel>\@@MMLdividelevel\space
- \firstXMLRelement/\secondXMLRelement
- \else
- \frac{\MMLcreset\firstXMLRelement}{\MMLcreset\secondXMLRelement}%
- \fi
- \decrement\MMLcDIVIDElevel}}
-
-\remapXMLsingular [min] [CPA] \MMLcMIN
-\remapXMLsingular [max] [CPA] \MMLcMAX
-
-\def\MMLcMIN#1#2#3\empty
- {\encapsulateXMLR
- {\min\doifXMLRchild{bvar}{#3}{_{\processXMLRchild{bvar}{#3}}}\left\{}
- {\MMLccomma}{\right\}}{#3}}
-
-\def\MMLcMAX#1#2#3\empty
- {\encapsulateXMLR
- {\max\doifXMLRchild{bvar}{#3}{_{\processXMLRchild{bvar}{#3}}}\left\{}
- {\MMLccomma}{\right\}}{#3}}
-
-\remapXMLsingular [minus] [CPA] \MMLcMINUS
-\remapXMLsingular [plus] [CPA] \MMLcPLUS
-
-\setupMMLappearance[sign][\c!reduction=\v!yes]
-
-\def\MMLcMINUS % expandafter needed ?
- {\doifelse\@@MMLsignreduction\v!yes
- {\expandafter\MMLcMINUSyes}{\expandafter\MMLcMINUSno}}
-
-\def\MMLcPLUS % expandafter needed ?
- {\doifelse\@@MMLsignreduction\v!yes
- {\expandafter\MMLcPLUSyes}{\expandafter\MMLcPLUSno}}
-
-\def\MMLcMINUSno#1#2#3\empty
- {\countXMLRchildren{#3}%
- \encapsulateXMLR{\ifcase\nofXMLRchildren\or-\fi}{-}{}{#3}}
-
-\def\MMLcPLUSno#1#2#3\empty
- {\countXMLRchildren{#3}%
- \encapsulateXMLR{\ifcase\nofXMLRchildren\or+\fi}{+}{}{#3}}
-
-\def\MMLcMINUSyes#1#2#3\empty
- {\setMMLcreset{\MMLcfunctionlist}%
- \countXMLRchildren{#3}%
- \encapsulateXMLR{\ifcase\nofXMLRchildren\or-\fi}{-}{}{#3}}
-
-\def\MMLcPLUSyes#1#2#3\empty
- {\setMMLcreset{plus/,minus/,\MMLcfunctionlist,\MMLcconstructlist}%
- \encapsulatenextXMLRelements
- {}
- {\doifXMLRchildelse{apply}{\nextXMLRelement}%
- {\collectXMLRchild{apply}{\nextXMLRelement}%
- \doifXMLRchildelse{minus/}{\the\XMLRtoks}
- {\countXMLRchildren{\the\XMLRtoks}
- \ifnum\nofXMLRchildren>2 +\else\fi}{+}}
- {+}}
- {}
- {#3\empty}}
-
-\remapXMLsingular [power] [CPA] \MMLcPOWER
-
-\setupMMLappearance[power][\c!reduction=\v!yes]
-
-\let\MMLpowerelement\empty
-
-\def\MMLcPOWER#1#2%
- {\withnexttwoXMLRelements
- {\doifXMLRchildelse{apply}{\firstXMLRelement}
- {\doifelse\@@MMLpowerreduction\v!yes
- {\collectXMLRchild{apply}{\firstXMLRelement}%
- \@EA\doifXMLRchildelse\@EA{\MMLcfunctionlist}{\the\XMLRtoks}
- {\let\MMLpowerelement\secondXMLRelement
- \MMLcreset\firstXMLRelement\empty}
- {\left(\MMLcreset\firstXMLRelement\empty\right)^{\MMLcreset\secondXMLRelement}}}
- {\left(\MMLcreset\firstXMLRelement\empty\right)^{\MMLcreset\secondXMLRelement}}}
- {\firstXMLRelement^{\MMLcreset\secondXMLRelement}}}}
-
-\remapXMLsingular [rem] [CPA] \MMLcREM
-
-\def\MMLcREM#1#2%
- {\withnexttwoXMLRelements
- {\firstXMLRelement\getXMLentity{mod}\secondXMLRelement}}
-
-\remapXMLsingular [times] [CPA] \MMLcTIMES
-
-\setupMMLappearance[times][\c!symbol=\v!no] %
-\setupMMLappearance[times][\c!auto=\v!yes] % new, auto catches cn cn cn
-
-\def\MMLcTIMES#1#2#3\empty
- {\setMMLcreset{\MMLcfunctionlist,\MMLcconstructlist}%
- \doifelse\@@MMLtimesauto\v!no
- {\let\@@MMLtimes@@symbol\@@MMLtimessymbol}
- {\doifelseXMLRneighbors{cn}{#3}
- {\let\@@MMLtimes@@symbol\v!yes}
- {\let\@@MMLtimes@@symbol\@@MMLtimessymbol}}%
- \doifelse\@@MMLtimes@@symbol\v!yes
- {\encapsulateXMLR{}{\times}{}{#3\empty}}
- {\doifelse\@@MMLtimes@@symbol{dot}
- {\encapsulateXMLR{}{\cdot}{}{#3\empty}}
- {#3\empty}}}
-
-\remapXMLsingular [root] [CPA] \MMLcROOT
-
-\setupMMLappearance[root][\c!symbol=\v!yes]
-
-\def\MMLcROOT#1#2#3\empty
- {\doifXMLRchildelse{degree}{#3}\donetrue\donefalse
- \doif\@@MMLrootsymbol\v!no\donefalse
- \ifdone
- \root\processXMLRchild{degree}{#3}\of
- {\let\MMLcDEGREE\ignoreXMLRelement
- \MMLcreset\processXMLRchildren{#3}}%
- \else
- \sqrt
- {\MMLcreset\processXMLRchildren{#3}}%
- \fi}
-
-\remapXMLsingular [gcd] [CPA] \MMLcGCD
-
-\def\MMLcGCD#1#2#3\empty{\encapsulateXMLR{\gcd(}{\MMLccomma}{)}{#3}}
-
-\remapXMLsingular [and] [CPA] \MMLcAND
-\remapXMLsingular [or] [CPA] \MMLcOR
-\remapXMLsingular [xor] [CPA] \MMLcXOR
-\remapXMLsingular [implies] [CPA] \MMLcIMPLIES
-
-\def\MMLcAND #1#2#3\empty{\encapsulateXMLR{}{\getXMLentity{and}}{}{#3}}
-\def\MMLcOR #1#2#3\empty{\encapsulateXMLR{}{\getXMLentity{or}}{}{#3}}
-\def\MMLcXOR #1#2#3\empty{\encapsulateXMLR{}{\getXMLentity{xor}}{}{#3}}
-\def\MMLcIMPLIES#1#2#3\empty{\encapsulateXMLR{}{\getXMLentity{implies}}{}{#3}}
-
-\remapXMLsingular [not] [CPA] \MMLcNOT
-
-\def\MMLcNOT#1#2#3\empty{\getXMLentity{not}\processXMLRchildren{#3}}
-
-\remapXMLsingular [forall] [CPA] \MMLcFORALL
-\remapXMLsingular [exists] [CPA] \MMLcEXISTS
-
-\def\MMLcFORALL%
- {\getXMLentity{forall}%
- \!% \getXMLentity{NegThinSpace}%
- \MMLcFORALLandEXISTS}
-
-\def\MMLcEXISTS%
- {\getXMLentity{exists}%
- \MMLcFORALLandEXISTS}
-
-\def\MMLcFORALLandEXISTS#1#2#3\empty
- {\MMLcreset
- _{\encapsulateXMLRchildren{bvar}{}{\MMLccomma}{}{#3}}%
- \doifXMLRchildelse{condition}{#3}
- {\;% \getXMLentity{ThickSpace}%
- \processXMLRchild{condition}{#3}
- \doifXMLRchildelse{apply,reln,ci,cn}{#3}
- {\countXMLRchild{apply,reln,ci,cn}{#3}%
- \ifcase\nofXMLRchildren\or % == snelle volgende
- \encapsulateXMLRchildren{apply,reln,ci,cn}
- {\left\vert}%
- {}
- {\right.}
- {#3\empty}%
- \else % special case
- \pushmacro\MMLcCONDITION
- \let\MMLcCONDITION\gobbletwoarguments
- \collectbetweenXMLRchild{apply,reln,ci,cn}{\hfill\crcr}{#3}%
- \left\vert\matrix{\the\XMLRtoks}\right.%
- \popmacro\MMLcCONDITION
- \fi}
- {}}
- {:\processXMLRchild{apply,reln,ci,cn}{#3\empty}}}
-
-\remapXMLsingular [abs] [CPA] \MMLcABS
-
-\def\MMLcABS#1#2#3\empty
- {\left\vert\MMLcreset\processXMLRchildren{#3}\right\vert}
-
-\remapXMLsingular [conjugate] [CPA] \MMLcCONJUGATE
-
-\def\MMLcCONJUGATE#1#2#3\empty%
- {\overline{\MMLcreset\processXMLRchildren{#3}}}
-
-\remapXMLsingular [arg] [CPA] \MMLcARG
-
-\def\MMLcARG#1#2#3\empty
- {\getXMLentity{arg}(\MMLcreset\processXMLRchildren{#3})}
-
-\remapXMLsingular [real] [CPA] \MMLcREAL
-\remapXMLsingular [imaginary] [CPA] \MMLcIMAGINARY
-
-\def\MMLcREAL#1#2#3\empty
- {\getXMLentity{real}(\MMLcreset\processXMLRchildren{#3})}
-
-\def\MMLcIMAGINARY#1#2#3\empty
- {\getXMLentity{imaginary}(\MMLcreset\processXMLRchildren{#3})}
-
-\remapXMLsingular [lcm] [CPA] \MMLcLCM
-
-\def\MMLcLCM#1#2#3\empty
- {\encapsulateXMLR{\getXMLentity{lcm}(}{\MMLccomma}{)}{#3}}
-
-\remapXMLsingular [floor] [CPA] \MMLcFLOOR
-\remapXMLsingular [ceiling] [CPA] \MMLcCEILING
-
-\def\MMLcFLOOR#1#2#3\empty
- {\getXMLentity{lfloor}\processXMLRchildren{#3}\getXMLentity{rfloor}}
-
-\def\MMLcCEILING#1#2#3\empty
- {\getXMLentity{lceiling}\processXMLRchildren{#3}\getXMLentity{rceiling}}
-
-%%% relations
-
-\remapXMLsingular [eq] [CPA] \MMLcEQ
-\remapXMLsingular [neq] [CPA] \MMLcNEQ
-\remapXMLsingular [gt] [CPA] \MMLcGT
-\remapXMLsingular [lt] [CPA] \MMLcLT
-\remapXMLsingular [geq] [CPA] \MMLcGEQ
-\remapXMLsingular [leq] [CPA] \MMLcLEQ
-\remapXMLsingular [equivalent] [CPA] \MMLcEQUIVALENT
-\remapXMLsingular [approx] [CPA] \MMLcAPPROX
-\remapXMLsingular [factorof] [CPA] \MMLcFACTOROF
-
-\setupMMLappearance[relation][\c!align=\v!no]
-
-\def\noMMLcrelation#1#2%
- {\encapsulatenextXMLRelements{}{#1}{}#2\empty}
-
-\def\lastMMLcrelation#1#2%
- {\countXMLRchildren{#2}%
- \rawcollectbetweenXMLR
- {\advance\nofXMLRchildren -1
- \ifnum\nofXMLRchildren>1
- \appendtoks\@col@amp@#1\crcr\to\XMLRtoks
- \else
- \appendtoks\@col@amp@#1\to\XMLRtoks
- \fi}
- {#2}%
- \eqalign{\the\XMLRtoks\crcr}}
-
-\def\firstMMLcrelation#1#2%
- {\nofXMLRchildren=0
- \rawcollectbetweenXMLR
- {\advance\nofXMLRchildren 1
- \ifnum\nofXMLRchildren=1
- \appendtoks\@col@amp@#1\to\XMLRtoks
- \else
- \appendtoks\crcr\@col@amp@#1\to\XMLRtoks
- \fi}
- {#2}%
- \eqalign{\the\XMLRtoks\crcr}}
-
-\def\leftMMLcrelation#1#2%
- {\collectbetweenXMLR{\@col@amp@#1\crcr}{#2}%
- \eqalign{\the\XMLRtoks}}
-
-\def\rightMMLcrelation#1#2%
- {\collectbetweenXMLR{\crcr#1{}\@col@amp@}{#2}% watch the {}
- \prependtoks\@col@amp@\to\XMLRtoks
- \eqalign{\the\XMLRtoks\crcr}}
-
-\def\MMLcrelation#1#2\empty
- {\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{#1}{#2}}
-
-\def\MMLcEQ #1#2{\MMLcrelation=}
-\def\MMLcNEQ #1#2{\MMLcrelation\neq}
-\def\MMLcGT #1#2{\MMLcrelation>}
-\def\MMLcLT #1#2{\MMLcrelation<}
-\def\MMLcGEQ #1#2{\MMLcrelation\geq}
-\def\MMLcLEQ #1#2{\MMLcrelation\leq}
-\def\MMLcEQUIVALENT#1#2{\MMLcrelation\equiv}
-\def\MMLcAPPROX #1#2{\MMLcrelation\approx}
-\def\MMLcFACTOROF #1#2{\MMLcrelation\mid}
-
-%%% introduced when making an example for Thorsten Bahne:
-
-\remapXMLsingular [becomes] [CPA] \MMLcBECOMES
-
-\def\MMLcBECOMES#1#2{\MMLcrelation{:=}}
-
-\addtocommalist{becomes/}\MMLcmainresetlist
-
-%%% calculus and vector calculus
-
-\setupMMLappearance[int][\c!location=\v!top]
-
-\remapXMLsingular [int] [CPA] \MMLcINT
-
-\def\doMMLlimits#1%
- {\doifelsevalue{@@MML#1\c!location}\v!top\limits\nolimits}
-
-\def\MMLcINT#1#2#3\empty
- {\pushmacro\xmlr
- \MMLcreset
- \doifXMLRchildelse{domainofapplication}{#3}
- {\int\doMMLlimits{int}_{\processXMLRchild{domainofapplication}{#3}}}
- {\doifXMLRchildelse{condition}{#3}
- {\int\doMMLlimits{int}_{\processXMLRchild{condition}{#3}}}
- {\doifXMLRchildelse{lowlimit}{#3}
- {\int\doMMLlimits{int}
- _{\processXMLRchild{lowlimit}{#3}}
- ^{\processXMLRchild {uplimit}{#3}}}
- {\int}}}%
- \doifXMLRchildelse{apply}{#3}
- {\doifMMLfunctionelse{#3}%
- {\MMLcreset % TEST
- \processXMLRchild{apply}{#3}}
- {\left(\MMLcreset % TEST
- \processXMLRchild{apply}{#3}\right)}}
- {\MMLcreset % TEST
- \processXMLRchild{ci}{#3}}%
- \doifXMLRchild{bvar}{#3}
- {\,% \getXMLentity{ThinSpace}%
- {\rm\getXMLentity{mathematicald}}\processXMLRchild{bvar}{#3}}%
- \popmacro\xmlr}
-
-\remapXMLsingular [diff] [CPA] \MMLcDIFF
-
-\setupMMLappearance[diff][\c!location=\v!top]
-
-\def\MMLcDIFF#1#2#3\empty
- {\pushmacro\xmlr
- \MMLcreset
- \doifXMLRchildelse{bvar}{#3}
- {\frac
- {{\rm \getXMLentity{mathematicald}}%
- \collectXMLRchild{bvar}{#3}%
- \let\MMLcDEGREE\superMMLcelement
- \expanded{\processXMLRchild{degree}{\the\XMLRtoks}}%
- \doif\@@MMLdifflocation\v!top
- {\doifXMLRchildelse{ci}{#3}
- {\processXMLRchild{ci}{#3}}
- {\doifMMLfunctionelse{#3}
- {\MMLcreset\processXMLRchild{apply}{#3}}
- {\left(\MMLcreset\processXMLRchild{apply}{#3}\right)}}}}
- {\let\MMLcDEGREE\superMMLcelement
- \begingroup\rm\getXMLentity{mathematicald}\endgroup
- \processXMLRchild{bvar}{#3}}%
- \doifnot\@@MMLdifflocation\v!top
- {\left(\MMLcreset\processXMLRchild{apply,ci}{#3}\right)}}
- {\processXMLRchildren{#3}^\prime}%
- \popmacro\xmlr}
-
-\remapXMLsingular [partialdiff] [CPA] \MMLcPARTIALDIFF
-
-\def\MMLcBVARpartialdiff#1#2%
- {\getXMLentity{differentiald}\processXMLRchild{apply,reln,ci,cn}{#2}
- \doifXMLRchild{degree}{#2}{^{\processXMLRchild{degree}{#2}}}}
-
-\def\MMLcPARTIALDIFF#1#2#3\empty
- {\pushmacro\xmlr
- \doifXMLRchildelse{list}{#3}
- {\getXMLentity{capitaldifferentiald}_{\encapsulateXMLRchild{list}{}{\MMLccomma}{}{#3}}%
- \processXMLRchild{apply,reln,ci,cn}{#3}}
- {\countXMLRchild{bvar}{#3}%
- \ifnum\nofXMLRchildren>0
- \pushmacro\MMLcDEGREE
- \pushmacro\MMLcBVAR
- \frac
- {\doifXMLRchildelse{degree}{#3}
- {\collectXMLRchild{degree}{#3}}
- {\collectXMLRchild{bvar}{#3}%
- \expanded{\collectXMLRchild{degree}{\the\XMLRtoks}}}%
- \getXMLentity{differentiald}^{\encapsulateXMLR{}{+}{}{\the\XMLRtoks}}%
- \let\MMLcDEGREE\gobbletwoarguments
- \doifMMLfunctionelse{#3}{\MMLcreset}{}%
- \processXMLRchild{apply,reln,ci,cn}{#3}}
- {\let\MMLcBVAR\MMLcBVARpartialdiff
- \processXMLRchild{bvar}{#3}}%
- \popmacro\MMLcBVAR
- \popmacro\MMLcDEGREE
- \else
- \processXMLRchild{apply,reln,ci,cn}{#3}%
- \fi}%
- \popmacro\xmlr}
-
-\def\doifMMLfunctionelse#1#2#3%
- {\collectXMLRchild{apply}{#1}%
- \doifXMLRchildelse{fn}{\the\XMLRtoks#1}
- {#2}
- {\doifXMLRchildelse{ci}{\the\XMLRtoks#1}
- {\pushmacro\xmlr
- \getXMLarguments{dummy}{type=""}%
- \def\xmlr{\getmmlarguments{dummy}{}}%
- \the\XMLRtoks % what if more than one ?
- \popmacro\xmlr
- \doif{\XMLpar{dummy}{type}{}}{fn}{#2}{#3}}
- {#2}}}
-
-\def\subMMLcelement #1#2{_{#2}}
-\def\superMMLcelement#1#2{^{#2}}
-
-\remapXMLsequence [lowlimit][CPA] \MMLcLOWLIMIT
-\remapXMLsequence [uplimit] [CPA] \MMLcUPLIMIT
-\remapXMLsequence [bvar] [CPA] \MMLcBVAR
-\remapXMLsequence [degree] [CPA] \MMLcDEGREE
-
-\def\MMLcLOWLIMIT#1#2{#2}
-\def\MMLcUPLIMIT #1#2{#2}
-\def\MMLcBVAR #1#2{#2}
-\def\MMLcDEGREE #1#2{#2}
-
-\remapXMLsingular [divergence] [CPA] \MMLcDIVERGENCE
-\remapXMLsingular [grad] [CPA] \MMLcGRAD
-\remapXMLsingular [curl] [CPA] \MMLcCURL
-\remapXMLsingular [laplacian] [CPA] \MMLcLAPLACIAN
-
-\def\MMLcDIVERGENCE#1#2#3\empty{\getXMLentity{divergence}\processXMLRchildren{#3}}
-\def\MMLcGRAD #1#2#3\empty{\getXMLentity{grad}\processXMLRchildren{#3}}
-\def\MMLcCURL #1#2#3\empty{\getXMLentity{curl}\processXMLRchildren{#3}}
-\def\MMLcLAPLACIAN #1#2#3\empty{\getXMLentity{laplacian}\processXMLRchildren{#3}}
-
-%%% theory of sets
-
-\remapXMLsequence [set] [CPA] \MMLcSET
-
-\def\MMLcSET#1#2%
- {\doifXMLRchildelse{condition}{#2}
- {\{\processXMLRchild{bvar}{#2}\,\vert\,\processXMLRchild{condition}{#2}\}}
- {\encapsulateXMLR{\{}{\MMLccomma}{\}}{#2}}}
-
-\remapXMLsequence [list] [CPA] \MMLcLIST
-
-\def\MMLcLIST#1#2{\encapsulateXMLR{[}{\MMLccomma}{]}{#2}}
-
-\remapXMLsingular [union] [CPA] \MMLcUNION
-\remapXMLsingular [intersect] [CPA] \MMLcINTERSECT
-\remapXMLsingular [in] [CPA] \MMLcIN
-\remapXMLsingular [notin] [CPA] \MMLcNOTIN
-\remapXMLsingular [subset] [CPA] \MMLcSUBSET
-\remapXMLsingular [prsubset] [CPA] \MMLcPRSUBSET
-\remapXMLsingular [notsubset] [CPA] \MMLcNOTSUBSET
-\remapXMLsingular [notprsubset] [CPA] \MMLcNOTPRSUBSET
-\remapXMLsingular [setdiff] [CPA] \MMLcSETDIFF
-
-\def\MMLcset#1{\withnexttwoXMLRelements{\firstXMLRelement#1\secondXMLRelement}}
-
-\def\MMLcUNION #1#2{\MMLcset\cup}
-\def\MMLcINTERSECT #1#2{\MMLcset\cap}
-\def\MMLcIN #1#2{\MMLcset\in}
-\def\MMLcNOTIN #1#2{\MMLcset{\not\in}}
-\def\MMLcSUBSET #1#2{\MMLcset\subset}
-\def\MMLcPRSUBSET #1#2{\MMLcset\subseteq}
-\def\MMLcNOTSUBSET #1#2{\MMLcset{\not\subset}}
-\def\MMLcNOTPRSUBSET #1#2{\MMLcset{\not\subseteq}}
-\def\MMLcSETDIFF #1#2{\MMLcset\setminus}
-
-\remapXMLsingular [card] [CPA] \MMLcCARD
-
-\def\MMLcCARD#1#2#3\empty{\encapsulateXMLR{\vert}{}{\vert}{#3}}
-
-\remapXMLsingular [cartesianproduct] [CPA] \MMLcCARTESIANPRODUCT
-
-\def\MMLcCARTESIANPRODUCT#1#2#3\empty{\encapsulateXMLR{}{\times}{}{#3}}
-
-%%% sequences and series
-
-\remapXMLsingular [sum] [CPA] \MMLcSUM
-\remapXMLsingular [product] [CPA] \MMLcPRODUCT
-
-\def\MMLcSUM {\MMLcSUMandPRODUCT{sum}\sum}
-\def\MMLcPRODUCT{\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#3#4\empty
- {\pushmacro\xmlr
- \doifXMLRchildelse{condition,bvar,lowlimit}{#4}
- {\def\MMLcSUMlow
- {_{\doifXMLRchildelse{condition}{#4}
- {\collectXMLRchild{condition}{#4}%
- \expanded{\collectbetweenXMLR{\crcr}{\the\XMLRtoks}}%
- \stackMMLsubscripts{\the\XMLRtoks}}
- {\doifXMLRchild{bvar}{#4}
- {\processXMLRchild{bvar}{#4}%
- \doifXMLRchild{lowlimit}{#4}{=}}%
- \processXMLRchild{lowlimit}{#4}}}}}
- {\let\MMLcSUMlow\empty}%
- \doifXMLRchildelse{uplimit}{#4}
- {\def\MMLcSUMup{^{\processXMLRchild{uplimit}{#4}}}}
- {\let\MMLcSUMup\empty}%
- \MMLcreset#2\doMMLlimits{#1}\MMLcSUMup\MMLcSUMlow
- \MMLcreset
- \processXMLRchild{apply,ci}{#4}%
- \popmacro\xmlr}
-
-\remapXMLsingular [limit] [CPA] \MMLcLIMIT
-
-\setupMMLappearance[limit][\c!location=\v!top]
-
-\def\MMLcLIMIT#1#2#3\empty
- {\pushmacro\xmlr
- \MMLcreset
- \lim\doMMLlimits{limit}_
- {\MMLcreset
- \doifXMLRchildelse{condition}{#3}
- {\processXMLRchild{condition}{#3}}
- {\doifXMLRchild{bvar}{#3}
- {\processXMLRchild{bvar}{#3}\rightarrow}%
- \processXMLRchild{lowlimit}{#3}}}%
- \processXMLRchild{apply}{#3}%
- \popmacro\xmlr}
-
-\remapXMLsingular [tendsto] [CPA] \MMLcTENDSTO
-
-\def\MMLcTENDSTO#1#2%
- {\getXMLarguments{tendsto}{type="default" #1}%
- \withnexttwoXMLRelements
- {\MMLcreset\firstXMLRelement
- \processaction
- [\XMLpar{tendsto}{type}{default}]
- [ above=>\downarrow,
- below=>\uparrow,
- unknown=>\rightarrow]%
- \MMLcreset\secondXMLRelement}}
-
-%%% elementary classical functions
-
-\remapXMLsingular [exp] [CPA] \MMLcEXP
-
-\def\MMLcEXP#1#2#3\empty
- {\getXMLentity{exponentiale}^{\MMLcreset#3}}
-
-\remapXMLsingular [ln] [CPA] \MMLcLN
-
-%\def\MMLcLN#1#2#3\empty
-% {\ln\left(\MMLcreset#3\right)}
-
-\def\MMLcLN#1#2%
- {\doMMLcfunction{ln}}
-
-\remapXMLsingular [log] [CPA] \MMLcLOG
-
-\setupMMLappearance[log][\c!location=\v!right]
-
-\def\MMLcLOG#1#2#3\empty
- {\pushmacro\MMLcLOGBASE
- \let\MMLcLOGBASE\secondoftwoarguments
- \doifXMLRchildelse{logbase}{#3}
- {\doifelse\@@MMLloglocation\v!left
- {\mathop{{}^{\processXMLRchild{logbase}{#3}}\!\getXMLentity{log}}}
- {\getXMLentity{log}_{\processXMLRchild{logbase}{#3}}}}
- {\getXMLentity{log}}%
- \let\MMLcLOGBASE\ignoreXMLRelement
- \nodoMMLcfunction#3\empty
- \popmacro\MMLcLOGBASE}
-
-\remapXMLsequence [logbase] [CPA] \MMLcLOGBASE
-
-\def\MMLcLOGBASE#1#2{#2}
-
-\remapXMLsingular [sin] [CPA] \MMLcSIN
-\remapXMLsingular [arcsin] [CPA] \MMLcARCSIN
-\remapXMLsingular [sinh] [CPA] \MMLcSINH
-\remapXMLsingular [arcsinh] [CPA] \MMLcARCSINH
-\remapXMLsingular [cos] [CPA] \MMLcCOS
-\remapXMLsingular [arccos] [CPA] \MMLcARCCOS
-\remapXMLsingular [cosh] [CPA] \MMLcCOSH
-\remapXMLsingular [arccosh] [CPA] \MMLcARCCOSH
-\remapXMLsingular [tan] [CPA] \MMLcTAN
-\remapXMLsingular [arctan] [CPA] \MMLcARCTAN
-\remapXMLsingular [tanh] [CPA] \MMLcTANH
-\remapXMLsingular [arctanh] [CPA] \MMLcARCTANH
-\remapXMLsingular [cot] [CPA] \MMLcCOT
-\remapXMLsingular [arccot] [CPA] \MMLcARCCOT
-\remapXMLsingular [coth] [CPA] \MMLcCOTH
-\remapXMLsingular [arccoth] [CPA] \MMLcARCCOTH
-\remapXMLsingular [csc] [CPA] \MMLcCSC
-\remapXMLsingular [arccsc] [CPA] \MMLcARCCSC
-\remapXMLsingular [csch] [CPA] \MMLcCSCH
-\remapXMLsingular [arccsch] [CPA] \MMLcARCCSCH
-\remapXMLsingular [sec] [CPA] \MMLcSEC
-\remapXMLsingular [arcsec] [CPA] \MMLcARCSEC
-\remapXMLsingular [sech] [CPA] \MMLcSECH
-\remapXMLsingular [arcsech] [CPA] \MMLcARCSECH
-
-\setupMMLappearance[function][\c!reduction=\v!yes]
-
-\def\doMMLcfunction#1%
- {\doifnextcharelse\xmlr{\dodoMMLcfunction{#1}}{\getXMLentity{#1}}}
-
-\def\dodoMMLcfunction#1%
- {\getXMLentity{#1}%
- \nodoMMLcfunction}
-
-\def\nodoMMLcfunction#1\empty
- {\ifx\MMLpowerelement\empty\else
- ^{\MMLcreset\MMLpowerelement\empty}\!\let\MMLpowerelement\empty
- \fi
- \doifelse\@@MMLfunctionreduction\v!yes
- {\doifXMLRchildelse{apply}{#1}
- {\collectXMLRchild{apply}{#1}%
- \@EA\doifXMLRchildelse\@EA{\MMLcfunctionlist}{\the\XMLRtoks}
- {\MMLcreset#1\empty}
- {\left(\MMLcreset#1\empty\right)}}
- {\MMLcreset#1\empty}}
- {\left(\MMLcreset#1\empty\right)}}
-
-\def\MMLcSIN #1#2{\doMMLcfunction{sin}}
-\def\MMLcARCSIN #1#2{\doMMLcfunction{arcsin}}
-\def\MMLcSINH #1#2{\doMMLcfunction{sinh}}
-\def\MMLcARCSINH#1#2{\doMMLcfunction{arcsinh}}
-\def\MMLcCOS #1#2{\doMMLcfunction{cos}}
-\def\MMLcARCCOS #1#2{\doMMLcfunction{arccos}}
-\def\MMLcCOSH #1#2{\doMMLcfunction{cosh}}
-\def\MMLcARCCOSH#1#2{\doMMLcfunction{arccosh}}
-\def\MMLcTAN #1#2{\doMMLcfunction{tan}}
-\def\MMLcARCTAN #1#2{\doMMLcfunction{arctan}}
-\def\MMLcTANH #1#2{\doMMLcfunction{tanh}}
-\def\MMLcARCTANH#1#2{\doMMLcfunction{arctanh}}
-\def\MMLcCOT #1#2{\doMMLcfunction{cot}}
-\def\MMLcARCCOT #1#2{\doMMLcfunction{arccot}}
-\def\MMLcCOTH #1#2{\doMMLcfunction{coth}}
-\def\MMLcARCCOTH#1#2{\doMMLcfunction{arccoth}}
-\def\MMLcCSC #1#2{\doMMLcfunction{csc}}
-\def\MMLcARCCSC #1#2{\doMMLcfunction{arccsc}}
-\def\MMLcCSCH #1#2{\doMMLcfunction{csch}}
-\def\MMLcARCCSCH#1#2{\doMMLcfunction{arccsch}}
-\def\MMLcSEC #1#2{\doMMLcfunction{sec}}
-\def\MMLcARCSEC #1#2{\doMMLcfunction{arcsec}}
-\def\MMLcSECH #1#2{\doMMLcfunction{sech}}
-\def\MMLcARCSECH#1#2{\doMMLcfunction{arcsech}}
-
-%%% statistics
-
-\remapXMLsingular [mean] [CPA] \MMLcMEAN
-\remapXMLsingular [sdev] [CPA] \MMLcSDEV
-\remapXMLsingular [variance] [CPA] \MMLcVARIANCE
-\remapXMLsingular [median] [CPA] \MMLcMEDIAN
-\remapXMLsingular [mode] [CPA] \MMLcMODE
-
-\def\MMLcMEAN #1#2{\withnextXMLRelement{\overline{\nextXMLRelement}}}
-\def\MMLcSDEV #1#2{\withnextXMLRelement{\sigma(\MMLcreset\nextXMLRelement)}}
-\def\MMLcVARIANCE#1#2{\withnextXMLRelement{\sigma(\MMLcreset\nextXMLRelement)^2}}
-\def\MMLcMEDIAN #1#2{\withnextXMLRelement{\getXMLentity{median}(\MMLcreset\nextXMLRelement)}}
-\def\MMLcMODE #1#2{\withnextXMLRelement{\getXMLentity{mode}(\MMLcreset\nextXMLRelement)}}
-
-\remapXMLsingular [moment] [CPA] \MMLcMOMENT
-\remapXMLsequence [momentabout] [CPA] \MMLcMOMENTABOUT
-
-\def\MMLcMOMENT#1#2#3\empty
- {\left\langle\processXMLRchild{apply,reln,ci,cn}{#3}%
- ^{\processXMLRchild{degree}{#3}}\right\rangle}
-
-\def\MMLcMOMENTABOUT#1#2{}
-
-%%% linear algebra
-
-\remapXMLsequence [vector] [CPA] \MMLcVECTOR
-
-\setupMMLappearance[vector][\c!direction=\v!horizontal] % \v!vertical
-
-\def\MMLcVECTOR#1#2%
- {\countXMLRchildren{#2}%
- \ifnum\nofXMLRchildren>1
- \doifelse\@@MMLvectordirection\v!horizontal
- {\encapsulateXMLR{\left(}{\MMLccomma}{\right)}{#2}}
- {\collectbetweenXMLR{\crcr}{#2}%
- \MMLcreset\left(\matrix{\the\XMLRtoks}\right)}%
- \else
- \overrightarrow{#2}%
- \fi}
-
-\remapXMLsequence [matrix] [CPA] \MMLcMATRIX
-\remapXMLsequence [matrixrow] [CPA] \MMLcMATRIXROW
-
-\unexpanded\def\@col@amp@{&}
-
-\def\doMMLcMATRIX#1#2#3%
- {\pushmacro\MMLcMATRIXROW
- \let\MMLcMATRIXROW\normalMMLcMATRIXROW
- \MMLcreset
- \ifcase#1\matrix{#3}\else\left(\matrix{#3}\right)\fi
- \popmacro\MMLcMATRIXROW}
-
-\def\MMLcMATRIX#1#2%
- {\doMMLcMATRIX1{#1}{#2}}
-
-\def\MMLcMATRIXROW#1#2%
- {\collectbetweenXMLR{\@col@amp@}{#2}\the\XMLRtoks\crcr}
-
-\let\normalMMLcMATRIXROW\MMLcMATRIXROW
-
-\def\MMLcMATRIXROW#1#2%
- {\collectbetweenXMLR{\@col@amp@}{#2}%
- \left(\matrix{\the\XMLRtoks\crcr}\right)}
-
-\remapXMLsingular [determinant] [CPA] \MMLcDETERMINANT
-
-% \def\MMLcDETERMINANT#1#2{\getXMLentity{determinant}} % optie
-
-\def\MMLcDETERMINANT#1#2\empty
- {\pushmacro\MMLcMATRIX
- \def\MMLcMATRIX##1##2{\doMMLcMATRIX0{##1}{##2}}%
- \left|#2\empty\right|%
- \popmacro\MMLcMATRIX}
-
-\remapXMLsingular [transpose] [CPA] \MMLcTRANSPOSE
-
-\def\MMLcTRANSPOSE#1#2{\withnextXMLRelement{\nextXMLRelement^{\rm T}}}
-
-\remapXMLsingular [selector] [CPA] \MMLcSELECTOR
-
-\def\MMLcSELECTOR#1#2#3\empty
- {\pushmacro\xmlr
- \withnextXMLRelement
- {\mathinner{\nextXMLRelement}% hm, assumes a matrix or so
- \doMMLcSELECTOR}%
- #3\empty
- \popmacro\xmlr}
-
-\def\doMMLcSELECTOR#1\empty
- {_{\MMLcreset\encapsulateXMLR{}{\MMLccomma}{}{#1\empty}}}
-
-\remapXMLsingular [vectorproduct] [CPA] \MMLcVECTORPRODUCT
-\remapXMLsingular [scalarproduct] [CPA] \MMLcSCALARPRODUCT
-\remapXMLsingular [outerproduct] [CPA] \MMLcOUTERPRODUCT
-
-\def\MMLcvector#1%
- {\withnexttwoXMLRelements{\firstXMLRelement#1\secondXMLRelement}}
-
-\def\MMLcVECTORPRODUCT#1#2{\MMLcvector{\getXMLentity{vectorproduct}}#2}% #2?%
-\def\MMLcSCALARPRODUCT#1#2{\MMLcvector{\getXMLentity{scalarproduct}}#2}
-\def\MMLcOUTERPRODUCT #1#2{\MMLcvector{\getXMLentity{outerproduct}}#2}
-
-%%% semantic mapping elements
-
-\remapXMLsequence [semantics] [CPA] \MMLcSEMANTICS
-
-\def\MMLcSEMANTICS#1#2%
- {\doifXMLRchildelse{annotation}{#2}
- {\processXMLRchild{annotation}{#2}}
- {#2}}
-
-\remapXMLsequence [annotation] [CPA] \MMLcANNOTATION
-
-\def\MMLcANNOTATION#1#2% we need a better unmapper
- {\getXMLarguments{annotation}{encoding="" #1}%
- \doif{\XMLpar{annotation}{encoding}{}}{TeX}%
- {\begingroup
- \setnormalXMLentities % better: \simplifyXMLentities ; test first
- \let\xmlrent\expandedXMLentity
- \edef\mmlascii{#2}%
- \setnormalcatcodes
- \ifx\mmlascii\empty
- \donefalse
- \else
- \def\do##1##2\end % hack
- {\edef\!!stringa{\string##1}%
- \edef\!!stringb{\letterdollar}%
- \ifx\!!stringa\!!stringb
- \donetrue
- \else
- \donefalse
- \fi}%
- \expandafter\do\mmlascii\end
- \fi
- \ifdone
- \hbox{\scantokens\@EA{\mmlascii}}%
- \else
- \scantokens\@EA{\mmlascii}%
- \fi
- \endgroup}}
-
-\remapXMLsequence [annotation-xml] [CPA] \MMLcANNOTATIONXML
-
-\def\MMLcANNOTATIONXML#1#2{}
-
-%%% constant and symbol elements
-
-\remapXMLsingular [integers] [CPA] \MMLcINTEGERS
-\remapXMLsingular [reals] [CPA] \MMLcREALS
-\remapXMLsingular [rationals] [CPA] \MMLcRATIONALS
-\remapXMLsingular [naturalnumbers] [CPA] \MMLcNATURALNUMBERS
-\remapXMLsingular [complexes] [CPA] \MMLcCOMPLEXES
-\remapXMLsingular [primes] [CPA] \MMLcPRIMES
-\remapXMLsingular [exponentiale] [CPA] \MMLcEXPONENTIALE
-\remapXMLsingular [imaginaryi] [CPA] \MMLcIMAGINARYI
-\remapXMLsingular [notanumber] [CPA] \MMLcNOTANUMBER
-\remapXMLsingular [true] [CPA] \MMLcTRUE
-\remapXMLsingular [false] [CPA] \MMLcFALSE
-\remapXMLsingular [emptyset] [CPA] \MMLcEMPTYSET
-\remapXMLsingular [pi] [CPA] \MMLcPI
-\remapXMLsingular [eulergamma] [CPA] \MMLcEULERGAMMA
-\remapXMLsingular [infinity] [CPA] \MMLcINFINITY
-
-\def\MMLcINTEGERS #1#2{\getXMLentity{integers}}
-\def\MMLcREALS #1#2{\getXMLentity{reals}}
-\def\MMLcRATIONALS #1#2{\getXMLentity{rationals}}
-\def\MMLcNATURALNUMBERS#1#2{\getXMLentity{naturalnumbers}}
-\def\MMLcCOMPLEXES #1#2{\getXMLentity{complexes}}
-\def\MMLcPRIMES #1#2{\getXMLentity{primes}}
-\def\MMLcEXPONENTIALE #1#2{\getXMLentity{ExponentialE}}
-\def\MMLcIMAGINARYI #1#2{\getXMLentity{ImaginaryI}}
-\def\MMLcNOTANUMBER #1#2{\mathop{\rm NaN}}
-\def\MMLcTRUE #1#2{\mathop{\rm true}}
-\def\MMLcFALSE #1#2{\mathop{\rm false}}
-\def\MMLcEMPTYSET #1#2{\mathop{\hbox{\O}}}
-\def\MMLcPI #1#2{\pi}
-\def\MMLcEULERGAMMA #1#2{\gamma}
-\def\MMLcINFINITY #1#2{\infty}
-
-\stopXMLmapping
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-mml.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-mml.mkii
deleted file mode 100644
index f948128fa5e..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-mml.mkii
+++ /dev/null
@@ -1,515 +0,0 @@
-%D \module
-%D [ file=xtag-mml,
-%D version=2000.12.20,
-%D title=\CONTEXT\ XML Macros,
-%D subtitle=MathML,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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}
-
-% I will reimplement this one without mapping since we now have more
-% tricks available
-
-\useXMLfilter[map]
-
-%\enablemathpunctuation
-
-% First some general formula element definitions.
-
-\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}
-
-% Since I only had the draft of mml 2 as example of
-% rendering, there are probably a lot of omissions and
-% misinterpretations. At least I learned some bits and
-% pieces of math rendering.
-%
-% The main complications were not so much the math, but to
-% find the most efficient way to handle elements without
-% spacing beging messed up. The first implementation was
-% aimed at getting reasonable output, this second
-% implementation is already better in terms of handling
-% nesting, and I will definitely need a third one that has
-% more efficient and less ugly code.
-%
-% The TeX part is not that complicated and once the
-% preprocessor was okay, the rest way just a lot of keying
-% and testing. It all comes down to gobbling, redefining,
-% and not so much to parsing.
-
-\unprotect
-
-\def\setupMMLappearance[#1]{\dodoubleargument\getparameters[@@MML#1]}
-
-\defineXMLdirective [mathml] \setupMMLappearance
-
-\defineXMLargument [math] \doXMLmath
-\defineXMLargument [imath] \doXMLimath
-\defineXMLargument [dmath] \doXMLdmath
-\defineXMLargument [m] \doXMLimath
-
-\unexpanded\def\doXMLmath {\ifhmode\@EA\doXMLimath\else\@EA\doXMLdmath\fi}
-\unexpanded\def\doXMLimath{\XMLremapdata[mml]{$}{$}}
-\unexpanded\def\doXMLdmath{\XMLremapdata[mml]{\dostartformula{}}{\dostopformula}}
-
-\ifx\XMLRtoks\undefined \newtoks\XMLRtoks \fi
-
-\def\convertasciiafter#1#2%
- {\defconvertedargument\asciiafter{#2}%
- \@EA#1\@EA{\asciiafter}}
-
-\def\checkMMLoperator#1% #2
- {\unspaceargument#1\to\ascii
- \doifXMLentityelse\ascii{\getXMLentity\ascii}} % {#2}
-
-% this will be done in a more safe way
-
-\def\MMLtodo#1{\enspace\hbox{\rm#1}\enspace}
-
-% this goes to core-mat
-
-\def\normalorfiller #1#2{#1}
-\def\normalordelimiter#1#2{#2}
-
-\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}
-
-% Auxiliary macros
-
-\bgroup \obeylines
-
-\gdef\defineMMLentity% % needed !
- {\bgroup\obeylines\xdefineMMLentity}
-
-\gdef\xdefineMMLentity #1 #2 #3 #4
- {\egroup\dodefineMMLentity{#1}{#2}{#3}{#4}}
-
-\global\let\dodefineMMLentity\gobblefourarguments
-
-\gdef\defineMMLsynonym% % needed !
- {\bgroup\obeylines\xdefineMMLsynonym}
-
-\gdef\xdefineMMLsynonym #1 #2
- {\egroup\dodefineMMLsynonym{#1}{#2}}
-
-\global\let\dodefineMMLsynonym\gobbletwoarguments
-
-\egroup
-
-% some more
-
-\def\showMMLentity#1%
- {\bgroup
- \doifXMLentityelse{#1}
- {\let\left\empty\let\right\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}
-
-% the definitions
-
-\ifx\blackboard\undefined
- \def\blackboard{\ifx\Bbb\undefined\else\expandafter\Bbb\fi}
-\fi
-
-% 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}
-
-% basic entities, hebrew
-
-\defineXMLentity [aleph] {\mathematics \aleph}
-
-% 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] {\pm}
-\defineXMLentity [minusplus] {\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}}
-
-\defineXMLentity [lbrace] {\normalordelimiter{\{}{\left \{}}
-\defineXMLentity [rbrace] {\normalordelimiter{\}}{\right\}}}
-\defineXMLentity [lbracket] {\normalordelimiter{[}{\left [}}
-\defineXMLentity [rbracket] {\normalordelimiter{]}{\right]}}
-\defineXMLentity [lparenthesis] {\normalordelimiter{(}{\left (}}
-\defineXMLentity [rparenthesis] {\normalordelimiter{)}{\right)}}
-\defineXMLentity [langle] {\normalordelimiter{\langle}{\left \langle}}
-\defineXMLentity [rangle] {\normalordelimiter{\rangle}{\right\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}}
-
-\defineXMLentity [\letterleftbrace ] {\getXMLentity{lbrace}}
-\defineXMLentity [\letterrightbrace] {\getXMLentity{rbrace}}
-
-\defineXMLentity [{[}] {\getXMLentity{lbracket}}
-\defineXMLentity [{]}] {\getXMLentity{rbracket}}
-\defineXMLentity [{(}] {\getXMLentity{lparenthesis}}
-\defineXMLentity [{)}] {\getXMLentity{rparenthesis}}
-
-\defineXMLentity [times] {\times}
-\defineXMLentity [minus] {-}
-\defineXMLentity [plus] {+}
-\defineXMLentity [plusmn] {\pm}
-
-\defineXMLentity [nabla] {\nabla}
-
-\def\myspecialnormalvert{\mathematics{\vert}} % temp hack, should stretch
-
-\defineXMLentity [,] {{,}}
-\defineXMLentity [.] {{.}}
-\defineXMLentity [+] {+}
-\defineXMLentity [-] {-}
-\defineXMLentity [(] {(}
-\defineXMLentity [)] {)}
-\defineXMLentity [<] {\mathematics{<}}
-\defineXMLentity [>] {\mathematics{>}}
-\defineXMLentity [|] {\myspecialnormalvert}
-\defineXMLentity [/] {/}
-\defineXMLentity [*] {\times}
-\defineXMLentity [=] {=}
-
-\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/mkii/xtag-mmp.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-mmp.mkii
deleted file mode 100644
index 93f0a1504db..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-mmp.mkii
+++ /dev/null
@@ -1,553 +0,0 @@
-%D \module
-%D [ file=xtag-mmp,
-%D version=2000.12.20,
-%D title=\CONTEXT\ XML Macros,
-%D subtitle=Presentation MathML,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% \points should become \bodyfontsize
-
-% under reconstruction
-%
-% \starttext
-% \usemodule[mathml] \useXMLfilter[utf]
-% \unprotect
-%
-% \remapXMLsequence [mover] [CPA] \MMLpOVER
-% \remapXMLsequence [munder] [CPA] \MMLpUNDER
-%
-% \def\MMLpUNDER#1#2%
-% {\getXMLarguments{munder}{accent="false" #1}%
-% \withnexttwoXMLRelements\doMMLpUNDER#2}
-%
-% \def\MMLpOVER#1#2%
-% {\getXMLarguments{mover}{accent="false" #1}%
-% \withnexttwoXMLRelements\doMMLpOVER #2}
-%
-% \def\doMMLpUNDER
-% {\doifelse{\XMLpar{munder}{accent}{}}{true}
-% {\secondXMLRelement\firstXMLRelement}
-% {\mathop{\vtop{\mathsurround\zeropoint\ialign{\hss##\hss\crcr
-% \disabledelimiter\doMMLfiller\firstXMLRelement
-% \crcr\noalign{\kern3\points\nointerlineskip}%
-% \disabledelimiter\doMMLfiller\secondXMLRelement
-% \crcr\noalign{\kern3\points}}}}\limits}}
-%
-% \def\doMMLpOVER
-% {\doifelse{\XMLpar{mover}{accent}{}}{true}
-% {\secondXMLRelement\firstXMLRelement}
-% {\mathop{\vbox{\mathsurround\zeropoint\ialign{\hss##\hss\crcr\noalign{\kern3\points}%
-% \disabledelimiter\doMMLfiller\secondXMLRelement
-% \crcr\noalign{\kern3\points\nointerlineskip}%
-% \disabledelimiter\doMMLfiller\firstXMLRelement
-% \crcr}}}\limits}}
-%
-% \protect
-%
-% Normal: \startXMLdata<math><mover ><mi>a</mi><mo>¯</mo></mover></math>\stopXMLdata \par
-% Accent: \startXMLdata<math><mover accent="true"><mi>x</mi><mo>¯</mo></mover></math>\stopXMLdata \par
-%
-% \stoptext
-
-\writestatus{loading}{ConTeXt XML Macros / Presentational MathML}
-
-\unprotect
-
-\def\convertasciiafter#1#2%
- {\defconvertedargument\asciiafter{#2}%
- \@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
-
-\def\MMLpmath#1#2%
- {\begingroup
- \getXMLarguments{mstyle}{#1}\setMMLpmathstyle{mstyle}#2%
- \endgroup}
-
-\def\MMLpMI#1#2%
- {\MMLpmath{#1}{\checkMMLoperator{#2}{#2}}}
-
-\def\MMLpMN#1#2%
- {\begingroup\rm\MMLpmath{#1}{#2}\endgroup}
-
-\def\MMLpMO#1#2% yes or no
- {\checkMMLoperator
- {#2}
- {\ConvertConstantAfter\doifinstringelse{\xmlrent}{#2}
- {#2}{\hbox{\MMLpmath{#1}{\ignorespaces#2\unskip}}}}} % \hbox ?
-
-\remapXMLsequence [mfenced] [CPA] \MMLpFENCED
-
-\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
-
-\def\MMLpFENCED#1#2%
- {\getXMLarguments{mfenced}{open="(" close=")" separators="" #1}%
- \edef\MMLpopen {\XMLpar{mfenced}{open}{}}%
- \edef\MMLpclose{\XMLpar{mfenced}{close}{}}%
- \ifx\MMLpopen\empty\else\doMMLleft\MMLpopen\fi
- \pushmacro\MMLpopen
- \pushmacro\MMLpclose
- \doifXMLparelse{mfenced}{separators}
- {\resetMMLseparator
- \encapsulateXMLR
- {}%
- {\pushmacro\myspecialnormalvert % hack
- \def\myspecialnormalvert{\;\vrule\;}%
- \grabMMLseparator{\XMLpar{mfenced}{separators}{}}%
- \popmacro\myspecialnormalvert}
- {}%
- {#2\empty}}
- {#2}%
- \popmacro\MMLpclose
- \popmacro\MMLpopen
- \ifx\MMLpclose\empty
- \ifx\MMLpopen\empty\else\right.\fi
- \else\doMMLright\MMLpclose\fi}
-
-\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% better use \checkMMLoperator
- {\ifnum\MMLxxcounter=\MMLyycounter\space
-\doifXMLentityelse{#1}
- {\def\lastMMLseparator{\xmlrent{#1}}}
- {\def\lastMMLseparator{#1}}%
- \fi
- \dograbMMLseparator}
-
-\remapXMLsequence [menclose] [CPA] \MMLpENCLOSE
-
-\def\MMLpENCLOSE#1#2%
- {\getXMLarguments{menclose}{notation="" #1}%
- \doifelse{\XMLpar{menclose}{notation}{}}{longdiv}
- {\overline{)#2}}
- {#2}}
-
-\remapXMLsequence [mfrac] [CPA] \MMLpFRAC
-
-\def\MMLpFRAC#1#2% \above is suboptimal since the spacing changes
- {\withnexttwoXMLRelements
- {\getXMLarguments{mfrac}{linethickness="" #1}%
- \doifXMLparelse{mfrac}{linethickness}
- {\edef\theXMLpar{\XMLpar{mfrac}{linethickness}{1}}%
- \processaction
- [\theXMLpar]
- [ thin=>\scratchdimen=.2pt,
- medium=>\scratchdimen=.4pt,
- thick=>\scratchdimen=.8pt,
- unknown=>\setdimensionwithunit\scratchdimen{\theXMLpar}{}]%
- {{\firstXMLRelement}\above\scratchdimen{\secondXMLRelement}}}
- {\frac{\firstXMLRelement}{\secondXMLRelement}}}%
- #2}
-
-\remapXMLsequence [ms] [CPA] \MMLpSTRING
-
-\def\MMLpSTRING#1#2%
- {\MMLpTEXT{#1}
- {\getXMLarguments{mstyle}{#1}%
- \getXMLarguments{ms}{lquote="\xmlrent{quot}" rquote="\xmlrent{quot}" #1}%
- \XMLpar{ms}{lquote}{}\ignorespaces#2\unskip\unskip\XMLpar{ms}{rquote}{}}}
-
-\remapXMLsequence [mstyle] [CPA] \MMLpSTYLE
-
-\getXMLarguments
- {mstyle}
- {fontweight="" fontstyle="" mathstyle="" mathvariant="" background="" color=""}
-
-\def\MMLpSTYLE#1#2%
- {\getXMLarguments{mstyle}{#1}#2}
-
-\remapXMLsequence [mtext] [CPA] \MMLpTEXT
-\remapXMLsequence [merror] [CPA] \MMLpERROR
-\remapXMLsequence [mphantom] [CPA] \MMLpPHANTOM
-\remapXMLsequence [mpadded] [CPA] \MMLpPADDED
-
-\def\MMLpTEXT#1#2%
- {\hbox
- {\tf % else encoding problems
- \getXMLarguments{mstyle}{#1}%
- \doMMPpbackground{mstyle}
- {\doMMPpcolor{mstyle}
- {\setMMLptextstyle{mstyle}%
- \ignorespaces#2\unskip\unskip}}}}
-
-\def\setMMLpstyle#1%
- {\doifdefined{MMLpstyle:#1}{\getvalue{MMLpstyle:#1}}}
-
-\def\defineMMLstyle[#1]#2%
- {\setvalue{MMLpstyle:#1}{#2}}
-
-\defineMMLstyle[normal] {\tf} \defineMMLstyle[double-stuck] {\bf}
-\defineMMLstyle[bolditalic] {\bi} \defineMMLstyle[bold-italic] {\bi}
-\defineMMLstyle[boldslanted]{\bs} \defineMMLstyle[bold-slanted] {\bs}
-\defineMMLstyle[boldnormal] {\bf} \defineMMLstyle[bold] {\bf}
-\defineMMLstyle[slanted] {\sl} \defineMMLstyle[normalslanted]{\sl}
-\defineMMLstyle[italic] {\it} \defineMMLstyle[normalitalic] {\it}
-\defineMMLstyle[fraktur] {\bf} \defineMMLstyle[bold-fraktur] {\bf}
-\defineMMLstyle[script] {\tf} \defineMMLstyle[bold-script] {\bf}
-
-% and all kind of other crappy names
-
-\def\setMMLptextstyle#1%
- {\setMMLpstyle{\XMLpar{#1}{fontweight}{}\XMLpar{#1}{fontstyle}{}}}
-
-\def\setMMLpmathstyle#1%
- {\setMMLpstyle{\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\MMLpERROR #1#2{\hbox{$\displaystyle#2$}}
-\def\MMLpPHANTOM#1#2{\phantom{\ignorespaces{}#2\unskip}} % watch spacing {} hack
-\def\MMLpPADDED #1#2{#2}
-
-\remapXMLsequence [mrow] [CPA] \MMLpROW
-
-\def\MMLpROW#1#2{#2}
-
-\remapXMLsequence [msqrt] [CPA] \MMLpSQRT
-\remapXMLsequence [mroot] [CPA] \MMLpROOT
-
-\def\MMLpSQRT#1#2%
- {\sqrt{#2}}
-
-\def\MMLpROOT#1#2%
- {\withnexttwoXMLRelements{\root{\secondXMLRelement}\of{\firstXMLRelement}}#2}
-
-\remapXMLsequence [msup] [CPA] \MMLpSUP
-\remapXMLsequence [msub] [CPA] \MMLpSUB
-
-\setupMMLappearance[scripts][\c!alternative=\v!a]
-
-\def\MMLpSUBP#1#2%
- {\withnexttwoXMLRelements
- {\doifelse\@@MMLscriptsalternative\v!a
- {{\firstXMLRelement}#1{\secondXMLRelement}} % both {} essential
- {\firstXMLRelement#1{\secondXMLRelement}}}%
- #2}
-
-\def\MMLpSUP#1{\MMLpSUBP ^}
-\def\MMLpSUB#1{\MMLpSUBP _}
-
-\remapXMLsequence [msubsup] [CPA] \MMLpSUBSUP
-
-\def\MMLpSUBSUP#1#2%
- {\withnextthreeXMLRelements
- {\firstXMLRelement _{\secondXMLRelement}^{\thirdXMLRelement}}%
- #2}
-
-\remapXMLsequence [mover] [CPA] \MMLpOVER
-\remapXMLsequence [munder] [CPA] \MMLpUNDER
-\remapXMLsequence [munderover] [CPA] \MMLpUNDEROVER
-
-% hack, cannot be nested
-
-\def\MMLpUNDER#1#2{\withnexttwoXMLRelements\doMMLpUNDER#2}
-\def\MMLpOVER #1#2{\withnexttwoXMLRelements\doMMLpOVER #2}
-
-\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}
-
-\def\doMMLpUNDER
- {\mathop{\vtop{\mathsurround\zeropoint\ialign{\hss##\hss\crcr
- \disabledelimiter\doMMLfiller\firstXMLRelement
- \crcr\noalign{\kern3\points\nointerlineskip}%
- \disabledelimiter\doMMLfiller\secondXMLRelement
- \crcr\noalign{\kern3\points}}}}\limits}
-
-\def\doMMLpOVER
- {\mathop{\vbox{\mathsurround\zeropoint\ialign{\hss##\hss\crcr\noalign{\kern3\points}%
- \disabledelimiter\doMMLfiller\secondXMLRelement
- \crcr\noalign{\kern3\points\nointerlineskip}%
- \disabledelimiter\doMMLfiller\firstXMLRelement
- \crcr}}}\limits}
-
-\def\MMLpUNDEROVER#1#2%
- {\withnextthreeXMLRelements
- {\firstXMLRelement
- _{\disablefiller\disabledelimiter\secondXMLRelement}%
- ^{\disablefiller\disabledelimiter\thirdXMLRelement}}#2}
-
-\remapXMLsequence [mtable] [CPA] \MMLpTABLE
-\remapXMLsequence [mtr] [CPA] \MMLpTR
-\remapXMLsequence [mtd] [CPA] \MMLpTD
-\remapXMLsequence [mlabeledtr] [CPA] \MMLpLABELEDTR
-
-\unexpanded\def\@col@amp@{&}
-
-\def\MMLpTR#1#2{\collectbetweenXMLR{\@col@amp@}{#2}\the\XMLRtoks\crcr}
-\def\MMLpTD#1#2{#2}
-
-\def\MMLpLABELEDTR{\MMLpTR}
-
-\def\MMLpTABLEmapper#1#2#3%
- {\doifXMLparelse{mtable}{#1}
- {\newcounter\MMLcounter
- \def\docommand##1%
- {\increment\MMLcounter
- \let\MMLpREMAP\doMMLpREMAP
- \def\MMLsetting{##1}#3% remap list
- \expanded{\setupTABLE[column][\MMLcounter][#2=\MMLsetting]}}%
- \expanded{\processseparatedlist[\XMLpar{mtable}{#1}{}][ ]\noexpand\docommand}}
- {}}
-
-\def\MMLpTABLEmap#1#2#3%
- {\doifXMLparelse{mtbl}{#1}
- {\edef\MMLsetting{\XMLpar{mtbl}{#1}{}}#3% remap list
- \edef\theMMLpTABLEmap{#2=\MMLsetting,\theMMLpTABLEmap}}
- {}}
-
-\def\doMMLpREMAP#1#2%
- {\doif{\MMLsetting}{#1}
- {\def\MMLsetting{#2}%
- \let\MMLpREMAP\gobbletwoarguments}}
-
-\let\MMLpREMAP\doMMLpREMAP
-
-\def\doMMLpTABLE#1#2%
- {\begingroup
- \getXMLarguments{mtable}
- {columnalign="" columnspacing=".25ex" rowspacing=".25ex"
- frame="" color="" background="" #1}%
- \setupTABLE[\c!frame=\v!off]%
- \MMLpTABLEmapper{background}{\c!backgroundcolor}{}%
- \MMLpTABLEmapper{color}{\c!color}{}%
- \MMLpTABLEmapper{frame}{\c!frame}
- {\MMLpREMAP{none}{off}\MMLpREMAP{solid}{on}}%
- \MMLpTABLEmapper{columnalign}{\c!align}
- {\MMLpREMAP{left}{right}%
- \MMLpREMAP{right}{left}%
- \MMLpREMAP{center}{middle}}%
- \setMMLpunit{\XMLpar{mtable}{rowspacing}{}}{.25ex}%
- \let\MMLpTABLEoffset\MMLpunit
- \let\MMLpTR\doMMLpTR
- \let\MMLpTD\doMMLpTD
- \bTABLE[\c!background=\v!color,\c!offset=\MMLpTABLEoffset]#2\eTABLE
- \endgroup}
-
-\def\doMMLpTR#1#2%
- {\doifXMLRchildelse{mtd}{#2}
- {\bTR\ignorespaces#2\unskip\eTR}
- {\bTR\doMMLpTD{#1}{#2}\eTR}}
-
-\def\doMMLpTD#1#2%
- {\getXMLarguments{mtbl}
- {columnalign="" columnspacing="" rowspacing=""
- frame="" color="" background="" #1}%
- \let\theMMLpTABLEmap\empty
- \MMLpTABLEmap{background}{\c!backgroundcolor}{}%
- \MMLpTABLEmap{color}{\c!color}{}%
- \MMLpTABLEmap{frame}{\c!frame}
- {\MMLpREMAP{none}{off}\MMLpREMAP{solid}{on}}%
- \MMLpTABLEmap{columnalign}{\c!align}
- {\MMLpREMAP{left}{right}\MMLpREMAP{right}{left}}%
- \@EA\bTD\@EA[\theMMLpTABLEmap]$\ignorespaces#2\unskip$\eTD}
-
-\setupMMLappearance[mtable][\c!alternative=\v!a]
-
-\def\MMLpTABLE
- {\doifelse\@@MMLmtablealternative\v!a
- {\expandafter\MMLpTABLEa}
- {\expandafter\MMLpTABLEb}}
-
-\def\MMLpTABLEa#1#2%
- {\begingroup
- \doifelsenothing{#1}
- {\global\setfalse\mmlTABLEargs}
- {\global\settrue\mmlTABLEargs}%
- \ifconditional\mmlTABLEargs \else
- \setbox\scratchbox=\hbox
- {$\displaystyle
- \def\MMLpTABLE##1##2%
- {\ifconditional\mmlTABLEargs \else
- \doifelsenothing{##1}{##2}{\global\settrue\mmlTABLEargs}%
- \fi}%
- \let\MMLpTR\MMLpTABLE
- \let\MMLpTD\MMLpTABLE
- #2$}%
- \fi
- \ifconditional\mmlTABLEargs
- \let\MMLpTABLE\doMMLpTABLE
- \def\next{\MMLpTABLE{#1}}%
- \else
- \let\next\matrix
- \fi
- \next{#2}%
- \endgroup}
-
-\let\MMLpTABLEb\doMMLpTABLE
-
-\remapXMLsingular [mspace] [CPA] \MMLpSPACE
-
-\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
- \edefconvertedargument\ascii{#1}%
- \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}
-
-\def\MMLpSPACE#1#2%
- {\getXMLarguments{mspace}{width=".5em" #1}%
- \setMMLpunit{\XMLpar{mspace}{width}{}}{.5em}%
- \hskip\MMLpunit\relax}
-
-
-\remapXMLsingular [mglyph] [CPA] \MMLpGLYPH
-
-\def\MMLpGLYPH#1#2% we assume \definefont usage
- {\getXMLarguments{mglyph}{fontfamily="" index="1" alt="" #1}%
- \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}{}}}}}}
-
-\remapXMLsingular [malignmark] [CPA] \MMLpALIGNMARK
-
-\def\MMLpALIGNMARK#1#2%
- {}
-
-\remapXMLsingular [none] [CPA] \MMLpNONE
-\remapXMLsingular [mprescripts] [CPA] \MMLpMPRESCRIPTS
-\remapXMLsequence [mmultiscripts] [CPA] \MMLpMULTISCRIPTS
-
-\def\MMLpNONE #1#2{}
-\def\MMLpMPRESCRIPTS#1#2{}
-
-\def\MMLpMULTISCRIPTS#1#2%
- {\pushmacro\xmlr
- \let\xmlr\pMULTISCRIPTmmlPRE
- \donefalse \scratchcounter=0 #2\empty
- \let\xmlr\pMULTISCRIPTmmlPOST
- \donetrue \scratchcounter=0 #2\empty
- \popmacro\xmlr}
-
-\def\pMULTISCRIPTmmlPRE#1#2#3#4%
- {\ifdone
- \ifodd\scratchcounter
- _{\naturalxmlr{#1}{#2}{#3}{#4}}%
- \else
- ^{\naturalxmlr{#1}{#2}{#3}{#4}}{}%
- \fi
- \else
- \doif{mprescripts/}{#1}{\donetrue{}}% weak, the / here
- \fi
- \ifdone \advance\scratchcounter \plusone \fi}
-
-\let\pMULTISCRIPTmmlPOST\pMULTISCRIPTmmlPRE
-
-\stopXMLmapping
-
-\protect \endinput
-
-% extra samples
-
-\startXMLdata
-<formula>
- <dmath>
- <mfrac>
- <mrow>
- <mfrac>
- <mrow>
- <mtext>Q</mtext>
- </mrow>
- <mrow>
- <mtext>P</mtext>
- </mrow>
- </mfrac>
- </mrow>
- <mrow>
- <mtext>R</mtext>
- </mrow>
- </mfrac>
- </dmath>
-</formula>
-\stopXMLdata
-
-\startXMLdata
-<formula>
- <dmath>
- <mfrac>
- <mrow>
- <mfrac>
- <mrow>
- <mi mathvariant='normal'>R</mi>
- </mrow>
- <mrow>
- <mi mathvariant='normal'>P</mi>
- </mrow>
- </mfrac>
- </mrow>
- <mrow>
- <mi mathvariant='normal'>R</mi>
- </mrow>
- </mfrac>
- </dmath>
-</formula>
-\stopXMLdata
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-mxa.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-mxa.mkii
deleted file mode 100644
index 5e83367df79..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-mxa.mkii
+++ /dev/null
@@ -1,101 +0,0 @@
-\defineMMLsynonym bkarow rbarr
-\defineMMLsynonym circlearrowleft olarr
-\defineMMLsynonym circlearrowright orarr
-\defineMMLsynonym curvearrowleft cularr
-\defineMMLsynonym curvearrowright curarr
-\defineMMLsynonym dbkarow rBarr
-\defineMMLsynonym DoubleDownArrow dArr
-\defineMMLsynonym DoubleLeftRightArrow hArr
-\defineMMLsynonym DoubleLongLeftArrow xlArr
-\defineMMLsynonym DoubleLongLeftRightArrow xhArr
-\defineMMLsynonym DoubleLongRightArrow xrArr
-\defineMMLsynonym DoubleUpArrow uArr
-\defineMMLsynonym DoubleUpDownArrow vArr
-\defineMMLsynonym Downarrow dArr
-\defineMMLsynonym DownArrowUpArrow duarr
-\defineMMLsynonym downdownarrows ddarr
-\defineMMLsynonym downharpoonleft dharl
-\defineMMLsynonym downharpoonright dharr
-\defineMMLsynonym DownLeftVector lhard
-\defineMMLsynonym DownRightVector rhard
-\defineMMLsynonym drbkarow RBarr
-\defineMMLsynonym Equilibrium rlhar
-\defineMMLsynonym hksearow searhk
-\defineMMLsynonym hkswarow swarhk
-\defineMMLsynonym hookleftarrow larrhk
-\defineMMLsynonym hookrightarrow rarrhk
-\defineMMLsynonym LeftArrowRightArrow lrarr
-\defineMMLsynonym leftarrowtail larrtl
-\defineMMLsynonym LeftDownVector dharl
-\defineMMLsynonym leftharpoondown lhard
-\defineMMLsynonym leftharpoonup lharu
-\defineMMLsynonym leftleftarrows llarr
-\defineMMLsynonym LeftRightArrow harr
-\defineMMLsynonym Leftrightarrow hArr
-\defineMMLsynonym leftrightarrow harr
-\defineMMLsynonym leftrightarrows lrarr
-\defineMMLsynonym leftrightharpoons lrhar
-\defineMMLsynonym leftrightsquigarrow harrw
-\defineMMLsynonym LeftUpVector uharl
-\defineMMLsynonym LeftVector lharu
-\defineMMLsynonym Lleftarrow lAarr
-\defineMMLsynonym LongLeftArrow xlarr
-\defineMMLsynonym Longleftarrow xlArr
-\defineMMLsynonym longleftarrow xlarr
-\defineMMLsynonym LongLeftRightArrow xharr
-\defineMMLsynonym Longleftrightarrow xhArr
-\defineMMLsynonym longleftrightarrow xharr
-\defineMMLsynonym longmapsto xmap
-\defineMMLsynonym LongRightArrow xrarr
-\defineMMLsynonym Longrightarrow xrArr
-\defineMMLsynonym longrightarrow xrarr
-\defineMMLsynonym looparrowleft larrlp
-\defineMMLsynonym looparrowright rarrlp
-\defineMMLsynonym LowerLeftArrow swarr
-\defineMMLsynonym LowerRightArrow searr
-\defineMMLsynonym Lsh lsh
-\defineMMLsynonym mapsto map
-\defineMMLsynonym multimap mumap
-\defineMMLsynonym nearrow nearr
-\defineMMLsynonym nLeftarrow nlArr
-\defineMMLsynonym nleftarrow nlarr
-\defineMMLsynonym nLeftrightarrow nhArr
-\defineMMLsynonym nleftrightarrow nharr
-\defineMMLsynonym nRightarrow nrArr
-\defineMMLsynonym nrightarrow nrarr
-\defineMMLsynonym nwarrow nwarr
-\defineMMLsynonym ReverseEquilibrium lrhar
-\defineMMLsynonym ReverseUpEquilibrium duhar
-\defineMMLsynonym RightArrowLeftArrow rlarr
-\defineMMLsynonym rightarrowtail rarrtl
-\defineMMLsynonym RightDownVector dharr
-\defineMMLsynonym rightharpoondown rhard
-\defineMMLsynonym rightharpoonup rharu
-\defineMMLsynonym rightleftarrows rlarr
-\defineMMLsynonym rightleftharpoons rlhar
-\defineMMLsynonym rightrightarrows rrarr
-\defineMMLsynonym rightsquigarrow rarrw
-\defineMMLsynonym RightTeeArrow map
-\defineMMLsynonym RightUpVector uharr
-\defineMMLsynonym RightVector rharu
-\defineMMLsynonym Rrightarrow rAarr
-\defineMMLsynonym Rsh rsh
-\defineMMLsynonym searrow searr
-\defineMMLsynonym ShortLeftArrow slarr
-\defineMMLsynonym ShortRightArrow srarr
-\defineMMLsynonym swarrow swarr
-\defineMMLsynonym toea nesear
-\defineMMLsynonym tosa seswar
-\defineMMLsynonym twoheadleftarrow Larr
-\defineMMLsynonym twoheadrightarrow Rarr
-\defineMMLsynonym Uparrow uArr
-\defineMMLsynonym UpArrowDownArrow udarr
-\defineMMLsynonym UpDownArrow varr
-\defineMMLsynonym Updownarrow vArr
-\defineMMLsynonym updownarrow varr
-\defineMMLsynonym UpEquilibrium udhar
-\defineMMLsynonym upharpoonleft uharl
-\defineMMLsynonym upharpoonright uharr
-\defineMMLsynonym UpperLeftArrow nwarr
-\defineMMLsynonym UpperRightArrow nearr
-\defineMMLsynonym upuparrows uuarr
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-mxb.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-mxb.mkii
deleted file mode 100644
index c325a9e4493..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-mxb.mkii
+++ /dev/null
@@ -1,55 +0,0 @@
-\defineMMLsynonym ast midast
-\defineMMLsynonym Backslash setmn
-\defineMMLsynonym barwedge barwed
-\defineMMLsynonym bigcap xcap
-\defineMMLsynonym bigcirc xcirc
-\defineMMLsynonym bigcup xcup
-\defineMMLsynonym bigodot xodot
-\defineMMLsynonym bigoplus xoplus
-\defineMMLsynonym bigotimes xotime
-\defineMMLsynonym bigsqcup xsqcup
-\defineMMLsynonym bigtriangledown xdtri
-\defineMMLsynonym bigtriangleup xutri
-\defineMMLsynonym biguplus xuplus
-\defineMMLsynonym bigvee xvee
-\defineMMLsynonym bigwedge xwedge
-\defineMMLsynonym boxminus minusb
-\defineMMLsynonym boxplus plusb
-\defineMMLsynonym boxtimes timesb
-\defineMMLsynonym cdot sdot
-\defineMMLsynonym circledast oast
-\defineMMLsynonym circledcirc ocir
-\defineMMLsynonym circleddash odash
-\defineMMLsynonym CircleDot odot
-\defineMMLsynonym CircleMinus ominus
-\defineMMLsynonym CirclePlus oplus
-\defineMMLsynonym CircleTimes otimes
-\defineMMLsynonym Coproduct coprod
-\defineMMLsynonym curlyvee cuvee
-\defineMMLsynonym curlywedge cuwed
-\defineMMLsynonym ddagger Dagger
-\defineMMLsynonym diamond diam
-\defineMMLsynonym divideontimes divonx
-\defineMMLsynonym dotminus minusd
-\defineMMLsynonym dotplus plusdo
-\defineMMLsynonym dotsquare sdotb
-\defineMMLsynonym doublebarwedge Barwed
-\defineMMLsynonym intercal intcal
-\defineMMLsynonym Intersection xcap
-\defineMMLsynonym intprod iprod
-\defineMMLsynonym leftthreetimes lthree
-\defineMMLsynonym oslash osol
-\defineMMLsynonym rightthreetimes rthree
-\defineMMLsynonym setminus setmn
-\defineMMLsynonym smallsetminus ssetmn
-\defineMMLsynonym SquareIntersection sqcap
-\defineMMLsynonym SquareUnion sqcup
-\defineMMLsynonym Star sstarf
-\defineMMLsynonym star sstarf
-\defineMMLsynonym Sum sum
-\defineMMLsynonym Union xcup
-\defineMMLsynonym UnionPlus uplus
-\defineMMLsynonym Vee xvee
-\defineMMLsynonym VerticalTilde wreath
-\defineMMLsynonym Wedge xwedge
-\defineMMLsynonym wr wreath
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-mxc.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-mxc.mkii
deleted file mode 100644
index e692f2a249b..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-mxc.mkii
+++ /dev/null
@@ -1,10 +0,0 @@
-\defineMMLsynonym LeftCeiling lceil
-\defineMMLsynonym LeftFloor lfloor
-\defineMMLsynonym llcorner dlcorn
-\defineMMLsynonym lmoustache lmoust
-\defineMMLsynonym lrcorner drcorn
-\defineMMLsynonym RightCeiling rceil
-\defineMMLsynonym RightFloor rfloor
-\defineMMLsynonym rmoustache rmoust
-\defineMMLsynonym ulcorner ulcorn
-\defineMMLsynonym urcorner urcorn
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-mxh.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-mxh.mkii
deleted file mode 100644
index 3cf0103c804..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-mxh.mkii
+++ /dev/null
@@ -1,67 +0,0 @@
-\defineMMLsynonym approx ap
-\defineMMLsynonym Because becaus
-\defineMMLsynonym because becaus
-\defineMMLsynonym blacksquare squarf
-\defineMMLsynonym bot bottom
-\defineMMLsynonym circ compfn
-\defineMMLsynonym ClockwiseContourIntegral cwconint
-\defineMMLsynonym Congruent equiv
-\defineMMLsynonym ContourIntegral conint
-\defineMMLsynonym CounterClockwiseContourIntegral awconint
-\defineMMLsynonym Del nabla
-\defineMMLsynonym DoubleContourIntegral Conint
-\defineMMLsynonym DoubleLeftArrow lArr
-\defineMMLsynonym DoubleRightArrow rArr
-\defineMMLsynonym DoubleVerticalBar par
-\defineMMLsynonym DownTee top
-\defineMMLsynonym Element isinv
-\defineMMLsynonym Exists exist
-\defineMMLsynonym ForAll forall
-\defineMMLsynonym geq ge
-\defineMMLsynonym GreaterEqual ge
-\defineMMLsynonym iiiint qint
-\defineMMLsynonym iiint tint
-\defineMMLsynonym Implies rArr
-\defineMMLsynonym in isin
-\defineMMLsynonym Integral int
-\defineMMLsynonym langle lang
-\defineMMLsynonym LeftAngleBracket lang
-\defineMMLsynonym Leftarrow lArr
-\defineMMLsynonym leq le
-\defineMMLsynonym MinusPlus mnplus
-\defineMMLsynonym mp mnplus
-\defineMMLsynonym NotElement notin
-\defineMMLsynonym NotEqual ne
-\defineMMLsynonym NotReverseElement notniva
-\defineMMLsynonym oint conint
-\defineMMLsynonym parallel par
-\defineMMLsynonym PartialD part
-\defineMMLsynonym Proportional prop
-\defineMMLsynonym propto prop
-\defineMMLsynonym rangle rang
-\defineMMLsynonym ReverseElement niv
-\defineMMLsynonym RightAngleBracket rang
-\defineMMLsynonym Rightarrow rArr
-\defineMMLsynonym simeq sime
-\defineMMLsynonym SmallCircle compfn
-\defineMMLsynonym Sqrt radic
-\defineMMLsynonym Subset sub
-\defineMMLsynonym subset sub
-\defineMMLsynonym subseteq sube
-\defineMMLsynonym SubsetEqual sube
-\defineMMLsynonym SuchThat ni
-\defineMMLsynonym Superset sup
-\defineMMLsynonym SupersetEqual supe
-\defineMMLsynonym supset sup
-\defineMMLsynonym supseteq supe
-\defineMMLsynonym Therefore there4
-\defineMMLsynonym therefore there4
-\defineMMLsynonym Tilde sim
-\defineMMLsynonym TildeEqual sime
-\defineMMLsynonym TildeFullEqual cong
-\defineMMLsynonym TildeTilde ap
-\defineMMLsynonym TripleDot tdot
-\defineMMLsynonym UpTee perp
-\defineMMLsynonym vee or
-\defineMMLsynonym Vert Verbar
-\defineMMLsynonym wedge and
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-mxn.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-mxn.mkii
deleted file mode 100644
index 35eeade9a1a..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-mxn.mkii
+++ /dev/null
@@ -1,84 +0,0 @@
-\defineMMLsynonym gnapprox gnap
-\defineMMLsynonym gneq gne
-\defineMMLsynonym gneqq gnE
-\defineMMLsynonym gvertneqq gvnE
-\defineMMLsynonym lnapprox lnap
-\defineMMLsynonym lneq lne
-\defineMMLsynonym lneqq lnE
-\defineMMLsynonym lvertneqq lvnE
-\defineMMLsynonym napprox nap
-\defineMMLsynonym ngeq nge
-\defineMMLsynonym ngeqq ngE
-\defineMMLsynonym ngeqslant nges
-\defineMMLsynonym ngtr ngt
-\defineMMLsynonym nleq nle
-\defineMMLsynonym nleqq nlE
-\defineMMLsynonym nleqslant nles
-\defineMMLsynonym nless nlt
-\defineMMLsynonym NotCongruent nequiv
-\defineMMLsynonym NotDoubleVerticalBar npar
-\defineMMLsynonym NotGreater ngt
-\defineMMLsynonym NotGreaterEqual nge
-\defineMMLsynonym NotGreaterFullEqual ngE
-\defineMMLsynonym NotGreaterGreater nGtv
-\defineMMLsynonym NotGreaterLess ntvgl
-\defineMMLsynonym NotGreaterSlantEqual nges
-\defineMMLsynonym NotGreaterTilde ngsim
-\defineMMLsynonym NotLeftTriangle nltri
-\defineMMLsynonym NotLeftTriangleEqual nltrie
-\defineMMLsynonym NotLess nlt
-\defineMMLsynonym NotLessEqual nle
-\defineMMLsynonym NotLessFullEqual nlE
-\defineMMLsynonym NotLessGreater ntvlg
-\defineMMLsynonym NotLessLess nLtv
-\defineMMLsynonym NotLessSlantEqual nles
-\defineMMLsynonym NotLessTilde nlsim
-\defineMMLsynonym NotPrecedes npr
-\defineMMLsynonym NotPrecedesEqual npre
-\defineMMLsynonym NotPrecedesSlantEqual nprcue
-\defineMMLsynonym NotRightTriangle nrtri
-\defineMMLsynonym NotRightTriangleEqual nrtrie
-\defineMMLsynonym NotSquareSubsetEqual nsqsube
-\defineMMLsynonym NotSquareSupersetEqual nsqsupe
-\defineMMLsynonym NotSubset vnsub
-\defineMMLsynonym NotSucceeds nsc
-\defineMMLsynonym NotSucceedsEqual nsce
-\defineMMLsynonym NotSucceedsSlantEqual nsccue
-\defineMMLsynonym NotSuperset vnsup
-\defineMMLsynonym NotTilde nsim
-\defineMMLsynonym NotTildeEqual nsime
-\defineMMLsynonym NotTildeFullEqual ncong
-\defineMMLsynonym NotTildeTilde nap
-\defineMMLsynonym NotVerticalBar nmid
-\defineMMLsynonym nparallel npar
-\defineMMLsynonym nprec npr
-\defineMMLsynonym npreceq npre
-\defineMMLsynonym nshortmid nsmid
-\defineMMLsynonym nshortparallel nspar
-\defineMMLsynonym nsimeq nsime
-\defineMMLsynonym nsubset vnsub
-\defineMMLsynonym nsubseteq nsube
-\defineMMLsynonym nsubseteqq nsubE
-\defineMMLsynonym nsucc nsc
-\defineMMLsynonym nsucceq nsce
-\defineMMLsynonym nsupset vnsup
-\defineMMLsynonym nsupseteq nsupe
-\defineMMLsynonym nsupseteqq nsupE
-\defineMMLsynonym ntriangleleft nltri
-\defineMMLsynonym ntrianglelefteq nltrie
-\defineMMLsynonym ntriangleright nrtri
-\defineMMLsynonym ntrianglerighteq nrtrie
-\defineMMLsynonym precnapprox prnap
-\defineMMLsynonym precneqq prnE
-\defineMMLsynonym precnsim prnsim
-\defineMMLsynonym subsetneq subne
-\defineMMLsynonym subsetneqq subnE
-\defineMMLsynonym succnapprox scnap
-\defineMMLsynonym succneqq scnE
-\defineMMLsynonym succnsim scnsim
-\defineMMLsynonym supsetneq supne
-\defineMMLsynonym supsetneqq supnE
-\defineMMLsynonym varsubsetneq vsubne
-\defineMMLsynonym varsubsetneqq vsubnE
-\defineMMLsynonym varsupsetneq vsupne
-\defineMMLsynonym varsupsetneqq vsupnE
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-mxo.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-mxo.mkii
deleted file mode 100644
index 045b4f40696..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-mxo.mkii
+++ /dev/null
@@ -1,14 +0,0 @@
-\defineMMLsynonym angle ang
-\defineMMLsynonym backprime bprime
-\defineMMLsynonym circledS oS
-\defineMMLsynonym complement comp
-\defineMMLsynonym emptyset empty
-\defineMMLsynonym hbar plank
-\defineMMLsynonym hslash plankv
-\defineMMLsynonym Im image
-\defineMMLsynonym measuredangle angmsd
-\defineMMLsynonym nexists nexist
-\defineMMLsynonym NotExists nexist
-\defineMMLsynonym Re real
-\defineMMLsynonym varnothing emptyv
-\defineMMLsynonym wp weierp
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-mxr.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-mxr.mkii
deleted file mode 100644
index ed1498f8137..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-mxr.mkii
+++ /dev/null
@@ -1,112 +0,0 @@
-\defineMMLsynonym approxeq ape
-\defineMMLsynonym backcong bcong
-\defineMMLsynonym backepsilon bepsi
-\defineMMLsynonym backsim bsim
-\defineMMLsynonym backsimeq bsime
-\defineMMLsynonym between twixt
-\defineMMLsynonym Bumpeq bump
-\defineMMLsynonym bumpeq bumpe
-\defineMMLsynonym circeq cire
-\defineMMLsynonym coloneq colone
-\defineMMLsynonym Cup smile
-\defineMMLsynonym CupCap asymp
-\defineMMLsynonym curlyeqprec cuepr
-\defineMMLsynonym curlyeqsucc cuesc
-\defineMMLsynonym ddotseq eDDot
-\defineMMLsynonym doteq esdot
-\defineMMLsynonym doteqdot eDot
-\defineMMLsynonym DotEqual esdot
-\defineMMLsynonym DoubleRightTee vDash
-\defineMMLsynonym eqcirc ecir
-\defineMMLsynonym eqcolon ecolon
-\defineMMLsynonym eqsim esim
-\defineMMLsynonym eqslantgtr egs
-\defineMMLsynonym eqslantless els
-\defineMMLsynonym EqualTilde esim
-\defineMMLsynonym fallingdotseq efDot
-\defineMMLsynonym geqq gE
-\defineMMLsynonym geqslant ges
-\defineMMLsynonym gg Gt
-\defineMMLsynonym ggg Gg
-\defineMMLsynonym GreaterEqualLess gel
-\defineMMLsynonym GreaterFullEqual gE
-\defineMMLsynonym GreaterLess gl
-\defineMMLsynonym GreaterSlantEqual ges
-\defineMMLsynonym GreaterTilde gsim
-\defineMMLsynonym gtrapprox gap
-\defineMMLsynonym gtrdot gtdot
-\defineMMLsynonym gtreqless gel
-\defineMMLsynonym gtreqqless gEl
-\defineMMLsynonym gtrless gl
-\defineMMLsynonym gtrsim gsim
-\defineMMLsynonym HumpDownHump bump
-\defineMMLsynonym HumpEqual bumpe
-\defineMMLsynonym LeftTee dashv
-\defineMMLsynonym LeftTriangle vltri
-\defineMMLsynonym LeftTriangleEqual ltrie
-\defineMMLsynonym leqq lE
-\defineMMLsynonym leqslant les
-\defineMMLsynonym lessapprox lap
-\defineMMLsynonym lessdot ltdot
-\defineMMLsynonym lesseqgtr leg
-\defineMMLsynonym lesseqqgtr lEg
-\defineMMLsynonym LessEqualGreater leg
-\defineMMLsynonym LessFullEqual lE
-\defineMMLsynonym LessGreater lg
-\defineMMLsynonym lessgtr lg
-\defineMMLsynonym lesssim lsim
-\defineMMLsynonym LessSlantEqual les
-\defineMMLsynonym LessTilde lsim
-\defineMMLsynonym ll Lt
-\defineMMLsynonym NestedGreaterGreater Gt
-\defineMMLsynonym NestedLessLess Lt
-\defineMMLsynonym pitchfork fork
-\defineMMLsynonym prec pr
-\defineMMLsynonym precapprox prap
-\defineMMLsynonym preccurlyeq prcue
-\defineMMLsynonym Precedes pr
-\defineMMLsynonym PrecedesEqual pre
-\defineMMLsynonym PrecedesSlantEqual prcue
-\defineMMLsynonym PrecedesTilde prsim
-\defineMMLsynonym preceq pre
-\defineMMLsynonym precsim prsim
-\defineMMLsynonym Proportion Colon
-\defineMMLsynonym questeq equest
-\defineMMLsynonym RightTee vdash
-\defineMMLsynonym RightTriangle vrtri
-\defineMMLsynonym RightTriangleEqual rtrie
-\defineMMLsynonym risingdotseq erDot
-\defineMMLsynonym shortmid smid
-\defineMMLsynonym shortparallel spar
-\defineMMLsynonym smallfrown sfrown
-\defineMMLsynonym smallsmile ssmile
-\defineMMLsynonym sqsubset sqsub
-\defineMMLsynonym sqsubseteq sqsube
-\defineMMLsynonym sqsupset sqsup
-\defineMMLsynonym sqsupseteq sqsupe
-\defineMMLsynonym SquareSubset sqsub
-\defineMMLsynonym SquareSubsetEqual sqsube
-\defineMMLsynonym SquareSuperset sqsup
-\defineMMLsynonym SquareSupersetEqual sqsupe
-\defineMMLsynonym Subset Sub
-\defineMMLsynonym subseteqq subE
-\defineMMLsynonym succ sc
-\defineMMLsynonym succapprox scap
-\defineMMLsynonym succcurlyeq sccue
-\defineMMLsynonym Succeeds sc
-\defineMMLsynonym SucceedsEqual sce
-\defineMMLsynonym SucceedsSlantEqual sccue
-\defineMMLsynonym SucceedsTilde scsim
-\defineMMLsynonym succeq sce
-\defineMMLsynonym succsim scsim
-\defineMMLsynonym Supset Sup
-\defineMMLsynonym supseteqq supE
-\defineMMLsynonym thickapprox thkap
-\defineMMLsynonym thicksim thksim
-\defineMMLsynonym trianglelefteq ltrie
-\defineMMLsynonym triangleq trie
-\defineMMLsynonym trianglerighteq rtrie
-\defineMMLsynonym varpropto vprop
-\defineMMLsynonym vartriangleleft vltri
-\defineMMLsynonym vartriangleright vrtri
-\defineMMLsynonym VerticalBar mid
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-pml.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-pml.mkii
deleted file mode 100644
index a0930b63428..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-pml.mkii
+++ /dev/null
@@ -1,85 +0,0 @@
-%D \module
-%D [ file=xtag-pml,
-%D version=2001.09.04,
-%D title=\CONTEXT\ XML Support,
-%D subtitle=Physics ML,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 / PhysML}
-
-%D This is a reimplmentation of the old filter. This module
-%D runs on top of the mathml and units modules.
-
-\useXMLfilter[map]
-\useXMLfilter[mml,mmp,mmc]
-
-\defineXMLargument [phys] \doXMLphys
-\defineXMLargument [iphys] \doXMLiphys
-\defineXMLargument [dphys] \doXMLdphys
-
-\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
-
-\doifnotmode{demo}{\endinput}
-
-\usemodule[units]
-
-\starttext
-
-\startXMLdata
-<phys>
- <apply> <times/>
- <cn> 10 </cn>
- <ci><unit><Milli/><Sec/><Per/><Square/><Kilo/><Meter/></unit> </ci>
- </apply>
-</phys>
-\stopXMLdata
-
-\startXMLdata
-<phys>
- <apply> <divide/>
- <cn> 10 </cn>
- <ci> <unit><Unit/><Milli/><Sec/><Per/><Square/><Kilo/><Meter/></unit> </ci>
- </apply>
-</phys>
-\stopXMLdata
-
-\startXMLdata
-<phys>
- <apply> <times/>
- <cn> 10 </cn>
- <ci> <unit> <Milli/> <Sec/> <Per/> <Square/> <Kilo/> <Meter/> </unit> </ci>
- </apply>
-</phys>
-\stopXMLdata
-
-\startXMLdata
-<phys>
- <apply> <times/>
- <cn> 10 </cn>
- <ci> <unit><Milli/><Sec/><Per/><Square/><Kilo/><Meter/></unit> </ci>
- </apply>
-</phys>
-\stopXMLdata
-
-\startXMLdata
-<phys>
- <apply> <times/>
- <cn> 10 </cn>
- <ci> <unit> <Milli/> <Sec/> <Per/> <Square/> <Kilo/> <Meter/> </unit> </ci>
- </apply>
-</phys>
-\stopXMLdata
-
-\stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-pmu.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-pmu.mkii
deleted file mode 100644
index 5c7c9a8f61a..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-pmu.mkii
+++ /dev/null
@@ -1,188 +0,0 @@
-%D \module
-%D [ file=xtag-pmu,
-%D version=2001.06.10,
-%D title=\CONTEXT\ XML Macros,
-%D subtitle=Units,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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}
-
-%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
-
-\defineXMLsingular [unitmeaning] [label=] \doPMLunitmeaning
-
-\def\doPMLunitmeaning
- {\expanded{\unitmeaning{\XMLop{label}}}}
-
-\startXMLmapping [mml]
-
-\remapXMLsequence [unit] [CPA] \doPMLuseq
-\remapXMLsingular [unit] [CPA] \doPMLunit % #2\empty
-\remapXMLsequence [cunseq] [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\handlePMLunit#1{\ifPMLunit\ignorespaces#1\fi\ignorespaces}
-
-%D All unit commands are remapped in a similar way.
-
-\remapXMLsingular [Atto] [C] {\handlePMLunit\Atto}
-\remapXMLsingular [Femto] [C] {\handlePMLunit\Femto}
-\remapXMLsingular [Pico] [C] {\handlePMLunit\Pico}
-\remapXMLsingular [Nano] [C] {\handlePMLunit\Nano}
-\remapXMLsingular [Micro] [C] {\handlePMLunit\Micro}
-\remapXMLsingular [Milli] [C] {\handlePMLunit\Milli}
-\remapXMLsingular [Centi] [C] {\handlePMLunit\Centi}
-\remapXMLsingular [Deci] [C] {\handlePMLunit\Deci}
-\remapXMLsingular [Hecto] [C] {\handlePMLunit\Hecto}
-\remapXMLsingular [Kilo] [C] {\handlePMLunit\Kilo}
-\remapXMLsingular [Mega] [C] {\handlePMLunit\Mega}
-\remapXMLsingular [Giga] [C] {\handlePMLunit\Giga}
-\remapXMLsingular [Terra] [C] {\handlePMLunit\Terra}
-\remapXMLsingular [Peta] [C] {\handlePMLunit\Peta}
-\remapXMLsingular [Exa] [C] {\handlePMLunit\Exa}
-
-\remapXMLsingular [Times] [C] {\handlePMLunit\Times}
-\remapXMLsingular [Solidus] [C] {\handlePMLunit\Solidus}
-\remapXMLsingular [Per] [C] {\handlePMLunit\Per}
-\remapXMLsingular [OutOf] [C] {\handlePMLunit\OutOf}
-
-\remapXMLsingular [Linear] [C] {\handlePMLunit\Linear}
-\remapXMLsingular [Square] [C] {\handlePMLunit\Square}
-\remapXMLsingular [Cubic] [C] {\handlePMLunit\Cubic}
-
-\remapXMLsingular [Inverse] [C] {\handlePMLunit\Inverse}
-
-\remapXMLsingular [Degrees] [C] {\handlePMLunit\Degrees}
-\remapXMLsingular [Meter] [C] {\handlePMLunit\Meter}
-\remapXMLsingular [Liter] [C] {\handlePMLunit\Liter}
-\remapXMLsingular [Sec] [C] {\handlePMLunit\Sec}
-\remapXMLsingular [Year] [C] {\handlePMLunit\Year}
-\remapXMLsingular [Month] [C] {\handlePMLunit\Month}
-\remapXMLsingular [Week] [C] {\handlePMLunit\Week}
-\remapXMLsingular [Day] [C] {\handlePMLunit\Day}
-\remapXMLsingular [Hour] [C] {\handlePMLunit\Hour}
-\remapXMLsingular [Min] [C] {\handlePMLunit\Min}
-\remapXMLsingular [Second] [C] {\handlePMLunit\Sec}
-\remapXMLsingular [Rad] [C] {\handlePMLunit\Rad}
-\remapXMLsingular [Deg] [C] {\handlePMLunit\Deg}
-\remapXMLsingular [Hertz] [C] {\handlePMLunit\Hertz}
-\remapXMLsingular [RevPerSec] [C] {\handlePMLunit\RevPerSec}
-\remapXMLsingular [RevPerMin] [C] {\handlePMLunit\RevPerMin}
-\remapXMLsingular [Gram] [C] {\handlePMLunit\Gram}
-\remapXMLsingular [Atom] [C] {\handlePMLunit\Atom}
-\remapXMLsingular [Newton] [C] {\handlePMLunit\Newton}
-\remapXMLsingular [Pascal] [C] {\handlePMLunit\Pascal}
-\remapXMLsingular [Joule] [C] {\handlePMLunit\Joule}
-\remapXMLsingular [Watt] [C] {\handlePMLunit\Watt}
-\remapXMLsingular [Celsius] [C] {\handlePMLunit\Celsius}
-\remapXMLsingular [Kelvin] [C] {\handlePMLunit\Kelvin}
-\remapXMLsingular [Fahrenheit] [C] {\handlePMLunit\Fahrenheit}
-\remapXMLsingular [Mol] [C] {\handlePMLunit\Mol}
-\remapXMLsingular [Molair] [C] {\handlePMLunit\Molair}
-\remapXMLsingular [Equivalent] [C] {\handlePMLunit\Equivalent}
-\remapXMLsingular [Farad] [C] {\handlePMLunit\Farad}
-\remapXMLsingular [Ohm] [C] {\handlePMLunit\Ohm}
-\remapXMLsingular [Siemens] [C] {\handlePMLunit\Siemens}
-\remapXMLsingular [Ampere] [C] {\handlePMLunit\Ampere}
-\remapXMLsingular [Coulomb] [C] {\handlePMLunit\Coulomb}
-\remapXMLsingular [Volt] [C] {\handlePMLunit\Volt}
-\remapXMLsingular [eVolt] [C] {\handlePMLunit\eVolt}
-\remapXMLsingular [Tesla] [C] {\handlePMLunit\Tesla}
-\remapXMLsingular [VoltAC] [C] {\handlePMLunit\VoltAC}
-\remapXMLsingular [VoltDC] [C] {\handlePMLunit\VoltDC}
-\remapXMLsingular [Baud] [C] {\handlePMLunit\Baud}
-\remapXMLsingular [Bit] [C] {\handlePMLunit\Bit}
-\remapXMLsingular [Byte] [C] {\handlePMLunit\Byte}
-\remapXMLsingular [Bequerel] [C] {\handlePMLunit\Bequerel}
-\remapXMLsingular [Sievert] [C] {\handlePMLunit\Sievert}
-\remapXMLsingular [Candela] [C] {\handlePMLunit\Candela}
-\remapXMLsingular [Bell] [C] {\handlePMLunit\Bell}
-\remapXMLsingular [At] [C] {\handlePMLunit\At}
-\remapXMLsingular [Atm] [C] {\handlePMLunit\Atm}
-\remapXMLsingular [Bar] [C] {\handlePMLunit\Bar}
-\remapXMLsingular [EVolt] [C] {\handlePMLunit\EVolt}
-\remapXMLsingular [Foot] [C] {\handlePMLunit\Foot}
-\remapXMLsingular [Inch] [C] {\handlePMLunit\Inch}
-\remapXMLsingular [Cal] [C] {\handlePMLunit\Cal}
-\remapXMLsingular [Force] [C] {\handlePMLunit\Force}
-\remapXMLsingular [Lux] [C] {\handlePMLunit\Lux}
-\remapXMLsingular [Gray] [C] {\handlePMLunit\Gray}
-\remapXMLsingular [Weber] [C] {\handlePMLunit\Weber}
-\remapXMLsingular [Henry] [C] {\handlePMLunit\Henry}
-\remapXMLsingular [Sterant] [C] {\handlePMLunit\Sterant}
-\remapXMLsingular [Angstrom] [C] {\handlePMLunit\Angstrom}
-\remapXMLsingular [Gauss] [C] {\handlePMLunit\Gauss}
-
-\remapXMLsingular [Percent] [C] {\handlePMLunit\Percent}
-\remapXMLsingular [Promille] [C] {\handlePMLunit\Promille}
-\remapXMLsingular [Permille] [C] {\handlePMLunit\Permille}
-
-\remapXMLsingular [Unit] [C] {\handlePMLunit\Unit}
-\remapXMLsingular [NoUnit] [C] {\handlePMLunit\NoUnit}
-
-\stopXMLmapping
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-pre.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-pre.mkii
deleted file mode 100644
index 5e75197b76b..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-pre.mkii
+++ /dev/null
@@ -1,448 +0,0 @@
-%D \module
-%D [ file=xtag-pre,
-%D version=2000.12.20,
-%D title=\CONTEXT\ XML Macros,
-%D subtitle=Predefined Things,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 / Predefined}
-
-%D Here we predefine some escapes, processing instructions,
-%D entities and other handy things.
-
-\unprotect
-
-%D For \MKIV:
-
-\setvalue{@u@s@"}#1#2"{#2} \setvalue{@g@s@"}#1#2"{\scratchtoks{#2}}
-\setvalue{@u@s@'}#1#2'{#2} \setvalue{@g@s@'}#1#2'{\scratchtoks{#2}}
-\setvalue{@u@s@ }#1#2 {#2} \setvalue{@g@s@ }#1#2 {\scratchtoks{#2}}
-
-\def\unstringed#1{\csname\ifcsname @u@s@#1\endcsname @u@s@#1\else\s!empty\fi\endcsname#1}
-\def\grabstring#1{\csname\ifcsname @g@s@#1\endcsname @g@s@#1\else\s!empty\fi\endcsname#1}
-
-\def\dowithgrabbedstring#1%
- {\def\@@dowithgrabbedstring{#1}%
- \afterassignment\@@dowithgrabbedstring\grabstring}
-
-%D Let's get rid of ligatures:
-
-% \definefonthandling [default] [noligs]
-
-%D First we define the default error handler. When tracing is
-%D activated, the unknown element is showed verbatim.
-
-\defineXMLenvironment [\s!default] \defaultXMLelement \defaultXMLelement
-\defineXMLsingular [\s!default] \defaultXMLelement
-
-% \def\defaultXMLelement
-% {\iftraceXMLelements[\currentXMLfullidentifier]\fi}
-
-\def\defaultXMLelement
- {\iftraceXMLelements{\infofont<\currentXMLfullidentifier>}\fi}
-
-%D We can use the default handler to implement automatic
-%D element hiding. Beware: this overloads the tracer.
-
-% \def\startXMLignore{\dododefineXMLignore \s!default}
-% \def\stopXMLignore {\dododefineXMLprocess\s!default}
-
-\newcount\xmlignoredepth
-
-\def\startXMLignore{\ifcase\xmlignoredepth\dododefineXMLignore\s!default\fi\advance\xmlignoredepth\plusone}
-\def\stopXMLignore {\advance\xmlignoredepth\minusone\ifcase\xmlignoredepth\dododefineXMLprocess\s!default\fi}
-
-%D The following entities need to be defined anyway. They
-%D may be overloaded later.
-
-% rest also \letter
-
-\defineXMLentities [amp] {\letterampersand} {\&}
-\defineXMLentities [gt] {\string>} {\mathematics{>}}
-\defineXMLentities [lt] {\string<} {\mathematics{<}}
-\defineXMLentities [quot] {\string"} {\mathematics{"}}
-\defineXMLentities [apos] {\string`} {\mathematics{'}}
-
-%D Of course we define:
-
-\defineXMLentities [tex] {tex} {\TeX}
-\defineXMLentities [context] {context} {\ConTeXt}
-\defineXMLentities [xml] {xml} {XML}
-\defineXMLentities [xsd] {xsd} {XSD}
-\defineXMLentities [html] {html} {HTML}
-
-%D The following entities are used for internal purposes and
-%D concern characters that are kind of problematic in \TEX\
-%D input.
-
-\defineXMLentities [tex-hash] {\letterhash} {\#}
-\defineXMLentities [tex-dollar] {\letterdollar} {\$}
-\defineXMLentities [tex-percent] {\letterpercent} {\%}
-\defineXMLentities [tex-backslash] {\letterbackslash} {\texescape}
-\defineXMLentities [tex-hat] {\letterhat} {\^{}}
-\defineXMLentities [tex-underscore] {\letterunderscore} {\_}
-\defineXMLentities [tex-leftbrace] {\letterleftbrace} {\leftargument}
-\defineXMLentities [tex-rightbrace] {\letterrightbrace} {\rightargument}
-\defineXMLentities [tex-bar] {\letterbar} {\vl}
-\defineXMLentities [tex-tilde] {\lettertilde} {\~{}}
-
-%D Some pretty printing macros will use color, for which we
-%D define a dedicated palet here.
-
-\definepalet
- [xtag]
- [0=darkgray, 1=darkred, 2=darkgreen,
- 3=darkblue, 4=darkcyan, 5=darkmagenta,
- 6=darkyellow, 7=black, 8=black]
-
-%D An example of its usage can be found in the pretty
-%D printing macros in the run time module.
-
-\newif\ifautoXMLshow \autoXMLshowtrue
-\newif\ifshowXMLarguments \showXMLargumentstrue
-
-\def\setupXMLfile{\dodoubleargument\getparameters[\??xf]}
-
-\setupXMLfile
- [\c!inbetween=\blank,
- \c!level=1]
-
-\fetchruntimecommand\showXMLfile {\f!xtagprefix\s!run}
-\fetchruntimecommand\showXMLbuffer{\f!xtagprefix\s!run}
-\fetchruntimecommand\showXMLtext {\f!xtagprefix\s!run}
-
-\fetchruntimecommand\showXMLign {\f!xtagprefix\s!run}
-\fetchruntimecommand\showXMLnop {\f!xtagprefix\s!run}
-\fetchruntimecommand\showXMLtxt {\f!xtagprefix\s!run}
-\fetchruntimecommand\showXMLpar {\f!xtagprefix\s!run}
-\fetchruntimecommand\showXMLlin {\f!xtagprefix\s!run}
-\fetchruntimecommand\showXMLwrd {\f!xtagprefix\s!run}
-\fetchruntimecommand\showXMLemp {\f!xtagprefix\s!run}
-
-\fetchruntimecommand\showXMLbreak {\f!xtagprefix\s!run}
-
-%D By default, we will ignore escape commands, preceded by
-%D \type {<!} and ending in (presumably) a \type {>}.
-
-\defineXMLescape [\s!default] {\gobbleuntil{>}}
-
-%D The comment escape has the form:
-%D
-%D \starttyping
-%D <!-- a couple of remarks -->
-%D \stoptyping
-
-\defineXMLescape [--] {\gobbleuntil{-->}}
-
-%D The \type {CDATA} escape is kind of unique in its
-%D strange syntax.
-%D
-%D \starttyping
-%D <!CDATA[it starts here
-%D whatever you like to be shown verbatim
-%D and ends here]]>
-%D \stoptyping
-%D
-%D Watch this rather obscure definition (we need to pass an
-%D \type {[} to the macro.
-
-\chardef\XMLcdatamethod=1
-
-\newtoks \everyXMLcdata % \appendtoks \tt \to \everyXMLcdata
-
-\setvalue{XMLcdatamethod1}%
- {\skipfirstverbatimlinefalse
- \processtaggeddisplayverbatim{]]>}}
-
-\setvalue{XMLcdatamethod2}%
- {\begingroup
- \obeylines
- \obeyspaces
- \the\everyXMLcdata
- \processXMLcdata}
-
-\long\def\processXMLcdata#1]]>%
- {#1\endgroup}
-
-\defineXMLescape [CDATA]
- {\executeifdefined{XMLcdatamethod\number\XMLcdatamethod}{\begingroup\processXMLcdata}}
-
-%D \starttyping
-%D <!ELEMENT ...">
-%D <!ATTLIST ...">
-%D \stoptyping
-
-\defineXMLescape [ATTLIST]{\gobbleuntil>}
-\defineXMLescape [ELEMENT]{\gobbleuntil>}
-
-%D \starttyping
-%D <!ENTITY crap "very new [&#x7B;] crap">
-%D <!ENTITY crap SYSTEM "crapfile.xml">
-%D <!ENTITY crap SYSTEM "crapfile.pdf" NDATA ignoredanyway>
-%D \stoptyping
-
-\defineXMLescape [ENTITY] \handleXMLentityescape
-
-\def\handleXMLentityescape#1>%
- {\dohandleXMLentityescape#1 @ @ @ @ @ @>}
-
-\def\dohandleXMLentityescape#1 #2 #3 #4>
- {\doifnot{#1}\letterpercent
- {\doifelse{#2}{SYSTEM}
- {\dohandleXMLentitySYSTEM#1 #2 #3 #4>}
- {\dohandleXMLentityDEFINE#1 #2 #3 #4>}}}
-
-\def\dohandleXMLentitySYSTEM#1 #2 #3 #4 #5 #6>% name SYSTEM ....
- {\doifelse{#4}{@}
- {\expanded{\defineXMLentity[#1]{\noexpand\readXMLsystem{\unstringed#3}}}}
- {\doif{#4}{NDATA} % maybe we should also store the NDATA
- {\expanded{\defineXMLentity[#1]{\noexpand\readXMLndata{\unstringed#3}}}}}}
-
-\def\readXMLsystem#1%
- {\readfile{#1}
- {\writestatus{xml-system}{reading #1}}
- {\writestatus{xml-system}{unable to locate #1}}}
-
-\def\readXMLndata#1%
- {#1} % {\externalfigure[#1]}
-
-\def\dohandleXMLentityDEFINE#1 %#2 #3 #4 #5 #6>% name replacement
- {\def\docommand##1>{\expanded{\defineXMLentity[#1]{\the\scratchtoks}}}%
- \afterassignment\docommand\grabstring}
-
-%D Such entities can be encapsulated in a \type {DOCTYPE}
-%D element. Therefore we remove the outer level of document
-%D type definitions.
-%D
-%D \starttyping
-%D <!DOCTYPE Something>
-%D <!DOCTYPE Something >
-%D <!DOCTYPE Something [ ... ]>
-%D <!DOCTYPE Something SYSTEM "... ...">
-%D <!DOCTYPE Something SYSTEM "... ..." >
-%D <!DOCTYPE Something SYSTEM "... ..." [ ... ]>
-%D <!DOCTYPE Something PUBLIC "... ..." "...">
-%D <!DOCTYPE Something PUBLIC "... ..." "..." >
-%D <!DOCTYPE Something PUBLIC "... ..." "..." [ ... ]>
-%D \stoptyping
-
-\defineXMLescape [DOCTYPE] \handleXMLdoctype
-
-\def\handleXMLdoctype
- {\let\XMLdoctype\empty
- \dohandleXMLdoctype}
-
-\def\dohandleXMLdoctype
- {\futurelet\nexttoken\dohandleXMLdoctok}
-
-\def\dohandleXMLdoctok
- {\ifx\nexttoken>%
- % [doctype: \XMLdoctype]
- \@EA\gobbleuntil\@EA>%
- \else\ifx\nexttoken\blankspace
- % [doctype: \XMLdoctype]
- \@EAEAEA\dodohandleXMLdoctype
- \else
- \@EAEAEA\redoXMLdoctype
- \fi\fi}
-
-\def\redoXMLdoctype#1%
- {\edef\XMLdoctype{\XMLdoctype#1}\dohandleXMLdoctype}
-
-\def\dodohandleXMLdoctype#1%
- {\executeifdefined{XMLdoctype#1}{\gobbleuntil>}}
-
-\setvalue{XMLdoctype>}{}
-\setvalue{XMLdoctype[}{\processuntil{]>}} % or \gobbleuntil{]>}}
-
-\def\XMLdoctypeS YSTEM %
- {\dowithgrabbedstring\dodohandleXMLdoctype}
-
-\def\XMLdoctypeP UBLIC %
- {\dowithgrabbedstring{\dowithgrabbedstring\dodohandleXMLdoctype}}
-
-% wrong
-%
-% \def\XMLdoctypeS YSTEM {\XMLgrabstring}
-% \def\XMLdoctypeP UBLIC {\XMLgrabstring}
-%
-% \def\XMLgrabstring
-% {\doifnextcharelse>{\gobbleuntil>}{\dowithgrabbedstring\XMLgrabstring}}
-
-%D Some day we may need to support entities within a
-%D document type namespace.
-
-%D As an example of processing instructions, we implement a
-%D \CONTEXT\ code handler:
-
-\defineXMLprocessor [context] \contextXMLcommand
-\defineXMLprocessor [context-command] \contextXMLcommand
-
-% we need to get rid of the endlinechar inserted by \scantokens
-%
-% \def\saveendlinechar%
-% {\ifx\restoreendlinechar\undefined
-% \edef\restoreendlinechar{\endlinechar\the\endlinechar\space}%
-% \fi
-% \endlinechar=-1 }
-%
-% \def\scanXMLtokens#1%
-% {\saveendlinechar\scantokens{#1}\restoreendlinechar}
-
-%D For security reasons, we provide a switch to turn this
-%D mechanism on and off. When turned off, there is no way to
-%D turn it on from within an \XML\ encoded document, simply
-%D because the possibility to process \CONTEXT\ commands is
-%D gone.
-
-\setupXMLprocessing[\c!command=\v!yes]
-
-%\def\contextXMLcommand#1%
-% {\doif\@@xpcommando\v!ja
-% {\pushmacro\disableXML
-% \def\disableXML{\global\let\afterXMLprocessor\empty}%
-% \global\let\afterXMLprocessor\enableXML
-% \setnormalcatcodes\scantokens{#1}\afterXMLprocessor
-% \popmacro\disableXML}}
-
-\def\contextXMLcommand#1% we don't use #1 here
- {\doif\@@xpcommand\v!yes
- {\disableXML\scantokens\@EA{\currentXMLprocess}\enableXML}}
-
-%D The indirect method (using the macro \type
-%D {\currentXMLprocess} instead of \type {#}) is needed
-%D because of the \type {\scantokens}. Given the previous
-%D definition, and given that \ETEX\ is used, we can now
-%D say:
-%D
-%D \starttyping
-%D <?context-command {\bf Start Of Some \TeX\ Text} ?>
-%D \stoptyping
-%D
-%D A non||\ETEX\ solution is also possible, using buffers,
-%D but for the moment we assume that \ETEX\ is used.
-
-%D Next we implement a general purpose directive. This one
-%D can be used to set variables that can be accessed with
-%D \type {\XMLvar}.
-
-\defineXMLprocessor [context-directive] \contextXMLdirective
-
-\def\contextXMLdirective#1%
- {\docontextXMLdirective#1 @ @ @\end}
-
-\def\docontextXMLdirective#1 #2 #3 #4\end % class variable value
- {\expandafter\def\csname\@@XMLvariable:#1:#2\endcsname{#3}}
-
-%D A simple processing instruction is the following. It just
-%D writes a message to the screen.
-
-\defineXMLprocessor [context-message] {\writestatus{xml-message}}
-
-%D The following processing instruction permits you to tag
-%D parts of the file in such a way that you can filter data.
-%D We use this method when documenting schemas.
-
-\defineXMLprocessor [context-block] \handleXMLcontextblock
-
-\def\handleXMLcontextblock#1%
- {\dohandleXMLcontextblock#1 \relax}
-
-\def\dohandleXMLcontextblock#1 #2 #3\relax
- {\dodohandleXMLcontextblock{#1}{#2}}
-
-\let\dodohandleXMLcontextblock\gobbletwoarguments
-
-\def\hideXMLcontextblock[#1]%
- {\def\dodohandleXMLcontextblock
- {\dododohandleXMLcontextblock\doifinset{#1}}}
-
-\def\videXMLcontextblock[#1]%
- {\def\dodohandleXMLcontextblock
- {\dododohandleXMLcontextblock\doifnotinset{#1}}}
-
-\protect
-
-\def\dododohandleXMLcontextblock#1#2#3#4%
- {\let\next\relax
- \doifelse{#3}{begin}
- {#1{#4}{#2}
- {%\writestatus{xml-block}{skipping begin #4}%
- \long\def\next##1?context-block end #4 ##2?>{}}}
- {\doif{#3}{name}
- {#1{#4}{#2}
- {%\writestatus{xml-block}{skipping name #4}%
- \long\def\next##1?context-block ##2?>{}}}}%
- \next}
-
-\unprotect
-
-%D Say that a file contains blocks like the following:
-%D
-%D \starttyping
-%D <?context-block begin whatevername ?>
-%D
-%D <to/> <be> <or/> maybe <not/> so much <to/> </be>
-%D
-%D <?context-block end whatevername ?>
-%D \stoptyping
-%D
-%D The following commands will show only this block:
-%D
-%D \starttyping
-%D \videXMLcontextblock[whatevername] \showXMLfile{yourfile}
-%D \stoptyping
-%D
-%D You can also mark blocks in the following way, thereby
-%D saving yourself some work:
-%D
-%D \starttyping
-%D <?context-block what ?>
-%D
-%D <what>What do you want?</what>
-%D
-%D <?context-block how ?>
-%D
-%D <how>How do you want?</how>
-%D
-%D <?context-block done ?>
-%D \stoptyping
-
-% yet undocumented and experimental
-
-% \defineXMLprocessor [context-eof] {\endinput}
-
-% already defined in xtag-ini
-
-% \defineXMLsingular [begingroup] {\begingroup}
-% \defineXMLsingular [endgroup] {\endgroup}
-%
-% \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/mkii/xtag-prs.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-prs.mkii
deleted file mode 100644
index 8728d992a47..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-prs.mkii
+++ /dev/null
@@ -1,42 +0,0 @@
-%D \module
-%D [ file=xtag-prs,
-%D version=2004.08.18,
-%D title=\CONTEXT\ XML Macros,
-%D subtitle=Parsing,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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
-
-\def\analyzefunction#1%
- {\expanded{\doanalyzefunction#1\relax\relax(#1)}\empty\relax\end}
-
-\def\doanalyzefunction#1#2(#3)#4\relax#5\end
- {\ifx#4\empty
- \let\functionname\empty
- \else
- \def\functionname{#1#2}%
- \fi
- \getfunctionargs#3,\empty,\empty,\empty,\empty,\empty,\empty,\empty,\empty\relax}
-
-\def\getfunctionargs#1,#2,#3,#4,#5,#6,#7,#8,#9\relax
- {\edef\functionA{#1}\edef\functionB{#2}%
- \edef\functionC{#3}\edef\functionD{#4}%
- \edef\functionE{#5}\edef\functionF{#6}%
- \edef\functionG{#7}\edef\functionH{#8}}
-
-% \analyzefunction{x} [\functionname][a:\functionA/b:\functionB/c:\functionC/d:\functionD] \endgraf
-% \analyzefunction{sin(x)} [\functionname][a:\functionA/b:\functionB/c:\functionC/d:\functionD] \endgraf
-% \analyzefunction{1pt,2pt,3pt,4pt} [\functionname][a:\functionA/b:\functionB/c:\functionC/d:\functionD] \endgraf
-% \analyzefunction{rect(1pt,2pt,3pt,4pt)} [\functionname][a:\functionA/b:\functionB/c:\functionC/d:\functionD] \endgraf
-% \analyzefunction{1pt,2pt,3pt,4pt,5pt,6pt,7pt,8pt} [\functionname][e:\functionE/f:\functionF/g:\functionG/h:\functionH] \endgraf
-% \analyzefunction{rect(1pt,2pt,3pt,4pt,5pt,6pt,7pt,8pt)} [\functionname][e:\functionE/f:\functionF/g:\functionG/h:\functionH] \endgraf
-
-% todo [#1][settings][maxwidth,maxheight,method=] with method=x y xy [1]
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-raw.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-raw.mkii
deleted file mode 100644
index aab294c5adb..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-raw.mkii
+++ /dev/null
@@ -1,37 +0,0 @@
-%D \module
-%D [ file=xtag-raw,
-%D version=2002.03.21,
-%D title=\CONTEXT\ XML Macros,
-%D subtitle=Raw Specials,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 / Raw Specials}
-
-%D Some day this module will be obsolete.
-
-\defineXMLentity [tex-hash] {\letterhash}
-\defineXMLentity [tex-dollar] {\letterdollar}
-\defineXMLentity [tex-percent] {\letterpercent}
-\defineXMLentity [tex-backslash] {\letterbackslash}
-\defineXMLentity [tex-hat] {\letterhat}
-\defineXMLentity [tex-underscore] {\letterunderscore}
-\defineXMLentity [tex-leftbrace] {\letterbgroup}
-\defineXMLentity [tex-rightbrace] {\letteregroup}
-\defineXMLentity [tex-bar] {\letterbar}
-\defineXMLentity [tex-tilde] {\lettertilde}
-
-\endinput
-
-\defineXMLsingular[test][oeps=,whow=,hm=]
-% {\tttf \input \XMLop{oeps} [\XMLop{whow}] [\XMLop{hm}]}
- {\tttf \XMLop{oeps} [\XMLop{whow}] [\XMLop{hm}]}
-
-\startXMLdata
-<test oeps="oeps_tst.tmp" whow="#FFEEGG" hm="^{}~"/>
-\stopXMLdata
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-rng.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-rng.mkii
deleted file mode 100644
index 4b9dcfaf156..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-rng.mkii
+++ /dev/null
@@ -1,28 +0,0 @@
-%D \module
-%D [ file=xtag-rng,
-%D version=2002.10.29,
-%D title=\CONTEXT\ XML Macros,
-%D subtitle=Relax NG,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 commands picks up a named block from the
-%D given file and pretty prints it.
-%D
-%D \starttyping
-%D \showRNGcomponent [eximple.rng] [request]
-%D \stoptyping
-%D
-%D If needed, you adapt the colors used by redefining the
-%D \type {xtag} color palet.
-
-\fetchruntimecommand\showRNGcomponent {\f!xtagprefix\s!run}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-run.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-run.mkii
deleted file mode 100644
index 65424650c0f..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-run.mkii
+++ /dev/null
@@ -1,319 +0,0 @@
-%D \module
-%D [ file=xtag-run,
-%D version=2001.01.10,
-%D title=\CONTEXT\ XML Macros,
-%D subtitle=Visualization,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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: make this mkiv compliant, catcode tables etc
-
-\writestatus{loading}{ConTeXt XML Macros / Visualization}
-
-\unprotect
-
-\bgroup
-
-\catcode`\.=\escapecatcode
-.catcode`.B=.begingroupcatcode
-.catcode`.E=.endgroupcatcode
-.catcode`.#=.activecatcode
-.catcode`.$=.activecatcode
-.catcode`.%=.activecatcode
-.catcode`.\=.activecatcode
-.catcode`.^=.activecatcode
-.catcode`._=.activecatcode
-.catcode`.{=.activecatcode
-.catcode`.}=.activecatcode
-.catcode`.|=.activecatcode
-.catcode`.~=.activecatcode
-
-.gdef.verbatimXML
- B.catcode`.#=.activecatcode .let#.letterhash
- .catcode`.$=.activecatcode .let$.dollar
- .catcode`.%=.activecatcode .let%.percent
- .catcode`.\=.activecatcode .let\.letterbackslash
- .catcode`.^=.activecatcode .let^.letterhat
- .catcode`._=.activecatcode .let_.letterunderscore
- .catcode`.{=.activecatcode .let{.leftargument
- .catcode`.}=.activecatcode .let}.rightargument
- .catcode`.|=.activecatcode .let|.letterbar
- .catcode`.~=.activecatcode .let~.lettertilde
- E
-
-.egroup
-
-\gdef\@@XMLshow{\@@XML shw}
-
-\gdef\@XMLindent#1%
- {\ifnum\XMLlevel>\plusone\advance\leftskip#11em\relax\fi}
-
-\gdef\@XMLlevel#1%
- {\advance\XMLlevel#11\relax}
-
-\unexpanded\gdef\@XMLentity#1%
- {\noindent\hbox{\localcolortrue\color[xtag:0]{\string&#1;}}}
-
-\bgroup
-
-\@EA\catcode\string`=\activecatcode
-\@EA\catcode\string`"\activecatcode
-\@EA\catcode\string``\activecatcode
-\@EA\catcode\string`&\activecatcode
-
-\gdef\doshowXMLargument#1#2#3#4%
- {\hskip\zeropoint % or maybe \allowbreak
- \string#1\color[xtag:#3]{#4}\string#2}%
-
-\gdef\showXMLarguments
- {\hskip\zeropoint % or maybe \allowbreak
- \ifshowXMLarguments
- \bgroup
- \@EA\catcode\string`=\activecatcode
- \@EA\catcode\string`"\activecatcode
- \@EA\catcode\string``\activecatcode
- \@EA\catcode\string`&\activecatcode
- \def={\color[xtag:7]{\string=}}%
- \def"##1"{\doshowXMLargument""8{##1}}%
- \def`##1`{\doshowXMLargument``8{##1}}%
- \def&##1;{\doshowXMLargument&;7{##1}}%
- \scantokens\@EA{\currentXMLarguments}%
- \egroup
- \else
- \currentXMLarguments
- \fi}
-
-\egroup
-
-\ifx\XMLprettycycle\undefined \gdef\XMLprettycycle{3} \fi
-
-\doglobal\newcounter\@XMLnofelements
-\doglobal\newif\ifXMLunspacepretty
-
-\gdef\@XMLelement#1%
- {\ifnum\XMLlevel<\@@xflevel\relax
- \ifnum\kindofXMLelement=2\else
- \doglobal\increment\@XMLnofelements\relax
- \ifcase\@XMLnofelements\else\@@xfinbetween\fi
- \fi
- \fi
- % no, too fragile:
-% \ifnum\XMLlevel>1\hangindent2em\fi
- \ifcase\kindofXMLelement\or\or
- \getvalue{\@@XMLshow::\currentXMLelement}\relax
- \fi
- \dontleavehmode % \indent
- \bgroup
- % \localcolortrue
- \advance\XMLlevel \minusone
- \DoMod\XMLlevel by\XMLprettycycle to\scratchcounter
- \advance\scratchcounter \plusone
- \startcolor[xtag:\ifnum\scratchcounter<0 0\else\number\scratchcounter\fi]%
- \ifXMLunspacepretty\unskip\fi
- \string<%
- \ifnum\kindofXMLelement=2\string/\fi
- \currentXMLelement
- \stopcolor
- \ifcase#1\or
- \cleanupXMLarguments % get rid of spurious end space and end /
- \ifx\currentXMLarguments\empty\else
- \setbox\scratchbox\hbox{\space}\hskip\wd\scratchbox % hm, slow
- \startcolor[xtag:0]\showXMLarguments\unskip\stopcolor\unskip
- \fi
- \fi
- \startcolor[xtag:\ifnum\scratchcounter<0 0\else\number\scratchcounter\fi]%
- \ifnum\kindofXMLelement=3\string/\fi
- \string>%
- \stopcolor
- \egroup
- \ifcase\kindofXMLelement\or
- \getvalue{\@@XMLshow::\currentXMLelement}\relax
- \fi
- \ifnum\XMLlevel<\@@xflevel\relax
- \ifnum\kindofXMLelement=1\else
- \doglobal\increment\@XMLnofelements\relax
- \ifcase\@XMLnofelements\else\@@xfinbetween\fi
- \fi
- \fi
- \ifXMLunspacepretty\ignorespaces\fi}
-
-\gdef\nextXMLtext{\blank\@XMLlevel+\@XMLelement1\par}
-\gdef\prevXMLtext{\par\@XMLelement0\par\@XMLlevel-\blank}
-\gdef\nextXMLpara{\nextXMLline\par}
-\gdef\prevXMLpara{\par\prevXMLline}
-\gdef\nextXMLline{\par\@XMLlevel+\@XMLindent+\@XMLelement1}
-\gdef\prevXMLline{\@XMLelement0\par\@XMLindent-\@XMLlevel-}
-\gdef\nextXMLword{\@XMLlevel+\@XMLelement1}
-\gdef\prevXMLword{\@XMLelement0\@XMLlevel-}
-
-\gdef\someXMLtext{\blank\@XMLlevel+\@XMLelement1\@XMLlevel-\blank}
-\gdef\someXMLpara{\someXMLline}
-\gdef\someXMLline{\par\@XMLlevel+\@XMLindent+\@XMLelement1\par\@XMLindent-\@XMLlevel-}
-\gdef\someXMLword{\@XMLlevel+\@XMLelement1\@XMLlevel-}
-
-\gdef\@XMLindent#1%
- {\ifnum\XMLlevel>\zerocount
- \advance\leftskip#11em\relax
- \fi}
-
-\gdef\nextXMLtext{\blank\@XMLlevel+\@XMLelement1\par\@XMLindent+}
-\gdef\prevXMLtext{\par\@XMLindent-\@XMLelement0\par\@XMLlevel-\blank}
-\gdef\nextXMLpara{\nextXMLline\par\@XMLindent+}
-\gdef\prevXMLpara{\par\@XMLindent-\prevXMLline}
-\gdef\nextXMLline{\par\@XMLlevel+\@XMLelement1}
-\gdef\prevXMLline{\@XMLelement0\par\@XMLlevel-}
-
-\gdef\someXMLline{\par\@XMLlevel+\@XMLelement1\par\@XMLlevel-}
-
-\gdef\setXMLshow#1#2#3[#4]%
- {\def\docommand##1{#1[##1]#2#3\letvalue{\@@XMLshow:##1}\empty}%
- \processcommalist[#4]\docommand}
-
-\gdef\showXMLign[#1]%
- {\setXMLshow\defineXMLignore \relax\relax[#1]%
- \setXMLshow\defineXMLsingular \relax\relax[#1]}
-
-\gdef\showXMLnop[#1]%
- {\setXMLshow\defineXMLenvironment\relax\relax[#1]%
- \setXMLshow\defineXMLsingular \relax\relax[#1]}
-
-\gdef\showXMLtxt[#1]%
- {\setXMLshow\defineXMLenvironment\nextXMLtext\prevXMLtext[#1]%
- \setXMLshow\defineXMLsingular \someXMLtext\relax [#1]}
-
-\gdef\showXMLpar[#1]%
- {\setXMLshow\defineXMLenvironment\nextXMLpara\prevXMLpara[#1]%
- \setXMLshow\defineXMLsingular \someXMLline\relax [#1]}
-
-\gdef\showXMLlin[#1]%
- {\setXMLshow\defineXMLenvironment\nextXMLline\prevXMLline[#1]%
- \setXMLshow\defineXMLsingular \someXMLword\relax [#1]}
-
-\gdef\showXMLwrd[#1]%
- {\setXMLshow\defineXMLenvironment\nextXMLword\prevXMLword[#1]%
- \setXMLshow\defineXMLsingular \someXMLword\relax [#1]}
-
-\gdef\showXMLemp[#1]%
- {\setXMLshow\defineXMLsingular\someXMLword\relax[#1]}
-
-\gdef\showXMLbreak[#1]%
- {\def\docommand##1{\setvalue{\@@XMLshow::##1}{\hskip\zeropoint}}%
- \processcommalist[#1]\docommand}
-
-\gdef\doautoshowXMLelement
- {\ifcase\kindofXMLelement
- \or \nextXMLpara \or \prevXMLpara \or \someXMLline
- \fi}
-
-\gdef\autoshowXMLelement
- {\ifcsname\@@XMLshow:\currentXMLelement\endcsname
- \expandafter\normalexecuteXMLelement
- \else
- \expandafter\doautoshowXMLelement
- \fi}
-
-\global\let\normalexecuteXMLelement\executeXMLelement
-
-\gdef\showXMLfile#1%
- {\bgroup
- % temp hack, will be the normal definition
- \long\def\docleanupXMLarguments##1/ ##2\relax{\def\currentXMLarguments{##1}}%
- % so far for hack
- \nohyphens
- \dontcomplain
- \XMLlevel\zerocount
- \increment\@@xflevel % hack
- \tttf
- \startpacked[\v!blank]
- \ifautoXMLshow \let\executeXMLelement\autoshowXMLelement \fi
- \let\executeXMLentity\@XMLentity
- \enableXML\verbatimXML
- \enableregime[utf]%
- \utfunicodetracer\pluseight
- \veryraggedright
- \readfile{\truefilename{#1}}\donothing\donothing\endgraf
- \removelastskip % really needed
- \stoppacked
- \egroup}
-
-\gdef\showXMLtext#1%
- {\bgroup
- % temp hack, will be the normal definition
- \long\def\docleanupXMLarguments##1/ ##2\relax{\def\currentXMLarguments{##1}}%
- % so far for hack
- \dontcomplain
- \XMLlevel\maxcard
- \increment\@@xflevel % hack
- \tttf
- \ifautoXMLshow \let\executeXMLelement\autoshowXMLelement \fi
- \let\executeXMLentity\@XMLentity
- \let\par\allowbreak\let\endgraf\par
- \setbox\scratchbox\hbox
- {\enableXML\verbatimXML\scantokens{#1}\removelastskip}%
- \unhbox\scratchbox
- \egroup}
-
-\gdef\showXMLbuffer
- {\dosingleempty\doshowXMLbuffer}
-
-\gdef\doshowXMLbuffer[#1]%
- {\doifelsenothing{#1}
- {\doshowXMLbuffer[\jobname]}
- {\bgroup
- \def\dodoprocessXMLbuffer##1{\showXMLfile{\TEXbufferfile{##1}}}%
- \processcommalist[#1]\dodoprocessXMLbuffer
- \egroup}}
-
-%D
-
-\gdef\showXSDcomponent
- {\dodoubleargument\doshowXSDcomponent}
-
-\gdef\doshowXSDcomponent[#1][#2]%
- {\bgroup
- \showXMLnop[xsd:schema]
- \showXMLign[xsd:appInfo]
- \showXMLign[xsd:annotation]
- \videXMLcontextblock[#2]
- \showXMLfile{#1}
- \egroup}
-
-\gdef\showRNGcomponent
- {\dodoubleargument\doshowRNGcomponent}
-
-\gdef\doshowRNGcomponent[#1][#2]%
- {\bgroup
- \videXMLcontextblock[#2]
- \showXMLfile{#1}
- \egroup}
-
-%D
-
-\gdef\tracebackXMLattribute#1%
- {\bgroup
- \doloop
- {\ifcsname\@@XMLdepth:\recurselevel\endcsname
- \edef\!!stringa{\csname\@@XMLdepth:\recurselevel\endcsname}%
- \writestatus
- {XML TRACE}
- {[#1] [\recurselevel] [\!!stringa] [\XMLinh{#1}]}%
- \else
- \exitloop
- \fi}%
- \egroup}
-
-\gdef\showXMLinh[#1]%
- {\doifsomething{#1}
- {\bgroup\infofont[%
- \dorecurse\XMLdepth
-% {\csname\@@XMLvariable:\csname\@@XMLdepth:\recurselevel\endcsname:#1\endcsname
- {\csname\@@XMLvariable:\recurselevel:#1\endcsname
- \ifnum\recurselevel<\XMLdepth->\fi}%
- ]\egroup}}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-stk.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-stk.mkii
deleted file mode 100644
index d454a63ca8d..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-stk.mkii
+++ /dev/null
@@ -1,230 +0,0 @@
-%D \module
-%D [ file=xtag-exp,
-%D version=2006.01.19,
-%D title=\CONTEXT\ XML Macros,
-%D subtitle=Stacking Data,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 / 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{\recurselevel:\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/mkii/xtag-utf.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-utf.mkii
deleted file mode 100644
index b58fbbe88b6..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-utf.mkii
+++ /dev/null
@@ -1,21 +0,0 @@
-%D \module
-%D [ file=xtag-utf,
-%D version=2002.06.24,
-%D title=\CONTEXT\ XML Macros,
-%D subtitle=UTF,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 / UTF}
-
-%D This filter is kind of obsolete, since \UTF\ is not
-%D limited to \XML. So, here we only enable \UTF\ support.
-
-\chardef\XMLtokensreduction\plustwo \enableregime[utf]
-
-\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-xsd.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-xsd.mkii
deleted file mode 100644
index c1f4b91b649..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-xsd.mkii
+++ /dev/null
@@ -1,28 +0,0 @@
-%D \module
-%D [ file=xtag-xsd,
-%D version=2001.10.04,
-%D title=\CONTEXT\ XML Support,
-%D subtitle=Schemas,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 commands picks up a named block from the
-%D given file and pretty prints it.
-%D
-%D \starttyping
-%D \showXSDcomponent [x-exa-tx.xsd] [sequence]
-%D \stoptyping
-%D
-%D If needed, you adapt the colors used by redefining the
-%D \type {xtag} color palet.
-
-\fetchruntimecommand\showXSDcomponent {\f!xtagprefix\s!run}
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkii/xtag-xsl.mkii b/Master/texmf-dist/tex/context/base/mkii/xtag-xsl.mkii
deleted file mode 100644
index 49767e30c79..00000000000
--- a/Master/texmf-dist/tex/context/base/mkii/xtag-xsl.mkii
+++ /dev/null
@@ -1,224 +0,0 @@
-%D \module
-%D [ file=xtag-xsl,
-%D version=2002.03.07,
-%D title=\CONTEXT\ XML Support,
-%D subtitle=XSLT processing,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%C
-%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
-
-% FOR THIS TO WORK YOU NEED A PROPER cp8bit VECTOR
-%
-% 8 bit support has been messed up in a couple of distributions
-%
-% 0x00 0x00
-% 0x01 0x01
-% 0x02 0x02
-% etc
-
-%D This module is rather experimental so users may expect
-%D changes in the interface.
-
-\unprotect
-
-\definesystemvariable {xl}
-
-\newif\iftraceXSLTprocessing % \traceXSLTprocessingtrue
-
-\def\XSLTscriptfile{\bufferprefix xlscript}
-
-% to be sped up:
-
-\def\presetXSLTcharacters
- {\let\par\empty
- \def\{{\rawcharacter{`\{}}% \string^^..
- \def\}{\rawcharacter{`\}}}% \string^^..
- \def\\{\rawcharacter{`\\}}}% \string^^..
-
-\def\obeyXSLTcharacters
- {\setnaturalcatcodes
- \catcode`\\=\escapecatcode}
-
-\long\def\startXSLTscript #1 #2 %
- {\bgroup
- \obeyXSLTcharacters
- \doifelse{#2}{capsule}\dostartXSLTscript\nostartXSLTscript#1 #2 }
-
-\long\def\dostartXSLTscript#1 #2 #3 %
- {\obeylines
- \dodostartXSLTscript#1 #2 #3 }
-
-\long\def\dodostartXSLTscript#1 #2 #3 #4\stopXSLTscript
- {\egroup
- \long\setvalue{\??xl#1}{\doXSLTscript{#3}{#4}}}
-
-\long\def\nostartXSLTscript
- {\obeylines
- \nonostartXSLTscript}
-
-\long\def\nonostartXSLTscript#1 #2\stopXSLTscript
- {\egroup
- \long\setvalue{\??xl#1}{\doXSLTscript\empty{#2}}}
-
-\long\def\donormalXSLTscript#1#2%
- {\includeXSLTscript{b-capsule-#1}%
- #2%
- \includeXSLTscript{e-capsule-#1}}
-
-\def\includeXSLTscript#1%
- {\csname\ifcsname\??xl#1\endcsname\??xl#1\else\s!empty\fi\endcsname}
-
-\startXSLTscript b-capsule-1.0
-<?xml version="1.0"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-\stopXSLTscript
-
-\startXSLTscript e-capsule-1.0
-</xsl:stylesheet>
-\stopXSLTscript
-
-\def\applyXSLTscript
- {\dotripleempty\doapplyXSLTscript}
-
-\long\def\doapplyXSLTscript[#1][#2][#3]%
- {\ifthirdargument
- \bgroup
- \let\doXSLTscript\donormalXSLTscript
- \presetXSLTcharacters
- \donefalse
- \def\docommand##1{\dodoapplyXSLTscript{##1}{\ifdone#3\else#2\fi}{#3}\donetrue}%
- \processcommalist[#1]\docommand
- \egroup
- \else
- \applyXSLTscript[#1][#2][#2]%
- \fi}
-
-% Since a \XML\ file is loaded into memory as a tree, we
-% can safely use the same input and output filename, thereby
-% avoiding temporary files.
-
-\def\dodoapplyXSLTscript#1#2#3%
- {\bgroup
- \doifundefined{\??xl#1}%
- {\writestatus{XSLT}{unknown script #1}}
- {\writestatus{XSLT}{convert #2 into #3 using #1}%
- \edef\par{\outputnewlinechar}%
- \edef\!!stringc{\getvalue{\??xl#1}}%
- \immediate\openout\scratchwrite=\XSLTscriptfile.xsl
- \immediate\write\scratchwrite{\!!stringc}%
- \immediate\closeout\scratchwrite
- \iftraceXSLTprocessing\wait\fi
- \executeXSLT{\XSLTscriptfile.xsl}{#2}{#3}%
- \iftraceXSLTprocessing\wait\fi}%
- \egroup}
-
-\def\executeXSLT#1#2#3% script input output
- {\executesystemcommand{xsltproc -o #3 #1 #2}}
-
-\long\def\applyXSLTtobuffer
- {\dodoubleempty\doapplyXSLTtobuffer}
-
-\long\def\doapplyXSLTtobuffer[#1][#2]%
- {\expanded{\applyXSLTscript[#1][\TEXbufferfile{\ifsecondargument#2\else\jobname\fi}]}}
-
-\def\resetXSLTscripting#1%
- {\setgvalue{\??xl\s!dummy}{\doXSLTscript{#1}{}}}
-
-\resetXSLTscripting{1.0}
-
-\def\startXSLTscripting
- {\bgroup
- \obeyXSLTcharacters
- \obeylines
- \dostartXSLTscripting}
-
-\long\def\dostartXSLTscripting#1\stopXSLTscripting
- {\egroup
- \let\doXSLTscript\doextendXSLTscript
- \getvalue{\??xl\s!dummy}{#1}}
-
-\long\def\doextendXSLTscript#1#2#3%
- {\setgvalue{\??xl\s!dummy}{\doXSLTscript{#1}{#2#3}}}
-
-\def\applyXSLTscripting
- {\applyXSLTscript[\s!dummy]}
-
-\protect
-
-\doifnotmode{demo}{\endinput}
-
-% \def\Whow{Whow It Works}
-%
-% \startXSLTscript test capsule 1.0
-% <xsl:output method="text"/>
-%
-% <xsl:template match="/figurelibrary/figure">
-% \Whow \\ #<xsl:apply-templates/>
-% </xsl:template>
-%
-% <xsl:template match="/">
-% <xsl:apply-templates/>
-% </xsl:template>
-% \stopXSLTscript
-%
-% \applyXSLTscript [test] [figtest.xml] [crap.tmp] \typefile{crap.tmp}
-%
-% \startbuffer
-% <hello>world</hello>
-% \stopbuffer
-%
-% \applyXSLTtobuffer[test] \typebuffer
-%
-% \startXSLTscripting
-% <xsl:output method="text"/>
-% \stopXSLTscripting
-%
-% \startXSLTscripting
-% <xsl:template match="/figurelibrary/figure">
-% <xsl:apply-templates/>
-% </xsl:template>
-% \stopXSLTscripting
-%
-% \startXSLTscripting
-% <xsl:template match="/">
-% <xsl:apply-templates/>
-% </xsl:template>
-% \stopXSLTscripting
-%
-% \applyXSLTscripting [figtest.xml] [crap.tmp] \typefile{crap.tmp}
-
-\starttext
-
-\startXSLTscript another
-<?xml version="1.0"?>
-
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:cd="http://www.pragma-ade.com/commands"
- version="1.0">
-
-<xsl:output method="text"/>
-
-<xsl:template match="/">
- <xsl:apply-templates/>
-</xsl:template>
-
-<xsl:template match="cd:interface">
- <xsl:apply-templates><xsl:sort order="descending" select="@name"/></xsl:apply-templates>
-</xsl:template>
-
-<xsl:template match="cd:command">
- name: <xsl:value-of select="@name"/>\\par
-</xsl:template>
-
-</xsl:stylesheet>
-\stopXSLTscript
-
-\applyXSLTscript [another] [cont-en.xml] [whatever.tmp]
-
-\readfile{whatever.tmp}{}{}
-
-\stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkiv/anch-pgr.lua b/Master/texmf-dist/tex/context/base/mkiv/anch-pgr.lua
index 8e400cd123f..8681239c9b6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/anch-pgr.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/anch-pgr.lua
@@ -24,6 +24,7 @@ local lpegmatch = lpeg.match
local jobpositions = job.positions
local formatters = string.formatters
local setmetatableindex = table.setmetatableindex
+local settings_to_array = utilities.parsers.settings_to_array
local enableaction = nodes.tasks.enableaction
@@ -32,6 +33,7 @@ local context = context
local implement = interfaces.implement
+local texgetcount = tex.getcount
local report_graphics = logs.reporter("backgrounds")
local report_shapes = logs.reporter("backgrounds","shapes")
local report_free = logs.reporter("backgrounds","free")
@@ -78,9 +80,9 @@ local getdepth = nuts.getdepth
local nodecodes = nodes.nodecodes
local par_code = nodecodes.par
-local start_of_par = nuts.start_of_par
-local insert_before = nuts.insert_before
-local insert_after = nuts.insert_after
+local startofpar = nuts.startofpar
+local insertbefore = nuts.insertbefore
+local insertafter = nuts.insertafter
local processranges = nuts.processranges
@@ -99,6 +101,7 @@ local enabled = false
-- many pages but for an arbitrary background shape that is not so common.
local function check(specification)
+ --
local a = specification.attribute
local index = specification.index
local depth = specification.depth
@@ -165,12 +168,12 @@ local function flush(head,f,l,a,parent,depth)
ln = new_hlist(setlink(new_rule(65536,65536*4,0),new_kern(-65536),ln))
rn = new_hlist(setlink(new_rule(65536,0,65536*4),new_kern(-65536),rn))
end
- if getid(f) == par_code and start_of_par(f) then -- we need to clean this mess
- insert_after(head,f,ln)
+ if getid(f) == par_code and startofpar(f) then -- we need to clean this mess
+ insertafter(head,f,ln)
else
- head, f = insert_before(head,f,ln)
+ head, f = insertbefore(head,f,ln)
end
- insert_after(head,l,rn)
+ insertafter(head,l,rn)
end
return head, true
end
@@ -205,24 +208,10 @@ local function registerbackground(name)
end
end
--- local function collectbackgrounds(r,n)
--- if enabled then
--- local parent = getbox(n)
--- local head = getlist(parent)
--- realpage = r
--- processranges(a_textbackground,flush,head) -- ,parent)
--- end
--- end
---
--- interfaces.implement {
--- name = "collectbackgrounds",
--- actions = collectbackgrounds,
--- arguments = { "integer", "integer" }
--- }
-
nodes.handlers.textbackgrounds = function(head,where,parent) -- we have hlistdir and local dir
-- todo enable action in register
- index = index + 1
+ index = index + 1
+ realpage = texgetcount("realpageno")
return processranges(a_textbackground,flush,head,parent)
end
@@ -235,8 +224,6 @@ interfaces.implement {
-- optimized already but we can assume a cycle i.e. prune the last point and then
-- even less code .. we could merge some loops but his is more robust
--- use idiv here
-
local function topairs(t,n)
local r = { }
for i=1,n do
@@ -783,9 +770,7 @@ local function calculatemultipar(tag)
for i=bindex+1,eindex-1 do
br = f_tag_two(btag,i)
local r = collected[br]
- if not r then
- report_graphics("invalid middle for %a",br)
- else
+ if r then
local rp = r.p -- page
local pp = list[rp]
local mp = middlepart(b,e,p,rp,r,left,right)
@@ -794,6 +779,8 @@ local function calculatemultipar(tag)
else
list[rp] = { mp }
end
+ else
+ report_graphics("invalid middle for %a",br)
end
end
local ep = e.p -- page
@@ -1213,7 +1200,7 @@ implement {
actions = function(tags,anchor,page) -- no caching (yet) / page
local collected = jobpositions.collected
if type(tags) == "string" then
- tags = utilities.parsers.settings_to_array(tags)
+ tags = settings_to_array(tags)
end
local list = { }
local nofboxes = 0
diff --git a/Master/texmf-dist/tex/context/base/mkiv/anch-pos.lua b/Master/texmf-dist/tex/context/base/mkiv/anch-pos.lua
index 77bf09e3923..77f55964f8f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/anch-pos.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/anch-pos.lua
@@ -49,6 +49,7 @@ local context = context
local ctx_latelua = context.latelua
local tex = tex
+local texgetdimen = tex.getdimen
local texgetcount = tex.getcount
local texgetinteger = tex.getintegervalue or tex.getcount
local texsetcount = tex.setcount
@@ -574,8 +575,8 @@ implement {
actions = function()
nofparagraphs = nofparagraphs + 1
texsetcount("global","c_anch_positions_paragraph",nofparagraphs)
- local box = getbox("strutbox")
- local w, h, d = getwhd(box)
+ local h = texgetdimen("strutht")
+ local d = texgetdimen("strutdp")
local t = {
p = true,
c = true,
@@ -704,8 +705,8 @@ implement {
name = "dosetpositionstrut",
arguments = "string",
actions = function(name)
- local box = getbox("strutbox")
- local w, h, d = getwhd(box)
+ local h = texgetdimen("strutht")
+ local d = texgetdimen("strutdp")
local spec = {
p = true,
c = column,
@@ -726,8 +727,8 @@ implement {
name = "dosetpositionstrutkind",
arguments = { "string", "integer" },
actions = function(name,kind)
- local box = getbox("strutbox")
- local w, h, d = getwhd(box)
+ local h = texgetdimen("strutht")
+ local d = texgetdimen("strutdp")
local spec = {
k = kind,
p = true,
@@ -985,7 +986,7 @@ local function overlapping(one,two,overlappingmargin) -- hm, strings so this is
end
local function onsamepage(list,page)
- for id in gmatch(list,"(, )") do
+ for id in gmatch(list,"([^,%s]+)") do
local jpi = collected[id]
if jpi then
local p = jpi.p
diff --git a/Master/texmf-dist/tex/context/base/mkiv/anch-pos.mkiv b/Master/texmf-dist/tex/context/base/mkiv/anch-pos.mkiv
index 772c89504d9..ce67caa9805 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/anch-pos.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/anch-pos.mkiv
@@ -477,10 +477,10 @@
%D positions being on the same page.
%D
%D \starttyping
-%D \doifpositionsonsamepageelse{point a}{point b}
+%D \doifpositionsonsamepageelse{point a,point b}
%D {action when on same page}
%D {action when not on same page}
-%D \doifpositionsonthispageelse{point a}{point b}
+%D \doifpositionsonthispageelse{point a,point b}
%D {action when on this page}
%D {action when not on this page}
%D \stoptyping
diff --git a/Master/texmf-dist/tex/context/base/mkiv/anch-snc.lua b/Master/texmf-dist/tex/context/base/mkiv/anch-snc.lua
index ee13adca39d..e7520f88d1e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/anch-snc.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/anch-snc.lua
@@ -24,8 +24,8 @@ local mpnumeric = mp.numeric
local mppoints = mp.points
local texgetdimen = tex.getdimen
-local p_number = patterns.cardinal/tonumber
-local p_space = patterns.whitespace^0
+local p_number = lpegpatterns.cardinal/tonumber
+local p_space = lpegpatterns.whitespace^0
local p_tag = P("syncpos:") * p_number * P(":") * p_number
local p_option = p_number * ((P(",") * p_space * P("reset") * Cc(true)) + Cc(false)) -- for now
diff --git a/Master/texmf-dist/tex/context/base/mkiv/attr-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/attr-ini.lua
index 5507f2a70b8..b05c343e598 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/attr-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/attr-ini.lua
@@ -35,8 +35,8 @@ attributes.states = attributes.states or { }
attributes.handlers = attributes.handlers or { }
attributes.unsetvalue = -0x7FFFFFFF
-local currentfont = font.current -- mabe nicer is attributes.current
-local currentattributes = node.current_attributes -- mabe nicer is fonts .current
+local currentfont = font.current
+local currentattributes = nodes and nodes.currentattributes or node.currentattributes or node.current_attr -- no nodes table yet
local names = attributes.names
local numbers = attributes.numbers
diff --git a/Master/texmf-dist/tex/context/base/mkiv/attr-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/attr-ini.mkiv
index 71c6478f8c3..ad40a1ffead 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/attr-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/attr-ini.mkiv
@@ -168,19 +168,3 @@
% \to \everyafterpagebreak
\protect \endinput
-
-% for the luatex list:
-%
-% \attributedef\zeroattribute=0
-% \attributedef\someattribute=999
-%
-% \directlua {
-% local createtoken = newtoken.create
-% function attributenumber(name)
-% local n = createtoken(name).mode - createtoken("zeroattribute").mode
-% return n >= 0 and n or false
-% end
-% }
-%
-% \directlua{print(attributenumber("noneattribute"))}
-% \directlua{print(attributenumber("someattribute"))}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/back-exp.lua b/Master/texmf-dist/tex/context/base/mkiv/back-exp.lua
index 7a37cc94887..1abe9164a71 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/back-exp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/back-exp.lua
@@ -325,9 +325,9 @@ local styletemplate = [[
local numbertoallign = {
[0] = "justify", ["0"] = "justify", [variables.normal ] = "justify",
- [1] = "right", ["1"] = "right", [variables.flushright] = "right",
- [2] = "center", ["2"] = "center", [variables.middle ] = "center",
- [3] = "left", ["3"] = "left", [variables.flushleft ] = "left",
+ "right", ["1"] = "right", [variables.flushright] = "right",
+ "center", ["2"] = "center", [variables.middle ] = "center",
+ "left", ["3"] = "left", [variables.flushleft ] = "left",
}
function wrapups.allusedstyles(filename)
@@ -1640,7 +1640,7 @@ do
d.__i__ = n
data[n] = d
elseif content == " " or content == "" then
- if di.tg == "mspace" then
+ if d.tg == "mspace" then
-- we append or prepend a space to a preceding or following mtext
local parent = di.__p__
local index = di.__i__ -- == i
@@ -3020,7 +3020,7 @@ local collectresults do -- too many locals otherwise
local getkern = nuts.getkern
local getwidth = nuts.getwidth
- local start_of_par = nuts.start_of_par
+ local startofpar = nuts.startofpar
local nexthlist = nuts.traversers.hlist
local nextnode = nuts.traversers.node
@@ -3390,7 +3390,7 @@ end
last = nil
currentparagraph = nil
end
- elseif not paragraph and id == par_code and start_of_par(n) then
+ elseif not paragraph and id == par_code and startofpar(n) then
paragraph = getattr(n,a_taggedpar)
elseif id == disc_code then
-- very unlikely because we stripped them
@@ -3438,8 +3438,8 @@ end
for n, subtype in nexthlist, head do
if subtype == linelist_code then
setattr(n,a_textblock,noftextblocks)
- elseif subtype == glue_code or subtype == kern_code then -- no need to set fontkerns
- setattr(n,a_textblock,0)
+-- elseif subtype == glue_code or subtype == kern_code then -- weird, no list
+-- setattr(n,a_textblock,0)
end
end
return false
diff --git a/Master/texmf-dist/tex/context/base/mkiv/back-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/back-ini.lua
index d01be4a73f5..f2c22d3ba2a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/back-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/back-ini.lua
@@ -132,7 +132,7 @@ end)
backends.included = included
function backends.timestamp()
- return os.date("%Y-%m-%dT%X") .. os.timezone(true)
+ return os.date("%Y-%m-%dT%X") .. os.timezone()
end
-- Also here:
diff --git a/Master/texmf-dist/tex/context/base/mkiv/back-pdp.lua b/Master/texmf-dist/tex/context/base/mkiv/back-pdp.lua
index 857f13ef239..3de83bef1ac 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/back-pdp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/back-pdp.lua
@@ -22,6 +22,7 @@ local tokenscanners = tokens.scanners
local scanword = tokenscanners.word
local scankeyword = tokenscanners.keyword
local scanstring = tokenscanners.string
+local scantoks = tokenscanners.toks
local scaninteger = tokenscanners.integer
local scanwhd = tokenscanners.whd
@@ -30,6 +31,7 @@ local report = logs.reporter("backend")
local nodepool = nodes.pool
local newliteral = nodepool.literal
+local newlateliteral = nodepool.lateliteral
local newsave = nodepool.save
local newrestore = nodepool.restore
local newsetmatrix = nodepool.setmatrix
@@ -40,8 +42,24 @@ local variables = interfaces.variables
-- literals
+-- local function pdfliteral()
+-- context(newliteral(scanword() or "origin",scanstring()))
+-- end
+
+-- Who knows what will end up in e.g. tikz .. so we now do:
+
local function pdfliteral()
- context(newliteral(scanword() or "origin",scanstring()))
+ local word = scanword()
+ local node
+ if word == "shipout" then
+ context(newlateliteral(scanword() or "origin",scantoks()))
+ else
+ context(newliteral(word or "origin",scanstring()))
+ end
+end
+
+local function pdflateliteral()
+ context(newlateliteral(scanword() or "origin",scantoks()))
end
-- objects
@@ -198,14 +216,15 @@ end
-- mapfile mapline includechars catalog info names trailer
local extensions = {
- literal = pdfliteral,
- obj = pdfobj,
- refobj = pdfrefobj,
- dest = pdfdest,
- annot = pdfannot,
- save = pdfsave,
- restore = pdfrestore,
- setmatrix = pdfsetmatrix,
+ literal = pdfliteral,
+ lateliteral = pdflateliteral,
+ obj = pdfobj,
+ refobj = pdfrefobj,
+ dest = pdfdest,
+ annot = pdfannot,
+ save = pdfsave,
+ restore = pdfrestore,
+ setmatrix = pdfsetmatrix,
}
local function pdfextension()
@@ -276,12 +295,13 @@ implement { name = "pdfvariable", actions = pdfvariable }
-- for the moment (tikz)
-implement { name = "pdfliteral", actions = pdfliteral }
-implement { name = "pdfobj", actions = pdfobj }
-implement { name = "pdflastobj", actions = pdflastobj }
-implement { name = "pdfrefobj", actions = pdfrefobj }
---------- { name = "pdfannot", actions = pdfannot }
---------- { name = "pdfdest", actions = pdfdest }
---------- { name = "pdfsave", actions = pdfsave }
---------- { name = "pdfrestore", actions = pdfrestore }
---------- { name = "pdfsetmatrix", actions = pdfsetmatrix }
+implement { name = "pdfliteral", actions = pdfliteral }
+implement { name = "pdflateliteral", actions = pdflateliteral }
+implement { name = "pdfobj", actions = pdfobj }
+implement { name = "pdflastobj", actions = pdflastobj }
+implement { name = "pdfrefobj", actions = pdfrefobj }
+--------- { name = "pdfannot", actions = pdfannot }
+--------- { name = "pdfdest", actions = pdfdest }
+--------- { name = "pdfsave", actions = pdfsave }
+--------- { name = "pdfrestore", actions = pdfrestore }
+--------- { name = "pdfsetmatrix", actions = pdfsetmatrix }
diff --git a/Master/texmf-dist/tex/context/base/mkiv/blob-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/blob-ini.lua
index 0b35c3b65aa..012b4ddb053 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/blob-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/blob-ini.lua
@@ -25,28 +25,26 @@ if not modules then modules = { } end modules ['blob-ini'] = {
local type, tostring = type, tostring
local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns
-local report_blobs = logs.reporter("blobs")
+local report_blobs = logs.reporter("blobs")
-local flush_node_list = node.flush_list
-local hpack_node_list = node.hpack
------ vpack_node_list = node.vpack
-local write_node = node.write
+local flushnodelist = nodes.flushlist
+local hpacknodelist = nodes.hpack
-local typesetters = nodes.typesetters
-local tonodes = typesetters.tonodes
-local tohpack = typesetters.tohpack
-local tovpack = typesetters.tovpack
+local typesetters = nodes.typesetters
+local tonodes = typesetters.tonodes
+local tohpack = typesetters.tohpack
+local tovpack = typesetters.tovpack
-local implement = interfaces.implement
+local context = context
--- provide copies here (nicer for manuals)
+local implement = interfaces.implement
-blobs = blobs or { }
-local blobs = blobs
+blobs = blobs or { }
+local blobs = blobs
-blobs.tonodes = tonodes
-blobs.tohpack = tohpack
-blobs.tovpack = tovpack
+blobs.tonodes = tonodes
+blobs.tohpack = tohpack
+blobs.tovpack = tovpack
-- end of helpers
@@ -68,7 +66,7 @@ function blobs.dispose(t)
local li = list[i]
local pack = li.pack
if pack then
- flush_node_list(pack)
+ flushnodelist(pack)
li.pack = nil
end
end
@@ -96,14 +94,14 @@ function blobs.pack(t,how)
for i=1,#list do
local pack = list[i].pack
if pack then
- flush_node_list(node.pack)
+ flushnodelist(pack)
end
if how == "vertical" then
-- we need to prepend a local par node
-- list[i].pack = vpack_node_list(list[i].head,"exactly")
report_blobs("vpack not yet supported")
else
- list[i].pack = hpack_node_list(list[i].head,"exactly")
+ list[i].pack = hpacknodelist(list[i].head,"exactly")
end
end
end
@@ -114,8 +112,8 @@ function blobs.write(t)
local li = list[i]
local pack = li.pack
if pack then
- write_node(pack)
- flush_node_list(pack)
+ context(pack)
+ flushnodelist(pack)
li.pack = nil
end
end
@@ -158,28 +156,28 @@ end
local function strwd(str)
local l = tohpack(str)
local w = l.width
- flush_node_list(l)
+ flushnodelist(l)
return w
end
local function strht(str)
local l = tohpack(str)
local h = l.height
- flush_node_list(l)
+ flushnodelist(l)
return h
end
local function strdp(str)
local l = tohpack(str)
local d = l.depth
- flush_node_list(l)
+ flushnodelist(l)
return d
end
local function strhd(str)
local l = tohpack(str)
local s = l.height + l.depth
- flush_node_list(l)
+ flushnodelist(l)
return s
end
@@ -192,7 +190,7 @@ blobs.strhd = strhd
local scan_hbox = tokens.scanners.hbox
-implement { name = "strwd", actions = function() local l = scan_hbox() context(l.width) flush_node_list(l) end }
-implement { name = "strht", actions = function() local l = scan_hbox() context(l.height) flush_node_list(l) end }
-implement { name = "strdp", actions = function() local l = scan_hbox() context(l.depth) flush_node_list(l) end }
-implement { name = "strhd", actions = function() local l = scan_hbox() context(l.height + l.depth) flush_node_list(l) end }
+implement { name = "strwd", actions = function() local l = scan_hbox() context(l.width) flushnodelist(l) end }
+implement { name = "strht", actions = function() local l = scan_hbox() context(l.height) flushnodelist(l) end }
+implement { name = "strdp", actions = function() local l = scan_hbox() context(l.depth) flushnodelist(l) end }
+implement { name = "strhd", actions = function() local l = scan_hbox() context(l.height + l.depth) flushnodelist(l) end }
diff --git a/Master/texmf-dist/tex/context/base/mkiv/buff-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/buff-ini.lua
index 4589e5498c5..f23344edada 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/buff-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/buff-ini.lua
@@ -8,7 +8,7 @@ if not modules then modules = { } end modules ['buff-ini'] = {
local concat = table.concat
local type, next, load = type, next, load
-local sub, format = string.sub, string.format
+local sub, format, find = string.sub, string.format, string.find
local splitlines, validstring, replacenewlines = string.splitlines, string.valid, string.replacenewlines
local P, Cs, patterns, lpegmatch = lpeg.P, lpeg.Cs, lpeg.patterns, lpeg.match
local utfchar = utf.char
@@ -55,6 +55,7 @@ local replacesuffix = file.replacesuffix
local registertempfile = luatex.registertempfile
local v_yes = variables.yes
+local v_append = variables.append
local eol = patterns.eol
local space = patterns.space
@@ -125,6 +126,14 @@ local function getcontent(name)
return buffer and buffer.data or ""
end
+local function empty(name)
+ if find(getcontent(name),"%S") then
+ return false
+ else
+ return true
+ end
+end
+
local function getlines(name)
local buffer = name and cache[name]
return buffer and splitlines(buffer.data)
@@ -201,6 +210,7 @@ buffers.assign = assign
buffers.prepend = prepend
buffers.append = append
buffers.exists = exists
+buffers.empty = empty
buffers.getcontent = getcontent
buffers.getlines = getlines
buffers.collectcontent = collectcontent
@@ -642,7 +652,7 @@ implement {
end
}
-local function savebuffer(list,name,prefix) -- name is optional
+local function savebuffer(list,name,prefix,option,directory) -- name is optional
if not list or list == "" then
list = name
end
@@ -656,13 +666,16 @@ local function savebuffer(list,name,prefix) -- name is optional
if prefix == v_yes then
name = addsuffix(tex.jobname .. "-" .. name,"tmp")
end
- io.savedata(name,replacenewlines(content))
+ if directory ~= "" and dir.makedirs(directory) then
+ name = file.join(directory,name)
+ end
+ io.savedata(name,replacenewlines(content),"\n",option == v_append)
end
implement {
name = "savebuffer",
actions = savebuffer,
- arguments = "3 strings",
+ arguments = "5 strings",
}
-- we can consider adding a size to avoid unlikely clashes
@@ -675,7 +688,7 @@ local runner = sandbox.registerrunner {
name = "run buffer",
program = "context",
method = "execute",
- template = jit and "--purgeall --jit %filename%" or "--purgeall %filename%",
+ template = (jit and "--jit --engine=luajittex" or "--engine=luatex") .. " --purgeall %?path: --path=%path% ?% %filename%",
reporter = report_typeset,
checkers = {
filename = "readable",
@@ -769,7 +782,10 @@ local function runbuffer(name,encapsulate,runnername,suffixes)
end
savedata(filename,content)
report_typeset("processing saved buffer %a\n",filename)
- runner { filename = filename }
+ runner {
+ filename = filename,
+ path = environment.arguments.path, -- maybe take all set paths
+ }
end
new[tag] = (new[tag] or 0) + 1
report_typeset("no changes in %a, processing skipped",name)
@@ -800,7 +816,7 @@ local function getbuffermkvi(name) -- rather direct !
ctx_viafile(resolvers.macros.preprocessed(getcontent(name)),formatters["buffer.%s.mkiv"](validstring(name,"noname")))
end
-local function gettexbuffer(name)
+local function getbuffertex(name)
local buffer = name and cache[name]
if buffer and buffer.data ~= "" then
ctx_pushcatcodetable()
@@ -815,15 +831,15 @@ local function gettexbuffer(name)
end
end
-buffers.get = getbuffer
-buffers.getmkiv = getbuffermkiv
-buffers.gettexbuffer = gettexbuffer
-buffers.run = runbuffer
+buffers.get = getbuffer
+buffers.getmkvi = getbuffermkvi
+buffers.gettex = getbuffertex
+buffers.run = runbuffer
implement { name = "getbufferctxlua", actions = loadcontent, arguments = "string" }
implement { name = "getbuffer", actions = getbuffer, arguments = "string" }
implement { name = "getbuffermkvi", actions = getbuffermkvi, arguments = "string" }
-implement { name = "gettexbuffer", actions = gettexbuffer, arguments = "string" }
+implement { name = "getbuffertex", actions = getbuffertex, arguments = "string" }
interfaces.implement {
name = "getbuffercontent",
@@ -849,6 +865,12 @@ implement {
arguments = "string"
}
+implement {
+ name = "doifelsebufferempty",
+ actions = { empty, commands.doifelse },
+ arguments = "string"
+}
+
-- This only used for mp buffers and is a kludge. Don't change the
-- texprint into texsprint as it fails because "p<nl>enddef" becomes
-- "penddef" then.
@@ -885,10 +907,10 @@ end
-- moved here:
function buffers.samplefile(name)
- if not buffers.exists(name) then
- buffers.assign(name,io.loaddata(resolvers.findfile(name)))
+ if not exists(name) then
+ assign(name,io.loaddata(resolvers.findfile(name)))
end
- buffers.get(name)
+ getbuffer(name)
end
implement {
diff --git a/Master/texmf-dist/tex/context/base/mkiv/buff-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/buff-ini.mkiv
index a8a120d903c..071a189873e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/buff-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/buff-ini.mkiv
@@ -22,8 +22,8 @@
\let\currentbuffer\empty
-\def\doifelsebuffer#1%
- {\clf_doifelsebuffer{#1}}
+ \def\doifelsebuffer #1{\clf_doifelsebuffer {#1}}
+\unexpanded\def\doifelsebufferempty#1{\clf_doifelsebufferempty{#1}}
\let\doifbufferelse\doifelsebuffer
@@ -246,12 +246,14 @@
% \savebufferinfile[x][temp.log] % gets name: temp.log
\installcorenamespace{savebuffer}
+\installcorenamespace{savebuffercounter}
-\installsetuponlycommandhandler \??savebuffer {savebuffer}
+\installcommandhandler \??savebuffer {savebuffer} \??savebuffer
\setupsavebuffer
[\c!list=,
\c!file=,
+ \c!directory=,
\c!prefix=\v!yes]
\unexpanded\def\savebuffer
@@ -262,9 +264,54 @@
\doifelseassignment{#1}
{\setupcurrentsavebuffer[#1]}%
{\setupcurrentsavebuffer[\c!list={#1},\c!file=#2]}%
- \clf_savebuffer{\directsavebufferparameter\c!list}{\directsavebufferparameter\c!file}{\directsavebufferparameter\c!prefix}%
+ \clf_savebuffer % will become key/value
+ {\savebufferparameter\c!list}%
+ {\savebufferparameter\c!file}%
+ {\savebufferparameter\c!prefix}%
+ {\savebufferparameter\c!option}%
+ {\savebufferparameter\c!directory}%
\endgroup}
+%D \starttyping
+%D \definesavebuffer[slide]
+%D
+%D \starttext
+%D \startslide
+%D \starttext
+%D \stopslide
+%D \startslide
+%D slide 1
+%D \stopslide
+%D text 1 \par
+%D \startslide
+%D slide 2
+%D \stopslide
+%D text 2 \par
+%D \startslide
+%D \stoptext
+%D \stopslide
+%D \stoptext
+%D \stoptyping
+
+\appendtoks
+ \ifcsname\e!stop\currentsavebuffer\endcsname\else
+ \definebuffer[\currentsavebuffer]%
+ \expandafter\newcount\csname\??savebuffercounter\currentsavebuffer\endcsname
+ \setuevalue{\e!stop\currentsavebuffer}{\buff_stop_save_buffer{\currentsavebuffer}}%
+ \setsavebufferparameter\c!file{\currentsavebuffer.tex}%
+ \fi
+\to \everydefinesavebuffer
+
+\protected\def\buff_stop_save_buffer#1%
+ {\edef\currentsavebuffer{#1}%
+ \global\advance\csname\??savebuffercounter\currentsavebuffer\endcsname\plusone
+ \clf_savebuffer % will become key/value
+ {\thedefinedbuffer{\currentsavebuffer}}%
+ {\savebufferparameter\c!file}%
+ {\savebufferparameter\c!prefix}%
+ {\ifnum\csname\??savebuffercounter\currentsavebuffer\endcsname>\plusone\v!append\fi}%
+ {\savebufferparameter\c!directory}}
+
%D Experimental: no expansion of commands in buffer!
% \startbuffer[what]
diff --git a/Master/texmf-dist/tex/context/base/mkiv/buff-ver.lua b/Master/texmf-dist/tex/context/base/mkiv/buff-ver.lua
index ccb8ab0df8e..2a8e3b8c2b4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/buff-ver.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/buff-ver.lua
@@ -807,8 +807,8 @@ local nospace = space^1/""
local endstring = P(-1)
local compactors = {
- [v_all] = Cs((backslash * (1-backslash-space)^1 * nospace * (endstring+fences) + 1)^0),
- [v_absolute] = Cs((backslash * (1-symbols -space)^1 * nospace * (symbols+backslash) + 1)^0),
+ [v_all] = Cs((backslash * (1-backslash-space)^1 * nospace * (endstring + fences + #backslash) + 1)^0),
+ [v_absolute] = Cs((backslash * (1-symbols -space)^1 * nospace * (symbols + backslash ) + 1)^0),
[v_last] = Cs((space^1 * endstring/"" + 1)^0),
}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/char-def.lua b/Master/texmf-dist/tex/context/base/mkiv/char-def.lua
index 7a04e869d19..1aea51318fa 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/char-def.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/char-def.lua
@@ -19,11 +19,16 @@ the trouble. Some additional data is kept in other files.
For a generic subset of the data here, run "context luatex-basics-prepare.tex" after
adapting this file.
+
+Updated end 2021 as prelude to ar's remote talk at the meeting. Needs some indic
+checking (see comment field).
+
+Todo: get rid of specials = { "font", ... } in math ... we have already vectors.
]]--
local variants_emoji={
- [0xFE0E]="text style",
- [0xFE0F]="emoji style",
+ [0xFE0E]="text style",
+ [0xFE0F]="emoji style",
}
local variants_forms={
@@ -31,6 +36,52 @@ local variants_forms={
[0xFE01]="centered form",
}
+local variants_style={
+ [0xFE00]="chancery style",
+ [0xFE01]="roundhand style",
+}
+
+local variants_dotted={
+ [0xFE00]="dotted form",
+}
+
+local variants_90={
+ [0xFE00]="rotated 90 degrees",
+}
+
+local variants_180={
+ [0xFE01]="rotated 180 degrees",
+}
+
+local variants_270={
+ [0xFE02]="rotated 270 degrees",
+}
+
+local variants_expanded={
+ [0xFE00]="expanded",
+}
+
+local variants_90_180={
+ [0xFE00]="rotated 90 degrees",
+ [0xFE01]="rotated 180 degrees",
+}
+
+local variants_90_180_270={
+ [0xFE00]="rotated 90 degrees",
+ [0xFE01]="rotated 180 degrees",
+ [0xFE02]="rotated 270 degrees",
+}
+
+local variants_180_270={
+ [0xFE01]="rotated 180 degrees",
+ [0xFE02]="rotated 270 degrees",
+}
+
+local variants_90_270={
+ [0xFE00]="rotated 90 degrees",
+ [0xFE02]="rotated 270 degrees",
+}
+
characters = characters or { }
characters.data={
@@ -314,7 +365,7 @@ characters.data={
description="EXCLAMATION MARK",
direction="on",
linebreak="ex",
- mathclass="close",
+ mathclass="factorial",
synonyms={ "bang", "factorial" },
unicodeslot=0x21,
},
@@ -326,7 +377,7 @@ characters.data={
description="QUOTATION MARK",
direction="on",
linebreak="qu",
- mathclass="default",
+ mathclass="ordinary",
synonyms={ "neutral quotation mark" },
unicodeslot=0x22,
},
@@ -389,7 +440,7 @@ characters.data={
description="APOSTROPHE",
direction="on",
linebreak="qu",
- mathclass="default",
+ mathclass="ordinary",
synonyms={ "apl quote", "apostrophe-quote", "neutral single quotation mark" },
unicodeslot=0x27,
},
@@ -442,6 +493,7 @@ characters.data={
direction="es",
linebreak="pr",
mathclass="binary",
+ mathgroup="nary arithmetic",
unicodeslot=0x2B,
},
{
@@ -464,9 +516,10 @@ characters.data={
description="HYPHEN-MINUS",
direction="es",
linebreak="hy",
- mathclass="nothing",
+ mathclass="ordinary",
mathextensible="h",
mathfiller="relfill",
+ mathgroup="binary arithmetic",
mathname="mathhyphen",
mathsymbol=0x2212,
synonyms={ "hyphen or minus sign", "hyphus" },
@@ -481,8 +534,16 @@ characters.data={
description="FULL STOP",
direction="cs",
linebreak="is",
- mathclass="punctuation",
- mathname="ldotp",
+ mathspec={
+ {
+ class="binary",
+ name="ldot",
+ },
+ {
+ class="punctuation",
+ name="ldotp",
+ },
+ },
synonyms={ "decimal point", "dot", "period" },
unicodeslot=0x2E,
},
@@ -494,7 +555,17 @@ characters.data={
description="SOLIDUS",
direction="cs",
linebreak="sy",
- mathclass="middle",
+ mathclass="division",
+ mathspec={
+ {
+ class="division",
+ name="slash",
+ },
+ {
+ class="division",
+ name="solidus",
+ },
+ },
synonyms={ "slash", "virgule" },
unicodeslot=0x2F,
},
@@ -505,7 +576,7 @@ characters.data={
description="DIGIT ZERO",
direction="en",
linebreak="nu",
- mathclass="number",
+ mathclass="digit",
unicodeslot=0x30,
variants={
[0xFE00]="short diagonal stroke form",
@@ -520,7 +591,7 @@ characters.data={
description="DIGIT ONE",
direction="en",
linebreak="nu",
- mathclass="number",
+ mathclass="digit",
unicodeslot=0x31,
variants=variants_emoji,
},
@@ -531,7 +602,7 @@ characters.data={
description="DIGIT TWO",
direction="en",
linebreak="nu",
- mathclass="number",
+ mathclass="digit",
unicodeslot=0x32,
variants=variants_emoji,
},
@@ -542,7 +613,7 @@ characters.data={
description="DIGIT THREE",
direction="en",
linebreak="nu",
- mathclass="number",
+ mathclass="digit",
unicodeslot=0x33,
variants=variants_emoji,
},
@@ -553,7 +624,7 @@ characters.data={
description="DIGIT FOUR",
direction="en",
linebreak="nu",
- mathclass="number",
+ mathclass="digit",
unicodeslot=0x34,
variants=variants_emoji,
},
@@ -564,7 +635,7 @@ characters.data={
description="DIGIT FIVE",
direction="en",
linebreak="nu",
- mathclass="number",
+ mathclass="digit",
unicodeslot=0x35,
variants=variants_emoji,
},
@@ -575,7 +646,7 @@ characters.data={
description="DIGIT SIX",
direction="en",
linebreak="nu",
- mathclass="number",
+ mathclass="digit",
unicodeslot=0x36,
variants=variants_emoji,
},
@@ -586,7 +657,7 @@ characters.data={
description="DIGIT SEVEN",
direction="en",
linebreak="nu",
- mathclass="number",
+ mathclass="digit",
unicodeslot=0x37,
variants=variants_emoji,
},
@@ -597,7 +668,7 @@ characters.data={
description="DIGIT EIGHT",
direction="en",
linebreak="nu",
- mathclass="number",
+ mathclass="digit",
unicodeslot=0x38,
variants=variants_emoji,
},
@@ -608,7 +679,7 @@ characters.data={
description="DIGIT NINE",
direction="en",
linebreak="nu",
- mathclass="number",
+ mathclass="digit",
unicodeslot=0x39,
variants=variants_emoji,
},
@@ -621,6 +692,7 @@ characters.data={
direction="cs",
linebreak="is",
mathclass="relation",
+--mathsymbol=0x2236,
unicodeslot=0x3A,
},
{
@@ -642,6 +714,7 @@ characters.data={
direction="on",
linebreak="al",
mathclass="relation",
+ mathgroup="nary relation",
mathname="lt",
mirror=0x3E,
textclass="open",
@@ -657,6 +730,7 @@ characters.data={
linebreak="al",
mathextensible="h",
mathfiller="equalfill",
+ mathgroup="nary relation",
mathspec={
{
class="relation",
@@ -664,6 +738,7 @@ characters.data={
},
{
class="relation",
+ comment="useless",
name="Relbar",
},
},
@@ -677,6 +752,7 @@ characters.data={
direction="on",
linebreak="al",
mathclass="relation",
+ mathgroup="nary relation",
mathname="gt",
mirror=0x3C,
textclass="close",
@@ -711,7 +787,6 @@ characters.data={
direction="l",
lccode=0x61,
linebreak="al",
- mathclass="variable",
unicodeslot=0x41,
},
{
@@ -722,7 +797,6 @@ characters.data={
direction="l",
lccode=0x62,
linebreak="al",
- mathclass="variable",
unicodeslot=0x42,
},
{
@@ -733,7 +807,6 @@ characters.data={
direction="l",
lccode=0x63,
linebreak="al",
- mathclass="variable",
unicodeslot=0x43,
},
{
@@ -744,7 +817,6 @@ characters.data={
direction="l",
lccode=0x64,
linebreak="al",
- mathclass="variable",
unicodeslot=0x44,
},
{
@@ -755,7 +827,6 @@ characters.data={
direction="l",
lccode=0x65,
linebreak="al",
- mathclass="variable",
unicodeslot=0x45,
},
{
@@ -766,7 +837,6 @@ characters.data={
direction="l",
lccode=0x66,
linebreak="al",
- mathclass="variable",
unicodeslot=0x46,
},
{
@@ -777,7 +847,6 @@ characters.data={
direction="l",
lccode=0x67,
linebreak="al",
- mathclass="variable",
unicodeslot=0x47,
},
{
@@ -788,7 +857,6 @@ characters.data={
direction="l",
lccode=0x68,
linebreak="al",
- mathclass="variable",
unicodeslot=0x48,
},
{
@@ -800,7 +868,6 @@ characters.data={
direction="l",
lccode=0x69,
linebreak="al",
- mathclass="variable",
unicodeslot=0x49,
},
{
@@ -812,7 +879,6 @@ characters.data={
direction="l",
lccode=0x6A,
linebreak="al",
- mathclass="variable",
unicodeslot=0x4A,
},
{
@@ -823,7 +889,6 @@ characters.data={
direction="l",
lccode=0x6B,
linebreak="al",
- mathclass="variable",
unicodeslot=0x4B,
},
{
@@ -834,7 +899,6 @@ characters.data={
direction="l",
lccode=0x6C,
linebreak="al",
- mathclass="variable",
unicodeslot=0x4C,
},
{
@@ -845,7 +909,6 @@ characters.data={
direction="l",
lccode=0x6D,
linebreak="al",
- mathclass="variable",
unicodeslot=0x4D,
},
{
@@ -856,7 +919,6 @@ characters.data={
direction="l",
lccode=0x6E,
linebreak="al",
- mathclass="variable",
unicodeslot=0x4E,
},
{
@@ -867,7 +929,6 @@ characters.data={
direction="l",
lccode=0x6F,
linebreak="al",
- mathclass="variable",
unicodeslot=0x4F,
},
{
@@ -878,7 +939,6 @@ characters.data={
direction="l",
lccode=0x70,
linebreak="al",
- mathclass="variable",
unicodeslot=0x50,
},
{
@@ -889,7 +949,6 @@ characters.data={
direction="l",
lccode=0x71,
linebreak="al",
- mathclass="variable",
unicodeslot=0x51,
},
{
@@ -900,7 +959,6 @@ characters.data={
direction="l",
lccode=0x72,
linebreak="al",
- mathclass="variable",
unicodeslot=0x52,
},
{
@@ -911,7 +969,6 @@ characters.data={
direction="l",
lccode=0x73,
linebreak="al",
- mathclass="variable",
unicodeslot=0x53,
},
{
@@ -922,7 +979,6 @@ characters.data={
direction="l",
lccode=0x74,
linebreak="al",
- mathclass="variable",
unicodeslot=0x54,
},
{
@@ -933,7 +989,6 @@ characters.data={
direction="l",
lccode=0x75,
linebreak="al",
- mathclass="variable",
unicodeslot=0x55,
},
{
@@ -944,7 +999,6 @@ characters.data={
direction="l",
lccode=0x76,
linebreak="al",
- mathclass="variable",
unicodeslot=0x56,
},
{
@@ -955,7 +1009,6 @@ characters.data={
direction="l",
lccode=0x77,
linebreak="al",
- mathclass="variable",
unicodeslot=0x57,
},
{
@@ -966,7 +1019,6 @@ characters.data={
direction="l",
lccode=0x78,
linebreak="al",
- mathclass="variable",
unicodeslot=0x58,
},
{
@@ -977,7 +1029,6 @@ characters.data={
direction="l",
lccode=0x79,
linebreak="al",
- mathclass="variable",
unicodeslot=0x59,
},
{
@@ -988,7 +1039,6 @@ characters.data={
direction="l",
lccode=0x7A,
linebreak="al",
- mathclass="variable",
unicodeslot=0x5A,
},
{
@@ -1013,7 +1063,7 @@ characters.data={
description="REVERSE SOLIDUS",
direction="on",
linebreak="pr",
- mathclass="nothing",
+ mathclass="division",
mathname="backslash",
synonyms={ "backslash" },
unicodeslot=0x5C,
@@ -1036,12 +1086,13 @@ characters.data={
adobename="asciicircum",
category="sk",
cjkwd="na",
+ comment="the Hat looks rediculous in most fonts",
contextname="textasciicircum",
description="CIRCUMFLEX ACCENT",
direction="on",
linebreak="al",
- mathclass="topaccent",
- mathname="Hat",
+--mathclass="topaccent",
+--mathname="Hat",
synonyms={ "spacing circumflex accent" },
unicodeslot=0x5E,
},
@@ -1064,8 +1115,17 @@ characters.data={
description="GRAVE ACCENT",
direction="on",
linebreak="al",
- mathclass="topaccent",
- mathname="grave",
+ mathspec={
+ {
+ class="topaccent",
+ name="grave",
+ },
+ {
+ class="topaccent",
+ name="widegrave",
+ stretch="h",
+ },
+ },
synonyms={ "spacing grave accent" },
unicodeslot=0x60,
},
@@ -1076,7 +1136,6 @@ characters.data={
description="LATIN SMALL LETTER A",
direction="l",
linebreak="al",
- mathclass="variable",
uccode=0x41,
unicodeslot=0x61,
},
@@ -1087,7 +1146,6 @@ characters.data={
description="LATIN SMALL LETTER B",
direction="l",
linebreak="al",
- mathclass="variable",
uccode=0x42,
unicodeslot=0x62,
},
@@ -1098,7 +1156,6 @@ characters.data={
description="LATIN SMALL LETTER C",
direction="l",
linebreak="al",
- mathclass="variable",
uccode=0x43,
unicodeslot=0x63,
},
@@ -1109,7 +1166,6 @@ characters.data={
description="LATIN SMALL LETTER D",
direction="l",
linebreak="al",
- mathclass="variable",
uccode=0x44,
unicodeslot=0x64,
},
@@ -1120,7 +1176,6 @@ characters.data={
description="LATIN SMALL LETTER E",
direction="l",
linebreak="al",
- mathclass="variable",
uccode=0x45,
unicodeslot=0x65,
},
@@ -1131,7 +1186,6 @@ characters.data={
description="LATIN SMALL LETTER F",
direction="l",
linebreak="al",
- mathclass="variable",
uccode=0x46,
unicodeslot=0x66,
},
@@ -1142,7 +1196,6 @@ characters.data={
description="LATIN SMALL LETTER G",
direction="l",
linebreak="al",
- mathclass="variable",
uccode=0x47,
unicodeslot=0x67,
},
@@ -1153,7 +1206,6 @@ characters.data={
description="LATIN SMALL LETTER H",
direction="l",
linebreak="al",
- mathclass="variable",
uccode=0x48,
unicodeslot=0x68,
},
@@ -1165,7 +1217,6 @@ characters.data={
description="LATIN SMALL LETTER I",
direction="l",
linebreak="al",
- mathclass="variable",
uccode=0x49,
unicodeslot=0x69,
},
@@ -1176,7 +1227,6 @@ characters.data={
description="LATIN SMALL LETTER J",
direction="l",
linebreak="al",
- mathclass="variable",
uccode=0x4A,
unicodeslot=0x6A,
},
@@ -1187,7 +1237,6 @@ characters.data={
description="LATIN SMALL LETTER K",
direction="l",
linebreak="al",
- mathclass="variable",
uccode=0x4B,
unicodeslot=0x6B,
},
@@ -1198,7 +1247,6 @@ characters.data={
description="LATIN SMALL LETTER L",
direction="l",
linebreak="al",
- mathclass="variable",
uccode=0x4C,
unicodeslot=0x6C,
},
@@ -1209,7 +1257,6 @@ characters.data={
description="LATIN SMALL LETTER M",
direction="l",
linebreak="al",
- mathclass="variable",
uccode=0x4D,
unicodeslot=0x6D,
},
@@ -1220,7 +1267,6 @@ characters.data={
description="LATIN SMALL LETTER N",
direction="l",
linebreak="al",
- mathclass="variable",
uccode=0x4E,
unicodeslot=0x6E,
},
@@ -1231,7 +1277,6 @@ characters.data={
description="LATIN SMALL LETTER O",
direction="l",
linebreak="al",
- mathclass="variable",
uccode=0x4F,
unicodeslot=0x6F,
},
@@ -1242,7 +1287,6 @@ characters.data={
description="LATIN SMALL LETTER P",
direction="l",
linebreak="al",
- mathclass="variable",
uccode=0x50,
unicodeslot=0x70,
},
@@ -1253,7 +1297,6 @@ characters.data={
description="LATIN SMALL LETTER Q",
direction="l",
linebreak="al",
- mathclass="variable",
uccode=0x51,
unicodeslot=0x71,
},
@@ -1264,7 +1307,6 @@ characters.data={
description="LATIN SMALL LETTER R",
direction="l",
linebreak="al",
- mathclass="variable",
uccode=0x52,
unicodeslot=0x72,
},
@@ -1275,7 +1317,6 @@ characters.data={
description="LATIN SMALL LETTER S",
direction="l",
linebreak="al",
- mathclass="variable",
uccode=0x53,
unicodeslot=0x73,
},
@@ -1286,7 +1327,6 @@ characters.data={
description="LATIN SMALL LETTER T",
direction="l",
linebreak="al",
- mathclass="variable",
uccode=0x54,
unicodeslot=0x74,
},
@@ -1297,7 +1337,6 @@ characters.data={
description="LATIN SMALL LETTER U",
direction="l",
linebreak="al",
- mathclass="variable",
uccode=0x55,
unicodeslot=0x75,
},
@@ -1308,7 +1347,6 @@ characters.data={
description="LATIN SMALL LETTER V",
direction="l",
linebreak="al",
- mathclass="variable",
uccode=0x56,
unicodeslot=0x76,
},
@@ -1319,7 +1357,6 @@ characters.data={
description="LATIN SMALL LETTER W",
direction="l",
linebreak="al",
- mathclass="variable",
uccode=0x57,
unicodeslot=0x77,
},
@@ -1330,7 +1367,6 @@ characters.data={
description="LATIN SMALL LETTER X",
direction="l",
linebreak="al",
- mathclass="variable",
uccode=0x58,
unicodeslot=0x78,
},
@@ -1341,7 +1377,6 @@ characters.data={
description="LATIN SMALL LETTER Y",
direction="l",
linebreak="al",
- mathclass="variable",
uccode=0x59,
unicodeslot=0x79,
},
@@ -1352,7 +1387,6 @@ characters.data={
description="LATIN SMALL LETTER Z",
direction="l",
linebreak="al",
- mathclass="variable",
uccode=0x5A,
unicodeslot=0x7A,
},
@@ -1380,11 +1414,12 @@ characters.data={
description="VERTICAL LINE",
direction="on",
linebreak="ba",
+ mathclass="ordinary",
mathspec={
- {
- class="nothing",
- name="arrowvert",
- },
+-- {
+-- class="ordinary",
+-- name="arrowvert",
+-- },
{
class="delimiter",
name="vert",
@@ -1394,12 +1429,12 @@ characters.data={
name="lvert",
},
{
- class="close",
- name="rvert",
+ class="middle",
+ name="mvert",
},
{
- class="relation",
- name="mid",
+ class="close",
+ name="rvert",
},
{
class="delimiter",
@@ -1432,6 +1467,7 @@ characters.data={
description="TILDE",
direction="on",
linebreak="al",
+ mathclass="relation",
synonyms={ "spacing tilde" },
unicodeslot=0x7E,
},
@@ -1729,7 +1765,7 @@ characters.data={
description="YEN SIGN",
direction="et",
linebreak="pr",
- mathclass="nothing",
+ mathclass="ordinary",
mathname="yen",
synonyms={ "yuan sign" },
unicodeslot=0xA5,
@@ -1753,7 +1789,7 @@ characters.data={
description="SECTION SIGN",
direction="on",
linebreak="ai",
- mathclass="box",
+ mathclass="ordinary",
mathname="S",
synonyms={ "european paragraph sign" },
unicodeslot=0xA7,
@@ -1766,8 +1802,17 @@ characters.data={
description="DIAERESIS",
direction="on",
linebreak="ai",
- mathclass="topaccent",
- mathname="ddot",
+ mathspec={
+ {
+ class="topaccent",
+ name="ddot",
+ },
+ {
+ class="topaccent",
+ name="wideddot",
+ stretch="h",
+ },
+ },
specials={ "compat", 0x20, 0x308 },
synonyms={ "spacing diaeresis" },
unicodeslot=0xA8,
@@ -1857,10 +1902,20 @@ characters.data={
description="MACRON",
direction="on",
linebreak="al",
- mathclass="topaccent",
- mathfiller="barfill",
- mathmleq=0x203E,
- mathname="bar",
+--mathclass="topaccent",
+--mathfiller="barfill",
+--mathmleq=0x203E,
+ mathspec={
+ {
+ class="topaccent",
+ name="bar",
+ },
+ {
+ class="topaccent",
+ name="widebar",
+ stretch="h",
+ },
+ },
specials={ "compat", 0x20, 0x304 },
synonyms={ "apl overbar", "overline", "spacing macron" },
unicodeslot=0xAF,
@@ -1919,8 +1974,17 @@ characters.data={
description="ACUTE ACCENT",
direction="on",
linebreak="bb",
- mathclass="topaccent",
- mathname="acute",
+ mathspec={
+ {
+ class="topaccent",
+ name="acute",
+ },
+ {
+ class="topaccent",
+ name="wideacute",
+ stretch="h",
+ },
+ },
specials={ "compat", 0x20, 0x301 },
synonyms={ "spacing acute accent" },
unicodeslot=0xB4,
@@ -1933,7 +1997,7 @@ characters.data={
direction="l",
linebreak="al",
specials={ "compat", 0x3BC },
- uccode=0x39C,
+ uccode=0x3BC,
unicodeslot=0xB5,
},
{
@@ -1944,7 +2008,7 @@ characters.data={
description="PILCROW SIGN",
direction="on",
linebreak="ai",
- mathclass="box",
+ mathclass="ordinary",
mathname="P",
synonyms={ "european section sign", "paragraph sign" },
unicodeslot=0xB6,
@@ -2337,6 +2401,7 @@ characters.data={
direction="on",
linebreak="ai",
mathclass="binary",
+ mathgroup="nary arithmetic",
mathname="times",
synonyms={ "cartesian product" },
unicodeslot=0xD7,
@@ -2736,6 +2801,7 @@ characters.data={
direction="on",
linebreak="ai",
mathclass="binary",
+ mathgroup="binary arithmetic",
mathname="div",
synonyms={ "obelus" },
unicodeslot=0xF7,
@@ -3738,6 +3804,7 @@ characters.data={
direction="l",
linebreak="al",
specials={ "compat", 0x2BC, 0x6E },
+ uccode={ 0x2BC, 0x6E },
unicodeslot=0x149,
},
{
@@ -4387,7 +4454,7 @@ characters.data={
direction="l",
linebreak="al",
specials={ "compat", 0x73 },
- uccode=0x53,
+ uccode=0x73,
unicodeslot=0x17F,
},
{
@@ -4683,7 +4750,6 @@ characters.data={
description="LATIN SMALL LETTER LAMBDA WITH STROKE",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="lambdabar",
synonyms={ "latin letter lambda bar" },
unicodeslot=0x19B,
@@ -5638,6 +5704,7 @@ characters.data={
linebreak="al",
shcode=0x6A,
specials={ "char", 0x6A, 0x30C },
+ uccode={ 0x6A, 0x30C },
unicodeslot=0x1F0,
},
{
@@ -7680,8 +7747,17 @@ characters.data={
description="MODIFIER LETTER CIRCUMFLEX ACCENT",
direction="on",
linebreak="al",
- mathclass="topaccent",
- mathname="hat",
+ mathspec={
+ {
+ class="topaccent",
+ name="hat",
+ },
+ {
+ class="topaccent",
+ name="widehat",
+ stretch="h",
+ },
+ },
specials={ "compat", 0x20, 0x302 },
unicodeslot=0x2C6,
},
@@ -7694,8 +7770,17 @@ characters.data={
description="CARON",
direction="on",
linebreak="ai",
- mathclass="topaccent",
- mathname="check",
+ mathspec={
+ {
+ class="topaccent",
+ name="check",
+ },
+ {
+ class="topaccent",
+ name="widecheck",
+ stretch="h",
+ },
+ },
specials={ "compat", 0x20, 0x30C },
synonyms={ "mandarin chinese third tone", "modifier letter hacek" },
unicodeslot=0x2C7,
@@ -7844,8 +7929,17 @@ characters.data={
description="BREVE",
direction="on",
linebreak="ai",
- mathclass="topaccent",
- mathname="breve",
+ mathspec={
+ {
+ class="topaccent",
+ name="breve",
+ },
+ {
+ class="topaccent",
+ name="widebreve",
+ stretch="h",
+ },
+ },
specials={ "compat", 0x20, 0x306 },
unicodeslot=0x2D8,
},
@@ -7857,8 +7951,17 @@ characters.data={
description="DOT ABOVE",
direction="on",
linebreak="ai",
- mathclass="topaccent",
- mathname="dot",
+ mathspec={
+ {
+ class="topaccent",
+ name="dot",
+ },
+ {
+ class="topaccent",
+ name="widedot",
+ stretch="h",
+ },
+ },
specials={ "compat", 0x20, 0x307 },
synonyms={ "mandarin chinese fifth or neutral tone" },
unicodeslot=0x2D9,
@@ -7871,8 +7974,17 @@ characters.data={
description="RING ABOVE",
direction="on",
linebreak="ai",
- mathclass="topaccent",
- mathname="ring",
+ mathspec={
+ {
+ class="topaccent",
+ name="ring",
+ },
+ {
+ class="topaccent",
+ name="widering",
+ stretch="h",
+ },
+ },
specials={ "compat", 0x20, 0x30A },
unicodeslot=0x2DA,
},
@@ -7894,8 +8006,17 @@ characters.data={
description="SMALL TILDE",
direction="on",
linebreak="al",
- mathclass="topaccent",
- mathname="tilde",
+ mathspec={
+ {
+ class="topaccent",
+ name="tilde",
+ },
+ {
+ class="topaccent",
+ name="widetilde",
+ stretch="h",
+ },
+ },
specials={ "compat", 0x20, 0x303 },
unicodeslot=0x2DC,
},
@@ -8194,9 +8315,6 @@ characters.data={
description="COMBINING CIRCUMFLEX ACCENT",
direction="nsm",
linebreak="cm",
- mathclass="topaccent",
- mathname="widehat",
- mathstretch="h",
unicodeslot=0x302,
},
{
@@ -8207,9 +8325,6 @@ characters.data={
description="COMBINING TILDE",
direction="nsm",
linebreak="cm",
- mathclass="topaccent",
- mathname="widetilde",
- mathstretch="h",
unicodeslot=0x303,
},
{
@@ -8691,6 +8806,7 @@ characters.data={
description="COMBINING LOW LINE",
direction="nsm",
linebreak="cm",
+ mathextensible="l",
synonyms={ "underline", "underscore" },
unicodeslot=0x332,
},
@@ -9281,6 +9397,7 @@ characters.data={
category="lu",
description="GREEK CAPITAL LETTER HETA",
direction="l",
+ lccode=0x371,
linebreak="al",
unicodeslot=0x370,
},
@@ -9295,6 +9412,7 @@ characters.data={
category="lu",
description="GREEK CAPITAL LETTER ARCHAIC SAMPI",
direction="l",
+ lccode=0x373,
linebreak="al",
unicodeslot=0x372,
},
@@ -9326,6 +9444,7 @@ characters.data={
category="lu",
description="GREEK CAPITAL LETTER PAMPHYLIAN DIGAMMA",
direction="l",
+ lccode=0x377,
linebreak="al",
unicodeslot=0x376,
},
@@ -9382,6 +9501,7 @@ characters.data={
category="lu",
description="GREEK CAPITAL LETTER YOT",
direction="l",
+ lccode=0x3F3,
linebreak="al",
unicodeslot=0x37F,
},
@@ -9507,6 +9627,7 @@ characters.data={
linebreak="al",
shcode=0x3B9,
specials={ "char", 0x3CA, 0x301 },
+ uccode={ 0x3B9, 0x308, 0x301 },
unicodeslot=0x390,
},
[0x391]={
@@ -9518,7 +9639,6 @@ characters.data={
direction="l",
lccode=0x3B1,
linebreak="al",
- mathclass="variable",
mathname="Alpha",
unicodeslot=0x391,
},
@@ -9531,7 +9651,6 @@ characters.data={
direction="l",
lccode=0x3B2,
linebreak="al",
- mathclass="variable",
mathname="Beta",
unicodeslot=0x392,
},
@@ -9544,7 +9663,6 @@ characters.data={
direction="l",
lccode=0x3B3,
linebreak="al",
- mathclass="variable",
mathname="Gamma",
synonyms={ "gamma function" },
unicodeslot=0x393,
@@ -9558,7 +9676,6 @@ characters.data={
direction="l",
lccode=0x3B4,
linebreak="al",
- mathclass="variable",
mathname="Delta",
unicodeslot=0x394,
},
@@ -9571,7 +9688,6 @@ characters.data={
direction="l",
lccode=0x3B5,
linebreak="al",
- mathclass="variable",
mathname="Epsilon",
unicodeslot=0x395,
},
@@ -9584,7 +9700,6 @@ characters.data={
direction="l",
lccode=0x3B6,
linebreak="al",
- mathclass="variable",
mathname="Zeta",
unicodeslot=0x396,
},
@@ -9597,7 +9712,6 @@ characters.data={
direction="l",
lccode=0x3B7,
linebreak="al",
- mathclass="variable",
mathname="Eta",
unicodeslot=0x397,
},
@@ -9610,7 +9724,6 @@ characters.data={
direction="l",
lccode=0x3B8,
linebreak="al",
- mathclass="variable",
mathname="Theta",
unicodeslot=0x398,
},
@@ -9623,7 +9736,6 @@ characters.data={
direction="l",
lccode=0x3B9,
linebreak="al",
- mathclass="variable",
mathname="Iota",
unicodeslot=0x399,
},
@@ -9636,7 +9748,6 @@ characters.data={
direction="l",
lccode=0x3BA,
linebreak="al",
- mathclass="variable",
mathname="Kappa",
unicodeslot=0x39A,
},
@@ -9649,7 +9760,6 @@ characters.data={
direction="l",
lccode=0x3BB,
linebreak="al",
- mathclass="variable",
mathname="Lambda",
unicodeslot=0x39B,
},
@@ -9662,7 +9772,6 @@ characters.data={
direction="l",
lccode=0x3BC,
linebreak="al",
- mathclass="variable",
mathname="Mu",
unicodeslot=0x39C,
},
@@ -9675,7 +9784,6 @@ characters.data={
direction="l",
lccode=0x3BD,
linebreak="al",
- mathclass="variable",
mathname="Nu",
unicodeslot=0x39D,
},
@@ -9688,7 +9796,6 @@ characters.data={
direction="l",
lccode=0x3BE,
linebreak="al",
- mathclass="variable",
mathname="Xi",
unicodeslot=0x39E,
},
@@ -9701,7 +9808,6 @@ characters.data={
direction="l",
lccode=0x3BF,
linebreak="al",
- mathclass="variable",
mathname="Omicron",
unicodeslot=0x39F,
},
@@ -9714,7 +9820,6 @@ characters.data={
direction="l",
lccode=0x3C0,
linebreak="al",
- mathclass="variable",
mathname="Pi",
unicodeslot=0x3A0,
},
@@ -9727,7 +9832,6 @@ characters.data={
direction="l",
lccode=0x3C1,
linebreak="al",
- mathclass="variable",
mathname="Rho",
unicodeslot=0x3A1,
},
@@ -9740,7 +9844,6 @@ characters.data={
direction="l",
lccode=0x3C3,
linebreak="al",
- mathclass="variable",
mathname="Sigma",
unicodeslot=0x3A3,
},
@@ -9753,7 +9856,6 @@ characters.data={
direction="l",
lccode=0x3C4,
linebreak="al",
- mathclass="variable",
mathname="Tau",
unicodeslot=0x3A4,
},
@@ -9766,7 +9868,6 @@ characters.data={
direction="l",
lccode=0x3C5,
linebreak="al",
- mathclass="variable",
mathname="Upsilon",
unicodeslot=0x3A5,
},
@@ -9779,7 +9880,6 @@ characters.data={
direction="l",
lccode=0x3C6,
linebreak="al",
- mathclass="variable",
mathname="Phi",
unicodeslot=0x3A6,
},
@@ -9792,7 +9892,6 @@ characters.data={
direction="l",
lccode=0x3C7,
linebreak="al",
- mathclass="variable",
mathname="Chi",
unicodeslot=0x3A7,
},
@@ -9805,7 +9904,6 @@ characters.data={
direction="l",
lccode=0x3C8,
linebreak="al",
- mathclass="variable",
mathname="Psi",
unicodeslot=0x3A8,
},
@@ -9818,7 +9916,6 @@ characters.data={
direction="l",
lccode=0x3C9,
linebreak="al",
- mathclass="variable",
mathname="Omega",
unicodeslot=0x3A9,
},
@@ -9903,6 +10000,7 @@ characters.data={
linebreak="al",
shcode=0x3C5,
specials={ "char", 0x3CB, 0x301 },
+ uccode={ 0x3C5, 0x308, 0x301 },
unicodeslot=0x3B0,
},
[0x3B1]={
@@ -9913,7 +10011,6 @@ characters.data={
description="GREEK SMALL LETTER ALPHA",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="alpha",
uccode=0x391,
unicodeslot=0x3B1,
@@ -9926,7 +10023,6 @@ characters.data={
description="GREEK SMALL LETTER BETA",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="beta",
uccode=0x392,
unicodeslot=0x3B2,
@@ -9939,7 +10035,6 @@ characters.data={
description="GREEK SMALL LETTER GAMMA",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="gamma",
uccode=0x393,
unicodeslot=0x3B3,
@@ -9952,7 +10047,6 @@ characters.data={
description="GREEK SMALL LETTER DELTA",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="delta",
uccode=0x394,
unicodeslot=0x3B4,
@@ -9965,7 +10059,6 @@ characters.data={
description="GREEK SMALL LETTER EPSILON",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="varepsilon",
uccode=0x395,
unicodeslot=0x3B5,
@@ -9978,7 +10071,6 @@ characters.data={
description="GREEK SMALL LETTER ZETA",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="zeta",
uccode=0x396,
unicodeslot=0x3B6,
@@ -9991,7 +10083,6 @@ characters.data={
description="GREEK SMALL LETTER ETA",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="eta",
uccode=0x397,
unicodeslot=0x3B7,
@@ -10004,7 +10095,6 @@ characters.data={
description="GREEK SMALL LETTER THETA",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="theta",
uccode=0x398,
unicodeslot=0x3B8,
@@ -10017,7 +10107,6 @@ characters.data={
description="GREEK SMALL LETTER IOTA",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="iota",
uccode=0x399,
unicodeslot=0x3B9,
@@ -10030,7 +10119,6 @@ characters.data={
description="GREEK SMALL LETTER KAPPA",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="kappa",
uccode=0x39A,
unicodeslot=0x3BA,
@@ -10043,7 +10131,6 @@ characters.data={
description="GREEK SMALL LETTER LAMDA",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="lambda",
uccode=0x39B,
unicodeslot=0x3BB,
@@ -10056,7 +10143,6 @@ characters.data={
description="GREEK SMALL LETTER MU",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="mu",
uccode=0x39C,
unicodeslot=0x3BC,
@@ -10069,7 +10155,6 @@ characters.data={
description="GREEK SMALL LETTER NU",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="nu",
uccode=0x39D,
unicodeslot=0x3BD,
@@ -10082,7 +10167,6 @@ characters.data={
description="GREEK SMALL LETTER XI",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="xi",
uccode=0x39E,
unicodeslot=0x3BE,
@@ -10095,7 +10179,6 @@ characters.data={
description="GREEK SMALL LETTER OMICRON",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="omicron",
uccode=0x39F,
unicodeslot=0x3BF,
@@ -10108,7 +10191,6 @@ characters.data={
description="GREEK SMALL LETTER PI",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="pi",
synonyms={ "mathematical constant 3.141592... pi", "mathematical constant pi" },
uccode=0x3A0,
@@ -10122,7 +10204,6 @@ characters.data={
description="GREEK SMALL LETTER RHO",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="rho",
uccode=0x3A1,
unicodeslot=0x3C1,
@@ -10134,9 +10215,8 @@ characters.data={
description="GREEK SMALL LETTER FINAL SIGMA",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="varsigma",
- uccode=0x3A3,
+ uccode=0x3C3,
unicodeslot=0x3C2,
},
[0x3C3]={
@@ -10147,7 +10227,6 @@ characters.data={
description="GREEK SMALL LETTER SIGMA",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="sigma",
uccode=0x3A3,
unicodeslot=0x3C3,
@@ -10160,7 +10239,6 @@ characters.data={
description="GREEK SMALL LETTER TAU",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="tau",
uccode=0x3A4,
unicodeslot=0x3C4,
@@ -10173,7 +10251,6 @@ characters.data={
description="GREEK SMALL LETTER UPSILON",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="upsilon",
uccode=0x3A5,
unicodeslot=0x3C5,
@@ -10186,7 +10263,6 @@ characters.data={
description="GREEK SMALL LETTER PHI",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="varphi",
uccode=0x3A6,
unicodeslot=0x3C6,
@@ -10199,7 +10275,6 @@ characters.data={
description="GREEK SMALL LETTER CHI",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="chi",
uccode=0x3A7,
unicodeslot=0x3C7,
@@ -10212,7 +10287,6 @@ characters.data={
description="GREEK SMALL LETTER PSI",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="psi",
uccode=0x3A8,
unicodeslot=0x3C8,
@@ -10225,7 +10299,6 @@ characters.data={
description="GREEK SMALL LETTER OMEGA",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="omega",
uccode=0x3A9,
unicodeslot=0x3C9,
@@ -10294,6 +10367,7 @@ characters.data={
category="lu",
description="GREEK CAPITAL KAI SYMBOL",
direction="l",
+ lccode=0x3D7,
linebreak="al",
unicodeslot=0x3CF,
},
@@ -10306,7 +10380,7 @@ characters.data={
linebreak="al",
specials={ "compat", 0x3B2 },
synonyms={ "curled beta" },
- uccode=0x392,
+ uccode=0x3B2,
unicodeslot=0x3D0,
},
[0x3D1]={
@@ -10316,11 +10390,10 @@ characters.data={
description="GREEK THETA SYMBOL",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="varTheta",
specials={ "compat", 0x3B8 },
synonyms={ "script theta" },
- uccode=0x398,
+ uccode=0x3B8,
unicodeslot=0x3D1,
},
[0x3D2]={
@@ -10357,10 +10430,9 @@ characters.data={
description="GREEK PHI SYMBOL",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="phi",
specials={ "compat", 0x3C6 },
- uccode=0x3A6,
+ uccode=0x3C6,
unicodeslot=0x3D5,
},
[0x3D6]={
@@ -10370,11 +10442,10 @@ characters.data={
description="GREEK PI SYMBOL",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="varpi",
specials={ "compat", 0x3C0 },
synonyms={ "omega pi" },
- uccode=0x3A0,
+ uccode=0x3C0,
unicodeslot=0x3D6,
},
[0x3D7]={
@@ -10426,7 +10497,6 @@ characters.data={
direction="l",
lccode=0x3DD,
linebreak="al",
- mathclass="variable",
mathname="digamma",
unicodeslot=0x3DC,
},
@@ -10609,7 +10679,7 @@ characters.data={
linebreak="al",
mathclass="ordinary",
specials={ "compat", 0x3BA },
- uccode=0x39A,
+ uccode=0x3BA,
unicodeslot=0x3F0,
},
[0x3F1]={
@@ -10620,7 +10690,7 @@ characters.data={
direction="l",
linebreak="al",
specials={ "compat", 0x3C1 },
- uccode=0x3A1,
+ uccode=0x3C1,
unicodeslot=0x3F1,
},
[0x3F2]={
@@ -10658,11 +10728,10 @@ characters.data={
description="GREEK LUNATE EPSILON SYMBOL",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="epsilon",
specials={ "compat", 0x3B5 },
synonyms={ "straight epsilon" },
- uccode=0x395,
+ uccode=0x3B5,
unicodeslot=0x3F5,
},
[0x3F6]={
@@ -10670,7 +10739,6 @@ characters.data={
description="GREEK REVERSED LUNATE EPSILON SYMBOL",
direction="on",
linebreak="al",
- mathclass="variable",
mathname="backepsilon",
synonyms={ "reversed straight epsilon" },
unicodeslot=0x3F6,
@@ -13652,6 +13720,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER LHA",
direction="l",
+ lccode=0x515,
linebreak="al",
unicodeslot=0x514,
},
@@ -13666,6 +13735,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER RHA",
direction="l",
+ lccode=0x517,
linebreak="al",
unicodeslot=0x516,
},
@@ -13680,6 +13750,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER YAE",
direction="l",
+ lccode=0x519,
linebreak="al",
unicodeslot=0x518,
},
@@ -13694,6 +13765,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER QA",
direction="l",
+ lccode=0x51B,
linebreak="al",
unicodeslot=0x51A,
},
@@ -13708,6 +13780,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER WE",
direction="l",
+ lccode=0x51D,
linebreak="al",
unicodeslot=0x51C,
},
@@ -13722,6 +13795,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER ALEUT KA",
direction="l",
+ lccode=0x51F,
linebreak="al",
unicodeslot=0x51E,
},
@@ -13736,6 +13810,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER EL WITH MIDDLE HOOK",
direction="l",
+ lccode=0x521,
linebreak="al",
unicodeslot=0x520,
},
@@ -13750,6 +13825,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER EN WITH MIDDLE HOOK",
direction="l",
+ lccode=0x523,
linebreak="al",
unicodeslot=0x522,
},
@@ -13764,6 +13840,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER PE WITH DESCENDER",
direction="l",
+ lccode=0x525,
linebreak="al",
unicodeslot=0x524,
},
@@ -13778,6 +13855,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER SHHA WITH DESCENDER",
direction="l",
+ lccode=0x527,
linebreak="al",
unicodeslot=0x526,
},
@@ -13792,6 +13870,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER EN WITH LEFT HOOK",
direction="l",
+ lccode=0x529,
linebreak="al",
unicodeslot=0x528,
},
@@ -13806,6 +13885,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER DZZHE",
direction="l",
+ lccode=0x52B,
linebreak="al",
unicodeslot=0x52A,
},
@@ -13820,6 +13900,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER DCHE",
direction="l",
+ lccode=0x52D,
linebreak="al",
unicodeslot=0x52C,
},
@@ -13834,6 +13915,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER EL WITH DESCENDER",
direction="l",
+ lccode=0x52F,
linebreak="al",
unicodeslot=0x52E,
},
@@ -14604,6 +14686,7 @@ characters.data={
direction="l",
linebreak="al",
specials={ "compat", 0x565, 0x582 },
+ uccode={ 0x565, 0x582 },
unicodeslot=0x587,
},
[0x588]={
@@ -15681,6 +15764,13 @@ characters.data={
linebreak="cm",
unicodeslot=0x61C,
},
+ [0x61D]={
+ category="po",
+ description="ARABIC END OF TEXT MARK",
+ direction="al",
+ linebreak="ex",
+ unicodeslot=0x61D,
+ },
[0x61E]={
category="po",
contextname="arabictripledot",
@@ -20257,6 +20347,334 @@ characters.data={
linebreak="al",
unicodeslot=0x86A,
},
+ [0x870]={
+ arabic="r",
+ category="lo",
+ description="ARABIC LETTER ALEF WITH ATTACHED FATHA",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x870,
+ },
+ [0x871]={
+ arabic="r",
+ category="lo",
+ description="ARABIC LETTER ALEF WITH ATTACHED TOP RIGHT FATHA",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x871,
+ },
+ [0x872]={
+ arabic="r",
+ category="lo",
+ description="ARABIC LETTER ALEF WITH RIGHT MIDDLE STROKE",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x872,
+ },
+ [0x873]={
+ arabic="r",
+ category="lo",
+ description="ARABIC LETTER ALEF WITH LEFT MIDDLE STROKE",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x873,
+ },
+ [0x874]={
+ arabic="r",
+ category="lo",
+ description="ARABIC LETTER ALEF WITH ATTACHED KASRA",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x874,
+ },
+ [0x875]={
+ arabic="r",
+ category="lo",
+ description="ARABIC LETTER ALEF WITH ATTACHED BOTTOM RIGHT KASRA",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x875,
+ },
+ [0x876]={
+ arabic="r",
+ category="lo",
+ description="ARABIC LETTER ALEF WITH ATTACHED ROUND DOT ABOVE",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x876,
+ },
+ [0x877]={
+ arabic="r",
+ category="lo",
+ description="ARABIC LETTER ALEF WITH ATTACHED RIGHT ROUND DOT",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x877,
+ },
+ [0x878]={
+ arabic="r",
+ category="lo",
+ description="ARABIC LETTER ALEF WITH ATTACHED LEFT ROUND DOT",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x878,
+ },
+ [0x879]={
+ arabic="r",
+ category="lo",
+ description="ARABIC LETTER ALEF WITH ATTACHED ROUND DOT BELOW",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x879,
+ },
+ [0x87A]={
+ arabic="r",
+ category="lo",
+ description="ARABIC LETTER ALEF WITH DOT ABOVE",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x87A,
+ },
+ [0x87B]={
+ arabic="r",
+ category="lo",
+ description="ARABIC LETTER ALEF WITH ATTACHED TOP RIGHT FATHA AND DOT ABOVE",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x87B,
+ },
+ [0x87C]={
+ arabic="r",
+ category="lo",
+ description="ARABIC LETTER ALEF WITH RIGHT MIDDLE STROKE AND DOT ABOVE",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x87C,
+ },
+ [0x87D]={
+ arabic="r",
+ category="lo",
+ description="ARABIC LETTER ALEF WITH ATTACHED BOTTOM RIGHT KASRA AND DOT ABOVE",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x87D,
+ },
+ [0x87E]={
+ arabic="r",
+ category="lo",
+ description="ARABIC LETTER ALEF WITH ATTACHED TOP RIGHT FATHA AND LEFT RING",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x87E,
+ },
+ [0x87F]={
+ arabic="r",
+ category="lo",
+ description="ARABIC LETTER ALEF WITH RIGHT MIDDLE STROKE AND LEFT RING",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x87F,
+ },
+ [0x880]={
+ arabic="r",
+ category="lo",
+ description="ARABIC LETTER ALEF WITH ATTACHED BOTTOM RIGHT KASRA AND LEFT RING",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x880,
+ },
+ [0x881]={
+ arabic="r",
+ category="lo",
+ description="ARABIC LETTER ALEF WITH ATTACHED RIGHT HAMZA",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x881,
+ },
+ [0x882]={
+ arabic="r",
+ category="lo",
+ description="ARABIC LETTER ALEF WITH ATTACHED LEFT HAMZA",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x882,
+ },
+ [0x883]={
+ arabic="c",
+ category="lo",
+ description="ARABIC TATWEEL WITH OVERSTRUCK HAMZA",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x883,
+ },
+ [0x884]={
+ arabic="c",
+ category="lo",
+ description="ARABIC TATWEEL WITH OVERSTRUCK WAW",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x884,
+ },
+ [0x885]={
+ arabic="c",
+ category="lo",
+ description="ARABIC TATWEEL WITH TWO DOTS BELOW",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x885,
+ },
+ [0x886]={
+ arabic="d",
+ category="lo",
+ description="ARABIC LETTER THIN YEH",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x886,
+ },
+ [0x887]={
+ arabic="u",
+ category="lo",
+ description="ARABIC BASELINE ROUND DOT",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x887,
+ },
+ [0x888]={
+ arabic="u",
+ category="sk",
+ description="ARABIC RAISED ROUND DOT",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x888,
+ },
+ [0x889]={
+ arabic="d",
+ category="lo",
+ description="ARABIC LETTER NOON WITH INVERTED SMALL V",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x889,
+ },
+ [0x88A]={
+ arabic="d",
+ category="lo",
+ description="ARABIC LETTER HAH WITH INVERTED SMALL V BELOW",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x88A,
+ },
+ [0x88B]={
+ arabic="d",
+ category="lo",
+ description="ARABIC LETTER TAH WITH DOT BELOW",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x88B,
+ },
+ [0x88C]={
+ arabic="d",
+ category="lo",
+ description="ARABIC LETTER TAH WITH THREE DOTS BELOW",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x88C,
+ },
+ [0x88D]={
+ arabic="d",
+ category="lo",
+ description="ARABIC LETTER KEHEH WITH TWO DOTS VERTICALLY BELOW",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x88D,
+ },
+ [0x88E]={
+ arabic="r",
+ category="lo",
+ description="ARABIC VERTICAL TAIL",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x88E,
+ },
+ [0x890]={
+ arabic="u",
+ category="cf",
+ description="ARABIC POUND MARK ABOVE",
+ direction="an",
+ linebreak="al",
+ unicodeslot=0x890,
+ },
+ [0x891]={
+ arabic="u",
+ category="cf",
+ description="ARABIC PIASTRE MARK ABOVE",
+ direction="an",
+ linebreak="al",
+ unicodeslot=0x891,
+ },
+ [0x898]={
+ category="mn",
+ combining=0xE6,
+ description="ARABIC SMALL HIGH WORD AL-JUZ",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x898,
+ },
+ [0x899]={
+ category="mn",
+ combining=0xDC,
+ description="ARABIC SMALL LOW WORD ISHMAAM",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x899,
+ },
+ [0x89A]={
+ category="mn",
+ combining=0xDC,
+ description="ARABIC SMALL LOW WORD IMAALA",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x89A,
+ },
+ [0x89B]={
+ category="mn",
+ combining=0xDC,
+ description="ARABIC SMALL LOW WORD TASHEEL",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x89B,
+ },
+ [0x89C]={
+ category="mn",
+ combining=0xE6,
+ description="ARABIC MADDA WAAJIB",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x89C,
+ },
+ [0x89D]={
+ category="mn",
+ combining=0xE6,
+ description="ARABIC SUPERSCRIPT ALEF MOKHASSAS",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x89D,
+ },
+ [0x89E]={
+ category="mn",
+ combining=0xE6,
+ description="ARABIC DOUBLED MADDA",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x89E,
+ },
+ [0x89F]={
+ category="mn",
+ combining=0xE6,
+ description="ARABIC HALF MADDA OVER MADDA",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x89F,
+ },
[0x8A0]={
arabic="d",
category="lo",
@@ -20425,6 +20843,14 @@ characters.data={
linebreak="al",
unicodeslot=0x8B4,
},
+ [0x8B5]={
+ arabic="d",
+ category="lo",
+ description="ARABIC LETTER QAF WITH DOT BELOW AND NO DOTS ABOVE",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x8B5,
+ },
[0x8B6]={
arabic="d",
category="lo",
@@ -20569,6 +20995,93 @@ characters.data={
linebreak="al",
unicodeslot=0x8C7,
},
+ [0x8C8]={
+ arabic="d",
+ category="lo",
+ description="ARABIC LETTER GRAF",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x8C8,
+ },
+ [0x8C9]={
+ category="lm",
+ description="ARABIC SMALL FARSI YEH",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0x8C9,
+ },
+ [0x8CA]={
+ category="mn",
+ combining=0xE6,
+ description="ARABIC SMALL HIGH FARSI YEH",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x8CA,
+ },
+ [0x8CB]={
+ category="mn",
+ combining=0xE6,
+ description="ARABIC SMALL HIGH YEH BARREE WITH TWO DOTS BELOW",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x8CB,
+ },
+ [0x8CC]={
+ category="mn",
+ combining=0xE6,
+ description="ARABIC SMALL HIGH WORD SAH",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x8CC,
+ },
+ [0x8CD]={
+ category="mn",
+ combining=0xE6,
+ description="ARABIC SMALL HIGH ZAH",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x8CD,
+ },
+ [0x8CE]={
+ category="mn",
+ combining=0xE6,
+ description="ARABIC LARGE ROUND DOT ABOVE",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x8CE,
+ },
+ [0x8CF]={
+ category="mn",
+ combining=0xDC,
+ description="ARABIC LARGE ROUND DOT BELOW",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x8CF,
+ },
+ [0x8D0]={
+ category="mn",
+ combining=0xDC,
+ description="ARABIC SUKUN BELOW",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x8D0,
+ },
+ [0x8D1]={
+ category="mn",
+ combining=0xDC,
+ description="ARABIC LARGE CIRCLE BELOW",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x8D1,
+ },
+ [0x8D2]={
+ category="mn",
+ combining=0xDC,
+ description="ARABIC LARGE ROUND DOT INSIDE CIRCLE BELOW",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x8D2,
+ },
[0x8D3]={
category="mn",
combining=0xDC,
@@ -22700,7 +23213,6 @@ characters.data={
direction="l",
indic="d",
indicmark="l",
- indicorder="bh",
linebreak="cm",
unicodeslot=0x9C8,
},
@@ -22745,6 +23257,7 @@ characters.data={
direction="l",
indic="c",
linebreak="al",
+ synonyms={ "bangla khanda ta" },
unicodeslot=0x9CE,
},
[0x9D7]={
@@ -22752,7 +23265,8 @@ characters.data={
category="mc",
description="BENGALI AU LENGTH MARK",
direction="l",
- indic="o",
+ indic="d",
+ indicmark="r",
indicorder="ap",
linebreak="cm",
unicodeslot=0x9D7,
@@ -26462,6 +26976,17 @@ characters.data={
linebreak="al",
unicodeslot=0xC39,
},
+ [0xC3C]={
+ category="mn",
+ combining=0x7,
+ description="TELUGU SIGN NUKTA",
+ direction="nsm",
+ indic="o",
+ indicclass="nukta",
+ indicmark="b",
+ linebreak="cm",
+ unicodeslot=0xC3C,
+ },
[0xC3D]={
category="lo",
description="TELUGU SIGN AVAGRAHA",
@@ -26655,6 +27180,15 @@ characters.data={
linebreak="al",
unicodeslot=0xC5A,
},
+ [0xC5D]={
+ category="lo",
+ comment="check indic",
+ description="TELUGU LETTER NAKAARA POLLU",
+ direction="l",
+ indic="i",
+ linebreak="al",
+ unicodeslot=0xC5D,
+ },
[0xC60]={
category="lo",
description="TELUGU LETTER VOCALIC RR",
@@ -27452,6 +27986,15 @@ characters.data={
linebreak="cm",
unicodeslot=0xCD6,
},
+ [0xCDD]={
+ category="lo",
+ comment="check indic",
+ description="KANNADA LETTER NAKAARA POLLU",
+ direction="l",
+ indic="i",
+ linebreak="al",
+ unicodeslot=0xCDD,
+ },
[0xCDE]={
category="lo",
description="KANNADA LETTER FA",
@@ -27592,6 +28135,13 @@ characters.data={
linebreak="al",
unicodeslot=0xCF2,
},
+ [0xCF3]={
+ category="mc",
+ description="KANNADA SIGN COMBINING ANUSVARA ABOVE RIGHT",
+ direction="l",
+ linebreak="cm",
+ unicodeslot=0xCF3,
+ },
[0xD00]={
category="mn",
description="MALAYALAM SIGN COMBINING ANUSVARA ABOVE",
@@ -28212,6 +28762,7 @@ characters.data={
direction="nsm",
indic="o",
indicclass="halant",
+ indicmark="r",
linebreak="cm",
synonyms={ "malayalam chandrakkala", "malayalam vowel half-u" },
unicodeslot=0xD4D,
@@ -30404,6 +30955,13 @@ characters.data={
linebreak="sa",
unicodeslot=0xECD,
},
+ [0xECE]={
+ category="mn",
+ description="LAO YAMAKKAN",
+ direction="nsm",
+ linebreak="sa",
+ unicodeslot=0xECE,
+ },
[0xED0]={
category="nd",
description="LAO DIGIT ZERO",
@@ -32034,9 +32592,7 @@ characters.data={
indic="c",
linebreak="sa",
unicodeslot=0x1000,
- variants={
- [0xFE00]="dotted form",
- },
+ variants=variants_dotted,
},
[0x1001]={
category="lo",
@@ -32053,9 +32609,7 @@ characters.data={
indic="c",
linebreak="sa",
unicodeslot=0x1002,
- variants={
- [0xFE00]="dotted form",
- },
+ variants=variants_dotted,
},
[0x1003]={
category="lo",
@@ -32072,9 +32626,7 @@ characters.data={
indic="c",
linebreak="sa",
unicodeslot=0x1004,
- variants={
- [0xFE00]="dotted form",
- },
+ variants=variants_dotted,
},
[0x1005]={
category="lo",
@@ -32171,9 +32723,7 @@ characters.data={
indic="c",
linebreak="sa",
unicodeslot=0x1010,
- variants={
- [0xFE00]="dotted form",
- },
+ variants=variants_dotted,
},
[0x1011]={
category="lo",
@@ -32182,9 +32732,7 @@ characters.data={
indic="c",
linebreak="sa",
unicodeslot=0x1011,
- variants={
- [0xFE00]="dotted form",
- },
+ variants=variants_dotted,
},
[0x1012]={
category="lo",
@@ -32217,9 +32765,7 @@ characters.data={
indic="c",
linebreak="sa",
unicodeslot=0x1015,
- variants={
- [0xFE00]="dotted form",
- },
+ variants=variants_dotted,
},
[0x1016]={
category="lo",
@@ -32252,9 +32798,7 @@ characters.data={
indic="c",
linebreak="sa",
unicodeslot=0x1019,
- variants={
- [0xFE00]="dotted form",
- },
+ variants=variants_dotted,
},
[0x101A]={
category="lo",
@@ -32263,9 +32807,7 @@ characters.data={
indic="c",
linebreak="sa",
unicodeslot=0x101A,
- variants={
- [0xFE00]="dotted form",
- },
+ variants=variants_dotted,
},
[0x101B]={
category="lo",
@@ -32282,9 +32824,7 @@ characters.data={
indic="c",
linebreak="sa",
unicodeslot=0x101C,
- variants={
- [0xFE00]="dotted form",
- },
+ variants=variants_dotted,
},
[0x101D]={
category="lo",
@@ -32293,9 +32833,7 @@ characters.data={
indic="c",
linebreak="sa",
unicodeslot=0x101D,
- variants={
- [0xFE00]="dotted form",
- },
+ variants=variants_dotted,
},
[0x101E]={
category="lo",
@@ -32336,9 +32874,7 @@ characters.data={
indic="i",
linebreak="sa",
unicodeslot=0x1022,
- variants={
- [0xFE00]="dotted form",
- },
+ variants=variants_dotted,
},
[0x1023]={
category="lo",
@@ -32467,9 +33003,7 @@ characters.data={
indicmark="l",
linebreak="sa",
unicodeslot=0x1031,
- variants={
- [0xFE00]="dotted form",
- },
+ variants=variants_dotted,
},
[0x1032]={
category="mn",
@@ -33051,9 +33585,7 @@ characters.data={
indic="c",
linebreak="sa",
unicodeslot=0x1075,
- variants={
- [0xFE00]="dotted form",
- },
+ variants=variants_dotted,
},
[0x1076]={
category="lo",
@@ -33078,9 +33610,7 @@ characters.data={
indic="c",
linebreak="sa",
unicodeslot=0x1078,
- variants={
- [0xFE00]="dotted form",
- },
+ variants=variants_dotted,
},
[0x1079]={
category="lo",
@@ -33097,9 +33627,7 @@ characters.data={
indic="c",
linebreak="sa",
unicodeslot=0x107A,
- variants={
- [0xFE00]="dotted form",
- },
+ variants=variants_dotted,
},
[0x107B]={
category="lo",
@@ -33148,9 +33676,7 @@ characters.data={
indic="c",
linebreak="sa",
unicodeslot=0x1080,
- variants={
- [0xFE00]="dotted form",
- },
+ variants=variants_dotted,
},
[0x1081]={
category="lo",
@@ -33726,6 +34252,7 @@ characters.data={
category="lu",
description="GEORGIAN CAPITAL LETTER YN",
direction="l",
+ lccode=0x2D27,
linebreak="al",
unicodeslot=0x10C7,
},
@@ -33733,6 +34260,7 @@ characters.data={
category="lu",
description="GEORGIAN CAPITAL LETTER AEN",
direction="l",
+ lccode=0x2D2D,
linebreak="al",
unicodeslot=0x10CD,
},
@@ -39259,6 +39787,7 @@ characters.data={
description="CHEROKEE SMALL LETTER YE",
direction="l",
linebreak="al",
+ uccode=0x13F0,
unicodeslot=0x13F8,
},
[0x13F9]={
@@ -39266,6 +39795,7 @@ characters.data={
description="CHEROKEE SMALL LETTER YI",
direction="l",
linebreak="al",
+ uccode=0x13F1,
unicodeslot=0x13F9,
},
[0x13FA]={
@@ -39273,6 +39803,7 @@ characters.data={
description="CHEROKEE SMALL LETTER YO",
direction="l",
linebreak="al",
+ uccode=0x13F2,
unicodeslot=0x13FA,
},
[0x13FB]={
@@ -39280,6 +39811,7 @@ characters.data={
description="CHEROKEE SMALL LETTER YU",
direction="l",
linebreak="al",
+ uccode=0x13F3,
unicodeslot=0x13FB,
},
[0x13FC]={
@@ -39287,6 +39819,7 @@ characters.data={
description="CHEROKEE SMALL LETTER YV",
direction="l",
linebreak="al",
+ uccode=0x13F4,
unicodeslot=0x13FC,
},
[0x13FD]={
@@ -39294,6 +39827,7 @@ characters.data={
description="CHEROKEE SMALL LETTER MV",
direction="l",
linebreak="al",
+ uccode=0x13F5,
unicodeslot=0x13FD,
},
[0x1400]={
@@ -44695,6 +45229,17 @@ characters.data={
linebreak="al",
unicodeslot=0x170C,
},
+ [0x170D]={
+ category="lo",
+ comment="check indic",
+ description="TAGALOG LETTER RA",
+ direction="l",
+ indic="c",
+ indicclass="ra",
+ indicorder="am",
+ linebreak="al",
+ unicodeslot=0x170D,
+ },
[0x170E]={
category="lo",
description="TAGALOG LETTER LA",
@@ -44745,6 +45290,21 @@ characters.data={
linebreak="cm",
unicodeslot=0x1714,
},
+ [0x1715]={
+ category="mc",
+ combining=0x9,
+ description="TAGALOG SIGN PAMUDPOD",
+ direction="l",
+ linebreak="cm",
+ unicodeslot=0x1715,
+ },
+ [0x171F]={
+ category="lo",
+ description="TAGALOG LETTER ARCHAIC RA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x171F,
+ },
[0x1720]={
category="lo",
description="HANUNOO LETTER A",
@@ -44889,7 +45449,7 @@ characters.data={
category="mn",
combining=0x9,
description="HANUNOO SIGN PAMUDPOD",
- direction="nsm",
+ direction="l",
linebreak="cm",
unicodeslot=0x1734,
},
@@ -46100,6 +46660,13 @@ characters.data={
mongolian="nj",
unicodeslot=0x180E,
},
+ [0x180F]={
+ category="mn",
+ description="MONGOLIAN FREE VARIATION SELECTOR FOUR",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x180F,
+ },
[0x1810]={
category="nd",
description="MONGOLIAN DIGIT ZERO",
@@ -50773,6 +51340,118 @@ characters.data={
linebreak="cm",
unicodeslot=0x1AC0,
},
+ [0x1AC1]={
+ category="mn",
+ combining=0xE6,
+ description="COMBINING LEFT PARENTHESIS ABOVE LEFT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1AC1,
+ },
+ [0x1AC2]={
+ category="mn",
+ combining=0xE6,
+ description="COMBINING RIGHT PARENTHESIS ABOVE RIGHT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1AC2,
+ },
+ [0x1AC3]={
+ category="mn",
+ combining=0xDC,
+ description="COMBINING LEFT PARENTHESIS BELOW LEFT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1AC3,
+ },
+ [0x1AC4]={
+ category="mn",
+ combining=0xDC,
+ description="COMBINING RIGHT PARENTHESIS BELOW RIGHT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1AC4,
+ },
+ [0x1AC5]={
+ category="mn",
+ combining=0xE6,
+ description="COMBINING SQUARE BRACKETS ABOVE",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1AC5,
+ },
+ [0x1AC6]={
+ category="mn",
+ combining=0xE6,
+ description="COMBINING NUMBER SIGN ABOVE",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1AC6,
+ },
+ [0x1AC7]={
+ category="mn",
+ combining=0xE6,
+ description="COMBINING INVERTED DOUBLE ARCH ABOVE",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1AC7,
+ },
+ [0x1AC8]={
+ category="mn",
+ combining=0xE6,
+ description="COMBINING PLUS SIGN ABOVE",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1AC8,
+ },
+ [0x1AC9]={
+ category="mn",
+ combining=0xE6,
+ description="COMBINING DOUBLE PLUS SIGN ABOVE",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1AC9,
+ },
+ [0x1ACA]={
+ category="mn",
+ combining=0xDC,
+ description="COMBINING DOUBLE PLUS SIGN BELOW",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1ACA,
+ },
+ [0x1ACB]={
+ category="mn",
+ combining=0xE6,
+ description="COMBINING TRIPLE ACUTE ACCENT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1ACB,
+ },
+ [0x1ACC]={
+ category="mn",
+ combining=0xE6,
+ description="COMBINING LATIN SMALL LETTER INSULAR G",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1ACC,
+ },
+ [0x1ACD]={
+ category="mn",
+ combining=0xE6,
+ description="COMBINING LATIN SMALL LETTER INSULAR R",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1ACD,
+ },
+ [0x1ACE]={
+ category="mn",
+ combining=0xE6,
+ description="COMBINING LATIN SMALL LETTER INSULAR T",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1ACE,
+ },
[0x1B00]={
category="mn",
description="BALINESE SIGN ULU RICEM",
@@ -51318,6 +51997,13 @@ characters.data={
linebreak="al",
unicodeslot=0x1B4B,
},
+ [0x1B4C]={
+ category="lo",
+ description="BALINESE LETTER ARCHAIC JNYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1B4C,
+ },
[0x1B50]={
category="nd",
description="BALINESE DIGIT ZERO",
@@ -51642,6 +52328,20 @@ characters.data={
linebreak="al",
unicodeslot=0x1B7C,
},
+ [0x1B7D]={
+ category="po",
+ description="BALINESE PANTI LANTANG",
+ direction="l",
+ linebreak="ba",
+ unicodeslot=0x1B7D,
+ },
+ [0x1B7E]={
+ category="po",
+ description="BALINESE PAMADA LANTANG",
+ direction="l",
+ linebreak="ba",
+ unicodeslot=0x1B7E,
+ },
[0x1B80]={
category="mn",
description="SUNDANESE SIGN PANYECEK",
@@ -53347,6 +54047,7 @@ characters.data={
description="CYRILLIC SMALL LETTER ROUNDED VE",
direction="l",
linebreak="al",
+ uccode=0x432,
unicodeslot=0x1C80,
},
[0x1C81]={
@@ -53354,6 +54055,7 @@ characters.data={
description="CYRILLIC SMALL LETTER LONG-LEGGED DE",
direction="l",
linebreak="al",
+ uccode=0x434,
unicodeslot=0x1C81,
},
[0x1C82]={
@@ -53361,6 +54063,7 @@ characters.data={
description="CYRILLIC SMALL LETTER NARROW O",
direction="l",
linebreak="al",
+ uccode=0x43E,
unicodeslot=0x1C82,
},
[0x1C83]={
@@ -53368,6 +54071,7 @@ characters.data={
description="CYRILLIC SMALL LETTER WIDE ES",
direction="l",
linebreak="al",
+ uccode=0x441,
unicodeslot=0x1C83,
},
[0x1C84]={
@@ -53375,6 +54079,7 @@ characters.data={
description="CYRILLIC SMALL LETTER TALL TE",
direction="l",
linebreak="al",
+ uccode=0x442,
unicodeslot=0x1C84,
},
[0x1C85]={
@@ -53382,6 +54087,7 @@ characters.data={
description="CYRILLIC SMALL LETTER THREE-LEGGED TE",
direction="l",
linebreak="al",
+ uccode=0x442,
unicodeslot=0x1C85,
},
[0x1C86]={
@@ -53389,6 +54095,7 @@ characters.data={
description="CYRILLIC SMALL LETTER TALL HARD SIGN",
direction="l",
linebreak="al",
+ uccode=0x44A,
unicodeslot=0x1C86,
},
[0x1C87]={
@@ -53396,6 +54103,7 @@ characters.data={
description="CYRILLIC SMALL LETTER TALL YAT",
direction="l",
linebreak="al",
+ uccode=0x463,
unicodeslot=0x1C87,
},
[0x1C88]={
@@ -53403,12 +54111,14 @@ characters.data={
description="CYRILLIC SMALL LETTER UNBLENDED UK",
direction="l",
linebreak="al",
+ uccode=0xA64B,
unicodeslot=0x1C88,
},
[0x1C90]={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER AN",
direction="l",
+ lccode=0x10D0,
linebreak="al",
unicodeslot=0x1C90,
},
@@ -53416,6 +54126,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER BAN",
direction="l",
+ lccode=0x10D1,
linebreak="al",
unicodeslot=0x1C91,
},
@@ -53423,6 +54134,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER GAN",
direction="l",
+ lccode=0x10D2,
linebreak="al",
unicodeslot=0x1C92,
},
@@ -53430,6 +54142,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER DON",
direction="l",
+ lccode=0x10D3,
linebreak="al",
unicodeslot=0x1C93,
},
@@ -53437,6 +54150,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER EN",
direction="l",
+ lccode=0x10D4,
linebreak="al",
unicodeslot=0x1C94,
},
@@ -53444,6 +54158,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER VIN",
direction="l",
+ lccode=0x10D5,
linebreak="al",
unicodeslot=0x1C95,
},
@@ -53451,6 +54166,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER ZEN",
direction="l",
+ lccode=0x10D6,
linebreak="al",
unicodeslot=0x1C96,
},
@@ -53458,6 +54174,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER TAN",
direction="l",
+ lccode=0x10D7,
linebreak="al",
unicodeslot=0x1C97,
},
@@ -53465,6 +54182,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER IN",
direction="l",
+ lccode=0x10D8,
linebreak="al",
unicodeslot=0x1C98,
},
@@ -53472,6 +54190,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER KAN",
direction="l",
+ lccode=0x10D9,
linebreak="al",
unicodeslot=0x1C99,
},
@@ -53479,6 +54198,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER LAS",
direction="l",
+ lccode=0x10DA,
linebreak="al",
unicodeslot=0x1C9A,
},
@@ -53486,6 +54206,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER MAN",
direction="l",
+ lccode=0x10DB,
linebreak="al",
unicodeslot=0x1C9B,
},
@@ -53493,6 +54214,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER NAR",
direction="l",
+ lccode=0x10DC,
linebreak="al",
unicodeslot=0x1C9C,
},
@@ -53500,6 +54222,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER ON",
direction="l",
+ lccode=0x10DD,
linebreak="al",
unicodeslot=0x1C9D,
},
@@ -53507,6 +54230,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER PAR",
direction="l",
+ lccode=0x10DE,
linebreak="al",
unicodeslot=0x1C9E,
},
@@ -53514,6 +54238,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER ZHAR",
direction="l",
+ lccode=0x10DF,
linebreak="al",
unicodeslot=0x1C9F,
},
@@ -53521,6 +54246,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER RAE",
direction="l",
+ lccode=0x10E0,
linebreak="al",
unicodeslot=0x1CA0,
},
@@ -53528,6 +54254,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER SAN",
direction="l",
+ lccode=0x10E1,
linebreak="al",
unicodeslot=0x1CA1,
},
@@ -53535,6 +54262,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER TAR",
direction="l",
+ lccode=0x10E2,
linebreak="al",
unicodeslot=0x1CA2,
},
@@ -53542,6 +54270,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER UN",
direction="l",
+ lccode=0x10E3,
linebreak="al",
unicodeslot=0x1CA3,
},
@@ -53549,6 +54278,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER PHAR",
direction="l",
+ lccode=0x10E4,
linebreak="al",
unicodeslot=0x1CA4,
},
@@ -53556,6 +54286,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER KHAR",
direction="l",
+ lccode=0x10E5,
linebreak="al",
unicodeslot=0x1CA5,
},
@@ -53563,6 +54294,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER GHAN",
direction="l",
+ lccode=0x10E6,
linebreak="al",
unicodeslot=0x1CA6,
},
@@ -53570,6 +54302,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER QAR",
direction="l",
+ lccode=0x10E7,
linebreak="al",
unicodeslot=0x1CA7,
},
@@ -53577,6 +54310,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER SHIN",
direction="l",
+ lccode=0x10E8,
linebreak="al",
unicodeslot=0x1CA8,
},
@@ -53584,6 +54318,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER CHIN",
direction="l",
+ lccode=0x10E9,
linebreak="al",
unicodeslot=0x1CA9,
},
@@ -53591,6 +54326,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER CAN",
direction="l",
+ lccode=0x10EA,
linebreak="al",
unicodeslot=0x1CAA,
},
@@ -53598,6 +54334,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER JIL",
direction="l",
+ lccode=0x10EB,
linebreak="al",
unicodeslot=0x1CAB,
},
@@ -53605,6 +54342,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER CIL",
direction="l",
+ lccode=0x10EC,
linebreak="al",
unicodeslot=0x1CAC,
},
@@ -53612,6 +54350,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER CHAR",
direction="l",
+ lccode=0x10ED,
linebreak="al",
unicodeslot=0x1CAD,
},
@@ -53619,6 +54358,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER XAN",
direction="l",
+ lccode=0x10EE,
linebreak="al",
unicodeslot=0x1CAE,
},
@@ -53626,6 +54366,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER JHAN",
direction="l",
+ lccode=0x10EF,
linebreak="al",
unicodeslot=0x1CAF,
},
@@ -53633,6 +54374,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER HAE",
direction="l",
+ lccode=0x10F0,
linebreak="al",
unicodeslot=0x1CB0,
},
@@ -53640,6 +54382,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER HE",
direction="l",
+ lccode=0x10F1,
linebreak="al",
unicodeslot=0x1CB1,
},
@@ -53647,6 +54390,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER HIE",
direction="l",
+ lccode=0x10F2,
linebreak="al",
unicodeslot=0x1CB2,
},
@@ -53654,6 +54398,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER WE",
direction="l",
+ lccode=0x10F3,
linebreak="al",
unicodeslot=0x1CB3,
},
@@ -53661,6 +54406,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER HAR",
direction="l",
+ lccode=0x10F4,
linebreak="al",
unicodeslot=0x1CB4,
},
@@ -53668,6 +54414,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER HOE",
direction="l",
+ lccode=0x10F5,
linebreak="al",
unicodeslot=0x1CB5,
},
@@ -53675,6 +54422,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER FI",
direction="l",
+ lccode=0x10F6,
linebreak="al",
unicodeslot=0x1CB6,
},
@@ -53682,6 +54430,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER YN",
direction="l",
+ lccode=0x10F7,
linebreak="al",
unicodeslot=0x1CB7,
},
@@ -53689,6 +54438,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER ELIFI",
direction="l",
+ lccode=0x10F8,
linebreak="al",
unicodeslot=0x1CB8,
},
@@ -53696,6 +54446,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER TURNED GAN",
direction="l",
+ lccode=0x10F9,
linebreak="al",
unicodeslot=0x1CB9,
},
@@ -53703,6 +54454,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER AIN",
direction="l",
+ lccode=0x10FA,
linebreak="al",
unicodeslot=0x1CBA,
},
@@ -53710,6 +54462,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER AEN",
direction="l",
+ lccode=0x10FD,
linebreak="al",
unicodeslot=0x1CBD,
},
@@ -53717,6 +54470,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER HARD SIGN",
direction="l",
+ lccode=0x10FE,
linebreak="al",
unicodeslot=0x1CBE,
},
@@ -53724,6 +54478,7 @@ characters.data={
category="lu",
description="GEORGIAN MTAVRULI CAPITAL LETTER LABIAL SIGN",
direction="l",
+ lccode=0x10FF,
linebreak="al",
unicodeslot=0x1CBF,
},
@@ -55706,7 +56461,7 @@ characters.data={
combining=0xEA,
description="COMBINING DOUBLE CIRCUMFLEX ABOVE",
direction="nsm",
- linebreak="cm",
+ linebreak="gl",
unicodeslot=0x1DCD,
},
[0x1DCE]={
@@ -56061,6 +56816,14 @@ characters.data={
linebreak="cm",
unicodeslot=0x1DF9,
},
+ [0x1DFA]={
+ category="mn",
+ combining=0xDA,
+ description="COMBINING DOT BELOW LEFT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1DFA,
+ },
[0x1DFB]={
category="mn",
combining=0xE6,
@@ -56074,7 +56837,7 @@ characters.data={
combining=0xE9,
description="COMBINING DOUBLE INVERTED BREVE BELOW",
direction="nsm",
- linebreak="cm",
+ linebreak="gl",
unicodeslot=0x1DFC,
},
[0x1DFD]={
@@ -57759,6 +58522,7 @@ characters.data={
linebreak="al",
shcode=0x68,
specials={ "char", 0x68, 0x331 },
+ uccode={ 0x68, 0x331 },
unicodeslot=0x1E96,
},
[0x1E97]={
@@ -57769,6 +58533,7 @@ characters.data={
linebreak="al",
shcode=0x74,
specials={ "char", 0x74, 0x308 },
+ uccode={ 0x74, 0x308 },
unicodeslot=0x1E97,
},
[0x1E98]={
@@ -57779,6 +58544,7 @@ characters.data={
linebreak="al",
shcode=0x77,
specials={ "char", 0x77, 0x30A },
+ uccode={ 0x77, 0x30A },
unicodeslot=0x1E98,
},
[0x1E99]={
@@ -57789,6 +58555,7 @@ characters.data={
linebreak="al",
shcode=0x79,
specials={ "char", 0x79, 0x30A },
+ uccode={ 0x79, 0x30A },
unicodeslot=0x1E99,
},
[0x1E9A]={
@@ -57799,6 +58566,7 @@ characters.data={
linebreak="al",
shcode=0x61,
specials={ "compat", 0x61, 0x2BE },
+ uccode={ 0x61, 0x2BE },
unicodeslot=0x1E9A,
},
[0x1E9B]={
@@ -57808,7 +58576,7 @@ characters.data={
direction="l",
linebreak="al",
specials={ "char", 0x17F, 0x307 },
- uccode=0x1E60,
+ uccode=0x1E61,
unicodeslot=0x1E9B,
},
[0x1E9C]={
@@ -58923,6 +59691,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER MIDDLE-WELSH LL",
direction="l",
+ lccode=0x1EFB,
linebreak="al",
unicodeslot=0x1EFA,
},
@@ -58937,6 +59706,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER MIDDLE-WELSH V",
direction="l",
+ lccode=0x1EFD,
linebreak="al",
unicodeslot=0x1EFC,
},
@@ -58951,6 +59721,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER Y WITH LOOP",
direction="l",
+ lccode=0x1EFF,
linebreak="al",
unicodeslot=0x1EFE,
},
@@ -59761,6 +60532,7 @@ characters.data={
linebreak="al",
shcode=0x3C5,
specials={ "char", 0x3C5, 0x313 },
+ uccode={ 0x3C5, 0x313 },
unicodeslot=0x1F50,
},
[0x1F51]={
@@ -59782,6 +60554,7 @@ characters.data={
linebreak="al",
shcode=0x3C5,
specials={ "char", 0x1F50, 0x300 },
+ uccode={ 0x3C5, 0x313, 0x300 },
unicodeslot=0x1F52,
},
[0x1F53]={
@@ -59803,6 +60576,7 @@ characters.data={
linebreak="al",
shcode=0x3C5,
specials={ "char", 0x1F50, 0x301 },
+ uccode={ 0x3C5, 0x313, 0x301 },
unicodeslot=0x1F54,
},
[0x1F55]={
@@ -59824,6 +60598,7 @@ characters.data={
linebreak="al",
shcode=0x3C5,
specials={ "char", 0x1F50, 0x342 },
+ uccode={ 0x3C5, 0x313, 0x342 },
unicodeslot=0x1F56,
},
[0x1F57]={
@@ -60219,7 +60994,7 @@ characters.data={
linebreak="al",
shcode=0x3B1,
specials={ "char", 0x1F00, 0x345 },
- uccode=0x1F88,
+ uccode={ 0x1F00, 0x3B9 },
unicodeslot=0x1F80,
},
[0x1F81]={
@@ -60230,7 +61005,7 @@ characters.data={
linebreak="al",
shcode=0x3B1,
specials={ "char", 0x1F01, 0x345 },
- uccode=0x1F89,
+ uccode={ 0x1F01, 0x3B9 },
unicodeslot=0x1F81,
},
[0x1F82]={
@@ -60241,7 +61016,7 @@ characters.data={
linebreak="al",
shcode=0x3B1,
specials={ "char", 0x1F02, 0x345 },
- uccode=0x1F8A,
+ uccode={ 0x1F02, 0x3B9 },
unicodeslot=0x1F82,
},
[0x1F83]={
@@ -60252,7 +61027,7 @@ characters.data={
linebreak="al",
shcode=0x3B1,
specials={ "char", 0x1F03, 0x345 },
- uccode=0x1F8B,
+ uccode={ 0x1F03, 0x3B9 },
unicodeslot=0x1F83,
},
[0x1F84]={
@@ -60263,7 +61038,7 @@ characters.data={
linebreak="al",
shcode=0x3B1,
specials={ "char", 0x1F04, 0x345 },
- uccode=0x1F8C,
+ uccode={ 0x1F04, 0x3B9 },
unicodeslot=0x1F84,
},
[0x1F85]={
@@ -60274,7 +61049,7 @@ characters.data={
linebreak="al",
shcode=0x3B1,
specials={ "char", 0x1F05, 0x345 },
- uccode=0x1F8D,
+ uccode={ 0x1F05, 0x3B9 },
unicodeslot=0x1F85,
},
[0x1F86]={
@@ -60285,7 +61060,7 @@ characters.data={
linebreak="al",
shcode=0x3B1,
specials={ "char", 0x1F06, 0x345 },
- uccode=0x1F8E,
+ uccode={ 0x1F06, 0x3B9 },
unicodeslot=0x1F86,
},
[0x1F87]={
@@ -60296,7 +61071,7 @@ characters.data={
linebreak="al",
shcode=0x3B1,
specials={ "char", 0x1F07, 0x345 },
- uccode=0x1F8F,
+ uccode={ 0x1F07, 0x3B9 },
unicodeslot=0x1F87,
},
[0x1F88]={
@@ -60395,7 +61170,7 @@ characters.data={
linebreak="al",
shcode=0x3B7,
specials={ "char", 0x1F20, 0x345 },
- uccode=0x1F98,
+ uccode={ 0x1F20, 0x3B9 },
unicodeslot=0x1F90,
},
[0x1F91]={
@@ -60406,7 +61181,7 @@ characters.data={
linebreak="al",
shcode=0x3B7,
specials={ "char", 0x1F21, 0x345 },
- uccode=0x1F99,
+ uccode={ 0x1F21, 0x3B9 },
unicodeslot=0x1F91,
},
[0x1F92]={
@@ -60417,7 +61192,7 @@ characters.data={
linebreak="al",
shcode=0x3B7,
specials={ "char", 0x1F22, 0x345 },
- uccode=0x1F9A,
+ uccode={ 0x1F22, 0x3B9 },
unicodeslot=0x1F92,
},
[0x1F93]={
@@ -60428,7 +61203,7 @@ characters.data={
linebreak="al",
shcode=0x3B7,
specials={ "char", 0x1F23, 0x345 },
- uccode=0x1F9B,
+ uccode={ 0x1F23, 0x3B9 },
unicodeslot=0x1F93,
},
[0x1F94]={
@@ -60439,7 +61214,7 @@ characters.data={
linebreak="al",
shcode=0x3B7,
specials={ "char", 0x1F24, 0x345 },
- uccode=0x1F9C,
+ uccode={ 0x1F24, 0x3B9 },
unicodeslot=0x1F94,
},
[0x1F95]={
@@ -60450,7 +61225,7 @@ characters.data={
linebreak="al",
shcode=0x3B7,
specials={ "char", 0x1F25, 0x345 },
- uccode=0x1F9D,
+ uccode={ 0x1F25, 0x3B9 },
unicodeslot=0x1F95,
},
[0x1F96]={
@@ -60461,7 +61236,7 @@ characters.data={
linebreak="al",
shcode=0x3B7,
specials={ "char", 0x1F26, 0x345 },
- uccode=0x1F9E,
+ uccode={ 0x1F26, 0x3B9 },
unicodeslot=0x1F96,
},
[0x1F97]={
@@ -60472,7 +61247,7 @@ characters.data={
linebreak="al",
shcode=0x3B7,
specials={ "char", 0x1F27, 0x345 },
- uccode=0x1F9F,
+ uccode={ 0x1F27, 0x3B9 },
unicodeslot=0x1F97,
},
[0x1F98]={
@@ -60571,7 +61346,7 @@ characters.data={
linebreak="al",
shcode=0x3C9,
specials={ "char", 0x1F60, 0x345 },
- uccode=0x1FA8,
+ uccode={ 0x1F60, 0x3B9 },
unicodeslot=0x1FA0,
},
[0x1FA1]={
@@ -60582,7 +61357,7 @@ characters.data={
linebreak="al",
shcode=0x3C9,
specials={ "char", 0x1F61, 0x345 },
- uccode=0x1FA9,
+ uccode={ 0x1F61, 0x3B9 },
unicodeslot=0x1FA1,
},
[0x1FA2]={
@@ -60593,7 +61368,7 @@ characters.data={
linebreak="al",
shcode=0x3C9,
specials={ "char", 0x1F62, 0x345 },
- uccode=0x1FAA,
+ uccode={ 0x1F62, 0x3B9 },
unicodeslot=0x1FA2,
},
[0x1FA3]={
@@ -60604,7 +61379,7 @@ characters.data={
linebreak="al",
shcode=0x3C9,
specials={ "char", 0x1F63, 0x345 },
- uccode=0x1FAB,
+ uccode={ 0x1F63, 0x3B9 },
unicodeslot=0x1FA3,
},
[0x1FA4]={
@@ -60615,7 +61390,7 @@ characters.data={
linebreak="al",
shcode=0x3C9,
specials={ "char", 0x1F64, 0x345 },
- uccode=0x1FAC,
+ uccode={ 0x1F64, 0x3B9 },
unicodeslot=0x1FA4,
},
[0x1FA5]={
@@ -60626,7 +61401,7 @@ characters.data={
linebreak="al",
shcode=0x3C9,
specials={ "char", 0x1F65, 0x345 },
- uccode=0x1FAD,
+ uccode={ 0x1F65, 0x3B9 },
unicodeslot=0x1FA5,
},
[0x1FA6]={
@@ -60637,7 +61412,7 @@ characters.data={
linebreak="al",
shcode=0x3C9,
specials={ "char", 0x1F66, 0x345 },
- uccode=0x1FAE,
+ uccode={ 0x1F66, 0x3B9 },
unicodeslot=0x1FA6,
},
[0x1FA7]={
@@ -60648,7 +61423,7 @@ characters.data={
linebreak="al",
shcode=0x3C9,
specials={ "char", 0x1F67, 0x345 },
- uccode=0x1FAF,
+ uccode={ 0x1F67, 0x3B9 },
unicodeslot=0x1FA7,
},
[0x1FA8]={
@@ -60769,6 +61544,7 @@ characters.data={
linebreak="al",
shcode=0x3B1,
specials={ "char", 0x1F70, 0x345 },
+ uccode={ 0x1F70, 0x3B9 },
unicodeslot=0x1FB2,
},
[0x1FB3]={
@@ -60779,7 +61555,7 @@ characters.data={
linebreak="al",
shcode=0x3B1,
specials={ "char", 0x3B1, 0x345 },
- uccode=0x1FBC,
+ uccode={ 0x3B1, 0x3B9 },
unicodeslot=0x1FB3,
},
[0x1FB4]={
@@ -60790,6 +61566,7 @@ characters.data={
linebreak="al",
shcode=0x3B1,
specials={ "char", 0x3AC, 0x345 },
+ uccode={ 0x3AC, 0x3B9 },
unicodeslot=0x1FB4,
},
[0x1FB6]={
@@ -60800,6 +61577,7 @@ characters.data={
linebreak="al",
shcode=0x3B1,
specials={ "char", 0x3B1, 0x342 },
+ uccode={ 0x3B1, 0x342 },
unicodeslot=0x1FB6,
},
[0x1FB7]={
@@ -60810,6 +61588,7 @@ characters.data={
linebreak="al",
shcode=0x3B1,
specials={ "char", 0x1FB6, 0x345 },
+ uccode={ 0x3B1, 0x342, 0x3B9 },
unicodeslot=0x1FB7,
},
[0x1FB8]={
@@ -60883,7 +61662,7 @@ characters.data={
direction="l",
linebreak="al",
specials={ "char", 0x3B9 },
- uccode=0x399,
+ uccode=0x3B9,
unicodeslot=0x1FBE,
},
[0x1FBF]={
@@ -60921,6 +61700,7 @@ characters.data={
linebreak="al",
shcode=0x3B7,
specials={ "char", 0x1F74, 0x345 },
+ uccode={ 0x1F74, 0x3B9 },
unicodeslot=0x1FC2,
},
[0x1FC3]={
@@ -60931,7 +61711,7 @@ characters.data={
linebreak="al",
shcode=0x3B7,
specials={ "char", 0x3B7, 0x345 },
- uccode=0x1FCC,
+ uccode={ 0x3B7, 0x3B9 },
unicodeslot=0x1FC3,
},
[0x1FC4]={
@@ -60942,6 +61722,7 @@ characters.data={
linebreak="al",
shcode=0x3B7,
specials={ "char", 0x3AE, 0x345 },
+ uccode={ 0x3AE, 0x3B9 },
unicodeslot=0x1FC4,
},
[0x1FC6]={
@@ -60952,6 +61733,7 @@ characters.data={
linebreak="al",
shcode=0x3B7,
specials={ "char", 0x3B7, 0x342 },
+ uccode={ 0x3B7, 0x342 },
unicodeslot=0x1FC6,
},
[0x1FC7]={
@@ -60962,6 +61744,7 @@ characters.data={
linebreak="al",
shcode=0x3B7,
specials={ "char", 0x1FC6, 0x345 },
+ uccode={ 0x3B7, 0x342, 0x3B9 },
unicodeslot=0x1FC7,
},
[0x1FC8]={
@@ -61076,6 +61859,7 @@ characters.data={
linebreak="al",
shcode=0x3B9,
specials={ "char", 0x3CA, 0x300 },
+ uccode={ 0x3B9, 0x308, 0x300 },
unicodeslot=0x1FD2,
},
[0x1FD3]={
@@ -61086,6 +61870,7 @@ characters.data={
linebreak="al",
shcode=0x3B9,
specials={ "char", 0x390 },
+ uccode={ 0x3B9, 0x308, 0x301 },
unicodeslot=0x1FD3,
},
[0x1FD6]={
@@ -61096,6 +61881,7 @@ characters.data={
linebreak="al",
shcode=0x3B9,
specials={ "char", 0x3B9, 0x342 },
+ uccode={ 0x3B9, 0x342 },
unicodeslot=0x1FD6,
},
[0x1FD7]={
@@ -61106,6 +61892,7 @@ characters.data={
linebreak="al",
shcode=0x3B9,
specials={ "char", 0x3CA, 0x342 },
+ uccode={ 0x3B9, 0x308, 0x342 },
unicodeslot=0x1FD7,
},
[0x1FD8]={
@@ -61209,6 +61996,7 @@ characters.data={
linebreak="al",
shcode=0x3C5,
specials={ "char", 0x3CB, 0x300 },
+ uccode={ 0x3C5, 0x308, 0x300 },
unicodeslot=0x1FE2,
},
[0x1FE3]={
@@ -61219,6 +62007,7 @@ characters.data={
linebreak="al",
shcode=0x3C5,
specials={ "char", 0x3B0 },
+ uccode={ 0x3C5, 0x308, 0x301 },
unicodeslot=0x1FE3,
},
[0x1FE4]={
@@ -61229,6 +62018,7 @@ characters.data={
linebreak="al",
shcode=0x3C1,
specials={ "char", 0x3C1, 0x313 },
+ uccode={ 0x3C1, 0x313 },
unicodeslot=0x1FE4,
},
[0x1FE5]={
@@ -61250,6 +62040,7 @@ characters.data={
linebreak="al",
shcode=0x3C5,
specials={ "char", 0x3C5, 0x342 },
+ uccode={ 0x3C5, 0x342 },
unicodeslot=0x1FE6,
},
[0x1FE7]={
@@ -61260,6 +62051,7 @@ characters.data={
linebreak="al",
shcode=0x3C5,
specials={ "char", 0x3CB, 0x342 },
+ uccode={ 0x3C5, 0x308, 0x342 },
unicodeslot=0x1FE7,
},
[0x1FE8]={
@@ -61352,6 +62144,7 @@ characters.data={
linebreak="al",
shcode=0x3C9,
specials={ "char", 0x1F7C, 0x345 },
+ uccode={ 0x1F7C, 0x3B9 },
unicodeslot=0x1FF2,
},
[0x1FF3]={
@@ -61362,7 +62155,7 @@ characters.data={
linebreak="al",
shcode=0x3C9,
specials={ "char", 0x3C9, 0x345 },
- uccode=0x1FFC,
+ uccode={ 0x3C9, 0x3B9 },
unicodeslot=0x1FF3,
},
[0x1FF4]={
@@ -61373,6 +62166,7 @@ characters.data={
linebreak="al",
shcode=0x3C9,
specials={ "char", 0x3CE, 0x345 },
+ uccode={ 0x3CE, 0x3B9 },
unicodeslot=0x1FF4,
},
[0x1FF6]={
@@ -61383,6 +62177,7 @@ characters.data={
linebreak="al",
shcode=0x3C9,
specials={ "char", 0x3C9, 0x342 },
+ uccode={ 0x3C9, 0x342 },
unicodeslot=0x1FF6,
},
[0x1FF7]={
@@ -61393,6 +62188,7 @@ characters.data={
linebreak="al",
shcode=0x3C9,
specials={ "char", 0x1FF6, 0x345 },
+ uccode={ 0x3C9, 0x342, 0x3B9 },
unicodeslot=0x1FF7,
},
[0x1FF8]={
@@ -61647,7 +62443,8 @@ characters.data={
[0x2012]={
adobename="figuredash",
category="pd",
- contextname="textminus",
+ contextname="figuredash",
+ contextspec={ "textminus" },
description="FIGURE DASH",
direction="on",
linebreak="ba",
@@ -61701,7 +62498,7 @@ characters.data={
name="Vert",
},
{
- class="nothing",
+ class="ordinary",
name="Arrowvert",
},
{
@@ -61709,6 +62506,10 @@ characters.data={
name="lVert",
},
{
+ class="middle",
+ name="mVert",
+ },
+ {
class="close",
name="rVert",
},
@@ -61824,7 +62625,7 @@ characters.data={
name="dagger",
},
{
- class="box",
+ class="ordinary",
name="dag",
},
},
@@ -61845,7 +62646,7 @@ characters.data={
name="ddagger",
},
{
- class="box",
+ class="ordinary",
name="ddag",
},
},
@@ -61902,11 +62703,11 @@ characters.data={
linebreak="in",
mathspec={
{
- class="inner",
+ class="ellipsis",
name="ldots",
},
{
- class="inner",
+ class="ellipsis",
name="dots",
},
},
@@ -62016,7 +62817,7 @@ characters.data={
description="PRIME",
direction="et",
linebreak="po",
- mathclass="nothing",
+ mathclass="prime",
mathname="prime",
synonyms={ "feet", "minutes" },
unicodeslot=0x2032,
@@ -62028,7 +62829,7 @@ characters.data={
description="DOUBLE PRIME",
direction="et",
linebreak="po",
- mathclass="nothing",
+ mathclass="prime",
mathname="doubleprime",
specials={ "compat", 0x2032, 0x2032 },
synonyms={ "inches", "seconds" },
@@ -62039,7 +62840,7 @@ characters.data={
description="TRIPLE PRIME",
direction="et",
linebreak="po",
- mathclass="nothing",
+ mathclass="prime",
mathname="tripleprime",
specials={ "compat", 0x2032, 0x2032, 0x2032 },
unicodeslot=0x2034,
@@ -62051,7 +62852,7 @@ characters.data={
description="REVERSED PRIME",
direction="on",
linebreak="po",
- mathclass="nothing",
+ mathclass="prime",
mathname="reversedprime",
unicodeslot=0x2035,
},
@@ -62060,7 +62861,7 @@ characters.data={
description="REVERSED DOUBLE PRIME",
direction="on",
linebreak="po",
- mathclass="nothing",
+ mathclass="prime",
mathname="reverseddoubleprime",
specials={ "compat", 0x2035, 0x2035 },
unicodeslot=0x2036,
@@ -62070,7 +62871,7 @@ characters.data={
description="REVERSED TRIPLE PRIME",
direction="on",
linebreak="po",
- mathclass="nothing",
+ mathclass="prime",
mathname="reversedtripleprime",
specials={ "compat", 0x2035, 0x2035, 0x2035 },
unicodeslot=0x2037,
@@ -62203,16 +63004,6 @@ characters.data={
description="FRACTION SLASH",
direction="cs",
linebreak="is",
- mathspec={
- {
- class="ordinary",
- name="slash",
- },
- {
- class="close",
- name="solidus",
- },
- },
synonyms={ "solidus" },
unicodeslot=0x2044,
},
@@ -62354,8 +63145,8 @@ characters.data={
category="po",
description="QUADRUPLE PRIME",
direction="on",
- linebreak="al",
- mathclass="nothing",
+ linebreak="po",
+ mathclass="prime",
mathname="quadrupleprime",
specials={ "compat", 0x2032, 0x2032, 0x2032, 0x2032 },
unicodeslot=0x2057,
@@ -62431,34 +63222,43 @@ characters.data={
},
[0x2061]={
category="cf",
- comment="maybe: nulloperator",
+ comment="ordinary",
description="FUNCTION APPLICATION",
direction="bn",
linebreak="al",
+ mathclass="ghost",
+ mathname="applyfunction",
unicodeslot=0x2061,
},
[0x2062]={
category="cf",
+ comment="binary",
description="INVISIBLE TIMES",
direction="bn",
linebreak="al",
+ mathclass="ghost",
+ mathname="invisibletimes",
unicodeslot=0x2062,
},
[0x2063]={
category="cf",
+ comment="punctuation",
description="INVISIBLE SEPARATOR",
direction="bn",
linebreak="al",
- mathclass="binary",
- mathname="invisibletimes",
+ mathclass="ghost",
+ mathname="invisiblecomma",
synonyms={ "invisible comma" },
unicodeslot=0x2063,
},
[0x2064]={
category="cf",
+ comment="binary",
description="INVISIBLE PLUS",
direction="bn",
linebreak="al",
+ mathclass="ghost",
+ mathname="invisibleplus",
unicodeslot=0x2064,
},
[0x2066]={
@@ -63173,6 +63973,13 @@ characters.data={
linebreak="pr",
unicodeslot=0x20BF,
},
+ [0x20C0]={
+ category="sc",
+ description="SOM SIGN",
+ direction="et",
+ linebreak="po",
+ unicodeslot=0x20C0,
+ },
[0x20D0]={
category="mn",
combining=0xE6,
@@ -63238,6 +64045,7 @@ characters.data={
linebreak="cm",
mathclass="topaccent",
mathname="vec",
+ mathstretch="h",
synonyms={ "vector" },
unicodeslot=0x20D7,
},
@@ -63305,7 +64113,7 @@ characters.data={
description="COMBINING ENCLOSING SQUARE",
direction="nsm",
linebreak="cm",
- mathclass="default",
+ mathclass="ordinary",
mathname="bigsquare",
unicodeslot=0x20DE,
},
@@ -63314,7 +64122,7 @@ characters.data={
description="COMBINING ENCLOSING DIAMOND",
direction="nsm",
linebreak="cm",
- mathclass="default",
+ mathclass="ordinary",
mathname="bigdiamond",
unicodeslot=0x20DF,
},
@@ -63479,7 +64287,7 @@ characters.data={
description="DOUBLE-STRUCK CAPITAL C",
direction="l",
linebreak="al",
- mathclass="variable",
+ mathgroup="constant set",
mathname="complexes",
specials={ "font", 0x43 },
synonyms={ "complex numbers", "the set of complex numbers" },
@@ -63528,7 +64336,6 @@ characters.data={
description="EULER CONSTANT",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="Eulerconst",
specials={ "compat", 0x190 },
unicodeslot=0x2107,
@@ -63567,6 +64374,7 @@ characters.data={
linebreak="al",
specials={ "font", 0x48 },
unicodeslot=0x210B,
+ variants=variants_style,
visual="it",
},
[0x210C]={
@@ -63591,7 +64399,6 @@ characters.data={
description="PLANCK CONSTANT",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="Plankconst",
specials={ "font", 0x68 },
unicodeslot=0x210E,
@@ -63603,7 +64410,7 @@ characters.data={
linebreak="al",
mathspec={
{
- class="variable",
+ class="ordinary",
name="hslash",
},
{
@@ -63621,6 +64428,7 @@ characters.data={
linebreak="al",
specials={ "font", 0x49 },
unicodeslot=0x2110,
+ variants=variants_style,
visual="it",
},
[0x2111]={
@@ -63629,7 +64437,6 @@ characters.data={
description="BLACK-LETTER CAPITAL I",
direction="l",
linebreak="al",
- mathclass="default",
mathname="Im",
specials={ "font", 0x49 },
synonyms={ "imaginary part" },
@@ -63643,6 +64450,7 @@ characters.data={
specials={ "font", 0x4C },
synonyms={ "laplace transform" },
unicodeslot=0x2112,
+ variants=variants_style,
visual="it",
},
[0x2113]={
@@ -63653,7 +64461,7 @@ characters.data={
description="SCRIPT SMALL L",
direction="l",
linebreak="ai",
- mathclass="default",
+ mathclass="ordinary",
mathname="ell",
specials={ "font", 0x6C },
synonyms={ "liter" },
@@ -63672,7 +64480,7 @@ characters.data={
description="DOUBLE-STRUCK CAPITAL N",
direction="l",
linebreak="al",
- mathclass="variable",
+ mathgroup="constant set",
mathname="naturalnumbers",
specials={ "font", 0x4E },
synonyms={ "natural number" },
@@ -63704,7 +64512,6 @@ characters.data={
description="SCRIPT CAPITAL P",
direction="on",
linebreak="al",
- mathclass="default",
mathname="wp",
synonyms={ "weierstrass elliptic function" },
unicodeslot=0x2118,
@@ -63714,7 +64521,7 @@ characters.data={
description="DOUBLE-STRUCK CAPITAL P",
direction="l",
linebreak="al",
- mathclass="variable",
+ mathgroup="constant set",
mathname="primes",
specials={ "font", 0x50 },
unicodeslot=0x2119,
@@ -63724,7 +64531,7 @@ characters.data={
description="DOUBLE-STRUCK CAPITAL Q",
direction="l",
linebreak="al",
- mathclass="variable",
+ mathgroup="constant set",
mathname="rationals",
specials={ "font", 0x51 },
synonyms={ "rational numbers", "the set of rational numbers" },
@@ -63738,6 +64545,7 @@ characters.data={
specials={ "font", 0x52 },
synonyms={ "riemann integral" },
unicodeslot=0x211B,
+ variants=variants_style,
visual="it",
},
[0x211C]={
@@ -63746,7 +64554,6 @@ characters.data={
description="BLACK-LETTER CAPITAL R",
direction="l",
linebreak="al",
- mathclass="default",
mathname="Re",
specials={ "font", 0x52 },
synonyms={ "real part" },
@@ -63757,7 +64564,7 @@ characters.data={
description="DOUBLE-STRUCK CAPITAL R",
direction="l",
linebreak="al",
- mathclass="variable",
+ mathgroup="constant set",
mathname="reals",
specials={ "font", 0x52 },
synonyms={ "real numbers", "the set of real numbers" },
@@ -63821,7 +64628,7 @@ characters.data={
description="DOUBLE-STRUCK CAPITAL Z",
direction="l",
linebreak="al",
- mathclass="variable",
+ mathgroup="constant set",
mathname="integers",
specials={ "font", 0x5A },
synonyms={ "integers", "the set of integers" },
@@ -63844,7 +64651,6 @@ characters.data={
direction="l",
lccode=0x3C9,
linebreak="al",
- mathclass="variable",
mathname="ohm",
specials={ "char", 0x3A9 },
unicodeslot=0x2126,
@@ -63855,7 +64661,6 @@ characters.data={
description="INVERTED OHM SIGN",
direction="on",
linebreak="al",
- mathclass="variable",
mathname="mho",
synonyms={ "mho" },
unicodeslot=0x2127,
@@ -63873,7 +64678,6 @@ characters.data={
description="TURNED GREEK SMALL LETTER IOTA",
direction="on",
linebreak="al",
- mathclass="variable",
mathname="turnediota",
synonyms={ "unique element" },
unicodeslot=0x2129,
@@ -63897,7 +64701,6 @@ characters.data={
direction="l",
lccode=0xE5,
linebreak="ai",
- mathclass="variable",
mathname="Angstrom",
specials={ "char", 0xC5 },
unicodeslot=0x212B,
@@ -63910,6 +64713,7 @@ characters.data={
specials={ "font", 0x42 },
synonyms={ "bernoulli function" },
unicodeslot=0x212C,
+ variants=variants_style,
visual="it",
},
[0x212D]={
@@ -63946,6 +64750,7 @@ characters.data={
specials={ "font", 0x45 },
synonyms={ "electromotive force", "emf" },
unicodeslot=0x2130,
+ variants=variants_style,
visual="it",
},
[0x2131]={
@@ -63956,6 +64761,7 @@ characters.data={
specials={ "font", 0x46 },
synonyms={ "fourier transform" },
unicodeslot=0x2131,
+ variants=variants_style,
visual="it",
},
[0x2132]={
@@ -63977,6 +64783,7 @@ characters.data={
specials={ "font", 0x4D },
synonyms={ "german mark pre-wwii", "m-matrix" },
unicodeslot=0x2133,
+ variants=variants_style,
visual="it",
},
[0x2134]={
@@ -63995,7 +64802,7 @@ characters.data={
description="ALEF SYMBOL",
direction="l",
linebreak="al",
- mathclass="default",
+ mathclass="ordinary",
mathname="aleph",
specials={ "compat", 0x5D0 },
synonyms={ "first transfinite cardinal", "first transfinite cardinal countable" },
@@ -64006,7 +64813,7 @@ characters.data={
description="BET SYMBOL",
direction="l",
linebreak="al",
- mathclass="default",
+ mathclass="ordinary",
mathname="beth",
specials={ "compat", 0x5D1 },
synonyms={ "second transfinite cardinal", "second transfinite cardinal continuum" },
@@ -64017,7 +64824,7 @@ characters.data={
description="GIMEL SYMBOL",
direction="l",
linebreak="al",
- mathclass="default",
+ mathclass="ordinary",
mathname="gimel",
specials={ "compat", 0x5D2 },
synonyms={ "third transfinite cardinal" },
@@ -64028,7 +64835,7 @@ characters.data={
description="DALET SYMBOL",
direction="l",
linebreak="al",
- mathclass="default",
+ mathclass="ordinary",
mathname="daleth",
specials={ "compat", 0x5D3 },
synonyms={ "fourth transfinite cardinal" },
@@ -64140,7 +64947,7 @@ characters.data={
description="DOUBLE-STRUCK ITALIC CAPITAL D",
direction="l",
linebreak="al",
- mathclass="nothing",
+ mathclass="differential",
mathname="differentialD",
specials={ "font", 0x44 },
unicodeslot=0x2145,
@@ -64150,7 +64957,7 @@ characters.data={
description="DOUBLE-STRUCK ITALIC SMALL D",
direction="l",
linebreak="al",
- mathclass="nothing",
+ mathclass="differential",
mathname="differentiald",
specials={ "font", 0x64 },
unicodeslot=0x2146,
@@ -64160,7 +64967,7 @@ characters.data={
description="DOUBLE-STRUCK ITALIC SMALL E",
direction="l",
linebreak="al",
- mathclass="nothing",
+ mathclass="exponential",
mathname="exponentiale",
specials={ "font", 0x65 },
unicodeslot=0x2147,
@@ -64170,7 +64977,7 @@ characters.data={
description="DOUBLE-STRUCK ITALIC SMALL I",
direction="l",
linebreak="al",
- mathclass="nothing",
+ mathclass="ordinary",
mathname="imaginaryi",
specials={ "font", 0x69 },
unicodeslot=0x2148,
@@ -64180,7 +64987,7 @@ characters.data={
description="DOUBLE-STRUCK ITALIC SMALL J",
direction="l",
linebreak="al",
- mathclass="nothing",
+ mathclass="ordinary",
mathname="imaginaryj",
specials={ "font", 0x6A },
unicodeslot=0x2149,
@@ -66142,7 +66949,7 @@ characters.data={
description="PARTIAL DIFFERENTIAL",
direction="on",
linebreak="ai",
- mathclass="default",
+ mathclass="differential",
mathname="partial",
unicodeslot=0x2202,
},
@@ -66174,7 +66981,8 @@ characters.data={
description="EMPTY SET",
direction="on",
linebreak="al",
- mathclass="default",
+ mathclass="ordinary",
+ mathgroup="constant set",
mathname="emptyset",
synonyms={ "null set" },
unicodeslot=0x2205,
@@ -66188,6 +66996,8 @@ characters.data={
description="INCREMENT",
direction="on",
linebreak="al",
+ mathclass="differential",
+ mathname="laplace",
synonyms={ "forward difference", "laplace operator" },
unicodeslot=0x2206,
},
@@ -66198,7 +67008,7 @@ characters.data={
description="NABLA",
direction="on",
linebreak="ai",
- mathclass="default",
+ mathclass="ordinary",
mathname="nabla",
synonyms={ "backward difference", "del" },
unicodeslot=0x2207,
@@ -66339,6 +67149,7 @@ characters.data={
description="MINUS SIGN",
direction="es",
linebreak="pr",
+ mathgroup="binary arithmetic",
mathspec={
{
class="binary",
@@ -66346,6 +67157,7 @@ characters.data={
},
{
class="relation",
+ comment="useless",
name="relbar",
},
},
@@ -66354,6 +67166,7 @@ characters.data={
[0x2213]={
adobename="minusplus",
category="sm",
+ contextname="textmp",
description="MINUS-OR-PLUS SIGN",
direction="et",
linebreak="pr",
@@ -66480,7 +67293,7 @@ characters.data={
description="INFINITY",
direction="on",
linebreak="ai",
- mathclass="default",
+ mathclass="ordinary",
mathname="infty",
unicodeslot=0x221E,
},
@@ -66536,8 +67349,17 @@ characters.data={
description="DIVIDES",
direction="on",
linebreak="ai",
- mathclass="binary",
- mathname="divides",
+ mathspec={
+ {
+ -- class="binary",
+ class="ordinary",
+ name="divides",
+ },
+ {
+ class="relation",
+ name="mid",
+ },
+ },
synonyms={ "apl stile", "such that" },
unicodeslot=0x2223,
},
@@ -66548,7 +67370,8 @@ characters.data={
linebreak="al",
mathspec={
{
- class="binary",
+ -- class="binary",
+ class="ordinary",
name="ndivides",
},
{
@@ -66670,7 +67493,7 @@ characters.data={
name="int",
},
{
- class="nothing",
+ class="ordinary",
name="intop",
},
},
@@ -66690,7 +67513,7 @@ characters.data={
name="iint",
},
{
- class="nothing",
+ class="ordinary",
name="iintop",
},
},
@@ -66709,7 +67532,7 @@ characters.data={
name="iiint",
},
{
- class="nothing",
+ class="ordinary",
name="iiintop",
},
},
@@ -67294,6 +68117,7 @@ characters.data={
description="LESS-THAN OR EQUAL TO",
direction="on",
linebreak="ai",
+ mathgroup="nary relation",
mathlist={ 0x3C, 0x3D },
mathspec={
{
@@ -67315,6 +68139,7 @@ characters.data={
description="GREATER-THAN OR EQUAL TO",
direction="on",
linebreak="ai",
+ mathgroup="nary relation",
mathlist={ 0x3E, 0x3D },
mathspec={
{
@@ -68041,7 +68866,7 @@ characters.data={
description="DOWN TACK",
direction="on",
linebreak="al",
- mathclass="default",
+ mathclass="ordinary",
mathname="top",
synonyms={ "top" },
unicodeslot=0x22A4,
@@ -68055,7 +68880,7 @@ characters.data={
linebreak="ai",
mathspec={
{
- class="default",
+ class="ordinary",
name="bot",
},
{
@@ -68820,7 +69645,7 @@ characters.data={
description="VERTICAL ELLIPSIS",
direction="on",
linebreak="al",
- mathclass="inner",
+ mathclass="ellipsis",
mathname="vdots",
unicodeslot=0x22EE,
},
@@ -68829,7 +69654,7 @@ characters.data={
description="MIDLINE HORIZONTAL ELLIPSIS",
direction="on",
linebreak="in",
- mathclass="inner",
+ mathclass="ellipsis",
mathname="cdots",
unicodeslot=0x22EF,
},
@@ -68838,7 +69663,7 @@ characters.data={
description="UP RIGHT DIAGONAL ELLIPSIS",
direction="on",
linebreak="al",
- mathclass="inner",
+ mathclass="ellipsis",
mathname="udots",
mirror=0x22F1,
unicodeslot=0x22F0,
@@ -68848,7 +69673,7 @@ characters.data={
description="DOWN RIGHT DIAGONAL ELLIPSIS",
direction="on",
linebreak="al",
- mathclass="inner",
+ mathclass="ellipsis",
mathname="ddots",
mirror=0x22F0,
unicodeslot=0x22F1,
@@ -68968,11 +69793,11 @@ characters.data={
linebreak="al",
mathspec={
{
- class="ord",
+ class="ordinary",
name="varnothing",
},
{
- class="ord",
+ class="ordinary",
name="diameter",
},
},
@@ -75745,7 +76570,7 @@ characters.data={
description="BLACK SPADE SUIT",
direction="on",
linebreak="ai",
- mathclass="default",
+ mathclass="ordinary",
mathname="spadesuit",
unicodeslot=0x2660,
variants=variants_emoji,
@@ -75757,7 +76582,7 @@ characters.data={
description="WHITE HEART SUIT",
direction="on",
linebreak="ai",
- mathclass="default",
+ mathclass="ordinary",
mathname="heartsuit",
unicodeslot=0x2661,
},
@@ -75767,7 +76592,7 @@ characters.data={
description="WHITE DIAMOND SUIT",
direction="on",
linebreak="al",
- mathclass="default",
+ mathclass="ordinary",
mathname="diamondsuit",
unicodeslot=0x2662,
},
@@ -75778,7 +76603,7 @@ characters.data={
description="BLACK CLUB SUIT",
direction="on",
linebreak="ai",
- mathclass="default",
+ mathclass="ordinary",
mathname="clubsuit",
synonyms={ "shamrock" },
unicodeslot=0x2663,
@@ -75880,7 +76705,7 @@ characters.data={
description="MUSIC FLAT SIGN",
direction="on",
linebreak="ai",
- mathclass="default",
+ mathclass="ordinary",
mathname="flat",
unicodeslot=0x266D,
},
@@ -75889,7 +76714,7 @@ characters.data={
description="MUSIC NATURAL SIGN",
direction="on",
linebreak="al",
- mathclass="default",
+ mathclass="ordinary",
mathname="natural",
unicodeslot=0x266E,
},
@@ -75900,7 +76725,7 @@ characters.data={
description="MUSIC SHARP SIGN",
direction="on",
linebreak="ai",
- mathclass="default",
+ mathclass="ordinary",
mathname="sharp",
synonyms={ "infix bag count" },
unicodeslot=0x266F,
@@ -77201,7 +78026,7 @@ characters.data={
description="CHECK MARK",
direction="on",
linebreak="al",
- mathclass="nothing",
+ mathclass="ordinary",
mathname="checkmark",
unicodeslot=0x2713,
},
@@ -77297,7 +78122,7 @@ characters.data={
description="MALTESE CROSS",
direction="on",
linebreak="al",
- mathclass="nothing",
+ mathclass="ordinary",
mathname="maltese",
unicodeslot=0x2720,
},
@@ -82936,7 +83761,7 @@ characters.data={
name="iiiint",
},
{
- class="nothing",
+ class="ordinary",
name="iiiintop",
},
},
@@ -87051,6 +87876,14 @@ characters.data={
linebreak="al",
unicodeslot=0x2C2E,
},
+ [0x2C2F]={
+ category="lu",
+ description="GLAGOLITIC CAPITAL LETTER CAUDATE CHRIVI",
+ direction="l",
+ lccode=0x2C5F,
+ linebreak="al",
+ unicodeslot=0x2C2F,
+ },
[0x2C30]={
category="ll",
description="GLAGOLITIC SMALL LETTER AZU",
@@ -87427,6 +88260,13 @@ characters.data={
uccode=0x2C2E,
unicodeslot=0x2C5E,
},
+ [0x2C5F]={
+ category="ll",
+ description="GLAGOLITIC SMALL LETTER CAUDATE CHRIVI",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x2C5F,
+ },
[0x2C60]={
category="lu",
description="LATIN CAPITAL LETTER L WITH DOUBLE BAR",
@@ -87550,6 +88390,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER ALPHA",
direction="l",
+ lccode=0x251,
linebreak="al",
unicodeslot=0x2C6D,
},
@@ -87557,6 +88398,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER M WITH HOOK",
direction="l",
+ lccode=0x271,
linebreak="al",
specials={ "with", 0x4D, 0x1FA9D },
unicodeslot=0x2C6E,
@@ -87565,6 +88407,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER TURNED A",
direction="l",
+ lccode=0x250,
linebreak="al",
unicodeslot=0x2C6F,
},
@@ -87572,6 +88415,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER TURNED ALPHA",
direction="l",
+ lccode=0x252,
linebreak="al",
unicodeslot=0x2C70,
},
@@ -87586,6 +88430,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER W WITH HOOK",
direction="l",
+ lccode=0x2C73,
linebreak="al",
specials={ "with", 0x57, 0x1FA9D },
unicodeslot=0x2C72,
@@ -87677,6 +88522,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER S WITH SWASH TAIL",
direction="l",
+ lccode=0x23F,
linebreak="al",
unicodeslot=0x2C7E,
},
@@ -87684,6 +88530,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER Z WITH SWASH TAIL",
direction="l",
+ lccode=0x240,
linebreak="al",
unicodeslot=0x2C7F,
},
@@ -88540,6 +89387,7 @@ characters.data={
category="lu",
description="COPTIC CAPITAL LETTER CRYPTOGRAMMIC SHEI",
direction="l",
+ lccode=0x2CEC,
linebreak="al",
unicodeslot=0x2CEB,
},
@@ -88554,6 +89402,7 @@ characters.data={
category="lu",
description="COPTIC CAPITAL LETTER CRYPTOGRAMMIC GANGIA",
direction="l",
+ lccode=0x2CEE,
linebreak="al",
unicodeslot=0x2CED,
},
@@ -88592,6 +89441,7 @@ characters.data={
category="lu",
description="COPTIC CAPITAL LETTER BOHAIRIC KHEI",
direction="l",
+ lccode=0x2CF3,
linebreak="al",
unicodeslot=0x2CF2,
},
@@ -90796,6 +91646,91 @@ characters.data={
linebreak="al",
unicodeslot=0x2E52,
},
+ [0x2E53]={
+ category="po",
+ description="MEDIEVAL EXCLAMATION MARK",
+ direction="on",
+ linebreak="ex",
+ unicodeslot=0x2E53,
+ },
+ [0x2E54]={
+ category="po",
+ description="MEDIEVAL QUESTION MARK",
+ direction="on",
+ linebreak="ex",
+ unicodeslot=0x2E54,
+ },
+ [0x2E55]={
+ category="ps",
+ description="LEFT SQUARE BRACKET WITH STROKE",
+ direction="on",
+ linebreak="op",
+ mirror=0x2E56,
+ unicodeslot=0x2E55,
+ },
+ [0x2E56]={
+ category="pe",
+ description="RIGHT SQUARE BRACKET WITH STROKE",
+ direction="on",
+ linebreak="cl",
+ mirror=0x2E55,
+ unicodeslot=0x2E56,
+ },
+ [0x2E57]={
+ category="ps",
+ description="LEFT SQUARE BRACKET WITH DOUBLE STROKE",
+ direction="on",
+ linebreak="op",
+ mirror=0x2E58,
+ unicodeslot=0x2E57,
+ },
+ [0x2E58]={
+ category="pe",
+ description="RIGHT SQUARE BRACKET WITH DOUBLE STROKE",
+ direction="on",
+ linebreak="cl",
+ mirror=0x2E57,
+ unicodeslot=0x2E58,
+ },
+ [0x2E59]={
+ category="ps",
+ description="TOP HALF LEFT PARENTHESIS",
+ direction="on",
+ linebreak="op",
+ mirror=0x2E5A,
+ unicodeslot=0x2E59,
+ },
+ [0x2E5A]={
+ category="pe",
+ description="TOP HALF RIGHT PARENTHESIS",
+ direction="on",
+ linebreak="cl",
+ mirror=0x2E59,
+ unicodeslot=0x2E5A,
+ },
+ [0x2E5B]={
+ category="ps",
+ description="BOTTOM HALF LEFT PARENTHESIS",
+ direction="on",
+ linebreak="op",
+ mirror=0x2E5C,
+ unicodeslot=0x2E5B,
+ },
+ [0x2E5C]={
+ category="pe",
+ description="BOTTOM HALF RIGHT PARENTHESIS",
+ direction="on",
+ linebreak="cl",
+ mirror=0x2E5B,
+ unicodeslot=0x2E5C,
+ },
+ [0x2E5D]={
+ category="pd",
+ description="OBLIQUE HYPHEN",
+ direction="on",
+ linebreak="ba",
+ unicodeslot=0x2E5D,
+ },
[0x2E80]={
category="so",
cjkwd="w",
@@ -116276,6 +117211,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER ZEMLYA",
direction="l",
+ lccode=0xA641,
linebreak="al",
unicodeslot=0xA640,
},
@@ -116290,6 +117226,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER DZELO",
direction="l",
+ lccode=0xA643,
linebreak="al",
unicodeslot=0xA642,
},
@@ -116304,6 +117241,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER REVERSED DZE",
direction="l",
+ lccode=0xA645,
linebreak="al",
unicodeslot=0xA644,
},
@@ -116318,6 +117256,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER IOTA",
direction="l",
+ lccode=0xA647,
linebreak="al",
unicodeslot=0xA646,
},
@@ -116332,6 +117271,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER DJERV",
direction="l",
+ lccode=0xA649,
linebreak="al",
unicodeslot=0xA648,
},
@@ -116346,6 +117286,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER MONOGRAPH UK",
direction="l",
+ lccode=0xA64B,
linebreak="al",
unicodeslot=0xA64A,
},
@@ -116360,6 +117301,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER BROAD OMEGA",
direction="l",
+ lccode=0xA64D,
linebreak="al",
unicodeslot=0xA64C,
},
@@ -116374,6 +117316,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER NEUTRAL YER",
direction="l",
+ lccode=0xA64F,
linebreak="al",
unicodeslot=0xA64E,
},
@@ -116388,6 +117331,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER YERU WITH BACK YER",
direction="l",
+ lccode=0xA651,
linebreak="al",
unicodeslot=0xA650,
},
@@ -116402,6 +117346,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER IOTIFIED YAT",
direction="l",
+ lccode=0xA653,
linebreak="al",
unicodeslot=0xA652,
},
@@ -116416,6 +117361,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER REVERSED YU",
direction="l",
+ lccode=0xA655,
linebreak="al",
unicodeslot=0xA654,
},
@@ -116430,6 +117376,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER IOTIFIED A",
direction="l",
+ lccode=0xA657,
linebreak="al",
unicodeslot=0xA656,
},
@@ -116444,6 +117391,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER CLOSED LITTLE YUS",
direction="l",
+ lccode=0xA659,
linebreak="al",
unicodeslot=0xA658,
},
@@ -116458,6 +117406,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER BLENDED YUS",
direction="l",
+ lccode=0xA65B,
linebreak="al",
unicodeslot=0xA65A,
},
@@ -116472,6 +117421,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER IOTIFIED CLOSED LITTLE YUS",
direction="l",
+ lccode=0xA65D,
linebreak="al",
unicodeslot=0xA65C,
},
@@ -116486,6 +117436,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER YN",
direction="l",
+ lccode=0xA65F,
linebreak="al",
unicodeslot=0xA65E,
},
@@ -116500,6 +117451,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER REVERSED TSE",
direction="l",
+ lccode=0xA661,
linebreak="al",
unicodeslot=0xA660,
},
@@ -116514,6 +117466,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER SOFT DE",
direction="l",
+ lccode=0xA663,
linebreak="al",
unicodeslot=0xA662,
},
@@ -116528,6 +117481,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER SOFT EL",
direction="l",
+ lccode=0xA665,
linebreak="al",
unicodeslot=0xA664,
},
@@ -116542,6 +117496,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER SOFT EM",
direction="l",
+ lccode=0xA667,
linebreak="al",
unicodeslot=0xA666,
},
@@ -116556,6 +117511,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER MONOCULAR O",
direction="l",
+ lccode=0xA669,
linebreak="al",
unicodeslot=0xA668,
},
@@ -116570,6 +117526,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER BINOCULAR O",
direction="l",
+ lccode=0xA66B,
linebreak="al",
unicodeslot=0xA66A,
},
@@ -116584,6 +117541,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER DOUBLE MONOCULAR O",
direction="l",
+ lccode=0xA66D,
linebreak="al",
unicodeslot=0xA66C,
},
@@ -116735,6 +117693,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER DWE",
direction="l",
+ lccode=0xA681,
linebreak="al",
unicodeslot=0xA680,
},
@@ -116749,6 +117708,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER DZWE",
direction="l",
+ lccode=0xA683,
linebreak="al",
unicodeslot=0xA682,
},
@@ -116763,6 +117723,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER ZHWE",
direction="l",
+ lccode=0xA685,
linebreak="al",
unicodeslot=0xA684,
},
@@ -116777,6 +117738,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER CCHE",
direction="l",
+ lccode=0xA687,
linebreak="al",
unicodeslot=0xA686,
},
@@ -116791,6 +117753,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER DZZE",
direction="l",
+ lccode=0xA689,
linebreak="al",
unicodeslot=0xA688,
},
@@ -116805,6 +117768,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER TE WITH MIDDLE HOOK",
direction="l",
+ lccode=0xA68B,
linebreak="al",
unicodeslot=0xA68A,
},
@@ -116819,6 +117783,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER TWE",
direction="l",
+ lccode=0xA68D,
linebreak="al",
unicodeslot=0xA68C,
},
@@ -116833,6 +117798,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER TSWE",
direction="l",
+ lccode=0xA68F,
linebreak="al",
unicodeslot=0xA68E,
},
@@ -116847,6 +117813,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER TSSE",
direction="l",
+ lccode=0xA691,
linebreak="al",
unicodeslot=0xA690,
},
@@ -116861,6 +117828,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER TCHE",
direction="l",
+ lccode=0xA693,
linebreak="al",
unicodeslot=0xA692,
},
@@ -116875,6 +117843,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER HWE",
direction="l",
+ lccode=0xA695,
linebreak="al",
unicodeslot=0xA694,
},
@@ -116889,6 +117858,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER SHWE",
direction="l",
+ lccode=0xA697,
linebreak="al",
unicodeslot=0xA696,
},
@@ -116903,6 +117873,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER DOUBLE O",
direction="l",
+ lccode=0xA699,
linebreak="al",
unicodeslot=0xA698,
},
@@ -116917,6 +117888,7 @@ characters.data={
category="lu",
description="CYRILLIC CAPITAL LETTER CROSSED O",
direction="l",
+ lccode=0xA69B,
linebreak="al",
unicodeslot=0xA69A,
},
@@ -117819,6 +118791,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER EGYPTOLOGICAL ALEF",
direction="l",
+ lccode=0xA723,
linebreak="al",
unicodeslot=0xA722,
},
@@ -117833,6 +118806,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER EGYPTOLOGICAL AIN",
direction="l",
+ lccode=0xA725,
linebreak="al",
unicodeslot=0xA724,
},
@@ -117847,6 +118821,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER HENG",
direction="l",
+ lccode=0xA727,
linebreak="al",
unicodeslot=0xA726,
},
@@ -117861,6 +118836,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER TZ",
direction="l",
+ lccode=0xA729,
linebreak="al",
unicodeslot=0xA728,
},
@@ -117875,6 +118851,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER TRESILLO",
direction="l",
+ lccode=0xA72B,
linebreak="al",
unicodeslot=0xA72A,
},
@@ -117889,6 +118866,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER CUATRILLO",
direction="l",
+ lccode=0xA72D,
linebreak="al",
unicodeslot=0xA72C,
},
@@ -117903,6 +118881,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER CUATRILLO WITH COMMA",
direction="l",
+ lccode=0xA72F,
linebreak="al",
specials={ "with", 0xA72C, 0x2C },
unicodeslot=0xA72E,
@@ -117933,6 +118912,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER AA",
direction="l",
+ lccode=0xA733,
linebreak="al",
unicodeslot=0xA732,
},
@@ -117947,6 +118927,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER AO",
direction="l",
+ lccode=0xA735,
linebreak="al",
unicodeslot=0xA734,
},
@@ -117961,6 +118942,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER AU",
direction="l",
+ lccode=0xA737,
linebreak="al",
unicodeslot=0xA736,
},
@@ -117975,6 +118957,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER AV",
direction="l",
+ lccode=0xA739,
linebreak="al",
unicodeslot=0xA738,
},
@@ -117989,6 +118972,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER AV WITH HORIZONTAL BAR",
direction="l",
+ lccode=0xA73B,
linebreak="al",
specials={ "with", 0xA738, 0x2015 },
unicodeslot=0xA73A,
@@ -118005,6 +118989,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER AY",
direction="l",
+ lccode=0xA73D,
linebreak="al",
unicodeslot=0xA73C,
},
@@ -118019,6 +119004,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER REVERSED C WITH DOT",
direction="l",
+ lccode=0xA73F,
linebreak="al",
unicodeslot=0xA73E,
},
@@ -118033,6 +119019,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER K WITH STROKE",
direction="l",
+ lccode=0xA741,
linebreak="al",
specials={ "with", 0x4B, 0x2F },
unicodeslot=0xA740,
@@ -118049,6 +119036,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER K WITH DIAGONAL STROKE",
direction="l",
+ lccode=0xA743,
linebreak="al",
unicodeslot=0xA742,
},
@@ -118063,6 +119051,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER K WITH STROKE AND DIAGONAL STROKE",
direction="l",
+ lccode=0xA745,
linebreak="al",
unicodeslot=0xA744,
},
@@ -118077,6 +119066,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER BROKEN L",
direction="l",
+ lccode=0xA747,
linebreak="al",
unicodeslot=0xA746,
},
@@ -118091,6 +119081,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER L WITH HIGH STROKE",
direction="l",
+ lccode=0xA749,
linebreak="al",
unicodeslot=0xA748,
},
@@ -118105,6 +119096,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER O WITH LONG STROKE OVERLAY",
direction="l",
+ lccode=0xA74B,
linebreak="al",
unicodeslot=0xA74A,
},
@@ -118119,6 +119111,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER O WITH LOOP",
direction="l",
+ lccode=0xA74D,
linebreak="al",
unicodeslot=0xA74C,
},
@@ -118133,6 +119126,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER OO",
direction="l",
+ lccode=0xA74F,
linebreak="al",
unicodeslot=0xA74E,
},
@@ -118147,6 +119141,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER P WITH STROKE THROUGH DESCENDER",
direction="l",
+ lccode=0xA751,
linebreak="al",
unicodeslot=0xA750,
},
@@ -118161,6 +119156,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER P WITH FLOURISH",
direction="l",
+ lccode=0xA753,
linebreak="al",
unicodeslot=0xA752,
},
@@ -118175,6 +119171,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER P WITH SQUIRREL TAIL",
direction="l",
+ lccode=0xA755,
linebreak="al",
unicodeslot=0xA754,
},
@@ -118189,6 +119186,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER Q WITH STROKE THROUGH DESCENDER",
direction="l",
+ lccode=0xA757,
linebreak="al",
unicodeslot=0xA756,
},
@@ -118203,6 +119201,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER Q WITH DIAGONAL STROKE",
direction="l",
+ lccode=0xA759,
linebreak="al",
unicodeslot=0xA758,
},
@@ -118217,6 +119216,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER R ROTUNDA",
direction="l",
+ lccode=0xA75B,
linebreak="al",
unicodeslot=0xA75A,
},
@@ -118231,6 +119231,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER RUM ROTUNDA",
direction="l",
+ lccode=0xA75D,
linebreak="al",
unicodeslot=0xA75C,
},
@@ -118245,6 +119246,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER V WITH DIAGONAL STROKE",
direction="l",
+ lccode=0xA75F,
linebreak="al",
unicodeslot=0xA75E,
},
@@ -118259,6 +119261,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER VY",
direction="l",
+ lccode=0xA761,
linebreak="al",
unicodeslot=0xA760,
},
@@ -118273,6 +119276,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER VISIGOTHIC Z",
direction="l",
+ lccode=0xA763,
linebreak="al",
unicodeslot=0xA762,
},
@@ -118287,6 +119291,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER THORN WITH STROKE",
direction="l",
+ lccode=0xA765,
linebreak="al",
specials={ "with", 0xDE, 0x2F },
unicodeslot=0xA764,
@@ -118303,6 +119308,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER THORN WITH STROKE THROUGH DESCENDER",
direction="l",
+ lccode=0xA767,
linebreak="al",
unicodeslot=0xA766,
},
@@ -118317,6 +119323,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER VEND",
direction="l",
+ lccode=0xA769,
linebreak="al",
unicodeslot=0xA768,
},
@@ -118331,6 +119338,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER ET",
direction="l",
+ lccode=0xA76B,
linebreak="al",
unicodeslot=0xA76A,
},
@@ -118345,6 +119353,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER IS",
direction="l",
+ lccode=0xA76D,
linebreak="al",
unicodeslot=0xA76C,
},
@@ -118359,6 +119368,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER CON",
direction="l",
+ lccode=0xA76F,
linebreak="al",
unicodeslot=0xA76E,
},
@@ -118437,6 +119447,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER INSULAR D",
direction="l",
+ lccode=0xA77A,
linebreak="al",
unicodeslot=0xA779,
},
@@ -118451,6 +119462,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER INSULAR F",
direction="l",
+ lccode=0xA77C,
linebreak="al",
unicodeslot=0xA77B,
},
@@ -118465,6 +119477,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER INSULAR G",
direction="l",
+ lccode=0x1D79,
linebreak="al",
unicodeslot=0xA77D,
},
@@ -118472,6 +119485,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER TURNED INSULAR G",
direction="l",
+ lccode=0xA77F,
linebreak="al",
unicodeslot=0xA77E,
},
@@ -118486,6 +119500,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER TURNED L",
direction="l",
+ lccode=0xA781,
linebreak="al",
unicodeslot=0xA780,
},
@@ -118500,6 +119515,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER INSULAR R",
direction="l",
+ lccode=0xA783,
linebreak="al",
unicodeslot=0xA782,
},
@@ -118514,6 +119530,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER INSULAR S",
direction="l",
+ lccode=0xA785,
linebreak="al",
unicodeslot=0xA784,
},
@@ -118528,6 +119545,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER INSULAR T",
direction="l",
+ lccode=0xA787,
linebreak="al",
unicodeslot=0xA786,
},
@@ -118563,6 +119581,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER SALTILLO",
direction="l",
+ lccode=0xA78C,
linebreak="al",
unicodeslot=0xA78B,
},
@@ -118577,6 +119596,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER TURNED H",
direction="l",
+ lccode=0x265,
linebreak="al",
unicodeslot=0xA78D,
},
@@ -118598,6 +119618,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER N WITH DESCENDER",
direction="l",
+ lccode=0xA791,
linebreak="al",
unicodeslot=0xA790,
},
@@ -118612,6 +119633,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER C WITH BAR",
direction="l",
+ lccode=0xA793,
linebreak="al",
unicodeslot=0xA792,
},
@@ -118640,6 +119662,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER B WITH FLOURISH",
direction="l",
+ lccode=0xA797,
linebreak="al",
unicodeslot=0xA796,
},
@@ -118654,6 +119677,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER F WITH STROKE",
direction="l",
+ lccode=0xA799,
linebreak="al",
specials={ "with", 0x46, 0x2F },
unicodeslot=0xA798,
@@ -118670,6 +119694,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER VOLAPUK AE",
direction="l",
+ lccode=0xA79B,
linebreak="al",
unicodeslot=0xA79A,
},
@@ -118684,6 +119709,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER VOLAPUK OE",
direction="l",
+ lccode=0xA79D,
linebreak="al",
unicodeslot=0xA79C,
},
@@ -118698,6 +119724,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER VOLAPUK UE",
direction="l",
+ lccode=0xA79F,
linebreak="al",
unicodeslot=0xA79E,
},
@@ -118712,6 +119739,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER G WITH OBLIQUE STROKE",
direction="l",
+ lccode=0xA7A1,
linebreak="al",
unicodeslot=0xA7A0,
},
@@ -118726,6 +119754,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER K WITH OBLIQUE STROKE",
direction="l",
+ lccode=0xA7A3,
linebreak="al",
unicodeslot=0xA7A2,
},
@@ -118740,6 +119769,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER N WITH OBLIQUE STROKE",
direction="l",
+ lccode=0xA7A5,
linebreak="al",
unicodeslot=0xA7A4,
},
@@ -118754,6 +119784,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER R WITH OBLIQUE STROKE",
direction="l",
+ lccode=0xA7A7,
linebreak="al",
unicodeslot=0xA7A6,
},
@@ -118768,6 +119799,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER S WITH OBLIQUE STROKE",
direction="l",
+ lccode=0xA7A9,
linebreak="al",
unicodeslot=0xA7A8,
},
@@ -118782,6 +119814,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER H WITH HOOK",
direction="l",
+ lccode=0x266,
linebreak="al",
specials={ "with", 0x48, 0x1FA9D },
unicodeslot=0xA7AA,
@@ -118790,6 +119823,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER REVERSED OPEN E",
direction="l",
+ lccode=0x25C,
linebreak="al",
unicodeslot=0xA7AB,
},
@@ -118797,6 +119831,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER SCRIPT G",
direction="l",
+ lccode=0x261,
linebreak="al",
unicodeslot=0xA7AC,
},
@@ -118804,6 +119839,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER L WITH BELT",
direction="l",
+ lccode=0x26C,
linebreak="al",
unicodeslot=0xA7AD,
},
@@ -118811,6 +119847,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER SMALL CAPITAL I",
direction="l",
+ lccode=0x26A,
linebreak="al",
unicodeslot=0xA7AE,
},
@@ -118825,6 +119862,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER TURNED K",
direction="l",
+ lccode=0x29E,
linebreak="al",
unicodeslot=0xA7B0,
},
@@ -118832,6 +119870,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER TURNED T",
direction="l",
+ lccode=0x287,
linebreak="al",
unicodeslot=0xA7B1,
},
@@ -118839,6 +119878,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER J WITH CROSSED-TAIL",
direction="l",
+ lccode=0x29D,
linebreak="al",
unicodeslot=0xA7B2,
},
@@ -118846,6 +119886,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER CHI",
direction="l",
+ lccode=0xAB53,
linebreak="al",
unicodeslot=0xA7B3,
},
@@ -118853,6 +119894,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER BETA",
direction="l",
+ lccode=0xA7B5,
linebreak="al",
unicodeslot=0xA7B4,
},
@@ -118867,6 +119909,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER OMEGA",
direction="l",
+ lccode=0xA7B7,
linebreak="al",
unicodeslot=0xA7B6,
},
@@ -118881,6 +119924,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER U WITH STROKE",
direction="l",
+ lccode=0xA7B9,
linebreak="al",
specials={ "with", 0x55, 0x2F },
unicodeslot=0xA7B8,
@@ -118897,6 +119941,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER GLOTTAL A",
direction="l",
+ lccode=0xA7BB,
linebreak="al",
unicodeslot=0xA7BA,
},
@@ -118911,6 +119956,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER GLOTTAL I",
direction="l",
+ lccode=0xA7BD,
linebreak="al",
unicodeslot=0xA7BC,
},
@@ -118925,6 +119971,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER GLOTTAL U",
direction="l",
+ lccode=0xA7BF,
linebreak="al",
unicodeslot=0xA7BE,
},
@@ -118935,10 +119982,26 @@ characters.data={
linebreak="al",
unicodeslot=0xA7BF,
},
+ [0xA7C0]={
+ category="lu",
+ description="LATIN CAPITAL LETTER OLD POLISH O",
+ direction="l",
+ lccode=0xA7C1,
+ linebreak="al",
+ unicodeslot=0xA7C0,
+ },
+ [0xA7C1]={
+ category="ll",
+ description="LATIN SMALL LETTER OLD POLISH O",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0xA7C1,
+ },
[0xA7C2]={
category="lu",
description="LATIN CAPITAL LETTER ANGLICANA W",
direction="l",
+ lccode=0xA7C3,
linebreak="al",
unicodeslot=0xA7C2,
},
@@ -118953,6 +120016,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER C WITH PALATAL HOOK",
direction="l",
+ lccode=0xA794,
linebreak="al",
unicodeslot=0xA7C4,
},
@@ -118960,6 +120024,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER S WITH HOOK",
direction="l",
+ lccode=0x282,
linebreak="al",
specials={ "with", 0x53, 0x1FA9D },
unicodeslot=0xA7C5,
@@ -118968,6 +120033,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER Z WITH PALATAL HOOK",
direction="l",
+ lccode=0x1D8E,
linebreak="al",
unicodeslot=0xA7C6,
},
@@ -118975,6 +120041,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER D WITH SHORT STROKE OVERLAY",
direction="l",
+ lccode=0xA7C8,
linebreak="al",
unicodeslot=0xA7C7,
},
@@ -118989,6 +120056,7 @@ characters.data={
category="lu",
description="LATIN CAPITAL LETTER S WITH SHORT STROKE OVERLAY",
direction="l",
+ lccode=0xA7CA,
linebreak="al",
unicodeslot=0xA7C9,
},
@@ -118999,10 +120067,94 @@ characters.data={
linebreak="al",
unicodeslot=0xA7CA,
},
+ [0xA7D0]={
+ category="lu",
+ description="LATIN CAPITAL LETTER CLOSED INSULAR G",
+ direction="l",
+ lccode=0xA7D1,
+ linebreak="al",
+ unicodeslot=0xA7D0,
+ },
+ [0xA7D1]={
+ category="ll",
+ description="LATIN SMALL LETTER CLOSED INSULAR G",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0xA7D1,
+ },
+ [0xA7D3]={
+ category="ll",
+ description="LATIN SMALL LETTER DOUBLE THORN",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0xA7D3,
+ },
+ [0xA7D5]={
+ category="ll",
+ description="LATIN SMALL LETTER DOUBLE WYNN",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0xA7D5,
+ },
+ [0xA7D6]={
+ category="lu",
+ description="LATIN CAPITAL LETTER MIDDLE SCOTS S",
+ direction="l",
+ lccode=0xA7D7,
+ linebreak="al",
+ unicodeslot=0xA7D6,
+ },
+ [0xA7D7]={
+ category="ll",
+ description="LATIN SMALL LETTER MIDDLE SCOTS S",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0xA7D7,
+ },
+ [0xA7D8]={
+ category="lu",
+ description="LATIN CAPITAL LETTER SIGMOID S",
+ direction="l",
+ lccode=0xA7D9,
+ linebreak="al",
+ unicodeslot=0xA7D8,
+ },
+ [0xA7D9]={
+ category="ll",
+ description="LATIN SMALL LETTER SIGMOID S",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0xA7D9,
+ },
+ [0xA7F2]={
+ category="lm",
+ description="MODIFIER LETTER CAPITAL C",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x43 },
+ unicodeslot=0xA7F2,
+ },
+ [0xA7F3]={
+ category="lm",
+ description="MODIFIER LETTER CAPITAL F",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x46 },
+ unicodeslot=0xA7F3,
+ },
+ [0xA7F4]={
+ category="lm",
+ description="MODIFIER LETTER CAPITAL Q",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x51 },
+ unicodeslot=0xA7F4,
+ },
[0xA7F5]={
category="lu",
description="LATIN CAPITAL LETTER REVERSED HALF H",
direction="l",
+ lccode=0xA7F6,
linebreak="al",
unicodeslot=0xA7F5,
},
@@ -123087,9 +124239,7 @@ characters.data={
indic="c",
linebreak="sa",
unicodeslot=0xAA60,
- variants={
- [0xFE00]="dotted form",
- },
+ variants=variants_dotted,
},
[0xAA61]={
category="lo",
@@ -123098,9 +124248,7 @@ characters.data={
indic="c",
linebreak="sa",
unicodeslot=0xAA61,
- variants={
- [0xFE00]="dotted form",
- },
+ variants=variants_dotted,
},
[0xAA62]={
category="lo",
@@ -123109,9 +124257,7 @@ characters.data={
indic="c",
linebreak="sa",
unicodeslot=0xAA62,
- variants={
- [0xFE00]="dotted form",
- },
+ variants=variants_dotted,
},
[0xAA63]={
category="lo",
@@ -123120,9 +124266,7 @@ characters.data={
indic="c",
linebreak="sa",
unicodeslot=0xAA63,
- variants={
- [0xFE00]="dotted form",
- },
+ variants=variants_dotted,
},
[0xAA64]={
category="lo",
@@ -123131,9 +124275,7 @@ characters.data={
indic="c",
linebreak="sa",
unicodeslot=0xAA64,
- variants={
- [0xFE00]="dotted form",
- },
+ variants=variants_dotted,
},
[0xAA65]={
category="lo",
@@ -123142,9 +124284,7 @@ characters.data={
indic="c",
linebreak="sa",
unicodeslot=0xAA65,
- variants={
- [0xFE00]="dotted form",
- },
+ variants=variants_dotted,
},
[0xAA66]={
category="lo",
@@ -123153,9 +124293,7 @@ characters.data={
indic="c",
linebreak="sa",
unicodeslot=0xAA66,
- variants={
- [0xFE00]="dotted form",
- },
+ variants=variants_dotted,
},
[0xAA67]={
category="lo",
@@ -123195,9 +124333,7 @@ characters.data={
direction="l",
linebreak="sa",
unicodeslot=0xAA6B,
- variants={
- [0xFE00]="dotted form",
- },
+ variants=variants_dotted,
},
[0xAA6C]={
category="lo",
@@ -123206,9 +124342,7 @@ characters.data={
indic="c",
linebreak="sa",
unicodeslot=0xAA6C,
- variants={
- [0xFE00]="dotted form",
- },
+ variants=variants_dotted,
},
[0xAA6D]={
category="lo",
@@ -123233,9 +124367,7 @@ characters.data={
indic="c",
linebreak="sa",
unicodeslot=0xAA6F,
- variants={
- [0xFE00]="dotted form",
- },
+ variants=variants_dotted,
},
[0xAA70]={
category="lm",
@@ -123324,9 +124456,7 @@ characters.data={
indic="c",
linebreak="sa",
unicodeslot=0xAA7A,
- variants={
- [0xFE00]="dotted form",
- },
+ variants=variants_dotted,
},
[0xAA7B]={
category="mc",
@@ -124706,6 +125836,7 @@ characters.data={
description="CHEROKEE SMALL LETTER A",
direction="l",
linebreak="al",
+ uccode=0x13A0,
unicodeslot=0xAB70,
},
[0xAB71]={
@@ -124713,6 +125844,7 @@ characters.data={
description="CHEROKEE SMALL LETTER E",
direction="l",
linebreak="al",
+ uccode=0x13A1,
unicodeslot=0xAB71,
},
[0xAB72]={
@@ -124720,6 +125852,7 @@ characters.data={
description="CHEROKEE SMALL LETTER I",
direction="l",
linebreak="al",
+ uccode=0x13A2,
unicodeslot=0xAB72,
},
[0xAB73]={
@@ -124727,6 +125860,7 @@ characters.data={
description="CHEROKEE SMALL LETTER O",
direction="l",
linebreak="al",
+ uccode=0x13A3,
unicodeslot=0xAB73,
},
[0xAB74]={
@@ -124734,6 +125868,7 @@ characters.data={
description="CHEROKEE SMALL LETTER U",
direction="l",
linebreak="al",
+ uccode=0x13A4,
unicodeslot=0xAB74,
},
[0xAB75]={
@@ -124741,6 +125876,7 @@ characters.data={
description="CHEROKEE SMALL LETTER V",
direction="l",
linebreak="al",
+ uccode=0x13A5,
unicodeslot=0xAB75,
},
[0xAB76]={
@@ -124748,6 +125884,7 @@ characters.data={
description="CHEROKEE SMALL LETTER GA",
direction="l",
linebreak="al",
+ uccode=0x13A6,
unicodeslot=0xAB76,
},
[0xAB77]={
@@ -124755,6 +125892,7 @@ characters.data={
description="CHEROKEE SMALL LETTER KA",
direction="l",
linebreak="al",
+ uccode=0x13A7,
unicodeslot=0xAB77,
},
[0xAB78]={
@@ -124762,6 +125900,7 @@ characters.data={
description="CHEROKEE SMALL LETTER GE",
direction="l",
linebreak="al",
+ uccode=0x13A8,
unicodeslot=0xAB78,
},
[0xAB79]={
@@ -124769,6 +125908,7 @@ characters.data={
description="CHEROKEE SMALL LETTER GI",
direction="l",
linebreak="al",
+ uccode=0x13A9,
unicodeslot=0xAB79,
},
[0xAB7A]={
@@ -124776,6 +125916,7 @@ characters.data={
description="CHEROKEE SMALL LETTER GO",
direction="l",
linebreak="al",
+ uccode=0x13AA,
unicodeslot=0xAB7A,
},
[0xAB7B]={
@@ -124783,6 +125924,7 @@ characters.data={
description="CHEROKEE SMALL LETTER GU",
direction="l",
linebreak="al",
+ uccode=0x13AB,
unicodeslot=0xAB7B,
},
[0xAB7C]={
@@ -124790,6 +125932,7 @@ characters.data={
description="CHEROKEE SMALL LETTER GV",
direction="l",
linebreak="al",
+ uccode=0x13AC,
unicodeslot=0xAB7C,
},
[0xAB7D]={
@@ -124797,6 +125940,7 @@ characters.data={
description="CHEROKEE SMALL LETTER HA",
direction="l",
linebreak="al",
+ uccode=0x13AD,
unicodeslot=0xAB7D,
},
[0xAB7E]={
@@ -124804,6 +125948,7 @@ characters.data={
description="CHEROKEE SMALL LETTER HE",
direction="l",
linebreak="al",
+ uccode=0x13AE,
unicodeslot=0xAB7E,
},
[0xAB7F]={
@@ -124811,6 +125956,7 @@ characters.data={
description="CHEROKEE SMALL LETTER HI",
direction="l",
linebreak="al",
+ uccode=0x13AF,
unicodeslot=0xAB7F,
},
[0xAB80]={
@@ -124818,6 +125964,7 @@ characters.data={
description="CHEROKEE SMALL LETTER HO",
direction="l",
linebreak="al",
+ uccode=0x13B0,
unicodeslot=0xAB80,
},
[0xAB81]={
@@ -124825,6 +125972,7 @@ characters.data={
description="CHEROKEE SMALL LETTER HU",
direction="l",
linebreak="al",
+ uccode=0x13B1,
unicodeslot=0xAB81,
},
[0xAB82]={
@@ -124832,6 +125980,7 @@ characters.data={
description="CHEROKEE SMALL LETTER HV",
direction="l",
linebreak="al",
+ uccode=0x13B2,
unicodeslot=0xAB82,
},
[0xAB83]={
@@ -124839,6 +125988,7 @@ characters.data={
description="CHEROKEE SMALL LETTER LA",
direction="l",
linebreak="al",
+ uccode=0x13B3,
unicodeslot=0xAB83,
},
[0xAB84]={
@@ -124846,6 +125996,7 @@ characters.data={
description="CHEROKEE SMALL LETTER LE",
direction="l",
linebreak="al",
+ uccode=0x13B4,
unicodeslot=0xAB84,
},
[0xAB85]={
@@ -124853,6 +126004,7 @@ characters.data={
description="CHEROKEE SMALL LETTER LI",
direction="l",
linebreak="al",
+ uccode=0x13B5,
unicodeslot=0xAB85,
},
[0xAB86]={
@@ -124860,6 +126012,7 @@ characters.data={
description="CHEROKEE SMALL LETTER LO",
direction="l",
linebreak="al",
+ uccode=0x13B6,
unicodeslot=0xAB86,
},
[0xAB87]={
@@ -124867,6 +126020,7 @@ characters.data={
description="CHEROKEE SMALL LETTER LU",
direction="l",
linebreak="al",
+ uccode=0x13B7,
unicodeslot=0xAB87,
},
[0xAB88]={
@@ -124874,6 +126028,7 @@ characters.data={
description="CHEROKEE SMALL LETTER LV",
direction="l",
linebreak="al",
+ uccode=0x13B8,
unicodeslot=0xAB88,
},
[0xAB89]={
@@ -124881,6 +126036,7 @@ characters.data={
description="CHEROKEE SMALL LETTER MA",
direction="l",
linebreak="al",
+ uccode=0x13B9,
unicodeslot=0xAB89,
},
[0xAB8A]={
@@ -124888,6 +126044,7 @@ characters.data={
description="CHEROKEE SMALL LETTER ME",
direction="l",
linebreak="al",
+ uccode=0x13BA,
unicodeslot=0xAB8A,
},
[0xAB8B]={
@@ -124895,6 +126052,7 @@ characters.data={
description="CHEROKEE SMALL LETTER MI",
direction="l",
linebreak="al",
+ uccode=0x13BB,
unicodeslot=0xAB8B,
},
[0xAB8C]={
@@ -124902,6 +126060,7 @@ characters.data={
description="CHEROKEE SMALL LETTER MO",
direction="l",
linebreak="al",
+ uccode=0x13BC,
unicodeslot=0xAB8C,
},
[0xAB8D]={
@@ -124909,6 +126068,7 @@ characters.data={
description="CHEROKEE SMALL LETTER MU",
direction="l",
linebreak="al",
+ uccode=0x13BD,
unicodeslot=0xAB8D,
},
[0xAB8E]={
@@ -124916,6 +126076,7 @@ characters.data={
description="CHEROKEE SMALL LETTER NA",
direction="l",
linebreak="al",
+ uccode=0x13BE,
unicodeslot=0xAB8E,
},
[0xAB8F]={
@@ -124923,6 +126084,7 @@ characters.data={
description="CHEROKEE SMALL LETTER HNA",
direction="l",
linebreak="al",
+ uccode=0x13BF,
unicodeslot=0xAB8F,
},
[0xAB90]={
@@ -124930,6 +126092,7 @@ characters.data={
description="CHEROKEE SMALL LETTER NAH",
direction="l",
linebreak="al",
+ uccode=0x13C0,
unicodeslot=0xAB90,
},
[0xAB91]={
@@ -124937,6 +126100,7 @@ characters.data={
description="CHEROKEE SMALL LETTER NE",
direction="l",
linebreak="al",
+ uccode=0x13C1,
unicodeslot=0xAB91,
},
[0xAB92]={
@@ -124944,6 +126108,7 @@ characters.data={
description="CHEROKEE SMALL LETTER NI",
direction="l",
linebreak="al",
+ uccode=0x13C2,
unicodeslot=0xAB92,
},
[0xAB93]={
@@ -124951,6 +126116,7 @@ characters.data={
description="CHEROKEE SMALL LETTER NO",
direction="l",
linebreak="al",
+ uccode=0x13C3,
unicodeslot=0xAB93,
},
[0xAB94]={
@@ -124958,6 +126124,7 @@ characters.data={
description="CHEROKEE SMALL LETTER NU",
direction="l",
linebreak="al",
+ uccode=0x13C4,
unicodeslot=0xAB94,
},
[0xAB95]={
@@ -124965,6 +126132,7 @@ characters.data={
description="CHEROKEE SMALL LETTER NV",
direction="l",
linebreak="al",
+ uccode=0x13C5,
unicodeslot=0xAB95,
},
[0xAB96]={
@@ -124972,6 +126140,7 @@ characters.data={
description="CHEROKEE SMALL LETTER QUA",
direction="l",
linebreak="al",
+ uccode=0x13C6,
unicodeslot=0xAB96,
},
[0xAB97]={
@@ -124979,6 +126148,7 @@ characters.data={
description="CHEROKEE SMALL LETTER QUE",
direction="l",
linebreak="al",
+ uccode=0x13C7,
unicodeslot=0xAB97,
},
[0xAB98]={
@@ -124986,6 +126156,7 @@ characters.data={
description="CHEROKEE SMALL LETTER QUI",
direction="l",
linebreak="al",
+ uccode=0x13C8,
unicodeslot=0xAB98,
},
[0xAB99]={
@@ -124993,6 +126164,7 @@ characters.data={
description="CHEROKEE SMALL LETTER QUO",
direction="l",
linebreak="al",
+ uccode=0x13C9,
unicodeslot=0xAB99,
},
[0xAB9A]={
@@ -125000,6 +126172,7 @@ characters.data={
description="CHEROKEE SMALL LETTER QUU",
direction="l",
linebreak="al",
+ uccode=0x13CA,
unicodeslot=0xAB9A,
},
[0xAB9B]={
@@ -125007,6 +126180,7 @@ characters.data={
description="CHEROKEE SMALL LETTER QUV",
direction="l",
linebreak="al",
+ uccode=0x13CB,
unicodeslot=0xAB9B,
},
[0xAB9C]={
@@ -125014,6 +126188,7 @@ characters.data={
description="CHEROKEE SMALL LETTER SA",
direction="l",
linebreak="al",
+ uccode=0x13CC,
unicodeslot=0xAB9C,
},
[0xAB9D]={
@@ -125021,6 +126196,7 @@ characters.data={
description="CHEROKEE SMALL LETTER S",
direction="l",
linebreak="al",
+ uccode=0x13CD,
unicodeslot=0xAB9D,
},
[0xAB9E]={
@@ -125028,6 +126204,7 @@ characters.data={
description="CHEROKEE SMALL LETTER SE",
direction="l",
linebreak="al",
+ uccode=0x13CE,
unicodeslot=0xAB9E,
},
[0xAB9F]={
@@ -125035,6 +126212,7 @@ characters.data={
description="CHEROKEE SMALL LETTER SI",
direction="l",
linebreak="al",
+ uccode=0x13CF,
unicodeslot=0xAB9F,
},
[0xABA0]={
@@ -125042,6 +126220,7 @@ characters.data={
description="CHEROKEE SMALL LETTER SO",
direction="l",
linebreak="al",
+ uccode=0x13D0,
unicodeslot=0xABA0,
},
[0xABA1]={
@@ -125049,6 +126228,7 @@ characters.data={
description="CHEROKEE SMALL LETTER SU",
direction="l",
linebreak="al",
+ uccode=0x13D1,
unicodeslot=0xABA1,
},
[0xABA2]={
@@ -125056,6 +126236,7 @@ characters.data={
description="CHEROKEE SMALL LETTER SV",
direction="l",
linebreak="al",
+ uccode=0x13D2,
unicodeslot=0xABA2,
},
[0xABA3]={
@@ -125063,6 +126244,7 @@ characters.data={
description="CHEROKEE SMALL LETTER DA",
direction="l",
linebreak="al",
+ uccode=0x13D3,
unicodeslot=0xABA3,
},
[0xABA4]={
@@ -125070,6 +126252,7 @@ characters.data={
description="CHEROKEE SMALL LETTER TA",
direction="l",
linebreak="al",
+ uccode=0x13D4,
unicodeslot=0xABA4,
},
[0xABA5]={
@@ -125077,6 +126260,7 @@ characters.data={
description="CHEROKEE SMALL LETTER DE",
direction="l",
linebreak="al",
+ uccode=0x13D5,
unicodeslot=0xABA5,
},
[0xABA6]={
@@ -125084,6 +126268,7 @@ characters.data={
description="CHEROKEE SMALL LETTER TE",
direction="l",
linebreak="al",
+ uccode=0x13D6,
unicodeslot=0xABA6,
},
[0xABA7]={
@@ -125091,6 +126276,7 @@ characters.data={
description="CHEROKEE SMALL LETTER DI",
direction="l",
linebreak="al",
+ uccode=0x13D7,
unicodeslot=0xABA7,
},
[0xABA8]={
@@ -125098,6 +126284,7 @@ characters.data={
description="CHEROKEE SMALL LETTER TI",
direction="l",
linebreak="al",
+ uccode=0x13D8,
unicodeslot=0xABA8,
},
[0xABA9]={
@@ -125105,6 +126292,7 @@ characters.data={
description="CHEROKEE SMALL LETTER DO",
direction="l",
linebreak="al",
+ uccode=0x13D9,
unicodeslot=0xABA9,
},
[0xABAA]={
@@ -125112,6 +126300,7 @@ characters.data={
description="CHEROKEE SMALL LETTER DU",
direction="l",
linebreak="al",
+ uccode=0x13DA,
unicodeslot=0xABAA,
},
[0xABAB]={
@@ -125119,6 +126308,7 @@ characters.data={
description="CHEROKEE SMALL LETTER DV",
direction="l",
linebreak="al",
+ uccode=0x13DB,
unicodeslot=0xABAB,
},
[0xABAC]={
@@ -125126,6 +126316,7 @@ characters.data={
description="CHEROKEE SMALL LETTER DLA",
direction="l",
linebreak="al",
+ uccode=0x13DC,
unicodeslot=0xABAC,
},
[0xABAD]={
@@ -125133,6 +126324,7 @@ characters.data={
description="CHEROKEE SMALL LETTER TLA",
direction="l",
linebreak="al",
+ uccode=0x13DD,
unicodeslot=0xABAD,
},
[0xABAE]={
@@ -125140,6 +126332,7 @@ characters.data={
description="CHEROKEE SMALL LETTER TLE",
direction="l",
linebreak="al",
+ uccode=0x13DE,
unicodeslot=0xABAE,
},
[0xABAF]={
@@ -125147,6 +126340,7 @@ characters.data={
description="CHEROKEE SMALL LETTER TLI",
direction="l",
linebreak="al",
+ uccode=0x13DF,
unicodeslot=0xABAF,
},
[0xABB0]={
@@ -125154,6 +126348,7 @@ characters.data={
description="CHEROKEE SMALL LETTER TLO",
direction="l",
linebreak="al",
+ uccode=0x13E0,
unicodeslot=0xABB0,
},
[0xABB1]={
@@ -125161,6 +126356,7 @@ characters.data={
description="CHEROKEE SMALL LETTER TLU",
direction="l",
linebreak="al",
+ uccode=0x13E1,
unicodeslot=0xABB1,
},
[0xABB2]={
@@ -125168,6 +126364,7 @@ characters.data={
description="CHEROKEE SMALL LETTER TLV",
direction="l",
linebreak="al",
+ uccode=0x13E2,
unicodeslot=0xABB2,
},
[0xABB3]={
@@ -125175,6 +126372,7 @@ characters.data={
description="CHEROKEE SMALL LETTER TSA",
direction="l",
linebreak="al",
+ uccode=0x13E3,
unicodeslot=0xABB3,
},
[0xABB4]={
@@ -125182,6 +126380,7 @@ characters.data={
description="CHEROKEE SMALL LETTER TSE",
direction="l",
linebreak="al",
+ uccode=0x13E4,
unicodeslot=0xABB4,
},
[0xABB5]={
@@ -125189,6 +126388,7 @@ characters.data={
description="CHEROKEE SMALL LETTER TSI",
direction="l",
linebreak="al",
+ uccode=0x13E5,
unicodeslot=0xABB5,
},
[0xABB6]={
@@ -125196,6 +126396,7 @@ characters.data={
description="CHEROKEE SMALL LETTER TSO",
direction="l",
linebreak="al",
+ uccode=0x13E6,
unicodeslot=0xABB6,
},
[0xABB7]={
@@ -125203,6 +126404,7 @@ characters.data={
description="CHEROKEE SMALL LETTER TSU",
direction="l",
linebreak="al",
+ uccode=0x13E7,
unicodeslot=0xABB7,
},
[0xABB8]={
@@ -125210,6 +126412,7 @@ characters.data={
description="CHEROKEE SMALL LETTER TSV",
direction="l",
linebreak="al",
+ uccode=0x13E8,
unicodeslot=0xABB8,
},
[0xABB9]={
@@ -125217,6 +126420,7 @@ characters.data={
description="CHEROKEE SMALL LETTER WA",
direction="l",
linebreak="al",
+ uccode=0x13E9,
unicodeslot=0xABB9,
},
[0xABBA]={
@@ -125224,6 +126428,7 @@ characters.data={
description="CHEROKEE SMALL LETTER WE",
direction="l",
linebreak="al",
+ uccode=0x13EA,
unicodeslot=0xABBA,
},
[0xABBB]={
@@ -125231,6 +126436,7 @@ characters.data={
description="CHEROKEE SMALL LETTER WI",
direction="l",
linebreak="al",
+ uccode=0x13EB,
unicodeslot=0xABBB,
},
[0xABBC]={
@@ -125238,6 +126444,7 @@ characters.data={
description="CHEROKEE SMALL LETTER WO",
direction="l",
linebreak="al",
+ uccode=0x13EC,
unicodeslot=0xABBC,
},
[0xABBD]={
@@ -125245,6 +126452,7 @@ characters.data={
description="CHEROKEE SMALL LETTER WU",
direction="l",
linebreak="al",
+ uccode=0x13ED,
unicodeslot=0xABBD,
},
[0xABBE]={
@@ -125252,6 +126460,7 @@ characters.data={
description="CHEROKEE SMALL LETTER WV",
direction="l",
linebreak="al",
+ uccode=0x13EE,
unicodeslot=0xABBE,
},
[0xABBF]={
@@ -125259,6 +126468,7 @@ characters.data={
description="CHEROKEE SMALL LETTER YA",
direction="l",
linebreak="al",
+ uccode=0x13EF,
unicodeslot=0xABBF,
},
[0xABC0]={
@@ -130459,6 +131669,7 @@ characters.data={
direction="l",
linebreak="al",
specials={ "compat", 0x66, 0x66 },
+ uccode={ 0x66, 0x66 },
unicodeslot=0xFB00,
},
[0xFB01]={
@@ -130470,6 +131681,7 @@ characters.data={
linebreak="al",
shcode={ 0x66, 0x69 },
specials={ "compat", 0x66, 0x69 },
+ uccode={ 0x66, 0x69 },
unicodeslot=0xFB01,
},
[0xFB02]={
@@ -130481,6 +131693,7 @@ characters.data={
linebreak="al",
shcode={ 0x66, 0x6C },
specials={ "compat", 0x66, 0x6C },
+ uccode={ 0x66, 0x6C },
unicodeslot=0xFB02,
},
[0xFB03]={
@@ -130492,6 +131705,7 @@ characters.data={
linebreak="al",
shcode={ 0x66, 0x69 },
specials={ "compat", 0x66, 0x66, 0x69 },
+ uccode={ 0x66, 0x66, 0x69 },
unicodeslot=0xFB03,
},
[0xFB04]={
@@ -130503,6 +131717,7 @@ characters.data={
linebreak="al",
shcode={ 0x66, 0x6C },
specials={ "compat", 0x66, 0x66, 0x6C },
+ uccode={ 0x66, 0x66, 0x6C },
unicodeslot=0xFB04,
},
[0xFB05]={
@@ -130511,6 +131726,7 @@ characters.data={
direction="l",
linebreak="al",
specials={ "compat", 0x17F, 0x74 },
+ uccode={ 0x73, 0x74 },
unicodeslot=0xFB05,
},
[0xFB06]={
@@ -130521,6 +131737,7 @@ characters.data={
linebreak="al",
shcode={ 0x73, 0x74 },
specials={ "compat", 0x73, 0x74 },
+ uccode={ 0x73, 0x74 },
unicodeslot=0xFB06,
},
[0xFB13]={
@@ -130529,6 +131746,7 @@ characters.data={
direction="l",
linebreak="al",
specials={ "compat", 0x574, 0x576 },
+ uccode={ 0x574, 0x576 },
unicodeslot=0xFB13,
},
[0xFB14]={
@@ -130537,6 +131755,7 @@ characters.data={
direction="l",
linebreak="al",
specials={ "compat", 0x574, 0x565 },
+ uccode={ 0x574, 0x565 },
unicodeslot=0xFB14,
},
[0xFB15]={
@@ -130545,6 +131764,7 @@ characters.data={
direction="l",
linebreak="al",
specials={ "compat", 0x574, 0x56B },
+ uccode={ 0x574, 0x56B },
unicodeslot=0xFB15,
},
[0xFB16]={
@@ -130553,6 +131773,7 @@ characters.data={
direction="l",
linebreak="al",
specials={ "compat", 0x57E, 0x576 },
+ uccode={ 0x57E, 0x576 },
unicodeslot=0xFB16,
},
[0xFB17]={
@@ -130561,6 +131782,7 @@ characters.data={
direction="l",
linebreak="al",
specials={ "compat", 0x574, 0x56D },
+ uccode={ 0x574, 0x56D },
unicodeslot=0xFB17,
},
[0xFB1D]={
@@ -131920,6 +133142,13 @@ characters.data={
linebreak="al",
unicodeslot=0xFBC1,
},
+ [0xFBC2]={
+ category="sk",
+ description="ARABIC SYMBOL WASLA ABOVE",
+ direction="al",
+ linebreak="al",
+ unicodeslot=0xFBC2,
+ },
[0xFBD3]={
category="lo",
description="ARABIC LETTER NG ISOLATED FORM",
@@ -134872,6 +136101,118 @@ characters.data={
linebreak="op",
unicodeslot=0xFD3F,
},
+ [0xFD40]={
+ category="so",
+ description="ARABIC LIGATURE RAHIMAHU ALLAAH",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0xFD40,
+ },
+ [0xFD41]={
+ category="so",
+ description="ARABIC LIGATURE RADI ALLAAHU ANH",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0xFD41,
+ },
+ [0xFD42]={
+ category="so",
+ description="ARABIC LIGATURE RADI ALLAAHU ANHAA",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0xFD42,
+ },
+ [0xFD43]={
+ category="so",
+ description="ARABIC LIGATURE RADI ALLAAHU ANHUM",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0xFD43,
+ },
+ [0xFD44]={
+ category="so",
+ description="ARABIC LIGATURE RADI ALLAAHU ANHUMAA",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0xFD44,
+ },
+ [0xFD45]={
+ category="so",
+ description="ARABIC LIGATURE RADI ALLAAHU ANHUNNA",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0xFD45,
+ },
+ [0xFD46]={
+ category="so",
+ description="ARABIC LIGATURE SALLALLAAHU ALAYHI WA-AALIH",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0xFD46,
+ },
+ [0xFD47]={
+ category="so",
+ description="ARABIC LIGATURE ALAYHI AS-SALAAM",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0xFD47,
+ },
+ [0xFD48]={
+ category="so",
+ description="ARABIC LIGATURE ALAYHIM AS-SALAAM",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0xFD48,
+ },
+ [0xFD49]={
+ category="so",
+ description="ARABIC LIGATURE ALAYHIMAA AS-SALAAM",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0xFD49,
+ },
+ [0xFD4A]={
+ category="so",
+ description="ARABIC LIGATURE ALAYHI AS-SALAATU WAS-SALAAM",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0xFD4A,
+ },
+ [0xFD4B]={
+ category="so",
+ description="ARABIC LIGATURE QUDDISA SIRRAH",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0xFD4B,
+ },
+ [0xFD4C]={
+ category="so",
+ description="ARABIC LIGATURE SALLALLAHU ALAYHI WAAALIHEE WA-SALLAM",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0xFD4C,
+ },
+ [0xFD4D]={
+ category="so",
+ description="ARABIC LIGATURE ALAYHAA AS-SALAAM",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0xFD4D,
+ },
+ [0xFD4E]={
+ category="so",
+ description="ARABIC LIGATURE TABAARAKA WA-TAAALAA",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0xFD4E,
+ },
+ [0xFD4F]={
+ category="so",
+ description="ARABIC LIGATURE RAHIMAHUM ALLAAH",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0xFD4F,
+ },
[0xFD50]={
category="lo",
description="ARABIC LIGATURE TEH WITH JEEM WITH MEEM INITIAL FORM",
@@ -135817,6 +137158,13 @@ characters.data={
specials={ "final", 0x646, 0x62C, 0x64A },
unicodeslot=0xFDC7,
},
+ [0xFDCF]={
+ category="so",
+ description="ARABIC LIGATURE SALAAMUHU ALAYNAA",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0xFDCF,
+ },
[0xFDF0]={
category="lo",
contextname="arabicsalla",
@@ -135945,6 +137293,20 @@ characters.data={
linebreak="al",
unicodeslot=0xFDFD,
},
+ [0xFDFE]={
+ category="so",
+ description="ARABIC LIGATURE SUBHAANAHU WA TAAALAA",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0xFDFE,
+ },
+ [0xFDFF]={
+ category="so",
+ description="ARABIC LIGATURE AZZA WA JALL",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0xFDFF,
+ },
[0xFE00]={
description="VARIATION SELECTOR-0x0001",
synonyms={ "vs1" },
@@ -136038,6 +137400,7 @@ characters.data={
description="PRESENTATION FORM FOR VERTICAL HORIZONTAL ELLIPSIS",
direction="on",
linebreak="in",
+ mathclass="ellipsis",
specials={ "vertical", 0x2026 },
unicodeslot=0xFE19,
},
@@ -146536,6 +147899,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER A",
direction="l",
+ lccode=0x104D8,
linebreak="al",
unicodeslot=0x104B0,
},
@@ -146543,6 +147907,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER AI",
direction="l",
+ lccode=0x104D9,
linebreak="al",
unicodeslot=0x104B1,
},
@@ -146550,6 +147915,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER AIN",
direction="l",
+ lccode=0x104DA,
linebreak="al",
unicodeslot=0x104B2,
},
@@ -146557,6 +147923,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER AH",
direction="l",
+ lccode=0x104DB,
linebreak="al",
unicodeslot=0x104B3,
},
@@ -146564,6 +147931,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER BRA",
direction="l",
+ lccode=0x104DC,
linebreak="al",
unicodeslot=0x104B4,
},
@@ -146571,6 +147939,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER CHA",
direction="l",
+ lccode=0x104DD,
linebreak="al",
unicodeslot=0x104B5,
},
@@ -146578,6 +147947,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER EHCHA",
direction="l",
+ lccode=0x104DE,
linebreak="al",
unicodeslot=0x104B6,
},
@@ -146585,6 +147955,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER E",
direction="l",
+ lccode=0x104DF,
linebreak="al",
unicodeslot=0x104B7,
},
@@ -146592,6 +147963,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER EIN",
direction="l",
+ lccode=0x104E0,
linebreak="al",
unicodeslot=0x104B8,
},
@@ -146599,6 +147971,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER HA",
direction="l",
+ lccode=0x104E1,
linebreak="al",
unicodeslot=0x104B9,
},
@@ -146606,6 +147979,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER HYA",
direction="l",
+ lccode=0x104E2,
linebreak="al",
unicodeslot=0x104BA,
},
@@ -146613,6 +147987,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER I",
direction="l",
+ lccode=0x104E3,
linebreak="al",
unicodeslot=0x104BB,
},
@@ -146620,6 +147995,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER KA",
direction="l",
+ lccode=0x104E4,
linebreak="al",
unicodeslot=0x104BC,
},
@@ -146627,6 +148003,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER EHKA",
direction="l",
+ lccode=0x104E5,
linebreak="al",
unicodeslot=0x104BD,
},
@@ -146634,6 +148011,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER KYA",
direction="l",
+ lccode=0x104E6,
linebreak="al",
unicodeslot=0x104BE,
},
@@ -146641,6 +148019,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER LA",
direction="l",
+ lccode=0x104E7,
linebreak="al",
unicodeslot=0x104BF,
},
@@ -146648,6 +148027,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER MA",
direction="l",
+ lccode=0x104E8,
linebreak="al",
unicodeslot=0x104C0,
},
@@ -146655,6 +148035,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER NA",
direction="l",
+ lccode=0x104E9,
linebreak="al",
unicodeslot=0x104C1,
},
@@ -146662,6 +148043,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER O",
direction="l",
+ lccode=0x104EA,
linebreak="al",
unicodeslot=0x104C2,
},
@@ -146669,6 +148051,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER OIN",
direction="l",
+ lccode=0x104EB,
linebreak="al",
unicodeslot=0x104C3,
},
@@ -146676,6 +148059,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER PA",
direction="l",
+ lccode=0x104EC,
linebreak="al",
unicodeslot=0x104C4,
},
@@ -146683,6 +148067,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER EHPA",
direction="l",
+ lccode=0x104ED,
linebreak="al",
unicodeslot=0x104C5,
},
@@ -146690,6 +148075,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER SA",
direction="l",
+ lccode=0x104EE,
linebreak="al",
unicodeslot=0x104C6,
},
@@ -146697,6 +148083,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER SHA",
direction="l",
+ lccode=0x104EF,
linebreak="al",
unicodeslot=0x104C7,
},
@@ -146704,6 +148091,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER TA",
direction="l",
+ lccode=0x104F0,
linebreak="al",
unicodeslot=0x104C8,
},
@@ -146711,6 +148099,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER EHTA",
direction="l",
+ lccode=0x104F1,
linebreak="al",
unicodeslot=0x104C9,
},
@@ -146718,6 +148107,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER TSA",
direction="l",
+ lccode=0x104F2,
linebreak="al",
unicodeslot=0x104CA,
},
@@ -146725,6 +148115,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER EHTSA",
direction="l",
+ lccode=0x104F3,
linebreak="al",
unicodeslot=0x104CB,
},
@@ -146732,6 +148123,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER TSHA",
direction="l",
+ lccode=0x104F4,
linebreak="al",
unicodeslot=0x104CC,
},
@@ -146739,6 +148131,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER DHA",
direction="l",
+ lccode=0x104F5,
linebreak="al",
unicodeslot=0x104CD,
},
@@ -146746,6 +148139,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER U",
direction="l",
+ lccode=0x104F6,
linebreak="al",
unicodeslot=0x104CE,
},
@@ -146753,6 +148147,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER WA",
direction="l",
+ lccode=0x104F7,
linebreak="al",
unicodeslot=0x104CF,
},
@@ -146760,6 +148155,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER KHA",
direction="l",
+ lccode=0x104F8,
linebreak="al",
unicodeslot=0x104D0,
},
@@ -146767,6 +148163,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER GHA",
direction="l",
+ lccode=0x104F9,
linebreak="al",
unicodeslot=0x104D1,
},
@@ -146774,6 +148171,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER ZA",
direction="l",
+ lccode=0x104FA,
linebreak="al",
unicodeslot=0x104D2,
},
@@ -146781,6 +148179,7 @@ characters.data={
category="lu",
description="OSAGE CAPITAL LETTER ZHA",
direction="l",
+ lccode=0x104FB,
linebreak="al",
unicodeslot=0x104D3,
},
@@ -147687,6 +149086,531 @@ characters.data={
linebreak="al",
unicodeslot=0x1056F,
},
+ [0x10570]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER A",
+ direction="l",
+ lccode=0x10597,
+ linebreak="al",
+ unicodeslot=0x10570,
+ },
+ [0x10571]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER BBE",
+ direction="l",
+ lccode=0x10598,
+ linebreak="al",
+ unicodeslot=0x10571,
+ },
+ [0x10572]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER BE",
+ direction="l",
+ lccode=0x10599,
+ linebreak="al",
+ unicodeslot=0x10572,
+ },
+ [0x10573]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER CE",
+ direction="l",
+ lccode=0x1059A,
+ linebreak="al",
+ unicodeslot=0x10573,
+ },
+ [0x10574]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER CHE",
+ direction="l",
+ lccode=0x1059B,
+ linebreak="al",
+ unicodeslot=0x10574,
+ },
+ [0x10575]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER DE",
+ direction="l",
+ lccode=0x1059C,
+ linebreak="al",
+ unicodeslot=0x10575,
+ },
+ [0x10576]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER DHE",
+ direction="l",
+ lccode=0x1059D,
+ linebreak="al",
+ unicodeslot=0x10576,
+ },
+ [0x10577]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER EI",
+ direction="l",
+ lccode=0x1059E,
+ linebreak="al",
+ unicodeslot=0x10577,
+ },
+ [0x10578]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER E",
+ direction="l",
+ lccode=0x1059F,
+ linebreak="al",
+ unicodeslot=0x10578,
+ },
+ [0x10579]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER FE",
+ direction="l",
+ lccode=0x105A0,
+ linebreak="al",
+ unicodeslot=0x10579,
+ },
+ [0x1057A]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER GA",
+ direction="l",
+ lccode=0x105A1,
+ linebreak="al",
+ unicodeslot=0x1057A,
+ },
+ [0x1057C]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER HA",
+ direction="l",
+ lccode=0x105A3,
+ linebreak="al",
+ unicodeslot=0x1057C,
+ },
+ [0x1057D]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER HHA",
+ direction="l",
+ lccode=0x105A4,
+ linebreak="al",
+ unicodeslot=0x1057D,
+ },
+ [0x1057E]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER I",
+ direction="l",
+ lccode=0x105A5,
+ linebreak="al",
+ unicodeslot=0x1057E,
+ },
+ [0x1057F]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER IJE",
+ direction="l",
+ lccode=0x105A6,
+ linebreak="al",
+ unicodeslot=0x1057F,
+ },
+ [0x10580]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER JE",
+ direction="l",
+ lccode=0x105A7,
+ linebreak="al",
+ unicodeslot=0x10580,
+ },
+ [0x10581]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER KA",
+ direction="l",
+ lccode=0x105A8,
+ linebreak="al",
+ unicodeslot=0x10581,
+ },
+ [0x10582]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER LA",
+ direction="l",
+ lccode=0x105A9,
+ linebreak="al",
+ unicodeslot=0x10582,
+ },
+ [0x10583]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER LLA",
+ direction="l",
+ lccode=0x105AA,
+ linebreak="al",
+ unicodeslot=0x10583,
+ },
+ [0x10584]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER ME",
+ direction="l",
+ lccode=0x105AB,
+ linebreak="al",
+ unicodeslot=0x10584,
+ },
+ [0x10585]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER NE",
+ direction="l",
+ lccode=0x105AC,
+ linebreak="al",
+ unicodeslot=0x10585,
+ },
+ [0x10586]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER NJE",
+ direction="l",
+ lccode=0x105AD,
+ linebreak="al",
+ unicodeslot=0x10586,
+ },
+ [0x10587]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER O",
+ direction="l",
+ lccode=0x105AE,
+ linebreak="al",
+ unicodeslot=0x10587,
+ },
+ [0x10588]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER PE",
+ direction="l",
+ lccode=0x105AF,
+ linebreak="al",
+ unicodeslot=0x10588,
+ },
+ [0x10589]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER QA",
+ direction="l",
+ lccode=0x105B0,
+ linebreak="al",
+ unicodeslot=0x10589,
+ },
+ [0x1058A]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER RE",
+ direction="l",
+ lccode=0x105B1,
+ linebreak="al",
+ unicodeslot=0x1058A,
+ },
+ [0x1058C]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER SE",
+ direction="l",
+ lccode=0x105B3,
+ linebreak="al",
+ unicodeslot=0x1058C,
+ },
+ [0x1058D]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER SHE",
+ direction="l",
+ lccode=0x105B4,
+ linebreak="al",
+ unicodeslot=0x1058D,
+ },
+ [0x1058E]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER TE",
+ direction="l",
+ lccode=0x105B5,
+ linebreak="al",
+ unicodeslot=0x1058E,
+ },
+ [0x1058F]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER THE",
+ direction="l",
+ lccode=0x105B6,
+ linebreak="al",
+ unicodeslot=0x1058F,
+ },
+ [0x10590]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER U",
+ direction="l",
+ lccode=0x105B7,
+ linebreak="al",
+ unicodeslot=0x10590,
+ },
+ [0x10591]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER VE",
+ direction="l",
+ lccode=0x105B8,
+ linebreak="al",
+ unicodeslot=0x10591,
+ },
+ [0x10592]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER XE",
+ direction="l",
+ lccode=0x105B9,
+ linebreak="al",
+ unicodeslot=0x10592,
+ },
+ [0x10594]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER Y",
+ direction="l",
+ lccode=0x105BB,
+ linebreak="al",
+ unicodeslot=0x10594,
+ },
+ [0x10595]={
+ category="lu",
+ description="VITHKUQI CAPITAL LETTER ZE",
+ direction="l",
+ lccode=0x105BC,
+ linebreak="al",
+ unicodeslot=0x10595,
+ },
+ [0x10597]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER A",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x10597,
+ },
+ [0x10598]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER BBE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x10598,
+ },
+ [0x10599]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER BE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x10599,
+ },
+ [0x1059A]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER CE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1059A,
+ },
+ [0x1059B]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER CHE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1059B,
+ },
+ [0x1059C]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER DE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1059C,
+ },
+ [0x1059D]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER DHE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1059D,
+ },
+ [0x1059E]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER EI",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1059E,
+ },
+ [0x1059F]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER E",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1059F,
+ },
+ [0x105A0]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER FE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x105A0,
+ },
+ [0x105A1]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER GA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x105A1,
+ },
+ [0x105A3]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER HA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x105A3,
+ },
+ [0x105A4]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER HHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x105A4,
+ },
+ [0x105A5]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER I",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x105A5,
+ },
+ [0x105A6]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER IJE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x105A6,
+ },
+ [0x105A7]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER JE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x105A7,
+ },
+ [0x105A8]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER KA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x105A8,
+ },
+ [0x105A9]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER LA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x105A9,
+ },
+ [0x105AA]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER LLA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x105AA,
+ },
+ [0x105AB]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER ME",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x105AB,
+ },
+ [0x105AC]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER NE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x105AC,
+ },
+ [0x105AD]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER NJE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x105AD,
+ },
+ [0x105AE]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER O",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x105AE,
+ },
+ [0x105AF]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER PE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x105AF,
+ },
+ [0x105B0]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER QA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x105B0,
+ },
+ [0x105B1]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER RE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x105B1,
+ },
+ [0x105B3]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER SE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x105B3,
+ },
+ [0x105B4]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER SHE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x105B4,
+ },
+ [0x105B5]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER TE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x105B5,
+ },
+ [0x105B6]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER THE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x105B6,
+ },
+ [0x105B7]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER U",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x105B7,
+ },
+ [0x105B8]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER VE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x105B8,
+ },
+ [0x105B9]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER XE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x105B9,
+ },
+ [0x105BB]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER Y",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x105BB,
+ },
+ [0x105BC]={
+ category="ll",
+ description="VITHKUQI SMALL LETTER ZE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x105BC,
+ },
[0x10600]={
category="lo",
description="LINEAR A SIGN AB001",
@@ -150074,6 +151998,461 @@ characters.data={
linebreak="al",
unicodeslot=0x10767,
},
+ [0x10780]={
+ category="lm",
+ description="MODIFIER LETTER SMALL CAPITAL AA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x10780,
+ },
+ [0x10781]={
+ category="lm",
+ description="MODIFIER LETTER SUPERSCRIPT TRIANGULAR COLON",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x2D0 },
+ unicodeslot=0x10781,
+ },
+ [0x10782]={
+ category="lm",
+ description="MODIFIER LETTER SUPERSCRIPT HALF TRIANGULAR COLON",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x2D1 },
+ unicodeslot=0x10782,
+ },
+ [0x10783]={
+ category="lm",
+ description="MODIFIER LETTER SMALL AE",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0xE6 },
+ unicodeslot=0x10783,
+ },
+ [0x10784]={
+ category="lm",
+ description="MODIFIER LETTER SMALL CAPITAL B",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x299 },
+ unicodeslot=0x10784,
+ },
+ [0x10785]={
+ category="lm",
+ description="MODIFIER LETTER SMALL B WITH HOOK",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x253 },
+ unicodeslot=0x10785,
+ },
+ [0x10787]={
+ category="lm",
+ description="MODIFIER LETTER SMALL DZ DIGRAPH",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x2A3 },
+ unicodeslot=0x10787,
+ },
+ [0x10788]={
+ category="lm",
+ description="MODIFIER LETTER SMALL DZ DIGRAPH WITH RETROFLEX HOOK",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0xAB66 },
+ unicodeslot=0x10788,
+ },
+ [0x10789]={
+ category="lm",
+ description="MODIFIER LETTER SMALL DZ DIGRAPH WITH CURL",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x2A5 },
+ unicodeslot=0x10789,
+ },
+ [0x1078A]={
+ category="lm",
+ description="MODIFIER LETTER SMALL DEZH DIGRAPH",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x2A4 },
+ unicodeslot=0x1078A,
+ },
+ [0x1078B]={
+ category="lm",
+ description="MODIFIER LETTER SMALL D WITH TAIL",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x256 },
+ unicodeslot=0x1078B,
+ },
+ [0x1078C]={
+ category="lm",
+ description="MODIFIER LETTER SMALL D WITH HOOK",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x257 },
+ unicodeslot=0x1078C,
+ },
+ [0x1078D]={
+ category="lm",
+ description="MODIFIER LETTER SMALL D WITH HOOK AND TAIL",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x1D91 },
+ unicodeslot=0x1078D,
+ },
+ [0x1078E]={
+ category="lm",
+ description="MODIFIER LETTER SMALL REVERSED E",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x258 },
+ unicodeslot=0x1078E,
+ },
+ [0x1078F]={
+ category="lm",
+ description="MODIFIER LETTER SMALL CLOSED REVERSED OPEN E",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x25E },
+ unicodeslot=0x1078F,
+ },
+ [0x10790]={
+ category="lm",
+ description="MODIFIER LETTER SMALL FENG DIGRAPH",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x2A9 },
+ unicodeslot=0x10790,
+ },
+ [0x10791]={
+ category="lm",
+ description="MODIFIER LETTER SMALL RAMS HORN",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x264 },
+ unicodeslot=0x10791,
+ },
+ [0x10792]={
+ category="lm",
+ description="MODIFIER LETTER SMALL CAPITAL G",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x262 },
+ unicodeslot=0x10792,
+ },
+ [0x10793]={
+ category="lm",
+ description="MODIFIER LETTER SMALL G WITH HOOK",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x260 },
+ unicodeslot=0x10793,
+ },
+ [0x10794]={
+ category="lm",
+ description="MODIFIER LETTER SMALL CAPITAL G WITH HOOK",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x29B },
+ unicodeslot=0x10794,
+ },
+ [0x10795]={
+ category="lm",
+ description="MODIFIER LETTER SMALL H WITH STROKE",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x127 },
+ unicodeslot=0x10795,
+ },
+ [0x10796]={
+ category="lm",
+ description="MODIFIER LETTER SMALL CAPITAL H",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x29C },
+ unicodeslot=0x10796,
+ },
+ [0x10797]={
+ category="lm",
+ description="MODIFIER LETTER SMALL HENG WITH HOOK",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x267 },
+ unicodeslot=0x10797,
+ },
+ [0x10798]={
+ category="lm",
+ description="MODIFIER LETTER SMALL DOTLESS J WITH STROKE AND HOOK",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x284 },
+ unicodeslot=0x10798,
+ },
+ [0x10799]={
+ category="lm",
+ description="MODIFIER LETTER SMALL LS DIGRAPH",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x2AA },
+ unicodeslot=0x10799,
+ },
+ [0x1079A]={
+ category="lm",
+ description="MODIFIER LETTER SMALL LZ DIGRAPH",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x2AB },
+ unicodeslot=0x1079A,
+ },
+ [0x1079B]={
+ category="lm",
+ description="MODIFIER LETTER SMALL L WITH BELT",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x26C },
+ unicodeslot=0x1079B,
+ },
+ [0x1079C]={
+ category="lm",
+ description="MODIFIER LETTER SMALL CAPITAL L WITH BELT",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x1DF04 },
+ unicodeslot=0x1079C,
+ },
+ [0x1079D]={
+ category="lm",
+ description="MODIFIER LETTER SMALL L WITH RETROFLEX HOOK AND BELT",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0xA78E },
+ unicodeslot=0x1079D,
+ },
+ [0x1079E]={
+ category="lm",
+ description="MODIFIER LETTER SMALL LEZH",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x26E },
+ unicodeslot=0x1079E,
+ },
+ [0x1079F]={
+ category="lm",
+ description="MODIFIER LETTER SMALL LEZH WITH RETROFLEX HOOK",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x1DF05 },
+ unicodeslot=0x1079F,
+ },
+ [0x107A0]={
+ category="lm",
+ description="MODIFIER LETTER SMALL TURNED Y",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x28E },
+ unicodeslot=0x107A0,
+ },
+ [0x107A1]={
+ category="lm",
+ description="MODIFIER LETTER SMALL TURNED Y WITH BELT",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x1DF06 },
+ unicodeslot=0x107A1,
+ },
+ [0x107A2]={
+ category="lm",
+ description="MODIFIER LETTER SMALL O WITH STROKE",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0xF8 },
+ unicodeslot=0x107A2,
+ },
+ [0x107A3]={
+ category="lm",
+ description="MODIFIER LETTER SMALL CAPITAL OE",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x276 },
+ unicodeslot=0x107A3,
+ },
+ [0x107A4]={
+ category="lm",
+ description="MODIFIER LETTER SMALL CLOSED OMEGA",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x277 },
+ unicodeslot=0x107A4,
+ },
+ [0x107A5]={
+ category="lm",
+ description="MODIFIER LETTER SMALL Q",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x71 },
+ unicodeslot=0x107A5,
+ },
+ [0x107A6]={
+ category="lm",
+ description="MODIFIER LETTER SMALL TURNED R WITH LONG LEG",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x27A },
+ unicodeslot=0x107A6,
+ },
+ [0x107A7]={
+ category="lm",
+ description="MODIFIER LETTER SMALL TURNED R WITH LONG LEG AND RETROFLEX HOOK",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x1DF08 },
+ unicodeslot=0x107A7,
+ },
+ [0x107A8]={
+ category="lm",
+ description="MODIFIER LETTER SMALL R WITH TAIL",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x27D },
+ unicodeslot=0x107A8,
+ },
+ [0x107A9]={
+ category="lm",
+ description="MODIFIER LETTER SMALL R WITH FISHHOOK",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x27E },
+ unicodeslot=0x107A9,
+ },
+ [0x107AA]={
+ category="lm",
+ description="MODIFIER LETTER SMALL CAPITAL R",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x280 },
+ unicodeslot=0x107AA,
+ },
+ [0x107AB]={
+ category="lm",
+ description="MODIFIER LETTER SMALL TC DIGRAPH WITH CURL",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x2A8 },
+ unicodeslot=0x107AB,
+ },
+ [0x107AC]={
+ category="lm",
+ description="MODIFIER LETTER SMALL TS DIGRAPH",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x2A6 },
+ unicodeslot=0x107AC,
+ },
+ [0x107AD]={
+ category="lm",
+ description="MODIFIER LETTER SMALL TS DIGRAPH WITH RETROFLEX HOOK",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0xAB67 },
+ unicodeslot=0x107AD,
+ },
+ [0x107AE]={
+ category="lm",
+ description="MODIFIER LETTER SMALL TESH DIGRAPH",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x2A7 },
+ unicodeslot=0x107AE,
+ },
+ [0x107AF]={
+ category="lm",
+ description="MODIFIER LETTER SMALL T WITH RETROFLEX HOOK",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x288 },
+ unicodeslot=0x107AF,
+ },
+ [0x107B0]={
+ category="lm",
+ description="MODIFIER LETTER SMALL V WITH RIGHT HOOK",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x2C71 },
+ unicodeslot=0x107B0,
+ },
+ [0x107B2]={
+ category="lm",
+ description="MODIFIER LETTER SMALL CAPITAL Y",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x28F },
+ unicodeslot=0x107B2,
+ },
+ [0x107B3]={
+ category="lm",
+ description="MODIFIER LETTER GLOTTAL STOP WITH STROKE",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x2A1 },
+ unicodeslot=0x107B3,
+ },
+ [0x107B4]={
+ category="lm",
+ description="MODIFIER LETTER REVERSED GLOTTAL STOP WITH STROKE",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x2A2 },
+ unicodeslot=0x107B4,
+ },
+ [0x107B5]={
+ category="lm",
+ description="MODIFIER LETTER BILABIAL CLICK",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x298 },
+ unicodeslot=0x107B5,
+ },
+ [0x107B6]={
+ category="lm",
+ description="MODIFIER LETTER DENTAL CLICK",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x1C0 },
+ unicodeslot=0x107B6,
+ },
+ [0x107B7]={
+ category="lm",
+ description="MODIFIER LETTER LATERAL CLICK",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x1C1 },
+ unicodeslot=0x107B7,
+ },
+ [0x107B8]={
+ category="lm",
+ description="MODIFIER LETTER ALVEOLAR CLICK",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x1C2 },
+ unicodeslot=0x107B8,
+ },
+ [0x107B9]={
+ category="lm",
+ description="MODIFIER LETTER RETROFLEX CLICK WITH RETROFLEX HOOK",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x1DF0A },
+ unicodeslot=0x107B9,
+ },
+ [0x107BA]={
+ category="lm",
+ description="MODIFIER LETTER SMALL S WITH CURL",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x1DF1E },
+ unicodeslot=0x107BA,
+ },
[0x10800]={
category="lo",
description="CYPRIOT SYLLABLE A",
@@ -155523,6 +157902,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER A",
direction="r",
+ lccode=0x10CC0,
linebreak="al",
unicodeslot=0x10C80,
},
@@ -155530,6 +157910,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER AA",
direction="r",
+ lccode=0x10CC1,
linebreak="al",
unicodeslot=0x10C81,
},
@@ -155537,6 +157918,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER EB",
direction="r",
+ lccode=0x10CC2,
linebreak="al",
unicodeslot=0x10C82,
},
@@ -155544,6 +157926,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER AMB",
direction="r",
+ lccode=0x10CC3,
linebreak="al",
unicodeslot=0x10C83,
},
@@ -155551,6 +157934,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER EC",
direction="r",
+ lccode=0x10CC4,
linebreak="al",
unicodeslot=0x10C84,
},
@@ -155558,6 +157942,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER ENC",
direction="r",
+ lccode=0x10CC5,
linebreak="al",
unicodeslot=0x10C85,
},
@@ -155565,6 +157950,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER ECS",
direction="r",
+ lccode=0x10CC6,
linebreak="al",
unicodeslot=0x10C86,
},
@@ -155572,6 +157958,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER ED",
direction="r",
+ lccode=0x10CC7,
linebreak="al",
unicodeslot=0x10C87,
},
@@ -155579,6 +157966,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER AND",
direction="r",
+ lccode=0x10CC8,
linebreak="al",
unicodeslot=0x10C88,
},
@@ -155586,6 +157974,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER E",
direction="r",
+ lccode=0x10CC9,
linebreak="al",
unicodeslot=0x10C89,
},
@@ -155593,6 +157982,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER CLOSE E",
direction="r",
+ lccode=0x10CCA,
linebreak="al",
unicodeslot=0x10C8A,
},
@@ -155600,6 +157990,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER EE",
direction="r",
+ lccode=0x10CCB,
linebreak="al",
unicodeslot=0x10C8B,
},
@@ -155607,6 +157998,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER EF",
direction="r",
+ lccode=0x10CCC,
linebreak="al",
unicodeslot=0x10C8C,
},
@@ -155614,6 +158006,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER EG",
direction="r",
+ lccode=0x10CCD,
linebreak="al",
unicodeslot=0x10C8D,
},
@@ -155621,6 +158014,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER EGY",
direction="r",
+ lccode=0x10CCE,
linebreak="al",
unicodeslot=0x10C8E,
},
@@ -155628,6 +158022,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER EH",
direction="r",
+ lccode=0x10CCF,
linebreak="al",
unicodeslot=0x10C8F,
},
@@ -155635,6 +158030,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER I",
direction="r",
+ lccode=0x10CD0,
linebreak="al",
unicodeslot=0x10C90,
},
@@ -155642,6 +158038,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER II",
direction="r",
+ lccode=0x10CD1,
linebreak="al",
unicodeslot=0x10C91,
},
@@ -155649,6 +158046,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER EJ",
direction="r",
+ lccode=0x10CD2,
linebreak="al",
unicodeslot=0x10C92,
},
@@ -155656,6 +158054,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER EK",
direction="r",
+ lccode=0x10CD3,
linebreak="al",
unicodeslot=0x10C93,
},
@@ -155663,6 +158062,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER AK",
direction="r",
+ lccode=0x10CD4,
linebreak="al",
unicodeslot=0x10C94,
},
@@ -155670,6 +158070,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER UNK",
direction="r",
+ lccode=0x10CD5,
linebreak="al",
unicodeslot=0x10C95,
},
@@ -155677,6 +158078,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER EL",
direction="r",
+ lccode=0x10CD6,
linebreak="al",
unicodeslot=0x10C96,
},
@@ -155684,6 +158086,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER ELY",
direction="r",
+ lccode=0x10CD7,
linebreak="al",
unicodeslot=0x10C97,
},
@@ -155691,6 +158094,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER EM",
direction="r",
+ lccode=0x10CD8,
linebreak="al",
unicodeslot=0x10C98,
},
@@ -155698,6 +158102,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER EN",
direction="r",
+ lccode=0x10CD9,
linebreak="al",
unicodeslot=0x10C99,
},
@@ -155705,6 +158110,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER ENY",
direction="r",
+ lccode=0x10CDA,
linebreak="al",
unicodeslot=0x10C9A,
},
@@ -155712,6 +158118,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER O",
direction="r",
+ lccode=0x10CDB,
linebreak="al",
unicodeslot=0x10C9B,
},
@@ -155719,6 +158126,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER OO",
direction="r",
+ lccode=0x10CDC,
linebreak="al",
unicodeslot=0x10C9C,
},
@@ -155726,6 +158134,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER NIKOLSBURG OE",
direction="r",
+ lccode=0x10CDD,
linebreak="al",
unicodeslot=0x10C9D,
},
@@ -155733,6 +158142,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER RUDIMENTA OE",
direction="r",
+ lccode=0x10CDE,
linebreak="al",
unicodeslot=0x10C9E,
},
@@ -155740,6 +158150,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER OEE",
direction="r",
+ lccode=0x10CDF,
linebreak="al",
unicodeslot=0x10C9F,
},
@@ -155747,6 +158158,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER EP",
direction="r",
+ lccode=0x10CE0,
linebreak="al",
unicodeslot=0x10CA0,
},
@@ -155754,6 +158166,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER EMP",
direction="r",
+ lccode=0x10CE1,
linebreak="al",
unicodeslot=0x10CA1,
},
@@ -155761,6 +158174,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER ER",
direction="r",
+ lccode=0x10CE2,
linebreak="al",
unicodeslot=0x10CA2,
},
@@ -155768,6 +158182,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER SHORT ER",
direction="r",
+ lccode=0x10CE3,
linebreak="al",
unicodeslot=0x10CA3,
},
@@ -155775,6 +158190,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER ES",
direction="r",
+ lccode=0x10CE4,
linebreak="al",
unicodeslot=0x10CA4,
},
@@ -155782,6 +158198,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER ESZ",
direction="r",
+ lccode=0x10CE5,
linebreak="al",
unicodeslot=0x10CA5,
},
@@ -155789,6 +158206,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER ET",
direction="r",
+ lccode=0x10CE6,
linebreak="al",
unicodeslot=0x10CA6,
},
@@ -155796,6 +158214,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER ENT",
direction="r",
+ lccode=0x10CE7,
linebreak="al",
unicodeslot=0x10CA7,
},
@@ -155803,6 +158222,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER ETY",
direction="r",
+ lccode=0x10CE8,
linebreak="al",
unicodeslot=0x10CA8,
},
@@ -155810,6 +158230,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER ECH",
direction="r",
+ lccode=0x10CE9,
linebreak="al",
unicodeslot=0x10CA9,
},
@@ -155817,6 +158238,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER U",
direction="r",
+ lccode=0x10CEA,
linebreak="al",
unicodeslot=0x10CAA,
},
@@ -155824,6 +158246,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER UU",
direction="r",
+ lccode=0x10CEB,
linebreak="al",
unicodeslot=0x10CAB,
},
@@ -155831,6 +158254,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER NIKOLSBURG UE",
direction="r",
+ lccode=0x10CEC,
linebreak="al",
unicodeslot=0x10CAC,
},
@@ -155838,6 +158262,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER RUDIMENTA UE",
direction="r",
+ lccode=0x10CED,
linebreak="al",
unicodeslot=0x10CAD,
},
@@ -155845,6 +158270,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER EV",
direction="r",
+ lccode=0x10CEE,
linebreak="al",
unicodeslot=0x10CAE,
},
@@ -155852,6 +158278,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER EZ",
direction="r",
+ lccode=0x10CEF,
linebreak="al",
unicodeslot=0x10CAF,
},
@@ -155859,6 +158286,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER EZS",
direction="r",
+ lccode=0x10CF0,
linebreak="al",
unicodeslot=0x10CB0,
},
@@ -155866,6 +158294,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER ENT-SHAPED SIGN",
direction="r",
+ lccode=0x10CF1,
linebreak="al",
unicodeslot=0x10CB1,
},
@@ -155873,6 +158302,7 @@ characters.data={
category="lu",
description="OLD HUNGARIAN CAPITAL LETTER US",
direction="r",
+ lccode=0x10CF2,
linebreak="al",
unicodeslot=0x10CB2,
},
@@ -157213,6 +159643,30 @@ characters.data={
linebreak="al",
unicodeslot=0x10EB1,
},
+ [0x10EFD]={
+ category="mn",
+ combining=0xDC,
+ description="ARABIC SMALL LOW WORD SAKTA",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x10EFD,
+ },
+ [0x10EFE]={
+ category="mn",
+ combining=0xDC,
+ description="ARABIC SMALL LOW WORD QASR",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x10EFE,
+ },
+ [0x10EFF]={
+ category="mn",
+ combining=0xDC,
+ description="ARABIC SMALL LOW WORD MADDA",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x10EFF,
+ },
[0x10F00]={
category="lo",
description="OLD SOGDIAN LETTER ALEPH",
@@ -157824,6 +160278,210 @@ characters.data={
linebreak="al",
unicodeslot=0x10F59,
},
+ [0x10F70]={
+ arabic="d",
+ category="lo",
+ description="OLD UYGHUR LETTER ALEPH",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10F70,
+ },
+ [0x10F71]={
+ arabic="d",
+ category="lo",
+ description="OLD UYGHUR LETTER BETH",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10F71,
+ },
+ [0x10F72]={
+ arabic="d",
+ category="lo",
+ description="OLD UYGHUR LETTER GIMEL-HETH",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10F72,
+ },
+ [0x10F73]={
+ arabic="d",
+ category="lo",
+ description="OLD UYGHUR LETTER WAW",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10F73,
+ },
+ [0x10F74]={
+ arabic="r",
+ category="lo",
+ description="OLD UYGHUR LETTER ZAYIN",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10F74,
+ },
+ [0x10F75]={
+ arabic="r",
+ category="lo",
+ description="OLD UYGHUR LETTER FINAL HETH",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10F75,
+ },
+ [0x10F76]={
+ arabic="d",
+ category="lo",
+ description="OLD UYGHUR LETTER YODH",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10F76,
+ },
+ [0x10F77]={
+ arabic="d",
+ category="lo",
+ description="OLD UYGHUR LETTER KAPH",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10F77,
+ },
+ [0x10F78]={
+ arabic="d",
+ category="lo",
+ description="OLD UYGHUR LETTER LAMEDH",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10F78,
+ },
+ [0x10F79]={
+ arabic="d",
+ category="lo",
+ description="OLD UYGHUR LETTER MEM",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10F79,
+ },
+ [0x10F7A]={
+ arabic="d",
+ category="lo",
+ description="OLD UYGHUR LETTER NUN",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10F7A,
+ },
+ [0x10F7B]={
+ arabic="d",
+ category="lo",
+ description="OLD UYGHUR LETTER SAMEKH",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10F7B,
+ },
+ [0x10F7C]={
+ arabic="d",
+ category="lo",
+ description="OLD UYGHUR LETTER PE",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10F7C,
+ },
+ [0x10F7D]={
+ arabic="d",
+ category="lo",
+ description="OLD UYGHUR LETTER SADHE",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10F7D,
+ },
+ [0x10F7E]={
+ arabic="d",
+ category="lo",
+ description="OLD UYGHUR LETTER RESH",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10F7E,
+ },
+ [0x10F7F]={
+ arabic="d",
+ category="lo",
+ description="OLD UYGHUR LETTER SHIN",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10F7F,
+ },
+ [0x10F80]={
+ arabic="d",
+ category="lo",
+ description="OLD UYGHUR LETTER TAW",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10F80,
+ },
+ [0x10F81]={
+ arabic="d",
+ category="lo",
+ description="OLD UYGHUR LETTER LESH",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10F81,
+ },
+ [0x10F82]={
+ category="mn",
+ combining=0xE6,
+ description="OLD UYGHUR COMBINING DOT ABOVE",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x10F82,
+ },
+ [0x10F83]={
+ category="mn",
+ combining=0xDC,
+ description="OLD UYGHUR COMBINING DOT BELOW",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x10F83,
+ },
+ [0x10F84]={
+ category="mn",
+ combining=0xE6,
+ description="OLD UYGHUR COMBINING TWO DOTS ABOVE",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x10F84,
+ },
+ [0x10F85]={
+ category="mn",
+ combining=0xDC,
+ description="OLD UYGHUR COMBINING TWO DOTS BELOW",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x10F85,
+ },
+ [0x10F86]={
+ category="po",
+ description="OLD UYGHUR PUNCTUATION BAR",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10F86,
+ },
+ [0x10F87]={
+ category="po",
+ description="OLD UYGHUR PUNCTUATION TWO BARS",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10F87,
+ },
+ [0x10F88]={
+ category="po",
+ description="OLD UYGHUR PUNCTUATION TWO DOTS",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10F88,
+ },
+ [0x10F89]={
+ category="po",
+ description="OLD UYGHUR PUNCTUATION FOUR DOTS",
+ direction="r",
+ linebreak="al",
+ unicodeslot=0x10F89,
+ },
[0x10FB0]={
arabic="d",
category="lo",
@@ -158966,6 +161624,49 @@ characters.data={
linebreak="nu",
unicodeslot=0x1106F,
},
+ [0x11070]={
+ category="mn",
+ combining=0x9,
+ description="BRAHMI SIGN OLD TAMIL VIRAMA",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x11070,
+ },
+ [0x11071]={
+ category="lo",
+ description="BRAHMI LETTER OLD TAMIL SHORT E",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11071,
+ },
+ [0x11072]={
+ category="lo",
+ description="BRAHMI LETTER OLD TAMIL SHORT O",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11072,
+ },
+ [0x11073]={
+ category="mn",
+ description="BRAHMI VOWEL SIGN OLD TAMIL SHORT E",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x11073,
+ },
+ [0x11074]={
+ category="mn",
+ description="BRAHMI VOWEL SIGN OLD TAMIL SHORT O",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x11074,
+ },
+ [0x11075]={
+ category="lo",
+ description="BRAHMI LETTER OLD TAMIL LLA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11075,
+ },
[0x1107F]={
category="mn",
combining=0x9,
@@ -159442,6 +162143,13 @@ characters.data={
linebreak="ba",
unicodeslot=0x110C1,
},
+ [0x110C2]={
+ category="mn",
+ description="KAITHI VOWEL SIGN VOCALIC R",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x110C2,
+ },
[0x110CD]={
arabic="u",
category="cf",
@@ -161723,6 +164431,27 @@ characters.data={
linebreak="cm",
unicodeslot=0x1123E,
},
+ [0x1123F]={
+ category="lo",
+ description="KHOJKI LETTER QA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1123F,
+ },
+ [0x11240]={
+ category="lo",
+ description="KHOJKI LETTER SHORT I",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11240,
+ },
+ [0x11241]={
+ category="mn",
+ description="KHOJKI VOWEL SIGN VOCALIC R",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x11241,
+ },
[0x11280]={
category="lo",
description="MULTANI LETTER A",
@@ -166061,6 +168790,13 @@ characters.data={
linebreak="al",
unicodeslot=0x116B8,
},
+ [0x116B9]={
+ category="po",
+ description="TAKRI ABBREVIATION SIGN",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x116B9,
+ },
[0x116C0]={
category="nd",
description="TAKRI DIGIT ZERO",
@@ -166538,6 +169274,55 @@ characters.data={
linebreak="sa",
unicodeslot=0x1173F,
},
+ [0x11740]={
+ category="lo",
+ description="AHOM LETTER CA",
+ direction="l",
+ linebreak="sa",
+ unicodeslot=0x11740,
+ },
+ [0x11741]={
+ category="lo",
+ description="AHOM LETTER TTA",
+ direction="l",
+ linebreak="sa",
+ unicodeslot=0x11741,
+ },
+ [0x11742]={
+ category="lo",
+ description="AHOM LETTER TTHA",
+ direction="l",
+ linebreak="sa",
+ unicodeslot=0x11742,
+ },
+ [0x11743]={
+ category="lo",
+ description="AHOM LETTER DDA",
+ direction="l",
+ linebreak="sa",
+ unicodeslot=0x11743,
+ },
+ [0x11744]={
+ category="lo",
+ description="AHOM LETTER DDHA",
+ direction="l",
+ linebreak="sa",
+ unicodeslot=0x11744,
+ },
+ [0x11745]={
+ category="lo",
+ description="AHOM LETTER NNA",
+ direction="l",
+ linebreak="sa",
+ unicodeslot=0x11745,
+ },
+ [0x11746]={
+ category="lo",
+ description="AHOM LETTER LLA",
+ direction="l",
+ linebreak="sa",
+ unicodeslot=0x11746,
+ },
[0x11800]={
category="lo",
description="DOGRA LETTER A",
@@ -166964,6 +169749,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER NGAA",
direction="l",
+ lccode=0x118C0,
linebreak="al",
unicodeslot=0x118A0,
},
@@ -166971,6 +169757,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER A",
direction="l",
+ lccode=0x118C1,
linebreak="al",
unicodeslot=0x118A1,
},
@@ -166978,6 +169765,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER WI",
direction="l",
+ lccode=0x118C2,
linebreak="al",
unicodeslot=0x118A2,
},
@@ -166985,6 +169773,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER YU",
direction="l",
+ lccode=0x118C3,
linebreak="al",
unicodeslot=0x118A3,
},
@@ -166992,6 +169781,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER YA",
direction="l",
+ lccode=0x118C4,
linebreak="al",
unicodeslot=0x118A4,
},
@@ -166999,6 +169789,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER YO",
direction="l",
+ lccode=0x118C5,
linebreak="al",
unicodeslot=0x118A5,
},
@@ -167006,6 +169797,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER II",
direction="l",
+ lccode=0x118C6,
linebreak="al",
unicodeslot=0x118A6,
},
@@ -167013,6 +169805,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER UU",
direction="l",
+ lccode=0x118C7,
linebreak="al",
unicodeslot=0x118A7,
},
@@ -167020,6 +169813,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER E",
direction="l",
+ lccode=0x118C8,
linebreak="al",
unicodeslot=0x118A8,
},
@@ -167027,6 +169821,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER O",
direction="l",
+ lccode=0x118C9,
linebreak="al",
unicodeslot=0x118A9,
},
@@ -167034,6 +169829,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER ANG",
direction="l",
+ lccode=0x118CA,
linebreak="al",
unicodeslot=0x118AA,
},
@@ -167041,6 +169837,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER GA",
direction="l",
+ lccode=0x118CB,
linebreak="al",
unicodeslot=0x118AB,
},
@@ -167048,6 +169845,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER KO",
direction="l",
+ lccode=0x118CC,
linebreak="al",
unicodeslot=0x118AC,
},
@@ -167055,6 +169853,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER ENY",
direction="l",
+ lccode=0x118CD,
linebreak="al",
unicodeslot=0x118AD,
},
@@ -167062,6 +169861,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER YUJ",
direction="l",
+ lccode=0x118CE,
linebreak="al",
unicodeslot=0x118AE,
},
@@ -167069,6 +169869,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER UC",
direction="l",
+ lccode=0x118CF,
linebreak="al",
unicodeslot=0x118AF,
},
@@ -167076,6 +169877,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER ENN",
direction="l",
+ lccode=0x118D0,
linebreak="al",
unicodeslot=0x118B0,
},
@@ -167083,6 +169885,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER ODD",
direction="l",
+ lccode=0x118D1,
linebreak="al",
unicodeslot=0x118B1,
},
@@ -167090,6 +169893,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER TTE",
direction="l",
+ lccode=0x118D2,
linebreak="al",
unicodeslot=0x118B2,
},
@@ -167097,6 +169901,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER NUNG",
direction="l",
+ lccode=0x118D3,
linebreak="al",
unicodeslot=0x118B3,
},
@@ -167104,6 +169909,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER DA",
direction="l",
+ lccode=0x118D4,
linebreak="al",
unicodeslot=0x118B4,
},
@@ -167111,6 +169917,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER AT",
direction="l",
+ lccode=0x118D5,
linebreak="al",
unicodeslot=0x118B5,
},
@@ -167118,6 +169925,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER AM",
direction="l",
+ lccode=0x118D6,
linebreak="al",
unicodeslot=0x118B6,
},
@@ -167125,6 +169933,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER BU",
direction="l",
+ lccode=0x118D7,
linebreak="al",
unicodeslot=0x118B7,
},
@@ -167132,6 +169941,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER PU",
direction="l",
+ lccode=0x118D8,
linebreak="al",
unicodeslot=0x118B8,
},
@@ -167139,6 +169949,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER HIYO",
direction="l",
+ lccode=0x118D9,
linebreak="al",
unicodeslot=0x118B9,
},
@@ -167146,6 +169957,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER HOLO",
direction="l",
+ lccode=0x118DA,
linebreak="al",
unicodeslot=0x118BA,
},
@@ -167153,6 +169965,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER HORR",
direction="l",
+ lccode=0x118DB,
linebreak="al",
unicodeslot=0x118BB,
},
@@ -167160,6 +169973,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER HAR",
direction="l",
+ lccode=0x118DC,
linebreak="al",
unicodeslot=0x118BC,
},
@@ -167167,6 +169981,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER SSUU",
direction="l",
+ lccode=0x118DD,
linebreak="al",
unicodeslot=0x118BD,
},
@@ -167174,6 +169989,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER SII",
direction="l",
+ lccode=0x118DE,
linebreak="al",
unicodeslot=0x118BE,
},
@@ -167181,6 +169997,7 @@ characters.data={
category="lu",
description="WARANG CITI CAPITAL LETTER VIYO",
direction="l",
+ lccode=0x118DF,
linebreak="al",
unicodeslot=0x118BF,
},
@@ -169600,6 +172417,118 @@ characters.data={
linebreak="ba",
unicodeslot=0x11AA2,
},
+ [0x11AB0]={
+ category="lo",
+ description="CANADIAN SYLLABICS NATTILIK HI",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11AB0,
+ },
+ [0x11AB1]={
+ category="lo",
+ description="CANADIAN SYLLABICS NATTILIK HII",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11AB1,
+ },
+ [0x11AB2]={
+ category="lo",
+ description="CANADIAN SYLLABICS NATTILIK HO",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11AB2,
+ },
+ [0x11AB3]={
+ category="lo",
+ description="CANADIAN SYLLABICS NATTILIK HOO",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11AB3,
+ },
+ [0x11AB4]={
+ category="lo",
+ description="CANADIAN SYLLABICS NATTILIK HA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11AB4,
+ },
+ [0x11AB5]={
+ category="lo",
+ description="CANADIAN SYLLABICS NATTILIK HAA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11AB5,
+ },
+ [0x11AB6]={
+ category="lo",
+ description="CANADIAN SYLLABICS NATTILIK SHRI",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11AB6,
+ },
+ [0x11AB7]={
+ category="lo",
+ description="CANADIAN SYLLABICS NATTILIK SHRII",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11AB7,
+ },
+ [0x11AB8]={
+ category="lo",
+ description="CANADIAN SYLLABICS NATTILIK SHRO",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11AB8,
+ },
+ [0x11AB9]={
+ category="lo",
+ description="CANADIAN SYLLABICS NATTILIK SHROO",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11AB9,
+ },
+ [0x11ABA]={
+ category="lo",
+ description="CANADIAN SYLLABICS NATTILIK SHRA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11ABA,
+ },
+ [0x11ABB]={
+ category="lo",
+ description="CANADIAN SYLLABICS NATTILIK SHRAA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11ABB,
+ },
+ [0x11ABC]={
+ category="lo",
+ description="CANADIAN SYLLABICS SPE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11ABC,
+ },
+ [0x11ABD]={
+ category="lo",
+ description="CANADIAN SYLLABICS SPI",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11ABD,
+ },
+ [0x11ABE]={
+ category="lo",
+ description="CANADIAN SYLLABICS SPO",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11ABE,
+ },
+ [0x11ABF]={
+ category="lo",
+ description="CANADIAN SYLLABICS SPA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11ABF,
+ },
[0x11AC0]={
category="lo",
description="PAU CIN HAU LETTER PA",
@@ -169999,6 +172928,76 @@ characters.data={
linebreak="al",
unicodeslot=0x11AF8,
},
+ [0x11B00]={
+ category="po",
+ description="DEVANAGARI HEAD MARK",
+ direction="l",
+ linebreak="bb",
+ unicodeslot=0x11B00,
+ },
+ [0x11B01]={
+ category="po",
+ description="DEVANAGARI HEAD MARK WITH HEADSTROKE",
+ direction="l",
+ linebreak="bb",
+ unicodeslot=0x11B01,
+ },
+ [0x11B02]={
+ category="po",
+ description="DEVANAGARI SIGN BHALE",
+ direction="l",
+ linebreak="bb",
+ unicodeslot=0x11B02,
+ },
+ [0x11B03]={
+ category="po",
+ description="DEVANAGARI SIGN BHALE WITH HOOK",
+ direction="l",
+ linebreak="bb",
+ unicodeslot=0x11B03,
+ },
+ [0x11B04]={
+ category="po",
+ description="DEVANAGARI SIGN EXTENDED BHALE",
+ direction="l",
+ linebreak="bb",
+ unicodeslot=0x11B04,
+ },
+ [0x11B05]={
+ category="po",
+ description="DEVANAGARI SIGN EXTENDED BHALE WITH HOOK",
+ direction="l",
+ linebreak="bb",
+ unicodeslot=0x11B05,
+ },
+ [0x11B06]={
+ category="po",
+ description="DEVANAGARI SIGN WESTERN FIVE-LIKE BHALE",
+ direction="l",
+ linebreak="bb",
+ unicodeslot=0x11B06,
+ },
+ [0x11B07]={
+ category="po",
+ description="DEVANAGARI SIGN WESTERN NINE-LIKE BHALE",
+ direction="l",
+ linebreak="bb",
+ unicodeslot=0x11B07,
+ },
+ [0x11B08]={
+ category="po",
+ description="DEVANAGARI SIGN REVERSED NINE-LIKE BHALE",
+ direction="l",
+ linebreak="bb",
+ unicodeslot=0x11B08,
+ },
+ [0x11B09]={
+ category="po",
+ description="DEVANAGARI SIGN MINDU",
+ direction="l",
+ linebreak="bb",
+ unicodeslot=0x11B09,
+ },
[0x11C00]={
category="lo",
description="BHAIKSUKI LETTER A",
@@ -172300,6 +175299,610 @@ characters.data={
linebreak="al",
unicodeslot=0x11EF8,
},
+ [0x11F00]={
+ category="mn",
+ description="KAWI SIGN CANDRABINDU",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x11F00,
+ },
+ [0x11F01]={
+ category="mn",
+ description="KAWI SIGN ANUSVARA",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x11F01,
+ },
+ [0x11F02]={
+ category="lo",
+ description="KAWI SIGN REPHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F02,
+ },
+ [0x11F03]={
+ category="mc",
+ description="KAWI SIGN VISARGA",
+ direction="l",
+ linebreak="cm",
+ unicodeslot=0x11F03,
+ },
+ [0x11F04]={
+ category="lo",
+ description="KAWI LETTER A",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F04,
+ },
+ [0x11F05]={
+ category="lo",
+ description="KAWI LETTER AA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F05,
+ },
+ [0x11F06]={
+ category="lo",
+ description="KAWI LETTER I",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F06,
+ },
+ [0x11F07]={
+ category="lo",
+ description="KAWI LETTER II",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F07,
+ },
+ [0x11F08]={
+ category="lo",
+ description="KAWI LETTER U",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F08,
+ },
+ [0x11F09]={
+ category="lo",
+ description="KAWI LETTER UU",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F09,
+ },
+ [0x11F0A]={
+ category="lo",
+ description="KAWI LETTER VOCALIC R",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F0A,
+ },
+ [0x11F0B]={
+ category="lo",
+ description="KAWI LETTER VOCALIC RR",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F0B,
+ },
+ [0x11F0C]={
+ category="lo",
+ description="KAWI LETTER VOCALIC L",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F0C,
+ },
+ [0x11F0D]={
+ category="lo",
+ description="KAWI LETTER VOCALIC LL",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F0D,
+ },
+ [0x11F0E]={
+ category="lo",
+ description="KAWI LETTER E",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F0E,
+ },
+ [0x11F0F]={
+ category="lo",
+ description="KAWI LETTER AI",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F0F,
+ },
+ [0x11F10]={
+ category="lo",
+ description="KAWI LETTER O",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F10,
+ },
+ [0x11F12]={
+ category="lo",
+ description="KAWI LETTER KA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F12,
+ },
+ [0x11F13]={
+ category="lo",
+ description="KAWI LETTER KHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F13,
+ },
+ [0x11F14]={
+ category="lo",
+ description="KAWI LETTER GA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F14,
+ },
+ [0x11F15]={
+ category="lo",
+ description="KAWI LETTER GHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F15,
+ },
+ [0x11F16]={
+ category="lo",
+ description="KAWI LETTER NGA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F16,
+ },
+ [0x11F17]={
+ category="lo",
+ description="KAWI LETTER CA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F17,
+ },
+ [0x11F18]={
+ category="lo",
+ description="KAWI LETTER CHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F18,
+ },
+ [0x11F19]={
+ category="lo",
+ description="KAWI LETTER JA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F19,
+ },
+ [0x11F1A]={
+ category="lo",
+ description="KAWI LETTER JHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F1A,
+ },
+ [0x11F1B]={
+ category="lo",
+ description="KAWI LETTER NYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F1B,
+ },
+ [0x11F1C]={
+ category="lo",
+ description="KAWI LETTER TTA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F1C,
+ },
+ [0x11F1D]={
+ category="lo",
+ description="KAWI LETTER TTHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F1D,
+ },
+ [0x11F1E]={
+ category="lo",
+ description="KAWI LETTER DDA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F1E,
+ },
+ [0x11F1F]={
+ category="lo",
+ description="KAWI LETTER DDHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F1F,
+ },
+ [0x11F20]={
+ category="lo",
+ description="KAWI LETTER NNA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F20,
+ },
+ [0x11F21]={
+ category="lo",
+ description="KAWI LETTER TA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F21,
+ },
+ [0x11F22]={
+ category="lo",
+ description="KAWI LETTER THA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F22,
+ },
+ [0x11F23]={
+ category="lo",
+ description="KAWI LETTER DA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F23,
+ },
+ [0x11F24]={
+ category="lo",
+ description="KAWI LETTER DHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F24,
+ },
+ [0x11F25]={
+ category="lo",
+ description="KAWI LETTER NA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F25,
+ },
+ [0x11F26]={
+ category="lo",
+ description="KAWI LETTER PA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F26,
+ },
+ [0x11F27]={
+ category="lo",
+ description="KAWI LETTER PHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F27,
+ },
+ [0x11F28]={
+ category="lo",
+ description="KAWI LETTER BA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F28,
+ },
+ [0x11F29]={
+ category="lo",
+ description="KAWI LETTER BHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F29,
+ },
+ [0x11F2A]={
+ category="lo",
+ description="KAWI LETTER MA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F2A,
+ },
+ [0x11F2B]={
+ category="lo",
+ description="KAWI LETTER YA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F2B,
+ },
+ [0x11F2C]={
+ category="lo",
+ description="KAWI LETTER RA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F2C,
+ },
+ [0x11F2D]={
+ category="lo",
+ description="KAWI LETTER LA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F2D,
+ },
+ [0x11F2E]={
+ category="lo",
+ description="KAWI LETTER WA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F2E,
+ },
+ [0x11F2F]={
+ category="lo",
+ description="KAWI LETTER SHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F2F,
+ },
+ [0x11F30]={
+ category="lo",
+ description="KAWI LETTER SSA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F30,
+ },
+ [0x11F31]={
+ category="lo",
+ description="KAWI LETTER SA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F31,
+ },
+ [0x11F32]={
+ category="lo",
+ description="KAWI LETTER HA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F32,
+ },
+ [0x11F33]={
+ category="lo",
+ description="KAWI LETTER JNYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x11F33,
+ },
+ [0x11F34]={
+ category="mc",
+ description="KAWI VOWEL SIGN AA",
+ direction="l",
+ linebreak="cm",
+ unicodeslot=0x11F34,
+ },
+ [0x11F35]={
+ category="mc",
+ description="KAWI VOWEL SIGN ALTERNATE AA",
+ direction="l",
+ linebreak="cm",
+ unicodeslot=0x11F35,
+ },
+ [0x11F36]={
+ category="mn",
+ description="KAWI VOWEL SIGN I",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x11F36,
+ },
+ [0x11F37]={
+ category="mn",
+ description="KAWI VOWEL SIGN II",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x11F37,
+ },
+ [0x11F38]={
+ category="mn",
+ description="KAWI VOWEL SIGN U",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x11F38,
+ },
+ [0x11F39]={
+ category="mn",
+ description="KAWI VOWEL SIGN UU",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x11F39,
+ },
+ [0x11F3A]={
+ category="mn",
+ description="KAWI VOWEL SIGN VOCALIC R",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x11F3A,
+ },
+ [0x11F3E]={
+ category="mc",
+ description="KAWI VOWEL SIGN E",
+ direction="l",
+ linebreak="cm",
+ unicodeslot=0x11F3E,
+ },
+ [0x11F3F]={
+ category="mc",
+ description="KAWI VOWEL SIGN AI",
+ direction="l",
+ linebreak="cm",
+ unicodeslot=0x11F3F,
+ },
+ [0x11F40]={
+ category="mn",
+ description="KAWI VOWEL SIGN EU",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x11F40,
+ },
+ [0x11F41]={
+ category="mc",
+ combining=0x9,
+ description="KAWI SIGN KILLER",
+ direction="l",
+ linebreak="cm",
+ unicodeslot=0x11F41,
+ },
+ [0x11F42]={
+ category="mn",
+ combining=0x9,
+ description="KAWI CONJOINER",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x11F42,
+ },
+ [0x11F43]={
+ category="po",
+ description="KAWI DANDA",
+ direction="l",
+ linebreak="ba",
+ unicodeslot=0x11F43,
+ },
+ [0x11F44]={
+ category="po",
+ description="KAWI DOUBLE DANDA",
+ direction="l",
+ linebreak="ba",
+ unicodeslot=0x11F44,
+ },
+ [0x11F45]={
+ category="po",
+ description="KAWI PUNCTUATION SECTION MARKER",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x11F45,
+ },
+ [0x11F46]={
+ category="po",
+ description="KAWI PUNCTUATION ALTERNATE SECTION MARKER",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x11F46,
+ },
+ [0x11F47]={
+ category="po",
+ description="KAWI PUNCTUATION FLOWER",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x11F47,
+ },
+ [0x11F48]={
+ category="po",
+ description="KAWI PUNCTUATION SPACE FILLER",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x11F48,
+ },
+ [0x11F49]={
+ category="po",
+ description="KAWI PUNCTUATION DOT",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x11F49,
+ },
+ [0x11F4A]={
+ category="po",
+ description="KAWI PUNCTUATION DOUBLE DOT",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x11F4A,
+ },
+ [0x11F4B]={
+ category="po",
+ description="KAWI PUNCTUATION TRIPLE DOT",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x11F4B,
+ },
+ [0x11F4C]={
+ category="po",
+ description="KAWI PUNCTUATION CIRCLE",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x11F4C,
+ },
+ [0x11F4D]={
+ category="po",
+ description="KAWI PUNCTUATION FILLED CIRCLE",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x11F4D,
+ },
+ [0x11F4E]={
+ category="po",
+ description="KAWI PUNCTUATION SPIRAL",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x11F4E,
+ },
+ [0x11F4F]={
+ category="po",
+ description="KAWI PUNCTUATION CLOSING SPIRAL",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x11F4F,
+ },
+ [0x11F50]={
+ category="nd",
+ description="KAWI DIGIT ZERO",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x11F50,
+ },
+ [0x11F51]={
+ category="nd",
+ description="KAWI DIGIT ONE",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x11F51,
+ },
+ [0x11F52]={
+ category="nd",
+ description="KAWI DIGIT TWO",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x11F52,
+ },
+ [0x11F53]={
+ category="nd",
+ description="KAWI DIGIT THREE",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x11F53,
+ },
+ [0x11F54]={
+ category="nd",
+ description="KAWI DIGIT FOUR",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x11F54,
+ },
+ [0x11F55]={
+ category="nd",
+ description="KAWI DIGIT FIVE",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x11F55,
+ },
+ [0x11F56]={
+ category="nd",
+ description="KAWI DIGIT SIX",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x11F56,
+ },
+ [0x11F57]={
+ category="nd",
+ description="KAWI DIGIT SEVEN",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x11F57,
+ },
+ [0x11F58]={
+ category="nd",
+ description="KAWI DIGIT EIGHT",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x11F58,
+ },
+ [0x11F59]={
+ category="nd",
+ description="KAWI DIGIT NINE",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x11F59,
+ },
[0x11FB0]={
category="lo",
description="LISU LETTER YHA",
@@ -181304,6 +184907,699 @@ characters.data={
linebreak="al",
unicodeslot=0x12543,
},
+ [0x12F90]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM001",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12F90,
+ },
+ [0x12F91]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM002",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12F91,
+ },
+ [0x12F92]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM004",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12F92,
+ },
+ [0x12F93]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM005",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12F93,
+ },
+ [0x12F94]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM006",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12F94,
+ },
+ [0x12F95]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM007",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12F95,
+ },
+ [0x12F96]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM008",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12F96,
+ },
+ [0x12F97]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM009",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12F97,
+ },
+ [0x12F98]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM010",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12F98,
+ },
+ [0x12F99]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM011",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12F99,
+ },
+ [0x12F9A]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM012",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12F9A,
+ },
+ [0x12F9B]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM012B",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12F9B,
+ },
+ [0x12F9C]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM013",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12F9C,
+ },
+ [0x12F9D]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM015",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12F9D,
+ },
+ [0x12F9E]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM017",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12F9E,
+ },
+ [0x12F9F]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM019",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12F9F,
+ },
+ [0x12FA0]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM021",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FA0,
+ },
+ [0x12FA1]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM023",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FA1,
+ },
+ [0x12FA2]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM024",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FA2,
+ },
+ [0x12FA3]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM025",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FA3,
+ },
+ [0x12FA4]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM026",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FA4,
+ },
+ [0x12FA5]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM027",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FA5,
+ },
+ [0x12FA6]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM028",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FA6,
+ },
+ [0x12FA7]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM029",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FA7,
+ },
+ [0x12FA8]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM030",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FA8,
+ },
+ [0x12FA9]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM033",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FA9,
+ },
+ [0x12FAA]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM034",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FAA,
+ },
+ [0x12FAB]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM035",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FAB,
+ },
+ [0x12FAC]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM036",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FAC,
+ },
+ [0x12FAD]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM037",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FAD,
+ },
+ [0x12FAE]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM038",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FAE,
+ },
+ [0x12FAF]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM039",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FAF,
+ },
+ [0x12FB0]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM040",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FB0,
+ },
+ [0x12FB1]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM041",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FB1,
+ },
+ [0x12FB2]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM044",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FB2,
+ },
+ [0x12FB3]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM046",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FB3,
+ },
+ [0x12FB4]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM047",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FB4,
+ },
+ [0x12FB5]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM049",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FB5,
+ },
+ [0x12FB6]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM050",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FB6,
+ },
+ [0x12FB7]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM051",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FB7,
+ },
+ [0x12FB8]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM052",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FB8,
+ },
+ [0x12FB9]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM053",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FB9,
+ },
+ [0x12FBA]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM054",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FBA,
+ },
+ [0x12FBB]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM055",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FBB,
+ },
+ [0x12FBC]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM056",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FBC,
+ },
+ [0x12FBD]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM058",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FBD,
+ },
+ [0x12FBE]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM059",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FBE,
+ },
+ [0x12FBF]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM060",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FBF,
+ },
+ [0x12FC0]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM061",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FC0,
+ },
+ [0x12FC1]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM062",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FC1,
+ },
+ [0x12FC2]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM063",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FC2,
+ },
+ [0x12FC3]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM064",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FC3,
+ },
+ [0x12FC4]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM066",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FC4,
+ },
+ [0x12FC5]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM067",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FC5,
+ },
+ [0x12FC6]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM068",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FC6,
+ },
+ [0x12FC7]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM069",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FC7,
+ },
+ [0x12FC8]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM070",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FC8,
+ },
+ [0x12FC9]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM071",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FC9,
+ },
+ [0x12FCA]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM072",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FCA,
+ },
+ [0x12FCB]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM073",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FCB,
+ },
+ [0x12FCC]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM074",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FCC,
+ },
+ [0x12FCD]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM075",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FCD,
+ },
+ [0x12FCE]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM075B",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FCE,
+ },
+ [0x12FCF]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM076",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FCF,
+ },
+ [0x12FD0]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM078",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FD0,
+ },
+ [0x12FD1]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM079",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FD1,
+ },
+ [0x12FD2]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM080",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FD2,
+ },
+ [0x12FD3]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM081",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FD3,
+ },
+ [0x12FD4]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM082",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FD4,
+ },
+ [0x12FD5]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM083",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FD5,
+ },
+ [0x12FD6]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM084",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FD6,
+ },
+ [0x12FD7]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM085",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FD7,
+ },
+ [0x12FD8]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM086",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FD8,
+ },
+ [0x12FD9]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM087",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FD9,
+ },
+ [0x12FDA]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM088",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FDA,
+ },
+ [0x12FDB]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM089",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FDB,
+ },
+ [0x12FDC]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM090",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FDC,
+ },
+ [0x12FDD]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM091",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FDD,
+ },
+ [0x12FDE]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM092",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FDE,
+ },
+ [0x12FDF]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM094",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FDF,
+ },
+ [0x12FE0]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM095",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FE0,
+ },
+ [0x12FE1]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM096",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FE1,
+ },
+ [0x12FE2]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM097",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FE2,
+ },
+ [0x12FE3]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM098",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FE3,
+ },
+ [0x12FE4]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM099",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FE4,
+ },
+ [0x12FE5]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM100",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FE5,
+ },
+ [0x12FE6]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM101",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FE6,
+ },
+ [0x12FE7]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM102",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FE7,
+ },
+ [0x12FE8]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM103",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FE8,
+ },
+ [0x12FE9]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM104",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FE9,
+ },
+ [0x12FEA]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM105",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FEA,
+ },
+ [0x12FEB]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM107",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FEB,
+ },
+ [0x12FEC]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM108",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FEC,
+ },
+ [0x12FED]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM109",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FED,
+ },
+ [0x12FEE]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM110",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FEE,
+ },
+ [0x12FEF]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM112",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FEF,
+ },
+ [0x12FF0]={
+ category="lo",
+ description="CYPRO-MINOAN SIGN CM114",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FF0,
+ },
+ [0x12FF1]={
+ category="po",
+ description="CYPRO-MINOAN SIGN CM301",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FF1,
+ },
+ [0x12FF2]={
+ category="po",
+ description="CYPRO-MINOAN SIGN CM302",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x12FF2,
+ },
[0x13000]={
category="lo",
description="EGYPTIAN HIEROGLYPH A001",
@@ -182325,6 +186621,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13091,
+ variants=variants_90,
},
[0x13092]={
category="lo",
@@ -182332,6 +186629,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13092,
+ variants=variants_90,
},
[0x13093]={
category="lo",
@@ -182339,6 +186637,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13093,
+ variants=variants_180,
},
[0x13094]={
category="lo",
@@ -182493,6 +186792,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x130A9,
+ variants=variants_180,
},
[0x130AA]={
category="lo",
@@ -183207,6 +187507,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x1310F,
+ variants=variants_90,
},
[0x13110]={
category="lo",
@@ -183263,6 +187564,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13117,
+ variants=variants_270,
},
[0x13118]={
category="lo",
@@ -183298,6 +187600,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x1311C,
+ variants=variants_90,
},
[0x1311D]={
category="lo",
@@ -183333,6 +187636,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13121,
+ variants=variants_90,
},
[0x13122]={
category="lo",
@@ -183375,6 +187679,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13127,
+ variants=variants_90,
},
[0x13128]={
category="lo",
@@ -183501,6 +187806,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13139,
+ variants=variants_90_270,
},
[0x1313A]={
category="lo",
@@ -184019,6 +188325,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13183,
+ variants=variants_270,
},
[0x13184]={
category="lo",
@@ -184047,6 +188354,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13187,
+ variants=variants_180,
},
[0x13188]={
category="lo",
@@ -184222,6 +188530,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x131A0,
+ variants=variants_90_270,
},
[0x131A1]={
category="lo",
@@ -184341,6 +188650,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x131B1,
+ variants=variants_90_180,
},
[0x131B2]={
category="lo",
@@ -184390,6 +188700,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x131B8,
+ variants=variants_90,
},
[0x131B9]={
category="lo",
@@ -184397,6 +188708,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x131B9,
+ variants=variants_90,
},
[0x131BA]={
category="lo",
@@ -184404,6 +188716,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x131BA,
+ variants=variants_270,
},
[0x131BB]={
category="lo",
@@ -184523,6 +188836,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x131CB,
+ variants=variants_90,
},
[0x131CC]={
category="lo",
@@ -184768,6 +189082,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x131EE,
+ variants=variants_180_270,
},
[0x131EF]={
category="lo",
@@ -184838,6 +189153,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x131F8,
+ variants=variants_180,
},
[0x131F9]={
category="lo",
@@ -184845,6 +189161,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x131F9,
+ variants=variants_90_180,
},
[0x131FA]={
category="lo",
@@ -184852,6 +189169,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x131FA,
+ variants=variants_90_180,
},
[0x131FB]={
category="lo",
@@ -185048,6 +189366,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13216,
+ variants=variants_270,
},
[0x13217]={
category="lo",
@@ -185503,6 +189822,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13257,
+ variants=variants_180,
},
[0x13258]={
category="lo",
@@ -185755,6 +190075,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x1327B,
+ variants=variants_270,
},
[0x1327C]={
category="lo",
@@ -185783,6 +190104,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x1327F,
+ variants=variants_90_180,
},
[0x13280]={
category="lo",
@@ -185825,6 +190147,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13285,
+ variants=variants_90,
},
[0x13286]={
category="lo",
@@ -185874,6 +190197,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x1328C,
+ variants=variants_90,
},
[0x1328D]={
category="lo",
@@ -186042,6 +190366,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x132A4,
+ variants=variants_180_270,
},
[0x132A5]={
category="lo",
@@ -186084,6 +190409,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x132AA,
+ variants=variants_90,
},
[0x132AB]={
category="lo",
@@ -186315,6 +190641,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x132CB,
+ variants=variants_90,
},
[0x132CC]={
category="lo",
@@ -186434,6 +190761,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x132DC,
+ variants=variants_90,
},
[0x132DD]={
category="lo",
@@ -186511,6 +190839,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x132E7,
+ variants=variants_90_270,
},
[0x132E8]={
category="lo",
@@ -186525,6 +190854,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x132E9,
+ variants=variants_270,
},
[0x132EA]={
category="lo",
@@ -186630,6 +190960,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x132F8,
+ variants=variants_270,
},
[0x132F9]={
category="lo",
@@ -186665,6 +190996,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x132FD,
+ variants=variants_270,
},
[0x132FE]={
category="lo",
@@ -186700,6 +191032,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13302,
+ variants=variants_270,
},
[0x13303]={
category="lo",
@@ -186707,6 +191040,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13303,
+ variants=variants_270,
},
[0x13304]={
category="lo",
@@ -186735,6 +191069,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13307,
+ variants=variants_90,
},
[0x13308]={
category="lo",
@@ -186742,6 +191077,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13308,
+ variants=variants_180,
},
[0x13309]={
category="lo",
@@ -186798,6 +191134,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13310,
+ variants=variants_270,
},
[0x13311]={
category="lo",
@@ -186805,6 +191142,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13311,
+ variants=variants_270,
},
[0x13312]={
category="lo",
@@ -186812,6 +191150,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13312,
+ variants=variants_180_270,
},
[0x13313]={
category="lo",
@@ -186819,6 +191158,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13313,
+ variants=variants_180_270,
},
[0x13314]={
category="lo",
@@ -186826,6 +191166,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13314,
+ variants=variants_180_270,
},
[0x13315]={
category="lo",
@@ -186875,6 +191216,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x1331B,
+ variants=variants_90_180,
},
[0x1331C]={
category="lo",
@@ -186882,6 +191224,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x1331C,
+ variants=variants_270,
},
[0x1331D]={
category="lo",
@@ -186917,6 +191260,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13321,
+ variants=variants_180_270,
},
[0x13322]={
category="lo",
@@ -186924,6 +191268,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13322,
+ variants=variants_90_180,
},
[0x13323]={
category="lo",
@@ -187029,6 +191374,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13331,
+ variants=variants_180_270,
},
[0x13332]={
category="lo",
@@ -187099,6 +191445,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x1333B,
+ variants=variants_90,
},
[0x1333C]={
category="lo",
@@ -187106,6 +191453,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x1333C,
+ variants=variants_90,
},
[0x1333D]={
category="lo",
@@ -187204,6 +191552,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x1334A,
+ variants=variants_270,
},
[0x1334B]={
category="lo",
@@ -187365,6 +191714,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13361,
+ variants=variants_270,
},
[0x13362]={
category="lo",
@@ -187491,6 +191841,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13373,
+ variants=variants_270,
},
[0x13374]={
category="lo",
@@ -187519,6 +191870,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13377,
+ variants=variants_90,
},
[0x13378]={
category="lo",
@@ -187526,6 +191878,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13378,
+ variants=variants_90,
},
[0x13379]={
category="lo",
@@ -187561,6 +191914,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x1337D,
+ variants=variants_270,
},
[0x1337E]={
category="lo",
@@ -187617,6 +191971,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13385,
+ variants=variants_270,
},
[0x13386]={
category="lo",
@@ -187757,6 +192112,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13399,
+ variants=variants_90,
},
[0x1339A]={
category="lo",
@@ -187764,6 +192120,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x1339A,
+ variants=variants_90,
},
[0x1339B]={
category="lo",
@@ -187911,6 +192268,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x133AF,
+ variants=variants_270,
},
[0x133B0]={
category="lo",
@@ -187918,6 +192276,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x133B0,
+ variants=variants_270,
},
[0x133B1]={
category="lo",
@@ -188023,6 +192382,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x133BF,
+ variants=variants_270,
},
[0x133C0]={
category="lo",
@@ -188163,6 +192523,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x133D3,
+ variants=variants_90,
},
[0x133D4]={
category="lo",
@@ -188233,6 +192594,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x133DD,
+ variants=variants_270,
},
[0x133DE]={
category="lo",
@@ -188380,6 +192742,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x133F2,
+ variants=variants_90,
},
[0x133F3]={
category="lo",
@@ -188401,6 +192764,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x133F5,
+ variants=variants_90,
},
[0x133F6]={
category="lo",
@@ -188408,6 +192772,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x133F6,
+ variants=variants_90,
},
[0x133F7]={
category="lo",
@@ -188499,6 +192864,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13403,
+ variants=variants_90,
},
[0x13404]={
category="lo",
@@ -188632,6 +192998,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13416,
+ variants=variants_90,
},
[0x13417]={
category="lo",
@@ -188653,6 +193020,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13419,
+ variants=variants_90_180_270,
},
[0x1341A]={
category="lo",
@@ -188660,6 +193028,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x1341A,
+ variants=variants_90,
},
[0x1341B]={
category="lo",
@@ -188723,6 +193092,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x13423,
+ variants=variants_90,
},
[0x13424]={
category="lo",
@@ -188786,6 +193156,7 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x1342C,
+ variants=variants_270,
},
[0x1342D]={
category="lo",
@@ -188800,6 +193171,14 @@ characters.data={
direction="l",
linebreak="al",
unicodeslot=0x1342E,
+ variants=variants_270,
+ },
+ [0x1342F]={
+ category="lo",
+ description="EGYPTIAN HIEROGLYPH V011D",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1342F,
},
[0x13430]={
category="cf",
@@ -188864,6 +193243,213 @@ characters.data={
linebreak="cl",
unicodeslot=0x13438,
},
+ [0x13439]={
+ category="cf",
+ description="EGYPTIAN HIEROGLYPH INSERT AT MIDDLE",
+ direction="l",
+ linebreak="gl",
+ unicodeslot=0x13439,
+ },
+ [0x1343A]={
+ category="cf",
+ description="EGYPTIAN HIEROGLYPH INSERT AT TOP",
+ direction="l",
+ linebreak="gl",
+ unicodeslot=0x1343A,
+ },
+ [0x1343B]={
+ category="cf",
+ description="EGYPTIAN HIEROGLYPH INSERT AT BOTTOM",
+ direction="l",
+ linebreak="gl",
+ unicodeslot=0x1343B,
+ },
+ [0x1343C]={
+ category="cf",
+ description="EGYPTIAN HIEROGLYPH BEGIN ENCLOSURE",
+ direction="l",
+ linebreak="op",
+ unicodeslot=0x1343C,
+ },
+ [0x1343D]={
+ category="cf",
+ description="EGYPTIAN HIEROGLYPH END ENCLOSURE",
+ direction="l",
+ linebreak="cl",
+ unicodeslot=0x1343D,
+ },
+ [0x1343E]={
+ category="cf",
+ description="EGYPTIAN HIEROGLYPH BEGIN WALLED ENCLOSURE",
+ direction="l",
+ linebreak="op",
+ unicodeslot=0x1343E,
+ },
+ [0x1343F]={
+ category="cf",
+ description="EGYPTIAN HIEROGLYPH END WALLED ENCLOSURE",
+ direction="l",
+ linebreak="cl",
+ unicodeslot=0x1343F,
+ },
+ [0x13440]={
+ category="mn",
+ description="EGYPTIAN HIEROGLYPH MIRROR HORIZONTALLY",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x13440,
+ },
+ [0x13441]={
+ category="lo",
+ description="EGYPTIAN HIEROGLYPH FULL BLANK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x13441,
+ },
+ [0x13442]={
+ category="lo",
+ description="EGYPTIAN HIEROGLYPH HALF BLANK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x13442,
+ },
+ [0x13443]={
+ category="lo",
+ description="EGYPTIAN HIEROGLYPH LOST SIGN",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x13443,
+ variants=variants_expanded,
+ },
+ [0x13444]={
+ category="lo",
+ description="EGYPTIAN HIEROGLYPH HALF LOST SIGN",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x13444,
+ variants=variants_expanded,
+ },
+ [0x13445]={
+ category="lo",
+ description="EGYPTIAN HIEROGLYPH TALL LOST SIGN",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x13445,
+ variants=variants_expanded,
+ },
+ [0x13446]={
+ category="lo",
+ description="EGYPTIAN HIEROGLYPH WIDE LOST SIGN",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x13446,
+ variants=variants_expanded,
+ },
+ [0x13447]={
+ category="mn",
+ description="EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT TOP START",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x13447,
+ },
+ [0x13448]={
+ category="mn",
+ description="EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT BOTTOM START",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x13448,
+ },
+ [0x13449]={
+ category="mn",
+ description="EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT START",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x13449,
+ },
+ [0x1344A]={
+ category="mn",
+ description="EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT TOP END",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1344A,
+ },
+ [0x1344B]={
+ category="mn",
+ description="EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT TOP",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1344B,
+ },
+ [0x1344C]={
+ category="mn",
+ description="EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT BOTTOM START AND TOP END",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1344C,
+ },
+ [0x1344D]={
+ category="mn",
+ description="EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT START AND TOP",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1344D,
+ },
+ [0x1344E]={
+ category="mn",
+ description="EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT BOTTOM END",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1344E,
+ },
+ [0x1344F]={
+ category="mn",
+ description="EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT TOP START AND BOTTOM END",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1344F,
+ },
+ [0x13450]={
+ category="mn",
+ description="EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT BOTTOM",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x13450,
+ },
+ [0x13451]={
+ category="mn",
+ description="EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT START AND BOTTOM",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x13451,
+ },
+ [0x13452]={
+ category="mn",
+ description="EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT END",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x13452,
+ },
+ [0x13453]={
+ category="mn",
+ description="EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT TOP AND END",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x13453,
+ },
+ [0x13454]={
+ category="mn",
+ description="EGYPTIAN HIEROGLYPH MODIFIER DAMAGED AT BOTTOM AND END",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x13454,
+ },
+ [0x13455]={
+ category="mn",
+ description="EGYPTIAN HIEROGLYPH MODIFIER DAMAGED",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x13455,
+ },
[0x14400]={
category="lo",
description="ANATOLIAN HIEROGLYPH A001",
@@ -197229,6 +201815,629 @@ characters.data={
linebreak="ba",
unicodeslot=0x16A6F,
},
+ [0x16A70]={
+ category="lo",
+ description="TANGSA LETTER OZ",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A70,
+ },
+ [0x16A71]={
+ category="lo",
+ description="TANGSA LETTER OC",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A71,
+ },
+ [0x16A72]={
+ category="lo",
+ description="TANGSA LETTER OQ",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A72,
+ },
+ [0x16A73]={
+ category="lo",
+ description="TANGSA LETTER OX",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A73,
+ },
+ [0x16A74]={
+ category="lo",
+ description="TANGSA LETTER AZ",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A74,
+ },
+ [0x16A75]={
+ category="lo",
+ description="TANGSA LETTER AC",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A75,
+ },
+ [0x16A76]={
+ category="lo",
+ description="TANGSA LETTER AQ",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A76,
+ },
+ [0x16A77]={
+ category="lo",
+ description="TANGSA LETTER AX",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A77,
+ },
+ [0x16A78]={
+ category="lo",
+ description="TANGSA LETTER VZ",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A78,
+ },
+ [0x16A79]={
+ category="lo",
+ description="TANGSA LETTER VC",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A79,
+ },
+ [0x16A7A]={
+ category="lo",
+ description="TANGSA LETTER VQ",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A7A,
+ },
+ [0x16A7B]={
+ category="lo",
+ description="TANGSA LETTER VX",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A7B,
+ },
+ [0x16A7C]={
+ category="lo",
+ description="TANGSA LETTER EZ",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A7C,
+ },
+ [0x16A7D]={
+ category="lo",
+ description="TANGSA LETTER EC",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A7D,
+ },
+ [0x16A7E]={
+ category="lo",
+ description="TANGSA LETTER EQ",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A7E,
+ },
+ [0x16A7F]={
+ category="lo",
+ description="TANGSA LETTER EX",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A7F,
+ },
+ [0x16A80]={
+ category="lo",
+ description="TANGSA LETTER IZ",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A80,
+ },
+ [0x16A81]={
+ category="lo",
+ description="TANGSA LETTER IC",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A81,
+ },
+ [0x16A82]={
+ category="lo",
+ description="TANGSA LETTER IQ",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A82,
+ },
+ [0x16A83]={
+ category="lo",
+ description="TANGSA LETTER IX",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A83,
+ },
+ [0x16A84]={
+ category="lo",
+ description="TANGSA LETTER UZ",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A84,
+ },
+ [0x16A85]={
+ category="lo",
+ description="TANGSA LETTER UC",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A85,
+ },
+ [0x16A86]={
+ category="lo",
+ description="TANGSA LETTER UQ",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A86,
+ },
+ [0x16A87]={
+ category="lo",
+ description="TANGSA LETTER UX",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A87,
+ },
+ [0x16A88]={
+ category="lo",
+ description="TANGSA LETTER AWZ",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A88,
+ },
+ [0x16A89]={
+ category="lo",
+ description="TANGSA LETTER AWC",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A89,
+ },
+ [0x16A8A]={
+ category="lo",
+ description="TANGSA LETTER AWQ",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A8A,
+ },
+ [0x16A8B]={
+ category="lo",
+ description="TANGSA LETTER AWX",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A8B,
+ },
+ [0x16A8C]={
+ category="lo",
+ description="TANGSA LETTER UIZ",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A8C,
+ },
+ [0x16A8D]={
+ category="lo",
+ description="TANGSA LETTER UIC",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A8D,
+ },
+ [0x16A8E]={
+ category="lo",
+ description="TANGSA LETTER UIQ",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A8E,
+ },
+ [0x16A8F]={
+ category="lo",
+ description="TANGSA LETTER UIX",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A8F,
+ },
+ [0x16A90]={
+ category="lo",
+ description="TANGSA LETTER FINAL NG",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A90,
+ },
+ [0x16A91]={
+ category="lo",
+ description="TANGSA LETTER LONG UEX",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A91,
+ },
+ [0x16A92]={
+ category="lo",
+ description="TANGSA LETTER SHORT UEZ",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A92,
+ },
+ [0x16A93]={
+ category="lo",
+ description="TANGSA LETTER SHORT AWX",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A93,
+ },
+ [0x16A94]={
+ category="lo",
+ description="TANGSA LETTER UEC",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A94,
+ },
+ [0x16A95]={
+ category="lo",
+ description="TANGSA LETTER UEZ",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A95,
+ },
+ [0x16A96]={
+ category="lo",
+ description="TANGSA LETTER UEQ",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A96,
+ },
+ [0x16A97]={
+ category="lo",
+ description="TANGSA LETTER UEX",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A97,
+ },
+ [0x16A98]={
+ category="lo",
+ description="TANGSA LETTER UIUZ",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A98,
+ },
+ [0x16A99]={
+ category="lo",
+ description="TANGSA LETTER UIUC",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A99,
+ },
+ [0x16A9A]={
+ category="lo",
+ description="TANGSA LETTER UIUQ",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A9A,
+ },
+ [0x16A9B]={
+ category="lo",
+ description="TANGSA LETTER UIUX",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A9B,
+ },
+ [0x16A9C]={
+ category="lo",
+ description="TANGSA LETTER MZ",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A9C,
+ },
+ [0x16A9D]={
+ category="lo",
+ description="TANGSA LETTER MC",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A9D,
+ },
+ [0x16A9E]={
+ category="lo",
+ description="TANGSA LETTER MQ",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A9E,
+ },
+ [0x16A9F]={
+ category="lo",
+ description="TANGSA LETTER MX",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16A9F,
+ },
+ [0x16AA0]={
+ category="lo",
+ description="TANGSA LETTER KA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16AA0,
+ },
+ [0x16AA1]={
+ category="lo",
+ description="TANGSA LETTER KHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16AA1,
+ },
+ [0x16AA2]={
+ category="lo",
+ description="TANGSA LETTER GA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16AA2,
+ },
+ [0x16AA3]={
+ category="lo",
+ description="TANGSA LETTER NGA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16AA3,
+ },
+ [0x16AA4]={
+ category="lo",
+ description="TANGSA LETTER SA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16AA4,
+ },
+ [0x16AA5]={
+ category="lo",
+ description="TANGSA LETTER YA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16AA5,
+ },
+ [0x16AA6]={
+ category="lo",
+ description="TANGSA LETTER WA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16AA6,
+ },
+ [0x16AA7]={
+ category="lo",
+ description="TANGSA LETTER PA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16AA7,
+ },
+ [0x16AA8]={
+ category="lo",
+ description="TANGSA LETTER NYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16AA8,
+ },
+ [0x16AA9]={
+ category="lo",
+ description="TANGSA LETTER PHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16AA9,
+ },
+ [0x16AAA]={
+ category="lo",
+ description="TANGSA LETTER BA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16AAA,
+ },
+ [0x16AAB]={
+ category="lo",
+ description="TANGSA LETTER MA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16AAB,
+ },
+ [0x16AAC]={
+ category="lo",
+ description="TANGSA LETTER NA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16AAC,
+ },
+ [0x16AAD]={
+ category="lo",
+ description="TANGSA LETTER HA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16AAD,
+ },
+ [0x16AAE]={
+ category="lo",
+ description="TANGSA LETTER LA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16AAE,
+ },
+ [0x16AAF]={
+ category="lo",
+ description="TANGSA LETTER HTA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16AAF,
+ },
+ [0x16AB0]={
+ category="lo",
+ description="TANGSA LETTER TA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16AB0,
+ },
+ [0x16AB1]={
+ category="lo",
+ description="TANGSA LETTER DA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16AB1,
+ },
+ [0x16AB2]={
+ category="lo",
+ description="TANGSA LETTER RA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16AB2,
+ },
+ [0x16AB3]={
+ category="lo",
+ description="TANGSA LETTER NHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16AB3,
+ },
+ [0x16AB4]={
+ category="lo",
+ description="TANGSA LETTER SHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16AB4,
+ },
+ [0x16AB5]={
+ category="lo",
+ description="TANGSA LETTER CA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16AB5,
+ },
+ [0x16AB6]={
+ category="lo",
+ description="TANGSA LETTER TSA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16AB6,
+ },
+ [0x16AB7]={
+ category="lo",
+ description="TANGSA LETTER GHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16AB7,
+ },
+ [0x16AB8]={
+ category="lo",
+ description="TANGSA LETTER HTTA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16AB8,
+ },
+ [0x16AB9]={
+ category="lo",
+ description="TANGSA LETTER THA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16AB9,
+ },
+ [0x16ABA]={
+ category="lo",
+ description="TANGSA LETTER XA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16ABA,
+ },
+ [0x16ABB]={
+ category="lo",
+ description="TANGSA LETTER FA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16ABB,
+ },
+ [0x16ABC]={
+ category="lo",
+ description="TANGSA LETTER DHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16ABC,
+ },
+ [0x16ABD]={
+ category="lo",
+ description="TANGSA LETTER CHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16ABD,
+ },
+ [0x16ABE]={
+ category="lo",
+ description="TANGSA LETTER ZA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x16ABE,
+ },
+ [0x16AC0]={
+ category="nd",
+ description="TANGSA DIGIT ZERO",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x16AC0,
+ },
+ [0x16AC1]={
+ category="nd",
+ description="TANGSA DIGIT ONE",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x16AC1,
+ },
+ [0x16AC2]={
+ category="nd",
+ description="TANGSA DIGIT TWO",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x16AC2,
+ },
+ [0x16AC3]={
+ category="nd",
+ description="TANGSA DIGIT THREE",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x16AC3,
+ },
+ [0x16AC4]={
+ category="nd",
+ description="TANGSA DIGIT FOUR",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x16AC4,
+ },
+ [0x16AC5]={
+ category="nd",
+ description="TANGSA DIGIT FIVE",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x16AC5,
+ },
+ [0x16AC6]={
+ category="nd",
+ description="TANGSA DIGIT SIX",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x16AC6,
+ },
+ [0x16AC7]={
+ category="nd",
+ description="TANGSA DIGIT SEVEN",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x16AC7,
+ },
+ [0x16AC8]={
+ category="nd",
+ description="TANGSA DIGIT EIGHT",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x16AC8,
+ },
+ [0x16AC9]={
+ category="nd",
+ description="TANGSA DIGIT NINE",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x16AC9,
+ },
[0x16AD0]={
category="lo",
description="BASSA VAH LETTER ENNI",
@@ -198386,6 +203595,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER M",
direction="l",
+ lccode=0x16E60,
linebreak="al",
unicodeslot=0x16E40,
},
@@ -198393,6 +203603,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER S",
direction="l",
+ lccode=0x16E61,
linebreak="al",
unicodeslot=0x16E41,
},
@@ -198400,6 +203611,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER V",
direction="l",
+ lccode=0x16E62,
linebreak="al",
unicodeslot=0x16E42,
},
@@ -198407,6 +203619,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER W",
direction="l",
+ lccode=0x16E63,
linebreak="al",
unicodeslot=0x16E43,
},
@@ -198414,6 +203627,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER ATIU",
direction="l",
+ lccode=0x16E64,
linebreak="al",
unicodeslot=0x16E44,
},
@@ -198421,6 +203635,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER Z",
direction="l",
+ lccode=0x16E65,
linebreak="al",
unicodeslot=0x16E45,
},
@@ -198428,6 +203643,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER KP",
direction="l",
+ lccode=0x16E66,
linebreak="al",
unicodeslot=0x16E46,
},
@@ -198435,6 +203651,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER P",
direction="l",
+ lccode=0x16E67,
linebreak="al",
unicodeslot=0x16E47,
},
@@ -198442,6 +203659,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER T",
direction="l",
+ lccode=0x16E68,
linebreak="al",
unicodeslot=0x16E48,
},
@@ -198449,6 +203667,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER G",
direction="l",
+ lccode=0x16E69,
linebreak="al",
unicodeslot=0x16E49,
},
@@ -198456,6 +203675,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER F",
direction="l",
+ lccode=0x16E6A,
linebreak="al",
unicodeslot=0x16E4A,
},
@@ -198463,6 +203683,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER I",
direction="l",
+ lccode=0x16E6B,
linebreak="al",
unicodeslot=0x16E4B,
},
@@ -198470,6 +203691,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER K",
direction="l",
+ lccode=0x16E6C,
linebreak="al",
unicodeslot=0x16E4C,
},
@@ -198477,6 +203699,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER A",
direction="l",
+ lccode=0x16E6D,
linebreak="al",
unicodeslot=0x16E4D,
},
@@ -198484,6 +203707,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER J",
direction="l",
+ lccode=0x16E6E,
linebreak="al",
unicodeslot=0x16E4E,
},
@@ -198491,6 +203715,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER E",
direction="l",
+ lccode=0x16E6F,
linebreak="al",
unicodeslot=0x16E4F,
},
@@ -198498,6 +203723,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER B",
direction="l",
+ lccode=0x16E70,
linebreak="al",
unicodeslot=0x16E50,
},
@@ -198505,6 +203731,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER C",
direction="l",
+ lccode=0x16E71,
linebreak="al",
unicodeslot=0x16E51,
},
@@ -198512,6 +203739,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER U",
direction="l",
+ lccode=0x16E72,
linebreak="al",
unicodeslot=0x16E52,
},
@@ -198519,6 +203747,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER YU",
direction="l",
+ lccode=0x16E73,
linebreak="al",
unicodeslot=0x16E53,
},
@@ -198526,6 +203755,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER L",
direction="l",
+ lccode=0x16E74,
linebreak="al",
unicodeslot=0x16E54,
},
@@ -198533,6 +203763,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER Q",
direction="l",
+ lccode=0x16E75,
linebreak="al",
unicodeslot=0x16E55,
},
@@ -198540,6 +203771,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER HP",
direction="l",
+ lccode=0x16E76,
linebreak="al",
unicodeslot=0x16E56,
},
@@ -198547,6 +203779,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER NY",
direction="l",
+ lccode=0x16E77,
linebreak="al",
unicodeslot=0x16E57,
},
@@ -198554,6 +203787,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER X",
direction="l",
+ lccode=0x16E78,
linebreak="al",
unicodeslot=0x16E58,
},
@@ -198561,6 +203795,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER D",
direction="l",
+ lccode=0x16E79,
linebreak="al",
unicodeslot=0x16E59,
},
@@ -198568,6 +203803,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER OE",
direction="l",
+ lccode=0x16E7A,
linebreak="al",
unicodeslot=0x16E5A,
},
@@ -198575,6 +203811,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER N",
direction="l",
+ lccode=0x16E7B,
linebreak="al",
unicodeslot=0x16E5B,
},
@@ -198582,6 +203819,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER R",
direction="l",
+ lccode=0x16E7C,
linebreak="al",
unicodeslot=0x16E5C,
},
@@ -198589,6 +203827,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER O",
direction="l",
+ lccode=0x16E7D,
linebreak="al",
unicodeslot=0x16E5D,
},
@@ -198596,6 +203835,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER AI",
direction="l",
+ lccode=0x16E7E,
linebreak="al",
unicodeslot=0x16E5E,
},
@@ -198603,6 +203843,7 @@ characters.data={
category="lu",
description="MEDEFAIDRIN CAPITAL LETTER Y",
direction="l",
+ lccode=0x16E7F,
linebreak="al",
unicodeslot=0x16E5F,
},
@@ -210024,6 +215265,110 @@ characters.data={
linebreak="al",
unicodeslot=0x18CD5,
},
+ [0x1AFF0]={
+ category="lm",
+ cjkwd="w",
+ description="KATAKANA LETTER MINNAN TONE-2",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1AFF0,
+ },
+ [0x1AFF1]={
+ category="lm",
+ cjkwd="w",
+ description="KATAKANA LETTER MINNAN TONE-3",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1AFF1,
+ },
+ [0x1AFF2]={
+ category="lm",
+ cjkwd="w",
+ description="KATAKANA LETTER MINNAN TONE-4",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1AFF2,
+ },
+ [0x1AFF3]={
+ category="lm",
+ cjkwd="w",
+ description="KATAKANA LETTER MINNAN TONE-5",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1AFF3,
+ },
+ [0x1AFF5]={
+ category="lm",
+ cjkwd="w",
+ description="KATAKANA LETTER MINNAN TONE-7",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1AFF5,
+ },
+ [0x1AFF6]={
+ category="lm",
+ cjkwd="w",
+ description="KATAKANA LETTER MINNAN TONE-8",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1AFF6,
+ },
+ [0x1AFF7]={
+ category="lm",
+ cjkwd="w",
+ description="KATAKANA LETTER MINNAN NASALIZED TONE-1",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1AFF7,
+ },
+ [0x1AFF8]={
+ category="lm",
+ cjkwd="w",
+ description="KATAKANA LETTER MINNAN NASALIZED TONE-2",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1AFF8,
+ },
+ [0x1AFF9]={
+ category="lm",
+ cjkwd="w",
+ description="KATAKANA LETTER MINNAN NASALIZED TONE-3",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1AFF9,
+ },
+ [0x1AFFA]={
+ category="lm",
+ cjkwd="w",
+ description="KATAKANA LETTER MINNAN NASALIZED TONE-4",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1AFFA,
+ },
+ [0x1AFFB]={
+ category="lm",
+ cjkwd="w",
+ description="KATAKANA LETTER MINNAN NASALIZED TONE-5",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1AFFB,
+ },
+ [0x1AFFD]={
+ category="lm",
+ cjkwd="w",
+ description="KATAKANA LETTER MINNAN NASALIZED TONE-7",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1AFFD,
+ },
+ [0x1AFFE]={
+ category="lm",
+ cjkwd="w",
+ description="KATAKANA LETTER MINNAN NASALIZED TONE-8",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1AFFE,
+ },
[0x1B000]={
category="lo",
cjkwd="w",
@@ -212320,6 +217665,46 @@ characters.data={
linebreak="id",
unicodeslot=0x1B11E,
},
+ [0x1B11F]={
+ category="lo",
+ cjkwd="w",
+ description="HIRAGANA LETTER ARCHAIC WU",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x1B11F,
+ },
+ [0x1B120]={
+ category="lo",
+ cjkwd="w",
+ description="KATAKANA LETTER ARCHAIC YI",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x1B120,
+ },
+ [0x1B121]={
+ category="lo",
+ cjkwd="w",
+ description="KATAKANA LETTER ARCHAIC YE",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x1B121,
+ },
+ [0x1B122]={
+ category="lo",
+ cjkwd="w",
+ description="KATAKANA LETTER ARCHAIC WU",
+ direction="l",
+ linebreak="id",
+ unicodeslot=0x1B122,
+ },
+ [0x1B132]={
+ category="lo",
+ cjkwd="w",
+ description="HIRAGANA LETTER SMALL KO",
+ direction="l",
+ linebreak="cj",
+ unicodeslot=0x1B132,
+ },
[0x1B150]={
category="lo",
cjkwd="w",
@@ -212344,6 +217729,14 @@ characters.data={
linebreak="cj",
unicodeslot=0x1B152,
},
+ [0x1B155]={
+ category="lo",
+ cjkwd="w",
+ description="KATAKANA LETTER SMALL KO",
+ direction="l",
+ linebreak="cj",
+ unicodeslot=0x1B155,
+ },
[0x1B164]={
category="lo",
cjkwd="w",
@@ -216574,6 +221967,1301 @@ characters.data={
linebreak="cm",
unicodeslot=0x1BCA3,
},
+ [0x1CF00]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK GORAZDO NIZKO S KRYZHEM ON LEFT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF00,
+ },
+ [0x1CF01]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK NIZKO S KRYZHEM ON LEFT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF01,
+ },
+ [0x1CF02]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK TSATA ON LEFT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF02,
+ },
+ [0x1CF03]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK GORAZDO NIZKO ON LEFT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF03,
+ },
+ [0x1CF04]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK NIZKO ON LEFT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF04,
+ },
+ [0x1CF05]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK SREDNE ON LEFT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF05,
+ },
+ [0x1CF06]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK MALO POVYSHE ON LEFT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF06,
+ },
+ [0x1CF07]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK POVYSHE ON LEFT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF07,
+ },
+ [0x1CF08]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK VYSOKO ON LEFT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF08,
+ },
+ [0x1CF09]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK MALO POVYSHE S KHOKHLOM ON LEFT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF09,
+ },
+ [0x1CF0A]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK POVYSHE S KHOKHLOM ON LEFT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF0A,
+ },
+ [0x1CF0B]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK VYSOKO S KHOKHLOM ON LEFT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF0B,
+ },
+ [0x1CF0C]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK GORAZDO NIZKO S KRYZHEM ON RIGHT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF0C,
+ },
+ [0x1CF0D]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK NIZKO S KRYZHEM ON RIGHT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF0D,
+ },
+ [0x1CF0E]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK TSATA ON RIGHT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF0E,
+ },
+ [0x1CF0F]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK GORAZDO NIZKO ON RIGHT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF0F,
+ },
+ [0x1CF10]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK NIZKO ON RIGHT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF10,
+ },
+ [0x1CF11]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK SREDNE ON RIGHT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF11,
+ },
+ [0x1CF12]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK MALO POVYSHE ON RIGHT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF12,
+ },
+ [0x1CF13]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK POVYSHE ON RIGHT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF13,
+ },
+ [0x1CF14]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK VYSOKO ON RIGHT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF14,
+ },
+ [0x1CF15]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK MALO POVYSHE S KHOKHLOM ON RIGHT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF15,
+ },
+ [0x1CF16]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK POVYSHE S KHOKHLOM ON RIGHT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF16,
+ },
+ [0x1CF17]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK VYSOKO S KHOKHLOM ON RIGHT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF17,
+ },
+ [0x1CF18]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK TSATA S KRYZHEM",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF18,
+ },
+ [0x1CF19]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK MALO POVYSHE S KRYZHEM",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF19,
+ },
+ [0x1CF1A]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK STRANNO MALO POVYSHE",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF1A,
+ },
+ [0x1CF1B]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK POVYSHE S KRYZHEM",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF1B,
+ },
+ [0x1CF1C]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK POVYSHE STRANNO",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF1C,
+ },
+ [0x1CF1D]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK VYSOKO S KRYZHEM",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF1D,
+ },
+ [0x1CF1E]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK MALO POVYSHE STRANNO",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF1E,
+ },
+ [0x1CF1F]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK GORAZDO VYSOKO",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF1F,
+ },
+ [0x1CF20]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK ZELO",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF20,
+ },
+ [0x1CF21]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK ON",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF21,
+ },
+ [0x1CF22]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK RAVNO",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF22,
+ },
+ [0x1CF23]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK TIKHAYA",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF23,
+ },
+ [0x1CF24]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK BORZAYA",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF24,
+ },
+ [0x1CF25]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK UDARKA",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF25,
+ },
+ [0x1CF26]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK PODVERTKA",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF26,
+ },
+ [0x1CF27]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK LOMKA",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF27,
+ },
+ [0x1CF28]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK KUPNAYA",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF28,
+ },
+ [0x1CF29]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK KACHKA",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF29,
+ },
+ [0x1CF2A]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK ZEVOK",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF2A,
+ },
+ [0x1CF2B]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK SKOBA",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF2B,
+ },
+ [0x1CF2C]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK RAZSEKA",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF2C,
+ },
+ [0x1CF2D]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK KRYZH ON LEFT",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF2D,
+ },
+ [0x1CF30]={
+ category="mn",
+ description="ZNAMENNY COMBINING TONAL RANGE MARK MRACHNO",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF30,
+ },
+ [0x1CF31]={
+ category="mn",
+ description="ZNAMENNY COMBINING TONAL RANGE MARK SVETLO",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF31,
+ },
+ [0x1CF32]={
+ category="mn",
+ description="ZNAMENNY COMBINING TONAL RANGE MARK TRESVETLO",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF32,
+ },
+ [0x1CF33]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK ZADERZHKA",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF33,
+ },
+ [0x1CF34]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK DEMESTVENNY ZADERZHKA",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF34,
+ },
+ [0x1CF35]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK OTSECHKA",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF35,
+ },
+ [0x1CF36]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK PODCHASHIE",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF36,
+ },
+ [0x1CF37]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK PODCHASHIE WITH VERTICAL STROKE",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF37,
+ },
+ [0x1CF38]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK CHASHKA",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF38,
+ },
+ [0x1CF39]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK CHASHKA POLNAYA",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF39,
+ },
+ [0x1CF3A]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK OBLACHKO",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF3A,
+ },
+ [0x1CF3B]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK SOROCHYA NOZHKA",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF3B,
+ },
+ [0x1CF3C]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK TOCHKA",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF3C,
+ },
+ [0x1CF3D]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK DVOETOCHIE",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF3D,
+ },
+ [0x1CF3E]={
+ category="mn",
+ description="ZNAMENNY COMBINING ATTACHING VERTICAL OMET",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF3E,
+ },
+ [0x1CF3F]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK CURVED OMET",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF3F,
+ },
+ [0x1CF40]={
+ category="mn",
+ description="ZNAMENNY COMBINING MARK KRYZH",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF40,
+ },
+ [0x1CF41]={
+ category="mn",
+ description="ZNAMENNY COMBINING LOWER TONAL RANGE INDICATOR",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF41,
+ },
+ [0x1CF42]={
+ category="mn",
+ description="ZNAMENNY PRIZNAK MODIFIER LEVEL-2",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF42,
+ },
+ [0x1CF43]={
+ category="mn",
+ description="ZNAMENNY PRIZNAK MODIFIER LEVEL-3",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF43,
+ },
+ [0x1CF44]={
+ category="mn",
+ description="ZNAMENNY PRIZNAK MODIFIER DIRECTION FLIP",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF44,
+ },
+ [0x1CF45]={
+ category="mn",
+ description="ZNAMENNY PRIZNAK MODIFIER KRYZH",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF45,
+ },
+ [0x1CF46]={
+ category="mn",
+ description="ZNAMENNY PRIZNAK MODIFIER ROG",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1CF46,
+ },
+ [0x1CF50]={
+ category="so",
+ description="ZNAMENNY NEUME KRYUK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF50,
+ },
+ [0x1CF51]={
+ category="so",
+ description="ZNAMENNY NEUME KRYUK TIKHY",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF51,
+ },
+ [0x1CF52]={
+ category="so",
+ description="ZNAMENNY NEUME PARAKLIT",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF52,
+ },
+ [0x1CF53]={
+ category="so",
+ description="ZNAMENNY NEUME DVA V CHELNU",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF53,
+ },
+ [0x1CF54]={
+ category="so",
+ description="ZNAMENNY NEUME KLYUCH",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF54,
+ },
+ [0x1CF55]={
+ category="so",
+ description="ZNAMENNY NEUME ZANOZHEK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF55,
+ },
+ [0x1CF56]={
+ category="so",
+ description="ZNAMENNY NEUME STOPITSA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF56,
+ },
+ [0x1CF57]={
+ category="so",
+ description="ZNAMENNY NEUME STOPITSA S OCHKOM",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF57,
+ },
+ [0x1CF58]={
+ category="so",
+ description="ZNAMENNY NEUME PEREVODKA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF58,
+ },
+ [0x1CF59]={
+ category="so",
+ description="ZNAMENNY NEUME PEREVODKA NEPOSTOYANNAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF59,
+ },
+ [0x1CF5A]={
+ category="so",
+ description="ZNAMENNY NEUME STOPITSA WITH SOROCHYA NOZHKA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF5A,
+ },
+ [0x1CF5B]={
+ category="so",
+ description="ZNAMENNY NEUME CHELYUSTKA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF5B,
+ },
+ [0x1CF5C]={
+ category="so",
+ description="ZNAMENNY NEUME PALKA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF5C,
+ },
+ [0x1CF5D]={
+ category="so",
+ description="ZNAMENNY NEUME ZAPYATAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF5D,
+ },
+ [0x1CF5E]={
+ category="so",
+ description="ZNAMENNY NEUME GOLUBCHIK BORZY",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF5E,
+ },
+ [0x1CF5F]={
+ category="so",
+ description="ZNAMENNY NEUME GOLUBCHIK TIKHY",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF5F,
+ },
+ [0x1CF60]={
+ category="so",
+ description="ZNAMENNY NEUME GOLUBCHIK MRACHNY",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF60,
+ },
+ [0x1CF61]={
+ category="so",
+ description="ZNAMENNY NEUME GOLUBCHIK SVETLY",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF61,
+ },
+ [0x1CF62]={
+ category="so",
+ description="ZNAMENNY NEUME GOLUBCHIK TRESVETLY",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF62,
+ },
+ [0x1CF63]={
+ category="so",
+ description="ZNAMENNY NEUME VRAKHIYA PROSTAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF63,
+ },
+ [0x1CF64]={
+ category="so",
+ description="ZNAMENNY NEUME VRAKHIYA MRACHNAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF64,
+ },
+ [0x1CF65]={
+ category="so",
+ description="ZNAMENNY NEUME VRAKHIYA SVETLAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF65,
+ },
+ [0x1CF66]={
+ category="so",
+ description="ZNAMENNY NEUME VRAKHIYA TRESVETLAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF66,
+ },
+ [0x1CF67]={
+ category="so",
+ description="ZNAMENNY NEUME VRAKHIYA KLYUCHEVAYA PROSTAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF67,
+ },
+ [0x1CF68]={
+ category="so",
+ description="ZNAMENNY NEUME VRAKHIYA KLYUCHEVAYA MRACHNAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF68,
+ },
+ [0x1CF69]={
+ category="so",
+ description="ZNAMENNY NEUME VRAKHIYA KLYUCHEVAYA SVETLAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF69,
+ },
+ [0x1CF6A]={
+ category="so",
+ description="ZNAMENNY NEUME VRAKHIYA KLYUCHEVAYA TRESVETLAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF6A,
+ },
+ [0x1CF6B]={
+ category="so",
+ description="ZNAMENNY NEUME DOUBLE ZAPYATAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF6B,
+ },
+ [0x1CF6C]={
+ category="so",
+ description="ZNAMENNY NEUME REVERSED CHELYUSTKA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF6C,
+ },
+ [0x1CF6D]={
+ category="so",
+ description="ZNAMENNY NEUME DERBITSA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF6D,
+ },
+ [0x1CF6E]={
+ category="so",
+ description="ZNAMENNY NEUME KHAMILO",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF6E,
+ },
+ [0x1CF6F]={
+ category="so",
+ description="ZNAMENNY NEUME CHASHKA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF6F,
+ },
+ [0x1CF70]={
+ category="so",
+ description="ZNAMENNY NEUME PODCHASHIE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF70,
+ },
+ [0x1CF71]={
+ category="so",
+ description="ZNAMENNY NEUME SKAMEYTSA MRACHNAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF71,
+ },
+ [0x1CF72]={
+ category="so",
+ description="ZNAMENNY NEUME SKAMEYTSA SVETLAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF72,
+ },
+ [0x1CF73]={
+ category="so",
+ description="ZNAMENNY NEUME SKAMEYTSA TRESVETLAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF73,
+ },
+ [0x1CF74]={
+ category="so",
+ description="ZNAMENNY NEUME SKAMEYTSA TIKHAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF74,
+ },
+ [0x1CF75]={
+ category="so",
+ description="ZNAMENNY NEUME DEMESTVENNY KLYUCH",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF75,
+ },
+ [0x1CF76]={
+ category="so",
+ description="ZNAMENNY NEUME SKAMEYTSA KLYUCHEVAYA SVETLAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF76,
+ },
+ [0x1CF77]={
+ category="so",
+ description="ZNAMENNY NEUME SKAMEYTSA KLYUCHENEPOSTOYANNAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF77,
+ },
+ [0x1CF78]={
+ category="so",
+ description="ZNAMENNY NEUME SKAMEYTSA KLYUCHEVAYA TIKHAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF78,
+ },
+ [0x1CF79]={
+ category="so",
+ description="ZNAMENNY NEUME SKAMEYTSA DVOECHELNAYA PROSTAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF79,
+ },
+ [0x1CF7A]={
+ category="so",
+ description="ZNAMENNY NEUME SKAMEYTSA DVOECHELNAYA SVETLAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF7A,
+ },
+ [0x1CF7B]={
+ category="so",
+ description="ZNAMENNY NEUME SKAMEYTSA DVOECHELNAYA NEPOSTOYANNAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF7B,
+ },
+ [0x1CF7C]={
+ category="so",
+ description="ZNAMENNY NEUME SKAMEYTSA DVOECHELNAYA KLYUCHEVAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF7C,
+ },
+ [0x1CF7D]={
+ category="so",
+ description="ZNAMENNY NEUME SLOZHITIE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF7D,
+ },
+ [0x1CF7E]={
+ category="so",
+ description="ZNAMENNY NEUME SLOZHITIE S ZAPYATOY",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF7E,
+ },
+ [0x1CF7F]={
+ category="so",
+ description="ZNAMENNY NEUME SLOZHITIE ZAKRYTOE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF7F,
+ },
+ [0x1CF80]={
+ category="so",
+ description="ZNAMENNY NEUME SLOZHITIE S KRYZHEM",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF80,
+ },
+ [0x1CF81]={
+ category="so",
+ description="ZNAMENNY NEUME KRYZH",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF81,
+ },
+ [0x1CF82]={
+ category="so",
+ description="ZNAMENNY NEUME ROG",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF82,
+ },
+ [0x1CF83]={
+ category="so",
+ description="ZNAMENNY NEUME FITA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF83,
+ },
+ [0x1CF84]={
+ category="so",
+ description="ZNAMENNY NEUME KOBYLA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF84,
+ },
+ [0x1CF85]={
+ category="so",
+ description="ZNAMENNY NEUME ZMEYTSA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF85,
+ },
+ [0x1CF86]={
+ category="so",
+ description="ZNAMENNY NEUME STATYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF86,
+ },
+ [0x1CF87]={
+ category="so",
+ description="ZNAMENNY NEUME STATYA S ZAPYATOY",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF87,
+ },
+ [0x1CF88]={
+ category="so",
+ description="ZNAMENNY NEUME STATYA S KRYZHEM",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF88,
+ },
+ [0x1CF89]={
+ category="so",
+ description="ZNAMENNY NEUME STATYA S ZAPYATOY I KRYZHEM",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF89,
+ },
+ [0x1CF8A]={
+ category="so",
+ description="ZNAMENNY NEUME STATYA S KRYZHEM I ZAPYATOY",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF8A,
+ },
+ [0x1CF8B]={
+ category="so",
+ description="ZNAMENNY NEUME STATYA ZAKRYTAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF8B,
+ },
+ [0x1CF8C]={
+ category="so",
+ description="ZNAMENNY NEUME STATYA ZAKRYTAYA S ZAPYATOY",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF8C,
+ },
+ [0x1CF8D]={
+ category="so",
+ description="ZNAMENNY NEUME STATYA S ROGOM",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF8D,
+ },
+ [0x1CF8E]={
+ category="so",
+ description="ZNAMENNY NEUME STATYA S DVUMYA ZAPYATYMI",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF8E,
+ },
+ [0x1CF8F]={
+ category="so",
+ description="ZNAMENNY NEUME STATYA S ZAPYATOY I PODCHASHIEM",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF8F,
+ },
+ [0x1CF90]={
+ category="so",
+ description="ZNAMENNY NEUME POLKULIZMY",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF90,
+ },
+ [0x1CF91]={
+ category="so",
+ description="ZNAMENNY NEUME STATYA NEPOSTOYANNAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF91,
+ },
+ [0x1CF92]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA PROSTAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF92,
+ },
+ [0x1CF93]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA MRACHNOTIKHAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF93,
+ },
+ [0x1CF94]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA KRYZHEVAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF94,
+ },
+ [0x1CF95]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA POLUPOVODNAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF95,
+ },
+ [0x1CF96]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA POVODNAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF96,
+ },
+ [0x1CF97]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA NEPOSTOYANNAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF97,
+ },
+ [0x1CF98]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA KLYUCHEPOVODNAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF98,
+ },
+ [0x1CF99]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA KLYUCHENEPOSTOYANNAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF99,
+ },
+ [0x1CF9A]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA TIKHAYA PUTNAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF9A,
+ },
+ [0x1CF9B]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA DVOECHELNAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF9B,
+ },
+ [0x1CF9C]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA DVOECHELNOKRYZHEVAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF9C,
+ },
+ [0x1CF9D]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA DVOECHELNOPOVODNAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF9D,
+ },
+ [0x1CF9E]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA DVOECHELNAYA KLYUCHEVAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF9E,
+ },
+ [0x1CF9F]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA DVOECHELNOPOVODNAYA KLYUCHEVAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CF9F,
+ },
+ [0x1CFA0]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA GROMNAYA WITH SINGLE ZAPYATAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFA0,
+ },
+ [0x1CFA1]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA GROMOPOVODNAYA WITH SINGLE ZAPYATAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFA1,
+ },
+ [0x1CFA2]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA GROMNAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFA2,
+ },
+ [0x1CFA3]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA GROMOPOVODNAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFA3,
+ },
+ [0x1CFA4]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA GROMOPOVODNAYA WITH DOUBLE ZAPYATAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFA4,
+ },
+ [0x1CFA5]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA GROMOKRYZHEVAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFA5,
+ },
+ [0x1CFA6]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA GROMOKRYZHEVAYA POVODNAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFA6,
+ },
+ [0x1CFA7]={
+ category="so",
+ description="ZNAMENNY NEUME MECHIK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFA7,
+ },
+ [0x1CFA8]={
+ category="so",
+ description="ZNAMENNY NEUME MECHIK POVODNY",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFA8,
+ },
+ [0x1CFA9]={
+ category="so",
+ description="ZNAMENNY NEUME MECHIK KLYUCHEVOY",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFA9,
+ },
+ [0x1CFAA]={
+ category="so",
+ description="ZNAMENNY NEUME MECHIK KLYUCHEPOVODNY",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFAA,
+ },
+ [0x1CFAB]={
+ category="so",
+ description="ZNAMENNY NEUME MECHIK KLYUCHENEPOSTOYANNY",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFAB,
+ },
+ [0x1CFAC]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA TRYASOGLASNAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFAC,
+ },
+ [0x1CFAD]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA TRYASOPOVODNAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFAD,
+ },
+ [0x1CFAE]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA TRYASOSTRELNAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFAE,
+ },
+ [0x1CFAF]={
+ category="so",
+ description="ZNAMENNY NEUME OSOKA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFAF,
+ },
+ [0x1CFB0]={
+ category="so",
+ description="ZNAMENNY NEUME OSOKA SVETLAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFB0,
+ },
+ [0x1CFB1]={
+ category="so",
+ description="ZNAMENNY NEUME OSOKA TRESVETLAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFB1,
+ },
+ [0x1CFB2]={
+ category="so",
+ description="ZNAMENNY NEUME OSOKA KRYUKOVAYA SVETLAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFB2,
+ },
+ [0x1CFB3]={
+ category="so",
+ description="ZNAMENNY NEUME OSOKA KLYUCHEVAYA SVETLAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFB3,
+ },
+ [0x1CFB4]={
+ category="so",
+ description="ZNAMENNY NEUME OSOKA KLYUCHEVAYA NEPOSTOYANNAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFB4,
+ },
+ [0x1CFB5]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA KRYUKOVAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFB5,
+ },
+ [0x1CFB6]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA KRYUKOVAYA POVODNAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFB6,
+ },
+ [0x1CFB7]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA KRYUKOVAYA GROMNAYA WITH SINGLE ZAPYATAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFB7,
+ },
+ [0x1CFB8]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA KRYUKOVAYA GROMOPOVODNAYA WITH SINGLE ZAPYATAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFB8,
+ },
+ [0x1CFB9]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA KRYUKOVAYA GROMNAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFB9,
+ },
+ [0x1CFBA]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA KRYUKOVAYA GROMOPOVODNAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFBA,
+ },
+ [0x1CFBB]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA KRYUKOVAYA GROMOPOVODNAYA WITH DOUBLE ZAPYATAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFBB,
+ },
+ [0x1CFBC]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA KRYUKOVAYA GROMOKRYZHEVAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFBC,
+ },
+ [0x1CFBD]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA KRYUKOVAYA GROMOKRYZHEVAYA POVODNAYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFBD,
+ },
+ [0x1CFBE]={
+ category="so",
+ description="ZNAMENNY NEUME STRELA KRYUKOVAYA TRYASKA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFBE,
+ },
+ [0x1CFBF]={
+ category="so",
+ description="ZNAMENNY NEUME KUFISMA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFBF,
+ },
+ [0x1CFC0]={
+ category="so",
+ description="ZNAMENNY NEUME OBLAKO",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFC0,
+ },
+ [0x1CFC1]={
+ category="so",
+ description="ZNAMENNY NEUME DUDA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFC1,
+ },
+ [0x1CFC2]={
+ category="so",
+ description="ZNAMENNY NEUME NEMKA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFC2,
+ },
+ [0x1CFC3]={
+ category="so",
+ description="ZNAMENNY NEUME PAUK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1CFC3,
+ },
[0x1D000]={
category="so",
description="BYZANTINE MUSICAL SYMBOL PSILI",
@@ -219958,6 +226646,20 @@ characters.data={
linebreak="al",
unicodeslot=0x1D1E8,
},
+ [0x1D1E9]={
+ category="so",
+ description="MUSICAL SYMBOL SORI",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1D1E9,
+ },
+ [0x1D1EA]={
+ category="so",
+ description="MUSICAL SYMBOL KORON",
+ direction="on",
+ linebreak="al",
+ unicodeslot=0x1D1EA,
+ },
[0x1D200]={
category="so",
description="GREEK VOCAL NOTATION SYMBOL-0x0001",
@@ -220451,6 +227153,146 @@ characters.data={
linebreak="al",
unicodeslot=0x1D245,
},
+ [0x1D2C0]={
+ category="no",
+ description="KAKTOVIK NUMERAL ZERO",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1D2C0,
+ },
+ [0x1D2C1]={
+ category="no",
+ description="KAKTOVIK NUMERAL ONE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1D2C1,
+ },
+ [0x1D2C2]={
+ category="no",
+ description="KAKTOVIK NUMERAL TWO",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1D2C2,
+ },
+ [0x1D2C3]={
+ category="no",
+ description="KAKTOVIK NUMERAL THREE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1D2C3,
+ },
+ [0x1D2C4]={
+ category="no",
+ description="KAKTOVIK NUMERAL FOUR",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1D2C4,
+ },
+ [0x1D2C5]={
+ category="no",
+ description="KAKTOVIK NUMERAL FIVE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1D2C5,
+ },
+ [0x1D2C6]={
+ category="no",
+ description="KAKTOVIK NUMERAL SIX",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1D2C6,
+ },
+ [0x1D2C7]={
+ category="no",
+ description="KAKTOVIK NUMERAL SEVEN",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1D2C7,
+ },
+ [0x1D2C8]={
+ category="no",
+ description="KAKTOVIK NUMERAL EIGHT",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1D2C8,
+ },
+ [0x1D2C9]={
+ category="no",
+ description="KAKTOVIK NUMERAL NINE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1D2C9,
+ },
+ [0x1D2CA]={
+ category="no",
+ description="KAKTOVIK NUMERAL TEN",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1D2CA,
+ },
+ [0x1D2CB]={
+ category="no",
+ description="KAKTOVIK NUMERAL ELEVEN",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1D2CB,
+ },
+ [0x1D2CC]={
+ category="no",
+ description="KAKTOVIK NUMERAL TWELVE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1D2CC,
+ },
+ [0x1D2CD]={
+ category="no",
+ description="KAKTOVIK NUMERAL THIRTEEN",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1D2CD,
+ },
+ [0x1D2CE]={
+ category="no",
+ description="KAKTOVIK NUMERAL FOURTEEN",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1D2CE,
+ },
+ [0x1D2CF]={
+ category="no",
+ description="KAKTOVIK NUMERAL FIFTEEN",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1D2CF,
+ },
+ [0x1D2D0]={
+ category="no",
+ description="KAKTOVIK NUMERAL SIXTEEN",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1D2D0,
+ },
+ [0x1D2D1]={
+ category="no",
+ description="KAKTOVIK NUMERAL SEVENTEEN",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1D2D1,
+ },
+ [0x1D2D2]={
+ category="no",
+ description="KAKTOVIK NUMERAL EIGHTEEN",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1D2D2,
+ },
+ [0x1D2D3]={
+ category="no",
+ description="KAKTOVIK NUMERAL NINETEEN",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1D2D3,
+ },
[0x1D2E0]={
category="no",
description="MAYAN NUMERAL ZERO",
@@ -221875,6 +228717,13 @@ characters.data={
description="MATHEMATICAL ITALIC CAPITAL D",
direction="l",
linebreak="al",
+ mathclass="ordinary",
+ mathspec={
+ {
+ class="differential",
+ name="Dd",
+ },
+ },
specials={ "font", 0x44 },
unicodeslot=0x1D437,
visual="it",
@@ -222109,6 +228958,13 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL D",
direction="l",
linebreak="al",
+ mathclass="ordinary",
+ mathspec={
+ {
+ class="differential",
+ name="dd",
+ },
+ },
specials={ "font", 0x64 },
unicodeslot=0x1D451,
visual="it",
@@ -222118,6 +228974,13 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL E",
direction="l",
linebreak="al",
+ mathclass="ordinary",
+ mathspec={
+ {
+ class="exponential",
+ name="ee",
+ },
+ },
specials={ "font", 0x65 },
unicodeslot=0x1D452,
visual="it",
@@ -222145,6 +229008,13 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL I",
direction="l",
linebreak="al",
+ mathclass="ordinary",
+ mathspec={
+ {
+ class="imaginary",
+ name="ii",
+ },
+ },
specials={ "font", 0x69 },
unicodeslot=0x1D456,
visual="it",
@@ -222154,6 +229024,13 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL J",
direction="l",
linebreak="al",
+ mathclass="ordinary",
+ mathspec={
+ {
+ class="imaginary",
+ name="ji",
+ },
+ },
specials={ "font", 0x6A },
unicodeslot=0x1D457,
visual="it",
@@ -222777,6 +229654,7 @@ characters.data={
linebreak="al",
specials={ "font", 0x41 },
unicodeslot=0x1D49C,
+ variants=variants_style,
visual="it",
},
[0x1D49E]={
@@ -222786,6 +229664,7 @@ characters.data={
linebreak="al",
specials={ "font", 0x43 },
unicodeslot=0x1D49E,
+ variants=variants_style,
visual="it",
},
[0x1D49F]={
@@ -222795,6 +229674,7 @@ characters.data={
linebreak="al",
specials={ "font", 0x44 },
unicodeslot=0x1D49F,
+ variants=variants_style,
visual="it",
},
[0x1D4A2]={
@@ -222804,6 +229684,7 @@ characters.data={
linebreak="al",
specials={ "font", 0x47 },
unicodeslot=0x1D4A2,
+ variants=variants_style,
visual="it",
},
[0x1D4A5]={
@@ -222813,6 +229694,7 @@ characters.data={
linebreak="al",
specials={ "font", 0x4A },
unicodeslot=0x1D4A5,
+ variants=variants_style,
visual="it",
},
[0x1D4A6]={
@@ -222822,6 +229704,7 @@ characters.data={
linebreak="al",
specials={ "font", 0x4B },
unicodeslot=0x1D4A6,
+ variants=variants_style,
visual="it",
},
[0x1D4A9]={
@@ -222831,6 +229714,7 @@ characters.data={
linebreak="al",
specials={ "font", 0x4E },
unicodeslot=0x1D4A9,
+ variants=variants_style,
visual="it",
},
[0x1D4AA]={
@@ -222840,6 +229724,7 @@ characters.data={
linebreak="al",
specials={ "font", 0x4F },
unicodeslot=0x1D4AA,
+ variants=variants_style,
visual="it",
},
[0x1D4AB]={
@@ -222850,6 +229735,7 @@ characters.data={
specials={ "font", 0x50 },
synonyms={ "power set" },
unicodeslot=0x1D4AB,
+ variants=variants_style,
visual="it",
},
[0x1D4AC]={
@@ -222859,6 +229745,7 @@ characters.data={
linebreak="al",
specials={ "font", 0x51 },
unicodeslot=0x1D4AC,
+ variants=variants_style,
visual="it",
},
[0x1D4AE]={
@@ -222868,6 +229755,7 @@ characters.data={
linebreak="al",
specials={ "font", 0x53 },
unicodeslot=0x1D4AE,
+ variants=variants_style,
visual="it",
},
[0x1D4AF]={
@@ -222877,6 +229765,7 @@ characters.data={
linebreak="al",
specials={ "font", 0x54 },
unicodeslot=0x1D4AF,
+ variants=variants_style,
visual="it",
},
[0x1D4B0]={
@@ -222886,6 +229775,7 @@ characters.data={
linebreak="al",
specials={ "font", 0x55 },
unicodeslot=0x1D4B0,
+ variants=variants_style,
visual="it",
},
[0x1D4B1]={
@@ -222895,6 +229785,7 @@ characters.data={
linebreak="al",
specials={ "font", 0x56 },
unicodeslot=0x1D4B1,
+ variants=variants_style,
visual="it",
},
[0x1D4B2]={
@@ -222904,6 +229795,7 @@ characters.data={
linebreak="al",
specials={ "font", 0x57 },
unicodeslot=0x1D4B2,
+ variants=variants_style,
visual="it",
},
[0x1D4B3]={
@@ -222913,6 +229805,7 @@ characters.data={
linebreak="al",
specials={ "font", 0x58 },
unicodeslot=0x1D4B3,
+ variants=variants_style,
visual="it",
},
[0x1D4B4]={
@@ -222922,6 +229815,7 @@ characters.data={
linebreak="al",
specials={ "font", 0x59 },
unicodeslot=0x1D4B4,
+ variants=variants_style,
visual="it",
},
[0x1D4B5]={
@@ -222931,6 +229825,7 @@ characters.data={
linebreak="al",
specials={ "font", 0x5A },
unicodeslot=0x1D4B5,
+ variants=variants_style,
visual="it",
},
[0x1D4B6]={
@@ -227055,7 +233950,7 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL DOTLESS I",
direction="l",
linebreak="al",
- mathclass="default",
+ mathclass="ordinary",
mathname="imath",
specials={ "font", 0x131 },
unicodeslot=0x1D6A4,
@@ -227066,7 +233961,7 @@ characters.data={
description="MATHEMATICAL ITALIC SMALL DOTLESS J",
direction="l",
linebreak="al",
- mathclass="default",
+ mathclass="ordinary",
mathname="jmath",
specials={ "font", 0x237 },
unicodeslot=0x1D6A5,
@@ -227536,6 +234431,7 @@ characters.data={
description="MATHEMATICAL BOLD PARTIAL DIFFERENTIAL",
direction="on",
linebreak="al",
+ mathclass="differential",
specials={ "font", 0x2202 },
unicodeslot=0x1D6DB,
visual="bf",
@@ -227824,7 +234720,7 @@ characters.data={
description="MATHEMATICAL ITALIC NABLA",
direction="l",
linebreak="al",
- mathclass="default",
+ mathclass="ordinary",
specials={ "font", 0x2207 },
unicodeslot=0x1D6FB,
visual="it",
@@ -228059,6 +234955,7 @@ characters.data={
description="MATHEMATICAL ITALIC PARTIAL DIFFERENTIAL",
direction="on",
linebreak="al",
+ mathclass="differential",
specials={ "font", 0x2202 },
unicodeslot=0x1D715,
visual="it",
@@ -228077,7 +234974,7 @@ characters.data={
description="MATHEMATICAL ITALIC THETA SYMBOL",
direction="l",
linebreak="al",
- mathclass="default",
+ mathclass="ordinary",
mathname="vartheta",
specials={ "font", 0x3D1 },
unicodeslot=0x1D717,
@@ -228088,7 +234985,7 @@ characters.data={
description="MATHEMATICAL ITALIC KAPPA SYMBOL",
direction="l",
linebreak="al",
- mathclass="default",
+ mathclass="ordinary",
mathname="varkappa",
specials={ "font", 0x3F0 },
unicodeslot=0x1D718,
@@ -228108,7 +235005,6 @@ characters.data={
description="MATHEMATICAL ITALIC RHO SYMBOL",
direction="l",
linebreak="al",
- mathclass="variable",
mathname="varrho",
specials={ "font", 0x3F1 },
unicodeslot=0x1D71A,
@@ -228587,6 +235483,7 @@ characters.data={
description="MATHEMATICAL BOLD ITALIC PARTIAL DIFFERENTIAL",
direction="on",
linebreak="al",
+ mathclass="differential",
specials={ "font", 0x2202 },
unicodeslot=0x1D74F,
visual="bi",
@@ -229109,6 +236006,7 @@ characters.data={
description="MATHEMATICAL SANS-SERIF BOLD PARTIAL DIFFERENTIAL",
direction="on",
linebreak="al",
+ mathclass="differential",
specials={ "font", 0x2202 },
unicodeslot=0x1D789,
visual="bf",
@@ -229631,6 +236529,7 @@ characters.data={
description="MATHEMATICAL SANS-SERIF BOLD ITALIC PARTIAL DIFFERENTIAL",
direction="on",
linebreak="al",
+ mathclass="differential",
specials={ "font", 0x2202 },
unicodeslot=0x1D7C3,
visual="bi",
@@ -234831,6 +241730,265 @@ characters.data={
linebreak="cm",
unicodeslot=0x1DAAF,
},
+ [0x1DF00]={
+ category="ll",
+ description="LATIN SMALL LETTER FENG DIGRAPH WITH TRILL",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF00,
+ },
+ [0x1DF01]={
+ category="ll",
+ description="LATIN SMALL LETTER REVERSED SCRIPT G",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF01,
+ },
+ [0x1DF02]={
+ category="ll",
+ description="LATIN LETTER SMALL CAPITAL TURNED G",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF02,
+ },
+ [0x1DF03]={
+ category="ll",
+ description="LATIN SMALL LETTER REVERSED K",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF03,
+ },
+ [0x1DF04]={
+ category="ll",
+ description="LATIN LETTER SMALL CAPITAL L WITH BELT",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF04,
+ },
+ [0x1DF05]={
+ category="ll",
+ description="LATIN SMALL LETTER LEZH WITH RETROFLEX HOOK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF05,
+ },
+ [0x1DF06]={
+ category="ll",
+ description="LATIN SMALL LETTER TURNED Y WITH BELT",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF06,
+ },
+ [0x1DF07]={
+ category="ll",
+ description="LATIN SMALL LETTER REVERSED ENG",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF07,
+ },
+ [0x1DF08]={
+ category="ll",
+ description="LATIN SMALL LETTER TURNED R WITH LONG LEG AND RETROFLEX HOOK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF08,
+ },
+ [0x1DF09]={
+ category="ll",
+ description="LATIN SMALL LETTER T WITH HOOK AND RETROFLEX HOOK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF09,
+ },
+ [0x1DF0A]={
+ category="lo",
+ description="LATIN LETTER RETROFLEX CLICK WITH RETROFLEX HOOK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF0A,
+ },
+ [0x1DF0B]={
+ category="ll",
+ description="LATIN SMALL LETTER ESH WITH DOUBLE BAR",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF0B,
+ },
+ [0x1DF0C]={
+ category="ll",
+ description="LATIN SMALL LETTER ESH WITH DOUBLE BAR AND CURL",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF0C,
+ },
+ [0x1DF0D]={
+ category="ll",
+ description="LATIN SMALL LETTER TURNED T WITH CURL",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF0D,
+ },
+ [0x1DF0E]={
+ category="ll",
+ description="LATIN LETTER INVERTED GLOTTAL STOP WITH CURL",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF0E,
+ },
+ [0x1DF0F]={
+ category="ll",
+ description="LATIN LETTER STRETCHED C WITH CURL",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF0F,
+ },
+ [0x1DF10]={
+ category="ll",
+ description="LATIN LETTER SMALL CAPITAL TURNED K",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF10,
+ },
+ [0x1DF11]={
+ category="ll",
+ description="LATIN SMALL LETTER L WITH FISHHOOK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF11,
+ },
+ [0x1DF12]={
+ category="ll",
+ description="LATIN SMALL LETTER DEZH DIGRAPH WITH PALATAL HOOK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF12,
+ },
+ [0x1DF13]={
+ category="ll",
+ description="LATIN SMALL LETTER L WITH BELT AND PALATAL HOOK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF13,
+ },
+ [0x1DF14]={
+ category="ll",
+ description="LATIN SMALL LETTER ENG WITH PALATAL HOOK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF14,
+ },
+ [0x1DF15]={
+ category="ll",
+ description="LATIN SMALL LETTER TURNED R WITH PALATAL HOOK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF15,
+ },
+ [0x1DF16]={
+ category="ll",
+ description="LATIN SMALL LETTER R WITH FISHHOOK AND PALATAL HOOK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF16,
+ },
+ [0x1DF17]={
+ category="ll",
+ description="LATIN SMALL LETTER TESH DIGRAPH WITH PALATAL HOOK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF17,
+ },
+ [0x1DF18]={
+ category="ll",
+ description="LATIN SMALL LETTER EZH WITH PALATAL HOOK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF18,
+ },
+ [0x1DF19]={
+ category="ll",
+ description="LATIN SMALL LETTER DEZH DIGRAPH WITH RETROFLEX HOOK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF19,
+ },
+ [0x1DF1A]={
+ category="ll",
+ description="LATIN SMALL LETTER I WITH STROKE AND RETROFLEX HOOK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF1A,
+ },
+ [0x1DF1B]={
+ category="ll",
+ description="LATIN SMALL LETTER O WITH RETROFLEX HOOK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF1B,
+ },
+ [0x1DF1C]={
+ category="ll",
+ description="LATIN SMALL LETTER TESH DIGRAPH WITH RETROFLEX HOOK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF1C,
+ },
+ [0x1DF1D]={
+ category="ll",
+ description="LATIN SMALL LETTER C WITH RETROFLEX HOOK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF1D,
+ },
+ [0x1DF1E]={
+ category="ll",
+ description="LATIN SMALL LETTER S WITH CURL",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF1E,
+ },
+ [0x1DF25]={
+ category="ll",
+ description="LATIN SMALL LETTER D WITH MID-HEIGHT LEFT HOOK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF25,
+ },
+ [0x1DF26]={
+ category="ll",
+ description="LATIN SMALL LETTER L WITH MID-HEIGHT LEFT HOOK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF26,
+ },
+ [0x1DF27]={
+ category="ll",
+ description="LATIN SMALL LETTER N WITH MID-HEIGHT LEFT HOOK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF27,
+ },
+ [0x1DF28]={
+ category="ll",
+ description="LATIN SMALL LETTER R WITH MID-HEIGHT LEFT HOOK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF28,
+ },
+ [0x1DF29]={
+ category="ll",
+ description="LATIN SMALL LETTER S WITH MID-HEIGHT LEFT HOOK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF29,
+ },
+ [0x1DF2A]={
+ category="ll",
+ description="LATIN SMALL LETTER T WITH MID-HEIGHT LEFT HOOK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1DF2A,
+ },
[0x1E000]={
category="mn",
combining=0xE6,
@@ -235135,6 +242293,510 @@ characters.data={
linebreak="cm",
unicodeslot=0x1E02A,
},
+ [0x1E030]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL A",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x430 },
+ unicodeslot=0x1E030,
+ },
+ [0x1E031]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL BE",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x431 },
+ unicodeslot=0x1E031,
+ },
+ [0x1E032]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL VE",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x432 },
+ unicodeslot=0x1E032,
+ },
+ [0x1E033]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL GHE",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x433 },
+ unicodeslot=0x1E033,
+ },
+ [0x1E034]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL DE",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x434 },
+ unicodeslot=0x1E034,
+ },
+ [0x1E035]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL IE",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x435 },
+ unicodeslot=0x1E035,
+ },
+ [0x1E036]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL ZHE",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x436 },
+ unicodeslot=0x1E036,
+ },
+ [0x1E037]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL ZE",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x437 },
+ unicodeslot=0x1E037,
+ },
+ [0x1E038]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL I",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x438 },
+ unicodeslot=0x1E038,
+ },
+ [0x1E039]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL KA",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x43A },
+ unicodeslot=0x1E039,
+ },
+ [0x1E03A]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL EL",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x43B },
+ unicodeslot=0x1E03A,
+ },
+ [0x1E03B]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL EM",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x43C },
+ unicodeslot=0x1E03B,
+ },
+ [0x1E03C]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL O",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x43E },
+ unicodeslot=0x1E03C,
+ },
+ [0x1E03D]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL PE",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x43F },
+ unicodeslot=0x1E03D,
+ },
+ [0x1E03E]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL ER",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x440 },
+ unicodeslot=0x1E03E,
+ },
+ [0x1E03F]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL ES",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x441 },
+ unicodeslot=0x1E03F,
+ },
+ [0x1E040]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL TE",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x442 },
+ unicodeslot=0x1E040,
+ },
+ [0x1E041]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL U",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x443 },
+ unicodeslot=0x1E041,
+ },
+ [0x1E042]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL EF",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x444 },
+ unicodeslot=0x1E042,
+ },
+ [0x1E043]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL HA",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x445 },
+ unicodeslot=0x1E043,
+ },
+ [0x1E044]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL TSE",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x446 },
+ unicodeslot=0x1E044,
+ },
+ [0x1E045]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL CHE",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x447 },
+ unicodeslot=0x1E045,
+ },
+ [0x1E046]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL SHA",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x448 },
+ unicodeslot=0x1E046,
+ },
+ [0x1E047]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL YERU",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x44B },
+ unicodeslot=0x1E047,
+ },
+ [0x1E048]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL E",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x44D },
+ unicodeslot=0x1E048,
+ },
+ [0x1E049]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL YU",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x44E },
+ unicodeslot=0x1E049,
+ },
+ [0x1E04A]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL DZZE",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0xA689 },
+ unicodeslot=0x1E04A,
+ },
+ [0x1E04B]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL SCHWA",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x4D9 },
+ unicodeslot=0x1E04B,
+ },
+ [0x1E04C]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL BYELORUSSIAN-UKRAINIAN I",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x456 },
+ unicodeslot=0x1E04C,
+ },
+ [0x1E04D]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL JE",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x458 },
+ unicodeslot=0x1E04D,
+ },
+ [0x1E04E]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL BARRED O",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x4E9 },
+ unicodeslot=0x1E04E,
+ },
+ [0x1E04F]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL STRAIGHT U",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x4AF },
+ unicodeslot=0x1E04F,
+ },
+ [0x1E050]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL PALOCHKA",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x4CF },
+ unicodeslot=0x1E050,
+ },
+ [0x1E051]={
+ category="lm",
+ description="CYRILLIC SUBSCRIPT SMALL LETTER A",
+ direction="l",
+ linebreak="al",
+ specials={ "sub", 0x430 },
+ unicodeslot=0x1E051,
+ },
+ [0x1E052]={
+ category="lm",
+ description="CYRILLIC SUBSCRIPT SMALL LETTER BE",
+ direction="l",
+ linebreak="al",
+ specials={ "sub", 0x431 },
+ unicodeslot=0x1E052,
+ },
+ [0x1E053]={
+ category="lm",
+ description="CYRILLIC SUBSCRIPT SMALL LETTER VE",
+ direction="l",
+ linebreak="al",
+ specials={ "sub", 0x432 },
+ unicodeslot=0x1E053,
+ },
+ [0x1E054]={
+ category="lm",
+ description="CYRILLIC SUBSCRIPT SMALL LETTER GHE",
+ direction="l",
+ linebreak="al",
+ specials={ "sub", 0x433 },
+ unicodeslot=0x1E054,
+ },
+ [0x1E055]={
+ category="lm",
+ description="CYRILLIC SUBSCRIPT SMALL LETTER DE",
+ direction="l",
+ linebreak="al",
+ specials={ "sub", 0x434 },
+ unicodeslot=0x1E055,
+ },
+ [0x1E056]={
+ category="lm",
+ description="CYRILLIC SUBSCRIPT SMALL LETTER IE",
+ direction="l",
+ linebreak="al",
+ specials={ "sub", 0x435 },
+ unicodeslot=0x1E056,
+ },
+ [0x1E057]={
+ category="lm",
+ description="CYRILLIC SUBSCRIPT SMALL LETTER ZHE",
+ direction="l",
+ linebreak="al",
+ specials={ "sub", 0x436 },
+ unicodeslot=0x1E057,
+ },
+ [0x1E058]={
+ category="lm",
+ description="CYRILLIC SUBSCRIPT SMALL LETTER ZE",
+ direction="l",
+ linebreak="al",
+ specials={ "sub", 0x437 },
+ unicodeslot=0x1E058,
+ },
+ [0x1E059]={
+ category="lm",
+ description="CYRILLIC SUBSCRIPT SMALL LETTER I",
+ direction="l",
+ linebreak="al",
+ specials={ "sub", 0x438 },
+ unicodeslot=0x1E059,
+ },
+ [0x1E05A]={
+ category="lm",
+ description="CYRILLIC SUBSCRIPT SMALL LETTER KA",
+ direction="l",
+ linebreak="al",
+ specials={ "sub", 0x43A },
+ unicodeslot=0x1E05A,
+ },
+ [0x1E05B]={
+ category="lm",
+ description="CYRILLIC SUBSCRIPT SMALL LETTER EL",
+ direction="l",
+ linebreak="al",
+ specials={ "sub", 0x43B },
+ unicodeslot=0x1E05B,
+ },
+ [0x1E05C]={
+ category="lm",
+ description="CYRILLIC SUBSCRIPT SMALL LETTER O",
+ direction="l",
+ linebreak="al",
+ specials={ "sub", 0x43E },
+ unicodeslot=0x1E05C,
+ },
+ [0x1E05D]={
+ category="lm",
+ description="CYRILLIC SUBSCRIPT SMALL LETTER PE",
+ direction="l",
+ linebreak="al",
+ specials={ "sub", 0x43F },
+ unicodeslot=0x1E05D,
+ },
+ [0x1E05E]={
+ category="lm",
+ description="CYRILLIC SUBSCRIPT SMALL LETTER ES",
+ direction="l",
+ linebreak="al",
+ specials={ "sub", 0x441 },
+ unicodeslot=0x1E05E,
+ },
+ [0x1E05F]={
+ category="lm",
+ description="CYRILLIC SUBSCRIPT SMALL LETTER U",
+ direction="l",
+ linebreak="al",
+ specials={ "sub", 0x443 },
+ unicodeslot=0x1E05F,
+ },
+ [0x1E060]={
+ category="lm",
+ description="CYRILLIC SUBSCRIPT SMALL LETTER EF",
+ direction="l",
+ linebreak="al",
+ specials={ "sub", 0x444 },
+ unicodeslot=0x1E060,
+ },
+ [0x1E061]={
+ category="lm",
+ description="CYRILLIC SUBSCRIPT SMALL LETTER HA",
+ direction="l",
+ linebreak="al",
+ specials={ "sub", 0x445 },
+ unicodeslot=0x1E061,
+ },
+ [0x1E062]={
+ category="lm",
+ description="CYRILLIC SUBSCRIPT SMALL LETTER TSE",
+ direction="l",
+ linebreak="al",
+ specials={ "sub", 0x446 },
+ unicodeslot=0x1E062,
+ },
+ [0x1E063]={
+ category="lm",
+ description="CYRILLIC SUBSCRIPT SMALL LETTER CHE",
+ direction="l",
+ linebreak="al",
+ specials={ "sub", 0x447 },
+ unicodeslot=0x1E063,
+ },
+ [0x1E064]={
+ category="lm",
+ description="CYRILLIC SUBSCRIPT SMALL LETTER SHA",
+ direction="l",
+ linebreak="al",
+ specials={ "sub", 0x448 },
+ unicodeslot=0x1E064,
+ },
+ [0x1E065]={
+ category="lm",
+ description="CYRILLIC SUBSCRIPT SMALL LETTER HARD SIGN",
+ direction="l",
+ linebreak="al",
+ specials={ "sub", 0x44A },
+ unicodeslot=0x1E065,
+ },
+ [0x1E066]={
+ category="lm",
+ description="CYRILLIC SUBSCRIPT SMALL LETTER YERU",
+ direction="l",
+ linebreak="al",
+ specials={ "sub", 0x44B },
+ unicodeslot=0x1E066,
+ },
+ [0x1E067]={
+ category="lm",
+ description="CYRILLIC SUBSCRIPT SMALL LETTER GHE WITH UPTURN",
+ direction="l",
+ linebreak="al",
+ specials={ "sub", 0x491 },
+ unicodeslot=0x1E067,
+ },
+ [0x1E068]={
+ category="lm",
+ description="CYRILLIC SUBSCRIPT SMALL LETTER BYELORUSSIAN-UKRAINIAN I",
+ direction="l",
+ linebreak="al",
+ specials={ "sub", 0x456 },
+ unicodeslot=0x1E068,
+ },
+ [0x1E069]={
+ category="lm",
+ description="CYRILLIC SUBSCRIPT SMALL LETTER DZE",
+ direction="l",
+ linebreak="al",
+ specials={ "sub", 0x455 },
+ unicodeslot=0x1E069,
+ },
+ [0x1E06A]={
+ category="lm",
+ description="CYRILLIC SUBSCRIPT SMALL LETTER DZHE",
+ direction="l",
+ linebreak="al",
+ specials={ "sub", 0x45F },
+ unicodeslot=0x1E06A,
+ },
+ [0x1E06B]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL ES WITH DESCENDER",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x4AB },
+ unicodeslot=0x1E06B,
+ },
+ [0x1E06C]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL YERU WITH BACK YER",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0xA651 },
+ unicodeslot=0x1E06C,
+ },
+ [0x1E06D]={
+ category="lm",
+ description="MODIFIER LETTER CYRILLIC SMALL STRAIGHT U WITH STROKE",
+ direction="l",
+ linebreak="al",
+ specials={ "super", 0x4B1 },
+ unicodeslot=0x1E06D,
+ },
+ [0x1E08F]={
+ category="mn",
+ combining=0xE6,
+ description="COMBINING CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1E08F,
+ },
[0x1E100]={
category="lo",
description="NYIAKENG PUACHUE HMONG LETTER MA",
@@ -235639,6 +243301,224 @@ characters.data={
linebreak="al",
unicodeslot=0x1E14F,
},
+ [0x1E290]={
+ category="lo",
+ description="TOTO LETTER PA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E290,
+ },
+ [0x1E291]={
+ category="lo",
+ description="TOTO LETTER BA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E291,
+ },
+ [0x1E292]={
+ category="lo",
+ description="TOTO LETTER TA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E292,
+ },
+ [0x1E293]={
+ category="lo",
+ description="TOTO LETTER DA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E293,
+ },
+ [0x1E294]={
+ category="lo",
+ description="TOTO LETTER KA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E294,
+ },
+ [0x1E295]={
+ category="lo",
+ description="TOTO LETTER GA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E295,
+ },
+ [0x1E296]={
+ category="lo",
+ description="TOTO LETTER MA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E296,
+ },
+ [0x1E297]={
+ category="lo",
+ description="TOTO LETTER NA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E297,
+ },
+ [0x1E298]={
+ category="lo",
+ description="TOTO LETTER NGA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E298,
+ },
+ [0x1E299]={
+ category="lo",
+ description="TOTO LETTER SA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E299,
+ },
+ [0x1E29A]={
+ category="lo",
+ description="TOTO LETTER CHA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E29A,
+ },
+ [0x1E29B]={
+ category="lo",
+ description="TOTO LETTER YA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E29B,
+ },
+ [0x1E29C]={
+ category="lo",
+ description="TOTO LETTER WA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E29C,
+ },
+ [0x1E29D]={
+ category="lo",
+ description="TOTO LETTER JA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E29D,
+ },
+ [0x1E29E]={
+ category="lo",
+ description="TOTO LETTER HA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E29E,
+ },
+ [0x1E29F]={
+ category="lo",
+ description="TOTO LETTER RA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E29F,
+ },
+ [0x1E2A0]={
+ category="lo",
+ description="TOTO LETTER LA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E2A0,
+ },
+ [0x1E2A1]={
+ category="lo",
+ description="TOTO LETTER I",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E2A1,
+ },
+ [0x1E2A2]={
+ category="lo",
+ description="TOTO LETTER BREATHY I",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E2A2,
+ },
+ [0x1E2A3]={
+ category="lo",
+ description="TOTO LETTER IU",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E2A3,
+ },
+ [0x1E2A4]={
+ category="lo",
+ description="TOTO LETTER BREATHY IU",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E2A4,
+ },
+ [0x1E2A5]={
+ category="lo",
+ description="TOTO LETTER U",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E2A5,
+ },
+ [0x1E2A6]={
+ category="lo",
+ description="TOTO LETTER E",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E2A6,
+ },
+ [0x1E2A7]={
+ category="lo",
+ description="TOTO LETTER BREATHY E",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E2A7,
+ },
+ [0x1E2A8]={
+ category="lo",
+ description="TOTO LETTER EO",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E2A8,
+ },
+ [0x1E2A9]={
+ category="lo",
+ description="TOTO LETTER BREATHY EO",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E2A9,
+ },
+ [0x1E2AA]={
+ category="lo",
+ description="TOTO LETTER O",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E2AA,
+ },
+ [0x1E2AB]={
+ category="lo",
+ description="TOTO LETTER AE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E2AB,
+ },
+ [0x1E2AC]={
+ category="lo",
+ description="TOTO LETTER BREATHY AE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E2AC,
+ },
+ [0x1E2AD]={
+ category="lo",
+ description="TOTO LETTER A",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E2AD,
+ },
+ [0x1E2AE]={
+ category="mn",
+ combining=0xE6,
+ description="TOTO SIGN RISING TONE",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1E2AE,
+ },
[0x1E2C0]={
category="lo",
description="WANCHO LETTER AA",
@@ -236056,6 +243936,500 @@ characters.data={
linebreak="pr",
unicodeslot=0x1E2FF,
},
+ [0x1E4D0]={
+ category="lo",
+ description="NAG MUNDARI LETTER O",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4D0,
+ },
+ [0x1E4D1]={
+ category="lo",
+ description="NAG MUNDARI LETTER OP",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4D1,
+ },
+ [0x1E4D2]={
+ category="lo",
+ description="NAG MUNDARI LETTER OL",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4D2,
+ },
+ [0x1E4D3]={
+ category="lo",
+ description="NAG MUNDARI LETTER OY",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4D3,
+ },
+ [0x1E4D4]={
+ category="lo",
+ description="NAG MUNDARI LETTER ONG",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4D4,
+ },
+ [0x1E4D5]={
+ category="lo",
+ description="NAG MUNDARI LETTER A",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4D5,
+ },
+ [0x1E4D6]={
+ category="lo",
+ description="NAG MUNDARI LETTER AJ",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4D6,
+ },
+ [0x1E4D7]={
+ category="lo",
+ description="NAG MUNDARI LETTER AB",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4D7,
+ },
+ [0x1E4D8]={
+ category="lo",
+ description="NAG MUNDARI LETTER ANY",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4D8,
+ },
+ [0x1E4D9]={
+ category="lo",
+ description="NAG MUNDARI LETTER AH",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4D9,
+ },
+ [0x1E4DA]={
+ category="lo",
+ description="NAG MUNDARI LETTER I",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4DA,
+ },
+ [0x1E4DB]={
+ category="lo",
+ description="NAG MUNDARI LETTER IS",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4DB,
+ },
+ [0x1E4DC]={
+ category="lo",
+ description="NAG MUNDARI LETTER IDD",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4DC,
+ },
+ [0x1E4DD]={
+ category="lo",
+ description="NAG MUNDARI LETTER IT",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4DD,
+ },
+ [0x1E4DE]={
+ category="lo",
+ description="NAG MUNDARI LETTER IH",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4DE,
+ },
+ [0x1E4DF]={
+ category="lo",
+ description="NAG MUNDARI LETTER U",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4DF,
+ },
+ [0x1E4E0]={
+ category="lo",
+ description="NAG MUNDARI LETTER UC",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4E0,
+ },
+ [0x1E4E1]={
+ category="lo",
+ description="NAG MUNDARI LETTER UD",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4E1,
+ },
+ [0x1E4E2]={
+ category="lo",
+ description="NAG MUNDARI LETTER UK",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4E2,
+ },
+ [0x1E4E3]={
+ category="lo",
+ description="NAG MUNDARI LETTER UR",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4E3,
+ },
+ [0x1E4E4]={
+ category="lo",
+ description="NAG MUNDARI LETTER E",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4E4,
+ },
+ [0x1E4E5]={
+ category="lo",
+ description="NAG MUNDARI LETTER ENN",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4E5,
+ },
+ [0x1E4E6]={
+ category="lo",
+ description="NAG MUNDARI LETTER EG",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4E6,
+ },
+ [0x1E4E7]={
+ category="lo",
+ description="NAG MUNDARI LETTER EM",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4E7,
+ },
+ [0x1E4E8]={
+ category="lo",
+ description="NAG MUNDARI LETTER EN",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4E8,
+ },
+ [0x1E4E9]={
+ category="lo",
+ description="NAG MUNDARI LETTER ETT",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4E9,
+ },
+ [0x1E4EA]={
+ category="lo",
+ description="NAG MUNDARI LETTER ELL",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4EA,
+ },
+ [0x1E4EB]={
+ category="lm",
+ description="NAG MUNDARI SIGN OJOD",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E4EB,
+ },
+ [0x1E4EC]={
+ category="mn",
+ combining=0xE8,
+ description="NAG MUNDARI SIGN MUHOR",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1E4EC,
+ },
+ [0x1E4ED]={
+ category="mn",
+ combining=0xE8,
+ description="NAG MUNDARI SIGN TOYOR",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1E4ED,
+ },
+ [0x1E4EE]={
+ category="mn",
+ combining=0xDC,
+ description="NAG MUNDARI SIGN IKIR",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1E4EE,
+ },
+ [0x1E4EF]={
+ category="mn",
+ combining=0xE6,
+ description="NAG MUNDARI SIGN SUTUH",
+ direction="nsm",
+ linebreak="cm",
+ unicodeslot=0x1E4EF,
+ },
+ [0x1E4F0]={
+ category="nd",
+ description="NAG MUNDARI DIGIT ZERO",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x1E4F0,
+ },
+ [0x1E4F1]={
+ category="nd",
+ description="NAG MUNDARI DIGIT ONE",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x1E4F1,
+ },
+ [0x1E4F2]={
+ category="nd",
+ description="NAG MUNDARI DIGIT TWO",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x1E4F2,
+ },
+ [0x1E4F3]={
+ category="nd",
+ description="NAG MUNDARI DIGIT THREE",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x1E4F3,
+ },
+ [0x1E4F4]={
+ category="nd",
+ description="NAG MUNDARI DIGIT FOUR",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x1E4F4,
+ },
+ [0x1E4F5]={
+ category="nd",
+ description="NAG MUNDARI DIGIT FIVE",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x1E4F5,
+ },
+ [0x1E4F6]={
+ category="nd",
+ description="NAG MUNDARI DIGIT SIX",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x1E4F6,
+ },
+ [0x1E4F7]={
+ category="nd",
+ description="NAG MUNDARI DIGIT SEVEN",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x1E4F7,
+ },
+ [0x1E4F8]={
+ category="nd",
+ description="NAG MUNDARI DIGIT EIGHT",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x1E4F8,
+ },
+ [0x1E4F9]={
+ category="nd",
+ description="NAG MUNDARI DIGIT NINE",
+ direction="l",
+ linebreak="nu",
+ unicodeslot=0x1E4F9,
+ },
+ [0x1E7E0]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE HHYA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7E0,
+ },
+ [0x1E7E1]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE HHYU",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7E1,
+ },
+ [0x1E7E2]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE HHYI",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7E2,
+ },
+ [0x1E7E3]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE HHYAA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7E3,
+ },
+ [0x1E7E4]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE HHYEE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7E4,
+ },
+ [0x1E7E5]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE HHYE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7E5,
+ },
+ [0x1E7E6]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE HHYO",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7E6,
+ },
+ [0x1E7E8]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE GURAGE HHWA",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7E8,
+ },
+ [0x1E7E9]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE HHWI",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7E9,
+ },
+ [0x1E7EA]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE HHWEE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7EA,
+ },
+ [0x1E7EB]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE HHWE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7EB,
+ },
+ [0x1E7ED]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE GURAGE MWI",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7ED,
+ },
+ [0x1E7EE]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE GURAGE MWEE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7EE,
+ },
+ [0x1E7F0]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE GURAGE QWI",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7F0,
+ },
+ [0x1E7F1]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE GURAGE QWEE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7F1,
+ },
+ [0x1E7F2]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE GURAGE QWE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7F2,
+ },
+ [0x1E7F3]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE GURAGE BWI",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7F3,
+ },
+ [0x1E7F4]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE GURAGE BWEE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7F4,
+ },
+ [0x1E7F5]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE GURAGE KWI",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7F5,
+ },
+ [0x1E7F6]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE GURAGE KWEE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7F6,
+ },
+ [0x1E7F7]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE GURAGE KWE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7F7,
+ },
+ [0x1E7F8]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE GURAGE GWI",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7F8,
+ },
+ [0x1E7F9]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE GURAGE GWEE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7F9,
+ },
+ [0x1E7FA]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE GURAGE GWE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7FA,
+ },
+ [0x1E7FB]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE GURAGE FWI",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7FB,
+ },
+ [0x1E7FC]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE GURAGE FWEE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7FC,
+ },
+ [0x1E7FD]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE GURAGE PWI",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7FD,
+ },
+ [0x1E7FE]={
+ category="lo",
+ description="ETHIOPIC SYLLABLE GURAGE PWEE",
+ direction="l",
+ linebreak="al",
+ unicodeslot=0x1E7FE,
+ },
[0x1E800]={
category="lo",
description="MENDE KIKAKUI SYLLABLE M001 KI",
@@ -237559,6 +245933,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER ALIF",
direction="r",
+ lccode=0x1E922,
linebreak="al",
unicodeslot=0x1E900,
},
@@ -237567,6 +245942,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER DAALI",
direction="r",
+ lccode=0x1E923,
linebreak="al",
unicodeslot=0x1E901,
},
@@ -237575,6 +245951,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER LAAM",
direction="r",
+ lccode=0x1E924,
linebreak="al",
unicodeslot=0x1E902,
},
@@ -237583,6 +245960,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER MIIM",
direction="r",
+ lccode=0x1E925,
linebreak="al",
unicodeslot=0x1E903,
},
@@ -237591,6 +245969,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER BA",
direction="r",
+ lccode=0x1E926,
linebreak="al",
unicodeslot=0x1E904,
},
@@ -237599,6 +245978,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER SINNYIIYHE",
direction="r",
+ lccode=0x1E927,
linebreak="al",
unicodeslot=0x1E905,
},
@@ -237607,6 +245987,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER PE",
direction="r",
+ lccode=0x1E928,
linebreak="al",
unicodeslot=0x1E906,
},
@@ -237615,6 +245996,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER BHE",
direction="r",
+ lccode=0x1E929,
linebreak="al",
unicodeslot=0x1E907,
},
@@ -237623,6 +246005,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER RA",
direction="r",
+ lccode=0x1E92A,
linebreak="al",
unicodeslot=0x1E908,
},
@@ -237631,6 +246014,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER E",
direction="r",
+ lccode=0x1E92B,
linebreak="al",
unicodeslot=0x1E909,
},
@@ -237639,6 +246023,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER FA",
direction="r",
+ lccode=0x1E92C,
linebreak="al",
unicodeslot=0x1E90A,
},
@@ -237647,6 +246032,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER I",
direction="r",
+ lccode=0x1E92D,
linebreak="al",
unicodeslot=0x1E90B,
},
@@ -237655,6 +246041,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER O",
direction="r",
+ lccode=0x1E92E,
linebreak="al",
unicodeslot=0x1E90C,
},
@@ -237663,6 +246050,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER DHA",
direction="r",
+ lccode=0x1E92F,
linebreak="al",
unicodeslot=0x1E90D,
},
@@ -237671,6 +246059,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER YHE",
direction="r",
+ lccode=0x1E930,
linebreak="al",
unicodeslot=0x1E90E,
},
@@ -237679,6 +246068,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER WAW",
direction="r",
+ lccode=0x1E931,
linebreak="al",
unicodeslot=0x1E90F,
},
@@ -237687,6 +246077,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER NUN",
direction="r",
+ lccode=0x1E932,
linebreak="al",
unicodeslot=0x1E910,
},
@@ -237695,6 +246086,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER KAF",
direction="r",
+ lccode=0x1E933,
linebreak="al",
unicodeslot=0x1E911,
},
@@ -237703,6 +246095,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER YA",
direction="r",
+ lccode=0x1E934,
linebreak="al",
unicodeslot=0x1E912,
},
@@ -237711,6 +246104,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER U",
direction="r",
+ lccode=0x1E935,
linebreak="al",
unicodeslot=0x1E913,
},
@@ -237719,6 +246113,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER JIIM",
direction="r",
+ lccode=0x1E936,
linebreak="al",
unicodeslot=0x1E914,
},
@@ -237727,6 +246122,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER CHI",
direction="r",
+ lccode=0x1E937,
linebreak="al",
unicodeslot=0x1E915,
},
@@ -237735,6 +246131,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER HA",
direction="r",
+ lccode=0x1E938,
linebreak="al",
unicodeslot=0x1E916,
},
@@ -237743,6 +246140,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER QAAF",
direction="r",
+ lccode=0x1E939,
linebreak="al",
unicodeslot=0x1E917,
},
@@ -237751,6 +246149,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER GA",
direction="r",
+ lccode=0x1E93A,
linebreak="al",
unicodeslot=0x1E918,
},
@@ -237759,6 +246158,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER NYA",
direction="r",
+ lccode=0x1E93B,
linebreak="al",
unicodeslot=0x1E919,
},
@@ -237767,6 +246167,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER TU",
direction="r",
+ lccode=0x1E93C,
linebreak="al",
unicodeslot=0x1E91A,
},
@@ -237775,6 +246176,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER NHA",
direction="r",
+ lccode=0x1E93D,
linebreak="al",
unicodeslot=0x1E91B,
},
@@ -237783,6 +246185,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER VA",
direction="r",
+ lccode=0x1E93E,
linebreak="al",
unicodeslot=0x1E91C,
},
@@ -237791,6 +246194,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER KHA",
direction="r",
+ lccode=0x1E93F,
linebreak="al",
unicodeslot=0x1E91D,
},
@@ -237799,6 +246203,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER GBE",
direction="r",
+ lccode=0x1E940,
linebreak="al",
unicodeslot=0x1E91E,
},
@@ -237807,6 +246212,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER ZAL",
direction="r",
+ lccode=0x1E941,
linebreak="al",
unicodeslot=0x1E91F,
},
@@ -237815,6 +246221,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER KPO",
direction="r",
+ lccode=0x1E942,
linebreak="al",
unicodeslot=0x1E920,
},
@@ -237823,6 +246230,7 @@ characters.data={
category="lu",
description="ADLAM CAPITAL LETTER SHA",
direction="r",
+ lccode=0x1E943,
linebreak="al",
unicodeslot=0x1E921,
},
@@ -251950,6 +260358,38 @@ characters.data={
linebreak="id",
unicodeslot=0x1F6D7,
},
+ [0x1F6DC]={
+ category="so",
+ cjkwd="w",
+ description="WIRELESS",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F6DC,
+ },
+ [0x1F6DD]={
+ category="so",
+ cjkwd="w",
+ description="PLAYGROUND SLIDE",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F6DD,
+ },
+ [0x1F6DE]={
+ category="so",
+ cjkwd="w",
+ description="WHEEL",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F6DE,
+ },
+ [0x1F6DF]={
+ category="so",
+ cjkwd="w",
+ description="RING BUOY",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F6DF,
+ },
[0x1F6E0]={
category="so",
description="HAMMER AND WRENCH",
@@ -252964,6 +261404,62 @@ characters.data={
linebreak="al",
unicodeslot=0x1F773,
},
+ [0x1F774]={
+ category="so",
+ description="LOT OF FORTUNE",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F774,
+ },
+ [0x1F775]={
+ category="so",
+ description="OCCULTATION",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F775,
+ },
+ [0x1F776]={
+ category="so",
+ description="LUNAR ECLIPSE",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F776,
+ },
+ [0x1F77B]={
+ category="so",
+ description="HAUMEA",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F77B,
+ },
+ [0x1F77C]={
+ category="so",
+ description="MAKEMAKE",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F77C,
+ },
+ [0x1F77D]={
+ category="so",
+ description="GONGGONG",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F77D,
+ },
+ [0x1F77E]={
+ category="so",
+ description="QUAOAR",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F77E,
+ },
+ [0x1F77F]={
+ category="so",
+ description="ORCUS",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F77F,
+ },
[0x1F780]={
category="so",
description="BLACK LEFT-POINTING ISOSCELES RIGHT TRIANGLE",
@@ -253588,6 +262084,13 @@ characters.data={
linebreak="id",
unicodeslot=0x1F7D8,
},
+ [0x1F7D9]={
+ category="so",
+ description="NINE POINTED WHITE STAR",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F7D9,
+ },
[0x1F7E0]={
category="so",
cjkwd="w",
@@ -253684,6 +262187,14 @@ characters.data={
linebreak="id",
unicodeslot=0x1F7EB,
},
+ [0x1F7F0]={
+ category="so",
+ cjkwd="w",
+ description="HEAVY EQUALS SIGN",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F7F0,
+ },
[0x1F800]={
category="so",
description="LEFTWARDS ARROW WITH SMALL TRIANGLE ARROWHEAD",
@@ -255696,6 +264207,14 @@ characters.data={
synonyms={ "face with groucho glasses" },
unicodeslot=0x1F978,
},
+ [0x1F979]={
+ category="so",
+ cjkwd="w",
+ description="FACE HOLDING BACK TEARS",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F979,
+ },
[0x1F97A]={
category="so",
cjkwd="w",
@@ -256353,6 +264872,14 @@ characters.data={
linebreak="id",
unicodeslot=0x1F9CB,
},
+ [0x1F9CC]={
+ category="so",
+ cjkwd="w",
+ description="TROLL",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1F9CC,
+ },
[0x1F9CD]={
category="so",
cjkwd="w",
@@ -257487,6 +266014,30 @@ characters.data={
linebreak="id",
unicodeslot=0x1FA74,
},
+ [0x1FA75]={
+ category="so",
+ cjkwd="w",
+ description="LIGHT BLUE HEART",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FA75,
+ },
+ [0x1FA76]={
+ category="so",
+ cjkwd="w",
+ description="GREY HEART",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FA76,
+ },
+ [0x1FA77]={
+ category="so",
+ cjkwd="w",
+ description="PINK HEART",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FA77,
+ },
[0x1FA78]={
category="so",
cjkwd="w",
@@ -257511,6 +266062,22 @@ characters.data={
linebreak="id",
unicodeslot=0x1FA7A,
},
+ [0x1FA7B]={
+ category="so",
+ cjkwd="w",
+ description="X-RAY",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FA7B,
+ },
+ [0x1FA7C]={
+ category="so",
+ cjkwd="w",
+ description="CRUTCH",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FA7C,
+ },
[0x1FA80]={
category="so",
cjkwd="w",
@@ -257567,6 +266134,22 @@ characters.data={
linebreak="id",
unicodeslot=0x1FA86,
},
+ [0x1FA87]={
+ category="so",
+ cjkwd="w",
+ description="MARACAS",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FA87,
+ },
+ [0x1FA88]={
+ category="so",
+ cjkwd="w",
+ description="FLUTE",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FA88,
+ },
[0x1FA90]={
category="so",
cjkwd="w",
@@ -257767,6 +266350,62 @@ characters.data={
linebreak="id",
unicodeslot=0x1FAA8,
},
+ [0x1FAA9]={
+ category="so",
+ cjkwd="w",
+ description="MIRROR BALL",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAA9,
+ },
+ [0x1FAAA]={
+ category="so",
+ cjkwd="w",
+ description="IDENTIFICATION CARD",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAAA,
+ },
+ [0x1FAAB]={
+ category="so",
+ cjkwd="w",
+ description="LOW BATTERY",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAAB,
+ },
+ [0x1FAAC]={
+ category="so",
+ cjkwd="w",
+ description="HAMSA",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAAC,
+ },
+ [0x1FAAD]={
+ category="so",
+ cjkwd="w",
+ description="FOLDING HAND FAN",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAAD,
+ },
+ [0x1FAAE]={
+ category="so",
+ cjkwd="w",
+ description="HAIR PICK",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAAE,
+ },
+ [0x1FAAF]={
+ category="so",
+ cjkwd="w",
+ description="KHANDA",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAAF,
+ },
[0x1FAB0]={
category="so",
cjkwd="w",
@@ -257823,6 +266462,70 @@ characters.data={
linebreak="id",
unicodeslot=0x1FAB6,
},
+ [0x1FAB7]={
+ category="so",
+ cjkwd="w",
+ description="LOTUS",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAB7,
+ },
+ [0x1FAB8]={
+ category="so",
+ cjkwd="w",
+ description="CORAL",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAB8,
+ },
+ [0x1FAB9]={
+ category="so",
+ cjkwd="w",
+ description="EMPTY NEST",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAB9,
+ },
+ [0x1FABA]={
+ category="so",
+ cjkwd="w",
+ description="NEST WITH EGGS",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FABA,
+ },
+ [0x1FABB]={
+ category="so",
+ cjkwd="w",
+ description="HYACINTH",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FABB,
+ },
+ [0x1FABC]={
+ category="so",
+ cjkwd="w",
+ description="JELLYFISH",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FABC,
+ },
+ [0x1FABD]={
+ category="so",
+ cjkwd="w",
+ description="WING",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FABD,
+ },
+ [0x1FABF]={
+ category="so",
+ cjkwd="w",
+ description="GOOSE",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FABF,
+ },
[0x1FAC0]={
category="so",
cjkwd="w",
@@ -257847,6 +266550,46 @@ characters.data={
linebreak="id",
unicodeslot=0x1FAC2,
},
+ [0x1FAC3]={
+ category="so",
+ cjkwd="w",
+ description="PREGNANT MAN",
+ direction="on",
+ linebreak="eb",
+ unicodeslot=0x1FAC3,
+ },
+ [0x1FAC4]={
+ category="so",
+ cjkwd="w",
+ description="PREGNANT PERSON",
+ direction="on",
+ linebreak="eb",
+ unicodeslot=0x1FAC4,
+ },
+ [0x1FAC5]={
+ category="so",
+ cjkwd="w",
+ description="PERSON WITH CROWN",
+ direction="on",
+ linebreak="eb",
+ unicodeslot=0x1FAC5,
+ },
+ [0x1FACE]={
+ category="so",
+ cjkwd="w",
+ description="MOOSE",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FACE,
+ },
+ [0x1FACF]={
+ category="so",
+ cjkwd="w",
+ description="DONKEY",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FACF,
+ },
[0x1FAD0]={
category="so",
cjkwd="w",
@@ -257903,6 +266646,190 @@ characters.data={
linebreak="id",
unicodeslot=0x1FAD6,
},
+ [0x1FAD7]={
+ category="so",
+ cjkwd="w",
+ description="POURING LIQUID",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAD7,
+ },
+ [0x1FAD8]={
+ category="so",
+ cjkwd="w",
+ description="BEANS",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAD8,
+ },
+ [0x1FAD9]={
+ category="so",
+ cjkwd="w",
+ description="JAR",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAD9,
+ },
+ [0x1FADA]={
+ category="so",
+ cjkwd="w",
+ description="GINGER ROOT",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FADA,
+ },
+ [0x1FADB]={
+ category="so",
+ cjkwd="w",
+ description="PEA POD",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FADB,
+ },
+ [0x1FAE0]={
+ category="so",
+ cjkwd="w",
+ description="MELTING FACE",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAE0,
+ },
+ [0x1FAE1]={
+ category="so",
+ cjkwd="w",
+ description="SALUTING FACE",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAE1,
+ },
+ [0x1FAE2]={
+ category="so",
+ cjkwd="w",
+ description="FACE WITH OPEN EYES AND HAND OVER MOUTH",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAE2,
+ },
+ [0x1FAE3]={
+ category="so",
+ cjkwd="w",
+ description="FACE WITH PEEKING EYE",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAE3,
+ },
+ [0x1FAE4]={
+ category="so",
+ cjkwd="w",
+ description="FACE WITH DIAGONAL MOUTH",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAE4,
+ },
+ [0x1FAE5]={
+ category="so",
+ cjkwd="w",
+ description="DOTTED LINE FACE",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAE5,
+ },
+ [0x1FAE6]={
+ category="so",
+ cjkwd="w",
+ description="BITING LIP",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAE6,
+ },
+ [0x1FAE7]={
+ category="so",
+ cjkwd="w",
+ description="BUBBLES",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAE7,
+ },
+ [0x1FAE8]={
+ category="so",
+ cjkwd="w",
+ description="SHAKING FACE",
+ direction="on",
+ linebreak="id",
+ unicodeslot=0x1FAE8,
+ },
+ [0x1FAF0]={
+ category="so",
+ cjkwd="w",
+ description="HAND WITH INDEX FINGER AND THUMB CROSSED",
+ direction="on",
+ linebreak="eb",
+ unicodeslot=0x1FAF0,
+ },
+ [0x1FAF1]={
+ category="so",
+ cjkwd="w",
+ description="RIGHTWARDS HAND",
+ direction="on",
+ linebreak="eb",
+ unicodeslot=0x1FAF1,
+ },
+ [0x1FAF2]={
+ category="so",
+ cjkwd="w",
+ description="LEFTWARDS HAND",
+ direction="on",
+ linebreak="eb",
+ unicodeslot=0x1FAF2,
+ },
+ [0x1FAF3]={
+ category="so",
+ cjkwd="w",
+ description="PALM DOWN HAND",
+ direction="on",
+ linebreak="eb",
+ unicodeslot=0x1FAF3,
+ },
+ [0x1FAF4]={
+ category="so",
+ cjkwd="w",
+ description="PALM UP HAND",
+ direction="on",
+ linebreak="eb",
+ unicodeslot=0x1FAF4,
+ },
+ [0x1FAF5]={
+ category="so",
+ cjkwd="w",
+ description="INDEX POINTING AT THE VIEWER",
+ direction="on",
+ linebreak="eb",
+ unicodeslot=0x1FAF5,
+ },
+ [0x1FAF6]={
+ category="so",
+ cjkwd="w",
+ description="HEART HANDS",
+ direction="on",
+ linebreak="eb",
+ unicodeslot=0x1FAF6,
+ },
+ [0x1FAF7]={
+ category="so",
+ cjkwd="w",
+ description="LEFTWARDS PUSHING HAND",
+ direction="on",
+ linebreak="eb",
+ unicodeslot=0x1FAF7,
+ },
+ [0x1FAF8]={
+ category="so",
+ cjkwd="w",
+ description="RIGHTWARDS PUSHING HAND",
+ direction="on",
+ linebreak="eb",
+ unicodeslot=0x1FAF8,
+ },
[0x1FB00]={
category="so",
description="BLOCK SEXTANT-1",
diff --git a/Master/texmf-dist/tex/context/base/mkiv/char-fio.lua b/Master/texmf-dist/tex/context/base/mkiv/char-fio.lua
index b1f652eedb0..2b0fe42cee3 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/char-fio.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/char-fio.lua
@@ -38,8 +38,8 @@ disableaction(textfileactions, "characters.filters.utf.decompose")
local report = logs.reporter("unicode filter")
local reporting = "no"
--- this is messy as for performance reasons i don't want this to happen
--- per line by default
+-- This is messy as for performance reasons i don't want this to happen per line by
+-- default.
local enforced = {
["characters.filters.utf.collapse"] = true,
diff --git a/Master/texmf-dist/tex/context/base/mkiv/char-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/char-ini.lua
index ac31dbfc60c..db1b85cc5d1 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/char-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/char-ini.lua
@@ -47,9 +47,9 @@ loaded!</p>
-- todo: in 'char-def.lua' assume defaults:
--
--- directtions = l
--- cjkwd = a
--- linebreak = al
+-- directions = l
+-- cjkwd = a
+-- linebreak = al
characters = characters or { }
local characters = characters
@@ -66,9 +66,17 @@ end
Extending the table.
--ldx]]--
-if context and not characters.private then
+if context and CONTEXTLMTXMODE == 0 then
- require("char-prv")
+ if not characters.private then
+
+ require("char-prv")
+
+ if storage then
+ storage.register("characters/private", characters.private, "characters.private")
+ end
+
+ end
for unicode, d in next, characters.private do
data[unicode] = d
@@ -193,379 +201,411 @@ insert(characters.ranges,{
})
local blocks = allocate {
- ["adlam"] = { first = 0x1E900, last = 0x1E95F, description = "Adlam" },
- ["aegeannumbers"] = { first = 0x10100, last = 0x1013F, description = "Aegean Numbers" },
- ["ahom"] = { first = 0x11700, last = 0x1173F, description = "Ahom" },
- ["alchemicalsymbols"] = { first = 0x1F700, last = 0x1F77F, description = "Alchemical Symbols" },
- ["alphabeticpresentationforms"] = { first = 0x0FB00, last = 0x0FB4F, otf="latn", description = "Alphabetic Presentation Forms" },
- ["anatolianhieroglyphs"] = { first = 0x14400, last = 0x1467F, description = "Anatolian Hieroglyphs" },
- ["ancientgreekmusicalnotation"] = { first = 0x1D200, last = 0x1D24F, otf="grek", description = "Ancient Greek Musical Notation" },
- ["ancientgreeknumbers"] = { first = 0x10140, last = 0x1018F, otf="grek", description = "Ancient Greek Numbers" },
- ["ancientsymbols"] = { first = 0x10190, last = 0x101CF, otf="grek", description = "Ancient Symbols" },
- ["arabic"] = { first = 0x00600, last = 0x006FF, otf="arab", description = "Arabic" },
- ["arabicextendeda"] = { first = 0x008A0, last = 0x008FF, description = "Arabic Extended-A" },
- ["arabicmathematicalalphabeticsymbols"] = { first = 0x1EE00, last = 0x1EEFF, description = "Arabic Mathematical Alphabetic Symbols" },
- ["arabicpresentationformsa"] = { first = 0x0FB50, last = 0x0FDFF, otf="arab", description = "Arabic Presentation Forms-A" },
- ["arabicpresentationformsb"] = { first = 0x0FE70, last = 0x0FEFF, otf="arab", description = "Arabic Presentation Forms-B" },
- ["arabicsupplement"] = { first = 0x00750, last = 0x0077F, otf="arab", description = "Arabic Supplement" },
- ["armenian"] = { first = 0x00530, last = 0x0058F, otf="armn", description = "Armenian" },
- ["arrows"] = { first = 0x02190, last = 0x021FF, description = "Arrows" },
- ["avestan"] = { first = 0x10B00, last = 0x10B3F, description = "Avestan" },
- ["balinese"] = { first = 0x01B00, last = 0x01B7F, otf="bali", description = "Balinese" },
- ["bamum"] = { first = 0x0A6A0, last = 0x0A6FF, description = "Bamum" },
- ["bamumsupplement"] = { first = 0x16800, last = 0x16A3F, description = "Bamum Supplement" },
- ["basiclatin"] = { first = 0x00000, last = 0x0007F, otf="latn", description = "Basic Latin" },
- ["bassavah"] = { first = 0x16AD0, last = 0x16AFF, description = "Bassa Vah" },
- ["batak"] = { first = 0x01BC0, last = 0x01BFF, description = "Batak" },
- ["bengali"] = { first = 0x00980, last = 0x009FF, otf="beng", description = "Bengali" },
- ["bhaiksuki"] = { first = 0x11C00, last = 0x11C6F, description = "Bhaiksuki" },
- ["blockelements"] = { first = 0x02580, last = 0x0259F, otf="bopo", description = "Block Elements" },
- ["bopomofo"] = { first = 0x03100, last = 0x0312F, otf="bopo", description = "Bopomofo" },
- ["bopomofoextended"] = { first = 0x031A0, last = 0x031BF, otf="bopo", description = "Bopomofo Extended" },
- ["boxdrawing"] = { first = 0x02500, last = 0x0257F, description = "Box Drawing" },
- ["brahmi"] = { first = 0x11000, last = 0x1107F, description = "Brahmi" },
- ["braillepatterns"] = { first = 0x02800, last = 0x028FF, otf="brai", description = "Braille Patterns" },
- ["buginese"] = { first = 0x01A00, last = 0x01A1F, otf="bugi", description = "Buginese" },
- ["buhid"] = { first = 0x01740, last = 0x0175F, otf="buhd", description = "Buhid" },
- ["byzantinemusicalsymbols"] = { first = 0x1D000, last = 0x1D0FF, otf="byzm", description = "Byzantine Musical Symbols" },
- ["carian"] = { first = 0x102A0, last = 0x102DF, description = "Carian" },
- ["caucasianalbanian"] = { first = 0x10530, last = 0x1056F, description = "Caucasian Albanian" },
- ["chakma"] = { first = 0x11100, last = 0x1114F, description = "Chakma" },
- ["cham"] = { first = 0x0AA00, last = 0x0AA5F, description = "Cham" },
- ["cherokee"] = { first = 0x013A0, last = 0x013FF, otf="cher", description = "Cherokee" },
- ["cherokeesupplement"] = { first = 0x0AB70, last = 0x0ABBF, description = "Cherokee Supplement" },
- ["chesssymbols"] = { first = 0x1FA00, last = 0x1FA6F, description = "Chess Symbols" },
- ["chorasmian"] = { first = 0x10FB0, last = 0x10FDF, description = "Chorasmian" },
- ["cjkcompatibility"] = { first = 0x03300, last = 0x033FF, otf="hang", description = "CJK Compatibility" },
- ["cjkcompatibilityforms"] = { first = 0x0FE30, last = 0x0FE4F, otf="hang", description = "CJK Compatibility Forms" },
- ["cjkcompatibilityideographs"] = { first = 0x0F900, last = 0x0FAFF, otf="hang", description = "CJK Compatibility Ideographs" },
- ["cjkcompatibilityideographssupplement"] = { first = 0x2F800, last = 0x2FA1F, otf="hang", description = "CJK Compatibility Ideographs Supplement" },
- ["cjkradicalssupplement"] = { first = 0x02E80, last = 0x02EFF, otf="hang", description = "CJK Radicals Supplement" },
- ["cjkstrokes"] = { first = 0x031C0, last = 0x031EF, otf="hang", description = "CJK Strokes" },
- ["cjksymbolsandpunctuation"] = { first = 0x03000, last = 0x0303F, otf="hang", description = "CJK Symbols and Punctuation" },
- ["cjkunifiedideographs"] = { first = 0x04E00, last = 0x09FFF, otf="hang", description = "CJK Unified Ideographs", catcode = "letter" },
- ["cjkunifiedideographsextensiona"] = { first = 0x03400, last = 0x04DBF, otf="hang", description = "CJK Unified Ideographs Extension A" },
- ["cjkunifiedideographsextensionb"] = { first = 0x20000, last = 0x2A6DF, otf="hang", description = "CJK Unified Ideographs Extension B" },
- ["cjkunifiedideographsextensionc"] = { first = 0x2A700, last = 0x2B73F, description = "CJK Unified Ideographs Extension C" },
- ["cjkunifiedideographsextensiond"] = { first = 0x2B740, last = 0x2B81F, description = "CJK Unified Ideographs Extension D" },
- ["cjkunifiedideographsextensione"] = { first = 0x2B820, last = 0x2CEAF, description = "CJK Unified Ideographs Extension E" },
- ["cjkunifiedideographsextensionf"] = { first = 0x2CEB0, last = 0x2EBEF, description = "CJK Unified Ideographs Extension F" },
- ["cjkunifiedideographsextensiong"] = { first = 0x30000, last = 0x3134F, description = "CJK Unified Ideographs Extension G" },
- ["combiningdiacriticalmarks"] = { first = 0x00300, last = 0x0036F, description = "Combining Diacritical Marks" },
- ["combiningdiacriticalmarksextended"] = { first = 0x01AB0, last = 0x01AFF, description = "Combining Diacritical Marks Extended" },
- ["combiningdiacriticalmarksforsymbols"] = { first = 0x020D0, last = 0x020FF, description = "Combining Diacritical Marks for Symbols" },
- ["combiningdiacriticalmarkssupplement"] = { first = 0x01DC0, last = 0x01DFF, description = "Combining Diacritical Marks Supplement" },
- ["combininghalfmarks"] = { first = 0x0FE20, last = 0x0FE2F, description = "Combining Half Marks" },
- ["commonindicnumberforms"] = { first = 0x0A830, last = 0x0A83F, description = "Common Indic Number Forms" },
- ["controlpictures"] = { first = 0x02400, last = 0x0243F, description = "Control Pictures" },
- ["coptic"] = { first = 0x02C80, last = 0x02CFF, otf="copt", description = "Coptic" },
- ["copticepactnumbers"] = { first = 0x102E0, last = 0x102FF, description = "Coptic Epact Numbers" },
- ["countingrodnumerals"] = { first = 0x1D360, last = 0x1D37F, description = "Counting Rod Numerals" },
- ["cuneiform"] = { first = 0x12000, last = 0x123FF, otf="xsux", description = "Cuneiform" },
- ["cuneiformnumbersandpunctuation"] = { first = 0x12400, last = 0x1247F, otf="xsux", description = "Cuneiform Numbers and Punctuation" },
- ["currencysymbols"] = { first = 0x020A0, last = 0x020CF, description = "Currency Symbols" },
- ["cypriotsyllabary"] = { first = 0x10800, last = 0x1083F, otf="cprt", description = "Cypriot Syllabary" },
- ["cyrillic"] = { first = 0x00400, last = 0x004FF, otf="cyrl", description = "Cyrillic" },
- ["cyrillicextendeda"] = { first = 0x02DE0, last = 0x02DFF, otf="cyrl", description = "Cyrillic Extended-A" },
- ["cyrillicextendedb"] = { first = 0x0A640, last = 0x0A69F, otf="cyrl", description = "Cyrillic Extended-B" },
- ["cyrillicextendedc"] = { first = 0x01C80, last = 0x01C8F, description = "Cyrillic Extended-C" },
- ["cyrillicsupplement"] = { first = 0x00500, last = 0x0052F, otf="cyrl", description = "Cyrillic Supplement" },
- ["deseret"] = { first = 0x10400, last = 0x1044F, otf="dsrt", description = "Deseret" },
- ["devanagari"] = { first = 0x00900, last = 0x0097F, otf="deva", description = "Devanagari" },
- ["devanagariextended"] = { first = 0x0A8E0, last = 0x0A8FF, description = "Devanagari Extended" },
- ["digitsarabicindic"] = { first = 0x00660, last = 0x00669, math = true },
- -- ["digitsbengali"] = { first = 0x009E6, last = 0x009EF, math = true },
- ["digitsbold"] = { first = 0x1D7CE, last = 0x1D7D8, math = true },
- -- ["digitsdevanagari"] = { first = 0x00966, last = 0x0096F, math = true },
- ["digitsdoublestruck"] = { first = 0x1D7D8, last = 0x1D7E2, math = true },
- -- ["digitsethiopic"] = { first = 0x01369, last = 0x01371, math = true },
- ["digitsextendedarabicindic"] = { first = 0x006F0, last = 0x006F9, math = true },
- -- ["digitsgujarati"] = { first = 0x00AE6, last = 0x00AEF, math = true },
- -- ["digitsgurmukhi"] = { first = 0x00A66, last = 0x00A6F, math = true },
- -- ["digitskannada"] = { first = 0x00CE6, last = 0x00CEF, math = true },
- -- ["digitskhmer"] = { first = 0x017E0, last = 0x017E9, math = true },
- -- ["digitslao"] = { first = 0x00ED0, last = 0x00ED9, math = true },
- ["digitslatin"] = { first = 0x00030, last = 0x00039, math = true },
- -- ["digitsmalayalam"] = { first = 0x00D66, last = 0x00D6F, math = true },
- -- ["digitsmongolian"] = { first = 0x01810, last = 0x01809, math = true },
- ["digitsmonospace"] = { first = 0x1D7F6, last = 0x1D80F, math = true },
- -- ["digitsmyanmar"] = { first = 0x01040, last = 0x01049, math = true },
- ["digitsnormal"] = { first = 0x00030, last = 0x00039, math = true },
- -- ["digitsoriya"] = { first = 0x00B66, last = 0x00B6F, math = true },
- ["digitssansserifbold"] = { first = 0x1D7EC, last = 0x1D805, math = true },
- ["digitssansserifnormal"] = { first = 0x1D7E2, last = 0x1D7EC, math = true },
- -- ["digitstamil"] = { first = 0x00030, last = 0x00039, math = true }, -- no zero
- -- ["digitstelugu"] = { first = 0x00C66, last = 0x00C6F, math = true },
- -- ["digitsthai"] = { first = 0x00E50, last = 0x00E59, math = true },
- -- ["digitstibetan"] = { first = 0x00F20, last = 0x00F29, math = true },
- ["dingbats"] = { first = 0x02700, last = 0x027BF, description = "Dingbats" },
- ["divesakuru"] = { first = 0x11900, last = 0x1195F, description = "Dives Akuru" },
- ["dogra"] = { first = 0x11800, last = 0x1184F, description = "Dogra" },
- ["dominotiles"] = { first = 0x1F030, last = 0x1F09F, description = "Domino Tiles" },
- ["duployan"] = { first = 0x1BC00, last = 0x1BC9F, description = "Duployan" },
- ["earlydynasticcuneiform"] = { first = 0x12480, last = 0x1254F, description = "Early Dynastic Cuneiform" },
- ["egyptianhieroglyphformatcontrols"] = { first = 0x13430, last = 0x1343F, description = "Egyptian Hieroglyph Format Controls" },
- ["egyptianhieroglyphs"] = { first = 0x13000, last = 0x1342F, description = "Egyptian Hieroglyphs" },
- ["elbasan"] = { first = 0x10500, last = 0x1052F, description = "Elbasan" },
- ["elymaic"] = { first = 0x10FE0, last = 0x10FFF, description = "Elymaic" },
- ["emoticons"] = { first = 0x1F600, last = 0x1F64F, description = "Emoticons" },
- ["enclosedalphanumerics"] = { first = 0x02460, last = 0x024FF, description = "Enclosed Alphanumerics" },
- ["enclosedalphanumericsupplement"] = { first = 0x1F100, last = 0x1F1FF, description = "Enclosed Alphanumeric Supplement" },
- ["enclosedcjklettersandmonths"] = { first = 0x03200, last = 0x032FF, description = "Enclosed CJK Letters and Months" },
- ["enclosedideographicsupplement"] = { first = 0x1F200, last = 0x1F2FF, description = "Enclosed Ideographic Supplement" },
- ["ethiopic"] = { first = 0x01200, last = 0x0137F, otf="ethi", description = "Ethiopic" },
- ["ethiopicextended"] = { first = 0x02D80, last = 0x02DDF, otf="ethi", description = "Ethiopic Extended" },
- ["ethiopicextendeda"] = { first = 0x0AB00, last = 0x0AB2F, description = "Ethiopic Extended-A" },
- ["ethiopicsupplement"] = { first = 0x01380, last = 0x0139F, otf="ethi", description = "Ethiopic Supplement" },
- ["generalpunctuation"] = { first = 0x02000, last = 0x0206F, description = "General Punctuation" },
- ["geometricshapes"] = { first = 0x025A0, last = 0x025FF, math = true, description = "Geometric Shapes" },
- ["geometricshapesextended"] = { first = 0x1F780, last = 0x1F7FF, description = "Geometric Shapes Extended" },
- ["georgian"] = { first = 0x010A0, last = 0x010FF, otf="geor", description = "Georgian" },
- ["georgianextended"] = { first = 0x01C90, last = 0x01CBF, description = "Georgian Extended" },
- ["georgiansupplement"] = { first = 0x02D00, last = 0x02D2F, otf="geor", description = "Georgian Supplement" },
- ["glagolitic"] = { first = 0x02C00, last = 0x02C5F, otf="glag", description = "Glagolitic" },
- ["glagoliticsupplement"] = { first = 0x1E000, last = 0x1E02F, description = "Glagolitic Supplement" },
- ["gothic"] = { first = 0x10330, last = 0x1034F, otf="goth", description = "Gothic" },
- ["grantha"] = { first = 0x11300, last = 0x1137F, description = "Grantha" },
- ["greekandcoptic"] = { first = 0x00370, last = 0x003FF, otf="grek", description = "Greek and Coptic" },
- ["greekextended"] = { first = 0x01F00, last = 0x01FFF, otf="grek", description = "Greek Extended" },
- ["gujarati"] = { first = 0x00A80, last = 0x00AFF, otf="gujr", description = "Gujarati" },
- ["gunjalagondi"] = { first = 0x11D60, last = 0x11DAF, description = "Gunjala Gondi" },
- ["gurmukhi"] = { first = 0x00A00, last = 0x00A7F, otf="guru", description = "Gurmukhi" },
- ["halfwidthandfullwidthforms"] = { first = 0x0FF00, last = 0x0FFEF, description = "Halfwidth and Fullwidth Forms" },
- ["hangulcompatibilityjamo"] = { first = 0x03130, last = 0x0318F, otf="jamo", description = "Hangul Compatibility Jamo" },
- ["hanguljamo"] = { first = 0x01100, last = 0x011FF, otf="jamo", description = "Hangul Jamo" },
- ["hanguljamoextendeda"] = { first = 0x0A960, last = 0x0A97F, description = "Hangul Jamo Extended-A" },
- ["hanguljamoextendedb"] = { first = 0x0D7B0, last = 0x0D7FF, description = "Hangul Jamo Extended-B" },
- ["hangulsyllables"] = { first = 0x0AC00, last = 0x0D7AF, otf="hang", description = "Hangul Syllables" },
- ["hanifirohingya"] = { first = 0x10D00, last = 0x10D3F, description = "Hanifi Rohingya" },
- ["hanunoo"] = { first = 0x01720, last = 0x0173F, otf="hano", description = "Hanunoo" },
- ["hatran"] = { first = 0x108E0, last = 0x108FF, description = "Hatran" },
- ["hebrew"] = { first = 0x00590, last = 0x005FF, otf="hebr", description = "Hebrew" },
- ["highprivateusesurrogates"] = { first = 0x0DB80, last = 0x0DBFF, description = "High Private Use Surrogates" },
- ["highsurrogates"] = { first = 0x0D800, last = 0x0DB7F, description = "High Surrogates" },
- ["hiragana"] = { first = 0x03040, last = 0x0309F, otf="kana", description = "Hiragana" },
- ["ideographicdescriptioncharacters"] = { first = 0x02FF0, last = 0x02FFF, description = "Ideographic Description Characters" },
- ["ideographicsymbolsandpunctuation"] = { first = 0x16FE0, last = 0x16FFF, description = "Ideographic Symbols and Punctuation" },
- ["imperialaramaic"] = { first = 0x10840, last = 0x1085F, description = "Imperial Aramaic" },
- ["indicsiyaqnumbers"] = { first = 0x1EC70, last = 0x1ECBF, description = "Indic Siyaq Numbers" },
- ["inscriptionalpahlavi"] = { first = 0x10B60, last = 0x10B7F, description = "Inscriptional Pahlavi" },
- ["inscriptionalparthian"] = { first = 0x10B40, last = 0x10B5F, description = "Inscriptional Parthian" },
- ["ipaextensions"] = { first = 0x00250, last = 0x002AF, description = "IPA Extensions" },
- ["javanese"] = { first = 0x0A980, last = 0x0A9DF, description = "Javanese" },
- ["kaithi"] = { first = 0x11080, last = 0x110CF, description = "Kaithi" },
- ["kanaextendeda"] = { first = 0x1B100, last = 0x1B12F, description = "Kana Extended-A" },
- ["kanasupplement"] = { first = 0x1B000, last = 0x1B0FF, description = "Kana Supplement" },
- ["kanbun"] = { first = 0x03190, last = 0x0319F, description = "Kanbun" },
- ["kangxiradicals"] = { first = 0x02F00, last = 0x02FDF, description = "Kangxi Radicals" },
- ["kannada"] = { first = 0x00C80, last = 0x00CFF, otf="knda", description = "Kannada" },
- ["katakana"] = { first = 0x030A0, last = 0x030FF, otf="kana", description = "Katakana" },
- ["katakanaphoneticextensions"] = { first = 0x031F0, last = 0x031FF, otf="kana", description = "Katakana Phonetic Extensions" },
- ["kayahli"] = { first = 0x0A900, last = 0x0A92F, description = "Kayah Li" },
- ["kharoshthi"] = { first = 0x10A00, last = 0x10A5F, otf="khar", description = "Kharoshthi" },
- ["khitansmallscript"] = { first = 0x18B00, last = 0x18CFF, description = "Khitan Small Script" },
- ["khmer"] = { first = 0x01780, last = 0x017FF, otf="khmr", description = "Khmer" },
- ["khmersymbols"] = { first = 0x019E0, last = 0x019FF, otf="khmr", description = "Khmer Symbols" },
- ["khojki"] = { first = 0x11200, last = 0x1124F, description = "Khojki" },
- ["khudawadi"] = { first = 0x112B0, last = 0x112FF, description = "Khudawadi" },
- ["lao"] = { first = 0x00E80, last = 0x00EFF, otf="lao", description = "Lao" },
- ["latinextendeda"] = { first = 0x00100, last = 0x0017F, otf="latn", description = "Latin Extended-A" },
- ["latinextendedadditional"] = { first = 0x01E00, last = 0x01EFF, otf="latn", description = "Latin Extended Additional" },
- ["latinextendedb"] = { first = 0x00180, last = 0x0024F, otf="latn", description = "Latin Extended-B" },
- ["latinextendedc"] = { first = 0x02C60, last = 0x02C7F, otf="latn", description = "Latin Extended-C" },
- ["latinextendedd"] = { first = 0x0A720, last = 0x0A7FF, otf="latn", description = "Latin Extended-D" },
- ["latinextendede"] = { first = 0x0AB30, last = 0x0AB6F, description = "Latin Extended-E" },
- ["latinsupplement"] = { first = 0x00080, last = 0x000FF, otf="latn", description = "Latin-1 Supplement" },
- ["lepcha"] = { first = 0x01C00, last = 0x01C4F, description = "Lepcha" },
- ["letterlikesymbols"] = { first = 0x02100, last = 0x0214F, math = true, description = "Letterlike Symbols" },
- ["limbu"] = { first = 0x01900, last = 0x0194F, otf="limb", description = "Limbu" },
- ["lineara"] = { first = 0x10600, last = 0x1077F, description = "Linear A" },
- ["linearbideograms"] = { first = 0x10080, last = 0x100FF, otf="linb", description = "Linear B Ideograms" },
- ["linearbsyllabary"] = { first = 0x10000, last = 0x1007F, otf="linb", description = "Linear B Syllabary" },
- ["lisu"] = { first = 0x0A4D0, last = 0x0A4FF, description = "Lisu" },
- ["lisusupplement"] = { first = 0x11FB0, last = 0x11FBF, description = "Lisu Supplement" },
- ["lowercasebold"] = { first = 0x1D41A, last = 0x1D433, math = true },
- ["lowercaseboldfraktur"] = { first = 0x1D586, last = 0x1D59F, math = true },
- ["lowercasebolditalic"] = { first = 0x1D482, last = 0x1D49B, math = true },
- ["lowercaseboldscript"] = { first = 0x1D4EA, last = 0x1D503, math = true },
- ["lowercasedoublestruck"] = { first = 0x1D552, last = 0x1D56B, math = true },
- ["lowercasefraktur"] = { first = 0x1D51E, last = 0x1D537, math = true },
- ["lowercasegreekbold"] = { first = 0x1D6C2, last = 0x1D6DB, math = true },
- ["lowercasegreekbolditalic"] = { first = 0x1D736, last = 0x1D74F, math = true },
- ["lowercasegreekitalic"] = { first = 0x1D6FC, last = 0x1D715, math = true },
- ["lowercasegreeknormal"] = { first = 0x003B1, last = 0x003CA, math = true },
- ["lowercasegreeksansserifbold"] = { first = 0x1D770, last = 0x1D789, math = true },
- ["lowercasegreeksansserifbolditalic"] = { first = 0x1D7AA, last = 0x1D7C3, math = true },
- ["lowercaseitalic"] = { first = 0x1D44E, last = 0x1D467, math = true },
- ["lowercasemonospace"] = { first = 0x1D68A, last = 0x1D6A3, math = true },
- ["lowercasenormal"] = { first = 0x00061, last = 0x0007A, math = true },
- ["lowercasesansserifbold"] = { first = 0x1D5EE, last = 0x1D607, math = true },
- ["lowercasesansserifbolditalic"] = { first = 0x1D656, last = 0x1D66F, math = true },
- ["lowercasesansserifitalic"] = { first = 0x1D622, last = 0x1D63B, math = true },
- ["lowercasesansserifnormal"] = { first = 0x1D5BA, last = 0x1D5D3, math = true },
- ["lowercasescript"] = { first = 0x1D4B6, last = 0x1D4CF, math = true },
- ["lowsurrogates"] = { first = 0x0DC00, last = 0x0DFFF, description = "Low Surrogates" },
- ["lycian"] = { first = 0x10280, last = 0x1029F, description = "Lycian" },
- ["lydian"] = { first = 0x10920, last = 0x1093F, description = "Lydian" },
- ["mahajani"] = { first = 0x11150, last = 0x1117F, description = "Mahajani" },
- ["mahjongtiles"] = { first = 0x1F000, last = 0x1F02F, description = "Mahjong Tiles" },
- ["makasar"] = { first = 0x11EE0, last = 0x11EFF, description = "Makasar" },
- ["malayalam"] = { first = 0x00D00, last = 0x00D7F, otf="mlym", description = "Malayalam" },
- ["mandaic"] = { first = 0x00840, last = 0x0085F, otf="mand", description = "Mandaic" },
- ["manichaean"] = { first = 0x10AC0, last = 0x10AFF, description = "Manichaean" },
- ["marchen"] = { first = 0x11C70, last = 0x11CBF, description = "Marchen" },
- ["masaramgondi"] = { first = 0x11D00, last = 0x11D5F, description = "Masaram Gondi" },
- ["mathematicalalphanumericsymbols"] = { first = 0x1D400, last = 0x1D7FF, math = true, description = "Mathematical Alphanumeric Symbols" },
- ["mathematicaloperators"] = { first = 0x02200, last = 0x022FF, math = true, description = "Mathematical Operators" },
- ["mayannumerals"] = { first = 0x1D2E0, last = 0x1D2FF, description = "Mayan Numerals" },
- ["medefaidrin"] = { first = 0x16E40, last = 0x16E9F, description = "Medefaidrin" },
- ["meeteimayek"] = { first = 0x0ABC0, last = 0x0ABFF, description = "Meetei Mayek" },
- ["meeteimayekextensions"] = { first = 0x0AAE0, last = 0x0AAFF, description = "Meetei Mayek Extensions" },
- ["mendekikakui"] = { first = 0x1E800, last = 0x1E8DF, description = "Mende Kikakui" },
- ["meroiticcursive"] = { first = 0x109A0, last = 0x109FF, description = "Meroitic Cursive" },
- ["meroitichieroglyphs"] = { first = 0x10980, last = 0x1099F, description = "Meroitic Hieroglyphs" },
- ["miao"] = { first = 0x16F00, last = 0x16F9F, description = "Miao" },
- ["miscellaneousmathematicalsymbolsa"] = { first = 0x027C0, last = 0x027EF, math = true, description = "Miscellaneous Mathematical Symbols-A" },
- ["miscellaneousmathematicalsymbolsb"] = { first = 0x02980, last = 0x029FF, math = true, description = "Miscellaneous Mathematical Symbols-B" },
- ["miscellaneoussymbols"] = { first = 0x02600, last = 0x026FF, math = true, description = "Miscellaneous Symbols" },
- ["miscellaneoussymbolsandarrows"] = { first = 0x02B00, last = 0x02BFF, math = true, description = "Miscellaneous Symbols and Arrows" },
- ["miscellaneoussymbolsandpictographs"] = { first = 0x1F300, last = 0x1F5FF, description = "Miscellaneous Symbols and Pictographs" },
- ["miscellaneoustechnical"] = { first = 0x02300, last = 0x023FF, math = true, description = "Miscellaneous Technical" },
- ["modi"] = { first = 0x11600, last = 0x1165F, description = "Modi" },
- ["modifiertoneletters"] = { first = 0x0A700, last = 0x0A71F, description = "Modifier Tone Letters" },
- ["mongolian"] = { first = 0x01800, last = 0x018AF, otf="mong", description = "Mongolian" },
- ["mongoliansupplement"] = { first = 0x11660, last = 0x1167F, description = "Mongolian Supplement" },
- ["mro"] = { first = 0x16A40, last = 0x16A6F, description = "Mro" },
- ["multani"] = { first = 0x11280, last = 0x112AF, description = "Multani" },
- ["musicalsymbols"] = { first = 0x1D100, last = 0x1D1FF, otf="musc", description = "Musical Symbols" },
- ["myanmar"] = { first = 0x01000, last = 0x0109F, otf="mymr", description = "Myanmar" },
- ["myanmarextendeda"] = { first = 0x0AA60, last = 0x0AA7F, description = "Myanmar Extended-A" },
- ["myanmarextendedb"] = { first = 0x0A9E0, last = 0x0A9FF, description = "Myanmar Extended-B" },
- ["nabataean"] = { first = 0x10880, last = 0x108AF, description = "Nabataean" },
- ["nandinagari"] = { first = 0x119A0, last = 0x119FF, description = "Nandinagari" },
- ["newa"] = { first = 0x11400, last = 0x1147F, description = "Newa" },
- ["newtailue"] = { first = 0x01980, last = 0x019DF, description = "New Tai Lue" },
- ["nko"] = { first = 0x007C0, last = 0x007FF, otf="nko", description = "NKo" },
- ["numberforms"] = { first = 0x02150, last = 0x0218F, description = "Number Forms" },
- ["nushu"] = { first = 0x1B170, last = 0x1B2FF, description = "Nushu" },
- ["nyiakengpuachuehmong"] = { first = 0x1E100, last = 0x1E14F, description = "Nyiakeng Puachue Hmong" },
- ["ogham"] = { first = 0x01680, last = 0x0169F, otf="ogam", description = "Ogham" },
- ["olchiki"] = { first = 0x01C50, last = 0x01C7F, description = "Ol Chiki" },
- ["oldhungarian"] = { first = 0x10C80, last = 0x10CFF, description = "Old Hungarian" },
- ["olditalic"] = { first = 0x10300, last = 0x1032F, otf="ital", description = "Old Italic" },
- ["oldnortharabian"] = { first = 0x10A80, last = 0x10A9F, description = "Old North Arabian" },
- ["oldpermic"] = { first = 0x10350, last = 0x1037F, description = "Old Permic" },
- ["oldpersian"] = { first = 0x103A0, last = 0x103DF, otf="xpeo", description = "Old Persian" },
- ["oldsogdian"] = { first = 0x10F00, last = 0x10F2F, description = "Old Sogdian" },
- ["oldsoutharabian"] = { first = 0x10A60, last = 0x10A7F, description = "Old South Arabian" },
- ["oldturkic"] = { first = 0x10C00, last = 0x10C4F, description = "Old Turkic" },
- ["opticalcharacterrecognition"] = { first = 0x02440, last = 0x0245F, description = "Optical Character Recognition" },
- ["oriya"] = { first = 0x00B00, last = 0x00B7F, otf="orya", description = "Oriya" },
- ["ornamentaldingbats"] = { first = 0x1F650, last = 0x1F67F, description = "Ornamental Dingbats" },
- ["osage"] = { first = 0x104B0, last = 0x104FF, description = "Osage" },
- ["osmanya"] = { first = 0x10480, last = 0x104AF, otf="osma", description = "Osmanya" },
- ["ottomansiyaqnumbers"] = { first = 0x1ED00, last = 0x1ED4F, description = "Ottoman Siyaq Numbers" },
- ["pahawhhmong"] = { first = 0x16B00, last = 0x16B8F, description = "Pahawh Hmong" },
- ["palmyrene"] = { first = 0x10860, last = 0x1087F, description = "Palmyrene" },
- ["paucinhau"] = { first = 0x11AC0, last = 0x11AFF, description = "Pau Cin Hau" },
- ["phagspa"] = { first = 0x0A840, last = 0x0A87F, otf="phag", description = "Phags-pa" },
- ["phaistosdisc"] = { first = 0x101D0, last = 0x101FF, description = "Phaistos Disc" },
- ["phoenician"] = { first = 0x10900, last = 0x1091F, otf="phnx", description = "Phoenician" },
- ["phoneticextensions"] = { first = 0x01D00, last = 0x01D7F, description = "Phonetic Extensions" },
- ["phoneticextensionssupplement"] = { first = 0x01D80, last = 0x01DBF, description = "Phonetic Extensions Supplement" },
- ["playingcards"] = { first = 0x1F0A0, last = 0x1F0FF, description = "Playing Cards" },
- ["privateusearea"] = { first = 0x0E000, last = 0x0F8FF, description = "Private Use Area" },
- ["psalterpahlavi"] = { first = 0x10B80, last = 0x10BAF, description = "Psalter Pahlavi" },
- ["rejang"] = { first = 0x0A930, last = 0x0A95F, description = "Rejang" },
- ["ruminumeralsymbols"] = { first = 0x10E60, last = 0x10E7F, description = "Rumi Numeral Symbols" },
- ["runic"] = { first = 0x016A0, last = 0x016FF, otf="runr", description = "Runic" },
- ["samaritan"] = { first = 0x00800, last = 0x0083F, description = "Samaritan" },
- ["saurashtra"] = { first = 0x0A880, last = 0x0A8DF, description = "Saurashtra" },
- ["sharada"] = { first = 0x11180, last = 0x111DF, description = "Sharada" },
- ["shavian"] = { first = 0x10450, last = 0x1047F, otf="shaw", description = "Shavian" },
- ["shorthandformatcontrols"] = { first = 0x1BCA0, last = 0x1BCAF, description = "Shorthand Format Controls" },
- ["siddham"] = { first = 0x11580, last = 0x115FF, description = "Siddham" },
- ["sinhala"] = { first = 0x00D80, last = 0x00DFF, otf="sinh", description = "Sinhala" },
- ["sinhalaarchaicnumbers"] = { first = 0x111E0, last = 0x111FF, description = "Sinhala Archaic Numbers" },
- ["smallformvariants"] = { first = 0x0FE50, last = 0x0FE6F, description = "Small Form Variants" },
- ["smallkanaextension"] = { first = 0x1B130, last = 0x1B16F, description = "Small Kana Extension" },
- ["sogdian"] = { first = 0x10F30, last = 0x10F6F, description = "Sogdian" },
- ["sorasompeng"] = { first = 0x110D0, last = 0x110FF, description = "Sora Sompeng" },
- ["soyombo"] = { first = 0x11A50, last = 0x11AAF, description = "Soyombo" },
- ["spacingmodifierletters"] = { first = 0x002B0, last = 0x002FF, description = "Spacing Modifier Letters" },
- ["specials"] = { first = 0x0FFF0, last = 0x0FFFF, description = "Specials" },
- ["sundanese"] = { first = 0x01B80, last = 0x01BBF, description = "Sundanese" },
- ["sundanesesupplement"] = { first = 0x01CC0, last = 0x01CCF, description = "Sundanese Supplement" },
- ["superscriptsandsubscripts"] = { first = 0x02070, last = 0x0209F, description = "Superscripts and Subscripts" },
- ["supplementalarrowsa"] = { first = 0x027F0, last = 0x027FF, math = true, description = "Supplemental Arrows-A" },
- ["supplementalarrowsb"] = { first = 0x02900, last = 0x0297F, math = true, description = "Supplemental Arrows-B" },
- ["supplementalarrowsc"] = { first = 0x1F800, last = 0x1F8FF, math = true, description = "Supplemental Arrows-C" },
- ["supplementalmathematicaloperators"] = { first = 0x02A00, last = 0x02AFF, math = true, description = "Supplemental Mathematical Operators" },
- ["supplementalpunctuation"] = { first = 0x02E00, last = 0x02E7F, description = "Supplemental Punctuation" },
- ["supplementalsymbolsandpictographs"] = { first = 0x1F900, last = 0x1F9FF, description = "Supplemental Symbols and Pictographs" },
- ["supplementaryprivateuseareaa"] = { first = 0xF0000, last = 0xFFFFF, description = "Supplementary Private Use Area-A" },
- ["supplementaryprivateuseareab"] = { first = 0x100000,last = 0x10FFFF, description = "Supplementary Private Use Area-B" },
- ["suttonsignwriting"] = { first = 0x1D800, last = 0x1DAAF, description = "Sutton SignWriting" },
- ["sylotinagri"] = { first = 0x0A800, last = 0x0A82F, otf="sylo", description = "Syloti Nagri" },
- ["symbolsandpictographsextendeda"] = { first = 0x1FA70, last = 0x1FAFF, description = "Symbols and Pictographs Extended-A" },
- ["symbolsforlegacycomputing"] = { first = 0x1FB00, last = 0x1FBFF, description = "Symbols for Legacy Computing" },
- ["syriac"] = { first = 0x00700, last = 0x0074F, otf="syrc", description = "Syriac" },
- ["syriacsupplement"] = { first = 0x00860, last = 0x0086F, description = "Syriac Supplement" },
- ["tagalog"] = { first = 0x01700, last = 0x0171F, otf="tglg", description = "Tagalog" },
- ["tagbanwa"] = { first = 0x01760, last = 0x0177F, otf="tagb", description = "Tagbanwa" },
- ["tags"] = { first = 0xE0000, last = 0xE007F, description = "Tags" },
- ["taile"] = { first = 0x01950, last = 0x0197F, otf="tale", description = "Tai Le" },
- ["taitham"] = { first = 0x01A20, last = 0x01AAF, description = "Tai Tham" },
- ["taiviet"] = { first = 0x0AA80, last = 0x0AADF, description = "Tai Viet" },
- ["taixuanjingsymbols"] = { first = 0x1D300, last = 0x1D35F, description = "Tai Xuan Jing Symbols" },
- ["takri"] = { first = 0x11680, last = 0x116CF, description = "Takri" },
- ["tamil"] = { first = 0x00B80, last = 0x00BFF, otf="taml", description = "Tamil" },
- ["tamilsupplement"] = { first = 0x11FC0, last = 0x11FFF, description = "Tamil Supplement" },
- ["tangut"] = { first = 0x17000, last = 0x187FF, description = "Tangut" },
- ["tangutsupplement"] = { first = 0x18D00, last = 0x18D8F, description = "Tangut Supplement" },
- ["tangutcomponents"] = { first = 0x18800, last = 0x18AFF, description = "Tangut Components" },
- ["telugu"] = { first = 0x00C00, last = 0x00C7F, otf="telu", description = "Telugu" },
- ["thaana"] = { first = 0x00780, last = 0x007BF, otf="thaa", description = "Thaana" },
- ["thai"] = { first = 0x00E00, last = 0x00E7F, otf="thai", description = "Thai" },
- ["tibetan"] = { first = 0x00F00, last = 0x00FFF, otf="tibt", description = "Tibetan" },
- ["tifinagh"] = { first = 0x02D30, last = 0x02D7F, otf="tfng", description = "Tifinagh" },
- ["tirhuta"] = { first = 0x11480, last = 0x114DF, description = "Tirhuta" },
- ["transportandmapsymbols"] = { first = 0x1F680, last = 0x1F6FF, description = "Transport and Map Symbols" },
- ["ugaritic"] = { first = 0x10380, last = 0x1039F, otf="ugar", description = "Ugaritic" },
- ["unifiedcanadianaboriginalsyllabics"] = { first = 0x01400, last = 0x0167F, otf="cans", description = "Unified Canadian Aboriginal Syllabics" },
- ["unifiedcanadianaboriginalsyllabicsextended"] = { first = 0x018B0, last = 0x018FF, description = "Unified Canadian Aboriginal Syllabics Extended" },
- ["uppercasebold"] = { first = 0x1D400, last = 0x1D419, math = true },
- ["uppercaseboldfraktur"] = { first = 0x1D56C, last = 0x1D585, math = true },
- ["uppercasebolditalic"] = { first = 0x1D468, last = 0x1D481, math = true },
- ["uppercaseboldscript"] = { first = 0x1D4D0, last = 0x1D4E9, math = true },
- ["uppercasedoublestruck"] = { first = 0x1D538, last = 0x1D551, math = true }, -- gaps are filled in elsewhere
- ["uppercasefraktur"] = { first = 0x1D504, last = 0x1D51D, math = true },
- ["uppercasegreekbold"] = { first = 0x1D6A8, last = 0x1D6C1, math = true },
- ["uppercasegreekbolditalic"] = { first = 0x1D71C, last = 0x1D735, math = true },
- ["uppercasegreekitalic"] = { first = 0x1D6E2, last = 0x1D6FB, math = true },
- ["uppercasegreeknormal"] = { first = 0x00391, last = 0x003AA, math = true },
- ["uppercasegreeksansserifbold"] = { first = 0x1D756, last = 0x1D76F, math = true },
- ["uppercasegreeksansserifbolditalic"] = { first = 0x1D790, last = 0x1D7A9, math = true },
- ["uppercaseitalic"] = { first = 0x1D434, last = 0x1D44D, math = true },
- ["uppercasemonospace"] = { first = 0x1D670, last = 0x1D689, math = true },
- ["uppercasenormal"] = { first = 0x00041, last = 0x0005A, math = true },
- ["uppercasesansserifbold"] = { first = 0x1D5D4, last = 0x1D5ED, math = true },
- ["uppercasesansserifbolditalic"] = { first = 0x1D63C, last = 0x1D655, math = true },
- ["uppercasesansserifitalic"] = { first = 0x1D608, last = 0x1D621, math = true },
- ["uppercasesansserifnormal"] = { first = 0x1D5A0, last = 0x1D5B9, math = true },
- ["uppercasescript"] = { first = 0x1D49C, last = 0x1D4B5, math = true },
- ["vai"] = { first = 0x0A500, last = 0x0A63F, description = "Vai" },
- ["variationselectors"] = { first = 0x0FE00, last = 0x0FE0F, description = "Variation Selectors" },
- ["variationselectorssupplement"] = { first = 0xE0100, last = 0xE01EF, description = "Variation Selectors Supplement" },
- ["vedicextensions"] = { first = 0x01CD0, last = 0x01CFF, description = "Vedic Extensions" },
- ["verticalforms"] = { first = 0x0FE10, last = 0x0FE1F, description = "Vertical Forms" },
- ["wancho"] = { first = 0x1E2C0, last = 0x1E2FF, description = "Wancho" },
- ["warangciti"] = { first = 0x118A0, last = 0x118FF, description = "Warang Citi" },
- ["yezidi"] = { first = 0x10E80, last = 0x10EBF, description = "Yezidi" },
- ["yijinghexagramsymbols"] = { first = 0x04DC0, last = 0x04DFF, otf="yi", description = "Yijing Hexagram Symbols" },
- ["yiradicals"] = { first = 0x0A490, last = 0x0A4CF, otf="yi", description = "Yi Radicals" },
- ["yisyllables"] = { first = 0x0A000, last = 0x0A48F, otf="yi", description = "Yi Syllables" },
- ["zanabazarsquare"] = { first = 0x11A00, last = 0x11A4F, description = "Zanabazar Square" },
+ ["adlam"] = { first = 0x1E900, last = 0x1E95F, description = "Adlam" },
+ ["aegeannumbers"] = { first = 0x10100, last = 0x1013F, description = "Aegean Numbers" },
+ ["ahom"] = { first = 0x11700, last = 0x1174F, description = "Ahom" },
+ ["alchemicalsymbols"] = { first = 0x1F700, last = 0x1F77F, description = "Alchemical Symbols" },
+ ["alphabeticpresentationforms"] = { first = 0x0FB00, last = 0x0FB4F, otf="latn", description = "Alphabetic Presentation Forms" },
+ ["anatolianhieroglyphs"] = { first = 0x14400, last = 0x1467F, description = "Anatolian Hieroglyphs" },
+ ["ancientgreekmusicalnotation"] = { first = 0x1D200, last = 0x1D24F, otf="grek", description = "Ancient Greek Musical Notation" },
+ ["ancientgreeknumbers"] = { first = 0x10140, last = 0x1018F, otf="grek", description = "Ancient Greek Numbers" },
+ ["ancientsymbols"] = { first = 0x10190, last = 0x101CF, otf="grek", description = "Ancient Symbols" },
+ ["arabic"] = { first = 0x00600, last = 0x006FF, otf="arab", description = "Arabic" },
+ ["arabicextendeda"] = { first = 0x008A0, last = 0x008FF, description = "Arabic Extended-A" },
+ ["arabicextendedb"] = { first = 0x00870, last = 0x0089F, description = "Arabic Extended-B" },
+ ["arabicextendedc"] = { first = 0x10EC0, last = 0x10EFF, description = "Arabic Extended-C" },
+ ["arabicmathematicalalphabeticsymbols"] = { first = 0x1EE00, last = 0x1EEFF, description = "Arabic Mathematical Alphabetic Symbols" },
+ ["arabicpresentationformsa"] = { first = 0x0FB50, last = 0x0FDFF, otf="arab", description = "Arabic Presentation Forms-A" },
+ ["arabicpresentationformsb"] = { first = 0x0FE70, last = 0x0FEFF, otf="arab", description = "Arabic Presentation Forms-B" },
+ ["arabicsupplement"] = { first = 0x00750, last = 0x0077F, otf="arab", description = "Arabic Supplement" },
+ ["armenian"] = { first = 0x00530, last = 0x0058F, otf="armn", description = "Armenian" },
+ ["arrows"] = { first = 0x02190, last = 0x021FF, description = "Arrows" },
+ ["avestan"] = { first = 0x10B00, last = 0x10B3F, description = "Avestan" },
+ ["balinese"] = { first = 0x01B00, last = 0x01B7F, otf="bali", description = "Balinese" },
+ ["bamum"] = { first = 0x0A6A0, last = 0x0A6FF, description = "Bamum" },
+ ["bamumsupplement"] = { first = 0x16800, last = 0x16A3F, description = "Bamum Supplement" },
+ ["basiclatin"] = { first = 0x00000, last = 0x0007F, otf="latn", description = "Basic Latin" },
+ ["bassavah"] = { first = 0x16AD0, last = 0x16AFF, description = "Bassa Vah" },
+ ["batak"] = { first = 0x01BC0, last = 0x01BFF, description = "Batak" },
+ ["bengali"] = { first = 0x00980, last = 0x009FF, otf="beng", description = "Bengali" },
+ ["bhaiksuki"] = { first = 0x11C00, last = 0x11C6F, description = "Bhaiksuki" },
+ ["blockelements"] = { first = 0x02580, last = 0x0259F, otf="bopo", description = "Block Elements" },
+ ["bopomofo"] = { first = 0x03100, last = 0x0312F, otf="bopo", description = "Bopomofo" },
+ ["bopomofoextended"] = { first = 0x031A0, last = 0x031BF, otf="bopo", description = "Bopomofo Extended" },
+ ["boxdrawing"] = { first = 0x02500, last = 0x0257F, description = "Box Drawing" },
+ ["brahmi"] = { first = 0x11000, last = 0x1107F, description = "Brahmi" },
+ ["braillepatterns"] = { first = 0x02800, last = 0x028FF, otf="brai", description = "Braille Patterns" },
+ ["buginese"] = { first = 0x01A00, last = 0x01A1F, otf="bugi", description = "Buginese" },
+ ["buhid"] = { first = 0x01740, last = 0x0175F, otf="buhd", description = "Buhid" },
+ ["byzantinemusicalsymbols"] = { first = 0x1D000, last = 0x1D0FF, otf="byzm", description = "Byzantine Musical Symbols" },
+ ["carian"] = { first = 0x102A0, last = 0x102DF, description = "Carian" },
+ ["caucasianalbanian"] = { first = 0x10530, last = 0x1056F, description = "Caucasian Albanian" },
+ ["chakma"] = { first = 0x11100, last = 0x1114F, description = "Chakma" },
+ ["cham"] = { first = 0x0AA00, last = 0x0AA5F, description = "Cham" },
+ ["cherokee"] = { first = 0x013A0, last = 0x013FF, otf="cher", description = "Cherokee" },
+ ["cherokeesupplement"] = { first = 0x0AB70, last = 0x0ABBF, description = "Cherokee Supplement" },
+ ["chesssymbols"] = { first = 0x1FA00, last = 0x1FA6F, description = "Chess Symbols" },
+ ["chorasmian"] = { first = 0x10FB0, last = 0x10FDF, description = "Chorasmian" },
+ ["cjkcompatibility"] = { first = 0x03300, last = 0x033FF, otf="hang", description = "CJK Compatibility" },
+ ["cjkcompatibilityforms"] = { first = 0x0FE30, last = 0x0FE4F, otf="hang", description = "CJK Compatibility Forms" },
+ ["cjkcompatibilityideographs"] = { first = 0x0F900, last = 0x0FAFF, otf="hang", description = "CJK Compatibility Ideographs" },
+ ["cjkcompatibilityideographssupplement"] = { first = 0x2F800, last = 0x2FA1F, otf="hang", description = "CJK Compatibility Ideographs Supplement" },
+ ["cjkradicalssupplement"] = { first = 0x02E80, last = 0x02EFF, otf="hang", description = "CJK Radicals Supplement" },
+ ["cjkstrokes"] = { first = 0x031C0, last = 0x031EF, otf="hang", description = "CJK Strokes" },
+ ["cjksymbolsandpunctuation"] = { first = 0x03000, last = 0x0303F, otf="hang", description = "CJK Symbols and Punctuation" },
+ ["cjkunifiedideographs"] = { first = 0x04E00, last = 0x09FFF, otf="hang", description = "CJK Unified Ideographs", catcode = "letter" },
+ ["cjkunifiedideographsextensiona"] = { first = 0x03400, last = 0x04DBF, otf="hang", description = "CJK Unified Ideographs Extension A" },
+ ["cjkunifiedideographsextensionb"] = { first = 0x20000, last = 0x2A6DF, otf="hang", description = "CJK Unified Ideographs Extension B" },
+ ["cjkunifiedideographsextensionc"] = { first = 0x2A700, last = 0x2B73F, description = "CJK Unified Ideographs Extension C" },
+ ["cjkunifiedideographsextensiond"] = { first = 0x2B740, last = 0x2B81F, description = "CJK Unified Ideographs Extension D" },
+ ["cjkunifiedideographsextensione"] = { first = 0x2B820, last = 0x2CEAF, description = "CJK Unified Ideographs Extension E" },
+ ["cjkunifiedideographsextensionf"] = { first = 0x2CEB0, last = 0x2EBEF, description = "CJK Unified Ideographs Extension F" },
+ ["cjkunifiedideographsextensiong"] = { first = 0x30000, last = 0x3134F, description = "CJK Unified Ideographs Extension G" },
+ ["cjkunifiedideographsextensionh"] = { first = 0x31350, last = 0x323AF, description = "CJK Unified Ideographs Extension H" },
+ ["combiningdiacriticalmarks"] = { first = 0x00300, last = 0x0036F, description = "Combining Diacritical Marks" },
+ ["combiningdiacriticalmarksextended"] = { first = 0x01AB0, last = 0x01AFF, description = "Combining Diacritical Marks Extended" },
+ ["combiningdiacriticalmarksforsymbols"] = { first = 0x020D0, last = 0x020FF, description = "Combining Diacritical Marks for Symbols" },
+ ["combiningdiacriticalmarkssupplement"] = { first = 0x01DC0, last = 0x01DFF, description = "Combining Diacritical Marks Supplement" },
+ ["combininghalfmarks"] = { first = 0x0FE20, last = 0x0FE2F, description = "Combining Half Marks" },
+ ["commonindicnumberforms"] = { first = 0x0A830, last = 0x0A83F, description = "Common Indic Number Forms" },
+ ["controlpictures"] = { first = 0x02400, last = 0x0243F, description = "Control Pictures" },
+ ["coptic"] = { first = 0x02C80, last = 0x02CFF, otf="copt", description = "Coptic" },
+ ["copticepactnumbers"] = { first = 0x102E0, last = 0x102FF, description = "Coptic Epact Numbers" },
+ ["countingrodnumerals"] = { first = 0x1D360, last = 0x1D37F, description = "Counting Rod Numerals" },
+ ["cuneiform"] = { first = 0x12000, last = 0x123FF, otf="xsux", description = "Cuneiform" },
+ ["cuneiformnumbersandpunctuation"] = { first = 0x12400, last = 0x1247F, otf="xsux", description = "Cuneiform Numbers and Punctuation" },
+ ["currencysymbols"] = { first = 0x020A0, last = 0x020CF, description = "Currency Symbols" },
+ ["cypriotsyllabary"] = { first = 0x10800, last = 0x1083F, otf="cprt", description = "Cypriot Syllabary" },
+ ["cyprominoan"] = { first = 0x12F90, last = 0x12FFF, description = "Cypro-Minoan" },
+ ["cyrillic"] = { first = 0x00400, last = 0x004FF, otf="cyrl", description = "Cyrillic" },
+ ["cyrillicextendeda"] = { first = 0x02DE0, last = 0x02DFF, otf="cyrl", description = "Cyrillic Extended-A" },
+ ["cyrillicextendedb"] = { first = 0x0A640, last = 0x0A69F, otf="cyrl", description = "Cyrillic Extended-B" },
+ ["cyrillicextendedc"] = { first = 0x01C80, last = 0x01C8F, description = "Cyrillic Extended-C" },
+ ["cyrillicextendedd"] = { first = 0x1E030, last = 0x1E08F, description = "Cyrillic Extended-D" },
+ ["cyrillicsupplement"] = { first = 0x00500, last = 0x0052F, otf="cyrl", description = "Cyrillic Supplement" },
+ ["deseret"] = { first = 0x10400, last = 0x1044F, otf="dsrt", description = "Deseret" },
+ ["devanagari"] = { first = 0x00900, last = 0x0097F, otf="deva", description = "Devanagari" },
+ ["devanagariextended"] = { first = 0x0A8E0, last = 0x0A8FF, description = "Devanagari Extended" },
+ ["devanagariextendeda"] = { first = 0x11B00, last = 0x11B5F, description = "Devanagari Extended-A" },
+ ["digitsarabicindic"] = { first = 0x00660, last = 0x00669, math = true },
+ -- ["digitsbengali"] = { first = 0x009E6, last = 0x009EF, math = true },
+ ["digitsbold"] = { first = 0x1D7CE, last = 0x1D7D7, math = true },
+ -- ["digitsdevanagari"] = { first = 0x00966, last = 0x0096F, math = true },
+ ["digitsdoublestruck"] = { first = 0x1D7D8, last = 0x1D7E1, math = true },
+ -- ["digitsethiopic"] = { first = 0x01369, last = 0x01371, math = true },
+ ["digitsextendedarabicindic"] = { first = 0x006F0, last = 0x006F9, math = true },
+ -- ["digitsgujarati"] = { first = 0x00AE6, last = 0x00AEF, math = true },
+ -- ["digitsgurmukhi"] = { first = 0x00A66, last = 0x00A6F, math = true },
+ -- ["digitskannada"] = { first = 0x00CE6, last = 0x00CEF, math = true },
+ -- ["digitskhmer"] = { first = 0x017E0, last = 0x017E9, math = true },
+ -- ["digitslao"] = { first = 0x00ED0, last = 0x00ED9, math = true },
+ ["digitslatin"] = { first = 0x00030, last = 0x00039, math = true },
+ -- ["digitsmalayalam"] = { first = 0x00D66, last = 0x00D6F, math = true },
+ -- ["digitsmongolian"] = { first = 0x01810, last = 0x01809, math = true },
+ ["digitsmonospace"] = { first = 0x1D7F6, last = 0x1D7FF, math = true },
+ -- ["digitsmyanmar"] = { first = 0x01040, last = 0x01049, math = true },
+ ["digitsnormal"] = { first = 0x00030, last = 0x00039, math = true },
+ -- ["digitsoriya"] = { first = 0x00B66, last = 0x00B6F, math = true },
+ ["digitssansserifbold"] = { first = 0x1D7EC, last = 0x1D7F5, math = true },
+ ["digitssansserifnormal"] = { first = 0x1D7E2, last = 0x1D7EB, math = true },
+ -- ["digitstamil"] = { first = 0x00030, last = 0x00039, math = true }, -- no zero
+ -- ["digitstelugu"] = { first = 0x00C66, last = 0x00C6F, math = true },
+ -- ["digitsthai"] = { first = 0x00E50, last = 0x00E59, math = true },
+ -- ["digitstibetan"] = { first = 0x00F20, last = 0x00F29, math = true },
+ ["dingbats"] = { first = 0x02700, last = 0x027BF, description = "Dingbats" },
+ ["divesakuru"] = { first = 0x11900, last = 0x1195F, description = "Dives Akuru" },
+ ["dogra"] = { first = 0x11800, last = 0x1184F, description = "Dogra" },
+ ["dominotiles"] = { first = 0x1F030, last = 0x1F09F, description = "Domino Tiles" },
+ ["duployan"] = { first = 0x1BC00, last = 0x1BC9F, description = "Duployan" },
+ ["earlydynasticcuneiform"] = { first = 0x12480, last = 0x1254F, description = "Early Dynastic Cuneiform" },
+ ["egyptianhieroglyphformatcontrols"] = { first = 0x13430, last = 0x1345F, description = "Egyptian Hieroglyph Format Controls" },
+ ["egyptianhieroglyphs"] = { first = 0x13000, last = 0x1342F, description = "Egyptian Hieroglyphs" },
+ ["elbasan"] = { first = 0x10500, last = 0x1052F, description = "Elbasan" },
+ ["elymaic"] = { first = 0x10FE0, last = 0x10FFF, description = "Elymaic" },
+ ["emoticons"] = { first = 0x1F600, last = 0x1F64F, description = "Emoticons" },
+ ["enclosedalphanumerics"] = { first = 0x02460, last = 0x024FF, description = "Enclosed Alphanumerics" },
+ ["enclosedalphanumericsupplement"] = { first = 0x1F100, last = 0x1F1FF, description = "Enclosed Alphanumeric Supplement" },
+ ["enclosedcjklettersandmonths"] = { first = 0x03200, last = 0x032FF, description = "Enclosed CJK Letters and Months" },
+ ["enclosedideographicsupplement"] = { first = 0x1F200, last = 0x1F2FF, description = "Enclosed Ideographic Supplement" },
+ ["ethiopic"] = { first = 0x01200, last = 0x0137F, otf="ethi", description = "Ethiopic" },
+ ["ethiopicextended"] = { first = 0x02D80, last = 0x02DDF, otf="ethi", description = "Ethiopic Extended" },
+ ["ethiopicextendeda"] = { first = 0x0AB00, last = 0x0AB2F, description = "Ethiopic Extended-A" },
+ ["ethiopicextendedb"] = { first = 0x1E7E0, last = 0x1E7FF, description = "Ethiopic Extended-B" },
+ ["ethiopicsupplement"] = { first = 0x01380, last = 0x0139F, otf="ethi", description = "Ethiopic Supplement" },
+ ["generalpunctuation"] = { first = 0x02000, last = 0x0206F, description = "General Punctuation" },
+ ["geometricshapes"] = { first = 0x025A0, last = 0x025FF, math = true, description = "Geometric Shapes" },
+ ["geometricshapesextended"] = { first = 0x1F780, last = 0x1F7FF, description = "Geometric Shapes Extended" },
+ ["georgian"] = { first = 0x010A0, last = 0x010FF, otf="geor", description = "Georgian" },
+ ["georgianextended"] = { first = 0x01C90, last = 0x01CBF, description = "Georgian Extended" },
+ ["georgiansupplement"] = { first = 0x02D00, last = 0x02D2F, otf="geor", description = "Georgian Supplement" },
+ ["glagolitic"] = { first = 0x02C00, last = 0x02C5F, otf="glag", description = "Glagolitic" },
+ ["glagoliticsupplement"] = { first = 0x1E000, last = 0x1E02F, description = "Glagolitic Supplement" },
+ ["gothic"] = { first = 0x10330, last = 0x1034F, otf="goth", description = "Gothic" },
+ ["grantha"] = { first = 0x11300, last = 0x1137F, description = "Grantha" },
+ ["greekandcoptic"] = { first = 0x00370, last = 0x003FF, otf="grek", description = "Greek and Coptic" },
+ ["greekextended"] = { first = 0x01F00, last = 0x01FFF, otf="grek", description = "Greek Extended" },
+ ["gujarati"] = { first = 0x00A80, last = 0x00AFF, otf="gujr", description = "Gujarati" },
+ ["gunjalagondi"] = { first = 0x11D60, last = 0x11DAF, description = "Gunjala Gondi" },
+ ["gurmukhi"] = { first = 0x00A00, last = 0x00A7F, otf="guru", description = "Gurmukhi" },
+ ["halfwidthandfullwidthforms"] = { first = 0x0FF00, last = 0x0FFEF, description = "Halfwidth and Fullwidth Forms" },
+ ["hangulcompatibilityjamo"] = { first = 0x03130, last = 0x0318F, otf="jamo", description = "Hangul Compatibility Jamo" },
+ ["hanguljamo"] = { first = 0x01100, last = 0x011FF, otf="jamo", description = "Hangul Jamo" },
+ ["hanguljamoextendeda"] = { first = 0x0A960, last = 0x0A97F, description = "Hangul Jamo Extended-A" },
+ ["hanguljamoextendedb"] = { first = 0x0D7B0, last = 0x0D7FF, description = "Hangul Jamo Extended-B" },
+ ["hangulsyllables"] = { first = 0x0AC00, last = 0x0D7AF, otf="hang", description = "Hangul Syllables" },
+ ["hanifirohingya"] = { first = 0x10D00, last = 0x10D3F, description = "Hanifi Rohingya" },
+ ["hanunoo"] = { first = 0x01720, last = 0x0173F, otf="hano", description = "Hanunoo" },
+ ["hatran"] = { first = 0x108E0, last = 0x108FF, description = "Hatran" },
+ ["hebrew"] = { first = 0x00590, last = 0x005FF, otf="hebr", description = "Hebrew" },
+ ["highprivateusesurrogates"] = { first = 0x0DB80, last = 0x0DBFF, description = "High Private Use Surrogates" },
+ ["highsurrogates"] = { first = 0x0D800, last = 0x0DB7F, description = "High Surrogates" },
+ ["hiragana"] = { first = 0x03040, last = 0x0309F, otf="kana", description = "Hiragana" },
+ ["ideographicdescriptioncharacters"] = { first = 0x02FF0, last = 0x02FFF, description = "Ideographic Description Characters" },
+ ["ideographicsymbolsandpunctuation"] = { first = 0x16FE0, last = 0x16FFF, description = "Ideographic Symbols and Punctuation" },
+ ["imperialaramaic"] = { first = 0x10840, last = 0x1085F, description = "Imperial Aramaic" },
+ ["indicsiyaqnumbers"] = { first = 0x1EC70, last = 0x1ECBF, description = "Indic Siyaq Numbers" },
+ ["inscriptionalpahlavi"] = { first = 0x10B60, last = 0x10B7F, description = "Inscriptional Pahlavi" },
+ ["inscriptionalparthian"] = { first = 0x10B40, last = 0x10B5F, description = "Inscriptional Parthian" },
+ ["ipaextensions"] = { first = 0x00250, last = 0x002AF, description = "IPA Extensions" },
+ ["javanese"] = { first = 0x0A980, last = 0x0A9DF, description = "Javanese" },
+ ["kaithi"] = { first = 0x11080, last = 0x110CF, description = "Kaithi" },
+ ["kaktoviknumerals"] = { first = 0x1D2C0, last = 0x1D2DF, description = "Kaktovik Numerals" },
+ ["kanaextendeda"] = { first = 0x1B100, last = 0x1B12F, description = "Kana Extended-A" },
+ ["kanaextendedb"] = { first = 0x1AFF0, last = 0x1AFFF, description = "Kana Extended-B" },
+ ["kanasupplement"] = { first = 0x1B000, last = 0x1B0FF, description = "Kana Supplement" },
+ ["kanbun"] = { first = 0x03190, last = 0x0319F, description = "Kanbun" },
+ ["kangxiradicals"] = { first = 0x02F00, last = 0x02FDF, description = "Kangxi Radicals" },
+ ["kannada"] = { first = 0x00C80, last = 0x00CFF, otf="knda", description = "Kannada" },
+ ["katakana"] = { first = 0x030A0, last = 0x030FF, otf="kana", description = "Katakana" },
+ ["katakanaphoneticextensions"] = { first = 0x031F0, last = 0x031FF, otf="kana", description = "Katakana Phonetic Extensions" },
+ ["kayahli"] = { first = 0x0A900, last = 0x0A92F, description = "Kayah Li" },
+ ["kawi"] = { first = 0x11F00, last = 0x11F5F, description = "Kawi" },
+ ["kharoshthi"] = { first = 0x10A00, last = 0x10A5F, otf="khar", description = "Kharoshthi" },
+ ["khitansmallscript"] = { first = 0x18B00, last = 0x18CFF, description = "Khitan Small Script" },
+ ["khmer"] = { first = 0x01780, last = 0x017FF, otf="khmr", description = "Khmer" },
+ ["khmersymbols"] = { first = 0x019E0, last = 0x019FF, otf="khmr", description = "Khmer Symbols" },
+ ["khojki"] = { first = 0x11200, last = 0x1124F, description = "Khojki" },
+ ["khudawadi"] = { first = 0x112B0, last = 0x112FF, description = "Khudawadi" },
+ ["lao"] = { first = 0x00E80, last = 0x00EFF, otf="lao", description = "Lao" },
+ ["latinextendeda"] = { first = 0x00100, last = 0x0017F, otf="latn", description = "Latin Extended-A" },
+ ["latinextendedadditional"] = { first = 0x01E00, last = 0x01EFF, otf="latn", description = "Latin Extended Additional" },
+ ["latinextendedb"] = { first = 0x00180, last = 0x0024F, otf="latn", description = "Latin Extended-B" },
+ ["latinextendedc"] = { first = 0x02C60, last = 0x02C7F, otf="latn", description = "Latin Extended-C" },
+ ["latinextendedd"] = { first = 0x0A720, last = 0x0A7FF, otf="latn", description = "Latin Extended-D" },
+ ["latinextendede"] = { first = 0x0AB30, last = 0x0AB6F, description = "Latin Extended-E" },
+ ["latinextendedf"] = { first = 0x10780, last = 0x107BF, description = "Latin Extended-F" },
+ ["latinextendedg"] = { first = 0x1DF00, last = 0x1DFFF, description = "Latin Extended-G" },
+ ["latinsupplement"] = { first = 0x00080, last = 0x000FF, otf="latn", description = "Latin-1 Supplement" },
+ ["lepcha"] = { first = 0x01C00, last = 0x01C4F, description = "Lepcha" },
+ ["letterlikesymbols"] = { first = 0x02100, last = 0x0214F, math = true, description = "Letterlike Symbols" },
+ ["limbu"] = { first = 0x01900, last = 0x0194F, otf="limb", description = "Limbu" },
+ ["lineara"] = { first = 0x10600, last = 0x1077F, description = "Linear A" },
+ ["linearbideograms"] = { first = 0x10080, last = 0x100FF, otf="linb", description = "Linear B Ideograms" },
+ ["linearbsyllabary"] = { first = 0x10000, last = 0x1007F, otf="linb", description = "Linear B Syllabary" },
+ ["lisu"] = { first = 0x0A4D0, last = 0x0A4FF, description = "Lisu" },
+ ["lisusupplement"] = { first = 0x11FB0, last = 0x11FBF, description = "Lisu Supplement" },
+ ["lowercasebold"] = { first = 0x1D41A, last = 0x1D433, math = true },
+ ["lowercaseboldfraktur"] = { first = 0x1D586, last = 0x1D59F, math = true },
+ ["lowercasebolditalic"] = { first = 0x1D482, last = 0x1D49B, math = true, italic = true },
+ ["lowercaseboldscript"] = { first = 0x1D4EA, last = 0x1D503, math = true, italic = true },
+ ["lowercasedoublestruck"] = { first = 0x1D552, last = 0x1D56B, math = true },
+ ["lowercasefraktur"] = { first = 0x1D51E, last = 0x1D537, math = true },
+ ["lowercasegreekbold"] = { first = 0x1D6C2, last = 0x1D6DB, math = true },
+ ["lowercasegreekbolditalic"] = { first = 0x1D736, last = 0x1D74F, math = true, italic = true },
+ ["lowercasegreekitalic"] = { first = 0x1D6FC, last = 0x1D715, math = true, italic = true },
+ ["lowercasegreeknormal"] = { first = 0x003B1, last = 0x003C9, math = true },
+ ["lowercasegreeksansserifbold"] = { first = 0x1D770, last = 0x1D789, math = true },
+ ["lowercasegreeksansserifbolditalic"] = { first = 0x1D7AA, last = 0x1D7C3, math = true, italic = true },
+ ["lowercaseitalic"] = { first = 0x1D44E, last = 0x1D467, math = true, italic = true },
+ ["lowercasemonospace"] = { first = 0x1D68A, last = 0x1D6A3, math = true },
+ ["lowercasenormal"] = { first = 0x00061, last = 0x0007A, math = true },
+ ["lowercasesansserifbold"] = { first = 0x1D5EE, last = 0x1D607, math = true },
+ ["lowercasesansserifbolditalic"] = { first = 0x1D656, last = 0x1D66F, math = true, italic = true },
+ ["lowercasesansserifitalic"] = { first = 0x1D622, last = 0x1D63B, math = true, italic = true },
+ ["lowercasesansserifnormal"] = { first = 0x1D5BA, last = 0x1D5D3, math = true },
+ ["lowercasescript"] = { first = 0x1D4B6, last = 0x1D4CF, math = true, italic = true },
+ ["lowsurrogates"] = { first = 0x0DC00, last = 0x0DFFF, description = "Low Surrogates" },
+ ["lycian"] = { first = 0x10280, last = 0x1029F, description = "Lycian" },
+ ["lydian"] = { first = 0x10920, last = 0x1093F, description = "Lydian" },
+ ["mahajani"] = { first = 0x11150, last = 0x1117F, description = "Mahajani" },
+ ["mahjongtiles"] = { first = 0x1F000, last = 0x1F02F, description = "Mahjong Tiles" },
+ ["makasar"] = { first = 0x11EE0, last = 0x11EFF, description = "Makasar" },
+ ["malayalam"] = { first = 0x00D00, last = 0x00D7F, otf="mlym", description = "Malayalam" },
+ ["mandaic"] = { first = 0x00840, last = 0x0085F, otf="mand", description = "Mandaic" },
+ ["manichaean"] = { first = 0x10AC0, last = 0x10AFF, description = "Manichaean" },
+ ["marchen"] = { first = 0x11C70, last = 0x11CBF, description = "Marchen" },
+ ["masaramgondi"] = { first = 0x11D00, last = 0x11D5F, description = "Masaram Gondi" },
+ ["mathematicalalphanumericsymbols"] = { first = 0x1D400, last = 0x1D7FF, math = true, description = "Mathematical Alphanumeric Symbols" },
+ ["mathematicaloperators"] = { first = 0x02200, last = 0x022FF, math = true, description = "Mathematical Operators" },
+ ["mayannumerals"] = { first = 0x1D2E0, last = 0x1D2FF, description = "Mayan Numerals" },
+ ["medefaidrin"] = { first = 0x16E40, last = 0x16E9F, description = "Medefaidrin" },
+ ["meeteimayek"] = { first = 0x0ABC0, last = 0x0ABFF, description = "Meetei Mayek" },
+ ["meeteimayekextensions"] = { first = 0x0AAE0, last = 0x0AAFF, description = "Meetei Mayek Extensions" },
+ ["mendekikakui"] = { first = 0x1E800, last = 0x1E8DF, description = "Mende Kikakui" },
+ ["meroiticcursive"] = { first = 0x109A0, last = 0x109FF, description = "Meroitic Cursive" },
+ ["meroitichieroglyphs"] = { first = 0x10980, last = 0x1099F, description = "Meroitic Hieroglyphs" },
+ ["miao"] = { first = 0x16F00, last = 0x16F9F, description = "Miao" },
+ ["miscellaneousmathematicalsymbolsa"] = { first = 0x027C0, last = 0x027EF, math = true, description = "Miscellaneous Mathematical Symbols-A" },
+ ["miscellaneousmathematicalsymbolsb"] = { first = 0x02980, last = 0x029FF, math = true, description = "Miscellaneous Mathematical Symbols-B" },
+ ["miscellaneoussymbols"] = { first = 0x02600, last = 0x026FF, math = true, description = "Miscellaneous Symbols" },
+ ["miscellaneoussymbolsandarrows"] = { first = 0x02B00, last = 0x02BFF, math = true, description = "Miscellaneous Symbols and Arrows" },
+ ["miscellaneoussymbolsandpictographs"] = { first = 0x1F300, last = 0x1F5FF, description = "Miscellaneous Symbols and Pictographs" },
+ ["miscellaneoustechnical"] = { first = 0x02300, last = 0x023FF, math = true, description = "Miscellaneous Technical" },
+ ["modi"] = { first = 0x11600, last = 0x1165F, description = "Modi" },
+ ["modifiertoneletters"] = { first = 0x0A700, last = 0x0A71F, description = "Modifier Tone Letters" },
+ ["mongolian"] = { first = 0x01800, last = 0x018AF, otf="mong", description = "Mongolian" },
+ ["mongoliansupplement"] = { first = 0x11660, last = 0x1167F, description = "Mongolian Supplement" },
+ ["mro"] = { first = 0x16A40, last = 0x16A6F, description = "Mro" },
+ ["multani"] = { first = 0x11280, last = 0x112AF, description = "Multani" },
+ ["musicalsymbols"] = { first = 0x1D100, last = 0x1D1FF, otf="musc", description = "Musical Symbols" },
+ ["myanmar"] = { first = 0x01000, last = 0x0109F, otf="mymr", description = "Myanmar" },
+ ["myanmarextendeda"] = { first = 0x0AA60, last = 0x0AA7F, description = "Myanmar Extended-A" },
+ ["myanmarextendedb"] = { first = 0x0A9E0, last = 0x0A9FF, description = "Myanmar Extended-B" },
+ ["nabataean"] = { first = 0x10880, last = 0x108AF, description = "Nabataean" },
+ ["nagmundari"] = { first = 0x1E4D0, last = 0x1E4FF, description = "Nag Mundari" },
+ ["nandinagari"] = { first = 0x119A0, last = 0x119FF, description = "Nandinagari" },
+ ["newa"] = { first = 0x11400, last = 0x1147F, description = "Newa" },
+ ["newtailue"] = { first = 0x01980, last = 0x019DF, description = "New Tai Lue" },
+ ["nko"] = { first = 0x007C0, last = 0x007FF, otf="nko", description = "NKo" },
+ ["numberforms"] = { first = 0x02150, last = 0x0218F, description = "Number Forms" },
+ ["nushu"] = { first = 0x1B170, last = 0x1B2FF, description = "Nushu" },
+ ["nyiakengpuachuehmong"] = { first = 0x1E100, last = 0x1E14F, description = "Nyiakeng Puachue Hmong" },
+ ["ogham"] = { first = 0x01680, last = 0x0169F, otf="ogam", description = "Ogham" },
+ ["olchiki"] = { first = 0x01C50, last = 0x01C7F, description = "Ol Chiki" },
+ ["oldhungarian"] = { first = 0x10C80, last = 0x10CFF, description = "Old Hungarian" },
+ ["olditalic"] = { first = 0x10300, last = 0x1032F, otf="ital", description = "Old Italic" },
+ ["oldnortharabian"] = { first = 0x10A80, last = 0x10A9F, description = "Old North Arabian" },
+ ["oldpermic"] = { first = 0x10350, last = 0x1037F, description = "Old Permic" },
+ ["oldpersian"] = { first = 0x103A0, last = 0x103DF, otf="xpeo", description = "Old Persian" },
+ ["oldsogdian"] = { first = 0x10F00, last = 0x10F2F, description = "Old Sogdian" },
+ ["oldsoutharabian"] = { first = 0x10A60, last = 0x10A7F, description = "Old South Arabian" },
+ ["oldturkic"] = { first = 0x10C00, last = 0x10C4F, description = "Old Turkic" },
+ ["olduyghur"] = { first = 0x10F70, last = 0x10FAF, description = "Old Uyghur" },
+ ["opticalcharacterrecognition"] = { first = 0x02440, last = 0x0245F, description = "Optical Character Recognition" },
+ ["oriya"] = { first = 0x00B00, last = 0x00B7F, otf="orya", description = "Oriya" },
+ ["ornamentaldingbats"] = { first = 0x1F650, last = 0x1F67F, description = "Ornamental Dingbats" },
+ ["osage"] = { first = 0x104B0, last = 0x104FF, description = "Osage" },
+ ["osmanya"] = { first = 0x10480, last = 0x104AF, otf="osma", description = "Osmanya" },
+ ["ottomansiyaqnumbers"] = { first = 0x1ED00, last = 0x1ED4F, description = "Ottoman Siyaq Numbers" },
+ ["pahawhhmong"] = { first = 0x16B00, last = 0x16B8F, description = "Pahawh Hmong" },
+ ["palmyrene"] = { first = 0x10860, last = 0x1087F, description = "Palmyrene" },
+ ["paucinhau"] = { first = 0x11AC0, last = 0x11AFF, description = "Pau Cin Hau" },
+ ["phagspa"] = { first = 0x0A840, last = 0x0A87F, otf="phag", description = "Phags-pa" },
+ ["phaistosdisc"] = { first = 0x101D0, last = 0x101FF, description = "Phaistos Disc" },
+ ["phoenician"] = { first = 0x10900, last = 0x1091F, otf="phnx", description = "Phoenician" },
+ ["phoneticextensions"] = { first = 0x01D00, last = 0x01D7F, description = "Phonetic Extensions" },
+ ["phoneticextensionssupplement"] = { first = 0x01D80, last = 0x01DBF, description = "Phonetic Extensions Supplement" },
+ ["playingcards"] = { first = 0x1F0A0, last = 0x1F0FF, description = "Playing Cards" },
+ ["privateusearea"] = { first = 0x0E000, last = 0x0F8FF, description = "Private Use Area" },
+ ["psalterpahlavi"] = { first = 0x10B80, last = 0x10BAF, description = "Psalter Pahlavi" },
+ ["rejang"] = { first = 0x0A930, last = 0x0A95F, description = "Rejang" },
+ ["ruminumeralsymbols"] = { first = 0x10E60, last = 0x10E7F, description = "Rumi Numeral Symbols" },
+ ["runic"] = { first = 0x016A0, last = 0x016FF, otf="runr", description = "Runic" },
+ ["samaritan"] = { first = 0x00800, last = 0x0083F, description = "Samaritan" },
+ ["saurashtra"] = { first = 0x0A880, last = 0x0A8DF, description = "Saurashtra" },
+ ["sharada"] = { first = 0x11180, last = 0x111DF, description = "Sharada" },
+ ["shavian"] = { first = 0x10450, last = 0x1047F, otf="shaw", description = "Shavian" },
+ ["shorthandformatcontrols"] = { first = 0x1BCA0, last = 0x1BCAF, description = "Shorthand Format Controls" },
+ ["siddham"] = { first = 0x11580, last = 0x115FF, description = "Siddham" },
+ ["sinhala"] = { first = 0x00D80, last = 0x00DFF, otf="sinh", description = "Sinhala" },
+ ["sinhalaarchaicnumbers"] = { first = 0x111E0, last = 0x111FF, description = "Sinhala Archaic Numbers" },
+ ["smallformvariants"] = { first = 0x0FE50, last = 0x0FE6F, description = "Small Form Variants" },
+ ["smallkanaextension"] = { first = 0x1B130, last = 0x1B16F, description = "Small Kana Extension" },
+ ["sogdian"] = { first = 0x10F30, last = 0x10F6F, description = "Sogdian" },
+ ["sorasompeng"] = { first = 0x110D0, last = 0x110FF, description = "Sora Sompeng" },
+ ["soyombo"] = { first = 0x11A50, last = 0x11AAF, description = "Soyombo" },
+ ["spacingmodifierletters"] = { first = 0x002B0, last = 0x002FF, description = "Spacing Modifier Letters" },
+ ["specials"] = { first = 0x0FFF0, last = 0x0FFFF, description = "Specials" },
+ ["sundanese"] = { first = 0x01B80, last = 0x01BBF, description = "Sundanese" },
+ ["sundanesesupplement"] = { first = 0x01CC0, last = 0x01CCF, description = "Sundanese Supplement" },
+ ["superscriptsandsubscripts"] = { first = 0x02070, last = 0x0209F, description = "Superscripts and Subscripts" },
+ ["supplementalarrowsa"] = { first = 0x027F0, last = 0x027FF, math = true, description = "Supplemental Arrows-A" },
+ ["supplementalarrowsb"] = { first = 0x02900, last = 0x0297F, math = true, description = "Supplemental Arrows-B" },
+ ["supplementalarrowsc"] = { first = 0x1F800, last = 0x1F8FF, math = true, description = "Supplemental Arrows-C" },
+ ["supplementalmathematicaloperators"] = { first = 0x02A00, last = 0x02AFF, math = true, description = "Supplemental Mathematical Operators" },
+ ["supplementalpunctuation"] = { first = 0x02E00, last = 0x02E7F, description = "Supplemental Punctuation" },
+ ["supplementalsymbolsandpictographs"] = { first = 0x1F900, last = 0x1F9FF, description = "Supplemental Symbols and Pictographs" },
+ ["supplementaryprivateuseareaa"] = { first = 0xF0000, last = 0xFFFFF, description = "Supplementary Private Use Area-A" },
+ ["supplementaryprivateuseareab"] = { first = 0x100000,last = 0x10FFFF, description = "Supplementary Private Use Area-B" },
+ ["suttonsignwriting"] = { first = 0x1D800, last = 0x1DAAF, description = "Sutton SignWriting" },
+ ["sylotinagri"] = { first = 0x0A800, last = 0x0A82F, otf="sylo", description = "Syloti Nagri" },
+ ["symbolsandpictographsextendeda"] = { first = 0x1FA70, last = 0x1FAFF, description = "Symbols and Pictographs Extended-A" },
+ ["symbolsforlegacycomputing"] = { first = 0x1FB00, last = 0x1FBFF, description = "Symbols for Legacy Computing" },
+ ["syriac"] = { first = 0x00700, last = 0x0074F, otf="syrc", description = "Syriac" },
+ ["syriacsupplement"] = { first = 0x00860, last = 0x0086F, description = "Syriac Supplement" },
+ ["tagalog"] = { first = 0x01700, last = 0x0171F, otf="tglg", description = "Tagalog" },
+ ["tagbanwa"] = { first = 0x01760, last = 0x0177F, otf="tagb", description = "Tagbanwa" },
+ ["tags"] = { first = 0xE0000, last = 0xE007F, description = "Tags" },
+ ["taile"] = { first = 0x01950, last = 0x0197F, otf="tale", description = "Tai Le" },
+ ["taitham"] = { first = 0x01A20, last = 0x01AAF, description = "Tai Tham" },
+ ["taiviet"] = { first = 0x0AA80, last = 0x0AADF, description = "Tai Viet" },
+ ["taixuanjingsymbols"] = { first = 0x1D300, last = 0x1D35F, description = "Tai Xuan Jing Symbols" },
+ ["takri"] = { first = 0x11680, last = 0x116CF, description = "Takri" },
+ ["tamil"] = { first = 0x00B80, last = 0x00BFF, otf="taml", description = "Tamil" },
+ ["tamilsupplement"] = { first = 0x11FC0, last = 0x11FFF, description = "Tamil Supplement" },
+ ["tangut"] = { first = 0x17000, last = 0x187FF, description = "Tangut" },
+ ["tangutsupplement"] = { first = 0x18D00, last = 0x18D7F, description = "Tangut Supplement" },
+ ["tangutcomponents"] = { first = 0x18800, last = 0x18AFF, description = "Tangut Components" },
+ ["tangsa"] = { first = 0x16A70, last = 0x16ACF, description = "Tangsa" },
+ ["telugu"] = { first = 0x00C00, last = 0x00C7F, otf="telu", description = "Telugu" },
+ ["thaana"] = { first = 0x00780, last = 0x007BF, otf="thaa", description = "Thaana" },
+ ["thai"] = { first = 0x00E00, last = 0x00E7F, otf="thai", description = "Thai" },
+ ["tibetan"] = { first = 0x00F00, last = 0x00FFF, otf="tibt", description = "Tibetan" },
+ ["tifinagh"] = { first = 0x02D30, last = 0x02D7F, otf="tfng", description = "Tifinagh" },
+ ["tirhuta"] = { first = 0x11480, last = 0x114DF, description = "Tirhuta" },
+ ["toto"] = { first = 0x1E290, last = 0x1E2BF, description = "Toto" },
+ ["transportandmapsymbols"] = { first = 0x1F680, last = 0x1F6FF, description = "Transport and Map Symbols" },
+ ["ugaritic"] = { first = 0x10380, last = 0x1039F, otf="ugar", description = "Ugaritic" },
+ ["unifiedcanadianaboriginalsyllabics"] = { first = 0x01400, last = 0x0167F, otf="cans", description = "Unified Canadian Aboriginal Syllabics" },
+ ["unifiedcanadianaboriginalsyllabicsextended"] = { first = 0x018B0, last = 0x018FF, description = "Unified Canadian Aboriginal Syllabics Extended" },
+ ["unifiedcanadianaboriginalsyllabicsextendeda"] = { first = 0x11AB0, last = 0x11ABF, description = "Unified Canadian Aboriginal Syllabics Extended-A" },
+ ["uppercasebold"] = { first = 0x1D400, last = 0x1D419, math = true },
+ ["uppercaseboldfraktur"] = { first = 0x1D56C, last = 0x1D585, math = true },
+ ["uppercasebolditalic"] = { first = 0x1D468, last = 0x1D481, math = true, italic = true },
+ ["uppercaseboldscript"] = { first = 0x1D4D0, last = 0x1D4E9, math = true, italic = true },
+ ["uppercasedoublestruck"] = { first = 0x1D538, last = 0x1D551, math = true }, -- gaps are filled in elsewhere
+ ["uppercasefraktur"] = { first = 0x1D504, last = 0x1D51D, math = true },
+ ["uppercasegreekbold"] = { first = 0x1D6A8, last = 0x1D6C1, math = true },
+ ["uppercasegreekbolditalic"] = { first = 0x1D71C, last = 0x1D735, math = true, italic = true },
+ ["uppercasegreekitalic"] = { first = 0x1D6E2, last = 0x1D6FB, math = true, italic = true },
+ ["uppercasegreeknormal"] = { first = 0x00391, last = 0x003AA, math = true },
+ ["uppercasegreeksansserifbold"] = { first = 0x1D756, last = 0x1D76F, math = true },
+ ["uppercasegreeksansserifbolditalic"] = { first = 0x1D790, last = 0x1D7A9, math = true, italic = true },
+ ["uppercaseitalic"] = { first = 0x1D434, last = 0x1D44D, math = true, italic = true },
+ ["uppercasemonospace"] = { first = 0x1D670, last = 0x1D689, math = true },
+ ["uppercasenormal"] = { first = 0x00041, last = 0x0005A, math = true },
+ ["uppercasesansserifbold"] = { first = 0x1D5D4, last = 0x1D5ED, math = true },
+ ["uppercasesansserifbolditalic"] = { first = 0x1D63C, last = 0x1D655, math = true, italic = true },
+ ["uppercasesansserifitalic"] = { first = 0x1D608, last = 0x1D621, math = true, italic = true },
+ ["uppercasesansserifnormal"] = { first = 0x1D5A0, last = 0x1D5B9, math = true },
+ ["uppercasescript"] = { first = 0x1D49C, last = 0x1D4B5, math = true, italic = true },
+ ["vai"] = { first = 0x0A500, last = 0x0A63F, description = "Vai" },
+ ["variationselectors"] = { first = 0x0FE00, last = 0x0FE0F, description = "Variation Selectors" },
+ ["variationselectorssupplement"] = { first = 0xE0100, last = 0xE01EF, description = "Variation Selectors Supplement" },
+ ["vedicextensions"] = { first = 0x01CD0, last = 0x01CFF, description = "Vedic Extensions" },
+ ["verticalforms"] = { first = 0x0FE10, last = 0x0FE1F, description = "Vertical Forms" },
+ ["vithkuqi"] = { first = 0x10570, last = 0x105BF, description = "Vithkuqi" },
+ ["wancho"] = { first = 0x1E2C0, last = 0x1E2FF, description = "Wancho" },
+ ["warangciti"] = { first = 0x118A0, last = 0x118FF, description = "Warang Citi" },
+ ["yezidi"] = { first = 0x10E80, last = 0x10EBF, description = "Yezidi" },
+ ["yijinghexagramsymbols"] = { first = 0x04DC0, last = 0x04DFF, otf="yi", description = "Yijing Hexagram Symbols" },
+ ["yiradicals"] = { first = 0x0A490, last = 0x0A4CF, otf="yi", description = "Yi Radicals" },
+ ["yisyllables"] = { first = 0x0A000, last = 0x0A48F, otf="yi", description = "Yi Syllables" },
+ ["zanabazarsquare"] = { first = 0x11A00, last = 0x11A4F, description = "Zanabazar Square" },
+ ["znamennymusicalnotation"] = { first = 0x1CF00, last = 0x1CFCF, description = "Znamenny Musical Notation" },
+
+ -- we need this early on:
+
+ ["lowercasecalligraphic"] = { first = 0x100000, last = 0x100019, math = true },
+ ["uppercasecalligraphic"] = { first = 0x100020, last = 0x100039, math = true },
+ ["lowercaseboldcalligraphic"] = { first = 0x100040, last = 0x100059, math = true },
+ ["uppercaseboldcalligraphic"] = { first = 0x100060, last = 0x100079, math = true },
+ -- ["lowercasesansgreek"] = { first = 0x100040, last = 0x100059, math = true }, -- reserved for future use
+ -- ["uppercasesansgreek"] = { first = 0x100060, last = 0x100079, math = true }, -- reserved for future use
+ -- ["lowercaseitalicsansgreek"] = { first = 0x100080, last = 0x100099, math = true }, -- reserved for future use
+ -- ["uppercaseitalicsansgreek"] = { first = 0x1000A0, last = 0x1000B9, math = true }, -- reserved for future use
+ -- ["lowercaseblackboarditalic"] = { first = 0x1000C0, last = 0x1000D9, math = true }, -- reserved for future use
+ -- ["uppercaseblackboarditalic"] = { first = 0x1000E0, last = 0x1000F9, math = true }, -- reserved for future use
}
-- moved from math-act.lua to here:
@@ -769,10 +809,27 @@ local is_punctuation = allocate ( tohash {
"pc", "pd", "ps", "pe", "pi", "pf", "po",
} )
+local is_hyphenator = allocate ( tohash {
+ "pd",
+} )
+
local is_symbol = allocate ( tohash {
"sm", "sc", "sk", "so",
} )
+local can_have_space = allocate ( tohash {
+ "lu", "ll", "lt", "lm", "lo", -- letters
+ -- "mn", "mc", "me", -- marks
+ "nd", "nl", "no", -- numbers
+ "ps", "pi", -- initial
+ -- "pe", "pf", -- final
+ -- "pc", "pd", "po", -- punctuation
+ "sm", "sc", "sk", "so", -- symbols
+ -- "zs", "zl", "zp", -- separators
+ -- "cc", "cf", "cs", "co", "cn", -- others
+} )
+
+
-- to be redone: store checked characters
characters.is_character = is_character
@@ -781,7 +838,9 @@ characters.is_command = is_command
characters.is_spacing = is_spacing
characters.is_mark = is_mark
characters.is_punctuation = is_punctuation
+characters.is_hyphenator = is_hyphenator
characters.is_symbol = is_symbol
+characters.can_have_space = can_have_space
local mti = function(t,k)
if type(k) == "number" then
@@ -792,11 +851,14 @@ local mti = function(t,k)
end
end
-setmetatableindex(characters.is_character, mti)
-setmetatableindex(characters.is_letter, mti)
-setmetatableindex(characters.is_command, mti)
-setmetatableindex(characters.is_spacing, mti)
-setmetatableindex(characters.is_punctuation,mti)
+setmetatableindex(characters.is_character, mti)
+setmetatableindex(characters.is_letter, mti)
+setmetatableindex(characters.is_command, mti)
+setmetatableindex(characters.is_spacing, mti)
+setmetatableindex(characters.is_punctuation, mti)
+setmetatableindex(characters.is_hyphenator, mti)
+setmetatableindex(characters.is_symbol, mti)
+setmetatableindex(characters.can_have_space, mti)
-- todo: also define callers for the above
@@ -926,7 +988,7 @@ if not characters.fallbacks then
end
-if storage then
+if storage then -- in case we extend
storage.register("characters/fallbacks", characters.fallbacks, "characters.fallbacks") -- accents and such
end
@@ -1218,7 +1280,7 @@ if not characters.splits then
local kind = specials[1]
if kind == "compat" then
compat[unicode] = { unpack(specials,2) }
- elseif kind == "char" then
+ elseif kind == "char" or kind == "with" then -- width added
char [unicode] = { unpack(specials,2) }
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/char-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/char-ini.mkiv
index aa3d31ba831..384ae983f7f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/char-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/char-ini.mkiv
@@ -17,6 +17,7 @@
\registerctxluafile{char-map}{} % maybe we will load this someplace else
\registerctxluafile{char-tex}{}
\registerctxluafile{char-ent}{}
+\registerctxluafile{char-scr}{}
\unprotect
diff --git a/Master/texmf-dist/tex/context/base/mkiv/char-scr.lua b/Master/texmf-dist/tex/context/base/mkiv/char-scr.lua
new file mode 100644
index 00000000000..69213381462
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/char-scr.lua
@@ -0,0 +1,161 @@
+if not modules then modules = { } end modules ['char-scr'] = {
+ version = 1.001,
+ comment = "companion to char-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local tonumber = tonumber
+
+characters.scripthash = { -- we could put these presets in char-def.lua
+ --
+ -- half width opening parenthesis
+ --
+ [0x0028] = "half_width_open",
+ [0x005B] = "half_width_open",
+ [0x007B] = "half_width_open",
+ [0x2018] = "half_width_open", -- ‘
+ [0x201C] = "half_width_open", -- “
+ --
+ -- full width opening parenthesis
+ --
+ [0x3008] = "full_width_open", -- 〈 Left book quote
+ [0x300A] = "full_width_open", -- 《 Left double book quote
+ [0x300C] = "full_width_open", -- 「 left quote
+ [0x300E] = "full_width_open", -- 『 left double quote
+ [0x3010] = "full_width_open", -- 〠left double book quote
+ [0x3014] = "full_width_open", -- 〔 left book quote
+ [0x3016] = "full_width_open", --〖 left double book quote
+ [0x3018] = "full_width_open", -- left tortoise bracket
+ [0x301A] = "full_width_open", -- left square bracket
+ [0x301D] = "full_width_open", -- reverse double prime qm
+ [0xFF08] = "full_width_open", -- ( left parenthesis
+ [0xFF3B] = "full_width_open", -- ï¼» left square brackets
+ [0xFF5B] = "full_width_open", -- ï½› left curve bracket
+ --
+ -- half width closing parenthesis
+ --
+ [0x0029] = "half_width_close",
+ [0x005D] = "half_width_close",
+ [0x007D] = "half_width_close",
+ [0x2019] = "half_width_close", -- ’ right quote, right
+ [0x201D] = "half_width_close", -- †right double quote
+ --
+ -- full width closing parenthesis
+ --
+ [0x3009] = "full_width_close", -- 〉 book quote
+ [0x300B] = "full_width_close", -- 》 double book quote
+ [0x300D] = "full_width_close", -- 〠right quote, right
+ [0x300F] = "full_width_close", -- 〠right double quote
+ [0x3011] = "full_width_close", -- 】 right double book quote
+ [0x3015] = "full_width_close", -- 〕 right book quote
+ [0x3017] = "full_width_close", -- 〗 right double book quote
+ [0x3019] = "full_width_close", -- right tortoise bracket
+ [0x301B] = "full_width_close", -- right square bracket
+ [0x301E] = "full_width_close", -- double prime qm
+ [0x301F] = "full_width_close", -- low double prime qm
+ [0xFF09] = "full_width_close", -- ) right parenthesis
+ [0xFF3D] = "full_width_close", -- ï¼½ right square brackets
+ [0xFF5D] = "full_width_close", -- ï½ right curve brackets
+ --
+ [0xFF62] = "half_width_open", -- left corner bracket
+ [0xFF63] = "half_width_close", -- right corner bracket
+ --
+ -- vertical opening vertical
+ --
+ -- 0xFE35, 0xFE37, 0xFE39, 0xFE3B, 0xFE3D, 0xFE3F, 0xFE41, 0xFE43, 0xFE47,
+ --
+ -- vertical closing
+ --
+ -- 0xFE36, 0xFE38, 0xFE3A, 0xFE3C, 0xFE3E, 0xFE40, 0xFE42, 0xFE44, 0xFE48,
+ --
+ -- half width opening punctuation
+ --
+ -- <empty>
+ --
+ -- full width opening punctuation
+ --
+ -- 0x2236, -- ∶
+ -- 0xFF0C, -- ,
+ --
+ -- half width closing punctuation_hw
+ --
+ [0x0021] = "half_width_close", -- !
+ [0x002C] = "half_width_close", -- ,
+ [0x002E] = "half_width_close", -- .
+ [0x003A] = "half_width_close", -- :
+ [0x003B] = "half_width_close", -- ;
+ [0x003F] = "half_width_close", -- ?
+ [0xFF61] = "half_width_close", -- hw full stop
+ --
+ -- full width closing punctuation
+ --
+ [0x3001] = "full_width_close", -- ã€
+ [0x3002] = "full_width_close", -- 。
+ [0xFF0C] = "full_width_close", -- ,
+ [0xFF0E] = "full_width_close", --
+ --
+ -- depends on font
+ --
+ [0xFF01] = "full_width_close", -- ï¼
+ [0xFF1F] = "full_width_close", -- ?
+ --
+ [0xFF1A] = "full_width_punct", -- :
+ [0xFF1B] = "full_width_punct", -- ï¼›
+ --
+ -- non starter
+ --
+ [0x3005] = "non_starter", [0x3041] = "non_starter", [0x3043] = "non_starter", [0x3045] = "non_starter", [0x3047] = "non_starter",
+ [0x3049] = "non_starter", [0x3063] = "non_starter", [0x3083] = "non_starter", [0x3085] = "non_starter", [0x3087] = "non_starter",
+ [0x308E] = "non_starter", [0x3095] = "non_starter", [0x3096] = "non_starter", [0x309B] = "non_starter", [0x309C] = "non_starter",
+ [0x309D] = "non_starter", [0x309E] = "non_starter", [0x30A0] = "non_starter", [0x30A1] = "non_starter", [0x30A3] = "non_starter",
+ [0x30A5] = "non_starter", [0x30A7] = "non_starter", [0x30A9] = "non_starter", [0x30C3] = "non_starter", [0x30E3] = "non_starter",
+ [0x30E5] = "non_starter", [0x30E7] = "non_starter", [0x30EE] = "non_starter", [0x30F5] = "non_starter", [0x30F6] = "non_starter",
+ [0x30FC] = "non_starter", [0x30FD] = "non_starter", [0x30FE] = "non_starter", [0x31F0] = "non_starter", [0x31F1] = "non_starter",
+ [0x31F2] = "non_starter", [0x31F3] = "non_starter", [0x31F4] = "non_starter", [0x31F5] = "non_starter", [0x31F6] = "non_starter",
+ [0x31F7] = "non_starter", [0x31F8] = "non_starter", [0x31F9] = "non_starter", [0x31FA] = "non_starter", [0x31FB] = "non_starter",
+ [0x31FC] = "non_starter", [0x31FD] = "non_starter", [0x31FE] = "non_starter", [0x31FF] = "non_starter",
+ --
+ [0x301C] = "non_starter", [0x303B] = "non_starter", [0x303C] = "non_starter", [0x309B] = "non_starter", [0x30FB] = "non_starter",
+ [0x30FE] = "non_starter",
+ -- hyphenation
+ --
+ [0x2026] = "hyphen", -- … ellipsis
+ [0x2014] = "hyphen", -- — hyphen
+ --
+ [0x1361] = "ethiopic_word",
+ [0x1362] = "ethiopic_sentence",
+ --
+ -- tibetan:
+ --
+ [0x0F0B] = "breaking_tsheg",
+ [0x0F0C] = "nonbreaking_tsheg",
+
+}
+
+table.setmetatableindex(characters.scripthash, function(t,k)
+ local v
+ if not tonumber(k) then v = false
+ elseif (k >= 0x03040 and k <= 0x030FF)
+ or (k >= 0x031F0 and k <= 0x031FF)
+ or (k >= 0x032D0 and k <= 0x032FE)
+ or (k >= 0x0FF00 and k <= 0x0FFEF) then v = "katakana"
+ elseif (k >= 0x03400 and k <= 0x04DFF)
+ or (k >= 0x04E00 and k <= 0x09FFF)
+ or (k >= 0x0F900 and k <= 0x0FAFF)
+ or (k >= 0x20000 and k <= 0x2A6DF)
+ or (k >= 0x2F800 and k <= 0x2FA1F) then v = "chinese"
+ elseif (k >= 0x0AC00 and k <= 0x0D7A3) then v = "korean"
+ elseif (k >= 0x01100 and k <= 0x0115F) then v = "jamo_initial"
+ elseif (k >= 0x01160 and k <= 0x011A7) then v = "jamo_medial"
+ elseif (k >= 0x011A8 and k <= 0x011FF) then v = "jamo_final"
+ elseif (k >= 0x01200 and k <= 0x0139F) then v = "ethiopic_syllable"
+ elseif (k >= 0x00F00 and k <= 0x00FFF) then v = "tibetan"
+ else v = false
+ end
+ t[k] = v
+ return v
+end)
+
+-- storage.register("characters/scripthash", hash, "characters.scripthash")
diff --git a/Master/texmf-dist/tex/context/base/mkiv/char-utf.lua b/Master/texmf-dist/tex/context/base/mkiv/char-utf.lua
index 7d8ca219b63..e230370b5d9 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/char-utf.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/char-utf.lua
@@ -148,7 +148,7 @@ else
if vs then
local kind = vs[1]
local size = #vs
- if kind == "char" then
+ if kind == "char" or char == "with" then -- with added
if size == 3 then
local one = vs[2]
local two = vs[3]
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cldf-bas.lua b/Master/texmf-dist/tex/context/base/mkiv/cldf-bas.lua
index ac17a9381f1..5853f805708 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/cldf-bas.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/cldf-bas.lua
@@ -243,4 +243,3 @@ do
end
end
-
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cldf-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/cldf-ini.lua
index bb5a058a530..0bdc60379d4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/cldf-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/cldf-ini.lua
@@ -20,16 +20,8 @@ if not modules then modules = { } end modules ['cldf-ini'] = {
-- more efficient approach is stable enough to move the original code to the obsolete
-- module.
--
--- to be considered:
---
--- 0.528 local foo = tex.ctxcatcodes
--- 0.651 local foo = getcount("ctxcatcodes")
--- 0.408 local foo = getcount(ctxcatcodes) -- local ctxcatcodes = tex.iscount("ctxcatcodes")
-
-- maybe:  (escape) or 0x2061 (apply function) or 0x2394 (software function ⎔) (old)
-- note : tex.print == line with endlinechar appended
--- todo : context("%bold{total: }%s",total)
--- todo : context.documentvariable("title")
--
-- During the crited project we ran into the situation that luajittex was 10-20 times
-- slower that luatex ... after 3 days of testing and probing we finally figured out that
@@ -98,16 +90,21 @@ local texsprint = tex.sprint -- just appended (no space,eol treatment
local texprint = tex.print -- each arg a separate line (not last in directlua)
----- texwrite = tex.write -- all 'space' and 'character'
-local isnode = node.is_node
+-- In this stage we don't yet have nodes populated so we access the library directly ...
+
+local isnode = node.isnode or node.is_node
+local copynodelist = node.copylist or node.copy_list
local writenode = node.write
-local copynodelist = node.copy_list
local tonut = node.direct.todirect
local tonode = node.direct.tonode
-local istoken = token.is_token
local newtoken = token.new
local createtoken = token.create
-local setluatoken = token.set_lua
+
+local istoken = token.istoken or token.is_token
+local setluatoken = token.setlua or token.set_lua
+
+-- ... till here.
local isprintable = tex.isprintable or function(n)
return n and (type(n) == "string" or isnode(n) or istoken(n))
@@ -403,19 +400,22 @@ local registerscanner if CONTEXTLMTXMODE > 0 then
-- always permanent but we can consider to obey permanent==false
+ -- todo: make bitset instead of keys (nil is skipped anyway)
+
local function toflags(specification)
- local protected = specification.protected and "protected" -- or ""
+ local protected = specification.protected and "protected"
+ local untraced = specification.untraced and "untraced"
local usage = specification.usage
if usage == "value" then
- return "global", "value", "permanent", protected
+ return "global", "value", "permanent", "untraced", protected
elseif usage == "condition" then
- return "global", "conditional", "permanent", protected
+ return "global", "conditional", "permanent", "untraced", protected
elseif specification.frozen then
- return "global", "frozen", protected
+ return "global", "frozen", untraced, protected
elseif specification.permanent == false or specification.onlyonce then -- for now onlyonce here
- return "global", protected
+ return "global", untraced, protected
else
- return "global", "permanent", protected
+ return "global", "permanent", untraced, protected
end
end
@@ -425,6 +425,7 @@ local registerscanner if CONTEXTLMTXMODE > 0 then
storedscanners[name] = n
namesofscanners[n] = name
name = specification.public and name or (privatenamespace .. name)
+ -- print(name,n,toflags(specification))
setluatoken(name,n,toflags(specification))
end
@@ -577,6 +578,7 @@ local space = patterns.spacer
local spacing = newline * space^0
local content = lpegC((1-spacing)^1) -- texsprint
local emptyline = space^0 * newline^2 -- texprint("")
+ + newline * space^1 * newline^1
local endofline = space^0 * newline * space^0 -- texsprint(" ")
local simpleline = endofline * lpegP(-1) --
@@ -796,7 +798,7 @@ local function writer(parent,command,...) -- already optimized before call
flush(currentcatcodes,"}")
end
elseif typ == "number" then
- -- numbers never have funny catcodesz
+ -- numbers never have funny catcodes
flush(currentcatcodes,"{",ti,"}")
elseif typ == "table" then
local tn = #ti
@@ -850,7 +852,7 @@ local function writer(parent,command,...) -- already optimized before call
else
flush(currentcatcodes,"[",tj,"]")
end
- else -- is concat really faster than flushes here? probably needed anyway (print artifacts)
+ else
flush(currentcatcodes,"[")
for j=1,tn do
local tj = ti[j]
@@ -1138,10 +1140,12 @@ end)
-- The cmd names were synchronized with the normal call cmd names.
-local luacalls = { -- luatex luametatex
- lua_expandable_call = true, -- normal
- lua_call = true, -- protected normal
- lua_protected_call = true, -- protected
+local luacalls = {
+ lua_function_call = true,
+ lua_protected_call = true,
+ lua_value = true,
+ lua_local_call = true,
+ lua_call = true,
}
local function userdata(argument)
@@ -1153,7 +1157,7 @@ local function userdata(argument)
-- return formatters["<<\\%s>>"](csname)
return formatters["\\%s"](csname)
end
- if luacall[argument.cmdname] then
+ if luacalls[argument.cmdname] then
return "<<function>>" -- argument.mode
end
return "<<token>>"
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cldf-ver.lua b/Master/texmf-dist/tex/context/base/mkiv/cldf-ver.lua
index 7a1c813014b..479606f838b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/cldf-ver.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/cldf-ver.lua
@@ -68,8 +68,8 @@ local function flush(s,inline)
context.resetbuffer(t_buffer)
end
-local function t_tocontext(t)
- local s = table.serialize(t)
+local function t_tocontext(t,s)
+ local s = table.serialize(t,s)
context(function() flush(s,false) end)
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/colo-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/colo-ini.lua
index 5bfe4635c18..7a53ca71fb1 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/colo-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/colo-ini.lua
@@ -43,6 +43,7 @@ local texsetattribute = tex.setattribute
local texgetattribute = tex.getattribute
local texgetcount = tex.getcount
local texgettoks = tex.gettoks
+local texiscount = tex.iscount
local texgetmacro = tokens.getters.macro
local a_color = attributes.private('color')
@@ -82,8 +83,19 @@ local function synccolorclone(name,clone)
valid[name] = clone
end
-local function synccolorcount(name,n)
- counts[name] = n
+local synccolorcount if CONTEXTLMTXMODE > 0 then
+-- local prefix = texgetmacro("??colornumber")
+-- for k, v in next, counts do
+-- counts[k] = texiscount(prefix..k)
+-- print(k,v,counts[k])
+-- end
+ synccolorcount = function(name,n)
+ counts[name] = texiscount(n)
+ end
+else
+ synccolorcount = function(name,n)
+ counts[name] = n
+ end
end
local stack = { }
@@ -650,7 +662,7 @@ local function definemixcolor(makecolor,name,fractions,cs,global,freeze)
if not v then
return
end
- values[i] = v
+ colorvalues[i] = v
end
if #values > 0 then
csone = values[1][1]
@@ -877,7 +889,7 @@ local function formatcolor(ca,separator)
end
return concat(c,separator)
else
- return format("%0.3f",0)
+ return "0.000" -- format("%0.3f",0)
end
end
@@ -1139,7 +1151,7 @@ local setcolormodel = colors.setmodel
implement {
name = "synccolorcount",
actions = synccolorcount,
- arguments = { "string", "integer" }
+ arguments = { "string", CONTEXTLMTXMODE > 0 and "string" or "integer" }
}
implement {
@@ -1353,3 +1365,62 @@ implement {
context((s < 0 and 0) or (s > 1 and 1) or s)
end
}
+
+-- This is a playground for MS and HH:
+--
+-- Required Contrast Ratios for WCAG Conformance (how about small text)
+--
+-- Level AA Text 4.5:1 for regular text and 3.0:1 for large text (18pt or 14pt/bold)
+-- Level AAA Text 7.0:1 for regular text and 4.5:1 for large text (18pt or 14pt/bold)
+--
+-- Level AA Non-Text 3.0:1 for user interface components and graphics
+
+do
+
+ -- https://www.w3.org/TR/WCAG21/#dfn-contrast-ratio
+ -- https://www.w3.org/TR/WCAG21/#dfn-relative-luminance
+
+ local function crap(v)
+ return v <= 0.03928 and v/12.92 or (v+0.055/1.055)^2.4
+ end
+
+ local function luminance(color)
+ color = colorvalues[color]
+ if color then
+ return (0.2126 * crap(color[2]) + 0.7152 * crap(color[3]) + 0.0722 * crap(color[4])) + 0.05
+ end
+ end
+
+ local function formatluminance(color)
+ local l = luminance(color)
+ if l then
+ return format("%0.3f",l)
+ end
+ end
+
+ local function formatluminanceratio(one,two)
+ local one = luminance(one)
+ local two = luminance(two)
+ if one and two then
+ return format("%0.3f",one > two and one/two or two/one)
+ end
+ end
+
+ colors.formatluminance = formatluminance
+ colors.formatluminanceratio = formatluminanceratio
+
+ implement {
+ name = "formatluminance",
+ -- protected = true,
+ arguments = "integer",
+ actions = { formatluminance, context },
+ }
+
+ implement {
+ name = "formatluminanceratio",
+ -- protected = true,
+ arguments = { "integer", "integer" },
+ actions = { formatluminanceratio, context },
+ }
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cont-fil.mkiv b/Master/texmf-dist/tex/context/base/mkiv/cont-fil.mkiv
index edef8dbc82f..1d2a44b1ff0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/cont-fil.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/cont-fil.mkiv
@@ -149,4 +149,6 @@
%definefilesynonym [set-13] [setups-proofing]
%definefilesynonym [set-15] [setups-generate]
+\definefilesynonym [newmml] [mathml]
+
\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cont-log.mkiv b/Master/texmf-dist/tex/context/base/mkiv/cont-log.mkiv
index a6cd1cc2fed..bcd276bdff5 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/cont-log.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/cont-log.mkiv
@@ -207,6 +207,7 @@
\unexpanded\def\pdfeTeX {pdfe-\wordboundary\TeX}
\unexpanded\def\luaTeX {lua\wordboundary\TeX}
\unexpanded\def\Lua {Lua}
+\unexpanded\def\LUA {\Lua}
\unexpanded\def\luajitTeX {lua\wordboundary jit\wordboundary\TeX}
\unexpanded\def\luametaTeX{lua\wordboundary meta\wordboundary\TeX}
%unexpanded\def\XeTeX {X\lower.5\exheight\hbox{\kern-.15\emwidth\mirror{E}}\kern-.1667\emwidth\TeX}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cont-new.mkiv b/Master/texmf-dist/tex/context/base/mkiv/cont-new.mkiv
index 89ef1e6c3bd..2ff5bba1fbd 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/cont-new.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/cont-new.mkiv
@@ -13,7 +13,7 @@
% \normalend % uncomment this to get the real base runtime
-\newcontextversion{2021.03.05 19:11}
+\newcontextversion{2023.02.23 21:26}
%D This file is loaded at runtime, thereby providing an excellent place for hacks,
%D patches, extensions and new features. There can be local overloads in cont-loc
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cont-run.mkiv b/Master/texmf-dist/tex/context/base/mkiv/cont-run.mkiv
index 12c12e0d93a..764866a9e3f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/cont-run.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/cont-run.mkiv
@@ -53,7 +53,9 @@
\unexpanded\def\blocksynctexfile[#1]%
{\processcommacommand{#1}\synctexblockfilename}
-\def\continuewhenlmtxmode
+\let\continuewhenmkivmode\relax
+
+\unexpanded\def\continuewhenlmtxmode
{\starttext
\startTEXpage[\c!offset=2ex,\c!foregroundstyle=\tttf]%
This file needs \LuaMetaTeX\ and \ConTeXt\ \LMTX.%
diff --git a/Master/texmf-dist/tex/context/base/mkiv/context-error.lmx b/Master/texmf-dist/tex/context/base/mkiv/context-error.lmx
index d1a758b050a..60579f4a0a6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/context-error.lmx
+++ b/Master/texmf-dist/tex/context/base/mkiv/context-error.lmx
@@ -51,9 +51,7 @@
</div></div>
<div id="bottom"><div id="bottom-one"><div id="bottom-two">
Job Name: <?lua p(environment.jobname) ?> &nbsp;&nbsp;&nbsp;
- ConTeXt Version: <?lua p(environment.version) ?> &nbsp;&nbsp;&nbsp;
- Real Page: <?lua p(tracers.cs('c:realpageno')) ?> &nbsp;&nbsp;&nbsp;
- Page: <?lua p(tracers.cs('c:pageno')) ?> &nbsp;&nbsp;&nbsp;
+ ConTeXt Version: <?lua p(environment.version) ?>
</div></div></div>
</body>
</html>
diff --git a/Master/texmf-dist/tex/context/base/mkiv/context-todo.tex b/Master/texmf-dist/tex/context/base/mkiv/context-todo.tex
index 6aa5bca08a8..e9345c4098c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/context-todo.tex
+++ b/Master/texmf-dist/tex/context/base/mkiv/context-todo.tex
@@ -169,6 +169,11 @@ concern \LUATEX\ have been removed from the agenda but some improvements in
\stopitem
\stopitemize
+% should be in lpdf namespace:
+%
+% ./grph-pat.lua 69: local l = new_literal(lpdf.patternstream(p,width,height))
+
+
\stopsubject
\stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkiv/context.mkiv b/Master/texmf-dist/tex/context/base/mkiv/context.mkiv
index 49eb150497e..7a7e2e8d5c3 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/context.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/context.mkiv
@@ -11,6 +11,10 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+%D There is some residual code in \MKIV\ that results from the transition to \LMTX\
+%D but removeing it can have side effects due to oversights. There is no impact on
+%D performance to I leave at that.
+
% Here is some timing (2015-04-01) luajittex format generation:
%
% 2.6 sec : normal make
@@ -45,7 +49,7 @@
%D {YYYY.MM.DD HH:MM} format.
\edef\contextformat {\jobname}
-\edef\contextversion{2021.03.05 19:11}
+\edef\contextversion{2023.02.23 21:26}
%D Kind of special:
diff --git a/Master/texmf-dist/tex/context/base/mkiv/core-con.lua b/Master/texmf-dist/tex/context/base/mkiv/core-con.lua
index 4bf1424bc02..f57eb6ef890 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/core-con.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/core-con.lua
@@ -17,7 +17,7 @@ slower but look nicer this way.</p>
--ldx]]--
local floor = math.floor
-local osdate, ostime = os.date, os.time
+local osdate, ostime, ostimezone = os.date, os.time, os.timezone
local concat, insert, reverse = table.concat, table.insert, table.reverse
local lower, upper, rep, match, gsub = string.lower, string.upper, string.rep, string.match, string.gsub
local utfchar, utfbyte = utf.char, utf.byte
@@ -127,7 +127,8 @@ local counters = allocate {
0xE050, 0xE051, 0xE052, 0xE053, 0xE054,
0xE055, 0xE056, 0xE057, 0xE058, 0xE059
},
- ['devangari'] = {
+ ['devanagari'] = {
+ -- ० १ २ ३ ४ ५ ६ ७ ८ ९
0x0966, 0x0967, 0x0968, 0x0969, 0x096A,
0x096B, 0x096C, 0x096D, 0x096E, 0x096F
},
@@ -197,7 +198,39 @@ local decimals = allocate {
['persian'] = {
["0"] = "Û°", ["1"] = "Û±", ["2"] = "Û²", ["3"] = "Û³", ["4"] = "Û´",
["5"] = "Ûµ", ["6"] = "Û¶", ["7"] = "Û·", ["8"] = "Û¸", ["9"] = "Û¹",
- }
+ },
+ ['devanagari'] = {
+ ["0"] = "०", ["1"] = "१", ["2"] = "२", ["3"] = "३", ["4"] = "४",
+ ["5"] = "५", ["6"] = "६", ["7"] = "७", ["8"] = "८", ["9"] = "९",
+ },
+ ['malayalam'] = {
+ ["0"] = "൦", ["1"] = "൧", ["2"] = "൨", ["3"] = "൩", ["4"] = "൪",
+ ["5"] = "൫", ["6"] = "൬", ["7"] = "൭", ["8"] = "൮", ["9"] = "൯",
+ },
+ ['tamil'] = {
+ ["0"] = "௦", ["1"] = "௧", ["2"] = "௨", ["3"] = "௩", ["4"] = "௪",
+ ["5"] = "௫", ["6"] = "௬", ["7"] = "௭", ["8"] = "௮", ["9"] = "௯",
+ },
+ ['kannada'] = {
+ ["0"] = "೦", ["1"] = "೧", ["2"] = "೨", ["3"] = "೩", ["4"] = "೪",
+ ["5"] = "೫", ["6"] = "೬", ["7"] = "೭", ["8"] = "೮", ["9"] = "೯",
+ },
+ ['telugu'] = {
+ ["0"] = "౦", ["1"] = "౧", ["2"] = "౨", ["3"] = "౩", ["4"] = "౪",
+ ["5"] = "౫", ["6"] = "౬", ["7"] = "౭", ["8"] = "౮", ["9"] = "౯",
+ },
+ ['bengali'] = {
+ ["0"] = "০", ["1"] = "১", ["2"] = "২", ["3"] = "৩", ["4"] = "৪",
+ ["5"] = "৫", ["6"] = "৬", ["7"] = "৭", ["8"] = "৮", ["9"] = "৯",
+ },
+ ['gujarati'] = {
+ ["0"] = "૦", ["1"] = "૧", ["2"] = "૨", ["3"] = "૩", ["4"] = "૪",
+ ["5"] = "૫", ["6"] = "૬", ["7"] = "૭", ["8"] = "૮", ["9"] = "૯",
+ },
+ ['gurmurkhi'] = {
+ ["0"] = "੦", ["1"] = "੧", ["2"] = "੨", ["3"] = "੩", ["4"] = "੪",
+ ["5"] = "੫", ["6"] = "੬", ["7"] = "੭", ["8"] = "੮", ["9"] = "੯",
+ },
}
languages.decimals = decimals
@@ -1152,6 +1185,8 @@ local ordinals = {
french = function(n)
if n == 1 then
return "er"
+ else
+ return "e"
end
end,
}
@@ -1415,6 +1450,111 @@ data.es = data.spanish
-- print(translate(101))
-- print(translate(199))
+-- verbose swedish by Peter Kvillegard
+
+do
+
+ local words = {
+ [0] = "noll",
+ [1] = "ett",
+ [2] = "två",
+ [3] = "tre",
+ [4] = "fyra",
+ [5] = "fem",
+ [6] = "sex",
+ [7] = "sju",
+ [8] = "Ã¥tta",
+ [9] = "nio",
+ [10] = "tio",
+ [11] = "elva",
+ [12] = "tolv",
+ [13] = "tretton",
+ [14] = "fjorton",
+ [15] = "femton",
+ [16] = "sexton",
+ [17] = "sjutton",
+ [18] = "arton",
+ [19] = "nitton",
+ [20] = "tjugo",
+ [30] = "trettio",
+ [40] = "fyrtio",
+ [50] = "femtio",
+ [60] = "sextio",
+ [70] = "sjuttio",
+ [80] = "Ã¥ttio",
+ [90] = "nittio",
+ [100] = "hundra",
+ [10^3] = "tusen",
+ [10^6] = "miljon",
+ [10^9] = "miljard",
+ [10^12] = "biljon",
+ [10^15] = "biljard",
+ }
+
+ local function translate(n,connector)
+ local w = words[n]
+ if w then
+ return w
+ else
+ local t = { }
+ local l = 0
+ -- group of three digits to words, e.g. 123 -> etthundratjugotre
+ local function triplets(n)
+ if floor(n/100) > 0 then
+ l = l + 1 ; t[l] = words[floor(n/100)]
+ l = l + 1 ; t[l] = words[100]
+ end
+ if n%100 > 20 then
+ l = l + 1 ; t[l] = words[n%100-n%10]
+ if n%10 > 0 then
+ l = l + 1 ; t[l] = words[n%10]
+ end
+ elseif n%100 > 0 then
+ l = l + 1 ; t[l] = words[n%100]
+ end
+ end
+ -- loops through 10^15,10^12,...10^3, extracting groups of three digits
+ -- to make words from, then adding names for order of magnitude
+ for i=15,3,-3 do
+ local triplet = floor(n/10^i)%10^3
+ if triplet > 0 then
+ -- grammar: "en" instead of "ett"
+ if i > 3 and triplet == 1 then
+ l = l + 1 ; t[l] = "en"
+ else
+ triplets(triplet)
+ end
+ -- grammar: plural form of "millions" etc
+ l = l + 1 ; t[l] = words[10^i]
+ if i > 3 and triplet > 1 then
+ l = l + 1 ; t[l] = "er"
+ end
+ end
+ end
+ -- add last group of three numbers (no word for magnitude)
+ n = n%1000
+ if n > 0 then
+ triplets(n)
+ end
+ t = concat(t," ")
+ -- grammar: spacing for numbers < 10^6 and repeated letters
+ if n < 10^6 then
+ t = gsub(t,"%stusen%s","tusen")
+ t = gsub(t,"etttusen","ettusen")
+ end
+ return t
+ end
+ end
+
+ data.swedish = {
+ words = words,
+ translate = translate,
+ }
+
+ data.sv = data.swedish
+
+end
+
-- verbose handler:
function converters.verbose.translate(n,language,connector)
@@ -1864,14 +2004,37 @@ implement {
actions = { formatters["U+%05X"], context },
}
-local n = R("09")^1 / tonumber
+-- totime might move to utilities.parsers as more general helper
+
+local n = R("09")^1 / tonumber -- lpegpatterns.digit
local p = Cf( Ct("")
- * Cg(Cc("year") * (n )) * P("-")^-1
- * Cg(Cc("month") * (n + Cc( 1))) * P("-")^-1
- * Cg(Cc("day") * (n + Cc( 1))) * whitespace^-1
- * Cg(Cc("hour") * (n + Cc( 0))) * P(":")^-1
- * Cg(Cc("min") * (n + Cc( 0)))
+ -- year is mandate, month and day are optional
+ * Cg(Cc("year") * n)
+ * S("-/")^-1
+ * Cg(Cc("month") * (n + Cc(1)))
+ * S("-/")^-1
+ * Cg(Cc("day") * (n + Cc(1)))
+ -- time is optional, hour and minuta are mandate, seconds are optional
+ * (
+ whitespace^0
+ * P("T")^-1
+ * whitespace^0
+ * Cg(Cc("hour") * n)
+ * P(":")^-1
+ * Cg(Cc("min") * n)
+ * P(":")^-1
+ * Cg(Cc("sec") * (n + Cc(0)))
+ )^-1
+ -- zone is optional, hour is mandate, minutes are optional
+ * (
+ whitespace^0
+ * Cg(Cc("tzs") * (P("+") * Cc(1) + P("-") * Cc(-1) + Cc(1)))
+ * whitespace^0
+ * Cg(Cc("tzh") * n)
+ * P(":")^-1
+ * Cg(Cc("tzm") * (n + Cc(0)))
+ )^-1
, rawset)
function converters.totime(s)
@@ -1880,11 +2043,19 @@ function converters.totime(s)
elseif type(s) == "table" then
return s
elseif type(s) == "string" then
- return lpegmatch(p,s)
+ local t = lpegmatch(p,s)
+ if not t then
+ logs.report("system","invalid time specification %a",s)
+ elseif t.tzh then
+ local localtzh, localtzm = ostimezone(true)
+ t.hour = t.hour + localtzh - t.tzs * t.tzh
+ t.min = t.min + localtzm - t.tzs * t.tzm
+ end
+ return t
end
local n = tonumber(s)
if n and n >= 0 then
- return date("*t",n)
+ return osdate("*t",n)
end
end
@@ -2043,3 +2214,9 @@ local function field(n) return context(osdate("*t")[n]) end
implement { name = "actualday", public = true, actions = function() field("day") end }
implement { name = "actualmonth", public = true, actions = function() field("month") end }
implement { name = "actualyear", public = true, actions = function() field("year") end }
+
+implement {
+ name = "uuid",
+ public = true,
+ actions = { os.uuid, context },
+}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/core-dat.lua b/Master/texmf-dist/tex/context/base/mkiv/core-dat.lua
index b497501598b..b58a801d964 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/core-dat.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/core-dat.lua
@@ -156,8 +156,29 @@ local function setdataset(settings)
end
end
-local function datasetvariable(name,tag,key)
- local t = collected[name]
+local cache = table.setmetatableindex(function(t,k)
+ local v = table.load(k..".tuc")
+ if v then
+ v = v.job
+ if v then
+ v = v.datasets
+ if v then
+ v = v.collected
+ end
+ end
+ end
+ if not v then
+ v = { }
+ if trace_datasets then
+ report_dataset("error: unknown dataset job %a",k)
+ end
+ end
+ t[k] = v
+ return v
+end)
+
+local function datasetvariable(name,tag,key,cache)
+ local t = (cache or collected)[name]
if t == nil then
if trace_datasets then
report_dataset("error: unknown dataset, name %a, tag %a, not passed to tex",name) -- no tag
@@ -181,6 +202,10 @@ local function datasetvariable(name,tag,key)
end
end
+local function datasetvariablefromjob(jobnname,name,tag,key)
+ datasetvariable(name,tag,key,cache[jobnname])
+end
+
implement {
name = "setdataset",
actions = setdataset,
@@ -200,6 +225,12 @@ implement {
arguments = "3 strings",
}
+implement {
+ name = "datasetvariablefromjob",
+ arguments = { "string", "string", "string", "string" },
+ actions = datasetvariablefromjob
+}
+
--[[ldx--
<p>We also provide an efficient variant for page states.</p>
--ldx]]--
diff --git a/Master/texmf-dist/tex/context/base/mkiv/data-bin.lua b/Master/texmf-dist/tex/context/base/mkiv/data-bin.lua
index 2bac901ea47..f455f7d9a9b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/data-bin.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/data-bin.lua
@@ -8,7 +8,8 @@ if not modules then modules = { } end modules ['data-bin'] = {
local resolvers = resolvers
local methodhandler = resolvers.methodhandler
-local notfound = resolvers.loaders.notfound
+
+local notfound = resolvers.loaders.notfound
function resolvers.findbinfile(filename,filetype)
return methodhandler('finders',filename,filetype)
@@ -28,3 +29,14 @@ function resolvers.loadbinfile(filename,filetype)
return notfound()
end
end
+
+local notfound = resolvers.cleaners.notfound
+
+function resolvers.cleanupbinfile(filename)
+ local fname = methodhandler('finders',filename)
+ if fname and fname ~= "" then
+ return methodhandler('cleaners',fname)
+ else
+ return notfound()
+ end
+end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/data-con.lua b/Master/texmf-dist/tex/context/base/mkiv/data-con.lua
index ec2251b3534..51e0ce85614 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/data-con.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/data-con.lua
@@ -56,7 +56,7 @@ local mt = {
__storage__ = true
}
-function containers.define(category, subcategory, version, enabled)
+function containers.define(category, subcategory, version, enabled, reload)
if category and subcategory then
local c = allocated[category]
if not c then
@@ -70,6 +70,7 @@ function containers.define(category, subcategory, version, enabled)
subcategory = subcategory,
storage = { },
enabled = enabled,
+ reload = reload,
version = version or math.pi, -- after all, this is TeX
trace = false,
-- writable = getwritablepath and getwritablepath (category,subcategory) or { "." },
@@ -97,7 +98,8 @@ end
function containers.read(container,name)
local storage = container.storage
- local stored = storage[name]
+ local reload = container.reload
+ local stored = not reload and storage[name]
if not stored and container.enabled and caches and containers.usecache then
stored = loaddatafromcache(container.readables,name,container.writable)
if stored and stored.cache_version == container.version then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/data-dec.lua b/Master/texmf-dist/tex/context/base/mkiv/data-dec.lua
new file mode 100644
index 00000000000..2a62b7dd91a
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/data-dec.lua
@@ -0,0 +1,56 @@
+if not modules then modules = { } end modules ['data-dec'] = {
+ version = 1.001,
+ comment = "companion to luat-lib.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local loaddata = io.loaddata
+local suffix = file.suffix
+local resultof = os.resultof
+
+local decompressors = { }
+resolvers.decompressors = decompressors
+
+local decompresslzma = nil
+local decompressgzip = gzip.decompress
+
+local function decompressed(k)
+ local s = suffix(k)
+ if s == "xz" then
+ if decompresslzma == nil then
+ local lzma = require(resolvers.findfile("libs-imp-lzma.lmt"))
+ if lzma then
+ local decompress = lzma.decompress
+ decompresslzma = function(name)
+ return decompress(loaddata(k))
+ end
+ else
+ decompresslzma = function(name)
+ -- todo: use a proper runner
+ return resultof("xz -d -c -q -q " .. name)
+ end
+ end
+ end
+ return decompresslzma(k)
+ elseif s == "gz" then
+ return decompressgzip(loaddata(k))
+ end
+end
+
+local cache = table.setmetatableindex(function(t,k)
+ local v = decompressed(k) or false
+ t[k] = v
+ return v
+end)
+
+decompressors.decompress = decompress
+
+function decompressors.register(filename)
+ return cache[filename]
+end
+
+function decompressors.unregister(filename)
+ cache[filename] = nil
+end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/data-env.lua b/Master/texmf-dist/tex/context/base/mkiv/data-env.lua
index 3b10d89b8b4..c9c11e49c04 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/data-env.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/data-env.lua
@@ -95,8 +95,8 @@ local relations = allocate { -- todo: handlers also here
names = { "mp" },
variable = 'MPINPUTS',
suffixes = CONTEXTLMTXMODE > 0
- and { 'mp', 'mpxl', 'mpvi', 'mpiv', 'mpii' }
- or { 'mp', 'mpvi', 'mpiv', 'mpii' },
+ and { 'mpxl', 'mpvi', 'mpiv', 'mpii', 'mp' }
+ or { 'mpvi', 'mpiv', 'mpii', 'mp' },
usertype = true,
},
tex = {
diff --git a/Master/texmf-dist/tex/context/base/mkiv/data-inp.lua b/Master/texmf-dist/tex/context/base/mkiv/data-inp.lua
index 97fb8904b91..569a66f4eb4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/data-inp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/data-inp.lua
@@ -15,11 +15,14 @@ local registermethod = resolvers.registermethod
local finders = allocate { helpers = { }, notfound = function() end }
local openers = allocate { helpers = { }, notfound = function() end }
local loaders = allocate { helpers = { }, notfound = function() return false, nil, 0 end }
+local tracers = allocate { helpers = { }, notfound = function() end }
registermethod("finders", finders, "uri")
registermethod("openers", openers, "uri")
registermethod("loaders", loaders, "uri")
+registermethod("tracers", tracers, "uri")
resolvers.finders = finders
resolvers.openers = openers
resolvers.loaders = loaders
+resolvers.tracers = tracers
diff --git a/Master/texmf-dist/tex/context/base/mkiv/data-out.lua b/Master/texmf-dist/tex/context/base/mkiv/data-out.lua
index 6cd02a22e2e..cc20f50b3f4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/data-out.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/data-out.lua
@@ -14,4 +14,8 @@ local registermethod = resolvers.registermethod
local savers = allocate { helpers = { } }
resolvers.savers = savers
-registermethod("savers", savers, "uri")
+local cleaners = allocate { helpers = { } }
+resolvers.cleaners = cleaners
+
+registermethod("savers", savers, "uri")
+registermethod("cleaners", cleaners, "uri")
diff --git a/Master/texmf-dist/tex/context/base/mkiv/data-pre.lua b/Master/texmf-dist/tex/context/base/mkiv/data-pre.lua
index f7df8b91870..cab297d1920 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/data-pre.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/data-pre.lua
@@ -25,6 +25,8 @@ if not modules then modules = { } end modules ['data-pre'] = {
-- version : operating system version
-- release : operating system release
+
+local ipairs = ipairs
local insert, remove = table.insert, table.remove
local resolvers = resolvers
@@ -40,6 +42,7 @@ local dirname = file.dirname
local joinpath = file.join
local isfile = lfs.isfile
+local isdir = lfs.isdir
prefixes.environment = function(str)
return cleanpath(expansion(str))
@@ -92,6 +95,8 @@ prefixes.pathname = function(str)
return cleanpath(dirname((fullname ~= "" and fullname) or str))
end
+-- we can actually freeze these
+
prefixes.selfautoloc = function(str)
local pth = getenv('SELFAUTOLOC')
return cleanpath(str and joinpath(pth,str) or pth)
@@ -112,6 +117,34 @@ prefixes.home = function(str)
return cleanpath(str and joinpath(pth,str) or pth)
end
+do
+ local tmppth
+
+ prefixes.temp = function(str)
+ if not tmppth then
+ for _, s in ipairs { "TMP", "TEMP", "TMPDIR", "TEMPDIR" } do
+ tmppth = getenv(s)
+ if tmppth ~= "" and isdir(tmppth) then
+ break
+ end
+ end
+ if not tmppth or tmppth == "" then
+ tmppth = "."
+ end
+ end
+ return cleanpath(str and joinpath(tmppth,str) or tmppth)
+ end
+
+ prefixes.texruns = function(str)
+ local pth = getenv('TEXRUNS')
+ if pth == "" then
+ pth = tmppth
+ end
+ return cleanpath(str and joinpath(pth,str) or pth)
+ end
+
+end
+
prefixes.env = prefixes.environment
prefixes.rel = prefixes.relative
prefixes.loc = prefixes.locate
diff --git a/Master/texmf-dist/tex/context/base/mkiv/data-tar.lua b/Master/texmf-dist/tex/context/base/mkiv/data-tar.lua
new file mode 100644
index 00000000000..45de749b663
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/data-tar.lua
@@ -0,0 +1,236 @@
+if not modules then modules = { } end modules ['data-tar'] = {
+ version = 1.001,
+ comment = "companion to luat-lib.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local format, find, match = string.format, string.find, string.match
+
+local trace_locating = false trackers.register("resolvers.locating", function(v) trace_locating = v end)
+
+local report_tar = logs.reporter("resolvers","tar")
+
+--[[ldx--
+<p>We use a url syntax for accessing the tar file itself and file in it:</p>
+
+<typing>
+tar:///oeps.tar?name=bla/bla.tex
+tar:///oeps.tar?tree=tex/texmf-local
+</typing>
+--ldx]]--
+
+local resolvers = resolvers
+local findfile = resolvers.findfile
+local registerfile = resolvers.registerfile
+local splitmethod = resolvers.splitmethod
+local starttiming = resolvers.starttiming
+local stoptiming = resolvers.stoptiming
+
+local urlquery = url.query
+
+--- hm, zip sits in the global namespace, but tar doesn't
+
+local tar = utilities.tar or { }
+utilities.tar = tar -- not needed
+
+local archives = tar.archives or { }
+tar.archives = archives
+
+local registeredfiles = tar.registeredfiles or { }
+tar.registeredfiles = registeredfiles
+
+-- foo.tar.xz : done
+-- foo.tar.gz : todo
+-- foo.tar : done
+
+local hashtar, fetchtar, wipetar do
+
+ local suffix = file.suffix -- hassuffix .. no need to split
+
+ local tarfiles = utilities.tar.file
+ local tarstrings = utilities.tar.string
+
+ local hashtarfile = tar.files.hash
+ local fetchtarfile = tar.files.fetch
+
+ local hashtarstring = tar.strings.hash
+ local fetchtarstring = tar.strings.fetch
+
+ local register = resolvers.decompressors.register
+
+ hashtar = function(archive,strip)
+ local a = register(archive)
+ if a then
+ return hashtarstring(a,archive)
+ else
+ return hashtarfile(archive,archive)
+ end
+ end
+
+ fetchtar = function(archive,filename,list)
+ local a = register(archive)
+ if a then
+ return fetchtarstring(a,filename,list)
+ else
+ return fetchtarfile(archive,filename,list)
+ end
+ end
+
+ wipetar = resolvers.decompressors.unregister
+
+end
+
+local function validfile(archive,name)
+ return archive[name]
+end
+
+local function openarchive(name)
+ if not name or name == "" then
+ return nil
+ else
+ local arch = archives[name]
+ if not arch then
+ local full = findfile(name) or ""
+ arch = full ~= "" and hashtar(full,name) or false
+ archives[name] = arch
+ end
+ return arch
+ end
+end
+
+local function closearchive(name)
+ if not name or (name == "" and archives[name]) then
+ archives[name] = nil
+ wipetar(name)
+ end
+end
+
+tar.openarchive = openarchive
+tar.closearchive = closearchive
+
+function resolvers.locators.tar(specification)
+ local archive = specification.filename
+ local tarfile = archive and archive ~= "" and openarchive(archive)
+ if trace_locating then
+ if tarfile then
+ report_tar("locator: archive %a found",archive)
+ else
+ report_tar("locator: archive %a not found",archive)
+ end
+ end
+end
+
+function resolvers.concatinators.tar(tarfile,path,name) -- ok ?
+ if not path or path == "" then
+ return format('%s?name=%s',tarfile,name)
+ else
+ return format('%s?name=%s/%s',tarfile,path,name)
+ end
+end
+
+local finders = resolvers.finders
+local notfound = finders.notfound
+
+function finders.tar(specification)
+ local original = specification.original
+ local archive = specification.filename
+ if archive then
+ local query = urlquery(specification.query)
+ local queryname = query.name
+ if queryname then
+ local tfile = openarchive(archive)
+ if tfile then
+ if trace_locating then
+ report_tar("finder: archive %a found",archive)
+ end
+ if validfile(tfile,queryname) then
+ if trace_locating then
+ report_tar("finder: file %a found",queryname)
+ end
+ return specification.original
+ elseif trace_locating then
+ report_tar("finder: file %a not found",queryname)
+ end
+ elseif trace_locating then
+ report_tar("finder: unknown archive %a",archive)
+ end
+ end
+ end
+ if trace_locating then
+ report_tar("finder: %a not found",original)
+ end
+ return notfound()
+end
+
+local openers = resolvers.openers
+local notfound = openers.notfound
+local textopener = openers.helpers.textopener
+
+function openers.tar(specification)
+ local original = specification.original
+ local archive = specification.filename
+ if archive then
+ local query = urlquery(specification.query)
+ local queryname = query.name
+ if queryname then
+ local tfile = openarchive(archive)
+ if tfile then
+ if trace_locating then
+ report_tar("opener; archive %a opened",archive)
+ end
+ local data = fetchtar(archive,queryname,tfile)
+ if data then
+ if trace_locating then
+ report_tar("opener: file %a found",queryname)
+ end
+ return textopener('tar',original,data) -- a string handle
+ elseif trace_locating then
+ report_tar("opener: file %a not found",queryname)
+ end
+ elseif trace_locating then
+ report_tar("opener: unknown archive %a",archive)
+ end
+ end
+ end
+ if trace_locating then
+ report_tar("opener: %a not found",original)
+ end
+ return notfound()
+end
+
+loaders = resolvers.loaders
+local notfound = loaders.notfound
+
+function loaders.tar(specification)
+ local original = specification.original
+ local archive = specification.filename
+ if archive then
+ local query = urlquery(specification.query)
+ local queryname = query.name
+ if queryname then
+ local tfile = openarchive(archive)
+ if tfile then
+ if trace_locating then
+ report_tar("loader: archive %a opened",archive)
+ end
+ local data = fetchtar(archive,queryname,tfile)
+ if data then
+ if trace_locating then
+ report_tar("loader; file %a loaded",original)
+ end
+ return true, data, #data
+ elseif trace_locating then
+ report_tar("loader: file %a not found",queryname)
+ end
+ elseif trace_locating then
+ report_tar("loader; unknown archive %a",archive)
+ end
+ end
+ end
+ if trace_locating then
+ report_tar("loader: %a not found",original)
+ end
+ return notfound()
+end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/data-tex.lua b/Master/texmf-dist/tex/context/base/mkiv/data-tex.lua
index 2c1a7dbd5d1..42547b00b2f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/data-tex.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/data-tex.lua
@@ -175,9 +175,10 @@ local function textopener(tag,filename,filehandle,coding)
currentline = currentline + 1
-- self.currentline = currentline
local content = lines[currentline]
--- lines[currentline] = nil
+ -- lines[currentline] = false
if content == "" then
- return ""
+ -- return ""
+ return content
-- elseif content == ctrl_d or ctrl_z then
-- return nil -- we need this as \endinput does not work in prints
elseif content then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/data-tmp.lua b/Master/texmf-dist/tex/context/base/mkiv/data-tmp.lua
index 9a8a586cda4..1948f1ea596 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/data-tmp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/data-tmp.lua
@@ -74,7 +74,7 @@ local usedreadables = { }
local compilelua = luautilities.compile
local luasuffixes = luautilities.suffixes
-caches.base = caches.base or "luatex-cache" -- can be local
+caches.base = caches.base or (LUATEXENGINE and LUATEXENGINE .. "-cache") or "luatex-cache" -- can be local
caches.more = caches.more or "context" -- can be local
caches.defaults = { "TMPDIR", "TEMPDIR", "TMP", "TEMP", "HOME", "HOMEPATH" }
diff --git a/Master/texmf-dist/tex/context/base/mkiv/data-use.lua b/Master/texmf-dist/tex/context/base/mkiv/data-use.lua
index a7ca2389e99..168b62201ee 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/data-use.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/data-use.lua
@@ -82,14 +82,14 @@ function statistics.savefmtstatus(texname,formatbanner,sourcefile,banner) -- tex
functionality = LUATEXFUNCTIONALITY,
}
io.savedata(luvname,table.serialize(luvdata,true))
- lua.registerfinalizer(function()
+ lua.registerinitexfinalizer(function()
if jit then
logs.report("format banner","%s lua: %s jit",banner,LUAVERSION)
else
logs.report("format banner","%s lua: %s",banner,LUAVERSION)
end
logs.newline()
- end)
+ end, "show banner")
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/data-vir.lua b/Master/texmf-dist/tex/context/base/mkiv/data-vir.lua
index 4b19ee53720..b78211fc9a7 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/data-vir.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/data-vir.lua
@@ -17,6 +17,7 @@ trackers.register("resolvers.virtual", function(v) trace_virtual = v end)
local resolvers = resolvers
local savers = resolvers.savers
+local cleaners = resolvers.cleaners
local data = { }
local n = 0 -- hm, number can be query
@@ -37,6 +38,10 @@ function savers.virtual(specification,content,suffix)
return filename
end
+function cleaners.virtual(filename)
+ data[filename] = nil
+end
+
local finders = resolvers.finders
local notfound = finders.notfound
diff --git a/Master/texmf-dist/tex/context/base/mkiv/data-zip.lua b/Master/texmf-dist/tex/context/base/mkiv/data-zip.lua
index 8d914b842de..1a9310f17fe 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/data-zip.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/data-zip.lua
@@ -70,10 +70,10 @@ if zipfiles then
local readstring = streams.readstring
local streamsize = streams.size
- local metatable = {
+ local metatable = { -- irrelevant as the streams proivide the methods .. a leftover?
close = streams.close,
read = function(stream,n)
- readstring(stream,n == "*a" and streamsize(stream) or n)
+ readstring(stream,n == "*a" and streamsize(stream) or n) -- no return ?
end
}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/export-example.css b/Master/texmf-dist/tex/context/base/mkiv/export-example.css
index 7cfd7f291fc..45af82c34b4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/export-example.css
+++ b/Master/texmf-dist/tex/context/base/mkiv/export-example.css
@@ -19,14 +19,14 @@
\definefloat[myfloata]
\definefloat[myfloatb][myfloatbs][figure]
- context|div.float.myfloata { } float[detail='myfloata'] { }
- context|div.float.myfloatb { } float[detail='myfloatb'] { }
- context|div.float.figure { } float[detail='figure'] { }
- context|div.float.figure.myfloatb { } float[chain~='figure'][detail='myfloata'] { }
- context|div.myfloata { } *[detail='myfloata'] { }
- context|div.myfloatb { } *[detail='myfloatb'] { }
- context|div.figure { } *[chain~='figure'] { }
- context|div.figure.myfloatb { } *[chain~='figure'][detail='myfloatb'] { }
+ div.float.myfloata { } float[detail='myfloata'] { }
+ div.float.myfloatb { } float[detail='myfloatb'] { }
+ div.float.figure { } float[detail='figure'] { }
+ div.float.figure.myfloatb { } float[chain~='figure'][detail='myfloata'] { }
+ div.myfloata { } *[detail='myfloata'] { }
+ div.myfloatb { } *[detail='myfloatb'] { }
+ div.figure { } *[chain~='figure'] { }
+ div.figure.myfloatb { } *[chain~='figure'][detail='myfloatb'] { }
Inheritance when using div seems to be stronger so we need to take more precautions.
@@ -39,34 +39,34 @@
/* extradata: display */
ignore,
-context|div.ignore {
+div.ignore {
display : none ;
}
ignore,
-context|div.private {
+div.private {
display : none ;
}
xmetadata,
-context|div.xmetadata {
+div.xmetadata {
display : none ;
}
xmetavariable,
-context|div.xmetavariable {
+div.xmetavariable {
display : none ;
}
extradata,
-context|div.extradata {
+div.extradata {
display : none ;
}
/* document : display */
document:before,
-context|div.document:before {
+div.document:before {
content : attr(title) ;
font-size : 44pt ;
font-weight : bold ;
@@ -74,7 +74,7 @@ context|div.document:before {
}
document,
-context|div.document {
+div.document {
font-family : "DejaVu Serif", "Lucida Bright", serif ;
font-size : 12pt ;
/* line-height : 14.4pt; */
@@ -88,26 +88,26 @@ context|div.document {
}
document>metadata,
-context|div.document context|div.metadata {
+div.document div.metadata {
font-family : "DejaVu Sans Mono", "Lucida Console", monospace ;
margin-bottom : 3ex ;
}
/*
document>metadata>metavariable[name="X"]:before,
- context|div.document context|div.metadata context|div.metavariable.metaname-X:before {
+ div.document div.metadata div.metavariable.metaname-X:before {
content : "X\00A0\00A0\00A0:\00A0" ;
}
*/
document>metadata,
-context|div.document context|div.metadata {
+div.document div.metadata {
display : flex ;
flex-flow : column ;
}
document>metadata>metavariable:before,
-context|div.document context|div.metadata context|div.metavariable:before {
+div.document div.metadata div.metavariable:before {
display : inline ;
content : attr(label);
width : 8em ;
@@ -116,7 +116,7 @@ context|div.document context|div.metadata context|div.metavariable:before {
}
document>metadata>metavariable[name="title"],
-context|div.document context|div.metadata context|div.metavariable.metaname-title {
+div.document div.metadata div.metavariable.metaname-title {
order : -1 ;
display : block ;
width : 50em ;
@@ -129,7 +129,7 @@ context|div.document context|div.metadata context|div.metavariable.metaname-titl
}
document>metadata>metavariable[name="title"]:before,
-context|div.document context|div.metadata context|div.metavariable.metaname-title:before {
+div.document div.metadata div.metavariable.metaname-title:before {
content : none ;
}
@@ -138,8 +138,8 @@ context|div.document context|div.metadata context|div.metavariable.metaname-titl
paragraph,
p,
-context|div.paragraph,
-context|div.p {
+div.paragraph,
+div.p {
display : block ;
margin-top : 0.5em ;
margin-bottom : 0.5em ;
@@ -148,7 +148,7 @@ context|div.p {
/* break : display */
break,
-context|div.break {
+div.break {
display : block ;
margin-bottom : 0.5em ;
}
@@ -157,16 +157,16 @@ context|div.break {
/* highlight : inline */
construct,
-context|div.construct {
+div.construct {
}
construct[detail="important"],
-context|div.construct.important {
+div.construct.important {
font-weight : bold ;
}
highlight,
-context|div.highlight { /* todo: style and color */
+div.highlight { /* todo: style and color */
display : inline ;
}
@@ -176,12 +176,12 @@ context|div.highlight { /* todo: style and color */
/* sectioncontent : display */
section,
-context|div.section {
+div.section {
display : block ;
}
sectioncaption,
-context|div.sectioncaption {
+div.sectioncaption {
display : block ;
text-align : left ;
page-break-after : avoid ;
@@ -190,18 +190,18 @@ context|div.sectioncaption {
}
sectioncontent,
-context|div.sectioncontent {
+div.sectioncontent {
display : block ;
}
sectionnumber,
-context|div.sectionnumber {
+div.sectionnumber {
display : inline ;
margin-right : 1em ;
}
sectionnumber,
-context|div.sectiontitle {
+div.sectiontitle {
display : inline ;
}
@@ -211,29 +211,29 @@ context|div.sectiontitle {
section[detail="chapter"]>sectioncaption,
section[detail="title"]>sectioncaption,
-context|div.level-2.chapter context|div.sectioncaption ,
-context|div.level-2.title context|div.sectioncaption {
+div.level-2.chapter div.sectioncaption ,
+div.level-2.title div.sectioncaption {
font-size : 2em ;
font-weight : bold ;
}
section[detail="chapter"],
section[detail="title"],
-context|div.level-2.chapter,
-context|div.level-2.title {
+div.level-2.chapter,
+div.level-2.title {
page-break-before : always ;
margin-top : 4ex ;
}
section[detail="chapter"]>sectioncaption>sectionnumber,
-context|div.level-2.chapter context|div.sectioncaption context|div.sectionnumber {
+div.level-2.chapter div.sectioncaption div.sectionnumber {
/* nothing */
}
section[detail="chapter"]>sectioncaption>sectiontitle,
section[detail="title"]>sectioncaption>sectiontitle,
-context|div.level-2.chapter context|div.sectioncaption context|div.sectiontitle,
-context|div.level-2.title context|div.sectioncaption context|div.sectiontitle {
+div.level-2.chapter div.sectioncaption div.sectiontitle,
+div.level-2.title div.sectioncaption div.sectiontitle {
/* nothing */
}
@@ -241,28 +241,28 @@ context|div.level-2.title context|div.sectioncaption context|div.sectiontitle {
section[detail="section"]>sectioncaption,
section[detail="subject"]>sectioncaption,
-context|div.level-3.section context|div.sectioncaption,
-context|div.level-3.subject context|div.sectioncaption {
+div.level-3.section div.sectioncaption,
+div.level-3.subject div.sectioncaption {
font-size : 1.75em ;
font-weight : bold ;
}
section[detail="section"],
section[detail="subject"],
-context|div.level-3.section,
-context|div.level-3.subject {
+div.level-3.section,
+div.level-3.subject {
/* nothing */
}
section[detail="section"]>sectioncaption>sectionnumber,
-context|div.level-3.section context|div.sectioncaption context|div.sectionnumber {
+div.level-3.section div.sectioncaption div.sectionnumber {
/* nothing */
}
section[detail="section"]>sectioncaption>sectiontitle,
section[detail="subject"]>sectioncaption>sectiontitle,
-context|div.level-3.section context|div.sectioncaption context|div.sectiontitle,
-context|div.level-3.subject context|div.sectioncaption context|div.sectiontitle {
+div.level-3.section div.sectioncaption div.sectiontitle,
+div.level-3.subject div.sectioncaption div.sectiontitle {
/* nothing */
}
@@ -270,28 +270,28 @@ context|div.level-3.subject context|div.sectioncaption context|div.sectiontitle
section[detail="subsection"]>sectioncaption,
section[detail="subsubject"]>sectioncaption,
-context|div.level-4.subsection context|div.sectioncaption,
-context|div.level-4.subsubject context|div.sectioncaption {
+div.level-4.subsection div.sectioncaption,
+div.level-4.subsubject div.sectioncaption {
font-size : 1.5em ;
font-weight : bold ;
}
section[detail="subsection"],
section[detail="subsubject"],
-context|div.level-4.subsection,
-context|div.level-4.subsubject {
+div.level-4.subsection,
+div.level-4.subsubject {
/* nothing */
}
section[detail="subsection"]>sectioncaption>sectionnumber,
-context|div.level-4.subsection context|div.sectioncaption context|div.sectionnumber {
+div.level-4.subsection div.sectioncaption div.sectionnumber {
/* nothing */
}
section[detail="subsection"]>sectioncaption>sectiontitle,
section[detail="subsubject"]>sectioncaption>sectiontitle,
-context|div.level-4.subsection context|div.sectioncaption context|div.sectiontitle,
-context|div.level-4.subsubject context|div.sectioncaption context|div.sectiontitle {
+div.level-4.subsection div.sectioncaption div.sectiontitle,
+div.level-4.subsubject div.sectioncaption div.sectiontitle {
/* nothing */
}
@@ -299,28 +299,28 @@ context|div.level-4.subsubject context|div.sectioncaption context|div.sectiontit
section[detail="subsubsection"]>sectioncaption,
section[detail="subsubsubject"]>sectioncaption,
-context|div.level-5.subsubsection context|div.sectioncaption,
-context|div.level-5.subsubsubject context|div.sectioncaption {
+div.level-5.subsubsection div.sectioncaption,
+div.level-5.subsubsubject div.sectioncaption {
font-size : 1.25em ;
font-weight : bold ;
}
section[detail="subsubsection"],
section[detail="subsubsubject"],
-context|div.level-5.subsubsection,
-context|div.level-5.subsubsubject {
+div.level-5.subsubsection,
+div.level-5.subsubsubject {
/* nothing */
}
section[detail="subsubsection"]>sectioncaption>sectionnumber,
-context|div.level-5.subsubsection context|div.sectioncaption context|div.sectionnumber {
+div.level-5.subsubsection div.sectioncaption div.sectionnumber {
/* nothing */
}
section[detail="subsubsection"]>sectioncaption>sectiontitle,
section[detail="subsubsubject"]>sectioncaption>sectiontitle,
-context|div.level-5.subsubsection context|div.sectioncaption context|div.sectiontitle,
-context|div.level-5.subsubsubject context|div.sectioncaption context|div.sectiontitle {
+div.level-5.subsubsection div.sectioncaption div.sectiontitle,
+div.level-5.subsubsubject div.sectioncaption div.sectiontitle {
/* nothing */
}
@@ -328,14 +328,14 @@ context|div.level-5.subsubsubject context|div.sectioncaption context|div.section
section[detail="summary"],
section[detail="subsummary"],
-context|div.section.summary,
-context|div.section.subsummary {
+div.section.summary,
+div.section.subsummary {
margin-top : 1em ;
margin-bottom : 1em ;
}
section[detail="summary"]>sectioncaption>sectiontitle,
-context|div.section.summary context|div.sectioncaption context|div.sectiontitle {
+div.section.summary div.sectioncaption div.sectiontitle {
display : block ;
margin-top : 1em ;
margin-bottom : 1em ;
@@ -347,7 +347,7 @@ context|div.section.summary context|div.sectioncaption context|div.sectiontitle
}
section[detail="subsummary"]>sectioncaption>sectiontitle,
-context|div.section.subsummary context|div.sectioncaption context|div.sectiontitle {
+div.section.subsummary div.sectioncaption div.sectiontitle {
display : block ;
margin-top : 1em ;
margin-bottom : 1em ;
@@ -377,27 +377,27 @@ context|div.section.subsummary context|div.sectioncaption context|div.sectiontit
}
itemgroup,
-context|div.itemgroup {
+div.itemgroup {
display : block ;
margin-bottom : 0.5em ;
margin-top : 0.5em ;
}
-itemgroup[symbol="1"], context|div.itemgroup.symbol-1 { list-style-type : disc ; }
-itemgroup[symbol="2"], context|div.itemgroup.symbol-2 { list-style-type : square ; }
-itemgroup[symbol="3"], context|div.itemgroup.symbol-3 { list-style-type : square ; }
-itemgroup[symbol="4"], context|div.itemgroup.symbol-4 { list-style-type : square ; }
-itemgroup[symbol="5"], context|div.itemgroup.symbol-5 { list-style-type : circ ; }
-itemgroup[symbol="a"], context|div.itemgroup.symbol-a { list-style-type : lower-alpha ; }
-itemgroup[symbol="A"], context|div.itemgroup.symbol-A { list-style-type : alpha ; }
-itemgroup[symbol="r"], context|div.itemgroup.symbol-r { list-style-type : lower-roman ; }
-itemgroup[symbol="R"], context|div.itemgroup.symbol-R { list-style-type : upper-roman ; }
-itemgroup[symbol="n"], context|div.itemgroup.symbol-n { list-style-type : decimal ; }
-itemgroup[symbol="g"], context|div.itemgroup.symbol-g { list-style-type : lower-greek ; }
-itemgroup[symbol="G"], context|div.itemgroup.symbol-G { list-style-type : upper-greek ; }
+itemgroup[symbol="1"], div.itemgroup.symbol-1 { list-style-type : disc ; }
+itemgroup[symbol="2"], div.itemgroup.symbol-2 { list-style-type : square ; }
+itemgroup[symbol="3"], div.itemgroup.symbol-3 { list-style-type : square ; }
+itemgroup[symbol="4"], div.itemgroup.symbol-4 { list-style-type : square ; }
+itemgroup[symbol="5"], div.itemgroup.symbol-5 { list-style-type : circ ; }
+itemgroup[symbol="a"], div.itemgroup.symbol-a { list-style-type : lower-alpha ; }
+itemgroup[symbol="A"], div.itemgroup.symbol-A { list-style-type : alpha ; }
+itemgroup[symbol="r"], div.itemgroup.symbol-r { list-style-type : lower-roman ; }
+itemgroup[symbol="R"], div.itemgroup.symbol-R { list-style-type : upper-roman ; }
+itemgroup[symbol="n"], div.itemgroup.symbol-n { list-style-type : decimal ; }
+itemgroup[symbol="g"], div.itemgroup.symbol-g { list-style-type : lower-greek ; }
+itemgroup[symbol="G"], div.itemgroup.symbol-G { list-style-type : upper-greek ; }
item,
-context|div.item {
+div.item {
display : list-item ;
margin-left : 1em ;
margin-bottom : 0.5em ;
@@ -405,12 +405,12 @@ context|div.item {
}
itemtag,
-context|div.itemtag {
+div.itemtag {
display: none ;
}
itemcontent,
-context|div.itemcontent {
+div.itemcontent {
}
/* description : display */
@@ -419,14 +419,14 @@ context|div.itemcontent {
/* descriptionsymbol : inline */
description,
-context|div.description {
+div.description {
display : block ;
margin-bottom : 1em ;
margin-top : 1em ;
}
descriptiontag,
-context|div.descriptiontag {
+div.descriptiontag {
display : inline ;
float : left ;
clear : left ;
@@ -436,11 +436,11 @@ context|div.descriptiontag {
}
descriptioncontent,
-context|div.descriptioncontent {
+div.descriptioncontent {
}
descriptionsymbol,
-context|div.descriptionsymbol {
+div.descriptionsymbol {
display : inline ;
}
@@ -450,7 +450,7 @@ context|div.descriptionsymbol {
/* verbatim : inline */
verbatimblock,
-context|div.verbatimblock {
+div.verbatimblock {
background-color : rgb(50%,50%,100%) ;
display : block ;
padding : 1em ;
@@ -460,19 +460,19 @@ context|div.verbatimblock {
}
verbatimlines+verbatimlines,
-context|div.verbatimlines+context|div.verbatimlines {
+div.verbatimlines+div.verbatimlines {
display : block ;
margin-top : 1em ;
}
verbatimline,
-context|div.verbatimline {
+div.verbatimline {
display : block ;
white-space : pre-wrap ;
}
verbatim,
-context|div.verbatim {
+div.verbatim {
display : inline ;
white-space : pre-wrap ;
color : rgb(60%,60%,0%) ;
@@ -484,26 +484,26 @@ context|div.verbatim {
/* linenumber : inline */
lines,
-context|div.lines {
+div.lines {
display : block ;
margin-bottom : 1em ;
margin-top : 1em ;
}
lines+lines,
-context|div.lines+context|div.lines {
+div.lines+div.lines {
display : block ;
margin-top : 1em ;
}
line,
-context|div.line {
+div.line {
display : block ;
white-space : pre-wrap ;
}
linenumber,
-context|div.linenumber {
+div.linenumber {
display : inline-block ;
margin-right : 1em ;
width : 3em ;
@@ -516,8 +516,8 @@ context|div.linenumber {
sorting,
synonym,
-context|div.sorting,
-context|div.synonym {
+div.sorting,
+div.synonym {
display : inline ;
font-variant : small-caps ;
}
@@ -533,17 +533,17 @@ context|div.synonym {
/* registerpagerange : mixed */
register,
-context|div.register {
+div.register {
display: none ;
}
registerlocation,
-context|div.registerlocation {
+div.registerlocation {
display: inline ;
}
registerlocation:after,
-context|div.registerlocation:after {
+div.registerlocation:after {
content : "\25B6\00A0\00A0" ;
color : rgb(40%,40%,40%) ;
font-size : x-small ;
@@ -559,38 +559,38 @@ context|div.registerlocation:after {
/* we have a few bonus mappings here */
table,
-context|div.table {
+div.table {
display : table ;
}
tablerow, tr
-context|div.tablerow, context|div.tr {
+div.tablerow, div.tr {
display : table-row ;
}
tablecell[align="middle"], td[align="middle"],
-context|div.tablecell.align-middle {
+div.tablecell.align-middle {
display : table-cell ;
text-align : center ;
padding : .1em ;
}
tablecell[align="flushleft"], td[align="flushleft"],
-context|div.tablecell.align-flushleft {
+div.tablecell.align-flushleft {
display : table-cell ;
text-align : left ;
padding : .1em ;
}
tablecell[align="flushright"], td[align="flushright"],
-context|div.tablecell.align-flushright {
+div.tablecell.align-flushright {
display : table-cell ;
text-align : right ;
padding : .1em ;
}
tablecell, td
-context|div.tablecell, context|div.td {
+div.tablecell, div.td {
display : table-cell ;
text-align : left ;
padding : .1em ;
@@ -616,7 +616,7 @@ div.tbody, div.tablebody {
/* tabulatecell : mixed */
tabulate,
-context|div.tabulate {
+div.tabulate {
display : table ;
margin-top : 1em ;
margin-bottom : 1em ;
@@ -624,50 +624,50 @@ context|div.tabulate {
}
floatcontent>tabulate,
-context|div.floatcontent context|div.tabulate {
+div.floatcontent div.tabulate {
margin-left : 0em ;
}
tabulaterow,
-context|div.tabulaterow {
+div.tabulaterow {
display : table-row ;
}
tabulatecell[align="middle"],
-context|div.tabulatecell.align-middle {
+div.tabulatecell.align-middle {
display : table-cell ;
text-align : center ;
padding-right : 1em ;
}
tabulatecell[align="flushleft"],
-context|div.tabulatecell.align-flushleft {
+div.tabulatecell.align-flushleft {
display : table-cell ;
text-align : left ;
padding-right : 1em ;
}
tabulatecell[align="flushright"],
-context|div.tabulatecell.align-flushright {
+div.tabulatecell.align-flushright {
display : table-cell ;
text-align : right ;
padding-right : 1em ;
}
tabulatecell,
-context|div.tabulatecell {
+div.tabulatecell {
display : table-cell ;
text-align : left ;
padding-right : 1em ;
}
tabulatecell[kind="strong"],
-context|div.tabulatecell.kind-strong {
+div.tabulatecell.kind-strong {
font-weight : bold ;
}
tabulatecell[kind="equals"]:before,
-context|div.tabulatecell.kind-equals:before {
+div.tabulatecell.kind-equals:before {
display : inline-block ;
clear : left ;
margin-left : -.6em ;
@@ -688,26 +688,26 @@ context|div.tabulatecell.kind-equals:before {
/* combinationcaption : mixed */
combination,
-context|div.combination {
+div.combination {
display : table ;
margin-top : 0em ;
margin-bottom : 0em ;
}
combinationpair, combinationtext,
-context|div.combinationpair, context|div.combinationtext {
+div.combinationpair, div.combinationtext {
display : table-cell ;
padding-right : 1em ;
}
combinationcontent,
-context|div.combinationcontent {
+div.combinationcontent {
display : table-row ;
text-align : center ;
}
combinationcaption,
-context|div.combinationcaption {
+div.combinationcaption {
display : table-row ;
padding-top : 1ex ;
text-align : center ;
@@ -722,13 +722,13 @@ context|div.combinationcaption {
/* listtext : inline */
list,
-context|div.list {
+div.list {
display : block ;
text-align : left ;
}
listitem[detail="chapter"],
-context|div.listitem.chapter {
+div.listitem.chapter {
display : block ;
margin-top : 1em ;
margin-left : 5em ;
@@ -736,32 +736,32 @@ context|div.listitem.chapter {
}
listitem[detail="section"],
-context|div.listitem.section {
+div.listitem.section {
display : block ;
margin-left : 5em ;
}
listitem[detail="subsection"],
-context|div.listitem.subsection {
+div.listitem.subsection {
display : block ;
margin-left : 5em ;
}
/*
listitem[detail="subsection"],
-context|div.listitem.subsection {
+div.listitem.subsection {
display : inline-block ;
margin-left : -5em ;
}
listitem[detail="subsection"]>listtag,
-context|div.listitem.subsection context|div.listtag {
+div.listitem.subsection div.listtag {
margin-right : 1em ;
}
*/
listitem[detail="chapter"]>listtag,
-context|div.listitem.chapter > context|div.listtag {
+div.listitem.chapter > div.listtag {
display : inline-block ;
margin-left : -5em ;
float : left ;
@@ -769,7 +769,7 @@ context|div.listitem.chapter > context|div.listtag {
}
listitem[detail="section"]>listtag,
-context|div.listitem.section > context|div.listtag {
+div.listitem.section > div.listtag {
display : inline-block ;
margin-left : -5em ;
float : left ;
@@ -777,7 +777,7 @@ context|div.listitem.section > context|div.listtag {
}
listitem[detail="subsection"]>listtag,
-context|div.listitem.subsection > context|div.listtag {
+div.listitem.subsection > div.listtag {
display : inline-block ;
margin-left : -5em ;
float : left ;
@@ -785,22 +785,22 @@ context|div.listitem.subsection > context|div.listtag {
}
listcontent,
-context|div.listcontent {
+div.listcontent {
display : inline ;
}
listdata,
-context|div.listdata {
+div.listdata {
display : inline ;
}
listpage,
-context|div.listpage {
+div.listpage {
display : none ;
}
listtext,
-context|div.listtext {
+div.listtext {
display : inline ;
}
@@ -816,75 +816,75 @@ context|div.listtext {
delimited[detail="quotation"]:before,
delimitedblock[detail="quotation"]:before,
-context|div.delimited.quotation:before,
-context|div.delimitedblock.quotation:before {
+div.delimited.quotation:before,
+div.delimitedblock.quotation:before {
/* content : "\201C" ; */
font-style : italic ;
}
delimited[detail="quotation"]:after,
delimitedblock[detail="quotation"]:after,
-context|div.delimited.quotation:after,
-context|div.delimitedblock.quotation:after {
+div.delimited.quotation:after,
+div.delimitedblock.quotation:after {
/* content : "\201D" ; */
font-style : italic ;
}
delimited[detail="quote"]:before,
delimitedblock[detail="quote"]:before,
-context|div.delimited.quote:before,
-context|div.delimitedblock.quote:before {
+div.delimited.quote:before,
+div.delimitedblock.quote:before {
/* content : "\2018" ; */
font-style : italic ;
}
delimited[detail="quote"]:after,
delimitedblock[detail="quote"]:after,
-context|div.delimited.quote:after,
-context|div.delimitedblock.quote:after {
+div.delimited.quote:after,
+div.delimitedblock.quote:after {
/* content : "\2019" ; */
font-style : italic ;
}
delimited,
-context|div.delimited {
+div.delimited {
display : inline
}
delimitedcontent,
-context|div.delimitedcontent {
+div.delimitedcontent {
display : inline
}
delimitedsymbol,
-context|div.delimitedsymbol {
+div.delimitedsymbol {
display : inline
}
delimitedblock,
-context|div.delimitedblock {
+div.delimitedblock {
display : block
}
subsentence:before,
subsentence:after,
-context|div.subsentence:before,
-context|div.subsentence:after {
+div.subsentence:before,
+div.subsentence:after {
content : "\2014" ;
}
subsentence,
-context|div.subsentence {
+div.subsentence {
display : inline
}
subsentencecontent,
-context|div.subsentencecontent {
+div.subsentencecontent {
display : inline
}
subsentencesymbol,
-context|div.subsentencesymbol {
+div.subsentencesymbol {
display : inline
}
@@ -899,7 +899,7 @@ context|div.subsentencesymbol {
/* floatcontent : mixed */
float,
-context|div.float {
+div.float {
display : block ;
margin-top : 1em ;
margin-bottom : 1em ;
@@ -907,33 +907,33 @@ context|div.float {
}
floatcaption,
-context|div.floatcaption {
+div.floatcaption {
display : block ;
margin-top : 0.5em ;
color : rgb(60%,60%,0%) ;
}
floatlabel,
-context|div.floatlabel {
+div.floatlabel {
display : inline-block ;
font-weight : bold ;
margin-right : 0.25em ;
}
floatnumber,
-context|div.floatnumber {
+div.floatnumber {
display : inline ;
font-weight : bold ;
margin-right : 0.25em ;
}
floattext,
-context|div.floattext {
+div.floattext {
display : inline ;
}
floatcontent,
-context|div.floatcontent {
+div.floatcontent {
}
/* image : mixed */
@@ -948,13 +948,13 @@ context|div.floatcontent {
} */
mpgraphic:before,
-context|div.mpgraphic:before {
+div.mpgraphic:before {
/* does not work with empty element */
content : "[runtime metapost graphic]" ;
}
mpgraphic,
-context|div.mpgraphic {
+div.mpgraphic {
display : inline ;
}
@@ -967,15 +967,16 @@ context|div.mpgraphic {
/* formulacontent : display */
formula,
-context|div.formula {
- display : block ;
+div.formula {
+ xdisplay : block ;
+ display : table ;
margin-top : 1em ;
margin-bottom : 1em ;
margin-left : 2.5em ;
}
subformula,
-context|div.subformula { /* todo */
+div.subformula { /* todo */
display : block ;
margin-top : 1em ;
margin-bottom : 1em ;
@@ -983,7 +984,7 @@ context|div.subformula { /* todo */
}
formulaset,
-context|div.formulaset { /* todo */
+div.formulaset { /* todo */
display : block ;
margin-top : 1em ;
margin-bottom : 1em ;
@@ -991,32 +992,37 @@ context|div.formulaset { /* todo */
}
formulacaption,
-context|div.formulacaption { /* todo */
- display : block ;
- margin-top : 0.5em ;
- color : rgb(60%,60%,0%) ;
+div.formulacaption { /* todo */
+ xdisplay : block ;
+ display : table-cell ;
+ margin-top : 0.5em ;
+ padding-left : 2em ;
+ color : rgb(60%,60%,0%) ;
}
formulalabel,
-context|div.formulalabel {
+div.formulalabel {
display : inline ;
font-weight : bold ;
margin-right : .25em ;
}
formulanumber,
-context|div.formulanumber {
+div.formulanumber {
display : inline ;
font-weight : bold ;
+ margin-left : 0em ;
}
formulacontent,
-context|div.formulacontent {
- display : block ;
+div.formulacontent {
+ xdisplay : block ;
+ display : table-cell ;
+ margin-left : 0em ;
}
link,
-context|div.link {
+div.link {
display : inline ;
}
@@ -1024,7 +1030,7 @@ context|div.link {
/* margintext : inline */
margintext,
-context|div.margintext {
+div.margintext {
display : block ;
font-weight : bold ;
margin-top : 1em ;
@@ -1032,7 +1038,7 @@ context|div.margintext {
}
margintext:before,
-context|div.margintext:before {
+div.margintext:before {
content : "\25B6\00A0\00A0" ;
color : rgb(40%,40%,40%) ;
}
@@ -1060,12 +1066,12 @@ context|div.margintext:before {
/* mtr : display */
/* mtd : display */
-context|div.math-inline {
+div.math-inline {
display : inline ;
vertical-align : 0 ; /* this will be set directly */
}
-context|div.math-display {
+div.math-display {
display : block ;
margin : 1ex 0ex 1em 3em ;
}
@@ -1074,12 +1080,12 @@ context|div.math-display {
/* pubfld : inline */
publication,
-context|div.publication {
+div.publication {
display : inline ;
}
pubfld[detail="title"],
-context|div.pubfld.title {
+div.pubfld.title {
display : inline ;
font-weight : italic ;
}
@@ -1089,17 +1095,17 @@ context|div.pubfld.title {
/* number : inline */
quantity,
-context|div.quantity {
+div.quantity {
display : inline-block ;
}
quantity>unit,
-context|div.quantity>context|div.unit {
+div.quantity>div.unit {
display : inline ;
}
quantity>number,
-context|div.quantity>context|div.number {
+div.quantity>div.number {
display : inline ;
}
@@ -1108,34 +1114,34 @@ context|div.quantity>context|div.number {
/* subsup : inline */
sup,
-context|div.sup {
+div.sup {
display : inline-block ;
font-size : xx-small ;
vertical-align : super ;
}
sub,
-context|div.sub {
+div.sub {
display : inline-block ;
font-size : xx-small ;
vertical-align : sub ;
}
subsup>sup,
-context|div.subsup>context|div.sup {
+div.subsup>div.sup {
display : inline ;
vertical-align : top ;
}
subsup>sub,
-context|div.subsup>context|div.sub {
+div.subsup>div.sub {
display : inline ;
vertical-align : bottom ;
}
/* links */
-context|div[href]:hover {
+div[href]:hover {
color : rgb(50%,0%,0%) ;
background-color : rgb(85%,85%,85%) ;
}
@@ -1143,12 +1149,12 @@ context|div[href]:hover {
/* setups */
setup,
-context|div.setup {
+div.setup {
display : block ;
}
comment,
-context|div.comment {
+div.comment {
background-color : rgb(50%,75%,100%) ;
display : block ;
padding : 1em ;
@@ -1160,18 +1166,18 @@ context|div.comment {
/* blocks */
block,
-context|div.block {
+div.block {
display : block ;
}
/* special */
c,
-context|div.c {
+div.c {
display : inline ;
}
warning,
-context|div.warning {
+div.warning {
display : none ;
}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/file-job.lua b/Master/texmf-dist/tex/context/base/mkiv/file-job.lua
index 97e223387dc..0d26cdfb259 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/file-job.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/file-job.lua
@@ -49,6 +49,8 @@ local cleanpath = resolvers.cleanpath
local toppath = resolvers.toppath
local resolveprefix = resolvers.resolve
+local currentfile = luatex.currentfile
+
local hasscheme = url.hasscheme
local jobresolvers = resolvers.jobs
@@ -791,7 +793,8 @@ end
local function autoname(name)
if name == "*" then
- name = nameonly(toppath() or name)
+ -- name = nameonly(toppath() or name)
+ name = nameonly(currentfile() or name)
end
return name
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/file-lib.lua b/Master/texmf-dist/tex/context/base/mkiv/file-lib.lua
index 9b0679e250d..50ac5e1db34 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/file-lib.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/file-lib.lua
@@ -18,10 +18,11 @@ local report_library = logs.reporter("files","library")
----- report_files = logs.reporter("files","readfile")
local removesuffix = file.removesuffix
+local collapsepath = file.collapsepath
local getreadfilename = resolvers.getreadfilename
-local loaded = { }
+local libraries = table.setmetatableindex("table")
local defaultpatterns = { "%s" }
local function defaultaction(name,foundname)
@@ -46,6 +47,7 @@ function resolvers.uselibrary(specification) -- todo: reporter
local foundname = getreadfilename("any",".",somename) -- maybe some day also an option not to backtrack .. and ../.. (or block global)
return foundname ~= "" and foundname
end
+ local loaded = libraries[patterns]
for i=1,#files do
local filename = files[i]
if not loaded[filename] then
@@ -76,17 +78,25 @@ function resolvers.uselibrary(specification) -- todo: reporter
end
end
end
- if not loaded[foundname] then
- if foundname then
- action(name,foundname)
+ if type(foundname) == "string" then
+ if not loaded[foundname] then
+ if foundname then
+ foundname = collapsepath(foundname)
+ -- this way we can run a module (nil when making a format):
+ local inputname = environment.inputfilename
+ if not inputname or collapsepath(inputname) ~= foundname then
+ action(name,foundname)
+ end
+ -- afterwards:
+ if onlyonce then
+ loaded[foundname] = true -- todo: base this on return value
+ end
+ elseif failure then
+ failure(name)
+ end
if onlyonce then
- loaded[foundname] = true -- todo: base this on return value
+ loaded[filename] = true -- todo: base this on return value
end
- elseif failure then
- failure(name)
- end
- if onlyonce then
- loaded[filename] = true -- todo: base this on return value
end
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/file-res.lua b/Master/texmf-dist/tex/context/base/mkiv/file-res.lua
index 16afae4c7ab..3ed7abc8d3d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/file-res.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/file-res.lua
@@ -59,18 +59,20 @@ local function readfilename(specification,backtrack,treetoo)
end
end
if not fnd and backtrack then
+ local path = environment.arguments.runpath and environment.arguments.path or ""
for i=1,#names do
local fname = names[i]
for i=1,backtrack,1 do
fname = "../" .. fname
- if isfile(fname) then
+ local pname = path and (path ~= "") and (path .. "/" .. fname) or fname
+ if isfile(pname) then
if trace_files then
- report_files("found by backtracking: %s",fname)
+ report_files("found by backtracking: %s",pname)
end
- fnd = fname
+ fnd = pname
break
elseif trace_files then
- report_files("not found by backtracking: %s",fname)
+ report_files("not found by backtracking: %s",pname)
end
end
if fnd then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-cff.lua b/Master/texmf-dist/tex/context/base/mkiv/font-cff.lua
index 4e2981011ac..c71c3aef33a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-cff.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-cff.lua
@@ -29,7 +29,7 @@ if not modules then modules = { } end modules ['font-cff'] = {
local next, type, tonumber, rawget = next, type, tonumber, rawget
local byte, char, gmatch, sub = string.byte, string.char, string.gmatch, string.sub
-local concat, remove, unpack = table.concat, table.remove, table.unpack
+local concat, insert, remove, unpack = table.concat, table.insert, table.remove, table.unpack
local floor, abs, round, ceil, min, max = math.floor, math.abs, math.round, math.ceil, math.min, math.max
local P, C, R, S, C, Cs, Ct = lpeg.P, lpeg.C, lpeg.R, lpeg.S, lpeg.C, lpeg.Cs, lpeg.Ct
local lpegmatch = lpeg.match
@@ -348,11 +348,11 @@ do
top = 0
end
+ P("\10") / function()
- result.strhw = stack[top]
+ result.stdhw = stack[top]
top = 0
end
+ P("\11") / function()
- result.strvw = stack[top]
+ result.stdvw = stack[top]
top = 0
end
+ P("\13") / function()
@@ -453,7 +453,7 @@ do
top = 0
end
+ P("\10") / function()
- result.bluesnap = stack[top]
+ result.blueshift = stack[top]
top = 0
end
+ P("\11") / function()
@@ -528,7 +528,7 @@ do
-- the second variant is much faster. Not that it matters much as we don't see
-- such numbers often.
- local remap = {
+ local remap_1 = {
["\x00"] = "00", ["\x01"] = "01", ["\x02"] = "02", ["\x03"] = "03", ["\x04"] = "04", ["\x05"] = "05", ["\x06"] = "06", ["\x07"] = "07", ["\x08"] = "08", ["\x09"] = "09", ["\x0A"] = "0.", ["\x0B"] = "0E", ["\x0C"] = "0E-", ["\x0D"] = "0", ["\x0E"] = "0-", ["\x0F"] = "0",
["\x10"] = "10", ["\x11"] = "11", ["\x12"] = "12", ["\x13"] = "13", ["\x14"] = "14", ["\x15"] = "15", ["\x16"] = "16", ["\x17"] = "17", ["\x18"] = "18", ["\x19"] = "19", ["\x1A"] = "1.", ["\x1B"] = "1E", ["\x1C"] = "1E-", ["\x1D"] = "1", ["\x1E"] = "1-", ["\x1F"] = "1",
["\x20"] = "20", ["\x21"] = "21", ["\x22"] = "22", ["\x23"] = "23", ["\x24"] = "24", ["\x25"] = "25", ["\x26"] = "26", ["\x27"] = "27", ["\x28"] = "28", ["\x29"] = "29", ["\x2A"] = "2.", ["\x2B"] = "2E", ["\x2C"] = "2E-", ["\x2D"] = "2", ["\x2E"] = "2-", ["\x2F"] = "2",
@@ -544,11 +544,18 @@ do
["\xC0"] = "E-0", ["\xC1"] = "E-1", ["\xC2"] = "E-2", ["\xC3"] = "E-3", ["\xC4"] = "E-4", ["\xC5"] = "E-5", ["\xC6"] = "E-6", ["\xC7"] = "E-7", ["\xC8"] = "E-8", ["\xC9"] = "E-9", ["\xCA"] = "E-.", ["\xCB"] = "E-E", ["\xCC"] = "E-E-", ["\xCD"] = "E-", ["\xCE"] = "E--", ["\xCF"] = "E-",
["\xD0"] = "-0", ["\xD1"] = "-1", ["\xD2"] = "-2", ["\xD3"] = "-3", ["\xD4"] = "-4", ["\xD5"] = "-5", ["\xD6"] = "-6", ["\xD7"] = "-7", ["\xD8"] = "-8", ["\xD9"] = "-9", ["\xDA"] = "-.", ["\xDB"] = "-E", ["\xDC"] = "-E-", ["\xDD"] = "-", ["\xDE"] = "--", ["\xDF"] = "-",
}
+ local remap_2 = {
+ ["\x0F"] = "0", ["\x1F"] = "1", ["\x2F"] = "2", ["\x3F"] = "3", ["\x4F"] = "4",
+ ["\x5F"] = "5", ["\x6F"] = "6", ["\x7F"] = "7", ["\x8F"] = "8", ["\x9F"] = "9",
+ }
+
+ local p_last_1 = S("\x0F\x1F\x2F\x3F\x4F\x5F\x6F\x7F\x8F\x9F\xAF\xBF")
+ local p_last_2 = R("\xF0\xFF")
- local p_last = S("\x0F\x1F\x2F\x3F\x4F\x5F\x6F\x7F\x8F\x9F\xAF\xBF")
- + R("\xF0\xFF")
+ -- tricky, we don't want to append last
- local p_nibbles = P("\30") * Cs(((1-p_last)/remap)^0 * (P(1)/remap)) / function(n)
+ -- local p_nibbles = P("\30") * Cs(((1-p_last)/remap)^0 * (P(1)/remap)) / function(n)
+ local p_nibbles = P("\30") * Cs(((1-(p_last_1+p_last_2))/remap_1)^0 * (p_last_1/remap_2 + p_last_2/"")) / function(n)
-- 0-9=digit a=. b=E c=E- d=reserved e=- f=finish
top = top + 1
stack[top] = tonumber(n) or 0
@@ -572,6 +579,11 @@ do
stack[top] = -(byte(b0)-251)*256 - byte(b1) - 108
end
+ -- local p_float = P("\255") * C(1) * C(1) * C(1) * C(1) / function(b0,b1,b2,b3)
+ -- top = top + 1
+ -- stack[top] = 0
+ -- end
+
local p_short = P("\28") * C(1) * C(1) / function(b1,b2)
-- -32768 .. +32767 : b1<<8 | b2
top = top + 1
@@ -607,6 +619,7 @@ do
+ p_nibbles
+ p_single
+ p_double
+ -- + p_float
+ p_unsupported
)^1
@@ -701,6 +714,7 @@ do
local y = 0
local width = false
local lsb = 0
+ local result = { }
local r = 0
local stems = 0
local globalbias = 0
@@ -728,8 +742,13 @@ do
local seacs = { }
local procidx = nil
- local function showstate(where)
- report("%w%-10s : [%s] n=%i",depth*2,where,concat(stack," ",1,top),top)
+ local function showstate(where,i,n)
+ if i then
+ local j = i + n - 1
+ report("%w%-10s : [%s] step",depth*2+2,where,concat(stack," ",i,j <= top and j or top))
+ else
+ report("%w%-10s : [%s] n=%i",depth*2,where,concat(stack," ",1,top),top)
+ end
end
local function showvalue(where,value,showstack)
@@ -745,6 +764,13 @@ do
-- some back. I inlined some of then and a bit speed can be gained by more
-- inlining but not that much.
+ -- Maybe have several action tables:
+ --
+ -- keep curve / checked
+ -- keep curve / not checked
+ -- checked
+ -- not checked
+
local function xymoveto()
if keepcurve then
r = r + 1
@@ -859,9 +885,9 @@ do
end
end
- local function xycurveto(x1,y1,x2,y2,x3,y3) -- called local so no blend here
+ local function xycurveto(x1,y1,x2,y2,x3,y3,i,n) -- called local so no blend here
if trace_charstrings then
- showstate("curveto")
+ showstate("curveto",i,n)
end
if keepcurve then
r = r + 1
@@ -1005,6 +1031,16 @@ do
if trace_charstrings then
showstate("rrcurveto")
end
+if top == 6 then
+ local ax = x + stack[1] -- dxa
+ local ay = y + stack[2] -- dya
+ local bx = ax + stack[3] -- dxb
+ local by = ay + stack[4] -- dyb
+ x = bx + stack[5] -- dxc
+ y = by + stack[6] -- dyc
+ xycurveto(ax,ay,bx,by,x,y,1,6)
+else
+-- print("rr",top==6,top)
for i=1,top,6 do
local ax = x + stack[i] -- dxa
local ay = y + stack[i+1] -- dya
@@ -1012,8 +1048,9 @@ do
local by = ay + stack[i+3] -- dyb
x = bx + stack[i+4] -- dxc
y = by + stack[i+5] -- dyc
- xycurveto(ax,ay,bx,by,x,y)
+ xycurveto(ax,ay,bx,by,x,y,i,6)
end
+end
top = 0
end
@@ -1026,6 +1063,15 @@ do
y = y + stack[1] -- dy1
s = 2
end
+if top == 4 then
+ local ax = x + stack[1] -- dxa
+ local ay = y
+ local bx = ax + stack[2] -- dxb
+ local by = ay + stack[3] -- dyb
+ x = bx + stack[4] -- dxc
+ y = by
+ xycurveto(ax,ay,bx,by,x,y,1,4)
+else
for i=s,top,4 do
local ax = x + stack[i] -- dxa
local ay = y
@@ -1033,8 +1079,9 @@ do
local by = ay + stack[i+2] -- dyb
x = bx + stack[i+3] -- dxc
y = by
- xycurveto(ax,ay,bx,by,x,y)
+ xycurveto(ax,ay,bx,by,x,y,i,4)
end
+end
top = 0
end
@@ -1048,6 +1095,16 @@ do
d = stack[1] -- dx1
s = 2
end
+if top == 4 then
+ local ax = x + d
+ local ay = y + stack[1] -- dya
+ local bx = ax + stack[2] -- dxb
+ local by = ay + stack[3] -- dyb
+ x = bx
+ y = by + stack[4] -- dyc
+ xycurveto(ax,ay,bx,by,x,y,1,4)
+ d = 0
+else
for i=s,top,4 do
local ax = x + d
local ay = y + stack[i] -- dya
@@ -1055,9 +1112,10 @@ do
local by = ay + stack[i+2] -- dyb
x = bx
y = by + stack[i+3] -- dyc
- xycurveto(ax,ay,bx,by,x,y)
+ xycurveto(ax,ay,bx,by,x,y,i,4)
d = 0
end
+end
top = 0
end
@@ -1066,6 +1124,33 @@ do
if last then
top = top - 1
end
+if top == 4 then
+ local ax, ay, bx, by
+ if swap then
+ ax = x + stack[1]
+ ay = y
+ bx = ax + stack[2]
+ by = ay + stack[3]
+ y = by + stack[4]
+ if last then
+ x = bx + last
+ else
+ x = bx
+ end
+ else
+ ax = x
+ ay = y + stack[1]
+ bx = ax + stack[2]
+ by = ay + stack[3]
+ x = bx + stack[4]
+ if last then
+ y = by + last
+ else
+ y = by
+ end
+ end
+ xycurveto(ax,ay,bx,by,x,y,1 ,4)
+else
for i=1,top,4 do
local ax, ay, bx, by
if swap then
@@ -1093,8 +1178,9 @@ do
end
swap = true
end
- xycurveto(ax,ay,bx,by,x,y)
+ xycurveto(ax,ay,bx,by,x,y,i,4)
end
+end
top = 0
end
@@ -1123,7 +1209,7 @@ do
local by = ay + stack[i+3] -- dyb
x = bx + stack[i+4] -- dxc
y = by + stack[i+5] -- dyc
- xycurveto(ax,ay,bx,by,x,y)
+ xycurveto(ax,ay,bx,by,x,y,i,6)
end
x = x + stack[top-1] -- dxc
y = y + stack[top] -- dyc
@@ -1628,7 +1714,8 @@ do
-- todo: round in blend
- local encode = { }
+ local encode = { }
+ local typeone = false
-- this eventually can become a helper
@@ -1645,15 +1732,13 @@ do
end
for i=108,1131 do
local v = 0xF700 + i - 108
--- t[i] = char(band(rshift(v,8),0xFF),band(v,0xFF))
t[i] = char(extract(v,8,8),extract(v,0,8))
end
for i=1132,2048 do
t[i] = char(28,band(rshift(i,8),0xFF),band(i,0xFF))
end
- -- we could inline some ...
setmetatableindex(encode,function(t,k)
- -- 16.16-bit signed fixed value
+ -- as we're cff2 we write 16.16-bit signed fixed value
local r = round(k)
local v = rawget(t,r)
if v then
@@ -1758,42 +1843,6 @@ do
-- precompiling and reuse is much slower than redoing the calls
- -- local function decode(str)
- -- local a, b, c, d, e = byte(str,1,5)
- -- if a == 28 then
- -- if c then
- -- local n = 0x100 * b + c
- -- if n >= 0x8000 then
- -- return n - 0x10000
- -- else
- -- return n
- -- end
- -- end
- -- elseif a < 32 then
- -- return false
- -- elseif a <= 246 then
- -- return a - 139
- -- elseif a <= 250 then
- -- if b then
- -- return a*256 - 63124 + b
- -- end
- -- elseif a <= 254 then
- -- if b then
- -- return -a*256 + 64148 - b
- -- end
- -- else
- -- if e then
- -- local n = 0x100 * b + c
- -- if n >= 0x8000 then
- -- return n - 0x10000 + (0x100 * d + e)/0xFFFF
- -- else
- -- return n + (0x100 * d + e)/0xFFFF
- -- end
- -- end
- -- end
- -- return false
- -- end
-
process = function(tab)
local i = 1
local n = #tab
@@ -1817,14 +1866,20 @@ do
-- stack[top] = -t*256 + 251*256 - tab[i+1] - 108
stack[top] = -t*256 + 64148 - tab[i+1]
i = i + 2
+ elseif typeone then
+ local n = 0x1000000 * tab[i+1] + 0x10000 * tab[i+2] + 0x100 * tab[i+3] + tab[i+4]
+ if n >= 0x8000000 then
+ n = n - 0xFFFFFFFF - 1
+ end
+ stack[top] = n
+ i = i + 5
else
- -- a 16.16 float
- local n = 0x100 * tab[i+1] + tab[i+2]
- if n >= 0x8000 then
- stack[top] = n - 0x10000 + (0x100 * tab[i+3] + tab[i+4])/0xFFFF
- else
- stack[top] = n + (0x100 * tab[i+3] + tab[i+4])/0xFFFF
+ local n1 = 0x100 * tab[i+1] + tab[i+2]
+ local n2 = 0x100 * tab[i+3] + tab[i+4]
+ if n1 >= 0x8000 then
+ n1 = n1 - 0x10000
end
+ stack[top] = n1 + n2/0xFFFF
i = i + 5
end
elseif t == 28 then
@@ -1917,7 +1972,8 @@ do
-- cff 1: (when cff2 strip them)
elseif t == 1 or t == 3 or t == 18 or operation == 23 then
p_getstem() -- at the start
- if true then
+ if version == "cff" then
+-- if true then
if top > 0 then
for i=1,top do
r = r + 1 ; result[r] = encode[stack[i]]
@@ -1932,6 +1988,7 @@ do
-- cff 1: (when cff2 strip them)
elseif t == 19 or t == 20 then
local s = p_getmask() or 0 -- after the stems
+-- if version == "cff" then
if true then
if top > 0 then
for i=1,top do
@@ -1955,7 +2012,8 @@ do
i = i + 1
elseif t == 13 then
hsbw()
- if version == "cff" then
+-- if version == "cff" then
+ if true then
-- we do a moveto over lsb
r = r + 1 ; result[r] = encode[lsb]
r = r + 1 ; result[r] = chars[22]
@@ -1968,8 +2026,40 @@ do
showstate(reverse[t] or "<action>")
end
if top > 0 then
- for i=1,top do
- r = r + 1 ; result[r] = encode[stack[i]]
+ -- if t == 8 and top > 42 then
+ if t == 8 and top > 48 then
+ -- let's assume this only happens for rrcurveto .. the other ones would need some more
+ -- complex handling (cff2 stuff)
+ --
+ -- dx1 dy1 (dx1+dx2) (dy1+dy2) (dx1+dx2+dx3) (dy1+dy2+dy3) rcurveto.
+ local n = 0
+ for i=1,top do
+ -- if n == 42 then
+ if n == 48 then
+-- local zero = encode[0]
+-- local res3 = result[r-3]
+-- local res2 = result[r-2]
+-- local res1 = result[r-1]
+-- local res0 = result[r]
+-- result[r-3] = zero
+-- result[r-2] = zero
+ r = r + 1 ; result[r] = chars[t]
+-- r = r + 1 ; result[r] = zero
+-- r = r + 1 ; result[r] = zero
+-- r = r + 1 ; result[r] = res3
+-- r = r + 1 ; result[r] = res2
+-- r = r + 1 ; result[r] = res1
+-- r = r + 1 ; result[r] = res0
+ n = 1
+ else
+ n = n + 1
+ end
+ r = r + 1 ; result[r] = encode[stack[i]]
+ end
+ else
+ for i=1,top do
+ r = r + 1 ; result[r] = encode[stack[i]]
+ end
end
top = 0
end
@@ -2046,7 +2136,7 @@ do
end
end
- local function processshape(tab,index,hack)
+ local function processshape(glyphs,tab,index,hack)
if not tab then
glyphs[index] = {
@@ -2085,7 +2175,6 @@ do
end
process(tab)
-
if hack then
return x, y
end
@@ -2108,13 +2197,15 @@ do
r = r + 1
result[r] = c_endchar
local stream = concat(result)
+result = nil
-- if trace_charstrings then
-- report("vdata: %s",stream)
-- end
if glyph then
- glyph.stream = stream
+ glyph.stream = stream
+ glyph.width = width
else
- glyphs[index] = { stream = stream }
+ glyphs[index] = { stream = stream, width = width }
end
elseif glyph then
glyph.segments = keepcurve ~= false and result or nil
@@ -2134,6 +2225,7 @@ do
name = charset and charset[index] or nil,
-- sidebearing = 0,
}
+result = nil
else
glyphs[index] = {
boundingbox = boundingbox,
@@ -2141,7 +2233,6 @@ do
name = charset and charset[index] or nil,
}
end
-
if trace_charstrings then
report("width : %s",tostring(width))
report("boundingbox: % t",boundingbox)
@@ -2192,19 +2283,21 @@ do
return privatedata.nominalwidthx or 0, privatedata.defaultwidthx or 0
end
- parsecharstrings = function(fontdata,data,glphs,doshapes,tversion,streams,nobias)
+ parsecharstrings = function(fontdata,data,glphs,doshapes,tversion,streams,nobias,istypeone)
local dictionary = data.dictionaries[1]
local charstrings = dictionary.charstrings
keepcurve = doshapes
version = tversion
+ typeone = istypeone or false
strings = data.strings
globals = data.routines or { }
locals = dictionary.subroutines or { }
charset = dictionary.charset
vsindex = dictionary.vsindex or 0
- glyphs = glphs or { }
+
+ local glyphs = glphs or { }
globalbias, localbias = setbias(globals,locals,nobias)
nominalwidth, defaultwidth = setwidths(dictionary.private)
@@ -2212,7 +2305,7 @@ do
if charstrings then
startparsing(fontdata,data,streams)
for index=1,#charstrings do
- processshape(charstrings[index],index-1)
+ processshape(glyphs,charstrings[index],index-1)
end
if justpass and next(seacs) then
-- old type 1 stuff ... seacs
@@ -2228,7 +2321,7 @@ do
-- this is a real ugly hack but we seldom enter this branch (e.g. old lbr)
local jp = justpass
justpass = false
- local x, y = processshape(charstrings[bindex+1],bindex,true)
+ local x, y = processshape(glyphs,charstrings[bindex+1],bindex,true)
justpass = jp
--
local base = bglyph.stream
@@ -2259,7 +2352,8 @@ do
locals = dictionary.subroutines or { }
charset = false
vsindex = dictionary.vsindex or 0
- glyphs = glphs or { }
+
+ local glyphs = glphs or { }
justpass = streams == true
seacs = { }
@@ -2267,9 +2361,9 @@ do
globalbias, localbias = setbias(globals,locals,nobias)
nominalwidth, defaultwidth = setwidths(dictionary.private)
- processshape(tab,index-1)
+ processshape(glyphs,tab,index-1)
- -- return glyphs[index]
+ return glyphs[index]
end
end
@@ -2434,7 +2528,7 @@ local function readnoselect(f,fontdata,data,glyphs,doshapes,version,streams)
parseprivates(data,data.dictionaries)
readlocals(f,data,dictionary,version)
startparsing(fontdata,data,streams)
- parsecharstrings(fontdata,data,glyphs,doshapes,version,streams)
+ parsecharstrings(fontdata,data,glyphs,doshapes,version,streams,false)
stopparsing(fontdata,data)
end
@@ -2483,7 +2577,7 @@ local function readfdselect(f,fontdata,data,glyphs,doshapes,version,streams)
end
end
else
- -- unsupported format
+ report("unsupported fd index format %i",format)
end
-- hm, always
if maxindex >= 0 then
@@ -2491,21 +2585,30 @@ local function readfdselect(f,fontdata,data,glyphs,doshapes,version,streams)
if cidarray then
setposition(f,header.offset+cidarray)
local dictionaries = readlengths(f,version == "cff2")
- for i=1,#dictionaries do
- dictionaries[i] = readstring(f,dictionaries[i])
- end
- parsedictionaries(data,dictionaries)
- cid.dictionaries = dictionaries
- readcidprivates(f,data)
- for i=1,#dictionaries do
- readlocals(f,data,dictionaries[i],version)
- end
- startparsing(fontdata,data,streams)
- for i=1,#charstrings do
- parsecharstring(fontdata,data,dictionaries[fdindex[i]+1],charstrings[i],glyphs,i,doshapes,version,streams)
--- charstrings[i] = nil
+ if #dictionaries > 0 then
+ for i=1,#dictionaries do
+ dictionaries[i] = readstring(f,dictionaries[i])
+ end
+ parsedictionaries(data,dictionaries)
+ cid.dictionaries = dictionaries
+ readcidprivates(f,data)
+ for i=1,#dictionaries do
+ readlocals(f,data,dictionaries[i],version)
+ end
+ startparsing(fontdata,data,streams)
+ for i=1,#charstrings do
+ local dictionary = dictionaries[fdindex[i]+1]
+ if dictionary then
+ parsecharstring(fontdata,data,dictionary,charstrings[i],glyphs,i,doshapes,version,streams)
+ else
+ -- report("no dictionary for %a : %a => %a",version,i,fdindex[i]+1)
+ end
+ -- charstrings[i] = false
+ end
+ stopparsing(fontdata,data)
+ else
+ report("no cid dictionaries")
end
- stopparsing(fontdata,data)
else
report("no cid array")
end
@@ -2593,6 +2696,8 @@ function readers.cff(f,fontdata,specification)
cffinfo.bluefuzz = data.bluefuzz
cffinfo.stdhw = data.stdhw
cffinfo.stdvw = data.stdvw
+ cffinfo.stemsnaph = data.stemsnaph
+ cffinfo.stemsnapv = data.stemsnapv
end
end
cleanup(data,dictionaries)
@@ -2643,38 +2748,38 @@ end
-- temporary helper needed for checking backend patches
-function readers.cffcheck(filename)
- local f = io.open(filename,"rb")
- if f then
- local fontdata = {
- glyphs = { },
- }
- local header = readheader(f)
- if header.major ~= 1 then
- report("only version %s is supported for table %a",1,"cff")
- return
- end
- local names = readfontnames(f)
- local dictionaries = readtopdictionaries(f)
- local strings = readstrings(f)
- local glyphs = { }
- local data = {
- header = header,
- names = names,
- dictionaries = dictionaries,
- strings = strings,
- glyphs = glyphs,
- nofglyphs = 0,
- }
- --
- parsedictionaries(data,dictionaries,"cff")
- --
- local cid = data.dictionaries[1].cid
- if cid and cid.fdselect then
- readfdselect(f,fontdata,data,glyphs,false)
- else
- readnoselect(f,fontdata,data,glyphs,false)
- end
- return data
- end
-end
+-- function readers.cffcheck(filename)
+-- local f = io.open(filename,"rb")
+-- if f then
+-- local fontdata = {
+-- glyphs = { },
+-- }
+-- local header = readheader(f)
+-- if header.major ~= 1 then
+-- report("only version %s is supported for table %a",1,"cff")
+-- return
+-- end
+-- local names = readfontnames(f)
+-- local dictionaries = readtopdictionaries(f)
+-- local strings = readstrings(f)
+-- local glyphs = { }
+-- local data = {
+-- header = header,
+-- names = names,
+-- dictionaries = dictionaries,
+-- strings = strings,
+-- glyphs = glyphs,
+-- nofglyphs = 0,
+-- }
+-- --
+-- parsedictionaries(data,dictionaries,"cff")
+-- --
+-- local cid = data.dictionaries[1].cid
+-- if cid and cid.fdselect then
+-- readfdselect(f,fontdata,data,glyphs,false)
+-- else
+-- readnoselect(f,fontdata,data,glyphs,false)
+-- end
+-- return data
+-- end
+-- end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-cft.lua b/Master/texmf-dist/tex/context/base/mkiv/font-cft.lua
index cf6c232a606..d6afc01f70f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-cft.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-cft.lua
@@ -6,7 +6,7 @@ if not modules then modules = { } end modules ['font-cft'] = {
license = "see context related readme files"
}
--- context font tables (needs updating)
+-- context font tables (needs updating, only okay for mkiv)
--
-- todo: extra:
--
@@ -439,7 +439,7 @@ do
},
colorschemes = {
default = {
- [1] = { t_string },
+ { t_string },
}
},
files = {
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-chk.lua b/Master/texmf-dist/tex/context/base/mkiv/font-chk.lua
index e18e4b8048a..693823a8662 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-chk.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-chk.lua
@@ -64,7 +64,7 @@ local implement = interfaces.implement
local glyph_code = nodes.nodecodes.glyph
local new_special = nodes.pool.special -- todo: literal
-local hpack_node = node.hpack
+local hpack_node = nodes.hpack
local nuts = nodes.nuts
local tonut = nuts.tonut
@@ -75,7 +75,7 @@ local setchar = nuts.setchar
local nextglyph = nuts.traversers.glyph
local remove_node = nuts.remove
-local insert_node_after = nuts.insert_after
+local insertnodeafter = nuts.insertafter
-- maybe in fonts namespace
-- deletion can be option
@@ -324,7 +324,7 @@ function checkers.missing(head)
local char, font = isglyph(node)
local kind, char = placeholder(font,char)
if kind == "node" then
- insert_node_after(head,node,tonut(char))
+ insertnodeafter(head,node,tonut(char))
head = remove_node(head,node,true)
elseif kind == "char" then
setchar(node,char)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-col.lua b/Master/texmf-dist/tex/context/base/mkiv/font-col.lua
index c47a299060b..ea9b9c98c7b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-col.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-col.lua
@@ -22,7 +22,6 @@ local nuts = nodes.nuts
local setfont = nuts.setfont
------ traverse_char = nuts.traverse_char
local nextchar = nuts.traversers.char
local settings_to_hash = utilities.parsers.settings_to_hash
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-con.lua b/Master/texmf-dist/tex/context/base/mkiv/font-con.lua
index f650e5b03d6..066ea33ed2b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-con.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-con.lua
@@ -388,20 +388,20 @@ function constructors.scale(tfmdata,specification)
--
local mathsize = tonumber(specification.mathsize) or 0
local textsize = tonumber(specification.textsize) or scaledpoints
- local forcedsize = tonumber(parameters.mathsize ) or 0 -- can be set by the feature "mathsize"
+ -- local forcedsize = tonumber(parameters.mathsize ) or 0 -- can be set by the feature "mathsize"
local extrafactor = tonumber(specification.factor ) or 1
- if (mathsize == 2 or forcedsize == 2) and parameters.scriptpercentage then
- scaledpoints = parameters.scriptpercentage * textsize / 100
- elseif (mathsize == 3 or forcedsize == 3) and parameters.scriptscriptpercentage then
- scaledpoints = parameters.scriptscriptpercentage * textsize / 100
- elseif forcedsize > 1000 then -- safeguard
- scaledpoints = forcedsize
- else
- -- in context x and xx also use mathsize
- end
+ -- if context then
+ -- -- do nothing, as we moved this upstream
+ -- elseif (mathsize == 2 or forcedsize == 2) and parameters.scriptpercentage then
+ -- scaledpoints = parameters.scriptpercentage * textsize / 100
+ -- elseif (mathsize == 3 or forcedsize == 3) and parameters.scriptscriptpercentage then
+ -- scaledpoints = parameters.scriptscriptpercentage * textsize / 100
+ -- elseif forcedsize > 1000 then -- safeguard
+ -- scaledpoints = forcedsize
+ -- end
targetparameters.mathsize = mathsize -- context specific
targetparameters.textsize = textsize -- context specific
- targetparameters.forcedsize = forcedsize -- context specific
+ -- targetparameters.forcedsize = forcedsize -- context specific
targetparameters.extrafactor = extrafactor -- context specific
--
local addtounicode = constructors.addtounicode
@@ -534,7 +534,6 @@ function constructors.scale(tfmdata,specification)
local realdimensions = properties.realdimensions
local writingmode = properties.writingmode or "horizontal"
local identity = properties.identity or "horizontal"
- --
local vfonts = target.fonts
if vfonts and #vfonts > 0 then
target.fonts = fastcopy(vfonts) -- maybe we virtualize more afterwards
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-ctx.lua b/Master/texmf-dist/tex/context/base/mkiv/font-ctx.lua
index eead8abff67..2c56b5613fc 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-ctx.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-ctx.lua
@@ -1411,7 +1411,7 @@ do -- else too many locals
context(function()
busy = false
mathematics.finishfallbacks(tfmdata,specification,fallbacks)
-tfmdata.original = specification.specification
+ tfmdata.original = specification.specification
local id = definefont(tfmdata)
csnames[id] = specification.cs
properties.id = id
@@ -1449,7 +1449,7 @@ tfmdata.original = specification.specification
end)
return
else
-tfmdata.original = specification.specification
+ tfmdata.original = specification.specification
local id = definefont(tfmdata)
csnames[id] = specification.cs
properties.id = id
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-dsp.lua b/Master/texmf-dist/tex/context/base/mkiv/font-dsp.lua
index 8d7c3d359d9..f0f8e50cfcf 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-dsp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-dsp.lua
@@ -234,6 +234,24 @@ local read_integer = {
streamreader.readinteger4,
}
+directives.register("fonts.streamreader",function()
+
+ read_cardinal = {
+ streamreader.readcardinal1,
+ streamreader.readcardinal2,
+ streamreader.readcardinal3,
+ streamreader.readcardinal4,
+ }
+
+ read_integer = {
+ streamreader.readinteger1,
+ streamreader.readinteger2,
+ streamreader.readinteger3,
+ streamreader.readinteger4,
+ }
+
+end)
+
-- Traditionally we use these unique names (so that we can flatten the lookup list
-- (we create subsets runtime) but I will adapt the old code to newer names.
@@ -360,7 +378,7 @@ local function getaxisscale(segments,minimum,default,maximum,user)
for i=1,#segments do
local s = segments[i]
if type(s) ~= "number" then
- report("using default axis scale")
+ -- report("using default axis scale")
return default
elseif s[1] >= default then
if s[2] == default then
@@ -2177,6 +2195,8 @@ do
--
local usedlookups = false -- setmetatableindex("number")
--
+ local allsteps = { } -- new per 2022-09-25
+
for lookupid=1,noflookups do
local lookup = lookups[lookupid]
local lookuptype = lookup.type
@@ -2214,6 +2234,7 @@ do
steps[nofsteps] = step
local rules = step.rules
if rules then
+ allsteps[#allsteps+1] = step -- new per 2022-09-25
for i=1,#rules do
local rule = rules[i]
local before = rule.before
@@ -2329,29 +2350,31 @@ do
local reported = { }
- local function report_issue(i,what,sequence,kind)
- local name = sequence.name
- if not reported[name] then
- report("rule %i in %s lookup %a has %s lookups",i,what,name,kind)
- reported[name] = true
- end
+ local function report_issue(i,what,step,kind)
+-- if not reported[step] then
+ report("rule %i in step %i of %s has %s lookups",i,step,what,kind)
+-- reported[name] = true
+-- end
end
- for i=lastsequence+1,nofsequences do
- local sequence = sequences[i]
- local steps = sequence.steps
- for i=1,#steps do
- local step = steps[i]
+ -- for i=lastsequence+1,nofsequences do
+ -- local sequence = sequences[i]
+ -- local steps = sequence.steps
+ -- for i=1,#steps do
+ -- local step = steps[i]
+
+ for s=1,#allsteps do -- new per 2022-09-25
+ local step = allsteps[s] -- new per 2022-09-25
local rules = step.rules
if rules then
for i=1,#rules do
local rule = rules[i]
local rlookups = rule.lookups
if not rlookups then
- report_issue(i,what,sequence,"no")
+ report_issue(i,what,s,"no")
elseif not next(rlookups) then
-- can be ok as it aborts a chain sequence
- -- report_issue(i,what,sequence,"empty")
+ -- report_issue(i,what,s,"empty")
rule.lookups = nil
else
-- we can have holes in rlookups flagged false and we can have multiple lookups
@@ -2392,12 +2415,12 @@ do
sublookupcheck[lookupid] = 1
h = nofsublookups
else
- report_issue(i,what,sequence,"missing")
+ report_issue(i,what,s,"missing")
rule.lookups = nil
break
end
else
- report_issue(i,what,sequence,"bad")
+ report_issue(i,what,s,"bad")
rule.lookups = nil
break
end
@@ -2419,7 +2442,7 @@ do
end
end
end
- end
+ -- end -- new per 2022-09-25
for i, n in sortedhash(sublookupcheck) do
local l = lookups[i]
@@ -2515,7 +2538,9 @@ do
local scriptoffset = tableoffset + readushort(f)
local featureoffset = tableoffset + readushort(f)
local lookupoffset = tableoffset + readushort(f)
- local variationsoffset = version > 0x00010000 and (tableoffset + readulong(f)) or 0
+ -- MFK : Rubik-Regular.ttf : we need to delay adding the offset
+ -- local variationsoffset = version > 0x00010000 and (tableoffset + readulong(f)) or 0
+ local variationsoffset = version > 0x00010000 and readulong(f) or 0
if not scriptoffset then
return
end
@@ -2541,7 +2566,8 @@ do
end
--
if variationsoffset > 0 then
- loadvariations(f,fontdata,variationsoffset,lookuptypes,featurehash,featureorder)
+ -- loadvariations(f,fontdata,variationsoffset,lookuptypes,featurehash,featureorder)
+ loadvariations(f,fontdata,tableoffset + variationsoffset,lookuptypes,featurehash,featureorder)
end
end
end
@@ -2878,7 +2904,7 @@ local function readmathglyphinfo(f,fontdata,offset)
if not math then
glyph.math = { accent = accent }
else
- math.accent = accent
+ math.accent = accent -- will become math.topanchor
end
end
end
@@ -2968,7 +2994,7 @@ local function readmathvariants(f,fontdata,offset)
-- advance = readushort(f),
-- }
- local function get(offset,coverage,nofglyphs,construction,kvariants,kparts,kitalic)
+ local function get(offset,coverage,nofglyphs,construction,kvariants,kparts,kitalic,korientation,orientation)
if coverage ~= 0 and nofglyphs > 0 then
local coverage = readcoverage(f,offset+coverage,true)
for i=1,nofglyphs do
@@ -3033,14 +3059,23 @@ local function readmathvariants(f,fontdata,offset)
if italic and italic ~= 0 then
math[kitalic] = italic
end
+ if orientation then
+ math[korientation] = orientation
+ end
end
end
end
end
end
- get(offset,vcoverage,vnofglyphs,vconstruction,"vvariants","vparts","vitalic")
- get(offset,hcoverage,hnofglyphs,hconstruction,"hvariants","hparts","hitalic")
+ -- if LUATEXENGINE == "luametatex" then
+ if CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0 then
+ get(offset,hcoverage,hnofglyphs,hconstruction,"variants","parts","partsitalic","partsorientation","horizontal")
+ get(offset,vcoverage,vnofglyphs,vconstruction,"variants","parts","partsitalic","partsorientation","vertical")
+ else
+ get(offset,vcoverage,vnofglyphs,vconstruction,"vvariants","vparts","vitalic")
+ get(offset,hcoverage,hnofglyphs,hconstruction,"hvariants","hparts","hitalic")
+ end
end
function readers.math(f,fontdata,specification)
@@ -3072,9 +3107,11 @@ function readers.colr(f,fontdata,specification)
local tableoffset = gotodatatable(f,fontdata,"colr",specification.glyphs)
if tableoffset then
local version = readushort(f)
- if version ~= 0 then
+ if version == 0 or version == 1 then
report("table version %a of %a is not supported (yet), maybe font %s is bad",version,"colr",fontdata.filename)
return
+ else
+ -- both versions have this in common
end
if not fontdata.tables.cpal then
report("color table %a in font %a has no mandate %a table","colr",fontdata.filename,"cpal")
@@ -3806,6 +3843,7 @@ function readers.hvar(f,fontdata,specification)
end
local tableoffset = gotodatatable(f,fontdata,"hvar",specification.variable)
if not tableoffset then
+ -- report("no hvar table, expect problems due to messy widths")
return
end
@@ -3819,11 +3857,11 @@ function readers.hvar(f,fontdata,specification)
local variations = { }
local innerindex = { } -- size is mapcount
local outerindex = { } -- size is mapcount
+ local deltas = { }
if variationoffset > 0 then
regions, deltas = readvariationdata(f,variationoffset,factors)
end
-
if not regions then
-- for now .. what to do ?
return
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-enc.lua b/Master/texmf-dist/tex/context/base/mkiv/font-enc.lua
index 608539c59ad..f2f0595ddfa 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-enc.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-enc.lua
@@ -26,7 +26,7 @@ local report_encoding = logs.reporter("fonts","encoding")
local encodings = fonts.encodings or { }
fonts.encodings = encodings
-encodings.version = 1.03
+encodings.version = 1.04
encodings.cache = containers.define("fonts", "enc", fonts.encodings.version, true)
encodings.known = allocate { -- sort of obsolete
texnansi = true,
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-hsh.lua b/Master/texmf-dist/tex/context/base/mkiv/font-hsh.lua
index 7e90e15024e..89b0dc8238d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-hsh.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-hsh.lua
@@ -37,6 +37,7 @@ local italics = hashes.italics or allocate()
local lastmathids = hashes.lastmathids or allocate()
local dynamics = hashes.dynamics or allocate()
local unicodes = hashes.unicodes or allocate()
+local unislots = hashes.unislots or allocate()
local originals = hashes.originals or allocate()
local modes = hashes.modes or allocate()
local variants = hashes.variants or allocate()
@@ -59,12 +60,13 @@ hashes.italics = italics
hashes.lastmathids = lastmathids
hashes.dynamics = dynamics
hashes.unicodes = unicodes
+hashes.unislots = unislots
hashes.originals = originals
hashes.modes = modes
hashes.variants = variants
-local nodepool = nodes and nodes.pool
-local dummyglyph = nodepool and nodepool.register(nodepool.glyph())
+local nodepool = nodes and nodes.pool
+local dummyglyph = nodepool and nodepool.register(nodepool.glyph())
local nulldata = allocate {
name = "nullfont",
@@ -343,6 +345,22 @@ setmetatableindex(originals, function(t,k) -- always a unicode
end
end)
+setmetatableindex(unislots, function(t,k)
+ if k == true then
+ return unislots[currentfont()]
+ else
+ local characters = identifiers[k].characters
+ local resolved = setmetatableindex(function(t,k)
+ local c = characters[k]
+ local v = c and c.unicode or 0xFFFD
+ t[k] = v
+ return v -- can be a table !
+ end)
+ t[k] = resolved
+ return resolved
+ end
+end)
+
setmetatableindex(modes, function(t,k)
if k == true then
return modes[currentfont()]
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-imp-dimensions.lua b/Master/texmf-dist/tex/context/base/mkiv/font-imp-dimensions.lua
index 760ce37193a..9e664a68484 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-imp-dimensions.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-imp-dimensions.lua
@@ -42,6 +42,7 @@ local function initialize(tfmdata,key,value)
local newwidth = false
local newheight = false
local newdepth = false
+ local newshift = false
if value == "strut" then
newheight = gettexdimen("strutht")
newdepth = gettexdimen("strutdp")
@@ -55,6 +56,7 @@ local function initialize(tfmdata,key,value)
newwidth = spec[1]
newheight = spec[2]
newdepth = spec[3]
+ newshift = spec[4]
local quad = parameters.quad or 0
local ascender = parameters.ascender or 0
local descender = parameters.descender or 0
@@ -87,6 +89,7 @@ local function initialize(tfmdata,key,value)
parameters.x_heigth = (ascender + descender) / 2
end
end
+ -- todo: hshift too
if newwidth or newheight or newdepth then
for unicode, character in next, characters do
local oldwidth = character.width
@@ -100,8 +103,9 @@ local function initialize(tfmdata,key,value)
character.height = height
character.depth = depth
if oldwidth ~= width then
+ -- todo: xoffset
local commands = character.commands
- local hshift = rightcommand[(width - oldwidth) / 2]
+ local hshift = rightcommand[newshift or ((width - oldwidth) / 2)]
if commands then
character.commands = prependcommands (
commands,
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-imp-effects.lua b/Master/texmf-dist/tex/context/base/mkiv/font-imp-effects.lua
index 43ce82b71a6..27a16914b8e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-imp-effects.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-imp-effects.lua
@@ -207,94 +207,63 @@ local rules = {
"UnderbarRuleThickness",
}
--- local commands = char.commands
--- if commands then
--- local command = commands[1]
--- if command and command[1] == "right" then
--- commands[1] = rightcommand[command[2]-snap]
--- end
--- end
-
-- radicals are not yet ok
-local setmathparameters
-local setmathcharacters
-
-if CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0 then
-
- setmathparameters = function(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier)
- if delta ~= 0 then
- for i=1,#rules do
- local name = rules[i]
- local value = mathparameters[name]
- if value then
- mathparameters[name] = (squeeze or 1) * (value + dy)
- end
+local function setmathparameters(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier)
+ -- hm, this was "if delta ~= 0 then" but delta was gone
+ if dy ~= 0 then
+ for i=1,#rules do
+ local name = rules[i]
+ local value = mathparameters[name]
+ if value then
+ mathparameters[name] = (squeeze or 1) * (value + dy)
end
end
end
+end
- setmathcharacters = function()
- end
+local function setmathcharacters(tfmdata,characters,mathparameters,dx,dy,squeeze,wdelta,hdelta,ddelta)
-else
+ -- still not the perfect rule
- setmathparameters = function(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier)
- if delta ~= 0 then
- for i=1,#rules do
- local name = rules[i]
- local value = mathparameters[name]
- if value then
- mathparameters[name] = (squeeze or 1) * (value + dy)
- end
- end
+ local function wdpatch(char)
+ if wsnap ~= 0 then
+ char.width = char.width + wdelta/2
end
end
- setmathcharacters = function(tfmdata,characters,mathparameters,dx,dy,squeeze,wdelta,hdelta,ddelta)
-
- -- still not the perfect rule
-
- local function wdpatch(char)
- if wsnap ~= 0 then
- char.width = char.width + wdelta/2
- end
- end
-
- local function htpatch(char)
- if hsnap ~= 0 then
- local height = char.height
- if height then
- char.height = char.height + 2 * dy
- end
+ local function htpatch(char)
+ if hsnap ~= 0 then
+ local height = char.height
+ if height then
+ char.height = char.height + 2 * dy
end
end
+ end
- local character = characters[0x221A]
+ local character = characters[0x221A]
- if character and character.next then
- local char = character
- local next = character.next
+ if character and character.next then
+ local char = character
+ local next = character.next
+ wdpatch(char)
+ htpatch(char)
+ while next do
+ char = characters[next]
wdpatch(char)
htpatch(char)
- while next do
- char = characters[next]
- wdpatch(char)
- htpatch(char)
- next = char.next
- end
- if char then
- local v = char.vert_variants
- if v then
- local top = v[#v]
- if top then
- local char = characters[top.glyph]
- htpatch(char)
- end
+ next = char.next
+ end
+ if char then
+ local v = char.vert_variants
+ if v then
+ local top = v[#v]
+ if top then
+ local char = characters[top.glyph]
+ htpatch(char)
end
end
end
-
end
end
@@ -304,8 +273,6 @@ end
-- inspect(fonts.hashes.characters[f][c])
-- end }
-local shiftmode = CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0
-
local function manipulateeffect(tfmdata)
local effect = tfmdata.properties.effect
if effect then
@@ -327,49 +294,42 @@ local function manipulateeffect(tfmdata)
local factor = (1 + effect.factor) * factor
local hfactor = (1 + effect.hfactor) * hfactor
local vfactor = (1 + effect.vfactor) * vfactor
- if shiftmode then
- parameters.hshift = hshift
- parameters.vshift = vshift
- else
- vshift = vshift ~= 0 and upcommand[vshift] or false
- hshift = rightcommand[hshift]
- end
+ vshift = vshift ~= 0 and upcommand[vshift] or false
+ hshift = rightcommand[hshift]
for unicode, character in next, characters do
local oldwidth = character.width
local oldheight = character.height
local olddepth = character.depth
if oldwidth and oldwidth > 0 then
character.width = oldwidth + wdelta
- if not shiftmode then
- local commands = character.commands
- if vshift then
- if commands then
- prependcommands ( commands,
- -- show_effect,
- hshift,
- vshift
- )
- else
- character.commands = {
- -- show_effect,
- hshift,
- vshift,
- charcommand[unicode]
- }
- end
+ local commands = character.commands
+ if vshift then
+ if commands then
+ prependcommands ( commands,
+ -- show_effect,
+ hshift,
+ vshift
+ )
+ else
+ character.commands = {
+ -- show_effect,
+ hshift,
+ vshift,
+ charcommand[unicode]
+ }
+ end
+ else
+ if commands then
+ prependcommands ( commands,
+ -- show_effect,
+ hshift
+ )
else
- if commands then
- prependcommands ( commands,
- -- show_effect,
- hshift
- )
- else
- character.commands = {
- -- show_effect,
- hshift,
- charcommand[unicode]
- }
- end
+ character.commands = {
+ -- show_effect,
+ hshift,
+ charcommand[unicode]
+ }
end
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-imp-italics.lua b/Master/texmf-dist/tex/context/base/mkiv/font-imp-italics.lua
index 6c432d7cf4a..8b38c5893b6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-imp-italics.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-imp-italics.lua
@@ -6,34 +6,39 @@ if not modules then modules = { } end modules ['font-imp-italics'] = {
license = "see context related readme files"
}
-local next = next
+local next, tonumber = next, tonumber
local fonts = fonts
local handlers = fonts.handlers
local registerotffeature = handlers.otf.features.register
local registerafmfeature = handlers.afm.features.register
-local function initialize(tfmdata,key,value)
- for unicode, character in next, tfmdata.characters do
- local olditalic = character.italic
- if olditalic and olditalic ~= 0 then
- character.width = character.width + olditalic
- character.italic = 0
- end
- end
-end
-
-local specification = {
- name = "italicwidths",
- description = "add italic to width",
- manipulators = {
- base = initialize,
- node = initialize, -- only makes sense for math
- }
-}
-
-registerotffeature(specification)
-registerafmfeature(specification)
+-- This is a precursor to what we do in lmtx now via tweaks but at some point I
+-- might make this a mkiv features too using staircase kerns.
+
+-- local function initialize(tfmdata,key,value)
+-- local factor = tonumber(value) or 1
+-- for unicode, character in next, tfmdata.characters do
+-- local olditalic = character.italic
+-- if olditalic and olditalic ~= 0 then
+-- character.width = character.width + olditalic
+-- character.italic = 0
+-- character.bottomright = -factor * olditalic -- lmtx only
+-- end
+-- end
+-- end
+--
+-- local specification = {
+-- name = "italicwidths",
+-- description = "add italic to width",
+-- manipulators = {
+-- base = initialize,
+-- node = initialize, -- only makes sense for math
+-- }
+-- }
+--
+-- registerotffeature(specification)
+-- registerafmfeature(specification)
local function initialize(tfmdata,value) -- hm, always value
if value then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-imp-ligatures.lua b/Master/texmf-dist/tex/context/base/mkiv/font-imp-ligatures.lua
index 091eb5d4b45..02833707ba2 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-imp-ligatures.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-imp-ligatures.lua
@@ -104,14 +104,14 @@ local function blockligatures(str)
before = before,
current = { one, two },
after = after,
- lookups = { 1 }, -- not shared !
+ lookups = { 1, false }, -- not shared !
}
revert[new] = {
-- before = before,
current = { one, zwj },
-- after = { two, unpack(after) },
after = { two },
- lookups = { 1 }, -- not shared !
+ lookups = { 1, false }, -- not shared !
}
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-imp-math.lua b/Master/texmf-dist/tex/context/base/mkiv/font-imp-math.lua
index d2294e93c6f..624f39f029b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-imp-math.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-imp-math.lua
@@ -16,57 +16,41 @@ local registerotffeature = fonts.handlers.otf.features.register
local setmetatableindex = table.setmetatableindex
--- requested for latex but not supported unless really needed in context:
+-- local splitter = lpeg.splitat(",",tonumber)
+-- local lpegmatch = lpeg.match
--
--- registerotffeature {
--- name = "ignoremathconstants",
--- description = "ignore math constants table",
--- initializers = {
--- base = function(tfmdata,value)
--- if value then
--- tfmdata.mathparameters = nil
+-- local function initialize(tfmdata,value)
+-- local mathparameters = tfmdata.mathparameters
+-- if mathparameters then
+-- local sup, sub
+-- if type(value) == "string" then
+-- sup, sub = lpegmatch(splitter,value)
+-- if not sup then
+-- sub, sup = 0, 0
+-- elseif not sub then
+-- sub, sup = sup, 0
-- end
+-- elseif type(value) == "number" then
+-- sup, sub = 0, value
+-- end
+-- if sup then
+-- mathparameters.NoLimitSupFactor = sup
+-- end
+-- if sub then
+-- mathparameters.NoLimitSubFactor = sub
-- end
+-- end
+-- end
+--
+-- registerotffeature {
+-- name = "mathnolimitsmode",
+-- description = "influence nolimits placement",
+-- initializers = {
+-- base = initialize,
+-- node = initialize,
-- }
-- }
--- tfmdata.properties.mathnolimitsmode = tonumber(value) or 0
-
-local splitter = lpeg.splitat(",",tonumber)
-local lpegmatch = lpeg.match
-
-local function initialize(tfmdata,value)
- local mathparameters = tfmdata.mathparameters
- if mathparameters then
- local sup, sub
- if type(value) == "string" then
- sup, sub = lpegmatch(splitter,value)
- if not sup then
- sub, sup = 0, 0
- elseif not sub then
- sub, sup = sup, 0
- end
- elseif type(value) == "number" then
- sup, sub = 0, value
- end
- if sup then
- mathparameters.NoLimitSupFactor = sup
- end
- if sub then
- mathparameters.NoLimitSubFactor = sub
- end
- end
-end
-
-registerotffeature {
- name = "mathnolimitsmode",
- description = "influence nolimits placement",
- initializers = {
- base = initialize,
- node = initialize,
- }
-}
-
local function initialize(tfmdata,value)
tfmdata.properties.nostackmath = value and true
end
@@ -108,7 +92,8 @@ function fonts.helpers.mathscriptslots(tfmdata,textcode)
end
end
end
-local function initialize(tfmdata,key,value)
+
+local function initialize(tfmdata,value)
if value then
local rawdata = tfmdata.shared.rawdata
local rawresources = rawdata and rawdata.resources
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-imp-properties.lua b/Master/texmf-dist/tex/context/base/mkiv/font-imp-properties.lua
index 21b55aeb2b0..5405737a5bd 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-imp-properties.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-imp-properties.lua
@@ -72,10 +72,10 @@ do
extra = amount
end
end
- parameters.space = amount * emwidth
- parameters.space_stretch = stretch * emwidth
- parameters.space_shrink = shrink * emwidth
- parameters.extra_space = extra * emwidth
+ parameters.space = amount * emwidth
+ parameters.spacestretch = stretch * emwidth
+ parameters.spaceshrink = shrink * emwidth
+ parameters.extraspace = extra * emwidth
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-imp-reorder.lua b/Master/texmf-dist/tex/context/base/mkiv/font-imp-reorder.lua
index b2dec781c7d..323978cde20 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-imp-reorder.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-imp-reorder.lua
@@ -35,6 +35,7 @@ local trace_reorder = trackers.register("fonts.reorderlookups",function(v) trac
local report_reorder = logs.reporter("fonts","reorder")
local vectors = { }
+otf.vectors = vectors -- kind of private
vectors.arab = {
gsub = {
@@ -97,7 +98,7 @@ function otf.reorderlookups(tfmdata,vector)
if not what then
what = find(kind,"^gsub") and "gsub" or "gpos"
end
- local newwhen = order[what][feature]
+-- local newwhen = order[what][feature]
if not newwhen then
-- skip
elseif not when then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-imp-tweaks.lua b/Master/texmf-dist/tex/context/base/mkiv/font-imp-tweaks.lua
index 9cbda97fa8f..6d522e48b85 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-imp-tweaks.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-imp-tweaks.lua
@@ -10,10 +10,15 @@ if not context then return end
local addfeature = fonts.handlers.otf.addfeature
+-- The mapping directives avoids a check and copying of the (kind of special code
+-- mapping tables.
+
addfeature {
name = "uppercasing",
type = "substitution",
prepend = true,
+ mapping = true,
+ -- valid = function() return true end,
data = characters.uccodes
}
@@ -21,5 +26,115 @@ addfeature {
name = "lowercasing",
type = "substitution",
prepend = true,
+ mapping = true,
+ -- valid = function() return true end,
data = characters.lccodes
}
+
+if CONTEXTLMTXMODE > 0 then
+
+ local nuts = nodes.nuts
+ local isnextchar = nuts.isnextchar
+ local getdisc = nuts.getdisc
+ local setchar = nuts.setchar
+
+ local disc_code = nodes.nodecodes.disc
+
+ local lccodes = characters.lccodes
+ local uccodes = characters.uccodes
+
+ function fonts.handlers.otf.handlers.ctx_camelcasing(head,dataset,sequence,initialrl,font,dynamic)
+ local first = false
+ local current = head
+ -- local scale = 1000
+ -- local xscale = 1000
+ -- local yscale = 1000
+ local function check(current)
+ while current do
+ -- scale, xscale, yscale = getscales(current)
+ local nxt, char, id = isnextchar(current,font,dynamic) -- ,scale,xscale,yscale)
+ if char then
+ if first then
+ local lower = lccodes[char]
+ if lower ~= char then
+ setchar(current,lower)
+ end
+ else
+ local upper = uccodes[char]
+ if upper ~= char then
+ setchar(current,upper)
+ end
+ first = true
+ end
+ elseif id == disc_code then
+ local pre, post, replace = getdisc(current)
+ if pre then
+ check(pre)
+ end
+ if post then
+ check(post)
+ end
+ if replace then
+ check(replace)
+ end
+ else
+ first = false
+ end
+ current = nxt
+ end
+ end
+ check(current)
+ return head
+ end
+
+ addfeature {
+ nocheck = true,
+ name = "camelcasing",
+ type = "ctx_camelcasing",
+ prepend = true,
+ data = "action",
+ }
+
+end
+
+do -- for the moment this is mostly a demo feature
+
+ local digit = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" }
+ local single = { "'" }
+ local double = { '"' }
+
+ local singleprime = 0x2032 -- "′"
+ local doubleprime = 0x2033 -- "″"
+
+ addfeature {
+ -- nocheck = true,
+ name = "primes",
+ type = "chainsubstitution",
+ lookups = {
+ {
+ type = "substitution",
+ data = { ["'"] = singleprime },
+ },
+ {
+ type = "substitution",
+ data = { ["'"] = doubleprime },
+ },
+ },
+ data = {
+ rules = {
+ {
+ before = { digit },
+ current = { single },
+ after = { digit },
+ lookups = { 1 },
+ },
+ {
+ before = { digit },
+ current = { single, single },
+ lookups = { 2, 0 }, -- zero: gsub_remove
+ },
+ },
+ },
+ }
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-imp-unicode.lua b/Master/texmf-dist/tex/context/base/mkiv/font-imp-unicode.lua
index ddb965ec977..7b2cd29bf48 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-imp-unicode.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-imp-unicode.lua
@@ -18,6 +18,8 @@ local registerotffeature = fonts.handlers.otf.features.register
local extraprivates = helpers.extraprivates
local addprivate = helpers.addprivate
+local tounicode = fonts.mappings.tounicode
+
local function initialize(tfmdata)
for i=1,#extraprivates do
local e = extraprivates[i]
@@ -38,8 +40,6 @@ constructors.newfeatures.otf.register {
}
}
-local tounicode = fonts.mappings.tounicode
-
local function initialize(tfmdata,key,value)
if value == "ligatures" then
local private = fonts.constructors and fonts.constructors.privateoffset or 0xF0000
@@ -80,3 +80,25 @@ registerotffeature {
node = initialize,
}
}
+
+local function initialize(tfmdata,key,value)
+ if value then
+-- local c = tfmdata.characters[0x002D]
+-- if c then
+-- c.tounicode = tounicode(0x002D)
+-- end
+ local c = tfmdata.descriptions[0x002D]
+ if c then
+ c.tounicode = tounicode(0x002D)
+ end
+ end
+end
+
+registerotffeature {
+ name = "hardhyphen",
+ description = "hardhyphen",
+ manipulators = {
+ base = initialize,
+ node = initialize,
+ }
+}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-ini.mkvi b/Master/texmf-dist/tex/context/base/mkiv/font-ini.mkvi
index 271a81c2aa4..c51019fdd60 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-ini.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-ini.mkvi
@@ -474,15 +474,52 @@
\installcorenamespace{mappedfontsize}
+% \unexpanded\def\mapfontsize
+% {\dodoubleargument\font_basics_map_fontsize}
+
+% \def\font_basics_map_fontsize[#from][#to]%
+% {\setvalue{\??mappedfontsize\the\dimexpr#from\relax}{#to}}
+
+% \def\font_basics_set_mapped_fontsize#from%
+% {\ifcsname\??mappedfontsize\the\dimexpr#from\relax\endcsname
+% \lastnamedcs\else#from%
+% \fi}
+
+%letcsname\??mappedfontsize\s!text \endcsname\!!plusone
+\letcsname\??mappedfontsize\s!script \endcsname\!!plustwo
+\letcsname\??mappedfontsize\s!scriptscript\endcsname\!!plusthree
+
\unexpanded\def\mapfontsize
- {\dodoubleargument\font_basics_map_fontsize}
+ {\dotripleargument\font_basics_map_fontsize}
+
+\def\font_basics_map_fontsize[#class][#from][#to]%
+ {\setvalue{%
+ \??mappedfontsize
+ #class:%
+ \ifcsname\??mappedfontsize#from\endcsname\lastnamedcs\else1\fi
+ }{#to}}
+
+\permanent\tolerant\protected\def\checkedmapfontsize[#class]#spacer[#from]#spacer[#to]%
+ {\ifcsname\??mappedfontsize#class:\csname\??mappedfontsize#from\endcsname\endcsname
+ % keep (user) value
+ \else
+ \mapfontsize[#class][#from][#to]%
+ \fi}
-\def\font_basics_map_fontsize[#from][#to]%
- {\setvalue{\??mappedfontsize\the\dimexpr#from\relax}{#to}}
+\permanent\tolerant\def\mappedfontsize#class#from%
+ {\begincsname
+ \??mappedfontsize
+ #class:%
+ \ifcsname\??mappedfontsize#from\endcsname\lastnamedcs\else1\fi
+ \endcsname}
\def\font_basics_set_mapped_fontsize#from%
- {\ifcsname\??mappedfontsize\the\dimexpr#from\relax\endcsname
- \lastnamedcs\else#from%
+ {\ifcsname\??mappedfontsize\fontclass:\fontface\endcsname
+ %\the\dimexpr\lastnamedcs\dimexpr#from\relax\relax
+ %\the\dimexpr\lastnamedcs\dimexpr\bodyfontsize\relax\relax
+ \the\dimexpr\lastnamedcs\dimexpr\normalizedbodyfontsize\relax\relax
+ \else % we could use default
+ #from%
\fi}
\installcorenamespace{fontbodyknown}
@@ -2852,4 +2889,10 @@
\unexpanded\def\usefontpath[#1]%
{\clf_addfontpath{#1}}
+%D NO select discs:
+
+\ifdefined\discretionaryligaturemode
+ \discretionaryligaturemode\plusone
+\fi
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-lib.mkvi b/Master/texmf-dist/tex/context/base/mkiv/font-lib.mkvi
index db9df49cd6f..dcb1ff1bbe7 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-lib.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-lib.mkvi
@@ -52,9 +52,9 @@
% \ifcase\directlua{tex.print(callback.list()["provide_charproc_data"] == false and 1 or 0)}\relax
% % this is the generic variant that will become luatex-fonts-ocl once we have
% % more recent versions of luatex 1.13/1.14 on the garden
- \registerctxluafile{font-ocl}{}
+% \registerctxluafile{font-ocl}{}
% \else
-% \registerctxluafile{font-ocm}{}
+ \registerctxluafile{font-ocm}{}
% \fi
% we use otf code for type one
@@ -63,6 +63,8 @@
\registerctxluafile{font-one}{optimize}
\registerctxluafile{font-afk}{}
+\registerctxluafile{font-txt}{}
+
% tfm
\registerctxluafile{font-tpk}{optimize}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-lig.lua b/Master/texmf-dist/tex/context/base/mkiv/font-lig.lua
index 1aed9fc5b58..b753b881d60 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-lig.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-lig.lua
@@ -6,7 +6,7 @@ if not modules then modules = { } end modules ['font-lig'] = {
license = "see context related readme files",
}
--- This module is not loaded but generated a file for plain TeX as a substitute
+-- This module is not loaded but generates a file for plain TeX as a substitute
-- for collapsing the input: "luatex-fonts-lig.lua" with "collapse=yes".
local next = next
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-map.lua b/Master/texmf-dist/tex/context/base/mkiv/font-map.lua
index c983ea96343..4aa937ed162 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-map.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-map.lua
@@ -253,9 +253,9 @@ function mappings.addtounicode(data,filename,checklookups,forceligatures)
local usedmap = cidinfo and fonts.cid.getmap(cidinfo)
local uparser = makenameparser() -- hm, every time?
if usedmap then
- oparser = usedmap and makenameparser(cidinfo.ordering)
- cidnames = usedmap.names
- cidcodes = usedmap.unicodes
+ oparser = usedmap and makenameparser(cidinfo.ordering)
+ cidnames = usedmap.names
+ cidcodes = usedmap.unicodes
end
local ns = 0
local nl = 0
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-mis.lua b/Master/texmf-dist/tex/context/base/mkiv/font-mis.lua
index 18120f524a0..f721be0ef8f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-mis.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-mis.lua
@@ -21,7 +21,7 @@ local readers = otf.readers
if readers then
- otf.version = otf.version or 3.113
+ otf.version = otf.version or 3.133
otf.cache = otf.cache or containers.define("fonts", "otl", otf.version, true)
function fonts.helpers.getfeatures(name,save)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-mps.lua b/Master/texmf-dist/tex/context/base/mkiv/font-mps.lua
index 8bfe23b892b..d75267a09ae 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-mps.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-mps.lua
@@ -279,7 +279,7 @@ local getdepth = nuts.getdepth
local getexpansion = nuts.getexpansion
local isglyph = nuts.isglyph
-local effective_glue = nuts.effective_glue
+local effectiveglue = nuts.effectiveglue
local characters = fonts.hashes.characters
local parameters = fonts.hashes.parameters
@@ -362,7 +362,7 @@ function fonts.metapost.boxtomp(n,kind)
elseif id == kern_code then
dx = dx + getkern(current) * fc
elseif id == glue_code then
- dx = dx + effective_glue(current,parent) * fc
+ dx = dx + effectiveglue(current,parent) * fc
elseif id == hlist_code then
local list = getlist(current)
if list then
@@ -420,7 +420,7 @@ function fonts.metapost.boxtomp(n,kind)
elseif id == kern_code then
dy = dy - getkern(current) * fc
elseif id == glue_code then
- dy = dy - effective_glue(current,parent) * fc
+ dy = dy - effectiveglue(current,parent) * fc
elseif id == rule_code then
local wd, ht, dp = getwhd(current)
local hd = (ht + dp) * fc
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-nod.lua b/Master/texmf-dist/tex/context/base/mkiv/font-nod.lua
index ed307e7c531..a7dcfd9b09b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-nod.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-nod.lua
@@ -70,11 +70,11 @@ local setbox = nuts.setbox
local setchar = nuts.setchar
local setsubtype = nuts.setsubtype
-local copy_node_list = nuts.copy_list
-local hpack_node_list = nuts.hpack
-local flush_node_list = nuts.flush_list
-local protect_glyphs = nuts.protect_glyphs
-local start_of_par = nuts.start_of_par
+local copy_node_list = nuts.copylist
+local hpacknodelist = nuts.hpack
+local flushnodelist = nuts.flushlist
+local protectglyphs = nuts.protectglyphs
+local startofpar = nuts.startofpar
local nextnode = nuts.traversers.node
local nextglyph = nuts.traversers.glyph
@@ -144,7 +144,7 @@ function step_tracers.reset()
for i=1,#collection do
local c = collection[i]
if c then
- flush_node_list(c)
+ flushnodelist(c)
end
end
collection, messages = { }, { }
@@ -158,7 +158,7 @@ function step_tracers.glyphs(n,i)
local c = collection[i]
if c then
local c = copy_node_list(c)
- local b = hpack_node_list(c) -- multiple arguments
+ local b = hpacknodelist(c) -- multiple arguments
setbox(n,b)
end
end
@@ -266,7 +266,7 @@ function step_tracers.codes(i,command,space)
local char, id = isglyph(c)
if char then
showchar(char,id)
- elseif id == dir_code or (id == par_code and start_of_par(c)) then
+ elseif id == dir_code or (id == par_code and startofpar(c)) then
context("[%s]",getdirection(c) or "?")
elseif id == disc_code then
local pre, post, replace = getdisc(c)
@@ -317,7 +317,7 @@ function step_tracers.check(head)
if l then -- hm, can be false
n = l
end
- protect_glyphs(n)
+ protectglyphs(n)
collection[1] = n
end
end
@@ -333,7 +333,7 @@ function step_tracers.register(head)
if l then -- hm, can be false
n = l
end
- protect_glyphs(n)
+ protectglyphs(n)
collection[nc] = n
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-ocl.lua b/Master/texmf-dist/tex/context/base/mkiv/font-ocl.lua
index e6a38af5c3e..7d960922f47 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-ocl.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-ocl.lua
@@ -370,13 +370,24 @@ if context then
local xmlconvert = xml.convert
local xmlfirst = xml.first
+ -- function otfsvg.filterglyph(entry,index)
+ -- -- we only support decompression in lmtx, so one needs to wipe the
+ -- -- cache when invalid xml is reported
+ -- local svg = xmlconvert(entry.data)
+ -- local root = svg and xmlfirst(svg,"/svg[@id='glyph"..index.."']")
+ -- local data = root and tostring(root)
+ -- -- report_svg("data for glyph %04X: %s",index,data)
+ -- return data
+ -- end
+
function otfsvg.filterglyph(entry,index)
- -- we only support decompression in lmtx, so one needs to wipe the
- -- cache when invalid xml is reported
- local svg = xmlconvert(entry.data)
+ local d = entry.data
+ if gzip.compressed(d) then
+ d = gzip.decompress(d) or d
+ end
+ local svg = xmlconvert(d)
local root = svg and xmlfirst(svg,"/svg[@id='glyph"..index.."']")
local data = root and tostring(root)
- -- report_svg("data for glyph %04X: %s",index,data)
return data
end
@@ -412,6 +423,9 @@ end
--
-- Because a generic setup can be flawed we need to catch bad inkscape runs which add a bit of
-- ugly overhead. Bah.
+ --
+ -- In the long run this method is a dead end because we cannot rely on command line arguments
+ -- etc to be upward compatible (so no real batch tool).
local new = nil
@@ -430,9 +444,10 @@ end
-- local indices = fonts.getindices(tfmdata)
local descriptions = tfmdata.descriptions
local nofshapes = #svgshapes
+ local s_format = inkscapeformat("pdf") -- hack, this will go away when is >= 0 is everywhere
local f_svgfile = formatters["temp-otf-svg-shape-%i.svg"]
local f_pdffile = formatters["temp-otf-svg-shape-%i.pdf"]
- local f_convert = formatters["%s --export-%s=%s\n"]
+ local f_convert = formatters[new and "file-open:%s; export-%s:%s; export-do\n" or "%s --export-%s=%s\n"]
local filterglyph = otfsvg.filterglyph
local nofdone = 0
local processed = { }
@@ -446,7 +461,7 @@ end
local svgfile = f_svgfile(index)
local pdffile = f_pdffile(index)
savedata(svgfile,data)
- inkscape:write(f_convert(svgfile,inkscapeformat("pdf"),pdffile))
+ inkscape:write(f_convert(svgfile,s_format,pdffile))
processed[index] = true
nofdone = nofdone + 1
if nofdone % 25 == 0 then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-ocm.lua b/Master/texmf-dist/tex/context/base/mkiv/font-ocm.lua
index 2f6c29e65d8..e54799b235f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-ocm.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-ocm.lua
@@ -40,16 +40,16 @@ callback.register("provide_charproc_data",function(action,f,...)
end)
local defaults = {
- [1] = function() return 0, 0 end,
- [2] = function() return 0, 0 end,
- [3] = function() return 0.001, "" end,
+ function() return 0, 0 end,
+ function() return 0, 0 end,
+ function() return 0.001, "" end,
}
local function registeractions(t)
return {
- [1] = t.preroll or defaults[1],
- [2] = t.collect or defaults[2],
- [3] = t.wrapup or defaults[3],
+ t.preroll or defaults[1],
+ t.collect or defaults[2],
+ t.wrapup or defaults[3],
}
end
@@ -408,6 +408,7 @@ local pdftovirtual do
scale = scale * (width / (xform.width * bpfactor))
dy = - depth + dy
+-- png .. no time to figure it out now
-- dx = 0
-- dy = 0
local object = pdf.immediateobj("stream",f_stream(width,scale,scale,dx,dy,c)), width
@@ -558,6 +559,9 @@ local initializesvg do
--
-- Because a generic setup can be flawed we need to catch bad inkscape runs which add a bit of
-- ugly overhead. Bah.
+ --
+ -- In the long run this method is a dead end because we cannot rely on command line arguments
+ -- etc to be upward compatible (so no real batch tool).
local new = nil
@@ -576,9 +580,10 @@ local initializesvg do
-- local indices = fonts.getindices(tfmdata)
local descriptions = tfmdata.descriptions
local nofshapes = #svgshapes
+ local s_format = inkscapeformat("pdf") -- hack, this will go away when is >= 0 is everywhere
local f_svgfile = formatters["temp-otf-svg-shape-%i.svg"]
local f_pdffile = formatters["temp-otf-svg-shape-%i.pdf"]
- local f_convert = formatters["%s --export-%s=%s\n"]
+ local f_convert = formatters[new and "file-open:%s; export-%s:%s; export-do\n" or "%s --export-%s=%s\n"]
local filterglyph = otfsvg.filterglyph
local nofdone = 0
local processed = { }
@@ -592,7 +597,7 @@ local initializesvg do
local svgfile = f_svgfile(index)
local pdffile = f_pdffile(index)
savedata(svgfile,data)
- inkscape:write(f_convert(svgfile,inkscapeformat("pdf"),pdffile))
+ inkscape:write(f_convert(svgfile,s_format,pdffile))
processed[index] = true
nofdone = nofdone + 1
if nofdone % 25 == 0 then
@@ -695,34 +700,53 @@ end
local initializepng do
- local otfpng = otf.png or { }
- otf.png = otfpng
- otf.pngenabled = true
+ -- Alternatively we can create a single pdf file with -adjoin and then pick up pages from
+ -- that file but creating thousands of small files is no fun either.
+ local otfpng = otf.png or { }
+ otf.png = otfpng
+ otf.pngenabled = true
local report_png = logs.reporter("fonts","png conversion")
-
local loaddata = io.loaddata
local savedata = io.savedata
local remove = os.remove
-
- local runner = sandbox and sandbox.registerrunner {
- name = "otfpng",
- program = "gm",
- template = "convert -quality 100 temp-otf-png-shape.png temp-otf-png-shape.pdf > temp-otf-svg-shape.log",
- -- reporter = report_png,
- }
-
- if not runner then
- --
- -- poor mans variant for generic:
- --
- runner = function()
- return os.execute("gm convert -quality 100 temp-otf-png-shape.png temp-otf-png-shape.pdf > temp-otf-svg-shape.log")
+ local texhack = [[\startTEXpage\externalfigure[temp-otf-png-shape.png]\stopTEXpage]]
+ local runner = false
+ local method = "gm"
+
+ local function initialize(v)
+ if v == "lmtx" then
+ report_png("using lmtx converter, slow but okay")
+ runner = sandbox.registerrunner {
+ -- reporter = report_png,
+ name = "otfpng",
+ program = "mtxrun --script context",
+ template = "--once --batch --silent temp-otf-png-shape.tex > temp-otf-svg-shape.log",
+ }
+ method = v
+ elseif v == "mutool" then
+ report_png("using lmtx converter, no mask, black background")
+ runner = sandbox.registerrunner {
+ -- reporter = report_png,
+ name = "otfpng",
+ program = "mutool",
+ template = "convert -o temp-otf-png-shape.pdf temp-otf-png-shape.png",
+ }
+ method = v
+ else
+ report_png("using lmtx converter, no mask, white background")
+ runner = sandbox.registerrunner {
+ -- reporter = report_png,
+ name = "otfpng",
+ program = "gm",
+ template = "convert -quality 100 temp-otf-png-shape.png temp-otf-png-shape.pdf > temp-otf-svg-shape.log",
+ }
+ method = "gm"
end
+ return runner
end
- -- Alternatively we can create a single pdf file with -adjoin and then pick up pages from
- -- that file but creating thousands of small files is no fun either.
+ directives.register("backend.otfpng.method",initialize)
local files = utilities.files
local openfile = files.open
@@ -735,12 +759,19 @@ local initializepng do
local pdfshapes = { }
local pngfile = "temp-otf-png-shape.png"
local pdffile = "temp-otf-png-shape.pdf"
+ local logfile = "temp-otf-png-shape.log"
+ local texfile = "temp-otf-png-shape.tex"
+ local tucfile = "temp-otf-png-shape.tuc"
local nofdone = 0
local indices = sortedkeys(pngshapes) -- can be sparse
local nofindices = #indices
report_png("processing %i png containers",nofindices)
statistics.starttiming()
local filehandle = openfile(filename)
+ savedata(texfile,texhack) -- not always used but who cares
+ if not runner then
+ initialize()
+ end
for i=1,nofindices do
local index = indices[i]
local entry = pngshapes[index]
@@ -771,6 +802,9 @@ local initializepng do
report_png("processing %i pdf results",nofindices)
remove(pngfile)
remove(pdffile)
+ remove(logfile)
+ remove(texfile)
+ remove(tucfile)
statistics.stoptiming()
if statistics.elapsedseconds then
report_png("png conversion time %s",statistics.elapsedseconds() or "-")
@@ -789,7 +823,7 @@ local initializepng do
end
local pdffile = containers.read(otf.pdfcache,hash)
local pdfshapes = pdffile and pdffile.pdfshapes
- if not pdfshapes or pdffile.timestamp ~= timestamp then
+ if not pdfshapes or pdffile.timestamp ~= timestamp or pdffile.timestamp ~= method then
local pngfile = containers.read(otf.pngcache,hash)
local filename = tfmdata.resources.filename
local pngshapes = pngfile and pngfile.pngshapes
@@ -797,6 +831,7 @@ local initializepng do
containers.write(otf.pdfcache, hash, {
pdfshapes = pdfshapes,
timestamp = timestamp,
+ method = method,
})
end
--
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-onr.lua b/Master/texmf-dist/tex/context/base/mkiv/font-onr.lua
index c33b09f9e2a..9e5a012bd5f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-onr.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-onr.lua
@@ -211,6 +211,8 @@ do
+ P(1)
)^0 * Carg(1)
+ -- cache this?
+
local function loadpfbvector(filename,shapestoo,streams)
-- for the moment limited to encoding only
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-osd.lua b/Master/texmf-dist/tex/context/base/mkiv/font-osd.lua
index 87453d9e2d9..f35be2cd188 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-osd.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-osd.lua
@@ -6,7 +6,6 @@ if not modules then modules = { } end modules ['font-osd'] = { -- script devanag
license = "see context related readme files"
}
-
-- we need to check nbsphash (context only)
-- A few remarks:
@@ -56,6 +55,11 @@ if not modules then modules = { } end modules ['font-osd'] = { -- script devanag
-- By now we have yet another incremental improved version. In the end I might
-- rewrite the code.
--
+-- At the start of 2022 Kauśika spent a lot of time testing combinations of fonts
+-- and scripts and in the process some more tracing was added as well as a mixed
+-- conjuncts options that can deal with fuzzy fonts. The machinery does what it has
+-- to do but some fonts expect more magic to be applied.
+--
-- Hans Hagen, PRAGMA-ADE, Hasselt NL
-- Todo:
@@ -81,8 +85,10 @@ if not modules then modules = { } end modules ['font-osd'] = { -- script devanag
-- malayalam, oriya, tamil and tolugu but not all are checked. Also, some of the
-- code below might need to be adapted to the extra scripts.
-local insert, imerge, copy, tohash = table.insert, table.imerge, table.copy, table.tohash
-local next, type = next, type
+local insert, remove, imerge, copy, tohash = table.insert, table.remove, table.imerge, table.copy, table.tohash
+local next, type, rawget = next, type, rawget
+local formatters = string.formatters
+local settings_to_hash = utilities.parsers.settings_to_hash
local report = logs.reporter("otf","devanagari")
@@ -98,6 +104,8 @@ local methods = fonts.analyzers.methods
local otffeatures = fonts.constructors.features.otf
local registerotffeature = otffeatures.register
+local trace_steps = false
+
local nuts = nodes.nuts
local getnext = nuts.getnext
@@ -118,11 +126,11 @@ local setstate = nuts.setstate
local ischar = nuts.ischar
-local insert_node_after = nuts.insert_after
+local insertnodeafter = nuts.insertafter
local copy_node = nuts.copy
local remove_node = nuts.remove
-local flush_list = nuts.flush_list
-local flush_node = nuts.flush_node
+local flushlist = nuts.flushlist
+local flushnode = nuts.flushnode
local copyinjection = nodes.injections.copy -- KE: is this necessary? HH: probably not as positioning comes later and we rawget/set
@@ -130,7 +138,8 @@ local unsetvalue = attributes.unsetvalue
local fontdata = fonts.hashes.identifiers
-local a_syllabe = attributes.private('syllabe')
+local a_syllabe = "syllable" -- attributes.private('syllabe') -- can be just a property key
+local a_reordered = "reordered" -- attributes.private('reordered') -- can be just a property key
local dotted_circle = 0x25CC
local c_nbsp = 0x00A0
@@ -156,9 +165,14 @@ replace_all_nbsp = function(head) -- delayed definition
end
local processcharacters = nil
+local logprocess = nil
if context then
- local fontprocesses = fonts.hashes.processes
+
+ local fontprocesses = fonts.hashes.processes
+ local tracers = nodes.tracers
+ local registermessage = (tracers and tracers.steppers.message) or function() end
+
function processcharacters(head,font)
local processors = fontprocesses[font]
for i=1,#processors do
@@ -166,7 +180,24 @@ if context then
end
return head
end
+
+ -- When we'retrying to fix something it can be handy to have some more
+ -- details available.
+
+ trackers.register("otf.steps", function(v) trace_steps = v end)
+
+ logprocess = function(str)
+ if trace_steps then
+ registermessage("devanagari %s",str)
+ if trace_steps == "silent" then
+ return
+ end
+ end
+ report(str)
+ end
+
else
+
function processcharacters(head,font)
local processors = fontdata[font].shared.processes
for i=1,#processors do
@@ -174,6 +205,11 @@ else
end
return head
end
+
+ logprocess = function(str)
+ -- do nothing
+ end
+
end
-- We can assume that script are not mixed in the source but if that is the case
@@ -302,7 +338,7 @@ local after_subscript = indicgroups.after_subscript
local before_main = indicgroups.before_main
local after_main = indicgroups.after_main
-local mark_four = table.merged (
+local mark_pre_above_below_post = table.merged (
pre_mark,
above_mark,
below_mark,
@@ -315,6 +351,14 @@ local mark_above_below_post = table.merged (
post_mark
)
+-- Handy
+
+local devanagarihash = table.setmetatableindex(function(t,k)
+ local v = fontdata[k].resources.devanagari or false
+ t[k] = v
+ return v
+end)
+
-- We use some pseudo features as we need to manipulate the nodelist based
-- on information in the font as well as already applied features. We can
-- probably replace some of the code below by injecting 'real' features
@@ -460,7 +504,7 @@ local function initializedevanagi(tfmdata)
local devanagari = resources.devanagari
if not devanagari then
--
- report("adding devanagari features to font")
+ report("adding features to font")
--
local gsubfeatures = resources.features.gsub
local sequences = resources.sequences
@@ -491,7 +535,9 @@ local function initializedevanagi(tfmdata)
for k, v in next, pre_mark do
local locl = coverage[k]
if locl then
- if #locl > 0 then --contextchain; KE: is this right?
+ -- if #locl > 0 then we have a list otherwise a hash; we actually should
+ -- test properly for gsub_...
+ if #locl > 0 then
for j=1,#locl do
local ck = locl[j]
local f = ck[4]
@@ -512,6 +558,8 @@ local function initializedevanagi(tfmdata)
end
end
end
+ else
+ -- useless next if, because locl is a table
end
if locl then
reorder_matras.steps[1].coverage[locl] = true
@@ -524,7 +572,7 @@ local function initializedevanagi(tfmdata)
if basic_shaping_forms[k] then
lastmatch = lastmatch + 1
if s ~= lastmatch then
- table.insert(sequences, lastmatch, table.remove(sequences, s))
+ insert(sequences,lastmatch,remove(sequences,s))
end
end
end
@@ -545,9 +593,7 @@ local function initializedevanagi(tfmdata)
local vatucache = { }
local pstfcache = { }
local seqsubset = { }
- local rephstep = {
- coverage = { } -- will be adapted each work
- }
+ local rephstep = { coverage = { } } -- will be adapted each work
local devanagari = {
reph = false,
vattu = false,
@@ -577,7 +623,7 @@ local function initializedevanagi(tfmdata)
local has_pstf = features.pstf
if has_rphf and has_rphf[script] then
devanagari.reph = true
- elseif (has_blwf and has_blwf[script] ) or (has_vatu and has_vatu[script] ) then
+ elseif (has_blwf and has_blwf[script]) or (has_vatu and has_vatu[script]) then
devanagari.vattu = true
for i=1,nofsteps do
local step = steps[i]
@@ -585,10 +631,8 @@ local function initializedevanagi(tfmdata)
if coverage then
for k, v in next, coverage do
for h, w in next, halant do
- if v[h] then
- if not blwfcache[k] then
- blwfcache[k] = v
- end
+ if v[h] and not blwfcache[k] then
+ blwfcache[k] = v
end
if has_vatu and has_vatu[script] and not vatucache[k] then
vatucache[k] = v
@@ -610,34 +654,40 @@ local function initializedevanagi(tfmdata)
for k, v in next, ra do
local r = coverage[k]
if r then
+ -- if #r > 0 then we have a list otherwise a hash; we actually should
+ -- test properly for gsub_...
local found = false
- if #r > 0 then -- contextchain; KE: is this right?
+ if #r > 0 then
for j=1,#r do
- local ck = r[j]
- local f = ck[4]
+ local ck = r[j]
+ local f = ck[4]
local chainlookups = ck[6]
- if chainlookups and chainlookups[f] then --KE: why is check for chainlookups[f] necessacy???
+ if chainlookups then
local chainlookup = chainlookups[f]
- for j=1,#chainlookup do
- local chainstep = chainlookup[j]
- local steps = chainstep.steps
- local nofsteps = chainstep.nofsteps
- for i=1,nofsteps do
- local step = steps[i]
- local coverage = step.coverage
- if coverage then
- local h = coverage[k]
- if h then
- for k, v in next, h do
- found = v and v.ligature
+ if chainlookup then
+ for j=1,#chainlookup do
+ local chainstep = chainlookup[j]
+ local steps = chainstep.steps
+ local nofsteps = chainstep.nofsteps
+ for i=1,nofsteps do
+ local step = steps[i]
+ local coverage = step.coverage
+ if coverage then
+ local h = coverage[k]
+ if h then
+ for k, v in next, h do
+ if v then
+ found = tonumber(v) or v.ligature
+ if found then
+ pre_base_reordering_consonants[found] = true
+ break
+ end
+ end
+ end
if found then
- pre_base_reordering_consonants[found] = true
break
end
end
- if found then
- break
- end
end
end
end
@@ -646,10 +696,12 @@ local function initializedevanagi(tfmdata)
end
else
for k, v in next, r do
- found = v and v.ligature
- if found then
- pre_base_reordering_consonants[found] = true
- break
+ if v then
+ found = tonumber(v) or v.ligature
+ if found then
+ pre_base_reordering_consonants[found] = true
+ break
+ end
end
end
end
@@ -667,18 +719,21 @@ local function initializedevanagi(tfmdata)
local step = steps[i]
local coverage = step.coverage
if coverage then
- local reph, rephbase = false, false
+ local reph = false
+ local base = false
if kind == "rphf" then
-- rphf acts on consonant + halant
for k, v in next, ra do
local r = coverage[k]
if r then
- rephbase = k
+ -- if #r > 0 then we have a list otherwise a hash; we actually should
+ -- test properly for gsub_...
+ base = k
local h = false
- if #r > 0 then --contextchain; KE: is this right?
+ if #r > 0 then
for j=1,#r do
- local ck = r[j]
- local f = ck[4]
+ local ck = r[j]
+ local f = ck[4]
local chainlookups = ck[6]
if chainlookups then
local chainlookup = chainlookups[f]
@@ -695,7 +750,7 @@ local function initializedevanagi(tfmdata)
for k, v in next, halant do
local h = r[k]
if h then
- reph = h.ligature or false
+ reph = tonumber(h) or h.ligature or false
break
end
end
@@ -712,7 +767,7 @@ local function initializedevanagi(tfmdata)
for k, v in next, halant do
local h = r[k]
if h then
- reph = h.ligature or false
+ reph = tonumber(h) or h.ligature or false
break
end
end
@@ -723,7 +778,9 @@ local function initializedevanagi(tfmdata)
end
end
end
- seqsubset[#seqsubset+1] = { kind, coverage, reph, rephbase }
+-- if reph then
+ seqsubset[#seqsubset+1] = { kind, coverage, reph, base }
+-- end
end
end
end
@@ -737,18 +794,20 @@ local function initializedevanagi(tfmdata)
for k, v in next, halant do
local h = coverage[k]
if h then
+ -- if #h > 0 then we have a list otherwise a hash; we actually should
+ -- test properly for gsub_...
local found = false
- if #h > 0 then -- contextchain; KE: is this right?
+ if #h > 0 then
for j=1,#h do
- local ck = h[j]
- local f = ck[4]
+ local ck = h[j]
+ local f = ck[4]
local chainlookups = ck[6]
if chainlookups then
local chainlookup = chainlookups[f]
for j=1,#chainlookup do
local chainstep = chainlookup[j]
- local steps = chainstep.steps
- local nofsteps = chainstep.nofsteps
+ local steps = chainstep.steps
+ local nofsteps = chainstep.nofsteps
for i=1,nofsteps do
local step = steps[i]
local coverage = step.coverage
@@ -756,10 +815,12 @@ local function initializedevanagi(tfmdata)
local h = coverage[k]
if h then
for k, v in next, h do
- found = v and v.ligature
- if found then
- pre_base_reordering_consonants[found] = true
- break
+ if v then
+ found = tonumber(v) or v.ligature
+ if found then
+ pre_base_reordering_consonants[found] = true
+ break
+ end
end
end
if found then
@@ -773,7 +834,7 @@ local function initializedevanagi(tfmdata)
end
else
for k, v in next, h do
- found = v and v.ligature
+ found = v and (tonumber(v) or v.ligature)
if found then
pre_base_reordering_consonants[found] = true
break
@@ -800,9 +861,9 @@ local function initializedevanagi(tfmdata)
sharedfeatures["dv03"] = true -- dv03_reorder_pre_base_reordering_consonants
sharedfeatures["dv04"] = true -- dv04_remove_joiners
end
- if script == "mlym" or script == "taml" then
- devanagari.left_matra_before_base = true
- end
+ -- if script == "mlym" or script == "taml" then
+ -- devanagari.movematra = "leftbeforebase"
+ -- end
end
end
end
@@ -816,6 +877,49 @@ registerotffeature {
},
}
+local function initializeconjuncts(tfmdata,value)
+ if value then
+ local resources = tfmdata.resources
+ local devanagari = resources.devanagari
+ if devanagari then
+ -- quit was the old situation
+ local conjuncts = "auto" -- mixed|continue|quit|auto
+ local movematra = "auto" -- default|leftbeforebase|auto
+ if type(value) == "string" and value ~= "auto" then
+ value = settings_to_hash(value)
+ conjuncts = rawget(value,"conjuncts") or conjuncts
+ movematra = rawget(value,"movematra") or movematra
+ end
+ if conjuncts == "auto" then
+ conjuncts = "mixed" -- for all scripts ?
+ end
+ if movematra == "auto" and
+ script == "mlym" or
+ script == "taml" then
+ movematra = "leftbeforebase"
+ else
+ movematra = "default"
+ end
+ devanagari.conjuncts = conjuncts
+ devanagari.movematra = movematra
+ --
+ if trace_steps then
+ report("conjuncts %a, movematra %a",conjuncts,movematra)
+ end
+ --
+ end
+ end
+end
+
+registerotffeature {
+ name = "indic",
+ description = "control indic",
+ default = "auto",
+ initializers = {
+ node = initializeconjuncts,
+ },
+}
+
local show_syntax_errors = false
local function inject_syntax_error(head,current,char)
@@ -826,7 +930,7 @@ local function inject_syntax_error(head,current,char)
else
setchar(current,dotted_circle)
end
- return insert_node_after(head,current,signal)
+ return insertnodeafter(head,current,signal)
end
-- hm, this is applied to one character:
@@ -874,38 +978,44 @@ local function initialize_one(font,attr) -- we need a proper hook into the datas
end
-local function contextchain(contexts, n)
+-- HH: somehow we can get a non context here so for now we check for .n
+
+local function contextchain(contexts,n)
local char = getchar(n)
- for k=1,#contexts do
- local ck = contexts[k]
- local seq = ck[3]
- local f = ck[4]
- local l = ck[5]
- if (l - f) == 1 and seq[f+1][char] then
- local ok = true
- local c = n
- for i=l+1,#seq do
- c = getnext(c)
- if not c or not seq[i][ischar(c)] then
- ok = false
- break
- end
- end
- if ok then
- c = getprev(n)
- for i=1,f-1 do
- c = getprev(c)
- if not c or not seq[f-i][ischar(c)] then
+ if not contexts.n then
+ return contexts[char]
+ else
+ for k=1,#contexts do
+ local ck = contexts[k]
+ local seq = ck[3]
+ local f = ck[4]
+ local l = ck[5]
+ if (l - f) == 1 and seq[f+1][char] then
+ local ok = true
+ local c = n
+ for i=l+1,#seq do
+ c = getnext(c)
+ if not c or not seq[i][ischar(c)] then
ok = false
+ break
end
end
- end
- if ok then
- return true
+ if ok then
+ c = getprev(n)
+ for i=1,f-1 do
+ c = getprev(c)
+ if not c or not seq[f-i][ischar(c)] then
+ ok = false
+ end
+ end
+ end
+ if ok then
+ return true
+ end
end
end
+ return false
end
- return false
end
local function order_matras(c)
@@ -937,11 +1047,13 @@ local function order_matras(c)
end
end
+local swapped = table.swapped(states)
+
local function reorder_one(head,start,stop,font,attr,nbspaces)
local reph, vattu, blwfcache, vatucache, pstfcache = initialize_one(font,attr) -- todo: a hash[font]
- local devanagari = fontdata[font].resources.devanagari
+ -- local devanagari = devanagarihash[font]
local current = start
local n = getnext(start)
local base = nil
@@ -968,7 +1080,10 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
if current == stop then
stop = getprev(stop)
head = remove_node(head,current)
- flush_node(current)
+ flushnode(current)
+ if trace_steps then
+ logprocess("reorder one, remove nbsp")
+ end
return head, stop, nbspaces
else
nbspaces = nbspaces + 1
@@ -998,7 +1113,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
tempcurrent = processcharacters(tempcurrent,font)
setstate(tempcurrent,unsetvalue)
if getchar(next) == getchar(tempcurrent) then
- flush_list(tempcurrent)
+ flushlist(tempcurrent)
if show_syntax_errors then
head, current = inject_syntax_error(head,current,char)
end
@@ -1006,12 +1121,15 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
setchar(current,getchar(tempcurrent)) -- we assumes that the result of blwf consists of one node
local freenode = getnext(current)
setlink(current,tmp)
- flush_node(freenode)
- flush_list(tempcurrent)
+ flushnode(freenode)
+ flushlist(tempcurrent)
if changestop then
stop = current
end
end
+ if trace_steps then
+ logprocess("reorder one, handle nbsp")
+ end
end
end
end
@@ -1073,6 +1191,9 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
if lastcons == stop then
stop = n
end
+ if trace_steps then
+ logprocess("reorder one, handle halant")
+ end
end
end
@@ -1102,6 +1223,9 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
if matra == stop then
stop = n
end
+ if trace_steps then
+ logprocess("reorder one, handle matra")
+ end
end
local current = start
@@ -1148,14 +1272,19 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
end
local tpm = twopart_mark[ch]
- while tpm do
- local extra = copy_node(n)
- copyinjection(extra,n)
- ch = tpm[1]
- setchar(n,ch)
- setchar(extra,tpm[2])
- head = insert_node_after(head,current,extra)
- tpm = twopart_mark[ch]
+ if tpm then
+ while tpm do
+ local extra = copy_node(n)
+ copyinjection(extra,n)
+ ch = tpm[1]
+ setchar(n,ch)
+ setchar(extra,tpm[2])
+ head = insertnodeafter(head,current,extra)
+ tpm = twopart_mark[ch]
+ end
+ if trace_steps then
+ logprocess("reorder one, handle mark")
+ end
end
while c ~= stop and dependent_vowel[ch] do
c = n
@@ -1178,10 +1307,11 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
local bp = getprev(firstcons)
local cn = getnext(current)
local last = getnext(c)
+ local done = false
while cn ~= last do
-- move pre-base matras...
if pre_mark[getchar(cn)] then
- if devanagari.left_matra_before_base then
+ if devanagarihash[font].movematra == "leftbeforebase" then
local prev, next = getboth(cn)
setlink(prev,next)
if cn == stop then
@@ -1219,6 +1349,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
end
cn = next
end
+ done = true
elseif current ~= base and dependent_vowel[getchar(cn)] then
local prev, next = getboth(cn)
if next then
@@ -1231,6 +1362,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
setlink(b,cn,getnext(b))
order_matras(cn)
cn = next
+ done = true
elseif current == base and dependent_vowel[getchar(cn)] then
local cnn = getnext(cn)
order_matras(cn)
@@ -1244,10 +1376,15 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
end
allreordered = c == stop
current = getnext(c)
+ if done and trace_steps then
+ logprocess("reorder one, matra")
+ end
end
if reph or vattu then
- local current, cns = start, nil
+ local current = start
+ local cns = nil
+ local done = false
while current ~= stop do
local c = current
local n = getnext(current)
@@ -1280,6 +1417,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
local next = getnext(b)
setlink(c,next)
setlink(b,current)
+ done = true
end
elseif cns and getnext(cns) ~= current then -- todo: optimize next
-- position below-base Ra (vattu) following the consonants on which it is placed (either the base consonant or one of the pre-base consonants)
@@ -1288,6 +1426,7 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
setlink(cp,n)
setlink(cns,current) -- cns ?
setlink(c,cnsn)
+ done = true
if c == stop then
stop = cp
break
@@ -1327,15 +1466,18 @@ local function reorder_one(head,start,stop,font,attr,nbspaces)
end
current = getnext(current)
end
+ if done and trace_steps then
+ logprocess("reorder one, handle reph and vata") -- todo: boolean
+ end
end
if getchar(base) == c_nbsp then
nbspaces = nbspaces - 1
if base == stop then
- stop = getprev(stop)
+ stop = getprev(stop)
end
head = remove_node(head,base)
- flush_node(base)
+ flushnode(base)
end
return head, stop, nbspaces
@@ -1373,6 +1515,9 @@ function handlers.devanagari_reorder_matras(head,start) -- no leak
setlink(current,start)
-- setlink(current,start,next) -- maybe
start = startnext
+ if trace_steps then
+ logprocess("reorder matra")
+ end
break
-- elseif consonant[char] and (not getstate(current) or getstate(current,s_init) then
-- startnext = getnext(start)
@@ -1438,6 +1583,9 @@ function handlers.devanagari_reorder_reph(head,start)
local char = ischar(current,startfont)
if char and getprop(current,a_syllabe) == startattr then
if halant[char] then
+ if trace_steps then
+ logprocess("reorder reph, handling halant")
+ end
local next = getnext(current)
if next then
local nextchar = ischar(next,startfont)
@@ -1475,6 +1623,9 @@ function handlers.devanagari_reorder_reph(head,start)
local char = ischar(current,startfont)
if char and getprop(current,a_syllabe) == startattr then
if consonant[char] and not getstate(current,s_pref) then
+ if trace_steps then
+ logprocess("reorder reph, handling consonant")
+ end
startnext = getnext(start)
head = remove_node(head,start)
setlink(current,start)
@@ -1506,6 +1657,9 @@ function handlers.devanagari_reorder_reph(head,start)
local char = ischar(current,startfont)
if char and getprop(current,a_syllabe) == startattr then
if getstate(current,s_pstf) then -- post-base
+ if trace_steps then
+ logprocess("reorder reph, before postscript, post base")
+ end
startnext = getnext(start)
head = remove_node(head,start)
setlink(getprev(current),start)
@@ -1514,12 +1668,15 @@ function handlers.devanagari_reorder_reph(head,start)
start = startnext
startattr = getprop(start,a_syllabe)
break
- elseif not c and ( vowel_modifier[char] or stress_tone_mark[char] ) then
+ elseif not c and (vowel_modifier[char] or stress_tone_mark[char]) then
c = current
end
current = getnext(current)
else
if c then
+ if trace_steps then
+ logprocess("reorder reph, before postscript")
+ end
startnext = getnext(start)
head = remove_node(head,start)
setlink(getprev(c),start)
@@ -1551,7 +1708,13 @@ function handlers.devanagari_reorder_reph(head,start)
local state = getstate(current)
if before_subscript[rephbase] and (state == s_blwf or state == s_pstf) then
c = current
+ if trace_steps then
+ logprocess("reorder reph, before subscript")
+ end
elseif after_subscript[rephbase] and (state == s_pstf) then
+ if trace_steps then
+ logprocess("reorder reph, after subscript")
+ end
c = current
end
current = getnext(current)
@@ -1589,6 +1752,9 @@ function handlers.devanagari_reorder_reph(head,start)
end
end
if start ~= current then
+ if trace_steps then
+ logprocess("reorder reph, to end")
+ end
startnext = getnext(start)
head = remove_node(head,start)
setlink(start,getnext(current))
@@ -1616,10 +1782,10 @@ end
-- return head, start, done
-- end
-local reordered_pre_base_reordering_consonants = { } -- shared ? not reset ?
+-- todo: nodes -> table -> nodes
function handlers.devanagari_reorder_pre_base_reordering_consonants(head,start)
- if reordered_pre_base_reordering_consonants[start] then
+ if getprop(start,a_reordered) then
return head, start, true
end
local current = start -- we could cache attributes here
@@ -1630,6 +1796,9 @@ function handlers.devanagari_reorder_pre_base_reordering_consonants(head,start)
local next = getnext(current)
if char and getprop(current,a_syllabe) == startattr then
if halant[char] then -- state can also be init
+ if trace_steps then
+ logprocess("reorder pre base consonants, handle halant")
+ end
if next then
local char = ischar(next,startfont)
if char and zw_char[char] and getprop(next,a_syllabe) == startattr then
@@ -1643,7 +1812,7 @@ function handlers.devanagari_reorder_pre_base_reordering_consonants(head,start)
setlink(start,next)
setlink(current,start)
-- setlink(current,start,next) -- maybe
- reordered_pre_base_reordering_consonants[start] = true
+ setprop(start,"reordered",true)
start = startnext
return head, start, true
-- elseif consonant[char] and (not getstate(current) or getstate(current,s_init)) then
@@ -1670,6 +1839,9 @@ function handlers.devanagari_reorder_pre_base_reordering_consonants(head,start)
while current and getprop(current,a_syllabe) == startattr do
local char = ischar(current)
if (not dependent_vowel[char] and (not getstate(current) or getstate(current,s_init))) then
+ if trace_steps then
+ logprocess("reorder pre base consonants, handle vowel or initial")
+ end
startnext = getnext(start)
head = remove_node(head,start)
if current == head then
@@ -1679,7 +1851,7 @@ function handlers.devanagari_reorder_pre_base_reordering_consonants(head,start)
setlink(getprev(current),start)
setlink(start,current)
end
- reordered_pre_base_reordering_consonants[start] = true
+ setprop(start,"reordered",true)
start = startnext
break
end
@@ -1712,7 +1884,10 @@ function handlers.devanagari_remove_joiners(head,start,kind,lookupname,replaceme
if head == start then
head = stop
end
- flush_list(start)
+ flushlist(start)
+ if trace_steps then
+ logprocess("remove joiners")
+ end
return head, stop, true
end
@@ -1739,8 +1914,8 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas
local subpos = nil
local postpos = nil
- reorderreph.coverage = { }
- rephbase[font] = { }
+ reorderreph.coverage = { } -- use local
+ rephbase[font] = { } -- use local
for i=1,#seqsubset do
@@ -1750,8 +1925,12 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas
local kind = subset[1]
local lookupcache = subset[2]
if kind == "rphf" then
- reorderreph.coverage[subset[3]] = true -- neat
- rephbase[font][subset[3]] = subset[4]
+ --
+ local reph = subset[3]
+ local base = subset[4]
+ reorderreph.coverage[reph] = true -- neat -- use local
+ rephbase[font][reph] = base -- use local
+ --
local current = start
local last = getnext(stop)
while current ~= last do
@@ -1760,15 +1939,15 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas
local found = lookupcache[c]
if found then
local next = getnext(current)
- if found[getchar(next)] or contextchain(found, next) then --above-base: rphf Consonant + Halant
+ if contextchain(found, next) then -- above-base: rphf Consonant + Halant
local afternext = next ~= stop and getnext(next)
if afternext and zw_char[getchar(afternext)] then -- ZWJ and ZWNJ prevent creation of reph
current = afternext -- getnext(next)
elseif current == start then
setstate(current,s_rphf)
- current = next
+ current = next -- later again next
else
- current = next
+ current = next -- later again next
end
end
end
@@ -1784,8 +1963,8 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas
local found = lookupcache[c]
if found then -- pre-base: pref Halant + Consonant
local next = getnext(current)
- if found[getchar(next)] or contextchain(found, next) then
- if (not getstate(current) and not getstate(next)) then --KE: state can also be init...
+ if contextchain(found, next) then
+ if not getstate(current) and not getstate(next) then --KE: state can also be init...
setstate(current,s_pref)
setstate(next,s_pref)
current = next
@@ -1804,10 +1983,10 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas
local found = lookupcache[c]
if found then
local next = getnext(current)
- if found[getchar(next)] or contextchain(found, next) then
+ if contextchain(found, next) then
if next ~= stop and getchar(getnext(next)) == c_zwnj then -- zwnj prevent creation of half
current = next
- elseif (not getstate(current)) then --KE: state can also be init...
+ elseif not getstate(current) then --KE: state can also be init...
setstate(current,s_half)
if not halfpos then
halfpos = current
@@ -1828,8 +2007,8 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas
local found = lookupcache[c]
if found then
local next = getnext(current)
- if found[getchar(next)] or contextchain(found, next) then
- if (not getstate(current) and not getstate(next)) then --KE: state can also be init...
+ if contextchain(found, next) then
+ if not getstate(current) and not getstate(next) then --KE: state can also be init...
setstate(current,s_blwf)
setstate(next,s_blwf)
current = next
@@ -1849,8 +2028,8 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas
local found = lookupcache[c]
if found then
local next = getnext(current)
- if found[getchar(next)] or contextchain(found, next) then
- if (not getstate(current) and not getstate(next)) then -- KE: state can also be init...
+ if contextchain(found, next) then
+ if not getstate(current) and not getstate(next) then -- KE: state can also be init...
setstate(current,s_pstf)
setstate(next,s_pstf)
current = next
@@ -1864,7 +2043,7 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas
end
end
- local current, base, firstcons = start, nil, nil
+ local current, base, firstcons, subnotafterbase, postnotafterbase = start, nil, nil, nil, nil
if getstate(start,s_rphf) then
-- if syllable starts with Ra + H and script has 'Reph' then exclude Reph from candidates for base consonants
@@ -1876,7 +2055,10 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas
if current == stop then
stop = getprev(stop)
head = remove_node(head,current)
- flush_node(current)
+ flushnode(current)
+ if trace_steps then
+ logprocess("reorder two, remove nbsp")
+ end
return head, stop, nbspaces
else
nbspaces = nbspaces + 1
@@ -1917,11 +2099,22 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas
end
end
end
+ if trace_steps then
+ logprocess("reorder two, handle nbsp")
+ end
end
else -- not Stand Alone cluster
local last = getnext(stop)
while current ~= last do -- find base consonant
local next = getnext(current)
+-- IF PATCHED THEN
+-- if current == subpos then
+-- subnotafterbase = current
+-- end
+-- if current == postpos then
+-- postnotafterbase = current
+-- end
+-- END
if consonant[getchar(current)] then
if not (current ~= stop and next ~= stop and halant[getchar(next)] and getchar(getnext(next)) == c_zwj) then
if not firstcons then
@@ -1931,6 +2124,14 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas
local a = getstate(current)
if not (a == s_blwf or a == s_pstf or (a ~= s_rphf and a ~= s_blwf and ra[getchar(current)])) then
base = current
+-- IF PATCHED THEN
+-- if subnotafterbase then
+-- subpos = base
+-- end
+-- if postnotafterbase then
+-- postpos = base
+-- end
+-- END
end
end
end
@@ -1948,7 +2149,7 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas
return head, stop, nbspaces
else
if getstate(base) then -- state can also be init
- setstate(base,unsetvalue)
+ setstate(base,unsetvalue) -- THIS RESETS THE HALF STATE
end
basepos = base
end
@@ -1973,19 +2174,32 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas
local cn = getnext(current)
-- not so efficient (needed for malayalam)
local tpm = twopart_mark[char]
- while tpm do
- local extra = copy_node(current)
- copyinjection(extra,current)
- char = tpm[1]
- setchar(current,char)
- setchar(extra,tpm[2])
- head = insert_node_after(head,current,extra)
- tpm = twopart_mark[char]
+ if tpm then
+ while tpm do
+ local extra = copy_node(current)
+ copyinjection(extra,current)
+ char = tpm[1]
+ setchar(current,char)
+ setchar(extra,tpm[2])
+ head = insertnodeafter(head,current,extra)
+ tpm = twopart_mark[char]
+ end
+ if tpm and trace_steps then
+ logprocess("reorder two, handle matra")
+ end
end
--
- if not moved[current] and dependent_vowel[char] then
+-- IF PATCHED THEN
+-- if dependent_vowel[char] then
+-- ELSE
+ if not moved[current] and dependent_vowel[char] then
+-- END
if pre_mark[char] then -- or: if before_main or before_half
+-- IF PATCHED THEN
+-- -- nothing
+-- ELSE
moved[current] = true
+-- END
-- can be helper to remove one node
local prev, next = getboth(current)
setlink(prev,next)
@@ -2031,8 +2245,18 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas
setlink(getprev(pos),current)
setlink(current,pos)
-- setlink(getprev(pos),current,pos) -- maybe
+ if trace_steps then
+ logprocess("reorder two, handle pre mark")
+ end
elseif above_mark[char] then
-- after main consonant
+-- IF PATCHED
+-- target = subpos
+-- if postpos == subpos then
+-- postpos = current
+-- end
+-- subpos = current
+-- ELSE
target = basepos
if subpos == basepos then
subpos = current
@@ -2041,6 +2265,7 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas
postpos = current
end
basepos = current
+-- END
elseif below_mark[char] then
-- after subjoined consonants
target = subpos
@@ -2074,13 +2299,16 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas
setlink(current,getnext(target))
setlink(target,current)
-- setlink(target,current,getnext(target)) -- maybe
+ if trace_steps then
+ logprocess("reorder two, handle mark")
+ end
end
end
end
current = cn
end
- -- reorder halant+Ra
+ -- reorder halant + Ra
local current = getnext(start)
local last = getnext(stop)
@@ -2104,6 +2332,9 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas
stop = prev
end
cn = next
+ if trace_steps then
+ logprocess("reorder two, handle halant and ra")
+ end
end
end
-- after_postscript
@@ -2143,6 +2374,9 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas
setprev(nextnextnext,current)
end
setlink(nextnext,c)
+ if trace_steps then
+ logprocess("reorder two, handle nukta")
+ end
end
if stop == current then break end
current = getnext(current)
@@ -2154,7 +2388,10 @@ local function reorder_two(head,start,stop,font,attr,nbspaces) -- maybe do a pas
end
nbspaces = nbspaces - 1
head = remove_node(head, base)
- flush_node(base)
+ flushnode(base)
+ if trace_steps then
+ logprocess("reorder two, handle nbsp")
+ end
end
return head, stop, nbspaces
@@ -2179,8 +2416,8 @@ local function analyze_next_chars_one(c,font,variant) -- skip one dependent vowe
if not n then
return c
end
+ local v = ischar(n,font)
if variant == 1 then
- local v = ischar(n,font)
if v and nukta[v] then
n = getnext(n)
if n then
@@ -2213,7 +2450,6 @@ local function analyze_next_chars_one(c,font,variant) -- skip one dependent vowe
end
end
elseif variant == 2 then
- local v = ischar(n,font)
if v and nukta[v] then
c = n
end
@@ -2238,11 +2474,11 @@ local function analyze_next_chars_one(c,font,variant) -- skip one dependent vowe
end
end
-- c = ms_matra(c)
- local n = getnext(c)
+ n = getnext(c)
if not n then
return c
end
- local v = ischar(n,font)
+ v = ischar(n,font)
if not v then
return c
end
@@ -2251,21 +2487,49 @@ local function analyze_next_chars_one(c,font,variant) -- skip one dependent vowe
local already_below_mark -- = false
local already_post_mark -- = false
while dependent_vowel[v] do
- local vowels = twopart_mark[v] or { v }
- for k, v in next, vowels do
- if pre_mark[v] and not already_pre_mark then
- already_pre_mark = true
- elseif above_mark[v] and not already_above_mark then
- already_above_mark = true
- elseif below_mark[v] and not already_below_mark then
- already_below_mark = true
- elseif post_mark[v] and not already_post_mark then
- already_post_mark = true
- else
- return c
- end
- end
- c = getnext(c)
+ local vowels = twopart_mark[v]
+ if vowels then
+ for k=1,#vowels do
+ local v = vowels[k]
+ if pre_mark[v] and not already_pre_mark then
+ already_pre_mark = true
+ elseif above_mark[v] and not already_above_mark then
+ already_above_mark = true
+ elseif below_mark[v] and not already_below_mark then
+ already_below_mark = true
+ elseif post_mark[v] and not already_post_mark then
+ already_post_mark = true
+ elseif devanagarihash[font].conjuncts == "continue" then
+ -- for testing
+ else
+ return c
+ end
+ end
+ else
+ if pre_mark[v] and not already_pre_mark then
+ already_pre_mark = true
+ elseif post_mark[v] and not already_post_mark then
+-- IF PATCHED THEN
+-- already_post_mark = true
+-- ELSE
+ if devanagarihash[font].conjuncts == "mixed" then
+ -- for messy fonts
+ return c
+ else
+ already_post_mark = true
+ end
+-- END
+ elseif below_mark[v] and not already_below_mark then
+ already_below_mark = true
+ elseif above_mark[v] and not already_above_mark then
+ already_above_mark = true
+ elseif devanagarihash[font].conjuncts == "continue" then
+ -- for testing
+ else
+ return c
+ end
+ end
+ c = n
n = getnext(c)
if not n then
return c
@@ -2276,7 +2540,7 @@ local function analyze_next_chars_one(c,font,variant) -- skip one dependent vowe
end
end
if nukta[v] then
- c = getnext(c)
+ c = n
n = getnext(c)
if not n then
return c
@@ -2287,7 +2551,7 @@ local function analyze_next_chars_one(c,font,variant) -- skip one dependent vowe
end
end
if halant[v] then
- c = getnext(c)
+ c = n
n = getnext(c)
if not n then
return c
@@ -2298,7 +2562,7 @@ local function analyze_next_chars_one(c,font,variant) -- skip one dependent vowe
end
end
if vowel_modifier[v] then
- c = getnext(c)
+ c = n
n = getnext(c)
if not n then
return c
@@ -2309,7 +2573,7 @@ local function analyze_next_chars_one(c,font,variant) -- skip one dependent vowe
end
end
if stress_tone_mark[v] then
- c = getnext(c)
+ c = n
n = getnext(c)
if not n then
return c
@@ -2326,6 +2590,16 @@ local function analyze_next_chars_one(c,font,variant) -- skip one dependent vowe
end
end
+-- Consonant syllable:
+--
+-- { C + [ N ] + < H + [ < ZWNJ | ZWJ > ] | < ZWNJ | ZWJ > + H > }
+-- + C
+-- + [ N ]
+-- + [ A ]
+-- + [ < H + [ < ZWNJ|ZWJ > ] | { M } + [ N ] + [ H ] > ]
+-- + [ SM ]
+-- + [ ( VD ) ]
+
local function analyze_next_chars_two(c,font)
local n = getnext(c)
if not n then
@@ -2393,11 +2667,11 @@ local function analyze_next_chars_two(c,font)
-- This shouldn't happen I guess.
return
end
- local n = getnext(c)
+ n = getnext(c)
if not n then
return c
end
- local v = ischar(n,font)
+ v = ischar(n,font)
if not v then
return c
end
@@ -2440,21 +2714,50 @@ local function analyze_next_chars_two(c,font)
local already_above_mark -- = false
local already_below_mark -- = false
local already_post_mark -- = false
- while dependent_vowel[v] do
- local vowels = twopart_mark[v] or { v }
- for k, v in next, vowels do
- if pre_mark[v] and not already_pre_mark then
- already_pre_mark = true
- elseif above_mark[v] and not already_above_mark then
- already_above_mark = true
- elseif below_mark[v] and not already_below_mark then
- already_below_mark = true
- elseif post_mark[v] and not already_post_mark then
- already_post_mark = true
- else
- return c
- end
- end
+ -- inefficient : too many tests but seldom more than one
+ while dependent_vowel[v] do
+ local vowels = twopart_mark[v]
+ if vowels then
+ for k=1,#vowels do
+ local v = vowels[k]
+ if pre_mark[v] and not already_pre_mark then
+ already_pre_mark = true
+ elseif above_mark[v] and not already_above_mark then
+ already_above_mark = true
+ elseif below_mark[v] and not already_below_mark then
+ already_below_mark = true
+ elseif post_mark[v] and not already_post_mark then
+ already_post_mark = true
+ elseif devanagarihash[font].conjuncts == "continue" then
+ -- for testing
+ else
+ return c
+ end
+ end
+ else
+ if pre_mark[v] and not already_pre_mark then
+ already_pre_mark = true
+ elseif post_mark[v] and not already_post_mark then
+-- IF PATCHED THEN
+-- already_post_mark = true
+-- ELSE
+ if devanagarihash[font].conjuncts == "mixed" then
+ -- for messy fonts
+ return c
+ else
+ already_post_mark = true
+ end
+-- END
+ elseif below_mark[v] and not already_below_mark then
+ already_below_mark = true
+ elseif above_mark[v] and not already_above_mark then
+ already_above_mark = true
+ elseif devanagarihash[font].conjuncts == "continue" then
+ -- for testing
+ else
+ return c
+ end
+ end
c = n
n = getnext(c)
if not n then
@@ -2708,7 +3011,7 @@ local function method_one(head,font,attr)
end
else
if show_syntax_errors then
- local mark = mark_four[char]
+ local mark = mark_pre_above_below_post[char]
if mark then
head, current = inject_syntax_error(head,current,char)
end
@@ -2731,15 +3034,15 @@ local function method_one(head,font,attr)
while current do
local char = ischar(current,font)
if char then
- if n == 0 and not getstate(current) then
- setstate(current,s_init)
- end
- n = n + 1
- else
- n = 0
- end
- current = getnext(current)
- end
+ if n == 0 and not getstate(current) then
+ setstate(current,s_init)
+ end
+ n = n + 1
+ else
+ n = 0
+ end
+ current = getnext(current)
+ end
return head, done
end
@@ -2800,7 +3103,6 @@ local function method_two(head,font,attr)
syllableend = current
elseif consonant[getchar(current)] then
-- WHY current INSTEAD OF c ?
-
-- Consonant syllable: {C+[N]+<H+[<ZWNJ|ZWJ>]|<ZWNJ|ZWJ>+H>} + C+[N]+[A] + [< H+[<ZWNJ|ZWJ>] | {M}+[N]+[H]>]+[SM]+[(VD)]
current = analyze_next_chars_two(current,font) -- not c !
syllableend = current
@@ -2822,7 +3124,7 @@ local function method_two(head,font,attr)
if not syllableend and show_syntax_errors then
local char = ischar(current,font)
if char and not getstate(current) then -- state can also be init
- local mark = mark_four[char]
+ local mark = mark_pre_above_below_post[char]
if mark then
head, current = inject_syntax_error(head,current,char)
end
@@ -2841,15 +3143,19 @@ local function method_two(head,font,attr)
while current do
local char = ischar(current,font)
if char then
- if n == 0 and not getstate(current) then -- state can also be init
- setstate(current,s_init)
- end
- n = n + 1
- else
- n = 0
- end
- current = getnext(current)
- end
+ if n == 0 and not getstate(current) then -- state can also be init
+ setstate(current,s_init)
+ end
+ n = n + 1
+ else
+ n = 0
+ end
+ current = getnext(current)
+ end
+
+ -- if languages.indic then
+ -- head = languages.indic.handler(head)
+ -- end
return head, done
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-ota.lua b/Master/texmf-dist/tex/context/base/mkiv/font-ota.lua
index ce1b22b50d7..a8f9f0047c2 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-ota.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-ota.lua
@@ -40,7 +40,7 @@ local getsubtype = nuts.getsubtype
local getchar = nuts.getchar
local ischar = nuts.ischar
-local end_of_math = nuts.end_of_math
+local endofmath = nuts.endofmath
local nodecodes = nodes.nodecodes
----- glyph_code = nodecodes.glyph
@@ -173,7 +173,7 @@ function analyzers.setstate(head,font)
end
first, last, n = nil, nil, 0
if id == math_code then
- current = end_of_math(current)
+ current = endofmath(current)
end
elseif id == disc_code then
-- always in the middle .. it doesn't make much sense to assign a property
@@ -189,7 +189,7 @@ function analyzers.setstate(head,font)
end
first, last, n = nil, nil, 0
if id == math_code then
- current = end_of_math(current)
+ current = endofmath(current)
end
end
current = getnext(current)
@@ -435,7 +435,7 @@ function methods.arab(head,font,attr)
first = nil
end
if id == math_code then -- a bit duplicate as we test for glyphs twice
- current = end_of_math(current)
+ current = endofmath(current)
end
end
current = getnext(current)
@@ -562,7 +562,7 @@ do
wrapup()
end
if id == math_code then -- a bit duplicate as we test for glyphs twice
- current = end_of_math(current)
+ current = endofmath(current)
end
end
current = getnext(current)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-otc.lua b/Master/texmf-dist/tex/context/base/mkiv/font-otc.lua
index 2643d022a57..f83c3e8ec76 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-otc.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-otc.lua
@@ -102,8 +102,9 @@ local function validspecification(specification,name)
specification = { dataset = dataset }
else
dataset = { { data = specification.data } }
- specification.data = nil
- specification.dataset = dataset
+ specification.data = nil
+ specification.coverage = dataset
+ specification.dataset = dataset
end
local first = dataset[1]
if first then
@@ -129,7 +130,7 @@ local function validspecification(specification,name)
end
end
-local function addfeature(data,feature,specifications)
+local function addfeature(data,feature,specifications,prepareonly)
-- todo: add some validator / check code so that we're more tolerant to
-- user errors
@@ -141,6 +142,12 @@ local function addfeature(data,feature,specifications)
local descriptions = data.descriptions
local resources = data.resources
+
+ if not descriptions or not resources then
+ report_otf("missing specification")
+ return
+ end
+
local features = resources.features
local sequences = resources.sequences
@@ -225,6 +232,9 @@ local function addfeature(data,feature,specifications)
local stepkey = coverup.stepkey
local register = coverup.register
+ -- todo: directly pass a coverage i.e. for privates that later will be
+ -- set
+
local function prepare_substitution(list,featuretype,nocheck)
local coverage = { }
local cover = coveractions[featuretype]
@@ -232,6 +242,7 @@ local function addfeature(data,feature,specifications)
local unicode = tounicode(code)
local description = descriptions[unicode]
if not nocheck and not description then
+ -- todo: trace !
skip = skip + 1
else
if type(replacement) == "table" then
@@ -436,13 +447,36 @@ local function addfeature(data,feature,specifications)
local prepare_single = prepare_pair -- we could have a better test on the spec
- local function prepare_chain(list,featuretype,sublookups)
+ local function hassteps(lookups)
+ if lookups then
+ for i=1,#lookups do
+ local l = lookups[i]
+ if l then
+ for j=1,#l do
+ local l = l[j]
+ if l then
+ local n = l.nofsteps
+ if not n then
+ -- gsub_remove
+ return true
+ elseif n > 0 then
+ return true
+ end
+ end
+ end
+ end
+ end
+ end
+ return false
+ end
+
+ -- 0 == remove, false = ignore (remove is default)
+
+ local function prepare_chain(list,featuretype,sublookups,nocheck)
-- todo: coveractions
local rules = list.rules
local coverage = { }
if rules then
- local rulehash = { }
- local rulesize = 0
local lookuptype = types[featuretype]
for nofrules=1,#rules do
local rule = rules[nofrules]
@@ -473,6 +507,16 @@ local function addfeature(data,feature,specifications)
local lookups = rule.lookups or false
local subtype = nil
if lookups and sublookups then
+ -- inspect(lookups)
+ if #lookups > 0 then
+ local ns = stop - start + 1
+ for i=1,ns do
+ if lookups[i] == nil then
+ lookups[i] = 0
+ end
+ end
+ end
+ local l = { }
for k, v in sortedhash(lookups) do
local t = type(v)
if t == "table" then
@@ -483,61 +527,76 @@ local function addfeature(data,feature,specifications)
v[i] = { vi }
end
end
+ l[k] = v
elseif t == "number" then
local lookup = sublookups[v]
if lookup then
- lookups[k] = { lookup }
+ l[k] = { lookup }
if not subtype then
subtype = lookup.type
end
elseif v == 0 then
- lookups[k] = { { type = "gsub_remove" } }
+ l[k] = { { type = "gsub_remove", nosteps = true } }
else
- lookups[k] = false -- { false } -- new
+ l[k] = false -- { false } -- new
end
else
- lookups[k] = false -- { false } -- new
+ l[k] = false -- { false } -- new
end
end
+ if nocheck then
+ -- fragile
+ rule.lookups = l --no, because checking can spoil it
+ end
+ lookups = l
end
if nofsequences > 0 then -- we merge coverage into one
-- we copy as we can have different fonts
- local hashed = { }
- for i=1,nofsequences do
- local t = { }
- local s = sequence[i]
- for i=1,#s do
- local u = tounicode(s[i])
- if u then
- t[u] = true
+ if hassteps(lookups) then
+ -- sequence is the before|current|after match list
+ local hashed = { }
+ for i=1,nofsequences do
+ local t = { }
+ local s = sequence[i]
+ for i=1,#s do
+ local u = tounicode(s[i])
+ if u then
+ t[u] = true
+ end
end
+ hashed[i] = t
end
- hashed[i] = t
- end
- sequence = hashed
- -- now we create the rule
- rulesize = rulesize + 1
- rulehash[rulesize] = {
- nofrules, -- 1
- lookuptype, -- 2
- sequence, -- 3
- start, -- 4
- stop, -- 5
- lookups, -- 6 (6/7 also signal of what to do)
- replacements, -- 7
- subtype, -- 8
- }
--- for unic in next, sequence[start] do
- for unic in sortedhash(sequence[start]) do
- local cu = coverage[unic]
- if not cu then
- coverage[unic] = rulehash -- can now be done cleaner i think
+ -- hashed is the before|current|after match hash
+ sequence = hashed
+ local ruleset = {
+ nofrules, -- 1
+ lookuptype, -- 2
+ sequence, -- 3
+ start, -- 4
+ stop, -- 5
+ lookups, -- 6 (6/7 also signal of what to do)
+ replacements, -- 7
+ subtype, -- 8
+ }
+ for unic in sortedhash(sequence[start]) do
+ local cu = coverage[unic]
+ if cu then
+ local n = cu.n + 1
+ cu[n] = ruleset
+ cu.n = n
+ else
+ coverage[unic] = {
+ ruleset,
+ n = 1,
+ }
+ end
end
+ sequence.n = nofsequences
+ else
+ -- report_otf("no steps for %a",lookuptype) -- e.g. in primes feature
end
- sequence.n = nofsequences
end
end
- rulehash.n = rulesize
end
return coverage
end
@@ -626,133 +685,167 @@ local function addfeature(data,feature,specifications)
end
local askedfeatures = specification.features or everywhere
local askedsteps = specification.steps or specification.subtables or { specification.data } or { }
- local featuretype = normalized[specification.type or "substitution"] or "substitution"
+ local featuretype = specification.type or "substitution"
+ local featureaction = false
local featureflags = specification.flags or noflags
local nocheck = specification.nocheck
+ local mapping = specification.mapping
local featureorder = specification.order or { feature }
local featurechain = (featuretype == "chainsubstitution" or featuretype == "chainposition") and 1 or 0
local nofsteps = 0
local steps = { }
local sublookups = specification.lookups
local category = nil
+ local steptype = nil
+ local sequence = nil
+ --
+ if fonts.handlers.otf.handlers[featuretype] then
+ featureaction = true -- function based
+ else
+ featuretype = normalized[specification.type or "substitution"] or "substitution"
+ end
--
checkflags(specification,resources)
--
- if sublookups then
- local s = { }
- for i=1,#sublookups do
- local specification = sublookups[i]
- local askedsteps = specification.steps or specification.subtables or { specification.data } or { }
- local featuretype = normalized[specification.type or "substitution"] or "substitution"
- local featureflags = specification.flags or noflags
- local nofsteps = 0
- local steps = { }
- for i=1,#askedsteps do
- local list = askedsteps[i]
- local coverage = nil
- local format = nil
- if featuretype == "substitution" then
- coverage = prepare_substitution(list,featuretype,nocheck)
- elseif featuretype == "ligature" then
- coverage = prepare_ligature(list,featuretype,nocheck)
- elseif featuretype == "alternate" then
- coverage = prepare_alternate(list,featuretype,nocheck)
- elseif featuretype == "multiple" then
- coverage = prepare_multiple(list,featuretype,nocheck)
- elseif featuretype == "kern" or featuretype == "move" then
- format = featuretype
- coverage = prepare_kern(list,featuretype)
- elseif featuretype == "pair" then
- format = "pair"
- coverage = prepare_pair(list,featuretype)
- elseif featuretype == "single" then
- format = "single"
- coverage = prepare_single(list,featuretype)
- end
- if coverage and next(coverage) then
- nofsteps = nofsteps + 1
- steps[nofsteps] = register(coverage,featuretype,format,feature,nofsteps,descriptions,resources)
+ for k, v in next, askedfeatures do
+ if v[1] then
+ askedfeatures[k] = tohash(v)
+ end
+ end
+ --
+ if featureflags[1] then featureflags[1] = "mark" end
+ if featureflags[2] then featureflags[2] = "ligature" end
+ if featureflags[3] then featureflags[3] = "base" end
+ --
+ if featureaction then
+
+ category = "gsub"
+ sequence = {
+ features = { [feature] = askedfeatures },
+ flags = featureflags,
+ name = feature, -- redundant
+ order = featureorder,
+ type = featuretype,
+ -- steps = { },
+ nofsteps = 0, -- just in case we test for that
+ }
+
+ else
+
+ if sublookups then
+ local s = { }
+ for i=1,#sublookups do
+ local specification = sublookups[i]
+ local askedsteps = specification.steps or specification.subtables or { specification.data } or { }
+ local featuretype = normalized[specification.type or "substitution"] or "substitution"
+ local featureflags = specification.flags or noflags
+ local nofsteps = 0
+ local steps = { }
+ for i=1,#askedsteps do
+ local list = askedsteps[i]
+ local coverage = nil
+ local format = nil
+ if featuretype == "substitution" then
+ coverage = prepare_substitution(list,featuretype,nocheck)
+ elseif featuretype == "ligature" then
+ coverage = prepare_ligature(list,featuretype,nocheck)
+ elseif featuretype == "alternate" then
+ coverage = prepare_alternate(list,featuretype,nocheck)
+ elseif featuretype == "multiple" then
+ coverage = prepare_multiple(list,featuretype,nocheck)
+ elseif featuretype == "kern" or featuretype == "move" then
+ format = featuretype
+ coverage = prepare_kern(list,featuretype)
+ elseif featuretype == "pair" then
+ format = "pair"
+ coverage = prepare_pair(list,featuretype)
+ elseif featuretype == "single" then
+ format = "single"
+ coverage = prepare_single(list,featuretype)
+ end
+ if coverage and next(coverage) then
+ nofsteps = nofsteps + 1
+ steps[nofsteps] = register(coverage,featuretype,format,feature,nofsteps,descriptions,resources)
+ end
end
+ --
+ checkmerge(specification)
+ checksteps(specification)
+ --
+ s[i] = {
+ [stepkey] = steps,
+ nofsteps = nofsteps,
+ flags = featureflags,
+ type = types[featuretype],
+ }
+ end
+ sublookups = s
+ end
+
+ for i=1,#askedsteps do
+ local list = askedsteps[i]
+ local coverage = nil
+ local format = nil
+ if featuretype == "substitution" then
+ -- see font-imp-tweaks: we directly pass a mapping so no checks done
+ category = "gsub"
+ coverage = (mapping and list) or prepare_substitution(list,featuretype,nocheck)
+ elseif featuretype == "ligature" then
+ category = "gsub"
+ coverage = prepare_ligature(list,featuretype,nocheck)
+ elseif featuretype == "alternate" then
+ category = "gsub"
+ coverage = prepare_alternate(list,featuretype,nocheck)
+ elseif featuretype == "multiple" then
+ category = "gsub"
+ coverage = prepare_multiple(list,featuretype,nocheck)
+ elseif featuretype == "kern" or featuretype == "move" then
+ category = "gpos"
+ format = featuretype
+ coverage = prepare_kern(list,featuretype)
+ elseif featuretype == "pair" then
+ category = "gpos"
+ format = "pair"
+ coverage = prepare_pair(list,featuretype)
+ elseif featuretype == "single" then
+ category = "gpos"
+ format = "single"
+ coverage = prepare_single(list,featuretype)
+ elseif featuretype == "chainsubstitution" then
+ category = "gsub"
+ coverage = prepare_chain(list,featuretype,sublookups,nocheck)
+ elseif featuretype == "chainposition" then
+ category = "gpos"
+ coverage = prepare_chain(list,featuretype,sublookups,nocheck)
+ else
+ report_otf("not registering feature %a, unknown category",feature)
+ return
end
- --
- checkmerge(specification)
- checksteps(specification)
- --
- s[i] = {
+ if coverage and next(coverage) then
+ nofsteps = nofsteps + 1
+ steps[nofsteps] = register(coverage,featuretype,format,feature,nofsteps,descriptions,resources)
+ end
+ end
+
+ if nofsteps > 0 then
+ sequence = {
+ chain = featurechain,
+ features = { [feature] = askedfeatures },
+ flags = featureflags,
+ name = feature, -- redundant
+ order = featureorder,
[stepkey] = steps,
nofsteps = nofsteps,
- flags = featureflags,
- type = types[featuretype],
+ type = specification.handler or types[featuretype],
}
- end
- sublookups = s
- end
- for i=1,#askedsteps do
- local list = askedsteps[i]
- local coverage = nil
- local format = nil
- if featuretype == "substitution" then
- category = "gsub"
- coverage = prepare_substitution(list,featuretype,nocheck)
- elseif featuretype == "ligature" then
- category = "gsub"
- coverage = prepare_ligature(list,featuretype,nocheck)
- elseif featuretype == "alternate" then
- category = "gsub"
- coverage = prepare_alternate(list,featuretype,nocheck)
- elseif featuretype == "multiple" then
- category = "gsub"
- coverage = prepare_multiple(list,featuretype,nocheck)
- elseif featuretype == "kern" or featuretype == "move" then
- category = "gpos"
- format = featuretype
- coverage = prepare_kern(list,featuretype)
- elseif featuretype == "pair" then
- category = "gpos"
- format = "pair"
- coverage = prepare_pair(list,featuretype)
- elseif featuretype == "single" then
- category = "gpos"
- format = "single"
- coverage = prepare_single(list,featuretype)
- elseif featuretype == "chainsubstitution" then
- category = "gsub"
- coverage = prepare_chain(list,featuretype,sublookups)
- elseif featuretype == "chainposition" then
- category = "gpos"
- coverage = prepare_chain(list,featuretype,sublookups)
- else
- report_otf("not registering feature %a, unknown category",feature)
- return
- end
- if coverage and next(coverage) then
- nofsteps = nofsteps + 1
- steps[nofsteps] = register(coverage,featuretype,format,feature,nofsteps,descriptions,resources)
+ if prepareonly then
+ return sequence
+ end
end
end
- if nofsteps > 0 then
+
+ if sequence then
-- script = { lang1, lang2, lang3 } or script = { lang1 = true, ... }
- for k, v in next, askedfeatures do
- if v[1] then
- askedfeatures[k] = tohash(v)
- end
- end
- --
- if featureflags[1] then featureflags[1] = "mark" end
- if featureflags[2] then featureflags[2] = "ligature" end
- if featureflags[3] then featureflags[3] = "base" end
- local steptype = types[featuretype]
- local sequence = {
- chain = featurechain,
- features = { [feature] = askedfeatures },
- flags = featureflags,
- name = feature, -- redundant
- order = featureorder,
- [stepkey] = steps,
- nofsteps = nofsteps,
- type = steptype,
- }
- --
checkflags(sequence,resources)
checkmerge(sequence)
checksteps(sequence)
@@ -782,11 +875,13 @@ local function addfeature(data,feature,specifications)
end
end
end
+
end
end
if trace_loading then
report_otf("registering feature %a, affected glyphs %a, skipped glyphs %a",feature,done,skip)
end
+
end
otf.enhancers.addfeature = addfeature
@@ -833,6 +928,23 @@ local function enhance(data,filename,raw)
end
end
+-- local function enhance(data,filename,raw)
+-- local first = 1
+-- local last = #extrafeatures
+-- while true do
+-- for slot=first,last do
+-- local specification = extrafeatures[slot]
+-- addfeature(data,specification.name,specification)
+-- end
+-- if #extrafeatures > last then
+-- first = last + 1
+-- last = #extrafeatures
+-- else
+-- break
+-- end
+-- end
+-- end
+
otf.enhancers.enhance = enhance
otf.enhancers.register("check extra features",enhance)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-otj.lua b/Master/texmf-dist/tex/context/base/mkiv/font-otj.lua
index bb02044dca6..c4ec9972cd4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-otj.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-otj.lua
@@ -90,6 +90,8 @@ local getoffsets = nuts.getoffsets
local getboth = nuts.getboth
local getdisc = nuts.getdisc
local setdisc = nuts.setdisc
+local getreplace = nuts.getreplace
+local setreplace = nuts.setreplace
local setoffsets = nuts.setoffsets
local ischar = nuts.ischar
local getkern = nuts.getkern
@@ -98,13 +100,11 @@ local setlink = nuts.setlink
local setwidth = nuts.setwidth
local getwidth = nuts.getwidth
------ traverse_id = nuts.traverse_id
------ traverse_char = nuts.traverse_char
local nextchar = nuts.traversers.char
local nextglue = nuts.traversers.glue
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local properties = nodes.properties.data
@@ -124,7 +124,7 @@ if not fontkern then -- generic
local thekern = nuts.new("kern",0) -- fontkern
local setkern = nuts.setkern
- local copy_node = nuts.copy_node
+ local copy_node = nuts.copy
fontkern = function(k)
local n = copy_node(thekern)
@@ -138,7 +138,7 @@ if not italickern then -- generic
local thekern = nuts.new("kern",3) -- italiccorrection
local setkern = nuts.setkern
- local copy_node = nuts.copy_node
+ local copy_node = nuts.copy
italickern = function(k)
local n = copy_node(thekern)
@@ -667,12 +667,12 @@ local function inject_kerns_only(head,where)
if leftkern and leftkern ~= 0 then
if prev and getid(prev) == glue_code then
if useitalickerns then
- head = insert_node_before(head,current,italickern(leftkern))
+ head = insertnodebefore(head,current,italickern(leftkern))
else
setwidth(prev, getwidth(prev) + leftkern)
end
else
- head = insert_node_before(head,current,fontkern(leftkern))
+ head = insertnodebefore(head,current,fontkern(leftkern))
end
end
end
@@ -731,7 +731,7 @@ local function inject_kerns_only(head,where)
if i then
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- pre = insert_node_before(pre,n,fontkern(leftkern))
+ pre = insertnodebefore(pre,n,fontkern(leftkern))
done = true
end
end
@@ -747,7 +747,7 @@ local function inject_kerns_only(head,where)
if i then
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- post = insert_node_before(post,n,fontkern(leftkern))
+ post = insertnodebefore(post,n,fontkern(leftkern))
done = true
end
end
@@ -763,7 +763,7 @@ local function inject_kerns_only(head,where)
if i then
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- replace = insert_node_before(replace,n,fontkern(leftkern))
+ replace = insertnodebefore(replace,n,fontkern(leftkern))
done = true
end
end
@@ -830,39 +830,36 @@ local function inject_positions_only(head,where)
rightkern = 0
elseif prev and getid(prev) == glue_code then
if useitalickerns then
- head = insert_node_before(head,current,italickern(leftkern))
+ head = insertnodebefore(head,current,italickern(leftkern))
else
setwidth(prev, getwidth(prev) + leftkern)
end
else
- head = insert_node_before(head,current,fontkern(leftkern))
+ head = insertnodebefore(head,current,fontkern(leftkern))
end
end
if rightkern and rightkern ~= 0 then
if next and getid(next) == glue_code then
if useitalickerns then
- insert_node_after(head,current,italickern(rightkern))
+ insertnodeafter(head,current,italickern(rightkern))
else
setwidth(next, getwidth(next) + rightkern)
end
else
- insert_node_after(head,current,fontkern(rightkern))
+ insertnodeafter(head,current,fontkern(rightkern))
end
end
- else
+ elseif next then
local i = p.emptyinjections
if i then
-- glyph|disc|glyph (special case)
local rightkern = i.rightkern
- if rightkern and rightkern ~= 0 then
- if next and getid(next) == disc_code then
- if replace then
- -- error, we expect an empty one
- else
- -- KE setfield(next,"replace",fontkern(rightkern)) -- maybe also leftkern
- replace = fontkern(rightkern) -- maybe also leftkern
- done = true --KE
- end
+ if rightkern and rightkern ~= 0 and getid(next) == disc_code then
+ local replace = getreplace(next)
+ if replace then
+ -- can't happen
+ else
+ setreplace(next,fontkern(rightkern))
end
end
end
@@ -925,12 +922,12 @@ local function inject_positions_only(head,where)
end
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- pre = insert_node_before(pre,n,fontkern(leftkern))
+ pre = insertnodebefore(pre,n,fontkern(leftkern))
done = true
end
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- insert_node_after(pre,n,fontkern(rightkern))
+ insertnodeafter(pre,n,fontkern(rightkern))
done = true
end
end
@@ -950,12 +947,12 @@ local function inject_positions_only(head,where)
end
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- post = insert_node_before(post,n,fontkern(leftkern))
+ post = insertnodebefore(post,n,fontkern(leftkern))
done = true
end
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- insert_node_after(post,n,fontkern(rightkern))
+ insertnodeafter(post,n,fontkern(rightkern))
done = true
end
end
@@ -975,12 +972,12 @@ local function inject_positions_only(head,where)
end
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- replace = insert_node_before(replace,n,fontkern(leftkern))
+ replace = insertnodebefore(replace,n,fontkern(leftkern))
done = true
end
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- insert_node_after(replace,n,fontkern(rightkern))
+ insertnodeafter(replace,n,fontkern(rightkern))
done = true
end
end
@@ -996,7 +993,7 @@ local function inject_positions_only(head,where)
-- glyph|pre glyphs
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- pre = insert_node_before(pre,pre,fontkern(rightkern))
+ pre = insertnodebefore(pre,pre,fontkern(rightkern))
done = true
end
end
@@ -1010,7 +1007,7 @@ local function inject_positions_only(head,where)
-- glyph|replace glyphs
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- replace = insert_node_before(replace,replace,fontkern(rightkern))
+ replace = insertnodebefore(replace,replace,fontkern(rightkern))
done = true
end
end
@@ -1144,8 +1141,8 @@ local function inject_everything(head,where)
--
-- todo: head and check for prev / next kern
--
- insert_node_before(n,n,fontkern(-wn))
- insert_node_after(n,n,fontkern(-wn))
+ insertnodebefore(n,n,fontkern(-wn))
+ insertnodeafter(n,n,fontkern(-wn))
end
end
end
@@ -1295,39 +1292,37 @@ local function inject_everything(head,where)
rightkern = 0
elseif prev and getid(prev) == glue_code then
if useitalickerns then
- head = insert_node_before(head,current,italickern(leftkern))
+ head = insertnodebefore(head,current,italickern(leftkern))
else
setwidth(prev, getwidth(prev) + leftkern)
end
else
- head = insert_node_before(head,current,fontkern(leftkern))
+ head = insertnodebefore(head,current,fontkern(leftkern))
end
end
if rightkern and rightkern ~= 0 then
if next and getid(next) == glue_code then
if useitalickerns then
- insert_node_after(head,current,italickern(rightkern))
+ insertnodeafter(head,current,italickern(rightkern))
else
setwidth(next, getwidth(next) + rightkern)
end
else
- insert_node_after(head,current,fontkern(rightkern))
+ insertnodeafter(head,current,fontkern(rightkern))
end
end
end
- else
+ elseif next then
local i = p.emptyinjections
if i then
-- glyph|disc|glyph (special case)
local rightkern = i.rightkern
- if rightkern and rightkern ~= 0 then
- if next and getid(next) == disc_code then
- if replace then
- -- error, we expect an empty one
- else
- replace = fontkern(rightkern)
- done = true
- end
+ if rightkern and rightkern ~= 0 and getid(next) == disc_code then
+ local replace = getreplace(next)
+ if replace then
+ -- can't happen
+ else
+ setreplace(next,fontkern(rightkern))
end
end
end
@@ -1406,12 +1401,12 @@ local function inject_everything(head,where)
end
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- pre = insert_node_before(pre,n,fontkern(leftkern))
+ pre = insertnodebefore(pre,n,fontkern(leftkern))
done = true
end
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- insert_node_after(pre,n,fontkern(rightkern))
+ insertnodeafter(pre,n,fontkern(rightkern))
done = true
end
if hasmarks then
@@ -1437,12 +1432,12 @@ local function inject_everything(head,where)
end
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- post = insert_node_before(post,n,fontkern(leftkern))
+ post = insertnodebefore(post,n,fontkern(leftkern))
done = true
end
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- insert_node_after(post,n,fontkern(rightkern))
+ insertnodeafter(post,n,fontkern(rightkern))
done = true
end
if hasmarks then
@@ -1468,12 +1463,12 @@ local function inject_everything(head,where)
end
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- replace = insert_node_before(replace,n,fontkern(leftkern))
+ replace = insertnodebefore(replace,n,fontkern(leftkern))
done = true
end
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- insert_node_after(replace,n,fontkern(rightkern))
+ insertnodeafter(replace,n,fontkern(rightkern))
done = true
end
if hasmarks then
@@ -1495,7 +1490,7 @@ local function inject_everything(head,where)
-- glyph|pre glyphs
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- pre = insert_node_before(pre,pre,fontkern(rightkern))
+ pre = insertnodebefore(pre,pre,fontkern(rightkern))
done = true
end
end
@@ -1509,7 +1504,7 @@ local function inject_everything(head,where)
-- glyph|replace glyphs
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- replace = insert_node_before(replace,replace,fontkern(rightkern))
+ replace = insertnodebefore(replace,replace,fontkern(rightkern))
done = true
end
end
@@ -1711,8 +1706,8 @@ local function injectspaces(head)
if trace_spaces then
report_spaces("%C [%p + %p + %p] %C",prevchar,lnew,old,rnew,nextchar)
end
- head = insert_node_before(head,n,italickern(lnew))
- insert_node_after(head,n,italickern(rnew))
+ head = insertnodebefore(head,n,italickern(lnew))
+ insertnodeafter(head,n,italickern(rnew))
else
local new = old + (leftkern + rightkern) * factor
if trace_spaces then
@@ -1727,7 +1722,7 @@ local function injectspaces(head)
if trace_spaces then
report_spaces("%C [%p + %p]",prevchar,old,new)
end
- insert_node_after(head,n,italickern(new)) -- tricky with traverse but ok
+ insertnodeafter(head,n,italickern(new)) -- tricky with traverse but ok
else
local new = old + leftkern * factor
if trace_spaces then
@@ -1746,7 +1741,7 @@ local function injectspaces(head)
if trace_spaces then
report_spaces("[%p + %p] %C",old,new,nextchar)
end
- insert_node_after(head,n,italickern(new))
+ insertnodeafter(head,n,italickern(new))
else
local new = old + rightkern * factor
if trace_spaces then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-otl.lua b/Master/texmf-dist/tex/context/base/mkiv/font-otl.lua
index 8159db180d6..354ca59a78d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-otl.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-otl.lua
@@ -26,7 +26,7 @@ if not modules then modules = { } end modules ['font-otl'] = {
local lower = string.lower
local type, next, tonumber, tostring, unpack = type, next, tonumber, tostring, unpack
local abs = math.abs
-local derivetable = table.derive
+local derivetable, sortedhash = table.derive, table.sortedhash
local formatters = string.formatters
local setmetatableindex = table.setmetatableindex
@@ -52,7 +52,7 @@ local report_otf = logs.reporter("fonts","otf loading")
local fonts = fonts
local otf = fonts.handlers.otf
-otf.version = 3.113 -- beware: also sync font-mis.lua and in mtx-fonts
+otf.version = 3.132 -- beware: also sync font-mis.lua and in mtx-fonts
otf.cache = containers.define("fonts", "otl", otf.version, true)
otf.svgcache = containers.define("fonts", "svg", otf.version, true)
otf.pngcache = containers.define("fonts", "png", otf.version, true)
@@ -218,6 +218,9 @@ function otf.load(filename,sub,instance)
if cleanup == 0 then
checkmemory(used,threshold,tracememory)
end
+ if context then
+ otfreaders.condense(data)
+ end
otfreaders.pack(data)
report_otf("loading done")
report_otf("saving %a in cache",filename)
@@ -314,7 +317,7 @@ local function copytotfm(data,cache_id)
local properties = derivetable(data.properties)
local descriptions = derivetable(data.descriptions)
local goodies = derivetable(data.goodies)
- local characters = { }
+ local characters = { } -- newtable if we knwo how many
local parameters = { }
local mathparameters = { }
--
@@ -504,7 +507,28 @@ local function copytotfm(data,cache_id)
properties.subfont = subfont
--
if not CONTEXTLMTXMODE or CONTEXTLMTXMODE == 0 then
- properties.encodingbytes = 2
+ --
+ properties.encodingbytes = 2
+elseif CONTEXTLMTXMODE then
+ local duplicates = resources and resources.duplicates
+ if duplicates then
+ local maxindex = data.nofglyphs or metadata.nofglyphs
+ if maxindex then
+ for u, d in sortedhash(duplicates) do
+ local du = descriptions[u]
+ if du then
+ for uu in sortedhash(d) do
+ maxindex = maxindex + 1
+ descriptions[uu].dupindex = du.index
+ descriptions[uu].index = maxindex
+ end
+ else
+ -- report_otf("no %U in font %a, duplicates ignored",u,filename)
+ end
+ end
+ end
+ end
+ --
end
--
-- properties.name = specification.name
@@ -619,25 +643,33 @@ local function read_from_otf(specification)
return tfmdata
end
-local function checkmathsize(tfmdata,mathsize)
- local mathdata = tfmdata.shared.rawdata.metadata.math
- local mathsize = tonumber(mathsize)
- if mathdata then -- we cannot use mathparameters as luatex will complain
- local parameters = tfmdata.parameters
- parameters.scriptpercentage = mathdata.ScriptPercentScaleDown
- parameters.scriptscriptpercentage = mathdata.ScriptScriptPercentScaleDown
- parameters.mathsize = mathsize -- only when a number !
- end
-end
-
-registerotffeature {
- name = "mathsize",
- description = "apply mathsize specified in the font",
- initializers = {
- base = checkmathsize,
- node = checkmathsize,
- }
-}
+-- if context then
+--
+-- -- so the next will go to some generic module instead
+--
+-- else
+--
+-- local function checkmathsize(tfmdata,mathsize)
+-- local mathdata = tfmdata.shared.rawdata.metadata.math
+-- local mathsize = tonumber(mathsize)
+-- if mathdata then -- we cannot use mathparameters as luatex will complain
+-- local parameters = tfmdata.parameters
+-- parameters.scriptpercentage = mathdata.ScriptPercentScaleDown
+-- parameters.scriptscriptpercentage = mathdata.ScriptScriptPercentScaleDown
+-- parameters.mathsize = mathsize -- only when a number !
+-- end
+-- end
+--
+-- registerotffeature {
+-- name = "mathsize",
+-- description = "apply mathsize specified in the font",
+-- initializers = {
+-- base = checkmathsize,
+-- node = checkmathsize,
+-- }
+-- }
+--
+-- end
-- readers
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-oto.lua b/Master/texmf-dist/tex/context/base/mkiv/font-oto.lua
index 6f5f2fb418f..e8b92c07755 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-oto.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-oto.lua
@@ -67,7 +67,7 @@ local function gref(descriptions,n)
end
local function cref(feature,sequence)
- return formatters["feature %a, type %a, chain lookup %a"](feature,sequence.type,sequence.name)
+ return formatters["feature %a, type %a, (chain) lookup %a"](feature,sequence.type,sequence.name)
end
local function report_substitution(feature,sequence,descriptions,unicode,substitution)
@@ -170,7 +170,7 @@ end
local function makefake(tfmdata,name,present)
local private = getprivate(tfmdata)
local character = { intermediate = true, ligatures = { } }
- resources.unicodes[name] = private
+ tfmdata.resources.unicodes[name] = private
tfmdata.characters[private] = character
tfmdata.descriptions[private] = { name = name }
present[name] = private
@@ -178,43 +178,55 @@ local function makefake(tfmdata,name,present)
end
local function make_1(present,tree,name)
- for k, v in next, tree do
- if k == "ligature" then
- present[name] = v
+ if tonumber(tree) then
+ present[name] = v
+ else
+ for k, v in next, tree do
+ if k == "ligature" then
+ present[name] = v
+ else
+ make_1(present,v,name .. "_" .. k)
+ end
+ end
+ end
+end
+
+local function make_3(present,tfmdata,characters,tree,name,preceding,unicode,done,v)
+ local character = characters[preceding]
+ if not character then
+ if trace_baseinit then
+ report_prepare("weird ligature in lookup %a, current %C, preceding %C",sequence.name,v,preceding)
+ end
+ character = makefake(tfmdata,name,present)
+ end
+ local ligatures = character.ligatures
+ if ligatures then
+ ligatures[unicode] = { char = v }
+ else
+ character.ligatures = { [unicode] = { char = v } }
+ end
+ if done then
+ local d = done[name]
+ if not d then
+ done[name] = { "dummy", v }
else
- make_1(present,v,name .. "_" .. k)
+ d[#d+1] = v
end
end
end
local function make_2(present,tfmdata,characters,tree,name,preceding,unicode,done)
- for k, v in next, tree do
- if k == "ligature" then
- local character = characters[preceding]
- if not character then
- if trace_baseinit then
- report_prepare("weird ligature in lookup %a, current %C, preceding %C",sequence.name,v,preceding)
- end
- character = makefake(tfmdata,name,present)
- end
- local ligatures = character.ligatures
- if ligatures then
- ligatures[unicode] = { char = v }
+ if tonumber(tree) then
+ make_3(present,tfmdata,characters,tree,name,preceding,unicode,done,tree)
+ else
+ for k, v in next, tree do
+ if k == "ligature" then
+ make_3(present,tfmdata,characters,tree,name,preceding,unicode,done,v)
else
- character.ligatures = { [unicode] = { char = v } }
+ local code = present[name] or unicode
+ local name = name .. "_" .. k
+ make_2(present,tfmdata,characters,v,name,code,k,done)
end
- if done then
- local d = done[name]
- if not d then
- done[name] = { "dummy", v }
- else
- d[#d+1] = v
- end
- end
- else
- local code = present[name] or unicode
- local name = name .. "_" .. k
- make_2(present,tfmdata,characters,v,name,code,k,done)
end
end
end
@@ -228,12 +240,11 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis
local ligatures = { }
local alternate = tonumber(value) or true and 1
local defaultalt = otf.defaultbasealternate
-
local trace_singles = trace_baseinit and trace_singles
local trace_alternatives = trace_baseinit and trace_alternatives
local trace_ligatures = trace_baseinit and trace_ligatures
- -- A chain of changes is handled in font-con which is clesner because
+ -- A chain of changes is handled in font-con which is cleaner because
-- we can have shared changes and such.
if not changed then
@@ -493,6 +504,9 @@ local function featuresinitializer(tfmdata,value)
local value = features[feature]
if value then
local validlookups, lookuplist = collectlookups(rawdata,feature,script,language)
+-- if not validlookups and not lookuplist and script == "math" then
+-- validlookups, lookuplist = collectlookups(rawdata,feature,"dflt","dflt")
+-- end
if not validlookups then
-- skip
elseif basesubstitutions and basesubstitutions[feature] then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-otr.lua b/Master/texmf-dist/tex/context/base/mkiv/font-otr.lua
index 531f665de72..1e6f94e455c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-otr.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-otr.lua
@@ -66,6 +66,7 @@ if not modules then modules = { } end modules ['font-otr'] = {
-- require("char-ini")
-- end
+local number = number
local next, type, tonumber, rawget = next, type, tonumber, rawget
local byte, lower, char, gsub = string.byte, string.lower, string.char, string.gsub
local fullstrip = string.fullstrip
@@ -682,15 +683,15 @@ local weights = {
}
local widths = {
- [1] = "ultracondensed",
- [2] = "extracondensed",
- [3] = "condensed",
- [4] = "semicondensed",
- [5] = "normal",
- [6] = "semiexpanded",
- [7] = "expanded",
- [8] = "extraexpanded",
- [9] = "ultraexpanded",
+ "ultracondensed",
+ "extracondensed",
+ "condensed",
+ "semicondensed",
+ "normal",
+ "semiexpanded",
+ "expanded",
+ "extraexpanded",
+ "ultraexpanded",
}
setmetatableindex(weights, function(t,k)
@@ -703,31 +704,31 @@ setmetatableindex(widths,function(t,k)
return "normal"
end)
-local panoseweights = {
- [ 0] = "normal",
- [ 1] = "normal",
- [ 2] = "verylight",
- [ 3] = "light",
- [ 4] = "thin",
- [ 5] = "book",
- [ 6] = "medium",
- [ 7] = "demi",
- [ 8] = "bold",
- [ 9] = "heavy",
- [10] = "black",
+local panoseweights = { [0] =
+ "normal",
+ "normal",
+ "verylight",
+ "light",
+ "thin",
+ "book",
+ "medium",
+ "demi",
+ "bold",
+ "heavy",
+ "black",
}
-local panosewidths = {
- [ 0] = "normal",
- [ 1] = "normal",
- [ 2] = "normal",
- [ 3] = "normal",
- [ 4] = "normal",
- [ 5] = "expanded",
- [ 6] = "condensed",
- [ 7] = "veryexpanded",
- [ 8] = "verycondensed",
- [ 9] = "monospaced",
+local panosewidths = { [0] =
+ "normal",
+ "normal",
+ "normal",
+ "normal",
+ "normal",
+ "expanded",
+ "condensed",
+ "veryexpanded",
+ "verycondensed",
+ "monospaced",
}
-- We implement a reader per table.
@@ -1189,6 +1190,9 @@ readers.hmtx = function(f,fontdata,specification)
-- if leftsidebearing ~= 0 then
-- glyph.lsb = leftsidebearing
-- end
+-- if leftsidebearing ~= 0 then
+-- glyph.lsb = leftsidebearing
+-- end
end
-- The next can happen in for instance a monospace font or in a cjk font
-- with fixed widths.
@@ -1250,7 +1254,7 @@ readers.post = function(f,fontdata,specification)
local version = readulong(f)
fontdata.postscript = {
version = version,
- italicangle = round(1000*readfixed(f))/1000,
+ italicangle = readfixed(f),
underlineposition = readfword(f),
underlinethickness = readfword(f),
monospaced = readulong(f),
@@ -1292,8 +1296,8 @@ readers.post = function(f,fontdata,specification)
if length > 0 then
glyphs[mapping].name = readstring(f,length)
else
- report("quit post name fetching at %a of %a: %s",i,maxnames,"overflow")
- break
+ -- report("quit post name fetching at %a of %a: %s",i,maxnames,"overflow")
+ -- break
end
end
end
@@ -1683,7 +1687,7 @@ end
function readers.cmap(f,fontdata,specification)
local tableoffset = gotodatatable(f,fontdata,"cmap",specification.glyphs)
if tableoffset then
- local version = readushort(f)
+ local version = readushort(f) -- check later versions
local noftables = readushort(f)
local records = { }
local unicodecid = false
@@ -1962,9 +1966,10 @@ local function getinfo(maindata,sub,platformnames,rawfamilynames,metricstoo,inst
weight = weight and lower(weight),
width = width and lower(width),
pfmweight = metrics.weightclass or 400, -- will become weightclass
- pfmwidth = metrics.widthclass or 5, -- will become widthclass
+ pfmwidth = metrics.widthclass or 5, -- will become widthclass
panosewidth = metrics.panosewidth,
panoseweight = metrics.panoseweight,
+ fstype = metrics.fstype or 0, -- embedding, subsetting and editing
italicangle = postscript.italicangle or 0,
units = fontheader.units or 0,
designsize = fontdata.designsize,
@@ -2424,25 +2429,29 @@ function readers.loadfont(filename,n,instance)
nofsubfonts = fontdata.subfonts and #fontdata.subfonts or nil,
},
resources = {
- -- filename = fontdata.filename,
- filename = filename,
- private = privateoffset,
- duplicates = fontdata.duplicates or { },
- features = fontdata.features or { }, -- we need to add these in the loader
- sublookups = fontdata.sublookups or { }, -- we need to add these in the loader
- marks = fontdata.marks or { }, -- we need to add these in the loader
- markclasses = fontdata.markclasses or { }, -- we need to add these in the loader
- marksets = fontdata.marksets or { }, -- we need to add these in the loader
- sequences = fontdata.sequences or { }, -- we need to add these in the loader
- variants = fontdata.variants, -- variant -> unicode -> glyph
- version = getname(fontdata,"version"),
- cidinfo = fontdata.cidinfo,
- mathconstants = fontdata.mathconstants,
- colorpalettes = fontdata.colorpalettes,
- svgshapes = fontdata.svgshapes,
- pngshapes = fontdata.pngshapes,
- variabledata = fontdata.variabledata,
- foundtables = fontdata.foundtables,
+ -- filename = fontdata.filename,
+ filename = filename,
+ private = privateoffset,
+ duplicates = fontdata.duplicates or { },
+ features = fontdata.features or { }, -- we need to add these in the loader
+ sublookups = fontdata.sublookups or { }, -- we need to add these in the loader
+ marks = fontdata.marks or { }, -- we need to add these in the loader
+ markclasses = fontdata.markclasses or { }, -- we need to add these in the loader
+ marksets = fontdata.marksets or { }, -- we need to add these in the loader
+ sequences = fontdata.sequences or { }, -- we need to add these in the loader
+ variants = fontdata.variants, -- variant -> unicode -> glyph
+ version = getname(fontdata,"version"),
+ cidinfo = fontdata.cidinfo,
+ mathconstants = fontdata.mathconstants,
+ colorpalettes = fontdata.colorpalettes,
+ colorpaintdata = fontdata.colorpaintdata,
+ colorpaintlist = fontdata.colorpaintlist,
+ colorlinesdata = fontdata.colorlinesdata,
+ coloraffinedata = fontdata.coloraffinedata,
+ svgshapes = fontdata.svgshapes,
+ pngshapes = fontdata.pngshapes,
+ variabledata = fontdata.variabledata,
+ foundtables = fontdata.foundtables,
},
}
end
@@ -2498,15 +2507,15 @@ function readers.getinfo(filename,specification) -- string, nil|number|table
end
end
-function readers.rehash(fontdata,hashmethod)
+function readers.rehash() -- fontdata,hashmethod
report("the %a helper is not yet implemented","rehash")
end
-function readers.checkhash(fontdata)
+function readers.checkhash() --fontdata
report("the %a helper is not yet implemented","checkhash")
end
-function readers.pack(fontdata,hashmethod)
+function readers.pack() -- fontdata,hashmethod
report("the %a helper is not yet implemented","pack")
end
@@ -2522,6 +2531,10 @@ function readers.compact(fontdata)
report("the %a helper is not yet implemented","compact")
end
+function readers.condense(fontdata)
+ report("the %a helper is not yet implemented","condense")
+end
+
-- plug in
local extenders = { }
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-ots.lua b/Master/texmf-dist/tex/context/base/mkiv/font-ots.lua
index 880bcb6d50a..6d7c5fb2568 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-ots.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-ots.lua
@@ -8,6 +8,11 @@ if not modules then modules = { } end modules ['font-ots'] = { -- sequences
}
--[[ldx--
+<p>I need to check the description at the microsoft site ... it has been improved
+so maybe there are some interesting details there. Most below is based on old and
+incomplete documentation and involved quite a bit of guesswork (checking with the
+abstract uniscribe of those days. But changing things is tricky!</p>
+
<p>This module is a bit more split up that I'd like but since we also want to test
with plain <l n='tex'/> it has to be so. This module is part of <l n='context'/>
and discussion about improvements and functionality mostly happens on the
@@ -163,13 +168,10 @@ local trace_testruns = false registertracker("otf.testruns", function
local forcediscretionaries = false
local forcepairadvance = false -- for testing
-directives.register("otf.forcediscretionaries",function(v)
- forcediscretionaries = v
-end)
+local repeatablemultiples = context or false
-directives.register("otf.forcepairadvance",function(v)
- forcepairadvance = v
-end)
+directives.register("otf.forcediscretionaries", function(v) forcediscretionaries = v end)
+directives.register("otf.forcepairadvance", function(v) forcepairadvance = v end)
local report_direct = logs.reporter("fonts","otf direct")
local report_subchain = logs.reporter("fonts","otf subchain")
@@ -195,7 +197,6 @@ local setboth = nuts.setboth
local getid = nuts.getid
local getstate = nuts.getstate
local getsubtype = nuts.getsubtype
-local setsubtype = nuts.setsubtype
local getchar = nuts.getchar
local setchar = nuts.setchar
local getdisc = nuts.getdisc
@@ -213,39 +214,37 @@ local getglyphdata = nuts.getglyphdata
-- their positions because some complex ligatures might need that. For the moment we
-- use an x_ prefix because for now generic follows the other approach.
-local copy_no_components = nuts.copy_no_components
-local copy_only_glyphs = nuts.copy_only_glyphs
-local count_components = nuts.count_components
-local set_components = nuts.set_components
-local get_components = nuts.get_components
-local flush_components = nuts.flush_components
+local components = nuts.components
+local copynocomponents = components.copynocomponents
+local copyonlyglyphs = components.copyonlyglyphs
+local countcomponents = components.count
+local setcomponents = components.set
+local getcomponents = components.get
+local flushcomponents = components.flush
---------------------------------------------------------------------------------------
local ischar = nuts.ischar
-local usesfont = nuts.uses_font
-
-local insert_node_after = nuts.insert_after
-local copy_node = nuts.copy
-local copy_node_list = nuts.copy_list
-local remove_node = nuts.remove
-local find_node_tail = nuts.tail
-local flush_node_list = nuts.flush_list
-local flush_node = nuts.flush_node
-local end_of_math = nuts.end_of_math
-local start_of_par = nuts.start_of_par
+local usesfont = nuts.usesfont
+
+local insertnodeafter = nuts.insertafter
+local copynode = nuts.copy
+local copynodelist = nuts.copylist
+local removenode = nuts.remove
+local findnodetail = nuts.tail
+local flushnodelist = nuts.flushlist
+local flushnode = nuts.flushnode
+local endofmath = nuts.endofmath
+
+local startofpar = nuts.startofpar
local setmetatable = setmetatable
local setmetatableindex = table.setmetatableindex
local nextnode = nuts.traversers.node
------ zwnj = 0x200C
------ zwj = 0x200D
-
local nodecodes = nodes.nodecodes
local glyphcodes = nodes.glyphcodes
-local disccodes = nodes.disccodes
local glyph_code = nodecodes.glyph
local glue_code = nodecodes.glue
@@ -257,8 +256,7 @@ local par_code = nodecodes.par
local lefttoright_code = nodes.dirvalues.lefttoright
local righttoleft_code = nodes.dirvalues.righttoleft
-local discretionarydisc_code = disccodes.discretionary
-local ligatureglyph_code = glyphcodes.ligature
+local discretionarydisc_code = nodes.disccodes.discretionary
local a_noligature = attributes.private("noligature")
@@ -317,13 +315,6 @@ local checkstep = (tracers and tracers.steppers.check) or function()
local registerstep = (tracers and tracers.steppers.register) or function() end
local registermessage = (tracers and tracers.steppers.message) or function() end
--- local function checkdisccontent(d)
--- local pre, post, replace = getdisc(d)
--- if pre then for n in traverse_id(glue_code,pre) do report("pre: %s",nodes.idstostring(pre)) break end end
--- if post then for n in traverse_id(glue_code,post) do report("pos: %s",nodes.idstostring(post)) break end end
--- if replace then for n in traverse_id(glue_code,replace) do report("rep: %s",nodes.idstostring(replace)) break end end
--- end
-
local function logprocess(...)
if trace_steps then
registermessage(...)
@@ -380,7 +371,7 @@ local function cref(dataset,sequence,index)
return "no valid dataset"
end
local merged = sequence.merged and "merged " or ""
- if index then
+ if index and index > 1 then
return formatters["feature %a, type %a, %schain lookup %a, index %a"](
dataset[4],sequence.type,merged,sequence.name,index)
else
@@ -423,12 +414,12 @@ local function flattendisk(head,disc)
local prev, next = getboth(disc)
local ishead = head == disc
setdisc(disc)
- flush_node(disc)
+ flushnode(disc)
if pre then
- flush_node_list(pre)
+ flushnodelist(pre)
end
if post then
- flush_node_list(post)
+ flushnodelist(post)
end
if ishead then
if replace then
@@ -458,7 +449,7 @@ end
local function appenddisc(disc,list)
local pre, post, replace, pretail, posttail, replacetail = getdisc(disc,true)
local posthead = list
- local replacehead = copy_node_list(list)
+ local replacehead = copynodelist(list)
if post then
setlink(posttail,posthead)
else
@@ -480,16 +471,15 @@ local function markstoligature(head,start,stop,char)
local next = getnext(stop)
setprev(start)
setnext(stop)
- local base = copy_no_components(start,copyinjection)
+ local base = copynocomponents(start,copyinjection)
if head == start then
head = base
end
resetinjection(base)
setchar(base,char)
- setsubtype(base,ligatureglyph_code)
- set_components(base,start)
+ setcomponents(base,start)
setlink(prev,base,next)
- flush_components(start)
+ flushcomponents(start)
return head, base
end
end
@@ -509,7 +499,7 @@ local no_right_ligature_code = 2
local no_left_kern_code = 4
local no_right_kern_code = 8
-local has_glyph_option = node.direct.has_glyph_option or function(n,c)
+local hasglyphoption = function(n,c)
if c == no_left_ligature_code or c == no_right_ligature_code then
return getattr(n,a_noligature) == 1
else
@@ -520,7 +510,7 @@ end
-- in lmtx we need to check the components and can be slightly more clever
local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfound,hasmarks) -- brr head
- if has_glyph_option(start,no_right_ligature_code) then
+ if hasglyphoption(start,no_right_ligature_code) then
return head, start
end
if start == stop and getchar(start) == char then
@@ -533,14 +523,13 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
local comp = start
setprev(start)
setnext(stop)
- local base = copy_no_components(start,copyinjection)
+ local base = copynocomponents(start,copyinjection)
if start == head then
head = base
end
resetinjection(base)
setchar(base,char)
- setsubtype(base,ligatureglyph_code)
- set_components(base,comp)
+ setcomponents(base,comp)
setlink(prev,base,next)
if not discfound then
local deletemarks = not skiphash or hasmarks
@@ -554,7 +543,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
local char = getchar(start)
if not marks[char] then
baseindex = baseindex + componentindex
- componentindex = count_components(start,marks)
+ componentindex = countcomponents(start,marks)
-- we can be more clever here: "not deletemarks or (skiphash and not skiphash[char])"
-- and such:
elseif not deletemarks then
@@ -563,9 +552,9 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
if trace_marks then
logwarning("%s: keep ligature mark %s, gets index %s",pref(dataset,sequence),gref(char),getligaindex(start))
end
- local n = copy_node(start)
+ local n = copynode(start)
copyinjection(n,start) -- is this ok ? we position later anyway
- head, current = insert_node_after(head,current,n) -- unlikely that mark has components
+ head, current = insertnodeafter(head,current,n) -- unlikely that mark has components
elseif trace_marks then
logwarning("%s: delete ligature mark %s",pref(dataset,sequence),gref(char))
end
@@ -590,7 +579,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
break
end
end
- flush_components(components)
+ flushcomponents(components)
else
-- discfound ... forget about marks .. probably no scripts that hyphenate and have marks
local discprev, discnext = getboth(discfound)
@@ -602,8 +591,8 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
if not replace then
-- looks like we never come here as it's not okay
local prev = getprev(base)
- -- local comp = get_components(base) -- already set
- local copied = copy_only_glyphs(comp)
+ -- local comp = getcomponents(base) -- already set
+ local copied = copyonlyglyphs(comp)
if pre then
setlink(discprev,pre)
else
@@ -620,7 +609,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
setlink(prev,discfound,next)
setboth(base)
-- here components have a pointer so we can't free it!
- set_components(base,copied)
+ setcomponents(base,copied)
replace = base
if forcediscretionaries then
setdisc(discfound,pre,post,replace,discretionarydisc_code)
@@ -637,32 +626,69 @@ end
local function multiple_glyphs(head,start,multiple,skiphash,what,stop) -- what to do with skiphash matches here
local nofmultiples = #multiple
if nofmultiples > 0 then
+ local first = start
resetinjection(start)
setchar(start,multiple[1])
if nofmultiples > 1 then
- local sn = getnext(start)
- for k=2,nofmultiples do
+ -- local sn = getnext(start)
+ for i=2,nofmultiples do
-- untested:
--
-- while ignoremarks and marks[getchar(sn)] then
-- local sn = getnext(sn)
-- end
- local n = copy_node(start) -- ignore components
+ local n = copynode(start) -- ignore components
resetinjection(n)
- setchar(n,multiple[k])
- insert_node_after(head,start,n)
+ setchar(n,multiple[i])
+ insertnodeafter(head,start,n)
start = n
end
- if what == true then
- -- we're ok
- elseif what > 1 then
- local m = multiple[nofmultiples]
- for i=2,what do
- local n = copy_node(start) -- ignore components
- resetinjection(n)
- setchar(n,m)
- insert_node_after(head,start,n)
- start = n
+ end
+ if what ~= true and repeatablemultiples then
+ -- This is just some experimental code; we might introduce gsub_extensible
+ -- some day instead. Beware: when we have a feature that mixes alternates and
+ -- multiples we need to make sure we don't handle the alternate string values
+ -- here.
+ local kind = type(what)
+ local m, f, l
+ if kind == "string" then
+ local what, n = string.match(what,"^repeat(.-)[:=](%d+)$")
+ if what == "middle" then
+ m = tonumber(n)
+ elseif what == "first" then
+ f = tonumber(n)
+ elseif what == "last" then
+ l = tonumber(n)
+ end
+ elseif kind == "table" then
+ -- won't happen because currently we don't split these values
+ m = what.middle
+ f = what.first
+ l = what.last
+ end
+ if f or m or l then
+ if m and m > 1 and nofmultiples == 3 then
+ local middle = getnext(first)
+ for i=2,m do
+ local n = copynode(middle) -- ignore components
+ resetinjection(n)
+ insertnodeafter(head,first,n)
+ end
+ end
+ if f and f > 1 then
+ for i=2,f do
+ local n = copynode(first) -- ignore components
+ resetinjection(n)
+ insertnodeafter(head,first,n)
+ end
+ end
+ if l and l > 1 then
+ for i=2,l do
+ local n = copynode(start) -- ignore components
+ resetinjection(n)
+ insertnodeafter(head,start,n)
+ start = n
+ end
end
end
end
@@ -768,7 +794,7 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
while current do
local char = ischar(current,currentfont)
if char then
- local lg = ligature[char]
+ local lg = not tonumber(ligature) and ligature[char]
if lg then
stop = current
ligature = lg
@@ -781,14 +807,14 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
end
end
if stop then
- local lig = ligature.ligature
- if lig then
+ local ligature = tonumber(ligature) or ligature.ligature
+ if ligature then
if trace_ligatures then
local stopchar = getchar(stop)
- head, start = markstoligature(head,start,stop,lig)
+ head, start = markstoligature(head,start,stop,ligature)
logprocess("%s: replacing %s upto %s by ligature %s case 1",pref(dataset,sequence),gref(startchar),gref(stopchar),gref(getchar(start)))
else
- head, start = markstoligature(head,start,stop,lig)
+ head, start = markstoligature(head,start,stop,ligature)
end
return head, start, true, false
else
@@ -804,7 +830,7 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
if skiphash and skiphash[char] then
current = getnext(current)
else
- local lg = ligature[char]
+ local lg = not tonumber(ligature) and ligature[char]
if lg then
if marks[char] then
hasmarks = true
@@ -838,20 +864,20 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
local match
if replace then
local char = ischar(replace,currentfont)
- if char and ligature[char] then
+ if char and (not tonumber(ligature) and ligature[char]) then
match = true
end
end
if not match and pre then
local char = ischar(pre,currentfont)
- if char and ligature[char] then
+ if char and (not tonumber(ligature) and ligature[char]) then
match = true
end
end
if not match and not pre or not replace then
local n = getnext(discfound)
local char = ischar(n,currentfont)
- if char and ligature[char] then
+ if char and (not tonumber(ligature) and ligature[char]) then
match = true
end
end
@@ -861,9 +887,9 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
local prev = getprev(start)
if stop then
setnext(stop)
- local copy = copy_node_list(start)
+ local copy = copynodelist(start)
local tail = stop -- was: getprev(stop) -- Kai: needs checking on your samples
- local liat = find_node_tail(copy)
+ local liat = findnodetail(copy)
if pre then
setlink(liat,pre)
end
@@ -874,7 +900,7 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
replace = start
else
setnext(start)
- local copy = copy_node(start)
+ local copy = copynode(start)
if pre then
setlink(copy,pre)
end
@@ -895,24 +921,26 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
return head, start, true, true
end
end
- local lig = ligature.ligature
- if lig then
+ local ligature = tonumber(ligature) or ligature.ligature
+ if ligature then
if stop then
if trace_ligatures then
local stopchar = getchar(stop)
- -- head, start = toligature(head,start,stop,lig,dataset,sequence,skiphash,discfound,hasmarks)
- head, start = toligature(head,start,stop,lig,dataset,sequence,skiphash,false,hasmarks)
- logprocess("%s: replacing %s upto %s by ligature %s case 2",pref(dataset,sequence),gref(startchar),gref(stopchar),gref(lig))
+ -- head, start = toligature(head,start,stop,ligature,dataset,sequence,skiphash,discfound,hasmarks)
+ head, start = toligature(head,start,stop,ligature,dataset,sequence,skiphash,false,hasmarks)
+ logprocess("%s: replacing %s upto %s by ligature %s case 2",pref(dataset,sequence),gref(startchar),gref(stopchar),gref(ligature))
+ -- we can have a rare case of multiple disc in a lig but that makes no sense language wise but if really
+ -- needed we could backtrack if we're in a disc node
else
- -- head, start = toligature(head,start,stop,lig,dataset,sequence,skiphash,discfound,hasmarks)
- head, start = toligature(head,start,stop,lig,dataset,sequence,skiphash,false,hasmarks)
+ -- head, start = toligature(head,start,stop,ligature,dataset,sequence,skiphash,discfound,hasmarks)
+ head, start = toligature(head,start,stop,ligature,dataset,sequence,skiphash,false,hasmarks)
end
else
-- weird but happens (in some arabic font)
resetinjection(start)
- setchar(start,lig)
+ setchar(start,ligature)
if trace_ligatures then
- logprocess("%s: replacing %s by (no real) ligature %s case 3",pref(dataset,sequence),gref(startchar),gref(lig))
+ logprocess("%s: replacing %s by (no real) ligature %s case 3",pref(dataset,sequence),gref(startchar),gref(ligature))
end
end
return head, start, true, false
@@ -924,7 +952,7 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
end
function handlers.gpos_single(head,start,dataset,sequence,kerns,rlmode,skiphash,step,injection)
- if has_glyph_option(start,no_right_kern_code) then
+ if hasglyphoption(start,no_right_kern_code) then
return head, start, false
else
local startchar = getchar(start)
@@ -945,7 +973,7 @@ function handlers.gpos_single(head,start,dataset,sequence,kerns,rlmode,skiphash,
end
function handlers.gpos_pair(head,start,dataset,sequence,kerns,rlmode,skiphash,step,injection)
- if has_glyph_option(start,no_right_kern_code) then
+ if hasglyphoption(start,no_right_kern_code) then
return head, start, false
else
local snext = getnext(start)
@@ -1055,7 +1083,7 @@ function handlers.gpos_mark2base(head,start,dataset,sequence,markanchors,rlmode,
end
return head, start, true
elseif trace_bugs then
- -- onetimemessage(currentfont,basechar,"no base anchors",report_fonts)
+ -- onetimemessage(currentfont,basechar,"no base anchors")
logwarning("%s: mark %s is not anchored to %s",pref(dataset,sequence),gref(markchar),gref(basechar))
end
elseif trace_bugs then
@@ -1121,7 +1149,7 @@ function handlers.gpos_mark2ligature(head,start,dataset,sequence,markanchors,rlm
end
elseif trace_bugs then
-- logwarning("%s: char %s is missing in font",pref(dataset,sequence),gref(basechar))
- onetimemessage(currentfont,basechar,"no base anchors",report_fonts)
+ onetimemessage(currentfont,basechar,"no base anchors")
end
elseif trace_bugs then
logwarning("%s: prev node is no char, case %i",pref(dataset,sequence),1)
@@ -1286,7 +1314,7 @@ as less as needed but that would also make the code even more messy.</p>
-- To be done (example needed): what if > 1 steps
--- this is messy: do we need this disc checking also in alternaties?
+-- this is messy: do we need this disc checking also in alternates?
local function reportzerosteps(dataset,sequence)
logwarning("%s: no steps",cref(dataset,sequence))
@@ -1322,7 +1350,7 @@ function chainprocs.gsub_remove(head,start,stop,dataset,sequence,currentlookup,r
if trace_chains then
logprocess("%s: removing character %s",cref(dataset,sequence,chainindex),gref(getchar(start)))
end
- head, start = remove_node(head,start,true)
+ head, start = removenode(head,start,true)
return head, getprev(start), true
end
@@ -1489,7 +1517,7 @@ function chainprocs.gsub_ligature(head,start,stop,dataset,sequence,currentlookup
current = getnext(current)
-- end
else
- local lg = ligatures[schar]
+ local lg = not tonumber(ligatures) and ligatures[schar]
if lg then
ligatures = lg
last = current
@@ -1508,7 +1536,7 @@ function chainprocs.gsub_ligature(head,start,stop,dataset,sequence,currentlookup
end
end
end
- local ligature = ligatures.ligature
+ local ligature = tonumber(ligatures) or ligatures.ligature
if ligature then
if chainindex then
stop = last
@@ -1536,7 +1564,7 @@ end
function chainprocs.gpos_single(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash,chainindex)
-- we actually should check no_left_kern_code with next
- if not has_glyph_option(start,no_right_kern_code) then
+ if not hasglyphoption(start,no_right_kern_code) then
local mapping = currentlookup.mapping
if mapping == nil then
mapping = getmapping(dataset,sequence,currentlookup)
@@ -1566,7 +1594,7 @@ end
function chainprocs.gpos_pair(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash,chainindex) -- todo: injections ?
-- we actually should check no_left_kern_code with next
- if not has_glyph_option(start,no_right_kern_code) then
+ if not hasglyphoption(start,no_right_kern_code) then
local mapping = currentlookup.mapping
if mapping == nil then
mapping = getmapping(dataset,sequence,currentlookup)
@@ -1861,7 +1889,7 @@ function chainprocs.gpos_cursive(head,start,stop,dataset,sequence,currentlookup,
end
end
elseif trace_bugs then
- onetimemessage(currentfont,startchar,"no entry anchors",report_fonts)
+ onetimemessage(currentfont,startchar,"no entry anchors")
end
break
end
@@ -1917,7 +1945,7 @@ do if not userkern then -- generic
local setkern = nuts.setkern -- not injections.setkern
userkern = function(k)
- local n = copy_node(thekern)
+ local n = copynode(thekern)
setkern(n,k)
return n
end
@@ -1934,13 +1962,13 @@ local function checked(head)
if next then
setlink(kern,next)
end
- flush_node(current)
+ flushnode(current)
head = kern
current = next
else
local prev, next = getboth(current)
setlink(prev,kern,next)
- flush_node(current)
+ flushnode(current)
current = next
end
else
@@ -1959,12 +1987,11 @@ end
local noflags = { false, false, false, false }
-local function chainrun(head,start,last,dataset,sequence,rlmode,skiphash,ck)
+local function chainrun(head,start,last,dataset,sequence,rlmode,skiphash,ck,where)
local size = ck[5] - ck[4] + 1
local chainlookups = ck[6]
local done = false
-
-- current match
if chainlookups then
-- Lookups can be like { 1, false, 3 } or { false, 2 } or basically anything and
@@ -1975,21 +2002,30 @@ local function chainrun(head,start,last,dataset,sequence,rlmode,skiphash,ck)
-- if nofchainlookups > size then
-- -- bad rules
-- end
-
local chainlookup = chainlookups[1]
- for j=1,#chainlookup do
- local chainstep = chainlookup[j]
- local chainkind = chainstep.type
- local chainproc = chainprocs[chainkind]
- if chainproc then
- local ok
- head, start, ok = chainproc(head,start,last,dataset,sequence,chainstep,rlmode,skiphash)
- if ok then
- done = true
+ if chainlookup then
+ for j=1,#chainlookup do
+ local chainstep = chainlookup[j]
+ if chainstep then
+ local chainkind = chainstep.type
+ local chainproc = chainprocs[chainkind]
+ if chainproc then
+ local ok
+ -- HH: chainindex 1 added here (for KAI to check too), there are weird ligatures e.g.
+ -- char + mark -> char where mark has to disappear
+ head, start, ok = chainproc(head,start,last,dataset,sequence,chainstep,rlmode,skiphash,1)
+ if ok then
+ done = true
+ end
+ else
+ logprocess("%s: %s is not yet supported (1)",cref(dataset,sequence),chainkind)
+ end
+ else
+ logprocess("%s: has an issue (1)",cref(dataset,sequence))
end
- else
- logprocess("%s: %s is not yet supported (1)",cref(dataset,sequence),chainkind)
end
+ else
+ -- whatever
end
else
@@ -2030,23 +2066,28 @@ local function chainrun(head,start,last,dataset,sequence,rlmode,skiphash,ck)
if chainlookup then
for j=1,#chainlookup do
local chainstep = chainlookup[j]
- local chainkind = chainstep.type
- local chainproc = chainprocs[chainkind]
- if chainproc then
- local ok, n
- head, start, ok, n = chainproc(head,start,last,dataset,sequence,chainstep,rlmode,skiphash,i)
- -- messy since last can be changed !
- if ok then
- done = true
- if n and n > 1 and i + n > nofchainlookups then
- -- this is a safeguard, we just ignore the rest of the lookups
- i = size -- prevents an advance
- break
+ if chainstep then
+ local chainkind = chainstep.type
+ local chainproc = chainprocs[chainkind]
+ if chainproc then
+ local ok, n
+ head, start, ok, n = chainproc(head,start,last,dataset,sequence,chainstep,rlmode,skiphash,i)
+ -- messy since last can be changed !
+ if ok then
+ done = true
+ if n and n > 1 and i + n > nofchainlookups then
+ -- this is a safeguard, we just ignore the rest of the lookups
+ i = size -- prevents an advance
+ break
+ end
end
+ else
+ -- actually an error
+ logprocess("%s: %s is not yet supported (2)",cref(dataset,sequence),chainkind)
end
else
-- actually an error
- logprocess("%s: %s is not yet supported (2)",cref(dataset,sequence),chainkind)
+ logprocess("%s: has an issue (2)",cref(dataset,sequence))
end
end
else
@@ -2074,7 +2115,7 @@ local function chainrun(head,start,last,dataset,sequence,rlmode,skiphash,ck)
else
done = true
if trace_contexts then
- logprocess("%s: skipping match",cref(dataset,sequence))
+ logprocess("%s: skipping match @ %i",cref(dataset,sequence),where)
end
end
end
@@ -2104,6 +2145,8 @@ local function chaindisk(head,start,dataset,sequence,rlmode,skiphash,ck)
local last = start
local prev = getprev(start)
local hasglue = false
+ local useddisc = nil -- new 2022-09-25
+ local usedstart = start -- new 2022-09-25
-- fishy: so we can overflow and then go on in the sweep?
-- todo : id can also be glue_code as we checked spaces
@@ -2174,7 +2217,7 @@ local function chaindisk(head,start,dataset,sequence,rlmode,skiphash,ck)
tail = prev
setprev(current,sweepnode)
else
- tail = find_node_tail(head)
+ tail = findnodetail(head)
end
setnext(sweepnode,current)
setprev(head)
@@ -2265,15 +2308,14 @@ local function chaindisk(head,start,dataset,sequence,rlmode,skiphash,ck)
end
end
end
+
local done = false
if lookaheaddisc then
-
local cf = start
local cl = getprev(lookaheaddisc)
local cprev = getprev(start)
local insertedmarks = 0
-
while cprev do
local char = ischar(cf,currentfont)
if char and marks[char] then
@@ -2292,13 +2334,13 @@ local function chaindisk(head,start,dataset,sequence,rlmode,skiphash,ck)
head = lookaheaddisc
end
local pre, post, replace = getdisc(lookaheaddisc)
- local new = copy_node_list(cf) -- br, how often does that happen
+ local new = copynodelist(cf) -- br, how often does that happen
local cnew = new
if pre then
- setlink(find_node_tail(cf),pre)
+ setlink(findnodetail(cf),pre)
end
if replace then
- local tail = find_node_tail(new)
+ local tail = findnodetail(new)
setlink(tail,replace)
end
for i=1,insertedmarks do
@@ -2312,14 +2354,14 @@ local function chaindisk(head,start,dataset,sequence,rlmode,skiphash,ck)
end
if not notmatchpre[lookaheaddisc] then
local ok = false
- cf, start, ok = chainrun(cf,start,cl,dataset,sequence,rlmode,skiphash,ck)
+ cf, start, ok = chainrun(cf,start,cl,dataset,sequence,rlmode,skiphash,ck,1)
if ok then
done = true
end
end
if not notmatchreplace[lookaheaddisc] then
local ok = false
- new, cnew, ok = chainrun(new,cnew,clast,dataset,sequence,rlmode,skiphash,ck)
+ new, cnew, ok = chainrun(new,cnew,clast,dataset,sequence,rlmode,skiphash,ck,2)
if ok then
done = true
end
@@ -2330,16 +2372,14 @@ local function chaindisk(head,start,dataset,sequence,rlmode,skiphash,ck)
setdisc(lookaheaddisc,cf,post,new)
end
start = getprev(lookaheaddisc)
+ useddisc = lookaheaddisc -- new 2022-09-25
sweephead[cf] = getnext(clast) or false
sweephead[new] = getnext(cl) or false
-
elseif backtrackdisc then
-
local cf = getnext(backtrackdisc)
local cl = start
local cnext = getnext(start)
local insertedmarks = 0
-
while cnext do
local char = ischar(cnext,currentfont)
if char and marks[char] then
@@ -2354,8 +2394,8 @@ local function chaindisk(head,start,dataset,sequence,rlmode,skiphash,ck)
setprev(cf)
setnext(cl)
local pre, post, replace, pretail, posttail, replacetail = getdisc(backtrackdisc,true)
- local new = copy_node_list(cf)
- local cnew = find_node_tail(new)
+ local new = copynodelist(cf)
+ local cnew = findnodetail(new)
for i=1,insertedmarks do
cnew = getprev(cnew)
end
@@ -2365,14 +2405,14 @@ local function chaindisk(head,start,dataset,sequence,rlmode,skiphash,ck)
end
if not notmatchpost[backtrackdisc] then
local ok = false
- cf, start, ok = chainrun(cf,start,last,dataset,sequence,rlmode,skiphash,ck)
+ cf, start, ok = chainrun(cf,start,last,dataset,sequence,rlmode,skiphash,ck,3)
if ok then
done = true
end
end
if not notmatchreplace[backtrackdisc] then
local ok = false
- new, cnew, ok = chainrun(new,cnew,clast,dataset,sequence,rlmode,skiphash,ck)
+ new, cnew, ok = chainrun(new,cnew,clast,dataset,sequence,rlmode,skiphash,ck,4)
if ok then
done = true
end
@@ -2393,33 +2433,57 @@ local function chaindisk(head,start,dataset,sequence,rlmode,skiphash,ck)
setdisc(backtrackdisc,pre,post,replace)
end
start = getprev(backtrackdisc)
+ useddisc = backtrackdisc -- new 2022-09-25
sweephead[post] = getnext(clast) or false
sweephead[replace] = getnext(last) or false
-
else
local ok = false
- head, start, ok = chainrun(head,start,last,dataset,sequence,rlmode,skiphash,ck)
+ head, start, ok = chainrun(head,start,last,dataset,sequence,rlmode,skiphash,ck,5)
if ok then
done = true
end
end
-
- return head, start, done
+ if useddisc and start ~= usedstart then -- make this option per font -- new 2022-09-25
+ start = getnext(start) -- new 2022-09-25
+ end -- new 2022-09-25
+ return head, start, done, useddisc -- new 2022-09-25
end
-local function chaintrac(head,start,dataset,sequence,rlmode,skiphash,ck,match,discseen,sweepnode)
- local rule = ck[1]
- local lookuptype = ck[8] or ck[2]
- local nofseq = #ck[3]
- local first = ck[4]
- local last = ck[5]
- local char = getchar(start)
- logwarning("%s: rule %s %s at char %s for (%s,%s,%s) chars, lookuptype %a, %sdisc seen, %ssweeping",
- cref(dataset,sequence),rule,match and "matches" or "nomatch",
- gref(char),first-1,last-first+1,nofseq-last,lookuptype,
- discseen and "" or "no ", sweepnode and "" or "not ")
+local chaintrac do
+
+ local level = 0
+ local last = { }
+
+ chaintrac = function(head,start,dataset,sequence,rlmode,skiphash,ck,match,discseen,sweepnode)
+ if dataset then
+ level = level + 1
+ last[level] = start
+ local rule = ck[1]
+ local lookuptype = ck[8] or ck[2]
+ local nofseq = #ck[3] -- ck[3].n
+ local first = ck[4]
+ local last = ck[5]
+ local char = getchar(start)
+ logwarning("+ %i : %s: rule %s %s at char %s for (%s,%s,%s) chars, lookuptype %a, %sdisc seen, %ssweeping",
+ level,cref(dataset,sequence),rule,match and "matches" or "nomatch",
+ gref(char),first-1,last-first+1,nofseq-last,lookuptype,
+ discseen and "" or "no ", sweepnode and "" or "not ")
+ else
+ -- (start,done)
+ local what = start and "done" or "continue"
+ local where = head == last[level] and "same" or "different"
+ local char = getchar(head)
+ if char then
+ logwarning("- %i : %s at char %s, %s node",level,what,gref(char),where)
+ else
+ logwarning("- %i : %s, %s node",level,what,where)
+ end
+ level = level - 1
+ end
+ end
+
end
-- The next one is quite optimized but still somewhat slow, fonts like ebgaramond
@@ -2433,6 +2497,9 @@ end
-- the previous disc .. such be it (<before><disc><current=fl><after> with only f done)
local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,skiphash)
+ if not contexts then
+ return head, start, false
+ end
-- optimizing for rlmode gains nothing
local sweepnode = sweepnode
local sweeptype = sweeptype
@@ -2473,160 +2540,291 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s
for k=1,nofcontexts do -- does this disc mess work well with n > 1
- local ck = contexts[k]
- local seq = ck[3]
- local f = ck[4] -- first current
+ local ck = contexts[k]
+ local seq = ck[3]
+ local f = ck[4] -- first current
+ local last = start
if not startchar or not seq[f][startchar] then
-- report("no hit in %a at %i of %i contexts",sequence.type,k,nofcontexts)
goto next
end
- local s = seq.n -- or #seq
- local l = ck[5] -- last current
- local current = start
- local last = start
-
+ local s = seq.n -- or #seq
if s == 1 then
- goto next
- end
+ -- bit weird case: why use a chain, but it is a hit
+ else
+ local l = ck[5] -- last current
+ local current = start
+ -- local last = start
- -- current match
+ -- current match
- if l > f then
- -- before/current/after | before/current | current/after
- local discfound -- = nil
- local n = f + 1
- last = startnext -- the second in current (first already matched)
- while n <= l do
- if postreplace and not last then
- last = getnext(sweepnode)
- sweeptype = nil
- end
- if last then
- local char, id = ischar(last,currentfont)
- if char then
- if skiphash and skiphash[char] then
- skipped = true
- if trace_skips then
- show_skip(dataset,sequence,char,ck,classes[char])
- end
- last = getnext(last)
- elseif seq[n][char] then
- if n < l then
+ if l > f then
+ -- before/current/after | before/current | current/after
+ local discfound -- = nil
+ local n = f + 1
+ last = startnext -- the second in current (first already matched)
+ while n <= l do
+ if postreplace and not last then
+ last = getnext(sweepnode)
+ sweeptype = nil
+ end
+ if last then
+ local char, id = ischar(last,currentfont)
+ if char then
+ if skiphash and skiphash[char] then
+ skipped = true
+ if trace_skips then
+ show_skip(dataset,sequence,char,ck,classes[char])
+ end
last = getnext(last)
- end
- n = n + 1
- elseif discfound then
- notmatchreplace[discfound] = true
- if notmatchpre[discfound] then
- goto next
+ elseif seq[n][char] then
+ if n < l then
+ last = getnext(last)
+ end
+ n = n + 1
+ elseif discfound then
+ notmatchreplace[discfound] = true
+ if notmatchpre[discfound] then
+ goto next
+ else
+ break
+ end
else
- break
- end
- else
- goto next
- end
- elseif char == false then
- if discfound then
- notmatchreplace[discfound] = true
- if notmatchpre[discfound] then
goto next
+ end
+ elseif char == false then
+ if discfound then
+ notmatchreplace[discfound] = true
+ if notmatchpre[discfound] then
+ goto next
+ else
+ break
+ end
else
- break
+ goto next
end
- else
- goto next
- end
- elseif id == disc_code then
- -- elseif id == disc_code and (not discs or discs[last]) then
- discseen = true
- discfound = last
- notmatchpre[last] = nil
- notmatchpost[last] = true
- notmatchreplace[last] = nil
- local pre, post, replace = getdisc(last)
- if pre then
- local n = n
- while pre do
- if seq[n][getchar(pre)] then
- n = n + 1
- if n > l then
+ elseif id == disc_code then
+ -- elseif id == disc_code and (not discs or discs[last]) then
+ discseen = true
+ discfound = last
+ notmatchpre[last] = nil
+ notmatchpost[last] = true
+ notmatchreplace[last] = nil
+ local pre, post, replace = getdisc(last)
+ if pre then
+ local n = n
+ while pre do
+ if seq[n][getchar(pre)] then
+ n = n + 1
+ if n > l then
+ break
+ end
+ pre = getnext(pre)
+ else
+ notmatchpre[last] = true
break
end
- pre = getnext(pre)
- else
+ end
+ if n <= l then
notmatchpre[last] = true
- break
end
- end
- if n <= l then
+ else
notmatchpre[last] = true
end
+ if replace then
+ -- so far we never entered this branch
+ while replace do
+ if seq[n][getchar(replace)] then
+ n = n + 1
+ if n > l then
+ break
+ end
+ replace = getnext(replace)
+ else
+ notmatchreplace[last] = true
+ if notmatchpre[last] then
+ goto next
+ else
+ break
+ end
+ end
+ end
+ -- why here again
+ if notmatchpre[last] then
+ goto next
+ end
+ end
+ -- maybe only if match
+ last = getnext(last)
else
- notmatchpre[last] = true
+ goto next
end
- if replace then
- -- so far we never entered this branch
- while replace do
- if seq[n][getchar(replace)] then
- n = n + 1
- if n > l then
- break
+ else
+ goto next
+ end
+ end
+ end
+
+ -- before
+
+ if f > 1 then
+ -- if startprev then -- new 2022-09-25
+ local prev = startprev
+ if prereplace and prev == checkdisc then
+ prev = getprev(sweepnode)
+ end
+ if prev then
+ local discfound -- = nil
+ local n = f - 1
+ while n >= 1 do
+ if prev then
+ local char, id = ischar(prev,currentfont)
+ if char then
+ if skiphash and skiphash[char] then
+ skipped = true
+ if trace_skips then
+ show_skip(dataset,sequence,char,ck,classes[char])
+ end
+ prev = getprev(prev)
+ elseif seq[n][char] then
+ if n > 1 then
+ prev = getprev(prev)
+ end
+ n = n - 1
+ elseif discfound then
+ notmatchreplace[discfound] = true
+ if notmatchpost[discfound] then
+ goto next
+ else
+ break
+ end
+ else
+ goto next
end
- replace = getnext(replace)
- else
- notmatchreplace[last] = true
- if notmatchpre[last] then
+ elseif char == false then
+ if discfound then
+ notmatchreplace[discfound] = true
+ if notmatchpost[discfound] then
+ goto next
+ end
+ else
goto next
+ end
+ break
+ elseif id == disc_code then
+ -- elseif id == disc_code and (not discs or discs[prev]) then
+ -- the special case: f i where i becomes dottless i ..
+ discseen = true
+ discfound = prev
+ notmatchpre[prev] = true
+ notmatchpost[prev] = nil
+ notmatchreplace[prev] = nil
+ local pre, post, replace, pretail, posttail, replacetail = getdisc(prev,true)
+ -- weird test: needs checking
+ if pre ~= start and post ~= start and replace ~= start then
+ if post then
+ local n = n
+ while posttail do
+ if seq[n][getchar(posttail)] then
+ n = n - 1
+ if posttail == post or n < 1 then
+ break
+ else
+ posttail = getprev(posttail)
+ end
+ else
+ notmatchpost[prev] = true
+ break
+ end
+ end
+ if n >= 1 then
+ notmatchpost[prev] = true
+ end
+ else
+ notmatchpost[prev] = true
+ end
+ if replace then
+ -- we seldom enter this branch (e.g. on brill efficient)
+ while replacetail do
+ if seq[n][getchar(replacetail)] then
+ n = n - 1
+ if replacetail == replace or n < 1 then
+ break
+ else
+ replacetail = getprev(replacetail)
+ end
+ else
+ notmatchreplace[prev] = true
+ if notmatchpost[prev] then
+ goto next
+ else
+ break
+ end
+ end
+ end
+ else
+ -- notmatchreplace[prev] = true -- not according to Kai
+ end
+ end
+ prev = getprev(prev)
+ -- elseif id == glue_code and seq[n][32] and isspace(prev,threshold,id) then
+ -- elseif seq[n][32] and spaces[prev] then
+ -- n = n - 1
+ -- prev = getprev(prev)
+ elseif id == glue_code then
+ local sn = seq[n]
+ if (sn[32] and spaces[prev]) or sn[0xFFFC] then
+ n = n - 1
+ prev = getprev(prev)
else
- break
+ goto next
end
+ elseif seq[n][0xFFFC] then
+ n = n - 1
+ prev = getprev(prev)
+ else
+ goto next
end
- end
- -- why here again
- if notmatchpre[last] then
+ else
goto next
end
end
- -- maybe only if match
- last = getnext(last)
else
goto next
end
- else
- goto next
- end
+ -- else -- new 2022-09-25
+ -- goto next -- new 2022-09-25
+ -- end -- new 2022-09-25
end
- end
- -- before
+ -- after
- if f > 1 then
- if startprev then
- local prev = startprev
- if prereplace and prev == checkdisc then
- prev = getprev(sweepnode)
+ if s > l then
+ local current = last and getnext(last)
+ if not current and postreplace then
+ current = getnext(sweepnode)
end
- if prev then
+ if current then
local discfound -- = nil
- local n = f - 1
- while n >= 1 do
- if prev then
- local char, id = ischar(prev,currentfont)
+ local n = l + 1
+ while n <= s do
+ if current then
+ local char, id = ischar(current,currentfont)
if char then
if skiphash and skiphash[char] then
skipped = true
if trace_skips then
show_skip(dataset,sequence,char,ck,classes[char])
end
- prev = getprev(prev)
+ current = getnext(current) -- was absent
elseif seq[n][char] then
- if n > 1 then
- prev = getprev(prev)
+ if n < s then -- new test
+ current = getnext(current) -- was absent
end
- n = n - 1
+ n = n + 1
elseif discfound then
notmatchreplace[discfound] = true
- if notmatchpost[discfound] then
+ if notmatchpre[discfound] then
goto next
else
break
@@ -2637,237 +2835,108 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s
elseif char == false then
if discfound then
notmatchreplace[discfound] = true
- if notmatchpost[discfound] then
+ if notmatchpre[discfound] then
goto next
+ else
+ break
end
else
goto next
end
- break
elseif id == disc_code then
- -- elseif id == disc_code and (not discs or discs[prev]) then
- -- the special case: f i where i becomes dottless i ..
- discseen = true
- discfound = prev
- notmatchpre[prev] = true
- notmatchpost[prev] = nil
- notmatchreplace[prev] = nil
- local pre, post, replace, pretail, posttail, replacetail = getdisc(prev,true)
- -- weird test: needs checking
- if pre ~= start and post ~= start and replace ~= start then
- if post then
- local n = n
- while posttail do
- if seq[n][getchar(posttail)] then
- n = n - 1
- if posttail == post or n < 1 then
- break
- else
- posttail = getprev(posttail)
- end
- else
- notmatchpost[prev] = true
+ -- elseif id == disc_code and (not discs or discs[current]) then
+ discseen = true
+ discfound = current
+ notmatchpre[current] = nil
+ notmatchpost[current] = true
+ notmatchreplace[current] = nil
+ local pre, post, replace = getdisc(current)
+ if pre then
+ local n = n
+ while pre do
+ if seq[n][getchar(pre)] then
+ n = n + 1
+ if n > s then
break
+ else
+ pre = getnext(pre)
end
+ else
+ notmatchpre[current] = true
+ break
end
- if n >= 1 then
- notmatchpost[prev] = true
- end
- else
- notmatchpost[prev] = true
end
- if replace then
- -- we seldom enter this branch (e.g. on brill efficient)
- while replacetail do
- if seq[n][getchar(replacetail)] then
- n = n - 1
- if replacetail == replace or n < 1 then
- break
- else
- replacetail = getprev(replacetail)
- end
+ if n <= s then
+ notmatchpre[current] = true
+ end
+ else
+ notmatchpre[current] = true
+ end
+ if replace then
+ -- so far we never entered this branch
+ while replace do
+ if seq[n][getchar(replace)] then
+ n = n + 1
+ if n > s then
+ break
else
- notmatchreplace[prev] = true
- if notmatchpost[prev] then
- goto next
- else
- break
- end
+ replace = getnext(replace)
+ end
+ else
+ notmatchreplace[current] = true
+ if notmatchpre[current] then
+ goto next
+ else
+ break
end
end
- else
- -- notmatchreplace[prev] = true -- not according to Kai
end
+ else
+ -- notmatchreplace[current] = true -- not according to Kai
end
- prev = getprev(prev)
- -- elseif id == glue_code and seq[n][32] and isspace(prev,threshold,id) then
- -- elseif seq[n][32] and spaces[prev] then
- -- n = n - 1
- -- prev = getprev(prev)
+ current = getnext(current)
elseif id == glue_code then
local sn = seq[n]
- if (sn[32] and spaces[prev]) or sn[0xFFFC] then
- n = n - 1
- prev = getprev(prev)
+ if (sn[32] and spaces[current]) or sn[0xFFFC] then
+ n = n + 1
+ current = getnext(current)
else
goto next
end
elseif seq[n][0xFFFC] then
- n = n - 1
- prev = getprev(prev)
- else
- goto next
- end
- else
- goto next
- end
- end
- else
- goto next
- end
- else
- goto next
- end
- end
-
- -- after
-
- if s > l then
- local current = last and getnext(last)
- if not current and postreplace then
- current = getnext(sweepnode)
- end
- if current then
- local discfound -- = nil
- local n = l + 1
- while n <= s do
- if current then
- local char, id = ischar(current,currentfont)
- if char then
- if skiphash and skiphash[char] then
- skipped = true
- if trace_skips then
- show_skip(dataset,sequence,char,ck,classes[char])
- end
- current = getnext(current) -- was absent
- elseif seq[n][char] then
- if n < s then -- new test
- current = getnext(current) -- was absent
- end
- n = n + 1
- elseif discfound then
- notmatchreplace[discfound] = true
- if notmatchpre[discfound] then
- goto next
- else
- break
- end
- else
- goto next
- end
- elseif char == false then
- if discfound then
- notmatchreplace[discfound] = true
- if notmatchpre[discfound] then
- goto next
- else
- break
- end
- else
- goto next
- end
- elseif id == disc_code then
- -- elseif id == disc_code and (not discs or discs[current]) then
- discseen = true
- discfound = current
- notmatchpre[current] = nil
- notmatchpost[current] = true
- notmatchreplace[current] = nil
- local pre, post, replace = getdisc(current)
- if pre then
- local n = n
- while pre do
- if seq[n][getchar(pre)] then
- n = n + 1
- if n > s then
- break
- else
- pre = getnext(pre)
- end
- else
- notmatchpre[current] = true
- break
- end
- end
- if n <= s then
- notmatchpre[current] = true
- end
- else
- notmatchpre[current] = true
- end
- if replace then
- -- so far we never entered this branch
- while replace do
- if seq[n][getchar(replace)] then
- n = n + 1
- if n > s then
- break
- else
- replace = getnext(replace)
- end
- else
- notmatchreplace[current] = true
- if notmatchpre[current] then
- goto next
- else
- break
- end
- end
- end
- else
- -- notmatchreplace[current] = true -- not according to Kai
- end
- current = getnext(current)
- elseif id == glue_code then
- local sn = seq[n]
- if (sn[32] and spaces[current]) or sn[0xFFFC] then
n = n + 1
current = getnext(current)
else
goto next
end
- elseif seq[n][0xFFFC] then
- n = n + 1
- current = getnext(current)
else
goto next
end
- else
- goto next
end
+ else
+ goto next
end
- else
- goto next
end
end
-
if trace_contexts then
chaintrac(head,start,dataset,sequence,rlmode,skipped and skiphash,ck,true,discseen,sweepnode)
end
if discseen or sweepnode then
+ -- When we process a disc we can collapse and therefore we backtrack one node (start) and
+ -- reprocess. This is needed because there might be more in the collapsed list.
head, start, done = chaindisk(head,start,dataset,sequence,rlmode,skipped and skiphash,ck)
else
- head, start, done = chainrun(head,start,last,dataset,sequence,rlmode,skipped and skiphash,ck)
+ head, start, done = chainrun(head,start,last,dataset,sequence,rlmode,skipped and skiphash,ck,6)
+ end
+ if trace_contexts then
+ chaintrac(start,done)
end
if done then
break
-- else
-- next context
end
- ::next::
- -- if trace_chains then
- -- chaintrac(head,start,dataset,sequence,rlmode,skipped and skiphash,ck,false,discseen,sweepnode)
- -- end
+ ::next::
end
if discseen then
notmatchpre = { }
@@ -2886,21 +2955,46 @@ handlers.gsub_reversecontextchain = handle_contextchain
handlers.gpos_contextchain = handle_contextchain
handlers.gpos_context = handle_contextchain
--- this needs testing
+-- local function chained_contextchain(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash)
+-- local steps = currentlookup.steps
+-- local nofsteps = currentlookup.nofsteps
+-- if nofsteps > 1 then
+-- reportmoresteps(dataset,sequence)
+-- end
+-- -- probably wrong
+-- local l = steps[1].coverage[getchar(start)]
+-- if l then
+-- return handle_contextchain(head,start,dataset,sequence,l,rlmode,skiphash)
+-- else
+-- return head, start, false
+-- end
+-- end
+
+-- new 2022-09-25
local function chained_contextchain(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash)
local steps = currentlookup.steps
local nofsteps = currentlookup.nofsteps
- if nofsteps > 1 then
- reportmoresteps(dataset,sequence)
- end
- -- probably wrong
- local l = steps[1].coverage[getchar(start)]
- if l then
- return handle_contextchain(head,start,dataset,sequence,l,rlmode,skiphash)
+ local char = getchar(start)
+ if nofsteps == 1 then
+ local s = steps[1]
+ local l = s.coverage[char]
+ if l then
+ return handle_contextchain(head,start,dataset,sequence,l,rlmode,skiphash)
+ end
else
- return head, start, false
+ for i=1,nofsteps do
+ local s = steps[i]
+ local l = s.coverage[char]
+ if l then
+ local h, s, d = handle_contextchain(head,start,dataset,sequence,l,rlmode,skiphash)
+ if d then
+ return h, s, d
+ end
+ end
+ end
end
+ return head, start, false
end
chainprocs.gsub_context = chained_contextchain
@@ -3039,7 +3133,7 @@ do -- overcome local limit
end
-- Functions like kernrun, comprun etc evolved over time and in the end look rather
--- complex. It's a bit of a compromis between extensive copying and creating subruns.
+-- complex. It's a bit of a compromise between extensive copying and creating subruns.
-- The logic has been improved a lot by Kai and Ivo who use complex fonts which
-- really helped to identify border cases on the one hand and get insight in the diverse
-- ways fonts implement features (not always that consistent and efficient). At the same
@@ -3146,7 +3240,8 @@ local function kernrun(disc,k_run,font,attr,...)
if done and trace_testruns then
report_disc("done",disc)
end
- return nextstart, done
+ -- return nextstart, done
+ return nextstart
end
-- fonts like ebgaramond do ligatures this way (less efficient than e.g. dejavu which
@@ -3199,12 +3294,19 @@ local function comprun(disc,c_run,...) -- vararg faster than the whole list
setdisc(disc,pre,post,replace)
end
--
- return getnext(disc), renewed
+ -- return getnext(disc), renewed
+ return getnext(disc)
end
-- if we can hyphenate in a lig then unlikely a lig so we
-- could have a option here to ignore lig
+local test_flatten_start = 2 -- must start at 2 according to Kai
+
+directives.register("otf.testrun.forceflatten", function(v)
+ test_flatten_start = v and 1 or 2
+end)
+
local function testrun(disc,t_run,c_run,...)
if trace_testruns then
report_disc("test",disc)
@@ -3233,7 +3335,7 @@ local function testrun(disc,t_run,c_run,...)
local d = d_replace > d_post and d_replace or d_post
local head = getnext(disc) -- is: next
local tail = head
- for i=2,d do -- must start at 2 according to Kai
+ for i=test_flatten_start,d do
local nx = getnext(tail)
local id = getid(nx)
if id == disc_code then
@@ -3248,7 +3350,7 @@ local function testrun(disc,t_run,c_run,...)
next = getnext(tail)
setnext(tail)
setprev(head)
- local new = copy_node_list(head)
+ local new = copynodelist(head)
if posttail then
setlink(posttail,head)
else
@@ -3321,7 +3423,8 @@ local function testrun(disc,t_run,c_run,...)
end
end
-- next can have changed (copied list)
- return getnext(disc), renewed
+ -- return getnext(disc), renewed
+ return getnext(disc)
end
-- 1{2{\oldstyle\discretionary{3}{4}{5}}6}7\par
@@ -3414,7 +3517,7 @@ local function t_run_single(start,stop,font,attr,lookupcache)
while s do
local char = ischar(s,font)
if char then
- local lg = lookupmatch[char]
+ local lg = not tonumber(lookupmatch) and lookupmatch[char]
if lg then
if sstop then
d = 1
@@ -3444,7 +3547,7 @@ local function t_run_single(start,stop,font,attr,lookupcache)
break
end
end
- if l and l.ligature then -- so we test for ligature
+ if l and (tonumber(l) or l.ligature) then -- so we test for ligature
lastd = d
end
-- why not: if not l then break elseif l.ligature then return d end
@@ -3585,7 +3688,7 @@ local function t_run_multiple(start,stop,font,attr,steps,nofsteps)
while s do
local char = ischar(s)
if char then
- local lg = lookupmatch[char]
+ local lg = not tonumber(lookupmatch) and lookupmatch[char]
if lg then
if sstop then
d = 1
@@ -3615,7 +3718,7 @@ local function t_run_multiple(start,stop,font,attr,steps,nofsteps)
break
end
end
- if l and l.ligature then
+ if l and (tonumber(l) or l.ligature) then
lastd = d
end
end
@@ -3795,7 +3898,7 @@ do
local initialrl = 0
- if getid(head) == par_code and start_of_par(head) then
+ if getid(head) == par_code and startofpar(head) then
initialrl = pardirstate(head)
elseif direction == righttoleft_code then
initialrl = -1
@@ -3844,7 +3947,7 @@ do
-- the before and after lists in the loader. But first I need to see a font that uses multiple
-- matches.
--
- local start = find_node_tail(head)
+ local start = findnodetail(head)
local rlmode = 0 -- how important is this .. do we need to check for dir?
local merged = steps.merged
while start do
@@ -3930,26 +4033,22 @@ do
start = getnext(start)
elseif id == disc_code then
if not discs or discs[start] == true then
- local ok
if gpossing then
- start, ok = kernrun(start,k_run_single, font,attr,lookupcache,step,dataset,sequence,rlmode,skiphash,handler)
+ start = kernrun(start,k_run_single, font,attr,lookupcache,step,dataset,sequence,rlmode,skiphash,handler)
elseif forcetestrun then
- start, ok = testrun(start,t_run_single,c_run_single,font,attr,lookupcache,step,dataset,sequence,rlmode,skiphash,handler)
+ start = testrun(start,t_run_single,c_run_single,font,attr,lookupcache,step,dataset,sequence,rlmode,skiphash,handler)
else
- start, ok = comprun(start,c_run_single, font,attr,lookupcache,step,dataset,sequence,rlmode,skiphash,handler)
+ start = comprun(start,c_run_single, font,attr,lookupcache,step,dataset,sequence,rlmode,skiphash,handler)
end
- -- if ok then
- -- done = true
- -- end
else
start = getnext(start)
end
elseif id == math_code then
- start = getnext(end_of_math(start))
+ start = getnext(endofmath(start))
elseif id == dir_code then
topstack, rlmode = txtdirstate(start,dirstack,topstack,rlparmode)
start = getnext(start)
- -- elseif id == par_code and start_of_par(start) then
+ -- elseif id == par_code and startofpar(start) then
-- rlparmode, rlmode = pardirstate(start)
-- start = getnext(start)
else
@@ -4014,26 +4113,22 @@ do
start = getnext(start)
elseif id == disc_code then
if not discs or discs[start] == true then
- local ok
if gpossing then
- start, ok = kernrun(start,k_run_multiple, font,attr,steps,nofsteps,dataset,sequence,rlmode,skiphash,handler)
+ start = kernrun(start,k_run_multiple, font,attr,steps,nofsteps,dataset,sequence,rlmode,skiphash,handler)
elseif forcetestrun then
- start, ok = testrun(start,t_run_multiple,c_run_multiple,font,attr,steps,nofsteps,dataset,sequence,rlmode,skiphash,handler)
+ start = testrun(start,t_run_multiple,c_run_multiple,font,attr,steps,nofsteps,dataset,sequence,rlmode,skiphash,handler)
else
- start, ok = comprun(start,c_run_multiple, font,attr,steps,nofsteps,dataset,sequence,rlmode,skiphash,handler)
+ start = comprun(start,c_run_multiple, font,attr,steps,nofsteps,dataset,sequence,rlmode,skiphash,handler)
end
- -- if ok then
- -- done = true
- -- end
else
start = getnext(start)
end
elseif id == math_code then
- start = getnext(end_of_math(start))
+ start = getnext(endofmath(start))
elseif id == dir_code then
topstack, rlmode = txtdirstate(start,dirstack,topstack,rlparmode)
start = getnext(start)
- -- elseif id == par_code and start_of_par(start) then
+ -- elseif id == par_code and startofpar(start) then
-- rlparmode, rlmode = pardirstate(start)
-- start = getnext(start)
else
@@ -4140,13 +4235,13 @@ do
-- a different font|state or glue (happens often)
start = getnext(start)
elseif id == math_code then
- start = getnext(end_of_math(start))
+ start = getnext(endofmath(start))
elseif id == dir_code then
topstack, rlmode = txtdirstate(start,dirstack,topstack,rlparmode)
start = getnext(start)
- -- elseif id == par_code and start_of_par(start) then
+ -- elseif id == par_code and startofpar(start) then
-- rlparmode, rlmode = pardirstate(start)
- -- start = getnext(start)
+ -- start = nxt
else
start = getnext(start)
end
@@ -4161,49 +4256,60 @@ end
-- so far
-local plugins = { }
-otf.plugins = plugins
+do
-local report = logs.reporter("fonts")
+ local plugins = { }
+ otf.plugins = plugins
-function otf.registerplugin(name,f)
- if type(name) == "string" and type(f) == "function" then
- plugins[name] = { name, f }
- report()
- report("plugin %a has been loaded, please be aware of possible side effects",name)
- report()
- if logs.pushtarget then
- logs.pushtarget("log")
- end
- report("Plugins are not officially supported unless stated otherwise. This is because")
- report("they bypass the regular font handling and therefore some features in ConTeXt")
- report("(especially those related to fonts) might not work as expected or might not work")
- report("at all. Some plugins are for testing and development only and might change")
- report("whenever we feel the need for it.")
- report()
- if logs.poptarget then
- logs.poptarget()
+ local report = logs.reporter("fonts")
+ local warned = false
+ local okay = { text = true }
+
+ function otf.registerplugin(name,f)
+ if type(name) == "string" and type(f) == "function" then
+ plugins[name] = { name, f }
+ if okay[name] then
+ -- no warning (e.g. the diagnostic text plugin)
+ else
+ report("plugin %a has been loaded, please be aware of possible side effects",name)
+ if not warned then
+ if logs.pushtarget then
+ logs.pushtarget("log")
+ end
+ report("Plugins are not officially supported unless stated otherwise. This is because")
+ report("they bypass the regular font handling and therefore some features in ConTeXt")
+ report("(especially those related to fonts) might not work as expected or might not work")
+ report("at all. Some plugins are for testing and development only and might change")
+ report("whenever we feel the need for it.")
+ report()
+ if logs.poptarget then
+ logs.poptarget()
+ end
+ warned = true
+ end
+ end
end
end
-end
-function otf.plugininitializer(tfmdata,value)
- if type(value) == "string" then
- tfmdata.shared.plugin = plugins[value]
+ function otf.plugininitializer(tfmdata,value)
+ if type(value) == "string" then
+ tfmdata.shared.plugin = plugins[value]
+ end
end
-end
-function otf.pluginprocessor(head,font,attr,direction) -- n
- local s = fontdata[font].shared
- local p = s and s.plugin
- if p then
- if trace_plugins then
- report_process("applying plugin %a",p[1])
+ function otf.pluginprocessor(head,font,dynamic,direction) -- n
+ local s = fontdata[font].shared
+ local p = s and s.plugin
+ if p then
+ if trace_plugins then
+ report_process("applying plugin %a",p[1])
+ end
+ return p[2](head,font,dynamic,direction)
+ else
+ return head, false
end
- return p[2](head,font,attr,direction)
- else
- return head, false
end
+
end
function otf.featuresinitializer(tfmdata,value)
@@ -4225,8 +4331,8 @@ registerotffeature {
}
}
--- Moved here (up) a bit. This doesn't really belong in generic so it will
--- move to a context module some day.
+-- Moved here (up) a bit. This doesn't really belong in generic so it will move to a
+-- context module some day.
local function markinitializer(tfmdata,value)
local properties = tfmdata.properties
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-ott.lua b/Master/texmf-dist/tex/context/base/mkiv/font-ott.lua
index f4d7e05a137..74fd583758a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-ott.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-ott.lua
@@ -52,16 +52,20 @@ local scripts = allocate {
["cari"] = "carian",
["cham"] = "cham",
["cher"] = "cherokee",
+ ["chrs"] = "chorasmian",
["copt"] = "coptic",
+ ["cpmn"] = "cypro-minoan",
["cprt"] = "cypriot syllabary",
["cyrl"] = "cyrillic",
["dev2"] = "devanagari variant 2",
["deva"] = "devanagari",
+ ["diak"] = "dives akuru",
["dogr"] = "dogra",
["dsrt"] = "deseret",
["dupl"] = "duployan",
["egyp"] = "egyptian heiroglyphs",
["elba"] = "elbasan",
+ ["elym"] = "elymaic",
["ethi"] = "ethiopic",
["geor"] = "georgian",
["gjr2"] = "gujarati variant 2",
@@ -81,6 +85,7 @@ local scripts = allocate {
["hebr"] = "hebrew",
["hluw"] = "anatolian hieroglyphs",
["hmng"] = "pahawh hmong",
+ ["hmnp"] = "nyiakeng puachue hmong",
["hung"] = "old hungarian",
["ital"] = "old italic",
["jamo"] = "hangul jamo",
@@ -90,6 +95,7 @@ local scripts = allocate {
["khar"] = "kharosthi",
["khmr"] = "khmer",
["khoj"] = "khojki",
+ ["kits"] = "khitan small script",
["knd2"] = "kannada variant 2",
["knda"] = "kannada",
["kthi"] = "kaithi",
@@ -123,6 +129,7 @@ local scripts = allocate {
["musc"] = "musical symbols",
["mym2"] = "myanmar variant 2",
["mymr"] = "myanmar",
+ ["nand"] = "nandinagari",
["narb"] = "old north arabian",
["nbat"] = "nabataean",
["newa"] = "newa",
@@ -132,9 +139,10 @@ local scripts = allocate {
["olck"] = "ol chiki",
["orkh"] = "old turkic and orkhon runic",
["ory2"] = "odia variant 2",
- ["orya"] = "oriya",
+ ["orya"] = "odia",
["osge"] = "osage",
["osma"] = "osmanya",
+ ["ougr"] = "old uyghur",
["palm"] = "palmyrene",
["pauc"] = "pau cin hau",
["perm"] = "old permic",
@@ -166,7 +174,7 @@ local scripts = allocate {
["tagb"] = "tagbanwa",
["takr"] = "takri",
["tale"] = "tai le",
- ["talu"] = "tai lu",
+ ["talu"] = "new tai lue",
["taml"] = "tamil",
["tang"] = "tangut",
["tavt"] = "tai viet",
@@ -178,12 +186,16 @@ local scripts = allocate {
["thai"] = "thai",
["tibt"] = "tibetan",
["tirh"] = "tirhuta",
+ ["tnsa"] = "tangsa",
["tml2"] = "tamil variant 2",
+ ["toto"] = "toto",
["ugar"] = "ugaritic cuneiform",
["vai" ] = "vai",
["wara"] = "warang citi",
+ ["wcho"] = "wancho",
["xpeo"] = "old persian cuneiform",
["xsux"] = "sumero-akkadian cuneiform",
+ ["yezi"] = "yezidi",
["yi" ] = "yi",
["zanb"] = "zanabazar square",
}
@@ -199,6 +211,7 @@ local languages = allocate {
["agw" ] = "agaw",
["aio" ] = "aiton",
["aka" ] = "akan",
+ ["akb" ] = "batak angkola",
["als" ] = "alsatian",
["alt" ] = "altai",
["amh" ] = "amharic",
@@ -211,6 +224,7 @@ local languages = allocate {
["asm" ] = "assamese",
["ast" ] = "asturian",
["ath" ] = "athapaskan",
+ ["avn" ] = "avatime",
["avr" ] = "avar",
["awa" ] = "awadhi",
["aym" ] = "aymara",
@@ -256,8 +270,12 @@ local languages = allocate {
["brx" ] = "bodo",
["bsh" ] = "bashkir",
["bsk" ] = "burushaski",
+ ["bta" ] = "batak alas kluet",
+ ["btd" ] = "batak dairi (pakpak)",
["bti" ] = "beti",
+ ["btm" ] = "batak mandailing",
["bts" ] = "batak simalungun",
+ ["btx" ] = "batak karo",
["bug" ] = "bugis",
["byv" ] = "medumba",
["cak" ] = "kaqchikel",
@@ -292,14 +310,16 @@ local languages = allocate {
["csl" ] = "church slavonic",
["csy" ] = "czech",
["ctg" ] = "chittagonian",
+ ["ctt" ] = "wayanad chetti",
["cuk" ] = "san blas kuna",
+ ["dag" ] = "dagbani",
["dan" ] = "danish",
["dar" ] = "dargwa",
["dax" ] = "dayi",
["dcr" ] = "woods cree",
["deu" ] = "german",
- ["dgo" ] = "dogri",
- ["dgr" ] = "dogri",
+ ["dgo" ] = "dogri (individual language)",
+ ["dgr" ] = "dogri (macro language)",
["dhg" ] = "dhangu",
["dhv" ] = "divehi (dhivehi, maldivian)",
["diq" ] = "dimli",
@@ -371,13 +391,16 @@ local languages = allocate {
["guj" ] = "gujarati",
["guz" ] = "gusii",
["hai" ] = "haitian (haitian creole)",
+ ["hai0"] = "haida",
["hal" ] = "halam",
["har" ] = "harauti",
["hau" ] = "hausa",
["haw" ] = "hawaiian",
["hay" ] = "haya",
["haz" ] = "hazaragi",
+ ["hmz" ] = "hmong shuat",
["hbn" ] = "hammer-banna",
+ ["hei" ] = "heiltsuk",
["her" ] = "herero",
["hil" ] = "hiligaynon",
["hin" ] = "hindi",
@@ -402,10 +425,12 @@ local languages = allocate {
["ind" ] = "indonesian",
["ing" ] = "ingush",
["inu" ] = "inuktitut",
+ ["inuk"] = "nunavik inuktitut",
["ipk" ] = "inupiat",
["ipph"] = "phonetic transcription—ipa conventions",
["iri" ] = "irish",
["irt" ] = "irish traditional",
+ ["uri" ] = "irula",
["isl" ] = "icelandic",
["ism" ] = "inari sami",
["ita" ] = "italian",
@@ -425,6 +450,7 @@ local languages = allocate {
["kan" ] = "kannada",
["kar" ] = "karachay",
["kat" ] = "georgian",
+ ["kaw" ] = "kawi (old javanese)",
["kaz" ] = "kazakh",
["kde" ] = "makonde",
["kea" ] = "kabuverdianu (crioulo)",
@@ -482,6 +508,7 @@ local languages = allocate {
["kur" ] = "kurdish",
["kuu" ] = "kurukh",
["kuy" ] = "kuy",
+ ["kwk" ] = "kwakʼwala",
["kyk" ] = "koryak",
["kyu" ] = "western kayah",
["lad" ] = "ladin",
@@ -493,6 +520,7 @@ local languages = allocate {
["laz" ] = "laz",
["lcr" ] = "l-cree",
["ldk" ] = "ladakhi",
+ ["lef" ] = "lelemi",
["lez" ] = "lezgi",
["lij" ] = "ligurian",
["lim" ] = "limburgish",
@@ -505,6 +533,7 @@ local languages = allocate {
["lmo" ] = "lombard",
["lmw" ] = "lomwe",
["lom" ] = "loma",
+ ["lpo" ] = "lipo",
["lrc" ] = "luri",
["lsb" ] = "lower sorbian",
["lsm" ] = "lule sami",
@@ -521,7 +550,7 @@ local languages = allocate {
["mah" ] = "marshallese",
["maj" ] = "majang",
["mak" ] = "makhuwa",
- ["mal" ] = "malayalam reformed",
+ ["mal" ] = "malayalam",
["mam" ] = "mam",
["man" ] = "mansi",
["map" ] = "mapudungun",
@@ -556,6 +585,7 @@ local languages = allocate {
["mok" ] = "moksha",
["mol" ] = "moldavian",
["mon" ] = "mon",
+ ["mnw" ] = "thailand mon",
["mor" ] = "moroccan",
["mos" ] = "mossi",
["mri" ] = "maori",
@@ -594,7 +624,7 @@ local languages = allocate {
["nor" ] = "norwegian",
["nov" ] = "novial",
["nsm" ] = "northern sami",
- ["nso" ] = "sotho, northern",
+ ["nso" ] = "northern sotho",
["nta" ] = "northern tai",
["nto" ] = "esperanto",
["nym" ] = "nyamwezi",
@@ -642,6 +672,7 @@ local languages = allocate {
["rbu" ] = "russian buriat",
["rcr" ] = "r-cree",
["rej" ] = "rejang",
+ ["rhg" ] = "rohingya",
["ria" ] = "riang",
["rif" ] = "tarifit",
["rit" ] = "ritarungo",
@@ -666,6 +697,7 @@ local languages = allocate {
["scs" ] = "north slavey",
["sek" ] = "sekota",
["sel" ] = "selkup",
+ ["sfm" ] = "small flowery miao",
["sga" ] = "old irish",
["sgo" ] = "sango",
["sgs" ] = "samogitian",
@@ -687,7 +719,7 @@ local languages = allocate {
["snk" ] = "soninke",
["sog" ] = "sodo gurage",
["sop" ] = "songe",
- ["sot" ] = "sotho, southern",
+ ["sot" ] = "southern sotho",
["sqi" ] = "albanian",
["srb" ] = "serbian",
["srd" ] = "sardinian",
@@ -728,7 +760,9 @@ local languages = allocate {
["tht" ] = "tahitian",
["tib" ] = "tibetan",
["tiv" ] = "tiv",
+ ["tj;" ] = "tai laing",
["tkm" ] = "turkmen",
+ ["tli" ] = "tlingit",
["tmh" ] = "tamashek",
["tmn" ] = "temne",
["tna" ] = "tswana",
@@ -742,7 +776,7 @@ local languages = allocate {
["tsj" ] = "tshangla",
["tua" ] = "turoyo aramaic",
["tul" ] = "tulu",
- ["tum" ] = "tulu",
+ ["tum" ] = "tumbuka",
["tuv" ] = "tuvin",
["tvl" ] = "tuvalu",
["twi" ] = "twi",
@@ -764,6 +798,7 @@ local languages = allocate {
["wa" ] = "wa",
["wag" ] = "wagdi",
["war" ] = "waray-waray",
+ ["wci" ] = "waci gbe",
["wcr" ] = "west-cree",
["wel" ] = "welsh",
["wlf" ] = "wolof",
@@ -775,17 +810,23 @@ local languages = allocate {
["xkf" ] = "khengkha",
["xog" ] = "soga",
["xpe" ] = "kpelle (liberia)",
+ ["xub" ] = "bette kuruma",
+ ["xuj" ] = "jennu kuruma",
["yak" ] = "sakha",
["yao" ] = "yao",
["yap" ] = "yapese",
["yba" ] = "yoruba",
["ycr" ] = "y-cree",
+ ["ygp" ] = "gepo",
["yic" ] = "yi classic",
["yim" ] = "yi modern",
+ ["yna" ] = "aluo",
+ ["ywq" ] = "wuding-luquan",
["zea" ] = "zealandic",
["zgh" ] = "standard morrocan tamazigh",
["zha" ] = "zhuang",
["zhh" ] = "chinese, hong kong sar",
+ ["zho" ] = "chinese traditional, macao",
["zhp" ] = "chinese phonetic",
["zhs" ] = "chinese simplified",
["zht" ] = "chinese traditional",
@@ -794,7 +835,6 @@ local languages = allocate {
["zza" ] = "zazaki",
}
-
local features = allocate {
["aalt"] = "access all alternates",
["abvf"] = "above-base forms",
@@ -811,6 +851,7 @@ local features = allocate {
["case"] = "case-sensitive forms",
["ccmp"] = "glyph composition/decomposition",
["cfar"] = "conjunct form after ro",
+ ["chws"] = "contextual half-width spacing",
["cjct"] = "conjunct forms",
["clig"] = "contextual ligatures",
["cpct"] = "centered cjk punctuation",
@@ -821,13 +862,13 @@ local features = allocate {
["dist"] = "distances",
["dlig"] = "discretionary ligatures",
["dnom"] = "denominators",
- ["dtls"] = "dotless forms", -- math
+ ["dtls"] = "dotless forms", -- math
["expt"] = "expert forms",
["falt"] = "final glyph alternates",
["fin2"] = "terminal forms #2",
["fin3"] = "terminal forms #3",
["fina"] = "terminal forms",
- ["flac"] = "flattened accents over capitals", -- math
+ ["flac"] = "flattened accents over capitals", -- math
["frac"] = "fractions",
["fwid"] = "full width",
["half"] = "half forms",
@@ -836,7 +877,7 @@ local features = allocate {
["hist"] = "historical forms",
["hkna"] = "horizontal kana alternates",
["hlig"] = "historical ligatures",
- ["hngl"] = "hangul",
+ ["hngl"] = "hangul", -- depricated
["hojo"] = "hojo kanji forms",
["hwid"] = "half width",
["init"] = "initial forms",
@@ -866,7 +907,7 @@ local features = allocate {
["nukt"] = "nukta forms",
["numr"] = "numerators",
["onum"] = "old style figures",
- ["opbd"] = "optical bounds",
+ ["opbd"] = "optical bounds", -- funny, this is obsolete (too hard?) (and was recomended always true)
["ordn"] = "ordinals",
["ornm"] = "ornaments",
["palt"] = "proportional alternate width",
@@ -887,8 +928,8 @@ local features = allocate {
["rtbd"] = "right bounds",
["rtla"] = "right-to-left alternates",
["rtlm"] = "right to left mirrored forms",
- ["rvrn"] = "required variation alternates",
["ruby"] = "ruby notation forms",
+ ["rvrn"] = "required variation alternates",
["salt"] = "stylistic alternates",
["sinf"] = "scientific inferiors",
["size"] = "optical size", -- now stat table
@@ -928,6 +969,7 @@ local features = allocate {
["unic"] = "unicase",
["valt"] = "alternate vertical metrics",
["vatu"] = "vattu variants",
+ ["vchw"] = "vertical contextual half-width spacing",
["vert"] = "vertical writing",
["vhal"] = "alternate vertical half metrics",
["vjmo"] = "vowel jamo forms",
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-oup.lua b/Master/texmf-dist/tex/context/base/mkiv/font-oup.lua
index 2c49bc993f9..198e62bee40 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-oup.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-oup.lua
@@ -10,6 +10,7 @@ local next, type = next, type
local P, R, S = lpeg.P, lpeg.R, lpeg.S
local lpegmatch = lpeg.match
local insert, remove, copy, unpack = table.insert, table.remove, table.copy, table.unpack
+local find = string.find
local formatters = string.formatters
local sortedkeys = table.sortedkeys
@@ -37,13 +38,16 @@ local f_index = formatters["I%05X"]
local f_character_y = formatters["%C"]
local f_character_n = formatters["[ %C ]"]
-local check_duplicates = true -- can become an option (pseudo feature) / aways needed anyway
-local check_soft_hyphen = true -- can become an option (pseudo feature) / needed for tagging
+local check_duplicates = true -- can become an option (pseudo feature) / always needed anyway
+local check_soft_hyphen = context -- only in context
directives.register("otf.checksofthyphen",function(v)
- check_soft_hyphen = v
+ check_soft_hyphen = v -- only for testing
end)
+-- After (!) the unicodes have been resolved we compact ligature tables so before that happens
+-- we don't need to check for numbers.
+
local function replaced(list,index,replacement)
if type(list) == "number" then
return replacement
@@ -453,31 +457,48 @@ local function copyduplicates(fontdata)
local resources = fontdata.resources
local duplicates = resources.duplicates
if check_soft_hyphen then
- -- ebgaramond has a zero width empty soft hyphen
- -- antykwatorunsks lacks a soft hyphen
- local ds = descriptions[0xAD]
- if not ds or ds.width == 0 then
- if ds then
+ -- ebgaramond has a zero width empty soft hyphen
+ -- antykwatorunska lacks a soft hyphen
+ -- lucidaot has a halfwidth soft hyphen
+
+ -- local dh = descriptions[0x2D]
+ -- if dh then
+ -- descriptions[0xAD] = nil
+ -- local d = duplicates[0x2D]
+ -- if d then
+ -- d[#d+1] = { [0xAD] = true }
+ -- else
+ -- duplicates[0x2D] = { [0xAD] = true }
+ -- end
+ -- end
+
+ local dh = descriptions[0x2D]
+ if dh then
+ local ds = descriptions[0xAD]
+ if not ds or ds.width ~= dh.width then
descriptions[0xAD] = nil
- if trace_unicodes then
- report_unicodes("patching soft hyphen")
+ if ds then
+ if trace_unicodes then
+ report_unicodes("patching soft hyphen")
+ end
+ else
+ if trace_unicodes then
+ report_unicodes("adding soft hyphen")
+ end
end
- else
- if trace_unicodes then
- report_unicodes("adding soft hyphen")
+ if not duplicates then
+ duplicates = { }
+ resources.duplicates = duplicates
+ end
+ local d = duplicates[0x2D]
+ if d then
+ d[0xAD] = true
+ else
+ duplicates[0x2D] = { [0xAD] = true }
end
- end
- if not duplicates then
- duplicates = { }
- resources.duplicates = duplicates
- end
- local dh = duplicates[0x2D]
- if dh then
- dh[#dh+1] = { [0xAD] = true }
- else
- duplicates[0x2D] = { [0xAD] = true }
end
end
+
end
if duplicates then
for u, d in next, duplicates do
@@ -759,6 +780,7 @@ local function unifyglyphs(fontdata,usenames)
local resources = fontdata.resources
local zero = glyphs[0]
local zerocode = zero.unicode
+ local nofglyphs = #glyphs
if not zerocode then
zerocode = private
zero.unicode = zerocode
@@ -775,7 +797,7 @@ local function unifyglyphs(fontdata,usenames)
--
if names then
-- seldom uses, we don't issue message ... this branch might even go away
- for index=1,#glyphs do
+ for index=1,nofglyphs do
local glyph = glyphs[index]
local unicode = glyph.unicode -- this is the primary one
if not unicode then
@@ -808,7 +830,7 @@ local function unifyglyphs(fontdata,usenames)
descriptions[unicode] = glyph
end
elseif trace_unicodes then
- for index=1,#glyphs do
+ for index=1,nofglyphs do
local glyph = glyphs[index]
local unicode = glyph.unicode -- this is the primary one
if not unicode then
@@ -849,7 +871,7 @@ local function unifyglyphs(fontdata,usenames)
descriptions[unicode] = glyph
end
else
- for index=1,#glyphs do
+ for index=1,nofglyphs do
local glyph = glyphs[index]
local unicode = glyph.unicode -- this is the primary one
if not unicode then
@@ -876,33 +898,49 @@ local function unifyglyphs(fontdata,usenames)
end
end
--
- for index=1,#glyphs do
- local math = glyphs[index].math
- if math then
- local list = math.vparts
- if list then
- for i=1,#list do local l = list[i] l.glyph = indices[l.glyph] end
- end
- local list = math.hparts
- if list then
- for i=1,#list do local l = list[i] l.glyph = indices[l.glyph] end
- end
- local list = math.vvariants
- if list then
- -- for i=1,#list do local l = list[i] l.glyph = indices[l.glyph] end
- for i=1,#list do list[i] = indices[list[i]] end
+ if LUATEXENGINE == "luametatex" then
+ for index=1,nofglyphs do
+ local math = glyphs[index].math
+ if math then
+ local list = math.parts
+ if list then
+ for i=1,#list do local l = list[i] l.glyph = indices[l.glyph] end
+ end
+ local list = math.variants
+ if list then
+ for i=1,#list do list[i] = indices[list[i]] end
+ end
end
- local list = math.hvariants
- if list then
- -- for i=1,#list do local l = list[i] l.glyph = indices[l.glyph] end
- for i=1,#list do list[i] = indices[list[i]] end
+ end
+ else
+ for index=1,nofglyphs do
+ local math = glyphs[index].math
+ if math then
+ local list = math.vparts
+ if list then
+ for i=1,#list do local l = list[i] l.glyph = indices[l.glyph] end
+ end
+ local list = math.hparts
+ if list then
+ for i=1,#list do local l = list[i] l.glyph = indices[l.glyph] end
+ end
+ local list = math.vvariants
+ if list then
+ -- for i=1,#list do local l = list[i] l.glyph = indices[l.glyph] end
+ for i=1,#list do list[i] = indices[list[i]] end
+ end
+ local list = math.hvariants
+ if list then
+ -- for i=1,#list do local l = list[i] l.glyph = indices[l.glyph] end
+ for i=1,#list do list[i] = indices[list[i]] end
+ end
end
end
end
--
local colorpalettes = resources.colorpalettes
if colorpalettes then
- for index=1,#glyphs do
+ for index=1,nofglyphs do
local colors = glyphs[index].colors
if colors then
for i=1,#colors do
@@ -918,19 +956,22 @@ local function unifyglyphs(fontdata,usenames)
fontdata.names = names
fontdata.descriptions = descriptions
fontdata.hashmethod = hashmethod
+ fontdata.nofglyphs = nofglyphs
--
return indices, names
end
-local p_crappyname do
+local stripredundant do
local p_hex = R("af","AF","09")
local p_digit = R("09")
local p_done = S("._-")^0 + P(-1)
+ -- local p_style = P(".ss") * p_digit * p_digit * P(-1)
+ local p_style = P(".")
local p_alpha = R("az","AZ")
local p_ALPHA = R("AZ")
- p_crappyname = (
+ local p_crappyname = (
-- (P("uni") + P("UNI") + P("Uni") + P("U") + P("u"))
lpeg.utfchartabletopattern({ "uni", "u" },true)
* S("Xx_")^0
@@ -958,56 +999,182 @@ local p_crappyname do
* P(1)^1
) * p_done
-end
+ -- In context we only keep glyph names because of tracing and access by name
+ -- so weird names make no sense.
--- In context we only keep glyph names because of tracing and access by name
--- so weird names make no sense.
+ if context then
-local forcekeep = false -- only for testing something
+ local forcekeep = false -- only for testing something
+-- local forcekeep = true
-directives.register("otf.keepnames",function(v)
- report_cleanup("keeping weird glyph names, expect larger files and more memory usage")
- forcekeep = v
-end)
+ directives.register("otf.keepnames",function(v)
+ report_cleanup("keeping weird glyph names, expect larger files and more memory usage")
+ forcekeep = v
+ end)
-local function stripredundant(fontdata)
- local descriptions = fontdata.descriptions
- if descriptions then
- local n = 0
- local c = 0
- -- in context we always strip
- if (not context and fonts.privateoffsets.keepnames) or forcekeep then
- for unicode, d in next, descriptions do
- if d.class == "base" then
- d.class = nil
- c = c + 1
+ -- local p_lesscrappyname =
+ -- lpeg.utfchartabletopattern({ "uni", "u" },true)
+ -- * S("Xx")^0
+ -- * p_hex^1
+ -- * p_style
+
+ local function stripvariants(descriptions,list)
+ local n = list and #list or 0
+ if n > 0 then
+ for i=1,n do
+ local g = list[i]
+ if g then
+ local d = descriptions[g]
+ if d and d.name then
+ d.name = nil
+ n = n + 1
+ end
+ end
end
end
- else
- for unicode, d in next, descriptions do
- local name = d.name
- if name and lpegmatch(p_crappyname,name) then
- d.name = nil
- n = n + 1
+ return n
+ end
+
+ local function stripparts(descriptions,list)
+ local n = list and #list or 0
+ if n > 0 then
+ for i=1,n do
+ local g = list[i].glyph
+ if g then
+ local d = descriptions[g]
+ if d and d.name then
+ d.name = nil
+ n = n + 1
+ end
+ end
end
- if d.class == "base" then
- d.class = nil
- c = c + 1
+ end
+ return n
+ end
+
+ -- local function collectsimple(fontdata)
+ -- local resources = fontdata.resources
+ -- local sequences = resources and resources.sequences
+ -- if sequences then
+ -- local keeplist = { }
+ -- for i=1,#sequences do
+ -- local s = sequences[i]
+ -- if s.type == "gsub_single" then
+ -- -- only simple ones
+ -- local features = s.features
+ -- local steps = s.steps
+ -- if features and steps then
+ -- local okay = false
+ -- for k, v in next, features do
+ -- if find(k,"^ss%d%d") then
+ -- okay = true
+ -- break
+ -- end
+ -- end
+ -- if okay then
+ -- for i=1,#steps do
+ -- local coverage = steps[i].coverage
+ -- if coverage then
+ -- for k, v in next, coverage do
+ -- keeplist[k] = v
+ -- end
+ -- end
+ -- end
+ -- end
+ -- end
+ -- end
+ -- end
+ -- return next(keeplist) and keeplist or nil
+ -- end
+ -- end
+
+ local function collectsimple(fontdata)
+ return nil
+ end
+
+ stripredundant = function(fontdata)
+ local descriptions = fontdata.descriptions
+ if descriptions then
+ local n = 0
+ local c = 0
+ for unicode, d in next, descriptions do
+ local m = d.math
+ if m then
+ n = n + stripvariants(descriptions,m.vvariants)
+ n = n + stripvariants(descriptions,m.hvariants)
+ n = n + stripparts (descriptions,m.vparts)
+ n = n + stripparts (descriptions,m.hparts)
+ end
+ end
+ if forcekeep then
+ for unicode, d in next, descriptions do
+ if d.class == "base" then
+ d.class = nil
+ c = c + 1
+ end
+ end
+ else
+ local keeplist = collectsimple(fontdata)
+ for unicode, d in next, descriptions do
+ local name = d.name
+ if name then
+ -- if lpegmatch(p_lesscrappyname,name) then
+ if keeplist and keeplist[name] then
+ -- keep name
+ elseif lpegmatch(p_crappyname,name) then
+ d.name = nil
+ n = n + 1
+ end
+ end
+ if d.class == "base" then
+ d.class = nil
+ c = c + 1
+ end
+ end
+ end
+ if trace_cleanup then
+ if n > 0 then
+ report_cleanup("%s bogus names removed (verbose unicode)",n)
+ end
+ if c > 0 then
+ report_cleanup("%s base class tags removed (default is base)",c)
+ end
end
end
end
- if trace_cleanup then
- if n > 0 then
- report_cleanup("%s bogus names removed (verbose unicode)",n)
- end
- if c > 0 then
- report_cleanup("%s base class tags removed (default is base)",c)
+
+ else
+
+ stripredundant = function(fontdata)
+ local descriptions = fontdata.descriptions
+ if descriptions then
+ if fonts.privateoffsets.keepnames then
+ for unicode, d in next, descriptions do
+ if d.class == "base" then
+ d.class = nil
+ end
+ end
+ else
+ for unicode, d in next, descriptions do
+ local name = d.name
+ if name then
+ if lpegmatch(p_crappyname,name) then
+ d.name = nil
+ end
+ end
+ if d.class == "base" then
+ d.class = nil
+ end
+ end
+ end
end
end
+
end
-end
-readers.stripredundant = stripredundant
+ readers.stripredundant = stripredundant
+
+end
function readers.getcomponents(fontdata) -- handy for resolving ligatures when names are missing
local resources = fontdata.resources
@@ -1024,6 +1191,10 @@ function readers.getcomponents(fontdata) -- handy for resolving ligatures when n
local function traverse(p,k,v)
if k == "ligature" then
collected[v] = { unpack(l) }
+ elseif tonumber(v) then
+ insert(l,k)
+ collected[v] = { unpack(l) }
+ remove(l)
else
insert(l,k)
for k, vv in next, v do
@@ -1102,8 +1273,7 @@ readers.unifymissing = unifymissing
function readers.rehash(fontdata,hashmethod) -- TODO: combine loops in one
if not (fontdata and fontdata.glyphs) then
return
- end
- if hashmethod == "indices" then
+ elseif hashmethod == "indices" then
fontdata.hashmethod = "indices"
elseif hashmethod == "names" then
fontdata.hashmethod = "names"
@@ -1111,7 +1281,6 @@ function readers.rehash(fontdata,hashmethod) -- TODO: combine loops in one
unifyresources(fontdata,indices)
copyduplicates(fontdata)
unifymissing(fontdata)
- -- stripredundant(fontdata)
else
fontdata.hashmethod = "unicodes"
local indices = unifyglyphs(fontdata)
@@ -1211,7 +1380,6 @@ local function tabstr_flat(t)
end
local function tabstr_mixed(t) -- indexed
- local s = { }
local n = #t
if n == 0 then
return ""
@@ -1225,6 +1393,7 @@ local function tabstr_mixed(t) -- indexed
return tostring(k) -- number or string
end
else
+ local s = { }
for i=1,n do
local k = t[i]
if k == true then
@@ -1334,6 +1503,21 @@ function readers.pack(data)
end
end
+ -- local function pack_indexed(v) -- less code
+ -- local tag = concat(v," ")
+ -- local ht = h[tag]
+ -- if ht then
+ -- c[ht] = c[ht] + 1
+ -- else
+ -- ht = nt + 1
+ -- t[ht] = v
+ -- c[ht] = 1
+ -- h[tag] = ht
+ -- nt = ht
+ -- end
+ -- return ht
+ -- end
+
local function pack_mixed(v)
local tag = tabstr_mixed(v)
local ht = h[tag]
@@ -2564,6 +2748,34 @@ end
-- Because we pack we cannot mix tables and numbers so we can only turn a whole set in
-- format kern instead of pair.
+local strip_pairs = true
+
+local compact_pairs = true
+local compact_singles = true
+
+local merge_pairs = true
+local merge_singles = true
+local merge_substitutions = true
+local merge_alternates = true
+local merge_multiples = true
+local merge_ligatures = true
+local merge_cursives = true
+local merge_marks = true
+
+directives.register("otf.strip.pairs", function(v) strip_pairs = v end)
+
+directives.register("otf.compact.pairs", function(v) compact_pairs = v end)
+directives.register("otf.compact.singles", function(v) compact_singles = v end)
+
+directives.register("otf.merge.pairs", function(v) merge_pairs = v end)
+directives.register("otf.merge.singles", function(v) merge_singles = v end)
+directives.register("otf.merge.substitutions", function(v) merge_substitutions = v end)
+directives.register("otf.merge.alternates", function(v) merge_alternates = v end)
+directives.register("otf.merge.multiples", function(v) merge_multiples = v end)
+directives.register("otf.merge.ligatures", function(v) merge_ligatures = v end)
+directives.register("otf.merge.cursives", function(v) merge_cursives = v end)
+directives.register("otf.merge.marks", function(v) merge_marks = v end)
+
local function checkpairs(lookup)
local steps = lookup.steps
local nofsteps = lookup.nofsteps
@@ -2581,6 +2793,7 @@ local function checkpairs(lookup)
if v == true then
-- all zero
elseif v and (v[1] ~= 0 or v[2] ~= 0 or v[4] ~= 0) then
+ -- complex kerns
return false
end
end
@@ -2617,29 +2830,39 @@ local function checkpairs(lookup)
return kerned
end
-local compact_pairs = true
-local compact_singles = true
-
-local merge_pairs = true
-local merge_singles = true
-local merge_substitutions = true
-local merge_alternates = true
-local merge_multiples = true
-local merge_ligatures = true
-local merge_cursives = true
-local merge_marks = true
-
-directives.register("otf.compact.pairs", function(v) compact_pairs = v end)
-directives.register("otf.compact.singles", function(v) compact_singles = v end)
+local function strippairs(lookup)
+ local steps = lookup.steps
+ local nofsteps = lookup.nofsteps
+ local stripped = 0
-directives.register("otf.merge.pairs", function(v) merge_pairs = v end)
-directives.register("otf.merge.singles", function(v) merge_singles = v end)
-directives.register("otf.merge.substitutions", function(v) merge_substitutions = v end)
-directives.register("otf.merge.alternates", function(v) merge_alternates = v end)
-directives.register("otf.merge.multiples", function(v) merge_multiples = v end)
-directives.register("otf.merge.ligatures", function(v) merge_ligatures = v end)
-directives.register("otf.merge.cursives", function(v) merge_cursives = v end)
-directives.register("otf.merge.marks", function(v) merge_marks = v end)
+ for i=1,nofsteps do
+ local step = steps[i]
+ if step.format == "pair" then
+ local coverage = step.coverage
+ for g1, d1 in next, coverage do
+ for g2, d2 in next, d1 do
+ if d2[2] then
+ --- true or { a, b, c, d }
+ -- else
+ -- local v = d2[1]
+ -- if v == true then
+ -- d1[g2] = nil
+ -- stripped = stripped + 1
+ -- elseif v and (v[1] == 0 and v[2] == 0 and v[4] == 0) then -- vkrn can have v[3] ~= 0
+ -- d1[g2] = nil
+ -- stripped = stripped + 1
+ -- end
+ -- end
+ elseif d2[1] == true then
+ d1[g2] = nil
+ stripped = stripped + 1
+ end
+ end
+ end
+ end
+ end
+ return stripped
+end
function readers.compact(data)
if not data or data.compacted then
@@ -2648,6 +2871,7 @@ function readers.compact(data)
data.compacted = true
end
local resources = data.resources
+ local stripped = 0
local merged = 0
local kerned = 0
local allsteps = 0
@@ -2678,6 +2902,7 @@ function readers.compact(data)
merged = merged + mergesteps_4(lookup)
end
elseif kind == "gpos_single" then
+ -- maybe also strip zeros here
if merge_singles then
merged = merged + mergesteps_1(lookup,true)
end
@@ -2685,6 +2910,9 @@ function readers.compact(data)
kerned = kerned + checkkerns(lookup)
end
elseif kind == "gpos_pair" then
+ if strip_pairs then
+ stripped = stripped + strippairs(lookup) -- noto cjk from 24M -> 8 M
+ end
if merge_pairs then
merged = merged + mergesteps_2(lookup)
end
@@ -2726,6 +2954,9 @@ function readers.compact(data)
compact("sequences")
compact("sublookups")
if trace_optimizations then
+ if stripped > 0 then
+ report_optimizations("%i zero positions stripped before merging",stripped)
+ end
if merged > 0 then
report_optimizations("%i steps of %i removed due to merging",merged,allsteps)
end
@@ -2735,6 +2966,91 @@ function readers.compact(data)
end
end
+if CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0 then
+
+ local done = 0
+
+ local function condense_1(k,v,t)
+ if type(v) == "table" then
+ local u = false
+ local l = false
+ for k, v in next, v do
+ if k == "ligature" then
+ l = v
+ if u then
+ break
+ end
+ elseif u then
+ break
+ else
+ u = true
+ end
+ end
+ if l and not u then
+ t[k] = l
+ done = done + 1
+ end
+ if u then
+ for k, vv in next, v do
+ if k ~= "ligature" then
+ condense_1(k,vv,v)
+ end
+ end
+ end
+ end
+ end
+
+ local function condensesteps_1(lookup)
+ done = 0
+ if lookup.type == "gsub_ligature" then
+ local steps = lookup.steps
+ if steps then
+ for i=1,#steps do
+ local step = steps[i]
+ local coverage = step.coverage
+ if coverage then
+ for k, v in next, coverage do
+ if condense_1(k,v,coverage) then
+ coverage[k] = v.ligature
+ done = done + 1
+ end
+ end
+ end
+ end
+ end
+ end
+ return done
+ end
+
+ function readers.condense(data)
+ if not data or data.condensed then
+ return
+ else
+ data.condensed = true
+ end
+ local resources = data.resources
+ local condensed = 0
+ local function condense(what)
+ local lookups = resources[what]
+ if lookups then
+ for i=1,#lookups do
+ condensed = condensed + condensesteps_1(lookups[i])
+ end
+ elseif trace_optimizations then
+ report_optimizations("no lookups in %a",what)
+ end
+ end
+ condense("sequences")
+ condense("sublookups")
+ if trace_optimizations then
+ if condensed > 0 then
+ report_optimizations("%i ligatures condensed",condensed)
+ end
+ end
+ end
+
+end
+
local function mergesteps(t,k)
if k == "merged" then
local merged = { }
@@ -2854,7 +3170,7 @@ function readers.expand(data)
-- about 15% on arabtype .. then moving the a test also saves a bit (even when
-- often a is not set at all so that one is a bit debatable
- local function expandlookups(sequences)
+ local function expandlookups(sequences,whatever)
if sequences then
-- we also need to do sublookups
for i=1,#sequences do
@@ -2930,6 +3246,9 @@ function readers.expand(data)
if lookups then
for k, v in next, lookups do -- actually this one is indexed
local lookup = sublookups[v]
+if not lookup and whatever then
+ lookup = whatever[v]
+end
if lookup then
lookups[k] = lookup
if not subtype then
@@ -3010,5 +3329,5 @@ function readers.expand(data)
end
expandlookups(sequences)
- expandlookups(sublookups)
+ expandlookups(sublookups,sequences)
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-phb-imp-binary.lua b/Master/texmf-dist/tex/context/base/mkiv/font-phb-imp-binary.lua
new file mode 100644
index 00000000000..39ac6ec049c
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-phb-imp-binary.lua
@@ -0,0 +1,119 @@
+if not modules then modules = { } end modules ['font-phb-imp-binary'] = {
+ version = 1.000, -- 2016.10.10,
+ comment = "companion to font-txt.mkiv",
+ author = "Hans Hagen",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files",
+}
+
+-- The hb library comes in versions and the one I tested in 2016 was part of the inkscape
+-- suite. In principle one can have incompatibilities due to updates but that is the nature
+-- of a library. When a library ie expected one has better use the system version, if only
+-- to make sure that different programs behave the same.
+--
+-- The main reason for testing this approach was that when Idris was working on his fonts,
+-- we wanted to know how different shapers deal with it and the hb command line program
+-- could provide uniscribe output. For the context shaper uniscribe is the reference, also
+-- because Idris started out with Volt a decade ago.
+--
+-- This file uses the indirect approach by calling the executable. This file uses context
+-- features and is not generic.
+
+local next, tonumber, pcall = next, tonumber, pcall
+
+local concat = table.concat
+local reverse = table.reverse
+local formatters = string.formatters
+local removefile = os.remove
+local resultof = os.resultof
+local savedata = io.savedata
+
+local report = utilities.hb.report or print
+local packtoutf8 = utilities.hb.helpers.packtoutf8
+
+if not context then
+ report("the binary runner is only supported in context")
+ return
+end
+
+-- output : [index=cluster@x_offset,y_offset+x_advance,y_advance|...]
+-- result : { index, cluster, x_offset, y_offset, x_advance, y_advance }
+
+local P, Ct, Cc = lpeg.P, lpeg.Ct, lpeg.Cc
+local lpegmatch = lpeg.match
+
+local zero = Cc(0)
+local number = lpeg.patterns.integer / tonumber + zero
+local index = lpeg.patterns.cardinal / tonumber
+local cluster = index
+local offset = (P("@") * number * (P(",") * number + zero)) + zero * zero
+local advance = (P("+") * number * (P(",") * number + zero)) + zero * zero
+local glyph = Ct(index * P("=") * cluster * offset * advance)
+local pattern = Ct(P("[") * (glyph * P("|")^-1)^0 * P("]"))
+
+local shapers = {
+ native = "ot,uniscribe,fallback",
+ uniscribe = "uniscribe,ot,fallback",
+ fallback = "fallback"
+}
+
+local runner = sandbox.registerrunner {
+ method = "resultof",
+ name = "harfbuzz",
+ -- program = {
+ -- windows = "hb-shape.exe",
+ -- unix = "hb-shape"
+ -- },
+ program = "hb-shape",
+ checkers = {
+ shaper = "string",
+ features = "string",
+ script = "string",
+ language = "string",
+ direction = "string",
+ textfile = "writable",
+ fontfile = "readable",
+ },
+ template = string.longtostring [[
+ --shaper=%shaper%
+ --output-format=text
+ --no-glyph-names
+ --features="%features%"
+ --script=%script%
+ --language=%language%
+ --direction=%direction%
+ --text-file=%textfile%
+ --font-file=%fontfile%
+ ]],
+}
+
+local tempfile = "font-phb.tmp"
+local reported = false
+
+function utilities.hb.methods.binary(font,data,rlmode,text,leading,trailing)
+ if runner then
+ savedata(tempfile,packtoutf8(text,leading,trailing))
+ local result = runner {
+ shaper = shapers[data.shaper] or shapers.native,
+ features = data.features,
+ script = data.script or "dflt",
+ language = data.language or "dflt",
+ direction = rlmode < 0 and "rtl" or "ltr",
+ textfile = tempfile,
+ fontfile = data.filename,
+ }
+ removefile(tempfile)
+ if result then
+ -- return jsontolua(result)
+ result = lpegmatch(pattern,result) -- { index cluster xo yo xa ya }
+ if rlmode < 0 then
+ return reverse(result) -- we can avoid this
+ else
+ return result
+ end
+ end
+ elseif reported then
+ report("no runner available")
+ reported = true
+ end
+end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-phb-imp-library.lua b/Master/texmf-dist/tex/context/base/mkiv/font-phb-imp-library.lua
new file mode 100644
index 00000000000..fe991b023c7
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-phb-imp-library.lua
@@ -0,0 +1,498 @@
+if not modules then modules = { } end modules ['font-phb-imp-library'] = {
+ version = 1.000, -- 2020.01.08,
+ comment = "companion to font-txt.mkiv",
+ original = "derived from a prototype by Kai Eigner",
+ author = "Hans Hagen", -- so don't blame KE
+ copyright = "TAT Zetwerk / PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files",
+}
+
+-- The hb library comes in versions and the one I tested in 2016 was part of the inkscape
+-- suite. In principle one can have incompatibilities due to updates but that is the nature
+-- of a library. When a library ie expected one has better use the system version, if only
+-- to make sure that different programs behave the same.
+--
+-- The main reason for testing this approach was that when Idris was working on his fonts,
+-- we wanted to know how different shapers deal with it and the hb command line program
+-- could provide uniscribe output. For the context shaper uniscribe is the reference, also
+-- because Idris started out with Volt a decade ago.
+--
+-- We treat the lib as a black box as it should be. At some point Kai Eigner made an ffi
+-- binding and that one was adapted to the plugin approach of context. It saved me the
+-- trouble of looking at source files to figure it all out. Below is the adapted code.
+--
+-- Keep in mind that this file is for mkiv only. It won't work in lmtx where instead of
+-- ffi we use simple optional libraries with delayed bindings. In principle this mechanism
+-- is generic but because other macropackages follow another route we don't spend time
+-- on that code path here.
+
+local next, tonumber, pcall = next, tonumber, pcall
+local reverse = table.reverse
+local loaddata = io.loaddata
+
+local report = utilities.hb.report or print
+local packtoutf32 = utilities.hb.helpers.packtoutf32
+
+if not FFISUPPORTED or not ffi then
+ report("no ffi support")
+ return
+elseif CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0 then
+ report("no ffi support")
+ return
+elseif not context then
+ return
+end
+
+local harfbuzz = ffilib(os.name == "windows" and "libharfbuzz-0" or "libharfbuzz")
+
+if not harfbuzz then
+ report("no hb library found")
+ return
+end
+
+-- jit.on() : on very long (hundreds of pages) it looks faster but
+-- the normal font processor slows down ... this is consistent with
+-- earlier observations that turning it on is often slower on these
+-- one-shot tex runs (also because we don't use many math and/or
+-- string helpers and therefore the faster vm of luajit gives most
+-- benefits (given the patched hasher)
+
+-- Here is Kai's ffi mapping, a bit reorganized. We only define what we
+-- need. I'm happy that Kai did the deciphering of the api that I could
+-- then build upon.
+
+ffi.cdef [[
+
+typedef struct hb_blob_t hb_blob_t ;
+
+typedef enum {
+ HB_MEMORY_MODE_DUPLICATE,
+ HB_MEMORY_MODE_READONLY,
+ HB_MEMORY_MODE_WRITABLE,
+ HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE
+} hb_memory_mode_t ;
+
+typedef void (*hb_destroy_func_t) (
+ void *user_data
+) ;
+
+typedef struct hb_face_t hb_face_t ;
+
+typedef const struct hb_language_impl_t *hb_language_t ;
+
+typedef struct hb_buffer_t hb_buffer_t ;
+
+typedef enum {
+ HB_SCRIPT_COMMON, HB_SCRIPT_INHERITED, HB_SCRIPT_UNKNOWN,
+
+ HB_SCRIPT_ARABIC, HB_SCRIPT_ARMENIAN, HB_SCRIPT_BENGALI, HB_SCRIPT_CYRILLIC,
+ HB_SCRIPT_DEVANAGARI, HB_SCRIPT_GEORGIAN, HB_SCRIPT_GREEK,
+ HB_SCRIPT_GUJARATI, HB_SCRIPT_GURMUKHI, HB_SCRIPT_HANGUL, HB_SCRIPT_HAN,
+ HB_SCRIPT_HEBREW, HB_SCRIPT_HIRAGANA, HB_SCRIPT_KANNADA, HB_SCRIPT_KATAKANA,
+ HB_SCRIPT_LAO, HB_SCRIPT_LATIN, HB_SCRIPT_MALAYALAM, HB_SCRIPT_ORIYA,
+ HB_SCRIPT_TAMIL, HB_SCRIPT_TELUGU, HB_SCRIPT_THAI, HB_SCRIPT_TIBETAN,
+ HB_SCRIPT_BOPOMOFO, HB_SCRIPT_BRAILLE, HB_SCRIPT_CANADIAN_SYLLABICS,
+ HB_SCRIPT_CHEROKEE, HB_SCRIPT_ETHIOPIC, HB_SCRIPT_KHMER, HB_SCRIPT_MONGOLIAN,
+ HB_SCRIPT_MYANMAR, HB_SCRIPT_OGHAM, HB_SCRIPT_RUNIC, HB_SCRIPT_SINHALA,
+ HB_SCRIPT_SYRIAC, HB_SCRIPT_THAANA, HB_SCRIPT_YI, HB_SCRIPT_DESERET,
+ HB_SCRIPT_GOTHIC, HB_SCRIPT_OLD_ITALIC, HB_SCRIPT_BUHID, HB_SCRIPT_HANUNOO,
+ HB_SCRIPT_TAGALOG, HB_SCRIPT_TAGBANWA, HB_SCRIPT_CYPRIOT, HB_SCRIPT_LIMBU,
+ HB_SCRIPT_LINEAR_B, HB_SCRIPT_OSMANYA, HB_SCRIPT_SHAVIAN, HB_SCRIPT_TAI_LE,
+ HB_SCRIPT_UGARITIC, HB_SCRIPT_BUGINESE, HB_SCRIPT_COPTIC,
+ HB_SCRIPT_GLAGOLITIC, HB_SCRIPT_KHAROSHTHI, HB_SCRIPT_NEW_TAI_LUE,
+ HB_SCRIPT_OLD_PERSIAN, HB_SCRIPT_SYLOTI_NAGRI, HB_SCRIPT_TIFINAGH,
+ HB_SCRIPT_BALINESE, HB_SCRIPT_CUNEIFORM, HB_SCRIPT_NKO, HB_SCRIPT_PHAGS_PA,
+ HB_SCRIPT_PHOENICIAN, HB_SCRIPT_CARIAN, HB_SCRIPT_CHAM, HB_SCRIPT_KAYAH_LI,
+ HB_SCRIPT_LEPCHA, HB_SCRIPT_LYCIAN, HB_SCRIPT_LYDIAN, HB_SCRIPT_OL_CHIKI,
+ HB_SCRIPT_REJANG, HB_SCRIPT_SAURASHTRA, HB_SCRIPT_SUNDANESE, HB_SCRIPT_VAI,
+ HB_SCRIPT_AVESTAN, HB_SCRIPT_BAMUM, HB_SCRIPT_EGYPTIAN_HIEROGLYPHS,
+ HB_SCRIPT_IMPERIAL_ARAMAIC, HB_SCRIPT_INSCRIPTIONAL_PAHLAVI,
+ HB_SCRIPT_INSCRIPTIONAL_PARTHIAN, HB_SCRIPT_JAVANESE, HB_SCRIPT_KAITHI,
+ HB_SCRIPT_LISU, HB_SCRIPT_MEETEI_MAYEK, HB_SCRIPT_OLD_SOUTH_ARABIAN,
+ HB_SCRIPT_OLD_TURKIC, HB_SCRIPT_SAMARITAN, HB_SCRIPT_TAI_THAM,
+ HB_SCRIPT_TAI_VIET, HB_SCRIPT_BATAK, HB_SCRIPT_BRAHMI, HB_SCRIPT_MANDAIC,
+ HB_SCRIPT_CHAKMA, HB_SCRIPT_MEROITIC_CURSIVE, HB_SCRIPT_MEROITIC_HIEROGLYPHS,
+ HB_SCRIPT_MIAO, HB_SCRIPT_SHARADA, HB_SCRIPT_SORA_SOMPENG, HB_SCRIPT_TAKRI,
+ HB_SCRIPT_BASSA_VAH, HB_SCRIPT_CAUCASIAN_ALBANIAN, HB_SCRIPT_DUPLOYAN,
+ HB_SCRIPT_ELBASAN, HB_SCRIPT_GRANTHA, HB_SCRIPT_KHOJKI, HB_SCRIPT_KHUDAWADI,
+ HB_SCRIPT_LINEAR_A, HB_SCRIPT_MAHAJANI, HB_SCRIPT_MANICHAEAN,
+ HB_SCRIPT_MENDE_KIKAKUI, HB_SCRIPT_MODI, HB_SCRIPT_MRO, HB_SCRIPT_NABATAEAN,
+ HB_SCRIPT_OLD_NORTH_ARABIAN, HB_SCRIPT_OLD_PERMIC, HB_SCRIPT_PAHAWH_HMONG,
+ HB_SCRIPT_PALMYRENE, HB_SCRIPT_PAU_CIN_HAU, HB_SCRIPT_PSALTER_PAHLAVI,
+ HB_SCRIPT_SIDDHAM, HB_SCRIPT_TIRHUTA, HB_SCRIPT_WARANG_CITI, HB_SCRIPT_AHOM,
+ HB_SCRIPT_ANATOLIAN_HIEROGLYPHS, HB_SCRIPT_HATRAN, HB_SCRIPT_MULTANI,
+ HB_SCRIPT_OLD_HUNGARIAN, HB_SCRIPT_SIGNWRITING, HB_SCRIPT_ADLAM,
+ HB_SCRIPT_BHAIKSUKI, HB_SCRIPT_MARCHEN, HB_SCRIPT_OSAGE, HB_SCRIPT_TANGUT,
+ HB_SCRIPT_NEWA, HB_SCRIPT_MASARAM_GONDI, HB_SCRIPT_NUSHU, HB_SCRIPT_SOYOMBO,
+ HB_SCRIPT_ZANABAZAR_SQUARE, HB_SCRIPT_DOGRA, HB_SCRIPT_GUNJALA_GONDI,
+ HB_SCRIPT_HANIFI_ROHINGYA, HB_SCRIPT_MAKASAR, HB_SCRIPT_MEDEFAIDRIN,
+ HB_SCRIPT_OLD_SOGDIAN, HB_SCRIPT_SOGDIAN, HB_SCRIPT_ELYMAIC,
+ HB_SCRIPT_NANDINAGARI, HB_SCRIPT_NYIAKENG_PUACHUE_HMONG, HB_SCRIPT_WANCHO,
+
+ HB_SCRIPT_INVALID, _HB_SCRIPT_MAX_VALUE, _HB_SCRIPT_MAX_VALUE_SIGNED,
+} hb_script_t ;
+
+typedef enum {
+ HB_DIRECTION_INVALID,
+ HB_DIRECTION_LTR,
+ HB_DIRECTION_RTL,
+ HB_DIRECTION_TTB,
+ HB_DIRECTION_BTT
+} hb_direction_t ;
+
+typedef int hb_bool_t ;
+
+typedef uint32_t hb_tag_t ;
+
+typedef struct hb_feature_t {
+ hb_tag_t tag;
+ uint32_t value;
+ unsigned int start;
+ unsigned int end;
+} hb_feature_t ;
+
+typedef struct hb_font_t hb_font_t ;
+
+typedef uint32_t hb_codepoint_t ;
+typedef int32_t hb_position_t ;
+typedef uint32_t hb_mask_t ;
+
+typedef union _hb_var_int_t {
+ uint32_t u32;
+ int32_t i32;
+ uint16_t u16[2];
+ int16_t i16[2];
+ uint8_t u8[4];
+ int8_t i8[4];
+} hb_var_int_t ;
+
+typedef struct hb_glyph_info_t {
+ hb_codepoint_t codepoint ;
+ hb_mask_t mask ;
+ uint32_t cluster ;
+ /*< private >*/
+ hb_var_int_t var1 ;
+ hb_var_int_t var2 ;
+} hb_glyph_info_t ;
+
+typedef struct hb_glyph_position_t {
+ hb_position_t x_advance ;
+ hb_position_t y_advance ;
+ hb_position_t x_offset ;
+ hb_position_t y_offset ;
+ /*< private >*/
+ hb_var_int_t var ;
+} hb_glyph_position_t ;
+
+const char * hb_version_string (
+ void
+) ;
+
+hb_blob_t * hb_blob_create (
+ const char *data,
+ unsigned int length,
+ hb_memory_mode_t mode,
+ void *user_data,
+ hb_destroy_func_t destroy
+) ;
+
+void hb_blob_destroy (
+ hb_blob_t *blob
+) ;
+
+hb_face_t * hb_face_create (
+ hb_blob_t *blob,
+ unsigned int index
+) ;
+
+void hb_face_destroy (
+ hb_face_t *face
+) ;
+
+hb_language_t hb_language_from_string (
+ const char *str,
+ int len
+) ;
+
+void hb_buffer_set_language (
+ hb_buffer_t *buffer,
+ hb_language_t language
+) ;
+
+hb_script_t hb_script_from_string (
+ const char *s,
+ int len
+) ;
+
+void hb_buffer_set_script (
+ hb_buffer_t *buffer,
+ hb_script_t script
+) ;
+
+hb_direction_t hb_direction_from_string (
+ const char *str,
+ int len
+) ;
+
+void hb_buffer_set_direction (
+ hb_buffer_t *buffer,
+ hb_direction_t direction
+) ;
+
+hb_bool_t hb_feature_from_string (
+ const char *str,
+ int len,
+ hb_feature_t *feature
+) ;
+
+hb_bool_t hb_shape_full (
+ hb_font_t *font,
+ hb_buffer_t *buffer,
+ const hb_feature_t *features,
+ unsigned int num_features,
+ const char * const *shaper_list
+) ;
+
+
+hb_buffer_t * hb_buffer_create (
+ void
+) ;
+
+void hb_buffer_destroy (
+ hb_buffer_t *buffer
+) ;
+
+void hb_buffer_add_utf8 (
+ hb_buffer_t *buffer,
+ const char *text,
+ int text_length,
+ unsigned int item_offset,
+ int item_length
+) ;
+
+void hb_buffer_add_utf32 (
+ hb_buffer_t *buffer,
+ const char *text,
+ int text_length,
+ unsigned int item_offset,
+ int item_length
+) ;
+
+void hb_buffer_add (
+ hb_buffer_t *buffer,
+ hb_codepoint_t codepoint,
+ unsigned int cluster
+) ;
+
+unsigned int hb_buffer_get_length (
+ hb_buffer_t *buffer
+) ;
+
+hb_glyph_info_t * hb_buffer_get_glyph_infos (
+ hb_buffer_t *buffer,
+ unsigned int *length
+) ;
+
+hb_glyph_position_t *hb_buffer_get_glyph_positions (
+ hb_buffer_t *buffer,
+ unsigned int *length
+) ;
+
+void hb_buffer_reverse (
+ hb_buffer_t *buffer
+) ;
+
+void hb_buffer_reset (
+ hb_buffer_t *buffer
+) ;
+
+void hb_buffer_guess_segment_properties (
+ hb_buffer_t *buffer
+) ;
+
+hb_font_t * hb_font_create (
+ hb_face_t *face
+) ;
+
+void hb_font_destroy (
+ hb_font_t *font
+) ;
+
+void hb_font_set_scale (
+ hb_font_t *font,
+ int x_scale,
+ int y_scale
+) ;
+
+void hb_ot_font_set_funcs (
+ hb_font_t *font
+) ;
+
+unsigned int hb_face_get_upem (
+ hb_face_t *face
+) ;
+
+const char ** hb_shape_list_shapers (
+ void
+);
+]]
+
+-- The library must be somewhere accessible. The calls to the library are similar to
+-- the ones in the prototype but we organize things a bit differently. I tried to alias
+-- the functions in the harfbuzz namespace (luajittex will optimize this anyway but
+-- normal luatex not) but it crashes luajittex so I revered that.
+
+do
+
+ local l = harfbuzz.hb_shape_list_shapers()
+ local s = { }
+
+ for i=0,9 do
+ local str = l[i]
+ if str == ffi.NULL then
+ break
+ else
+ s[#s+1] = ffi.string(str)
+ end
+ end
+
+ report("using hb library version %a, supported shapers: %,t",ffi.string(harfbuzz.hb_version_string()),s)
+
+end
+
+-- we don't want to store userdata in the public data blob
+
+local fontdata = fonts.hashes.identifiers
+
+local loaded = { }
+local shared = { }
+local featured = { }
+
+local function loadfont(font)
+ local tfmdata = fontdata[font]
+ local resources = tfmdata.resources
+ local filename = resources.filename
+ local instance = shared[filename]
+ if not instance then
+ local wholefont = io.loaddata(filename)
+ local wholeblob = ffi.gc(harfbuzz.hb_blob_create(wholefont,#wholefont,0,nil,nil),harfbuzz.hb_blob_destroy)
+ local wholeface = ffi.gc(harfbuzz.hb_face_create(wholeblob,font),harfbuzz.hb_face_destroy)
+ local scale = harfbuzz.hb_face_get_upem(wholeface)
+ instance = ffi.gc(harfbuzz.hb_font_create(wholeface),harfbuzz.hb_font_destroy)
+ harfbuzz.hb_font_set_scale(instance,scale,scale)
+ harfbuzz.hb_ot_font_set_funcs(instance)
+ shared[filename] = instance
+ end
+ return instance
+end
+
+local function loadfeatures(data)
+ local featureset = data.featureset or { }
+ local feature = ffi.new("hb_feature_t[?]",#featureset)
+ local featurespec = feature[0]
+ local noffeatures = 0
+ for i=1,#featureset do
+ local f = featureset[i]
+ harfbuzz.hb_feature_from_string(f,#f,feature[noffeatures])
+ noffeatures = noffeatures + 1
+ end
+ return {
+ noffeatures = #featureset,
+ featureblob = feature,
+ featurespec = featurespec,
+ }
+end
+
+local function crap(t)
+ return ffi.new("const char *[?]", #t, t)
+end
+
+local shapers = {
+ native = crap { "ot", "uniscribe", "fallback" },
+ uniscribe = crap { "uniscribe", "ot", "fallback" },
+ -- uniscribe = crap { "uniscribe", "fallback" }, -- stalls without fallback when no uniscribe present
+ fallback = crap { "fallback" },
+}
+
+-- Reusing a buffer doesn't make a difference in performance so we forget
+-- about it and keep things simple. Todo: check if using locals makes sense.
+
+function utilities.hb.methods.library(font,data,rlmode,text,leading,trailing)
+ local instance = loaded[font]
+ if not instance then
+ instance = loadfont(font)
+ loaded[font] = instance
+ end
+ -- todo: dflt -> DFLT ?
+ -- todo: whatever -> Whatever ?
+ local language = data.language or "dflt"
+ local script = data.script or "dflt"
+ local direction = rlmode < 0 and "rtl" or "ltr"
+ local shaper = shapers[data.shaper]
+ local featurehash = data.features
+ local featuredata = featured[featurehash]
+ if not featuredata then
+ featuredata = loadfeatures(data)
+ featured[featurehash] = featuredata
+ end
+
+ local buffer = ffi.gc(harfbuzz.hb_buffer_create(),harfbuzz.hb_buffer_destroy)
+
+ -- if false then
+ -- -- i have no time to look into this now but something like this should
+ -- -- be possible .. it probably doesn't make a difference in performance
+ -- local n = 0 -- here we also start at 0
+ -- if leading then
+ -- harfbuzz.hb_buffer_add(buffer,[todo: 0x20],n)
+ -- end
+ -- for i=1,#text do
+ -- n = n + 1
+ -- harfbuzz.hb_buffer_add(buffer,[todo: text[i] ],n)
+ -- end
+ -- if trailing then
+ -- n = n + 1
+ -- harfbuzz.hb_buffer_add(buffer,[todo: 0x20 ],n)
+ -- end
+ -- else
+ -- maybe also utf 8 clusters here like on the command line but i have no time
+ -- to figure that out
+ text = packtoutf32(text,leading,trailing)
+ local size = #text/4
+ text = text .. "\000\000\000\000\000\000\000\000" -- trial and error: avoid crash
+ harfbuzz.hb_buffer_add_utf32(buffer,text,#text,0,size)
+ -- end
+
+ -- maybe: hb_buffer_set_segment_properties(buffer,...)
+
+ harfbuzz.hb_buffer_set_language(buffer,harfbuzz.hb_language_from_string(language,#language))
+ harfbuzz.hb_buffer_set_script(buffer,harfbuzz.hb_script_from_string(script,#script))
+ harfbuzz.hb_buffer_set_direction(buffer,harfbuzz.hb_direction_from_string(direction,#direction))
+
+ harfbuzz.hb_buffer_guess_segment_properties(buffer) -- why is this needed (we already set them)
+ harfbuzz.hb_shape_full(instance,buffer,featuredata.featurespec,featuredata.noffeatures,shaper)
+
+ if rlmode < 0 then
+ harfbuzz.hb_buffer_reverse(buffer)
+ end
+
+ local size = harfbuzz.hb_buffer_get_length(buffer)
+ local infos = harfbuzz.hb_buffer_get_glyph_infos(buffer, nil)
+ local positions = harfbuzz.hb_buffer_get_glyph_positions(buffer, nil)
+
+ local result = { }
+ for i=1,size do
+ local info = infos[i-1]
+ local position = positions[i-1]
+ result[i] = {
+ info.codepoint,
+ info.cluster,
+ position.x_offset,
+ position.y_offset,
+ position.x_advance,
+ position.y_advance,
+ }
+ end
+ -- inspect(result)
+ return result
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-phb.lua b/Master/texmf-dist/tex/context/base/mkiv/font-phb.lua
new file mode 100644
index 00000000000..ce42e5a59cc
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-phb.lua
@@ -0,0 +1,728 @@
+if not modules then modules = { } end modules ['font-phb'] = {
+ version = 1.000, -- 2016.10.10,
+ comment = "companion to font-txt.mkiv",
+ original = "derived from a prototype by Kai Eigner",
+ author = "Hans Hagen", -- so don't blame KE
+ copyright = "TAT Zetwerk / PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files",
+}
+
+-- The next code is a rewrite of Kai's prototype. Here we forget about components
+-- and assume some sane data structures. Clusters are handled on the fly. This is
+-- probably one of the places where generic and context code is (to be) different
+-- anyway. All errors in the logic below are mine (Hans). The optimizations probably
+-- make less sense in luajittex because there the interpreter does some optimization
+-- but we may end up with a non-jit version some day.
+--
+-- For testing I used the commandline tool as this code is not that critital and not
+-- used in context for production (maybe for testing). I noticed some issues with
+-- r2l shaping of latin but the uniscribe shaper seems better with that but as it's
+-- a library we're supposed to treat it as a magic black box and not look into it. In
+-- the end all will be sorted out I guess so we don't need to worry about it. Also, I
+-- can always improve the code below if really needed.
+--
+-- We create intermediate tables which might look inefficient. For instance we could
+-- just return two tables or an iterator but in the end this is not the bottleneck.
+-- In fact, speed is hard to measure anyway, as it depends on the font, complexity
+-- of the text, etc. Sometimes the library is faster, sometimes the context Lua one
+-- (which is interesting as it does a bit more, i.e. supports additional features,
+-- which also makes it even harder to check). When we compare context mkiv runs with
+-- mkii runs using pdftex or xetex (which uses harfbuzz) the performance of luatex
+-- on (simple) font demos normally is significant less compared with pdftex (8 bit
+-- and no unicode) but a bit better than xetex. It looks like the interface that gets
+-- implemented here suits that pattern (keep in mind that especially discretionary
+-- handling is quite complex and similar to the context mkiv variant).
+--
+-- The main motivations for supporting this are (1) the fact that Kai spent time on
+-- it, and (2) that we can compare the Lua variant with uniscribe, which is kind of
+-- a reference. We started a decade ago (2006) with the Lua implementation and had
+-- to rely on MSWord for comparison. On the other hand, the command line version is
+-- also useable for that. Don't blame the library or its (maybe wrong) use (here)
+-- for side effects.
+--
+-- Currently there are two methods: (1) binary, which is slow and uses the command
+-- line shaper and (2) the ffi binding. In the meantime I redid the feed-back-into-
+-- the-node-list method. This way tracing is easier, performance better, and there
+-- is no need to mess so much with spacing. I have no clue if I lost functionality
+-- and as this is not production code issues probably will go unnoticed for a while.
+-- We'll see.
+--
+-- Usage: see m-fonts-plugins.mkiv as that is the interface.
+--
+-- Remark: It looks like the library sets up some features by default. Passing them
+-- somehow doesn't work (yet) so I must miss something here. There is something fishy
+-- here with enabling features like init, medi, fina etc because when we turn them on
+-- they aren't applied. Also some features are not processed.
+--
+-- Remark: Because utf32 is fragile I append a couple of zero slots which seems to
+-- work out ok. In fact, after some experiment I figured out that utf32 needs a list
+-- of 4 byte cardinals. From the fact that Kai used the utf8 method I assumed that
+-- there was a utf32 too and indeed that worked but I have no time to look into it
+-- more deeply. It seems to work ok though.
+--
+-- The plugin itself has plugins and we do it the same as with (my)sql support, i.e.
+-- we provide methods. The specific methods are implemented in the imp files. We
+-- follow that model with other libraries too.
+--
+-- Somehow the command line version does uniscribe (usp10.dll) but not the library
+-- so when I can get motivated I might write a binding for uniscribe. (Problem: I
+-- don't look forward to decipher complex (c++) library api's so in the end it might
+-- never happen. A quick glance at the usp10 api gives me the impression that the
+-- apis don't differ that much, but still.)
+--
+-- Warning: This is rather old code, cooked up in the second half of 2016. I'm not
+-- sure if it will keep working because it's not used in production and therefore
+-- doesn't get tested. It was written as part of some comparison tests for Idris,
+-- who wanted to compare the ConTeXt handler, uniscribe and hb, for which there are
+-- also some special modules (that show results alongside). It has never been tested
+-- in regular documents. As it runs independent of the normal font processors there
+-- is probably not that much risk of interference but of course one looses all the
+-- goodies that have been around for a while (or will show up in the future). The
+-- code can probably be optimized a bit.
+
+-- There are three implementation specific files:
+--
+-- 1 font-phb-imp-binary.lua : calls the command line version of hb
+-- 2 font-phb-imp-library.lua : uses ffi to interface to hb
+-- 3 font-phb-imp-internal.lua : uses a small library to interface to hb
+--
+-- Variants 1 and 2 should work with mkiv and were used when playing with these
+-- things, when writing the articles, and when running some tests for Idris font
+-- development. Variant 3 (and maybe 1 also works) is meant for lmtx and has not
+-- been used (read: tested) so far. The 1 and 2 variants are kind of old, but 3 is
+-- an adaptation of 2 so not hip and modern either.
+
+if not context then
+ return
+end
+
+local next, tonumber, pcall, rawget = next, tonumber, pcall, rawget
+
+local concat = table.concat
+local sortedhash = table.sortedhash
+local formatters = string.formatters
+
+local fonts = fonts
+local otf = fonts.handlers.otf
+local texthandler = otf.texthandler
+
+local fontdata = fonts.hashes.identifiers
+
+local nuts = nodes.nuts
+local tonode = nuts.tonode
+local tonut = nuts.tonut
+
+local remove_node = nuts.remove
+
+local getboth = nuts.getboth
+local getnext = nuts.getnext
+local setnext = nuts.setnext
+local getprev = nuts.getprev
+local setprev = nuts.setprev
+local getid = nuts.getid
+local getchar = nuts.getchar
+local setchar = nuts.setchar
+local setlink = nuts.setlink
+local setoffsets = nuts.setoffsets
+----- getcomponents = nuts.getcomponents
+----- setcomponents = nuts.setcomponents
+local getwidth = nuts.getwidth
+local setwidth = nuts.setwidth
+
+local copy_node = nuts.copy
+local find_tail = nuts.tail
+
+local nodepool = nuts.pool
+local new_kern = nodepool.fontkern
+local new_glyph = nodepool.glyph
+
+local nodecodes = nodes.nodecodes
+local glyph_code = nodecodes.glyph
+local glue_code = nodecodes.glue
+
+local skipped = {
+ -- we assume that only valid features are set but maybe we need a list
+ -- of valid hb features as there can be many context specific ones
+ mode = true,
+ features = true,
+ language = true,
+ script = true,
+}
+
+local seenspaces = {
+ [0x0020] = true,
+ [0x00A0] = true,
+ [0x0009] = true, -- indeed
+ [0x000A] = true, -- indeed
+ [0x000D] = true, -- indeed
+}
+
+-- helpers
+
+local helpers = { }
+local methods = { }
+local initialized = { } -- we don't polute the shared table
+
+local method = "library"
+local shaper = "native" -- "uniscribe"
+local report = logs.reporter("font plugin","hb")
+
+utilities.hb = {
+ methods = methods,
+ helpers = helpers,
+ report = report,
+}
+
+do
+
+ local toutf8 = utf.char
+ local space = toutf8(0x20)
+
+ -- we can move this to the internal lib .. just pass a table .. but it is not faster
+
+ function helpers.packtoutf8(text,leading,trailing)
+ local size = #text
+ for i=1,size do
+ text[i] = toutf8(text[i])
+ end
+ if leading then
+ text[0] = space
+ end
+ if trailing then
+ text[size+1] = space
+ end
+ return concat(text,"",leading and 0 or 1,trailing and (size + 1) or size)
+ end
+
+ local toutf32 = utf.toutf32string
+ local space = toutf32(0x20)
+
+ function helpers.packtoutf32(text,leading,trailing)
+ local size = #text
+ for i=1,size do
+ text[i] = toutf32(text[i])
+ end
+ if leading then
+ text[0] = space
+ end
+ if trailing then
+ text[size+1] = space
+ end
+ return concat(text,"",leading and 0 or 1,trailing and (size + 1) or size)
+ end
+
+end
+
+local function initialize(font)
+
+ local tfmdata = fontdata[font]
+ local resources = tfmdata.resources
+ local shared = tfmdata.shared
+ local filename = resources.filename
+ local features = shared.features
+ local descriptions = shared.rawdata.descriptions
+ local characters = tfmdata.characters
+ local featureset = { }
+ local copytochar = shared.copytochar -- indextounicode
+ local spacewidth = nil -- unscaled
+ local factor = tfmdata.parameters.factor
+ local marks = resources.marks or { }
+
+ -- could be shared but why care about a few extra tables
+
+ if not copytochar then
+ copytochar = { }
+ -- let's make sure that we have an indexed table and not a hash
+ local max = 0
+ for k, v in next, descriptions do
+ if v.index > max then
+ max = v.index
+ end
+ end
+ for i=0,max do
+ copytochar[i] = i
+ end
+ -- the normal mapper
+ for k, v in next, descriptions do
+ copytochar[v.index] = k
+ end
+ shared.copytochar = copytochar
+ end
+
+ -- independent from loop as we have unordered hashes
+
+ if descriptions[0x0020] then
+ spacewidth = descriptions[0x0020].width
+ elseif descriptions[0x00A0] then
+ spacewidth = descriptions[0x00A0].width
+ end
+
+ for k, v in sortedhash(features) do
+ if #k > 4 then
+ -- unknown ones are ignored anyway but we can assume that the current
+ -- (and future) extra context features use more verbose names
+ elseif skipped[k] then
+ -- we don't want to pass language and such so we block a few features
+ -- explicitly
+ elseif v == "yes" or v == true then
+ featureset[#featureset+1] = k .. "=1" -- cf command line (false)
+ elseif v == "no" or v == false then
+ featureset[#featureset+1] = k .. "=0" -- cf command line (true)
+ elseif type(v) == "number" then
+ featureset[#featureset+1] = k .. "=" .. v -- cf command line (alternate)
+ else
+ -- unset
+ end
+ end
+
+ local data = {
+ language = features.language, -- do we need to uppercase and padd to 4 ?
+ script = features.script, -- do we need to uppercase and padd to 4 ?
+ features = #featureset > 0 and concat(featureset,",") or "", -- hash
+ featureset = #featureset > 0 and featureset or nil,
+ copytochar = copytochar,
+ spacewidth = spacewidth,
+ filename = filename,
+ marks = marks,
+ factor = factor,
+ characters = characters, -- the loaded font (we use its metrics which is more accurate)
+ method = features.method or method,
+ shaper = features.shaper or shaper,
+ }
+ initialized[font] = data
+ return data
+end
+
+-- In many cases this gives compatible output but especially with respect to spacing and user
+-- discretionaries that mix fonts there can be different outcomes. We also have no possibility
+-- to tweak and cheat. Of course one can always run a normal node mode pass with specific
+-- features first but then one can as well do all in node mode. So .. after a bit of playing
+-- around I redid this one from scratch and also added tracing.
+
+local trace_colors = false trackers.register("fonts.plugins.hb.colors", function(v) trace_colors = v end)
+local trace_details = false trackers.register("fonts.plugins.hb.details",function(v) trace_details = v end)
+local check_id = false
+----- components = false -- we have no need for them
+
+local setcolor = function() end
+local resetcolor = function() end
+
+if context then
+ setcolor = nodes.tracers.colors.set
+ resetcolor = nodes.tracers.colors.reset
+end
+
+table.setmetatableindex(methods,function(t,k)
+ local l = "font-phb-imp-" .. k .. ".lua"
+ report("start loading method %a from %a",k,l)
+ dofile(resolvers.findfile(l))
+ local v = rawget(t,k)
+ if v then
+ report("loading method %a succeeded",k)
+ else
+ report("loading method %a failed",k)
+ v = function() return { } end
+ end
+ t[k] = v
+ return v
+end)
+
+local inandout do
+
+ local utfbyte = utf.byte
+ local utfchar = utf.char
+ local utf3208 = utf.utf32_to_utf8_le
+
+ inandout = function(text,result,first,last,copytochar)
+ local s = { }
+ local t = { }
+ local r = { }
+ local f = formatters["%05U"]
+ for i=1,#text do
+ local c = text[i]
+ -- t[#t+1] = f(utfbyte(utf3208(c)))
+ s[#s+1] = utfchar(c)
+ t[#t+1] = f(c)
+ end
+ for i=first,last do
+ r[#r+1] = f(copytochar[result[i][1]])
+ end
+ return s, t, r
+ end
+
+end
+
+local function harfbuzz(head,font,attr,rlmode,start,stop,text,leading,trailing)
+ local data = initialized[font]
+
+ if not data then
+ data = initialize(font)
+ end
+
+ if check_id then
+ if getid(start) ~= glyph_code then
+ report("error: start is not a glyph")
+ return head
+ elseif getid(stop) ~= glyph_code then
+ report("error: stop is not a glyph")
+ return head
+ end
+ end
+ local size = #text -- original text, without spaces
+ local result = methods[data.method](font,data,rlmode,text,leading,trailing)
+ local length = result and #result or 0
+
+ if length == 0 then
+ -- report("warning: no result")
+ return head
+ end
+
+ local factor = data.factor
+ local marks = data.marks
+ local spacewidth = data.spacewidth
+ local copytochar = data.copytochar
+ local characters = data.characters
+
+ -- the text analyzer is only partially clever so we must assume that we get
+ -- inconsistent lists
+
+ -- we could check if something has been done (replacement or kern or so) but
+ -- then we pass around more information and need to check a lot and spaces
+ -- are kind of spoiling that game (we need a different table then) .. more
+ -- pain than gain
+
+ -- we could play with 0xFFFE as boundary
+
+ local current = start
+ local prev = nil
+ local glyph = nil
+
+ local first = 1
+ local last = length
+ local next = nil -- todo: keep track of them
+ local prev = nil -- todo: keep track of them
+
+ if leading then
+ first = first + 1
+ end
+ if trailing then
+ last = last - 1
+ end
+
+ local position = first
+ local cluster = 0
+ local glyph = nil
+ local index = 0
+ local count = 1
+ -- local runner = nil
+ local saved = nil
+
+ if trace_details then
+ report("start run, original size: %i, result index: %i upto %i",size,first,last)
+ local s, t, r = inandout(text,result,first,last,copytochar)
+ report("method : %s",data.method)
+ report("shaper : %s",data.shaper)
+ report("string : %t",s)
+ report("text : % t",t)
+ report("result : % t",r)
+ end
+
+ -- okay, after some experiments, it became clear that more complex code aimed at
+ -- optimization doesn't pay off as complexity also demands more testing
+
+ for i=first,last do
+ local r = result[i]
+ local unicode = copytochar[r[1]] -- can be private of course
+ --
+ cluster = r[2] + 1 -- starts at zero
+ --
+ if position == cluster then
+ if i == first then
+ index = 1
+ if trace_details then
+ report("[%i] position: %i, cluster: %i, index: %i, starting",i,position,cluster,index)
+ end
+ else
+ index = index + 1
+ if trace_details then
+ report("[%i] position: %i, cluster: %i, index: %i, next step",i,position,cluster,index)
+ end
+ end
+ elseif position < cluster then
+ -- a new cluster
+ current = getnext(current)
+ position = position + 1
+ size = size - 1
+ -- if runner then
+ -- local h, t
+ -- if saved then
+ -- h = copy_node(runner)
+ -- if trace_colors then
+ -- resetcolor(h)
+ -- end
+ -- setchar(h,saved)
+ -- t = h
+ -- if trace_details then
+ -- report("[%i] position: %i, cluster: %i, index: -, initializing components",i,position,cluster)
+ -- end
+ -- else
+ -- h = getcomponents(runner)
+ -- t = find_tail(h)
+ -- end
+ -- for p=position,cluster-1 do
+ -- local n
+ -- head, current, n = remove_node(head,current)
+ -- setlink(t,n)
+ -- t = n
+ -- if trace_details then
+ -- report("[%i] position: %i, cluster: %i, index: -, moving node to components",i,p,cluster)
+ -- end
+ -- size = size - 1
+ -- end
+ -- if saved then
+ -- setcomponents(runner,h)
+ -- saved = false
+ -- end
+ -- else
+ for p=position,cluster-1 do
+ head, current = remove_node(head,current,true)
+ if trace_details then
+ report("[%i] position: %i, cluster: %i, index: -, removing node",i,p,cluster)
+ end
+ size = size - 1
+ end
+ -- end
+ position = cluster
+ index = 1
+ glyph = nil
+ if trace_details then
+ report("[%i] position: %i, cluster: %i, index: %i, arriving",i,cluster,position,index)
+ end
+ else -- maybe a space got properties
+ if trace_details then
+ report("position: %i, cluster: %i, index: %i, quitting due to fatal inconsistency",position,cluster,index)
+ end
+ return head
+ end
+ local copied = false
+ if glyph then
+ if trace_details then
+ report("[%i] position: %i, cluster: %i, index: %i, copying glyph, unicode %U",i,position,cluster,index,unicode)
+ end
+ local g = copy_node(glyph)
+ if trace_colors then
+ resetcolor(g)
+ end
+ setlink(current,g,getnext(current))
+ current = g
+ copied = true
+ else
+ if trace_details then
+ report("[%i] position: %i, cluster: %i, index: %i, using glyph, unicode %U",i,position,cluster,index,unicode)
+ end
+ glyph = current
+ end
+ --
+ if not current then
+ if trace_details then
+ report("quitting due to unexpected end of node list")
+ end
+ return head
+ end
+ --
+ local id = getid(current)
+ if id ~= glyph_code then
+ if trace_details then
+ report("glyph expected in node list")
+ end
+ return head
+ end
+ --
+ -- really, we can get a tab (9), lf (10), or cr(13) back in cambria .. don't ask me why
+ --
+ local prev, next = getboth(current)
+ --
+ -- assign glyph: first in run
+ --
+ -- if components and index == 1 then
+ -- runner = current
+ -- saved = getchar(current)
+ -- if saved ~= unicode then
+ -- setchar(current,unicode) -- small optimization
+ -- if trace_colors then
+ -- count = (count == 8) and 1 or count + 1
+ -- setcolor(current,"trace:"..count)
+ -- end
+ -- end
+ -- else
+ setchar(current,unicode)
+ if trace_colors then
+ count = (count == 8) and 1 or count + 1
+ setcolor(current,"trace:"..count)
+ end
+ -- end
+ --
+ local x_offset = r[3] -- r.dx
+ local y_offset = r[4] -- r.dy
+ local x_advance = r[5] -- r.ax
+ ----- y_advance = r[6] -- r.ay
+ local left = 0
+ local right = 0
+ local dx = 0
+ local dy = 0
+ if trace_details then
+ if x_offset ~= 0 or y_offset ~= 0 or x_advance ~= 0 then -- or y_advance ~= 0
+ report("[%i] position: %i, cluster: %i, index: %i, old, xoffset: %p, yoffset: %p, xadvance: %p, width: %p",
+ i,position,cluster,index,x_offset*factor,y_offset*factor,x_advance*factor,characters[unicode].width)
+ end
+ end
+ if y_offset ~= 0 then
+ dy = y_offset * factor
+ end
+ if rlmode >= 0 then
+ -- l2r marks and rest
+ if x_offset ~= 0 then
+ dx = x_offset * factor
+ end
+ local width = characters[unicode].width
+ local delta = x_advance * factor
+ if delta ~= width then
+ -- right = -(delta - width)
+ right = delta - width
+ end
+ elseif marks[unicode] then -- why not just the next loop
+ -- r2l marks
+ if x_offset ~= 0 then
+ dx = -x_offset * factor
+ end
+ else
+ -- r2l rest
+ local width = characters[unicode].width
+ local delta = (x_advance - x_offset) * factor
+ if delta ~= width then
+ left = delta - width
+ end
+ if x_offset ~= 0 then
+ right = x_offset * factor
+ end
+ end
+ if copied or dx ~= 0 or dy ~= 0 then
+ setoffsets(current,dx,dy)
+ end
+ if left ~= 0 then
+ setlink(prev,new_kern(left),current) -- insertbefore
+ if current == head then
+ head = prev
+ end
+ end
+ if right ~= 0 then
+ local kern = new_kern(right)
+ setlink(current,kern,next)
+ current = kern
+ end
+ if trace_details then
+ if dy ~= 0 or dx ~= 0 or left ~= 0 or right ~= 0 then
+ report("[%i] position: %i, cluster: %i, index: %i, new, xoffset: %p, yoffset: %p, left: %p, right: %p",i,position,cluster,index,dx,dy,left,right)
+ end
+ end
+ end
+ --
+ if trace_details then
+ report("[-] position: %i, cluster: %i, index: -, at end",position,cluster)
+ end
+ if size > 1 then
+ current = getnext(current)
+ -- if runner then
+ -- local h, t
+ -- if saved then
+ -- h = copy_node(runner)
+ -- if trace_colors then
+ -- resetcolor(h)
+ -- end
+ -- setchar(h,saved)
+ -- t = h
+ -- if trace_details then
+ -- report("[-] position: %i, cluster: -, index: -, initializing components",position)
+ -- end
+ -- else
+ -- h = getcomponents(runner)
+ -- t = find_tail(h)
+ -- end
+ -- for i=1,size-1 do
+ -- if trace_details then
+ -- report("[-] position: %i + %i, cluster: -, index: -, moving node to components",position,i)
+ -- end
+ -- local n
+ -- head, current, n = remove_node(head,current,true)
+ -- setlink(t,n)
+ -- t = n
+ -- end
+ -- if saved then
+ -- setcomponents(runner,h)
+ -- saved = false
+ -- end
+ -- else
+ for i=1,size-1 do
+ if trace_details then
+ report("[-] position: %i + %i, cluster: -, index: -, removing node",position,i)
+ end
+ head, current = remove_node(head,current,true)
+ end
+ -- end
+ end
+ --
+ -- We see all kind of interesting spaces come back (like tabs in cambria) so we do a bit of
+ -- extra testing here.
+ --
+ if leading then
+ local r = result[1]
+ local unicode = copytochar[r[1]]
+ if seenspaces[unicode] then
+ local x_advance = r[5]
+ local delta = x_advance - spacewidth
+ if delta ~= 0 then
+ -- nothing to do but jump one slot ahead
+ local prev = getprev(start)
+ if getid(prev) == glue_code then
+ local dx = delta * factor
+ setwidth(prev,getwidth(prev) + dx)
+ if trace_details then
+ report("compensating leading glue by %p due to codepoint %U",dx,unicode)
+ end
+ else
+ report("no valid leading glue node")
+ end
+ end
+ end
+ end
+ --
+ if trailing then
+ local r = result[length]
+ local unicode = copytochar[r[1]]
+ if seenspaces[unicode] then
+ local x_advance = r[5]
+ local delta = x_advance - spacewidth
+ if delta ~= 0 then
+ local next = getnext(stop)
+ if getid(next) == glue_code then
+ local dx = delta * factor
+ setwidth(next,getwidth(next) + dx)
+ if trace_details then
+ report("compensating trailing glue by %p due to codepoint %U",dx,unicode)
+ end
+ else
+ report("no valid trailing glue node")
+ end
+ end
+ end
+ end
+ --
+ if trace_details then
+ report("run done")
+ end
+ return head
+end
+
+otf.registerplugin("harfbuzz",function(head,font,attr,direction)
+ return texthandler(head,font,attr,direction,harfbuzz)
+end)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-pre.mkiv b/Master/texmf-dist/tex/context/base/mkiv/font-pre.mkiv
index 445dedd2543..91a2e818eb7 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-pre.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-pre.mkiv
@@ -401,10 +401,11 @@
% liga=yes, % makes no sense
% tlig=yes, % makes no sense
% trep=yes, % makes no sense
- mathnolimitsmode={0,800}, % this looks okay on the average font
+ % mathnolimitsmode={0,800}, % this looks okay on the average font
mathalternates=yes,
- mathitalics=yes, % we pass them
- mathdimensions=all,
+ emulatelmtx=yes,
+ % mathitalics=yes, % we pass them
+ % mathdimensions=all,
% mathkerns=yes,
% mathgaps=yes,
language=dflt,
@@ -416,10 +417,14 @@
% [oldmath]
% [oldmath=yes]
-\ifdefined\mathnolimitsmode
- \mathnolimitsmode\plusone % font driven (only opentype)
+\ifdefined\variablefam
+ \variablefam\pluscclv
\fi
+% \ifdefined\mathnolimitsmode
+% \mathnolimitsmode\plusone % font driven (only opentype)
+% \fi
+
\ifdefined\mathitalicsmode
\mathitalicsmode\plusone % simple noads become zero
% \mathitalicsmode\plustwo % idem but inner is kept (for testing)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-prv.lua b/Master/texmf-dist/tex/context/base/mkiv/font-prv.lua
index 15057e2554e..59b793444d8 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-prv.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-prv.lua
@@ -39,6 +39,8 @@ local sharedprivates = setmetatableindex(function(t,k)
return v
end)
+fonts.helpers.sharedprivates = sharedprivates
+
function helpers.addprivate(tfmdata,name,characterdata)
local properties = tfmdata.properties
local characters = tfmdata.characters
@@ -81,6 +83,22 @@ function helpers.newprivateslot(name)
return sharedprivates[name]
end
+function helpers.isprivate(unicode)
+ if unicode < 0xD7FF or (unicode > 0xDFFF and unicode <= 0xFFFF) then
+ return false
+ elseif unicode >= 0x00E000 and unicode <= 0x00F8FF then
+ return true
+ elseif unicode >= 0x0F0000 and unicode <= 0x0FFFFF then
+ return true
+ elseif unicode >= 0x100000 and unicode <= 0x10FFFF then
+ return true
+ elseif unicode >= 0x00D800 and unicode <= 0x00DFFF then
+ return true
+ else
+ return false
+ end
+end
+
do
local context = context
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-sel.lua b/Master/texmf-dist/tex/context/base/mkiv/font-sel.lua
index 9a611f9faa3..ab6297f40aa 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-sel.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-sel.lua
@@ -77,19 +77,24 @@ local report_typescript = logs.reporter("selectfont","typescripts")
defaults["rm"] = { features = { ["sc"] = "*,f:smallcaps" } }
defaults["ss"] = { features = { ["sc"] = "*,f:smallcaps" } }
-defaults["asanamath"] = { options = { extras = "asana-math", features = "math\\mathsizesuffix", goodies = "anana-math" } }
-defaults["cambriamath"] = { options = { extras = "cambria-math", features = "math\\mathsizesuffix", goodies = "cambria-math" } }
-defaults["dejavumath"] = { options = { extras = "dejavu", features = "math\\mathsizesuffix" } }
-defaults["neoeuler"] = { options = { extras = "euler-math", features = "math\\mathsizesuffix" } }
-defaults["latinmodernmath"] = { options = { extras = "lm,lm-math", features = "math\\mathsizesuffix,lm-math", goodies = "lm" } }
-defaults["lucidabrightmathot"] = { options = { extras = "lucida-opentype-math", features = "math\\mathsizesuffix", goodies = "lucida-opentype-math" } }
-defaults["minionmath"] = { options = { extras = "minion-math", features = "math\\mathsizesuffix", goodies = "minion-math" } }
-defaults["texgyredejavumath"] = { options = { extras = "dejavu", features = "math\\mathsizesuffix" } }
-defaults["texgyrepagellamath"] = { options = { extras = "texgyre", features = "math\\mathsizesuffix" } }
-defaults["texgyrebonummath"] = { options = { extras = "texgyre", features = "math\\mathsizesuffix" } }
-defaults["texgyrescholamath"] = { options = { extras = "texgyre", features = "math\\mathsizesuffix" } }
-defaults["texgyretermesmath"] = { options = { extras = "texgyre", features = "math\\mathsizesuffix" } }
-defaults["xitsmath"] = { options = { extras = "xits-math", features = "math\\mathsizesuffix", goodies = "xits-math" } }
+-- WS: we need to check the extras with the typescripts
+
+defaults["asanamath"] = { options = { extras = "asana-math", features = "math\\mathsizesuffix,mathextra", goodies = "anana-math" } }
+defaults["cambriamath"] = { options = { extras = "cambria-math", features = "math\\mathsizesuffix,mathextra", goodies = "cambria-math" } }
+defaults["euler"] = { options = { extras = "euler-math", features = "math\\mathsizesuffix,mathextra", goodies = "euler-math" } }
+defaults["latinmodernmath"] = { options = { extras = "lm,lm-math", features = "math\\mathsizesuffix,mathextra,lm-math", goodies = "modern" } }
+defaults["lucidabrightmathot"] = { options = { extras = "lucida-opentype-math", features = "math\\mathsizesuffix,mathextra", goodies = "lucida-math" } }
+defaults["minionmath"] = { options = { extras = "minion-math", features = "math\\mathsizesuffix,mathextra", goodies = "minion-math" } }
+defaults["stixtwomath"] = { options = { extras = "stix-two-math", features = "math\\mathsizesuffix,mathextra", goodies = "stixtwo-math" } }
+defaults["texgyredejavumath"] = { options = { extras = "dejavu", features = "math\\mathsizesuffix,mathextra", goodies = "dejavu-math" } }
+defaults["texgyrepagellamath"] = { options = { extras = "texgyre", features = "math\\mathsizesuffix,mathextra", goodies = "pagella-math" } }
+defaults["texgyrebonummath"] = { options = { extras = "texgyre", features = "math\\mathsizesuffix,mathextra", goodies = "bonum-math" } }
+defaults["texgyrescholamath"] = { options = { extras = "texgyre", features = "math\\mathsizesuffix,mathextra", goodies = "schola-math" } }
+defaults["texgyretermesmath"] = { options = { extras = "texgyre", features = "math\\mathsizesuffix,mathextra", goodies = "termes-math" } }
+defaults["xitsmath"] = { options = { extras = "xits-math", features = "math\\mathsizesuffix,mathextra", goodies = "xits-math" } }
+
+defaults["neoeuler"] = defaults["euler"]
+defaults["dejavumath"] = defaults["texgyredejavumath"]
extras["features"] = function(data,alternative,features)
local d = data.options.features
@@ -466,7 +471,12 @@ function selectfont.registerfiles(index)
argument = method
method = "name"
end
- (extras[method] or methods[method] or methods[v_default])(data,alternative,argument)
+ if #entries == 1 and method == "features" then
+ extras["features"](data,alternative,argument)
+ methods[v_default](data,alternative)
+ else
+ (extras[method] or methods[method] or methods[v_default])(data,alternative,argument)
+ end
end
else
methods[v_default](data,alternative)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-shp.lua b/Master/texmf-dist/tex/context/base/mkiv/font-shp.lua
index 78e8597b937..197a3f1ccb0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-shp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-shp.lua
@@ -17,7 +17,7 @@ local pfb = fonts.handlers.pfb
local hashes = fonts.hashes
local identifiers = hashes.identifiers
-local version = 0.009
+local version = otf.version or 0.015
local shapescache = containers.define("fonts", "shapes", version, true)
local streamscache = containers.define("fonts", "streams", version, true)
@@ -150,6 +150,8 @@ end
local readers = otf.readers
local cleanname = otf.readers.helpers.cleanname
+-- todo: shared hash for this but not accessed often
+
local function makehash(filename,sub,instance)
local name = cleanname(file.basename(filename))
if instance then
@@ -234,17 +236,21 @@ local function loadstreams(cache,filename,sub,instance)
if data then
local glyphs = data.glyphs
local streams = { }
+ -- local widths = { }
if glyphs then
for i=0,#glyphs do
local glyph = glyphs[i]
if glyph then
streams[i] = glyph.stream or ""
+ -- widths [i] = glyph.width or 0
else
streams[i] = ""
+ -- widths [i] = 0
end
end
end
data.streams = streams
+ -- data.widths = widths -- maybe more reliable!
data.glyphs = nil
data.size = size
data.format = data.format or (kind == "otf" and "opentype") or "truetype"
@@ -259,8 +265,11 @@ local function loadstreams(cache,filename,sub,instance)
local names, encoding, streams, metadata = pfb.loadvector(filename,false,true)
if streams then
local fontbbox = metadata.fontbbox or { 0, 0, 0, 0 }
+ -- local widths = { }
for i=0,#streams do
- streams[i] = streams[i].stream or "\14"
+ local s = streams[i]
+ streams[i] = s.stream or "\14"
+ -- widths [i] = s.width or 0
end
data = {
filename = filename,
@@ -268,6 +277,7 @@ local function loadstreams(cache,filename,sub,instance)
time = time,
format = "type1",
streams = streams,
+ -- widths = widths,
fontheader = {
fontversion = metadata.version,
units = 1000, -- can this be different?
@@ -346,7 +356,8 @@ local function getstreamhash(fontid)
local fontdata = identifiers[fontid]
if fontdata then
local properties = fontdata.properties
- return makehash(properties.filename,properties.subfont,properties.instance)
+ local fonthash = makehash(properties.filename,properties.subfont,properties.instance)
+ return fonthash, fontdata
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-sol.lua b/Master/texmf-dist/tex/context/base/mkiv/font-sol.lua
index c618739959f..b3b514a16b7 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-sol.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-sol.lua
@@ -75,14 +75,14 @@ local setnext = nuts.setnext
local setlist = nuts.setlist
local find_node_tail = nuts.tail
-local flush_node = nuts.flush_node
-local flush_node_list = nuts.flush_list
-local copy_node_list = nuts.copy_list
+local flushnode = nuts.flushnode
+local flushnodelist = nuts.flushlist
+local copy_node_list = nuts.copylist
local hpack_nodes = nuts.hpack
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
-local protect_glyphs = nuts.protect_glyphs
-local start_of_par = nuts.start_of_par
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
+local protectglyphs = nuts.protectglyphs
+local startofpar = nuts.startofpar
local nextnode = nuts.traversers.next
local nexthlist = nuts.traversers.hlist
@@ -92,7 +92,7 @@ local repack_hlist = nuts.repackhlist
local nodes_to_utf = nodes.listtoutf
------ protect_glyphs = nodes.handlers.protectglyphs
+----- protectglyphs = nodes.handlers.protectglyphs
local setnodecolor = nodes.tracers.colors.set
@@ -367,8 +367,8 @@ function splitters.split(head) -- best also pass the direction
if encapsulate then
local user_one = new_usernode(splitter_one,n)
local user_two = new_usernode(splitter_two,n)
- head, start = insert_node_before(head,start,user_one)
- insert_node_after(head,stop,user_two)
+ head, start = insertnodebefore(head,start,user_one)
+ insertnodeafter(head,stop,user_two)
else
local current = start
while true do
@@ -437,7 +437,7 @@ function splitters.split(head) -- best also pass the direction
end
local direction, pop = getdirection(current)
r2l = not pop and direction == righttoleft_code
- elseif id == par_code and start_of_par(current) then
+ elseif id == par_code and startofpar(current) then
if start then
flush() -- very unlikely as this starts a paragraph
end
@@ -636,7 +636,7 @@ local function doit(word,list,best,width,badness,line,set,listdir)
if getid(first) == whatsit_code then
local temp = first
first = getnext(first)
- flush_node(temp)
+ flushnode(temp)
end
local last = find_node_tail(first)
-- replace [u]h->t by [u]first->last
@@ -660,14 +660,14 @@ local function doit(word,list,best,width,badness,line,set,listdir)
setnext(t)
end
setnext(last)
- flush_node_list(first)
+ flushnodelist(first)
else
if trace_optimize then
report_optimizers("line %a, set %a, badness before: %a, after %a, criterium %a, verdict %a",line,set or "?",badness,b,criterium,"continue")
end
-- free old h->t
setnext(t)
- flush_node_list(h) -- somehow fails
+ flushnodelist(h) -- somehow fails
if not encapsulate then
word[2] = first
word[3] = last
@@ -784,7 +784,7 @@ function splitters.optimize(head)
if not encapsulate and getid(list) == glyph_code then
-- nasty .. we always assume a prev being there .. future luatex will always have a leftskip set
-- is this assignment ok ? .. needs checking
- list = insert_node_before(list,list,new_leftskip(0)) -- new_glue(0)
+ list = insertnodebefore(list,list,new_leftskip(0)) -- new_glue(0)
setlist(current,list)
end
local temp, badness = repack_hlist(list,width,"exactly",direction) -- it would be nice if the badness was stored in the node
@@ -813,7 +813,7 @@ function splitters.optimize(head)
local bb, base
for i=1,max do
if base then
- flush_node_list(base)
+ flushnodelist(base)
end
base = copy_node_list(list)
local words = collect_words(base) -- beware: words is adapted
@@ -841,7 +841,7 @@ function splitters.optimize(head)
break
end
end
- flush_node_list(base)
+ flushnodelist(base)
end
local words = collect_words(list)
for best=lastbest or 1,max do
@@ -852,7 +852,7 @@ function splitters.optimize(head)
end
if done then
if b <= criterium then -- was == 0
- protect_glyphs(list)
+ protectglyphs(list)
break
end
end
@@ -869,7 +869,7 @@ function splitters.optimize(head)
end
for i=1,nc do
local ci = cache[i]
- flush_node_list(ci.original)
+ flushnodelist(ci.original)
end
cache = { }
tex.hbadness = tex_hbadness
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-syn.lua b/Master/texmf-dist/tex/context/base/mkiv/font-syn.lua
index 1d5e1803243..e80d57f4146 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-syn.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-syn.lua
@@ -1408,13 +1408,30 @@ here is for testing purposes only (it deals with names prefixed by an
encoding name).</p>
--ldx]]--
-local function fuzzy(mapping,sorted,name,sub)
+local function fuzzy(mapping,sorted,name,sub) -- no need for reverse sorted here
local condensed = gsub(name,"[^%a%d]","")
+ local pattern = condensed .. "$"
+ local matches = false
for k=1,#sorted do
local v = sorted[k]
- if find(v,condensed) then
+ if v == condensed then
return mapping[v], v
+ elseif find(v,pattern) then
+ return mapping[v], v
+ elseif find(v,condensed) then
+ if matches then
+ matches[#matches+1] = v
+ else
+ matches = { v }
+ end
+ end
+ end
+ if matches then
+ if #matches > 1 then
+ sort(matches,function(a,b) return #a < #b end)
end
+ matches = matches[1]
+ return mapping[matches], matches
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-ttf.lua b/Master/texmf-dist/tex/context/base/mkiv/font-ttf.lua
index a2732aa5f2e..1fee9fa88d9 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/font-ttf.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-ttf.lua
@@ -35,7 +35,7 @@ if not modules then modules = { } end modules ['font-ttf'] = {
local next, type, unpack = next, type, unpack
local band, rshift = bit32.band, bit32.rshift
-local sqrt, round = math.sqrt, math.round
+local sqrt, round, abs, min, max = math.sqrt, math.round, math.abs, math.min, math.max
local char, rep = string.char, string.rep
local concat = table.concat
local idiv = number.idiv
@@ -136,8 +136,12 @@ local function mergecomposites(glyphs,shapes)
local y = p[2]
nofpoints = nofpoints + 1
points[nofpoints] = {
+ -- unifractur : u n
+ -- seguiemj : 0x270E 0x2710
xscale * x + xrotate * y + xoffset,
yscale * y + yrotate * x + yoffset,
+-- xscale * x + yrotate * y + xoffset,
+-- xrotate * x + yscale * y + yoffset,
p[3]
}
end
@@ -203,77 +207,220 @@ end
-- We had two loops (going backward) but can do it in one loop .. but maybe we
-- should only accept fonts with proper hvar tables.
+-- dowidth is kind of hack ... fonts are not always ok wrt these extra points
+
+local xv = { } -- we share this cache
+local yv = { } -- we share this cache
+
local function applyaxis(glyph,shape,deltas,dowidth)
local points = shape.points
if points then
local nofpoints = #points
- local h = nofpoints + 2 -- weird, the example font seems to have left first
- local l = nofpoints + 1
- ----- v = nofpoints + 3
- ----- t = nofpoints + 4
local dw = 0
local dl = 0
for i=1,#deltas do
local deltaset = deltas[i]
local xvalues = deltaset.xvalues
local yvalues = deltaset.yvalues
- local dpoints = deltaset.points
- local factor = deltaset.factor
- if dpoints then
- -- todo: interpolate
- local nofdpoints = #dpoints
- for i=1,nofdpoints do
- local d = dpoints[i]
- local p = points[d]
- if p then
- if xvalues then
- local x = xvalues[i]
- if x and x ~= 0 then
- p[1] = p[1] + factor * x
- end
- end
- if yvalues then
- local y = yvalues[i]
- if y and y ~= 0 then
- p[2] = p[2] + factor * y
+ if xvalues and yvalues then
+ local dpoints = deltaset.points
+ local factor = deltaset.factor
+ if dpoints then
+ local cnt = #dpoints
+ if dowidth then
+ cnt = cnt - 4
+ end
+ if cnt > 0 then
+ -- Not the most efficient solution but we seldom do this. We
+ -- actually need to avoid the extra points here but I'll deal
+ -- with that when needed.
+ local contours = shape.contours
+ local nofcontours = #contours
+ local first = 1
+ local firstindex = 1
+ for contour=1,nofcontours do
+ local last = contours[contour]
+ if last >= first then
+ local lastindex = cnt
+ if firstindex < cnt then
+ for currentindex=firstindex,cnt do
+ local found = dpoints[currentindex]
+ if found <= first then
+ firstindex = currentindex
+ end
+ if found == last then
+ lastindex = currentindex
+ break
+ elseif found > last then
+ -- \definefontfeature[book][default][axis={weight=800}]
+ -- \definefont[testfont][file:Commissioner-vf-test.ttf*book]
+ -- \testfont EΘÄΞ
+ while lastindex > 1 and dpoints[lastindex] > last do
+ lastindex = lastindex - 1
+ end
+ --
+ break
+ end
+ end
+ end
+ -- print("unicode: ",glyph.unicode or "?")
+ -- print("contour: ",first,contour,last)
+ -- print("index : ",firstindex,lastindex,cnt)
+ -- print("points : ",dpoints[firstindex],dpoints[lastindex])
+ local function find(i)
+ local prv = lastindex
+ for j=firstindex,lastindex do
+ local nxt = dpoints[j] -- we could save this lookup when we return it
+ if nxt == i then
+ return false, j, false
+ elseif nxt > i then
+ return prv, false, j
+ end
+ prv = j
+ end
+ return prv, false, firstindex
+ end
+ -- We need the first and last points untouched so we first
+ -- collect data.
+ for point=first,last do
+ local d1, d2, d3 = find(point)
+ local p2 = points[point]
+ if d2 then
+ xv[point] = xvalues[d2]
+ yv[point] = yvalues[d2]
+ else
+ local n1 = dpoints[d1]
+ local n3 = dpoints[d3]
+ -- Some day I need to figure out these extra points but
+ -- I'll wait till the standard is more clear and fonts
+ -- become better (ntg-context: fraunces.ttf > abcdef).
+ if n1 > nofpoints then
+ n1 = nofpoints
+ end
+ if n3 > nofpoints then
+ n3 = nofpoints
+ end
+ --
+ local p1 = points[n1]
+ local p3 = points[n3]
+ local p1x = p1[1]
+ local p2x = p2[1]
+ local p3x = p3[1]
+ local p1y = p1[2]
+ local p2y = p2[2]
+ local p3y = p3[2]
+ local x1 = xvalues[d1]
+ local y1 = yvalues[d1]
+ local x3 = xvalues[d3]
+ local y3 = yvalues[d3]
+ --
+ local fx
+ local fy
+ --
+ if p1x == p3x then
+ if x1 == x3 then
+ fx = x1
+ else
+ fx = 0
+ end
+ elseif p2x <= min(p1x,p3x) then
+ if p1x < p3x then
+ fx = x1
+ else
+ fx = x3
+ end
+ elseif p2x >= max(p1x,p3x) then
+ if p1x > p3x then
+ fx = x1
+ else
+ fx = x3
+ end
+ else
+ fx = (p2x - p1x)/(p3x - p1x)
+-- fx = round(fx)
+ fx = (1 - fx) * x1 + fx * x3
+ end
+ --
+ if p1y == p3y then
+ if y1 == y3 then
+ fy = y1
+ else
+ fy = 0
+ end
+ elseif p2y <= min(p1y,p3y) then
+ if p1y < p3y then
+ fy = y1
+ else
+ fy = y3
+ end
+ elseif p2y >= max(p1y,p3y) then
+ if p1y > p3y then
+ fy = y1
+ else
+ fy = y3
+ end
+ else
+ fy = (p2y - p1y)/(p3y - p1y)
+-- fy = round(fy)
+ fy = (1 - fy) * y1 + fy * y3
+ end
+ -- -- maybe:
+ -- if p1y ~= p3y then
+ -- fy = (p2y - p1y)/(p3y - p1y)
+ -- fy = (1 - fy) * y1 + fy * y3
+ -- elseif abs(p1y-p2y) < abs(p3y-p2y) then
+ -- fy = y1
+ -- else
+ -- fy = y3
+ -- end
+ --
+ xv[point] = fx
+ yv[point] = fy
+ end
+ end
+ if lastindex < cnt then
+ firstindex = lastindex + 1
+ end
end
+ first = last + 1
end
- elseif dowidth then
- -- we've now ran into phantom points which is a bit fuzzy because:
- -- are there gaps in there?
- --
- -- todo: move this outside the loop (when we can be sure of all 4 being there)
- if d == h then
- -- we have a phantom point hadvance
- local x = xvalues[i]
- if x then
- dw = dw + factor * x
+
+ for i=1,nofpoints do
+ local pi = points[i]
+ local fx = xv[i]
+ local fy = yv[i]
+ if fx ~= 0 then
+ pi[1] = pi[1] + factor * fx
end
- elseif d == l then
- local x = xvalues[i]
- if x then
- dl = dl + factor * x
+ if fy ~= 0 then
+ pi[2] = pi[2] + factor * fy
end
end
+ else
+ report("bad deltapoint data, maybe a missing hvar table")
end
- end
- else
- for i=1,nofpoints do
- local p = points[i]
- if xvalues then
+ else
+ for i=1,nofpoints do
+ local p = points[i]
local x = xvalues[i]
- if x and x ~= 0 then
- p[1] = p[1] + factor * x
- end
- end
- if yvalues then
- local y = yvalues[i]
- if y and y ~= 0 then
- p[2] = p[2] + factor * y
+ if x then
+ local y = yvalues[i]
+ if x ~= 0 then
+ p[1] = p[1] + factor * x
+ end
+ if y ~= 0 then
+ p[2] = p[2] + factor * y
+ end
+ else
+ break
end
end
end
if dowidth then
+ local h = nofpoints + 2 -- weird, the example font seems to have left first
+ local l = nofpoints + 1
+ ----- v = nofpoints + 3
+ ----- t = nofpoints + 4
local x = xvalues[h]
if x then
dw = dw + factor * x
@@ -618,6 +765,18 @@ local function contours2outlines_shaped(glyphs,shapes,keepcurve)
end
first = last + 1
end
+ -- See readers.hvar where we set the delta lsb as well as the adapted
+ -- width. At this point we do know the boundingbox's llx. The xmax is
+ -- not that relevant. It needs more testing!
+ --
+ xmin = glyph.boundingbox[1]
+ --
+ local dlsb = glyph.dlsb
+ if dlsb then
+ xmin = xmin + dlsb
+ glyph.dlsb = nil -- save space
+ end
+ --
glyph.boundingbox = { round(xmin), round(ymin), round(xmax), round(ymax) }
end
end
@@ -829,8 +988,8 @@ local function readglyph(f,nofcontours) -- read deltas here, saves space
local x = 0
for i=1,nofpoints do
local flag = flags[i]
- -- local short = band(flag,0x04) ~= 0
- -- local same = band(flag,0x20) ~= 0
+ -- local short = band(flag,0x02) ~= 0
+ -- local same = band(flag,0x10) ~= 0
if band(flag,0x02) ~= 0 then
if band(flag,0x10) ~= 0 then
x = x + readbyte(f)
@@ -930,13 +1089,13 @@ local function readcomposite(f)
yoffset = yoffset * yscale
end
elseif band(flags,0x0080) ~= 0 then -- f_matrix
- xscale = read2dot14(f)
- xrotate = read2dot14(f)
- yrotate = read2dot14(f)
- yscale = read2dot14(f)
+ xscale = read2dot14(f) -- xxpart
+ xrotate = read2dot14(f) -- yxpart
+ yrotate = read2dot14(f) -- xypart
+ yscale = read2dot14(f) -- yypart
if f_xyarg and f_offset then
- xoffset = xoffset * sqrt(xscale ^2 + xrotate^2)
- yoffset = yoffset * sqrt(yrotate^2 + yscale ^2)
+ xoffset = xoffset * sqrt(xscale ^2 + yrotate^2) -- was xrotate
+ yoffset = yoffset * sqrt(xrotate^2 + yscale ^2) -- was yrotate
end
end
nofcomponents = nofcomponents + 1
@@ -1119,50 +1278,6 @@ end
local function readdeltas(f,nofpoints)
local deltas = { }
local p = 0
- local z = 0
- while nofpoints > 0 do
- local control = readbyte(f)
-if not control then
- break
-end
- local allzero = band(control,0x80) ~= 0
- local runlength = band(control,0x3F) + 1
- if allzero then
- z = z + runlength
- else
- local runreader = band(control,0x40) ~= 0 and readshort or readinteger
- if z > 0 then
- for i=1,z do
- p = p + 1
- deltas[p] = 0
- end
- z = 0
- end
- for i=1,runlength do
- p = p + 1
- deltas[p] = runreader(f)
- end
- end
- nofpoints = nofpoints - runlength
- end
- -- saves space
--- if z > 0 then
--- for i=1,z do
--- p = p + 1
--- deltas[p] = 0
--- end
--- end
- if p > 0 then
- -- forget about trailing zeros
- return deltas
- else
- -- forget about all zeros
- end
-end
-
-local function readdeltas(f,nofpoints)
- local deltas = { }
- local p = 0
while nofpoints > 0 do
local control = readbyte(f)
if control then
@@ -1330,7 +1445,8 @@ function readers.gvar(f,fontdata,specification,glyphdata,shapedata)
-- local start = start and start[i] or 0
-- local stop = stop and stop [i] or 0
local start = start and start[i] or (peak < 0 and peak or 0)
- local stop = stop and stop [i] or (peak > 0 and peak or 0)
+ local stop = stop and stop [i] or (peak > 0 and peak or 0) -- or 1 ?
+-- local stop = stop and stop [i] or (peak > 0 and peak or 1) -- or 1 ?
-- do we really need these tests ... can't we assume sane values
if start > peak or peak > stop then
-- * 1
@@ -1343,7 +1459,6 @@ function readers.gvar(f,fontdata,specification,glyphdata,shapedata)
s = 0
break
elseif f < peak then
--- s = - s * (f - start) / (peak - start)
s = s * (f - start) / (peak - start)
elseif f > peak then
s = s * (stop - f) / (stop - peak)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-txt.lua b/Master/texmf-dist/tex/context/base/mkiv/font-txt.lua
new file mode 100644
index 00000000000..b8614c8f565
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/font-txt.lua
@@ -0,0 +1,553 @@
+if not modules then modules = { } end modules ['font-txt'] = {
+ version = 1.001,
+ comment = "companion to font-ini.mkiv",
+ original = "derived from a prototype by Kai Eigner",
+ author = "Hans Hagen", -- so don't blame KE
+ copyright = "TAT Zetwerk / PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- The next code is derived from a snippet handler prototype by Kai Eigner and
+-- resembles the main loop of the Lua font handler but I decided use a more generic
+-- (and pluggable) approach and not hook it into the already present opentype
+-- handler. This is cleaner as it cannot interfere with the Lua font processor
+-- (which does some more things) and is also better performance wise. It also makes
+-- it possible to support other handlers as history has proven that there are no
+-- universal solution in computer land. Most of the disc logic is kept but done
+-- slightly different.
+--
+-- The code is heavily optimized and generalized so there can be errors. As
+-- mentioned, the plug mode can be used for alternative font handlers. A font is
+-- still loaded but the node and base mode handlers are ignored. Plugins are
+-- unlikely to work well in context as they can mess up attribute driven subsystem,
+-- so they are not officially supported. The language and script options are
+-- available in the usual way.
+--
+-- The code collects snippets, either or not with spacing around them and partially
+-- running over disc nodes. The r2l "don't assume disc and collect larger chunks" is
+-- not robust so I got rid of that branch. This is somewhat similar to the Lua font
+-- handler.
+--
+-- An alternative is to run over longer strings with dummy chars (unicode objects) as
+-- markers for whatever is in the list but that becomes tricky with mixed fonts and
+-- reconstruction becomes a bit of a mess then, especially because disc nodes force
+-- us to backtrack and look at several solutions. It also has a larger memory
+-- footprint. Some tests demonstrated that it has no gain and only adds complexity.
+--
+-- This (derived) variant is better suited for context and seems to work ok in the
+-- generic variant. I also added some context specific tracing to the code. This
+-- variant uses the plug model provided in the context font system. So, in context,
+-- using the built in Lua handler is the better alternative, also because it has
+-- extensive tracing features. Context users would loose additional functionality
+-- that has been provided for a decade and therefore plugins are not officially
+-- supported (at least not by me, unless I use them myself).
+--
+-- There is no checking here for already processed characters so best not mix this
+-- variant with code that does similar things. If this code evolves depends on the
+-- useability. Kai's code can now be found on github where it is used with a harfbuzz
+-- library. We add this kind of stuff because occasionally we compare engines and
+-- Kai sends me examples and I then need to check context.
+--
+-- One important difference between Kai's approach and the one used in ConTeXt is
+-- that we use utf-32 instead of utf-8. Once I figured out that clusters were just
+-- indices into the original text that made more sense. The first implementation
+-- used the command line tool (binary), then I went for ffi (library).
+--
+-- Beware: this file only implements the framework for plugins. Plugins themselves
+-- are in other files (e.g. font-phb*.lua). On the todo list is a uniscribe plugin
+-- because that is after all the reference for opentype support, but that interface
+-- needs a bit more work (so it might never happen).
+--
+-- Usage: see m-fonts-plugins.mkiv. As it's a nice test for ffi support that file
+-- migth be added to the distribution somewhere in the middle of 2017 when the ffi
+-- interface has been tested a bit more. Okay, it's 2012 now and we're way past that
+-- date but we never had a reason for adding it to the ConTeXt distribution. It
+-- should still work okay because I occasionally checked it against progress made in
+-- the engines and used newer helpers.
+--
+-- Here is an example of usage:
+--
+-- \starttext
+-- \definefontfeature[test][mode=plug,features=text]
+-- \start
+-- \showfontkerns
+-- \definedfont[Serif*test]
+-- \input tufte \par
+-- \stop
+-- \stoptext
+
+local fonts = fonts
+local otf = fonts.handlers.otf
+local nodes = nodes
+
+local utfchar = utf.char
+
+local nuts = nodes.nuts
+
+local getnext = nuts.getnext
+local setnext = nuts.setnext
+local getprev = nuts.getprev
+local setprev = nuts.setprev
+local getid = nuts.getid
+local getsubtype = nuts.getsubtype
+local getfont = nuts.getfont
+local getchar = nuts.getchar
+local getdisc = nuts.getdisc
+local setdisc = nuts.setdisc
+local getboth = nuts.getboth
+local setlink = nuts.setlink
+local getkern = nuts.getkern
+local getwidth = nuts.getwidth
+
+local ischar = nuts.ischar
+local isglyph = nuts.isglyph
+local usesfont = nuts.usesfont
+
+local copy_node_list = nuts.copylist
+local find_node_tail = nuts.tail
+local flushlist = nuts.flushlist
+local freenode = nuts.free
+local endofmath = nuts.endofmath
+
+local startofpar = nuts.startofpar
+
+local nodecodes = nodes.nodecodes
+
+local glyph_code = nodecodes.glyph
+local glue_code = nodecodes.glue
+local disc_code = nodecodes.disc
+local kern_code = nodecodes.kern
+local math_code = nodecodes.math
+local dir_code = nodecodes.dir
+local par_code = nodecodes.par
+
+local righttoleft_code = nodes.dirvalues.righttoleft
+
+local txtdirstate = otf.helpers.txtdirstate
+local pardirstate = otf.helpers.pardirstate
+
+local fonthashes = fonts.hashes
+local fontdata = fonthashes.identifiers
+
+local function deletedisc(head)
+ local current = head
+ local next = nil
+ while current do
+ next = getnext(current)
+ if getid(current) == disc_code then
+ local pre, post, replace, pre_tail, post_tail, replace_tail = getdisc(current,true)
+ setdisc(current)
+ if pre then
+ flushlist(pre)
+ end
+ if post then
+ flushlist(post)
+ end
+ local p, n = getboth(current)
+ if replace then
+ if current == head then
+ head = replace
+ setprev(replace) -- already nil
+ else
+ setlink(p,replace)
+ end
+ setlink(replace_tail,n) -- was: setlink(n,replace_tail)
+ elseif current == head then
+ head = n
+ setprev(n)
+ else
+ setlink(p,n)
+ end
+ freenode(current)
+ end
+ current = next
+ end
+ return head
+end
+
+-- As we know that we have the same font we can probably optimize this a bit more.
+-- Although we can have more in disc nodes than characters and kerns we only support
+-- those two types.
+
+local function eqnode(n,m) -- no real improvement in speed
+ local n_char = isglyph(n)
+ if n_char then
+ return n_char == ischar(m,getfont(n))
+ elseif n_id == kern_code then
+ return getkern(n) == getkern(m)
+ end
+end
+
+local function equalnode(n,m)
+ if not n then
+ return not m
+ elseif not m then
+ return false
+ end
+ local n_char, n_id = isglyph(n)
+ if n_char then
+ return n_char == ischar(m,n_id) -- n_id == n_font
+ elseif n_id == whatsit_code then
+ return false
+ elseif n_id == glue_code then
+ return true
+ elseif n_id == kern_code then
+ return getkern(n) == getkern(m)
+ elseif n_id == disc_code then
+ local n_pre, n_post, n_replace = getdisc(n)
+ local m_pre, m_post, m_replace = getdisc(m)
+ while n_pre and m_pre do
+ if not eqnode(n_pre,m_pre) then
+ return false
+ end
+ n_pre = getnext(n_pre)
+ m_pre = getnext(m_pre)
+ end
+ if n_pre or m_pre then
+ return false
+ end
+ while n_post and m_post do
+ if not eqnode(n_post,m_post) then
+ return false
+ end
+ n_post = getnext(n_post)
+ m_post = getnext(m_post)
+ end
+ if n_post or m_post then
+ return false
+ end
+ while n_replace and m_replace do
+ if not eqnode(n_replace,m_replace) then
+ return false
+ end
+ n_replace = getnext(n_replace)
+ m_replace = getnext(m_replace)
+ end
+ if n_replace or m_replace then
+ return false
+ end
+ return true
+ end
+ return false
+end
+
+-- The spacing hackery is not nice. The text can get leading and trailing spaces
+-- and even mid spaces while the start and stop nodes not always are glues then
+-- so the plugin really needs to do some testing there. We could pass more context
+-- but it doesn't become much better.
+--
+-- The attribute gets passed for tracing purposes. We could support it (not that
+-- hard to do) but as we don't test strickly for fonts (in disc nodes) we are not
+-- compatible anyway. It would also mean more testing. So, don't use this mixed
+-- with node and base mode in context.
+--
+-- We don't distinguish between modes in treatment (so no r2l assumptions) and
+-- no cheats for scripts that might not use discretionaries. Such hacks can work
+-- in predictable cases but in context one can use a mix all kind of things and
+-- users do that. On the other hand, we do support longer glyph runs in both modes
+-- so there we gain a bit.
+
+do
+
+ local function texthandler(head,font,dynamic,rlmode,handler,startspacing,stopspacing,nesting)
+ if not head then
+ return
+ end
+ if startspacing == nil then
+ startspacing = false
+ end
+ if stopspacing == nil then
+ stopspacing = false
+ end
+
+ if getid(head) == par_code and startofpar(head) then
+ rlmode = pardirstate(head)
+ elseif rlmode == righttoleft_code then
+ rlmode = -1
+ else
+ rlmode = 0
+ end
+
+ local dirstack = { }
+ local rlparmode = 0
+ local topstack = 0
+ local text = { }
+ local size = 0
+ local current = head
+ local start = nil
+ local stop = nil
+ local startrlmode = rlmode
+
+ local function handle(leading,trailing) -- what gets passed can become configureable: e.g. utf 8
+ local stop = current or start -- hm, what with outer stop
+ if getid(stop) ~= glyph_code then
+ stop = getprev(stop)
+ end
+ head = handler(head,font,dynamic,rlmode,start,stop,text,leading,trailing) -- handler can adapt text
+ size = 0
+ text = { }
+ start = nil
+ end
+
+ while current do
+ local char, id = ischar(current,font)
+ if char then
+ if not start then
+ start = current
+ startrlmode = rlmode
+ end
+ local char = getchar(current)
+ size = size + 1
+ text[size] = char
+ current = getnext(current)
+ elseif char == false then
+ -- so a mixed font
+ if start and size > 0 then
+ handle(startspacing,false)
+ end
+ startspacing = false
+ current = getnext(current)
+ elseif id == glue_code then
+ -- making this branch optional i.e. always use the else doesn't really
+ -- make a difference in performance (in hb) .. tricky anyway as we can
+ local width = getwidth(current)
+ if width > 0 then
+ if start and size > 0 then
+ handle(startspacing,true)
+ end
+ startspacing = true
+ stopspacing = false
+ else
+ if start and size > 0 then
+ head = handle(startspacing)
+ end
+ startspacing = false
+ stopspacing = false
+ end
+ current = getnext(current)
+ elseif id == disc_code and usesfont(current,font) then -- foo|-|bar : has hbox
+ -- This looks much like the original code but I don't see a need to optimize
+ -- for e.g. deva or r2l fonts. If there are no disc nodes then we won't see
+ -- this branch anyway and if there are, we should just deal with them.
+ --
+ -- There is still some weird code here ... start/stop and such. When I'm in
+ -- the mood (or see a need) I'll rewrite this bit.
+
+ -- bug: disc in last word moves to end (in practice not an issue as one
+ -- doesn't want a break there)
+
+ local pre = nil
+ local post = nil
+ local currentnext = getnext(current)
+ local current_pre, current_post, current_replace = getdisc(current)
+ setdisc(current) -- why, we set it later
+ if start then
+ pre = copy_node_list(start,current)
+ stop = getprev(current)
+ -- why also current and not:
+ -- pre = copy_node_list(start,stop)
+ if start == head then
+ head = current
+ end
+ setlink(getprev(start),current)
+ setlink(stop,current_pre)
+ current_pre = start
+ setprev(current_pre)
+ start = nil
+ stop = nil
+ startrlmode = rlmode
+ end
+ while currentnext do
+ local char, id = ischar(currentnext,font)
+ if char or id == disc_code then
+ stop = currentnext
+ currentnext = getnext(currentnext)
+ elseif id == glue_code then
+ local width = getwidth(currentnext)
+ if width and width > 0 then
+ stopspacing = true
+ else
+ stopspacing = false
+ end
+ break
+ else
+ break
+ end
+ end
+ if stop then
+ local currentnext = getnext(current)
+ local stopnext = getnext(stop)
+ post = copy_node_list(currentnext,stopnext)
+ if current_post then
+ setlink(find_node_tail(current_post),currentnext)
+ else
+ setprev(currentnext)
+ current_post = currentnext
+ end
+ setlink(current,stopnext)
+ setnext(stop)
+ stop = nil
+ end
+ if pre then
+ setlink(find_node_tail(pre),current_replace)
+ current_replace = pre
+ pre = nil
+ end
+ if post then
+ if current_replace then
+ setlink(find_node_tail(current_replace),post)
+ else
+ current_replace = post
+ end
+ post = nil
+ end
+ size = 0 -- hm, ok, start is also nil now
+ text = { }
+ if current_pre then
+ current_pre = texthandler(current_pre,font,dynamic,rlmode,handler,startspacing,false,"pre")
+ end
+ if current_post then
+ current_post = texthandler(current_post,font,dynamic,rlmode,handler,false,stopspacing,"post")
+ end
+ if current_replace then
+ current_replace = texthandler(current_replace,font,dynamic,rlmode,handler,startspacing,stopspacing,"replace")
+ end
+ startspacing = false
+ stopspacing = false
+ local cpost = current_post and find_node_tail(current_post)
+ local creplace = current_replace and find_node_tail(current_replace)
+ local cpostnew = nil
+ local creplacenew = nil
+ local newcurrent = nil
+ while cpost and equalnode(cpost,creplace) do
+ cpostnew = cpost
+ creplacenew = creplace
+ if creplace then
+ creplace = getprev(creplace)
+ end
+ cpost = getprev(cpost)
+ end
+ if cpostnew then
+ if cpostnew == current_post then
+ current_post = nil
+ else
+ setnext(getprev(cpostnew))
+ end
+ flushlist(cpostnew)
+ if creplacenew == current_replace then
+ current_replace = nil
+ else
+ setnext(getprev(creplacenew))
+ end
+ local c = getnext(current)
+ setlink(current,creplacenew)
+ local creplacenewtail = find_node_tail(creplacenew)
+ setlink(creplacenewtail,c)
+ newcurrent = creplacenewtail
+ end
+ current_post = current_post and deletedisc(current_post)
+ current_replace = current_replace and deletedisc(current_replace)
+ local cpre = current_pre
+ local creplace = current_replace
+ local cprenew = nil
+ local creplacenew = nil
+ while cpre and equalnode(cpre, creplace) do
+ cprenew = cpre
+ creplacenew = creplace
+ if creplace then
+ creplace = getnext(creplace)
+ end
+ cpre = getnext(cpre)
+ end
+ if cprenew then
+ cpre = current_pre
+ current_pre = getnext(cprenew)
+ if current_pre then
+ setprev(current_pre)
+ end
+ setnext(cprenew)
+ flushlist(cpre)
+ creplace = current_replace
+ current_replace = getnext(creplacenew)
+ if current_replace then
+ setprev(current_replace)
+ end
+ setlink(getprev(current),creplace)
+ if current == head then
+ head = creplace
+ end
+ setlink(creplacenew,current)
+ end
+ setdisc(current,current_pre,current_post,current_replace)
+ current = currentnext
+ else
+ if start and size > 0 then
+ handle(startspacing,stopspacing)
+ end
+ startspacing = false
+ stopspacing = false
+ if id == math_code then
+ current = getnext(endofmath(current))
+ elseif id == dir_code then
+ startspacing = false
+ topstack, rlmode = txtdirstate(current,dirstack,topstack,rlparmode)
+ current = getnext(current)
+ -- elseif id == par_code and startofpar(current) then
+ -- startspacing = false
+ -- rlparmode, rlmode = pardirstate(current)
+ -- current = getnext(current)
+ else
+ current = getnext(current)
+ end
+ end
+ end
+ if start and size > 0 then
+ handle(startspacing,stopspacing)
+ end
+ return head, true
+ end
+
+ function fonts.handlers.otf.texthandler(head,font,dynamic,direction,action)
+ if action then
+ return texthandler(head,font,dynamic,direction == righttoleft_code and -1 or 0,action)
+ else
+ return head, false
+ end
+ end
+
+ -- Next comes a tracer plug into context.
+
+ ----- texthandler = fonts.handlers.otf.texthandler
+ local report_text = logs.reporter("otf plugin","text")
+ local nofruns = 0
+ local nofsnippets = 0
+ local f_unicode = string.formatters["%U"]
+
+ local function showtext(head,font,dynamic,rlmode,start,stop,list,before,after)
+ if list then
+ nofsnippets = nofsnippets + 1
+ local plus = { }
+ for i=1,#list do
+ local u = list[i]
+ list[i] = utfchar(u)
+ plus[i] = f_unicode(u)
+ end
+ report_text("%03i : [%s] %t [%s]-> % t", nofsnippets, before and "+" or "-", list, after and "+" or "-", plus)
+ else
+ report_text()
+ report_text("invalid list")
+ report_text()
+ end
+ return head, false
+ end
+
+ fonts.handlers.otf.registerplugin("text",function(head,font,dynamic,direction)
+ nofruns = nofruns + 1
+ nofsnippets = 0
+ report_text("start run %i",nofruns)
+ local h, d = texthandler(head,font,dynamic,direction,showtext)
+ report_text("stop run %i",nofruns)
+ return h, d
+ end)
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/good-gen.lua b/Master/texmf-dist/tex/context/base/mkiv/good-gen.lua
index cee6b317211..1747727c177 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/good-gen.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/good-gen.lua
@@ -10,7 +10,7 @@ if not modules then modules = { } end modules ['good-gen'] = {
local type, next = type, next
local lower = string.lower
-
+local filesuffix, replacesuffix = file.suffix, file.replacesuffix
local fonts = fonts
----- trace_goodies = false trackers.register("fonts.goodies", function(v) trace_goodies = v end)
@@ -134,6 +134,16 @@ function fontgoodies.filenames.resolve(name)
return fn
end
end
+ elseif filesuffix(name) == "any" then
+ -- This is a bit weird place but it's a kind of fallback option in case
+ -- we can't resolve due to a name conflict.
+ local sequence = fonts.readers.sequence
+ for i=1,#sequence do
+ local fn = replacesuffix(name,sequence[i])
+ if findfile(fn) ~= "" then
+ return fn
+ end
+ end
else
-- no lookup, just use the regular mechanism
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/good-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/good-ini.lua
index 22ca12d28c6..df79adb61c3 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/good-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/good-ini.lua
@@ -150,7 +150,9 @@ end
local function flattenedfeatures(t,tt)
-- first set value dominates
- local tt = tt or { }
+ if not tt then
+ tt = { }
+ end
for i=1,#t do
local ti = t[i]
local ty = type(ti)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/good-mth.lua b/Master/texmf-dist/tex/context/base/mkiv/good-mth.lua
index 3473cc205c4..e25782e9ea6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/good-mth.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/good-mth.lua
@@ -1,4 +1,4 @@
-if not modules then modules = { } end modules ['good-mth'] = {
+ if not modules then modules = { } end modules ['good-mth'] = {
version = 1.000,
comment = "companion to font-lib.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
@@ -36,7 +36,7 @@ local new_glyph = nodepool.glyph
local new_hlist = nodepool.hlist
local new_vlist = nodepool.vlist
-local insert_node_after = nuts.insert_after
+local insertnodeafter = nuts.insertafter
local helpers = fonts.helpers
local upcommand = helpers.commands.up
@@ -47,151 +47,151 @@ local prependcommands = helpers.prependcommands
-- experiment, we have to load the definitions immediately as they precede
-- the definition so they need to be initialized in the typescript
-local function withscriptcode(tfmdata,unicode,data,action)
- if type(unicode) == "string" then
- local p, u = match(unicode,"^(.-):(.-)$")
- if u then
- u = tonumber(u)
- if u then
- local slots = fonts.helpers.mathscriptslots(tfmdata,u)
- if slots then
- if p == "*" then
- action(u,data)
- for i=1,#slots do
- action(slots[i],data)
- end
- else
- p = tonumber(p)
- if p then
- action(slots[p],data)
- end
- end
- end
- end
- end
- else
- action(unicode,data)
- end
-end
-
-local function finalize(tfmdata,feature,value)
--- if tfmdata.mathparameters then -- funny, cambria text has this
- local goodies = tfmdata.goodies
- if goodies then
- local virtualized = mathematics.virtualized
- for i=1,#goodies do
- local goodie = goodies[i]
- local mathematics = goodie.mathematics
- local dimensions = mathematics and mathematics.dimensions
- if dimensions then
- if trace_defining then
- report_math("overloading dimensions in %a @ %p",tfmdata.properties.fullname,tfmdata.parameters.size)
- end
- local characters = tfmdata.characters
- local descriptions = tfmdata.descriptions
- local parameters = tfmdata.parameters
- local factor = parameters.factor
- local hfactor = parameters.hfactor
- local vfactor = parameters.vfactor
- local function overloadone(unicode,data)
- local character = characters[unicode]
- if not character then
- local c = virtualized[unicode]
- if c then
- character = characters[c]
- end
- end
- if character then
- local width = data.width
- local height = data.height
- local depth = data.depth
- if trace_defining and (width or height or depth) then
- report_math("overloading dimensions of %C, width %p, height %p, depth %p",
- unicode,width or 0,height or 0,depth or 0)
- end
- if width then character.width = width * hfactor end
- if height then character.height = height * vfactor end
- if depth then character.depth = depth * vfactor end
- --
- local xoffset = data.xoffset
- local yoffset = data.yoffset
- if xoffset == "llx" then
- local d = descriptions[unicode]
- if d then
- xoffset = - d.boundingbox[1] * hfactor
- character.width = character.width + xoffset
- xoffset = rightcommand[xoffset]
- else
- xoffset = nil
- end
- elseif xoffset and xoffset ~= 0 then
- xoffset = rightcommand[xoffset * hfactor]
- else
- xoffset = nil
- end
- if yoffset and yoffset ~= 0 then
- yoffset = upcommand[yoffset * vfactor]
- else
- yoffset = nil
- end
- if xoffset or yoffset then
- local commands = characters.commands
- if commands then
- prependcommands(commands,yoffset,xoffset)
- else
- local slot = charcommand[unicode]
- if xoffset and yoffset then
- character.commands = { xoffset, yoffset, slot }
- elseif xoffset then
- character.commands = { xoffset, slot }
- else
- character.commands = { yoffset, slot }
- end
- end
- end
- elseif trace_defining then
- report_math("no overloading dimensions of %C, not in font",unicode)
- end
- end
- local function overload(dimensions)
- for unicode, data in next, dimensions do
- withscriptcode(tfmdata,unicode,data,overloadone)
- end
- end
- if value == nil then
- value = { "default" }
- end
- if value == "all" or value == true then
- for name, value in next, dimensions do
- overload(value)
- end
- else
- if type(value) == "string" then
- value = utilities.parsers.settings_to_array(value)
- end
- if type(value) == "table" then
- for i=1,#value do
- local d = dimensions[value[i]]
- if d then
- overload(d)
- end
- end
- end
- end
- end
- end
- end
-end
+-- local function withscriptcode(tfmdata,unicode,data,action)
+-- if type(unicode) == "string" then
+-- local p, u = match(unicode,"^(.-):(.-)$")
+-- if u then
+-- u = tonumber(u)
+-- if u then
+-- local slots = fonts.helpers.mathscriptslots(tfmdata,u)
+-- if slots then
+-- if p == "*" then
+-- action(u,data)
+-- for i=1,#slots do
+-- action(slots[i],data)
+-- end
+-- else
+-- p = tonumber(p)
+-- if p then
+-- action(slots[p],data)
+-- end
+-- end
+-- end
+-- end
+-- end
+-- else
+-- action(unicode,data)
+-- end
+-- end
-registerotffeature {
- name = "mathdimensions",
- description = "manipulate math dimensions",
- -- default = true,
- manipulators = {
- base = finalize,
- node = finalize,
- }
-}
+-- local function finalize(tfmdata,feature,value)
+-- -- if tfmdata.mathparameters then -- funny, cambria text has this
+-- local goodies = tfmdata.goodies
+-- if goodies then
+-- local virtualized = mathematics.virtualized
+-- for i=1,#goodies do
+-- local goodie = goodies[i]
+-- local mathematics = goodie.mathematics
+-- local dimensions = mathematics and mathematics.dimensions
+-- if dimensions then
+-- if trace_defining then
+-- report_math("overloading dimensions in %a @ %p",tfmdata.properties.fullname,tfmdata.parameters.size)
+-- end
+-- local characters = tfmdata.characters
+-- local descriptions = tfmdata.descriptions
+-- local parameters = tfmdata.parameters
+-- local factor = parameters.factor
+-- local hfactor = parameters.hfactor
+-- local vfactor = parameters.vfactor
+-- local function overloadone(unicode,data)
+-- local character = characters[unicode]
+-- if not character then
+-- local c = virtualized[unicode]
+-- if c then
+-- character = characters[c]
+-- end
+-- end
+-- if character then
+-- local width = data.width
+-- local height = data.height
+-- local depth = data.depth
+-- if trace_defining and (width or height or depth) then
+-- report_math("overloading dimensions of %C, width %p, height %p, depth %p",
+-- unicode,width or 0,height or 0,depth or 0)
+-- end
+-- if width then character.width = width * hfactor end
+-- if height then character.height = height * vfactor end
+-- if depth then character.depth = depth * vfactor end
+-- --
+-- local xoffset = data.xoffset
+-- local yoffset = data.yoffset
+-- if xoffset == "llx" then
+-- local d = descriptions[unicode]
+-- if d then
+-- xoffset = - d.boundingbox[1] * hfactor
+-- character.width = character.width + xoffset
+-- xoffset = rightcommand[xoffset]
+-- else
+-- xoffset = nil
+-- end
+-- elseif xoffset and xoffset ~= 0 then
+-- xoffset = rightcommand[xoffset * hfactor]
+-- else
+-- xoffset = nil
+-- end
+-- if yoffset and yoffset ~= 0 then
+-- yoffset = upcommand[yoffset * vfactor]
+-- else
+-- yoffset = nil
+-- end
+-- if xoffset or yoffset then
+-- local commands = character.commands
+-- if commands then
+-- prependcommands(commands,yoffset,xoffset)
+-- else
+-- local slot = charcommand[unicode]
+-- if xoffset and yoffset then
+-- character.commands = { xoffset, yoffset, slot }
+-- elseif xoffset then
+-- character.commands = { xoffset, slot }
+-- else
+-- character.commands = { yoffset, slot }
+-- end
+-- end
+-- end
+-- elseif trace_defining then
+-- report_math("no overloading dimensions of %C, not in font",unicode)
+-- end
+-- end
+-- local function overload(dimensions)
+-- for unicode, data in next, dimensions do
+-- withscriptcode(tfmdata,unicode,data,overloadone)
+-- end
+-- end
+-- if value == nil then
+-- value = { "default" }
+-- end
+-- if value == "all" or value == true then
+-- for name, value in next, dimensions do
+-- overload(value)
+-- end
+-- else
+-- if type(value) == "string" then
+-- value = utilities.parsers.settings_to_array(value)
+-- end
+-- if type(value) == "table" then
+-- for i=1,#value do
+-- local d = dimensions[value[i]]
+-- if d then
+-- overload(d)
+-- end
+-- end
+-- end
+-- end
+-- end
+-- end
+-- end
+-- end
+--
+-- registerotffeature {
+-- name = "mathdimensions",
+-- description = "manipulate math dimensions",
+-- -- default = true,
+-- manipulators = {
+-- base = finalize,
+-- node = finalize,
+-- }
+-- }
local function initialize(goodies)
local mathgoodies = goodies.mathematics
@@ -222,119 +222,117 @@ fontgoodies.register("mathematics", initialize)
-- local enabled = false directives.register("fontgoodies.mathkerning",function(v) enabled = v end)
-local function initialize(tfmdata)
--- if enabled and tfmdata.mathparameters then -- funny, cambria text has this
- if tfmdata.mathparameters then -- funny, cambria text has this
- local goodies = tfmdata.goodies
- if goodies then
- local characters = tfmdata.characters
- if characters[0x1D44E] then -- 119886
- -- we have at least an italic a
- for i=1,#goodies do
- local mathgoodies = goodies[i].mathematics
- if mathgoodies then
- local kerns = mathgoodies.kerns
- if kerns then
- local function kernone(unicode,data)
- local chardata = characters[unicode]
- if chardata and (not chardata.mathkerns or data.force) then
- chardata.mathkerns = data
- end
- end
- for unicode, data in next, kerns do
- withscriptcode(tfmdata,unicode,data,kernone)
- end
- return
- end
- end
- end
- else
- return -- no proper math font anyway
- end
- end
- end
-end
-
-registerotffeature {
- name = "mathkerns",
- description = "math kerns",
- -- default = true,
- initializers = {
- base = initialize,
- node = initialize,
- }
-}
-
--- math italics (not really needed)
+-- local function initialize(tfmdata)
+-- -- if enabled and tfmdata.mathparameters then -- funny, cambria text has this
+-- if tfmdata.mathparameters then -- funny, cambria text has this
+-- local goodies = tfmdata.goodies
+-- if goodies then
+-- local characters = tfmdata.characters
+-- if characters[0x1D44E] then -- 119886
+-- -- we have at least an italic a
+-- for i=1,#goodies do
+-- local mathgoodies = goodies[i].mathematics
+-- if mathgoodies then
+-- local kerns = mathgoodies.kerns
+-- if kerns then
+-- local function kernone(unicode,data)
+-- local chardata = characters[unicode]
+-- if chardata and (not chardata.mathkerns or data.force) then
+-- chardata.mathkerns = data
+-- end
+-- end
+-- for unicode, data in next, kerns do
+-- withscriptcode(tfmdata,unicode,data,kernone)
+-- end
+-- return
+-- end
+-- end
+-- end
+-- else
+-- return -- no proper math font anyway
+-- end
+-- end
+-- end
+-- end
--
--- it would be nice to have a \noitalics\font option
+-- registerotffeature {
+-- name = "mathkerns",
+-- description = "math kerns",
+-- -- default = true,
+-- initializers = {
+-- base = initialize,
+-- node = initialize,
+-- }
+-- }
-local function initialize(tfmdata)
- local goodies = tfmdata.goodies
- if goodies then
- local shared = tfmdata.shared
- for i=1,#goodies do
- local mathgoodies = goodies[i].mathematics
- if mathgoodies then
- local mathitalics = mathgoodies.italics
- if mathitalics then
- local properties = tfmdata.properties
- if properties.setitalics then
- mathitalics = mathitalics[file.nameonly(properties.name)] or mathitalics
- if mathitalics then
- if trace_goodies then
- report_goodies("loading mathitalics for font %a",properties.name)
- end
- local corrections = mathitalics.corrections
- local defaultfactor = mathitalics.defaultfactor
- -- properties.mathitalic_defaultfactor = defaultfactor -- we inherit outer one anyway (name will change)
- if corrections then
- fontgoodies.registerpostprocessor(tfmdata, function(tfmdata) -- this is another tfmdata (a copy)
- -- better make a helper so that we have less code being defined
- local properties = tfmdata.properties
- local parameters = tfmdata.parameters
- local characters = tfmdata.characters
- properties.mathitalic_defaultfactor = defaultfactor
- properties.mathitalic_defaultvalue = defaultfactor * parameters.quad
- if trace_goodies then
- report_goodies("assigning mathitalics for font %a",properties.name)
- end
- local quad = parameters.quad
- local hfactor = parameters.hfactor
- for k, v in next, corrections do
- local c = characters[k]
- if c then
- if v > -1 and v < 1 then
- c.italic = v * quad
- else
- c.italic = v * hfactor
- end
- else
- report_goodies("invalid mathitalics entry %U for font %a",k,properties.name)
- end
- end
- end)
- end
- return -- maybe not as these can accumulate
- end
- end
- end
- end
- end
- end
-end
-
-registerotffeature {
- name = "mathitalics",
- description = "additional math italic corrections",
- -- default = true,
- initializers = {
- base = initialize,
- node = initialize,
- }
-}
-
--- fontgoodies.register("mathitalics", initialize)
+-- -- math italics (not really needed)
+-- --
+-- -- it would be nice to have a \noitalics\font option
+--
+-- local function initialize(tfmdata)
+-- local goodies = tfmdata.goodies
+-- if goodies then
+-- local shared = tfmdata.shared
+-- for i=1,#goodies do
+-- local mathgoodies = goodies[i].mathematics
+-- if mathgoodies then
+-- local mathitalics = mathgoodies.italics
+-- if mathitalics then
+-- local properties = tfmdata.properties
+-- if properties.setitalics then
+-- mathitalics = mathitalics[file.nameonly(properties.name)] or mathitalics
+-- if mathitalics then
+-- if trace_goodies then
+-- report_goodies("loading mathitalics for font %a",properties.name)
+-- end
+-- local corrections = mathitalics.corrections
+-- local defaultfactor = mathitalics.defaultfactor
+-- -- properties.mathitalic_defaultfactor = defaultfactor -- we inherit outer one anyway (name will change)
+-- if corrections then
+-- fontgoodies.registerpostprocessor(tfmdata, function(tfmdata) -- this is another tfmdata (a copy)
+-- -- better make a helper so that we have less code being defined
+-- local properties = tfmdata.properties
+-- local parameters = tfmdata.parameters
+-- local characters = tfmdata.characters
+-- properties.mathitalic_defaultfactor = defaultfactor
+-- properties.mathitalic_defaultvalue = defaultfactor * parameters.quad
+-- if trace_goodies then
+-- report_goodies("assigning mathitalics for font %a",properties.name)
+-- end
+-- local quad = parameters.quad
+-- local hfactor = parameters.hfactor
+-- for k, v in next, corrections do
+-- local c = characters[k]
+-- if c then
+-- if v > -1 and v < 1 then
+-- c.italic = v * quad
+-- else
+-- c.italic = v * hfactor
+-- end
+-- else
+-- report_goodies("invalid mathitalics entry %U for font %a",k,properties.name)
+-- end
+-- end
+-- end)
+-- end
+-- return -- maybe not as these can accumulate
+-- end
+-- end
+-- end
+-- end
+-- end
+-- end
+-- end
+--
+-- registerotffeature {
+-- name = "mathitalics",
+-- description = "additional math italic corrections",
+-- -- default = true,
+-- initializers = {
+-- base = initialize,
+-- node = initialize,
+-- }
+-- }
local function mathradicalaction(n,h,v,font,mchar,echar)
local characters = fontcharacters[font]
@@ -361,7 +359,7 @@ local function mathradicalaction(n,h,v,font,mchar,echar)
local kern = new_kern(height-v)
list = setlink(kern,list)
local list = new_vlist(kern)
- insert_node_after(n,n,list)
+ insertnodeafter(n,n,list)
end
local function mathhruleaction(n,h,v,font,bchar,mchar,echar)
@@ -397,7 +395,7 @@ local function mathhruleaction(n,h,v,font,bchar,mchar,echar)
local kern = new_kern(height-v)
list = setlink(kern,list)
local list = new_vlist(kern)
- insert_node_after(n,n,list)
+ insertnodeafter(n,n,list)
end
local function initialize(tfmdata)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/grph-con.lua b/Master/texmf-dist/tex/context/base/mkiv/grph-con.lua
index b3d39f0bd93..fdae2223bda 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/grph-con.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/grph-con.lua
@@ -29,6 +29,7 @@ local variables = interfaces.variables
local v_high = variables.high
local v_low = variables.low
local v_medium = variables.medium
+local v_yes = variables.yes
local figures = figures
@@ -48,6 +49,10 @@ do -- eps | ps
local epsconverter = converters.eps
converters.ps = epsconverter
+ local function gscrop(specification)
+ return (specification and specification.crop == v_yes) and "-dEPSCrop" or ""
+ end
+
local resolutions = {
[v_low] = "screen",
[v_medium] = "ebook",
@@ -68,7 +73,7 @@ do -- eps | ps
-dBATCH
-dAutoRotatePages=/None
-dPDFSETTINGS=/%presets%
- -dEPSCrop
+ %crop%
-dCompatibilityLevel=%level%
-sOutputFile=%newname%
%colorspace%
@@ -81,6 +86,7 @@ do -- eps | ps
presets = "string",
level = "string",
colorspace = "string",
+ -- crop = "string",
},
}
@@ -119,7 +125,7 @@ do -- eps | ps
return tmpname
end
- function epsconverter.pdf(oldname,newname,resolution,colorspace) -- the resolution interface might change
+ function epsconverter.pdf(oldname,newname,resolution,colorspace,specification) -- the resolution interface might change
local presets = resolutions[resolution or "high"] or resolutions.high
local level = codeinjections.getformatoption("pdf_level") or "1.3"
local tmpname = oldname
@@ -141,13 +147,14 @@ do -- eps | ps
presets = presets,
level = tostring(level),
colorspace = colorspace,
+ crop = gscrop(specification),
}
if tmpname ~= oldname then
os.remove(tmpname)
end
end
- epsconverter["gray.pdf"] = function(oldname,newname,resolution) -- the resolution interface might change
+ epsconverter["gray.pdf"] = function(oldname,newname,resolution,_,specification) -- the resolution interface might change
epsconverter.pdf(oldname,newname,resolution,"gray")
end
@@ -211,11 +218,16 @@ do -- svg
return new and "filename" or suffix
end
+ local function inkscapecrop(specification)
+ return (specification and specification.crop == v_yes) and "--export-area-drawing" or ""
+ end
+
local runner = sandbox.registerrunner {
name = "svg to something",
program = "inkscape",
template = longtostring [[
%oldname%
+ %crop%
--export-dpi=%resolution%
--export-%format%=%newname%
]],
@@ -226,7 +238,7 @@ do -- svg
resolution = "string",
},
defaults = {
- format = format,
+ format = "pdf",
resolution = "600",
}
}
@@ -235,10 +247,11 @@ do -- svg
runner = runner,
}
- function svgconverter.pdf(oldname,newname)
+ function svgconverter.pdf(oldname,newname,resolution,arguments,specification)
runner {
format = inkscapeformat("pdf"),
resolution = "600",
+ crop = inkscapecrop(specification),
newname = expandfilename(newname),
oldname = expandfilename(oldname),
}
@@ -248,6 +261,7 @@ do -- svg
runner {
format = inkscapeformat("png"),
resolution = "600",
+ crop = inkscapecrop(specification),
newname = expandfilename(newname),
oldname = expandfilename(oldname),
}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/grph-fil.lua b/Master/texmf-dist/tex/context/base/mkiv/grph-fil.lua
index b3980783038..afb303acd17 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/grph-fil.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/grph-fil.lua
@@ -42,82 +42,154 @@ end
job.register('job.files.collected', tobesaved, initializer)
-local runner = sandbox.registerrunner {
+-- When there is a runpath specified, we're already there, so then we only need to
+-- pass the orginal path. But we pass it because it will prevent prepending the
+-- current direction to the given name.
+
+local contextrunner = sandbox.registerrunner {
name = "hashed context run",
program = "context",
- template = [[%options% %filename%]],
+ template = [[%options% %?path: --path=%path% ?% %?runpath: --runpath=%runpath% ?% %filename%]],
checkers = {
options = "string",
filename = "readable",
+ path = "string",
+ runpath = "string",
}
}
-function jobfiles.run(name,action)
- local usedname = addsuffix(name,inputsuffix) -- we assume tex if not set
- local oldchecksum = collected[usedname]
- local newchecksum = checksum(usedname)
- local resultfile = replacesuffix(usedname,resultsuffix)
- local tobedone = false
- if jobfiles.forcerun then
- tobedone = true
- if trace_run then
- report_run("processing file, changes in %a, %s",name,"processing forced")
+-- we can also use:
+--
+-- local jobvariables = job.variables
+-- jobvariables.getchecksum(tag)
+-- jobvariables.makechecksum(data)
+-- jobvariables.setchecksum(tag,checksum)
+
+-- The runpath features makes things more complex than needed, so we need to wrap
+-- that some day in a helper. This is also very sensitive for both being set!
+
+function jobfiles.run(action)
+ local filename = action.filename
+ if filename and filename ~= "" then
+ local result = action.result
+ local runner = action.runner or contextrunner
+ local path = action.path
+if not isfile(filename) and path and path ~= "" then
+ filename = file.join(path,filename)
+end
+ local oldchecksum = collected[filename]
+ local newchecksum = checksum(filename)
+-- print(filename,oldchecksum,newchecksum)
+ local tobedone = false
+ local forcerun = action.forcerun or jobfiles.forcerun
+ if not result then
+ result = replacesuffix(filename,resultsuffix)
+ action.result = result
end
- end
- if not tobedone and not oldchecksum then
- tobedone = true
- if trace_run then
- report_run("processing file, changes in %a, %s",name,"no checksum yet")
+ if forcerun then
+ tobedone = true
+ if trace_run then
+ report_run("processing file, changes in %a, %s",filename,"processing forced")
+ end
end
- end
- if not tobedone and oldchecksum ~= newchecksum then
- tobedone = true
- if trace_run then
- report_run("processing file, changes in %a, %s",name,"checksum mismatch")
+ if not tobedone and not oldchecksum then
+ tobedone = true
+ if trace_run then
+ report_run("processing file, changes in %a, %s",filename,"no checksum yet")
+ end
end
- end
- if not tobedone and not isfile(resultfile) then
- tobedone = true
- if trace_run then
- report_run("processing file, changes in %a, %s",name,"no result file")
+ if not tobedone and oldchecksum ~= newchecksum then
+ tobedone = true
+ if trace_run then
+ report_run("processing file, changes in %a, %s",filename,"checksum mismatch")
+ end
end
- end
- if tobedone then
- local ta = type(action)
- if ta == "function" then
- action(name)
- elseif ta == "string" and action ~= "" then
- -- can be anything but we assume it gets checked by the sandbox
- os.execute(action)
- elseif ta == "table" then
- runner(action)
- else
- report_run("processing file, no action given for processing %a",name)
+ if not tobedone and not isfile(result) then
+ tobedone = true
+ if trace_run then
+ report_run("processing file, changes in %a, %s",filename,"no result file")
+ end
end
- elseif trace_run then
- report_run("processing file, no changes in %a, not processed",name)
+ if tobedone then
+ local kind = type(runner)
+ if kind == "function" then
+ if trace_run then
+ report_run("processing file, command: %s",action.name or "unknown")
+ end
+ -- We can have a sandbox.registerrunner here in which case we need to make
+ -- sure that we don't feed a function into the checker. So one cannot use a
+ -- variable named "runner" in the template but that's no big deal.
+ local r = action.runner
+ action.runner = nil
+ runner(action)
+ action.runner = r
+ elseif kind == "string" then
+ -- can be anything but we assume it gets checked by the sandbox
+ if trace_run then
+ report_run("processing file, command: %s",runner)
+ end
+ os.execute(runner)
+ else
+ report_run("processing file, changes in %a, %s",filename,"no valid runner")
+ end
+ elseif trace_run then
+ report_run("processing file, no changes in %a, %s",filename,"not processed")
+ end
+ tobesaved[filename] = newchecksum
+ else
+ -- silently ignore error
end
- tobesaved[name] = newchecksum
end
--
local done = { }
-function jobfiles.context(name,options)
+local function analyzed(name,options)
+ local usedname = addsuffix(name,inputsuffix) -- we assume tex if not set
+ local resultname = replacesuffix(name,resultsuffix) -- we assume tex if not set
+ local pathname = file.pathpart(usedname)
+ local path = environment.arguments.path -- sic, no runpath
+ local runpath = environment.arguments.runpath
+ local resultname = replacesuffix(name,resultsuffix) -- we assume tex if not set
+ if runpath and runpath ~= "" then
+ -- not really needed but probably more robust for local leftovers
+ resultname = file.join(runpath,file.basename(resultname))
+ end
+ if path ~= "" then
+ if path then
+ path = file.join(path,pathname)
+ else
+ path = pathname
+ end
+ usedname = file.basename(usedname)
+ end
+ return {
+ options = options,
+ path = path,
+ filename = usedname,
+ result = resultname,
+ runpath = runpath,
+ }
+end
+
+function jobfiles.context(name,options) -- runpath ?
if type(name) == "table" then
local result = { }
for i=1,#name do
result[#result+1] = jobfiles.context(name[i],options)
end
return result
- else
- local result = replacesuffix(name,resultsuffix)
+ elseif name ~= "" then
+ local action = analyzed(name,options)
+ local result = action.result
if not done[result] then
- jobfiles.run(name, { options = options, filename = name })
+ jobfiles.run(action)
done[result] = true
end
return result
+ else
+ return { }
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/grph-img.lua b/Master/texmf-dist/tex/context/base/mkiv/grph-img.lua
index 0dc5efa7038..43299a84caa 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/grph-img.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/grph-img.lua
@@ -16,7 +16,7 @@ local round = math.round
local concat = table.concat
local suffixonly = file.suffix
-local newreader = io.newreader
+local newreader = io.newreader -- needs checking 0/1 based
local setmetatableindex = table.setmetatableindex
local setmetatablecall = table.setmetatablecall
@@ -24,6 +24,15 @@ local graphics = graphics or { }
local identifiers = { }
graphics.identifiers = identifiers
+local function checkedmethod(filename,method)
+ if method ~= "string" then
+ local found, data = resolvers.loadbinfile(filename)
+ return data, "string"
+ else
+ return filename, method
+ end
+end
+
do
local colorspaces = {
@@ -222,6 +231,7 @@ do
specification.error = "invalid filename"
return specification -- error
end
+ filename, method = checkedmethod(filename,method)
local f = newreader(filename,method)
if not f then
specification.error = "unable to open file"
@@ -454,6 +464,7 @@ do
specification.error = "invalid filename"
return specification -- error
end
+ filename, method = checkedmethod(filename,method)
local f = newreader(filename,method)
if not f then
specification.error = "unable to open file"
@@ -558,6 +569,7 @@ do
specification.error = "invalid filename"
return specification -- error
end
+ filename, method = checkedmethod(filename,method)
local f = newreader(filename,method)
if not f then
specification.error = "unable to open file"
@@ -727,21 +739,18 @@ end
function graphics.identify(filename,filetype)
local identify = filetype and identifiers[filetype]
- if identify then
- return identify(filename)
+ if not identify then
+ identify = identifiers[suffixonly(filename)]
end
- local identify = identifiers[suffixonly(filename)]
if identify then
- identify = identify(filename)
+ return identify(filename)
else
- identify = {
+ return {
filename = filename,
filetype = filetype,
error = "identification failed",
}
end
- -- inspect(identify)
- return identify
end
-- inspect(identifiers.jpg("t:/sources/hacker.jpg"))
diff --git a/Master/texmf-dist/tex/context/base/mkiv/grph-inc.lua b/Master/texmf-dist/tex/context/base/mkiv/grph-inc.lua
index 6fdf74c08da..f8dcc658b5f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/grph-inc.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/grph-inc.lua
@@ -78,9 +78,10 @@ local resolveprefix = resolvers.resolve
local texgetbox = tex.getbox
local texsetbox = tex.setbox
-local hpack = node.hpack
+local hpack = nodes.hpack
local new_latelua = nodes.pool.latelua
+local new_hlist = nodes.pool.hlist
local context = context
@@ -554,6 +555,11 @@ function figures.setpaths(locationset,pathlist)
end
end
end
+ -- new
+ if environment.arguments.path then
+ table.insert(t,1,environment.arguments.path)
+ end
+ --
figure_paths = t
last_pathlist = pathlist
figures.paths = figure_paths
@@ -587,6 +593,7 @@ local function new() -- we could use metatables status -> used -> request but it
controls = false,
display = false,
mask = false,
+ crop = false,
conversion = false,
resolution = false,
color = false,
@@ -766,18 +773,20 @@ local function register(askedname,specification)
local conversion = wipe(specification.conversion)
local resolution = wipe(specification.resolution)
local arguments = wipe(specification.arguments)
+ local crop = wipe(specification.crop)
local newformat = conversion
if not newformat or newformat == "" then
newformat = defaultformat
end
if trace_conversion then
- report_inclusion("checking conversion of %a, fullname %a, old format %a, new format %a, conversion %a, resolution %a, arguments %a",
+ report_inclusion("checking conversion of %a, fullname %a, old format %a, new format %a, conversion %a, resolution %a, crop %a, arguments %a",
askedname,
specification.fullname,
format,
newformat,
conversion or "default",
resolution or "default",
+ crop or "default",
arguments or ""
)
end
@@ -793,7 +802,7 @@ local function register(askedname,specification)
end
end
-- end of quick hack
- local converter = (not remapper) and (newformat ~= format or resolution or arguments) and converters[format]
+ local converter = (not remapper) and (newformat ~= format or resolution or arguments) and converters[format] -- no crop here
if converter then
local okay = converter[newformat]
if okay then
@@ -813,6 +822,10 @@ local function register(askedname,specification)
local oldname = specification.fullname
local newpath = file.dirname(oldname)
local oldbase = file.basename(oldname)
+ local runpath = environment.arguments.runpath
+ if runpath and runpath ~= "" and newpath == environment.arguments.path then
+ newpath = runpath
+ end
--
-- problem: we can have weird filenames, like a.b.c (no suffix) and a.b.c.gif
-- so we cannot safely remove a suffix (unless we do that for known suffixes)
@@ -853,6 +866,10 @@ local function register(askedname,specification)
if arguments then
hash = hash .. "[a:" .. arguments .. "]"
end
+ if crop then
+ hash = hash .. "[c:" .. crop .. "]"
+ end
+ newbase = gsub(newbase,"%.","_") -- nicer to have no suffix in the name
if hash ~= "" then
newbase = newbase .. "_" .. md5.hex(hash)
end
@@ -877,7 +894,7 @@ local function register(askedname,specification)
if trace_conversion then
report_inclusion("converting %a (%a) from %a to %a",askedname,oldname,format,newformat)
end
- converter(oldname,newname,resolution or "", arguments or "")
+ converter(oldname,newname,resolution or "", arguments or "",specification) -- in retrospect a table
else
if trace_conversion then
report_inclusion("no need to convert %a (%a) from %a to %a",askedname,oldname,format,newformat)
@@ -971,10 +988,12 @@ local function locate(request) -- name, format, cache
local askedconversion = request.conversion
local askedresolution = request.resolution
local askedarguments = request.arguments
+ local askedcrop = request.crop
local askedhash = f_hash_part(
askedname,
askedconversion or "default",
askedresolution or "default",
+ askedcrop or "default",
askedarguments or ""
)
local foundname = figures_found[askedhash]
@@ -1029,6 +1048,7 @@ local function locate(request) -- name, format, cache
cache = askedcache,
conversion = askedconversion,
resolution = askedresolution,
+ crop = askedcrop,
arguments = askedarguments,
})
end
@@ -1066,6 +1086,7 @@ local function locate(request) -- name, format, cache
conversion = askedconversion,
resolution = askedresolution,
arguments = askedarguments,
+ crop = askedcrop,
internal = internal,
})
elseif quitscanning then
@@ -1086,6 +1107,7 @@ local function locate(request) -- name, format, cache
cache = askedcache,
conversion = askedconversion,
resolution = askedresolution,
+ crop = askedcrop,
arguments = askedarguments,
})
end
@@ -1105,6 +1127,7 @@ local function locate(request) -- name, format, cache
cache = askedcache,
conversion = askedconversion,
resolution = askedresolution,
+ crop = askedcrop,
arguments = askedarguments,
})
end
@@ -1119,6 +1142,7 @@ local function locate(request) -- name, format, cache
cache = askedcache,
conversion = askedconversion,
resolution = askedresolution,
+ crop = askedcrop,
arguments = askedarguments,
})
end
@@ -1143,6 +1167,7 @@ local function locate(request) -- name, format, cache
cache = askedcache,
conversion = askedconversion,
resolution = askedresolution,
+ crop = askedcrop,
arguments = askedarguments,
})
end
@@ -1178,6 +1203,7 @@ local function locate(request) -- name, format, cache
cache = askedcache,
conversion = askedconversion,
resolution = askedresolution,
+ crop = askedcrop,
arguments = askedarguments
})
end
@@ -1206,6 +1232,7 @@ local function locate(request) -- name, format, cache
cache = askedcache,
conversion = askedconversion,
resolution = askedresolution,
+ crop = askedcrop,
arguments = askedarguments,
})
end
@@ -1231,6 +1258,7 @@ local function locate(request) -- name, format, cache
cache = askedcache,
conversion = askedconversion,
resolution = askedresolution,
+ crop = askedcrop,
arguments = askedarguments,
})
end
@@ -1241,6 +1269,7 @@ local function locate(request) -- name, format, cache
return register(askedname, { -- these two are needed for hashing 'found'
conversion = askedconversion,
resolution = askedresolution,
+ crop = askedcrop,
arguments = askedarguments,
})
end
@@ -1373,7 +1402,7 @@ end
function figures.dummy(data)
data = data or callstack[#callstack] or lastfiguredata
local dr, du, nr = data.request, data.used, figures.boxnumber
- local box = hpack(node.new("hlist")) -- we need to set the dir (luatex 0.60 buglet)
+ local box = hpack(new_hlist()) -- we need to set the dir (luatex 0.60 buglet)
du.width = du.width or figures.defaultwidth
du.height = du.height or figures.defaultheight
du.depth = du.depth or figures.defaultdepth
@@ -1455,6 +1484,7 @@ function checkers.generic(data)
local size = dr.size or "crop"
local color = dr.color or "natural"
local mask = dr.mask or "none"
+ local crop = dr.crop or "none"
local conversion = dr.conversion
local resolution = dr.resolution
local arguments = dr.arguments
@@ -1476,6 +1506,7 @@ function checkers.generic(data)
size,
color,
mask,
+ crop,
conversion,
resolution,
arguments
@@ -2071,6 +2102,7 @@ implement {
{ "preview" },
{ "display" },
{ "mask" },
+ { "crop" },
{ "conversion" },
{ "resolution" },
{ "color" },
diff --git a/Master/texmf-dist/tex/context/base/mkiv/grph-inc.mkiv b/Master/texmf-dist/tex/context/base/mkiv/grph-inc.mkiv
index 0b8065989fc..05d4c3a572a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/grph-inc.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/grph-inc.mkiv
@@ -111,6 +111,7 @@
\c!ownerpassword =,
\c!compact =,
\c!cmyk =,
+ \c!crop =\v!yes,
]
%D Defining figures.
@@ -370,6 +371,7 @@
compact {\externalfigureparameter\c!compact}% experiment, share fonts
userpassword {\externalfigureparameter\c!userpassword}%
ownerpassword{\externalfigureparameter\c!ownerpassword}%
+ crop {\externalfigureparameter\c!crop}%
\ifx\p_width\empty \else
width \dimexpr\p_width\relax
\fi
diff --git a/Master/texmf-dist/tex/context/base/mkiv/grph-pat.lua b/Master/texmf-dist/tex/context/base/mkiv/grph-pat.lua
index 4310af672b7..7954e9fee0f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/grph-pat.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/grph-pat.lua
@@ -9,7 +9,8 @@ if not modules then modules = { } end modules ['grph-pat'] = {
-- This is just a proof of concept. Viewers behave different (offsets) and Acrobat doesn't
-- show xform based patterns.
--
--- This module will be cleaned up and use codeinjections and such.
+-- This module will be cleaned up and use codeinjections and such. It should be in the lpdf
+-- namespace.
local texsetbox = tex.setbox
local texgetbox = tex.getbox
diff --git a/Master/texmf-dist/tex/context/base/mkiv/grph-raw.lua b/Master/texmf-dist/tex/context/base/mkiv/grph-raw.lua
index 62e96fcc9d7..73f0d51755e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/grph-raw.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/grph-raw.lua
@@ -22,7 +22,8 @@ function figures.bitmapimage(t)
local xresolution = tonumber(t.xresolution)
local yresolution = tonumber(t.yresolution)
if data and xresolution and yresolution then
- local width, height = t.width or "", t.height or ""
+ local width = t.width or ""
+ local height = t.height or ""
local n = backends.nodeinjections.injectbitmap {
xresolution = xresolution,
yresolution = yresolution,
@@ -30,9 +31,11 @@ function figures.bitmapimage(t)
height = height ~= "" and texsp(height) or nil,
data = data,
colorspace = t.colorspace,
+ format = t.format,
}
if n then
- context.hbox(n)
+ -- context.hpack(n)
+ context(nodes.hpack(n))
else
report_bitmap("format no supported by backend")
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/l-dir.lua b/Master/texmf-dist/tex/context/base/mkiv/l-dir.lua
index 325039cb1e6..ac8e2f4e8e1 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/l-dir.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/l-dir.lua
@@ -230,18 +230,18 @@ if onwindows then -- we could sanitize here
-- pattern = Ct {
pattern = {
- [1] = (Cs(P(".") + slash^1) + Cs(R("az","AZ") * P(":") * slash^0) + Cc("./")) * V(2) * V(3),
- [2] = Cs(((1-S("*?/\\"))^0 * slash)^0),
- [3] = Cs(P(1)^0)
+ (Cs(P(".") + slash^1) + Cs(R("az","AZ") * P(":") * slash^0) + Cc("./")) * V(2) * V(3),
+ Cs(((1-S("*?/\\"))^0 * slash)^0),
+ Cs(P(1)^0)
}
else -- assume unix
-- pattern = Ct {
pattern = {
- [1] = (C(P(".") + P("/")^1) + Cc("./")) * V(2) * V(3),
- [2] = C(((1-S("*?/"))^0 * P("/"))^0),
- [3] = C(P(1)^0)
+ (C(P(".") + P("/")^1) + Cc("./")) * V(2) * V(3),
+ C(((1-S("*?/"))^0 * P("/"))^0),
+ C(P(1)^0)
}
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/l-file.lua b/Master/texmf-dist/tex/context/base/mkiv/l-file.lua
index d0af94f09d4..9f8fd654833 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/l-file.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/l-file.lua
@@ -456,7 +456,7 @@ function file.join(one, two, three, ...)
if not two then
return one == "" and one or lpegmatch(reslasher,one)
end
- if one == "" then
+ if not one or one == "" then
return lpegmatch(stripper,three and concat({ two, three, ... },"/") or two)
end
if lpegmatch(isnetwork,one) then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/l-gzip.lua b/Master/texmf-dist/tex/context/base/mkiv/l-gzip.lua
index f141b5ebbbe..aadb781da38 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/l-gzip.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/l-gzip.lua
@@ -5,176 +5,4 @@ if not modules then modules = { } end modules ['l-gzip'] = {
license = "see context related readme files"
}
--- We only have a few official methods here:
---
--- local decompressed = gzip.load (filename)
--- local resultsize = gzip.save (filename,compresslevel)
--- local compressed = gzip.compress (str,compresslevel)
--- local decompressed = gzip.decompress (str)
--- local iscompressed = gzip.compressed (str)
--- local suffix, okay = gzip.suffix (filename)
---
--- In LuaMetaTeX we have only xzip which implements a very few methods:
---
--- compress (str,level,method,window,memory,strategy)
--- decompress (str,window)
--- adler32 (str,checksum)
--- crc32 (str,checksum)
---
--- Special window values are:
---
--- flate : - 15
--- zlib : 15
--- gzip : 15 | 16
--- auto : 15 | 32
-
-gzip = gzip or { } -- so in luatex we keep the old ones too
-
-if not zlib then
- zlib = xzip -- in luametatex we shadow the old one
-elseif not xzip then
- xzip = zlib
-end
-
-if zlib then
-
- local suffix = file.suffix
- local suffixes = file.suffixes
- local find = string.find
- local openfile = io.open
-
- local gzipwindow = 15 + 16 -- +16: gzip, +32: gzip|zlib
- local gziplevel = 3
- local identifier = "^\x1F\x8B\x08"
-
- local compress = zlib.compress
- local decompress = zlib.decompress
-
- function gzip.load(filename)
- local f = openfile(filename,"rb")
- if not f then
- -- invalid file
- else
- local data = f:read("*all")
- f:close()
- if data and data ~= "" then
- if suffix(filename) == "gz" then
- data = decompress(data,gzipwindow)
- end
- return data
- end
- end
- end
-
- function gzip.save(filename,data,level)
- if suffix(filename) ~= "gz" then
- filename = filename .. ".gz"
- end
- local f = openfile(filename,"wb")
- if f then
- data = compress(data or "",level or gziplevel,nil,gzipwindow)
- f:write(data)
- f:close()
- return #data
- end
- end
-
- function gzip.suffix(filename)
- local suffix, extra = suffixes(filename)
- local gzipped = extra == "gz"
- return suffix, gzipped
- end
-
- function gzip.compressed(s)
- return s and find(s,identifier)
- end
-
- function gzip.compress(s,level)
- if s and not find(s,identifier) then -- the find check might go away
- if not level then
- level = gziplevel
- elseif level <= 0 then
- return s
- elseif level > 9 then
- level = 9
- end
- return compress(s,level or gziplevel,nil,gzipwindow) or s
- end
- end
-
- function gzip.decompress(s)
- if s and find(s,identifier) then
- return decompress(s,gzipwindow)
- else
- return s
- end
- end
-
-end
-
--- In luametatex we can use this one but it doesn't look like there wil be stream
--- support so for now we still use zlib (the performance difference is not that
--- spectacular in our usage.
-
--- if flate then
---
--- local type = type
--- local find = string.find
---
--- local compress = flate.gz_compress
--- local decompress = flate.gz_decompress
---
--- local absmax = 128*1024*1024
--- local initial = 64*1024
--- local identifier = "^\x1F\x8B\x08"
---
--- function gzip.compressed(s)
--- return s and find(s,identifier)
--- end
---
--- function gzip.compress(s,level)
--- if s and not find(s,identifier) then -- the find check might go away
--- if not level then
--- level = 3
--- elseif level <= 0 then
--- return s
--- elseif level > 9 then
--- level = 9
--- end
--- return compress(s,level) or s
--- end
--- end
---
--- function gzip.decompress(s,size,iterate)
--- if s and find(s,identifier) then
--- if type(size) ~= "number" then
--- size = initial
--- end
--- if size > absmax then
--- size = absmax
--- end
--- if type(iterate) == "number" then
--- max = size * iterate
--- elseif iterate == nil or iterate == true then
--- iterate = true
--- max = absmax
--- end
--- if max > absmax then
--- max = absmax
--- end
--- while true do
--- local d = decompress(s,size)
--- if d then
--- return d
--- end
--- size = 2 * size
--- if not iterate or size > max then
--- return false
--- end
--- end
--- else
--- return s
--- end
--- end
---
--- end
+-- now in util-zip
diff --git a/Master/texmf-dist/tex/context/base/mkiv/l-io.lua b/Master/texmf-dist/tex/context/base/mkiv/l-io.lua
index a955262a31e..6bf7a97bda2 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/l-io.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/l-io.lua
@@ -147,9 +147,12 @@ function io.copydata(source,target,action)
end
end
-function io.savedata(filename,data,joiner)
- local f = open(filename,"wb")
+function io.savedata(filename,data,joiner,append)
+ local f = open(filename,append and "ab" or "wb")
if f then
+ if append and joiner and f:seek("end") > 0 then
+ f:write(joiner)
+ end
if type(data) == "table" then
f:write(concat(data,joiner or ""))
elseif type(data) == "function" then
@@ -288,7 +291,8 @@ end
io.noflines = noflines
--- inlined is faster ... beware, better use util-fil
+-- inlined is faster ... beware, better use util-fil so these are obsolete
+-- and will go
local nextchar = {
[ 4] = function(f)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/l-lpeg.lua b/Master/texmf-dist/tex/context/base/mkiv/l-lpeg.lua
index b0868ba4886..5f3bea08ca6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/l-lpeg.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/l-lpeg.lua
@@ -507,7 +507,7 @@ end
-- todo: cache when string
-function lpeg.replacer(one,two,makefunction,isutf) -- in principle we should sort the keys
+function lpeg.replacer(one,two,makefunction,isutf) -- in principle we should sort the keys but we have a better one anyway
local pattern
local u = isutf and utf8char or 1
if type(one) == "table" then
@@ -665,12 +665,12 @@ end
-- lpeg.print(lpeg.P("a","b","c"))
-- lpeg.print(lpeg.S("a","b","c"))
--- print(lpeg.count("äáàa",lpeg.P("á") + lpeg.P("à")))
--- print(lpeg.count("äáàa",lpeg.UP("áà")))
--- print(lpeg.count("äáàa",lpeg.US("àá")))
--- print(lpeg.count("äáàa",lpeg.UR("aá")))
--- print(lpeg.count("äáàa",lpeg.UR("àá")))
--- print(lpeg.count("äáàa",lpeg.UR(0x0000,0xFFFF)))
+-- print(lpeg.counter(lpeg.P("á") + lpeg.P("à"))("äáàa"))
+-- print(lpeg.counter(lpeg.UP("áà"))("äáàa"))
+-- print(lpeg.counter(lpeg.US("àá"))("äáàa"))
+-- print(lpeg.counter(lpeg.UR("aá"))("äáàa"))
+-- print(lpeg.counter(lpeg.UR("àá"))("äáàa"))
+-- print(lpeg.counter(lpeg.UR(0x0000,0xFFFF)))
function lpeg.is_lpeg(p)
return p and lpegtype(p) == "pattern"
diff --git a/Master/texmf-dist/tex/context/base/mkiv/l-macro-imp-optimize.lua b/Master/texmf-dist/tex/context/base/mkiv/l-macro-imp-optimize.lua
index 1ecaef7d4c5..c343dfa742e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/l-macro-imp-optimize.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/l-macro-imp-optimize.lua
@@ -28,7 +28,7 @@ if LUAVERSION >= 5.3 and lua.macros then
-- This indirect method makes it possible to use both the functions
-- and the inline variant (which often looks better). Also, a mixed
- -- 5,2 and 5.3 source is not possible because the 5.2 doesn't deal
+ -- 5.2 and 5.3 source is not possible because the 5.2 doesn't deal
-- with the newer 5.3 syntax.
-- We need to check for 64 usage: 0xFFFFFFFFFFFFFFFF (-1)
@@ -44,6 +44,7 @@ lua.macros.resolvestring [[
#define extract1(a,b) ((a >> b) & 0x01)
#define extract2(a,b) ((a >> b) & 0x03)
#define extract4(a,b) ((a >> b) & 0x0F)
+#define extract8(a,b) ((a >> b) & 0xFF)
#define lshift(a,b) (((a)<<(b))&0xFFFFFFFF)
#define rshift(a,b) (((a)>>(b))&0xFFFFFFFF)
#define intdiv(a,b) ((a)//(b))
diff --git a/Master/texmf-dist/tex/context/base/mkiv/l-math.lua b/Master/texmf-dist/tex/context/base/mkiv/l-math.lua
index e5668a5db0a..6105bc3c2d7 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/l-math.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/l-math.lua
@@ -14,9 +14,19 @@ end
if not math.round then
- local floor = math.floor
+ if xmath then
+
+ math.round = xmath.round
+
+ else
- function math.round(x) return floor(x + 0.5) end
+ local floor = math.floor
+
+ function math.round(x)
+ return x < 0 and -floor(-x + 0.5) or floor(x + 0.5)
+ end
+
+ end
end
@@ -141,7 +151,7 @@ if not math.ult then
local floor = math.floor
- function math.tointeger(m,n)
+ function math.ult(m,n)
-- not ok but i'm not motivated to look into it now
return floor(m) < floor(n) -- unsigned comparison needed
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/l-number.lua b/Master/texmf-dist/tex/context/base/mkiv/l-number.lua
index 9fd2f82f785..0ec60880d75 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/l-number.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/l-number.lua
@@ -1,16 +1,13 @@
if not modules then modules = { } end modules ['l-number'] = {
version = 1.001,
- comment = "companion to luat-lib.mkiv",
+ comment = "companion to luat-lib.mkxl",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
--- this module will be replaced when we have the bit library .. the number based sets
--- might go away
-
local tostring, tonumber = tostring, tonumber
-local format, floor, match, rep = string.format, math.floor, string.match, string.rep
+local format, match, rep = string.format, string.match, string.rep
local concat, insert = table.concat, table.insert
local lpegmatch = lpeg.match
local floor = math.floor
@@ -18,51 +15,6 @@ local floor = math.floor
number = number or { }
local number = number
--- begin obsolete code --
-
--- if bit32 then
---
--- local btest, bor = bit32.btest, bit32.bor
---
--- function number.bit(p)
--- return 2 ^ (p - 1) -- 1-based indexing
--- end
---
--- number.hasbit = btest
--- number.setbit = bor
---
--- function number.setbit(x,p) -- why not bor?
--- return btest(x,p) and x or x + p
--- end
---
--- function number.clearbit(x,p)
--- return btest(x,p) and x - p or x
--- end
---
--- else
---
--- -- http://ricilake.blogspot.com/2007/10/iterating-bits-in-lua.html
---
--- function number.bit(p)
--- return 2 ^ (p - 1) -- 1-based indexing
--- end
---
--- function number.hasbit(x, p) -- typical call: if hasbit(x, bit(3)) then ...
--- return x % (p + p) >= p
--- end
---
--- function number.setbit(x, p)
--- return (x % (p + p) >= p) and x or x + p
--- end
---
--- function number.clearbit(x, p)
--- return (x % (p + p) >= p) and x - p or x
--- end
---
--- end
-
--- end obsolete code --
-
-- print(number.tobitstring(8))
-- print(number.tobitstring(14))
-- print(number.tobitstring(66))
diff --git a/Master/texmf-dist/tex/context/base/mkiv/l-os.lua b/Master/texmf-dist/tex/context/base/mkiv/l-os.lua
index 73841074c46..faae76881ac 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/l-os.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/l-os.lua
@@ -26,22 +26,27 @@ if not modules then modules = { } end modules ['l-os'] = {
-- math.randomseed(tonumber(string.sub(string.reverse(tostring(math.floor(socket.gettime()*10000))),1,6)))
local os = os
-local date, time = os.date, os.time
+local date, time, difftime = os.date, os.time, os.difftime
local find, format, gsub, upper, gmatch = string.find, string.format, string.gsub, string.upper, string.gmatch
local concat = table.concat
-local random, ceil, randomseed = math.random, math.ceil, math.randomseed
+local random, ceil, randomseed, modf = math.random, math.ceil, math.randomseed, math.modf
local type, setmetatable, tonumber, tostring = type, setmetatable, tonumber, tostring
-- This check needs to happen real early on. Todo: we can pick it up from the commandline
-- if we pass --binpath= (which is useful anyway)
do
+
local selfdir = os.selfdir
+
if selfdir == "" then
selfdir = nil
end
+
if not selfdir then
+
-- We need a fallback plan so let's see what we get.
+
if arg then
-- passed by mtx-context ... saves network access
for i=1,#arg do
@@ -52,6 +57,7 @@ do
end
end
end
+
if not selfdir then
selfdir = os.selfbin or "luatex"
if find(selfdir,"[/\\]") then
@@ -92,11 +98,16 @@ do
end
end
end
+
-- let's hope we're okay now
+
os.selfdir = selfdir or "."
+
end
+
+ -- print(os.selfdir) os.exit()
+
end
--- print(os.selfdir) os.exit()
-- The following code permits traversing the environment table, at least in luatex. Internally all
-- environment names are uppercase.
@@ -157,7 +168,7 @@ if not os.__getenv__ then
end
function os.getenv(k)
- local K = upper(k)
+ local K = upper(k) -- hm utf
local v = osenv[K] or osgetenv(K) or osgetenv(k)
if v == "" then
return nil
@@ -183,32 +194,14 @@ end
-- end of environment hack
-local execute = os.execute
-local iopopen = io.popen
-
-local function resultof(command)
- local handle = iopopen(command,"r") -- already has flush
- if handle then
- local result = handle:read("*all") or ""
- handle:close()
- return result
- else
- return ""
- end
-end
-
-os.resultof = resultof
-
-function os.pipeto(command)
- return iopopen(command,"w") -- already has flush
-end
-
if not io.fileseparator then
+
if find(os.getenv("PATH"),";",1,true) then
io.fileseparator, io.pathseparator, os.type = "\\", ";", os.type or "windows"
else
io.fileseparator, io.pathseparator, os.type = "/" , ":", os.type or "unix"
end
+
end
os.type = os.type or (io.pathseparator == ";" and "windows") or "unix"
@@ -220,351 +213,370 @@ else
os.libsuffix, os.binsuffix, os.binsuffixes = 'so', '', { '' }
end
-local launchers = {
- windows = "start %s",
- macosx = "open %s",
- unix = "xdg-open %s &> /dev/null &",
-}
+do
-function os.launch(str)
- local command = format(launchers[os.name] or launchers.unix,str)
- -- todo: pcall
--- print(command)
- execute(command)
-end
+ local execute = os.execute
+ local iopopen = io.popen
+ local ostype = os.type
+
+ local function resultof(command)
+ -- already has flush, b is new and we need it to pipe xz output
+ local handle = iopopen(command,ostype == "windows" and "rb" or "r")
+ if handle then
+ local result = handle:read("*all") or ""
+ handle:close()
+ return result
+ else
+ return ""
+ end
+ end
-local gettimeofday = os.gettimeofday or os.clock
-os.gettimeofday = gettimeofday
+ os.resultof = resultof
-local startuptime = gettimeofday()
+ function os.pipeto(command)
+ return iopopen(command,"w") -- already has flush
+ end
-function os.runtime()
- return gettimeofday() - startuptime
-end
+ local launchers = {
+ windows = "start %s",
+ macosx = "open %s",
+ unix = "xdg-open %s &> /dev/null &",
+ }
+
+ function os.launch(str)
+ local command = format(launchers[os.name] or launchers.unix,str)
+ -- todo: pcall
+ -- print(command)
+ execute(command)
+ end
--- print(os.gettimeofday()-os.time())
--- os.sleep(1.234)
--- print (">>",os.runtime())
--- print(os.date("%H:%M:%S",os.gettimeofday()))
--- print(os.date("%H:%M:%S",os.time()))
+end
--- no need for function anymore as we have more clever code and helpers now
--- this metatable trickery might as well disappear
+do
-local resolvers = os.resolvers or { }
-os.resolvers = resolvers
+ local gettimeofday = os.gettimeofday or os.clock
+ os.gettimeofday = gettimeofday
-setmetatable(os, { __index = function(t,k)
- local r = resolvers[k]
- return r and r(t,k) or nil -- no memoize
-end })
+ local startuptime = gettimeofday()
--- we can use HOSTTYPE on some platforms
+ function os.runtime()
+ return gettimeofday() - startuptime
+ end
-local name, platform = os.name or "linux", os.getenv("MTX_PLATFORM") or ""
+ -- print(os.gettimeofday()-os.time())
+ -- os.sleep(1.234)
+ -- print (">>",os.runtime())
+ -- print(os.date("%H:%M:%S",os.gettimeofday()))
+ -- print(os.date("%H:%M:%S",os.time()))
--- local function guess()
--- local architecture = resultof("uname -m") or ""
--- if architecture ~= "" then
--- return architecture
--- end
--- architecture = os.getenv("HOSTTYPE") or ""
--- if architecture ~= "" then
--- return architecture
--- end
--- return resultof("echo $HOSTTYPE") or ""
--- end
+end
+-- We can use HOSTTYPE on some platforms (but not consistently on e.g. Linux).
+--
-- os.bits = 32 | 64
+--
+-- os.uname() : return {
+-- machine = "x86_64",
+-- nodename = "MYLAPTOP",
+-- release = "build 9200",
+-- sysname = "Windows",
+-- version = "6.02",
+-- }
--- os.uname()
--- sysname
--- machine
--- release
--- version
--- nodename
-
-if platform ~= "" then
+do
- os.platform = platform
+ local name = os.name or "linux"
+ local platform = os.getenv("MTX_PLATFORM") or ""
+ local architecture = os.uname and os.uname().machine -- lmtx
+ local bits = os.getenv("MTX_BITS") or find(platform,"64") and 64 or 32
-elseif os.type == "windows" then
+ if platform ~= "" then
- -- we could set the variable directly, no function needed here
+ -- we're okay already
- -- PROCESSOR_ARCHITECTURE : binary platform
- -- PROCESSOR_ARCHITEW6432 : OS platform
+ elseif os.type == "windows" then
- -- mswin-64 is now win64
+ -- PROCESSOR_ARCHITECTURE : binary platform
+ -- PROCESSOR_ARCHITEW6432 : OS platform
- function resolvers.platform(t,k)
- local architecture = os.getenv("PROCESSOR_ARCHITECTURE") or ""
- local platform = ""
- if find(architecture,"AMD64",1,true) then
- platform = "win64"
+ architecture = string.lower(architecture or os.getenv("PROCESSOR_ARCHITECTURE") or "")
+ if architecture == "x86_64" then
+ bits, platform = 64, "win64"
+ elseif find(architecture,"amd64") then
+ bits, platform = 64, "win64"
+ elseif find(architecture,"arm64") then
+ bits, platform = 64, "windows-arm64"
+ elseif find(architecture,"arm32") then
+ bits, platform = 32, "windows-arm32"
else
- platform = "mswin"
+ bits, platform = 32, "mswin"
end
- os.setenv("MTX_PLATFORM",platform)
- os.platform = platform
- return platform
- end
-elseif name == "linux" then
-
- function resolvers.platform(t,k)
- -- we sometimes have HOSTTYPE set so let's check that first
- local architecture = os.getenv("HOSTTYPE") or resultof("uname -m") or ""
- local platform = os.getenv("MTX_PLATFORM") or ""
- local musl = find(os.selfdir or "","linuxmusl")
- if platform ~= "" then
- -- we're done
- elseif find(architecture,"x86_64",1,true) then
- platform = musl and "linuxmusl" or "linux-64"
- elseif find(architecture,"ppc",1,true) then
- platform = "linux-ppc"
+ elseif name == "linux" then
+
+ -- There is no way to detect if musl is used because there is no __MUSL__
+ -- and it looks like there never will be. Folks don't care about cases where
+ -- one ships multipe binaries (as with TeX distibutions) and want to select
+ -- the right one. So probably it expects users to compile locally in which
+ -- case we don't care to much as they can then sort it out.
+
+ architecture = architecture or os.getenv("HOSTTYPE") or resultof("uname -m") or ""
+ local musl = find(os.selfdir or "","linuxmusl")
+ if find(architecture,"x86_64") then
+ bits, platform = 64, musl and "linuxmusl" or "linux-64"
+ elseif find(architecture,"ppc") then
+ bits, platform = 32, "linux-ppc" -- this will be dropped
else
- platform = musl and "linuxmusl" or "linux"
+ bits, platform = 32, musl and "linuxmusl" or "linux"
end
- os.setenv("MTX_PLATFORM",platform)
- os.platform = platform
- return platform
- end
-elseif name == "macosx" then
-
- --[[
- Identifying the architecture of OSX is quite a mess and this
- is the best we can come up with. For some reason $HOSTTYPE is
- a kind of pseudo environment variable, not known to the current
- environment. And yes, uname cannot be trusted either, so there
- is a change that you end up with a 32 bit run on a 64 bit system.
- Also, some proper 64 bit intel macs are too cheap (low-end) and
- therefore not permitted to run the 64 bit kernel.
- ]]--
-
- function resolvers.platform(t,k)
- -- local platform = ""
- -- local architecture = os.getenv("HOSTTYPE") or ""
- -- if architecture == "" then
- -- architecture = resultof("echo $HOSTTYPE") or ""
- -- end
- local architecture = resultof("echo $HOSTTYPE") or ""
- local platform = ""
+ elseif name == "macosx" then
+
+ -- Identifying the architecture of OSX is quite a mess and this is the best
+ -- we can come up with. For some reason $HOSTTYPE is a kind of pseudo
+ -- environment variable, not known to the current environment. And yes,
+ -- uname cannot be trusted either, so there is a change that you end up with
+ -- a 32 bit run on a 64 bit system. Also, some proper 64 bit intel macs are
+ -- too cheap (low-end) and therefore not permitted to run the 64 bit kernel.
+
+ architecture = architecture or resultof("echo $HOSTTYPE") or ""
if architecture == "" then
- -- print("\nI have no clue what kind of OSX you're running so let's assume an 32 bit intel.\n")
- platform = "osx-intel"
- elseif find(architecture,"i386",1,true) then
- platform = "osx-intel"
- elseif find(architecture,"x86_64",1,true) then
- platform = "osx-64"
- elseif find(architecture,"arm64",1,true) then
- platform = "osx-64"
+ bits, platform = 64, "osx-intel"
+ elseif find(architecture,"i386") then
+ bits, platform = 64, "osx-intel"
+ elseif find(architecture,"x86_64") then
+ bits, platform = 64, "osx-64"
+ elseif find(architecture,"arm64") then
+ bits, platform = 64, "osx-arm"
else
- platform = "osx-ppc"
+ bits, platform = 32, "osx-ppc"
end
- os.setenv("MTX_PLATFORM",platform)
- os.platform = platform
- return platform
- end
-elseif name == "sunos" then
+ elseif name == "sunos" then
- function resolvers.platform(t,k)
- local architecture = resultof("uname -m") or ""
- local platform = ""
- if find(architecture,"sparc",1,true) then
- platform = "solaris-sparc"
+ architecture = architecture or resultof("uname -m") or ""
+ if find(architecture,"sparc") then
+ bits, platform = 32, "solaris-sparc"
else -- if architecture == 'i86pc'
- platform = "solaris-intel"
+ bits, platform = 32, "solaris-intel"
end
- os.setenv("MTX_PLATFORM",platform)
- os.platform = platform
- return platform
- end
-elseif name == "freebsd" then
+ elseif name == "freebsd" then
- function resolvers.platform(t,k)
- local architecture = resultof("uname -m") or ""
- local platform = ""
- if find(architecture,"amd64",1,true) then
- platform = "freebsd-amd64"
+ architecture = architecture or os.getenv("MACHTYPE") or resultof("uname -m") or ""
+ if find(architecture,"amd64") or find(architecture,"AMD64") then
+ bits, platform = 64, "freebsd-amd64"
else
- platform = "freebsd"
+ bits, platform = 32, "freebsd"
end
- os.setenv("MTX_PLATFORM",platform)
- os.platform = platform
- return platform
- end
-elseif name == "kfreebsd" then
+ elseif name == "kfreebsd" then
- function resolvers.platform(t,k)
- -- we sometimes have HOSTTYPE set so let's check that first
- local architecture = os.getenv("HOSTTYPE") or resultof("uname -m") or ""
- local platform = ""
- if find(architecture,"x86_64",1,true) then
- platform = "kfreebsd-amd64"
+ architecture = architecture or os.getenv("HOSTTYPE") or resultof("uname -m") or ""
+ if architecture == "x86_64" then
+ bits, platform = 64, "kfreebsd-amd64"
else
- platform = "kfreebsd-i386"
+ bits, platform = 32, "kfreebsd-i386"
end
- os.setenv("MTX_PLATFORM",platform)
- os.platform = platform
- return platform
- end
-else
+ else
- -- platform = "linux"
- -- os.setenv("MTX_PLATFORM",platform)
- -- os.platform = platform
+ architecture = architecture or resultof("uname -m") or ""
+
+ if find(architecture,"aarch64") then
+ bits, platform = "linux-aarch64"
+ elseif find(architecture,"armv7l") then
+ -- linux-armel
+ bits, platform = 32, "linux-armhf"
+ elseif find(architecture,"mips64") or find(architecture,"mips64el") then
+ bits, platform = 64, "linux-mipsel"
+ elseif find(architecture,"mipsel") or find(architecture,"mips") then
+ bits, platform = 32, "linux-mipsel"
+ else
+ bits, platform = 64, "linux-64" -- was 32, "linux"
+ end
- function resolvers.platform(t,k)
- local platform = "linux"
- os.setenv("MTX_PLATFORM",platform)
- os.platform = platform
- return platform
end
-end
+ os.setenv("MTX_PLATFORM",platform)
+ os.setenv("MTX_BITS", bits)
-os.newline = name == "windows" and "\013\010" or "\010" -- crlf or lf
+ os.platform = platform
+ os.bits = bits
+ os.newline = name == "windows" and "\013\010" or "\010" -- crlf or lf
-function resolvers.bits(t,k)
- local bits = find(os.platform,"64",1,true) and 64 or 32
- os.bits = bits
- return bits
end
-- beware, we set the randomseed
--- from wikipedia: Version 4 UUIDs use a scheme relying only on random numbers. This algorithm sets the
--- version number as well as two reserved bits. All other bits are set using a random or pseudorandom
--- data source. Version 4 UUIDs have the form xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx with hexadecimal
--- digits x and hexadecimal digits 8, 9, A, or B for y. e.g. f47ac10b-58cc-4372-a567-0e02b2c3d479.
---
--- as we don't call this function too often there is not so much risk on repetition
-
-local t = { 8, 9, "a", "b" }
-
-function os.uuid()
- return format("%04x%04x-4%03x-%s%03x-%04x-%04x%04x%04x",
- random(0xFFFF),random(0xFFFF),
- random(0x0FFF),
- t[ceil(random(4))] or 8,random(0x0FFF),
- random(0xFFFF),
- random(0xFFFF),random(0xFFFF),random(0xFFFF)
- )
+-- From wikipedia: Version 4 UUIDs use a scheme relying only on random numbers. This
+-- algorithm sets the version number as well as two reserved bits. All other bits
+-- are set using a random or pseudorandom data source. Version 4 UUIDs have the form
+-- xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx with hexadecimal digits x and hexadecimal
+-- digits 8, 9, A, or B for y. e.g. f47ac10b-58cc-4372-a567-0e02b2c3d479. As we don't
+-- call this function too often there is not so much risk on repetition.
+
+do
+
+ local t = { 8, 9, "a", "b" }
+
+ function os.uuid()
+ return format("%04x%04x-4%03x-%s%03x-%04x-%04x%04x%04x",
+ random(0xFFFF),random(0xFFFF),
+ random(0x0FFF),
+ t[ceil(random(4))] or 8,random(0x0FFF),
+ random(0xFFFF),
+ random(0xFFFF),random(0xFFFF),random(0xFFFF)
+ )
+ end
+
end
-local d
+do
-function os.timezone(delta)
- d = d or ((tonumber(date("%H")) or 0) - (tonumber(date("!%H")) or 0))
- if delta then
- if d > 0 then
- return format("+%02i:00",d)
+ -- this is fragile because it depends on time and so we only check once during
+ -- a run (the computer doesn't move zones) .. Michal Vlasák made a better one
+
+ -- local d
+ --
+ -- function os.timezone()
+ -- d = d or ((tonumber(date("%H")) or 0) - (tonumber(date("!%H")) or 0))
+ -- if d > 0 then
+ -- return format("+%02i:00",d)
+ -- else
+ -- return format("-%02i:00",-d)
+ -- end
+ -- end
+
+ local hour, min
+
+ function os.timezone(difference)
+ if not hour then
+ -- somehow looks too complex:
+ local current = time()
+ local utcdate = date("!*t", current)
+ local localdate = date("*t", current)
+ localdate.isdst = false
+ local timediff = difftime(time(localdate), time(utcdate))
+ hour, min = modf(timediff / 3600)
+ min = min * 60
+ end
+ if difference then
+ return hour, min
else
- return format("-%02i:00",-d)
+ return format("%+03d:%02d",hour,min) -- %+ means: always show sign
end
- else
- return 1
end
-end
-local timeformat = format("%%s%s",os.timezone(true))
-local dateformat = "!%Y-%m-%d %H:%M:%S"
-local lasttime = nil
-local lastdate = nil
-
-function os.fulltime(t,default)
- t = t and tonumber(t) or 0
- if t > 0 then
- -- valid time
- elseif default then
- return default
- else
- t = time()
- end
- if t ~= lasttime then
- lasttime = t
- lastdate = format(timeformat,date(dateformat))
+ -- localtime with timezone: 2021-10-22 10:22:54+02:00
+
+ local timeformat = format("%%s%s",os.timezone())
+ local dateformat = "%Y-%m-%d %H:%M:%S"
+ local lasttime = nil
+ local lastdate = nil
+
+ function os.fulltime(t,default)
+ t = t and tonumber(t) or 0
+ if t > 0 then
+ -- valid time
+ elseif default then
+ return default
+ else
+ t = time()
+ end
+ if t ~= lasttime then
+ lasttime = t
+ lastdate = format(timeformat,date(dateformat))
+ end
+ return lastdate
end
- return lastdate
-end
-local dateformat = "%Y-%m-%d %H:%M:%S"
-local lasttime = nil
-local lastdate = nil
+ -- localtime without timezone: 2021-10-22 10:22:54
-function os.localtime(t,default)
- t = t and tonumber(t) or 0
- if t > 0 then
- -- valid time
- elseif default then
- return default
- else
- t = time()
+ local dateformat = "%Y-%m-%d %H:%M:%S"
+ local lasttime = nil
+ local lastdate = nil
+
+ function os.localtime(t,default)
+ t = t and tonumber(t) or 0
+ if t > 0 then
+ -- valid time
+ elseif default then
+ return default
+ else
+ t = time()
+ end
+ if t ~= lasttime then
+ lasttime = t
+ lastdate = date(dateformat,t)
+ end
+ return lastdate
end
- if t ~= lasttime then
- lasttime = t
- lastdate = date(dateformat,t)
+
+ function os.converttime(t,default)
+ local t = tonumber(t)
+ if t and t > 0 then
+ return date(dateformat,t)
+ else
+ return default or "-"
+ end
end
- return lastdate
-end
-function os.converttime(t,default)
- local t = tonumber(t)
- if t and t > 0 then
- return date(dateformat,t)
- else
- return default or "-"
+ -- table with values
+
+ function os.today()
+ return date("!*t")
+ end
+
+ -- utc time without timezone: 2021-10-22 08:22:54
+
+ function os.now()
+ return date("!%Y-%m-%d %H:%M:%S")
end
+
end
-local memory = { }
-
-local function which(filename)
- local fullname = memory[filename]
- if fullname == nil then
- local suffix = file.suffix(filename)
- local suffixes = suffix == "" and os.binsuffixes or { suffix }
- for directory in gmatch(os.getenv("PATH"),"[^" .. io.pathseparator .."]+") do
- local df = file.join(directory,filename)
- for i=1,#suffixes do
- local dfs = file.addsuffix(df,suffixes[i])
- if io.exists(dfs) then
- fullname = dfs
- break
+do
+
+ local cache = { }
+
+ local function which(filename)
+ local fullname = cache[filename]
+ if fullname == nil then
+ local suffix = file.suffix(filename)
+ local suffixes = suffix == "" and os.binsuffixes or { suffix }
+ for directory in gmatch(os.getenv("PATH"),"[^" .. io.pathseparator .."]+") do
+ local df = file.join(directory,filename)
+ for i=1,#suffixes do
+ local dfs = file.addsuffix(df,suffixes[i])
+ if io.exists(dfs) then
+ fullname = dfs
+ break
+ end
end
end
+ if not fullname then
+ fullname = false
+ end
+ cache[filename] = fullname
end
- if not fullname then
- fullname = false
- end
- memory[filename] = fullname
+ return fullname
end
- return fullname
-end
-os.which = which
-os.where = which
+ os.which = which
+ os.where = which
-function os.today()
- return date("!*t") -- table with values
-end
+ -- print(os.which("inkscape.exe"))
+ -- print(os.which("inkscape"))
+ -- print(os.which("gs.exe"))
+ -- print(os.which("ps2pdf"))
-function os.now()
- return date("!%Y-%m-%d %H:%M:%S") -- 2011-12-04 14:59:12
end
--- if not os.sleep and socket then
--- os.sleep = socket.sleep
--- end
-
if not os.sleep then
+
local socket = socket
+
function os.sleep(n)
if not socket then
-- so we delay ... if os.sleep is really needed then one should also
@@ -573,101 +585,105 @@ if not os.sleep then
end
socket.sleep(n)
end
-end
-
--- print(os.which("inkscape.exe"))
--- print(os.which("inkscape"))
--- print(os.which("gs.exe"))
--- print(os.which("ps2pdf"))
-
--- These are moved from core-con.lua (as I needed them elsewhere).
-local function isleapyear(year) -- timed for bram's cs practicum
- -- return (year % 400 == 0) or (year % 100 ~= 0 and year % 4 == 0) -- 3:4:1600:1900 = 9.9 : 8.2 : 5.0 : 6.8 (29.9)
- return (year % 4 == 0) and (year % 100 ~= 0 or year % 400 == 0) -- 3:4:1600:1900 = 5.1 : 6.5 : 8.1 : 10.2 (29.9)
- -- return (year % 4 == 0) and (year % 400 == 0 or year % 100 ~= 0) -- 3:4:1600:1900 = 5.2 : 8.5 : 6.8 : 10.1 (30.6)
end
-os.isleapyear = isleapyear
+-- These are moved from core-con.lua (as I needed them elsewhere).
--- nicer:
---
--- local days = {
--- [false] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
--- [true] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
--- }
---
--- local function nofdays(year,month)
--- return days[isleapyear(year)][month]
--- return month == 2 and isleapyear(year) and 29 or days[month]
--- end
---
--- more efficient:
+do
-local days = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
+ local function isleapyear(year) -- timed for bram's cs practicum
+ -- return (year % 400 == 0) or (year % 100 ~= 0 and year % 4 == 0) -- 3:4:1600:1900 = 9.9 : 8.2 : 5.0 : 6.8 (29.9)
+ return (year % 4 == 0) and (year % 100 ~= 0 or year % 400 == 0) -- 3:4:1600:1900 = 5.1 : 6.5 : 8.1 : 10.2 (29.9)
+ -- return (year % 4 == 0) and (year % 400 == 0 or year % 100 ~= 0) -- 3:4:1600:1900 = 5.2 : 8.5 : 6.8 : 10.1 (30.6)
+ end
-local function nofdays(year,month,day)
- if not month then
- return isleapyear(year) and 365 or 364
- elseif not day then
- return month == 2 and isleapyear(year) and 29 or days[month]
- else
- for i=1,month-1 do
- day = day + days[i]
- end
- if month > 2 and isleapyear(year) then
- day = day + 1
+ os.isleapyear = isleapyear
+
+ -- nicer:
+ --
+ -- local days = {
+ -- [false] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
+ -- [true] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
+ -- }
+ --
+ -- local function nofdays(year,month)
+ -- return days[isleapyear(year)][month]
+ -- return month == 2 and isleapyear(year) and 29 or days[month]
+ -- end
+ --
+ -- more efficient:
+
+ local days = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
+
+ local function nofdays(year,month,day)
+ if not month then
+ return isleapyear(year) and 365 or 364
+ elseif not day then
+ return month == 2 and isleapyear(year) and 29 or days[month]
+ else
+ for i=1,month-1 do
+ day = day + days[i]
+ end
+ if month > 2 and isleapyear(year) then
+ day = day + 1
+ end
+ return day
end
- return day
end
-end
-
-os.nofdays = nofdays
-function os.weekday(day,month,year)
- return date("%w",time { year = year, month = month, day = day }) + 1
-end
+ os.nofdays = nofdays
-function os.validdate(year,month,day)
- -- we assume that all three values are set
- -- year is always ok, even if lua has a 1970 time limit
- if month < 1 then
- month = 1
- elseif month > 12 then
- month = 12
+ function os.weekday(day,month,year)
+ return date("%w",time { year = year, month = month, day = day }) + 1
end
- if day < 1 then
- day = 1
- else
- local max = nofdays(year,month)
- if day > max then
- day = max
+
+ function os.validdate(year,month,day)
+ -- we assume that all three values are set
+ -- year is always ok, even if lua has a 1970 time limit
+ if month < 1 then
+ month = 1
+ elseif month > 12 then
+ month = 12
end
+ if day < 1 then
+ day = 1
+ else
+ local max = nofdays(year,month)
+ if day > max then
+ day = max
+ end
+ end
+ return year, month, day
end
- return year, month, day
-end
-function os.date(fmt,...)
- if not fmt then
- -- otherwise differences between unix, mingw and msvc
- fmt = "%Y-%m-%d %H:%M"
+ function os.date(fmt,...)
+ if not fmt then
+ -- otherwise differences between unix, mingw and msvc
+ fmt = "%Y-%m-%d %H:%M"
+ end
+ return date(fmt,...)
end
- return date(fmt,...)
+
end
-local osexit = os.exit
-local exitcode = nil
+do
-function os.setexitcode(code)
- exitcode = code
-end
+ local osexit = os.exit
+ local exitcode = nil
-function os.exit(c)
- if exitcode ~= nil then
- return osexit(exitcode)
+ function os.setexitcode(code)
+ exitcode = code
end
- if c ~= nil then
- return osexit(c)
+
+ function os.exit(c)
+ if exitcode ~= nil then
+ return osexit(exitcode)
+ end
+ if c ~= nil then
+ return osexit(c)
+ end
+ return osexit()
end
- return osexit()
+
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/l-string.lua b/Master/texmf-dist/tex/context/base/mkiv/l-string.lua
index 1dee85e2894..476820a175b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/l-string.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/l-string.lua
@@ -7,7 +7,7 @@ if not modules then modules = { } end modules ['l-string'] = {
}
local string = string
-local sub, gmatch, format, char, byte, rep, lower = string.sub, string.gmatch, string.format, string.char, string.byte, string.rep, string.lower
+local sub, gmatch, format, char, byte, rep, lower, find = string.sub, string.gmatch, string.format, string.char, string.byte, string.rep, string.lower, string.find
local lpegmatch, patterns = lpeg.match, lpeg.patterns
local P, S, C, Ct, Cc, Cs = lpeg.P, lpeg.S, lpeg.C, lpeg.Ct, lpeg.Cc, lpeg.Cs
@@ -52,10 +52,26 @@ function string.quoted(str)
return format("%q",str) -- always double quote
end
-function string.count(str,pattern) -- variant 3
+-- function string.count(str,pattern) -- variant 3
+-- local n = 0
+-- for _ in gmatch(str,pattern) do -- not for utf
+-- n = n + 1
+-- end
+-- return n
+-- end
+
+function string.count(str,pattern)
local n = 0
- for _ in gmatch(str,pattern) do -- not for utf
- n = n + 1
+ local i = 1
+ local l = #pattern
+ while true do
+ i = find(str,pattern,i)
+ if i then
+ n = n + 1
+ i = i + l
+ else
+ break
+ end
end
return n
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/l-url.lua b/Master/texmf-dist/tex/context/base/mkiv/l-url.lua
index 6f834d778d1..2e01ad40808 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/l-url.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/l-url.lua
@@ -379,53 +379,53 @@ end
-- print(url.barepath("/test"),url.barepath("test/"),url.barepath("/test/"),url.barepath("test"))
-- print(url.barepath("/x/yz"),url.barepath("x/yz/"),url.barepath("/x/yz/"),url.barepath("x/yz"))
---~ print(url.filename("file:///c:/oeps.txt"))
---~ print(url.filename("c:/oeps.txt"))
---~ print(url.filename("file:///oeps.txt"))
---~ print(url.filename("file:///etc/test.txt"))
---~ print(url.filename("/oeps.txt"))
-
---~ from the spec on the web (sort of):
-
---~ local function test(str)
---~ local t = url.hashed(str)
---~ t.constructed = url.construct(t)
---~ print(table.serialize(t))
---~ end
-
---~ inspect(url.hashed("http://www.pragma-ade.com/test%20test?test=test%20test&x=123%3d45"))
---~ inspect(url.hashed("http://www.pragma-ade.com/test%20test?test=test%20test&x=123%3d45"))
-
---~ test("sys:///./colo-rgb")
-
---~ test("/data/site/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733/figuur-cow.jpg")
---~ test("file:///M:/q2p/develop/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733")
---~ test("M:/q2p/develop/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733")
---~ test("file:///q2p/develop/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733")
---~ test("/q2p/develop/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733")
-
---~ test("file:///cow%20with%20spaces")
---~ test("file:///cow%20with%20spaces.pdf")
---~ test("cow%20with%20spaces.pdf")
---~ test("some%20file")
---~ test("/etc/passwords")
---~ test("http://www.myself.com/some%20words.html")
---~ test("file:///c:/oeps.txt")
---~ test("file:///c|/oeps.txt")
---~ test("file:///etc/oeps.txt")
---~ test("file://./etc/oeps.txt")
---~ test("file:////etc/oeps.txt")
---~ test("ftp://ftp.is.co.za/rfc/rfc1808.txt")
---~ test("http://www.ietf.org/rfc/rfc2396.txt")
---~ test("ldap://[2001:db8::7]/c=GB?objectClass?one#what")
---~ test("mailto:John.Doe@example.com")
---~ test("news:comp.infosystems.www.servers.unix")
---~ test("tel:+1-816-555-1212")
---~ test("telnet://192.0.2.16:80/")
---~ test("urn:oasis:names:specification:docbook:dtd:xml:4.1.2")
---~ test("http://www.pragma-ade.com/spaced%20name")
-
---~ test("zip:///oeps/oeps.zip#bla/bla.tex")
---~ test("zip:///oeps/oeps.zip?bla/bla.tex")
-
---~ table.print(url.hashed("/test?test"))
+-- print(url.filename("file:///c:/oeps.txt"))
+-- print(url.filename("c:/oeps.txt"))
+-- print(url.filename("file:///oeps.txt"))
+-- print(url.filename("file:///etc/test.txt"))
+-- print(url.filename("/oeps.txt"))
+
+-- from the spec on the web (sort of):
+
+-- local function test(str)
+-- local t = url.hashed(str)
+-- t.constructed = url.construct(t)
+-- print(table.serialize(t))
+-- end
+
+-- inspect(url.hashed("http://www.pragma-ade.com/test%20test?test=test%20test&x=123%3d45"))
+-- inspect(url.hashed("http://www.pragma-ade.com/test%20test?test=test%20test&x=123%3d45"))
+
+-- test("sys:///./colo-rgb")
+
+-- test("/data/site/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733/figuur-cow.jpg")
+-- test("file:///M:/q2p/develop/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733")
+-- test("M:/q2p/develop/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733")
+-- test("file:///q2p/develop/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733")
+-- test("/q2p/develop/output/q2p-develop/resources/ecaboperception4_res/topicresources/58313733")
+
+-- test("file:///cow%20with%20spaces")
+-- test("file:///cow%20with%20spaces.pdf")
+-- test("cow%20with%20spaces.pdf")
+-- test("some%20file")
+-- test("/etc/passwords")
+-- test("http://www.myself.com/some%20words.html")
+-- test("file:///c:/oeps.txt")
+-- test("file:///c|/oeps.txt")
+-- test("file:///etc/oeps.txt")
+-- test("file://./etc/oeps.txt")
+-- test("file:////etc/oeps.txt")
+-- test("ftp://ftp.is.co.za/rfc/rfc1808.txt")
+-- test("http://www.ietf.org/rfc/rfc2396.txt")
+-- test("ldap://[2001:db8::7]/c=GB?objectClass?one#what")
+-- test("mailto:John.Doe@example.com")
+-- test("news:comp.infosystems.www.servers.unix")
+-- test("tel:+1-816-555-1212")
+-- test("telnet://192.0.2.16:80/")
+-- test("urn:oasis:names:specification:docbook:dtd:xml:4.1.2")
+-- test("http://www.pragma-ade.com/spaced%20name")
+
+-- test("zip:///oeps/oeps.zip#bla/bla.tex")
+-- test("zip:///oeps/oeps.zip?bla/bla.tex")
+
+-- table.print(url.hashed("/test?test"))
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-def.mkiv b/Master/texmf-dist/tex/context/base/mkiv/lang-def.mkiv
index 85c1f3ac775..19f431ebf56 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lang-def.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-def.mkiv
@@ -269,6 +269,23 @@
\c!rightquotation=\leftguillemot,
\c!date={\v!day,{.},\space,\v!month,\space,\v!year}]
+\installlanguage
+ [\s!hy]
+ [\c!spacing=\v!packed,
+ \c!leftsentence=\endash, % *sentences not confirmed
+ \c!rightsentence=\endash,
+ \c!leftsubsentence=\endash,
+ \c!rightsubsentence=\endash,
+ \c!leftquote=\guilsingleleft,
+ \c!rightquote=\guilsingleright,
+ \c!leftquotation=\leftguillemot
+ \c!rightquotation=\rightguillemot
+ \c!date={\v!day,\space,\v!month,\space,\v!year}, % word
+ % \c!date={\v!day,{.},\v!month,{.},\v!year}, % numbers
+ \s!patterns=\s!hy,
+ \s!lefthyphenmin=2,
+ \s!righthyphenmin=2]
+
\installlanguage [\s!polish] [\s!pl]
\installlanguage [\s!czech] [\s!cs]
\installlanguage [\s!slovak] [\s!sk]
@@ -276,6 +293,10 @@
\installlanguage [\s!slovenian] [\s!sl]
\installlanguage [slovene] [\s!sl] % both possible (mojca: still needed?)
+\installlanguage [\s!armenian] [\s!hy]
+\installlanguage [\s!hye] [\s!hy] % Eastern Armenian
+\installlanguage [\s!hyw] [\s!hy] % Western Armenian
+
% Cyrillic Languages
\installlanguage
@@ -350,6 +371,21 @@
\c!rightquotation=\upperrightdoublesixquote,
\c!date={\v!day,\space,\v!month,\space,\v!year}]
+\installlanguage
+ [\s!bg]
+ [\s!lefthyphenmin=2,
+ \s!righthyphenmin=2,
+ \c!spacing=\v!packed,
+ \c!leftsentence=\leftguillemot,
+ \c!rightsentence=\rightguillemot,
+ \c!leftsubsentence=\lowerleftdoubleninequote,
+ \c!rightsubsentence=\upperrightdoubleninequote,
+ \c!leftquote=\lowerleftsingleninequote,
+ \c!rightquote=\upperrightsinglesixquote,
+ \c!leftquotation=\lowerleftdoubleninequote,
+ \c!rightquotation=\upperrightdoublesixquote,
+ \c!date={\v!day,\space,\v!month,\space,\v!year}]
+
\installlanguage [\s!russian] [\s!ru]
\installlanguage [\s!ukrainian] [\s!ua]
\installlanguage [\s!belarussian][\s!be]
@@ -357,6 +393,7 @@
\installlanguage [\s!sr-latn] [\s!sr]
\installlanguage [\s!sr-cyrl] [\s!sr]
\installlanguage [\s!macedonian] [\s!mk]
+\installlanguage [\s!bulgarian] [\s!bg]
% Uralic Languages: Cheremiss, Estonian, Finnish, Karelian, Laap,
@@ -486,7 +523,7 @@
\installlanguage [\s!arabic] [\s!ar]
\installlanguage
- [\s!pe]
+ [\s!farsi]
[\c!spacing=\v!broad,
\c!leftsentence=\emdash,
\c!rightsentence=\emdash,
@@ -498,9 +535,9 @@
\c!rightquotation=\rightguillemot,
\c!date={\v!day,\space,\v!month,\space,\v!year}]
-\installlanguage [\s!persian] [\s!pe]
-\installlanguage [\s!fa] [\s!pe] % these two are redundant but sometimes might
-\installlanguage [\s!farsi] [\s!fa] % sound more natural .. best set labels to 'pe'
+\installlanguage [\s!fa] [\s!farsi]
+\installlanguage [\s!persian] [\s!farsi]
+\installlanguage [\s!pe] [\s!farsi]
% Just aliases to "ar" for now
@@ -538,21 +575,23 @@
% Artificial Languages: Esperanto
\installlanguage
- [\s!esperanto]
- [%\c!spacing=\v!packed,
- %\c!leftsentence=\emdash,
- %\c!rightsentence=\emdash,
- %\c!leftsubsentence=\emdash,
- %\c!rightsubsentence=\emdash,
- %\c!leftquote=\lowerleftdoubleninequote,
- %\c!rightquote=\upperrightdoublesixquote,
- %\c!leftquotation=\lowerleftdoubleninequote,
- %\c!rightquotation=\upperrightdoublesixquote,
- %\c!date={\v!year,~m.,\space,\v!month,\space,\v!day,~d.},
+ [\s!eo]
+ [\c!spacing=\v!packed,
+ \c!leftsentence=\endash,
+ \c!rightsentence=\endash,
+ \c!leftsubsentence=\endash,
+ \c!rightsubsentence=\endash,
+ \c!leftquote=\upperleftsinglesixquote, %U+2018,
+ \c!rightquote=\upperrightsingleninequote, %U+2019,
+ \c!leftquotation=\upperleftdoublesixquote, %U+201C,
+ \c!rightquotation=\upperrightdoubleninequote, %U+201D,
+ \c!date={\v!day,-a\space de\space,\v!month,\space \v!year},
\s!patterns=eo,
\s!lefthyphenmin=2,
\s!righthyphenmin=2]
+\installlanguage[\s!esperanto][\c!default=\s!eo]
+
% Baltic Languages: Lettish/Latvian, Lietuvių/Lithuanian
\installlanguage
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-dis.lua b/Master/texmf-dist/tex/context/base/mkiv/lang-dis.lua
index 3e4678801f5..f6b27175cb6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lang-dis.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-dis.lua
@@ -36,8 +36,7 @@ local isglyph = nuts.isglyph
local copy_node = nuts.copy
local remove_node = nuts.remove
-local flush_list = nuts.flush_list
-local flush_node = nuts.flush_node
+----- flushnode = nuts.flushnode
local nextdisc = nuts.traversers.disc
@@ -124,12 +123,12 @@ end
local wiped = 0
-local flatten_discretionaries = nuts.flatten_discretionaries -- todo in nodes
+local flattendiscretionaries = nuts.flattendiscretionaries -- todo in nodes
--- if flatten_discretionaries then
+-- if flattendiscretionaries then
function languages.flatten(head)
- local h, n = flatten_discretionaries(head)
+ local h, n = flattendiscretionaries(head)
wiped = wiped + n
return h, n > 0
end
@@ -152,7 +151,7 @@ local flatten_discretionaries = nuts.flatten_discretionaries -- todo in nodes
-- head = h
-- end
-- wiped = wiped + 1
--- flush_node(delayed)
+-- flushnode(delayed)
-- return head
-- end
--
@@ -202,7 +201,7 @@ function languages.explicithyphen(template)
local pre, post
local disc = new_disc()
if template then
- local langdata = getlanguagedata(getlang(template))
+ local langdata = getlanguagedata(getlanguage(template))
local instance = langdata and langdata.instance
if instance then
local prechr = prehyphenchar(instance)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-exp.lua b/Master/texmf-dist/tex/context/base/mkiv/lang-exp.lua
index c2eb46990aa..758ab0f779e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lang-exp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-exp.lua
@@ -46,7 +46,7 @@ if LUATEXVERSION < 1.005 then -- not loaded any more
local char = isglyph(pre)
if char and char <= 0 then
done = true
- flush_list(pre)
+ flushlist(pre)
pre = nil
end
end
@@ -54,7 +54,7 @@ if LUATEXVERSION < 1.005 then -- not loaded any more
local char = isglyph(post)
if char and char <= 0 then
done = true
- flush_list(post)
+ flushlist(post)
post = nil
end
end
@@ -179,7 +179,7 @@ languages.expanders = expanders
-- expanded = function(head)
-- local done = hyphenate(head)
-- if done then
--- for d in traverse_id(disc_code,head) do
+-- for d in traverseid(disc_code,head) do
-- local s = getsubtype(d)
-- if s ~= discretionary_code then
-- expanders[s](d,template)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-hyp.lua b/Master/texmf-dist/tex/context/base/mkiv/lang-hyp.lua
index ca9f519cee4..e098e93af5f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lang-hyp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-hyp.lua
@@ -656,12 +656,12 @@ if context then
local setprev = nuts.setprev
local setnext = nuts.setnext
- local insert_before = nuts.insert_before
- local insert_after = nuts.insert_after
+ local insertbefore = nuts.insertbefore
+ local insertafter = nuts.insertafter
local copy_node = nuts.copy
- local copy_list = nuts.copy_list
+ local copylist = nuts.copylist
local remove_node = nuts.remove
- local end_of_math = nuts.end_of_math
+ local endofmath = nuts.endofmath
local node_tail = nuts.tail
local nexthlist = nuts.traversers.hlist
@@ -1014,7 +1014,7 @@ featureset.hyphenonly = hyphenonly == v_yes
-- [nodecodes.rule] = true,
-- [nodecodes.dir] = true,
-- [nodecodes.whatsit] = true,
- -- [nodecodes.ins] = true,
+ -- [nodecodes.insert] = true,
-- [nodecodes.adjust] = true,
--
-- [nodecodes.math] = true,
@@ -1087,7 +1087,7 @@ featureset.hyphenonly = hyphenonly == v_yes
nuts.setvisual(p,"penalty")
end
last = getprev(last)
- first, last = insert_after(first,last,p)
+ first, last = insertafter(first,last,p)
end
local function synchronizefeatureset(a)
@@ -1245,7 +1245,7 @@ featureset.hyphenonly = hyphenonly == v_yes
local glyph = copy_node(stop)
setchar(glyph,characters[replacement])
if head then
- insert_after(current,current,glyph)
+ insertafter(current,current,glyph)
else
head = glyph
end
@@ -1256,7 +1256,7 @@ featureset.hyphenonly = hyphenonly == v_yes
local glyph = copy_node(stop)
setchar(glyph,characters[list[i]])
if head then
- insert_after(current,current,glyph)
+ insertafter(current,current,glyph)
else
head = glyph
end
@@ -1265,7 +1265,7 @@ featureset.hyphenonly = hyphenonly == v_yes
end
if rightchar then
local glyph = copy_node(stop)
- insert_after(current,current,glyph)
+ insertafter(current,current,glyph)
setchar(glyph,rightchar)
end
return head
@@ -1291,7 +1291,7 @@ featureset.hyphenonly = hyphenonly == v_yes
setattrlist(disc,attrnode)
end
-- could be a replace as well
- insert_before(first,current,disc)
+ insertbefore(first,current,disc)
elseif type(r) == "table" then
local disc = new_disc()
local pre = r[1]
@@ -1325,7 +1325,7 @@ featureset.hyphenonly = hyphenonly == v_yes
if attrnode then
setattrlist(disc,attrnode)
end
- insert_before(first,current,disc)
+ insertbefore(first,current,disc)
else
setchar(current,characters[r])
if i < rsize then
@@ -1347,7 +1347,7 @@ featureset.hyphenonly = hyphenonly == v_yes
if first ~= current then
local disc = new_disc()
first, current, glyph = remove_node(first,current)
- first, current = insert_before(first,current,disc)
+ first, current = insertbefore(first,current,disc)
if trace_visualize then
setcolor(glyph,"darkred") -- these get checked
setcolor(disc,"darkgreen") -- in the colorizer
@@ -1372,7 +1372,7 @@ featureset.hyphenonly = hyphenonly == v_yes
local function injectseries(current,last,next,attrnode)
local disc = new_disc()
local start = current
- first, current = insert_before(first,current,disc)
+ first, current = insertbefore(first,current,disc)
setprev(start)
setnext(last)
if next then
@@ -1380,7 +1380,7 @@ featureset.hyphenonly = hyphenonly == v_yes
else
setnext(current)
end
- local pre = copy_list(start)
+ local pre = copylist(start)
local post = nil
local replace = start
setdisc(disc,pre,post,replace,automaticdisc_code,hyphenpenalty) -- ex ?
@@ -1547,10 +1547,10 @@ featureset.hyphenonly = hyphenonly == v_yes
skipping = true
end
-- elseif strict and strict[id] then
- -- current = id == math_code and getnext(end_of_math(current)) or getnext(current)
+ -- current = id == math_code and getnext(endofmath(current)) or getnext(current)
-- size = 0
else
- current = id == math_code and getnext(end_of_math(current)) or getnext(current)
+ current = id == math_code and getnext(endofmath(current)) or getnext(current)
end
if size > 0 then
if dictionary and size > charmin and leftmin + rightmin <= size then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-imp-indic.lua b/Master/texmf-dist/tex/context/base/mkiv/lang-imp-indic.lua
new file mode 100644
index 00000000000..164b765cc02
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-imp-indic.lua
@@ -0,0 +1,2282 @@
+return {
+
+ name = "indic transliterations",
+ version = "1.00",
+ comment = "Experimental code, the name of this file might change"
+ .. "or maybe it become a llg file in the end.",
+ author = "Sreeram and Hans",
+ copyright = "ConTeXt development team & whoever made this list",
+
+ transliterations = {
+ ["iast to deva"] = {
+ mapping = {
+ --- vowels
+ ["a"] = "अ",
+ ["Ä"] = "आ",
+ ["i"] = "इ",
+ ["ī"] = "ई",
+ ["u"] = "उ",
+ ["ū"] = "ऊ",
+ ["ṛ"] = "ऋ",
+ ["á¹"] = "ॠ",
+ ["ḷ"] = "ऌ",
+ ["ḹ"] = "ॡ",
+ ["è"] = "ऎ",
+ ["e"] = "à¤",
+ ["ai"] = "à¤",
+ ["ò"] = "ऒ",
+ ["o"] = "ओ",
+ ["au"] = "औ",
+ --- consonant forms
+ ["ka"] = "क",
+ ["kÄ"] = "का",
+ ["ki"] = "कि",
+ ["kī"] = "की",
+ ["ku"] = "कà¥",
+ ["kū"] = "कू",
+ ["ke"] = "के",
+ ["ko"] = "को",
+ ["kai"] = "कै",
+ ["kau"] = "कौ",
+ ["kḷ"] = "कॢ",
+ ["kḹ"] = "कॣ",
+ ["kṛ"] = "कृ",
+ ["ká¹"] = "कॄ",
+ ---
+ ["kha"] = "ख",
+ ["khÄ"] = "खा",
+ ["khi"] = "खि",
+ ["khī"] = "खी",
+ ["khu"] = "खà¥",
+ ["khū"] = "खू",
+ ["khe"] = "खे",
+ ["kho"] = "खो",
+ ["khai"] = "खै",
+ ["khau"] = "खौ",
+ ["khḷ"] = "खॢ",
+ ["khḹ"] = "खॣ",
+ ["khṛ"] = "खृ",
+ ["khá¹"] = "खॄ",
+ ---
+ ["ga"] = "ग",
+ ["gÄ"] = "गा",
+ ["gi"] = "गि",
+ ["gī"] = "गी",
+ ["gu"] = "गà¥",
+ ["gū"] = "गू",
+ ["ge"] = "गे",
+ ["go"] = "गो",
+ ["gai"] = "गै",
+ ["gau"] = "गौ",
+ ["gḷ"] = "गॢ",
+ ["gḹ"] = "गॣ",
+ ["gṛ"] = "गृ",
+ ["gá¹"] = "गॄ",
+ ---
+ ["gha"] = "घ",
+ ["ghÄ"] = "घा",
+ ["ghi"] = "घि",
+ ["ghī"] = "घी",
+ ["ghu"] = "घà¥",
+ ["ghū"] = "घू",
+ ["ghe"] = "घे",
+ ["gho"] = "घो",
+ ["ghai"] = "घै",
+ ["ghau"] = "घौ",
+ ["ghḷ"] = "घॢ",
+ ["ghḹ"] = "घॣ",
+ ["ghṛ"] = "घृ",
+ ["ghá¹"] = "घॄ",
+ ---
+ ["ṅa"] = "ङ",
+ ["á¹…Ä"] = "ङा",
+ ["ṅi"] = "ङि",
+ ["ṅī"] = "ङी",
+ ["á¹…u"] = "ङà¥",
+ ["ṅū"] = "ङू",
+ ["ṅe"] = "ङे",
+ ["ṅo"] = "ङो",
+ ["ṅai"] = "ङै",
+ ["ṅau"] = "ङौ",
+ ["ṅḷ"] = "ङॢ",
+ ["ṅḹ"] = "ङॣ",
+ ["ṅṛ"] = "ङृ",
+ ["á¹…á¹"] = "ङॄ",
+ ---
+ ["ca"] = "च",
+ ["cÄ"] = "चा",
+ ["ci"] = "चि",
+ ["cī"] = "ची",
+ ["cu"] = "चà¥",
+ ["cū"] = "चू",
+ ["ce"] = "चे",
+ ["co"] = "चो",
+ ["cai"] = "चै",
+ ["cau"] = "चौ",
+ ["cḷ"] = "चॢ",
+ ["cḹ"] = "चॣ",
+ ["cṛ"] = "चृ",
+ ["cá¹"] = "चॄ",
+ ---
+ ["cha"] = "छ",
+ ["chÄ"] = "छा",
+ ["chi"] = "छि",
+ ["chī"] = "छी",
+ ["chu"] = "छà¥",
+ ["chū"] = "छू",
+ ["che"] = "छे",
+ ["cho"] = "छो",
+ ["chai"] = "छै",
+ ["chau"] = "छौ",
+ ["chḷ"] = "छॢ",
+ ["chḹ"] = "छॣ",
+ ["chṛ"] = "छृ",
+ ["chá¹"] = "छॄ",
+ ---
+ ["ja"] = "ज",
+ ["jÄ"] = "जा",
+ ["ji"] = "जि",
+ ["jī"] = "जी",
+ ["ju"] = "जà¥",
+ ["jū"] = "जू",
+ ["je"] = "जे",
+ ["jo"] = "जो",
+ ["jai"] = "जै",
+ ["jau"] = "जौ",
+ ["jḷ"] = "जॢ",
+ ["jḹ"] = "जॣ",
+ ["jṛ"] = "जृ",
+ ["já¹"] = "जॄ",
+ ---
+ ["jha"] = "à¤",
+ ["jhÄ"] = "à¤à¤¾",
+ ["jhi"] = "à¤à¤¿",
+ ["jhÄ«"] = "à¤à¥€",
+ ["jhu"] = "à¤à¥",
+ ["jhÅ«"] = "à¤à¥‚",
+ ["jhe"] = "à¤à¥‡",
+ ["jho"] = "à¤à¥‹",
+ ["jhai"] = "à¤à¥ˆ",
+ ["jhau"] = "à¤à¥Œ",
+ ["jhḷ"] = "à¤à¥¢",
+ ["jhḹ"] = "à¤à¥£",
+ ["jhá¹›"] = "à¤à¥ƒ",
+ ["jhá¹"] = "à¤à¥„",
+ ---
+ ["ña"] = "ञ",
+ ["ñÄ"] = "ञा",
+ ["ñi"] = "ञि",
+ ["ñī"] = "ञी",
+ ["ñu"] = "ञà¥",
+ ["ñū"] = "ञू",
+ ["ñe"] = "ञे",
+ ["ño"] = "ञो",
+ ["ñai"] = "ञै",
+ ["ñau"] = "ञौ",
+ ["ñḷ"] = "ञॢ",
+ ["ñḹ"] = "ञॣ",
+ ["ñṛ"] = "ञृ",
+ ["ñá¹"] = "ञॄ",
+ ---
+ ["ṭa"] = "ट",
+ ["á¹­Ä"] = "टा",
+ ["ṭi"] = "टि",
+ ["ṭī"] = "टी",
+ ["á¹­u"] = "टà¥",
+ ["ṭū"] = "टू",
+ ["ṭe"] = "टे",
+ ["ṭo"] = "टो",
+ ["ṭai"] = "टै",
+ ["ṭau"] = "टौ",
+ ["ṭḷ"] = "टॢ",
+ ["ṭḹ"] = "टॣ",
+ ["ṭṛ"] = "टृ",
+ ["á¹­á¹"] = "टॄ",
+ ---
+ ["ṭha"] = "ठ",
+ ["á¹­hÄ"] = "ठा",
+ ["ṭhi"] = "ठि",
+ ["ṭhī"] = "ठी",
+ ["á¹­hu"] = "ठà¥",
+ ["ṭhū"] = "ठू",
+ ["ṭhe"] = "ठे",
+ ["ṭho"] = "ठो",
+ ["ṭhai"] = "ठै",
+ ["ṭhau"] = "ठौ",
+ ["ṭhḷ"] = "ठॢ",
+ ["ṭhḹ"] = "ठॣ",
+ ["ṭhṛ"] = "ठृ",
+ ["á¹­há¹"] = "ठॄ",
+ ---
+ ["á¸a"] = "ड",
+ ["á¸Ä"] = "डा",
+ ["á¸i"] = "डि",
+ ["á¸Ä«"] = "डी",
+ ["á¸u"] = "डà¥",
+ ["á¸Å«"] = "डू",
+ ["á¸e"] = "डे",
+ ["á¸o"] = "डो",
+ ["á¸ai"] = "डै",
+ ["á¸au"] = "डौ",
+ ["á¸á¸·"] = "डॢ",
+ ["á¸á¸¹"] = "डॣ",
+ ["á¸á¹›"] = "डृ",
+ ["á¸á¹"] = "डॄ",
+ ---
+ ["á¸ha"] = "ढ",
+ ["á¸hÄ"] = "ढा",
+ ["á¸hi"] = "ढि",
+ ["á¸hÄ«"] = "ढी",
+ ["á¸hu"] = "ढà¥",
+ ["á¸hÅ«"] = "ढू",
+ ["á¸he"] = "ढे",
+ ["á¸ho"] = "ढो",
+ ["á¸hai"] = "ढै",
+ ["á¸hau"] = "ढौ",
+ ["á¸hḷ"] = "ढॢ",
+ ["á¸hḹ"] = "ढॣ",
+ ["á¸há¹›"] = "ढृ",
+ ["á¸há¹"] = "ढॄ",
+ ---
+ ["ṇa"] = "ण",
+ ["ṇÄ"] = "णा",
+ ["ṇi"] = "णि",
+ ["ṇī"] = "णी",
+ ["ṇu"] = "णà¥",
+ ["ṇū"] = "णू",
+ ["ṇe"] = "णे",
+ ["ṇo"] = "णो",
+ ["ṇai"] = "णै",
+ ["ṇau"] = "णौ",
+ ["ṇḷ"] = "णॢ",
+ ["ṇḹ"] = "णॣ",
+ ["ṇṛ"] = "णृ",
+ ["ṇá¹"] = "णॄ",
+ ---
+ ["ta"] = "त",
+ ["tÄ"] = "ता",
+ ["ti"] = "ति",
+ ["tī"] = "ती",
+ ["tu"] = "तà¥",
+ ["tū"] = "तू",
+ ["te"] = "ते",
+ ["to"] = "तो",
+ ["tai"] = "तै",
+ ["tau"] = "तौ",
+ ["tḷ"] = "तॢ",
+ ["tḹ"] = "तॣ",
+ ["tṛ"] = "तृ",
+ ["tá¹"] = "तॄ",
+ ---
+ ["tha"] = "थ",
+ ["thÄ"] = "था",
+ ["thi"] = "थि",
+ ["thī"] = "थी",
+ ["thu"] = "थà¥",
+ ["thū"] = "थू",
+ ["the"] = "थे",
+ ["tho"] = "थो",
+ ["thai"] = "थै",
+ ["thau"] = "थौ",
+ ["thḷ"] = "थॢ",
+ ["thḹ"] = "थॣ",
+ ["thṛ"] = "थृ",
+ ["thá¹"] = "थॄ",
+ ---
+ ["da"] = "द",
+ ["dÄ"] = "दा",
+ ["di"] = "दि",
+ ["dī"] = "दी",
+ ["du"] = "दà¥",
+ ["dū"] = "दू",
+ ["de"] = "दे",
+ ["do"] = "दो",
+ ["dai"] = "दै",
+ ["dau"] = "दौ",
+ ["dḷ"] = "दॢ",
+ ["dḹ"] = "दॣ",
+ ["dṛ"] = "दृ",
+ ["dá¹"] = "दॄ",
+ ---
+ ["dha"] = "ध",
+ ["dhÄ"] = "धा",
+ ["dhi"] = "धि",
+ ["dhī"] = "धी",
+ ["dhu"] = "धà¥",
+ ["dhū"] = "धू",
+ ["dhe"] = "धे",
+ ["dho"] = "धो",
+ ["dhai"] = "धै",
+ ["dhau"] = "धौ",
+ ["dhḷ"] = "धॢ",
+ ["dhḹ"] = "धॣ",
+ ["dhṛ"] = "धृ",
+ ["dhá¹"] = "धॄ",
+ ---
+ ["na"] = "न",
+ ["nÄ"] = "ना",
+ ["ni"] = "नि",
+ ["nī"] = "नी",
+ ["nu"] = "नà¥",
+ ["nū"] = "नू",
+ ["ne"] = "ने",
+ ["no"] = "नो",
+ ["nai"] = "नै",
+ ["nau"] = "नौ",
+ ["nḷ"] = "नॢ",
+ ["nḹ"] = "नॣ",
+ ["nṛ"] = "नृ",
+ ["ná¹"] = "नॄ",
+ ---
+ ["pa"] = "प",
+ ["pÄ"] = "पा",
+ ["pi"] = "पि",
+ ["pī"] = "पी",
+ ["pu"] = "पà¥",
+ ["pū"] = "पू",
+ ["pe"] = "पे",
+ ["po"] = "पो",
+ ["pai"] = "पै",
+ ["pau"] = "पौ",
+ ["pḷ"] = "पॢ",
+ ["pḹ"] = "पॣ",
+ ["pṛ"] = "पृ",
+ ["pá¹"] = "पॄ",
+ ---
+ ["pha"] = "फ",
+ ["phÄ"] = "फा",
+ ["phi"] = "फि",
+ ["phī"] = "फी",
+ ["phu"] = "फà¥",
+ ["phū"] = "फू",
+ ["phe"] = "फे",
+ ["pho"] = "फो",
+ ["phai"] = "फै",
+ ["phau"] = "फौ",
+ ["phḷ"] = "फॢ",
+ ["phḹ"] = "फॣ",
+ ["phṛ"] = "फृ",
+ ["phá¹"] = "फॄ",
+ ---
+ ["ba"] = "ब",
+ ["bÄ"] = "बा",
+ ["bi"] = "बि",
+ ["bī"] = "बी",
+ ["bu"] = "बà¥",
+ ["bū"] = "बू",
+ ["be"] = "बे",
+ ["bo"] = "बो",
+ ["bai"] = "बै",
+ ["bau"] = "बौ",
+ ["bḷ"] = "बॢ",
+ ["bḹ"] = "बॣ",
+ ["bṛ"] = "बृ",
+ ["bá¹"] = "बॄ",
+ ---
+ ["bha"] = "भ",
+ ["bhÄ"] = "भा",
+ ["bhi"] = "भि",
+ ["bhī"] = "भी",
+ ["bhu"] = "भà¥",
+ ["bhū"] = "भू",
+ ["bhe"] = "भे",
+ ["bho"] = "भो",
+ ["bhai"] = "भै",
+ ["bhau"] = "भौ",
+ ["bhḷ"] = "भॢ",
+ ["bhḹ"] = "भॣ",
+ ["bhṛ"] = "भृ",
+ ["bhá¹"] = "भॄ",
+ ---
+ ["ma"] = "म",
+ ["mÄ"] = "मा",
+ ["mi"] = "मि",
+ ["mī"] = "मी",
+ ["mu"] = "मà¥",
+ ["mū"] = "मू",
+ ["me"] = "मे",
+ ["mo"] = "मो",
+ ["mai"] = "मै",
+ ["mau"] = "मौ",
+ ["mḷ"] = "मॢ",
+ ["mḹ"] = "मॣ",
+ ["mṛ"] = "मृ",
+ ["má¹"] = "मॄ",
+ ---
+ ["ya"] = "य",
+ ["yÄ"] = "या",
+ ["yi"] = "यि",
+ ["yī"] = "यी",
+ ["yu"] = "यà¥",
+ ["yū"] = "यू",
+ ["ye"] = "ये",
+ ["yo"] = "यो",
+ ["yai"] = "यै",
+ ["yau"] = "यौ",
+ ["yḷ"] = "यॢ",
+ ["yḹ"] = "यॣ",
+ ["yṛ"] = "यृ",
+ ["yá¹"] = "यॄ",
+ ---
+ ["ra"] = "र",
+ ["rÄ"] = "रा",
+ ["ri"] = "रि",
+ ["rī"] = "री",
+ ["ru"] = "रà¥",
+ ["rū"] = "रू",
+ ["re"] = "रे",
+ ["ro"] = "रो",
+ ["rai"] = "रै",
+ ["rau"] = "रौ",
+ ["rḷ"] = "रॢ",
+ ["rḹ"] = "रॣ",
+ ["rṛ"] = "रृ",
+ ["rá¹"] = "रॄ",
+ ---
+ ["la"] = "ल",
+ ["lÄ"] = "ला",
+ ["li"] = "लि",
+ ["lī"] = "ली",
+ ["lu"] = "लà¥",
+ ["lū"] = "लू",
+ ["le"] = "ले",
+ ["lo"] = "लो",
+ ["lai"] = "लै",
+ ["lau"] = "लौ",
+ ["lḷ"] = "लॢ",
+ ["lḹ"] = "लॣ",
+ ["lṛ"] = "लृ",
+ ["lá¹"] = "लॄ",
+ ---
+ ["va"] = "व",
+ ["vÄ"] = "वा",
+ ["vi"] = "वि",
+ ["vī"] = "वी",
+ ["vu"] = "वà¥",
+ ["vū"] = "वू",
+ ["ve"] = "वे",
+ ["vo"] = "वो",
+ ["vai"] = "वै",
+ ["vau"] = "वौ",
+ ["vḷ"] = "वॢ",
+ ["vḹ"] = "वॣ",
+ ["vṛ"] = "वृ",
+ ["vá¹"] = "वॄ",
+ ---
+ ["śa"] = "श",
+ ["Å›Ä"] = "शा",
+ ["śi"] = "शि",
+ ["śī"] = "शी",
+ ["Å›u"] = "शà¥",
+ ["śū"] = "शू",
+ ["śe"] = "शे",
+ ["śo"] = "शो",
+ ["śai"] = "शै",
+ ["śau"] = "शौ",
+ ["śḷ"] = "शॢ",
+ ["śḹ"] = "शॣ",
+ ["śṛ"] = "शृ",
+ ["Å›á¹"] = "शॄ",
+ ---
+ ["ṣa"] = "ष",
+ ["á¹£Ä"] = "षा",
+ ["ṣi"] = "षि",
+ ["ṣī"] = "षी",
+ ["á¹£u"] = "षà¥",
+ ["ṣū"] = "षू",
+ ["ṣe"] = "षे",
+ ["ṣo"] = "षो",
+ ["ṣai"] = "षै",
+ ["ṣau"] = "षौ",
+ ["ṣḷ"] = "षॢ",
+ ["ṣḹ"] = "षॣ",
+ ["ṣṛ"] = "षृ",
+ ["á¹£á¹"] = "षॄ",
+ ---
+ ["sa"] = "स",
+ ["sÄ"] = "सा",
+ ["si"] = "सि",
+ ["sī"] = "सी",
+ ["su"] = "सà¥",
+ ["sū"] = "सू",
+ ["se"] = "से",
+ ["so"] = "सो",
+ ["sai"] = "सै",
+ ["sau"] = "सौ",
+ ["sḷ"] = "सॢ",
+ ["sḹ"] = "सॣ",
+ ["sṛ"] = "सृ",
+ ["sá¹"] = "सॄ",
+ ---
+ ["ha"] = "ह",
+ ["hÄ"] = "हा",
+ ["hi"] = "हि",
+ ["hī"] = "ही",
+ ["hu"] = "हà¥",
+ ["hū"] = "हू",
+ ["he"] = "हे",
+ ["ho"] = "हो",
+ ["hai"] = "है",
+ ["hau"] = "हौ",
+ ["hḷ"] = "हॢ",
+ ["hḹ"] = "हॣ",
+ ["hṛ"] = "हृ",
+ ["há¹"] = "हॄ",
+ ---
+ ["ḻa"] = "ळ",
+ ["ḻÄ"] = "ळा",
+ ["ḻi"] = "ळि",
+ ["ḻī"] = "ळी",
+ ["ḻu"] = "ळà¥",
+ ["ḻū"] = "ळू",
+ ["ḻe"] = "ळे",
+ ["ḻo"] = "ळो",
+ ["ḻai"] = "ळै",
+ ["ḻau"] = "ळौ",
+ ["ḻḷ"] = "ळॢ",
+ ["ḻḹ"] = "ळॣ",
+ ["ḻṛ"] = "ळृ",
+ ["ḻá¹"] = "ळॄ",
+ ---
+ ["ká¹£a"] = "कà¥à¤·",
+ ["ká¹£Ä"] = "कà¥à¤·à¤¾",
+ ["ká¹£i"] = "कà¥à¤·à¤¿",
+ ["kṣī"] = "कà¥à¤·à¥€",
+ ["ká¹£u"] = "कà¥à¤·à¥",
+ ["kṣū"] = "कà¥à¤·à¥‚",
+ ["ká¹£e"] = "कà¥à¤·à¥‡",
+ ["ká¹£o"] = "कà¥à¤·à¥‹",
+ ["ká¹£ai"] = "कà¥à¤·à¥ˆ",
+ ["ká¹£au"] = "कà¥à¤·à¥Œ",
+ ["kṣḷ"] = "कà¥à¤·à¥¢",
+ ["kṣḹ"] = "कà¥à¤·à¥£",
+ ["kṣṛ"] = "कà¥à¤·à¥ƒ",
+ ["ká¹£á¹"] = "कà¥à¤·à¥„",
+ ---
+ ["jña"] = "जà¥à¤ž",
+ ["jñÄ"] = "जà¥à¤žà¤¾",
+ ["jñi"] = "जà¥à¤žà¤¿",
+ ["jñī"] = "जà¥à¤žà¥€",
+ ["jñu"] = "जà¥à¤žà¥",
+ ["jñū"] = "जà¥à¤žà¥‚",
+ ["jñe"] = "जà¥à¤žà¥‡",
+ ["jño"] = "जà¥à¤žà¥‹",
+ ["jñai"] = "जà¥à¤žà¥ˆ",
+ ["jñau"] = "जà¥à¤žà¥Œ",
+ ["jñḷ"] = "जà¥à¤žà¥¢",
+ ["jñḹ"] = "जà¥à¤žà¥£",
+ ["jñṛ"] = "जà¥à¤žà¥ƒ",
+ ["jñá¹"] = "जà¥à¤žà¥„",
+ ---
+ ["k"] = "कà¥",
+ ["kh"] = "खà¥",
+ ["g"] = "गà¥",
+ ["gh"] = "घà¥",
+ ["á¹…"] = "ङà¥",
+ ["c"] = "चà¥",
+ ["ch"] = "छà¥",
+ ["j"] = "जà¥",
+ ["jh"] = "à¤à¥",
+ ["ñ"] = "ञà¥",
+ ["á¹­"] = "टà¥",
+ ["á¹­h"] = "ठà¥",
+ ["á¸"] = "डà¥",
+ ["á¸h"] = "ढà¥",
+ ["ṇ"] = "णà¥",
+ ["t"] = "तà¥",
+ ["th"] = "थà¥",
+ ["d"] = "दà¥",
+ ["dh"] = "धà¥",
+ ["n"] = "नà¥",
+ ["p"] = "पà¥",
+ ["ph"] = "फà¥",
+ ["b"] = "बà¥",
+ ["bh"] = "भà¥",
+ ["m"] = "मà¥",
+ ["y"] = "यà¥",
+ ["r"] = "रà¥",
+ ["l"] = "लà¥",
+ ["v"] = "वà¥",
+ ["Å›"] = "शà¥",
+ ["á¹£"] = "षà¥",
+ ["s"] = "सà¥",
+ ["h"] = "हà¥",
+ ["ḻ"] = "ळà¥",
+ ["ká¹£"] = "कà¥à¤·à¥",
+ ["jñ"] = "जà¥à¤žà¥",
+ -- yogavaahas (always with phonetic)
+ ["á¹"] = "ं",
+ ["ḥ"] = "ः",
+ ["à¤"] = "à¤",
+ -- punctuations
+ ["viraama"] = "à¥",
+ ["."] = "।",
+ ["|"] = "।",
+ ["||"] = "॥",
+ },
+ },
+ ["itrans to deva"] = {
+ mapping = {
+ --- vowels
+ ["a"] = "अ",
+ ["A"] = "आ",
+ ["i"] = "इ",
+ ["I"] = "ई",
+ ["u"] = "उ",
+ ["U"] = "ऊ",
+ ["RRi"] = "ऋ",
+ ["RRI"] = "ॠ",
+ ["LLi"] = "ऌ",
+ ["LLI"] = "ॡ",
+ ["e"] = "à¤",
+ ["ai"] = "à¤",
+ ["o"] = "ओ",
+ ["au"] = "औ",
+ --- consonant forms
+ ["ka"] = "क",
+ ["kA"] = "का",
+ ["ki"] = "कि",
+ ["kI"] = "की",
+ ["ku"] = "कà¥",
+ ["kU"] = "कू",
+ ["ke"] = "के",
+ ["ko"] = "को",
+ ["kai"] = "कै",
+ ["kau"] = "कौ",
+ ["kLLi"] = "कॢ",
+ ["kLLI"] = "कॣ",
+ ["kRRi"] = "कृ",
+ ["kRRI"] = "कॄ",
+ ---
+ ["kha"] = "ख",
+ ["khA"] = "खा",
+ ["khi"] = "खि",
+ ["khI"] = "खी",
+ ["khu"] = "खà¥",
+ ["khU"] = "खू",
+ ["khe"] = "खे",
+ ["kho"] = "खो",
+ ["khai"] = "खै",
+ ["khau"] = "खौ",
+ ["khLLi"] = "खॢ",
+ ["khLLI"] = "खॣ",
+ ["khRRi"] = "खृ",
+ ["khRRI"] = "खॄ",
+ ---
+ ["ga"] = "ग",
+ ["gA"] = "गा",
+ ["gi"] = "गि",
+ ["gI"] = "गी",
+ ["gu"] = "गà¥",
+ ["gU"] = "गू",
+ ["ge"] = "गे",
+ ["go"] = "गो",
+ ["gai"] = "गै",
+ ["gau"] = "गौ",
+ ["gLLi"] = "गॢ",
+ ["gLLI"] = "गॣ",
+ ["gRRi"] = "गृ",
+ ["gRRI"] = "गॄ",
+ ---
+ ["gha"] = "घ",
+ ["ghA"] = "घा",
+ ["ghi"] = "घि",
+ ["ghI"] = "घी",
+ ["ghu"] = "घà¥",
+ ["ghU"] = "घू",
+ ["ghe"] = "घे",
+ ["gho"] = "घो",
+ ["ghai"] = "घै",
+ ["ghau"] = "घौ",
+ ["ghLLi"] = "घॢ",
+ ["ghLLI"] = "घॣ",
+ ["ghRRi"] = "घृ",
+ ["ghRRI"] = "घॄ",
+ ---
+ ["~Na"] = "ङ",
+ ["~NA"] = "ङा",
+ ["~Ni"] = "ङि",
+ ["~NI"] = "ङी",
+ ["~Nu"] = "ङà¥",
+ ["~NU"] = "ङू",
+ ["~Ne"] = "ङे",
+ ["~No"] = "ङो",
+ ["~Nai"] = "ङै",
+ ["~Nau"] = "ङौ",
+ ["~NLLi"] = "ङॢ",
+ ["~NLLI"] = "ङॣ",
+ ["~NRRi"] = "ङृ",
+ ["~NRRI"] = "ङॄ",
+ ---
+ ["ca"] = "च",
+ ["cA"] = "चा",
+ ["ci"] = "चि",
+ ["cI"] = "ची",
+ ["cu"] = "चà¥",
+ ["cU"] = "चू",
+ ["ce"] = "चे",
+ ["co"] = "चो",
+ ["cai"] = "चै",
+ ["cau"] = "चौ",
+ ["cLLi"] = "चॢ",
+ ["cLLI"] = "चॣ",
+ ["cRRi"] = "चृ",
+ ["cRRI"] = "चॄ",
+ ---
+ ["cha"] = "छ",
+ ["chA"] = "छा",
+ ["chi"] = "छि",
+ ["chI"] = "छी",
+ ["chu"] = "छà¥",
+ ["chU"] = "छू",
+ ["che"] = "छे",
+ ["cho"] = "छो",
+ ["chai"] = "छै",
+ ["chau"] = "छौ",
+ ["chLLi"] = "छॢ",
+ ["chLLI"] = "छॣ",
+ ["chRRi"] = "छृ",
+ ["chRRI"] = "छॄ",
+ ---
+ ["ja"] = "ज",
+ ["jA"] = "जा",
+ ["ji"] = "जि",
+ ["jI"] = "जी",
+ ["ju"] = "जà¥",
+ ["jU"] = "जू",
+ ["je"] = "जे",
+ ["jo"] = "जो",
+ ["jai"] = "जै",
+ ["jau"] = "जौ",
+ ["jLLi"] = "जॢ",
+ ["jLLI"] = "जॣ",
+ ["jRRi"] = "जृ",
+ ["jRRI"] = "जॄ",
+ ---
+ ["jha"] = "à¤",
+ ["jhA"] = "à¤à¤¾",
+ ["jhi"] = "à¤à¤¿",
+ ["jhI"] = "à¤à¥€",
+ ["jhu"] = "à¤à¥",
+ ["jhU"] = "à¤à¥‚",
+ ["jhe"] = "à¤à¥‡",
+ ["jho"] = "à¤à¥‹",
+ ["jhai"] = "à¤à¥ˆ",
+ ["jhau"] = "à¤à¥Œ",
+ ["jhLLi"] = "à¤à¥¢",
+ ["jhLLI"] = "à¤à¥£",
+ ["jhRRi"] = "à¤à¥ƒ",
+ ["jhRRI"] = "à¤à¥„",
+ ---
+ ["~na"] = "ञ",
+ ["~nA"] = "ञा",
+ ["~ni"] = "ञि",
+ ["~nI"] = "ञी",
+ ["~nu"] = "ञà¥",
+ ["~nU"] = "ञू",
+ ["~ne"] = "ञे",
+ ["~no"] = "ञो",
+ ["~nai"] = "ञै",
+ ["~nau"] = "ञौ",
+ ["~nLLi"] = "ञॢ",
+ ["~nLLI"] = "ञॣ",
+ ["~nRRi"] = "ञृ",
+ ["~nRRI"] = "ञॄ",
+ ---
+ ["Ta"] = "ट",
+ ["TA"] = "टा",
+ ["Ti"] = "टि",
+ ["TI"] = "टी",
+ ["Tu"] = "टà¥",
+ ["TU"] = "टू",
+ ["Te"] = "टे",
+ ["To"] = "टो",
+ ["Tai"] = "टै",
+ ["Tau"] = "टौ",
+ ["TLLi"] = "टॢ",
+ ["TLLI"] = "टॣ",
+ ["TRRi"] = "टृ",
+ ["TRRI"] = "टॄ",
+ ---
+ ["Tha"] = "ठ",
+ ["ThA"] = "ठा",
+ ["Thi"] = "ठि",
+ ["ThI"] = "ठी",
+ ["Thu"] = "ठà¥",
+ ["ThU"] = "ठू",
+ ["The"] = "ठे",
+ ["Tho"] = "ठो",
+ ["Thai"] = "ठै",
+ ["Thau"] = "ठौ",
+ ["ThLLi"] = "ठॢ",
+ ["ThLLI"] = "ठॣ",
+ ["ThRRi"] = "ठृ",
+ ["ThRRI"] = "ठॄ",
+ ---
+ ["Da"] = "ड",
+ ["DA"] = "डा",
+ ["Di"] = "डि",
+ ["DI"] = "डी",
+ ["Du"] = "डà¥",
+ ["DU"] = "डू",
+ ["De"] = "डे",
+ ["Do"] = "डो",
+ ["Dai"] = "डै",
+ ["Dau"] = "डौ",
+ ["DLLi"] = "डॢ",
+ ["DLLI"] = "डॣ",
+ ["DRRi"] = "डृ",
+ ["DRRI"] = "डॄ",
+ ---
+ ["Dha"] = "ढ",
+ ["DhA"] = "ढा",
+ ["Dhi"] = "ढि",
+ ["DhI"] = "ढी",
+ ["Dhu"] = "ढà¥",
+ ["DhU"] = "ढू",
+ ["Dhe"] = "ढे",
+ ["Dho"] = "ढो",
+ ["Dhai"] = "ढै",
+ ["Dhau"] = "ढौ",
+ ["DhLLi"] = "ढॢ",
+ ["DhLLI"] = "ढॣ",
+ ["DhRRi"] = "ढृ",
+ ["DhRRI"] = "ढॄ",
+ ---
+ ["Na"] = "ण",
+ ["NA"] = "णा",
+ ["Ni"] = "णि",
+ ["NI"] = "णी",
+ ["Nu"] = "णà¥",
+ ["NU"] = "णू",
+ ["Ne"] = "णे",
+ ["No"] = "णो",
+ ["Nai"] = "णै",
+ ["Nau"] = "णौ",
+ ["NLLi"] = "णॢ",
+ ["NLLI"] = "णॣ",
+ ["NRRi"] = "णृ",
+ ["NRRI"] = "णॄ",
+ ---
+ ["ta"] = "त",
+ ["tA"] = "ता",
+ ["ti"] = "ति",
+ ["tI"] = "ती",
+ ["tu"] = "तà¥",
+ ["tU"] = "तू",
+ ["te"] = "ते",
+ ["to"] = "तो",
+ ["tai"] = "तै",
+ ["tau"] = "तौ",
+ ["tLLi"] = "तॢ",
+ ["tLLI"] = "तॣ",
+ ["tRRi"] = "तृ",
+ ["tRRI"] = "तॄ",
+ ---
+ ["tha"] = "थ",
+ ["thA"] = "था",
+ ["thi"] = "थि",
+ ["thI"] = "थी",
+ ["thu"] = "थà¥",
+ ["thU"] = "थू",
+ ["the"] = "थे",
+ ["tho"] = "थो",
+ ["thai"] = "थै",
+ ["thau"] = "थौ",
+ ["thLLi"] = "थॢ",
+ ["thLLI"] = "थॣ",
+ ["thRRi"] = "थृ",
+ ["thRRI"] = "थॄ",
+ ---
+ ["da"] = "द",
+ ["dA"] = "दा",
+ ["di"] = "दि",
+ ["dI"] = "दी",
+ ["du"] = "दà¥",
+ ["dU"] = "दू",
+ ["de"] = "दे",
+ ["do"] = "दो",
+ ["dai"] = "दै",
+ ["dau"] = "दौ",
+ ["dLLi"] = "दॢ",
+ ["dLLI"] = "दॣ",
+ ["dRRi"] = "दृ",
+ ["dRRI"] = "दॄ",
+ ---
+ ["dha"] = "ध",
+ ["dhA"] = "धा",
+ ["dhi"] = "धि",
+ ["dhI"] = "धी",
+ ["dhu"] = "धà¥",
+ ["dhU"] = "धू",
+ ["dhe"] = "धे",
+ ["dho"] = "धो",
+ ["dhai"] = "धै",
+ ["dhau"] = "धौ",
+ ["dhLLi"] = "धॢ",
+ ["dhLLI"] = "धॣ",
+ ["dhRRi"] = "धृ",
+ ["dhRRI"] = "धॄ",
+ ---
+ ["na"] = "न",
+ ["nA"] = "ना",
+ ["ni"] = "नि",
+ ["nI"] = "नी",
+ ["nu"] = "नà¥",
+ ["nU"] = "नू",
+ ["ne"] = "ने",
+ ["no"] = "नो",
+ ["nai"] = "नै",
+ ["nau"] = "नौ",
+ ["nLLi"] = "नॢ",
+ ["nLLI"] = "नॣ",
+ ["nRRi"] = "नृ",
+ ["nRRI"] = "नॄ",
+ ---
+ ["pa"] = "प",
+ ["pA"] = "पा",
+ ["pi"] = "पि",
+ ["pI"] = "पी",
+ ["pu"] = "पà¥",
+ ["pU"] = "पू",
+ ["pe"] = "पे",
+ ["po"] = "पो",
+ ["pai"] = "पै",
+ ["pau"] = "पौ",
+ ["pLLi"] = "पॢ",
+ ["pLLI"] = "पॣ",
+ ["pRRi"] = "पृ",
+ ["pRRI"] = "पॄ",
+ ---
+ ["pha"] = "फ",
+ ["phA"] = "फा",
+ ["phi"] = "फि",
+ ["phI"] = "फी",
+ ["phu"] = "फà¥",
+ ["phU"] = "फू",
+ ["phe"] = "फे",
+ ["pho"] = "फो",
+ ["phai"] = "फै",
+ ["phau"] = "फौ",
+ ["phLLi"] = "फॢ",
+ ["phLLI"] = "फॣ",
+ ["phRRi"] = "फृ",
+ ["phRRI"] = "फॄ",
+ ---
+ ["ba"] = "ब",
+ ["bA"] = "बा",
+ ["bi"] = "बि",
+ ["bI"] = "बी",
+ ["bu"] = "बà¥",
+ ["bU"] = "बू",
+ ["be"] = "बे",
+ ["bo"] = "बो",
+ ["bai"] = "बै",
+ ["bau"] = "बौ",
+ ["bLLi"] = "बॢ",
+ ["bLLI"] = "बॣ",
+ ["bRRi"] = "बृ",
+ ["bRRI"] = "बॄ",
+ ---
+ ["bha"] = "भ",
+ ["bhA"] = "भा",
+ ["bhi"] = "भि",
+ ["bhI"] = "भी",
+ ["bhu"] = "भà¥",
+ ["bhU"] = "भू",
+ ["bhe"] = "भे",
+ ["bho"] = "भो",
+ ["bhai"] = "भै",
+ ["bhau"] = "भौ",
+ ["bhLLi"] = "भॢ",
+ ["bhLLI"] = "भॣ",
+ ["bhRRi"] = "भृ",
+ ["bhRRI"] = "भॄ",
+ ---
+ ["ma"] = "म",
+ ["mA"] = "मा",
+ ["mi"] = "मि",
+ ["mI"] = "मी",
+ ["mu"] = "मà¥",
+ ["mU"] = "मू",
+ ["me"] = "मे",
+ ["mo"] = "मो",
+ ["mai"] = "मै",
+ ["mau"] = "मौ",
+ ["mLLi"] = "मॢ",
+ ["mLLI"] = "मॣ",
+ ["mRRi"] = "मृ",
+ ["mRRI"] = "मॄ",
+ ---
+ ["ya"] = "य",
+ ["yA"] = "या",
+ ["yi"] = "यि",
+ ["yI"] = "यी",
+ ["yu"] = "यà¥",
+ ["yU"] = "यू",
+ ["ye"] = "ये",
+ ["yo"] = "यो",
+ ["yai"] = "यै",
+ ["yau"] = "यौ",
+ ["yLLi"] = "यॢ",
+ ["yLLI"] = "यॣ",
+ ["yRRi"] = "यृ",
+ ["yRRI"] = "यॄ",
+ ---
+ ["ra"] = "र",
+ ["rA"] = "रा",
+ ["ri"] = "रि",
+ ["rI"] = "री",
+ ["ru"] = "रà¥",
+ ["rU"] = "रू",
+ ["re"] = "रे",
+ ["ro"] = "रो",
+ ["rai"] = "रै",
+ ["rau"] = "रौ",
+ ["rLLi"] = "रॢ",
+ ["rLLI"] = "रॣ",
+ ["rRRi"] = "रृ",
+ ["rRRI"] = "रॄ",
+ ---
+ ["la"] = "ल",
+ ["lA"] = "ला",
+ ["li"] = "लि",
+ ["lI"] = "ली",
+ ["lu"] = "लà¥",
+ ["lU"] = "लू",
+ ["le"] = "ले",
+ ["lo"] = "लो",
+ ["lai"] = "लै",
+ ["lau"] = "लौ",
+ ["lLLi"] = "लॢ",
+ ["lLLI"] = "लॣ",
+ ["lRRi"] = "लृ",
+ ["lRRI"] = "लॄ",
+ ---
+ ["va"] = "व",
+ ["vA"] = "वा",
+ ["vi"] = "वि",
+ ["vI"] = "वी",
+ ["vu"] = "वà¥",
+ ["vU"] = "वू",
+ ["ve"] = "वे",
+ ["vo"] = "वो",
+ ["vai"] = "वै",
+ ["vau"] = "वौ",
+ ["vLLi"] = "वॢ",
+ ["vLLI"] = "वॣ",
+ ["vRRi"] = "वृ",
+ ["vRRI"] = "वॄ",
+ ---
+ ["sha"] = "श",
+ ["shA"] = "शा",
+ ["shi"] = "शि",
+ ["shI"] = "शी",
+ ["shu"] = "शà¥",
+ ["shU"] = "शू",
+ ["she"] = "शे",
+ ["sho"] = "शो",
+ ["shai"] = "शै",
+ ["shau"] = "शौ",
+ ["shLLi"] = "शॢ",
+ ["shLLI"] = "शॣ",
+ ["shRRi"] = "शृ",
+ ["shRRI"] = "शॄ",
+ ---
+ ["Sha"] = "ष",
+ ["ShA"] = "षा",
+ ["Shi"] = "षि",
+ ["ShI"] = "षी",
+ ["Shu"] = "षà¥",
+ ["ShU"] = "षू",
+ ["She"] = "षे",
+ ["Sho"] = "षो",
+ ["Shai"] = "षै",
+ ["Shau"] = "षौ",
+ ["ShLLi"] = "षॢ",
+ ["ShLLI"] = "षॣ",
+ ["ShRRi"] = "षृ",
+ ["ShRRI"] = "षॄ",
+ ---
+ ["sa"] = "स",
+ ["sA"] = "सा",
+ ["si"] = "सि",
+ ["sI"] = "सी",
+ ["su"] = "सà¥",
+ ["sU"] = "सू",
+ ["se"] = "से",
+ ["so"] = "सो",
+ ["sai"] = "सै",
+ ["sau"] = "सौ",
+ ["sLLi"] = "सॢ",
+ ["sLLI"] = "सॣ",
+ ["sRRi"] = "सृ",
+ ["sRRI"] = "सॄ",
+ ---
+ ["ha"] = "ह",
+ ["hA"] = "हा",
+ ["hi"] = "हि",
+ ["hI"] = "ही",
+ ["hu"] = "हà¥",
+ ["hU"] = "हू",
+ ["he"] = "हे",
+ ["ho"] = "हो",
+ ["hai"] = "है",
+ ["hau"] = "हौ",
+ ["hLLi"] = "हॢ",
+ ["hLLI"] = "हॣ",
+ ["hRRi"] = "हृ",
+ ["hRRI"] = "हॄ",
+ ---
+ ["ḻa"] = "ळ",
+ ["ḻA"] = "ळा",
+ ["ḻi"] = "ळि",
+ ["ḻI"] = "ळी",
+ ["ḻu"] = "ळà¥",
+ ["ḻU"] = "ळू",
+ ["ḻe"] = "ळे",
+ ["ḻo"] = "ळो",
+ ["ḻai"] = "ळै",
+ ["ḻau"] = "ळौ",
+ ["ḻLLi"] = "ळॢ",
+ ["ḻLLI"] = "ळॣ",
+ ["ḻRRi"] = "ळृ",
+ ["ḻRRI"] = "ळॄ",
+ ---
+ ["xa"] = "कà¥à¤·",
+ ["xA"] = "कà¥à¤·à¤¾",
+ ["xi"] = "कà¥à¤·à¤¿",
+ ["xI"] = "कà¥à¤·à¥€",
+ ["xu"] = "कà¥à¤·à¥",
+ ["xU"] = "कà¥à¤·à¥‚",
+ ["xe"] = "कà¥à¤·à¥‡",
+ ["xo"] = "कà¥à¤·à¥‹",
+ ["xai"] = "कà¥à¤·à¥ˆ",
+ ["xau"] = "कà¥à¤·à¥Œ",
+ ["xLLi"] = "कà¥à¤·à¥¢",
+ ["xLLI"] = "कà¥à¤·à¥£",
+ ["xRRi"] = "कà¥à¤·à¥ƒ",
+ ["xRRI"] = "कà¥à¤·à¥„",
+ ---
+ ["j~na"] = "जà¥à¤ž",
+ ["j~nA"] = "जà¥à¤žà¤¾",
+ ["j~ni"] = "जà¥à¤žà¤¿",
+ ["j~nI"] = "जà¥à¤žà¥€",
+ ["j~nu"] = "जà¥à¤žà¥",
+ ["j~nU"] = "जà¥à¤žà¥‚",
+ ["j~ne"] = "जà¥à¤žà¥‡",
+ ["j~no"] = "जà¥à¤žà¥‹",
+ ["j~nai"] = "जà¥à¤žà¥ˆ",
+ ["j~nau"] = "जà¥à¤žà¥Œ",
+ ["j~nLLi"] = "जà¥à¤žà¥¢",
+ ["j~nLLI"] = "जà¥à¤žà¥£",
+ ["j~nRRi"] = "जà¥à¤žà¥ƒ",
+ ["j~nRRI"] = "जà¥à¤žà¥„",
+ ---
+ ["k"] = "कà¥",
+ ["kh"] = "खà¥",
+ ["g"] = "गà¥",
+ ["gh"] = "घà¥",
+ ["~N"] = "ङà¥",
+ ["c"] = "चà¥",
+ ["ch"] = "छà¥",
+ ["j"] = "जà¥",
+ ["jh"] = "à¤à¥",
+ ["~n"] = "ञà¥",
+ ["T"] = "टà¥",
+ ["Th"] = "ठà¥",
+ ["D"] = "डà¥",
+ ["Dh"] = "ढà¥",
+ ["N"] = "णà¥",
+ ["t"] = "तà¥",
+ ["th"] = "थà¥",
+ ["d"] = "दà¥",
+ ["dh"] = "धà¥",
+ ["n"] = "नà¥",
+ ["p"] = "पà¥",
+ ["ph"] = "फà¥",
+ ["b"] = "बà¥",
+ ["bh"] = "भà¥",
+ ["m"] = "मà¥",
+ ["y"] = "यà¥",
+ ["r"] = "रà¥",
+ ["l"] = "लà¥",
+ ["v"] = "वà¥",
+ ["sh"] = "शà¥",
+ ["Sh"] = "षà¥",
+ ["s"] = "सà¥",
+ ["h"] = "हà¥",
+ ["ḻ"] = "ळà¥",
+ ["x"] = "कà¥à¤·à¥",
+ ["j~n"] = "जà¥à¤žà¥",
+ -- yogavaahas (always with phonetic)
+ ["M"] = "ं",
+ ["H"] = "ः",
+ ["à¤"] = "à¤",
+ -- punctuations
+ ["viraama"] = "à¥",
+ ["."] = "।",
+ ["|"] = "।",
+ ["||"] = "॥",
+ },
+ },
+ ["deva to iast"] = {
+ mapping = {
+ -- vowels
+ ["अ"] = "a",
+ ["आ"] = "Ä",
+ ["इ"] = "i",
+ ["ई"] = "ī",
+ ["उ"] = "u",
+ ["ऊ"] = "ū",
+ ["ऋ"] = "ṛ",
+ ["ॠ"] = "á¹",
+ ["ऌ"] = "ḷ",
+ ["ॡ"] = "ḹ",
+ ["ऎ"] = "è",
+ ["à¤"] = "e",
+ ["à¤"] = "ai",
+ ["ऒ"] = "ò",
+ ["ओ"] = "o",
+ ["औ"] = "au",
+ -- consonant + vowel forms
+ ["क"]= "ka",
+ ["का"] = "kÄ",
+ ["कि"] = "ki",
+ ["की"] = "kī",
+ ["कà¥"] = "ku",
+ ["कू"] = "kū",
+ ["के"] = "ke",
+ ["को"] = "ko",
+ ["कै"] = "kai",
+ ["कौ"] = "kau",
+ ["कॢ"] = "kḷ",
+ ["कॣ"] = "kḹ",
+ ["कृ"] = "kṛ",
+ ["कॄ"] = "ká¹",
+ ---
+ ["ख"]= "kha",
+ ["खा"] = "khÄ",
+ ["खि"] = "khi",
+ ["खी"] = "khī",
+ ["खà¥"] = "khu",
+ ["खू"] = "khū",
+ ["खे"] = "khe",
+ ["खो"] = "kho",
+ ["खै"] = "khai",
+ ["खौ"] = "khau",
+ ["खॢ"] = "khḷ",
+ ["खॣ"] = "khḹ",
+ ["खृ"] = "khṛ",
+ ["खॄ"] = "khá¹",
+ ---
+ ["ग"]= "ga",
+ ["गा"] = "gÄ",
+ ["गि"] = "gi",
+ ["गी"] = "gī",
+ ["गà¥"] = "gu",
+ ["गू"] = "gū",
+ ["गे"] = "ge",
+ ["गो"] = "go",
+ ["गै"] = "gai",
+ ["गौ"] = "gau",
+ ["गॢ"] = "gḷ",
+ ["गॣ"] = "gḹ",
+ ["गृ"] = "gṛ",
+ ["गॄ"] = "gá¹",
+ ---
+ ["घ"]= "gha",
+ ["घा"] = "ghÄ",
+ ["घि"] = "ghi",
+ ["घी"] = "ghī",
+ ["घà¥"] = "ghu",
+ ["घू"] = "ghū",
+ ["घे"] = "ghe",
+ ["घो"] = "gho",
+ ["घै"] = "ghai",
+ ["घौ"] = "ghau",
+ ["घॢ"] = "ghḷ",
+ ["घॣ"] = "ghḹ",
+ ["घृ"] = "ghṛ",
+ ["घॄ"] = "ghá¹",
+ ---
+ ["ङ"]= "ṅa",
+ ["ङा"] = "á¹…Ä",
+ ["ङि"] = "ṅi",
+ ["ङी"] = "ṅī",
+ ["ङà¥"] = "á¹…u",
+ ["ङू"] = "ṅū",
+ ["ङे"] = "ṅe",
+ ["ङो"] = "ṅo",
+ ["ङै"] = "ṅai",
+ ["ङौ"] = "ṅau",
+ ["ङॢ"] = "ṅḷ",
+ ["ङॣ"] = "ṅḹ",
+ ["ङृ"] = "ṅṛ",
+ ["ङॄ"] = "á¹…á¹",
+ ---
+ ["च"]= "ca",
+ ["चा"] = "cÄ",
+ ["चि"] = "ci",
+ ["ची"] = "cī",
+ ["चà¥"] = "cu",
+ ["चू"] = "cū",
+ ["चे"] = "ce",
+ ["चो"] = "co",
+ ["चै"] = "cai",
+ ["चौ"] = "cau",
+ ["चॢ"] = "cḷ",
+ ["चॣ"] = "cḹ",
+ ["चृ"] = "cṛ",
+ ["चॄ"] = "cá¹",
+ --
+ ["छ"]= "cha",
+ ["छा"] = "chÄ",
+ ["छि"] = "chi",
+ ["छी"] = "chī",
+ ["छà¥"] = "chu",
+ ["छू"] = "chū",
+ ["छे"] = "che",
+ ["छो"] = "cho",
+ ["छै"] = "chai",
+ ["छौ"] = "chau",
+ ["छॢ"] = "chḷ",
+ ["छॣ"] = "chḹ",
+ ["छृ"] = "chṛ",
+ ["छॄ"] = "chá¹",
+ --
+ ["ज"]= "ja",
+ ["जा"] = "jÄ",
+ ["जि"] = "ji",
+ ["जी"] = "jī",
+ ["जà¥"] = "ju",
+ ["जू"] = "jū",
+ ["जे"] = "je",
+ ["जो"] = "jo",
+ ["जै"] = "jai",
+ ["जौ"] = "jau",
+ ["जॢ"] = "jḷ",
+ ["जॣ"] = "jḹ",
+ ["जृ"] = "jṛ",
+ ["जॄ"] = "já¹",
+ --
+ ["à¤"]= "jha",
+ ["à¤à¤¾"] = "jhÄ",
+ ["à¤à¤¿"] = "jhi",
+ ["à¤à¥€"] = "jhÄ«",
+ ["à¤à¥"] = "jhu",
+ ["à¤à¥‚"] = "jhÅ«",
+ ["à¤à¥‡"] = "jhe",
+ ["à¤à¥‹"] = "jho",
+ ["à¤à¥ˆ"] = "jhai",
+ ["à¤à¥Œ"] = "jhau",
+ ["à¤à¥¢"] = "jhḷ",
+ ["à¤à¥£"] = "jhḹ",
+ ["à¤à¥ƒ"] = "jhá¹›",
+ ["à¤à¥„"] = "jhá¹",
+ --
+ ["ञ"]= "ña",
+ ["ञा"] = "ñÄ",
+ ["ञि"] = "ñi",
+ ["ञी"] = "ñī",
+ ["ञà¥"] = "ñu",
+ ["ञू"] = "ñū",
+ ["ञे"] = "ñe",
+ ["ञो"] = "ño",
+ ["ञै"] = "ñai",
+ ["ञौ"] = "ñau",
+ ["ञॢ"] = "ñḷ",
+ ["ञॣ"] = "ñḹ",
+ ["ञृ"] = "ñṛ",
+ ["ञॄ"] = "ñá¹",
+ --
+ ["ट"]= "ṭa",
+ ["टा"] = "á¹­Ä",
+ ["टि"] = "ṭi",
+ ["टी"] = "ṭī",
+ ["टà¥"] = "á¹­u",
+ ["टू"] = "ṭū",
+ ["टे"] = "ṭe",
+ ["टो"] = "ṭo",
+ ["टै"] = "ṭai",
+ ["टौ"] = "ṭau",
+ ["टॢ"] = "ṭḷ",
+ ["टॣ"] = "ṭḹ",
+ ["टृ"] = "ṭṛ",
+ ["टॄ"] = "á¹­á¹",
+ --
+ ["ठ"]= "ṭha",
+ ["ठा"] = "á¹­hÄ",
+ ["ठि"] = "ṭhi",
+ ["ठी"] = "ṭhī",
+ ["ठà¥"] = "á¹­hu",
+ ["ठू"] = "ṭhū",
+ ["ठे"] = "ṭhe",
+ ["ठो"] = "ṭho",
+ ["ठै"] = "ṭhai",
+ ["ठौ"] = "ṭhau",
+ ["ठॢ"] = "ṭhḷ",
+ ["ठॣ"] = "ṭhḹ",
+ ["ठृ"] = "ṭhṛ",
+ ["ठॄ"] = "á¹­há¹",
+ --
+ ["ड"]= "á¸a",
+ ["डा"] = "á¸Ä",
+ ["डि"] = "á¸i",
+ ["डी"] = "á¸Ä«",
+ ["डà¥"] = "á¸u",
+ ["डू"] = "á¸Å«",
+ ["डे"] = "á¸e",
+ ["डो"] = "á¸o",
+ ["डै"] = "á¸ai",
+ ["डौ"] = "á¸au",
+ ["डॢ"] = "á¸á¸·",
+ ["डॣ"] = "á¸á¸¹",
+ ["डृ"] = "á¸á¹›",
+ ["डॄ"] = "á¸á¹",
+ --
+ ["ढ"]= "á¸ha",
+ ["ढा"] = "á¸hÄ",
+ ["ढि"] = "á¸hi",
+ ["ढी"] = "á¸hÄ«",
+ ["ढà¥"] = "á¸hu",
+ ["ढू"] = "á¸hÅ«",
+ ["ढे"] = "á¸he",
+ ["ढो"] = "á¸ho",
+ ["ढै"] = "á¸hai",
+ ["ढौ"] = "á¸hau",
+ ["ढॢ"] = "á¸hḷ",
+ ["ढॣ"] = "á¸hḹ",
+ ["ढृ"] = "á¸há¹›",
+ ["ढॄ"] = "á¸há¹",
+ --
+ ["ण"]= "ṇa",
+ ["णा"] = "ṇÄ",
+ ["णि"] = "ṇi",
+ ["णी"] = "ṇī",
+ ["णà¥"] = "ṇu",
+ ["णू"] = "ṇū",
+ ["णे"] = "ṇe",
+ ["णो"] = "ṇo",
+ ["णै"] = "ṇai",
+ ["णौ"] = "ṇau",
+ ["णॢ"] = "ṇḷ",
+ ["णॣ"] = "ṇḹ",
+ ["णृ"] = "ṇṛ",
+ ["णॄ"] = "ṇá¹",
+ --
+ ["त"]= "ta",
+ ["ता"] = "tÄ",
+ ["ति"] = "ti",
+ ["ती"] = "tī",
+ ["तà¥"] = "tu",
+ ["तू"] = "tū",
+ ["ते"] = "te",
+ ["तो"] = "to",
+ ["तै"] = "tai",
+ ["तौ"] = "tau",
+ ["तॢ"] = "tḷ",
+ ["तॣ"] = "tḹ",
+ ["तृ"] = "tṛ",
+ ["तॄ"] = "tá¹",
+ --
+ ["थ"]= "tha",
+ ["था"] = "thÄ",
+ ["थि"] = "thi",
+ ["थी"] = "thī",
+ ["थà¥"] = "thu",
+ ["थू"] = "thū",
+ ["थे"] = "the",
+ ["थो"] = "tho",
+ ["थै"] = "thai",
+ ["थौ"] = "thau",
+ ["थॢ"] = "thḷ",
+ ["थॣ"] = "thḹ",
+ ["थृ"] = "thṛ",
+ ["थॄ"] = "thá¹",
+ --
+ ["द"]= "da",
+ ["दा"] = "dÄ",
+ ["दि"] = "di",
+ ["दी"] = "dī",
+ ["दà¥"] = "du",
+ ["दू"] = "dū",
+ ["दे"] = "de",
+ ["दो"] = "do",
+ ["दै"] = "dai",
+ ["दौ"] = "dau",
+ ["दॢ"] = "dḷ",
+ ["दॣ"] = "dḹ",
+ ["दृ"] = "dṛ",
+ ["दॄ"] = "dá¹",
+ --
+ ["ध"]= "dha",
+ ["धा"] = "dhÄ",
+ ["धि"] = "dhi",
+ ["धी"] = "dhī",
+ ["धà¥"] = "dhu",
+ ["धू"] = "dhū",
+ ["धे"] = "dhe",
+ ["धो"] = "dho",
+ ["धै"] = "dhai",
+ ["धौ"] = "dhau",
+ ["धॢ"] = "dhḷ",
+ ["धॣ"] = "dhḹ",
+ ["धृ"] = "dhṛ",
+ ["धॄ"] = "dhá¹",
+ --
+ ["न"]= "na",
+ ["ना"] = "nÄ",
+ ["नि"] = "ni",
+ ["नी"] = "nī",
+ ["नà¥"] = "nu",
+ ["नू"] = "nū",
+ ["ने"] = "ne",
+ ["नो"] = "no",
+ ["नै"] = "nai",
+ ["नौ"] = "nau",
+ ["नॢ"] = "nḷ",
+ ["नॣ"] = "nḹ",
+ ["नृ"] = "nṛ",
+ ["नॄ"] = "ná¹",
+ --
+ ["प"]= "pa",
+ ["पा"] = "pÄ",
+ ["पि"] = "pi",
+ ["पी"] = "pī",
+ ["पà¥"] = "pu",
+ ["पू"] = "pū",
+ ["पे"] = "pe",
+ ["पो"] = "po",
+ ["पै"] = "pai",
+ ["पौ"] = "pau",
+ ["पॢ"] = "pḷ",
+ ["पॣ"] = "pḹ",
+ ["पृ"] = "pṛ",
+ ["पॄ"] = "pá¹",
+ --
+ ["फ"]= "pha",
+ ["फा"] = "phÄ",
+ ["फि"] = "phi",
+ ["फी"] = "phī",
+ ["फà¥"] = "phu",
+ ["फू"] = "phū",
+ ["फे"] = "phe",
+ ["फो"] = "pho",
+ ["फै"] = "phai",
+ ["फौ"] = "phau",
+ ["फॢ"] = "phḷ",
+ ["फॣ"] = "phḹ",
+ ["फृ"] = "phṛ",
+ ["फॄ"] = "phá¹",
+ --
+ ["ब"]= "ba",
+ ["बा"] = "bÄ",
+ ["बि"] = "bi",
+ ["बी"] = "bī",
+ ["बà¥"] = "bu",
+ ["बू"] = "bū",
+ ["बे"] = "be",
+ ["बो"] = "bo",
+ ["बै"] = "bai",
+ ["बौ"] = "bau",
+ ["बॢ"] = "bḷ",
+ ["बॣ"] = "bḹ",
+ ["बृ"] = "bṛ",
+ ["बॄ"] = "bá¹",
+ --
+ ["भ"]= "bha",
+ ["भा"] = "bhÄ",
+ ["भि"] = "bhi",
+ ["भी"] = "bhī",
+ ["भà¥"] = "bhu",
+ ["भू"] = "bhū",
+ ["भे"] = "bhe",
+ ["भो"] = "bho",
+ ["भै"] = "bhai",
+ ["भौ"] = "bhau",
+ ["भॢ"] = "bhḷ",
+ ["भॣ"] = "bhḹ",
+ ["भृ"] = "bhṛ",
+ ["भॄ"] = "bhá¹",
+ --
+ ["म"]= "ma",
+ ["मा"] = "mÄ",
+ ["मि"] = "mi",
+ ["मी"] = "mī",
+ ["मà¥"] = "mu",
+ ["मू"] = "mū",
+ ["मे"] = "me",
+ ["मो"] = "mo",
+ ["मै"] = "mai",
+ ["मौ"] = "mau",
+ ["मॢ"] = "mḷ",
+ ["मॣ"] = "mḹ",
+ ["मृ"] = "mṛ",
+ ["मॄ"] = "má¹",
+ --
+ ["य"]= "ya",
+ ["या"] = "yÄ",
+ ["यि"] = "yi",
+ ["यी"] = "yī",
+ ["यà¥"] = "yu",
+ ["यू"] = "yū",
+ ["ये"] = "ye",
+ ["यो"] = "yo",
+ ["यै"] = "yai",
+ ["यौ"] = "yau",
+ ["यॢ"] = "yḷ",
+ ["यॣ"] = "yḹ",
+ ["यृ"] = "yṛ",
+ ["यॄ"] = "yá¹",
+ --
+ ["र"]= "ra",
+ ["रा"] = "rÄ",
+ ["रि"] = "ri",
+ ["री"] = "rī",
+ ["रà¥"] = "ru",
+ ["रू"] = "rū",
+ ["रे"] = "re",
+ ["रो"] = "ro",
+ ["रै"] = "rai",
+ ["रौ"] = "rau",
+ ["रॢ"] = "rḷ",
+ ["रॣ"] = "rḹ",
+ ["रृ"] = "rṛ",
+ ["रॄ"] = "rá¹",
+ --
+ ["ल"]= "la",
+ ["ला"] = "lÄ",
+ ["लि"] = "li",
+ ["ली"] = "lī",
+ ["लà¥"] = "lu",
+ ["लू"] = "lū",
+ ["ले"] = "le",
+ ["लो"] = "lo",
+ ["लै"] = "lai",
+ ["लौ"] = "lau",
+ ["लॢ"] = "lḷ",
+ ["लॣ"] = "lḹ",
+ ["लृ"] = "lṛ",
+ ["लॄ"] = "lá¹",
+ --
+ ["व"]= "va",
+ ["वा"] = "vÄ",
+ ["वि"] = "vi",
+ ["वी"] = "vī",
+ ["वà¥"] = "vu",
+ ["वू"] = "vū",
+ ["वे"] = "ve",
+ ["वो"] = "vo",
+ ["वै"] = "vai",
+ ["वौ"] = "vau",
+ ["वॢ"] = "vḷ",
+ ["वॣ"] = "vḹ",
+ ["वृ"] = "vṛ",
+ ["वॄ"] = "vá¹",
+ --
+ ["ष"]= "ṣa",
+ ["षा"] = "á¹£Ä",
+ ["षि"] = "ṣi",
+ ["षी"] = "ṣī",
+ ["षà¥"] = "á¹£u",
+ ["षू"] = "ṣū",
+ ["षे"] = "ṣe",
+ ["षो"] = "ṣo",
+ ["षै"] = "ṣai",
+ ["षौ"] = "ṣau",
+ ["षॢ"] = "ṣḷ",
+ ["षॣ"] = "ṣḹ",
+ ["षृ"] = "ṣṛ",
+ ["षॄ"] = "á¹£á¹",
+ --
+ ["श"]= "śa",
+ ["शा"] = "Å›Ä",
+ ["शि"] = "śi",
+ ["शी"] = "śī",
+ ["शà¥"] = "Å›u",
+ ["शू"] = "śū",
+ ["शे"] = "śe",
+ ["शो"] = "śo",
+ ["शै"] = "śai",
+ ["शौ"] = "śau",
+ ["शॢ"] = "śḷ",
+ ["शॣ"] = "śḹ",
+ ["शृ"] = "śṛ",
+ ["शॄ"] = "Å›á¹",
+ --
+ ["स"]= "sa",
+ ["सा"] = "sÄ",
+ ["सि"] = "si",
+ ["सी"] = "sī",
+ ["सà¥"] = "su",
+ ["सू"] = "sū",
+ ["से"] = "se",
+ ["सो"] = "so",
+ ["सै"] = "sai",
+ ["सौ"] = "sau",
+ ["सॢ"] = "sḷ",
+ ["सॣ"] = "sḹ",
+ ["सृ"] = "sṛ",
+ ["सॄ"] = "sá¹",
+ --
+ ["ह"]= "ha",
+ ["हा"] = "hÄ",
+ ["हि"] = "hi",
+ ["ही"] = "hī",
+ ["हà¥"] = "hu",
+ ["हू"] = "hū",
+ ["हे"] = "he",
+ ["हो"] = "ho",
+ ["है"] = "hai",
+ ["हौ"] = "hau",
+ ["हॢ"] = "hḷ",
+ ["हॣ"] = "hḹ",
+ ["हृ"] = "hṛ",
+ ["हॄ"] = "há¹",
+ --
+ ["ळ"]= "l̤a",
+ ["ळा"] = "l̤Ä",
+ ["ळि"] = "l̤i",
+ ["ळी"] = "l̤ī",
+ ["ळà¥"] = "l̤u",
+ ["ळू"] = "l̤ū",
+ ["ळे"] = "l̤e",
+ ["ळो"] = "l̤o",
+ ["ळै"] = "l̤ai",
+ ["ळौ"] = "l̤au",
+ ["ळॢ"] = "l̤ḷ",
+ ["ळॣ"] = "l̤ḹ",
+ ["ळृ"] = "l̤ṛ",
+ ["ळॄ"] = "l̤á¹",
+ ---
+ ["कà¥à¤·"]= "ká¹£a",
+ ["कà¥à¤·à¤¾"] = "ká¹£Ä",
+ ["कà¥à¤·à¤¿"] = "ká¹£i",
+ ["कà¥à¤·à¥€"] = "kṣī",
+ ["कà¥à¤·à¥"] = "ká¹£u",
+ ["कà¥à¤·à¥‚"] = "kṣū",
+ ["कà¥à¤·à¥‡"] = "ká¹£e",
+ ["कà¥à¤·à¥‹"] = "ká¹£o",
+ ["कà¥à¤·à¥ˆ"] = "ká¹£ai",
+ ["कà¥à¤·à¥Œ"] = "ká¹£au",
+ ["कà¥à¤·à¥¢"] = "kṣḷ",
+ ["कà¥à¤·à¥£"] = "kṣḹ",
+ ["कà¥à¤·à¥ƒ"] = "kṣṛ",
+ ["कà¥à¤·à¥„"] = "ká¹£á¹",
+ ---
+ ["जà¥à¤ž"]= "jña",
+ ["जà¥à¤žà¤¾"] = "jñÄ",
+ ["जà¥à¤žà¤¿"] = "jñi",
+ ["जà¥à¤žà¥€"] = "jñī",
+ ["जà¥à¤žà¥"] = "jñu",
+ ["जà¥à¤žà¥‚"] = "jñū",
+ ["जà¥à¤žà¥‡"] = "jñe",
+ ["जà¥à¤žà¥‹"] = "jño",
+ ["जà¥à¤žà¥ˆ"] = "jñai",
+ ["जà¥à¤žà¥Œ"] = "jñau",
+ ["जà¥à¤žà¥¢"] = "jñḷ",
+ ["जà¥à¤žà¥£"] = "jñḹ",
+ ["जà¥à¤žà¥ƒ"] = "jñṛ",
+ ["जà¥à¤žà¥„"] = "jñá¹",
+ --
+ ["कà¥"]= "k",
+ ["खà¥"] = "kh",
+ ["गà¥"] = "g",
+ ["घà¥"] = "gh",
+ ["ङà¥"] = "á¹…",
+ ["चà¥"] = "c",
+ ["छà¥"] = "ch",
+ ["जà¥"] = "j",
+ ["à¤à¥"] = "jh",
+ ["ञà¥"] = "ñ",
+ ["टà¥"] = "á¹­",
+ ["ठà¥"] = "á¹­h",
+ ["डà¥"] = "á¸",
+ ["ढà¥"] = "á¸h",
+ ["णà¥"] = "ṇ",
+ ["तà¥"] = "t",
+ ["थà¥"] = "th",
+ ["दà¥"] = "d",
+ ["धà¥"] = "dh",
+ ["नà¥"] = "n",
+ ["पà¥"] = "p",
+ ["फà¥"] = "ph",
+ ["बà¥"] = "b",
+ ["भà¥"] = "bh",
+ ["मà¥"] = "m",
+ ["यà¥"] = "y",
+ ["रà¥"] = "r",
+ ["लà¥"] = "l",
+ ["वà¥"] = "v",
+ ["शà¥"] = "Å›",
+ ["षà¥"] = "á¹£",
+ ["सà¥"] = "s",
+ ["हà¥"] = "h",
+ ["ळà¥"] = "l̤",
+ ["कà¥à¤·à¥"] = "ká¹£",
+ ["जà¥à¤žà¥"] = "jñ",
+ -- discard virama (?!) TODO: revisit this if need arises
+ -- ["à¥"] = "",
+ ["।"] = "|",
+ ["॥"] = "||",
+ ["ं"] = "ṃ",
+ ["ः"] = "ḥ",
+ ["ऽ"] = "\'",
+ -- disputed
+ ["à¤"] = "̃",
+ -- diactrics (combining): provided for completeness
+ -- warning: many fonts don't have these
+ ["॒"] = "॒",
+ -- could not test
+ -- ["॑"] = "̭",
+ ["॑"] = "॑",
+ ["᳚"] = "᳚",
+ ["á³›"] = "á³›",
+ ["᳡"] = "̀",
+ ["꣡"] = "Ì",
+ ["꣢"] = "²",
+ ["꣣"] = "³",
+ ["꣤"] = "â´",
+ ["꣥"] = "âµ",
+ ["꣦"] = "â¶",
+ ["꣧"] = "â·",
+ ["꣨"] = "â¸",
+ ["꣩"] = "â¹",
+ ["꣪"] = "꣪",
+ ["꣫"] = "꣫",
+ ["꣬"] = "꣬",
+ ["꣭"] = "꣭",
+ ["꣮"] = "꣮",
+ ["꣯"] = "꣯",
+ ["꣰"] = "꣰",
+ ["꣱"] = "꣱",
+ },
+ },
+ ["deva to mlym"] = {
+ mapping = {
+ -- vowels
+ ["अ"] = "അ",
+ ["आ"] = "ആ",
+ ["इ"] = "ഇ",
+ ["ई"] = "ഈ",
+ ["उ"] = "ഉ",
+ ["ऊ"] = "ഊ",
+ ["ऋ"] = "ഋ",
+ ["ॠ"] = "ൠ",
+ ["ऌ"] = "ഌ",
+ ["ॡ"] = "ൡ",
+ ["ऎ"] = "എ",
+ ["à¤"] = "à´",
+ ["à¤"] = "à´",
+ ["ऒ"] = "ഒ",
+ ["ओ"] = "ഓ",
+ ["औ"] = "ഔ",
+ -- consonants
+ ["क"] = "ക",
+ ["ख"] = "ഖ",
+ ["ग"] = "ഗ",
+ ["घ"] = "ഘ",
+ ["ङ"] = "ങ",
+ ["च"] = "ച",
+ ["छ"] = "ഛ",
+ ["ज"] = "ജ",
+ ["à¤"] = "à´",
+ ["ञ"] = "ഞ",
+ ["ट"] = "ട",
+ ["ठ"] = "ഠ",
+ ["ड"] = "ഡ",
+ ["ढ"] = "ഢ",
+ ["ण"] = "ണ",
+ ["त"] = "ത",
+ ["थ"] = "ഥ",
+ ["द"] = "ദ",
+ ["ध"] = "ധ",
+ ["न"] = "ന",
+ ["प"] = "പ",
+ ["फ"] = "ഫ",
+ ["ब"] = "ബ",
+ ["भ"] = "ഭ",
+ ["म"] = "മ",
+ ["य"] = "യ",
+ ["र"] = "ര",
+ ["ल"] = "ല",
+ ["व"] = "വ",
+ ["श"] = "ശ",
+ ["ष"] = "ഷ",
+ ["स"] = "സ",
+ ["ह"] = "ഹ",
+ ["ळ"] = "ള",
+ ["कà¥à¤·"] = "à´•àµà´·",
+ ["जà¥à¤ž"] = "à´œàµà´ž",
+ -- vowel marks
+ ["ा"] = "ാ",
+ ["ि"] = "ി",
+ ["ी"] = "ീ",
+ ["à¥"] = "àµ",
+ ["ू"] = "ൂ",
+ ["ृ"] = "ൃ",
+ ["ॄ"] = "ൄ",
+ ["ॢ"] = "ൢ",
+ ["ॣ"] = "ൣ",
+ ["ॆ"] = "െ",
+ ["े"] = "േ",
+ ["ै"] = "ൈ",
+ ["ॊ"] = "ൊ",
+ ["ो"] = "ോ",
+ ["ौ"] = "ൌ",
+ -- always with phonetic
+ ["ं"] = "ം",
+ ["ः"] = "ഃ",
+ ["à¤"] = "à´",
+ -- punctuation marks
+ ["à¥"] = "àµ",
+ ["'"] = "'",
+ ["।"] = ".",
+ ["॥"] = ".",
+ ["‘"] = "‘",
+ ["’"] = "’",
+ },
+ },
+ ["deva to tlgu"] = {
+ mapping = {
+ -- vowels
+ ["अ"] = "అ",
+ ["आ"] = "ఆ",
+ ["इ"] = "ఇ",
+ ["ई"] = "ఈ",
+ ["उ"] = "ఉ",
+ ["ऊ"] = "ఊ",
+ ["ऋ"] = "ఋ",
+ ["ॠ"] = "ౠ",
+ ["ऌ"] = "ఌ",
+ ["ॡ"] = "ౡ",
+ ["ऎ"] = "ఎ",
+ ["à¤"] = "à°",
+ ["à¤"] = "à°",
+ ["ऒ"] = "ఒ",
+ ["ओ"] = "ఓ",
+ ["औ"] = "ఔ",
+ -- consonants
+ ["क"] = "క",
+ ["ख"] = "ఖ",
+ ["ग"] = "గ",
+ ["घ"] = "ఘ",
+ ["ङ"] = "ఙ",
+ ["च"] = "చ",
+ ["छ"] = "ఛ",
+ ["ज"] = "జ",
+ ["à¤"] = "à°",
+ ["ञ"] = "ఞ",
+ ["ट"] = "ట",
+ ["ठ"] = "ఠ",
+ ["ड"] = "డ",
+ ["ढ"] = "ఢ",
+ ["ण"] = "ణ",
+ ["त"] = "త",
+ ["थ"] = "థ",
+ ["द"] = "ద",
+ ["ध"] = "ధ",
+ ["न"] = "న",
+ ["प"] = "ప",
+ ["फ"] = "ఫ",
+ ["ब"] = "బ",
+ ["भ"] = "భ",
+ ["म"] = "మ",
+ ["य"] = "య",
+ ["र"] = "ర",
+ ["ल"] = "ల",
+ ["व"] = "వ",
+ ["श"] = "శ",
+ ["ष"] = "ష",
+ ["स"] = "స",
+ ["ह"] = "హ",
+ ["ळ"] = "ళ",
+ ["कà¥à¤·"] = "à°•à±à°·",
+ ["जà¥à¤ž"] = "à°œà±à°ž",
+ -- vowel marks
+ ["ा"] = "ా",
+ ["ि"] = "ి",
+ ["ी"] = "ీ",
+ ["à¥"] = "à±",
+ ["ू"] = "ూ",
+ ["ृ"] = "ృ",
+ ["ॄ"] = "ౄ",
+ ["ॢ"] = "ౢ",
+ ["ॣ"] = "ౣ",
+ ["ॆ"] = "ె",
+ ["े"] = "ే",
+ ["ै"] = "ై",
+ ["ॊ"] = "ొ",
+ ["ो"] = "ో",
+ ["ौ"] = "ౌ",
+ -- always with phonetic
+ ["ं"] = "ం",
+ ["ः"] = "ః",
+ ["à¤"] = "à°€",
+ -- punctuation marks
+ ["à¥"] = "à±",
+ ["'"] = "'",
+ ["।"] = ".",
+ ["॥"] = ".",
+ ["‘"] = "‘",
+ ["’"] = "’",
+ },
+ },
+ ["deva to knda"] = {
+ mapping = {
+ -- vowels
+ ["अ"] = "ಅ",
+ ["आ"] = "ಆ",
+ ["इ"] = "ಇ",
+ ["ई"] = "ಈ",
+ ["उ"] = "ಉ",
+ ["ऊ"] = "ಊ",
+ ["ऋ"] = "ಋ",
+ ["ॠ"] = "ೠ",
+ ["ऌ"] = "ಌ",
+ ["ॡ"] = "ೡ",
+ ["ऎ"] = "ಎ",
+ ["à¤"] = "à²",
+ ["à¤"] = "à²",
+ ["ऒ"] = "ಒ",
+ ["ओ"] = "ಓ",
+ ["औ"] = "ಔ",
+ -- consonants
+ ["क"] = "ಕ",
+ ["ख"] = "ಖ",
+ ["ग"] = "ಗ",
+ ["घ"] = "ಘ",
+ ["ङ"] = "ಙ",
+ ["च"] = "ಚ",
+ ["छ"] = "ಛ",
+ ["ज"] = "ಜ",
+ ["à¤"] = "à²",
+ ["ञ"] = "ಞ",
+ ["ट"] = "ಟ",
+ ["ठ"] = "ಠ",
+ ["ड"] = "ಡ",
+ ["ढ"] = "ಢ",
+ ["ण"] = "ಣ",
+ ["त"] = "ತ",
+ ["थ"] = "ಥ",
+ ["द"] = "ದ",
+ ["ध"] = "ಧ",
+ ["न"] = "ನ",
+ ["प"] = "ಪ",
+ ["फ"] = "ಫ",
+ ["ब"] = "ಬ",
+ ["भ"] = "ಭ",
+ ["म"] = "ಮ",
+ ["य"] = "ಯ",
+ ["र"] = "ರ",
+ ["ल"] = "ಲ",
+ ["व"] = "ವ",
+ ["श"] = "ಶ",
+ ["ष"] = "ಷ",
+ ["स"] = "ಸ",
+ ["ह"] = "ಹ",
+ ["ळ"] = "ಳ",
+ ["कà¥à¤·"] = "ಕà³à²·",
+ ["जà¥à¤ž"] = "ಜà³à²ž",
+ -- vowel marks
+ ["ा"] = "ಾ",
+ ["ि"] = "ಿ",
+ ["ी"] = "ೀ",
+ ["à¥"] = "à³",
+ ["ू"] = "ೂ",
+ ["ृ"] = "ೃ",
+ ["ॄ"] = "ೄ",
+ ["ॢ"] = "ೢ",
+ ["ॣ"] = "ೣ",
+ ["ॆ"] = "ೆ",
+ ["े"] = "ೇ",
+ ["ै"] = "ೈ",
+ ["ॊ"] = "ೊ",
+ ["ो"] = "ೋ",
+ ["ौ"] = "ೌ",
+ -- always with phonetic
+ ["ं"] = "ಂ",
+ ["ः"] = "ಃ",
+ ["à¤"] = "à²",
+ -- punctuation marks
+ ["à¥"] = "à³",
+ ["'"] = "'",
+ ["।"] = ".",
+ ["॥"] = ".",
+ ["‘"] = "‘",
+ ["’"] = "’",
+ },
+ },
+ ["deva to gujr"] = {
+ mapping = {
+ -- vowels
+ ["अ"] = "અ",
+ ["आ"] = "આ",
+ ["इ"] = "ઇ",
+ ["ई"] = "ઈ",
+ ["उ"] = "ઉ",
+ ["ऊ"] = "ઊ",
+ ["ऋ"] = "ઋ",
+ ["ॠ"] = "ૠ",
+ ["ऌ"] = "ઌ",
+ ["ॡ"] = "ૡ",
+ -- ["ऎ"] = "",
+ ["à¤"] = "àª",
+ ["à¤"] = "àª",
+ -- ["ऒ"] = "",
+ ["ओ"] = "ઓ",
+ ["औ"] = "ઔ",
+ -- consonants
+ ["क"] = "ક",
+ ["ख"] = "ખ",
+ ["ग"] = "ગ",
+ ["घ"] = "ઘ",
+ ["ङ"] = "ઙ",
+ ["च"] = "ચ",
+ ["छ"] = "છ",
+ ["ज"] = "જ",
+ ["à¤"] = "àª",
+ ["ञ"] = "ઞ",
+ ["ट"] = "ટ",
+ ["ठ"] = "ઠ",
+ ["ड"] = "ડ",
+ ["ढ"] = "ઢ",
+ ["ण"] = "ણ",
+ ["त"] = "ત",
+ ["थ"] = "થ",
+ ["द"] = "દ",
+ ["ध"] = "ધ",
+ ["न"] = "ન",
+ ["प"] = "પ",
+ ["फ"] = "ફ",
+ ["ब"] = "બ",
+ ["भ"] = "ભ",
+ ["म"] = "મ",
+ ["य"] = "ય",
+ ["र"] = "ર",
+ ["ल"] = "લ",
+ ["व"] = "વ",
+ ["श"] = "શ",
+ ["ष"] = "ષ",
+ ["स"] = "સ",
+ ["ह"] = "હ",
+ ["ळ"] = "ળ",
+ ["कà¥à¤·"] = "કà«àª·",
+ ["जà¥à¤ž"] = "જà«àªž",
+ -- vowel marks
+ ["ा"] = "ા",
+ ["ि"] = "િ",
+ ["ी"] = "ી",
+ ["à¥"] = "à«",
+ ["ू"] = "ૂ",
+ ["ृ"] = "ૃ",
+ ["ॄ"] = "ૄ",
+ ["ॢ"] = "ૢ",
+ ["ॣ"] = "ૣ",
+ -- ["ॆ"] = "",
+ ["े"] = "ે",
+ ["ै"] = "ૈ",
+ -- ["ॊ"] = "",
+ ["ो"] = "ો",
+ ["ौ"] = "ૌ",
+ -- always with phonetic
+ ["ं"] = "ં",
+ ["ः"] = "ઃ",
+ ["à¤"] = "àª",
+ -- punctuation marks
+ ["à¥"] = "à«",
+ ["'"] = "'",
+ ["।"] = ".",
+ ["॥"] = ".",
+ ["‘"] = "‘",
+ ["’"] = "’",
+ },
+ },
+ ["deva to bngl"] = {
+ mapping = {
+ -- vowels
+ ["अ"] = "অ",
+ ["आ"] = "আ",
+ ["इ"] = "ই",
+ ["ई"] = "ঈ",
+ ["उ"] = "উ",
+ ["ऊ"] = "ঊ",
+ ["ऋ"] = "ঋ",
+ ["ॠ"] = "ৠ",
+ ["ऌ"] = "ঌ",
+ ["ॡ"] = "ৡ",
+ -- ["ऎ"] = "",
+ ["à¤"] = "à¦",
+ ["à¤"] = "à¦",
+ -- ["ऒ"] = "",
+ ["ओ"] = "ও",
+ ["औ"] = "ঔ",
+ -- consonants
+ ["क"] = "ক",
+ ["ख"] = "খ",
+ ["ग"] = "গ",
+ ["घ"] = "ঘ",
+ ["ङ"] = "ঙ",
+ ["च"] = "চ",
+ ["छ"] = "ছ",
+ ["ज"] = "জ",
+ ["à¤"] = "à¦",
+ ["ञ"] = "ঞ",
+ ["ट"] = "ট",
+ ["ठ"] = "ঠ",
+ ["ड"] = "ড",
+ ["ढ"] = "ঢ",
+ ["ण"] = "ণ",
+ ["त"] = "ত",
+ ["थ"] = "থ",
+ ["द"] = "দ",
+ ["ध"] = "ধ",
+ ["न"] = "ন",
+ ["प"] = "প",
+ ["फ"] = "ফ",
+ ["ब"] = "ব",
+ ["भ"] = "ভ",
+ ["म"] = "ম",
+ ["य"] = "য",
+ ["र"] = "র",
+ ["ल"] = "ল",
+ ["व"] = "ব",
+ ["श"] = "শ",
+ ["ष"] = "ষ",
+ ["स"] = "স",
+ ["ह"] = "হ",
+ -- ["ळ"] = "",
+ ["कà¥à¤·"] = "কà§à¦·",
+ ["जà¥à¤ž"] = "জà§à¦ž",
+ -- vowel marks
+ ["ा"] = "া",
+ ["ि"] = "ি",
+ ["ी"] = "ী",
+ ["à¥"] = "à§",
+ ["ू"] = "ূ",
+ ["ृ"] = "ৃ",
+ ["ॄ"] = "ৄ",
+ ["ॢ"] = "ৢ",
+ ["ॣ"] = "ৣ",
+ -- ["ॆ"] = "",
+ ["े"] = "ে",
+ ["ै"] = "ৈ",
+ -- ["ॊ"] = "",
+ ["ो"] = "ো",
+ ["ौ"] = "ৌ",
+ -- always with phonetic
+ ["ं"] = "ং",
+ ["ः"] = "ঃ",
+ ["à¤"] = "à¦",
+ -- punctuation marks
+ ["à¥"] = "à§",
+ ["'"] = "'",
+ ["।"] = ".",
+ ["॥"] = ".",
+ ["‘"] = "‘",
+ ["’"] = "’",
+ },
+ },
+ }
+}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-imp-serbian.lua b/Master/texmf-dist/tex/context/base/mkiv/lang-imp-serbian.lua
index 377d6dfde1d..6212500c264 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lang-imp-serbian.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-imp-serbian.lua
@@ -1,38 +1,81 @@
+local c2l = {
+ mapping = {
+ ["Ð"] = "A", ["а"] = "a",
+ ["Б"] = "B", ["б"] = "b",
+ ["В"] = "V", ["в"] = "v",
+ ["Г"] = "G", ["г"] = "g",
+ ["Д"] = "D", ["д"] = "d",
+ ["Ђ"] = "Ä", ["Ñ’"] = "Ä‘",
+ ["Е"] = "E", ["е"] = "e",
+ ["Ж"] = "Ž", ["ж"] = "ž",
+ ["З"] = "Z", ["з"] = "z",
+ ["И"] = "I", ["и"] = "i",
+ ["Ј"] = "J", ["ј"] = "j",
+ ["К"] = "K", ["к"] = "k",
+ ["Л"] = "L", ["л"] = "l",
+ ["Љ"] = "Lj", ["љ"] = "lj",
+ ["М"] = "M", ["м"] = "m",
+ ["Ð"] = "N", ["н"] = "n",
+ ["Њ"] = "Nj", ["њ"] = "nj",
+ ["О"] = "O", ["о"] = "o",
+ ["П"] = "P", ["п"] = "p",
+ ["Р"] = "R", ["р"] = "r",
+ ["С"] = "S", ["Ñ"] = "s",
+ ["Т"] = "T", ["т"] = "t",
+ ["Ћ"] = "Ć", ["ћ"] = "ć",
+ ["У"] = "U", ["у"] = "u",
+ ["Ф"] = "F", ["ф"] = "f",
+ ["Ð¥"] = "H", ["Ñ…"] = "h",
+ ["Ц"] = "C", ["ц"] = "c",
+ ["Ч"] = "ÄŒ", ["ч"] = "Ä",
+ ["Ð"] = "Dž", ["ÑŸ"] = "dž",
+ ["Ш"] = "Š", ["ш"] = "š",
+ }
+}
+
+local C2L = {
+ mapping = {
+ ["Ð"] = "A", ["а"] = "a",
+ ["Б"] = "B", ["б"] = "b",
+ ["В"] = "V", ["в"] = "v",
+ ["Г"] = "G", ["г"] = "g",
+ ["Д"] = "D", ["д"] = "d",
+ ["Ђ"] = "Ä", ["Ñ’"] = "Ä‘",
+ ["Е"] = "E", ["е"] = "e",
+ ["Ж"] = "Ž", ["ж"] = "ž",
+ ["З"] = "Z", ["з"] = "z",
+ ["И"] = "I", ["и"] = "i",
+ ["Ј"] = "J", ["ј"] = "j",
+ ["К"] = "K", ["к"] = "k",
+ ["Л"] = "L", ["л"] = "l",
+ ["Љ"] = "LJ", ["љ"] = "lj",
+ ["М"] = "M", ["м"] = "m",
+ ["Ð"] = "N", ["н"] = "n",
+ ["Њ"] = "NJ", ["њ"] = "nj",
+ ["О"] = "O", ["о"] = "o",
+ ["П"] = "P", ["п"] = "p",
+ ["Р"] = "R", ["р"] = "r",
+ ["С"] = "S", ["Ñ"] = "s",
+ ["Т"] = "T", ["т"] = "t",
+ ["Ћ"] = "Ć", ["ћ"] = "ć",
+ ["У"] = "U", ["у"] = "u",
+ ["Ф"] = "F", ["ф"] = "f",
+ ["Ð¥"] = "H", ["Ñ…"] = "h",
+ ["Ц"] = "C", ["ц"] = "c",
+ ["Ч"] = "ÄŒ", ["ч"] = "Ä",
+ ["Ð"] = "DŽ", ["ÑŸ"] = "dž",
+ ["Ш"] = "Š", ["ш"] = "š",
+ }
+}
+
return {
+ name = "sebian transliterations",
+ version = "1.00",
+ author = "Hans Hagen & Ivan Pešić",
+ copyright = "ConTeXt development team & whoever made this list",
transliterations = {
- ["serbian to latin"] = {
- mapping = {
- ["Ð"] = "A", ["а"] = "a",
- ["Б"] = "B", ["б"] = "b",
- ["В"] = "V", ["в"] = "v",
- ["Г"] = "G", ["г"] = "g",
- ["Д"] = "D", ["д"] = "d",
- ["Е"] = "E", ["е"] = "e",
- ["Ж"] = "Ž", ["ж"] = "ž",
- ["З"] = "Z", ["з"] = "z",
- ["И"] = "I", ["и"] = "i",
- ["Й"] = "J", ["й"] = "j",
- ["К"] = "K", ["к"] = "k",
- ["Л"] = "L", ["л"] = "l",
- ["М"] = "M", ["м"] = "m",
- ["Ð"] = "N", ["н"] = "n",
- ["О"] = "O", ["о"] = "o",
- ["П"] = "P", ["п"] = "p",
- ["Р"] = "R", ["р"] = "r",
- ["С"] = "S", ["Ñ"] = "s",
- ["Т"] = "T", ["т"] = "t",
- ["У"] = "U", ["у"] = "u",
- ["Ф"] = "F", ["ф"] = "f",
- ["Ð¥"] = "Ch", ["Ñ…"] = "ch",
- ["Ц"] = "C", ["ц"] = "c",
- ["Ч"] = "ÄŒ", ["ч"] = "Ä",
- ["Ш"] = "Š", ["ш"] = "š",
- ["Щ"] = "Št", ["щ"] = "št",
- ["Ъ"] = "Ă", ["ъ"] = "ă",
- ["Ь"] = "′", ["ь"] = "′",
- ["Ю"] = "Ju", ["ю"] = "ju",
- ["Я"] = "Ja", ["Ñ"] = "ja",
- }
- }
+ ["serbian to latin"] = c2l,
+ c2l = c2l,
+ C2L = C2L,
}
}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/lang-ini.lua
index 7a8aab8183f..54e5e96f841 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lang-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-ini.lua
@@ -21,7 +21,7 @@ if not modules then modules = { } end modules ['lang-ini'] = {
local type, tonumber, next = type, tonumber, next
local utfbyte = utf.byte
local format, gsub, gmatch, find = string.format, string.gsub, string.gmatch, string.find
-local concat, sortedkeys, sortedpairs, keys, insert = table.concat, table.sortedkeys, table.sortedpairs, table.keys, table.insert
+local concat, sortedkeys, sortedhash, keys, insert = table.concat, table.sortedkeys, table.sortedhash, table.keys, table.insert
local utfvalues, strip, utfcharacters = string.utfvalues, string.strip, utf.characters
local context = context
@@ -36,19 +36,20 @@ local trace_patterns = false trackers.register("languages.patterns", function(v
local report_initialization = logs.reporter("languages","initialization")
local lang = lang
+language = lang -- we use that in lmtx
-local prehyphenchar = lang.prehyphenchar -- global per language
-local posthyphenchar = lang.posthyphenchar -- global per language
-local preexhyphenchar = lang.preexhyphenchar -- global per language
-local postexhyphenchar = lang.postexhyphenchar -- global per language
------ lefthyphenmin = lang.lefthyphenmin
------ righthyphenmin = lang.righthyphenmin
-local sethjcode = lang.sethjcode
+local prehyphenchar = language.prehyphenchar -- global per language
+local posthyphenchar = language.posthyphenchar -- global per language
+local preexhyphenchar = language.preexhyphenchar -- global per language
+local postexhyphenchar = language.postexhyphenchar -- global per language
+----- lefthyphenmin = language.lefthyphenmin
+----- righthyphenmin = language.righthyphenmin
+local sethjcode = language.sethjcode
local uccodes = characters.uccodes
local lccodes = characters.lccodes
-local new_language = lang.new
+local new_language = language.new
languages = languages or {}
local languages = languages
@@ -157,11 +158,16 @@ local function sethjcodes(instance,loaded,what,factor)
loaded.codehash = h
end
--
- local function setcode(l)
- local u = uccodes[l]
+ local function setcode(code)
+ local l = lccodes[code] -- just in case we get a mixture
+ local u = uccodes[code] -- just in case we get a mixture
local s = l
+ if type(s) ~= "number" then
+ l = code
+ s = code
+ end
if hjcounts then
- local c = hjcounts[l]
+ local c = hjcounts[s]
if c then
c = c.count
if not c then
@@ -182,14 +188,14 @@ local function sethjcodes(instance,loaded,what,factor)
h[l] = s
if u ~= l and type(u) == "number" then
sethjcode(instance,u,s)
- h[u] = lccodes[l]
+ h[u] = s
end
end
--
local s = tex.savinghyphcodes
tex.savinghyphcodes = 0
if type(c) == "table" then
- for l in next, c do
+ for l in sortedhash(c) do
setcode(utfbyte(l))
end
else
@@ -500,15 +506,6 @@ else
return 0
end
end
-
- if CONTEXTLMTXMODE > 0 then
- numbers[0] = "null"
- registered.null = {
- number = 0,
- instance = new_language(0),
- }
- end
-
end
-- not that usefull, global values
@@ -584,7 +581,7 @@ languages.logger = languages.logger or { }
function languages.logger.report()
local result, r = { }, 0
- for tag, l in sortedpairs(registered) do
+ for tag, l in sortedhash(registered) do
if l.loaded then
r = r + 1
result[r] = format("%s:%s:%s",tag,l.parent,l.number)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/lang-ini.mkiv
index ffa280b053d..5bf08343adf 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lang-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-ini.mkiv
@@ -287,6 +287,8 @@
\s!righthyphenmin=2,
\s!lefthyphenchar=-1,
\s!righthyphenchar=45,
+ \s!explicitlefthyphenchar=\languageparameter\s!lefthyphenchar,
+ \s!explicitrighthyphenchar=\languageparameter\s!righthyphenchar,
% used in compound i.e. interfaced with c! and can be anything so no numbers
\c!lefthyphen=,
\c!righthyphen=-,
@@ -442,8 +444,10 @@
\righthyphenmin\numexpr0\languageparameter\s!righthyphenmin+\hyphenminoffset\relax
\hyphenationmin\numexpr0\languageparameter\s!hyphenmin\relax
% these values are stored with the language (global!)
- \prehyphenchar \languageparameter\s!righthyphenchar\relax
- \posthyphenchar\languageparameter\s!lefthyphenchar \relax}
+ \prehyphenchar \languageparameter\s!righthyphenchar\relax
+ \posthyphenchar \languageparameter\s!lefthyphenchar \relax
+ \preexhyphenchar \languageparameter\s!explicitrighthyphenchar\relax
+ \postexhyphenchar\languageparameter\s!explicitlefthyphenchar \relax}
\appendtoks
\lang_basics_synchronize_min_max
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-rep.lua b/Master/texmf-dist/tex/context/base/mkiv/lang-rep.lua
index 9f89fa24848..d2c47f5bacd 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lang-rep.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-rep.lua
@@ -62,11 +62,11 @@ local setprev = nuts.setprev
local setchar = nuts.setchar
local setattrlist = nuts.setattrlist
-local insert_node_before = nuts.insert_before
+local insertbefore = nuts.insertbefore
+local insertafter = nuts.insertafter
local remove_node = nuts.remove
local copy_node = nuts.copy
-local flush_list = nuts.flush_list
-local insert_after = nuts.insert_after
+local flushlist = nuts.flushlist
local nodepool = nuts.pool
local new_disc = nodepool.disc
@@ -170,7 +170,7 @@ local function tonodes(list,template)
local new = copy_node(template)
setchar(new,list[i])
if head then
- head, current = insert_after(head,current,new)
+ head, current = insertafter(head,current,new)
else
head, current = new, new
end
@@ -230,7 +230,7 @@ local function replace(head,first,last,final,hasspace,overload)
-- todo: also set attr
local new = new_disc(pre,post,replace)
setattrlist(new,first)
- head, current = insert_after(head,current,new)
+ head, current = insertafter(head,current,new)
elseif method == "noligature" then
-- not that efficient to copy but ok for testing
local list = codes[2]
@@ -239,12 +239,12 @@ local function replace(head,first,last,final,hasspace,overload)
local new = copy_node(first)
setchar(new,list[i])
setattr(new,a_noligature,1)
- head, current = insert_after(head,current,new)
+ head, current = insertafter(head,current,new)
end
else
local new = copy_node(first)
setchar(new,zwnj)
- head, current = insert_after(head,current,new)
+ head, current = insertafter(head,current,new)
end
else
report_replacement("unknown method %a",method or "?")
@@ -252,11 +252,11 @@ local function replace(head,first,last,final,hasspace,overload)
else
local new = copy_node(first)
setchar(new,codes)
- head, current = insert_after(head,current,new)
+ head, current = insertafter(head,current,new)
end
i = i + 1
end
- flush_list(list)
+ flushlist(list)
elseif newlength == 0 then
-- we overload
elseif oldlength == newlength then
@@ -271,7 +271,7 @@ local function replace(head,first,last,final,hasspace,overload)
for i=1,newlength-oldlength do
local n = copy_node(current)
setchar(n,newcodes[i])
- head, current = insert_node_before(head,current,n)
+ head, current = insertbefore(head,current,n)
current = getnext(current)
end
for i=newlength-oldlength+1,newlength do
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-tra.lua b/Master/texmf-dist/tex/context/base/mkiv/lang-tra.lua
index 5fd123349a3..35e9344aa1f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lang-tra.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-tra.lua
@@ -15,7 +15,7 @@ local nextchar = nuts.traversers.char
local getattr = nuts.getattr
local setchar = nuts.setchar
-local insert_before = nuts.insert_before
+local insertbefore = nuts.insertbefore
local copy_node = nuts.copy
local texsetattribute = tex.setattribute
@@ -97,7 +97,7 @@ function transliteration.handler(head)
for i = n-1,1,-1 do
local g = copy_node(current)
setchar(g,t[i])
- head, p = insert_before(head, p, g)
+ head, p = insertbefore(head, p, g)
end
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lang-txt.lua b/Master/texmf-dist/tex/context/base/mkiv/lang-txt.lua
index 026abbd0ed4..1b278926ec3 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lang-txt.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lang-txt.lua
@@ -16,23 +16,29 @@ if not modules then modules = { } end modules ['lang-txt'] = {
-- completed by numerous users. The following list is incomplete so feel
-- free to send me corrections.
--
+-- In 2020+ Tomas Hala and his students added some more languages and did
+-- some extensive checking of the entries in this file.
+--
-- af Afrikaans ...
-- ar Arabic Idris Samawi Hamid, Khaled Hosny
-- be Belarussian Darya Hryshkavets (2019)
-- bg Bulgarian Vladislav Hinkin, AleÅ¡ ÄŽurÄanský (2019)
--- ca Catalan ...
+-- ca Catalan ...; additions Javier Gambin Monzo + Samuel Conca Coles (2022)
-- cn Chinese Wang Lei, ...
-- cs Czech Tom Hudec, Petr Sojka, Richard Gabriel
-- da Danish Arne Jorgensen
-- de German Tobias Burnus, ...
-- en English Hans Hagen, ...
--- es Spanish Andrés Montoya, ...
+-- eo Esperanto Alain Delmotte (2021)
+-- es Spanish Andrés Montoya, ...; additions Javier Gambin Monzo + Samuel Conca Coles (2022)
-- et Estonian Clyde Johnston (2018)
--- fi Finish ...
--- fr French Daniel Flipo, Arthur Reutenauer
+-- fa Persian Mohammad Hossein Bateni (2016)
+-- fi Finnish ...; additions Ossi Salo (2022)
+-- fr French Daniel Flipo, Arthur Reutenauer; additions Arnaud Pierre Henri De Barbentane + Adrien Patton (2022)
-- gr Greek Apostolos Syropoulos, Thomas Schmitz
-- hr Croatian Željko Vrba, Richard Gabriel, Vedran Miletić
-- hu Hungarian Adam Reviczky
+-- hy Armenian Kristina Nazarjanová (2022)
-- it Italian Giuseppe Bilotta, Luigi Scarso
-- ja Japanese Richard Gabriel
-- kr Korean Jeong Dalyoung
@@ -42,7 +48,6 @@ if not modules then modules = { } end modules ['lang-txt'] = {
-- nb Norwegian Hans Fredrik Nordhaug, ...
-- nn Norwegian Hans Fredrik Nordhaug, ...
-- nl Dutch Hans Hagen
--- pe Persian Mohammad Hossein Bateni (2016)
-- pl Polish Grzegorz Sapijaszko (2011)
-- pt Portuguese Pedro F. M. Mendonça
-- ro Romanian Dan Seracu, ...
@@ -57,6 +62,7 @@ if not modules then modules = { } end modules ['lang-txt'] = {
-- ua Ukrainian Olga Briginets, Alexander Bokovoy, Victor Figurnov, ...
-- vi Vietnamese Han The Thanh
+
-- For the moment we keep this table in memory. In the future we can then
-- enable labels.
@@ -77,11 +83,15 @@ data.labels={
["labels"]={
["be"]="У",
["bg"]="в",
+ ["ca"]="En",
+ ["de"]="In",
["en"]="In",
+ ["eo"]="En",
["es"]="En",
+ ["fa"]="در",
["fr"]="Dans",
+ ["hy"]="Õ„Õ¥Õ»",
["mk"]="во",
- ["pe"]="در",
["sr"]="У",
["sr-latn"]="U",
},
@@ -90,12 +100,16 @@ data.labels={
["labels"]={
["be"]="Ðумар",
["bg"]="номер",
- ["de"]="Numer",
+ ["ca"]="Nombre",
+ ["de"]="Nummer",
["en"]="Number",
+ ["eo"]="Nombro",
+ ["es"]="Numero",
+ ["fa"]="شماره",
["fr"]="Numéro",
+ ["hy"]="Õ€Õ¡Õ´Õ¡Ö€",
["mk"]="Број",
["nl"]="Nummer",
- ["pe"]="شماره",
["sr"]="Број",
["sr-latn"]="Broj",
},
@@ -104,12 +118,17 @@ data.labels={
["labels"]={
["be"]="Гук",
["bg"]="обем",
+ ["ca"]="Volum",
["de"]="Band",
["en"]="Volume",
+ ["eo"]="Volumo",
+ ["es"]="Volumen",
["et"]="Köide",
+ ["fa"]="جلد",
+ ["fr"]="Volume",
+ ["hy"]="Ô¾Õ¡Õ¾Õ¡Õ¬",
["mk"]="Том",
["nl"]="Deel",
- ["pe"]="جلد",
["sr"]="Том",
["sr-latn"]="Tom",
},
@@ -118,15 +137,18 @@ data.labels={
["labels"]={
["be"]="i",
["bg"]="a",
+ ["ca"]="i",
["de"]="und",
["en"]="and",
+ ["eo"]="kaj",
["es"]="y",
["et"]="ja",
+ ["fa"]="Ùˆ",
["fr"]="et",
+ ["hy"]="Ö‡",
["it"]="e",
["mk"]="и",
["nl"]="en",
- ["pe"]="Ùˆ",
["sr"]="и",
["sr-latn"]="i",
},
@@ -135,15 +157,19 @@ data.labels={
["labels"]={
["be"]="Выданне",
["bg"]="издание",
+ ["ca"]="Edició",
["de"]="Auflage",
["en"]="edition",
+ ["eo"]="eldono",
["es"]="edición",
["et"]="väljaanne",
+ ["fa"]="ویرایش",
+ ["fi"]="versio",
["fr"]="édition",
+ ["hy"]="Õ°Ö€Õ¡Õ¿Õ¡Ö€Õ¡Õ¯Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶",
["it"]="edizione",
["mk"]="издание",
["nl"]="editie",
- ["pe"]="ویرایش",
["sr"]="издање",
["sr-latn"]="izdanje",
},
@@ -152,13 +178,17 @@ data.labels={
["labels"]={
["be"]="РÑдактар",
["bg"]="редактор",
+ ["ca"]="Editor",
["de"]="Herausgeber",
["en"]="editor",
+ ["eo"]="eldonisto",
+ ["es"]="editor",
["et"]="toimetaja",
+ ["fa"]="ویراستار",
["fr"]="éditeur",
+ ["hy"]="Õ­Õ´Õ¢Õ¡Õ£Õ«Ö€",
["it"]="a cura di",
["mk"]="уредник",
- ["pe"]="ویراستار",
["sr"]="уредник",
["sr-latn"]="urednik",
},
@@ -167,11 +197,14 @@ data.labels={
["labels"]={
["be"]="РÑдактары",
["bg"]="редактори",
+ ["ca"]="Editors",
["de"]="Herausgeber",
["en"]="editors",
+ ["eo"]="eldonistoj",
["es"]="editores",
["et"]="toimetajad",
["fr"]="éditeurs",
+ ["hy"]="Õ­Õ´Õ¢Õ¡Õ£Õ«Ö€Õ¶Õ¥Ö€",
["it"]="a cura di",
["mk"]="уредници",
["sr"]="уредници",
@@ -182,11 +215,15 @@ data.labels={
["labels"]={
["be"]="у",
["bg"]="в",
+ ["ca"]="en",
+ ["de"]="in",
["en"]="in",
+ ["eo"]="en",
["es"]="en",
+ ["fa"]="در",
["fr"]="dans",
+ ["hy"]="Õ´Õ¥Õ»",
["mk"]="во",
- ["pe"]="در",
["sr"]="у",
["sr-latn"]="u",
},
@@ -195,15 +232,19 @@ data.labels={
["labels"]={
["be"]="Ð”Ñ‹Ð¿Ð»Ð¾Ð¼Ð½Ð°Ñ Ñ€Ð°Ð±Ð¾Ñ‚Ð°",
["bg"]="дипломна работа",
+ ["ca"]="Tesi de maestria",
["de"]="Masterarbeit",
["en"]="Master's thesis",
+ ["eo"]="Magistreca disertaĵo",
["es"]="Tesis de maestría",
["et"]="magistritöö",
+ ["fa"]="پایان‌نامه کارشناسی ارشد",
+ ["fi"]="Pro gradu tutkielma",
["fr"]="Thèse de master (DEA, DESS, master)",
+ ["hy"]="Õ„Õ¡Õ£Õ«Õ½Õ¿Ö€Õ¸Õ½Õ¡Õ¯Õ¡Õ¶ Õ©Õ¥Õ¦",
["it"]="Tesi di laurea",
["mk"]="МагиÑтерÑка диÑертација",
["nl"]="Masterproef",
- ["pe"]="پایان‌نامه کارشناسی ارشد",
["sr"]="МаÑтер диÑертација",
["sr-latn"]="Master disertacija",
},
@@ -212,12 +253,17 @@ data.labels={
["labels"]={
["be"]="нумар",
["bg"]="номер",
- ["de"]="Numer",
+ ["ca"]="nombre",
+ ["de"]="Nummer",
["en"]="number",
+ ["eo"]="numero",
+ ["es"]="numero",
+ ["fa"]="شماره",
+ ["fi"]="numero",
["fr"]="numéro",
+ ["hy"]="Õ°Õ¡Õ´Õ¡Ö€",
["mk"]="број",
["nl"]="nummer",
- ["pe"]="شماره",
["sr"]="број",
["sr-latn"]="broj",
},
@@ -226,9 +272,13 @@ data.labels={
["labels"]={
["be"]="з",
["bg"]="на",
+ ["ca"]="de",
["de"]="von",
["en"]="of",
+ ["eo"]="de",
+ ["es"]="de",
["fr"]="de",
+ ["hy"]="-Õ«Ö",
["mk"]="од",
["nl"]="van",
["sr"]="од",
@@ -237,8 +287,14 @@ data.labels={
},
["others"]={
["labels"]={
+ ["ca"]="et al.",
+ ["de"]="et al.",
["en"]="et al.",
+ ["eo"]="aliaj",
+ ["es"]="otros",
["et"]="jt",
+ ["fr"]="et al.",
+ ["hy"]="Õ¥Ö‚ Õ¡ÕµÕ¬Õ¶",
["mk"]="и др.",
["sr"]="и др.",
["sr-latn"]="i dr.",
@@ -247,11 +303,16 @@ data.labels={
["p"]={
["labels"]={
["be"]="Ñтар.",
+ ["ca"]="p.",
["de"]="S.",
["en"]="p.",
+ ["eo"]="p.",
+ ["es"]="p",
["et"]="lk",
+ ["fa"]="ص",
+ ["fr"]="p.",
+ ["hy"]="Õ§Õ»",
["mk"]="ÑÑ‚Ñ€.",
- ["pe"]="ص",
["sr"]="ÑÑ‚Ñ€.",
["sr-latn"]="str.",
},
@@ -260,12 +321,18 @@ data.labels={
["labels"]={
["be"]="Ñтаронка",
["bg"]="Ñтрани",
+ ["ca"]="pagines",
["de"]="Seiten",
["en"]="pages",
+ ["eo"]="paÄoj",
+ ["es"]="paginas",
["et"]="leheküljed",
+ ["fa"]="صÙحات",
+ ["fi"]="sivut",
+ ["fr"]="pages",
+ ["hy"]="Õ§Õ»Õ¥Ö€",
["mk"]="Ñтраници",
["nl"]="paginas",
- ["pe"]="صÙحات",
["sr"]="Ñтраницa",
["sr-latn"]="stranica",
},
@@ -274,11 +341,15 @@ data.labels={
["labels"]={
["be"]="патÑнт",
["bg"]="патент",
+ ["ca"]="Patent",
["de"]="Patent",
["en"]="Patent",
+ ["eo"]="Patento",
["es"]="Patente",
["et"]="Patent",
+ ["fi"]="patentti",
["fr"]="Brevet",
+ ["hy"]="Ô±Ö€Õ¿Õ¸Õ¶Õ¡Õ£Õ«Ö€",
["it"]="Brevetto",
["mk"]="Патент",
["nl"]="Octrooi",
@@ -290,26 +361,33 @@ data.labels={
["labels"]={
["be"]="ДоктарÑÐºÐ°Ñ Ð´Ñ‹ÑертацыÑ",
["bg"]="диÑертачна работа",
+ ["ca"]="Tesi doctoral",
["de"]="Dissertation",
["en"]="PhD thesis",
+ ["eo"]="DoktoriÄa disertaĵo",
["es"]="Tesis doctoral",
["et"]="doktoritöö",
+ ["fa"]="رساله دکتری",
["fr"]="Thèse de doctorat",
+ ["hy"]="Ô´Õ¸Õ¯Õ¿Õ¸Ö€Õ¡Õ¯Õ¡Õ¶ Õ©Õ¥Õ¦",
["it"]="Tesi di dottorato",
["mk"]="ДокторÑка диÑертација",
["nl"]="Proefschrift",
- ["pe"]="رساله دکتری",
["sr"]="ДокторÑка диÑертација",
["sr-latn"]="Doktorska disertacija",
},
},
["pp"]={
["labels"]={
+ ["ca"]="pp",
["de"]="S.",
["en"]="pp.",
+ ["eo"]="pp.",
+ ["es"]="pp",
["et"]="lk-d",
+ ["fa"]="صص",
+ ["hy"]="Õ§Õ»",
["mk"]="ÑÑ‚Ñ€.",
- ["pe"]="صص",
["sr"]="ÑÑ‚Ñ€.",
["sr-latn"]="str.",
},
@@ -318,15 +396,19 @@ data.labels={
["labels"]={
["be"]="ТÑхнічны даклад",
["bg"]="техничеÑки доклад",
+ ["ca"]="Report tecnic",
["de"]="Technischer Bericht",
["en"]="Technical report",
+ ["eo"]="Teknika raporto",
["es"]="Informe técnico",
["et"]="tehniline raport",
+ ["fa"]="گزارش ÙÙ†ÛŒ",
+ ["fi"]="Tekninen raportti",
["fr"]="Rapport technique",
+ ["hy"]="ÕÕ¥Õ­Õ¶Õ«Õ¯Õ¡Õ¯Õ¡Õ¶ Õ°Õ¡Õ·Õ¾Õ¥Õ¿Õ¾Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶",
["it"]="Relazione tecnica",
["mk"]="Технички извештај",
["nl"]="Technisch rapport",
- ["pe"]="گزارش ÙÙ†ÛŒ",
["sr"]="Технички извештај",
["sr-latn"]="TehniÄki izveÅ¡taj",
},
@@ -335,12 +417,17 @@ data.labels={
["labels"]={
["be"]="гучнаÑць",
["bg"]="обем",
+ ["ca"]="volum",
["de"]="Band",
["en"]="volume",
+ ["eo"]="volumo",
+ ["es"]="volumen",
["et"]="köide",
+ ["fa"]="جلد",
+ ["fr"]="volume",
+ ["hy"]="Õ®Õ¡Õ¾Õ¡Õ¬",
["mk"]="том",
["nl"]="deel",
- ["pe"]="جلد",
["sr"]="том",
["sr-latn"]="tom",
},
@@ -349,11 +436,15 @@ data.labels={
["labels"]={
["be"]="з",
["bg"]="ÑÑŠÑ",
+ ["ca"]="en",
["de"]="mit",
["en"]="with",
+ ["eo"]="kun",
["es"]="con",
["et"]="koos",
+ ["fi"]="kanssa",
["fr"]="avec",
+ ["hy"]="Õ« Õ°Õ¥Õ¿",
["it"]="con",
["mk"]="Ñо",
["nl"]="met",
@@ -365,8 +456,12 @@ data.labels={
["functions"]={
["Pr"]={
["labels"]={
+ ["ca"]="Pr",
["cs"]="P",
["en"]="Pr",
+ ["eo"]="P",
+ ["es"]="Pr",
+ ["hy"]="P",
["mk"]="P",
["sk"]="P",
["sr"]="P",
@@ -375,10 +470,13 @@ data.labels={
},
["arccos"]={
["labels"]={
+ ["ca"]="arc cos",
["cs"]="arccos",
["en"]="arccos",
+ ["eo"]="arccos",
["es"]="arc\\sixperemspace cos",
["hr"]="arc\\sixperemspace cos",
+ ["hy"]="arccos",
["mk"]="arccos",
["pl"]="arc\\sixperemspace cos",
["sk"]="arccos",
@@ -388,10 +486,13 @@ data.labels={
},
["arccosh"]={
["labels"]={
+ ["ca"]="arccosh",
["cs"]="arccosh",
["en"]="arccosh",
+ ["eo"]="arccosh",
["es"]="arc\\sixperemspace cosh",
["hr"]="arc\\sixperemspace cosh",
+ ["hy"]="arccosh",
["mk"]="arccosh",
["pl"]="arc\\sixperemspace cosh",
["sk"]="arccosh",
@@ -401,10 +502,13 @@ data.labels={
},
["arcctg"]={
["labels"]={
+ ["ca"]="arc cot",
["cs"]="arccotg",
["en"]="arccot",
+ ["eo"]="arcctan",
["es"]="arc\\sixperemspace cot",
["hr"]="arc\\sixperemspace ctg",
+ ["hy"]="arcctg",
["mk"]="arccotg",
["pl"]="arc\\sixperemspace ctg",
["sk"]="arccotg",
@@ -414,10 +518,13 @@ data.labels={
},
["arcsin"]={
["labels"]={
+ ["ca"]="arc sen",
["cs"]="arcsin",
["en"]="arcsin",
+ ["eo"]="arcsin",
["es"]="arc\\sixperemspace sen",
["hr"]="arc\\sixperemspace sin",
+ ["hy"]="arcsin",
["mk"]="arcsin",
["pl"]="arc\\sixperemspace sin",
["sk"]="arcsin",
@@ -427,10 +534,13 @@ data.labels={
},
["arcsinh"]={
["labels"]={
+ ["ca"]="arc senh",
["cs"]="arcsinh",
["en"]="arcsinh",
+ ["eo"]="arcsinh",
["es"]="arc\\sixperemspace senh",
["hr"]="arc\\sixperemspace sinh",
+ ["hy"]="arcsinh",
["mk"]="arcsinh",
["pl"]="arc\\sixperemspace sinh",
["sk"]="arcsinh",
@@ -440,10 +550,13 @@ data.labels={
},
["arctan"]={
["labels"]={
+ ["ca"]="arc tan",
["cs"]="arctg",
["en"]="arctan",
+ ["eo"]="arctang",
["es"]="arc\\sixperemspace tan",
["hr"]="arc\\sixperemspace tg",
+ ["hy"]="arctan",
["mk"]="arctg",
["pl"]="arc\\sixperemspace tg",
["sk"]="arctg",
@@ -453,10 +566,13 @@ data.labels={
},
["arctanh"]={
["labels"]={
+ ["ca"]="arc tanh",
["cs"]="arctgh",
["en"]="arctanh",
+ ["eo"]="arctanh",
["es"]="arc\\sixperemspace tanh",
["hr"]="arc\\sixperemspace tgh",
+ ["hy"]="arctanh",
["mk"]="arctgh",
["pl"]="arc\\sixperemspace tgh",
["sk"]="arctgh",
@@ -466,9 +582,12 @@ data.labels={
},
["arg"]={
["labels"]={
+ ["ca"]="arg",
["cs"]="arg",
["en"]="arg",
+ ["eo"]="arg",
["es"]="arg",
+ ["hy"]="arg",
["mk"]="arg",
["sk"]="arg",
["sr"]="arg",
@@ -477,9 +596,12 @@ data.labels={
},
["cos"]={
["labels"]={
+ ["ca"]="cos",
["cs"]="cos",
["en"]="cos",
+ ["eo"]="cos",
["es"]="cos",
+ ["hy"]="cos",
["mk"]="cos",
["sk"]="cos",
["sr"]="cos",
@@ -488,9 +610,12 @@ data.labels={
},
["cosh"]={
["labels"]={
+ ["ca"]="cosh",
["cs"]="cosh",
["en"]="cosh",
+ ["eo"]="cosh",
["es"]="cosh",
+ ["hy"]="cosh",
["mk"]="cosh",
["sk"]="cosh",
["sr"]="cosh",
@@ -499,10 +624,13 @@ data.labels={
},
["cot"]={
["labels"]={
+ ["ca"]="cot",
["cs"]="cotg",
["en"]="cot",
+ ["eo"]="cotan",
["es"]="cot",
["hr"]="ctg",
+ ["hy"]="cot",
["mk"]="ctg",
["pl"]="ctg",
["sk"]="cotg",
@@ -512,9 +640,12 @@ data.labels={
},
["coth"]={
["labels"]={
+ ["ca"]="coth",
["cs"]="cotgh",
["en"]="coth",
+ ["eo"]="cotanh",
["es"]="coth",
+ ["hy"]="coth",
["mk"]="ctgh",
["sk"]="cotgh",
["sr"]="ctgh",
@@ -523,9 +654,12 @@ data.labels={
},
["csc"]={
["labels"]={
+ ["ca"]="csc",
["cs"]="cosec",
["en"]="csc",
+ ["eo"]="cosec",
["es"]="csc",
+ ["hy"]="csc",
["mk"]="cosec",
["sk"]="cosec",
["sr"]="cosec",
@@ -534,10 +668,13 @@ data.labels={
},
["ctg"]={
["labels"]={
+ ["ca"]="cot",
["cs"]="cotg",
["en"]="cot",
+ ["eo"]="cotan",
["es"]="cot",
["hr"]="ctg",
+ ["hy"]="cot",
["mk"]="ctg",
["pl"]="ctg",
["sk"]="cotg",
@@ -547,9 +684,12 @@ data.labels={
},
["deg"]={
["labels"]={
+ ["ca"]="gr",
["cs"]="deg",
["en"]="deg",
+ ["eo"]="gr",
["es"]="gr",
+ ["hy"]="deg",
["mk"]="deg",
["sk"]="deg",
["sr"]="deg",
@@ -558,9 +698,12 @@ data.labels={
},
["det"]={
["labels"]={
+ ["ca"]="det",
["cs"]="det",
["en"]="det",
+ ["eo"]="det",
["es"]="det",
+ ["hy"]="det",
["sk"]="det",
["sr"]="det",
["sr-latn"]="det",
@@ -568,14 +711,20 @@ data.labels={
},
["diff"]={
["labels"]={
+ ["ca"]="d",
["en"]="d",
+ ["eo"]="dif",
+ ["hy"]="diff",
},
},
["dim"]={
["labels"]={
+ ["ca"]="dim",
["cs"]="dim",
["en"]="dim",
+ ["eo"]="dim",
["es"]="dim",
+ ["hy"]="dim",
["mk"]="dim",
["sk"]="dim",
["sr"]="dim",
@@ -584,9 +733,12 @@ data.labels={
},
["exp"]={
["labels"]={
+ ["ca"]="exp",
["cs"]="exp",
["en"]="exp",
+ ["eo"]="eksp",
["es"]="exp",
+ ["hy"]="exp",
["sk"]="exp",
["sr"]="exp",
["sr-latn"]="exp",
@@ -594,10 +746,14 @@ data.labels={
},
["gcd"]={
["labels"]={
+ ["ca"]="med",
["cs"]="NSD",
+ ["de"]="ggT",
["en"]="gcd",
+ ["eo"]="",
["es"]="mcd",
["hr"]="nzd",
+ ["hy"]="Ô±Ô¸Ô²",
["mk"]="ÐЗД",
["nl"]="ggd",
["sk"]="NSD",
@@ -607,17 +763,23 @@ data.labels={
},
["hom"]={
["labels"]={
+ ["ca"]="hom",
["cs"]="Hom",
["en"]="hom",
+ ["eo"]="hom",
["es"]="hom",
+ ["hy"]="Õ°Õ¸Õ´",
["sk"]="Hom",
},
},
["inf"]={
["labels"]={
+ ["ca"]="inf",
["cs"]="inf",
["en"]="inf",
+ ["eo"]="inf",
["es"]="inf",
+ ["hy"]="inf",
["mk"]="inf",
["sk"]="inf",
["sr"]="inf",
@@ -626,19 +788,39 @@ data.labels={
},
["injlim"]={
["labels"]={
+ ["ca"]="inj",
["cs"]="inj\\sixperemspace lim",
["en"]="inj\\sixperemspace lim",
+ ["eo"]="",
["es"]="lím\\sixperemspace iny",
+ ["hy"]="inj\\sixperemspace lim",
["sk"]="inj\\sixperemspace lim",
["sr"]="inj\\sixperemspace lim",
["sr-latn"]="inj\\sixperemspace lim",
},
},
+ ["inv"]={
+ ["labels"]={
+ ["ca"]="inv",
+ ["cs"]="inv",
+ ["en"]="inv",
+ ["eo"]="inv",
+ ["es"]="inv",
+ ["hy"]="inv",
+ ["mk"]="inv",
+ ["sk"]="inv",
+ ["sr"]="inv",
+ ["sr-latn"]="inv",
+ },
+ },
["ker"]={
["labels"]={
+ ["ca"]="Ker",
["cs"]="ker",
["en"]="ker",
+ ["eo"]="",
["es"]="Ker",
+ ["hy"]="ker",
["sk"]="ker",
["sr"]="ker",
["sr-latn"]="ker",
@@ -646,10 +828,14 @@ data.labels={
},
["lcm"]={
["labels"]={
+ ["ca"]="MCM",
["cs"]="NSN",
+ ["de"]="kgV",
["en"]="lcm",
+ ["eo"]="",
["es"]="MCM",
["hr"]="nzv",
+ ["hy"]="Õ¡Õ¨Õ¢",
["mk"]="ÐЗС",
["nl"]="kgv",
["sk"]="NSN",
@@ -659,9 +845,14 @@ data.labels={
},
["lg"]={
["labels"]={
+ ["ca"]="log",
["cs"]="log",
+ ["de"]="log",
["en"]="lg",
+ ["eo"]="log",
["es"]="log",
+ ["fr"]="log",
+ ["hy"]="lg",
["mk"]="lg",
["sk"]="log",
["sr"]="lg",
@@ -670,9 +861,12 @@ data.labels={
},
["lim"]={
["labels"]={
+ ["ca"]="lim",
["cs"]="lim",
["en"]="lim",
+ ["eo"]="lim",
["es"]="lím",
+ ["hy"]="lim",
["mk"]="lim",
["sk"]="lim",
["sr"]="lim",
@@ -681,9 +875,12 @@ data.labels={
},
["liminf"]={
["labels"]={
+ ["ca"]="lim inf",
["cs"]="lim\\sixperemspace inf",
["en"]="lim\\sixperemspace inf",
+ ["eo"]="subinf",
["es"]="lím\\sixperemspace inf",
+ ["hy"]="lim\\sixperemspace infs",
["mk"]="lim\\sixperemspace inf",
["sk"]="lim\\sixperemspace inf",
["sr"]="lim\\sixperemspace inf",
@@ -692,9 +889,12 @@ data.labels={
},
["limsup"]={
["labels"]={
+ ["ca"]="lim sup",
["cs"]="lim\\sixperemspace sup",
["en"]="lim\\sixperemspace sup",
+ ["eo"]="suplim",
["es"]="lím\\sixperemspace sup",
+ ["hy"]="lim\\sixperemspace sup",
["mk"]="lim\\sixperemspace sup",
["sk"]="lim\\sixperemspace sup",
["sr"]="lim\\sixperemspace sup",
@@ -703,9 +903,12 @@ data.labels={
},
["ln"]={
["labels"]={
+ ["ca"]="En",
["cs"]="ln",
["en"]="ln",
+ ["eo"]="ln",
["es"]="ln",
+ ["hy"]="ln",
["mk"]="ln",
["sk"]="ln",
["sr"]="ln",
@@ -714,9 +917,12 @@ data.labels={
},
["log"]={
["labels"]={
+ ["ca"]="log",
["cs"]="log",
["en"]="log",
+ ["eo"]="log",
["es"]="log",
+ ["hy"]="log",
["mk"]="log",
["sk"]="log",
["sr"]="log",
@@ -725,9 +931,13 @@ data.labels={
},
["max"]={
["labels"]={
+ ["ca"]="max",
["cs"]="max",
["en"]="max",
+ ["eo"]="maks",
["es"]="máx",
+ ["fi"]="max",
+ ["hy"]="max",
["mk"]="max",
["sk"]="max",
["sr"]="max",
@@ -736,9 +946,14 @@ data.labels={
},
["median"]={
["labels"]={
+ ["ca"]="mitjana",
["cs"]="\\tilde",
["en"]="median",
+ ["eo"]="mediano",
["es"]="Mediana",
+ ["fi"]="mediaani",
+ ["fr"]="médiane",
+ ["hy"]="Õ´Õ«Õ»Õ«Õ¶",
["sk"]="\\tilde",
["sr"]="median",
["sr-latn"]="median",
@@ -746,9 +961,13 @@ data.labels={
},
["min"]={
["labels"]={
+ ["ca"]="min",
["cs"]="min",
["en"]="min",
+ ["eo"]="min",
["es"]="mín",
+ ["fi"]="min",
+ ["hy"]="min",
["mk"]="min",
["sk"]="min",
["sr"]="min",
@@ -757,9 +976,13 @@ data.labels={
},
["mod"]={
["labels"]={
+ ["ca"]="mod",
["cs"]="mod",
["en"]="mod",
+ ["eo"]="mod",
["es"]="mod",
+ ["fi"]="mod",
+ ["hy"]="mod",
["mk"]="mod",
["sk"]="mod",
["sr"]="mod",
@@ -768,9 +991,12 @@ data.labels={
},
["projlim"]={
["labels"]={
+ ["ca"]="lim proy",
["cs"]="proj\\sixperemspace lim",
["en"]="proj\\sixperemspace lim",
+ ["eo"]="",
["es"]="lím\\sixperemspace proy",
+ ["hy"]="proj\\sixperemspace lim",
["sk"]="proj\\sixperemspace lim",
["sr"]="proj\\sixperemspace lim",
["sr-latn"]="proj\\sixperemspace lim",
@@ -778,9 +1004,13 @@ data.labels={
},
["sec"]={
["labels"]={
+ ["ca"]="sec",
["cs"]="sec",
["en"]="sec",
+ ["eo"]="sek",
["es"]="sec",
+ ["fi"]="sek",
+ ["hy"]="sec",
["mk"]="sec",
["sk"]="sec",
["sr"]="sec",
@@ -789,9 +1019,13 @@ data.labels={
},
["sin"]={
["labels"]={
+ ["ca"]="sen",
["cs"]="sin",
["en"]="sin",
+ ["eo"]="sin",
["es"]="sen",
+ ["fi"]="sin",
+ ["hy"]="sin",
["mk"]="sin",
["sk"]="sin",
["sr"]="sin",
@@ -800,9 +1034,12 @@ data.labels={
},
["sinh"]={
["labels"]={
+ ["ca"]="senh",
["cs"]="sinh",
["en"]="sinh",
+ ["eo"]="sinh",
["es"]="senh",
+ ["hy"]="sinh",
["mk"]="sinh",
["sk"]="sinh",
["sr"]="sinh",
@@ -813,7 +1050,9 @@ data.labels={
["labels"]={
["cs"]="sup",
["en"]="sup",
+ ["eo"]="sup",
["es"]="sup",
+ ["hy"]="sup",
["mk"]="sup",
["sk"]="sup",
["sr"]="sup",
@@ -824,8 +1063,10 @@ data.labels={
["labels"]={
["cs"]="tg",
["en"]="tan",
+ ["eo"]="tan",
["es"]="tan",
["hr"]="tg",
+ ["hy"]="tan",
["mk"]="tg",
["pl"]="tg",
["sk"]="tg",
@@ -837,7 +1078,9 @@ data.labels={
["labels"]={
["cs"]="tgh",
["en"]="tanh",
+ ["eo"]="tanh",
["es"]="tanh",
+ ["hy"]="tanh",
["mk"]="tgh",
["sk"]="tgh",
["sr"]="tgh",
@@ -849,18 +1092,21 @@ data.labels={
["and"]={
["labels"]={
["af"]="",
- ["ca"]="",
+ ["ca"]=" i ",
["cs"]=" a ",
["da"]="",
["de"]=" und ",
["en"]=" and ",
+ ["eo"]=" kaj ",
["es"]=" y ",
["et"]=" ja ",
+ ["fa"]=" Ùˆ ",
["fi"]="",
- ["fr"]="",
+ ["fr"]=" et ",
["gr"]="",
["hr"]=" i ",
["hu"]=" és ",
+ ["hy"]=" Ö‡ ",
["it"]="",
["la"]="",
["lt"]="",
@@ -868,7 +1114,6 @@ data.labels={
["nb"]="",
["nl"]=" en ",
["nn"]="",
- ["pe"]=" Ùˆ ",
["pl"]=" i ",
["pt"]="",
["ro"]="",
@@ -895,13 +1140,16 @@ data.labels={
["da"]="Bilag ",
["de"]="Anhang ",
["en"]="Appendix ",
+ ["eo"]="Anekso",
["es"]="Apéndice ",
["et"]="Lisa ",
- ["fi"]="",
+ ["fa"]="پیوست ",
+ ["fi"]="liite",
["fr"]="Annexe ",
- ["gr"]="ΠαÏάÏτημα",
+ ["gr"]="ΠαÏάÏτημα ",
["hr"]="Dodatak ",
["hu"]="Melléklet ",
+ ["hy"]="Õ€Õ¡Õ¾Õ¥Õ¬Õ¾Õ¡Õ® ",
["it"]="",
["ja"]="付録",
["kr"]="부ë¡",
@@ -911,7 +1159,6 @@ data.labels={
["nb"]="Tillegg ",
["nl"]="",
["nn"]="Tillegg ",
- ["pe"]="پیوست ",
["pl"]="Dodatek ",
["pt"]="",
["ro"]="",
@@ -921,7 +1168,7 @@ data.labels={
["sr"]="Додатак ",
["sr-latn"]="Dodatak ",
["sv"]="",
- ["tk"]="Goşmaça",
+ ["tk"]="Goşmaça ",
["tr"]="",
["ua"]="",
["vi"]="",
@@ -941,13 +1188,16 @@ data.labels={
["da"]="april",
["de"]="April",
["en"]="April",
+ ["eo"]="Aprilo",
["es"]="abril",
["et"]="aprill",
+ ["fa"]="آوریل",
["fi"]="huhtikuu",
["fr"]="avril",
["gr"]="ΑπÏίλιος",
["hr"]="travnja",
["hu"]="április",
+ ["hy"]="Ô±ÕºÖ€Õ«Õ¬",
["it"]="aprile",
["ja"]="4",
["kr"]="4",
@@ -957,7 +1207,6 @@ data.labels={
["nb"]="april",
["nl"]="april",
["nn"]="april",
- ["pe"]="آوریل",
["pl"]="kwietnia",
["pt"]="abril",
["ro"]="aprilie",
@@ -975,25 +1224,30 @@ data.labels={
},
["april:jalali"]={
["labels"]={
+ ["ca"]="Tir",
["en"]="Tir",
["fa"]="تیر",
+ ["hy"]="ÕÕ«Ö€",
},
},
["april:mnem"]={
["labels"]={
["af"]="",
- ["ca"]="",
+ ["bg"]="апр.",
+ ["ca"]="abr",
["cs"]="dub.",
["da"]="",
["de"]="Apr.",
["en"]="apr",
+ ["eo"]="Apr.",
["es"]="abr.",
["et"]="apr",
["fi"]="",
- ["fr"]="",
+ ["fr"]="avr.",
["gr"]="",
["hr"]="tra",
["hu"]="ápr.",
+ ["hy"]="Ô±ÕºÖ€",
["it"]="",
["la"]="",
["lt"]="apr",
@@ -1007,8 +1261,8 @@ data.labels={
["ru"]="",
["sk"]="apr.",
["sl"]="",
- ["sr"]="апр.",
- ["sr-latn"]="apr.",
+ ["sr"]="апр",
+ ["sr-latn"]="apr",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -1020,18 +1274,21 @@ data.labels={
["labels"]={
["af"]="",
["ar"]="ÙÙŠ صÙحة ",
- ["ca"]="",
+ ["ca"]="a la pagina",
["cs"]="na stranÄ› ",
["da"]="på side ",
["de"]="auf Seite ",
["en"]="at page ",
+ ["eo"]="je paÄo",
["es"]="en la página ",
["et"]="leheküljel ",
- ["fi"]="",
+ ["fa"]="در صÙحه ",
+ ["fi"]="sivulla",
["fr"]="à la page ",
["gr"]="",
["hr"]="na stranici ",
["hu"]="oldal ",
+ ["hy"]="Õ§Õ»Õ¸Ö‚Õ´ ",
["it"]="a pagina ",
["la"]="",
["lt"]="puslapyje ",
@@ -1039,7 +1296,6 @@ data.labels={
["nb"]="på side ",
["nl"]="op pagina ",
["nn"]="på side ",
- ["pe"]="در صÙحه ",
["pl"]="na stronie ",
["pt"]="",
["ro"]="",
@@ -1070,13 +1326,16 @@ data.labels={
["da"]="august",
["de"]="August",
["en"]="August",
+ ["eo"]="AÅ­gusto",
["es"]="agosto",
["et"]="august",
+ ["fa"]="اوت",
["fi"]="elokuu",
["fr"]="août",
["gr"]="ΑÏγουστος",
["hr"]="kolovoza",
["hu"]="augusztus",
+ ["hy"]="Õ•Õ£Õ¸Õ½Õ¿Õ¸Õ½",
["it"]="agosto",
["ja"]="8",
["kr"]="8",
@@ -1086,7 +1345,6 @@ data.labels={
["nb"]="august",
["nl"]="augustus",
["nn"]="august",
- ["pe"]="اوت",
["pl"]="sierpnia",
["pt"]="agosto",
["ro"]="august",
@@ -1104,18 +1362,22 @@ data.labels={
},
["august:jalali"]={
["labels"]={
+ ["ca"]="Aban",
["en"]="Aban",
["fa"]="آبان",
+ ["hy"]="Ô±Õ¢Õ¡Õ¶",
},
},
["august:mnem"]={
["labels"]={
["af"]="",
- ["ca"]="",
+ ["bg"]="авг.",
+ ["ca"]="ag",
["cs"]="srp.",
["da"]="",
["de"]="Aug.",
["en"]="aug",
+ ["eo"]="AÅ­g.",
["es"]="ago.",
["et"]="aug",
["fi"]="",
@@ -1123,6 +1385,7 @@ data.labels={
["gr"]="",
["hr"]="kol",
["hu"]="aug.",
+ ["hy"]="Õ•Õ£",
["it"]="",
["la"]="",
["lt"]="aug",
@@ -1136,8 +1399,8 @@ data.labels={
["ru"]="",
["sk"]="aug.",
["sl"]="",
- ["sr"]="авг.",
- ["sr-latn"]="avg.",
+ ["sr"]="авг",
+ ["sr-latn"]="avg",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -1158,13 +1421,16 @@ data.labels={
["da"]="",
["de"]="Kapitel ",
["en"]="Chapter ",
+ ["eo"]="Ĉapitro",
["es"]="Capítulo ",
["et"]="Peatükk ",
- ["fi"]="",
+ ["fa"]="Ùصل ",
+ ["fi"]="luku",
["fr"]="Chapitre ",
["gr"]="Κεφάλαιο",
["hr"]="Poglavlje ",
["hu"]={ "", " fejezet" },
+ ["hy"]="Ô³Õ¬Õ¸Ö‚Õ­ ",
["it"]="",
["ja"]={ "第", "章" },
["kr"]={ "제", "장" },
@@ -1174,14 +1440,12 @@ data.labels={
["nb"]="",
["nl"]="",
["nn"]="",
- ["pe"]="Ùصل ",
["pl"]="Rozdział ",
["pt"]="",
["ro"]="",
["ru"]="",
["sk"]="Kapitola ",
["sl"]="Poglavje ",
- ["sr"]="Поглавље ",
["sr"]="Глава ",
["sr-latn"]="Glava ",
["sv"]="",
@@ -1196,18 +1460,21 @@ data.labels={
["af"]="",
["be"]=" (працÑг)",
["bg"]=" (продължение)",
- ["ca"]="",
+ ["ca"]="continua",
["cs"]=" (pokraÄování)",
["da"]="",
- ["de"]="",
+ ["de"]=" (Fortsetzung)",
["en"]=" (continued)",
+ ["eo"]=" (daÅ­rigota)",
["es"]=" (continúa)",
["et"]=" (jätkub)",
- ["fi"]="",
+ ["fa"]="(ادامه دارد)",
+ ["fi"]="(jatkuu)",
["fr"]="",
["gr"]="",
["hr"]=" (nastavak)",
["hu"]=" (folytatás)",
+ ["hy"]=" (Õ·Õ¡Ö€Õ¸Ö‚Õ¶Õ¡Õ¯Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶)",
["it"]="",
["la"]="",
["lt"]="",
@@ -1215,14 +1482,12 @@ data.labels={
["nb"]="",
["nl"]=" (vervolgd)",
["nn"]="",
- ["pe"]="(ادامه دارد)",
["pl"]="",
["pt"]="",
["ro"]="",
["ru"]="",
["sk"]=" (pokraÄovanie)",
["sl"]="",
- ["sr"]=" (наÑтавио)",
["sr"]=" (наÑтавак)",
["sr-latn"]=" (nastavak)",
["sv"]="",
@@ -1235,12 +1500,18 @@ data.labels={
["day"]={
["labels"]={
["bg"]="ден",
+ ["ca"]="dia",
+ ["de"]="Tag",
["en"]="day",
+ ["eo"]="tago",
["et"]="päev",
+ ["fa"]="روز",
+ ["fi"]="päivä",
+ ["fr"]="jour",
+ ["hy"]="Ö…Ö€",
["kr"]="ì¼",
["mk"]="ден",
["nl"]="dag",
- ["pe"]="روز",
["sr"]="дан",
["sr-latn"]="dan",
},
@@ -1259,13 +1530,16 @@ data.labels={
["da"]="december",
["de"]="Dezember",
["en"]="December",
+ ["eo"]="Decembro",
["es"]="diciembre",
["et"]="detsember",
+ ["fa"]="دسامبر",
["fi"]="joulukuu",
["fr"]="décembre",
["gr"]="ΔεκέμβÏιος",
["hr"]="prosinca",
["hu"]="december",
+ ["hy"]="Ô´Õ¥Õ¯Õ¿Õ¥Õ´Õ¢Õ¥Ö€",
["it"]="dicembre",
["ja"]="12",
["kr"]="12",
@@ -1275,7 +1549,6 @@ data.labels={
["nb"]="desember",
["nl"]="december",
["nn"]="desember",
- ["pe"]="دسامبر",
["pl"]="grudnia",
["pt"]="dezembro",
["ro"]="decembrie",
@@ -1293,25 +1566,30 @@ data.labels={
},
["december:jalali"]={
["labels"]={
+ ["ca"]="Esfand",
["en"]="Esfand",
["fa"]="اسÙند",
+ ["hy"]="Ô·Õ½Ö†Õ¡Õ¶Õ¤",
},
},
["december:mnem"]={
["labels"]={
["af"]="",
- ["ca"]="",
+ ["bg"]="дек.",
+ ["ca"]="des",
["cs"]="pros.",
["da"]="",
["de"]="Dez.",
["en"]="dec",
+ ["eo"]="Dec.",
["es"]="dic.",
["et"]="dets",
["fi"]="",
- ["fr"]="",
+ ["fr"]="déc.",
["gr"]="",
["hr"]="pro",
["hu"]="dec.",
+ ["hy"]="Ô´Õ¥Õ¯",
["it"]="",
["la"]="",
["lt"]="dec",
@@ -1325,8 +1603,8 @@ data.labels={
["ru"]="",
["sk"]="dec.",
["sl"]="",
- ["sr"]="дец.",
- ["sr-latn"]="dec.",
+ ["sr"]="дец",
+ ["sr-latn"]="dec",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -1348,13 +1626,16 @@ data.labels={
["da"]="februar",
["de"]="Februar",
["en"]="February",
+ ["eo"]="Februaro",
["es"]="febrero",
["et"]="veebruar",
+ ["fa"]="Ùوریه",
["fi"]="helmikuu",
["fr"]="février",
["gr"]="ΦεβÏουάÏιος",
["hr"]="veljaÄe",
["hu"]="február",
+ ["hy"]="ÕŠÕ¥Õ¿Ö€Õ¾Õ¡Ö€",
["it"]="febbraio",
["ja"]="2",
["kr"]="2",
@@ -1364,7 +1645,6 @@ data.labels={
["nb"]="februar",
["nl"]="februari",
["nn"]="februar",
- ["pe"]="Ùوریه",
["pl"]="lutego",
["pt"]="fevereiro",
["ro"]="februarie",
@@ -1382,25 +1662,30 @@ data.labels={
},
["february:jalali"]={
["labels"]={
+ ["ca"]="Ordibehesht",
["en"]="Ordibehesht",
["fa"]="اردیبهشت",
+ ["hy"]="Õ•Ö€Õ¤Õ«Õ¢Õ¥Õ°Õ¥Õ·Õ©",
},
},
["february:mnem"]={
["labels"]={
["af"]="",
- ["ca"]="",
+ ["bg"]="февр.",
+ ["ca"]="febr",
["cs"]="ún.",
["da"]="",
["de"]="Feb.",
["en"]="feb",
+ ["eo"]="Feb.",
["es"]="feb.",
["et"]="veebr",
["fi"]="",
- ["fr"]="",
+ ["fr"]="fév.",
["gr"]="",
["hr"]="velj",
["hu"]="feb.",
+ ["hy"]="Õ“Õ¥Õ¿",
["it"]="",
["la"]="",
["lt"]="feb",
@@ -1414,8 +1699,8 @@ data.labels={
["ru"]="",
["sk"]="feb.",
["sl"]="",
- ["sr"]="феб.",
- ["sr-latn"]="feb.",
+ ["sr"]="феб",
+ ["sr-latn"]="feb",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -1435,13 +1720,16 @@ data.labels={
["da"]="Figur ",
["de"]="Abbildung ",
["en"]="Figure ",
+ ["eo"]="Figuro ",
["es"]="Figura ",
["et"]="Joonis ",
+ ["fa"]="Ø´Ú©Ù„ ",
["fi"]="Kuva ",
["fr"]="Figure ",
["gr"]="Σχήμα",
["hr"]="Slika ",
["hu"]={ "", " ábra" },
+ ["hy"]="Õ†Õ¯Õ¡Ö€ ",
["it"]="Fig. ",
["ja"]="図",
["kr"]="그림 ",
@@ -1451,7 +1739,6 @@ data.labels={
["nb"]="Figur ",
["nl"]="Figuur ",
["nn"]="Figur ",
- ["pe"]="Ø´Ú©Ù„ ",
["pl"]="Ilustracja ",
["pt"]="Figura ",
["ro"]="Figura ",
@@ -1469,23 +1756,36 @@ data.labels={
},
["following:plural"]={
["labels"]={
+ ["de"]="ff.",
["en"]="ff.",
+ ["eo"]="sekvv",
["fr"]=hairspace .. "sqq",
+ ["hy"]="ff.",
},
},
["following:singular"]={
["labels"]={
+ ["de"]="f.",
["en"]="f.",
+ ["eo"]="sekv",
["fr"]=hairspace .. "sq",
+ ["hy"]="f.",
},
},
["followingpage"]={
["labels"]={
+ ["ca"]="en la seguent pagina",
+ ["de"]="auf einer Folgeseite",
["en"]="on a following page",
+ ["eo"]="je sekvanta paÄo",
+ ["es"]="en la siguiente pagina",
["et"]="järgmisel leheküljel",
+ ["fa"]="در صÙحات آینده",
+ ["fi"]="seuraavalla sivulla",
+ ["fr"]="sur la page suivante",
+ ["hy"]="Õ€Õ¡Õ»Õ¸Ö€Õ¤ Õ§Õ»Õ¸Ö‚Õ´",
["mk"]="на Ñледната Ñтраница",
["nl"]="op een volgende bladzijde",
- ["pe"]="در صÙحات آینده",
["sr"]="на Ñледећој Ñтраници",
["sr-latn"]="na sledećoj stranici",
},
@@ -1502,13 +1802,16 @@ data.labels={
["da"]="fredag",
["de"]="Freitag",
["en"]="Friday",
+ ["eo"]="vendredo",
["es"]="viernes",
["et"]="reede",
+ ["fa"]="جمعه",
["fi"]="perjantai",
["fr"]="vendredi",
["gr"]="ΠαÏασκευή",
["hr"]="petak",
["hu"]="péntek",
+ ["hy"]="Õ¸Ö‚Ö€Õ¢Õ¡Õ©",
["it"]="venerdì",
["ja"]="金曜日",
["kr"]="금요ì¼",
@@ -1518,7 +1821,6 @@ data.labels={
["nb"]="fredag",
["nl"]="vrijdag",
["nn"]="fredag",
- ["pe"]="جمعه",
["pl"]="piÄ…tek",
["pt"]="sexta-feira",
["ro"]="vineri",
@@ -1536,10 +1838,19 @@ data.labels={
},
["friday:mnem"]={
["labels"]={
+ ["bg"]="пт",
+ ["ca"]="dv",
+ ["cs"]="pá",
["de"]="Fr.",
["en"]="fri",
- ["sr"]="пет.",
- ["sr-latn"]="pet.",
+ ["eo"]="ven.",
+ ["es"]="vi",
+ ["fi"]="pe",
+ ["fr"]="ven.",
+ ["hy"]="ÕˆÖ‚Ö€Õ¢",
+ ["sk"]="pi",
+ ["sr"]="пет",
+ ["sr-latn"]="pet",
},
},
["graphic"]={
@@ -1552,15 +1863,18 @@ data.labels={
["cn"]="æ’图",
["cs"]="Graf ",
["da"]="Grafik ",
- ["de"]="Graphik ",
+ ["de"]="Grafik ",
["en"]="Graphic ",
+ ["eo"]="Grafiko",
["es"]="Gráfico ",
["et"]="Pilt ",
+ ["fa"]="طرح ",
["fi"]="Grafiikka ",
["fr"]="Illustration ",
["gr"]="ΓÏαφικό",
["hr"]="Slika ",
["hu"]={ "", " kép" },
+ ["hy"]="Ô³Ö€Õ¡Ö†",
["it"]="Grafico ",
["ja"]="イラスト",
["la"]="Typus ",
@@ -1569,7 +1883,6 @@ data.labels={
["nb"]="Bilde ",
["nl"]="Grafiek ",
["nn"]="Bilete ",
- ["pe"]="طرح ",
["pl"]="Grafika ",
["pt"]="Gráfico ",
["ro"]="Graficul ",
@@ -1589,19 +1902,23 @@ data.labels={
["labels"]={
["af"]="",
["ar"]="كما وضحنا سابقا",
- ["be"]="Графіка",
- ["ca"]="",
+ ["be"]="гл. вышÑй",
+ ["bg"]="виж по-горе",
+ ["ca"]="com es mostra dalt ",
["cs"]="viz výše",
["da"]="se foroven",
- ["de"]="siehe oben",
+ ["de"]="siehe oben", -- better "oben"?
["en"]="as we show above",
+ ["eo"]="laÅ­supre",
["es"]="como se muestra arriba",
["et"]="nii nagu üleval näidatud",
- ["fi"]="",
+ ["fa"]="چنان‌که شرح دادیم",
+ ["fi"]="kuten yllä näytämme",
["fr"]="ci-dessus",
["gr"]="",
["hr"]="vidi gore",
["hu"]="lásd feljebb",
+ ["hy"]="Õ½Õ¿Õ¸Ö€Ö‡ Õ¶Õ·Õ¾Õ¡Õ®",
["it"]="come mostrato sopra",
["kr"]="그러므로",
["la"]="",
@@ -1610,14 +1927,12 @@ data.labels={
["nb"]="som vist over",
["nl"]="hierboven",
["nn"]="som vist over",
- ["pe"]="چنان‌که شرح دادیم",
["pl"]="jak pokazano wyżej",
["pt"]="",
["ro"]="",
["ru"]="Ñм. выше",
["sk"]="pozri hore",
["sl"]="glej zgoraj",
- ["sr"]="види горе",
["sr"]="као што је показано изнад",
["sr-latn"]="kao Å¡to je pokazano iznad",
["sv"]="se ovan",
@@ -1631,20 +1946,23 @@ data.labels={
["labels"]={
["af"]="",
["ar"]="كما نوضح لاحقا",
- ["be"]="гл. вышÑй",
+ ["be"]="гл. ніжÑй",
["bg"]="ў далейшым",
- ["ca"]="",
+ ["ca"]="com es mostra baix",
["cs"]="viz níže",
["da"]="se forneden",
- ["de"]="siehe unten",
+ ["de"]="siehe unten", -- better "nachstehend"?
["en"]="as we show below",
+ ["eo"]="laÅ­sube",
["es"]="como se muestra abajo",
["et"]="nii nagu all näidatud",
- ["fi"]="",
+ ["fa"]="چنان‌که شرح خواهیم داد",
+ ["fi"]="kuten alla näytämme",
["fr"]="ci-dessous",
["gr"]="",
["hr"]="vidi ispod",
["hu"]="lásd lejjebb",
+ ["hy"]="Õ«Õ¶Õ¹ÕºÕ¥Õ½ ÖÕ¸Ö‚ÕµÖ Õ§ Õ¿Ö€Õ¾Õ¡Õ® Õ½Õ¿Õ¸Ö€Ö‡",
["it"]="come mostrato sotto",
["kr"]="ì´í›„ë¡œ",
["la"]="",
@@ -1653,14 +1971,12 @@ data.labels={
["nb"]="som vist under",
["nl"]="hieronder",
["nn"]="som vist under",
- ["pe"]="چنان‌که شرح خواهیم داد",
["pl"]="jak pokazano niżej",
["pt"]="",
["ro"]="",
["ru"]="Ñм. ниже",
["sk"]="pozri Äalej",
["sl"]="glej spodaj",
- ["sr"]="види доле",
["sr"]="као што је показано ниже",
["sr-latn"]="kao što je pokazano niže",
["sv"]="se nedan",
@@ -1674,14 +1990,15 @@ data.labels={
["labels"]={
["af"]="Intermezzo ",
["ar"]="Ùسحة ",
- ["be"]="УÑтаўка",
- ["bg"]="Aнтракт ",
+ ["be"]="ІнтÑрмецца ",
+ ["bg"]="Интермецо ",
["ca"]="Intermedi ",
["cn"]="퉣",
["cs"]="Intermezzo ",
["da"]="Intermezzo ",
["de"]="Intermezzo ",
["en"]="Intermezzo ",
+ ["eo"]="Intermezo",
["es"]="Intermedio ",
["et"]="Vahemäng ",
["fi"]="Intermezzo ",
@@ -1689,6 +2006,7 @@ data.labels={
["gr"]="ΠαÏση",
["hr"]="Intermeco ",
["hu"]={ "", " intermezzo" },
+ ["hy"]="Ô»Õ¶Õ¿Õ¥Ö€Õ´Õ¥ÖÕ¸",
["it"]="Intermezzo ",
["ja"]="é–“å¥æ›²",
["kr"]="간주곡",
@@ -1704,7 +2022,6 @@ data.labels={
["ru"]="Ð’Ñтавка ",
["sk"]="Intermezzo ",
["sl"]="Intermezzo ",
- ["sr"]="Интермеззо ",
["sr"]="ДигреÑија ",
["sr-latn"]="Digresija ",
["sv"]="Intermezzo ",
@@ -1728,13 +2045,16 @@ data.labels={
["da"]="januar",
["de"]="Januar",
["en"]="January",
+ ["eo"]="Januaro",
["es"]="enero",
["et"]="jaanuar",
+ ["fa"]="ژانویه",
["fi"]="tammikuu",
["fr"]="janvier",
["gr"]="ΙανουάÏιος",
["hr"]="sijeÄnja",
["hu"]="január",
+ ["hy"]="Õ€Õ¸Ö‚Õ¶Õ¾Õ¡Ö€",
["it"]="gennaio",
["ja"]="1",
["kr"]="1",
@@ -1744,7 +2064,6 @@ data.labels={
["nb"]="januar",
["nl"]="januari",
["nn"]="januar",
- ["pe"]="ژانویه",
["pl"]="stycznia",
["pt"]="janeiro",
["ro"]="ianuarie",
@@ -1762,25 +2081,31 @@ data.labels={
},
["january:jalali"]={
["labels"]={
+ ["ca"]="Farvardin",
["en"]="Farvardin",
+ ["es"]="Farvardin",
["fa"]="Ùروردین",
+ ["hy"]="Õ–Õ¡Ö€Õ¾Õ¡Ö€Õ¤Õ«Õ¶",
},
},
["january:mnem"]={
["labels"]={
["af"]="",
- ["ca"]="",
+ ["bg"]="Ñн.",
+ ["ca"]="gen",
["cs"]="led.",
["da"]="",
["de"]="Jan.",
["en"]="jan",
+ ["eo"]="Jan.",
["es"]="ene.",
["et"]="jaan",
["fi"]="",
- ["fr"]="",
+ ["fr"]="jan.",
["gr"]="",
["hr"]="sij",
["hu"]="jan.",
+ ["hy"]="Õ€Õ¸Ö‚Õ¶Õ¾",
["it"]="",
["la"]="",
["lt"]="jan",
@@ -1794,8 +2119,8 @@ data.labels={
["ru"]="",
["sk"]="jan.",
["sl"]="",
- ["sr"]="јан.",
- ["sr-latn"]="jan.",
+ ["sr"]="јан",
+ ["sr-latn"]="jan",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -1818,13 +2143,16 @@ data.labels={
["da"]="juli",
["de"]="Juli",
["en"]="July",
+ ["eo"]="Julio",
["es"]="julio",
["et"]="juuli",
+ ["fa"]="ژوئیه",
["fi"]="heinäkuu",
["fr"]="juillet",
["gr"]="ΙοÏλιος",
["hr"]="srpnja",
["hu"]="július",
+ ["hy"]="Õ€Õ¸Ö‚Õ¬Õ«Õ½",
["it"]="luglio",
["ja"]="7",
["kr"]="7",
@@ -1834,7 +2162,6 @@ data.labels={
["nb"]="juli",
["nl"]="juli",
["nn"]="juli",
- ["pe"]="ژوئیه",
["pl"]="lipca",
["pt"]="julho",
["ro"]="iulie",
@@ -1852,25 +2179,31 @@ data.labels={
},
["july:jalali"]={
["labels"]={
+ ["ca"]="Mehr",
["en"]="Mehr",
+ ["es"]="Mehr",
["fa"]="مهر",
+ ["hy"]="Õ„Õ¥Õ°Ö€",
},
},
["july:mnem"]={
["labels"]={
["af"]="",
- ["ca"]="",
+ ["bg"]="юли",
+ ["ca"]="jul",
["cs"]="Äce",
["da"]="",
["de"]="Jul.",
["en"]="jul",
+ ["eo"]="Jul.",
["es"]="jul.",
["et"]="juuli",
["fi"]="",
- ["fr"]="",
+ ["fr"]="juill.",
["gr"]="",
["hr"]="srp",
["hu"]="júl.",
+ ["hy"]="Õ€Õ¸Ö‚Õ¬",
["it"]="",
["la"]="",
["lt"]="jul",
@@ -1884,8 +2217,8 @@ data.labels={
["ru"]="",
["sk"]="júla",
["sl"]="",
- ["sr"]="јул.",
- ["sr-latn"]="jul.",
+ ["sr"]="јул",
+ ["sr-latn"]="jul",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -1907,13 +2240,16 @@ data.labels={
["da"]="juni",
["de"]="Juni",
["en"]="June",
+ ["eo"]="Junio",
["es"]="junio",
["et"]="juuni",
+ ["fa"]="ژوئن",
["fi"]="kesäkuu",
["fr"]="juin",
["gr"]="ΙοÏνιος",
["hr"]="lipnja",
["hu"]="június",
+ ["hy"]="Õ€Õ¸Ö‚Õ¶Õ«Õ½Õ«",
["it"]="giugno",
["ja"]="6",
["kr"]="6",
@@ -1923,7 +2259,6 @@ data.labels={
["nb"]="juni",
["nl"]="juni",
["nn"]="juni",
- ["pe"]="ژوئن",
["pl"]="czerwca",
["pt"]="junho",
["ro"]="iunie",
@@ -1941,25 +2276,31 @@ data.labels={
},
["june:jalali"]={
["labels"]={
+ ["ca"]="Shahrivar",
["en"]="Shahrivar",
+ ["es"]="Shahrivar",
["fa"]="شهریور",
+ ["hy"]="Õ‡Õ¡Õ°Ö€Õ«Õ¾Õ¡Ö€",
},
},
["june:mnem"]={
["labels"]={
["af"]="",
- ["ca"]="",
+ ["bg"]="юни",
+ ["ca"]="juny",
["cs"]="Äer.",
["da"]="",
["de"]="Jun.",
["en"]="jun",
+ ["eo"]="Jun.",
["es"]="jun.",
["et"]="juuni",
["fi"]="",
- ["fr"]="",
+ ["fr"]="juin",
["gr"]="",
["hr"]="lip",
["hu"]="jún.",
+ ["hy"]="Õ€Õ¸Ö‚Õ¶",
["it"]="",
["la"]="",
["lt"]="jun",
@@ -1994,13 +2335,16 @@ data.labels={
["da"]="linie ",
["de"]="Zeile ",
["en"]="line ",
+ ["eo"]="linio ",
["es"]="línea ",
["et"]="joon ",
+ ["fa"]="سطر ",
["fi"]="rivi ",
["fr"]="ligne ",
["gr"]="ΓÏαμμή",
["hr"]="redak ",
["hu"]={ "", " sor" },
+ ["hy"]="ÕÕ¸Õ² ",
["it"]="riga ",
["ja"]="ç·š",
["kr"]="í–‰",
@@ -2010,7 +2354,6 @@ data.labels={
["nb"]="linje ",
["nl"]="regel ",
["nn"]="linje ",
- ["pe"]="سطر ",
["pl"]="wiersz ",
["pt"]="linha ",
["ro"]="linia ",
@@ -2038,13 +2381,16 @@ data.labels={
["da"]="linier ",
["de"]="Zeilen ",
["en"]="lines ",
+ ["eo"]="linioj ",
["es"]="líneas ",
["et"]="jooned ",
+ ["fa"]="سطرهای ",
["fi"]="rivie ",
["fr"]="lignes ",
["gr"]="ΓÏαμμές",
["hr"]="retci ",
["hu"]="sorok ",
+ ["hy"]="ÕÕ¸Õ²Õ¥Ö€ ",
["it"]="righe ",
["ja"]="ç·š",
["kr"]="í–‰",
@@ -2054,7 +2400,6 @@ data.labels={
["nb"]="linjer ",
["nl"]="regels ",
["nn"]="linjer ",
- ["pe"]="سطرهای ",
["pl"]="wiersze ",
["pt"]="linhas ",
["ro"]="liniile ",
@@ -2083,13 +2428,16 @@ data.labels={
["da"]="marts",
["de"]="März",
["en"]="March",
+ ["eo"]="Marto",
["es"]="marzo",
["et"]="märts",
+ ["fa"]="مارس",
["fi"]="maaliskuu",
["fr"]="mars",
["gr"]="ΜάÏτιος",
["hr"]="ožujka",
["hu"]="március",
+ ["hy"]="Õ„Õ¡Ö€Õ¿",
["it"]="marzo",
["ja"]="3",
["kr"]="3",
@@ -2099,7 +2447,6 @@ data.labels={
["nb"]="mars",
["nl"]="maart",
["nn"]="mars",
- ["pe"]="مارس",
["pl"]="marca",
["pt"]="março",
["ro"]="martie",
@@ -2117,25 +2464,31 @@ data.labels={
},
["march:jalali"]={
["labels"]={
+ ["ca"]="Jordad",
["en"]="Khordad",
+ ["es"]="Khordad",
["fa"]="خرداد",
+ ["hy"]="Ô½Õ¸Ö€Õ¤Õ¡Õ¤",
},
},
["march:mnem"]={
["labels"]={
["af"]="",
- ["ca"]="",
+ ["bg"]="март",
+ ["ca"]="març",
["cs"]="břez.",
["da"]="",
["de"]="Mrz.",
["en"]="mar",
+ ["eo"]="Mar.",
["es"]="mar.",
["et"]="märts",
["fi"]="",
- ["fr"]="",
+ ["fr"]="mars",
["gr"]="",
["hr"]="ožu",
["hu"]="már.",
+ ["hy"]="Õ„Õ¡Ö€Õ¿",
["it"]="",
["la"]="",
["lt"]="mar",
@@ -2149,8 +2502,8 @@ data.labels={
["ru"]="",
["sk"]="mar.",
["sl"]="",
- ["sr"]="мар.",
- ["sr-latn"]="mar.",
+ ["sr"]="мар",
+ ["sr-latn"]="mar",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -2173,13 +2526,16 @@ data.labels={
["da"]="maj",
["de"]="Mai",
["en"]="May",
+ ["eo"]="Majo",
["es"]="mayo",
["et"]="mai",
+ ["fa"]="مه",
["fi"]="toukokuu",
["fr"]="mai",
["gr"]="Μάιος",
["hr"]="svibnja",
["hu"]="május",
+ ["hy"]="Õ„Õ¡ÕµÕ«Õ½",
["it"]="maggio",
["ja"]="5",
["kr"]="5",
@@ -2189,7 +2545,6 @@ data.labels={
["nb"]="mai",
["nl"]="mei",
["nn"]="mai",
- ["pe"]="مه",
["pl"]="maja",
["pt"]="maio",
["ro"]="mai",
@@ -2207,25 +2562,31 @@ data.labels={
},
["may:jalali"]={
["labels"]={
+ ["ca"]="Mordad",
["en"]="Mordad",
+ ["es"]="Mordad",
["fa"]="مرداد",
+ ["hy"]="Õ„Õ¸Ö€Õ¤Õ¡Õ¤",
},
},
["may:mnem"]={
["labels"]={
["af"]="",
- ["ca"]="",
+ ["bg"]="май",
+ ["ca"]="maig",
["cs"]="květ.",
["da"]="",
["de"]="Mai",
["en"]="may",
+ ["eo"]="Maj.",
["es"]="may.",
["et"]="mai",
["fi"]="",
- ["fr"]="",
+ ["fr"]="mai",
["gr"]="",
["hr"]="svi",
["hu"]="máj.",
+ ["hy"]="Õ„Õ¡Õµ",
["it"]="",
["la"]="",
["lt"]="may",
@@ -2260,13 +2621,16 @@ data.labels={
["da"]="mandag",
["de"]="Montag",
["en"]="Monday",
+ ["eo"]="lundo",
["es"]="lunes",
["et"]="esmaspäev",
+ ["fa"]="دوشنبه",
["fi"]="maanantai",
["fr"]="lundi",
["gr"]="ΔευτέÏα",
["hr"]="ponedjeljak",
["hu"]="hétfő",
+ ["hy"]="Õ¥Ö€Õ¯Õ¸Ö‚Õ·Õ¡Õ¢Õ©Õ«",
["it"]="lunedì",
["ja"]="月曜日",
["kr"]="월요ì¼",
@@ -2276,7 +2640,6 @@ data.labels={
["nb"]="mandag",
["nl"]="maandag",
["nn"]="måndag",
- ["pe"]="دوشنبه",
["pl"]="poniedziałek",
["pt"]="segunda-feira",
["ro"]="luni",
@@ -2294,22 +2657,38 @@ data.labels={
},
["monday:mnem"]={
["labels"]={
+ ["bg"]="пн",
+ ["ca"]="dl",
+ ["cs"]="po",
["de"]="Mo.",
["en"]="mon",
- ["sr"]="пон.",
- ["sr-latn"]="pon.",
+ ["eo"]="lun.",
+ ["es"]="lu",
+ ["fi"]="ma",
+ ["fr"]="lun.",
+ ["hy"]="ÔµÖ€Õ¯",
+ ["sk"]="po",
+ ["sr"]="пон",
+ ["sr-latn"]="pon",
},
},
["month"]={
["labels"]={
["be"]="меÑÑц",
["bg"]="меÑец",
+ ["ca"]="mes",
+ ["de"]="Monat",
["en"]="month",
+ ["eo"]="monato",
+ ["es"]="mes",
["et"]="kuu",
+ ["fa"]="ماه",
+ ["fi"]="kuukausi",
+ ["fr"]="mois",
+ ["hy"]="Õ¡Õ´Õ«Õ½",
["kr"]="ì›”",
["mk"]="меÑец",
["nl"]="maand",
- ["pe"]="ماه",
["sr"]="меÑец",
["sr-latn"]="mesec",
},
@@ -2328,13 +2707,16 @@ data.labels={
["da"]="november",
["de"]="November",
["en"]="November",
+ ["eo"]="Novembro",
["es"]="noviembre",
["et"]="november",
+ ["fa"]="نوامبر",
["fi"]="marraskuu",
["fr"]="novembre",
["gr"]="ÎοέμβÏιος",
["hr"]="studenog",
["hu"]="november",
+ ["hy"]="Õ†Õ¸ÕµÕ¥Õ´Õ¢Õ¥Ö€",
["it"]="novembre",
["ja"]="11",
["kr"]="11",
@@ -2344,7 +2726,6 @@ data.labels={
["nb"]="november",
["nl"]="november",
["nn"]="november",
- ["pe"]="نوامبر",
["pl"]="listopada",
["pt"]="novembro",
["ro"]="noiembrie",
@@ -2362,25 +2743,31 @@ data.labels={
},
["november:jalali"]={
["labels"]={
+ ["ca"]="Bahman",
["en"]="Bahman",
+ ["es"]="Bahman",
["fa"]="بهمن",
+ ["hy"]="Ô²Õ¡Õ°Õ´Õ¡Õ¶",
},
},
["november:mnem"]={
["labels"]={
["af"]="",
- ["ca"]="",
+ ["bg"]="ноем.",
+ ["ca"]="nov",
["cs"]="list.",
["da"]="",
["de"]="Nov.",
["en"]="nov",
+ ["eo"]="Nov.",
["es"]="nov.",
["et"]="nov",
["fi"]="",
- ["fr"]="",
+ ["fr"]="nov.",
["gr"]="",
["hr"]="stu",
["hu"]="nov.",
+ ["hy"]="Õ†Õ¸Õµ",
["it"]="",
["la"]="",
["lt"]="nov",
@@ -2394,8 +2781,8 @@ data.labels={
["ru"]="",
["sk"]="nov.",
["sl"]="",
- ["sr"]="нов.",
- ["sr-latn"]="nov.",
+ ["sr"]="нов",
+ ["sr-latn"]="nov",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -2416,13 +2803,16 @@ data.labels={
["da"]="oktober",
["de"]="Oktober",
["en"]="October",
+ ["eo"]="Oktobro",
["es"]="octubre",
["et"]="oktoober",
+ ["fa"]="اکتبر",
["fi"]="lokakuu",
["fr"]="octobre",
["gr"]="ΟκτώβÏιος",
["hr"]="listopada",
["hu"]="október",
+ ["hy"]="Õ°Õ¸Õ¯Õ¿Õ¥Õ´Õ¢Õ¥Ö€",
["it"]="ottobre",
["ja"]="10",
["kr"]="10",
@@ -2432,7 +2822,6 @@ data.labels={
["nb"]="oktober",
["nl"]="oktober",
["nn"]="oktober",
- ["pe"]="اکتبر",
["pl"]="października",
["pt"]="outubro",
["ro"]="octombrie",
@@ -2450,25 +2839,31 @@ data.labels={
},
["october:jalali"]={
["labels"]={
+ ["ca"]="Dey",
["en"]="Dey",
+ ["es"]="Dey",
["fa"]="دی",
+ ["hy"]="Ô´Õ¥Õµ",
},
},
["october:mnem"]={
["labels"]={
["af"]="",
- ["ca"]="",
+ ["bg"]="окт.",
+ ["ca"]="oct",
["cs"]="říj.",
["da"]="",
["de"]="Okt.",
["en"]="oct",
+ ["eo"]="Okt.",
["es"]="oct.",
["et"]="okt",
["fi"]="",
- ["fr"]="",
+ ["fr"]="oct.",
["gr"]="",
["hr"]="lis",
["hu"]="okt.",
+ ["hy"]="Õ€Õ¸Õ¯",
["it"]="",
["la"]="",
["lt"]="oct",
@@ -2482,8 +2877,8 @@ data.labels={
["ru"]="",
["sk"]="okt.",
["sl"]="",
- ["sr"]="окт.",
- ["sr-latn"]="okt.",
+ ["sr"]="окт",
+ ["sr-latn"]="okt",
["sv"]="",
["tk"]="",
["tr"]="",
@@ -2497,18 +2892,21 @@ data.labels={
["ar"]="صÙحة ",
["be"]="Ñтаронка ",
["bg"]="Ñтрана",
- ["ca"]="",
+ ["ca"]="pagina ",
["cs"]="strana ",
["da"]="Side ",
["de"]="Seite ",
["en"]="page ",
+ ["eo"]="paÄo ",
["es"]="página ",
["et"]="lehekülg ",
- ["fi"]="",
+ ["fa"]="صÙحه ",
+ ["fi"]="Sivu",
["fr"]="page ",
["gr"]="",
["hr"]="stranica ",
["hu"]="oldal ",
+ ["hy"]="Õ§Õ» ",
["it"]="pagina ",
["kr"]="쪽",
["la"]="",
@@ -2517,7 +2915,6 @@ data.labels={
["nb"]="side ",
["nl"]="pagina ",
["nn"]="side ",
- ["pe"]="صÙحه ",
["pl"]="strona ",
["pt"]="",
["ro"]="",
@@ -2545,13 +2942,16 @@ data.labels={
["da"]="Del ",
["de"]="Teil ",
["en"]="Part ",
+ ["eo"]="Parto ",
["es"]="Parte ",
["et"]="Osa ",
+ ["fa"]="قسمت ",
["fi"]="Osa ",
["fr"]="Partie ",
["gr"]="ΜέÏος",
["hr"]="Dio ",
["hu"]={ "", " rész" },
+ ["hy"]="Õ„Õ¡Õ½ ",
["it"]="Parte ",
["ja"]={ "第", "パート" },
["kr"]={ "제", "부" },
@@ -2561,7 +2961,6 @@ data.labels={
["nb"]="Del ",
["nl"]="Deel ",
["nn"]="Del",
- ["pe"]="قسمت ",
["pl"]="Część ",
["pt"]="Parte ",
["ro"]="Partea ",
@@ -2579,11 +2978,18 @@ data.labels={
},
["precedingpage"]={
["labels"]={
+ ["ca"]="en una pagina anterior",
+ ["de"]="oben", -- "auf der vorigen Seite" ok, but not "auf einer vorigen Seite"
["en"]="on a preceding page",
+ ["eo"]="sur antaÅ­a paÄo",
+ ["es"]="en la pagina anterior",
["et"]="eelmisel lehel",
+ ["fa"]="در صÙحات گذشته",
+ ["fi"]="edellisellä sivulla",
+ ["fr"]="sur la page précédente",
+ ["hy"]="Õ¶Õ¡Õ­Õ¸Ö€Õ¤ Õ§Õ»",
["mk"]="на претходната Ñтраница",
["nl"]="op een voorgaande bladzijde",
- ["pe"]="در صÙحات گذشته",
["sr"]="на претходној Ñтраници",
["sr-latn"]="na prethodnoj stranici",
},
@@ -2600,13 +3006,16 @@ data.labels={
["da"]="lørdag",
["de"]="Samstag",
["en"]="Saturday",
+ ["eo"]="sabato",
["es"]="sábado",
["et"]="laupäev",
+ ["fa"]="شنبه",
["fi"]="lauantai",
["fr"]="samedi",
["gr"]="Σάββατο",
["hr"]="subota",
["hu"]="szombat",
+ ["hy"]="Õ·Õ¡Õ¢Õ¡Õ©",
["it"]="sabato",
["ja"]="土曜日",
["kr"]="토요ì¼",
@@ -2616,7 +3025,6 @@ data.labels={
["nb"]="lørdag",
["nl"]="zaterdag",
["nn"]="laurdag",
- ["pe"]="شنبه",
["pl"]="sobota",
["pt"]="sábado",
["ro"]="sâmbătă",
@@ -2634,10 +3042,18 @@ data.labels={
},
["saturday:mnem"]={
["labels"]={
+ ["bg"]="Ñб",
+ ["cs"]="so",
["de"]="Sa.",
["en"]="sat",
- ["sr"]="Ñуб.",
- ["sr-latn"]="sub.",
+ ["eo"]="sab.",
+ ["es"]="sa",
+ ["fi"]="La",
+ ["fr"]="sam.",
+ ["hy"]="Õ‡Õ¡Õ¢",
+ ["sk"]="so",
+ ["sr"]="Ñуб",
+ ["sr-latn"]="sub",
},
},
["section"]={
@@ -2650,15 +3066,18 @@ data.labels={
["cn"]={ "第", "节" },
["cs"]="Sekce ",
["da"]="",
- ["de"]="",
- ["en"]="",
+ ["de"]="Abschnitt ",
+ ["en"]="Section",
+ ["eo"]="Sekcio ",
["es"]="Sección ",
["et"]="jaos ",
- ["fi"]="",
+ ["fa"]="بخش ",
+ ["fi"]="Osio",
["fr"]="Section ",
["gr"]="Ενότητα",
["hr"]="Odjeljak ",
["hu"]="Fejezet ",
+ ["hy"]="Ô²Õ¡ÕªÕ«Õ¶ ",
["it"]="",
["ja"]={ "第", "項" },
["kr"]={ "제", "절" },
@@ -2668,7 +3087,6 @@ data.labels={
["nb"]="",
["nl"]="",
["nn"]="",
- ["pe"]="بخش ",
["pl"]="Podrozdział ",
["pt"]="",
["ro"]="",
@@ -2690,18 +3108,21 @@ data.labels={
["ar"]="انظر ",
["be"]="гл. ",
["bg"]="погледни",
- ["ca"]="",
+ ["ca"]="vore ",
["cs"]="viz ",
["da"]="se ",
["de"]="siehe ",
["en"]="see ",
+ ["eo"]="vidu ",
["es"]="ver: ",
["et"]="vaadake ",
- ["fi"]="",
+ ["fa"]="نگاه کنید به ",
+ ["fi"]="Katso",
["fr"]="cf. ",
["gr"]="",
["hr"]="vidi ",
["hu"]="lásd ",
+ ["hy"]="Õ†Õ¡ÕµÕ¥Õ¬ ",
["it"]="cf. ",
["kr"]="",
["la"]="",
@@ -2710,7 +3131,6 @@ data.labels={
["nb"]="se ",
["nl"]="zie ",
["nn"]="sjå ",
- ["pe"]="نگاه کنید به ",
["pl"]="patrz ",
["pt"]="",
["ro"]="",
@@ -2740,13 +3160,16 @@ data.labels={
["da"]="september",
["de"]="September",
["en"]="September",
+ ["eo"]="Septembro",
["es"]="septiembre",
["et"]="september",
+ ["fa"]="سپتامبر",
["fi"]="syyskuu",
["fr"]="septembre",
["gr"]="ΣεπτέμβÏιος",
["hr"]="rujna",
["hu"]="szeptember",
+ ["hy"]="ÕÕ¥ÕºÕ¿Õ¥Õ´Õ¢Õ¥Ö€",
["it"]="settembre",
["ja"]="9",
["kr"]="9",
@@ -2756,7 +3179,6 @@ data.labels={
["nb"]="september",
["nl"]="september",
["nn"]="september",
- ["pe"]="سپتامبر",
["pl"]="września",
["pt"]="setembro",
["ro"]="septembrie",
@@ -2775,24 +3197,29 @@ data.labels={
["september:jalali"]={
["labels"]={
["en"]="Azar",
+ ["es"]="Azar",
["fa"]="آذر",
+ ["hy"]="Ô±Õ¦Õ¡Ö€",
},
},
["september:mnem"]={
["labels"]={
["af"]="",
- ["ca"]="",
+ ["bg"]="Ñепт.",
+ ["ca"]="set",
["cs"]="září",
["da"]="",
["de"]="Sep.",
["en"]="sep",
+ ["eo"]="Sep.",
["es"]="sep.",
["et"]="sept",
["fi"]="",
- ["fr"]="",
+ ["fr"]="sept.",
["gr"]="",
["hr"]="ruj",
["hu"]="szep.",
+ ["hy"]="ÕÕ¥Õº",
["it"]="",
["la"]="",
["lt"]="sep",
@@ -2825,15 +3252,18 @@ data.labels={
["cn"]="",
["cs"]="Podsekce ",
["da"]="",
- ["de"]="",
- ["en"]="",
+ ["de"]="Unterabschnitt ",
+ ["en"]="Subsection",
+ ["eo"]="Subsekcio ",
["es"]="Subsección ",
["et"]="alajaotis ",
- ["fi"]="",
+ ["fa"]="زیربخش ",
+ ["fi"]="Alajakso",
["fr"]="Soussection ",
["gr"]="Υπόενότητα",
["hr"]="Pododjeljak ",
["hu"]="Alfejezet ",
+ ["hy"]=" ÔµÕ¶Õ©Õ¡Õ¢Õ¡ÕªÕ«Õ¶ ",
["it"]="",
["ja"]="",
["la"]="",
@@ -2842,7 +3272,6 @@ data.labels={
["nb"]="",
["nl"]="",
["nn"]="",
- ["pe"]="زیربخش ",
["pl"]="Podpodrozdział ",
["pt"]="",
["ro"]="",
@@ -2868,15 +3297,18 @@ data.labels={
["cn"]="",
["cs"]="Podpodsekce ",
["da"]="",
- ["de"]="",
- ["en"]="",
+ ["de"]="Unterunterabschnitt ",
+ ["en"]="Subsubsection",
+ ["eo"]="Subsubsekcio ",
["es"]="Subsubsección ",
["et"]="alamjaotis ",
- ["fi"]="",
+ ["fa"]="زیرزیربخش ",
+ ["fi"]="Alakohta",
["fr"]="Soussoussection ",
["gr"]="",
["hr"]="Podpododjeljak ",
["hu"]="Al-alfejezet ",
+ ["hy"]="ÔµÕ¶Õ©Õ¡Õ¥Õ¶Õ©Õ¡Õ¢Õ¡ÕªÕ«Õ¶ ",
["it"]="",
["ja"]="",
["la"]="",
@@ -2885,7 +3317,6 @@ data.labels={
["nb"]="",
["nl"]="",
["nn"]="",
- ["pe"]="زیرزیربخش ",
["pl"]="",
["pt"]="",
["ro"]="",
@@ -2911,15 +3342,18 @@ data.labels={
["cn"]="",
["cs"]="Podpodpodsekce ",
["da"]="",
- ["de"]="",
- ["en"]="",
+ ["de"]="Unterunterunterabschnitt",
+ ["en"]="Subsubsubsection",
+ ["eo"]="Subsubsubsekcio ",
["es"]="Subsubsubsección ",
["et"]="",
- ["fi"]="",
+ ["fa"]="زیرزیرزیربخش ",
+ ["fi"]="Ala-alakohta",
["fr"]="Soussoussoussection ",
["gr"]="",
["hr"]="Podpodpododjeljak ",
["hu"]="Al-al-alfejezet ",
+ ["hy"]="ÔµÕ¶Õ©Õ¡Õ¥Õ¶Õ©Õ¡Õ¥Õ¶Õ©Õ¡Õ¢Õ¡ÕªÕ«Õ¶ ",
["it"]="",
["ja"]="",
["la"]="",
@@ -2928,7 +3362,6 @@ data.labels={
["nb"]="",
["nl"]="",
["nn"]="",
- ["pe"]="زیرزیرزیربخش ",
["pl"]="",
["pt"]="",
["ro"]="",
@@ -2956,13 +3389,16 @@ data.labels={
["da"]="søndag",
["de"]="Sonntag",
["en"]="Sunday",
+ ["eo"]="dimanĉo",
["es"]="domingo",
["et"]="pühapäev",
+ ["fa"]="یکشنبه",
["fi"]="sunnuntai",
["fr"]="dimanche",
["gr"]="ΚυÏιακή",
["hr"]="nedjelja",
["hu"]="vasárnap",
+ ["hy"]="Õ¯Õ«Ö€Õ¡Õ¯Õ«",
["it"]="domenica",
["ja"]="日曜日",
["kr"]="ì¼ìš”ì¼",
@@ -2972,7 +3408,6 @@ data.labels={
["nb"]="søndag",
["nl"]="zondag",
["nn"]="sundag",
- ["pe"]="یکشنبه",
["pl"]="niedziela",
["pt"]="domingo",
["ro"]="duminică",
@@ -2990,10 +3425,18 @@ data.labels={
},
["sunday:mnem"]={
["labels"]={
+ ["bg"]="нд",
+ ["ca"]="dg",
+ ["cs"]="ne",
["de"]="So.",
["en"]="sun",
- ["sr"]="нед.",
- ["sr-latn"]="ned.",
+ ["eo"]="dim.",
+ ["es"]="do",
+ ["fr"]="dim.",
+ ["hy"]="Ô¿Õ«Ö€",
+ ["sk"]="ne",
+ ["sr"]="нед",
+ ["sr-latn"]="ned",
},
},
["table"]={
@@ -3008,13 +3451,16 @@ data.labels={
["da"]="Tabel ",
["de"]="Tabelle ",
["en"]="Table ",
+ ["eo"]="Tabelo ",
["es"]="Tabla ",
["et"]="Tabel ",
+ ["fa"]="جدول ",
["fi"]="Taulukko ",
["fr"]="Tableau ",
["gr"]="Πίνακας",
["hr"]="Tablica ",
["hu"]={ "", " táblázat" },
+ ["hy"]="Ô±Õ²ÕµÕ¸Ö‚Õ½Õ¡Õ¯ ",
["it"]="Tabella ",
["ja"]="表",
["kr"]="표 ",
@@ -3024,7 +3470,6 @@ data.labels={
["nb"]="Tabell ",
["nl"]="Tabel ",
["nn"]="Tabell ",
- ["pe"]="جدول ",
["pl"]="Tabela ",
["pt"]="Tabela ",
["ro"]="Tabelul ",
@@ -3052,13 +3497,16 @@ data.labels={
["da"]="torsdag",
["de"]="Donnerstag",
["en"]="Thursday",
+ ["eo"]="ĵaŭdo",
["es"]="jueves",
["et"]="neljapäev",
+ ["fa"]="پنج‌شنبه",
["fi"]="torstai",
["fr"]="jeudi",
["gr"]="Πέμπτη",
["hr"]="Äetvrtak",
["hu"]="csütörtök",
+ ["hy"]="Õ°Õ«Õ¶Õ£Õ·Õ¡Õ¢Õ©Õ«",
["it"]="giovedì",
["ja"]="木曜日",
["kr"]="목요ì¼",
@@ -3068,7 +3516,6 @@ data.labels={
["nb"]="torsdag",
["nl"]="donderdag",
["nn"]="torsdag",
- ["pe"]="پنج‌شنبه",
["pl"]="czwartek",
["pt"]="quinta-feira",
["ro"]="joi",
@@ -3086,10 +3533,19 @@ data.labels={
},
["thursday:mnem"]={
["labels"]={
+ ["bg"]="чт",
+ ["ca"]="dj",
+ ["cs"]="Ät",
["de"]="Do.",
["en"]="thu",
- ["sr"]="чет.",
- ["sr-latn"]="Äet.",
+ ["eo"]="ĵaŭ.",
+ ["es"]="ju",
+ ["fi"]="To",
+ ["fr"]="jeu.",
+ ["hy"]="Õ€Õ¶Õ£",
+ ["sk"]="Å¡t",
+ ["sr"]="чет",
+ ["sr-latn"]="Äet",
},
},
["tuesday"]={
@@ -3104,13 +3560,16 @@ data.labels={
["da"]="tirsdag",
["de"]="Dienstag",
["en"]="Tuesday",
+ ["eo"]="mardo",
["es"]="martes",
["et"]="teisipäev",
+ ["fa"]="سه‌شنبه",
["fi"]="tiistai",
["fr"]="mardi",
["gr"]="ΤÏίτη",
["hr"]="utorak",
["hu"]="kedd",
+ ["hy"]="Õ¥Ö€Õ¥Ö„Õ·Õ¡Õ¢Õ©Õ«",
["it"]="martedì",
["ja"]="ç«æ›œæ—¥",
["kr"]="화요ì¼",
@@ -3120,7 +3579,6 @@ data.labels={
["nb"]="tirsdag",
["nl"]="dinsdag",
["nn"]="tysdag",
- ["pe"]="سه‌شنبه",
["pl"]="wtorek",
["pt"]="terça-feira",
["ro"]="marți",
@@ -3138,10 +3596,19 @@ data.labels={
},
["tuesday:mnem"]={
["labels"]={
+ ["bg"]="вт",
+ ["ca"]="dm",
+ ["cs"]="út",
["de"]="Di.",
["en"]="tue",
- ["sr"]="уто.",
- ["sr-latn"]="uto.",
+ ["eo"]="mar.",
+ ["es"]="ma",
+ ["fi"]="Ti",
+ ["fr"]="mar.",
+ ["hy"]="ÔµÖ€Ö„",
+ ["sk"]="út",
+ ["sr"]="уто",
+ ["sr-latn"]="uto",
},
},
["wednesday"]={
@@ -3156,13 +3623,16 @@ data.labels={
["da"]="onsdag",
["de"]="Mittwoch",
["en"]="Wednesday",
+ ["eo"]="merkredo",
["es"]="miércoles",
["et"]="kolmapäev",
+ ["fa"]="چهارشنبه",
["fi"]="keskiviikko",
["fr"]="mercredi",
["gr"]="ΤετάÏτη",
["hr"]="srijeda",
["hu"]="szerda",
+ ["hy"]="Õ¹Õ¸Ö€Õ¥Ö„Õ·Õ¡Õ¢Õ©Õ«",
["it"]="mercoledì",
["ja"]="水曜日",
["kr"]="수요ì¼",
@@ -3172,7 +3642,6 @@ data.labels={
["nb"]="onsdag",
["nl"]="woensdag",
["nn"]="onsdag",
- ["pe"]="چهارشنبه",
["pl"]="środa",
["pt"]="quarta-feira",
["ro"]="miercuri",
@@ -3190,21 +3659,37 @@ data.labels={
},
["wednesday:mnem"]={
["labels"]={
+ ["bg"]="ÑÑ€",
+ ["ca"]="dim",
+ ["cs"]="st",
["de"]="Mi.",
["en"]="wed",
- ["sr"]="Ñре.",
- ["sr-latn"]="sre.",
+ ["eo"]="mer.",
+ ["es"]="mi",
+ ["fi"]="Ke",
+ ["fr"]="mer.",
+ ["hy"]="Õ¹Õ¸Ö€",
+ ["sk"]="st",
+ ["sr"]="Ñре",
+ ["sr-latn"]="sre",
},
},
["year"]={
["labels"]={
["bg"]="година",
+ ["ca"]="any",
+ ["de"]="Jahr",
["en"]="year",
+ ["eo"]="jaro",
+ ["es"]="año",
["et"]="aasta",
+ ["fa"]="سال",
+ ["fi"]="Vuosi",
+ ["fr"]="année",
+ ["hy"]="ÕÕ¡Ö€Õ«",
["kr"]="ë…„",
["mk"]="година",
["nl"]="jaar",
- ["pe"]="سال",
["sr"]="година",
["sr-latn"]="godina",
},
@@ -3223,13 +3708,16 @@ data.labels={
["da"]="Forkortelser",
["de"]="Abkürzungen",
["en"]="Abbreviations",
+ ["eo"]="Mallongigoj",
["es"]="Abreviaturas",
["et"]="Lühend",
+ ["fa"]="نشانه‌های اختصاری",
["fi"]="Lyhennyksi",
["fr"]="Abréviations",
["gr"]="ΣυντομογÏαφίες",
["hr"]="Kratice",
["hu"]="Rövidítések",
+ ["hy"]="Õ€Õ¡ÕºÕ¡Õ¾Õ¸Ö‚Õ´Õ¶Õ¥Ö€",
["it"]="Abbreviazioni",
["ja"]="略語",
["kr"]="약어",
@@ -3239,7 +3727,6 @@ data.labels={
["nb"]="Forkortelser",
["nl"]="Afkortingen",
["nn"]="Forkortingar",
- ["pe"]="نشانه‌های اختصاری",
["pl"]="Wykaz skrótów",
["pt"]="Abreviaturas",
["ro"]="Abrevieri",
@@ -3267,13 +3754,16 @@ data.labels={
["da"]="Indhold",
["de"]="Inhalt",
["en"]="Contents",
+ ["eo"]="Enhavo",
["es"]="Contenido",
["et"]="Sisu",
+ ["fa"]="Ùهرست مطالب",
["fi"]="Sisällys",
["fr"]="Table des matières",
["gr"]="ΠεÏιεχόμενα",
["hr"]="Sadržaj",
["hu"]="Tartalom",
+ ["hy"]="Ô²Õ¸Õ¾Õ¡Õ¶Õ¤Õ¡Õ¯Õ¸Ö‚Õ©ÕµÕ¸Ö‚Õ¶",
["it"]="Indice",
["ja"]="目次",
["kr"]="목차",
@@ -3283,7 +3773,6 @@ data.labels={
["nb"]="Innhold",
["nl"]="Inhoud",
["nn"]="Innhald",
- ["pe"]="Ùهرست مطالب",
["pl"]="Spis treści",
["pt"]="Conteúdo",
["ro"]="Cuprins",
@@ -3310,13 +3799,16 @@ data.labels={
["da"]="Figurer",
["de"]="Abbildungen",
["en"]="Figures",
+ ["eo"]="Figuroj",
["es"]="Figuras",
["et"]="Arvandmed",
+ ["fa"]="Ùهرست اشکال",
["fi"]="Kuvi",
["fr"]="Figures",
["gr"]="Σχήματα",
["hr"]="Slike",
["hu"]="Ãbrák",
+ ["hy"]="Õ†Õ¯Õ¡Ö€Õ¡Õ¦Õ¡Ö€Õ¤Õ¸Ö‚Õ´Õ¶Õ¥Ö€",
["it"]="Figure",
["ja"]="図",
["kr"]="그림 ",
@@ -3326,7 +3818,6 @@ data.labels={
["nb"]="Figurer",
["nl"]="Figuren",
["nn"]="Figurar",
- ["pe"]="Ùهرست اشکال",
["pl"]="Ilustracje",
["pt"]="Figuras",
["ro"]="Figuri",
@@ -3347,19 +3838,23 @@ data.labels={
["af"]="Grafieke",
["ar"]="الرسوم",
["be"]="Графiка",
+ ["bg"]="Графики",
["ca"]="Gràfiques",
["cn"]="图",
["cs"]="Seznam grafů",
["da"]="Grafik",
- ["de"]="Graphiken",
+ ["de"]="Grafiken",
["en"]="Graphics",
+ ["eo"]="Grafikoj",
["es"]="Gráficos",
["et"]="Graafika",
+ ["fa"]="Ùهرست طرح‌ها",
["fi"]="Grafiikkaoi",
["fr"]="Graphiques",
["gr"]="ΓÏαφικά",
["hr"]="Slike",
["hu"]="Grafikák",
+ ["hy"]="Ô³Õ®Õ¡ÕºÕ¡Õ¿Õ¯Õ¥Ö€",
["it"]="Grafici",
["ja"]="グラフ",
["kr"]="그래픽 ",
@@ -3369,7 +3864,6 @@ data.labels={
["nb"]="Bilde",
["nl"]="Grafieken",
["nn"]="Bilete",
- ["pe"]="Ùهرست طرح‌ها",
["pl"]="Grafiki",
["pt"]="Gráficos",
["ro"]="Grafice",
@@ -3397,13 +3891,16 @@ data.labels={
["da"]="Indeks",
["de"]="Index",
["en"]="Index",
+ ["eo"]="Indekso",
["es"]="Ãndice",
["et"]="Indeks",
+ ["fa"]="نمایه",
["fi"]="Indeksiluku",
["fr"]="Index",
["gr"]="ΕυÏετήÏιο",
["hr"]="Indeks",
["hu"]="Index",
+ ["hy"]="Ô±ÕµÕ¢Õ¢Õ¥Õ¶Õ¡Õ¯Õ¡Õ¶ ÖÕ¸Ö‚ÖÕ«Õ¹",
["it"]="Indice",
["ja"]="目次",
["kr"]="찾아보기",
@@ -3413,14 +3910,12 @@ data.labels={
["nb"]="Register",
["nl"]="Index",
["nn"]="Register",
- ["pe"]="نمایه",
["pl"]="Indeks",
["pt"]="Ãndice",
["ro"]="Index",
["ru"]="Ðлфавитный указатель",
["sk"]="Zoznam",
["sl"]="Stvarno kazalo",
- ["sr"]="ИндекÑ",
["sr"]="Ð˜Ð½Ð´ÐµÐºÑ Ð¿Ð¾Ñ˜Ð¼Ð¾Ð²Ð°",
["sr-latn"]="Indeks pojmova",
["sv"]="Sakregister",
@@ -3435,12 +3930,14 @@ data.labels={
["af"]="Intermezzos",
["ar"]="Ùسح",
["be"]="Ð¡Ð¿Ñ–Ñ ÑƒÑтавак",
+ ["bg"]="Интермеца",
["ca"]="Intermedis",
["cn"]="퉣",
["cs"]="Intermezza",
["da"]="Intermezzoer",
["de"]="Intermezzi",
["en"]="Intermezzos",
+ ["eo"]="Intermezoj",
["es"]="Intermedios",
["et"]="Vahemängud",
["fi"]="Intermezzos",
@@ -3448,6 +3945,7 @@ data.labels={
["gr"]="ΠαÏσεις",
["hr"]="Intermeci",
["hu"]="Intermezzok",
+ ["hy"]="Ô»Õ¶Õ¿Õ¥Ö€Õ¬ÕµÕ¸Ö‚Õ¤Õ¶Õ¥Ö€",
["it"]="Intermezzi",
["ja"]="é–“å¥æ›²",
["kr"]="간주곡",
@@ -3463,7 +3961,6 @@ data.labels={
["ru"]="СпиÑок вÑтавок",
["sk"]="Intermezzá",
["sl"]="Intermezzi",
- ["sr"]="Интермеззи",
["sr"]="СпиÑак дигреÑија",
["sr-latn"]="Spisak digresija",
["sv"]="Intermezzon",
@@ -3485,13 +3982,16 @@ data.labels={
["da"]="Logoer",
["de"]="Logos",
["en"]="Logos",
+ ["eo"]="Markemblemoj",
["es"]="Logotipos",
["et"]="Logos",
+ ["fa"]="Ùهرست لوگوها",
["fi"]="Vertauskuva",
["fr"]="Logos",
["gr"]="Λογότυπα",
["hr"]="Logotipi",
["hu"]="Fejlécek",
+ ["hy"]="Ô¼Õ¸Õ£Õ¸Õ¶Õ¥Ö€",
["it"]="Logotipi",
["ja"]="ç†æ€§",
["kr"]="ì´ì„±",
@@ -3501,7 +4001,6 @@ data.labels={
["nb"]="Logoer",
["nl"]="Logo's",
["nn"]="Logoar",
- ["pe"]="Ùهرست لوگوها",
["pl"]="Znaki",
["pt"]="Logotipos",
["ro"]="Logo-uri",
@@ -3525,13 +4024,16 @@ data.labels={
["da"]="",
["de"]="Literatur",
["en"]="References",
+ ["eo"]="Referencoj",
["es"]="Bibliografía",
["et"]="Viited",
- ["fi"]="",
+ ["fa"]="کتاب‌نامه",
+ ["fi"]="Viittet",
["fr"]="Bibliographie",
["gr"]="",
["hr"]="Literatura",
["hu"]="Bibliográfia",
+ ["hy"]="Ô³Ö€Õ¡Õ¯Õ¡Õ¶Õ¸Ö‚Õ©Õ«Ö‚Õ¶",
["it"]="Bibliografia",
["kr"]="참고문헌",
["la"]="",
@@ -3540,7 +4042,6 @@ data.labels={
["nb"]="",
["nl"]="Literatuur",
["nn"]="",
- ["pe"]="کتاب‌نامه",
["pl"]="Bibliografia",
["pt"]="",
["ro"]="",
@@ -3567,13 +4068,16 @@ data.labels={
["da"]="Tabeller",
["de"]="Tabellen",
["en"]="Tables",
+ ["eo"]="Tabeloj",
["es"]="Tablas",
["et"]="Tabelid",
+ ["fa"]="Ùهرست جداول",
["fi"]="Taulukkoj",
["fr"]="Tableaux",
["gr"]="Πίνακες",
["hr"]="Tablice",
["hu"]="Táblázatok",
+ ["hy"]="Ô±Õ²ÕµÕ¸Ö‚Õ½Õ¡Õ¯Õ¶Õ¥Ö€",
["it"]="Tabelle",
["ja"]="机",
["kr"]="표 ",
@@ -3583,7 +4087,6 @@ data.labels={
["nb"]="Tabeller",
["nl"]="Tabellen",
["nn"]="Tabellar",
- ["pe"]="Ùهرست جداول",
["pl"]="Tabele",
["pt"]="Tabelas",
["ro"]="Tabele",
@@ -3611,13 +4114,16 @@ data.labels={
["da"]="Enheder",
["de"]="Einheiten",
["en"]="Units",
+ ["eo"]="Unuoj",
["es"]="Unidades",
["et"]="Ãœhikud",
+ ["fa"]="واحدها",
["fi"]="Yksiköt",
["fr"]="Unités",
["gr"]="Μονάδες",
["hr"]="Jedinice",
["hu"]="Mértékegységek",
+ ["hy"]="Õ‰Õ¡ÖƒÕ´Õ¡Õ¶ Õ´Õ«Õ¡Õ¾Õ¸Ö€Õ¶Õ¥Ö€",
["it"]="Unità",
["ja"]="ユニッツ",
["kr"]="측정단위",
@@ -3627,7 +4133,6 @@ data.labels={
["nb"]="Enheter",
["nl"]="Eenheden",
["nn"]="Einingar",
- ["pe"]="واحدها",
["pl"]="Jednostki",
["pt"]="Unidades",
["ro"]="Unități",
@@ -3658,3 +4163,4 @@ functions.atanh = functions.arctanh
functions.tg = functions.tan
functions.arctg = functions.arctan
functions.arctgh = functions.arctanh
+
diff --git a/Master/texmf-dist/tex/context/base/mkiv/libs-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/libs-ini.lua
index 5b8390df2a1..cf696f4e9ea 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/libs-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/libs-ini.lua
@@ -17,7 +17,6 @@ local find = string.find
-- here we implement the resolver
-
local nameonly = file.nameonly
local joinfile = file.join
local addsuffix = file.addsuffix
@@ -54,10 +53,10 @@ local function findlib(required) -- todo: cache
for i=1,#list do
local name = list[i]
local found = findfile(name,"lib")
- if not found then
+ if not found or found == "" then
found = findfile(addsuffix(name,suffix),"lib")
end
- if found then
+ if found and found ~= "" then
if trace then
report("library %a resolved via %a path to %a",name,"tds lib",found)
end
@@ -70,9 +69,9 @@ local function findlib(required) -- todo: cache
for i=1,#list do
local full = joinfile(list[i],base)
local found = isfile(full) and full
- if found then
+ if found and found ~= "" then
if trace then
- report("library %a resolved via %a path to %a",name,"system",found)
+ report("library %a resolved via %a path to %a",full,"system",found)
end
return found
end
@@ -137,7 +136,7 @@ function libraries.optionalloaded(name,libnames)
for i=1,#libnames do
local libname = libnames[i]
local filename = foundlibraries[libname]
- if filename then
+ if filename and filename ~= "" then
libnames[i] = filename
else
report("unable to locate library %a",libname)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-ano.lua b/Master/texmf-dist/tex/context/base/mkiv/lpdf-ano.lua
index a120ff2f4ee..2bc485ff1f6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-ano.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-ano.lua
@@ -108,6 +108,10 @@ local pdf_named = pdfconstant("Named")
local autoprefix = "#"
local usedautoprefixes = { }
+function codeinjections.setautoprefix(prefix)
+ autoprefix = prefix ~= "" and prefix or autoprefix
+end
+
local function registerautoprefix(name)
local internal = autoprefix .. name
if usedautoprefixes[internal] == nil then
@@ -1215,24 +1219,24 @@ local pdf_stop = pdfconstant("Stop")
local pdf_resume = pdfconstant("Resume")
local pdf_pause = pdfconstant("Pause")
-local function movie_or_sound(operation,arguments)
+local function movie_or_sound(operation,what,arguments)
arguments = (type(arguments) == "table" and arguments) or settings_to_array(arguments)
return pdfdictionary {
S = pdf_movie,
- T = format("movie %s",arguments[1] or "noname"),
+ T = format("%s %s",what,arguments[1] or "noname"),
Operation = operation,
}
end
-function executers.startmovie (arguments) return movie_or_sound(pdf_start ,arguments) end
-function executers.stopmovie (arguments) return movie_or_sound(pdf_stop ,arguments) end
-function executers.resumemovie(arguments) return movie_or_sound(pdf_resume,arguments) end
-function executers.pausemovie (arguments) return movie_or_sound(pdf_pause ,arguments) end
+function executers.startmovie (arguments) return movie_or_sound(pdf_start ,"movie",arguments) end
+function executers.stopmovie (arguments) return movie_or_sound(pdf_stop ,"movie",arguments) end
+function executers.resumemovie(arguments) return movie_or_sound(pdf_resume,"movie",arguments) end
+function executers.pausemovie (arguments) return movie_or_sound(pdf_pause ,"movie",arguments) end
-function executers.startsound (arguments) return movie_or_sound(pdf_start ,arguments) end
-function executers.stopsound (arguments) return movie_or_sound(pdf_stop ,arguments) end
-function executers.resumesound(arguments) return movie_or_sound(pdf_resume,arguments) end
-function executers.pausesound (arguments) return movie_or_sound(pdf_pause ,arguments) end
+function executers.startsound (arguments) return movie_or_sound(pdf_start ,"sound",arguments) end
+function executers.stopsound (arguments) return movie_or_sound(pdf_stop ,"sound",arguments) end
+function executers.resumesound(arguments) return movie_or_sound(pdf_resume,"sound",arguments) end
+function executers.pausesound (arguments) return movie_or_sound(pdf_pause ,"sound",arguments) end
function specials.action(var)
local operation = var.operation
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-fld.lua b/Master/texmf-dist/tex/context/base/mkiv/lpdf-fld.lua
index e14968eb8ad..50720c84ad2 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-fld.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-fld.lua
@@ -97,7 +97,7 @@ local pdfcolor = lpdf.color
local pdfcolorvalues = lpdf.colorvalues
local pdflayerreference = lpdf.layerreference
-local hpack_node = node.hpack
+local hpack_node = nodes.hpack
local submitoutputformat = 0 -- 0=unknown 1=HTML 2=FDF 3=XML => not yet used, needs to be checked
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/lpdf-ini.lua
index 1098ef8fa38..07e9c8df82b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-ini.lua
@@ -1410,7 +1410,8 @@ do
return timestamp
end
- lpdf.settime(tonumber(resolvers.variable("start_time")) or tonumber(resolvers.variable("SOURCE_DATE_EPOCH"))) -- bah
+ -- lpdf.settime(tonumber(resolvers.variable("starttime")) or tonumber(resolvers.variable("SOURCE_DATE_EPOCH"))) -- bah
+ lpdf.settime(tonumber(resolvers.variable("starttime")))
function lpdf.pdftimestamp(str)
local t = type(str)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-mov.lua b/Master/texmf-dist/tex/context/base/mkiv/lpdf-mov.lua
index 42ba6fb008f..0f0eefd2f44 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-mov.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-mov.lua
@@ -16,7 +16,9 @@ local pdfconstant = lpdf.constant
local pdfdictionary = lpdf.dictionary
local pdfarray = lpdf.array
local pdfborder = lpdf.border
-local write_node = node.write
+
+-- We should actually make sure that inclusion only happens once. But this mechanism
+-- is dropped in pdf anyway so it will go away (read: mapped onto the newer mechanisms).
function nodeinjections.insertmovie(specification)
-- managed in figure inclusion: width, height, factor, repeat, controls, preview, label, foundname
@@ -24,7 +26,7 @@ function nodeinjections.insertmovie(specification)
local height = specification.height
local factor = specification.factor or number.dimenfactors.bp
local moviedict = pdfdictionary {
- F = specification.foundname,
+ F = specification.foundname or specification.file,
Aspect = pdfarray { factor * width, factor * height },
Poster = (specification.preview and true) or false,
}
@@ -37,32 +39,31 @@ function nodeinjections.insertmovie(specification)
Subtype = pdfconstant("Movie"),
Border = bs,
C = bc,
- T = format("movie %s",specification.label),
+ T = format("movie %s",specification.tag or specification.label),
Movie = moviedict,
A = controldict,
}
- write_node(nodeinjections.annotation(width,height,0,action())) -- test: context(...)
+ context(nodeinjections.annotation(width,height,0,action())) -- test: context(...)
end
function nodeinjections.insertsound(specification)
- -- managed in interaction: repeat, label, foundname
- local soundclip = interactions.soundclips.soundclip(specification.label)
- if soundclip then
- local controldict = pdfdictionary {
- Mode = (specification["repeat"] and pdfconstant("Repeat")) or nil
- }
- local sounddict = pdfdictionary {
- F = soundclip.filename
- }
- local bs, bc = pdfborder()
- local action = pdfdictionary {
- Subtype = pdfconstant("Movie"),
- Border = bs,
- C = bc,
- T = format("sound %s",specification.label),
- Movie = sounddict,
- A = controldict,
+ local controldict = nil
+ if specification["repeat"] then
+ controldict = pdfdictionary {
+ Mode = pdfconstant("Repeat")
}
- write_node(nodeinjections.annotation(0,0,0,action())) -- test: context(...)
end
+ local sounddict = pdfdictionary {
+ F = specification.foundname or specification.file
+ }
+ local bs, bc = pdfborder()
+ local action = pdfdictionary {
+ Subtype = pdfconstant("Movie"),
+ Border = bs,
+ C = bc,
+ T = format("sound %s",specification.tag or specification.label),
+ Movie = sounddict,
+ A = controldict,
+ }
+ context(nodeinjections.annotation(0,0,0,action())) -- test: context(...)
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-nod.lua b/Master/texmf-dist/tex/context/base/mkiv/lpdf-nod.lua
index fcb2d145732..6702ed506b9 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-nod.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-nod.lua
@@ -24,10 +24,11 @@ local register = nodepool.register
local whatsit_code = nodecodes.whatsit
-local savewhatsit_code = whatsitcodes.save
-local restorewhatsit_code = whatsitcodes.restore
-local setmatrixwhatsit_code = whatsitcodes.setmatrix
-local literalwhatsit_code = whatsitcodes.literal
+local savewhatsit_code = whatsitcodes.save
+local restorewhatsit_code = whatsitcodes.restore
+local setmatrixwhatsit_code = whatsitcodes.setmatrix
+local literalwhatsit_code = whatsitcodes.literal
+local lateliteralwhatsit_code = whatsitcodes.lateliteral
local literalvalues = nodes.literalvalues
local originliteral_code = literalvalues.origin
@@ -66,6 +67,22 @@ function nodepool.literal(mode,str)
end
end
+-- We only define this for testing as we don't need it:
+
+local lateliteralnode = register(new_node(whatsit_code, lateliteralwhatsit_code))
+
+function nodepool.lateliteral(mode,str)
+ local t = copy_node(lateliteralnode)
+ if str then
+ setfield(t,"mode",literals[mode] and mode or pageliteral_code)
+ setdata(t,str)
+ else
+ setfield(t,"mode",pageliteral_code)
+ setdata(t,mode)
+ end
+ return t
+end
+
local savenode = register(new_node(whatsit_code, savewhatsit_code))
local restorenode = register(new_node(whatsit_code, restorewhatsit_code))
local setmatrixnode = register(new_node(whatsit_code, setmatrixwhatsit_code))
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-pda.xml b/Master/texmf-dist/tex/context/base/mkiv/lpdf-pda.xml
index 2f07fed2def..0de54aa2aae 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-pda.xml
+++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-pda.xml
@@ -7,21 +7,9 @@
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:format>application/pdf</dc:format>
- <dc:creator>
- <rdf:Seq>
- <rdf:li xml:lang="x-default"/>
- </rdf:Seq>
- </dc:creator>
- <dc:description>
- <rdf:Alt>
- <rdf:li xml:lang="x-default"/>
- </rdf:Alt>
- </dc:description>
- <dc:title>
- <rdf:Alt>
- <rdf:li xml:lang="x-default"/>
- </rdf:Alt>
- </dc:title>
+ <dc:creator/>
+ <dc:description/>
+ <dc:title/>
</rdf:Description>
<rdf:Description rdf:about="" xmlns:pdfx="http://ns.adobe.com/pdfx/1.3/">
<pdfx:ID/>
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-pdx.xml b/Master/texmf-dist/tex/context/base/mkiv/lpdf-pdx.xml
index 35726a5c051..45349b4d8fc 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-pdx.xml
+++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-pdx.xml
@@ -2,26 +2,19 @@
<!-- lpdf-pdx.xml -->
+<!--
+ There was a bug in the iso standard so now we just flush them flat because for some
+ reason there is no upward compatibulity. It's a sort of useless mess anyway.
+-->
+
<x:xmpmeta xmlns:x="adobe:ns:meta/">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:format>application/pdf</dc:format>
- <dc:creator>
- <rdf:Seq>
- <rdf:li xml:lang="x-default"/>
- </rdf:Seq>
- </dc:creator>
- <dc:description>
- <rdf:Alt>
- <rdf:li xml:lang="x-default"/>
- </rdf:Alt>
- </dc:description>
- <dc:title>
- <rdf:Alt>
- <rdf:li xml:lang="x-default"/>
- </rdf:Alt>
- </dc:title>
- </rdf:Description>
+ <dc:creator/>
+ <dc:description/>
+ <dc:title/>
+ </rdf:Description>
<rdf:Description rdf:about="" xmlns:pdfx="http://ns.adobe.com/pdfx/1.3/">
<pdfx:ID/>
<pdfx:ConTeXt.Jobname/>
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-pua.xml b/Master/texmf-dist/tex/context/base/mkiv/lpdf-pua.xml
index f717762b6e6..091a3d40092 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-pua.xml
+++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-pua.xml
@@ -2,25 +2,24 @@
<!-- lpdf-pua.xml -->
+<!--
+ There was a bug in the ISO standard so now we just flush them flat because for some
+ reason there is no upward compatibulity. It's a sort of useless mess anyway.
+-->
+
+<!--
+ <dc:creator> <rdf:Seq><rdf:li xml:lang="x-default"/></rdf:Seq></dc:creator>
+ <dc:description><rdf:Alt><rdf:li xml:lang="x-default"/></rdf:Alt></dc:description>
+ <dc:title> <rdf:Alt><rdf:li xml:lang="x-default"/></rdf:Alt></dc:title>
+-->
+
<x:xmpmeta xmlns:x="adobe:ns:meta/">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:format>application/pdf</dc:format>
- <dc:creator>
- <rdf:Seq>
- <rdf:li xml:lang="x-default"/>
- </rdf:Seq>
- </dc:creator>
- <dc:description>
- <rdf:Alt>
- <rdf:li xml:lang="x-default"/>
- </rdf:Alt>
- </dc:description>
- <dc:title>
- <rdf:Alt>
- <rdf:li xml:lang="x-default"/>
- </rdf:Alt>
- </dc:title>
+ <dc:creator/>
+ <dc:description/>
+ <dc:title/>
</rdf:Description>
<rdf:Description rdf:about="" xmlns:pdfx="http://ns.adobe.com/pdfx/1.3/">
<pdfx:ID/>
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-wid.lua b/Master/texmf-dist/tex/context/base/mkiv/lpdf-wid.lua
index 106eb98cca3..e856ddaf4f6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-wid.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-wid.lua
@@ -23,6 +23,9 @@ if not modules then modules = { } end modules ['lpdf-wid'] = {
-- the other fragile bit. And, now that adobe quits flash in 2020 we're without any
-- video anyway. Also, it won't play on all platforms and devices so let's wait for
-- html5 media in pdf then.
+--
+-- See mail by Michal Vlasák to the mailing list that discusses current support in
+-- viewers and also mentions (and submitted) a few fixes wrt embedding media.
local tonumber, next = tonumber, next
local gmatch, gsub, find, lower = string.gmatch, string.gsub, string.find, string.lower
@@ -43,6 +46,8 @@ local context = context
local texgetcount = tex.getcount
+local hpacknode = nodes.hpack
+
local nodeinjections = backends.pdf.nodeinjections
local codeinjections = backends.pdf.codeinjections
local registrations = backends.pdf.registrations
@@ -55,6 +60,7 @@ local v_auto = variables.auto
local v_embed = variables.embed
local v_max = variables.max
local v_yes = variables.yes
+local v_compress = variables.compress
local pdfconstant = lpdf.constant
local pdfnull = lpdf.null
@@ -64,20 +70,18 @@ local pdfreference = lpdf.reference
local pdfunicode = lpdf.unicode
local pdfstring = lpdf.string
local pdfboolean = lpdf.boolean
-local pdfflushobject = lpdf.flushobject
-local pdfflushstreamobject = lpdf.flushstreamobject
-local pdfflushstreamfileobject = lpdf.flushstreamfileobject
-local pdfreserveobject = lpdf.reserveobject
-local pdfpagereference = lpdf.pagereference
-local pdfshareobjectreference = lpdf.shareobjectreference
local pdfaction = lpdf.action
local pdfborder = lpdf.border
local pdftransparencyvalue = lpdf.transparencyvalue
local pdfcolorvalues = lpdf.colorvalues
-local hpack_node = node.hpack
-local write_node = node.write -- test context(...) instead
+local pdfflushobject = lpdf.flushobject
+local pdfflushstreamobject = lpdf.flushstreamobject
+local pdfflushstreamfileobject = lpdf.flushstreamfileobject
+local pdfreserveobject = lpdf.reserveobject
+local pdfpagereference = lpdf.pagereference
+local pdfshareobjectreference = lpdf.shareobjectreference
-- symbols
@@ -256,7 +260,7 @@ local function flushembeddedfiles()
for tag, reference in sortedhash(filestreams) do
if not reference then
report_attachment("unreferenced file, tag %a",tag)
- elseif referenced[tag] == "hidden" then
+ elseif referenced[tag] == "hidden" or referenced[tag] == "forced" then
e[#e+1] = pdfstring(tag)
e[#e+1] = reference -- already a reference
f[#f+1] = reference -- collect all file description references
@@ -366,6 +370,9 @@ function codeinjections.embedfile(specification)
}
local r = pdfreference(pdfflushobject(d))
filestreams[hash] = r
+ if specification.forcereference == true then
+ referenced[hash] = "forced"
+ end
return r
end
end
@@ -453,7 +460,7 @@ function nodeinjections.attachfile(specification)
local width = specification.width or 0
local height = specification.height or 0
local depth = specification.depth or 0
- local box = hpack_node(nodeinjections.annotation(width,height,depth,d()))
+ local box = hpacknode(nodeinjections.annotation(width,height,depth,d()))
box.width = width
box.height = height
box.depth = depth
@@ -554,12 +561,12 @@ function nodeinjections.comment(specification) -- brrr: seems to be done twice
Parent = pdfreference(nd),
}
d.Popup = pdfreference(nc)
- box = hpack_node(
+ box = hpacknode(
nodeinjections.annotation(0,0,0,d(),nd),
nodeinjections.annotation(width,height,depth,c(),nc)
)
else
- box = hpack_node(nodeinjections.annotation(width,height,depth,d()))
+ box = hpacknode(nodeinjections.annotation(width,height,depth,d()))
end
box.width = width -- redundant
box.height = height -- redundant
@@ -643,23 +650,21 @@ local function insertrenderingwindow(specification)
Subtype = pdfconstant("Screen"),
P = pdfreference(pdfpagereference(page)),
A = a, -- needed in order to make the annotation clickable (i.e. don't bark)
+ T = pdfunicode(label), -- for JS
Border = bs,
C = bc,
AA = actions,
}
local width = specification.width or 0
local height = specification.height or 0
- if height == 0 or width == 0 then
- -- todo: sound needs no window
- end
- write_node(nodeinjections.annotation(width,height,0,d(),r)) -- save ref
+ context(nodeinjections.annotation(width,height,0,d(),r)) -- save ref
return pdfreference(r)
end
-- some dictionaries can have a MH (must honor) or BE (best effort) capsule
local function insertrendering(specification)
- local label = specification.label
+ local label = specification.label
local option = settings_to_hash(specification.option)
if not mf[label] then
local filename = specification.filename
@@ -689,21 +694,23 @@ local function insertrendering(specification)
-- B = start,
-- }
-- }
- -- local parameters = pdfdictionary {
- -- Type = pdfconstant(MediaPermissions),
- -- TF = pdfstring("TEMPALWAYS") }, -- TEMPNEVER TEMPEXTRACT TEMPACCESS TEMPALWAYS
- -- }
+ local parameters = pdfdictionary {
+ Type = pdfconstant("MediaPermissions"),
+ TF = pdfstring("TEMPALWAYS"), -- TEMPNEVER TEMPEXTRACT TEMPACCESS TEMPALWAYS / needed for acrobat/wmp
+ }
local descriptor = pdfdictionary {
Type = pdfconstant("Filespec"),
F = filename,
}
if isurl then
descriptor.FS = pdfconstant("URL")
+ descriptor = pdfreference(pdfflushobject(descriptor))
elseif option[v_embed] then
- descriptor.EF = codeinjections.embedfile {
- file = filename,
- mimetype = mimetype, -- yes or no
- compress = false,
+ descriptor = codeinjections.embedfile {
+ file = filename,
+ mimetype = mimetype, -- yes or no
+ compress = option[v_compress] or false,
+ forcereference = true,
}
end
local clip = pdfdictionary {
@@ -712,13 +719,13 @@ local function insertrendering(specification)
N = label,
CT = mimetype,
Alt = pdfarray { "", "file not found" }, -- language id + message
- D = pdfreference(pdfflushobject(descriptor)),
- -- P = pdfreference(pdfflushobject(parameters)),
+ D = descriptor,
+ P = pdfreference(pdfflushobject(parameters)),
}
local rendition = pdfdictionary {
Type = pdfconstant("Rendition"),
S = pdfconstant("MR"),
- N = label,
+ N = pdfunicode(label),
C = pdfreference(pdfflushobject(clip)),
}
mf[label] = pdfreference(pdfflushobject(rendition))
@@ -756,6 +763,21 @@ function codeinjections.processrendering(label)
end
end
+-- needed mapping for access from JS
+
+local function flushrenderings()
+ if next(mf) then
+ local r = pdfarray()
+ for label, reference in sortedhash(mf) do
+ r[#r+1] = pdfunicode(label)
+ r[#r+1] = reference -- already a reference
+ end
+ lpdf.addtonames("Renditions",pdfreference(pdfflushobject(pdfdictionary{ Names = r })))
+ end
+end
+
+lpdf.registerdocumentfinalizer(flushrenderings,"renderings")
+
function codeinjections.insertrenderingwindow(specification)
local label = specification.label
codeinjections.processrendering(label)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-xmp.lua b/Master/texmf-dist/tex/context/base/mkiv/lpdf-xmp.lua
index 508bb19976d..2ca3ab3fea3 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-xmp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-xmp.lua
@@ -59,10 +59,11 @@ local mapping = {
["Producer"] = { "metadata","rdf:Description/pdf:Producer" },
-- ["Trapped"] = { "pdf", "rdf:Description/pdf:Trapped" }, -- '/False' in /Info, but 'False' in XMP
-- Dublin Core schema
- ["Author"] = { "metadata","rdf:Description/dc:creator/rdf:Seq/rdf:li" },
["Format"] = { "metadata","rdf:Description/dc:format" }, -- optional, but nice to have
- ["Subject"] = { "metadata","rdf:Description/dc:description/rdf:Alt/rdf:li" },
- ["Title"] = { "metadata","rdf:Description/dc:title/rdf:Alt/rdf:li" },
+ -- These were dc:.../rdf:Seq/rdf:li but there was a (invalidating) bug in the iso
+ ["Author"] = { "metadata","rdf:Description/dc:creator" },
+ ["Subject"] = { "metadata","rdf:Description/dc:description" },
+ ["Title"] = { "metadata","rdf:Description/dc:title" },
-- XMP Basic schema
["CreateDate"] = { "date", "rdf:Description/xmp:CreateDate" },
["CreationDate"] = { "date", "rdf:Description/xmp:CreationDate" }, -- dummy
diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-cnf.lua b/Master/texmf-dist/tex/context/base/mkiv/luat-cnf.lua
index f1690832125..a67167bb9ff 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/luat-cnf.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/luat-cnf.lua
@@ -24,26 +24,9 @@ texconfig.expand_depth = 10000
texconfig.half_error_line = 125
texconfig.max_print_line = 100000
texconfig.max_strings = 500000
-texconfig.hash_extra = 200000
+texconfig.hash_extra = 250000
texconfig.function_size = 32768
texconfig.properties_size = 10000
-texconfig.level_max = 500
-texconfig.level_chr = 46 -- period
-
-if CONTEXTLMTXMODE > 0 then
-
-texconfig.max_in_open = 2000
-texconfig.nest_size = 10000
-texconfig.param_size = 100000
-texconfig.save_size = 500000
-texconfig.stack_size = 100000
-texconfig.buffer_size = 10000000
-texconfig.token_size = 10000000
-texconfig.node_size = 50000000
-texconfig.max_pool = 10000000
-
-else
-
texconfig.max_in_open = 1000
texconfig.nest_size = 1000
texconfig.param_size = 25000
@@ -52,29 +35,7 @@ texconfig.stack_size = 10000
texconfig.buf_size = 10000000
texconfig.fix_mem_init = 1000000
-end
-
-local variablenames = CONTEXTLMTXMODE > 0 and {
- error_line = false,
- half_error_line = false,
- max_print_line = false,
- max_in_open = false,
- expand_depth = true,
- hash_extra = true,
- nest_size = true,
- max_strings = true,
- max_pool = true,
- param_size = true,
- save_size = true,
- stack_size = true,
- function_size = true,
- properties_size = true,
- token_size = true,
- node_size = true,
- buffer_size = true,
- level_max = true,
- level_chr = true,
-} or {
+local variablenames = {
error_line = false,
half_error_line = false,
max_print_line = false,
@@ -89,8 +50,6 @@ local variablenames = CONTEXTLMTXMODE > 0 and {
function_size = true,
properties_size = true,
fix_mem_init = true,
- level_max = true,
- level_chr = true,
}
local stub = [[
@@ -221,7 +180,7 @@ function texconfig.init()
-- local b = callbytecode(i)
local e, b = pcall(callbytecode,i)
if not e then
- print(string.format("\nfatal error : unable to load bytecode register %%i, maybe wipe the cache first\n",i))
+ print(string.format("fatal error : unable to load bytecode register %%i, maybe wipe the cache first\n",i))
os.exit()
end
if b then
@@ -250,7 +209,7 @@ function texconfig.init()
end
-CONTEXTLMTXMODE = %s
+CONTEXTLMTXMODE = 0
-- we provide a qualified path
@@ -297,9 +256,9 @@ local function makestub()
end
end
t[#t+1] = ""
- t[#t+1] = format(stub,firsttable,tostring(CONTEXTLMTXMODE or 0))
+ t[#t+1] = format(stub,firsttable)
io.savedata(name,concat(t,"\n"))
logs.newline()
end
-lua.registerfinalizer(makestub,"create stub file")
+lua.registerinitexfinalizer(makestub,"create stub file")
diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-cod.lua b/Master/texmf-dist/tex/context/base/mkiv/luat-cod.lua
index b3abecbbab4..6175302a3de 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/luat-cod.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/luat-cod.lua
@@ -33,8 +33,6 @@ texconfig.stack_size = 10000
texconfig.function_size = 32768
texconfig.properties_size = 10000
texconfig.fix_mem_init = 1000000
-texconfig.level_max = 500
-texconfig.level_chr = 46 -- period
-- registering bytecode chunks
@@ -92,28 +90,6 @@ function lua.registercode(filename,options)
end
end
-local finalizers = { }
-
-function lua.registerfinalizer(f,comment)
- comment = comment or "unknown"
- if type(f) == "function" then
- finalizers[#finalizers+1] = { action = f, comment = comment }
- else
- print(format("\nfatal error: invalid finalizer, action: %s\n",comment))
- os.exit()
- end
-end
-
-function lua.finalize(logger)
- for i=1,#finalizers do
- local finalizer = finalizers[i]
- finalizer.action()
- if logger then
- logger("finalize action: %s",finalizer.comment)
- end
- end
-end
-
-- A first start with environments. This will be overloaded later.
environment = environment or { }
@@ -170,6 +146,38 @@ environment.jitsupported = JITSUPPORTED
environment.initex = INITEXMODE
environment.initexmode = INITEXMODE
+if INITEXMODE then
+
+ local finalizers = { }
+
+ function lua.registerinitexfinalizer(f,comment)
+ comment = comment or "unknown"
+ if type(f) == "function" then
+ finalizers[#finalizers+1] = { action = f, comment = comment }
+ else
+ print(format("\nfatal error: invalid finalizer, action: %s\n",comment))
+ os.exit()
+ end
+ end
+
+ function lua.finalizeinitex(logger)
+ for i=1,#finalizers do
+ local finalizer = finalizers[i]
+ finalizer.action()
+ if logger then
+ logger("finalize action: %s",finalizer.comment)
+ end
+ end
+ end
+
+else
+
+ function lua.registerinitexfinalizer() end
+ function lua.finalizeinitex () end
+
+end
+
+
if not environment.luafilechunk then
function environment.luafilechunk(filename)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-lib.mkiv b/Master/texmf-dist/tex/context/base/mkiv/luat-lib.mkiv
index 6dbcdaf54a3..3df374de9ad 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/luat-lib.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/luat-lib.mkiv
@@ -45,6 +45,8 @@
\registerctxluafile{util-soc-imp-http} {}
\registerctxluafile{util-soc-imp-tp} {}
+\registerctxluafile{util-zip}{}
+
\registerctxluafile{data-ini}{}
\registerctxluafile{data-exp}{}
\registerctxluafile{data-env}{}
@@ -53,13 +55,14 @@
\registerctxluafile{data-res}{}
\registerctxluafile{data-inp}{}
\registerctxluafile{data-out}{}
-\registerctxluafile{data-fil}{} % opener gets overloaded in data-tex
+\registerctxluafile{data-fil}{autosuffix} % opener gets overloaded in data-tex
\registerctxluafile{data-pre}{} % after data-res
\registerctxluafile{data-bin}{} % before data-tex
\registerctxluafile{data-tex}{} % after data-pre
\registerctxluafile{data-vir}{}
\registerctxluafile{data-zip}{}
+%registerctxluafile{data-tar}{}
%registerctxluafile{data-crl}{}
\registerctxluafile{data-sch}{}
\registerctxluafile{data-tre}{}
@@ -85,6 +88,8 @@
\registerctxluafile{luat-mac}{}
%registerctxluafile{luat-prp}{} % for the moment of not much use
+\registerctxluafile{util-lib}{}
+
\registerctxluafile{lxml-tab}{}
\registerctxluafile{lxml-lpt}{}
\registerctxluafile{lxml-xml}{}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-mac.lua b/Master/texmf-dist/tex/context/base/mkiv/luat-mac.lua
index 3c50a41f89c..fca59c993ba 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/luat-mac.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/luat-mac.lua
@@ -85,6 +85,8 @@ local set = CONTEXTLMTXMODE > 0 and
return h .. "-"
elseif s == "spacer" then
return h .. "*"
+ elseif s == "keepspacer" then
+ return h .. ","
elseif s == "pickup" then
return h .. ":"
else
@@ -185,16 +187,20 @@ local name = (R("AZ","az") + utf8character)^1
local csname = (R("AZ","az") + S("@?!_:-*") + utf8character)^1
local longname = (longleft/"") * (nolong^1) * (longright/"")
local variable = P("#") * Cs(name + longname)
+local bcsname = P("csname")
+local ecsname = escape * P("endcsname")
local escapedname = escape * csname
-local definer = escape * (P("def") + S("egx") * P("def")) -- tex
+local definer = escape * (P("u")^-1 * S("egx")^-1 * P("def")) -- tex
local setter = escape * P("set") * (P("u")^-1 * S("egx")^-1) * P("value") -- context specific
--- + escape * P("install") * (1-P("handler"))^1 * P("handler") -- context specific
+local defcsname = escape * S("egx")^-1 * P("defcsname")
+ * (1 - ecsname)^1
+ * ecsname
local startcode = P("\\starttexdefinition") -- context specific
local stopcode = P("\\stoptexdefinition") -- context specific
local anything = patterns.anything
local always = patterns.alwaysmatched
-local definer = escape * (P("u")^-1 * S("egx")^-1 * P("def")) -- tex
-- The comment nilling can become an option but it nicely compensates the Lua
-- parsing here with less parsing at the TeX end. We keep lines so the errors
@@ -206,7 +212,6 @@ local definer = escape * (P("u")^-1 * S("egx")^-1 * P("def"))
local commenttoken = P("%")
local crorlf = S("\n\r")
------ commentline = commenttoken * ((Carg(1) * C((1-crorlf)^0))/function(strip,s) return strip and "" or s end)
local commentline = commenttoken * ((1-crorlf)^0)
local leadingcomment = (commentline * crorlf^1)^1
local furthercomment = (crorlf^1 * commentline)^1
@@ -229,7 +234,6 @@ local grammar = { "converter",
* startcode
* spaces
* (csname * spaces)^1 -- new: multiple, new:csname instead of name
- -- * (declaration + furthercomment + (1 - newline - space))^0
* ((declaration * (space^0/""))^1 + furthercomment + (1 - newline - space))^0 -- accepts #a #b #c
* V("texbody")
* stopcode
@@ -242,10 +246,12 @@ local grammar = { "converter",
+ (1 - stopcode)
)^0,
definition = pushlocal
- * definer
- * spaces^0
- * escapedname
--- * (declaration + furthercomment + commentline + (1-leftbrace))^0
+ * (definer * spaces^0 * escapedname)
+ * (declaration + furthercomment + commentline + csname_endcsname + (1-leftbrace))^0
+ * V("braced")
+ * poplocal,
+ csnamedef = pushlocal
+ * defcsname
* (declaration + furthercomment + commentline + csname_endcsname + (1-leftbrace))^0
* V("braced")
* poplocal,
@@ -265,11 +271,11 @@ local grammar = { "converter",
+ leadingcomment -- new per 2012-05-15 (message on mailing list)
+ nobrace
)^0
- -- * rightbrace^-1, -- the -1 catches errors
* (rightbrace + Cmt(always,matcherror)),
pattern = leadingcomment
+ V("definition")
+ + V("csnamedef")
+ V("setcode")
+ V("texcode")
+ furthercomment
diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-run.lua b/Master/texmf-dist/tex/context/base/mkiv/luat-run.lua
index 874287ee1a0..c778ad09457 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/luat-run.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/luat-run.lua
@@ -106,7 +106,7 @@ local function pre_dump_actions()
for i=1,#dumpactions do
dumpactions[i]()
end
- lua.finalize(trace_lua_dump and report_lua or nil)
+ lua.finalizeinitex(trace_lua_dump and report_lua or nil)
end
local function wrapup_synctex()
diff --git a/Master/texmf-dist/tex/context/base/mkiv/luat-sto.lua b/Master/texmf-dist/tex/context/base/mkiv/luat-sto.lua
index feb5464009b..be5134b84b1 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/luat-sto.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/luat-sto.lua
@@ -90,7 +90,7 @@ if environment.initex then
storage.max = max
end
- lua.registerfinalizer(dump,"dump storage")
+ lua.registerinitexfinalizer(dump,"dump storage")
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lxml-aux.lua b/Master/texmf-dist/tex/context/base/mkiv/lxml-aux.lua
index 126df4d82de..fc17371e58f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lxml-aux.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lxml-aux.lua
@@ -316,6 +316,37 @@ function xml.replace(root,pattern,whatever)
end
end
+function xml.expand(root,pattern,whatever)
+ local collected = root and xmlapplylpath(root,pattern)
+ if collected then
+ for c=1,#collected do
+ local e = collected[c]
+ local p = e.__p__
+ if p then
+ if trace_manipulations then
+ report('expanding',pattern,c,e)
+ end
+ local d = p.dt
+ local n = e.ni
+ local t = whatever(e,p)
+ if t then
+ if type(t) == "table" then
+ t = xmlcopy(t)
+ d[n] = t[1]
+ for i=2,#t do
+ n = n + 1
+ insert(d,n,t[i])
+ end
+ else
+ d[n] = t
+ end
+ redo_ni(d) -- probably not needed
+ end
+ end
+ end
+ end
+end
+
local function wrap(e,wrapper)
local t = {
rn = e.rn,
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lxml-css.lua b/Master/texmf-dist/tex/context/base/mkiv/lxml-css.lua
index 76cc4891e1d..48177c47cb2 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lxml-css.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lxml-css.lua
@@ -233,7 +233,7 @@ do
end
end
- function css.size(str,factors)
+ function css.size(str,factors, pct)
local size, unit
if type(str) == "table" then
size, unit = str[1], str[2]
@@ -241,7 +241,9 @@ do
size, unit = lpegmatch(p_size,lower(str))
end
if size and unit then
- if factors then
+ if unit == "%" and pct then
+ return size * pct
+ elseif factors then
return (factors[unit] or 1) * size
else
return size, unit
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lxml-ctx.mkiv b/Master/texmf-dist/tex/context/base/mkiv/lxml-ctx.mkiv
index 7d44d61bea1..ec782c39591 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lxml-ctx.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/lxml-ctx.mkiv
@@ -20,9 +20,9 @@
\unprotect
-\settrue \xmllshowbuffer
-\setfalse\xmllshowtitle
-\settrue \xmllshowwarning
+\settrue \xmllshowbuffertoo
+\setfalse\xmllshowtitletoo
+\settrue \xmllshowwarningtoo
\definehead
[lshowtitle]
@@ -35,10 +35,10 @@
\unexpanded\def\xmllshow#1%
{\ctxlua{xml.ctx.tshow {
pattern = \!!bs\detokenize{#1}\!!es,
- \ifconditional\xmllshowtitle
+ \ifconditional\xmllshowtitletoo
title = "lshowtitle",
\fi
- \ifconditional\xmllshowwarning
+ \ifconditional\xmllshowwarningtoo
warning = true,
\fi
} }}
@@ -46,11 +46,11 @@
\unexpanded\def\xmllshowbuffer#1#2#3%
{\ctxlua{xml.ctx.tshow {
pattern = \!!bs\detokenize{#2}\!!es,
- \ifconditional\xmllshowbuffer
+ \ifconditional\xmllshowbuffertoo
xmlroot = "#1",
attribute = "#3",
\fi
- \ifconditional\xmllshowwarning
+ \ifconditional\xmllshowwarningtoo
warning = true,
\fi
} }}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lxml-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/lxml-ini.lua
index 43643f71a18..980a83f1a2b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lxml-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lxml-ini.lua
@@ -154,6 +154,79 @@ implement { name = "xmlstoptiming", actions = function() statistics.stopt
implement { name = "xmlloadentities", actions = characters.registerentities, onceonly = true }
+if CONTEXTLMTXMODE > 0 then
+
+ local boolean_code = tokens.values.boolean
+
+ local getid = lxml.getid
+ local found = xml.found
+ local empty = xml.empty
+ local checkedempty = xml.checkedempty
+ local ifatt = lxml.ifatt
+ local ifattempty = lxml.ifattempty
+
+ implement {
+ name = "ifxml",
+ public = true,
+ usage = "condition",
+ arguments = "2 arguments",
+ actions = function(id,pattern)
+ return boolean_code, found(getid(id),pattern) and true
+ end
+ }
+
+ implement {
+ name = "ifxmltext",
+ public = true,
+ usage = "condition",
+ arguments = "2 arguments",
+ actions = function(id,pattern)
+ return boolean_code, not empty(getid(id),pattern) and true
+ end
+ }
+
+ implement {
+ name = "ifxmlatt",
+ public = true,
+ usage = "condition",
+ arguments = "3 arguments",
+ actions = function(id,name,value)
+ return boolean_code, ifatt(getid(id),name,value)
+ end
+ }
+
+ implement {
+ name = "ifxmlattempty",
+ public = true,
+ usage = "condition",
+ arguments = "2 arguments",
+ actions = function(id,name)
+ return boolean_code, ifattempty(getid(id),name)
+ end
+ }
+
+ implement {
+ name = "ifxmlempty",
+ public = true,
+ usage = "condition",
+ arguments = "2 arguments",
+ actions = function(id,pattern)
+ return boolean_code, not checkedempty(getid(id),pattern) and true
+ end
+ }
+
+ implement {
+ name = "ifxmlselfempty",
+ public = true,
+ usage = "condition",
+ arguments = "argument",
+ actions = function(id)
+ return boolean_code, not checkedempty(getid(id)) and true
+ end
+ }
+
+end
+
-- kind of special (3rd argument is a function)
commands.xmlsetfunction = lxml.setaction
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lxml-lpt.lua b/Master/texmf-dist/tex/context/base/mkiv/lxml-lpt.lua
index 9e4b475fb09..78a9fca2e0a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lxml-lpt.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lxml-lpt.lua
@@ -635,7 +635,9 @@ local builtin = {
match = "(ll.mi or 1)",
namespace = "ll.ns",
ns = "ll.ns",
-
+ -- new
+ -- attribute = "ll.at",
+ -- at = "ll.at",
}
local lp_builtin = lpeg.utfchartabletopattern(builtin)/builtin * ((spaces * P("(") * spaces * P(")"))/"")
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lxml-tab.lua b/Master/texmf-dist/tex/context/base/mkiv/lxml-tab.lua
index 3af4974d300..e18362bd8cd 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lxml-tab.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lxml-tab.lua
@@ -369,8 +369,7 @@ end
local function add_text(text)
if text == "" then
return
- end
- if cleanup then
+ elseif cleanup then
if nt > 0 then
local s = dt[nt]
if type(s) == "string" then
@@ -1022,6 +1021,7 @@ local function install(spacenewline,spacing,anything)
local text_unparsed = Cs((anything-open)^1)
local text_parsed = (Cs((anything-open-ampersand)^1)/add_text + Cs(entity_text)/add_text)^1
+-- local text_parsed = ((Cs(((anything-open-ampersand)^1) + entity_text))/add_text)^1
local somespace = (spacenewline)^1
local optionalspace = (spacenewline)^0
@@ -1043,10 +1043,16 @@ local function install(spacenewline,spacing,anything)
local unparsedtext = text_unparsed / add_text
local balanced = P { "[" * ((anything - S"[]") + V(1))^0 * "]" } -- taken from lpeg manual, () example
+ -- todo: combine empty and begin so that we scan attributes only once .. maybe also go for match time captures
+
local emptyelement = (spacing * open * name * attributes * optionalspace * slash * close) / add_empty
local beginelement = (spacing * open * name * attributes * optionalspace * close) / add_begin
local endelement = (spacing * open * slash * name * optionalspace * close) / add_end
+-- local commonelement = spacing * open * name * attributes * optionalspace *
+-- local cemptyelement = (slash * close) / add_empty
+-- local cbeginelement = ( * close) / add_begin
+
-- todo: combine the opens in:
local begincomment = open * P("!--")
@@ -1103,11 +1109,7 @@ local function install(spacenewline,spacing,anything)
local publicdoctype = doctypename * somespace * P("PUBLIC") * somespace * value * somespace * value * somespace * doctypeset
local systemdoctype = doctypename * somespace * P("SYSTEM") * somespace * value * somespace * doctypeset
local simpledoctype = (anything-close)^1 -- * balanced^0
- local somedoctype = C((somespace * (
-
-publicentityfile +
-
- publicdoctype + systemdoctype + definitiondoctype + simpledoctype) * optionalspace)^0)
+ local somedoctype = C((somespace * (publicentityfile + publicdoctype + systemdoctype + definitiondoctype + simpledoctype) * optionalspace)^0)
local instruction = (spacing * begininstruction * someinstruction * endinstruction) / function(...) add_special("@pi@",...) end
local comment = (spacing * begincomment * somecomment * endcomment ) / function(...) add_special("@cm@",...) end
@@ -1150,6 +1152,16 @@ publicentityfile +
children = parsedtext + V("parent") + emptyelement + comment + cdata + instruction + parsedcrap,
}
+-- local grammar_parsed_text_two = P { "followup",
+-- followup = beginelement * V("children")^0 * endelement * trailer,
+-- children = parsedtext + beginelement * V("children")^0 * endelement + emptyelement + comment + cdata + instruction + parsedcrap,
+-- }
+
+-- local grammar_parsed_text_two = P { "followup",
+-- followup = commonelement * cbeginelement * V("children")^0 * endelement * trailer,
+-- children = parsedtext + commonelement * (cbeginelement * V("children")^0 * endelement + cemptyelement) + comment + cdata + instruction + parsedcrap,
+-- }
+
local grammar_unparsed_text = P { "preamble",
preamble = utfbom^0 * instruction^0 * (doctype + comment + instruction)^0 * V("parent") * trailer,
parent = beginelement * V("children")^0 * endelement,
@@ -1412,7 +1424,7 @@ can speed up things a bit. The second argument is not to be used!</p>
-- end
-- end
--
--- We need to prevent __p__ recursio, so:
+-- We need to prevent __p__ recursion, so:
local function copy(old,p)
if old then
@@ -1967,7 +1979,7 @@ function xml.kind(e)
local tg = d.tg
if tg == "@cd@" then
return "cdata"
- elseif tg == "@cm" then
+ elseif tg == "@cm@" then
return "comment"
elseif tg == "@pi@" then
return "instruction"
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lxml-tex.lua b/Master/texmf-dist/tex/context/base/mkiv/lxml-tex.lua
index 7a79ee15f4d..520797883cd 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lxml-tex.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lxml-tex.lua
@@ -772,6 +772,8 @@ local tex_element
if tokenizedxmlw then
+-- local expandmacro = token.expandmacro
+
tex_element = function(e,handlers)
if setfilename then
syncfilename(e,"element")
@@ -793,6 +795,10 @@ if tokenizedxmlw then
addindex(rootname,false,true)
ix = e.ix
end
+-- lmtx only, same performance, a bit more immediate:
+--
+-- expandmacro(tokenizedxmlw,ctxcatcodes,true,command,true,rootname.."::"..ix)
+--
contextsprint(ctxcatcodes,tokenizedxmlw,"{",command,"}{",rootname,"::",ix,"}")
else
report_lxml("fatal error: no index for %a",command)
@@ -2064,6 +2070,28 @@ do
end
end
+ function lxml.ifatt(id,a,value)
+ local e = getid(id)
+ if e then
+ local at = e.at
+ att = at and at[a] or ""
+ else
+ att = ""
+ end
+ return att == value
+ end
+
+ function lxml.ifattempty(id,a)
+ local e = getid(id)
+ if e then
+ local at = e.at
+ att = at and at[a] or ""
+ else
+ att = ""
+ end
+ return att == ""
+ end
+
function lxml.refatt(id,a)
local e = getid(id)
if e then
@@ -2223,7 +2251,7 @@ function lxml.snippet(id,i)
if e then
local dt = e.dt
if dt then
- local dti = dt[i]
+ local dti = dt[tonumber(i)] -- string in lxml
if dti then
xmlsprint(dti,e)
end
@@ -2322,6 +2350,8 @@ do
end
end
+ xml.checkedempty = checkedempty
+
function lxml.doifempty (id,pattern) doif (checkedempty(id,pattern)) end
function lxml.doifnotempty (id,pattern) doifnot (checkedempty(id,pattern)) end
function lxml.doifelseempty(id,pattern) doifelse(checkedempty(id,pattern)) end
@@ -2727,6 +2757,8 @@ do
end
+-- hm, maybe to ini to, these implements
+
implement {
name = "xmlsetinjectors",
actions = xml.setinjectors,
diff --git a/Master/texmf-dist/tex/context/base/mkiv/m-fonts-plugins.mkiv b/Master/texmf-dist/tex/context/base/mkiv/m-fonts-plugins.mkiv
index ec1c05e7af8..00174d13e8f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/m-fonts-plugins.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/m-fonts-plugins.mkiv
@@ -15,15 +15,72 @@
%D Eigner at an NTG meeting, then left it for a while, and sort of finalized it the
%D last quarter of 2016. As I don't use this module, apart from maybe testing
%D something, it is not guaranteed to work (but fixing should be a no real problem
-%D as I expect apis to be stable). Plugins liek this can interfere with other
+%D as I expect apis to be stable). Plugins like this can interfere with other
%D functionality in \CONTEXT\ so don't expect too much support. The two modules
%D mentioned below should work in the generic loader too. It's anyhow an
%D illustration of how \type {ffi} be used in a practical application.
-
-% \enabletrackers[resolvers.ffilib]
-
-\registerctxluafile{font-txt}{} % generic text handler
-\registerctxluafile{font-phb}{} % harfbuzz plugin: binary or library (ffi/optional)
+%D
+%D I'm not sure if Idris will ever need this but the code has been used for some
+%D articles so that's why it's eventually shipped.
+%D
+%D The library is supposed to be present in
+%D
+%D \starttyping
+%D .../tex/texmf-win64/bin/lib/luatatex/harfbuzz/libharfbuzz-0.dll
+%D .../tex/texmf-win64/bin/lib/luametatex/harfbuzz/libharfbuzz-0.dll
+%D
+%D .../tex/texmf-*/bin/lib/luatatex/harfbuzz/libharfbuzz.so
+%D .../tex/texmf-*/bin/lib/luametatex/harfbuzz/libharfbuzz.so
+%D \stoptyping
+%D
+%D It might be found on the system if paths are set but with libraries that render
+%D (font) stuff it's best to rely on what you explictly installed. When you install
+%D files there make sure to run \type {mtxrun --generate}. Keep in mind that we don't
+%D officially support such dependencies (bug-wise).
+%D
+%D In mkiv we support binary and library, and in lmtx binary and internal where we
+%D default to library or internal as binary is not that fast (more meant as a
+%D playground I guess). You can track loading with:
+%D
+%D \starttyping
+%D \enabletrackers[resolvers.ffilib]
+%D \stoptyping
+%D
+%D This file has always been in the distribution but per end april 2021 the font-txt,
+%D font-phb and font-phb-imp-* files are in the distrinbution too. It's a side effect
+%D of some cleanup of the (luametatex) source tree (where the optional module was not
+%D yet in sync with the other optional ones). This module is mostly for myself and
+%D Idris if only because it is not tested for interferences with all kind of other
+%D font code (and it's unlikely to happen), so don't depend on this!
+
+% \starttext
+%
+% \definefontfeature [native] [default]
+% [mode=plug,
+% features=harfbuzz,
+% shaper=native]
+%
+% \definefontfeature [uniscribe] [default]
+% [mode=plug,
+% features=harfbuzz,
+% shaper=uniscribe]
+%
+% \definefontfeature [binary] [default]
+% [mode=plug,
+% method=binary,
+% features=harfbuzz,
+% shaper=uniscribe]
+%
+% % \nohyphens
+% \definedfont[Serif*default] fiets \par % \input tufte \par
+% \definedfont[Serif*native] fiets \par % \input tufte \par
+% \definedfont[Serif*uniscribe] fiets \par % \input tufte \par
+% \definedfont[Serif*binary] fiets \par % \input tufte \par
+%
+% \stoptext
+
+
+\registerctxluafile{font-phb}{autosuffix}
\startluacode
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-act.lua b/Master/texmf-dist/tex/context/base/mkiv/math-act.lua
index e1ef751d7ed..d56efbbfd44 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-act.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-act.lua
@@ -6,10 +6,13 @@ if not modules then modules = { } end modules ['math-act'] = {
license = "see context related readme files"
}
--- Here we tweak some font properties (if needed).
+-- Here we tweak some font properties (if needed). Per mid octover 2022 we also provide
+-- an lmtx emulation mode which means that we removed some other code. Some of that was
+-- experimental, some transitional, some is now obsolete). Using emulation mode also
+-- means that we are unlikely to test some aspects of the math engines extensively.
local type, next = type, next
-local fastcopy, insert, remove = table.fastcopy, table.insert, table.remove
+local fastcopy, insert, remove, copytable = table.fastcopy, table.insert, table.remove, table.copy
local formatters = string.formatters
local trace_defining = false trackers.register("math.defining", function(v) trace_defining = v end)
@@ -59,6 +62,9 @@ function mathematics.initializeparameters(target,original)
if not mathparameters.SpaceBeforeScript then
mathparameters.SpaceBeforeScript = mathparameters.SpaceAfterScript
end
+ if not mathparameters.SubscriptShiftDownWithSuperscript then
+ mathparameters.SubscriptShiftDownWithSuperscript = mathparameters.SubscriptShiftDown * 1.5
+ end
target.mathparameters = mathparameters
end
end
@@ -75,41 +81,43 @@ local how = {
NoLimitSubFactor = "unscaled",
}
-function mathematics.scaleparameters(target,original)
- if not target.properties.math_is_scaled then
- local mathparameters = target.mathparameters
- if mathparameters and next(mathparameters) then
- local parameters = target.parameters
- local factor = parameters.factor
- local hfactor = parameters.hfactor
- local vfactor = parameters.vfactor
- for name, value in next, mathparameters do
- local h = how[name]
- if h == "unscaled" then
- -- kept
- elseif h == "horizontal" then
- value = value * hfactor
- elseif h == "vertical"then
- value = value * vfactor
- else
- value = value * factor
- end
- mathparameters[name] = value
+local function scaleparameters(mathparameters,parameters)
+ if mathparameters and next(mathparameters) and parameters then
+ local factor = parameters.factor
+ local hfactor = parameters.hfactor
+ local vfactor = parameters.vfactor
+ for name, value in next, mathparameters do
+ local h = how[name]
+ if h == "unscaled" then
+ -- kept
+ elseif h == "horizontal" then
+ value = value * hfactor
+ elseif h == "vertical"then
+ value = value * vfactor
+ else
+ value = value * factor
end
+ mathparameters[name] = value
end
- target.properties.math_is_scaled = true
end
end
--- AccentBaseHeight vs FlattenedAccentBaseHeight
-
-function mathematics.checkaccentbaseheight(target,original)
- local mathparameters = target.mathparameters
- if mathparameters and mathparameters.AccentBaseHeight == 0 then
- mathparameters.AccentBaseHeight = target.parameters.x_height -- needs checking
+function mathematics.scaleparameters(target,original)
+ if not target.properties.math_is_scaled then
+ scaleparameters(target.mathparameters,target.parameters)
+ target.properties.math_is_scaled = true
end
end
+-- -- AccentBaseHeight vs FlattenedAccentBaseHeight
+--
+-- function mathematics.checkaccentbaseheight(target,original)
+-- local mathparameters = target.mathparameters
+-- if mathparameters and mathparameters.AccentBaseHeight == 0 then
+-- mathparameters.AccentBaseHeight = target.parameters.x_height -- needs checking
+-- end
+-- end
+
function mathematics.checkprivateparameters(target,original)
local mathparameters = target.mathparameters
if mathparameters then
@@ -150,28 +158,67 @@ function mathematics.overloadparameters(target,original)
if trace_defining then
report_math("overloading math parameters in %a @ %p",target.properties.fullname,target.parameters.size)
end
+ -- for name, value in next, parameters do
+ -- local tvalue = type(value)
+ -- if tvalue == "string" then
+ -- report_math("comment for math parameter %a: %s",name,value)
+ -- else
+ -- local oldvalue = mathparameters[name]
+ -- local newvalue = oldvalue
+ -- if oldvalue then
+ -- if tvalue == "number" then
+ -- newvalue = value
+ -- elseif tvalue == "function" then
+ -- newvalue = value(oldvalue,target,original)
+ -- elseif not tvalue then
+ -- newvalue = nil
+ -- end
+ -- if trace_defining and oldvalue ~= newvalue then
+ -- report_math("overloading math parameter %a: %S => %S",name,oldvalue,newvalue)
+ -- end
+ -- else
+ -- -- report_math("invalid math parameter %a",name)
+ -- end
+ -- mathparameters[name] = newvalue
+ -- end
+ -- end
+ for name, value in next, parameters do
+ local tvalue = type(value)
+ local oldvalue = mathparameters[name]
+ local newvalue = oldvalue
+ if tvalue == "number" then
+ newvalue = value
+ elseif tvalue == "string" then
+ -- delay till all set
+ elseif tvalue == "function" then
+ newvalue = value(oldvalue,target,original)
+ elseif not tvalue then
+ newvalue = nil
+ end
+ if trace_defining and oldvalue ~= newvalue then
+ report_math("overloading math parameter %a: %S => %S",name,oldvalue or 0,newvalue)
+ end
+ mathparameters[name] = newvalue
+ end
for name, value in next, parameters do
local tvalue = type(value)
if tvalue == "string" then
- report_math("comment for math parameter %a: %s",name,value)
- else
- local oldvalue = mathparameters[name]
- local newvalue = oldvalue
- if oldvalue then
- if tvalue == "number" then
- newvalue = value
- elseif tvalue == "function" then
- newvalue = value(oldvalue,target,original)
- elseif not tvalue then
- newvalue = nil
+ local newvalue = mathparameters[value]
+ if not newvalue then
+ local code = loadstring("return " .. value,"","t",mathparameters)
+ if type(code) == "function" then
+ local okay, v = pcall(code)
+ if okay then
+ newvalue = v
+ end
end
- if trace_defining and oldvalue ~= newvalue then
- report_math("overloading math parameter %a: %S => %S",name,oldvalue,newvalue)
- end
- else
- report_math("invalid math parameter %a",name)
end
- mathparameters[name] = newvalue
+ if newvalue then
+ -- split in number and string
+ mathparameters[name] = newvalue
+ elseif trace_defining then
+ report_math("ignoring math parameter %a: %S",name,value)
+ end
end
end
end
@@ -180,29 +227,65 @@ function mathematics.overloadparameters(target,original)
end
end
+local mathtweaks = { subsets = table.setmetatableindex("table") }
+mathematics.tweaks = mathtweaks
+
+local apply_tweaks = true
+
+directives.register("math.applytweaks", function(v)
+ apply_tweaks = v;
+end)
+
local function applytweaks(when,target,original)
- local goodies = original.goodies
- if goodies then
- for i=1,#goodies do
- local goodie = goodies[i]
- local mathematics = goodie.mathematics
- local tweaks = mathematics and mathematics.tweaks
- if type(tweaks) == "table" then
- tweaks = tweaks[when]
- if type(tweaks) == "table" then
- if trace_defining then
- report_math("tweaking math of %a @ %p (%s)",target.properties.fullname,target.parameters.size,when)
- end
- for i=1,#tweaks do
- local tweak= tweaks[i]
- local tvalue = type(tweak)
- if tvalue == "function" then
- tweak(target,original)
+ if apply_tweaks then
+ local goodies = original.goodies
+ if goodies then
+ local tweaked = target.tweaked or { }
+ if tweaked[when] then
+ if trace_defining then
+ report_math("tweaking math of %a @ %p (%s: %s)",target.properties.fullname,target.parameters.size,when,"done")
+ end
+ else
+ for i=1,#goodies do
+ local goodie = goodies[i]
+ local mathematics = goodie.mathematics
+ local tweaks = mathematics and mathematics.tweaks
+ if type(tweaks) == "table" then
+ tweaks = tweaks[when]
+ if type(tweaks) == "table" then
+ if trace_defining then
+ report_math("tweaking math of %a @ %p (%s: %s)",target.properties.fullname,target.parameters.size,when,"okay")
+ end
+ for i=1,#tweaks do
+ local tweak = tweaks[i]
+ local tvalue = type(tweak)
+ if type(tweak) == "table" then
+ local action = mathtweaks[tweak.tweak or ""]
+ if action then
+ local feature = tweak.feature
+ local features = target.specification.features.normal
+ if not feature or features[feature] == true then
+ local version = tweak.version
+ if version and version ~= target.tweakversion then
+ report_math("skipping tweak %a version %a",tweak.tweak,version)
+ elseif original then
+ action(target,original,tweak)
+ else
+ action(target,tweak)
+ end
+ end
+ end
+ end
+ end
end
end
end
+ tweaked[when] = true
+ target.tweaked = tweaked
end
end
+ else
+ report_math("not tweaking math of %a @ %p (%s)",target.properties.fullname,target.parameters.size,when)
end
end
@@ -220,120 +303,132 @@ function mathematics.tweakaftercopyingfont(target,original)
end
end
+sequencers.appendaction("mathparameters","system","mathematics.overloadparameters")
sequencers.appendaction("mathparameters","system","mathematics.scaleparameters")
-sequencers.appendaction("mathparameters","system","mathematics.checkaccentbaseheight") -- should go in lfg instead
+----------.appendaction("mathparameters","system","mathematics.checkaccentbaseheight") -- should go in lfg instead
sequencers.appendaction("mathparameters","system","mathematics.checkprivateparameters") -- after scaling !
-sequencers.appendaction("mathparameters","system","mathematics.overloadparameters")
sequencers.appendaction("beforecopyingcharacters","system","mathematics.tweakbeforecopyingfont")
sequencers.appendaction("aftercopyingcharacters", "system","mathematics.tweakaftercopyingfont")
--- no, it's a feature now (see good-mth):
---
--- sequencers.appendaction("aftercopyingcharacters", "system","mathematics.overloaddimensions")
-
--- a couple of predefined tweaks:
-
-local tweaks = { }
-mathematics.tweaks = tweaks
-
--- function tweaks.fixbadprime(target,original)
--- target.characters[0xFE325] = target.characters[0x2032]
--- end
-
--- these could go to math-fbk
-
--- local virtualized = mathematics.virtualized
---
--- local function accent_to_extensible(target,newchr,original,oldchr,height,depth,swap)
--- local characters = target.characters
--- -- if not characters[newchr] then -- xits needs an enforce
--- local addprivate = fonts.helpers.addprivate
--- local olddata = characters[oldchr]
--- if olddata then
--- if swap then
--- swap = characters[swap]
--- height = swap.depth
--- depth = 0
--- else
--- height = height or 0
--- depth = depth or 0
--- end
--- local correction = swap and { "down", (olddata.height or 0) - height } or { "down", olddata.height }
--- local newdata = {
--- commands = { correction, { "slot", 1, oldchr } },
--- width = olddata.width,
--- height = height,
--- depth = depth,
--- }
--- characters[newchr] = newdata
--- local nextglyph = olddata.next
--- while nextglyph do
--- local oldnextdata = characters[nextglyph]
--- local newnextdata = {
--- commands = { correction, { "slot", 1, nextglyph } },
--- width = oldnextdata.width,
--- height = height,
--- depth = depth,
--- }
--- local newnextglyph = addprivate(target,formatters["original-%H"](nextglyph),newnextdata)
--- newdata.next = newnextglyph
--- local nextnextglyph = oldnextdata.next
--- if nextnextglyph == nextglyph then
--- break
--- else
--- olddata = oldnextdata
--- newdata = newnextdata
--- nextglyph = nextnextglyph
--- end
--- end
--- local hv = olddata.horiz_variants
--- if hv then
--- hv = fastcopy(hv)
--- newdata.horiz_variants = hv
--- for i=1,#hv do
--- local hvi = hv[i]
--- local oldglyph = hvi.glyph
--- local olddata = characters[oldglyph]
--- local newdata = {
--- commands = { correction, { "slot", 1, oldglyph } },
--- width = olddata.width,
--- height = height,
--- depth = depth,
--- }
--- hvi.glyph = addprivate(target,formatters["original-%H"](oldglyph),newdata)
--- end
--- end
--- end
--- -- end
--- end
-
--- function tweaks.fixoverline(target,original)
--- local height, depth = 0, 0
--- local mathparameters = target.mathparameters
--- if mathparameters then
--- height = mathparameters.OverbarVerticalGap
--- depth = mathparameters.UnderbarVerticalGap
--- else
--- height = target.parameters.xheight/4
--- depth = height
--- end
--- accent_to_extensible(target,0x203E,original,0x0305,height,depth)
--- -- also crappy spacing for our purpose: push to top of baseline
--- accent_to_extensible(target,0xFE3DE,original,0x23DE,height,depth,0x23DF)
--- accent_to_extensible(target,0xFE3DC,original,0x23DC,height,depth,0x23DD)
--- accent_to_extensible(target,0xFE3B4,original,0x23B4,height,depth,0x23B5)
--- -- for symmetry
--- target.characters[0xFE3DF] = original.characters[0x23DF]
--- target.characters[0xFE3DD] = original.characters[0x23DD]
--- target.characters[0xFE3B5] = original.characters[0x23B5]
--- -- inspect(fonts.helpers.expandglyph(target.characters,0x203E))
--- -- inspect(fonts.helpers.expandglyph(target.characters,0x23DE))
--- end
+do
+
+ -- More than a year of testing, development, tweaking (and improving) fonts has resulted
+ -- in a math engine in \LUAMETATEX\ that is quite flexible. Basically we can drop italic
+ -- correction there. In \MKIV\ we can emulate this to some extend but we still need a bit
+ -- of mix because \LUAMETATEX\ lacks some features. A variant of the tweak below is now
+ -- also used in the plain code we ship. In \MKIV\ we dropped a few features that were a
+ -- prelude to this and, because most users switched to \LMTX, it is unlikely that other
+ -- tweaks wil be backported. There is also no need to adapt \LUATEX\ and eventually all
+ -- italic code might be removed from \LUAMETATEX\ (unless we want to be able to test the
+ -- alternative; I can live with a little ballast, especially because it took time to load
+ -- it).
+
+ local italics = nil
+ local integrals = table.tohash {
+ 0x0222B, 0x0222C, 0x0222D, 0x0222E, 0x0222F, 0x02230, 0x02231, 0x02232, 0x02233,
+ 0x02A0B, 0x02A0C, 0x02A0D, 0x02A0E, 0x02A0F, 0x02A10, 0x02A11, 0x02A12, 0x02A13,
+ 0x02A14, 0x02A15, 0x02A16, 0x02A17, 0x02A18, 0x02A19, 0x02A1A, 0x02A1B, 0x02A1C,
+ 0x02320, 0x02321
+ }
+
+ function mathtweaks.emulatelmtx(target,original,parameters)
+ -- gaps are not known yet
+ if not italic then
+ italics = { }
+ local gaps = mathematics.gaps
+ for name, data in next, characters.blocks do
+ if data.math and data.italic then
+ for i=data.first,data.last do
+ italics[i] = true
+ local g = gaps[i]
+ if g then
+ italics[g] = true
+ end
+ end
+ end
+ end
+-- table.save("temp.log", table.sortedkeys(italics))
+ end
+ --
+ local targetcharacters = target.characters
+ local targetdescriptions = target.descriptions
+ local factor = target.parameters.factor
+ local function getllx(u)
+ local d = targetdescriptions[u]
+ if d then
+ local b = d.boundingbox
+ if b then
+ local llx = b[1]
+ if llx < 0 then
+ return - llx
+ end
+ end
+ end
+ return false
+ end
+ -- beware: here we also do the weird ones
+ for u, c in next, targetcharacters do
+ local uc = c.unicode or u
+ if integrals[uc] then
+ -- skip this one
+ else
+ local accent = c.top_accent
+ local italic = c.italic
+ local width = c.width or 0
+ local llx = getllx(u)
+ local bl, br, tl, tr
+ if llx then
+ llx = llx * factor
+ width = width + llx
+ bl = - llx
+ tl = bl
+ c.commands = { rightcommand[llx], charcommand[u] }
+ if accent then
+ accent = accent + llx
+ end
+ end
+ if accent then
+ if italics[uc] then
+ c.top_accent = accent
+ else
+ c.top_accent = nil
+ end
+ end
+ if italic and italic ~= 0 then
+ width = width + italic
+ br = - italic
+ end
+ c.width = width
+ if italic then
+ c.italic = nil
+ end
+ if bl or br or tl or tr then
+ -- watch out: singular and _ because we are post copying / scaling
+ c.mathkern = {
+ bottom_left = bl and { { height = 0, kern = bl } } or nil,
+ bottom_right = br and { { height = 0, kern = br } } or nil,
+ top_left = tl and { { height = c.height or 0, kern = tl } } or nil,
+ top_right = tr and { { height = c.height or 0, kern = tr } } or nil,
+ }
+ end
+ end
+ end
+ end
--- sequencers.appendaction("aftercopyingcharacters", "system","mathematics.tweaks.fixoverline") -- for the moment always
+ function mathtweaks.parameters(target,original,parameters)
+ local newparameters = parameters.list
+ local oldparameters = target.mathparameters
+ if newparameters and oldparameters then
+ newparameters = copytable(newparameters)
+ scaleparameters(newparameters,target.parameters)
+ for name, newvalue in next, newparameters do
+ oldparameters[name] = newvalue
+ end
+ end
+ end
--- helpers
+end
local setmetatableindex = table.setmetatableindex
@@ -467,87 +562,6 @@ interfaces.implement {
end
}
--- experiment
-
--- check: when true, only set when present in font
--- force: when false, then not set when already set
-
--- todo: tounicode
-
--- function mathematics.injectfallbacks(target,original)
--- local properties = original.properties
--- if properties and properties.hasmath then
--- local specification = target.specification
--- if specification then
--- local fallbacks = specification.fallbacks
--- if fallbacks then
--- local definitions = fonts.collections.definitions[fallbacks]
--- if definitions then
--- if trace_collecting then
--- report_math("adding fallback characters to font %a",specification.hash)
--- end
--- local definedfont = fonts.definers.internal
--- local copiedglyph = fonts.handlers.vf.math.copy_glyph
--- local fonts = target.fonts
--- local size = specification.size -- target.size
--- local characters = target.characters
--- if not fonts then
--- fonts = { }
--- target.fonts = fonts
--- if not CONTEXTLMTXMODE or CONTEXTLMTXMODE == 0 then
--- target.type = "virtual"
--- target.properties.virtualized = true
--- end
--- end
--- if #fonts == 0 then
--- fonts[1] = { id = 0, size = size } -- sel, will be resolved later
--- end
--- local done = { }
--- for i=1,#definitions do
--- local definition = definitions[i]
--- local name = definition.font
--- local start = definition.start
--- local stop = definition.stop
--- local gaps = definition.gaps
--- local check = definition.check
--- local force = definition.force
--- local rscale = definition.rscale or 1
--- local offset = definition.offset or start
--- local id = definedfont { name = name, size = size * rscale }
--- local index = #fonts + 1
--- fonts[index] = { id = id, size = size }
--- local chars = fontchars[id]
--- local function remap(unic,unicode,gap)
--- -- local unic = unicode + offset - start
--- if check and not chars[unicode] then
--- -- not in font
--- elseif force or (not done[unic] and not characters[unic]) then
--- if trace_collecting then
--- report_math("remapping math character, vector %a, font %a, character %C%s%s",
--- fallbacks,name,unic,check and ", checked",gap and ", gap plugged")
--- end
--- characters[unic] = copiedglyph(target,characters,chars,unicode,index)
--- done[unic] = true
--- end
--- end
--- for unicode = start, stop do
--- local unic = unicode + offset - start
--- remap(unic,unicode,false)
--- end
--- if gaps then
--- for unic, unicode in next, gaps do
--- remap(unic,unicode,true)
--- end
--- end
--- end
--- end
--- end
--- end
--- end
--- end
---
--- sequencers.appendaction("aftercopyingcharacters", "system","mathematics.finishfallbacks")
-
local stack = { }
function mathematics.registerfallbackid(n,id,name)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-dim.lua b/Master/texmf-dist/tex/context/base/mkiv/math-dim.lua
index 06b4bbd97fd..c46e16faf6e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-dim.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-dim.lua
@@ -132,7 +132,6 @@ end
function mathematics.dimensions(dimens) -- beware, dimens get spoiled
if dimens.SpaceAfterScript then
- dimens.SubscriptShiftDownWithSuperscript = dimens.SubscriptShiftDown * 1.5 -- move this one
return table.fastcopy(dimens), { }
elseif dimens.AxisHeight or dimens.axis_height then
local t = { }
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-dir.lua b/Master/texmf-dist/tex/context/base/mkiv/math-dir.lua
index 38aa44358e2..f0298d2434c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-dir.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-dir.lua
@@ -36,8 +36,8 @@ local getattr = nuts.getattr
local setchar = nuts.setchar
local setlist = nuts.setlist
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local nodecodes = nodes.nodecodes
local enableaction = nodes.tasks.enableaction
@@ -65,8 +65,8 @@ local function processmath(head)
local start = nil
local stop = nil
local function capsulate()
- head = insert_node_before(head,start,new_direction(lefttoright_code))
- insert_node_after(head,stop,new_direction(lefttoright_code,true))
+ head = insertnodebefore(head,start,new_direction(lefttoright_code))
+ insertnodeafter(head,stop,new_direction(lefttoright_code,true))
if trace_directions then
report_directions("reversed: %s",nodes.listtoutf(start,false,false,stop))
end
@@ -142,6 +142,7 @@ function directions.processmath(head) -- style, penalties
return processmath(head)
end
end
+ return head
end
function directions.setmath(n)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-ext.lua b/Master/texmf-dist/tex/context/base/mkiv/math-ext.lua
index 762f1f904ed..1f78d6ad449 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-ext.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-ext.lua
@@ -27,7 +27,7 @@ local mathplus = { }
-- todo: store them and skip storage if already stored
-- todo: make a char-ctx.lua (or is this already side effect of save in format)
-local function addextra(unicode)
+function extras.add(unicode)
local min = mathematics.extrabase
local max = min + 0xFFF
if unicode >= min and unicode <= max then
@@ -41,8 +41,6 @@ local function addextra(unicode)
end
end
-extras.add = addextra
-
function extras.copy(target,original)
local characters = target.characters
local properties = target.properties
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-fbk.lua b/Master/texmf-dist/tex/context/base/mkiv/math-fbk.lua
index 6b43a901bdd..b4270462969 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-fbk.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-fbk.lua
@@ -7,6 +7,7 @@ if not modules then modules = { } end modules ['math-fbk'] = {
}
local next, type = next, type
+local floor = math.floor
local trace_fallbacks = false trackers.register("math.fallbacks", function(v) trace_fallbacks = v end)
@@ -32,6 +33,7 @@ local popcommand = helpers.commands.pop
local pushcommand = helpers.commands.push
local virtualcharacters = { }
+local virtualforced = { }
local hashes = fonts.hashes
local identifiers = hashes.identifiers
@@ -136,7 +138,7 @@ function fallbacks.apply(target,original)
local fullname = trace_fallbacks and target.properties.fullname
--
for k, v in sortedhash(virtualcharacters) do
- if not characters[k] then
+ if not characters[k] or virtualforced[k] then
local tv = type(v)
local cd = nil
if tv == "table" then
@@ -601,9 +603,11 @@ local function actuarian(data)
return {
-- todo: add alttext
-- compromise: lm has large hooks e.g. \actuarial{a}
- width = basewidth + 4 * linewidth,
- unicode = 0x20E7,
- commands = {
+ width = basewidth + 4 * linewidth,
+ height = basechar.height,
+ depth = basechar.depth,
+ unicode = 0x20E7,
+ commands = {
rightcommand[2 * linewidth],
downcommand[- baseheight - 3 * linewidth],
{ "rule", linewidth, basewidth + 4 * linewidth },
@@ -623,13 +627,15 @@ local function equals(data,unicode,snippet,advance,n) -- mathpair needs them
local basechar = characters[snippet]
local advance = advance * parameters.quad
return {
- unicode = unicode,
- width = n*basechar.width + (n-1)*advance,
- commands = {
+ unicode = unicode,
+ width = n*basechar.width - (n-1)*advance,
+ height = basechar.height,
+ depth = basechar.depth,
+ commands = {
charcommand[snippet],
- rightcommand[advance],
+ leftcommand[advance],
charcommand[snippet],
- n > 2 and rightcommand[advance] or nil,
+ n > 2 and leftcommand[advance] or nil,
n > 2 and charcommand[snippet] or nil,
},
}
@@ -694,3 +700,30 @@ virtualcharacters[0x305] = function(data)
}
end
+local function threedots(data,shift)
+ local characters = data.target.characters
+ local parameters = data.target.parameters
+ local periodchar = characters[0x002E]
+ local pluschar = characters[0x002B]
+ local period = charcommand[0x002E]
+ local periodwd = periodchar.width or 0
+ local periodht = periodchar.height or 0
+ local perioddp = periodchar.depth or 0
+ local offset = 0
+ if shift then
+ local plusht = pluschar.height or 0
+ local plusdp = pluschar.depth or 0
+ local axis = floor((plusdp + plusht)/2) - plusdp
+ offset = axis - floor(periodht/2)
+ periodht = axis + floor(periodht/2)
+ end
+ return {
+ width = 3*periodwd,
+ height = periodht,
+ depth = 0,
+ commands = { upcommand[offset], period, period, period }
+ }
+end
+
+virtualcharacters[0x2026] = function(data) return threedots(data,false) end virtualforced[0x2026] = true
+virtualcharacters[0x22EF] = function(data) return threedots(data, true) end virtualforced[0x22EF] = true
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-frc.lua b/Master/texmf-dist/tex/context/base/mkiv/math-frc.lua
index fa3ac515fe1..4a04c920316 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-frc.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-frc.lua
@@ -57,41 +57,3 @@ interfaces.implement {
actions = mathfraction,
arguments = { "string", "number", "number", "dimen" }
}
-
--- experimental code in lmtx
-
-if CONTEXTLMTXMODE > 0 then
-
- local ctx_Uatop = context.Uatop
- local ctx_Uover = context.Uover
-
- local function umathfraction(how,left,right,width)
- if how == v_no then
- if left == 0x002E and right == 0x002E then
- ctx_Uatop()
- else
- context("\\Uatopwithdelims%s%s",resolved[left],resolved[right])
- end
- elseif how == v_yes or how == v_hidden then
- local norule = how == v_hidden and " norule " or ""
- if left == 0x002E and right == 0x002E then
- context("\\Uabove%s%ssp",norule,width)
- else
- context("\\Uabovewithdelims%s%s%s%ssp",norule,resolved[left],resolved[right],width)
- end
- else -- v_auto
- if left == 0x002E and right == 0x002E then
- ctx_Uover()
- else
- context("\\Uoverwithdelims%s%s",resolved[left],resolved[right])
- end
- end
- end
-
- interfaces.implement {
- name = "umathfraction",
- actions = umathfraction,
- arguments = { "string", "number", "number", "dimen" }
- }
-
-end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/math-ini.lua
index 19bf868020a..688f682c8ac 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-ini.lua
@@ -31,6 +31,8 @@ local ctx_doifelsesomething = commands.doifelsesomething
local trace_defining = false trackers.register("math.defining", function(v) trace_defining = v end)
+-- trace_defining = true
+
local report_math = logs.reporter("mathematics","initializing")
mathematics = mathematics or { }
@@ -55,78 +57,96 @@ local families = allocate {
--- to be checked .. afew defaults in char-def that should be alpha
local classes = allocate {
- ord = 0, -- mathordcomm mathord
- op = 1, -- mathopcomm mathop
- bin = 2, -- mathbincomm mathbin
- rel = 3, -- mathrelcomm mathrel
- open = 4, -- mathopencomm mathopen
- middle = 4,
- close = 5, -- mathclosecomm mathclose
- punct = 6, -- mathpunctcomm mathpunct
- alpha = 7, -- mathalphacomm firstofoneargument
- accent = 8, -- class 0
- radical = 9,
- xaccent = 10, -- class 3
- topaccent = 11, -- class 0
- botaccent = 12, -- class 0
- under = 13,
- over = 14,
- delimiter = 15,
- inner = 0, -- mathinnercomm mathinner
- nothing = 0, -- mathnothingcomm firstofoneargument
- choice = 0, -- mathchoicecomm @@mathchoicecomm
- box = 0, -- mathboxcomm @@mathboxcomm
- limop = 1, -- mathlimopcomm @@mathlimopcomm
- nolop = 1, -- mathnolopcomm @@mathnolopcomm
+ ord = 0, -- mathordcomm mathord
+ op = 1, -- mathopcomm mathop
+ bin = 2, -- mathbincomm mathbin
+ rel = 3, -- mathrelcomm mathrel
+ open = 4, -- mathopencomm mathopen
+ middle = 4,
+ close = 5, -- mathclosecomm mathclose
+ punct = 6, -- mathpunctcomm mathpunct
+ alpha = 7, -- mathalphacomm firstofoneargument
+ accent = 8, -- class 0
+ radical = 9,
+ xaccent = 10, -- class 3
+ topaccent = 11, -- class 0
+ botaccent = 12, -- class 0
+ under = 13,
+ over = 14,
+ delimiter = 15,
+ division = 15,
+ inner = 0, -- mathinnercomm mathinner
+ choice = 0, -- mathchoicecomm @@mathchoicecomm
+ prime = 0,
+ differential = 0,
+ exponential = 0,
+ limop = 1, -- mathlimopcomm @@mathlimopcomm
+ nolop = 1, -- mathnolopcomm @@mathnolopcomm
--
- ordinary = 0, -- ord
- alphabetic = 7, -- alpha
- unknown = 0, -- nothing
- default = 0, -- nothing
- punctuation = 6, -- punct
- normal = 0, -- nothing
- opening = 4, -- open
- closing = 5, -- close
- binary = 2, -- bin
- relation = 3, -- rel
- fence = 0, -- unknown
- diacritic = 8, -- accent
- large = 1, -- op
- variable = 7, -- alphabetic
- number = 7, -- alphabetic
- root = 16, -- a private one
+ ordinary = 0, -- ord
+ alphabetic = 7, -- alpha
+ punctuation = 6, -- punct
+ opening = 4, -- open
+ closing = 5, -- close
+ binary = 2, -- bin
+ relation = 3, -- rel
+ diacritic = 8, -- accent
+ large = 1, -- op
+ variable = 7, -- alphabetic
+ number = 7, -- alphabetic
+ root = 16, -- a private one
}
-local open_class = 4
-local middle_class = 4
-local close_class = 5
-local accent_class = 8
-local radical_class = 9
-local topaccent_class = 11
-local botaccent_class = 12
-local under_class = 13
-local over_class = 14
-local delimiter_class = 15
-local root_class = 16
+local engineclasses = table.setmetatableindex(function(t,k)
+ if k then
+ local c = tonumber(k) or classes[k] or 0
+ local v = c < 8 and c or 0
+ t[k] = v
+ return v
+ else
+ return 0
+ end
+end)
+
+local ordinary_class = classes.ordinary
+local open_class = classes.open
+local middle_class = classes.middle
+local close_class = classes.close
+local accent_class = classes.accent
+local radical_class = classes.radical
+local topaccent_class = classes.topaccent
+local botaccent_class = classes.botaccent
+local under_class = classes.under
+local over_class = classes.over
+local delimiter_class = classes.delimiter
+local division_class = classes.division
+local root_class = classes.root
local accents = allocate {
accent = true, -- some can be both
- topaccent = true, [11] = true,
- botaccent = true, [12] = true,
- under = true, [13] = true,
- over = true, [14] = true,
+ topaccent = true, [topaccent_class] = true,
+ botaccent = true, [botaccent_class] = true,
+ under = true, [under_class] = true,
+ over = true, [over_class] = true,
unknown = false,
}
+-- engine subtypes get from elsewhere
+
local codes = allocate {
- ordinary = 0, [0] = "ordinary",
- largeoperator = 1, [1] = "largeoperator",
- binaryoperator = 2, [2] = "binaryoperator",
- relation = 3, [3] = "relation",
- openingsymbol = 4, [4] = "openingsymbol",
- closingsymbol = 5, [5] = "closingsymbol",
- punctuation = 6, [6] = "punctuation",
- variable = 7, [7] = "variable",
+ ordinary = 0, [ 0] = "ordinary",
+ largeoperator = 1, [ 1] = "largeoperator",
+ binaryoperator = 2, [ 2] = "binaryoperator",
+ relation = 3, [ 3] = "relation",
+ openingsymbol = 4, [ 4] = "openingsymbol",
+ closingsymbol = 5, [ 5] = "closingsymbol",
+ punctuation = 6, [ 6] = "punctuation",
+ -- inner = 7, [ 7] = "inner",
+ -- undersymbol = 8, [ 8] = "undersymbol",
+ -- oversymbol = 9, [ 9] = "oversymbol",
+ -- fractionsymbol = 10, [10] = "fractionsymbol",
+ -- radicalsymbol = 11, [11] = "radicalsymbol",
+ middlesymbol = 12, [12] = "middlesymbol",
}
local extensibles = allocate {
@@ -176,257 +196,206 @@ mathematics.codes = codes
mathematics.families = families
mathematics.virtualized = virtualized
--- there will be proper functions soon (and we will move this code in-line)
--- no need for " in class and family (saves space)
-
--- local function mathchar(class,family,slot)
--- return formatters['\\Umathchar "%X "%X "%X '](class,family,slot)
--- end
---
--- local function mathaccent(class,family,slot)
--- return formatters['\\Umathaccent "%X "%X "%X '](0,family,slot) -- no class
--- end
---
--- local function delimiter(class,family,slot)
--- return formatters['\\Udelimiter "%X "%X "%X '](class,family,slot)
--- end
---
--- local function radical(family,slot)
--- return formatters['\\Uradical "%X "%X '](family,slot)
--- end
---
--- local function root(family,slot)
--- return formatters['\\Uroot "%X "%X '](family,slot)
--- end
---
--- local function mathchardef(name,class,family,slot)
--- return formatters['\\Umathchardef\\%s "%X "%X "%X '](name,class,family,slot)
--- end
---
--- local function mathcode(target,class,family,slot)
--- return formatters['\\Umathcode%s="%X "%X "%X '](target,class,family,slot)
--- end
---
--- local function mathtopaccent(class,family,slot)
--- return formatters['\\Umathaccent "%X "%X "%X '](0,family,slot) -- no class
--- end
---
--- local function mathbotaccent(class,family,slot)
--- return formatters['\\Umathaccent bottom "%X "%X "%X '](0,family,slot) -- no class
--- end
---
--- local function mathtopdelimiter(class,family,slot)
--- return formatters['\\Udelimiterover "%X "%X '](family,slot) -- no class
--- end
---
--- local function mathbotdelimiter(class,family,slot)
--- return formatters['\\Udelimiterunder "%X "%X '](family,slot) -- no class
--- end
-
local escapes = characters.filters.utf.private.escapes
--- not that many so no need to reuse tables
+do
-local setmathcharacter = function(class,family,slot,unicode,mset,dset)
- if mset and codes[class] then -- regular codes < 7
- setmathcode("global",slot,class,family,unicode)
- mset = false
- end
- if dset and class == open_class or class == close_class or class == middle_class then
- setdelcode("global",slot,family,unicode,0,0)
- dset = false
+ local setmathcharacter = function(class,family,slot,unicode,mset,dset)
+ if mset and codes[class] then -- regular codes < 7
+ setmathcode("global",slot,class,family,unicode)
+ mset = false
+ end
+ if dset and (class == open_class or class == close_class or class == middle_class or class == division_class) then
+ setdelcode("global",slot,family,unicode,0,0)
+ dset = false
+ end
+ return mset, dset
end
- return mset, dset
-end
-
--- todo: make nice setters for this in lua
-
-local f_accent = formatters[ [[\defUmathtopaccent \%s{%X}{%X}{%X}]] ]
-local f_topaccent = formatters[ [[\defUmathtopaccent \%s{%X}{%X}{%X}]] ]
-local f_botaccent = formatters[ [[\defUmathbotaccent \%s{%X}{%X}{%X}]] ]
-local f_over = formatters[ [[\defUdelimiterover \%s{%X}{%X}{%X}]] ]
-local f_under = formatters[ [[\defUdelimiterunder\%s{%X}{%X}{%X}]] ]
-local f_fence = formatters[ [[\defUdelimiter \%s{%X}{%X}{%X}]] ]
-local f_delimiter = formatters[ [[\defUdelimiter \%s{%X}{%X}{%X}]] ]
-local f_radical = formatters[ [[\defUradical \%s{%X}{%X}]] ]
-local f_root = formatters[ [[\defUroot \%s{%X}{%X}]] ]
-local f_char = formatters[ [[\defUmathchar \%s{%X}{%X}{%X}]] ]
-
-local texmathchardef = tex.mathchardef
-
--- local setmathsymbol = function(name,class,family,slot) -- hex is nicer for tracing
--- if class == classes.accent then
--- ctx_sprint(f_topaccent(name,0,family,slot))
--- elseif class == classes.topaccent then
--- ctx_sprint(f_topaccent(name,0,family,slot))
--- elseif class == classes.botaccent then
--- ctx_sprint(f_botaccent(name,0,family,slot))
--- elseif class == classes.over then
--- ctx_sprint(f_over(name,0,family,slot))
--- elseif class == classes.under then
--- ctx_sprint(f_under(name,0,family,slot))
--- elseif class == open_class or class == close_class or class == middle_class then
--- setdelcode("global",slot,{family,slot,0,0})
--- ctx_sprint(f_fence(name,class,family,slot))
--- elseif class == classes.delimiter then
--- setdelcode("global",slot,{family,slot,0,0})
--- ctx_sprint(f_delimiter(name,0,family,slot))
--- elseif class == classes.radical then
--- ctx_sprint(f_radical(name,family,slot))
--- elseif class == classes.root then
--- ctx_sprint(f_root(name,family,slot))
--- elseif texmathchardef then
--- texmathchardef(name,class,family,slot,"permanent")
--- else
--- -- beware, open/close and other specials should not end up here
--- ctx_sprint(f_char(name,class,family,slot))
--- end
--- end
-local setmathsymbol = function(name,class,family,slot) -- hex is nicer for tracing
- if class == accent_class then
- ctx_sprint(f_topaccent(name,0,family,slot))
- elseif class == topaccent_class then
- ctx_sprint(f_topaccent(name,0,family,slot))
- elseif class == botaccent_class then
- ctx_sprint(f_botaccent(name,0,family,slot))
- elseif class == over_class then
- ctx_sprint(f_over(name,0,family,slot))
- elseif class == under_class then
- ctx_sprint(f_under(name,0,family,slot))
- elseif class == open_class or class == close_class or class == middle_class then
- setdelcode("global",slot,{family,slot,0,0})
- ctx_sprint(f_fence(name,class,family,slot))
- elseif class == delimiter_class then
- setdelcode("global",slot,{family,slot,0,0})
- ctx_sprint(f_delimiter(name,0,family,slot))
- elseif class == radical_class then
- ctx_sprint(f_radical(name,family,slot))
- elseif class == root_class then
- ctx_sprint(f_root(name,family,slot))
- elseif texmathchardef then
- texmathchardef(name,class,family,slot,"permanent")
- else
- -- beware, open/close and other specials should not end up here
- ctx_sprint(f_char(name,class,family,slot))
+ local function report(class,engine,family,unicode,name)
+ local nametype = type(name)
+ if nametype == "string" then
+ report_math("class %a, engine %a, family %a, char %C, name %a",class,engine,family,unicode,name)
+ elseif nametype == "number" then
+ report_math("class %a, engine %a, family %a, char %C, number %U",class,engine,family,unicode,name)
+ else
+ report_math("class %a, engine %a, family %a, char %C",class,engine,family,unicode)
+ end
end
-end
-local function report(class,family,unicode,name)
- local nametype = type(name)
- if nametype == "string" then
- report_math("class name %a, class %a, family %a, char %C, name %a",classname,class,family,unicode,name)
- elseif nametype == "number" then
- report_math("class name %a, class %a, family %a, char %C, number %U",classname,class,family,unicode,name)
- else
- report_math("class name %a, class %a, family %a, char %C", classname,class,family,unicode)
+ local f_accent = formatters[ [[\defUmathtopaccent \%s{%X}{%X}{%X}]] ]
+ local f_topaccent = formatters[ [[\defUmathtopaccent \%s{%X}{%X}{%X}]] ]
+ local f_botaccent = formatters[ [[\defUmathbotaccent \%s{%X}{%X}{%X}]] ]
+ local f_over = formatters[ [[\defUdelimiterover \%s{%X}{%X}{%X}]] ]
+ local f_under = formatters[ [[\defUdelimiterunder\%s{%X}{%X}{%X}]] ]
+ local f_fence = formatters[ [[\defUdelimiter \%s{%X}{%X}{%X}]] ]
+ local f_delimiter = formatters[ [[\defUdelimiter \%s{%X}{%X}{%X}]] ]
+ local f_radical = formatters[ [[\defUradical \%s{%X}{%X}]] ]
+ local f_root = formatters[ [[\defUroot \%s{%X}{%X}]] ]
+ local f_char = formatters[ [[\defUmathchar \%s{%X}{%X}{%X}]] ]
+
+ local texmathchardef = tex.mathchardef
+
+ local setmathsymbol = function(name,class,engine,family,slot) -- hex is nicer for tracing
+ if class == accent_class then
+ ctx_sprint(f_topaccent(name,0,family,slot))
+ elseif class == topaccent_class then
+ ctx_sprint(f_topaccent(name,0,family,slot))
+ elseif class == botaccent_class then
+ ctx_sprint(f_botaccent(name,0,family,slot))
+ elseif class == over_class then
+ ctx_sprint(f_over(name,0,family,slot))
+ elseif class == under_class then
+ ctx_sprint(f_under(name,0,family,slot))
+ elseif class == open_class or class == close_class or class == middle_class then
+ setdelcode("global",slot,{family,slot,0,0})
+ ctx_sprint(f_fence(name,engine,family,slot))
+ elseif class == delimiter_class then
+ setdelcode("global",slot,{family,slot,0,0})
+ ctx_sprint(f_delimiter(name,0,family,slot))
+ elseif class == radical_class then
+ ctx_sprint(f_radical(name,family,slot))
+ elseif class == root_class then
+ ctx_sprint(f_root(name,family,slot))
+ elseif texmathchardef then
+ texmathchardef(name,engine,family,slot,"permanent")
+ else
+ -- beware, open/close and other specials should not end up here
+ ctx_sprint(f_char(name,engine,family,slot))
+ end
end
-end
--- there will be a combined \(math)chardef (tracker)
-
-function mathematics.define(family)
- family = family or 0
- family = families[family] or family
- local data = characters.data
- for unicode, character in sortedhash(data) do
- local symbol = character.mathsymbol
- local mset = true
- local dset = true
- if symbol then
- local other = data[symbol]
- local class = other.mathclass
- if class then
- class = classes[class] or class -- no real checks needed
- if trace_defining then
- report(class,family,unicode,symbol)
- end
- mset, dset = setmathcharacter(class,family,unicode,symbol,mset,dset)
+ function mathematics.define(family)
+ family = family or 0
+ family = families[family] or family
+ local data = characters.data
+ --
+ local function remap(first,last)
+ for unicode=utfbyte(first),utfbyte(last) do
+ setmathcode("global",unicode,ordinary_class,family,unicode)
end
- local spec = other.mathspec
- if spec then
- for i=1,#spec do
- local m = spec[i]
- local class = m.class
- if class then
- class = classes[class] or class -- no real checks needed
- mset, dset = setmathcharacter(class,family,unicode,symbol,mset,dset)
+ end
+ remap("0","9")
+ remap("A","Z")
+ remap("a","z")
+ --
+ for unicode, character in sortedhash(data) do
+ local symbol = character.mathsymbol
+ local mset = true
+ local dset = true
+ if symbol then
+ local other = data[symbol]
+ local class = other.mathclass
+ if class then
+ local engine = engineclasses[class]
+ if trace_defining then
+ report(class,engine,family,unicode,symbol)
end
+ mset, dset = setmathcharacter(engine,family,unicode,symbol,mset,dset)
end
- end
- end
- local mathclass = character.mathclass
- local mathspec = character.mathspec
- if mathspec then
- if mathclass then
- local name = character.mathname
- if name then
- report_math("fatal error, conflicting mathclass and mathspec for %C",unicode)
- os.exit()
- else
- local class = classes[mathclass] or mathclass -- no real checks needed
- if not class then
- if trace_defining then
- report("unknown",family,unicode)
+ local spec = other.mathspec
+ if spec then
+ for i=1,#spec do
+ local m = spec[i]
+ local class = m.class
+ if class then
+ local engine = engineclasses[class]
+ -- todo: trace
+ mset, dset = setmathcharacter(engine,family,unicode,symbol,mset,dset)
end
- else
- if trace_defining then
- report(class,family,unicode)
- end
- mset, dset = setmathcharacter(class,family,unicode,unicode,mset,dset)
end
end
end
- for i=1,#mathspec do
- local m = mathspec[i]
- local name = m.name
- local class = m.class
+ local class = character.mathclass
+ local spec = character.mathspec
+ local name = character.mathname
+ if spec then
+ local done = false
if class then
- class = classes[class] or class -- no real checks needed
if name then
+ report_math("fatal error, conflicting mathclass and mathspec for %C",unicode)
+ os.exit()
+ else
+ class = classes[class] or ordinary_class
+ local engine = engineclasses[class]
if trace_defining then
- report(class,family,unicode,name)
+ report(class,engine,family,unicode)
end
- setmathsymbol(name,class,family,unicode)
+ mset, dset = setmathcharacter(engine,family,unicode,unicode,mset,dset)
+ done = true
+ end
+ end
+ for i=1,#spec do
+ local m = spec[i]
+ local name = m.name
+ local class = m.class or class
+ if class then
+ class = classes[class] or ordinary_class
else
- name = (class == classes.variable or class == classes.number) and character.adobename -- bad
- if name and trace_defining then
- report(class,family,unicode,name)
+ class = ordinary_class
+ end
+ if class then
+ local engine = engineclasses[class]
+ if name then
+ if trace_defining then
+ report(class,engine,family,unicode,name)
+ end
+ setmathsymbol(name,class,engine,family,unicode)
+ else
+ name = (class == classes.ordinary or class == classes.digit) and character.adobename -- bad
+ if name and trace_defining then
+ report(class,engine,family,unicode,name)
+ end
+ end
+ if not done then
+ mset, dset = setmathcharacter(engine,family,unicode,m.unicode or unicode,mset,dset) -- see solidus
+ done = true
end
end
- mset, dset = setmathcharacter(class,family,unicode,m.unicode or unicode,mset,dset) -- see solidus
- end
- end
- elseif mathclass then
- local name = character.mathname
- local class = classes[mathclass] or mathclass -- no real checks needed
- if not class then
- if trace_defining then
- report("unknown",family,unicode,name)
end
- elseif name == false then
- if trace_defining then
- report(class,family,unicode,name)
- end
- mset, dset = setmathcharacter(class,family,unicode,unicode,mset,dset)
else
- -- if not name then
- -- name = character.contextname -- too dangerous, we loose textslash and a few more
- -- end
- if name then
- if trace_defining then
- report(class,family,unicode,name)
- end
- setmathsymbol(name,class,family,unicode)
+ if class then
+ class = classes[class] or ordinary_class
else
+ class = ordinary_class
+ end
+ if name ~= nil then
+ local engine = engineclasses[class]
+ if name == false then
+ if trace_defining then
+ report(class,engine,family,unicode,name)
+ end
+ mset, dset = setmathcharacter(engine,family,unicode,unicode,mset,dset)
+ else
+ -- if not name then
+ -- name = character.contextname -- too dangerous, we loose textslash and a few more
+ -- end
+ if name then
+ if trace_defining then
+ report(class,engine,family,unicode,name)
+ end
+ setmathsymbol(name,class,engine,family,unicode)
+ else
+ if trace_defining then
+ report(class,engine,family,unicode,character.adobename)
+ end
+ end
+ mset, dset = setmathcharacter(engine,family,unicode,unicode,mset,dset)
+ end
+ elseif class ~= ordinary_class then
+ local engine = engineclasses[class]
if trace_defining then
- report(class,family,unicode,character.adobename)
+ report(class,engine,family,unicode,character.adobename)
end
+ mset, dset = setmathcharacter(engine,family,unicode,unicode,mset,dset)
end
- mset, dset = setmathcharacter(class,family,unicode,unicode,mset,dset)
end
end
+ if trace_defining then
+ logs.stopfilelogging()
+ end
end
+
end
-- needed for mathml analysis
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/math-ini.mkiv
index d0e18ff4b1b..a955e9284f5 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-ini.mkiv
@@ -324,18 +324,30 @@
% e.g.: \definemathematics[i:mp][setups=i:tight,openup=yes]
-\newmuskip\defaultthickmuskip \defaultthickmuskip 5mu plus 5mu
-\newmuskip\defaultmedmuskip \defaultmedmuskip 4mu plus 2mu minus 4mu
-\newmuskip\defaultthinmuskip \defaultthinmuskip 3mu
+\newmuskip\defaultthickmuskip \defaultthickmuskip 5mu plus 5mu
+\newmuskip\defaultmedmuskip \defaultmedmuskip 4mu plus 2mu minus 4mu
+\newmuskip\defaultthinmuskip \defaultthinmuskip 3mu
-\newmuskip\halfthickmuskip \halfthickmuskip 2.5mu plus 2.5mu
-\newmuskip\halfmedmuskip \halfmedmuskip 2.0mu plus 1.0mu minus 2.0mu
-\newmuskip\halfthinmuskip \halfthinmuskip 1.5mu
+\newmuskip\halfthickmuskip \halfthickmuskip 2.5mu plus 2.5mu
+\newmuskip\halfmedmuskip \halfmedmuskip 2.0mu plus 1.0mu minus 2.0mu
+\newmuskip\halfthinmuskip \halfthinmuskip 1.5mu
-\newcount \defaultrelpenalty \defaultrelpenalty 500
-\newcount \defaultbinoppenalty \defaultbinoppenalty 700
-\newcount \defaultprerelpenalty \defaultprerelpenalty -100
-\newcount \defaultprebinoppenalty \defaultprebinoppenalty -100
+\newcount \defaultrelpenalty \defaultrelpenalty 500
+\newcount \defaultbinoppenalty \defaultbinoppenalty 700
+\newcount \defaultprerelpenalty \defaultprerelpenalty -100
+\newcount \defaultprebinoppenalty \defaultprebinoppenalty -100
+\newcount \defaultdisplayprepenalty \defaultdisplayprepenalty -10
+
+% For the moment this way:
+
+% \appendtoks
+% \setmathprepenalty \mathbinarycode \defaultdisplayprepenalty
+% % \setmathpostpenalty\mathbinarycode \zerocount
+% \setmathprepenalty \mathrelationcode \defaultdisplayprepenalty
+% % \setmathpostpenalty\mathrelationcode \zerocount
+% \setmathpostpenalty\mathtextpunctuationcode\defaultdisplayprepenalty
+% % \setmathprepenalty \mathtextpunctuationcode\zerocount
+% \to \everybeforedisplayformula
% we need to control these otherwise:
%
@@ -1586,11 +1598,11 @@
% \unexpanded\def\disablemathpunctuation{\setfalse\automathpunctuation}
%
% \appendtoks
-% \doifelse{\mathematicsparameter\v!autopunctuation}\v!yes\settrue\setfalse\automathpunctuation
+% \doifelse{\mathematicsparameter\c!autopunctuation}\v!yes\settrue\setfalse\automathpunctuation
% \to \everyswitchmathematics
%
% \setupmathematics
-% [\v!autopunctuation=\v!no]
+% [\c!autopunctuation=\v!no]
%
% \def\math_punctuation_next{\ifx\nexttoken\blankspace\signalcharacter\fi}
%
@@ -1676,9 +1688,9 @@
\let\math_punctuation_yes_period \math_punctuation_nop_period
\let\math_punctuation_yes_semicolon\math_punctuation_all_semicolon
-\def\math_punctuation_comma_next {\begingroup\Umathcode\c_math_comma \ifx\nexttoken\blankspace\mathordcode\else\mathordcode\fi\zerocount\c_math_comma ,\endgroup}
-\def\math_punctuation_period_next {\begingroup\Umathcode\c_math_period \ifx\nexttoken\blankspace\mathordcode\else\mathordcode\fi\zerocount\c_math_period .\endgroup}
-\def\math_punctuation_semicolon_next{\begingroup\Umathcode\c_math_semicolon\ifx\nexttoken\blankspace\mathordcode\else\mathordcode\fi\zerocount\c_math_semicolon;\endgroup}
+\def\math_punctuation_comma_next {\begingroup\Umathcode\c_math_comma \ifx\nexttoken\blankspace\mathpunctcode\else\mathordcode\fi\zerocount\c_math_comma ,\endgroup}
+\def\math_punctuation_period_next {\begingroup\Umathcode\c_math_period \ifx\nexttoken\blankspace\mathpunctcode\else\mathordcode\fi\zerocount\c_math_period .\endgroup}
+\def\math_punctuation_semicolon_next{\begingroup\Umathcode\c_math_semicolon\ifx\nexttoken\blankspace\mathpunctcode\else\mathordcode\fi\zerocount\c_math_semicolon;\endgroup}
\installcorenamespace {mathautopunctuation}
@@ -1745,12 +1757,12 @@
\mathcode\c_math_comma \c_math_special
\mathcode\c_math_period \c_math_special
\mathcode\c_math_semicolon\c_math_special
- \begincsname\??mathautopunctuation\mathematicsparameter\v!autopunctuation\endcsname
+ \begincsname\??mathautopunctuation\mathematicsparameter\c!autopunctuation\endcsname
\to \everymathematics
\appendtoks
- \ifcsname\??mathautopunctuation\mathematicsparameter\v!autopunctuation\endcsname \else
- \letmathematicsparameter\v!autopunctuation\v!no
+ \ifcsname\??mathautopunctuation\mathematicsparameter\c!autopunctuation\endcsname \else
+ \letmathematicsparameter\c!autopunctuation\v!no
\fi
\to \everysetupmathematics
@@ -1758,7 +1770,7 @@
\def\disablemathpunctuation{\csname\??mathautopunctuation\v!yes\endcsname}
\setupmathematics
- [\v!autopunctuation=\v!no] % no | yes | all | comma | yes,semicolon | all,semicolon
+ [\c!autopunctuation=\v!no] % no | yes | all | comma | yes,semicolon | all,semicolon
%D The consequences of setting this are as follows:
%D
@@ -2931,6 +2943,10 @@
\math_openup_parameter#1{#2}%
\fi}
+%D For now (needed in asciimath):
+
+\def\math_relax_limits{\let\limits\relax}
+
\protect \endinput
% % not used (yet)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-int.mkiv b/Master/texmf-dist/tex/context/base/mkiv/math-int.mkiv
index 5876eb7bb25..0920415f902 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-int.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-int.mkiv
@@ -68,8 +68,8 @@
\to \everyswitchmathematics
\setupmathematics
-% [\v!integral=nolimits]
- [\v!integral=autolimits]
+% [\c!integral=nolimits]
+ [\c!integral=autolimits]
%D The following code is used for fallbacks and might become obsolete once
%D we have enough \OPENTYPE\ math fonts.
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-map.lua b/Master/texmf-dist/tex/context/base/mkiv/math-map.lua
index 97860b923ba..5f93b43fc6c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-map.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-map.lua
@@ -689,9 +689,9 @@ local issygreek = regular_tf.symbols
local isgreek = merged(islcgreek,isucgreek,issygreek)
local greekremapping = {
- [1] = { what = "unchanged" }, -- upright
- [2] = { what = "upright", it = "tf", bi = "bf" }, -- upright
- [3] = { what = "italic", tf = "it", bf = "bi" }, -- italic
+ { what = "unchanged" }, -- upright
+ { what = "upright", it = "tf", bi = "bf" }, -- upright
+ { what = "italic", tf = "it", bf = "bi" }, -- italic
}
local usedremap = { }
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-noa.lua b/Master/texmf-dist/tex/context/base/mkiv/math-noa.lua
index 1fb763a3b6c..fd4b8221583 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-noa.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-noa.lua
@@ -55,7 +55,7 @@ local trace_processing = false registertracker("math.processing", function(v
local trace_analyzing = false registertracker("math.analyzing", function(v) trace_analyzing = v end)
local trace_normalizing = false registertracker("math.normalizing", function(v) trace_normalizing = v end)
local trace_collapsing = false registertracker("math.collapsing", function(v) trace_collapsing = v end)
-local trace_fixing = false registertracker("math.fixing", function(v) trace_foxing = v end)
+local trace_fixing = false registertracker("math.fixing", function(v) trace_fixing = v end)
local trace_patching = false registertracker("math.patching", function(v) trace_patching = v end)
local trace_goodies = false registertracker("math.goodies", function(v) trace_goodies = v end)
local trace_variants = false registertracker("math.variants", function(v) trace_variants = v end)
@@ -134,12 +134,12 @@ local setsup = nuts.setsup
local setsubpre = nuts.setsubpre
local setsuppre = nuts.setsuppre
-local flush_node = nuts.flush
+local flushnode = nuts.flush
local copy_node = nuts.copy
local slide_nodes = nuts.slide
local set_visual = nuts.setvisual
-local mlist_to_hlist = nuts.mlist_to_hlist
+local mlisttohlist = nuts.mlisttohlist
local new_kern = nodepool.kern
local new_submlist = nodepool.submlist
@@ -185,7 +185,7 @@ local opdisplaylimitsnoad_code = noadcodes.opdisplaylimits
local oplimitsnoad_code = noadcodes.oplimits
local opnolimitsnoad_code = noadcodes.opnolimits
local binnoad_code = noadcodes.bin
-local relnode_code = noadcodes.rel
+local relnoad_code = noadcodes.rel
local opennoad_code = noadcodes.open
local closenoad_code = noadcodes.close
local punctnoad_code = noadcodes.punct
@@ -465,7 +465,7 @@ local function errorchar(font,char)
return fake
else
local kind, fake = fonts.checkers.placeholder(font,char)
- if not fake or kind ~= "char" then
+ if not fake or kind ~= "char" then -- Also check for "with" here?
fake = 0x3F
end
cached[font][char] = fake
@@ -884,7 +884,7 @@ do
end
setchar(d,chr)
setfam(d,fam)
- flush_node(sym)
+ flushnode(sym)
end
setattrlist(d,char)
setattrlist(f,char)
@@ -930,7 +930,7 @@ do
if midl then
local fence = makefence(middlefence_code,current)
setnucleus(current)
- flush_node(current)
+ flushnode(current)
middle[current] = nil
-- replace_node
setlink(prev,fence,next)
@@ -956,7 +956,7 @@ do
local f_c = makefence(rightfence_code,close)
makelist(middle,open,f_o,o_next,c_prev,f_c)
setnucleus(close)
- flush_node(close)
+ flushnode(close)
-- open is now a list
setlink(open,c_next)
return open
@@ -1795,7 +1795,7 @@ do
[oplimitsnoad_code] = true,
[opnolimitsnoad_code] = true,
[binnoad_code] = true, -- new
- [relnode_code] = true,
+ [relnoad_code] = true,
[opennoad_code] = true, -- new
[closenoad_code] = true, -- new
[punctnoad_code] = true, -- new
@@ -1883,7 +1883,7 @@ do
end
while c ~= l do
local n = getnext(c)
- flush_node(c)
+ flushnode(c)
c = n
end
setlink(parent,l)
@@ -1930,8 +1930,6 @@ do
mathematics.virtualize(movesub)
- local options_supported = tokens.defined("Unosuperscript")
-
local function fixsupscript(parent,current,current_char,new_char)
if new_char ~= current_char and new_char ~= true then
setchar(current,new_char)
@@ -1943,9 +1941,7 @@ do
report_fixing("fixing subscript, superscript %U",current_char)
end
end
- if options_supported then
- setfield(parent,"options",0x08+0x22)
- end
+ setfield(parent,"options",0x08+0x22)
end
-- local function movesubscript(parent,current_nucleus,oldchar,newchar)
@@ -2097,7 +2093,7 @@ do
end
setprev(next,pointer)
setnext(parent,getnext(next))
- flush_node(next)
+ flushnode(next)
end
end
end
@@ -2116,7 +2112,7 @@ do
local classes = { }
local colors = {
- [relnode_code] = "trace:dr",
+ [relnoad_code] = "trace:dr",
[ordnoad_code] = "trace:db",
[binnoad_code] = "trace:dg",
[opennoad_code] = "trace:dm",
@@ -2175,7 +2171,7 @@ do
local permitted = {
ordinary = ordnoad_code,
binary = binnoad_code,
- relation = relnode_code,
+ relation = relnoad_code,
punctuation = punctnoad_code,
inner = innernoad_code,
}
@@ -2350,16 +2346,10 @@ do
-- force_penalties = v
-- end)
- function builders.kernel.mlist_to_hlist(head,style,penalties)
- return mlist_to_hlist(head,style,force_penalties or penalties)
+ function builders.kernel.mlisttohlist(head,style,penalties)
+ return mlisttohlist(head,style,force_penalties or penalties)
end
- -- function builders.kernel.mlist_to_hlist(head,style,penalties)
- -- local h = mlist_to_hlist(head,style,force_penalties or penalties)
- -- inspect(nodes.totree(h,true,true,true))
- -- return h
- -- end
-
implement {
name = "setmathpenalties",
arguments = "integer",
@@ -2374,14 +2364,14 @@ local actions = tasks.actions("math") -- head, style, penalties
local starttiming, stoptiming = statistics.starttiming, statistics.stoptiming
-function processors.mlist_to_hlist(head,style,penalties)
+function processors.mlisttohlist(head,style,penalties)
starttiming(noads)
head = actions(head,style,penalties)
stoptiming(noads)
return head
end
-callbacks.register('mlist_to_hlist',processors.mlist_to_hlist,"preprocessing math list")
+callbacks.register('mlist_to_hlist',processors.mlisttohlist,"preprocessing math list")
-- tracing
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-ren.lua b/Master/texmf-dist/tex/context/base/mkiv/math-ren.lua
index 4628ffe5587..cf429cb3a69 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-ren.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-ren.lua
@@ -33,6 +33,13 @@ mappings["blackboard-to-bold"] = {
[0x02124] = 0x1D419,
}
+mappings["mikaels-favourites"] = {
+ [0x211D] = 0x1D411,
+ [0x211A] = 0x1D410,
+ [0x2124] = 0x1D419,
+ [0x2115] = 0x1D40D,
+}
+
local function renderset(list) -- order matters
local tag = gsub(list," ","")
local n = sets[tag]
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-tag.lua b/Master/texmf-dist/tex/context/base/mkiv/math-tag.lua
index 41373fcb58b..5bbe5cb3a3b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-tag.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-tag.lua
@@ -38,7 +38,7 @@ local getnucleus = nuts.getnucleus
local getsub = nuts.getsub
local getsup = nuts.getsup
-local set_attributes = nuts.setattributes
+local setattributes = nuts.setattributes
local nextnode = nuts.traversers.node
@@ -99,7 +99,6 @@ local chardata = characters.data
local getmathcodes = tex.getmathcodes
local mathcodes = mathematics.codes
local ordinary_mathcode = mathcodes.ordinary
-local variable_mathcode = mathcodes.variable
local fromunicode16 = fonts.mappings.fromunicode16
local fontcharacters = fonts.hashes.characters
@@ -226,7 +225,7 @@ process = function(start) -- we cannot use the processor as we have no finalizer
local char = getchar(start)
local code = getmathcodes(char)
local tag
- if code == ordinary_mathcode or code == variable_mathcode then
+ if code == ordinary_mathcode then
local ch = chardata[char]
local mc = ch and ch.mathclass
if mc == "number" then
@@ -297,7 +296,7 @@ process = function(start) -- we cannot use the processor as we have no finalizer
-- empty list
elseif not attr then
-- box comes from strange place
- set_attributes(list,a_tagged,text) -- only the first node ?
+ setattributes(list,a_tagged,text) -- only the first node ?
else
-- Beware, the first node in list is the actual list so we definitely
-- need to nest. This approach is a hack, maybe I'll make a proper
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-ttv.lua b/Master/texmf-dist/tex/context/base/mkiv/math-ttv.lua
index 151183212a3..662211a0d1c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-ttv.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-ttv.lua
@@ -61,6 +61,14 @@ mathencodings["large-to-small"] = {
[0x02044] = 0x0E, -- /
}
+mathencodings["large-to-small-private"] = {
+ [0xFE07A] = 0x7A, -- bracehtipdownleft
+ [0xFE07B] = 0x7B, -- bracehtipdownright
+ [0xFE07C] = 0x7C, -- bracehtipupleft
+ [0xFE07D] = 0x7D, -- bracehtipupright
+
+}
+
-- Beware: these are (in cm/lm) below the baseline due to limitations
-- in the tfm format but the engine (combined with the mathclass) takes
-- care of it. If we need them in textmode, we should make them virtual
@@ -429,7 +437,7 @@ mathencodings["tex-sy"] = {
[0x027E9] = 0x69, -- >, rangle
[0x0007C] = 0x6A, -- |, mid, lvert, rvert
[0x02225] = 0x6B, -- parallel
- -- [0x0 ] = 0x00, -- Vert, lVert, rVert, arrowvert, Arrowvert
+ -- [0x0 ] = 0x00, -- Vert, lVert, rVert, arrowvert, Arrowvert
[0x02195] = 0x6C, -- updownarrow
[0x021D5] = 0x6D, -- Updownarrow
[0x0005C] = 0x6E, -- \, backslash, setminus
diff --git a/Master/texmf-dist/tex/context/base/mkiv/math-vfu.lua b/Master/texmf-dist/tex/context/base/mkiv/math-vfu.lua
index 221bbff8975..5fe9738a218 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/math-vfu.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/math-vfu.lua
@@ -284,10 +284,9 @@ local function dots(main,characters,id,size,unicode)
}
end
elseif unicode == 0x22EE then
- -- weird height !
characters[unicode] = {
width = w,
- height = h+(1.4)*size,
+ height = h+0.8*size,
depth = 0,
commands = {
push, push, slot, pop, up4size, push, slot, pop, up4size, slot, pop,
@@ -296,7 +295,7 @@ local function dots(main,characters,id,size,unicode)
elseif unicode == 0x22F1 then
characters[unicode] = {
width = 3*w + 6*size/18,
- height = 1.5*size,
+ height = 0.7*size,
depth = 0,
commands = {
push,
@@ -313,7 +312,7 @@ local function dots(main,characters,id,size,unicode)
elseif unicode == 0x22F0 then
characters[unicode] = {
width = 3*w + 6*size/18,
- height = 1.5*size,
+ height = 0.7*size,
depth = 0,
commands = {
push,
@@ -422,7 +421,7 @@ local function stack(main,characters,id,size,unicode,u1,d12,u2)
local mu = size/18
characters[unicode] = {
width = w1,
- height = h1 + h2 + d12,
+ height = h1 + h2 + d12*mu,
depth = d1,
commands = {
{ "slot", id, u1 },
@@ -699,7 +698,7 @@ local function copy_glyph(main,target,original,unicode,slot)
vvi.glyph = addprivate(main,formatters["M-V-%H"](oldglyph),newdata)
end
end
- return newdata
+ return glyphdata
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/meta-blb.lua b/Master/texmf-dist/tex/context/base/mkiv/meta-blb.lua
index c690f3902e7..c042451f253 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/meta-blb.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/meta-blb.lua
@@ -200,7 +200,7 @@ metapost.installplugin {
}
-- Here follows an example of usage of the above: a more modern
--- version of followokens (in meta-imp-txt.mkiv).
+-- version of followtokens (in meta-imp-txt.mkiv).
local nodecodes = nodes.nodecodes
local kerncodes = nodes.kerncodes
@@ -221,9 +221,9 @@ local getsubtype = nuts.getsubtype
local setlink = nuts.setlink
local setlist = nuts.setlist
local getnext = nuts.getnext
-local flatten_list = nuts.flatten_discretionaries
+local flatten_list = nuts.flattendiscretionaries
local remove_node = nuts.remove
-local flush_node = nuts.flush
+local flushnode = nuts.flush
local addblob = mp.mf_blob_add
local newblob = mp.mf_blob_new
@@ -276,7 +276,7 @@ local function initialize(category,box)
end
setlist(wrap,head)
end
- flush_node(wrap)
+ flushnode(wrap)
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/meta-grd.mkiv b/Master/texmf-dist/tex/context/base/mkiv/meta-grd.mkiv
index 15a4471e78c..0296c68a6dc 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/meta-grd.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/meta-grd.mkiv
@@ -140,20 +140,20 @@
save sc, dx, dy, wd, ht, ox, oy, ax, ay ;
- sc = \directdummyparameter\c!factor*\directdummyparameter\c!scale ;
- dx = \MPdpar\directdummyparameter\c!dx*sc ;
- dy = \MPdpar\directdummyparameter\c!dy*sc ;
- wd = \directdummyparameter\c!nx*dx ;
- ht = \directdummyparameter\c!ny*dy ;
- ox = \MPdpar\directdummyparameter\c!xoffset\relax ;
- oy = \MPdpar\directdummyparameter\c!yoffset\relax ;
+ sc := \directdummyparameter\c!factor*\directdummyparameter\c!scale ;
+ dx := \MPdpar\directdummyparameter\c!dx*sc ;
+ dy := \MPdpar\directdummyparameter\c!dy*sc ;
+ wd := \directdummyparameter\c!nx*dx ;
+ ht := \directdummyparameter\c!ny*dy ;
+ ox := \MPdpar\directdummyparameter\c!xoffset\relax ;
+ oy := \MPdpar\directdummyparameter\c!yoffset\relax ;
if "\directdummyparameter\c!align" = "\v!middle" :
- ax = \MPdpar\directdummyparameter\c!dx/2
- ay = \MPdpar\directdummyparameter\c!dy/2
+ ax := \MPdpar\directdummyparameter\c!dx/2 ;
+ ay := \MPdpar\directdummyparameter\c!dy/2 ;
else :
- ax = 0 ;
- ay = 0 ;
+ ax := 0 ;
+ ay := 0 ;
fi ;
draw image (
diff --git a/Master/texmf-dist/tex/context/base/mkiv/meta-imp-dum.mkiv b/Master/texmf-dist/tex/context/base/mkiv/meta-imp-dum.mkiv
index 74a2de8755e..50a07f41554 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/meta-imp-dum.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/meta-imp-dum.mkiv
@@ -98,7 +98,7 @@
[placeholder]
[1=red,2=green,3=blue,4=cyan,5=magenta,6=yellow]
-\newcount\c_grph_replacement_n
+\newinteger\c_grph_replacement_n
\setupexternalfigures
[\c!reduction=0,
@@ -111,8 +111,8 @@
% \setuppalet[placeholder]%
\getpaletsize[placeholder]%
\ifnum\c_grph_replacement_n=\zerocount
- \getrandomnumber \m_grph_replacement_n\plusone\paletsize
- \global\c_grph_replacement_n \m_grph_replacement_n\relax
+ \getrandomnumber\m_grph_replacement_n\plusone\paletsize
+ \global\c_grph_replacement_n\m_grph_replacement_n\relax
\else
\global\advance\c_grph_replacement_n\plusone
\fi
diff --git a/Master/texmf-dist/tex/context/base/mkiv/meta-imp-mat.mkiv b/Master/texmf-dist/tex/context/base/mkiv/meta-imp-mat.mkiv
index e1b5d9d0059..66ac3306327 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/meta-imp-mat.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/meta-imp-mat.mkiv
@@ -139,35 +139,35 @@
enddef ;
\stopMPextensions
-\startuniqueMPgraphic{minifun::math:stacker:\number"FE3B4}{axis,ex,em}
+\startuniqueMPgraphic{minifun::math:stacker:\number"\ifcase\contextlmtxmode FE3B4\else23B4\fi}{axis,ex,em}
math_stacker_draw_accent(math_stacker_bracket_shape(OverlayHeight,false)) ;
\stopuniqueMPgraphic
-\startuniqueMPgraphic{minifun::math:stacker:\number"FE3B5}{axis,ex,em}
+\startuniqueMPgraphic{minifun::math:stacker:\number"\ifcase\contextlmtxmode FE3B5\else23B5\fi}{axis,ex,em}
math_stacker_draw_accent(math_stacker_bracket_shape(OverlayDepth,true)) ;
\stopuniqueMPgraphic
-\startuniqueMPgraphic{minifun::math:stacker:\number"FE3DC}{axis,ex,em}
+\startuniqueMPgraphic{minifun::math:stacker:\number"\ifcase\contextlmtxmode FE3DC\else23DC\fi}{axis,ex,em}
math_stacker_draw_accent(math_stacker_parent_shape(OverlayHeight,false)) ;
\stopuniqueMPgraphic
-\startuniqueMPgraphic{minifun::math:stacker:\number"FE3DD}{axis,ex,em}
+\startuniqueMPgraphic{minifun::math:stacker:\number"\ifcase\contextlmtxmode FE3DD\else23DD\fi}{axis,ex,em}
math_stacker_draw_accent(math_stacker_parent_shape(OverlayDepth,true)) ;
\stopuniqueMPgraphic
-\startuniqueMPgraphic{minifun::math:stacker:\number"FE3DE}{axis,ex,em}
+\startuniqueMPgraphic{minifun::math:stacker:\number"\ifcase\contextlmtxmode FE3DE\else23DE\fi}{axis,ex,em}
math_stacker_draw_accent(math_stacker_brace_shape(OverlayHeight,false)) ;
\stopuniqueMPgraphic
-\startuniqueMPgraphic{minifun::math:stacker:\number"FE3DF}{axis,ex,em}
+\startuniqueMPgraphic{minifun::math:stacker:\number"\ifcase\contextlmtxmode FE3DF\else23DF\fi}{axis,ex,em}
math_stacker_draw_accent(math_stacker_brace_shape(OverlayDepth,true)) ;
\stopuniqueMPgraphic
-\startuniqueMPgraphic{minifun::math:stacker:\number"FE33E}{axis,ex,em}
+\startuniqueMPgraphic{minifun::math:stacker:\number"\ifcase\contextlmtxmode FE33E\else203E\fi}{axis,ex,em}
math_stacker_draw_accent(math_stacker_bar_shape(false)) ;
\stopuniqueMPgraphic
-\startuniqueMPgraphic{minifun::math:stacker:\number"FE33F}{axis,ex,em}
+\startuniqueMPgraphic{minifun::math:stacker:\number"\ifcase\contextlmtxmode FE33F\else203F\fi}{axis,ex,em}
math_stacker_draw_accent(math_stacker_bar_shape(true)) ;
\stopuniqueMPgraphic
@@ -257,5 +257,10 @@ $
\underleftarrow {a+b+c+d} \quad
\underrightarrow {a+b+c+d}
$
+\blank[2*big]
+\setupmathradical[sqrt][alternative=mp,color=darkgreen]
+$
+ \sqrt[2]{a+b+c+d} \quad
+$
\stopTEXpage
diff --git a/Master/texmf-dist/tex/context/base/mkiv/meta-imp-txt.mkiv b/Master/texmf-dist/tex/context/base/mkiv/meta-imp-txt.mkiv
index 2c28acf7290..8e7af88b72c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/meta-imp-txt.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/meta-imp-txt.mkiv
@@ -243,7 +243,7 @@
if head then
n = { }
s = 0
- head = node.flatten_discretionaries(head)
+ head = nodes.flattendiscretionaries(head)
local current = head
while current do
local id = current.id
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mlib-mpf.lua b/Master/texmf-dist/tex/context/base/mkiv/mlib-mpf.lua
index 7452c011187..5e61cf4e11d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mlib-mpf.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/mlib-mpf.lua
@@ -133,6 +133,25 @@ do
n = 1
end
+ function metapost.getbuffer()
+ local b = { }
+ for i=1,n do
+ b[i] = buffer
+ end
+ return b, n
+ end
+
+ function metapost.setbuffer(b, s)
+ n = 0
+ for i=1,(s or #b) do
+ local bi = b[i]
+ if bi then
+ n = n + 1
+ buffer[n] = tostring(bi)
+ end
+ end
+ end
+
function metapost.runscript(code)
nesting = nesting + 1
runs = runs + 1
@@ -247,7 +266,7 @@ do
-- writers
- local function mpp(value)
+ local function rawmpp(value)
n = n + 1
local t = type(value)
if t == "number" then
@@ -268,13 +287,13 @@ do
local function mpprint(first,second,...)
if second == nil then
if first ~= nil then
- mpp(first)
+ rawmpp(first)
end
else
for i=1,select("#",first,second,...) do
local value = (select(i,first,second,...))
if value ~= nil then
- mpp(value)
+ rawmpp(value)
end
end
end
@@ -653,6 +672,25 @@ do
for k, v in next, aux do mp[k] = v end
+ -- mp.print = table.setmetatablecall(aux, function(t,...)
+ -- mpprint(...)
+ -- end)
+
+ mp.print = table.setmetatablecall(aux, function(t,first,second,...)
+ if second == nil then
+ if first ~= nil then
+ rawmpp(first)
+ end
+ else
+ for i=1,select("#",first,second,...) do
+ local value = (select(i,first,second,...))
+ if value ~= nil then
+ rawmpp(value)
+ end
+ end
+ end
+ end)
+
end
do
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mlib-pdf.lua b/Master/texmf-dist/tex/context/base/mkiv/mlib-pdf.lua
index e737b5d8688..5c1dc88b8c1 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mlib-pdf.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/mlib-pdf.lua
@@ -23,9 +23,6 @@ local context = context
local allocate = utilities.storage.allocate
-local copy_node = node.copy
-local write_node = node.write
-
local pen_info = mplib.pen_info
local getfields = mplib.getfields or mplib.fields -- todo: in lmtx get them once and then use gettype
@@ -91,7 +88,7 @@ end
function metapost.flushliteral(d)
if savedliterals then
- write_node(mpsliteral(savedliterals[d]))
+ context(mpsliteral(savedliterals[d]))
else
report_metapost("problem flushing literal %a",d)
end
@@ -217,7 +214,7 @@ local function flushnormalpath(path, t, open)
return t
end
-local function flushconcatpath(path, t, open)
+local function flushconcatpath(path, t, open, transform)
local pth, ith, nt
local length = #path
if t then
@@ -226,8 +223,10 @@ local function flushconcatpath(path, t, open)
t = { }
nt = 0
end
- nt = nt + 1
- t[nt] = f_cm(sx,rx,ry,sy,tx,ty)
+ if transform then
+ nt = nt + 1
+ t[nt] = f_cm(sx,rx,ry,sy,tx,ty)
+ end
for i=1,length do
nt = nt + 1
pth = path[i]
@@ -602,7 +601,7 @@ function metapost.flush(specification,result)
for i=1,#savedpath do
local path = savedpath[i]
if transformed then
- flushconcatpath(path,result,open)
+ flushconcatpath(path,result,open,i==1)
else
flushnormalpath(path,result,open)
end
@@ -612,7 +611,7 @@ function metapost.flush(specification,result)
if flush then
-- ignore this path
elseif transformed then
- flushconcatpath(path,result,open)
+ flushconcatpath(path,result,open,true)
else
flushnormalpath(path,result,open)
end
@@ -642,7 +641,7 @@ function metapost.flush(specification,result)
for i=1,#savedhtap do
local path = savedhtap[i]
if transformed then
- flushconcatpath(path,result,open)
+ flushconcatpath(path,result,open,i==1)
else
flushnormalpath(path,result,open)
end
@@ -651,7 +650,7 @@ function metapost.flush(specification,result)
evenodd = true
end
if transformed then
- flushconcatpath(path,result,open)
+ flushconcatpath(path,result,open,true)
else
flushnormalpath(path,result,open)
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mlib-pps.lua b/Master/texmf-dist/tex/context/base/mkiv/mlib-pps.lua
index 8a6f4b4f825..c3635d51782 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mlib-pps.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/mlib-pps.lua
@@ -13,7 +13,6 @@ local insert, remove, concat = table.insert, table.remove, table.concat
local Cs, Cf, C, Cg, Ct, P, S, V, Carg = lpeg.Cs, lpeg.Cf, lpeg.C, lpeg.Cg, lpeg.Ct, lpeg.P, lpeg.S, lpeg.V, lpeg.Carg
local lpegmatch, tsplitat, tsplitter = lpeg.match, lpeg.tsplitat, lpeg.tsplitter
local formatters = string.formatters
-local exists, savedata = io.exists, io.savedata
local mplib = mplib
local metapost = metapost
@@ -26,8 +25,8 @@ local setmacro = interfaces.setmacro
local texsetbox = tex.setbox
local textakebox = tex.takebox -- or: nodes.takebox
local texrunlocal = tex.runlocal
-local copy_list = node.copy_list
-local flush_list = node.flush_list
+local copylist = nodes.copylist
+local flushlist = nodes.flushlist
local setmetatableindex = table.setmetatableindex
local sortedhash = table.sortedhash
@@ -271,7 +270,7 @@ local function stopjob()
if top then
for slot, content in next, top.textexts do
if content then
- flush_list(content)
+ flushlist(content)
if trace_textexts then
report_textexts("freeing text %s",slot)
end
@@ -377,7 +376,7 @@ function models.rgb(cr)
elseif metapost.reducetogray then
if n == 1 then
local s = cr[1]
- checked_color_pair(f_gray,s,s)
+ return checked_color_pair(f_gray,s,s)
elseif n == 3 then
local r = cr[1]
local g = cr[2]
@@ -1078,7 +1077,7 @@ local tx_reset, tx_process do
end
box = cache[mp_hash]
if box then
- box = copy_list(box)
+ box = copylist(box)
else
texrunlocal("mptexttoks")
box = textakebox("mptextbox")
@@ -1463,6 +1462,8 @@ local function tr_process(object,prescript,before,after)
sp_specs = concat(sp_specs,",")
definemultitonecolor(sp_name,sp_specs,"","")
sp_type = "named"
+ elseif sp_type == "named" then
+ cs = { 1 } -- factor 1
end
if sp_type == "named" then
-- we might move this to another namespace .. also, named can be a spotcolor
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mtx-context-compare.tex b/Master/texmf-dist/tex/context/base/mkiv/mtx-context-compare.tex
index c940270c8ab..16f8a540858 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mtx-context-compare.tex
+++ b/Master/texmf-dist/tex/context/base/mkiv/mtx-context-compare.tex
@@ -38,7 +38,6 @@
\stopTEXpage
\stoptexdefinition
-
\startluacode
local report = logs.reporter("compare")
@@ -70,8 +69,8 @@ local function check(name)
return used
end
-local one = check(fileone)
-local two = check(filetwo)
+local one = check(fileone) -- can crash
+local two = check(filetwo) -- can crash
if not one then
report("invalid file %a",fileone)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mtx-context-hashed.tex b/Master/texmf-dist/tex/context/base/mkiv/mtx-context-hashed.tex
new file mode 100644
index 00000000000..88de10f3f29
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/mtx-context-hashed.tex
@@ -0,0 +1,136 @@
+%D \module
+%D [ file=mtx-context-hashed,
+%D version=2009.03.21,
+%D title=\CONTEXT\ Extra Trickry,
+%D subtitle=Combine Files,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+% begin help
+%
+% usage: context --extra=hashed [options] list-of-files
+%
+% --database : database to create or extend
+% --pattern : file pattern
+% --patterns : pattern file
+% --compression : apply compression
+%
+% end help
+
+% \startluacode
+% if not resolvers.finders.helpers.validhashed("hasheddata") then
+% resolvers.finders.helpers.createhashed {
+% database = "hasheddata",
+% pattern = "m4all/**.jpg$",
+% compress = false,
+% }
+% resolvers.finders.helpers.createhashed {
+% database = "hasheddata",
+% pattern = "m4all/**.png$",
+% compress = false,
+% }
+% resolvers.finders.helpers.createhashed {
+% database = "hasheddata",
+% pattern = "m4all/**.xml$",
+% compress = true,
+% }
+% end
+% \stopluacode
+
+% \startluacode
+% if not resolvers.finders.helpers.validhashed("hasheddata") then
+% resolvers.finders.helpers.createhashed {
+% database = "hasheddata",
+% patterns = {
+% { pattern = "m4all/**.jpg$", compress = false },
+% { pattern = "m4all/**.png$", compress = false },
+% { pattern = "m4all/**.xml$", compress = true },
+% },
+% }
+% end
+% \stopluacode
+
+% context --extra=hashed --database=hasheddata --pattern=m4all/**.jpg
+% context --extra=hashed --database=hasheddata --pattern=m4all/**.png
+% context --extra=hashed --database=hasheddata --pattern=m4all/**.xml --compress
+% context --extra=hashed --database=hasheddata --pattern=m4all/**.svg --compress
+
+% -- m4all.lua:
+%
+% return {
+% { pattern = "m4all/**.jpg$", compress = false },
+% { pattern = "m4all/**.png$", compress = false },
+% { pattern = "m4all/**.svg$", compress = true },
+% { pattern = "m4all/**.xml$", compress = true },
+% }
+%
+% context --extra=hashed --database=hasheddata --patterns=m4all.lua
+
+% \registerhashedfiles[hasheddata]
+% \registerfilescheme[hashed]
+%
+% \externalfigure[hashed:///m4all/books/chapters/h3/h3-if1/images/highres/casino.jpg] [height=1cm]
+% \externalfigure[hashed:///m4all/books/chapters/ha/ha-c4/images/highres/ha-c44-ex2-s1.png][height=1cm]
+% \externalfigure[m4all/books/chapters/h3/h3-if1/images/highres/casino.jpg] [height=1cm]
+% \externalfigure[m4all/books/chapters/ha/ha-c4/images/highres/ha-c44-ex2-s1.png] [height=1cm]
+
+\input mtx-context-common.tex
+
+\noheaderandfooterlines \setupbodyfont[tt]
+
+\starttext
+
+\startluacode
+
+ if CONTEXTLMTXMODE > 0 then
+
+ local database = document.arguments.database
+
+ if database then
+ local metadata = false
+ if tex.systemmodes["first"] then
+ metadata = resolvers.finders.helpers.createhashed {
+ database = database,
+ pattern = document.arguments.pattern,
+ compress = document.arguments.compress,
+ patterns = document.arguments.patterns and table.load(document.arguments.patterns),
+ }
+ else
+ metadata = resolvers.finders.helpers.validhashed(database)
+ if metadata then
+ metadata = metadata.metadata
+ end
+ end
+ if metadata then
+ local function show(what)
+ context.NC() context(what)
+ context.EQ() context(metadata[what])
+ context.NC() context.NR()
+ end
+ context.starttitle { title = "database: " .. database }
+ context.starttabulate { "||r|" }
+ show("nofnames")
+ show("nofpaths")
+ show("nofblobs")
+ show("nofcompressed")
+ context.stoptabulate()
+ context.stoptitle()
+ else
+ context("something went wrong, invalid database")
+ end
+ else
+ context("something went wrong, no database specified")
+ end
+ else
+ context("you need lmtx")
+ end
+
+\stopluacode
+
+\stoptext
+
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mtx-context-setters.tex b/Master/texmf-dist/tex/context/base/mkiv/mtx-context-setters.tex
new file mode 100644
index 00000000000..c90c385c586
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/mtx-context-setters.tex
@@ -0,0 +1,35 @@
+%D \module
+%D [ file=mtx-context-setters,
+%D version=0000.00.00,
+%D title=\CONTEXT\ Extra Trickry,
+%D subtitle=Show Trackers,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+% begin help
+%
+% usage: context --extra=setters [--pattern=] [trackers|directives|experiments]
+%
+% --pattern : filter by pattern
+% --trackers : show trackers
+% --directives : show directives
+% --experiments : show experiments
+%
+% end help
+
+\starttext
+
+\doifdocumentargument {trackers} { \ctxlua {trackers .show(environment.arguments.pattern) } }
+\doifdocumentargument {directives} { \ctxlua {directives .show(environment.arguments.pattern) } }
+\doifdocumentargument {experiments} { \ctxlua {experiments.show(environment.arguments.pattern) } }
+\doifdocumentargument {showtrackers} { \ctxlua {trackers .show(environment.arguments.pattern) } }
+\doifdocumentargument {showdirectives} { \ctxlua {directives .show(environment.arguments.pattern) } }
+\doifdocumentargument {showexperiments} { \ctxlua {experiments.show(environment.arguments.pattern) } }
+
+\stoptext
+
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-aux.mkiv b/Master/texmf-dist/tex/context/base/mkiv/mult-aux.mkiv
index d7921bcc290..5992ed39f5e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mult-aux.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/mult-aux.mkiv
@@ -656,11 +656,11 @@
\installparametersethandler {#1}{#2}%
\installrootparameterhandler{#1}{#2}}
-\protected\def\installbasicautosetuphandler#1#2#3% \??self name \??parent (can be \??self)
+\protected\def\installbasicautosetuphandler#1#2% \??self name \??parent (can be \??self)
{\installbasicparameterhandler{#1}{#2}%
\installautosetuphandler {#1}{#2}}
-\protected\def\installstylisticautosetuphandler#1#2#3% \??self name \??parent (can be \??self)
+\protected\def\installstylisticautosetuphandler#1#2% \??self name \??parent (can be \??self)
{\installbasicparameterhandler{#1}{#2}%
\installautosetuphandler {#1}{#2}%
\installstyleandcolorhandler {#1}{#2}}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-def.lua b/Master/texmf-dist/tex/context/base/mkiv/mult-def.lua
index 0f2ef419c17..4ac85137108 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mult-def.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/mult-def.lua
@@ -7,7 +7,11 @@ if not modules then modules = { } end modules ['mult-def'] = {
dataonly = true,
}
--- we can remove some commands, like inleftmargin and so (see typo-mar.mkiv)
+-- We can remove some commands, like inleftmargin and so (see typo-mar.mkiv). Also,
+-- some keywords are unique for mkiv or lmtx so at some point we might split this
+-- file. On the other hand, it's a way to standardize.
+
+-- StartMovie and StartSound etc can go.
return {
["commands"]={
@@ -7271,6 +7275,62 @@ return {
["pe"]="بنویس‌درثبت",
["ro"]="scrieinregistru",
},
+ -- we still need to add some new ones here as i completely forgot that it's
+ -- needed ... maybe ws has a backlog for setups that we can use
+ ["definesavebuffer"]={
+ ["en"]="startsavebuffer",
+ },
+ ["startnamedtyping"]={
+ ["en"]="startnamedtyping",
+ },
+ ["stopnamedtyping"]={
+ ["en"]="stopnamedtyping",
+ },
+ ["namedconstruction"]={
+ ["en"]="namedconstruction",
+ },
+ ["startnamedconstruction"]={
+ ["en"]="startnamedconstruction",
+ },
+ ["stopnamedconstruction"]={
+ ["en"]="stopnamedconstruction",
+ },
+ ["nameddescription"]={
+ ["en"]="nameddescription",
+ },
+ ["startnameddescription"]={
+ ["en"]="startnameddescription",
+ },
+ ["stopnameddescription"]={
+ ["en"]="stopnameddescription",
+ },
+ ["namedenumeration"]={
+ ["en"]="namedenumeration",
+ },
+ ["startnamedenumeration"]={
+ ["en"]="startnamedenumeration",
+ },
+ ["stopnamedenumeration"]={
+ ["en"]="stopnamedenumeration",
+ },
+ ["startnamedsection"]={
+ ["en"]="startnamedsection",
+ },
+ ["stopnamedsection"]={
+ ["en"]="stopnamedsection",
+ },
+ ["startnamedmatrix"]={
+ ["en"]="startnamedmatrix",
+ },
+ ["stopnamedmatrix"]={
+ ["en"]="stopnamedmatrix",
+ },
+ ["startnamedsubformulas"]={
+ ["en"]="startnamedsubformulas",
+ },
+ ["stopnamedsubformulas"]={
+ ["en"]="stopnamedsubformulas",
+ },
},
["constants"]={
["action"]={
@@ -7283,6 +7343,12 @@ return {
["pe"]="کنش",
["ro"]="actiune",
},
+ ["adaptive"]={
+ ["en"]="adaptive",
+ },
+ ["freezespacing"]={
+ ["en"]="freezespacing",
+ },
["address"]={
["cs"]="adresa",
["de"]="adresse",
@@ -7342,6 +7408,12 @@ return {
["en"]="alignbottom",
["fr"]="alignerbas",
},
+ ["topalign"]={
+ ["en"]="topalign",
+ },
+ ["bottomalign"]={
+ ["en"]="bottomalign",
+ },
["aligncharacter"]={
["cs"]="aligncharacter",
["de"]="aligncharacter",
@@ -7562,6 +7634,22 @@ return {
["pe"]="عرض‌خودکار",
["ro"]="autolatime",
},
+ ["autopunctuation"]={
+ ["en"]="autopunctuation",
+ ["fr"]="autoponctuation",
+ },
+ ["autospacing"]={
+ ["en"]="autospacing",
+ ["fr"]="autospacing",
+ },
+ ["autofencing"]={
+ ["en"]="autofencing",
+ ["fr"]="autofencing",
+ },
+ ["autonumbers"]={
+ ["en"]="autonumbers",
+ ["fr"]="autonumbers",
+ },
["availableheight"]={
["en"]="availableheight",
["fr"]="hauteurdisponible",
@@ -7821,6 +7909,10 @@ return {
["fr"]="commandebas",
["nl"]="ondercommando",
},
+ ["bottomcolor"]={
+ ["en"]="bottomcolor",
+ ["nl"]="onderkleur",
+ },
["bottomdistance"]={
["cs"]="vzdalenostspodku",
["de"]="abstandunten",
@@ -8264,6 +8356,10 @@ return {
["pe"]="criterium",
["ro"]="criteriu",
},
+ ["crop"]={
+ ["en"]="crop",
+ ["fr"]="recadre",
+ },
["cropoffset"]={
["en"]="cropoffset",
["fr"]="decalagerecadre",
@@ -9159,6 +9255,10 @@ return {
["fr"]="separateurtete",
["nl"]="kopscheider",
},
+ ["headindenting"]={
+ ["en"]="headindenting",
+ ["nl"]="kopinspringen",
+ },
["headstyle"]={
["cs"]="stylhlavicky",
["de"]="kopfstil",
@@ -9385,6 +9485,10 @@ return {
["en"]="instance",
["fr"]="instance",
},
+ ["integral"]={
+ ["en"]="integral",
+ ["fr"]="integrale",
+ },
["intent"]={
["en"]="intent",
["fr"]="intention",
@@ -9972,6 +10076,15 @@ return {
["en"]="mathclass",
["fr"]="classemath",
},
+ ["leftclass"]={
+ ["en"]="leftclass",
+ },
+ ["rightclass"]={
+ ["en"]="rightclass",
+ },
+ ["middleclass"]={
+ ["en"]="middleclass",
+ },
["mathlimits"]={
["en"]="mathlimits",
["fr"]="limitesmath",
@@ -9980,6 +10093,12 @@ return {
["en"]="mathstyle",
["fr"]="stylemath",
},
+ ["mathnumeratorstyle"]={
+ ["en"]="mathnumeratorstyle",
+ },
+ ["mathdenominatorstyle"]={
+ ["en"]="mathdenominatorstyle",
+ },
["max"]={
["cs"]="max",
["de"]="max",
@@ -10381,6 +10500,9 @@ return {
["pe"]="Ùاصله‌شماره",
["ro"]="numberdistance",
},
+ ["numberthreshold"]={
+ ["en"]="numberthreshold",
+ },
["numbering"]={
["cs"]="cislovani",
["de"]="nummerierung",
@@ -10395,6 +10517,10 @@ return {
["en"]="numberorder",
["fr"]="ordrenumero",
},
+ ["numberlocation"]=
+ {
+ ["en"]="numberlocation",
+ },
["numberprefix"]={
["en"]="numberprefix",
["fr"]="prefixenumero",
@@ -10805,6 +10931,9 @@ return {
["pe"]="پاراگراÙ",
["ro"]="paragraf",
},
+ ["penalties"]={
+ ["en"]="penalties",
+ },
["period"]={
["en"]="period",
["fr"]="periode",
@@ -11653,6 +11782,12 @@ return {
["en"]="smallcapsfont",
["fr"]="policepetitescaps",
},
+ ["snap"]={
+ ["en"]="snap",
+ },
+ ["snapstep"]={
+ ["en"]="snapstep",
+ },
["solution"]={
["en"]="solution",
["fr"]="solution",
@@ -11806,6 +11941,10 @@ return {
["pe"]="توده",
["ro"]="stack",
},
+ ["stacking"]={
+ ["en"]="stacking",
+ ["nl"]="stapels",
+ },
["stackname"]={
["en"]="stackname",
["fr"]="nompile",
@@ -11957,6 +12096,9 @@ return {
["en"]="surnamesep",
["fr"]="seprenom",
},
+ ["synchronize"]={
+ ["en"]="synchronize",
+ },
["svgstyle"]={
["en"]="svgstyle",
["fr"]="stylesvg",
@@ -12099,6 +12241,10 @@ return {
["en"]="textalign",
["fr"]="alignertexte",
},
+ ["textalternative"]={
+ ["en"]="textalternative",
+ ["nl"]="tekstvariant",
+ },
["textcolor"]={
["cs"]="barvatextu",
["de"]="textfarbe",
@@ -12159,6 +12305,10 @@ return {
["pe"]="حاشیه‌متن",
["ro"]="textmargin",
},
+ ["numbermethod"]={
+ ["en"]="numbermethod",
+ ["nl"]="nummermethode",
+ },
["textmethod"]={
["cs"]="textmethod",
["de"]="textmethod",
@@ -12342,6 +12492,10 @@ return {
["fr"]="commandehaut",
["nl"]="bovencommando",
},
+ ["topcolor"]={
+ ["en"]="topcolor",
+ ["nl"]="bovenkleur",
+ },
["topdistance"]={
["cs"]="vzdalenostvrsku",
["de"]="obenabstand",
@@ -12721,6 +12875,21 @@ return {
["pe"]="گام‌وای",
["ro"]="ystep",
},
+ ["leftsource"]={
+ ["en"]="leftsource",
+ },
+ ["rightsource"]={
+ ["en"]="rightsource",
+ },
+ ["middlesource"]={
+ ["en"]="middlesource",
+ },
+ ["source"]={
+ ["en"]="source",
+ },
+ ["target"]={
+ ["en"]="target",
+ },
},
["elements"]={
["answerlines"]={
@@ -12873,6 +13042,12 @@ return {
["pe"]="آرایش",
["ro"]="makeup",
},
+ ["namedtyping"]={
+ ["en"]="namedtyping",
+ },
+ ["namednotation"]={
+ ["en"]="namednotation",
+ },
["next"]={
["cs"]="dalsi",
["de"]="folgende",
@@ -14491,6 +14666,12 @@ return {
["pe"]="answerarea",
["ro"]="answerarea",
},
+ ["append"]={
+ ["en"]="append",
+ },
+ ["prepend"]={
+ ["en"]="prepend",
+ },
["appendices"]={
["cs"]="dodatky",
["de"]="anhaenge",
@@ -14609,10 +14790,6 @@ return {
["pe"]="پیشگÙتارخودکار",
["ro"]="autointro",
},
- ["autopunctuation"]={
- ["en"]="autopunctuation",
- ["fr"]="autoponctuation",
- },
["back"]={
["cs"]="zpet",
["de"]="zurueck",
@@ -15311,6 +15488,10 @@ return {
["pe"]="eight",
["ro"]="eight",
},
+ ["compress"]={
+ ["en"]="compress",
+ ["nl"]="comprimeer",
+ },
["embed"]={
["en"]="embed",
["fr"]="integrer",
@@ -15562,6 +15743,12 @@ return {
["pe"]="شناور",
["ro"]="obiectmobil",
},
+ ["flushforward"]={
+ ["en"]="flushforward",
+ },
+ ["flushbackward"]={
+ ["en"]="flushbackward",
+ },
["flushinner"]={
["cs"]="flushinner",
["de"]="flushinner",
@@ -15979,6 +16166,9 @@ return {
["pe"]="اÙÙ‚ÛŒ",
["ro"]="orizontal",
},
+ ["collapsed"]={
+ ["en"]="collapsed",
+ },
["hyphenated"]={
["cs"]="hyphenated",
["de"]="hyphenate",
@@ -16189,10 +16379,6 @@ return {
["pe"]="درحاشیه‌راست",
["ro"]="inmargineadreapta",
},
- ["integral"]={
- ["en"]="integral",
- ["fr"]="integrale",
- },
["interaction"]={
["cs"]="interakce",
["de"]="interaktion",
@@ -16360,6 +16546,10 @@ return {
["pe"]="نگهدار",
["ro"]="mentine",
},
+ ["keeptogether"]={
+ ["en"]="keeptogether",
+ ["fr"]="conserverensemble",
+ },
["kerncharacters"]={
["en"]="kerncharacters",
["fr"]="approchercaracteres",
@@ -16494,6 +16684,16 @@ return {
["pe"]="حاشیه‌چپ",
["ro"]="marginestanga",
},
+ ["lefttext"]={
+ ["cs"]="textvlevo",
+ ["de"]="linkertext",
+ ["en"]="lefttext",
+ ["fr"]="textegauche",
+ ["it"]="testosinistro",
+ ["nl"]="linkertekst",
+ ["pe"]="متن‌چپ",
+ ["ro"]="textstanga",
+ },
["leftpage"]={
["cs"]="levastranka",
["de"]="linkerseite",
@@ -17235,6 +17435,12 @@ return {
["pe"]="بدون‌آویزان‌کردن",
["ro"]="nothanging",
},
+ ["explicit"]={
+ ["en"]="explicit",
+ },
+ ["notcollapsed"]={
+ ["en"]="notcollapsed",
+ },
["nothyphenated"]={
["cs"]="nothyphenated",
["de"]="nothyphenated",
@@ -17688,6 +17894,10 @@ return {
["pe"]="محصول",
["ro"]="produs",
},
+ ["profile"]={
+ ["en"]="profile",
+ ["fr"]="profil",
+ },
["program"]={
["cs"]="program",
["de"]="programm",
@@ -17938,6 +18148,16 @@ return {
["pe"]="صÙحه‌راست",
["ro"]="paginadreapta",
},
+ ["righttext"]={
+ ["cs"]="textvpravo",
+ ["de"]="rechtertext",
+ ["en"]="righttext",
+ ["fr"]="textedroite",
+ ["it"]="testodestro",
+ ["nl"]="rechtertekst",
+ ["pe"]="متن‌راست",
+ ["ro"]="textdreapta",
+ },
["righttoleft"]={
["cs"]="righttoleft",
["de"]="righttoleft",
@@ -18983,6 +19203,9 @@ return {
["pe"]="متن",
["ro"]="text",
},
+ ["textdisplay"]={
+ ["en"]="textdisplay",
+ },
["textnote"]={
["en"]="textnote",
["fr"]="notetexte",
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-fmt.lua b/Master/texmf-dist/tex/context/base/mkiv/mult-fmt.lua
index 0d11a425333..bbcdfd343f4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mult-fmt.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/mult-fmt.lua
@@ -11,12 +11,12 @@ local concat, sortedhash = table.concat, table.sortedhash
local sub, formatters = string.sub, string.formatters
local utfsplit = utf.split
-local prtcatcodes = catcodes.numbers.prtcatcodes
-local contextsprint = context.sprint
-local implement = interfaces.implement
+local prtcatcodes = catcodes.numbers.prtcatcodes
+local contextsprint = context.sprint
+local implement = interfaces.implement
-local setmacro = token.set_macro
-local definedmacro = token.is_defined
+local setmacro = token.setmacro or token.set_macro
+local definedmacro = token.isdefined or token.is_defined
local report = logs.reporter("interface")
local report_interface = logs.reporter("interface","initialization")
@@ -217,9 +217,9 @@ function interfaces.setuserinterface(interface,response)
constant = constant[interface] or constant.en or given
constants[constant] = given -- breedte -> width
nofconstants = nofconstants + 1
- setmacro("c!" .. given,given,"immutable")
+ setmacro("c!" .. given,given,"immutable","constant")
if reversetoo then
- setmacro("k!" .. constant,given,"immutable")
+ setmacro("k!" .. constant,given,"immutable","constant")
end
report_constant("%-40s: %s",given,constant)
end
@@ -232,7 +232,7 @@ function interfaces.setuserinterface(interface,response)
variable = variable[interface] or variable.en or given
variables[given] = variable -- ja -> yes
nofvariables = nofvariables + 1
- setmacro("v!" .. given,variable,"immutable")
+ setmacro("v!" .. given,variable,"immutable","constant")
report_variable("%-40s: %s",given,variable)
end
logs.stopfilelogging()
@@ -244,7 +244,7 @@ function interfaces.setuserinterface(interface,response)
element = element[interface] or element.en or given
elements[element] = given
nofelements = nofelements + 1
- setmacro("e!" .. given,element,"immutable")
+ setmacro("e!" .. given,element,"immutable","constant")
report_element("%-40s: %s",given,element)
end
logs.stopfilelogging()
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-fun.lua b/Master/texmf-dist/tex/context/base/mkiv/mult-fun.lua
index 4ecbb1abdf4..0926b5d1287 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mult-fun.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/mult-fun.lua
@@ -16,7 +16,7 @@ return {
"maxdimensions",
"drawoptionsfactor",
"dq", "sq",
- "crossingscale", "crossingoption",
+ "crossingscale", "crossingoption", "crossingdebug",
"contextlmtxmode", "metafunversion", "minifunversion",
--
-- for the moment we put these here as they need to stand out
@@ -34,9 +34,22 @@ return {
"getparametertext",
-- "getparameteroption",
"applyparameters",
+ "mergeparameters",
"pushparameters",
"popparameters",
+ "setluaparameter",
"definecolor",
+ --
+ "record", "newrecord", "setrecord", "getrecord", "cntrecord",
+ --
+ "anchorxy", "anchorx", "anchory",
+ "anchorht", "anchordp",
+ "anchorul", "anchorll", "anchorlr", "anchorur",
+ "localanchorbox", "localanchorcell", "localanchorspan",
+ "anchorbox", "anchorcell", "anchorspan",
+ "matrixbox", "matrixcell", "matrixspan",
+ --
+ "pensilcolor", "pensilstep",
},
commands = {
"loadfile", "loadimage", "loadmodule",
@@ -48,6 +61,7 @@ return {
"zmod",
"paired", "tripled",
"unitcircle", "fulldiamond", "unitdiamond", "fullsquare", "unittriangle", "fulltriangle",
+ "unitoctagon", "fulloctagon", "unithexagon", "fullhexagon",
-- "halfcircle", "quartercircle",
"llcircle", "lrcircle", "urcircle", "ulcircle",
"tcircle", "bcircle", "lcircle", "rcircle",
@@ -72,7 +86,7 @@ return {
-- "withshading", "withlinearshading", "withcircularshading", "withfromshadecolor", "withtoshadecolor",
"shadedinto", "withshadecolors",
"withshadedomain", "withshademethod", "withshadefactor", "withshadevector",
- "withshadecenter", "withshadedirection", "withshaderadius", "withshadetransform",
+ "withshadecenter", "withshadedirection", "withshaderadius", "withshadetransform", "withshadecenterone", "withshadecentertwo",
"withshadestep", "withshadefraction", "withshadeorigin", "shownshadevector", "shownshadeorigin",
"shownshadedirection", "shownshadecenter",
"cmyk", "spotcolor", "multitonecolor", "namedcolor",
@@ -85,7 +99,7 @@ return {
"checkedbounds", "checkbounds", "strut", "rule",
"withmask", "bitmapimage",
"colordecimals", "ddecimal", "dddecimal", "ddddecimal", "colordecimalslist",
- "textext", "thetextext", "rawtextext", "textextoffset", "texbox", "thetexbox", "rawtexbox", "istextext",
+ "textext", "thetextext", "rawtextext", "textextoffset", "texbox", "thetexbox", "rawtexbox", "istextext", "infotext",
"rawmadetext", "validtexbox", "onetimetextext", "rawfmttext", "thefmttext", "fmttext", "onetimefmttext",
"notcached", "keepcached",
"verbatim",
@@ -94,6 +108,7 @@ return {
"transparent", "withtransparency", "withopacity",
"property", "properties", "withproperties",
"asgroup",
+ "withpattern", "withpatternscale", "withpatternfloat",
"infont", -- redefined using textext
-- "set_linear_vector", "set_circular_vector",
-- "linear_shade", "circular_shade",
@@ -104,7 +119,8 @@ return {
"grayscale", "greyscale", "withgray", "withgrey",
"colorpart", "colorlike",
"readfile",
- "clearxy", "unitvector", "center", -- redefined
+ "clearxy", "unitvector",
+ "center", -- redefined
"epsed", "anchored",
"originpath", "infinite",
"break",
@@ -158,7 +174,7 @@ return {
"passvariable", "passarrayvariable", "tostring", "topair", "format", "formatted", "quotation", "quote",
"startpassingvariable", "stoppassingvariable",
--
- "eofill", "eoclip", "nofill", "dofill", "fillup", "eofillup", "nodraw", "dodraw",
+ "eofill", "eoclip", "nofill", "dofill", "fillup", "eofillup", "nodraw", "dodraw", "enfill",
"area",
--
"addbackground",
@@ -178,9 +194,17 @@ return {
"setmacro", "setdimen", "setcount", "settoks",
"setglobalmacro", "setglobaldimen", "setglobalcount", "setglobaltoks",
--
- "positionpath", "positioncurve", "positionxy", "positionpxy",
- "positionwhd", "positionpage", "positionregion", "positionbox",
+ "positionpath", "positioncurve", "positionxy", "positionparagraph", "positioncolumn",
+ "positionwhd", "positionpage", "positionregion", "positionbox", "positionx", "positiony",
"positionanchor", "positioninregion", "positionatanchor",
+ "positioncolumnbox", "overlaycolumnbox", "positioncolumnatx",
+ --
+ "getposboxes", "getmultipars",
+ "getpospage", "getposparagraph", "getposcolumn", "getposregion",
+ "getposx", "getposy", "getposwidth", "getposheight", "getposdepth",
+ "getposleftskip", "getposrightskip", "getposhsize", "getposparindent", "getposhangindent", "getposhangafter",
+ "getposxy", "getposupperleft", "getposlowerleft", "getposupperright", "getposlowerright",
+ "getposllx", "getposlly", "getposurx", "getposury",
--
"wdpart", "htpart", "dppart",
--
@@ -190,19 +214,30 @@ return {
--
"utfnum", "utflen", "utfsub",
--
- "newhash", "disposehash", "inhash", "tohash",
+ "newhash", "disposehash", "inhash", "tohash", "fromhash",
--
"isarray", "prefix", "isobject",
--
"comment", "report", "lua", "lualist", "mp", "MP", "luacall",
--
- "mirrored", "mirroredabout",
+ "mirrored", "mirroredabout", "xslanted", "yslanted",
--
"scriptindex", "newscriptindex",
--
"newcolor", "newrgbcolor", "newcmykcolor",
"newnumeric", "newboolean", "newtransform", "newpath", "newpicture", "newstring", "newpair",
-
- "mpvar",
+ --
+ "mpvard", "mpvarn", "mpvars", "mpvar",
+ --
+ "withtolerance",
+ --
+ "hatched", "withdashes",
+ "processpath", "pencilled",
+ "sortedintersectiontimes", "intersectionpath", "firstintersectionpath", "secondintersectionpath",
+ "intersectionsfound", "cutbeforefirst", "cutafterfirst", "cutbeforelast", "cutafterlast",
+ --
+ "xnormalized", "ynormalized", "xynormalized",
+ "phantom",
+ "scrutinized",
},
}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-low.lua b/Master/texmf-dist/tex/context/base/mkiv/mult-low.lua
index a893d455c1f..686fbfb7aba 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mult-low.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/mult-low.lua
@@ -14,13 +14,16 @@ return {
"zerocount", "minusone", "minustwo", "plusone", "plustwo", "plusthree", "plusfour", "plusfive",
"plussix", "plusseven", "pluseight", "plusnine", "plusten", "pluseleven", "plustwelve", "plussixteen",
"plusfifty", "plushundred", "plusonehundred", "plustwohundred", "plusfivehundred",
- "plusthousand", "plustenthousand", "plustwentythousand", "medcard", "maxcard", "maxcardminusone",
+ "plusthousand", "plustenthousand", "plustwentythousand", "medcard", "maxcard", "maxcardminusone", "maxiterator",
"zeropoint", "onepoint", "halfapoint", "onebasepoint", "maxcount", "maxdimen", "scaledpoint", "thousandpoint",
"points", "halfpoint",
- "zeroskip",
+ "zeroskip", "centeringskip", "stretchingskip", "shrinkingskip",
+ "centeringfillskip", "stretchingfillskip", "shrinkingfillskip",
"zeromuskip", "onemuskip",
"pluscxxvii", "pluscxxviii", "pluscclv", "pluscclvi",
"normalpagebox",
+ "binaryshiftedten", "binaryshiftedtwenty", "binaryshiftedthirty",
+ "thickermuskip",
--
"directionlefttoright", "directionrighttoleft",
--
@@ -28,6 +31,8 @@ return {
--
"emptytoks", "empty", "undefined",
--
+ "prerollrun",
+ --
"voidbox", "emptybox", "emptyvbox", "emptyhbox",
--
"bigskipamount", "medskipamount", "smallskipamount",
@@ -61,7 +66,7 @@ return {
"tabasciicode", "newlineasciicode", "formfeedasciicode", "endoflineasciicode", "endoffileasciicode",
"commaasciicode", "spaceasciicode", "periodasciicode",
"hashasciicode", "dollarasciicode", "commentasciicode", "ampersandasciicode",
- "colonasciicode", "backslashasciicode", "circumflexasciicode", "underscoreasciicode",
+ "colonasciicode", "semicolonasciicode", "backslashasciicode", "circumflexasciicode", "underscoreasciicode",
"leftbraceasciicode", "barasciicode", "rightbraceasciicode", "tildeasciicode", "delasciicode",
"leftparentasciicode", "rightparentasciicode",
"lessthanasciicode", "morethanasciicode", "doublecommentsignal",
@@ -69,12 +74,13 @@ return {
"doublequoteasciicode", "singlequoteasciicode", "forwardslashasciicode",
"primeasciicode", "hyphenasciicode", "percentasciicode", "leftbracketasciicode", "rightbracketasciicode",
--
- "frozenhsizecode", "frozenskipcode", "frozenhangcode", "frozenindentcode", "frozenparfillcode",
- "frozenadjustcode", "frozenprotrudecode", "frozentolerancecode", "frozenstretchcode",
- "frozenloosenesscode", "frozenlastlinecode", "frozenlinepenaltycode", "frozenclubpenaltycode",
- "frozenwidowpenaltycode", "frozendisplaypenaltycode", "frozenbrokenpenaltycode",
- "frozendemeritscode", "frozenshapecode", "frozenlinecode", "frozenhyphenationcode",
- "frozenallcode",
+ "hsizefrozenparcode", "skipfrozenparcode", "hangfrozenparcode", "indentfrozenparcode", "parfillfrozenparcode",
+ "adjustfrozenparcode", "protrudefrozenparcode", "tolerancefrozenparcode", "stretchfrozenparcode",
+ "loosenessfrozenparcode", "lastlinefrozenparcode", "linepenaltyfrozenparcode", "clubpenaltyfrozenparcode",
+ "widowpenaltyfrozenparcode", "displaypenaltyfrozenparcode", "brokenpenaltyfrozenparcode",
+ "demeritsfrozenparcode", "shapefrozenparcode", "linefrozenparcode", "hyphenationfrozenparcode",
+ "shapingpenaltyfrozenparcode", "orphanpenaltyfrozenparcode", "allfrozenparcode",
+ "mathpenaltyfrozenparcode",
--
"activemathcharcode",
--
@@ -85,17 +91,45 @@ return {
"bottomlevelgroupcode", "simplegroupcode", "hboxgroupcode", "adjustedhboxgroupcode", "vboxgroupcode",
"vtopgroupcode", "aligngroupcode", "noaligngroupcode", "outputgroupcode", "mathgroupcode",
"discretionarygroupcode", "insertgroupcode", "vadjustgroupcode", "vcentergroupcode", "mathabovegroupcode",
- "mathchoicegroupcode", "semisimplegroupcode", "mathshiftgroupcode", "mathleftgroupcode",
+ "mathchoicegroupcode", "alsosimplegroupcode", "semisimplegroupcode", "mathshiftgroupcode", "mathleftgroupcode",
"localboxgroupcode", "splitoffgroupcode", "splitkeepgroupcode", "preamblegroupcode",
"alignsetgroupcode", "finrowgroupcode", "discretionarygroupcode",
--
+ "markautomigrationcode", "insertautomigrationcode", "adjustautomigrationcode", "preautomigrationcode", "postautomigrationcode",
+ --
"charnodecode", "hlistnodecode", "vlistnodecode", "rulenodecode", "insertnodecode", "marknodecode",
"adjustnodecode", "ligaturenodecode", "discretionarynodecode", "whatsitnodecode", "mathnodecode",
"gluenodecode", "kernnodecode", "penaltynodecode", "unsetnodecode", "mathsnodecode",
--
- "charifcode", "catifcode", "numifcode", "dimifcode", "oddifcode", "vmodeifcode", "hmodeifcode",
- "mmodeifcode", "innerifcode", "voidifcode", "hboxifcode", "vboxifcode", "xifcode", "eofifcode",
- "trueifcode", "falseifcode", "caseifcode", "definedifcode", "csnameifcode", "fontcharifcode",
+ -- "charifcode", "catifcode", "numifcode", "dimifcode", "oddifcode", "vmodeifcode", "hmodeifcode",
+ -- "mmodeifcode", "innerifcode", "voidifcode", "hboxifcode", "vboxifcode", "xifcode", "eofifcode",
+ -- "trueifcode", "falseifcode", "caseifcode", "definedifcode", "csnameifcode", "fontcharifcode",
+ --
+ "overrulemathcontrolcode", "underrulemathcontrolcode", "radicalrulemathcontrolcode", "fractionrulemathcontrolcode",
+ "accentskewhalfmathcontrolcode", "accentskewapplymathcontrolcode", "applyordinarykernpairmathcontrolcode",
+ "applyverticalitalickernmathcontrolcode", "applyordinaryitalickernmathcontrolcode", "applycharitalickernmathcontrolcode",
+ "reboxcharitalickernmathcontrolcode", "applyboxeditalickernmathcontrolcode", "staircasekernmathcontrolcode",
+ "applytextitalickernmathcontrolcode", "applyscriptitalickernmathcontrolcode",
+ "checkspaceitalickernmathcontrolcode", "checktextitalickernmathcontrolcode",
+ "analyzescriptnucleuscharmathcontrolcode", "analyzescriptnucleuslistmathcontrolcode", "analyzescriptnucleusboxmathcontrolcode",
+ "accenttopskewwithoffsetmathcontrolcode", "ignorekerndimensionsmathcontrolcode", "ignoreflataccentsmathcontrolcode",
+ "extendaccentsmathcontrolcode", "extenddelimitersmathcontrolcode",
+ --
+ "noligaturingglyphoptioncode", "nokerningglyphoptioncode", "noexpansionglyphoptioncode", "noprotrusionglyphoptioncode",
+ "noleftkerningglyphoptioncode", "noleftligaturingglyphoptioncode", "norightkerningglyphoptioncode", "norightligaturingglyphoptioncode",
+ "noitaliccorrectionglyphoptioncode", "islargeoperatorglyphoptioncode", "hasitalicshapeglyphoptioncode",
+ --
+ "normalparcontextcode", "vmodeparcontextcode", "vboxparcontextcode", "vtopparcontextcode", "vcenterparcontextcode",
+ "vadjustparcontextcode", "insertparcontextcode", "outputparcontextcode", "alignparcontextcode",
+ "noalignparcontextcode", "spanparcontextcode", "resetparcontextcode",
+ --
+ "leftoriginlistanchorcode", "leftheightlistanchorcode", "leftdepthlistanchorcode",
+ "rightoriginlistanchorcode", "rightheightlistanchorcode", "rightdepthlistanchorcode",
+ "centeroriginlistanchorcode", "centerheightlistanchorcode", "centerdepthlistanchorcode",
+ "halfwaytotallistanchorcode", "halfwayheightlistanchorcode", "halfwaydepthlistanchorcode",
+ "halfwayleftlistanchorcode", "halfwayrightlistanchorcode",
+ --
+ "negatexlistsigncode", "negateylistsigncode", "negatelistsigncode",
--
"fontslantperpoint", "fontinterwordspace", "fontinterwordstretch", "fontinterwordshrink",
"fontexheight", "fontemwidth", "fontextraspace", "slantperpoint",
@@ -130,14 +164,21 @@ return {
--
"typescriptone", "typescripttwo", "typescriptthree", "mathsizesuffix",
--
- "mathordcode", "mathopcode", "mathbincode", "mathrelcode", "mathopencode", "mathclosecode",
- "mathpunctcode", "mathalphacode", "mathinnercode", "mathnothingcode", "mathlimopcode",
- "mathnolopcode", "mathboxcode", "mathchoicecode", "mathaccentcode", "mathradicalcode",
+ "mathordinarycode", "mathordcode", "mathoperatorcode", "mathopcode", "mathbinarycode", "mathbincode",
+ "mathrelationcode", "mathrelcode", "mathopencode", "mathclosecode", "mathpunctuationcode",
+ "mathpunctcode", "mathovercode", "mathundercode", "mathinnercode", "mathradicalcode",
+ "mathfractioncode", "mathmiddlecode", "mathaccentcode", "mathfencedcode", "mathghostcode",
+ "mathvariablecode", "mathactivecode", "mathvcentercode", "mathconstructcode", "mathwrappedcode",
+ "mathbegincode", "mathendcode", "mathexplicitcode", "mathdivisioncode", "mathfactorialcode",
+ "mathdimensioncode", "mathexperimentalcode", "mathtextpunctuationcode",
+ "mathimaginarycode", "mathdifferentialcode", "mathexponentialcode", "mathellipsiscode", "mathfunctioncode", "mathdigitcode",
+ -- "mathtopaccentcode", "mathbottomaccentcode", "mathdelimitercode", "mathrootcode", "mathprintcode", --
+ "mathalphacode", "mathboxcode", "mathchoicecode", "mathnothingcode", "mathlimopcode", "mathnolopcode",
+ "mathunsetcode", "mathunspacedcode", "mathallcode", "mathfakecode", "mathunarycode",
+ "mathmaybeordinarycode", "mathmayberelationcode", "mathmaybebinarycode", "mathnumbergroupcode",
--
"constantnumber", "constantnumberargument", "constantdimen", "constantdimenargument", "constantemptyargument",
--
- "continueifinputfile",
- --
"luastringsep", "!!bs", "!!es",
--
"lefttorightmark", "righttoleftmark", "lrm", "rlm",
@@ -148,9 +189,9 @@ return {
"twoperemspace", "threeperemspace", "fourperemspace", "fiveperemspace", "sixperemspace",
"figurespace", "punctuationspace", "hairspace", "enquad", "emquad",
"zerowidthspace", "zerowidthnonjoiner", "zerowidthjoiner", "zwnj", "zwj",
- "optionalspace", "asciispacechar", "softhyphen",
+ "optionalspace", "asciispacechar", "softhyphen", "autoinsertedspace",
--
- "Ux", "eUx", "Umathaccents",
+ "Ux", "eUx",
--
"parfillleftskip", "parfillrightskip",
--
@@ -158,22 +199,42 @@ return {
--
"wildcardsymbol",
--
- "normalhyphenationmodecode", "automatichyphenationmodecode", "explicithyphenationmodecode",
- "syllablehyphenationmodecode", "uppercasehyphenationmodecode", "completehyphenationmodecode",
- "compoundhyphenationmodecode", "strictstarthyphenationmodecode", "strictendhyphenationmodecode",
- "automaticpenaltyhyphenationmodecode", "explicitpenaltyhyphenationmodecode",
- "permitgluehyphenationmodecode", "permitallhyphenationmodecode", "permitmathreplacehyphenationmodecode",
- "forcecheckhyphenationmodecode", "lazyligatureshyphenationmodecode",
+ "normalhyphenationcode", "automatichyphenationcode", "explicithyphenationcode", "syllablehyphenationcode", "uppercasehyphenationcode",
+ "collapsehyphenationcode", "compoundhyphenationcode", "strictstarthyphenationcode", "strictendhyphenationcode",
+ "automaticpenaltyhyphenationcode", "explicitpenaltyhyphenationcode", "permitgluehyphenationcode", "permitallhyphenationcode",
+ "permitmathreplacehyphenationcode", "forcecheckhyphenationcode", "lazyligatureshyphenationcode", "forcehandlerhyphenationcode",
+ "feedbackcompoundhyphenationcode", "ignoreboundshyphenationcode", "partialhyphenationcode", "completehyphenationcode",
+ --
+ "normalizelinenormalizecode", "parindentskipnormalizecode", "swaphangindentnormalizecode", "swapparsshapenormalizecode",
+ "breakafterdirnormalizecode", "removemarginkernsnormalizecode", "clipwidthnormalizecode", "flattendiscretionariesnormalizecode",
+ "discardzerotabskipsnormalizecode", "flattenhleadersnormalizecode",
+ --
+ "normalizeparnormalizeparcode", "flattenvleadersnormalizeparcode",
+ --
+ "nopreslackclassoptioncode", "nopostslackclassoptioncode",
+ "lefttopkernclassoptioncode", "righttopkernclassoptioncode", "leftbottomkernclassoptioncode", "rightbottomkernclassoptioncode",
+ "lookaheadforendclassoptioncode", "noitaliccorrectionclassoptioncode", "defaultmathclassoptions",
+ -- "openfenceclassoptioncode", "closefenceclassoptioncode", "middlefenceclassoptioncode",
+ "checkligatureclassoptioncode", "checkitaliccorrectionclassoptioncode", "checkkernpairclassoptioncode",
+ "flattenclassoptioncode", "omitpenaltyclassoptioncode", "unpackclassoptioncode", "raiseprimeclassoptioncode",
+ "carryoverlefttopkernclassoptioncode", "carryoverleftbottomkernclassoptioncode", "carryoverrighttopkernclassoptioncode", "carryoverrightbottomkernclassoptioncode",
+ "preferdelimiterdimensionsclassoptioncode", "autoinjectclassoptioncode", "removeitaliccorrectionclassoptioncode",
+ "operatoritaliccorrectionclassoptioncode",
--
- "normalizelinecode", "parindentskipcode", "swaphangindentcode", "swapparsshapecode", "breakafterdircode", "removemarginkernscode", "clipwidthcode",
+ "noligaturingglyphoptioncode", "nokerningglyphoptioncode", "noleftligatureglyphoptioncode",
+ "noleftkernglyphoptioncode", "norightligatureglyphoptioncode", "norightkernglyphoptioncode",
+ "noexpansionglyphoptioncode", "noprotrusionglyphoptioncode", "noitaliccorrectionglyphoptioncode",
+ -- extras:
+ "nokerningcode", "noligaturingcode",
--
- "noligaturingcode", "nokerningcode", "noleftligaturecode", "noleftkerncode", "norightligaturecode", "norightkerncode",
- "noexpansioncode", "noprotrusioncode",
+ "frozenflagcode", "tolerantflagcode", "protectedflagcode", "primitiveflagcode", "permanentflagcode", "noalignedflagcode", "immutableflagcode",
+ "mutableflagcode", "globalflagcode", "overloadedflagcode", "immediateflagcode", "conditionalflagcode", "valueflagcode", "instanceflagcode",
--
- "frozenflagcode", "tolerantflagcode", "protectedflagcode", "primitiveflagcode", "permanentflagcode", "noalignedflagcode", "immutableflagcode", "mutableflagcode",
- "globalflagcode", "overloadedflagcode", "immediateflagcode", "conditionalflagcode", "valueflagcode", "instanceflagcode",
+ "ordmathflattencode", "binmathflattencode", "relmathflattencode", "punctmathflattencode", "innermathflattencode",
--
- "continuewhenlmtxmode"
+ "normalworddiscoptioncode", "preworddiscoptioncode", "postworddiscoptioncode",
+ --
+ "continueifinputfile", "continuewhenlmtxmode", "continuewhenmkivmode",
},
["helpers"] = {
--
@@ -201,6 +262,9 @@ return {
"newcount", "newdimen", "newskip", "newmuskip", "newbox", "newtoks", "newread", "newwrite", "newmarks", "newinsert", "newattribute", "newif",
"newlanguage", "newfamily", "newfam", "newhelp", -- not used
--
+ "newinteger", "newdimension", "newgluespec", "newmugluespec",
+ "aliasinteger", "aliasdimension",
+ --
"then",
"begcsname",
--
@@ -221,11 +285,12 @@ return {
--
"doglobal", "dodoglobal", "redoglobal", "resetglobal",
--
- "donothing", "dontcomplain", "forgetall",
+ "donothing", "untraceddonothing", "dontcomplain", "moreboxtracing", "lessboxtracing", "noboxtracing", "forgetall",
--
"donetrue", "donefalse", "foundtrue", "foundfalse",
--
- "inlineordisplaymath","indisplaymath","forcedisplaymath","startforceddisplaymath","stopforceddisplaymath","startpickupmath","stoppickupmath","reqno",
+ "inlineordisplaymath", "indisplaymath", "forcedisplaymath", "startforceddisplaymath", "stopforceddisplaymath",
+ "startpickupmath", "stoppickupmath", "reqno", "forceinlinemath",
--
"mathortext",
--
@@ -243,10 +308,13 @@ return {
--
"hglue", "vglue", "hfillneg", "vfillneg", "hfilllneg", "vfilllneg",
--
+ "hsplit",
+ --
"ruledhss", "ruledhfil", "ruledhfill", "ruledhfilll", "ruledhfilneg", "ruledhfillneg", "normalhfillneg", "normalhfilllneg",
"ruledvss", "ruledvfil", "ruledvfill", "ruledvfilll", "ruledvfilneg", "ruledvfillneg", "normalvfillneg", "normalvfilllneg",
- "ruledhbox", "ruledvbox", "ruledvtop", "ruledvcenter", "ruledmbox",
- "ruledhpack", "ruledvpack", "ruledtpack",
+ "ruledhbox", "ruledvbox", "ruledvtop", "ruleddbox", "ruledvcenter", "ruledmbox",
+ "ruledhpack", "ruledvpack", "ruledtpack", "ruleddpack",
+ "ruledvsplit", "ruledtsplit", "ruleddsplit",
"ruledhskip", "ruledvskip", "ruledkern", "ruledmskip", "ruledmkern",
"ruledhglue", "ruledvglue", "normalhglue", "normalvglue",
"ruledpenalty",
@@ -270,7 +338,9 @@ return {
--
"groupedcommand", "groupedcommandcs",
"triggergroupedcommand", "triggergroupedcommandcs",
- "simplegroupedcommand", "pickupgroupedcommand",
+ "simplegroupedcommand", "simplegroupedcommandcs",
+ "pickupgroupedcommand", "pickupgroupedcommandcs",
+ "mathgroupedcommandcs",
--
"usedbaselineskip", "usedlineskip", "usedlineskiplimit",
--
@@ -283,7 +353,7 @@ return {
--
"givenwidth", "givenheight", "givendepth", "scangivendimensions",
--
- "scratchwidth", "scratchheight", "scratchdepth", "scratchoffset", "scratchdistance", "scratchtotal",
+ "scratchwidth", "scratchheight", "scratchdepth", "scratchoffset", "scratchdistance", "scratchtotal", "scratchitalic",
"scratchhsize", "scratchvsize",
"scratchxoffset", "scratchyoffset", "scratchhoffset", "scratchvoffset",
"scratchxposition", "scratchyposition",
@@ -333,7 +403,7 @@ return {
--
"quitcondition", "truecondition", "falsecondition",
--
- "tracingall", "tracingnone", "loggingall",
+ "tracingall", "tracingnone", "loggingall", "tracingcatcodes",
"showluatokens",
--
"aliasmacro",
@@ -372,7 +442,8 @@ return {
--
"getparameters", "geteparameters", "getgparameters", "getxparameters", "forgetparameters", "copyparameters",
--
- "getdummyparameters", "dummyparameter", "directdummyparameter", "setdummyparameter", "letdummyparameter", "setexpandeddummyparameter",
+ "getdummyparameters", "dummyparameter", "directdummyparameter", "setdummyparameter", "letdummyparameter",
+ "setexpandeddummyparameter", "resetdummyparameter",
"usedummystyleandcolor", "usedummystyleparameter", "usedummycolorparameter",
--
"processcommalist", "processcommacommand", "quitcommalist", "quitprevcommalist",
@@ -400,8 +471,7 @@ return {
"newconstant", "setnewconstant", "setconstant", "setconstantvalue",
"newconditional", "settrue", "setfalse", "settruevalue", "setfalsevalue", "setconditional",
--
- "newmacro", "setnewmacro", "newfraction",
- "newsignal",
+ "newmacro", "setnewmacro", "newfraction", "newsignal", "newboundary",
--
"dosingleempty", "dodoubleempty", "dotripleempty", "doquadrupleempty", "doquintupleempty", "dosixtupleempty", "doseventupleempty",
"dosingleargument", "dodoubleargument", "dotripleargument", "doquadrupleargument", "doquintupleargument", "dosixtupleargument", "doseventupleargument",
@@ -414,6 +484,8 @@ return {
--
"getfirstcharacter", "doifelsefirstchar", "doiffirstcharelse",
--
+ "mathclassvalue",
+ --
"startnointerference", "stopnointerference",
--
"twodigits","threedigits",
@@ -425,42 +497,68 @@ return {
"strut", "halfstrut", "quarterstrut", "depthstrut", "halflinestrut", "noheightstrut", "setstrut", "strutbox", "strutht", "strutdp", "strutwd", "struthtdp", "strutgap", "begstrut", "endstrut", "lineheight",
"leftboundary", "rightboundary", "signalcharacter",
--
- "shiftbox", "vpackbox", "hpackbox", "vpackedbox", "hpackedbox",
- --
- "ordordspacing", "ordopspacing", "ordbinspacing", "ordrelspacing",
- "ordopenspacing", "ordclosespacing", "ordpunctspacing", "ordinnerspacing",
- --
- "opordspacing", "opopspacing", "opbinspacing", "oprelspacing",
- "opopenspacing", "opclosespacing", "oppunctspacing", "opinnerspacing",
- --
- "binordspacing", "binopspacing", "binbinspacing", "binrelspacing",
- "binopenspacing", "binclosespacing", "binpunctspacing", "bininnerspacing",
- --
- "relordspacing", "relopspacing", "relbinspacing", "relrelspacing",
- "relopenspacing", "relclosespacing", "relpunctspacing", "relinnerspacing",
- --
- "openordspacing", "openopspacing", "openbinspacing", "openrelspacing",
- "openopenspacing", "openclosespacing", "openpunctspacing", "openinnerspacing",
+ "aligncontentleft", "aligncontentmiddle", "aligncontentright",
--
- "closeordspacing", "closeopspacing", "closebinspacing", "closerelspacing",
- "closeopenspacing", "closeclosespacing", "closepunctspacing", "closeinnerspacing",
- --
- "punctordspacing", "punctopspacing", "punctbinspacing", "punctrelspacing",
- "punctopenspacing", "punctclosespacing", "punctpunctspacing", "punctinnerspacing",
+ "shiftbox", "vpackbox", "hpackbox", "vpackedbox", "hpackedbox",
--
- "innerordspacing", "inneropspacing", "innerbinspacing", "innerrelspacing",
- "inneropenspacing", "innerclosespacing", "innerpunctspacing", "innerinnerspacing",
+ -- "ordordspacing", "ordopspacing", "ordbinspacing", "ordrelspacing",
+ -- "ordopenspacing", "ordclosespacing", "ordpunctspacing", "ordinnerspacing",
+ -- "ordfracspacing", "ordradspacing", "ordmiddlespacing", "ordaccentspacing",
+ -- --
+ -- "opordspacing", "opopspacing", "opbinspacing", "oprelspacing",
+ -- "opopenspacing", "opclosespacing", "oppunctspacing", "opinnerspacing",
+ -- "opfracspacing", "opradspacing", "opmiddlespacing", "opaccentspacing",
+ -- --
+ -- "binordspacing", "binopspacing", "binbinspacing", "binrelspacing",
+ -- "binopenspacing", "binclosespacing", "binpunctspacing", "bininnerspacing",
+ -- "binfracspacing", "binradspacing", "binmiddlespacing", "binaccentspacing",
+ -- --
+ -- "relordspacing", "relopspacing", "relbinspacing", "relrelspacing",
+ -- "relopenspacing", "relclosespacing", "relpunctspacing", "relinnerspacing",
+ -- "relfracspacing", "relradspacing", "relmiddlespacing", "relaccentspacing",
+ -- --
+ -- "openordspacing", "openopspacing", "openbinspacing", "openrelspacing",
+ -- "openopenspacing", "openclosespacing", "openpunctspacing", "openinnerspacing",
+ -- "openfracspacing", "openradspacing", "openmiddlespacing", "openaccentspacing",
+ -- --
+ -- "closeordspacing", "closeopspacing", "closebinspacing", "closerelspacing",
+ -- "closeopenspacing", "closeclosespacing", "closepunctspacing", "closeinnerspacing",
+ -- "closefracspacing", "closeradspacing", "closemiddlespacing", "closeaccentspacing",
+ -- --
+ -- "punctordspacing", "punctopspacing", "punctbinspacing", "punctrelspacing",
+ -- "punctopenspacing", "punctclosespacing", "punctpunctspacing", "punctinnerspacing",
+ -- "punctfracspacing", "punctradspacing", "punctmiddlespacing", "punctaccentspacing",
+ -- --
+ -- "innerordspacing", "inneropspacing", "innerbinspacing", "innerrelspacing",
+ -- "inneropenspacing", "innerclosespacing", "innerpunctspacing", "innerinnerspacing",
+ -- "innerfracspacing", "innerradspacing", "innermiddlespacing", "inneraccentspacing",
+ -- --
+ -- "fracordspacing", "fracopspacing", "fracbinspacing", "fracrelspacing",
+ -- "fracopenspacing", "fracclosespacing", "fracpunctspacing", "fracinnerspacing",
+ -- "fracfracspacing", "fracradspacing", "fracmiddlespacing", "fracaccentspacing",
+ -- --
+ -- "radordspacing", "radopspacing", "radbinspacing", "radrelspacing",
+ -- "radopenspacing", "radclosespacing", "radpunctspacing", "radinnerspacing",
+ -- "radfracspacing", "radradspacing", "radmiddlespacing", "radaccentspacing",
+ -- --
+ -- "middleordspacing", "middleopspacing", "middlebinspacing", "middlerelspacing",
+ -- "middleopenspacing", "middleclosespacing", "middlepunctspacing", "middleinnerspacing",
+ -- "middlefracspacing", "middleradspacing", "middlemiddlespacing", "middleaccentspacing",
+ -- --
+ -- "accentordspacing", "accentopspacing", "accentbinspacing", "accentrelspacing",
+ -- "accentopenspacing", "accentclosespacing", "accentpunctspacing", "accentinnerspacing",
+ -- "accentfracspacing", "accentradspacing", "accentmiddlespacing", "accentaccentspacing",
--
"normalreqno",
--
"startimath", "stopimath", "normalstartimath", "normalstopimath",
"startdmath", "stopdmath", "normalstartdmath", "normalstopdmath",
- "normalsuperscript", "normalsubscript", "normalnosuperscript", "normalnosubscript",
- "superscript", "subscript", "nosuperscript", "nosubscript",
+ "normalsuperscript", "normalsubscript", "normalnosuperscript", "normalnosubscript", "normalprimescript",
+ "superscript", "subscript", "nosuperscript", "nosubscript", "primescript",
"superprescript", "subprescript", "nosuperprescript", "nosubsprecript",
--
"uncramped", "cramped",
- "mathstyletrigger", "triggermathstyle",
+ "mathstyletrigger", "triggermathstyle", "triggeredmathstyle",
"mathstylefont", "mathsmallstylefont", "mathstyleface", "mathsmallstyleface", "mathstylecommand", "mathpalette",
"mathstylehbox", "mathstylevbox", "mathstylevcenter", "mathstylevcenteredhbox", "mathstylevcenteredvbox",
"mathtext", "setmathsmalltextbox", "setmathtextbox",
@@ -499,8 +597,6 @@ return {
--
"assumelongusagecs",
--
- "Umathbotaccent", "Umathtopaccent",
- --
"righttolefthbox", "lefttorighthbox", "righttoleftvbox", "lefttorightvbox", "righttoleftvtop", "lefttorightvtop",
"rtlhbox", "ltrhbox", "rtlvbox", "ltrvbox", "rtlvtop", "ltrvtop",
"autodirhbox", "autodirvbox", "autodirvtop",
@@ -508,8 +604,9 @@ return {
"lefttoright", "righttoleft", "checkedlefttoright", "checkedrighttoleft",
"synchronizelayoutdirection","synchronizedisplaydirection","synchronizeinlinedirection",
"dirlre", "dirrle", "dirlro", "dirrlo",
+ "rtltext", "ltrtext",
--
- "lesshyphens", "morehyphens", "nohyphens", "dohyphens",
+ "lesshyphens", "morehyphens", "nohyphens", "dohyphens", "dohyphencollapsing", "nohyphencollapsing",
"compounddiscretionary",
--
"Ucheckedstartdisplaymath", "Ucheckedstopdisplaymath",
@@ -548,7 +645,7 @@ return {
"prelistbox", "postlistbox", "prelistcopy", "postlistcopy", "setprelistbox", "setpostlistbox",
--
"noligaturing", "nokerning", "noexpansion", "noprotrusion",
- "noleftkerning", "noleftligaturing", "norightkerning", "norightligaturing",
+ "noleftkerning", "noleftligaturing", "norightkerning", "norightligaturing", "noitaliccorrection",
--
"futureletnexttoken", "defbackslashbreak", "letbackslashbreak",
--
@@ -556,8 +653,16 @@ return {
--
"suggestedalias",
--
+ "showboxhere",
+ --
+ "discoptioncodestring", "flagcodestring", "frozenparcodestring", "glyphoptioncodestring", "groupcodestring",
+ "hyphenationcodestring", "mathcontrolcodestring", "mathflattencodestring", "normalizecodestring",
+ "parcontextcodestring",
+ --
"newlocalcount", "newlocaldimen", "newlocalskip", "newlocalmuskip", "newlocaltoks", "newlocalbox",
"newlocalwrite", "newlocalread",
"setnewlocalcount", "setnewlocaldimen", "setnewlocalskip", "setnewlocalmuskip", "setnewlocaltoks", "setnewlocalbox",
+ --
+ "ifexpression"
}
}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-mps.lua b/Master/texmf-dist/tex/context/base/mkiv/mult-mps.lua
index a2a74b3b316..008bcbb9fbf 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mult-mps.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/mult-mps.lua
@@ -3,10 +3,10 @@ return {
"btex", "etex", "verbatimtex",
},
shortcuts = {
- "..", "...", "--", "---", "&", "\\",
+ "..", "...", "--", "---", "&", "&&", "\\",
},
primitives = { -- to be checked
- "charcode", "day", "linecap", "linejoin", "miterlimit", "month", "pausing",
+ "charcode", "day", "linecap", "linejoin", "miterlimit", "stacking", "month", "pausing",
"prologues", "showstopping", "time", "tracingcapsules", "tracingchoices", "mpprocset",
"tracingcommands", "tracingequations", "tracinglostchars",
"tracingmacros", "tracingonline", "tracingoutput", "tracingrestores",
@@ -30,7 +30,7 @@ return {
"def", "vardef", "enddef", "expr", "suffix", "text", "primary", "secondary",
"tertiary", "primarydef", "secondarydef", "tertiarydef",
"randomseed", "also", "contour", "doublepath",
- "withcolor", "withcmykcolor", "withpen",
+ "withcolor", "withcmykcolor", "withpen", "withstacking",
"dashed",
"envelope",
"if", "else", "elseif", "fi", "for", "endfor", "forever", "exitif", "within",
@@ -50,7 +50,7 @@ return {
"message", "delimiters", "turningnumber", "errmessage",
"scantokens", "end", "outer", "inner", "write", "to", "readfrom", "closefrom",
"withprescript", "withpostscript",
- "top", "bot", "lft", "rt", "ulft", "urt", "llft", "lrt",
+ -- "top", "bot", "lft", "rt", "ulft", "urt", "llft", "lrt",
--
"redpart", "greenpart", "bluepart",
"cyanpart", "magentapart", "yellowpart",
@@ -58,7 +58,7 @@ return {
"prescriptpart", "postscriptpart",
"rgbcolor", "cmykcolor", -- "greycolor", "graycolor",
"colormodel", "graypart", "greypart", "greycolor", "graycolor",
- "dashpart", "penpart",
+ "dashpart", "penpart", "stackingpart",
-- "colorpart",
"stroked", "filled", "textual", "clipped", "bounded", "pathpart",
"expandafter",
@@ -68,6 +68,15 @@ return {
--
"runscript", "maketext", "numbersystem",
"overloadmode", "setproperty",
+ --
+ "intersectiontimeslist", "arcpoint", "arcpointlist", "subarclength", "maxknotpool", "nocycle",
+ "pathpoint", "pathprecontrol", "pathpostcontrol", "pathdirection",
+ "deltapoint", "deltaprecontrol", "deltapostcontrol", "deltadirection",
+ "corner", "xrange", "yrange",
+ "convexed", "uncontrolled",
+ "nep", "makenep",
+ "withmiterlimit", "withlinejoin", "withlinecap",
+ "centerof", "centerofmass",
},
commands = {
"on", "off",
@@ -84,7 +93,8 @@ return {
"pensquare", "penrazor", "penspec",
"origin", "quartercircle", "right",
"unitsquare", "up", "withdots",
- "abs", "bbox", "ceiling", "center", "cutafter", "cutbefore", "dir",
+ "abs", "bbox", "ceiling", "cutafter", "cutbefore", "dir",
+ -- "center",
"directionpoint", "div", "dotprod", "intersectionpoint", "inverse", "mod",
"round", "unitvector", "whatever",
"cutdraw", "draw", "drawarrow", "drawdblarrow", "fill", "filldraw", "drawdot",
@@ -117,13 +127,15 @@ return {
--
"red", "green", "blue", "cyan", "magenta", "yellow", "black", "white", "background",
--
- "mm", "pt", "dd", "bp", "cm", "pc", "cc", "in",
+ "mm", "pt", "dd", "bp", "cm", "pc", "cc", "in", "dk",
--
- "triplet", "quadruplet", "totransform", "bymatrix",
+ "triplet", "quadruplet", "totransform", "bymatrix", "closedcurve", "closedlines",
--
"primitive", "permanent", "immutable", "mutable", "frozen",
--
"showproperty", "showhashentry",
+ --
+ "top", "bot", "lft", "rt", "ulft", "urt", "llft", "lrt",
},
internals = { -- we need to remove duplicates above
--
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-prm.lua b/Master/texmf-dist/tex/context/base/mkiv/mult-prm.lua
index 250a5dfc18d..72da8971821 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mult-prm.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/mult-prm.lua
@@ -32,14 +32,11 @@ return {
"iffontchar",
"interactionmode",
"interlinepenalties",
- "lastchkdim",
- "lastchknum",
"lastlinefit",
"lastnodetype",
"marks",
"muexpr",
"mutoglue",
- "numericscale",
"numexpr",
"pagediscards",
"parshapedimen",
@@ -57,7 +54,6 @@ return {
"splitdiscards",
"splitfirstmarks",
"topmarks",
- "tracingalignments",
"tracingassigns",
"tracinggroups",
"tracingifs",
@@ -67,165 +63,180 @@ return {
"widowpenalties",
},
["luatex"]={
- "UUskewed",
- "UUskewedwithdelims",
"Uabove",
"Uabovewithdelims",
"Uatop",
"Uatopwithdelims",
"Uchar",
"Udelcode",
- "Udelcodenum",
+ "Udelimited",
"Udelimiter",
"Udelimiterover",
"Udelimiterunder",
"Uhextensible",
"Uleft",
"Umathaccent",
+ "Umathaccentbasedepth",
"Umathaccentbaseheight",
+ "Umathaccentbottomovershoot",
+ "Umathaccentbottomshiftdown",
+ "Umathaccentextendmargin",
+ "Umathaccentsuperscriptdrop",
+ "Umathaccentsuperscriptpercent",
+ "Umathaccenttopovershoot",
+ "Umathaccenttopshiftup",
+ "Umathaccentvariant",
+ "Umathadapttoleft",
+ "Umathadapttoright",
"Umathaxis",
- "Umathbinbinspacing",
- "Umathbinclosespacing",
- "Umathbininnerspacing",
- "Umathbinopenspacing",
- "Umathbinopspacing",
- "Umathbinordspacing",
- "Umathbinpunctspacing",
- "Umathbinrelspacing",
+ "Umathbottomaccentvariant",
"Umathchar",
"Umathcharclass",
"Umathchardef",
"Umathcharfam",
- "Umathcharnum",
- "Umathcharnumdef",
"Umathcharslot",
"Umathclass",
- "Umathclosebinspacing",
- "Umathcloseclosespacing",
- "Umathcloseinnerspacing",
- "Umathcloseopenspacing",
- "Umathcloseopspacing",
- "Umathcloseordspacing",
- "Umathclosepunctspacing",
- "Umathcloserelspacing",
"Umathcode",
- "Umathcodenum",
"Umathconnectoroverlapmin",
+ "Umathdegreevariant",
+ "Umathdelimiterovervariant",
+ "Umathdelimiterpercent",
+ "Umathdelimitershortfall",
+ "Umathdelimiterundervariant",
+ "Umathdenominatorvariant",
+ "Umathdict",
+ "Umathdictdef",
+ "Umathdiscretionary",
+ "Umathextrasubpreshift",
+ "Umathextrasubprespace",
+ "Umathextrasubshift",
+ "Umathextrasubspace",
+ "Umathextrasuppreshift",
+ "Umathextrasupprespace",
+ "Umathextrasupshift",
+ "Umathextrasupspace",
+ "Umathflattenedaccentbasedepth",
+ "Umathflattenedaccentbaseheight",
+ "Umathflattenedaccentbottomshiftdown",
+ "Umathflattenedaccenttopshiftup",
"Umathfractiondelsize",
"Umathfractiondenomdown",
"Umathfractiondenomvgap",
"Umathfractionnumup",
"Umathfractionnumvgap",
"Umathfractionrule",
- "Umathinnerbinspacing",
- "Umathinnerclosespacing",
- "Umathinnerinnerspacing",
- "Umathinneropenspacing",
- "Umathinneropspacing",
- "Umathinnerordspacing",
- "Umathinnerpunctspacing",
- "Umathinnerrelspacing",
+ "Umathfractionvariant",
+ "Umathhextensiblevariant",
"Umathlimitabovebgap",
"Umathlimitabovekern",
"Umathlimitabovevgap",
"Umathlimitbelowbgap",
"Umathlimitbelowkern",
"Umathlimitbelowvgap",
+ "Umathlimits",
+ "Umathnoaxis",
+ "Umathnolimits",
"Umathnolimitsubfactor",
"Umathnolimitsupfactor",
- "Umathopbinspacing",
- "Umathopclosespacing",
- "Umathopenbinspacing",
- "Umathopenclosespacing",
- "Umathopeninnerspacing",
- "Umathopenopenspacing",
- "Umathopenopspacing",
- "Umathopenordspacing",
- "Umathopenpunctspacing",
- "Umathopenrelspacing",
+ "Umathnumeratorvariant",
+ "Umathopenupdepth",
+ "Umathopenupheight",
"Umathoperatorsize",
- "Umathopinnerspacing",
- "Umathopopenspacing",
- "Umathopopspacing",
- "Umathopordspacing",
- "Umathoppunctspacing",
- "Umathoprelspacing",
- "Umathordbinspacing",
- "Umathordclosespacing",
- "Umathordinnerspacing",
- "Umathordopenspacing",
- "Umathordopspacing",
- "Umathordordspacing",
- "Umathordpunctspacing",
- "Umathordrelspacing",
"Umathoverbarkern",
"Umathoverbarrule",
"Umathoverbarvgap",
"Umathoverdelimiterbgap",
+ "Umathoverdelimitervariant",
"Umathoverdelimitervgap",
- "Umathpunctbinspacing",
- "Umathpunctclosespacing",
- "Umathpunctinnerspacing",
- "Umathpunctopenspacing",
- "Umathpunctopspacing",
- "Umathpunctordspacing",
- "Umathpunctpunctspacing",
- "Umathpunctrelspacing",
+ "Umathoverlayaccentvariant",
+ "Umathoverlinevariant",
+ "Umathphantom",
+ "Umathpresubshiftdistance",
+ "Umathpresupshiftdistance",
+ "Umathprimeraise",
+ "Umathprimeraisecomposed",
+ "Umathprimeshiftdrop",
+ "Umathprimeshiftup",
+ "Umathprimespaceafter",
+ "Umathprimevariant",
+ "Umathprimewidth",
"Umathquad",
"Umathradicaldegreeafter",
"Umathradicaldegreebefore",
"Umathradicaldegreeraise",
+ "Umathradicalextensibleafter",
+ "Umathradicalextensiblebefore",
"Umathradicalkern",
"Umathradicalrule",
+ "Umathradicalvariant",
"Umathradicalvgap",
- "Umathrelbinspacing",
- "Umathrelclosespacing",
- "Umathrelinnerspacing",
- "Umathrelopenspacing",
- "Umathrelopspacing",
- "Umathrelordspacing",
- "Umathrelpunctspacing",
- "Umathrelrelspacing",
+ "Umathruledepth",
+ "Umathruleheight",
+ "Umathskeweddelimitertolerance",
"Umathskewedfractionhgap",
"Umathskewedfractionvgap",
+ "Umathsource",
"Umathspaceafterscript",
"Umathspacebeforescript",
- "Umathspacingmode",
"Umathstackdenomdown",
"Umathstacknumup",
+ "Umathstackvariant",
"Umathstackvgap",
+ "Umathsubscriptvariant",
+ "Umathsubshiftdistance",
"Umathsubshiftdown",
"Umathsubshiftdrop",
"Umathsubsupshiftdown",
"Umathsubsupvgap",
"Umathsubtopmax",
"Umathsupbottommin",
+ "Umathsuperscriptvariant",
+ "Umathsupshiftdistance",
"Umathsupshiftdrop",
"Umathsupshiftup",
"Umathsupsubbottommax",
+ "Umathtopaccentvariant",
"Umathunderbarkern",
"Umathunderbarrule",
"Umathunderbarvgap",
"Umathunderdelimiterbgap",
+ "Umathunderdelimitervariant",
"Umathunderdelimitervgap",
+ "Umathunderlinevariant",
+ "Umathuseaxis",
+ "Umathvextensiblevariant",
+ "Umathvoid",
+ "Umathxscale",
+ "Umathyscale",
"Umiddle",
"Unosubprescript",
"Unosubscript",
"Unosuperprescript",
"Unosuperscript",
+ "Uoperator",
"Uover",
"Uoverdelimiter",
"Uoverwithdelims",
+ "Uprimescript",
"Uradical",
"Uright",
"Uroot",
+ "Urooted",
+ "Ushiftedsubprescript",
+ "Ushiftedsubscript",
+ "Ushiftedsuperprescript",
+ "Ushiftedsuperscript",
"Uskewed",
"Uskewedwithdelims",
"Ustack",
"Ustartdisplaymath",
"Ustartmath",
+ "Ustartmathmode",
"Ustopdisplaymath",
"Ustopmath",
+ "Ustopmathmode",
+ "Ustretched",
+ "Ustretchedwithdelims",
"Ustyle",
"Usubprescript",
"Usubscript",
@@ -240,8 +251,22 @@ return {
"afterassigned",
"aftergrouped",
"aliased",
+ "aligncontent",
"alignmark",
+ "alignmentcellsource",
+ "alignmentwrapsource",
"aligntab",
+ "allcrampedstyles",
+ "alldisplaystyles",
+ "allmainstyles",
+ "allmathstyles",
+ "allscriptscriptstyles",
+ "allscriptstyles",
+ "allsplitstyles",
+ "alltextstyles",
+ "alluncrampedstyles",
+ "allunsplitstyles",
+ "amcode",
"atendofgroup",
"atendofgrouped",
"attribute",
@@ -249,48 +274,96 @@ return {
"automaticdiscretionary",
"automatichyphenpenalty",
"automigrationmode",
+ "autoparagraphmode",
"begincsname",
"beginlocalcontrol",
+ "beginmathgroup",
+ "beginsimplegroup",
"boundary",
+ "boxadapt",
+ "boxanchor",
+ "boxanchors",
"boxattribute",
"boxdirection",
+ "boxfreeze",
+ "boxgeometry",
"boxorientation",
+ "boxrepack",
+ "boxshift",
+ "boxsource",
+ "boxtarget",
"boxtotal",
+ "boxvadjust",
"boxxmove",
"boxxoffset",
"boxymove",
"boxyoffset",
"catcodetable",
+ "cdef",
+ "cdefcsname",
+ "cfcode",
"clearmarks",
+ "constant",
+ "copymathatomrule",
+ "copymathparent",
+ "copymathspacing",
"crampeddisplaystyle",
"crampedscriptscriptstyle",
"crampedscriptstyle",
"crampedtextstyle",
+ "csactive",
"csstring",
+ "currentloopiterator",
+ "currentloopnesting",
+ "currentmarks",
+ "dbox",
"defcsname",
+ "detokenized",
"dimensiondef",
+ "dimexpression",
"directlua",
+ "dpack",
+ "dsplit",
"edefcsname",
"efcode",
"endlocalcontrol",
+ "endmathgroup",
+ "endsimplegroup",
"enforced",
+ "etoks",
"etoksapp",
"etokspre",
+ "everybeforepar",
+ "everymathatom",
"everytab",
"exceptionpenalty",
"expand",
+ "expandactive",
"expandafterpars",
"expandafterspaces",
"expandcstoken",
"expanded",
+ "expandedafter",
+ "expandedloop",
"expandtoken",
"explicitdiscretionary",
"explicithyphenpenalty",
"firstvalidlanguage",
+ "flushmarks",
+ "fontcharta",
"fontid",
+ "fontmathcontrol",
+ "fontspecdef",
+ "fontspecid",
+ "fontspecifiedname",
"fontspecifiedsize",
+ "fontspecscale",
+ "fontspecxscale",
+ "fontspecyscale",
+ "fonttextcontrol",
"formatname",
"frozen",
+ "futurecsname",
"futuredef",
"futureexpand",
"futureexpandis",
@@ -299,7 +372,9 @@ return {
"gleaders",
"glet",
"gletcsname",
+ "glettonothing",
"gluespecdef",
+ "glyph",
"glyphdatafield",
"glyphoptions",
"glyphscale",
@@ -310,11 +385,16 @@ return {
"glyphtextscale",
"glyphxoffset",
"glyphxscale",
+ "glyphxscaled",
"glyphyoffset",
"glyphyscale",
+ "glyphyscaled",
"gtoksapp",
"gtokspre",
+ "hccode",
"hjcode",
+ "hmcode",
+ "holdingmigrations",
"hpack",
"hyphenationmin",
"hyphenationmode",
@@ -323,51 +403,95 @@ return {
"ifarguments",
"ifboolean",
"ifchkdim",
+ "ifchkdimension",
"ifchknum",
+ "ifchknumber",
"ifcmpdim",
"ifcmpnum",
"ifcondition",
"ifcstok",
+ "ifdimexpression",
"ifdimval",
"ifempty",
"ifflags",
+ "ifhaschar",
"ifhastok",
"ifhastoks",
"ifhasxtoks",
"ifincsname",
+ "ifinsert",
"ifmathparameter",
"ifmathstyle",
+ "ifnumexpression",
"ifnumval",
"ifparameter",
"ifparameters",
"ifrelax",
"iftok",
+ "ifzerodim",
+ "ifzeronum",
"ignorearguments",
+ "ignoredepthcriterium",
"ignorepars",
"immediate",
"immutable",
+ "indexofcharacter",
+ "indexofregister",
+ "inherited",
"initcatcodetable",
+ "insertbox",
+ "insertcopy",
+ "insertdepth",
+ "insertdistance",
+ "insertheight",
"insertheights",
- "insertht",
+ "insertlimit",
+ "insertmaxdepth",
+ "insertmode",
+ "insertmultiplier",
+ "insertpenalty",
+ "insertprogress",
+ "insertstorage",
+ "insertstoring",
+ "insertunbox",
+ "insertuncopy",
+ "insertwidth",
"instance",
"integerdef",
"lastarguments",
+ "lastatomclass",
+ "lastboundary",
+ "lastchkdim",
+ "lastchknum",
+ "lastleftclass",
+ "lastloopiterator",
"lastnamedcs",
"lastnodesubtype",
+ "lastpageextra",
+ "lastparcontext",
+ "lastrightclass",
"leftmarginkern",
"letcharcode",
"letcsname",
"letfrozen",
+ "letmathatomrule",
+ "letmathparent",
+ "letmathspacing",
"letprotected",
+ "lettonothing",
+ "linebreakcriterium",
"linedirection",
- "linepar",
- "listcallbackmode",
"localbrokenpenalty",
"localcontrol",
"localcontrolled",
+ "localcontrolledloop",
"localinterlinepenalty",
"localleftbox",
+ "localleftboxbox",
+ "localmiddlebox",
+ "localmiddleboxbox",
"localrightbox",
+ "localrightboxbox",
"lpcode",
"luabytecode",
"luabytecodecall",
@@ -379,77 +503,185 @@ return {
"luatexbanner",
"luatexrevision",
"luatexversion",
- "mathdelimitersmode",
+ "mathaccent",
+ "mathatom",
+ "mathatomglue",
+ "mathatomskip",
+ "mathbackwardpenalties",
+ "mathbeginclass",
+ "mathbinary",
+ "mathcheckfencesmode",
+ "mathclose",
+ "mathdictgroup",
+ "mathdictproperties",
"mathdirection",
+ "mathdisplaymode",
"mathdisplayskipmode",
+ "mathdoublescriptmode",
+ "mathendclass",
"matheqnogapstep",
- "mathflattenmode",
- "mathitalicsmode",
+ "mathfenced",
+ "mathfontcontrol",
+ "mathforwardpenalties",
+ "mathfraction",
+ "mathghost",
+ "mathgluemode",
+ "mathgroupingmode",
+ "mathinner",
+ "mathleftclass",
+ "mathlimitsmode",
+ "mathmainstyle",
+ "mathmiddle",
"mathnolimitsmode",
+ "mathopen",
+ "mathoperator",
+ "mathordinary",
+ "mathoverline",
"mathpenaltiesmode",
+ "mathpunctuation",
+ "mathradical",
+ "mathrelation",
+ "mathrightclass",
"mathrulesfam",
"mathrulesmode",
- "mathrulethicknessmode",
"mathscale",
- "mathscriptboxmode",
- "mathscriptcharmode",
"mathscriptsmode",
+ "mathslackmode",
+ "mathspacingmode",
+ "mathstackstyle",
"mathstyle",
+ "mathstylefontid",
"mathsurroundmode",
"mathsurroundskip",
+ "maththreshold",
+ "mathunderline",
+ "meaningasis",
+ "meaningfull",
+ "meaningless",
"mugluespecdef",
"mutable",
"noaligned",
+ "noatomruling",
"noboundary",
"nohrule",
"norelax",
"normalizelinemode",
+ "normalizeparmode",
"nospaces",
"novrule",
+ "numericscale",
+ "numexpression",
"orelse",
+ "orphanpenalties",
+ "orphanpenalty",
"orunless",
"outputbox",
"overloaded",
"overloadmode",
+ "overshoot",
+ "pageboundary",
+ "pageextragoal",
+ "pagevsize",
"parametercount",
- "parattr",
+ "parametermark",
+ "parattribute",
"pardirection",
"permanent",
+ "pettymuskip",
"postexhyphenchar",
"posthyphenchar",
+ "postinlinepenalty",
"prebinoppenalty",
"predisplaygapfactor",
"preexhyphenchar",
"prehyphenchar",
+ "preinlinepenalty",
"prerelpenalty",
"protrudechars",
"protrusionboundary",
"pxdimen",
+ "quitloop",
"quitvmode",
+ "resetmathspacing",
+ "retokenized",
"rightmarginkern",
"rpcode",
"savecatcodetable",
+ "scaledemwidth",
+ "scaledexheight",
+ "scaledextraspace",
+ "scaledfontdimen",
+ "scaledinterwordshrink",
+ "scaledinterwordspace",
+ "scaledinterwordstretch",
+ "scaledmathstyle",
+ "scaledslantperpoint",
"scantextokens",
+ "semiexpand",
+ "semiexpanded",
+ "semiprotected",
+ "setdefaultmathcodes",
"setfontid",
+ "setmathatomrule",
+ "setmathdisplaypostpenalty",
+ "setmathdisplayprepenalty",
+ "setmathignore",
+ "setmathoptions",
+ "setmathpostpenalty",
+ "setmathprepenalty",
+ "setmathspacing",
+ "shapingpenaltiesmode",
+ "shapingpenalty",
"snapshotpar",
+ "srule",
"supmarkmode",
"swapcsvalues",
+ "tabsize",
"textdirection",
"thewithoutunit",
+ "tinymuskip",
+ "todimension",
+ "tohexadecimal",
+ "tointeger",
"tokenized",
"toksapp",
"tokspre",
"tolerant",
+ "tomathstyle",
+ "toscaled",
+ "tosparsedimension",
+ "tosparsescaled",
"tpack",
+ "tracingadjusts",
+ "tracingalignments",
+ "tracingexpressions",
"tracingfonts",
+ "tracingfullboxes",
+ "tracinghyphenation",
+ "tracinginserts",
+ "tracinglevels",
+ "tracinglists",
+ "tracingmarks",
"tracingmath",
+ "tracingnodes",
+ "tracingpenalties",
+ "tsplit",
+ "uleaders",
"undent",
+ "unexpandedloop",
+ "unhpack",
"unletfrozen",
"unletprotected",
+ "untraced",
+ "unvpack",
+ "variablefam",
+ "virtualhrule",
+ "virtualvrule",
"vpack",
"wordboundary",
"wrapuppar",
"xdefcsname",
+ "xtoks",
"xtoksapp",
"xtokspre",
},
@@ -523,6 +755,7 @@ return {
"pdfobjcompresslevel",
"pdfomitcharset",
"pdfomitcidset",
+ "pdfomitinfodict",
"pdfoutline",
"pdfoutput",
"pdfpageattr",
@@ -583,6 +816,7 @@ return {
"accent",
"adjdemerits",
"advance",
+ "advanceby",
"afterassignment",
"aftergroup",
"atop",
@@ -627,6 +861,7 @@ return {
"displaywidowpenalty",
"displaywidth",
"divide",
+ "divideby",
"doublehyphendemerits",
"dp",
"dump",
@@ -662,12 +897,10 @@ return {
"font",
"fontdimen",
"fontname",
- "fontspecifiedname",
"futurelet",
"gdef",
"global",
"globaldefs",
- "glyph",
"halign",
"hangafter",
"hangindent",
@@ -732,16 +965,12 @@ return {
"lower",
"lowercase",
"mark",
- "mathaccent",
"mathbin",
"mathchar",
"mathchardef",
"mathchoice",
- "mathclose",
"mathcode",
- "mathinner",
"mathop",
- "mathopen",
"mathord",
"mathpunct",
"mathrel",
@@ -749,8 +978,6 @@ return {
"maxdeadcycles",
"maxdepth",
"meaning",
- "meaningfull",
- "meaningless",
"medmuskip",
"message",
"middle",
@@ -760,6 +987,7 @@ return {
"moveright",
"mskip",
"multiply",
+ "multiplyby",
"muskip",
"muskipdef",
"newlinechar",
@@ -774,14 +1002,12 @@ return {
"number",
"omit",
"or",
- "ordlimits",
"outer",
"output",
"outputpenalty",
"over",
"overfullrule",
"overline",
- "overshoot",
"overwithdelims",
"pagedepth",
"pagefilllstretch",
@@ -795,6 +1021,8 @@ return {
"parfillleftskip",
"parfillskip",
"parindent",
+ "parinitleftskip",
+ "parinitrightskip",
"parshape",
"parskip",
"patterns",
@@ -814,7 +1042,6 @@ return {
"righthyphenmin",
"rightskip",
"romannumeral",
- "scaledfontdimen",
"scriptfont",
"scriptscriptfont",
"scriptscriptstyle",
@@ -850,14 +1077,11 @@ return {
"thickmuskip",
"thinmuskip",
"time",
- "todimension",
- "tointeger",
"toks",
"toksdef",
"tolerance",
"topmark",
"topskip",
- "toscaled",
"tracingcommands",
"tracinglostchars",
"tracingmacros",
@@ -869,16 +1093,15 @@ return {
"tracingstats",
"uccode",
"uchyph",
+ "unboundary",
"underline",
"unhbox",
"unhcopy",
- "unhpack",
"unkern",
"unpenalty",
"unskip",
"unvbox",
"unvcopy",
- "unvpack",
"uppercase",
"vadjust",
"valign",
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-prm.mkiv b/Master/texmf-dist/tex/context/base/mkiv/mult-prm.mkiv
index 5ffb84d389c..75114c3309c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mult-prm.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/mult-prm.mkiv
@@ -68,7 +68,7 @@
"pdftracingfonts", "pdftrailer", "pdftrailerid", "pdfuniformdeviate",
"pdfuniqueresname", "pdfvorigin", "pdfxform", "pdfxformattr",
"pdfxformmargin", "pdfxformname", "pdfxformresources", "pdfximage",
- "pdfomitcidset", "pdfomitcharset",
+ "pdfomitcidset", "pdfomitcharset", "pdfomitinfodict",
},
aleph = { -- we don't bother
"Alephminorversion", "Alephrevision", "Alephversion",
diff --git a/Master/texmf-dist/tex/context/base/mkiv/mult-sys.mkiv b/Master/texmf-dist/tex/context/base/mkiv/mult-sys.mkiv
index 7e9792720ad..07ec16e2bf6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/mult-sys.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/mult-sys.mkiv
@@ -44,10 +44,15 @@
% definesystemconstant {vn}
\definesystemconstant {afrikaans} \definesystemconstant {af}
+\definesystemconstant {albanian} \definesystemconstant {sq}
+\definesystemconstant {armenian} \definesystemconstant {hy}
+ \definesystemconstant {hye}
+ \definesystemconstant {hyw}
\definesystemconstant {ancientgreek} \definesystemconstant {agr}
\definesystemconstant {ancientlatin} \definesystemconstant {ala}
\definesystemconstant {arabic} \definesystemconstant {ar}
\definesystemconstant {belarussian} \definesystemconstant {be}
+\definesystemconstant {bulgarian} \definesystemconstant {bg}
\definesystemconstant {bokmal} \definesystemconstant {nb}
\definesystemconstant {catalan} \definesystemconstant {ca}
\definesystemconstant {chinese} \definesystemconstant {cn}
@@ -57,7 +62,7 @@
\definesystemconstant {dutch} \definesystemconstant {nl}
\definesystemconstant {english} \definesystemconstant {en}
\definesystemconstant {estonian} \definesystemconstant {et}
-\definesystemconstant {esperanto} % \definesystemconstant {eo}
+\definesystemconstant {esperanto} \definesystemconstant {eo}
\definesystemconstant {farsi} \definesystemconstant {fa} % just persian
\definesystemconstant {finnish} \definesystemconstant {fi}
\definesystemconstant {french} \definesystemconstant {fr}
@@ -337,6 +342,8 @@
\definesystemconstant {righthyphenmin}
\definesystemconstant {lefthyphenchar}
\definesystemconstant {righthyphenchar}
+\definesystemconstant {explicitlefthyphenchar}
+\definesystemconstant {explicitrighthyphenchar}
\definesystemconstant {head}
\definesystemconstant {symbol}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-acc.lua b/Master/texmf-dist/tex/context/base/mkiv/node-acc.lua
index d8f4b25bf3a..5849c045c23 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-acc.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-acc.lua
@@ -32,8 +32,8 @@ local nextglyph = nuts.traversers.glyph
local nextnode = nuts.traversers.node
----- copy_node = nuts.copy
-local insert_after = nuts.insert_after
-local copy_no_components = nuts.copy_no_components
+local insertafter = nuts.insertafter
+local copynocomponents = nuts.components.copynocomponents
local nodecodes = nodes.nodecodes
local gluecodes = nodes.gluecodes
@@ -71,7 +71,7 @@ local function injectspaces(head)
if s == spaceskip_code or s == xspaceskip_code then
-- unless we don't care about the little bit of overhead
-- we can just: local g = copy_node(g)
- local g = copy_no_components(p)
+ local g = copynocomponents(p)
local a = getattr(n,a_characters)
setchar(g,slot)
setlink(p,g,n)
@@ -163,8 +163,8 @@ end)
-- local str = codes[a]
-- local b = pageliteral(format("/Span << /ActualText %s >> BDC", lpdf.tosixteen(str)))
-- local e = pageliteral("EMC")
--- insert_before(head,n,b)
--- insert_after(head,n,e)
+-- insertbefore(head,n,b)
+-- insertafter(head,n,e)
-- done = true
-- end
-- elseif id == hlist_code or id == vlist_code then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-aux.lua b/Master/texmf-dist/tex/context/base/mkiv/node-aux.lua
index d3c537a3bce..5a98b2ea3a5 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-aux.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-aux.lua
@@ -53,11 +53,11 @@ local traversers = nuts.traversers
local nextnode = traversers.node
local nextglyph = traversers.glyph
-local flush_node = nuts.flush
-local flush_list = nuts.flush_list
+local flushnode = nuts.flush
+local flushlist = nuts.flushlist
local hpack_nodes = nuts.hpack
-local unset_attribute = nuts.unset_attribute
-local first_glyph = nuts.first_glyph
+local unsetattribute = nuts.unsetattribute
+local firstglyph = nuts.firstglyph
local copy_node = nuts.copy
local find_tail = nuts.tail
local getbox = nuts.getbox
@@ -85,7 +85,7 @@ local report_error = logs.reporter("node-aux:error")
-- function tex.takebox(id)
-- local box = tex.getbox(id)
-- if box then
--- local copy = node.copy(box)
+-- local copy = nodes.copy(box)
-- local list = box.list
-- copy.list = list
-- box.list = nil
@@ -129,7 +129,7 @@ end
function nuts.takelist(n)
local l = getlist(n)
setlist(n)
- flush_node(n)
+ flushnode(n)
return l
end
@@ -142,7 +142,7 @@ local function repackhlist(list,...)
local temp, b = hpack_nodes(list,...)
list = getlist(temp)
setlist(temp)
- flush_node(temp)
+ flushnode(temp)
return list, b
end
@@ -153,50 +153,59 @@ function nodes.repackhlist(list,...)
return tonode(list), b
end
-local function set_attributes(head,attr,value)
- for n, id in nextnode, head do
- setattr(n,attr,value)
- if id == hlist_node or id == vlist_node then
- set_attributes(getlist(n),attr,value)
- end
- end
-end
+if not nuts.setattributes then
-local function set_unset_attributes(head,attr,value)
- for n, id in nextnode, head do
- if not getattr(n,attr) then
+ local function setattributes(head,attr,value)
+ for n, id in nextnode, head do
setattr(n,attr,value)
- end
- if id == hlist_code or id == vlist_code then
- set_unset_attributes(getlist(n),attr,value)
+ if id == hlist_node or id == vlist_node then
+ setattributes(getlist(n),attr,value)
+ end
end
end
+
+ nuts .setattributes = setattributes
+ nodes.setattributes = vianuts(setattributes)
+
end
-local function unset_attributes(head,attr)
- for n, id in nextnode, head do
- setattr(n,attr,unsetvalue)
- if id == hlist_code or id == vlist_code then
- unset_attributes(getlist(n),attr)
+if not nuts.setunsetattributes then
+
+ local function setunsetattributes(head,attr,value)
+ for n, id in nextnode, head do
+ if not getattr(n,attr) then
+ setattr(n,attr,value)
+ end
+ if id == hlist_code or id == vlist_code then
+ setunsetattributes(getlist(n),attr,value)
+ end
end
end
+
+ nuts .setunsetattributes = setunsetattributes
+ nodes.setunsetattributes = vianuts(setunsetattributes)
+
end
--- for old times sake
+if not nuts.unsetattributes then
-nuts.setattribute = nuts.setattr nodes.setattribute = nodes.setattr
-nuts.getattribute = nuts.getattr nodes.getattribute = nodes.getattr
-nuts.unsetattribute = nuts.unset_attribute nodes.unsetattribute = nodes.unset_attribute
-nuts.has_attribute = nuts.has_attribute nodes.has_attribute = nodes.has_attribute
-nuts.firstglyph = nuts.first_glyph nodes.firstglyph = nodes.first_glyph
+ local function unsetattributes(head,attr)
+ for n, id in nextnode, head do
+ setattr(n,attr,unsetvalue)
+ if id == hlist_code or id == vlist_code then
+ unsetattributes(getlist(n),attr)
+ end
+ end
+ end
+
+ nuts .unsetattributes = unsetattributes
+ nodes.unsetattributes = vianuts(unsetattributes)
-nuts.setattributes = set_attributes nodes.setattributes = vianuts(set_attributes)
-nuts.setunsetattributes = set_unset_attributes nodes.setunsetattributes = vianuts(set_unset_attributes)
-nuts.unsetattributes = unset_attributes nodes.unsetattributes = vianuts(unset_attributes)
+end
function nuts.firstcharacter(n,untagged) -- tagged == subtype > 255
if untagged then
- return first_glyph(n)
+ return firstglyph(n)
else
for g in nextglyph ,n do
return g
@@ -370,7 +379,7 @@ local function rehpack(n,width)
local set, order, sign = getboxglue(temp)
setboxglue(n,set,order,sign)
setlist(temp)
- flush_node(temp)
+ flushnode(temp)
return n
end
@@ -406,7 +415,7 @@ do
local getsubtype = nodes.getsubtype
- function nodes.start_of_par(n)
+ function nodes.startofpar(n)
local s = getsubtype(n)
return s == hmodepar_code or s == vmodepar_code
end
@@ -423,8 +432,6 @@ if not nuts.getnormalizedline then
local getlist = nuts.getlist
local getwidth = nuts.getwidth
- local direct = node.direct
-
local nodecodes = nodes.nodecodes
local skipcodes = nodes.skipcodes
@@ -438,7 +445,7 @@ if not nuts.getnormalizedline then
local indentskip_code = skipcodes.indentskip
local parfillskip_code = skipcodes.parfillskip
- local find_node = direct.find_node or function(h,t,s)
+ nuts.findnode = node.direct.find_node or function(h,t,s)
if h then
if s then
for node, subtype in traversers[t] do
@@ -454,7 +461,6 @@ if not nuts.getnormalizedline then
end
end
- nuts.find_node = find_node
function nuts.getnormalizedline(h)
if getid(h) == hlist_code and getsubtype(h) == line_code then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-bck.lua b/Master/texmf-dist/tex/context/base/mkiv/node-bck.lua
index ec84a3db5c3..b2c36ea5251 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-bck.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-bck.lua
@@ -52,7 +52,7 @@ local nextnode = nuts.traversers.node
local nexthlist = nuts.traversers.hlist
local nextlist = nuts.traversers.list
-local flush_node_list = nuts.flush_list
+local flushnodelist = nuts.flushlist
local new_rule = nodepool.rule
local new_kern = nodepool.kern
@@ -160,7 +160,7 @@ local function add_alignbackgrounds(head,list)
local template = getprop(head,"alignmentchecked")
if template then
list = colored_b(head,list,template[1],hlist_code,template[2])
- flush_node_list(template)
+ flushnodelist(template)
templates[currentrow] = false
return list
end
@@ -238,15 +238,6 @@ function nodes.handlers.backgroundsvbox(head,where)
return head
end
--- interfaces.implement {
--- name = "enablebackgroundboxes",
--- onlyonce = true,
--- actions = enableaction,
--- arguments = { "'shipouts'", "'nodes.handlers.backgrounds'" }
--- }
---
--- doing it in the shipout works as well but this is nicer
-
local function enable(alignmentstoo)
if not enabled then
enabled = true
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-bwc.lua b/Master/texmf-dist/tex/context/base/mkiv/node-bwc.lua
new file mode 100644
index 00000000000..e287de68e88
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-bwc.lua
@@ -0,0 +1,92 @@
+if not modules then modules = { } end modules ['node-bwc'] = {
+ version = 1.001,
+ comment = "companion to node-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- This is a backward compatibility list.
+
+local nodes = nodes
+local nuts = nodes.nuts
+
+nuts .check_discretionaries = nuts .checkdiscretionaries
+nuts .copy_list = nuts .copylist
+nuts .copy_node = nuts .copynode
+nuts .copy_only = nuts .copyonly
+nuts .current_attr = nuts .currentattributes
+nuts .effective_glue = nuts .effectiveglue
+nuts .end_of_math = nuts .endofmath
+nuts .find_attribute = nuts .findattribute
+nuts .first_glyph = nuts .firstglyph
+nuts .flatten_discretionaries = nuts .flattendiscretionaries
+nuts .flush_list = nuts .flushlist
+nuts .flush_node = nuts .flushnode
+nuts .get_attribute = nuts .getattribute
+nuts .get_synctex_fields = nuts .getsynctexfields
+nuts .has_attribute = nuts .hasattribute
+nuts .has_dimensions = nuts .hasdimensions
+nuts .has_field = nuts .hasfield
+nuts .has_glyph = nuts .hasglyph
+nuts .insert_after = nuts .insertafter
+nuts .insert_before = nuts .insertbefore
+nuts .is_direct = nuts .isdirect
+nuts .is_node = nuts .isnode
+nuts .is_nut = nuts .isnut
+nuts .is_zero_glue = nuts .iszeroglue
+nuts .mlist_to_hlist = nuts .mlisttohlist
+nuts .protect_glyph = nuts .protectglyph
+nuts .protect_glyphs = nuts .protectglyphs
+-----.protrusion_skippable = nuts .protrusionskippable
+nuts .set_attribute = nuts .setattribute
+-----.set_synctex_fields = nuts .setsynctexfields
+nuts .start_of_par = nuts .startofpar
+nuts .traverse_id = nuts .traverseid
+nuts .traverse_char = nuts .traversechar
+nuts .traverse_glyph = nuts .traverseglyph
+nuts .traverse_id = nuts .traverseid
+nuts .traverse_list = nuts .traverselist
+nuts .unprotect_glyph = nuts .unprotectglyph
+nuts .unprotect_glyphs = nuts .unprotectglyphs
+nuts .unset_attribute = nuts .unsetattribute
+nuts .uses_font = nuts .usesfont
+nuts .getattr = nuts .getattribute
+nuts .getattrs = nuts .getattributes
+nuts .getattrlist = nuts .getattributelist
+
+-----.check_discretionaries = nodes.checkdiscretionaries
+nodes.copy_list = nodes.copylist
+nodes.copy_node = nodes.copynode
+nodes.current_attributes = nodes.currentattributes
+nodes.effective_glue = nodes.effectiveglue
+nodes.end_of_math = nodes.endofmath
+nodes.find_attribute = nodes.findattribute
+nodes.first_glyph = nodes.firstglyph
+-----.flatten_discretionaries = nodes.flattendiscretionaries
+nodes.flush_list = nodes.flushlist
+nodes.flush_node = nodes.flushnode
+nodes.has_attribute = nodes.hasattribute
+nodes.has_field = nodes.hasfield
+nodes.has_glyph = nodes.hasglyph
+nodes.insert_after = nodes.insertafter
+nodes.insert_before = nodes.insertbefore
+nodes.is_node = nodes.isnode
+nodes.is_direct = nodes.isdirect
+nodes.is_nut = nodes.isnut
+nodes.is_zero_glue = nodes.iszeroglue
+nodes.last_node = nodes.lastnode
+nodes.mlist_to_hlist = nodes.mlisttohlist
+nodes.protect_glyph = nodes.protectglyph
+nodes.protect_glyphs = nodes.protectglyphs
+nodes.protrusion_skippable = nodes.protrusionskippable
+nodes.set_attribute = nodes.setattribute
+nodes.traverse_id = nodes.traverseid
+nodes.traverse_char = nodes.traversechar
+nodes.traverse_glyph = nodes.traverseglyph
+nodes.traverse_id = nodes.traverseid
+nodes.traverse_list = nodes.traverselist
+nodes.unprotect_glyph = nodes.unprotectglyph
+nodes.unprotect_glyphs = nodes.unprotectglyphs
+nodes.unset_attribute = nodes.unsetattribute
+nodes.uses_font = nodes.usesfont
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-fin.lua b/Master/texmf-dist/tex/context/base/mkiv/node-fin.lua
index 373cce3ce60..b9ba169ddb0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-fin.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-fin.lua
@@ -17,57 +17,57 @@ local setmetatableindex = table.setmetatableindex
local attributes, nodes, node = attributes, nodes, node
-local nuts = nodes.nuts
-local tonut = nodes.tonut
-
-local getnext = nuts.getnext
-local getid = nuts.getid
-local getlist = nuts.getlist
-local getleader = nuts.getleader
-local getattr = nuts.getattr
-local getwidth = nuts.getwidth
-local getwhd = nuts.getwhd
-local getorientation = nuts.getorientation
-local has_dimensions = nuts.has_dimensions
-local getbox = nuts.getbox
-
-local setlist = nuts.setlist
-local setleader = nuts.setleader
-
-local copy_node = nuts.copy
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
-
-local nextnode = nuts.traversers.node
-
-local nodecodes = nodes.nodecodes
-local rulecodes = nodes.rulecodes
-
-local boxrule_code = rulecodes.box
-local imagerule_code = rulecodes.image
-local emptyrule_code = rulecodes.empty
-
-local glyph_code = nodecodes.glyph
-local disc_code = nodecodes.disc
-local glue_code = nodecodes.glue
-local rule_code = nodecodes.rule
-local hlist_code = nodecodes.hlist
-local vlist_code = nodecodes.vlist
-
-local texlists = tex.lists
-local texgetnest = tex.getnest
-
-local states = attributes.states
-local numbers = attributes.numbers
-local a_trigger = attributes.private('trigger')
-local triggering = false
-
-local implement = interfaces.implement
-
-local starttiming = statistics.starttiming
-local stoptiming = statistics.stoptiming
-local loadstripped = utilities.lua.loadstripped
-local unsetvalue = attributes.unsetvalue
+local nuts = nodes.nuts
+local tonut = nodes.tonut
+
+local getnext = nuts.getnext
+local getid = nuts.getid
+local getlist = nuts.getlist
+local getleader = nuts.getleader
+local getattr = nuts.getattr
+local getwidth = nuts.getwidth
+local getwhd = nuts.getwhd
+local getorientation = nuts.getorientation
+local hasdimensions = nuts.hasdimensions
+local getbox = nuts.getbox
+
+local setlist = nuts.setlist
+local setleader = nuts.setleader
+
+local copy_node = nuts.copy
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
+
+local nextnode = nuts.traversers.node
+
+local nodecodes = nodes.nodecodes
+local rulecodes = nodes.rulecodes
+
+local boxrule_code = rulecodes.box
+local imagerule_code = rulecodes.image
+local emptyrule_code = rulecodes.empty
+
+local glyph_code = nodecodes.glyph
+local disc_code = nodecodes.disc
+local glue_code = nodecodes.glue
+local rule_code = nodecodes.rule
+local hlist_code = nodecodes.hlist
+local vlist_code = nodecodes.vlist
+
+local texlists = tex.lists
+local texgetnest = tex.getnest
+
+local states = attributes.states
+local numbers = attributes.numbers
+local a_trigger = attributes.private('trigger')
+local triggering = false
+
+local implement = interfaces.implement
+
+local starttiming = statistics.starttiming
+local stoptiming = statistics.stoptiming
+local loadstripped = utilities.lua.loadstripped
+local unsetvalue = attributes.unsetvalue
-- these two will be like trackers
@@ -163,13 +163,13 @@ function states.finalize(namespace,attribute,head) -- is this one ok?
if id == hlist_code or id == vlist_code then
local content = getlist(head)
if content then
- local list = insert_node_before(content,content,copy_node(nsnone)) -- two return values
+ local list = insertnodebefore(content,content,copy_node(nsnone)) -- two return values
if list ~= content then
setlist(head,list)
end
end
else
- head = insert_node_before(head,head,copy_node(nsnone))
+ head = insertnodebefore(head,head,copy_node(nsnone))
end
return head, true
end
@@ -199,20 +199,20 @@ local function process(attribute,head,inheritance,default) -- one attribute
if outer then
if default and outer == inheritance then
if current ~= default then
- head = insert_node_before(head,stack,copy_node(nsdata[default]))
+ head = insertnodebefore(head,stack,copy_node(nsdata[default]))
current = default
end
elseif current ~= outer then
- head = insert_node_before(head,stack,copy_node(nsdata[c]))
+ head = insertnodebefore(head,stack,copy_node(nsdata[c])) -- hm, what is c ... bug
current = outer
end
elseif default and inheritance then
if current ~= default then
- head = insert_node_before(head,stack,copy_node(nsdata[default]))
+ head = insertnodebefore(head,stack,copy_node(nsdata[default]))
current = default
end
elseif current > 0 then
- head = insert_node_before(head,stack,copy_node(nsnone))
+ head = insertnodebefore(head,stack,copy_node(nsnone))
current = 0
end
end
@@ -236,7 +236,7 @@ local function process(attribute,head,inheritance,default) -- one attribute
-- end nested --
end
elseif id == rule_code then
- check = has_dimensions(stack)
+ check = hasdimensions(stack)
end
-- much faster this way than using a check() and nested() function
if check then
@@ -244,11 +244,11 @@ local function process(attribute,head,inheritance,default) -- one attribute
if c then
if default and c == inheritance then
if current ~= default then
- head = insert_node_before(head,stack,copy_node(nsdata[default]))
+ head = insertnodebefore(head,stack,copy_node(nsdata[default]))
current = default
end
elseif current ~= c then
- head = insert_node_before(head,stack,copy_node(nsdata[c]))
+ head = insertnodebefore(head,stack,copy_node(nsdata[c]))
current = c
end
if leader then
@@ -281,11 +281,11 @@ local function process(attribute,head,inheritance,default) -- one attribute
end
elseif default and inheritance then
if current ~= default then
- head = insert_node_before(head,stack,copy_node(nsdata[default]))
+ head = insertnodebefore(head,stack,copy_node(nsdata[default]))
current = default
end
elseif current > 0 then
- head = insert_node_before(head,stack,copy_node(nsnone))
+ head = insertnodebefore(head,stack,copy_node(nsnone))
current = 0
end
check = false
@@ -326,7 +326,7 @@ local function selective(attribute,head,inheritance,default) -- two attributes
if default and outer == inheritance then
if current ~= default then
local data = nsdata[default]
- head = insert_node_before(head,stack,copy_node(data[nsforced or getattr(stack,nsselector) or nsselector]))
+ head = insertnodebefore(head,stack,copy_node(data[nsforced or getattr(stack,nsselector) or nsselector]))
current = default
end
else
@@ -334,7 +334,7 @@ local function selective(attribute,head,inheritance,default) -- two attributes
-- local s = nsforced or getattr(stack,nsselector)
if current ~= outer or current_selector ~= s then
local data = nsdata[outer]
- head = insert_node_before(head,stack,copy_node(data[nsforced or s or nsselector]))
+ head = insertnodebefore(head,stack,copy_node(data[nsforced or s or nsselector]))
current = outer
current_selector = s
end
@@ -342,11 +342,11 @@ local function selective(attribute,head,inheritance,default) -- two attributes
elseif default and inheritance then
if current ~= default then
local data = nsdata[default]
- head = insert_node_before(head,stack,copy_node(data[nsforced or getattr(stack,nsselector) or nsselector]))
+ head = insertnodebefore(head,stack,copy_node(data[nsforced or getattr(stack,nsselector) or nsselector]))
current = default
end
elseif current > 0 then
- head = insert_node_before(head,stack,copy_node(nsnone))
+ head = insertnodebefore(head,stack,copy_node(nsnone))
current, current_selector = 0, 0
end
end
@@ -374,7 +374,7 @@ local function selective(attribute,head,inheritance,default) -- two attributes
-- so no redundant color stuff (only here, layers for instance should obey)
check = false
else
- check = has_dimensions(stack)
+ check = hasdimensions(stack)
end
else
end
@@ -384,7 +384,7 @@ local function selective(attribute,head,inheritance,default) -- two attributes
if default and c == inheritance then
if current ~= default then
local data = nsdata[default]
- head = insert_node_before(head,stack,copy_node(data[nsforced or getattr(stack,nsselector) or nsselector]))
+ head = insertnodebefore(head,stack,copy_node(data[nsforced or getattr(stack,nsselector) or nsselector]))
current = default
end
else
@@ -392,7 +392,7 @@ local function selective(attribute,head,inheritance,default) -- two attributes
-- local s = nsforced or getattr(stack,nsselector)
if current ~= c or current_selector ~= s then
local data = nsdata[c]
- head = insert_node_before(head,stack,copy_node(data[nsforced or s or nsselector]))
+ head = insertnodebefore(head,stack,copy_node(data[nsforced or s or nsselector]))
current = c
current_selector = s
end
@@ -419,11 +419,11 @@ local function selective(attribute,head,inheritance,default) -- two attributes
elseif default and inheritance then
if current ~= default then
local data = nsdata[default]
- head = insert_node_before(head,stack,copy_node(data[nsforced or getattr(stack,nsselector) or nsselector]))
+ head = insertnodebefore(head,stack,copy_node(data[nsforced or getattr(stack,nsselector) or nsselector]))
current = default
end
elseif current > 0 then
- head = insert_node_before(head,stack,copy_node(nsnone))
+ head = insertnodebefore(head,stack,copy_node(nsnone))
current, current_selector = 0, 0
end
check = false
@@ -470,9 +470,9 @@ local function stacked(attribute,head,default) -- no triggering, no inheritance,
if a and current ~= a and nslistwise[a] then -- viewerlayer / needs checking, see below
local p = current
current = a
- head = insert_node_before(head,stack,copy_node(nsdata[a]))
+ head = insertnodebefore(head,stack,copy_node(nsdata[a]))
list = stacked(attribute,content,current) -- two return values
- head, stack = insert_node_after(head,stack,copy_node(nsnone))
+ head, stack = insertnodeafter(head,stack,copy_node(nsnone))
current = p
else
list = stacked(attribute,content,current)
@@ -485,13 +485,13 @@ local function stacked(attribute,head,default) -- no triggering, no inheritance,
end
end
elseif id == rule_code then
- check = has_dimensions(stack)
+ check = hasdimensions(stack)
end
if check then
local a = getattr(stack,attribute)
if a then
if current ~= a then
- head = insert_node_before(head,stack,copy_node(nsdata[a]))
+ head = insertnodebefore(head,stack,copy_node(nsdata[a]))
depth = depth + 1
current = a
end
@@ -508,7 +508,7 @@ local function stacked(attribute,head,default) -- no triggering, no inheritance,
elseif default > 0 then
--
elseif current > 0 then
- head = insert_node_before(head,stack,copy_node(nsnone))
+ head = insertnodebefore(head,stack,copy_node(nsnone))
depth = depth - 1
current = 0
end
@@ -517,7 +517,7 @@ local function stacked(attribute,head,default) -- no triggering, no inheritance,
stack = getnext(stack)
end
while depth > 0 do
- head = insert_node_after(head,stack,copy_node(nsnone))
+ head = insertnodeafter(head,stack,copy_node(nsnone))
depth = depth - 1
end
return head
@@ -556,12 +556,12 @@ local function stacker(attribute,head,default) -- no triggering, no inheritance,
if nslistwise then
local a = getattr(current,attribute)
if a and attrib ~= a and nslistwise[a] then -- viewerlayer
- head = insert_node_before(head,current,copy_node(nsdata[a]))
+ head = insertnodebefore(head,current,copy_node(nsdata[a]))
list = stacker(attribute,content,a)
if list ~= content then
setlist(current,list)
end
- head, current = insert_node_after(head,current,copy_node(nsnone))
+ head, current = insertnodeafter(head,current,copy_node(nsnone))
else
list = stacker(attribute,content,attrib)
if list ~= content then
@@ -576,7 +576,7 @@ local function stacker(attribute,head,default) -- no triggering, no inheritance,
end
end
elseif id == rule_code then
- check = has_dimensions(current)
+ check = hasdimensions(current)
end
if check then
@@ -588,7 +588,7 @@ local function stacker(attribute,head,default) -- no triggering, no inheritance,
end
local n = nsstep(a)
if n then
- head = insert_node_before(head,current,n) -- a
+ head = insertnodebefore(head,current,n) -- a
end
attrib = a
if leader then
@@ -617,7 +617,7 @@ local function stacker(attribute,head,default) -- no triggering, no inheritance,
if stacked then
local n = nsend()
while n do
- head = insert_node_after(head,previous,n)
+ head = insertnodeafter(head,previous,n)
n = nsend()
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-fnt.lua b/Master/texmf-dist/tex/context/base/mkiv/node-fnt.lua
index f3bb6228fe0..b3a8ccc1ee8 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-fnt.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-fnt.lua
@@ -60,21 +60,19 @@ local setprev = nuts.setprev
local isglyph = nuts.isglyph -- unchecked
local ischar = nuts.ischar -- checked
------ traverse_id = nuts.traverse_id
------ traverse_char = nuts.traverse_char
local nextboundary = nuts.traversers.boundary
local nextdisc = nuts.traversers.disc
local nextchar = nuts.traversers.char
-local flush_node = nuts.flush
+local flushnode = nuts.flush
local disc_code = nodecodes.disc
local boundary_code = nodecodes.boundary
local wordboundary_code = boundarycodes.word
-local protect_glyphs = nuts.protect_glyphs
-local unprotect_glyphs = nuts.unprotect_glyphs
+local protectglyphs = nuts.protectglyphs
+local unprotectglyphs = nuts.unprotectglyphs
local setmetatableindex = table.setmetatableindex
@@ -196,7 +194,7 @@ do
local a, u, b, r
local function protectnone()
- protect_glyphs(firstnone,lastnone)
+ protectglyphs(firstnone,lastnone)
firstnone = nil
end
@@ -392,7 +390,7 @@ do
end
end
end
- flush_node(r)
+ flushnode(r)
end
end
@@ -542,5 +540,5 @@ do
end
-handlers.protectglyphs = protect_glyphs
-handlers.unprotectglyphs = unprotect_glyphs
+handlers.protectglyphs = protectglyphs
+handlers.unprotectglyphs = unprotectglyphs
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-gcm.lua b/Master/texmf-dist/tex/context/base/mkiv/node-gcm.lua
index 5b598f6b033..de0018b4cf3 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-gcm.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-gcm.lua
@@ -8,37 +8,37 @@ if not modules then modules = { } end modules ['node-gmc'] = {
local type, tostring = type, tostring
-local nodes = nodes
-local nodecodes = nodes.nodecodes
-local ligature_code = nodes.glyphcodes.ligature
-local nuts = nodes.nuts
+local nodes = nodes
+local nodecodes = nodes.nodecodes
+local ligature_code = nodes.glyphcodes.ligature
+local nuts = nodes.nuts
-local getnext = nuts.getnext
-local getsubtype = nuts.getsubtype
-local getprev = nuts.getprev
-local setlink = nuts.setlink
-local nextglyph = nuts.traversers.glyph
-local copy_node = nuts.copy
-local isglyph = nuts.isglyph
+local getnext = nuts.getnext
+local getsubtype = nuts.getsubtype
+local getprev = nuts.getprev
+local setlink = nuts.setlink
+local nextglyph = nuts.traversers.glyph
+local copynode = nuts.copy
+local isglyph = nuts.isglyph
-local report_error = logs.reporter("node-aux:error")
+local report_error = logs.reporter("node-aux:error")
-local get_components = node.direct.getcomponents
-local set_components = node.direct.setcomponents
+local getcomponents = node.direct.getcomponents
+local setcomponents = node.direct.setcomponents
-local function copy_no_components(g,copyinjection)
- local components = get_components(g)
+local function copynocomponents(g,copyinjection)
+ local components = getcomponents(g)
if components then
- set_components(g)
- local n = copy_node(g)
+ setcomponents(g)
+ local n = copynode(g)
if copyinjection then
copyinjection(n,g)
end
- set_components(g,components)
+ setcomponents(g,components)
-- maybe also upgrade the subtype but we don't use it anyway
return n
else
- local n = copy_node(g)
+ local n = copynode(g)
if copyinjection then
copyinjection(n,g)
end
@@ -46,11 +46,11 @@ local function copy_no_components(g,copyinjection)
end
end
-local function copy_only_glyphs(current)
+local function copyonlyglyphs(current)
local head = nil
local previous = nil
for n in nextglyph, current do
- n = copy_node(n)
+ n = copynode(n)
if head then
setlink(previous,n)
else
@@ -63,14 +63,14 @@ end
-- start is a mark and we need to keep that one
-local function count_components(start,marks)
+local function countcomponents(start,marks)
local char = isglyph(start)
if char then
if getsubtype(start) == ligature_code then
local n = 0
- local components = get_components(start)
+ local components = getcomponents(start)
while components do
- n = n + count_components(components,marks)
+ n = n + countcomponents(components,marks)
components = getnext(components)
end
return n
@@ -81,16 +81,18 @@ local function count_components(start,marks)
return 0
end
-local function flush_components()
+local function flushcomponents()
-- this is a no-op in mkiv / generic
end
-nuts.set_components = set_components
-nuts.get_components = get_components
-nuts.copy_only_glyphs = copy_only_glyphs
-nuts.copy_no_components = copy_no_components
-nuts.count_components = count_components
-nuts.flush_components = flush_components
+nuts.components = {
+ set = setcomponents,
+ get = getcomponents,
+ copyonlyglyphs = copyonlyglyphs,
+ copynocomponents = copynocomponents,
+ count = countcomponents,
+ flush = flushcomponents,
+}
nuts.setcomponents = function() report_error("unsupported: %a","setcomponents") end
nuts.getcomponents = function() report_error("unsupported: %a","getcomponents") end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/node-ini.lua
index 701e3efa92c..ef7d4afed2d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-ini.lua
@@ -168,8 +168,9 @@ literalvalues = allocate(swapped(literalvalues,literalvalues))
if not nodecodes.delimiter then
-- as in luametatex / lmtx
- nodecodes.delimiter = nodecodes.delim
- nodecodes[nodecodes.delimiter] = "delimiter"
+ local d = nodecodes.delim
+ nodecodes.delimiter = d
+ nodecodes[d] = "delimiter"
nodecodes.delim = nil
end
@@ -180,6 +181,14 @@ if not nodecodes.par then
nodecodes[p] = "par"
end
+if not nodecodes.insert then
+ -- as in luametatex / lmtx
+ local i = nodecodes.ins
+ nodecodes.insert = i
+ nodecodes[i] = "insert"
+ nodecodes.ins = nil
+end
+
if not gluecodes.indentskip then
gluecodes.indentskip = gluecodes.userskip
gluecodes.lefthangskip = gluecodes.userskip
@@ -192,6 +201,7 @@ end
if not whatcodes.literal then
whatcodes.literal = whatcodes.pdfliteral
+ whatcodes.lateliteral = whatcodes.pdflateliteral
whatcodes.save = whatcodes.pdfsave
whatcodes.restore = whatcodes.pdfrestore
whatcodes.setmatrix = whatcodes.pdfsetmatrix
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/node-ini.mkiv
index 072cb319aad..10998d0604c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-ini.mkiv
@@ -29,7 +29,6 @@
\registerctxluafile{node-snp}{}
\registerctxluafile{node-tsk}{}
\registerctxluafile{node-tex}{}
-\registerctxluafile{node-dir}{} % experimental, not yet (and maybe never) used
\registerctxluafile{node-pro}{}
\registerctxluafile{node-ser}{}
%registerctxluafile{node-ext}{}
@@ -38,6 +37,7 @@
\registerctxluafile{node-scn}{}
\registerctxluafile{node-syn}{}
\registerctxluafile{node-par}{}
+\registerctxluafile{node-bwc}{} % might stay
\newcount\c_node_tracers_show_box % box number
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-ltp.lua b/Master/texmf-dist/tex/context/base/mkiv/node-ltp.lua
index 6cb9e8d102f..f008422e054 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-ltp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-ltp.lua
@@ -220,7 +220,7 @@ local getpre = nuts.getpre
local setpre = nuts.setpre
local isglyph = nuts.isglyph
-local start_of_par = nuts.start_of_par
+local startofpar = nuts.startofpar
local setfield = nuts.setfield
local setlink = nuts.setlink
@@ -240,16 +240,16 @@ local setexpansion = nuts.setexpansion
local find_tail = nuts.tail
local copy_node = nuts.copy
-local flush_node = nuts.flush
-local flush_node_list = nuts.flush_list
+local flushnode = nuts.flush
+local flushnodelist = nuts.flushlist
----- hpack_nodes = nuts.hpack
local xpack_nodes = nuts.hpack
local replace_node = nuts.replace
local remove_node = nuts.remove
-local insert_node_after = nuts.insert_after
-local insert_node_before = nuts.insert_before
-local is_zero_glue = nuts.is_zero_glue
-local is_skipable = nuts.protrusion_skippable
+local insertnodeafter = nuts.insertafter
+local insertnodebefore = nuts.insertbefore
+local iszeroglue = nuts.iszeroglue
+local protrusionskippable = nuts.protrusionskippable
local setattributelist = nuts.setattributelist
local find_node = nuts.find_node
@@ -267,7 +267,7 @@ local gluecodes = nodes.gluecodes
local temp_code = nodecodes.temp
local glyph_code = nodecodes.glyph
-local ins_code = nodecodes.ins
+local insert_code = nodecodes.insert
local mark_code = nodecodes.mark
local adjust_code = nodecodes.adjust
local penalty_code = nodecodes.penalty
@@ -386,7 +386,7 @@ local function inject_dirs_at_begin_of_line(stack,current)
for i=1,n do
local d = new_direction(stack[i])
setattributelist(d,current)
- h, current = insert_node_after(h,current,d)
+ h, current = insertnodeafter(h,current,d)
end
stack.n = 0
return h
@@ -421,14 +421,14 @@ end
for i=n,1,-1 do
local d = new_direction(stack[i],true)
setattributelist(d,start)
- h, current = insert_node_after(h,current,d)
+ h, current = insertnodeafter(h,current,d)
end
end
stack.n = n
return current
end
-local ignore_math_skip = node.direct.ignore_math_skip or function(current)
+local ignoremathskip = nuts.ignoremathskip or function(current)
local mode = texget("mathskipmode")
if mode == 6 or mode == 7 then
local b = true
@@ -744,7 +744,7 @@ local function find(head) -- do we really want to recurse into an hlist?
else
return head
end
- elseif is_skipable(head) then
+ elseif protrusionskippable(head) then
head = getnext(head)
else
return head
@@ -798,7 +798,7 @@ local function find(head,tail)
else
return tail
end
- elseif is_skipable(tail) then
+ elseif protrusionskippable(tail) then
tail = getprev(tail)
else
return tail
@@ -1010,7 +1010,7 @@ do
end
local function used_skip(s)
- return s and not is_zero_glue(s) and s
+ return s and not iszeroglue(s) and s
end
local function initialize_line_break(head,display)
@@ -1357,7 +1357,7 @@ do
report_parbuilders('unsupported disc at location %a',3)
end
if pre then
- flush_node_list(pre)
+ flushnodelist(pre)
pre = nil -- signal
end
if replace then
@@ -1368,13 +1368,13 @@ do
setdisc(lastnode,pre,post,replace)
local pre, post, replace = getdisc(prevlast)
if pre then
- flush_node_list(pre)
+ flushnodelist(pre)
end
if replace then
- flush_node_list(replace)
+ flushnodelist(replace)
end
if post then
- flush_node_list(post)
+ flushnodelist(post)
end
setdisc(prevlast) -- nil,nil,nil
elseif subtype == firstdisc_code then
@@ -1387,7 +1387,7 @@ do
setpost(lastnode)
end
if replace then
- flush_node_list(replace)
+ flushnodelist(replace)
end
if pre then
setlink(prevlast,pre)
@@ -1414,7 +1414,7 @@ do
lastnode = inject_dirs_at_end_of_line(dirstack,lastnode,getnext(head),current_break.cur_break)
local rightbox = current_break.passive_right_box
if rightbox then
- lastnode = insert_node_after(lastnode,lastnode,copy_node(rightbox))
+ lastnode = insertnodeafter(lastnode,lastnode,copy_node(rightbox))
end
if not lineend then
lineend = lastnode
@@ -1495,8 +1495,8 @@ do
-- so we inherit attributes, lineend is new pseudo head
local k = new_rightmarginkern(copy_node(last_rightmost_char),-w)
setattributelist(k,p)
--- insert_node_after(c,c,k)
- insert_node_after(p,p,k)
+-- insertnodeafter(c,c,k)
+ insertnodeafter(p,p,k)
-- if c == lineend then
-- lineend = getnext(c)
-- end
@@ -1512,7 +1512,7 @@ do
if not glue_break then
local rs = new_rightskip(unpack(rightskip))
setattributelist(rs,lineend)
- start, lineend = insert_node_after(start,lineend,rs)
+ start, lineend = insertnodeafter(start,lineend,rs)
end
local rs = lineend
-- insert leftbox (if needed after parindent)
@@ -1520,9 +1520,9 @@ do
if leftbox then
local first = getnext(start)
if first and current_line == (par.first_line + 1) and getid(first) == hlist_code and not getlist(first) then
- insert_node_after(start,start,copy_node(leftbox))
+ insertnodeafter(start,start,copy_node(leftbox))
else
- start = insert_node_before(start,start,copy_node(leftbox))
+ start = insertnodebefore(start,start,copy_node(leftbox))
end
end
if protrude_chars > 0 then
@@ -1534,7 +1534,7 @@ do
if last_leftmost_char and w ~= 0 then
local k = new_rightmarginkern(copy_node(last_leftmost_char),-w)
setattributelist(k,p)
- start = insert_node_before(start,start,k)
+ start = insertnodebefore(start,start,k)
end
end
end
@@ -1546,7 +1546,7 @@ do
-- so we inherit attributes, start is pseudo head and moves back
local k = new_leftmarginkern(copy_node(last_leftmost_char),-w)
setattributelist(k,p)
- start = insert_node_before(start,start,k)
+ start = insertnodebefore(start,start,k)
end
end
end
@@ -1556,7 +1556,7 @@ do
-- we could check for non zero but we will normalize anyway
ls = new_leftskip(unpack(leftskip))
setattributelist(ls,start)
- start = insert_node_before(start,start,ls)
+ start = insertnodebefore(start,start,ls)
end
if normalize > 0 then
local par = nil
@@ -1570,7 +1570,7 @@ do
indent = n
end
elseif id == par_code then
- if start_of_par(n) then --- maybe subtype check instead
+ if startofpar(n) then --- maybe subtype check instead
par = n
elseif noflocals then
noflocals = noflocals + 1
@@ -1635,11 +1635,11 @@ do
setattributelist(r,start)
if normalize > 3 then
-- makes most sense
- start = insert_node_after(start,ls,l)
- start = insert_node_before(start,rs,r)
+ start = insertnodeafter(start,ls,l)
+ start = insertnodebefore(start,rs,r)
else
- start = insert_node_before(start,ls,l)
- start = insert_node_after(start,rs,r)
+ start = insertnodebefore(start,ls,l)
+ start = insertnodeafter(start,rs,r)
end
cur_width = hsize
cur_indent = 0
@@ -1740,7 +1740,7 @@ do
end
if current ~= head then
setnext(current)
- flush_node_list(getnext(head))
+ flushnodelist(getnext(head))
setlink(head,next)
end
end
@@ -1759,7 +1759,7 @@ par.head = head
report_parbuilders("no local par node")
end
end
- flush_node(h)
+ flushnode(h)
par.head = nil -- needs checking
end
current_line = current_line - 1
@@ -1799,7 +1799,7 @@ par.head = head
if next then
setprev(next)
end
- flush_node(head)
+ flushnode(head)
end
post_line_break(par)
reset_meta(par)
@@ -2600,7 +2600,7 @@ par.head = head
end
elseif id == math_code then
auto_breaking = getsubtype(current) == endmath_code
- if is_zero_glue(current) or ignore_math_skip(current) then
+ if iszeroglue(current) or ignoremathskip(current) then
local v = getnext(current)
if auto_breaking and getid(v) == glue_code then
p_active, n_active = try_break(0, unhyphenated_code, par, first_p, current, checked_expansion)
@@ -2624,7 +2624,7 @@ par.head = head
par.internal_right_box = getfield(current,"box_right")
par.internal_right_box_width = getfield(current,"box_right_width")
elseif trace_unsupported then
- if id == mark_code or id == ins_code or id == adjust_code then
+ if id == mark_code or id == insert_code or id == adjust_code then
-- skip
else
report_parbuilders("node of type %a found in paragraph",type(id))
@@ -3090,7 +3090,7 @@ do
end
natural = natural + wd
elseif id == math_code then
- if is_zero_glue(current) or ignore_math_skip(current) then
+ if iszeroglue(current) or ignoremathskip(current) then
natural = natural + getkern(current)
else
local wd, stretch, shrink, stretch_order, shrink_order = getglue(current)
@@ -3098,7 +3098,7 @@ do
total_shrink [shrink_order] = total_shrink[shrink_order] + shrink
natural = natural + wd
end
- elseif id == ins_code or id == mark_code then
+ elseif id == insert_code or id == mark_code then
local prev, next = getboth(current)
if adjust_tail then -- todo
setlink(prev,next)
@@ -3272,7 +3272,7 @@ do
if p and getid(p) == marginkern_code then
found = p
end
- insert_node_before(head,found,g)
+ insertnodebefore(head,found,g)
end
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-met.lua b/Master/texmf-dist/tex/context/base/mkiv/node-met.lua
index 31f9a16b28b..45639b5bad3 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-met.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-met.lua
@@ -1,4 +1,4 @@
-if not modules then modules = { } end modules ['node-MET'] = {
+ if not modules then modules = { } end modules ['node-MET'] = {
version = 1.001,
comment = "companion to node-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
@@ -10,7 +10,7 @@ if not modules then modules = { } end modules ['node-MET'] = {
-- the regular code is proven stable. No support otherwise.
-- luatex: todo: copylist should return h, t
--- todo: see if using insert_before and insert_after makes sense here
+-- todo: see if using insertbefore and insertafter makes sense here
-- This file is a side effect of the \LUATEX\ speed optimization project of Luigi
-- Scarso and me. As \CONTEXT\ spends over half its time in \LUA, we though that
@@ -65,73 +65,75 @@ end
-- We start with some helpers and provide all relevant basic functions in the
-- node namespace as well.
-nodes = nodes or { }
-local nodes = nodes
-
-local nodecodes = nodes.nodecodes
-
-nodes.tostring = node.tostring or tostring
-nodes.copy = node.copy
-nodes.copy_node = node.copy
-nodes.copy_list = node.copy_list
-nodes.delete = node.delete
-nodes.dimensions = node.dimensions
-nodes.rangedimensions = node.rangedimensions
-nodes.end_of_math = node.end_of_math
-nodes.flush = node.flush_node
-nodes.flush_node = node.flush_node
-nodes.flush_list = node.flush_list
-nodes.free = node.free
-nodes.insert_after = node.insert_after
-nodes.insert_before = node.insert_before
-nodes.hpack = node.hpack
-nodes.new = node.new
-nodes.tail = node.tail
-nodes.traverse = node.traverse
-nodes.traverse_id = node.traverse_id
-nodes.traverse_char = node.traverse_char
-nodes.traverse_glyph = node.traverse_glyph
-nodes.traverse_list = node.traverse_list
-nodes.slide = node.slide
-nodes.vpack = node.vpack
-nodes.fields = node.fields
-nodes.is_node = node.is_node
-nodes.setglue = node.setglue
-nodes.uses_font = node.uses_font
-
-nodes.first_glyph = node.first_glyph
-nodes.has_glyph = node.has_glyph or node.first_glyph
-
-nodes.current_attributes = node.current_attributes or node.current_attr
-nodes.has_field = node.has_field
-nodes.last_node = node.last_node
-nodes.usedlist = node.usedlist
-nodes.protrusion_skippable = node.protrusion_skippable
-nodes.check_discretionaries = node.check_discretionaries
-nodes.write = node.write
-nodes.flatten_discretionaries = node.flatten_discretionaries
-
-nodes.count = node.count
-nodes.length = node.length
-
-nodes.has_attribute = node.has_attribute
-nodes.set_attribute = node.set_attribute
-nodes.find_attribute = node.find_attribute
-nodes.unset_attribute = node.unset_attribute
-
-nodes.protect_glyph = node.protect_glyph
-nodes.protect_glyphs = node.protect_glyphs
-nodes.unprotect_glyph = node.unprotect_glyph
-nodes.unprotect_glyphs = node.unprotect_glyphs
-nodes.kerning = node.kerning
-nodes.ligaturing = node.ligaturing
-nodes.hyphenating = node.hyphenating
-nodes.mlist_to_hlist = node.mlist_to_hlist
-
-nodes.effective_glue = node.effective_glue
-nodes.getglue = node.getglue
-nodes.setglue = node.setglue
-nodes.is_zero_glue = node.is_zero_glue
+nodes = nodes or { }
+local nodes = nodes
+
+local nodecodes = nodes.nodecodes
+
+nodes.tostring = node.tostring or tostring
+nodes.copy = node.copy
+nodes.copynode = node.copy
+nodes.copylist = node.copy_list
+nodes.delete = node.delete
+nodes.dimensions = node.dimensions
+nodes.rangedimensions = node.rangedimensions
+nodes.endofmath = node.end_of_math
+nodes.flush = node.flush_node
+nodes.flushnode = node.flush_node
+nodes.flushlist = node.flush_list
+nodes.free = node.free
+nodes.insertafter = node.insert_after
+nodes.insertbefore = node.insert_before
+nodes.hpack = node.hpack
+nodes.new = node.new
+nodes.tail = node.tail
+nodes.traverse = node.traverse
+nodes.traverseid = node.traverse_id
+nodes.traversechar = node.traverse_char
+nodes.traverseglyph = node.traverse_glyph
+nodes.traverselist = node.traverse_list
+nodes.slide = node.slide
+nodes.vpack = node.vpack
+nodes.fields = node.fields
+nodes.isnode = node.is_node
+nodes.isdirect = node.is_direct
+nodes.isnut = node.is_direct
+nodes.setglue = node.setglue
+nodes.usesfont = node.uses_font
+
+nodes.firstglyph = node.first_glyph
+nodes.hasglyph = node.has_glyph
+
+nodes.currentattributes = node.current_attributes or node.current_attr
+nodes.hasfield = node.has_field
+nodes.last_node = node.last_node
+nodes.usedlist = node.usedlist
+nodes.protrusionskippable = node.protrusion_skippable
+nodes.checkdiscretionaries = node.check_discretionaries
+nodes.write = node.write
+nodes.flattendiscretionaries = node.flatten_discretionaries
+
+nodes.count = node.count
+nodes.length = node.length
+
+nodes.hasattribute = node.has_attribute
+nodes.setattribute = node.set_attribute
+nodes.findattribute = node.find_attribute
+nodes.unsetattribute = node.unset_attribute
+
+nodes.protectglyph = node.protect_glyph
+nodes.protectglyphs = node.protect_glyphs
+nodes.unprotectglyph = node.unprotect_glyph
+nodes.unprotectglyphs = node.unprotect_glyphs
+nodes.kerning = node.kerning
+nodes.ligaturing = node.ligaturing
+nodes.hyphenating = node.hyphenating
+nodes.mlisttohlist = node.mlist_to_hlist
+
+nodes.effectiveglue = node.effective_glue
+nodes.getglue = node.getglue
+nodes.setglue = node.setglue
+nodes.iszeroglue = node.iszeroglue
nodes.tonode = function(n) return n end
nodes.tonut = function(n) return n end
@@ -149,7 +151,7 @@ nodes.getfield = n_getfield
nodes.setfield = n_setfield
nodes.getattr = n_getattr
nodes.setattr = n_setattr
-nodes.takeattr = nodes.unset_attribute
+nodes.takeattr = nodes.unsetattribute
local function n_getid (n) return n_getfield(n,"id") end
local function n_getsubtype(n) return n_getfield(n,"subtype") end
@@ -213,13 +215,13 @@ nodes.setlink = n_setlink
nodes.getbox = node.getbox or tex.getbox
nodes.setbox = node.setbox or tex.setbox
-local n_flush_node = nodes.flush
-local n_copy_node = nodes.copy
-local n_copy_list = nodes.copy_list
-local n_find_tail = nodes.tail
-local n_insert_after = nodes.insert_after
-local n_insert_before = nodes.insert_before
-local n_slide = nodes.slide
+local n_flushnode = nodes.flush
+local n_copynode = nodes.copy
+local n_copylist = nodes.copylist
+local n_findtail = nodes.tail
+local n_insertafter = nodes.insertafter
+local n_insertbefore = nodes.insertbefore
+local n_slide = nodes.slide
local n_remove_node = node.remove -- not yet nodes.remove
@@ -229,7 +231,7 @@ local function remove(head,current,free_too)
if not t then
-- forget about it
elseif free_too then
- n_flush_node(t)
+ n_flushnode(t)
t = nil
else
n_setboth(t)
@@ -266,10 +268,10 @@ function nodes.replace(head,current,new) -- no head returned if false
if head == current then
head = new
end
- n_flush_node(current)
+ n_flushnode(current)
return head, new
else
- n_flush_node(current)
+ n_flushnode(current)
return new
end
end
@@ -278,14 +280,14 @@ end
function nodes.append(head,current,...)
for i=1,select("#",...) do
- head, current = n_insert_after(head,current,(select(i,...)))
+ head, current = n_insertafter(head,current,(select(i,...)))
end
return head, current
end
function nodes.prepend(head,current,...)
for i=1,select("#",...) do
- head, current = n_insert_before(head,current,(select(i,...)))
+ head, current = n_insertbefore(head,current,(select(i,...)))
end
return head, current
end
@@ -300,7 +302,7 @@ function nodes.linked(...)
else
head = next
end
- last = n_find_tail(next) -- we could skip the last one
+ last = n_findtail(next) -- we could skip the last one
end
end
return head
@@ -391,7 +393,7 @@ metatable.__concat = function(n1,n2) -- todo: accept nut on one end
-- or abort
return n2 -- or n2 * 2
else
- local tail = n_find_tail(n1)
+ local tail = n_findtail(n1)
n_setlink(tail,n2)
return n1
end
@@ -406,19 +408,19 @@ metatable.__mul = function(n,multiplier)
elseif n_getnext(n) then
local head
for i=2,multiplier do
- local h = n_copy_list(n)
+ local h = n_copylist(n)
if head then
- local t = n_find_tail(h)
+ local t = n_findtail(h)
n_setlink(t,head)
end
head = h
end
- local t = n_find_tail(n)
+ local t = n_findtail(n)
n_setlink(t,head)
else
local head
for i=2,multiplier do
- local c = n_copy_node(n)
+ local c = n_copynode(n)
if head then
n_setlink(c,head)
end
@@ -431,10 +433,10 @@ end
metatable.__sub = function(first,second)
if type(second) == "number" then
- local tail = n_find_tail(first)
+ local tail = n_findtail(first)
for i=1,second do
local prev = n_getprev(tail)
- n_flush_node(tail) -- can become flushlist/flushnode
+ n_flushnode(tail) -- can become flushlist/flushnode
if prev then
tail = prev
else
@@ -449,15 +451,15 @@ metatable.__sub = function(first,second)
end
else
-- aaaaa - bbb => aaaabbba
- local firsttail = n_find_tail(first)
+ local firsttail = n_findtail(first)
local prev = n_getprev(firsttail)
if prev then
- local secondtail = n_find_tail(second)
+ local secondtail = n_findtail(second)
n_setlink(secondtail,firsttail)
n_setlink(prev,second)
return first
else
- local secondtail = n_find_tail(second)
+ local secondtail = n_findtail(second)
n_setlink(secondtail,first)
return second
end
@@ -469,7 +471,7 @@ metatable.__add = function(first,second)
local head = second
for i=1,first do
local second = n_getnext(head)
- n_flush_node(head) -- can become flushlist/flushnode
+ n_flushnode(head) -- can become flushlist/flushnode
if second then
head = second
else
@@ -486,7 +488,7 @@ metatable.__add = function(first,second)
-- aaaaa + bbb => abbbaaaa
local next = n_getnext(first)
if next then
- local secondtail = n_find_tail(second)
+ local secondtail = n_findtail(second)
n_setlink(first,second)
n_setlink(secondtail,next)
else
@@ -514,12 +516,12 @@ metatable.__pow = function(n,multiplier)
local head = nil
if n_getnext(n) then
if multiplier == 1 then
- head = n_copy_list(n)
+ head = n_copylist(n)
else
for i=1,multiplier do
- local h = n_copy_list(n)
+ local h = n_copylist(n)
if head then
- local t = n_find_tail(h)
+ local t = n_findtail(h)
n_setlink(t,head)
end
head = h
@@ -527,10 +529,10 @@ metatable.__pow = function(n,multiplier)
end
else
if multiplier == 1 then
- head = n_copy_node(n)
+ head = n_copynode(n)
else
for i=2,multiplier do
- local c = n_copy_node(n)
+ local c = n_copynode(n)
if head then
n_setlink(head,c)
end
@@ -556,76 +558,3 @@ metatable.__unm = function(head)
n_setnext(last)
return first
end
-
--- see node-nut.lua for more info on going nuts
-
--- if not gonuts then
---
--- local nuts = { }
--- nodes.nuts = nuts
---
--- local function dummy(f) return f end
---
--- nodes.vianuts = dummy
--- nodes.vianodes = dummy
---
--- for k, v in next, nodes do
--- if type(v) == "function" then
--- nuts[k] = v
--- end
--- end
---
--- end
-
--- also handy
-
-local tonode = nodes.tonode
-local whatsit_code = nodecodes.whatsit
-local getfields = node.fields
-local sort = table.sort
-local whatsitkeys = { }
-local keys = { whatsit = whatsitkeys }
-local messyhack = table.tohash { -- temporary solution
- nodecodes.attributelist,
- nodecodes.attribute,
- nodecodes.action, -- hm
-}
-
-setmetatableindex(keys,function(t,k)
- local v = (k == "attributelist" or k == nodecodes.attributelist) and { } or getfields(k)
- if messyhack[k] then
- for i=1,#v do
- if v[i] == "subtype" then
- remove(v,i)
- break
- end
- end
- end
- if v[ 0] then v[#v+1] = "next" v[ 0] = nil end
- if v[-1] then v[#v+1] = "prev" v[-1] = nil end
- sort(v)
- t[k] = v
- return v
-end)
-
-setmetatableindex(whatsitkeys,function(t,k)
- local v = getfields(whatsit_code,k)
- if v[ 0] then v[#v+1] = "next" v[ 0] = nil end
- if v[-1] then v[#v+1] = "prev" v[-1] = nil end
- sort(v)
- t[k] = v
- return v
-end)
-
-local function nodefields(n)
- n = tonode(n)
- local id = n.id
- if id == whatsit_code then
- return whatsitkeys[n.subtype]
- else
- return keys[id]
- end
-end
-
-nodes.keys = keys -- [id][subtype]
-nodes.fields = nodefields -- (n)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-mig.lua b/Master/texmf-dist/tex/context/base/mkiv/node-mig.lua
index 13414c560c7..06400326982 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-mig.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-mig.lua
@@ -6,8 +6,6 @@ if not modules then modules = { } end modules ['node-mig'] = {
license = "see context related readme files"
}
--- todo: insert_after
-
local format = string.format
local trace_migrations = false trackers.register("nodes.migrations", function(v) trace_migrations = v end)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-nut.lua b/Master/texmf-dist/tex/context/base/mkiv/node-nut.lua
index 9909194e7ae..dcd08f31766 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-nut.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-nut.lua
@@ -1,4 +1,4 @@
-if not modules then modules = { } end modules ['node-nut'] = {
+ if not modules then modules = { } end modules ['node-nut'] = {
version = 1.001,
comment = "companion to node-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
@@ -88,131 +88,106 @@ if not modules then modules = { } end modules ['node-nut'] = {
local type, rawget = type, rawget
-local nodes = nodes
-local direct = node.direct
+local nodes = nodes
+local direct = node.direct
-local fastcopy = table.fastcopy
+local fastcopy = table.fastcopy
-local nodecodes = nodes.nodecodes
-local hlist_code = nodecodes.hlist
-local vlist_code = nodecodes.vlist
-local glyph_code = nodecodes.glyph
+local nodecodes = nodes.nodecodes
+local hlist_code = nodecodes.hlist
+local vlist_code = nodecodes.vlist
+local glyph_code = nodecodes.glyph
-local nuts = nodes.nuts or { }
-nodes.nuts = nuts
+local nuts = nodes.nuts or { }
+nodes.nuts = nuts
-nodes.is_node = direct.is_node or function() return true end
-nodes.is_direct = direct.is_direct or function() return false end
-nodes.is_nut = nodes.is_direct
+nodes.isnode = direct.isnode or function() return true end
+nodes.isdirect = direct.isdirect or function() return false end
+nodes.isnut = nodes.isdirect
-- casters
-local tonode = direct.tonode or function(n) return n end
-local tonut = direct.todirect or function(n) return n end
+local tonode = direct.tonode or function(n) return n end
+local tonut = direct.todirect or function(n) return n end
-nuts.tonode = tonode
-nuts.tonut = tonut
+nuts.tonode = tonode
+nuts.tonut = tonut
-nodes.tonode = tonode
-nodes.tonut = tonut
-
--- -- some tracing:
---
--- local hash = table.setmetatableindex("number")
--- local ga = direct.get_attribute
--- function direct.get_attribute(n,a)
--- hash[a] = hash[a] + 1
--- return ga(n,a)
--- end
--- function nuts.reportattr()
--- inspect(hash)
--- end
-
--- local function track(name)
--- local n = 0
--- local f = direct[name]
--- direct[name] = function(...)
--- n = n + 1
--- if n % 1000 == 0 then
--- print(name,n)
--- end
--- return f(...)
--- end
--- end
--- track("getfield")
+nodes.tonode = tonode
+nodes.tonut = tonut
-- helpers
local nuts = nodes.nuts
-nuts.check_discretionaries = direct.check_discretionaries
+nuts.checkdiscretionaries = direct.check_discretionaries
nuts.copy = direct.copy
-nuts.copy_node = direct.copy
-nuts.copy_only = direct.copy_only or direct.copy
-nuts.copy_list = direct.copy_list
+nuts.copynode = direct.copy
+nuts.copyonly = direct.copy_only or direct.copy
+nuts.copylist = direct.copy_list
nuts.count = direct.count
-nuts.current_attr = direct.current_attr
+nuts.currentattribute = direct.current_attr
+nuts.currentattr = direct.current_attr
nuts.delete = direct.delete
nuts.dimensions = direct.dimensions
-nuts.end_of_math = direct.end_of_math
-nuts.find_attribute = direct.find_attribute
-nuts.first_glyph = direct.first_glyph
-nuts.flatten_discretionaries = direct.flatten_discretionaries
+nuts.endofmath = direct.end_of_math
+nuts.findattribute = direct.find_attribute
+nuts.firstglyph = direct.first_glyph
+nuts.flattendiscretionaries = direct.flatten_discretionaries
nuts.flush = direct.flush_node
-nuts.flush_list = direct.flush_list
-nuts.flush_node = direct.flush_node
+nuts.flushlist = direct.flush_list
+nuts.flushnode = direct.flush_node
nuts.free = direct.free
-nuts.get_synctex_fields = direct.get_synctex_fields
-nuts.has_attribute = direct.has_attribute
-nuts.has_field = direct.has_field
-nuts.has_glyph = direct.has_glyph or direct.first_glyph
+nuts.getsynctexfields = direct.get_synctex_fields
+nuts.hasattribute = direct.has_attribute
+nuts.hasfield = direct.has_field
+nuts.hasglyph = direct.has_glyph or direct.first_glyph
nuts.hpack = direct.hpack
-nuts.insert_after = direct.insert_after
-nuts.insert_before = direct.insert_before
-nuts.is_direct = direct.is_direct
-nuts.is_node = direct.is_node
-nuts.is_nut = direct.is_direct
+nuts.insertafter = direct.insert_after
+nuts.insertbefore = direct.insert_before
+nuts.isdirect = direct.is_direct
+nuts.isnode = direct.is_node
+nuts.isnut = direct.is_direct
nuts.kerning = direct.kerning
nuts.hyphenating = direct.hyphenating
-nuts.last_node = direct.last_node
+nuts.lastnode = direct.last_node
nuts.length = direct.length
nuts.ligaturing = direct.ligaturing
nuts.new = direct.new
-nuts.protect_glyph = direct.protect_glyph
-nuts.protect_glyphs = direct.protect_glyphs
-nuts.flush_components = direct.flush_components
-nuts.protrusion_skippable = direct.protrusion_skippable
+nuts.protectglyph = direct.protect_glyph
+nuts.protectglyphs = direct.protect_glyphs
+nuts.protrusionskippable = direct.protrusion_skippable
nuts.rangedimensions = direct.rangedimensions
-nuts.set_attribute = direct.set_attribute
-nuts.set_synctex_fields = direct.set_synctex_fields
+nuts.setattribute = direct.set_attribute
+nuts.setsynctexfields = direct.set_synctex_fields
nuts.slide = direct.slide
nuts.tail = direct.tail
nuts.tostring = direct.tostring
nuts.traverse = direct.traverse
-nuts.traverse_char = direct.traverse_char
-nuts.traverse_glyph = direct.traverse_glyph
-nuts.traverse_id = direct.traverse_id
-nuts.traverse_list = direct.traverse_list
-nuts.unprotect_glyph = direct.unprotect_glyph
-nuts.unprotect_glyphs = direct.unprotect_glyphs
-nuts.unset_attribute = direct.unset_attribute
-nuts.unset_attribute = direct.unset_attribute
+nuts.traversechar = direct.traverse_char
+nuts.traverseglyph = direct.traverse_glyph
+nuts.traverseid = direct.traverse_id
+nuts.traverselist = direct.traverse_list
+nuts.unprotectglyph = direct.unprotect_glyph
+nuts.unprotectglyphs = direct.unprotect_glyphs
+nuts.unsetattribute = direct.unset_attribute
+nuts.unsetattribute = direct.unset_attribute
nuts.usedlist = direct.usedlist
-nuts.uses_font = direct.uses_font
+nuts.usesfont = direct.uses_font
nuts.vpack = direct.vpack
nuts.write = direct.write
-nuts.mlist_to_hlist = direct.mlist_to_hlist
-nuts.has_dimensions = direct.has_dimensions
-nuts.start_of_par = direct.start_of_par
+nuts.mlisttohlist = direct.mlist_to_hlist
+nuts.hasdimensions = direct.has_dimensions
+nuts.startofpar = direct.start_of_par
nuts.migrate = direct.migrate
-if not nuts.mlist_to_hlist then
+if not nuts.mlisttohlist then
- local n_mlist_to_hlist = node.mlist_to_hlist
+ local n_mlisttohlist = node.mlist_to_hlist
- function nuts.mlist_to_hlist(head,...)
+ function nuts.mlisttohlist(head,...)
if head then
- local head = n_mlist_to_hlist(tonode(head),...)
+ local head = n_mlisttohlist(tonode(head),...)
if head then
return tonut(head)
end
@@ -221,11 +196,11 @@ if not nuts.mlist_to_hlist then
end
-if not nuts.has_dimensions then
+if not nuts.hasdimensions then
local getwhd = direct.getwhd
- function nuts.has_dimensions(n)
+ function nuts.hasdimensions(n)
local wd, ht, dp = getwhd(n)
return wd ~= 0 or (ht + dp) ~= 0
end
@@ -246,16 +221,20 @@ nuts.getid = direct.getid
nuts.getprev = direct.getprev
nuts.setprev = direct.setprev
-local get_attribute = direct.get_attribute
-local set_attribute = direct.set_attribute
-local unset_attribute = direct.unset_attribute
+local getattribute = direct.get_attribute
+local setattribute = direct.set_attribute
+local unsetattribute = direct.unset_attribute
+
+nuts.getattr = getattribute
+nuts.setattr = setattribute
+nuts.takeattr = unsetattribute -- ?
-nuts.getattr = get_attribute
-nuts.setattr = set_attribute
-nuts.takeattr = unset_attribute -- ?
+nuts.getattribute = getattribute
+nuts.setattribute = setattribute
+nuts.unsetattribute = unsetattribute -- ?
-nuts.is_zero_glue = direct.is_zero_glue
-nuts.effective_glue = direct.effective_glue
+nuts.iszeroglue = direct.is_zero_glue
+nuts.effectiveglue = direct.effective_glue
nuts.getglue = direct.getglue
nuts.setglue = direct.setglue
@@ -302,8 +281,8 @@ nuts.gettotal = direct.gettotal
nuts.getorientation = direct.getorientation or function() end
nuts.setorientation = direct.setorientation or function() end
-nuts.getglyphdata = direct.getglyphdata or get_attribute
-nuts.setglyphdata = direct.setglyphdata or function(n,d) set_attribute(n,0,d) end
+nuts.getglyphdata = direct.getglyphdata or getattribute
+nuts.setglyphdata = direct.setglyphdata or function(n,d) setattribute(n,0,d) end
nuts.getruledata = direct.getglyphdata and getdata or function(n) return getfield(n,"transform") end
nuts.setruledata = direct.setglyphdata and setdata or function(n,d) return setfield(n,"transform",d) end
@@ -381,20 +360,16 @@ nuts.setbox = direct.setbox
nuts.ischar = direct.is_char
nuts.isglyph = direct.is_glyph
-----.is_char = nuts.ischar
-----.is_glyph = nuts.isglyph
-
local d_remove_node = direct.remove
-local d_flush_node = direct.flush_node
+local d_flushnode = direct.flush_node
local d_getnext = direct.getnext
local d_getprev = direct.getprev
local d_getid = direct.getid
local d_getlist = direct.getlist
local d_find_tail = direct.tail
-local d_insert_after = direct.insert_after
-local d_insert_before = direct.insert_before
+local d_insertafter = direct.insert_after
+local d_insertbefore = direct.insert_before
local d_slide = direct.slide
------ d_copy_node = direct.copy
local d_traverse = direct.traverse
local d_setlink = direct.setlink
local d_setboth = direct.setboth
@@ -404,7 +379,7 @@ local remove = function(head,current,free_too)
if current then
local h, c = d_remove_node(head,current)
if free_too then
- d_flush_node(current)
+ d_flushnode(current)
return h, c
else
d_setboth(current)
@@ -416,7 +391,7 @@ end
-- for now
-if not nuts.start_of_par then
+if not nuts.startofpar then
local parcodes = nodes.parcodes
local hmodepar_code = parcodes.vmode_par
@@ -424,7 +399,7 @@ if not nuts.start_of_par then
local getsubtype = nuts.getsubtype
- function nuts.start_of_par(n)
+ function nuts.startofpar(n)
local s = getsubtype(n)
return s == hmodepar_code or s == vmodepar_code
end
@@ -467,9 +442,9 @@ if not nuts.getpre then
function nuts.getpost (n) local _, h, _, _, t, _ = d_getdisc(n,true) return h, t end
function nuts.getreplace(n) local _, _, h, _, _, t = d_getdisc(n,true) return h, t end
- function nuts.setpre (n,h) d_setfield(d,"pre", h) end
- function nuts.setpost (n,h) d_setfield(d,"post", h) end
- function nuts.setreplace(n,h) d_setfield(d,"replace",h) end
+ function nuts.setpre (n,h) d_setfield(n,"pre", h) end
+ function nuts.setpost (n,h) d_setfield(n,"post", h) end
+ function nuts.setreplace(n,h) d_setfield(n,"replace",h) end
end
@@ -507,10 +482,10 @@ function nuts.replace(head,current,new) -- no head returned if false
if head == current then
head = new
end
- d_flush_node(current)
+ d_flushnode(current)
return head, new
else
- d_flush_node(current)
+ d_flushnode(current)
return new
end
end
@@ -542,14 +517,14 @@ end
function nuts.append(head,current,...)
for i=1,select("#",...) do
- head, current = d_insert_after(head,current,(select(i,...)))
+ head, current = d_insertafter(head,current,(select(i,...)))
end
return head, current
end
function nuts.prepend(head,current,...)
for i=1,select("#",...) do
- head, current = d_insert_before(head,current,(select(i,...)))
+ head, current = d_insertbefore(head,current,(select(i,...)))
end
return head, current
end
@@ -604,43 +579,7 @@ function nodes.vianodes(f) return function(n,...) return tonut (f(tonode(n),...)
nuts.vianuts = nodes.vianuts
nuts.vianodes = nodes.vianodes
--- function nodes.insert_before(h,c,n)
--- if c then
--- if c == h then
--- n_setfield(n,"next",h)
--- n_setfield(n,"prev",nil)
--- n_setfield(h,"prev",n)
--- else
--- local cp = n_getprev(c)
--- n_setfield(n,"next",c)
--- n_setfield(n,"prev",cp)
--- if cp then
--- n_setfield(cp,"next",n)
--- end
--- n_setfield(c,"prev",n)
--- return h, n
--- end
--- end
--- return n, n
--- end
-
--- function nodes.insert_after(h,c,n)
--- if c then
--- local cn = n_getnext(c)
--- if cn then
--- n_setfield(n,"next",cn)
--- n_setfield(cn,"prev",n)
--- else
--- n_setfield(n,"next",nil)
--- end
--- n_setfield(c,"next",n)
--- n_setfield(n,"prev",c)
--- return h, n
--- end
--- return n, n
--- end
-
-function nodes.insert_list_after(h,c,n)
+function nodes.insertlistafter(h,c,n)
local t = n_tail(n)
if c then
local cn = n_getnext(c)
@@ -658,41 +597,7 @@ function nodes.insert_list_after(h,c,n)
return n, t
end
--- function nuts.insert_before(h,c,n)
--- if c then
--- if c == h then
--- d_setnext(n,h)
--- d_setprev(n)
--- d_setprev(h,n)
--- else
--- local cp = d_getprev(c)
--- d_setnext(n,c)
--- d_setprev(n,cp)
--- if cp then
--- d_setnext(cp,n)
--- end
--- d_setprev(c,n)
--- return h, n
--- end
--- end
--- return n, n
--- end
-
--- function nuts.insert_after(h,c,n)
--- if c then
--- local cn = d_getnext(c)
--- if cn then
--- d_setlink(n,cn)
--- else
--- d_setnext(n,nil)
--- end
--- d_setlink(c,n)
--- return h, n
--- end
--- return n, n
--- end
-
-function nuts.insert_list_after(h,c,n)
+function nuts.insertlistafter(h,c,n)
local t = d_tail(n)
if c then
local cn = d_getnext(c)
@@ -909,8 +814,8 @@ nuts.getstate = getstate
local getscript = direct.getscript or function(n,v) end -- elsewhere
local setscript = direct.setscript or function(n,v) end -- elsewhere
-nuts.setscript = getscript
-nuts.getscript = setscript
+nuts.setscript = setscript
+nuts.getscript = getscript
function nuts.isdone(n,k)
local p = propertydata[n]
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-ppt.lua b/Master/texmf-dist/tex/context/base/mkiv/node-ppt.lua
index 485e742b64a..35dc07d55a8 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-ppt.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-ppt.lua
@@ -77,7 +77,7 @@ local function register(where,data,...)
end
end
-local writenode = node.write
+local writenode = nodes.write
local flushnode = context.nodes.flush
function commands.deferredproperty(...)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-pro.lua b/Master/texmf-dist/tex/context/base/mkiv/node-pro.lua
index 4d748af89bd..8c8356e0424 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-pro.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-pro.lua
@@ -65,11 +65,9 @@ do
end
-processors.enabled = true -- this will become a proper state (like trackers)
-
do
- local has_glyph = nodes.has_glyph
+ local hasglyph = nodes.hasglyph
local count_nodes = nodes.countall
local texget = tex.get
@@ -77,7 +75,7 @@ do
local tracer = processors.tracer
local function pre_linebreak_filter(head,groupcode)
- local found = force_processors or has_glyph(head)
+ local found = force_processors or hasglyph(head)
if found then
if trace_callbacks then
local before = count_nodes(head,true)
@@ -95,7 +93,7 @@ do
end
local function hpack_filter(head,groupcode,size,packtype,direction,attributes)
- local found = force_processors or has_glyph(head)
+ local found = force_processors or hasglyph(head)
if found then
--
-- yes or no or maybe an option
@@ -148,7 +146,7 @@ do
end
do
- -- Beware, these are packaged boxes so no first_glyph test needed. Maybe some day I'll add a hash
+ -- Beware, these are packaged boxes so no firstglyph test needed. Maybe some day I'll add a hash
-- with valid groupcodes. Watch out, much can pass twice, for instance vadjust passes two times,
local actions = tasks.actions("finalizers") -- head, where
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-ref.lua b/Master/texmf-dist/tex/context/base/mkiv/node-ref.lua
index 098ed50c28e..2cade31ded3 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-ref.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-ref.lua
@@ -78,7 +78,8 @@ local getdimensions = nuts.dimensions
local getrangedimensions = nuts.rangedimensions
local traverse = nuts.traverse
local find_node_tail = nuts.tail
-local start_of_par = nuts.start_of_par
+
+local startofpar = nuts.startofpar
local nodecodes = nodes.nodecodes
local gluecodes = nodes.gluecodes
@@ -107,7 +108,7 @@ local new_rule = nodepool.rule
local new_kern = nodepool.kern
local new_hlist = nodepool.hlist
-local flush_node = nuts.flush
+local flushnode = nuts.flush
local tosequence = nodes.tosequence
@@ -135,7 +136,7 @@ local function vlist_dimensions(start,stop) -- also needs the stretch and so
local v = vpack_list(start)
local w, h, d = getwhd(v)
setlist(v) -- not needed
- flush_node(v)
+ flushnode(v)
if temp then
setnext(stop,temp)
end
@@ -421,7 +422,7 @@ local function inject_areas(head,attribute,make,stack,done,skip,parent,pardir,tx
local direction, pop = getdirection(current)
txtdir = not pop and direction -- we might need a stack
elseif id == par_code then
- if start_of_par(current) then
+ if startofpar(current) then
pardir = getdirection(current)
end
elseif id == glue_code and getsubtype(current) == leftskip_code then -- any glue at the left?
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-res.lua b/Master/texmf-dist/tex/context/base/mkiv/node-res.lua
index 478a46906e0..5c669f9da0e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-res.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-res.lua
@@ -99,7 +99,7 @@ local setdata = nuts.setdata
local setruledata = nuts.setruledata
local setvalue = nuts.setvalue
-local copy_nut = nuts.copy_only or nuts.copy
+local copy_nut = nuts.copy
local new_nut = nuts.new
local flush_nut = nuts.flush
@@ -173,19 +173,10 @@ local savepos = register_nut(new_nut(whatsit_code,whatsitcodes.savepos
local user_node = new_nut(whatsit_code,whatsitcodes.userdefined)
-if CONTEXTLMTXMODE == 0 then
- setfield(user_node,"type",usercodes.number)
-end
-
-local left_margin_kern, right_margin_kern
+setfield(user_node,"type",usercodes.number)
-if CONTEXTLMTXMODE > 0 then
- left_margin_kern = register_nut(new_nut(kern_code,kerncodes.leftmargincode))
- right_margin_kern = register_nut(new_nut(kern_code,kerncodes.rightmargincode))
-else
- left_margin_kern = register_nut(new_nut(nodecodes.marginkern,0))
- right_margin_kern = register_nut(new_nut(nodecodes.marginkern,1))
-end
+local left_margin_kern = register_nut(new_nut(nodecodes.marginkern,0))
+local right_margin_kern = register_nut(new_nut(nodecodes.marginkern,1))
local lineskip = register_nut(new_nut(glue_code,gluecodes.lineskip))
local baselineskip = register_nut(new_nut(glue_code,gluecodes.baselineskip))
@@ -429,27 +420,15 @@ function nutpool.savepos()
return copy_nut(savepos)
end
-if CONTEXTLMTXMODE == 0 then
-
- function nutpool.latelua(code)
- local n = copy_nut(latelua)
- if type(code) == "table" then
- local action = code.action
- local specification = code.specification or code
- code = function() action(specification) end
- end
- setdata(n,code)
- return n
- end
-
-else
-
- function nutpool.latelua(code)
- local n = copy_nut(latelua)
- nodeproperties[n] = { data = code }
- return n
+function nutpool.latelua(code)
+ local n = copy_nut(latelua)
+ if type(code) == "table" then
+ local action = code.action
+ local specification = code.specification or code
+ code = function() action(specification) end
end
-
+ setdata(n,code)
+ return n
end
function nutpool.leftmarginkern(glyph,width)
@@ -575,7 +554,7 @@ local function cleanup(nofboxes) -- todo
return nr, nl, nofboxes -- can be nil
end
-local usage = CONTEXTLMTXMODE > 0 and node.inuse or function()
+local function usage()
local t = { }
for n, tag in gmatch(status.node_mem_usage,"(%d+) ([a-z_]+)") do
t[tag] = tonumber(n) or 0
@@ -583,7 +562,7 @@ local usage = CONTEXTLMTXMODE > 0 and node.inuse or function()
return t
end
-local stock = CONTEXTLMTXMODE > 0 and node.instock or { }
+local stock = { }
nutpool .cleanup = cleanup
nodepool.cleanup = cleanup
@@ -611,25 +590,25 @@ statistics.register("node memory usage", function() -- comes after cleanup !
end
end)
-lua.registerfinalizer(cleanup, "cleanup reserved nodes")
+lua.registerinitexfinalizer(cleanup, "cleanup reserved nodes")
-- experiment
do
- local glyph = tonode(glyph)
- local traverse_id = nodes.traverse_id
+ local glyph = tonode(glyph)
+ local traverseid = nodes.traverseid
- local traversers = table.setmetatableindex(function(t,k)
- local v = traverse_id(type(k) == "number" and k or nodecodes[k],glyph)
+ local traversers = table.setmetatableindex(function(t,k)
+ local v = traverseid(type(k) == "number" and k or nodecodes[k],glyph)
t[k] = v
return v
end)
- traversers.node = nodes.traverse (glyph)
- traversers.char = nodes.traverse_char (glyph)
- if nodes.traverse_glyph then traversers.glyph = nodes.traverse_glyph(glyph) end
- if nodes.traverse_list then traversers.list = nodes.traverse_list (glyph) end
+ traversers.node = nodes.traverse (glyph)
+ traversers.char = nodes.traversechar (glyph)
+ if nodes.traverseglyph then traversers.glyph = nodes.traverseglyph(glyph) end
+ if nodes.traverselist then traversers.list = nodes.traverselist (glyph) end
nodes.traversers = traversers
@@ -637,20 +616,20 @@ end
do
- local glyph = glyph
- local traverse_id = nuts.traverse_id
+ local glyph = glyph
+ local traverseid = nuts.traverseid
- local traversers = table.setmetatableindex(function(t,k)
- local v = traverse_id(type(k) == "number" and k or nodecodes[k],glyph)
+ local traversers = table.setmetatableindex(function(t,k)
+ local v = traverseid(type(k) == "number" and k or nodecodes[k],glyph)
t[k] = v
return v
end)
- traversers.node = nuts.traverse (glyph)
- traversers.char = nuts.traverse_char (glyph)
- if nuts.traverse_glyph then traversers.glyph = nuts.traverse_glyph (glyph) end
- if nuts.traverse_list then traversers.list = nuts.traverse_list (glyph) end
- if nuts.traverse_content then traversers.content = nuts.traverse_content(glyph) end
+ traversers.node = nuts.traverse (glyph)
+ traversers.char = nuts.traversechar (glyph)
+ if nuts.traverseglyph then traversers.glyph = nuts.traverseglyph (glyph) end
+ if nuts.traverselist then traversers.list = nuts.traverselist (glyph) end
+ if nuts.traversecontent then traversers.content = nuts.traversecontent(glyph) end
nuts.traversers = traversers
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-rul.lua b/Master/texmf-dist/tex/context/base/mkiv/node-rul.lua
index f60fb2406a7..7ef58e97062 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-rul.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-rul.lua
@@ -57,15 +57,15 @@ local getruledata = nuts.getruledata
local isglyph = nuts.isglyph
-local flushlist = nuts.flush_list
-local effective_glue = nuts.effective_glue
-local insert_node_after = nuts.insert_after
-local insert_node_before = nuts.insert_before
+local flushlist = nuts.flushlist
+local effectiveglue = nuts.effectiveglue
+local insertnodeafter = nuts.insertafter
+local insertnodebefore = nuts.insertbefore
local find_tail = nuts.tail
local setglue = nuts.setglue
local getrangedimensions = nuts.rangedimensions
local hpack_nodes = nuts.hpack
-local copy_list = nuts.copy_list
+local copylist = nuts.copylist
local nexthlist = nuts.traversers.hlist
@@ -317,7 +317,7 @@ local function flush_ruled(head,f,l,d,level,parent,strip) -- not that fast but a
setattr(r,a_viewerlayer,layer)
end
if empty then
- head = insert_node_before(head,f,r)
+ head = insertnodebefore(head,f,r)
setlink(r,getnext(l))
setprev(f)
setnext(l)
@@ -325,12 +325,12 @@ local function flush_ruled(head,f,l,d,level,parent,strip) -- not that fast but a
else
local k = new_kern(-wd)
if foreground then
- insert_node_after(head,l,k)
- insert_node_after(head,k,r)
+ insertnodeafter(head,l,k)
+ insertnodeafter(head,k,r)
l = r
else
- head = insert_node_before(head,f,r)
- insert_node_after(head,r,k)
+ head = insertnodebefore(head,f,r)
+ insertnodeafter(head,r,k)
end
end
if trace_ruled then
@@ -356,7 +356,7 @@ local function flush_ruled(head,f,l,d,level,parent,strip) -- not that fast but a
else
local tx = d.text
if tx then
- local l = copy_list(tx)
+ local l = copylist(tx)
if d["repeat"] == v_yes then
l = new_leader(wd,l)
setattrlist(l,tx)
@@ -603,7 +603,7 @@ function linefillers.handler(head)
if head then
local indentation = iskip and getwidth(iskip) or 0
local leftfixed = lskip and getwidth(lskip) or 0
- local lefttotal = lskip and effective_glue(lskip,current) or 0
+ local lefttotal = lskip and effectiveglue(lskip,current) or 0
local width = lefttotal - (leftlocal and leftfixed or 0) + indentation - distance
if width > threshold then
if iskip then
@@ -612,13 +612,13 @@ function linefillers.handler(head)
if lskip then
setglue(lskip,leftlocal and getwidth(lskip) or nil)
if distance > 0 then
- insert_node_after(list,lskip,new_kern(distance))
+ insertnodeafter(list,lskip,new_kern(distance))
end
- insert_node_after(list,lskip,linefiller(current,data,width,"left"))
+ insertnodeafter(list,lskip,linefiller(current,data,width,"left"))
else
- insert_node_before(list,head,linefiller(current,data,width,"left"))
+ insertnodebefore(list,head,linefiller(current,data,width,"left"))
if distance > 0 then
- insert_node_before(list,head,new_kern(distance))
+ insertnodebefore(list,head,new_kern(distance))
end
end
end
@@ -642,9 +642,9 @@ function linefillers.handler(head)
end
if tail then
local rightfixed = rskip and getwidth(rskip) or 0
- local righttotal = rskip and effective_glue(rskip,current) or 0
+ local righttotal = rskip and effectiveglue(rskip,current) or 0
local parfixed = pskip and getwidth(pskip) or 0
- local partotal = pskip and effective_glue(pskip,current) or 0
+ local partotal = pskip and effectiveglue(pskip,current) or 0
local width = righttotal - (rightlocal and rightfixed or 0) + partotal - distance
if width > threshold then
if pskip then
@@ -653,13 +653,13 @@ function linefillers.handler(head)
if rskip then
setglue(rskip,rightlocal and getwidth(rskip) or nil)
if distance > 0 then
- insert_node_before(list,rskip,new_kern(distance))
+ insertnodebefore(list,rskip,new_kern(distance))
end
- insert_node_before(list,rskip,linefiller(current,data,width,"right"))
+ insertnodebefore(list,rskip,linefiller(current,data,width,"right"))
else
- insert_node_after(list,tail,linefiller(current,data,width,"right"))
+ insertnodeafter(list,tail,linefiller(current,data,width,"right"))
if distance > 0 then
- insert_node_after(list,tail,new_kern(distance))
+ insertnodeafter(list,tail,new_kern(distance))
end
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-rul.mkiv b/Master/texmf-dist/tex/context/base/mkiv/node-rul.mkiv
index 660c0d4e617..84463f21f2c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-rul.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-rul.mkiv
@@ -341,16 +341,17 @@
[undergraphic]
[\c!mp=rules:under:dash,
\c!offset=-.2,
+ \c!continue=\v!yes,
\c!order=\v!background]
\definebar[underrandom] [undergraphic][\c!mp=rules:under:random]
-\definebar[underrandoms][underrandom] [\c!continue=\v!yes]
+\definebar[underrandoms][underrandom] [\c!continue=\v!no]
\definebar[underdash] [undergraphic][\c!mp=rules:under:dash]
-\definebar[underdashes] [underdash] [\c!continue=\v!yes]
+\definebar[underdashes] [underdash] [\c!continue=\v!no]
\definebar[underdot] [undergraphic][\c!mp=rules:under:dots]
-\definebar[underdots] [underdot] [\c!continue=\v!yes]
+\definebar[underdots] [underdot] [\c!continue=\v!no]
%D This will move: (a bit duplicated)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-scn.lua b/Master/texmf-dist/tex/context/base/mkiv/node-scn.lua
index 0ec1ba387c9..55f39a74b6a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-scn.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-scn.lua
@@ -21,8 +21,6 @@ local getsubtype = nuts.getsubtype
local getlist = nuts.getlist
local setlist = nuts.setlist
-local end_of_math = nuts.end_of_math
-
local nodecodes = nodes.nodecodes
local gluecodes = nodes.gluecodes
local kerncodes = nodes.kerncodes
@@ -122,7 +120,9 @@ local function processwords(attribute,data,flush,head,parent,skip) -- we have hl
local continue, leaders, done, strip, level = false, false, false, true, -1
while n do
local id = getid(n)
- if id == glyph_code or id == rule_code or (id == hlist_code and getattr(n,a_runningtext)) then
+ if id == glyph_code or id == rule_code or (id == hlist_code and getattr(n,a_runningtext))
+or id == disc_code or id == boundary_code
+ then
local aa = getattr(n,attribute)
if aa and aa ~= skip then
if aa == a then
@@ -164,10 +164,10 @@ local function processwords(attribute,data,flush,head,parent,skip) -- we have hl
setlist(n,(processwords(attribute,data,flush,list,n,aa))) -- watch ()
end
end
- elseif id == disc_code or id == boundary_code then
- if f then
- l = n
- end
+-- elseif id == disc_code or id == boundary_code then
+-- if f then
+-- l = n
+-- end
elseif id == kern_code and getsubtype(n) == fontkern_code then
if f then
l = n
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-ser.lua b/Master/texmf-dist/tex/context/base/mkiv/node-ser.lua
index 25a6dd6c39d..ee2abe0d24e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-ser.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-ser.lua
@@ -17,14 +17,11 @@ local allocate = utilities.storage.allocate
local context = context
local nodes = nodes
-local node = node
-
-local is_node = nodes.is_node
+local isnode = nodes.isnode
local nodecodes = nodes.nodecodes
local subtcodes = nodes.codes
local getfields = nodes.fields
-
local tonode = nodes.tonode
local tonut = nodes.tonut
@@ -130,13 +127,13 @@ end
nodes.astable = astable
-setinspector("node",function(v) if is_node(v) then printtable(astable(v),tostring(v)) return true end end)
+setinspector("node",function(v) if isnode(v) then printtable(astable(v),tostring(v)) return true end end)
-- under construction:
local function totable(n,flat,verbose,noattributes) -- nicest: n,true,true,true
local function to_table(n,flat,verbose,noattributes) -- no need to pass
- local f = getfields(n)
+ local f = getfields(n.id)
local tt = { }
for k=1,#f do
local v = f[k]
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-shp.lua b/Master/texmf-dist/tex/context/base/mkiv/node-shp.lua
index 58dc944951a..b867f564a9e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-shp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-shp.lua
@@ -121,7 +121,7 @@ local removables = {
--
-- handlers.cleanuppage = cleanup_redundant -- nut
-handlers.cleanuppage = nuts.flatten_discretionaries
+handlers.cleanuppage = nuts.flattendiscretionaries
local function cleanup_flushed(head) -- rough
local start = head
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-syn.lua b/Master/texmf-dist/tex/context/base/mkiv/node-syn.lua
index d9c653abbb0..4014445b0a5 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-syn.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-syn.lua
@@ -125,7 +125,7 @@ if not modules then modules = { } end modules ['node-syn'] = {
local type, rawset = type, rawset
local concat = table.concat
local formatters = string.formatters
-local replacesuffix, suffixonly, nameonly = file.replacesuffix, file.suffix, file.nameonly
+local replacesuffix, suffixonly, nameonly, collapsepath = file.replacesuffix, file.suffix, file.nameonly, file.collapsepath
local openfile, renamefile, removefile = io.open, os.rename, os.remove
local report_system = logs.reporter("system")
@@ -159,8 +159,8 @@ local fontkern_code = kerncodes.fontkern
local cancel_code = nodes.dircodes.cancel
-local insert_before = nuts.insert_before
-local insert_after = nuts.insert_after
+local insertbefore = nuts.insertbefore
+local insertafter = nuts.insertafter
local nodepool = nuts.pool
local new_latelua = nodepool.latelua
@@ -170,7 +170,7 @@ local new_kern = nodepool.kern
local getdimensions = nuts.dimensions
local getrangedimensions = nuts.rangedimensions
-local getsynctexfields = nuts.getsynctexfields or nuts.get_synctex_fields
+local getsynctexfields = nuts.getsynctexfields
local forcesynctextag = tex.forcesynctextag or tex.force_synctex_tag
local forcesynctexline = tex.forcesynctexline or tex.force_synctex_line
local getsynctexline = tex.getsynctexline or tex.get_synctex_line
@@ -231,7 +231,8 @@ local blockedsuffixes = {
-- lfg = true,
}
-local sttags = table.setmetatableindex(function(t,name)
+local sttags = table.setmetatableindex(function(t,fullname)
+ local name = collapsepath(fullname)
if blockedsuffixes[suffixonly(name)] then
-- Just so that I don't get the ones on my development tree.
nofblocked = nofblocked + 1
@@ -247,6 +248,9 @@ local sttags = table.setmetatableindex(function(t,name)
else
noftags = noftags + 1
t[name] = noftags
+ if name ~= fullname then
+ t[fullname] = noftags
+ end
stnums[noftags] = name
return noftags
end
@@ -391,27 +395,27 @@ end
-- end
--
-- local function b_vlist(head,current,t,l,w,h,d)
--- return insert_before(head,current,new_latelua(function() doaction(f_vlist,t,l,w,h,d) end))
+-- return insertbefore(head,current,new_latelua(function() doaction(f_vlist,t,l,w,h,d) end))
-- end
--
-- local function b_hlist(head,current,t,l,w,h,d)
--- return insert_before(head,current,new_latelua(function() doaction(f_hlist,t,l,w,h,d) end))
+-- return insertbefore(head,current,new_latelua(function() doaction(f_hlist,t,l,w,h,d) end))
-- end
--
-- local function e_vlist(head,current)
--- return insert_after(head,current,new_latelua(noaction(s_vlist)))
+-- return insertafter(head,current,new_latelua(noaction(s_vlist)))
-- end
--
-- local function e_hlist(head,current)
--- return insert_after(head,current,new_latelua(noaction(s_hlist)))
+-- return insertafter(head,current,new_latelua(noaction(s_hlist)))
-- end
--
-- local function x_vlist(head,current,t,l,w,h,d)
--- return insert_before(head,current,new_latelua(function() doaction(f_vlist_1,t,l,w,h,d) end))
+-- return insertbefore(head,current,new_latelua(function() doaction(f_vlist_1,t,l,w,h,d) end))
-- end
--
-- local function x_hlist(head,current,t,l,w,h,d)
--- return insert_before(head,current,new_latelua(function() doaction(f_hlist_1,t,l,w,h,d) end))
+-- return insertbefore(head,current,new_latelua(function() doaction(f_hlist_1,t,l,w,h,d) end))
-- end
--
-- generic
@@ -466,7 +470,7 @@ local x_hlist do
x_hlist = function(head,current,t,l,w,h,d)
if filehandle then
- return insert_before(head,current,new_latelua(function() doaction(t,l,w,h,d) end))
+ return insertbefore(head,current,new_latelua(function() doaction(t,l,w,h,d) end))
else
return head
end
@@ -502,8 +506,8 @@ local function inject(head,first,last,tag,line)
d = depth
end
if trace then
- head = insert_before(head,first,new_rule(w,fulltrace and h or traceheight,fulltrace and d or tracedepth))
- head = insert_before(head,first,new_kern(-w))
+ head = insertbefore(head,first,new_rule(w,fulltrace and h or traceheight,fulltrace and d or tracedepth))
+ head = insertbefore(head,first,new_kern(-w))
end
head = x_hlist(head,first,tag,line,w,h,d)
return head
@@ -569,8 +573,8 @@ local function inject(parent,head,first,last,tag,line)
d = depth
end
if trace then
- head = insert_before(head,first,new_rule(w,fulltrace and h or traceheight,fulltrace and d or tracedepth))
- head = insert_before(head,first,new_kern(-w))
+ head = insertbefore(head,first,new_rule(w,fulltrace and h or traceheight,fulltrace and d or tracedepth))
+ head = insertbefore(head,first,new_kern(-w))
end
head = x_hlist(head,first,tag,line,w,h,d)
return head
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-tra.lua b/Master/texmf-dist/tex/context/base/mkiv/node-tra.lua
index 83c072c19b0..67435f1c78f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-tra.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-tra.lua
@@ -50,8 +50,6 @@ local getglue = nuts.getglue
local isglyph = nuts.isglyph
local getdirection = nuts.getdirection
local getwidth = nuts.getwidth
-
-local flush_list = nuts.flush_list
local count_nodes = nuts.countall
local used_nodes = nuts.usedlist
@@ -79,11 +77,12 @@ local rule_code = nodecodes.rule
local dir_code = nodecodes.dir
local par_code = nodecodes.par
local whatsit_code = nodecodes.whatsit
+local passive_code = nodecodes.passive
local dimenfactors = number.dimenfactors
local formatters = string.formatters
-local start_of_par = nuts.start_of_par
+local startofpar = nuts.startofpar
-- this will be reorganized:
@@ -154,7 +153,7 @@ local function tosequence(start,stop,compact)
elseif id == dir_code then
local d, p = getdirection(start)
n = n + 1 ; t[n] = "[<" .. (p and "-" or "+") .. d .. ">]" -- todo l2r etc
- elseif id == par_code and start_of_par(current) then
+ elseif id == par_code and startofpar(current) then
n = n + 1 ; t[n] = "[<" .. getdirection(start) .. ">]" -- todo l2r etc
elseif compact then
n = n + 1 ; t[n] = "[]"
@@ -305,57 +304,68 @@ end
nodes.showsimplelist = function(h,depth) showsimplelist(h,depth,0) end
local function listtoutf(h,joiner,textonly,last,nodisc)
- local w = { }
- local n = 0
- local g = formatters["<%i>"]
- local d = formatters["[%s|%s|%s]"]
- while h do
- local c, id = isglyph(h)
- if c then
- n = n + 1 ; w[n] = c >= 0 and utfchar(c) or g(c)
- if joiner then
- n = n + 1 ; w[n] = joiner
- end
- elseif id == disc_code then
- local pre, pos, rep = getdisc(h)
- if not nodisc then
- n = n + 1 ; w[n] = d(
- pre and listtoutf(pre,joiner,textonly) or "",
- pos and listtoutf(pos,joiner,textonly) or "",
- rep and listtoutf(rep,joiner,textonly) or ""
- )
- elseif rep then
- n = n + 1 ; w[n] = listtoutf(rep,joiner,textonly) or ""
- end
- if joiner then
- n = n + 1 ; w[n] = joiner
- end
- elseif textonly then
- if id == glue_code then
- if getwidth(h) > 0 then
- n = n + 1 ; w[n] = " "
+ if h then
+ local w = { }
+ local n = 0
+ local g = formatters["<%i>"]
+ local d = formatters["[%s|%s|%s]"]
+ while h do
+ local c, id = isglyph(h)
+ if c then
+ n = n + 1 ; w[n] = c >= 0 and utfchar(c) or g(c)
+ if joiner then
+ n = n + 1 ; w[n] = joiner
+ end
+ elseif id == disc_code then
+ local pre, pos, rep = getdisc(h)
+ if not nodisc then
+ n = n + 1 ; w[n] = d(
+ pre and listtoutf(pre,joiner,textonly) or "",
+ pos and listtoutf(pos,joiner,textonly) or "",
+ rep and listtoutf(rep,joiner,textonly) or ""
+ )
+ elseif rep then
+ n = n + 1 ; w[n] = listtoutf(rep,joiner,textonly) or ""
+ end
+ if joiner then
+ n = n + 1 ; w[n] = joiner
end
- elseif id == hlist_code or id == vlist_code then
- n = n + 1 ; w[n] = "["
- n = n + 1 ; w[n] = listtoutf(getlist(h),joiner,textonly,last,nodisc)
- n = n + 1 ; w[n] = "]"
+ elseif id == passive_code then
+ -- smells like a bug in luatex
+ print("weird: passive node in listtoutf")
+ return ""
+ elseif textonly then
+ if id == glue_code then
+ if getwidth(h) > 0 then
+ n = n + 1 ; w[n] = " "
+ end
+ elseif id == hlist_code or id == vlist_code then
+ local l = getlist(h)
+ n = n + 1 ; w[n] = "["
+ if l then
+ n = n + 1 ; w[n] = listtoutf(l,joiner,textonly,last,nodisc)
+ end
+ n = n + 1 ; w[n] = "]"
+ end
+ else
+ n = n + 1 ; w[n] = "[-]"
+ end
+ if h == last then
+ break
+ else
+ h = getnext(h)
end
- else
- n = n + 1 ; w[n] = "[-]"
- end
- if h == last then
- break
- else
- h = getnext(h)
end
+ return concat(w,"",1,(w[n] == joiner) and (n-1) or n)
+ else
+ return ""
end
- return concat(w,"",1,(w[n] == joiner) and (n-1) or n)
end
function nodes.listtoutf(h,joiner,textonly,last,nodisc)
if h then
local joiner = joiner == true and utfchar(0x200C) or joiner -- zwnj
- return listtoutf(tonut(h),joiner,textonly,last and tonut(last),nodisc)
+ return listtoutf(tonut(h),joiner,textonly,last and tonut(last) or nil,nodisc)
else
return ""
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-tsk.lua b/Master/texmf-dist/tex/context/base/mkiv/node-tsk.lua
index ca7c7fee45b..9e263df9136 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-tsk.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-tsk.lua
@@ -663,6 +663,7 @@ tasks.new {
"before",
"normalizers",
"builders",
+ "finalizers",
"after",
},
templates = {
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-tst.lua b/Master/texmf-dist/tex/context/base/mkiv/node-tst.lua
index 0dacff37532..c28086f8146 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-tst.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-tst.lua
@@ -16,11 +16,7 @@ local glue_code = nodecodes.glue
local penalty_code = nodecodes.penalty
local kern_code = nodecodes.kern
local glyph_code = nodecodes.glyph
-local whatsit_code = nodecodes.whatsit
-local hlist_code = nodecodes.hlist
-local leftskip_code = gluecodes.leftskip
-local rightskip_code = gluecodes.rightskip
local abovedisplayshortskip_code = gluecodes.abovedisplayshortskip
local belowdisplayshortskip_code = gluecodes.belowdisplayshortskip
@@ -35,52 +31,16 @@ local getkern = nuts.getkern
local getpenalty = nuts.getpenalty
local getwidth = nuts.getwidth
-local find_node_tail = nuts.tail
-
-function nuts.leftmarginwidth(n) -- todo: three values
- while n do
- local id = getid(n)
- if id == glue_code then
- return getsubtype(n) == leftskip_code and getwidth(n) or 0
- elseif id == whatsit_code then
- n = getnext(n)
- elseif id == hlist_code then
- return getwidth(n)
- else
- break
- end
- end
- return 0
-end
-
-function nuts.rightmarginwidth(n)
- if n then
- n = find_node_tail(n)
- while n do
- local id = getid(n)
- if id == glue_code then
- return getsubtype(n) == rightskip_code and getwidth(n) or 0
- elseif id == whatsit_code then
- n = getprev(n)
- else
- break
- end
- end
- end
- return false
-end
-
function nuts.somespace(n,all)
if n then
local id = getid(n)
if id == glue_code then
return (all or (getwidth(n) ~= 0)) and glue_code -- temp: or 0
elseif id == kern_code then
- return (all or (getkern(n) ~= 0)) and kern
+ return (all or (getkern(n) ~= 0)) and kern_code
elseif id == glyph_code then
- local category = chardata[getchar(n)].category
-- maybe more category checks are needed
- return (category == "zs") and glyph_code
+ return (chardata[getchar(n)].category == "zs") and glyph_code
end
end
return false
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-typ.lua b/Master/texmf-dist/tex/context/base/mkiv/node-typ.lua
index adf0d18c005..46494fef396 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-typ.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/node-typ.lua
@@ -20,7 +20,6 @@ local setchar = nuts.setchar
local setattrlist = nuts.setattrlist
local getfont = nuts.getfont
-local getattrlist = nuts.getattrlist
local hpack_node_list = nuts.hpack
local vpack_node_list = nuts.vpack
@@ -32,23 +31,18 @@ local new_glue = nodepool.glue
local utfvalues = utf.values
-local currentfont = font.current -- mabe nicer is fonts .current
-local currentattributes = node.current_attributes -- mabe nicer is attributes.current
-
+local currentfont = font.current
+local currentattributes = nodes.currentattributes
local fontparameters = fonts.hashes.parameters
-if not currentattributes then currentattributes = node.current_attr end -- CONTEXTLMTXMODE == 0
-
-- when attrid == true then take from glyph or current else use the given value
+-- todo: glyphscale etc
+
local function tonodes(str,fontid,spacing,templateglyph,attrid) -- quick and dirty
local head, prev = nil, nil
if not fontid then
- if templateglyph then
- fontid = getfont(templateglyph)
- else
- fontid = currentfont()
- end
+ fontid = templateglyph and getfont(templateglyph) or currentfont()
end
if attrid == true then
if templateglyph then
@@ -107,7 +101,7 @@ local function tohbox(str,fontid,spacing)
end
local function tovpack(str,fontid,spacing)
- -- vpack is just a hack, and a proper implemtation is on the agenda
+ -- vpack is just a hack, and a proper implementation is on the agenda
-- as it needs more info etc than currently available
return vpack_node_list(tonodes(str,fontid,spacing))
end
@@ -133,9 +127,9 @@ typesetters.hpack = typesetters.tohpack -- obsolete
typesetters.hbox = typesetters.tohbox -- obsolete
typesetters.vpack = typesetters.tovpack -- obsolete
--- node.write(nodes.typesetters.tohpack("Hello World!"))
--- node.write(nodes.typesetters.tohbox ("Hello World!"))
--- node.write(nodes.typesetters.tohpack("Hello World!",1,100*1024*10))
--- node.write(nodes.typesetters.tohbox ("Hello World!",1,100*1024*10))
+-- context(nodes.typesetters.tohpack("Hello World!"))
+-- context(nodes.typesetters.tohbox ("Hello World!"))
+-- context(nodes.typesetters.tohpack("Hello World!",1,100*1024*10))
+-- context(nodes.typesetters.tohbox ("Hello World!",1,100*1024*10))
string.tonodes = function(...) return tonode(tonodes(...)) end -- quite convenient
diff --git a/Master/texmf-dist/tex/context/base/mkiv/pack-cut.mkiv b/Master/texmf-dist/tex/context/base/mkiv/pack-cut.mkiv
index 84c14d648e5..533440efdc7 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/pack-cut.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/pack-cut.mkiv
@@ -102,9 +102,8 @@
\vss}%
\hss}}
-\unexpanded\def\makecutbox#1%
- {\bgroup
- \d_pack_cutmarks_height\ht#1%
+\unexpanded\def\makecutbox#1% not grouped !
+ {\d_pack_cutmarks_height\ht#1%
\d_pack_cutmarks_depth \dp#1%
\d_pack_cutmarks_width \wd#1%
\setbox#1\hpack
@@ -155,8 +154,7 @@
\box#1}%
\wd#1\d_pack_cutmarks_width
\ht#1\d_pack_cutmarks_height
- \dp#1\d_pack_cutmarks_depth
- \egroup}
+ \dp#1\d_pack_cutmarks_depth}
\unexpanded\def\cuthbox{\hpack\bgroup\dowithnextbox{\makecutbox\nextbox\flushnextbox\egroup}\hbox}
\unexpanded\def\cutvbox{\vpack\bgroup\dowithnextbox{\makecutbox\nextbox\flushnextbox\egroup}\vbox}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/pack-rul.lua b/Master/texmf-dist/tex/context/base/mkiv/pack-rul.lua
index 8e410f0cfc0..98117867c91 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/pack-rul.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/pack-rul.lua
@@ -57,7 +57,7 @@ local getboxglue = nuts.getboxglue
local hpack = nuts.hpack
local getdimensions = nuts.dimensions
-local flush_node = nuts.flush
+local flushnode = nuts.flush
local traversers = nuts.traversers
local nexthlist = traversers.hlist
@@ -131,7 +131,7 @@ local function doreshapeframedbox(n)
local set, order, sign = getboxglue(p)
setboxglue(h,set,order,sign)
setlist(p)
- flush_node(p)
+ flushnode(p)
elseif checkformath and subtype == equationlist_code then
-- display formulas use a shift
if nofnonzero == 1 then
@@ -165,7 +165,7 @@ local function doreshapeframedbox(n)
texsetdimen("global","framedaveragewidth",averagewidth)
end
-local function doanalyzeframedbox(n) -- traverse_list
+local function doanalyzeframedbox(n)
local box = getbox(n)
local noflines = 0
local firstheight = nil
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-app.mkiv b/Master/texmf-dist/tex/context/base/mkiv/page-app.mkiv
index cdb964ab06e..1a82e178d06 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-app.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-app.mkiv
@@ -204,7 +204,7 @@
{\bgroup
\setupexternalfigure[\v!page:\v!figure][\c!offset=\v!overlay,#2]%
\startTEXpage[\c!offset=\namedexternalfigureparameter{\v!page:\v!figure}\c!offset]%
- \externalfigure[#1]\ignorespaces} % so we can put some text below the graphic
+ \externalfigure[#1][\v!page:\v!figure]\ignorespaces} % so we can put some text below the graphic
\unexpanded\def\stoppagefigure
{\stopTEXpage
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-cst.lua b/Master/texmf-dist/tex/context/base/mkiv/page-cst.lua
index a6315ff05f9..5106f1fef92 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-cst.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-cst.lua
@@ -37,8 +37,7 @@ local tonode = nuts.tonode
local tonut = nuts.tonut
local vpack = nuts.vpack
-local flushlist = nuts.flush_list
------ removenode = nuts.remove
+local flushlist = nuts.flushlist
local setlink = nuts.setlink
local setlist = nuts.setlist
@@ -62,7 +61,7 @@ local takebox = nuts.takebox
local takelist = nuts.takelist
local splitbox = nuts.splitbox
local getattribute = nuts.getattribute
-local copylist = nuts.copy_list
+local copylist = nuts.copylist
local getbox = nuts.getbox
local getcount = tex.getcount
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-flt.lua b/Master/texmf-dist/tex/context/base/mkiv/page-flt.lua
index b1f729f7a6d..7c222084035 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-flt.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-flt.lua
@@ -12,7 +12,7 @@ if not modules then modules = { } end modules ['page-flt'] = {
local next = next
local tostring = tostring
local insert, remove = table.insert, table.remove
-local find = string.find
+local find, topattern = string.find, string.topattern
local abs = math.abs
local trace_floats = false trackers.register("floats.caching", function(v) trace_floats = v end)
@@ -21,7 +21,7 @@ local trace_collecting = false trackers.register("floats.collecting", function(
local report_floats = logs.reporter("floats","caching")
local report_collecting = logs.reporter("floats","collecting")
-local C, S, P, lpegmatch = lpeg.C, lpeg.S, lpeg.P, lpeg.match
+local C, Cc, S, P, lpegmatch = lpeg.C, lpeg.Cc, lpeg.S, lpeg.P, lpeg.match
-- we use floatbox, floatwidth, floatheight
-- text page leftpage rightpage (todo: top, bottom, margin, order)
@@ -119,7 +119,7 @@ local function get(stack,n,bylabel)
if bylabel then
for i=1,#stack do
local s = stack[i]
- local n = string.topattern(tostring(n)) -- to be sure
+ local n = topattern(tostring(n)) -- to be sure
if find(s.data.label,n) then
return s, s.box, i
end
@@ -326,16 +326,18 @@ end
-- todo: check for digits !
+local digits = lpeg.patterns.digits
+local nothing = Cc("")
local method = C((1-S(", :"))^1)
-local position = P(":") * C((1-S("*,"))^1) * (P("*") * C((1-S(","))^1))^0
+local position = P(":") * C(digits^1) * (P("*") * C(digits^1) + nothing)
local label = P(":") * C((1-S(",*: "))^0)
local pattern = method * (
- label * position * C("")
- + C("") * position * C("")
- + label * C("") * C("")
- + C("") * C("") * C("")
-) + C("") * C("") * C("") * C("")
+ label * position
+ + nothing * position
+ + label * nothing * nothing
+ + nothing * nothing * nothing
+) + nothing * nothing * nothing * nothing
-- inspect { lpegmatch(pattern,"somewhere:blabla,crap") }
-- inspect { lpegmatch(pattern,"somewhere:1*2") }
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-imp.mkiv b/Master/texmf-dist/tex/context/base/mkiv/page-imp.mkiv
index 829ed24f427..ec249d65228 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-imp.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-imp.mkiv
@@ -102,6 +102,15 @@
\installshipoutmethod \v!none
{\page_shipouts_ignore}
+% \setuppaper[method=rotate,rotation=15] \showframe
+% \starttext \dorecurse{10}{\input knuth\endgraf} \stoptext
+
+\installshipoutmethod\v!rotate
+ {\page_shipouts_rotate}
+
+\protected\def\page_shipouts_rotate#1%
+ {\invokepagehandler\v!normal{\rotate[\c!rotation=\rootlayouttargetparameter\c!rotation]{#1}}}
+
% extension mechanism
\newcount\c_page_boxes_flush_n % set at the lua end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/page-ini.lua
index 924e01b2aa8..bcabc0d6b02 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-ini.lua
@@ -6,6 +6,8 @@ if not modules then modules = { } end modules ['page-ini'] = {
license = "see context related readme files"
}
+-- Some day I need to make this more efficient.
+
local tonumber, rawget, rawset, type, next = tonumber, rawget, rawset, type, next
local match = string.match
local sort, tohash, insert, remove, sortedkeys = table.sort, table.tohash, table.insert, table.remove, table.sortedkeys
@@ -13,7 +15,12 @@ local settings_to_array, settings_to_hash = utilities.parsers.settings_to_array,
local texgetcount = tex.getcount
+local tonut = nodes.tonut
+local nextlist = nodes.nuts.traversers.list
+local texlists = tex.lists
+
local context = context
+local ctx_doif = commands.doif
local ctx_doifelse = commands.doifelse
local implement = interfaces.implement
@@ -23,16 +30,22 @@ local last = 0
local pages = structures.pages
local autolist = { }
local report = logs.reporter("pages","mark")
+local active = false
local trace = false trackers.register("pages.mark",function(v) trace = v end)
-function pages.mark(name,list)
+function pages.mark(name,list,settings)
+ active = true
+ --
local realpage = texgetcount("realpageno")
+ if type(settings) == "string" then
+ settings = settings_to_hash(settings)
+ end
if not list or list == "" then
if trace then
report("marking current page %i as %a",realpage,name)
end
- data[realpage][name] = true
+ data[realpage][name] = settings or true
return
end
if type(list) == "string" then
@@ -51,7 +64,7 @@ function pages.mark(name,list)
report("marking page %i upto %i as %a",f,t,name)
end
for page=f,t do
- data[page][name] = true
+ data[page][name] = settings or true
end
end
page = false
@@ -74,7 +87,7 @@ function pages.mark(name,list)
if trace then
report("marking page %i as %a",page,name)
end
- data[page][name] = true
+ data[page][name] = settings or true
end
end
end
@@ -83,30 +96,51 @@ function pages.mark(name,list)
if trace then
report("marking current page %i as %a",realpage,name)
end
- data[realpage][name] = true
+ data[realpage][name] = settings or true
end
end
local tobemarked = { }
function pages.markedlist(realpage)
- if realpage then
+ if active and realpage then
local m = rawget(tobemarked,realpage) or rawget(data,realpage)
return m and next(m) and sortedkeys(m)
end
end
local function marked(name)
- local realpage = texgetcount("realpageno")
- for i=last,realpage-1 do
- local di = data[i]
- if di then
- tobemarked[i] = di
- rawset(data,i,nil)
+ if active then
+ local realpage = texgetcount("realpageno")
+ if last ~= 0 then
+ for i=last,realpage-1 do
+ -- print(last)
+ local di = data[i]
+ if di then
+ tobemarked[i] = di
+ rawset(data,i,nil)
+ end
+ end
+ last = 0 -- needs checking
+ end
+ local pagedata = rawget(data,realpage)
+ return pagedata and pagedata[name] and true or false
+ else
+ return false
+ end
+end
+
+local function markedparameter(name,key)
+ if active then
+ local pagedata = rawget(data,texgetcount("realpageno"))
+ if pagedata then
+ pagedata = pagedata[name]
+ if pagedata then
+ pagedata = pagedata[key]
+ end
end
+ return pagedata
end
- local pagedata = rawget(data,realpage)
- return pagedata and pagedata[name] and true or false
end
local function toranges(marked)
@@ -124,12 +158,14 @@ local function toranges(marked)
last = page
end
list[#list+1] = { first, last }
+ --
+ active = true
end
return list
end
local function allmarked(list)
- if list then
+ if active and list then
local collected = pages.collected
if collected then
if type(list) == "string" then
@@ -175,26 +211,77 @@ pages.allmarked = allmarked
-- An alternative is to use an attribute and identify the state by parsing the node
-- list but that's a bit overkill for a hardly used feature like this.
-luatex.registerpageactions(function()
+-- Page actions are bound to a real page. When we set one, we need to bind to the
+-- current page unless we just flushed. So we also need to check the current page.
+
+-- \page ... \start : sync realpage
+-- \page \start : sync realpage
+-- \page \stop : reset synced because no content yet
+-- \page ... \stop : keep sync
+
+local function autopageaction()
+ if active then
+ local nofauto = #autolist
+ if nofauto > 0 then
+ local realpage = texgetcount("realpageno")
+ for i=1,nofauto do
+ local entry = autolist[i]
+ local names = entry[1]
+ local settings = entry[2]
+ for j=1,#names do
+ local name = names[j]
+ local list = data[realpage]
+ if not list[name] then
+ if trace then
+ report("automatically marking page %i as %a",realpage,name)
+ end
+ list[name] = settings or true
+ end
+ end
+ end
+ end
+ end
+end
+
+local function startmarked(name,settings)
+ active = true
+ --
+ insert(autolist, { settings_to_array(name), settings_to_hash(settings) })
+ autopageaction(true)
+end
+
+local function stopmarked()
local nofauto = #autolist
if nofauto > 0 then
- local realpage = texgetcount("realpageno")
- for i=1,nofauto do
- local names = autolist[i]
- for j=1,#names do
- local name = names[j]
- data[realpage][name] = true
- if trace then
- report("automatically marking page %i as %a",realpage,name)
+ if not texlists.pagehead then
+ local realpage = texgetcount("realpageno")
+ for i=1,nofauto do
+ local entry = autolist[i]
+ local names = entry[1]
+ for j=1,#names do
+ local name = names[j]
+ local list = data[realpage]
+ if list[name] then
+ if trace then
+ report("automatically unmarking page %i as %a",realpage,name)
+ end
+ list[name] = nil
+ end
end
end
end
+ remove(autolist)
end
-end)
+end
+
+implement {
+ name = "checkmarkedpages",
+ actions = autopageaction,
+}
implement {
name = "markpage",
- arguments = "2 strings",
+ arguments = "3 strings",
actions = pages.mark
}
@@ -205,6 +292,23 @@ implement {
}
implement {
+ name = "doifmarkedpage",
+ arguments = "string",
+ actions = { marked, ctx_doif }
+}
+
+implement {
+ name = "markedpageparameter",
+ arguments = "strings",
+ actions = function(name,key)
+ local value = markedparameter(name,key)
+ if value then
+ context(value)
+ end
+ end
+}
+
+implement {
name = "markedpages",
arguments = "string",
actions = function(name)
@@ -217,20 +321,13 @@ implement {
implement {
name = "startmarkpages",
- arguments = "string",
- actions = function(name)
- insert(autolist,settings_to_array(name))
- end
+ arguments = "2 strings",
+ actions = startmarked,
}
implement {
- name = "stopmarkpages",
- arguments = "string",
- actions = function(name)
- if #autolist > 0 then
- remove(autolist)
- end
- end
+ name = "stopmarkpages",
+ actions = stopmarked,
}
local tonut = nodes.tonut
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/page-ini.mkiv
index e56c3ac0404..0c444ffc2fc 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-ini.mkiv
@@ -333,10 +333,10 @@
\installcorenamespace{markedpage}
\unexpanded\def\markpage
- {\dodoubleempty\page_mark}
+ {\dotripleempty\page_mark}
-\def\page_mark[#1][#2]%
- {\clf_markpage{#1}{#2}}
+\def\page_mark[#1][#2][#3]%
+ {\clf_markpage{#1}{#2}{#3}}
\def\markedpages[#1]% expandable
{\clf_markedpages{#1}}
@@ -344,12 +344,28 @@
\unexpanded\def\doifelsemarkedpage#1%
{\clf_doifelsemarkedpage{#1}}
-\unexpanded\def\startmarkpages[#1]%
- {\clf_startmarkpages{#1}}
+\unexpanded\def\doifmarkedpage#1%
+ {\clf_doifmarkedpage{#1}}
+
+\unexpanded\def\startmarkpages
+ {\dodoubleempty\page_start_marked}
+
+\def\page_start_marked[#1][#2]%
+ {\clf_startmarkpages{#1}{#2}}
\unexpanded\def\stopmarkpages
{\clf_stopmarkpages}
+\unexpanded\def\checkmarkedpages
+ {\clf_checkmarkedpages}
+
+\def\markedpageparameter#1#2%
+ {\clf_markedpageparameter{#1}{#2}}
+
+\appendtoks
+ \checkmarkedpages
+\to \everyaftershipout
+
%D Experimental:
\newconstant\c_page_force_strut_depth_trace_mode
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-inj.mkvi b/Master/texmf-dist/tex/context/base/mkiv/page-inj.mkvi
index f1b520f5e3e..0adfca92d33 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-inj.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-inj.mkvi
@@ -33,8 +33,14 @@
\let\page_boxes_flush_after \clf_flushpageinjectionsafter
\def\page_injections_flush_indeed
- {\scrn_canvas_synchronize_set{\pageinjectionparameter\c!width}{\pageinjectionparameter\c!height}%
- \invokepagehandler\v!normal{\inheritedpageinjectionframed{\texsetup\p_page_injectionalternative_rederingsetup}}%
+ {\begingroup
+ \setbox\scratchbox\normalhpack
+ {\inheritedpageinjectionframed{\texsetup\p_page_injectionalternative_rederingsetup}}%
+ \printpaperwidth \wd\scratchbox
+ \printpaperheight\ht\scratchbox
+ \scrn_canvas_synchronize_only
+ \invokepagehandler\v!normal{\box\scratchbox}%
+ \endgroup
\scrn_canvas_synchronize_reset}
\def\page_injections_flush_saved#name#parameters%
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-lin.lua b/Master/texmf-dist/tex/context/base/mkiv/page-lin.lua
index 06983ef5c6f..d3ff2cdadcb 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-lin.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-lin.lua
@@ -84,7 +84,6 @@ local nextvlist = nuts.traversers.vlist
local copy_node = nuts.copy
----- hpack_nodes = nuts.hpack
local is_display_math = nuts.is_display_math
-local leftmarginwidth = nuts.leftmarginwidth
----- nodepool = nuts.pool
----- new_kern = nodepool.kern
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-lin.mkvi b/Master/texmf-dist/tex/context/base/mkiv/page-lin.mkvi
index e355e3e6017..3a54d1ef5eb 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-lin.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-lin.mkvi
@@ -352,7 +352,9 @@
\def\page_lines_add_numbers_to_box#box#column#max#nesting%
{\bgroup
- \strc_tags_enable_indeed
+ \ifconditional\c_strc_tags_enabled
+ \strc_tags_enable_indeed
+ \fi
\b_page_lines_number #box\relax
\c_page_lines_column #column\relax
\c_page_lines_last_column#max\relax
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-mix.lua b/Master/texmf-dist/tex/context/base/mkiv/page-mix.lua
index dacc829d7e6..a4e08063d50 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-mix.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-mix.lua
@@ -33,7 +33,7 @@ local vlist_code = nodecodes.vlist
local kern_code = nodecodes.kern
local glue_code = nodecodes.glue
local penalty_code = nodecodes.penalty
-local insert_code = nodecodes.ins
+local insert_code = nodecodes.insert
local mark_code = nodecodes.mark
local rule_code = nodecodes.rule
@@ -59,9 +59,9 @@ local getnext = nuts.getnext
local getprev = nuts.getprev
local getid = nuts.getid
local getlist = nuts.getlist
-local getsubtype = nuts.getsubtype
+local getindex = nuts.getindex or nuts.getsubtype -- luatex catch
local getbox = nuts.getbox
-local getattribute = nuts.getattribute
+local getattr = nuts.getattr
local getwhd = nuts.getwhd
local getkern = nuts.getkern
local getpenalty = nuts.getpenalty
@@ -79,6 +79,8 @@ local new_glue = nodepool.glue
local points = number.points
+local setinsertcontent = tex.setinsertcontent or tex.setbox
+
local settings_to_hash = utilities.parsers.settings_to_hash
local variables = interfaces.variables
@@ -121,7 +123,7 @@ local function collectinserts(result,nxt,nxtid)
i = i + 1
result.i = i
inserttotal = inserttotal + getheight(nxt) -- height includes depth (hm, still? needs checking)
- local s = getsubtype(nxt)
+ local s = getindex(nxt)
local c = inserts[s]
if trace_details then
report_state("insert of class %s found",s)
@@ -249,12 +251,19 @@ local function preparesplit(specification) -- a rather large function
report_state("fatal error, no list")
return
end
- local head = getlist(list) or specification.originalhead
+ local head = nil
+ if getid(list) == hlist_code then
+ head = list
+ else
+ head = getlist(list) or specification.originalhead
+ end
if not head then
report_state("fatal error, no head")
return
end
+
slidenodes(head) -- we can have set prev's to nil to prevent backtracking
+
local discarded = { }
local originalhead = head
local originalwidth = specification.originalwidth or getwidth(list)
@@ -439,6 +448,7 @@ local function preparesplit(specification) -- a rather large function
if column == nofcolumns then
column = 0 -- nicer in trace
rest = head
+-- rest = nil
return false, 0
else
local skipped
@@ -589,7 +599,7 @@ local function preparesplit(specification) -- a rather large function
if penalty == 0 then
unlock(2,penalty)
elseif penalty == forcedbreak then
- local needed = getattribute(current,a_checkedbreak)
+ local needed = getattr(current,a_checkedbreak)
local proceed = not needed or needed == 0
if not proceed then
local available = target - height
@@ -770,7 +780,6 @@ local function preparesplit(specification) -- a rather large function
specification.rest = rest
specification.overflow = overflow
specification.discarded = discarded
-
setlist(getbox(specification.box))
return specification
@@ -897,6 +906,7 @@ local function getsplit(result,n)
end
setprev(h) -- move up
+
local strutht = result.strutht
local strutdp = result.strutdp
local lineheight = strutht + strutdp
@@ -905,6 +915,19 @@ local function getsplit(result,n)
local v = new_vlist()
setlist(v,h)
+ -- safeguard ... i need to figure this out some day
+
+ local c = r.head
+ while c do
+ if c == result.rest then
+ report_state("flush, column %s, %s",n,"suspicous rest")
+ result.rest = nil
+ break
+ else
+ c = getnext(c)
+ end
+ end
+
-- local v = vpack(h,"exactly",height)
if isglobal then -- option
@@ -985,8 +1008,8 @@ local function getsplit(result,n)
for i=1,#list-1 do
setdepth(list[i],0)
end
- local b = vpack(l) -- multiple arguments, todo: fastvpack
- setbox("global",c,b) -- when we wrap in a box
+ local b = vpack(l) -- multiple arguments, todo: fastvpack
+ setinsertcontent(c,tonode(b)) -- when we wrap in a box
r.inserts[c] = nil
end
@@ -1064,7 +1087,10 @@ implement {
arguments = "integer",
actions = function(n)
if result then
- context(tonode(getsplit(result,n)))
+ local list = getsplit(result,n)
+ if list then
+ context(tonode(list))
+ end
end
end,
}
@@ -1082,7 +1108,10 @@ implement {
name = "mixflushrest",
actions = function()
if result then
- context(tonode(getrest(result)))
+ local rest = getrest(result)
+ if rest then
+ context(tonode(rest))
+ end
end
end
}
@@ -1091,7 +1120,10 @@ implement {
name = "mixflushlist",
actions = function()
if result then
- context(tonode(getlist(result)))
+ local list = getlist(result)
+ if list then
+ context(tonode(list))
+ end
end
end
}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-mix.mkiv b/Master/texmf-dist/tex/context/base/mkiv/page-mix.mkiv
index e38ad74068d..2bca9cbf56c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-mix.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-mix.mkiv
@@ -31,10 +31,6 @@
% offsets (inner ones, so we change the hsize ... needed with backgrounds
% when no content we currently loose the page
-% luatex buglet:
-%
-% \ctxlua{tex.setbox("global",0,node.hpack(nodes.pool.glyph("a",font.current())))}\box0
-
\registerctxluafile{page-mix}{}
\unprotect
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-one.mkiv b/Master/texmf-dist/tex/context/base/mkiv/page-one.mkiv
index 54e53035f51..567a19884d5 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-one.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-one.mkiv
@@ -63,6 +63,22 @@
% \fi
% \fi}
+% \unexpanded\def\page_one_command_set_vsize
+% {\ifgridsnapping
+% \ifcase\layoutlines
+% \getrawnoflines\textheight
+% \else
+% \noflines\layoutlines
+% \fi
+% \global\vsize\noflines\openlineheight
+% \else
+% \global\vsize\textheight
+% \fi
+% \global\advance\vsize\d_page_adapts_delta
+% % alternatively we could set it in builders.buildpage_filter
+% % \ifdim\pagegoal<\maxdimen .. \fi
+% \pagegoal\dimexpr\vsize-\d_page_floats_inserted_top-\d_page_floats_inserted_bottom\relax}
+
\unexpanded\def\page_one_command_set_vsize
{\ifgridsnapping
\ifcase\layoutlines
@@ -75,10 +91,10 @@
\global\vsize\textheight
\fi
\global\advance\vsize\d_page_adapts_delta
- % alternatively we could set it in builders.buildpage_filter
- % \ifdim\pagegoal<\maxdimen .. \fi
- \pagegoal\dimexpr\vsize-\d_page_floats_inserted_top-\d_page_floats_inserted_bottom\relax}
-
+ % \pagegoal\dimexpr\vsize-\d_page_floats_inserted_top-\d_page_floats_inserted_bottom\relax}
+ % per 2021/9/9 : otherwise weird notes overlap with side floats
+ \settotalinsertionheight
+ \pagegoal\dimexpr\vsize-\totalinsertionheight\relax}
% 1 = partial page, 2 = whole page, 3 = partial page
@@ -356,13 +372,13 @@
\def\page_one_command_flush_bottom_insertions_indeed
{\ifgridsnapping
- % \floatparameter\c!bottombefore
+ % \rootfloatparameter\c!bottombefore
\snaptogrid\hbox{\box\namedinsertionnumber\s!bottomfloat}%
- % \floatparameter\c!bottomafter
+ % \rootfloatparameter\c!bottomafter
\else
- \floatparameter\c!bottombefore
+ \rootfloatparameter\c!bottombefore
\unvbox\namedinsertionnumber\s!bottomfloat
- \floatparameter\c!bottomafter
+ \rootfloatparameter\c!bottomafter
\fi}
\unexpanded\def\page_one_command_flush_floats
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-pcl.mkiv b/Master/texmf-dist/tex/context/base/mkiv/page-pcl.mkiv
index 43ba4feb326..262ee71ab1a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-pcl.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-pcl.mkiv
@@ -246,8 +246,8 @@
\page_marks_synchronize_column\plusone\c_page_col_n_of_columns\recurselevel\scratchbox
% backgrounds
\anch_mark_column_box\scratchbox\recurselevel
- \mixedcolumnseparatorheight\ht\scratchbox
- \mixedcolumnseparatordepth \dp\scratchbox
+ \pagecolumnseparatorheight\ht\scratchbox
+ \pagecolumnseparatordepth \dp\scratchbox
\inheritedpagecolumnsframedbox\recurselevel\scratchbox}
\def\page_col_routine_package
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-sid.mkiv b/Master/texmf-dist/tex/context/base/mkiv/page-sid.mkiv
index e6c1be985d7..88e4fb1164b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-sid.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-sid.mkiv
@@ -292,7 +292,7 @@
\box\floatbox
% somehow we need this \scratchbox magic, but at least it's the same as the
% tracer now
- \setbox\scratchbox\emptybox
+ \setbox\scratchbox\emptyhbox
\wd\scratchbox\hsize
\ht\scratchbox\d_page_sides_bottomtotal
\box\scratchbox
diff --git a/Master/texmf-dist/tex/context/base/mkiv/page-str.lua b/Master/texmf-dist/tex/context/base/mkiv/page-str.lua
index 73f1782d0b6..64e593e27e2 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/page-str.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/page-str.lua
@@ -24,11 +24,12 @@ local nuts = nodes.nuts
local tonut = nodes.tonut
local slide_node_list = nuts.slide
local write_node = nuts.write
-local flush_node = nuts.flush
-local copy_node_list = nuts.copy_list
+local flushnode = nuts.flush
+local copy_node_list = nuts.copylist
local vpack_node_list = nuts.vpack
+local new_rule = nuts.pool.rule
-local getbox = nuts.getbox
+----- getbox = nuts.getbox
local setlink = nuts.setlink
local getlist = nuts.getlist
local setlist = nuts.setlist
@@ -40,7 +41,6 @@ local settings_to_array = utilities.parsers.settings_to_array
local enableaction = nodes.tasks.enableaction
local texgetdimen = tex.getdimen
------ texgetbox = tex.getbox
local trace_collecting = false trackers.register("streams.collecting", function(v) trace_collecting = v end)
local trace_flushing = false trackers.register("streams.flushing", function(v) trace_flushing = v end)
@@ -146,7 +146,7 @@ function streams.flush(name,copy) -- problem: we need to migrate afterwards
if di then
write_node(getlist(di)) -- list, will be option
setlist(di)
- flush_node(di)
+ flushnode(di)
end
end
end
@@ -226,9 +226,11 @@ function streams.synchronize(list) -- this is an experiment !
local delta = delta_height -- for tracing
while delta > 0 do
-- we need to add some interline penalties
- local line = copy_node_list(getbox("strutbox"))
- setwhd(line,false,strutht,strutdp)
+ -- local line = copy_node_list(getbox("strutbox"))
+ -- setwhd(line,false,strutht,strutdp)
+ local line = new_rule(0,strutht,strutdp) -- no tracing
if tail then
+ -- todo: inject at a better place
setlink(tail,line)
end
tail = line
@@ -237,7 +239,7 @@ function streams.synchronize(list) -- this is an experiment !
end
dana[m] = vpack_node_list(getlist(vbox))
setlist(vbox)
- flush_node(vbox)
+ flushnode(vbox)
if trace_flushing then
report_streams("slot %s:%s with delta (%p,%p) is compensated by %s lines",m,i,delta_height,delta_depth,n)
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/phys-dim.lua b/Master/texmf-dist/tex/context/base/mkiv/phys-dim.lua
index e0cea7babde..91803e4fdcd 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/phys-dim.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/phys-dim.lua
@@ -1008,7 +1008,7 @@ implement {
protected = true,
arguments = { "optional", "string" },
actions = function(filler, digits)
- digits = gsub(digits,"(%d)","%1\\digitsbreak")
+ digits = gsub(digits,"(%d)","%1\\digitsbreak ") -- space needed for following letters
digits = gsub(digits,"\\-$",filler)
context(digits)
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/phys-dim.mkiv b/Master/texmf-dist/tex/context/base/mkiv/phys-dim.mkiv
index b390ce64aef..a05300cce3c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/phys-dim.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/phys-dim.mkiv
@@ -170,9 +170,8 @@
% \definesymbol[units][times][\ifmmode\cdot\else\kern.2\emwidth\cdot\kern.2\emwidth\fi]
\unexpanded\def\digitstextbinop#1% assumes preceding
- {\ifmmode#1\else\fourperemspace\nobreak#1\fourperemspace\fi}
+ {\ifmmode\mathord{#1}\else\nobreak#1\fi}
-%def\digitstimessymbol{\ifmmode\cdot\else\digitstextbinop\cdot\fi}
\def\digitstimessymbol{\digitstextbinop\times}
\unexpanded\def\digitszeropadding {\hphantom{0}}
@@ -406,8 +405,13 @@
% \endcsname}
\unexpanded\def\phys_units_separator
- {\edef\currentunitsseparator{\unitparameter\c!separator}% no longer needed
- \ifcsname\??unitseparator\currentunitsseparator\endcsname\lastnamedcs\else\cdot\fi}
+ {\ifcsname\??unitseparator\unitparameter\c!separator\endcsname
+ \lastnamedcs
+ \else
+ \csname\??unitseparator\v!normal\endcsname
+ \fi}
+
+\installunitsseparator\v!normal{\ifmmode\mathord{\cdot}\else\cdot\fi}
\installunitsseparator\v!normal {\cdot}
\installunitsseparator\v!big {\unitsbigspace}
@@ -521,9 +525,6 @@
{\edef\p_order{\unitparameter\c!order}%
\ifx\p_order\v!reverse\expandafter\clf_unit_reverse\else\expandafter\clf_unit_normal\fi{\detokenize{#1}}}
-\unexpanded\def\digitstextbinnop#1%
- {\ifmmode#1\else#1\fourperemspace\fi}
-
\unexpanded\def\unitsPUS#1#2#3{\phys_units_next\prefixtext{#1}\unittext{#2}\unitsraise{\suffixtext{#3}}\c_phys_units_state\plusone} % suffix
\unexpanded\def\unitsPU #1#2{\phys_units_next\prefixtext{#1}\unittext{#2}\c_phys_units_state\plusthree} % unit
\unexpanded\def\unitsPS #1#2{\phys_units_next\prefixtext{#1}\unitsraise{\suffixtext{#2}}\c_phys_units_state\plusone} % suffix
diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-aut.lua b/Master/texmf-dist/tex/context/base/mkiv/publ-aut.lua
index 123a67009d4..64fecb3d5b0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/publ-aut.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/publ-aut.lua
@@ -503,6 +503,7 @@ local function btxauthor(dataset,tag,field,settings)
ctx_btxsetup(combiner)
ctx_btxstopauthor()
end
+
if index then
oneauthor(index)
elseif max == 1 then
@@ -515,9 +516,11 @@ local function btxauthor(dataset,tag,field,settings)
oneauthor(absmax,true)
end
end
+
else
report("ignored field %a of tag %a, used field %a is no author",field,tag,usedfield)
end
+
end
implement {
@@ -995,6 +998,22 @@ publications.sortmethods.authoryear = {
},
}
+publications.sortmethods.authortitle = {
+ sequence = {
+ { field = "author", default = "", unknown = "" },
+ { field = "title", default = "", unknown = "" },
+ { field = "booktitle", default = "", unknown = "" }, -- if this is an untitled section (e.g., introduction, foreword, preface) of a book or a review of a book
+ { field = "maintitle", default = "", unknown = "" }, -- if this is an untitled section or volume in a multivolume collection
+ { field = "volume", default = "", unknown = "" },
+ { field = "part", default = "", unknown = "" },
+ { field = "date", default = "9998-13-32", unknown = "9999-14-33" }, -- some specifications allow date instead of year, month, day
+ { field = "year", default = "9998", unknown = "9999" },
+ { field = "month", default = "13", unknown = "14" },
+ { field = "day", default = "32", unknown = "33" },
+ { field = "index", default = "", unknown = "" },
+ },
+}
+
implement {
name = "btxremapauthor",
arguments = "2 strings",
diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-dat.lua b/Master/texmf-dist/tex/context/base/mkiv/publ-dat.lua
index f09e97a8d9f..64aaaf4603e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/publ-dat.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/publ-dat.lua
@@ -379,6 +379,7 @@ function publications.new(name)
suffixes = { },
xmldata = xmlconvert(xmlplaceholder),
details = { },
+ missing = { },
ordered = { },
nofbytes = 0,
entries = nil, -- empty == all
@@ -632,13 +633,13 @@ do
local r_value = reference * Carg(1) / resolve
local balanced = P {
- [1] = ((escape * (left+right)) + (collapsed + r_value + 1 - (left+right))^1 + V(2))^0,
- [2] = left * V(1) * right,
+ ((escape * (left+right)) + (collapsed + r_value + 1 - (left+right))^1 + V(2))^0,
+ left * V(1) * right,
}
-- local unbalanced = P {
- -- [1] = left * V(2) * right,
- -- [2] = ((escape * (left+right)) + (collapsed + 1 - (left+right))^1 + V(1))^0,
+ -- left * V(2) * right,
+ -- ((escape * (left+right)) + (collapsed + 1 - (left+right))^1 + V(1))^0,
-- }
local unbalanced = (left/"") * balanced * (right/"") * P(-1)
@@ -732,6 +733,7 @@ do
end
end
end
+-- inspect(luadata)
statistics.stoptiming(publications)
end
@@ -1172,18 +1174,31 @@ do
end
end
- function savers.lua(dataset,filename,tobesaved)
- local list = { }
- local n = 0
- for tag, data in next, tobesaved do
+ function savers.lua(dataset,filename,tobesaved,options)
+ local list = { }
+ local n = 0
+
+ local function totable(data,category)
local t = { }
for key, value in next, data do
if not privates[key] then
- d[key] = value
+ t[key] = value
end
end
- list[tag] = t
+ t.category = category
n = n + 1
+ return t
+ end
+
+ if options.category then
+ setmetatableindex(list,"table")
+ for tag, data in next, tobesaved do
+ list[data.category or "unknown"][tag] = totable(data)
+ end
+ else
+ for tag, data in next, tobesaved do
+ list[tag] = totable(data,data.category)
+ end
end
report("%s entries from dataset %a saved in %a",n,dataset,filename)
table.save(filename,list)
@@ -1200,6 +1215,7 @@ do
local filename = specification.filename
local filetype = specification.filetype
local criterium = specification.criterium
+ local options = settings_to_hash(specification.options or "")
statistics.starttiming(publications)
if not filename or filename == "" then
report("no filename for saving given")
@@ -1229,7 +1245,7 @@ do
end
end
end
- saver(dataset,filename,tobesaved)
+ saver(dataset,filename,tobesaved,options)
else
report("unknown format %a for saving %a",filetype,dataset)
end
@@ -1250,6 +1266,7 @@ do
{ "filename" },
{ "filetype" },
{ "criterium" },
+ { "options" },
}
}
}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-fnd.lua b/Master/texmf-dist/tex/context/base/mkiv/publ-fnd.lua
index 32d0c11beed..5ba173365d1 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/publ-fnd.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/publ-fnd.lua
@@ -147,8 +147,8 @@ local p_expression = P("match")/"" * Cs(p_compare)
) / test_key_value
local pattern = Cs {
- [1] = V(2) * (p_combine * V(2))^0,
- [2] = p_expression,
+ V(2) * (p_combine * V(2))^0,
+ p_expression,
}
-- -- -- -- -- -- -- -- -- -- -- -- --
diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-apa.mkvi b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-apa.mkvi
index c7c00fd1436..b4ac74258bb 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-apa.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-apa.mkvi
@@ -1078,8 +1078,10 @@
\btxlabeltext{In}
\btxspace
\doifnot {\btxfoundname{author}} {editor} {
- \texdefinition{btx:apa:author-or-editor} {ineditor}
- \btxcomma
+ \btxdoif {ineditor} {
+ \texdefinition{btx:apa:author-or-editor} {ineditor}
+ \btxcomma
+ }
}
\texdefinition{btx:apa:composed-title}{booktitle}
\btxperiod
diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-aps-prb.mkvi b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-aps-prb.mkvi
new file mode 100644
index 00000000000..19735b94967
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-aps-prb.mkvi
@@ -0,0 +1,40 @@
+%D \module
+%D [ file=publ-imp-aps-prb,
+%D version=2015.03.22,
+%D title=Phys. Rev. B APS bibliography style,
+%D subtitle=Publications,
+%D author=Alan Braslau and Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is therefore copyrighted
+%D by \PRAGMA. See mreadme.pdf for details.
+
+\startbtxrenderingdefinitions[aps-prb]
+
+\loadbtxdefinitionfile[aps]
+
+\setupbtxlist
+ [aps]
+ [\c!alternative=\v!paragraph,
+ \c!width=\v!auto,
+ \c!distance=\zeropoint,
+ \c!numberalign=\v!flushright]
+
+\setupbtx
+ [aps:list:numbering:num]
+ [\c!command=\high,
+ \c!left=,
+ \c!right=,
+ \c!stopper=]
+
+\setupbtx
+ [aps:cite:num]
+ [\c!command=\high,
+ \c!left=,
+ \c!right=]
+
+%\setupbtx
+% [\c!specification=aps]
+
+\stopbtxrenderingdefinitions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-author.mkvi b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-author.mkvi
index 8ee7835996f..ea824a2b53b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-author.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-author.mkvi
@@ -118,6 +118,14 @@
\fastsetup{\s!btx:\s!cite:\s!author:others}
\stopsetups
+\startsetups \s!btx:\s!cite:\s!author:invertedfirst
+ \ifnum\currentbtxauthorindex>\plusone
+ \fastsetup{\s!btx:\s!cite:\s!author:normal}
+ \else
+ \fastsetup{\s!btx:\s!cite:\s!author:inverted}
+ \fi
+\stopsetups
+
\startsetups \s!btx:\s!cite:\s!author:invertedshort
\fastsetup{\s!btx:\s!cite:\s!author:concat}
\ifx\currentbtxvons\empty \else
@@ -258,6 +266,14 @@
\fastsetup{\s!btx:\s!list:\s!author:others}
\stopsetups
+\startsetups \s!btx:\s!list:\s!author:invertedfirst
+ \ifnum\currentbtxauthorindex>\plusone
+ \fastsetup{\s!btx:\s!list:\s!author:normal}
+ \else
+ \fastsetup{\s!btx:\s!list:\s!author:inverted}
+ \fi
+\stopsetups
+
\startsetups \s!btx:\s!list:\s!author:invertedshort
\fastsetup{\s!btx:\s!list:\s!author:concat}
\ifx\currentbtxvons\empty \else
diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-cite.mkvi b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-cite.mkvi
index 721985499b6..c9afdbf42dc 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/publ-imp-cite.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/publ-imp-cite.mkvi
@@ -85,7 +85,8 @@
\startsetups btx:cite:invalid
\btxcitereference
- {\tt <\currentbtxreference>}
+ % {\tt <\currentbtxreference>}
+ {\tt <\currentbtxmissingreference>}
\stopsetups
\startsetups btx:cite:concat
diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/publ-ini.lua
index ec36be89ad7..dac0ab441d0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/publ-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/publ-ini.lua
@@ -32,7 +32,7 @@ local sortedkeys, sortedhash = table.sortedkeys, table.sortedhash
local setmetatableindex = table.setmetatableindex
local lpegmatch = lpeg.match
local P, S, C, Ct, Cs, R, Carg = lpeg.P, lpeg.S, lpeg.C, lpeg.Ct, lpeg.Cs, lpeg.R, lpeg.Carg
-local upper = characters.upper
+local upper, lower = characters.upper, characters.lower
local report = logs.reporter("publications")
local report_cite = logs.reporter("publications","cite")
@@ -54,6 +54,8 @@ local detailed = publications.detailed
local enhancer = publications.enhancer
local enhancers = publications.enhancers
+if not publications.btx then publications.btx = { } end -- user space
+
local tracers = publications.tracers or { }
publications.tracers = tracers
@@ -691,6 +693,49 @@ local findallused do
end
}
+ implement {
+ name = "btxmissing",
+ arguments = "2 strings",
+ actions = function(dataset,tag)
+ local dataset = datasets[dataset]
+ if dataset then
+ local missing = dataset.missing
+ local message = missing[tag]
+ if message == nil then
+ local luadata = dataset.luadata
+ local entry = luadata[tag]
+ if not entry then
+ local t = lower(tag)
+ if luadata[t] then
+ message = t
+ else
+ t = upper(tag)
+ if luadata[t] then
+ message = t
+ else
+ for k, v in next, luadata do
+ if t == upper(k) then
+ message = k
+ break
+ end
+ end
+ end
+ end
+ end
+ if not message then
+ message = false
+ end
+ missing[tag] = message
+ end
+ if message then
+ context("%s vs %s",tag,message)
+ return
+ end
+ end
+ context(tag)
+ end
+ }
+
end
local function unknowncite(reference)
@@ -2166,18 +2211,18 @@ do
function lists.combiinlist(dataset,tag)
local rendering = renderings[dataset]
- local list = rendering.list
+ -- local list = rendering.list
local toindex = rendering.tagtolistindex
return toindex and toindex[tag]
end
function lists.flushcombi(dataset,tag)
local rendering = renderings[dataset]
- local list = rendering.list
local toindex = rendering.tagtolistindex
local listindex = toindex and toindex[tag]
if listindex then
- local li = list[listindex]
+ local list = rendering.list
+ local li = list[listindex]
if li then
local data = datasets[dataset]
local luadata = data.luadata
@@ -2406,6 +2451,10 @@ do
s = k
break
end
+ -- weird
+ if type(s) == "table" then
+ return citevariants.default
+ end
end
if s then
s = specifications[s]
@@ -2650,6 +2699,8 @@ do
-- a bit redundant access to datasets
+ local creported = setmetatableindex("table")
+
local function processcite(presets,specification)
--
if specification then
@@ -2676,9 +2727,15 @@ do
--
if not found or #found == 0 then
-- if not list or #list == 0 then
- report("no entry %a found in dataset %a",reference,dataset)
+ if not creported[dataset][reference] then
+ report("no entry %a found in dataset %a",reference,dataset)
+ creported[dataset][reference] = true
+ end
elseif not setup then
- report("invalid reference for %a",reference)
+ if not creported[""][reference] then
+ report("invalid reference for %a",reference)
+ creported[""][reference] = true
+ end
else
if trace_cite then
report("processing reference %a",reference)
@@ -3505,3 +3562,34 @@ do
end
end
+
+do
+
+ -- no caching for now
+
+ interfaces.implement { -- shared with mkiv so no public
+ name = "btxdoifelsecitedone",
+ protected = true,
+ -- public = true,
+ -- arguments = "2 arguments",
+ arguments = "2 strings",
+ actions = function(dataset,tag)
+ -- dataset ignored
+ local list = structures.lists.tobesaved
+ local done = false
+ for i=1,#list do
+ local l = list[i]
+ local m = l.metadata
+ if m and m.kind == "btx" then
+ local u = l.userdata
+ if u and u.btxref == tag then
+ done = true
+ break
+ end
+ end
+ end
+ ctx_doifelse(done)
+ end
+ }
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/publ-ini.mkiv
index dfed53c7374..6e34d3ab5e5 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/publ-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/publ-ini.mkiv
@@ -799,9 +799,13 @@
\unexpanded\def\btxdoifelsecombiinlist#1#2%
{\clf_btxdoifelsecombiinlist{#1}{#2}}
+\unexpanded\def\btxdoifelsecitedone#1#2%
+ {\clf_btxdoifelsecitedone{#1}{#2}}
+
\let\btxdoifsameaspreviouscheckedelse\btxdoifelsesameaspreviouschecked
\let\btxdoifsameaspreviouselse \btxdoifelsesameasprevious
\let\btxdoifcombiinlistelse \btxdoifelsecombiinlist
+\let\btxdoifcitedoneelse \btxdoifelsecitedone
\def\publ_place_list_indeed#1#2[#3][#4]%
{\begingroup
diff --git a/Master/texmf-dist/tex/context/base/mkiv/publ-sor.lua b/Master/texmf-dist/tex/context/base/mkiv/publ-sor.lua
index 30a0d9bddf8..ed944ed9d9e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/publ-sor.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/publ-sor.lua
@@ -370,9 +370,17 @@ table.setmetatableindex(sorters,function(t,k) return anything end)
publications.lists.sorters = sorters
--- publications.sortmethods.key = {
--- sequence = {
--- { field = "key", default = "", unknown = "" },
--- { field = "index", default = "", unknown = "" },
--- },
--- }
+publications.sortmethods.key = {
+ sequence = {
+ { field = "key", default = "", unknown = "" },
+ { field = "index", default = 0, unknown = 0 },
+ },
+}
+
+publications.sortmethods.index = {
+ sequence = {
+ { field = "index", default = 0, unknown = 0 },
+ },
+}
+
+publications.sortmethods.dataset = publications.sortmethods.index
diff --git a/Master/texmf-dist/tex/context/base/mkiv/regi-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/regi-ini.lua
index 8d4f2bfd5a1..2a3b2caafa5 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/regi-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/regi-ini.lua
@@ -16,7 +16,6 @@ runtime.</p>
local commands, context = commands, context
-
local tostring = tostring
local utfchar = utf.char
local P, Cs, Cc, lpegmatch = lpeg.P, lpeg.Cs, lpeg.Cc, lpeg.match
diff --git a/Master/texmf-dist/tex/context/base/mkiv/scrn-hlp.lua b/Master/texmf-dist/tex/context/base/mkiv/scrn-hlp.lua
index 8f6f6f746db..a11ad48d285 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/scrn-hlp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/scrn-hlp.lua
@@ -18,8 +18,8 @@ local formatters = string.formatters
local a_help = attributes.private("help")
-local copy_node_list = node.copy_list
-local hpack_node_list = node.hpack
+local copy_node_list = nodes.copylist
+local hpack_node_list = nodes.hpack
local register_list = nodes.pool.register
diff --git a/Master/texmf-dist/tex/context/base/mkiv/scrn-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/scrn-ini.lua
index ce9f9f71b06..9c9a9f1b487 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/scrn-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/scrn-ini.lua
@@ -33,7 +33,7 @@ interfaces.implement {
arguments = {
{
{ "title" },
- { "subtitle" },
+ { "subtitle"},
{ "author" },
{ "creator" },
{ "date" },
@@ -41,3 +41,11 @@ interfaces.implement {
}
}
}
+
+interfaces.implement {
+ name = "setautoprefix",
+ actions = function(prefix)
+ backends.codeinjections.setautoprefix(prefix)
+ end,
+ arguments = "string",
+}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/scrn-ini.mkvi b/Master/texmf-dist/tex/context/base/mkiv/scrn-ini.mkvi
index 39fef740c24..4651956a564 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/scrn-ini.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/scrn-ini.mkvi
@@ -251,4 +251,8 @@
\c!keyword=,
\c!date=]
+\appendtoks
+ \clf_setautoprefix{\interactionparameter\c!prefix}%
+\to \everysetupinteraction
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/scrn-wid.lua b/Master/texmf-dist/tex/context/base/mkiv/scrn-wid.lua
index 17c9ebddc4a..e92be778f1e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/scrn-wid.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/scrn-wid.lua
@@ -231,13 +231,15 @@ function soundclips.register(specification)
end
end
-function soundclips.insert(tag)
- local sc = soundclips[tag]
- if not sc then
- -- todo: message
- return soundclips.register { tag = tag }
- else
- return sc
+function soundclips.insert(specification)
+ local tag = specification.tag
+ if tag and tag ~= "" then
+ local sc = soundclips[tag]
+ if not sc then
+ -- todo: message
+ sc = soundclips.register { tag = tag }
+ end
+ nodeinjections.insertsound(sc)
end
end
@@ -298,7 +300,6 @@ implement {
actions = renderings.register,
arguments = {
{
- { "type" },
{ "label" },
{ "mime" },
{ "filename" },
@@ -321,6 +322,8 @@ implement {
{ "height", "dimen" },
{ "option" },
{ "page", "integer" },
+ { "openpage" },
+ { "closepage" },
}
}
}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/scrn-wid.mkvi b/Master/texmf-dist/tex/context/base/mkiv/scrn-wid.mkvi
index d0b0fb006a2..d9f7940cd8f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/scrn-wid.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/scrn-wid.mkvi
@@ -665,6 +665,7 @@
\letrenderingwindowparameter\c!closepageaction\empty
\setrenderingwindowparameter\c!width {\d_scrn_rendering_width }%
\setrenderingwindowparameter\c!height {\d_scrn_rendering_height}%
+ \letrenderingwindowparameter\c!align \v!flushleft
\to \everypresetrenderingwindow
\unexpanded\def\placerenderingwindow
diff --git a/Master/texmf-dist/tex/context/base/mkiv/scrp-cjk.lua b/Master/texmf-dist/tex/context/base/mkiv/scrp-cjk.lua
index 9e6e24f4d02..0667e8031f0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/scrp-cjk.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/scrp-cjk.lua
@@ -17,59 +17,60 @@ if not modules then modules = { } end modules ['scrp-cjk'] = {
-- endofline turned into spaces (would not make sense either because otherwise a
-- wanted space at the end of a line would have to be a hard coded ones.
-local nuts = nodes.nuts
+local nuts = nodes.nuts
-local insert_node_after = nuts.insert_after
-local insert_node_before = nuts.insert_before
-local copy_node = nuts.copy
-local remove_node = nuts.remove
-local nextglyph = nuts.traversers.glyph
+local copy_node = nuts.copy
+local remove_node = nuts.remove
+local nextglyph = nuts.traversers.glyph
-local getnext = nuts.getnext
-local getprev = nuts.getprev
-local getfont = nuts.getfont
-local getchar = nuts.getchar
-local getid = nuts.getid
-local getsubtype = nuts.getsubtype
-local getwidth = nuts.getwidth
+local getnext = nuts.getnext
+local getprev = nuts.getprev
+local getfont = nuts.getfont
+local getchar = nuts.getchar
+local getid = nuts.getid
+local getsubtype = nuts.getsubtype
+local getwidth = nuts.getwidth
-local setchar = nuts.setchar
+local setchar = nuts.setchar
-local nodepool = nuts.pool
-local new_glue = nodepool.glue
-local new_kern = nodepool.kern
-local new_penalty = nodepool.penalty
+local nodepool = nuts.pool
+local new_glue = nodepool.glue
+local new_kern = nodepool.kern
+local new_penalty = nodepool.penalty
-local nodecodes = nodes.nodecodes
-local gluecodes = nodes.gluecodes
+local nodecodes = nodes.nodecodes
+local gluecodes = nodes.gluecodes
-local glyph_code = nodecodes.glyph
-local glue_code = nodecodes.glue
+local glyph_code = nodecodes.glyph
+local glue_code = nodecodes.glue
-local userskip_code = gluecodes.userskip
-local spaceskip_code = gluecodes.spaceskip
-local xspaceskip_code = gluecodes.xspaceskip
+local userskip_code = gluecodes.userskip
+local spaceskip_code = gluecodes.spaceskip
+local xspaceskip_code = gluecodes.xspaceskip
-local hash = scripts.hash
+local hash = characters.scripthash
-local getscriptstatus = scripts.getstatus
-local getscriptdata = scripts.getdata
-local scriptcolors = scripts.colors
+local getscriptstatus = scripts.getstatus
+local getscriptdata = scripts.getdata
+local scriptcolors = scripts.colors
-local fonthashes = fonts.hashes
-local quaddata = fonthashes.quads
-local spacedata = fonthashes.spaces
+local fonthashes = fonts.hashes
+local quaddata = fonthashes.quads
+local spacedata = fonthashes.spaces
-local decomposed = characters.hangul.decomposed
+local decomposed = characters.hangul.decomposed
-local trace_details = false trackers.register("scripts.details", function(v) trace_details = v end)
+local trace_details = false trackers.register("scripts.details", function(v) trace_details = v end)
-local report_details = logs.reporter("scripts","detail")
+local report_details = logs.reporter("scripts","detail")
-- raggedleft is controlled by leftskip and we might end up with a situation where
-- the intercharacter spacing interferes with this; the solution is to patch the
-- nodelist but better is to use veryraggedleft
+local insertnodeafter = scripts.helpers.insertnodeafter
+local insertnodebefore = scripts.helpers.insertnodebefore
+
local inter_char_shrink = 0
local inter_char_stretch = 0
local inter_char_half_shrink = 0
@@ -133,206 +134,206 @@ local function nobreak(head,current)
if trace_details then
trace_detail(current,"break")
end
- insert_node_before(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_penalty(10000))
end
local function stretch_break(head,current)
if trace_details then
trace_detail(current,"stretch break")
end
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
end
local function shrink_break(head,current)
if trace_details then
trace_detail(current,"shrink break")
end
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
end
local function nobreak_stretch(head,current)
if trace_details then
trace_detail(current,"no break stretch")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
end
local function korean_break(head,current)
if trace_details then
trace_detail(current,"korean break")
end
- insert_node_before(head,current,new_penalty(inter_char_hangul_penalty))
+ insertnodebefore(head,current,new_penalty(inter_char_hangul_penalty))
end
local function nobreak_shrink(head,current)
if trace_details then
trace_detail(current,"nobreak shrink")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
end
local function nobreak_autoshrink(head,current)
if trace_details then
trace_detail(current,"nobreak autoshrink")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
end
local function nobreak_stretch_nobreak_shrink(head,current)
if trace_details then
trace_detail(current,"nobreak stretch nobreak shrink")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
end
local function nobreak_stretch_nobreak_autoshrink(head,current)
if trace_details then
trace_detail(current,"nobreak stretch nobreak autoshrink")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
end
local function nobreak_shrink_nobreak_stretch(head,current)
if trace_details then
trace_detail(current,"nobreak shrink nobreak stretch")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
end
local function nobreak_autoshrink_nobreak_stretch(head,current)
if trace_details then
trace_detail(current,"nobreak autoshrink nobreak stretch")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
end
local function nobreak_shrink_break_stretch(head,current)
if trace_details then
trace_detail(current,"nobreak shrink break stretch")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
end
local function nobreak_autoshrink_break_stretch(head,current)
if trace_details then
trace_detail(current,"nobreak autoshrink break stretch")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
end
local function nobreak_shrink_break_stretch_nobreak_shrink(head,current)
if trace_details then
trace_detail(current,"nobreak shrink break stretch nobreak shrink")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
end
local function japanese_between_full_close_open(head,current) -- todo: check width
if trace_details then
trace_detail(current,"japanese between full close open")
end
- insert_node_before(head,current,new_kern(-half_char_width))
- insert_node_before(head,current,new_glue(half_char_width,0,inter_char_half_shrink))
- insert_node_before(head,current,new_kern(-half_char_width))
+ insertnodebefore(head,current,new_kern(-half_char_width))
+ insertnodebefore(head,current,new_glue(half_char_width,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_kern(-half_char_width))
end
local function japanese_between_full_close_full_close(head,current) -- todo: check width
if trace_details then
trace_detail(current,"japanese between full close full close")
end
- insert_node_before(head,current,new_kern(-half_char_width))
- -- insert_node_before(head,current,new_glue(half_char_width,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_kern(-half_char_width))
+ -- insertnodebefore(head,current,new_glue(half_char_width,0,inter_char_half_shrink))
end
local function japanese_before_full_width_punct(head,current) -- todo: check width
if trace_details then
trace_detail(current,"japanese before full width punct")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(quarter_char_width,0,inter_char_quarter_shrink))
- insert_node_before(head,current,new_kern(-quarter_char_width))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(quarter_char_width,0,inter_char_quarter_shrink))
+ insertnodebefore(head,current,new_kern(-quarter_char_width))
end
local function japanese_after_full_width_punct(head,current) -- todo: check width
if trace_details then
trace_detail(current,"japanese after full width punct")
end
- insert_node_before(head,current,new_kern(-quarter_char_width))
- insert_node_before(head,current,new_glue(quarter_char_width,0,inter_char_quarter_shrink))
+ insertnodebefore(head,current,new_kern(-quarter_char_width))
+ insertnodebefore(head,current,new_glue(quarter_char_width,0,inter_char_quarter_shrink))
end
local function nobreak_autoshrink_break_stretch_nobreak_autoshrink(head,current)
if trace_details then
trace_detail(current,"nobreak autoshrink break stretch nobreak autoshrink")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
end
local function nobreak_autoshrink_break_stretch_nobreak_shrink(head,current)
if trace_details then
trace_detail(current,"nobreak autoshrink break stretch nobreak shrink")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
end
local function nobreak_shrink_break_stretch_nobreak_autoshrink(head,current)
if trace_details then
trace_detail(current,"nobreak shrink break stretch nobreak autoshrink")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
end
local function nobreak_stretch_break_shrink(head,current)
if trace_details then
trace_detail(current,"nobreak stretch break shrink")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
end
local function nobreak_stretch_break_autoshrink(head,current)
if trace_details then
trace_detail(current,"nobreak stretch break autoshrink")
end
- insert_node_before(head,current,new_penalty(10000))
- insert_node_before(head,current,new_glue(0,inter_char_stretch,0))
- insert_node_before(head,current,new_glue(0,0,inter_char_half_shrink))
+ insertnodebefore(head,current,new_penalty(10000))
+ insertnodebefore(head,current,new_glue(0,inter_char_stretch,0))
+ insertnodebefore(head,current,new_glue(0,0,inter_char_half_shrink))
end
-- Korean: hangul
@@ -514,7 +515,7 @@ end
scripts.installmethod {
name = "hangul",
injector = process,
- datasets = { -- todo: metatables
+ datasets = { -- todo: metatables and maybe some stretch and shrink factor
default = {
inter_char_shrink_factor = 0.50, -- of quad
inter_char_stretch_factor = 0.50, -- of quad
@@ -524,6 +525,15 @@ scripts.installmethod {
inter_char_quarter_stretch_factor = 0.50, -- of quad
inter_char_hangul_penalty = 50,
},
+ tight = {
+ inter_char_shrink_factor = 0.10, -- of quad
+ inter_char_stretch_factor = 0.10, -- of quad
+ inter_char_half_shrink_factor = 0.10, -- of quad
+ inter_char_half_stretch_factor = 0.10, -- of quad
+ inter_char_quarter_shrink_factor = 0.10, -- of quad
+ inter_char_quarter_stretch_factor = 0.10, -- of quad
+ inter_char_hangul_penalty = 50,
+ },
},
}
@@ -535,11 +545,11 @@ function scripts.decomposehangul(head)
setchar(current,lead_consonant)
local m = copy_node(current)
setchar(m,medial_vowel)
- head, current = insert_node_after(head,current,m)
+ head, current = insertnodeafter(head,current,m)
if tail_consonant then
local t = copy_node(current)
setchar(t,tail_consonant)
- head, current = insert_node_after(head,current,t)
+ head, current = insertnodeafter(head,current,t)
end
done = true
end
@@ -685,6 +695,7 @@ local chinese_8 = {
hiragana = stretch_break, -- nobreak_autoshrink_break_stretch,
katakana = stretch_break, -- nobreak_autoshrink_break_stretch,
half_width_open = nobreak_autoshrink_break_stretch_nobreak_autoshrink,
+half_width_open = stretch_break,
half_width_close = nobreak_autoshrink_nobreak_stretch,
full_width_open = nobreak_autoshrink_break_stretch_nobreak_shrink,
full_width_close = nobreak_autoshrink_nobreak_stretch,
@@ -961,7 +972,7 @@ local function process(head,first,last)
end
previous = current
-- elseif id == math_code then
- -- upcoming = getnext(end_of_math(current))
+ -- upcoming = getnext(endofmath(current))
-- previous = "start"
else -- glue
local p = getprev(first)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/scrp-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/scrp-ini.lua
index ab6fca4dbef..60282ae1106 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/scrp-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/scrp-ini.lua
@@ -23,68 +23,65 @@ local report_preprocessing = logs.reporter("scripts","preprocessing")
local report_splitting = logs.reporter("scripts","splitting")
-local attributes = attributes
-local nodes = nodes
-local context = context
+local attributes = attributes
+local nodes = nodes
+local context = context
-local nodecodes = nodes.nodecodes
+local nodecodes = nodes.nodecodes
-local implement = interfaces.implement
+local implement = interfaces.implement
-local glyph_code = nodecodes.glyph
-local glue_code = nodecodes.glue
+local glyph_code = nodecodes.glyph
+local glue_code = nodecodes.glue
-local emwidths = fonts.hashes.emwidths
-local exheights = fonts.hashes.exheights
+local emwidths = fonts.hashes.emwidths
+local exheights = fonts.hashes.exheights
-local a_script = attributes.private('script')
+local a_script = attributes.private('script')
-local fontdata = fonts.hashes.identifiers
-local allocate = utilities.storage.allocate
-local setnodecolor = nodes.tracers.colors.set
+local fontdata = fonts.hashes.identifiers
+local allocate = utilities.storage.allocate
+local setnodecolor = nodes.tracers.colors.set
-local enableaction = nodes.tasks.enableaction
-local disableaction = nodes.tasks.disableaction
+local enableaction = nodes.tasks.enableaction
+local disableaction = nodes.tasks.disableaction
-local nuts = nodes.nuts
+local nuts = nodes.nuts
-local getnext = nuts.getnext
-local getchar = nuts.getchar
-local getfont = nuts.getfont
-local getid = nuts.getid
-local getglyphdata = nuts.getglyphdata
-local setglyphdata = nuts.setglyphdata
+local getnext = nuts.getnext
+local getchar = nuts.getchar
+local getfont = nuts.getfont
+local getid = nuts.getid
+local getglyphdata = nuts.getglyphdata
+local setglyphdata = nuts.setglyphdata
-local isglyph = nuts.isglyph
+local isglyph = nuts.isglyph
-local insert_node_after = nuts.insert_after
-local insert_node_before = nuts.insert_before
+local firstglyph = nuts.firstglyph
-local first_glyph = nuts.first_glyph
+local nextglyph = nuts.traversers.glyph
+local nextchar = nuts.traversers.char
-local nextglyph = nuts.traversers.glyph
-local nextchar = nuts.traversers.char
+local nodepool = nuts.pool
-local nodepool = nuts.pool
+local new_glue = nodepool.glue
+local new_rule = nodepool.rule
+local new_penalty = nodepool.penalty
-local new_glue = nodepool.glue
-local new_rule = nodepool.rule
-local new_penalty = nodepool.penalty
+scripts = scripts or { }
+local scripts = scripts
-scripts = scripts or { }
-local scripts = scripts
+local handlers = allocate()
+scripts.handlers = handlers
-scripts.hash = scripts.hash or { }
-local hash = scripts.hash
+local injectors = allocate()
+scripts.injectors = handlers
-local handlers = allocate()
-scripts.handlers = handlers
+local splitters = allocate()
+scripts.splitters = splitters
-local injectors = allocate()
-scripts.injectors = handlers
-
-local splitters = allocate()
-scripts.splitters = splitters
+local helpers = allocate()
+scripts.helpers = helpers
-- we need to fake it in luatex
@@ -116,165 +113,34 @@ if not getscript then
end
-local hash = { -- we could put these presets in char-def.lua
- --
- -- half width opening parenthesis
- --
- [0x0028] = "half_width_open",
- [0x005B] = "half_width_open",
- [0x007B] = "half_width_open",
- [0x2018] = "half_width_open", -- ‘
- [0x201C] = "half_width_open", -- “
- --
- -- full width opening parenthesis
- --
- [0x3008] = "full_width_open", -- 〈 Left book quote
- [0x300A] = "full_width_open", -- 《 Left double book quote
- [0x300C] = "full_width_open", -- 「 left quote
- [0x300E] = "full_width_open", -- 『 left double quote
- [0x3010] = "full_width_open", -- 〠left double book quote
- [0x3014] = "full_width_open", -- 〔 left book quote
- [0x3016] = "full_width_open", --〖 left double book quote
- [0x3018] = "full_width_open", -- left tortoise bracket
- [0x301A] = "full_width_open", -- left square bracket
- [0x301D] = "full_width_open", -- reverse double prime qm
- [0xFF08] = "full_width_open", -- ( left parenthesis
- [0xFF3B] = "full_width_open", -- ï¼» left square brackets
- [0xFF5B] = "full_width_open", -- ï½› left curve bracket
- --
- -- half width closing parenthesis
- --
- [0x0029] = "half_width_close",
- [0x005D] = "half_width_close",
- [0x007D] = "half_width_close",
- [0x2019] = "half_width_close", -- ’ right quote, right
- [0x201D] = "half_width_close", -- †right double quote
- --
- -- full width closing parenthesis
- --
- [0x3009] = "full_width_close", -- 〉 book quote
- [0x300B] = "full_width_close", -- 》 double book quote
- [0x300D] = "full_width_close", -- 〠right quote, right
- [0x300F] = "full_width_close", -- 〠right double quote
- [0x3011] = "full_width_close", -- 】 right double book quote
- [0x3015] = "full_width_close", -- 〕 right book quote
- [0x3017] = "full_width_close", -- 〗 right double book quote
- [0x3019] = "full_width_close", -- right tortoise bracket
- [0x301B] = "full_width_close", -- right square bracket
- [0x301E] = "full_width_close", -- double prime qm
- [0x301F] = "full_width_close", -- low double prime qm
- [0xFF09] = "full_width_close", -- ) right parenthesis
- [0xFF3D] = "full_width_close", -- ï¼½ right square brackets
- [0xFF5D] = "full_width_close", -- ï½ right curve brackets
- --
- [0xFF62] = "half_width_open", -- left corner bracket
- [0xFF63] = "half_width_close", -- right corner bracket
- --
- -- vertical opening vertical
- --
- -- 0xFE35, 0xFE37, 0xFE39, 0xFE3B, 0xFE3D, 0xFE3F, 0xFE41, 0xFE43, 0xFE47,
- --
- -- vertical closing
- --
- -- 0xFE36, 0xFE38, 0xFE3A, 0xFE3C, 0xFE3E, 0xFE40, 0xFE42, 0xFE44, 0xFE48,
- --
- -- half width opening punctuation
- --
- -- <empty>
- --
- -- full width opening punctuation
- --
- -- 0x2236, -- ∶
- -- 0xFF0C, -- ,
- --
- -- half width closing punctuation_hw
- --
- [0x0021] = "half_width_close", -- !
- [0x002C] = "half_width_close", -- ,
- [0x002E] = "half_width_close", -- .
- [0x003A] = "half_width_close", -- :
- [0x003B] = "half_width_close", -- ;
- [0x003F] = "half_width_close", -- ?
- [0xFF61] = "half_width_close", -- hw full stop
- --
- -- full width closing punctuation
- --
- [0x3001] = "full_width_close", -- ã€
- [0x3002] = "full_width_close", -- 。
- [0xFF0C] = "full_width_close", -- ,
- [0xFF0E] = "full_width_close", --
- --
- -- depends on font
- --
- [0xFF01] = "full_width_close", -- ï¼
- [0xFF1F] = "full_width_close", -- ?
- --
- [0xFF1A] = "full_width_punct", -- :
- [0xFF1B] = "full_width_punct", -- ï¼›
- --
- -- non starter
- --
- [0x3005] = "non_starter", [0x3041] = "non_starter", [0x3043] = "non_starter", [0x3045] = "non_starter", [0x3047] = "non_starter",
- [0x3049] = "non_starter", [0x3063] = "non_starter", [0x3083] = "non_starter", [0x3085] = "non_starter", [0x3087] = "non_starter",
- [0x308E] = "non_starter", [0x3095] = "non_starter", [0x3096] = "non_starter", [0x309B] = "non_starter", [0x309C] = "non_starter",
- [0x309D] = "non_starter", [0x309E] = "non_starter", [0x30A0] = "non_starter", [0x30A1] = "non_starter", [0x30A3] = "non_starter",
- [0x30A5] = "non_starter", [0x30A7] = "non_starter", [0x30A9] = "non_starter", [0x30C3] = "non_starter", [0x30E3] = "non_starter",
- [0x30E5] = "non_starter", [0x30E7] = "non_starter", [0x30EE] = "non_starter", [0x30F5] = "non_starter", [0x30F6] = "non_starter",
- [0x30FC] = "non_starter", [0x30FD] = "non_starter", [0x30FE] = "non_starter", [0x31F0] = "non_starter", [0x31F1] = "non_starter",
- [0x31F2] = "non_starter", [0x31F3] = "non_starter", [0x31F4] = "non_starter", [0x31F5] = "non_starter", [0x31F6] = "non_starter",
- [0x31F7] = "non_starter", [0x31F8] = "non_starter", [0x31F9] = "non_starter", [0x31FA] = "non_starter", [0x31FB] = "non_starter",
- [0x31FC] = "non_starter", [0x31FD] = "non_starter", [0x31FE] = "non_starter", [0x31FF] = "non_starter",
- --
- [0x301C] = "non_starter", [0x303B] = "non_starter", [0x303C] = "non_starter", [0x309B] = "non_starter", [0x30FB] = "non_starter",
- [0x30FE] = "non_starter",
- -- hyphenation
- --
- [0x2026] = "hyphen", -- … ellipsis
- [0x2014] = "hyphen", -- — hyphen
- --
- [0x1361] = "ethiopic_word",
- [0x1362] = "ethiopic_sentence",
- --
- -- tibetan:
- --
- [0x0F0B] = "breaking_tsheg",
- [0x0F0C] = "nonbreaking_tsheg",
+local insertnodebefore, insertnodeafter do
-}
+ local insertafter = nuts.insertafter
+ local insertbefore = nuts.insertbefore
+ local setattributelist = nuts.setattributelist
-local function provide(t,k)
- local v
- if not tonumber(k) then v = false
- elseif (k >= 0x03040 and k <= 0x030FF)
- or (k >= 0x031F0 and k <= 0x031FF)
- or (k >= 0x032D0 and k <= 0x032FE)
- or (k >= 0x0FF00 and k <= 0x0FFEF) then v = "katakana"
- elseif (k >= 0x03400 and k <= 0x04DFF)
- or (k >= 0x04E00 and k <= 0x09FFF)
- or (k >= 0x0F900 and k <= 0x0FAFF)
- or (k >= 0x20000 and k <= 0x2A6DF)
- or (k >= 0x2F800 and k <= 0x2FA1F) then v = "chinese"
- elseif (k >= 0x0AC00 and k <= 0x0D7A3) then v = "korean"
- elseif (k >= 0x01100 and k <= 0x0115F) then v = "jamo_initial"
- elseif (k >= 0x01160 and k <= 0x011A7) then v = "jamo_medial"
- elseif (k >= 0x011A8 and k <= 0x011FF) then v = "jamo_final"
- elseif (k >= 0x01200 and k <= 0x0139F) then v = "ethiopic_syllable"
- elseif (k >= 0x00F00 and k <= 0x00FFF) then v = "tibetan"
- else v = false
+ insertnodebefore = function (head,current,what)
+ head, current = insertbefore(head,current,what)
+ setattributelist(what,current)
+ return head, current
end
- t[k] = v
- return v
-end
-setmetatableindex(hash,provide) -- should come from char-def
+ insertnodeafter = function(head,current,what)
+ head, current = insertafter(head,current,what)
+ setattributelist(what,current)
+ return head, current
+ end
+
+ helpers.insertnodebefore = insertnodebefore
+ helpers.insertnodeafter = insertnodeafter
+
+end
-scripts.hash = hash
+local hash = characters.scripthash
local numbertodataset = allocate()
local numbertohandler = allocate()
---~ storage.register("scripts/hash", hash, "scripts.hash")
-
scripts.numbertodataset = numbertodataset
scripts.numbertohandler = numbertohandler
@@ -511,7 +377,7 @@ local function traced_process(head,first,last,process,a)
end
function scripts.injectors.handler(head)
- local start = first_glyph(head) -- we already have glyphs here (subtype 1)
+ local start = firstglyph(head) -- we already have glyphs here (subtype 1)
if not start then
return head
else
@@ -791,7 +657,7 @@ end
local tree, attr, proc
-function splitters.handler(head) -- todo: also first_glyph test
+function splitters.handler(head) -- todo: also firstglyph test
local current = head
while current do
if getid(current) == glyph_code then
@@ -848,9 +714,9 @@ end
local function marker(head,current,font,color) -- could become: nodes.tracers.marker
local ex = exheights[font]
local em = emwidths [font]
- head, current = insert_node_after(head,current,new_penalty(10000))
- head, current = insert_node_after(head,current,new_glue(-0.05*em))
- head, current = insert_node_after(head,current,new_rule(0.05*em,1.5*ex,0.5*ex))
+ head, current = insertnodeafter(head,current,new_penalty(10000))
+ head, current = insertnodeafter(head,current,new_glue(-0.05*em))
+ head, current = insertnodeafter(head,current,new_rule(0.05*em,1.5*ex,0.5*ex))
setnodecolor(current,color)
return head, current
end
@@ -871,7 +737,7 @@ function splitters.insertafter(handler,head,first,last,detail)
if ignore then
return head, last
else
- return insert_node_after(head,last,new_glue(0,last_s))
+ return insertnodeafter(head,last,new_glue(0,last_s))
end
end
@@ -1046,30 +912,30 @@ do
scripts.inserters = {
space_before = function(head,current)
- return insert_node_before(head,current,space_glue(current))
+ return insertnodebefore(head,current,space_glue(current))
end,
space_after = function(head,current)
- return insert_node_after(head,current,space_glue(current))
+ return insertnodeafter(head,current,space_glue(current))
end,
zerowidthspace_before = function(head,current)
- return insert_node_before(head,current,new_glue(0))
+ return insertnodebefore(head,current,new_glue(0))
end,
zerowidthspace_after = function(head,current)
- return insert_node_after(head,current,new_glue(0))
+ return insertnodeafter(head,current,new_glue(0))
end,
nobreakspace_before = function(head,current)
local g = space_glue(current)
local p = new_penalty(10000)
- head, current = insert_node_before(head,current,p)
- return insert_node_before(head,current,g)
+ head, current = insertnodebefore(head,current,p)
+ return insertnodebefore(head,current,g)
end,
nobreakspace_after = function(head,current)
local g = space_glue(current)
local p = new_penalty(10000)
- head, current = insert_node_after(head,current,g)
- return insert_node_after(head,current,p)
+ head, current = insertnodeafter(head,current,g)
+ return insertnodeafter(head,current,p)
end,
}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/scrp-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/scrp-ini.mkiv
index 4eb3f29e373..f677eceef6c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/scrp-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/scrp-ini.mkiv
@@ -61,6 +61,8 @@
% \setuevalue\currentscript{\setscript[\currentscript]}%
% \to \everydefinescript
+% \ctxlua{inspect(scripts.handlers.hangul.datasets)}
+
\unexpanded\def\scripts_basics_set
{\clf_setscript{\currentscript}{\scriptparameter\c!method}{\scriptparameter\c!preset}}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/spac-ali.lua b/Master/texmf-dist/tex/context/base/mkiv/spac-ali.lua
index 2e2650f3b7a..448b0162b93 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/spac-ali.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/spac-ali.lua
@@ -68,7 +68,7 @@ local nofrealigned = 0
-- raggedright 0 0 fil
-- raggedcenter 0 + 0 + -
-local function handler(head,leftpage,realpageno) -- traverse_list
+local function handler(head,leftpage,realpageno) -- traverselist
local current = head
while current do
local id = getid(current)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/spac-ali.mkiv b/Master/texmf-dist/tex/context/base/mkiv/spac-ali.mkiv
index 2467f83525b..a54c44b72f8 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/spac-ali.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/spac-ali.mkiv
@@ -184,6 +184,9 @@
\unexpanded\def\leftorrightvbox{\ifconditional\displaylefttoright\expandafter\lefttorightvbox\else\expandafter\righttoleftvbox\fi}
\unexpanded\def\leftorrightvtop{\ifconditional\displaylefttoright\expandafter\lefttorightvtop\else\expandafter\righttoleftvtop\fi}
+\unexpanded\def\rtltext{\groupedcommand{\dontleavehmode\righttoleft\ignorespaces}\removeunwantedspaces}
+\unexpanded\def\ltrtext{\groupedcommand{\dontleavehmode\lefttoright\ignorespaces}\removeunwantedspaces}
+
% Tolerance and hyphenation
\ifdefined\lesshyphens \else \let\lesshyphens\relax \fi
diff --git a/Master/texmf-dist/tex/context/base/mkiv/spac-chr.lua b/Master/texmf-dist/tex/context/base/mkiv/spac-chr.lua
index fa6eb18a576..5bc8ae8f617 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/spac-chr.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/spac-chr.lua
@@ -28,7 +28,10 @@ local nodes, node = nodes, node
local nuts = nodes.nuts
+local getid = nuts.getid
local getboth = nuts.getboth
+local getsubtype = nuts.getsubtype
+local setsubtype = nuts.setsubtype
local getnext = nuts.getnext
local getprev = nuts.getprev
local getattr = nuts.getattr
@@ -37,16 +40,13 @@ local getlanguage = nuts.getlanguage
local setchar = nuts.setchar
local setattrlist = nuts.setattrlist
local getfont = nuts.getfont
-local setsubtype = nuts.setsubtype
local isglyph = nuts.isglyph
local setcolor = nodes.tracers.colors.set
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local remove_node = nuts.remove
------ traverse_id = nuts.traverse_id
------ traverse_char = nuts.traverse_char
local nextchar = nuts.traversers.char
local nextglyph = nuts.traversers.glyph
@@ -62,10 +62,12 @@ local nodecodes = nodes.nodecodes
local gluecodes = nodes.gluecodes
local glyph_code = nodecodes.glyph
+local glue_code = nodecodes.glue
local spaceskip_code = gluecodes.spaceskip
local chardata = characters.data
-local is_punctuation = characters.is_punctuation
+local ispunctuation = characters.is_punctuation
+local canhavespace = characters.can_have_space
local typesetters = typesetters
@@ -95,7 +97,7 @@ local function inject_quad_space(unicode,head,current,fraction)
setattrlist(glue,current)
setattrlist(current) -- why reset all
setattr(glue,a_character,unicode)
- return insert_node_after(head,current,glue)
+ return insertnodeafter(head,current,glue)
end
local function inject_char_space(unicode,head,current,parent)
@@ -105,7 +107,7 @@ local function inject_char_space(unicode,head,current,parent)
setattrlist(glue,current)
setattrlist(current) -- why reset all
setattr(glue,a_character,unicode)
- return insert_node_after(head,current,glue)
+ return insertnodeafter(head,current,glue)
end
local function inject_nobreak_space(unicode,head,current,space,spacestretch,spaceshrink)
@@ -114,23 +116,23 @@ local function inject_nobreak_space(unicode,head,current,space,spacestretch,spac
setattrlist(glue,current)
setattrlist(current) -- why reset all
setattr(glue,a_character,unicode) -- bombs
- head, current = insert_node_after(head,current,penalty)
+ head, current = insertnodeafter(head,current,penalty)
if trace_nbsp then
local rule = new_rule(space)
local kern = new_kern(-space)
local penalty = new_penalty(10000)
setcolor(rule,"orange")
- head, current = insert_node_after(head,current,rule)
- head, current = insert_node_after(head,current,kern)
- head, current = insert_node_after(head,current,penalty)
+ head, current = insertnodeafter(head,current,rule)
+ head, current = insertnodeafter(head,current,kern)
+ head, current = insertnodeafter(head,current,penalty)
end
- return insert_node_after(head,current,glue)
+ return insertnodeafter(head,current,glue)
end
local function nbsp(head,current)
local para = fontparameters[getfont(current)]
local attr = getattr(current,a_alignstate) or 0
- if attr >= 1 or attr <= 3 then -- flushright
+ if attr >= 1 and attr <= 3 then -- flushright
head, current = inject_nobreak_space(0x00A0,head,current,para.space,0,0)
else
head, current = inject_nobreak_space(0x00A0,head,current,para.space,para.spacestretch,para.spaceshrink)
@@ -148,7 +150,7 @@ end
function characters.replacenbspaces(head)
local wipe = false
- for current, char, font in nextglyph, head do -- can be anytime so no traverse_char
+ for current, char, font in nextglyph, head do -- can be anytime so no traversechar
if char == 0x00A0 then
if wipe then
head = remove_node(h,current,true)
@@ -184,18 +186,34 @@ local methods = {
-- maybe also 0x0008 : backspace
+ -- Watch out: a return value means "remove"!
+
+ [0x001E] = function(head,current) -- kind of special
+ local next = getnext(current)
+ if next and getid(next) == glue_code and getsubtype(next) == spaceskip_code then
+ local nextnext = getnext(next)
+ if nextnext then
+ local char, font = isglyph(nextnext)
+ if char and not canhavespace[char] then
+ head, current = remove_node(head,next,true)
+ end
+ end
+ end
+ return head, current
+ end,
+
[0x001F] = function(head,current) -- kind of special
local next = getnext(current)
if next then
local char, font = isglyph(next)
if char then
- head, current = remove_node(head,current,true)
- if not is_punctuation[char] then
+ if not ispunctuation[char] then
local p = fontparameters[font]
- head, current = insert_node_before(head,current,new_glue(p.space,p.space_stretch,p.space_shrink))
+ head, current = insertnodebefore(head,current,new_glue(p.space,p.space_stretch,p.space_shrink))
end
end
end
+ return head, current
end,
[0x00A0] = function(head,current) -- nbsp
@@ -226,7 +244,7 @@ local methods = {
end,
[0x00AD] = function(head,current) -- softhyphen
- return insert_node_after(head,current,languages.explicithyphen(current))
+ return insertnodeafter(head,current,languages.explicithyphen(current))
end,
[0x2000] = function(head,current) -- enquad
@@ -322,3 +340,30 @@ function characters.handler(head)
end
return head
end
+
+-- function characters.handler(head)
+-- local wiped = false
+-- for current, char in nextchar, head do
+-- local method = methods[char]
+-- if method then
+-- if wiped then
+-- wiped[#wiped+1] = current
+-- else
+-- wiped = { current }
+-- end
+-- if trace_characters then
+-- report_characters("replacing character %C, description %a",char,lower(chardata[char].description))
+-- end
+-- local h = method(head,current)
+-- if h then
+-- head = h
+-- end
+-- end
+-- end
+-- if wiped then
+-- for i=1,#wiped do
+-- head = remove_node(head,wiped[i],true)
+-- end
+-- end
+-- return head
+-- end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/spac-chr.mkiv b/Master/texmf-dist/tex/context/base/mkiv/spac-chr.mkiv
index 9113dc6a110..4c7cc9492eb 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/spac-chr.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/spac-chr.mkiv
@@ -95,7 +95,8 @@
\popoverloadmode
-\chardef\optionalspace"1F % will be space unless before punctuation
+\chardef\optionalspace "1F % will be space unless before punctuation
+\chardef\autoinsertedspace"1E % a more clever \autoinsertspace
% Shortcuts:
diff --git a/Master/texmf-dist/tex/context/base/mkiv/spac-hor.mkiv b/Master/texmf-dist/tex/context/base/mkiv/spac-hor.mkiv
index 16a1a0d4e9a..5d9cef07962 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/spac-hor.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/spac-hor.mkiv
@@ -621,6 +621,7 @@
\unexpanded\def\thinspace {\kern .16667\emwidth}
\unexpanded\def\negthinspace{\kern-.16667\emwidth}
\unexpanded\def\enspace {\kern .5\emwidth}
+ \unexpanded\def\emspace {\kern \emwidth}
\fi
@@ -635,8 +636,6 @@
\unexpanded\def\negenspace{\kern-.5\emwidth}
\unexpanded\def\negemspace{\kern- \emwidth}
-\let\emspace\quad
-
\unexpanded\def\charspace{ } % the unexpandable \space (as space can also be delimiter for numbers)
\unexpanded\def\quads
diff --git a/Master/texmf-dist/tex/context/base/mkiv/spac-ver.lua b/Master/texmf-dist/tex/context/base/mkiv/spac-ver.lua
index 2fc9263213c..8baf2518413 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/spac-ver.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/spac-ver.lua
@@ -148,14 +148,15 @@ local setdepth = nuts.setdepth
local getdepth = nuts.getdepth
local find_node_tail = nuts.tail
-local flush_node = nuts.flush_node
-local insert_node_after = nuts.insert_after
-local insert_node_before = nuts.insert_before
+local flushnode = nuts.flushnode
+local insertnodeafter = nuts.insertafter
+local insertnodebefore = nuts.insertbefore
local remove_node = nuts.remove
local count_nodes = nuts.countall
local hpack_node = nuts.hpack
local vpack_node = nuts.vpack
-local start_of_par = nuts.start_of_par
+
+local startofpar = nuts.startofpar
local nextnode = nuts.traversers.node
local nexthlist = nuts.traversers.hlist
@@ -171,7 +172,7 @@ local nodepool = nuts.pool
local new_penalty = nodepool.penalty
local new_kern = nodepool.kern
-local new_glue = nodepool.glue
+----- new_glue = nodepool.glue
local new_rule = nodepool.rule
local nodecodes = nodes.nodecodes
@@ -293,7 +294,7 @@ end
local function validvbox(parentid,list)
if parentid == hlist_code then
local id = getid(list)
- if id == par_code and start_of_par(list) then
+ if id == par_code and startofpar(list) then
list = getnext(list)
if not next then
return nil
@@ -329,7 +330,7 @@ local function already_done(parentid,list,a_snapmethod) -- todo: done when only
-- problem: any snapped vbox ends up in a line
if list and parentid == hlist_code then
local id = getid(list)
- if id == par_code and start_of_par(list) then
+ if id == par_code and startofpar(list) then
list = getnext(list)
if not list then
return false
@@ -709,19 +710,19 @@ local function snap_topskip(current,method)
return w, 0
end
-local categories = {
- [0] = "discard",
- [1] = "largest",
- [2] = "force",
- [3] = "penalty",
- [4] = "add",
- [5] = "disable",
- [6] = "nowhite",
- [7] = "goback",
- [8] = "packed",
- [9] = "overlay",
- [10] = "enable",
- [11] = "notopskip",
+local categories = { [0] =
+ "discard",
+ "largest",
+ "force",
+ "penalty",
+ "add",
+ "disable",
+ "nowhite",
+ "goback",
+ "packed",
+ "overlay",
+ "enable",
+ "notopskip",
}
categories = allocate(table.swapped(categories,categories))
@@ -1021,14 +1022,14 @@ do
if width == 0 then
-- do nothing
elseif where == "after" then
- head, current = insert_node_after(head,current,new_rule(w,h,d))
- head, current = insert_node_after(head,current,new_kern(width))
- head, current = insert_node_after(head,current,new_rule(w,h,d))
+ head, current = insertnodeafter(head,current,new_rule(w,h,d))
+ head, current = insertnodeafter(head,current,new_kern(width))
+ head, current = insertnodeafter(head,current,new_rule(w,h,d))
else
local c = current
- head, current = insert_node_before(head,current,new_rule(w,h,d))
- head, current = insert_node_before(head,current,new_kern(width))
- head, current = insert_node_before(head,current,new_rule(w,h,d))
+ head, current = insertnodebefore(head,current,new_rule(w,h,d))
+ head, current = insertnodebefore(head,current,new_kern(width))
+ head, current = insertnodebefore(head,current,new_rule(w,h,d))
current = c
end
if trace then
@@ -1203,10 +1204,10 @@ do
texsetdimen("global","d_spac_overlay",-delta) -- for tracing
-- we should adapt pagetotal ! (need a hook for that) .. now we have the wrong pagebreak
local k = new_kern(-delta)
- head = insert_node_before(head,n,k)
+ head = insertnodebefore(head,n,k)
if n_ht > p_ht then
local k = new_kern(n_ht-p_ht)
- head = insert_node_before(head,p,k)
+ head = insertnodebefore(head,p,k)
end
if trace_vspacing then
report_vspacing("overlaying, prev height: %p, prev depth: %p, next height: %p, skips: %p, move up: %p",p_ht,p_dp,n_ht,skips,delta)
@@ -1375,13 +1376,13 @@ do
if penalty_data >= 10000 then -- or whatever threshold?
local prev = getprev(current)
if getid(prev) == glue_code then -- maybe go back more, or maybe even push back before any glue
- -- tricky case: spacing/grid-007.tex: glue penalty glue
- head = insert_node_before(head,prev,p)
+ -- tricky case: spacing/grid-007.tex: glue penalty glue
+ head = insertnodebefore(head,prev,p)
else
- head = insert_node_before(head,current,p)
+ head = insertnodebefore(head,current,p)
end
else
- head = insert_node_before(head,current,p)
+ head = insertnodebefore(head,current,p)
end
-- if penalty_data > special_penalty_min and penalty_data < special_penalty_max then
local props = properties[p]
@@ -1400,22 +1401,22 @@ do
trace_done("flushed due to forced " .. why,glue_data)
end
head = forced_skip(head,current,getwidth(glue_data,width),"before",trace)
- flush_node(glue_data)
+ flushnode(glue_data)
else
local width, stretch, shrink = getglue(glue_data)
if width ~= 0 then
if trace then
trace_done("flushed due to non zero " .. why,glue_data)
end
- head = insert_node_before(head,current,glue_data)
+ head = insertnodebefore(head,current,glue_data)
elseif stretch ~= 0 or shrink ~= 0 then
if trace then
trace_done("flushed due to stretch/shrink in" .. why,glue_data)
end
- head = insert_node_before(head,current,glue_data)
+ head = insertnodebefore(head,current,glue_data)
else
-- report_vspacing("needs checking (%s): %p",gluecodes[getsubtype(glue_data)],w)
- flush_node(glue_data)
+ flushnode(glue_data)
end
end
end
@@ -1545,7 +1546,7 @@ do
if trace then
trace_done("flush",glue_data)
end
- head = insert_node_before(head,current,glue_data)
+ head = insertnodebefore(head,current,glue_data)
if trace then
trace_natural("natural",current)
end
@@ -1634,7 +1635,7 @@ do
trace_skip("force",sc,so,sp,current)
end
glue_order = so
- flush_node(glue_data)
+ flushnode(glue_data)
head, current, glue_data = remove_node(head,current)
elseif glue_order == so then
-- is now exclusive, maybe support goback as combi, else why a set
@@ -1645,7 +1646,7 @@ do
if trace then
trace_skip("largest",sc,so,sp,current)
end
- flush_node(glue_data)
+ flushnode(glue_data)
head, current, glue_data = remove_node(head,current)
else
if trace then
@@ -1657,7 +1658,7 @@ do
if trace then
trace_skip("goback",sc,so,sp,current)
end
- flush_node(glue_data)
+ flushnode(glue_data)
head, current, glue_data = remove_node(head,current)
elseif sc == force then
-- last one counts, some day we can provide an accumulator and largest etc
@@ -1665,13 +1666,13 @@ do
if trace then
trace_skip("force",sc,so,sp,current)
end
- flush_node(glue_data)
+ flushnode(glue_data)
head, current, glue_data = remove_node(head,current)
elseif sc == penalty then
if trace then
trace_skip("penalty",sc,so,sp,current)
end
- flush_node(glue_data)
+ flushnode(glue_data)
glue_data = nil
head, current = remove_node(head,current,true)
elseif sc == add then
@@ -1881,7 +1882,7 @@ do
end
if force_glue then
head, tail = forced_skip(head,tail,getwidth(glue_data),"after",trace)
- flush_node(glue_data)
+ flushnode(glue_data)
glue_data = nil
elseif tail then
setlink(tail,glue_data)
@@ -2004,10 +2005,7 @@ do
function vspacing.vboxhandler(head,where)
if head and not ignore[where] and getnext(head) then
- if getnext(head) then -- what if a one liner and snapping?
- head = collapser(head,"vbox",where,trace_vbox_vspacing,true,a_snapvbox) -- todo: local snapper
- return head
- end
+ head = collapser(head,"vbox",where,trace_vbox_vspacing,true,a_snapvbox) -- todo: local snapper
end
return head
end
@@ -2128,19 +2126,20 @@ do
end
end
- local trace = false
- local last = nil
- local vmode_code = tex.modelevels.vertical
- local temp_code = nodecodes.temp
- local getnest = tex.getnest
- local getlist = tex.getlist
+ local trace = false
+ local last = nil
+ local vmode_code = tex.modelevels.vertical
+ local temp_code = nodecodes.temp
+ local texgetnest = tex.getnest
+ local texgetlist = tex.getlist
+ local getnodetail = nodes.tail
trackers.register("vspacing.forcestrutdepth",function(v) trace = v end)
-- abs : negative is inner
function vspacing.checkstrutdepth(depth)
- local nest = getnest()
+ local nest = texgetnest()
if abs(nest.mode) == vmode_code and nest.head then
local tail = nest.tail
local id = tail.id
@@ -2149,10 +2148,10 @@ do
tail.depth = depth
end
nest.prevdepth = depth
- elseif id == temp_code and getnest("ptr") == 0 then
- local head = getlist("page_head")
+ elseif id == temp_code and texgetnest("ptr") == 0 then
+ local head = texgetlist("page_head")
if head then
- tail = nodes.tail(head)
+ tail = getnodetail(head)
if tail and tail.id == hlist_code then
if tail.depth < depth then
tail.depth = depth
diff --git a/Master/texmf-dist/tex/context/base/mkiv/status-files.pdf b/Master/texmf-dist/tex/context/base/mkiv/status-files.pdf
index e890fa88c93..5e4560e8410 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/status-files.pdf
+++ b/Master/texmf-dist/tex/context/base/mkiv/status-files.pdf
Binary files differ
diff --git a/Master/texmf-dist/tex/context/base/mkiv/status-lua.pdf b/Master/texmf-dist/tex/context/base/mkiv/status-lua.pdf
index ffeb01fef65..c403fd6c524 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/status-lua.pdf
+++ b/Master/texmf-dist/tex/context/base/mkiv/status-lua.pdf
Binary files differ
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-blk.lua b/Master/texmf-dist/tex/context/base/mkiv/strc-blk.lua
index 6717c37773a..f627ad3eaf7 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-blk.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-blk.lua
@@ -95,8 +95,11 @@ function blocks.setstate(state,name,tag)
end
end
-function blocks.select(state,name,tag,criterium)
- criterium = criterium or "text"
+
+local function selectblocks(state,name,tag,criterium,action)
+ if not criterium or criterium == "" then
+ criterium = "text"
+ end
if find(tag,"=",1,true) then
tag = ""
end
@@ -115,14 +118,19 @@ function blocks.select(state,name,tag,criterium)
local metadata = ri.metadata
if names[metadata.name] then
if all then
- printblock(ri.index,name,ri.data,hide)
+ if action(ri.index,name,ri.data,hide) then
+ return
+ end
else
local mtags = metadata.tags
if mtags then
for tag, sta in next, tags do
if mtags[tag] then
- printblock(ri.index,name,ri.data,hide)
- break
+ if action(ri.index,name,ri.data,hide) then
+ return
+ else
+ break
+ end
end
end
end
@@ -131,6 +139,20 @@ function blocks.select(state,name,tag,criterium)
end
end
+function blocks.select(state,name,tag,criterium)
+ selectblocks(state,name,tag,criterium,printblock)
+end
+
+function blocks.empty(state,name,tag,criterium)
+ local found = false
+ local function checkempty(_,_,data)
+ found = type(data) == "string" and find(data,"%S")
+ return found
+ end
+ selectblocks(state,name,tag,criterium,checkempty)
+ return not found
+end
+
function blocks.save(name,tag,userdata,buffer) -- wrong, not yet adapted
local data = buffers.getcontent(buffer)
local tags = settings_to_set(tag)
@@ -183,6 +205,7 @@ function blocks.save(name,tag,userdata,buffer) -- wrong, not yet adapted
buffers.erase(buffer)
end
+
-- interface
implement { name = "definestructureblock", actions = blocks.define, arguments = "string" }
@@ -190,3 +213,11 @@ implement { name = "savestructureblock", actions = blocks.save,
implement { name = "selectstructureblock", actions = blocks.select, arguments = "4 strings" }
implement { name = "setstructureblockstate", actions = blocks.setstate, arguments = "3 strings" }
implement { name = "structureblockuservariable", actions = blocks.uservariable, arguments = { "integer", "string" } }
+
+implement {
+ name = "doifelsestructureblocksempty",
+ arguments = "3 strings",
+ actions = function(name,tag,criterium)
+ commands.doifelse(blocks.empty(false,name,tag,criterium))
+ end,
+}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-blk.mkiv b/Master/texmf-dist/tex/context/base/mkiv/strc-blk.mkiv
index e521987212d..3541d28524c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-blk.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-blk.mkiv
@@ -177,4 +177,6 @@
\unexpanded\def\processblocks{\doquadrupleempty\strc_blocks_select [process]}
\unexpanded\def\selectblocks {\doquadrupleempty\strc_blocks_select [use]}
+\unexpanded\def\doifelseblocksempty{\clf_doifelsestructureblocksempty} % {name}{tag}{criterium}
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-doc.lua b/Master/texmf-dist/tex/context/base/mkiv/strc-doc.lua
index 5cb207c38bf..0592ad7d515 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-doc.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-doc.lua
@@ -40,6 +40,8 @@ local v_all = variables.all
local v_positive = variables.positive
local v_current = variables.current
+local texgetcount = tex.getcount
+
local trace_sectioning = false trackers.register("structures.sectioning", function(v) trace_sectioning = v end)
local trace_details = false trackers.register("structures.details", function(v) trace_details = v end)
@@ -48,6 +50,7 @@ local report_used = logs.reporter("structure")
local context = context
local commands = commands
+local ctx_doifelse = commands.doifelse
local structures = structures
local helpers = structures.helpers
@@ -165,9 +168,9 @@ end
local lastsaved = 0
function sections.save(sectiondata)
-local sectiondata = helpers.simplify(sectiondata) -- maybe done earlier
- local numberdata = sectiondata.numberdata
- local ntobesaved = #tobesaved
+ local sectiondata = helpers.simplify(sectiondata) -- maybe done earlier
+ local numberdata = sectiondata.numberdata
+ local ntobesaved = #tobesaved
if not numberdata or sectiondata.metadata.nolist then
-- stay
else
@@ -523,26 +526,76 @@ end
-- this one will become: return catcode, d (etc)
+-- function sections.structuredata(depth,key,default,honorcatcodetable) -- todo: spec table and then also depth
+-- if depth then
+-- depth = levelmap[depth] or tonumber(depth)
+-- end
+-- if not depth or depth == 0 then
+-- depth = data.depth
+-- end
+-- local data = data.status[depth]
+-- local d
+-- if data then
+-- if find(key,".",1,true) then
+-- d = accesstable(key,data)
+-- else
+-- d = data.titledata
+-- d = d and d[key]
+-- end
+-- end
+-- if d and type(d) ~= "table" then
+-- if honorcatcodetable == true or honorcatcodetable == v_auto then
+-- local metadata = data.metadata
+-- local catcodes = metadata and metadata.catcodes
+-- if catcodes then
+-- ctx_sprint(catcodes,d)
+-- else
+-- context(d)
+-- end
+-- elseif not honorcatcodetable or honorcatcodetable == "" then
+-- context(d)
+-- else
+-- local catcodes = catcodenumbers[honorcatcodetable]
+-- if catcodes then
+-- ctx_sprint(catcodes,d)
+-- else
+-- context(d)
+-- end
+-- end
+-- elseif default then
+-- context(default)
+-- end
+-- end
+
function sections.structuredata(depth,key,default,honorcatcodetable) -- todo: spec table and then also depth
+ local detail = false
+ if type(depth) == "string" then
+ depth, detail = string.splitup(depth,":")
+ end
if depth then
depth = levelmap[depth] or tonumber(depth)
end
if not depth or depth == 0 then
depth = data.depth
end
- local data = data.status[depth]
+ local useddata
+ if detail == "+" then
+ useddata = structures.lists.collected[#structures.lists.tobesaved+1]
+ else
+ useddata = data.status[depth]
+ end
local d
- if data then
+ if useddata then
if find(key,".",1,true) then
- d = accesstable(key,data)
+ d = accesstable(key,useddata)
else
- d = data.titledata
+ d = useddata.titledata
d = d and d[key]
end
end
if d and type(d) ~= "table" then
if honorcatcodetable == true or honorcatcodetable == v_auto then
- local metadata = data.metadata
+ local metadata = useddata.metadata
local catcodes = metadata and metadata.catcodes
if catcodes then
ctx_sprint(catcodes,d)
@@ -564,20 +617,50 @@ function sections.structuredata(depth,key,default,honorcatcodetable) -- todo: sp
end
end
+-- function sections.userdata(depth,key,default)
+-- if depth then
+-- depth = levelmap[depth] or tonumber(depth)
+-- end
+-- if not depth or depth == 0 then
+-- depth = data.depth
+-- end
+-- if depth > 0 then
+-- local userdata = data.status[depth]
+-- userdata = userdata and userdata.userdata
+-- userdata = (userdata and userdata[key]) or default
+-- if userdata then
+-- context(userdata)
+-- end
+-- end
+-- end
+
function sections.userdata(depth,key,default)
+ local detail = false
+ if type(depth) == "string" then
+ depth, detail = string.splitup(depth,":")
+ end
if depth then
- depth = levelmap[depth] or tonumber(depth)
+ depth = levelmap[depth]
+ end
+ if not depth then
+ depth = tonumber(depth)
end
if not depth or depth == 0 then
depth = data.depth
end
- if depth > 0 then
- local userdata = data.status[depth]
- userdata = userdata and userdata.userdata
- userdata = (userdata and userdata[key]) or default
+ local userdata
+ if detail == "+" then
+ userdata = structures.lists.collected[#structures.lists.tobesaved+1]
if userdata then
- context(userdata)
+ userdata = userdata.userdata
end
+ elseif depth > 0 then
+ userdata = data.status[depth]
+ userdata = userdata and userdata.userdata
+ end
+ userdata = (userdata and userdata[key]) or default
+ if userdata then
+ context(userdata)
end
end
@@ -772,6 +855,7 @@ function sections.typesetnumber(entry,kind,...)
applyprocessor(starter)
end
end
+-- inspect(entry)
if prefixlist and (kind == "section" or kind == "prefix" or kind == "direct") then
-- find valid set (problem: for sectionnumber we should pass the level)
-- no holes
@@ -780,6 +864,8 @@ function sections.typesetnumber(entry,kind,...)
local bb = 0
local ee = 0
-- find last valid number
+-- print("index >>",b,e)
+-- inspect(prefixlist)
for k=e,b,-1 do
local prefix = prefixlist[k]
local index = sections.getlevel(prefix) or k
@@ -1208,3 +1294,80 @@ implement {
name = "popsectionblock",
actions = sections.popblock,
}
+
+interfaces.implement {
+ name = "doifelsefirstsectionpage",
+ arguments = "1 argument",
+ public = true,
+ protected = true,
+ actions = function(name)
+ local found = false
+ -- local list = structures.lists.collected
+ local list = lists.collected
+ if list then
+ local realpage = texgetcount("realpageno")
+ for i=1,#list do
+ local listdata = list[i]
+ local metadata = listdata.metadata
+ if metadata and metadata.kind == "section" and metadata.name == name then
+ -- local current = structures.documents.data.status[metadata.level]
+ local current = data.status[metadata.level]
+ if current and current.references.internal == listdata.references.internal then
+ found = listdata.references.realpage == realpage
+ break
+ end
+ end
+ end
+ end
+ ctx_doifelse(found)
+ end,
+}
+
+-- could be faster (in huge lists)
+
+-- local firstpages = table.setmetatableindex(function(t,name)
+-- -- local list = structures.lists.collected
+-- local list = lists.collected
+-- local pages = { }
+-- if list then
+-- for i=1,#list do
+-- local listdata = list[i]
+-- local metadata = listdata.metadata
+-- if metadata and metadata.kind == "section" and metadata.name == name then
+-- local references = listdata.references
+-- if references then
+-- pages[references.internal] = listdata
+-- end
+-- end
+-- end
+-- end
+-- t[name] = pages
+-- return pages
+-- end)
+--
+-- interfaces.implement {
+-- name = "doifelsefirstsectionpage",
+-- arguments = "1 argument",
+-- public = true,
+-- protected = true,
+-- actions = function(name)
+-- local found = firstpages[name]
+-- if found then
+-- local level = structures.sections.levelmap[name]
+-- if level then
+-- -- local current = structures.documents.data.status[level]
+-- local current = data.status[level]
+-- if current then
+-- local realpage = texgetcount("realpageno")
+-- found = found[current.references.internal]
+-- found = found and found.references.realpage == realpage
+-- else
+-- found = false
+-- end
+-- else
+-- found = false
+-- end
+-- end
+-- ctx_doifelse(found)
+-- end,
+-- }
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-enu.mkvi b/Master/texmf-dist/tex/context/base/mkiv/strc-enu.mkvi
index 4680a3981df..4ad417a3e9b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-enu.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-enu.mkvi
@@ -305,16 +305,22 @@
\endgroup}
\unexpanded\def\strc_enumerations_inject_symbol % todo check
- {\constructionparameter\c!left
+ {\begingroup
+ \useconstructionstyleandcolor\c!numberstyle\c!numbercolor
+ \constructionparameter\c!left
\constructionparameter\c!symbol
- \constructionparameter\c!right}
+ \constructionparameter\c!right
+ \endgroup}
\unexpanded\def\strc_enumerations_inject_number
- {\constructionparameter\c!left
+ {\begingroup
+ \useconstructionstyleandcolor\c!numberstyle\c!numbercolor
+ \constructionparameter\c!left
\constructionparameter\c!starter
\clf_savedlistprefixednumber{\currentconstructionmain}\currentconstructionlistentry\relax
\constructionparameter\c!stopper
- \constructionparameter\c!right}
+ \constructionparameter\c!right
+ \endgroup}
\unexpanded\def\strc_enumerations_inject_text_and_number
{\constructionparameter\c!numbercommand
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-flt.mkvi b/Master/texmf-dist/tex/context/base/mkiv/strc-flt.mkvi
index d9fd359c668..464b6ab520f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-flt.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-flt.mkvi
@@ -1111,6 +1111,35 @@
\def\strc_floats_group_index
{\numexpr\clf_listgroupindex{\currentfloat}{\currentfloatgroup}\relax}
+%D A lightweight subnumber feature:
+%D
+%D \starttyping
+%D \startplacefigure [location=none]
+%D \startsubfloatnumbering
+%D \startfloatcombination [nx=3]
+%D \startplacefigure [title=Left] \externalfigure \stopplacefigure
+%D \startplacefigure [title=Middle] \externalfigure \stopplacefigure
+%D \startplacefigure [title=Right] \externalfigure \stopplacefigure
+%D \stopfloatcombination
+%D \stopsubfloatnumbering
+%D \stopplacefigure
+%D \stoptyping
+
+\glet\currentsubfloatcounter\empty
+
+\unexpanded\def\startsubfloatnumbering
+ {\glet\currentsubfloatcounter\s!unknown}
+
+\unexpanded\def\stopsubfloatnumbering
+ {\strc_counters_reset_sub\currentsubfloatcounter\plustwo
+ \glet\currentsubfloatcounter\empty}
+
+\defineconversionset[subfloats][number,characters]
+
+\setupcaptions
+ %[figure]
+ [\c!numberconversionset=subfloats]
+
\def\strc_floats_place_packaged_boxes
{\expandafter\strc_floats_place_packaged_boxes_indeed\expandafter{\m_strc_floats_saved_userdata}}
@@ -1127,7 +1156,17 @@
\ifx\currentfloatgroup\empty
% independent
\iftrialtypesetting\strc_counters_save\currentfloatcounter\fi
- \strc_counters_increment\currentfloatcounter
+ \ifx\empty\currentsubfloatcounter
+ \strc_counters_increment\currentfloatcounter
+ \strc_counters_reset_sub\currentfloatcounter\plustwo
+ \else
+ \ifcase\strc_counters_raw_sub\currentfloatcounter\plustwo\relax
+ \strc_counters_increment\currentfloatcounter
+ \strc_counters_reset_sub\currentfloatcounter\plustwo
+ \fi
+ \strc_counters_increment_sub\currentfloatcounter\plustwo
+ \glet\currentsubfloatcounter\currentfloatcounter
+ \fi
\else\ifcase\strc_floats_group_index
% first in group
\iftrialtypesetting\strc_counters_save\currentfloatcounter\fi
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-lst.lua b/Master/texmf-dist/tex/context/base/mkiv/strc-lst.lua
index a6799d80f1a..41d09f073a1 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-lst.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-lst.lua
@@ -37,6 +37,8 @@ local conditionals = tex.conditionals
local ctx_latelua = context.latelua
+local cheat = true
+
local structures = structures
local lists = structures.lists
local sections = structures.sections
@@ -96,7 +98,10 @@ local v_reference = variables.reference
local v_local = variables["local"]
local v_default = variables.default
--- for the moment not public --
+local cheats = {
+ [variables.fit] = true,
+ [variables.tight] = true,
+}
local function zerostrippedconcat(t,separator)
local f = 1
@@ -193,8 +198,13 @@ local function finalizer()
if r then
local i = r.internal
local f = flaginternals[i]
+ local v = usedviews[i]
+ if cheat and v and cheats[v] then -- cheats check added, to be tested by RKB
+ -- this permits runs=2 with interactivity
+ r.view = v
+ end
if f then
- r.used = usedviews[i] or true
+ r.used = v or true
end
end
end
@@ -232,7 +242,7 @@ function lists.addto(t) -- maybe more more here (saves parsing at the tex end)
if numberdata then
local numbers = numberdata.numbers
if type(numbers) == "string" then
- numberdata.numbers = counters.compact(numbers,nil,true)
+ counters.compact(numberdata,numbers,numberdata.level)
end
end
local group = numberdata and numberdata.group
@@ -256,6 +266,14 @@ function lists.addto(t) -- maybe more more here (saves parsing at the tex end)
if r and not r.section then
r.section = structures.sections.currentid()
end
+ local b = r and t.block
+ if r and not b then
+ local s = r.section
+ if s then
+ s = structures.sections.tobesaved[s]
+ r.block = s and s.block or nil
+ end
+ end
local i = r and r.internal or 0 -- brrr
if r and kind and name then
local tag = tags.getid(kind,name)
@@ -445,7 +463,8 @@ local function filtercollected(specification)
elseif not wantedcriterium then
block = documents.data.block
else
- block, criterium = wantedblock, wantedcriterium
+ block = wantedblock
+ criterium = wantedcriterium
end
if block == "" then
block = false
@@ -468,6 +487,10 @@ local function filtercollected(specification)
specification.block = block
specification.all = all
--
+ if specification.atmost then
+ criterium = v_text
+ end
+ --
if trace_lists then
report_lists("filtering names %,t, criterium %a, block %a",sortedkeys(names), criterium, block or "*")
end
@@ -476,6 +499,31 @@ local function filtercollected(specification)
report_lists("criterium %a, block %a, found %a",specification.criterium, specification.block or "*", #result)
end
--
+ local levels = tonumber(specification.levels)
+ if levels then
+ local minlevel = 1000
+ local found = result
+ local nofresult = #result
+ for i=1,nofresult do
+ local v = found[i]
+ local l = v.metadata.level or 1
+ if l < minlevel then
+ minlevel = l
+ end
+ end
+ local maxlevel = minlevel + levels - 1
+ result = { }
+ nofresult = 0
+ for i=1,#found do
+ local v = found[i]
+ local l = v.metadata.level or 1
+ if l >= minlevel and l <= maxlevel then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ end
+ end
+ end
+ --
if sortorder then -- experiment
local sorter = listsorters[sortorder]
if sorter then
@@ -495,7 +543,7 @@ end
filters[v_intro] = function(specification)
local collected = specification.collected
local result = { }
- local nofresult = #result
+ local nofresult = 0
local all = specification.all
local names = specification.names
for i=1,#collected do
@@ -515,7 +563,7 @@ end
filters[v_reference] = function(specification)
local collected = specification.collected
local result = { }
- local nofresult = #result
+ local nofresult = 0
local names = specification.names
local sections = sections.collected
local reference = specification.reference
@@ -554,7 +602,7 @@ end
filters[v_all] = function(specification)
local collected = specification.collected
local result = { }
- local nofresult = #result
+ local nofresult = 0
local block = specification.block
local all = specification.all
local forced = specification.forced
@@ -566,7 +614,7 @@ filters[v_all] = function(specification)
if r and (not block or not r.block or block == r.block) then
local metadata = v.metadata
if metadata then
- local name = metadata.name or false
+ local name = metadata.name or false
local sectionnumber = (r.section == 0) or sections[r.section]
if forced[name] or (sectionnumber and not metadata.nolist and (all or names[name])) then -- and not sectionnumber.hidenumber then
nofresult = nofresult + 1
@@ -588,7 +636,7 @@ filters[v_current] = function(specification)
end
local collected = specification.collected
local result = { }
- local nofresult = #result
+ local nofresult = 0
local depth = specification.depth
local block = specification.block
local all = specification.all
@@ -634,7 +682,7 @@ filters[v_here] = function(specification)
end
local collected = specification.collected
local result = { }
- local nofresult = #result
+ local nofresult = 0
local depth = specification.depth
local block = specification.block
local all = specification.all
@@ -679,7 +727,7 @@ filters[v_previous] = function(specification)
end
local collected = specification.collected
local result = { }
- local nofresult = #result
+ local nofresult = 0
local block = specification.block
local all = specification.all
local names = specification.names
@@ -740,7 +788,7 @@ filters[v_component] = function(specification)
-- special case, no structure yet
local collected = specification.collected
local result = { }
- local nofresult = #result
+ local nofresult = 0
local all = specification.all
local names = specification.names
local component = resolvers.jobs.currentcomponent() or ""
@@ -766,7 +814,7 @@ end
filters[v_default] = function(specification) -- is named
local collected = specification.collected
local result = { }
- local nofresult = #result
+ local nofresult = 0
----- depth = specification.depth
local block = specification.block
local criterium = specification.criterium
@@ -797,6 +845,7 @@ filters[v_default] = function(specification) -- is named
for i=1,#collected do
local v = collected[i]
local r = v.references
+-- inspect(v)
if r and (not block or not r.block or pblock == r.block) then
local sectionnumber = sections[r.section]
if sectionnumber then
@@ -839,13 +888,23 @@ function lists.process(specification)
local total = #result
lists.result = result
if total > 0 then
+ local usedinternals = references.usedinternals
+ local usedviews = references.usedviews
local specials = settings_to_set(specification.extras or "")
specials = next(specials) and specials or nil
for i=1,total do
- local r = result[i]
- local m = r.metadata
- local s = specials and r.numberdata and specials[zerostrippedconcat(r.numberdata.numbers,".")] or ""
- context.strclistsentryprocess(m.name,m.kind,i,s)
+ local listentry = result[i]
+ local metadata = listentry.metadata
+ local numberdata = listentry.numberdata
+ local references = listentry.references
+ local special = specials and numberdata and specials[zerostrippedconcat(numberdata.numbers,".")] or ""
+ if cheat and references then
+ -- this permits runs=2 with interactivity
+ local internal = references.internal
+ usedinternals[internal] = true
+ usedviews [internal] = references.view
+ end
+ context.strclistsentryprocess(metadata.name,metadata.kind,i,special)
end
end
end
@@ -943,6 +1002,18 @@ function lists.hasnumberdata(name,n)
return false
end
+function lists.rawnumber(n,name)
+ local data = lists.result[n]
+ if data then
+ local numberdata = data.numberdata
+ if numberdata then
+ numberdata = numberdata.numbers
+ return numberdata and numberdata[getsectionlevel(name)] or numberdata[name] or 0
+ end
+ end
+ return 0
+end
+
function lists.prefix(name,n,spec)
helpers.prefix(lists.result[n],spec)
end
@@ -1068,6 +1139,7 @@ implement {
}
},
{ "numberdata", {
+ { "level", "integer" },
{ "numbers" },
{ "groupsuffix" },
{ "group" },
@@ -1111,6 +1183,7 @@ implement {
{ "reference" },
{ "extras" },
{ "order" },
+ { "levels" },
}
}
}
@@ -1278,6 +1351,12 @@ implement {
arguments = "integer"
}
+implement {
+ name = "rawlistnumber",
+ actions = { lists.rawnumber, context },
+ arguments = { "integer", "string" },
+}
+
-- new and experimental and therefore off by default
lists.autoreorder = false -- true
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-mar.lua b/Master/texmf-dist/tex/context/base/mkiv/strc-mar.lua
index f7953c416e0..dd6c0a93d69 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-mar.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-mar.lua
@@ -43,7 +43,7 @@ local lateluawhatsit_code = whatsitcodes.latelua
local texsetattribute = tex.setattribute
-local a_marks = attributes.private("structure","marks")
+local a_marks = attributes.private("marks")
local trace_set = false trackers.register("marks.set", function(v) trace_set = v end)
local trace_get = false trackers.register("marks.get", function(v) trace_get = v end)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-mat.mkiv b/Master/texmf-dist/tex/context/base/mkiv/strc-mat.mkiv
index 7f5a1915445..d0d4066526f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-mat.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-mat.mkiv
@@ -204,7 +204,10 @@
\relax \relax \relax
[\c!name=\v!formula,\s!counter=\v!formula,%
\s!hascaption=\v!yes,\s!hastitle=\v!yes,\s!hasnumber=\v!yes,%\s!haslevel=#6,%
- \c!reference=#1,\c!title=\namedformulaentry,\c!bookmark=]%
+ \c!reference=#1,%
+ \c!title=\namedformulaentry,%
+ \c!list=\currentplaceformulalist,%
+ \c!bookmark=\currentplaceformulabookmark]%
[#2]%
\glet\namedformulaentry\empty % \relax
\glet#3\m_strc_counters_last_registered_index
@@ -620,7 +623,6 @@
\setvalue{\??mathdisplayspacemodel\v!after:1}% old
{\prevdepth .5\strutdp
- \edef\p_spaceafter{\formulaparameter\c!spaceafter}%
\ifx\p_spaceafter\v!none
% nothing
\else
@@ -637,7 +639,6 @@
\setvalue{\??mathdisplayspacemodel\v!after:2}% old
{\prevdepth\lineheight
- \edef\p_spaceafter{\formulaparameter\c!spaceafter}%
\ifx\p_spaceafter\v!none
% nothing
\else
@@ -668,11 +669,11 @@
\else\ifx\p_spacebefore\empty
\directvspacing\currentvspacing
\else
- \directvspacing{\p_spacebefore,\the\scratchdimen}%
+ \directvspacing\p_spacebefore
\fi\fi
\else
\ifx\p_spacebefore\v!none
- \directvspacing{\m_spacebefore}%
+ \directvspacing\m_spacebefore
\else\ifx\p_spacebefore\empty
\directvspacing{\m_spacebefore,\currentvspacing}%
\else
@@ -706,7 +707,7 @@
\else\ifx\p_spacebefore\empty
\directvspacing\currentvspacing
\else
- \directvspacing{\p_spacebefore,\the\scratchdimen}%
+ \directvspacing\p_spacebefore
\fi\fi
\fi
\else
@@ -975,6 +976,7 @@
\rawprocesscommalist[\p_direct]\strc_formulas_option
\fi
% not : \def\strc_formulas_formula[##1]##2{\mathematics{##2}}%
+ \useformulastyleandcolor\c!style\c!color
\mathematics{#2}%
\endgroup}
@@ -1227,13 +1229,20 @@
%\doifelsenextbgroup\strc_formulas_place_yes\strc_formulas_place_nop} % [ref]{}
\strc_formulas_place_nop}
+\let\currentplaceformulabookmark\empty
+\let\currentplaceformulalist \empty
+
\def\strc_formulas_start_place_parameters[#1]%
{\letdummyparameter\c!title \empty
\letdummyparameter\c!reference\empty
+ \letdummyparameter\c!bookmark \empty
+ \letdummyparameter\c!list \empty
\letdummyparameter\c!suffix \empty
\getdummyparameters[#1]%
\edef\currentplaceformulatitle {\dummyparameter\c!title}%
\edef\currentplaceformulareference{\dummyparameter\c!reference}%
+ \edef\currentplaceformulalist {\dummyparameter\c!list}%
+ \edef\currentplaceformulabookmark {\dummyparameter\c!bookmark}%
\edef\currentplaceformulasuffix {\dummyparameter\c!suffix}%
\ifx\currentplaceformulatitle\empty\else
\normalexpanded{\setformulalistentry{\currentplaceformulatitle}}%
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-not.mkvi b/Master/texmf-dist/tex/context/base/mkiv/strc-not.mkvi
index f29cb38ba16..469a57a15db 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-not.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-not.mkvi
@@ -24,9 +24,6 @@
\ifdefined\dotagsetnotesymbol \else \let\dotagsetnotesymbol\relax \fi
\ifdefined\dotagsetnotation \else \let\dotagsetnotation \relax \fi
-\unexpanded\def\unvboxed {\ifvmode\unvbox \else\box \fi} % will change or used more often
-\unexpanded\def\unvcopied{\ifvmode\unvcopy\else\copy\fi} % will change or used more often
-
%D \LMTX\ testcase:
%D
%D \starttyping
@@ -1507,7 +1504,12 @@
{\starthboxestohbox
\iftrialtypesetting\unvcopy\else\unvbox\fi\currentnoteinsertionnumber
\stophboxestohbox}}
- {\iftrialtypesetting\unvcopied\else\unvboxed\fi\currentnoteinsertionnumber}%
+ {\iftrialtypesetting
+ \ifvmode\unvcopy\else\copy\fi
+ \else
+ \ifvmode\unvbox \else\box \fi
+ \fi
+ \currentnoteinsertionnumber}%
\endgroup}
%D Supporting end notes is surprisingly easy. Even better, we can combine this
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-num.lua b/Master/texmf-dist/tex/context/base/mkiv/strc-num.lua
index 25e575a56f7..3339819a22f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-num.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-num.lua
@@ -270,18 +270,36 @@ function counters.raw(name)
return counterdata[name]
end
-function counters.compact(name,level,onlynumbers)
+function counters.compact(target,name,level)
local cd = counterdata[name]
if cd then
- local data = cd.data
- local compact = { }
- for i=1,level or #data do
+ local data = cd.data
+ local numbers = { }
+ local ownnumbers = { }
+ local depth = #data
+ if not level or level == 0 then
+ level = depth
+ elseif level > depth then
+ level = depth
+ end
+
+ for i=1,level do
local d = data[i]
- if d.number ~= 0 then
- compact[i] = (onlynumbers and d.number) or d
+ if d then
+ local n = d.number
+ local o = d.own
+ if n ~= 0 then
+ numbers[i] = n
+ end
+ if o ~= "" then
+ ownnumbers[i] = o
+ end
end
end
- return compact
+ target.numbers = numbers
+ if next(ownnumbers) then
+ target.ownnumbers = ownnumbers
+ end
end
end
@@ -357,8 +375,9 @@ end
local function reset(name,n)
local cd = counterdata[name]
if cd then
- for i=n or 1,#cd.data do
- local d = cd.data[i]
+ local data = cd.data
+ for i=n or 1,#data do
+ local d = data[i]
savevalue(name,i)
local number = d.start or 0
d.number = number
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-pag.lua b/Master/texmf-dist/tex/context/base/mkiv/strc-pag.lua
index 9c040104db4..d26f4adcfe2 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-pag.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-pag.lua
@@ -255,7 +255,7 @@ function helpers.analyze(entry,specification)
if not section then
return entry, false, "no section"
end
- local sectiondata = sections.collected[references.section]
+ local sectiondata = references.sectiondata or sections.collected[references.section] -- so we use an already resolved external one
if not sectiondata then
return entry, false, "no section data"
end
@@ -272,7 +272,7 @@ function helpers.analyze(entry,specification)
return entry, sectiondata, "okay"
end
-function helpers.prefix(data,prefixspec,nosuffix)
+function helpers.prefix(data,prefixspec,nosuffix) -- not only page
if data then
local _, prefixdata, status = helpers.analyze(data,prefixspec)
if prefixdata then
@@ -322,10 +322,6 @@ function pages.on_right(n)
end
end
-function pages.has_changed()
- return texconditionals.layouthaschanged
-end
-
function pages.in_body(n)
return texgetcount("pagebodymode") > 0
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-ref.lua b/Master/texmf-dist/tex/context/base/mkiv/strc-ref.lua
index bca36ccef43..8d081c923d3 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-ref.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-ref.lua
@@ -435,9 +435,21 @@ end
references.synchronizepage = synchronizepage
local function enhancereference(specification)
- local l = tobesaved[specification.prefix][specification.tag]
- if l then
- synchronizepage(l.references)
+ local prefix = specification.prefix
+ if prefix then
+ local entry = tobesaved[prefix]
+ if entry then
+ entry = entry[specification.tag]
+ if entry then
+ synchronizepage(entry.references)
+ else
+ -- normally a bug
+ end
+ else
+ -- normally a bug
+ end
+ else
+ -- normally a bug
end
end
@@ -1027,6 +1039,7 @@ local function loadexternalreferences(name,utilitydata)
local external = struc.references.collected -- direct references
local lists = struc.lists.collected -- indirect references (derived)
local pages = struc.pages.collected -- pagenumber data
+ local sections = struc.sections.collected
-- a bit weird one, as we don't have the externals in the collected
for prefix, set in next, external do
if prefix == "" then
@@ -1062,6 +1075,15 @@ local function loadexternalreferences(name,utilitydata)
if prefix == "" then
prefix = name -- this can clash!
end
+ local section = references.section
+ if section then
+ -- we have to make sure that the right section is used, see helpers.prefix
+ if sections then
+ references.sectiondata = sections[section]
+ else
+ -- warning
+ end
+ end
local target = external[prefix]
if not target then
target = { }
@@ -2084,7 +2106,7 @@ function references.setandgetattribute(data) -- maybe do internal automatically
if ndat then
local numbers = ndat.numbers
if type(numbers) == "string" then
- ndat.numbers = counters.compact(numbers,nil,true)
+ counters.compact(ndat,numbers)
end
data.numberdata = helpers.simplify(ndat)
end
@@ -2650,7 +2672,6 @@ end
implement { name = "referenceposx", actions = function() context("%p",referencepos("x")) end }
implement { name = "referenceposy", actions = function() context("%p",referencepos("y")) end }
-
implement {
name = "referencecolumn",
actions = function()
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-ref.mkvi b/Master/texmf-dist/tex/context/base/mkiv/strc-ref.mkvi
index 3bf33963851..5032c20c473 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-ref.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-ref.mkvi
@@ -1125,7 +1125,7 @@
\def\strc_references_handle_page_state_yes
{\markreferencepage
- \ifcase\referencepagedetail
+ \ifcase\referencepagedetail\relax
\expandafter\sixthofsixarguments \or
\expandafter\thirdofsixarguments \or
\expandafter\firstofsixarguments \or
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-ren.mkiv b/Master/texmf-dist/tex/context/base/mkiv/strc-ren.mkiv
index 359bd6aecc0..8926dfe8d70 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-ren.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-ren.mkiv
@@ -381,6 +381,7 @@
\noindentation
\else
\ignoreparskip
+ \doindentation
\fi\fi}
% nice testcase
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-syn.lua b/Master/texmf-dist/tex/context/base/mkiv/strc-syn.lua
index c0ebb556cc7..8933baea155 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-syn.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-syn.lua
@@ -29,6 +29,12 @@ local splitter = sorters.splitters.utf
synonyms.collected = collected
synonyms.tobesaved = tobesaved
+local progressions = { } -- false=not_yet_shown true=shown
+
+local variables = interfaces.variables
+local v_all = variables.all
+local v_current = variables.current
+
local function initializer()
collected = synonyms.collected
tobesaved = synonyms.tobesaved
@@ -86,12 +92,6 @@ function synonyms.register(class,kind,spec)
local tag = definition.tag or ""
data.metadata.kind = kind -- runtime, not saved in format (yet)
if not hash[tag] then
- if definition.used == nil then
- definition.used = false
- end
- if definition.shown == nil then
- definition.shown = false
- end
local entries = data.entries
entries[#entries+1] = spec
hash[tag] = spec
@@ -121,24 +121,58 @@ end
function synonyms.isused(class,tag)
local data = tobesaved[class]
local okay = data.hash[tag]
- return okay and okay.definition.used
+ return okay and okay.definition.used or false
end
function synonyms.isshown(class,tag)
local data = tobesaved[class]
local okay = data.hash[tag]
- return okay and okay.definition.shown
+ return okay and okay.definition.shown or false
+end
+
+local function resetused(class)
+ for tag, data in next, tobesaved[class].hash do
+ data.definition.used = nil
+ end
+end
+
+local function resetshown(class)
+ for tag, data in next, tobesaved[class].hash do
+ data.definition.shown = nil
+ end
end
-function synonyms.resetused(class)
+local function resetlist(class)
for tag, data in next, tobesaved[class].hash do
- data.definition.used = false
+ data.definition.list = nil
end
end
-function synonyms.resetshown(class)
+local function resetall(class)
for tag, data in next, tobesaved[class].hash do
- data.definition.shown = false
+ local definition = data.definition
+ definition.used = nil
+ definition.shown = nil
+ definition.list = nil
+ end
+end
+
+synonyms.resetused = resetused
+synonyms.resetshown = resetshown
+synonyms.resetlist = resetlist
+synonyms.resetall = resetall
+
+function synonyms.reset(class,what)
+ if what == "progress" then
+ progressions = { }
+ elseif what == "used" then
+ resetused(class)
+ elseif what == "shown" then
+ resetshown(class)
+ elseif what == "list" then
+ resetlist(class)
+ else
+ resetall(class)
end
end
@@ -151,6 +185,9 @@ function synonyms.synonym(class,tag)
definition.list = true
context(definition.synonym)
end
+ if progressions[tag] == nil then
+ progressions[tag] = false -- not yet shown
+ end
end
function synonyms.meaning(class,tag)
@@ -167,10 +204,10 @@ end
synonyms.compare = sorters.comparers.basic -- (a,b)
function synonyms.filter(data,options)
- local result = { }
- local entries = data.entries
- local all = options and options.criterium == interfaces.variables.all
- if all then
+ local result = { }
+ local entries = data.entries
+ local criterium = options and options.criterium
+ if criterium == v_all then
for i=1,#entries do
result[i] = entries[i]
end
@@ -179,9 +216,17 @@ function synonyms.filter(data,options)
local entry = entries[i]
local definition = entry.definition
if definition.list then
- result[#result+1] = entry
+ local tag = definition.tag
+ local done = progressions[tag]
+ if done == false then
+ result[#result+1] = entry
+ progressions[tag] = true
+ end
end
end
+ if criterium == v_current then
+ progressions = { }
+ end
end
data.result = result
end
@@ -193,9 +238,12 @@ function synonyms.prepare(data)
local entry = result[i]
local definition = entry.definition
if definition then
- local tag = definition.tag
- local key = tag ~= "" and tag or definition.synonym
- entry.split = splitter(strip(key))
+ local srt = definition.sortkey or ""
+ local tag = definition.tag or ""
+ local key = (srt ~= "" and srt) or (tag ~= "" and tag) or definition.synonym
+ if key then
+ entry.split = splitter(strip(key))
+ end
end
end
end
@@ -277,8 +325,10 @@ implement { name = "registerusedsynonym", actions = synonyms.registerused, arg
implement { name = "registershownsynonym", actions = synonyms.registershown, arguments = "2 strings" }
implement { name = "synonymmeaning", actions = synonyms.meaning, arguments = "2 strings" }
implement { name = "synonymname", actions = synonyms.synonym, arguments = "2 strings" }
-implement { name = "resetusedsynonyms", actions = synonyms.resetused, arguments = "string" }
-implement { name = "resetshownsynonyms", actions = synonyms.resetshown, arguments = "string" }
+-- { name = "resetusedsynonyms", actions = resetused, arguments = "string" }
+-- { name = "resetshownsynonyms", actions = resetshown, arguments = "string" }
+-- { name = "resetlistsynonyms", actions = resetlist, arguments = "string" }
+implement { name = "resetsynonyms", actions = synonyms.reset, arguments = "2 strings" }
implement {
name = "doifelsesynonymused",
@@ -310,6 +360,7 @@ implement {
{ "tag" },
{ "synonym" },
{ "meaning" },
+ { "sortkey" },
{ "used", "boolean" }
}
}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-syn.mkiv b/Master/texmf-dist/tex/context/base/mkiv/strc-syn.mkiv
index cdede1d0da0..e93141bde11 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-syn.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-syn.mkiv
@@ -101,6 +101,31 @@
%D
%D The lists are constructions (like descriptions are) and can be set up
%D likewise.
+%D
+%D You can show the currently accessed entries as follows:
+%D
+%D \starttyping
+%D \startchapter[title=One]
+%D test \FIRST\ test test \THIRD\ test \blank
+%D \placelistofsynonyms[myabbreviation]
+%D \resetsynonymsprogress[myabbreviation] % reset state
+%D \stopchapter
+%D
+%D \startchapter[title=Two]
+%D test \FIRST\ test test \SECOND\ test \blank
+%D \placelistofsynonyms[myabbreviation][criterium=current]
+%D \resetsynonymsprogress[myabbreviation] % reset state
+%D \stopchapter
+%D
+%D \startchapter[title=Three]
+%D test test test test test test \blank
+%D \placelistofsynonyms[myabbreviation][criterium=current] % also reset state
+%D \stopchapter
+%D
+%D \startchapter[title=All]
+%D \placelistofsynonyms[myabbreviation][criterium=all]
+%D \stopchapter
+%D \stoptyping
% todo: add 'define only' option to descriptions, then add sorting (also based on key)
% and call to definition -> replaces this module
@@ -319,8 +344,11 @@
\unexpanded\def\currentsynonymmeaning {\clf_synonymmeaning {\currentsimplelist}{\currentsynonymtag}}
\unexpanded\def\doifelsecurrentsynonymused {\clf_doifelsesynonymused {\currentsimplelist}{\currentsynonymtag}}
\unexpanded\def\doifelsecurrentsynonymshown{\clf_doifelsesynonymshown{\currentsimplelist}{\currentsynonymtag}}
-\unexpanded\def\resetusedsynonyms [#1]{\clf_resetusedsynonyms {#1}}
-\unexpanded\def\resetshownsynonyms [#1]{\clf_resetshownsynonyms {#1}}
+\unexpanded\def\resetusedsynonyms [#1]{\clf_resetsynonyms{#1}{used}}
+\unexpanded\def\resetshownsynonyms [#1]{\clf_resetsynonyms{#1}{shown}}
+\unexpanded\def\resetlistsynonyms [#1]{\clf_resetsynonyms{#1}{list}}
+\unexpanded\def\resetsynonyms [#1]{\clf_resetsynonyms{#1}{all}}
+\unexpanded\def\resetsynonymsprogress [#1]{\clf_resetsynonyms{#1}{progress}}
\let\rawsynonymname \clf_synonymname
\let\rawsynonymmeaning\clf_synonymmeaning
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-usr.mkiv b/Master/texmf-dist/tex/context/base/mkiv/strc-usr.mkiv
index 97b656fa087..cbf91061633 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/strc-usr.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/strc-usr.mkiv
@@ -91,21 +91,16 @@
\installcommandhandler \????userdata {userdata} \????userdata
\installcommandhandler \????userdataalternative {userdataalternative} \????userdataalternative
+\appendtoks
+ \setuevalue{\e!start\currentuserdata}{\dodoubleempty\userdata_start_instance[\currentuserdata]}%
+ \setuevalue{\e!stop \currentuserdata}{\userdata_stop_instance}%
+\to \everydefineuserdata
+
\unexpanded\def\startuserdata
{\begingroup
\let\currentuserdata\empty
\doifelsenextoptionalcs\userdata_start_delayed\userdata_start_indeed}
-% This variant works only when the userdata instance exists while the assignment check
-% can also be used with undefined instances which falls back to the global settings.
-%
-% \def\userdata_start_delayed[#1]%
-% {\ifcsname\nameduserdatahash{\detokenize\expandafter{\normalexpanded{#1}}}\s!parent\endcsname
-% \expandafter\userdata_start_delayed_name
-% \else
-% \expandafter\userdata_start_delayed_parameters
-% \fi[#1]}
-
\def\userdata_start_delayed[#1]%
{\doifelseassignmentcs{#1}%
\userdata_start_delayed_parameters
@@ -121,26 +116,27 @@
\checkuserdataparent
\doifelsenextoptionalcs\userdata_start_delayed_parameters\userdata_start_indeed}
+\unexpanded\def\userdata_start_instance[#1][#2]%
+ {\begingroup
+ \edef\currentuserdata{#1}%
+ \setupcurrentuserdata[#2]%
+ \grabbufferdatadirect
+ {\s!userdata:\currentuserdata}%
+ {\e!start\currentuserdata}%
+ {\e!stop \currentuserdata}}
+
\def\userdata_start_indeed
- {\grabbufferdatadirect\s!userdata{\csstring\startuserdata}{\csstring\stopuserdata}}
-
-% \unexpanded\def\stopuserdata
-% {\useuserdatastyleandcolor\c!style\c!color
-% \usealignparameter\userdataparameter
-% \edef\currentuserdataalternative{\userdataparameter\c!alternative}%
-% \ifcsname\currentuserdataalternativehash\s!parent\endcsname \else
-% \let\currentuserdataalternative\s!default
-% \fi
-% \edef\p_renderingsetup{\userdataalternativeparameter\c!renderingsetup}%
-% \directsetup\p_renderingsetup
-% \endgroup}
+ {\grabbufferdatadirect
+ {\s!userdata:\currentuserdata}%
+ {\csstring\startuserdata}%
+ {\csstring\stopuserdata}}
\unexpanded\def\stopuserdata
- {\userdataparameter\c!before % HH: moved, so we obey the outer spacing
- \dostarttagged\t!userdata\currentuserdata % HH: added, maybe move up ?
+ {\userdataparameter\c!before
+ \dostarttagged\t!userdata\currentuserdata
\begingroup
\useuserdatastyleandcolor\c!style\c!color
- \usealignparameter\userdataparameter % HH: added
+ \usealignparameter\userdataparameter
\edef\currentuserdataalternative{\userdataparameter\c!alternative}%
\ifcsname\currentuserdataalternativehash\s!parent\endcsname \else
\let\currentuserdataalternative\s!default
@@ -150,14 +146,13 @@
\directsetup\p_renderingsetup
\endgroup
\dostoptagged
- \userdataparameter\c!after % HH: moved
+ \userdataparameter\c!after
\endgroup}
-\unexpanded\def\getuserdata
- {\getbufferdata[\s!userdata]}
+\let\userdata_stop_instance\stopuserdata
-\unexpanded\def\getinlineuserdata
- {\inlinebuffer[\s!userdata]}
+\unexpanded\def\getuserdata {\getbufferdata[\s!userdata]}
+\unexpanded\def\getinlineuserdata{\inlinebuffer[\s!userdata]}
\defineuserdataalternative
[\s!default]
diff --git a/Master/texmf-dist/tex/context/base/mkiv/supp-box.lua b/Master/texmf-dist/tex/context/base/mkiv/supp-box.lua
index 4914b6818f1..2e7ca59244a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/supp-box.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/supp-box.lua
@@ -7,8 +7,6 @@ if not modules then modules = { } end modules ['supp-box'] = {
license = "see context related readme files"
}
--- this is preliminary code, use insert_before etc
-
local report_hyphenation = logs.reporter("languages","hyphenation")
local tonumber, next, type = tonumber, next, type
@@ -69,15 +67,15 @@ local setshift = nuts.setshift
local setsplit = nuts.setsplit
local setattrlist = nuts.setattrlist
-local flush_node = nuts.flush_node
-local flush_list = nuts.flush_list
+local flushnode = nuts.flushnode
+local flushlist = nuts.flushlist
local copy_node = nuts.copy
-local copy_list = nuts.copy_list
+local copylist = nuts.copylist
local find_tail = nuts.tail
local getdimensions = nuts.dimensions
local hpack = nuts.hpack
local vpack = nuts.vpack
-local traverse_id = nuts.traverse_id
+local traverseid = nuts.traverseid
local traverse = nuts.traverse
local free = nuts.free
local findtail = nuts.tail
@@ -118,7 +116,7 @@ local function hyphenatedlist(head,usecolor)
setlistcolor(post,"darkyellow")
end
if replace then
- flush_list(replace)
+ flushlist(replace)
end
setdisc(current)
if pre then
@@ -152,9 +150,9 @@ implement {
-- for n in nextdisc, tonut(head) do
-- local hyphen = getfield(n,"pre")
-- if hyphen then
--- flush_list(hyphen)
+-- flushlist(hyphen)
-- end
--- setfield(n,"pre",copy_list(pre))
+-- setfield(n,"pre",copylist(pre))
-- end
-- end
--
@@ -173,7 +171,7 @@ implement {
arguments = "integer",
actions = function(n)
-- we just hyphenate (as we pass a hpack) .. a bit too much casting but ...
- local l = languages.hyphenators.handler(tonode(checkedlist(n)))
+ local l = languages.hyphenators.handler(checkedlist(n))
report_hyphenation("show: %s",listtoutf(l,false,true))
end
}
@@ -200,7 +198,7 @@ local function applytowords(current,doaction,noaction,nested)
local id = getid(current)
if id == glue_code then
if start then
- doaction(tonode(copy_list(start,current)))
+ doaction(tonode(copylist(start,current)))
start = nil
end
noaction(tonode(copy_node(current)))
@@ -214,7 +212,7 @@ local function applytowords(current,doaction,noaction,nested)
current = getnext(current)
end
if start then
- doaction(tonode(copy_list(start)))
+ doaction(tonode(copylist(start)))
end
end
@@ -348,7 +346,7 @@ implement {
else
tail = prev
end
- flush_node(temp)
+ flushnode(temp)
end
-- done
setnext(tail)
@@ -430,7 +428,7 @@ local function setboxtonaturalwd(n)
local old = takebox(n)
local new = hpack(getlist(old))
setlist(old,nil)
- flush_node(old)
+ flushnode(old)
setbox(n,new)
end
@@ -482,20 +480,20 @@ end
do
- local nuts = nodes.nuts
- local tonode = nuts.tonode
- local takebox = nuts.takebox
- local flush_list = nuts.flush_list
- local copy_list = nuts.copy_list
- local getwhd = nuts.getwhd
- local setbox = nuts.setbox
- local new_hlist = nuts.pool.hlist
-
- local boxes = { }
- nodes.boxes = boxes
- local cache = table.setmetatableindex("table")
- local report = logs.reporter("boxes","cache")
- local trace = false
+ local nuts = nodes.nuts
+ local tonode = nuts.tonode
+ local takebox = nuts.takebox
+ local flushlist = nuts.flushlist
+ local copylist = nuts.copylist
+ local getwhd = nuts.getwhd
+ local setbox = nuts.setbox
+ local new_hlist = nuts.pool.hlist
+
+ local boxes = { }
+ nodes.boxes = boxes
+ local cache = table.setmetatableindex("table")
+ local report = logs.reporter("boxes","cache")
+ local trace = false
trackers.register("nodes.boxes",function(v) trace = v end)
@@ -528,7 +526,7 @@ do
if not b then
-- do nothing, maybe trace
elseif copy then
- b = copy_list(b)
+ b = copylist(b)
else
c[name] = false
end
@@ -545,13 +543,13 @@ do
local c = cache[category]
local b = takebox(box)
if b then
- flush_list(b)
+ flushlist(b)
end
local b = c[name]
if not b then
-- do nothing, maybe trace
elseif copy then
- b = copy_list(b)
+ b = copylist(b)
else
c[name] = false
end
@@ -577,7 +575,7 @@ do
if name and name ~= "" then
local b = c[name]
if b then
- flush_list(b)
+ flushlist(b)
c[name] = false
end
if trace then
@@ -586,7 +584,7 @@ do
else
for k, b in next, c do
if b then
- flush_list(b)
+ flushlist(b)
end
end
cache[category] = { }
@@ -697,7 +695,7 @@ local function stripglue(list)
if first and first ~= list then
-- we have discardables
setsplit(getprev(first),first)
- flush_list(list)
+ flushlist(list)
list = first
done = true
end
@@ -714,7 +712,7 @@ local function stripglue(list)
end
if last ~= tail then
-- we have discardables
- flush_list(getnext(last))
+ flushlist(getnext(last))
setnext(last)
done = true
end
@@ -767,7 +765,7 @@ local function limitate(t) -- don't pack the result !
else
maxleft = maxleft - swidth
end
- for n in traverse_id(glue_code,list) do
+ for n in traverseid(glue_code,list) do
local width = getdimensions(list,n)
if width > maxleft then
if not last then
@@ -779,7 +777,7 @@ local function limitate(t) -- don't pack the result !
end
end
if last and maxright > 0 then
- for n in traverse_id(glue_code,last) do
+ for n in traverseid(glue_code,last) do
local width = getdimensions(n)
if width < maxright then
first = n
@@ -808,7 +806,7 @@ local function limitate(t) -- don't pack the result !
end
setlink(last,sentinel)
setprev(rest)
- flush_list(rest)
+ flushlist(rest)
end
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/symb-imp-was.mkiv b/Master/texmf-dist/tex/context/base/mkiv/symb-imp-was.mkiv
new file mode 100644
index 00000000000..424e60b653f
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/symb-imp-was.mkiv
@@ -0,0 +1,206 @@
+%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 Converted to \MKIV\ by Hans but not yet complete.
+
+\unprotect
+
+\definefontsynonym [WaldiSymbol] [wasy10]
+\definefontsynonym [WaldiSymbolBold] [wasyb10]
+
+% \def\wasy@over#1#2{{\setbox0\hbox{$#2$}\hbox to \wd0{\hss$#1$\hss}\kern-\wd0\box0}}
+
+\def\WaldiSymbol {\getnamedglyphdirect{WaldiSymbol}} % #1
+\def\WaldiSymbol#1{\getglyph{WaldiSymbol}{\fontchar{#1}}}
+
+% general symbols
+
+\startsymbolset [wasy general]
+ \definesymbol [male] [\WaldiSymbol{male}]
+ \definesymbol [female] [\WaldiSymbol{female}]
+ \definesymbol [currency] [\WaldiSymbol{currency}]
+ \definesymbol [cent] [\WaldiSymbol{cent}]
+ \definesymbol [lozenge] [\WaldiSymbol{lozenge}]
+ \definesymbol [kreuz] [\WaldiSymbol{kreuz}]
+ \definesymbol [smiley] [\WaldiSymbol{smiley}]
+ \definesymbol [blacksmiley] [\WaldiSymbol{blacksmil}]
+ \definesymbol [frownie] [\WaldiSymbol{frownie}]
+ \definesymbol [sun] [\WaldiSymbol{sun}]
+ \definesymbol [checked] [\WaldiSymbol{checked}]
+ \definesymbol [brokenvert] [\WaldiSymbol{brokenver}]
+ \definesymbol [diameter] [\WaldiSymbol{diameter}]
+ \definesymbol [invdiameter] [\WaldiSymbol{invdiamet}]
+ \definesymbol [phone] [\WaldiSymbol{phone}]
+ \definesymbol [recorder] [\WaldiSymbol{recorder}]
+ \definesymbol [clock] [\WaldiSymbol{clock}]
+ \definesymbol [permil] [\WaldiSymbol{permil}]
+ \definesymbol [bell] [\WaldiSymbol{bell}]
+ \definesymbol [ataribox] [\WaldiSymbol{ataribox}]
+ \definesymbol [pointer] [\WaldiSymbol{pointer}]
+ \definesymbol [lightning] [\WaldiSymbol{lightning}]
+ \definesymbol [agemO] [\WaldiSymbol{agemO}]
+\stopsymbolset
+
+\startsymbolset [wasy music]
+ \definesymbol [eighthnote] [\WaldiSymbol{eighthnote}]
+ \definesymbol [quarternote] [\WaldiSymbol{quarternote}]
+ \definesymbol [halfnote] [\WaldiSymbol{halfnote}]
+ \definesymbol [fullnote] [\WaldiSymbol{fullnote}]
+ \definesymbol [twonotes] [\WaldiSymbol{twonotes}]
+\stopsymbolset
+
+\startsymbolset [wasy astronomy]
+ \definesymbol [ascnode] [\WaldiSymbol{ascnode}]
+ \definesymbol [descnode] [\WaldiSymbol{descnode}]
+ \definesymbol [astrosun] [\WaldiSymbol{astrosun}]
+ \definesymbol [sun] [\WaldiSymbol{sun}]
+ \definesymbol [newmoon] [\WaldiSymbol{newmoon}]
+ \definesymbol [fullmoon] [\WaldiSymbol{fullmoon}]
+ \definesymbol [rightmoon] [\WaldiSymbol{rightmoon}]
+ \definesymbol [leftmoon] [\WaldiSymbol{leftmoon}]
+ \definesymbol [vernal] [\WaldiSymbol{vernal}]
+ \definesymbol [mercury] [\WaldiSymbol{mercury}]
+ \definesymbol [mars] [\WaldiSymbol{mars}]
+ \definesymbol [saturn] [\WaldiSymbol{saturn}]
+ \definesymbol [neptune] [\WaldiSymbol{neptune}]
+ \definesymbol [earth] [\WaldiSymbol{earth}]
+ \definesymbol [venus] [\WaldiSymbol{venus}]
+ \definesymbol [jupiter] [\WaldiSymbol{jupiter}]
+ \definesymbol [uranus] [\WaldiSymbol{uranus}]
+ \definesymbol [pluto] [\WaldiSymbol{pluto}]
+\stopsymbolset
+
+\startsymbolset [wasy astrology]
+ \definesymbol [conjunction] [\WaldiSymbol{conjunction}]
+ \definesymbol [opposition] [\WaldiSymbol{opposition}]
+ \definesymbol [aries] [\WaldiSymbol{aries}]
+ \definesymbol [libra] [\WaldiSymbol{libra}]
+ \definesymbol [taurus] [\WaldiSymbol{taurus}]
+ \definesymbol [scorpio] [\WaldiSymbol{scorpio}]
+ \definesymbol [gemini] [\WaldiSymbol{gemini}]
+ \definesymbol [sagittarius] [\WaldiSymbol{sagittarius}]
+ \definesymbol [cancer] [\WaldiSymbol{cancer}]
+ \definesymbol [capricornus] [\WaldiSymbol{capricornus}]
+ \definesymbol [leo] [\WaldiSymbol{leo}]
+ \definesymbol [aquarius] [\WaldiSymbol{aquarius}]
+ \definesymbol [virgo] [\WaldiSymbol{virgo}]
+ \definesymbol [pisces] [\WaldiSymbol{pisces}]
+\stopsymbolset
+
+\startsymbolset [wasy geometry]
+ \definesymbol [fivestar] [\WaldiSymbol{fivestar}] % HHR additional
+ \definesymbol [hexstar] [\WaldiSymbol{hexstar}]
+ \definesymbol [varhexstar] [\WaldiSymbol{varhexstar}]
+ \definesymbol [davidsstar] [\WaldiSymbol{davidsstar}]
+ \definesymbol [Circle] [\WaldiSymbol{Circle}]
+ \definesymbol [CIRCLE] [\WaldiSymbol{CIRCLE}]
+ \definesymbol [Leftcircle] [\WaldiSymbol{Leftcircle}]
+ \definesymbol [LEFTCIRCLE] [\WaldiSymbol{LEFTCIRCLE}]
+ \definesymbol [Rightcircle] [\WaldiSymbol{Rightcircle}]
+ \definesymbol [RIGHTCIRCLE] [\WaldiSymbol{RIGHTCIRCLE}]
+% \definesymbol [LEFTcircle] [\dontleavehmode\hbox to \zeropoint{\WaldiSymbol {LEFTCIRCLE}\hss}\WaldiSymbol{Circle}]
+% \definesymbol [RIGHTcircle] [\dontleavehmode\hbox to \zeropoint{\WaldiSymbol{RIGHTCIRCLE}\hss}\WaldiSymbol{Circle}]
+ \definesymbol [LEFTarrow] [\WaldiSymbol{LEFTarrow}]
+ \definesymbol [RIGHTarrow] [\WaldiSymbol{RIGHTarrow}]
+ \definesymbol [UParrow] [\WaldiSymbol{UParrow}]
+ \definesymbol [DOWNarrow] [\WaldiSymbol{DOWNarrow}]
+ \definesymbol [Box] [\WaldiSymbol{Box}]
+ \definesymbol [APLbox] [\WaldiSymbol{APLbox}]
+ \definesymbol [XBox] [\WaldiSymbol{XBox}]
+ \definesymbol [Bowtie] [\WaldiSymbol{Bowtie}]
+ \definesymbol [Diamond] [\WaldiSymbol{Diamond}]
+ \definesymbol [octagon] [\WaldiSymbol{octagon}]
+ \definesymbol [hexagon] [\WaldiSymbol{hexagon}]
+ \definesymbol [varhexagon] [\WaldiSymbol{varhexagon}]
+ \definesymbol [pentagon] [\WaldiSymbol{pentagon}]
+% \definesymbol [pentastar] [\dontleavehmode\hbox to \zeropoint{\WaldiSymbol{pentagon}\hss}\lower.04em\hbox{\WaldiSymbol{fivestar}}]
+\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
+
+\protect
+
+\continueifinputfile{symb-imp-was.mkiv}
+
+\usemodule[article-basic]
+
+\starttext
+
+\starttitle[title=Regular]
+
+ \startsubject[title={wasy general}] \showsymbolset[wasy general] \stopsubject
+ \startsubject[title={wasy music}] \showsymbolset[wasy music] \stopsubject
+ \startsubject[title={wasy astronomy}] \showsymbolset[wasy astronomy] \stopsubject
+ \startsubject[title={wasy astrology}] \showsymbolset[wasy astrology] \stopsubject
+ \startsubject[title={wasy geometry}] \showsymbolset[wasy geometry] \stopsubject
+
+\stoptitle
+
+\starttitle[title=Bold]
+
+ \startsubject[title={wasy general}] \start \bf \showsymbolset[wasy general] \stop \stopsubject
+ \startsubject[title={wasy music}] \start \bf \showsymbolset[wasy music] \stop \stopsubject
+ \startsubject[title={wasy astronomy}] \start \bf \showsymbolset[wasy astronomy] \stop \stopsubject
+ \startsubject[title={wasy astrology}] \start \bf \showsymbolset[wasy astrology] \stop \stopsubject
+ \startsubject[title={wasy geometry}] \start \bf \showsymbolset[wasy geometry] \stop \stopsubject
+
+\stoptitle
+
+
+% \startsubject[title={wasy physics}] \showsymbolset[wasy physics] \stopsubject
+% \startsubject[title={wasy apl}] \showsymbolset[wasy apl] \stopsubject
+
+\stoptext
+
diff --git a/Master/texmf-dist/tex/context/base/mkiv/syst-aux.mkiv b/Master/texmf-dist/tex/context/base/mkiv/syst-aux.mkiv
index 194f1de2cb1..44668dcc98d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/syst-aux.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/syst-aux.mkiv
@@ -1470,10 +1470,20 @@
% replaces prev
+% \protected\def\syst_helpers_do_if_in_string_else#1#2% ##2 can be {abc}
+% {\expandafter\def\expandafter\syst_helpers_do_do_if_in_string_else
+% \expandafter##\expandafter1#1##2##3^^^^0004{\unless\if##2@}% expand #1 here
+% \expandafter\syst_helpers_do_do_if_in_string_else\normalexpanded{#2#1}@@^^^^0004} % expand #2 here
+
\protected\def\syst_helpers_do_if_in_string_else#1#2% ##2 can be {abc}
{\expandafter\def\expandafter\syst_helpers_do_do_if_in_string_else
- \expandafter##\expandafter1#1##2##3^^^^0004{\unless\if##2@}% expand #1 here
- \expandafter\syst_helpers_do_do_if_in_string_else\normalexpanded{#2#1}@@^^^^0004} % expand #2 here
+ \expandafter##\expandafter1#1##2##3^^^^0004{\unless\ifx##2^^^^0003}% expand #1 here
+ \expandafter\syst_helpers_do_do_if_in_string_else\normalexpanded{#2#1}^^^^0003^^^^0003^^^^0004} % expand #2 here
+
+% \protected\def\syst_helpers_do_if_in_string_else#1#2% ##2 can be {abc}
+% {\normalexpanded{\def\noexpand\syst_helpers_do_do_if_in_string_else
+% ##1#1##2##3}^^^^0004{\unless\ifx##2^^^^0003}% expand #1 here
+% \normalexpanded{\noexpand\syst_helpers_do_do_if_in_string_else#2#1}^^^^0003^^^^0003^^^^0004} % expand #2 here
%D The next alternative proved to be upto twice as fast on tasks like checking
%D reserved words in pretty verbatim typesetting! This is mainly due to the fact
@@ -1486,10 +1496,15 @@
%D Where \type {\doifinstringelse} does as much expansion as possible, the latter
%D alternative does minimal (one level) expansion.
+% \protected\def\syst_helpers_do_if_in_csname_else#1#2%
+% {\def\syst_helpers_do_do_if_in_csname_else##1#1##2##3^^^^0004%
+% {\unless\if##2@}%
+% \expandafter\syst_helpers_do_do_if_in_csname_else#2#1@@^^^^0004}
+
\protected\def\syst_helpers_do_if_in_csname_else#1#2%
{\def\syst_helpers_do_do_if_in_csname_else##1#1##2##3^^^^0004%
- {\unless\if##2@}%
- \expandafter\syst_helpers_do_do_if_in_csname_else#2#1@@^^^^0004}
+ {\unless\ifx##2^^^^0003}%
+ \expandafter\syst_helpers_do_do_if_in_csname_else#2#1^^^^0003^^^^0003^^^^0004}
\protected\def\doifelseincsname#1#2%
{\normalexpanded{\syst_helpers_do_if_in_csname_else{#1}}{#2}%
diff --git a/Master/texmf-dist/tex/context/base/mkiv/syst-con.lua b/Master/texmf-dist/tex/context/base/mkiv/syst-con.lua
index 6e998bdfd5e..6a11fa8d3c6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/syst-con.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/syst-con.lua
@@ -35,7 +35,7 @@ local f_uchexnumber = formatters["%X"]
local f_lchexnumbers = formatters["%02x"]
local f_uchexnumbers = formatters["%02X"]
local f_octnumber = formatters["%03o"]
-local nicenumber = formatters["%0.6F"]
+local nicenumber = formatters["%0.6F"] -- or N
local lchexnumber = function(n) if n < 0 then n = 0x100000000 + n end return f_lchexnumber (n) end
local uchexnumber = function(n) if n < 0 then n = 0x100000000 + n end return f_uchexnumber (n) end
@@ -74,7 +74,7 @@ implement { name = "tand", actions = { math.tand, nicenumber, context }, argumen
function commands.format(fmt,...) context((gsub(fmt,"@","%%")),...) end
implement {
- name = "formatone",
+ name = "formatone", -- used as such so no name change here
public = true,
protected = true,
arguments = "2 strings",
diff --git a/Master/texmf-dist/tex/context/base/mkiv/syst-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/syst-ini.mkiv
index aafbc787e5e..ae1978eb6d7 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/syst-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/syst-ini.mkiv
@@ -589,7 +589,7 @@
\protected\def\defUmathbotaccent #1#2#3#4{\global\instance\protected\def#1{\Umathbotaccent "#2 "#3 "#4 }}
\protected\def\defUdelimiterover #1#2#3#4{\global\instance\protected\def#1{\Udelimiterover "#2 "#3 }}
\protected\def\defUdelimiterunder #1#2#3#4{\global\instance\protected\def#1{\Udelimiterunder "#2 "#3 }}
-\protected\def\defUdelimiter #1#2#3#4{\global\instance\protected\def#1{\Udelimiter "#2 "#2 "#4 }}
+\protected\def\defUdelimiter #1#2#3#4{\global\instance\protected\def#1{\Udelimiter "#2 "#3 "#4 }}
\protected\def\defUradical #1#2#3{\global\instance\protected\def#1{\Uradical "#2 "#3 }}
\protected\def\defUroot #1#2#3{\global\instance\protected\def#1{\Uroot "#2 "#3 }}
\protected\def\defUmathchar #1#2#3#4{\global\instance\Umathchardef #1 "#2 "#3 "#4 }
@@ -1240,4 +1240,25 @@
\let\nexttoken\relax
+%D We need to disable this feature (comes from pdftex) because it not only messes up
+%D the nested content and wrappers (like in the page builder) but also is rather
+%D confusing wrt grouping. In \CONTEXT\ we don't redefine \type {\par} anyway, so
+%D best not expose this feature.
+
+\ifdefined\partokenname
+ \let\partokencontext\relax
+ \newcount\partokencontext
+ \let\partokenname\gobbleoneargument
+\fi
+
+%D In case we load \LMTX\ code.
+
+\ifdefined\autoparagraphmode \else
+ \newcount\autoparagraphmode
+\fi
+
+\let\advanceby \advance
+\let\multiplyby\multiply
+\let\divideby \divide
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/syst-lua.lua b/Master/texmf-dist/tex/context/base/mkiv/syst-lua.lua
index 085f75eca92..fa980aa7682 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/syst-lua.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/syst-lua.lua
@@ -17,18 +17,15 @@ local xcomplex = xcomplex or { }
local cmd = tokens.commands
-local scan_next = token.scan_next or token.get_next
-local scan_cmdchr = token.scan_cmdchr_expanded
+local scannext = token.scan_next or token.get_next
-local get_command = token.get_command
-local get_mode = token.get_mode
-local get_index = token.get_index
-local get_csname = token.get_csname
-local get_macro = token.get_macro
-
-local put_next = token.put_next
-
-local scan_token = token.scan_token or token.get_token
+local getcommand = token.get_command
+local getmode = token.get_mode
+local getindex = token.get_index
+local getcsname = token.get_csname
+local getmacro = token.get_macro
+local putnext = token.put_next
+local scantoken = token.scan_token or token.get_token
local getdimen = tex.getdimen
local getglue = tex.getglue
@@ -194,7 +191,9 @@ implement {
do
- local result = { "return " }
+ local result = CONTEXTLMTXMODE > 0 and
+ { "local xmath = xmath local xcomplex = xcomplex return " }
+ or { "local xmath = math local xcomplex = { } return " }
local word = { }
local r = 1
local w = 0
@@ -209,12 +208,12 @@ do
local w = 0
local r = 1
while true do
- local t = scan_next()
- local n = get_command(t)
+ local t = scannext()
+ local n = getcommand(t)
local c = cmd[n]
-- todo, helper: returns number
if c == "letter" then
- w = w + 1 ; word[w] = utfchar(get_mode(t))
+ w = w + 1 ; word[w] = utfchar(getmode(t))
else
if w > 0 then
local s = concat(word,"",1,w)
@@ -233,23 +232,23 @@ do
w = 0
end
if c == "other_char" then
- r = r + 1 ; result[r] = utfchar(get_mode(t))
+ r = r + 1 ; result[r] = utfchar(getmode(t))
elseif c == "spacer" then
-- r = r + 1 ; result[r] = " "
elseif c == "relax" then
break
elseif c == "assign_int" then
- r = r + 1 ; result[r] = getcount(get_index(t))
+ r = r + 1 ; result[r] = getcount(getindex(t))
elseif c == "assign_dimen" then
- r = r + 1 ; result[r] = getdimen(get_index(t))
+ r = r + 1 ; result[r] = getdimen(getindex(t))
elseif c == "assign_glue" then
- r = r + 1 ; result[r] = getglue(get_index(t))
+ r = r + 1 ; result[r] = getglue(getindex(t))
elseif c == "assign_toks" then
- r = r + 1 ; result[r] = gettoks(get_index(t))
+ r = r + 1 ; result[r] = gettoks(getindex(t))
elseif c == "char_given" or c == "math_given" or c == "xmath_given" then
- r = r + 1 ; result[r] = get_mode(t)
+ r = r + 1 ; result[r] = getmode(t)
elseif c == "last_item" then
- local n = get_csname(t)
+ local n = getcsname(t)
if n then
local s = gettex(n)
if s then
@@ -261,9 +260,9 @@ do
unexpected(c)
end
elseif c == "call" then
- local n = get_csname(t)
+ local n = getcsname(t)
if n then
- local s = get_macro(n)
+ local s = getmacro(n)
if s then
r = r + 1 ; result[r] = s
else
@@ -273,8 +272,8 @@ do
unexpected(c)
end
elseif c == "the" or c == "convert" or c == "lua_expandable_call" then
- put_next(t)
- scan_token() -- expands
+ putnext(t)
+ scantoken() -- expands
else
unexpected(c)
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/syst-lua.mkiv b/Master/texmf-dist/tex/context/base/mkiv/syst-lua.mkiv
index f0902eaf58b..327d1d407f6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/syst-lua.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/syst-lua.mkiv
@@ -73,8 +73,8 @@
%D We can omit the tex.ctxcatcodes here as nowadays we seldom change the regime at
%D the \TEX\ end:
-%def\luaexpr#1{\ctxlua{context (tostring(#1))}} % more efficient:
-\def\luaexpr#1{\ctxlua{tex.print(tostring(#1))}} % no use is shortcutting has to be compiled
+%def\luaexpr#1{\ctxlua{context (tostring(#1))}} % more efficient:
+\def\luaexpr#1{\ctxlua{tex.print(tostring(#1))}} % no use in shortcutting has to be compiled
%D But as we only use write 16 we could as well do all in \LUA\ and ignore the rest.
%D Okay, we still can do writes here but only when not blocked.
diff --git a/Master/texmf-dist/tex/context/base/mkiv/tabl-xtb.lua b/Master/texmf-dist/tex/context/base/mkiv/tabl-xtb.lua
index c9dd1e4e519..32770141bac 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/tabl-xtb.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/tabl-xtb.lua
@@ -73,9 +73,9 @@ local setlink = nuts.setlink
local setdirection = nuts.setdirection
local setshift = nuts.setshift
-local copy_node_list = nuts.copy_list
-local hpack_node_list = nuts.hpack
-local flush_node_list = nuts.flush_list
+local copynodelist = nuts.copylist
+local hpacknodelist = nuts.hpack
+local flushnodelist = nuts.flushlist
local takebox = nuts.takebox
local nodepool = nuts.pool
@@ -273,7 +273,7 @@ function xtables.set_reflow_width()
local tb = getbox("b_tabl_x")
local drc = row[c]
--
- drc.list = true -- we don't need to keep the content around as we're in trial mode (no: copy_node_list(tb))
+ drc.list = true -- we don't need to keep the content around as we're in trial mode (no: copynodelist(tb))
--
local width, height, depth = getwhd(tb)
--
@@ -561,7 +561,7 @@ function xtables.reflow_width()
for c=1,nofcolumns do
local drc = row[c]
if drc.list then
- -- flush_node_list(drc.list)
+ -- flushnodelist(drc.list)
drc.list = false
end
end
@@ -853,7 +853,7 @@ function xtables.construct()
if list then
local w, h, d = getwhd(list)
setshift(list,h+d)
- -- list = hpack_node_list(list) -- is somehow needed
+ -- list = hpacknodelist(list) -- is somehow needed
-- setwhd(list,0,0,0)
-- faster:
local h = new_hlist(list)
@@ -900,9 +900,9 @@ function xtables.construct()
end
nofr = nofr + 1
local rp = rowproperties[r]
- -- we have a direction issue here but hpack_node_list(list,0,"exactly") cannot be used
+ -- we have a direction issue here but hpacknodelist(list,0,"exactly") cannot be used
-- due to the fact that we need the width
- local hbox = hpack_node_list(list)
+ local hbox = hpacknodelist(list)
setdirection(hbox,lefttoright_code)
result[nofr] = {
hbox,
@@ -949,7 +949,7 @@ end
local function inject(row,copy,package)
local list = row[1]
if copy then
- row[1] = copy_node_list(list)
+ row[1] = copynodelist(list)
end
if package then
ctx_beginvbox()
@@ -1186,7 +1186,7 @@ end
function xtables.cleanup()
for mode, result in next, data.results do
for _, r in next, result do
- flush_node_list(r[1])
+ flushnodelist(r[1])
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/tabl-xtb.mkvi b/Master/texmf-dist/tex/context/base/mkiv/tabl-xtb.mkvi
index c5042a405bd..c340efdfad0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/tabl-xtb.mkvi
+++ b/Master/texmf-dist/tex/context/base/mkiv/tabl-xtb.mkvi
@@ -267,7 +267,7 @@
}% else whitespace mess
\def\tabl_x_get_buffer
- {\clf_gettexbuffer{\tabl_x_current_buffer}}
+ {\clf_getbuffertex{\tabl_x_current_buffer}}
\let\tabl_x_start_row_yes \relax
\let\tabl_x_start_row_nop \relax
@@ -392,11 +392,24 @@
% in text flow: headers and footers get repeated
-\setvalue{\??xtableflushsplit\v!repeat}%
+% \setvalue{\??xtableflushsplit\v!repeat}%
+% {\doloop
+% {\clf_x_table_flush
+% method {\v!split}%
+% height \ifdim\pagegoal=\maxdimen\textheight\else\pagegoal\fi
+% \relax
+% \ifcase\c_tabl_x_state
+% \exitloop
+% \else
+% \page
+% \fi}}
+
+\defcsname\??xtableflushsplit\v!repeat\endcsname
{\doloop
- {\clf_x_table_flush
+ {\testpage[5]% for now hard coded, just as the \lineheight below, see mail end of april 2021
+ \clf_x_table_flush
method {\v!split}%
- height \ifdim\pagegoal=\maxdimen\textheight\else\pagegoal\fi
+ height \ifdim\pagegoal=\maxdimen\textheight\else\dimexpr\pagegoal-\pagetotal-\lineheight\relax\fi
\relax
\ifcase\c_tabl_x_state
\exitloop
diff --git a/Master/texmf-dist/tex/context/base/mkiv/task-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/task-ini.lua
index 3e78fb2f9c8..3697a4086e7 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/task-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/task-ini.lua
@@ -65,13 +65,8 @@ appendaction("processors", "lists", "typesetters.kerns.handler",
appendaction("processors", "lists", "typesetters.digits.handler", nil, "nut", "disabled" )
appendaction("processors", "lists", "typesetters.italics.handler", nil, "nut", "disabled" )
appendaction("processors", "lists", "languages.visualizediscretionaries", nil, "nut", "disabled" )
-
-if CONTEXTLMTXMODE == 0 then
-
appendaction("processors", "lists", "nodes.handlers.migrate", nil, "nut", "disabled" )
-end
-
appendaction("processors", "after", "typesetters.marksuspects", nil, "nut", "disabled" )
appendaction("shipouts", "normalizers", "nodes.handlers.cleanuppage", nil, "nut", "production")
@@ -120,16 +115,14 @@ appendaction("math", "normalizers", "noads.handlers.italics",
appendaction("math", "normalizers", "noads.handlers.kernpairs", nil, "nonut", "disabled" )
appendaction("math", "normalizers", "noads.handlers.classes", nil, "nonut", "disabled" )
-appendaction("math", "builders", "builders.kernel.mlist_to_hlist", nil, "nut", "enabled" ) -- mandate
+appendaction("math", "builders", "builders.kernel.mlisttohlist", nil, "nut", "enabled" ) -- mandate
appendaction("math", "builders", "typesetters.directions.processmath", nil, "nut", "disabled" )
appendaction("math", "builders", "noads.handlers.makeup", nil, "nonut", "disabled" )
appendaction("math", "builders", "noads.handlers.align", nil, "nonut", "enabled" )
-if CONTEXTLMTXMODE == 0 then
-
appendaction("finalizers", "lists", "typesetters.paragraphs.normalize", nil, "nut", "enabled" ) -- "disabled"
-
-end
+appendaction("finalizers", "lists", "nodes.handlers.showhyphenation", nil, "nut", "disabled" )
+appendaction("finalizers", "lists", "nodes.handlers.visualizehyphenation", nil, "nut", "disabled" )
appendaction("finalizers", "lists", "typesetters.margins.localhandler", nil, "nut", "disabled" )
appendaction("finalizers", "lists", "builders.paragraphs.keeptogether", nil, "nut", "disabled" )
@@ -137,9 +130,11 @@ appendaction("finalizers", "fonts", "builders.paragraphs.solutions.split
appendaction("finalizers", "lists", "builders.paragraphs.tag", nil, "nut", "disabled" )
appendaction("finalizers", "lists", "nodes.linefillers.handler", nil, "nut", "disabled" )
+
appendaction("contributers", "normalizers", "nodes.handlers.flattenline", nil, "nut", "disabled" )
appendaction("contributers", "normalizers", "nodes.handlers.textbackgrounds", nil, "nut", "disabled" )
+
appendaction("vboxbuilders", "normalizers", "nodes.handlers.backgroundsvbox", nil, "nut", "disabled" )
------------("vboxbuilders", "normalizers", "typesetters.margins.localhandler", nil, "nut", "disabled" )
appendaction("vboxbuilders", "normalizers", "builders.vspacing.vboxhandler", nil, "nut", "enabled" )
diff --git a/Master/texmf-dist/tex/context/base/mkiv/toks-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/toks-ini.lua
index 7120b47c3cd..96bf7d7b90c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/toks-ini.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/toks-ini.lua
@@ -22,49 +22,49 @@ local commands = token.commands()
tokens.commands = utilities.storage.allocate(table.swapped(commands,commands))
tokens.values = { }
-local scan_toks = token.scan_toks
-local scan_string = token.scan_string
-local scan_argument = token.scan_argument
-local scan_delimited = token.scan_delimited
-local scan_tokenlist = token.scan_tokenlist or scan_string
-local scan_integer = token.scan_integer or token.scan_int
-local scan_cardinal = token.scan_cardinal
-local scan_code = token.scan_code
-local scan_token_code = token.scan_token_code
-local scan_dimen = token.scan_dimen
-local scan_glue = token.scan_glue
-local scan_skip = token.scan_skip
-local scan_keyword = token.scan_keyword
-local scan_keyword_cs = token.scan_keyword_cs or scan_keyword
-local scan_token = token.scan_token
-local scan_box = token.scan_box
-local scan_word = token.scan_word
-local scan_letters = token.scan_letters or scan_word -- lmtx
-local scan_key = token.scan_key
-local scan_value = token.scan_value
-local scan_char = token.scan_char
-local scan_number = token.scan_number -- not defined
-local scan_csname = token.scan_csname
-local scan_real = token.scan_real
-local scan_float = token.scan_float
-local scan_luanumber = token.scan_luanumber or scan_float -- only lmtx
-local scan_luainteger = token.scan_luainteger or scan_integer -- only lmtx
-local scan_luacardinal = token.scan_luacardinal or scan_cardinal -- only lmtx
-
-local set_macro = token.set_macro
-local set_char = token.set_char
-local set_lua = token.set_lua
-
-local create_token = token.create
-local new_token = token.new
-local is_defined = token.is_defined
-local is_token = token.is_token
-
-tokens.new = new_token
-tokens.create = create_token
-tokens.istoken = is_token
-tokens.isdefined = is_defined
-tokens.defined = is_defined
+local scantoks = token.scan_toks
+local scanstring = token.scan_string
+local scanargument = token.scan_argument
+local scandelimited = token.scan_delimited
+local scantokenlist = token.scan_tokenlist or scanstring
+local scaninteger = token.scan_integer or token.scan_int
+local scancardinal = token.scan_cardinal
+local scancode = token.scan_code
+local scantokencode = token.scan_token_code
+local scandimen = token.scan_dimen
+local scanglue = token.scan_glue
+local scanskip = token.scan_skip
+local scankeyword = token.scan_keyword
+local scankeywordcs = token.scan_keyword_cs or scankeyword
+local scantoken = token.scan_token
+local scanbox = token.scan_box
+local scanword = token.scan_word
+local scanletters = token.scan_letters or scanword -- lmtx
+local scankey = token.scan_key
+local scanvalue = token.scan_value
+local scanchar = token.scan_char
+local scannumber = token.scan_number -- not defined
+local scancsname = token.scan_csname
+local scanreal = token.scan_real
+local scanfloat = token.scan_float
+local scanluanumber = token.scan_luanumber or scanfloat -- only lmtx
+local scanluainteger = token.scan_luainteger or scaninteger -- only lmtx
+local scanluacardinal = token.scan_luacardinal or scancardinal -- only lmtx
+
+local setmacro = token.set_macro
+local setchar = token.set_char
+local setlua = token.set_lua
+
+local createtoken = token.create
+local newtoken = token.new
+local isdefined = token.is_defined
+local istoken = token.is_token
+
+tokens.new = newtoken
+tokens.create = createtoken
+tokens.istoken = istoken
+tokens.isdefined = isdefined
+tokens.defined = isdefined
local bits = {
escape = 0x00000001, -- 2^00
@@ -98,10 +98,10 @@ tokens.bits = bits
-- words are space or \relax terminated and the trailing space is gobbled; a word
-- can contain any non-space letter/other (see archive for implementation in lua)
-if not scan_number then
+if not scannumber then
- scan_number = function(base)
- local s = scan_word()
+ scannumber = function(base)
+ local s = scanword()
if not s then
return nil
elseif base then
@@ -113,8 +113,8 @@ if not scan_number then
end
-local function scan_boolean()
- local kw = scan_word()
+local function scanboolean()
+ local kw = scanword()
if kw == "true" then
return true
elseif kw == "false" then
@@ -124,64 +124,64 @@ local function scan_boolean()
end
end
-local function scan_verbatim()
- return scan_argument(false)
+local function scanverbatim()
+ return scanargument(false)
end
-if not scan_box then
+if not scanbox then
- local scan_list = token.scan_list
- local put_next = token.put_next
+ local scanlist = token.scan_list
+ local putnext = token.put_next
- scan_box = function(s)
+ scanbox = function(s)
if s == "hbox" or s == "vbox" or s == "vtop" then
- put_next(create_token(s))
+ putnext(createtoken(s))
end
- return scan_list()
+ return scanlist()
end
- token.scan_box = scan_box
+ token.scanbox = scanbox
end
tokens.scanners = { -- these expand
- token = scan_token,
- toks = scan_toks,
- tokens = scan_toks,
- box = scan_box,
- hbox = function() return scan_box("hbox") end,
- vbox = function() return scan_box("vbox") end,
- vtop = function() return scan_box("vtop") end,
- dimen = scan_dimen,
- dimension = scan_dimen,
- glue = scan_glue,
- gluevalues = function() return scan_glue(false,false,true) end,
- gluespec = scan_skip,
- integer = scan_integer,
- cardinal = scan_cardinal,
- real = scan_real,
- float = scan_float,
- luanumber = scan_luanumber,
- luainteger = scan_luainteger,
- luacardinal = scan_luacardinal,
- count = scan_integer,
- string = scan_string,
- argument = scan_argument,
- delimited = scan_delimited,
- tokenlist = scan_tokenlist,
- verbatim = scan_verbatim, -- detokenize
- code = scan_code,
- tokencode = scan_token_code,
- word = scan_word,
- letters = scan_letters,
- key = scan_key,
- value = scan_value,
- char = scan_char,
- number = scan_number,
- boolean = scan_boolean,
- keyword = scan_keyword,
- keywordcs = scan_keyword_cs,
- csname = scan_csname,
+ token = scantoken,
+ toks = scantoks,
+ tokens = scantoks,
+ box = scanbox,
+ hbox = function() return scanbox("hbox") end,
+ vbox = function() return scanbox("vbox") end,
+ vtop = function() return scanbox("vtop") end,
+ dimen = scandimen,
+ dimension = scandimen,
+ glue = scanglue,
+ gluevalues = function() return scanglue(false,false,true) end,
+ gluespec = scanskip,
+ integer = scaninteger,
+ cardinal = scancardinal,
+ real = scanreal,
+ float = scanfloat,
+ luanumber = scanluanumber,
+ luainteger = scanluainteger,
+ luacardinal = scanluacardinal,
+ count = scaninteger,
+ string = scanstring,
+ argument = scanargument,
+ delimited = scandelimited,
+ tokenlist = scantokenlist,
+ verbatim = scanverbatim, -- detokenize
+ code = scancode,
+ tokencode = scantokencode,
+ word = scanword,
+ letters = scanletters,
+ key = scankey,
+ value = scanvalue,
+ char = scanchar,
+ number = scannumber,
+ boolean = scanboolean,
+ keyword = scankeyword,
+ keywordcs = scankeywordcs,
+ csname = scancsname,
next = token.scan_next,
nextexpanded = token.scan_next_expanded,
@@ -214,9 +214,9 @@ tokens.getters = { -- these don't expand
}
tokens.setters = {
- macro = set_macro,
- char = set_char,
- lua = set_lua,
+ macro = setmacro,
+ char = setchar,
+ lua = setlua,
count = tex.setcount,
dimen = tex.setdimen,
skip = tex.setglue,
@@ -226,7 +226,7 @@ tokens.setters = {
box = tex.setbox,
}
-token.accessors = {
+tokens.accessors = {
command = token.get_command,
cmd = token.get_command,
cmdname = token.get_cmdname,
@@ -243,33 +243,12 @@ token.accessors = {
range = token.get_range,
}
--- static int run_scan_token(lua_State * L)
--- {
--- saved_tex_scanner texstate;
--- save_tex_scanner(texstate);
--- get_x_token();
--- make_new_token(L, cur_cmd, cur_chr, cur_cs);
--- unsave_tex_scanner(texstate);
--- return 1;
--- }
---
--- static int run_get_future(lua_State * L)
--- {
--- /* saved_tex_scanner texstate; */
--- /* save_tex_scanner(texstate); */
--- get_token();
--- make_new_token(L, cur_cmd, cur_chr, cur_cs);
--- back_input();
--- /* unsave_tex_scanner(texstate); */
--- return 1;
--- }
-
if setinspector then
local simple = { letter = "letter", other_char = "other" }
local astable = function(t)
- if t and is_token(t) then
+ if t and istoken(t) then
local cmdname = t.cmdname
local simple = simple[cmdname]
if simple then
@@ -304,10 +283,10 @@ if setinspector then
end
tokens.cache = table.setmetatableindex(function(t,k)
- if not is_defined(k) then
- set_macro(k,"","global")
+ if not isdefined(k) then
+ setmacro(k,"","global")
end
- local v = create_token(k)
+ local v = createtoken(k)
t[k] = v
return v
end)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/trac-ctx.lua b/Master/texmf-dist/tex/context/base/mkiv/trac-ctx.lua
index a808778b316..f3243d39856 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/trac-ctx.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/trac-ctx.lua
@@ -66,9 +66,9 @@ implement {
}
implement {
- name = "installtextracker",
+ name = "installtextracker",
arguments = "3 strings",
- actions = function(tag,enable,disable)
+ actions = function(tag,enable,disable)
install(textrackers,trackers.register,tag,enable,disable)
end,
}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/trac-deb.lua b/Master/texmf-dist/tex/context/base/mkiv/trac-deb.lua
index 07865e4bf50..88d7e54c660 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/trac-deb.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/trac-deb.lua
@@ -191,9 +191,11 @@ function tracers.printerror(specification)
report_str(tracers.showlines(filename,linenumber,offset,tonumber(luaerrorline)))
report_nl()
end
- local errname = file.addsuffix(tex.jobname .. "-error","log")
if quitonerror then
- table.save(errname,specification)
+ local name = tex.jobname or ""
+ if name ~= "" then
+ table.save(name .. "-error.log",specification)
+ end
local help = specification.lasttexhelp
if help and #help > 0 then
report_nl()
diff --git a/Master/texmf-dist/tex/context/base/mkiv/trac-fil.lua b/Master/texmf-dist/tex/context/base/mkiv/trac-fil.lua
index f422c9f6b83..15aee6725c0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/trac-fil.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/trac-fil.lua
@@ -45,7 +45,7 @@ patterns.timestamp = timestamp
loggers = loggers or { }
-local timeformat = format("[%%s%s]",os.timezone(true))
+local timeformat = format("[%%s%s]",os.timezone())
local dateformat = "!%Y-%m-%d %H:%M:%S"
function loggers.makeline(t)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/trac-jus.lua b/Master/texmf-dist/tex/context/base/mkiv/trac-jus.lua
index aec1844ec5a..5f53b4c9941 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/trac-jus.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/trac-jus.lua
@@ -28,7 +28,7 @@ local findtail = nuts.tail
local nexthlist = nuts.traversers.hlist
local getdimensions = nuts.dimensions
-local copy_list = nuts.copy_list
+local copylist = nuts.copylist
local tracedrule = nodes.tracers.pool.nuts.rule
@@ -100,7 +100,7 @@ function checkers.handler(head)
setlist(current,rule)
elseif alignstate == 2 then
local lrule = new_hlist(tracedrule(-delta/2,naturalheight,naturaldepth,"trace:dy"))
- local rrule = copy_list(lrule)
+ local rrule = copylist(lrule)
setlink(lrule,list)
setlink(findtail(list),new_kern(delta/2),rrule)
setlist(current,lrule)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/trac-set.lua b/Master/texmf-dist/tex/context/base/mkiv/trac-set.lua
index 3974830fab0..0441f386b39 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/trac-set.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/trac-set.lua
@@ -165,6 +165,9 @@ local function register_setter(t,what,...)
end
local s = fnc -- else wrong reference
fnc = function(value) set(t,s,value) end
+ elseif typ == "table" then
+ functions.values = fnc
+ fnc = nil
elseif typ ~= "function" then
fnc = nil
end
@@ -216,35 +219,42 @@ local function list_setter(t) -- pattern
return user, system
end
-local function show_setter(t)
+local function show_setter(t,pattern)
local list = list_setter(t)
t.report()
for k=1,#list do
local name = list[k]
- local functions = t.data[name]
- if functions then
- local value = functions.value
- local default = functions.default
- local modules = #functions
- if default == nil then
- default = "unset"
- elseif type(default) == "table" then
- default = concat(default,"|")
- else
- default = tostring(default)
+ if not pattern or find(name,pattern) then
+ local functions = t.data[name]
+ if functions then
+ local value = functions.value
+ local default = functions.default
+ local values = functions.values
+ local modules = #functions
+ if default == nil then
+ default = "unset"
+ elseif type(default) == "table" then
+ default = concat(default,"|")
+ else
+ default = tostring(default)
+ end
+ if value == nil then
+ value = "unset"
+ elseif type(value) == "table" then
+ value = concat(value,"|")
+ else
+ value = tostring(value)
+ end
+ t.report(name)
+ t.report(" modules : %i",modules)
+ t.report(" default : %s",default)
+ t.report(" value : %s",value)
+ if values then
+ local v = { } for i=1,#values do v[i] = tostring(values[i]) end
+ t.report(" values : % t",v)
end
- if value == nil then
- value = "unset"
- elseif type(value) == "table" then
- value = concat(value,"|")
- else
- value = tostring(value)
+ t.report()
end
- t.report(name)
- t.report(" modules : %i",modules)
- t.report(" default : %s",default)
- t.report(" value : %s",value)
- t.report()
end
end
end
@@ -272,6 +282,11 @@ local function setter_value(setter,name)
return d and (d.value or d.default)
end
+local function setter_values(setter,name)
+ local d = setter.data[name]
+ return d and d.values
+end
+
local function new_setter(name) -- we could use foo:bar syntax (but not used that often)
local setter -- we need to access it in setter itself
setter = {
@@ -286,6 +301,7 @@ local function new_setter(name) -- we could use foo:bar syntax (but not used tha
show = function(...) show_setter (setter,...) end,
default = function(...) return setter_default (setter,...) end,
value = function(...) return setter_value (setter,...) end,
+ values = function(...) return setter_values (setter,...) end,
}
data[name] = setter
return setter
@@ -393,7 +409,7 @@ if texconfig then
-- this happens too late in ini mode but that is no problem
local function set(k,v)
- v = tonumber(v)
+ local v = tonumber(v)
if v then
texconfig[k] = v
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/trac-vis.lua b/Master/texmf-dist/tex/context/base/mkiv/trac-vis.lua
index fb5ef98d939..3bfbd1c76e2 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/trac-vis.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/trac-vis.lua
@@ -70,14 +70,14 @@ local isglyph = nuts.isglyph
local hpack_nodes = nuts.hpack
local vpack_nodes = nuts.vpack
-local copy_list = nuts.copy_list
-local copy_node = nuts.copy_node
-local flush_node_list = nuts.flush_list
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local copylist = nuts.copylist
+local copy_node = nuts.copy
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local apply_to_nodes = nuts.apply
local find_tail = nuts.tail
-local effectiveglue = nuts.effective_glue
+local effectiveglue = nuts.effectiveglue
+local flushnodelist = nuts.flushlist
local hpack_string = nuts.typesetters.tohpack
@@ -500,7 +500,7 @@ local fontkern, italickern, marginkern, mathlistkern do
setattr(info,a_layer,layer)
f_cache[kern] = info
end
- head = insert_node_before(head,current,copy_list(info))
+ head = insertnodebefore(head,current,copylist(info))
return head, current
end
@@ -548,7 +548,7 @@ local glyphexpansion do
setattr(info,a_layer,l_expansion)
f_cache[extra] = info
end
- head = insert_node_before(head,current,copy_list(info))
+ head = insertnodebefore(head,current,copylist(info))
return head, current
end
return head, current
@@ -584,7 +584,7 @@ local kernexpansion do
setattr(info,a_layer,l_expansion)
f_cache[extra] = info
end
- head = insert_node_before(head,current,copy_list(info))
+ head = insertnodebefore(head,current,copylist(info))
return head, current
end
return head, current
@@ -621,7 +621,7 @@ local whatsit do
setattr(info,a_layer,l_whatsit)
w_cache[what] = info
end
- head, current = insert_node_after(head,current,copy_list(info))
+ head, current = insertnodeafter(head,current,copylist(info))
return head, current
end
@@ -694,7 +694,7 @@ local user do
setattr(info,a_layer,l_user)
u_cache[what] = info
end
- head, current = insert_node_after(head,current,copy_list(info))
+ head, current = insertnodeafter(head,current,copylist(info))
return head, current
end
@@ -733,7 +733,7 @@ local math do
setattr(info,a_layer,l_math)
m_cache[tag][skip] = info
end
- head, current = insert_node_after(head,current,copy_list(info))
+ head, current = insertnodeafter(head,current,copylist(info))
return head, current
end
@@ -791,7 +791,7 @@ local ruledbox do
end
-- we need to trigger the right mode (else sometimes no whatits)
local info = setlink(
- this and copy_list(this) or nil,
+ this and copylist(this) or nil,
(dp == 0 and outlinerule and outlinerule(wd,ht,dp,linewidth)) or userrule {
width = wd,
height = ht,
@@ -812,7 +812,7 @@ local ruledbox do
elseif trace_origin then
local size = 2*size
local origin = o_cache[size]
- origin = copy_list(origin)
+ origin = copylist(origin)
if getid(parent) == vlist_code then
setshift(origin,-shift)
info = setlink(current,new_kern(-size),origin,new_kern(-size-dp),info)
@@ -832,7 +832,7 @@ local ruledbox do
elseif trace_origin then
local size = 2*size
local origin = o_cache[size]
- origin = copy_list(origin)
+ origin = copylist(origin)
if getid(parent) == vlist_code then
info = setlink(current,new_kern(-wd-size-shift),origin,new_kern(-size+shift),info)
else
@@ -1012,11 +1012,11 @@ local ruledglue do
end
(vertical and g_cache_v or g_cache_h)[amount] = info
end
- info = copy_list(info)
+ info = copylist(info)
if vertical then
info = vpack_nodes(info)
end
- head, current = insert_node_before(head,current,info)
+ head, current = insertnodebefore(head,current,info)
return head, getnext(current)
end
@@ -1032,8 +1032,8 @@ local ruledglue do
-- info = sometext(amount,l_glue,c_space)
-- g_cache_h[amount] = info
-- end
- -- info = copy_list(info)
- -- head, current = insert_node_before(head,current,info)
+ -- info = copylist(info)
+ -- head, current = insertnodebefore(head,current,info)
-- return head, getnext(current)
-- else
-- return head, current
@@ -1061,8 +1061,8 @@ local ruledglue do
g_cache_x[width] = info
end
end
- info = copy_list(info)
- head, current = insert_node_before(head,current,info)
+ info = copylist(info)
+ head, current = insertnodebefore(head,current,info)
return head, getnext(current)
else
return head, current
@@ -1091,11 +1091,11 @@ local ruledkern do
end
cache[kern] = info
end
- info = copy_list(info)
+ info = copylist(info)
if vertical then
info = vpack_nodes(info)
end
- head, current = insert_node_before(head,current,info)
+ head, current = insertnodebefore(head,current,info)
return head, getnext(current)
end
@@ -1119,8 +1119,8 @@ local ruleditalic do
end
i_cache[kern] = info
end
- info = copy_list(info)
- head, current = insert_node_before(head,current,info)
+ info = copylist(info)
+ head, current = insertnodebefore(head,current,info)
return head, getnext(current)
end
@@ -1144,8 +1144,8 @@ local ruledmarginkern do
end
m_cache[kern] = info
end
- info = copy_list(info)
- head, current = insert_node_before(head,current,info)
+ info = copylist(info)
+ head, current = insertnodebefore(head,current,info)
return head, getnext(current)
end
@@ -1169,8 +1169,8 @@ local ruledmathlistkern do
end
l_cache[kern] = info
end
- info = copy_list(info)
- head, current = insert_node_before(head,current,info)
+ info = copylist(info)
+ head, current = insertnodebefore(head,current,info)
return head, getnext(current)
end
@@ -1192,7 +1192,7 @@ local ruleddiscretionary do
d = new_hlist(kern)
d_cache[true] = d
end
- insert_node_after(head,current,copy_list(d))
+ insertnodeafter(head,current,copylist(d))
return head, current
end
@@ -1223,13 +1223,13 @@ local ruledpenalty do
end
(vertical and p_cache_v or p_cache_h)[penalty] = info
end
- info = copy_list(info)
+ info = copylist(info)
if vertical then
info = vpack_nodes(info)
elseif raisepenalties then
setshift(info,-65536*4)
end
- head, current = insert_node_before(head,current,info)
+ head, current = insertnodebefore(head,current,info)
return head, getnext(current)
end
@@ -1503,7 +1503,7 @@ do
local function cleanup()
for tag, cache in next, caches do
for k, v in next, cache do
- flush_node_list(v)
+ flushnodelist(v)
end
end
cleanup = function()
diff --git a/Master/texmf-dist/tex/context/base/mkiv/type-set.mkiv b/Master/texmf-dist/tex/context/base/mkiv/type-set.mkiv
index 68cd939d769..c87129e9441 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/type-set.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/type-set.mkiv
@@ -59,81 +59,91 @@
\fi
-\definefilesynonym [type-imp-latin-modern.mkiv] [type-imp-latinmodern.mkiv]
-\definefilesynonym [type-imp-modern-latin.mkiv] [type-imp-modernlatin.mkiv]
-
-\definefilesynonym [type-imp-lucida.mkiv] [type-imp-lucida-typeone.mkiv]
-\definefilesynonym [type-imp-lucidaot.mkiv] [type-imp-lucida-opentype.mkiv]
-\definefilesynonym [type-imp-lucidadk.mkiv] [type-imp-lucida-opentype.mkiv]
-
-\definefilesynonym [type-imp-dejavu-condensed.mkiv] [type-imp-dejavu.mkiv]
-
-\definefilesynonym [type-imp-palatino.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-courier.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-avantgarde.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-helvetica.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-chancery.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-bookman.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-schoolbook.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-times.mkiv] [type-imp-texgyre.mkiv]
-
-\definefilesynonym [type-imp-cursor.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-adventor.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-heros.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-chorus.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-bonum.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-schola.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-pagella.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-termes.mkiv] [type-imp-texgyre.mkiv]
-
-\definefilesynonym [type-imp-mscoretimes.mkiv] [type-imp-mscore.mkiv]
-\definefilesynonym [type-imp-mscorearial.mkiv] [type-imp-mscore.mkiv]
-\definefilesynonym [type-imp-mscorecourier.mkiv] [type-imp-mscore.mkiv]
-\definefilesynonym [type-imp-mscoreverdana.mkiv] [type-imp-mscore.mkiv]
-
-\definefilesynonym [type-imp-candara.mkiv] [type-imp-cleartype.mkiv]
-\definefilesynonym [type-imp-consolas.mkiv] [type-imp-cleartype.mkiv]
-\definefilesynonym [type-imp-constantia.mkiv] [type-imp-cleartype.mkiv]
-\definefilesynonym [type-imp-corbel.mkiv] [type-imp-cleartype.mkiv]
-\definefilesynonym [type-imp-calibri.mkiv] [type-imp-cleartype.mkiv]
-
-\definefilesynonym [type-imp-antykwa-poltawskiego.mkiv] [type-imp-antykwapoltawskiego.mkiv]
-
-%definefilesynonym [type-imp-mac.mkiv] [type-imp-osx.mkiv]
-%definefilesynonym [type-imp-win.mkiv] [type-imp-mscore.mkiv]
-
-\definefilesynonym [type-imp-eulernovum.mkiv] [type-imp-euler.mkiv]
-\definefilesynonym [type-imp-eulernova.mkiv] [type-imp-euler.mkiv]
-
-\definefilesynonym [type-imp-euler-with-pagella.mkiv] [type-imp-euler.mkiv]
-\definefilesynonym [type-imp-pagella-with-euler.mkiv] [type-imp-euler.mkiv]
-
-\definefilesynonym [type-imp-mdbch.mkiv] [type-imp-mathdesign.mkiv]
-\definefilesynonym [type-imp-mdugm.mkiv] [type-imp-mathdesign.mkiv]
-\definefilesynonym [type-imp-mdput.mkiv] [type-imp-mathdesign.mkiv]
-\definefilesynonym [type-imp-mdici.mkiv] [type-imp-mathdesign.mkiv]
-\definefilesynonym [type-imp-mdpgd.mkiv] [type-imp-mathdesign.mkiv]
-\definefilesynonym [type-imp-mdpus.mkiv] [type-imp-mathdesign.mkiv]
-
-\definefilesynonym [type-imp-mathdesignch.mkiv] [type-imp-mathdesign.mkiv]
-\definefilesynonym [type-imp-mathdesigngm.mkiv] [type-imp-mathdesign.mkiv]
-\definefilesynonym [type-imp-mathdesignut.mkiv] [type-imp-mathdesign.mkiv]
-\definefilesynonym [type-imp-mathdesignci.mkiv] [type-imp-mathdesign.mkiv]
-\definefilesynonym [type-imp-mathdesigngd.mkiv] [type-imp-mathdesign.mkiv]
-\definefilesynonym [type-imp-mathdesignus.mkiv] [type-imp-mathdesign.mkiv]
-
-\definefilesynonym [type-imp-mathdesigncharter.mkiv] [type-imp-mathdesign.mkiv]
-\definefilesynonym [type-imp-mathdesigngaramond.mkiv] [type-imp-mathdesign.mkiv]
-\definefilesynonym [type-imp-mathdesignutopia.mkiv] [type-imp-mathdesign.mkiv]
-
-\definefilesynonym [type-imp-cows.mkiv] [type-imp-koeielettersot.mkiv]
-\definefilesynonym [type-imp-sheep.mkiv] [type-imp-koeielettersot.mkiv]
-\definefilesynonym [type-imp-coloredcows.mkiv] [type-imp-koeielettersot.mkiv]
-\definefilesynonym [type-imp-coloredsheep.mkiv] [type-imp-koeielettersot.mkiv]
-\definefilesynonym [type-imp-koeieletters.mkiv] [type-imp-koeielettersot.mkiv]
-
-\definefilesynonym [type-imp-stixtwo.mkiv] [type-imp-stix.mkiv]
-
-\definefilesynonym [type-imp-ibmplex.mkiv] [type-imp-plex.mkiv]
+\definefilesynonym [type-imp-latin-modern.mkiv] [type-imp-latinmodern.mkiv]
+\definefilesynonym [type-imp-modern-latin.mkiv] [type-imp-modernlatin.mkiv]
+
+\definefilesynonym [type-imp-lucida-opentype.mkiv] [type-imp-lucida.mkiv]
+\definefilesynonym [type-imp-lucidaot.mkiv] [type-imp-lucida.mkiv]
+\definefilesynonym [type-imp-lucidadk.mkiv] [type-imp-lucida.mkiv]
+
+\definefilesynonym [type-imp-dejavu-condensed.mkiv] [type-imp-dejavu.mkiv]
+
+\definefilesynonym [type-imp-palatino.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-courier.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-avantgarde.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-helvetica.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-chancery.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-bookman.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-schoolbook.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-times.mkiv] [type-imp-texgyre.mkiv]
+
+\definefilesynonym [type-imp-cursor.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-adventor.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-heros.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-chorus.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-bonum.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-schola.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-pagella.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-termes.mkiv] [type-imp-texgyre.mkiv]
+
+\definefilesynonym [type-imp-mscoretimes.mkiv] [type-imp-mscore.mkiv]
+\definefilesynonym [type-imp-mscorearial.mkiv] [type-imp-mscore.mkiv]
+\definefilesynonym [type-imp-mscorecourier.mkiv] [type-imp-mscore.mkiv]
+\definefilesynonym [type-imp-mscoreverdana.mkiv] [type-imp-mscore.mkiv]
+
+\definefilesynonym [type-imp-candara.mkiv] [type-imp-cleartype.mkiv]
+\definefilesynonym [type-imp-consolas.mkiv] [type-imp-cleartype.mkiv]
+\definefilesynonym [type-imp-constantia.mkiv] [type-imp-cleartype.mkiv]
+\definefilesynonym [type-imp-corbel.mkiv] [type-imp-cleartype.mkiv]
+\definefilesynonym [type-imp-calibri.mkiv] [type-imp-cleartype.mkiv]
+
+\definefilesynonym [type-imp-antykwa-poltawskiego.mkiv] [type-imp-antykwapoltawskiego.mkiv]
+
+%definefilesynonym [type-imp-mac.mkiv] [type-imp-osx.mkiv]
+%definefilesynonym [type-imp-win.mkiv] [type-imp-mscore.mkiv]
+
+\definefilesynonym [type-imp-eulernovum.mkiv] [type-imp-euler.mkiv]
+\definefilesynonym [type-imp-eulernova.mkiv] [type-imp-euler.mkiv]
+
+\definefilesynonym [type-imp-euler-with-pagella.mkiv] [type-imp-euler.mkiv]
+\definefilesynonym [type-imp-pagella-with-euler.mkiv] [type-imp-euler.mkiv]
+
+\definefilesynonym [type-imp-mdbch.mkiv] [type-imp-mathdesign.mkiv]
+\definefilesynonym [type-imp-mdugm.mkiv] [type-imp-mathdesign.mkiv]
+\definefilesynonym [type-imp-mdput.mkiv] [type-imp-mathdesign.mkiv]
+\definefilesynonym [type-imp-mdici.mkiv] [type-imp-mathdesign.mkiv]
+\definefilesynonym [type-imp-mdpgd.mkiv] [type-imp-mathdesign.mkiv]
+\definefilesynonym [type-imp-mdpus.mkiv] [type-imp-mathdesign.mkiv]
+
+\definefilesynonym [type-imp-mathdesignch.mkiv] [type-imp-mathdesign.mkiv]
+\definefilesynonym [type-imp-mathdesigngm.mkiv] [type-imp-mathdesign.mkiv]
+\definefilesynonym [type-imp-mathdesignut.mkiv] [type-imp-mathdesign.mkiv]
+\definefilesynonym [type-imp-mathdesignci.mkiv] [type-imp-mathdesign.mkiv]
+\definefilesynonym [type-imp-mathdesigngd.mkiv] [type-imp-mathdesign.mkiv]
+\definefilesynonym [type-imp-mathdesignus.mkiv] [type-imp-mathdesign.mkiv]
+
+\definefilesynonym [type-imp-mathdesigncharter.mkiv] [type-imp-mathdesign.mkiv]
+\definefilesynonym [type-imp-mathdesigngaramond.mkiv] [type-imp-mathdesign.mkiv]
+\definefilesynonym [type-imp-mathdesignutopia.mkiv] [type-imp-mathdesign.mkiv]
+
+\definefilesynonym [type-imp-cows.mkiv] [type-imp-koeielettersot.mkiv]
+\definefilesynonym [type-imp-sheep.mkiv] [type-imp-koeielettersot.mkiv]
+\definefilesynonym [type-imp-coloredcows.mkiv] [type-imp-koeielettersot.mkiv]
+\definefilesynonym [type-imp-coloredsheep.mkiv] [type-imp-koeielettersot.mkiv]
+\definefilesynonym [type-imp-koeieletters.mkiv] [type-imp-koeielettersot.mkiv]
+
+%definefilesynonym [type-imp-xits.mkiv] [type-imp-stix.mkiv]
+\definefilesynonym [type-imp-stixtwo.mkiv] [type-imp-stix.mkiv]
+
+\definefilesynonym [type-imp-ibmplex.mkiv] [type-imp-plex.mkiv]
+
+\definefilesynonym [type-imp-newcomputermodern-book.mkiv] [type-imp-newcomputermodern.mkiv]
+
+\definefilesynonym [type-imp-kpfonts-light.mkiv] [type-imp-kpfonts.mkiv]
+\definefilesynonym [type-imp-kpfonts-bold.mkiv] [type-imp-kpfonts.mkiv]
+\definefilesynonym [type-imp-kpfonts-sans.mkiv] [type-imp-kpfonts.mkiv]
+
+\definefilesynonym [type-imp-gentiumplus.mkiv] [type-imp-gentium.mkiv]
+\definefilesynonym [type-imp-gentiumbook.mkiv] [type-imp-gentium.mkiv]
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-bld.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-bld.lua
index 30503277212..36371aa104b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-bld.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-bld.lua
@@ -46,7 +46,7 @@ local nodeidstostring = nodes.idstostring
local nodepool = nodes.pool
local new_baselineskip = nodepool.baselineskip
local new_lineskip = nodepool.lineskip
-local insert_node_before = nodes.insert_before
+local insertnodebefore = nodes.insertbefore
local hpack_node = nodes.hpack
local nuts = nodes.nuts
@@ -157,9 +157,9 @@ function parbuilders.constructors.methods.oneline(head,followed_by_display)
t.prevdepth = h.depth
t.prevgraf = 1
if d < texget("lineskiplimit") then
- return insert_node_before(h,h,new_lineskip(texget("lineskip",false))) -- no stretch etc
+ return insertnodebefore(h,h,new_lineskip(texget("lineskip",false))) -- no stretch etc
else
- return insert_node_before(h,h,new_baselineskip(d))
+ return insertnodebefore(h,h,new_baselineskip(d))
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-brk.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-brk.lua
index 89eb7e52d33..68d9f2f5410 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-brk.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-brk.lua
@@ -46,13 +46,13 @@ local setprev = nuts.setprev
local setboth = nuts.setboth
local setsubtype = nuts.setsubtype
-local copy_node = nuts.copy_node
-local copy_node_list = nuts.copy_list
-local flush_node = nuts.flush_node
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local copy_node = nuts.copy
+local copy_node_list = nuts.copylist
+local flushnode = nuts.flushnode
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local remove_node = nuts.remove
-local end_of_math = nuts.end_of_math
+local endofmath = nuts.endofmath
local tonodes = nuts.tonodes
@@ -116,15 +116,15 @@ local function insert_break(head,start,stop,before,after,kern)
local g = new_glue()
setattrlist(p,start)
setattrlist(g,start)
- insert_node_before(head,start,p)
- insert_node_before(head,start,g)
+ insertnodebefore(head,start,p)
+ insertnodebefore(head,start,g)
end
local p = new_penalty(after)
local g = new_glue()
setattrlist(p,start)
setattrlist(g,start)
- insert_node_after(head,stop,g)
- insert_node_after(head,stop,p)
+ insertnodeafter(head,stop,g)
+ insertnodeafter(head,stop,p)
end
methods[1] = function(head,start,stop,settings,kern)
@@ -170,7 +170,7 @@ methods[2] = function(head,start) -- ( => (-
local hyphen = copy_node(post)
setchar(hyphen,languages.prehyphenchar(getlanguage(post)))
setlink(post,hyphen)
- head, start = insert_node_before(head,start,new_disc(nil,post,replace))
+ head, start = insertnodebefore(head,start,new_disc(nil,post,replace))
setattrlist(start,replace)
insert_break(head,start,start,10000,10000)
end
@@ -186,7 +186,7 @@ methods[3] = function(head,start) -- ) => -)
local hyphen = copy_node(pre)
setchar(hyphen,languages.prehyphenchar(getlanguage(pre)))
setlink(hyphen,pre)
- head, start = insert_node_before(head,start,new_disc(hyphen,nil,replace)) -- so not pre !
+ head, start = insertnodebefore(head,start,new_disc(hyphen,nil,replace)) -- so not pre !
setattrlist(start,tmp)
insert_break(head,start,start,10000,10000)
end
@@ -198,7 +198,7 @@ methods[4] = function(head,start) -- - => - - -
if p and n then
local tmp
head, start, tmp = remove_node(head,start)
- head, start = insert_node_before(head,start,new_disc())
+ head, start = insertnodebefore(head,start,new_disc())
setattrlist(start,tmp)
setdisc(start,copy_node(tmp),copy_node(tmp),tmp)
insert_break(head,start,start,10000,10000)
@@ -211,7 +211,7 @@ methods[5] = function(head,start,stop,settings) -- x => p q r
if p and n then
local tmp
head, start, tmp = remove_node(head,start)
- head, start = insert_node_before(head,start,new_disc())
+ head, start = insertnodebefore(head,start,new_disc())
local attr = getattrlist(tmp)
local font = getfont(tmp)
local left = settings.left
@@ -228,7 +228,7 @@ methods[5] = function(head,start,stop,settings) -- x => p q r
end
setdisc(start,left,right,middle)
setattrlist(start,attr)
- flush_node(tmp)
+ flushnode(tmp)
insert_break(head,start,start,10000,10000)
end
return head, start
@@ -302,7 +302,7 @@ function breakpoints.handler(head)
end
elseif id == math_code then
attr = nil
- current = end_of_math(current)
+ current = endofmath(current)
if current then
current = getnext(current)
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-cap.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-cap.lua
index 3d0d6055a77..b6338ce4024 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-cap.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-cap.lua
@@ -36,9 +36,9 @@ local setchar = nuts.setchar
local setfont = nuts.setfont
local copy_node = nuts.copy
-local end_of_math = nuts.end_of_math
-local insert_after = nuts.insert_after
-local find_attribute = nuts.find_attribute
+local endofmath = nuts.endofmath
+local insertafter = nuts.insertafter
+local findattribute = nuts.findattribute
local nextglyph = nuts.traversers.glyph
@@ -132,7 +132,7 @@ local function replacer(start,codes)
else
local g = copy_node(start)
setchar(g,chr)
- insert_after(start,start,g)
+ insertafter(start,start,g)
end
end
elseif ifc[dc] then
@@ -237,7 +237,7 @@ local function mixed(start,attr,lastfont,n,count,where,first)
if fp ~= fc then
local k = fonts.getkern(fontdata[fp],getchar(p),c)
if k ~= 0 then
- insert_after(p,p,newkern(k))
+ insertafter(p,p,newkern(k))
end
end
else
@@ -410,7 +410,7 @@ function cases.handler(head) -- not real fast but also not used on much data
count = count + 1
end
elseif id == math_code then
- start = end_of_math(start)
+ start = endofmath(start)
count = 0
elseif prev_id == kern_code and getsubtype(prev) == fontkern_code then
-- still inside a word ...normally kerns are added later
@@ -427,7 +427,7 @@ function cases.handler(head) -- not real fast but also not used on much data
end
-- function cases.handler(head) -- not real fast but also not used on much data
--- local attr, start = find_attribute(head,a_cases)
+-- local attr, start = findattribute(head,a_cases)
-- if not start then
-- return head, false
-- end
@@ -520,7 +520,7 @@ end
-- count = count + 1
-- end
-- elseif id == math_code then
--- start = end_of_math(start)
+-- start = endofmath(start)
-- count = 0
-- elseif prev_id == kern_code and getsubtype(prev) == fontkern_code then
-- -- still inside a word ...normally kerns are added later
@@ -536,7 +536,7 @@ end
-- end
-- end
-- if start then
--- attr, start = find_attribute(start,a_cases)
+-- attr, start = findattribute(start,a_cases)
-- end
-- end
-- return head
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-chr.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-chr.lua
index bb3883b3308..c9ba0c7b9da 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-chr.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-chr.lua
@@ -99,8 +99,8 @@ local wordboundary_code = boundarycodes.word
local texgetnest = tex.getnest -- to be used
local texsetcount = tex.setcount
-local flush_node = nodes.flush_node
-local flush_list = nodes.flush_list
+local flushnode = nodes.flushnode
+local flushlist = nodes.flushlist
local settexattribute = tex.setattribute
local punctuation = characters.is_punctuation
@@ -140,7 +140,7 @@ local actions = {
remove = function(specification)
local n = pickup()
if n then
- flush_node(n)
+ flushnode(n)
end
end,
push = function(specification)
@@ -175,7 +175,7 @@ local function pickup(head,tail,str)
while true do
local prev = first.prev
if prev and prev[a_marked] == attr then
- if prev.id == par_code then -- and start_of_par(prev)
+ if prev.id == par_code then -- and startofpar(prev)
break
else
first = prev
@@ -212,7 +212,7 @@ local actions = {
list.tail = prev
prev.next = nil
end
- flush_list(first)
+ flushlist(first)
end
end
end,
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-cln.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-cln.lua
index b9b0e7d6cb7..469859162fb 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-cln.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-cln.lua
@@ -10,6 +10,8 @@ if not modules then modules = { } end modules ['typo-cln'] = {
-- this case Dream Theaters' Octavium). Of course extensions will take
-- more time.
+-- This feature is probably never used so we can get rid of it.
+
local tonumber = tonumber
local utfbyte = utf.byte
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-del.mkiv b/Master/texmf-dist/tex/context/base/mkiv/typo-del.mkiv
index 9720326be14..726c6d4bae2 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-del.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-del.mkiv
@@ -525,10 +525,11 @@
\usedelimitedtextstyleandcolor\c!style\c!color
%
\begingroup
- \edef\p_delimited_left {\delimitedtextparameter{\c!left}}%
- \edef\p_delimited_right {\delimitedtextparameter{\c!right}}%
- \edef\p_delimited_nextleft {\delimitedtextparameter{\c!nextleft}}%
- \edef\p_delimited_nextright{\delimitedtextparameter{\c!nextright}}%
+ \usealignparameter\delimitedtextparameter
+ \edef\p_delimited_left {\delimitedtextparameter\c!left}%
+ \edef\p_delimited_right {\delimitedtextparameter\c!right}%
+ \edef\p_delimited_nextleft {\delimitedtextparameter\c!nextleft}%
+ \edef\p_delimited_nextright{\delimitedtextparameter\c!nextright}%
%
\leftdelimitedtextmark
%
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-dha.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-dha.lua
index ac72ae39488..176ed78670b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-dha.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-dha.lua
@@ -62,11 +62,12 @@ local setprop = nuts.setprop
local setstate = nuts.setstate
local setchar = nuts.setchar
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local remove_node = nuts.remove
-local end_of_math = nuts.end_of_math
-local start_of_par = nuts.start_of_par
+local endofmath = nuts.endofmath
+
+local startofpar = nuts.startofpar
local nodepool = nuts.pool
@@ -160,7 +161,7 @@ local function process(start)
local id = getid(current)
local next = getnext(current)
if id == math_code then
- current = getnext(end_of_math(next))
+ current = getnext(endofmath(next))
elseif getprop(current,"direction") then
-- this handles unhbox etc
current = next
@@ -332,7 +333,7 @@ local function process(start)
end
textdir = autodir
setprop(current,"direction",true)
- elseif id == par_code and start_of_par(current) then
+ elseif id == par_code and startofpar(current) then
local direction = getdirection(current)
if direction == righttoleft_code then
autodir = -1
@@ -376,13 +377,13 @@ local function process(start)
local id = getid(current)
if id == math_code then
-- todo: this might be tricky nesting
- current = getnext(end_of_math(getnext(current)))
+ current = getnext(endofmath(getnext(current)))
else
local cp = getprop(current,"direction")
if cp == "n" then
local swap = state == "r"
if swap then
- head = insert_node_before(head,current,startdir(lefttoright_code))
+ head = insertnodebefore(head,current,startdir(lefttoright_code))
end
setprop(current,"direction",true)
while true do
@@ -395,14 +396,14 @@ local function process(start)
end
end
if swap then
- head, current = insert_node_after(head,current,stopdir(lefttoright_code))
+ head, current = insertnodeafter(head,current,stopdir(lefttoright_code))
end
elseif cp == "l" then
if state ~= "l" then
if state == "r" then
- head = insert_node_before(head,last or current,stopdir(righttoleft_code))
+ head = insertnodebefore(head,last or current,stopdir(righttoleft_code))
end
- head = insert_node_before(head,current,startdir(lefttoright_code))
+ head = insertnodebefore(head,current,startdir(lefttoright_code))
state = "l"
done = true
end
@@ -410,9 +411,9 @@ local function process(start)
elseif cp == "r" then
if state ~= "r" then
if state == "l" then
- head = insert_node_before(head,last or current,stopdir(lefttoright_code))
+ head = insertnodebefore(head,last or current,stopdir(lefttoright_code))
end
- head = insert_node_before(head,current,startdir(righttoleft_code))
+ head = insertnodebefore(head,current,startdir(righttoleft_code))
state = "r"
done = true
end
@@ -425,9 +426,9 @@ local function process(start)
end
else
if state == "r" then
- head = insert_node_before(head,current,stopdir(righttoleft_code))
+ head = insertnodebefore(head,current,stopdir(righttoleft_code))
elseif state == "l" then
- head = insert_node_before(head,current,stopdir(lefttoright_code))
+ head = insertnodebefore(head,current,stopdir(lefttoright_code))
end
state = false
last = false
@@ -441,9 +442,9 @@ local function process(start)
local sd = (state == "r" and stopdir(righttoleft_code)) or (state == "l" and stopdir(lefttoright_code))
if sd then
if id == glue_code and getsubtype(current) == parfillskip_code then
- head = insert_node_before(head,current,sd)
+ head = insertnodebefore(head,current,sd)
else
- head = insert_node_after(head,current,sd)
+ head = insertnodeafter(head,current,sd)
end
end
break
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-dig.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-dig.lua
index a9294a38dae..bbc9311c408 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-dig.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-dig.lua
@@ -33,10 +33,9 @@ local setlink = nuts.setlink
local setnext = nuts.setnext
local setprev = nuts.setprev
-local hpack_node = nuts.hpack
-local traverse_id = nuts.traverse_id
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local hpacknode = nuts.hpack
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local texsetattribute = tex.setattribute
local unsetvalue = attributes.unsetvalue
@@ -73,16 +72,16 @@ local a_digits = attributes.private("digits")
function nodes.aligned(head,start,stop,width,how)
if how == "flushright" or how == "middle" then
- head, start = insert_node_before(head,start,new_glue(0,65536,65536))
+ head, start = insertnodebefore(head,start,new_glue(0,65536,65536))
end
if how == "flushleft" or how == "middle" then
- head, stop = insert_node_after(head,stop,new_glue(0,65536,65536))
+ head, stop = insertnodeafter(head,stop,new_glue(0,65536,65536))
end
local prv = getprev(start)
local nxt = getnext(stop)
setprev(start)
setnext(stop)
- local packed = hpack_node(start,width,"exactly") -- no directional mess here, just lr
+ local packed = hpacknode(start,width,"exactly") -- no directional mess here, just lr
if prv then
setlink(prv,packed)
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-drp.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-drp.lua
index ddc6d68ae82..79cda3ab96c 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-drp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-drp.lua
@@ -59,10 +59,11 @@ local nodecodes = nodes.nodecodes
local nodepool = nuts.pool
local new_kern = nodepool.kern
-local insert_before = nuts.insert_before
-local insert_after = nuts.insert_after
+local insertbefore = nuts.insertbefore
+local insertafter = nuts.insertafter
local remove_node = nuts.remove
-local start_of_par = nuts.start_of_par
+
+local startofpar = nuts.startofpar
local nextnode = nuts.traversers.node
local nextglyph = nuts.traversers.glyph
@@ -72,6 +73,7 @@ local v_default = variables.default
local v_margin = variables.margin
local v_auto = variables.auto
local v_first = variables.first
+local v_keep = variables.keep
local v_last = variables.last
local texget = tex.get
@@ -132,6 +134,7 @@ interfaces.implement {
-- a page so this has a low priority
actions[v_default] = function(head,setting)
+ local skip = false
-- begin of par
local first = getnext(head)
local indent = false
@@ -195,6 +198,9 @@ actions[v_default] = function(head,setting)
else
-- keep quote etc with initial
local next = getnext(first)
+ if next and method[v_keep] then
+ skip = first
+ end
if not next then
-- don't start with a quote or so
return head
@@ -244,7 +250,7 @@ actions[v_default] = function(head,setting)
local id = getid(current)
if id == kern_code then
setkern(current,0)
- elseif id == glyph_code then
+ elseif id == glyph_code and skip ~= current then
local next = getnext(current)
if font then
setfont(current,font)
@@ -300,7 +306,11 @@ actions[v_default] = function(head,setting)
--
local hoffset = width + hoffset + distance + (indent and parindent or 0)
for current in nextglyph, first do
- setoffsets(current,-hoffset,-voffset) -- no longer - height here
+ if skip == current then
+ setoffsets(current,-hoffset,0)
+ else
+ setoffsets(current,-hoffset,-voffset) -- no longer - height here
+ end
if current == last then
break
end
@@ -325,7 +335,7 @@ actions[v_default] = function(head,setting)
texset("hangindent",hangindent)
end
if indent then
- insert_after(first,first,new_kern(-parindent))
+ insertafter(first,first,new_kern(-parindent))
end
end
return head
@@ -334,7 +344,7 @@ end
-- we can count ... when all done, we can disable ...
function initials.handler(head)
- if getid(head) == par_code and start_of_par(head) then
+ if getid(head) == par_code and startofpar(head) then
local settings = getprop(head,a_initial)
if settings then
disableaction("processors","typesetters.initials.handler")
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-dua.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-dua.lua
index 5e1d4c109ae..dd7515a370a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-dua.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-dua.lua
@@ -83,9 +83,10 @@ local setdirection = nuts.setdirection
----- setattrlist = nuts.setattrlist
local remove_node = nuts.remove
-local insert_node_after = nuts.insert_after
-local insert_node_before = nuts.insert_before
-local start_of_par = nuts.start_of_par
+local insertnodeafter = nuts.insertafter
+local insertnodebefore = nuts.insertbefore
+
+local startofpar = nuts.startofpar
local nodepool = nuts.pool
local new_direction = nodepool.direction
@@ -337,7 +338,7 @@ local function get_baselevel(head,list,size,direction)
-- This is an adapted version:
if direction == lefttoright_code or direction == righttoleft_code then
return direction, true
- elseif getid(head) == par_code and start_of_par(head) then
+ elseif getid(head) == par_code and startofpar(head) then
direction = getdirection(head)
if direction == lefttoright_code or direction == righttoleft_code then
return direction, true
@@ -765,16 +766,16 @@ local function apply_to_list(list,size,head,pardir)
local d = new_direction(enddir,true)
-- setprop(d,"directions",true)
-- setattrlist(d,current)
- head = insert_node_before(head,current,d)
+ head = insertnodebefore(head,current,d)
enddir = false
end
elseif begindir then
- if id == par_code and start_of_par(current) then
+ if id == par_code and startofpar(current) then
-- par should always be the 1st node
local d = new_direction(begindir)
-- setprop(d,"directions",true)
-- setattrlist(d,current)
- head, current = insert_node_after(head,current,d)
+ head, current = insertnodeafter(head,current,d)
begindir = nil
end
end
@@ -782,7 +783,7 @@ local function apply_to_list(list,size,head,pardir)
local d = new_direction(begindir)
-- setprop(d,"directions",true)
-- setattrlist(d,current)
- head = insert_node_before(head,current,d)
+ head = insertnodebefore(head,current,d)
end
local skip = entry.skip
if skip and skip > 0 then
@@ -795,7 +796,7 @@ local function apply_to_list(list,size,head,pardir)
local d = new_direction(enddir,true)
-- setprop(d,"directions",true)
-- setattrlist(d,current)
- head, current = insert_node_after(head,current,d)
+ head, current = insertnodeafter(head,current,d)
end
if not entry.remove then
current = getnext(current)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-dub.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-dub.lua
index 88b3361da4a..dc45a278513 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-dub.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-dub.lua
@@ -71,9 +71,10 @@ local setdirection = nuts.setdirection
local setattrlist = nuts.setattrlist
local remove_node = nuts.remove
-local insert_node_after = nuts.insert_after
-local insert_node_before = nuts.insert_before
-local start_of_par = nuts.start_of_par
+local insertnodeafter = nuts.insertafter
+local insertnodebefore = nuts.insertbefore
+
+local startofpar = nuts.startofpar
local nodepool = nuts.pool
local new_direction = nodepool.direction
@@ -398,7 +399,7 @@ end
local function get_baselevel(head,list,size,direction)
if direction == lefttoright_code or direction == righttoleft_code then
return direction, true
- elseif getid(head) == par_code and start_of_par(head) then
+ elseif getid(head) == par_code and startofpar(head) then
direction = getdirection(head)
if direction == lefttoright_code or direction == righttoleft_code then
return direction, true
@@ -898,16 +899,16 @@ local function apply_to_list(list,size,head,pardir)
local d = new_direction(enddir,true)
-- setprop(d,"directions",true)
-- setattrlist(d,current)
- head = insert_node_before(head,current,d)
+ head = insertnodebefore(head,current,d)
enddir = false
end
elseif begindir then
- if id == par_code and start_of_par(current) then
+ if id == par_code and startofpar(current) then
-- par should always be the 1st node
local d = new_direction(begindir)
-- setprop(d,"directions",true)
-- setattrlist(d,current)
- head, current = insert_node_after(head,current,d)
+ head, current = insertnodeafter(head,current,d)
begindir = nil
end
end
@@ -915,7 +916,7 @@ local function apply_to_list(list,size,head,pardir)
local d = new_direction(begindir)
-- setprop(d,"directions",true)
-- setattrlist(d,current)
- head = insert_node_before(head,current,d)
+ head = insertnodebefore(head,current,d)
end
local skip = entry.skip
if skip and skip > 0 then
@@ -928,7 +929,7 @@ local function apply_to_list(list,size,head,pardir)
local d = new_direction(enddir,true)
-- setprop(d,"directions",true)
-- setattrlist(d,current)
- head, current = insert_node_after(head,current,d)
+ head, current = insertnodeafter(head,current,d)
end
if not entry.remove then
current = getnext(current)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-duc.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-duc.lua
index 6e4f27de257..614defeb687 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-duc.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-duc.lua
@@ -76,9 +76,10 @@ local setattrlist = nuts.setattrlist
local properties = nodes.properties.data
local remove_node = nuts.remove
-local insert_node_after = nuts.insert_after
-local insert_node_before = nuts.insert_before
-local start_of_par = nuts.start_of_par
+local insertnodeafter = nuts.insertafter
+local insertnodebefore = nuts.insertbefore
+
+local startofpar = nuts.startofpar
local nodepool = nuts.pool
local new_direction = nodepool.direction
@@ -416,7 +417,7 @@ end
local function get_baselevel(head,list,size,direction)
if direction == lefttoright_code or direction == righttoleft_code then
return direction, true
- elseif getid(head) == par_code and start_of_par(head) then
+ elseif getid(head) == par_code and startofpar(head) then
direction = getdirection(head)
if direction == lefttoright_code or direction == righttoleft_code then
return direction, true
@@ -959,18 +960,18 @@ local function apply_to_list(list,size,head,pardir)
c = p
end
-- there is always a par nodes so head will stay
- head = insert_node_before(head,c,new_direction(enddir,true))
+ head = insertnodebefore(head,c,new_direction(enddir,true))
enddir = false
end
elseif begindir then
- if id == par_code and start_of_par(current) then
+ if id == par_code and startofpar(current) then
-- par should always be the 1st node
- head, current = insert_node_after(head,current,new_direction(begindir))
+ head, current = insertnodeafter(head,current,new_direction(begindir))
begindir = nil
end
end
if begindir then
- head = insert_node_before(head,current,new_direction(begindir))
+ head = insertnodebefore(head,current,new_direction(begindir))
end
local skip = entry.skip
if skip and skip > 0 then
@@ -985,7 +986,7 @@ local function apply_to_list(list,size,head,pardir)
end
end
if enddir then
- head, current = insert_node_after(head,current,new_direction(enddir,true))
+ head, current = insertnodeafter(head,current,new_direction(enddir,true))
end
if not entry.remove then
current = getnext(current)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-fkr.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-fkr.lua
index 1fd08526c3a..faaa09891e5 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-fkr.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-fkr.lua
@@ -18,7 +18,7 @@ local glyph_code = nodecodes.glyph
local fontdata = fonts.hashes.identifiers
local getkernpair = fonts.handlers.otf.getkern
-local insert_before = nuts.insert_before
+local insertbefore = nuts.insertbefore
local new_kern = nuts.pool.fontkern
local enableaction = nodes.tasks.enableaction
@@ -56,7 +56,7 @@ function typesetters.fontkerns.handler(head)
kern = (kern1 + kern2)/2 -- mixed
end
if kern ~= 0 then
- head, current = insert_before(head,current,new_kern(kern))
+ head = insertbefore(head,current,new_kern(kern))
end
lastdata = data
else
@@ -68,7 +68,7 @@ function typesetters.fontkerns.handler(head)
end
local kern = getkernpair(lastdata,lastchar,char)
if kern ~= 0 then
- head, current = insert_before(head,current,new_kern(kern))
+ head = insertbefore(head,current,new_kern(kern))
end
end
lastchar = char
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-fln.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-fln.lua
index 3941e65efaa..0ee77fe870e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-fln.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-fln.lua
@@ -63,15 +63,15 @@ local spaceskip_code = nodes.gluecodes.spaceskip
local nextglyph = nuts.traversers.glyph
local nextdisc = nuts.traversers.disc
-local flush_node_list = nuts.flush_list
-local flush_node = nuts.flush_node
-local copy_node_list = nuts.copy_list
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local flushnodelist = nuts.flushlist
+local flushnode = nuts.flushnode
+local copy_node_list = nuts.copylist
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local remove_node = nuts.remove
local getdimensions = nuts.dimensions
local hpack_node_list = nuts.hpack
-local start_of_par = nuts.start_of_par
+local startofpar = nuts.startofpar
local nodepool = nuts.pool
local newpenalty = nodepool.penalty
@@ -182,7 +182,7 @@ actions[v_line] = function(head,setting)
-- temp = typesetters.kerns.handler(temp) -- maybe when enabled
-- temp = typesetters.cases.handler(temp) -- maybe when enabled
local width = getdimensions(temp)
- flush_node_list(temp)
+ flushnodelist(temp)
return width
end
@@ -230,7 +230,7 @@ actions[v_line] = function(head,setting)
end
end
- flush_node_list(temp)
+ flushnodelist(temp)
local start = head
local n = 0
@@ -296,11 +296,11 @@ actions[v_line] = function(head,setting)
end
end
setdisc(disc,pre,post,replace)
- flush_node(disc)
+ flushnode(disc)
elseif id == glue_code then
n = n + 1
if linebreak ~= n then
- head = insert_node_before(head,start,newpenalty(10000)) -- nobreak
+ head = insertnodebefore(head,start,newpenalty(10000)) -- nobreak
end
end
local next = getnext(start)
@@ -308,11 +308,11 @@ actions[v_line] = function(head,setting)
if start ~= head then
local where = id == glue_code and getprev(start) or start
if trace_firstlines then
- head, where = insert_node_after(head,where,newpenalty(10000)) -- nobreak
- head, where = insert_node_after(head,where,newkern(-65536))
- head, where = insert_node_after(head,where,tracerrule(65536,4*65536,2*65536,"darkblue"))
+ head, where = insertnodeafter(head,where,newpenalty(10000)) -- nobreak
+ head, where = insertnodeafter(head,where,newkern(-65536))
+ head, where = insertnodeafter(head,where,tracerrule(65536,4*65536,2*65536,"darkblue"))
end
- head, where = insert_node_after(head,where,newpenalty(-10000)) -- break
+ head, where = insertnodeafter(head,where,newpenalty(-10000)) -- break
end
start = next
break
@@ -372,7 +372,7 @@ end
actions[v_default] = actions[v_line]
function firstlines.handler(head)
- if getid(head) == par_code and start_of_par(head) then
+ if getid(head) == par_code and startofpar(head) then
local settings = getprop(head,a_firstline)
if settings then
disableaction("processors","typesetters.firstlines.handler")
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-inj.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-inj.lua
index 44b6c0a147e..ef344ec4b0b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-inj.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-inj.lua
@@ -41,26 +41,45 @@ function injectors.reset(name)
list[name] = nil
end
+local function activate(injector,name)
+ if not injector.active then
+ ctx_doactivateinjector(name)
+ injector.active = true
+ if showall then
+ -- in case we already enabled tracing
+ injector.show = true
+ end
+ end
+end
+
function injectors.set(name,numbers,command)
local injector = list[name]
- local actions = injector.actions
- local places = settings_to_array(numbers)
+ local actions = injector.actions
+ local places = settings_to_array(numbers)
for i=1,#places do
actions[tonumber(places[i])] = command
end
- if not injector.active then
- ctx_doactivateinjector(name)
- injector.active = true
- end
+ -- not: injector.show = true
+ activate(injector,name)
end
function injectors.show(name)
if not name or name == "" then
showall = true
+ local names = settings_to_array(name)
+ for name, injector in next, list do
+ injector.show = true
+ activate(injector,name)
+ end
else
- local list = settings_to_array(name)
- for i=1,#list do
- list[list[i]].show = true
+ local names = settings_to_array(name)
+ for i=1,#names do
+ local name = names[i]
+ local injector = list[name]
+ if injector then
+ injector.show = true
+ activate(injector,name)
+ end
end
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-itc.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-itc.lua
index c3a583fe494..0cf847846a0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-itc.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-itc.lua
@@ -44,9 +44,9 @@ local setkern = nuts.setkern
local getkern = nuts.getkern
local getheight = nuts.getheight
-local insert_node_after = nuts.insert_after
+local insertnodeafter = nuts.insertafter
local remove_node = nuts.remove
-local end_of_math = nuts.end_of_math
+local endofmath = nuts.endofmath
local texgetattribute = tex.getattribute
local texsetattribute = tex.setattribute
@@ -182,7 +182,7 @@ local enablemath = false
local enabletext = false
local function domath(head,current)
- current = end_of_math(current)
+ current = endofmath(current)
local next = getnext(current)
if next then
local char, id = isglyph(next)
@@ -251,7 +251,7 @@ local function domath(head,current)
if trace_italics then
report_italics("%s italic %p between math %C and non punctuation %C","adding",a,getchar(glyph),char)
end
- insert_node_after(head,glyph,correction_kern(a,glyph))
+ insertnodeafter(head,glyph,correction_kern(a,glyph))
end
end
end
@@ -309,7 +309,7 @@ local function texthandler(head)
if font ~= lastfont then
if previtalic ~= 0 then
if okay(data,current,font,prevchar,previtalic,char,"glyph") then
- insert_node_after(prevhead,prev,correction_kern(previtalic,current))
+ insertnodeafter(prevhead,prev,correction_kern(previtalic,current))
end
elseif previnserted and data then
if trace_italics then
@@ -320,7 +320,7 @@ local function texthandler(head)
--
if replaceitalic ~= 0 then
if okay(data,replace,font,replacechar,replaceitalic,char,"replace") then
- insert_node_after(replacehead,replace,correction_kern(replaceitalic,current))
+ insertnodeafter(replacehead,replace,correction_kern(replaceitalic,current))
end
replaceitalic = 0
elseif replaceinserted and data then
@@ -332,7 +332,7 @@ local function texthandler(head)
--
if postitalic ~= 0 then
if okay(data,post,font,postchar,postitalic,char,"post") then
- insert_node_after(posthead,post,correction_kern(postitalic,current))
+ insertnodeafter(posthead,post,correction_kern(postitalic,current))
end
postitalic = 0
elseif postinserted and data then
@@ -484,7 +484,7 @@ local function texthandler(head)
end
previnserted = correction_glue(previtalic,current) -- maybe just add ? else problem with penalties
previtalic = 0
- insert_node_after(prevhead,prev,previnserted)
+ insertnodeafter(prevhead,prev,previnserted)
else
if replaceitalic ~= 0 then
if trace_italics then
@@ -492,7 +492,7 @@ local function texthandler(head)
end
replaceinserted = correction_kern(replaceitalic,current) -- needs to be a kern
replaceitalic = 0
- insert_node_after(replacehead,replace,replaceinserted)
+ insertnodeafter(replacehead,replace,replaceinserted)
end
if postitalic ~= 0 then
if trace_italics then
@@ -500,7 +500,7 @@ local function texthandler(head)
end
postinserted = correction_kern(postitalic,current) -- needs to be a kern
postitalic = 0
- insert_node_after(posthead,post,postinserted)
+ insertnodeafter(posthead,post,postinserted)
end
end
elseif id == math_code then
@@ -514,14 +514,14 @@ local function texthandler(head)
if mathokay then
current = domath(head,current)
else
- current = end_of_math(current)
+ current = endofmath(current)
end
else
if previtalic ~= 0 then
if trace_italics then
report_italics("inserting %p between %s italic %C and whatever",previtalic,"glyph",prevchar)
end
- insert_node_after(prevhead,prev,correction_kern(previtalic,current))
+ insertnodeafter(prevhead,prev,correction_kern(previtalic,current))
previnserted = nil
previtalic = 0
replaceinserted = nil
@@ -533,7 +533,7 @@ local function texthandler(head)
if trace_italics then
report_italics("inserting %p between %s italic %C and whatever",replaceitalic,"replace",replacechar)
end
- insert_node_after(replacehead,replace,correction_kern(replaceitalic,current))
+ insertnodeafter(replacehead,replace,correction_kern(replaceitalic,current))
previnserted = nil
previtalic = 0
replaceinserted = nil
@@ -545,7 +545,7 @@ local function texthandler(head)
if trace_italics then
report_italics("inserting %p between %s italic %C and whatever",postitalic,"post",postchar)
end
- insert_node_after(posthead,post,correction_kern(postitalic,current))
+ insertnodeafter(posthead,post,correction_kern(postitalic,current))
previnserted = nil
previtalic = 0
replaceinserted = nil
@@ -562,19 +562,19 @@ local function texthandler(head)
if trace_italics then
report_italics("inserting %p between %s italic %C and end of list",previtalic,"glyph",prevchar)
end
- insert_node_after(prevhead,prev,correction_kern(previtalic,current))
+ insertnodeafter(prevhead,prev,correction_kern(previtalic,current))
else
if replaceitalic ~= 0 then
if trace_italics then
report_italics("inserting %p between %s italic %C and end of list",replaceitalic,"replace",replacechar)
end
- insert_node_after(replacehead,replace,correction_kern(replaceitalic,current))
+ insertnodeafter(replacehead,replace,correction_kern(replaceitalic,current))
end
if postitalic ~= 0 then
if trace_italics then
report_italics("inserting %p between %s italic %C and end of list",postitalic,"post",postchar)
end
- insert_node_after(posthead,post,correction_kern(postitalic,current))
+ insertnodeafter(posthead,post,correction_kern(postitalic,current))
end
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-krn.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-krn.lua
index 489375e9be7..58d6c091ca4 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-krn.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-krn.lua
@@ -1,4 +1,4 @@
-if not modules then modules = { } end modules ['typo-krn'] = {
+ if not modules then modules = { } end modules ['typo-krn'] = {
version = 1.001,
comment = "companion to typo-krn.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
@@ -24,10 +24,9 @@ local nodepool = nuts.pool
-- check what is used
local find_node_tail = nuts.tail
-local flush_node = nuts.flush_node
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
-local end_of_math = nuts.end_of_math
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
+local endofmath = nuts.endofmath
local copy_node = nuts.copy
local getnext = nuts.getnext
@@ -129,7 +128,7 @@ local factors = kerns.factors
-- make sure it runs after all others
-- there will be a width adaptor field in nodes so this will change
-- todo: interchar kerns / disc nodes / can be made faster
--- todo: use insert_before etc
+-- todo: use insertbefore etc
local gluefactor = 4 -- assumes quad = .5 enspace
@@ -331,7 +330,7 @@ local function process_list(head,keeptogether,krn,font,okay)
-- if kerns then
-- print("it happens indeed, basemode kerns not yet injected")
-- end
- insert_node_before(head,start,new_kern((kerns and kerns[char] or 0) + kern))
+ insertnodebefore(head,start,new_kern((kerns and kerns[char] or 0) + kern))
okay = true
end
end
@@ -412,7 +411,7 @@ function kerns.handler(head)
setattr(n,a_kerns,attr) -- we took away the attr
end
setchar(n,unicode[i])
- insert_node_after(head,s,n)
+ insertnodeafter(head,s,n)
s = n
end
end
@@ -444,10 +443,10 @@ function kerns.handler(head)
local data = chardata[font][prevchar]
local kerns = data and data.kerns
local kern = (kerns and kerns[char] or 0) + quaddata[font]*krn
- insert_node_before(head,start,kern_injector(fillup,kern))
+ insertnodebefore(head,start,kern_injector(fillup,kern))
end
else
- insert_node_before(head,start,kern_injector(fillup,quaddata[font]*krn))
+ insertnodebefore(head,start,kern_injector(fillup,quaddata[font]*krn))
end
end
prev = start
@@ -557,16 +556,16 @@ function kerns.handler(head)
-- special case
local b, f = closest_bound(start,getprev)
if b then
- insert_node_before(head,start,kern_injector(fillup,quaddata[f]*krn))
+ insertnodebefore(head,start,kern_injector(fillup,quaddata[f]*krn))
end
local b, f = closest_bound(start,getnext)
if b then
- insert_node_after(head,start,kern_injector(fillup,quaddata[f]*krn))
+ insertnodeafter(head,start,kern_injector(fillup,quaddata[f]*krn))
end
end
bound = false
elseif id == math_code then
- start = end_of_math(start)
+ start = endofmath(start)
bound = false
end
if start then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-lin.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-lin.lua
index 84d622e1e9c..40247c45711 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-lin.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-lin.lua
@@ -74,8 +74,8 @@ local tonut = nodes.tonut
local tonode = nodes.tonode
local nexthlist = nuts.traversers.hlist
-local insert_before = nuts.insert_before
-local insert_after = nuts.insert_after
+local insertbefore = nuts.insertbefore
+local insertafter = nuts.insertafter
local find_tail = nuts.tail
local rehpack = nuts.rehpack
----- remove_node = nuts.remove
@@ -99,7 +99,7 @@ local setwidth = nuts.setwidth
local setprop = nuts.setprop
local getprop = nuts.rawprop -- getprop
-local effectiveglue = nuts.effective_glue
+local effectiveglue = nuts.effectiveglue
local nodepool = nuts.pool
local new_kern = nodepool.kern
@@ -147,9 +147,9 @@ local function finalize(prop,key) -- delayed calculations
end
local kern1 = new_kern(delta)
local kern2 = new_kern(-delta)
- head = insert_before(head,head,kern1)
- head = insert_before(head,head,pack)
- head = insert_before(head,head,kern2)
+ head = insertbefore(head,head,kern1)
+ head = insertbefore(head,head,pack)
+ head = insertbefore(head,head,kern2)
setlist(line,head)
local where = {
pack = pack,
@@ -207,11 +207,11 @@ local function normalize(line,islocal) -- assumes prestine lines, nothing pre/ap
if addskips then
if rightskip and not leftskip then
leftskip = new_leftskip(lskip)
- head = insert_before(head,head,leftskip)
+ head = insertbefore(head,head,leftskip)
end
if leftskip and not rightskip then
rightskip = new_rightskip(0)
- head, tail = insert_after(head,tail,rightskip)
+ head, tail = insertafter(head,tail,rightskip)
end
end
if head ~= oldhead then
@@ -267,7 +267,7 @@ function paragraphs.normalize(head,islocal)
current = getnext(current)
end
if current then
- head, current = insert_before(head,current,new_glue(l_width,l_stretch,l_shrink))
+ head, current = insertbefore(head,current,new_glue(l_width,l_stretch,l_shrink))
if head == current then
setlist(last,head)
end
@@ -303,10 +303,10 @@ local function addtoline(n,list,option)
if trace_anchors and not line.traced then
line.traced = true
local rule = new_rule(2*65536,2*65536,1*65536)
- local list = insert_before(rule,rule,new_kern(-1*65536))
+ local list = insertbefore(rule,rule,new_kern(-1*65536))
addtoline(n,list)
local rule = new_rule(2*65536,6*65536,-3*65536)
- local list = insert_before(rule,rule,new_kern(-1*65536))
+ local list = insertbefore(rule,rule,new_kern(-1*65536))
addtoline(n,list,"internal")
else
line.traced = true
@@ -329,14 +329,14 @@ local function addtoline(n,list,option)
-- optimize now .. we can also decide to put each blob in a hlist
local kern = new_kern(delta)
if tail then
- head, tail = insert_after(head,tail,kern)
+ head, tail = insertafter(head,tail,kern)
else
head, tail = kern, kern
setlist(where.pack,head)
end
- head, tail = insert_after(head,tail,blob)
+ head, tail = insertafter(head,tail,blob)
local kern = new_kern(-delta)
- head, tail = insert_after(head,tail,kern)
+ head, tail = insertafter(head,tail,kern)
--
where.head = head
where.tail = tail
@@ -366,7 +366,7 @@ local function addanchortoline(n,anchor)
end
if where.tail then
local head = where.head
- insert_before(head,head,anchor)
+ insertbefore(head,head,anchor)
else
where.tail = anchor
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-mar.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-mar.lua
index 7e69162a900..56324c79041 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-mar.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-mar.lua
@@ -61,9 +61,9 @@ local v_line = variables.line
local nuts = nodes.nuts
local tonode = nuts.tonode
-local hpack_nodes = nuts.hpack
-local traverse_id = nuts.traverse_id
-local flush_node_list = nuts.flush_list
+local hpacknodes = nuts.hpack
+local traverseid = nuts.traverseid
+local flushnodelist = nuts.flushlist
local getnext = nuts.getnext
local getprev = nuts.getprev
@@ -251,7 +251,7 @@ function margins.save(t)
local si = store[i]
if si.name == name then
local s = remove(store,i)
- flush_node_list(s.box)
+ flushnodelist(s.box)
end
end
else
@@ -259,7 +259,7 @@ function margins.save(t)
local si = store[i]
if si.name == name then
local s = remove(store,i)
- flush_node_list(s.box)
+ flushnodelist(s.box)
end
end
end
@@ -270,8 +270,8 @@ function margins.save(t)
if t.number then
local leftmargindistance = texgetdimen("naturalleftmargindistance")
local rightmargindistance = texgetdimen("naturalrightmargindistance")
- local strutbox = getbox("strutbox")
- local _, strutht, strutdp = getwhd(strutbox)
+ local strutht = texgetdimen("strutht")
+ local strutdp = texgetdimen("strutdp")
-- better make a new table and make t entry in t
t.box = content
t.n = nofsaved
@@ -492,9 +492,9 @@ local function markovershoot(current) -- todo: alleen als offset > line
v_anchors = v_anchors + 1
cache[v_anchors] = fastcopy(stacked)
local anchor = setanchor(v_anchors)
- -- local list = hpack_nodes(setlink(anchor,getlist(current))) -- not ok, we need to retain width
+ -- local list = hpacknodes(setlink(anchor,getlist(current))) -- not ok, we need to retain width
-- local list = setlink(anchor,getlist(current)) -- why not this ... better play safe
- local list = hpack_nodes(setlink(anchor,getlist(current)),getwidth(current),"exactly")--
+ local list = hpacknodes(setlink(anchor,getlist(current)),getwidth(current),"exactly")--
if trace_marginstack then
report_margindata("marking anchor %a",v_anchors)
end
@@ -790,7 +790,7 @@ local function flushed(scope,parent) -- current is hlist
if done then
local a = getattr(head,a_linenumber) -- hack .. we need a more decent critical attribute inheritance mechanism
if false then
- local l = hpack_nodes(head,getwidth(parent),"exactly")
+ local l = hpacknodes(head,getwidth(parent),"exactly")
setlist(parent,l)
if a then
setattr(l,a_linenumber,a)
@@ -905,7 +905,7 @@ end
local function finalhandler(head)
if nofdelayed > 0 then
local current = head
- while current and nofdelayed > 0 do -- traverse_list
+ while current and nofdelayed > 0 do
local id = getid(current)
if id == hlist_code then -- only lines?
local a = getprop(current,"margindata")
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-pag.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-pag.lua
index ea4b1574caf..b6a27f16731 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-pag.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-pag.lua
@@ -39,7 +39,7 @@ local setpenalty = nuts.setpenalty
local getwidth = nuts.getwidth
local getdepth = nuts.getdepth
-local insert_node_after = nuts.insert_after
+local insertnodeafter = nuts.insertafter
local new_penalty = nuts.pool.penalty
local trace_keeptogether = false
@@ -129,7 +129,7 @@ local function keeptogether(start,a,specification)
if getid(previous) == penalty_code then
setpenalty(previous,10000)
else
- insert_node_after(head,previous,new_penalty(10000))
+ insertnodeafter(head,previous,new_penalty(10000))
end
else
break
@@ -144,7 +144,7 @@ local function keeptogether(start,a,specification)
if getid(previous) == penalty_code then
setpenalty(previous,10000)
else
- insert_node_after(head,previous,new_penalty(10000))
+ insertnodeafter(head,previous,new_penalty(10000))
end
else
break
@@ -158,7 +158,7 @@ local function keeptogether(start,a,specification)
if getid(previous) == penalty_code then
setpenalty(previous,10000)
else
- insert_node_after(head,previous,new_penalty(10000))
+ insertnodeafter(head,previous,new_penalty(10000))
end
else
break
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-pnc.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-pnc.lua
index 732970884f2..79ca4f57770 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-pnc.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-pnc.lua
@@ -21,7 +21,7 @@ local glue_code = nodecodes.glue
local spaceskip_code = gluecodes.spaceskip
local new_kern = nuts.pool.kern
-local insert_after = nuts.insert_after
+local insertafter = nuts.insertafter
local nextglyph = nuts.traversers.glyph
@@ -89,7 +89,7 @@ function periodkerns.handler(head)
if factor ~= 0 then
fontspace = parameters[getfont(current)].space -- can be sped up
inserted = factor * fontspace
- insert_after(head,current,new_kern(inserted))
+ insertafter(head,current,new_kern(inserted))
if trace then
report("inserting space at %C . [%p] %C .",pchar,inserted,nchar)
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-rep.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-rep.lua
index 2538a014d10..a116a3f5d0f 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-rep.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-rep.lua
@@ -38,6 +38,7 @@ local chardata = characters.data
local collected = false
local a_stripping = attributes.private("stripping")
+
local texsetattribute = tex.setattribute
local unsetvalue = attributes.unsetvalue
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-rub.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-rub.lua
index 6c6ab9a3334..14acfdbd7fb 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-rub.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-rub.lua
@@ -49,7 +49,6 @@ local getwidth = nuts.getwidth
local setwidth = nuts.setwidth
local hpack = nuts.hpack
-local insert_after = nuts.insert_after
local takebox = nuts.takebox
local nexthlist = nuts.traversers.hlist
@@ -368,7 +367,7 @@ local function whatever(current)
end
end
-attach = function(head) -- traverse_list
+attach = function(head)
for current in nexthlist, head do
whatever(current)
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-spa.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-spa.lua
index 78fc2296443..db05963eb8a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-spa.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-spa.lua
@@ -29,10 +29,10 @@ local getprev = nuts.getprev
local takeattr = nuts.takeattr
local isglyph = nuts.isglyph
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local remove_node = nuts.remove
-local end_of_math = nuts.end_of_math
+local endofmath = nuts.endofmath
local nodepool = nuts.pool
local new_penalty = nodepool.penalty
@@ -116,8 +116,8 @@ function spacings.handler(head)
if trace_spacing then
report_spacing("inserting penalty and space before %C (left)",char)
end
- insert_node_before(head,start,new_penalty(10000))
- insert_node_before(head,start,new_glue(left*quad))
+ insertnodebefore(head,start,new_penalty(10000))
+ insertnodebefore(head,start,new_glue(left*quad))
end
end
local next = getnext(start)
@@ -152,15 +152,15 @@ function spacings.handler(head)
if trace_spacing then
report_spacing("inserting penalty and space after %C (right)",char)
end
- insert_node_after(head,start,new_glue(right*quad))
- insert_node_after(head,start,new_penalty(10000))
+ insertnodeafter(head,start,new_glue(right*quad))
+ insertnodeafter(head,start,new_penalty(10000))
end
end
end
end
end
elseif id == math_code then
- start = end_of_math(start) -- weird, can return nil .. no math end?
+ start = endofmath(start) -- weird, can return nil .. no math end?
end
if start then
start = getnext(start)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-sus.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-sus.lua
index bb5b03912ce..993f4c7982d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-sus.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-sus.lua
@@ -57,9 +57,9 @@ local setattr = nuts.setattr
local setlist = nuts.setlist
local setcolor = nodes.tracers.colors.set
-local insert_before = nuts.insert_before
-local insert_after = nuts.insert_after
-local end_of_math = nuts.end_of_math
+local insertbefore = nuts.insertbefore
+local insertafter = nuts.insertafter
+local endofmath = nuts.endofmath
local nodepool = nuts.pool
@@ -123,22 +123,22 @@ local function mark(head,current,id,color)
local width = getwidth(current)
local rule = new_rule(width)
local kern = new_kern(-width)
- head = insert_before(head,current,rule)
- head = insert_before(head,current,kern)
+ head = insertbefore(head,current,rule)
+ head = insertbefore(head,current,kern)
setcolor(rule,color)
-- elseif id == kern_code then
-- local width = getkern(current)
-- local rule = new_rule(width)
-- local kern = new_kern(-width)
- -- head = insert_before(head,current,rule)
- -- head = insert_before(head,current,kern)
+ -- head = insertbefore(head,current,rule)
+ -- head = insertbefore(head,current,kern)
-- setcolor(rule,color)
else
local width, height, depth = getwhd(current)
local extra = fonts.hashes.xheights[getfont(current)] / 2
local rule = new_rule(width,height+extra,depth+extra)
local hlist = new_hlist(rule)
- head = insert_before(head,current,hlist)
+ head = insertbefore(head,current,hlist)
setcolor(rule,color)
setcolor(current,"white")
end
@@ -226,7 +226,7 @@ function typesetters.marksuspects(head)
end
current = getnext(current)
elseif id == math_code then
- current = getnext(end_of_math(current))
+ current = getnext(endofmath(current))
elseif id == glue_code then
local a = getattr(current,a_characters)
if a then
@@ -270,7 +270,7 @@ local function showsuspects(head)
head, current = mark(head,current,id,colors[a])
end
elseif id == math_code then
- current = end_of_math(current)
+ current = endofmath(current)
elseif id == hlist_code or id == vlist_code then
local list = getlist(current)
if list then
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-tal.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-tal.lua
index db605a4916d..b827b8ef9ab 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-tal.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-tal.lua
@@ -47,8 +47,8 @@ local isglyph = nuts.isglyph
local setattr = nuts.setattr
local setchar = nuts.setchar
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local nextglyph = nuts.traversers.glyph
local getdimensions = nuts.dimensions
@@ -376,46 +376,46 @@ function characteralign.handler(head,where)
local new_kern = trace_split and traced_kern or new_kern
if b_start then
if before < maxbefore then
- head = insert_node_before(head,b_start,new_kern(maxbefore-before))
+ head = insertnodebefore(head,b_start,new_kern(maxbefore-before))
end
if not c then
-- print("[before]")
if dataset.hasseparator then
local width = fontcharacters[getfont(b_start)][separator].width
- insert_node_after(head,b_stop,new_kern(maxafter+width))
+ insertnodeafter(head,b_stop,new_kern(maxafter+width))
end
elseif a_start then
-- print("[before] [separator] [after]")
if after < maxafter then
- insert_node_after(head,a_stop,new_kern(maxafter-after))
+ insertnodeafter(head,a_stop,new_kern(maxafter-after))
end
else
-- print("[before] [separator]")
if maxafter > 0 then
- insert_node_after(head,c,new_kern(maxafter))
+ insertnodeafter(head,c,new_kern(maxafter))
end
end
elseif a_start then
if c then
-- print("[separator] [after]")
if maxbefore > 0 then
- head = insert_node_before(head,c,new_kern(maxbefore))
+ head = insertnodebefore(head,c,new_kern(maxbefore))
end
else
-- print("[after]")
local width = fontcharacters[getfont(b_stop)][separator].width
- head = insert_node_before(head,a_start,new_kern(maxbefore+width))
+ head = insertnodebefore(head,a_start,new_kern(maxbefore+width))
end
if after < maxafter then
- insert_node_after(head,a_stop,new_kern(maxafter-after))
+ insertnodeafter(head,a_stop,new_kern(maxafter-after))
end
elseif c then
-- print("[separator]")
if maxbefore > 0 then
- head = insert_node_before(head,c,new_kern(maxbefore))
+ head = insertnodebefore(head,c,new_kern(maxbefore))
end
if maxafter > 0 then
- insert_node_after(head,c,new_kern(maxafter))
+ insertnodeafter(head,c,new_kern(maxafter))
end
end
return head
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-wrp.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-wrp.lua
index f2ca43b56ef..4ba3c3afff0 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-wrp.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-wrp.lua
@@ -53,6 +53,8 @@ local report = logs.reporter("paragraphs","wrappers")
-- If needed we can extend this checker for other cases but then we will also
-- use attributes.
+-- we can actually do better in lmtx
+
local function remove_dangling_crlf(head,tail)
if head and tail and getid(tail) == glue_code and getsubtype(tail) == parfillskip_code then
tail = getprev(tail)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-wrp.mkiv b/Master/texmf-dist/tex/context/base/mkiv/typo-wrp.mkiv
index 4e9ecf2e128..3a3bb4fafad 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-wrp.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-wrp.mkiv
@@ -49,7 +49,7 @@
\ignorespaces}
\unexpanded\def\spac_crlf_placeholder
- {\strut}
+ {\wordboundary\strut} % or \endstrut
\unexpanded\def\spac_crlf_placeholder_show
{\wordboundary
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-deb.lua b/Master/texmf-dist/tex/context/base/mkiv/util-deb.lua
index bd94b6d01ed..10e5731b036 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-deb.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-deb.lua
@@ -346,3 +346,25 @@ debugger.showtraceback = showtraceback
-- debug.showtraceback = showtraceback
-- showtraceback()
+
+-- For now also here because we want it in mtxrun (taken from lmt file):
+
+if luac then
+
+ local show, dump = luac.print, string.dump
+
+ function luac.inspect(v)
+ if type(v) == "function" then
+ local ok, str = xpcall(dump,function() end,v)
+ if ok then
+ v = str
+ end
+ end
+ if type(v) == "string" then
+ show(v,true)
+ else
+ print(v)
+ end
+ end
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-evo-imp-server.lua b/Master/texmf-dist/tex/context/base/mkiv/util-evo-imp-server.lua
index f4dd5b3f7fc..b2672012825 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-evo-imp-server.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-evo-imp-server.lua
@@ -65,6 +65,13 @@ function evohome.server(specification)
local port = specification.port or (presets.server and presets.server.port) or 8068
local host = specification.host or (presets.server and presets.server.host) or "*"
+ if presets.initial == "alloff" then
+ report("turning all zones off")
+ evohome.actions.alloff(presets)
+ else
+ report("using default initial state")
+ end
+
package.extraluapath(presets.filepath)
local socket = socket or require("socket")
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-evo.lua b/Master/texmf-dist/tex/context/base/mkiv/util-evo.lua
index dfb395e082b..75c2282f0f2 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-evo.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-evo.lua
@@ -44,7 +44,7 @@ local formatters = string.formatters
local floor, div = math.floor, math.div
local resultof, ostime, osdate, ossleep = os.resultof, os.time, os.date, os.sleep
local jsontolua, jsontostring = json.tolua, json.tostring
-local savetable, loadtable, sortedkeys = table.save, table.load, table.sortedkeys
+local savetable, loadtable, sortedkeys, sortedhash = table.save, table.load, table.sortedkeys, table.sortedhash
local setmetatableindex, setmetatablenewindex = table.setmetatableindex, table.setmetatablenewindex
local replacer = utilities.templates.replacer
local lower = string.lower -- no utf support yet (encoding needs checking in evohome)
@@ -172,9 +172,11 @@ local function loadedtable(filename)
return { }
end
-local function savedtable(filename,data)
+local function savedtable(filename,data,trace)
savetable(filename,data)
- report("file %a saved",filename)
+ if trace then
+ report("file %a saved",filename)
+ end
end
local function loadpresets(filename)
@@ -823,11 +825,12 @@ local function settask(presets,when,tag,action)
done = false,
category = category,
action = action,
+ tag = tag,
}
else
list[tag] = nil
end
- savedtable(presets.files.schedules,list)
+ savedtable(presets.files.schedules,list,false)
end
end
@@ -990,6 +993,15 @@ local function poller(presets)
return step, process, presets
end
+local function alloff(presets)
+ local zones = getzonenames(presets)
+ if zones then
+ for i=1,#zones do
+ setzonestate(presets,zones[i],5,true)
+ end
+ end
+end
+
--
evohome = {
@@ -1023,6 +1035,8 @@ evohome = {
schedule = schedule, -- presets, name
permanent = permanent, -- presets, name
--
+ alloff = alloff, -- presets
+ --
settomorrow = settomorrow, -- presets, tag, function
resettomorrow = resettomorrow, -- presets, tag
tomorrowset = tomorrowset, -- presets, tag
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-fil.lua b/Master/texmf-dist/tex/context/base/mkiv/util-fil.lua
index 183f7bea81f..0b20264ecc9 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-fil.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-fil.lua
@@ -203,23 +203,23 @@ function files.readinteger4le(f)
end
function files.readfixed2(f)
- local a, b = byte(f:read(2),1,2)
- if a >= 0x80 then
- tonumber((a - 0x100) .. "." .. b)
- else
- tonumber(( a ) .. "." .. b)
+ local n1, n2 = byte(f:read(2),1,2)
+ if n1 >= 0x80 then
+ n1 = n1 - 0x100
end
+ return n1 + n2/0xFF
end
-- (real) (n>>16) + ((n&0xffff)/65536.0)) but no cast in lua (we could use unpack)
function files.readfixed4(f)
local a, b, c, d = byte(f:read(4),1,4)
- if a >= 0x80 then
- tonumber((0x100 * a + b - 0x10000) .. "." .. (0x100 * c + d))
- else
- tonumber((0x100 * a + b ) .. "." .. (0x100 * c + d))
+ local n1 = 0x100 * a + b
+ local n2 = 0x100 * c + d
+ if n1 >= 0x8000 then
+ n1 = n1 - 0x10000
end
+ return n1 + n2/0xFFFF
end
-- (real) ((n<<16)>>(16+14)) + ((n&0x3fff)/16384.0))
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-jsn.lua b/Master/texmf-dist/tex/context/base/mkiv/util-jsn.lua
index 8da35189793..6d12c520aeb 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-jsn.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-jsn.lua
@@ -17,6 +17,10 @@ if not modules then modules = { } end modules ['util-jsn'] = {
--
-- Upgraded for handling the somewhat more fax server templates.
+if utilities and utilities.json then
+ return json
+end
+
local P, V, R, S, C, Cc, Cs, Ct, Cf, Cg = lpeg.P, lpeg.V, lpeg.R, lpeg.S, lpeg.C, lpeg.Cc, lpeg.Cs, lpeg.Ct, lpeg.Cf, lpeg.Cg
local lpegmatch = lpeg.match
local format, gsub = string.format, string.gsub
@@ -265,6 +269,8 @@ do
k = lpegmatch(escaper,k) or k
v = lpegmatch(escaper,v) or v
n = n + 1 t[n] = f_key_val_str(depth,k,v)
+ elseif i > 1 then
+ n = n - 1
end
elseif tv == "table" then
local l = #v
@@ -280,6 +286,9 @@ do
end
elseif next(v) then
tojsonpp(v,k,depth,level+1,0)
+ elseif i > 1 then
+ n = n - 1
+ -- we don't know if we have a hash or string
end
elseif tv == "boolean" then
if tk == "number" then
@@ -297,6 +306,8 @@ do
else
t[n] = f_key_val_nop(depth,k)
end
+ elseif i > 1 then
+ n = n - 1
end
else
if tk == "number" then
@@ -306,6 +317,8 @@ do
k = lpegmatch(escaper,k) or k
n = n + 1
t[n] = f_key_val_null(depth,k)
+ elseif i > 1 then
+ n = n - 1
end
end
end
@@ -440,4 +453,8 @@ end
-- inspect(l)
-- print(s==l.s)
+-- if not package.loaded.json then
+-- package.loaded.json = json
+-- end
+
return json
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-lib-imp-gm.lua b/Master/texmf-dist/tex/context/base/mkiv/util-lib-imp-gm.lua
index d1ffde87903..99c62451c81 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-lib-imp-gm.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-lib-imp-gm.lua
@@ -6,6 +6,10 @@ if not modules then modules = { } end modules ['util-lib-imp-gm'] = {
license = "see context related readme files",
}
+if true then
+ logs.report("warning","swiglib is no longer supported")
+end
+
local graphicmagick = utilities.graphicmagick or { }
utilities.graphicmagick = graphicmagick
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-lib-imp-gs.lua b/Master/texmf-dist/tex/context/base/mkiv/util-lib-imp-gs.lua
index 0eceda7aa5d..305f4103b19 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-lib-imp-gs.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-lib-imp-gs.lua
@@ -6,6 +6,10 @@ if not modules then modules = { } end modules ['util-lib-imp-gs'] = {
license = "see context related readme files",
}
+if true then
+ logs.report("warning","swiglib is no longer supported")
+end
+
local insert = table.insert
local formatters = string.formatters
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-lib.lua b/Master/texmf-dist/tex/context/base/mkiv/util-lib.lua
index be763d92e91..77ec7cd7e20 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-lib.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-lib.lua
@@ -245,6 +245,8 @@ end
resolvers.locatelib = locate -- for now
+-- swiglib is no longer officially supported
+
do
local report_swiglib = logs.reporter("swiglib")
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-prs.lua b/Master/texmf-dist/tex/context/base/mkiv/util-prs.lua
index 6d2f8c19e06..635b610e072 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-prs.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-prs.lua
@@ -55,9 +55,13 @@ local nobracket = 1 - (lbracket + rbracket)
local escape, left, right = P("\\"), P('{'), P('}')
+-- lpegpatterns.balanced = P {
+-- [1] = ((escape * (left+right)) + (1 - (left+right)) + V(2))^0,
+-- [2] = left * V(1) * right
+-- }
lpegpatterns.balanced = P {
- [1] = ((escape * (left+right)) + (1 - (left+right)) + V(2))^0,
- [2] = left * V(1) * right
+ ((escape * (left+right)) + (1 - (left+right)) + V(2))^0,
+ left * V(1) * right
}
local nestedbraces = P { lbrace * (nobrace + V(1))^0 * rbrace }
@@ -67,11 +71,12 @@ local spaces = space^0
local argument = Cs((lbrace/"") * ((nobrace + nestedbraces)^0) * (rbrace/""))
local content = (1-endofstring)^0
-lpegpatterns.nestedbraces = nestedbraces -- no capture
-lpegpatterns.nestedparents = nestedparents -- no capture
-lpegpatterns.nested = nestedbraces -- no capture
-lpegpatterns.argument = argument -- argument after e.g. =
-lpegpatterns.content = content -- rest after e.g =
+lpegpatterns.nestedbraces = nestedbraces -- no capture
+lpegpatterns.nestedparents = nestedparents -- no capture
+lpegpatterns.nestedbrackets = nestedbrackets -- no capture
+lpegpatterns.nested = nestedbraces -- no capture
+lpegpatterns.argument = argument -- argument after e.g. =
+lpegpatterns.content = content -- rest after e.g =
local value = lbrace * C((nobrace + nestedbraces)^0) * rbrace
+ C((nestedbraces + (1-comma))^0)
@@ -568,9 +573,9 @@ end
-- "1","2","3","4"
-- "5","6","7","8"
-- ]]
---
+
-- local mycsvsplitter = parsers.csvsplitter { numbers = true }
---
+
-- local list = mycsvsplitter(crap) inspect(list)
-- and this is a slightly patched version of a version posted by Philipp Gesang
@@ -617,12 +622,6 @@ end
-- local list, names = mycsvsplitter(crap,true) inspect(list) inspect(names)
-- local list, names = mycsvsplitter(crap) inspect(list) inspect(names)
--- parsers.stepper("1,7-",9,function(i) print(">>>",i) end)
--- parsers.stepper("1-3,7,8,9")
--- parsers.stepper("1-3,6,7",function(i) print(">>>",i) end)
--- parsers.stepper(" 1 : 3, ,7 ")
--- parsers.stepper("1:4,9:13,24:*",30)
-
local function ranger(first,last,n,action)
if not first then
-- forget about it
@@ -639,7 +638,7 @@ local function ranger(first,last,n,action)
end
end
-local cardinal = lpegpatterns.cardinal / tonumber
+local cardinal = (lpegpatterns.hexadecimal + lpegpatterns.cardinal) / tonumber
local spacers = lpegpatterns.spacer^0
local endofstring = lpegpatterns.endofstring
@@ -650,14 +649,29 @@ local stepper = spacers * ( cardinal * ( spacers * S(":-") * spacers * ( cardin
* Carg(1) * Carg(2) / ranger * S(", ")^0 )^1 * endofstring -- we're sort of strict (could do without endofstring)
function parsers.stepper(str,n,action)
+ local ts = type(str)
if type(n) == "function" then
- lpegmatch(stepper,str,1,false,n or print)
- else
+ if ts == "number" then
+ n(str)
+ elseif ts == "table" then
+ for i=1,#str do
+ n(str[i])
+ end
+ else
+ lpegmatch(stepper,str,1,false,n or print)
+ end
+ elseif ts == "string" then
lpegmatch(stepper,str,1,n,action or print)
end
end
---
+-- parsers.stepper("1,7-",9,function(i) print(">>>",i) end)
+-- parsers.stepper("1-3,7,8,9")
+-- parsers.stepper("1-3,6,7",function(i) print(">>>",i) end)
+-- parsers.stepper(" 1 : 3, ,7 ")
+-- parsers.stepper("1:4,9:13,24:*",30)
+-- parsers.stepper(1,print)
+-- parsers.stepper({1,3,4},print)
local pattern_math = Cs((P("%")/"\\percent " + P("^") * Cc("{") * lpegpatterns.integer * Cc("}") + anything)^0)
local pattern_text = Cs((P("%")/"\\percent " + (P("^")/"\\high") * Cc("{") * lpegpatterns.integer * Cc("}") + anything)^0)
@@ -681,7 +695,7 @@ local spaces = lpegpatterns.space^0
local dummy = function() end
setmetatableindex(cache,function(t,k)
- local separator = P(k)
+ local separator = S(k) -- was P
local value = (1-separator)^0
local pattern = spaces * C(value) * separator^0 * Cp()
t[k] = pattern
@@ -801,11 +815,20 @@ local pattern = Cf( Ct("") *
( Cg(Cc("day") * cardinal)
* S("-/") * Cg(Cc("month") * cardinal)
* S("-/") * Cg(Cc("year") * p_year)
+ ) +
+ ( Cg(Cc("year") * p_year)
+ * S("-/") * Cg(Cc("month") * cardinal)
+ ) +
+ ( Cg(Cc("month") * cardinal)
+ * S("-/") * Cg(Cc("year") * p_year)
)
)
- * P(" ") * Cg(Cc("hour") * cardinal)
+ * (
+ P(" ") * Cg(Cc("hour") * cardinal)
* P(":") * Cg(Cc("min") * cardinal)
* (P(":") * Cg(Cc("sec") * cardinal))^-1
+ + P(-1) )
+
, rawset)
lpegpatterns.splittime = pattern
@@ -814,6 +837,8 @@ function parsers.totime(str)
return lpegmatch(pattern,str)
end
+-- inspect(parsers.totime("2019-03-05"))
+-- inspect(parsers.totime("2019-03-05 12:12:12"))
-- print(os.time(parsers.totime("2019-03-05 12:12:12")))
-- print(os.time(parsers.totime("2019/03/05 12:12:12")))
-- print(os.time(parsers.totime("05-03-2019 12:12:12")))
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-rnd.lua b/Master/texmf-dist/tex/context/base/mkiv/util-rnd.lua
new file mode 100644
index 00000000000..7504965b21a
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-rnd.lua
@@ -0,0 +1,116 @@
+if not modules then modules = { } end modules ['util-rnd'] = {
+ version = 1.001,
+ comment = "companion to luat-lib.mkiv",
+ author = "Tamara, Adriana, Tomáš Hála & Hans Hagen",
+ copyright = "ConTeXt Development Team", -- umbrella
+ license = "see context related readme files"
+}
+
+-- The rounding code is a variant on Tomáš Hála <tomas.hala@mendelu.cz; mendelu@thala.cz>
+-- code that is used in the statistical module. We use local variables and a tolerant name
+-- resolver that also permits efficient local aliases. With code like this one
+-- really have to make sure that locals are used because changing the rounding
+-- can influence other code.
+
+local floor, ceil, pow = math.floor, math.ceil, math.pow
+local rawget, type = rawget, type
+local gsub, lower = string.gsub, string.lower
+
+local rounding = { }
+
+local methods = {
+ no = function(num)
+ -- no rounding
+ return num
+ end,
+ up = function(num,coef)
+ -- ceiling rounding
+ coef = coef and pow(10,coef) or 1
+ return ceil(num * coef) / coef
+ end,
+ down = function(num,coef)
+ -- floor rounding
+ coef = coef and pow(10,coef) or 1
+ return floor(num * coef) / coef
+ end,
+ halfup = function(num,coef)
+ -- rounds decimal numbers as usual, numbers with 0.5 up, too (e.g. number -0.5 will be rounded to 0)
+ coef = coef and pow(10,coef) or 1
+ return floor(num * coef + 0.5) / coef
+ end,
+ halfdown = function(num,coef)
+ -- rounds decimal numbers as usual, numbers with 0.5 down, too (e.g. number 0.5 will be rounded to 0)
+ coef = coef and pow(10,coef) or 1
+ return ceil(num * coef -0.5) / coef
+ end,
+ halfabsup = function(num,coef)
+ -- rounds deciaml numbers as usual, numbers with 0.5 away from zero, e.g. numbers -0.5 and 0.5 will be rounded to -1 and 1
+ coef = coef and pow(10,coef) or 1
+ return (num >= 0 and floor(num * coef + 0.5) or ceil(num * coef - 0.5)) / coef
+ end,
+ halfabsdown = function(num,coef)
+ -- rounds deciaml numbers as usual, numbers with 0.5 towards zero, e.g. numbers -0.5 and 0.5 will be rounded both to 0
+ coef = coef and pow(10,coef) or 1
+ return (num < 0 and floor(num * coef + 0.5) or ceil(num * coef - 0.5)) / coef
+ end,
+ halfeven = function(num,coef)
+ -- rounds deciaml numbers as usual, numbers with 0.5 to the nearest even, e.g. numbers 1.5 and 2.5 will be rounded both to 2
+ coef = coef and pow(10,coef) or 1
+ num = num*coef
+ return floor(num + (((num - floor(num)) ~= 0.5 and 0.5) or ((floor(num) % 2 == 1) and 1) or 0)) / coef
+ end,
+ halfodd = function(num,coef)
+ -- rounds deciaml numbers as usual, numbers with 0.5 to the nearest odd (e.g. numbers 1.5 and 2.5 will be rounded to 1 and 3
+ coef = coef and pow(10,coef) or 1
+ num = num * coef
+ return floor(num + (((num - floor(num)) ~= 0.5 and 0.5) or ((floor(num) % 2 == 1) and 0) or 1)) / coef
+ end,
+}
+
+methods.default = methods.halfup
+
+rounding.methods = table.setmetatableindex(methods,function(t,k)
+ local s = gsub(lower(k),"[^a-z]","")
+ local v = rawget(t,s)
+ if not v then
+ v = t.halfup
+ end
+ t[k] = v
+ return v
+end)
+
+-- If needed I can make a high performance one.
+
+local defaultmethod = methods.halfup
+
+rounding.round = function(num,dec,mode)
+ if type(dec) == "string" then
+ mode = dec
+ dec = 1
+ end
+ return (mode and methods[mode] or defaultmethods)(num,dec)
+end
+
+number.rounding = rounding
+
+-- -- Tomáš' test numbers:
+
+-- local list = { 5.49, 5.5, 5.51, 6.49, 6.5, 6.51, 0.5, 12.45 }
+--
+-- for method, round in table.sortedhash(number.rounding.methods) do
+-- for i=1,#list do
+-- local n = list[i]
+-- print(n,method,round(n,k),round(n,k,3))
+-- end
+-- end
+--
+-- local myround = number.rounding.methods["HALF ABS DOWN"]
+--
+-- for i=1,#list do
+-- local n = list[i]
+-- print(n,"Half Abs Down",number.rounding.round(n,1,"Half Abs Down"))
+-- print(n,"HALF_ABS_DOWN",number.rounding.round(n,1,"HALF_ABS_DOWN"))
+-- print(n,"HALF_ABS_DOWN",myround(n,1))
+-- end
+
+return rounding
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-sac.lua b/Master/texmf-dist/tex/context/base/mkiv/util-sac.lua
index a8851f4c835..36daef81673 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-sac.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-sac.lua
@@ -262,12 +262,11 @@ function streams.readfixed2(f)
local i = f[2]
local j = i + 1
f[2] = j + 1
- local a, b = byte(f[1],i,j)
- if a >= 0x80 then
- return tonumber((a - 0x100) .. "." .. b) or 0
- else
- return tonumber((a ) .. "." .. b) or 0
+ local n1, n2 = byte(f[1],i,j)
+ if n1 >= 0x80 then
+ n1 = n1 - 0x100
end
+ return n1 + n2/0xFF
end
function streams.readfixed4(f)
@@ -275,11 +274,12 @@ function streams.readfixed4(f)
local j = i + 3
f[2] = j + 1
local a, b, c, d = byte(f[1],i,j)
- if a >= 0x80 then
- return tonumber((0x100 * a + b - 0x10000) .. "." .. (0x100 * c + d)) or 0
- else
- return tonumber((0x100 * a + b ) .. "." .. (0x100 * c + d)) or 0
+ local n1 = 0x100 * a + b
+ local n2 = 0x100 * c + d
+ if n1 >= 0x8000 then
+ n1 = n1 - 0x10000
end
+ return n1 + n2/0xFFFF
end
if bit32 then
@@ -377,10 +377,10 @@ if sio and sio.readcardinal2 then
f[2] = i + 4
return readfixed4(f[1],i)
end
- function streams.read2dot4(f)
+ function streams.read2dot14(f)
local i = f[2]
f[2] = i + 2
- return read2dot4(f[1],i)
+ return read2dot14(f[1],i)
end
function streams.readbytes(f,n)
local i = f[2]
@@ -507,10 +507,10 @@ do
function io.newreader(str,method)
local f, m
if method == "string" then
- f = openstring(str)
+ f = openstring(str,true)
m = streams
elseif method == "stream" then
- f = openstream(str)
+ f = openstream(str,true)
m = streams
else
f = openfile(str,"rb")
@@ -522,6 +522,7 @@ do
__index = function(t,k)
local r = m[k]
if k == "close" then
+ -- maybe use __toclose
if f then
m.close(f)
f = nil
@@ -543,3 +544,39 @@ do
end
end
+
+if bit32 and not streams.tocardinal1 then
+
+ local extract = bit32.extract
+ local char = string.char
+
+ streams.tocardinal1 = char
+ function streams.tocardinal2(n) return char(extract( 8,8),extract( 0,8)) end
+ function streams.tocardinal3(n) return char(extract(16,8),extract( 8,8),extract(0,8)) end
+ function streams.tocardinal4(n) return char(extract(24,8),extract(16,8),extract(8,8),extract(0,8)) end
+
+ streams.tocardinal1le = char
+ function streams.tocardinal2le(n) return char(extract(0,8),extract(8,8)) end
+ function streams.tocardinal3le(n) return char(extract(0,8),extract(8,8),extract(16,8)) end
+ function streams.tocardinal4le(n) return char(extract(0,8),extract(8,8),extract(16,8),extract(24,8)) end
+
+end
+
+if not streams.readcstring then
+
+ local readchar = streams.readchar
+ local concat = table.concat
+
+ function streams.readcstring(f)
+ local t = { }
+ while true do
+ local c = readchar(f)
+ if c and c ~= "\0" then
+ t[#t+1] = c
+ else
+ return concat(t)
+ end
+ end
+ end
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-sbx.lua b/Master/texmf-dist/tex/context/base/mkiv/util-sbx.lua
index cd282009e0a..066ca30237e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-sbx.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-sbx.lua
@@ -330,7 +330,7 @@ local function validcommand(name,program,template,checkers,defaults,variables,re
-- for now, we will have a "flags" checker
else
local checker = validators[chktype]
- if checker then
+ if checker and type(value) == "string" then
value = checker(unquoted(value),strict)
if value then
variables[variable] = optionalquoted(value)
@@ -350,7 +350,7 @@ local function validcommand(name,program,template,checkers,defaults,variables,re
local chktype = checkers[variable]
if chktype == "verbose" then
-- for now, we will have a "flags" checker
- else
+ elseif type(default) == "string" then
local checker = validators[chktype]
if checker then
default = checker(unquoted(default),strict)
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-sci.lua b/Master/texmf-dist/tex/context/base/mkiv/util-sci.lua
index 778991ea69d..67528c74e0a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-sci.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-sci.lua
@@ -23,6 +23,7 @@ do
lexerroot = file.dirname(resolvers.findfile("scite-context-lexer.lua"))
-- end
if lfs.isdir(lexerroot) then
+ -- pushluapath
package.extraluapath(lexerroot)
package.extraluapath(lexerroot.."/themes")
package.extraluapath(lexerroot.."/data")
@@ -58,14 +59,14 @@ local knownlexers = {
-- todo: pat/hyp ori
}
-lexer = nil -- main lexer, global (for the moment needed for themes)
+lexers = nil -- main lexer, global (for the moment needed for themes)
local function loadscitelexer()
- if not lexer then
- lexer = require("scite-context-lexer")
- require("scite-context-theme") -- uses lexer
- if lexer then
- lexer.context.disablewordcheck()
+ if not lexers then
+ lexers = require("scite-context-lexer")
+ lexers.styles = require("scite-context-theme") -- uses lexer
+ if lexers then
+ (lexers.disablewordcheck or lexers.context.disablewordcheck)()
end
end
return lexer
@@ -74,7 +75,7 @@ end
local loadedlexers = setmetatableindex(function(t,k)
local l = knownlexers[k] or k
loadscitelexer()
- local v = lexer.load(formatters["scite-context-lexer-%s"](l))
+ local v = lexers.load(formatters["scite-context-lexer-%s"](l))
t[l] = v
t[k] = v
return v
@@ -124,7 +125,7 @@ local function exportcsslexing()
return (#f == 0 and f[1] == 0) or ((f[1] == f[2]) and (f[2] == f[3]) and (f[3] == 0))
end
local result, r = { }, 0
- for k, v in table.sortedhash(lexer.context.styles) do
+ for k, v in table.sortedhash(lexers.context.styles) do
local bold = v.bold
local fore = v.fore
r = r + 1
@@ -149,7 +150,7 @@ local function exportwhites()
end
local function exportstyled(lexer,text,numbered)
- local result = lexer.lex(lexer,text,0)
+ local result = lexers.lex(lexer,text,0)
local start = 1
local whites = exportwhites()
local buffer = { }
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-sql-imp-ffi.lua b/Master/texmf-dist/tex/context/base/mkiv/util-sql-imp-ffi.lua
index f440695023d..cbfd7bcf5f6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-sql-imp-ffi.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-sql-imp-ffi.lua
@@ -8,8 +8,7 @@ if not modules then modules = { } end modules ['util-sql-imp-ffi'] = {
-- I looked at luajit-mysql to see how the ffi mapping was done but it didn't work
-- out that well (at least not on windows) but I got the picture. As I have somewhat
--- different demands I simplified / redid the ffi bit and just took the swiglib
--- variant and adapted that.
+-- different demands I simplified.
local tonumber = tonumber
local concat = table.concat
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-sql-imp-sqlite.lua b/Master/texmf-dist/tex/context/base/mkiv/util-sql-imp-sqlite.lua
index a88035f683a..781c92c896d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-sql-imp-sqlite.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-sql-imp-sqlite.lua
@@ -22,20 +22,6 @@ local preparetemplate = helpers.preparetemplate
local setmetatable = setmetatable
local formatters = string.formatters
------ sqlite = require("swiglib.sqlite.core")
------ swighelpers = require("swiglib.helpers.core")
------
------ get_list_item = sqlite.char_p_array_getitem
------ is_okay = sqlite.SQLITE_OK
------ execute_query = sqlite.sqlite3_exec_lua_callback
------ error_message = sqlite.sqlite3_errmsg
------
------ new_db = sqlite.new_sqlite3_p_array
------ open_db = sqlite.sqlite3_open
------ get_db = sqlite.sqlite3_p_array_getitem
------ close_db = sqlite.sqlite3_close
------ dispose_db = sqlite.delete_sqlite3_p_array
-
local ffi = require("ffi")
ffi.cdef [[
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-sql-imp-swiglib.lua b/Master/texmf-dist/tex/context/base/mkiv/util-sql-imp-swiglib.lua
index 786b4bffc2b..16f6d533a5e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-sql-imp-swiglib.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-sql-imp-swiglib.lua
@@ -6,6 +6,10 @@ if not modules then modules = { } end modules ['util-sql-imp-swiglib'] = {
license = "see context related readme files"
}
+if true then
+ logs.report("warning","swiglib is no longer supported")
+end
+
-- As the regular library is flawed (i.e. there are crashes in the table
-- construction code) and also not that efficient, Luigi Scarso looked into
-- a swig binding. This is a bit more low level approach but as we stay
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-sql-tickets.lua b/Master/texmf-dist/tex/context/base/mkiv/util-sql-tickets.lua
index 3258fb186d8..d852212bcc5 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-sql-tickets.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-sql-tickets.lua
@@ -18,7 +18,7 @@ local ostime, uuid, osfulltime = os.time, os.uuid, os.fulltime
local random = math.random
local concat = table.concat
-if not utilities.sql then require("util-sql") end
+-- if not utilities.sql then require("util-sql") end
local sql = utilities.sql
local tickets = { }
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-sql-tracers.lua b/Master/texmf-dist/tex/context/base/mkiv/util-sql-tracers.lua
index 44e32d256c6..0780f4d5bf2 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-sql-tracers.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-sql-tracers.lua
@@ -10,7 +10,7 @@ local sql = utilities.sql
local tracers = { }
sql.tracers = tracers
-sql.setmethod("swiglib")
+sql.setmethod("library")
local gsub, lower = string.gsub, string.lower
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-sql.lua b/Master/texmf-dist/tex/context/base/mkiv/util-sql.lua
index 36f3eab1935..55c4961f7da 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-sql.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-sql.lua
@@ -26,7 +26,6 @@ if not modules then modules = { } end modules ['util-sql'] = {
-- util-sql-imp-client.lua
-- util-sql-imp-library.lua
--- util-sql-imp-swiglib.lua
-- util-sql-imp-lmxsql.lua
-- local sql = require("util-sql")
@@ -36,8 +35,7 @@ if not modules then modules = { } end modules ['util-sql'] = {
-- { name = "data",type = "string" },
-- }
--
--- local execute = sql.methods.swiglib.execute
--- -- local execute = sql.methods.library.execute
+-- local execute = sql.methods.library.execute
-- -- local execute = sql.methods.client.execute
-- -- local execute = sql.methods.lmxsql.execute
--
@@ -114,7 +112,6 @@ if optional then
local methods = {
ffi = "mysql",
library = "mysql",
- swiglib = "mysql",
postgress = "postgress",
sqlite = "sqlite",
sqlite3 = "sqlite",
@@ -124,7 +121,7 @@ if optional then
local m = methods[k]
if m then
report_state("start loading method %a as %a",k,m)
- require("libs-imp-" .. m)
+ require("libs-imp-" .. m .. ".lmt") -- brrr
report_state("loading method %a done",k)
return rawget(t,m)
else
@@ -192,8 +189,7 @@ local function makeconverter(entries,celltemplate,wraptemplate)
assignments[#assignments+1] = format("[%q] = %s,",name,value)
end
end
- local code = format(wraptemplate,concat(shortcuts,"\n"),key and "{ }" or "data",key or "i",concat(assignments,"\n "))
- -- print(code)
+ local code = format(wraptemplate,concat(shortcuts,"\n"),key and "{ }" or "data",key or "i",concat(assignments,"\n "))
local func = load(code)
return func and func()
end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-str.lua b/Master/texmf-dist/tex/context/base/mkiv/util-str.lua
index 0d1f39de9d7..b5c721a41d2 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-str.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-str.lua
@@ -10,12 +10,13 @@ utilities = utilities or { }
utilities.strings = utilities.strings or { }
local strings = utilities.strings
-local format, gsub, rep, sub, find = string.format, string.gsub, string.rep, string.sub, string.find
+local format, gsub, rep, sub, find, char = string.format, string.gsub, string.rep, string.sub, string.find, string.char
local load, dump = load, string.dump
local tonumber, type, tostring, next, setmetatable = tonumber, type, tostring, next, setmetatable
local unpack, concat = table.unpack, table.concat
local P, V, C, S, R, Ct, Cs, Cp, Carg, Cc = lpeg.P, lpeg.V, lpeg.C, lpeg.S, lpeg.R, lpeg.Ct, lpeg.Cs, lpeg.Cp, lpeg.Carg, lpeg.Cc
local patterns, lpegmatch = lpeg.patterns, lpeg.match
+local tsplitat = lpeg.tsplitat
local utfchar, utfbyte, utflen = utf.char, utf.byte, utf.len
----- loadstripped = utilities.lua.loadstripped
@@ -622,7 +623,7 @@ local template = [[
return function(%s) return %s end
]]
--- this might move
+-- We only use fast serialize in controlled cases.
local pattern = Cs(Cc('"') * (
(1-S('"\\\n\r'))^1
@@ -632,12 +633,43 @@ local pattern = Cs(Cc('"') * (
+ P('\r') / '\\r'
)^0 * Cc('"'))
+-- -- I need to do more experiments with this:
+--
+-- local pattern = Cs(Cc('"') * (
+-- (1-S('"\\\n\r'))^1
+-- + P('"') / '\\034'
+-- + P('\\') / '\\092'
+-- + P('\n') / '\\013'
+-- + P('\r') / '\\010'
+-- )^0 * Cc('"'))
+
patterns.escapedquotes = pattern
function string.escapedquotes(s)
return lpegmatch(pattern,s)
end
+local pattern = (1 - P("\\"))^1 ; pattern = Cs (
+ pattern
+ * ( (P("\\") / "" * (digit^-3 / function(s) return char(tonumber(s)) end)) + pattern )^1
+)
+
+patterns.unescapedquotes = pattern
+
+function string.unescapedquotes(s)
+ return lpegmatch(pattern,s) or s
+end
+
+-- function string.longifneeded(s)
+-- if find(s,'["\\\n\r]') then
+-- return "[===[" .. s .. "]===]"
+-- else
+-- return '"' .. s ..'"'
+-- end
+-- end
+
+string.texnewlines = lpeg.replacer(patterns.newline,"\r",true)
+
-- print(string.escapedquotes('1\\23\n"'))
-- but for now here
@@ -1476,7 +1508,7 @@ end
if not string.explode then
- local tsplitat = lpeg.tsplitat
+ -- local tsplitat = lpeg.tsplitat
local p_utf = patterns.utf8character
local p_check = C(p_utf) * (P("+") * Cc(true))^0
@@ -1499,3 +1531,24 @@ if not string.explode then
end
end
+
+
+do
+
+ local p_whitespace = patterns.whitespace^1
+
+ local cache = setmetatable({ }, { __index = function(t,k)
+ local p = tsplitat(p_whitespace * P(k) * p_whitespace)
+ local v = function(s)
+ return lpegmatch(p,s)
+ end
+ t[k] = v
+ return v
+ end })
+
+ function string.wordsplitter(s)
+ return cache[s]
+ end
+
+end
+
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-tab.lua b/Master/texmf-dist/tex/context/base/mkiv/util-tab.lua
index 9f7112eb915..58ca3bcb10e 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-tab.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-tab.lua
@@ -417,9 +417,9 @@ if JITSUPPORTED then
else
- local f_v = formatters["[%q]=%q,"]
- local f_t = formatters["[%q]="]
- local f_q = formatters["%q,"]
+ -- local f_v = formatters["[%q]=%q,"]
+ -- local f_t = formatters["[%q]="]
+ -- local f_q = formatters["%q,"]
function table.fastserialize(t,prefix) -- todo, move local function out
local r = { type(prefix) == "string" and prefix or "return" }
@@ -432,7 +432,7 @@ else
local v = t[0]
if v then
m = m + 1
- r[m] = "[0]='"
+ r[m] = "[0]="
if type(v) == "table" then
fastserialize(v)
else
@@ -720,6 +720,7 @@ local function serialize(root,name,specification)
local t -- = { }
local n = 1
+ -- local m = 0 -- no gain
local unknown = false
local function do_serialize(root,name,depth,level,indexed)
@@ -850,6 +851,12 @@ local function serialize(root,name,specification)
n = n + 1 t[n] = f_key_str_value_str(depth,tostring(k),tostring(v))
end
end
+ -- if n > 100000 then -- no gain
+ -- local k = m + 1
+ -- t[k] = concat(t,"\n",k,n)
+ -- n = k
+ -- m = k
+ -- end
end
end
if level > 0 then
@@ -898,6 +905,7 @@ local function serialize(root,name,specification)
n = n + 1
t[n] = f_table_finish()
return concat(t,"\n")
+ -- return concat(t,"\n",1,n) -- no gain
end
table.serialize = serialize
@@ -970,3 +978,43 @@ end
-- return remove(t,random(1,n))
-- end
-- end
+
+function combine(target,source)
+ -- no copy so if that is needed one needs to deepcopy source first
+ if target then
+ for k, v in next, source do
+ if type(v) == "table" then
+ target[k] = combine(target[k],source[k])
+ else
+ target[k] = v
+ end
+ end
+ return target
+ else
+ return source
+ end
+end
+
+table.combine = combine
+
+-- If needed we can add something (some discussion on the list but I'm not sure if
+-- it makes sense because merging such mixed tables is quite unusual.
+--
+-- function table.himerged(...)
+-- local result = { }
+-- local r = 0
+-- for i=1,select("#",...) do
+-- local s = select(i,...)
+-- if s then
+-- for k, v in next, s do
+-- if type(k) == "number" then
+-- r = r + 1
+-- result[r] = v
+-- else
+-- result[k] = v
+-- end
+-- end
+-- end
+-- end
+-- return result
+-- end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-tar.lua b/Master/texmf-dist/tex/context/base/mkiv/util-tar.lua
new file mode 100644
index 00000000000..c8a8536a71f
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-tar.lua
@@ -0,0 +1,359 @@
+if not modules then modules = { } end modules ['util-tar'] = {
+ version = 1.001,
+ comment = "companion to luat-lib.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local type, tonumber = type, tonumber
+local gsub, escapedpattern = string.gsub, string.escapedpattern
+local nameonly, dirname, makedirs = file.nameonly, file.dirname, dir.makedirs
+local savedata = io.savedata
+local newreader = io.newreader
+
+local report = logs.reporter("tar")
+
+local types = {
+ ["0"] = "file",
+ ["\0"] = "regular",
+ ["1"] = "link",
+ ["2"] = "symbolic", -- reserved
+ ["3"] = "character",
+ ["4"] = "block",
+ ["5"] = "directory",
+ ["6"] = "fifo",
+ ["7"] = "continuation", -- reserved
+ ["x"] = "extended", -- header
+}
+
+local function asstring(str)
+ return str and gsub(str,"[\0 ]+$","") or nil
+end
+
+local function asnumber(str)
+ str = gsub(str,"\0$","")
+ return tonumber(str,8)
+end
+
+local function opentar(whatever,filename)
+ local f = newreader(filename,whatever)
+ if f then
+ f.metadata = {
+ nofpaths = 0,
+ noffiles = 0,
+ noflinks = 0,
+ nofbytes = 0,
+ }
+ return f
+ end
+end
+
+local function readheader(t)
+ -- checksum
+ local p = t:getposition()
+ local h = t:readbytetable(512)
+ t:setposition(p)
+ for i=149,156 do -- nasty, one less
+ h[i] = 0
+ end
+ local c = 256
+ for i=1,512 do
+ c = c + h[i]
+ end
+ --
+ local header = {
+ name = asstring(t:readstring(100)), -- 0
+ mode = asnumber(t:readstring( 8)), -- 100 -- when we write: 0775 octal
+ uid = asnumber(t:readstring( 8)), -- 108
+ gid = asnumber(t:readstring( 8)), -- 116
+ size = asnumber(t:readstring( 12)), -- 124
+ mtime = asnumber(t:readstring( 12)), -- 136
+ checksum = asnumber(t:readstring( 6)), -- 148 -- actually 6 with space and \0
+ dummy = t:skip (2) ,
+ typeflag = t:readstring( 1) , -- 156
+ linkname = asstring(t:readstring(100)), -- 157
+ -- magic = asstring(t:readstring( 6)), -- 257 -- ustar\0
+ -- version = 2 -- 263
+ -- uname = 32 -- 265
+ -- gname = 32 -- 297
+ -- devmajor = 8 -- 329
+ -- devminor = 8 -- 337
+ -- prefix = 155 -- 345
+ padding = t:skip (255) , -- 500
+ }
+ local typeflag = header.typeflag
+ if typeflag then
+ header.filetype = types[typeflag]
+ if c == header.checksum then
+ return header
+ end
+ end
+end
+
+local readers = {
+
+ directory = function(t,h)
+ local metadata = t.metadata
+ local filename = h.name
+ if metadata.verbose then
+ report("%8s %s","",filename)
+ end
+ metadata.nofpaths = metadata.nofpaths + 1
+ return true
+ end,
+
+ file = function(t,h)
+ local metadata = t.metadata
+ local filename = h.name
+ local filesize = h.size
+ local pathname = dirname(filename)
+ if metadata.verbose then
+ report("% 8i : %s",filesize,filename)
+ end
+ if makedirs(pathname) then
+ savedata(filename,t:readstring(filesize))
+ else
+ t.skip(filesize)
+ end
+ local position = t:getposition()
+ local target = position + (512 - position % 512) % 512
+ t:setposition(target)
+ metadata.noffiles = metadata.noffiles + 1
+ metadata.nofbytes = metadata.nofbytes + filesize
+ return true
+ end,
+
+ symbolic = function(t,h)
+ local metadata = t.metadata
+ local filename = h.name
+ local linkname = h.linkname
+ if metadata.verbose then
+ report("%8s %s => %s","",linkname,filename)
+ end
+ metadata.noflinks = metadata.noflinks + 1
+ return true
+ end,
+
+}
+
+local skippers = {
+
+ directory = function(t,h)
+ return true
+ end,
+
+ file = function(t,h)
+ local filesize = h.size
+ local fileoffset = t:getposition()
+ local position = filesize + fileoffset
+ local target = position + (512 - position % 512) % 512
+ t:setposition(target)
+ return fileoffset
+ end,
+
+ symbolic = function(t,h)
+ return true
+ end,
+
+}
+
+local writers = {
+ -- nothing here (yet)
+}
+
+local function saveheader(t,h)
+ local filetype = h.filetype
+ local reader = readers[filetype]
+ if reader then
+ return filetype, reader(t,h)
+ else
+ report("no reader for %s",filetype)
+ end
+end
+
+local function skipheader(t,h)
+ local filetype = h.filetype
+ local skipper = skippers[filetype]
+ if skipper then
+ return filetype, skipper(t,h)
+ else
+ report("no skipper for %s",filetype)
+ end
+end
+
+local function unpacktar(whatever,filename,verbose)
+ local t = opentar(whatever,filename)
+ if t then
+ local metadata = t.metadata
+ statistics.starttiming(metadata)
+ if verbose then
+ if whatever == "string" then
+ report("unpacking: %i bytes",#filename)
+ else
+ report("unpacking: %s",filename)
+ end
+ report("")
+ metadata.verbose = verbose
+ end
+ while true do
+ local h = readheader(t)
+ if not h then
+ break
+ else
+ local filetype, saved = saveheader(t,h)
+ if not saved then
+ break
+ end
+ end
+ end
+ statistics.stoptiming(metadata)
+ metadata.runtime = statistics.elapsed(metadata)
+ if verbose then
+ report("")
+ report("number of paths : %i",metadata.nofpaths)
+ report("number of files : %i",metadata.noffiles)
+ report("number of links : %i",metadata.noflinks)
+ report("number of bytes : %i",metadata.nofbytes)
+ report("")
+ report("runtime needed : %s",statistics.elapsedseconds(metadata))
+ report("")
+ end
+ t.close()
+ return metadata
+ end
+end
+
+local function listtar(whatever,filename,onlyfiles)
+ local t = opentar(whatever,filename)
+ if t then
+ local list, n = { }, 0
+ while true do
+ local h = readheader(t)
+ if not h then
+ break
+ else
+ local filetype, offset = skipheader(t,h)
+ if not offset then
+ break
+ elseif filetype == "file" then
+ n = n + 1 ; list[n] = { filetype, h.name, h.size }
+ elseif filetype == "link" then
+ n = n + 1 ; list[n] = { filetype, h.name, h.linkfile }
+ elseif not onlyfiles then
+ n = n + 1 ; list[n] = { filetype, h.name }
+ end
+ end
+ end
+ t.close()
+ -- can be an option
+ table.sort(list,function(a,b) return a[2] < b[2] end)
+ return list
+ end
+end
+
+local function hashtar(whatever,filename,strip)
+ local t = opentar(whatever,filename)
+ if t then
+ local list = { }
+ if strip then
+ strip = "^" .. escapedpattern(nameonly(nameonly(strip))) .. "/"
+ end
+ while true do
+ local h = readheader(t)
+ if not h then
+ break
+ else
+ local filetype, offset = skipheader(t,h)
+ if not offset then
+ break
+ else
+ local name = h.name
+ if strip then
+ name = gsub(name,strip,"")
+ end
+ if filetype == "file" then
+ list[name] = { offset, h.size }
+ elseif filetype == "link" then
+ list[name] = h.linkname
+ end
+ end
+ end
+ end
+ t.close()
+ return list
+ end
+end
+
+-- weak table ?
+
+local function fetchtar(whatever,archive,filename,list)
+ if not list then
+ list = hashtar(whatever,archive)
+ end
+ if list then
+ local what = list[filename]
+ if type(what) == "string" then
+ what = list[what] -- a link
+ end
+ if what then
+ local t = opentar(whatever,archive)
+ if t then
+ t:setposition(what[1])
+ return t:readstring(what[2])
+ end
+ end
+ end
+end
+
+local function packtar(whatever,filename,verbose)
+ report("packing will be implemented when we need it")
+end
+
+local tar = {
+ files = {
+ unpack = function(...) return unpacktar("file", ...) end,
+ pack = function(...) return packtar ("file", ...) end,
+ list = function(...) return listtar ("file", ...) end,
+ hash = function(...) return hashtar ("file", ...) end,
+ fetch = function(...) return fetchtar ("file", ...) end,
+ },
+ strings = {
+ unpack = function(...) return unpacktar("string",...) end,
+ pack = function(...) return packtar ("string",...) end,
+ list = function(...) return listtar ("string",...) end,
+ hash = function(...) return hashtar ("string",...) end,
+ fetch = function(...) return fetchtar ("string",...) end,
+ },
+ streams = {
+ unpack = function(...) return unpacktar("stream",...) end,
+ pack = function(...) return packtar ("stream",...) end,
+ list = function(...) return listtar ("stream",...) end,
+ hash = function(...) return hashtar ("stream",...) end,
+ fetch = function(...) return fetchtar ("stream",...) end,
+ },
+}
+
+utilities.tar = tar
+
+-- tar.files .unpack("e:/luatex/luametatex-source.tar",true)
+-- tar.streams.unpack("e:/luatex/luametatex-source.tar",true)
+-- tar.strings.unpack(io.loaddata("e:/luatex/luametatex-source.tar"),true)
+
+-- inspect(tar.files .unpack("e:/luatex/luametatex-source.tar"))
+-- inspect(tar.streams.unpack("e:/luatex/luametatex-source.tar"))
+-- inspect(tar.strings.unpack(io.loaddata("e:/luatex/luametatex-source.tar")))
+
+-- inspect(tar.files .list("e:/luatex/luametatex-source.tar",true))
+-- inspect(tar.streams.list("e:/luatex/luametatex-source.tar",true))
+-- inspect(tar.strings.list(io.loaddata("e:/luatex/luametatex-source.tar"),true))
+
+-- local c = os.clock()
+-- local l = tar.files.hash("e:/luatex/luametatex-source.tar")
+-- for i=1,500 do
+-- local s = tar.files.fetch("e:/luatex/luametatex-source.tar", "luametatex-source/source/tex/texbuildpage.c", l)
+-- local s = tar.files.fetch( "e:/luatex/luametatex-source.tar","luametatex-source/source/lua/lmtlibrary.c", l)
+-- end
+-- print(os.clock()-c)
+
+return tar
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-tbs.lua b/Master/texmf-dist/tex/context/base/mkiv/util-tbs.lua
new file mode 100644
index 00000000000..339abcfccd8
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-tbs.lua
@@ -0,0 +1,131 @@
+if not modules then modules = { } end modules ['util-tbs'] = {
+ version = 1.001,
+ comment = "companion to luat-lib.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local tonumber, type, rawget = tonumber, type, rawget
+
+utilities = utilities or {}
+local tablestore = { }
+utilities.tablestore = tablestore
+
+local loaded = { }
+local current = nil
+
+function tablestore.load(namespace,filename)
+ local data = loaded[namespace]
+ if not data then
+ if type(filename) == "table" then
+ data = filename
+ else
+ local fullname = resolvers.findfile(filename)
+ if fullname and fullname ~= "" then
+ if file.suffix(fullname,"json") and utilities.json then
+ data = io.loaddata(fullname)
+ if data then
+ data = utilities.json.tolua(data)
+ else
+ -- error
+ end
+ else
+ data = table.load(fullname)
+ end
+ end
+ end
+ if not data then
+ data = { }
+ end
+ loaded[namespace] = data
+ if metapost then
+ metapost.setparameterset(namespace,data)
+ end
+ end
+ current = data
+ return data
+end
+
+function tablestore.loaded(namespace)
+ return (namespace and loaded[namespace]) or current or { }
+end
+
+function tablestore.known(namespace)
+ return namespace and rawget(loaded,namespace) or false
+end
+
+do
+
+ local find, gmatch, formatters = string.find, string.gmatch, string.formatters
+
+ local P, C, Ct, Cc, R = lpeg.P, lpeg.C, lpeg.Ct, lpeg.Cc, lpeg.R
+
+ local separator = P(".")
+ local equal = P("=")
+ local digit = R("09")
+ local lbracket = P("[")
+ local rbracket = P("]")
+ local index = Ct(Cc("index") * lbracket * (digit^1 / tonumber) * rbracket)
+ local test = Ct(Cc("test") * lbracket * C((1-equal)^1) * equal * C((1-rbracket)^1) * rbracket)
+ local entry = Ct(Cc("entry") * C((1-lbracket-separator)^1))
+
+ local specifier = Ct ((entry + (separator + index + test))^1)
+
+ local function field(namespace,name,default)
+ local data = loaded[namespace] or current
+ if data then
+ -- if find(name,"%[") then
+ local t = lpeg.match(specifier,name)
+ for i=1,#t do
+ local ti = t[i]
+ local t1 = ti[1]
+ local k = ti[2]
+ if t1 == "test" then
+ local v = ti[3]
+ for j=1,#data do
+ local dj = data[j]
+ if dj[k] == v then
+ data = dj
+ goto OKAY
+ end
+ end
+ return
+ else
+ data = data[k]
+ if not data then
+ return
+ end
+ end
+ ::OKAY::
+ end
+ -- else
+ -- for s in gmatch(name,"[^%.]+") do
+ -- data = data[s] or data[tonumber(s) or 0]
+ -- if not data then
+ -- return
+ -- end
+ -- end
+ -- end
+ return data
+ end
+ end
+
+
+ function length(namespace,name,default)
+ local data = field(namespace,name)
+ return type(data) == "table" and #data or 0
+ end
+
+ function formatted(namespace,name,fmt)
+ local data = field(namespace,name)
+ if data then
+ return formatters[fmt](data)
+ end
+ end
+
+ tablestore.field = field
+ tablestore.length = length
+ tablestore.formatted = formatted
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-zip.lua b/Master/texmf-dist/tex/context/base/mkiv/util-zip.lua
index f87e391a181..4ceec7afdbb 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/util-zip.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/util-zip.lua
@@ -13,13 +13,23 @@ if not modules then modules = { } end modules ['util-zip'] = {
-- keep some hybrid functionality.
local type, tostring, tonumber = type, tostring, tonumber
-local sort = table.sort
+local sort, concat = table.sort, table.concat
local find, format, sub, gsub = string.find, string.format, string.sub, string.gsub
local osdate, ostime, osclock = os.date, os.time, os.clock
local ioopen = io.open
local loaddata, savedata = io.loaddata, io.savedata
local filejoin, isdir, dirname, mkdirs = file.join, lfs.isdir, file.dirname, dir.mkdirs
+local suffix, suffixes = file.suffix, file.suffixes
+local openfile = io.open
+
+gzip = gzip or { } -- so in luatex we keep the old ones too
+
+if not zlib then
+ zlib = xzip -- in luametatex we shadow the old one
+elseif not xzip then
+ xzip = zlib
+end
local files = utilities.files
local openfile = files.open
@@ -34,32 +44,18 @@ local band = bit32.band
local rshift = bit32.rshift
local lshift = bit32.lshift
-local decompress, expandsize, calculatecrc
-
--- if flate then
---
--- decompress = flate.flate_decompress
--- calculatecrc = flate.update_crc32
---
--- else
+local zlibdecompress = zlib.decompress
+local zlibdecompresssize = zlib.decompresssize
+local zlibchecksum = zlib.crc32
- local zlibdecompress = zlib.decompress
- local zlibexpandsize = zlib.expandsize
- local zlibchecksum = zlib.crc32
-
- decompress = function(source)
- return zlibdecompress(source,-15) -- auto
- end
-
- expandsize = zlibexpandsize and function(source,targetsize)
- return zlibexpandsize(source,targetsize,-15) -- auto
- end or decompress
-
- calculatecrc = function(buffer,initial)
- return zlibchecksum(initial or 0,buffer)
- end
+if not CONTEXTLMTXMODE or CONTEXTLMTXMODE == 0 then
+ local cs = zlibchecksum
+ zlibchecksum = function(str,n) return cs(n or 0, str) end
+end
--- end
+local decompress = function(source) return zlibdecompress (source,-15) end -- auto
+local decompresssize = function(source,targetsize) return zlibdecompresssize(source,targetsize,-15) end -- auto
+local calculatecrc = function(buffer,initial) return zlibchecksum (initial or 0,buffer) end
local zipfiles = { }
utilities.zipfiles = zipfiles
@@ -201,8 +197,8 @@ local openzipfile, closezipfile, unzipfile, foundzipfile, getziphash, getziplist
setposition(handle,position)
local result = readstring(handle,compressed)
if data.method == 8 then
- if expandsize then
- result = expandsize(result,data.uncompressed)
+ if decompresssize then
+ result = decompresssize(result,data.uncompressed)
else
result = decompress(result)
end
@@ -516,48 +512,173 @@ if xzip then -- flate then do
end
-zipfiles.gunzipfile = gzip.load
+-- todo: compress/decompress that work with offset in string
--- if flate then
---
--- local streams = utilities.streams
--- local openfile = streams.open
--- local closestream = streams.close
--- local setposition = streams.setposition
--- local getsize = streams.size
--- local readcardinal4 = streams.readcardinal4le
--- local getstring = streams.getstring
--- local decompress = flate.gz_decompress
---
--- -- id1=1 id2=1 method=1 flags=1 mtime=4(le) extra=1 os=1
--- -- flags:8 comment=...<nul> flags:4 name=...<nul> flags:2 extra=...<nul> flags:1 crc=2
--- -- data:?
--- -- crc=4 size=4
---
--- function zipfiles.gunzipfile(filename)
--- local strm = openfile(filename)
--- if strm then
--- setposition(strm,getsize(strm) - 4 + 1)
--- local size = readcardinal4(strm)
--- local data = decompress(getstring(strm),size)
--- closestream(strm)
--- return data
--- end
--- end
+-- We only have a few official methods here:
--
--- elseif gzip then
+-- local decompressed = gzip.load (filename)
+-- local resultsize = gzip.save (filename,compresslevel)
+-- local compressed = gzip.compress (str,compresslevel)
+-- local decompressed = gzip.decompress (str)
+-- local iscompressed = gzip.compressed (str)
+-- local suffix, okay = gzip.suffix (filename)
--
--- local openfile = gzip.open
+-- In LuaMetaTeX we have only xzip which implements a very few methods:
--
--- function zipfiles.gunzipfile(filename)
--- local g = openfile(filename,"rb")
--- if g then
--- local d = g:read("*a")
--- d:close()
--- return d
--- end
--- end
---
--- end
+-- compress (str,level,method,window,memory,strategy)
+-- decompress (str,window)
+-- adler32 (str,checksum)
+-- crc32 (str,checksum)
+
+local pattern = "^\x1F\x8B\x08"
+local gziplevel = 3
+
+function gzip.suffix(filename)
+ local suffix, extra = suffixes(filename)
+ local gzipped = extra == "gz"
+ return suffix, gzipped
+end
+
+function gzip.compressed(s)
+ return s and find(s,pattern)
+end
+
+local getdecompressed
+local putcompressed
+
+if gzip.compress then
+
+ local gzipwindow = 15 + 16 -- +16: gzip, +32: gzip|zlib
+
+ local compress = zlib.compress
+ local decompress = zlib.decompress
+
+ getdecompressed = function(str)
+ return decompress(str,gzipwindow) -- pass offset
+ end
+
+ putcompressed = function(str,level)
+ return compress(str,level or gziplevel,nil,gzipwindow)
+ end
+
+else
+
+ -- Special window values are: flate: -15, zlib: 15, gzip : -15
+
+ local gzipwindow = -15 -- miniz needs this
+ local identifier = "\x1F\x8B"
+
+ local compress = zlib.compress
+ local decompress = zlib.decompress
+ local zlibchecksum = zlib.crc32
+
+ if not CONTEXTLMTXMODE or CONTEXTLMTXMODE == 0 then
+ local cs = zlibchecksum
+ zlibchecksum = function(str,n) return cs(n or 0, str) end
+ end
+
+ local streams = utilities.streams
+ local openstream = streams.openstring
+ local closestream = streams.close
+ local getposition = streams.getposition
+ local readbyte = streams.readbyte
+ local readcardinal4 = streams.readcardinal4le
+ local readcardinal2 = streams.readcardinal2le
+ local readstring = streams.readstring
+ local readcstring = streams.readcstring
+ local skipbytes = streams.skip
+
+ local tocardinal1 = streams.tocardinal1
+ local tocardinal4 = streams.tocardinal4le
+
+ getdecompressed = function(str)
+ local s = openstream(str)
+ local identifier = readstring(s,2)
+ local method = readbyte(s,1)
+ local flags = readbyte(s,1)
+ local timestamp = readcardinal4(s)
+ local compression = readbyte(s,1)
+ local operating = readbyte(s,1)
+ -- local isjusttext = (flags & 0x01 ~= 0) and true or false
+ -- local extrasize = (flags & 0x04 ~= 0) and readcardinal2(s) or 0
+ -- local filename = (flags & 0x08 ~= 0) and readcstring(s) or ""
+ -- local comment = (flags & 0x10 ~= 0) and readcstring(s) or ""
+ -- local checksum = (flags & 0x02 ~= 0) and readcardinal2(s) or 0
+ local isjusttext = band(flags,0x01) ~= 0 and true or false
+ local extrasize = band(flags,0x04) ~= 0 and readcardinal2(s) or 0
+ local filename = band(flags,0x08) ~= 0 and readcstring(s) or ""
+ local comment = band(flags,0x10) ~= 0 and readcstring(s) or ""
+ local checksum = band(flags,0x02) ~= 0 and readcardinal2(s) or 0
+ local compressed = readstring(s,#str)
+ local data = decompress(compressed,gzipwindow) -- pass offset
+ return data
+ end
+
+ putcompressed = function(str,level,originalname)
+ return concat {
+ identifier, -- 2 identifier
+ tocardinal1(0x08), -- 1 method
+ tocardinal1(0x08), -- 1 flags
+ tocardinal4(os.time()), -- 4 mtime
+ tocardinal1(0x02), -- 1 compression (2 or 4)
+ tocardinal1(0xFF), -- 1 operating
+ (originalname or "unknownname") .. "\0",
+ compress(str,level,nil,gzipwindow),
+ tocardinal4(zlibchecksum(str)), -- 4
+ tocardinal4(#str), -- 4
+ }
+ end
+
+end
+
+function gzip.load(filename)
+ local f = openfile(filename,"rb")
+ if not f then
+ -- invalid file
+ else
+ local data = f:read("*all")
+ f:close()
+ if data and data ~= "" then
+ if suffix(filename) == "gz" then
+ data = getdecompressed(data)
+ end
+ return data
+ end
+ end
+end
+
+function gzip.save(filename,data,level,originalname)
+ if suffix(filename) ~= "gz" then
+ filename = filename .. ".gz"
+ end
+ local f = openfile(filename,"wb")
+ if f then
+ data = putcompressed(data or "",level or gziplevel,originalname)
+ f:write(data)
+ f:close()
+ return #data
+ end
+end
+
+function gzip.compress(s,level)
+ if s and not find(s,pattern) then
+ if not level then
+ level = gziplevel
+ elseif level <= 0 then
+ return s
+ elseif level > 9 then
+ level = 9
+ end
+ return putcompressed(s,level or gziplevel) or s
+ end
+end
+
+function gzip.decompress(s)
+ if s and find(s,pattern) then
+ return getdecompressed(s)
+ else
+ return s
+ end
+end
return zipfiles
diff --git a/Master/texmf-dist/tex/context/base/mkxl/anch-bar.mkxl b/Master/texmf-dist/tex/context/base/mkxl/anch-bar.mkxl
index 3587eb8a052..f99e6142854 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/anch-bar.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/anch-bar.mkxl
@@ -15,10 +15,8 @@
\unprotect
-%D This can be done better now ...
-
-%D We will implement a sidebar mechanism using the functionality from
-%D \type {core-pos}.
+%D We will implement a sidebar mechanism using the functionality from \type
+%D {core-pos}.
%D
%D \starttyping
%D \definesidebar[whow][rulecolor=green,distance=0pt]
@@ -54,15 +52,17 @@
%D \input tufte
%D \stopsidebar
%D \stoptyping
+%D
+%D This can be done better now ... maybe also by using the syncpos features.
\installcorenamespace{sidebar}
\installcommandhandler \??sidebar {sidebar} \??sidebar
-\newcount\c_anch_sidebars_n
-\newcount\c_anch_sidebars_current % local
-\newdimen\d_anch_sidebars_distance
-\newcount\c_anch_sidebars_level
+\newinteger \c_anch_sidebars_n
+\newinteger \c_anch_sidebars_current % local
+\newdimension\d_anch_sidebars_distance
+\newinteger \c_anch_sidebars_level
% \setupMPvariables
% [mpos:sidebar]
@@ -78,6 +78,7 @@
\c!bottomoffset=\zeropoint,
\c!distance=.5\bodyfontsize,
\c!level=,
+ \c!location=\v!left,
\c!leftmargindistance=\zeropoint]
\aliased\let\setupsidebars\setupsidebar
@@ -85,8 +86,8 @@
\permanent\tolerant\protected\def\startsidebar[#1]#*[#2]%
{\bgroup
\dontleavehmode
- \advance\c_anch_sidebars_level\plusone
- \global\advance\c_anch_sidebars_n\plusone
+ \advanceby\c_anch_sidebars_level\plusone
+ \global\advanceby\c_anch_sidebars_n\plusone
\c_anch_sidebars_current\c_anch_sidebars_n\relax % relax needed
\ifhastok={#1}%
\edef\currentsidebar{\the\c_anch_sidebars_level}%
@@ -102,23 +103,21 @@
\ifempty\m_level
\ifnum\c_anch_sidebars_level=\plusone
\ifzeropt\scratchdimen
- \advance\d_anch_sidebars_distance\scratchdistance\relax
+ \advanceby\d_anch_sidebars_distance\scratchdistance\relax
\else
\d_anch_sidebars_distance\scratchdimen
\fi
\else
- \advance\d_anch_sidebars_distance\scratchdistance\relax
+ \advanceby\d_anch_sidebars_distance\scratchdistance\relax
\fi
- \else
- \ifnum\m_level=\plusone
- \ifzeropt\scratchdimen
- \advance\d_anch_sidebars_distance\scratchdistance\relax
- \else
- \d_anch_sidebars_distance\scratchdimen
- \fi
+ \orelse\ifnum\m_level=\plusone
+ \ifzeropt\scratchdimen
+ \advanceby\d_anch_sidebars_distance\scratchdistance\relax
\else
- \d_anch_sidebars_distance\dimexpr\scratchdimen+\numexpr\m_level-\plusone\relax\dimexpr\scratchdistance\relax\relax
+ \d_anch_sidebars_distance\scratchdimen
\fi
+ \else
+ \d_anch_sidebars_distance\dimexpr\scratchdimen+\numexpr\m_level-\plusone\relax\dimexpr\scratchdistance\relax\relax
\fi
\startpositionoverlay{\v!text-1}%
\normalexpanded{\setMPpositiongraphicrange % maybe expand in definition
@@ -126,6 +125,7 @@
{e:sidebar:\the\c_anch_sidebars_n}%
{mpos:sidebar}%
{self=sidebar:\the\c_anch_sidebars_n,
+ location=\mplocation{\sidebarparameter\c!location},
linewidth=\sidebarparameter\c!rulethickness,
linecolor=\sidebarparameter\c!rulecolor,
alternative=\sidebarparameter\c!alternative,
@@ -146,19 +146,13 @@
%D one lua call).
\startMPpositionmethod{mpos:sidebar}
- \startMPpositiongraphic{mpos:sidebar}{linecolor,linewidth,distance,alternative}%
- anch_sidebars_draw (
- \MPp\MPbself,\MPp\MPeself,\MPy\MPbself,\MPy\MPeself,\MPh\MPbself,\MPd\MPeself,
- \MPx{\textanchor},\MPy{\textanchor},\MPw{\textanchor},\MPh{\textanchor},
- \MPvar{alternative},\MPvar{distance},\MPvar{linewidth},\MPvar{linecolor},
- \MPvar{topoffset}, \MPvar{bottomoffset}
- ) ;
+ \startMPpositiongraphic{mpos:sidebar}{linecolor,linewidth,distance,alternative}
+ anch_sidebars_draw("\MPbself", "\MPeself", "\textanchor") ;
\stopMPpositiongraphic
\MPpositiongraphic{mpos:sidebar}{}%
\stopMPpositionmethod
-%D We now reimplement the \MKII\ margin rules handler in a more
-%D modern way.
+%D We now reimplement the \MKII\ margin rules handler in a more modern way.
%D
%D \setupmarginrules
%D [rulecolor=darkred,
diff --git a/Master/texmf-dist/tex/context/base/mkxl/anch-bck.mklx b/Master/texmf-dist/tex/context/base/mkxl/anch-bck.mklx
index 36416c93da3..ea6999f45da 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/anch-bck.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/anch-bck.mklx
@@ -31,14 +31,14 @@
% Paragraph positions:
-\newcount\c_anch_backgrounds_text_n
+\newinteger\c_anch_backgrounds_text_n
\def\v_anch_backgrounds_text_current {tbg:0}
\def\v_anch_backgrounds_anchor_current_b{b:\v_anch_backgrounds_text_current}
\def\v_anch_backgrounds_anchor_current_e{e:\v_anch_backgrounds_text_current}
\def\anch_backgrounds_text_initialize_next
- {\global\advance\c_anch_backgrounds_text_n\plusone
+ {\global\advanceby\c_anch_backgrounds_text_n\plusone
\edef\v_anch_backgrounds_text_current{tbg:\number\c_anch_backgrounds_text_n}}
% The first position can be used in the middle of a paragraph in which case we're
@@ -57,7 +57,7 @@
%D Some MP
-\newcount\MPparcounter
+\newinteger\MPparcounter
\permanent\def\MPself {\MPvar{self}}
\permanent\def\MPbself {b:\MPvar{self}}
@@ -89,7 +89,7 @@
% \readfile{ward}{}{}
% \stoptextbackground
-\newcount\c_anch_backgrounds_text_level
+\newinteger\c_anch_backgrounds_text_level
\installcorenamespace{textbackground}
\installcorenamespace{textbackgroundlevel}
@@ -97,9 +97,9 @@
\installcommandhandler \??textbackground {textbackground} \??textbackground
\appendtoks
- \frozen\instance\setuevalue{\currenttextbackground}{\groupedcommand{\starttextbackground[\currenttextbackground]}{\stoptextbackground}}%
- \frozen\instance\setuevalue{\e!start\currenttextbackground}{\starttextbackground[\currenttextbackground]}%
- \frozen\instance\setuevalue{\e!stop \currenttextbackground}{\stoptextbackground}%
+ \frozen\instance\protected\edefcsname \currenttextbackground\endcsname{\groupedcommand{\starttextbackground[\currenttextbackground]}{\stoptextbackground}}%
+ \frozen\instance\protected\edefcsname\e!start\currenttextbackground\endcsname{\starttextbackground[\currenttextbackground]}%
+ \frozen\instance\protected\edefcsname\e!stop \currenttextbackground\endcsname{\stoptextbackground}%
\to \everydefinetextbackground
\newconstant \c_anch_backgrounds_pos_state
@@ -119,37 +119,26 @@
\eposkind\v_anch_backgrounds_text_current\c_anch_backgrounds_pos_state
\fi}
-% \permanent\tolerant\protected\def\starttextbackground[#tag]#spacer[#settings]%
-% {\begingroup
-% \advance\c_anch_backgrounds_text_level\plusone
-% \def\currenttextbackground{#tag}%
-% \anch_backgrounds_text_initialize_next
-% \ifparameter#settings\or
-% \setupcurrenttextbackground[#settings]%
-% \fi
-% \doifelse{\textbackgroundparameter\c!state}\v!start
-% \anch_backgrounds_text_preset_yes
-% \anch_backgrounds_text_preset_nop
-% \anch_backgrounds_text_start_indeed}
-
% ugly hack to register usage
-\newcount \c_anch_backgrounds_text_count
-\newcount \c_anch_backgrounds_text_check
+\newinteger \c_anch_backgrounds_text_count
+\newinteger \c_anch_backgrounds_text_check
\newconstant\c_anch_backgrounds_text_state
\permanent\tolerant\protected\def\starttextbackground[#tag]#spacer[#settings]%
{\begingroup
- \global\advance\c_anch_backgrounds_text_count\plusone
- \advance\c_anch_backgrounds_text_level\plusone
+ \global\advanceby\c_anch_backgrounds_text_count\plusone
+ \advanceby\c_anch_backgrounds_text_level\plusone
\def\currenttextbackground{#tag}%
\anch_backgrounds_text_initialize_next
\ifparameter#settings\or
\setupcurrenttextbackground[#settings]%
\fi
- \doifelse{\textbackgroundparameter\c!state}\v!start
+ \ifcstok{\textbackgroundparameter\c!state}\v!start
\anch_backgrounds_text_preset_yes
+ \else
\anch_backgrounds_text_preset_nop
+ \fi
\anch_backgrounds_text_start_indeed}
\def\anch_backgrounds_text_level_start
@@ -171,11 +160,11 @@
\let\anch_backgrounds_text_start_indeed\relax
\let\anch_backgrounds_text_stop_indeed \relax
-\setvalue{\??textbackgroundlevel\v!text}%
+\defcsname\??textbackgroundlevel\v!text\endcsname
{\let\anch_backgrounds_text_start_indeed\anch_backgrounds_text_start_txt
\let\anch_backgrounds_text_stop_indeed \anch_backgrounds_text_stop_txt}
-\setvalue{\??textbackgroundlevel\v!paragraph}%
+\defcsname\??textbackgroundlevel\v!paragraph\endcsname
{\ifnum\c_anch_backgrounds_text_level>\textbackgroundparameter\c!criterium\relax
\let\anch_backgrounds_text_start_indeed\anch_backgrounds_text_start_txt
\let\anch_backgrounds_text_stop_indeed \anch_backgrounds_text_stop_txt
@@ -184,11 +173,11 @@
\let\anch_backgrounds_text_stop_indeed \anch_backgrounds_text_stop_par
\fi}
-\setvalue{\??textbackgroundlevel\v!always}%
+\defcsname\??textbackgroundlevel\v!always\endcsname
{\let\anch_backgrounds_text_start_indeed\anch_backgrounds_text_start_par
\let\anch_backgrounds_text_stop_indeed \anch_backgrounds_text_stop_par}
-\setvalue{\??textbackgroundlevel\v!none}%
+\defcsname\??textbackgroundlevel\v!none\endcsname
{\anch_backgrounds_text_preset_nop}
\def\anch_backgrounds_text_preset_nop
@@ -256,7 +245,7 @@
\carryoverpar\endgroup}
\def\anch_backgrounds_text_start_txt
- {\ifvmode \dontleavehmode \fi
+ {\ifvmode\dontleavehmode\fi
\begingroup
\c_anch_backgrounds_pos_state\plusone
\usetextbackgroundstyleandcolor\c!style\c!color
@@ -266,7 +255,7 @@
{\anch_backgrounds_epos
\carryoverpar\endgroup}
-\newskip\textbackgroundskip
+\newgluespec\textbackgroundskip
% maybe we should have a resetter for such compensation struts
@@ -305,10 +294,8 @@
\kern\textbackgroundskip\nobreak
\fi
\fi
- \dosetleftskipadaption{\textbackgroundparameter\c!leftoffset}%
- \advance\leftskip\leftskipadaption
- \dosetleftskipadaption{\textbackgroundparameter\c!rightoffset}%
- \advance\rightskip\leftskipadaption
+ \doadaptleftskip {\textbackgroundparameter\c!leftoffset}%
+ \doadaptrightskip{\textbackgroundparameter\c!rightoffset}%
% new
\dosetraggedcommand{\textbackgroundparameter\c!align}%
\raggedcommand
@@ -324,7 +311,7 @@
\removelastskip % new
\spac_helpers_assign_skip\textbackgroundskip{\textbackgroundparameter\c!bottomoffset}%
\ifdim\lastskip>\zeropoint
- \advance\textbackgroundskip-\lastskip
+ \advanceby\textbackgroundskip-\lastskip
\fi
\ifgridsnapping
\orelse\ifdim\textbackgroundskip>\zeropoint
@@ -366,9 +353,6 @@
\definesystemattribute[textbackground][public]
-% \def\page_prepare_backgrounds#1%
-% {\clf_collectbackgrounds\realpageno#1\relax}
-
\def\anch_backgrounds_bpos
{\ifconditional\c_anch_backgrounds_pos_no_shape
\c_attr_textbackground\attributeunsetvalue
@@ -408,10 +392,10 @@
\newconditional\c_strc_floats_mark_as_free
\newconditional\c_strc_floats_trace_free
\newconstant \c_free_offset_kind
-\newdimen \d_free_offset_left
-\newdimen \d_free_offset_right
-\newdimen \d_free_offset_top
-\newdimen \d_free_offset_bottom
+\newdimension \d_free_offset_left
+\newdimension \d_free_offset_right
+\newdimension \d_free_offset_top
+\newdimension \d_free_offset_bottom
\installtextracker{floats.freeregion}
{\settrue \c_strc_floats_trace_free}
@@ -558,35 +542,14 @@
gridcolor=red,
linecolor=blue,
fillcolor=lightgray,
- filloffset=\!!zeropoint,
+ filloffset=\zeropoint,
linewidth=\linewidth,
gridwidth=\linewidth,
- gridshift=\!!zeropoint,
+ gridshift=\zeropoint,
lineradius=.5\bodyfontsize,
- lineoffset=\!!zeropoint,
+ lineoffset=\zeropoint,
dashtype=1]
-\startuseMPgraphic{mpos:region:setup}
- boxgridtype := \MPvar{gridtype} ;
- boxlinetype := \MPvar{linetype} ;
- boxfilltype := \MPvar{filltype} ;
- boxdashtype := \MPvar{dashtype} ;
- boxfilloffset := \MPvar{filloffset} ;
- boxlinewidth := \MPvar{linewidth} ;
- boxgridwidth := \MPvar{gridwidth} ;
- boxgridshift := \MPvar{gridshift} ;
- boxlineradius := \MPvar{lineradius} ;
- boxlineoffset := \MPvar{lineoffset} ;
- %
- def boxgridcolor = \MPvar{gridcolor} enddef ;
- def boxlinecolor = \MPvar{linecolor} enddef ;
- def boxfillcolor = \MPvar{fillcolor} enddef ;
- %
- def boxgridoptions = withcolor boxgridcolor enddef ;
- def boxlineoptions = withcolor boxlinecolor enddef ;
- def boxfilloptions = withcolor boxfillcolor enddef ;
-\stopuseMPgraphic
-
\startuseMPgraphic{mpos:region:extra}
% user stuff
\stopuseMPgraphic
@@ -598,8 +561,7 @@
\startMPpositiongraphic{mpos:region}{fillcolor,filloffset,linecolor,gridcolor,linewidth,gridwidth,gridshift,lineradius,lineoffset}
\includeMPgraphic{mpos:region:setup} ;
\includeMPgraphic{mpos:region:extra} ;
- % \getmultipars("self","anchor") ;
- \MPgetmultipars{\MPvar{self}}{\MPanchorid} ;
+ getmultipars("self", "anchor") ;
\includeMPgraphic{\MPvar{mp}} ;
\includeMPgraphic{mpos:region:anchor} ;
\stopMPpositiongraphic
@@ -670,21 +632,12 @@
lineoffset=5pt,
linewidth=1pt]
-% \startMPpositiongraphic{mpos:encircle}{linecolor,fillcolor,linewidth,lineoffset}
-% getposboxes("self","anchor") ;
-% if nofposboxes = 1 :
-% posboxes[1] := posboxes[1] enlarged \MPvar{lineoffset} cornered \MPvar{lineoffset} ;
-% fill posboxes[1] withcolor \MPvar{fillcolor} ;
-% draw posboxes[1] withpen pencircle scaled \MPvar{linewidth} withcolor \MPvar{linecolor} ;
-% fi ;
-% \stopMPpositiongraphic
-
\startMPpositiongraphic{mpos:encircle}{linecolor,fillcolor,linewidth,lineoffset}
getposboxes("self","anchor") ;
if nofposboxes = 1 :
posboxes[1] := (posboxes[1] enlarged mpvar "lineoffset") cornered mpvar "lineoffset" ;
fill posboxes[1] withcolor mpvar "fillcolor" ;
- draw posboxes[1] withpen pencircle scaled mpvar "linewidth" withcolor mpvar "linecolor" ;
+ draw posboxes[1] withpen pencircle scaled mpvar "linewidth" withcolor mpvar "linecolor" ;
fi ;
\stopMPpositiongraphic
@@ -694,14 +647,6 @@
lineoffset=.25ex,
linewidth=1pt]
-% \startMPpositiongraphic{mpos:connect}{linecolor,lineoffset,linewidth}
-% boxlinewidth := \MPvar{linewidth} ;
-% boxlineoffset := \MPvar{lineoffset} ;
-% def boxlineoptions = withcolor \MPvar{linecolor} enddef ;
-% getposboxes("from,to","anchor") ;
-% connect_positions ;
-% \stopMPpositiongraphic
-
\startMPpositiongraphic{mpos:connect}{linecolor,lineoffset,linewidth}
boxlinewidth := mpvar "linewidth" ;
boxlineoffset := mpvar "lineoffset" ;
diff --git a/Master/texmf-dist/tex/context/base/mkxl/anch-box.mkxl b/Master/texmf-dist/tex/context/base/mkxl/anch-box.mkxl
new file mode 100644
index 00000000000..d480b221483
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/anch-box.mkxl
@@ -0,0 +1,250 @@
+%D \module
+%D [ file=anch-box,
+%D version=2022.03.25,
+%D title=\CONTEXT\ Anchoring Macros,
+%D subtitle=Boxes,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%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 Anchoring Macros / Boxes}
+
+\unprotect
+
+\startMPpositiongraphic{mypos:boxanchor:arrow}{}% from,to,linecolor,text,alternative,leftedge,rightedge,distance}
+ anch_box_arrows_draw ;
+\stopMPpositiongraphic
+
+\def\anch_box_connect_parameters#1#2%
+ {span=no,
+ from=\boxanchorposone,%
+ to=\boxanchorpostwo,%
+ distance={\namedboxanchorcontentparameter{#1}\c!distance},%
+ dashtype={\namedboxanchorcontentparameter{#1}\c!dash},%
+ arrow={\namedboxanchorcontentparameter{#1}\c!arrow},%
+ alternative={\namedboxanchorcontentparameter{#1}\c!alternative},%
+ text={\namedboxanchorcontentparameter{#1}\c!text},%
+ rulethickness={\namedboxanchorcontentparameter{#1}\c!rulethickness},%
+ linecolor=\namedboxanchorcontentparameter{#1}{\c!rulecolor},
+ #2}
+
+\tolerant\permanent\protected\def\connectboxanchors[#1]#*[#2]#*[#3]#*[#4]#*#:#5#6%
+ {\begingroup
+ %
+ \edef\boxanchorone{\boxanchoringclass:#5}%
+ \edef\boxanchortwo{\boxanchoringclass:#6}%
+% \edef\boxanchorone{#5}%
+% \edef\boxanchortwo{#6}%
+ %
+ \doifnotanchorbox{\boxanchorone}{\defineboxanchor[\boxanchorone]}%
+ \doifnotanchorbox{\boxanchortwo}{\defineboxanchor[\boxanchortwo]}%
+ %
+ \edef\boxanchorposone{#1:#2:\namespacedboxanchor{\boxanchorone}}%
+ \edef\boxanchorpostwo{#1:#2:\namespacedboxanchor{\boxanchortwo}}%
+% \edef\boxanchorposone{#1:#2:\number\namedboxanchor{\boxanchorone}}%
+% \edef\boxanchorpostwo{#1:#2:\number\namedboxanchor{\boxanchortwo}}%
+ %
+ \setboxanchor[\boxanchorone][#1][#3]\hpack{\xypos{\boxanchorposone}}%
+ \setboxanchor[\boxanchortwo][#2][#4]\hpack{\xypos{\boxanchorpostwo}}%
+ %
+ \ifparameter#3\or\setupboxanchorcontent[#1][#3]\fi
+ \ifparameter#4\or\setupboxanchorcontent[#2][#4]\fi % used ?
+ %
+ \normalexpanded{%
+ \startpositionoverlay{text+1}% will become configurable region
+ \setMPpositiongraphic
+ {\boxanchorposone}%
+ {\namedboxanchorcontentparameter{#1}\c!mp}%
+ {\anch_box_connect_parameters{#1}{#3}}%
+ \stoppositionoverlay
+ }%
+ \ifcstok{\namedboxanchorcontentparameter{#1}\c!page}\v!yes
+ \normalexpanded{%
+ \startpositionoverlay{text+1}% will become configurable region
+ \setMPpositiongraphic
+ {\boxanchorpostwo}%
+ {\namedboxanchorcontentparameter{#1}\c!mp}%
+ {\anch_box_connect_parameters{#1}{#3}}%
+ \stoppositionoverlay
+ }%
+ \fi
+ \endgroup}
+
+% dedicated or not
+
+\tolerant\permanent\protected\def\connectmatrixanchors[#1]#*[#2]#*[#3]#*[#4]#*#:#5#6%
+ {\begingroup
+ \doifelseinset{#5}{\m_anch_matrix_list}\donetrue\donefalse
+ \ifdone\else
+ \defineboxanchor[#5]%
+ \setboxanchor[#5][#1][#3]\hpack{\xypos{\namespacedboxanchor{#5}}}%
+ \xdef\m_anch_matrix_list{\m_anch_matrix_list,#5}%
+ \fi
+ \ifparameter#3\or\setupboxanchorcontent[#1][#3]\fi
+ \doifelseinset{#6}{\m_anch_matrix_list}\donetrue\donefalse
+ \ifdone\else
+ \defineboxanchor[#6]%
+ \setboxanchor[#6][#2][#4]\hpack{\xypos{\namespacedboxanchor{#6}}}%
+ \xdef\m_anch_matrix_list{\m_anch_matrix_list,#6}%
+ \fi
+ \ifparameter#4\or\setupboxanchorcontent[#1][#4]\fi
+ \startpositionoverlay{text-1}% will become configurable region
+ \setMPpositiongraphic
+ {\namespacedboxanchor{#5}}%
+ {\namedboxanchorcontentparameter{#1}\c!mp}%
+ {from=\namespacedboxanchor{#5},%
+ to=\namespacedboxanchor{#6},%
+ distance={\namedboxanchorcontentparameter{#1}\c!distance},%
+ dashtype={\namedboxanchorcontentparameter{#1}\c!dash},%
+ arrow={\namedboxanchorcontentparameter{#1}\c!arrow},%
+ alternative={\namedboxanchorcontentparameter{#1}\c!alternative},%
+ text={\namedboxanchorcontentparameter{#1}\c!text},%
+ rulethickness={\namedboxanchorcontentparameter{#1}\c!rulethickness},%
+ linecolor=\namedboxanchorcontentparameter{#1}{\c!rulecolor},%
+ % matrix specific:
+ leftedge=\namespacedboxanchor\c!leftedge,%
+ rightedge=\namespacedboxanchor\c!rightedge}%
+ \stoppositionoverlay
+ \endgroup}
+
+\lettonothing\m_anch_matrix_list
+
+\tolerant\permanent\protected\def\startmatrixanchors
+ {\glet\m_anch_matrix_list\empty
+ \defineboxanchor[\v!leftedge]%
+ \setboxanchor[\v!leftedge][\v!leftedge]\hpack{\xypos{\namespacedboxanchor\v!leftedge}}%
+ \defineboxanchor[\v!rightedge]%
+ \setboxanchor[\v!rightedge][\v!rightedge]\hpack{\xypos{\namespacedboxanchor\v!rightedge}}%
+ \setupmathfence[\c!leftsource=\v!leftedge,\c!rightsource=\v!rightedge]}
+
+\tolerant\permanent\protected\def\stopmatrixanchors
+ {\setupmathfence[\c!leftsource=,\c!rightsource=]%
+ \glet\m_anch_matrix_list\empty}
+
+\defineboxanchorcontent
+ [arrow]
+ [\c!mp=mypos:boxanchor:arrow,
+ \c!distance=1.5\exheight,
+ \c!rulethickness=\linewidth,
+ \c!rulecolor=textcolor]
+
+\defineboxanchorcontent
+ [\v!top]
+ [arrow]
+ [\c!corner=\v!height,
+ \c!location=\v!depth,
+ \c!yoffset=.25\exheight,
+ \c!alternative=\v!top]
+
+\defineboxanchorcontent
+ [\v!bottom]
+ [arrow]
+ [\c!corner=\v!depth,
+ \c!location=\v!height,
+ \c!yoffset=-\namedboxanchorcontentparameter{top}\c!yoffset,
+ \c!alternative=\v!bottom]
+
+\defineboxanchorcontent
+ [\v!left]
+ [arrow]
+ [\c!corner={\v!middle,\v!left},
+ \c!xoffset=-1.25\emwidth,
+ \c!alternative=\v!left]
+
+\defineboxanchorcontent
+ [\v!right]
+ [arrow]
+ [\c!corner={\v!middle,\v!right},
+ \c!xoffset=-\namedboxanchorcontentparameter{left}\c!xoffset,
+ \c!alternative=\v!right]
+
+\defineboxanchorcontent
+ [\v!leftedge]
+ [\v!left]
+ [\c!xoffset=-.25\exheight]
+
+\defineboxanchorcontent
+ [\v!rightedge]
+ [\v!right]
+ [\c!xoffset=0.25\exheight] % we are centered
+
+\defineboxanchorcontent[\v!middle:\v!bottom][\v!bottom][\c!alternative=\v!middle,\c!yoffset=-.5\exheight]
+\defineboxanchorcontent[\v!middle:\v!top ][\v!top ][\c!alternative=\v!middle,\c!yoffset=.5\exheight]
+\defineboxanchorcontent[\v!middle:\v!left ][\v!left ][\c!alternative=\v!middle,\c!xoffset=-.5\exheight]
+\defineboxanchorcontent[\v!middle:\v!right ][\v!right ][\c!alternative=\v!middle,\c!xoffset=.5\exheight]
+
+\defineboxanchorcontent
+ [\v!left:\v!bottom]
+ [\v!bottom]
+ [\c!alternative=\v!middle,
+ \c!corner={\v!left,\v!depth},
+ \c!xoffset=-.25\exheight,
+ \c!yoffset=-.25\exheight]
+
+\defineboxanchorcontent
+ [\v!right:\v!bottom]
+ [\v!bottom]
+ [\c!alternative=\v!middle,
+ \c!corner={\v!right,\v!depth},
+ \c!xoffset=.25\exheight,
+ \c!yoffset=-.25\exheight]
+
+\defineboxanchorcontent
+ [\v!left:\v!top]
+ [\v!top]
+ [\c!alternative=\v!middle,
+ \c!corner={\v!left,\v!height},
+ \c!xoffset=-.25\exheight,
+ \c!yoffset=.25\exheight]
+
+\defineboxanchorcontent
+ [\v!right:\v!top]
+ [\v!top]
+ [\c!alternative=\v!middle,
+ \c!corner={\v!right,\v!height},
+ \c!xoffset=.25\exheight,
+ \c!yoffset=.25\exheight]
+
+% \setupboxanchorcontent [top] [rulecolor=darkyellow]
+% \setupboxanchorcontent [left] [rulecolor=darkred]
+% \setupboxanchorcontent [bottom][rulecolor=darkblue]
+% \setupboxanchorcontent [right] [rulecolor=darkgreen]
+%
+% \startbuffer
+% \connectboxanchors[top] [top] [text={\small\small\strut\bf var 1}]{a1}{a2}
+% \connectboxanchors[top] [top] [text={\small\small\strut\bf var 2}]{b1}{b2}
+% \connectboxanchors[top] [top] [text={\small\small\strut\bf var 3}]{a1}{b1}
+% \connectboxanchors[bottom][bottom][text={\small\small\strut\bf var 4}]{b1}{b2}
+% \connectboxanchors[bottom][bottom][text={\small\small\strut\bf var 6}]{a1}{a2}
+% \connectboxanchors[bottom][bottom][rulecolor=darkgreen,distance=4ex,text={\small\small\strut\bf var 7}]{c1}{d1}
+%
+% % \start
+%
+% $\showboxes
+% % \mathboxanchored{a1}{a}^{2^x} +
+% % \mathboxanchored[nucleus]{a1}{a}^{2^x} +
+% % \mathboxanchored{a1}{g}^2 +
+% % \mathboxanchored{a1}{a} +
+% a^{\mathboxanchored{a1}{2}} +
+% % a^{\mathboxanchored{a1}{2}}_3 +
+% \mathboxanchored{b1}{b}
+% =
+% \mathboxanchored{c1}{c}^2 +
+% \mathboxanchored[nucleus]{d1}{d}^2
+% =
+% b_{\mathboxanchored{b2}{3}} +
+% \mathboxanchored{a2}{a}
+% $
+% \stopbuffer
+%
+% \starttext
+% \startTEXpage[offset=10mm]\startboxanchoring[a]\getbuffer\stopboxanchoring\stopTEXpage
+% \startTEXpage[offset=11mm]\startboxanchoring[b]\getbuffer\stopboxanchoring\stopTEXpage
+% \startTEXpage[offset=12mm]\startboxanchoring[+]\getbuffer\stopboxanchoring\stopTEXpage
+% \stoptext
+
+\protect
diff --git a/Master/texmf-dist/tex/context/base/mkxl/anch-loc.lmt b/Master/texmf-dist/tex/context/base/mkxl/anch-loc.lmt
new file mode 100644
index 00000000000..14efab2606f
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/anch-loc.lmt
@@ -0,0 +1,520 @@
+if not modules then modules = { } end modules ['anch-loc'] = {
+ version = 1.001,
+ comment = "companion to anch-loc.lmtx",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local next, type = next, type
+local setmetatableindex, sortedhash, insert, remove = table.setmetatableindex, table.sortedhash, table.insert, table.remove
+
+local context = context
+
+local nuts = nodes.nuts
+local nodepool = nodes.pool
+local whatever = nodepool.userids["localanchor"]
+local new_usernode = nodepool.usernode
+local new_kern = nuts.pool.kern
+local getbox = nuts.getbox
+local getwidth = nuts.getwidth
+local setwidth = nuts.setwidth
+local getprop = nuts.getprop
+local insertbefore = nuts.insertbefore
+local insertafter = nuts.insertafter
+local setattributelist = nuts.setattributelist
+
+local texgetbox = tex.getbox
+
+local implement = interfaces.implement
+
+local analyze = drivers.converters.analyze
+
+local dimension_value = tokens.values.dimension
+
+local v_left = interfaces.variables.left
+local v_middle = interfaces.variables.middle
+
+local positionsstack = setmetatableindex("table")
+
+local function allocate2(t,k)
+ local v = { min = false, max = false }
+ t[k] = v
+ return v
+end
+
+local function allocate1(t,k)
+ local v = setmetatableindex({ cnt = { }, min = false, max = false }, allocate2)
+ t[k] = v
+ return v
+end
+
+local positions = setmetatableindex(allocate1)
+
+-- The basics:
+
+local function pushpositions()
+ insert(positionsstack,positions)
+ positions = setmetatableindex(allocate1)
+end
+
+local function poppositions()
+ positions = remove(positionsstack) or { }
+end
+
+local function initializepositions(driver,specification)
+ -- positions.width = specification.boundingbox[3]
+ -- positions.height = specification.boundingbox[4]
+end
+
+-- local function finalizepositions(...)
+-- end
+
+local function collectpositions(current,pos_h,pos_v,cur_b)
+ -- beware, we actually can have a copy due to setting trialrun so we cannot
+ -- fetch the nodetable directly but go via the metatable ... fast enough
+ local data = getprop(current,"data")
+ local hash = positions[data.name]
+ local x = data.x
+ local y = data.y
+ if not hash.min then
+ hash.min = x
+ hash.max = x
+ elseif x > hash.max then
+ hash.max = x
+ end
+ hash = hash[x]
+ if not hash.min then
+ hash.min = y
+ hash.max = y
+ elseif y > hash.max then
+ hash.max = y
+ end
+ hash[y] = { pos_h, pos_v, data, current, 0, false, cur_b }
+end
+
+local function valid(name,x,y)
+ if positions then
+ local xlist = positions[name]
+ if xlist then
+ xlist = xlist[x]
+ return xlist and xlist[y]
+ end
+ end
+end
+
+local function anchorx(name,x,y)
+ local v = valid(name,x,y)
+ return v and v[1] or 0
+end
+
+local function anchory(name,x,y)
+ local v = valid(name,x,y)
+ return v and v[2] or 0
+end
+
+local function anchorht(name,x,y)
+ local v = valid(name,x,y)
+ if v then
+ return v[7][2]
+ else
+ return 0
+ end
+end
+
+local function anchordp(name,x,y)
+ local v = valid(name,x,y)
+ if v then
+ return v[7][3]
+ else
+ return 0
+ end
+end
+
+local function anchorlr(name,x,y)
+ local v = valid(name,x,y)
+ if v then
+ return v[1] + v[7][1], v[2] - v[7][3]
+ else
+ return 0, 0
+ end
+end
+
+local function anchorur(name,x,y)
+ local v = valid(name,x,y)
+ if v then
+ return v[1] + v[7][1], v[2] + v[7][2]
+ else
+ return 0, 0
+ end
+end
+
+local function anchorul(name,x,y)
+ local v = valid(name,x,y)
+ if v then
+ return v[1], v[2] + v[7][2]
+ else
+ return 0, 0
+ end
+end
+
+local function anchorll(name,x,y)
+ local v = valid(name,x,y)
+ if v then
+ return v[1], v[2] - v[7][3]
+ else
+ return 0, 0
+ end
+end
+
+local function anchorxy(name,x,y)
+ local v = valid(name,x,y)
+ if v then
+ return v[1], v[2]
+ else
+ return 0, 0
+ end
+end
+
+local driver = {
+ actions = {
+ initialize = initializepositions,
+ -- finalize = finalizepositions,
+ },
+ flushers = {
+ userdefined = {
+ [whatever] = collectpositions,
+ }
+ }
+}
+
+function drivers.converters.resyncbox(n)
+ local b = getbox(n)
+ analyze(driver,b)
+ for name, position in next, positions do
+ local xlast = { }
+ local aligned = false
+ for c=position.min,position.max do
+ local column = position[c]
+ if column then
+ local min = column.min
+ if min then
+ local max = column.max
+ local xlimit = 0
+ for r=min,max do
+ local cell = column[r]
+ if cell and cell[3].kind == "sync" then
+ local x = cell[1]
+ local l = xlast[r]
+ if l and l ~= 0 then
+ x = x + l
+ cell[1] = x
+ end
+ if x > xlimit then
+ xlimit = x
+ end
+ if not aligned then
+ aligned = cell[3].align
+ end
+ end
+ end
+ for r=min,max do
+ local cell = column[r]
+ if cell and cell[3].kind == "sync" then
+ local progress = xlimit - cell[1]
+ if aligned or progress ~= 0 then
+ local kern = new_kern(progress)
+ local current = cell[4]
+ setattributelist(kern,current)
+ insertafter(current,current,kern) -- why does before not work
+ cell[5] = progress
+ cell[6] = kern
+ xlast[r] = (xlast[r] or 0) + progress
+ end
+ end
+ end
+ end
+ end
+ end
+
+ if aligned then
+ local min = position.min
+ local max = position.max
+ local previous = { }
+ for c=min,max do
+ local column = position[c]
+ if column then
+ local min = column.min
+ if min then
+ local max = column.max
+ for r=min,max do
+ local cell = column[r]
+ if cell then
+ local prev = previous[r]
+ if prev then
+ local align = prev[3].align
+ if align then
+ local p = prev[6]
+ local n = cell[6]
+ local d = cell[5]
+ if align == "r" or align == v_right then
+ setwidth(p,getwidth(p)+d)
+ setwidth(n,getwidth(n)-d)
+ elseif align == "c" or align == "m" or align == v_middle then
+ setwidth(p,getwidth(p)+d/2)
+ setwidth(n,getwidth(n)-d/2)
+ end
+ end
+ end
+ previous[r] = cell
+ end
+ end
+ end
+ end
+ end
+ end
+
+ end
+ return b
+end
+
+-- The ConTeXt interface (at that end we call them localanchors):
+
+implement {
+ name = "pushlocalanchors",
+ public = true,
+ protected = true,
+ untraced = true,
+ actions = pushpositions,
+}
+
+implement {
+ name = "poplocalanchors",
+ public = true,
+ protected = true,
+ untraced = true,
+ actions = poppositions,
+}
+
+implement {
+ name = "analyzelocalanchors",
+ arguments = { "integerargument" },
+ public = true,
+ protected = true,
+ untraced = true,
+ actions = function(n)
+ analyze(driver,texgetbox(n))
+ end
+}
+
+implement {
+ name = "synchronizelocalanchors",
+ arguments = { "integerargument" },
+ public = true,
+ protected = true,
+ untraced = true,
+ actions = drivers.converters.resyncbox,
+}
+
+implement {
+ name = "setlocalsyncanchor",
+ arguments = { "argument", "integerargument", "integerargument" },
+ public = true,
+ protected = true,
+ usage = "value",
+ actions = function(name,x,y)
+ -- value node ... only hlist or vlist or whatsit but we need trialmode so:
+ context(new_usernode(whatever,{ name = name, kind = "sync", x = x, y = y }))
+ end
+}
+
+implement {
+ name = "setlocalalignanchor",
+ arguments = { "argument", "integerargument", "integerargument", "argument" },
+ public = true,
+ protected = true,
+ usage = "value",
+ actions = function(name,x,y,align)
+ -- value node ... only hlist or vlist or whatsit but we need trialmode so:
+ context(new_usernode(whatever,{ name = name, kind = "sync", x = x, y = y, align = align }))
+ end
+}
+
+implement {
+ name = "setlocalmarkanchor",
+ arguments = { "argument", "integerargument", "integerargument" },
+ public = true,
+ protected = true,
+ usage = "value",
+ actions = function(name,x,y)
+ context(new_usernode(whatever,{ name = name, kind = "mark", x = x, y = y }))
+ end
+}
+
+implement {
+ name = "localanchorx",
+ arguments = { "argument", "integerargument", "integerargument" },
+ public = true,
+ usage = "value",
+ actions = function(name,x,y)
+ return dimension_value, anchorx(name,x,y)
+ end
+}
+
+implement {
+ name = "localanchory",
+ arguments = { "argument", "integerargument", "integerargument" },
+ public = true,
+ usage = "value",
+ actions = function(name,x,y)
+ return dimension_value, anchory(name,x,y)
+ end
+}
+
+interfaces.implement {
+ name = "sync",
+ arguments = { "argument", "integerargument" },
+ protected = true,
+ public = true,
+ actions = function(name,x)
+ local t = positions[name].cnt
+ local y = (t[x] or 0) + 1
+ t[x] = y
+ context(new_usernode(whatever,{ name = name, kind = "sync", x = x, y = y }))
+ end,
+}
+
+interfaces.implement {
+ name = "async",
+ arguments = { "argument", "integerargument", "argument" },
+ protected = true,
+ untraced = true,
+ public = true,
+ actions = function(name,x,align)
+ local t = positions[name].cnt
+ local y = (t[x] or 0) + 1
+ t[x] = y
+ context(new_usernode(whatever,{ name = name, kind = "sync", x = x, y = y, align = align }))
+ end,
+}
+
+-- The MetaFun interface:
+
+do
+
+ local injectors = mp.inject
+ local scanners = mp.scan
+
+ local injectnumeric = injectors.numeric
+ local injectpair = injectors.pair
+ local injectpath = injectors.path
+
+ local scaninteger = scanners.integer
+ local scanstring = scanners.string
+
+ local bpfactor = number.dimenfactors.bp
+
+ local registerscript = metapost.registerscript
+ local registerdirect = metapost.registerdirect
+
+ registerscript("anchorxy", function()
+ local x, y = anchorxy(scanstring(),scaninteger(),scaninteger())
+ return injectpair(x*bpfactor,y*bpfactor)
+ end)
+
+ registerdirect("anchorx", function() return anchorx(scanstring(),scaninteger(),scaninteger()) * bpfactor end)
+ registerdirect("anchory", function() return anchory(scanstring(),scaninteger(),scaninteger()) * bpfactor end)
+
+ registerdirect("anchorht", function() return anchorht(scanstring(),scaninteger(),scaninteger()) * bpfactor end)
+ registerdirect("anchordp", function() return anchordp(scanstring(),scaninteger(),scaninteger()) * bpfactor end)
+
+ local function corner(f)
+ local x, y = f(scanstring(),scaninteger(),scaninteger())
+ return injectpair(x*bpfactor,y*bpfactor)
+ end
+
+ registerdirect("anchorlr", function() return corner(anchorlr) end)
+ registerdirect("anchorur", function() return corner(anchorur) end)
+ registerdirect("anchorul", function() return corner(anchorul) end)
+ registerdirect("anchorll", function() return corner(anchorll) end)
+
+ registerscript("anchorbox", function()
+ local l = valid(scanstring(),scaninteger(),scaninteger())
+ local r = valid(scanstring(),scaninteger(),scaninteger())
+ local llx, lly, urx, ury, llb, urb
+ if l and r then
+ llx = l[1]
+ lly = l[2]
+ urx = r[1]
+ ury = r[2]
+ llb = l[7]
+ urb = r[7]
+ if llx > urx then
+ llx, urx = urx, llx
+ end
+ if lly > ury then
+ lly, ury = ury, lly
+ lly = lly - urb[3]
+ ury = ury + llb[2]
+ else
+ lly = lly - llb[3]
+ ury = ury + urb[2]
+ end
+ llx = llx * bpfactor
+ lly = lly * bpfactor
+ urx = urx * bpfactor
+ ury = ury * bpfactor
+ else
+ llx = 0
+ lly = 0
+ urx = 0
+ ury = 0
+ end
+ local p = {
+ cycle = true,
+ curled = true,
+ { llx, lly },
+ { urx, lly },
+ { urx, ury },
+ { llx, ury }
+ }
+ injectpath(p)
+ end)
+
+ -- boundingbox (
+ -- anchorul(lname, lx, ly) --
+ -- anchorlr(rname, rx, ry)
+ -- )
+
+ local min = math.min
+ local max = math.max
+
+ registerscript("anchorspan", function()
+ local l = valid(scanstring(),scaninteger(),scaninteger())
+ local r = valid(scanstring(),scaninteger(),scaninteger())
+ local llx, lly, urx, ury, lb, ub
+ if l and r then
+ lb = l[7]
+ rb = r[7]
+ llx = min((l[1] ),(r[1] )) * bpfactor
+ lly = min((l[2] - lb[3]),(r[2] - rb[3])) * bpfactor
+ urx = max((l[1] + lb[1]),(r[1] + rb[1])) * bpfactor
+ ury = max((l[2] + lb[2]),(r[2] + rb[2])) * bpfactor
+ else
+ llx = 0
+ lly = 0
+ urx = 0
+ ury = 0
+ end
+ local p = {
+ cycle = true,
+-- curled = true,
+ { llx, lly },
+ { urx, lly },
+ { urx, ury },
+ { llx, ury }
+ }
+ injectpath(p)
+ end)
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/anch-loc.mkxl b/Master/texmf-dist/tex/context/base/mkxl/anch-loc.mkxl
new file mode 100644
index 00000000000..8009e15954b
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/anch-loc.mkxl
@@ -0,0 +1,115 @@
+%D \module
+%D [ file=anch-loc,
+%D version=2021.05.27,
+%D title=\CONTEXT\ Anchoring Macros,
+%D subtitle=Local Positioning Support,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%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 Anchoring Macros / Local Positioning}
+
+%D This is a typical \LMTX\ feature that could have been provided in \MKIV\ but I
+%D never finished it there. In \LMTX\ we have already a bit better infrastructure
+%D for it.
+%D
+%D When watching the brilliant positive yt videos of Yoyoka Soma (よよã‹) drum
+%D performances one realizes that a covers can improve the original. Let's see if
+%D this module can improve some of the position related mechanisms. (Btw, quite
+%D often covers impress me more than originals I'd never list too anyway.)
+
+% todo:
+%
+% - make box fit and inject glue
+% - set height / depth or just insert something between
+
+\registerctxluafile{anch-loc}{autosuffix}
+
+\unprotect
+
+\aliased\let\syncanchor \gobblethreearguments
+\aliased\let\alignanchor\gobblefourarguments
+\aliased\let\markanchor \gobblethreearguments
+
+\permanent\protected\def\anch_local_withanchor_s #1#2#3{\leftboundary\setlocalsyncanchor {#1} #2 #3\rightboundary}
+\permanent\protected\def\anch_local_withanchor_a#1#2#3#4{\leftboundary\setlocalalignanchor{#1} #2 #3{#4}\rightboundary}
+\permanent\protected\def\anch_local_withanchor_n #1#2#3{\leftboundary\setlocalmarkanchor {#1} #2 #3\rightboundary}
+\permanent\protected\def\anch_local_withanchor_t #1#2#3{\anch_local_withanchor_n{#1}{#2}{#3}\smash[whd]{\smallinfofont\number#2-\number#3}}
+
+\permanent\protected\def\setlocalanchoring
+ {\enforced\let\syncanchor \anch_local_withanchor_s
+ \enforced\let\alignanchor\anch_local_withanchor_a
+ \enforced\let\markanchor \anch_local_withanchor_m}
+
+\let\anch_local_withanchor_m\anch_local_withanchor_n
+
+\installtextracker{localanchor}
+ {\let\anch_local_withanchor_m\anch_local_withanchor_t}
+ {\let\anch_local_withanchor_m\anch_local_withanchor_n}
+
+\permanent\protected\lettonothing\stopanchoring
+
+\permanent\protected\def\startanchoring#1\stopanchoring % todo: boundary
+ {\begingroup
+ \pushlocalanchors
+ \setlocalanchoring
+ \setbox\scratchbox\vbox{\settrialtypesetting#1}%
+ \analyzelocalanchors\scratchbox
+ \vbox{#1}%
+ \poplocalanchors
+ \endgroup}
+
+\permanent\protected\lettonothing\stopsynchronizing
+
+\permanent\protected\def\startsynchronizing#1\stopsynchronizing % todo: boundary
+ {\begingroup
+ \pushlocalanchors
+ \setlocalanchoring
+ \setbox\scratchbox\vbox{#1}%
+ \synchronizelocalanchors\scratchbox
+ \unvbox\scratchbox
+ \poplocalanchors
+ \endgroup}
+
+% variant on \sync (defined at the lua end)
+
+\permanent\protected\def\autosync#1#2{\leftboundary\sync{#1}{#2}\rightboundary}
+
+% \startsynchronizing
+% $a = a + a $\par
+% $a \mathsnc{1}= a + a $\par
+% $ \mordsnc{1}= a + a + a $\par
+% $ \mordsnc{1}= a \mathsnc{2}+ a + a + a$\par
+% $ \mordsnc{1} \mordsnc{2}+ a + a + a$
+% \stopsynchronizing
+
+\permanent\protected\def\mathsync#1{\sync{m}{#1}}
+\permanent\protected\def\mordsync#1{\mathord{}\sync{m}{#1}}
+\permanent\protected\def\mrelsync#1{\mathrel{}\sync{m}{#1}}
+\permanent\protected\def\mbinsync#1{\mathbin{}\sync{m}{#1}}
+
+\setlocalanchoring
+
+%D These are defined at the \LUA\ end.
+%D
+%D \starttyping
+%D \pushlocalanchors
+%D \poplocalanchors
+%D \analyzelocalanchors
+%D \synchronizelocalanchors
+%D \setlocalsyncanchor {name} x y | {name} {x} {y}
+%D \setlocalmarkanchor {name} x y | {name} {x} {y}
+%D \localanchorx {name} x y | {name} {x} {y}
+%D \localanchory {name} x y | {name} {x} {y}
+%D \sync {name} x | {name} {x}
+%D \stoptyping
+
+% \permanent\def\anchorxy#1#2#3{(\todimension\localanchorx{#1} #2 #3,\todimension\localanchory{#1} #2 #3)}
+
+\protect \endinput
+
+% Musical timestamp: Nightwish Decades bluray in loop mode.
diff --git a/Master/texmf-dist/tex/context/base/mkxl/anch-pgr.lmt b/Master/texmf-dist/tex/context/base/mkxl/anch-pgr.lmt
index 5b750d80e7a..575d4e90644 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/anch-pgr.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/anch-pgr.lmt
@@ -33,9 +33,15 @@ local context = context
local implement = interfaces.implement
+local texgetcount = tex.getcount
+local texiscount = tex.iscount
+
local getmacro = tokens.getters.macro
+local expandasvalue = tex.expandasvalue
local scanmpstring = mp.scan.string
-local mpgnamespace = getmacro("??graphicvariable")
+----- mpgnamespace = getmacro("??graphicvariable")
+
+local string_value = tokens.values.string
local report_graphics = logs.reporter("backgrounds")
local report_shapes = logs.reporter("backgrounds","shapes")
@@ -56,6 +62,8 @@ local f_pair = formatters["(%p,%p)"]
local f_path = formatters["%--t--cycle"]
local f_pair_i = formatters["(%r,%r)"] -- rounded
+local c_realpageno = texiscount("realpageno")
+
graphics = graphics or { }
local backgrounds = { }
graphics.backgrounds = backgrounds
@@ -89,9 +97,9 @@ local getdepth = nuts.getdepth
local nodecodes = nodes.nodecodes
local par_code = nodecodes.par
-local start_of_par = nuts.start_of_par
-local insert_before = nuts.insert_before
-local insert_after = nuts.insert_after
+local startofpar = nuts.startofpar
+local insertbefore = nuts.insertbefore
+local insertafter = nuts.insertafter
local processranges = nuts.processranges
@@ -101,15 +109,17 @@ local jobpositions = job.positions
local getpos = jobpositions.getpos
local getfree = jobpositions.getfree
-local data = { }
+----- data = { }
local realpage = 1
-local recycle = 1000 -- only tables can overflow this
+----- recycle = 1000 -- only tables can overflow this
local enabled = false
--- Freeing the data is somewhat tricky as we can have backgrounds spanning
--- many pages but for an arbitrary background shape that is not so common.
+-- Freeing the data is somewhat tricky as we can have backgrounds spanning many
+-- pages but for an arbitrary background shape that is not so common but we use
+-- a different trick anyway in lmtx.
local function check(specification)
+ --
local a = specification.attribute
local index = specification.index
local depth = specification.depth
@@ -159,13 +169,17 @@ local function check(specification)
wn[3] = dp
end
end
- -- inspect(w)
+-- inspect(w)
end
local index = 0
+local registervalue = attributes.registervalue
+local getvalue = attributes.getvalue
+
local function flush(head,f,l,a,parent,depth)
- local d = data[a]
+ -- local d = data[a]
+ local d = getvalue(a_textbackground,a)
if d then
local ix = index
local ht = getheight(parent)
@@ -176,29 +190,53 @@ local function flush(head,f,l,a,parent,depth)
ln = new_hlist(setlink(new_rule(65536,65536*4,0),new_kern(-65536),ln))
rn = new_hlist(setlink(new_rule(65536,0,65536*4),new_kern(-65536),rn))
end
- if getid(f) == par_code and start_of_par(f) then -- we need to clean this mess
- insert_after(head,f,ln)
+ if getid(f) == par_code and startofpar(f) then -- we need to clean this mess
+ insertafter(head,f,ln)
else
- head, f = insert_before(head,f,ln)
+ head, f = insertbefore(head,f,ln)
end
- insert_after(head,l,rn)
+ insertafter(head,l,rn)
end
return head, true
end
+-- local function registerbackground(name)
+-- local n = #data + 1
+-- if n > recycle then
+-- -- we could also free all e: that are beyond a page but we don't always
+-- -- know the page so a recycle is nicer and the s lists are kept anyway
+-- -- so the amount of kept data is not that large
+-- n = 1
+-- end
+-- local b = jobpositions.tobesaved["b:"..name]
+-- if b then
+-- local s = setmetatableindex("table")
+-- b.s = s
+-- data[n] = {
+-- bpos = b,
+-- name = name,
+-- n = n,
+-- shapes = s,
+-- count = 0,
+-- sindex = 0,
+-- }
+-- texsetattribute(a_textbackground,n)
+-- if not enabled then
+-- enableaction("contributers", "nodes.handlers.textbackgrounds")
+-- enabled = true
+-- end
+-- else
+-- texsetattribute(a_textbackground,unsetvalue)
+-- end
+-- end
+
local function registerbackground(name)
- local n = #data + 1
- if n > recycle then
- -- we could also free all e: that are beyond a page but we don't always
- -- know the page so a recycle is nicer and the s lists are kept anyway
- -- so the amount of kept data is not that large
- n = 1
- end
local b = jobpositions.tobesaved["b:"..name]
if b then
+ local n = registervalue(a_textbackground,t)
local s = setmetatableindex("table")
b.s = s
- data[n] = {
+ local t = {
bpos = b,
name = name,
n = n,
@@ -216,24 +254,10 @@ local function registerbackground(name)
end
end
--- local function collectbackgrounds(r,n)
--- if enabled then
--- local parent = getbox(n)
--- local head = getlist(parent)
--- realpage = r
--- processranges(a_textbackground,flush,head) -- ,parent)
--- end
--- end
---
--- interfaces.implement {
--- name = "collectbackgrounds",
--- actions = collectbackgrounds,
--- arguments = { "integer", "integer" }
--- }
-
nodes.handlers.textbackgrounds = function(head,where,parent) -- we have hlistdir and local dir
-- todo enable action in register
- index = index + 1
+ index = index + 1
+ realpage = texgetcount(c_realpageno)
return processranges(a_textbackground,flush,head,parent)
end
@@ -246,8 +270,6 @@ interfaces.implement {
-- optimized already but we can assume a cycle i.e. prune the last point and then
-- even less code .. we could merge some loops but his is more robust
--- use idiv here
-
local function topairs(t,n)
local r = { }
for i=1,n do
@@ -794,9 +816,7 @@ local function calculatemultipar(tag)
for i=bindex+1,eindex-1 do
br = f_tag_two(btag,i)
local r = collected[br]
- if not r then
- report_graphics("invalid middle for %a",br)
- else
+ if r then
local rp = r.p -- page
local pp = list[rp]
local mp = middlepart(b,e,p,rp,r,left,right)
@@ -805,6 +825,8 @@ local function calculatemultipar(tag)
else
list[rp] = { mp }
end
+ else
+ report_graphics("invalid middle for %a",br)
end
end
local ep = e.p -- page
@@ -1195,13 +1217,13 @@ backgrounds.fetchmultipar = fetchmultipar
local function getwhatever(action)
local tags = scanmpstring()
local anchor = scanmpstring()
- local page = nil
+ local page = texgetcount(c_realpageno)
if tags == "self" then
- tags = getmacro(mpgnamespace .. getmacro("currentmpvariableclass") .. ":self",true) -- Isn't it already edef'd?
+ tags = expandasvalue(string_value,"mpcategoryparameter",true,"self")
elseif type(tags) == "string" then
tags = settings_to_array(tags)
for i=1,#tags do
- tags[i] = getmacro(mpgnamespace .. getmacro("currentmpvariableclass") .. ":" .. tags[i],true) -- Isn't it already edef'd?
+ tags[i] = expandasvalue(string_value,"mpcategoryparameter",true,tags[i])
end
end
if anchor == "anchor" then
@@ -1212,6 +1234,8 @@ local function getwhatever(action)
end
end
+-- backgrounds.getwhatever = getwhatever -- public for tracing
+
metapost.registerscript("getmultipars", function()
return getwhatever(fetchmultipar)
end)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/anch-pgr.mkxl b/Master/texmf-dist/tex/context/base/mkxl/anch-pgr.mkxl
index ec8f0e549f2..10c66b66581 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/anch-pgr.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/anch-pgr.mkxl
@@ -116,8 +116,8 @@
%D stick to just one anchor and derive the head and tail anchors from this one. We
%D set these anchors before and after each page.
-\newdimen\c_anch_page_width
-\newdimen\c_anch_page_height
+\newdimension\c_anch_page_width
+\newdimension\c_anch_page_height
\protected\def\anch_positions_register_page#1% this one is flushed first ! ... can't we avoid this one
{\ifpositioning\ifcase\realpageno\or
@@ -204,13 +204,13 @@
%D
%D \typebuffer[graphic]
-\immutable\def\MPanchoridentifier{mpa} % {mp-anchor}
-\mutable \def\MPanchornumber {\the\realpageno}
-\mutable \let\MPanchorid \empty
+\immutable\def \MPanchoridentifier{mpa} % {mp-anchor}
+\mutable \def \MPanchornumber {\the\realpageno}
+\mutable \lettonothing\MPanchorid
%D The rest of the definitions concerning such overlays may look complicated,
-\mutable\let\currentpositionoverlay\empty
+\mutable\lettonothing\currentpositionoverlay
%D Position actions are automatically executed when a position is set.
@@ -245,7 +245,7 @@
{\dopositionaction{\currentpositionoverlay::\MPanchoridentifier}\hss}%
\ht\scratchbox\d_overlay_height
\dp\scratchbox\zeropoint
- \anch_mark_tagged_box\scratchbox\MPanchorid % needs an hbox
+ \anch_mark_tagged_box\scratchbox\MPanchorid\zerocount % needs an hbox
\box\scratchbox
\vfill}}
@@ -256,7 +256,7 @@
\expandafter\gobbletwoarguments
\fi}
-\let\currentpositionregion\empty
+\lettonothing\currentpositionregion
\def\anch_positions_region_overlay_indeed#1#2%
{\begingroup
@@ -294,14 +294,14 @@
\ifdefined\checkpositionoverlays \else \let\checkpositionoverlays\relax \fi
-\mutable\let\currentpositionoverlay\empty
+\mutable\lettonothing\currentpositionoverlay
\def\anch_positions_overlay_start_yes#1%
{\checkpositionoverlays
\edef\currentpositionoverlay{#1}}
\permanent\protected\def\stoppositionoverlay
- {\let\currentpositionoverlay\empty}
+ {\lettonothing\currentpositionoverlay}
%D A position graphic is a normal (non||reused) \METAPOST\ graphic, used
%D immediately, with zero dimensions, so that a sequence of them does not harm.
@@ -315,19 +315,19 @@
\permanent\tolerant\protected\def\startMPpositiongraphic#=#*#=#:#3\stopMPpositiongraphic % tag list mpcode
{\gdefcsname\??positiongraphic#1\endcsname{\anch_positions_meta_graphic_use{#1}{#2}{#3}}}
-\aliased\let\stopMPpositiongraphic\relax
+\permanent\protected\lettonothing\stopMPpositiongraphic
\def\anch_positions_meta_graphic_prepare
- {\ifcsname\??graphicvariable\currentmpvariableclass:self\endcsname \else
- \letcsname\??graphicvariable\currentmpvariableclass:self\endcsname\currentposition
+ {\iftok{\mpcategoryparameter{self}}\emptytoks
+ \letmpcategoryparameter{self}\currentposition
\fi
- \ifcsname\??graphicvariable\currentmpvariableclass:from\endcsname \else
- \letcsname\??graphicvariable\currentmpvariableclass:from\endcsname\currentposition
+ \iftok{\mpcategoryparameter{from}}\emptytoks
+ \letmpcategoryparameter{from}\currentposition
\fi}
\def\anch_positions_meta_graphic_use#1#2#3%
{\begingroup
- \meta_prepare_variables{#2}%
+ \edef\currentmpcategory{#1}%
\anch_positions_meta_graphic_prepare
\startMPcode#3\stopMPcode
\endgroup}
@@ -346,13 +346,13 @@
\def\anch_positions_meta_graphic_direct#1#2#3% what tag setups
{\begingroup
- \setupMPvariables[#2][#3]%
- \edef\currentmpvariableclass{#2}%
+ \edef\currentmpcategory{#2}%
+ \setupcurrentmpcategory[#3]%
\anch_positions_meta_graphic_prepare
\obeyMPboxorigin % do we also set the size ? when needed this must be done in mp ... might change
\enforced\tolerant\protected\def\MPpositiongraphic##=##*##={\anch_positions_meta_graphic_nested{#3}{##1}{##2}}% takes two extra arguments
% \def\anch_positions_meta_graphic_direct{\anch_positions_meta_graphic_nested{#3}}% takes two extra arguments
- \setbox\b_anch_positions_graphic\hbox % \hpack
+ \setbox\b_anch_positions_graphic\hpack
{\ignorespaces\begincsname#1#2\endcsname\removelastspace}%
\smashbox\b_anch_positions_graphic
\box\b_anch_positions_graphic
@@ -360,8 +360,8 @@
\def\anch_positions_meta_graphic_nested#1#2#3% nesting used in prikkels / pascal (might go away)
{\begingroup
- \setupMPvariables[#2][#1,#3]%
- \edef\currentmpvariableclass{#2}%
+ \edef\currentmpcategory{#2}%
+ \setupcurrentmpcategory[#1,#3]%
\anch_positions_meta_graphic_prepare
\begincsname\??positiongraphic#2\endcsname
\endgroup}%
@@ -369,7 +369,7 @@
\permanent\def\startMPpositionmethod#1#2\stopMPpositionmethod
{\gdefcsname\??positionmethod#1\endcsname{#2}} % todo: var list here
-\aliased\let\stopMPpositionmethod\relax
+\permanent\protected\lettonothing\stopMPpositionmethod
%D Simple one position graphics.
@@ -427,7 +427,7 @@
\def\anch_positions_meta_graphic_cleanup_range#1#2#3#4% pos tag setups
{\ifnum\MPp{#2}<\realpageno \else
- \noexpand \anch_positions_meta_graphic_handle_range_indeed{#1}{#2}{#3}{#4}%
+ \noexpand\anch_positions_meta_graphic_handle_range_indeed{#1}{#2}{#3}{#4}%
\fi}
\appendtoks
diff --git a/Master/texmf-dist/tex/context/base/mkxl/anch-pos.lmt b/Master/texmf-dist/tex/context/base/mkxl/anch-pos.lmt
index 67d1657f20d..79a0da09744 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/anch-pos.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/anch-pos.lmt
@@ -6,33 +6,46 @@ if not modules then modules = { } end modules ['anch-pos'] = {
license = "see context related readme files"
}
---[[ldx--
-<p>We save positional information in the main utility table. Not only
-can we store much more information in <l n='lua'/> but it's also
-more efficient.</p>
---ldx]]--
-
--- plus (extra) is obsolete but we will keep it for a while
+-- We save positional information in the main utility table. Not only can we store
+-- much more information in Lua but it's also more efficient. In the meantime these
+-- files have become quite large. In some cases that get noticed by a hickup in the
+-- start and/or finish, but that is the price we pay for progress.
+--
+-- This was the last module that got rid of directly setting scanners, with a little
+-- performance degradation but not that noticeable. It is also a module that has been
+-- on the (partial) redo list for a while.
--
--- maybe replace texsp by our own converter (stay at the lua end)
--- eventually mp will have large numbers so we can use sp there too
+-- We can gain a little when we group positions but then we still have to deal with
+-- regions and cells so we either end up with lots of extra small tables pointing to
+-- them and/or assembling/disassembling. I played with that and rejected the idea
+-- until I ran into a test case where we had 50.000 one line paragraphs in an eight
+-- columns setup, and there we save 25 M on a 75 M tuc file. So, I played a bit more
+-- and we can have a solution that is of similar performance for regular documents
+-- (in spite of the extra overhead) but also works ok for the large files. In normal
+-- documents it is never a problem, but there are always exceptions to the normal and
+-- often these are also cases where positions are not really used but end up in the
+-- tuc file anyway.
--
--- this is one of the first modules using scanners and we need to replace it by
--- implement and friends
+-- Currently (because we never had split tags) we do splitting at access time, which
+-- is sort of inefficient but still ok. Much of this mechanism comes from MkII where
+-- TeX was the bottleneck.
--
--- we could have namespaces, like p, page, region, columnarea, textarea but then
--- we need virtual table accessors as well as have tag/id accessors ... we don't
--- save much here (at least not now)
+-- By grouping we need to set more metatable so in the end that is also overhead
+-- but on the average we're okay because excessive serialization also comes at a price
+-- and this way we also delay some activities till the moment it is realy used (which
+-- is not always the case with positional information. We will make this transition
+-- stepwise so till we're done there will be inefficiencies and overhead.
--
--- This was the last module that got rid of directly setting scanners, with a little
--- performance degradation but not that noticeable.
+-- The pure hash based variant combined with filtering is in anch-pos.lua and previous
+-- lmt versions! That is the reference.
-local tostring, next, setmetatable, tonumber = tostring, next, setmetatable, tonumber
-local sort = table.sort
+local tostring, next, setmetatable, tonumber, rawget, rawset = tostring, next, setmetatable, tonumber, rawget, rawset
+local sort, sortedhash = table.sort, table.sortedhash
local format, gmatch = string.format, string.gmatch
-local lpegmatch = lpeg.match
+local P, R, C, Cc, lpegmatch = lpeg.P, lpeg.R, lpeg.C, lpeg.Cc, lpeg.match
local insert, remove = table.insert, table.remove
local allocate = utilities.storage.allocate
+local setmetatableindex, setmetatablenewindex = table.setmetatableindex, table.setmetatablenewindex
local report = logs.reporter("positions")
@@ -49,17 +62,20 @@ local context = context
local ctx_latelua = context.latelua
local tex = tex
+local texgetdimen = tex.getdimen
local texgetcount = tex.getcount
local texgetinteger = tex.getintegervalue or tex.getcount
+local texiscount = tex.iscount
+local texisdimen = tex.isdimen
local texsetcount = tex.setcount
local texget = tex.get
local texsp = tex.sp
----- texsp = string.todimen -- because we cache this is much faster but no rounding
-
-local setmetatableindex = table.setmetatableindex
-local setmetatablenewindex = table.setmetatablenewindex
+local texgetnest = tex.getnest
+local texgetparstate = tex.getparstate
local nuts = nodes.nuts
+local tonut = nodes.tonut
local setlink = nuts.setlink
local getlist = nuts.getlist
@@ -67,8 +83,12 @@ local setlist = nuts.setlist
local getbox = nuts.getbox
local getid = nuts.getid
local getwhd = nuts.getwhd
+local setprop = nuts.setprop
+
+local getparstate = nuts.getparstate
local hlist_code = nodes.nodecodes.hlist
+local par_code = nodes.nodecodes.par
local find_tail = nuts.tail
----- hpack = nuts.hpack
@@ -85,6 +105,7 @@ local formatters = string.formatters
local collected = allocate()
local tobesaved = allocate()
+local positionsused = nil
local jobpositions = {
collected = collected,
@@ -109,138 +130,717 @@ local default = { -- not r and paragraphs etc
hs = 0, -- hsize
pi = 0, -- parindent
ps = false, -- parshape
- dir = 0,
+ dir = 0, -- obsolete
+ r2l = false, -- righttoleft
}
}
-local f_b_tag = formatters["b:%s"]
-local f_e_tag = formatters["e:%s"]
-local f_p_tag = formatters["p:%s"]
-local f_w_tag = formatters["w:%s"]
-
-local f_region = formatters["region:%s"]
-
-local f_tag_three = formatters["%s:%s:%s"]
-local f_tag_two = formatters["%s:%s"]
-
-local nofregular = 0
-local nofspecial = 0
-local splitter = lpeg.splitat(":",true)
-
-local pagedata = { }
-local columndata = setmetatableindex("table") -- per page
-local freedata = setmetatableindex("table") -- per page
-
-local function initializer()
- tobesaved = jobpositions.tobesaved
- collected = jobpositions.collected
- for tag, data in next, collected do
- local prefix, rest = lpegmatch(splitter,tag)
- if prefix == "p" then
- nofregular = nofregular + 1
- elseif prefix == "page" then
- nofregular = nofregular + 1
- pagedata[tonumber(rest) or 0] = data
- elseif prefix == "free" then
- nofspecial = nofspecial + 1
- local t = freedata[data.p or 0]
- t[#t+1] = data
- elseif prefix == "columnarea" then
- columndata[data.p or 0][data.c or 0] = data
- end
- setmetatable(data,default)
- end
- --
- local pages = structures.pages.collected
- if pages then
- local last = nil
- for p=1,#pages do
- local region = "page:" .. p
- local data = pagedata[p]
- local free = freedata[p]
- if free then
- sort(free,function(a,b) return b.y < a.y end) -- order matters !
- end
- if data then
- last = data
- last.free = free
- elseif last then
- local t = setmetatableindex({ free = free, p = p },last)
- if not collected[region] then
- collected[region] = t
+local f_b_tag = formatters["b:%s"]
+local f_e_tag = formatters["e:%s"]
+local f_p_tag = formatters["p:%s"]
+----- f_w_tag = formatters["w:%s"]
+
+local f_region = formatters["region:%s"]
+
+local f_tag_three = formatters["%s:%s:%s"]
+local f_tag_two = formatters["%s:%s"]
+
+local c_realpageno = texiscount("realpageno")
+local d_strutht = texisdimen("strutht")
+local d_strutdp = texisdimen("strutdp")
+
+-- Because positions are set with a delay we cannot yet make the tree -- so that
+-- is a finalizer step. But, we already have a dual split.
+
+local treemode = false
+local treemode = true
+
+local function checkshapes(s)
+ for p, data in next, s do
+ local n = #data
+ if n > 1 then
+ local d1 = data[1]
+ local ph = d1[2]
+ local pd = d1[3]
+ local xl = d1[4]
+ local xr = d1[5]
+ for i=2,n do
+ local di = data[i]
+ local h = di[2]
+ local d = di[3]
+ local l = di[4]
+ local r = di[5]
+ if r == xr then
+ di[5] = nil
+ if l == xl then
+ di[4] = nil
+ if d == pd then
+ di[3] = nil
+ if h == ph then
+ di[2] = nil
+ else
+ ph = h
+ end
+ else
+ pd, ph = d, h
+ end
+ else
+ ph, pd, xl = h, d, l
+ end
else
- -- something is wrong
+ ph, pd, xl, xr = h, d, l, r
end
- pagedata[p] = t
end
end
end
- jobpositions.pagedata = pagedata
-end
-
-function jobpositions.used()
- return next(collected) -- we can safe it
end
-function jobpositions.getfree(page)
- return freedata[page]
-end
-
--- we can gain a little when we group positions but then we still have to
--- deal with regions and cells so we either end up with lots of extra small
--- tables pointing to them and/or assembling/disassembling so in the end
--- it makes no sense to do it (now) and still have such a mix
---
--- proof of concept code removed ... see archive
-
-local function finalizer()
- -- We make the (possible extensive) shape lists sparse working
- -- from the end. We could also drop entries here that have l and
- -- r the same which saves testing later on.
- for k, v in next, tobesaved do
- local s = v.s
- if s then
- for p, data in next, s do
- local n = #data
- if n > 1 then
- local ph = data[1][2]
- local pd = data[1][3]
- local xl = data[1][4]
- local xr = data[1][5]
- for i=2,n do
- local di = data[i]
- local h = di[2]
- local d = di[3]
- local l = di[4]
- local r = di[5]
- if r == xr then
- di[5] = nil
- if l == xl then
- di[4] = nil
- if d == pd then
- di[3] = nil
- if h == ph then
- di[2] = nil
- else
- ph = h
+local columndata = { }
+local freedata = { } -- we can make these weak
+local syncdata = { } -- we can make these weak
+local columndone = false
+
+if treemode then
+
+ -- At some point we can install extra ones. I actually was halfway making a more
+ -- general installer but we have quite some distinct handling down here and it
+ -- became messy. So I rolled that back. Also, users and modules will quite likely
+ -- stay in the "user" namespace.
+
+ -- syncpos : indirect access via helper, todo after we switch: direct setters
+ -- free : indirect access via helper, todo after we switch: direct setters
+ -- columnarea : indirect access via helper, todo after we switch: direct setters
+
+ -- todo: keep track of total and check that against # (sanity check)
+
+ local prefix_number = { "text", "textarea", "page", "p", "free", "columnarea" }
+ local prefix_label_number = { "syncpos" }
+ local prefix_number_rest = { "region", "b", "e" }
+
+ -- no need to split: syncpos free columnarea (textarea?)
+
+ local function splitter_pattern()
+ local p_number = R("09")^1/tonumber
+ local p_colon = P(":")
+ local p_label = C(P(1 - p_colon)^0)
+ local p_rest = C(P(1)^0)
+ return
+ C(lpeg.utfchartabletopattern(prefix_number )) * p_colon * p_number * P(-1)
+ + C(lpeg.utfchartabletopattern(prefix_label_number)) * p_colon * (p_number + p_label) * p_colon * p_number * P(-1)
+ + C(lpeg.utfchartabletopattern(prefix_number_rest )) * p_colon * (p_number + p_rest)
+ + Cc("user") * p_rest
+ end
+
+ -- In the end these metatable entries are not more efficient than copying
+ -- but it's all about making sure that the tuc file doesn't explode.
+
+ columndata = { }
+ columndone = false
+
+ local deltapacking = true -- so we can see the difference
+-- local deltapacking = false -- so we can see the difference
+
+ local function checkcommondata(v,common)
+ if common then
+ local i = v.i
+ local t = common[i]
+ if t then
+v.i = nil
+ local m = t.mt
+ if not m then
+ setmetatable(t,default)
+ m = { __index = t }
+ t.mt = m
+ end
+ setmetatable(v,m)
+ return
+ end
+ end
+ setmetatable(v,default)
+ end
+
+ local function initializer()
+ tobesaved = jobpositions.tobesaved
+ collected = jobpositions.collected
+ --
+ local p_splitter = splitter_pattern()
+ --
+ local list = nil
+ --
+ local shared = setmetatableindex(rawget(collected,"shared"),"table")
+ local x_y_w_h_list = shared.x_y_w_h
+ local y_w_h_d_list = shared.y_w_h_d
+ local x_h_d_list = shared.x_h_d
+ local x_h_d_hs_list = shared.x_h_d_hs
+ --
+ columndata = setmetatableindex(function(t,k)
+ setmetatableindex(t,"table")
+ list = rawget(collected,"columnarea")
+ if list then
+ -- for tag, data in next, list do
+ for i=1,#list do
+ local data = list[i]
+ columndata[data.p or 0][data.c or 0] = data
+ checkcommondata(data,y_w_h_d_list)
+ end
+ end
+ columndone = true
+ return t[k]
+ end)
+ --
+ -- todo: use a raw collected and a weak proxy
+ --
+ setmetatableindex(collected,function(t,k)
+ if k ~= true then
+ local prefix, one, two = lpegmatch(p_splitter,k)
+ local list = rawget(t,prefix)
+ if list and type(list) == "table" then
+ local v = list[one] or false
+ if v then
+ if prefix == "p" then
+ -- if deltapacking and type(v) == "number" then
+ if type(v) == "number" then
+ for i=one,1,-1 do
+ local l = list[i]
+ if type(l) ~= "number" then
+ if not getmetatable(l) then
+ checkcommondata(l,x_h_d_hs_list)
+ end
+ v = setmetatable({ y = v }, { __index = l })
+ list[one] = v
+ break
+ end
+ end
+ else
+ checkcommondata(v,x_h_d_hs_list)
+ end
+ elseif prefix == "text" or prefix == "textarea" then
+ if type(v) == "number" then
+ for i=one,1,-1 do
+ local l = list[i]
+ if type(l) ~= "number" then
+ if not getmetatable(l) then
+ checkcommondata(l,x_y_w_h_list)
+ end
+ v = setmetatable({ p = v }, { __index = l })
+ list[one] = v
+ break
end
- else
- pd, ph = d, h
end
else
- ph, pd, xl = h, d, l
+ checkcommondata(v,x_y_w_h_list)
+ end
+ elseif prefix == "columnarea" then
+ if not columndone then
+ checkcommondata(v,y_w_h_d_list)
end
+ elseif prefix == "syncpos" then
+ -- will become an error
+ if two then
+ -- v = syncdata[one][two] or { }
+ v = v[two] or { }
+ else
+ v = { }
+ end
+ -- for j=1,#v do
+ -- checkcommondata(v[j],x_h_d_list)
+ -- end
+ elseif prefix == "free" then
+ -- will become an error
+ elseif prefix == "page" then
+ checkcommondata(v)
else
- ph, pd, xl, xr = h, d, l, r
+ checkcommondata(v)
+ end
+ else
+ if prefix == "page" then
+ for i=one,1,-1 do
+ local data = list[i]
+ if data then
+ v = setmetatableindex({ free = free or false, p = p },last)
+ list[one] = v
+ break
+ end
+ end
end
end
+ t[k] = v
+ return v
+ end
+ end
+ t[k] = false
+ return false
+ end)
+ --
+ setmetatableindex(tobesaved,function(t,k)
+ local prefix, one, two = lpegmatch(p_splitter,k)
+ local v = rawget(t,prefix)
+ if v and type(v) == "table" then
+ v = v[one]
+ if v and two then
+ v = v[two]
+ end
+ return v -- or default
+ else
+ -- return default
+ end
+ end)
+ --
+ setmetatablenewindex(tobesaved,function(t,k,v)
+ local prefix, one, two = lpegmatch(p_splitter,k)
+ local p = rawget(t,prefix)
+ if not p then
+ p = { }
+ rawset(t,prefix,p)
+ end
+ if type(one) == "number" then -- maybe Cc(0 1 2)
+ if #p < one then
+ for i=#p+1,one-1 do
+ p[i] = { } -- false
+ end
end
end
+ if two then
+ local pone = p[one]
+ if not pone then
+ pone = { }
+ p[one] = pone
+ end
+ if type(two) == "number" then -- maybe Cc(0 1 2)
+ if #pone < two then
+ for i=#pone+1,two-1 do
+ pone[i] = { } -- false
+ end
+ end
+ end
+ pone[two] = v
+ else
+ p[one] = v
+ end
+ end)
+ --
+ syncdata = setmetatableindex(function(t,category)
+ -- p's and y's are not shared so no need to resolve
+ local list = rawget(collected,"syncpos")
+ local tc = list and rawget(list,category)
+ if tc then
+ sort(tc,function(a,b)
+ local ap = a.p
+ local bp = b.p
+ if ap == bp then
+ return b.y < a.y
+ else
+ return ap < bp
+ end
+ end)
+ tc.start = 1
+ for i=1,#tc do
+ checkcommondata(tc[i],x_h_d_list)
+ end
+ else
+ tc = { }
+ end
+ t[category] = tc
+ return tc
+ end)
+ end
+
+ local function finalizer()
+
+ -- We make the (possible extensive) shape lists sparse working from the end. We
+ -- could also drop entries here that have l and r the same which saves testing
+ -- later on.
+
+ local nofpositions = 0
+ local nofpartials = 0
+ local nofdeltas = 0
+ --
+ local x_y_w_h_size = 0
+ local x_y_w_h_list = { }
+ local x_y_w_h_hash = setmetatableindex(function(t,x)
+ local y = setmetatableindex(function(t,y)
+ local w = setmetatableindex(function(t,w)
+ local h = setmetatableindex(function(t,h)
+ x_y_w_h_size = x_y_w_h_size + 1
+ t[h] = x_y_w_h_size
+ x_y_w_h_list[x_y_w_h_size] = { x = x, y = y, w = w, h = h }
+ return x_y_w_h_size
+ end)
+ t[w] = h
+ return h
+ end)
+ t[y] = w
+ return w
+ end)
+ t[x] = y
+ return y
+ end)
+ --
+ local y_w_h_d_size = 0
+ local y_w_h_d_list = { }
+ local y_w_h_d_hash = setmetatableindex(function(t,y)
+ local w = setmetatableindex(function(t,w)
+ local h = setmetatableindex(function(t,h)
+ local d = setmetatableindex(function(t,d)
+ y_w_h_d_size = y_w_h_d_size + 1
+ t[d] = y_w_h_d_size
+ y_w_h_d_list[y_w_h_d_size] = { y = y, w = w, h = h, d = d }
+ return y_w_h_d_size
+ end)
+ t[h] = d
+ return d
+ end)
+ t[w] = h
+ return h
+ end)
+ t[y] = w
+ return w
+ end)
+ --
+ local x_h_d_size = 0
+ local x_h_d_list = { }
+ local x_h_d_hash = setmetatableindex(function(t,x)
+ local h = setmetatableindex(function(t,h)
+ local d = setmetatableindex(function(t,d)
+ x_h_d_size = x_h_d_size + 1
+ t[d] = x_h_d_size
+ x_h_d_list[x_h_d_size] = { x = x, h = h, d = d }
+ return x_h_d_size
+ end)
+ t[h] = d
+ return d
+ end)
+ t[x] = h
+ return h
+ end)
+ --
+ local x_h_d_hs_size = 0
+ local x_h_d_hs_list = { }
+ local x_h_d_hs_hash = setmetatableindex(function(t,x)
+ local h = setmetatableindex(function(t,h)
+ local d = setmetatableindex(function(t,d)
+ local hs = setmetatableindex(function(t,hs)
+ x_h_d_hs_size = x_h_d_hs_size + 1
+ t[hs] = x_h_d_hs_size
+ x_h_d_hs_list[x_h_d_hs_size] = { x = x, h = h, d = d, hs = hs }
+ return x_h_d_hs_size
+ end)
+ t[d] = hs
+ return hs
+ end)
+ t[h] = d
+ return d
+ end)
+ t[x] = h
+ return h
+ end)
+ --
+ rawset(tobesaved,"shared", {
+ x_y_w_h = x_y_w_h_list,
+ y_w_h_d = y_w_h_d_list,
+ x_h_d = x_h_d_list,
+ x_h_d_hs = x_h_d_hs_list,
+ })
+ --
+ -- If fonts can use crazy and hard to grasp packing tricks so can we. The "i" field
+ -- refers to a shared set of values. In addition we pack some sequences.
+ --
+ -- how about free
+ --
+ for k, v in sortedhash(tobesaved) do
+ if k == "p" then
+ -- numeric
+ local n = #v
+ for i=1,n do
+ local t = v[i]
+ local hsh = x_h_d_hs_hash[t.x or 0][t.h or 0][t.d or 0][t.hs or 0]
+ t.x = nil
+ t.h = nil
+ t.d = nil
+ t.hs = nil -- not in syncpos
+ t.i = hsh
+ local s = t.s
+ if s then
+ checkshapes(s)
+ end
+ end
+ if deltapacking then
+ -- delta packing (y)
+ local last
+ local current
+ for i=1,n do
+ current = v[i]
+ if last then
+ for k, v in next, last do
+ if k ~= "y" and v ~= current[k] then
+ goto DIFFERENT
+ end
+ end
+ for k, v in next, current do
+ if k ~= "y" and v ~= last[k] then
+ goto DIFFERENT
+ end
+ end
+ v[i] = current.y or 0
+ nofdeltas = nofdeltas + 1
+ goto CONTINUE
+ end
+ ::DIFFERENT::
+ last = current
+ ::CONTINUE::
+ end
+ end
+ --
+ nofpositions = nofpositions + n
+ nofpartials = nofpartials + n
+ elseif k == "syncpos" then
+ -- hash
+ for k, t in next, v do
+ -- numeric
+ local n = #t
+ for j=1,n do
+ local t = t[j]
+ local hsh = x_h_d_hash[t.x or 0][t.h or 0][t.d or 0]
+ t.x = nil
+ t.h = nil
+ t.d = nil
+ t.i = hsh
+ end
+ nofpositions = nofpositions + n
+ nofpartials = nofpartials + n
+ end
+ elseif k == "text" or k == "textarea" then
+ -- numeric
+ local n = #v
+ for i=1,n do
+ local t = v[i]
+ local hsh = x_y_w_h_hash[t.x or 0][t.y or 0][t.w or 0][t.h or 0]
+ t.x = nil
+ t.y = nil
+ t.w = nil
+ t.h = nil
+ t.i = hsh
+ end
+ nofpositions = nofpositions + n
+ nofpartials = nofpartials + n
+ if deltapacking then
+ -- delta packing (p)
+ local last
+ local current
+ for i=1,n do
+ current = v[i]
+ if last then
+ for k, v in next, last do
+ if k ~= "p" and v ~= current[k] then
+ goto DIFFERENT
+ end
+ end
+ for k, v in next, current do
+ if k ~= "p" and v ~= last[k] then
+ goto DIFFERENT
+ end
+ end
+ v[i] = current.p or 0
+ nofdeltas = nofdeltas + 1
+ goto CONTINUE
+ end
+ ::DIFFERENT::
+ last = current
+ ::CONTINUE::
+ end
+ end
+ elseif k == "columnarea" then
+ -- numeric
+ local n = #v
+ for i=1,n do
+ local t = v[i]
+ local hsh = y_w_h_d_hash[t.y or 0][t.w or 0][t.h or 0][t.d or 0]
+ t.y = nil
+ t.w = nil
+ t.h = nil
+ t.d = nil
+ t.i = hsh
+ end
+ nofpositions = nofpositions + n
+ nofpartials = nofpartials + n
+ else -- probably only b has shapes
+ for k, t in next, v do -- no need to sort
+ local s = t.s
+ if s then
+ checkshapes(s)
+ end
+ nofpositions = nofpositions + 1
+ end
+ end
+ end
+
+ statistics.register("positions", function()
+ if nofpositions > 0 then
+ return format("%s collected, %i deltas, %i shared partials, %i partial entries",
+ nofpositions, nofdeltas, nofpartials,
+ x_y_w_h_size + y_w_h_d_size + x_h_d_size + x_h_d_hs_size
+ )
+ else
+ return nil
+ end
+ end)
+
+ end
+
+ freedata = setmetatableindex(function(t,page)
+ local list = rawget(collected,"free")
+ local free = { }
+ if list then
+ local size = 0
+ for i=1,#list do
+ local l = list[i]
+ if l.p == page then
+ size = size + 1
+ free[size] = l
+ checkcommondata(l)
+ end
+ end
+ sort(free,function(a,b) return b.y < a.y end) -- order matters !
+ end
+ t[page] = free
+ return free
+ end)
+
+ job.register('job.positions.collected', tobesaved, initializer, finalizer)
+
+else
+
+ columndata = setmetatableindex("table") -- per page
+ freedata = setmetatableindex("table") -- per page
+
+ local function initializer()
+ tobesaved = jobpositions.tobesaved
+ collected = jobpositions.collected
+ --
+ local pagedata = { }
+ local p_splitter = lpeg.splitat(":",true)
+
+ for tag, data in next, collected do
+ local prefix, rest = lpegmatch(p_splitter,tag)
+ if prefix == "page" then
+ pagedata[tonumber(rest) or 0] = data
+ elseif prefix == "free" then
+ local t = freedata[data.p or 0]
+ t[#t+1] = data
+ elseif prefix == "columnarea" then
+ columndata[data.p or 0][data.c or 0] = data
+ end
+ setmetatable(data,default)
+ end
+ local pages = structures.pages.collected
+ if pages then
+ local last = nil
+ for p=1,#pages do
+ local region = "page:" .. p
+ local data = pagedata[p]
+ local free = freedata[p]
+ if free then
+ sort(free,function(a,b) return b.y < a.y end) -- order matters !
+ end
+ if data then
+ last = data
+ last.free = free
+ elseif last then
+ local t = setmetatableindex({ free = free, p = p },last)
+ if not collected[region] then
+ collected[region] = t
+ else
+ -- something is wrong
+ end
+ pagedata[p] = t
+ end
+ end
+ end
+ jobpositions.pagedata = pagedata -- never used
+
+ end
+
+ local function finalizer()
+
+ -- We make the (possible extensive) shape lists sparse working from the end. We
+ -- could also drop entries here that have l and r the same which saves testing
+ -- later on.
+
+ local nofpositions = 0
+
+ for k, v in next, tobesaved do
+ local s = v.s
+ if s then
+ checkshapes(s)
+ end
+ nofpositions = nofpositions + 1
end
+
+ statistics.register("positions", function()
+ if nofpositions > 0 then
+ return format("%s collected",nofpositions)
+ else
+ return nil
+ end
+ end)
+
end
+
+ local p_number = lpeg.patterns.cardinal/tonumber
+ local p_tag = P("syncpos:") * p_number * P(":") * p_number
+
+ syncdata = setmetatableindex(function(t,category)
+ setmetatable(t,nil)
+ for tag, pos in next, collected do
+ local c, n = lpegmatch(p_tag,tag)
+ if c then
+ local tc = t[c]
+ if tc then
+ tc[n] = pos
+ else
+ t[c] = { [n] = pos }
+ end
+ end
+ end
+ for k, list in next, t do
+ sort(list,function(a,b)
+ local ap = a.p
+ local bp = b.p
+ if ap == bp then
+ return b.y < a.y
+ else
+ return ap < bp
+ end
+ end)
+ list.start = 1
+ end
+ return t[category]
+ end)
+
+ job.register('job.positions.collected', tobesaved, initializer, finalizer)
+
end
-job.register('job.positions.collected', tobesaved, initializer, finalizer)
+function jobpositions.used()
+ if positionsused == nil then
+ positionsused = false
+ for k, v in next, collected do
+ if k ~= "shared" and type(v) == "table" and next(v) then
+ positionsused = true
+ break
+ end
+ end
+ end
+ return positionsused
+end
+
+function jobpositions.getfree(page)
+ return freedata[page]
+end
+
+function jobpositions.getsync(category)
+ return syncdata[category] or { }
+end
local regions = { }
local nofregions = 0
@@ -308,7 +908,7 @@ local function enhance(data)
data.y = y ~= 0 and y or nil
end
if data.p == true then
- data.p = texgetcount("realpageno") -- we should use a variable set in otr
+ data.p = texgetcount(c_realpageno) -- we should use a variable set in otr
end
if data.c == true then
data.c = column
@@ -477,25 +1077,28 @@ implement {
local function b_region(specification)
local tag = specification.tag or specification
local last = tobesaved[tag]
- local x, y = getpos()
- last.x = x ~= 0 and x or nil
- last.y = y ~= 0 and y or nil
- last.p = texgetcount("realpageno")
- insert(regions,tag) -- todo: fast stack
- region = tag
+ if last then
+ local x, y = getpos()
+ last.x = x ~= 0 and x or nil
+ last.y = y ~= 0 and y or nil
+ last.p = texgetcount(c_realpageno)
+ insert(regions,tag) -- todo: fast stack
+ region = tag
+ end
end
local function e_region(specification)
local last = tobesaved[region]
- local y = getvpos()
- local x, y = getpos()
- if specification.correct then
- local h = (last.y or 0) - y
- last.h = h ~= 0 and h or nil
- end
- last.y = y ~= 0 and y or nil
- remove(regions) -- todo: fast stack
- region = regions[#regions]
+ if last then
+ local y = getvpos()
+ if specification.correct then
+ local h = (last.y or 0) - y
+ last.h = h ~= 0 and h or nil
+ end
+ last.y = y ~= 0 and y or nil
+ remove(regions) -- todo: fast stack
+ region = regions[#regions]
+ end
end
jobpositions.b_region = b_region
@@ -503,15 +1106,24 @@ jobpositions.e_region = e_region
local lastregion
-local function setregionbox(n,tag,k,lo,ro,to,bo,column) -- kind
+local function setregionbox(n,tag,index,k,lo,ro,to,bo,column) -- kind
if not tag or tag == "" then
nofregions = nofregions + 1
- tag = f_region(nofregions)
+ tag = "region"
+ index = nofregions
+ elseif index ~= 0 then
+ -- So we can cheat and pass a zero index and enforce tag as is needed in
+ -- cases where we fallback on automated region tagging (framed).
+ tag = tag .. ":" .. index
end
local box = getbox(n)
local w, h, d = getwhd(box)
+ -- We could set directly but then we also need to check for gaps but as this
+ -- is direct is is unlikely that we get a gap. We then also need to intecept
+ -- these auto regions (comning from framed). Too messy and the split in the
+ -- setter is fast enough.
tobesaved[tag] = {
- -- p = texgetcount("realpageno"), -- we copy them
+ -- p = texgetcount(c_realpageno), -- we copy them
x = 0,
y = 0,
w = w ~= 0 and w or nil,
@@ -528,8 +1140,18 @@ local function setregionbox(n,tag,k,lo,ro,to,bo,column) -- kind
return tag, box
end
-local function markregionbox(n,tag,correct,...) -- correct needs checking
- local tag, box = setregionbox(n,tag,...)
+-- we can have a finalizer property that we catch in the backend but that demands
+-- a check for property for each list .. what is the impact
+
+-- textarea operates *inside* a box so experiments with pre/post hooks in the
+-- backend driver didn't work out (because a box can be larger)
+--
+-- it also gives no gain to split prefix and number here because in the end we
+-- push and pop tags as strings, but it save a little on expansion so we do it
+-- in the interface
+
+local function markregionbox(n,tag,index,correct,...) -- correct needs checking
+ local tag, box = setregionbox(n,tag,index,...)
-- todo: check if tostring is needed with formatter
local push = new_latelua { action = b_region, tag = tag }
local pop = new_latelua { action = e_region, correct = correct }
@@ -573,199 +1195,296 @@ function jobpositions.settobesaved(name,tag,data)
end
end
-local nofparagraphs = 0
+do
-implement {
- name = "parpos",
- actions = function()
- nofparagraphs = nofparagraphs + 1
- texsetcount("global","c_anch_positions_paragraph",nofparagraphs)
- local box = getbox("strutbox")
- local w, h, d = getwhd(box)
- local t = {
- p = true,
- c = true,
- r = true,
- x = true,
- y = true,
- h = h,
- d = d,
- hs = texget("hsize"), -- never 0
- }
- local leftskip = texget("leftskip",false)
- local rightskip = texget("rightskip",false)
- local hangindent = texget("hangindent")
- local hangafter = texget("hangafter")
- local parindent = texget("parindent")
- local parshape = texget("parshape")
- if leftskip ~= 0 then
- t.ls = leftskip
- end
- if rightskip ~= 0 then
- t.rs = rightskip
- end
- if hangindent ~= 0 then
- t.hi = hangindent
+ local c_anch_positions_paragraph = texiscount("c_anch_positions_paragraph")
+
+ local nofparagraphs = 0
+
+ local function enhancepar_1(data)
+ if data then
+ local par = data.par -- we can pass twice when we copy
+ local state = par and getparstate(data.par,true)
+ if state then
+ local x, y = getpos()
+ if x ~= 0 then
+ data.x = x
+ end
+ if y ~= 0 then
+ data.y = y
+ end
+ data.p = texgetcount(c_realpageno) -- we should use a variable set in otr
+ if column then
+ data.c = column
+ end
+ if region then
+ data.r = region
+ end
+ --
+ data.par = nil
+ local leftskip = state.leftskip
+ local rightskip = state.rightskip
+ local hangindent = state.hangindent
+ local hangafter = state.hangafter
+ local parindent = state.parindent
+ local parshape = state.parshape
+ if hangafter ~= 0 and hangafter ~= 1 then
+ data.ha = hangafter
+ end
+ if hangindent ~= 0 then
+ data.hi = hangindent
+ end
+ data.hs = state.hsize
+ if leftskip ~= 0 then
+ data.ls = leftskip
+ end
+ if parindent ~= 0 then
+ data.pi = parindent
+ end
+ if rightskip ~= 0 then
+ data.rs = rightskip
+ end
+ if parshape and #parshape > 0 then
+ data.ps = parshape
+ end
+ end
end
- if hangafter ~= 1 and hangafter ~= 0 then -- can not be zero .. so it needs to be 1 if zero
- t.ha = hangafter
+ return data
+ end
+
+ local function enhancepar_2(data)
+ if data then
+ local x, y = getpos()
+ if x ~= 0 then
+ data.x = x
+ end
+ if y ~= 0 then
+ data.y = y
+ end
+ data.p = texgetcount(c_realpageno)
+ if column then
+ data.c = column
+ end
+ if region then
+ data.r = region
+ end
end
- if parindent ~= 0 then
- t.pi = parindent
+ return data
+ end
+
+ implement {
+ name = "parpos",
+ actions = function()
+ nofparagraphs = nofparagraphs + 1
+ texsetcount("global",c_anch_positions_paragraph,nofparagraphs)
+ local name = f_p_tag(nofparagraphs)
+ local h = texgetdimen(d_strutht)
+ local d = texgetdimen(d_strutdp)
+ --
+ local top = texgetnest("top","head")
+ local nxt = top.next
+ if nxt then
+ nxt = tonut(nxt)
+ end
+ local data
+ if nxt and getid(nxt) == par_code then -- todo: check node type
+ local t = {
+ h = h,
+ d = d,
+ par = nxt,
+ }
+ tobesaved[name] = t
+ ctx_latelua { action = enhancepar_1, specification = t }
+ else
+ -- This is kind of weird but it happens in tables (rows) so we probably
+ -- need less.
+ local state = texgetparstate()
+ local leftskip = state.leftskip
+ local rightskip = state.rightskip
+ local hangindent = state.hangindent
+ local hangafter = state.hangafter
+ local parindent = state.parindent
+ local parshape = state.parshape
+ local t = {
+ p = true,
+ c = true,
+ r = true,
+ x = true,
+ y = true,
+ h = h,
+ d = d,
+ hs = state.hsize, -- never 0
+ }
+ if leftskip ~= 0 then
+ t.ls = leftskip
+ end
+ if rightskip ~= 0 then
+ t.rs = rightskip
+ end
+ if hangindent ~= 0 then
+ t.hi = hangindent
+ end
+ if hangafter ~= 1 and hangafter ~= 0 then -- can not be zero .. so it needs to be 1 if zero
+ t.ha = hangafter
+ end
+ if parindent ~= 0 then
+ t.pi = parindent
+ end
+ if parshape and #parshape > 0 then
+ t.ps = parshape
+ end
+ tobesaved[name] = t
+ ctx_latelua { action = enhancepar_2, specification = t }
+ end
end
- if parshape and #parshape > 0 then
- t.ps = parshape
+ }
+
+ implement {
+ name = "dosetposition",
+ arguments = "argument",
+ public = true,
+ protected = true,
+ actions = function(name)
+ local spec = {
+ p = true,
+ c = column,
+ r = true,
+ x = true,
+ y = true,
+ n = nofparagraphs > 0 and nofparagraphs or nil,
+ r2l = texgetinteger("inlinelefttoright") == 1 or nil,
+ }
+ tobesaved[name] = spec
+ ctx_latelua { action = enhance, specification = spec }
end
- local name = f_p_tag(nofparagraphs)
- tobesaved[name] = t
- ctx_latelua { action = enhance, specification = t }
- end
-}
+ }
-implement {
- name = "dosetposition",
- arguments = "argument",
- public = true,
- protected = true,
- actions = function(name)
- local spec = {
- p = true,
- c = column,
- r = true,
- x = true,
- y = true,
- n = nofparagraphs > 0 and nofparagraphs or nil,
- r2l = texgetinteger("inlinelefttoright") == 1 or nil,
- }
- tobesaved[name] = spec
- ctx_latelua { action = enhance, specification = spec }
- end
-}
+ implement {
+ name = "dosetpositionwhd",
+ arguments = { "argument", "dimenargument", "dimenargument", "dimenargument" },
+ public = true,
+ protected = true,
+ actions = function(name,w,h,d)
+ local spec = {
+ p = true,
+ c = column,
+ r = true,
+ x = true,
+ y = true,
+ w = w ~= 0 and w or nil,
+ h = h ~= 0 and h or nil,
+ d = d ~= 0 and d or nil,
+ n = nofparagraphs > 0 and nofparagraphs or nil,
+ r2l = texgetinteger("inlinelefttoright") == 1 or nil,
+ }
+ tobesaved[name] = spec
+ ctx_latelua { action = enhance, specification = spec }
+ end
+ }
-implement {
- name = "dosetpositionwhd",
- arguments = { "argument", "dimenargument", "dimenargument", "dimenargument" },
- public = true,
- protected = true,
- actions = function(name,w,h,d)
- local spec = {
- p = true,
- c = column,
- r = true,
- x = true,
- y = true,
- w = w ~= 0 and w or nil,
- h = h ~= 0 and h or nil,
- d = d ~= 0 and d or nil,
- n = nofparagraphs > 0 and nofparagraphs or nil,
- r2l = texgetinteger("inlinelefttoright") == 1 or nil,
- }
- tobesaved[name] = spec
- ctx_latelua { action = enhance, specification = spec }
- end
-}
+ implement {
+ name = "dosetpositionbox",
+ arguments = { "argument", "integerargument" },
+ public = true,
+ protected = true,
+ actions = function(name,n)
+ local box = getbox(n)
+ local w, h, d = getwhd(box)
+ local spec = {
+ p = true,
+ c = column,
+ r = true,
+ x = true,
+ y = true,
+ w = w ~= 0 and w or nil,
+ h = h ~= 0 and h or nil,
+ d = d ~= 0 and d or nil,
+ n = nofparagraphs > 0 and nofparagraphs or nil,
+ r2l = texgetinteger("inlinelefttoright") == 1 or nil,
+ }
+ tobesaved[name] = spec
+ ctx_latelua { action = enhance, specification = spec }
+ end
+ }
-implement {
- name = "dosetpositionbox",
- arguments = { "argument", "integerargument" },
- public = true,
- protected = true,
- actions = function(name,n)
- local box = getbox(n)
- local w, h, d = getwhd(box)
- local spec = {
- p = true,
- c = column,
- r = true,
- x = true,
- y = true,
- w = w ~= 0 and w or nil,
- h = h ~= 0 and h or nil,
- d = d ~= 0 and d or nil,
- n = nofparagraphs > 0 and nofparagraphs or nil,
- r2l = texgetinteger("inlinelefttoright") == 1 or nil,
- }
- tobesaved[name] = spec
- ctx_latelua { action = enhance, specification = spec }
- end
-}
+ implement {
+ name = "dosetpositionplus",
+ arguments = { "argument", "dimenargument", "dimenargument", "dimenargument" },
+ public = true,
+ protected = true,
+ actions = function(name,w,h,d)
+ local spec = {
+ p = true,
+ c = column,
+ r = true,
+ x = true,
+ y = true,
+ w = w ~= 0 and w or nil,
+ h = h ~= 0 and h or nil,
+ d = d ~= 0 and d or nil,
+ n = nofparagraphs > 0 and nofparagraphs or nil,
+ e = scanstring(),
+ r2l = texgetinteger("inlinelefttoright") == 1 or nil,
+ }
+ tobesaved[name] = spec
+ ctx_latelua { action = enhance, specification = spec }
+ end
+ }
-implement {
- name = "dosetpositionplus",
- arguments = { "argument", "dimenargument", "dimenargument", "dimenargument" },
- public = true,
- protected = true,
- actions = function(name,w,h,d)
- local spec = {
- p = true,
- c = column,
- r = true,
- x = true,
- y = true,
- w = w ~= 0 and w or nil,
- h = h ~= 0 and h or nil,
- d = d ~= 0 and d or nil,
- n = nofparagraphs > 0 and nofparagraphs or nil,
- e = scanstring(),
- r2l = texgetinteger("inlinelefttoright") == 1 or nil,
- }
- tobesaved[name] = spec
- ctx_latelua { action = enhance, specification = spec }
- end
-}
+ implement {
+ name = "dosetpositionstrut",
+ arguments = "argument",
+ public = true,
+ protected = true,
+ actions = function(name)
+ local h = texgetdimen(d_strutht)
+ local d = texgetdimen(d_strutdp)
+ local spec = {
+ p = true,
+ c = column,
+ r = true,
+ x = true,
+ y = true,
+ h = h ~= 0 and h or nil,
+ d = d ~= 0 and d or nil,
+ n = nofparagraphs > 0 and nofparagraphs or nil,
+ r2l = texgetinteger("inlinelefttoright") == 1 or nil,
+ }
+ tobesaved[name] = spec
+ ctx_latelua { action = enhance, specification = spec }
+ end
+ }
-implement {
- name = "dosetpositionstrut",
- arguments = "argument",
- public = true,
- protected = true,
- actions = function(name)
- local box = getbox("strutbox")
- local w, h, d = getwhd(box)
- local spec = {
- p = true,
- c = column,
- r = true,
- x = true,
- y = true,
- h = h ~= 0 and h or nil,
- d = d ~= 0 and d or nil,
- n = nofparagraphs > 0 and nofparagraphs or nil,
- r2l = texgetinteger("inlinelefttoright") == 1 or nil,
- }
- tobesaved[name] = spec
- ctx_latelua { action = enhance, specification = spec }
- end
-}
+ implement {
+ name = "dosetpositionstrutkind",
+ arguments = { "argument", "integerargument" },
+ public = true,
+ protected = true,
+ actions = function(name,kind)
+ local h = texgetdimen(d_strutht)
+ local d = texgetdimen(d_strutdp)
+ local spec = {
+ k = kind,
+ p = true,
+ c = column,
+ r = true,
+ x = true,
+ y = true,
+ h = h ~= 0 and h or nil,
+ d = d ~= 0 and d or nil,
+ n = nofparagraphs > 0 and nofparagraphs or nil,
+ r2l = texgetinteger("inlinelefttoright") == 1 or nil,
+ }
+ tobesaved[name] = spec
+ ctx_latelua { action = enhance, specification = spec }
+ end
+ }
-implement {
- name = "dosetpositionstrutkind",
- arguments = { "argument", "integerargument" },
- public = true,
- protected = true,
- actions = function(name,kind)
- local box = getbox("strutbox")
- local w, h, d = getwhd(box)
- local spec = {
- k = kind,
- p = true,
- c = column,
- r = true,
- x = true,
- y = true,
- h = h ~= 0 and h or nil,
- d = d ~= 0 and d or nil,
- n = nofparagraphs > 0 and nofparagraphs or nil,
- r2l = texgetinteger("inlinelefttoright") == 1 or nil,
- }
- tobesaved[name] = spec
- ctx_latelua { action = enhance, specification = spec }
- end
-}
+end
function jobpositions.getreserved(tag,n)
if tag == v_column then
- local fulltag = f_tag_three(tag,texgetcount("realpageno"),n or 1)
+ local fulltag = f_tag_three(tag,texgetcount(c_realpageno),n or 1)
local data = collected[fulltag]
if data then
return data, fulltag
@@ -773,7 +1492,7 @@ function jobpositions.getreserved(tag,n)
tag = v_text
end
if tag == v_text then
- local fulltag = f_tag_two(tag,texgetcount("realpageno"))
+ local fulltag = f_tag_two(tag,texgetcount(c_realpageno))
return collected[fulltag] or false, fulltag
end
return collected[tag] or false, tag
@@ -784,7 +1503,12 @@ function jobpositions.copy(target,source)
end
function jobpositions.replace(id,p,x,y,w,h,d)
- collected[id] = { p = p, x = x, y = y, w = w, h = h, d = d } -- c g
+ local c = collected[id]
+ if c then
+ c.p = p ; c.x = x ; c.y = y ; c.w = w ; c.h = h ; c.d = d ; -- c g
+ else
+ collected[i] = { p = p, x = x, y = y, w = w, h = h, d = d } -- c g
+ end
end
local function getpage(id)
@@ -1003,7 +1727,7 @@ local function overlapping(one,two,overlappingmargin) -- hm, strings so this is
end
local function onsamepage(list,page)
- for id in gmatch(list,"(, )") do
+ for id in gmatch(list,"([^,%s]+)") do
local jpi = collected[id]
if jpi then
local p = jpi.p
@@ -1034,9 +1758,17 @@ local function columnofpos(realpage,xposition)
return 1
end
-jobpositions.overlapping = overlapping
-jobpositions.onsamepage = onsamepage
-jobpositions.columnofpos = columnofpos
+local function getcolumndata(realpage,column)
+ local p = columndata[realpage]
+ if p then
+ return p[column]
+ end
+end
+
+jobpositions.overlapping = overlapping
+jobpositions.onsamepage = onsamepage
+jobpositions.columnofpos = columnofpos
+jobpositions.getcolumndata = getcolumndata
-- interface
@@ -1046,14 +1778,12 @@ implement {
public = true,
protected = true,
actions = function(name,page,x,y,w,h,d)
- collected[name] = {
- p = page,
- x = x,
- y = y,
- w = w,
- h = h,
- d = d,
- }
+ local c = collected[name]
+ if c then
+ c.p = page ; c.x = x ; c.y = y ; c.w = w ; c.h = h ; c.d = d ;
+ else
+ collected[name] = { p = page, x = x, y = y, w = w, h = h, d = d }
+ end
end
}
@@ -1380,18 +2110,18 @@ implement {
actions = MPpardata
}
-implement {
- name = "MPposset",
- arguments = "argument",
- public = true,
- actions = function(name)
- local b = f_b_tag(name)
- local e = f_e_tag(name)
- local w = f_w_tag(name)
- local p = f_p_tag(getparagraph(b))
- MPpos(b) context(",") MPpos(e) context(",") MPpos(w) context(",") MPpos(p) context(",") MPpardata(p)
- end
-}
+-- implement {
+-- name = "MPposset",
+-- arguments = "argument",
+-- public = true,
+-- actions = function(name)
+-- local b = f_b_tag(name)
+-- local e = f_e_tag(name)
+-- local w = f_w_tag(name)
+-- local p = f_p_tag(getparagraph(b))
+-- MPpos(b) context(",") MPpos(e) context(",") MPpos(w) context(",") MPpos(p) context(",") MPpardata(p)
+-- end
+-- }
implement {
name = "MPls",
@@ -1447,7 +2177,7 @@ implement {
implement {
name = "MPrest",
- arguments = { "argument", "argument" },
+ arguments = "2 arguments",
public = true,
actions = function(name,default)
local jpi = collected[name]
@@ -1511,7 +2241,7 @@ implement {
implement {
name = "doifelseoverlapping",
- arguments = { "argument", "argument" },
+ arguments = "2 arguments",
public = true,
protected = true,
actions = function(one,two)
@@ -1535,7 +2265,7 @@ implement {
public = true,
protected = true,
actions = function(list)
- doifelse(onsamepage(list,tostring(texgetcount("realpageno"))))
+ doifelse(onsamepage(list,tostring(texgetcount(c_realpageno))))
end
}
@@ -1544,53 +2274,53 @@ implement {
public = true,
protected = true,
actions = function()
- doifelse(next(collected))
+ doifelse(jobpositions.used())
end
}
implement {
name = "markregionbox",
- arguments = "integer",
+ arguments = { "integer", "integer" },
actions = markregionbox
}
implement {
name = "setregionbox",
- arguments = "integer",
+ arguments = { "integer", "integer" },
actions = setregionbox
}
implement {
name = "markregionboxtagged",
- arguments = { "integer", "string" },
+ arguments = { "integer", "string", "integer" },
actions = markregionbox
}
implement {
name = "markregionboxtaggedn",
- arguments = { "integer", "string", "integer" },
- actions = function(box,tag,n)
- markregionbox(box,tag,nil,nil,nil,nil,nil,nil,n)
+ arguments = { "integer", "string", "integer", "integer" },
+ actions = function(box,tag,index,n)
+ markregionbox(box,tag,index,nil,nil,nil,nil,nil,nil,n)
end
}
implement {
name = "setregionboxtagged",
- arguments = { "integer", "string" },
+ arguments = { "integer", "string", "integer" },
actions = setregionbox
}
implement {
name = "markregionboxcorrected",
- arguments = { "integer", "string", true },
+ arguments = { "integer", "string", "integer", true },
actions = markregionbox
}
implement {
name = "markregionboxtaggedkind",
- arguments = { "integer", "string", "integer", "dimen", "dimen", "dimen", "dimen" },
- actions = function(box,tag,n,d1,d2,d3,d4)
- markregionbox(box,tag,nil,n,d1,d2,d3,d4)
+ arguments = { "integer", "string", "integer", "integer", "dimen", "dimen", "dimen", "dimen" },
+ actions = function(box,tag,index,n,d1,d2,d3,d4)
+ markregionbox(box,tag,index,nil,n,d1,d2,d3,d4)
end
}
@@ -1603,27 +2333,6 @@ implement {
end
}
--- statistics (at least for the moment, when testing)
-
--- statistics.register("positions", function()
--- local total = nofregular + nofusedregions + nofmissingregions
--- if total > 0 then
--- return format("%s collected, %s regulars, %s regions, %s unresolved regions",
--- total, nofregular, nofusedregions, nofmissingregions)
--- else
--- return nil
--- end
--- end)
-
-statistics.register("positions", function()
- local total = nofregular + nofspecial
- if total > 0 then
- return format("%s collected, %s regular, %s special",total,nofregular,nofspecial)
- else
- return nil
- end
-end)
-
-- We support the low level positional commands too:
local newsavepos = nodes.pool.savepos
diff --git a/Master/texmf-dist/tex/context/base/mkxl/anch-pos.mkxl b/Master/texmf-dist/tex/context/base/mkxl/anch-pos.mkxl
index d217f2cac3f..a1e0cc35434 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/anch-pos.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/anch-pos.mkxl
@@ -17,10 +17,18 @@
%D early, but starting in 2012 more dramatic changes started to happen, especially
%D in relation to background graphics. It will probably take some time to settle.
-\registerctxluafile{anch-pos}{autosuffix}
-
\unprotect
+\newinteger\c_anch_column % will be delegated to lua
+\newinteger\c_anch_text % will be delegated to lua
+\newinteger\c_anch_free
+\newtoks \t_anch_positions_tracers
+\newinteger\c_anch_positions_paragraph
+\newbox \b_anch_position
+\newif \ifpositioning % sort of public
+
+\registerctxluafile{anch-pos}{autosuffix}
+
%D The first application of positional information was embedded graphics. Since we
%D are interacting with text, it made sense to take the current line height and
%D depth into account too. This is why we have position macros for simple positions
@@ -43,13 +51,13 @@
% \dosetpositionstrut #1 % defined at lua end
% \dosetpositionstrutkind #1#2 % defined at lua end
-\newbox\b_anch_position
-\newif \ifpositioning % sort of public
+% see top: \newbox\b_anch_position
+% see top: \newif \ifpositioning % sort of public
-\mutable\let\currentposition \empty
-\mutable\let\currentpositionaction\empty
-\mutable\let\currentpositionanchor\empty
-\mutable\let\currentpositionregion\empty
+\mutable\lettonothing\currentposition
+\mutable\lettonothing\currentpositionaction
+\mutable\lettonothing\currentpositionanchor
+\mutable\lettonothing\currentpositionregion
%D Sometimes we want to trick the position handler a bit:
@@ -164,7 +172,7 @@
{\anch_positions_initialize
\hbox % \hpack
{\edef\currentposition{#1}%
- \dosetpositionwhd\currentposition{#2}{#3}{#4}% already \the\dimexpr
+ \dosetpositionwhd\currentposition{#2}{#3}{#4}%
\anch_positions_trace_left
\dopositionaction\currentposition
\hss}}
@@ -184,7 +192,8 @@
\def\anch_positions_set_box_finish#1%
{\anch_positions_initialize
- \hbox to \wd\nextbox % \hpack
+ %\hbox to \wd\nextbox
+ \hpack to \wd\nextbox
{\edef\currentposition{#1}%
\dosetpositionbox\currentposition\nextbox
\anch_positions_trace_left
@@ -244,7 +253,7 @@
{\anch_positions_initialize
\hbox % \hpack
{\edef\currentposition{#1}%
- \dosetpositionplus\currentposition{#2}{#3}{#4}{#5}% already \the\dimexpr
+ \dosetpositionplus\currentposition{#2}{#3}{#4}{#5}%
\anch_positions_trace_right
\dopositionaction\currentposition
\hss}}
@@ -281,16 +290,22 @@
\permanent\def\textanchor {text:\the\realpageno}
\permanent\def\regionanchor{region:0}
-\newcount\c_anch_column % will be delegated to lua
-\newcount\c_anch_text % will be delegated to lua
+% see top: \newinteger\c_anch_column % will be delegated to lua
+% see top: \newinteger\c_anch_text % will be delegated to lua
% beware we need to pass \somethingexpanded or { }
+% Is this really always needed? We use \enabletextarearegistration for page areas so why
+% not also for this.
+%
+% At some point we can switch to dedicated markers because there are not
+% that many variants: text, page, textarea, columnarea, free.
+
\protected\def\anch_mark_column_box#1#2% box n
- {\global\advance\c_anch_column\plusone
- \clf_markregionboxtaggedn#1{columnarea:\the\c_anch_column}#2\relax} % extra height
+ {\global\advanceby\c_anch_column\plusone
+ \clf_markregionboxtaggedn#1{columnarea}\c_anch_column#2\relax} % extra height
-\protected\def\anch_mark_region_box
+\protected\def\anch_mark_region_box % auto region:index
{\iftrialtypesetting
\expandafter\gobbleoneargument
\orelse\ifpositioning
@@ -304,39 +319,46 @@
\protected\def\anch_mark_flow_box#1% will be extended / renamed
{\hpack\bgroup
- \global\advance\c_anch_text\plusone
- \clf_markregionboxtagged#1{textarea:\the\c_anch_text}%
+ \global\advanceby\c_anch_text\plusone
+ \clf_markregionboxtagged#1{textarea}\c_anch_text % will become flow:
\box#1%
\egroup}
-\protected\def\anch_mark_tagged_box#1#2%
- {\clf_markregionboxtagged#1{#2}}
+\protected\def\anch_mark_tagged_box#1#2#3%
+ {\clf_markregionboxtagged#1{#2}#3\relax}
\protected\def\anch_mark_flow_only#1% will be extended / renamed
- {\global\advance\c_anch_text\plusone
- \clf_markregionboxcorrected#1{textarea:\the\c_anch_text}}
+ {\global\advanceby\c_anch_text\plusone
+ \clf_markregionboxcorrected#1{textarea}\c_anch_text}% will become flow:
\protected\def\anch_make_page_box#1% maybe like text
- {\clf_setregionboxtagged#1{page:\the\realpageno}}
+ {\clf_setregionboxtagged#1{page}\realpageno}
\protected\def\anch_mark_text_box#1%
- {\clf_markregionboxtagged#1{text:\the\realpageno}} % needs an hbox
+ {\clf_markregionboxtagged#1{text}\realpageno} % needs an hbox
-\newcount\c_anch_free
-
-\protected\def\anch_mark_tagged_box_free#1#2#3#4#5#6% only needed when positions
+\protected\def\anch_mark_tagged_box_free
{\ifpositioning
- \global\advance\c_anch_free\plusone % could be done at the lua end
- \clf_markregionboxtaggedkind
- #1%
- {free:\number\c_anch_free}%
- #2\space % kind
- #3\space % leftoffset
- #4\space % rightoffset
- #5\space % topoffset
- #6\relax % bottomoffset
+ \expandafter\anch_mark_tagged_box_free_yes
+ \else
+ \expandafter\gobblesixarguments
\fi}
+% see top: \newinteger\c_anch_free
+
+\protected\def\anch_mark_tagged_box_free_yes#1#2#3#4#5#6% only needed when positions
+ {\global\advanceby\c_anch_free\plusone % could be done at the lua end
+ \clf_markregionboxtaggedkind
+ #1%
+ {free}%
+ \c_anch_free
+ #2% kind % single token value
+ #3% leftoffset % single token value
+ #4% rightoffset % single token value
+ #5% topoffset % single token value
+ #6% bottomoffset % single token value
+ \relax}
+
% \reservedautoregiontag % define at lua end
%D We can copy a position with:
@@ -394,8 +416,8 @@
%D can keep track of them. This mechanism is activated automatically based on
%D information collected in the previous pass.
-\newtoks \t_anch_positions_tracers
-\newcount\c_anch_positions_paragraph
+% see top: \newtoks \t_anch_positions_tracers
+% see top: \newinteger\c_anch_positions_paragraph
\permanent\protected\def\tracepositions
{\the\t_anch_positions_tracers}
@@ -404,9 +426,8 @@
{\enforced\aliased\glet\registerparoptions\doregisterparoptions
\global\positioningtrue}
-\permanent\let\disableparpositions\relax
-
-\aliased\let\registerparoptions\relax
+\permanent\protected\lettonothing\disableparpositions
+\permanent\protected\lettonothing\registerparoptions % hooks into everypar
\permanent\protected\def\doregisterparoptions
{\iftrialtypesetting \orelse\ifinpagebody \orelse\ifmmode \orelse\ifinformula \else
@@ -418,16 +439,22 @@
\def\anch_positions_register_par_options_traced
{\anch_positions_register_par_options_normal
- \smashedhbox to \zeropoint
+ \begingroup
+ \setbox\scratchbox\hpack
{\hss
\startcolor[blue]%
- \llap{\infofont\number\c_anch_positions_paragraph}%
+ \hpack \s!yoffset -2\onepoint to \zeropoint
+ {\hss\infofont\number\c_anch_positions_paragraph\hskip2\onepoint}%
\vrule
\s!width 4\onepoint
\s!height2\onepoint
\s!depth 2\onepoint
\stopcolor
- \hss}}
+ \hss}%
+ \smashbox\scratchbox
+ \boxxoffset\scratchbox-2\onepoint
+ \box\scratchbox
+ \endgroup}
\let\anch_positions_register_par_options\anch_positions_register_par_options_normal
@@ -481,10 +508,10 @@
%D positions being on the same page.
%D
%D \starttyping
-%D \doifpositionsonsamepageelse{point a}{point b}
+%D \doifpositionsonsamepageelse{point a,point b}
%D {action when on same page}
%D {action when not on same page}
-%D \doifpositionsonthispageelse{point a}{point b}
+%D \doifpositionsonthispageelse{point a,point b}
%D {action when on this page}
%D {action when not on this page}
%D \stoptyping
diff --git a/Master/texmf-dist/tex/context/base/mkxl/anch-snc.lmt b/Master/texmf-dist/tex/context/base/mkxl/anch-snc.lmt
new file mode 100644
index 00000000000..c97be2b391d
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/anch-snc.lmt
@@ -0,0 +1,217 @@
+if not modules then modules = { } end modules ['anch-snc'] = {
+ version = 1.001,
+ comment = "companion to anch-snc.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local tonumber, next, setmetatable, rawget = tonumber, next, setmetatable, rawget
+local concat, sort, remove, copy = table.concat, table.sort, table.remove, table.copy
+local match, find = string.match, string.find
+local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns
+local setmetatableindex = table.setmetatableindex
+local P, Cc = lpeg.P, lpeg.Cc
+
+graphics = graphics or { }
+local synchronizers = { }
+graphics.synchronizers = synchronizers
+
+local jobpositions = job.positions
+
+local p_number = lpegpatterns.cardinal/tonumber
+local p_space = lpegpatterns.whitespace^0
+local p_option = p_number * ((P(",") * p_space * P("reset") * Cc(true)) + Cc(false)) -- for now
+
+local list = { }
+local kinds = {
+ above = 1,
+ continue = 2,
+ nothing = 3,
+ normal = 4,
+ below = 5,
+}
+
+local lastdone = { }
+
+function synchronizers.collect(category,realpage,region)
+ local all = jobpositions.getsync(category)
+ local m = 0
+ local n = #all
+ list = { }
+ if region and region ~= "" then
+ -- successive can be optimized when we sort by region
+ local start = 1
+ local done = false
+ local last, rtop, rbot
+ for i=start,n do
+ local pos = all[i]
+ local p = pos.p
+ local r = pos.r
+ if r == region then
+ if not done then
+ local region = jobpositions.collected[r]
+ list.region = region
+ list.page = region
+ rtop = (region.y or 0) + (region.h or 0)
+ rbot = (region.y or 0) - (region.d or 0)
+ last = { kind = "nothing", top = rtop, bottom = 0, task = 0 }
+ m = m + 1 ; list[m] = last
+ done = true
+ end
+ local top = pos.y + pos.h
+ last.bottom = top
+ local task, reset = lpegmatch(p_option,pos.e)
+ last = { kind = "normal", top = top, bottom = 0, task = task }
+ m = m + 1 ; list[m] = last
+ end
+ end
+ if done then
+ last.bottom = rbot
+ end
+ else
+ local start = all.start or 1
+ local done = false
+ local last, rtop, rbot, ptop, pbot
+ for i=start,n do
+ local pos = all[i]
+ local p = pos.p
+ if p == realpage then
+ if not done then
+ local region = jobpositions.collected[pos.r]
+ local page = jobpositions.collected["page:"..realpage] or region
+ list.region = region
+ list.page = page
+ rtop = (region.y or 0) + (region.h or 0)
+ rbot = (region.y or 0) - (region.d or 0)
+ ptop = (page .y or 0) + (page .h or 0)
+ pbot = (page .y or 0) - (page .d or 0)
+ last = { kind = "above", top = ptop, bottom = rtop, task = 0 }
+ m = m + 1 ; list[m] = last
+ if i > 1 then
+ local task, reset = lpegmatch(p_option,all[i-1].e)
+ last = { kind = "continue", top = rtop, bottom = 0, task = task }
+ m = m + 1 ; list[m] = last
+ else
+ last = { kind = "nothing", top = rtop, bottom = 0, task = 0 }
+ m = m + 1 ; list[m] = last
+ end
+ done = true
+ end
+ local top = pos.y + pos.h
+ last.bottom = top
+ local task, reset = lpegmatch(p_option,pos.e)
+ if reset then
+ local l = list[2]
+ l.kind = "nothing"
+ l.task = 0
+ end
+ last = { kind = "normal", top = top, bottom = 0, task = task }
+ m = m + 1 ; list[m] = last
+ elseif p > realpage then
+ all.start = i -- tricky, only for page
+ break
+ end
+ end
+ if done then
+ last.bottom = rbot
+ last = { kind = "below", top = rbot, bottom = pbot, task = 0 }
+ m = m + 1 ; list[m] = last
+ lastdone[category] = {
+ { kind = "above", top = ptop, bottom = rtop, task = 0 },
+ { kind = "continue", top = rtop, bottom = rbot, task = list[#list-1].task }, -- lasttask
+ { kind = "below", top = rbot, bottom = pbot, task = 0 },
+ region = list.region,
+ page = list.page,
+ }
+ else
+ local l = lastdone[category]
+ if l then
+ list = copy(l) -- inefficient, maybe metatable for region/page
+ m = 3
+ end
+ end
+ end
+ return m
+end
+
+function synchronizers.extend()
+ local n = #list
+ if n > 0 then
+ for i=1,n do
+ local l = list[i]
+ local k = l.kind
+ if k == "nothing" then
+ local ll = list[i+1]
+ if ll and ll.kind == "normal" then
+ ll.top = l.top
+ remove(list,i)
+ n = #list
+ break
+ end
+ end
+ end
+ end
+ return n
+end
+
+function synchronizers.prune()
+ local n = #list
+ if n > 0 then
+ if list[1].kind == "above" then
+ remove(list,1)
+ end
+ if list[1].kind == "nothing" then
+ remove(list,1)
+ end
+ if list[#list].kind == "below" then
+ remove(list,#list)
+ end
+ n = #list
+ end
+ return n
+end
+
+function synchronizers.collapse()
+ local n = #list
+ if n > 0 then
+ local m = 0
+ local p = nil
+ for i=1,n do
+ local l = list[i]
+ local t = l.task
+ if p == t then
+ list[m].bottom = l.bottom
+ else
+ m = m + 1
+ list[m] = l
+ end
+ p = t
+ end
+ for i=n,m+1,-1 do
+ list[i] = nil
+ end
+ n = m
+ end
+ return n
+end
+
+-- These operate on the currently set list:
+
+function synchronizers.getsize () return #list end
+function synchronizers.gettop (n) return list[n].top end
+function synchronizers.getbottom(n) return list[n].bottom end
+function synchronizers.getkind (n) return kinds[list[n].kind] end
+function synchronizers.gettask (n) return list[n].task end
+
+function synchronizers.getx() return list.page.x or 0 end
+function synchronizers.gety() return list.page.y or 0 end
+function synchronizers.getw() return list.page.w or 0 end
+function synchronizers.geth() return list.page.h or 0 end
+function synchronizers.getd() return list.page.d or 0 end
+
+-- function mp.xxOverlayRegion()
+-- local r = tokens.getters.macro("m_overlay_region")
+-- mp.quoted('"'.. r .. '"')
+-- end
+
diff --git a/Master/texmf-dist/tex/context/base/mkxl/anch-snc.mkxl b/Master/texmf-dist/tex/context/base/mkxl/anch-snc.mkxl
index e186e024f96..a2df714b729 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/anch-snc.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/anch-snc.mkxl
@@ -11,33 +11,139 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-%D The original is in the mkii file. It does more at the \TEX\ end and
-%D has some more magic. If we really need that I'll add it. After all,
-%D in mkiv we can do things different.
-
-%D TODO: bleed : + left , minus right oro check if it touches page ... autobleed
+%D This is a rather old mechanism that we once needed in an actually nice design.
+%D Those were the times that processing a rather complex xml file with \PDFTEX\ into
+%D a 400 page document took 45 minutes (a few runs) while nowadays with luatex and
+%D \MKIV\ (and \LMTX) we express runtime in seconds.
+%D
+%D In retrospect it was a waste of time (and money) to invest in all these
+%D mechanisms because the publishers we were dealign with were far from ready for
+%D dealing with xml and let alone automatic rendering. But, as the code still worked
+%D well after nearly two decades I decided to revive it .. maybe some curious
+%D \CONTEXT\ user can benefit from it after all.
+%D
+%D The logic is mostly the same as in \MKII\ but some work is now delegated to \LUA\
+%D so that we save memory and gain some runtime. As this was not really a used
+%D module the interface also was upgraded. As we know the bottlenecks in \METAPOST\
+%D we also work around those a bit. It made sense too change the interface to use
+%D the new \LMTX\ mechanisms for passing parameters. The old interface can be found
+%D in the \MKII\ and \MKIV\ files.
+
+%D TODO: bleed | autobleed
\writestatus{loading}{ConTeXt Anchoring Macros / Synchronization}
\registerctxluafile{anch-snc}{}
+\registerctxluafile{mlib-snc}{}
+
+%D \stoptyping
+%D \starttext
+%D
+%D \setuplayout[location=middle]
+%D \setupbodyfont[dejavu]
+%D
+%D \definesyncpositions[1]
+%D \definesyncpositions[2]
+%D
+%D % \startuseMPgraphic{sync1}
+%D % StartPage ;
+%D % lmt_synchronizer [ ... ] ;
+%D % clip currentpicture to Page ;
+%D % setbounds currentpicture to Page ;
+%D % StopPage ;
+%D % \stopuseMPgraphic
+%D
+%D \startuseMPgraphic{sync1}
+%D lmt_synchronizer [
+%D % page = "yes",
+%D index = 1,
+%D hoffset = 0,
+%D width = BackSpace - LeftMarginDistance,
+%D extend = false,
+%D prune = true,
+%D draw = false,
+%D fill = true,
+%D ] ;
+%D \stopuseMPgraphic
+%D
+%D \startuseMPgraphic{sync2}
+%D lmt_synchronizer [
+%D index = 2,
+%D region = OverlayRegion,
+%D hoffset = -1cm,
+%D width = 1cm,
+%D extend = true,
+%D prune = false,
+%D draw = false,
+%D fill = true,
+%D ] ;
+%D clip currentpicture to OverlayBox leftenlarged 1cm;
+%D setbounds currentpicture to OverlayBox ;
+%D \stopuseMPgraphic
+%D
+%D \defineoverlay[tempoverlay1][\useMPgraphic{sync1}]
+%D \defineoverlay[tempoverlay2][\useMPgraphic{sync2}]
+%D
+%D \setupbackgrounds[page][background=tempoverlay1]
+%D
+%D \framed[region=yes,background=tempoverlay2,width=14cm,align=normal]{%
+%D \syncposition[2][1]\samplefile{ward}\endgraf
+%D \syncposition[2][2]\samplefile{ward}\endgraf
+%D \syncposition[2][3]\samplefile{ward}\endgraf
+%D }
+%D
+%D \vskip1cm \hskip1cm \framed[region=yes,background=tempoverlay2,width=16cm,align=normal]{%
+%D \syncposition[2][1]\samplefile{ward}\endgraf
+%D \syncposition[2][2]\samplefile{ward}\endgraf
+%D \syncposition[2][3]\samplefile{ward}\endgraf
+%D }
+%D
+%D \vskip1cm \hskip1cm \framed[region=yes,background=tempoverlay2,width=10cm,align=normal]{%
+%D \syncposition[2][1]\samplefile{ward}\endgraf
+%D \syncposition[2][2]\samplefile{ward}\endgraf
+%D \syncposition[2][3]\samplefile{ward}\endgraf
+%D }
+%D
+%D \dorecurse {100} {
+%D \startchapter[title={Test #1}]
+%D \syncposition[1][1,reset]\dorecurse{20}{\samplefile{ward}\endgraf}
+%D \syncposition[1][2]\dorecurse {4}{\samplefile{ward}\endgraf}
+%D \syncposition[1][3]\dorecurse {7}{\samplefile{ward}\endgraf}
+%D \syncposition[1][4]\dorecurse {3}{\samplefile{ward}\endgraf}
+%D \stopchapter
+%D }
+%D
+%D \dorecurse {100} {
+%D \startchapter[title={Test #1}]
+%D \syncposition[1][1]\dorecurse{1}{\samplefile{ward}\endgraf}
+%D \syncposition[1][2]\dorecurse{1}{\samplefile{ward}\endgraf}
+%D \syncposition[1][3]\dorecurse{1}{\samplefile{ward}\endgraf}
+%D \syncposition[1][4]\dorecurse{1}{\samplefile{ward}\endgraf}
+%D \stopchapter
+%D }
+%D
+%D \stoptext
+%D \stoptyping
+
+%D We could actually use par positions but in \LMTX\ we have syncpos entries
+%D somewhat optimized.
\unprotect
-\ifdefined\??syncposcounter \else \installcorenamespace{syncposcounter} \fi
-\ifdefined\s!syncpos \else \def\s!syncpos {syncpos} \fi
+\installcorenamespace{syncposcounter}
\let\c_sync_n\relax
\permanent\protected\def\definesyncpositions[#1]%
{\ifcsname\??syncposcounter:#1\endcsname \else
- \expandafter\newcount\csname\??syncposcounter:#1\endcsname
+ \expandafter\newinteger\csname\??syncposcounter:#1\endcsname
\fi}
-\permanent\tolerant\protected\def\syncposition[#1]#*[#2]% we could actually use par positions
+\permanent\tolerant\protected\def\syncposition[#1]#*[#2]%
{\dontleavehmode
\ifcsname\??syncposcounter:#1\endcsname
\let\c_sync_n\lastnamedcs
- \global\advance\c_sync_n\plusone
+ \global\advanceby\c_sync_n\plusone
\enabletextarearegistration
\setpositionplus{\s!syncpos:#1:\the\c_sync_n}{#2}\hpack{\strut}%
\else
@@ -46,112 +152,3 @@
\ignorespaces}
\protect
-
-\continueifinputfile{anch-snc.mkiv}
-
-\starttext
-
-% \setuppapersize[A4][A3]
-
-\setuplayout[location=middle]
-
-\setupbodyfont[dejavu]
-
-\definesyncpositions[1]
-\definesyncpositions[2]
-
-% \enabletrackers[metapost.lua]
-
-\startMPdefinitions
- input "mp-asnc.mpiv" ;
-
- SetSyncColor(1,0,"magenta") ;
- SetSyncColor(1,1,"red") ;
- SetSyncColor(1,2,"green") ;
- SetSyncColor(1,3,"blue") ;
- SetSyncColor(1,4,"yellow") ;
-
- SetSyncColor(2,0,"magenta") ;
- SetSyncColor(2,1,"red") ;
- SetSyncColor(2,2,"green") ;
- SetSyncColor(2,3,"blue") ;
- SetSyncColor(2,4,"yellow") ;
-\stopMPdefinitions
-
-\startuseMPgraphic{sync1}
- StartPage ;
- StartSync(1) ;
- SyncHOffset := 0 ;
- SyncWidth := BackSpace - LeftMarginDistance;
- CollectSyncDataPage ;
- % ExtendSyncPaths ; % to top of text area
- PruneSyncPaths ; % clip top / bottom
- CollapseSyncPaths ;
- MakeSyncPaths ;
- % DrawSyncPaths ;
- FillSyncPaths ;
- StopSync ;
- clip currentpicture to Page ;
- setbounds currentpicture to Page ;
- StopPage ;
-\stopuseMPgraphic
-
-\startuseMPgraphic{sync2}
- StartSync(2) ;
- SyncHOffset := -1cm ;
- SyncWidth := 1cm ;
- CollectSyncDataRegion(OverlayRegion) ;
- ExtendSyncPaths ; % to top of text area
- MakeSyncPaths ;
- FillSyncPaths ;
- StopSync ;
- clip currentpicture to OverlayBox leftenlarged 1cm;
- setbounds currentpicture to OverlayBox ;
-\stopuseMPgraphic
-
-\defineoverlay[tempoverlay1][\useMPgraphic{sync1}]
-\defineoverlay[tempoverlay2][\useMPgraphic{sync2}]
-
-\setupbackgrounds[page][background=tempoverlay1]
-
-\framed[region=yes,background=tempoverlay2,width=14cm,align=normal]{
- \syncposition[2][1]\samplefile{ward}\endgraf
- \syncposition[2][2]\samplefile{ward}\endgraf
- \syncposition[2][3]\samplefile{ward}\endgraf
-}
-
-
-\vskip1cm \hskip1cm \framed[region=yes,background=tempoverlay2,width=16cm,align=normal]{
- \syncposition[2][1]\samplefile{ward}\endgraf
- \syncposition[2][2]\samplefile{ward}\endgraf
- \syncposition[2][3]\samplefile{ward}\endgraf
-}
-
-\vskip1cm \hskip1cm \framed[region=yes,background=tempoverlay2,width=10cm,align=normal]{
- \syncposition[2][1]\samplefile{ward}\endgraf
- \syncposition[2][2]\samplefile{ward}\endgraf
- \syncposition[2][3]\samplefile{ward}\endgraf
-}
-
-
-\dorecurse {100} {
-% \dorecurse {1} {
- \startchapter[title={Test #1}]
- \syncposition[1][1,reset]\dorecurse{20}{\samplefile{ward}\endgraf}
- \syncposition[1][2]\dorecurse {4}{\samplefile{ward}\endgraf}
- \syncposition[1][3]\dorecurse {7}{\samplefile{ward}\endgraf}
- \syncposition[1][4]\dorecurse {3}{\samplefile{ward}\endgraf}
- \stopchapter
-}
-
-\dorecurse {100} {
-% \dorecurse {1} {
- \startchapter[title={Test #1}]
- \syncposition[1][1]\dorecurse{1}{\samplefile{ward}\endgraf}
- \syncposition[1][2]\dorecurse{1}{\samplefile{ward}\endgraf}
- \syncposition[1][3]\dorecurse{1}{\samplefile{ward}\endgraf}
- \syncposition[1][4]\dorecurse{1}{\samplefile{ward}\endgraf}
- \stopchapter
-}
-
-\stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkxl/anch-tab.mkxl b/Master/texmf-dist/tex/context/base/mkxl/anch-tab.mkxl
index 11e9598d9c2..94e02165307 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/anch-tab.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/anch-tab.mkxl
@@ -18,7 +18,7 @@
\unprotect
-\newcount\c_anch_tabs
+\newinteger\c_anch_tabs
\protected\def\tabl_tabulate_hook_b
{\iftrialtypesetting\else
@@ -54,7 +54,7 @@
% \appendtoks \registerparoptions \to \everypar
\appendtoks
- \global\advance\c_anch_tabs\plusone
+ \global\advanceby\c_anch_tabs\plusone
\to \everytabulate
% for text backgrounds
@@ -74,7 +74,7 @@
%D references to the graphics involved. Each table has its own namespace.
\newconditional\tablehaspositions
-\newcount \noftabpositions
+\newinteger \noftabpositions
\newtoks \posXCtoks
\protected\def\anch_tabulate_bpos{\bpos}
@@ -195,7 +195,7 @@
\box\scratchbox}
\appendtoks
- \global\advance\noftabpositions\plusone
+ \global\advanceby\noftabpositions\plusone
\global\setfalse\tablehaspositions
\to \everytabulate
@@ -227,9 +227,9 @@
%D In order to prevent potential clashes with abbreviations, postpone the mapping and
%D make them mutable.
-\mutable\let\GSC\empty
-\mutable\let\GFC\empty
-\mutable\let\GTC\empty
+\mutable\lettonothing\GSC
+\mutable\lettonothing\GFC
+\mutable\lettonothing\GTC
\appendtoks
\enforced\let\GSC\tbGSC
@@ -274,7 +274,7 @@
\permanent\def\normalTABLEquote {\unskip\!ttRightGlue&\omit\tablepos&} % "
\appendtoks
- \global\advance\noftabpositions\plusone
+ \global\advanceby\noftabpositions\plusone
\global\setfalse\tablehaspositions
\to \everytable
diff --git a/Master/texmf-dist/tex/context/base/mkxl/attr-col.lmt b/Master/texmf-dist/tex/context/base/mkxl/attr-col.lmt
index 9c542a94293..1ac1cf93b0e 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/attr-col.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/attr-col.lmt
@@ -47,8 +47,8 @@ local report_transparencies = logs.reporter("transparencies","support")
-- nb. too many "0 g"s
local states = attributes.states
-local nodeinjections = backends.nodeinjections
local registrations = backends.registrations
+local nodeinjections = backends.nodeinjections
local unsetvalue = attributes.unsetvalue
local enableaction = nodes.tasks.enableaction
@@ -348,10 +348,18 @@ function colors.spot(parent,f,d,p)
return { 5, .5, .5, .5, .5, 0, 0, 0, .5, parent, f, d, p }
end
-local function graycolor(...) graycolor = nodeinjections.graycolor return graycolor(...) end
-local function rgbcolor (...) rgbcolor = nodeinjections.rgbcolor return rgbcolor (...) end
-local function cmykcolor(...) cmykcolor = nodeinjections.cmykcolor return cmykcolor(...) end
-local function spotcolor(...) spotcolor = nodeinjections.spotcolor return spotcolor(...) end
+local graycolor = nodeinjections.graycolor
+local rgbcolor = nodeinjections.rgbcolor
+local cmykcolor = nodeinjections.cmykcolor
+local spotcolor = nodeinjections.spotcolor
+
+updaters.register("backends.injections.latebindings",function()
+ local nodeinjections = backends.nodeinjections
+ graycolor = nodeinjections.graycolor
+ rgbcolor = nodeinjections.rgbcolor
+ cmykcolor = nodeinjections.cmykcolor
+ spotcolor = nodeinjections.spotcolor
+end)
local function extender(colors,key)
if colors.supported and key == "none" then
@@ -513,15 +521,13 @@ local f_transparency = formatters["%s:%s"]
registerstorage("attributes/transparencies/registered", registered, "attributes.transparencies.registered")
registerstorage("attributes/transparencies/values", values, "attributes.transparencies.values")
-local function inject_transparency(...)
- inject_transparency = nodeinjections.transparency
- return inject_transparency(...)
-end
+local register_transparency = registrations.transparency
+local inject_transparency = nodeinjections.transparency
-local function register_transparency(...)
- register_transparency = registrations.transparency
- return register_transparency(...)
-end
+updaters.register("backends.injections.latebindings",function()
+ register_transparency = backends.registrations.transparency
+ inject_transparency = backends.nodeinjections.transparency
+end)
function transparencies.register(name,a,t,force) -- name is irrelevant here (can even be nil)
-- Force needed here for metapost converter. We could always force
@@ -614,7 +620,17 @@ colorintents.registered = allocate {
knockout = 2,
}
-local data, registered = colorintents.data, colorintents.registered
+local inject_overprint = nodeinjections.injectoverprint
+local inject_knockout = nodeinjections.injectknockout
+
+updaters.register("backends.injections.latebindings",function()
+ local nodeinjections = backends.nodeinjections
+ inject_overprint = nodeinjections.injectoverprint
+ inject_knockout = nodeinjections.injectknockout
+end)
+
+local data = colorintents.data
+local registered = colorintents.registered
local function extender(colorintents,key)
if key == "none" then
@@ -626,11 +642,11 @@ end
local function reviver(data,n)
if n == 1 then
- local d = nodeinjections.overprint() -- called once
+ local d = inject_overprint() -- called once
data[1] = d
return d
elseif n == 2 then
- local d = nodeinjections.knockout() -- called once
+ local d = inject_knockout() -- called once
data[2] = d
return d
end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/attr-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/attr-ini.lmt
new file mode 100644
index 00000000000..8b2ec89119b
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/attr-ini.lmt
@@ -0,0 +1,361 @@
+if not modules then modules = { } end modules ['attr-ini'] = {
+ version = 1.001,
+ comment = "companion to attr-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local next, type = next, type
+local osexit = os.exit
+local sortedhash = table.sortedhash
+
+--[[ldx--
+<p>We start with a registration system for atributes so that we can use the
+symbolic names later on.</p>
+--ldx]]--
+
+local nodes = nodes
+local context = context
+local storage = storage
+local commands = commands
+
+local implement = interfaces.implement
+
+attributes = attributes or { }
+local attributes = attributes
+
+local sharedstorage = storage.shared
+
+local texsetattribute = tex.setattribute
+
+attributes.names = attributes.names or { }
+attributes.numbers = attributes.numbers or { }
+attributes.list = attributes.list or { }
+attributes.values = attributes.values or { }
+attributes.counts = attributes.counts or { }
+attributes.handlers = attributes.handlers or { }
+attributes.states = attributes.states or { }
+attributes.unsetvalue = -0x7FFFFFFF
+
+local currentfont = font.current
+local currentattributes = nodes and nodes. currentattributes or node.currentattributes
+local getusedattributes = nodes and nodes.nuts and nodes.nuts.getusedattributes or node.direct.getusedattributes
+
+local names = attributes.names
+local numbers = attributes.numbers
+local list = attributes.list
+local values = attributes.values
+local counts = attributes.counts
+
+storage.register("attributes/names", names, "attributes.names")
+storage.register("attributes/numbers", numbers, "attributes.numbers")
+storage.register("attributes/list", list, "attributes.list")
+storage.register("attributes/values", values, "attributes.values")
+storage.register("attributes/counts", counts, "attributes.counts")
+
+local report_attribute = logs.reporter("attributes")
+local report_value = logs.reporter("attributes","values")
+
+local trace_values = false
+
+local max_register_index = tex.magicconstants.max_attribute_register_index
+
+trackers.register("attributes.values", function(v) trace_values = v end)
+
+-- function attributes.define(name,number) -- at the tex end
+-- if not numbers[name] then
+-- numbers[name] = number
+-- names[number] = name
+-- list[number] = { }
+-- end
+-- end
+
+--[[ldx--
+<p>We reserve this one as we really want it to be always set (faster).</p>
+--ldx]]--
+
+names[0], numbers["fontdynamic"] = "fontdynamic", 0
+
+--[[ldx--
+<p>private attributes are used by the system and public ones are for users. We use dedicated
+ranges of numbers for them. Of course a the <l n='context'/> end a private attribute can be
+accessible too, so a private attribute can have a public appearance.</p>
+--ldx]]--
+
+sharedstorage.attributes_last_private = sharedstorage.attributes_last_private or 15 -- very private
+sharedstorage.attributes_last_public = sharedstorage.attributes_last_public or 1024 -- less private
+
+function attributes.private(name) -- at the lua end (hidden from user)
+ local number = numbers[name]
+ if not number then
+ local last = sharedstorage.attributes_last_private
+ if last < 1023 then
+ last = last + 1
+ sharedstorage.attributes_last_private = last
+ else
+ report_attribute("no more room for private attributes")
+ osexit()
+ end
+ number = last
+ numbers[name], names[number], list[number] = number, name, { }
+ end
+ return number
+end
+
+function attributes.public(name) -- at the lua end (hidden from user)
+ local number = numbers[name]
+ if not number then
+ local last = sharedstorage.attributes_last_public
+ if last < max_register_index then
+ last = last + 1
+ sharedstorage.attributes_last_public = last
+ else
+ report_attribute("no more room for public attributes")
+ osexit()
+ end
+ number = last
+ numbers[name], names[number], list[number] = number, name, { }
+ end
+ return number
+end
+
+attributes.system = attributes.private
+
+function attributes.define(name,category)
+ return (attributes[category or "public"] or attributes["public"])(name)
+end
+
+-- tracers
+
+local function showlist(what,list)
+ if list then
+ local a = list.next
+ local i = 0
+ while a do
+ local number = a.index
+ local value = a.value
+ i = i + 1
+ report_attribute("%S %2i: attribute %3i, value %4i, name %a",what,i,number,value,names[number])
+ a = a.next
+ end
+ end
+end
+
+function attributes.showcurrent()
+ showlist("current",currentattributes())
+end
+
+function attributes.ofnode(n)
+ showlist(n,n.attr)
+end
+
+-- rather special (can be optimized)
+
+local store = { }
+
+function attributes.save(name)
+ name = name or ""
+ local n = currentattributes()
+ n = n and n.next
+ local t = { }
+ while n do
+ t[n.index] = n.value
+ n = n.next
+ end
+ store[name] = {
+ attr = t,
+ font = currentfont(),
+ }
+end
+
+function attributes.restore(name)
+ name = name or ""
+ local t = store[name]
+ if t then
+ local attr = t.attr
+ local font = t.font
+ if attr then
+ for k, v in next, attr do
+ texsetattribute(k,v)
+ end
+ end
+ if font then
+ -- tex.font = font
+ -- context.getvalue(fonts.hashes.csnames[font])
+ currentfont(font)
+ end
+ end
+ -- store[name] = nil
+end
+
+-- value manager
+
+local cleaners = { }
+
+-- function attributes.registervalue(index,value)
+-- local list = values[index]
+-- local last
+-- if list then
+-- last = counts[index] + 1
+-- list[last] = value
+-- else
+-- last = 1
+-- values[index] = { value }
+-- end
+-- counts[index] = last
+-- return last
+-- end
+
+function attributes.registervalue(index,value)
+ local list = values[index]
+ local last
+ if list then
+ local c = counts[index]
+ if c and c[2] > 0 then
+ -- this can be an option
+ for i=c[1],c[2] do
+ if list[i] == nil then
+ -- we avoid 0 because that can be a signal attribute value
+ local n = i == 0 and 1 or i
+ if trace_values then
+ report_value("reusing slot %i for attribute %i in range (%i,%i)",n,index,c[1],c[2])
+ end
+ c[1] = n
+ list[n] = value
+ return n
+ end
+ end
+ else
+ c = { 0, 0 }
+ end
+ last = c[2] + 1
+ list[last] = value
+ c[1] = last
+ c[2] = last
+ if trace_values then
+ report_value("expanding to slot %i for attribute %i",last,index)
+ end
+ else
+ last = 1
+ values[index] = { value }
+ counts[index] = { last, last }
+ if trace_values then
+ report_value("starting at slot %i for attribute %i",last,index)
+ end
+ end
+ return last
+end
+
+function attributes.getvalue(index,value)
+ local list = values[index]
+ return list and list[value] or nil
+end
+
+function attributes.hasvalues(index)
+ local list = values[index]
+ return list and next(list) and true or false
+end
+
+function attributes.getvalues(index)
+ local list = values[index]
+ return list and next(list) and list or nil
+end
+
+function attributes.setcleaner(index,cleaner)
+ cleaners[index] = cleaner
+end
+
+function attributes.checkvalues()
+-- if true then
+-- report_value("no checking done")
+-- return
+-- end
+ if next(values) then
+ local active = getusedattributes()
+ if trace_values then
+ -- sorted
+ for index, list in sortedhash(values) do
+ local b = active[index]
+ if b then
+ local cleaner = cleaners[index]
+ for k in sortedhash(list) do
+ if b[k] then
+ report_value("keeping value %i for attribute %i",k,index)
+ else
+ report_value("wiping value %i for attribute %i",k,index)
+ if cleaner then
+ cleaner(list[k])
+ end
+ list[k] = nil
+ end
+ end
+ if next(list) then
+ counts[index][1] = 0
+ goto continue
+ end
+ end
+ report_value("no more values for attribute %i",index)
+ values[index] = nil
+ counts[index] = nil
+ ::continue::
+ end
+ else
+ for index, list in next, values do
+ local b = active[index]
+ if b then
+ local cleaner = cleaners[index]
+ for k in next, list do
+ if not b[k] then
+ if cleaner then
+ cleaner(list[k])
+ end
+ list[k] = nil
+ end
+ end
+ if next(list) then
+ counts[index][1] = 0
+ goto continue
+ end
+ end
+ values[index] = nil
+ counts[index] = { 0, 0 }
+ ::continue::
+ end
+ end
+ elseif trace_values then
+ report_value("no check needed")
+ end
+end
+
+implement {
+ name = "cleanupattributes",
+ -- public = true, -- some day ... but then also \shipoutpage
+ protected = true,
+ actions = attributes.checkvalues,
+}
+
+-- interface
+
+implement {
+ name = "defineattribute",
+ arguments = "2 strings",
+ actions = { attributes.define, context }
+}
+
+implement {
+ name = "showattributes",
+ actions = attributes.showcurrent
+}
+
+implement {
+ name = "savecurrentattributes",
+ arguments = "string",
+ actions = attributes.save
+}
+
+implement {
+ name = "restorecurrentattributes",
+ arguments = "string",
+ actions = attributes.restore
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/attr-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/attr-ini.mkxl
index e707a478f1f..ce21be08128 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/attr-ini.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/attr-ini.mkxl
@@ -15,7 +15,7 @@
\unprotect
-\registerctxluafile{attr-ini}{}
+\registerctxluafile{attr-ini}{autosuffix}
\installcorenamespace{attributecount} % the counter representing the attribute (attrdef'd)
\installcorenamespace{attributeid} % the internal number
@@ -23,16 +23,16 @@
\installcorenamespace{attributepickup}
\permanent\protected\def\pushattribute#1%
- {\global\advance\csname\??attributestack\string#1\endcsname\plusone
+ {\global\advanceby\csname\??attributestack\string#1\endcsname\plusone
\gdefcsname\??attributestack\string#1:\number\csname\??attributestack\string#1\endcsname\endcsname{\number\attribute#1}}
\permanent\protected\def\popattribute#1%
{\attribute#1\csname\??attributestack\string#1:\number\csname\??attributestack\string#1\endcsname\endcsname\relax
- \global\advance\csname\??attributestack\string#1\endcsname\minusone}
+ \global\advanceby\csname\??attributestack\string#1\endcsname\minusone}
\permanent\protected\def\installattributestack#1%
{\ifcsname\??attributestack\string#1\endcsname \else
- \expandafter\newcount\csname\??attributestack\string#1\endcsname
+ \expandafter\newinteger\csname\??attributestack\string#1\endcsname
\fi}
\newtoks \t_attr_list_global
diff --git a/Master/texmf-dist/tex/context/base/mkxl/attr-lay.mkxl b/Master/texmf-dist/tex/context/base/mkxl/attr-lay.mkxl
index 00c6335337a..122839c0608 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/attr-lay.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/attr-lay.mkxl
@@ -66,14 +66,14 @@
\def\currentviewerlayer{\the\currentviewerlayertoks}
\appendtoks
- \let\currentviewerlayer\empty
+ \lettonothing\currentviewerlayer
\to \everybeforepagebody
% layout components are implemented rather directly (speed)
\installcorenamespace{layoutcomponentattribute}
-\mutable\let\layoutcomponentboxattribute\empty
+\mutable\lettonothing\layoutcomponentboxattribute
\permanent\def\attr_layoutcomponent_initialize#1%
{\edef\layoutcomponentboxattribute{\clf_definedlayoutcomponent{#1}}%
@@ -87,11 +87,11 @@
\fi}
\permanent\def\attr_layoutcomponent_reset
- {\let\layoutcomponentboxattribute\empty}
+ {\lettonothing\layoutcomponentboxattribute}
-\permanent\let\setlayoutcomponentattribute \gobbleoneargument
-\permanent\let\resetlayoutcomponentattribute\relax
- \let\layoutcomponentboxattribute \empty
+\permanent\let \setlayoutcomponentattribute \gobbleoneargument
+\permanent\let \resetlayoutcomponentattribute\relax
+ \lettonothing\layoutcomponentboxattribute
\permanent\protected\def\showlayoutcomponents
{\enforced\let\setlayoutcomponentattribute \attr_layoutcomponent_set
diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-exp-imp-mth.lmt b/Master/texmf-dist/tex/context/base/mkxl/back-exp-imp-mth.lmt
index 73c09d79ecf..4df109b54f5 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/back-exp-imp-mth.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/back-exp-imp-mth.lmt
@@ -21,6 +21,10 @@ local extras = backend.extras
local checks = backend.checks
local finalizers = backend.finalizers
+----- bpfactor = number.dimenfactors.bp
+----- f_points = string.formatters["%p"]
+local f_em = string.formatters["%.6Nem"]
+
local implement = interfaces.implement
do
@@ -155,6 +159,7 @@ do
mi = true,
mo = true,
mn = true,
+ mspace = true,
}
local function checkmath(root) -- we can provide utf.toentities as an option
@@ -162,8 +167,16 @@ do
if data then
local ndata = #data
local roottg = root.tg
- if roottg == "msubsup" then
- -- kind of tricky: we have a diufferent order in display mode
+ if roottg == "mo" then
+ local s = specifications[root.fulltag]
+ local c = s.class
+ if c == "open" or c == "close" or c == "middle" then
+ root.attributes = {
+ maxsize = 1
+ }
+ end
+ elseif roottg == "msubsup" then
+ -- kind of tricky: we have a different order in display mode
local nucleus, superscript, subscript
if ndata > 3 then
-- error
@@ -206,25 +219,33 @@ do
-- end
elseif roottg == "mfenced" then
local s = specifications[root.fulltag]
- local l, m, r = s.left, s.middle, s.right
- if l then
- l = utfchar(l)
- end
- if m then
- local t = { }
- for i=1,#m do
- t[i] = utfchar(m[i])
+ local o = s.operator
+ if o then
+ root.skip = "comment"
+ -- root.content = utfchar(o) -- use embedded for now
+ else
+ local l = s.left
+ local m = s.middle
+ local r = s.right
+ if l then
+ l = utfchar(l)
end
- m = concat(t)
- end
- if r then
- r = utfchar(r)
+ if m then
+ local t = { }
+ for i=1,#m do
+ t[i] = utfchar(m[i])
+ end
+ m = concat(t)
+ end
+ if r then
+ r = utfchar(r)
+ end
+ root.attributes = {
+ open = l,
+ separators = m,
+ close = r,
+ }
end
- root.attributes = {
- open = l,
- separators = m,
- close = r,
- }
end
if ndata == 0 then
root.skip = "comment" -- get rid of weird artefacts
@@ -241,7 +262,7 @@ do
local tg = d.tg
if automathrows and (roottg == "mrow" or roottg == "mtext") then
-- maybe just always ! check spec first
- -- or we can have chesks.* for each as we then can flatten
+ -- or we can have checks.* for each as we then can flatten
if no_mrow[tg] then
root.skip = "comment"
end
@@ -274,7 +295,13 @@ do
-- todo: p.topfixed
if t then
-- mover
- d[1].data[1].content = utfchar(t)
+ if true then -- we don't go here any more
+ local dd = d[1].data
+ if dd then
+ dd[1].content = utfchar(t)
+ end
+ end
+ --
di.data = { d[2], d[1] }
end
else
@@ -294,7 +321,12 @@ do
-- todo: p.bottomfixed
if b then
-- munder
- d[2].data[1].content = utfchar(b)
+ if true then -- we don't go here any more
+ local dd = d[2].data
+ if dd then
+ dd[1].content = utfchar(b)
+ end
+ end
end
else
-- can't happen
@@ -317,8 +349,16 @@ do
-- todo: p.bottomfixed
if t and b then
-- munderover
- d[1].data[1].content = utfchar(t)
- d[3].data[1].content = utfchar(b)
+ if true then -- we don't go here any more
+ local dd = d[1].data
+ if dd then
+ dd[1].content = utfchar(t)
+ end
+ local dd = d[3].data
+ if dd then
+ dd[1].content = utfchar(b)
+ end
+ end
di.data = { d[2], d[3], d[1] }
else
-- can't happen
@@ -394,6 +434,17 @@ do
elseif tg == "break" then
di.skip = "comment"
i = i + 1
+ elseif tg == "mspace" then
+ -- di.empty = true
+ local s = specifications[di.fulltag]
+ local e = s and s.emfactor
+ if e and e ~= 0 then
+ di.element = "mspace"
+ di.attributes = {
+ width = f_em(e),
+ }
+ end
+ i = i + 1
elseif tg == "mtext" then
-- this is only needed for unboxed mtexts ... all kind of special
-- tex border cases and optimizations ... trial and error
@@ -519,6 +570,8 @@ do
local tg = di.tg
if tg == "mtext" or tg == "ms" then
return di
+ elseif tg == "mspace" then
+ return di
else
local data = di.data
local ndata = #data
@@ -530,38 +583,43 @@ do
end
if d then
local content = d.content
- if not content then
+ if d.tg == "mspace" then
+ n = n + 1
+ data[n] = d
+ d.data = { }
+ elseif not content then
+-- if not content then
n = n + 1
d.__i__ = n
data[n] = d
- elseif content == " " or content == "" then
- if di.tg == "mspace" then
- -- we append or prepend a space to a preceding or following mtext
- local parent = di.__p__
- local index = di.__i__ -- == i
- local data = parent.data
- if index > 1 then
- local d = data[index-1]
- if d.tg == "mtext" then
- local dd = d.data
- local dn = dd[#dd]
- local dc = dn.content
- if dc then
- dn.content = dc .. content
- end
- end
- elseif index < ndata then
- local d = data[index+1]
- if d.tg == "mtext" then
- local dd = d.data
- local dn = dd[1]
- local dc = dn.content
- if dc then
- dn.content = content .. dc
- end
- end
- end
- end
+-- elseif content == " " or content == "" then
+-- if d.tg == "mspace" then
+-- -- we append or prepend a space to a preceding or following mtext
+-- local parent = di.__p__
+-- local index = di.__i__ -- == i
+-- local data = parent.data
+-- if index > 1 then
+-- local d = data[index-1]
+-- if d.tg == "mtext" then
+-- local dd = d.data
+-- local dn = dd[#dd]
+-- local dc = dn.content
+-- if dc then
+-- dn.content = dc .. content
+-- end
+-- end
+-- elseif index < ndata then
+-- local d = data[index+1]
+-- if d.tg == "mtext" then
+-- local dd = d.data
+-- local dn = dd[1]
+-- local dc = dn.content
+-- if dc then
+-- dn.content = content .. dc
+-- end
+-- end
+-- end
+-- end
else
n = n + 1
data[n] = d
@@ -586,8 +644,9 @@ do
local specification = specifications[di.fulltag]
local mode = specification and specification.mode == "display" and "block" or "inline"
di.attributes = {
- ["display"] = mode,
- ["xmlns:m"] = mathmlns,
+ ["display"] = mode,
+ ["xmlns:m"] = mathmlns,
+ ["xmlns:math"] = mathmlns,
}
-- can be option if needed:
if mode == "inline" then
diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-exp.lmt b/Master/texmf-dist/tex/context/base/mkxl/back-exp.lmt
index 1375d2655c2..e5e2e9dab00 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/back-exp.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/back-exp.lmt
@@ -44,6 +44,7 @@ local formatters = string.formatters
local todimen = number.todimen
local replacetemplate = utilities.templates.replace
local settings_to_array = utilities.parsers.settings_to_array
+local settings_to_hash = utilities.parsers.settings_to_hash
local addsuffix, joinfile, nameonly, basename, filesuffix = file.addsuffix, file.join, file.nameonly, file.basename, file.suffix
@@ -74,8 +75,6 @@ local v_hidden = variables.hidden
local implement = interfaces.implement
-local included = backends.included
-
local tasks = nodes.tasks
local fontchar = fonts.hashes.characters
local fontquads = fonts.hashes.quads
@@ -100,12 +99,12 @@ local overloads = fonts.mappings.overloads
-- todo: more locals (and optimize)
-local exportversion = "0.35"
-local mathmlns = "http://www.w3.org/1998/Math/MathML"
-local contextns = "http://www.contextgarden.net/context/export" -- whatever suits
-local cssnamespaceurl = "@namespace context url('%namespace%') ;"
-local cssnamespace = "context|"
------ cssnamespacenop = "/* no namespace */"
+local exportversion <const> = "0.35"
+local mathmlns <const> = "http://www.w3.org/1998/Math/MathML"
+local contextns <const> = "http://www.contextgarden.net/context/export" -- whatever suits
+local cssnamespaceurl <const> = "@namespace context url('%namespace%') ;"
+local cssnamespace <const> = "context|"
+----- cssnamespacenop <const> = "/* no namespace */"
local usecssnamespace = false
@@ -137,7 +136,6 @@ local currentdepth = 0
local wrapups = { }
local tree = { data = { }, fulltag == "root" } -- root
-local treeroot = tree
local treehash = { }
local extras = { }
local checks = { }
@@ -297,7 +295,7 @@ structurestags.backend = {
destinationhash = destinationhash,
}
-local namespacetemplate = [[
+local namespacetemplate <const> = [[
/* %what% for file %filename% */
%cssnamespaceurl%
@@ -313,7 +311,7 @@ do
-- /* text-justify : inter-word ; */
-- /* text-align : justify ; */
-local documenttemplate = [[
+local documenttemplate <const> = [[
document,
%namespace%div.document {
font-size : %size% !important ;
@@ -322,7 +320,7 @@ document,
hyphens : %hyphens% !important ;
}]]
-local styletemplate = [[
+local styletemplate <const> = [[
%element%[detail="%detail%"],
%namespace%div.%element%.%detail% {
display : inline ;
@@ -335,9 +333,9 @@ local styletemplate = [[
local numbertoallign = {
[0] = "justify", ["0"] = "justify", [variables.normal ] = "justify",
- [1] = "right", ["1"] = "right", [variables.flushright] = "right",
- [2] = "center", ["2"] = "center", [variables.middle ] = "center",
- [3] = "left", ["3"] = "left", [variables.flushleft ] = "left",
+ "right", ["1"] = "right", [variables.flushright] = "right",
+ "center", ["2"] = "center", [variables.middle ] = "center",
+ "left", ["3"] = "left", [variables.flushleft ] = "left",
}
function wrapups.allusedstyles(filename)
@@ -410,7 +408,7 @@ end
do
-local imagetemplate = [[
+local imagetemplate <const> = [[
%element%[id="%id%"], %namespace%div.%element%[id="%id%"] {
display : block ;
background-image : url('%url%') ;
@@ -561,9 +559,7 @@ do
setattribute(di,"language",languagenames[texgetcount("mainlanguagenumber")])
if not less_state then
setattribute(di,"file",tex.jobname)
- if included.date then
- setattribute(di,"date",os.fulltime())
- end
+ setattribute(di,"date",os.fulltime())
setattribute(di,"context",environment.version)
setattribute(di,"version",exportversion)
setattribute(di,"xmlns:m",mathmlns)
@@ -845,9 +841,9 @@ do
used[element][detail or ""] = { nature, specification.parents } -- for template css
-- also in last else ?
local metadata = specification.metadata
- if metadata then
+ if metadata and next(metadata) then
result[#result+1] = f_metadata_begin(depth)
- for k, v in table.sortedpairs(metadata) do
+ for k, v in sortedhash(metadata) do
if v ~= "" then
result[#result+1] = f_metadata(depth+1,k,lpegmatch(p_entity,v))
end
@@ -921,7 +917,9 @@ do
local element = di.element
if not element then
-- skip
- elseif element == "break" then -- or element == "pagebreak"
+ elseif element == "break" then -- or element == "pagebreak" -- todo: use empty flag
+ emptytag(result,element,nature,di)
+ elseif element == "mspace" then -- todo: use empty flag
emptytag(result,element,nature,di)
elseif element == "" or di.skip == "ignore" then
-- skip
@@ -941,6 +939,11 @@ do
flushtree(result,di.after,nature)
end
end
+ else
+-- local element = di.element
+-- if element == "mspace" then -- todo: use empty flag
+-- emptytag(result,element,nature,di)
+-- end
end
end
end
@@ -961,8 +964,8 @@ do
-- skip
elseif di.skip == "ignore" then
-- skip (new)
-elseif di.tg == "ignore" then
- -- skip (new)
+ elseif di.tg == "ignore" then
+ -- skip (new)
elseif di.content then
if di.samepar then
prevparnumber = false
@@ -1046,12 +1049,22 @@ elseif di.tg == "ignore" then
-- also tabulaterow reconstruction .. maybe better as a checker
-- i.e cell attribute
+ local function showtree(data,when,where)
+ if data then
+ for i=1,#data do
+ local d = data[i]
+ if type(d) == "table" and d.element then
+ print(when,where,i,d.element,d.parnumber or 0)
+ end
+ end
+ end
+ end
+
local function collapsetree(tree)
--- for tag, trees in sortedhash(treehash) do
+ -- showtree(data,"before","collapse")
+ -- for tag, trees in sortedhash(treehash) do
for tag, trees in next, treehash do
local d = trees[1].data
--- print("!!!!!!!!",tag)
--- inspect(trees)
if d then
local nd = #d
if nd > 0 then
@@ -1097,30 +1110,22 @@ elseif di.tg == "ignore" then
end
end
end
+ -- showtree(data,"after","collapse")
end
local function finalizetree(tree)
+ -- showtree(data,"before","finalize")
for _, finalizer in next, finalizers do
finalizer(tree)
end
+ -- showtree(data,"after","finalize")
end
- -- local function showtree(data,when,where)
- -- if data then
- -- for i=1,#data do
- -- local d = data[i]
- -- if type(d) == "table" and d.element then
- -- print(when,where,i,d.element,d.parnumber or 0)
- -- end
- -- end
- -- end
- -- end
-
local function indextree(tree)
local data = tree.data
if data then
- local n, new = 0, { }
-- showtree(data,"before","index")
+ local n, new = 0, { }
for i=1,#data do
local d = data[i]
if not d then
@@ -1148,9 +1153,12 @@ elseif di.tg == "ignore" then
for i=1,#data do
local d = data[i]
if type(d) == "table" then
- local check = checks[d.tg]
- if check then
- check(d,data,i)
+ local tg = d.tg
+ if tg then
+ local check = checks[tg]
+ if check then
+ check(d,data,i)
+ end
end
checktree(d) -- so parts can pass twice
end
@@ -1166,9 +1174,12 @@ elseif di.tg == "ignore" then
for i=1,#data do
local d = data[i]
if type(d) == "table" then
- local fix = fixes[d.tg]
- if fix then
- fix(d,data,i)
+ local tg = d.tg
+ if tg then
+ local fix = fixes[tg]
+ if fix then
+ fix(d,data,i)
+ end
end
fixtree(d) -- so parts can pass twice
end
@@ -1406,29 +1417,30 @@ end
local collectresults do -- too many locals otherwise
- local nodecodes = nodes.nodecodes
- local gluecodes = nodes.gluecodes
- local listcodes = nodes.listcodes
- local whatsitcodes = nodes.whatsitcodes
+ local nodecodes = nodes.nodecodes
+ local gluecodes = nodes.gluecodes
+ local listcodes = nodes.listcodes
+ local whatsitcodes = nodes.whatsitcodes
- local subtypes = nodes.subtypes
+ local subtypes = nodes.subtypes
- local hlist_code = nodecodes.hlist
- local vlist_code = nodecodes.vlist
- local glyph_code = nodecodes.glyph
- local glue_code = nodecodes.glue
- local kern_code = nodecodes.kern
- local disc_code = nodecodes.disc
- local whatsit_code = nodecodes.whatsit
- local par_code = nodecodes.par
+ local hlist_code = nodecodes.hlist
+ local vlist_code = nodecodes.vlist
+ local glyph_code = nodecodes.glyph
+ local glue_code = nodecodes.glue
+ local kern_code = nodecodes.kern
+ local disc_code = nodecodes.disc
+ local whatsit_code = nodecodes.whatsit
+ local par_code = nodecodes.par
- local userskip_code = gluecodes.userskip
- local rightskip_code = gluecodes.rightskip
- local parfillskip_code = gluecodes.parfillskip
- local spaceskip_code = gluecodes.spaceskip
- local xspaceskip_code = gluecodes.xspaceskip
+ local userskip_code = gluecodes.userskip
+ local rightskip_code = gluecodes.rightskip
+ local parfillskip_code = gluecodes.parfillskip
+ local spaceskip_code = gluecodes.spaceskip
+ local xspaceskip_code = gluecodes.xspaceskip
+ local intermathskip_code = gluecodes.intermathskip
- local linelist_code = listcodes.line
+ local linelist_code = listcodes.line
local userdefinedwhatsit_code = whatsitcodes.userdefined
@@ -1456,7 +1468,7 @@ local collectresults do -- too many locals otherwise
local getkern = nuts.getkern
local getwidth = nuts.getwidth
- local start_of_par = nuts.start_of_par
+ local startofpar = nuts.startofpar
local nexthlist = nuts.traversers.hlist
local nextnode = nuts.traversers.node
@@ -1654,6 +1666,21 @@ local collectresults do -- too many locals otherwise
currentcontent[nofcurrentcontent] = c
end
elseif subtype == userskip_code then
+-- local at = getattr(n,a_tagged)
+-- local tl = taglist[at]
+-- if tl and structurestags.strip(tl.taglist[#tl.taglist]) == "mspace" then
+-- if nofcurrentcontent > 0 then
+-- pushcontent()
+-- pushentry(currentnesting) -- ??
+-- end
+-- -- in the past we'd push a space here ... check mkiv : otherwise no threshold with mspace
+-- pushentry(tl)
+-- if trace_export then
+-- report_export("%w<!-- processing mspace tagged %a",currentdepth,at)
+-- end
+-- last = nil
+-- currentparagraph = nil
+-- else
if getwidth(n) > threshold then
if last and not somespace[currentcontent[nofcurrentcontent]] then
local a = getattr(n,a_tagged) or pat
@@ -1681,6 +1708,7 @@ local collectresults do -- too many locals otherwise
end
end
end
+-- end
elseif subtype == spaceskip_code or subtype == xspaceskip_code then
if not somespace[currentcontent[nofcurrentcontent]] then
local a = getattr(n,a_tagged) or pat
@@ -1703,6 +1731,8 @@ local collectresults do -- too many locals otherwise
currentattribute = last
end
end
+ elseif subtype == intermathskip_code then
+ -- put this as attribute when it differs, maybe more ... check mathml
elseif subtype == rightskip_code then
-- a line
if nofcurrentcontent > 0 then
@@ -1769,49 +1799,50 @@ local collectresults do -- too many locals otherwise
elseif id == kern_code then
local kern = getkern(n)
if kern > 0 then
-local a = getattr(n,a_tagged) or pat
-local t = taglist[a]
-if not t or t.tagname ~= "ignore" then -- maybe earlier on top)
- local limit = threshold
- if p then
- local c, f = isglyph(p)
- if c then
- limit = fontquads[f] / 4
+ local a = getattr(n,a_tagged) or pat
+ local t = taglist[a]
+ if not t or t.tagname ~= "ignore" then -- maybe earlier on top)
+ local limit = threshold
+ if p then
+ local c, f = isglyph(p)
+ if c then
+ limit = fontquads[f] / 4
+ end
end
- end
- if kern > limit then
- if last and not somespace[currentcontent[nofcurrentcontent]] then
--- local a = getattr(n,a_tagged) or pat
- if a == last then
- if not somespace[currentcontent[nofcurrentcontent]] then
+ if kern > limit then
+ if last and not somespace[currentcontent[nofcurrentcontent]] then
+ -- local a = getattr(n,a_tagged) or pat
+ if a == last then
+ if not somespace[currentcontent[nofcurrentcontent]] then
+ if trace_export then
+ report_export("%w<!-- injecting spacing 8 (kern %p) -->",currentdepth,kern)
+ end
+ nofcurrentcontent = nofcurrentcontent + 1
+ currentcontent[nofcurrentcontent] = " "
+ end
+ elseif a then
+ -- e.g LOGO<space>LOGO
+ if trace_export then
+ report_export("%w<!-- processing kern, threshold %p, tag %s => %s -->",currentdepth,limit,last,a)
+ end
+ last = a
+ pushcontent()
if trace_export then
- report_export("%w<!-- injecting spacing 8 (kern %p) -->",currentdepth,kern)
+ report_export("%w<!-- injecting spacing 9 (kern %p) -->",currentdepth,kern)
end
nofcurrentcontent = nofcurrentcontent + 1
currentcontent[nofcurrentcontent] = " "
+ -- currentnesting = taglist[last]
+ currentnesting = t
+ pushentry(currentnesting)
+ currentattribute = last
end
- elseif a then
- -- e.g LOGO<space>LOGO
- if trace_export then
- report_export("%w<!-- processing kern, threshold %p, tag %s => %s -->",currentdepth,limit,last,a)
- end
- last = a
- pushcontent()
- if trace_export then
- report_export("%w<!-- injecting spacing 9 (kern %p) -->",currentdepth,kern)
- end
- nofcurrentcontent = nofcurrentcontent + 1
- currentcontent[nofcurrentcontent] = " "
--- currentnesting = taglist[last]
-currentnesting = t
- pushentry(currentnesting)
- currentattribute = last
end
end
end
-end
end
elseif id == whatsit_code then
+ -- todo (lmtx)
if subtype == userdefinedwhatsit_code then
-- similar to images, see above
local at = getattr(n,a_tagged)
@@ -1826,7 +1857,7 @@ end
last = nil
currentparagraph = nil
end
- elseif not paragraph and id == par_code and start_of_par(n) then
+ elseif not paragraph and id == par_code and startofpar(n) then
paragraph = getattr(n,a_taggedpar)
elseif id == disc_code then
-- very unlikely because we stripped them
@@ -1849,18 +1880,25 @@ end
end
end
+ local enabled = true
+
+ updaters.register("tagging.state.disable",function() enabled = false end)
+ updaters.register("tagging.state.enable", function() enabled = true end)
+
function nodes.handlers.export(head) -- hooks into the page builder
- starttiming(treehash)
- if trace_export then
- report_export("%w<!-- start flushing page -->",currentdepth)
- end
- -- continueexport()
- restart = true
- collectresults(head)
- if trace_export then
- report_export("%w<!-- stop flushing page -->",currentdepth)
+ if enabled then
+ starttiming(treehash)
+ if trace_export then
+ report_export("%w<!-- start flushing page -->",currentdepth)
+ end
+ -- continueexport()
+ restart = true
+ collectresults(head)
+ if trace_export then
+ report_export("%w<!-- stop flushing page -->",currentdepth)
+ end
+ stoptiming(treehash)
end
- stoptiming(treehash)
return head
end
@@ -1869,13 +1907,15 @@ end
return p
end
+ -- needs checking!
+
function builders.paragraphs.tag(head)
noftextblocks = noftextblocks + 1
for n, subtype in nexthlist, head do
if subtype == linelist_code then
setattr(n,a_textblock,noftextblocks)
- elseif subtype == glue_code or subtype == kern_code then -- no need to set fontkerns
- setattr(n,a_textblock,0)
+ -- elseif subtype == glue_code or subtype == kern_code then -- weird, no list
+ -- setattr(n,a_textblock,0)
end
end
return false
@@ -1888,7 +1928,11 @@ do
local xmlcollected = xml.collected
local xmlsetcomment = xml.setcomment
-local xmlpreamble = [[
+local xmlpreamble_nop = [[
+<?xml version="1.0" encoding="UTF-8" standalone="%standalone%" ?>
+]]
+
+local xmlpreamble_yes = [[
<?xml version="1.0" encoding="UTF-8" standalone="%standalone%" ?>
<!--
@@ -1904,11 +1948,11 @@ local xmlpreamble = [[
local flushtree = wrapups.flushtree
- local function wholepreamble(standalone)
- return replacetemplate(xmlpreamble, {
+ local function wholepreamble(standalone,nocomment)
+ return replacetemplate(nocomment and xmlpreamble_nop or xmlpreamble_yes, {
standalone = standalone and "yes" or "no",
filename = tex.jobname,
- date = included.date and os.fulltime(),
+ date = os.fulltime(),
contextversion = environment.version,
exportversion = exportversion,
})
@@ -1923,7 +1967,18 @@ local cssheadlink = [[
<link type="text/css" rel="stylesheet" href="%filename%" />
]]
- local function allusedstylesheets(cssfiles,files,path)
+-- great, these suggested valuess attributes
+
+local mathmlheadscript = [[
+<script
+ type="text/javascript"
+ id="MathJax-script"
+ async="async"
+ src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/mml-chtml.js">
+</script>
+]]
+
+ local function allusedstylesheets(cssfiles,files,path,extra)
local done = { }
local result = { }
local extras = { }
@@ -1942,10 +1997,13 @@ local cssheadlink = [[
done[cssfile] = true
end
end
+ if extra then
+ extras[#extras+1] = extra
+ end
return concat(result), concat(extras)
end
-local elementtemplate = [[
+local elementtemplate <const> = [[
/* element="%element%" detail="%detail%" chain="%chain%" */
%element%,
@@ -1953,7 +2011,7 @@ local elementtemplate = [[
display: %display% ;
}]]
-local detailtemplate = [[
+local detailtemplate <const> = [[
/* element="%element%" detail="%detail%" chain="%chain%" */
%element%[detail=%detail%],
@@ -1963,7 +2021,7 @@ local detailtemplate = [[
-- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd" >
-local htmltemplate = [[
+local htmltemplate <const> = [[
%preamble%
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:math="http://www.w3.org/1998/Math/MathML">
@@ -2033,13 +2091,20 @@ local htmltemplate = [[
return concat(result,"\n\n")
end
- local function allcontent(tree,embed)
- local result = { }
+ local function allcontent(tree)
+ local result = { }
+ local data = tree.data
+ for i=1,#data do
+ if data[i].tg ~= "document" then
+ data[i] = { }
+ end
+ end
flushtree(result,tree.data,"display") -- we need to collect images
result = concat(result)
-- no need to lpeg .. fast enough
result = gsub(result,"\n *\n","\n")
result = gsub(result,"\n +([^< ])","\n%1")
+ --
return result
end
@@ -2237,11 +2302,16 @@ local htmltemplate = [[
if not c.special then
local tg = c.tg
local ns = c.ns
+ local at = c.at
if ns == "m" then
- if false then -- yes or no
+ -- should happen elsewhere
+ -- if false then -- yes or no
c.ns = ""
- c.at["xmlns:m"] = nil
- end
+ at["xmlns:m"] = nil
+ if tg == "math" then
+ at["xmlns"] = mathmlns
+ end
+ -- end
-- elseif tg == "a" then
-- c.ns = ""
else
@@ -2255,7 +2325,6 @@ local htmltemplate = [[
comment = c.dt
end
end
- local at = c.at
local class = nil
local label = nil
if tg == "document" then
@@ -2316,6 +2385,83 @@ local htmltemplate = [[
local embedfile = false directives.register("export.embed",function(v) embedfile = v end)
+ local justexport = nodes.handlers.export
+
+ local function wrapuptree(tree)
+ wrapups.fixtree(tree)
+ wrapups.collapsetree(tree)
+ wrapups.indextree(tree)
+ wrapups.checktree(tree)
+ wrapups.breaktree(tree)
+ wrapups.finalizetree(tree)
+ end
+
+ local function localexport(head)
+ starttiming(treehash)
+
+ local saved_treestack = treestack
+ local saved_nesting = nesting
+ local saved_currentdepth = currentdepth
+ local saved_tree = tree
+ local saved_treehash = treehash
+ local saved_nofbreaks = nofbreaks
+ local saved_show_comment = show_comment
+
+ treestack = { }
+ nesting = { }
+ currentdepth = 0
+ tree = { data = { }, fulltag == "root" } -- root
+ treehash = { }
+ nofbreaks = 0
+ show_comment = false
+
+ justexport(head)
+ finishexport()
+ wrapuptree(tree)
+
+ -- tree.data = tree.data[1].data
+
+ local result = concat {
+ wholepreamble(true,true),
+ allcontent(tree),
+ }
+
+ treestack = saved_treestack
+ nesting = saved_nesting
+ currentdepth = saved_currentdepth
+ tree = saved_tree
+ treehash = saved_treehash
+ nofbreaks = saved_nofbreaks
+ show_comment = saved_show_comment
+
+ stoptiming(treehash)
+
+ return result
+
+ end
+
+ structurestags.localexport = localexport
+
+ function structures.tags.exportbox(n,filename,buffername)
+ local list = nodes.nuts.getbox(n)
+ if n then
+ local e = localexport(list)
+ if filename and filename ~= "" then
+ io.savedata(filename,e)
+ elseif buffername then
+ buffers.assign(buffername == interfaces.variables.yes and "" or buffername,e)
+ else
+ return e
+ end
+ end
+ end
+
+ interfaces.implement {
+ name = "exportbox",
+ arguments = { "integer", "string", "string" },
+ actions = structures.tags.exportbox
+ }
+
function structurestags.finishexport()
if exporting then
@@ -2338,14 +2484,7 @@ local htmltemplate = [[
end
report_export("")
--
- wrapups.fixtree(tree)
- wrapups.collapsetree(tree)
- wrapups.indextree(tree)
- wrapups.checktree(tree)
- wrapups.breaktree(tree)
- wrapups.finalizetree(tree)
- --
- wrapups.hashlistdata()
+ wrapuptree(tree)
--
local askedname = finetuning.file
--
@@ -2439,14 +2578,7 @@ local htmltemplate = [[
-- representation that uses verbose element names and carries information in
-- attributes
- local data = tree.data
- for i=1,#data do
- if data[i].tg ~= "document" then
- data[i] = { }
- end
- end
-
- local result = allcontent(tree,embedmath) -- embedfile is for testing
+ local result = allcontent(tree)
-- ugly but so be it:
@@ -2488,7 +2620,7 @@ local htmltemplate = [[
os.remove(htmlfilename)
result = concat {
- wholepreamble(true),
+ wholepreamble(true,true),
"<!-- This export file is used for filtering runtime only! -->\n",
result,
}
@@ -2526,7 +2658,10 @@ local htmltemplate = [[
end
end
- local x_styles, h_styles = allusedstylesheets(cssfiles,files,"styles")
+
+ local script = settings_to_hash(finetuning.option or "").mathjax and mathmlheadscript or nil
+
+ local x_styles, h_styles = allusedstylesheets(cssfiles,files,"styles",script)
local attach = backends.nodeinjections.attachfile
@@ -2703,6 +2838,7 @@ implement {
{ "svgstyle" },
{ "cssfile" },
{ "file" },
+ { "option" },
{ "export" },
}
}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-exp.mkxl b/Master/texmf-dist/tex/context/base/mkxl/back-exp.mkxl
index 5aebd302fdc..cafbb938ffb 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/back-exp.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/back-exp.mkxl
@@ -15,6 +15,8 @@
\writestatus{loading}{ConTeXt Backend Macros / XML export}
+\newinteger\tagparcounter
+
\registerctxluafile{back-exp} {autosuffix}
\registerctxluafile{back-exp-imp-tag}{autosuffix}
\registerctxluafile{back-exp-imp-mth}{autosuffix}
@@ -49,10 +51,8 @@
\expandafter\ctxcommand
\fi}
-\newcount\tagparcounter
-
-\aliased\let\dotagsetparcounter\relax
-\aliased\let\doresetparcounter \relax
+\permanent\protected\lettonothing\dotagsetparcounter
+\permanent\protected\lettonothing\doresetparcounter
\appendtoks
\doresetparcounter
@@ -158,7 +158,7 @@
\appendtoks
\enforced\permanent\protected\def\dotagsetparcounter
- {\global\advance\tagparcounter\plusone\c_attr_taggedpar\tagparcounter}%
+ {\global\advanceby\tagparcounter\plusone\c_attr_taggedpar\tagparcounter}%
\enforced\permanent\protected\def\doresetparcounter
{\c_attr_taggedpar\attributeunsetvalue}%
\to \everyenableelements
@@ -312,7 +312,7 @@
\permanent\protected\def\dostartexport
{%\glet\dostartexport\relax
- \let\currentexport\empty
+ \lettonothing\currentexport
\clf_setupexport
align {\exportparameter\c!align}%
bodyfont \dimexpr\exportparameter\c!bodyfont\relax
@@ -327,6 +327,7 @@
svgstyle {\exportparameter\c!svgstyle}%
cssfile {\exportparameter\c!cssfile}%
file {\exportparameter\c!file}%
+ option {\exportparameter\c!option}%
export {\backendparameter\c!export}%
\relax}
@@ -358,4 +359,106 @@
\fi
\to \everystartdocument
+%D This can replace the older (rather unknown) attachment feature because it
+%D is more immediate (same run). I can also use this then for manuals.
+%D
+%D \setuptagging[state=start] % mandate here
+%D
+%D \starttyping
+%D \startmathexport % [buffer=yes]
+%D test $ x = 1 + a $ test
+%D \stopmathexport
+%D
+%D \typebuffer
+%D
+%D \startmathexport[buffer=math]
+%D test $ x = 1 + a^2 $ test
+%D test $ x = 1 + a $ test
+%D test $ x = z + \sqrt{a} $ test
+%D \stopmathexport
+%D
+%D \typebuffer[math]
+%D
+%D \startmathexport[filename=foo.xml]
+%D test $ x = z + \sqrt{a} $ test
+%D \stopmathexport
+%D
+%D \dorecurse{\collectedmath} {\page \collectedmath #1 \page}
+%D \stoptyping
+%D
+%D This one also does buffers and files:
+%D
+%D \starttyping
+%D \startboxexport
+%D \startparagraph
+%D \input tufte
+%D \stopparagraph
+%D \startitemize
+%D \startitem item one \stopitem
+%D \startitem item two \stopitem
+%D \stopitemize
+%D \startparagraph
+%D \input tufte
+%D \stopparagraph
+%D \stopboxexport
+%D
+%D \typebuffer
+%D \stoptyping
+
+\installcorenamespace {boxexport}
+\installcorenamespace {mathexport}
+
+\installsetuponlycommandhandler \??boxexport {boxexport}
+\installsetuponlycommandhandler \??mathexport {mathexport}
+
+% \permanent\tolerant\protected\def\startboxexport[#1]%
+% {\dowithnextbox{\strc_export_box{#1}}\vbox\bgroup}
+%
+% \permanent\protected\def\stopboxexport
+% {\egroup}
+%
+% \def\strc_export_box#1%
+% {\ctxlua{buffers.assign("#1",structures.tags.exportbox(\number\nextbox))}}
+
+\permanent\tolerant\protected\def\startboxexport[#1]%
+ {\begingroup
+ \iftok{#1}\emptytoks
+ \letboxexportparameter\c!buffer\v!yes
+ \orelse\ifhastok={#1}\relax
+ \setupmathexport[#1]%
+ \else
+ \setboxexportparameter\c!buffer{#1}%
+ \fi
+ \setbox\nextbox\vbox\bgroup}
+
+\permanent\protected\def\stopboxexport
+ {\egroup
+ \clf_exportbox \nextbox
+ {\boxexportparameter\c!file}%
+ {\boxexportparameter\c!buffer}%
+ \endgroup}
+
+\permanent\tolerant\protected\def\startmathexport[#1]%
+ {\begingroup
+ \iftok{#1}\emptytoks
+ \letboxexportparameter\c!buffer\v!yes
+ \orelse\ifhastok={#1}\relax
+ \setupmathexport[#1]%
+ \else
+ \setboxexportparameter\c!buffer{#1}%
+ \fi
+ \clf_startcollectingmath}
+
+\permanent\protected\def\stopmathexport
+ {\clf_stopcollectingmath
+ \clf_processcollectedmath
+ {\boxexportparameter\c!file}
+ {\boxexportparameter\c!buffer}%
+ \endgroup}
+
+% Defined at the \LUA\ end:
+%
+% \the\collectedmath : number of snippets
+% \collectedmath n : specific snippet
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-lua.lmt b/Master/texmf-dist/tex/context/base/mkxl/back-imp-lua.lmt
index dc836f12bb3..5bb23973cb0 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/back-lua.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/back-imp-lua.lmt
@@ -1,7 +1,7 @@
-if not modules then modules = { } end modules ['back-lua'] = {
+if not modules then modules = { } end modules ['back-imp-lua'] = {
version = 1.001,
optimize = true,
- comment = "companion to lpdf-ini.mkiv",
+ comment = "companion to back-imp-lua.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -41,6 +41,7 @@ local used = { }
local shapes = { }
local glyphs = { }
local buffer = { }
+local metadata = nil
local b = 0
local converter = nil
@@ -65,25 +66,11 @@ local function reset()
end
local function result()
- -- todo: we're now still in the pdf backend but need different codeinjections
- local codeinjections = backends.pdf.codeinjections
- local getvariable = codeinjections.getidentityvariable or function() end
- local jobname = environment.jobname or tex.jobname or "unknown"
return {
- metadata = {
- unit = "bp",
- jobname = jobname,
- title = getvariable("title") or jobname,
- subject = getvariable("subject"),
- author = getvariable("author"),
- keywords = getvariable("keywords"),
- time = os.date("%Y-%m-%d %H:%M"),
- engine = environment.luatexengine .. " " .. environment.luatexversion,
- context = environment.version,
- },
- fonts = fonts,
- pages = pages,
- shapes = shapes,
+ metadata = metadata,
+ fonts = fonts,
+ pages = pages,
+ shapes = shapes,
}
end
@@ -106,6 +93,9 @@ end
local function prepare(driver)
converter = drivers.converters.lmtx
+ -- if not environment.initex then
+ backends.initialize("lua")
+ -- end
luatex.registerstopactions(1,function()
save()
end)
@@ -128,6 +118,23 @@ local function finalize(driver,details)
b[4] * bpfactor,
},
}
+ if not metadata then
+ -- this has to happen while we're still running tex because we do
+ -- prerolls
+ local identity = interactions.general.getidentity()
+ local jobname = environment.jobname or tex.jobname or "unknown"
+ metadata = {
+ unit = "bp",
+ jobname = jobname,
+ title = identity.title,
+ subject = identity.subject,
+ author = identity.author,
+ keywords = identity.keywords,
+ time = os.date("%Y-%m-%d %H:%M"),
+ engine = environment.luatexengine .. " " .. environment.luatexversion,
+ context = environment.version,
+ }
+ end
end
local function wrapup(driver)
@@ -195,7 +202,7 @@ local function flushcharacter(current, pos_h, pos_v, pos_r, font, char)
end
end
-local function rule(pos_h, pos_v, pos_r, size_h, size_v, rule_s, rule_o)
+local function flush_rule(current, pos_h, pos_v, pos_r, size_h, size_v, rule_s, rule_o)
b = b + 1
buffer[b] = {
t = "rule" ~= t and "rule" or nil,
@@ -218,23 +225,22 @@ end
local function flushrule(current, pos_h, pos_v, pos_r, size_h, size_v, subtype)
local rule_s, rule_o
if subtype == normalrule_code then
- rule_s = "normal"
+ rule_s = normal_rule_code
elseif subtype == outlinerule_code then
- rule_s = "outline"
+ rule_s = outline_rule_code
rule_o = getdata(current)
else
return
end
- return rule(pos_h, pos_v, pos_r, size_h, size_v, rule_s, rule_o)
+ return flush_rule(pos_h, pos_v, pos_r, size_h, size_v, rule_s, rule_o)
end
local function flushsimplerule(pos_h, pos_v, pos_r, size_h, size_v)
- return rule(pos_h, pos_v, pos_r, size_h, size_v, "normal", nil)
+ return flush_rule(false,pos_h,pos_v,pos_r,size_h,size_v,normalrule_code,nil)
end
local function flushspecialrule(pos_h, pos_v, pos_r, w, h, d, l, outline)
- -- no l support yet
- return rule(pos_h, pos_v - d, pos_r, w, h + d, outline and "outline" or "normal")
+ return flush_rule(false,pos_h,pos_v-d,pos_r,w,h+d,outline and outlinerule_code or normalrule_code)
end
-- file stuff too
@@ -296,11 +302,13 @@ drivers.install {
name = "json",
actions = {
prepare = prepare,
- initialize = initialize,
- finalize = finalize,
wrapup = wrapup,
cleanup = cleanup,
+ --
+ initialize = initialize,
convert = convert,
+ finalize = finalize,
+ --
outputfilename = outputfilename,
},
flushers = {
@@ -309,6 +317,7 @@ drivers.install {
rule = flushrule,
simplerule = flushsimplerule,
specialrule = flushspecialrule,
+ setstate = function() end,
}
}
@@ -338,6 +347,9 @@ end
local function prepare(driver)
converter = drivers.converters.lmtx
+ -- if not environment.initex then
+ backends.initialize("js")
+ -- end
luatex.registerstopactions(1,function()
save()
end)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-lua.mkxl b/Master/texmf-dist/tex/context/base/mkxl/back-imp-lua.mkxl
index 0fb1bcc88ef..64112384211 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/back-lua.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/back-imp-lua.mkxl
@@ -1,5 +1,5 @@
%D \module
-%D [ file=back-lua,
+%D [ file=back-imp-lua,
%D version=2018.07.26,
%D title=\CONTEXT\ Backend Macros,
%D subtitle=\LUA,
@@ -11,6 +11,6 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\registerctxluafile{back-lua}{autosuffix,optimize}
+\registerctxluafile{back-imp-lua}{autosuffix}
\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-mps.lmt b/Master/texmf-dist/tex/context/base/mkxl/back-imp-mps.lmt
index 4a2a573c459..05d7c4a638c 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/back-mps.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/back-imp-mps.lmt
@@ -1,7 +1,7 @@
-if not modules then modules = { } end modules ['back-mps'] = {
+if not modules then modules = { } end modules ['back-imp-mps'] = {
version = 1.001,
optimize = true,
- comment = "companion to lpdf-ini.mkiv",
+ comment = "companion to back-imp-mps.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
@@ -40,6 +40,8 @@ local function reset()
b = 0
end
+-- todo: high efficient helpers:
+
local f_font = formatters[ "\\definefont[%s][file:%s*none @ %sbp]\n" ]
local f_glyph = formatters[ [[draw textext.drt("\%s\char%i\relax") shifted (%N,%N);]] ]
@@ -77,6 +79,9 @@ end
local function prepare(driver)
converter = drivers.converters.lmtx
+ -- if not environment.initex then
+ backends.initialize("mps")
+ -- end
luatex.registerstopactions(1,function()
save()
end)
@@ -122,12 +127,12 @@ local function updatefontstate(id)
end
end
-local function flushcharacter(current, pos_h, pos_v, pod_r, font, char)
+local function flushcharacter(current, pos_h, pos_v, pos_r, font, char)
b = b + 1
buffer[b] = f_glyph(last,char,pos_h*bpfactor,pos_v*bpfactor)
end
-local function flushrule(current, pos_h, pos_v, pod_r, size_h, size_v, subtype)
+local function flushrule(current, pos_h, pos_v, pos_r, size_h, size_v, subtype)
if subtype == normalrule_code then
b = b + 1
buffer[b] = f_rule(size_h*bpfactor,size_v*bpfactor,pos_h*bpfactor,pos_v*bpfactor)
@@ -137,12 +142,12 @@ local function flushrule(current, pos_h, pos_v, pod_r, size_h, size_v, subtype)
end
end
-local function flushsimplerule(pos_h, pos_v, pod_r, size_h, size_v)
- flush_rule(false,pos_h,pos_v,pod_r,size_h,size_v,normalrule_code)
+local function flushsimplerule(pos_h, pos_v, pos_r, size_h, size_v)
+ flushrule(false,pos_h,pos_v,pos_r,size_h,size_v,normalrule_code)
end
-local function flushspecialrule(pos_h, pos_v, pod_r, w, h, d, l, outline)
- flush_rule(false,pos_h,pos_v-d,pod_r,w,h+d,outline and outlinerule_code or normalrule_code)
+local function flushspecialrule(pos_h, pos_v, pos_r, w, h, d, l, outline)
+ flushrule(false,pos_h,pos_v-d,pos_r,w,h+d,outline and outlinerule_code or normalrule_code)
end
-- installer
diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-mps.mkxl b/Master/texmf-dist/tex/context/base/mkxl/back-imp-mps.mkxl
index d4d428d4203..bda05370665 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/back-mps.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/back-imp-mps.mkxl
@@ -1,5 +1,5 @@
%D \module
-%D [ file=back-mps,
+%D [ file=back-imp-mps,
%D version=2018.07.26,
%D title=\CONTEXT\ Backend Macros,
%D subtitle=\METAPOST,
@@ -11,6 +11,6 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\registerctxluafile{back-mps}{autosuffix,optimize}
+\registerctxluafile{back-imp-mps}{autosuffix}
\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-imp-pdf.lmt b/Master/texmf-dist/tex/context/base/mkxl/back-imp-pdf.lmt
new file mode 100644
index 00000000000..a57427e664d
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/back-imp-pdf.lmt
@@ -0,0 +1,49 @@
+if not modules then modules = { } end modules ['back-imp-pdf'] = {
+ version = 1.001,
+ comment = "companion to back-imp-pdf.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- We hide the pdf table from users so that we can guarantee no interference with
+-- the way we manage resources, info, etc. Users should use the \type {lpdf}
+-- interface instead. For now we have a little for tikz. If really needed some more
+-- can be made accessible but it has to happen in a controlled way then, for
+-- instance by first loading or enabling some compatibility layer so that we can
+-- trace possible interferences.
+
+updaters.register("backends.pdf.latebindings",function()
+ --
+ local dummy = function() end
+ local report = logs.reporter("backend")
+ --
+ -- For now we keep this for tikz. If really needed some more can be made
+ -- accessible but it has to happen in a controlled way then, for instance
+ -- by first loading or enabling some compatibility layer so that we can
+ -- trace possible interferences.
+ --
+ pdf = {
+ immediateobj = lpdf.immediateobject
+ }
+
+ table.setmetatableindex(pdf,function(t,k)
+ report("calling unavailable pdf.%s function",k)
+ t[k] = dummy
+ return dummy
+ end)
+
+end)
+
+-- The compression setter is defined here because it's probably the only macro
+-- that is used independent of a driver being chosen. It's easier this way than
+-- checking in other ways unless we add some generic compression setting to
+-- all drivers.
+
+interfaces.implement {
+ name = "setpdfcompression",
+ arguments = { "integer", "integer" },
+ actions = lpdf.setcompression,
+}
+
+-- The pdf driver itself is installed in lpdf-lmt.lmt!
diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-imp-pdf.mkxl b/Master/texmf-dist/tex/context/base/mkxl/back-imp-pdf.mkxl
new file mode 100644
index 00000000000..f2afe61daff
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/back-imp-pdf.mkxl
@@ -0,0 +1,160 @@
+%D \module
+%D [ file=back-imp-pdf,
+%D version=2009.04.15,
+%D title=\CONTEXT\ Backend Macros,
+%D subtitle=\PDF,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%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 less there is here, the better. After a decade it is time to remove the \type
+%D {\pdf*} ones completely. For the moment I keep them commented but even that will
+%D go away.
+
+%D Todo: a few delayed binding left:
+
+% ./lpdf-ini.lmt : reserve | immediate | positions | matrix | pos | fontobject
+% ./lpdf-lmt.lmt : fontname | object | boxresources
+% ./lpdf-rul.lmt : mp stuff
+% ./back-res.lmt : boxresources
+
+\writestatus{loading}{ConTeXt Backend Macros / PDF}
+
+% \registerctxluafile{back-imp-pdf}{autosuffix} % some code will move to lpdf-*
+
+\registerctxluafile{lpdf-ini}{autosuffix}
+\registerctxluafile{lpdf-lmt}{autosuffix}
+\registerctxluafile{lpdf-col}{autosuffix}
+\registerctxluafile{lpdf-xmp}{autosuffix}
+\registerctxluafile{lpdf-ano}{autosuffix}
+\registerctxluafile{lpdf-mis}{autosuffix}
+\registerctxluafile{lpdf-ren}{autosuffix}
+\registerctxluafile{lpdf-grp}{autosuffix}
+\registerctxluafile{lpdf-wid}{autosuffix}
+\registerctxluafile{lpdf-fld}{autosuffix}
+\registerctxluafile{lpdf-tag}{autosuffix}
+\registerctxluafile{lpdf-fmt}{autosuffix}
+\registerctxluafile{lpdf-pde}{autosuffix}
+\registerctxluafile{lpdf-img}{autosuffix}
+\registerctxluafile{lpdf-epa}{autosuffix}
+\registerctxluafile{lpdf-emb}{autosuffix}
+\registerctxluafile{lpdf-fnt}{autosuffix}
+\registerctxluafile{lpdf-rul}{autosuffix}
+
+\registerctxluafile{back-imp-pdf}{autosuffix} % some code will move to lpdf-*
+\registerctxluafile{back-imp-pdp}{autosuffix}
+
+% \registerctxluafile{lpdf-u3d}{autosuffix}
+
+\loadmkxlfile{back-imp-u3d}
+
+\unprotect
+
+%D We will minimize the number of calls to \PDF\ specific primitives and delegate
+%D all management and injection of code to the backend.
+%D
+%D Because we do a lot in \LUA\ and don't want interferences, we nil most of the
+%D \PDFTEX\ primitives. Of course one can always use the \type {\pdfvariable},
+%D \type {\pdfextension} and \type {\pdffeedback} primitives but it will probably
+%D have bad side effects. We fake them as primitives which is why they are
+%D defined as untraced.
+
+% \pdfextension % defined in lua
+% \pdffeedback % idem
+% \pdfvariable % idem
+% \pdfliteral % idem
+% \pdfobj % idem
+% \pdflastobj % idem
+% \pdfrefobj % idem
+
+\untraced\permanent\protected\def\pdfrestore {\pdfextension restore}
+\untraced\permanent\protected\def\pdfsave {\pdfextension save}
+\untraced\permanent\protected\def\pdfsetmatrix{\pdfextension setmatrix}
+
+\untraced\permanent\def\pdfxform {\saveboxresource}
+\untraced\permanent\def\pdflastxform {\lastsavedboxresourceindex}
+\untraced\permanent\def\pdfrefxform {\useboxresource}
+
+%D This is also needed for tikz:
+
+\ifdefined\pdfsavepos\else
+ \untraced\permanent\def\pdfsavepos {\savepos }
+ \untraced\permanent\def\pdflastxpos{\lastxpos}
+ \untraced\permanent\def\pdflastypos{\lastypos}
+\fi
+
+%D Here are quick and dirty compression flippers, mostly used when testing something
+%D as one can best stick to the defaults that also adapt to specific standards.
+
+\untraced\permanent\protected\def\nopdfcompression {\clf_setpdfcompression\zerocount\zerocount}
+\untraced\permanent\protected\def\onlypdfobjectcompression{\clf_setpdfcompression\plusthree\zerocount}
+\untraced\permanent\protected\def\maximumpdfcompression {\clf_setpdfcompression\plusnine \plusnine }
+\untraced\permanent\protected\def\normalpdfcompression {\clf_setpdfcompression\plusthree\plusthree}
+
+%D PDF/X (maybe combine the two lua calls)
+
+\setupbackend
+ [xmpfile=]
+
+\appendtoks
+ \edef\p_file{\backendparameter{xmpfile}}%
+ \ifempty\p_file\else
+ \clf_setxmpfile{\p_file}%
+ \fi
+\to \everysetupbackend
+
+%D This will change:
+
+\appendtoks
+ \clf_setformat
+ format {\backendparameter\c!format}%
+ level {\backendparameter\c!level}%
+ option {\backendparameter\c!option}%
+ profile {\backendparameter\c!profile}%
+ intent {\backendparameter\c!intent}%
+ file {\backendparameter\c!file}%
+ \relax
+\to \everysetupbackend
+
+%D These are the only official methods to add stuff to the resources. If more is
+%D needed for third party low level code, it can be added.
+
+% \pdfbackendsetcatalog #1#2 % defined in lua
+% \pdfbackendsetinfo #1#2 % idem
+% \pdfbackendsetname #1#2 % idem
+%
+% \pdfbackendsetpageattribute #1#2 % idem
+% \pdfbackendsetpagesattribute#1#2 % idem
+% \pdfbackendsetpageresource #1#2 % idem
+%
+% \pdfbackendsetextgstate #1#2 % idem
+% \pdfbackendsetcolorspace #1#2 % idem
+% \pdfbackendsetpattern #1#2 % idem
+% \pdfbackendsetshade #1#2 % idem
+%
+% \pdfbackendcurrentresources % idem, expandable
+% \pdfcolor #1 % idem, expandable
+
+%D This is a temporary hack that will be removed, improved or somehow can become
+%D default.
+
+\permanent\def\TransparencyHack{\setupcolors[\c!pagecolormodel=\v!auto]}
+
+%D Just in case one needs this \unknown:
+%D
+%D \starttyping
+%D text \pdfbackendactualtext{Meier}{Müller} text
+%D \stoptyping
+
+\untraced\permanent\protected\def\pdfbackendactualtext#1#2% not interfaced
+ {\clf_startactualtext{#2}%
+ #1%
+ \clf_stopactualtext}
+
+\aliased\let\pdfactualtext\pdfbackendactualtext
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-pdp.lmt b/Master/texmf-dist/tex/context/base/mkxl/back-imp-pdp.lmt
index 1b3a1700790..6b5a0edf937 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/back-pdp.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/back-imp-pdp.lmt
@@ -1,54 +1,50 @@
-if not modules then modules = { } end modules ['back-pdp'] = {
+if not modules then modules = { } end modules ['back-imp-pdp'] = {
version = 1.001,
- comment = "companion to lpdf-ini.mkiv",
+ comment = "companion to back-imp-pdf.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
--- This is temporary ... awaiting a better test .. basically we can
--- always use this: pdf primitives.
+-- We don't support late literals unless it's really needed by some third party
+-- code.
local context = context
local lpdf = lpdf
-local pdfreserveobject
-local pdfcompresslevel
-local pdfobject
-local pdfpagereference
-local pdfgetxformname
-local pdfminorversion
-local pdfmajorversion
-
-updaters.register("backend.update.lpdf",function()
- pdfreserveobject = lpdf.reserveobject
- pdfcompresslevel = lpdf.compresslevel
- pdfobject = lpdf.object
- pdfpagereference = lpdf.pagereference
- pdfgetxformname = lpdf.getxformname
- pdfminorversion = lpdf.minorversion
- pdfmajorversion = lpdf.majorversion
-end)
-
-local tokenscanners = tokens.scanners
-local scanword = tokenscanners.word
-local scankeyword = tokenscanners.keyword
-local scanstring = tokenscanners.string
-local scaninteger = tokenscanners.integer
-local scanwhd = tokenscanners.whd
-
-local trace = false trackers.register("backend", function(v) trace = v end)
-local report = logs.reporter("backend")
-
-local nodepool = nodes.pool
-local newliteral = nodepool.literal
-local newsave = nodepool.save
-local newrestore = nodepool.restore
-local newsetmatrix = nodepool.setmatrix
-
-local implement = interfaces.implement
-local constants = interfaces.constants
-local variables = interfaces.variables
+local pdfreserveobject = lpdf.reserveobject
+local pdfcompresslevel = lpdf.compresslevel
+local pdfobject = lpdf.object
+local pdfpagereference = lpdf.pagereference
+local pdfgetxformname = lpdf.getxformname
+local pdfminorversion = lpdf.minorversion
+local pdfmajorversion = lpdf.majorversion
+
+local tokenscanners = tokens.scanners
+local scanword = tokenscanners.word
+local scankeyword = tokenscanners.keyword
+local scanstring = tokenscanners.string
+local scaninteger = tokenscanners.integer
+local scanwhd = tokenscanners.whd
+
+local values = tokens.values
+local dimension_value = values.dimension
+local cardinal_value = values.cardinal
+
+local immediate_code = tex.flagcodes.immediate
+
+local trace = false trackers.register("backend.primitives", function(v) trace = v end)
+local report = logs.reporter("backend")
+
+local nodepool = nodes.pool
+local newliteral = nodepool.literal
+local newsave = nodepool.save
+local newrestore = nodepool.restore
+local newsetmatrix = nodepool.setmatrix
+
+local implement = interfaces.implement
+local constants = interfaces.constants
+local variables = interfaces.variables
-- literals
@@ -60,14 +56,14 @@ end
local lastobjnum = 0
-local function pdf_obj()
+local function pdf_obj(prefix)
if scankeyword("reserveobjnum") then
lastobjnum = pdfreserveobject()
if trace then
report("\\pdfobj reserveobjnum: object %i",lastobjnum)
end
else
- local immediate = true
+ local immediate = prefix and (prefix & immediate_code) ~= 0 -- was just "true"
local objnum = scankeyword("useobjnum") and scaninteger() or pdfreserveobject()
local uncompress = scankeyword("uncompressed") or pdfcompresslevel() == 0
local streamobject = scankeyword("stream")
@@ -100,10 +96,14 @@ local function pdf_obj()
end
local function pdf_lastobj()
- context("%i",lastobjnum)
if trace then
report("\\lastobj: object %i",lastobjnum)
end
+ return cardinal_value, lastobjnum
+end
+
+local function pdf_pagereference()
+ return cardinal_value, pdfpagereference()
end
local function pdf_refobj()
@@ -213,7 +213,7 @@ local extensions = {
}
local function pdf_extension()
- local w = scanword()
+ local w = scanword(false)
if w then
local e = extensions[w]
if e then
@@ -228,17 +228,17 @@ end
-- lastlink lastobj pageref retval revision version xformname
local feedbacks = {
- lastobj = pdf_lastobj,
- pageref = function() context(pdfpagereference()) end,
- xformname = function() context(pdfgetxformname ()) end,
+ lastobj = pdf_lastobj,
+ pageref = pdf_pagereference,
+ xformname = function() context(pdfgetxformname ()) end,
}
local function pdf_feedback()
- local w = scanword()
+ local w = scanword(false)
if w then
local f = feedbacks[w]
if f then
- f()
+ return f()
else
report("\\pdffeedback: unsupported %a",w)
end
@@ -259,7 +259,7 @@ local variables = {
}
local function pdf_variable()
- local w = scanword()
+ local w = scanword(false)
if w then
local f = variables[w]
if f then
@@ -272,20 +272,18 @@ local function pdf_variable()
end
end
--- kept:
-
-implement { name = "pdfextension", actions = pdf_extension }
-implement { name = "pdffeedback", actions = pdf_feedback }
-implement { name = "pdfvariable", actions = pdf_variable }
-
--- for the moment (tikz)
-
-implement { name = "pdfliteral", actions = pdf_literal }
-implement { name = "pdfobj", actions = pdf_obj }
-implement { name = "pdflastobj", actions = pdf_lastobj }
-implement { name = "pdfrefobj", actions = pdf_refobj }
---------- { name = "pdfannot", actions = pdf_annot }
---------- { name = "pdfdest", actions = pdf_dest }
---------- { name = "pdfsave", actions = pdf_save }
---------- { name = "pdfrestore", actions = pdf_restore }
---------- { name = "pdfsetmatrix", actions = pdf_setmatrix }
+-- kept (also because tikz needs including the pdftex primitives):
+
+implement { name = "pdfextension", actions = pdf_extension, public = true, untraced = true } -- , protected = true }
+implement { name = "pdffeedback", actions = pdf_feedback, public = true, usage = "value", untraced = true } -- expandable / todo : value
+implement { name = "pdfvariable", actions = pdf_variable, public = true, untraced = true } -- expandable / todo : value
+implement { name = "pdfliteral", actions = pdf_literal, public = true, untraced = true, protected = true }
+implement { name = "pdfobj", actions = pdf_obj, public = true, usage = "value", protected = true }
+implement { name = "pdflastobj", actions = pdf_lastobj, public = true, usage = "value", protected = true }
+implement { name = "pdfrefobj", actions = pdf_refobj, public = true, untraced = true, protected = true }
+
+--------- { name = "pdfannot", actions = pdf_annot }
+--------- { name = "pdfdest", actions = pdf_dest }
+--------- { name = "pdfsave", actions = pdf_save }
+--------- { name = "pdfrestore", actions = pdf_restore }
+--------- { name = "pdfsetmatrix", actions = pdf_setmatrix }
diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-u3d.mkxl b/Master/texmf-dist/tex/context/base/mkxl/back-imp-u3d.mkxl
index 297dd554579..e91ef485f75 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/back-u3d.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/back-imp-u3d.mkxl
@@ -1,5 +1,5 @@
%D \module
-%D [ file=back-u3d,
+%D [ file=back-imp-u3d,
%D version=2009.04.15,
%D title=\CONTEXT\ Backend Macros,
%D subtitle=U3D Experiment,
@@ -15,6 +15,8 @@
%D user interface is rather messy an might be improved. The files and setup is
%D derived from an example by Michael Vidiassov.
+\registerctxluafile{lpdf-u3d}{autosuffix}
+
\endinput
\starttext
diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/back-ini.lmt
index 92270574249..110a1b3dc2e 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/back-ini.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/back-ini.lmt
@@ -53,7 +53,7 @@ local defaults = {
tables = tables,
}
-backends.defaults = defaults
+backends.defaults = defaults -- so, when not in the specific namespace we need to register here (to be checked)
backends.nodeinjections = { } setmetatableindex(backends.nodeinjections, nodeinjections)
backends.codeinjections = { } setmetatableindex(backends.codeinjections, codeinjections)
@@ -62,24 +62,42 @@ backends.tables = { } setmetatableindex(backends.tables, tables
backends.current = "unknown"
-function backends.install(what)
+local registered = table.setmetatableindex(function(t,k)
+ local v = {
+ name = k,
+ nodeinjections = { },
+ codeinjections = { },
+ registrations = { },
+ tables = { },
+ }
+ t[k] = v
+ return v
+end)
+
+backends.registered = registered
+
+-- The binding feature is mostly there to prevent side effects of overloading
+-- not so much for performance because there are not that many calls.
+
+function backends.initialize(what)
if type(what) == "string" then
- local backend = backends[what]
+ local backend = registered[what]
if backend then
if trace then
- if backend.comment then
- report("initializing backend %a, %a",what,backend.comment)
- else
- report("initializing backend %a",what)
- end
+ report("initializing backend %a",what)
end
- backends.current = what
for category, default in next, defaults do
local target = backends[category]
local plugin = backend [category]
setmetatableindex(plugin, default)
setmetatableindex(target, plugin)
end
+ --
+ backends.current = what
+ -- delayed / out-of-order locals: like lpdf.* (a few forward references)
+ updaters.apply("backends." .. what .. ".latebindings")
+ -- delayed / out-of-order locals: backends.[c|n]odeinjections.* (not all, only critical ones)
+ updaters.apply("backends.injections.latebindings")
elseif trace then
report("no backend named %a",what)
end
@@ -88,11 +106,7 @@ end
statistics.register("used backend", function()
local bc = backends.current
- if bc ~= "unknown" then
- return format("%s (%s)",bc,backends[bc].comment or "no comment")
- else
- return nil
- end
+ return bc ~= "unknown" and bc or nil
end)
-- can best be here
@@ -125,3 +139,9 @@ backends.included = included
function backends.getcallbackstate()
return { count = status.late_callbacks or 0 }
end
+
+--
+
+function backends.setencryption(specification)
+ codeinjections.setencryption(specification)
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/back-ini.mkxl
index fad9c1e709d..8a4b9d894ac 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/back-ini.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/back-ini.mkxl
@@ -50,6 +50,13 @@
\clf_setrealspaces{\backendparameter\c!space}%
\to \everysetupbackend
+\appendtoks
+ \clf_setsofthyphens{\backendparameter\c!hyphen}%
+\to \everysetupbackend
+
+\setupbackend
+ [\c!hyphen=\v!yes]
+
%D For the moment this is an experiment (defauls is pdf, but we also
%D have lua, json and mps).
%D
diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-pdf.lmt b/Master/texmf-dist/tex/context/base/mkxl/back-pdf.lmt
deleted file mode 100644
index 44d0230bdd6..00000000000
--- a/Master/texmf-dist/tex/context/base/mkxl/back-pdf.lmt
+++ /dev/null
@@ -1,55 +0,0 @@
-if not modules then modules = { } end modules ['back-pdf'] = {
- version = 1.001,
- comment = "companion to back-pdf.mkiv",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files"
-}
-
--- We hide the pdf table from users so that we can guarantee no interference with
--- the way we manage resources, info, etc. Users should use the \type {lpdf}
--- interface instead. If needed I will provide replacement functionality.
-
-local setmetatableindex = table.setmetatableindex
-
-local pdfsetcompression
-local pdfimmediateobject
-
-updaters.register("backend.update.lpdf",function()
- pdfsetcompression = lpdf.setcompression
- pdfimmediateobject = lpdf.immediateobject
-end)
-
-interfaces.implement {
- name = "setpdfcompression",
- arguments = { "integer", "integer" },
- actions = function(...) pdfsetcompression(...) end,
-}
-
-do
-
- local dummy = function() end
- local report = logs.reporter("backend")
-
- local function unavailable(t,k)
- report("calling unavailable pdf.%s function",k)
- t[k] = dummy
- return dummy
- end
-
- updaters.register("backend.update",function()
- --
- -- For now we keep this for tikz. If really needed some more can be made
- -- accessible but it has to happen in a controlled way then, for instance
- -- by first loading or enabling some compatibility layer so that we can
- -- trace possible interferences.
- --
- pdf = {
- immediateobj = pdfimmediateobject
- }
- setmetatableindex(pdf,unavailable)
- end)
-
-end
-
-backends.install("pdf")
diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-pdf.mkxl b/Master/texmf-dist/tex/context/base/mkxl/back-pdf.mkxl
deleted file mode 100644
index d59c29bc01c..00000000000
--- a/Master/texmf-dist/tex/context/base/mkxl/back-pdf.mkxl
+++ /dev/null
@@ -1,157 +0,0 @@
-%D \module
-%D [ file=back-pdf,
-%D version=2009.04.15,
-%D title=\CONTEXT\ Backend Macros,
-%D subtitle=\PDF,
-%D author=Hans Hagen,
-%D date=\currentdate,
-%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
-%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 less there is here, the better. After a decade it is time to remove the \type
-%D {\pdf*} ones completely. For the moment I keep them commented but even that will
-%D go away.
-
-\writestatus{loading}{ConTeXt Backend Macros / PDF}
-
-\registerctxluafile{lpdf-ini}{autosuffix,optimize}
-\registerctxluafile{lpdf-lmt}{autosuffix,optimize}
-\registerctxluafile{lpdf-col}{autosuffix}
-\registerctxluafile{lpdf-xmp}{autosuffix}
-\registerctxluafile{lpdf-ano}{autosuffix}
-\registerctxluafile{lpdf-res}{autosuffix}
-\registerctxluafile{lpdf-mis}{autosuffix}
-\registerctxluafile{lpdf-ren}{autosuffix}
-\registerctxluafile{lpdf-grp}{autosuffix}
-\registerctxluafile{lpdf-wid}{autosuffix}
-\registerctxluafile{lpdf-fld}{autosuffix}
-\registerctxluafile{lpdf-mov}{autosuffix}
-\registerctxluafile{lpdf-u3d}{autosuffix} % this will become a module
-%registerctxluafile{lpdf-swf}{} % this will become a module
-\registerctxluafile{lpdf-tag}{autosuffix}
-\registerctxluafile{lpdf-fmt}{autosuffix}
-\registerctxluafile{lpdf-pde}{autosuffix}
-\registerctxluafile{lpdf-img}{autosuffix,optimize}
-\registerctxluafile{lpdf-epa}{autosuffix}
-\registerctxluafile{lpdf-emb}{autosuffix,optimize}
-\registerctxluafile{lpdf-fnt}{autosuffix}
-\registerctxluafile{lpdf-rul}{autosuffix}
-
-\registerctxluafile{back-pdp}{autosuffix}
-\registerctxluafile{back-pdf}{autosuffix} % some code will move to lpdf-*
-
-\loadmkxlfile{back-u3d} % this will become a module
-%loadmkxlfile{back-swf} % this will become a module
-
-\unprotect
-
-%D We will minimize the number of calls to \PDF\ specific primitives and delegate
-%D all management and injection of code to the backend.
-%D
-%D Because we do a lot in \LUA\ and don't want interferences, we nil most of the
-%D \PDFTEX\ primitives. Of course one can always use the \type {\pdfvariable},
-%D \type {\pdfextension} and \type {\pdffeedback} primitives but it will probably
-%D have bad side effects.
-
-\permanent\protected\def\pdfextension{\clf_pdfextension}
-\permanent \def\pdffeedback {\clf_pdffeedback}
-\permanent \def\pdfvariable {\clf_pdfvariable}
-
-%D For the moment we keep this for tikz but hopefully it will at some point use
-%D the proper ones. Consider them obsolete:
-
-\permanent\protected\def\pdfliteral {\clf_pdfliteral}
-\permanent\protected\def\pdfobj {\clf_pdfobj}%
-\permanent\protected\def\pdflastobj {\numexpr\clf_pdflastobj\relax}
-\permanent\protected\def\pdfrefobj {\clf_pdfrefobj}
-
-\permanent\protected\def\pdfrestore {\pdfextension restore}
-\permanent\protected\def\pdfsave {\pdfextension save}
-\permanent\protected\def\pdfsetmatrix{\pdfextension setmatrix}
-
-\permanent\let\pdfxform \saveboxresource
-\permanent\let\pdflastxform\lastsavedboxresourceindex
-\permanent\let\pdfrefxform \useboxresource
-
-%D Here are quick and dirty compression flippers, mostly used when testing something
-%D as one can best stick to the defaults that also adapt to specific standards.
-
-\permanent\protected\def\nopdfcompression {\clf_setpdfcompression\zerocount\zerocount}
-\permanent\protected\def\onlypdfobjectcompression{\clf_setpdfcompression\zerocount\plusthree}
-\permanent\protected\def\maximumpdfcompression {\clf_setpdfcompression\plusnine \plusnine }
-\permanent\protected\def\normalpdfcompression {\clf_setpdfcompression\plusthree\plusthree}
-
-%D PDF/X (maybe combine the two lua calls)
-
-\setupbackend
- [xmpfile=]
-
-\appendtoks
- \edef\p_file{\backendparameter{xmpfile}}%
- \ifempty\p_file\else
- \clf_setxmpfile{\p_file}%
- \fi
-\to \everysetupbackend
-
-%D This will change:
-
-\appendtoks
- \clf_setformat
- format {\backendparameter\c!format}%
- level {\backendparameter\c!level}%
- option {\backendparameter\c!option}%
- profile {\backendparameter\c!profile}%
- intent {\backendparameter\c!intent}%
- file {\backendparameter\c!file}%
- \relax
-\to \everysetupbackend
-
-%D These are the only official methods to add stuff to the resources. If more is
-%D needed for third party low level code, it can be added.
-
-\permanent\protected\def\pdfbackendsetcatalog #1#2{\clf_lpdf_addtocatalog{#1}{#2}}
-\permanent\protected\def\pdfbackendsetinfo #1#2{\clf_lpdf_addtoinfo{#1}{#2}}
-\permanent\protected\def\pdfbackendsetname #1#2{\clf_lpdf_addtonames{#1}{#2}}
-
-\permanent\protected\def\pdfbackendsetpageattribute #1#2{\clf_lpdf_addtopageattributes{#1}{#2}}
-\permanent\protected\def\pdfbackendsetpagesattribute#1#2{\clf_lpdf_addtopagesattributes{#1}{#2}}
-\permanent\protected\def\pdfbackendsetpageresource #1#2{\clf_lpdf_addtopageresources{#1}{#2}}
-
-\permanent\protected\def\pdfbackendsetextgstate #1#2{\clf_lpdf_adddocumentextgstate{#1}{#2}}
-\permanent\protected\def\pdfbackendsetcolorspace #1#2{\clf_lpdf_adddocumentcolorspace{#1}{#2}}
-\permanent\protected\def\pdfbackendsetpattern #1#2{\clf_lpdf_adddocumentpattern{#1}{#2}}
-\permanent\protected\def\pdfbackendsetshade #1#2{\clf_lpdf_adddocumentshade{#1}{#2}}
-
-\permanent \def\pdfbackendcurrentresources {\clf_lpdf_collectedresources}
-\permanent \def\pdfcolor #1{\clf_lpdf_color\numexpr\rawcolorattribute{#1}\relax}
-
-%D This is a temporary hack mthat will be removed, improved or somehow can become
-%D default.
-
-\permanent\def\TransparencyHack{\setupcolors[\c!pagecolormodel=\v!auto]}
-
-%D Just in case one needs this \unknown:
-%D
-%D \starttyping
-%D text \pdfbackendactualtext{Meier}{Müller} text
-%D \stoptyping
-
-\permanent\protected\def\pdfbackendactualtext#1#2% not interfaced
- {\clf_startactualtext{#2}%
- #1%
- \clf_stopactualtext}
-
-\aliased\let\pdfactualtext\pdfbackendactualtext
-
-%D Bah, this is also needed for tikz:
-
-\ifdefined\pdfsavepos\else
- \permanent\let\pdfsavepos \savepos
- \permanent\let\pdflastxpos\lastxpos
- \permanent\let\pdflastypos\lastypos
-\fi
-
-\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-res.lmt b/Master/texmf-dist/tex/context/base/mkxl/back-res.lmt
index 3157b37ef61..031e56909e9 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/back-res.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/back-res.lmt
@@ -6,43 +6,49 @@ if not modules then modules = { } end modules ['back-res'] = {
license = "see context related readme files"
}
-local context = context
+local context = context
-local trace = false trackers.register("backend", function(v) trace = v end)
-local report = logs.reporter("backend")
+local trace = false trackers.register("backend", function(v) trace = v end)
+local report = logs.reporter("backend")
-local scanners = tokens.scanners
-local scankeyword = scanners.keyword
-local scaninteger = scanners.integer
-local scanstring = scanners.string
-local scandimension = scanners.dimension
-local scanword = scanners.word
-local scanwhd = scanners.whd
+local scanners = tokens.scanners
+local scankeyword = scanners.keyword
+local scaninteger = scanners.integer
+local scanstring = scanners.string
+local scandimension = scanners.dimension
+local scanword = scanners.word
+local scanwhd = scanners.whd
-local implement = interfaces.implement
-local constants = interfaces.constants
-local variables = interfaces.variables
+local implement = interfaces.implement
+local constants = interfaces.constants
+local variables = interfaces.variables
+
+local values = tokens.values
+----- dimension_value = values.dimension
+local cardinal_value = values.cardinal
+----- direct_value = values.direct
-- A box resource has an index. This happens to be an object number due to the pdf
-- backend but in fact it's an abstraction. This is why we have explicit fetchers.
-- The internal number (as in \Fm123) is yet another number.
-local tex_saveboxresource = tex.saveboxresource
-local tex_useboxresource = tex.useboxresource
-local tex_getboxresourcebox = tex.getboxresourcebox
-local tex_getboxresourcedimensions = tex.getboxresourcedimensions
+-- this will change:
+--
+-- tex.* : arglist, as in luatex
+-- tex.boxresources : table
+
+local codeinjections = backends.codeinjections
+local nodeinjections = backends.nodeinjections
-updaters.register("backend.update",function()
- tex_saveboxresource = tex.saveboxresource
- tex_useboxresource = tex.useboxresource
- tex_getboxresourcebox = tex.getboxresourcebox
- tex_getboxresourcedimensions = tex.getboxresourcedimensions
-end)
+local savebox = function(...) return codeinjections.saveboxresource(...) end
+local usebox = function(...) return nodeinjections.useboxresource(...) end
+local getbox = function(...) return nodeinjections.getboxresourcebox(...) end
+local getwhd = function(...) return codeinjections.getboxresourcedimensions(...) end
-local savebox = function(...) return tex_saveboxresource(...) end
-local usebox = function(...) return tex_useboxresource(...) end
-local getbox = function(...) return tex_getboxresourcebox(...) end
-local getwhd = function(...) return tex_getboxresourcedimensions(...) end
+tex.saveboxresource = savebox
+tex.useboxresource = usebox
+tex.getboxresourcebox = getbox
+tex.getboxresourcedimensions = getwhd
local boxresources = {
save = savebox,
@@ -71,9 +77,10 @@ end
local function lastsavedboxresourceindex()
if trace then
- report("\\lastsaveboxresource: index %i",lastindex)
+ report("\\lastsaveboxresourceindex: index %i",lastindex)
end
- context("%i",lastindex)
+ -- context("%i",lastindex)
+ return cardinal_value, lastindex or 0
end
local function useboxresource()
@@ -86,9 +93,51 @@ local function useboxresource()
context(node)
end
-implement { name = "saveboxresource", actions = saveboxresource }
-implement { name = "lastsavedboxresourceindex", actions = lastsavedboxresourceindex }
-implement { name = "useboxresource", actions = useboxresource }
+implement {
+ name = "saveboxresource",
+ actions = saveboxresource,
+}
+implement {
+ name = "lastsavedboxresourceindex",
+ public = true,
+ usage = "value",
+ actions = lastsavedboxresourceindex,
+}
+implement {
+ name = "useboxresource",
+ actions = useboxresource,
+}
+
+-- used in pack
+
+do
+
+ local nuts = nodes.nuts
+ local tonut = nodes.tonut
+
+ local setwhd = nuts.setwhd
+ local setlist = nuts.setlist
+
+ local new_hlist = nuts.pool.hlist
+
+ function codeinjections.restoreboxresource(index)
+ local hbox = new_hlist()
+ local list, wd, ht, dp = usebox(index)
+ setlist(hbox,tonut(list))
+ setwhd(hbox,wd,ht,dp)
+ return hbox -- so we return a nut !
+ end
+
+ function codeinjections.registerboxresource(n,offset,delay,objnum)
+ local immediate = true
+ if delay == true or delay == 1 then
+ immediate = false
+ end
+ local r = savebox(n,nil,true,immediate,0,offset or 0,objnum)
+ return r
+ end
+
+end
-- image resources
@@ -136,11 +185,13 @@ local function saveimageresource()
end
local function lastsavedimageresourceindex()
- context("%i",lastindex or 0)
+-- context("%i",lastindex or 0)
+ return cardinal_value, lastindex or 0
end
local function lastsavedimageresourcepages()
- context("%i",lastpages or 0) -- todo
+-- context("%i",lastpages or 0) -- todo
+ return cardinal_value, lastpages or 0
end
local function useimageresource()
@@ -171,7 +222,26 @@ local function useimageresource()
end
end
-implement { name = "saveimageresource", actions = saveimageresource }
-implement { name = "lastsavedimageresourceindex", actions = lastsavedimageresourceindex }
-implement { name = "lastsavedimageresourcepages", actions = lastsavedimageresourcepages }
-implement { name = "useimageresource", actions = useimageresource }
+implement {
+ name = "saveimageresource",
+ actions = saveimageresource,
+}
+
+implement {
+ name = "lastsavedimageresourceindex",
+ public = true,
+ usage = "value",
+ actions = lastsavedimageresourceindex,
+}
+
+implement {
+ name = "lastsavedimageresourcepages",
+ public = true,
+ usage = "value",
+ actions = lastsavedimageresourcepages,
+}
+
+implement {
+ name = "useimageresource",
+ actions = useimageresource,
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-res.mkxl b/Master/texmf-dist/tex/context/base/mkxl/back-res.mkxl
index 8a18eef991f..1febef18d30 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/back-res.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/back-res.mkxl
@@ -23,12 +23,12 @@
% todo: public implementors (we can update the lua code anyway)
\permanent\protected\def\saveboxresource {\clf_saveboxresource}
-\permanent\protected\def\lastsavedboxresourceindex {\numexpr\clf_lastsavedboxresourceindex\relax}
+%permanent\protected\def\lastsavedboxresourceindex {\numexpr\clf_lastsavedboxresourceindex\relax}
\permanent\protected\def\useboxresource {\clf_useboxresource}
\permanent\protected\def\saveimageresource {\clf_saveimageresource}
-\permanent\protected\def\lastsavedimageresourceindex{\numexpr\clf_lastsavedimageresourceindex\relax}
-\permanent\protected\def\lastsavedimageresourcepages{\numexpr\clf_lastsavedimageresourcepages\relax}
+%permanent\protected\def\lastsavedimageresourceindex{\numexpr\clf_lastsavedimageresourceindex\relax}
+%permanent\protected\def\lastsavedimageresourcepages{\numexpr\clf_lastsavedimageresourcepages\relax}
\permanent\protected\def\useimageresource {\clf_useimageresource}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/bibl-bib.mkxl b/Master/texmf-dist/tex/context/base/mkxl/bibl-bib.mkxl
index 20aea7bb612..ffdb5b954b1 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/bibl-bib.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/bibl-bib.mkxl
@@ -344,8 +344,8 @@
% variables
-\ifdefined\bibtexblock \else \newcount\bibtexblock \fi \bibtexblock\plusone
-\ifdefined\bibtexcounter \else \newcount\bibtexcounter \fi
+\ifdefined\bibtexblock \else \newinteger\bibtexblock \fi \bibtexblock\plusone
+\ifdefined\bibtexcounter \else \newinteger\bibtexcounter \fi
\newtoks \everysetupbibtexpublications
\newtoks \everysetupbibtexcitations
@@ -450,7 +450,7 @@
\edef\bibtexpublicationsalternative{\@@pbalternative}% parent
\ifempty\bibtexpublicationsalternative \else
\processcommacommand[\bibtexpublicationsalternative]\dodoloadbibtexpublicationalternative
- \let\@@pbalternative\empty
+ \lettonothing\@@pbalternative
\fi
\fi}
@@ -551,7 +551,7 @@
\the\everysetupbibtexlistplacement
\forgetall
\typesetbibtexlist
- \global\advance\bibtexblock\plusone}
+ \global\advanceby\bibtexblock\plusone}
\setvalue{\??pb:\c!numbering:\v!short}#1% todo var s -> short tag
{\bibtexlistnumberbox{\bibtexpublicationsparameter\c!numbercommand{\bibtexgetshort\currentpublicationtag}}}
@@ -580,7 +580,7 @@
\fi
\to \everysetupbibtexlistplacement
-\newdimen\bibtexnumberwidth
+\newdimension\bibtexnumberwidth
\def\bibtexlistnumberbox{\hbox \ifcase\bibtexnumberwidth\else to \bibtexnumberwidth\fi}
@@ -633,6 +633,7 @@
{}%
{\namedlistparameter\currentbibtexsession\c!extras}%
{\namedlistparameter\currentbibtexsession\c!order}%
+ {}%
\ctxlua{bibtex.hacks.flush("\bibtexpublicationsparameter\c!sorttype")}%
\stoppacked
\endgroup}
@@ -651,12 +652,12 @@
\def\dotypesetbibtexpublication
{\doifelsebibreferencefound\currentbibtexsessiontag
- {\global\advance\bibtexcounter\plusone
+ {\global\advanceby\bibtexcounter\plusone
\ctxlua{bibtex.hacks.registerplaced("\currentbibtexsessiontag")}%
\let\currentlist\currentbibtexsession
- \let\currentlistentrynumber \bibtexcounter
- \let\currentlistentrytitle \thebibtexpublicationlistelement
- \let\currentlistentrypagenumber\empty
+ \let\currentlistentrynumber\bibtexcounter
+ \let\currentlistentrytitle\thebibtexpublicationlistelement
+ \lettonothing\currentlistentrypagenumber
\strc_lists_apply_renderingsetup}
{}} % invalid
diff --git a/Master/texmf-dist/tex/context/base/mkxl/bibl-tra.mkxl b/Master/texmf-dist/tex/context/base/mkxl/bibl-tra.mkxl
index 536de8d31c9..d197e8ea4b7 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/bibl-tra.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/bibl-tra.mkxl
@@ -202,8 +202,8 @@
\installstructurelistprocessor{pubs:userdata}%
{\ctxlua{bibtex.hacks.add(structures.lists.uservalue("\currentlist",\currentlistindex,"bibref"),\currentlistindex)}}
-\ifdefined\bibtexblock \else \newcount\bibtexblock \fi \bibtexblock\plusone
-\ifdefined\bibtexcounter \else \newcount\bibtexcounter \fi
+\ifdefined\bibtexblock \else \newinteger\bibtexblock \fi \bibtexblock\plusone
+\ifdefined\bibtexcounter \else \newinteger\bibtexcounter \fi
%D \macros{bibdoif,bibdoifnot,bibdoifelse}
%D
@@ -258,7 +258,7 @@
{\dosingleempty\dosetupbibtex}
\protected\def\dosetupbibtex[#1]%
- {\let\@@pbdatabase\empty
+ {\lettonothing\@@pbdatabase
\getparameters[\??pb][#1]%
\the\everysetupbibtex}
@@ -299,7 +299,7 @@
{\readsysfile{bibl-\@@pbalternative.tex}
{\showmessage\m!publications{6}{bibl-\@@pbalternative}}
{\showmessage\m!publications{1}{bibl-\@@pbalternative}}%
- \let\@@pbalternative\empty}%
+ \lettonothing\@@pbalternative}%
\let\setuppublicationlayout\normalsetuppublicationlayout % overloaded in bibl-num ... vadjust needs to be done with option
\getparameters[\??pb][#1]% as bibl-* can have set things back
\the\everysetuppublications
@@ -517,9 +517,9 @@
%D Another level of indirection is needed to control the typesetting of all of these
%D arguments.
-\newcount\etallimitcounter
-\newcount\etaldisplaycounter
-\newcount\todocounter
+\newinteger\etallimitcounter
+\newinteger\etaldisplaycounter
+\newinteger\todocounter
\protected\def\specialbibinsert#1#2#3#4#5%
{\bgroup
@@ -537,7 +537,7 @@
\fi
\ifnum\todocounter>\zerocount
% find the current author list
- \let\templist\empty
+ \lettonothing\templist
\dorecurse{#2}
{\scratchtoks\doubleexpandafter{\csname\??pb @#1\recurselevel\endcsname}%
\edef\templist{\ifempty\templist\else\templist,\fi\the\scratchtoks}}%
@@ -559,7 +559,7 @@
%D \#3 = commacommand containing authors
\protected\def\doprocessauthoritem#1#2#3%
- {\advance\scratchcounter\plusone
+ {\advanceby\scratchcounter\plusone
\ifnum\numexpr\scratchcounter-\plusone\relax<#2\relax
\publicationlistparameter{#1}#3%
\ifnum\scratchcounter=#2\relax
@@ -770,6 +770,7 @@
{}%
{\listparameter\c!extras}%
{\listparameter\c!order}}%
+ {}%
\ctxlua{bibtex.hacks.flush("\@@pbsorttype")}%
\stoppacked
\endgroup}
@@ -854,7 +855,7 @@
\inpublisttrue
\typesetpubslist
\inpublistfalse
- \global\advance\bibtexblock\plusone}
+ \global\advanceby\bibtexblock\plusone}
%D \subsubject{What's in a publication}
%D
@@ -877,13 +878,13 @@
\protected\def\doplacepublicationindeed#1%
{\doifelsebibreferencefound{#1}
- {\global\advance\bibtexcounter\plusone
+ {\global\advanceby\bibtexcounter\plusone
\def\currentpublicationkey{#1}%
\ctxlua{bibtex.hacks.registerplaced("#1")}%
- \def \currentlist {pubs}%
- \edef\currentlistentrynumber {\number\bibtexcounter}%
- \let \currentlistentrytitle \bibtexpubtext
- \let \currentlistentrypagenumber\empty
+ \def\currentlist{pubs}%
+ \edef\currentlistentrynumber{\number\bibtexcounter}%
+ \let\currentlistentrytitle\bibtexpubtext
+ \lettonothing\currentlistentrypagenumber
\strc_lists_apply_renderingsetup}
{}} % invalid
@@ -896,7 +897,7 @@
\the\initializebibdefinitions % NEW
\def\@@currentalternative{:l:}%
\presetbibvariables
- \let\biblanguage\empty
+ \lettonothing\biblanguage
\ignorespaces
\bibgetvard{#1}%
\removeunwantedspaces
@@ -962,9 +963,9 @@
\ifempty\LOextras
\setupcite[\@@currentalternative][#1]%
\else
- \expandafter\ifrelax\csname \??pv \@@currentalternative\c!right\endcsname
+ \expandafter\ifrelax\csname\??pv\@@currentalternative\c!right\endcsname
% avoids tail recursion
- \expandafter\let\csname \??pv \@@currentalternative\c!right\endcsname\empty
+ \expandafter\lettonothing\csname\??pv\@@currentalternative\c!right\endcsname
\fi
\expandafter\ifrelax\csname LOright\endcsname
\edef\LOextras{{\LOextras\bibalternative\c!right}}%
@@ -1049,22 +1050,22 @@
%D Delegate this to \LUA.
-% \let\ixlastcommand \relax
-% \let\ixsecondcomman \relax
-% \let\ixfirstcommand \relax
-% \let\thebibauthors \empty
-% \let\thebibyears \empty
-% \let\authorcount \!!zerocount
+% \let \ixlastcommand \relax
+% \let \ixsecondcomman\relax
+% \let \ixfirstcommand\relax
+% \lettonothing\thebibauthors
+% \lettonothing\thebibyears
+% \let \authorcount \!!zerocount
-\let\currentbibauthor\empty
+\lettonothing\currentbibauthor
\protected\def\ixbibauthoryear#1#2#3#4%
{\bgroup
- \gdef\ixlastcommand {#4}%
+ \gdef\ixlastcommand{#4}%
\gdef\ixsecondcommand{#3}%
- \gdef\ixfirstcommand {#2}%
- \glet\thebibauthors \empty
- \glet\thebibyears \empty
+ \gdef\ixfirstcommand{#2}%
+ \glettonothing\thebibauthors
+ \glettonothing\thebibyears
\getcommalistsize[#1]%
\ifbibcitecompress
\dorecurse\commalistsize{\xdef\thebibyears{\thebibyears,}}%
@@ -1087,7 +1088,7 @@
\expandafter\processcommalist\expandafter[\thebibauthors]\dodobibauthoryear}
\protected\def\dodobibauthoryear#1%
- {\advance\scratchcounter\plusone
+ {\advanceby\scratchcounter\plusone
\edef\wantednumber{\the\scratchcounter}%
\getfromcommacommand[\thebibyears][\wantednumber]%
\expandafter\def\expandafter\currentbibyear\expandafter{\commalistelement}%
@@ -1104,7 +1105,7 @@
{\getcommacommandsize[#1]%
\ifcase\commalistsize
% anonymous?
- \let\currentbibauthor\empty
+ \lettonothing\currentbibauthor
\or
\def\currentbibauthor{#1}%
\or
@@ -1113,13 +1114,13 @@
\handlemultiplebibauthors{\commalistsize}{#1}%
\fi}
-\newcount\citescratchcounter
+\newinteger\citescratchcounter
\protected\def\handlemultiplebibauthors#1#2%
{\citescratchcounter\zerocount
- \let\currentbibauthor\empty
+ \lettonothing\currentbibauthor
\protected\def\bibprocessauthoritem##1%
- {\advance\citescratchcounter\plusone
+ {\advanceby\citescratchcounter\plusone
\ifnum \citescratchcounter=#1\relax
\edef\currentbibauthor{\currentbibauthor##1}%
\orelse\ifnum\numexpr\citescratchcounter+\plusone\relax=#1\relax
@@ -1195,8 +1196,8 @@
%D Two temporary counters. One of these two can possibly be replaced by \type
%D {\scratchcounter}.
-\newcount\bibitemcounter
-\newcount\bibitemwanted
+\newinteger\bibitemcounter
+\newinteger\bibitemwanted
%D The first portion is simple enough: if this is the very first author it is quite
%D straightforward to add it. \type {\bibitemcounter} and \type {\bibitemwanted} are
@@ -1222,12 +1223,12 @@
%D setup properly to insert the year info.
\protected\def\docomparemyauthor#1%
- {\global\advance\bibitemwanted \plusone
+ {\global\advanceby\bibitemwanted \plusone
\def\mytempc{#1}%
\ifx\mytempc\myauthor
\quitcommalist
\orelse\ifnum\bibitemwanted=\bibitemcounter\relax
- \global\advance\bibitemwanted \plusone
+ \global\advanceby\bibitemwanted \plusone
\global\bibitemcounter\bibitemwanted\relax
\expandafter\doglobal\expandafter\robustaddtocommalist\expandafter{{\myauthor}}\thebibauthors
\fi}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/blob-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/blob-ini.lmt
index 42a18fddde0..a2244dcdd6f 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/blob-ini.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/blob-ini.lmt
@@ -25,28 +25,26 @@ if not modules then modules = { } end modules ['blob-ini'] = {
local type, tostring = type, tostring
local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns
-local report_blobs = logs.reporter("blobs")
+local report_blobs = logs.reporter("blobs")
-local flush_node_list = node.flush_list
-local hpack_node_list = node.hpack
------ vpack_node_list = node.vpack
-local write_node = node.write
+local flushnodelist = nodes.flushlist
+local hpacknodelist = nodes.hpack
-local typesetters = nodes.typesetters
-local tonodes = typesetters.tonodes
-local tohpack = typesetters.tohpack
-local tovpack = typesetters.tovpack
+local typesetters = nodes.typesetters
+local tonodes = typesetters.tonodes
+local tohpack = typesetters.tohpack
+local tovpack = typesetters.tovpack
-local implement = interfaces.implement
+local context = context
--- provide copies here (nicer for manuals)
+local implement = interfaces.implement
-blobs = blobs or { }
-local blobs = blobs
+blobs = blobs or { }
+local blobs = blobs
-blobs.tonodes = tonodes
-blobs.tohpack = tohpack
-blobs.tovpack = tovpack
+blobs.tonodes = tonodes
+blobs.tohpack = tohpack
+blobs.tovpack = tovpack
-- end of helpers
@@ -68,7 +66,7 @@ function blobs.dispose(t)
local li = list[i]
local pack = li.pack
if pack then
- flush_node_list(pack)
+ flushnodelist(pack)
li.pack = nil
end
end
@@ -96,14 +94,14 @@ function blobs.pack(t,how)
for i=1,#list do
local pack = list[i].pack
if pack then
- flush_node_list(node.pack)
+ flushnodelist(pack)
end
if how == "vertical" then
-- we need to prepend a local par node
-- list[i].pack = vpack_node_list(list[i].head,"exactly")
report_blobs("vpack not yet supported")
else
- list[i].pack = hpack_node_list(list[i].head,"exactly")
+ list[i].pack = hpacknodelist(list[i].head,"exactly")
end
end
end
@@ -114,8 +112,8 @@ function blobs.write(t)
local li = list[i]
local pack = li.pack
if pack then
- write_node(pack)
- flush_node_list(pack)
+ context(pack)
+ flushnodelist(pack)
li.pack = nil
end
end
@@ -158,28 +156,28 @@ end
local function strwd(str)
local l = tohpack(str)
local w = l.width
- flush_node_list(l)
+ flushnodelist(l)
return w
end
local function strht(str)
local l = tohpack(str)
local h = l.height
- flush_node_list(l)
+ flushnodelist(l)
return h
end
local function strdp(str)
local l = tohpack(str)
local d = l.depth
- flush_node_list(l)
+ flushnodelist(l)
return d
end
local function strhd(str)
local l = tohpack(str)
local s = l.height + l.depth
- flush_node_list(l)
+ flushnodelist(l)
return s
end
@@ -196,7 +194,7 @@ local scan_hbox = tokens.scanners.hbox
local function action(field,what)
local l = scan_hbox()
local d = l[field]
- flush_node_list(l)
+ flushnodelist(l)
if what == "value" then
return dimension_code, d
else
diff --git a/Master/texmf-dist/tex/context/base/mkxl/blob-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/blob-ini.mkxl
index 1dcd5597254..2e27ab20edd 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/blob-ini.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/blob-ini.mkxl
@@ -18,7 +18,7 @@
%D down the road (close to version 1.00 of \LUATEX). Typesetting in
%D pure \LUA\ sometimes makes sense.
-\registerctxluafile{node-typ}{} % experimental
+\registerctxluafile{node-typ}{autosuffix} % experimental
\registerctxluafile{blob-ini}{autosuffix}
\unprotect
diff --git a/Master/texmf-dist/tex/context/base/mkxl/bndr-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/bndr-ini.lmt
new file mode 100644
index 00000000000..2ee127020a5
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/bndr-ini.lmt
@@ -0,0 +1,52 @@
+if not modules then modules = { } end modules ['bndr-ini'] = {
+ version = 1.001,
+ comment = "companion to bndr-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local context = context
+local storage = storage
+local implement = interfaces.implement
+local sharedstorage = storage.shared
+
+local boundaries = tex.boundaries or { } -- maybe different namespace
+tex.boundaries = boundaries
+
+boundaries.names = boundaries.names or { }
+boundaries.numbers = boundaries.numbers or { }
+
+local names = boundaries.names
+local numbers = boundaries.numbers
+
+storage.register("boundaries/names", names, "tex.boundaries.names")
+storage.register("boundaries/numbers", numbers, "tex.boundaries.numbers")
+
+sharedstorage.boundaries_last = sharedstorage.boundaries_last or 0 -- so zero is not used
+
+function boundaries.system(name)
+ local number = numbers[name]
+ if not number then
+ local last = sharedstorage.boundaries_last
+ number = last + 1
+ sharedstorage.boundaries_last = number
+ numbers[name] = number
+ names[number] = name
+ end
+ return number
+end
+
+implement {
+ name = "defineboundary",
+ arguments = "string",
+ actions = { boundaries.system, context }
+}
+
+-- implement {
+-- name = "newboundary",
+-- arguments = "csname",
+-- public = true,
+-- protected = true,
+-- actions = function(n) tex.setintegervalue(n,boundaries.system()) end,
+-- }
diff --git a/Master/texmf-dist/tex/context/base/mkxl/bndr-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/bndr-ini.mkxl
new file mode 100644
index 00000000000..8481048bb97
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/bndr-ini.mkxl
@@ -0,0 +1,39 @@
+%D \module
+%D [ file=bndr-ini,
+%D version=2022.05.02,
+%D title=\CONTEXT\ Boundary Macros,
+%D subtitle=Initialization,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%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 Boundary Macros / Initialization}
+
+\unprotect
+
+\registerctxluafile{bndr-ini}{autosuffix}
+
+% \defineboundary[foobar][public]\meaning\foobar\par
+% \defineboundary[barfoo][public]\meaning\barfoo\par
+
+\immutable\def\??boundaryprefix{c_bndr_}
+
+\permanent\tolerant\protected\def\defineboundary[#1]#*[#2]% nicer for users
+ {\doifelseinset\s!public{#2}%
+ {\ifcsname#1\endcsname\else
+ \global\permanent\expandafter\integerdef\csname#1\endcsname\clf_defineboundary{#1}\relax
+ \fi}
+ {\ifcsname\??boundaryprefix#1\endcsname\else
+ \global\permanent\expandafter\integerdef\csname\??boundaryprefix#1\endcsname\clf_defineboundary{#1}\relax
+ \fi}}
+
+\permanent\protected\def\newboundary#1% nicer for lowlevel
+ {\ifdefined#1\else
+ \global\immutable\integerdef#1\clf_defineboundary{\csstring#1}\relax
+ \fi}
+
+\protect
diff --git a/Master/texmf-dist/tex/context/base/mkxl/buff-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/buff-ini.lmt
index 41e8a50785e..9f5535638ce 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/buff-ini.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/buff-ini.lmt
@@ -8,9 +8,10 @@ if not modules then modules = { } end modules ['buff-ini'] = {
local concat = table.concat
local type, next, load = type, next, load
-local sub, format = string.sub, string.format
+local sub, format, find, match = string.sub, string.format, string.find, string.match
local splitlines, validstring, replacenewlines = string.splitlines, string.valid, string.replacenewlines
-local P, Cs, patterns, lpegmatch = lpeg.P, lpeg.Cs, lpeg.patterns, lpeg.match
+local P, S, C, Ct, Cs = lpeg.P, lpeg.S, lpeg.C, lpeg.Ct, lpeg.Cs
+local patterns, lpegmatch = lpeg.patterns, lpeg.match
local utfchar = utf.char
local nameonly = file.nameonly
local totable = string.totable
@@ -24,7 +25,7 @@ local trace_visualize = false trackers.register("buffers.visualize", function
local report_buffers = logs.reporter("buffers","usage")
local report_typeset = logs.reporter("buffers","typeset")
------ report_grabbing = logs.reporter("buffers","grabbing")
+local report_grabbing = logs.reporter("buffers","grabbing")
local context = context
local commands = commands
@@ -38,14 +39,15 @@ local scaninteger = scanners.integer
local scanboolean = scanners.boolean
local scancode = scanners.code
local scantokencode = scanners.tokencode
------ scantoken = scanners.token
local getters = tokens.getters
local gettoken = getters.token
-local getcommand = token.get_command
------ getcsname = token.get_csname
-local getnextchar = token.scan_next_char or token.get_next_char
+local createtoken = token.create
+local grabtokens = token.grab
+
+local getcommand = tokens.accessors.command
+local getnextchar = tokens.scanners.nextchar
local variables = interfaces.variables
local settings_to_array = utilities.parsers.settings_to_array
@@ -56,6 +58,7 @@ local replacesuffix = file.replacesuffix
local registertempfile = luatex.registertempfile
local v_yes = variables.yes
+local v_append = variables.append
local eol = patterns.eol
local space = patterns.space
@@ -85,36 +88,73 @@ local buffers = buffers
local cache = { }
local function erase(name)
- cache[name] = nil
-end
-
-local function assign(name,str,catcodes)
- cache[name] = {
- data = str,
- catcodes = catcodes,
- typeset = false,
- }
+ if not name or name == "" then
+ cache[""] = false -- nil
+ else
+ local list = settings_to_array(name)
+ for i=1,#list do
+ cache[list[i]] = false -- nil
+ end
+ end
end
-local function combine(name,str,prepend)
- local buffer = cache[name]
- if buffer then
- buffer.data = prepend and (str .. buffer.data) or (buffer.data .. str)
- buffer.typeset = false
- else
+local assign do
+
+ -- There is no gain in an immediate concatenating lpeg
+
+ local action = whitespace^0 * C(P("+")^1 + P("*")) * whitespace^0
+ local equal = whitespace^0 * patterns.equal * whitespace^0
+ local name = C((1-action)^1)
+ local pattern = C((1-equal)^1) * equal * Ct((action + name)^1)
+
+ assign = function(name,str,catcodes)
+ local target, content = lpegmatch(pattern,name)
+ if target and content then
+ for i=1,#content do
+ local c = content[i]
+ if c == "+" then
+ content[i] = ""
+ elseif c == "++" then
+ content[i] = " "
+ elseif c == "+++" then
+ content[i] = "\r\r"
+ elseif c == "*" then
+ content[i] = str
+ else
+ local s = cache[c]
+ content[i] = s and s.data or ""
+ end
+ end
+ name = target
+ str = concat(content)
+ end
cache[name] = {
data = str,
+ catcodes = catcodes,
typeset = false,
}
end
-end
-local function prepend(name,str)
- combine(name,str,true)
end
-local function append(name,str)
- combine(name,str)
+local prepend, append do
+
+ local function combine(name,str,prepend)
+ local buffer = cache[name]
+ if buffer then
+ buffer.data = prepend and (str .. buffer.data) or (buffer.data .. str)
+ buffer.typeset = false
+ else
+ cache[name] = {
+ data = str,
+ typeset = false,
+ }
+ end
+ end
+
+ prepend = function(name,str) combine(name,str,true) end
+ append = function(name,str) combine(name,str) end
+
end
local function exists(name)
@@ -126,6 +166,14 @@ local function getcontent(name)
return buffer and buffer.data or ""
end
+local function empty(name)
+ if find(getcontent(name),"%S") then
+ return false
+ else
+ return true
+ end
+end
+
local function getlines(name)
local buffer = name and cache[name]
return buffer and splitlines(buffer.data)
@@ -202,6 +250,7 @@ buffers.assign = assign
buffers.prepend = prepend
buffers.append = append
buffers.exists = exists
+buffers.empty = empty
buffers.getcontent = getcontent
buffers.getlines = getlines
buffers.collectcontent = collectcontent
@@ -311,50 +360,6 @@ end
buffers.undent = undent
--- function commands.grabbuffer(name,begintag,endtag,bufferdata,catcodes,doundent) -- maybe move \\ to call
--- local dn = getcontent(name)
--- if dn == "" then
--- nesting = 0
--- continue = false
--- end
--- if trace_grab then
--- if #bufferdata > 30 then
--- report_grabbing("%s => |%s..%s|",name,sub(bufferdata,1,10),sub(bufferdata,-10,#bufferdata))
--- else
--- report_grabbing("%s => |%s|",name,bufferdata)
--- end
--- end
--- local counter = counters[begintag]
--- if not counter then
--- counter = countnesting(begintag,endtag)
--- counters[begintag] = counter
--- end
--- nesting = nesting + lpegmatch(counter,bufferdata)
--- local more = nesting > 0
--- if more then
--- dn = dn .. sub(bufferdata,2,-1) .. endtag
--- nesting = nesting - 1
--- continue = true
--- else
--- if continue then
--- dn = dn .. sub(bufferdata,2,-2) -- no \r, \n is more generic
--- elseif dn == "" then
--- dn = sub(bufferdata,2,-2)
--- else
--- dn = dn .. "\n" .. sub(bufferdata,2,-2) -- no \r, \n is more generic
--- end
--- local last = sub(dn,-1)
--- if last == "\n" or last == "\r" then -- \n is unlikely as \r is the endlinechar
--- dn = sub(dn,1,-2)
--- end
--- if doundent or (autoundent and doundent == nil) then
--- dn = undent(dn)
--- end
--- end
--- assign(name,dn,catcodes)
--- commands.doifelse(more)
--- end
-
local split = table.setmetatableindex(function(t,k)
local v = totable(k)
t[k] = v
@@ -379,25 +384,25 @@ local experiment = false
local experiment = scantokencode and true
local function pickup(start,stop)
- local stoplist = split[stop] -- totable(stop)
- local stoplength = #stoplist
- local stoplast = stoplist[stoplength]
- local startlist = split[start] -- totable(start)
- local startlength = #startlist
- local startlast = startlist[startlength]
- local list = { }
- local size = 0
- local depth = 0
--- local done = 32
- local scancode = experiment and scantokencode or scancode
+ local stoplist = split[stop] -- totable(stop)
+ local stoplength = #stoplist
+ local stoplast = stoplist[stoplength]
+ local startlist = split[start] -- totable(start)
+ local startlength = #startlist
+ local startlast = startlist[startlength]
+ local list = { }
+ local size = 0
+ local depth = 0
+ -- local done = 32
+ local scancode = experiment and scantokencode or scancode
while true do -- or use depth
local char = scancode()
if char then
--- if char < done then
--- -- we skip leading control characters so that we can use them to
--- -- obey spaces (a dirty trick)
--- else
--- done = 0
+ -- if char < done then
+ -- -- we skip leading control characters so that we can use them to
+ -- -- obey spaces (a dirty trick)
+ -- else
+ -- done = 0
char = utfchar(char)
size = size + 1
list[size] = char
@@ -434,7 +439,7 @@ local function pickup(start,stop)
depth = depth + 1
end
end
--- end
+ -- end
else
-- local t = scantoken()
local t = gettoken()
@@ -446,7 +451,7 @@ local function pickup(start,stop)
if char then
size = size + 1 ; list[size] = char
else
--- local csname = getcsname(t)
+ -- local csname = getcsname(t)
local csname = scancsname(t)
if csname == stop then
stoplength = 0
@@ -498,132 +503,17 @@ local function pickup(start,stop)
end
end
--- -- lmtx:
---
--- local function pickup(start,stop)
--- local stoplist = split[stop] -- totable(stop)
--- local stoplength = #stoplist
--- local stoplast = stoplist[stoplength]
--- local startlist = split[start] -- totable(start)
--- local startlength = #startlist
--- local startlast = startlist[startlength]
--- local list = { }
--- local size = 0
--- local depth = 0
--- getnextchar() -- we start with a \relax
--- while true do -- or use depth
--- local char = getnextchar()
--- if char then
--- size = size + 1
--- list[size] = char
--- if char == stoplast and size >= stoplength then
--- local done = true
--- local last = size
--- for i=stoplength,1,-1 do
--- if stoplist[i] ~= list[last] then
--- done = false
--- break
--- end
--- last = last - 1
--- end
--- if done then
--- if depth > 0 then
--- depth = depth - 1
--- else
--- break
--- end
--- char = false -- trick: let's skip the next (start) test
--- end
--- end
--- if char == startlast and size >= startlength then
--- local done = true
--- local last = size
--- for i=startlength,1,-1 do
--- if startlist[i] ~= list[last] then
--- done = false
--- break
--- end
--- last = last - 1
--- end
--- if done then
--- depth = depth + 1
--- end
--- end
--- else
--- local t = gettoken()
--- if t then
--- -- we're skipping leading stuff, like obeyedlines and relaxes
--- if experiment and size > 0 then
--- -- we're probably in a macro
--- local char = tochar[getcommand(t)]
--- if char then
--- size = size + 1 ; list[size] = char
--- else
--- local csname = getcsname(t)
- local csname = scancsname(t)
--- if csname == stop then
--- stoplength = 0
--- break
--- else
--- size = size + 1 ; list[size] = "\\"
--- size = size + 1 ; list[size] = csname
--- size = size + 1 ; list[size] = " "
--- end
--- end
--- else
--- -- ignore and hope for the best
--- end
--- else
--- break
--- end
--- end
--- end
--- local start = 1
--- local stop = size - stoplength - 1
--- -- not good enough: only empty lines, but even then we miss the leading
--- -- for verbatim
--- --
--- -- the next is not yet adapted to the new scanner ... we don't need lpeg here
--- --
--- for i=start,stop do
--- local li = list[i]
--- if lpegmatch(blackspace,li) then
--- -- keep going
--- elseif lpegmatch(eol,li) then
--- -- okay
--- start = i + 1
--- else
--- break
--- end
--- end
--- for i=stop,start,-1 do
--- if lpegmatch(whitespace,list[i]) then
--- stop = i - 1
--- else
--- break
--- end
--- end
--- --
--- if start <= stop then
--- return concat(list,"",start,stop)
--- else
--- return ""
--- end
--- end
-
--- function buffers.pickup(name,start,stop,finish,catcodes,doundent)
--- local data = tokens.pickup(start,stop)
--- if doundent or (autoundent and doundent == nil) then
--- data = buffers.undent(data)
--- end
--- buffers.assign(name,data,catcodes)
--- context(finish)
--- end
-
--- commands.pickupbuffer = buffers.pickup
-
tokens.pickup = pickup
+local function showpickup(name,bufferdata,catcodes,undented)
+ undented = undented and ">" or "="
+ if #bufferdata > 50 then
+ report_grabbing("%s : %i =%s |%s..%s|",name,catcodes,undented,sub(bufferdata,1,20),sub(bufferdata,-20,#bufferdata))
+ else
+ report_grabbing("%s : %i =%s |%s|",name,catcodes,undented,bufferdata)
+ end
+end
+
implement {
name = "pickupbuffer",
actions = function()
@@ -633,18 +523,47 @@ implement {
local stop = scanstring()
local finish = scancsname()
local catcodes = scaninteger()
- local doundent = scanboolean()
+ local doundent = scaninteger() == 1 -- better than a keyword scan
-- could be a scanner:
local data = pickup(start,stop)
- if doundent or (autoundent and doundent == nil) then
+ local undented = doundent or (autoundent and doundent == nil)
+ if undented then
data = undent(data)
end
- buffers.assign(name,data,catcodes)
+ if trace_grab then
+ showpickup(name,data,catcodes,undented)
+ end
+ assign(name,data,catcodes)
context[finish]()
end
}
-local function savebuffer(list,name,prefix) -- name is optional
+implement {
+ name = "grabbuffer",
+ actions = function()
+ -- let's pickup all here (no arguments)
+ local name = scanstring()
+ local start = scanstring()
+ local stop = scanstring()
+ local finish = scancsname()
+ local catcodes = scaninteger()
+ local doundent = scaninteger() == 1 -- better than a keyword scan
+ local starttok = createtoken(start,true)
+ local stoptok = createtoken(stop,true)
+ local data = grabtokens(starttok,stoptok,true,13) -- strip first and last \endoflineasciicode
+ local undented = doundent or (autoundent and doundent == nil)
+ if undented then
+ data = undent(data)
+ end
+ if trace_grab then
+ showpickup(name,data,catcodes,undented)
+ end
+ assign(name,data,catcodes)
+ context[finish]()
+ end
+}
+
+local function savebuffer(list,name,prefix,option,directory) -- name is optional
if not list or list == "" then
list = name
end
@@ -658,13 +577,16 @@ local function savebuffer(list,name,prefix) -- name is optional
if prefix == v_yes then
name = addsuffix(tex.jobname .. "-" .. name,"tmp")
end
- io.savedata(name,replacenewlines(content))
+ if directory ~= "" and dir.makedirs(directory) then
+ name = file.join(directory,name)
+ end
+ savedata(name,replacenewlines(content),"\n",option == v_append)
end
implement {
name = "savebuffer",
actions = savebuffer,
- arguments = "3 strings",
+ arguments = "5 strings",
}
-- we can consider adding a size to avoid unlikely clashes
@@ -677,10 +599,11 @@ local runner = sandbox.registerrunner {
name = "run buffer",
program = "context",
method = "execute",
- template = jit and "--purgeall --jit %filename%" or "--purgeall %filename%",
+ template = [[--purgeall %?path: --path=%path% ?% %filename%]],
reporter = report_typeset,
checkers = {
filename = "readable",
+ path = "string",
}
}
@@ -771,7 +694,10 @@ local function runbuffer(name,encapsulate,runnername,suffixes)
end
savedata(filename,content)
report_typeset("processing saved buffer %a\n",filename)
- runner { filename = filename }
+ runner {
+ filename = filename,
+ path = environment.arguments.path, -- maybe take all set paths
+ }
end
new[tag] = (new[tag] or 0) + 1
report_typeset("no changes in %a, processing skipped",name)
@@ -789,12 +715,17 @@ local function runbuffer(name,encapsulate,runnername,suffixes)
end
local f_getbuffer = formatters["buffer.%s"]
+local defaultlist = { "" }
local function getbuffer(name)
- local str = getcontent(name)
- if str ~= "" then
- -- characters.showstring(str)
- ctx_viafile(str,f_getbuffer(validstring(name,"noname")))
+ local list = name and name ~= "" and settings_to_array(name) or defaultlist
+ for i=1,#list do
+ local buf = list[i]
+ local str = getcontent(buf)
+ if str ~= "" then
+ -- characters.showstring(str)
+ ctx_viafile(str,f_getbuffer(validstring(buf,"noname")))
+ end
end
end
@@ -802,7 +733,7 @@ local function getbuffermkvi(name) -- rather direct !
ctx_viafile(resolvers.macros.preprocessed(getcontent(name)),formatters["buffer.%s.mkiv"](validstring(name,"noname")))
end
-local function gettexbuffer(name)
+local function getbuffertex(name)
local buffer = name and cache[name]
if buffer and buffer.data ~= "" then
ctx_pushcatcodetable()
@@ -817,15 +748,16 @@ local function gettexbuffer(name)
end
end
-buffers.get = getbuffer
-buffers.getmkiv = getbuffermkiv
-buffers.gettexbuffer = gettexbuffer
-buffers.run = runbuffer
+buffers.get = getbuffer
+buffers.getmkvi = getbuffermkvi
+buffers.gettex = getbuffertex
+buffers.getctxlua = loadcontent
+buffers.run = runbuffer
-implement { name = "getbufferctxlua", actions = loadcontent, arguments = "string" }
-implement { name = "getbuffer", actions = getbuffer, arguments = "string" }
-implement { name = "getbuffermkvi", actions = getbuffermkvi, arguments = "string" }
-implement { name = "gettexbuffer", actions = gettexbuffer, arguments = "string" }
+implement { name = "getbufferctxlua", actions = loadcontent, arguments = "argument" }
+implement { name = "getbuffer", actions = getbuffer, arguments = "argument" }
+implement { name = "getbuffermkvi", actions = getbuffermkvi, arguments = "argument" }
+implement { name = "getbuffertex", actions = getbuffertex, arguments = "argument" }
interfaces.implement {
name = "getbuffercontent",
@@ -848,6 +780,16 @@ implement {
implement {
name = "doifelsebuffer",
actions = { exists, commands.doifelse },
+ public = true,
+ -- protected = false,
+ arguments = "string"
+}
+
+implement {
+ name = "doifelsebufferempty",
+ actions = { empty, commands.doifelse },
+ public = true,
+ protected = true,
arguments = "string"
}
@@ -887,10 +829,10 @@ end
-- moved here:
function buffers.samplefile(name)
- if not buffers.exists(name) then
- buffers.assign(name,io.loaddata(resolvers.findfile(name)))
+ if not exists(name) then
+ assign(name,io.loaddata(resolvers.findfile(name)))
end
- buffers.get(name)
+ getbuffer(name)
end
implement {
@@ -898,3 +840,81 @@ implement {
actions = buffers.samplefile,
arguments = "string"
}
+
+-- A somewhat strange place (for now) so the *.log definitions might move someplace
+-- else (if useful at all).
+
+-- Handy for the math test suite that Mikael Sundqvist and I are making where we
+-- need to track box content as well as some low level math tracing features, so
+-- we can pipe to buffers (via a temporary file).
+
+do
+
+ local insert, remove = table.insert, table.remove
+ local setlogfile = texio.setlogfile
+ local openfile = io.open
+
+ local stack = { }
+ local files = { }
+
+ local function resetlogfile(name)
+ files[name] = false
+ end
+
+ local function pushlogfile(name)
+ local f = openfile(name,files[name] and "ab" or "wb")
+ insert(stack,f)
+ files[name] = true
+ setlogfile(f)
+ end
+
+ local function poplogfile()
+ remove(stack)
+ setlogfile(stack[#stack])
+ end
+
+ logs.pushlogfile = pushlogfile
+ logs.poplogfile = poplogfile
+ logs.resetlogfile = resetlogfile
+
+ implement {
+ name = "resetlogfile",
+ arguments = "argument",
+ public = true,
+ protected = true,
+ actions = resetlogfile,
+ }
+
+ implement {
+ name = "pushlogfile",
+ arguments = "argument",
+ public = true,
+ protected = true,
+ actions = pushlogfile,
+ }
+
+ implement {
+ name = "poplogfile",
+ public = true,
+ protected = true,
+ actions = poplogfile,
+ }
+
+ -- In the end we went for a somewhat hidden low level one (see low level math tests
+ -- for usage):
+
+ local serialized = nodes.nuts.serialized
+ local getbox = nodes.nuts.getbox
+
+ implement {
+ name = "showboxinbuffer",
+ public = true,
+ protected = true,
+ arguments = { "argument", "integer", "integer" },
+ actions = function(buffer, box, detail)
+ local box = getbox(box)
+ assign(buffer or "",box and serialized(box,detail))
+ end,
+ }
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/buff-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/buff-ini.mkxl
index ed62743ad89..0bc4d665f30 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/buff-ini.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/buff-ini.mkxl
@@ -22,15 +22,16 @@
%D pretty and never be efficient but it has served us for ages (conceptually it's
%D as in \MKII).
-\mutable\let\currentbuffer\empty
+\mutable\lettonothing\currentbuffer
-\permanent\def\doifelsebuffer#1{\clf_doifelsebuffer{#1}} % expandable, todo: use public implementor
+% \doifelsebuffer {#1} % expandable
+% \doifelsebufferempty {#1} % non expandable
\aliased\let\doifbufferelse\doifelsebuffer
\permanent\tolerant\protected\def\resetbuffer[#1]{\clf_erasebuffer{#1}} % todo: use public implementor
-\permanent\setuvalue{\e!start\v!buffer}%
+\permanent\protected\defcsname\e!start\v!buffer\endcsname
{\begingroup % (3)
\obeylines
\buff_start}
@@ -73,7 +74,8 @@
{\begingroup % (1)
#4%
\begingroup % (2)
- \scratchcounter\catcodetable
+ \scratchcounterone\catcodetable
+ \scratchcountertwo#6\relax
\clf_erasebuffer{#1}%
\setcatcodetable\vrbcatcodes
\protected\def\buff_finish
@@ -83,30 +85,31 @@
% todo: we need to skip the first lineending which is an active character
% but sometimes we have something different ... this is a side effect of
% checking for optional arguments i.e. the next token is already tokenized
- % and for that reason we have the \relax as well as the \string
+ % and for that reason we had the \relax as well as the \string
\clf_pickupbuffer
{#1}%
{#2}%
{#3}%
-% {\string\dofinishpickupbuffer}%
+ % {\string\dofinishpickupbuffer}%
\buff_finish
- \scratchcounter
- \ifnum#6=\plusone\s!true\else\s!false\fi
- % \relax}
- \expandafter\relax\string} % maybe \normalexpanded{\relax\utfchar{7}}} signal
+ % \ifnum#6=\plusone\s!true\else\s!false\fi
+ % \expandafter\relax\string} % dirty trick
+ \scratchcounterone
+ % better than \string but still a dirty trick to avoid \par mess in blocks
+ \expandafter\scratchcountertwo\detokenized}
\protected\def\buff_stop#1%
{\endgroup % (3 & 4 & 5 & 6)
\begincsname#1\endcsname}
-\aliased\let\endbuffer\relax
+\permanent\protected\lettonothing\endbuffer
\permanent\tolerant\protected\def\setbuffer[#1]#:#2\endbuffer % seldom used so we just pass #2
{\clf_assignbuffer{#1}{\detokenize{#2}}\catcodetable\relax}
-% beware, never adapt the global buffer settings, actually we might introduce
+% Beware, never adapt the global buffer settings, actually we might introduce
% a broken parent chain for this purpose but on the other hand it's not that
-% different from framed cum suis
+% different from framed cum suis.
\installcorenamespace{buffer}
@@ -114,18 +117,23 @@
\setupbuffer
[\c!before=,
- \c!after=]
+ \c!after=,
+ \c!define=\v!yes]
-\newcount\c_buff_n_of_defined
+\newinteger\c_buff_n_of_defined
\mutable\let\currentdefinedbuffer\s!dummy
\appendtoks
- \global\advance\c_buff_n_of_defined\plusone
+ \global\advanceby\c_buff_n_of_defined\plusone
\setexpandedbufferparameter\c!number{\number\c_buff_n_of_defined}%
\edef\currentdefinedbuffer{def-\number\c_buff_n_of_defined}%
- \frozen\instance\setuevalue{\e!start\currentbuffer}{\buff_start_defined{\currentbuffer}{\currentdefinedbuffer}{\e!start\currentbuffer}{\e!stop\currentbuffer}}%
- \frozen\instance\setuevalue{\e!get \currentbuffer}{\buff_get_stored {\currentbuffer}{\currentdefinedbuffer}}%
+ \ifcstok{\bufferparameter\c!define}\v!yes
+ \frozen\instance\protected\edefcsname\e!start\currentbuffer\endcsname
+ {\buff_start_defined{\currentbuffer}{\currentdefinedbuffer}{\e!start\currentbuffer}{\e!stop\currentbuffer}}%
+ \frozen\instance\protected\edefcsname\e!get \currentbuffer\endcsname
+ {\buff_get_stored {\currentbuffer}{\currentdefinedbuffer}}%
+ \fi
\to \everydefinebuffer
\protected\def\buff_start_defined
@@ -135,35 +143,40 @@
\permanent\def\thebuffernumber #1{\namedbufferparameter{#1}\c!number}
\permanent\def\thedefinedbuffer#1{def-\namedbufferparameter{#1}\c!number}
-\permanent\tolerant\protected\def\getbuffer[#1]% [name]
+\permanent\def\getbufferdata[#1]% expandable
+ {\clf_getbuffer{#1}}
+
+\permanent\tolerant\protected\def\getbuffer[#1]% [namelist]
{\namedbufferparameter\empty\c!before\relax
- \doifelsenothing{#1}
- {\buff_get_stored_indeed\empty}
- {\processcommalist[#1]\buff_get_stored_indeed}%
+ \clf_getbuffer{#1}%
\namedbufferparameter\empty\c!after\relax}
\protected\def\buff_get_stored#1#2%
{\namedbufferparameter{#1}\c!before\relax
- \buff_get_stored_indeed{#2}%
+ \clf_getbuffer{#2}%
\namedbufferparameter{#1}\c!after\relax}
-\protected\def\buff_get_stored_indeed#1%
- {\clf_getbuffer{#1}}
+\aliased\let\rawbuffer\clf_getbuffer % expandable
\permanent\protected\def\getdefinedbuffer[#1]%
{\buff_get_stored{#1}{\thedefinedbuffer{#1}}}%
-\permanent\tolerant\protected\def\inlinebuffer[#1]% [name]
- {\doifelsenothing{#1}
- {\buff_get_stored_inline_indeed\empty}
- {\processcommalist[#1]\buff_get_stored_inline_indeed}}
+% We had this:
+%
+% \permanent\tolerant\protected\def\inlinebuffer[#1]% [name]
+% {\doifelsenothing{#1}
+% {\buff_get_stored_inline_indeed\empty}
+% {\processcommalist[#1]\buff_get_stored_inline_indeed}}
+%
+% \protected\def\buff_get_stored_inline_indeed#1%
+% {\ignorespaces\clf_getbuffer{#1}\removeunwantedspaces}
+%
+% but it makes no sense to ignore spaces in between and we now do the
+% list at the \LUA\ end anyway:
-\protected\def\buff_get_stored_inline_indeed#1%
+\permanent\tolerant\protected\def\inlinebuffer[#1]% [name]
{\ignorespaces\clf_getbuffer{#1}\removeunwantedspaces}
-\permanent\def\rawbuffer#1% expandable
- {\clf_getbuffer{#1}}
-
\definebuffer
[\v!hiding]
@@ -172,28 +185,24 @@
[\c!before=,
\c!after=]
-\permanent\protected\protected\def\processTEXbuffer[#1]% keep case, maybe also lower
- {\pushcatcodetable
- \catcodetable\ctxcatcodes % \setcatcodetable
- \buff_get_stored_indeed{#1}%
- \popcatcodetable}
-
-% only mkiv:
-%
-% \startbuffer[x]
-% x
-% \stopbuffer
-%
-% \savebuffer[x] [temp] % gets name: jobname-temp.tmp
-% \savebufferinfile[x][temp.log] % gets name: temp.log
+%D \starttyping
+%D \startbuffer[x]
+%D x y z
+%D \stopbuffer
+%D
+%D \savebuffer[x] [temp] % gets name: jobname-temp.tmp
+%D \savebufferinfile[x][temp.log] % gets name: temp.log
+%D \stoptyping
\installcorenamespace{savebuffer}
+\installcorenamespace{savebuffercounter}
-\installsetuponlycommandhandler \??savebuffer {savebuffer}
+\installcommandhandler \??savebuffer {savebuffer} \??savebuffer
\setupsavebuffer
[\c!list=,
\c!file=,
+ \c!directory=,
\c!prefix=\v!yes]
\permanent\tolerant\protected\def\savebuffer[#1]#*[#2]%
@@ -203,9 +212,57 @@
\else
\setupcurrentsavebuffer[\c!list={#1},\c!file=#2]%
\fi
- \clf_savebuffer{\directsavebufferparameter\c!list}{\directsavebufferparameter\c!file}{\directsavebufferparameter\c!prefix}%
+ \clf_savebuffer % will become key/value
+ {\savebufferparameter\c!list}%
+ {\savebufferparameter\c!file}%
+ {\savebufferparameter\c!prefix}%
+ {\savebufferparameter\c!option}%
+ {\savebufferparameter\c!directory}%
\endgroup}
+%D \starttyping
+%D \definesavebuffer[slide]
+%D
+%D \starttext
+%D \startslide
+%D \starttext
+%D \stopslide
+%D \startslide
+%D slide 1
+%D \stopslide
+%D text 1 \par
+%D \startslide
+%D slide 2
+%D \stopslide
+%D text 2 \par
+%D \startslide
+%D \stoptext
+%D \stopslide
+%D \stoptext
+%D \stoptyping
+
+% We can keep the counter at the lua end and explicitly reset it when we
+% save.
+
+\appendtoks
+ \ifcsname\e!stop\currentsavebuffer\endcsname\else
+ \definebuffer[\currentsavebuffer]%
+ \expandafter\newinteger\csname\??savebuffercounter\currentsavebuffer\endcsname
+ \protected\edefcsname\e!stop\currentsavebuffer\endcsname{\buff_stop_save_buffer{\currentsavebuffer}}%
+ \setsavebufferparameter\c!file{\currentsavebuffer.tex}%
+ \fi
+\to \everydefinesavebuffer
+
+\protected\def\buff_stop_save_buffer#1%
+ {\edef\currentsavebuffer{#1}%
+ \global\advanceby\csname\??savebuffercounter\currentsavebuffer\endcsname\plusone
+ \clf_savebuffer % will become key/value
+ {\thedefinedbuffer{\currentsavebuffer}}%
+ {\savebufferparameter\c!file}%
+ {\savebufferparameter\c!prefix}%
+ {\ifnum\csname\??savebuffercounter\currentsavebuffer\endcsname>\plusone\v!append\fi}%
+ {\savebufferparameter\c!directory}}
+
%D Experimental: no expansion of commands in buffer!
% \startbuffer[what]
@@ -217,8 +274,15 @@
%
% \ctxluabuffer[what] \ctxluabuffer
-\permanent\tolerant\protected\def\ctxluabuffer[#1]{\clf_getbufferctxlua{#1}} % todo: use public implementor
-\permanent\tolerant\protected\def\mkvibuffer [#1]{\clf_getbuffermkvi {#1}} % todo: use public implementor
+\permanent\tolerant\protected\def\processTEXbuffer[#1]#;#=% keep case, maybe also lower
+ {\pushcatcodetable
+ \catcodetable\ctxcatcodes % \setcatcodetable
+ \clf_getbuffer{#1#2}%
+ \popcatcodetable}
+
+\permanent\tolerant\protected\def\ctxluabuffer[#1]#;#={\clf_getbufferctxlua{#1#2}} % todo: use public implementor
+\permanent\tolerant\protected\def\mkvibuffer [#1]#;#={\clf_getbuffermkvi {#1#2}} % todo: use public implementor
+\permanent\tolerant\protected\def\texbuffer [#1]#;#={\clf_getbuffertex {#1#2}} % todo: use public implementor
% maybe still used elsewhere
@@ -226,8 +290,38 @@
\aliased\let\dostartbuffer\grabbufferdata % for old times sake, this will go away
-% new (expandable):
-
-\permanent\def\getbufferdata[#1]{\buff_get_stored_indeed{#1}}
+% low level helper (for math manual):
+
+% \showboxinbuffer{temp}<boxnumber><detail> % defined in lua, detail cf \shownodedetails 0|1|2
+
+%D \starttyping
+%D \setbox\scratchbox\hbox{$fff$}
+%D \showboxinbuffer{temp}\scratchbox\plusone
+%D \typebuffer[temp][option=TEX]
+%D \stoptyping
+%D
+%D More extensive multistep cases can do this:
+%D
+%D \starttyping
+%D \pushlogfile{oeps-1.txt}
+%D \setbox0\hbox{A}\showbox0
+%D \pushlogfile{oeps-2.txt}
+%D \setbox0\hbox{B}\showbox0
+%D \poplogfile
+%D \setbox0\hbox{C}\showbox0
+%D \poplogfile
+%D
+%D % \resetlogfile{oeps-1.txt}
+%D \pushlogfile{oeps-1.txt}
+%D \setbox0\hbox{A}\showbox0
+%D \pushlogfile{oeps-2.txt}
+%D \setbox0\hbox{B}\showbox0
+%D \poplogfile
+%D \setbox0\hbox{C}\showbox0
+%D \poplogfile
+%D \stoptyping
+%D
+%D But in the end that was overkill and we don't really need a stepwise verbatim
+%D because we need to add comments in between anyway.
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/buff-par.mklx b/Master/texmf-dist/tex/context/base/mkxl/buff-par.mklx
index b6ffa3f534e..63e6f47bd5a 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/buff-par.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/buff-par.mklx
@@ -131,11 +131,11 @@
\relax
\endgroup}
-\mutable\let\currentparallelinstance\empty
-\mutable\let\currentparallelnumber \empty
-\mutable\let\currentparallelline \empty
-\mutable\let\currentparallellabel \empty
-\mutable\let\currentparallelcontent \empty
+\mutable\lettonothing\currentparallelinstance
+\mutable\lettonothing\currentparallelnumber
+\mutable\lettonothing\currentparallelline
+\mutable\lettonothing\currentparallellabel
+\mutable\lettonothing\currentparallelcontent
\permanent\protected\def\doflushparallel#instance#status#line#label#content% called at lua end
{\begingroup
diff --git a/Master/texmf-dist/tex/context/base/mkxl/buff-ver.mkxl b/Master/texmf-dist/tex/context/base/mkxl/buff-ver.mkxl
index 68a07df60be..8c42694a320 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/buff-ver.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/buff-ver.mkxl
@@ -31,7 +31,6 @@
\installcorenamespace{typinglines}
\installcorenamespace{typingspace}
-\installcorenamespace{typingblank} % needs checking ... used?
\newtoks\everyinitializeverbatim
@@ -40,6 +39,7 @@
\resetfontfeature
\resetcharacterspacing
\resetbreakpoints
+ \nohyphencollapsing
\to \everyinitializeverbatim
\permanent\protected\def\setverbatimspaceskip % to be checked: must happen after font switch
@@ -53,16 +53,9 @@
\defcsname\??typingspace\v!on \endcsname{\enforced\let\obeyedspace\specialcontrolspace}
\defcsname\??typingspace\v!stretch \endcsname{\enforced\let\obeyedspace\specialstretchedspace}
-\defcsname\??typingspace\v!normal \endcsname{}
+\letcsname\??typingspace\v!normal \endcsname\donothing
\defcsname\??typingspace\v!fixed \endcsname{\enforced\let\obeyedspace\specialfixedspace}
-
-\defcsname\??typingblank\v!standard \endcsname{\s_spac_whitespace_parskip}
-\defcsname\??typingblank\v!small \endcsname{\smallskipamount}
-\defcsname\??typingblank\v!medium \endcsname{\medskipamount}
-\defcsname\??typingblank\v!big \endcsname{\bigskipamount}
-\defcsname\??typingblank\v!halfline \endcsname{.5\baselineskip}
-\defcsname\??typingblank\v!line \endcsname{\baselineskip}
-\defcsname\??typingblank\v!none \endcsname{\zeropoint}
+\defcsname\??typingspace\v!character \endcsname{\enforced\chardef\obeyedspace\spaceasciicode}
\protected\def\buff_verbatim_obey_hyphens
{}
@@ -107,12 +100,10 @@
\def\buff_verbatim_initialize_typing_one
{\usebodyfontparameter\typingparameter
- \scratchskip\typingparameter\c!oddmargin\relax
- \ifzeropt\scratchskip \else
+ \ifzerodim\typingparameter\c!oddmargin\else
\let\buff_verbatim_set_line_margin\buff_verbatim_set_line_margin_indeed
\fi
- \scratchskip\typingparameter\c!evenmargin\relax
- \ifzeropt\scratchskip \else
+ \ifzerodim\typingparameter\c!evenmargin\else
\let\buff_verbatim_set_line_margin\buff_verbatim_set_line_margin_indeed
\fi
\ifrelax\buff_verbatim_set_line_margin
@@ -148,7 +139,7 @@
\installcommandhandler \??type {type} \??type
\appendtoks
- \frozen\instance\setuevalue{\currenttype}{\buff_verbatim_type{\currenttype}}%
+ \frozen\instance\protected\edefcsname\currenttype\endcsname{\buff_verbatim_type{\currenttype}}%
\to \everydefinetype
\appendtoks
@@ -176,8 +167,8 @@
\installcommandhandler \??typing {typing} \??typing
\appendtoks
- \frozen\instance\setuevalue{\e!start\currenttyping}{\buff_verbatim_typing_start{\currenttyping}}%
- \frozen\instance\setuevalue{\e!stop \currenttyping}{\buff_verbatim_typing_stop {\currenttyping}}%
+ \frozen\protected\instance\edefcsname\e!start\currenttyping\endcsname{\buff_verbatim_typing_start{\currenttyping}{\currenttyping}}%
+ \frozen\protected\instance\edefcsname\e!stop \currenttyping\endcsname{\buff_verbatim_typing_stop}%
\ifempty\currenttypingparent
\normalexpanded{\definelinenumbering[\currenttyping]}%
\else
@@ -287,8 +278,8 @@
\futureexpand\bgroup\buff_verbatim_type_a\buff_verbatim_type_one}
\def\buff_verbatim_type_one
- {\catcode`<=\othercatcode % old precaution
- \catcode`>=\othercatcode % old precaution
+ {\catcode\lessthanasciicode\othercatcode % old precaution
+ \catcode\morethanasciicode\othercatcode % old precaution
\futureexpandis<\buff_verbatim_type_b\buff_verbatim_type_c}
\def\buff_verbatim_type_three
@@ -451,34 +442,33 @@
\mutable\let\beginofverbatimlines\relax % hooks
\mutable\let\endofverbatimlines \relax % hooks
-\protected\def\buff_verbatim_typing_start#1% tricky non standard lookahead
+\protected\def\buff_verbatim_typing_start#1#2% tricky non standard lookahead
{\begingroup
- \edef\currenttyping{#1}%
+ \edef\currenttyping {#1}%
+ \edef\currenttypingwrapper{#2}%
\obeylines
\futureexpandis[\buff_verbatim_typing_start_yes\buff_verbatim_typing_start_nop}
-\def\buff_verbatim_typing_start_nop
- {\typingparameter\c!before\relax
- \startpacked[\v!blank]%
+\def\buff_verbatim_typing_start_yes[#1]%
+ {\ifhastok={#1}%
+ \setupcurrenttyping[#1]%
+ \orelse\ifcstok{#1}\v!continue
+ \lettypingparameter\c!continue\v!yes
+ \fi
+ \typingparameter\c!before\relax % moved down
+ \startpacked[\v!blank]% % moved down
\buff_verbatim_setup_line_numbering
\buff_verbatim_initialize_typing_one
\buff_verbatim_setup_keep_together
- \normalexpanded{\buff_verbatim_type_block{\e!start\currenttyping}{\e!stop\currenttyping}}}
+ \normalexpanded{\buff_verbatim_type_block{\e!start\currenttypingwrapper}{\e!stop\currenttypingwrapper}}}
-\def\buff_verbatim_typing_start_yes[#1]%
+\def\buff_verbatim_typing_start_nop
{\typingparameter\c!before\relax
\startpacked[\v!blank]%
- \ifcondition\validassignment{#1}%
- \setupcurrenttyping[#1]%
- \else
- \doif\v!continue{#1}{\lettypingparameter\c!continue\v!yes}%
- \fi
\buff_verbatim_setup_line_numbering
\buff_verbatim_initialize_typing_one
\buff_verbatim_setup_keep_together
- \normalexpanded{\buff_verbatim_type_block{\e!start\currenttyping}{\e!stop\currenttyping}}}
-
-% \startnamedtyping[#1]
+ \normalexpanded{\buff_verbatim_type_block{\e!start\currenttypingwrapper}{\e!stop \currenttypingwrapper}}}
\protected\def\buff_verbatim_setup_keep_together
{\edef\p_keeptogether{\typingparameter\c!keeptogether}%
@@ -517,13 +507,18 @@
\dostoptagged
\begincsname#2\endcsname}
-\protected\def\buff_verbatim_typing_stop#1% hm, currenttyping
+\protected\def\buff_verbatim_typing_stop
{\stoppacked
\typingparameter\c!after\relax
\useindentnextparameter\typingparameter
\endgroup
\dorechecknextindentation}
+\permanent\protected\def\startnamedtyping[#1]%
+ {\buff_verbatim_typing_start{#1}\e!namedtyping}
+
+\permanent\let\stopnamedtyping\buff_verbatim_typing_stop
+
%D Line numbering for files is combined with filtering, while display verbatim has
%D the ability to continue.
%D
@@ -577,10 +572,10 @@
% [category] [settings] {name} % for historic reasons, all filenames are {}
-\mutable\let\currenttypingfile\empty
+\mutable\lettonothing\currenttypingfile
\appendtoks
- \frozen\instance\setuevalue{\e!type\currenttyping\v!file}{\typefile[\currenttyping]}%
+ \frozen\protected\instance\edefcsname\e!type\currenttyping\v!file\endcsname{\typefile[\currenttyping]}%
\to \everydefinetyping
\permanent\tolerant\protected\def\typefile[#1]#*[#2]#:#3%
@@ -769,11 +764,13 @@
{\buff_verbatim_type_defined_buffer[\v!buffer][\thedefinedbuffer{#1}]}%
\appendtoks
- \frozen\instance\setuevalue{\e!type\currentbuffer}{\buff_verbatim_type_defined_buffer[\v!buffer][\currentdefinedbuffer]}%
+ \frozen\instance\protected\edefcsname\e!type\currentbuffer\endcsname
+ {\buff_verbatim_type_defined_buffer[\v!buffer][\currentdefinedbuffer]}%
\to \everydefinebuffer
\appendtoks % \e!buffer
- \frozen\instance\setuevalue{\e!type\currenttyping\v!buffer}{\buff_verbatim_type_buffer_class{\currenttyping}}%
+ \frozen\instance\protected\edefcsname\e!type\currenttyping\v!buffer\endcsname
+ {\buff_verbatim_type_buffer_class{\currenttyping}}%
\to \everydefinetyping
\tolerant\protected\def\buff_verbatim_type_buffer[#1]#*[#2]%
@@ -835,13 +832,25 @@
\stoppacked
\typingparameter\c!after\relax}
-\permanent\protected\def\typeinlinebuffer
+\permanent\tolerant\protected\def\typeinlinebuffer[#1]#,[#2]%
{\dontleavehmode
\begingroup
- \enforced\let\buff_verbatim_type_buffer_indeed\buff_verbatim_type_buffer_indeed_inline
\enforced\let\setupcurrenttyping\setupcurrenttype % a terrible hack but it saves code
- \let\currenttype\empty
- \buff_verbatim_type_buffer}
+ \lettonothing\currenttype
+ \ifparameters
+ \buff_verbatim_type_buffer_indeed_inline\currenttyping\empty% []
+ \or
+ \ifhastok={#1}%
+ \setupcurrenttyping[#1]%
+ \buff_verbatim_type_buffer_indeed_inline\currenttyping\empty% [settings]
+ \else
+ \processcommalist[#1]{\buff_verbatim_type_buffer_indeed_inline\currenttyping}% [name]
+ \fi
+ \or
+ \setupcurrenttyping[#2]%
+ \processcommalist[#1]{\buff_verbatim_type_buffer_indeed_inline\currenttyping}% [name] [settings]
+ \fi
+ \endgroup}
\protected\def\buff_verbatim_type_buffer_indeed_inline#1#2% category name
{\edef\currenttype{#1}%
@@ -896,11 +905,11 @@
% line numbering, keep broken lines together
-\newcount\nofverbatimlines
+\newinteger\nofverbatimlines
\protected\def\buff_verbatim_begin_of_line
{\ifconditional\verbatimnumberinglines
- \global\advance\nofverbatimlines\plusone
+ \global\advanceby\nofverbatimlines\plusone
\c_attr_verbatimline\nofverbatimlines
\fi
\noindent
@@ -928,8 +937,8 @@
% hooks (todo: frozen):
-\newcount \c_buff_verbatim_noflines
-\newcount \c_buff_verbatim_current
+\newinteger \c_buff_verbatim_noflines
+\newinteger \c_buff_verbatim_current
\newconditional\c_buff_optimize_linebreaks
\permanent\protected\def\doverbatimspace {\obeyedspace}
@@ -940,10 +949,10 @@
\permanent\protected\def\doinlineverbatimnewline {\obeyedspace}
\permanent\protected\def\doinlineverbatimemptyline {\obeyedspace}
-\permanent\protected\def\dodisplayverbatimstart {\advance\c_buff_verbatim_current\plusone
+\permanent\protected\def\dodisplayverbatimstart {\advanceby\c_buff_verbatim_current\plusone
\buff_verbatim_begin_of_line}
\permanent\protected\def\dodisplayverbatimstop {\buff_verbatim_end_of_line}
-\permanent\protected\def\dodisplayverbatimbeginline{\advance\c_buff_verbatim_current\plusone
+\permanent\protected\def\dodisplayverbatimbeginline{\advanceby\c_buff_verbatim_current\plusone
\buff_verbatim_begin_of_line}
\permanent\protected\def\dodisplayverbatimnewline {\buff_verbatim_end_of_line
\par
diff --git a/Master/texmf-dist/tex/context/base/mkxl/catc-def.mkxl b/Master/texmf-dist/tex/context/base/mkxl/catc-def.mkxl
index a7d48714a5c..1bde9877447 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/catc-def.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/catc-def.mkxl
@@ -17,17 +17,20 @@
%D days of \LUATEX) was dropped when I realized that there is not common ground to
%D cover between formats. It is simply not worth the trouble.
+%D Maybe we also need a copy of \type {\ctxcatcodes} so that we can always go back
+%D to the unpatched regime.
+
\ifdefined\nilcatcodes \else \newcatcodetable \nilcatcodes \fi
\ifdefined\texcatcodes \else \newcatcodetable \texcatcodes \fi
\ifdefined\luacatcodes \else \newcatcodetable \luacatcodes \fi
\ifdefined\notcatcodes \else \newcatcodetable \notcatcodes \fi
-\ifdefined\rlncatcodes \else \newcatcodetable \rlncatcodes \fi
+\ifdefined\rlncatcodes \else \newcatcodetable \rlncatcodes \fi % readline, not for context
\ifdefined\vrbcatcodes \else \newcatcodetable \vrbcatcodes \fi
\ifdefined\prtcatcodes \else \newcatcodetable \prtcatcodes \fi
\ifdefined\ctxcatcodes \else \newcatcodetable \ctxcatcodes \fi
\ifdefined\txtcatcodes \else \newcatcodetable \txtcatcodes \fi
-\ifdefined\tpacatcodes \else \newcatcodetable \tpacatcodes \fi % { }
-\ifdefined\tpbcatcodes \else \newcatcodetable \tpbcatcodes \fi % < >
+\ifdefined\tpacatcodes \else \newcatcodetable \tpacatcodes \fi % verbatim: { }
+\ifdefined\tpbcatcodes \else \newcatcodetable \tpbcatcodes \fi % verbatim: < >
\ifdefined\ctdcatcodes \else \newcatcodetable \ctdcatcodes \fi % context definitions
\startcatcodetable \nilcatcodes
@@ -251,6 +254,9 @@
\letcatcodecommand \ctxcatcodes \barasciicode \relax
\letcatcodecommand \ctxcatcodes \tildeasciicode \relax
+% \letcatcodecommand \prtcatcodes \barasciicode \relax
+% \letcatcodecommand \prtcatcodes \tildeasciicode \relax
+
%D Because some characters have a special meaning, we provide shortcuts to their
%D character representation. Some will be overloaded (which might change).
@@ -270,4 +276,14 @@
\aliased\let\defaultcatcodetable\ctxcatcodes
\popoverloadmode
+\amcode \circumflexasciicode \superscriptcatcode
+\amcode \underscoreasciicode \subscriptcatcode
+\amcode \barasciicode \othercatcode
+\amcode \tildeasciicode \othercatcode
+
+% \amcode "002C \activecatcode % comma
+% \amcode "002E \activecatcode % period
+% \amcode "003A \activecatcode % colon
+% \amcode "003B \activecatcode % semicolon
+
\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/catc-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/catc-ini.mkxl
index 5b33db981d6..d8c4da04060 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/catc-ini.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/catc-ini.mkxl
@@ -39,21 +39,22 @@
%D We predefine some prefixes ahead of syst-aux and mult-sys. We reserve 8 slots for
%D catcodes. (This active mess probably needs an update some day.)
-\installsystemnamespace{catcodelet} % let : \let
-\installsystemnamespace{catcodedef} % def : \def
-\installsystemnamespace{catcodeued} % ued : \protected\def
-\installsystemnamespace{catcodeget} % \meaning
+% \installsystemnamespace{catcodelet} % let : \let
+% \installsystemnamespace{catcodedef} % def : \def
+% \installsystemnamespace{catcodeued} % ued : \protected\def
+% \installsystemnamespace{catcodeget} % \meaning
\installsystemnamespace{catcodetablet}
\installsystemnamespace{catcodetablen}
-\newcount\c_syst_catcodes_n \c_syst_catcodes_n\zerocount % 0 = signal, so advance before allocate
-\newcount\c_syst_catcodes_a
-\newcount\c_syst_catcodes_b
-\newcount\c_syst_catcodes_c
+\newinteger\c_syst_catcodes_n \c_syst_catcodes_n\zerocount % 0 = signal, so advance before allocate
+
+%newinteger\c_syst_catcodes_a
+%newinteger\c_syst_catcodes_b
+%newinteger\c_syst_catcodes_c
\permanent\protected\def\newcatcodetable#1% we could move the cctdefcounter to lua
- {\global\advance\c_syst_catcodes_n\plusone
+ {\global\advanceby\c_syst_catcodes_n\plusone
\gdefcsname\??catcodetablen\number\c_syst_catcodes_n\endcsname{\string#1}% logging
\immutable\integerdef#1\c_syst_catcodes_n
\ctxlua{catcodes.register("\expandafter\gobbleoneargument\string#1",\number#1)}}
@@ -92,6 +93,8 @@
\aliased\let\permitcaretescape\permitcircumflexescape
+\newconstant\defaultcatcodetable
+
% ==
%
% \protected\def\startextendcatcodetable#1#2\stopextendcatcodetable
@@ -104,87 +107,147 @@
%D The next command can be defined in a cleaner way in the MkIV way but we want
%D to have a fast one with a minimal chance for interference. Do we still need
%D this complex mechanism? Probably not. Future versions of \MKIV\ might only use
-%D active characters for very special cases.
-
-\setnewconstant\c_syst_catcodes_hack\tildeasciicode
-
-%D Once a catcode is assigned, the next assignments will happen faster. However,
-%D redefinitions probably happen seldom so it's sort of overkill.
-
-\permanent\protected\def\letcatcodecommand{\afterassignment\syst_catcodes_let_a\c_syst_catcodes_a}
-\permanent\protected\def\defcatcodecommand{\afterassignment\syst_catcodes_def_a\c_syst_catcodes_a}
-\permanent\protected\def\uedcatcodecommand{\afterassignment\syst_catcodes_ued_a\c_syst_catcodes_a}
-
-\def\syst_catcodes_let_a{\afterassignment\syst_catcodes_let_b\c_syst_catcodes_b}
-\def\syst_catcodes_def_a{\afterassignment\syst_catcodes_def_b\c_syst_catcodes_b}
-\def\syst_catcodes_ued_a{\afterassignment\syst_catcodes_ued_b\c_syst_catcodes_b}
-
-\def\syst_catcodes_let_b % each time
- {\ifcsname\??catcodelet\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname
- \expandafter\lastnamedcs
- \else
- \expandafter\syst_catcodes_let_c
- \fi}
-
-\def\syst_catcodes_def_b % each time
- {\ifcsname\??catcodedef\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname
- \expandafter\lastnamedcs
- \else
- \expandafter\syst_catcodes_def_c
- \fi}
-
-\def\syst_catcodes_ued_b % each time
- {\ifcsname\??catcodeued\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname
- \expandafter\lastnamedcs
- \else
- \expandafter\syst_catcodes_ued_c
- \fi}
-
-\def\syst_catcodes_let_c % only first time
- {\frozen\enforced\gdefcsname\??catcodelet\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\expandafter\endcsname\expandafter
- {\enforced\letcsname\??catcodeget\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname}%
- \syst_catcodes_reinstate_unexpanded
- \csname\??catcodelet\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname}
+%D active characters for very special cases. Older files demonstrate this old
+%D hackery tilde abuse.
-\def\syst_catcodes_def_c % only first time (we could use \normalexpanded here)
- {\frozen\enforced\gdefcsname\??catcodedef\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\expandafter\endcsname
- \expandafter##\expandafter1\expandafter
- {\frozen\enforced\defcsname\??catcodeget\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname{##1}}%
- \syst_catcodes_reinstate_normal
- \csname\??catcodedef\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname}
+% %D Once a catcode is assigned, the next assignments will happen faster. However,
+% %D redefinitions probably happen seldom so it's sort of overkill. We also need to
+% %D take care of the initial (shared between catcode regfimes) binding.
+%
+% \permanent\protected\def\letcatcodecommand{\afterassignment\syst_catcodes_let_a\c_syst_catcodes_a}
+% \permanent\protected\def\defcatcodecommand{\afterassignment\syst_catcodes_def_a\c_syst_catcodes_a} % obsolete
+% \permanent\protected\def\uedcatcodecommand{\afterassignment\syst_catcodes_ued_a\c_syst_catcodes_a} % obsolete
+%
+% \def\syst_catcodes_let_a{\afterassignment\syst_catcodes_let_b\c_syst_catcodes_b}
+% \def\syst_catcodes_def_a{\afterassignment\syst_catcodes_def_b\c_syst_catcodes_b}
+% \def\syst_catcodes_ued_a{\afterassignment\syst_catcodes_ued_b\c_syst_catcodes_b}
+%
+% % The two step definition is used because we need to fetch the third argument.
+%
+% \def\syst_catcodes_let_b % each time
+% {\ifcsname\??catcodelet\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname
+% \expandafter\lastnamedcs
+% \else
+% \expandafter\syst_catcodes_let_c
+% \fi}
+%
+% \def\syst_catcodes_def_b % each time
+% {\ifcsname\??catcodedef\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname
+% \expandafter\lastnamedcs
+% \else
+% \expandafter\syst_catcodes_def_c
+% \fi}
+%
+% \def\syst_catcodes_ued_b % each time
+% {\ifcsname\??catcodeued\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname
+% \expandafter\lastnamedcs
+% \else
+% \expandafter\syst_catcodes_ued_c
+% \fi}
+%
+% \def\syst_catcodes_let_c % only first time
+% {\frozen\enforced\gdefcsname\??catcodelet\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\expandafter\endcsname\expandafter
+% {\expandafter\enforced\letcsname\??catcodeget\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname}%
+% \syst_catcodes_reinstate_unexpanded
+% \csname\??catcodelet\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname}
+%
+% \def\syst_catcodes_def_c % only first time (we could use \normalexpanded here)
+% {\frozen\enforced\gdefcsname\??catcodedef\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\expandafter\endcsname
+% \expandafter##\expandafter1\expandafter
+% {\expandafter\frozen\expandafter\enforced\defcsname\??catcodeget\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname{##1}}%
+% \syst_catcodes_reinstate_normal
+% \csname\??catcodedef\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname}
+%
+% \def\syst_catcodes_ued_c % only first time
+% {\frozen\enforced\gdefcsname\??catcodeued\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\expandafter\endcsname
+% \expandafter##\expandafter1\expandafter
+% {\expandafter\frozen\expandafter\enforced\expandafter\protected\defcsname\??catcodeget\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname{##1}}%
+% \syst_catcodes_reinstate_unexpanded
+% \csname\??catcodeued\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname}
+%
+% %D We can simplify this a bit (not that critical):
+%
+% \def\syst_catcodes_let_b
+% {\afterassignment\syst_catcodes_let_c\let\m_syst_catcodes_temp}
+%
+% \def\syst_catcodes_let_c
+% {\enforced\letcsname\??catcodeget\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname\m_syst_catcodes_temp
+% \protected\edef\m_syst_catcodes_temp{\noexpand\catcodecommand{\number\c_syst_catcodes_b}}%
+% \letcharcode\c_syst_catcodes_b\m_syst_catcodes_temp}
+%
+% \def\syst_catcodes_let_c
+% {\letcharcode\c_syst_catcodes_b\m_syst_catcodes_temp}
+%
+% % not that much gain:
+%
+% \def\syst_catcodes_let_c % only first time
+% {\expandafter\integerdef\csname\??catcodelet\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname\c_syst_catcodes_b
+% \letcsname\??catcodeget\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname\m_syst_catcodes_temp
+% \protected\edef\m_syst_catcodes_temp{\noexpand\catcodecommand\csname\??catcodelet\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname}%
+% \letcharcode\c_syst_catcodes_b\m_syst_catcodes_temp}
-\def\syst_catcodes_ued_c % only first time
- {\frozen\enforced\gdefcsname\??catcodeued\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\expandafter\endcsname
- \expandafter##\expandafter1\expandafter
- {\frozen\enforced\protected\defcsname\??catcodeget\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname{##1}}%
- \syst_catcodes_reinstate_unexpanded
- \csname\??catcodeued\number\c_syst_catcodes_a:\number\c_syst_catcodes_b\endcsname}
+%D This can be used when a direct definition has been done and the selector has been
+%D lost. I really need to get rid of this ...
-\permanent\def\reinstatecatcodecommand{\afterassignment\syst_catcodes_reinstate_normal\c_syst_catcodes_b}
+% \permanent\def\reinstatecatcodecommand{\afterassignment\syst_catcodes_reinstate_normal\c_syst_catcodes_b}
+%
+% \let\m_syst_catcodes_temp\relax
+%
+% \def\syst_catcodes_reinstate_normal
+% {\edef\m_syst_catcodes_temp{\noexpand\catcodecommand{\number\c_syst_catcodes_b}}%
+% \letcharcode\c_syst_catcodes_b\m_syst_catcodes_temp}
+%
+% \def\syst_catcodes_reinstate_unexpanded
+% {\protected\edef\m_syst_catcodes_temp{\noexpand\catcodecommand{\number\c_syst_catcodes_b}}%
+% \letcharcode\c_syst_catcodes_b\m_syst_catcodes_temp}
+%
+% \permanent\def\catcodecommand#1%
+% {\csname\??catcodeget\number
+% \ifcsname\??catcodeget\number\currentcatcodetable:\number#1\endcsname
+% \currentcatcodetable \else \defaultcatcodetable
+% \fi
+% :\number#1\endcsname}
+
+%D For now, will become just letcharcode:
+
+\permanent\protected\def\letcatcodecommand{\afterassignment\letcharcode\scratchcounter}
+
+%D \startbuffer
+%D \def\foo{foo}
+%D \start
+%D \pushactivechar | \letcharcode124 \foo test||test\par
+%D \popactivechar | test||test\par
+%D \stop
+%D \start
+%D \pushactivecharcode124 \letcharcode124 \foo test||test\par
+%D \popactivecharcode 124 test||test\par
+%D \stop
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
-%D This can be used when a direct definition has been done and the selector has been
-%D lost. A problem is that \type {\next} needs to be unique (as it gets bound) (still?).
+\permanent\protected\def\pushactivechar#1%
+ {\expandafter\let\expandafter\m_active\csname\csactive#1\endcsname
+ %\expandafter\let\expandafter\m_active\csname\Uchar"FFFF\Uchar\expandafter`\string#1\endcsname
+ \pushmacro\m_active}
-\def\syst_catcodes_reinstate_normal
- {\begingroup
- \edef\temp{\noexpand\catcodecommand{\number\c_syst_catcodes_b}}%
- \global\letcharcode\c_syst_catcodes_b\temp
- \endgroup}
+\permanent\protected\def\popactivechar#1%
+ {\popmacro\m_active
+ %\letcsname\Uchar"FFFF\Uchar\expandafter`\string#1\endcsname\m_active
+ \letcsname\csactive#1\endcsname\m_active}
-\def\syst_catcodes_reinstate_unexpanded
- {\begingroup
- \protected\edef\temp{\noexpand\catcodecommand{\number\c_syst_catcodes_b}}%
- \global\letcharcode\c_syst_catcodes_b\temp
- \endgroup}
+\permanent\protected\def\pushactivecharcode{\afterassignment\syst_active_push\integerdef\c_active_char_code}
+\permanent\protected\def\popactivecharcode {\afterassignment\syst_active_pop\integerdef \c_active_char_code}
-\newconstant\defaultcatcodetable
+\permanent\protected\def\syst_active_push
+ {\expandafter\let\expandafter\m_active\csname\csactive\Uchar\c_active_char_code\endcsname
+ %\expandafter\let\expandafter\m_active\csname\Uchar"FFFF\Uchar\c_active_char_code\endcsname
+ \pushmacro\m_active}
-\permanent\def\catcodecommand#1%
- {\csname\??catcodeget\number
- \ifcsname\??catcodeget\number\currentcatcodetable:\number#1\endcsname
- \currentcatcodetable \else \defaultcatcodetable
- \fi
- :\number#1\endcsname}
+\permanent\protected\def\syst_active_pop
+ {\popmacro\m_active
+ %\letcsname\Uchar"FFFF\Uchar\c_active_char_code\endcsname\m_active
+ \letcsname\csactive\Uchar\c_active_char_code\endcsname\m_active}
%D \macros
%D {restorecatcodes,pushcatcodetable,popcatcodetable}
@@ -199,10 +262,10 @@
%D pop catcode tables and as we keep track of used tables users seldom need to deal
%D with this themselves.
-\newcount\c_syst_catcodes_level
+\newinteger\c_syst_catcodes_level
\permanent\protected\def\pushcatcodetable
- {\advance\c_syst_catcodes_level\plusone
+ {\advanceby\c_syst_catcodes_level\plusone
\syst_catcodes_trace_push
\expandafter\integerdef\csname\??catcodetablet\number\c_syst_catcodes_level\endcsname\currentcatcodetable}
@@ -212,7 +275,7 @@
\else
\catcodetable\csname\??catcodetablet\number\c_syst_catcodes_level\endcsname
\syst_catcodes_trace_pop
- \advance\c_syst_catcodes_level\minusone
+ \advanceby\c_syst_catcodes_level\minusone
\fi}
\protected\def\syst_catcodes_trace_nesting_error
@@ -256,9 +319,9 @@
-%
\fi}
-\let\syst_catcodes_trace_set \empty
-\let\syst_catcodes_trace_push\empty
-\let\syst_catcodes_trace_pop \empty
+\lettonothing\syst_catcodes_trace_set
+\lettonothing\syst_catcodes_trace_push
+\lettonothing\syst_catcodes_trace_pop
% \tracecatcodetables
diff --git a/Master/texmf-dist/tex/context/base/mkxl/catc-sym.mkxl b/Master/texmf-dist/tex/context/base/mkxl/catc-sym.mkxl
index a96ffb865c0..b441856e9a8 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/catc-sym.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/catc-sym.mkxl
@@ -64,20 +64,15 @@
\protect
%D \macros
-%D {uncatcodespecials,setnaturalcatcodes,setnormalcatcodes,
-%D uncatcodecharacters,uncatcodeallcharacters,
-%D uncatcodespacetokens}
+%D {setnormalcatcodes,uncatcodespacetokens}
%D
%D The following macros are more or less replaced by switching to a catcode table
%D (which we simulate in \MKII) but we keep them for convenience and compatibility.
%D Some old engine code has been removed. A few ar still used a few times so I need
%D to clean that up.
-%permanent\protected\def\uncatcodespecials {\setcatcodetable\nilcatcodes \uncatcodespacetokens}
-%permanent\protected\def\setnaturalcatcodes {\setcatcodetable\nilcatcodes}
-\permanent\protected\def\setnormalcatcodes {\setcatcodetable\ctxcatcodes} % maybe \texcatcodes
-%permanent\protected\def\uncatcodecharacters {\setcatcodetable\nilcatcodes} % was fast version, gone now
-%permanent\protected\def\uncatcodeallcharacters{\setcatcodetable\nilcatcodes} % was slow one, with restore
+\permanent\protected\def\setnormalcatcodes
+ {\setcatcodetable\ctxcatcodes} % maybe \texcatcodes
\permanent\protected\def\uncatcodespacetokens
{\catcode\spaceasciicode \spacecatcode
diff --git a/Master/texmf-dist/tex/context/base/mkxl/char-brl.lmt b/Master/texmf-dist/tex/context/base/mkxl/char-brl.lmt
new file mode 100644
index 00000000000..046436b5977
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/char-brl.lmt
@@ -0,0 +1,405 @@
+if not modules then modules = { } end modules ['char-bri'] = {
+ version = 1.001,
+ comment = "companion to char-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- We use a somewhat indirect approach because we generated the database and
+-- have to do that again probably. At some point we can move some to char-def
+-- so the interfaces here are kind of private and can change.
+--
+-- This is just an experiment. The data is taken from Wikipedia and the nemeth
+-- sequences come from a 2021 blog by Murray Sargent (from Microsoft):
+--
+-- https://devblogs.microsoft.com/math-in-office/unicode-math-braille-sequences/
+
+local next = next
+local gsub = string.gsub
+local utfbyte, utfsplit = utf.byte, string.utfvaluetable
+local sortedkeys = table.sortedkeys
+
+local braille = { }
+characters.braille = braille
+
+local codepoints = {
+ digits = {
+ [48] = "â š",
+ [49] = "â ",
+ [50] = "â ƒ",
+ [51] = "â ‰",
+ [52] = "â ™",
+ [53] = "â ‘",
+ [54] = "â ‹",
+ [55] = "â ›",
+ [56] = "â “",
+ [57] = "â Š",
+ },
+ letters = {
+ [97] = "â ",
+ [98] = "â ƒ",
+ [99] = "â ‰",
+ [100] = "â ™",
+ [101] = "â ‘",
+ [102] = "â ‹",
+ [103] = "â ›",
+ [104] = "â “",
+ [105] = "â Š",
+ [106] = "â š",
+ [107] = "â …",
+ [108] = "â ‡",
+ [109] = "â ",
+ [110] = "â ",
+ [111] = "â •",
+ [112] = "â ",
+ [113] = "â Ÿ",
+ [114] = "â —",
+ [115] = "â Ž",
+ [116] = "â ž",
+ [117] = "â ¥",
+ [118] = "â §",
+ [119] = "â º",
+ [120] = "â ­",
+ [121] = "â ½",
+ [122] = "â µ",
+ },
+ punctuation = {
+ [33] = "â –",
+ [34] = "⠸⠡",
+ [40] = "â â £",
+ [41] = "â â œ",
+ [44] = "â ‚",
+ [45] = "â ¤",
+ [46] = "â ²",
+ [47] = "⠸⠌",
+ [58] = "â ’",
+ [59] = "â †",
+ [63] = "â ¦",
+ [8211] = "â  â ¤",
+ [8212] = "â â  â ¤",
+ [8216] = "â „â ¦",
+ [8217] = "â „â ´",
+ [8220] = "⠘⠦",
+ [8221] = "⠘⠴",
+ },
+ ueb = {
+ [33] = "â –",
+ [34] = "â  â ¶",
+ [35] = "⠸⠹",
+ [36] = "⠈⠎",
+ [37] = "⠨⠴",
+ [38] = "⠈⠯",
+ [39] = "â „",
+ [40] = "â â £",
+ [41] = "â â œ",
+ [42] = "â â ”",
+ [43] = "â â –",
+ [44] = "â ‚",
+ [45] = "â ¤",
+ [46] = "⠼⠲",
+ [47] = "⠸⠌",
+ [58] = "â ’",
+ [59] = "â †",
+ [60] = "⠈⠣",
+ [61] = "â â ¶",
+ [62] = "⠈⠜",
+ [63] = "â ¦",
+ [64] = "â ˆâ ",
+ [91] = "⠨⠣",
+ [92] = "⠸⠡",
+ [93] = "⠨⠜",
+ [94] = "⠈⠢",
+ [95] = "⠨⠤",
+ [123] = "⠸⠣",
+ [124] = "⠸⠳",
+ [125] = "⠸⠜",
+ [126] = "⠈⠔",
+ [162] = "⠈⠉",
+ [163] = "⠈⠇",
+ [167] = "⠘⠎",
+ [169] = "⠘⠉",
+ [172] = "⠈⠹",
+ [174] = "⠘⠗",
+ [176] = "⠘⠚",
+ [177] = "⠸⠖",
+ [182] = "â ˜â ",
+ [215] = "â â ¦",
+ [247] = "â â Œ",
+ [913] = "â  â ¨â ",
+ [914] = "⠠⠨⠃",
+ [915] = "⠠⠨⠛",
+ [916] = "⠠⠨⠙",
+ [917] = "⠠⠨⠑",
+ [918] = "⠠⠨⠵",
+ [919] = "⠠⠨⠱",
+ [920] = "⠠⠨⠹",
+ [921] = "⠠⠨⠊",
+ [922] = "⠠⠨⠅",
+ [923] = "⠠⠨⠇",
+ [924] = "â  â ¨â ",
+ [925] = "â  â ¨â ",
+ [926] = "⠠⠨⠭",
+ [927] = "⠠⠨⠕",
+ [928] = "â  â ¨â ",
+ [929] = "⠠⠨⠗",
+ [931] = "⠠⠨⠎",
+ [932] = "⠠⠨⠞",
+ [933] = "⠠⠨⠥",
+ [934] = "⠠⠨⠋",
+ [935] = "⠠⠨⠯",
+ [936] = "⠠⠨⠽",
+ [937] = "⠠⠨⠺",
+ [945] = "â ¨â ",
+ [946] = "⠨⠃",
+ [947] = "⠨⠛",
+ [948] = "⠨⠙",
+ [949] = "⠨⠑",
+ [950] = "⠨⠵",
+ [951] = "⠨⠱",
+ [952] = "⠨⠹",
+ [953] = "⠨⠊",
+ [954] = "⠨⠅",
+ [955] = "⠨⠇",
+ [956] = "â ¨â ",
+ [957] = "â ¨â ",
+ [958] = "⠨⠭",
+ [959] = "⠨⠕",
+ [960] = "â ¨â ",
+ [961] = "⠨⠗",
+ [962] = "⠨⠎",
+ [963] = "⠨⠎",
+ [964] = "⠨⠞",
+ [965] = "⠨⠥",
+ [966] = "⠨⠋",
+ [967] = "⠨⠯",
+ [968] = "⠨⠽",
+ [969] = "⠨⠺",
+ [8212] = "â  â ¤",
+ [8213] = "â â  â ¤",
+ [8216] = "â  â ¦",
+ [8217] = "â  â ´",
+ [8220] = "⠘⠦",
+ [8221] = "⠘⠴",
+ [8224] = "⠈⠠⠹",
+ [8225] = "⠈⠠⠻",
+ [8226] = "⠸⠲",
+ [8242] = "â ¶",
+ [8243] = "⠶⠶",
+ [8592] = "⠳⠪",
+ [8593] = "⠳⠬",
+ [8594] = "⠳⠕",
+ [8595] = "⠳⠩",
+ [8596] = "⠰⠳⠺⠗⠕",
+ [8598] = "⠳⠱",
+ [8599] = "⠳⠎",
+ [8600] = "⠳⠣",
+ [8601] = "⠳⠜",
+ [8656] = "⠰⠳⠶⠶⠪",
+ [8657] = "⠰⠳⠶⠶⠬",
+ [8658] = "⠰⠳⠶⠶⠕",
+ [8659] = "⠰⠳⠶⠶⠩",
+ [8704] = "â ˜â ",
+ [8706] = "⠈⠙",
+ [8707] = "⠘⠢",
+ [8709] = "⠈⠚",
+ [8711] = "⠘⠙",
+ [8712] = "⠘⠑",
+ [8715] = "⠈⠘⠑",
+ [8722] = "â â ¤",
+ [8723] = "⠸⠤",
+ [8728] = "â â ´",
+ [8730] = "â â ©",
+ [8733] = "â ¸â â ¶",
+ [8734] = "⠼⠿",
+ [8736] = "⠸⠪",
+ [8737] = "⠨⠸⠪",
+ [8741] = "⠼⠇",
+ [8743] = "⠈⠦",
+ [8744] = "⠈⠖",
+ [8745] = "⠨⠦",
+ [8746] = "⠨⠖",
+ [8747] = "â ®",
+ [8748] = "⠮⠮",
+ [8749] = "⠮⠮⠮",
+ [8750] = "⠈⠮",
+ [8756] = "â  â ¡",
+ [8757] = "⠈⠌",
+ [8758] = "â ’",
+ [8759] = "â ’â ’",
+ [8771] = "⠸⠔",
+ [8773] = "â â ¸â ”",
+ [8776] = "⠘⠔",
+ [8783] = "â ˜â â ¶",
+ [8785] = "â ¨â â ¶",
+ [8800] = "â â ¶â ˆâ ±",
+ [8801] = "⠸⠿",
+ [8804] = "⠸⠈⠣",
+ [8805] = "⠸⠈⠜",
+ [8810] = "⠨⠈⠣",
+ [8811] = "⠨⠈⠜",
+ [8834] = "⠘⠣",
+ [8835] = "⠘⠜",
+ [8838] = "⠸⠘⠣",
+ [8839] = "⠸⠘⠜",
+ [8842] = "⠨⠘⠣",
+ [8843] = "⠨⠘⠜",
+ [8853] = "â °â «â ¿â ªâ â –â ±",
+ [8867] = "⠈⠸⠒",
+ [8869] = "⠼⠤",
+ [8870] = "⠸⠒",
+ [8872] = "⠘⠸⠒",
+ [8882] = "⠈⠸⠣",
+ [8883] = "⠈⠸⠜",
+ [8884] = "⠸⠸⠣",
+ [8885] = "⠸⠸⠜",
+ [8894] = "⠼⠸⠪",
+ [8901] = "â â ²",
+ [9675] = "â ¿",
+ [10764] = "⠮⠮⠮⠮",
+ },
+ specials = {
+ uppercase = "â  ",
+ space = "â €",
+ number = "â ¼",
+ rule = "â ’",
+ },
+ alphabets = {
+ ["lowercasenormal"] = "â °",
+ ["lowercasegreeknormal"] = "â ¨",
+ ["lowercasegreekitalic"] = "⠨⠨",
+ ["lowercaseitalic"] = "â ¨",
+ ["lowercasebold"] = "â ¸",
+ ["lowercasebolditalic"] = "⠸⠨",
+ ["lowercasefraktur"] = "â ¸",
+ ["lowercaseboldfraktur"] = "⠸⠸",
+ ["lowercasescript"] = "â ˆ",
+ ["lowercaseboldscript"] = "⠸⠈",
+ ["lowercasesansserifnormal"] = "â  â ¨",
+ ["lowercasesansserifitalic"] = "⠠⠨⠨",
+ ["lowercasesansserifbold"] = "⠠⠨⠸",
+ ["lowercasesansserifbolditalic"] = "⠠⠨⠸⠨",
+
+ ["uppercase"] = "â  ",
+
+ -- ["russian"] = "⠈⠈",
+ -- ["hebrew"] = "â  â  ",
+ -- ["altgreek"] = "⠨⠈",
+
+ -- ["lowercasedoublestruck"] = ""
+ -- ["lowercasegreekbold"] = ""
+ -- ["lowercasegreekbolditalic"] = ""
+ -- ["lowercasegreeksansserifbold"] = ""
+ -- ["lowercasegreeksansserifbolditalic"] = ""
+ -- ["lowercasemonospace"] = ""
+ },
+}
+
+braille.codepoints = codepoints
+
+local textunicodes, mathunicodes, textstrings, mathstrings, textlist, mathlist, specials
+
+local function prepare()
+
+ local charblocks = characters.blocks
+ local uccodes = characters.uccodes
+
+ local letters = codepoints.letters
+ local cspecials = codepoints.specials
+ local uppercase = cspecials.uppercase
+ local number = cspecials.number
+ local space = cspecials.space
+ local rule = cspecials.rule
+
+ -- filtered from the mentioned blog webpage:
+
+ local nemeth = table.load(resolvers.find_file("math-brl.lmt")).nemeth
+ codepoints.nemeth = nemeth
+
+ -- we let the tex math engine do the spacing but it can become an option:
+
+ for k, v in next, nemeth do
+ nemeth[k] = gsub(v,space,"")
+ end
+
+ textstrings = { }
+ mathstrings = { }
+ textunicodes = { }
+ mathunicodes = { }
+
+ for k, v in next, codepoints.letters do
+ textstrings[k] = v
+ mathstrings[k] = v
+ local K = uccodes[k]
+ if K then
+ local V = uppercase .. v
+ textstrings[K] = V
+ mathstrings[K] = V
+ end
+ end
+
+ for k, v in next, codepoints.digits do
+ local d = number .. v
+ textstrings[k] = v
+ mathstrings[k] = v
+ end
+
+ for k, v in next, codepoints.punctuation do
+ textstrings[k] = v
+ mathstrings[k] = v
+ end
+ -- overlaps with the above
+
+ for k, v in next, codepoints.ueb do
+ textstrings[k] = v
+ mathstrings[k] = v
+ end
+
+ for k, v in next, codepoints.nemeth do
+ mathstrings[k] = v
+ if not textstrings[k] then
+ textstrings[k] = v
+ end
+ end
+
+ for k, v in next, codepoints.alphabets do
+ local block = charblocks[k]
+ if block then
+ local c = utfbyte('a')
+ for i=block.first,block.last do
+ mathstrings[i] = v..letters[c]
+ if not textstrings[i] then
+ textstrings[i] = v .. letters[c]
+ end
+ c = c + 1
+ end
+ end
+ end
+
+ for k, v in next, textstrings do
+ textunicodes[k] = utfsplit(v)
+ end
+ for k, v in next, mathstrings do
+ mathunicodes[k] = utfsplit(v)
+ end
+
+ textlist = sortedkeys(textstrings)
+ mathlist = sortedkeys(mathstrings)
+
+ specials = {
+ uppercase = utfbyte(uppercase),
+ number = utfbyte(number),
+ space = utfbyte(space),
+ rule = utfbyte(rule)
+ }
+end
+
+-- maybe an iterator
+
+function braille.textlist () if not textlist then prepare() end return textlist end
+function braille.mathlist () if not mathlist then prepare() end return mathlist end
+function braille.textunicode(n) if not textunicodes then prepare() end return textunicodes[n] end
+function braille.mathunicode(n) if not mathunicodes then prepare() end return mathunicodes[n] end
+function braille.textstring (n) if not textstrings then prepare() end return textstrings [n] end
+function braille.mathstring (n) if not mathstrings then prepare() end return mathstrings [n] end
+function braille.special (n) if not specials then prepare() end return specials [n] end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/char-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/char-ini.mkxl
index 6965598a960..baa5426cc03 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/char-ini.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/char-ini.mkxl
@@ -17,6 +17,8 @@
\registerctxluafile{char-map}{} % maybe we will load this someplace else
\registerctxluafile{char-tex}{autosuffix}
\registerctxluafile{char-ent}{}
+\registerctxluafile{char-scr}{}
+%registerctxluafile{char-brl}{}
\unprotect
diff --git a/Master/texmf-dist/tex/context/base/mkxl/char-prv.lmt b/Master/texmf-dist/tex/context/base/mkxl/char-prv.lmt
new file mode 100644
index 00000000000..38ae87dcc35
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/char-prv.lmt
@@ -0,0 +1,15 @@
+if not modules then modules = { } end modules ['char-prv'] = {
+ version = 1.001,
+ comment = "companion to char-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files",
+ dataonly = true,
+}
+
+-- We needed this in mkiv for all kind of math compensations. This file is kept
+-- around in order to prevent loading the mkiv (.lua) variant.
+
+characters = characters or { }
+
+characters.private = { }
diff --git a/Master/texmf-dist/tex/context/base/mkxl/char-tex.lmt b/Master/texmf-dist/tex/context/base/mkxl/char-tex.lmt
index 3d8f6a2598e..02d9a6cb62c 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/char-tex.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/char-tex.lmt
@@ -36,7 +36,6 @@ local is_letter = characters.is_letter
local is_command = characters.is_command
local is_spacing = characters.is_spacing
local is_mark = characters.is_mark
-local is_punctuation = characters.is_punctuation
local data = characters.data if not data then return end
local blocks = characters.blocks
@@ -770,24 +769,36 @@ if not csletters then
storage.register("characters/csletters", csletters, "characters.csletters")
end
+ local function setname(category,chr,u,contextname)
+ if is_character[category] then
+ if chr.unicodeslot < 128 then
+ if is_letter[category] then
+ texsetmacro(contextname,utfchar(u),"immutable")
+ else
+ texsetchar(contextname,u,"immutable")
+ end
+ else
+ texsetmacro(contextname,utfchar(u),"immutable")
+ end
+ elseif is_command[category] and not forbidden[u] then
+ texsetmacro(contextname,utfchar(u),"immutable")
+ end
+ end
+
function characters.setcharacternames(ctt)
for u, chr in next, data do -- will move up
local contextname = chr.contextname
+ local contextspec = chr.contextspec
local category = chr.category
- local isletter = is_letter[category]
if contextname then
- if is_character[category] then
- if chr.unicodeslot < 128 then
- if isletter then
- texsetmacro(contextname,utfchar(u),"immutable")
- else
- texsetchar(contextname,u,"immutable")
- end
- else
- texsetmacro(contextname,utfchar(u),"immutable")
+ setname(category,chr,u,contextname)
+ end
+ if contextspec then
+ for i=1,#contextspec do
+ local extraname = contextspec[i]
+ if extraname ~= contextname then
+ setname(category,chr,u,extraname)
end
- elseif is_command[category] and not forbidden[u] then
- texsetmacro(contextname,utfchar(u),"immutable")
end
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/chem-str.mkxl b/Master/texmf-dist/tex/context/base/mkxl/chem-str.mkxl
index 6c591225e33..a4a974de1da 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/chem-str.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/chem-str.mkxl
@@ -82,7 +82,7 @@
[\c!align=\v!normal,
\c!strut=\v!no]
-\mutable\let\currentdefinedchemical\empty
+\mutable\lettonothing\currentdefinedchemical
\permanent\protected\def\setupchemicalframed
{\setupframed[\??chemicalframed]}
@@ -120,9 +120,9 @@
\ifcase\currentxfontsize\or\scriptstyle\or\scriptscriptstyle\fi
#1}}
-\setvalue{\??chemicalsize\v!small }{\txx}
-\setvalue{\??chemicalsize\v!medium}{\tx}
-\setvalue{\??chemicalsize\v!big }{}
+\defcsname\??chemicalsize\v!small \endcsname{\txx}
+\defcsname\??chemicalsize\v!medium\endcsname{\tx}
+\defcsname\??chemicalsize\v!big \endcsname{}
\newtoks \everychemical
\newtoks \everystructurechemical
@@ -131,9 +131,9 @@
\newtoks \t_chem_every_box
\newbox \b_chem_result
\newconditional\c_chem_some_text
-\newdimen \d_chem_width
-\newdimen \d_chem_height
-\newdimen \d_chem_depth
+\newdimension \d_chem_width
+\newdimension \d_chem_height
+\newdimension \d_chem_depth
\permanent\tolerant\protected\def\startchemical[#1]#*[#2]%
{\ifmmode\vcenter\else\vbox\fi % vpack ?
@@ -256,29 +256,29 @@
\permanent\protected\def\chemicalbottext#1{\global\settrue\c_chem_some_text\gdef\m_chem_bot_text{#1}\ignorespaces}
\permanent\protected\def\chemicalmidtext#1{\global\settrue\c_chem_some_text\gdef\m_chem_mid_text{#1}\ignorespaces}
-\mutable\let\toptext\empty
-\mutable\let\bottext\empty
-\mutable\let\midtext\empty
+\mutable\lettonothing\toptext
+\mutable\lettonothing\bottext
+\mutable\lettonothing\midtext
\appendtoks
- \let\toptext\chemicaltoptext \glet\m_chem_top_text\empty
- \let\bottext\chemicalbottext \glet\m_chem_bot_text\empty
- \let\midtext\chemicalmidtext \glet\m_chem_mid_text\empty
+ \let\toptext\chemicaltoptext \glettonothing\m_chem_top_text
+ \let\bottext\chemicalbottext \glettonothing\m_chem_bot_text
+ \let\midtext\chemicalmidtext \glettonothing\m_chem_mid_text
\global\setfalse\c_chem_some_text
\to \everystructurechemical
\def\chem_add_texts
- {\setbox2\hpack to \d_chem_width{\strut\hss\hbox{\strut\m_chem_mid_text}\hss}%
- \setbox4\hpack to \d_chem_width{\strut\hss\hbox{\strut\m_chem_top_text}\hss}%
- \setbox6\hpack to \d_chem_width{\strut\hss\hbox{\strut\m_chem_bot_text}\hss}%
+ {\setbox\scratchboxone \hpack to \d_chem_width{\strut\hss\hbox{\strut\m_chem_mid_text}\hss}%
+ \setbox\scratchboxtwo \hpack to \d_chem_width{\strut\hss\hbox{\strut\m_chem_top_text}\hss}%
+ \setbox\scratchboxthree\hpack to \d_chem_width{\strut\hss\hbox{\strut\m_chem_bot_text}\hss}%
\setbox\b_chem_result\hpack \bgroup
\box\b_chem_result
\hskip-\d_chem_width
- \raise\d_chem_height\hpack{\lower\ht4\box4}%
+ \raise\d_chem_height\hpack{\lower\ht\scratchboxtwo\box\scratchboxtwo}%
\hskip-\d_chem_width
- \lower.5\dimexpr\ht2-\dp2\relax\box2%
+ \lower.5\dimexpr\ht\scratchboxone-\dp\scratchboxone\relax\box\scratchboxone
\hskip-\d_chem_width
- \lower\d_chem_depth \hpack{\raise\dp6\box6}%
+ \lower\d_chem_depth\hpack{\raise\dp\scratchboxthree\box\scratchboxthree}%
\hss
\egroup} % text on top of chemicals
@@ -607,12 +607,15 @@
\definechemicalsymbol[d:plus] [\enspace+\enspace]
\definechemicalsymbol[d:minus] [\enspace-\enspace]
\definechemicalsymbol[d:equals] [\enspace=\enspace]
-\definechemicalsymbol[d:gives] [\rightarrowfill] % \chem_arrow_construct\xrightarrow
-\definechemicalsymbol[d:equilibrium] [\rightoverleftarrowfill] % \chem_arrow_construct\xrightoverleftarrow
-\definechemicalsymbol[d:mesomeric] [\leftarrowfill] % \chem_arrow_construct\xleftrightarrow
+%definechemicalsymbol[d:gives] [\rightarrowfill] % \chem_arrow_construct\xrightarrow
+%definechemicalsymbol[d:equilibrium] [\rightoverleftarrowfill] % \chem_arrow_construct\xrightoverleftarrow
+%definechemicalsymbol[d:mesomeric] [\leftarrowfill] % \chem_arrow_construct\xleftrightarrow
+\definechemicalsymbol[d:gives] [\crightarrow]
+\definechemicalsymbol[d:equilibrium] [\cleftarrow]
+\definechemicalsymbol[d:mesomeric] [\crightoverleftarrow]
\definechemicalsymbol[d:single] [\chemicalbondrule]
-\definechemicalsymbol[d:double] [\hpack{\lower.5ex\chemicalbondrule\hskip-1em\raise.5ex\chemicalbondrule}]
-\definechemicalsymbol[d:triple] [\hpack{\chemicalbondrule\hskip-1em\lower.5ex\chemicalbondrule\hskip-1em\raise.5ex\chemicalbondrule}]
+\definechemicalsymbol[d:double] [\hpack{\lower.5\exheight\chemicalbondrule\hskip-\emwidth\raise.5\exheight\chemicalbondrule}]
+\definechemicalsymbol[d:triple] [\hpack{\chemicalbondrule\hskip-\emwidth\lower.5\exheight\chemicalbondrule\hskip-\emwidth\raise.5\exheight\chemicalbondrule}]
\definechemicalsymbol[d:opencomplex] [\mathematics{\Bigg[}] % not yet ok
\definechemicalsymbol[d:closecomplex][\mathematics{\Bigg]}] % not yet ok
diff --git a/Master/texmf-dist/tex/context/base/mkxl/cldf-bas.lmt b/Master/texmf-dist/tex/context/base/mkxl/cldf-bas.lmt
new file mode 100644
index 00000000000..40b2b74a54d
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/cldf-bas.lmt
@@ -0,0 +1,262 @@
+if not modules then modules = { } end modules ['cldf-bas'] = {
+ version = 1.001,
+ comment = "companion to cldf-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- -- speedtest needed:
+--
+-- local flush, writer = context.getlogger()
+--
+-- trackers.register("context.trace",function(v)
+-- flush, writer = context.getlogger()
+-- end)
+--
+-- function context.bgroup()
+-- flush(ctxcatcodes,"{")
+-- end
+--
+-- function context.egroup()
+-- flush(ctxcatcodes,"}")
+-- end
+
+local tonumber = tonumber
+local type = type
+local format = string.format
+local utfchar = utf.char
+local concat = table.concat
+
+local context = context
+local ctxcore = context.core
+
+local variables = interfaces.variables
+
+local ctx_flushnode = context.nuts.flush
+local ctx_sprint = context.sprint
+local txtcatcodes = tex.txtcatcodes
+
+local nuts = nodes.nuts
+local tonode = nuts.tonode
+local nodepool = nuts.pool
+local new_rule = nodepool.rule
+local new_glyph = nodepool.glyph
+local new_latelua = nodepool.latelua
+
+local setattrlist = nuts.setattrlist
+
+local texgetcount = tex.getcount
+local texsetcount = tex.setcount
+local texchardef = tex.chardef
+local expandmacro = token.expandmacro
+
+local is_letter = characters.is_letter
+
+-- a set of basic fast ones
+
+function context.setfontid(n)
+ -- isn't there a setter?
+ context("\\setfontid%i\\relax",n)
+end
+
+function context.char(k) -- used as escape too, so don't change to utf
+ if type(k) == "table" then
+ local n = #k
+ if n == 1 then
+ context([[\char%s\relax]],k[1])
+ elseif n > 0 then
+ context([[\char%s\relax]],concat(k,[[\relax\char]]))
+ end
+ else
+ if type(k) == "string" then
+ k = tonumber(k)
+ end
+ if type(k) == "number" then
+ context([[\char%s\relax]],k)
+ end
+ end
+end
+
+function context.safechar(c)
+ if characters.is_letter[c] then -- not yet loaded
+ ctx_sprint(c)
+ else
+ ctx_sprint(txtcatcodes,c)
+ end
+end
+
+function context.utfchar(k)
+ if type(k) == "string" then
+ k = tonumber(k)
+ end
+ if type(k) == "number" then
+ context(utfchar(k))
+ end
+end
+
+function context.rule(w,h,d,direction)
+ local rule
+ if type(w) == "table" then
+ rule = new_rule(w.width,w.height,w.depth,w.direction)
+ else
+ rule = new_rule(w,h,d,direction)
+ end
+ setattrlist(rule,true)
+ context(tonode(rule))
+ -- ctx_flushnode(tonode(rule))
+end
+
+function context.glyph(id,k)
+ if id then
+ if not k then
+ id, k = true, id
+ end
+ local glyph = new_glyph(id,k)
+ setattrlist(glyph,true)
+ context(tonode(glyph))
+ -- ctx_flushnode(tonode(glyph))
+ end
+end
+
+-- local function ctx_par () context("\\par") end
+-- local function ctx_space() context("\\space") end
+
+local ctx_par = context.cs.par
+local ctx_space = context.cs.space
+
+context.par = ctx_par
+context.space = ctx_space
+
+ctxcore.par = ctx_par
+ctxcore.space = ctx_space
+
+-- local function ctx_bgroup() context("{") end
+-- local function ctx_egroup() context("}") end
+
+local ctx_bgroup = context.cs.bgroup
+local ctx_egroup = context.cs.egroup
+
+context.bgroup = ctx_bgroup
+context.egroup = ctx_egroup
+
+ctxcore.bgroup = ctx_bgroup
+ctxcore.egroup = ctx_egroup
+
+-- not yet used ... but will get variant at the tex end as well
+
+local function setboxregister(kind,n)
+ context(type(n) == "number" and [[\setbox%s\%s]] or [[\setbox\%s\%s]],n,kind)
+end
+
+function ctxcore.sethboxregister(n) setboxregister("hbox",n) end
+function ctxcore.setvboxregister(n) setboxregister("vbox",n) end
+function ctxcore.setvtopregister(n) setboxregister("vtop",n) end
+
+local function startboxregister(kind,n)
+ context(type(n) == "number" and [[\setbox%s\%s{]] or [[\setbox\%s\%s{]],n,kind)
+end
+
+function ctxcore.starthboxregister(n) startboxregister("hbox",n) end
+function ctxcore.startvboxregister(n) startboxregister("vbox",n) end
+function ctxcore.startvtopregister(n) startboxregister("vtop",n) end
+
+ctxcore.stophboxregister = ctx_egroup
+ctxcore.stopvboxregister = ctx_egroup
+ctxcore.stopvtopregister = ctx_egroup
+
+function ctxcore.flushboxregister(n)
+ context(type(n) == "number" and [[\box%s ]] or [[\box\%s]],n)
+end
+
+-- function ctxcore.beginhbox() context([[\hbox\bgroup]]) end
+-- function ctxcore.beginvbox() context([[\vbox\bgroup]]) end
+-- function ctxcore.beginvtop() context([[\vtop\bgroup]]) end
+
+local ctx_hbox = context.cs.hbox
+local ctx_vbox = context.cs.vbox
+local ctx_vtop = context.cs.vtop
+
+function ctxcore.beginhbox() ctx_hbox() ctx_bgroup() end
+function ctxcore.beginvbox() ctx_vbox() ctx_bgroup() end
+function ctxcore.beginvtop() ctx_vtop() ctx_bgroup() end
+
+ctxcore.endhbox = ctx_egroup -- \egroup
+ctxcore.endvbox = ctx_egroup -- \egroup
+ctxcore.endvtop = ctx_egroup -- \egroup
+
+local function allocate(name,what,cmd)
+ local a = format("c_syst_last_allocated_%s",what)
+ local n = texgetcount(a) + 1
+ if n <= texgetcount("c_syst_max_allocated_register") then
+ texsetcount(a,n)
+ end
+ context("\\global\\expandafter\\%sdef\\csname %s\\endcsname %s\\relax",cmd or what,name,n)
+ return n
+end
+
+context.registers = {
+ newdimen = function(name) expandmacro("syst_new_dimen", true,name) return texgetcount("c_syst_last_allocated_dimen") end,
+ newskip = function(name) expandmacro("syst_new_skip", true,name) return texgetcount("c_syst_last_allocated_skip" ) end,
+ newcount = function(name) expandmacro("syst_new_count", true,name) return texgetcount("c_syst_last_allocated_count") end,
+ newmuskip = function(name) expandmacro("syst_new_muskip",true,name) return texgetcount("c_syst_last_allocated_muskip") end,
+ newtoks = function(name) expandmacro("syst_new_toks", true,name) return texgetcount("c_syst_last_allocated_toks") end,
+ newbox = function(name) expandmacro("syst_new_box", true,name) return texgetcount("c_syst_last_allocated_box") end,
+ -- not really a register but kind of belongs here
+ newchar = texchardef,
+}
+
+function context.latelua(f)
+ -- table check moved elsewhere
+ local latelua = new_latelua(f)
+ setattrlist(latelua,true) -- will become an option
+ ctx_flushnode(latelua,true)
+end
+
+do
+
+ local NC = ctxcore.NC
+ local BC = ctxcore.BC
+ local NR = ctxcore.NR
+
+ context.nc = setmetatable({ }, {
+ __call =
+ function(t,...)
+ NC()
+ return context(...)
+ end,
+ __index =
+ function(t,k)
+ NC()
+ return context[k]
+ end,
+ }
+ )
+
+ function context.bc(...)
+ BC()
+ return context(...)
+ end
+
+ function context.nr(...)
+ NC()
+ NR()
+ end
+
+end
+
+-- for the moment here:
+
+do
+
+ local texset = tex.set
+ local maxdimen = tex.magicconstants.maxdimen
+
+ function tex.dontcomplain()
+ texset("hbadness",maxdimen)
+ texset("vbadness",maxdimen)
+ texset("hfuzz", maxdimen)
+ texset("vfuzz", maxdimen)
+ end
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/cldf-bas.mkxl b/Master/texmf-dist/tex/context/base/mkxl/cldf-bas.mkxl
index 962db5209f5..ab801e411b3 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/cldf-bas.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/cldf-bas.mkxl
@@ -13,7 +13,19 @@
\writestatus{loading}{ConTeXt Lua Documents / Basics}
-\registerctxluafile{cldf-bas}{}
+\unprotect
+
+\permanent\protected\def\syst_new_dimen #1{\expandafter\newdimen \csname#1\endcsname}
+\permanent\protected\def\syst_new_skip #1{\expandafter\newskip \csname#1\endcsname}
+\permanent\protected\def\syst_new_count #1{\expandafter\newcount \csname#1\endcsname}
+\permanent\protected\def\syst_new_muskip#1{\expandafter\newmuskip\csname#1\endcsname}
+\permanent\protected\def\syst_new_toks #1{\expandafter\newtoks \csname#1\endcsname}
+\permanent\protected\def\syst_new_box #1{\expandafter\newbox \csname#1\endcsname}
+\permanent\protected\def\syst_new_char #1{\expandafter\chardef \csname#1\endcsname}
+
+\protect
+
+\registerctxluafile{cldf-bas}{autosuffix}
\registerctxluafile{cldf-prs}{}
\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/cldf-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/cldf-ini.mkxl
index b393eb9b572..0c5788bb291 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/cldf-ini.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/cldf-ini.mkxl
@@ -13,7 +13,7 @@
\writestatus{loading}{ConTeXt Lua Documents / Initialization}
-\newcount\trialtypesettingstate % gets aliased at the Lua end
+% \newcount\trialtypesettingstate % gets aliased at the Lua end
\registerctxluafile{cldf-ini}{autosuffix}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/cldf-lmt.lmt b/Master/texmf-dist/tex/context/base/mkxl/cldf-lmt.lmt
index f3121eadc02..aba3dacdaa5 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/cldf-lmt.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/cldf-lmt.lmt
@@ -6,7 +6,7 @@ if not modules then modules = { } end modules ['cldf-lmt'] = {
license = "see context related readme files"
}
-local next, load = next, load
+local next, load, tonumber = next, load, tonumber
local gmatch, gsub, byte = string.gmatch, string.gsub, string.byte
local setmetatableindex = table.setmetatableindex
@@ -41,7 +41,7 @@ local scankeyword = scanners.keyword
local peekchar = scanners.peekchar
local skipnext = scanners.skip
-local getindex = token.get_index
+local getindex = tokens.accessors.index
local texsetdimen = tex.setdimen
local texsetcount = tex.setcount
@@ -187,6 +187,7 @@ implement {
name = "newarray",
public = true,
protected = true,
+ untraced = true,
arguments = { {
{ "name", "string" },
{ "nx", "integer" },
@@ -335,6 +336,7 @@ implement {
name = "showarray",
public = true,
protected = true,
+ untraced = true,
actions = function()
local name = scanstring()
if name then
@@ -358,9 +360,10 @@ end)
table.makeweak(cache)
implement {
- name = "luaexpression",
- public = true,
- actions = function()
+ name = "luaexpression",
+ public = true,
+ untraced = true,
+ actions = function()
local how = scanword()
local code = cache[scanargument()]
if code then
@@ -544,6 +547,7 @@ end
implement {
name = "newluatable",
protected = true,
+ untraced = true,
arguments = "csname",
actions = newluatable,
}
@@ -551,6 +555,7 @@ implement {
implement {
name = "useluatable",
protected = true,
+ untraced = true,
arguments = { "csname", true },
actions = newluatable,
}
@@ -558,6 +563,7 @@ implement {
implement {
name = "disposeluatable",
protected = true,
+ untraced = true,
public = true,
arguments = "csname",
actions = disposeluatable,
@@ -566,6 +572,7 @@ implement {
implement {
name = "inspectluatable",
protected = true,
+ untraced = true,
public = true,
arguments = "csname",
actions = inspectluatable,
@@ -574,6 +581,7 @@ implement {
implement {
name = "showluatables",
protected = true,
+ untraced = true,
public = true,
actions = showluatables,
}
@@ -581,6 +589,7 @@ implement {
implement {
name = "setluatable",
protected = true,
+ untraced = true,
public = true,
arguments = { "csname", "argument" },
actions = function(name,data)
@@ -597,6 +606,7 @@ implement {
implement {
name = "getfromluatable",
protected = false,
+ untraced = true,
public = true,
arguments = { "csname", "argument" },
actions = getfromluatable,
@@ -605,6 +615,7 @@ implement {
implement {
name = "idxfromluatable",
protected = false,
+ untraced = true,
public = true,
arguments = { "csname", "integer" },
actions = idxfromluatable,
@@ -627,10 +638,11 @@ context.luatables = {
local tables = { }
local stack = setmetatableindex("table")
-interfaces.implement {
- name = "droptablegroup",
- public = true,
- actions = function()
+implement {
+ name = "droptablegroup",
+ public = true,
+ untraced = true,
+ actions = function()
local g = texget("currentgrouplevel") -- todo: tex.getgrouplevel()
local s = stack[g]
if s then
@@ -699,7 +711,7 @@ local function newtable(array)
if not tables[name] then
local t = { }
tables[name] = t
- interfaces.implement {
+ implement {
name = name,
public = true,
usage = "value",
@@ -715,6 +727,7 @@ end
implement {
name = "newhashedtable",
protected = true,
+ untraced = true,
public = true,
actions = newtable,
}
@@ -722,6 +735,7 @@ implement {
implement {
name = "newindexedtable",
protected = true,
+ untraced = true,
public = true,
actions = function() newtable(true) end,
}
@@ -886,7 +900,7 @@ implement {
end
}
-interfaces.implement {
+implement {
name = "bitwise",
public = true,
usage = "value",
@@ -933,7 +947,7 @@ interfaces.implement {
local escape = function(s) return "\\" .. byte(s) end
-interfaces.implement {
+implement {
name = "ctxluamatch",
public = true,
usage = "value",
@@ -947,3 +961,84 @@ interfaces.implement {
return none_code
end,
}
+
+-- yes or no ...
+
+do
+
+ local codes = { }
+ tex.codes = codes
+
+ local global_code = tex.flagcodes.global
+
+ local savelua = token.savelua
+ local isdefined = token.isdefined
+
+ local newsparse = sparse.new
+ local setsparse = sparse.set
+ local wipesparse = sparse.wipe
+ local restoresparse = sparse.restore
+
+ -- local function isglobal(n) -- maybe a general helper
+ -- return n and (tonumber(n) & global_code)
+ -- end
+
+ local registerfunction = context.functions.register
+
+ implement {
+ name = "codedef",
+ public = true,
+ untraced = true,
+ protected = true,
+ actions = function(what)
+ local name = scancsname(true)
+ -- if isdefined(name) then
+ -- wipesparse(codes[name]) -- better make a wipe helper if ever needed
+ -- else
+ local code = newsparse()
+ local restore = registerfunction(function() restoresparse(code) end)
+ implement {
+ name = name,
+ public = true,
+ protected = true,
+ usage = "value",
+ actions = function(what)
+ local n = scaninteger()
+ if what == "value" then
+ return integer_code, code[n]
+ else
+ local v = scaninteger(true)
+ -- if isglobal(what) then
+ if what and (tonumber(what) & global_code) then
+ setsparse(code,"global",n,v)
+ else
+ savelua(restore,true) -- only once
+ setsparse(code,n,v)
+ end
+ end
+ end,
+ }
+ codes[name] = code
+ -- end
+ end,
+ }
+
+end
+
+-- for now here:
+
+do
+
+ local runstring = tex.runstring
+ local ctxcatcodes = tex.ctxcatcodes
+ local formatters = string.formatters
+
+ function context.runstring(fmt,str,...)
+ if str then
+ runstring(ctxcatcodes,formatters[fmt](str,...))
+ elseif fmt then
+ runstring(ctxcatcodes,fmt)
+ end
+ end
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/colo-ext.mkxl b/Master/texmf-dist/tex/context/base/mkxl/colo-ext.mkxl
index df2d9d768a1..a70bd9b18c4 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/colo-ext.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/colo-ext.mkxl
@@ -46,7 +46,7 @@
\installcorenamespace{colorintent}
\permanent\protected\def\registercolorintent#1#2% \relax is needed !
- {\setevalue{\??colorintent#1}{\c_attr_colorintent\clf_registercolorintent{#2}\relax}}
+ {\edefcsname\??colorintent#1\endcsname{\c_attr_colorintent\clf_registercolorintent{#2}\relax}}
\protected\def\colo_intents_set
{\clf_enablecolorintents
@@ -58,7 +58,7 @@
\installattributestack\colorintentattribute
-\setevalue{\??colorintent\v!none}{\c_attr_colorintent\attributeunsetvalue} % or reset? used at all?
+\edefcsname\??colorintent\v!none\endcsname{\c_attr_colorintent\attributeunsetvalue} % or reset? used at all?
\permanent\protected\def\startcolorintent[#1]%
{\pushattribute\colorintentattribute
@@ -73,14 +73,14 @@
\aliased\let\stopoverprint\stopcolorintent
\aliased\let\stopknockout \stopcolorintent
-\aliased\let\starttextcolorintent\relax
-\aliased\let\stoptextcolorintent \relax
+\permanent\protected\lettonothing\starttextcolorintent
+\permanent\protected\lettonothing\stoptextcolorintent
\appendtoks
\colo_intents_set_text
\to \everysetupcolors
-\let\p_colo_intent\empty
+\lettonothing\p_colo_intent
\def\colo_intents_set_text
{\edef\p_colo_intent{\colorsparameter\c!intent}%
diff --git a/Master/texmf-dist/tex/context/base/mkxl/colo-grp.mkxl b/Master/texmf-dist/tex/context/base/mkxl/colo-grp.mkxl
index 9237952d750..1d3df712cdd 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/colo-grp.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/colo-grp.mkxl
@@ -47,7 +47,7 @@
\installcorenamespace{colorgroup}
\installcorenamespace{colorgroupsetter}
-\newcount\c_colo_groups_n % scratch counter
+\newinteger\c_colo_groups_n % scratch counter
\permanent\tolerant\protected\def\definecolorgroup[#1]#*[#2]#*[#3]% % sort of obsolete, just use palets directly
{\ifarguments\or\or
@@ -73,13 +73,13 @@
\fi}}
\def\colo_groups_define_entry#1#2#3% name mode specification
- {\advance\c_colo_groups_n\plusone
+ {\advanceby\c_colo_groups_n\plusone
\csname\??colorgroupsetter\ifcsname\??colorgroupsetter#2\endcsname#2\else\s!rgb\fi\endcsname[#1:\the\c_colo_groups_n][#3:0:0:0:0]}
-\setvalue{\??colorgroupsetter\s!gray}[#1][#2:#3]{\definecolor[#1][s=#2]}
-\setvalue{\??colorgroupsetter\s!rgb }[#1][#2:#3:#4:#5]{\definecolor[#1][r=#2,g=#3,b=#4]}
-\setvalue{\??colorgroupsetter\s!cmyk}[#1][#2:#3:#4:#5:#6]{\definecolor[#1][c=#2,m=#3=,y=#4,k=#5]}
-\setvalue{\??colorgroupsetter\s!spot}[#1][#2:#3:#4]{\definespotcolor[#1][#2][p=#3]}
+\defcsname\??colorgroupsetter\s!gray\endcsname[#1][#2:#3]{\definecolor[#1][s=#2]}
+\defcsname\??colorgroupsetter\s!rgb \endcsname[#1][#2:#3:#4:#5]{\definecolor[#1][r=#2,g=#3,b=#4]}
+\defcsname\??colorgroupsetter\s!cmyk\endcsname[#1][#2:#3:#4:#5:#6]{\definecolor[#1][c=#2,m=#3=,y=#4,k=#5]}
+\defcsname\??colorgroupsetter\s!spot\endcsname[#1][#2:#3:#4]{\definespotcolor[#1][#2][p=#3]}
%D \macros
%D {showcolorgroup}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/colo-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/colo-ini.mkxl
index c096fe90f2c..a7f483bc2cc 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/colo-ini.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/colo-ini.mkxl
@@ -61,10 +61,10 @@
\let\m_colo_weight_gray\v!yes
-\mutable\let\currentcolormodel \empty
-\mutable\let\currentcolorname \empty
-\mutable\let\currentcolorpalet \empty
-\mutable\let\currentcolorprefix\empty % \currentcolorpalet:
+\mutable\lettonothing\currentcolormodel
+\mutable\lettonothing\currentcolorname
+\mutable\lettonothing\currentcolorpalet
+\mutable\lettonothing\currentcolorprefix % \currentcolorpalet:
%D \macros
%D {definecolor,defineglobalcolor,definenamedcolor,definespotcolor,definemultitonecolor,
@@ -125,7 +125,7 @@
% transparency
\permanent\protected\def\transparent[#1]%
- {\bgroup
+ {\beginsimplegroup
\edef\scratchstringone{#1}%
% the \relax catches a non existent csname
\ifx\scratchstringone\v!reset
@@ -150,7 +150,7 @@
% color
\permanent\protected\def\coloronly[#1]%
- {\bgroup
+ {\beginsimplegroup
\edef\currentcolorname{#1}%
\ifempty\currentcolorprefix
\colo_helpers_activate_nop_only
@@ -174,7 +174,7 @@
% color + transparency
\permanent\protected\def\color[#1]%
- {\bgroup
+ {\beginsimplegroup
\edef\currentcolorname{#1}%
\ifempty\currentcolorprefix
\colo_helpers_activate_nop
@@ -184,7 +184,7 @@
\let\nexttoken}
\permanent\protected\def\graycolor[#1]%
- {\bgroup
+ {\beginsimplegroup
\colo_helpers_set_model\s!gray\colo_helpers_activate{#1}%
\let\nexttoken}
@@ -201,7 +201,7 @@
{\endgroup}
\permanent\protected\def\colored[#1]%
- {\bgroup
+ {\beginsimplegroup
\colo_basics_defined_and_activated{#1}%
\let\nexttoken}
@@ -288,10 +288,10 @@
\let\v_colo_freeze_state\s!false
-\setvalue{\??colorconversions\v!yes}%
+\defcsname\??colorconversions\v!yes\endcsname
{\settrue \c_colo_convert_gray}
-\setvalue{\??colorconversions\v!always}%
+\defcsname\??colorconversions\v!always\endcsname
{\settrue \c_colo_convert_gray
\setfalse\c_colo_rgb_supported
\setfalse\c_colo_cmyk_supported}
@@ -331,27 +331,52 @@
\let\colo_helpers_show_message\showmessage
\to \everyjob
+% handled elsewhere but kind of a reference here:
+%
+% \def\colo_force_colormodel#1#2%
+% {\setcolorsparameter\c!rgb {#1}%
+% \setcolorsparameter\c!cmyk{#2}%
+% \the\everysetupcolors}
+
%D We provide stacking independent of grouping.
-\newcount\c_colo_nesting
+% the old one
+%
+% \newcount\c_colo_nesting
+%
+% \permanent\protected\def\pushcolor[#1]%
+% {\global\advanceby\c_colo_nesting\plusone
+% \edefcsname\??colorstack\number\c_colo_nesting\endcsname
+% {\c_attr_colormodel \the\c_attr_colormodel
+% \c_attr_color \the\c_attr_color
+% \c_attr_transparency\the\c_attr_transparency
+% \relax}% stack
+% \colo_helpers_activate{#1}}
+%
+% \permanent\protected\def\popcolor
+% {\csname\??colorstack\number\c_colo_nesting\endcsname
+% \global\advanceby\c_colo_nesting\minusone}
+%
+% more efficient:
+
+\installmacrostack\m_color_state
\permanent\protected\def\pushcolor[#1]%
- {\global\advance\c_colo_nesting\plusone
- \edefcsname\??colorstack\number\c_colo_nesting\endcsname
+ {\edef\m_color_state
{\c_attr_colormodel \the\c_attr_colormodel
\c_attr_color \the\c_attr_color
- \c_attr_transparency\the\c_attr_transparency
- \relax}% stack
+ \c_attr_transparency\the\c_attr_transparency}%
+ \push_macro_m_color_state
\colo_helpers_activate{#1}}
\permanent\protected\def\popcolor
- {\csname\??colorstack\number\c_colo_nesting\endcsname
- \global\advance\c_colo_nesting\minusone}
+ {\pop_macro_m_color_state
+ \m_color_state\relax}
% a simple one: assumes grouping
-\newcount\c_colo_saved_attribute_color
-\newcount\c_colo_saved_attribute_transparency
+\newinteger\c_colo_saved_attribute_color
+\newinteger\c_colo_saved_attribute_transparency
\permanent\protected\def\savecolor
{\c_colo_saved_attribute_color \c_attr_color
@@ -361,6 +386,16 @@
{\c_attr_color \c_colo_saved_attribute_color
\c_attr_transparency\c_colo_saved_attribute_transparency}
+%D Nasty:
+
+\permanent\def\usedcolorparameterattributes#1%
+ {\beginlocalcontrol\begingroup
+ \dousecolorparameter{#1}%
+ \normalexpanded{\endgroup\noexpand\endlocalcontrol
+ \noexpand\s!attr \colorattribute \the\c_attr_color
+ \noexpand\s!attr \colormodelattribute \the\c_attr_colormodel
+ \noexpand\s!attr \transparencyattribute \the\c_attr_transparency}}
+
%D In this documentation we will not go into too much details on palets. Curious
%D users can find more information on this topic in \from[use of color].
%D
@@ -429,7 +464,7 @@
\def\colo_palet_allocate#1%
{\letcsname\??paletlist#1\endcsname\empty
\ifcsname\??paletsize#1\endcsname\else
- \expandafter\newcount\csname\??paletsize#1\endcsname
+ \expandafter\newinteger\csname\??paletsize#1\endcsname
\fi}
\def\colo_palet_prepare#1%
@@ -439,14 +474,15 @@
\else
\colo_palet_allocate\colo_palet_name
\fi
- \enforced\expandafter\let\expandafter\c_colo_palet\csname\??paletsize\colo_palet_name\endcsname
+ % \enforced\expandafter\integerdef\expandafter\c_colo_palet\csname\??paletsize\colo_palet_name\endcsname
+ \edef\c_colo_palet{\csname\??paletsize\colo_palet_name\endcsname}% we can't alias as they are integers
\edef\m_colo_palet{\begincsname\??paletlist\colo_palet_name\endcsname}}
\def\colo_palet_extend#1%
{\addtocommalist{#1}\m_colo_palet
\letcsname\??paletlist\colo_palet_name\endcsname\m_colo_palet
- %\advance\csname\??paletsize\colo_palet_name\endcsname\plusone
- \advance\c_colo_palet\plusone}
+ %\advanceby\csname\??paletsize\colo_palet_name\endcsname\plusone
+ \advanceby\c_colo_palet\plusone}
\permanent\protected\def\doifelsecolorpalet#1%
{\ifcsname\??paletlist#1\endcsname
@@ -455,8 +491,8 @@
\expandafter\secondoftwoarguments
\fi}
-\mutable\let\paletlist\empty
-\mutable\let\paletsize\!!zerocount
+\mutable\lettonothing\paletlist
+\mutable\let \paletsize\!!zerocount
\permanent\protected\def\getpaletlist[#1]%
{\edef\paletlist{\begincsname\??paletlist#1\endcsname}}
@@ -502,14 +538,14 @@
% \or
% \colo_palet_prepare{#1}%
% \ifcondition\validassignment{#2}%
-% \setevalue{\??colorpaletspecification#1}{#2}%
+% \edefcsname\??colorpaletspecification#1\endcsname{#2}%
% \processcommalist[#2]{\colo_palets_define_one{#1}}%
% \orelse\ifcsname\??colorpaletspecification#2\endcsname
% \normalexpanded{\colo_palets_define_b{#1}{\lastnamedcs}{}}%
% \fi
% \or
% \colo_palet_prepare{#1}%
-% \setevalue{\??colorpaletspecification#1}{#2}%
+% \edefcsname\??colorpaletspecification#1\endcsname{#2}%
% \colo_palet_extend{#2}%
% \colo_palets_define_assign{#1}{#2}{#3}%
% \fi}
@@ -553,15 +589,15 @@
{\edef\currentcolorpalet{#1}%
\ifempty\currentcolorpalet
% seems to be a reset
- \let\currentcolorprefix\empty
+ \lettonothing\currentcolorprefix
%\t_colo_prefix\emptytoks
\orelse\ifcsname\??paletlist\currentcolorpalet\endcsname
\edef\currentcolorprefix{#1:}%
%\t_colo_prefix\expandafter{\currentcolorprefix}%
\else
\colo_helpers_show_message\m!colors7\currentcolorpalet
- \let\currentcolorpalet\empty
- \let\currentcolorprefix\empty
+ \lettonothing\currentcolorpalet
+ \lettonothing\currentcolorprefix
%\t_colo_prefix\emptytoks
\fi
\the\everysetuppalet
@@ -628,6 +664,31 @@
\fetchmodulecommand \showcolor \f!colo_run
+%D This one shows the luminance ratio conform WCAG:
+%D
+%D \starttyping
+%D \starttabulate[||r|]
+%D \NC red \NC \colorluminance{red} \NC \NR
+%D \NC green \NC \colorluminance{green} \NC \NR
+%D \NC black \NC \colorluminance{black} \NC \NR
+%D \NC white \NC \colorluminance{white} \NC \NR
+%D \stoptabulate
+%D
+%D \starttabulate[||r|]
+%D \NC red : green \NC \colorluminanceratio{red}{green} \NC \NR
+%D \NC red : black \NC \colorluminanceratio{red}{black} \NC \NR
+%D \NC red : white \NC \colorluminanceratio{red}{white} \NC \NR
+%D \stoptabulate
+%D
+%D \usecolors[crayola]
+%D
+%D \compareluminance[Jade] [Onyx] \par
+%D \compareluminance[Goldenrod] [Onyx] \par
+%D \compareluminance[CobaltBlue][Onyx] \par
+%D \stoptyping
+
+\fetchmodulecommand \compareluminance \f!colo_run
+
%D It would make sense to put the following code in \type {colo-mps}, but it it
%D rather low level.
@@ -713,13 +774,13 @@
\def\v_colo_dummy_name{c_o_l_o_r}
-\letvalue{\??colorattribute \v_colo_dummy_name}\empty
-\letvalue{\??transparencyattribute\v_colo_dummy_name}\empty
-\letvalue{\??colorsetter \v_colo_dummy_name}\empty
-\letvalue{\??transparencysetter \v_colo_dummy_name}\empty
+\letcsname\??colorattribute \v_colo_dummy_name\endcsname\empty
+\letcsname\??transparencyattribute\v_colo_dummy_name\endcsname\empty
+\letcsname\??colorsetter \v_colo_dummy_name\endcsname\empty
+\letcsname\??transparencysetter \v_colo_dummy_name\endcsname\empty
-\letvalue{\??colorsetter -}\empty % used?
-\letvalue{\??transparencysetter-}\empty % used?
+\letcsname\??colorsetter -\endcsname\empty % used?
+\letcsname\??transparencysetter -\endcsname\empty % used?
% new: expandable (see tbl preamble)
@@ -814,8 +875,8 @@
% \let\colo_basics_inherit \gobbletwoarguments % used in mp interface
\def\colo_basics_allocate#1%
- {\expandafter\newcount\csname\??colornumber#1\endcsname
- \clf_synccolorcount{#1}\c_syst_last_allocated_count}
+ {\expandafter\newinteger\csname\??colornumber#1\endcsname
+ \clf_synccolorcount{#1}{\??colornumber#1}}
\def\colo_basics_synchronize#1%
{\ifcsname\??colornumber#1\endcsname\else
@@ -827,10 +888,10 @@
\let\colo_basics_inherit\clf_synccolorclone
-\newcount\c_colo_protection
+\newinteger\c_colo_protection
-\permanent\protected\def\startprotectedcolors{\advance\c_colo_protection\plusone }
-\permanent\protected\def\stopprotectedcolors {\advance\c_colo_protection\minusone}
+\permanent\protected\def\startprotectedcolors{\advanceby\c_colo_protection\plusone }
+\permanent\protected\def\stopprotectedcolors {\advanceby\c_colo_protection\minusone}
\permanent\tolerant\protected\def\definecolor[#1]#*[#2]%
{\iftok{#1}{#2}%
@@ -850,7 +911,7 @@
\clf_defineprocesscolorglobal{#1}{#2}\v_colo_freeze_state\relax
\colo_basics_synchronize{#1}%
\ifcase\c_colo_protection
- \protected\instance\setgvalue{#1}{\colo_helpers_activate{#1}}%
+ \protected\instance\gdefcsname#1\endcsname{\colo_helpers_activate{#1}}%
\fi
\fi}
@@ -885,14 +946,14 @@
{\clf_definespotcolorglobal{#1}{#2}{#3}%
\colo_basics_synchronize{#1}%
\ifcase\c_colo_protection
- \protected\instance\setgvalue{#1}{\colo_helpers_activate{#1}}%
+ \protected\instance\gdefcsname#1\endcsname{\colo_helpers_activate{#1}}%
\fi}
\permanent\tolerant\protected\def\definemultitonecolor[#1]#*[#2]#*[#3]#*[#4]%
{\clf_definemultitonecolorglobal{#1}{#2}{#3}{#4}%
\colo_basics_synchronize{#1}%
\ifcase\c_colo_protection
- \protected\instance\setgvalue{#1}{\colo_helpers_activate{#1}}%
+ \protected\instance\gdefcsname#1\endcsname{\colo_helpers_activate{#1}}%
\fi}
%D Transparencies (only):
@@ -1066,8 +1127,8 @@
%D \stopregistercolor
%D \stoptyping
-\mutable\let\maintextcolor \empty
-\mutable\def\defaulttextcolor{black}
+\mutable\lettonothing\maintextcolor
+\mutable\def \defaulttextcolor{black}
\permanent\protected\def\inheritmaintextcolor
{\ifempty\maintextcolor\else\colo_helpers_activate\maintextcolor\fi}
@@ -1093,9 +1154,9 @@
\permanent\protected\def\starttextcolor[#1]%
{\doifsomething{#1}{\colo_helpers_switch_to_maintextcolor{#1}}}
-\aliased\let\stoptextcolor\relax
+\permanent\protected\lettonothing\stoptextcolor
-\let\p_colo_textcolor\empty
+\lettonothing\p_colo_textcolor
\def\colo_helpers_initialize_maintextcolor
{\edef\p_colo_textcolor{\directcolorsparameter\c!textcolor}%
@@ -1108,13 +1169,13 @@
\appendtoks \colo_helpers_initialize_maintextcolor \to \everyjob
\appendtoks \colo_helpers_initialize_maintextcolor \to \everysetupcolors
-\letvalue{\??colorsetter }\empty \letvalue{\??colorattribute }\!!zerocount
-\letvalue{\??transparencysetter}\empty \letvalue{\??transparencyattribute}\!!zerocount
+\letcsname\??colorsetter \endcsname\empty \letcsname\??colorattribute \endcsname\!!zerocount
+\letcsname\??transparencysetter\endcsname\empty \letcsname\??transparencyattribute\endcsname\!!zerocount
-\def\colo_helpers_inherited_direct_cs#1{\ifcsname\??colorsetter #1\endcsname\lastnamedcs\fi}
-\def\colo_helpers_inherited_direct_ca#1{\ifcsname\??colorattribute #1\endcsname\lastnamedcs\else\!!zerocount\fi}
-\def\colo_helpers_inherited_direct_ts#1{\ifcsname\??transparencysetter #1\endcsname\lastnamedcs\fi}
-\def\colo_helpers_inherited_direct_ta#1{\ifcsname\??transparencyattribute#1\endcsname\lastnamedcs\else\!!zerocount\fi}
+\def\colo_helpers_inherited_direct_cs#1{\begincsname\??colorsetter #1\endcsname}
+\def\colo_helpers_inherited_direct_ca#1{\ifcsname \??colorattribute #1\endcsname\lastnamedcs\else\!!zerocount\fi}
+\def\colo_helpers_inherited_direct_ts#1{\begincsname\??transparencysetter #1\endcsname}
+\def\colo_helpers_inherited_direct_ta#1{\ifcsname \??transparencyattribute#1\endcsname\lastnamedcs\else\!!zerocount\fi}
\let\colo_defcsname\defcsname
\let\colo_endcsname\endcsname
@@ -1159,8 +1220,8 @@
\colo_defcsname\??transparencysetter #1:#2\colo_endcsname{\colo_helpers_inherited_direct_ts{\??colorpalet#1:#2}}%
\colo_defcsname\??transparencyattribute#1:#2\colo_endcsname{\colo_helpers_inherited_direct_ta{\??colorpalet#1:#2}}}
-\setvalue{\??colorattribute currentcolor}{\the\c_attr_color} % for mpcolor
-\setvalue{\??transparencyattribute currentcolor}{\the\c_attr_transparency} % for mpcolor
+\defcsname\??colorattribute currentcolor\endcsname{\the\c_attr_color} % for mpcolor
+\defcsname\??transparencyattribute currentcolor\endcsname{\the\c_attr_transparency} % for mpcolor
\def\colo_helpers_inherited_current_ca#1{\ifcsname\??colorattribute \currentcolorprefix#1\endcsname\lastnamedcs\orelse\ifcsname\??colorattribute #1\endcsname\lastnamedcs\else\!!zerocount\fi}
\def\colo_helpers_inherited_current_cs#1{\ifcsname\??colorsetter \currentcolorprefix#1\endcsname\lastnamedcs\orelse\ifcsname\??colorsetter #1\endcsname\lastnamedcs\fi}
@@ -1264,6 +1325,9 @@
\permanent\def\colorvalue #1{\clf_formatcolor\rawcolorattribute{#1}{\colorformatseparator}}
\permanent\def\grayvalue #1{\clf_formatgray \rawcolorattribute{#1}{\colorformatseparator}}
+\permanent\def\colorluminance #1{\clf_formatluminance \rawcolorattribute{#1} }
+\permanent\def\colorluminanceratio #1#2{\clf_formatluminanceratio\rawcolorattribute{#1} \rawcolorattribute{#2} }
+
\permanent\def\doifelseblack #1{\clf_doifelseblack\rawcolorattribute{#1}}
\permanent\def\doifelsedrawingblack {\clf_doifelsedrawingblack}
@@ -1294,7 +1358,16 @@
%
% I really need to sort this out!
-\permanent\protected\def\forcecolorhack{\leaders\hrule\s!height\zeropoint\s!depth\zeropoint\hskip\zeropoint\relax} % relax is needed !
+% \permanent\protected\def\normalforcecolorhack{\leaders\hrule\s!height\zeropoint\s!depth\zeropoint\hskip\zeropoint\relax} % relax is needed !
+%
+% \installtexexperiment
+% {disablecolorhack}
+% {\pushoverloadmode\enforced\permanent\protected\lettonothing\forcecolorhack\popoverloadmode}
+% {\pushoverloadmode\enforced\let\forcecolorhack\normalforcecolorhack\popoverloadmode}
+%
+% use \hpack container{...}
+
+\permanent\protected\lettonothing\forcecolorhack
%D We default to the colors defined in \type {colo-imp-rgb} and support both \RGB\
%D and \CMYK\ output. Transparencies are defined here:
@@ -1334,6 +1407,7 @@
\definecolor[trace:9][g=.4,b=.8]
\definecolor[trace:w][s=1]
+\definecolor[trace:z][s=0,t=.5,a=1]
\definecolor[trace:r][r=.75,t=.5,a=1]
\definecolor[trace:g][g=.75,t=.5,a=1]
\definecolor[trace:b][b=.75,t=.5,a=1]
@@ -1348,6 +1422,7 @@
\definecolor[trace:o][r=1,g=.6,b=.1,t=.5,a=1]
\definecolor[trace:dw][s=1]
+\definecolor[trace:dz][s=0,t=.75,a=1]
\definecolor[trace:dr][r=.75,t=.75,a=1]
\definecolor[trace:dg][g=.75,t=.75,a=1]
\definecolor[trace:db][b=.75,t=.75,a=1]
diff --git a/Master/texmf-dist/tex/context/base/mkxl/cont-fil.mkxl b/Master/texmf-dist/tex/context/base/mkxl/cont-fil.mkxl
index 0ca3bb05acd..e7fdd6f8247 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/cont-fil.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/cont-fil.mkxl
@@ -146,7 +146,10 @@
%definefilesynonym [set-13] [setups-proofing]
%definefilesynonym [set-15] [setups-generate]
-\definefilesynonym [ecmascript] [libs-imp-mujs]
-\definefilesynonym [zint] [libs-imp-zint]
+\definefilesynonym [ecmascript] [libs-imp-mujs]
+\definefilesynonym [zint] [libs-imp-zint]
+\definefilesynonym [barcode] [libs-imp-zint]
+
+\definefilesynonym [newmml] [mathml]
\endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/cont-log.mkxl b/Master/texmf-dist/tex/context/base/mkxl/cont-log.mkxl
index 4df509f608f..baf3afeba1c 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/cont-log.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/cont-log.mkxl
@@ -188,6 +188,7 @@
\instance\protected\def\INRSTEX {inrs\TeX}
\instance\protected\def\PRAGMA {Pragma ADE}
+\instance\protected\def\LUA {\Lua} % below
%D And this is how they show up: \TeX, \MetaFont, \MetaPost, \PiCTeX, \TaBlE, \ConTeXt,
%D \PPCHTeX, \AmSTeX, \LaTeX, \LamSTeX.
@@ -204,27 +205,44 @@
\frozen\instance\protected\def\luametaTeX{lua\wordboundary meta\wordboundary\TeX}
\frozen\instance\protected\def\XeTeX {X\lower.5\exheight\hbox{\kern-.15\emwidth\mirror{E}}\kern-.1667\emwidth\TeX}
-% Adapted from a patch by Mojca:
-\def\syst_logos_xetex_e
- {\setbox\scratchbox\hbox{E}%
- \raise\dimexpr\ht\scratchbox+\dp\scratchbox\relax\hbox{\rotate[\c!rotation=180]{\box\scratchbox}}}
-
-\frozen\instance\protected\def\XeTeX
+% % Adapted from a patch by Mojca:
+%
+% \def\syst_logos_xetex_e
+% {\setbox\scratchbox\hbox{E}%
+% \raise\dimexpr\ht\scratchbox+\dp\scratchbox\relax\hbox{\rotate[\c!rotation=180]{\box\scratchbox}}}
+%
+% \frozen\instance\protected\def\XeTeX
+% {X\lower.5\exheight
+% \hbox
+% {\kern-.15\emwidth
+% \iffontchar\font"018E\relax
+% \char"018E%
+% \else
+% \ifx\fontalternative\s!bf \mirror{E}\orelse
+% \ifx\fontalternative\s!it\syst_logos_xetex_e\orelse
+% \ifx\fontalternative\s!sl\syst_logos_xetex_e\orelse
+% \ifx\fontalternative\s!bi\syst_logos_xetex_e\orelse
+% \ifx\fontalternative\s!bs\syst_logos_xetex_e\else
+% \mirror{E}\fi
+% \fi}%
+% \kern-.1667\emwidth\TeX}
+
+% This is good enough for th efew times that we need it:
+
+\def\syst_logos_xe
{X\lower.5\exheight
- \hbox
- {\kern-.15\emwidth
- \iffontchar\font"018E\relax
- \char"018E%
- \else
- \ifx\fontalternative\s!bf \mirror{E}\orelse
- \ifx\fontalternative\s!it\syst_logos_xetex_e\orelse
- \ifx\fontalternative\s!sl\syst_logos_xetex_e\orelse
- \ifx\fontalternative\s!bi\syst_logos_xetex_e\orelse
- \ifx\fontalternative\s!bs\syst_logos_xetex_e\else
- \mirror{E}\fi
- \fi}%
- \kern-.1667\emwidth\TeX}
+ \hbox\bgroup
+ \kern-.15\emwidth
+ \iffontchar\font"018E\relax
+ \char"018E%
+ \else
+ \mirror{E}%
+ \fi
+ \egroup}
+
+\frozen\instance\protected\def\XeTeX {\syst_logos_xe\kern-.1667\emwidth\TeX}
+\frozen\instance\protected\def\XeLaTeX{\syst_logos_xe\LaTeX}
\instance\protected\def\ETEX {\eTeX}
\instance\protected\def\PDFTEX {\pdfTeX}
@@ -300,7 +318,6 @@
\enforced\instance\def\LuaTeX {LuaTeX}%
\enforced\instance\def\LuajitTeX {LuajitTeX}%
\enforced\instance\def\LuaMetaTeX{LuaMetaTeX}%
- %\let\wordboundary\empty % primitive so we need to promote it to frozen (orjust preroll)
\to \everysimplifycommands
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/cont-new.mkxl b/Master/texmf-dist/tex/context/base/mkxl/cont-new.mkxl
index b60dd2dddd4..129e3d54531 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/cont-new.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/cont-new.mkxl
@@ -13,7 +13,7 @@
% \normalend % uncomment this to get the real base runtime
-\newcontextversion{2021.03.05 19:11}
+\newcontextversion{2023.02.23 21:26}
%D This file is loaded at runtime, thereby providing an excellent place for hacks,
%D patches, extensions and new features. There can be local overloads in cont-loc
diff --git a/Master/texmf-dist/tex/context/base/mkxl/cont-run.lmt b/Master/texmf-dist/tex/context/base/mkxl/cont-run.lmt
index 76fd6ba249b..448992b4b56 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/cont-run.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/cont-run.lmt
@@ -21,6 +21,8 @@ local possiblepath = sandbox.possiblepath
local context = context
local implement = interfaces.implement
+local texset = tex.set
+
local qualified = { }
local writeable = { }
local readable = { }
@@ -190,6 +192,21 @@ else
end
+local function setoverloadmode(overloadmode)
+ if overloadmode == "warning" then
+ overloadmode = 3 -- 5
+ elseif overloadmode == "error" then
+ overloadmode = 4 -- 6
+ else
+ overloadmode = tonumber(overloadmode)
+ end
+ if overloadmode then
+ texset("overloadmode",overloadmode)
+ end
+end
+
+directives.register("overloadmode", setoverloadmode)
+
local function processjob()
tokens.setters.macro("processjob","","permanent")
@@ -202,6 +219,14 @@ local function processjob()
environment.lmtxmode = CONTEXTLMTXMODE -- should be true
+ -- directives
+ -- silent
+ -- batchmode
+
+if arguments.directives then
+ directives.enable(arguments.directives)
+end
+
if arguments.nosynctex then
luatex.synctex.setup {
state = interfaces.variables.never,
@@ -213,22 +238,26 @@ local function processjob()
}
end
- local overloadmode = arguments.overloadmode
-
- if overloadmode == "warning" then
- overloadmode = 3 -- 5
- elseif overloadmode == "error" then
- overloadmode = 4 -- 6
- else
- overloadmode = tonumber(overloadmode)
- end
+ logs.registerfinalactions(function()
+ logs.pushtarget("log")
+ statistics.showusage("finish")
+ logs.poptarget()
+ end)
- if overloadmode then
- tex.set("overloadmode",overloadmode)
- end
+ setoverloadmode(arguments.overloadmode)
if not filename or filename == "" then
-- skip
+ elseif suffix == "svg" or arguments.forcesvg then
+
+ report_system("processing svg output: %s",filename)
+
+ context.starttext()
+ context.startTEXpage()
+ context.externalfigure ( { filename }, { conversion = "mp" } )
+ context.stopTEXpage()
+ context.stoptext()
+
elseif suffix == "xml" or arguments.forcexml then
-- Maybe we should move the preamble parsing here as it
diff --git a/Master/texmf-dist/tex/context/base/mkxl/cont-run.mkxl b/Master/texmf-dist/tex/context/base/mkxl/cont-run.mkxl
index 8944a0359e7..edc038e45e2 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/cont-run.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/cont-run.mkxl
@@ -22,14 +22,14 @@
\unprotect
-\permanent\let\synctexsetfilename \clf_synctexsetfilename % can be public implementors
-\permanent\let\synctexresetfilename\clf_synctexresetfilename % idem
-\permanent\let\synctexblockfilename\clf_synctexblockfilename % idem
+% \synctexsetfilename % defined at lua end
+% \synctexresetfilename % idem
+% \synctexblockfilename % idem
-\aliased\let\synctexpause \donothing
-\aliased\let\synctexresume \donothing
-\aliased\let\synctexpushline\donothing
-\aliased\let\synctexpopline \donothing
+\permanent\protected\lettonothing\synctexpause
+\permanent\protected\lettonothing\synctexresume
+\permanent\protected\lettonothing\synctexpushline
+\permanent\protected\lettonothing\synctexpopline
\appendtoks\synctexpause \to\everybeforeoutput
\appendtoks\synctexresume\to\everyafteroutput
@@ -54,6 +54,14 @@
\permanent\protected\def\blocksynctexfile[#1]%
{\processcommacommand{#1}\synctexblockfilename}
-\aliased\let\continuewhenlmtxmode\relax
+\permanent\protected\lettonothing\continuewhenlmtxmode
+
+\permanent\protected\def\continuewhenmkivmode
+ {\starttext
+ \startTEXpage[\c!offset=2ex,\c!foregroundstyle=\tttf]%
+ This file needs \LuaTeX\ and \ConTeXt\ \MKIV.%
+ \stopTEXpage
+ \stoptext
+ \endinput}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/context.mkxl b/Master/texmf-dist/tex/context/base/mkxl/context.mkxl
index 88b99e7d4a4..809fbc307d3 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/context.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/context.mkxl
@@ -29,7 +29,7 @@
%D {YYYY.MM.DD HH:MM} format.
\immutable\edef\contextformat {\jobname}
-\immutable\edef\contextversion{2021.03.05 19:11}
+\immutable\edef\contextversion{2023.02.23 21:26}
%overloadmode 1 % check frozen / warning
%overloadmode 2 % check frozen / error
@@ -40,6 +40,8 @@
\immutable\chardef\contextlmtxmode\directlua{tex.print(CONTEXTLMTXMODE or 0)}\relax
+\directlua{io.output():setvbuf("line")}
+
%D For those who want to use this:
\aliased\let\fmtname \contextformat
@@ -121,7 +123,7 @@
%D This needs more checking for clashes:
%D
%D \starttyping
-%D \doifelsefileexists{l-macro-imp-codes-luametatex.lua}{\registerctxluafile{l-macro-imp-codes-luametatex}{}}{}
+% \doifelsefileexists{l-macro-imp-codes-luametatex.lua}{\registerctxluafile{l-macro-imp-codes-luametatex}{}}{}
%D \stoptyping
\loadmkxlfile{supp-dir}
@@ -133,6 +135,7 @@
\loadmkxlfile{mult-ini}
\loadmkxlfile{mult-sys}
\loadmkxlfile{mult-aux}
+% \doiffileelse{mult-aux-new.mkxl}{\loadmkxlfile{mult-aux-new}}{\loadmkxlfile{mult-aux}}
\loadmkxlfile{mult-def}
%loadmarkfile{mult-chk}
\loadmklxfile{mult-dim}
@@ -144,6 +147,7 @@
\loadmkxlfile{toks-aux}
\loadmkxlfile{attr-ini}
+\loadmkxlfile{bndr-ini}
\loadmkxlfile{core-ini}
\loadmkxlfile{core-env}
@@ -151,6 +155,8 @@
\loadmkxlfile{layo-ini}
\loadmkxlfile{node-ini}
+\loadmkxlfile{node-ext}
+\loadmkxlfile{node-syn}
% \loadmkxlfile{cldf-bas} % basics / depends on nodes
@@ -158,11 +164,10 @@
\loadmkxlfile{node-mig}
%loadmkxlfile{node-pag}
-\loadmkxlfile{driv-ini}
+\loadmkxlfile{driv-ini} % after node-ini (ext)
\loadmkxlfile{back-ini}
\loadmkxlfile{back-res}
-\loadmkxlfile{back-ext}
\loadmkxlfile{cldf-bas} % basics / depends on nodes
@@ -218,7 +223,7 @@
\loadmkxlfile{colo-grp} % optional
\loadmkxlfile{colo-ext}
-\loadmkxlfile{node-bck} % overloads anch-pgr (experimental and undocumented)
+% \loadmkxlfile{node-bck} % overloads anch-pgr (experimental and undocumented)
\loadmkxlfile{pack-cut}
@@ -304,6 +309,8 @@
\loadmkxlfile{page-lay}
\loadmklxfile{page-box}
\loadmklxfile{page-txt}
+
+\loadmkxlfile{typo-lbx}
\loadmkxlfile{page-sid}
\loadmklxfile{strc-flt}
@@ -386,6 +393,9 @@
\loadmkxlfile{typo-tal}
\loadmkxlfile{typo-par} % par builders (uses fonts)
+%loadmkxlfile{typo-lbx}
+\loadmkxlfile{typo-adj}
+\loadmkxlfile{typo-ada}
\loadmkxlfile{tabl-com}
%loadmarkfile{tabl-pln}
@@ -416,6 +426,7 @@
\loadmkxlfile{typo-wrp}
\loadmkxlfile{typo-spa}
\loadmkxlfile{typo-krn}
+\loadmkxlfile{typo-hid}
\loadmklxfile{typo-itc}
\loadmkxlfile{typo-dir}
\loadmkxlfile{typo-brk}
@@ -466,7 +477,7 @@
\loadmklxfile{anch-bck}
\loadmkxlfile{anch-tab} % overloads tabl-tbl
\loadmkxlfile{anch-bar}
-%loadmkxlfile{anch-snc} % when needed this one will be redone
+\loadmkxlfile{anch-snc}
\loadmkxlfile{math-ini} % way after font-pre !
\loadmkxlfile{math-pln}
@@ -478,14 +489,18 @@
\loadmkxlfile{math-mis}
\loadmkxlfile{math-scr}
\loadmkxlfile{math-int}
+\loadmkxlfile{math-dif}
\loadmkxlfile{math-del}
\loadmkxlfile{math-fen}
+\loadmkxlfile{math-lop}
\loadmklxfile{math-acc}
\loadmklxfile{math-rad}
+\loadmklxfile{math-dld}
\loadmkxlfile{math-inl}
\loadmkxlfile{math-dis}
%loadmkxlfile{math-lan}
\loadmkxlfile{math-toy}
+\loadmkxlfile{math-twk}
\loadmkxlfile{strc-mat}
@@ -496,6 +511,8 @@
\loadmkxlfile{phys-dim}
\loadmkxlfile{node-rul} % beware, defined \underbar so after math
+\loadmkxlfile{node-bck} % overloads anch-pgr (experimental and undocumented)
+
\loadmklxfile{font-sol} % font solutions
\loadmklxfile{strc-not}
@@ -504,6 +521,8 @@
\loadmkxlfile{strc-usr}
\loadmkxlfile{pack-com}
+\loadmkxlfile{math-com}
+
\loadmkxlfile{typo-del}
\loadmkxlfile{grph-trf}
@@ -514,15 +533,20 @@
\loadmkxlfile{grph-pat}
\loadmkxlfile{pack-box}
+\loadmkxlfile{pack-mat}
\loadmkxlfile{pack-bar}
\loadmkxlfile{page-app}
\loadmkxlfile{meta-fig}
\loadmkxlfile{page-ffl}
+\loadmkxlfile{page-blk}
\loadmkxlfile{lang-spa} % will become obsolete
+\loadmkxlfile{lang-hup}
+
\loadmkxlfile{typo-ovl} % fuzzy project (tracing) code
+\loadmkxlfile{typo-syn} % experiment
% old bibtex support: (will be m-oldbibtex.mkiv)
@@ -557,10 +581,13 @@
\loadmkxlfile{driv-shp}
+\loadmkxlfile{anch-loc} % for now here (after driver)
+
\loadmkxlfile{back-exp}
-\loadmkxlfile{back-pdf}
-\loadmkxlfile{back-mps}
-\loadmkxlfile{back-lua}
+
+\loadmkxlfile{back-imp-pdf}
+\loadmkxlfile{back-imp-mps}
+\loadmkxlfile{back-imp-lua}
\loadmkxlfile{mlib-pdf}
\loadmkxlfile{mlib-pps}
@@ -568,6 +595,8 @@
\loadmkxlfile{meta-blb}
\loadmkxlfile{grph-epd}
+\loadmkxlfile{anch-box}
+
\loadmkxlfile{typo-shp}
\loadmkxlfile{math-inc} % an experiment
@@ -603,12 +632,220 @@
\ctxlua{statistics.savefmtstatus("\jobname","\contextversion","context.mkxl","\contextbanner")}% can become automatic
\to \everydump
-% some day:
+% maybe some day (but also inhibits):
%
% \prependtoks
% \overloadmode 255
% \to \everyjob
-\overloadmode 0 % for now
+\overloadmode\zerocount % for now
\errorstopmode \dump \endinput
+
+% Some lua files are (still) shared with mkiv amd some are large and rather
+% generic. However there are some that can be improved in lmtx. At some point
+% we will definitely freeze mkiv and then use lmt files for futher development
+% of lmtx. We also no longer use the macro feature to replace 5.3 compatible
+% function calls by native 5.4 features as lmt files assume 5.4 anyway. This
+% makes format generation a little faster (not that it's that slow). It might \
+% take a while before we dealt with all of them because I'll also clean them
+% up a bit when doing.
+%
+% % luat-bas.mkxl l-macro-imp-optimize % this will go away
+
+% c:/data/develop/context/sources/attr-eff.lua
+% c:/data/develop/context/sources/attr-mkr.lua
+% c:/data/develop/context/sources/attr-neg.lua
+
+% c:/data/develop/context/sources/buff-imp-default.lua
+% c:/data/develop/context/sources/buff-imp-escaped.lua
+% c:/data/develop/context/sources/buff-imp-lua.lua
+% c:/data/develop/context/sources/buff-imp-mp.lua
+% c:/data/develop/context/sources/buff-imp-nested.lua
+% c:/data/develop/context/sources/buff-imp-parsed-xml.lua
+% c:/data/develop/context/sources/buff-imp-tex.lua
+% c:/data/develop/context/sources/buff-imp-xml.lua
+
+% c:/data/develop/context/sources/buff-par.lua
+% c:/data/develop/context/sources/buff-ver.lua
+
+% c:/data/develop/context/sources/char-cjk.lua
+% c:/data/develop/context/sources/char-def.lua
+% c:/data/develop/context/sources/char-enc.lua
+% c:/data/develop/context/sources/char-ent.lua
+% c:/data/develop/context/sources/char-fio.lua
+% c:/data/develop/context/sources/char-ini.lua
+% c:/data/develop/context/sources/char-map.lua
+% c:/data/develop/context/sources/char-scr.lua
+% c:/data/develop/context/sources/char-utf.lua
+
+% c:/data/develop/context/sources/chem-ini.lua
+% c:/data/develop/context/sources/chem-str.lua
+
+% c:/data/develop/context/sources/cldf-com.lua
+% c:/data/develop/context/sources/cldf-ini.lua
+% c:/data/develop/context/sources/cldf-prs.lua % use in chemistry
+% c:/data/develop/context/sources/cldf-scn.lua
+% c:/data/develop/context/sources/cldf-stp.lua
+% c:/data/develop/context/sources/cldf-ver.lua
+
+% c:/data/develop/context/sources/colo-icc.lua
+% c:/data/develop/context/sources/colo-ini.lua
+
+% c:/data/develop/context/sources/core-con.lua
+% c:/data/develop/context/sources/core-ctx.lua
+% c:/data/develop/context/sources/core-dat.lua
+% c:/data/develop/context/sources/core-two.lua
+
+% data...
+
+% c:/data/develop/context/sources/file-ini.lua
+% c:/data/develop/context/sources/file-lib.lua
+% c:/data/develop/context/sources/file-res.lua
+% c:/data/develop/context/sources/file-syn.lua
+
+% c:/data/develop/context/sources/font-afk.lua
+% c:/data/develop/context/sources/font-agl.lua
+% c:/data/develop/context/sources/font-aux.lua
+% c:/data/develop/context/sources/font-cid.lua
+% c:/data/develop/context/sources/font-enc.lua
+% c:/data/develop/context/sources/font-log.lua
+% c:/data/develop/context/sources/font-lua.lua % not realy used, more a demo
+% c:/data/develop/context/sources/font-nod.lua % some trace helpers
+% c:/data/develop/context/sources/font-osd.lua
+% c:/data/develop/context/sources/font-otc.lua
+% c:/data/develop/context/sources/font-oth.lua
+% c:/data/develop/context/sources/font-oti.lua
+% c:/data/develop/context/sources/font-oto.lua
+% c:/data/develop/context/sources/font-otr.lua
+% c:/data/develop/context/sources/font-ott.lua % just some tables
+% c:/data/develop/context/sources/font-oup.lua % packing and unpacking
+% c:/data/develop/context/sources/font-pat.lua
+% c:/data/develop/context/sources/font-prv.lua
+% c:/data/develop/context/sources/font-sel.lua
+% c:/data/develop/context/sources/font-shp.lua % shapes, for now shared
+% c:/data/develop/context/sources/font-sol.lua
+% c:/data/develop/context/sources/font-syn.lua % identification code
+% c:/data/develop/context/sources/font-trt.lua
+% c:/data/develop/context/sources/font-web.lua % proof of concept, never used
+
+% c:/data/develop/context/sources/font-imp-combining.lua % shared, like typescript
+% c:/data/develop/context/sources/font-imp-dimensions.lua % idem
+% c:/data/develop/context/sources/font-imp-italics.lua % idem
+% c:/data/develop/context/sources/font-imp-notused.lua % idem
+% c:/data/develop/context/sources/font-imp-properties.lua % idem
+% c:/data/develop/context/sources/font-imp-reorder.lua % idem
+% c:/data/develop/context/sources/font-imp-spacekerns.lua % idem
+% c:/data/develop/context/sources/font-imp-tex.lua % idem
+% c:/data/develop/context/sources/font-imp-tweaks.lua % idem
+% c:/data/develop/context/sources/font-imp-unicode.lua % idem
+
+% c:/data/develop/context/sources/good-ctx.lua
+% c:/data/develop/context/sources/good-ini.lua
+
+% c:/data/develop/context/sources/grph-bmp.lua
+% c:/data/develop/context/sources/grph-chk.lua
+% c:/data/develop/context/sources/grph-con.lua
+% c:/data/develop/context/sources/grph-fil.lua
+% c:/data/develop/context/sources/grph-img.lua
+% c:/data/develop/context/sources/grph-pat.lua
+% c:/data/develop/context/sources/grph-raw.lua
+% c:/data/develop/context/sources/grph-u3d.lua
+
+% c:/data/develop/context/sources/java-ini.lua
+
+% c:/data/develop/context/sources/lang-cnt.lua
+% c:/data/develop/context/sources/lang-def.lua % these are data files
+% c:/data/develop/context/sources/lang-txt.lua % these are data files
+% c:/data/develop/context/sources/lang-wrd.lua
+
+% c:/data/develop/context/sources/luat-exe.lua
+% c:/data/develop/context/sources/luat-iop.lua
+% c:/data/develop/context/sources/luat-mac.lua % will become lmt
+
+% c:/data/develop/context/sources/lxml-aux.lua
+% c:/data/develop/context/sources/lxml-css.lua
+% c:/data/develop/context/sources/lxml-dir.lua
+% c:/data/develop/context/sources/lxml-ent.lua
+% c:/data/develop/context/sources/lxml-ini.lua
+% c:/data/develop/context/sources/lxml-lpt.lua
+% c:/data/develop/context/sources/lxml-mis.lua
+% c:/data/develop/context/sources/lxml-sor.lua
+% c:/data/develop/context/sources/lxml-tab.lua
+% c:/data/develop/context/sources/lxml-tex.lua
+% c:/data/develop/context/sources/lxml-xml.lua
+
+% c:/data/develop/context/sources/meta-blb.lua
+% c:/data/develop/context/sources/meta-fun.lua
+% c:/data/develop/context/sources/meta-lua.lua
+% c:/data/develop/context/sources/meta-nod.lua
+% c:/data/develop/context/sources/meta-pdf.lua
+% c:/data/develop/context/sources/meta-tex.lua
+
+% c:/data/develop/context/sources/mult-aux.lua
+% c:/data/develop/context/sources/mult-fmt.lua
+
+% c:/data/develop/context/sources/page-cst.lua
+% c:/data/develop/context/sources/page-flt.lua
+% c:/data/develop/context/sources/page-inj.lua
+% c:/data/develop/context/sources/page-ins.lua
+% c:/data/develop/context/sources/page-mix.lua
+% c:/data/develop/context/sources/page-pst.lua
+
+% c:/data/develop/context/sources/phys-dim.lua
+
+% c:/data/develop/context/sources/publ-aut.lua % shared
+% c:/data/develop/context/sources/publ-dat.lua
+% c:/data/develop/context/sources/publ-fnd.lua
+% c:/data/develop/context/sources/publ-inc.lua
+% c:/data/develop/context/sources/publ-ini.lua
+% c:/data/develop/context/sources/publ-jrn.lua
+% c:/data/develop/context/sources/publ-oth.lua
+% c:/data/develop/context/sources/publ-reg.lua
+% c:/data/develop/context/sources/publ-sor.lua
+% c:/data/develop/context/sources/publ-tra.lua
+% c:/data/develop/context/sources/publ-usr.lua
+
+% c:/data/develop/context/sources/scrn-but.lua
+% c:/data/develop/context/sources/scrn-fld.lua
+% c:/data/develop/context/sources/scrn-hlp.lua
+
+% c:/data/develop/context/sources/scrp-cjk.lua
+% c:/data/develop/context/sources/scrp-eth.lua
+% c:/data/develop/context/sources/scrp-tha.lua
+% c:/data/develop/context/sources/scrp-tib.lua
+
+% c:/data/develop/context/sources/sort-ini.lua
+% c:/data/develop/context/sources/sort-lan.lua
+
+% c:/data/develop/context/sources/strc-bkm.lua
+% c:/data/develop/context/sources/strc-blk.lua
+% c:/data/develop/context/sources/strc-con.lua
+% c:/data/develop/context/sources/strc-doc.lua
+% c:/data/develop/context/sources/strc-flt.lua
+% c:/data/develop/context/sources/strc-ini.lua
+% c:/data/develop/context/sources/strc-itm.lua
+% c:/data/develop/context/sources/strc-lev.lua
+% c:/data/develop/context/sources/strc-mat.lua
+% c:/data/develop/context/sources/strc-num.lua
+% c:/data/develop/context/sources/strc-pag.lua
+% c:/data/develop/context/sources/strc-syn.lua
+% c:/data/develop/context/sources/strc-usr.lua
+
+% c:/data/develop/context/sources/syst-cmp.lua
+% c:/data/develop/context/sources/syst-con.lua
+
+% c:/data/develop/context/sources/trac-ctx.lua
+% c:/data/develop/context/sources/trac-lmx.lua
+% c:/data/develop/context/sources/trac-par.lua
+% c:/data/develop/context/sources/trac-tex.lua
+
+% c:/data/develop/context/sources/typo-cln.lua -- wrong name for what it does
+% c:/data/develop/context/sources/typo-dha.lua
+% c:/data/develop/context/sources/typo-fkr.lua
+% c:/data/develop/context/sources/typo-inj.lua
+% c:/data/develop/context/sources/typo-man.lua
+% c:/data/develop/context/sources/typo-prc.lua
+% c:/data/develop/context/sources/typo-rep.lua
+
+% c:/data/develop/context/sources/unic-ini.lua
diff --git a/Master/texmf-dist/tex/context/base/mkxl/core-con.mkxl b/Master/texmf-dist/tex/context/base/mkxl/core-con.mkxl
index df505cfee5f..f9aa1a69d18 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/core-con.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/core-con.mkxl
@@ -19,8 +19,8 @@
\unprotect
-\ifdefined\currentlanguage \else \let\currentlanguage\empty \fi
-\ifdefined\labeltext \else \let\labeltext \firstofoneargument \fi
+\ifdefined\currentlanguage \else \lettonothing\currentlanguage \fi
+\ifdefined\labeltext \else \let\labeltext\firstofoneargument \fi
%D This module deals with all kind of conversions from numbers and dates. I
%D considered splitting this module in a support one and a core one, but to keep
@@ -86,9 +86,14 @@
\permanent\def\Alphabeticnumerals#1{\clf_Alphabetic\numexpr#1\relax{}}
\permanent\def\thainumerals #1{\clf_alphabetic\numexpr#1\relax{thai}}
-\permanent\def\devanagarinumerals#1{\clf_alphabetic\numexpr#1\relax{devanagari}}
-\permanent\def\gurmurkhinumerals #1{\clf_alphabetic\numexpr#1\relax{gurmurkhi}}
-\permanent\def\gujaratinumerals #1{\clf_alphabetic\numexpr#1\relax{gujarati}}
+\permanent\def\devanagarinumerals#1{\clf_decimals\numexpr#1\relax{devanagari}}
+\permanent\def\malayalamnumerals #1{\clf_decimals\numexpr#1\relax{malayalam}}
+\permanent\def\tamilnumerals #1{\clf_decimals\numexpr#1\relax{tamil}}
+\permanent\def\kannadanumerals #1{\clf_decimals\numexpr#1\relax{kannada}}
+\permanent\def\telugunumerals #1{\clf_decimals\numexpr#1\relax{telugu}}
+\permanent\def\bengalinumerals #1{\clf_decimals\numexpr#1\relax{bengali}}
+\permanent\def\gujaratinumerals #1{\clf_decimals\numexpr#1\relax{gujarati}}
+\permanent\def\gurmurkhinumerals #1{\clf_decimals\numexpr#1\relax{gurmurkhi}}
\permanent\def\tibetannumerals #1{\clf_alphabetic\numexpr#1\relax{tibetan}}
\permanent\def\greeknumerals #1{\clf_alphabetic\numexpr#1\relax{greek}}
\permanent\def\Greeknumerals #1{\clf_Alphabetic\numexpr#1\relax{greek}}
@@ -180,12 +185,7 @@
%D
%D The last part of this module is dedicated to converting dates. Because we want to
%D use as meaningful commands as possible, and because \TEX\ already uses up some of
-%D those, we save the original meanings.
-
-% \savenormalmeaning\time
-% \savenormalmeaning\year
-% \savenormalmeaning\month
-% \savenormalmeaning\day
+%D those, we save the original meanings. The above are defined already.
%D \macros
%D {month,MONTH}
@@ -418,8 +418,8 @@
\installcorenamespace{date}
-\permanent\tolerant\protected\def\definedate[#1]#*[#2]%
- {\ifarguments\else\setvalue{\??date#1}{#2}\fi}
+\permanent\tolerant\protected\def\definedate[#1]#,[#2]%
+ {\ifarguments\else\defcsname\??date#1\endcsname{#2}\fi}
\def\syst_converters_check_date_specification#1%
{\ifcsname\??date#1\endcsname
@@ -452,7 +452,7 @@
\iftok{\directdummyparameter\c!m}\emptytoks\else\normalmonth\number\directdummyparameter\c!m\relax\fi
\iftok{\directdummyparameter\c!y}\emptytoks\else\normalyear \number\directdummyparameter\c!y\relax\fi}}
-\permanent\tolerant\protected\def\date[#1]#*[#2]% sets the date !
+\permanent\tolerant\protected\def\date[#1]#,[#2]% sets the date !
{\dontleavehmode
\begingroup
\setdate[#1]% sets the date !
@@ -552,7 +552,7 @@
\installcorenamespace {conversionwords}
%D It might be better to move more to \LUA\ as we also need conversion there and
-%D doublicating logic doesn't make things cleaner. It means that all conversions
+%D duplicating logic doesn't make things cleaner. It means that all conversions
%D will get a language argument too. However, we permit definitions at the \TEX\ end
%D so we have to provide some hybrid method.
@@ -568,8 +568,8 @@
\def\syst_converters_define_conversion_indeed#1#2#3%
{\doifelseinstring{,}{\detokenize{#3}}
{\clf_defineconversion{#2}{\detokenize{#3}}% a set e.g. of symbols
- \setgvalue{\??conversion#1}{\syst_converters_checked_conversion{#2}}}
- {\setgvalue{\??conversion#1}{#3}}}
+ \gdefcsname\??conversion#1\endcsname{\syst_converters_checked_conversion{#2}}}
+ {\gdefcsname\??conversion#1\endcsname{#3}}}
\def\syst_converters_checked_conversion#1#2%
{\clf_checkedconversion{#1}\numexpr#2\relax}
@@ -588,9 +588,9 @@
\permanent\protected\def\uconvertnumber % unexpandable
{\convertnumber}
-\setvalue{\??conversionarguments1}#1{\csname\??conversion\currentlanguage#1\endcsname}
-\setvalue{\??conversionarguments2}#1{\csname\??conversion #1\endcsname}
-\letvalue{\??conversionarguments3}\syst_converters_checked_conversion
+\defcsname\??conversionarguments1\endcsname#1{\csname\??conversion\currentlanguage#1\endcsname}
+\defcsname\??conversionarguments2\endcsname#1{\csname\??conversion #1\endcsname}
+\letcsname\??conversionarguments3\endcsname \syst_converters_checked_conversion
% we can also add a \ctxcommand{doifelseconversion("#1","\currentlanguage")} to check
% if we have definitions that are not matched at the lua end .. eventually we might do
@@ -617,11 +617,11 @@
%D Handy.
-\setvalue{\??conversionwords\v!one }{1}
-\setvalue{\??conversionwords\v!two }{2}
-\setvalue{\??conversionwords\v!three}{3}
-\setvalue{\??conversionwords\v!four }{4}
-\setvalue{\??conversionwords\v!five }{5}
+\defcsname\??conversionwords\v!one \endcsname{1}
+\defcsname\??conversionwords\v!two \endcsname{2}
+\defcsname\??conversionwords\v!three\endcsname{3}
+\defcsname\??conversionwords\v!four \endcsname{4}
+\defcsname\??conversionwords\v!five \endcsname{5}
%permanent\def\wordtonumber#1#2{\ifcsname\??conversionwords#1\endcsname\csname\??conversionwords#1\endcsname\else#2\fi}
\permanent\def\wordtonumber#1#2{\ifcsname\??conversionwords#1\endcsname\lastnamedcs\else#2\fi}
@@ -729,6 +729,11 @@
\defineconversion [thainumerals] [\thainumerals]
\defineconversion [devanagarinumerals] [\devanagarinumerals]
+\defineconversion [malayalamnumerals] [\malayalamnumerals]
+\defineconversion [tamilnumerals] [\tamilnumerals]
+\defineconversion [kannadanumerals] [\kannadanumerals]
+\defineconversion [telugunumerals] [\telugunumerals]
+\defineconversion [bengalinumerals] [\bengalinumerals]
\defineconversion [gurmurkhinumerals] [\gurmurkhinumerals]
\defineconversion [gujaratinumerals] [\gujaratinumerals]
\defineconversion [tibetannumerals] [\tibetannumerals]
@@ -968,9 +973,9 @@
%D Taken from x-asciimath (see digits-001.tex for an example):
-\mutable\let\spaceddigitsmethod \empty % alternative methods : 1 default, 2 and 3 only when > 4
-\mutable\let\spaceddigitssymbol \empty % extra splitter symbol : {,}
-\mutable\let\spaceddigitsseparator\empty % separator symbol : {\Uchar{"2008}}
+\mutable\lettonothing\spaceddigitsmethod % alternative methods : 1 default, 2 and 3 only when > 4
+\mutable\lettonothing\spaceddigitssymbol % extra splitter symbol : {,}
+\mutable\lettonothing\spaceddigitsseparator % separator symbol : {\Uchar{"2008}}
\permanent\protected\def\spaceddigits#1%
{\clf_spaceddigits
diff --git a/Master/texmf-dist/tex/context/base/mkxl/core-dat.mkxl b/Master/texmf-dist/tex/context/base/mkxl/core-dat.mkxl
index 93d0bbb7ae8..ab40d874c1a 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/core-dat.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/core-dat.mkxl
@@ -30,6 +30,16 @@
%D \stoplines
%D \stoptyping
+%D \starttyping
+%D \definedataset[nofpages]
+%D
+%D \dorecurse{16}{whatever\page}
+%D
+%D \setdataset [nofpages] [pagetotal=\lastpagenumber]
+%D
+%D \testfeatureonce{100}{test \datasetvariable[todo-datasets]{nofpages}{1}{pagetotal} }
+%D \stoptyping
+
\unprotect
\registerctxluafile{core-dat}{}
@@ -58,8 +68,15 @@
\fi
\endgroup}
-\permanent\def\datasetvariable#1#2#3%
- {\clf_datasetvariable{#1}{#2}{#3}}
+% \permanent\def\datasetvariable#1#2#3%
+% {\clf_datasetvariable{#1}{#2}{#3}}
+
+\permanent\tolerant\def\datasetvariable[#1]%
+ {\ifparameter#1\or
+ \expandafter\clf_datasetvariablefromjob{#1\expandafter}%
+ \else
+ \expandafter\clf_datasetvariable
+ \fi}
\installcorenamespace{pagestate}
\installcorenamespace{pagestatecounter}
@@ -67,7 +84,7 @@
\installcommandhandler \??pagestate {pagestate} \??pagestate
\def\syst_pagestates_allocate
- {\expandafter\newcount\csname\??pagestatecounter\currentpagestate\endcsname}
+ {\expandafter\newinteger\csname\??pagestatecounter\currentpagestate\endcsname}
\appendtoks
\syst_pagestates_allocate
@@ -81,7 +98,7 @@
\edef\currentpagestate{#1}%
\ifcsname\??pagestatecounter\currentpagestate\endcsname
\scratchcounter\lastnamedcs
- \advance\scratchcounter\plusone
+ \advanceby\scratchcounter\plusone
\else
\scratchcounter\plusone
\syst_pagestates_allocate
diff --git a/Master/texmf-dist/tex/context/base/mkxl/core-def.mkxl b/Master/texmf-dist/tex/context/base/mkxl/core-def.mkxl
index 96570bc366d..839e9b2602e 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/core-def.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/core-def.mkxl
@@ -112,6 +112,7 @@
\syst_files_load
% for the moment here (before doc env)
\setupoutput[pdf]%
+% \setupoutput[lua]%
%
\clf_setdocumentcommandline
\clf_setdocumentctxfile
diff --git a/Master/texmf-dist/tex/context/base/mkxl/core-env.lmt b/Master/texmf-dist/tex/context/base/mkxl/core-env.lmt
index 388e96787a0..018a017679b 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/core-env.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/core-env.lmt
@@ -18,8 +18,7 @@ local P, C, S, lpegmatch, patterns = lpeg.P, lpeg.C, lpeg.S, lpeg.match, lpeg.pa
local context = context
local ctxcore = context.core
-local texgetcount = tex.getcount
-local texgetintegervalue = token.get_integer -- todo: in tex namespace
+local texgetintegervalue = token.getinteger -- todo
local allocate = utilities.storage.allocate
local setmetatableindex = table.setmetatableindex
@@ -119,12 +118,10 @@ setmetatablenewindex(texifs, function(t,k) end)
-- kind of variable ... maybe we no longer have to cache anyway (in lmtx)
setmetatableindex(texconstants, function(t,k)
- -- return cache[k].command == countcode and texgetcount(k) or 0
return cache[k].command == integercode and texgetintegervalue(k) or 0
end)
setmetatableindex(texconditionals, function(t,k) -- 0 == true
- -- return cache[k].command == countcode and texgetcount(k) == 0
return cache[k].command == integercode and texgetintegervalue(k) == 0
end)
@@ -135,30 +132,30 @@ end)
tex.isdefined = isdefined
-function tex.isdimen(name)
- local hit = cache[name]
- return hit.command == dimencode and hit.index or true
-end
-
-function tex.iscount(name)
- local hit = cache[name]
- return hit.command == countcode and hit.index or true
-end
-
-function tex.istoken(name)
- local hit = cache[name]
- return hit.command == tokencode and hit.index or true
-end
-
-function tex.isskip(name)
- local hit = cache[name]
- return hit.command == skipcode and hit.index or true
-end
-
-function tex.ismuskip(name)
- local hit = cache[name]
- return hit.command == muskipcode and hit.index or true
-end
+-- function tex.isdimen(name)
+-- local hit = cache[name]
+-- return hit.command == dimencode and hit.index or true
+-- end
+--
+-- function tex.iscount(name)
+-- local hit = cache[name]
+-- return hit.command == countcode and hit.index or true
+-- end
+--
+-- function tex.istoken(name)
+-- local hit = cache[name]
+-- return hit.command == tokencode and hit.index or true
+-- end
+--
+-- function tex.isskip(name)
+-- local hit = cache[name]
+-- return hit.command == skipcode and hit.index or true
+-- end
+--
+-- function tex.ismuskip(name)
+-- local hit = cache[name]
+-- return hit.command == muskipcode and hit.index or true
+-- end
function tex.type(name)
return types[cache[name].command] or "macro"
diff --git a/Master/texmf-dist/tex/context/base/mkxl/core-env.mkxl b/Master/texmf-dist/tex/context/base/mkxl/core-env.mkxl
index 62e4106c574..0777d282354 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/core-env.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/core-env.mkxl
@@ -308,43 +308,12 @@
\installmacrostack\c_syst_modes_set_done
-% \permanent\protected\def\startmodeset
-% {\push_macro_c_syst_modes_set_done
-% \setfalse\c_syst_modes_set_done
-% \doifelsenextoptionalcs\syst_modes_set_start\syst_modes_set_quit}
-%
-% \aliased\let\stopmodeset\relax
-%
-% \def\syst_modes_set_start[#1]%
-% {\edef\m_mode_case{#1}%
-% \unless\ifx\m_mode_case\s!default
-% \expandafter\syst_modes_set_check
-% \orelse\ifconditional\c_syst_modes_set_done
-% \expandafter\syst_modes_set_quit
-% \else
-% \expandafter\syst_modes_set_yes
-% \fi}
-%
-% \def\syst_modes_set_check
-% {\syst_modes_check_lr\syst_modes_set_yes\syst_modes_set_nop\m_mode_case}
-%
-% \def\syst_modes_set_yes#1%
-% {\settrue\c_syst_modes_set_done
-% #1%
-% \doifelsenextoptionalcs\syst_modes_set_start\syst_modes_set_quit}
-%
-% \def\syst_modes_set_nop#1%
-% {\doifelsenextoptionalcs\syst_modes_set_start\syst_modes_set_quit}
-%
-% \def\syst_modes_set_quit#-\stopmodeset
-% {\pop_macro_c_syst_modes_set_done}
-
\permanent\protected\def\startmodeset
{\push_macro_c_syst_modes_set_done
\setfalse\c_syst_modes_set_done
\syst_modes_set_start}
-\aliased\let\stopmodeset\relax
+\permanent\protected\lettonothing\stopmodeset
\tolerant\def\syst_modes_set_start#.[#1]% skip spaces and pars
{\edef\m_mode_case{#1}%
@@ -372,9 +341,10 @@
\def\syst_modes_set_quit#-\stopmodeset
{\pop_macro_c_syst_modes_set_done}
-%D Lets now set a mode:
+%D Lets now set a few modes:
-\enablemode[mkiv] \newsystemmode{mkiv} \setsystemmode{mkiv}
+\enablemode[mkiv] \newsystemmode{mkiv} \setsystemmode{mkiv} % also mkxl
+\enablemode[lmtx] \newsystemmode{lmtx} \setsystemmode{lmtx}
%D Setups:
@@ -393,7 +363,7 @@
\permanent\protected\tolerant\def\setups[#1]#;#2{\processcommacommand[#1#2]\syst_setups} % {..} or [..]
\permanent\protected\tolerant\def\setup [#1]#;#2{\syst_setups{#1#2}} % {..} or [..]
-\letvalue{\??setup:\??empty}\gobbleoneargument
+\letcsname\??setup:\??empty\endcsname\gobbleoneargument
\permanent\def\syst_setups#1% the grid option will be extended to other main modes
{\csname\??setup
@@ -410,10 +380,10 @@
\permanent\def\fastsetupwithargument #1{\csname\??setup:#1\endcsname} % swapped per 2015-08-30
\permanent\def\fastsetupwithargumentswapped#1#2{\csname\??setup:#2\endcsname{#1}}% swapped per 2015-09-05
-% the next one is meant for \c!setups situations, hence the check for
-% a shortcut
+%D The next one is meant for \c!setups situations, hence the check for a
+%D shortcut.
-\let\m_syst_setups_asked\empty
+\lettonothing\m_syst_setups_asked
\permanent\protected\def\doprocesslocalsetups#1% sort of public, fast local variant
{\edef\m_syst_setups_asked{#1}%
@@ -438,11 +408,20 @@
\permanent\def\autosetups#1{\clf_autosetups{#1}} % todo: public implementor
-\permanent\edef\setupwithargument#1% saves a few expansions
- {\noexpand\csname\??setup:\noexpand\ifcsname\??setup:#1\endcsname#1\noexpand\else\??empty\noexpand\fi\endcsname}
+%% \permanent\edef\setupwithargument#1% saves a few expansions and is faster
+%% {\noexpand\csname\??setup:\noexpand\ifcsname\??setup:#1\endcsname#1\noexpand\else\??empty\noexpand\fi\endcsname}
+%%
+%% \permanent\edef\setupwithargumentswapped#1#2% saves a few expansions (can be \let)
+%% {\noexpand\csname\??setup:\noexpand\ifcsname\??setup:#2\endcsname#2\noexpand\else\??empty\noexpand\fi\endcsname{#1}}
+
+%D We can gain a bit more but as usual it's not noticeable at all in production runs. We use
+%D this one a lot in the \XML\ code.
+
+% \permanent\def\setupwithargument #1{\futurecsname\gobbleoneargument\??setup:#1\endcsname}
+% \permanent\def\setupwithargumentswapped #1#2{\futurecsname\gobbleoneargument\??setup:#2\endcsname{#1}}
-\permanent\edef\setupwithargumentswapped#1#2% saves a few expansions (can be \let)
- {\noexpand\csname\??setup:\noexpand\ifcsname\??setup:#2\endcsname#2\noexpand\else\??empty\noexpand\fi\endcsname{#1}}
+\permanent\edef\setupwithargument #1{\noexpand\futurecsname\noexpand\gobbleoneargument\??setup:#1\endcsname}
+\permanent\edef\setupwithargumentswapped#1#2{\noexpand\futurecsname\noexpand\gobbleoneargument\??setup:#2\endcsname{#1}}
\aliased\let\directsetup\syst_setups
\aliased\let\texsetup \syst_setups % nicer than \directsetup and more en par with xmlsetup and luasetup
@@ -538,17 +517,16 @@
\to \t_syst_setups_xml
\newtoks\t_syst_setups_lua \appendtoks
- \obeylualines
\obeyluatokens
\to \t_syst_setups_lua
% Is doglobal still relevant? Maybe always global? Or never? Anyway, it will become obsolete.
-\permanent\protected\def\startluasetups {\begingroup\doifelsenextoptionalcs\syst_setups_start_lua_yes\syst_setups_start_lua_nop} \aliased\let\stopluasetups \relax
-\permanent\protected\def\startxmlsetups {\begingroup\doifelsenextoptionalcs\syst_setups_start_xml_yes\syst_setups_start_xml_nop} \aliased\let\stopxmlsetups \relax
-\permanent\protected\def\startrawsetups {\begingroup\doifelsenextoptionalcs\syst_setups_start_raw_yes\syst_setups_start_raw_nop} \aliased\let\stoprawsetups \relax
-\permanent\protected\def\startlocalsetups{\begingroup\doifelsenextoptionalcs\syst_setups_start_loc_yes\syst_setups_start_loc_nop} \aliased\let\stoplocalsetups\relax
-\permanent\protected\def\startsetups {\begingroup\doifelsenextoptionalcs\syst_setups_start_tex_yes\syst_setups_start_tex_nop} \aliased\let\stopsetups \relax
+\permanent\protected\def\startluasetups {\begingroup\doifelsenextoptionalcs\syst_setups_start_lua_yes\syst_setups_start_lua_nop} \permanent\protected\lettonothing\stopluasetups
+\permanent\protected\def\startxmlsetups {\begingroup\doifelsenextoptionalcs\syst_setups_start_xml_yes\syst_setups_start_xml_nop} \permanent\protected\lettonothing\stopxmlsetups
+\permanent\protected\def\startrawsetups {\begingroup\doifelsenextoptionalcs\syst_setups_start_raw_yes\syst_setups_start_raw_nop} \permanent\protected\lettonothing\stoprawsetups
+\permanent\protected\def\startlocalsetups{\begingroup\doifelsenextoptionalcs\syst_setups_start_loc_yes\syst_setups_start_loc_nop} \permanent\protected\lettonothing\stoplocalsetups
+\permanent\protected\def\startsetups {\begingroup\doifelsenextoptionalcs\syst_setups_start_tex_yes\syst_setups_start_tex_nop} \permanent\protected\lettonothing\stopsetups
\def\syst_setups_start_lua_two#1#2#+\stopluasetups {\endgroup\dodoglobal\instance\defcsname\??setup#1:#2\endcsname##1{#3}}
\def\syst_setups_start_xml_two#1#2#+\stopxmlsetups {\endgroup\dodoglobal\instance\defcsname\??setup#1:#2\endcsname##1{#3}}
@@ -611,11 +589,11 @@
\permanent\def\systemsetups#1{\syst_setups{\systemsetupsprefix#1}}
-\permanent\protected\def\resetsetups[#1]% see x-fo for usage
- {\ifcsname\??setup\ifgridsnapping\v!grid\fi:#1\endcsname
- \dodoglobal\undefinevalue{\??setup\ifgridsnapping\v!grid\fi:#1}%
+\permanent\tolerant\protected\def\resetsetups[#1]#;#2%
+ {\ifcsname\??setup\ifgridsnapping\v!grid\fi:#1#2\endcsname
+ \dodoglobal\undefinevalue{\??setup\ifgridsnapping\v!grid\fi:#1#2}%
\else
- \dodoglobal\undefinevalue{\??setup:#1}%
+ \dodoglobal\undefinevalue{\??setup:#1#2}%
\fi}
\permanent\tolerant\protected\def\copysetups[#1]#*[#2]%
@@ -645,7 +623,7 @@
\permanent\protected\def\setgvariables{\syst_variables_set[\getrawgparameters]}
\permanent\protected\def\setxvariables{\syst_variables_set[\getrawxparameters]}
-\mutable\let\currentvariableclass\empty
+\mutable\lettonothing\currentvariableclass
\tolerant\def\syst_variables_set[#1]#*[#2]#*[#3]% tricky, test on s-pre-60
{\doifelse{#2}\currentvariableclass
@@ -665,14 +643,12 @@
\permanent \def\getvariable #1#2{\begincsname\??variables#1:#2\endcsname}
\permanent\protected\def\showvariable#1#2{\showvalue{\begincsname\??variables#1:#2\endcsname}}
-\let\currentvariableclass\empty
-
%D \macros
%D {checkvariables}
%D
%D I'll probably forget that this on exists.
-\let\m_syst_variables_temp\empty
+\lettonothing\m_syst_variables_temp
\permanent\tolerant\def\checkvariables[#1]#*[#2]%
{\dogetparameters\syst_variables_check_value[#1][#2]}
@@ -718,7 +694,7 @@
%D A few more (we could use a public test variable so that we only need to expand
%D once, assuming expandable variables):
-\letvalue{\??variables:}\empty
+\letcsname\??variables:\endcsname\empty
\permanent\protected\def\doifelseemptyvariable#1#2%
{\edef\m_syst_string_one{\begincsname\??variables#1:#2\endcsname}%
@@ -787,13 +763,6 @@
\permanent\tolerant\protected\def\defineselector[#1]#*[#2]{\getparameters[\??selector#1][\c!max=\plusone,\c!n=\plusone,#2]}
\permanent\tolerant\protected\def\setupselector [#1]#*[#2]{\getparameters[\??selector#1][#2]}
-% \def\directselect#1% expandable
-% {\filterfromnext % maybe add an \expanded
-% {\csname\??selector\ifcsname\??selector#1\c!max\endcsname#1\fi\c!max\endcsname}%
-% {\csname\??selector\ifcsname\??selector#1\c!n \endcsname#1\fi\c!n \endcsname}}
-%
-% this is more efficient when the arguments are used a few times (or passed along):
-
\permanent\def\directselect#1% expandable
{\expandafter\filterfromnext
\csname\??selector\ifcsname\??selector#1\c!max\endcsname#1\fi\c!max\expandafter\endcsname
diff --git a/Master/texmf-dist/tex/context/base/mkxl/core-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/core-ini.mkxl
index de7c645b425..a0fd8af1068 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/core-ini.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/core-ini.mkxl
@@ -75,7 +75,8 @@
\to \everysimplifycommands
\appendtoks
- \everypar\emptytoks % pretty important
+ \everypar \emptytoks % pretty important
+ \everybeforepar\emptytoks % pretty important
\to \everyforgetall
%D Page building:
@@ -175,8 +176,8 @@
\newconstant\pageduplexmode % 0 single 1 double 2 mix
\newconstant\pagebodymode % 0 not 1 normal pagebody 2 spread
-\newcount\nofcolumns \nofcolumns \plusone
-\newcount\nofmulticolumns \nofmulticolumns\plusone
+\newinteger\nofcolumns \nofcolumns \plusone
+\newinteger\nofmulticolumns \nofmulticolumns\plusone
%D \macros
%D {ifproductionrun}
@@ -219,6 +220,7 @@
\let\setlayoutcomponentattribute \gobbleoneargument
\let\resetlayoutcomponentattribute\relax
-\let\layoutcomponentboxattribute \empty
+
+\lettonothing\layoutcomponentboxattribute
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/core-sys.lmt b/Master/texmf-dist/tex/context/base/mkxl/core-sys.lmt
index 0d471133d3f..8615e9f05a7 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/core-sys.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/core-sys.lmt
@@ -19,23 +19,32 @@ function environment.initializefilenames()
local arguments = environment.arguments
- local jobname = arguments.jobname or tex.jobname
- local fulljobname = arguments.fulljobname or jobname
- local inputfilename = arguments.input or fulljobname
- local outputfilename = arguments.result or removesuffix(jobname)
+ local jobname = arguments.jobname
+ local fulljobname = arguments.fulljobname
+ local inputfilename = arguments.input
+
+ if not fulljobname then
+ fulljobname = inputfilename or tex.jobname
+ end
+ if not inputfilename then
+ inputfilename = fulljobname
+ end
+ if not jobname then
+ jobname = removesuffix(fulljobname)
+ end
- local inputfilename = suffixonly(inputfilename) == "tex" and removesuffix(inputfilename) or inputfilename or ""
+ local inputfilebase = basename(inputfilename)
+ local outputfilename = arguments.result or removesuffix(fulljobname)
+
+-- local inputfilename = suffixonly(inputfilename) == "tex" and removesuffix(inputfilename) or inputfilename or ""
local filename = fulljobname
local suffix = suffixonly(filename)
local filename = ctxrunner.resolve(filename) -- in case we're prepped
- local jobfilename = jobname or inputfilename or tex.jobname or ""
- local inputfilename = inputfilename or ""
-
+ local jobfilename = jobname -- alias
local jobfilebase = basename(jobfilename)
- local inputfilebase = basename(inputfilename)
-- jobfilename = gsub(jobfilename, "^./","")
-- inputfilename = gsub(inputfilename,"^./","")
diff --git a/Master/texmf-dist/tex/context/base/mkxl/core-sys.mkxl b/Master/texmf-dist/tex/context/base/mkxl/core-sys.mkxl
index c5093588eb4..393d85d771f 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/core-sys.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/core-sys.mkxl
@@ -90,7 +90,7 @@
\permanent\protected\def\setjobfullname#1% #1 = default if not given
{\doifelsenothing\jobfilename
- {\let\jobfullname\empty}
+ {\lettonothing\jobfullname}
{\doif\jobfilesuffix\c!tex{\edef\jobfullname{\jobfilename.#1}}}}
%D There are a couple of system states avaiable:
@@ -129,9 +129,9 @@
\scratchcounter\normaltime
\processaction
[#1]
- [ \v!small=>\divide\scratchcounter 15, % 900,
- \v!medium=>\divide\scratchcounter 30, % 1800,
- \v!big=>\divide\scratchcounter 60, % 3600,
+ [ \v!small=>\divideby\scratchcounter 15, % 900,
+ \v!medium=>\divideby\scratchcounter 30, % 1800,
+ \v!big=>\divideby\scratchcounter 60, % 3600,
\v!normal=>\scratchcounter\newrandomseed,
\s!default=>\scratchcounter\newrandomseed,
\s!unknown=>\scratchcounter#1]%
@@ -233,16 +233,32 @@
%
% \ignorestartstop[bagger]
+%D When looking at an application of \type {\beginsimplegroup} and \type I wondered
+%D about this one but it doesn't make much sense. One hould define highlights that
+%D have style and color, but on the other hand, we might want to combine a font
+%D style and some other treatment. The overhead of commalists (where we can use
+%D {\aftergrouped} for collecting stop tags) is neglectable but it makes no sense.
+%D Maybe we need a \type {command} or better (as commands can take arguments) a
+%D \type {setups} key, but no one ever asked so \unknown.
+
+% \processnextcommalist\typo_highlights_step ...
+%
+% list : 10K single: 0.111 / 0.132 with command / 0.134 with setups
+% single: 10K single: 0.075 / 0.098 with command / 0.099 with setups
+
\installcorenamespace{highlight}
\installcommandhandler \??highlight {highlight} \??highlight % we could do with less
\setuphighlight
[\c!define=\v!yes]
+% \c!command=,
+% \c!setups=]
\appendtoks
\ifcstok{\highlightparameter\c!define}\v!yes
- \frozen\instance\setuevalue\currenthighlight{\typo_highlights_indeed{\currenthighlight}}%
+ \frozen\instance\protected\edefcsname\currenthighlight\endcsname
+ {\typo_highlights_indeed{\currenthighlight}}%
\fi
\to \everydefinehighlight
@@ -253,6 +269,8 @@
{\def\currenthighlight{#1}%
\dostarttagged\t!highlight\currenthighlight
\usehighlightstyleandcolor\c!style\c!color
+ % \usehighlightstyleandcolor\c!style\c!color
+ % \highlightparameter\c!command
\dotaghighlight}
{\dostoptagged}}
@@ -264,6 +282,8 @@
\def\currenthighlight{#1}%
\dostarttagged\t!highlight\currenthighlight
\usehighlightstyleandcolor\c!style\c!color
+ % \usehighlightstyleandcolor\c!style\c!color
+ % \highlightparameter\c!command
\dotaghighlight}
\permanent\protected\def\stophighlight
@@ -272,13 +292,19 @@
\aliased\let\directhighlight\typo_highlights_indeed
+%D Defining commands (rather old):
+
\permanent\protected\def\defineexpandable
- {\doifelsenextoptional
+ {\integerdef\c_syst_parameter_catcode\catcode\hashasciicode
+ \catcode\hashasciicode\parametercatcode%
+ \doifelsenextoptional
{\syst_basics_define_yes\def}%
{\syst_basics_define_nop\def}}
\permanent\protected\def\define
- {\doifelsenextoptional
+ {\integerdef\c_syst_parameter_catcode\catcode\hashasciicode
+ \catcode\hashasciicode\parametercatcode%
+ \doifelsenextoptional
{\syst_basics_define_yes{\protected\def}}%
{\syst_basics_define_nop{\protected\def}}}
@@ -297,13 +323,15 @@
#1#3##1##2##3##4##5##6##7{#4}\or
#1#3##1##2##3##4##5##6##7##8{#4}\or
#1#3##1##2##3##4##5##6##7##8##9{#4}\else
- #1#3{#4}\fi}
+ #1#3{#4}\fi
+ \catcode\hashasciicode\c_syst_parameter_catcode}
\protected\def\syst_basics_define_nop#1#2#3%
{\ifdefined#2%
\showmessage\m!system4{\string#2}%
\fi
- #1#2{#3}}
+ #1#2{#3}%
+ \catcode\hashasciicode\c_syst_parameter_catcode}
\aliased\let\redefine\define
diff --git a/Master/texmf-dist/tex/context/base/mkxl/core-two.mkxl b/Master/texmf-dist/tex/context/base/mkxl/core-two.mkxl
index cadd9d05907..38f03c7c45b 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/core-two.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/core-two.mkxl
@@ -82,8 +82,9 @@
\setfalse\twopassdatafound
-\mutable\let\twopassdata \empty
-\mutable\let\twopassdatalist\empty
+\mutable\lettonothing\twopassdata
+\mutable\lettonothing\twopassdatalist
+
\mutable\let\noftwopassitems\!!zeropoint
\def\syst_twopass_check % can be delegated to lua once obsolete is gone
diff --git a/Master/texmf-dist/tex/context/base/mkxl/core-uti.lua b/Master/texmf-dist/tex/context/base/mkxl/core-uti.lmt
index 887ef9a7536..48737d7f62f 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/core-uti.lua
+++ b/Master/texmf-dist/tex/context/base/mkxl/core-uti.lmt
@@ -18,8 +18,8 @@ saves much runtime but at the cost of more memory usage.</p>
--ldx]]--
local math = math
+local next, type, tostring, tonumber, setmetatable, load = next, type, tostring, tonumber, setmetatable, load
local format, match = string.format, string.match
-local next, type, tostring, tonumber = next, type, tostring, tonumber
local concat = table.concat
local definetable = utilities.tables.definetable
@@ -43,7 +43,7 @@ local report_passes = logs.reporter("job","passes")
job = job or { }
local job = job
-job.version = 1.32
+job.version = 1.33
job.packversion = 1.02
-- some day we will implement loading of other jobs and then we need
@@ -209,6 +209,67 @@ local skiplist = {
"positions",
}
+-- I'm not that impressed by the savings. It's some 5 percent on the luametatex
+-- manual and probably some more on the m4 files (if so I might enable it).
+
+local deltapacking = false
+-- local deltapacking = true
+
+local function packnumberdata(tobesaved)
+ if deltapacking and tobesaved[1] then
+ local last
+ local current
+ for i=1,#tobesaved do
+ current = tobesaved[i]
+ if last then
+ if last.numbers and last.block then
+ for k, v in next, last do
+ if k ~= "numbers" and v ~= current[k] then
+ goto DIFFERENT
+ end
+ end
+ for k, v in next, current do
+ if k ~= "numbers" and v ~= last[k] then
+ goto DIFFERENT
+ end
+ end
+ tobesaved[i] = {
+ numbers = current.numbers,
+ }
+ goto CONTINUE
+ else
+ current = nil
+ end
+ end
+ ::DIFFERENT::
+ last = current
+ ::CONTINUE::
+ end
+ end
+end
+
+local function unpacknumberdata(collected)
+ if deltapacking and collected[1] then
+ local key = "numbers"
+ local last = collected[1]
+ local meta = false
+ for i=2,#collected do
+ local c = collected[i]
+ if c.block then
+ last = c
+ meta = false
+ elseif c.numbers then
+ if not meta then
+ meta = { __index = last }
+ end
+ setmetatable(c, meta)
+ end
+ end
+ end
+end
+
+-- -- --
+
-- not ok as we can have arbitrary keys in userdata and dataset so some day we
-- might need a bit more granularity, like skippers
@@ -219,16 +280,17 @@ job.pack = true
directives.register("job.pack",function(v) job.pack = v end)
-local _save_, _load_, _others_ = { }, { }, { } -- registers timing
+local savedfiles = { }
+local loadedfiles = { } -- for now only timers
+local otherfiles = { } -- for now only timers
function job.save(filename) -- we could return a table but it can get pretty large
- statistics.starttiming(_save_)
+ statistics.starttiming(savedfiles)
local f = io.open(filename,'w')
if f then
f:write("local utilitydata = { }\n\n")
f:write(serialize(comment,"utilitydata.comment",true),"\n\n")
for l=1,#savelist do
- -- f:write("do\n\n") -- no solution for the jit limitatione either
local list = savelist[l]
local target = format("utilitydata.%s",list[1])
local data = list[2]
@@ -249,23 +311,20 @@ function job.save(filename) -- we could return a table but it can get pretty lar
else
f:write(definer,"\n\n",serialize(data,name,true),"\n\n")
end
- -- f:write("end\n\n")
end
if job.pack then
packers.strip(jobpacker)
- -- f:write("do\n\n")
+ packnumberdata(jobpacker.index)
f:write(serialize(jobpacker,"utilitydata.job.packed",true),"\n\n")
- -- f:write("end\n\n")
end
f:write("return utilitydata")
f:close()
end
- statistics.stoptiming(_save_)
+ statistics.stoptiming(savedfiles)
end
local function load(filename)
if lfs.isfile(filename) then
-
local function dofile(filename)
local result = loadstring(io.loaddata(filename))
if result then
@@ -274,7 +333,6 @@ local function load(filename)
return nil
end
end
-
local okay, data = pcall(dofile,filename)
if okay and type(data) == "table" then
local jobversion = job.version
@@ -286,124 +344,135 @@ local function load(filename)
return data
end
else
- os.remove(filename) -- probably a bad file (or luajit overflow as it cannot handle large tables well)
- report_passes("removing stale job data file %a, restart job, message: %s%s",filename,tostring(data),
- jit and " (try luatex instead of luajittex)" or "")
+ os.remove(filename)
+ report_passes("removing stale job data file %a, restart job, message: %s",filename,tostring(data))
os.exit(true) -- trigger second run
end
end
end
function job.load(filename)
- statistics.starttiming(_load_)
+ statistics.starttiming(loadedfiles)
local utilitydata = load(filename)
if utilitydata then
local jobpacker = utilitydata.job.packed
- local handlers = { }
+ unpacknumberdata(jobpacker.index)
for i=1,#savelist do
- local list = savelist[i]
- local target = list[1]
- local initializer = list[3]
- local result = accesstable(target,utilitydata)
+ local list = savelist[i]
+ local target = list[1]
+ local result = accesstable(target,utilitydata)
if result then
local done = packers.unpack(result,jobpacker,true)
if done then
migratetable(target,mark(result))
- if type(initializer) == "function" then
- handlers[#handlers+1] = { initializer, result }
- end
else
report_passes("pack version mismatch")
end
end
end
- -- so we have all tables available (unpacked)
- for i=1,#handlers do
- local handler = handlers[i]
- handler[1](handler[2])
+ end
+ for i=1,#savelist do
+ local list = savelist[i]
+ local initializer = list[3]
+ if type(initializer) == "function" then
+ initializer(utilitydata and accesstable(list[1],utilitydata) or nil)
end
end
- statistics.stoptiming(_load_)
+ statistics.stoptiming(loadedfiles)
end
-function job.loadother(filename)
- statistics.starttiming(_load_)
- _others_[#_others_+1] = file.nameonly(filename)
- local utilitydata = load(filename)
- if utilitydata then
- local jobpacker = utilitydata.job.packed
- local unpacked = { }
- for l=1,#savelist do
- local list = savelist[l]
- local target = list[1]
- local result = accesstable(target,utilitydata)
- local done = packers.unpack(result,jobpacker,true)
- if done then
- migratetable(target,result,unpacked)
+local othercache = { }
+
+function job.loadother(filename,cache)
+ local unpacked = false
+ statistics.starttiming(loadedfiles)
+ filename = file.addsuffix(filename,"tuc")
+ if cache then
+ unpacked = othercache[filename]
+ end
+ if not unpacked then
+ -- so we can register the same name twice(in loading order)
+ otherfiles[#otherfiles+1] = file.nameonly(filename)
+ local utilitydata = load(filename)
+ if utilitydata then
+ local jobpacker = utilitydata.job.packed
+ unpacknumberdata(jobpacker.index)
+ unpacked = { }
+ for l=1,#savelist do
+ local list = savelist[l]
+ local target = list[1]
+ local result = accesstable(target,utilitydata)
+ local done = packers.unpack(result,jobpacker,true)
+ if done then
+ migratetable(target,result,unpacked)
+ end
+ end
+ unpacked.job.packed = nil -- nicer in inspecting
+ if cache then
+ othercache[filename] = unpacked
+ end
+ --
+ local lists = utilitydata.structures.lists.collected or { }
+ local sections = utilitydata.structures.sections.collected or { }
+ local pages = utilitydata.structures.pages .collected or { }
+ for i=1,#lists do
+ local entry = lists[i]
+ local references = entry.references
+ if references then
+ local section = references.section
+ local realpage = references.realpage
+ -- maybe entry.* instead:
+ references.sectiondata = section and sections[section]
+ references.pagedata = realpage and pages[realpage]
+ -- get rid of these, maybe even crash as these are bogus
+ -- references.internal = nil
+ -- references.realpage = nil
+ -- references.section = nil
+ references.x = nil
+ references.y = nil
+ end
end
+ --
+ -- also do the references here
+ --
+ structures.references.registerfromlist(lists,derived,pages,sections)
end
- unpacked.job.packed = nil -- nicer in inspecting
- return unpacked
end
- statistics.stoptiming(_load_)
+ statistics.stoptiming(loadedfiles)
+ return unpacked
end
--- function job.keep(filename)
--- local suffix = file.suffix(filename)
--- local base = file.removesuffix(filename)
--- if suffix == "" then
--- suffix = "tuc"
--- end
--- for i=1,10 do
--- local tmpname = format("%s-%s-%02d.tmp",base,suffix,i)
--- if lfs.isfile(tmpname) then
--- os.remove(tmpname)
--- report_passes("removing %a",tmpname)
--- end
--- end
--- if lfs.isfile(filename) then
--- local tmpname = format("%s-%s-%02d.tmp",base,suffix,environment.currentrun or 1)
--- report_passes("copying %a into %a",filename,tmpname)
--- file.copy(filename,tmpname)
--- else
--- report_passes("no file %a, nothing kept",filename)
--- end
--- end
-
--- eventually this will end up in strc-ini
-
statistics.register("startup time", function()
return statistics.elapsedseconds(statistics,"including runtime option file processing")
end)
statistics.register("jobdata time",function()
if enabled then
- if #_others_ > 0 then
- return format("%s seconds saving, %s seconds loading, other files: %s",statistics.elapsedtime(_save_),statistics.elapsedtime(_load_),concat(_others_," "))
+ if #otherfiles > 0 then
+ return format("%s seconds saving, %s seconds loading, other files: %s",statistics.elapsedtime(savedfiles),statistics.elapsedtime(loadedfiles),concat(otherfiles," "))
else
- return format("%s seconds saving, %s seconds loading",statistics.elapsedtime(_save_),statistics.elapsedtime(_load_))
+ return format("%s seconds saving, %s seconds loading",statistics.elapsedtime(savedfiles),statistics.elapsedtime(loadedfiles))
end
else
- if #_others_ > 0 then
- return format("nothing saved, %s seconds loading, other files: %s",statistics.elapsedtime(_load_),concat(_others_," "))
+ if #otherfiles > 0 then
+ return format("nothing saved, %s seconds loading, other files: %s",statistics.elapsedtime(loadedfiles),concat(otherfiles," "))
else
- return format("nothing saved, %s seconds loading",statistics.elapsedtime(_load_))
+ return format("nothing saved, %s seconds loading",statistics.elapsedtime(loadedfiles))
end
end
end)
statistics.register("callbacks", function()
- local c_internal = status.callbacks or 0
- local c_file = status.indirect_callbacks or 0
- local c_direct = status.direct_callbacks or 0
- local c_late = backends.getcallbackstate().count
- local c_function = status.function_callbacks or 0
- local c_total = c_internal + c_file + c_direct + c_late + c_function
- local n_pages = structures.pages.nofpages or 0
- local c_average = n_pages > 0 and math.round(c_total/n_pages) or 0
- local result = format (
- "internal: %s, file: %s, direct: %s, late: %s, function %s, total: %s (%s per page)",
- c_internal, c_file, c_direct, c_late, c_function, c_total, c_average
+ local backend = backends.getcallbackstate()
+ local frontend = status.getcallbackstate()
+ local pages = structures.pages.nofpages or 0
+ local total = frontend.count + backend.count
+ local average = pages > 0 and math.round(total/pages) or 0
+ local result = format (
+ "file: %s, saved: %s, direct: %s, function: %s, value: %s, message: %s, bytecode: %s, late %s, total: %s (%s per page)",
+ frontend.file, frontend.saved, frontend.direct, frontend["function"],
+ frontend.value, frontend.message, frontend.bytecode, backend.count,
+ total, average
)
statistics.callbacks = function()
return result
@@ -417,20 +486,11 @@ statistics.register("randomizer", function()
end
end)
--- a sort of joke (for ctx meeting)
-
--- local kg_per_watt_per_second = 1 / 15000000
--- local watts_per_core = 50
--- local speedup_by_other_engine = 1.2
--- local used_wood_factor = watts_per_core * kg_per_watt_per_second / speedup_by_other_engine
--- local used_wood_factor = (50 / 15000000) / 1.2
-
-
function statistics.formatruntime(runtime)
if not environment.initex then -- else error when testing as not counters yet
-- stoptiming(statistics) -- to be sure
- local shipped = texgetcount('nofshipouts')
- local pages = texgetcount('realpageno')
+ local shipped = texgetcount("nofshipouts")
+ local pages = texgetcount("realpageno")
if pages > shipped then
pages = shipped
end
@@ -448,9 +508,10 @@ function statistics.formatruntime(runtime)
end
implement {
- name = "savevariable",
+ name = "savecurrentvalue",
+ public = true,
actions = job.variables.save,
- arguments = "2 strings",
+ arguments = { "csname", "argument" },
}
implement {
diff --git a/Master/texmf-dist/tex/context/base/mkxl/data-fil.lmt b/Master/texmf-dist/tex/context/base/mkxl/data-fil.lmt
new file mode 100644
index 00000000000..bbcc954b2ea
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/data-fil.lmt
@@ -0,0 +1,144 @@
+if not modules then modules = { } end modules ['data-fil'] = {
+ version = 1.001,
+ comment = "companion to luat-lib.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local ioopen = io.open
+local isdir = lfs.isdir
+
+local trace_locating = false trackers.register("resolvers.locating", function(v) trace_locating = v end)
+
+local report_files = logs.reporter("resolvers","files")
+
+local resolvers = resolvers
+local resolveprefix = resolvers.resolve
+local findfile = resolvers.findfile
+local scanfiles = resolvers.scanfiles
+local registerfilehash = resolvers.registerfilehash
+local appendhash = resolvers.appendhash
+
+local loadcachecontent = caches.loadcontent
+
+local checkgarbage = utilities.garbagecollector and utilities.garbagecollector.check
+
+function resolvers.locators.file(specification)
+ local filename = specification.filename
+ local realname = resolveprefix(filename) -- no shortcut
+ if realname and realname ~= '' and isdir(realname) then
+ if trace_locating then
+ report_files("file locator %a found as %a",filename,realname)
+ end
+ appendhash('file',filename,true) -- cache
+ elseif trace_locating then
+ report_files("file locator %a not found",filename)
+ end
+end
+
+function resolvers.hashers.file(specification)
+ local pathname = specification.filename
+ local content = loadcachecontent(pathname,'files')
+ registerfilehash(pathname,content,content==nil)
+end
+
+function resolvers.generators.file(specification)
+ local pathname = specification.filename
+ local content = scanfiles(pathname,false,true) -- scan once
+ registerfilehash(pathname,content,true)
+end
+
+resolvers.concatinators.file = file.join
+
+local finders = resolvers.finders
+local notfound = finders.notfound
+
+function finders.file(specification,filetype)
+ local filename = specification.filename
+ local foundname = findfile(filename,filetype)
+ if foundname and foundname ~= "" then
+ if trace_locating then
+ report_files("file finder: %a found",filename)
+ end
+ return foundname
+ else
+ if trace_locating then
+ report_files("file finder: %a not found",filename)
+ end
+ return notfound()
+ end
+end
+
+-- The default textopener will be overloaded later on.
+
+local openers = resolvers.openers
+local notfound = openers.notfound
+local overloaded = false
+
+local function textopener(tag,filename,f)
+ return {
+ reader = function() return f:read () end,
+ close = function() return f:close() end,
+ }
+end
+
+function openers.helpers.textopener(...)
+ return textopener(...)
+end
+
+function openers.helpers.settextopener(opener)
+ if overloaded then
+ report_files("file opener: %s overloaded","already")
+ else
+ if trace_locating then
+ report_files("file opener: %s overloaded","once")
+ end
+ overloaded = true
+ textopener = opener
+ end
+end
+
+function openers.file(specification,filetype)
+ local filename = specification.filename
+ if filename and filename ~= "" then
+ local f = ioopen(filename,"r")
+ if f then
+ if trace_locating then
+ report_files("file opener: %a opened",filename)
+ end
+ return textopener("file",filename,f)
+ end
+ end
+ if trace_locating then
+ report_files("file opener: %a not found",filename)
+ end
+ return notfound()
+end
+
+local loaders = resolvers.loaders
+local notfound = loaders.notfound
+
+function loaders.file(specification,filetype)
+ local filename = specification.filename
+ if filename and filename ~= "" then
+ local f = ioopen(filename,"rb")
+ if f then
+ if trace_locating then
+ report_files("file loader: %a loaded",filename)
+ end
+ local s = f:read("*a") -- io.readall(f) is faster but we never have large files here
+ if checkgarbage then
+ checkgarbage(#s)
+ end
+ f:close()
+ if s then
+ return true, s, #s
+ end
+ end
+ end
+ if trace_locating then
+ report_files("file loader: %a not found",filename)
+ end
+ return notfound()
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/data-hsh.lmt b/Master/texmf-dist/tex/context/base/mkxl/data-hsh.lmt
new file mode 100644
index 00000000000..0a2d94f8190
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/data-hsh.lmt
@@ -0,0 +1,382 @@
+-- only lmt because the backend code doesn't deal with it and it makes
+-- no sense to waste time on that for mkiv
+
+if not modules then modules = { } end modules ['data-hsh'] = {
+ version = 0.002,
+ comment = "companion to luat-lib.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- todo: options
+--
+-- lowercase
+-- cleanupnames (normalize)
+-- use database from project tree
+
+local type = type
+local gsub = string.gsub
+local addsuffix, basename, pathpart, filesuffix, filesize = file.addsuffix, file.basename, file.pathpart, file.suffix, file.size
+local loadtable, savetable = table.load, table.save
+local loaddata, savedata, open = io.loaddata, io.savedata, io.open
+
+local trace_hashed = false
+local report_hashed = logs.reporter("resolvers","hashed")
+
+trackers.register("resolvers.locating", function(v) trace_hashed = v end)
+trackers.register("resolvers.hashed", function(v) trace_hashed = v end)
+
+-- we can have a virtual file: open at the position, make sure read and seek don't
+-- go beyond the boundaries
+
+local resolvers = resolvers
+local finders = resolvers.finders
+local openers = resolvers.openers
+local loaders = resolvers.loaders
+
+local ordered = { }
+local hashed = { }
+local version = 0.002
+
+-- local lowercase = characters.lower
+
+local function showstatus(database,metadata)
+ report_hashed("database %a, %i paths, %i names, %i unique blobs, %i compressed blobs",
+ database, metadata.nofpaths, metadata.nofnames, metadata.nofblobs, metadata.nofcompressed
+ )
+end
+
+local function validhashed(database)
+ local found = hashed[database]
+ if found then
+ return found
+ else
+ local metaname = addsuffix(database,"lua")
+ local dataname = addsuffix(database,"dat")
+ local metadata = loadtable(metaname)
+ if type(metadata) ~= "table" then
+ report_hashed("invalid database %a",metaname)
+ elseif metadata.version ~= version then
+ report_hashed("version mismatch in database %a",metaname)
+ elseif not lfs.isfile(dataname) then
+ report_hashed("missing data data file for %a",metaname)
+ else
+ return {
+ database = database,
+ metadata = metadata,
+ dataname = dataname,
+ }
+ end
+ end
+end
+
+local function registerhashed(database)
+ if not hashed[database] then
+ local valid = validhashed(database)
+ if valid then
+ ordered[#ordered + 1] = valid
+ hashed[database] = ordered[#ordered]
+ showstatus(database,valid.metadata)
+ end
+ end
+end
+
+local registerfilescheme do
+
+ local findfile = finders.file
+
+ local list = { }
+ local done = { }
+ local hash = { }
+
+ registerfilescheme = function(name)
+ if not done[name] then
+ list[#list+1] = name
+ done[name] = true
+ end
+ end
+
+ -- why does the finder not remember ?
+
+ function finders.file(specification,filetype)
+ if type(specification) == "table" then
+ local original = specification.original
+ -- print(original)
+ if original then
+ local found = hash[original]
+ if found == nil then
+ for i=1,#list do
+ local scheme = list[i]
+ local found = finders[scheme](specification,filetype)
+ if found then
+ hash[original] = found
+ if trace_hashed then
+ report_hashed("found by auto scheme %s: %s",scheme,found)
+ end
+ return found
+ end
+ end
+ local found = findfile(specification,filetype)
+ if found then
+ hash[original] = found
+ if trace_hashed then
+ report_hashed("found by normal file scheme: %s",found)
+ end
+ return found
+ end
+ hash[original] = false
+ elseif found then
+ return found
+ end
+ return false
+ else
+ -- something is wrong here, maybe we should trace it (scheme can be "unknown")
+ end
+ end
+ -- again, something is wrong
+ return findfile(specification,filetype)
+ end
+
+end
+
+finders.helpers.validhashed = validhashed
+finders.helpers.registerhashed = registerhashed
+finders.helpers.registerfilescheme = registerfilescheme
+
+local function locate(found,path,name)
+ local files = found.metadata.files
+ local hashes = found.metadata.hashes
+ local fp = files[path]
+ local hash = fp and fp[name]
+ if hash and hashes[hash] then
+ return hash
+ end
+end
+
+local function locatehash(filename,database)
+ if filename then
+ local name = basename(filename)
+ local path = pathpart(filename)
+ local hash = false
+ if database then
+ local found = hashed[database]
+ if found then
+ hash = locate(found,path,name), database, path, name
+ end
+ else
+ for i=1,#ordered do
+ local found = ordered[i]
+ hash = locate(found,path,name)
+ if hash then
+ database = found.database
+ break
+ end
+ end
+ end
+ if hash then
+ return {
+ hash = hash,
+ name = name,
+ path = path,
+ base = database,
+ }
+ end
+ end
+end
+
+-- no caching yet, we don't always want the file and it's fast enough
+
+local function locateblob(filename,database)
+ local found = locatehash(filename,database)
+ if found then
+ local database = found.base
+ local data = hashed[database]
+ if data then
+ local metadata = data.metadata
+ local dataname = data.dataname
+ local hashes = metadata.hashes
+ local blobdata = hashes[found.hash]
+ if blobdata and dataname then
+ local position = blobdata.position
+ local f = open(dataname,"rb")
+ if f then
+ f:seek("set",position)
+ local blob = f:read(blobdata.datasize)
+ if blobdata.compress == "zip" then
+ blob = zlib.decompresssize(blob,blobdata.filesize)
+ end
+ return blob
+ end
+ end
+ end
+ end
+end
+
+local finders = resolvers.finders
+local notfound = finders.notfound
+
+function finders.hashed(specification)
+ local original = specification.original
+ local fullpath = specification.path
+ if fullpath then
+ local found = locatehash(fullpath)
+ if found then
+ if trace_hashed then
+ report_hashed("finder: file %a found",original)
+ end
+ return original
+ end
+ end
+ if trace_hashed then
+ report_hashed("finder: unknown file %a",original)
+ end
+ return notfound()
+end
+
+local notfound = openers.notfound
+local textopener = openers.helpers.textopener
+
+function openers.hashed(specification)
+ local original = specification.original
+ local fullpath = specification.path
+ if fullpath then
+ local found = locateblob(fullpath)
+ if found then
+ if trace_hashed then
+ report_hashed("finder: file %a found",original)
+ end
+ return textopener("hashed",original,found,"utf-8")
+ end
+ end
+ if trace_hashed then
+ report_hashed("finder: unknown file %a",original)
+ end
+ return notfound()
+end
+
+local notfound = loaders.notfound
+
+function loaders.hashed(specification)
+ local original = specification.original
+ local fullpath = specification.path
+ if fullpath then
+ local found = locateblob(fullpath)
+ if found then
+ if trace_hashed then
+ report_hashed("finder: file %a found",original)
+ end
+ return true, found, found and #found or 0
+ end
+ end
+ if trace_hashed then
+ report_hashed("finder: unknown file %a",original)
+ end
+ return notfound()
+end
+
+-- this actually could end up in the generate namespace but it is not
+-- really a 'generic' feature, more a module (at least for now)
+
+local calculatehash = sha2.HEX256 -- md5.HEX is not unique enough
+
+function resolvers.finders.helpers.createhashed(specification)
+ local database = specification.database
+ local patterns = specification.patterns
+ if not patterns then
+ local pattern = specification.pattern
+ if pattern then
+ patterns = {
+ {
+ pattern = pattern,
+ compress = specification.compress,
+ }
+ }
+ end
+ end
+ local datname = addsuffix(database,"dat")
+ local luaname = addsuffix(database,"lua")
+ local metadata = loadtable(luaname)
+ if type(metadata) ~= "table" then
+ metadata = false
+ elseif metadata.kind == "hashed" and metadata.version ~= version then
+ report_hashed("version mismatch, starting with new table")
+ metadata = false
+ end
+ if not metadata then
+ metadata = {
+ version = version,
+ kind = "hashed",
+ files = { },
+ hashes = { },
+ nofnames = 0,
+ nofpaths = 0,
+ nofblobs = 0,
+ nofcompressed = 0,
+ }
+ end
+ local files = metadata.files
+ local hashes = metadata.hashes
+ local nofpaths = metadata.nofpaths
+ local nofnames = metadata.nofnames
+ local nofblobs = metadata.nofblobs
+ local nofcompressed = metadata.nofcompressed
+ if type(patterns) == "table" then
+ for i=1,#patterns do
+ local pattern = patterns[i].pattern
+ if pattern then
+ local compress = patterns[i].compress
+ local list = dir.glob(pattern)
+ local total = #list
+ report_hashed("database %a, adding pattern %a, compression %l",database,pattern,compress)
+ for i=1,total do
+ local filename = list[i]
+ local name = basename(filename)
+ local path = pathpart(filename)
+ local data = loaddata(filename)
+ -- cleanup
+ path = gsub(path,"^[./]*","")
+ --
+ if data then
+ local fp = files[path]
+ if not fp then
+ fp = { }
+ files[path] = fp
+ nofpaths = nofpaths + 1
+ end
+ local ff = fp[name]
+ if not ff then
+ local hash = calculatehash(data)
+ if not hashes[hash] then
+ local size = #data
+ if compress then
+ data = zlib.compresssize(data,size)
+ nofcompressed = nofcompressed + 1
+ end
+ local position = filesize(datname)
+ savedata(datname,data,"",true)
+ hashes[hash] = {
+ filesize = size,
+ datasize = #data,
+ compress = compress and "zip",
+ position = position,
+ }
+ nofblobs = nofblobs + 1
+ end
+ fp[name] = hash
+ nofnames = nofnames + 1
+ end
+ end
+ end
+ end
+ end
+ end
+ metadata.nofpaths = nofpaths
+ metadata.nofnames = nofnames
+ metadata.nofblobs = nofblobs
+ metadata.nofcompressed = nofcompressed
+ savetable(luaname, metadata)
+ showstatus(database,metadata)
+ return metadata
+end
+
diff --git a/Master/texmf-dist/tex/context/base/mkxl/data-vir.lmt b/Master/texmf-dist/tex/context/base/mkxl/data-vir.lmt
new file mode 100644
index 00000000000..b78211fc9a7
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/data-vir.lmt
@@ -0,0 +1,104 @@
+if not modules then modules = { } end modules ['data-vir'] = {
+ version = 1.001,
+ comment = "companion to luat-lib.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local type = type
+local formatters = string.formatters
+
+local trace_virtual = false
+local report_virtual = logs.reporter("resolvers","virtual")
+
+trackers.register("resolvers.locating", function(v) trace_virtual = v end)
+trackers.register("resolvers.virtual", function(v) trace_virtual = v end)
+
+local resolvers = resolvers
+local savers = resolvers.savers
+local cleaners = resolvers.cleaners
+
+local data = { }
+local n = 0 -- hm, number can be query
+local f_virtual_n = formatters["virtual://%s.%s"]
+local f_virtual_y = formatters["virtual://%s-%s.%s"]
+
+function savers.virtual(specification,content,suffix)
+ n = n + 1 -- one number for all namespaces
+ local path = type(specification) == "table" and specification.path or specification
+ if type(path) ~= "string" or path == "" then
+ path = "virtualfile"
+ end
+ local filename = suffix and f_virtual_y(path,n,suffix) or f_virtual_n(path,n)
+ if trace_virtual then
+ report_virtual("saver: file %a saved",filename)
+ end
+ data[filename] = content
+ return filename
+end
+
+function cleaners.virtual(filename)
+ data[filename] = nil
+end
+
+local finders = resolvers.finders
+local notfound = finders.notfound
+
+function finders.virtual(specification)
+ local original = specification.original
+ local d = data[original]
+ if d then
+ if trace_virtual then
+ report_virtual("finder: file %a found",original)
+ end
+ return original
+ else
+ if trace_virtual then
+ report_virtual("finder: unknown file %a",original)
+ end
+ return notfound()
+ end
+end
+
+local openers = resolvers.openers
+local notfound = openers.notfound
+local textopener = openers.helpers.textopener
+
+function openers.virtual(specification)
+ local original = specification.original
+ local d = data[original]
+ if d then
+ if trace_virtual then
+ report_virtual("opener: file %a opened",original)
+ end
+ data[original] = nil -- when we comment this we can have error messages
+ -- With utf-8 we signal that no regime is to be applied!
+ -- characters.showstring(d)
+ return textopener("virtual",original,d,"utf-8")
+ else
+ if trace_virtual then
+ report_virtual("opener: file %a not found",original)
+ end
+ return notfound()
+ end
+end
+
+local loaders = resolvers.loaders
+local notfound = loaders.notfound
+
+function loaders.virtual(specification)
+ local original = specification.original
+ local d = data[original]
+ if d then
+ if trace_virtual then
+ report_virtual("loader: file %a loaded",original)
+ end
+ data[original] = nil
+ return true, d, #d
+ end
+ if trace_virtual then
+ report_virtual("loader: file %a not loaded",original)
+ end
+ return notfound()
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/driv-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/driv-ini.lmt
index 729196e870d..c43bf2a83b3 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/driv-ini.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/driv-ini.lmt
@@ -30,6 +30,8 @@ local shipout = tex.shipout
local texgetbox = tex.getbox
local texgetcount = tex.getcount
+local c_realpageno = tex.iscount("realpageno")
+
function converters.engine(driver,boxnumber,mode,number,specification)
return shipout(boxnumber)
end
@@ -65,6 +67,14 @@ local installwhatsits do
local leaderlevel = 0
local backends = backends
+ local trace = true
+
+ local latelua = backends.latelua
+ local writeout = backends.writeout
+ local openout = backends.openout
+ local closeout = backends.closeout
+
+ trackers.register("backends.whatsits",function(v) trace = v end)
local function pushleaderlevel()
leaderlevel = leaderlevel + 1
@@ -75,26 +85,26 @@ local installwhatsits do
end
local function flushlatelua(current,h,v)
- -- Here we assume maganement by the lua function so currently we don't
- -- check for leaderlevel.
- return backends.latelua(current,h,v)
+ -- Here we assume management by the lua function so currently we don't
+ -- need to check for leaderlevel and it can even be counterproductive.
+ return latelua(current,h,v)
end
local function flushwriteout(current)
if leaderlevel == 0 then
- backends.writeout(current)
+ writeout(current)
end
end
local function flushopenout(current)
if leaderlevel == 0 then
- backends.openout(current)
+ openout(current)
end
end
local function flushcloseout(current)
if leaderlevel == 0 then
- backends.closeout(current)
+ closeout(current)
end
end
@@ -110,8 +120,6 @@ local installwhatsits do
local whatsitcodes = nodes.whatsitcodes
- local trace = true trackers.register("backends.whatsits",function(v) trace = v end)
-
installwhatsits = function(name,flushers)
-- latelua : specific
@@ -135,54 +143,13 @@ local installwhatsits do
return v
end
- -- flushers.whatsit = setmetatableindex ( {
- -- [whatsitcodes.literal] = flushers.literal,
- -- [whatsitcodes.latelua] = flushlatelua,
- -- [whatsitcodes.userdefined] = flushuserdefined,
- -- [whatsitcodes.savepos] = flushsavepos,
- -- [whatsitcodes.save] = flushers.save,
- -- [whatsitcodes.restore] = flushers.restore,
- -- [whatsitcodes.setmatrix] = flushers.setmatrix,
- -- [whatsitcodes.open] = flushopenout,
- -- [whatsitcodes.close] = flushcloseout,
- -- [whatsitcodes.write] = flushwriteout,
- -- [whatsitcodes.startmatrix] = flushers.startmatrix,
- -- [whatsitcodes.stopmatrix] = flushers.stopmatrix,
- -- [whatsitcodes.startscaling] = flushers.startscaling,
- -- [whatsitcodes.stopscaling] = flushers.stopscaling,
- -- [whatsitcodes.startrotation] = flushers.startrotation,
- -- [whatsitcodes.stoprotation] = flushers.stoprotation,
- -- [whatsitcodes.startmirroring] = flushers.startmirroring,
- -- [whatsitcodes.stopmirroring] = flushers.stopmirroring,
- -- [whatsitcodes.startclipping] = flushers.startclipping,
- -- [whatsitcodes.stopclipping] = flushers.stopclipping,
- -- [whatsitcodes.setstate] = flushers.setstate,
- -- }, checkagain )
-
- -- -- sparse
-
- -- flushers.whatsit = setmetatableindex ( {
- -- [whatsitcodes.latelua] = flushlatelua,
- -- [whatsitcodes.userdefined] = flushuserdefined,
- -- [whatsitcodes.savepos] = flushsavepos,
- -- [whatsitcodes.open] = flushopenout,
- -- [whatsitcodes.close] = flushcloseout,
- -- [whatsitcodes.write] = flushwriteout,
- -- }, checkagain )
-
- -- -- delayed
+ -- delayed
local whatsit ; whatsit = setmetatableindex ( {
[whatsitcodes.literal] = flushers.literal or function(...) return checkagain(whatsit,whatsitcodes.literal )(...) end,
- [whatsitcodes.latelua] = flushlatelua,
- [whatsitcodes.userdefined] = flushuserdefined,
- [whatsitcodes.savepos] = flushsavepos,
[whatsitcodes.save] = flushers.save or function(...) return checkagain(whatsit,whatsitcodes.save )(...) end,
[whatsitcodes.restore] = flushers.restore or function(...) return checkagain(whatsit,whatsitcodes.restore )(...) end,
[whatsitcodes.setmatrix] = flushers.setmatrix or function(...) return checkagain(whatsit,whatsitcodes.setmatrix )(...) end,
- [whatsitcodes.open] = flushopenout,
- [whatsitcodes.close] = flushcloseout,
- [whatsitcodes.write] = flushwriteout,
[whatsitcodes.startmatrix] = flushers.startmatrix or function(...) return checkagain(whatsit,whatsitcodes.startmatrix )(...) end,
[whatsitcodes.stopmatrix] = flushers.stopmatrix or function(...) return checkagain(whatsit,whatsitcodes.stopmatrix )(...) end,
[whatsitcodes.startscaling] = flushers.startscaling or function(...) return checkagain(whatsit,whatsitcodes.startscaling )(...) end,
@@ -194,6 +161,13 @@ local installwhatsits do
[whatsitcodes.startclipping] = flushers.startclipping or function(...) return checkagain(whatsit,whatsitcodes.startclipping )(...) end,
[whatsitcodes.stopclipping] = flushers.stopclipping or function(...) return checkagain(whatsit,whatsitcodes.stopclippin )(...) end,
[whatsitcodes.setstate] = flushers.setstate or function(...) return checkagain(whatsit,whatsitcodes.setstate )(...) end,
+ --
+ [whatsitcodes.latelua] = flushlatelua,
+ [whatsitcodes.userdefined] = flushuserdefined,
+ [whatsitcodes.savepos] = flushsavepos,
+ [whatsitcodes.open] = flushopenout,
+ [whatsitcodes.close] = flushcloseout,
+ [whatsitcodes.write] = flushwriteout,
}, checkagain)
flushers.whatsit = whatsit
@@ -232,7 +206,7 @@ function drivers.convert(boxnumber)
if currentinstance then
callbacks.functions.start_page_number()
starttiming(drivers)
- convert(currentinstance,boxnumber,texgetcount("realpageno"))
+ convert(currentinstance,boxnumber,texgetcount(c_realpageno))
stoptiming(drivers)
callbacks.functions.stop_page_number()
end
@@ -271,15 +245,15 @@ function drivers.enable(name)
cleanup(currentinstance)
stoptiming(drivers)
end
- currentdriver = name or "default"
+ currentdriver = name or "none"
currentinstance = instances[currentdriver]
if currentinstance then
- local actions = currentinstance.actions
- prepare = actions.prepare
- wrapup = actions.wrapup
- cleanup = actions.cleanup
- convert = actions.convert
- outputfilename = actions.outputfilename
+ local actions = currentinstance.actions
+ prepare = actions.prepare
+ wrapup = actions.wrapup
+ cleanup = actions.cleanup
+ convert = actions.convert
+ outputfilename = actions.outputfilename
--
if prepare and not prepared[currentdriver] then
starttiming(drivers)
@@ -309,42 +283,6 @@ interfaces.implement {
actions = drivers.enable,
}
--- The default driver:
-
-do
-
- local filename = nil
-
- drivers.install {
- name = "default",
- actions = {
- convert = drivers.converters.engine,
- outputfilename = function(driver)
- if not filename then
- filename = addsuffix(tex.jobname,"pdf")
- end
- return filename
- end,
- },
- flushers = {
- -- we always need this entry
- },
- }
-
-end
-
--- No driver:
-
-do
-
- drivers.install {
- name = "none",
- actions = { },
- flushers = { },
- }
-
-end
-
do
local function prepare(driver)
@@ -366,10 +304,14 @@ do
end
---
-
setmetatableindex(instances,function() return instances.default end)
--- for now:
+-- We default to no driver at all:
+
+drivers.install {
+ name = "none",
+ actions = { },
+ flushers = { },
+}
-drivers.enable("default")
+drivers.enable("none")
diff --git a/Master/texmf-dist/tex/context/base/mkxl/driv-shp.lmt b/Master/texmf-dist/tex/context/base/mkxl/driv-shp.lmt
index d3a47bf0d2e..09928f303eb 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/driv-shp.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/driv-shp.lmt
@@ -7,130 +7,121 @@ if not modules then modules = { } end modules ['driv-shp'] = {
license = "see context related readme files"
}
-local type, next = type, next
-
-local setmetatableindex = table.setmetatableindex
-local formatters = string.formatters
-local concat = table.concat
-local keys = table.keys
-local sortedhash = table.sortedhash
-local splitstring = string.split
-local find = string.find
-local stripstring = string.strip
-local idiv = number.idiv
-local sequenced = table.sequenced
-local round = math.round
-local extract = bit32.extract
-local nuts = nodes.nuts
-
-local tonut = nodes.tonut
-local tonode = nodes.tonode
-
-local getdirection = nuts.getdirection
-local getlist = nuts.getlist
-local getoffsets = nuts.getoffsets
-local getorientation = nuts.getorientation
-local getfield = nuts.getfield
-local getwhd = nuts.getwhd
-local getkern = nuts.getkern
-local getheight = nuts.getheight
-local getdepth = nuts.getdepth
------ getwidth = nuts.getwidth
-local getnext = nuts.getnext
-local getsubtype = nuts.getsubtype
-local getid = nuts.getid
-local getleader = nuts.getleader
------ getglue = nuts.getglue
-local getshift = nuts.getshift
-local getdata = nuts.getdata
------ getexpansion = nuts.getexpansion
-local getreplace = nuts.getreplace
-local setreplace = nuts.setreplace
-local getfont = nuts.getfont
-local getkerndimension = nuts.getkerndimension
-
-local setdirection = nuts.setdirection
-local setfield = nuts.setfield
-local setlink = nuts.setlink
-
-local isglyph = nuts.isglyph
-local findtail = nuts.tail
-local nextdir = nuts.traversers.dir
-local nextnode = nuts.traversers.node
-
------ rangedimensions = node.direct.rangedimensions -- nuts ?
-local effectiveglue = nuts.effective_glue
-local start_of_par = nuts.start_of_par
-local dirdimensions = nuts.dirdimensions
-
-local texget = tex.get
-
-local fonthashes = fonts.hashes
-local fontdata = fonthashes.identifiers
-local characters = fonthashes.characters
-local parameters = fonthashes.parameters
-
-local nodecodes = nodes.nodecodes
-local whatsitcodes = nodes.whatsitcodes
-local gluecodes = nodes.gluecodes
-local dircodes = nodes.dircodes
-local dirvalues = nodes.dirvalues
-local subtypes = nodes.subtypes
-
-local lefttoright_code = dirvalues.lefttoright
-local righttoleft_code = dirvalues.righttoleft
-
-local glyph_code = nodecodes.glyph
-local kern_code = nodecodes.kern
-local glue_code = nodecodes.glue
-local hlist_code = nodecodes.hlist
-local vlist_code = nodecodes.vlist
-local dir_code = nodecodes.dir
-local disc_code = nodecodes.disc
-local math_code = nodecodes.math
-local rule_code = nodecodes.rule
-local whatsit_code = nodecodes.whatsit
------ penalty_code = nodecodes.penalty
------ boundary_code = nodecodes.boundary
-
-local leaders_code = gluecodes.leaders
-local cleaders_code = gluecodes.cleaders
-local xleaders_code = gluecodes.xleaders
-local gleaders_code = gluecodes.gleaders
-
-local spaceskip_code = gluecodes.spaceskip
-
-local getpagedimensions = layouts.getpagedimensions
-
-local drivers = drivers
-local instances = drivers.instances
-
-local report = logs.reporter("drivers")
+local type, next, rawget, rawset = type, next, rawget, rawset
+
+local setmetatableindex = table.setmetatableindex
+local formatters = string.formatters
+local concat = table.concat
+local keys = table.keys
+local insert = table.insert
+local sortedhash = table.sortedhash
+local find = string.find
+local stripstring = string.strip
+local sequenced = table.sequenced
+local round = math.round
+local nuts = nodes.nuts
+
+local tonut = nodes.tonut
+local tonode = nodes.tonode
+
+local getdirection = nuts.getdirection
+local getlist = nuts.getlist
+local getoffsets = nuts.getoffsets
+local getorientation = nuts.getorientation
+local getanchors = nuts.getanchors
+local getgeometry = nuts.getgeometry
+local getxyscales = nuts.getxyscales
+local getwhd = nuts.getwhd
+local getkern = nuts.getkern
+local getheight = nuts.getheight
+local getdepth = nuts.getdepth
+----- getwidth = nuts.getwidth
+local getnext = nuts.getnext
+local getsubtype = nuts.getsubtype
+local getid = nuts.getid
+local getleader = nuts.getleader
+----- getglue = nuts.getglue
+local getshift = nuts.getshift
+local getreplace = nuts.getreplace
+local setreplace = nuts.setreplace
+local getfont = nuts.getfont
+
+local getglyphdimensions = nuts.getglyphdimensions
+local getkerndimension = nuts.getkerndimension
+local getlistdimensions = nuts.getlistdimensions
+local getruledimensions = nuts.getruledimensions
+
+local setdirection = nuts.setdirection
+local setlink = nuts.setlink
+
+local isglyph = nuts.isglyph
+----- nextdir = nuts.traversers.dir
+local nextnode = nuts.traversers.node
+
+local effectiveglue = nuts.effectiveglue
+local dirdimensions = nuts.dirdimensions
+
+local fonthashes = fonts.hashes
+local fontdata = fonthashes.identifiers
+local characters = fonthashes.characters
+local parameters = fonthashes.parameters
+
+local nodecodes = nodes.nodecodes
+local whatsitcodes = nodes.whatsitcodes
+local gluecodes = nodes.gluecodes
+local dirvalues = nodes.dirvalues
+local subtypes = nodes.subtypes
+
+local lefttoright_code = dirvalues.lefttoright
+local righttoleft_code = dirvalues.righttoleft
+
+local glyph_code = nodecodes.glyph
+local kern_code = nodecodes.kern
+local glue_code = nodecodes.glue
+local hlist_code = nodecodes.hlist
+local vlist_code = nodecodes.vlist
+local dir_code = nodecodes.dir
+local disc_code = nodecodes.disc
+local math_code = nodecodes.math
+local rule_code = nodecodes.rule
+local whatsit_code = nodecodes.whatsit
+
+local virtualrule_code = nodes.rulecodes.virtual
+
+local leaders_code = gluecodes.leaders
+local cleaders_code = gluecodes.cleaders
+local xleaders_code = gluecodes.xleaders
+local gleaders_code = gluecodes.gleaders
+
+local spaceskip_code = gluecodes.spaceskip
+
+local getpagedimensions = layouts.getpagedimensions
+
+local drivers = drivers
+
+local report = logs.reporter("drivers")
---------------------------------------------------------------------------------------
+-- For the moment rules need at least some height but maybe some day we let user rules
+-- fall through or have some way to force a rule via some property.
+---------------------------------------------------------------------------------------
local lastfont = nil
local fontcharacters = nil
local magicconstants = tex.magicconstants
-local trueinch = magicconstants.trueinch
local maxdimen = magicconstants.maxdimen
-local running = magicconstants.running
+local runningrule = magicconstants.runningrule
local pos_h = 0
local pos_v = 0
local pos_r = lefttoright_code
local shippingmode = "none"
-local abs_max_v = 0
-local abs_max_h = 0
-
local shipbox_h = 0
local shipbox_v = 0
local page_size_h = 0
local page_size_v = 0
------ page_h_origin = 0 -- trueinch
------ page_v_origin = 0 -- trueinch
local initialize
local finalize
@@ -152,6 +143,10 @@ function drivers.getvpos() return round(pos_v) end
-- characters
+-- experiment (smaller page stream but might be fragile)
+
+local tospace = false directives.register("backends.spaces", function(v) tospace = v end)
+
local flush_character do
local stack = setmetatableindex("table")
@@ -159,213 +154,318 @@ local flush_character do
local nesting = 0
local main = 0
- -- experiment (smaller page stream but might be fragile)
-
- local tospace = false directives.register("backends.spaces", function(v) tospace = v end)
-
-- todo: cache streams
- local default = 16384 * number.dimenfactors.bp -- 65536 // 4
+ local default = 16384 -- * number.dimenfactors.bp -- 65536 // 4
+ local refactored = 1000000 -- expansion related
local vfinjectors = fonts.helpers.vfinjectors
- local function flush_vf_packet(current,pos_h,pos_v,pos_r,font,char,data,factor,vfcommands,sx,sy)
+ -- current can go
+ -- local alternative = false -- more local, can be an option: vf.commands.local
+
+ local function flush_vf_packet(current,pos_h,pos_v,pos_r,font,char,data,csx,csy,factor,sx,sy,vfcommands)
if nesting > 100 then
return
elseif nesting == 0 then
main = font
+ -- if alternative then
+ -- local s = stack[0]
+ -- s[1] = pos_h
+ -- s[2] = pos_v
+ -- s[3] = pos_r
+ -- end
+ else
+ -- if alternative then
+ -- local s = stack[0]
+ -- pos_h = s[1]
+ -- pos_v = s[2]
+ -- pos_r = s[3]
+ -- end
end
nesting = nesting + 1
+ local savedlevel = level
+
+ local function push()
+ level = level + 1
+ local s = stack[level]
+ s[1] = pos_h
+ s[2] = pos_v
+ s[3] = pos_r
+ end
+
+ local function pop()
+ if level > 0 then
+ local s = stack[level]
+ pos_h = s[1]
+ pos_v = s[2]
+ pos_r = s[3]
+ level = level - 1
+ end
+ end
+
+ -- push() -- or:
+
local saved_h = pos_h
local saved_v = pos_v
local saved_r = pos_r
+
pos_r = lefttoright_code
- local data = fontdata[font]
- local fnt = font
- local fonts = data.fonts
- local siz = (data.parameters.factor or 1)/65536
+ local fdata = fontdata[font] -- offsets etc
+ local fnt = font
+ local fonts = fdata.fonts
+ local siz = (fdata.parameters.factor or 1)/65536
+
+ -- An alternative where we (here) locally define handlers like this:
+ --
+ -- if not vfinjectors then
+ -- function vfinjectors.char(hpos,vpos,packet)
+ -- -- .... access: font, char, factor, sx, xy
+ -- end
+ -- end
+ --
+ -- doesn't work because accessing the parameters passed to the outer function doesn't
+ -- work as expected (so we end up in a nesting loop). I remember hitting this somewhat
+ -- unexpected feature before.
+
+ local scale = data.scale
+ local xoffset = data.xoffset
+ local yoffset = data.yoffset
+
+ if scale then
+ sx = scale * sx
+ sy = scale * sy
+ end
- local function flushchar(font,char,fnt,chr,f,e)
- if fnt then
+ -- -- example of usage needed (nested vf)
+
+ if csx then
+ sx = sx * csx
+ csx = 1
+ end
+ if csy then
+ sy = sy * csy
+ csy = 1
+ end
+
+ if xoffset and xoffset ~= 0 then
+ if factor ~= 0 then
+ xoffset = xoffset + xoffset * factor / refactored -- expansion
+ end
+ pos_h = pos_h + xoffset * sx
+ end
+
+ if yoffset and yoffset ~= 0 then
+ pos_v = pos_v + yoffset * sy
+ end
+
+ -- we assume resolved fonts: id mandate but maybe also size
+
+ local function flushchar(fnt,chr,csx,csy) -- can't be moved out of the function due to binding locals
+ if fnt then -- to the function variables etc etc ... kind of messy
local nest = char ~= chr or font ~= fnt
if fnt == 0 then
fnt = main
end
- return flush_character(current,fnt,chr,factor,nest,pos_h,pos_v,pos_r,f,e)
+ if csx then
+ csx = csx * sx
+ else
+ csx = sx
+ end
+ if csy then
+ csy = csy * sy
+ else
+ csy = sy
+ end
+ -- here no current!
+ -- return flushcharacter(false,pos_h,pos_v,pos_r,fnt,chr,nil,csx,csy,factor,sx,sy)
+ return flush_character(false,fnt,chr,factor,nest,pos_h,pos_v,pos_r,csx,csy)
else
return 0
end
end
- -- we assume resolved fonts: id mandate but maybe also size
-
- -- we could map left, right, up, down -> offset
- -- we could map char, font, slot to -> slot
-
for i=1,#vfcommands do
- local packet = vfcommands[i]
- local command = packet[1]
- if command == "char" then
- local chr = packet[2]
- local f = packet[3]
- local e = packet[4]
- pos_h = pos_h + flushchar(font,char,fnt,chr,f,e)
- elseif command == "slot" then
- local index = packet[2]
- local chr = packet[3]
- local f = packet[4]
- local e = packet[5]
- if index == 0 then
- pos_h = pos_h + flushchar(font,char,font,chr,f,e)
- else
- local okay = fonts and fonts[index]
- if okay then
- local fnt = okay.id
- if fnt then
- pos_h = pos_h + flushchar(font,char,fnt,chr,f,e)
- end
- else
- -- safeguard, we assume the font itself (often index 1)
- pos_h = pos_h + flushchar(font,char,font,chr,f,e)
- end
- end
- elseif command == "use" then
- local index = packet[2]
- if index then
- local fnt
+ local packet = vfcommands[i]
+ if packet then
+ local command = packet[1]
+ if command == "char" then
+ local chr = packet[2]
+ local csx = packet[3]
+ local csy = packet[4] or csx
+ pos_h = pos_h + flushchar(fnt,chr,csx,csy)
+* sx
+ elseif command == "slot" then
+ local index = packet[2]
+ local chr = packet[3]
+ local csx = packet[4]
+ local csy = packet[5] or csx
if index == 0 then
- fnt = font
+ pos_h = pos_h + flushchar(font,chr,csx,csy)
+* sx
else
local okay = fonts and fonts[index]
if okay then
- fnt = okay.id
+ local fnt = okay.id
+ if fnt then
+ if fnt == 0 then
+ fnt = font
+ end
+ pos_h = pos_h + flushchar(fnt,chr,csx,csy)
+* sx
+ end
+ else
+ -- safeguard, we assume the font itself (often index 1)
+ pos_h = pos_h + flushchar(font,chr,csx,csy)
+* sx
end
end
- if fnt then
- -- not efficient but ok for now as experiment
- local d = characters[fnt]
- if d then
- for i=3,#packet do
- local chr = packet[i]
- local dat = d[chr]
- if dat then
- flushfontchar(fnt,chr,dat)
+ elseif command == "use" then
+ local index = packet[2]
+ if index then
+ local fnt
+ if index == 0 then
+ fnt = font
+ else
+ local okay = fonts and fonts[index]
+ if okay then
+ fnt = okay.id
+ end
+ end
+ if fnt then
+ -- not efficient but ok for now as experiment
+ local d = characters[fnt]
+ if d then
+ for i=3,#packet do
+ local chr = packet[i]
+ local dat = d[chr]
+ if dat then
+ flushfontchar(fnt,chr,dat)
+ end
end
end
end
end
- end
- elseif command == "right" then
- local h = packet[2] -- already scaled
- if h ~= 0 then
- if factor ~= 0 then
- h = h + h * factor / 1000 -- expansion
+ elseif command == "right" then
+ local h = packet[2] -- already scaled
+ if h ~= 0 then
+ if factor ~= 0 then
+ h = h + h * factor / refactored -- expansion
+ end
+ pos_h = pos_h + h * sx
end
- pos_h = pos_h + h * sx
- end
- elseif command == "left" then
- local h = packet[2] -- already scaled
- if h ~= 0 then
- if factor ~= 0 then
- h = h + h * factor / 1000 -- expansion
+ elseif command == "left" then
+ local h = packet[2] -- already scaled
+ if h ~= 0 then
+ if factor ~= 0 then
+ h = h + h * factor / refactored -- expansion
+ end
+ pos_h = pos_h - h * sx
end
- pos_h = pos_h - h * sx
- end
- elseif command == "down" then
- local v = packet[2] -- already scaled
- if v and v ~= 0 then
- pos_v = pos_v - v * sy
- end
- elseif command == "up" then
- local v = packet[2] -- already scaled
- if v and v ~= 0 then
- pos_v = pos_v + v * sy
- end
- elseif command == "offset" then
- local ph = pos_h
- local pv = pos_v
- local h = packet[2] or 0
- local v = packet[3] or 0
- local c = packet[4]
- if h ~= 0 then
- if factor ~= 0 then
- h = h + h * factor / 1000 -- expansion
+ elseif command == "down" then
+ local v = packet[2] -- already scaled
+ if v and v ~= 0 then
+ pos_v = pos_v - v * sy
end
- pos_h = pos_h + h * sx
- end
- if v and v ~= 0 then
- pos_v = pos_v + v * sy
- end
- if c then
- flushchar(font,char,fnt,c)
- pos_h = ph
- pos_v = pv
- end
- elseif command == "compose" then
- local ph = pos_h
- local pv = pos_v
- local h = packet[2] or 0
- local v = packet[3] or 0
- local c = packet[4]
- if h ~= 0 then
- if factor ~= 0 then
- h = h + h * factor / 1000 -- expansion
+ elseif command == "up" then
+ local v = packet[2] -- already scaled
+ if v and v ~= 0 then
+ pos_v = pos_v + v * sy
end
- pos_h = pos_h + h * sx
- end
- if v and v ~= 0 then
- pos_v = pos_v + v * sy
- end
- if c then
- flushchar(font,char,fnt,c)
- pos_h = ph
- pos_v = pv
- end
- elseif command == "push" then
- level = level + 1
- local s = stack[level]
- s[1] = pos_h
- s[2] = pos_v
- elseif command == "pop" then
- if level > 0 then
- local s = stack[level]
- pos_h = s[1]
- pos_v = s[2]
- level = level - 1
- end
- elseif command == "rule" then
- local size_v = packet[2]
- local size_h = packet[3]
- if size_h > 0 and size_v > 0 then
- if factor ~= 0 then
- size_h = size_h + size_h * factor / 1000
+ elseif command == "offset" then
+ local c = packet[4]
+ if c then
+ local ph = pos_h
+ local pv = pos_v
+ local csx = packet[5]
+ local csy = packet[6] or csx
+ local h = packet[2]
+ local v = packet[3]
+ if h and h ~= 0 then
+ if factor ~= 0 then
+ h = h + h * factor / refactored -- expansion
+ end
+ pos_h = pos_h + h * sx
+ end
+ if v and v ~= 0 then
+ pos_v = pos_v + v * sy
+ end
+ flushchar(fnt,c,csx,csy)
+ pos_h = ph
+ pos_v = pv
end
- if size_h > 0 then
- size_h = size_h * sx
- size_v = size_v * sy
- flushsimplerule(pos_h,pos_v,pos_r,size_h,size_v)
- pos_h = pos_h + size_h
+ elseif command == "stay" then
+ -- we can do a fast one if needed, it's more an experiment
+ push()
+ flushchar(font,packet[2],1,1)
+ pop()
+ elseif command == "compose" then -- for now idem
+ local ph = pos_h
+ local pv = pos_v
+ local h = packet[2] or 0
+ local v = packet[3] or 0
+ local c = packet[4]
+ if h ~= 0 then
+ if factor ~= 0 then
+ h = h + h * factor / refactored -- expansion
+ end
+ pos_h = pos_h + h * sx
end
- end
- elseif command == "frame" then
- -- d:width d:height d:depth d:rulethickness b:outline b:advance b:baseline s:color
- local width = packet[2]
- if width > 0 then
- local height = packet[3] or 0
- local depth = packet[4] or 0
- local total = height + depth
- if total > 0 then
+ if v and v ~= 0 then
+ pos_v = pos_v + v * sy
+ end
+ if c then
+ flushchar(fnt,c)
+ pos_h = ph
+ pos_v = pv
+ end
+ elseif command == "push" then
+ push()
+ elseif command == "pop" then
+ pop()
+ elseif command == "frame" then
+ -- d:width d:height d:depth d:rulethickness b:outline b:advance b:baseline s:color
+ local width = packet[2]
+ local height = packet[3]
+ local depth = packet[4]
+ local wd, ht, dp
+ if width == true or height == true or depth == true then
+ wd, ht, dp = getwhd(current,true)
+ end
+ if width == true then
+ width = wd
+ elseif not width then
+ width = 0
+ end
+ if height == true then
+ height = ht
+ elseif not height then
+ height = 0
+ end
+ if depth == true then
+ depth = dp
+ elseif not depth then
+ depth = 0
+ end
+ local total = height + depth
+ if width > 0 and total > 0 then
if factor ~= 0 then
- width = width + width * factor / 1000
+ width = width + width * factor / refactored
end
if width > 0 then
- local line = packet[5] or default
- local outline = not packet[6]
- local advance = not packet[7]
+ local line = packet[5] or default
+ local outline = packet[6]
+ local advance = packet[7]
+ if outline == nil then
+ outline = true
+ end
+ if advance == nil then
+ advance = true
+ end
local baseline = outline and packet[8]
local color = packet[9] -- no longer needed probably
if color then
@@ -383,56 +483,110 @@ local flush_character do
end
end
end
- end
- elseif command == "font" then
- local index = packet[2]
- local okay = fonts and fonts[index]
- if okay then
- fnt = okay.id or fnt -- or maybe just return
- end
- elseif command == "lua" then
- local code = packet[2]
- local kind = type(code)
- if kind ~= "function" then
- code = loadstring(code)
- kind = type(code)
- end
- if kind == "function" then
- code(font,char,pos_h,pos_v,sx,sy)
- end
- elseif command == "node" then -- obsolete
- local h = packet[2]
- hlist_out(h,getlist(h))
- else
- local injector = vfinjectors[command]
- if injector then
- injector(pos_h,pos_v,packet)
+ elseif command == "rule" then
+ local size_v = packet[2]
+ local size_h = packet[3]
+ if size_h > 0 and size_v > 0 then
+ if factor ~= 0 then
+ size_h = size_h + size_h * factor / refactored
+ end
+ if size_h > 0 then
+ size_h = size_h * sx
+ size_v = size_v * sy
+ flushsimplerule(pos_h,pos_v,pos_r,size_h,size_v)
+ pos_h = pos_h + size_h
+ end
+ end
+ elseif command == "line" then
+ local wd = packet[2] or 0
+ local ht = packet[3] or 0
+ local dp = packet[4] or 0
+ if wd > 0 and ht ~= 0 and dp ~= 0 then
+ if factor ~= 0 then
+ wd = wd + wd * factor / refactored
+ end
+ if wd > 0 then
+ wd = wd * sx
+ ht = ht * sy
+ dp = dp * sy
+ local color = packet[5] -- no longer needed probably
+ if color then
+ vfinjectors.startcolor(pos_h,pos_v,color) -- takes packet or string
+ end
+ flushsimplerule(pos_h,pos_v-dp,pos_r,wd,ht+dp)
+ if color then
+ vfinjectors.stopcolor()
+ end
+ pos_h = pos_h + wd
+ end
+ end
+ elseif command == "font" then
+ local index = packet[2]
+ local okay = fonts and fonts[index]
+ if okay then
+ fnt = okay.id or fnt -- or maybe just return
+ end
+ elseif command == "lua" then
+ local code = packet[2]
+ local kind = type(code)
+ if kind ~= "function" then
+ code = loadstring(code)
+ kind = type(code)
+ end
+ if kind == "function" then
+ code(font,char,pos_h,pos_v,sx,sy) -- maybe also packet
+ end
+ elseif command == "node" then
+ local h = packet[2]
+ hlist_out(h,getlist(h))
+ -- elseif command == "pdf" then
+ -- unsupported
+ -- elseif command == "pdfmode" then
+ -- unsupported
+ -- elseif command == "special" then
+ -- unsupported
+ -- elseif command == "nop" then
+ -- just ignored
+ -- elseif command == "image" then
+ -- unsupported, use "node"
+ elseif command == "inspect" then
+ inspect(vfcommands)
+ elseif command == "trace" then
+ report("virtual state: h=%p v=%p d=%i",pos_h,pos_v,pos_r)
+ else
+ local injector = vfinjectors[command]
+ if injector then
+ injector(pos_h,pos_v,packet) -- maybe also sx, sy but then we need to check usage
+ end
end
end
- -- image : not needed, maybe some day
- -- pdfmode : not used
- -- special : makes no sense
- -- nop : the official ignore
- -- scale : not supported
end
+ -- pop() -- or:
+
pos_h = saved_h
pos_v = saved_v
pos_r = saved_r
+ if savedlevel ~= level then
+ report("")
+ report("virtual state: stack is corrupt")
+ report("")
+ end
+ level = savedlevel
+
nesting = nesting - 1
+
end
local onetimemessage -- could be defined later (todo: make plug for this)
- local getxyscales = nuts.getxyscales
-
- flush_character = function(current,font,char,factor,vfcommands,pos_h,pos_v,pos_r,f,e)
+ flush_character = function(current,font,char,factor,vfcommands,pos_h,pos_v,pos_r,csx,csy)
if font ~= lastfont then
lastfont = font
fontcharacters = characters[font]
- updatefontstate(font)
+ updatefontstate(font) -- can move to lpdf-lmt, cleaner
end
local data = fontcharacters[char]
@@ -445,20 +599,25 @@ local flush_character do
end
return 0, 0, 0
end
+
if vfcommands then
vfcommands = data.commands
end
local width, height, depth, naturalwidth, sx, sy
if current then
- naturalwidth, height, depth, factor = getwhd(current,true) -- also get corrected width
- sx, sy = getxyscales(current) -- maybe: getwhdfs
- if factor == 0 then
- width = naturalwidth
- else
- -- width = (1.0 + factor/1000000.0) * naturalwidth
- width = naturalwidth + naturalwidth * factor/1000000.0
- -- width = naturalwidth + naturalwidth * 0.000001 * factor
- end
+ -- if true then
+ width, height, depth, factor, sx, sy = getglyphdimensions(current)
+ -- else
+ -- naturalwidth, height, depth, factor = getwhd(current,true) -- also get corrected width
+ -- sx, sy = getxyscales(current)
+ -- if factor == 0 then
+ -- width = naturalwidth
+ -- else
+ -- -- width = (1.0 + factor/1000000.0) * naturalwidth
+ -- width = naturalwidth + naturalwidth * factor/1000000.0
+ -- -- width = naturalwidth + naturalwidth * 0.000001 * factor
+ -- end
+ -- end
else
width = data.width or 0
height = data.height or 0
@@ -474,24 +633,16 @@ local flush_character do
pos_h = pos_h - width -- here ?
end
if vfcommands then
- flush_vf_packet(current,pos_h,pos_v,pos_r,font,char,data,factor,vfcommands,sx,sy) -- also f ?
+ flush_vf_packet(current,pos_h,pos_v,pos_r,font,char,data,csx,csy,factor,sx,sy,vfcommands)
else
- -- kind of messy that we do orientation here and offsets elsewhere .. this might change
- local orientation = data.orientation
+ local orientation = data.orientation -- 0 (none), 1, 2, 3 or 4 (none)
if orientation and (orientation == 1 or orientation == 3) then
- local x = data.xoffset
- local y = data.yoffset
- if x then
- pos_h = pos_h + x
- end
- if y then
- pos_v = pos_v + y
- end
+ -- we can get weird charactersbox tracing here
pushorientation(orientation,pos_h,pos_v)
- flushcharacter(current,pos_h,pos_v,pos_r,font,char,data,f,e,factor,sx,sy) -- ,naturalwidth,width)
+ flushcharacter(current,pos_h,pos_v,pos_r,font,char,data,csx,csy,factor,sx,sy)
poporientation(orientation,pos_h,pos_v)
else
- flushcharacter(current,pos_h,pos_v,pos_r,font,char,data,f,e,factor,sx,sy) -- ,naturalwidth,width)
+ flushcharacter(current,pos_h,pos_v,pos_r,font,char,data,csx,csy,factor,sx,sy)
end
end
return width, height, depth
@@ -510,8 +661,6 @@ local function reset_state()
shippingmode = "none"
page_size_h = 0
page_size_v = 0
- -- page_h_origin = 0 -- trueinch
- -- page_v_origin = 0 -- trueinch
end
-- local function dirstackentry(t,k)
@@ -527,23 +676,67 @@ end
--
-- local dirstack = setmetatableindex(dirstackentry)
--
--- local function reset_dir_stack()
+-- local function reset_directions()
-- dirstack = setmetatableindex(dirstackentry)
-- end
local dirstack = { }
+local anchors = { }
+local befores = setmetatableindex("table")
+local afters = setmetatableindex("table")
+local stired = false
-local function reset_dir_stack()
+local function reset_directions()
dirstack = { }
end
+local function reset_anchors()
+ anchors = { }
+end
+
+interfaces.implement {
+ name = "registeranchorbox",
+ public = true,
+ protected = true,
+ arguments = { "integer", "integer", "box" },
+ actions = function(anchor,where,box)
+ box = tonut(box)
+ insert(where < 0 and befores[anchor] or afters[anchor],box)
+ stored = true
+ end
+}
+
local hlist_out, vlist_out do
- local function applyanchor(orientation,x,y,width,height,depth,woffset,hoffset,doffset,xoffset,yoffset)
- local ot = extract(orientation, 0,4)
- local ay = extract(orientation, 4,4)
- local ax = extract(orientation, 8,4)
- local of = extract(orientation,12,4)
+ local finalize = nodes.handlers.finalizelist
+ local flushnode = nuts.flushnode
+
+ local function flushstored(current,source,before)
+ local t = before and befores or afters
+ local s = rawget(t,source)
+ if s then
+ for i=1,#s do
+ local si = s[i]
+ if si then
+ local box = si -- si[1]
+ finalize(box) -- tricky: we might need to group
+ if getid(box) == vlist_code then
+ vlist_out(current,box)
+ else
+ hlist_out(current,box)
+ end
+ flushnode(box)
+ s[i] = false
+ end
+ end
+ rawset(t,source,nil)
+ end
+ end
+
+ local function applyorientation(orientation,x,y,width,height,depth,woffset,hoffset,doffset,xoffset,yoffset)
+ local ot = (orientation >> 0) & 0x0F
+ local ay = (orientation >> 4) & 0x0F
+ local ax = (orientation >> 8) & 0x0F
if ot == 4 then
ot, ay = 0, 1
elseif ot == 5 then
@@ -581,32 +774,73 @@ local hlist_out, vlist_out do
return ot, x + xoffset, y - yoffset
end
- -- to be checked: begin- or enddir kan nil zijn, weird
+ local function applyanchor(anchor,shift,anchor_h,anchor_v,width,height,depth)
+ local h = 0
+ local v = 0
+ local a = anchor & 0x00FF
+ local s = anchor & 0x0F00
+ if a == 0x02 then
+ v = height
+ elseif a == 0x03 then
+ v = - depth
+ elseif a == 0x04 then
+ h = width
+ elseif a == 0x05 then
+ h = width
+ v = height
+ elseif a == 0x06 then
+ h = width
+ v = - depth
+ elseif a == 0x07 then
+ h = width/2
+ elseif a == 0x08 then
+ h = width/2
+ v = height
+ elseif a == 0x09 then
+ h = width/2
+ v = - depth
+ elseif a == 0x0A then -- halfway_total_anchor
+ h = width/2
+ v = height/2 - depth/2
+ elseif a == 0x0B then -- halfway_height_anchor
+ h = width/2
+ v = height/2
+ elseif a == 0x0C then -- halfway_depth_anchor
+ h = width/2
+ v = - depth/2
+ elseif a == 0x0D then -- halfway_left_anchor
+ v = height/2 - depth/2
+ elseif a == 0x0E then -- halfway_right_anchor
+ h = width
+ v = height/2 - depth/2
+ end
+ if not shift then
+ h = -h
+ v = -v
+ end
+ if s == 0x100 then
+ h = -h
+ elseif s == 0x200 then
+ v = -v
+ elseif s == 0x300 then
+ h = -h
+ v = -v
+ else
+ end
+ anchor_h = anchor_h + h
+ anchor_v = anchor_v + v
+ return anchor_h, anchor_v
+ end
- -- local function calculate_width_to_enddir(this_box,begindir) -- can be a helper
- -- local dir_nest = 1
- -- local enddir = begindir
- -- for current, subtype in nextdir, getnext(begindir) do
- -- if subtype == normaldir_code then -- todo
- -- dir_nest = dir_nest + 1
- -- else
- -- dir_nest = dir_nest - 1
- -- end
- -- if dir_nest == 0 then -- does the type matter
- -- enddir = current
- -- local width = rangedimensions(this_box,begindir,enddir)
- -- return enddir, width
- -- end
- -- end
- -- if enddir == begindir then
- -- local width = rangedimensions(this_box,begindir) -- ,enddir)
- -- return enddir, width
- -- end
- -- return enddir, 0
- -- end
+ drivers.applyanchor = applyanchor
+ drivers.applyorientation = applyorientation
+
+ -- to be checked: begin- or enddir kan nil zijn, weird
-- check frequencies of nodes
+ local eps <const> = 10
+
hlist_out = function(this_box,current)
local ref_h = pos_h
local ref_v = pos_v
@@ -617,7 +851,7 @@ local hlist_out, vlist_out do
boxdepth = getwhd(this_box)
local cur_h = 0
- local cur_v = 0
+ -- local cur_v = 0
-- if not current then
-- current = getlist(this_box)
@@ -635,26 +869,30 @@ local hlist_out, vlist_out do
else
pos_h = ref_h + (cur_h + x_offset)
end
- pos_v = ref_v - (cur_v - y_offset)
+ -- pos_v = ref_v - (cur_v - y_offset)
+ pos_v = ref_v + y_offset
-- synced
end
pos_v = pos_v + raise
pos_h = pos_h - left
local wd = flush_character(current,font,char,false,true,pos_h,pos_v,pos_r)
- cur_h = cur_h + wd - right
+ -- cur_h = cur_h + wd - right -- hm, no left here?
+ cur_h = cur_h + wd -- see new tabulate alignment code
elseif id == glue_code then
- local gluewidth = effectiveglue(current,this_box)
+ -- local gluewidth = effectiveglue(current,this_box)
+ local gluewidth = effectiveglue(current,this_box,true)
if gluewidth ~= 0 then
if subtype >= leaders_code then
local leader = getleader(current)
if leader then
- local width, height, depth = getwhd(leader)
- if getid(leader) == rule_code then
+ local id = getid(leader)
+ if id == rule_code then
if gluewidth > 0 then
- if height == running then
+ local width, height, depth = getwhd(leader)
+ if height == runningrule then
height = boxheight
end
- if depth == running then
+ if depth == runningrule then
depth = boxdepth
end
local total = height + depth
@@ -667,67 +905,113 @@ local hlist_out, vlist_out do
end
cur_h = cur_h + gluewidth
end
- elseif width > 0 and gluewidth > 0 then
- local boxdir = getdirection(leader) or lefttoright_code
- gluewidth = gluewidth + 10
- local edge = cur_h + gluewidth
- local lx = 0
- if subtype == gleaders_code then
- local save_h = cur_h
- if pos_r == righttoleft_code then
- cur_h = ref_h - shipbox_h - cur_h
- cur_h = width * (cur_h / width)
- cur_h = ref_h - shipbox_h - cur_h
- else
- cur_h = cur_h + ref_h - shipbox_h
- cur_h = width * (cur_h / width)
- cur_h = cur_h - ref_h - shipbox_h
- end
- if cur_h < save_h then
- cur_h = cur_h + width
- end
- elseif subtype == leaders_code then
- local save_h = cur_h
- cur_h = width * (cur_h / width)
- if cur_h < save_h then
- cur_h = cur_h + width
- end
- else
- lq = gluewidth / width
- lr = gluewidth % width
- if subtype == cleaders_code then
+ elseif (id == hlist_code or id == vlist_code or id == glyph_code) and gluewidth > 0 then
+ local width, height, depth = getwhd(leader)
+ -- no need for //
+ if width > 0 then
+ gluewidth = gluewidth + eps
+ local edge = cur_h + gluewidth
+ local lx = 0
+ if subtype == gleaders_code then
+ local save_h = cur_h
+ if pos_r == righttoleft_code then
+ cur_h = ref_h - shipbox_h + cur_h
+ cur_h = width * (cur_h / width)
+ cur_h = ref_h - shipbox_h - cur_h
+ else
+ cur_h = ref_h - shipbox_h - cur_h
+ cur_h = width * (cur_h / width)
+ cur_h = ref_h - shipbox_h - cur_h
+ end
+ if cur_h < save_h then
+ cur_h = cur_h + width
+ end
+ local lr = gluewidth % width
cur_h = cur_h + lr / 2
+ elseif subtype == leaders_code then
+ local save_h = cur_h
+ cur_h = width * (cur_h / width)
+ if cur_h < save_h then
+ cur_h = cur_h + width
+ end
else
- lx = lr / (lq + 1)
- cur_h = cur_h + (lr - (lq - 1) * lx) / 2
- end
- end
- local shift = getshift(leader)
- pushleaderlevel()
- while cur_h + width <= edge do
- local basepoint_h = 0
- -- local basepoint_v = shift
- if boxdir ~= pos_r then
- basepoint_h = boxwidth
- end
- -- synch_pos_with_cur(ref_h,ref_v,cur_h + basepoint_h,shift)
- if pos_r == righttoleft_code then
- pos_h = ref_h - (cur_h + basepoint_h)
- else
- pos_h = ref_h + (cur_h + basepoint_h)
+ local lq = gluewidth / width
+ local lr = gluewidth % width
+ if subtype == cleaders_code then
+ cur_h = cur_h + lr / 2
+ else
+ lx = lr / (lq + 1)
+ cur_h = cur_h + (lr - (lq - 1) * lx) / 2
+ end
end
- pos_v = ref_v - shift
- -- synced
- if getid(leader) == vlist_code then
- vlist_out(leader,getlist(leader))
+ if id == glyph_code then
+ local char, font = isglyph(leader)
+ local x_offset, y_offset, left, right, raise = getoffsets(leader)
+ local h = ref_h
+ local v = ref_v
+ if x_offset ~= 0 or y_offset ~= 0 then
+ if pos_r == righttoleft_code then
+ h = h - x_offset
+ else
+ h = h + x_offset
+ end
+ v = v + y_offset
+ end
+ v = v + raise
+ h = h - left
+ local basepoint_h = 0
+ if boxdir ~= pos_r then
+ basepoint_h = boxwidth
+ end
+ if pos_r == righttoleft_code then
+ pos_h = h - basepoint_h
+ else
+ pos_h = h + basepoint_h
+ end
+ while cur_h + width <= edge do
+ if pos_r == righttoleft_code then
+ pos_h = h - cur_h
+ else
+ pos_h = h + cur_h
+ end
+ pos_v = v
+ flush_character(leader,font,char,false,true,pos_h,pos_v,pos_r)
+ cur_h = cur_h + width + lx
+ end
else
- hlist_out(leader,getlist(leader))
+ local shift = isglyph and 0 or getshift(leader)
+ local boxdir = getdirection(leader) or lefttoright_code
+ pushleaderlevel()
+ while cur_h + width <= edge do
+ -- todo: move some out of loop as above
+ local basepoint_h = 0
+ -- local basepoint_v = shift
+ if boxdir ~= pos_r then
+ basepoint_h = boxwidth
+ end
+ -- synch_pos_with_cur(ref_h,ref_v,cur_h + basepoint_h,shift)
+ if pos_r == righttoleft_code then
+ pos_h = ref_h - (cur_h + basepoint_h)
+ else
+ pos_h = ref_h + (cur_h + basepoint_h)
+ end
+ pos_v = ref_v - shift
+ -- synced
+ if id == vlist_code then
+ vlist_out(leader,getlist(leader))
+ else
+ hlist_out(leader,getlist(leader))
+ end
+ cur_h = cur_h + width + lx
+ end
+ popleaderlevel()
end
- cur_h = cur_h + width + lx
+ cur_h = edge - eps
+ else
+ cur_h = cur_h + gluewidth
end
- popleaderlevel()
- cur_h = edge - 10
else
+ -- maybe some day also glyphs
cur_h = cur_h + gluewidth
end
else
@@ -735,130 +1019,216 @@ local hlist_out, vlist_out do
end
else
if tospace and subtype == spaceskip_code then
- -- todo: flush_space
- flush_character(false,getfont(current),32,false,true,pos_h,pos_v,pos_r) -- we need tp pass current for scale?
+ -- kind of tricky because because we can have a different sx sy
+ flush_character(false,getfont(current),32,false,true,pos_h,pos_v,pos_r) -- we need to pass current for scale?
end
cur_h = cur_h + gluewidth
end
end
elseif id == hlist_code or id == vlist_code then
- local width, height, depth = getwhd(current)
- local list = getlist(current)
+-- local width, height, depth = getwhd(current)
+-- local list = getlist(current)
+-- if list then
+-- local boxdir = getdirection(current) or lefttoright_code
+-- local shift = getshift(current)
+ local width, height, depth, shift, list = getlistdimensions(current)
if list then
- local boxdir = getdirection(current) or lefttoright_code
- local shift, orientation = getshift(current)
- if not orientation then
- local basepoint_h = boxdir ~= pos_r and width or 0
- -- local basepoint_v = shift
- if pos_r == righttoleft_code then
- pos_h = ref_h - (cur_h + basepoint_h)
- else
- pos_h = ref_h + (cur_h + basepoint_h)
- end
- pos_v = ref_v - shift
- -- synced
- if id == vlist_code then
- vlist_out(current,list)
- else
- hlist_out(current,list)
- end
- elseif orientation == 0x1000 then
- local orientation, xoffset, yoffset = getorientation(current)
- local basepoint_h = boxdir ~= pos_r and width or 0
- -- local basepoint_v = shift
- if pos_r == righttoleft_code then
- pos_h = ref_h - (cur_h + basepoint_h + xoffset)
- else
- pos_h = ref_h + (cur_h + basepoint_h + xoffset)
- end
- pos_v = ref_v - (shift - yoffset)
- -- synced
- if id == vlist_code then
- vlist_out(current,list)
- else
- hlist_out(current,list)
- end
- else
+-- local boxdir = getdirection(current) or lefttoright_code
+-- local geometry, hasoffset, hasorientation, hasanchor = getgeometry(current,true)
+ local geometry, hasoffset, hasorientation, hasanchor, boxdir = getgeometry(current,true)
+ local anchor, source, target, targetdata, s_anchor, t_anchor
+ local anc_h, anc_v
+ local usedorientation = false
+ if hasanchor then
+ anchor, source, target, s_anchor, t_anchor = getanchors(current)
+ end
+ if hasorientation then
local orientation, xoffset, yoffset, woffset, hoffset, doffset = getorientation(current)
- local orientation, basepoint_h, basepoint_v = applyanchor(orientation,0,shift,width,height,depth,woffset,hoffset,doffset,xoffset,yoffset)
+ local orientation, basepoint_h, basepoint_v = applyorientation(orientation,0,shift,width,height,depth,woffset,hoffset,doffset,xoffset,yoffset)
if orientation == 1 then
basepoint_h = basepoint_h + doffset
if boxdir == pos_r then
basepoint_v = basepoint_v - height
end
+ usedorientation = orientation
elseif orientation == 2 then
if boxdir == pos_r then
basepoint_h = basepoint_h + width
end
+ usedorientation = orientation
elseif orientation == 3 then
basepoint_h = basepoint_h + hoffset
if boxdir ~= pos_r then
basepoint_v = basepoint_v - height
end
+ usedorientation = orientation
+ end
+ if target then
+ targetdata = anchors[target]
+ if targetdata then
+ anc_h = basepoint_h
+ anc_v = - basepoint_v
+ goto posdone
+ end
end
if pos_r == righttoleft_code then
pos_h = ref_h - (cur_h + basepoint_h)
else
pos_h = ref_h + (cur_h + basepoint_h)
end
- pos_v = ref_v - (cur_v + basepoint_v)
- -- synced
- pushorientation(orientation,pos_h,pos_v,pos_r)
- if id == vlist_code then
- vlist_out(current,list)
+ -- pos_v = ref_v - (cur_v + basepoint_v)
+ pos_v = ref_v - basepoint_v
+ elseif hasoffset then
+-- local orientation, xoffset, yoffset = getorientation(current)
+ local xoffset, yoffset = getoffsets(current)
+ local basepoint_h = boxdir ~= pos_r and width or 0
+ local basepoint_v = shift
+ if target then
+ targetdata = anchors[target]
+ if targetdata then
+ anc_h = xoffset + basepoint_h
+ anc_v = yoffset - basepoint_v
+ goto posdone
+ end
+ end
+ if pos_r == righttoleft_code then
+ pos_h = ref_h - (cur_h + basepoint_h + xoffset)
+ else
+ pos_h = ref_h + (cur_h + basepoint_h + xoffset)
+ end
+ pos_v = ref_v - (basepoint_v - yoffset)
+ elseif hasanchor then
+ local basepoint_h = boxdir ~= pos_r and width or 0
+ local basepoint_v = shift
+ if target then
+ targetdata = anchors[target]
+ if targetdata then
+ anc_h = basepoint_h
+ anc_v = - basepoint_v
+ goto posdone
+ end
+ end
+ if pos_r == righttoleft_code then
+ pos_h = ref_h - (cur_h + basepoint_h)
else
- hlist_out(current,list)
+ pos_h = ref_h + (cur_h + basepoint_h)
+ end
+ pos_v = ref_v - basepoint_v
+ else
+ local basepoint_h = boxdir ~= pos_r and width or 0
+ local basepoint_v = shift
+ if pos_r == righttoleft_code then
+ pos_h = ref_h - (cur_h + basepoint_h)
+ else
+ pos_h = ref_h + (cur_h + basepoint_h)
end
- poporientation(orientation,pos_h,pos_v,pos_r)
+ pos_v = ref_v - basepoint_v
+ end
+ goto process
+ ::posdone::
+ if pos_r == righttoleft_code then
+ pos_h = targetdata[1] - anc_h
+ else
+ pos_h = targetdata[1] + anc_h
+ end
+ pos_v = targetdata[2] + anc_v
+ if anchor and anchor > 0 then
+-- pos_h, pos_v = applyanchor(anchor,true,t_anchor,pos_h,pos_v,targetdata[3],targetdata[4],targetdata[5])
+-- pos_h, pos_v = applyanchor(anchor,false,s_anchor,pos_h,pos_v,width,height,depth)
+ pos_h, pos_v = applyanchor(t_anchor,true, pos_h,pos_v,targetdata[3],targetdata[4],targetdata[5])
+ pos_h, pos_v = applyanchor(s_anchor,false,pos_h,pos_v,width,height,depth)
+ end
+ ::process::
+ if source then
+ local anchor_h = pos_h
+ local anchor_v = pos_v
+ if usedorientation then
+ if usedorientation == 1 then
+ anchor_v = anchor_v - (width - height)
+ elseif usedorientation == 2 then
+ anchor_v = anchor_v - (depth - height)
+ elseif usedorientation == 3 then -- weird
+ anchor_v = anchor_v + (height - width)
+ end
+ end
+-- anchor_v = anchor_v + shift
+ anchors[source] = { anchor_h, anchor_v, width, height, depth }
+ end
+ if usedorientation then
+ pushorientation(usedorientation,pos_h,pos_v,pos_r)
+ end
+ if source and stored then
+ flushstored(current,source,true)
+ end
+ if id == vlist_code then
+ vlist_out(current,list)
+ else
+ hlist_out(current,list)
+ end
+ if source and stored then
+ flushstored(current,source,false)
+ end
+ if usedorientation then
+ poporientation(usedorientation,pos_h,pos_v,pos_r)
end
end
cur_h = cur_h + width
elseif id == kern_code then
- -- we can use getkerndimension(current) but then we get rounded values so for
- -- now we calculate ourselves
- local kern, factor = getkern(current,true)
- if kern ~= 0 then
- if factor ~= 0 then
- cur_h = cur_h + (1.0 + factor/1000000.0) * kern
- else
+ -- when we use getkerndimension we get rounded values
+ if true then
+ local kern = getkerndimension(current)
+ if kern ~= 0 then
cur_h = cur_h + kern
end
+ else
+ local kern, factor = getkern(current,true)
+ if kern ~= 0 then
+ if factor ~= 0 then
+ cur_h = cur_h + (1.0 + factor/1000000.0) * kern
+ else
+ cur_h = cur_h + kern
+ end
+ end
end
elseif id == rule_code then
- local width, height, depth = getwhd(current)
+ local width, height, depth, virtual = getruledimensions(current)
if width > 0 then
- if height == running then
+ if height == runningrule then
height = boxheight
end
- if depth == running then
+ if depth == runningrule then
depth = boxdepth
end
local total = height + depth
if total > 0 then
- local xoffset, yoffset, left, right = getoffsets(current) -- top bottom
- if left ~= 0 then
- pos_v = pos_v + left
- total = total - left
- end
- if right ~= 0 then
- depth = depth - right
- total = total - right
- end
+ local xoffset, yoffset, top, bottom = getoffsets(current)
if pos_r == righttoleft_code then
pos_h = pos_h - width
xoffset = - xoffset
end
+ if not virtual then
+ if top ~= 0 then
+ -- height = height - top
+ total = total - top
+ end
+ if bottom ~= 0 then
+ depth = depth - bottom
+ total = total - bottom
+ end
+ end
pos_v = pos_v - depth
flushrule(current,pos_h + xoffset,pos_v + yoffset,pos_r,width,total,subtype)
end
+ if not virtual then
+ cur_h = cur_h + width
+ end
end
- cur_h = cur_h + width
elseif id == math_code then
-- local kern = getkern(current)
-- if kern ~= 0 then
-- cur_h = cur_h + kern
-- else
- cur_h = cur_h + effectiveglue(current,this_box)
+ cur_h = cur_h + effectiveglue(current,this_box,true)
-- end
elseif id == dir_code then
-- We normally have proper begin-end pairs. A begin without end is (silently) handled
@@ -871,7 +1241,7 @@ local hlist_out, vlist_out do
ref_h = ds.ref_h
ref_v = ds.ref_v
cur_h = ds.cur_h
- cur_v = ds.cur_v
+ -- cur_v = ds.cur_v
else
-- pardir
end
@@ -885,7 +1255,7 @@ local hlist_out, vlist_out do
if enddir ~= current then
dirstack[enddir] = {
cur_h = new_h,
- cur_v = cur_v,
+ -- cur_v = cur_v,
ref_h = ref_h,
ref_v = ref_v,
}
@@ -896,12 +1266,13 @@ local hlist_out, vlist_out do
else
pos_h = ref_h + cur_h
end
- pos_v = ref_v - cur_v
+ -- pos_v = ref_v - cur_v
+ pos_v = ref_v
-- synced
ref_h = pos_h
ref_v = pos_v
cur_h = 0
- cur_v = 0
+ -- cur_v = 0
pos_r = dir
goto synced
end
@@ -916,7 +1287,7 @@ local hlist_out, vlist_out do
setlink(current,replace)
setreplace(current)
end
- -- elseif id == par_code and start_of_par(current) then
+ -- elseif id == par_code and startofpar(current) then
-- local pardir = getdirection(current) or lefttoright_code
-- if pardir == righttoleft_code then
-- end
@@ -932,7 +1303,8 @@ local hlist_out, vlist_out do
else
pos_h = ref_h + cur_h
end
- pos_v = ref_v - cur_v
+ -- pos_v = ref_v - cur_v
+ pos_v = ref_v
::synced::
end
pos_h = ref_h
@@ -950,15 +1322,16 @@ local hlist_out, vlist_out do
boxheight,
boxdepth = getwhd(this_box)
- local cur_h = 0
+ local cur_h = 0 -- needs checking .. needed ?
local cur_v = - boxheight
local top_edge = cur_v
- if pos_r == righttoleft_code then
- pos_h = ref_h - cur_h
- else
- pos_h = ref_h + cur_h
- end
+ -- if pos_r == righttoleft_code then
+ -- pos_h = ref_h - cur_h
+ -- else
+ -- pos_h = ref_h + cur_h
+ -- end
+ pos_h = ref_h
pos_v = ref_v - cur_v
-- synced
@@ -970,7 +1343,7 @@ local hlist_out, vlist_out do
-- local id = getid(current)
for current, id, subtype in nextnode, current do
if id == glue_code then
- local glueheight = effectiveglue(current,this_box)
+ local glueheight = effectiveglue(current,this_box,true)
if glueheight ~= 0 then
if subtype >= leaders_code then
local leader = getleader(current)
@@ -981,7 +1354,7 @@ local hlist_out, vlist_out do
depth = 0 -- hm
total = glueheight -- forgotten ... needs testing
if total > 0 then
- if width == running then
+ if width == runningrule then
width = boxwidth
end
if width > 0 then
@@ -1004,19 +1377,21 @@ local hlist_out, vlist_out do
if cur_v < save_v then
cur_v = cur_v + total
end
+ local lr = glueheight % total
+ cur_v = cur_v + lr / 2
elseif subtype == leaders_code then -- aleader
save_v = cur_v
- cur_v = top_edge + total * ((cur_v - top_edge) / total)
+ cur_v = top_edge + total * ((cur_v - top_edge) // total)
if cur_v < save_v then
cur_v = cur_v + total
end
else
- lq = glueheight / total
- lr = glueheight % total
+ local lq = glueheight / total
+ local lr = glueheight % total
if subtype == cleaders_code then
cur_v = cur_v + lr / 2
else
- ly = lr / (lq + 1)
+ ly = lr // (lq + 1)
cur_v = cur_v + (lr - (lq - 1) * ly) / 2
end
end
@@ -1049,102 +1424,189 @@ local hlist_out, vlist_out do
end
end
elseif id == hlist_code or id == vlist_code then
- local width, height, depth = getwhd(current)
- local list = getlist(current)
+-- local width, height, depth = getwhd(current)
+-- local list = getlist(current)
+-- if list then
+-- local boxdir = getdirection(current) or lefttoright_code
+-- local shift = getshift(current)
+ local width, height, depth, shift, list = getlistdimensions(current)
if list then
- local boxdir = getdirection(current) or lefttoright_code
- local shift, orientation = getshift(current)
- if not orientation then
- -- local basepoint_h = shift
- -- local basepoint_v = height
- if boxdir ~= pos_r then
- shift = shift + width
+-- local boxdir = getdirection(current) or lefttoright_code
+-- local geometry, hasoffset, hasorientation, hasanchor = getgeometry(current,true)
+ local geometry, hasoffset, hasorientation, hasanchor, boxdir = getgeometry(current,true)
+ local anchor, source, target, targetdata, s_anchor, t_anchor
+ local usedorientation = false
+ if hasanchor then
+ anchor, source, target, s_anchor, t_anchor = getanchors(current)
+ end
+ if hasorientation then
+ local orientation, xoffset, yoffset, woffset, hoffset, doffset = getorientation(current)
+ local orientation, basepoint_h, basepoint_v = applyorientation(orientation,shift,height,width,height,depth,woffset,hoffset,doffset,xoffset,yoffset)
+ if orientation == 1 then
+ basepoint_h = basepoint_h + width - height -- hm
+ basepoint_v = basepoint_v - height
+ usedorientation = orientation
+ elseif orientation == 2 then
+ basepoint_h = basepoint_h + width
+ basepoint_v = basepoint_v + depth - height
+ usedorientation = orientation
+ elseif orientation == 3 then -- weird
+ basepoint_h = basepoint_h + height
+ usedorientation = orientation
end
- if pos_r == righttoleft_code then
- pos_h = ref_h - shift
- else
- pos_h = ref_h + shift
+ if target then
+ targetdata = anchors[target]
+ if targetdata then
+ if pos_r == righttoleft_code then
+ pos_h = targetdata[1] - basepoint_h
+ else
+ pos_h = targetdata[1] + basepoint_h
+ end
+ pos_v = targetdata[2] - basepoint_v
+ goto posdone
+ end
end
- pos_v = ref_v - (cur_v + height)
- -- synced
- if id == vlist_code then
- vlist_out(current,list)
+ if pos_r == righttoleft_code then
+ pos_h = ref_h - basepoint_h
else
- hlist_out(current,list)
+ pos_h = ref_h + basepoint_h
end
- elseif orientation == 0x1000 then
- local orientation, xoffset, yoffset = getorientation(current)
+ pos_v = ref_v - (cur_v + basepoint_v)
+ elseif hasoffset then
+ -- local orientation, xoffset, yoffset = getorientation(current)
+ local xoffset, yoffset = getoffsets(current)
-- local basepoint_h = shift
-- local basepoint_v = height
if boxdir ~= pos_r then
shift = shift + width
end
+ if target then
+ targetdata = anchors[target]
+ if targetdata then
+ if pos_r == righttoleft_code then
+ pos_h = targetdata[1] - (shift + xoffset)
+ else
+ pos_h = targetdata[1] + (shift + xoffset)
+ end
+ pos_v = targetdata[2] - (height - yoffset)
+ goto posdone
+ end
+ end
if pos_r == righttoleft_code then
pos_h = ref_h - (shift + xoffset)
else
pos_h = ref_h + (shift + xoffset)
end
pos_v = ref_v - (cur_v + height - yoffset)
- -- synced
- if id == vlist_code then
- vlist_out(current,list)
+ elseif hasanchor then
+ -- local basepoint_h = shift
+ -- local basepoint_v = height
+ if boxdir ~= pos_r then
+ shift = shift + width
+ end
+ if target then
+ local a = anchors[target]
+ if a then
+ if pos_r == righttoleft_code then
+ pos_h = targetdata[1] - shift
+ else
+ pos_h = targetdata[1] + shift
+ end
+ pos_v = targetdata[2] - height
+ goto posdone
+ end
+ end
+ if pos_r == righttoleft_code then
+ pos_h = ref_h - shift
else
- hlist_out(current,list)
+ pos_h = ref_h + shift
end
+ pos_v = ref_v - (cur_v + height)
else
- local orientation, xoffset, yoffset, woffset, hoffset, doffset = getorientation(current)
- local orientation, basepoint_h, basepoint_v = applyanchor(orientation,shift,height,width,height,depth,woffset,hoffset,doffset,xoffset,yoffset)
- if orientation == 1 then
- basepoint_h = basepoint_h + width - height
- basepoint_v = basepoint_v - height
- elseif orientation == 2 then
- basepoint_h = basepoint_h + width
- basepoint_v = basepoint_v + depth - height
- elseif orientation == 3 then -- weird
- basepoint_h = basepoint_h + height
+ -- local basepoint_h = shift
+ -- local basepoint_v = height
+ if boxdir ~= pos_r then
+ shift = shift + width
end
if pos_r == righttoleft_code then
- pos_h = ref_h - basepoint_h
+ pos_h = ref_h - shift
else
- pos_h = ref_h + basepoint_h
+ pos_h = ref_h + shift
end
- pos_v = ref_v - (cur_v + basepoint_v)
- -- synced
- pushorientation(orientation,pos_h,pos_v,pos_r)
- if id == vlist_code then
- vlist_out(current,list)
- else
- hlist_out(current,list)
+ pos_v = ref_v - (cur_v + height)
+ end
+ goto process
+ ::posdone::
+ if anchor and anchor > 0 then
+-- pos_h, pos_v = applyanchor(anchor,true,t_anchor,pos_h,pos_v,targetdata[3],targetdata[4],targetdata[5])
+-- pos_h, pos_v = applyanchor(anchor,false,s_anchor,pos_h,pos_v,width,height,depth)
+ pos_h, pos_v = applyanchor(t_anchor,true, pos_h,pos_v,targetdata[3],targetdata[4],targetdata[5])
+ pos_h, pos_v = applyanchor(s_anchor,false,pos_h,pos_v,width,height,depth)
+ end
+ ::process::
+ if source then
+ -- move this into apply_anchor
+ local anchor_h = pos_h
+ local anchor_v = pos_v
+ if usedorientation then
+ if usedorientation == 1 then
+ anchor_v = anchor_v - (width - height)
+ elseif usedorientation == 2 then
+ anchor_v = anchor_v - (depth - height)
+ elseif usedorientation == 3 then -- weird
+ anchor_v = anchor_v + (height - width)
+ end
end
- poporientation(orientation,pos_h,pos_v,pos_r)
+ anchors[source] = { anchor_h, anchor_v, width, height, depth }
+ end
+ if usedorientation then
+ pushorientation(usedorientation,pos_h,pos_v,pos_r)
+ end
+ if source and stored then
+ flushstored(current,source,true)
+ end
+ if id == vlist_code then
+ vlist_out(current,list)
+ else
+ hlist_out(current,list)
+ end
+ if source and stored then
+ flushstored(current,source,false)
+ end
+ if usedorientation then
+ poporientation(usedorientation,pos_h,pos_v,pos_r)
end
end
cur_v = cur_v + height + depth
elseif id == kern_code then
cur_v = cur_v + getkern(current)
elseif id == rule_code then
- local width, height, depth = getwhd(current)
+ local width, height, depth, virtual = getruledimensions(current)
local total = height + depth
if total > 0 then
- if width == running then
+ if width == runningrule then
width = boxwidth
end
if width > 0 then
local xoffset, yoffset, left, right = getoffsets(current)
- if left ~= 0 then
- width = width - left
- xoffset = left
- end
- if right ~= 0 then
- width = width - right
+ if not virtual then
+ if left ~= 0 then
+ width = width - left
+ xoffset = left
+ end
+ if right ~= 0 then
+ width = width - right
+ end
end
if pos_r == righttoleft_code then
xoffset = - xoffset - width
end
flushrule(current,pos_h + xoffset,pos_v - total - yoffset,pos_r,width,total,subtype)
end
+ if not virtual then
+ cur_v = cur_v + total
+ end
end
- cur_v = cur_v + total
elseif id == whatsit_code then
flushwhatsit[subtype](current,pos_h,pos_v)
else
@@ -1202,7 +1664,8 @@ function drivers.converters.lmtx(driver,box,smode,objnum,specification)
flushliteral = flushers.literal
flushwhatsit = flushers.whatsit
- reset_dir_stack()
+ reset_directions()
+ reset_anchors()
reset_state()
shippingmode = smode
@@ -1213,28 +1676,10 @@ function drivers.converters.lmtx(driver,box,smode,objnum,specification)
local total = height + depth
- ----- v_offset_par = 0
- ----- h_offset_par = 0
-
- local max_v = total -- + v_offset_par
- local max_h = width -- + h_offset_par
-
- if height > maxdimen or depth > maxdimen or width > maxdimen then
+ if height > maxdimen or depth > maxdimen or width > maxdimen or total > maxdimen then
goto DONE
end
- if max_v > maxdimen then
- goto DONE
- elseif max_v > abs_max_v then
- abs_max_v = max_v
- end
-
- if max_h > maxdimen then
- goto DONE
- elseif max_h > abs_max_h then
- abs_max_h = max_h
- end
-
if shippingmode == "page" then
-- We have zero offsets in ConTeXt.
@@ -1271,11 +1716,11 @@ function drivers.converters.lmtx(driver,box,smode,objnum,specification)
else
- page_size_h = width
- page_size_v = total
- pos_r = getdirection(box)
- pos_v = depth
- pos_h = pos_r == righttoleft_code and width or 0
+ page_size_h = width
+ page_size_v = total
+ pos_r = getdirection(box)
+ pos_v = depth
+ pos_h = pos_r == righttoleft_code and width or 0
end
@@ -1316,15 +1761,20 @@ do
----- tonut = nodes.tonut
local properties = nodes.properties.data
local flush = texio.write
- local flushline = texio.write_nl
+ local flushline = texio.writenl
local periods = utilities.strings.newrepeater(".")
- local function showdetails(n,l)
+ local f_detail_0 = formatters["%s %s = %s"]
+ local f_detail_1 = formatters["%i: %s %s = %s"]
+ local f_detail_2 = formatters["%i:%i: %s %s = %s"]
+
+ local function showdetails(n,l,tlp,l1,l2)
local p = properties[tonut(n)]
if p then
for k, v in sortedhash(p) do
local t = type(v)
+ local p = periods[l+1]
if t == "string" then
if find(v,"[\n\r]") then
v = "\n" .. stripstring(v) .. "\n"
@@ -1336,7 +1786,15 @@ do
else
v = "<" .. tostring(v) .. ">"
end
- flushline(periods[l+1] .. " " .. k .. " = " .. v)
+ if tlp == 3 then
+ flushline(f_detail_2(l1,l2,p,k,v))
+ elseif tlp == 2 then
+ flushline(f_detail_1(l2,p,k,v))
+ elseif tlp == 1 then
+ flushline(f_detail_1(l1,p,k,v))
+ else
+ flushline(f_detail_0(p,k,v))
+ end
end
end
end
@@ -1346,13 +1804,23 @@ do
literal = showdetails,
}
- callback.register("show_whatsit",function(n,l)
+ callback.register("show_whatsit",function(n,what,l,tlp,l1,l2)
local s = nodes.whatsitcodes[n.subtype]
- flush(" [" .. s .. "]")
- local w = whatsittracers[s]
- if w then
- w(n,l)
+ if what == 1 then
+ return s or "unknown"
+ -- elseif what == 2 then
+ else
+ local w = whatsittracers[s]
+ if w then
+ w(n,l,tlp,l1,l2)
+ end
end
end)
+ local names = attributes.names
+
+ callback.register("get_attribute",function(k,v)
+ return attributes.names[k], nil -- we show the name and number
+ end)
+
end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/driv-shp.mkxl b/Master/texmf-dist/tex/context/base/mkxl/driv-shp.mkxl
index 199215a59ea..6364d6dc4f6 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/driv-shp.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/driv-shp.mkxl
@@ -11,7 +11,8 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\registerctxluafile{driv-shp}{autosuffix,optimize}
+\registerctxluafile{driv-shp}{autosuffix}
+\registerctxluafile{driv-usr}{autosuffix}
\unprotect
diff --git a/Master/texmf-dist/tex/context/base/mkxl/driv-usr.lmt b/Master/texmf-dist/tex/context/base/mkxl/driv-usr.lmt
new file mode 100644
index 00000000000..0542228aace
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/driv-usr.lmt
@@ -0,0 +1,585 @@
+if not modules then modules = { } end modules ['driv-shp'] = {
+ version = 1.001,
+ optimize = true,
+ comment = "companion to driv-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local nuts = nodes.nuts
+local tonut = nodes.tonut
+
+local getdirection = nuts.getdirection
+local getlist = nuts.getlist
+local getoffsets = nuts.getoffsets
+local getorientation = nuts.getorientation
+local getanchors = nuts.getanchors
+local getgeometry = nuts.getgeometry
+local getwhd = nuts.getwhd
+local getkern = nuts.getkern
+local getwidth = nuts.getwidth
+local getheight = nuts.getheight
+local getdepth = nuts.getdepth
+local getnext = nuts.getnext
+local getid = nuts.getid
+local getshift = nuts.getshift
+local getprop = nuts.getprop
+local getreplace = nuts.getreplace
+local setreplace = nuts.setreplace
+----- getkerndimension = nuts.getkerndimension
+----- getglyphdimensions = nuts.getglyphdimensions
+
+local setdirection = nuts.setdirection
+local setlink = nuts.setlink
+
+local nextnode = nuts.traversers.node
+
+local effectiveglue = nuts.effectiveglue
+local dirdimensions = nuts.dirdimensions
+
+local nodecodes = nodes.nodecodes
+local whatsitcodes = nodes.whatsitcodes
+local dirvalues = nodes.dirvalues
+
+local lefttoright_code = dirvalues.lefttoright
+local righttoleft_code = dirvalues.righttoleft
+
+local glyph_code = nodecodes.glyph
+local kern_code = nodecodes.kern
+local glue_code = nodecodes.glue
+local hlist_code = nodecodes.hlist
+local vlist_code = nodecodes.vlist
+local dir_code = nodecodes.dir
+local disc_code = nodecodes.disc
+local math_code = nodecodes.math
+local rule_code = nodecodes.rule
+local whatsit_code = nodecodes.whatsit
+
+local userdefined_code = nodes.whatsitcodes.userdefined
+
+local drivers = drivers
+
+local report = logs.reporter("drivers")
+
+local magicconstants = tex.magicconstants
+local maxdimen = magicconstants.maxdimen
+
+local pos_h = 0
+local pos_v = 0
+local pos_r = lefttoright_code
+
+local applyorientation = drivers.applyorientation
+local applyanchor = drivers.applyanchor
+
+local initialize
+local finalize
+local userdefined
+
+local function reset_state()
+ pos_h = 0
+ pos_v = 0
+ pos_r = lefttoright_code
+end
+
+local dirstack = { }
+
+local function reset_dir_stack()
+ dirstack = { }
+end
+
+local function handlewhatsit(current,pos_h,pos_v)
+ local action = userdefined[getprop(current,"id")]
+ if action then
+ action(current,pos_h,pos_v)
+ end
+end
+
+local hlist_out, vlist_out -- todo: some can be combined
+
+hlist_out = function(this_box,current)
+ local ref_h = pos_h
+ local ref_v = pos_v
+ local ref_r = pos_r
+ pos_r = getdirection(this_box)
+ local cur_h = 0
+ local cur_b
+
+ for current, id, subtype in nextnode, current do
+ if id == glyph_code then -- or id == kern_code
+ local width, factor = getwidth(current,true)
+ if width ~= 0 then
+ if factor ~= 0 then
+ cur_h = cur_h + (1.0 + factor/1000000.0) * width
+ else
+ cur_h = cur_h + width
+ end
+ end
+ elseif id == glue_code then
+-- cur_h = cur_h + effectiveglue(current,this_box)
+cur_h = cur_h + effectiveglue(current,this_box,true)
+ elseif id == hlist_code or id == vlist_code then
+ local width, height, depth = getwhd(current)
+ local list = getlist(current)
+ if list then
+ local boxdir = getdirection(current) or lefttoright_code
+ local shift = getshift(current)
+ local geometry, hasoffset, hasorientation, hasanchor = getgeometry(current,true)
+ local anchor, source, target, targetdata, s_anchor, t_anchor
+ local anc_h, anc_v
+ local usedorientation = false
+ if hasanchor then
+ anchor, source, target, s_anchor, t_anchor = getanchors(current)
+ end
+ if hasorientation then
+ local orientation, xoffset, yoffset, woffset, hoffset, doffset = getorientation(current)
+ local orientation, basepoint_h, basepoint_v = applyorientation(orientation,0,shift,width,height,depth,woffset,hoffset,doffset,xoffset,yoffset)
+ if orientation == 1 then
+ basepoint_h = basepoint_h + doffset
+ if boxdir == pos_r then
+ basepoint_v = basepoint_v - height
+ end
+ usedorientation = orientation
+ elseif orientation == 2 then
+ if boxdir == pos_r then
+ basepoint_h = basepoint_h + width
+ end
+ usedorientation = orientation
+ elseif orientation == 3 then
+ basepoint_h = basepoint_h + hoffset
+ if boxdir ~= pos_r then
+ basepoint_v = basepoint_v - height
+ end
+ usedorientation = orientation
+ end
+ if target then
+ targetdata = anchors[target]
+ if targetdata then
+ anc_h = basepoint_h
+ anc_v = - basepoint_v
+ goto posdone
+ end
+ end
+ if pos_r == righttoleft_code then
+ pos_h = ref_h - (cur_h + basepoint_h)
+ else
+ pos_h = ref_h + (cur_h + basepoint_h)
+ end
+ -- pos_v = ref_v - (cur_v + basepoint_v)
+ pos_v = ref_v - basepoint_v
+ elseif hasoffset then
+ local orientation, xoffset, yoffset = getorientation(current)
+ local basepoint_h = boxdir ~= pos_r and width or 0
+ local basepoint_v = shift
+ if target then
+ targetdata = anchors[target]
+ if targetdata then
+ anc_h = xoffset + basepoint_h
+ anc_v = yoffset - basepoint_v
+ goto posdone
+ end
+ end
+ if pos_r == righttoleft_code then
+ pos_h = ref_h - (cur_h + basepoint_h + xoffset)
+ else
+ pos_h = ref_h + (cur_h + basepoint_h + xoffset)
+ end
+ pos_v = ref_v - (basepoint_v - yoffset)
+ elseif hasanchor then
+ local basepoint_h = boxdir ~= pos_r and width or 0
+ local basepoint_v = shift
+ if target then
+ targetdata = anchors[target]
+ if targetdata then
+ anc_h = basepoint_h
+ anc_v = - basepoint_v
+ goto posdone
+ end
+ end
+ if pos_r == righttoleft_code then
+ pos_h = ref_h - (cur_h + basepoint_h)
+ else
+ pos_h = ref_h + (cur_h + basepoint_h)
+ end
+ pos_v = ref_v - basepoint_v
+ else
+ local basepoint_h = boxdir ~= pos_r and width or 0
+ local basepoint_v = shift
+ if pos_r == righttoleft_code then
+ pos_h = ref_h - (cur_h + basepoint_h)
+ else
+ pos_h = ref_h + (cur_h + basepoint_h)
+ end
+ pos_v = ref_v - basepoint_v
+ end
+ goto process
+ ::posdone::
+ if pos_r == righttoleft_code then
+ pos_h = targetdata[1] - anc_h
+ else
+ pos_h = targetdata[1] + anc_h
+ end
+ pos_v = targetdata[2] + anc_v
+ if anchor and anchor > 0 then
+ pos_h, pos_v = applyanchor(t_anchor,true, pos_h,pos_v,targetdata[3],targetdata[4],targetdata[5])
+ pos_h, pos_v = applyanchor(s_anchor,false,pos_h,pos_v,width,height,depth)
+ end
+ ::process::
+ if source then
+ local anchor_h = pos_h
+ local anchor_v = pos_v
+ if usedorientation then
+ if usedorientation == 1 then
+ anchor_v = anchor_v - (width - height)
+ elseif usedorientation == 2 then
+ anchor_v = anchor_v - (depth - height)
+ elseif usedorientation == 3 then -- weird
+ anchor_v = anchor_v + (height - width)
+ end
+ end
+ anchors[source] = { anchor_h, anchor_v, width, height, depth }
+ end
+ -- if usedorientation then
+ -- pushorientation(usedorientation,pos_h,pos_v,pos_r)
+ -- end
+ if id == vlist_code then
+ vlist_out(current,list)
+ else
+ hlist_out(current,list)
+ end
+ -- if usedorientation then
+ -- poporientation(usedorientation,pos_h,pos_v,pos_r)
+ -- end
+ end
+ cur_h = cur_h + width
+
+ elseif id == kern_code then
+ local kern, factor = getkern(current,true)
+ if kern ~= 0 then
+ if factor ~= 0 then
+ cur_h = cur_h + (1.0 + factor/1000000.0) * kern
+ else
+ cur_h = cur_h + kern
+ end
+ end
+ elseif id == rule_code then
+ cur_h = cur_h + getwidth(current)
+ elseif id == math_code then
+-- cur_h = cur_h + effectiveglue(current,this_box)
+cur_h = cur_h + effectiveglue(current,this_box,true)
+ elseif id == dir_code then
+ local dir, cancel = getdirection(current)
+ if cancel then
+ local ds = dirstack[current]
+ if ds then
+ ref_h = ds.ref_h
+ ref_v = ds.ref_v
+ cur_h = ds.cur_h
+ end
+ pos_r = dir
+ else
+ local width, enddir = dirdimensions(this_box,current)
+ local new_h = cur_h + width
+ if dir ~= pos_r then
+ cur_h = new_h
+ end
+ if enddir ~= current then
+ dirstack[enddir] = {
+ cur_h = new_h,
+ ref_h = ref_h,
+ ref_v = ref_v,
+ }
+ setdirection(enddir,pos_r)
+ end
+ if pos_r == righttoleft_code then
+ pos_h = ref_h - cur_h
+ else
+ pos_h = ref_h + cur_h
+ end
+ pos_v = ref_v
+ ref_h = pos_h
+ ref_v = pos_v
+ cur_h = 0
+ pos_r = dir
+ goto synced
+ end
+ elseif id == whatsit_code then
+ if subtype == userdefined_code then
+ local action = userdefined[getprop(current,"id")]
+ if action then
+ if not cur_b then
+ local wd, ht, dp = getwhd(this_box)
+ cur_b = { wd, ht, dp, ref_h, ref_v, ref_r }
+ end
+ action(current, pos_h,pos_v, cur_b)
+ end
+ end
+ elseif id == disc_code then
+ local replace, tail = getreplace(current)
+ if replace then
+ setlink(tail,getnext(current))
+ setlink(current,replace)
+ setreplace(current)
+ end
+ else
+ goto synced
+ end
+ if pos_r == righttoleft_code then
+ pos_h = ref_h - cur_h
+ else
+ pos_h = ref_h + cur_h
+ end
+ pos_v = ref_v
+ ::synced::
+ end
+ pos_h = ref_h
+ pos_v = ref_v
+ pos_r = ref_r
+end
+
+vlist_out = function(this_box,current)
+ local ref_h = pos_h
+ local ref_v = pos_v
+ local ref_r = pos_r
+ pos_r = getdirection(this_box)
+ local cur_v = - getheight(this_box)
+ local top_edge = cur_v
+ pos_h = ref_h
+ pos_v = ref_v - cur_v
+ local cur_b
+
+ for current, id, subtype in nextnode, current do
+ if id == glue_code then
+-- cur_v = cur_v + effectiveglue(current,this_box)
+cur_v = cur_v + effectiveglue(current,this_box,true)
+ elseif id == hlist_code or id == vlist_code then
+ local width, height, depth = getwhd(current)
+ local list = getlist(current)
+ if list then
+ local boxdir = getdirection(current) or lefttoright_code
+ local shift = getshift(current)
+ local geometry, hasoffset, hasorientation, hasanchor = getgeometry(current,true)
+ local anchor, source, target, targetdata, s_anchor, t_anchor
+ local usedorientation = false
+ if hasanchor then
+ anchor, source, target, s_anchor, t_anchor = getanchors(current)
+ end
+ if hasorientation then
+ local orientation, xoffset, yoffset, woffset, hoffset, doffset = getorientation(current)
+ local orientation, basepoint_h, basepoint_v = applyorientation(orientation,shift,height,width,height,depth,woffset,hoffset,doffset,xoffset,yoffset)
+ if orientation == 1 then
+ basepoint_h = basepoint_h + width - height -- hm
+ basepoint_v = basepoint_v - height
+ usedorientation = orientation
+ elseif orientation == 2 then
+ basepoint_h = basepoint_h + width
+ basepoint_v = basepoint_v + depth - height
+ usedorientation = orientation
+ elseif orientation == 3 then -- weird
+ basepoint_h = basepoint_h + height
+ usedorientation = orientation
+ end
+ if target then
+ targetdata = anchors[target]
+ if targetdata then
+ if pos_r == righttoleft_code then
+ pos_h = targetdata[1] - basepoint_h
+ else
+ pos_h = targetdata[1] + basepoint_h
+ end
+ pos_v = targetdata[2] - basepoint_v
+ goto posdone
+ end
+ end
+ if pos_r == righttoleft_code then
+ pos_h = ref_h - basepoint_h
+ else
+ pos_h = ref_h + basepoint_h
+ end
+ pos_v = ref_v - (cur_v + basepoint_v)
+ elseif hasoffset then
+ local orientation, xoffset, yoffset = getorientation(current)
+ -- local basepoint_h = shift
+ -- local basepoint_v = height
+ if boxdir ~= pos_r then
+ shift = shift + width
+ end
+ if target then
+ targetdata = anchors[target]
+ if targetdata then
+ if pos_r == righttoleft_code then
+ pos_h = targetdata[1] - (shift + xoffset)
+ else
+ pos_h = targetdata[1] + (shift + xoffset)
+ end
+ pos_v = targetdata[2] - (height - yoffset)
+ goto posdone
+ end
+ end
+ if pos_r == righttoleft_code then
+ pos_h = ref_h - (shift + xoffset)
+ else
+ pos_h = ref_h + (shift + xoffset)
+ end
+ pos_v = ref_v - (cur_v + height - yoffset)
+ elseif hasanchor then
+ -- local basepoint_h = shift
+ -- local basepoint_v = height
+ if boxdir ~= pos_r then
+ shift = shift + width
+ end
+ if target then
+ local a = anchors[target]
+ if a then
+ if pos_r == righttoleft_code then
+ pos_h = targetdata[1] - shift
+ else
+ pos_h = targetdata[1] + shift
+ end
+ pos_v = targetdata[2] - height
+ goto posdone
+ end
+ end
+ if pos_r == righttoleft_code then
+ pos_h = ref_h - shift
+ else
+ pos_h = ref_h + shift
+ end
+ pos_v = ref_v - (cur_v + height)
+ else
+ -- local basepoint_h = shift
+ -- local basepoint_v = height
+ if boxdir ~= pos_r then
+ shift = shift + width
+ end
+ if pos_r == righttoleft_code then
+ pos_h = ref_h - shift
+ else
+ pos_h = ref_h + shift
+ end
+ pos_v = ref_v - (cur_v + height)
+ end
+ goto process
+ ::posdone::
+ if anchor and anchor > 0 then
+ pos_h, pos_v = applyanchor(t_anchor,true, pos_h,pos_v,targetdata[3],targetdata[4],targetdata[5])
+ pos_h, pos_v = applyanchor(s_anchor,false,pos_h,pos_v,width,height,depth)
+ end
+ ::process::
+ if source then
+ -- move this into apply_anchor
+ local anchor_h = pos_h
+ local anchor_v = pos_v
+ if usedorientation then
+ if usedorientation == 1 then
+ anchor_v = anchor_v - (width - height)
+ elseif usedorientation == 2 then
+ anchor_v = anchor_v - (depth - height)
+ elseif usedorientation == 3 then -- weird
+ anchor_v = anchor_v + (height - width)
+ end
+ end
+ anchors[source] = { anchor_h, anchor_v, width, height, depth }
+ end
+ -- if usedorientation then
+ -- pushorientation(usedorientation,pos_h,pos_v,pos_r)
+ -- end
+ -- if source then
+ -- flushstored(current,source,true)
+ -- end
+ if id == vlist_code then
+ vlist_out(current,list)
+ else
+ hlist_out(current,list)
+ end
+ -- if source then
+ -- flushstored(current,source,false)
+ -- end
+ -- if usedorientation then
+ -- poporientation(usedorientation,pos_h,pos_v,pos_r)
+ -- end
+ end
+ cur_v = cur_v + height + depth
+
+ elseif id == kern_code then
+ cur_v = cur_v + getkern(current)
+ elseif id == rule_code then
+ local width, height, depth = getwhd(current)
+ cur_v = cur_v + height + depth
+ elseif id == whatsit_code then
+ if subtype == userdefined_code then
+ local action = userdefined[getprop(current,"id")]
+ if action then
+ if not cur_b then
+ local wd, ht, dp = getwhd(this_box)
+ cur_b = { wd, ht, dp, ref_h, ref_v, ref_r }
+ end
+ action(current,pos_h,pos_v)
+ end
+ end
+ else
+ goto synced
+ end
+ pos_h = ref_h
+ ::synced::
+ end
+ pos_h = ref_h
+ pos_v = ref_v
+ pos_r = ref_r
+end
+
+function drivers.converters.analyze(driver,box)
+
+ if not driver then
+ report("error in converter, no driver")
+ return
+ elseif box then
+ box = tonut(box)
+ else
+ report("error in converter, no box")
+ return
+ end
+
+ local width, height, depth = getwhd(box)
+ local total = height + depth
+
+ if height > maxdimen or depth > maxdimen or width > maxdimen or total > maxdimen then
+ report("error in converter, overflow")
+ return
+ end
+
+ local actions = driver.actions
+ local flushers = driver.flushers
+
+ initialize = actions.initialize
+ finalize = actions.finalize
+
+ userdefined = flushers.userdefined
+
+ reset_dir_stack()
+ reset_state()
+
+ pos_r = getdirection(box)
+ pos_v = depth
+ pos_h = pos_r == righttoleft_code and width or 0
+
+ local details = {
+ boundingbox = { 0, 0, width, total },
+ }
+
+ if initialize then
+ initialize(driver,details)
+ end
+
+ if getid(box) == vlist_code then
+ vlist_out(box,getlist(box))
+ else
+ hlist_out(box,getlist(box))
+ end
+
+ if finalize then
+ finalize(driver,details)
+ end
+
+end
+
diff --git a/Master/texmf-dist/tex/context/base/mkxl/enco-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/enco-ini.mkxl
index c93ef7f6185..3d87ee7765c 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/enco-ini.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/enco-ini.mkxl
@@ -71,7 +71,7 @@
\fi
\endcsname}
-\immutable\letvalue{\??accents}\empty
+\immutable\letcsname\??accents\endcsname\empty
%D Because now have this (\type {\chr} issues a one|-|time warning):
@@ -208,10 +208,11 @@
\setbox0\hbox{#4}%
\halign
{##\crcr\hbox{#5}\crcr
- \hidewidth
+ \hskip\hideskip % \hidewidth
\hskip#2\wd0
\hskip-#3\slantperpoint % in plain 1ex * dimenless value
- \vpack to .2\exheight{\box0\vss}\hidewidth
+ \vpack to .2\exheight{\box0\vss}%
+ \hskip\hideskip % \hidewidth
\crcr}}}
\permanent\protected\def\buildtextmacron {\bottomaccent{.25ex}{0}{15}{\textmacron}}
@@ -236,7 +237,7 @@
{\topaccent{0pt}{0}{15}{\textgrave}} % e.g.
\permanent\protected\def\definemathaccent#1 #2%
- {\setvalue{#1}{\mathaccent#2 }}
+ {\defcsname#1\endcsname{\mathaccent#2 }} % can be redefined
% from enco-def:
diff --git a/Master/texmf-dist/tex/context/base/mkxl/file-ini.mklx b/Master/texmf-dist/tex/context/base/mkxl/file-ini.mklx
index 35a49c72dd4..7c4645a9ae5 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/file-ini.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/file-ini.mklx
@@ -71,16 +71,16 @@
\installsystemnamespace{eolstack}
-\newcount\c_system_files_eol_level
+\newinteger\c_system_files_eol_level
\permanent\protected\def\pushendofline
- {\advance\c_system_files_eol_level\plusone
+ {\advanceby\c_system_files_eol_level\plusone
\expandafter\chardef\csname\??eolstack\number\c_system_files_eol_level\endcsname\catcode\endoflineasciicode
\catcode\endoflineasciicode\commentcatcode}
\permanent\protected\def\popendofline
{\catcode\endoflineasciicode\csname\??eolstack\number\c_system_files_eol_level\endcsname
- \advance\c_system_files_eol_level\minusone}
+ \advanceby\c_system_files_eol_level\minusone}
\permanent\protected\def\restoreendofline
{\catcode\endoflineasciicode\endoflinecatcode}
@@ -90,22 +90,22 @@
%D
%D A low level capsule:
-\newcount\readingfilelevel % no longer needed
-\newtoks \everystartreadingfile
-\newtoks \everystopreadingfile
+\newinteger\readingfilelevel % no longer needed
+\newtoks \everystartreadingfile
+\newtoks \everystopreadingfile
\permanent\protected\def\startreadingfile% beter een every en \setnormalcatcodes
- {\global\advance\readingfilelevel\plusone
+ {\global\advanceby\readingfilelevel\plusone
\the\everystartreadingfile
\pushcatcodetable % saveguard
\setcatcodetable\ctxcatcodes
- \clf_pushregime}% temporarily this way
+ \pushregime}% temporarily this way
\permanent\protected\def\stopreadingfile
- {\popcatcodetable % saveguard
- \clf_popregime % temporarily this way
+ {\popcatcodetable % saveguard
+ \popregime % temporarily this way
\the\everystopreadingfile
- \global\advance\readingfilelevel\minusone}
+ \global\advanceby\readingfilelevel\minusone}
%D \macros
%D {input, normalinput}
@@ -182,11 +182,12 @@
\newconstant\splitoffkind
\mutable\def\splitoffroot{.}
-\mutable\let\splitofffull\empty
-\mutable\let\splitoffpath\empty
-\mutable\let\splitoffbase\empty
-\mutable\let\splitoffname\empty
-\mutable\let\splitofftype\empty
+
+\mutable\lettonothing\splitofffull
+\mutable\lettonothing\splitoffpath
+\mutable\lettonothing\splitoffbase
+\mutable\lettonothing\splitoffname
+\mutable\lettonothing\splitofftype
\permanent\protected\def\splitfilename{\clf_splitfilename}
@@ -213,7 +214,7 @@
{\ifcsname\??fileonce#whatever\endcsname
\expandafter\gobbleoneargument
\else
- \letgvalue{\??fileonce#whatever}\relax
+ \aliased\gletcsname\??fileonce#whatever\endcsname\relax
\expandafter\firstofoneargument
\fi}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/file-job.lmt b/Master/texmf-dist/tex/context/base/mkxl/file-job.lmt
index 95ad48e824b..e117b914e0b 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/file-job.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/file-job.lmt
@@ -10,8 +10,8 @@ if not modules then modules = { } end modules ['file-job'] = {
-- and push/poppign at the tex end
local next, rawget, tostring, tonumber = next, rawget, tostring, tonumber
-local gsub, match, find = string.gsub, string.match, string.find
-local insert, remove, concat = table.insert, table.remove, table.concat
+local gsub, match, gmatch, ind = string.gsub, string.match, string.gmatch, string.find
+local insert, remove, concat, unique, imerged = table.insert, table.remove, table.concat, table.unique, table.imerged
local validstring, formatters = string.valid, string.formatters
local sortedhash = table.sortedhash
local setmetatableindex, setmetatablenewindex = table.setmetatableindex, table.setmetatablenewindex
@@ -49,6 +49,8 @@ local cleanpath = resolvers.cleanpath
local toppath = resolvers.toppath
local resolveprefix = resolvers.resolve
+local currentfile = luatex.currentfile
+
local hasscheme = url.hasscheme
local jobresolvers = resolvers.jobs
@@ -189,8 +191,8 @@ implement {
-- moved from tex to lua:
-local texpatterns = { "%s.mkvi", "%s.mkiv", "%s.mklx", "%s.mkxl", "%s.tex" }
-local luapatterns = { "%s" .. utilities.lua.suffixes.luc, "%s.lua", "%s.lmt" }
+local texpatterns = { "%s.mklx", "%s.mkxl", "%s.mkvi", "%s.mkiv", "%s.tex" }
+local luapatterns = { "%s" .. utilities.lua.suffixes.luc, "%s.lmt", "%s.lua" }
local cldpatterns = { "%s.cld" }
local xmlpatterns = { "%s.xml" }
@@ -395,6 +397,8 @@ end
local textlevel = 0 -- inaccessible for user, we need to define counter textlevel at the tex end
+local c_textlevel = tex.iscount("textlevel")
+
local function dummyfunction() end
local function startstoperror()
@@ -412,7 +416,7 @@ local function starttext()
context.dostarttext()
end
textlevel = textlevel + 1
- texsetcount("global","textlevel",textlevel)
+ texsetcount("global",c_textlevel,textlevel)
end
local function stoptext()
@@ -422,7 +426,7 @@ local function stoptext()
elseif textlevel > 0 then
textlevel = textlevel - 1
end
- texsetcount("global","textlevel",textlevel)
+ texsetcount("global",c_textlevel,textlevel)
if textlevel <= 0 then
if trace_jobfiles then
report_jobfiles("stopping text")
@@ -548,7 +552,9 @@ end
local function poptree()
top = remove(treestack)
- -- inspect(top)
+ if #top[#top].branches == 0 then
+ top[#top].branches = nil -- saves space in tuc
+ end
end
do
@@ -556,10 +562,15 @@ do
local function log_tree(report,top,depth)
report("%s%s: %s",depth,top.type,top.name)
local branches = top.branches
- if #branches > 0 then
- depth = depth .. " "
- for i=1,#branches do
- log_tree(report,branches[i],depth)
+ if branches then
+ local n = #branches
+ if n > 0 then
+ depth = depth .. " "
+ for i=1,n do
+ log_tree(report,branches[i],depth)
+ end
+ else
+ top.brances = nil -- saves space in tuc
end
end
end
@@ -811,18 +822,32 @@ implement { name = "usecomponent", public = true, protected = true, actions =
-- todo: setsystemmode to currenttype
-- todo: make start/stop commands at the tex end
+-- local start = {
+-- [v_project] = context.startprojectindeed,
+-- [v_product] = context.startproductindeed,
+-- [v_component] = context.startcomponentindeed,
+-- [v_environment] = context.startenvironmentindeed,
+-- }
+
+-- local stop = {
+-- [v_project] = context.stopprojectindeed,
+-- [v_product] = context.stopproductindeed,
+-- [v_component] = context.stopcomponentindeed,
+-- [v_environment] = context.stopenvironmentindeed,
+-- }
+
local start = {
- [v_project] = context.startprojectindeed,
- [v_product] = context.startproductindeed,
- [v_component] = context.startcomponentindeed,
- [v_environment] = context.startenvironmentindeed,
+ [v_project] = "startprojectindeed",
+ [v_product] = "startproductindeed",
+ [v_component] = "startcomponentindeed",
+ [v_environment] = "startenvironmentindeed",
}
local stop = {
- [v_project] = context.stopprojectindeed,
- [v_product] = context.stopproductindeed,
- [v_component] = context.stopcomponentindeed,
- [v_environment] = context.stopenvironmentindeed,
+ [v_project] = "stopprojectindeed",
+ [v_product] = "stopproductindeed",
+ [v_component] = "stopcomponentindeed",
+ [v_environment] = "stopenvironmentindeed",
}
local function gotonextlevel(what,name) -- todo: something with suffix name
@@ -831,25 +856,27 @@ local function gotonextlevel(what,name) -- todo: something with suffix name
currenttype = what
pushtree(what,name)
if start[what] then
- start[what]()
+ -- start[what]()
+ token.expandmacro(start[what])
end
end
local function gotopreviouslevel(what)
if stop[what] then
- stop[what]()
+ token.expandmacro(stop[what])
+ -- stop[what]() -- not immediate
end
poptree()
currenttype = remove(typestack) or v_text
remove(stacks[what]) -- not currenttype ... weak recovery
-context.endinput() -- does not work
--- context.signalendofinput(what)
+ -- context.endinput() -- now at the tex end !
end
local function autoname()
local name = scan_delimited(91,93) or scan_delimited(0,32) -- [name] or name<space>
if name == "*" then
- name = nameonly(toppath() or name)
+ -- name = nameonly(toppath() or name)
+ name = nameonly(currentfile() or name)
end
return name
end
@@ -898,6 +925,7 @@ end
function environment.loadexamodes(filename)
if not filename or filename == "" then
+ -- todo: environment.fulljobnmame
filename = removesuffix(tex.jobname)
end
filename = resolvers.findfile(addsuffix(filename,'ctm')) or ""
@@ -1027,6 +1055,7 @@ function document.setcommandline() -- has to happen at the tex end in order to e
-- in the new mtx=context approach we always pass a stub file so we need to
-- to trick the files table which actually only has one entry in a tex job
+
if arguments.timing then
context.usemodule { "timing" }
end
@@ -1281,3 +1310,59 @@ implement {
-- ctx_doifelse(continue)
end
}
+
+-- data-hsh.lmt:
+
+local helpers = resolvers.finders.helpers
+local validhashed = helpers.validhashed
+local registerhashed = helpers.registerhashed
+local registerfilescheme = helpers.registerfilescheme
+
+implement {
+ name = "registerhashedfiles",
+ public = true,
+ protected = true,
+ arguments = "optional",
+ actions = function(list)
+ for name in gmatch(list,"[^, ]+") do
+ registerhashed(name)
+ end
+ end,
+}
+
+implement {
+ name = "registerfilescheme",
+ public = true,
+ protected = true,
+ arguments = "optional",
+ actions = function(list)
+ for name in gmatch(list,"[^, ]+") do
+ registerfilescheme(name)
+ end
+ end,
+}
+
+implement {
+ name = "doifelsevalidhashedfiles",
+ public = true,
+ protected = true,
+ arguments = "string",
+ actions = function(name)
+ ctx_doifelse(validhashed(name))
+ end,
+}
+
+implement {
+ name = "adddefaultsuffix",
+ public = true,
+ protected = true,
+ actions = function(list)
+ resolvers.defaultsuffixes = unique(
+ imerged(
+ resolvers.defaultsuffixes,
+ list
+ )
+ )
+ end,
+ arguments = "array",
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/file-job.mklx b/Master/texmf-dist/tex/context/base/mkxl/file-job.mklx
index 9fb14c9bfc2..76b679bd683 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/file-job.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/file-job.mklx
@@ -18,6 +18,9 @@
%D This module delegates most of the work to \LUA\ and therefore also let it
%D define the commands, which is more efficient.
+\ifdefined\textlevel \else \newinteger\textlevel \fi % used at lua end
+
+\registerctxluafile{data-hsh}{autosuffix}
\registerctxluafile{file-job}{autosuffix}
%D Here are some helpers for processing and path control. In the following example
@@ -45,7 +48,7 @@
% helper (not really needed nowadays)
-\mutable\let\locatedfilepath\empty
+\mutable\lettonothing\locatedfilepath
\permanent\protected\def\locatefilepath#name%
{\edef\locatedfilepath{\clf_locatefilepath{#name}}} % todo: set at the lua end, catcodes and such
@@ -77,7 +80,6 @@
% document structure
-\ifdefined\textlevel \else \newcount\textlevel \fi % might go away
\ifdefined\strc_pagenumbers_flush_final_page \else \let\strc_pagenumbers_flush_final_page\relax \fi % ugly
\permanent\protected\def\dostarttext
@@ -138,22 +140,6 @@
% \startcomponent [#name] or #name<space> % defined at lua end
% \startenvironment [#name] or #name<space> % defined at lua end
-\newconditional\endofinput % hack, needed because \endinput happens one level down in the input when we write from lua
-
-% \protected\def\signalendofinput#1% argument just for tracing
-% {\global\settrue\endofinput}
-%
-% \protected\def\honorendofinput
-% {\ifconditional\endofinput
-% \global\setfalse\endofinput
-% \endinput
-% \fi}
-
-% \protected\def\stopproject {\clf_stopproject \honorendofinput} % todo
-% \protected\def\stopproduct {\clf_stopproduct \honorendofinput} % todo
-% \protected\def\stopcomponent {\clf_stopcomponent \honorendofinput} % todo
-% \protected\def\stopenvironment {\clf_stopenvironment\honorendofinput} % todo
-
% \currentproject % defined at lua end
% \currentproduct % defined at lua end
% \currentcomponent % defined at lua end
@@ -189,7 +175,9 @@
\neverypar\emptytoks
-%D Wrappers (the signal is a synchronization with lua hack):
+%D Wrappers. The \type {\endinput} is tricky because we call macros at the \LUA\
+%D end. In \LMTX\ we now do an immediate one, so the ending happens here now. It
+%D is different that in \MKIV, but you can compare the code.
\newsystemmode\v!project
\newsystemmode\v!product
@@ -204,7 +192,7 @@
\permanent\protected\def\stopprojectindeed
{\popsystemmode\v!project
%stoptext
- }%\signalendofinput\v!project}
+ \endinput}
\permanent\protected\def\startproductindeed
{\starttext
@@ -214,7 +202,7 @@
\permanent\protected\def\stopproductindeed
{\popsystemmode\v!product
\stoptext
- }%\signalendofinput\v!product}
+ \endinput}
\permanent\protected\def\startcomponentindeed
{\starttext
@@ -226,7 +214,7 @@
{\popsystemmode\v!component
\popreferenceprefix
\stoptext
- }%\signalendofinput\v!component}
+ \endinput}
\permanent\protected\def\startenvironmentindeed
{\pushsystemmode\v!environment
@@ -234,7 +222,7 @@
\permanent\protected\def\stopenvironmentindeed
{\popsystemmode\v!environment
- }%\signalendofinput\v!environment}
+ \endinput}
%D Upgraded after the ctx 2020 meeting:
%D
@@ -290,8 +278,8 @@
\normalexpanded {%
\startsetups[\currentdocument:\v!start]\noexpand\directsetup{\ifempty\currentdocumentparent\s!document\else\currentdocumentparent\fi:\v!start}\stopsetups
\startsetups[\currentdocument:\v!stop ]\noexpand\directsetup{\ifempty\currentdocumentparent\s!document\else\currentdocumentparent\fi:\v!stop }\stopsetups
- \permanent\setvalue{\e!start\currentdocument}{\startdocument[\currentdocument]}%
- \permanent\setvalue{\e!stop \currentdocument}{\stopdocument}
+ \permanent\defcsname\e!start\currentdocument\endcsname{\startdocument[\currentdocument]}%
+ \permanent\defcsname\e!stop \currentdocument\endcsname{\stopdocument}
}%
\to \everydefinedocument
@@ -302,7 +290,7 @@
\ifparameters
\or
\ifhastok={#namespace}%
- \let\currentdocument\empty
+ \lettonothing\currentdocument
\setupcurrentdocument[#namespace]%
\else
\edef\currentdocument{#namespace}%
@@ -337,7 +325,7 @@
\ifparameters
\or
\ifhastok={#namespace}%
- \let\currentdocument\empty
+ \lettonothing\currentdocument
\setupcurrentdocument[#namespace]%
\fi
\or
@@ -352,10 +340,17 @@
%
% \protected\def\samplefile#1%
% {\ifcsname\??samplefile#1\endcsname \else
-% \setxvalue{\??samplefile#1}{\cldloadfile{#1}}%
+% \xdefcsname\??samplefile#1\endcsname{\cldloadfile{#1}}%
% \fi
% \lastnamedcs}
\permanent\protected\def\samplefile#1{\clf_samplefile{#1}}
+% \adddefaultsuffix[foo,{},crap]
+% \adddefaultsuffix[{}]
+%
+% \typefile{./crapcrap}
+% \typefile{crapcrap}
+
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/file-mod.lmt b/Master/texmf-dist/tex/context/base/mkxl/file-mod.lmt
index 6af5d8816e0..d10abf53385 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/file-mod.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/file-mod.lmt
@@ -177,7 +177,11 @@ function environment.usemodules(prefix,askedname,truename)
for i=1,#prefixes do
-- todo: reconstruct name i.e. basename
local thename = prefixes[i] .. "-" .. truename
- if usemodule(thename) then
+ if thename == tex.jobname then
+ -- in case we process a module
+ status = 1
+ break
+ elseif usemodule(thename) then
status = 1
break
end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/file-mod.mklx b/Master/texmf-dist/tex/context/base/mkxl/file-mod.mklx
index 24471e30f00..a64529dd6d9 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/file-mod.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/file-mod.mklx
@@ -29,11 +29,21 @@
%D More information on the specific modules can be found in their dedicated manuals.
%D We use \type {\next} so that we can \type {\end} in modules.
+% \enabledirectives[logs.errors=*]
+% \enabledirectives[logs.errors=missing modules]
+%
+% \usemodule[letsquit]
+%
+% \starttext
+% test
+% \stoptext
+
\installcorenamespace{module}
-\mutable\let\currentmodule \s!unknown
-\mutable\let\currentmodulecategory \empty
-\mutable\let\currentmoduleparameters\empty
+\mutable\let\currentmodule\s!unknown
+
+\mutable\lettonothing\currentmodulecategory
+\mutable\lettonothing\currentmoduleparameters
\installmacrostack\currentmodule
\installmacrostack\currentmodulecategory
@@ -44,20 +54,20 @@
\push_macro_currentmodulecategory
\push_macro_currentmoduleparameters
\ifparameters
- \let\currentmodule\empty
+ \lettonothing\currentmodule
\or
- \let \currentmodulecategory \empty
- \edef\currentmodule {#category}%
- \let \currentmoduleparameters\empty
+ \lettonothing\currentmodulecategory
+ \edef\currentmodule{#category}%
+ \lettonothing\currentmoduleparameters
\or
\ifhastok={#name}%
- \let\currentmodulecategory \empty
- \edef\currentmodule {#category}%
+ \lettonothing\currentmodulecategory
+ \edef\currentmodule{#category}%
\edef\currentmoduleparameters{#name}%
\else
- \edef\currentmodulecategory {#category}%
- \edef\currentmodule {#name}%
- \let \currentmoduleparameters\empty
+ \edef\currentmodulecategory{#category}%
+ \edef\currentmodule{#name}%
+ \lettonothing\currentmoduleparameters
\fi
\or
\edef\currentmodulecategory {#category}%
@@ -79,11 +89,11 @@
\aliased\let\usemodule \usemodules
\aliased\let\usetexmodule\usemodules
-\newcount\c_syst_modules_nesting
-\newtoks \everysetupmodule
+\newinteger\c_syst_modules_nesting
+\newtoks \everysetupmodule
\permanent\tolerant\protected\def\startmodule[#1]#;#2 %
- {\global\advance\c_syst_modules_nesting\plusone
+ {\global\advanceby\c_syst_modules_nesting\plusone
\push_macro_currentmodule
\push_macro_currentmoduleparameters
\def\currentmodule{#1#2}}
@@ -94,7 +104,7 @@
\else
\pop_macro_currentmoduleparameters
\pop_macro_currentmodule
- \global\advance\c_syst_modules_nesting\minusone
+ \global\advanceby\c_syst_modules_nesting\minusone
\fi}
\permanent\protected\def\setupmodule % to be lmtx'd
@@ -129,7 +139,7 @@
\getparameters[\??module#name:][#parameters]% internal (defaults)
\normalexpanded{\getparameters[\??module#name:][\the\scratchtoks]}% loadtime (user)
\fi
- \let\currentmoduleparameters\empty
+ \lettonothing\currentmoduleparameters
\the\everysetupmodule}
\permanent\def\moduleparameter#name#parameter% should have been \namedmoduleparameter
@@ -259,4 +269,7 @@
\aliased\let\fetchruntimecommand\fetchmodulecommand % obsolete
+% \permanent\protected\def\moduleoverloaded
+% {\enforced}
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/file-res.mklx b/Master/texmf-dist/tex/context/base/mkxl/file-res.mklx
index a123b5e2213..a6240892181 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/file-res.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/file-res.mklx
@@ -62,7 +62,7 @@
%D to redefine the original \type {\input} when needed, for instance when loading
%D third party libraries.
-\mutable\let\readfilename\empty
+\mutable\lettonothing\readfilename
\def\syst_files_read_file#protocol#path#name% #true #false
{\edef\readfilename{\clf_getreadfilename{#protocol}{#path}{#name}}%
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-cff.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-cff.lmt
new file mode 100644
index 00000000000..dc5f9838292
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-cff.lmt
@@ -0,0 +1,2788 @@
+if not modules then modules = { } end modules ['font-cff'] = {
+ version = 1.001,
+ optimize = true,
+ comment = "companion to font-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- todo: option.outlines
+-- todo: option.boundingbox
+-- per charstring (less memory)
+
+-- This is a heavy one as it is a rather packed format. We don't need al the information
+-- now but we might need it later (who know what magic we can do with metapost). So at
+-- some point this might become a module. We just follow Adobe Technical Notes #5176 and
+-- #5177. In case of doubt I looked in the fontforge code that comes with LuaTeX but
+-- it's not the easiest source to read (and doesn't cover cff2).
+
+-- For now we save the segments in a list of segments with the operator last in an entry
+-- because that reflects the original. But it might make more sense to use a single array
+-- per segment. For pdf a simple concat works ok, but for other purposes a operator first
+-- flush is nicer.
+--
+-- In retrospect I could have looked into the backend code of LuaTeX but it never
+-- occurred to me that parsing charstrings was needed there (which has to to
+-- with merging subroutines and flattening, not so much with calculations.) On
+-- the other hand, we can now feed back cff2 stuff.
+
+local next, type, tonumber, rawget = next, type, tonumber, rawget
+local byte, char, gmatch, sub = string.byte, string.char, string.gmatch, string.sub
+local concat, insert, remove, unpack = table.concat, table.insert, table.remove, table.unpack
+local floor, abs, round, ceil, min, max = math.floor, math.abs, math.round, math.ceil, math.min, math.max
+local P, C, R, S, C, Cs, Ct = lpeg.P, lpeg.C, lpeg.R, lpeg.S, lpeg.C, lpeg.Cs, lpeg.Ct
+local lpegmatch = lpeg.match
+local formatters = string.formatters
+local bytetable = string.bytetable
+----- rshift, band, extract = bit32.rshift, bit32.band, bit32.extract
+
+local readers = fonts.handlers.otf.readers
+local streamreader = readers.streamreader
+
+local readstring = streamreader.readstring
+local readbyte = streamreader.readcardinal1 -- 8-bit unsigned integer
+local readushort = streamreader.readcardinal2 -- 16-bit unsigned integer
+local readuint = streamreader.readcardinal3 -- 24-bit unsigned integer
+local readulong = streamreader.readcardinal4 -- 32-bit unsigned integer
+local setposition = streamreader.setposition
+local getposition = streamreader.getposition
+local readbytetable = streamreader.readbytetable
+
+directives.register("fonts.streamreader",function()
+
+ streamreader = utilities.streams
+
+ readstring = streamreader.readstring
+ readbyte = streamreader.readcardinal1
+ readushort = streamreader.readcardinal2
+ readuint = streamreader.readcardinal3
+ readulong = streamreader.readcardinal4
+ setposition = streamreader.setposition
+ getposition = streamreader.getposition
+ readbytetable = streamreader.readbytetable
+
+end)
+
+local setmetatableindex = table.setmetatableindex
+
+local trace_charstrings = false trackers.register("fonts.cff.charstrings",function(v) trace_charstrings = v end)
+local report = logs.reporter("otf reader","cff")
+
+local parsedictionaries
+local parsecharstring
+local parsecharstrings
+local resetcharstrings
+local parseprivates
+local startparsing
+local stopparsing
+
+local defaultstrings = { [0] = -- taken from ff
+ ".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent",
+ "ampersand", "quoteright", "parenleft", "parenright", "asterisk", "plus",
+ "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four",
+ "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less",
+ "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H",
+ "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W",
+ "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum",
+ "underscore", "quoteleft", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
+ "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y",
+ "z", "braceleft", "bar", "braceright", "asciitilde", "exclamdown", "cent",
+ "sterling", "fraction", "yen", "florin", "section", "currency",
+ "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft",
+ "guilsinglright", "fi", "fl", "endash", "dagger", "daggerdbl",
+ "periodcentered", "paragraph", "bullet", "quotesinglbase", "quotedblbase",
+ "quotedblright", "guillemotright", "ellipsis", "perthousand", "questiondown",
+ "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent",
+ "dieresis", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "emdash",
+ "AE", "ordfeminine", "Lslash", "Oslash", "OE", "ordmasculine", "ae",
+ "dotlessi", "lslash", "oslash", "oe", "germandbls", "onesuperior",
+ "logicalnot", "mu", "trademark", "Eth", "onehalf", "plusminus", "Thorn",
+ "onequarter", "divide", "brokenbar", "degree", "thorn", "threequarters",
+ "twosuperior", "registered", "minus", "eth", "multiply", "threesuperior",
+ "copyright", "Aacute", "Acircumflex", "Adieresis", "Agrave", "Aring",
+ "Atilde", "Ccedilla", "Eacute", "Ecircumflex", "Edieresis", "Egrave",
+ "Iacute", "Icircumflex", "Idieresis", "Igrave", "Ntilde", "Oacute",
+ "Ocircumflex", "Odieresis", "Ograve", "Otilde", "Scaron", "Uacute",
+ "Ucircumflex", "Udieresis", "Ugrave", "Yacute", "Ydieresis", "Zcaron",
+ "aacute", "acircumflex", "adieresis", "agrave", "aring", "atilde",
+ "ccedilla", "eacute", "ecircumflex", "edieresis", "egrave", "iacute",
+ "icircumflex", "idieresis", "igrave", "ntilde", "oacute", "ocircumflex",
+ "odieresis", "ograve", "otilde", "scaron", "uacute", "ucircumflex",
+ "udieresis", "ugrave", "yacute", "ydieresis", "zcaron", "exclamsmall",
+ "Hungarumlautsmall", "dollaroldstyle", "dollarsuperior", "ampersandsmall",
+ "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader",
+ "onedotenleader", "zerooldstyle", "oneoldstyle", "twooldstyle",
+ "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle",
+ "sevenoldstyle", "eightoldstyle", "nineoldstyle", "commasuperior",
+ "threequartersemdash", "periodsuperior", "questionsmall", "asuperior",
+ "bsuperior", "centsuperior", "dsuperior", "esuperior", "isuperior",
+ "lsuperior", "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior",
+ "tsuperior", "ff", "ffi", "ffl", "parenleftinferior", "parenrightinferior",
+ "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall",
+ "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall",
+ "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall",
+ "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall",
+ "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah",
+ "Tildesmall", "exclamdownsmall", "centoldstyle", "Lslashsmall",
+ "Scaronsmall", "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall",
+ "Dotaccentsmall", "Macronsmall", "figuredash", "hypheninferior",
+ "Ogoneksmall", "Ringsmall", "Cedillasmall", "questiondownsmall", "oneeighth",
+ "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds",
+ "zerosuperior", "foursuperior", "fivesuperior", "sixsuperior",
+ "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior",
+ "oneinferior", "twoinferior", "threeinferior", "fourinferior",
+ "fiveinferior", "sixinferior", "seveninferior", "eightinferior",
+ "nineinferior", "centinferior", "dollarinferior", "periodinferior",
+ "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall",
+ "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall",
+ "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall",
+ "Igravesmall", "Iacutesmall", "Icircumflexsmall", "Idieresissmall",
+ "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall",
+ "Otildesmall", "Odieresissmall", "OEsmall", "Oslashsmall", "Ugravesmall",
+ "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall",
+ "Thornsmall", "Ydieresissmall", "001.000", "001.001", "001.002", "001.003",
+ "Black", "Bold", "Book", "Light", "Medium", "Regular", "Roman", "Semibold",
+}
+
+local standardnames = { [0] = -- needed for seac
+ false, false, false, false, false, false, false, false, false, false, false,
+ false, false, false, false, false, false, false, false, false, false, false,
+ false, false, false, false, false, false, false, false, false, false,
+ "space", "exclam", "quotedbl", "numbersign", "dollar", "percent",
+ "ampersand", "quoteright", "parenleft", "parenright", "asterisk", "plus",
+ "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four",
+ "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less",
+ "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H",
+ "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W",
+ "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum",
+ "underscore", "quoteleft", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
+ "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y",
+ "z", "braceleft", "bar", "braceright", "asciitilde", false, false, false,
+ false, false, false, false, false, false, false, false, false, false, false,
+ false, false, false, false, false, false, false, false, false, false, false,
+ false, false, false, false, false, false, false, false, false, "exclamdown",
+ "cent", "sterling", "fraction", "yen", "florin", "section", "currency",
+ "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft",
+ "guilsinglright", "fi", "fl", false, "endash", "dagger", "daggerdbl",
+ "periodcentered", false, "paragraph", "bullet", "quotesinglbase",
+ "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand",
+ false, "questiondown", false, "grave", "acute", "circumflex", "tilde",
+ "macron", "breve", "dotaccent", "dieresis", false, "ring", "cedilla", false,
+ "hungarumlaut", "ogonek", "caron", "emdash", false, false, false, false,
+ false, false, false, false, false, false, false, false, false, false, false,
+ false, "AE", false, "ordfeminine", false, false, false, false, "Lslash",
+ "Oslash", "OE", "ordmasculine", false, false, false, false, false, "ae",
+ false, false, false, "dotlessi", false, false, "lslash", "oslash", "oe",
+ "germandbls", false, false, false, false
+}
+
+local cffreaders = {
+ readbyte,
+ readushort,
+ readuint,
+ readulong,
+}
+
+directives.register("fonts.streamreader",function()
+ cffreaders = {
+ readbyte,
+ readushort,
+ readuint,
+ readulong,
+ }
+end)
+
+-- The header contains information about its own size.
+
+local function readheader(f)
+ local offset = getposition(f)
+ local major = readbyte(f)
+ local header = {
+ offset = offset,
+ major = major,
+ minor = readbyte(f),
+ size = readbyte(f), -- headersize
+ }
+ if major == 1 then
+ header.dsize = readbyte(f) -- list of dict offsets
+ elseif major == 2 then
+ header.dsize = readushort(f) -- topdict size
+ else
+ -- I'm probably no longer around by then and we use AI's to
+ -- handle this kind of stuff, if we typeset documents at all.
+ end
+ setposition(f,offset+header.size)
+ return header
+end
+
+-- The indexes all look the same, so we share a loader. We could pass a handler
+-- and run over the array but why bother, we only have a few uses.
+
+local function readlengths(f,longcount)
+ local count = longcount and readulong(f) or readushort(f)
+ if count == 0 then
+ return { }
+ end
+ local osize = readbyte(f)
+ local read = cffreaders[osize]
+ if not read then
+ report("bad offset size: %i",osize)
+ return { }
+ end
+ local lengths = { }
+ local previous = read(f)
+ for i=1,count do
+ local offset = read(f)
+ local length = offset - previous
+ if length < 0 then
+ report("bad offset: %i",length)
+ length = 0
+ end
+ lengths[i] = length
+ previous = offset
+ end
+ return lengths
+end
+
+-- There can be subfonts so names is an array. However, in our case it's always
+-- one font. The same is true for the top dictionaries. Watch how we only load
+-- the dictionary string as for interpretation we need to have the strings loaded
+-- as well.
+
+local function readfontnames(f)
+ local names = readlengths(f)
+ for i=1,#names do
+ names[i] = readstring(f,names[i])
+ end
+ return names
+end
+
+local function readtopdictionaries(f)
+ local dictionaries = readlengths(f)
+ for i=1,#dictionaries do
+ dictionaries[i] = readstring(f,dictionaries[i])
+ end
+ return dictionaries
+end
+
+-- Strings are added to a list of standard strings so we start the font specific
+-- one with an offset. Strings are shared so we have one table.
+
+local function readstrings(f)
+ local lengths = readlengths(f)
+ local strings = setmetatableindex({ }, defaultstrings)
+ local index = #defaultstrings
+ for i=1,#lengths do
+ index = index + 1
+ strings[index] = readstring(f,lengths[i])
+ end
+ return strings
+end
+
+-- Parsing the dictionaries is delayed till we have the strings loaded. The parser
+-- is stack based so the operands come before the operator (like in postscript).
+
+-- local function delta(t)
+-- local n = #t
+-- if n > 1 then
+-- local p = t[1]
+-- for i=2,n do
+-- local c = t[i]
+-- t[i] = c + p
+-- p = c
+-- end
+-- end
+-- end
+
+do
+
+ -- We use a closure so that we don't need to pass too much around. For cff2 we can
+ -- at some point use a simple version as there is less.
+
+ local stack = { }
+ local top = 0
+ local result = { }
+ local strings = { }
+
+ local p_single =
+ P("\00") / function()
+ result.version = strings[stack[top]] or "unset"
+ top = 0
+ end
+ + P("\01") / function()
+ result.notice = strings[stack[top]] or "unset"
+ top = 0
+ end
+ + P("\02") / function()
+ result.fullname = strings[stack[top]] or "unset"
+ top = 0
+ end
+ + P("\03") / function()
+ result.familyname = strings[stack[top]] or "unset"
+ top = 0
+ end
+ + P("\04") / function()
+ result.weight = strings[stack[top]] or "unset"
+ top = 0
+ end
+ + P("\05") / function()
+ result.fontbbox = { unpack(stack,1,4) }
+ top = 0
+ end
+ + P("\06") / function()
+ result.bluevalues = { unpack(stack,1,top) }
+ top = 0
+ end
+ + P("\07") / function()
+ result.otherblues = { unpack(stack,1,top) }
+ top = 0
+ end
+ + P("\08") / function()
+ result.familyblues = { unpack(stack,1,top) }
+ top = 0
+ end
+ + P("\09") / function()
+ result.familyotherblues = { unpack(stack,1,top) }
+ top = 0
+ end
+ + P("\10") / function()
+ result.stdhw = stack[top]
+ top = 0
+ end
+ + P("\11") / function()
+ result.stdvw = stack[top]
+ top = 0
+ end
+ + P("\13") / function()
+ result.uniqueid = stack[top]
+ top = 0
+ end
+ + P("\14") / function()
+ result.xuid = concat(stack,"",1,top)
+ top = 0
+ end
+ + P("\15") / function()
+ result.charset = stack[top]
+ top = 0
+ end
+ + P("\16") / function()
+ result.encoding = stack[top]
+ top = 0
+ end
+ + P("\17") / function() -- valid cff2
+ result.charstrings = stack[top]
+ top = 0
+ end
+ + P("\18") / function()
+ result.private = {
+ size = stack[top-1],
+ offset = stack[top],
+ }
+ top = 0
+ end
+ + P("\19") / function()
+ result.subroutines = stack[top]
+ top = 0 -- new, forgotten ?
+ end
+ + P("\20") / function()
+ result.defaultwidthx = stack[top]
+ top = 0 -- new, forgotten ?
+ end
+ + P("\21") / function()
+ result.nominalwidthx = stack[top]
+ top = 0 -- new, forgotten ?
+ end
+ -- + P("\22") / function() -- reserved
+ -- end
+ -- + P("\23") / function() -- reserved
+ -- end
+ + P("\24") / function() -- new in cff2
+ result.vstore = stack[top]
+ top = 0
+ end
+ + P("\25") / function() -- new in cff2
+ result.maxstack = stack[top]
+ top = 0
+ end
+ -- + P("\26") / function() -- reserved
+ -- end
+ -- + P("\27") / function() -- reserved
+ -- end
+
+ local p_double = P("\12") * (
+ P("\00") / function()
+ result.copyright = stack[top]
+ top = 0
+ end
+ + P("\01") / function()
+ result.monospaced = stack[top] == 1 and true or false -- isfixedpitch
+ top = 0
+ end
+ + P("\02") / function()
+ result.italicangle = stack[top]
+ top = 0
+ end
+ + P("\03") / function()
+ result.underlineposition = stack[top]
+ top = 0
+ end
+ + P("\04") / function()
+ result.underlinethickness = stack[top]
+ top = 0
+ end
+ + P("\05") / function()
+ result.painttype = stack[top]
+ top = 0
+ end
+ + P("\06") / function()
+ result.charstringtype = stack[top]
+ top = 0
+ end
+ + P("\07") / function() -- valid cff2
+ result.fontmatrix = { unpack(stack,1,6) }
+ top = 0
+ end
+ + P("\08") / function()
+ result.strokewidth = stack[top]
+ top = 0
+ end
+ + P("\09") / function()
+ result.bluescale = stack[top]
+ top = 0
+ end
+ + P("\10") / function()
+ result.blueshift = stack[top]
+ top = 0
+ end
+ + P("\11") / function()
+ result.bluefuzz = stack[top]
+ top = 0
+ end
+ + P("\12") / function()
+ result.stemsnaph = { unpack(stack,1,top) }
+ top = 0
+ end
+ + P("\13") / function()
+ result.stemsnapv = { unpack(stack,1,top) }
+ top = 0
+ end
+ + P("\20") / function()
+ result.syntheticbase = stack[top]
+ top = 0
+ end
+ + P("\21") / function()
+ result.postscript = strings[stack[top]] or "unset"
+ top = 0
+ end
+ + P("\22") / function()
+ result.basefontname = strings[stack[top]] or "unset"
+ top = 0
+ end
+ + P("\21") / function()
+ result.basefontblend = stack[top]
+ top = 0
+ end
+ + P("\30") / function()
+ result.cid.registry = strings[stack[top-2]] or "unset"
+ result.cid.ordering = strings[stack[top-1]] or "unset"
+ result.cid.supplement = stack[top]
+ top = 0
+ end
+ + P("\31") / function()
+ result.cid.fontversion = stack[top]
+ top = 0
+ end
+ + P("\32") / function()
+ result.cid.fontrevision= stack[top]
+ top = 0
+ end
+ + P("\33") / function()
+ result.cid.fonttype = stack[top]
+ top = 0
+ end
+ + P("\34") / function()
+ result.cid.count = stack[top]
+ top = 0
+ end
+ + P("\35") / function()
+ result.cid.uidbase = stack[top]
+ top = 0
+ end
+ + P("\36") / function() -- valid cff2
+ result.cid.fdarray = stack[top]
+ top = 0
+ end
+ + P("\37") / function() -- valid cff2
+ result.cid.fdselect = stack[top]
+ top = 0
+ end
+ + P("\38") / function()
+ result.cid.fontname = strings[stack[top]] or "unset"
+ top = 0
+ end
+ )
+
+ -- Some lpeg fun ... a first variant split the byte and made a new string but
+ -- the second variant is much faster. Not that it matters much as we don't see
+ -- such numbers often.
+
+ local remap_1 = {
+ ["\x00"] = "00", ["\x01"] = "01", ["\x02"] = "02", ["\x03"] = "03", ["\x04"] = "04", ["\x05"] = "05", ["\x06"] = "06", ["\x07"] = "07", ["\x08"] = "08", ["\x09"] = "09", ["\x0A"] = "0.", ["\x0B"] = "0E", ["\x0C"] = "0E-", ["\x0D"] = "0", ["\x0E"] = "0-", ["\x0F"] = "0",
+ ["\x10"] = "10", ["\x11"] = "11", ["\x12"] = "12", ["\x13"] = "13", ["\x14"] = "14", ["\x15"] = "15", ["\x16"] = "16", ["\x17"] = "17", ["\x18"] = "18", ["\x19"] = "19", ["\x1A"] = "1.", ["\x1B"] = "1E", ["\x1C"] = "1E-", ["\x1D"] = "1", ["\x1E"] = "1-", ["\x1F"] = "1",
+ ["\x20"] = "20", ["\x21"] = "21", ["\x22"] = "22", ["\x23"] = "23", ["\x24"] = "24", ["\x25"] = "25", ["\x26"] = "26", ["\x27"] = "27", ["\x28"] = "28", ["\x29"] = "29", ["\x2A"] = "2.", ["\x2B"] = "2E", ["\x2C"] = "2E-", ["\x2D"] = "2", ["\x2E"] = "2-", ["\x2F"] = "2",
+ ["\x30"] = "30", ["\x31"] = "31", ["\x32"] = "32", ["\x33"] = "33", ["\x34"] = "34", ["\x35"] = "35", ["\x36"] = "36", ["\x37"] = "37", ["\x38"] = "38", ["\x39"] = "39", ["\x3A"] = "3.", ["\x3B"] = "3E", ["\x3C"] = "3E-", ["\x3D"] = "3", ["\x3E"] = "3-", ["\x3F"] = "3",
+ ["\x40"] = "40", ["\x41"] = "41", ["\x42"] = "42", ["\x43"] = "43", ["\x44"] = "44", ["\x45"] = "45", ["\x46"] = "46", ["\x47"] = "47", ["\x48"] = "48", ["\x49"] = "49", ["\x4A"] = "4.", ["\x4B"] = "4E", ["\x4C"] = "4E-", ["\x4D"] = "4", ["\x4E"] = "4-", ["\x4F"] = "4",
+ ["\x50"] = "50", ["\x51"] = "51", ["\x52"] = "52", ["\x53"] = "53", ["\x54"] = "54", ["\x55"] = "55", ["\x56"] = "56", ["\x57"] = "57", ["\x58"] = "58", ["\x59"] = "59", ["\x5A"] = "5.", ["\x5B"] = "5E", ["\x5C"] = "5E-", ["\x5D"] = "5", ["\x5E"] = "5-", ["\x5F"] = "5",
+ ["\x60"] = "60", ["\x61"] = "61", ["\x62"] = "62", ["\x63"] = "63", ["\x64"] = "64", ["\x65"] = "65", ["\x66"] = "66", ["\x67"] = "67", ["\x68"] = "68", ["\x69"] = "69", ["\x6A"] = "6.", ["\x6B"] = "6E", ["\x6C"] = "6E-", ["\x6D"] = "6", ["\x6E"] = "6-", ["\x6F"] = "6",
+ ["\x70"] = "70", ["\x71"] = "71", ["\x72"] = "72", ["\x73"] = "73", ["\x74"] = "74", ["\x75"] = "75", ["\x76"] = "76", ["\x77"] = "77", ["\x78"] = "78", ["\x79"] = "79", ["\x7A"] = "7.", ["\x7B"] = "7E", ["\x7C"] = "7E-", ["\x7D"] = "7", ["\x7E"] = "7-", ["\x7F"] = "7",
+ ["\x80"] = "80", ["\x81"] = "81", ["\x82"] = "82", ["\x83"] = "83", ["\x84"] = "84", ["\x85"] = "85", ["\x86"] = "86", ["\x87"] = "87", ["\x88"] = "88", ["\x89"] = "89", ["\x8A"] = "8.", ["\x8B"] = "8E", ["\x8C"] = "8E-", ["\x8D"] = "8", ["\x8E"] = "8-", ["\x8F"] = "8",
+ ["\x90"] = "90", ["\x91"] = "91", ["\x92"] = "92", ["\x93"] = "93", ["\x94"] = "94", ["\x95"] = "95", ["\x96"] = "96", ["\x97"] = "97", ["\x98"] = "98", ["\x99"] = "99", ["\x9A"] = "9.", ["\x9B"] = "9E", ["\x9C"] = "9E-", ["\x9D"] = "9", ["\x9E"] = "9-", ["\x9F"] = "9",
+ ["\xA0"] = ".0", ["\xA1"] = ".1", ["\xA2"] = ".2", ["\xA3"] = ".3", ["\xA4"] = ".4", ["\xA5"] = ".5", ["\xA6"] = ".6", ["\xA7"] = ".7", ["\xA8"] = ".8", ["\xA9"] = ".9", ["\xAA"] = "..", ["\xAB"] = ".E", ["\xAC"] = ".E-", ["\xAD"] = ".", ["\xAE"] = ".-", ["\xAF"] = ".",
+ ["\xB0"] = "E0", ["\xB1"] = "E1", ["\xB2"] = "E2", ["\xB3"] = "E3", ["\xB4"] = "E4", ["\xB5"] = "E5", ["\xB6"] = "E6", ["\xB7"] = "E7", ["\xB8"] = "E8", ["\xB9"] = "E9", ["\xBA"] = "E.", ["\xBB"] = "EE", ["\xBC"] = "EE-", ["\xBD"] = "E", ["\xBE"] = "E-", ["\xBF"] = "E",
+ ["\xC0"] = "E-0", ["\xC1"] = "E-1", ["\xC2"] = "E-2", ["\xC3"] = "E-3", ["\xC4"] = "E-4", ["\xC5"] = "E-5", ["\xC6"] = "E-6", ["\xC7"] = "E-7", ["\xC8"] = "E-8", ["\xC9"] = "E-9", ["\xCA"] = "E-.", ["\xCB"] = "E-E", ["\xCC"] = "E-E-", ["\xCD"] = "E-", ["\xCE"] = "E--", ["\xCF"] = "E-",
+ ["\xD0"] = "-0", ["\xD1"] = "-1", ["\xD2"] = "-2", ["\xD3"] = "-3", ["\xD4"] = "-4", ["\xD5"] = "-5", ["\xD6"] = "-6", ["\xD7"] = "-7", ["\xD8"] = "-8", ["\xD9"] = "-9", ["\xDA"] = "-.", ["\xDB"] = "-E", ["\xDC"] = "-E-", ["\xDD"] = "-", ["\xDE"] = "--", ["\xDF"] = "-",
+ }
+ local remap_2 = {
+ ["\x0F"] = "0", ["\x1F"] = "1", ["\x2F"] = "2", ["\x3F"] = "3", ["\x4F"] = "4",
+ ["\x5F"] = "5", ["\x6F"] = "6", ["\x7F"] = "7", ["\x8F"] = "8", ["\x9F"] = "9",
+ }
+
+ local p_last_1 = S("\x0F\x1F\x2F\x3F\x4F\x5F\x6F\x7F\x8F\x9F\xAF\xBF")
+ local p_last_2 = R("\xF0\xFF")
+
+ -- tricky, we don't want to append last
+
+ -- local p_nibbles = P("\30") * Cs(((1-p_last)/remap)^0 * (P(1)/remap)) / function(n)
+ local p_nibbles = P("\30") * Cs(((1-(p_last_1+p_last_2))/remap_1)^0 * (p_last_1/remap_2 + p_last_2/"")) / function(n)
+ -- 0-9=digit a=. b=E c=E- d=reserved e=- f=finish
+ top = top + 1
+ stack[top] = tonumber(n) or 0
+ end
+
+ local p_byte = C(R("\32\246")) / function(b0)
+ -- -107 .. +107
+ top = top + 1
+ stack[top] = byte(b0) - 139
+ end
+
+ local p_positive = C(R("\247\250")) * C(1) / function(b0,b1)
+ -- +108 .. +1131
+ top = top + 1
+ stack[top] = (byte(b0)-247)*256 + byte(b1) + 108
+ end
+
+ local p_negative = C(R("\251\254")) * C(1) / function(b0,b1)
+ -- -1131 .. -108
+ top = top + 1
+ stack[top] = -(byte(b0)-251)*256 - byte(b1) - 108
+ end
+
+ -- local p_float = P("\255") * C(1) * C(1) * C(1) * C(1) / function(b0,b1,b2,b3)
+ -- top = top + 1
+ -- stack[top] = 0
+ -- end
+
+ local p_short = P("\28") * C(1) * C(1) / function(b1,b2)
+ -- -32768 .. +32767 : b1<<8 | b2
+ top = top + 1
+ local n = 0x100 * byte(b1) + byte(b2)
+ if n >= 0x8000 then
+ stack[top] = n - 0xFFFF - 1
+ else
+ stack[top] = n
+ end
+ end
+
+ local p_long = P("\29") * C(1) * C(1) * C(1) * C(1) / function(b1,b2,b3,b4)
+ -- -2^31 .. +2^31-1 : b1<<24 | b2<<16 | b3<<8 | b4
+ top = top + 1
+ local n = 0x1000000 * byte(b1) + 0x10000 * byte(b2) + 0x100 * byte(b3) + byte(b4)
+ if n >= 0x8000000 then
+ stack[top] = n - 0xFFFFFFFF - 1
+ else
+ stack[top] = n
+ end
+ end
+
+ local p_unsupported = P(1) / function(detail)
+ top = 0
+ end
+
+ local p_dictionary = (
+ p_byte
+ + p_positive
+ + p_negative
+ + p_short
+ + p_long
+ + p_nibbles
+ + p_single
+ + p_double
+ -- + p_float
+ + p_unsupported
+ )^1
+
+ parsedictionaries = function(data,dictionaries,version)
+ stack = { }
+ strings = data.strings
+ if trace_charstrings then
+ report("charstring format %a",version)
+ end
+ for i=1,#dictionaries do
+ top = 0
+ result = version == "cff" and {
+ monospaced = false,
+ italicangle = 0,
+ underlineposition = -100,
+ underlinethickness = 50,
+ painttype = 0,
+ charstringtype = 2,
+ fontmatrix = { 0.001, 0, 0, 0.001, 0, 0 },
+ fontbbox = { 0, 0, 0, 0 },
+ strokewidth = 0,
+ charset = 0,
+ encoding = 0,
+ cid = {
+ fontversion = 0,
+ fontrevision = 0,
+ fonttype = 0,
+ count = 8720,
+ }
+ } or {
+ charstringtype = 2,
+ charset = 0,
+ vstore = 0,
+ cid = {
+ -- nothing yet
+ },
+ }
+ lpegmatch(p_dictionary,dictionaries[i])
+ dictionaries[i] = result
+ end
+ --
+ result = { }
+ top = 0
+ stack = { }
+ end
+
+ parseprivates = function(data,dictionaries)
+ stack = { }
+ strings = data.strings
+ for i=1,#dictionaries do
+ local private = dictionaries[i].private
+ if private and private.data then
+ top = 0
+ result = {
+ forcebold = false,
+ languagegroup = 0,
+ expansionfactor = 0.06,
+ initialrandomseed = 0,
+ subroutines = 0,
+ defaultwidthx = 0,
+ nominalwidthx = 0,
+ cid = {
+ -- actually an error
+ },
+ }
+ lpegmatch(p_dictionary,private.data)
+ private.data = result
+ end
+ end
+ result = { }
+ top = 0
+ stack = { }
+ end
+
+ -- All bezier curves have 6 points with successive pairs relative to
+ -- the previous pair. Some can be left out and are then copied or zero
+ -- (optimization).
+ --
+ -- We are not really interested in all the details of a glyph because we
+ -- only need to calculate the boundingbox. So, todo: a quick no result but
+ -- calculate only variant.
+ --
+ -- The conversion is straightforward and the specification os clear once
+ -- you understand that the x and y needs to be updates each step. It's also
+ -- quite easy to test because in mp a shape will look bad when a few variables
+ -- are swapped. But still there might be bugs down here because not all
+ -- variants are seen in a font so far. We are less compact that the ff code
+ -- because there quite some variants are done in one helper with a lot of
+ -- testing for states.
+
+ local x = 0
+ local y = 0
+ local width = false
+ local lsb = 0
+ local result = { }
+ local r = 0
+ local stems = 0
+ local globalbias = 0
+ local localbias = 0
+ local nominalwidth = 0
+ local defaultwidth = 0
+ local charset = false
+ local globals = false
+ local locals = false
+ local depth = 1
+ local xmin = 0
+ local xmax = 0
+ local ymin = 0
+ local ymax = 0
+ local checked = false
+ local keepcurve = false
+ local version = 2
+ local regions = false
+ local nofregions = 0
+ local region = false
+ local factors = false
+ local axis = false
+ local vsindex = 0
+ local justpass = false
+ local seacs = { }
+ local procidx = nil
+
+ local function showstate(where,i,n)
+ if i then
+ local j = i + n - 1
+ report("%w%-10s : [%s] step",depth*2+2,where,concat(stack," ",i,j <= top and j or top))
+ else
+ report("%w%-10s : [%s] n=%i",depth*2,where,concat(stack," ",1,top),top)
+ end
+ end
+
+ local function showvalue(where,value,showstack)
+ if showstack then
+ report("%w%-10s : %s : [%s] n=%i",depth*2,where,tostring(value),concat(stack," ",1,top),top)
+ else
+ report("%w%-10s : %s",depth*2,where,tostring(value))
+ end
+ end
+
+ -- All these indirect calls make this run slower but it's cleaner this way
+ -- and we cache the result. As we moved the boundingbox code inline we gain
+ -- some back. I inlined some of then and a bit speed can be gained by more
+ -- inlining but not that much.
+
+ -- Maybe have several action tables:
+ --
+ -- keep curve / checked
+ -- keep curve / not checked
+ -- checked
+ -- not checked
+
+ local function xymoveto()
+ if keepcurve then
+ r = r + 1
+ result[r] = { x, y, "m" }
+ end
+ if checked then
+ if x > xmax then xmax = x elseif x < xmin then xmin = x end
+ if y > ymax then ymax = y elseif y < ymin then ymin = y end
+ else
+ xmin = x
+ ymin = y
+ xmax = x
+ ymax = y
+ checked = true
+ end
+ end
+
+ local function xmoveto() -- slight speedup
+ if keepcurve then
+ r = r + 1
+ result[r] = { x, y, "m" }
+ end
+ if not checked then
+ xmin = x
+ ymin = y
+ xmax = x
+ ymax = y
+ checked = true
+ elseif x > xmax then
+ xmax = x
+ elseif x < xmin then
+ xmin = x
+ end
+ end
+
+ local function ymoveto() -- slight speedup
+ if keepcurve then
+ r = r + 1
+ result[r] = { x, y, "m" }
+ end
+ if not checked then
+ xmin = x
+ ymin = y
+ xmax = x
+ ymax = y
+ checked = true
+ elseif y > ymax then
+ ymax = y
+ elseif y < ymin then
+ ymin = y
+ end
+ end
+
+ local function moveto()
+ if trace_charstrings then
+ showstate("moveto")
+ end
+ top = 0 -- forgotten
+ xymoveto()
+ end
+
+ local function xylineto() -- we could inline, no blend
+ if keepcurve then
+ r = r + 1
+ result[r] = { x, y, "l" }
+ end
+ if checked then
+ if x > xmax then xmax = x elseif x < xmin then xmin = x end
+ if y > ymax then ymax = y elseif y < ymin then ymin = y end
+ else
+ xmin = x
+ ymin = y
+ xmax = x
+ ymax = y
+ checked = true
+ end
+ end
+
+ local function xlineto() -- slight speedup
+ if keepcurve then
+ r = r + 1
+ result[r] = { x, y, "l" }
+ end
+ if not checked then
+ xmin = x
+ ymin = y
+ xmax = x
+ ymax = y
+ checked = true
+ elseif x > xmax then
+ xmax = x
+ elseif x < xmin then
+ xmin = x
+ end
+ end
+
+ local function ylineto() -- slight speedup
+ if keepcurve then
+ r = r + 1
+ result[r] = { x, y, "l" }
+ end
+ if not checked then
+ xmin = x
+ ymin = y
+ xmax = x
+ ymax = y
+ checked = true
+ elseif y > ymax then
+ ymax = y
+ elseif y < ymin then
+ ymin = y
+ end
+ end
+
+ local function xycurveto(x1,y1,x2,y2,x3,y3,i,n) -- called local so no blend here
+ if trace_charstrings then
+ showstate("curveto",i,n)
+ end
+ if keepcurve then
+ r = r + 1
+ result[r] = { x1, y1, x2, y2, x3, y3, "c" }
+ end
+ if checked then
+ if x1 > xmax then xmax = x1 elseif x1 < xmin then xmin = x1 end
+ if y1 > ymax then ymax = y1 elseif y1 < ymin then ymin = y1 end
+ else
+ xmin = x1
+ ymin = y1
+ xmax = x1
+ ymax = y1
+ checked = true
+ end
+ if x2 > xmax then xmax = x2 elseif x2 < xmin then xmin = x2 end
+ if y2 > ymax then ymax = y2 elseif y2 < ymin then ymin = y2 end
+ if x3 > xmax then xmax = x3 elseif x3 < xmin then xmin = x3 end
+ if y3 > ymax then ymax = y3 elseif y3 < ymin then ymin = y3 end
+ end
+
+ local function rmoveto()
+ if not width then
+ if top > 2 then
+ width = stack[1]
+ if trace_charstrings then
+ showvalue("backtrack width",width)
+ end
+ else
+ width = true
+ end
+ end
+ if trace_charstrings then
+ showstate("rmoveto")
+ end
+ x = x + stack[top-1] -- dx1
+ y = y + stack[top] -- dy1
+ top = 0
+ xymoveto()
+ end
+
+ local function hmoveto()
+ if not width then
+ if top > 1 then
+ width = stack[1]
+ if trace_charstrings then
+ showvalue("backtrack width",width)
+ end
+ else
+ width = true
+ end
+ end
+ if trace_charstrings then
+ showstate("hmoveto")
+ end
+ x = x + stack[top] -- dx1
+ top = 0
+ xmoveto()
+ end
+
+ local function vmoveto()
+ if not width then
+ if top > 1 then
+ width = stack[1]
+ if trace_charstrings then
+ showvalue("backtrack width",width)
+ end
+ else
+ width = true
+ end
+ end
+ if trace_charstrings then
+ showstate("vmoveto")
+ end
+ y = y + stack[top] -- dy1
+ top = 0
+ ymoveto()
+ end
+
+ local function rlineto()
+ if trace_charstrings then
+ showstate("rlineto")
+ end
+ for i=1,top,2 do
+ x = x + stack[i] -- dxa
+ y = y + stack[i+1] -- dya
+ xylineto()
+ end
+ top = 0
+ end
+
+ local function hlineto() -- x (y,x)+ | (x,y)+
+ if trace_charstrings then
+ showstate("hlineto")
+ end
+ if top == 1 then
+ x = x + stack[1]
+ xlineto()
+ else
+ local swap = true
+ for i=1,top do
+ if swap then
+ x = x + stack[i]
+ xlineto()
+ swap = false
+ else
+ y = y + stack[i]
+ ylineto()
+ swap = true
+ end
+ end
+ end
+ top = 0
+ end
+
+ local function vlineto() -- y (x,y)+ | (y,x)+
+ if trace_charstrings then
+ showstate("vlineto")
+ end
+ if top == 1 then
+ y = y + stack[1]
+ ylineto()
+ else
+ local swap = false
+ for i=1,top do
+ if swap then
+ x = x + stack[i]
+ xlineto()
+ swap = false
+ else
+ y = y + stack[i]
+ ylineto()
+ swap = true
+ end
+ end
+ end
+ top = 0
+ end
+
+ local function rrcurveto()
+ if trace_charstrings then
+ showstate("rrcurveto")
+ end
+if top == 6 then
+ local ax = x + stack[1] -- dxa
+ local ay = y + stack[2] -- dya
+ local bx = ax + stack[3] -- dxb
+ local by = ay + stack[4] -- dyb
+ x = bx + stack[5] -- dxc
+ y = by + stack[6] -- dyc
+ xycurveto(ax,ay,bx,by,x,y,1,6)
+else
+-- print("rr",top==6,top)
+ for i=1,top,6 do
+ local ax = x + stack[i] -- dxa
+ local ay = y + stack[i+1] -- dya
+ local bx = ax + stack[i+2] -- dxb
+ local by = ay + stack[i+3] -- dyb
+ x = bx + stack[i+4] -- dxc
+ y = by + stack[i+5] -- dyc
+ xycurveto(ax,ay,bx,by,x,y,i,6)
+ end
+end
+ top = 0
+ end
+
+ local function hhcurveto()
+ if trace_charstrings then
+ showstate("hhcurveto")
+ end
+ local s = 1
+ if top % 2 ~= 0 then
+ y = y + stack[1] -- dy1
+ s = 2
+ end
+if top == 4 then
+ local ax = x + stack[1] -- dxa
+ local ay = y
+ local bx = ax + stack[2] -- dxb
+ local by = ay + stack[3] -- dyb
+ x = bx + stack[4] -- dxc
+ y = by
+ xycurveto(ax,ay,bx,by,x,y,1,4)
+else
+ for i=s,top,4 do
+ local ax = x + stack[i] -- dxa
+ local ay = y
+ local bx = ax + stack[i+1] -- dxb
+ local by = ay + stack[i+2] -- dyb
+ x = bx + stack[i+3] -- dxc
+ y = by
+ xycurveto(ax,ay,bx,by,x,y,i,4)
+ end
+end
+ top = 0
+ end
+
+ local function vvcurveto()
+ if trace_charstrings then
+ showstate("vvcurveto")
+ end
+ local s = 1
+ local d = 0
+ if top % 2 ~= 0 then
+ d = stack[1] -- dx1
+ s = 2
+ end
+if top == 4 then
+ local ax = x + d
+ local ay = y + stack[1] -- dya
+ local bx = ax + stack[2] -- dxb
+ local by = ay + stack[3] -- dyb
+ x = bx
+ y = by + stack[4] -- dyc
+ xycurveto(ax,ay,bx,by,x,y,1,4)
+ d = 0
+else
+ for i=s,top,4 do
+ local ax = x + d
+ local ay = y + stack[i] -- dya
+ local bx = ax + stack[i+1] -- dxb
+ local by = ay + stack[i+2] -- dyb
+ x = bx
+ y = by + stack[i+3] -- dyc
+ xycurveto(ax,ay,bx,by,x,y,i,4)
+ d = 0
+ end
+end
+ top = 0
+ end
+
+ local function xxcurveto(swap)
+ local last = top % 4 ~= 0 and stack[top]
+ if last then
+ top = top - 1
+ end
+if top == 4 then
+ local ax, ay, bx, by
+ if swap then
+ ax = x + stack[1]
+ ay = y
+ bx = ax + stack[2]
+ by = ay + stack[3]
+ y = by + stack[4]
+ if last then
+ x = bx + last
+ else
+ x = bx
+ end
+ else
+ ax = x
+ ay = y + stack[1]
+ bx = ax + stack[2]
+ by = ay + stack[3]
+ x = bx + stack[4]
+ if last then
+ y = by + last
+ else
+ y = by
+ end
+ end
+ xycurveto(ax,ay,bx,by,x,y,1 ,4)
+else
+ for i=1,top,4 do
+ local ax, ay, bx, by
+ if swap then
+ ax = x + stack[i]
+ ay = y
+ bx = ax + stack[i+1]
+ by = ay + stack[i+2]
+ y = by + stack[i+3]
+ if last and i+3 == top then
+ x = bx + last
+ else
+ x = bx
+ end
+ swap = false
+ else
+ ax = x
+ ay = y + stack[i]
+ bx = ax + stack[i+1]
+ by = ay + stack[i+2]
+ x = bx + stack[i+3]
+ if last and i+3 == top then
+ y = by + last
+ else
+ y = by
+ end
+ swap = true
+ end
+ xycurveto(ax,ay,bx,by,x,y,i,4)
+ end
+end
+ top = 0
+ end
+
+ local function hvcurveto()
+ if trace_charstrings then
+ showstate("hvcurveto")
+ end
+ xxcurveto(true)
+ end
+
+ local function vhcurveto()
+ if trace_charstrings then
+ showstate("vhcurveto")
+ end
+ xxcurveto(false)
+ end
+
+ local function rcurveline()
+ if trace_charstrings then
+ showstate("rcurveline")
+ end
+ for i=1,top-2,6 do
+ local ax = x + stack[i] -- dxa
+ local ay = y + stack[i+1] -- dya
+ local bx = ax + stack[i+2] -- dxb
+ local by = ay + stack[i+3] -- dyb
+ x = bx + stack[i+4] -- dxc
+ y = by + stack[i+5] -- dyc
+ xycurveto(ax,ay,bx,by,x,y,i,6)
+ end
+ x = x + stack[top-1] -- dxc
+ y = y + stack[top] -- dyc
+ xylineto()
+ top = 0
+ end
+
+ local function rlinecurve()
+ if trace_charstrings then
+ showstate("rlinecurve")
+ end
+ if top > 6 then
+ for i=1,top-6,2 do
+ x = x + stack[i]
+ y = y + stack[i+1]
+ xylineto()
+ end
+ end
+ local ax = x + stack[top-5]
+ local ay = y + stack[top-4]
+ local bx = ax + stack[top-3]
+ local by = ay + stack[top-2]
+ x = bx + stack[top-1]
+ y = by + stack[top]
+ xycurveto(ax,ay,bx,by,x,y)
+ top = 0
+ end
+
+ -- flex is not yet tested! no loop
+
+ local function flex() -- fd not used
+ if trace_charstrings then
+ showstate("flex")
+ end
+ local ax = x + stack[1] -- dx1
+ local ay = y + stack[2] -- dy1
+ local bx = ax + stack[3] -- dx2
+ local by = ay + stack[4] -- dy2
+ local cx = bx + stack[5] -- dx3
+ local cy = by + stack[6] -- dy3
+ xycurveto(ax,ay,bx,by,cx,cy)
+ local dx = cx + stack[7] -- dx4
+ local dy = cy + stack[8] -- dy4
+ local ex = dx + stack[9] -- dx5
+ local ey = dy + stack[10] -- dy5
+ x = ex + stack[11] -- dx6
+ y = ey + stack[12] -- dy6
+ xycurveto(dx,dy,ex,ey,x,y)
+ top = 0
+ end
+
+ local function hflex()
+ if trace_charstrings then
+ showstate("hflex")
+ end
+ local ax = x + stack[1] -- dx1
+ local ay = y
+ local bx = ax + stack[2] -- dx2
+ local by = ay + stack[3] -- dy2
+ local cx = bx + stack[4] -- dx3
+ local cy = by
+ xycurveto(ax,ay,bx,by,cx,cy)
+ local dx = cx + stack[5] -- dx4
+ local dy = by
+ local ex = dx + stack[6] -- dx5
+ local ey = y
+ x = ex + stack[7] -- dx6
+ xycurveto(dx,dy,ex,ey,x,y)
+ top = 0
+ end
+
+ local function hflex1()
+ if trace_charstrings then
+ showstate("hflex1")
+ end
+ local ax = x + stack[1] -- dx1
+ local ay = y + stack[2] -- dy1
+ local bx = ax + stack[3] -- dx2
+ local by = ay + stack[4] -- dy2
+ local cx = bx + stack[5] -- dx3
+ local cy = by
+ xycurveto(ax,ay,bx,by,cx,cy)
+ local dx = cx + stack[6] -- dx4
+ local dy = by
+ local ex = dx + stack[7] -- dx5
+ local ey = dy + stack[8] -- dy5
+ x = ex + stack[9] -- dx6
+ xycurveto(dx,dy,ex,ey,x,y)
+ top = 0
+ end
+
+ local function flex1()
+ if trace_charstrings then
+ showstate("flex1")
+ end
+ local ax = x + stack[1] --dx1
+ local ay = y + stack[2] --dy1
+ local bx = ax + stack[3] --dx2
+ local by = ay + stack[4] --dy2
+ local cx = bx + stack[5] --dx3
+ local cy = by + stack[6] --dy3
+ xycurveto(ax,ay,bx,by,cx,cy)
+ local dx = cx + stack[7] --dx4
+ local dy = cy + stack[8] --dy4
+ local ex = dx + stack[9] --dx5
+ local ey = dy + stack[10] --dy5
+ if abs(ex - x) > abs(ey - y) then -- spec: abs(dx) > abs(dy)
+ x = ex + stack[11]
+ else
+ y = ey + stack[11]
+ end
+ xycurveto(dx,dy,ex,ey,x,y)
+ top = 0
+ end
+
+ local function getstem()
+ if top == 0 then
+ -- bad
+ elseif top % 2 ~= 0 then
+ if width then
+ remove(stack,1)
+ else
+ width = remove(stack,1)
+ if trace_charstrings then
+ showvalue("width",width)
+ end
+ end
+ top = top - 1
+ end
+ if trace_charstrings then
+ showstate("stem")
+ end
+ stems = stems + (top // 2)
+ top = 0
+ end
+
+ local function getmask()
+ if top == 0 then
+ -- bad
+ elseif top % 2 ~= 0 then
+ if width then
+ remove(stack,1)
+ else
+ width = remove(stack,1)
+ if trace_charstrings then
+ showvalue("width",width)
+ end
+ end
+ top = top - 1
+ end
+ if trace_charstrings then
+ showstate(operator == 19 and "hintmark" or "cntrmask")
+ end
+ stems = stems + (top // 2)
+ top = 0
+ if stems == 0 then
+ -- forget about it
+ elseif stems <= 8 then
+ return 1
+ else
+ return (stems + 7) // 8
+ end
+ end
+
+ local function unsupported(t)
+ if trace_charstrings then
+ showstate("unsupported " .. t)
+ end
+ top = 0
+ end
+
+ local function unsupportedsub(t)
+ if trace_charstrings then
+ showstate("unsupported sub " .. t)
+ end
+ top = 0
+ end
+
+ -- type 1 (not used in type 2)
+
+ local function getstem3()
+ if trace_charstrings then
+ showstate("stem3")
+ end
+ top = 0
+ end
+
+ local function divide()
+ if version == "cff" then
+ local d = stack[top]
+ top = top - 1
+ stack[top] = stack[top] / d
+ end
+ end
+
+ local function closepath()
+ if version == "cff" then
+ if trace_charstrings then
+ showstate("closepath")
+ end
+ end
+ top = 0
+ end
+
+ local function hsbw()
+ if version == "cff" then
+ if trace_charstrings then
+ showstate("hsbw")
+ end
+ lsb = stack[top-1] or 0
+ width = stack[top]
+ end
+ top = 0
+ end
+
+ local function sbw()
+ if version == "cff" then
+ if trace_charstrings then
+ showstate("sbw")
+ end
+ lsb = stack[top-3]
+ width = stack[top-1]
+ end
+ top = 0
+ end
+
+ -- asb adx ady bchar achar seac (accented characters)
+
+ local function seac()
+ if version == "cff" then
+ if trace_charstrings then
+ showstate("seac")
+ end
+ end
+ top = 0
+ end
+
+ -- These are probably used for special cases i.e. call out to the
+ -- postscript interpreter (p 61 of the spec as well as chapter 8).
+ --
+ -- This needs checking (I have to ask Taco next time we meet.)
+
+ local popped = 3
+ local hints = 3
+
+ -- arg1 ... argn n othersubr# <callothersubr> (on postscript stack)
+
+ local function callothersubr()
+ if version == "cff" then
+ if trace_charstrings then
+ showstate("callothersubr")
+ end
+ if stack[top] == hints then
+ popped = stack[top-2]
+ else
+ popped = 3
+ end
+ local t = stack[top-1]
+ if t then
+ top = top - (t + 2)
+ if top < 0 then
+ top = 0
+ end
+ else
+ top = 0
+ end
+ else
+ top = 0
+ end
+ end
+
+ -- <pop> number (from postscript stack)
+
+ local function pop()
+ if version == "cff" then
+ if trace_charstrings then
+ showstate("pop")
+ end
+ top = top + 1
+ stack[top] = popped
+ else
+ top = 0
+ end
+ end
+
+ local function setcurrentpoint()
+ if version == "cff" then
+ if trace_charstrings then
+ showstate("setcurrentpoint (unsupported)")
+ end
+ x = x + stack[top-1]
+ y = y + stack[top]
+ end
+ top = 0
+ end
+
+ -- So far for unsupported postscript. Now some cff2 magic. As I still need
+ -- to wrap my head around the rather complex variable font specification
+ -- with regions and axis, the following approach kind of works but is more
+ -- some trial and error trick. It's still not clear how much of the complex
+ -- truetype description applies to cff. Once there are fonts out there we'll
+ -- get there. (Marcel and friends did some tests with recent cff2 fonts so
+ -- the code has been adapted accordingly.)
+
+ local reginit = false
+
+ local function updateregions(n) -- n + 1
+ if regions then
+ local current = regions[n+1] or regions[1]
+ nofregions = #current
+ if axis and n ~= reginit then
+ factors = { }
+ for i=1,nofregions do
+ local region = current[i]
+ local s = 1
+ for j=1,#axis do
+ local f = axis[j]
+ local r = region[j]
+ local start = r.start
+ local peak = r.peak
+ local stop = r.stop
+ if start > peak or peak > stop then
+ -- * 1
+ elseif start < 0 and stop > 0 and peak ~= 0 then
+ -- * 1
+ elseif peak == 0 then
+ -- * 1
+ elseif f < start or f > stop then
+ -- * 0
+ s = 0
+ break
+ elseif f < peak then
+ s = s * (f - start) / (peak - start)
+ elseif f > peak then
+ s = s * (stop - f) / (stop - peak)
+ else
+ -- * 1
+ end
+ end
+ factors[i] = s
+ end
+ end
+ end
+ reginit = n
+ end
+
+ local function setvsindex()
+ local vsindex = stack[top]
+ if trace_charstrings then
+ showstate(formatters["vsindex %i"](vsindex))
+ end
+ updateregions(vsindex)
+ top = top - 1
+ end
+
+ local function blend()
+ local n = stack[top]
+ top = top - 1
+ if axis then
+ -- x (r1x,r2x,r3x)
+ -- (x,y) (r1x,r2x,r3x) (r1y,r2y,r3y)
+ if trace_charstrings then
+ local t = top - nofregions * n
+ local m = t - n
+ for i=1,n do
+ local k = m + i
+ local d = m + n + (i-1)*nofregions
+ local old = stack[k]
+ local new = old
+ for r=1,nofregions do
+ new = new + stack[d+r] * factors[r]
+ end
+ stack[k] = new
+ showstate(formatters["blend %i of %i: %s -> %s"](i,n,old,new))
+ end
+ top = t
+ elseif n == 1 then
+ top = top - nofregions
+ local v = stack[top]
+ for r=1,nofregions do
+ v = v + stack[top+r] * factors[r]
+ end
+ stack[top] = v
+ else
+ top = top - nofregions * n
+ local d = top
+ local k = top - n
+ for i=1,n do
+ k = k + 1
+ local v = stack[k]
+ for r=1,nofregions do
+ v = v + stack[d+r] * factors[r]
+ end
+ stack[k] = v
+ d = d + nofregions
+ end
+ end
+ else
+ top = top - nofregions * n
+ end
+ end
+
+ -- Bah, we cannot use a fast lpeg because a hint has an unknown size and a
+ -- runtime capture cannot handle that well.
+
+ local actions = { [0] =
+ unsupported, -- 0
+ getstem, -- 1 -- hstem
+ unsupported, -- 2
+ getstem, -- 3 -- vstem
+ vmoveto, -- 4
+ rlineto, -- 5
+ hlineto, -- 6
+ vlineto, -- 7
+ rrcurveto, -- 8
+ unsupported, -- 9 -- closepath
+ unsupported, -- 10 -- calllocal,
+ unsupported, -- 11 -- callreturn,
+ unsupported, -- 12 -- elsewhere
+ hsbw, -- 13 -- hsbw (type 1 cff)
+ unsupported, -- 14 -- endchar,
+ setvsindex, -- 15 -- cff2
+ blend, -- 16 -- cff2
+ unsupported, -- 17
+ getstem, -- 18 -- hstemhm
+ getmask, -- 19 -- hintmask
+ getmask, -- 20 -- cntrmask
+ rmoveto, -- 21
+ hmoveto, -- 22
+ getstem, -- 23 -- vstemhm
+ rcurveline, -- 24
+ rlinecurve, -- 25
+ vvcurveto, -- 26
+ hhcurveto, -- 27
+ unsupported, -- 28 -- elsewhere
+ unsupported, -- 29 -- elsewhere
+ vhcurveto, -- 30
+ hvcurveto, -- 31
+ }
+
+ local reverse = { [0] =
+ "unsupported",
+ "getstem",
+ "unsupported",
+ "getstem",
+ "vmoveto",
+ "rlineto",
+ "hlineto",
+ "vlineto",
+ "rrcurveto",
+ "unsupported",
+ "unsupported",
+ "unsupported",
+ "unsupported",
+ "hsbw",
+ "unsupported",
+ "setvsindex",
+ "blend",
+ "unsupported",
+ "getstem",
+ "getmask",
+ "getmask",
+ "rmoveto",
+ "hmoveto",
+ "getstem",
+ "rcurveline",
+ "rlinecurve",
+ "vvcurveto",
+ "hhcurveto",
+ "unsupported",
+ "unsupported",
+ "vhcurveto",
+ "hvcurveto",
+ }
+
+ local subactions = {
+ -- cff 1
+ [000] = dotsection,
+ [001] = getstem3,
+ [002] = getstem3,
+ [006] = seac,
+ [007] = sbw,
+ [012] = divide,
+ [016] = callothersubr,
+ [017] = pop,
+ [033] = setcurrentpoint,
+ -- cff 2
+ [034] = hflex,
+ [035] = flex,
+ [036] = hflex1,
+ [037] = flex1,
+ }
+
+ local chars = setmetatableindex(function (t,k)
+ local v = char(k)
+ t[k] = v
+ return v
+ end)
+
+ local c_endchar = chars[14]
+
+ -- todo: round in blend
+
+ local encode = { }
+ local typeone = false
+
+ -- this eventually can become a helper
+
+ setmetatableindex(encode,function(t,i)
+ for i=-2048,-1130 do
+ -- t[i] = char(28,band(rshift(i,8),0xFF),band(i,0xFF))
+ t[i] = char(28,(i >> 8) & 0xFF,i & 0xFF)
+ end
+ for i=-1131,-108 do
+ local v = 0xFB00 - i - 108
+ -- t[i] = char(band(rshift(v,8),0xFF),band(v,0xFF))
+ t[i] = char((v >> 8) & 0xFF,v & 0xFF)
+ end
+ for i=-107,107 do
+ t[i] = chars[i + 139]
+ end
+ for i=108,1131 do
+ local v = 0xF700 + i - 108
+ -- t[i] = char(extract(v,8,8),extract(v,0,8))
+ t[i] = char((v >> 8) & 0xFF,v & 0xFF)
+ end
+ for i=1132,2048 do
+ -- t[i] = char(28,band(rshift(i,8),0xFF),band(i,0xFF))
+ t[i] = char(28,(i >> 8) & 0xFF,i & 0xFF)
+ end
+ setmetatableindex(encode,function(t,k)
+ -- as we're cff2 we write 16.16-bit signed fixed value
+ local r = round(k)
+ local v = rawget(t,r)
+ if v then
+ return v
+ end
+ local v1 = floor(k)
+ local v2 = floor((k - v1) * 0x10000)
+ -- return char(255,extract(v1,8,8),extract(v1,0,8),extract(v2,8,8),extract(v2,0,8))
+ return char(255,(v1 >> 8) & 0xFF,v1 & 0xFF,(v2 >> 8) & 0xFF,v2 & 0xFF)
+ end)
+ return t[i]
+ end)
+
+ readers.cffencoder = encode
+
+ local function p_setvsindex()
+ local vsindex = stack[top]
+ updateregions(vsindex)
+ top = top - 1
+ end
+
+ local function p_blend()
+ -- leaves n values on stack
+ local n = stack[top]
+ top = top - 1
+ if not axis then
+ -- fatal error
+ elseif n == 1 then
+ top = top - nofregions
+ local v = stack[top]
+ for r=1,nofregions do
+ v = v + stack[top+r] * factors[r]
+ end
+ stack[top] = round(v)
+ else
+ top = top - nofregions * n
+ local d = top
+ local k = top - n
+ for i=1,n do
+ k = k + 1
+ local v = stack[k]
+ for r=1,nofregions do
+ v = v + stack[d+r] * factors[r]
+ end
+ stack[k] = round(v)
+ d = d + nofregions
+ end
+ end
+ end
+
+ local function p_getstem()
+ local n = 0
+ if top % 2 ~= 0 then
+ n = 1
+ end
+ if top > n then
+ stems = stems + ((top - n) // 2)
+ end
+ end
+
+ local function p_getmask()
+ local n = 0
+ if top % 2 ~= 0 then
+ n = 1
+ end
+ if top > n then
+ stems = stems + ((top - n) // 2)
+ end
+ if stems == 0 then
+ return 0
+ elseif stems <= 8 then
+ return 1
+ else
+ return (stems + 7) // 8
+ end
+ end
+
+ -- end of experiment
+
+ local process
+
+ local function call(scope,list,bias) -- ,process)
+ depth = depth + 1
+ if top == 0 then
+ showstate(formatters["unknown %s call %s, case %s"](scope,"?",1))
+ top = 0
+ else
+ local index = stack[top] + bias
+ top = top - 1
+ if trace_charstrings then
+ showvalue(scope,index,true)
+ end
+ local tab = list[index]
+ if tab then
+ process(tab)
+ else
+ showstate(formatters["unknown %s call %s, case %s"](scope,index,2))
+ top = 0
+ end
+ end
+ depth = depth - 1
+ end
+
+ -- precompiling and reuse is much slower than redoing the calls
+
+ process = function(tab)
+ local i = 1
+ local n = #tab
+ while i <= n do
+ local t = tab[i]
+ if t >= 32 then
+ top = top + 1
+ if t <= 246 then
+ -- -107 .. +107
+ stack[top] = t - 139
+ i = i + 1
+ elseif t <= 250 then
+ -- +108 .. +1131
+ -- stack[top] = (t-247)*256 + tab[i+1] + 108
+ -- stack[top] = t*256 - 247*256 + tab[i+1] + 108
+ stack[top] = t*256 - 63124 + tab[i+1]
+ i = i + 2
+ elseif t <= 254 then
+ -- -1131 .. -108
+ -- stack[top] = -(t-251)*256 - tab[i+1] - 108
+ -- stack[top] = -t*256 + 251*256 - tab[i+1] - 108
+ stack[top] = -t*256 + 64148 - tab[i+1]
+ i = i + 2
+ elseif typeone then
+ local n = 0x1000000 * tab[i+1] + 0x10000 * tab[i+2] + 0x100 * tab[i+3] + tab[i+4]
+ if n >= 0x8000000 then
+ n = n - 0xFFFFFFFF - 1
+ end
+ stack[top] = n
+ i = i + 5
+ else
+ local n1 = 0x100 * tab[i+1] + tab[i+2]
+ local n2 = 0x100 * tab[i+3] + tab[i+4]
+ if n1 >= 0x8000 then
+ n1 = n1 - 0x10000
+ end
+ stack[top] = n1 + n2/0xFFFF
+ i = i + 5
+ end
+ elseif t == 28 then
+ -- -32768 .. +32767 : b1<<8 | b2
+ top = top + 1
+ local n = 0x100 * tab[i+1] + tab[i+2]
+ if n >= 0x8000 then
+ -- stack[top] = n - 0xFFFF - 1
+ stack[top] = n - 0x10000
+ else
+ stack[top] = n
+ end
+ i = i + 3
+ elseif t == 11 then -- not in cff2
+ if trace_charstrings then
+ showstate("return")
+ end
+ return
+ elseif t == 10 then
+ call("local",locals,localbias) -- ,process)
+ i = i + 1
+ elseif t == 14 then -- not in cff2
+ if width then
+ -- okay
+ elseif top > 0 then
+ width = stack[1]
+ if trace_charstrings then
+ showvalue("width",width)
+ end
+ else
+ width = true
+ end
+ if trace_charstrings then
+ showstate("endchar")
+ end
+ return
+ elseif t == 29 then
+ call("global",globals,globalbias) -- ,process)
+ i = i + 1
+ elseif t == 12 then
+ i = i + 1
+ local t = tab[i]
+ if justpass then
+ if t >= 34 and t <= 37 then -- flexes
+ for i=1,top do
+ r = r + 1 ; result[r] = encode[stack[i]]
+ end
+ r = r + 1 ; result[r] = chars[12]
+ r = r + 1 ; result[r] = chars[t]
+ top = 0
+ elseif t == 6 then
+ seacs[procidx] = {
+ asb = stack[1],
+ adx = stack[2],
+ ady = stack[3],
+ base = stack[4],
+ accent = stack[5],
+ width = width,
+ lsb = lsb,
+ }
+ top = 0
+ else
+ local a = subactions[t]
+ if a then
+ a(t)
+ else
+ top = 0
+ end
+ end
+ else
+ local a = subactions[t]
+ if a then
+ a(t)
+ else
+ if trace_charstrings then
+ showvalue("<subaction>",t)
+ end
+ top = 0
+ end
+ end
+ i = i + 1
+ elseif justpass then
+ -- todo: local a = passactions
+ if t == 15 then
+ p_setvsindex()
+ i = i + 1
+ elseif t == 16 then
+ local s = p_blend() or 0
+ i = i + s + 1
+ -- cff 1: (when cff2 strip them)
+ elseif t == 1 or t == 3 or t == 18 or operation == 23 then
+ p_getstem() -- at the start
+ if version == "cff" then
+-- if true then
+ if top > 0 then
+ for i=1,top do
+ r = r + 1 ; result[r] = encode[stack[i]]
+ end
+ top = 0
+ end
+ r = r + 1 ; result[r] = chars[t]
+ else
+ top = 0
+ end
+ i = i + 1
+ -- cff 1: (when cff2 strip them)
+ elseif t == 19 or t == 20 then
+ local s = p_getmask() or 0 -- after the stems
+-- if version == "cff" then
+ if true then
+ if top > 0 then
+ for i=1,top do
+ r = r + 1 ; result[r] = encode[stack[i]]
+ end
+ top = 0
+ end
+ r = r + 1 ; result[r] = chars[t]
+ for j=1,s do
+ i = i + 1
+ r = r + 1 ; result[r] = chars[tab[i]]
+ end
+ else
+ i = i + s
+ top = 0
+ end
+ i = i + 1
+ -- cff 1: closepath
+ elseif t == 9 then
+ top = 0
+ i = i + 1
+ elseif t == 13 then
+ hsbw()
+-- if version == "cff" then
+ if true then
+ -- we do a moveto over lsb
+ r = r + 1 ; result[r] = encode[lsb]
+ r = r + 1 ; result[r] = chars[22]
+ else
+ -- lsb is supposed to be zero
+ end
+ i = i + 1
+ else
+ if trace_charstrings then
+ showstate(reverse[t] or "<action>")
+ end
+ if top > 0 then
+ -- if t == 8 and top > 42 then
+ if t == 8 and top > 48 then
+ -- let's assume this only happens for rrcurveto .. the other ones would need some more
+ -- complex handling (cff2 stuff)
+ --
+ -- dx1 dy1 (dx1+dx2) (dy1+dy2) (dx1+dx2+dx3) (dy1+dy2+dy3) rcurveto.
+ local n = 0
+ for i=1,top do
+ -- if n == 42 then
+ if n == 48 then
+-- local zero = encode[0]
+-- local res3 = result[r-3]
+-- local res2 = result[r-2]
+-- local res1 = result[r-1]
+-- local res0 = result[r]
+-- result[r-3] = zero
+-- result[r-2] = zero
+ r = r + 1 ; result[r] = chars[t]
+-- r = r + 1 ; result[r] = zero
+-- r = r + 1 ; result[r] = zero
+-- r = r + 1 ; result[r] = res3
+-- r = r + 1 ; result[r] = res2
+-- r = r + 1 ; result[r] = res1
+-- r = r + 1 ; result[r] = res0
+ n = 1
+ else
+ n = n + 1
+ end
+ r = r + 1 ; result[r] = encode[stack[i]]
+ end
+ else
+ for i=1,top do
+ r = r + 1 ; result[r] = encode[stack[i]]
+ end
+ end
+ top = 0
+ end
+ r = r + 1 ; result[r] = chars[t]
+ i = i + 1
+ end
+ else
+ local a = actions[t]
+ if a then
+ local s = a(t)
+ if s then
+ i = i + s + 1
+ else
+ i = i + 1
+ end
+ else
+ if trace_charstrings then
+ showstate(reverse[t] or "<action>")
+ end
+ top = 0
+ i = i + 1
+ end
+ end
+ end
+ end
+
+ -- local function calculatebounds(segments,x,y)
+ -- local nofsegments = #segments
+ -- if nofsegments == 0 then
+ -- return { x, y, x, y }
+ -- else
+ -- local xmin = 10000
+ -- local xmax = -10000
+ -- local ymin = 10000
+ -- local ymax = -10000
+ -- if x < xmin then xmin = x end
+ -- if x > xmax then xmax = x end
+ -- if y < ymin then ymin = y end
+ -- if y > ymax then ymax = y end
+ -- -- we now have a reasonable start so we could
+ -- -- simplify the next checks
+ -- for i=1,nofsegments do
+ -- local s = segments[i]
+ -- local x = s[1]
+ -- local y = s[2]
+ -- if x < xmin then xmin = x end
+ -- if x > xmax then xmax = x end
+ -- if y < ymin then ymin = y end
+ -- if y > ymax then ymax = y end
+ -- if s[#s] == "c" then -- "curveto"
+ -- local x = s[3]
+ -- local y = s[4]
+ -- if x < xmin then xmin = x elseif x > xmax then xmax = x end
+ -- if y < ymin then ymin = y elseif y > ymax then ymax = y end
+ -- local x = s[5]
+ -- local y = s[6]
+ -- if x < xmin then xmin = x elseif x > xmax then xmax = x end
+ -- if y < ymin then ymin = y elseif y > ymax then ymax = y end
+ -- end
+ -- end
+ -- return { round(xmin), round(ymin), round(xmax), round(ymax) } -- doesn't make ceil more sense
+ -- end
+ -- end
+
+ local function setbias(globals,locals,nobias)
+ if nobias then
+ return 0, 0
+ else
+ local g = #globals
+ local l = #locals
+ return
+ ((g < 1240 and 107) or (g < 33900 and 1131) or 32768) + 1,
+ ((l < 1240 and 107) or (l < 33900 and 1131) or 32768) + 1
+ end
+ end
+
+ local function processshape(glyphs,tab,index,hack)
+
+ if not tab then
+ glyphs[index] = {
+ boundingbox = { 0, 0, 0, 0 },
+ width = 0,
+ name = charset and charset[index] or nil,
+ }
+ return
+ end
+
+ tab = bytetable(tab)
+
+ x = 0
+ y = 0
+ width = false
+ lsb = 0
+ r = 0
+ top = 0
+ stems = 0
+ result = { } -- we could reuse it when only boundingbox calculations are needed
+ popped = 3
+ procidx = index
+
+ xmin = 0
+ xmax = 0
+ ymin = 0
+ ymax = 0
+ checked = false
+ if trace_charstrings then
+ report("glyph: %i",index)
+ report("data : % t",tab)
+ end
+
+ if regions then
+ updateregions(vsindex)
+ end
+
+ process(tab)
+ if hack then
+ return x, y
+ end
+
+ local boundingbox = {
+ round(xmin),
+ round(ymin),
+ round(xmax),
+ round(ymax),
+ }
+
+ if width == true or width == false then
+ width = defaultwidth
+ else
+ width = nominalwidth + width
+ end
+
+ local glyph = glyphs[index] -- can be autodefined in otr
+ if justpass then
+ r = r + 1
+ result[r] = c_endchar
+ local stream = concat(result)
+result = nil
+ -- if trace_charstrings then
+ -- report("vdata: %s",stream)
+ -- end
+ if glyph then
+ glyph.stream = stream
+ glyph.width = width
+ else
+ glyphs[index] = { stream = stream, width = width }
+ end
+ elseif glyph then
+ glyph.segments = keepcurve ~= false and result or nil
+ glyph.boundingbox = boundingbox
+ if not glyph.width then
+ glyph.width = width
+ end
+ if charset and not glyph.name then
+ glyph.name = charset[index]
+ end
+ -- glyph.sidebearing = 0 -- todo
+ elseif keepcurve then
+ glyphs[index] = {
+ segments = result,
+ boundingbox = boundingbox,
+ width = width,
+ name = charset and charset[index] or nil,
+ -- sidebearing = 0,
+ }
+result = nil
+ else
+ glyphs[index] = {
+ boundingbox = boundingbox,
+ width = width,
+ name = charset and charset[index] or nil,
+ }
+ end
+ if trace_charstrings then
+ report("width : %s",tostring(width))
+ report("boundingbox: % t",boundingbox)
+ end
+
+ end
+
+ startparsing = function(fontdata,data,streams)
+ reginit = false
+ axis = false
+ regions = data.regions
+ justpass = streams == true
+ popped = 3
+ seacs = { }
+ if regions then
+ -- this was:
+ -- regions = { regions } -- needs checking
+ -- and is now (MFC):
+ regions = { }
+ local deltas = data.deltas
+ for i = 1, #deltas do
+ regions[i] = deltas[i].regions
+ end
+ axis = data.factors or false
+ end
+ end
+
+ stopparsing = function(fontdata,data)
+ stack = { }
+ glyphs = false
+ result = { }
+ top = 0
+ locals = false
+ globals = false
+ strings = false
+ popped = 3
+ seacs = { }
+ end
+
+ local function setwidths(private)
+ if not private then
+ return 0, 0
+ end
+ local privatedata = private.data
+ if not privatedata then
+ return 0, 0
+ end
+ return privatedata.nominalwidthx or 0, privatedata.defaultwidthx or 0
+ end
+
+ parsecharstrings = function(fontdata,data,glphs,doshapes,tversion,streams,nobias,istypeone)
+
+ local dictionary = data.dictionaries[1]
+ local charstrings = dictionary.charstrings
+
+ keepcurve = doshapes
+ version = tversion
+ typeone = istypeone or false
+ strings = data.strings
+ globals = data.routines or { }
+ locals = dictionary.subroutines or { }
+ charset = dictionary.charset
+ vsindex = dictionary.vsindex or 0
+
+ local glyphs = glphs or { }
+
+ globalbias, localbias = setbias(globals,locals,nobias)
+ nominalwidth, defaultwidth = setwidths(dictionary.private)
+
+ if charstrings then
+ startparsing(fontdata,data,streams)
+ for index=1,#charstrings do
+ processshape(glyphs,charstrings[index],index-1)
+ end
+ if justpass and next(seacs) then
+ -- old type 1 stuff ... seacs
+ local charset = data.dictionaries[1].charset
+ if charset then
+ local lookup = table.swapped(charset)
+ for index, v in next, seacs do
+ local bindex = lookup[standardnames[v.base]]
+ local aindex = lookup[standardnames[v.accent]]
+ local bglyph = bindex and glyphs[bindex]
+ local aglyph = aindex and glyphs[aindex]
+ if bglyph and aglyph then
+ -- this is a real ugly hack but we seldom enter this branch (e.g. old lbr)
+ local jp = justpass
+ justpass = false
+ local x, y = processshape(glyphs,charstrings[bindex+1],bindex,true)
+ justpass = jp
+ --
+ local base = bglyph.stream
+ local accent = aglyph.stream
+ local moveto = encode[-x-v.asb+v.adx] .. chars[22]
+ .. encode[-y +v.ady] .. chars[ 4]
+ -- prune an endchar
+ base = sub(base,1,#base-1)
+ -- combine them
+ glyphs[index].stream = base .. moveto .. accent
+ end
+ end
+ end
+ end
+ stopparsing(fontdata,data)
+ else
+ report("no charstrings")
+ end
+ return glyphs
+ end
+
+ parsecharstring = function(fontdata,data,dictionary,tab,glphs,index,doshapes,tversion,streams)
+
+ keepcurve = doshapes
+ version = tversion
+ strings = data.strings
+ globals = data.routines or { }
+ locals = dictionary.subroutines or { }
+ charset = false
+ vsindex = dictionary.vsindex or 0
+
+ local glyphs = glphs or { }
+
+ justpass = streams == true
+ seacs = { }
+
+ globalbias, localbias = setbias(globals,locals,nobias)
+ nominalwidth, defaultwidth = setwidths(dictionary.private)
+
+ processshape(glyphs,tab,index-1)
+
+ return glyphs[index]
+ end
+
+end
+
+local function readglobals(f,data,version)
+ local routines = readlengths(f,version == "cff2")
+ for i=1,#routines do
+ routines[i] = readbytetable(f,routines[i])
+ end
+ data.routines = routines
+end
+
+local function readencodings(f,data)
+ data.encodings = { }
+end
+
+local function readcharsets(f,data,dictionary)
+ local header = data.header
+ local strings = data.strings
+ local nofglyphs = data.nofglyphs
+ local charsetoffset = dictionary.charset
+ if charsetoffset and charsetoffset ~= 0 then
+ setposition(f,header.offset+charsetoffset)
+ local format = readbyte(f)
+ local charset = { [0] = ".notdef" }
+ dictionary.charset = charset
+ if format == 0 then
+ for i=1,nofglyphs do
+ charset[i] = strings[readushort(f)]
+ end
+ elseif format == 1 or format == 2 then
+ local readcount = format == 1 and readbyte or readushort
+ local i = 1
+ while i <= nofglyphs do
+ local sid = readushort(f)
+ local n = readcount(f)
+ for s=sid,sid+n do
+ charset[i] = strings[s]
+ i = i + 1
+ if i > nofglyphs then
+ break
+ end
+ end
+ end
+ else
+ report("cff parser: unsupported charset format %a",format)
+ end
+ else
+ dictionary.nocharset = true
+ dictionary.charset = nil
+ end
+end
+
+local function readprivates(f,data)
+ local header = data.header
+ local dictionaries = data.dictionaries
+ local private = dictionaries[1].private
+ if private then
+ setposition(f,header.offset+private.offset)
+ private.data = readstring(f,private.size)
+ end
+end
+
+local function readlocals(f,data,dictionary,version)
+ local header = data.header
+ local private = dictionary.private
+ if private then
+ local subroutineoffset = private.data.subroutines
+ if subroutineoffset ~= 0 then
+ setposition(f,header.offset+private.offset+subroutineoffset)
+ local subroutines = readlengths(f,version == "cff2")
+ for i=1,#subroutines do
+ subroutines[i] = readbytetable(f,subroutines[i])
+ end
+ dictionary.subroutines = subroutines
+ private.data.subroutines = nil
+ else
+ dictionary.subroutines = { }
+ end
+ else
+ dictionary.subroutines = { }
+ end
+end
+
+-- These charstrings are little programs and described in: Technical Note #5177. A truetype
+-- font has only one dictionary.
+
+local function readcharstrings(f,data,version)
+ local header = data.header
+ local dictionaries = data.dictionaries
+ local dictionary = dictionaries[1]
+ local stringtype = dictionary.charstringtype
+ local offset = dictionary.charstrings
+ if type(offset) ~= "number" then
+ -- weird
+ elseif stringtype == 2 then
+ setposition(f,header.offset+offset)
+ -- could be a metatable .. delayed loading
+ local charstrings = readlengths(f,version=="cff2")
+ local nofglyphs = #charstrings
+ for i=1,nofglyphs do
+ charstrings[i] = readstring(f,charstrings[i])
+ end
+ data.nofglyphs = nofglyphs
+ dictionary.charstrings = charstrings
+ else
+ report("unsupported charstr type %i",stringtype)
+ data.nofglyphs = 0
+ dictionary.charstrings = { }
+ end
+end
+
+-- cid (maybe do this stepwise so less mem) -- share with above
+
+local function readcidprivates(f,data)
+ local header = data.header
+ local dictionaries = data.dictionaries[1].cid.dictionaries
+ for i=1,#dictionaries do
+ local dictionary = dictionaries[i]
+ local private = dictionary.private
+ if private then
+ setposition(f,header.offset+private.offset)
+ private.data = readstring(f,private.size)
+ end
+ end
+ parseprivates(data,dictionaries)
+end
+
+readers.parsecharstrings = parsecharstrings -- used in font-onr.lua (type 1)
+
+local function readnoselect(f,fontdata,data,glyphs,doshapes,version,streams)
+ local dictionaries = data.dictionaries
+ local dictionary = dictionaries[1]
+ local cid = not dictionary.private and dictionary.cid
+ readglobals(f,data,version)
+ readcharstrings(f,data,version)
+ if version == "cff2" then
+ dictionary.charset = nil
+ else
+ readencodings(f,data)
+ readcharsets(f,data,dictionary)
+ end
+ if cid then
+ local fdarray = cid.fdarray
+ if fdarray then
+ setposition(f,data.header.offset + fdarray)
+ local dictionaries = readlengths(f,version=="cff2")
+ local nofdictionaries = #dictionaries
+ if nofdictionaries > 0 then
+ for i=1,nofdictionaries do
+ dictionaries[i] = readstring(f,dictionaries[i])
+ end
+ parsedictionaries(data,dictionaries)
+ dictionary.private = dictionaries[1].private
+ if nofdictionaries > 1 then
+ report("ignoring dictionaries > 1 in cid font")
+ end
+ end
+ end
+ end
+ readprivates(f,data)
+ parseprivates(data,data.dictionaries)
+ readlocals(f,data,dictionary,version)
+ startparsing(fontdata,data,streams)
+ parsecharstrings(fontdata,data,glyphs,doshapes,version,streams,false)
+ stopparsing(fontdata,data)
+end
+
+local function readfdselect(f,fontdata,data,glyphs,doshapes,version,streams)
+ local header = data.header
+ local dictionaries = data.dictionaries
+ local dictionary = dictionaries[1]
+ local cid = dictionary.cid
+ local cidselect = cid and cid.fdselect
+ readglobals(f,data,version)
+ readcharstrings(f,data,version)
+ if version ~= "cff2" then
+ readencodings(f,data)
+ end
+ local charstrings = dictionary.charstrings
+ local fdindex = { }
+ local nofglyphs = data.nofglyphs
+ local maxindex = -1
+ setposition(f,header.offset+cidselect)
+ local format = readbyte(f)
+ if format == 1 then
+ for i=0,nofglyphs do -- notdef included (needs checking)
+ local index = readbyte(f)
+ fdindex[i] = index
+ if index > maxindex then
+ maxindex = index
+ end
+ end
+ elseif format == 3 then
+ local nofranges = readushort(f)
+ local first = readushort(f)
+ local index = readbyte(f)
+ while true do
+ local last = readushort(f)
+ if index > maxindex then
+ maxindex = index
+ end
+ for i=first,last do
+ fdindex[i] = index
+ end
+ if last >= nofglyphs then
+ break
+ else
+ first = last + 1
+ index = readbyte(f)
+ end
+ end
+ else
+ report("unsupported fd index format %i",format)
+ end
+ -- hm, always
+ if maxindex >= 0 then
+ local cidarray = cid.fdarray
+ if cidarray then
+ setposition(f,header.offset+cidarray)
+ local dictionaries = readlengths(f,version == "cff2")
+ if #dictionaries > 0 then
+ for i=1,#dictionaries do
+ dictionaries[i] = readstring(f,dictionaries[i])
+ end
+ parsedictionaries(data,dictionaries)
+ cid.dictionaries = dictionaries
+ readcidprivates(f,data)
+ for i=1,#dictionaries do
+ readlocals(f,data,dictionaries[i],version)
+ end
+ startparsing(fontdata,data,streams)
+ for i=1,#charstrings do
+ local dictionary = dictionaries[fdindex[i]+1]
+ if dictionary then
+ parsecharstring(fontdata,data,dictionary,charstrings[i],glyphs,i,doshapes,version,streams)
+ else
+ -- report("no dictionary for %a : %a => %a",version,i,fdindex[i]+1)
+ end
+ -- charstrings[i] = false
+ end
+ stopparsing(fontdata,data)
+ else
+ report("no cid dictionaries")
+ end
+ else
+ report("no cid array")
+ end
+ end
+end
+
+local gotodatatable = readers.helpers.gotodatatable
+
+local function cleanup(data,dictionaries)
+ -- for i=1,#dictionaries do
+ -- local d = dictionaries[i]
+ -- d.subroutines = nil
+ -- end
+ -- data.strings = nil
+ -- if data then
+ -- data.charstrings = nil
+ -- data.routines = nil
+ -- end
+end
+
+function readers.cff(f,fontdata,specification)
+ local tableoffset = gotodatatable(f,fontdata,"cff",specification.details or specification.glyphs)
+ if tableoffset then
+ local header = readheader(f)
+ if header.major ~= 1 then
+ report("only version %s is supported for table %a",1,"cff")
+ return
+ end
+ local glyphs = fontdata.glyphs
+ local names = readfontnames(f)
+ local dictionaries = readtopdictionaries(f)
+ local strings = readstrings(f)
+ local data = {
+ header = header,
+ names = names,
+ dictionaries = dictionaries,
+ strings = strings,
+ nofglyphs = fontdata.nofglyphs,
+ }
+ --
+ parsedictionaries(data,dictionaries,"cff")
+ --
+ local dic = dictionaries[1]
+ local cid = dic.cid
+ --
+ local cffinfo = {
+ familyname = dic.familyname,
+ fullname = dic.fullname,
+ boundingbox = dic.boundingbox,
+ weight = dic.weight,
+ italicangle = dic.italicangle,
+ underlineposition = dic.underlineposition,
+ underlinethickness = dic.underlinethickness,
+ defaultwidth = dic.defaultwidthx,
+ nominalwidth = dic.nominalwidthx,
+ monospaced = dic.monospaced,
+ }
+ fontdata.cidinfo = cid and {
+ registry = cid.registry,
+ ordering = cid.ordering,
+ supplement = cid.supplement,
+ }
+ fontdata.cffinfo = cffinfo
+ --
+ local all = specification.shapes or specification.streams or false
+ if specification.glyphs or all then
+ if cid and cid.fdselect then
+ readfdselect(f,fontdata,data,glyphs,all,"cff",specification.streams)
+ else
+ readnoselect(f,fontdata,data,glyphs,all,"cff",specification.streams)
+ end
+ end
+ local private = dic.private
+ if private then
+ local data = private.data
+ if type(data) == "table" then
+ cffinfo.defaultwidth = data.defaultwidthx or cffinfo.defaultwidth
+ cffinfo.nominalwidth = data.nominalwidthx or cffinfo.nominalwidth
+ cffinfo.bluevalues = data.bluevalues
+ cffinfo.otherblues = data.otherblues
+ cffinfo.familyblues = data.familyblues
+ cffinfo.familyotherblues = data.familyotherblues
+ cffinfo.bluescale = data.bluescale
+ cffinfo.blueshift = data.blueshift
+ cffinfo.bluefuzz = data.bluefuzz
+ cffinfo.stdhw = data.stdhw
+ cffinfo.stdvw = data.stdvw
+ cffinfo.stemsnaph = data.stemsnaph
+ cffinfo.stemsnapv = data.stemsnapv
+ end
+ end
+ cleanup(data,dictionaries)
+ end
+end
+
+function readers.cff2(f,fontdata,specification)
+ local tableoffset = gotodatatable(f,fontdata,"cff2",specification.glyphs)
+ if tableoffset then
+ local header = readheader(f)
+ if header.major ~= 2 then
+ report("only version %s is supported for table %a",2,"cff2")
+ return
+ end
+ local glyphs = fontdata.glyphs
+ local dictionaries = { readstring(f,header.dsize) }
+ local data = {
+ header = header,
+ dictionaries = dictionaries,
+ nofglyphs = fontdata.nofglyphs,
+ }
+ --
+ parsedictionaries(data,dictionaries,"cff2")
+ --
+ local offset = dictionaries[1].vstore
+ if offset > 0 then
+ local storeoffset = dictionaries[1].vstore + data.header.offset + 2 -- cff has a preceding size field
+ local regions, deltas = readers.helpers.readvariationdata(f,storeoffset,factors)
+ --
+ data.regions = regions
+ data.deltas = deltas
+ else
+ data.regions = { }
+ data.deltas = { }
+ end
+ data.factors = specification.factors
+ --
+ local cid = data.dictionaries[1].cid
+ local all = specification.shapes or specification.streams or false
+ if cid and cid.fdselect then
+ readfdselect(f,fontdata,data,glyphs,all,"cff2",specification.streams)
+ else
+ readnoselect(f,fontdata,data,glyphs,all,"cff2",specification.streams)
+ end
+ cleanup(data,dictionaries)
+ end
+end
+
+-- temporary helper needed for checking backend patches
+
+-- function readers.cffcheck(filename)
+-- local f = io.open(filename,"rb")
+-- if f then
+-- local fontdata = {
+-- glyphs = { },
+-- }
+-- local header = readheader(f)
+-- if header.major ~= 1 then
+-- report("only version %s is supported for table %a",1,"cff")
+-- return
+-- end
+-- local names = readfontnames(f)
+-- local dictionaries = readtopdictionaries(f)
+-- local strings = readstrings(f)
+-- local glyphs = { }
+-- local data = {
+-- header = header,
+-- names = names,
+-- dictionaries = dictionaries,
+-- strings = strings,
+-- glyphs = glyphs,
+-- nofglyphs = 0,
+-- }
+-- --
+-- parsedictionaries(data,dictionaries,"cff")
+-- --
+-- local cid = data.dictionaries[1].cid
+-- if cid and cid.fdselect then
+-- readfdselect(f,fontdata,data,glyphs,false)
+-- else
+-- readnoselect(f,fontdata,data,glyphs,false)
+-- end
+-- return data
+-- end
+-- end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-chk.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-chk.lmt
index 6f927e09764..05a3611ccd2 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-chk.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-chk.lmt
@@ -12,7 +12,8 @@ if not modules then modules = { } end modules ['font-chk'] = {
-- instead we just keep the method we use but slightly adapted to the backend
-- of lmtx.
-local next = next
+local type, next = type, next
+local find, lower, gmatch = string.find, string.lower, string.gmatch
local floor = math.floor
local context = context
@@ -22,12 +23,15 @@ local bpfactor = number.dimenfactors.bp
local fastcopy = table.fastcopy
local sortedkeys = table.sortedkeys
local sortedhash = table.sortedhash
+local contains = table.contains
local report = logs.reporter("fonts")
local report_checking = logs.reporter("fonts","checking")
local allocate = utilities.storage.allocate
+local getmacro = tokens.getters.macro
+
local fonts = fonts
fonts.checkers = fonts.checkers or { }
@@ -38,8 +42,8 @@ local fontdata = fonthashes.identifiers
local fontcharacters = fonthashes.characters
local currentfont = font.current
-local addcharacters = font.addcharacters
+local definers = fonts.definers
local helpers = fonts.helpers
local addprivate = helpers.addprivate
@@ -64,7 +68,7 @@ local implement = interfaces.implement
local glyph_code = nodes.nodecodes.glyph
-local hpack_node = node.hpack
+local hpack_node = nodes.hpack
local nuts = nodes.nuts
local tonut = nuts.tonut
@@ -75,8 +79,8 @@ local setchar = nuts.setchar
local nextglyph = nuts.traversers.glyph
local remove_node = nuts.remove
-local insert_node_after = nuts.insert_after
-local insert_node_before = nuts.insert_before
+local insertnodeafter = nuts.insertafter
+local insertnodebefore = nuts.insertbefore
local copy_node = nuts.copy
local actions = false
@@ -155,15 +159,18 @@ checkers.mapping = mapping
-- sure the dimensions are known at the lua and tex end. For previous variants see
-- the mkiv files or older lmtx files. I decided to just drop the old stuff here.
-function checkers.placeholder(font,char)
- local category = chardata[char].category or "lu" -- todo: unknown
- local fakedata = mapping[category]
+function checkers.placeholder(font,char,category)
+ local category = category or chardata[char].category or "lu" -- todo: unknown
+ local fakedata = mapping[category] or mapping.lu
local tfmdata = fontdata[font]
local units = tfmdata.parameters.units or 1000
local slant = (tfmdata.parameters.slant or 0)/65536
local scale = units/1000
local rawdata = tfmdata.shared and tfmdata.shared.rawdata
local weight = (rawdata and rawdata.metadata and rawdata.metadata.pfmweight or 400)/400
+-- if slant then
+-- slant = 0.2
+-- end
local specification = {
code = "MissingGlyph",
scale = scale,
@@ -191,7 +198,7 @@ function checkers.missing(head)
local c = chardata[char]
if c then
local s = c.specials
- if s and s[1] == "char" then
+ if s and (s[1] == "char" or s[1] == "with") then -- with added
local l = #s
if l > 2 then
-- check first
@@ -208,7 +215,7 @@ function checkers.missing(head)
onetimemessage(font,char,"missing (decomposed)")
setchar(n,s[l])
for i=l-1,2,-1 do
- head, o = insert_node_before(head,o,copy_node(n))
+ head, o = insertnodebefore(head,o,copy_node(n))
setchar(o,s[i])
end
goto DONE
@@ -372,16 +379,11 @@ local function expandglyph(characters,index,done)
if n then
d.next = expandglyph(characters,n,done)
end
- local h = d.horiz_variants
- if h then
- for i=1,#h do
- h[i].glyph = expandglyph(characters,h[i].glyph,done)
- end
- end
- local v = d.vert_variants
- if v then
- for i=1,#v do
- v[i].glyph = expandglyph(characters,v[i].glyph,done)
+ local p = d.parts
+ if p then
+ for i=1,#p do
+ local pi = p[i]
+ pi.glyph = expandglyph(characters,pi.glyph,done)
end
end
return d
@@ -430,9 +432,11 @@ local function addvisualspace(tfmdata)
if spacechar and not spacechar.commands then
local w = spacechar.width
local h = tfmdata.parameters.xheight
+ -- local h = tfmdata.parameters.xheight / 4 -- could be "visualspace=large" or so
local c = {
width = w,
- commands = { { "rule", h, w } }
+ commands = { { "rule", h, w } },
+ -- commands = { { "line", w, 5*h, h } },
}
local u = addprivate(tfmdata, "visualspace", c)
end
@@ -450,3 +454,101 @@ local visualspace_specification = {
registerotffeature(visualspace_specification)
registerafmfeature(visualspace_specification)
+
+do
+
+
+ local reference = 88 -- string.byte("X")
+ local mapping = { ss = "sans", rm = "serif", tt = "mono" }
+ local order = { "sans", "serif", "mono" }
+ local fallbacks = { sans = { }, serif = { }, mono = { } }
+
+ local function locate(fallbacks,n,f,c)
+ for i=1,#fallbacks do
+ local id = fallbacks[i]
+ if type(id) == "string" then
+ local fid = definers.define { name = id }
+ report("using fallback font %!font:name! (id: %i)",fid,fid)
+ fallbacks[i] = fid
+ id = fid
+ end
+ if type(id) == "number" then
+ local cid = fontcharacters[id]
+ if cid[c] then
+ local fc = fontcharacters[f]
+ local sc = (fc[reference].height / cid[reference].height) * (n.scale or 1000)
+ report("character %C in font %!font:name! (id: %i) is taken from fallback font %!font:name! (id: %i)",c,f,f,id,id)
+ return { id, sc }
+ end
+ end
+ end
+ return false
+ end
+
+ local cache = table.setmetatableindex("table")
+
+ callback.register("missing_character", function(n,f,c)
+ local cached = cache[f]
+ local found = cached[c]
+ if found == nil then
+ -- we can use fonts.helpers.name(f) but we need the monospace flag anyway so:
+ local metadata = fontdata[f].shared
+ if metadata then
+ metadata = metadata.rawdata
+ if metadata then
+ metadata = metadata.metadata
+ if metadata then
+ if metadata.monospaced then
+ found = locate(fallbacks.mono,n,f,c)
+ if found then
+ cached[c] = found
+ goto done
+ end
+ end
+ local fn = lower(metadata.fullname)
+ for i=1,3 do
+ local o = order[i]
+ if find(fn,o) then
+ found = locate(fallbacks[o],n,f,c)
+ if found then
+ cached[c] = found
+ goto done
+ end
+ end
+ end
+ end
+ end
+ end
+ found = locate(fallbacks[mapping[getmacro("fontstyle")] or "mono"],n,f,c)
+ if found then
+ cached[c] = found
+ goto done
+ end
+ end
+ ::done::
+ if found then
+ n.font = found[1]
+ n.scale = found[2]
+ end
+ end)
+
+ function definers.registerfallbackfont(style,list)
+ local l = fallbacks[style]
+ if l then
+ for s in gmatch(list,"[^, ]+") do
+ if not contains(l,s) then
+ l[#l+1] = s
+ end
+ end
+ end
+ end
+
+ implement {
+ name = "registerfallbackfont",
+ public = true,
+ protected = true,
+ arguments = { "optional", "optional" },
+ actions = definers.registerfallbackfont,
+ }
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-col.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-col.lmt
index 41d3274008c..2a999ddebc8 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-col.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-col.lmt
@@ -22,11 +22,11 @@ local nuts = nodes.nuts
local setfont = nuts.setfont
------ traverse_char = nuts.traverse_char
local nextchar = nuts.traversers.char
local getscales = nuts.getscales
local setscales = nuts.setscales
local setprop = nuts.setprop
+local getcharspec = nuts.getcharspec
local settings_to_hash = utilities.parsers.settings_to_hash
@@ -53,6 +53,7 @@ local charcommand = helpers.commands.char
local rightcommand = helpers.commands.right
local addprivate = helpers.addprivate
local hasprivate = helpers.hasprivate
+local isprivate = helpers.isprivate
local fontpatternhassize = helpers.fontpatternhassize
local hashes = fonts.hashes
@@ -258,7 +259,9 @@ function collections.clonevector(name)
if target then
for unicode = start, stop do
local unic = unicode + offset - start
- if not newchars[target] then
+ if isprivate(unic) or isprivate(target) then
+ -- ignore
+ elseif not newchars[target] then
-- not in font
elseif force or (not vector[unic] and not oldchars[unic]) then
vector[unic] = { cloneid, target }
@@ -270,7 +273,9 @@ function collections.clonevector(name)
else
for unicode = start, stop do
local unic = unicode + offset - start
- if not newchars[unicode] then
+ if isprivate(unic) or isprivate(unicode) then
+ -- ignore
+ elseif not newchars[target] then
-- not in font
elseif force or (not vector[unic] and not oldchars[unic]) then
vector[unic] = cloneid
@@ -281,7 +286,9 @@ function collections.clonevector(name)
if target then
for unicode = start, stop do
local unic = unicode + offset - start
- if force or (not vector[unic] and not oldchars[unic]) then
+ if isprivate(unic) or isprivate(target) then
+ -- ignore
+ elseif force or (not vector[unic] and not oldchars[unic]) then
vector[unic] = { cloneid, target }
end
target = target + 1
@@ -289,14 +296,18 @@ function collections.clonevector(name)
elseif remap then
for unicode = start, stop do
local unic = unicode + offset - start
- if force or (not vector[unic] and not oldchars[unic]) then
+ if isprivate(unic) or isprivate(unicode) then
+ -- ignore
+ elseif force or (not vector[unic] and not oldchars[unic]) then
vector[unic] = { cloneid, remap[unicode] }
end
end
else
for unicode = start, stop do
local unic = unicode + offset - start
- if force or (not vector[unic] and not oldchars[unic]) then
+ if isprivate(unic) then
+ -- ignore
+ elseif force or (not vector[unic] and not oldchars[unic]) then
vector[unic] = cloneid
end
end
@@ -384,6 +395,7 @@ local function monoslot(font,char,parent,factor)
width = width,
height = character.height,
depth = character.depth,
+ -- { "offset", ... }
commands = {
rightcommand[(width - character.width or 0)/2],
charcommand[char],
@@ -411,63 +423,80 @@ end
-- todo: also general one for missing
+local function apply(n,char,font,vector,vect)
+ local kind = type(vect)
+ local newfont, newchar
+ if kind == "table" then
+ newfont = vect[1]
+ newchar = vect[2]
+ if trace_collecting then
+ report_fonts("remapping character %C in font %a to character %C in font %a%s",
+ char,font,newchar,newfont,not chardata[newfont][newchar] and " (missing)" or ""
+ )
+ end
+ elseif kind == "function" then
+ newfont, newchar = vect(font,char,vector)
+ if not newfont then
+ newfont = font
+ end
+ if not newchar then
+ newchar = char
+ end
+ if trace_collecting then
+ report_fonts("remapping character %C in font %a to character %C in font %a%s",
+ char,font,newchar,newfont,not chardata[newfont][newchar] and " (missing)" or ""
+ )
+ end
+ vector[char] = { newfont, newchar }
+ else
+ local fakemono = vector.factor
+ if trace_collecting then
+ report_fonts("remapping font %a to %a for character %C%s",
+ font,vect,char,not chardata[vect][char] and " (missing)" or ""
+ )
+ end
+ newfont = vect
+ if fakemono then
+ newchar = monoslot(vect,char,font,fakemono)
+ else
+ newchar = char
+ end
+ end
+ local rscale = vector.rscale
+ if rscale and rscale ~= 1 then
+ local s, x, y = getscales(n)
+ setscales(n,s*rscale,x*rscale,y*rscale)
+ end
+ setfont(n,newfont,newchar)
+ setprop(n, "original", { font = font, char = char })
+end
+
function collections.process(head) -- this way we keep feature processing
for n, char, font in nextchar, head do
local vector = validvectors[font]
if vector then
local vect = vector[char]
if vect then
- local kind = type(vect)
- local newfont, newchar
- if kind == "table" then
- newfont = vect[1]
- newchar = vect[2]
- if trace_collecting then
- report_fonts("remapping character %C in font %a to character %C in font %a%s",
- char,font,newchar,newfont,not chardata[newfont][newchar] and " (missing)" or ""
- )
- end
- elseif kind == "function" then
- newfont, newchar = vect(font,char,vector)
- if not newfont then
- newfont = font
- end
- if not newchar then
- newchar = char
- end
- if trace_collecting then
- report_fonts("remapping character %C in font %a to character %C in font %a%s",
- char,font,newchar,newfont,not chardata[newfont][newchar] and " (missing)" or ""
- )
- end
- vector[char] = { newfont, newchar }
- else
- local fakemono = vector.factor
- if trace_collecting then
- report_fonts("remapping font %a to %a for character %C%s",
- font,vect,char,not chardata[vect][char] and " (missing)" or ""
- )
- end
- newfont = vect
- if fakemono then
- newchar = monoslot(vect,char,font,fakemono)
- else
- newchar = char
- end
- end
- local rscale = vector.rscale
- if rscale and rscale ~= 1 then
- local s, x, y = getscales(n)
- setscales(n,s*rscale,x*rscale,y*rscale)
- end
- setfont(n,newfont,newchar)
- setprop(n, "original", { font = font, char = char })
+ apply(n,char,font,vector,vect)
end
end
end
return head
end
+function collections.direct(n)
+ local char, font = getcharspec(n)
+ if font and char then
+ local vector = validvectors[font]
+ if vector then
+ local vect = vector[char]
+ if vect then
+ apply(n,char,font,vector,vect)
+ end
+ end
+ end
+end
+
function collections.found(font,char) -- this way we keep feature processing
if not char then
font, char = currentfont(), font
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-col.mklx b/Master/texmf-dist/tex/context/base/mkxl/font-col.mklx
index e6500dd7620..03515201fe4 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-col.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-col.mklx
@@ -34,7 +34,7 @@
\permanent\tolerant\protected\def\definefontfallback[#name]#spacer[#font]#spacer[#ranges]#spacer[#settings]%
{\let\mathsizesuffix\relax
\clf_fontcollectiondefine{#name}{#font}{#ranges}{#settings}%
- \let\mathsizesuffix\empty}
+ \lettonothing\mathsizesuffix}
\permanent\tolerant\protected\def\resetfontfallback[#name]#spacer[#font]%
{\clf_fontcollectionreset{#name}{#font}}
@@ -54,7 +54,7 @@
\font_fallbacks_prepare#fallbacks%
\endgroup}
-\let\m_font_fallbacks\empty % set in the font-ini
+\lettonothing\m_font_fallbacks % set in the font-ini
\appendtoks
\ifconditional\c_font_fallbacks_in_progress\else
@@ -68,7 +68,7 @@
\fi
\to\everydefinefont
-\let\m_font_fallbacks_spec\empty
+\lettonothing\m_font_fallbacks_spec
\def\font_fallbacks_start_cloning
{\begingroup
@@ -95,14 +95,18 @@
% math (experiment, todo clf_)
-\def\font_fallbacks_register_math#1#2#3#4%
- {\doifelsenothing{#3}%
- {\definedfont[#2 at #4sp]}%
- {\definedfont[#2*#3\space at #4\scaledpoint]}%
- \clf_registerfontfallbackid#1\space\fontid\font\space{#2}}
-
-% \def\font_fallbacks_finish_math
-% {\ctxlua{mathematics.finishfallbacks()}}
+% \def\font_fallbacks_register_math#1#2#3#4%
+% {\doifelsenothing{#3}%
+% {\definedfont[#2 at #4\scaledpoint]}%
+% {\definedfont[#2*#3\space at #4\scaledpoint]}%
+% \clf_registerfontfallbackid#1\space\fontid\font\space{#2}}
+
+% % % \def\font_fallbacks_register_math#1#2#3#4%
+% % % {\definedfont[#2\iftok{#3}\emptytoks\else*#3 \fi at #4\scaledpoint]%
+% % % \clf_registerfontfallbackid#1\space\fontid\font\space{#2}}
+% % %
+% % % \def\font_fallbacks_finish_math
+% % % {\ctxlua{mathematics.finishfallbacks()}}
% check : only replace when present in replacement font (default: no)
% force : force replacent even when basefont has glyph (default: yes)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-con.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-con.lmt
index bebc4e4984f..073af7d2ec8 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-con.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-con.lmt
@@ -156,22 +156,26 @@ function constructors.aftercopyingcharacters(target,original)
-- can be used for additional tweaking
end
+function constructors.beforepassingfonttotex(tfmdata)
+ -- can be used for additional tweaking
+end
+
function constructors.trytosharefont(target,tfmdata)
-- implemented in font-def.lmt
end
local synonyms = {
- exheight = "x_height",
- xheight = "x_height",
- ex = "x_height",
+ exheight = "xheight",
+ xheight = "xheight",
+ ex = "xheight",
emwidth = "quad",
em = "quad",
- spacestretch = "space_stretch",
- stretch = "space_stretch",
- spaceshrink = "space_shrink",
- shrink = "space_shrink",
- extraspace = "extra_space",
- xspace = "extra_space",
+ spacestretch = "spacestretch",
+ stretch = "spacestretch",
+ spaceshrink = "spaceshrink",
+ shrink = "spaceshrink",
+ extraspace = "extraspace",
+ xspace = "extraspace",
slantperpoint = "slant",
}
@@ -188,9 +192,9 @@ function constructors.enhanceparameters(parameters)
if k == "spacing" then
return {
width = t.space,
- stretch = t.space_stretch,
- shrink = t.space_shrink,
- extra = t.extra_space,
+ stretch = t.spacestretch,
+ shrink = t.spaceshrink,
+ extra = t.extraspace,
}
end
return mt and mt[k] or nil
@@ -205,9 +209,9 @@ function constructors.enhanceparameters(parameters)
elseif k == "spacing" then
if type(v) == "table" then
rawset(t,"space",v.width or 0)
- rawset(t,"space_stretch",v.stretch or 0)
- rawset(t,"space_shrink",v.shrink or 0)
- rawset(t,"extra_space",v.extra or 0)
+ rawset(t,"spacestretch",v.stretch or 0)
+ rawset(t,"spaceshrink",v.shrink or 0)
+ rawset(t,"extraspace",v.extra or 0)
end
else
rawset(t,k,v)
@@ -254,6 +258,26 @@ local function fixedpsname(psname,fallback)
return usedname, psname ~= usedname
end
+local function scaleparts(parts,delta)
+ local t = { }
+ for i=1,#parts do
+ local p = parts[i]
+ local s = p["start"] or 0
+ local e = p["end"] or 0
+ local a = p["advance"] or 0
+ t[i] = {
+ ["start"] = s == 0 and 0 or s * delta,
+ ["end"] = e == 0 and 0 or e * delta,
+ ["advance"] = a == 0 and 0 or a * delta,
+ ["extender"] = p["extender"],
+ ["glyph"] = p["glyph"],
+ }
+ end
+ return t
+end
+
+-- getcharactertagvalues
+
function constructors.scale(tfmdata,specification)
local target = { } -- the new table
--
@@ -298,20 +322,20 @@ function constructors.scale(tfmdata,specification)
--
local mathsize = tonumber(specification.mathsize) or 0
local textsize = tonumber(specification.textsize) or scaledpoints
- local forcedsize = tonumber(parameters.mathsize ) or 0 -- can be set by the feature "mathsize"
+ -- local forcedsize = tonumber(parameters.mathsize ) or 0 -- can be set by the feature "mathsize"
local extrafactor = tonumber(specification.factor ) or 1
- if (mathsize == 2 or forcedsize == 2) and parameters.scriptpercentage then
- scaledpoints = parameters.scriptpercentage * textsize / 100
- elseif (mathsize == 3 or forcedsize == 3) and parameters.scriptscriptpercentage then
- scaledpoints = parameters.scriptscriptpercentage * textsize / 100
- elseif forcedsize > 1000 then -- safeguard
- scaledpoints = forcedsize
- else
- -- in context x and xx also use mathsize
- end
+ -- if (mathsize == 2 or forcedsize == 2) and parameters.scriptpercentage then
+ -- scaledpoints = parameters.scriptpercentage * textsize / 100
+ -- elseif (mathsize == 3 or forcedsize == 3) and parameters.scriptscriptpercentage then
+ -- scaledpoints = parameters.scriptscriptpercentage * textsize / 100
+ -- elseif forcedsize > 1000 then -- safeguard
+ -- scaledpoints = forcedsize
+ -- else
+ -- -- in context x and xx also use mathsize
+ -- end
targetparameters.mathsize = mathsize
targetparameters.textsize = textsize
- targetparameters.forcedsize = forcedsize
+ -- targetparameters.forcedsize = forcedsize
targetparameters.extrafactor = extrafactor
--
local defaultwidth = resources.defaultwidth or 0
@@ -334,6 +358,7 @@ function constructors.scale(tfmdata,specification)
--
local askedscaledpoints = scaledpoints
local scaledpoints, delta = constructors.calculatescale(tfmdata,scaledpoints,nil,specification) -- no shortcut, dan be redefined
+-- print("B",mathsize,askedscaledpoints,scaledpoints,delta)
--
local hdelta = delta
local vdelta = delta
@@ -390,6 +415,7 @@ function constructors.scale(tfmdata,specification)
if extendfactor ~= 0 and extendfactor ~= 1 then
hdelta = hdelta * extendfactor
target.extend = extendfactor * 1000
+-- target.extend = round(target.extend)
else
target.extend = 1000 -- extent ?
end
@@ -398,6 +424,7 @@ function constructors.scale(tfmdata,specification)
if squeezefactor ~= 0 and squeezefactor ~= 1 then
vdelta = vdelta * squeezefactor
target.squeeze = squeezefactor * 1000
+-- target.squeeze = round(target.squeeze)
else
target.squeeze = 1000 -- extent ?
end
@@ -423,7 +450,7 @@ function constructors.scale(tfmdata,specification)
local hasquality = parameters.expansion or parameters.protrusion
local hasitalics = properties.hasitalics
local autoitalicamount = properties.autoitalicamount
- local stackmath = not properties.nostackmath
+ -- local stackmath = not properties.nostackmath
local haskerns = properties.haskerns or properties.mode == "base" -- we can have afm in node mode
local hasligatures = properties.hasligatures or properties.mode == "base" -- we can have afm in node mode
local realdimensions = properties.realdimensions
@@ -437,21 +464,21 @@ function constructors.scale(tfmdata,specification)
--
target.postprocessors = tfmdata.postprocessors
--
- local targetslant = (parameters.slant or parameters[1] or 0) * factors.pt -- per point
- local targetspace = (parameters.space or parameters[2] or 0) * hdelta
- local targetspace_stretch = (parameters.space_stretch or parameters[3] or 0) * hdelta
- local targetspace_shrink = (parameters.space_shrink or parameters[4] or 0) * hdelta
- local targetx_height = (parameters.x_height or parameters[5] or 0) * vdelta
- local targetquad = (parameters.quad or parameters[6] or 0) * hdelta
- local targetextra_space = (parameters.extra_space or parameters[7] or 0) * hdelta
- --
- targetparameters.slant = targetslant -- slantperpoint
- targetparameters.space = targetspace
- targetparameters.space_stretch = targetspace_stretch
- targetparameters.space_shrink = targetspace_shrink
- targetparameters.x_height = targetx_height
- targetparameters.quad = targetquad
- targetparameters.extra_space = targetextra_space
+ local targetslant = (parameters.slant or parameters[1] or 0) * factors.pt -- per point
+ local targetspace = (parameters.space or parameters[2] or 0) * hdelta
+ local targetspacestretch = (parameters.spacestretch or parameters[3] or 0) * hdelta
+ local targetspaceshrink = (parameters.spaceshrink or parameters[4] or 0) * hdelta
+ local targetxheight = (parameters.xheight or parameters[5] or 0) * vdelta
+ local targetquad = (parameters.quad or parameters[6] or 0) * hdelta
+ local targetextraspace = (parameters.extraspace or parameters[7] or 0) * hdelta
+ --
+ targetparameters.slant = targetslant -- slantperpoint
+ targetparameters.space = targetspace
+ targetparameters.spacestretch = targetspacestretch
+ targetparameters.spaceshrink = targetspaceshrink
+ targetparameters.xheight = targetxheight
+ targetparameters.quad = targetquad
+ targetparameters.extraspace = targetextraspace
--
local hshift = parameters.hshift
if hshift then
@@ -464,7 +491,7 @@ function constructors.scale(tfmdata,specification)
--
local ascender = parameters.ascender
if ascender then
- targetparameters.ascender = delta * ascender
+ targetparameters.ascender = delta * ascender
end
local descender = parameters.descender
if descender then
@@ -477,17 +504,28 @@ function constructors.scale(tfmdata,specification)
local scaledheight = defaultheight * vdelta
local scaleddepth = defaultdepth * vdelta
--
+ local textcontrol = properties.textcontrol or 0
+ if targetproperties.mode == "base" then
+ textcontrol = textcontrol | 0x02 | 0x04 -- todo symbolic
+ elseif targetproperties.mode == "none" then
+ textcontrol = textcontrol | 0x08 -- todo symbolic
+ end
+ targetproperties.textcontrol = textcontrol
+ target.textcontrol = textcontrol
+ --
local hasmath = (properties.hasmath or next(mathparameters)) and true
--
if hasmath then
constructors.assignmathparameters(target,tfmdata) -- does scaling and whatever is needed
- properties.hasmath = true
- target.nomath = false
+ properties.hasmath = true -- to be sure
+ target.nomath = false -- hm
target.MathConstants = target.mathparameters
- properties.compactmath = true
- target.compactmath = true
+ local compactmath = properties.compactmath
+
+ targetproperties.compactmath = compactmath
+ target.compactmath = compactmath
local textscale = parameters.textscale -- or 1000
local scriptscale = parameters.scriptscale -- or 700
@@ -505,11 +543,9 @@ function constructors.scale(tfmdata,specification)
targetparameters.scriptscale = scriptscale
targetparameters.scriptscriptscale = scriptscriptscale
- -- todo: maybe retrofit to font-con.lua
-
- local oldmath = properties.oldmath
- targetproperties.oldmath = oldmath
- target.oldmath = oldmath
+ local mathcontrol = properties.mathcontrol
+ targetproperties.mathcontrol = mathcontrol
+ target.mathcontrol = mathcontrol
else
properties.hasmath = false
@@ -557,6 +593,7 @@ function constructors.scale(tfmdata,specification)
--
for unicode, character in next, characters do
local chr, description, index
+ -- todo: add description entry to char entry instead of index ... saves elsewhere too
if changed then
local c = changed[unicode]
if c and c ~= unicode then
@@ -640,95 +677,108 @@ function constructors.scale(tfmdata,specification)
end
if hasquality then
-- we could move these calculations elsewhere (saves calculations)
- local ve = character.expansion_factor
+ local ve = character.expansion
if ve then
- chr.expansion_factor = ve*1000 -- expansionfactor, hm, can happen elsewhere
+ chr.expansion = ve*1000 -- expansionfactor, hm, can happen elsewhere
end
- local vl = character.left_protruding
+ local vc = character.compression
+ if vc then
+ chr.compression = vc*1000 -- expansionfactor, hm, can happen elsewhere
+ end
+ local vl = character.leftprotrusion
if vl then
- chr.left_protruding = width*vl
+ chr.leftprotrusion = width*vl
end
- local vr = character.right_protruding
+ local vr = character.rightprotrusion
if vr then
- chr.right_protruding = width*vr
+ chr.rightprotrusion = width*vr
end
end
--
if hasmath then
- --
- -- todo, just operate on descriptions.math
- local vn = character.next
- if vn then
- chr.next = vn
- else
- local vv = character.vert_variants
- if vv then
- local t = { }
- for i=1,#vv do
- local vvi = vv[i]
- local s = vvi["start"] or 0
- local e = vvi["end"] or 0
- local a = vvi["advance"] or 0
- t[i] = { -- zero check nicer for 5.3
- ["start"] = s == 0 and 0 or s * vdelta,
- ["end"] = e == 0 and 0 or e * vdelta,
- ["advance"] = a == 0 and 0 or a * vdelta,
- ["extender"] = vvi["extender"],
- ["glyph"] = vvi["glyph"],
- }
- end
- chr.vert_variants = t
- else
- local hv = character.horiz_variants
- if hv then
- local t = { }
- for i=1,#hv do
- local hvi = hv[i]
- local s = hvi["start"] or 0
- local e = hvi["end"] or 0
- local a = hvi["advance"] or 0
- t[i] = { -- zero check nicer for 5.3
- ["start"] = s == 0 and 0 or s * hdelta,
- ["end"] = e == 0 and 0 or e * hdelta,
- ["advance"] = a == 0 and 0 or a * hdelta,
- ["extender"] = hvi["extender"],
- ["glyph"] = hvi["glyph"],
- }
- end
- chr.horiz_variants = t
- end
- end
- -- todo also check mathitalics (or that one can go away)
+ local nxt = character.next
+ if nxt then
+ chr.next = nxt
+ end
+ local parts = character.parts
+ if parts then
+ local orientation = character.partsorientation or "vertical"
+ chr.parts = scaleparts(parts,orientation == "horizontal" and hdelta or vdelta)
+ chr.partsorientation = orientation
end
- local vi = character.vert_italic
+ local vi = character.partsitalic
if vi and vi ~= 0 then
- chr.vert_italic = vi*hdelta
+ chr.partsitalic = vi*hdelta
end
- local va = character.accent
- if va then
- chr.top_accent = vdelta*va
+ local va = character.topanchor
+ if va and va ~= 0 then
+ chr.topanchor = va*vdelta
end
- if stackmath then
- local mk = character.mathkerns
- if mk then
- local tr = mk.topright
- local tl = mk.topleft
- local br = mk.bottomright
- local bl = mk.bottomleft
- chr.mathkern = { -- singular -> should be patched in luatex !
- top_right = tr and mathkerns(tr,vdelta) or nil,
- top_left = tl and mathkerns(tl,vdelta) or nil,
- bottom_right = br and mathkerns(br,vdelta) or nil,
- bottom_left = bl and mathkerns(bl,vdelta) or nil,
- }
- end
+ va = character.bottomanchor
+ if va and va ~= 0 then
+ chr.bottomanchor = va*vdelta
+ end
+ --
+ local mk = character.mathkerns
+ if mk then
+ local tr = mk.topright
+ local tl = mk.topleft
+ local br = mk.bottomright
+ local bl = mk.bottomleft
+ chr.mathkerns = {
+ topright = tr and mathkerns(tr,vdelta) or nil,
+ topleft = tl and mathkerns(tl,vdelta) or nil,
+ bottomright = br and mathkerns(br,vdelta) or nil,
+ bottomleft = bl and mathkerns(bl,vdelta) or nil,
+ }
end
+ --
if hasitalics then
local vi = character.italic
if vi and vi ~= 0 then
chr.italic = vi*hdelta
end
end
+ --
+ -- These can never happen here as these come from tweaks but I need to check it:
+ --
+ -- local vo = character.topovershoot
+ -- if vo and vo ~= 0 then
+ -- chr.topovershoot = vo*hdelta
+ -- end
+ -- local il = character.innerlocation
+ -- if il then
+ -- chr.innerlocation = il
+ -- chr.innerxoffset = (character.innerxoffset or 0) * hdelta
+ -- chr.inneryoffset = (character.inneryoffset or 0) * vdelta
+ -- end
+ --
+ -- if character.extensible then
+ -- chr.extensible = true -- stretch fixed width accent
+ -- end
+ -- --
+ -- local k = character.topleft if k and k ~= 0 then chr.topleft = k*hdelta end
+ -- local k = character.topright if k and k ~= 0 then chr.topright = k*hdelta end
+ -- local k = character.bottomleft if k and k ~= 0 then chr.bottomleft = k*hdelta end
+ -- local k = character.bottomright if k and k ~= 0 then chr.bottomright = k*hdelta end
+ -- --
+ -- local m = character.leftmargin if m and m ~= 0 then chr.leftmargin = m*hdelta end
+ -- local m = character.rightmargin if m and m ~= 0 then chr.rightmargin = m*hdelta end
+ -- local m = character.topmargin if m and m ~= 0 then chr.topmargin = m*hdelta end
+ -- local m = character.bottommargin if m and m ~= 0 then chr.bottommargin = m*hdelta end
+ --
+ local sm = character.smaller
+ if sm then
+ chr.smaller = sm
+ end
+ -- local mi = character.mirror
+ -- if mi then
+ -- chr.mirror = mi
+ -- end
+ local fa = character.flataccent -- set here?
+ if fa then
+ chr.flataccent = fa
+ end
elseif autoitalicamount then -- itlc feature
local vi = description.italic
if not vi then
@@ -776,10 +826,29 @@ function constructors.scale(tfmdata,specification)
end
end
end
+ -- only in old school fonts (otherwise we set commands later in context)
local vc = character.commands
if vc then
chr.commands = scalecommands(vc,hdelta,vdelta)
end
+ local cb = character.callback
+ if cb then
+ chr.callback = cb
+ end
+ -- we assume that these are done in a manipulator afterwards
+ -- as it makes no sense otherwise
+ -- local vx = character.xoffset
+ -- if vx then
+ -- chr.xoffset = vx*hdelta
+ -- end
+ -- local vy = character.yoffset
+ -- if vy then
+ -- chr.yoffset = vy*vdelta
+ -- end
+ -- local va = character.advance
+ -- if va then
+ -- chr.advance = va*vdelta
+ -- end
targetcharacters[unicode] = chr
end
--
@@ -1088,6 +1157,7 @@ do
local position = source.position
setindeed("node",source,target,group,name,position)
setindeed("base",source,target,group,name,position)
+ setindeed("none",source,target,group,name,position)
setindeed("plug",source,target,group,name,position)
end
@@ -1155,10 +1225,10 @@ do
defaults = { },
descriptions = tables and tables.features or { },
used = statistics and statistics.usedfeatures or { },
- initializers = { base = { }, node = { }, plug = { } },
- processors = { base = { }, node = { }, plug = { } },
- manipulators = { base = { }, node = { }, plug = { } },
- finalizers = { base = { }, node = { }, plug = { } },
+ initializers = { base = { }, node = { }, none = { }, plug = { } },
+ processors = { base = { }, node = { }, none = { }, plug = { } },
+ manipulators = { base = { }, node = { }, none = { }, plug = { } },
+ finalizers = { base = { }, node = { }, none = { }, plug = { } },
}
features.register = function(specification) return register(features,specification) end
handler.features = features -- will also become hidden
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-ctx.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-ctx.lmt
index b735e3d2f91..23c676e4ee5 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-ctx.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-ctx.lmt
@@ -90,6 +90,7 @@ local setsubtype = nuts.setsubtype
local texgetdimen = tex.getdimen
local texsetcount = tex.setcount
+local texiscount = tex.iscount
local texget = tex.get
local texdefinefont = tex.definefont
@@ -156,7 +157,8 @@ or
-- this will move elsewhere ...
local function getfontname(tfmdata)
- return basename(type(tfmdata) == "number" and properties[tfmdata].name or tfmdata.properties.name)
+ local p = type(tfmdata) == "number" and properties[tfmdata] or tfmdata.properties
+ return basename((p and (p.name or p.fullname or p.fontname)) or "unknown")
end
helpers.name = getfontname
@@ -185,6 +187,12 @@ constructors.noffontsloaded = 0
-- font.getcopy = font.getfont -- we always want the table that context uses
+local accuratefactors = false
+----- compactfontmode = false
+
+experiments.register("fonts.accurate", function(v) accuratefactors = v end)
+experiments.register("fonts.compact", function() accuratefactors = true end)
+
do
-- Does this still make sense?
@@ -302,14 +310,14 @@ function definers.resetnullfont()
-- resetting is needed because tikz misuses nullfont
local parameters = fonts.nulldata.parameters
--
- parameters.slant = 0 -- 1
- parameters.space = 0 -- 2
- parameters.space_stretch = 0 -- 3
- parameters.space_shrink = 0 -- 4
- parameters.x_height = 0 -- 5
- parameters.quad = 0 -- 6
- parameters.extra_space = 0 -- 7
- parameters.designsize = 655360
+ parameters.slant = 0 -- 1
+ parameters.space = 0 -- 2
+ parameters.spacestretch = 0 -- 3
+ parameters.spaceshrink = 0 -- 4
+ parameters.xheight = 0 -- 5
+ parameters.quad = 0 -- 6
+ parameters.extraspace = 0 -- 7
+ parameters.designsize = 655360
--
constructors.enhanceparameters(parameters) -- official copies for us
--
@@ -503,6 +511,22 @@ do
end
end
+ local beforepassingfonttotex = sequencers.new {
+ name = "beforepassingfonttotex",
+ arguments = "tfmdata",
+ }
+
+ appendgroup(beforepassingfonttotex,"before") -- user
+ appendgroup(beforepassingfonttotex,"system") -- private
+ appendgroup(beforepassingfonttotex,"after" ) -- user
+
+ function constructors.beforepassingfonttotex(tfmdata)
+ local runner = beforepassingfonttotex.runner
+ if runner then
+ runner(tfmdata)
+ end
+ end
+
end
--[[ldx--
@@ -1051,23 +1075,30 @@ local sizepattern, splitpattern, specialscale do
local withinparents = leftparent * (1-rightparent)^0 * rightparent
local withinbraces = leftbrace * (1-rightbrace )^0 * rightbrace
local value = C((withinparents + withinbraces + (1-space))^1)
- -- local dimension = C((space/"" + P(1))^1)
- local dimension = Cs((digit+period)^1 * (spaces/"") * (P(1)-digit)^0)
--- local scaler = C((digit+period)^1)
+ local dimension = Cs((digit+period)^1 * (spaces/"") * (P(1)-digit-space)^0)
+ -- local dimension_x = C((space/"" + P(1))^1)
+ local dimension_x = C((1-space)^1)
+ -- local scaler = C((digit+period)^1)
local scaler = lpeg.patterns.unsigned/function(s) return round(tonumber(s)*1000) end
+ C(lpeg.patterns.cardinal)
local rest = C(P(1)^0)
local scale_none = Cc(0)
- local scale_at = (P("at") + P("@")) * Cc(1) * spaces * dimension -- dimension
- local scale_sa = P("sa") * Cc(2) * spaces * dimension -- number
- local scale_mo = P("mo") * Cc(3) * spaces * dimension -- number
- local scale_scaled = P("scaled") * Cc(4) * spaces * dimension -- number
- local scale_ht = P("ht") * Cc(5) * spaces * dimension -- dimension
- local scale_cp = P("cp") * Cc(6) * spaces * dimension -- dimension
+ local scale_at = (P("at") + P("@")) * Cc(1) * spaces * dimension -- dimension
+ local scale_sa = P("sa") * Cc(2) * spaces * dimension_x -- number or string
+ local scale_mo = P("mo") * Cc(3) * spaces * dimension_x -- number or string
+ local scale_scaled = P("scaled") * Cc(4) * spaces * dimension -- number
+ local scale_ht = P("ht") * Cc(5) * spaces * dimension -- dimension
+ local scale_cp = P("cp") * Cc(6) * spaces * dimension -- dimension
+ local scale_sx = P("sx") * spaces * scaler -- scale
+ local scale_sy = P("sy") * spaces * scaler -- scale
specialscale = { [5] = "ht", [6] = "cp" }
- sizepattern = spaces * ((scale_at + scale_sa + scale_mo + scale_ht + scale_cp + scale_scaled) * (spaces * scaler)^0 + scale_none)
+ -- sizepattern = spaces * ((scale_at + scale_sa + scale_mo + scale_ht + scale_cp + scale_scaled) * (spaces * scaler)^0 + scale_none)
+
+ scaler = spaces * ( (scale_sx + Cc(0)) * spaces * (scale_sy + Cc(0)) )^-1
+ sizepattern = spaces * ((scale_at + scale_sa + scale_mo + scale_ht + scale_cp + scale_scaled) * scaler + scale_none)
+
splitpattern = spaces * value * spaces * rest
end
@@ -1095,12 +1126,16 @@ local specifiers = { }
do -- else too many locals
- local starttiming = statistics.starttiming
- local stoptiming = statistics.stoptiming
+ local starttiming = statistics.starttiming
+ local stoptiming = statistics.stoptiming
+
+ local setmacro = tokens.setters.macro
+ local ctxcatcodes = tex.ctxcatcodes
+ local texconditionals = tex.conditionals
- local setmacro = tokens.setters.macro
- local ctxcatcodes = tex.ctxcatcodes
- local texconditionals = tex.conditionals
+ local c_scaledfontmode = texiscount("scaledfontmode")
+ local c_scaledfontsize = texiscount("scaledfontsize")
+ local c_lastfontid = texiscount("lastfontid")
local reported = setmetatableindex(function(t,k)
local v = setmetatableindex(function(t,k)
@@ -1111,6 +1146,12 @@ do -- else too many locals
return v
end)
+ local obey_designsize = false
+
+ experiments.register("fonts.compact.obeydesignsize",function(v)
+ obey_designsize = v
+ end)
+
implement {
name = "definefont_one",
arguments = "string",
@@ -1133,13 +1174,14 @@ do -- else too many locals
end
-- we can also use a count for the size
if size and size ~= "" then
- local mode, size, sx, sy = lpegmatch(sizepattern,size)
- if mode and size and size ~= "" then
- texsetcount("scaledfontmode",mode)
- -- ctx_setsomefontsize(size)
+ local mode, fontsize, sx, sy = lpegmatch(sizepattern,size)
+-- print(size,mode,fontsize,sx,sy)
+ if mode and fontsize and fontsize ~= "" then
+ texsetcount(c_scaledfontmode,mode)
+ -- ctx_setsomefontsize(fontsize)
-- We use a catcodetable, just in case it's 1.2\exheight (a corner case that showed
-- up in the lmtx manual: marking that changed size in the mids of some verbatim).
- setmacro(ctxcatcodes,"somefontsize",size)
+ setmacro(ctxcatcodes,"somefontsize",fontsize)
if sx then
setmacro("somefontsizex",sx)
end
@@ -1147,15 +1189,15 @@ do -- else too many locals
setmacro("somefontsizey",sy)
end
else
- texsetcount("scaledfontmode",0)
+ texsetcount(c_scaledfontmode,0)
-- ctx_setemptyfontsize()
end
elseif true then
-- so we don't need to check in tex
- texsetcount("scaledfontmode",2)
+ texsetcount(c_scaledfontmode,2)
-- ctx_setemptyfontsize()
else
- texsetcount("scaledfontmode",0)
+ texsetcount(c_scaledfontmode,0)
-- ctx_setemptyfontsize()
end
specification = definers.makespecification(str,lookup,name,sub,method,detail,size)
@@ -1190,23 +1232,23 @@ do -- else too many locals
"integer",
},
actions = function (
- global, -- \ifx\fontclass\empty\s!false\else\s!true\fi
- cs, -- {#csname}%
- str, -- \somefontfile
- size, -- \d_font_scaled_font_size
- inheritancemode, -- \c_font_feature_inheritance_mode
- classfeatures, -- \m_font_class_features
- fontfeatures, -- \m_font_features
- classfallbacks, -- \m_font_class_fallbacks
- fontfallbacks, -- \m_font_fallbacks
- mathsize, -- \fontface
- textsize, -- \d_font_scaled_text_face
- classgoodies, -- \m_font_class_goodies
- goodies, -- \m_font_goodies
- classdesignsize, -- \m_font_class_designsize
- fontdesignsize, -- \m_font_designsize
- scaledfontmode -- \scaledfontmode
- )
+ global, -- \ifx\fontclass\empty\s!false\else\s!true\fi
+ cs, -- {#csname}%
+ str, -- \somefontfile
+ size, -- \d_font_scaled_font_size
+ inheritancemode, -- \c_font_feature_inheritance_mode
+ classfeatures, -- \m_font_class_features
+ fontfeatures, -- \m_font_features
+ classfallbacks, -- \m_font_class_fallbacks
+ fontfallbacks, -- \m_font_fallbacks
+ mathsize, -- \fontface
+ textsize, -- \d_font_scaled_text_face
+ classgoodies, -- \m_font_class_goodies
+ goodies, -- \m_font_goodies
+ classdesignsize, -- \m_font_class_designsize
+ fontdesignsize, -- \m_font_designsize
+ scaledfontmode -- \scaledfontmode
+ )
if trace_defining then
report_defining("start stage two: %s, size %s, features %a & %a, mode %a",str,size,classfeatures,fontfeatures,inheritancemode)
end
@@ -1214,7 +1256,7 @@ do -- else too many locals
local lookup, name, sub, method, detail = getspecification(str or "")
-- new (todo: inheritancemode)
local designsize = fontdesignsize ~= "" and fontdesignsize or classdesignsize or ""
- local designname = designsizefilename(name,designsize,size)
+ local designname = designsizefilename(name,designsize,size,obey_designsize)
if designname and designname ~= "" then
if trace_defining or trace_designsize then
report_defining("remapping name %a, specification %a, size %a, designsize %a",name,designsize,size,designname)
@@ -1343,98 +1385,36 @@ do -- else too many locals
local properties = tfmdata.properties
-- we use char0 as signal; cf the spec pdf can handle this (no char in slot)
characters[0] = nil
- -- characters[0x00A0] = { width = parameters.space }
- -- characters[0x2007] = { width = characters[0x0030] and characters[0x0030].width or parameters.space } -- figure
- -- characters[0x2008] = { width = characters[0x002E] and characters[0x002E].width or parameters.space } -- period
- --
- local fallbacks = specification.fallbacks or ""
- local mathsize = (mathsize == 1 or mathsize == 2 or mathsize == 3) and mathsize or nil -- can be unset so we test 1 2 3
- if fallbacks ~= "" and mathsize and not busy then
- busy = true
- -- We need this ugly hack in order to resolve fontnames (at the \TEX end). Originally
- -- math was done in Lua after loading (plugged into aftercopying).
- --
- -- After tl 2017 I'll also do text fallbacks this way (although backups there are done
- -- in a completely different way.)
- if trace_defining then
- report_defining("defining %a, id %a, target %a, features %a / %a, fallbacks %a / %a, step %a",
- name,id,nice_cs(cs),classfeatures,fontfeatures,classfallbacks,fontfallbacks,1)
- end
- mathematics.resolvefallbacks(tfmdata,specification,fallbacks)
- context(function()
- -- We're doing math fallbacks.
- busy = false
- mathematics.finishfallbacks(tfmdata,specification,fallbacks)
- tfmdata.original = specification.specification
- local id = definefont(tfmdata,properties.id)
- csnames[id] = specification.cs
- properties.id = id -- already set
- definers.register(tfmdata,id) -- to be sure, normally already done
- texdefinefont(global,cs,id)
- -- texdefinefont(cs,id,global and "global")
- constructors.finalize(tfmdata)
- if trace_defining then
- report_defining("defining %a, id %a, target %a, features %a / %a, fallbacks %a / %a, step %a",
- name,id,nice_cs(cs),classfeatures,fontfeatures,classfallbacks,fontfallbacks,2)
- end
- -- resolved (when designsize is used):
- local size = round(tfmdata.parameters.size or 655360)
- setmacro("somefontsize",size.."sp")
- -- ctx_setsomefontsize(size .. "sp")
- texsetcount("scaledfontsize",size)
- lastfontid = id
- --
- if trace_defining then
- report_defining("memory usage after: %s",statistics.memused())
- report_defining("stop stage two")
- end
- --
- texsetcount("global","lastfontid",lastfontid)
- specifiers[lastfontid] = { str, size }
- if not mathsize then
- -- forget about it (can't happen here)
- elseif mathsize == 0 then
- -- can't happen (here)
- else
- -- maybe only 1 2 3 (we already test for this)
- lastmathids[mathsize] = lastfontid
- end
- stoptiming(fonts)
- end)
- return
- else
- tfmdata.original = specification.specification
- local id = definefont(tfmdata,properties.id)
- csnames[id] = specification.cs
- properties.id = id -- already set
- definers.register(tfmdata,id) -- to be sure, normally already done
- texdefinefont(global,cs,id)
- -- texdefinefont(cs,id,global and "global")
- constructors.finalize(tfmdata)
- if trace_defining then
- report_defining("defining %a, id %a, target %a, features %a / %a, fallbacks %a / %a, step %a",
- name,id,nice_cs(cs),classfeatures,fontfeatures,classfallbacks,fontfallbacks,"-")
- end
- -- resolved (when designsize is used):
- local size = round(tfmdata.parameters.size or 655360)
- setmacro("somefontsize",size.."sp")
- -- ctx_setsomefontsize(size .. "sp")
- texsetcount("scaledfontsize",size)
- lastfontid = id
+ tfmdata.original = specification.specification
+ local id = definefont(tfmdata,properties.id)
+ csnames[id] = specification.cs
+ properties.id = id -- already set
+ definers.register(tfmdata,id) -- to be sure, normally already done
+ texdefinefont(global,cs,id)
+ -- texdefinefont(cs,id,global and "global")
+ constructors.finalize(tfmdata)
+ if trace_defining then
+ report_defining("defining %a, id %a, target %a, features %a / %a, fallbacks %a / %a, step %a",
+ name,id,nice_cs(cs),classfeatures,fontfeatures,classfallbacks,fontfallbacks,"-")
end
+ -- resolved (when designsize is used):
+ local size = round(tfmdata.parameters.size or 655360)
+ setmacro("somefontsize",size.."sp")
+ texsetcount(c_scaledfontsize,size)
+ lastfontid = id
elseif tfmtype == "number" then
if trace_defining then
report_defining("reusing %s, id %a, target %a, features %a / %a, fallbacks %a / %a, goodies %a / %a, designsize %a / %a",
name,tfmdata,nice_cs(cs),classfeatures,fontfeatures,classfallbacks,fontfallbacks,classgoodies,goodies,classdesignsize,fontdesignsize)
end
csnames[tfmdata] = specification.cs
+-- \definedfont ends up here
texdefinefont(global,cs,tfmdata)
-- texdefinefont(cs,tfmdata,global and "global")
-- resolved (when designsize is used):
local size = round(fontdata[tfmdata].parameters.size or 0)
- -- ctx_setsomefontsize(size .. "sp")
setmacro("somefontsize",size.."sp")
- texsetcount("scaledfontsize",size)
+ texsetcount(c_scaledfontsize,size)
lastfontid = tfmdata
else
local nice = nice_cs(cs)
@@ -1442,7 +1422,7 @@ do -- else too many locals
report_defining("unable to define %a as %a",name,nice)
end
lastfontid = -1
- texsetcount("scaledfontsize",0)
+ texsetcount(c_scaledfontsize,0)
-- ctx_letvaluerelax(cs) -- otherwise the current definition takes the previous one
end
if trace_defining then
@@ -1450,7 +1430,7 @@ do -- else too many locals
report_defining("stop stage two")
end
--
- texsetcount("global","lastfontid",lastfontid)
+ texsetcount("global",c_lastfontid,lastfontid)
specifiers[lastfontid] = { str, size }
if not mathsize then
-- forget about it
@@ -1574,6 +1554,8 @@ do -- else too many locals
local n = 0
+ local d_bodyfontsize = tex.isdimen("bodyfontsize")
+
function definers.internal(specification,cs)
specification = specification or { }
local name = specification.name
@@ -1581,7 +1563,7 @@ do -- else too many locals
local number = tonumber(specification.number)
local id = nil
if not size then
- size = texgetdimen("bodyfontsize")
+ size = texgetdimen(d_bodyfontsize)
end
if number then
id = number
@@ -1623,7 +1605,7 @@ do -- else too many locals
return infofont
end
- -- abstract interfacing
+ -- abstract interfacing : we could actually do a runmacro or so
implement { name = "tf", actions = function() setmacro("fontalternative","tf") end }
implement { name = "bf", actions = function() setmacro("fontalternative","bf") end }
@@ -1638,6 +1620,8 @@ end
-- have delayed definitions and so we never know what style is taken
-- as start.
+local c_font_scaled_points = texiscount("c_font_scaled_points")
+
function constructors.calculatescale(tfmdata,scaledpoints,relativeid,specification)
local parameters = tfmdata.parameters
local units = parameters.units or 1000
@@ -1657,9 +1641,12 @@ function constructors.calculatescale(tfmdata,scaledpoints,relativeid,specificati
scaledpoints = (- scaledpoints/1000) * (tfmdata.designsize or parameters.designsize) -- already in sp
end
-- a temp hack till we have upgraded all mechanisms
- local delta = round(scaledpoints/units)
+ local delta = scaledpoints/units
local size = round(scaledpoints)
- texsetcount("c_font_scaled_points",size)
+ if not accuratefactors then
+ delta = round(delta)
+ end
+ texsetcount(c_font_scaled_points,size)
--
return size, delta
end
@@ -1684,16 +1671,17 @@ function constructors.hashinstance(specification,force)
end
specification.size = size
if fallbacks then
- return hash .. ' @ ' .. size .. ' @ ' .. fallbacks
+ hash = hash .. ' @ ' .. size .. ' @ ' .. fallbacks
else
local scalemode = specification.scalemode
local special = scalemode and specialscale[scalemode]
if special then
- return hash .. ' @ ' .. size .. ' @ ' .. special
+ hash = hash .. ' @ ' .. size .. ' @ ' .. special
else
- return hash .. ' @ ' .. size
+ hash = hash .. ' @ ' .. size
end
end
+ return hash
end
-- We overload the (generic) resolver:
@@ -2378,7 +2366,7 @@ do
end
implement {
- name = "nbfs",
+ name = "normalizedbodyfontsize",
arguments = "dimen",
actions = function(d)
context(lpegmatch(stripper,f_strip(d/65536)))
@@ -3032,7 +3020,7 @@ end
do
- local getfontoffamily = font.getfontoffamily
+ local getfontoffamily = tex.getfontoffamily
local new_glyph = nodes.pool.glyph
local fontproperties = fonts.hashes.properties
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-def.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-def.lmt
index 614f9803606..6afeeb47405 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-def.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-def.lmt
@@ -183,6 +183,7 @@ function resolvers.file(specification)
specification.forcedname = name
specification.name = removesuffix(name)
else
+ -- maybe when no suffix and not found, then still run over suffixes
specification.name = name -- can be resolved
end
end
@@ -473,6 +474,7 @@ function definers.read(specification,size,id) -- id can be optional, name can al
end
specification = definers.resolve(specification)
local hash = constructors.hashinstance(specification)
+-- inspect(hash)
local tfmdata = definers.registered(hash) -- id
local name = specification.name
if tfmdata then
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-dsp.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-dsp.lmt
new file mode 100644
index 00000000000..a1bf6f641d1
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-dsp.lmt
@@ -0,0 +1,4668 @@
+if not modules then modules = { } end modules ['font-dsp'] = {
+ version = 1.001,
+ optimize = true,
+ comment = "companion to font-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- many 0,0 entry/exit
+
+-- This loader went through a few iterations. First I made a ff compatible one so
+-- that we could do some basic checking. Also some verbosity was added (named
+-- glyphs). Eventually all that was dropped for a context friendly format, simply
+-- because keeping the different table models in sync too to much time. I have the
+-- old file somewhere. A positive side effect is that we get an (upto) much smaller
+-- smaller tma/tmc file. In the end the loader will be not much slower than the
+-- c based ff one.
+
+-- Being binary encoded, an opentype is rather compact. When expanded into a Lua table
+-- quite some memory can be used. This is very noticeable in the ff loader, which for
+-- a good reason uses a verbose format. However, when we use that data we create a couple
+-- of hashes. In the Lua loader we create these hashes directly, which save quite some
+-- memory.
+--
+-- We convert a font file only once and then cache it. Before creating the cached instance
+-- packing takes place: common tables get shared. After (re)loading and unpacking we then
+-- get a rather efficient internal representation of the font. In the new loader there is a
+-- pitfall. Because we use some common coverage magic we put a bit more information in
+-- the mark and cursive coverage tables than strickly needed: a reference to the coverage
+-- itself. This permits a fast lookup of the second glyph involved. In the marks we
+-- expand the class indicator to a class hash, in the cursive we use a placeholder that gets
+-- a self reference. This means that we cannot pack these subtables unless we add a unique
+-- id per entry (the same one per coverage) and that makes the tables larger. Because only a
+-- few fonts benefit from this, I decided to not do this. Experiments demonstrated that it
+-- only gives a few percent gain (on for instance husayni we can go from 845K to 828K
+-- bytecode). Better stay conceptually clean than messy compact.
+
+-- When we can reduce all basic lookups to one step we might safe a bit in the processing
+-- so then only chains are multiple.
+
+-- I used to flatten kerns here but that has been moved elsewhere because it polutes the code
+-- here and can be done fast afterwards. One can even wonder if it makes sense to do it as we
+-- pack anyway. In a similar fashion the unique placeholders in anchors in marks have been
+-- removed because packing doesn't save much there anyway.
+
+-- Although we have a bit more efficient tables in the cached files, the internals are still
+-- pretty similar. And although we have a slightly more direct coverage access the processing
+-- of node lists is not noticeable faster for latin texts, but for arabic we gain some 10%
+-- (and could probably gain a bit more).
+
+-- All this packing in the otf format is somewhat obsessive as nowadays 4K resolution
+-- multi-gig videos pass through our networks and storage and memory is abundant.
+
+-- Although we use a few table readers there i sno real gain in there (apart from having
+-- less code. After all there are often not that many demanding features.
+
+local next, type, tonumber = next, type, tonumber
+local gsub = string.gsub
+local lower = string.lower
+local sub = string.sub
+local strip = string.strip
+local tohash = table.tohash
+local concat = table.concat
+local copy = table.copy
+local reversed = table.reversed
+local sort = table.sort
+local insert = table.insert
+local round = math.round
+
+local settings_to_hash = utilities.parsers.settings_to_hash_colon_too
+local setmetatableindex = table.setmetatableindex
+local formatters = string.formatters
+local sortedkeys = table.sortedkeys
+local sortedhash = table.sortedhash
+local sequenced = table.sequenced
+
+local report = logs.reporter("otf reader")
+
+local readers = fonts.handlers.otf.readers
+local streamreader = readers.streamreader
+
+local setposition = streamreader.setposition
+local getposition = streamreader.getposition
+local readuinteger = streamreader.readcardinal1
+local readushort = streamreader.readcardinal2
+local readuoffset = streamreader.readcardinal3
+local readulong = streamreader.readcardinal4
+local readinteger = streamreader.readinteger1
+local readshort = streamreader.readinteger2
+local readstring = streamreader.readstring
+local readtag = streamreader.readtag
+local readbytes = streamreader.readbytes
+local readfixed = streamreader.readfixed4
+local read2dot14 = streamreader.read2dot14
+local skipshort = streamreader.skipshort
+local skipbytes = streamreader.skip
+local readbytetable = streamreader.readbytetable
+local readbyte = streamreader.readbyte
+local readcardinaltable = streamreader.readcardinaltable
+local readintegertable = streamreader.readintegertable
+local readfword = readshort
+
+local short = 2
+local ushort = 2
+local uoffset = 3
+local ulong = 4
+
+directives.register("fonts.streamreader",function()
+
+ streamreader = utilities.streams
+
+ setposition = streamreader.setposition
+ getposition = streamreader.getposition
+ readuinteger = streamreader.readcardinal1
+ readushort = streamreader.readcardinal2
+ readuoffset = streamreader.readcardinal3
+ readulong = streamreader.readcardinal4
+ readinteger = streamreader.readinteger1
+ readshort = streamreader.readinteger2
+ readstring = streamreader.readstring
+ readtag = streamreader.readtag
+ readbytes = streamreader.readbytes
+ readfixed = streamreader.readfixed4
+ read2dot14 = streamreader.read2dot14
+ skipshort = streamreader.skipshort
+ skipbytes = streamreader.skip
+ readbytetable = streamreader.readbytetable
+ readbyte = streamreader.readbyte
+ readcardinaltable = streamreader.readcardinaltable
+ readintegertable = streamreader.readintegertable
+ readfword = readshort
+
+end)
+
+local gsubhandlers = { }
+local gposhandlers = { }
+
+readers.gsubhandlers = gsubhandlers
+readers.gposhandlers = gposhandlers
+
+local helpers = readers.helpers
+local gotodatatable = helpers.gotodatatable
+local setvariabledata = helpers.setvariabledata
+
+local lookupidoffset = -1 -- will become 1 when we migrate (only -1 for comparign with old)
+
+local classes = {
+ "base",
+ "ligature",
+ "mark",
+ "component",
+}
+
+local gsubtypes = {
+ "single",
+ "multiple",
+ "alternate",
+ "ligature",
+ "context",
+ "chainedcontext",
+ "extension",
+ "reversechainedcontextsingle",
+}
+
+local gpostypes = {
+ "single",
+ "pair",
+ "cursive",
+ "marktobase",
+ "marktoligature",
+ "marktomark",
+ "context",
+ "chainedcontext",
+ "extension",
+}
+
+local chaindirections = {
+ context = 0,
+ chainedcontext = 1,
+ reversechainedcontextsingle = -1,
+}
+
+local function setmetrics(data,where,tag,d)
+ local w = data[where]
+ if w then
+ local v = w[tag]
+ if v then
+ -- it looks like some fonts set the value and not the delta
+ -- report("adding %s to %s.%s value %s",d,where,tag,v)
+ w[tag] = v + d
+ end
+ end
+end
+
+local variabletags = {
+ hasc = function(data,d) setmetrics(data,"windowsmetrics","typoascender",d) end,
+ hdsc = function(data,d) setmetrics(data,"windowsmetrics","typodescender",d) end,
+ hlgp = function(data,d) setmetrics(data,"windowsmetrics","typolinegap",d) end,
+ hcla = function(data,d) setmetrics(data,"windowsmetrics","winascent",d) end,
+ hcld = function(data,d) setmetrics(data,"windowsmetrics","windescent",d) end,
+ vasc = function(data,d) setmetrics(data,"vhea not done","ascent",d) end,
+ vdsc = function(data,d) setmetrics(data,"vhea not done","descent",d) end,
+ vlgp = function(data,d) setmetrics(data,"vhea not done","linegap",d) end,
+ xhgt = function(data,d) setmetrics(data,"windowsmetrics","xheight",d) end,
+ cpht = function(data,d) setmetrics(data,"windowsmetrics","capheight",d) end,
+ sbxs = function(data,d) setmetrics(data,"windowsmetrics","subscriptxsize",d) end,
+ sbys = function(data,d) setmetrics(data,"windowsmetrics","subscriptysize",d) end,
+ sbxo = function(data,d) setmetrics(data,"windowsmetrics","subscriptxoffset",d) end,
+ sbyo = function(data,d) setmetrics(data,"windowsmetrics","subscriptyoffset",d) end,
+ spxs = function(data,d) setmetrics(data,"windowsmetrics","superscriptxsize",d) end,
+ spys = function(data,d) setmetrics(data,"windowsmetrics","superscriptysize",d) end,
+ spxo = function(data,d) setmetrics(data,"windowsmetrics","superscriptxoffset",d) end,
+ spyo = function(data,d) setmetrics(data,"windowsmetrics","superscriptyoffset",d) end,
+ strs = function(data,d) setmetrics(data,"windowsmetrics","strikeoutsize",d) end,
+ stro = function(data,d) setmetrics(data,"windowsmetrics","strikeoutpos",d) end,
+ unds = function(data,d) setmetrics(data,"postscript","underlineposition",d) end,
+ undo = function(data,d) setmetrics(data,"postscript","underlinethickness",d) end,
+}
+
+local read_cardinal = {
+ streamreader.readcardinal1,
+ streamreader.readcardinal2,
+ streamreader.readcardinal3,
+ streamreader.readcardinal4,
+}
+
+local read_integer = {
+ streamreader.readinteger1,
+ streamreader.readinteger2,
+ streamreader.readinteger3,
+ streamreader.readinteger4,
+}
+
+directives.register("fonts.streamreader",function()
+
+ read_cardinal = {
+ streamreader.readcardinal1,
+ streamreader.readcardinal2,
+ streamreader.readcardinal3,
+ streamreader.readcardinal4,
+ }
+
+ read_integer = {
+ streamreader.readinteger1,
+ streamreader.readinteger2,
+ streamreader.readinteger3,
+ streamreader.readinteger4,
+ }
+
+end)
+
+-- Traditionally we use these unique names (so that we can flatten the lookup list
+-- (we create subsets runtime) but I will adapt the old code to newer names.
+
+-- chainsub
+-- reversesub
+
+local lookupnames = {
+ gsub = {
+ single = "gsub_single",
+ multiple = "gsub_multiple",
+ alternate = "gsub_alternate",
+ ligature = "gsub_ligature",
+ context = "gsub_context",
+ chainedcontext = "gsub_contextchain",
+ reversechainedcontextsingle = "gsub_reversecontextchain", -- reversesub
+ },
+ gpos = {
+ single = "gpos_single",
+ pair = "gpos_pair",
+ cursive = "gpos_cursive",
+ marktobase = "gpos_mark2base",
+ marktoligature = "gpos_mark2ligature",
+ marktomark = "gpos_mark2mark",
+ context = "gpos_context",
+ chainedcontext = "gpos_contextchain",
+ }
+}
+
+-- keep this as reference:
+--
+-- local lookupbits = {
+-- [0x0001] = "righttoleft",
+-- [0x0002] = "ignorebaseglyphs",
+-- [0x0004] = "ignoreligatures",
+-- [0x0008] = "ignoremarks",
+-- [0x0010] = "usemarkfilteringset",
+-- [0x00E0] = "reserved",
+-- [0xFF00] = "markattachmenttype",
+-- }
+--
+-- local lookupstate = setmetatableindex(function(t,k)
+-- local v = { }
+-- for kk, vv in next, lookupbits do
+-- if (k & kk) ~= 0 then
+-- v[vv] = true
+-- end
+-- end
+-- t[k] = v
+-- return v
+-- end)
+
+local lookupflags = setmetatableindex(function(t,k)
+ local v = {
+ (k & 0x0008) ~= 0 and true or false, -- ignoremarks
+ (k & 0x0004) ~= 0 and true or false, -- ignoreligatures
+ (k & 0x0002) ~= 0 and true or false, -- ignorebaseglyphs
+ (k & 0x0001) ~= 0 and true or false, -- r2l
+ }
+ t[k] = v
+ return v
+end)
+
+-- Variation stores: it's not entirely clear if the regions are a shared
+-- resource (it looks like they are). Anyway, we play safe and use a
+-- share.
+
+-- values can be anything the min/max permits so we can either think of
+-- real values of a fraction along the axis (probably easier)
+
+-- wght=400,wdth=100,ital=1
+
+local function axistofactors(str)
+ local t = settings_to_hash(str)
+ for k, v in next, t do
+ t[k] = tonumber(v) or v -- this also normalizes numbers itself
+ end
+ return t
+end
+
+local hash = table.setmetatableindex(function(t,k)
+ local v = sequenced(axistofactors(k),",")
+ t[k] = v
+ return v
+end)
+
+helpers.normalizedaxishash = hash
+
+local cleanname = fonts.names and fonts.names.cleanname or function(name)
+ return name and (gsub(lower(name),"[^%a%d]","")) or nil
+end
+
+helpers.cleanname = cleanname
+
+function helpers.normalizedaxis(str)
+ return hash[str] or str
+end
+
+-- contradicting spec ... (signs) so i'll check it and fix it once we have
+-- proper fonts
+
+local function getaxisscale(segments,minimum,default,maximum,user)
+ --
+ -- returns the right values cf example in standard
+ --
+ if not minimum or not default or not maximum then
+ return false
+ end
+ if user < minimum then
+ user = minimum
+ elseif user > maximum then
+ user = maximum
+ end
+ if user < default then
+ default = - (default - user) / (default - minimum)
+ elseif user > default then
+ default = (user - default) / (maximum - default)
+ else
+ default = 0
+ end
+ if not segments then
+ return default
+ end
+ local e
+ for i=1,#segments do
+ local s = segments[i]
+ if type(s) ~= "number" then
+ -- report("using default axis scale")
+ return default
+ elseif s[1] >= default then
+ if s[2] == default then
+ return default
+ else
+ e = i
+ break
+ end
+ end
+ end
+ if e then
+ local b = segments[e-1]
+ local e = segments[e]
+ return b[2] + (e[2] - b[2]) * (default - b[1]) / (e[1] - b[1])
+ else
+ return false
+ end
+end
+
+local function getfactors(data,instancespec)
+ if instancespec == true then
+ -- take default
+ elseif type(instancespec) ~= "string" or instancespec == "" then
+ return
+ end
+ local variabledata = data.variabledata
+ if not variabledata then
+ return
+ end
+ local instances = variabledata.instances
+ local axis = variabledata.axis
+ local segments = variabledata.segments
+ if instances and axis then
+ local values
+ if instancespec == true then
+ -- first instance:
+ -- values = instances[1].values
+ -- axis defaults:
+ values = { }
+ for i=1,#axis do
+ values[i] = {
+ -- axis = axis[i].tag,
+ value = axis[i].default,
+ }
+ end
+
+ else
+ for i=1,#instances do
+ local instance = instances[i]
+ if cleanname(instance.subfamily) == instancespec then
+ values = instance.values
+ break
+ end
+ end
+ end
+ if values then
+ local factors = { }
+ for i=1,#axis do
+ local a = axis[i]
+ factors[i] = getaxisscale(segments,a.minimum,a.default,a.maximum,values[i].value)
+ end
+ return factors
+ end
+ local values = axistofactors(hash[instancespec] or instancespec)
+ if values then
+ local factors = { }
+ for i=1,#axis do
+ local a = axis[i]
+ local d = a.default
+ factors[i] = getaxisscale(segments,a.minimum,d,a.maximum,values[a.name or a.tag] or values[a.tag] or d)
+ end
+ return factors
+ end
+ end
+end
+
+local function getscales(regions,factors)
+ local scales = { }
+ for i=1,#regions do
+ local region = regions[i]
+ local s = 1
+ for j=1,#region do
+ local axis = region[j]
+ local f = factors[j]
+ local start = axis.start
+ local peak = axis.peak
+ local stop = axis.stop
+ -- get rid of these tests, false flag
+ if start > peak or peak > stop then
+ -- * 1
+ elseif start < 0 and stop > 0 and peak ~= 0 then
+ -- * 1
+ elseif peak == 0 then
+ -- * 1
+ elseif f < start or f > stop then
+ -- * 0
+ s = 0
+ break
+ elseif f < peak then
+ -- s = - s * (f - start) / (peak - start)
+ s = s * (f - start) / (peak - start)
+ elseif f > peak then
+ s = s * (stop - f) / (stop - peak)
+ else
+ -- * 1
+ end
+ end
+ scales[i] = s
+ end
+ return scales
+end
+
+helpers.getaxisscale = getaxisscale
+helpers.getfactors = getfactors
+helpers.getscales = getscales
+helpers.axistofactors = axistofactors
+
+local function readvariationdata(f,storeoffset,factors) -- store
+ local position = getposition(f)
+ setposition(f,storeoffset)
+ -- header
+ local format = readushort(f)
+ local regionoffset = storeoffset + readulong(f)
+ local nofdeltadata = readushort(f)
+ local deltadata = readcardinaltable(f,nofdeltadata,ulong)
+ -- regions
+ setposition(f,regionoffset)
+ local nofaxis = readushort(f)
+ local nofregions = readushort(f)
+ local regions = { }
+ for i=1,nofregions do -- 0
+ local t = { }
+ for i=1,nofaxis do
+ t[i] = { -- maybe no keys, just 1..3
+ start = read2dot14(f),
+ peak = read2dot14(f),
+ stop = read2dot14(f),
+ }
+ end
+ regions[i] = t
+ end
+ -- deltas
+ -- if factors then
+ for i=1,nofdeltadata do
+ setposition(f,storeoffset+deltadata[i])
+ local nofdeltasets = readushort(f)
+ local nofshorts = readushort(f)
+ local nofregions = readushort(f)
+ local usedregions = { }
+ local deltas = { }
+ for i=1,nofregions do
+ usedregions[i] = regions[readushort(f)+1]
+ end
+ -- we could test before and save a for
+ for i=1,nofdeltasets do
+ local t = readintegertable(f,nofshorts,short)
+ for i=nofshorts+1,nofregions do
+ t[i] = readinteger(f)
+ end
+ deltas[i] = t
+ end
+ deltadata[i] = {
+ regions = usedregions,
+ deltas = deltas,
+ scales = factors and getscales(usedregions,factors) or nil,
+ }
+ end
+ -- end
+ setposition(f,position)
+ return regions, deltadata
+end
+
+helpers.readvariationdata = readvariationdata
+
+-- Beware: only use the simple variant if we don't set keys/values (otherwise too many entries). We
+-- could also have a variant that applies a function but there is no real benefit in this.
+
+local function readcoverage(f,offset,simple)
+ setposition(f,offset)
+ local coverageformat = readushort(f)
+ if coverageformat == 1 then
+ local nofcoverage = readushort(f)
+ if simple then
+ -- often 1 or 2
+ if nofcoverage == 1 then
+ return { readushort(f) }
+ elseif nofcoverage == 2 then
+ return { readushort(f), readushort(f) }
+ else
+ return readcardinaltable(f,nofcoverage,ushort)
+ end
+ elseif nofcoverage == 1 then
+ return { [readushort(f)] = 0 }
+ elseif nofcoverage == 2 then
+ return { [readushort(f)] = 0, [readushort(f)] = 1 }
+ else
+ local coverage = { }
+ for i=0,nofcoverage-1 do
+ coverage[readushort(f)] = i -- index in record
+ end
+ return coverage
+ end
+ elseif coverageformat == 2 then
+ local nofranges = readushort(f)
+ local coverage = { }
+ local n = simple and 1 or 0 -- needs checking
+ for i=1,nofranges do
+ local firstindex = readushort(f)
+ local lastindex = readushort(f)
+ local coverindex = readushort(f)
+ if simple then
+ for i=firstindex,lastindex do
+ coverage[n] = i
+ n = n + 1
+ end
+ else
+ for i=firstindex,lastindex do
+ coverage[i] = n
+ n = n + 1
+ end
+ end
+ end
+ return coverage
+ else
+ report("unknown coverage format %a ",coverageformat)
+ return { }
+ end
+end
+
+local function readclassdef(f,offset,preset)
+ setposition(f,offset)
+ local classdefformat = readushort(f)
+ local classdef = { }
+ if type(preset) == "number" then
+ for k=0,preset-1 do
+ classdef[k] = 1
+ end
+ end
+ if classdefformat == 1 then
+ local index = readushort(f)
+ local nofclassdef = readushort(f)
+ for i=1,nofclassdef do
+ classdef[index] = readushort(f) + 1
+ index = index + 1
+ end
+ elseif classdefformat == 2 then
+ local nofranges = readushort(f)
+ local n = 0
+ for i=1,nofranges do
+ local firstindex = readushort(f)
+ local lastindex = readushort(f)
+ local class = readushort(f) + 1
+ for i=firstindex,lastindex do
+ classdef[i] = class
+ end
+ end
+ else
+ report("unknown classdef format %a ",classdefformat)
+ end
+ if type(preset) == "table" then
+ for k in next, preset do
+ if not classdef[k] then
+ classdef[k] = 1
+ end
+ end
+ end
+ return classdef
+end
+
+local function classtocoverage(defs)
+ if defs then
+ local list = { }
+ for index, class in next, defs do
+ local c = list[class]
+ if c then
+ c[#c+1] = index
+ else
+ list[class] = { index }
+ end
+ end
+ return list
+ end
+end
+
+-- extra readers
+
+local skips = { [0] =
+ 0, -- ----
+ 1, -- ---x
+ 1, -- --y-
+ 2, -- --yx
+ 1, -- -h--
+ 2, -- -h-x
+ 2, -- -hy-
+ 3, -- -hyx
+ 2, -- v--x
+ 2, -- v-y-
+ 3, -- v-yx
+ 2, -- vh--
+ 3, -- vh-x
+ 3, -- vhy-
+ 4, -- vhyx
+}
+
+-- We can assume that 0 is nothing and in fact we can start at 1 as
+-- usual in Lua to make sure of that.
+
+local function readvariation(f,offset)
+ local p = getposition(f)
+ setposition(f,offset)
+ local outer = readushort(f)
+ local inner = readushort(f)
+ local format = readushort(f)
+ setposition(f,p)
+ if format == 0x8000 then
+ return outer, inner
+ end
+end
+
+local function readposition(f,format,mainoffset,getdelta)
+ if format == 0 then
+ return false
+ end
+ -- a few happen often
+ if format == 0x04 then
+ local h = readshort(f)
+ if h == 0 then
+ return true -- all zero
+ else
+ return { 0, 0, h, 0 }
+ end
+ end
+ if format == 0x05 then
+ local x = readshort(f)
+ local h = readshort(f)
+ if x == 0 and h == 0 then
+ return true -- all zero
+ else
+ return { x, 0, h, 0 }
+ end
+ end
+ if format == 0x44 then
+ local h = readshort(f)
+ if getdelta then
+ local d = readshort(f) -- short or ushort
+ if d > 0 then
+ local outer, inner = readvariation(f,mainoffset+d)
+ if outer then
+ h = h + getdelta(outer,inner)
+ end
+ end
+ else
+ skipshort(f,1)
+ end
+ if h == 0 then
+ return true -- all zero
+ else
+ return { 0, 0, h, 0 }
+ end
+ end
+ --
+ -- todo:
+ --
+ -- if format == 0x55 then
+ -- local x = readshort(f)
+ -- local h = readshort(f)
+ -- ....
+ -- end
+ --
+ local x = (format & 0x1) ~= 0 and readshort(f) or 0 -- x placement
+ local y = (format & 0x2) ~= 0 and readshort(f) or 0 -- y placement
+ local h = (format & 0x4) ~= 0 and readshort(f) or 0 -- h advance
+ local v = (format & 0x8) ~= 0 and readshort(f) or 0 -- v advance
+ if format >= 0x10 then
+ local X = (format & 0x10) ~= 0 and skipshort(f) or 0
+ local Y = (format & 0x20) ~= 0 and skipshort(f) or 0
+ local H = (format & 0x40) ~= 0 and skipshort(f) or 0
+ local V = (format & 0x80) ~= 0 and skipshort(f) or 0
+ -- local s = skips[extract(format,4,4)]
+ local s = skips[(format >> 4) & 0xF]
+ if s > 0 then
+ skipshort(f,s)
+ end
+ if getdelta then
+ if X > 0 then
+ local outer, inner = readvariation(f,mainoffset+X)
+ if outer then
+ x = x + getdelta(outer,inner)
+ end
+ end
+ if Y > 0 then
+ local outer, inner = readvariation(f,mainoffset+Y)
+ if outer then
+ y = y + getdelta(outer,inner)
+ end
+ end
+ if H > 0 then
+ local outer, inner = readvariation(f,mainoffset+H)
+ if outer then
+ h = h + getdelta(outer,inner)
+ end
+ end
+ if V > 0 then
+ local outer, inner = readvariation(f,mainoffset+V)
+ if outer then
+ v = v + getdelta(outer,inner)
+ end
+ end
+ end
+ return { x, y, h, v }
+ elseif x == 0 and y == 0 and h == 0 and v == 0 then
+ return true -- all zero
+ else
+ return { x, y, h, v }
+ end
+end
+
+local function readanchor(f,offset,getdelta) -- maybe also ignore 0's as in pos
+ if not offset or offset == 0 then
+ return nil -- false
+ end
+ setposition(f,offset)
+ -- no need to skip as we position each
+ local format = readshort(f) -- 1: x y 2: x y index 3 x y X Y
+ local x = readshort(f)
+ local y = readshort(f)
+ if format == 3 then
+ if getdelta then
+ local X = readshort(f)
+ local Y = readshort(f)
+ if X > 0 then
+ local outer, inner = readvariation(f,offset+X)
+ if outer then
+ x = x + getdelta(outer,inner)
+ end
+ end
+ if Y > 0 then
+ local outer, inner = readvariation(f,offset+Y)
+ if outer then
+ y = y + getdelta(outer,inner)
+ end
+ end
+ else
+ skipshort(f,2)
+ end
+ return { x, y } -- , { xindex, yindex }
+ else
+ return { x, y }
+ end
+end
+
+-- common handlers: inlining can be faster but we cache anyway
+-- so we don't bother too much about speed here
+
+local function readfirst(f,offset)
+ if offset then
+ setposition(f,offset)
+ end
+ return { readushort(f) }
+end
+
+-- quite often 0, 1, 2
+
+local function readarray(f,offset)
+ if offset then
+ setposition(f,offset)
+ end
+ local n = readushort(f)
+ if n == 1 then
+ return { readushort(f) }, 1
+ elseif n > 0 then
+ return readcardinaltable(f,n,ushort), n
+ end
+end
+
+local function readcoveragearray(f,offset,t,simple)
+ if not t then
+ return nil
+ end
+ local n = #t
+ if n == 0 then
+ return nil
+ end
+ for i=1,n do
+ t[i] = readcoverage(f,offset+t[i],simple)
+ end
+ return t
+end
+
+local function covered(subset,all)
+ local used, u
+ for i=1,#subset do
+ local s = subset[i]
+ if all[s] then
+ if used then
+ u = u + 1
+ used[u] = s
+ else
+ u = 1
+ used = { s }
+ end
+ end
+ end
+ return used
+end
+
+-- We generalize the chained lookups so that we can do with only one handler
+-- when processing them.
+
+-- pruned
+
+local function readlookuparray(f,noflookups,nofcurrent)
+ local lookups = { }
+ if noflookups > 0 then
+ local length = 0
+ for i=1,noflookups do
+ local index = readushort(f) + 1
+ if index > length then
+ length = index
+ end
+ local lookup = readushort(f) + 1
+ local list = lookups[index]
+ if list then
+ list[#list+1] = lookup
+ else
+ lookups[index] = { lookup }
+ end
+ end
+ for index=1,length do
+ if not lookups[index] then
+ lookups[index] = false
+ end
+ end
+ -- if length > nofcurrent then
+ -- report("more lookups than currently matched characters")
+ -- end
+ end
+ return lookups
+end
+
+-- not pruned
+--
+-- local function readlookuparray(f,noflookups,nofcurrent)
+-- local lookups = { }
+-- for i=1,nofcurrent do
+-- lookups[i] = false
+-- end
+-- for i=1,noflookups do
+-- local index = readushort(f) + 1
+-- if index > nofcurrent then
+-- report("more lookups than currently matched characters")
+-- for i=nofcurrent+1,index-1 do
+-- lookups[i] = false
+-- end
+-- nofcurrent = index
+-- end
+-- lookups[index] = readushort(f) + 1
+-- end
+-- return lookups
+-- end
+
+local function unchainedcontext(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs,what)
+ local tableoffset = lookupoffset + offset
+ setposition(f,tableoffset)
+ local subtype = readushort(f)
+ if subtype == 1 then
+ local coverage = readushort(f)
+ local subclasssets = readarray(f)
+ local rules = { }
+ if subclasssets then
+ coverage = readcoverage(f,tableoffset+coverage,true)
+ for i=1,#subclasssets do
+ local offset = subclasssets[i]
+ if offset > 0 then
+ local firstcoverage = coverage[i]
+ local rulesoffset = tableoffset + offset
+ local subclassrules = readarray(f,rulesoffset)
+ for rule=1,#subclassrules do
+ setposition(f,rulesoffset + subclassrules[rule])
+ local nofcurrent = readushort(f)
+ local noflookups = readushort(f)
+ local current = { { firstcoverage } }
+ for i=2,nofcurrent do
+ current[i] = { readushort(f) }
+ end
+ local lookups = readlookuparray(f,noflookups,nofcurrent)
+ rules[#rules+1] = {
+ current = current,
+ lookups = lookups
+ }
+ end
+ end
+ end
+ else
+ report("empty subclassset in %a subtype %i","unchainedcontext",subtype)
+ end
+ return {
+ format = "glyphs",
+ rules = rules,
+ }
+ elseif subtype == 2 then
+ -- We expand the classes as later on we do a pack over the whole table so then we get
+ -- back efficiency. This way we can also apply the coverage to the first current.
+ local coverage = readushort(f)
+ local currentclassdef = readushort(f)
+ local subclasssets = readarray(f)
+ local rules = { }
+ if subclasssets then
+ coverage = readcoverage(f,tableoffset + coverage)
+ currentclassdef = readclassdef(f,tableoffset + currentclassdef,coverage)
+ local currentclasses = classtocoverage(currentclassdef,fontdata.glyphs)
+ for class=1,#subclasssets do
+ local offset = subclasssets[class]
+ if offset > 0 then
+ local firstcoverage = currentclasses[class]
+ if firstcoverage then
+ firstcoverage = covered(firstcoverage,coverage) -- bonus
+ if firstcoverage then
+ local rulesoffset = tableoffset + offset
+ local subclassrules = readarray(f,rulesoffset)
+ for rule=1,#subclassrules do
+ setposition(f,rulesoffset + subclassrules[rule])
+ local nofcurrent = readushort(f)
+ local noflookups = readushort(f)
+ local current = { firstcoverage }
+ for i=2,nofcurrent do
+ current[i] = currentclasses[readushort(f) + 1]
+ end
+ local lookups = readlookuparray(f,noflookups,nofcurrent)
+ rules[#rules+1] = {
+ current = current,
+ lookups = lookups
+ }
+ end
+ else
+ report("no coverage")
+ end
+ else
+ report("no coverage class")
+ end
+ end
+ end
+ else
+ report("empty subclassset in %a subtype %i","unchainedcontext",subtype)
+ end
+ return {
+ format = "class",
+ rules = rules,
+ }
+ elseif subtype == 3 then
+ local nofglyphs = readushort(f)
+ local noflookups = readushort(f)
+ local current = readcardinaltable(f,nofglyphs,ushort)
+ local lookups = readlookuparray(f,noflookups,#current)
+ current = readcoveragearray(f,tableoffset,current,true)
+ return {
+ format = "coverage",
+ rules = {
+ {
+ current = current,
+ lookups = lookups,
+ }
+ }
+ }
+ else
+ report("unsupported subtype %a in %a %s",subtype,"unchainedcontext",what)
+ end
+end
+
+-- todo: optimize for n=1 ?
+
+-- class index needs checking, probably no need for +1
+
+local function chainedcontext(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs,what)
+ local tableoffset = lookupoffset + offset
+ setposition(f,tableoffset)
+ local subtype = readushort(f)
+ if subtype == 1 then
+ local coverage = readushort(f)
+ local subclasssets = readarray(f)
+ local rules = { }
+ if subclasssets then
+ coverage = readcoverage(f,tableoffset+coverage,true)
+ for i=1,#subclasssets do
+ local offset = subclasssets[i]
+ if offset > 0 then
+ local firstcoverage = coverage[i]
+ local rulesoffset = tableoffset + offset
+ local subclassrules = readarray(f,rulesoffset)
+ for rule=1,#subclassrules do
+ setposition(f,rulesoffset + subclassrules[rule])
+ local nofbefore = readushort(f)
+ local before
+ if nofbefore > 0 then
+ before = { }
+ for i=1,nofbefore do
+ before[i] = { readushort(f) }
+ end
+ end
+ local nofcurrent = readushort(f)
+ local current = { { firstcoverage } }
+ for i=2,nofcurrent do
+ current[i] = { readushort(f) }
+ end
+ local nofafter = readushort(f)
+ local after
+ if nofafter > 0 then
+ after = { }
+ for i=1,nofafter do
+ after[i] = { readushort(f) }
+ end
+ end
+ local noflookups = readushort(f)
+ local lookups = readlookuparray(f,noflookups,nofcurrent)
+ rules[#rules+1] = {
+ before = before,
+ current = current,
+ after = after,
+ lookups = lookups,
+ }
+ end
+ end
+ end
+ else
+ report("empty subclassset in %a subtype %i","chainedcontext",subtype)
+ end
+ return {
+ format = "glyphs",
+ rules = rules,
+ }
+ elseif subtype == 2 then
+ local coverage = readushort(f)
+ local beforeclassdef = readushort(f)
+ local currentclassdef = readushort(f)
+ local afterclassdef = readushort(f)
+ local subclasssets = readarray(f)
+ local rules = { }
+ if subclasssets then
+ local coverage = readcoverage(f,tableoffset + coverage)
+ local beforeclassdef = readclassdef(f,tableoffset + beforeclassdef,nofglyphs)
+ local currentclassdef = readclassdef(f,tableoffset + currentclassdef,coverage)
+ local afterclassdef = readclassdef(f,tableoffset + afterclassdef,nofglyphs)
+ local beforeclasses = classtocoverage(beforeclassdef,fontdata.glyphs)
+ local currentclasses = classtocoverage(currentclassdef,fontdata.glyphs)
+ local afterclasses = classtocoverage(afterclassdef,fontdata.glyphs)
+ for class=1,#subclasssets do
+ local offset = subclasssets[class]
+ if offset > 0 then
+ local firstcoverage = currentclasses[class]
+ if firstcoverage then
+ firstcoverage = covered(firstcoverage,coverage) -- bonus
+ if firstcoverage then
+ local rulesoffset = tableoffset + offset
+ local subclassrules = readarray(f,rulesoffset)
+ for rule=1,#subclassrules do
+ -- watch out, in context we first get the counts and then the arrays while
+ -- here we get them mixed
+ setposition(f,rulesoffset + subclassrules[rule])
+ local nofbefore = readushort(f)
+ local before
+ if nofbefore > 0 then
+ before = { }
+ for i=1,nofbefore do
+ before[i] = beforeclasses[readushort(f) + 1]
+ end
+ end
+ local nofcurrent = readushort(f)
+ local current = { firstcoverage }
+ for i=2,nofcurrent do
+ current[i] = currentclasses[readushort(f)+ 1]
+ end
+ local nofafter = readushort(f)
+ local after
+ if nofafter > 0 then
+ after = { }
+ for i=1,nofafter do
+ after[i] = afterclasses[readushort(f) + 1]
+ end
+ end
+ -- no sequence index here (so why in context as it saves nothing)
+ local noflookups = readushort(f)
+ local lookups = readlookuparray(f,noflookups,nofcurrent)
+ rules[#rules+1] = {
+ before = before,
+ current = current,
+ after = after,
+ lookups = lookups,
+ }
+ end
+ else
+ report("no coverage")
+ end
+ else
+ report("class is not covered")
+ end
+ end
+ end
+ else
+ report("empty subclassset in %a subtype %i","chainedcontext",subtype)
+ end
+ return {
+ format = "class",
+ rules = rules,
+ }
+ elseif subtype == 3 then
+ -- Maybe this one needs checking. Anyway zero current is bad.
+ local before = readarray(f)
+ local current = readarray(f)
+ local after = readarray(f)
+ local noflookups = readushort(f)
+ local lookups = current and readlookuparray(f,noflookups,#current)
+ if lookups then
+ before = readcoveragearray(f,tableoffset,before,true)
+ current = readcoveragearray(f,tableoffset,current,true)
+ after = readcoveragearray(f,tableoffset,after,true)
+ return {
+ format = "coverage",
+ rules = {
+ {
+ before = before,
+ current = current,
+ after = after,
+ lookups = lookups,
+ }
+ }
+ }
+ else
+ report("confusing subtype %a in %a %s",subtype,"chainedcontext",what)
+ end
+ else
+ report("unsupported subtype %a in %a %s",subtype,"chainedcontext",what)
+ end
+end
+
+local function extension(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs,types,handlers,what)
+ local tableoffset = lookupoffset + offset
+ setposition(f,tableoffset)
+ local subtype = readushort(f)
+ if subtype == 1 then
+ local lookuptype = types[readushort(f)]
+ local faroffset = readulong(f)
+ local handler = handlers[lookuptype]
+ if handler then
+ -- maybe we can just pass one offset (or tableoffset first)
+ return handler(f,fontdata,lookupid,tableoffset + faroffset,0,glyphs,nofglyphs), lookuptype
+ else
+ report("no handler for lookuptype %a subtype %a in %s %s",lookuptype,subtype,what,"extension")
+ end
+ else
+ report("unsupported subtype %a in %s %s",subtype,what,"extension")
+ end
+end
+
+-- gsub handlers
+
+function gsubhandlers.single(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs)
+ local tableoffset = lookupoffset + offset
+ setposition(f,tableoffset)
+ local subtype = readushort(f)
+ if subtype == 1 then
+ local coverage = readushort(f)
+ local delta = readshort(f) -- can be negative
+ local coverage = readcoverage(f,tableoffset+coverage) -- not simple as we need to set key/value anyway
+ for index in next, coverage do
+ local newindex = (index + delta) % 65536 -- modulo is new in 1.8.3
+ if index > nofglyphs or newindex > nofglyphs then
+ report("invalid index in %s format %i: %i -> %i (max %i)","single",subtype,index,newindex,nofglyphs)
+ coverage[index] = nil
+ else
+ coverage[index] = newindex
+ end
+ end
+ return {
+ coverage = coverage
+ }
+ elseif subtype == 2 then -- in streamreader a seek and fetch is faster than a temp table
+ local coverage = readushort(f)
+ local nofreplacements = readushort(f)
+ local replacements = readcardinaltable(f,nofreplacements,ushort)
+ local coverage = readcoverage(f,tableoffset + coverage) -- not simple as we need to set key/value anyway
+ for index, newindex in next, coverage do
+ newindex = newindex + 1
+ if index > nofglyphs or newindex > nofglyphs then
+ report("invalid index in %s format %i: %i -> %i (max %i)","single",subtype,index,newindex,nofglyphs)
+ coverage[index] = nil
+ else
+ coverage[index] = replacements[newindex]
+ end
+ end
+ return {
+ coverage = coverage
+ }
+ else
+ report("unsupported subtype %a in %a substitution",subtype,"single")
+ end
+end
+
+-- we see coverage format 0x300 in some old ms fonts
+
+local function sethandler(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs,what)
+ local tableoffset = lookupoffset + offset
+ setposition(f,tableoffset)
+ local subtype = readushort(f)
+ if subtype == 1 then
+ local coverage = readushort(f)
+ local nofsequence = readushort(f)
+ local sequences = readcardinaltable(f,nofsequence,ushort)
+ for i=1,nofsequence do
+ setposition(f,tableoffset + sequences[i])
+ sequences[i] = readcardinaltable(f,readushort(f),ushort)
+ end
+ local coverage = readcoverage(f,tableoffset + coverage)
+ for index, newindex in next, coverage do
+ newindex = newindex + 1
+ if index > nofglyphs or newindex > nofglyphs then
+ report("invalid index in %s format %i: %i -> %i (max %i)",what,subtype,index,newindex,nofglyphs)
+ coverage[index] = nil
+ else
+ coverage[index] = sequences[newindex]
+ end
+ end
+ return {
+ coverage = coverage
+ }
+ else
+ report("unsupported subtype %a in %a substitution",subtype,what)
+ end
+end
+
+function gsubhandlers.multiple(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs)
+ return sethandler(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs,"multiple")
+end
+
+function gsubhandlers.alternate(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs)
+ return sethandler(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs,"alternate")
+end
+
+function gsubhandlers.ligature(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs)
+ local tableoffset = lookupoffset + offset
+ setposition(f,tableoffset)
+ local subtype = readushort(f)
+ if subtype == 1 then
+ local coverage = readushort(f)
+ local nofsets = readushort(f)
+ local ligatures = readcardinaltable(f,nofsets,ushort)
+ for i=1,nofsets do
+ local offset = lookupoffset + offset + ligatures[i]
+ setposition(f,offset)
+ local n = readushort(f)
+ if n == 1 then
+ ligatures[i] = { offset + readushort(f) }
+ else
+ local l = { }
+ for i=1,n do
+ l[i] = offset + readushort(f)
+ end
+ ligatures[i] = l
+ end
+ end
+ local coverage = readcoverage(f,tableoffset + coverage)
+ for index, newindex in next, coverage do
+ local hash = { }
+ local ligatures = ligatures[newindex+1]
+ for i=1,#ligatures do
+ local offset = ligatures[i]
+ setposition(f,offset)
+ local lig = readushort(f)
+ local cnt = readushort(f)
+ local hsh = hash
+ for i=2,cnt do
+ local c = readushort(f)
+ local h = hsh[c]
+ if not h then
+ h = { }
+ hsh[c] = h
+ end
+ hsh = h
+ end
+ hsh.ligature = lig
+ end
+ coverage[index] = hash
+ end
+ return {
+ coverage = coverage
+ }
+ else
+ report("unsupported subtype %a in %a substitution",subtype,"ligature")
+ end
+end
+
+function gsubhandlers.context(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs)
+ return unchainedcontext(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs,"substitution"), "context"
+end
+
+function gsubhandlers.chainedcontext(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs)
+ return chainedcontext(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs,"substitution"), "chainedcontext"
+end
+
+function gsubhandlers.extension(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs)
+ return extension(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs,gsubtypes,gsubhandlers,"substitution")
+end
+
+function gsubhandlers.reversechainedcontextsingle(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs)
+ local tableoffset = lookupoffset + offset
+ setposition(f,tableoffset)
+ local subtype = readushort(f)
+ if subtype == 1 then -- NEEDS CHECKING
+ local current = readfirst(f)
+ local before = readarray(f)
+ local after = readarray(f)
+ local replacements = readarray(f)
+ current = readcoveragearray(f,tableoffset,current,true)
+ before = readcoveragearray(f,tableoffset,before,true)
+ after = readcoveragearray(f,tableoffset,after,true)
+ return {
+ format = "reversecoverage", -- reversesub
+ rules = {
+ {
+ before = before,
+ current = current,
+ after = after,
+ replacements = replacements,
+ }
+ }
+ }, "reversechainedcontextsingle"
+ else
+ report("unsupported subtype %a in %a substitution",subtype,"reversechainedcontextsingle")
+ end
+end
+
+-- gpos handlers
+
+local function readpairsets(f,tableoffset,sets,format1,format2,mainoffset,getdelta)
+ local done = { }
+ for i=1,#sets do
+ local offset = sets[i]
+ local reused = done[offset]
+ if not reused then
+ offset = tableoffset + offset
+ setposition(f,offset)
+ local n = readushort(f)
+ reused = { }
+ for i=1,n do
+ reused[i] = {
+ readushort(f), -- second glyph id
+ readposition(f,format1,offset,getdelta),
+ readposition(f,format2,offset,getdelta),
+ }
+ end
+ done[offset] = reused
+ end
+ sets[i] = reused
+ end
+ return sets
+end
+
+local function readpairclasssets(f,nofclasses1,nofclasses2,format1,format2,mainoffset,getdelta)
+ local classlist1 = { }
+ for i=1,nofclasses1 do
+ local classlist2 = { }
+ classlist1[i] = classlist2
+ for j=1,nofclasses2 do
+ local one = readposition(f,format1,mainoffset,getdelta)
+ local two = readposition(f,format2,mainoffset,getdelta)
+ if one or two then
+ classlist2[j] = { one, two }
+ else
+ classlist2[j] = false
+ end
+ end
+ end
+ return classlist1
+end
+
+-- no real gain in kerns as we pack
+
+function gposhandlers.single(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs)
+ local tableoffset = lookupoffset + offset
+ setposition(f,tableoffset)
+ local subtype = readushort(f)
+ local getdelta = fontdata.temporary.getdelta
+ if subtype == 1 then
+ local coverage = readushort(f)
+ local format = readushort(f)
+ local value = readposition(f,format,tableoffset,getdelta)
+ local coverage = readcoverage(f,tableoffset+coverage)
+ for index, newindex in next, coverage do
+ coverage[index] = value -- will be packed and shared anyway
+ end
+ return {
+ format = "single",
+ coverage = coverage,
+ }
+ elseif subtype == 2 then
+ local coverage = readushort(f)
+ local format = readushort(f)
+ local nofvalues = readushort(f)
+ local values = { }
+ for i=1,nofvalues do
+ values[i] = readposition(f,format,tableoffset,getdelta)
+ end
+ local coverage = readcoverage(f,tableoffset+coverage)
+ for index, newindex in next, coverage do
+ coverage[index] = values[newindex+1]
+ end
+ return {
+ format = "single",
+ coverage = coverage,
+ }
+ else
+ report("unsupported subtype %a in %a positioning",subtype,"single")
+ end
+end
+
+-- this needs checking! if no second pair then another advance over the list
+
+-- ValueFormat1 applies to the ValueRecord of the first glyph in each pair. ValueRecords for all first glyphs must use ValueFormat1. If ValueFormat1 is set to zero (0), the corresponding glyph has no ValueRecord and, therefore, should not be repositioned.
+-- ValueFormat2 applies to the ValueRecord of the second glyph in each pair. ValueRecords for all second glyphs must use ValueFormat2. If ValueFormat2 is set to null, then the second glyph of the pair is the “next†glyph for which a lookup should be performed.
+
+-- local simple = {
+-- [true] = { [true] = { true, true }, [false] = { true } },
+-- [false] = { [true] = { false, true }, [false] = { false } },
+-- }
+
+-- function gposhandlers.pair(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs)
+-- local tableoffset = lookupoffset + offset
+-- setposition(f,tableoffset)
+-- local subtype = readushort(f)
+-- local getdelta = fontdata.temporary.getdelta
+-- if subtype == 1 then
+-- local coverage = readushort(f)
+-- local format1 = readushort(f)
+-- local format2 = readushort(f)
+-- local sets = readarray(f)
+-- sets = readpairsets(f,tableoffset,sets,format1,format2,mainoffset,getdelta)
+-- coverage = readcoverage(f,tableoffset + coverage)
+-- local shared = { } -- partial sparse, when set also needs to be handled in the packer
+-- for index, newindex in next, coverage do
+-- local set = sets[newindex+1]
+-- local hash = { }
+-- for i=1,#set do
+-- local value = set[i]
+-- if value then
+-- local other = value[1]
+-- if shared then
+-- local s = shared[value]
+-- if s == nil then
+-- local first = value[2]
+-- local second = value[3]
+-- if first or second then
+-- s = { first, second or nil } -- needs checking
+-- else
+-- s = false
+-- end
+-- shared[value] = s
+-- end
+-- hash[other] = s or nil
+-- else
+-- local first = value[2]
+-- local second = value[3]
+-- if first or second then
+-- hash[other] = { first, second or nil } -- needs checking
+-- else
+-- hash[other] = nil -- what if set, maybe warning
+-- end
+-- end
+-- end
+-- end
+-- coverage[index] = hash
+-- end
+-- return {
+-- shared = shared and true or nil,
+-- format = "pair",
+-- coverage = coverage,
+-- }
+-- elseif subtype == 2 then
+-- local coverage = readushort(f)
+-- local format1 = readushort(f)
+-- local format2 = readushort(f)
+-- local classdef1 = readushort(f)
+-- local classdef2 = readushort(f)
+-- local nofclasses1 = readushort(f) -- incl class 0
+-- local nofclasses2 = readushort(f) -- incl class 0
+-- local classlist = readpairclasssets(f,nofclasses1,nofclasses2,format1,format2,tableoffset,getdelta)
+-- coverage = readcoverage(f,tableoffset+coverage)
+-- classdef1 = readclassdef(f,tableoffset+classdef1,coverage)
+-- classdef2 = readclassdef(f,tableoffset+classdef2,nofglyphs)
+-- local usedcoverage = { }
+-- local shared = { } -- partial sparse, when set also needs to be handled in the packer
+-- for g1, c1 in next, classdef1 do
+-- if coverage[g1] then
+-- local l1 = classlist[c1]
+-- if l1 then
+-- local hash = { }
+-- for paired, class in next, classdef2 do
+-- local offsets = l1[class]
+-- if offsets then
+-- local first = offsets[1]
+-- local second = offsets[2]
+-- if first or second then
+-- if shared then
+-- local s1 = shared[first]
+-- if s1 == nil then
+-- s1 = { }
+-- shared[first] = s1
+-- end
+-- local s2 = s1[second]
+-- if s2 == nil then
+-- s2 = { first, second or nil }
+-- s1[second] = s2
+-- end
+-- hash[paired] = s2
+-- else
+-- hash[paired] = { first, second or nil }
+-- end
+-- else
+-- -- upto the next lookup for this combination
+-- end
+-- end
+-- end
+-- usedcoverage[g1] = hash
+-- end
+-- end
+-- end
+-- return {
+-- shared = shared and true or nil,
+-- format = "pair",
+-- coverage = usedcoverage,
+-- }
+-- elseif subtype == 3 then
+-- report("yet unsupported subtype %a in %a positioning",subtype,"pair")
+-- else
+-- report("unsupported subtype %a in %a positioning",subtype,"pair")
+-- end
+-- end
+
+function gposhandlers.pair(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs)
+ local tableoffset = lookupoffset + offset
+ setposition(f,tableoffset)
+ local subtype = readushort(f)
+ local getdelta = fontdata.temporary.getdelta
+ if subtype == 1 then
+ local coverage = readushort(f)
+ local format1 = readushort(f)
+ local format2 = readushort(f)
+ local sets = readarray(f)
+ sets = readpairsets(f,tableoffset,sets,format1,format2,mainoffset,getdelta)
+ coverage = readcoverage(f,tableoffset + coverage)
+ local shared = { } -- partial sparse, when set also needs to be handled in the packer
+ for index, newindex in next, coverage do
+ local set = sets[newindex+1]
+ local hash = { }
+ for i=1,#set do
+ local value = set[i]
+ if value then
+ local other = value[1]
+ local share = shared[value]
+ if share == nil then
+ local first = value[2]
+ local second = value[3]
+ if first or second then
+ share = { first, second or nil } -- needs checking
+ else
+ share = false
+ end
+ shared[value] = share
+ end
+ hash[other] = share or nil -- really overload ?
+ end
+ end
+ coverage[index] = hash
+ end
+ return {
+ shared = shared and true or nil,
+ format = "pair",
+ coverage = coverage,
+ }
+ elseif subtype == 2 then
+ local coverage = readushort(f)
+ local format1 = readushort(f)
+ local format2 = readushort(f)
+ local classdef1 = readushort(f)
+ local classdef2 = readushort(f)
+ local nofclasses1 = readushort(f) -- incl class 0
+ local nofclasses2 = readushort(f) -- incl class 0
+ local classlist = readpairclasssets(f,nofclasses1,nofclasses2,format1,format2,tableoffset,getdelta)
+ coverage = readcoverage(f,tableoffset+coverage)
+ classdef1 = readclassdef(f,tableoffset+classdef1,coverage)
+ classdef2 = readclassdef(f,tableoffset+classdef2,nofglyphs)
+ local usedcoverage = { }
+ local shared = { } -- partial sparse, when set also needs to be handled in the packer
+ for g1, c1 in next, classdef1 do
+ if coverage[g1] then
+ local l1 = classlist[c1]
+ if l1 then
+ local hash = { }
+ for paired, class in next, classdef2 do
+ local offsets = l1[class]
+ if offsets then
+ local first = offsets[1]
+ local second = offsets[2]
+ if first or second then
+ local s1 = shared[first]
+ if s1 == nil then
+ s1 = { }
+ shared[first] = s1
+ end
+ local s2 = s1[second]
+ if s2 == nil then
+ s2 = { first, second or nil }
+ s1[second] = s2
+ end
+ hash[paired] = s2
+ end
+ end
+ end
+ usedcoverage[g1] = hash
+ end
+ end
+ end
+ return {
+ shared = shared and true or nil,
+ format = "pair",
+ coverage = usedcoverage,
+ }
+ elseif subtype == 3 then
+ report("yet unsupported subtype %a in %a positioning",subtype,"pair")
+ else
+ report("unsupported subtype %a in %a positioning",subtype,"pair")
+ end
+end
+
+function gposhandlers.cursive(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs)
+ local tableoffset = lookupoffset + offset
+ setposition(f,tableoffset)
+ local subtype = readushort(f)
+ local getdelta = fontdata.temporary.getdelta
+ if subtype == 1 then
+ local coverage = tableoffset + readushort(f)
+ local nofrecords = readushort(f)
+ local records = { }
+ for i=1,nofrecords do
+ local entry = readushort(f)
+ local exit = readushort(f)
+ records[i] = {
+ -- entry = entry ~= 0 and (tableoffset + entry) or false,
+ -- exit = exit ~= 0 and (tableoffset + exit ) or nil,
+ entry ~= 0 and (tableoffset + entry) or false,
+ exit ~= 0 and (tableoffset + exit ) or nil,
+ }
+ end
+ -- slot 1 will become hash after loading and it must be unique because we
+ -- pack the tables (packed we turn the cc-* into a zero)
+ local cc = (fontdata.temporary.cursivecount or 0) + 1
+ fontdata.temporary.cursivecount = cc
+ cc = "cc-" .. cc
+ coverage = readcoverage(f,coverage)
+ for i=1,nofrecords do
+ local r = records[i]
+ records[i] = {
+ -- 1,
+ cc,
+ -- readanchor(f,r.entry,getdelta) or false,
+ -- readanchor(f,r.exit, getdelta) or nil,
+ readanchor(f,r[1],getdelta) or false,
+ readanchor(f,r[2],getdelta) or nil,
+ }
+ end
+ for index, newindex in next, coverage do
+ coverage[index] = records[newindex+1]
+ end
+ return {
+ coverage = coverage,
+ }
+ else
+ report("unsupported subtype %a in %a positioning",subtype,"cursive")
+ end
+end
+
+local function handlemark(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs,ligature)
+ local tableoffset = lookupoffset + offset
+ setposition(f,tableoffset)
+ local subtype = readushort(f)
+ local getdelta = fontdata.temporary.getdelta
+ if subtype == 1 then
+ -- we are one based, not zero
+ local markcoverage = tableoffset + readushort(f)
+ local basecoverage = tableoffset + readushort(f)
+ local nofclasses = readushort(f)
+ local markoffset = tableoffset + readushort(f)
+ local baseoffset = tableoffset + readushort(f)
+ --
+ local markcoverage = readcoverage(f,markcoverage)
+ local basecoverage = readcoverage(f,basecoverage,true) -- TO BE CHECKED: true
+ --
+ setposition(f,markoffset)
+ local markclasses = { }
+ local nofmarkclasses = readushort(f)
+ --
+ local lastanchor = fontdata.lastanchor or 0
+ local usedanchors = { }
+ --
+ for i=1,nofmarkclasses do
+ local class = readushort(f) + 1
+ local offset = readushort(f)
+ if offset == 0 then
+ markclasses[i] = false
+ else
+ markclasses[i] = { class, markoffset + offset }
+ end
+ usedanchors[class] = true
+ end
+ for i=1,nofmarkclasses do
+ local mc = markclasses[i]
+ if mc then
+ mc[2] = readanchor(f,mc[2],getdelta)
+ end
+ end
+ --
+ setposition(f,baseoffset)
+ local nofbaserecords = readushort(f)
+ local baserecords = { }
+ --
+ if ligature then
+ -- 3 components
+ -- 1 : class .. nofclasses -- NULL when empty
+ -- 2 : class .. nofclasses -- NULL when empty
+ -- 3 : class .. nofclasses -- NULL when empty
+ for i=1,nofbaserecords do -- here i is the class
+ local offset = readushort(f)
+ if offset == 0 then
+ baserecords[i] = false
+ else
+ baserecords[i] = baseoffset + offset
+ end
+ end
+ for i=1,nofbaserecords do
+ local recordoffset = baserecords[i]
+ if recordoffset then
+ setposition(f,recordoffset)
+ local nofcomponents = readushort(f)
+ local components = { }
+ for i=1,nofcomponents do
+ local classes = { }
+ for i=1,nofclasses do
+ local offset = readushort(f)
+ if offset ~= 0 then
+ classes[i] = recordoffset + offset
+ else
+ classes[i] = false
+ end
+ end
+ components[i] = classes
+ end
+ baserecords[i] = components
+ end
+ end
+ local baseclasses = { } -- setmetatableindex("table")
+ for i=1,nofclasses do
+ baseclasses[i] = { }
+ end
+ for i=1,nofbaserecords do
+ local components = baserecords[i]
+ if components then
+ local b = basecoverage[i]
+ for c=1,#components do
+ local classes = components[c]
+ if classes then
+ for i=1,nofclasses do
+ local anchor = readanchor(f,classes[i],getdelta)
+ local bclass = baseclasses[i]
+ local bentry = bclass[b]
+ if bentry then
+ bentry[c] = anchor
+ else
+ bclass[b]= { [c] = anchor }
+ end
+ end
+ end
+ end
+ end
+ end
+ for index, newindex in next, markcoverage do
+ markcoverage[index] = markclasses[newindex+1] or nil
+ end
+ return {
+ format = "ligature",
+ baseclasses = baseclasses,
+ coverage = markcoverage,
+ }
+ else
+ for i=1,nofbaserecords do
+ local r = { }
+ for j=1,nofclasses do
+ local offset = readushort(f)
+ if offset == 0 then
+ r[j] = false
+ else
+ r[j] = baseoffset + offset
+ end
+ end
+ baserecords[i] = r
+ end
+ local baseclasses = { } -- setmetatableindex("table")
+ for i=1,nofclasses do
+ baseclasses[i] = { }
+ end
+ for i=1,nofbaserecords do
+ local r = baserecords[i]
+ local b = basecoverage[i]
+ for j=1,nofclasses do
+ baseclasses[j][b] = readanchor(f,r[j],getdelta)
+ end
+ end
+ for index, newindex in next, markcoverage do
+ markcoverage[index] = markclasses[newindex+1] or nil
+ end
+ -- we could actually already calculate the displacement if we want
+ return {
+ format = "base",
+ baseclasses = baseclasses,
+ coverage = markcoverage,
+ }
+ end
+ else
+ report("unsupported subtype %a in",subtype)
+ end
+
+end
+
+function gposhandlers.marktobase(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs)
+ return handlemark(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs)
+end
+
+function gposhandlers.marktoligature(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs)
+ return handlemark(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs,true)
+end
+
+function gposhandlers.marktomark(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs)
+ return handlemark(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs)
+end
+
+function gposhandlers.context(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs)
+ return unchainedcontext(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs,"positioning"), "context"
+end
+
+function gposhandlers.chainedcontext(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs)
+ return chainedcontext(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs,"positioning"), "chainedcontext"
+end
+
+function gposhandlers.extension(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs)
+ return extension(f,fontdata,lookupid,lookupoffset,offset,glyphs,nofglyphs,gpostypes,gposhandlers,"positioning")
+end
+
+-- main loader
+
+do
+
+ local plugins = { }
+
+ function plugins.size(f,fontdata,tableoffset,feature)
+ if fontdata.designsize then
+ -- yes, there are fonts with multiple size entries ... it probably relates
+ -- to the other two fields (menu entries in some language)
+ else
+ local function check(offset)
+ setposition(f,offset)
+ local designsize = readushort(f)
+ if designsize > 0 then -- we could also have a threshold
+ local fontstyleid = readushort(f)
+ local guimenuid = readushort(f)
+ local minsize = readushort(f)
+ local maxsize = readushort(f)
+ if minsize == 0 and maxsize == 0 and fontstyleid == 0 and guimenuid == 0 then
+ minsize = designsize
+ maxsize = designsize
+ end
+ if designsize >= minsize and designsize <= maxsize then
+ return minsize, maxsize, designsize
+ end
+ end
+ end
+ local minsize, maxsize, designsize = check(tableoffset+feature.offset+feature.parameters)
+ if not designsize then
+ -- some old adobe fonts have: tableoffset+feature.parameters and we could
+ -- use some heuristic but why bother ... this extra check will be removed
+ -- some day and/or when we run into an issue
+ minsize, maxsize, designsize = check(tableoffset+feature.parameters)
+ if designsize then
+ report("bad size feature in %a, falling back to wrong offset",fontdata.filename or "?")
+ else
+ report("bad size feature in %a,",fontdata.filename or "?")
+ end
+ end
+ if designsize then
+ fontdata.minsize = minsize
+ fontdata.maxsize = maxsize
+ fontdata.designsize = designsize
+ end
+ end
+ end
+
+ -- function plugins.rvrn(f,fontdata,tableoffset,feature)
+ -- -- todo, at least a message
+ -- end
+
+ -- feature order needs checking ... as we loop over a hash ... however, in the file
+ -- they are sorted so order is not that relevant
+
+ local function reorderfeatures(fontdata,scripts,features)
+ local scriptlangs = { }
+ local featurehash = { }
+ local featureorder = { }
+ for script, languages in next, scripts do
+ for language, record in next, languages do
+ local hash = { }
+ local list = record.featureindices
+ for k=1,#list do
+ local index = list[k]
+ local feature = features[index]
+ local lookups = feature.lookups
+ local tag = feature.tag
+ if tag then
+ hash[tag] = true
+ end
+ if lookups then
+ for i=1,#lookups do
+ local lookup = lookups[i]
+ local o = featureorder[lookup]
+ if o then
+ local okay = true
+ for i=1,#o do
+ if o[i] == tag then
+ okay = false
+ break
+ end
+ end
+ if okay then
+ o[#o+1] = tag
+ end
+ else
+ featureorder[lookup] = { tag }
+ end
+ local f = featurehash[lookup]
+ if f then
+ local h = f[tag]
+ if h then
+ local s = h[script]
+ if s then
+ s[language] = true
+ else
+ h[script] = { [language] = true }
+ end
+ else
+ f[tag] = { [script] = { [language] = true } }
+ end
+ else
+ featurehash[lookup] = { [tag] = { [script] = { [language] = true } } }
+ end
+ --
+ local h = scriptlangs[tag]
+ if h then
+ local s = h[script]
+ if s then
+ s[language] = true
+ else
+ h[script] = { [language] = true }
+ end
+ else
+ scriptlangs[tag] = { [script] = { [language] = true } }
+ end
+ end
+ end
+ end
+ end
+ end
+ return scriptlangs, featurehash, featureorder
+ end
+
+ local function readscriplan(f,fontdata,scriptoffset)
+ setposition(f,scriptoffset)
+ local nofscripts = readushort(f)
+ local scripts = { }
+ for i=1,nofscripts do
+ scripts[readtag(f)] = scriptoffset + readushort(f)
+ end
+ -- script list -> language system info
+ local languagesystems = setmetatableindex("table")
+ for script, offset in next, scripts do
+ setposition(f,offset)
+ local defaultoffset = readushort(f)
+ local noflanguages = readushort(f)
+ local languages = { }
+ if defaultoffset > 0 then
+ languages.dflt = languagesystems[offset + defaultoffset]
+ end
+ for i=1,noflanguages do
+ local language = readtag(f)
+ local offset = offset + readushort(f)
+ languages[language] = languagesystems[offset]
+ end
+ scripts[script] = languages
+ end
+ -- script list -> language system info -> feature list
+ for offset, usedfeatures in next, languagesystems do
+ if offset > 0 then
+ setposition(f,offset)
+ local featureindices = { }
+ usedfeatures.featureindices = featureindices
+ usedfeatures.lookuporder = readushort(f) -- reserved, not used (yet)
+ usedfeatures.requiredindex = readushort(f) -- relates to required (can be 0xFFFF)
+ local noffeatures = readushort(f)
+ for i=1,noffeatures do
+ featureindices[i] = readushort(f) + 1
+ end
+ end
+ end
+ return scripts
+ end
+
+ local function readfeatures(f,fontdata,featureoffset)
+ setposition(f,featureoffset)
+ local features = { }
+ local noffeatures = readushort(f)
+ for i=1,noffeatures do
+ -- also shared?
+ features[i] = {
+ tag = readtag(f),
+ offset = readushort(f)
+ }
+ end
+ --
+ for i=1,noffeatures do
+ local feature = features[i]
+ local offset = featureoffset+feature.offset
+ setposition(f,offset)
+ local parameters = readushort(f) -- feature.parameters
+ local noflookups = readushort(f)
+ if noflookups > 0 then
+-- local lookups = { }
+-- feature.lookups = lookups
+-- for j=1,noflookups do
+-- lookups[j] = readushort(f) + 1
+-- end
+ local lookups = readcardinaltable(f,noflookups,ushort)
+ feature.lookups = lookups
+ for j=1,noflookups do
+ lookups[j] = lookups[j] + 1
+ end
+ end
+ if parameters > 0 then
+ feature.parameters = parameters
+ local plugin = plugins[feature.tag]
+ if plugin then
+ plugin(f,fontdata,featureoffset,feature)
+ end
+ end
+ end
+ return features
+ end
+
+ local function readlookups(f,lookupoffset,lookuptypes,featurehash,featureorder)
+ setposition(f,lookupoffset)
+ local noflookups = readushort(f)
+ local lookups = readcardinaltable(f,noflookups,ushort)
+ for lookupid=1,noflookups do
+ local offset = lookups[lookupid]
+ setposition(f,lookupoffset+offset)
+ local subtables = { }
+ local typebits = readushort(f)
+ local flagbits = readushort(f)
+ local lookuptype = lookuptypes[typebits]
+ local lookupflags = lookupflags[flagbits]
+ local nofsubtables = readushort(f)
+ for j=1,nofsubtables do
+ subtables[j] = offset + readushort(f) -- we can probably put lookupoffset here
+ end
+ -- which one wins?
+ local markclass = (flagbits & 0x0010) ~= 0 -- usemarkfilteringset
+ if markclass then
+ markclass = readushort(f) -- + 1
+ end
+ -- local markset = rshift(flagbits,8)
+ local markset = (flagbits >> 8) & 0xFFFFFFFF
+ if markset > 0 then
+ markclass = markset -- + 1
+ end
+ lookups[lookupid] = {
+ type = lookuptype,
+ -- chain = chaindirections[lookuptype] or nil,
+ flags = lookupflags,
+ name = lookupid,
+ subtables = subtables,
+ markclass = markclass,
+ features = featurehash[lookupid], -- not if extension
+ order = featureorder[lookupid],
+ }
+ end
+ return lookups
+ end
+
+ local f_lookupname = formatters["%s_%s_%s"]
+
+ local function resolvelookups(f,lookupoffset,fontdata,lookups,lookuptypes,lookuphandlers,what,tableoffset)
+
+ local sequences = fontdata.sequences or { }
+ local sublookuplist = fontdata.sublookups or { }
+ fontdata.sequences = sequences
+ fontdata.sublookups = sublookuplist
+ local nofsublookups = #sublookuplist
+ local nofsequences = #sequences -- 0
+ local lastsublookup = nofsublookups
+ local lastsequence = nofsequences
+ local lookupnames = lookupnames[what]
+ local sublookuphash = { }
+ local sublookupcheck = { }
+ local glyphs = fontdata.glyphs
+ local nofglyphs = fontdata.nofglyphs or #glyphs
+ local noflookups = #lookups
+ local lookupprefix = sub(what,2,2) -- g[s|p][ub|os]
+ --
+ local usedlookups = false -- setmetatableindex("number")
+ --
+ local allsteps = { } -- new per 2022-09-25
+
+ for lookupid=1,noflookups do
+ local lookup = lookups[lookupid]
+ local lookuptype = lookup.type
+ local subtables = lookup.subtables
+ local features = lookup.features
+ local handler = lookuphandlers[lookuptype]
+ if handler then
+ local nofsubtables = #subtables
+ local order = lookup.order
+ local flags = lookup.flags
+ -- this is expected in the font handler (faster checking)
+ if flags[1] then flags[1] = "mark" end
+ if flags[2] then flags[2] = "ligature" end
+ if flags[3] then flags[3] = "base" end
+ --
+ local markclass = lookup.markclass
+ -- local chain = lookup.chain
+ if nofsubtables > 0 then
+ local steps = { }
+ local nofsteps = 0
+ local oldtype = nil
+ for s=1,nofsubtables do
+ local step, lt = handler(f,fontdata,lookupid,lookupoffset,subtables[s],glyphs,nofglyphs)
+ if lt then
+ lookuptype = lt
+ if oldtype and lt ~= oldtype then
+ report("messy %s lookup type %a and %a",what,lookuptype,oldtype)
+ end
+ oldtype = lookuptype
+ end
+ if not step then
+ report("unsupported %s lookup type %a",what,lookuptype)
+ else
+ nofsteps = nofsteps + 1
+ steps[nofsteps] = step
+ local rules = step.rules
+ if rules then
+ allsteps[#allsteps+1] = step -- new per 2022-09-25
+ for i=1,#rules do
+ local rule = rules[i]
+ local before = rule.before
+ local current = rule.current
+ local after = rule.after
+ local replacements = rule.replacements
+ if before then
+ for i=1,#before do
+ before[i] = tohash(before[i])
+ end
+ -- as with original ctx ff loader
+ rule.before = reversed(before)
+ end
+ if current then
+ if replacements then
+ -- We have a reverse lookup and therefore only one current entry. We might need
+ -- to reverse the order in the before and after lists so that needs checking.
+ local first = current[1]
+ local hash = { }
+ local repl = { }
+ for i=1,#first do
+ local c = first[i]
+ hash[c] = true
+ repl[c] = replacements[i]
+ end
+ rule.current = { hash }
+ rule.replacements = repl
+ else
+ for i=1,#current do
+ current[i] = tohash(current[i])
+ end
+ end
+ else
+ -- weird lookup
+ end
+ if after then
+ for i=1,#after do
+ after[i] = tohash(after[i])
+ end
+ end
+ if usedlookups then
+ local lookups = rule.lookups
+ if lookups then
+ for k, v in next, lookups do
+ if v then
+ for k, v in next, v do
+ usedlookups[v] = usedlookups[v] + 1
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ if nofsteps ~= nofsubtables then
+ report("bogus subtables removed in %s lookup type %a",what,lookuptype)
+ end
+ lookuptype = lookupnames[lookuptype] or lookuptype
+ if features then
+ nofsequences = nofsequences + 1
+ -- report("registering %i as sequence step %i",lookupid,nofsequences)
+ local l = {
+ index = nofsequences,
+ name = f_lookupname(lookupprefix,"s",lookupid+lookupidoffset),
+ steps = steps,
+ nofsteps = nofsteps,
+ type = lookuptype,
+ markclass = markclass or nil,
+ flags = flags,
+ -- chain = chain,
+ order = order,
+ features = features,
+ }
+ sequences[nofsequences] = l
+ lookup.done = l
+ else
+ nofsublookups = nofsublookups + 1
+ -- report("registering %i as sublookup %i",lookupid,nofsublookups)
+ local l = {
+ index = nofsublookups,
+ name = f_lookupname(lookupprefix,"l",lookupid+lookupidoffset),
+ steps = steps,
+ nofsteps = nofsteps,
+ type = lookuptype,
+ markclass = markclass or nil,
+ flags = flags,
+ -- chain = chain,
+ }
+ sublookuplist[nofsublookups] = l
+ sublookuphash[lookupid] = nofsublookups
+ sublookupcheck[lookupid] = 0
+ lookup.done = l
+ end
+ else
+ report("no subtables for lookup %a",lookupid)
+ end
+ else
+ report("no handler for lookup %a with type %a",lookupid,lookuptype)
+ end
+ end
+
+ if usedlookups then
+ report("used %s lookups: % t",what,sortedkeys(usedlookups))
+ end
+
+ -- When we have a context, we have sublookups that resolve into lookups for which we need to
+ -- know the type. We split the main lookuptable in two parts: sequences (the main lookups)
+ -- and subtable lookups (simple specs with no features). We could keep them merged and might do
+ -- that once we only use this loader. Then we can also move the simple specs into the sequence.
+ -- After all, we pack afterwards.
+
+ local reported = { }
+
+ local function report_issue(i,what,step,kind)
+-- if not reported[step] then
+ report("rule %i in step %i of %s has %s lookups",i,step,what,kind)
+-- reported[name] = true
+-- end
+ end
+
+ -- for i=lastsequence+1,nofsequences do
+ -- local sequence = sequences[i]
+ -- local steps = sequence.steps
+ -- for i=1,#steps do
+ -- local step = steps[i]
+
+ for s=1,#allsteps do -- new per 2022-09-25
+ local step = allsteps[s] -- new per 2022-09-25
+ local rules = step.rules
+ if rules then
+ for i=1,#rules do
+ local rule = rules[i]
+ local rlookups = rule.lookups
+ if not rlookups then
+ report_issue(i,what,s,"no")
+ elseif not next(rlookups) then
+ -- can be ok as it aborts a chain sequence
+ -- report_issue(i,what,s,"empty")
+ rule.lookups = nil
+ else
+ -- we can have holes in rlookups flagged false and we can have multiple lookups
+ -- applied (first time seen in seguemj)
+ local length = #rlookups
+ for index=1,length do
+ local lookuplist = rlookups[index]
+ if lookuplist then
+ local length = #lookuplist
+ local found = { }
+ local noffound = 0
+ for index=1,length do
+ local lookupid = lookuplist[index]
+ if lookupid then
+ local h = sublookuphash[lookupid]
+ if not h then
+ -- here we have a lookup that is used independent as well
+ -- as in another one
+ local lookup = lookups[lookupid]
+ if lookup then
+ local d = lookup.done
+ if d then
+ nofsublookups = nofsublookups + 1
+ -- report("registering %i as sublookup %i",lookupid,nofsublookups)
+ local l = {
+ index = nofsublookups, -- handy for tracing
+ name = f_lookupname(lookupprefix,"d",lookupid+lookupidoffset),
+ derived = true, -- handy for tracing
+ steps = d.steps,
+ nofsteps = d.nofsteps,
+ type = d.lookuptype or "gsub_single", -- todo: check type
+ markclass = d.markclass or nil,
+ flags = d.flags,
+ -- chain = d.chain,
+ }
+ sublookuplist[nofsublookups] = copy(l) -- we repack later
+ sublookuphash[lookupid] = nofsublookups
+ sublookupcheck[lookupid] = 1
+ h = nofsublookups
+ else
+ report_issue(i,what,s,"missing")
+ rule.lookups = nil
+ break
+ end
+ else
+ report_issue(i,what,s,"bad")
+ rule.lookups = nil
+ break
+ end
+ else
+ sublookupcheck[lookupid] = sublookupcheck[lookupid] + 1
+ end
+ if h then
+ noffound = noffound + 1
+ found[noffound] = h
+ end
+ end
+ end
+ rlookups[index] = noffound > 0 and found or false
+ else
+ rlookups[index] = false
+ end
+ end
+ end
+ end
+ end
+ end
+ -- end -- new per 2022-09-25
+
+ for i, n in sortedhash(sublookupcheck) do
+ local l = lookups[i]
+ local t = l.type
+ if n == 0 and t ~= "extension" then
+ local d = l.done
+ report("%s lookup %s of type %a is not used",what,d and d.name or l.name,t)
+ end
+ end
+
+ end
+
+ local function loadvariations(f,fontdata,variationsoffset,lookuptypes,featurehash,featureorder)
+ setposition(f,variationsoffset)
+ local version = readulong(f) -- two times readushort
+ local nofrecords = readulong(f)
+ local records = { }
+ for i=1,nofrecords do
+ records[i] = {
+ conditions = readulong(f),
+ substitutions = readulong(f),
+ }
+ end
+ for i=1,nofrecords do
+ local record = records[i]
+ local offset = record.conditions
+ if offset == 0 then
+ record.condition = nil
+ record.matchtype = "always"
+ else
+ local offset = variationsoffset+offset
+ setposition(f,offset)
+ local nofconditions = readushort(f)
+ local conditions = { }
+ for i=1,nofconditions do
+ conditions[i] = offset + readulong(f)
+ end
+ record.conditions = conditions
+ record.matchtype = "condition"
+ end
+ end
+ for i=1,nofrecords do
+ local record = records[i]
+ if record.matchtype == "condition" then
+ local conditions = record.conditions
+ for i=1,#conditions do
+ setposition(f,conditions[i])
+ conditions[i] = {
+ format = readushort(f),
+ axis = readushort(f),
+ minvalue = read2dot14(f),
+ maxvalue = read2dot14(f),
+ }
+ end
+ end
+ end
+
+ for i=1,nofrecords do
+ local record = records[i]
+ local offset = record.substitutions
+ if offset == 0 then
+ record.substitutions = { }
+ else
+ setposition(f,variationsoffset + offset)
+ local version = readulong(f)
+ local nofsubstitutions = readushort(f)
+ local substitutions = { }
+ for i=1,nofsubstitutions do
+ substitutions[readushort(f)] = readulong(f)
+ end
+ for index, alternates in sortedhash(substitutions) do
+ if index == 0 then
+ record.substitutions = false
+ else
+ local tableoffset = variationsoffset + offset + alternates
+ setposition(f,tableoffset)
+ local parameters = readulong(f) -- feature parameters
+ local noflookups = readushort(f)
+ local lookups = readcardinaltable(f,noflookups,ushort) -- not sure what to do with these
+ -- todo : resolve to proper lookups
+ record.substitutions = lookups
+ end
+ end
+ end
+ end
+ setvariabledata(fontdata,"features",records)
+ end
+
+ local function readscripts(f,fontdata,what,lookuptypes,lookuphandlers,lookupstoo)
+ local tableoffset = gotodatatable(f,fontdata,what,true)
+ if tableoffset then
+ local version = readulong(f)
+ local scriptoffset = tableoffset + readushort(f)
+ local featureoffset = tableoffset + readushort(f)
+ local lookupoffset = tableoffset + readushort(f)
+ -- MFK : Rubik-Regular.ttf : we need to delay adding the offset
+ -- local variationsoffset = version > 0x00010000 and (tableoffset + readulong(f)) or 0
+ local variationsoffset = version > 0x00010000 and readulong(f) or 0
+ if not scriptoffset then
+ return
+ end
+ local scripts = readscriplan(f,fontdata,scriptoffset)
+ local features = readfeatures(f,fontdata,featureoffset)
+ --
+ local scriptlangs, featurehash, featureorder = reorderfeatures(fontdata,scripts,features)
+ --
+ if fontdata.features then
+ fontdata.features[what] = scriptlangs
+ else
+ fontdata.features = { [what] = scriptlangs }
+ end
+ --
+ if not lookupstoo then
+ return
+ end
+ --
+ local lookups = readlookups(f,lookupoffset,lookuptypes,featurehash,featureorder)
+ --
+ if lookups then
+ resolvelookups(f,lookupoffset,fontdata,lookups,lookuptypes,lookuphandlers,what,tableoffset)
+ end
+ --
+ if variationsoffset > 0 then
+ -- loadvariations(f,fontdata,variationsoffset,lookuptypes,featurehash,featureorder)
+ loadvariations(f,fontdata,tableoffset + variationsoffset,lookuptypes,featurehash,featureorder)
+ end
+ end
+ end
+
+ local function checkkerns(f,fontdata,specification)
+ local datatable = fontdata.tables.kern
+ if not datatable then
+ return -- no kerns
+ end
+ local features = fontdata.features
+ local gposfeatures = features and features.gpos
+ local name
+ if not gposfeatures or not gposfeatures.kern then
+ name = "kern"
+ elseif specification.globalkerns then
+ name = "globalkern"
+ else
+ report("ignoring global kern table, using gpos kern feature")
+ return
+ end
+ setposition(f,datatable.offset)
+ local version = readushort(f)
+ local noftables = readushort(f)
+ if noftables > 1 then
+ report("adding global kern table as gpos feature %a",name)
+ local kerns = setmetatableindex("table")
+ for i=1,noftables do
+ local version = readushort(f)
+ local length = readushort(f)
+ local coverage = readushort(f)
+ -- bit 8-15 of coverage: format 0 or 2
+ -- local format = rshift(coverage,8) -- is this ok
+ local format = (coverage >> 8) & 0xFFFFFFFF -- is this ok
+ if format == 0 then
+ local nofpairs = readushort(f)
+ local searchrange = readushort(f)
+ local entryselector = readushort(f)
+ local rangeshift = readushort(f)
+ for i=1,nofpairs do
+ kerns[readushort(f)][readushort(f)] = readfword(f)
+ end
+ elseif format == 2 then
+ -- apple specific so let's ignore it
+ else
+ -- not supported by ms
+ end
+ end
+ local feature = { dflt = { dflt = true } }
+ if not features then
+ fontdata.features = { gpos = { [name] = feature } }
+ elseif not gposfeatures then
+ fontdata.features.gpos = { [name] = feature }
+ else
+ gposfeatures[name] = feature
+ end
+ local sequences = fontdata.sequences
+ if not sequences then
+ sequences = { }
+ fontdata.sequences = sequences
+ end
+ local nofsequences = #sequences + 1
+ sequences[nofsequences] = {
+ index = nofsequences,
+ name = name,
+ steps = {
+ {
+ coverage = kerns,
+ format = "kern",
+ },
+ },
+ nofsteps = 1,
+ type = "gpos_pair",
+ flags = { false, false, false, false },
+ order = { name },
+ features = { [name] = feature },
+ }
+ else
+ report("ignoring empty kern table of feature %a",name)
+ end
+ end
+
+ function readers.gsub(f,fontdata,specification)
+ if specification.details then
+ readscripts(f,fontdata,"gsub",gsubtypes,gsubhandlers,specification.lookups)
+ end
+ end
+
+ function readers.gpos(f,fontdata,specification)
+ if specification.details then
+ readscripts(f,fontdata,"gpos",gpostypes,gposhandlers,specification.lookups)
+ if specification.lookups then
+ checkkerns(f,fontdata,specification)
+ end
+ end
+ end
+
+end
+
+function readers.gdef(f,fontdata,specification)
+ if not specification.glyphs then
+ return
+ end
+ local datatable = fontdata.tables.gdef
+ if datatable then
+ local tableoffset = datatable.offset
+ setposition(f,tableoffset)
+ local version = readulong(f)
+ local classoffset = readushort(f)
+ local attachmentoffset = readushort(f) -- used for bitmaps
+ local ligaturecarets = readushort(f) -- used in editors (maybe nice for tracing)
+ local markclassoffset = readushort(f)
+ local marksetsoffset = version >= 0x00010002 and readushort(f) or 0
+ local varsetsoffset = version >= 0x00010003 and readulong(f) or 0
+ local glyphs = fontdata.glyphs
+ local marks = { }
+ local markclasses = setmetatableindex("table")
+ local marksets = setmetatableindex("table")
+ fontdata.marks = marks
+ fontdata.markclasses = markclasses
+ fontdata.marksets = marksets
+ -- class definitions
+ if classoffset ~= 0 then
+ setposition(f,tableoffset + classoffset)
+ local classformat = readushort(f)
+ if classformat == 1 then
+ local firstindex = readushort(f)
+ local lastindex = firstindex + readushort(f) - 1
+ for index=firstindex,lastindex do
+ local class = classes[readushort(f)]
+ if class == "mark" then
+ marks[index] = true
+ end
+ glyphs[index].class = class
+ end
+ elseif classformat == 2 then
+ local nofranges = readushort(f)
+ for i=1,nofranges do
+ local firstindex = readushort(f)
+ local lastindex = readushort(f)
+ local class = classes[readushort(f)]
+ if class then
+ for index=firstindex,lastindex do
+ glyphs[index].class = class
+ if class == "mark" then
+ marks[index] = true
+ end
+ end
+ end
+ end
+ end
+ end
+ -- mark classes
+ if markclassoffset ~= 0 then
+ setposition(f,tableoffset + markclassoffset)
+ local classformat = readushort(f)
+ if classformat == 1 then
+ local firstindex = readushort(f)
+ local lastindex = firstindex + readushort(f) - 1
+ for index=firstindex,lastindex do
+ markclasses[readushort(f)][index] = true
+ end
+ elseif classformat == 2 then
+ local nofranges = readushort(f)
+ for i=1,nofranges do
+ local firstindex = readushort(f)
+ local lastindex = readushort(f)
+ local class = markclasses[readushort(f)]
+ for index=firstindex,lastindex do
+ class[index] = true
+ end
+ end
+ end
+ end
+ -- mark sets : todo: just make the same as class sets above
+ if marksetsoffset ~= 0 then
+ marksetsoffset = tableoffset + marksetsoffset
+ setposition(f,marksetsoffset)
+ local format = readushort(f)
+ if format == 1 then
+ local nofsets = readushort(f)
+ local sets = readcardinaltable(f,nofsets,ulong)
+ for i=1,nofsets do
+ local offset = sets[i]
+ if offset ~= 0 then
+ marksets[i] = readcoverage(f,marksetsoffset+offset)
+ end
+ end
+ end
+ end
+
+ local factors = specification.factors
+
+ if (specification.variable or factors) and varsetsoffset ~= 0 then
+
+ local regions, deltas = readvariationdata(f,tableoffset+varsetsoffset,factors)
+
+ -- setvariabledata(fontdata,"gregions",regions)
+
+ if factors then
+ fontdata.temporary.getdelta = function(outer,inner)
+ local delta = deltas[outer+1]
+ if delta then
+ local d = delta.deltas[inner+1]
+ if d then
+ local scales = delta.scales
+ local dd = 0
+ for i=1,#scales do
+ local di = d[i]
+ if di then
+ dd = dd + scales[i] * di
+ else
+ break
+ end
+ end
+ return round(dd)
+ end
+ end
+ return 0
+ end
+ end
+
+ end
+ end
+end
+
+-- We keep this code here instead of font-otm.lua because we need coverage
+-- helpers. Okay, these helpers could go to the main reader file some day.
+
+local function readmathvalue(f)
+ local v = readshort(f)
+ skipshort(f,1) -- offset to device table
+ return v
+end
+
+local function readmathconstants(f,fontdata,offset)
+ setposition(f,offset)
+ fontdata.mathconstants = {
+ ScriptPercentScaleDown = readshort(f),
+ ScriptScriptPercentScaleDown = readshort(f),
+ DelimitedSubFormulaMinHeight = readushort(f),
+ DisplayOperatorMinHeight = readushort(f),
+ MathLeading = readmathvalue(f),
+ AxisHeight = readmathvalue(f),
+ AccentBaseHeight = readmathvalue(f),
+ FlattenedAccentBaseHeight = readmathvalue(f),
+ SubscriptShiftDown = readmathvalue(f),
+ SubscriptTopMax = readmathvalue(f),
+ SubscriptBaselineDropMin = readmathvalue(f),
+ SuperscriptShiftUp = readmathvalue(f),
+ SuperscriptShiftUpCramped = readmathvalue(f),
+ SuperscriptBottomMin = readmathvalue(f),
+ SuperscriptBaselineDropMax = readmathvalue(f),
+ SubSuperscriptGapMin = readmathvalue(f),
+ SuperscriptBottomMaxWithSubscript = readmathvalue(f),
+ SpaceAfterScript = readmathvalue(f),
+ UpperLimitGapMin = readmathvalue(f),
+ UpperLimitBaselineRiseMin = readmathvalue(f),
+ LowerLimitGapMin = readmathvalue(f),
+ LowerLimitBaselineDropMin = readmathvalue(f),
+ StackTopShiftUp = readmathvalue(f),
+ StackTopDisplayStyleShiftUp = readmathvalue(f),
+ StackBottomShiftDown = readmathvalue(f),
+ StackBottomDisplayStyleShiftDown = readmathvalue(f),
+ StackGapMin = readmathvalue(f),
+ StackDisplayStyleGapMin = readmathvalue(f),
+ StretchStackTopShiftUp = readmathvalue(f),
+ StretchStackBottomShiftDown = readmathvalue(f),
+ StretchStackGapAboveMin = readmathvalue(f),
+ StretchStackGapBelowMin = readmathvalue(f),
+ FractionNumeratorShiftUp = readmathvalue(f),
+ FractionNumeratorDisplayStyleShiftUp = readmathvalue(f),
+ FractionDenominatorShiftDown = readmathvalue(f),
+ FractionDenominatorDisplayStyleShiftDown = readmathvalue(f),
+ FractionNumeratorGapMin = readmathvalue(f),
+ FractionNumeratorDisplayStyleGapMin = readmathvalue(f),
+ FractionRuleThickness = readmathvalue(f),
+ FractionDenominatorGapMin = readmathvalue(f),
+ FractionDenominatorDisplayStyleGapMin = readmathvalue(f),
+ SkewedFractionHorizontalGap = readmathvalue(f),
+ SkewedFractionVerticalGap = readmathvalue(f),
+ OverbarVerticalGap = readmathvalue(f),
+ OverbarRuleThickness = readmathvalue(f),
+ OverbarExtraAscender = readmathvalue(f),
+ UnderbarVerticalGap = readmathvalue(f),
+ UnderbarRuleThickness = readmathvalue(f),
+ UnderbarExtraDescender = readmathvalue(f),
+ RadicalVerticalGap = readmathvalue(f),
+ RadicalDisplayStyleVerticalGap = readmathvalue(f),
+ RadicalRuleThickness = readmathvalue(f),
+ RadicalExtraAscender = readmathvalue(f),
+ RadicalKernBeforeDegree = readmathvalue(f),
+ RadicalKernAfterDegree = readmathvalue(f),
+ RadicalDegreeBottomRaisePercent = readshort(f),
+ }
+end
+
+local function readmathglyphinfo(f,fontdata,offset)
+ setposition(f,offset)
+ local italics = readushort(f)
+ local accents = readushort(f)
+ local extensions = readushort(f)
+ local kerns = readushort(f)
+ local glyphs = fontdata.glyphs
+ if italics ~= 0 then
+ setposition(f,offset+italics)
+ local coverage = readushort(f)
+ local nofglyphs = readushort(f)
+ coverage = readcoverage(f,offset+italics+coverage,true)
+ setposition(f,offset+italics+4)
+ for i=1,nofglyphs do
+ local italic = readmathvalue(f)
+ if italic ~= 0 then
+ local glyph = glyphs[coverage[i]]
+ local math = glyph.math
+ if not math then
+ glyph.math = { italic = italic }
+ else
+ math.italic = italic
+ end
+ end
+ end
+ fontdata.hasitalics = true
+ end
+ if accents ~= 0 then
+ setposition(f,offset+accents)
+ local coverage = readushort(f)
+ local nofglyphs = readushort(f)
+ coverage = readcoverage(f,offset+accents+coverage,true)
+ setposition(f,offset+accents+4)
+ for i=1,nofglyphs do
+ local accent = readmathvalue(f)
+ if accent ~= 0 then
+ local glyph = glyphs[coverage[i]]
+ local math = glyph.math
+ if not math then
+ glyph.math = { accent = accent }
+ else
+ math.accent = accent -- will become math.topanchor
+ end
+ end
+ end
+ end
+ if extensions ~= 0 then
+ setposition(f,offset+extensions)
+ end
+ if kerns ~= 0 then
+ local kernoffset = offset + kerns
+ setposition(f,kernoffset)
+ local coverage = readushort(f)
+ local nofglyphs = readushort(f)
+ if nofglyphs > 0 then
+ local function get(offset)
+ setposition(f,kernoffset+offset)
+ local n = readushort(f)
+ if n == 0 then
+ local k = readmathvalue(f)
+ if k == 0 then
+ -- no need for it (happens sometimes)
+ else
+ return { { kern = k } }
+ end
+ else
+ local l = { }
+ for i=1,n do
+ l[i] = { height = readmathvalue(f) }
+ end
+ for i=1,n do
+ l[i].kern = readmathvalue(f)
+ end
+ l[n+1] = { kern = readmathvalue(f) }
+ return l
+ end
+ end
+ local kernsets = { }
+ for i=1,nofglyphs do
+ local topright = readushort(f)
+ local topleft = readushort(f)
+ local bottomright = readushort(f)
+ local bottomleft = readushort(f)
+ kernsets[i] = {
+ topright = topright ~= 0 and topright or nil,
+ topleft = topleft ~= 0 and topleft or nil,
+ bottomright = bottomright ~= 0 and bottomright or nil,
+ bottomleft = bottomleft ~= 0 and bottomleft or nil,
+ }
+ end
+ coverage = readcoverage(f,kernoffset+coverage,true)
+ for i=1,nofglyphs do
+ local kernset = kernsets[i]
+ if next(kernset) then
+ local k = kernset.topright if k then kernset.topright = get(k) end
+ local k = kernset.topleft if k then kernset.topleft = get(k) end
+ local k = kernset.bottomright if k then kernset.bottomright = get(k) end
+ local k = kernset.bottomleft if k then kernset.bottomleft = get(k) end
+ if next(kernset) then
+ local glyph = glyphs[coverage[i]]
+ local math = glyph.math
+ if math then
+ math.kerns = kernset
+ else
+ glyph.math = { kerns = kernset }
+ end
+ end
+ end
+ end
+ end
+ end
+end
+
+local function readmathvariants(f,fontdata,offset)
+ setposition(f,offset)
+ local glyphs = fontdata.glyphs
+ local minoverlap = readushort(f)
+ local vcoverage = readushort(f)
+ local hcoverage = readushort(f)
+ local vnofglyphs = readushort(f)
+ local hnofglyphs = readushort(f)
+ local vconstruction = readcardinaltable(f,vnofglyphs,ushort)
+ local hconstruction = readcardinaltable(f,hnofglyphs,ushort)
+
+ fontdata.mathconstants.MinConnectorOverlap = minoverlap
+
+ -- variants[i] = {
+ -- glyph = readushort(f),
+ -- advance = readushort(f),
+ -- }
+
+ local function get(offset,coverage,nofglyphs,construction,kvariants,kparts,kitalic,korientation,orientation)
+ if coverage ~= 0 and nofglyphs > 0 then
+ local coverage = readcoverage(f,offset+coverage,true)
+ for i=1,nofglyphs do
+ local c = construction[i]
+ if c ~= 0 then
+ local index = coverage[i]
+ local glyph = glyphs[index]
+ local math = glyph.math
+ setposition(f,offset+c)
+ local assembly = readushort(f)
+ local nofvariants = readushort(f)
+ if nofvariants > 0 then
+ local variants, v = nil, 0
+ for i=1,nofvariants do
+ local variant = readushort(f)
+ if variant == index then
+ -- ignore
+ elseif variants then
+ v = v + 1
+ variants[v] = variant
+ else
+ v = 1
+ variants = { variant }
+ end
+ skipshort(f)
+ end
+ if not variants then
+ -- only self
+ elseif not math then
+ math = { [kvariants] = variants }
+ glyph.math = math
+ else
+ math[kvariants] = variants
+ end
+ end
+ if assembly ~= 0 then
+ setposition(f,offset + c + assembly)
+ local italic = readmathvalue(f)
+ local nofparts = readushort(f)
+ local parts = { }
+ for i=1,nofparts do
+ local p = {
+ glyph = readushort(f),
+ start = readushort(f),
+ ["end"] = readushort(f),
+ advance = readushort(f),
+ }
+ local flags = readushort(f)
+ if (flags & 0x0001) ~= 0 then
+ p.extender = 1 -- true
+ end
+ parts[i] = p
+ end
+ if not math then
+ math = {
+ [kparts] = parts
+ }
+ glyph.math = math
+ else
+ math[kparts] = parts
+ end
+ if italic and italic ~= 0 then
+ math[kitalic] = italic
+ end
+ if orientation then
+ math[korientation] = orientation
+ end
+ end
+ end
+ end
+ end
+ end
+
+ -- if CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0 then
+ get(offset,hcoverage,hnofglyphs,hconstruction,"variants","parts","partsitalic","partsorientation","horizontal")
+ get(offset,vcoverage,vnofglyphs,vconstruction,"variants","parts","partsitalic","partsorientation","vertical")
+ -- else
+ -- get(offset,vcoverage,vnofglyphs,vconstruction,"vvariants","vparts","vitalic")
+ -- get(offset,hcoverage,hnofglyphs,hconstruction,"hvariants","hparts","hitalic")
+ -- end
+end
+
+function readers.math(f,fontdata,specification)
+ local tableoffset = gotodatatable(f,fontdata,"math",specification.glyphs)
+ if tableoffset then
+ local version = readulong(f)
+ -- if version ~= 0x00010000 then
+ -- report("table version %a of %a is not supported (yet), maybe font %s is bad",version,"math",fontdata.filename)
+ -- return
+ -- end
+ local constants = readushort(f)
+ local glyphinfo = readushort(f)
+ local variants = readushort(f)
+ if constants == 0 then
+ report("the math table of %a has no constants",fontdata.filename)
+ else
+ readmathconstants(f,fontdata,tableoffset+constants)
+ end
+ if glyphinfo ~= 0 then
+ readmathglyphinfo(f,fontdata,tableoffset+glyphinfo)
+ end
+ if variants ~= 0 then
+ readmathvariants(f,fontdata,tableoffset+variants)
+ end
+ end
+end
+
+do
+
+ -- format 1: PaintColrLayers
+ -- for each referenced child paint table, in bottom-up z-order:
+ -- call renderPaint() passing the child paint table
+ -- compose the returned graphic onto the surface using simplealpha blending
+ --
+ -- format 2, 3: PaintSolid
+ -- paint the specified color onto the surface
+ --
+ -- format 4, 5, 6, 7, 8, 9: PaintLinearGradient, PaintRadialGradient, PaintSweepGradient
+ -- paint the gradient onto the surface following the gradient algorithm
+ --
+ -- format 10: PaintGlyph
+ -- apply the outline of the referenced glyph to the clip region
+ -- (take the intersection of clip regions—see Filling shapes)
+ -- call renderPaint() passing the child paint table
+ -- restore the previous clip region
+ --
+ -- format 11: PaintColrGlyph
+ -- call renderPaint() passing the paint table referenced by the base glyph ID
+ --
+ -- format 12 .. 31: Transform Translate Scale
+ -- apply the specified transform, compose the transform with the current transform
+ -- call renderPaint() passing the child paint table
+ -- restore the previous transform state
+ --
+ -- format 32: PaintComposite
+ -- call renderPaint() passing the backdrop child paint table and save the result
+ -- call renderPaint() passing the source child paint table and save the result
+ -- compose the source and backdrop using the specified composite mode
+ -- compose the result of the above composition onto the surface using simple alpha blending
+
+ local paintdata -- for the moment verbose, will be just indexed
+ local linesdata -- for the moment verbose, will be just indexed
+ local affinedata -- for the moment verbose, will be just indexed
+
+ local function getpaintoffset(f,offset)
+ offset = offset + readuoffset(f)
+ return paintdata[offset] and offset or nil
+ end
+
+ local function getlinesoffset(f,offset,var)
+ local offset = offset + readuoffset(f)
+ if linesdata[offset] == nil then
+ linesdata[offset] = var
+ end
+ return offset
+ end
+
+ local function getaffineoffset(f,offset,var)
+ local offset = offset + readuoffset(f)
+ if affinedata[offset] == nil then
+ affinedata[offset] = var
+ end
+ return offset
+ end
+
+ paintreaders = {
+ -- uint8 numLayers Number of offsets to paint tables to read from LayerList.
+ -- uint32 firstLayerIndex Index (base 0) into the LayerList.
+ [1] = function(f,format)
+ return {
+ format = format,
+ name = "PaintColrLayers",
+ count = readuinteger(f),
+ index = readulong(f),
+ list = false,
+ }
+ end,
+ -- uint16 paletteIndex Index for a CPAL palette entry.
+ -- F2DOT14 alpha Alpha value.
+ [2] = function(f,format)
+ return {
+ format = format,
+ name = "Paintsolid",
+ palette = readushort(f),
+ alpha = read2dot14(f),
+ }
+ end,
+ -- uint16 paletteIndex Index for a CPAL palette entry.
+ -- F2DOT14 alpha Alpha value. For variation, use varIndexBase + 0.
+ -- uint32 varIndexBase Base index into DeltaSetIndexMap.
+ [3] = function(f,format)
+ return {
+ format = format,
+ name = "Paintsolid",
+ palette = readushort(f),
+ alpha = read2dot14(f),
+ varbase = readulong(f),
+ }
+ end,
+ -- Offset24 colorLineOffset Offset to VarColorLine table.
+ -- FWORD x0 Start point (pâ‚€) x coordinate. For variation, use varIndexBase + 0.
+ -- FWORD y0 Start point (pâ‚€) y coordinate. For variation, use varIndexBase + 1.
+ -- FWORD x1 End point (pâ‚) x coordinate. For variation, use varIndexBase + 2.
+ -- FWORD y1 End point (pâ‚) y coordinate. For variation, use varIndexBase + 3.
+ -- FWORD x2 Rotation point (pâ‚‚) x coordinate. For variation, use varIndexBase + 4.
+ -- FWORD y2 Rotation point (pâ‚‚) y coordinate. For variation, use varIndexBase + 5.
+ -- uint32 varIndexBase Base index into DeltaSetIndexMap.
+ [4] = function(f,format,offset)
+ return {
+ format = format,
+ name = "PaintLinearGradient",
+ color = getlinesoffset(f,offset,false),
+ x0 = readfword(f),
+ y0 = readfword(f),
+ x1 = readfword(f),
+ y1 = readfword(f),
+ x2 = readfword(f),
+ y2 = readfword(f),
+ }
+ end,
+ [5] = function(f,format,offset)
+ return {
+ format = format,
+ name = "PaintLinearGradient",
+ color = getlinesoffset(f,offset,true),
+ x0 = readfword(f),
+ y0 = readfword(f),
+ x1 = readfword(f),
+ y1 = readfword(f),
+ x2 = readfword(f),
+ y2 = readfword(f),
+ varbase = readulong(f),
+ }
+ end,
+ -- Offset24 colorLineOffset Offset to VarColorLine table.
+ -- FWORD x0 Start circle center x coordinate. For variation, use varIndexBase + 0.
+ -- FWORD y0 Start circle center y coordinate. For variation, use varIndexBase + 1.
+ -- UFWORD radius0 Start circle radius. For variation, use varIndexBase + 2.
+ -- FWORD x1 End circle center x coordinate. For variation, use varIndexBase + 3.
+ -- FWORD y1 End circle center y coordinate. For variation, use varIndexBase + 4.
+ -- UFWORD radius1 End circle radius. For variation, use varIndexBase + 5.
+ -- uint32 varIndexBase Base index into DeltaSetIndexMap.
+ [6] = function(f,format)
+ return {
+ format = format,
+ name = "PaintRadialGradient",
+ color = getlinesoffset(f,offset,false),
+ x0 = readfword(f),
+ y0 = readfword(f),
+ radius0 = readfword(f),
+ x1 = readfword(f),
+ y1 = readfword(f),
+ radius1 = readfword(f),
+ }
+ end,
+ [7] = function(f,format)
+ return {
+ format = format,
+ name = "PaintRadialGradient",
+ color = getlinesoffset(f,offset,true),
+ x0 = readfword(f),
+ y0 = readfword(f),
+ radius0 = readfword(f),
+ x1 = readfword(f),
+ y1 = readfword(f),
+ radius1 = readfword(f),
+ varbase = readulong(f),
+ }
+ end,
+ -- Offset24 colorLineOffset Offset to VarColorLine table.
+ -- FWORD centerX Center x coordinate. For variation, use varIndexBase + 0.
+ -- FWORD centerY Center y coordinate. For variation, use varIndexBase + 1.
+ -- F2DOT14 startAngle Start of the angular range of the gradient, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 2.
+ -- F2DOT14 endAngle End of the angular range of the gradient, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 3.
+ -- uint32 varIndexBase Base index into DeltaSetIndexMap.
+ [8] = function(f,format)
+ return {
+ format = format,
+ name = "PaintSweepGradient",
+ color = getlinesoffset(f,offset,false),
+ centerx = readfword(f),
+ centery = readfword(f),
+ startangle = read2dot14(f),
+ endangle = read2dot14(f),
+ }
+ end,
+ [9] = function(f,format)
+ return {
+ format = format,
+ name = "PaintSweepGradient",
+ color = getlinesoffset(f,offset,true),
+ centerx = readfword(f),
+ centery = readfword(f),
+ startangle = read2dot14(f),
+ endangle = read2dot14(f),
+ varbase = readulong(f),
+ }
+ end,
+ -- Offset24 paintOffset Offset to a Paint table.
+ -- uint16 glyphID Glyph ID for the source outline.
+ [10] = function(f,format,offset)
+ return {
+ format = format,
+ name = "PaintGlyph",
+ paint = getpaintoffset(f,offset),
+ glyph = readushort(f),
+ }
+ end,
+ -- uint16 glyphID Glyph ID for a BaseGlyphList base glyph.
+ [11] = function(f,format)
+ return {
+ format = format,
+ name = "PaintColrGlyph",
+ glyph = readushort(f),
+ }
+ end,
+ -- Offset24 paintOffset Offset to a Paint subtable.
+ -- Offset24 transformOffset Offset to an (Var)Affine2x3 table.
+ [12] = function(f,format,offset)
+ return {
+ format = format,
+ name = "PaintTransform",
+ affine = getaffineoffset(f,offset,false),
+ paint = getpaintoffset(f,offset),
+ }
+ end,
+ [13] = function(f,format,offset)
+ return {
+ format = format,
+ name = "PaintTransform",
+ affine = getaffineoffset(f,offset,true),
+ paint = getpaintoffset(f,offset),
+ }
+ end,
+ -- Offset24 paintOffset Offset to a Paint subtable.
+ -- FWORD dx Translation in x direction. For variation, use varIndexBase + 0.
+ -- FWORD dy Translation in y direction. For variation, use varIndexBase + 1.
+ -- uint32 varIndexBase Base index into DeltaSetIndexMap.
+ [14] = function(f,format,offset)
+ return {
+ format = format,
+ name = "PaintTranslate",
+ paint = getpaintoffset(f,offset),
+ dx = readfword(f),
+ dy = readfword(f),
+ }
+ end,
+ [15] = function(f,format,offset)
+ return {
+ format = format,
+ name = "PaintTranslate",
+ paint = getpaintoffset(f,offset),
+ dx = readfword(f),
+ dy = readfword(f),
+ varbase = readulong(f),
+ }
+ end,
+ -- Offset24 paintOffset Offset to a Paint subtable.
+ -- F2DOT14 scaleX Scale factor in x direction. For variation, use varIndexBase + 0.
+ -- F2DOT14 scaleY Scale factor in y direction. For variation, use varIndexBase + 1.
+ -- uint32 varIndexBase Base index into DeltaSetIndexMap.
+ [16] = function(f,format,offset)
+ return {
+ format = format,
+ name = "PaintScale",
+ paint = getpaintoffset(f,offset),
+ scalex = read2dot14(f),
+ scaley = read2dot14(f),
+ }
+ end,
+ [17] = function(f,format,offset)
+ return {
+ format = format,
+ name = "PaintScale",
+ paint = getpaintoffset(f,offset),
+ scalex = read2dot14(f),
+ scaley = read2dot14(f),
+ varbase = readulong(f),
+ }
+ end,
+ -- Offset24 paintOffset Offset to a Paint subtable.
+ -- F2DOT14 scaleX Scale factor in x direction. For variation, use varIndexBase + 0.
+ -- F2DOT14 scaleY Scale factor in y direction. For variation, use varIndexBase + 1.
+ -- FWORD centerX x coordinate for the center of scaling. For variation, use varIndexBase + 2.
+ -- FWORD centerY y coordinate for the center of scaling. For variation, use varIndexBase + 3.
+ -- uint32 varIndexBase Base index into DeltaSetIndexMap.
+ [18] = function(f,format,offset)
+ return {
+ format = format,
+ name = "PaintScale",
+ paint = getpaintoffset(f,offset),
+ scalex = read2dot14(f),
+ scaley = read2dot14(f),
+ centerx = readfword(f),
+ centery = readfword(f),
+ }
+ end,
+ [19] = function(f,format,offset)
+ return {
+ format = format,
+ name = "PaintScale",
+ paint = getpaintoffset(f,offset),
+ scalex = read2dot14(f),
+ scaley = read2dot14(f),
+ centerx = readfword(f),
+ centery = readfword(f),
+ varbase = readulong(f),
+ }
+ end,
+ -- Offset24 paintOffset Offset to a Paint subtable.
+ -- F2DOT14 scale Scale factor in x and y directions. For variation, use varIndexBase + 0.
+ -- uint32 varIndexBase Base index into DeltaSetIndexMap.
+ [20] = function(f,format,offset)
+ return {
+ format = format,
+ name = "PaintScale",
+ paint = getpaintoffset(f,offset),
+ scale = read2dot14(f),
+ }
+ end,
+ [21] = function(f,format,offset)
+ return {
+ format = format,
+ name = "PaintScale",
+ paint = getpaintoffset(f,offset),
+ scale = read2dot14(f),
+ varbase = readulong(f),
+ }
+ end,
+ -- Offset24 paintOffset Offset to a Paint subtable.
+ -- F2DOT14 scale Scale factor in x and y directions. For variation, use varIndexBase + 0.
+ -- FWORD centerX x coordinate for the center of scaling. For variation, use varIndexBase + 1.
+ -- FWORD centerY y coordinate for the center of scaling. For variation, use varIndexBase + 2.
+ -- uint32 varIndexBase Base index into DeltaSetIndexMap.
+ [22] = function(f,format,offset)
+ return {
+ format = format,
+ name = "PaintScale",
+ paint = getpaintoffset(f,offset),
+ scale = read2dot14(f),
+ centerx = readfword(f),
+ centery = readfword(f),
+ }
+ end,
+ [23] = function(f,format,offset)
+ return {
+ format = format,
+ name = "PaintScale",
+ paint = getpaintoffset(f,offset),
+ scale = read2dot14(f),
+ centerx = readfword(f),
+ centery = readfword(f),
+ varbase = readulong(f),
+ }
+ end,
+ -- Offset24 paintOffset Offset to a Paint subtable.
+ -- F2DOT14 angle Rotation angle, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 0.
+ -- uint32 varIndexBase Base index into DeltaSetIndexMap.
+ [24] = function(f,format,offset)
+ return {
+ format = format,
+ angle = read2dot14(f),
+ paint = getpaintoffset(f,offset),
+ name = "PaintRotate",
+ }
+ end,
+ [25] = function(f,format,offset)
+ return {
+ format = format,
+ name = "PaintRotate",
+ paint = getpaintoffset(f,offset),
+ angle = read2dot14(f),
+ varbase = readulong(f),
+ }
+ end,
+ -- Offset24 paintOffset Offset to a Paint subtable.
+ -- F2DOT14 angle Rotation angle, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 0.
+ -- FWORD centerX x coordinate for the center of rotation. For variation, use varIndexBase + 1.
+ -- FWORD centerY y coordinate for the center of rotation. For variation, use varIndexBase + 2.
+ -- uint32 varIndexBase Base index into DeltaSetIndexMap.
+ [26] = function(f,format,offset)
+ return {
+ format = format,
+ name = "PaintRotate",
+ paint = getpaintoffset(f,offset),
+ centerx = readfword(f),
+ centery = readfword(f),
+ }
+ end,
+ [27] = function(f,format,offset)
+ return {
+ format = format,
+ name = "PaintRotate",
+ paint = getpaintoffset(f,offset),
+ centerx = read2dot14(f),
+ centery = read2dot14(f),
+ varbase = readulong(f),
+ }
+ end,
+ -- Offset24 paintOffset Offset to a Paint subtable.
+ -- F2DOT14 xSkewAngle Angle of skew in the direction of the x-axis, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 0.
+ -- F2DOT14 ySkewAngle Angle of skew in the direction of the y-axis, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 1.
+ -- uint32 varIndexBase Base index into DeltaSetIndexMap.
+ [28] = function(f,format,offset)
+ return {
+ format = format,
+ name = "PaintSkew",
+ paint = getpaintoffset(f,offset),
+ xangle = read2dot14(f),
+ yangle = read2dot14(f),
+ }
+ end,
+ [29] = function(f,format,offset)
+ return {
+ format = format,
+ name = "PaintSkew",
+ paint = getpaintoffset(f,offset),
+ xangle = read2dot14(f),
+ yangle = read2dot14(f),
+ varbase = readulong(f),
+ }
+ end,
+ -- Offset24 paintOffset Offset to a Paint subtable.
+ -- F2DOT14 xSkewAngle Angle of skew in the direction of the x-axis, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 0.
+ -- F2DOT14 ySkewAngle Angle of skew in the direction of the y-axis, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 1.
+ -- FWORD centerX x coordinate for the center of rotation. For variation, use varIndexBase + 2.
+ -- FWORD centerY y coordinate for the center of rotation. For variation, use varIndexBase + 3.
+ -- uint32 varIndexBase Base index into DeltaSetIndexMap.
+ [30] = function(f,format,offset)
+ return {
+ format = format,
+ name = "PaintSkew",
+ paint = getpaintoffset(f,offset),
+ xangle = read2dot14(f),
+ yangle = read2dot14(f),
+ centerx = readfword(f),
+ centery = readfword(f),
+ }
+ end,
+ [31] = function(f,format,offset)
+ return {
+ format = format,
+ name = "PaintSkew",
+ paint = getpaintoffset(f,offset),
+ xangle = read2dot14(f),
+ yangle = read2dot14(f),
+ centerx = readfword(f),
+ centery = readfword(f),
+ varbase = readulong(f),
+ }
+ end,
+ -- Offset24 sourcePaintOffset Offset to a source Paint table.
+ -- uint8 compositeMode A CompositeMode enumeration value.
+ -- Offset24 backdropaintOffset Offset to a backdrop Paint table.
+ [32] = function(f,format,offset)
+ return {
+ format = format,
+ name = "PaintComposite",
+ source = getpaintoffset(f,offset),
+ mode = readuinteger(f),
+ backdrop = getpaintoffset(f,offset),
+ }
+ end,
+ }
+
+ local unsupported = function()
+ return nil
+ end
+
+ setmetatableindex(paintreaders,function(t,format)
+ report("unsupported colr type 2 paint format %i",format)
+ t[format] = unsupported
+ return unsupported
+ end)
+
+ function readers.colr(f,fontdata,specification)
+ local tableoffset = gotodatatable(f,fontdata,"colr",specification.glyphs)
+ if tableoffset then
+ local version = readushort(f)
+ if version == 0 then
+ -- we're okay
+ elseif version == 1 then
+ report("table version %a of %a is %s supported for font %s",version,"colr","partially",fontdata.filename)
+ else
+ report("table version %a of %a is %s supported for font %s",version,"colr","not",fontdata.filename)
+ return
+ end
+ if not fontdata.tables.cpal then
+ report("color table %a in font %a has no mandate %a table","colr",fontdata.filename,"cpal")
+ fontdata.colorpalettes = { }
+ end
+ local glyphs = fontdata.glyphs
+ local nofglyphs = readushort(f)
+ local baseoffset = readulong(f)
+ local layeroffset = readulong(f)
+ local noflayers = readushort(f)
+ local glyphlistoffset = 0
+ local layerlistoffset = 0
+ local cliplistoffset = 0
+ local varindexmapoffset = 0
+ local variationoffset = 0
+ if version == 1 then
+ glyphlistoffset = readulong(f)
+ layerlistoffset = readulong(f)
+ cliplistoffset = readulong(f)
+ varindexmapoffset = readulong(f)
+ variationoffset = readulong(f)
+ end
+ local layerrecords = { }
+ local maxclass = 0
+ -- The special value 0xFFFF is foreground (but we index from 1). It
+ -- more looks like indices into a palette so 'class' is a better name
+ -- than 'palette'.
+ if layeroffset > 0 then
+ setposition(f,tableoffset + layeroffset)
+ for i=1,noflayers do
+ local slot = readushort(f)
+ local class = readushort(f)
+ if class < 0xFFFF then
+ class = class + 1
+ if class > maxclass then
+ maxclass = class
+ end
+ end
+ layerrecords[i] = {
+ slot = slot,
+ class = class,
+ }
+ end
+ end
+ fontdata.maxcolorclass = maxclass
+ if baseoffset > 0 then
+ setposition(f,tableoffset + baseoffset)
+ for i=0,nofglyphs-1 do
+ local glyphindex = readushort(f)
+ local firstlayer = readushort(f)
+ local noflayers = readushort(f)
+ local t = { }
+ for i=1,noflayers do
+ t[i] = layerrecords[firstlayer+i]
+ end
+ glyphs[glyphindex].colors = t
+ end
+ end
+if next(layerrecords) then
+ report("table version %a of %a is %s supported for font %s",version,"colr","partially",fontdata.filename)
+ return
+end
+ -- if not (CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0) then
+ -- return
+ -- end
+ if layerlistoffset > 0 and glyphlistoffset > 0 then
+ local layers = { }
+ local paints = { }
+ local count, offset
+ --
+ setposition(f,tableoffset + layerlistoffset)
+ count = readulong(f)
+ -- layers = readcardinaltable(f,count,uoffset)
+ for i=1,count do -- zero ?
+ layers[i] = readulong(f) -- offsets to painttable
+ end
+ --
+ offset = tableoffset + glyphlistoffset
+ setposition(f,offset)
+ count = readulong(f)
+ for i=1,count do
+ -- glyph index -> paintrecord
+ paints[readushort(f)] = readulong(f) -- paintrecord offset (32 formats)
+ end
+ paintdata = setmetatableindex(function(t,k)
+ setposition(f,k)
+ local format = readuinteger(f)
+ local v = paintreaders[format](f,format,k)
+ t[k] = v
+ return v
+ end)
+ linesdata = { }
+ affinedata = { }
+ for k, v in next, paints do
+ local o = offset + v
+ if paintdata[o] then
+ paints[k] = o -- first paint
+ end
+ end
+ -- expand format 1
+ offset = tableoffset + layerlistoffset
+ for k, v in next, paints do
+ v = paintdata[v]
+ local format = v.format
+ if format == 1 then
+ -- name
+ local count = v.count
+ local index = v.index
+ local list = { }
+ v.count = nil
+ v.index = nil
+ v.list = list
+ for i=1,count do
+ local o = offset + layers[index+i]
+ if paintdata[o] then
+ list[i] = o
+ end
+ end
+ end
+ end
+ --
+ if variationoffset > 0 then
+ local offsettostore = tableoffset + variationoffset
+ local factors = specification.factors
+ if factors then
+ local regions, deltas = readvariationdata(f,offsettostore,factors)
+ report("font %a has a colr variations, check it out",fontdata.filename)
+ -- inspect(regions)
+ -- inspect(deltas)
+ end
+ end
+ --
+ -- It will take while before I finish this, also because there has never
+ -- been much demand for color fonts and there is no real incentive for
+ -- spending too much time on it.
+ --
+ -- todo: cliplist, varbase, affine, deltas etc
+ --
+ -- reindex tables, gives smaller files but optional because of tracing
+ --
+ for k, v in next, linesdata do
+ setposition(f,k)
+ local extend = readuinteger(f)
+ local count = readushort(f)
+ local stops = { }
+ for i=1,count do
+ stops[i] = {
+ stop = read2dot14(f),
+ pallette = readushort(f),
+ alpha = read2dot14(f),
+ varbase = v and readulong(f) or nil,
+ }
+ end
+ linesdata[k] = {
+ extend = readuinteger(f),
+ stops = stops,
+ }
+ end
+ --
+ for k, v in next, affinedata do
+ setposition(f,k)
+ affinedata[k] = {
+ xx = readfixed(f),
+ yx = readfixed(f),
+ xy = readfixed(f),
+ yy = readfixed(f),
+ dx = readfixed(f),
+ dy = readfixed(f),
+ }
+ end
+ --
+ local function rehash(t)
+ local hash = { }
+ local data = { }
+ local n = 0
+ for k, v in table.sortedhash(t) do
+ n = n + 1
+ hash[k] = n
+ data[n] = v
+ end
+ return hash, data
+ end
+ --
+ if true then
+ local phash, pdata = rehash(paintdata)
+ local lhash, ldata = rehash(linesdata)
+ local ahash, adata = rehash(affinedata)
+ for k, v in next, paintdata do
+ local c = v.color
+ if c then
+ v.color = lhash[c]
+ end
+ local a = v.affine
+ if a then
+ v.affine = ahash[a]
+ end
+ local p = v.paint
+ if p then
+ v.paint = phash[p]
+ goto done
+ end
+ local l = v.list
+ if l then
+ for i=1,#l do
+ l[i] = phash[l[i]]
+ end
+ goto done
+ end
+ local s = v.source
+ if s then
+ v.source = phash[s]
+ v.backdrop = phash[v.backdrop]
+ -- goto done
+ end
+ ::done::
+ end
+ paintdata = pdata
+ linesdata = ldata
+ for k, v in next, paints do -- zero indexed
+ paints[k] = phash[v]
+ end
+ end
+ --
+ if not next(layerrecords) then
+ for k, v in next, paints do
+ local paint = paintdata[v]
+ local format = paint.format
+ if format == 1 then
+ local list = paint.list
+ local done = { }
+ for i=1,#list do
+ local p = paintdata[list[i]]
+ local f = p.format
+ if f == 10 or f == 11 then
+ done[i] = {
+ slot = p.glyph,
+ class = i,
+ }
+ end
+ end
+ glyphs[k].colors = done
+ end
+ end
+ end
+-- fontdata.colorpaintdata = paintdata
+-- fontdata.colorpaintlist = paints
+-- fontdata.colorlinesdata = linesdata
+-- fontdata.coloraffinedata = affinedata
+ end
+ end
+ fontdata.hascolor = true
+ end
+
+end
+
+function readers.cpal(f,fontdata,specification)
+ local tableoffset = gotodatatable(f,fontdata,"cpal",specification.glyphs)
+ if tableoffset then
+ local version = readushort(f)
+ -- if version > 1 then
+ -- report("table version %a of %a is not supported (yet), maybe font %s is bad",version,"cpal",fontdata.filename)
+ -- return
+ -- end
+ local nofpaletteentries = readushort(f)
+ local nofpalettes = readushort(f)
+ local nofcolorrecords = readushort(f)
+ local firstcoloroffset = readulong(f)
+ local colorrecords = { }
+ local palettes = readcardinaltable(f,nofpalettes,ushort)
+ if version == 1 then
+ -- used for guis
+ local palettettypesoffset = readulong(f)
+ local palettelabelsoffset = readulong(f)
+ local paletteentryoffset = readulong(f)
+ end
+ setposition(f,tableoffset+firstcoloroffset)
+ for i=1,nofcolorrecords do
+ local b, g, r, a = readbytes(f,4)
+ colorrecords[i] = {
+ r, g, b, a ~= 255 and a or nil,
+ }
+ end
+ for i=1,nofpalettes do
+ local p = { }
+ local o = palettes[i]
+ for j=1,nofpaletteentries do
+ p[j] = colorrecords[o+j]
+ end
+ palettes[i] = p
+ end
+ fontdata.colorpalettes = palettes
+ end
+end
+
+local compress = gzip and gzip.compress
+local compressed = compress and gzip.compressed
+
+-- At some point I will delay loading and only store the offsets (in context lmtx
+-- only).
+
+-- compressed = false
+
+function readers.svg(f,fontdata,specification)
+ local tableoffset = gotodatatable(f,fontdata,"svg",specification.glyphs)
+ if tableoffset then
+ local version = readushort(f)
+ -- if version ~= 0 then
+ -- report("table version %a of %a is not supported (yet), maybe font %s is bad",version,"svg",fontdata.filename)
+ -- return
+ -- end
+ local glyphs = fontdata.glyphs
+ local indexoffset = tableoffset + readulong(f)
+ local reserved = readulong(f)
+ setposition(f,indexoffset)
+ local nofentries = readushort(f)
+ local entries = { }
+ for i=1,nofentries do
+ entries[i] = {
+ first = readushort(f),
+ last = readushort(f),
+ offset = indexoffset + readulong(f),
+ length = readulong(f),
+ }
+ end
+ for i=1,nofentries do
+ local entry = entries[i]
+ setposition(f,entry.offset)
+ local data = readstring(f,entry.length)
+ if compressed and not compressed(data) then
+ data = compress(data)
+ end
+ entries[i] = {
+ first = entry.first,
+ last = entry.last,
+ data = data
+ }
+ end
+ fontdata.svgshapes = entries
+ end
+ fontdata.hascolor = true
+end
+
+function readers.sbix(f,fontdata,specification)
+ local tableoffset = gotodatatable(f,fontdata,"sbix",specification.glyphs)
+ if tableoffset then
+ local version = readushort(f)
+ local flags = readushort(f)
+ local nofstrikes = readulong(f)
+ local strikes = { }
+ local nofglyphs = fontdata.nofglyphs
+ for i=1,nofstrikes do
+ strikes[i] = readulong(f)
+ end
+ local shapes = { }
+ local done = 0
+ for i=1,nofstrikes do
+ local strikeoffset = strikes[i] + tableoffset
+ setposition(f,strikeoffset)
+ strikes[i] = {
+ ppem = readushort(f),
+ ppi = readushort(f),
+ offset = strikeoffset
+ }
+ end
+ -- highest first
+ sort(strikes,function(a,b)
+ if b.ppem == a.ppem then
+ return b.ppi < a.ppi
+ else
+ return b.ppem < a.ppem
+ end
+ end)
+ local glyphs = { }
+ -- local delayed = CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0 or fonts.handlers.typethree
+ for i=1,nofstrikes do
+ local strike = strikes[i]
+ local strikeppem = strike.ppem
+ local strikeppi = strike.ppi
+ local strikeoffset = strike.offset
+ setposition(f,strikeoffset)
+ for i=0,nofglyphs do
+ glyphs[i] = readulong(f)
+ end
+ local glyphoffset = glyphs[0]
+ for i=0,nofglyphs-1 do
+ local nextoffset = glyphs[i+1]
+ if not shapes[i] then
+ local datasize = nextoffset - glyphoffset
+ if datasize > 0 then
+ setposition(f,strikeoffset + glyphoffset)
+ local x = readshort(f)
+ local y = readshort(f)
+ local tag = readtag(f) -- or just skip, we never needed it till now
+ local size = datasize - 8
+ local data = nil
+ local offset = nil
+ -- if delayed then
+ offset = getposition(f)
+ -- else
+ -- data = readstring(f,size)
+ -- size = nil
+ -- end
+ shapes[i] = {
+ x = x,
+ y = y,
+ o = offset,
+ s = size,
+ data = data,
+ -- tag = tag, -- maybe for tracing
+ -- ppem = strikeppem, -- not used, for tracing
+ -- ppi = strikeppi, -- not used, for tracing
+ }
+ done = done + 1
+ if done == nofglyphs then
+ break
+ end
+ end
+ end
+ glyphoffset = nextoffset
+ end
+ end
+ fontdata.pngshapes = shapes
+ end
+end
+
+-- Another bitmap (so not that useful) format. But Luigi found a font that
+-- has them , so ...
+
+do
+
+ local function getmetrics(f)
+ return {
+ ascender = readinteger(f),
+ descender = readinteger(f),
+ widthmax = readuinteger(f),
+ caretslopedumerator = readinteger(f),
+ caretslopedenominator = readinteger(f),
+ caretoffset = readinteger(f),
+ minorigin = readinteger(f),
+ minadvance = readinteger(f),
+ maxbefore = readinteger(f),
+ minafter = readinteger(f),
+ pad1 = readinteger(f),
+ pad2 = readinteger(f),
+ }
+ end
+
+ -- bad names
+
+ local function getbigmetrics(f)
+ -- bigmetrics, maybe just skip 9 bytes
+ return {
+ height = readuinteger(f),
+ width = readuinteger(f),
+ horiBearingX = readinteger(f),
+ horiBearingY = readinteger(f),
+ horiAdvance = readuinteger(f),
+ vertBearingX = readinteger(f),
+ vertBearingY = readinteger(f),
+ vertAdvance = readuinteger(f),
+ }
+ end
+
+ local function getsmallmetrics(f)
+ -- smallmetrics, maybe just skip 5 bytes
+ return {
+ height = readuinteger(f),
+ width = readuinteger(f),
+ bearingX = readinteger(f),
+ bearingY = readinteger(f),
+ advance = readuinteger(f),
+ }
+ end
+
+ function readers.cblc(f,fontdata,specification)
+ -- should we delay this ?
+ local ctdttableoffset = gotodatatable(f,fontdata,"cbdt",specification.glyphs)
+ if not ctdttableoffset then
+ return
+ end
+ local cblctableoffset = gotodatatable(f,fontdata,"cblc",specification.glyphs)
+ if cblctableoffset then
+ local majorversion = readushort(f)
+ local minorversion = readushort(f)
+ local nofsizetables = readulong(f)
+ local sizetables = { }
+ local shapes = { }
+ local subtables = { }
+ for i=1,nofsizetables do
+ sizetables[i] = {
+ subtables = readulong(f),
+ indexsize = readulong(f),
+ nofsubtables = readulong(f),
+ colorref = readulong(f),
+ hormetrics = getmetrics(f),
+ vermetrics = getmetrics(f),
+ firstindex = readushort(f),
+ lastindex = readushort(f),
+ ppemx = readbyte(f),
+ ppemy = readbyte(f),
+ bitdepth = readbyte(f),
+ flags = readbyte(f),
+ }
+ end
+ sort(sizetables,function(a,b)
+ if b.ppemx == a.ppemx then
+ return b.bitdepth < a.bitdepth
+ else
+ return b.ppemx < a.ppemx
+ end
+ end)
+ for i=1,nofsizetables do
+ local s = sizetables[i]
+ local d = false
+ for j=s.firstindex,s.lastindex do
+ if not shapes[j] then
+ shapes[j] = i
+ d = true
+ end
+ end
+ if d then
+ s.used = true
+ end
+ end
+ for i=1,nofsizetables do
+ local s = sizetables[i]
+ if s.used then
+ local offset = s.subtables
+ setposition(f,cblctableoffset+offset)
+ for j=1,s.nofsubtables do
+ local firstindex = readushort(f)
+ local lastindex = readushort(f)
+ local tableoffset = readulong(f) + offset
+ for k=firstindex,lastindex do
+ if shapes[k] == i then
+ local s = subtables[tableoffset]
+ if not s then
+ s = {
+ firstindex = firstindex,
+ lastindex = lastindex,
+ }
+ subtables[tableoffset] = s
+ end
+ shapes[k] = s
+ end
+ end
+ end
+ end
+ end
+
+ -- there is no need to sort in string stream but we have a nicer trace
+ -- if needed
+
+ for offset, subtable in sortedhash(subtables) do
+ local tabletype = readushort(f)
+ subtable.format = readushort(f)
+ local baseoffset = readulong(f) + ctdttableoffset
+ local offsets = { }
+ local metrics = nil
+ if tabletype == 1 then
+ -- we have the usual one more to get the size
+ for i=subtable.firstindex,subtable.lastindex do
+ offsets[i] = readulong(f) + baseoffset
+ end
+ skipbytes(f,4)
+ elseif tabletype == 2 then
+ local size = readulong(f)
+ local done = baseoffset
+ metrics = getbigmetrics(f)
+ for i=subtable.firstindex,subtable.lastindex do
+ offsets[i] = done
+ done = done + size
+ end
+ elseif tabletype == 3 then
+ -- we have the usual one more to get the size
+ local n = subtable.lastindex - subtable.firstindex + 2
+ for i=subtable.firstindex,subtable.lastindex do
+ offsets[i] = readushort(f) + baseoffset
+ end
+ if math.odd(n) then
+ skipbytes(f,4)
+ else
+ skipbytes(f,2)
+ end
+ elseif tabletype == 4 then
+ for i=1,readulong(f) do
+ offsets[readushort(f)] = readushort(f) + baseoffset
+ end
+ elseif tabletype == 5 then
+ local size = readulong(f)
+ local done = baseoffset
+ metrics = getbigmetrics(f)
+ local n = readulong(f)
+ for i=1,n do
+ offsets[readushort(f)] = done
+ done = done + size
+ end
+ if math.odd(n) then
+ skipbytes(f,2)
+ end
+ else
+ return -- unsupported format
+ end
+ subtable.offsets = offsets
+ subtable.metrics = metrics
+ end
+
+ -- we only support a few sensible types ... there are hardly any fonts so
+ -- why are there so many variants ... not the best spec
+
+ local default = { width = 0, height = 0 }
+ local glyphs = fontdata.glyphs
+ -- local delayed = CONTEXTLMTXMODE and CONTEXTLMTXMODE > 0 or fonts.handlers.typethree
+
+ for index, subtable in sortedhash(shapes) do
+ if type(subtable) == "table" then
+ local data = nil
+ local size = nil
+ local metrics = default
+ local format = subtable.format
+ local offset = subtable.offsets[index]
+ setposition(f,offset)
+ if format == 17 then
+ metrics = getsmallmetrics(f)
+ size = true
+ elseif format == 18 then
+ metrics = getbigmetrics(f)
+ size = true
+ elseif format == 19 then
+ metrics = subtable.metrics
+ size = true
+ else
+ -- forget about it
+ end
+ if size then
+ size = readulong(f)
+ -- if delayed then
+ offset = getposition(f)
+ data = nil
+ -- else
+ -- offset = nil
+ -- data = readstring(f,size)
+ -- size = nil
+ -- end
+ else
+ offset = nil
+ end
+ local x = metrics.width
+ local y = metrics.height
+ shapes[index] = {
+ x = x,
+ y = y,
+ o = offset,
+ s = size,
+ data = data,
+ }
+ -- I'll look into this in more details when needed
+ -- as we can use the bearings to get better boxes.
+ local glyph = glyphs[index]
+ if not glyph.boundingbox then
+ local width = glyph.width
+ local height = width * y/x
+ glyph.boundingbox = { 0, 0, width, height }
+ end
+ else
+ shapes[index] = {
+ x = 0,
+ y = 0,
+ data = "", -- or just nil
+ }
+ end
+ end
+
+ fontdata.pngshapes = shapes -- we cheat
+ end
+ end
+
+ function readers.cbdt(f,fontdata,specification)
+ -- local tableoffset = gotodatatable(f,fontdata,"ctdt",specification.glyphs)
+ -- if tableoffset then
+ -- local majorversion = readushort(f)
+ -- local minorversion = readushort(f)
+ -- end
+ end
+
+ -- function readers.ebdt(f,fontdata,specification)
+ -- if specification.glyphs then
+ -- end
+ -- end
+
+ -- function readers.ebsc(f,fontdata,specification)
+ -- if specification.glyphs then
+ -- end
+ -- end
+
+ -- function readers.eblc(f,fontdata,specification)
+ -- if specification.glyphs then
+ -- end
+ -- end
+
+end
+
+-- + AVAR : optional
+-- + CFF2 : otf outlines
+-- - CVAR : ttf hinting, not needed
+-- + FVAR : the variations
+-- + GVAR : ttf outline changes
+-- + HVAR : horizontal changes
+-- + MVAR : metric changes
+-- + STAT : relations within fonts
+-- * VVAR : vertical changes
+--
+-- * BASE : extra baseline adjustments
+-- - GASP : not needed
+-- + GDEF : not needed (carets)
+-- + GPOS : adapted device tables (needed?)
+-- + GSUB : new table
+-- + NAME : 25 added
+
+function readers.stat(f,fontdata,specification)
+ local tableoffset = gotodatatable(f,fontdata,"stat",true) -- specification.variable
+ if tableoffset then
+ local extras = fontdata.extras
+ local version = readulong(f) -- 0x00010000
+ local axissize = readushort(f)
+ local nofaxis = readushort(f)
+ local axisoffset = readulong(f)
+ local nofvalues = readushort(f)
+ local valuesoffset = readulong(f)
+ local fallbackname = extras[readushort(f)] -- beta fonts mess up
+ local axis = { }
+ local values = { }
+ setposition(f,tableoffset+axisoffset)
+ for i=1,nofaxis do
+ local tag = readtag(f)
+ axis[i] = {
+ tag = tag,
+ name = lower(extras[readushort(f)] or tag),
+ ordering = readushort(f), -- maybe gaps
+ variants = { }
+ }
+ end
+ -- flags:
+ --
+ -- 0x0001 : OlderSiblingFontAttribute
+ -- 0x0002 : ElidableAxisValueName
+ -- 0xFFFC : reservedFlags
+ --
+ setposition(f,tableoffset+valuesoffset)
+ for i=1,nofvalues do
+ values[i] = readushort(f)
+ end
+ for i=1,nofvalues do
+ setposition(f,tableoffset + valuesoffset + values[i])
+ local format = readushort(f)
+ local index = readushort(f) + 1
+ local flags = readushort(f)
+ local name = lower(extras[readushort(f)] or "no name")
+ local value = readfixed(f)
+ local variant
+ if format == 1 then
+ variant = {
+ flags = flags,
+ name = name,
+ value = value,
+ }
+ elseif format == 2 then
+ variant = {
+ flags = flags,
+ name = name,
+ value = value,
+ minimum = readfixed(f),
+ maximum = readfixed(f),
+ }
+ elseif format == 3 then
+ variant = {
+ flags = flags,
+ name = name,
+ value = value,
+ link = readfixed(f),
+ }
+ end
+ insert(axis[index].variants,variant)
+ end
+ sort(axis,function(a,b)
+ return a.ordering < b.ordering
+ end)
+ for i=1,#axis do
+ local a = axis[i]
+ sort(a.variants,function(a,b)
+ return a.name < b.name
+ end)
+ a.ordering = nil
+ end
+ setvariabledata(fontdata,"designaxis",axis)
+ setvariabledata(fontdata,"fallbackname",fallbackname)
+ end
+end
+
+-- The avar table is optional and used in combination with fvar. Given the
+-- detailed explanation about bad values we expect the worst and do some
+-- checking.
+
+function readers.avar(f,fontdata,specification)
+ local tableoffset = gotodatatable(f,fontdata,"avar",true) -- specification.variable
+ if tableoffset then
+
+ local function collect()
+ local nofvalues = readushort(f)
+ local values = { }
+ local lastfrom = false
+ local lastto = false
+ for i=1,nofvalues do
+ local from = read2dot14(f)
+ local to = read2dot14(f)
+ if lastfrom and from <= lastfrom then
+ -- ignore
+ elseif lastto and to >= lastto then
+ -- ignore
+ else
+ values[#values+1] = { from, to }
+ lastfrom, lastto = from, to
+ end
+ end
+ nofvalues = #values
+ if nofvalues > 2 then
+ local some = values[1]
+ if some[1] == -1 and some[2] == -1 then
+ some = values[nofvalues]
+ if some[1] == 1 and some[2] == 1 then
+ for i=2,nofvalues-1 do
+ some = values[i]
+ if some[1] == 0 and some[2] == 0 then
+ return values
+ end
+ end
+ end
+ end
+ end
+ return false
+ end
+
+ local version = readulong(f) -- 0x00010000
+ local reserved = readushort(f)
+ local nofaxis = readushort(f)
+ local segments = { }
+ for i=1,nofaxis do
+ segments[i] = collect()
+ end
+ setvariabledata(fontdata,"segments",segments)
+ end
+end
+
+function readers.fvar(f,fontdata,specification)
+ local tableoffset = gotodatatable(f,fontdata,"fvar",true) -- specification.variable or specification.instancenames
+ if tableoffset then
+ local version = readulong(f) -- 0x00010000
+ local offsettoaxis = tableoffset + readushort(f)
+ local reserved = skipshort(f)
+ -- pair 1
+ local nofaxis = readushort(f)
+ local sizeofaxis = readushort(f)
+ -- pair 2
+ local nofinstances = readushort(f)
+ local sizeofinstances = readushort(f)
+ --
+ local extras = fontdata.extras
+ local axis = { }
+ local instances = { }
+ --
+ setposition(f,offsettoaxis)
+ --
+ for i=1,nofaxis do
+ axis[i] = {
+ tag = readtag(f), -- ital opsz slnt wdth wght
+ minimum = readfixed(f),
+ default = readfixed(f),
+ maximum = readfixed(f),
+ flags = readushort(f),
+ name = lower(extras[readushort(f)] or "bad name"),
+ }
+ local n = sizeofaxis - 20
+ if n > 0 then
+ skipbytes(f,n)
+ elseif n < 0 then
+ -- error
+ end
+ end
+ --
+ local nofbytes = 2 + 2 + 2 + nofaxis * 4
+ local readpsname = nofbytes <= sizeofinstances
+ local skippable = sizeofinstances - nofbytes
+ for i=1,nofinstances do
+ local subfamid = readushort(f)
+ local flags = readushort(f) -- 0, not used yet
+ local values = { }
+ for i=1,nofaxis do
+ values[i] = {
+ axis = axis[i].tag,
+ value = readfixed(f),
+ }
+ end
+ local psnameid = readpsname and readushort(f) or 0xFFFF
+ if subfamid == 2 or subfamid == 17 then
+ -- okay
+ elseif subfamid == 0xFFFF then
+ subfamid = nil
+ elseif subfamid <= 256 or subfamid >= 32768 then
+ subfamid = nil -- actually an error
+ end
+ if psnameid == 6 then
+ -- okay
+ elseif psnameid == 0xFFFF then
+ psnameid = nil
+ elseif psnameid <= 256 or psnameid >= 32768 then
+ psnameid = nil -- actually an error
+ end
+ instances[i] = {
+ -- flags = flags,
+ subfamily = extras[subfamid],
+ psname = psnameid and extras[psnameid] or nil,
+ values = values,
+ }
+ if skippable > 0 then
+ skipbytes(f,skippable)
+ end
+ end
+ setvariabledata(fontdata,"axis",axis)
+ setvariabledata(fontdata,"instances",instances)
+ end
+end
+
+local function calculate(f,fontdata,specification,offset,field,regions,deltas,nozero)
+ --
+ -- innerIndexBitCountMask = 0x000F
+ -- mapEntrySizeMask = 0x0030
+ -- reservedFlags = 0xFFC0
+ --
+ -- outerIndex = entry >> ((entryFormat & innerIndexBitCountMask) + 1)
+ -- innerIndex = entry & ((1 << ((entryFormat & innerIndexBitCountMask) + 1)) - 1)
+ --
+ setposition(f,offset)
+ local format = readushort(f) -- todo: check
+ local mapcount = readushort(f)
+ -- local entrysize = rshift(band(format,0x0030),4) + 1
+ local entrysize = (((format & 0x0030) >> 4) & 0xFFFFFFFF) + 1
+ local nofinnerbits = (format & 0x000F) + 1 -- n of inner bits
+ -- local innermask = lshift(1,nofinnerbits) - 1
+ local innermask = (1 << nofinnerbits) - 1
+ local readcardinal = read_cardinal[entrysize] -- 1 upto 4 bytes
+ local innerindex = { } -- size is mapcount
+ local outerindex = { } -- size is mapcount
+ for i=0,mapcount-1 do
+ local mapdata = readcardinal(f)
+ -- outerindex[i] = rshift(mapdata,nofinnerbits)
+ outerindex[i] = (mapdata >> nofinnerbits) & 0xFFFFFFFF
+ innerindex[i] = (mapdata & innermask)
+ end
+ -- use last entry when no match i
+ setvariabledata(fontdata,"hvarwidths",true)
+ local glyphs = fontdata.glyphs
+ for i=0,fontdata.nofglyphs-1 do
+ local glyph = glyphs[i]
+ local outer = outerindex[i] or 0
+ local inner = innerindex[i] or i
+ if outer and inner then -- not needed
+ local delta = deltas[outer+1]
+ if delta then
+ local d = delta.deltas[inner+1]
+ if d then
+ local scales = delta.scales
+ local deltaw = field and glyph[field] or 0
+ for i=1,#scales do
+ local di = d[i]
+ if di then
+ deltaw = deltaw + scales[i] * di
+ else
+ break -- can't happen
+ end
+ end
+ deltaw = round(deltaw)
+ if nozero and deltaw == 0 then
+ -- no need for dlsb zero
+ else
+ glyph[field] = deltaw
+ end
+ end
+ end
+ end
+ end
+end
+
+-- Todo: when it's tested for a while the lsb hackery can be backported from the
+-- font-dsp.lmt file.
+
+function readers.hvar(f,fontdata,specification)
+ local factors = specification.factors
+ if not factors then
+ return
+ end
+ local tableoffset = gotodatatable(f,fontdata,"hvar",specification.variable)
+ if not tableoffset then
+ -- report("no hvar table, expect problems due to messy widths")
+ return
+ end
+ local version = readulong(f) -- 0x00010000
+ local variationoffset = tableoffset + readulong(f) -- the store
+ local advanceoffset = tableoffset + readulong(f)
+ local lsboffset = tableoffset + readulong(f)
+ local rsboffset = tableoffset + readulong(f)
+ if variationoffset > tableoffset then
+ local regions, deltas = readvariationdata(f,variationoffset,factors)
+ if regions then
+ if advanceoffset > tableoffset then
+ calculate(f,fontdata,specification,advanceoffset,"width",regions,deltas,false)
+ end
+ -- I don't want to save the lsb as it is the llx that we already store but as
+ -- we're ahead of reading the bounding box so we cannot set the right lsb here
+ -- so we set the delta (d) instead.
+ if lsboffset > tableoffset then
+ calculate(f,fontdata,specification,lsboffset,"dlsb",regions,deltas,true) -- delta lsb
+ end
+ -- if rsboffset > tableoffset then
+ -- -- we don't use right side bearings
+ -- end
+ -- setvariabledata(fontdata,"hregions",regions)
+ end
+
+ end
+
+end
+
+function readers.vvar(f,fontdata,specification)
+ if not specification.variable then
+ return
+ end
+end
+
+function readers.mvar(f,fontdata,specification)
+ local tableoffset = gotodatatable(f,fontdata,"mvar",specification.variable)
+ if tableoffset then
+ local version = readulong(f) -- 0x00010000
+ local reserved = skipshort(f,1)
+ local recordsize = readushort(f)
+ local nofrecords = readushort(f)
+ local offsettostore = tableoffset + readushort(f)
+ local dimensions = { }
+ local factors = specification.factors
+ if factors then
+ local regions, deltas = readvariationdata(f,offsettostore,factors)
+ for i=1,nofrecords do
+ local tag = readtag(f)
+ local var = variabletags[tag]
+ if var then
+ local outer = readushort(f)
+ local inner = readushort(f)
+ local delta = deltas[outer+1]
+ if delta then
+ local d = delta.deltas[inner+1]
+ if d then
+ local scales = delta.scales
+ local dd = 0
+ for i=1,#scales do
+ dd = dd + scales[i] * d[i]
+ end
+ var(fontdata,round(dd))
+ end
+ end
+ else
+ skipshort(f,2)
+ end
+ if recordsize > 8 then -- 4 + 2 + 2
+ skipbytes(recordsize-8)
+ end
+ end
+ end
+ -- setvariabledata(fontdata,"mregions",regions)
+ end
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-emp.mklx b/Master/texmf-dist/tex/context/base/mkxl/font-emp.mklx
index 1e30e701264..dfb97426cda 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-emp.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-emp.mklx
@@ -38,7 +38,7 @@
%D
%D or even better:
-\let\m_font_emphasized_typeface\empty
+\lettonothing\m_font_emphasized_typeface
\def\font_emphasis_checked_typeface#slanted#italic%
{\edef\m_font_emphasized_typeface{\font_bodyfontvariable\s!em}%
@@ -55,28 +55,45 @@
\permanent\protected\def\emphasistypeface{\font_emphasis_checked_typeface\sl\it}
\permanent\protected\def\emphasisboldface{\font_emphasis_checked_typeface\bs\bi}
-\permanent\protected\def\normalboldface % public
+\permanent\protected\def\normalboldface % public, upgraded from mkvi / WS
{\relax
+ \ifx\fontalternative\s!tf\bf\orelse
\ifx\fontalternative\s!it\bi\orelse
- \ifx\fontalternative\s!sl\bs\else
+ \ifx\fontalternative\s!sl\bs\orelse
+ \ifx\fontalternative\s!bf \orelse
+ \ifx\fontalternative\s!bi \orelse
+ \ifx\fontalternative\s!bs \else
\bf\fi}
-\permanent\protected\def\normalitalicface % public
+\permanent\protected\def\normalitalicface % public, upgraded from mkvi
{\relax
\ifx\fontalternative\s!tf\it\orelse
- \ifx\fontalternative\s!bf\bi\else
- \tf\fi}
-
-\permanent\protected\def\normalslantedface % public
- {\relax \ifx\fontalternative\s!tf\sl
- \orelse\ifx\fontalternative\s!bf\bs
- \else \tf\fi}
-
-\permanent\protected\def\normaltypeface % public
+ \ifx\fontalternative\s!it \orelse
+ \ifx\fontalternative\s!sl\it\orelse
+ \ifx\fontalternative\s!bf\bi\orelse
+ \ifx\fontalternative\s!bi\bi\orelse
+ \ifx\fontalternative\s!bs\bi\else
+ \it\fi}
+
+\permanent\protected\def\normalslantedface % public, upgraded from mkvi
{\relax
- \ifx\fontalternative\s!bi \it \orelse
- \ifx\fontalternative\s!bs \sl \else
- \tf \fi}
+ \ifx\fontalternative\s!tf\sl\orelse
+ \ifx\fontalternative\s!it\sl\orelse
+ \ifx\fontalternative\s!sl \orelse
+ \ifx\fontalternative\s!bf\bs\orelse
+ \ifx\fontalternative\s!bi\bs\orelse
+ \ifx\fontalternative\s!bs\bs\else
+ \sl\fi}
+
+\permanent\protected\def\normaltypeface % public, upgraded from mkvi
+ {\relax
+ \ifx\fontalternative\s!tf \orelse
+ \ifx\fontalternative\s!it\tf\orelse
+ \ifx\fontalternative\s!sl\tf\orelse
+ \ifx\fontalternative\s!bf \orelse
+ \ifx\fontalternative\s!bi\bf\orelse
+ \ifx\fontalternative\s!bs\bf\else
+ \tf\fi}
\permanent\protected\def\swaptypeface % public
{\relax
@@ -93,6 +110,43 @@
\aliased\let\italicface \normalitalicface % public
\aliased\let\swapface \swaptypeface % public
+%D \startbuffer[demo]
+%D \starttabulate[|l|c|c|c|c|c|c|c|]
+%D \NC \NC \tex{tf} \NC \tex{it} \NC \tex{sl} \NC \tex{bf}
+%D \NC \tex{bi} \NC \tex{bs} \NC \tex{sc} \NC \NR
+%D \NC \NC \tf txt \NC \it txt \NC \sl txt \NC \bf txt
+%D \NC \bi txt \NC \bs txt \NC \sc txt \NC \NR
+%D \NC \tex{typeface} \NC \tf \typeface txt \NC \it \typeface txt \NC \sl \typeface txt \NC \bf \typeface txt
+%D \NC \bi \typeface txt \NC \bs \typeface txt \NC \sc \typeface txt \NC \NR
+%D \NC \tex{boldface} \NC \tf \boldface txt \NC \it \boldface txt \NC \sl \boldface txt \NC \bf \boldface txt
+%D \NC \bi \boldface txt \NC \bs \boldface txt \NC \sc \boldface txt \NC \NR
+%D \NC \tex{slantedface} \NC \tf \slantedface txt \NC \it \slantedface txt \NC \sl \slantedface txt \NC \bf \slantedface txt
+%D \NC \bi \slantedface txt \NC \bs \slantedface txt \NC \sc \slantedface txt \NC \NR
+%D \NC \tex{italicface} \NC \tf \italicface txt \NC \it \italicface txt \NC \sl \italicface txt \NC \bf \italicface txt
+%D \NC \bi \italicface txt \NC \bs \italicface txt \NC \sc \italicface txt \NC \NR
+%D \NC \tex{swapface} \NC \tf \swapface txt \NC \it \swapface txt \NC \sl \swapface txt \NC \bf \swapface txt
+%D \NC \bi \swapface txt \NC \bs \swapface txt \NC \sc \swapface txt \NC \NR
+%D \stoptabulate
+%D \stopbuffer
+%D
+%D {\small \typebuffer[demo]}
+%D
+%D This gives:
+%D
+%D \getbuffer[demo]
+%D
+%D But with:
+%D
+%D \startbuffer
+%D \setupbodyfontenvironment [default] [em=blue] % affects \swapface
+%D \stopbuffer
+%D
+%D \typebuffer
+%D
+%D We get:
+%D
+%D {\getbuffer\getbuffer[demo]}
+
%D To be set with the default body font environment: \type {em} being \type
%D {slanted} or \type {italic}.
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-fbk.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-fbk.lmt
index 47d284c845c..bdc5265aeaa 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-fbk.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-fbk.lmt
@@ -17,7 +17,7 @@ local next = next
local trace_visualize = false trackers.register("fonts.composing.visualize", function(v) trace_visualize = v end)
local trace_define = false trackers.register("fonts.composing.define", function(v) trace_define = v end)
-local report = logs.reporter("fonts","combining")
+local report = logs.reporter("fonts","composing")
local allocate = utilities.storage.allocate
@@ -50,6 +50,73 @@ local fraction = 0.15 -- 30 units for lucida
-- todo: we also need to update the feature hashes ... i'll do that when i'm in the mood
-- and/or when i need it
+-- \starttext
+-- \definefontfeature[default][default][fakecombining=yes,compose=yes]
+-- \setupbodyfont[minion]
+-- [x][\char"2D9][x][\char"323] á¹­á¸á¹ƒá¸¥
+-- \stoptext
+
+local missing = {
+ -- [0x323] = { kind = "bottom", top = 0x307 }, -- dot below
+ [0x323] = { kind = "bottom", top = 0x2D9 }, -- dot below
+ --
+ -- TODO
+ --
+}
+
+local function fakecharacters(tfmdata,value)
+ if value then
+ local characters = tfmdata.characters
+ local descriptions = tfmdata.descriptions
+ for unicode, detail in next, missing do
+ local c = characters[k]
+ if not c then
+ local kind = detail.kind
+ if kind == "bottom" then
+ local u = detail.top
+ local d = characters[u]
+ if d then
+ local ex = tfmdata.parameters.xheight
+ characters[unicode] = {
+ width = d.width,
+ height = 0,
+ depth = ex/2,
+ commands = { { "offset", 0, -d.height - ex/5 , u } },
+ unicode = unicode,
+ }
+ -- we need this for the composer
+ local d = descriptions[u]
+ local x = descriptions[0x78]
+ if d and x then
+ local t = table.copy(d)
+ local x = -x.boundingbox[4]/2
+ local b = t.boundingbox
+ b[2] = x
+ b[4] = x
+ descriptions[unicode] = t
+ end
+ if trace then
+ report("deriving %C from %C",unicode,u)
+ end
+ end
+ end
+ end
+ end
+ end
+end
+
+local specification = {
+ name = "fakecombining",
+ description = "add missing combining accents",
+ manipulators = {
+ -- position = 1, -- todo: just before compose
+ base = fakecharacters,
+ node = fakecharacters,
+ }
+}
+
+fonts.handlers.otf.features.register(specification)
+
local function composecharacters(tfmdata)
-- this assumes that slot 1 is self, there will be a proper self some day
local characters = tfmdata.characters
@@ -110,8 +177,10 @@ local function composecharacters(tfmdata)
report("composed %C, base %C, accent %C",i,chr,acc)
end
local acc_t = charcommand[acc]
- local cb = descriptions[chr].boundingbox
- local ab = descriptions[acc].boundingbox
+ local cb = descriptions[chr]
+ local ab = descriptions[acc]
+ local cb = cb and cb.boundingbox
+ local ab = ab and ab.boundingbox
-- todo: adapt height
if cb and ab then
local c_llx = scale*cb[1]
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-fea.mklx b/Master/texmf-dist/tex/context/base/mkxl/font-fea.mklx
index 9f4d2119e99..3e6a4b2eb38 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-fea.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-fea.mklx
@@ -136,12 +136,10 @@
% beware: these are global features on top of existing font features
-\mutable\let\currentfeature\s!current
-
-\let\m_font_feature_list \s!current
-\let\m_font_feature_asked\empty
-
-\newconstant\c_font_feature_state
+\mutable\let \currentfeature \s!current
+\let \m_font_feature_list \s!current
+\lettonothing\m_font_feature_asked
+\newconstant \c_font_feature_state
\newevery\everyfontfeatureswitch
@@ -193,7 +191,7 @@
\the\everyfontfeatureswitch}
\protected\def\font_feature_replace
- {\ifnum\c_font_feature_state=\zerocount
+ {\ifzero\c_font_feature_state
\ifx\m_font_feature_asked\currentfeature\else
\font_feature_replace_indeed
\fi
@@ -214,9 +212,9 @@
\fi}
\protected\def\font_feature_reset_indeed
- {\let\m_font_feature_asked\empty
- \let\currentfeature \s!current
- \let\m_font_feature_list \s!current
+ {\lettonothing\m_font_feature_asked
+ \let\currentfeature\s!current
+ \let\m_font_feature_list\s!current
\clf_resetfeature}
\permanent\protected\def\revivefeature
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-fil.mklx b/Master/texmf-dist/tex/context/base/mkxl/font-fil.mklx
index 57ed47fa287..79535ea112d 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-fil.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-fil.mklx
@@ -44,7 +44,7 @@
\permanent\protected\tolerant\protected\def\startfontclass[#class]%
{\push_macro_fontclass
\doifelse{#class}\v!each
- {\let\fontclass\empty}
+ {\lettonothing\fontclass}
{\doifsomething{#class}{\def\fontclass{#class}}}}
\permanent\protected\def\stopfontclass
@@ -65,8 +65,8 @@
\installcorenamespace {fontfile} % file synonyms
-\let\m_font_name\empty
-\let\m_font_file\empty
+\lettonothing\m_font_name
+\lettonothing\m_font_file
\mutable\def\defaultfontfile{\truefontname{Normal}} % was cmtt10, but that one is gone
@@ -141,7 +141,7 @@
% \def\fntsetdefname {\glet\somefontname\defaultfontfile}
% \def\fntsetsomename{\gdef\somefontname} % takes argument
-% \def\fntsetnopsize {\let\somefontsize\empty}
+% \def\fntsetnopsize {\lettonothing\somefontsize}
% \def\fntsetsomesize{\def\somefontsize} % takes argument
% happens later, else mkvi parsing gets into troubles
@@ -272,8 +272,8 @@
%D model and at that time we still defaulted to no model at all. Nowadays we default
%D to the \type {modern} fontclass.
-\let\fontclass \empty
-\let\defaultfontclass\empty
+\lettonothing\fontclass
+\lettonothing\defaultfontclass
\permanent\def\fontclassname#class#name% tricky ... no lastnamedcs here due to nesting
{\ifcsname\??fontfile#class#name\endcsname
@@ -307,48 +307,48 @@
\ifcsname\??fontfile #name\s!features\endcsname \edef\m_font_features{\lastnamedcs}\orelse % symbolic_name
\ifcsname\??fontfile\fontclass#name\endcsname \expandafter\font_helpers_set_features_yes\lastnamedcs \orelse % class + parent_name
\ifcsname\??fontfile #name\endcsname \expandafter\font_helpers_set_features_yes\lastnamedcs \else % parent_name
- \let\m_font_features\empty\fi}
+ \lettonothing\m_font_features\fi}
\def\font_helpers_set_fallbacks_yes#name%
{\ifcsname\??fontfile\fontclass#name\s!fallbacks\endcsname \edef\m_font_fallbacks{\lastnamedcs}\orelse
\ifcsname\??fontfile #name\s!fallbacks\endcsname \edef\m_font_fallbacks{\lastnamedcs}\orelse
\ifcsname\??fontfile\fontclass#name\endcsname \expandafter\font_helpers_set_fallbacks_yes\lastnamedcs \orelse
\ifcsname\??fontfile #name\endcsname \expandafter\font_helpers_set_fallbacks_yes\lastnamedcs \else
- \let\m_font_fallbacks\empty\fi}
+ \lettonothing\m_font_fallbacks\fi}
\def\font_helpers_set_goodies_yes#name%
{\ifcsname\??fontfile\fontclass#name\s!goodies \endcsname \edef\m_font_goodies{\lastnamedcs}\orelse
\ifcsname\??fontfile #name\s!goodies \endcsname \edef\m_font_goodies{\lastnamedcs}\orelse
\ifcsname\??fontfile\fontclass#name\endcsname \expandafter\font_helpers_set_goodies_yes\lastnamedcs \orelse
\ifcsname\??fontfile #name\endcsname \expandafter\font_helpers_set_goodies_yes\lastnamedcs \else
- \let\m_font_goodies\empty\fi}
+ \lettonothing\m_font_goodies\fi}
\def\font_helpers_set_designsize_yes#name%
{\ifcsname\??fontfile\fontclass#name\s!designsize\endcsname \edef\m_font_designsize{\lastnamedcs}\orelse
\ifcsname\??fontfile #name\s!designsize\endcsname \edef\m_font_designsize{\lastnamedcs}\orelse
\ifcsname\??fontfile\fontclass#name\endcsname \expandafter\font_helpers_set_designsize_yes\lastnamedcs \orelse
\ifcsname\??fontfile #name\endcsname \expandafter\font_helpers_set_designsize_yes\lastnamedcs \else
- \let\m_font_designsize\empty\fi}
+ \lettonothing\m_font_designsize\fi}
\def\font_helpers_set_features_nop#name%
{\ifcsname\??fontfile#name\s!features\endcsname \edef\m_font_features{\lastnamedcs}\orelse
\ifcsname\??fontfile#name\endcsname \expandafter\font_helpers_set_features_nop\lastnamedcs \else
- \let\m_font_features\empty\fi}
+ \lettonothing\m_font_features\fi}
\def\font_helpers_set_fallbacks_nop#name%
{\ifcsname\??fontfile#name\s!fallbacks\endcsname \edef\m_font_fallbacks{\lastnamedcs}\orelse
\ifcsname\??fontfile#name\endcsname \expandafter\font_helpers_set_fallbacks_nop\lastnamedcs \else
- \let\m_font_fallbacks\empty\fi}
+ \lettonothing\m_font_fallbacks\fi}
\def\font_helpers_set_goodies_nop#name%
{\ifcsname\??fontfile#name\s!goodies\endcsname \edef\m_font_goodies{\lastnamedcs}\orelse
\ifcsname\??fontfile#name\endcsname \expandafter\font_helpers_set_goodies_nop\lastnamedcs \else
- \let\m_font_goodies\empty\fi}
+ \lettonothing\m_font_goodies\fi}
\def\font_helpers_set_designsize_nop#name%
{\ifcsname\??fontfile#name\s!designsize\endcsname \edef\m_font_designsize{\lastnamedcs}\orelse
\ifcsname\??fontfile#name\endcsname \expandafter\font_helpers_set_designsize_nop\lastnamedcs \else
- \let\m_font_designsize\empty\fi}
+ \lettonothing\m_font_designsize\fi}
\def\font_helpers_update_font_parameters_yes
{\font_helpers_set_features_yes \somefontname
@@ -379,6 +379,6 @@
% bonus
-% \currentfontinstancespec % define ad the lua end
+% \currentfontinstancespec % defined at the lua end
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-fmp.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-fmp.lmt
index f35c96f49ed..dc70a70e842 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-fmp.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-fmp.lmt
@@ -8,8 +8,13 @@ if not modules then modules = { } end modules ['font-fmp'] = {
-- We only need to pick up the filename and optionally the enc file as we only use
-- them for old school virtual math fonts. We might as well drop this completely.
--- This used to be a backend module but the code is rather generic so we just put it
--- here now.
+-- This used to be a backend module but the code is rather generic so for now we
+-- just put it here.
+--
+-- As Type 1 is kind of obsolete I don't expect usage of those fonts in ways that
+-- are not yet covered. Actually, we don't need map files at all because we read the
+-- afm files. Maybe for math but there at some point we'll ditch the virtual old
+-- school variants because afaik ConTeXt users are not using these any longer.
local find, match, splitlines = string.find, string.match, string.splitlines
@@ -99,7 +104,10 @@ function mappings.loadline(how,line)
end
function mappings.reset()
- lpdf.setmapfile("") -- tricky ... backend related
+ local setmapfile = lpdf and lpdf.setmapfile
+ if setmapfile then
+ setmapfile("") -- tricky ... backend related
+ end
end
mappings.getentry = getentry
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-hsh.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-hsh.lmt
new file mode 100644
index 00000000000..594f4733274
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-hsh.lmt
@@ -0,0 +1,397 @@
+if not modules then modules = { } end modules ['font-hsh'] = {
+ version = 1.001,
+ comment = "companion to font-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local rawget = rawget
+
+local setmetatableindex = table.setmetatableindex
+local currentfont = font and font.current -- used in the web service
+local allocate = utilities.storage.allocate
+
+local fonts = fonts
+local hashes = fonts.hashes or allocate()
+fonts.hashes = hashes
+
+-- todo: autoallocate ... just create on the fly .. use constructors.keys (problem: plurals)
+
+local identifiers = hashes.identifiers or allocate()
+local characters = hashes.characters or allocate() -- chardata
+local descriptions = hashes.descriptions or allocate()
+local parameters = hashes.parameters or allocate()
+local mathparameters = hashes.mathparameters or allocate()
+local properties = hashes.properties or allocate()
+local resources = hashes.resources or allocate()
+local spacings = hashes.spacings or allocate()
+local spaces = hashes.spaces or allocate()
+local quads = hashes.quads or allocate() -- maybe also spacedata
+local xheights = hashes.xheights or allocate()
+local csnames = hashes.csnames or allocate() -- namedata
+local features = hashes.features or allocate()
+local marks = hashes.marks or allocate()
+local classes = hashes.classes or allocate()
+local italics = hashes.italics or allocate()
+local lastmathids = hashes.lastmathids or allocate()
+local dynamics = hashes.dynamics or allocate()
+local unicodes = hashes.unicodes or allocate()
+local unislots = hashes.unislots or allocate()
+local originals = hashes.originals or allocate()
+local modes = hashes.modes or allocate()
+local variants = hashes.variants or allocate()
+
+hashes.characters = characters
+hashes.descriptions = descriptions
+hashes.parameters = parameters
+hashes.mathparameters = mathparameters
+hashes.properties = properties
+hashes.resources = resources
+hashes.spacings = spacings
+hashes.spaces = spaces
+hashes.quads = quads hashes.emwidths = quads
+hashes.xheights = xheights hashes.exheights = xheights
+hashes.csnames = csnames
+hashes.features = features
+hashes.marks = marks
+hashes.classes = classes
+hashes.italics = italics
+hashes.lastmathids = lastmathids
+hashes.dynamics = dynamics
+hashes.unicodes = unicodes
+hashes.unislots = unislots
+hashes.originals = originals
+hashes.modes = modes
+hashes.variants = variants
+
+local nodepool = nodes and nodes.pool
+local dummyglyph = nodepool and nodepool.register(nodepool.glyph())
+
+local nulldata = allocate {
+ name = "nullfont",
+ characters = { },
+ descriptions = { },
+ properties = {
+ designsize = 786432, -- really ? maybe move to 655360 instead
+ },
+ parameters = { -- lmromanregular @ 12pt
+ slantperpoint = 0,
+ spacing = {
+ width = 256377,
+ stretch = 128188,
+ shrink = 85459,
+ extra = 85459,
+ },
+ quad = 786432,
+ size = 786432,
+ slant = 0, -- 1
+ space = 256377, -- 2
+ spacestretch = 128188, -- 3
+ spaceshrink = 85459, -- 4
+ xheight = 338952, -- 5
+ quad = 786432, -- 6
+ extraspace = 85459, -- 7
+ },
+}
+
+fonts.nulldata = nulldata
+
+fonts.constructors.enhanceparameters(nulldata.parameters) -- official copies for us
+
+setmetatableindex(identifiers, function(t,k)
+ return k == true and identifiers[currentfont()] or nulldata
+end)
+
+if font then
+
+ -- to be used
+
+ local define = font.define
+ local setfont = font.setfont
+ local frozen = font.frozen
+
+ function fonts.reserveid(fontdata)
+ return define(fontdata or nulldata)
+ end
+
+ function fonts.enhanceid(id,fontdata)
+ if not frozen(id) then
+ setfont(id,fontdata)
+ end
+ end
+
+end
+
+setmetatableindex(characters, function(t,k)
+ if k == true then
+ return characters[currentfont()]
+ else
+ local characters = identifiers[k].characters
+ t[k] = characters
+ return characters
+ end
+end)
+
+setmetatableindex(descriptions, function(t,k)
+ if k == true then
+ return descriptions[currentfont()]
+ else
+ local descriptions = identifiers[k].descriptions
+ t[k] = descriptions
+ return descriptions
+ end
+end)
+
+setmetatableindex(parameters, function(t,k)
+ if k == true then
+ return parameters[currentfont()]
+ else
+ local parameters = identifiers[k].parameters
+ t[k] = parameters
+ return parameters
+ end
+end)
+
+setmetatableindex(mathparameters, function(t,k)
+ if k == true then
+ return mathparameters[currentfont()]
+ else
+ local mathparameters = identifiers[k].mathparameters
+ t[k] = mathparameters
+ return mathparameters
+ end
+end)
+
+setmetatableindex(properties, function(t,k)
+ if k == true then
+ return properties[currentfont()]
+ else
+ local properties = identifiers[k].properties
+ t[k] = properties
+ return properties
+ end
+end)
+
+setmetatableindex(resources, function(t,k)
+ if k == true then
+ return resources[currentfont()]
+ else
+ local shared = identifiers[k].shared
+ local rawdata = shared and shared.rawdata
+ local resources = rawdata and rawdata.resources
+ t[k] = resources or false -- better than resolving each time
+ return resources
+ end
+end)
+
+setmetatableindex(features, function(t,k)
+ if k == true then
+ return features[currentfont()]
+ else
+ local shared = identifiers[k].shared
+ local features = shared and shared.features or { }
+ t[k] = features
+ return features
+ end
+end)
+
+local nospacing = {
+ width = 0,
+ stretch = 0,
+ shrink = 0,
+ extra = 0,
+}
+
+setmetatableindex(spacings, function(t,k)
+ if k == true then
+ return spacings[currentfont()]
+ else
+ local parameters = parameters[k]
+ local spacing = parameters and parameters.spacing or nospacing
+ t[k] = spacing
+ return spacing
+ end
+end)
+
+setmetatableindex(spaces, function(t,k)
+ if k == true then
+ return spaces[currentfont()]
+ else
+ local space = spacings[k].width
+ t[k] = space
+ return space
+ end
+end)
+
+setmetatableindex(marks, function(t,k)
+ if k == true then
+ return marks[currentfont()]
+ else
+ local resources = identifiers[k].resources or { }
+ local marks = resources.marks or { }
+ t[k] = marks
+ return marks
+ end
+end)
+
+setmetatableindex(classes, function(t,k)
+ if k == true then
+ return classes[currentfont()]
+ else
+ local resources = identifiers[k].resources or { }
+ local classes = resources.classes or { }
+ t[k] = classes
+ return classes
+ end
+end)
+
+setmetatableindex(quads, function(t,k)
+ if k == true then
+ return quads[currentfont()]
+ else
+ local parameters = rawget(parameters,k)
+ local quad
+ if parameters then
+ quad = parameters.quad
+ elseif dummyglyph then
+ dummyglyph.font = k
+ dummyglyph.char = 0x2014 -- emdash
+ quad = dummyglyph.width -- dirty trick
+ end
+ if not quad or quad == 0 then
+ quad = 655360 -- lm 10pt
+ end
+ t[k] = quad
+ return quad
+ end
+end)
+
+setmetatableindex(xheights, function(t,k)
+ if k == true then
+ return xheights[currentfont()]
+ else
+ local parameters = rawget(parameters,k)
+ local xheight
+ if parameters then
+ xheight = parameters.xheight
+ elseif dummyglyph then
+ dummyglyph.font = k
+ dummyglyph.char = 0x78 -- x
+ xheight = dummyglyph.height -- dirty trick
+ end
+ if not xheight or xheight == 0 then
+ xheight = 282460 -- lm 10pt
+ end
+ t[k] = xheight
+ return xheight
+ end
+end)
+
+setmetatableindex(italics, function(t,k) -- is test !
+ if k == true then
+ return italics[currentfont()]
+ else
+ local properties = identifiers[k].properties
+ local hasitalics = properties and properties.hasitalics
+ if hasitalics then
+ hasitalics = characters[k] -- convenient return
+ else
+ hasitalics = false
+ end
+ t[k] = hasitalics
+ return hasitalics
+ end
+end)
+
+setmetatableindex(dynamics, function(t,k)
+ if k == true then
+ return dynamics[currentfont()]
+ else
+ local shared = identifiers[k].shared
+ local dynamics = shared and shared.dynamics or false
+ t[k] = dynamics
+ return dynamics
+ end
+end)
+
+setmetatableindex(unicodes, function(t,k) -- always a unicode
+ if k == true then
+ return unicodes[currentfont()]
+ else
+ local resources = resources[k]
+ local unicodes = resources and resources.unicodes or { }
+ t[k] = unicodes
+ return unicodes
+ end
+end)
+
+setmetatableindex(originals, function(t,k) -- always a unicode
+ if k == true then
+ return originals[currentfont()]
+ else
+ local resolved = { }
+ setmetatableindex(resolved,function(t,name)
+ local u = unicodes[k][name]
+ local d = u and descriptions[k][u]
+ local v = d and d.unicode or u or 0 -- so we return notdef (at least for the moment)
+ t[name] = u
+ return v
+ end)
+ t[k] = resolved
+ return resolved
+ end
+end)
+
+setmetatableindex(unislots, function(t,k)
+ if k == true then
+ return unislots[currentfont()]
+ else
+ local characters = identifiers[k].characters
+ local resolved = setmetatableindex(function(t,k)
+ local c = characters[k]
+ local v = c and c.unicode or 0xFFFD
+ t[k] = v
+ return v -- can be a table !
+ end)
+ t[k] = resolved
+ return resolved
+ end
+end)
+
+setmetatableindex(modes, function(t,k)
+ if k == true then
+ return modes[currentfont()]
+ else
+ local mode = properties[k].mode or "base"
+ t[k] = mode
+ return mode
+ end
+end)
+
+setmetatableindex(variants, function(t,k)
+ if k == true then
+ return variants[currentfont()]
+ else
+ local resources = resources[k]
+ if resources then
+ local variants = resources.variants
+ if variants and next(variants) then
+ t[k] = variants
+ return variants
+ end
+ end
+ t[k] = false
+ return false
+ end
+end)
+
+if font then
+
+ function font.getfont(id)
+ return identifiers[id]
+ end
+
+end
+
+-- font.setfont = currentfont -- bah, no native 'setfont' as name
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-imp-braille.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-imp-braille.lmt
new file mode 100644
index 00000000000..79bb99f7c6a
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-imp-braille.lmt
@@ -0,0 +1,135 @@
+if not modules then modules = { } end modules ['font-imp-braille'] = {
+ version = 1.001,
+ comment = "companion to font-ini.mkiv",
+ author = "Hans Hagen, PRAGMA ADE",
+ copyright = "ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+if not context then return end
+
+-- require("char-brl.lmt") -- we delay this one
+
+-- we can omit spaces and tweak the math parameters instead
+
+-- callback.register("math_rule", function(kind,font,width,height,attr)
+-- return nodes.tonode(nodes.nuts.pool.rule(width,5*height,5*height))
+-- end)
+
+local braille = characters.braille -- so this one is nil
+
+local braille_math_rule do
+
+ local nuts = nodes.nuts
+ local tonut = nodes.tonut
+ local tonode = nodes.tonode
+ local nodepool = nuts.pool
+ local setattrlist = nuts.setattrlist
+ local hpack = nuts.hpack
+ -- local getwhd = nuts.getwhd
+ -- local setwhd = nuts.setwhd
+ -- local setoffsets = nuts.setoffsets
+ local newmathglyph = nuts.newmathglyph
+ local newleader = nodepool.leader
+
+ local braillerule
+
+ -- function(kind,font,width,height,attr)
+ -- return nodes.tonode(nodes.nuts.pool.rule(width,5*height,5*height))
+ -- end
+
+ braille_math_rule = function(kind,font,width,height,attr)
+ if not braillerule then
+ braillerule = braille.special("rule")
+ end
+ local attlst = tonut(attr)
+ local glyph = newmathglyph(font,braillerule,attlst)
+ local box = hpack(glyph)
+ --
+ -- local w, h, d = getwhd(box)
+ -- local t = (h + d) / 2
+ -- setwhd(box,w,t,t)
+ -- setoffsets(glyph,0,-t) -- setting the offset of the box messes up (visual) things
+ --
+ local leader = newleader(width,box)
+ local result = hpack(leader,width,"exactly")
+ setattrlist(leader,attlst)
+ return tonode(result)
+ end
+
+end
+
+local setmetatableindex = table.setmetatableindex
+
+local cache = table.setmetatableindex(function(t,w)
+ local v = table.setmetatableindex(function(t,u)
+ local v = { "offset", w, 0, u }
+ t[u] = v
+ return v
+ end)
+ t[w] = v
+ return v
+end)
+
+local function initialize(tfmdata,value)
+ if value then
+ if not braille then
+ require("char-brl.lmt")
+ braille = characters.braille
+ end
+ callback.register("math_rule", braille_math_rule)
+ local characters = tfmdata.characters
+ local numberdata = characters[braille.special("number")]
+ if numberdata then
+ local ismath = value ~= "text" and (value == "math" or tfmdata.mathparameters)
+ local list = ismath and braille.mathlist() or braille.textlist()
+ local unicode = ismath and braille.mathunicode or braille.textunicode
+ local width = numberdata.width
+ local height = numberdata.height
+ local depth = numberdata.depth
+ for i=1,#list do
+ local u = list[i]
+ local t = unicode(u)
+ local d = characters[u]
+ local w = 0
+ local c = { }
+ local n = #t
+ for i=1,n do
+ local ub = t[i]
+ local db = characters[ub]
+ if db then
+ c[i] = cache[w][ub]
+ w = w + width
+ end
+ end
+ if d then
+ d.width = n * width
+ d.height = height
+ d.depth = depth
+ d.commands = c
+ d.smaller = nil
+ else
+ characters[u] = {
+ width = n * width,
+ height = height,
+ depth = depth,
+ commands = c,
+ unicode = u,
+ }
+ end
+ end
+ characters[0xAD] = characters[45]
+ end
+ end
+end
+
+local specification = {
+ name = "braille",
+ description = "braille",
+ manipulators = {
+ base = initialize,
+ node = initialize,
+ }
+}
+
+fonts.handlers.otf.features.register(specification)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-imp-checks.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-imp-checks.lmt
new file mode 100644
index 00000000000..120f89c492e
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-imp-checks.lmt
@@ -0,0 +1,40 @@
+if not modules then modules = { } end modules ['font-imp-checks'] = {
+ version = 1.001,
+ comment = "companion to font-ini.mkiv",
+ author = "Hans Hagen, PRAGMA ADE",
+ copyright = "ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+if not context then return end
+
+local function initialize(tfmdata,value)
+ if value then
+ local characters = tfmdata.characters
+ if not characters[0x2012] then
+ local data = characters[0x2013]
+ local zero = characters[0x0030]
+ if data and zero then
+ local copy = table.copy(data)
+ local width = zero.width or 0
+ if width > 0 then
+ characters[0x2012] = copy
+ copy.effect = {
+ extend = width/copy.width
+ }
+ copy.width = width
+ end
+ end
+ end
+ end
+end
+
+fonts.handlers.otf.features.register {
+ name = "checkmissing",
+ description = "checkmissing",
+ manipulators = {
+ base = initialize,
+ node = initialize,
+ }
+}
+
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-imp-digits.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-imp-digits.lmt
new file mode 100644
index 00000000000..b350b774552
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-imp-digits.lmt
@@ -0,0 +1,62 @@
+if not modules then modules = { } end modules ['font-imp-digits'] = {
+ version = 1.001,
+ comment = "companion to font-ini.mkiv",
+ author = "Hans Hagen, PRAGMA ADE",
+ copyright = "ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+if not context then return end
+
+local equaldigits = { }
+
+-- for i=48,57 do
+-- equaldigits[i] = fonts.helpers.newprivateslot(tonumber(i)..".equaldigits")
+-- end
+
+local function initialize(tfmdata,value)
+ if value then
+ local characters = tfmdata.characters
+ local wd, ht, dp = 0, 0, 0
+ for i=48,57 do
+ if not equaldigits[i] then
+ equaldigits[i] = fonts.helpers.newprivateslot(tonumber(i)..".equaldigits")
+ end
+ local c = characters[i]
+ local w = c.width or 0
+ local h = c.height or 0
+ local d = c.depth or 0
+ if w > wd then wd = w end
+ if h > ht then ht = h end
+ if d > dp then dp = d end
+ end
+ for i=48,57 do
+ -- fonts.helpers.addprivate(tfmdata,tonumber(i)..".equaldigits")
+ local u = equaldigits[i]
+ local c = characters[i]
+ characters[u] = table.setmetatableindex( {
+ height = ht,
+ depth = dp,
+ width = wd,
+ xoffset = (wd - (c.width or 0)) / 2,
+ }, c)
+ end
+ end
+end
+
+fonts.handlers.otf.features.register {
+ name = "equaldigits",
+ description = "equaldigits",
+ manipulators = {
+ base = initialize,
+ node = initialize,
+ }
+}
+
+fonts.handlers.otf.addfeature {
+ -- name = "tnum", -- let's not waste that one
+ name = "tabledigits",
+ type = "substitution",
+ nocheck = true,
+ data = equaldigits,
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-imp-effects.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-imp-effects.lmt
new file mode 100644
index 00000000000..f366bc89ed8
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-imp-effects.lmt
@@ -0,0 +1,348 @@
+if not modules then modules = { } end modules ['font-imp-effects'] = {
+ version = 1.001,
+ comment = "companion to font-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- todo: pickup from goodies: if type(effect) then ...
+
+local next, type, tonumber = next, type, tonumber
+local is_boolean = string.is_boolean
+
+local fonts = fonts
+
+local handlers = fonts.handlers
+local registerotffeature = handlers.otf.features.register
+local registerafmfeature = handlers.afm.features.register
+
+local settings_to_hash = utilities.parsers.settings_to_hash_colon_too
+
+local report_effect = logs.reporter("fonts","effect")
+local report_slant = logs.reporter("fonts","slant")
+local report_extend = logs.reporter("fonts","extend")
+local report_squeeze = logs.reporter("fonts","squeeze")
+
+local trace = false
+
+trackers.register("fonts.effect", function(v) trace = v end)
+trackers.register("fonts.slant", function(v) trace = v end)
+trackers.register("fonts.extend", function(v) trace = v end)
+trackers.register("fonts.squeeze",function(v) trace = v end)
+
+local function initializeslant(tfmdata,value)
+ value = tonumber(value)
+ if not value then
+ value = 0
+ elseif value > 1 then
+ value = 1
+ elseif value < -1 then
+ value = -1
+ end
+ if trace then
+ report_slant("applying %0.3f",value)
+ end
+ tfmdata.parameters.slantfactor = value
+end
+
+local specification = {
+ name = "slant",
+ description = "slant glyphs",
+ initializers = {
+ base = initializeslant,
+ node = initializeslant,
+ }
+}
+
+registerotffeature(specification)
+registerafmfeature(specification)
+
+local function initializeextend(tfmdata,value)
+ value = tonumber(value)
+ if not value then
+ value = 0
+ elseif value > 10 then
+ value = 10
+ elseif value < -10 then
+ value = -10
+ end
+ if trace then
+ report_extend("applying %0.3f",value)
+ end
+ tfmdata.parameters.extendfactor = value
+end
+
+local specification = {
+ name = "extend",
+ description = "scale glyphs horizontally",
+ initializers = {
+ base = initializeextend,
+ node = initializeextend,
+ }
+}
+
+registerotffeature(specification)
+registerafmfeature(specification)
+
+local function initializesqueeze(tfmdata,value)
+ value = tonumber(value)
+ if not value then
+ value = 0
+ elseif value > 10 then
+ value = 10
+ elseif value < -10 then
+ value = -10
+ end
+ if trace then
+ report_squeeze("applying %0.3f",value)
+ end
+ tfmdata.parameters.squeezefactor = value
+end
+
+local specification = {
+ name = "squeeze",
+ description = "scale glyphs vertically",
+ initializers = {
+ base = initializesqueeze,
+ node = initializesqueeze,
+ }
+}
+
+registerotffeature(specification)
+registerafmfeature(specification)
+
+local effects = {
+ inner = 0,
+ normal = 0,
+ outer = 1,
+ outline = 1,
+ both = 2,
+ hidden = 3,
+}
+
+local rules = {
+ "RadicalRuleThickness",
+ "OverbarRuleThickness",
+ "FractionRuleThickness",
+ "UnderbarRuleThickness",
+}
+
+-- radicals are not yet ok
+
+local function setmathparameters(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier)
+ -- hm, this was "if delta ~= 0 then" but delta was gone
+ if dy ~= 0 then
+ for i=1,#rules do
+ local name = rules[i]
+ local value = mathparameters[name]
+ if value then
+ mathparameters[name] = (squeeze or 1) * (value + dy)
+ end
+ end
+ end
+end
+
+local function initializeeffect(tfmdata,value)
+ local spec
+ if type(value) == "number" then
+ spec = { width = value }
+ else
+ spec = settings_to_hash(value)
+ end
+ local effect = spec.effect or "both"
+ local width = tonumber(spec.width) or 0
+ local mode = effects[effect]
+ if not mode then
+ report_effect("invalid effect %a",effect)
+ elseif width == 0 and mode == 0 then
+ report_effect("invalid width %a for effect %a",width,effect)
+ else
+ local parameters = tfmdata.parameters
+ local properties = tfmdata.properties
+ parameters.mode = mode
+ parameters.width = width * 1000
+ if is_boolean(spec.auto) == true then
+ local squeeze = 1 - width/20
+ local average = (1 - squeeze) * width * 100
+ spec.squeeze = squeeze
+ spec.extend = 1 + width/2
+ spec.wdelta = average
+ spec.hdelta = average/2
+ spec.ddelta = average/2
+ spec.vshift = average/2
+ end
+ local factor = tonumber(spec.factor) or 0
+ local hfactor = tonumber(spec.hfactor) or factor
+ local vfactor = tonumber(spec.vfactor) or factor
+ local delta = tonumber(spec.delta) or 1
+ local wdelta = tonumber(spec.wdelta) or delta
+ local hdelta = tonumber(spec.hdelta) or delta
+ local ddelta = tonumber(spec.ddelta) or hdelta
+ local vshift = tonumber(spec.vshift) or 0
+ local slant = spec.slant
+ local extend = spec.extend
+ local squeeze = spec.squeeze
+ if slant then
+ initializeslant(tfmdata,slant)
+ end
+ if extend then
+ initializeextend(tfmdata,extend)
+ end
+ if squeeze then
+ initializesqueeze(tfmdata,squeeze)
+ end
+ effect = {
+ effect = effect,
+ width = width,
+ factor = factor,
+ hfactor = hfactor,
+ vfactor = vfactor,
+ wdelta = wdelta,
+ hdelta = hdelta,
+ ddelta = ddelta,
+ vshift = vshift,
+ slant = tfmdata.parameters.slantfactor,
+ extend = tfmdata.parameters.extendfactor,
+ squeeze = tfmdata.parameters.squeezefactor,
+ }
+ properties.effect = effect
+ end
+end
+
+-- local show_effect = { "lua", function(f,c)
+-- report_effect("font id %i, char %C",f,c)
+-- inspect(fonts.hashes.characters[f][c])
+-- end }
+
+local function manipulateeffect(tfmdata)
+ local effect = tfmdata.properties.effect
+ if effect then
+ local characters = tfmdata.characters
+ local parameters = tfmdata.parameters
+ local mathparameters = tfmdata.mathparameters
+ local multiplier = effect.width * 100
+ local factor = parameters.factor
+ local hfactor = parameters.hfactor
+ local vfactor = parameters.vfactor
+ local wdelta = effect.wdelta * hfactor * multiplier
+ local hdelta = effect.hdelta * vfactor * multiplier
+ local ddelta = effect.ddelta * vfactor * multiplier
+ local vshift = effect.vshift * vfactor * multiplier
+ local squeeze = effect.squeeze
+ local hshift = wdelta / 2
+ local dx = multiplier * vfactor
+ local dy = vshift
+ local factor = (1 + effect.factor) * factor
+ local hfactor = (1 + effect.hfactor) * hfactor
+ local vfactor = (1 + effect.vfactor) * vfactor
+ parameters.hshift = hshift
+ parameters.vshift = vshift
+ --
+ -- For now we assume that the properties of parts wrt advance and such still
+ -- apply and that the extensible piece kicks in if needed. Beware of creating
+ -- virtual extensibles because these could get squeeze twice.
+ --
+ -- local allparts = { }
+ -- for unicode, character in next, characters do
+ -- local parts = character.parts
+ -- if parts then
+ -- for i=1,#parts do
+ -- allparts[parts[i].glyph] = true
+ -- end
+ -- end
+ -- end
+ --
+ for unicode, character in next, characters do
+ local oldwidth = character.width
+ local oldheight = character.height
+ local olddepth = character.depth
+ local olditalic = character.italic
+ local oldtopanchor = character.topanchor
+ local oldbottomanchor = character.bottomanchor
+ if oldwidth and oldwidth > 0 then
+ character.width = oldwidth + wdelta
+ end
+ if oldheight and oldheight > 0 then
+ character.height = oldheight + hdelta
+ end
+ if olddepth and olddepth > 0 then
+ character.depth = olddepth + ddelta
+ end
+ if olditalic or oldtopaccent or oldbottomaccent then
+ local factor = character.width / oldwidth
+ if olditalic and olditalic > 0 then
+ character.italic = olditalic * factor
+ end
+ if oldtopanchor and oldtopanchor > 0 then
+ character.topanchor = oldtopanchor * factor
+ end
+ if oldbottomanchor and oldbottomanchor > 0 then
+ character.bottomanchor = oldbottomanchor * factor
+ end
+ end
+ end
+ if mathparameters then
+ setmathparameters(tfmdata,characters,mathparameters,dx,dy,squeeze,multiplier)
+ end
+ parameters.factor = factor
+ parameters.hfactor = hfactor
+ parameters.vfactor = vfactor
+ if trace then
+ report_effect("applying")
+ report_effect(" effect : %s", effect.effect)
+ report_effect(" width : %s => %s", effect.width, multiplier)
+ report_effect(" factor : %s => %s", effect.factor, factor )
+ report_effect(" hfactor : %s => %s", effect.hfactor,hfactor)
+ report_effect(" vfactor : %s => %s", effect.vfactor,vfactor)
+ report_effect(" wdelta : %s => %s", effect.wdelta, wdelta)
+ report_effect(" hdelta : %s => %s", effect.hdelta, hdelta)
+ report_effect(" ddelta : %s => %s", effect.ddelta, ddelta)
+ end
+ end
+end
+
+local specification = {
+ name = "effect",
+ description = "apply effects to glyphs",
+ initializers = {
+ base = initializeeffect,
+ node = initializeeffect,
+ },
+ manipulators = {
+ base = manipulateeffect,
+ node = manipulateeffect,
+ },
+}
+
+registerotffeature(specification)
+registerafmfeature(specification)
+
+local function initializeoutline(tfmdata,value)
+ value = tonumber(value)
+ if not value then
+ value = 0
+ else
+ value = tonumber(value) or 0
+ end
+ local parameters = tfmdata.parameters
+ local properties = tfmdata.properties
+ parameters.mode = effects.outline
+ parameters.width = value * 1000
+ properties.effect = {
+ effect = effect,
+ width = width,
+ }
+end
+
+local specification = {
+ name = "outline",
+ description = "outline glyphs",
+ initializers = {
+ base = initializeoutline,
+ node = initializeoutline,
+ }
+}
+
+registerotffeature(specification)
+registerafmfeature(specification)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-imp-ligatures.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-imp-ligatures.lmt
new file mode 100644
index 00000000000..da5282428e8
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-imp-ligatures.lmt
@@ -0,0 +1,158 @@
+if not modules then modules = { } end modules ['font-imp-ligatures'] = {
+ version = 1.001,
+ comment = "companion to font-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- Not perfect (disc) but we have allternatives.
+
+local lpegmatch = lpeg.match
+local utfsplit = utf.split
+local settings_to_array = utilities.parsers.settings_to_array
+
+local fonts = fonts
+local otf = fonts.handlers.otf
+local registerotffeature = otf.features.register
+local addotffeature = otf.addfeature
+
+-- This is a quick and dirty hack.
+
+local lookups = { }
+local protect = { }
+local revert = { }
+local zwjchar = 0x200C
+local zwj = { zwjchar }
+
+addotffeature {
+ name = "blockligatures",
+ type = "chainsubstitution",
+ nocheck = true, -- because there is no 0x200C in the font
+ prepend = true, -- make sure we do it early
+ future = true, -- avoid nilling due to no steps yet
+ lookups = {
+ {
+ type = "multiple",
+ data = lookups,
+ },
+ },
+ data = {
+ rules = protect,
+ }
+}
+
+addotffeature {
+ name = "blockligatures",
+ type = "chainsubstitution",
+ nocheck = true, -- because there is no 0x200C in the font
+ append = true, -- this is done late
+ overload = false, -- we don't want to overload the previous definition
+ lookups = {
+ {
+ type = "ligature",
+ data = lookups,
+ },
+ },
+ data = {
+ rules = revert,
+ }
+}
+
+registerotffeature {
+ name = 'blockligatures',
+ description = 'block certain ligatures',
+}
+
+-- local splitter = lpeg.splitat(":")
+--
+-- local function blockligatures(str)
+-- local t = settings_to_array(str)
+-- for i=1,#t do
+-- local ti = t[i]
+-- local before, current, after = lpegmatch(splitter,ti)
+-- if current and after then -- before is returned when no match
+-- -- experimental joke
+-- if before then
+-- before = utfsplit(before)
+-- for i=1,#before do
+-- before[i] = { before[i] }
+-- end
+-- end
+-- if current then
+-- current = utfsplit(current)
+-- end
+-- if after then
+-- after = utfsplit(after)
+-- for i=1,#after do
+-- after[i] = { after[i] }
+-- end
+-- end
+-- else
+-- before = nil
+-- current = utfsplit(ti)
+-- after = nil
+-- end
+-- if #current > 1 then
+-- local one = current[1]
+-- local two = current[2]
+-- lookups[one] = { one, zwjchar }
+-- local one = { one }
+-- local two = { two }
+-- local new = #protect + 1
+-- protect[new] = {
+-- before = before,
+-- current = { one, two },
+-- after = after,
+-- lookups = { 1, false }, -- not shared !
+-- }
+-- revert[new] = {
+-- current = { one, zwj },
+-- after = { two },
+-- lookups = { 1, false }, -- not shared !
+-- }
+-- end
+-- end
+-- end
+
+local function blockligatures(str)
+ local t = settings_to_array(str)
+ for i=1,#t do
+ local ti = t[i]
+ local current = utfsplit(ti)
+ if #current > 1 then
+ local one = current[1]
+ local two = current[2]
+ lookups[one] = { one, zwjchar }
+ local one = { one }
+ local two = { two }
+ local new = #protect + 1
+ protect[new] = {
+ current = { one, two },
+ lookups = { 1, false }, -- not shared !
+ }
+ revert[new] = {
+ current = { one, zwj },
+ after = { two },
+ lookups = { 1, false }, -- not shared !
+ }
+ end
+ end
+end
+
+-- blockligatures("\0\0")
+
+otf.helpers.blockligatures = blockligatures
+
+-- blockligatures("fi,ff")
+-- blockligatures("fl")
+
+if context then
+
+ interfaces.implement {
+ name = "blockligatures",
+ arguments = "string",
+ actions = blockligatures,
+ }
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-imp-math.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-imp-math.lmt
index 277190f2410..bd445caeaa2 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-imp-math.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-imp-math.lmt
@@ -13,60 +13,62 @@ local helpers = fonts.helpers
local registerotffeature = fonts.handlers.otf.features.register
local setmetatableindex = table.setmetatableindex
+local sortedhash = table.sortedhash
+local copytable = table.copy
local texconditionals = tex.conditionals
-- tfmdata.properties.mathnolimitsmode = tonumber(value) or 0
-local splitter = lpeg.splitat(",",tonumber)
-local lpegmatch = lpeg.match
-
-local function initialize(tfmdata,value)
- local mathparameters = tfmdata.mathparameters
- if mathparameters then
- local sup, sub
- if type(value) == "string" then
- sup, sub = lpegmatch(splitter,value)
- if not sup then
- sub, sup = 0, 0
- elseif not sub then
- sub, sup = sup, 0
- end
- elseif type(value) == "number" then
- sup, sub = 0, value
- end
- if sup then
- mathparameters.NoLimitSupFactor = sup
- end
- if sub then
- mathparameters.NoLimitSubFactor = sub
- end
- end
-end
-
-registerotffeature {
- name = "mathnolimitsmode",
- description = "influence nolimits placement",
- initializers = {
- base = initialize,
- node = initialize,
- }
-}
-
--- this will become a mode in the engine
-
-local function initialize(tfmdata,value)
- tfmdata.properties.nostackmath = value and true
-end
+-- local splitter = lpeg.splitat(",",tonumber)
+-- local lpegmatch = lpeg.match
+--
+-- local function initialize(tfmdata,value)
+-- local mathparameters = tfmdata.mathparameters
+-- if mathparameters then
+-- local sup, sub
+-- if type(value) == "string" then
+-- sup, sub = lpegmatch(splitter,value) -- settings_to_array
+-- if not sup then
+-- sub, sup = 0, 0
+-- elseif not sub then
+-- sub, sup = sup, 0
+-- end
+-- elseif type(value) == "number" then
+-- sup, sub = 0, value
+-- end
+-- if sup then
+-- mathparameters.NoLimitSupFactor = sup
+-- end
+-- if sub then
+-- mathparameters.NoLimitSubFactor = sub
+-- end
+-- end
+-- end
+--
+-- registerotffeature {
+-- name = "mathnolimitsmode",
+-- description = "influence nolimits placement",
+-- initializers = {
+-- base = initialize,
+-- node = initialize,
+-- }
+-- }
-registerotffeature {
- name = "nostackmath",
- description = "disable math stacking mechanism",
- initializers = {
- base = initialize,
- node = initialize,
- }
-}
+-- this will become a mode in the engine -- done
+--
+-- local function initialize(tfmdata,value)
+-- tfmdata.properties.nostackmath = value and true
+-- end
+--
+-- registerotffeature {
+-- name = "nostackmath",
+-- description = "disable math stacking mechanism",
+-- initializers = {
+-- base = initialize,
+-- node = initialize,
+-- }
+-- }
-- A quick and dirty and low level implementation but okay for testing:
@@ -89,6 +91,7 @@ function fonts.helpers.mathscriptslots(tfmdata,textcode)
if coverage then
local okay = coverage[textcode]
if okay then
+ -- can be single or table
return okay
end
end
@@ -99,14 +102,14 @@ function fonts.helpers.mathscriptslots(tfmdata,textcode)
end
end
-local function manipulate(tfmdata,key,value)
- if texconditionals["c_font_compact"] then
+local function manipulate(tfmdata,value)
+ -- if texconditionals["c_font_compact"] then
+ if value then -- so basically always
local rawdata = tfmdata.shared.rawdata
local rawresources = rawdata and rawdata.resources
local rawfeatures = rawresources and rawresources.features
local basesubstitutions = rawfeatures and rawfeatures.gsub
local sequences = basesubstitutions and tfmdata.resources.sequences
-
if sequences then
local characters = tfmdata.characters
for s=1,#sequences do
@@ -120,15 +123,26 @@ local function manipulate(tfmdata,key,value)
for textcode, v in next, coverage do
local textdata = characters[textcode]
if textdata then
- local scriptcode = v[1]
- local scriptscriptcode = v[2]
- local scriptdata = characters[scriptcode]
- local scriptscriptdata = characters[scriptscriptcode]
- if scriptdata then
- textdata.smaller = scriptcode
+ local scriptcode, scriptscriptcode
+ local sstykind = type(v)
+ if sstykind == "table" then
+ scriptcode = v[1]
+ scriptscriptcode = v[2]
+ elseif sstykind == "number" then
+ scriptcode = v
+ scriptscriptcode = v
+ else
+ -- weird
end
- if scriptscriptdata then
- scriptdata.smaller = scriptscriptcode
+ if scriptcode then
+ local scriptdata = characters[scriptcode]
+ local scriptscriptdata = characters[scriptscriptcode]
+ if scriptdata and scriptdata ~= textdata then
+ textdata.smaller = scriptcode
+ if scriptscriptdata and scriptdata ~= scriptscriptdata then
+ scriptdata.smaller = scriptscriptcode
+ end
+ end
end
end
end
@@ -140,35 +154,45 @@ local function manipulate(tfmdata,key,value)
end
end
-local function initialize(tfmdata,key,value)
+local function initialize(tfmdata,value)
+ -- Here it really gets enabled as the scales are used.
if texconditionals["c_font_compact"] then
local rawdata = tfmdata.shared.rawdata
local rawresources = rawdata and rawdata.resources
local mathconstants = rawresources.mathconstants
if mathconstants then
local parameters = tfmdata.parameters
+ local properties = tfmdata.properties
parameters.textscale = 1000
parameters.scriptscale = mathconstants.ScriptPercentScaleDown * 10
parameters.scriptscriptscale = mathconstants.ScriptScriptPercentScaleDown * 10
+ properties.compactmath = true
end
end
end
-local specification = {
+-- local specification = {
+-- name = "compactmath",
+-- description = "use one math font",
+-- manipulators = {
+-- base = manipulate,
+-- node = manipulate,
+-- },
+-- initializers = {
+-- base = initialize,
+-- node = initialize,
+-- }
+-- }
+
+registerotffeature {
name = "compactmath",
description = "use one math font",
- manipulators = {
- base = manipulate,
- node = manipulate,
- },
initializers = {
- base = initialize,
- node = initialize,
+ base = function(...) manipulate(...) initialize(...) end,
+ node = function(...) manipulate(...) initialize(...) end,
}
}
-registerotffeature(specification)
-
-- The problem is that the traditional code path doesn't add an italic to the subscript,
-- simply because it assumes that the width has that already subtracted. So, we cannot
-- compensate in the following way. We're stuck with the fact that the texgyre fonts
@@ -199,28 +223,115 @@ registerotffeature(specification)
-- end
-- end
-local function initialize(tfmdata,key,value)
- if value then
+local function initialize(tfmdata,value)
+ if type(value) == "string" then
local rawdata = tfmdata.shared.rawdata
local rawresources = rawdata and rawdata.resources
local mathconstants = rawresources.mathconstants
if mathconstants then
- tfmdata.properties.oldmath = true
+ local bitmap = tex.stringtocodesbitmap(value,tex.mathcontrolcodes)
+ -- logs.report("mathfont","setting math control to %08X",bitmap)
+ tfmdata.properties.mathcontrol = bitmap
+ end
+ end
+end
+
+registerotffeature {
+ name = "mathcontrol",
+ description = "control specific old/new math handling",
+ initializers = {
+ base = initialize,
+ node = initialize,
+ }
+}
+
+local function initialize(tfmdata,value)
+ if value then
+ local validlookups, lookuplist = fonts.handlers.otf.collectlookups(tfmdata.shared.rawdata,"flac","math","dflt")
+ if validlookups then
+ -- it's quite likely just one step
+ local characters = tfmdata.characters
+ local changed = tfmdata.changed
+ for i=1,#lookuplist do
+ local lookup = lookuplist[i]
+ local steps = lookup.steps
+ local nofsteps = lookup.nofsteps
+ for i=1,nofsteps do
+ local coverage = steps[i].coverage
+ if coverage then
+ for k, v in next, coverage do
+ local c = characters[k]
+ local f = characters[v]
+ if c and f then
+ c.flataccent = v
+ if not f.unicode then
+ f.unicode = c.unicode
+ end
+ end
+ end
+ end
+ end
+ end
end
end
end
-local specification = {
- name = "oldmath",
- description = "deal with fake opentype fonts",
- -- manipulators = {
- -- base = manipulate,
- -- node = manipulate,
- -- },
+registerotffeature {
+ name = "flattenaccents",
+ description = "mapping accents to flat ones",
initializers = {
base = initialize,
node = initialize,
}
}
-registerotffeature(specification)
+-- todo: document our privates
+
+-- This horrible hack is needed because when opentype math showed up and math was
+-- added to unicode folks had forgotten about different script shapes so we not only
+-- have a retrospective variant selector but inconsistent defaults. What a mess it
+-- is. So the quick and dirty solution is:
+--
+-- add copies in private slots
+-- use a pseudo feature to access those
+-- and optionally afterwards replace the original slots
+
+-- local coverage = { }
+--
+-- local function initialize(tfmdata,value)
+-- if value then
+-- if not next(coverage) then
+-- for k, char in next, mathematics.alphabets.sr.tf.lcletters do
+-- coverage[char] = 0xFE800 + k
+-- end
+-- for k, char in next, mathematics.alphabets.sr.tf.ucletters do
+-- coverage[char] = 0xFE800 + k
+-- end
+-- fonts.handlers.otf.addfeature {
+-- name = "savemathscripts",
+-- type = "substitution",
+-- data = coverage,
+-- }
+-- end
+-- local characters = tfmdata.characters
+-- local descriptions = tfmdata.descriptions
+-- for char, private in next, coverage do
+-- local data = characters[char]
+-- if data and not characters[private] then
+-- -- otherwise we need a virtual
+-- characters [private] = copytable(data)
+-- descriptions[private] = copytable(descriptions[char])
+-- end
+-- end
+-- end
+-- end
+--
+-- registerotffeature {
+-- name = "copymathscripts",
+-- description = "copy math script",
+-- prepend = 1,
+-- initializers = {
+-- base = initialize,
+-- node = initialize,
+-- }
+-- }
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-imp-quality.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-imp-quality.lmt
new file mode 100644
index 00000000000..6637fa07f8f
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-imp-quality.lmt
@@ -0,0 +1,676 @@
+if not modules then modules = { } end modules ['font-imp-quality'] = {
+ version = 1.001,
+ comment = "companion to font-ini.mkiv and hand-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+if not context then return end
+
+local next, type, tonumber = next, type, tonumber
+
+local fonts = fonts
+local utilities = utilities
+
+local handlers = fonts.handlers
+local otf = handlers.otf
+local afm = handlers.afm
+local registerotffeature = otf.features.register
+local registerafmfeature = afm.features.register
+
+local allocate = utilities.storage.allocate
+local getparameters = utilities.parsers.getparameters
+
+local implement = interfaces and interfaces.implement
+
+local trace_protrusion = false trackers.register("fonts.protrusion", function(v) trace_protrusion = v end)
+local trace_expansion = false trackers.register("fonts.expansion", function(v) trace_expansion = v end)
+
+local report_expansions = logs.reporter("fonts","expansions")
+local report_protrusions = logs.reporter("fonts","protrusions")
+
+-- -- -- -- -- --
+-- shared
+-- -- -- -- -- --
+
+local function get_class_and_vector(tfmdata,value,where) -- "expansions"
+ local g_where = tfmdata.goodies and tfmdata.goodies[where]
+ local f_where = fonts[where]
+ local g_classes = g_where and g_where.classes
+ local f_classes = f_where and f_where.classes
+ local class = (g_classes and g_classes[value]) or (f_classes and f_classes[value])
+ if class then
+ local class_vector = class.vector
+ local g_vectors = g_where and g_where.vectors
+ local f_vectors = f_where and f_where.vectors
+ local vector = (g_vectors and g_vectors[class_vector]) or (f_vectors and f_vectors[class_vector])
+ return class, vector
+ end
+end
+
+-- -- -- -- -- --
+-- expansion (hz)
+-- -- -- -- -- --
+
+local expansions = fonts.expansions or allocate()
+
+fonts.expansions = expansions
+
+local classes = expansions.classes or allocate()
+local vectors = expansions.vectors or allocate()
+
+expansions.classes = classes
+expansions.vectors = vectors
+
+classes.preset = {
+ stretch = 2,
+ shrink = 2,
+ step = .5,
+ factor = 1,
+}
+
+classes['quality'] = {
+ stretch = 2,
+ shrink = 2,
+ step = .5,
+ vector = 'default',
+ factor = 1,
+}
+
+vectors['default'] = {
+ [0x0041] = 0.5, -- A
+ [0x0042] = 0.7, -- B
+ [0x0043] = 0.7, -- C
+ [0x0044] = 0.5, -- D
+ [0x0045] = 0.7, -- E
+ [0x0046] = 0.7, -- F
+ [0x0047] = 0.5, -- G
+ [0x0048] = 0.7, -- H
+ [0x004B] = 0.7, -- K
+ [0x004D] = 0.7, -- M
+ [0x004E] = 0.7, -- N
+ [0x004F] = 0.5, -- O
+ [0x0050] = 0.7, -- P
+ [0x0051] = 0.5, -- Q
+ [0x0052] = 0.7, -- R
+ [0x0053] = 0.7, -- S
+ [0x0055] = 0.7, -- U
+ [0x0057] = 0.7, -- W
+ [0x005A] = 0.7, -- Z
+ [0x0061] = 0.7, -- a
+ [0x0062] = 0.7, -- b
+ [0x0063] = 0.7, -- c
+ [0x0064] = 0.7, -- d
+ [0x0065] = 0.7, -- e
+ [0x0067] = 0.7, -- g
+ [0x0068] = 0.7, -- h
+ [0x006B] = 0.7, -- k
+ [0x006D] = 0.7, -- m
+ [0x006E] = 0.7, -- n
+ [0x006F] = 0.7, -- o
+ [0x0070] = 0.7, -- p
+ [0x0071] = 0.7, -- q
+ [0x0073] = 0.7, -- s
+ [0x0075] = 0.7, -- u
+ [0x0077] = 0.7, -- w
+ [0x007A] = 0.7, -- z
+ [0x0032] = 0.7, -- 2
+ [0x0033] = 0.7, -- 3
+ [0x0036] = 0.7, -- 6
+ [0x0038] = 0.7, -- 8
+ [0x0039] = 0.7, -- 9
+}
+
+vectors['quality'] = vectors['default'] -- metatable ?
+
+-- Compression is new and used for a math experiment. Musical timestamp(s): November
+-- 2022, a cluster of live performances: RPWL (5), PT (7, yes!) and xPropaganda (10).
+
+local function initialize(tfmdata,value)
+ if value then
+ local class, vector = get_class_and_vector(tfmdata,value,"expansions")
+ if class then
+ if vector then
+ local stretch = class.stretch or 0
+ local shrink = class.shrink or 0
+ local step = class.step or 0
+ local factor = class.factor or 1
+ if trace_expansion then
+ report_expansions("setting class %a, vector %a, factor %a, stretch %a, shrink %a, step %a",
+ value,class.vector,factor,stretch,shrink,step)
+ end
+ tfmdata.parameters.expansion = {
+ stretch = 10 * stretch,
+ shrink = 10 * shrink,
+ step = 10 * step,
+ factor = factor,
+ }
+ local data = characters and characters.data
+ for i, chr in next, tfmdata.characters do -- todo unicode
+ local v = vector[i]
+ if data and not v then -- we could move the data test outside (needed for plain)
+ local d = data[i]
+ if d then
+ local s = d.shcode
+ if not s then
+ -- sorry
+ elseif type(s) == "table" then
+ v = ((vector[s[1]] or 0) + (vector[s[#s]] or 0)) / 2
+ else
+ v = vector[s] or 0
+ end
+ end
+ end
+ -- So, factor influences all shapes but we now obey zero when set!
+ if v then
+ if type(v) == "table" then
+ local e = v[1]
+ local c = v[2] or 0
+ if e ~= 0 then
+ chr.expansion = e*factor
+ end
+ if c ~= 0 then
+ chr.compression = c*factor
+ end
+ elseif v == 0 then
+ -- chr.expansion = 0
+ else
+ chr.expansion = v*factor
+ end
+ elseif factor ~= 1 then -- test is new
+ chr.expansion = factor
+ end
+ end
+ elseif trace_expansion then
+ report_expansions("unknown vector %a in class %a",class.vector,value)
+ end
+ elseif trace_expansion then
+ report_expansions("unknown class %a",value)
+ end
+ end
+end
+
+local specification = {
+ name = "expansion",
+ description = "apply hz optimization",
+ initializers = {
+ base = initialize,
+ node = initialize,
+ }
+}
+
+registerotffeature(specification)
+registerafmfeature(specification)
+
+fonts.goodies.register("expansions", function(...) return fonts.goodies.report("expansions", trace_expansion, ...) end)
+
+implement {
+ name = "setupfontexpansion",
+ arguments = "2 strings",
+ actions = function(class,settings) getparameters(classes,class,'preset',settings) end
+}
+
+-- special version for math 7/11/22
+
+classes.math = {
+ stretch = 2,
+ shrink = 2,
+ step = .5,
+ vector = 'math',
+ factor = 1,
+}
+
+vectors.math = {
+ [0x002B] = { 4, 0 }, -- +
+ [0x2212] = { 4, 0 }, -- -
+ [0x003C] = { 8, 0 }, -- <
+ [0x003D] = { 8, 0 }, -- =
+ [0x003E] = { 8, 0 }, -- >
+ [0x002F] = { 2, 0 }, -- /
+ [0x0028] = { 2, 0 }, -- (
+ [0x0029] = { 2, 0 }, -- )
+ [0x005B] = { 2, 0 }, -- [
+ [0x005D] = { 2, 0 }, -- ]
+}
+
+local function initialize(tfmdata,value)
+ if value then
+ local class, vector = get_class_and_vector(tfmdata,value,"expansions")
+ if class then
+ if vector then
+ local stretch = class.stretch or 0
+ local shrink = class.shrink or 0
+ local step = class.step or 0
+ local factor = class.factor or 1
+ if trace_expansion then
+ report_expansions("setting class %a, vector %a, factor %a, stretch %a, shrink %a, step %a",
+ value,class.vector,factor,stretch,shrink,step)
+ end
+ tfmdata.parameters.expansion = {
+ stretch = 10 * stretch,
+ shrink = 10 * shrink,
+ step = 10 * step,
+ factor = factor,
+ }
+ local characters = tfmdata.characters
+ for u, v in next, vector do
+ local chr = characters[u]
+ if type(v) == "table" then
+ local e = v[1]
+ local c = v[2] or 0
+ if e ~= 0 then
+ chr.expansion = e*factor
+ end
+ if c ~= 0 then
+ chr.compression = c*factor
+ end
+ elseif v ~= 0 then
+ chr.expansion = v*factor
+ end
+ end
+ elseif trace_expansion then
+ report_expansions("unknown vector %a in class %a",class.vector,value)
+ end
+ elseif trace_expansion then
+ report_expansions("unknown class %a",value)
+ end
+ end
+end
+
+registerotffeature {
+ name = "mathexpansion",
+ description = "apply hz optimization to math",
+ initializers = {
+ base = initialize,
+ node = initialize,
+ }
+}
+
+-- -- -- -- -- --
+-- protrusion
+-- -- -- -- -- --
+
+fonts.protrusions = allocate()
+local protrusions = fonts.protrusions
+
+protrusions.classes = allocate()
+protrusions.vectors = allocate()
+
+local classes = protrusions.classes
+local vectors = protrusions.vectors
+
+-- the values need to be revisioned
+
+classes.preset = {
+ factor = 1,
+ left = 1,
+ right = 1,
+}
+
+classes['pure'] = { vector = 'pure', factor = 1 }
+classes['punctuation'] = { vector = 'punctuation', factor = 1 }
+classes['alpha'] = { vector = 'alpha', factor = 1 }
+classes['quality'] = { vector = 'quality', factor = 1 }
+
+vectors['pure'] = {
+
+ [0x002C] = { 0, 1 }, -- comma
+ [0x002E] = { 0, 1 }, -- period
+ [0x003A] = { 0, 1 }, -- colon
+ [0x003B] = { 0, 1 }, -- semicolon
+ [0x002D] = { 0, 1 }, -- hyphen
+ [0x00AD] = { 0, 1 }, -- also hyphen
+ [0x2013] = { 0, 0.50 }, -- endash
+ [0x2014] = { 0, 0.33 }, -- emdash
+ [0x3001] = { 0, 1 }, -- ideographic comma ã€
+ [0x3002] = { 0, 1 }, -- ideographic full stop 。
+ [0x060C] = { 0, 1 }, -- arabic comma ،
+ [0x061B] = { 0, 1 }, -- arabic semicolon Ø›
+ [0x06D4] = { 0, 1 }, -- arabic full stop Û”
+
+}
+
+vectors['punctuation'] = {
+
+ [0x003F] = { 0, 0.20 }, -- ?
+ [0x00BF] = { 0.20, 0 }, -- ¿
+ [0x0021] = { 0, 0.20 }, -- !
+ [0x00A1] = { 0.20, 0, }, -- ¡
+ [0x0028] = { 0.05, 0 }, -- (
+ [0x0029] = { 0, 0.05 }, -- )
+ [0x005B] = { 0.05, 0 }, -- [
+ [0x005D] = { 0, 0.05 }, -- ]
+ [0x002C] = { 0, 0.70 }, -- comma
+ [0x002E] = { 0, 0.70 }, -- period
+ [0x003A] = { 0, 0.50 }, -- colon
+ [0x003B] = { 0, 0.50 }, -- semicolon
+ [0x002D] = { 0, 0.70 }, -- hyphen
+ [0x00AD] = { 0, 0.70 }, -- also hyphen
+ [0x2013] = { 0, 0.30 }, -- endash
+ [0x2014] = { 0, 0.20 }, -- emdash
+ [0x060C] = { 0, 0.70 }, -- arabic comma
+ [0x061B] = { 0, 0.50 }, -- arabic semicolon
+ [0x06D4] = { 0, 0.70 }, -- arabic full stop
+ [0x061F] = { 0, 0.20 }, -- ØŸ
+
+ -- todo: left and right quotes: .5 double, .7 single
+
+ [0x2039] = { 0.70, 0.70 }, -- left single guillemet ‹
+ [0x203A] = { 0.70, 0.70 }, -- right single guillemet ›
+ [0x00AB] = { 0.50, 0.50 }, -- left guillemet «
+ [0x00BB] = { 0.50, 0.50 }, -- right guillemet »
+
+ [0x2018] = { 0.70, 0.70 }, -- left single quotation mark ‘
+ [0x2019] = { 0, 0.70 }, -- right single quotation mark ’
+ [0x201A] = { 0.70, 0 }, -- single low-9 quotation mark ,
+ [0x201B] = { 0.70, 0 }, -- single high-reversed-9 quotation mark ‛
+ [0x201C] = { 0.50, 0.50 }, -- left double quotation mark “
+ [0x201D] = { 0, 0.50 }, -- right double quotation mark â€
+ [0x201E] = { 0.50, 0 }, -- double low-9 quotation mark „
+ [0x201F] = { 0.50, 0 }, -- double high-reversed-9 quotation mark ‟
+
+}
+
+vectors['alpha'] = {
+
+ [0x0041] = { .05, .05 }, -- A
+ [0x0046] = { 0, .05 }, -- F
+ [0x004A] = { .05, 0 }, -- J
+ [0x004B] = { 0, .05 }, -- K
+ [0x004C] = { 0, .05 }, -- L
+ [0x0054] = { .05, .05 }, -- T
+ [0x0056] = { .05, .05 }, -- V
+ [0x0057] = { .05, .05 }, -- W
+ [0x0058] = { .05, .05 }, -- X
+ [0x0059] = { .05, .05 }, -- Y
+
+ [0x006B] = { 0, .05 }, -- k
+ [0x0072] = { 0, .05 }, -- r
+ [0x0074] = { 0, .05 }, -- t
+ [0x0076] = { .05, .05 }, -- v
+ [0x0077] = { .05, .05 }, -- w
+ [0x0078] = { .05, .05 }, -- x
+ [0x0079] = { .05, .05 }, -- y
+
+}
+
+vectors['quality'] = table.merged(
+ vectors['punctuation'],
+ vectors['alpha']
+)
+
+-- As this is experimental code, users should not depend on it. The implications are still
+-- discussed on the ConTeXt Dev List and we're not sure yet what exactly the spec is (the
+-- next code is tested with a gyre font patched by / fea file made by Khaled Hosny). The
+-- double trick should not be needed it proper hanging punctuation is used in which case
+-- values < 1 can be used.
+--
+-- preferred (in context, usine vectors):
+--
+-- \definefontfeature[whatever][default][mode=node,protrusion=quality]
+--
+-- using lfbd and rtbd, with possibibility to enable only one side :
+--
+-- \definefontfeature[whocares][default][mode=node,protrusion=yes, opbd=yes,script=latn]
+-- \definefontfeature[whocares][default][mode=node,protrusion=right,opbd=yes,script=latn]
+--
+-- idem, using multiplier
+--
+-- \definefontfeature[whocares][default][mode=node,protrusion=2,opbd=yes,script=latn]
+-- \definefontfeature[whocares][default][mode=node,protrusion=double,opbd=yes,script=latn]
+--
+-- idem, using named feature file (less frozen):
+--
+-- \definefontfeature[whocares][default][mode=node,protrusion=2,opbd=yes,script=latn,featurefile=texgyrepagella-regularxx.fea]
+
+classes['double'] = { -- for testing opbd
+ factor = 2,
+ left = 1,
+ right = 1,
+}
+
+local function map_opbd_onto_protrusion(tfmdata,value,opbd)
+ local characters = tfmdata.characters
+ local descriptions = tfmdata.descriptions
+ local properties = tfmdata.properties
+ local parameters = tfmdata.parameters
+ local resources = tfmdata.resources
+ local rawdata = tfmdata.shared.rawdata
+ local lookuphash = rawdata.lookuphash
+ local lookuptags = resources.lookuptags
+ local script = properties.script
+ local language = properties.language
+ local units = parameters.units
+ local done, factor, left, right = false, 1, 1, 1
+ local class = classes[value]
+ if class then
+ factor = class.factor or 1
+ left = class.left or 1
+ right = class.right or 1
+ else
+ factor = tonumber(value) or 1
+ end
+ local lfactor = left * factor
+ local rfactor = right * factor
+ if trace_protrusion then
+ report_protrusions("left factor %0.3F, right factor %0.3F",lfactor,rfactor)
+ end
+ tfmdata.parameters.protrusion = {
+ factor = factor,
+ left = left,
+ right = right,
+ }
+ if opbd ~= "right" then
+ local validlookups, lookuplist = otf.collectlookups(rawdata,"lfbd",script,language)
+ if validlookups then
+ for i=1,#lookuplist do
+ local lookup = lookuplist[i]
+ local steps = lookup.steps
+ if steps then
+ if trace_protrusion then
+ report_protrusions("setting left using lfbd")
+ end
+ for i=1,#steps do
+ local step = steps[i]
+ local coverage = step.coverage
+ if coverage then
+ for k, v in next, coverage do
+ if v == true then
+ -- zero
+ else
+ local w = descriptions[k].width
+ local d = - v[1]
+ if w == 0 or d == 0 then
+ -- ignored
+ else
+ local p = lfactor * d/units
+ characters[k].leftprotrusion = p
+ if trace_protrusion then
+ report_protrusions("lfbd -> %0.3F %C",p,k)
+ end
+ end
+ end
+ end
+ end
+ end
+ done = true
+ end
+ end
+ end
+ end
+ if opbd ~= "left" then
+ local validlookups, lookuplist = otf.collectlookups(rawdata,"rtbd",script,language)
+ if validlookups then
+ for i=1,#lookuplist do
+ local lookup = lookuplist[i]
+ local steps = lookup.steps
+ if steps then
+ if trace_protrusion then
+ report_protrusions("setting right using rtbd")
+ end
+ for i=1,#steps do
+ local step = steps[i]
+ local coverage = step.coverage
+ if coverage then
+ for k, v in next, coverage do
+ if v == true then
+ -- zero
+ else
+ local w = descriptions[k].width
+ local d = - v[3]
+ if w == 0 or d == 0 then
+ -- ignored
+ else
+ local p = rfactor * d/units
+ characters[k].rightprotrusion = p
+ if trace_protrusion then
+ report_protrusions("rtbd -> %0.3F %C",p,k)
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ done = true
+ end
+ end
+ end
+end
+
+-- The opbd test is just there because it was discussed on the context development list. However,
+-- the mentioned fxlbi.otf font only has some kerns for digits. So, consider this feature not supported
+-- till we have a proper test font.
+
+local function initialize(tfmdata,value)
+ if value then
+ local opbd = tfmdata.shared.features.opbd
+ if opbd then
+ -- possible values: left right both yes no (experimental)
+ map_opbd_onto_protrusion(tfmdata,value,opbd)
+ else
+ local class, vector = get_class_and_vector(tfmdata,value,"protrusions")
+ if class then
+ if vector then
+ local factor = class.factor or 1
+ local left = class.left or 1
+ local right = class.right or 1
+ if trace_protrusion then
+ report_protrusions("setting class %a, vector %a, factor %a, left %a, right %a",
+ value,class.vector,factor,left,right)
+ end
+ local data = characters.data
+ local lfactor = left * factor
+ local rfactor = right * factor
+ if trace_protrusion then
+ report_protrusions("left factor %0.3F, right factor %0.3F",lfactor,rfactor)
+ end
+ tfmdata.parameters.protrusion = {
+ factor = factor,
+ left = left,
+ right = right,
+ }
+ for i, chr in next, tfmdata.characters do
+ local v = vector[i]
+ local pl = nil
+ local pr = nil
+ if v then
+ pl = v[1]
+ pr = v[2]
+ else
+ local d = data[i]
+ if d then
+ local s = d.shcode
+ if not s then
+ -- sorry
+ elseif type(s) == "table" then
+ local vl = vector[s[1]]
+ local vr = vector[s[#s]]
+ if vl then pl = vl[1] end
+ if vr then pr = vr[2] end
+ else
+ v = vector[s]
+ if v then
+ pl = v[1]
+ pr = v[2]
+ end
+ end
+ end
+ end
+ if pl and pl ~= 0 then
+ local p = pl * lfactor
+ chr.leftprotrusion = p
+ if trace_protrusion then
+ report_protrusions("left -> %0.3F %C ",p,i)
+ end
+ end
+ if pr and pr ~= 0 then
+ local p = pr * rfactor
+ chr.rightprotrusion = p
+ if trace_protrusion then
+ report_protrusions("right -> %0.3F %C",p,i)
+ end
+ end
+ end
+ elseif trace_protrusion then
+ report_protrusions("unknown vector %a in class %a",class.vector,value)
+ end
+ elseif trace_protrusion then
+ report_protrusions("unknown class %a",value)
+ end
+ end
+ end
+end
+
+local specification = {
+ name = "protrusion",
+ description = "l/r margin character protrusion",
+ initializers = {
+ base = initialize,
+ node = initialize,
+ }
+}
+
+registerotffeature(specification)
+registerafmfeature(specification)
+
+fonts.goodies.register("protrusions", function(...) return fonts.goodies.report("protrusions", trace_protrusion, ...) end)
+
+implement {
+ name = "setupfontprotrusion",
+ arguments = "2 strings",
+ actions = function(class,settings) getparameters(classes,class,'preset',settings) end
+}
+
+local function initialize(tfmdata,value)
+ local properties = tfmdata.properties
+ local parameters = tfmdata.parameters
+ if properties then
+ value = tonumber(value)
+ if value then
+ if value < 0 then
+ value = 0
+ elseif value > 10 then
+ report_expansions("threshold for %a @ %p limited to 10 pct",properties.fontname,parameters.size)
+ value = 10
+ end
+ if value > 5 then
+ report_expansions("threshold for %a @ %p exceeds 5 pct",properties.fontname,parameters.size)
+ end
+ end
+ properties.threshold = value or nil -- nil enforces default
+ end
+end
+
+local specification = {
+ name = "threshold",
+ description = "threshold for quality features",
+ initializers = {
+ base = initialize,
+ node = initialize,
+ }
+}
+
+registerotffeature(specification)
+registerafmfeature(specification)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-imp-sanitize.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-imp-sanitize.lmt
new file mode 100644
index 00000000000..84c42e78f30
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-imp-sanitize.lmt
@@ -0,0 +1,197 @@
+if not modules then modules = { } end modules ['font-san'] = {
+ version = 1.001,
+ comment = "companion to font-ini.mkiv",
+ author = "Hans Hagen, PRAGMA ADE & Å›rÄ«rÄma",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- \definefontfeature[demo][sanitizer=demo]
+-- \definedfont[Serif*default,demo] test context test
+-- \definedfont[Serif*default] test context test
+
+local keys, insert, copytable = table.keys, table.insert, table.copy
+local utfvalues, utfbyte = utf.values, utf.byte
+
+local sanitizers = { }
+
+local trace = false
+local report = logs.reporter("fonts", "sanitizers")
+
+trackers.register("fonts.sanitizers", function(v) trace = v end)
+
+function fonts.registersanitizer(name,vector)
+ sanitizers[name] = vector
+end
+
+local function split(s)
+ local t = { }
+ for value in utfvalues(s) do
+ t[#t+1] = value
+ end
+ return t
+end
+
+local function wrap(t)
+ for i=1,#t do
+ t[i] = { t[i] }
+ end
+ return t
+end
+
+local function initializesanitizer(tfmdata,value)
+ local resources = tfmdata.resources
+ local sanitized = resources.sanitized
+ if not sanitized then
+ local sanitizer = false
+ local goodies = tfmdata.goodies
+ if goodies then
+ for i=1,#goodies do
+ local goodie = goodies[i]
+ local sanitizers = goodie.sanitizers
+ sanitizer = sanitizers and sanitizers[value]
+ if sanitizer then
+ report("using sanitizer %a from goodie file",value)
+ break
+ end
+ end
+ end
+ if not sanitizer then
+ sanitizer = sanitizers[value]
+ if sanitizer then
+ report("using sanitizer %a",value)
+ end
+ end
+ resources.sanitized = true
+ if sanitizer then
+ local mapping = sanitizer.mapping
+ if mapping then
+ local keys = keys(mapping)
+ local maps = { }
+ table.sort(keys, function(a,b) return a > b end)
+ for i = 1,#keys do
+ local k = keys[i]
+ keys[i] = split(k)
+ maps[i] = split(mapping[k])
+ end
+ for i=1,#maps do
+ local k = keys[i]
+ local m = maps[i]
+ if trace then
+ -- m = copytable(m)
+ -- insert(m,1,utfbyte("["))
+ -- insert(m, utfbyte("]"))
+ local t = { utfbyte("[") }
+ t[#t+1] = 0x200D -- zwnj
+ for i=1,#m do
+ t[#t+1] = m[i]
+ t[#t+1] = 0x200D -- zwnj
+ end
+ t[#t+1] = utfbyte("]")
+ end
+ maps[i] = { type = "multiple", data = { [k[1]] = m } }
+ keys[i] = { current = wrap(k) , lookups = { i } }
+ end
+ local specification = {
+ name = "sanitizer",
+ type = "chainsubstitution",
+ prepend = 1,
+ nocheck = true,
+ default = true,
+ lookups = maps,
+ data = { rules = keys },
+ }
+ local s = fonts.handlers.otf.enhancers.addfeature(
+ tfmdata,"sanitizer",specification, true
+ )
+ insert(resources.sequences,1,s)
+ end
+ end
+ end
+end
+
+-- has to come *after* devanagari because we need to push it in front
+-- ... it could be a built-in
+
+fonts.constructors.features.otf.register {
+ name = "sanitizer",
+ description = "inject sanitizer features",
+ initializers = {
+ node = initializesanitizer,
+ },
+}
+
+local dev2rkrf = {
+ ["केà¥à¤°"] = "कà¥à¤°à¥‡",
+ ["कैà¥à¤°"] = "कà¥à¤°à¥ˆ",
+ ["खेà¥à¤°"] = "खà¥à¤°à¥‡",
+ ["खैà¥à¤°"] = "खà¥à¤°à¥ˆ",
+ ["गेà¥à¤°"] = "गà¥à¤°à¥‡",
+ ["गैà¥à¤°"] = "गà¥à¤°à¥ˆ",
+ ["घेà¥à¤°"] = "घà¥à¤°à¥‡",
+ ["घैà¥à¤°"] = "घà¥à¤°à¥ˆ",
+ -- not required: placed here just to show how bad some fonts are :(
+ -- ["ङेà¥à¤°"] = "ङà¥à¤°à¥‡",
+ -- ["ङैà¥à¤°"] = "ङà¥à¤°à¥ˆ",
+ ["चेà¥à¤°"] = "चà¥à¤°à¥‡",
+ ["चैà¥à¤°"] = "चà¥à¤°à¥ˆ",
+ ["छेà¥à¤°"] = "छà¥à¤°à¥‡",
+ ["छैà¥à¤°"] = "छà¥à¤°à¥ˆ",
+ ["जेà¥à¤°"] = "जà¥à¤°à¥‡",
+ ["जैà¥à¤°"] = "जà¥à¤°à¥ˆ",
+ ["à¤à¥‡à¥à¤°"] = "à¤à¥à¤°à¥‡",
+ ["à¤à¥ˆà¥à¤°"] = "à¤à¥à¤°à¥ˆ",
+ ["ञेà¥à¤°"] = "ञà¥à¤°à¥‡",
+ ["ञैà¥à¤°"] = "ञà¥à¤°à¥ˆ",
+ ["णेà¥à¤°"] = "णà¥à¤°à¥‡",
+ ["णैà¥à¤°"] = "णà¥à¤°à¥ˆ",
+ ["तेà¥à¤°"] = "तà¥à¤°à¥‡",
+ ["तैà¥à¤°"] = "तà¥à¤°à¥ˆ",
+ ["थेà¥à¤°"] = "थà¥à¤°à¥‡",
+ ["थैà¥à¤°"] = "थà¥à¤°à¥ˆ",
+ ["देà¥à¤°"] = "दà¥à¤°à¥‡",
+ ["दैà¥à¤°"] = "दà¥à¤°à¥ˆ",
+ ["धेà¥à¤°"] = "धà¥à¤°à¥‡",
+ ["धैà¥à¤°"] = "धà¥à¤°à¥ˆ",
+ ["नेà¥à¤°"] = "नà¥à¤°à¥‡",
+ ["नैà¥à¤°"] = "नà¥à¤°à¥ˆ",
+ ["पेà¥à¤°"] = "पà¥à¤°à¥‡",
+ ["पैà¥à¤°"] = "पà¥à¤°à¥ˆ",
+ ["फेà¥à¤°"] = "फà¥à¤°à¥‡",
+ ["फैà¥à¤°"] = "फà¥à¤°à¥ˆ",
+ ["बेà¥à¤°"] = "बà¥à¤°à¥‡",
+ ["बैà¥à¤°"] = "बà¥à¤°à¥ˆ",
+ ["भेà¥à¤°"] = "भà¥à¤°à¥‡",
+ ["भैà¥à¤°"] = "भà¥à¤°à¥ˆ",
+ ["मेà¥à¤°"] = "मà¥à¤°à¥‡",
+ ["मैà¥à¤°"] = "मà¥à¤°à¥ˆ",
+ ["येà¥à¤°"] = "यà¥à¤°à¥‡",
+ ["यैà¥à¤°"] = "यà¥à¤°à¥ˆ",
+ -- some fonts might need this, some might not: weird
+ -- for example: Shobhika does not need it but Noto Serif does :(
+ -- ["लेà¥à¤°"] = "लà¥à¤°à¥‡",
+ -- ["लैà¥à¤°"] = "लà¥à¤°à¥ˆ",
+ ["वेà¥à¤°"] = "वà¥à¤°à¥‡",
+ ["वैà¥à¤°"] = "वà¥à¤°à¥ˆ",
+ ["सेà¥à¤°"] = "सà¥à¤°à¥‡",
+ ["सैà¥à¤°"] = "सà¥à¤°à¥ˆ",
+ ["शेà¥à¤°"] = "शà¥à¤°à¥‡",
+ ["शैà¥à¤°"] = "शà¥à¤°à¥ˆ",
+ ["षेà¥à¤°"] = "षà¥à¤°à¥‡",
+ ["षैà¥à¤°"] = "षà¥à¤°à¥ˆ",
+ ["हेà¥à¤°"] = "हà¥à¤°à¥‡",
+ ["हैà¥à¤°"] = "हà¥à¤°à¥ˆ",
+ -- some fonts might need this, some might not: weird
+ -- ["ळेà¥à¤°"] = "ळà¥à¤°à¥‡",
+ -- ["ळैà¥à¤°"] = "ळà¥à¤°à¥ˆ",
+}
+
+local demomapping = {
+ luatex = "LuaTeX",
+ metapost = "MetaPost",
+ context = "ConTeXt",
+ metafun = "MetaFun",
+}
+
+fonts.registersanitizer("dev2rkrf", { mapping = dev2rkrf })
+fonts.registersanitizer("demo", { mapping = demomapping })
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-imp-scripts.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-imp-scripts.lmt
new file mode 100644
index 00000000000..97b11c91d36
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-imp-scripts.lmt
@@ -0,0 +1,188 @@
+if not modules then modules = { } end modules ['font-imp-scripts'] = {
+ version = 1.001,
+ comment = "companion to font-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local getrange = characters.getrange
+
+local settings_to_hash = utilities.parsers.settings_to_hash
+
+if not context then return end
+
+-- the defaults are not yet ok
+
+local next, type, tonumber = next, type, tonumber
+local gmatch = string.gmatch
+local max = math.max
+
+local fonts = fonts
+local utilities = utilities
+
+local helpers = fonts.helpers
+local charcommand = helpers.commands.char
+local downcommand = helpers.commands.down
+local upcommand = helpers.commands.up
+
+local handlers = fonts.handlers
+local otf = handlers.otf
+local afm = handlers.afm
+local registerotffeature = otf.features.register
+local registerafmfeature = afm.features.register
+
+local settings_to_hash = utilities.parsers.settings_to_hash
+local sortedhash = table.sortedhash
+
+local handlers = fonts.handlers
+
+local sup = nil
+local sub = nil
+
+local function initialize(tfmdata,key,value)
+ --
+ if not sup then
+ sup = { }
+ sub = { }
+ for unicode, data in next, characters.data do
+ local specials = data.specials
+ if specials then
+ local what = specials[1]
+ if what == "super" then
+ sup[unicode] = specials[2]
+ elseif what == "sub" then
+ sub[unicode] = specials[2]
+ end
+ end
+ end
+ end
+ --
+ local spec
+ if value == true then
+ spec = { factor = 3/5, up = 5/4, down = 1/4 }
+ elseif type(value) == "number" then
+ spec = { factor = value, up = 5/4, down = 1/4 }
+ else
+ spec = settings_to_hash(value)
+ end
+ local factor = tonumber(spec.factor) or 3/5
+ local up = tonumber(spec.up) or 5/4
+ local down = tonumber(spec.down) or 1/4
+ --
+ local characters = tfmdata.characters
+ local parameters = tfmdata.parameters
+ local up = parameters.xheight * up
+ local down = -parameters.xheight * down
+ -- disable sups/subs
+ local function add(unicode,other,go_up)
+ local old = characters[other]
+ if old then
+ local shift = go_up and up or down
+ local width = (old.width or 0) * factor
+ local height = (old.height or 0) * factor + shift
+ local depth = go_up and 0 or max((old.depth or 0) * factor + down,0)
+ characters[unicode] = {
+ width = width,
+ height = height,
+ depth = depth,
+ commands = { { "offset", 0, shift, other, factor, factor } },
+ -- yoffset = shift,
+ -- xscale = factor,
+ -- yscale = factor,
+ -- commands = { { "slot", 0, other } }, -- { slotcommand[0][other] or charcommand[other] }
+ }
+ end
+ end
+ for unicode, other in sortedhash(sup) do
+ add(unicode,other,true)
+ end
+ for unicode, other in sortedhash(sub) do
+ add(unicode,other,false)
+ end
+end
+
+local specification = {
+ name = "scripts",
+ description = "add superiors and inferiors",
+ manipulators = {
+ base = initialize,
+ node = initialize,
+ }
+}
+
+registerotffeature(specification)
+registerafmfeature(specification)
+
+-- a different kind of scripts support
+
+local function initialize(tfmdata,key,value)
+ if value then
+ local detail = type(value) == "string" and settings_to_hash(value) or { }
+ local orientation = tonumber(detail.orientation) or 0
+ if orientation == 1 or orientation == 3 then
+ local characters = tfmdata.characters
+ local parameters = tfmdata.parameters
+ local emwidth = parameters.quad
+ local exheight = parameters.xheight
+ local ranges = detail.ranges
+ local downshift = exheight * (tonumber(detail.down) or 0)
+ local rightshift = exheight * (tonumber(detail.right) or 0)
+ local orientate
+ if orientation == 1 then
+ orientate = function(character)
+ local width = character.width or 0
+ local height = character.height or 0
+ local depth = character.depth or 0
+ character.width = height + depth + rightshift + rightshift
+ character.height = width - downshift
+ character.depth = shift
+ character.xoffset = depth + rightshift
+ character.yoffset = width - downshift
+ character.orientation = orientation
+ end
+ else
+ orientate = function(character)
+ local width = character.width or 0
+ local height = character.height or 0
+ local depth = character.depth or 0
+-- character.width = height + depth + rightshift + rightshift
+ character.height = width - downshift
+ character.depth = shift
+-- character.xoffset = height + rightshift
+-- character.yoffset = - downshift
+-- character.orientation = orientation
+ end
+ end
+ if ranges then
+ for s in gmatch(ranges,"[^, ]+") do
+ local start, stop, description, gaps = getrange(s,true)
+ if start and stop then
+ for unicode=start,stop do
+ local character = characters[unicode]
+ if character then
+ orientate(character)
+ end
+ end
+ end
+ end
+ else
+ for unicode, character in next, characters do
+ orientate(character)
+ end
+ end
+ end
+ end
+end
+
+local specification = {
+ name = "vertical",
+ description = "vertical",
+ manipulators = {
+ base = initialize,
+ node = initialize,
+ }
+}
+
+registerotffeature(specification)
+registerafmfeature(specification)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-imp-text.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-imp-text.lmt
new file mode 100644
index 00000000000..16edb2ef421
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-imp-text.lmt
@@ -0,0 +1,30 @@
+if not modules then modules = { } end modules ['font-imp-text'] = {
+ version = 1.001,
+ comment = "companion to font-ini.mkiv and hand-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local type = type
+
+local fonts = fonts
+local registerotffeature = fonts.handlers.otf.features.register
+
+local function initialize(tfmdata,value)
+ if type(value) == "string" then
+ tfmdata.properties.textcontrol = (tfmdata.properties.textcontrol or 0) | tex.stringtocodesbitmap(value,tex.textcontrolcodes)
+ end
+end
+
+local specification = {
+ name = "textcontrol",
+ description = "control specific text handling",
+ initializers = {
+ none = initialize,
+ base = initialize,
+ node = initialize,
+ }
+}
+
+registerotffeature(specification)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-imp-tracing.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-imp-tracing.lmt
index 59603c9ddd6..00e3aaa50cf 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-imp-tracing.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-imp-tracing.lmt
@@ -33,74 +33,125 @@ local v_frame = variables.frame
local v_empty = variables.empty
local v_none = variables.none
+-- d:width d:height d:depth d:rulethickness b:outline b:advance b:baseline s:color
+
+-- local function initialize(tfmdata,key,value)
+-- if value then
+-- local vfspecials = fonts.helpers.vfspecials
+-- local vfcommands = fonts.helpers.commands
+-- local backgrounds = vfspecials.backgrounds
+-- local outlines = vfspecials.outlines
+-- local characters = tfmdata.characters
+-- local rulecache = backgrounds
+-- local showchar = true
+-- local color = "palegray"
+-- if type(value) == "string" then
+-- value = settings_to_array(value)
+-- for i=1,#value do
+-- local v = value[i]
+-- if v == v_frame then
+-- rulecache = outlines
+-- elseif v == v_background then
+-- rulecache = backgrounds
+-- elseif v == v_empty then
+-- showchar = false
+-- elseif v == v_none then
+-- color = nil
+-- else
+-- color = v
+-- end
+-- end
+-- end
+-- local gray = color and { "startcolor", color } or nil
+-- local black = gray and { "stopcolor" } or nil
+-- for unicode, character in next, characters do
+-- local width = character.width or 0
+-- local height = character.height or 0
+-- local depth = character.depth or 0
+-- local rule = rulecache[height][depth][width]
+-- if showchar then
+-- local commands = character.commands
+-- if commands then
+-- if gray then
+-- character.commands = prependcommands (
+-- commands, gray, rule, black
+-- )
+-- else
+-- character.commands = prependcommands (
+-- commands, rule
+-- )
+-- end
+-- else
+-- local char = charcommand[unicode]
+-- if gray then
+-- character.commands = {
+-- gray, rule, black, char
+-- }
+-- else
+-- character.commands = {
+-- rule, char
+-- }
+-- end
+-- end
+-- else
+-- if gray then
+-- character.commands = {
+-- gray, rule, black
+-- }
+-- else
+-- character.commands = {
+-- rule
+-- }
+-- end
+-- end
+-- end
+-- end
+-- end
+
local function initialize(tfmdata,key,value)
if value then
local vfspecials = fonts.helpers.vfspecials
local vfcommands = fonts.helpers.commands
- local backgrounds = vfspecials.backgrounds
- local outlines = vfspecials.outlines
+ -- local backgrounds = vfspecials.backgrounds
+ -- local outlines = vfspecials.outlines
local characters = tfmdata.characters
- local rulecache = backgrounds
+ local rule = { "frame", true, true, true, false, false, false, false, "palegray" }
local showchar = true
- local color = "palegray"
if type(value) == "string" then
value = settings_to_array(value)
for i=1,#value do
local v = value[i]
if v == v_frame then
- rulecache = outlines
+ rule[6] = true
elseif v == v_background then
- rulecache = backgrounds
+ rule[6] = false
elseif v == v_empty then
showchar = false
elseif v == v_none then
- color = nil
+ rule[9] = false
else
- color = v
+ local thickness = string.todimen(v)
+ if thickness and thickness > 0 then
+ rule[5] = thickness
+ else
+ rule[9] = v
+ end
end
end
end
- local gray = color and { "startcolor", color } or nil
- local black = gray and { "stopcolor" } or nil
+ if not showchar then
+ rule = { rule }
+ end
for unicode, character in next, characters do
- local width = character.width or 0
- local height = character.height or 0
- local depth = character.depth or 0
- local rule = rulecache[height][depth][width]
if showchar then
local commands = character.commands
if commands then
- if gray then
- character.commands = prependcommands (
- commands, gray, rule, black
- )
- else
- character.commands = prependcommands (
- commands, rule
- )
- end
+ character.commands = prependcommands ( commands, rule )
else
- local char = charcommand[unicode]
- if gray then
- character.commands = {
- gray, rule, black, char
- }
- else
- character.commands = {
- rule, char
- }
- end
+ character.commands = { rule, charcommand[unicode] }
end
else
- if gray then
- character.commands = {
- gray, rule, black
- }
- else
- character.commands = {
- rule
- }
- end
+ character.commands = rule
end
end
end
@@ -127,7 +178,7 @@ local function initialize(tfmdata,key,value)
local vfspecials = fonts.helpers.vfspecials
local vfcommands = fonts.helpers.commands
local backgrounds = vfspecials.backgrounds
- local outlines = vfspecials.outlines
+ -- local outlines = vfspecials.outlines
local characters = tfmdata.characters
local rulecache = backgrounds
local push = vfcommands.push
@@ -139,9 +190,16 @@ local function initialize(tfmdata,key,value)
local blcolor = { "startcolor", "trace:3" } -- b / db
local tlcolor = { "startcolor", "trace:4" } -- y / dy
for unicode, character in next, characters do
- local mathkern = character.mathkern
- local italic = character.vert_italic or character.italic
- if mathkern or (italic and italic ~= 0) then
+ local mathkerns = character.mathkerns
+ local italic = character.vitalic or character.italic
+
+if italic ~= italic then
+ -- 8427 in pagella suddenly gets a "nan" assigned ... can this be a lua bug
+ -- test file : staircase-001.tex
+ italic = 0
+end
+
+ if mathkerns or (italic and italic ~= 0) then
local width = character.width or 0
local height = character.height or 0
local depth = character.depth or 0
@@ -151,15 +209,15 @@ local function initialize(tfmdata,key,value)
count = count + 1 list[count] = itcolor
count = count + 1 list[count] = push
count = count + 1 list[count] = { "offset", width + (italic < 0 and -italic or 0), 0 }
- count = count + 1 list[count] = rulecache[height][depth][abs(-italic)]
+ count = count + 1 list[count] = rulecache[height][depth][italic < 0 and -italic or italic]
count = count + 1 list[count] = pop
count = count + 1 list[count] = black
end
- if mathkern then
- local br = mathkern.bottom_right
- local tr = mathkern.top_right
- local bl = mathkern.bottom_left
- local tl = mathkern.top_left
+ if mathkerns then
+ local br = mathkerns.bottomright
+ local tr = mathkerns.topright
+ local bl = mathkerns.bottomleft
+ local tl = mathkerns.topleft
if br then
local done = false
for i=1,#br do
@@ -176,7 +234,7 @@ local function initialize(tfmdata,key,value)
end
count = count + 1 list[count] = push
count = count + 1 list[count] = { "offset", width + (k < 0 and k or 0), - depth }
- count = count + 1 list[count] = rulecache[h][0][abs(k)]
+ count = count + 1 list[count] = rulecache[h][0][k < 0 and -k or k]
count = count + 1 list[count] = pop
end
end
@@ -200,7 +258,7 @@ local function initialize(tfmdata,key,value)
end
count = count + 1 list[count] = push
count = count + 1 list[count] = { "offset", width + (k < 0 and k or 0), height - h }
- count = count + 1 list[count] = rulecache[h][0][abs(k)]
+ count = count + 1 list[count] = rulecache[h][0][k < 0 and k or k]
count = count + 1 list[count] = pop
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-ini.lmt
index 45e8f9e18a7..bc68fa83d4c 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-ini.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-ini.lmt
@@ -10,8 +10,8 @@ if not modules then modules = { } end modules ['font-ini'] = {
<p>Not much is happening here.</p>
--ldx]]--
-local allocate = utilities.storage.allocate
-local sortedhash = table.sortedhash
+local sortedhash, setmetatableindex = table.sortedhash, table.setmetatableindex
+local allocate = utilities.storage.allocate
fonts = fonts or { }
local fonts = fonts
@@ -37,4 +37,63 @@ fonts.privateoffsets = {
keepnames = false, -- when set to true names are always kept (not for context)
}
+local effects = setmetatableindex(
+ function(t,slant)
+ local v = setmetatableindex(
+ function(t,squeeze)
+ local v = setmetatableindex(
+ function(t,extend)
+ local v = setmetatableindex(
+ function(t,mode)
+ local v = setmetatableindex(
+ function(t,line)
+ local v = {
+ slant = slant,
+ squeeze = squeeze,
+ extend = extend,
+ mode = mode,
+ line = line * 1000,
+ }
+ t[line] = v
+ return v
+ end)
+ t[mode] = v
+ return v
+ end)
+ t[extend] = v
+ return v
+ end)
+ t[squeeze] = v
+ return v
+ end)
+ t[slant] = v
+ return v
+ end)
+
+-- This is an experiment, part of math engine project (MS and HH) where we wondered
+-- how to deal with bad or missing alphabets. One solution is a character specific
+-- effect which is supported by the engine (in fact the backend). By using a table
+-- cache we limit checking. We use tweaks in font goodies to achieve it.
+--
+-- character.effect = fonts.effects[slant][squeeze][extend][mode][line]
+-- character.effect = fonts.toeffect { slant = .2 }
+
+fonts.effects = effects
+
+fonts.effects[0][1][1][0][0] = false
+
+function fonts.toeffect(t)
+ local slant = t.slant or 0
+ local squeeze = t.squeeze or 1
+ local extend = t.extend or 1
+ local mode = t.mode or 0
+ local line = t.line or 0
+ if slant or squeeze or extend or mode or line then
+ local effect = effects[slant][squeeze][extend][mode][line]
+ if effect then
+ return effect
+ end
+ end
+end
+
-- Also here now:
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-ini.mklx b/Master/texmf-dist/tex/context/base/mkxl/font-ini.mklx
index 557ac3c49e2..6efae2ae10b 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-ini.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-ini.mklx
@@ -333,7 +333,7 @@
\the\everybodyfont
\settrue\c_font_synchronize}
-\mutable\let\savedfont\empty
+\mutable\lettonothing\savedfont
\installmacrostack\savedfont
@@ -401,9 +401,9 @@
%D local (sometimes in the textflow) size. We store these dimensions in two
%D \DIMENSION\ registers. These registers are not to be misused in calculations.
-\ifdefined\globalbodyfontsize \else \newdimen\globalbodyfontsize \fi \globalbodyfontsize=12pt
-\ifdefined\localbodyfontsize \else \newdimen\localbodyfontsize \fi \localbodyfontsize =\globalbodyfontsize
-\ifdefined\bodyfontsize \else \newdimen\bodyfontsize \fi \bodyfontsize =\globalbodyfontsize
+\ifdefined\globalbodyfontsize \else \newdimension\globalbodyfontsize \fi \globalbodyfontsize=12pt
+\ifdefined\localbodyfontsize \else \newdimension\localbodyfontsize \fi \localbodyfontsize =\globalbodyfontsize
+\ifdefined\bodyfontsize \else \newdimension\bodyfontsize \fi \bodyfontsize =\globalbodyfontsize
%D When we assign for instance 12pt to a \DIMENSION\ register the \type {\the}'d
%D value comes out as 12.0pt, which is often not the way users specify the bodyfont
@@ -419,11 +419,11 @@
\fi}
\def\normalizebodyfontsize_indeed#macro#body%
- {\edef#macro{\clf_nbfs\dimexpr#body\relax}%
+ {\edef#macro{\clf_normalizedbodyfontsize\dimexpr#body\relax}%
\gletcsname\??fontnormalizedbody\number\dimexpr#body\endcsname#macro}
\permanent\def\thenormalizedbodyfontsize#body%
- {\clf_nbfs\dimexpr#body\relax}
+ {\clf_normalizedbodyfontsize\dimexpr#body\relax}
\mutable\edef\normalizedglobalbodyfontsize{\thenormalizedbodyfontsize\bodyfontsize}
\mutable\edef\normalizedlocalbodyfontsize {\thenormalizedbodyfontsize\bodyfontsize}
@@ -458,12 +458,60 @@
\installcorenamespace{mappedfontsize}
-\permanent\tolerant\protected\def\mapfontsize[#from]#spacer[#to]%
- {\ifarguments\or\or\defcsname\??mappedfontsize\the\dimexpr#from\relax\endcsname{#to}\fi}
+% \permanent\tolerant\protected\def\mapfontsize[#from]#spacer[#to]%
+% {\ifarguments\or\or\defcsname\??mappedfontsize\the\dimexpr#from\relax\endcsname{#to}\fi}
+%
+% \def\font_basics_set_mapped_fontsize#from%
+% {\ifcsname\??mappedfontsize\the\dimexpr#from\relax\endcsname
+% \lastnamedcs\else#from%
+% \fi}
+
+% will become: mapmathfontsize
+
+%letcsname\??mappedfontsize\s!text \endcsname\!!plusone
+\letcsname\??mappedfontsize\s!script \endcsname\!!plustwo
+\letcsname\??mappedfontsize\s!scriptscript\endcsname\!!plusthree
+
+\permanent\tolerant\protected\def\mapfontsize[#class]#spacer[#from]#spacer[#to]%
+ {\ifarguments
+ % ignore
+ \or
+ % reset
+ \letcsname\??mappedfontsize#class:1\endcsname\undefined
+ \letcsname\??mappedfontsize#class:2\endcsname\undefined
+ \letcsname\??mappedfontsize#class:3\endcsname\undefined
+ \or
+ % unsupported
+ \or
+ % set
+ \defcsname
+ \??mappedfontsize
+ #class:%
+ \begincsname\??mappedfontsize#from\endcsname
+ \endcsname{#to}%
+ \fi}
+
+\permanent\tolerant\protected\def\checkedmapfontsize[#class]#spacer[#from]#spacer[#to]%
+ {\ifcsname\??mappedfontsize#class:\begincsname\??mappedfontsize#from\endcsname\endcsname
+ % keep (user) value
+ \else
+ \mapfontsize[#class][#from][#to]%
+ \fi}
+
+\permanent\tolerant\def\mappedfontsize#class#from%
+ {\begincsname
+ \??mappedfontsize
+ #class:%
+ \begincsname\??mappedfontsize#from\endcsname
+ \endcsname}
\def\font_basics_set_mapped_fontsize#from%
- {\ifcsname\??mappedfontsize\the\dimexpr#from\relax\endcsname
- \lastnamedcs\else#from%
+ {\ifcsname\??mappedfontsize\fontclass:\fontface\endcsname
+ %\the\dimexpr\lastnamedcs\dimexpr#from\relax\relax
+ %\the\dimexpr\lastnamedcs\dimexpr\bodyfontsize\relax\relax
+ \the\dimexpr\lastnamedcs\dimexpr\normalizedbodyfontsize\relax\relax
+ \else % we could use default
+ #from%
\fi}
\installcorenamespace{fontbodyknown}
@@ -612,7 +660,8 @@
\def\font_basics_check_text_bodyfont_step#whatever#body% size can be empty (checking needed as \bf is already defined)
{\ifcsname#whatever\endcsname\else
- \permanent\setugvalue{#whatever}{#body}%
+ %\permanent\setugvalue{#whatever}{#body}%
+ \permanent\protected\gdefcsname#whatever\endcsname{#body}%
\fi}
\def\font_basics_check_text_bodyfont#style#alternative#size% size can be empty (checking needed as \bf is already defined)
@@ -656,19 +705,21 @@
% 4:x{\definedfont[Serif sa 4]x}\par
% 5:x{\definedfont[Serif sa 5]x}\par
-\permanent\def\safontscale{\number\dimexpr\v_font_size_absolute\relax}
-\permanent\def\mofontscale{\number\dimexpr\font_basics_set_mapped_fontsize\v_font_size_absolute\relax}
+% \permanent\def\safontscale{\number\dimexpr\v_font_size_absolute\relax}
+% \permanent\def\mofontscale{\number\dimexpr\font_basics_set_mapped_fontsize\v_font_size_absolute\relax}
\mutable\let\somefontname \s!unknown
\mutable\let\somefontspec \s!unknown
\mutable\let\somefontfile \s!unknown
\mutable\let\somefontsize \zerocount
-\mutable\let\somefontsizex\empty
-\mutable\let\somefontsizey\empty
-\newcount\scaledfontmode % also used at the lua end
-\newcount\scaledfontsize % also used at the lua end
-\newcount\lastfontid % also used at the lua end / tex end
+\mutable\lettonothing\somefontsizex
+\mutable\lettonothing\somefontsizey
+
+% \newinteger\scaledfontmode % font-lib.mklx
+% \newinteger\scaledfontsize % font-lib.mklx
+% \newinteger\lastfontid % font-lib.mklx
+
\newtoks \everydefinefont
\aliased\let\c_font_feature_inheritance_fontnone \zerocount % none
@@ -681,28 +732,29 @@
\setnewconstant\c_font_feature_inheritance_mode \c_font_feature_inheritance_default
-\newdimen \d_font_scaled_text_face
-\newdimen \d_font_scaled_font_size
+\newdimension \d_font_scaled_text_face
+\newdimension \d_font_scaled_font_size
\newconditional\c_font_body_scale
\newfraction \f_font_body_scale
\newconditional\c_font_compact
-\newcount \c_font_scaled_glyph_scale
+\newinteger \c_font_scaled_glyph_scale
\immutable\dimensiondef\d_font_scaled_default 10pt
-\newcount\c_font_future_glyph_scale
-
% todo: move all to lua: use localcall for resolving filename
-\newcount\c_font_future_glyph_scale
-\newcount\c_font_scaled_font_mode_saved
-\newcount\c_font_scaled_points
+% \newcountinteger\c_font_future_glyph_scale % font-lib.mklx
+% \newcountinteger\c_font_scaled_font_mode_saved % font-lib.mklx
+% \newcountinteger\c_font_scaled_points % font-lib.mklx
+
+\mutable\lettonothing\somefontspec
-\mutable\let\somefontspec \empty
\mutable\let\lastrawfontcall \relax
\mutable\let\lastglobalrawfontcall\relax
+\immutable\dimensiondef\d_font_default_size 10pt
+
\protected\def\font_helpers_low_level_define
{\ifconditional\c_font_compact
\expandafter\font_helpers_low_level_define_compact
@@ -713,9 +765,9 @@
\protected\def\font_helpers_low_level_define_normal#specification#csname%
{% we can now set more at the lua end
\glet\somefontname\defaultfontfile
- \let\somefontsize\empty
- \let\somefontsizex\empty
- \let\somefontsizey\empty
+ \lettonothing\somefontsize
+ \lettonothing\somefontsizex
+ \lettonothing\somefontsizey
\clf_definefont_one{\detokenize\expandafter{\normalexpanded{#specification}}}% the escapestring catches at \somedimen
% sets \scaledfontmode and \somefontname and \somefontsize
\ifcase\fontface\relax
@@ -733,8 +785,10 @@
\fi
%
\ifcase\scaledfontmode\relax
- % none, avoid the designsize if possible
- \d_font_scaled_font_size-\plusthousand\scaledpoint
+ % mkiv, fails with glyphscale:
+ % \d_font_scaled_font_size-\plusthousand\scaledpoint
+ % so we just assume
+ \d_font_scaled_font_size\d_font_default_size
\or
% at
\d_font_scaled_font_size\somefontsize
@@ -743,7 +797,7 @@
\d_font_scaled_font_size\v_font_size_absolute\relax
\d_font_scaled_font_size\currentfontbodysize\d_font_scaled_font_size % uses \somefontsize set by lua
\or
- % mo
+ % mo % mapped font size will go away
\d_font_scaled_font_size\font_basics_set_mapped_fontsize\v_font_size_absolute
\d_font_scaled_font_size\currentfontbodysize\d_font_scaled_font_size
\or
@@ -777,24 +831,6 @@
\fi
\font_helpers_update_font_parameters
\font_helpers_update_font_class_parameters
- %\writestatus{fonts}{low level define: #csname/\somefontfile/\number\d_font_scaled_font_size/\fontface/\number\d_font_scaled_text_face}%
-% \clf_definefont_two
-% \ifempty\fontclass\s!false\else\s!true\fi
-% {#csname}%
-% {\somefontfile}%
-% \d_font_scaled_font_size
-% \c_font_feature_inheritance_mode
-% {\m_font_class_features}%
-% {\m_font_features}%
-% {\m_font_class_fallbacks}%
-% {\m_font_fallbacks}%
-% \fontface
-% \d_font_scaled_text_face
-% {\m_font_class_goodies}%
-% {\m_font_goodies}%
-% {\m_font_class_designsize}%
-% {\m_font_designsize}%
-% \scaledfontmode
\clf_definefont_two
\ifempty\fontclass\s!false\else\s!true\fi
{#csname}%
@@ -815,7 +851,7 @@
\relax
\ifcase\scaledfontsize
%\scaledfontsize\plusone
- \let\somefontspec\empty
+ \lettonothing\somefontspec
\let\lastrawfontcall\relax
\mutable\letcsname#csname\endcsname\relax
\else
@@ -828,9 +864,9 @@
\protected\def\font_helpers_low_level_define_compact#specification#csname%
{% we can now set more at the lua end
\glet\somefontname\defaultfontfile
- \let\somefontsize\empty
- \let\somefontsizex\empty
- \let\somefontsizey\empty
+ \lettonothing\somefontsize
+ \lettonothing\somefontsizex
+ \lettonothing\somefontsizey
\clf_definefont_one{\detokenize\expandafter{\normalexpanded{#specification}}}% the escapestring catches at \somedimen
% sets \scaledfontmode and \somefontname and \somefontsize
\ifcase\fontface\relax
@@ -848,8 +884,10 @@
\fi
%
\ifcase\scaledfontmode\relax
- % none, avoid the designsize if possible
- \d_font_scaled_font_size-\plusthousand\scaledpoint
+ % mkiv, fails with glyphscale:
+ % \d_font_scaled_font_size-\plusthousand\scaledpoint
+ % so we just assume
+ \d_font_scaled_font_size\d_font_default_size
\or
% at
\d_font_scaled_font_size\somefontsize
@@ -890,7 +928,8 @@
\scaledfontmode\zerocount
\fi
\c_font_future_glyph_scale\numexpr\plushundred*\d_font_scaled_font_size/\maxcard\relax
- \glyphscale\numexpr\plushundred*\d_font_scaled_font_size/\maxcard\relax % needed ? for math i guess
+ % \glyphscale\numexpr\plushundred*\d_font_scaled_font_size/\maxcard\relax % needed ? for math i guess
+ \glyphscale\numexpr\c_font_future_glyph_scale % needed ? for math i guess
% \d_font_scaled_font_size\d_font_scaled_default
% \d_font_scaled_text_face\d_font_scaled_default
%
@@ -924,7 +963,7 @@
\relax
\ifcase\scaledfontsize
%\scaledfontsize\plusone
- \let\somefontspec\empty
+ \lettonothing\somefontspec
\let\lastrawfontcall\relax
\mutable\letcsname#csname\endcsname\relax
\else
@@ -932,25 +971,46 @@
%
\glyphscale
\ifnum\c_font_scaled_font_mode_saved>\plusfour
+ % \c_font_scaled_points is set when we pass the font to the engine
\numexpr\plusthousand*\dimexpr\d_font_scaled_default\relax/\c_font_scaled_points\relax
\else
\c_font_future_glyph_scale
\fi
- \ifempty\somefontsizex\else
- \edef\somefontsizex{\glyphxscale\somefontsizex\relax}% todo: inserts relax
- \fi
- \ifempty\somefontsizey\else
- \edef\somefontsizey{\glyphyscale\somefontsizey\relax}%
- \fi
- \ifempty\fontclass\else\global\fi
- \mutable\protected\edefcsname#csname\endcsname
- {\setfontid\the\fontid\csname#csname\endcsname\relax
- \glyphscale\the\glyphscale\relax
- \somefontsizex
- \somefontsizey}%
- %
+ % experiment
+ \glyphxscale\ifempty\somefontsizex\plusthousand\else\somefontsizex\fi\relax
+ \glyphyscale\ifempty\somefontsizey\plusthousand\else\somefontsizey\fi\relax
+ % experiment
\expandafter\let\expandafter\lastrawfontcall\csname#csname\endcsname
- \the\everydefinefont
+ \ifrelax\lastrawfontcall
+ \lettonothing\somefontspec
+ \else
+ %
+ % \ifempty\fontclass\else\global\fi
+ % \mutable\protected\edefcsname#csname\endcsname
+ % {\setfontid\the\fontid\csname#csname\endcsname\relax
+ % \glyphscale\the\glyphscale\relax
+ % \somefontsizex
+ % \somefontsizey}%
+ % \expandafter\let\expandafter\lastrawfontcall\csname#csname\endcsname
+ %
+ % \mutable\protected\edef\lastrawfontcall
+ % {\setfontid\the\fontid\csname#csname\endcsname\relax
+ % \glyphscale\the\glyphscale\relax
+ % \somefontsizex
+ % \somefontsizey}%
+ % \mutable\ifempty\fontclass\letcsname\else\gletcsname\fi#csname\endcsname\lastrawfontcall
+ %
+ \mutable\fontspecdef\lastrawfontcall
+ \lastnamedcs
+ % scale \glyphscale
+ % xscale \glyphxscale
+ % yscale \glyphyscale
+ all \glyphscale \glyphxscale \glyphyscale
+ \relax
+ \mutable\ifempty\fontclass\letcsname\else\gletcsname\fi#csname\endcsname\lastrawfontcall
+ %
+ \the\everydefinefont
+ \fi
\fi
\c_font_feature_inheritance_mode\c_font_feature_inheritance_default}
@@ -980,7 +1040,7 @@
\newif\ifskipfontcharacteristics \skipfontcharacteristicstrue
-\tracingfonts\plussix % <id: name @ size>
+% \tracingfonts\plussix % <id: name @ size>
%D When fontclasses are used, we define the font global, since namespaces are
%D used. Otherwise we parse the specs each time.
@@ -996,8 +1056,8 @@
\newconstant\c_fonts_auto_language
-\letvalue{\??fontslanguage\v!auto}\plusone % experimental
-%letvalue{\??fontslanguage\v!yes }\plustwo % less efficient, for experiments
+\letcsname\??fontslanguage\v!auto\endcsname\plusone % experimental
+%letcsname\??fontslanguage\v!yes \endcsname\plustwo % less efficient, for experiments
\appendtoks
\c_fonts_auto_language
@@ -1104,7 +1164,7 @@
\newconditional\c_font_auto_size \settrue\c_font_auto_size
-\mutable\let\lastfontidentifier\empty
+\mutable\lettonothing\lastfontidentifier
\def\v_font_identifier_basic{\??fontinstancebasic \lastfontidentifier-\fontsize-\fontface}
\def\v_font_identifier_class{\??fontinstanceclass\fontclass-\lastfontidentifier-\fontsize-\fontface}
@@ -1115,14 +1175,15 @@
% \def\v_font_identifier_class{\??fontinstanceclass\fontclass-\lastfontidentifier-\fontstyle-\fontsize} % no \fontface
\def\font_basics_define_font_without_parameters#identifier#2%
- {\c_font_feature_inheritance_mode\c_font_feature_inheritance_fontonly
+ {\relax % intercept lookahead, in case we scan for a number
+ \c_font_feature_inheritance_mode\c_font_feature_inheritance_fontonly
\edef\lastfontidentifier{#identifier}%
\let\v_font_size_relative\v_font_rscale_default
\let\v_font_size_absolute\fontbody
\font_helpers_low_level_define{#2}\v_font_identifier_basic
\csname\v_font_identifier_basic\endcsname
\setfalse\c_font_auto_size
- \setfontcharacteristics
+ \the\everyfont % \setfontcharacteristics
\the\everyfontswitch
\let\v_font_identifier_basic\v_font_identifier_basic_saved}
@@ -1143,7 +1204,7 @@
\csname\v_font_identifier_class\endcsname
\setfalse\c_font_auto_size
\ifskipfontcharacteristics \else
- \setfontcharacteristics
+ \the\everyfont % \setfontcharacteristics
\the\everyfontswitch
\fi
\let\v_font_identifier_class\v_font_identifier_class_saved}
@@ -1152,7 +1213,7 @@
{\csname\v_font_identifier_class\endcsname
\setfalse\c_font_auto_size
\ifskipfontcharacteristics \else
- \setfontcharacteristics
+ \the\everyfont % \setfontcharacteristics
\the\everyfontswitch
\fi
\let\v_font_identifier_class\v_font_identifier_class_saved}
@@ -1207,7 +1268,7 @@
\ifcsname\??fontenvironments \s!default\s!text \endcsname\lastnamedcs\else
\csname\??fontenvironments \s!default \endcsname \fi}
-\setvalue{\??fontenvironments\s!default}{1}
+\defcsname\??fontenvironments\s!default\endcsname{1}
%D In the following macros we use \type {\currentxfontsize} to hold the current
%D x||size of the font. This enables us to support for instance \type {\sl} inside a
@@ -1302,10 +1363,10 @@
% todo: class:size
% todo: make assignments global
-\letvalue\??fontenvironments\empty % so we default to empty
+\letcsname\??fontenvironments\endcsname\empty % so we default to empty
\permanent\def\bodyfontvariable#parameter%
- {\csname\??fontenvironments
+ {\begincsname\??fontenvironments
\ifcsname\??fontenvironments\fontclass\normalizedbodyfontsize#parameter\endcsname\fontclass\normalizedbodyfontsize#parameter\orelse
\ifcsname\??fontenvironments\fontclass #parameter\endcsname\fontclass #parameter\orelse
\ifcsname\??fontenvironments \normalizedbodyfontsize#parameter\endcsname \normalizedbodyfontsize#parameter\orelse
@@ -1318,14 +1379,22 @@
\ifcsname\??fontenvironments \normalizedbodyfontsize#parameter\endcsname\lastnamedcs\orelse
\ifcsname\??fontenvironments\s!default #parameter\endcsname\lastnamedcs\fi}
-\permanent\def\bodyfontsizevariable#size#parameter%
- {\csname\??fontenvironments
+\permanent\def\bodyfontsizevariable#size#parameter% used in s-fonts-show
+ {\begincsname\??fontenvironments
\ifcsname\??fontenvironments\fontclass#size#parameter\endcsname\fontclass#size#parameter\orelse
\ifcsname\??fontenvironments\fontclass #parameter\endcsname\fontclass #parameter\orelse
+ \ifcsname\??fontenvironments\v!all #size#parameter\endcsname\v!all #size#parameter\orelse
\ifcsname\??fontenvironments #size#parameter\endcsname #size#parameter\orelse
\ifcsname\??fontenvironments\s!default #parameter\endcsname\s!default #parameter\fi
\endcsname}
+\def\font_bodyfontvariable#parameter%
+ {\ifcsname\??fontenvironments\fontclass\normalizedbodyfontsize#parameter\endcsname\lastnamedcs\orelse
+ \ifcsname\??fontenvironments\fontclass #parameter\endcsname\lastnamedcs\orelse
+ \ifcsname\??fontenvironments\v!all \normalizedbodyfontsize#parameter\endcsname\lastnamedcs\orelse
+ \ifcsname\??fontenvironments \normalizedbodyfontsize#parameter\endcsname\lastnamedcs\orelse
+ \ifcsname\??fontenvironments\s!default #parameter\endcsname\lastnamedcs\fi}
+
\def\font_bodyfontsizevariable#size#parameter%
{\ifcsname\??fontenvironments\fontclass#size#parameter\endcsname\lastnamedcs\orelse
\ifcsname\??fontenvironments\fontclass #parameter\endcsname\lastnamedcs\orelse
@@ -1389,13 +1458,13 @@
\def\font_basics_define_body_font_environment_empty[#body][#settings][#dummy]%
{\push_macro_fontclass
- \let\fontclass\empty
+ \lettonothing\fontclass
\font_basics_define_body_font_environment_class[][#body][#settings]%
\pop_macro_fontclass}
\def\font_basics_define_body_font_environment_unset[#body][#dummya][#dummyb]%
{\push_macro_fontclass
- \let\fontclass\empty
+ \lettonothing\fontclass
\font_basics_define_body_font_environment_class[][#body][]%
\pop_macro_fontclass}
@@ -1538,7 +1607,7 @@
\protected\def\font_basics_define_body_font_class_given[#1][#2][#3]#4%
{\push_macro_fontclass
\doifelse{#4}\s!default
- {\let\fontclass\empty}
+ {\lettonothing\fontclass}
{\def\fontclass{#4}}%
\definebodyfont[#1][#2][#3]%
\pop_macro_fontclass}
@@ -1652,6 +1721,8 @@
%D Here the rest concerns rl or lr so in this case it is not a size specifier but
%D a directional one.
+%D no need for the: one two rest
+
\protected\def\font_basics_define_body_font_nop_mm[#one#two#rest=#value]% local
{%\ifcsname\s!mm\endcsname\else\font_basics_check_fontname_combination\s!mm{#one#two}{#rest}\fi
\letcsname\??fontinstanceclass\m_font_asked_body-\s!mm-#one#two#rest-1\endcsname\undefined
@@ -1846,8 +1917,8 @@
\edef\m_font_step{\font_bodyfontvariable\m_font_keyword}%
\normalexpanded{\font_helpers_set_font_set_font_option_body{#method}{\m_font_step}{#message}}%
\orelse\ifx\m_font_keyword\v!reset
- \let\fontstyle\empty % new 31/7/2006
- \let\fontsize \empty
+ \lettonothing\fontstyle % new 31/7/2006
+ \lettonothing\fontsize
\orelse\ifcsname\??fontstyle\m_font_keyword\endcsname
\let\fontstyle\m_font_keyword
\else
@@ -1879,7 +1950,7 @@
% we need to check the fontclass
\permanent\def\registerfontclass#class%
- {\letgvalue{\??fontclassyes#class}\v!yes} % global ?
+ {\gletcsname\??fontclassyes#class\endcsname\v!yes} % global ?
\permanent\def\setcurrentfontclass#class%
{\ifcsname\??fontclassyes#class\endcsname
@@ -1897,11 +1968,6 @@
\fi
-% \let\defaultfontstyle \s!rm
-% \let\defaultfontalternative\s!tf
-% \let\defaultfontsize \empty
-% \let\defaultfontface \!!zerocount
-
%D So far for synchronisation. (We can inline the following macros.)
\permanent\protected\def\setcurrentfont#body#style#alternative#size% not used
@@ -1974,7 +2040,7 @@
\fi
\setfalse\c_font_auto_size
\ifskipfontcharacteristics
- \setfontcharacteristics
+ \the\everyfont % \setfontcharacteristics
\the\everyfontswitch
\fi}
@@ -2124,10 +2190,10 @@
{\font_helpers_check_nested_x_fontsize
\font_helpers_set_current_font_xxx_alternative{#alternative}{5}\scriptscriptstyle
\currentxfontsize\plustwo
- \enforced\let\tx\empty
- \enforced\let\txx\empty}
+ \enforced\lettonothing\tx
+ \enforced\lettonothing\txx}
-%D This alterative is not really needed, but for old time's sake we keep it there.
+%D This alternative is not really needed, but for old time's sake we keep it there.
%D We can speed it up when needed.
\def\font_helpers_set_current_font_x_style_alternative #alternative{\csname#alternative\endcsname\tx}
@@ -2159,7 +2225,7 @@
\newconditional\c_font_inherit_scale
-\def\font_scale_inherit#1%
+\def\font_scale_inherit_normal#1%
{\begingroup
\scratchcounterone\fontid\font\relax
\currentxfontsize\plusone
@@ -2170,35 +2236,94 @@
\scratchcounterthree\fontid\font\relax
% parent -> x -> xx
% parent -> xx
- %
- % this can become \integerdef
- %
- \global\expandafter\chardef\csname\??fontscalex \number\scratchcounterone\endcsname\scratchcountertwo
- \global\expandafter\chardef\csname\??fontscalexx\number\scratchcounterone\endcsname\scratchcounterthree
- \global\expandafter\chardef\csname\??fontscalex \number\scratchcountertwo\endcsname\scratchcounterthree
- \global\expandafter\chardef\csname\??fontscalexx\number\scratchcountertwo\endcsname\scratchcounterthree
+ \global\expandafter\integerdef\csname\??fontscalex \number\scratchcounterone\endcsname\scratchcountertwo
+ \global\expandafter\integerdef\csname\??fontscalexx\number\scratchcounterone\endcsname\scratchcounterthree
+ \global\expandafter\integerdef\csname\??fontscalex \number\scratchcountertwo\endcsname\scratchcounterthree
+ \global\expandafter\integerdef\csname\??fontscalexx\number\scratchcountertwo\endcsname\scratchcounterthree
\endgroup
\setfontid\csname#1\number\fontid\font\endcsname}
-\def\font_scale_inherit_x
+\def\font_scale_inherit_normal_x
{\ifcsname\??fontscalex\number\fontid\font\endcsname
\setfontid\lastnamedcs
\else
- \font_scale_inherit\??fontscalex
+ \font_scale_inherit_normal\??fontscalex
\fi
\ifskipfontcharacteristics
- \setfontcharacteristics
+ \the\everyfont % \setfontcharacteristics
\the\everyfontswitch
\fi}
-\def\font_scale_inherit_xx
+\def\font_scale_inherit_normal_xx
{\ifcsname\??fontscalexx\number\fontid\font\endcsname
\setfontid\lastnamedcs
\else
- \font_scale_inherit\??fontscalexx
+ \font_scale_inherit_normal\??fontscalexx
+ \fi
+ \ifskipfontcharacteristics
+ \the\everyfont % \setfontcharacteristics
+ \the\everyfontswitch
+ \fi}
+
+\def\font_scale_inherit_compact#1%
+ {\begingroup
+ \scratchcounterone\fontid\font\relax
+ \currentxfontsize\plusone
+ \scratchcountertwo\numericscale\font_currentfontscale
+ \currentxfontsize\plustwo
+ \scratchcounterthree\numericscale\font_currentfontscale
+ % parent -> x -> xx
+ % parent -> xx
+ \global\expandafter\fontspecdef\csname\??fontscalex \number\scratchcounterone:\number\glyphscale\endcsname
+ \scratchcounterone
+ scale \numexpr\glyphscale*\scratchcountertwo/1000\relax
+ % scale \glyphscale
+ % xscale \scratchcountertwo
+ % yscale \scratchcountertwo
+ \relax
+ \global\expandafter\fontspecdef\csname\??fontscalexx\number\scratchcounterone:\number\glyphscale\endcsname
+ \scratchcounterone
+ scale \numexpr\glyphscale*\scratchcounterthree/1000\relax
+ % scale \glyphscale
+ % xscale \scratchcounterthree
+ % yscale \scratchcounterthree
+ \relax
+ \global\expandafter\fontspecdef\csname\??fontscalex \number\scratchcountertwo:\number\glyphscale\endcsname
+ \scratchcounterone
+ scale \numexpr\glyphscale*\scratchcounterthree/1000\relax
+ % scale \glyphscale
+ % xscale \scratchcounterthree
+ % yscale \scratchcounterthree
+ \relax
+ \global\expandafter\fontspecdef\csname\??fontscalexx\number\scratchcountertwo:\number\glyphscale\endcsname
+ \scratchcounterone
+ scale \numexpr\glyphscale*\scratchcounterthree/1000\relax
+ % scale \glyphscale
+ % xscale \scratchcounterthree
+ % yscale \scratchcounterthree
+ \relax
+ \endgroup
+ \csname#1\number\fontid\font:\number\glyphscale\endcsname}
+
+\def\font_scale_inherit_compact_x
+ {\ifcsname\??fontscalex\number\fontid\font:\number\glyphscale\endcsname
+ \lastnamedcs
+ \else
+ \font_scale_inherit_compact\??fontscalex
+ \fi
+ \ifskipfontcharacteristics
+ \the\everyfont % \setfontcharacteristics
+ \the\everyfontswitch
+ \fi}
+
+\def\font_scale_inherit_compact_xx
+ {\ifcsname\??fontscalexx\number\fontid\font:\number\glyphscale\endcsname
+ \lastnamedcs
+ \else
+ \font_scale_inherit_compact\??fontscalexx
\fi
\ifskipfontcharacteristics
- \setfontcharacteristics
+ \the\everyfont % \setfontcharacteristics
\the\everyfontswitch
\fi}
@@ -2219,7 +2344,11 @@
\ifmmode
\scriptstyle
\orelse\ifconditional\c_font_inherit_scale
- \font_scale_inherit_x
+ \ifconditional\c_font_compact
+ \font_scale_inherit_compact_x
+ \else
+ \font_scale_inherit_normal_x
+ \fi
\else
\font_scale_defined_x
\fi
@@ -2230,19 +2359,27 @@
\ifmmode
\scriptscriptstyle
\orelse\ifconditional\c_font_inherit_scale
- \font_scale_inherit_xx
+ \ifconditional\c_font_compact
+ \font_scale_inherit_compact_xx
+ \else
+ \font_scale_inherit_normal_xx
+ \fi
\else
\font_scale_defined_xx
\fi
- \enforced\let\tx \empty
- \enforced\let\txx\empty}
+ \enforced\lettonothing\tx
+ \enforced\lettonothing\txx}
\permanent\protected\def\sx
{\currentxfontsize\plusone
\ifmmode
\scriptstyle
\else
- \font_scale_inherit_x
+ \ifconditional\c_font_compact
+ \font_scale_inherit_compact_x
+ \else
+ \font_scale_inherit_normal_x
+ \fi
\fi
\enforced\let\tx\txx
\enforced\let\sx\sxx}
@@ -2252,12 +2389,16 @@
\ifmmode
\scriptscriptstyle
\else
- \font_scale_inherit_xx
+ \ifconditional\c_font_compact
+ \font_scale_inherit_compact_xx
+ \else
+ \font_scale_inherit_normal_xx
+ \fi
\fi
- \enforced\let\tx \empty
- \enforced\let\txx\empty
- \enforced\let\sx \empty
- \enforced\let\sxx\empty}
+ \enforced\lettonothing\tx
+ \enforced\lettonothing\txx
+ \enforced\lettonothing\sx
+ \enforced\lettonothing\sxx}
\permanent\protected\def\useinheritxsizes{\settrue \c_font_inherit_scale} % not yet public, playground for WS and me
\permanent\protected\def\usedefinedxsizes{\setfalse\c_font_inherit_scale} % not yet public, playground for WS and me
@@ -2274,6 +2415,8 @@
%D math families and finally we activate the default typeface and also set the font
%D specific parameters assigned to \type {\everybodyfont}.
+% todo: per class
+
\permanent\protected\def\textface {\currentbodyfontdimension\s!text }
\permanent\protected\def\scriptface {\currentbodyfontdimension\s!script }
\permanent\protected\def\scriptscriptface{\currentbodyfontdimension\s!scriptscript}
@@ -2301,6 +2444,28 @@
}%
\gletcsname\??fontbodyfaces\fontbody\endcsname\font_basics_set_faces}
+% \permanent\def\currentbodyfontdimension#parameter% there can be factors here
+% {\the\dimexpr
+% \ifcsname\??fontenvironments\fontclass\normalizedbodyfontsize#parameter\endcsname
+% \lastnamedcs
+% \orelse\ifcsname\??fontenvironments\fontclass\s!default#parameter\endcsname
+% \lastnamedcs
+% \dimexpr\normalizedbodyfontsize\relax
+% \orelse\ifcsname\??fontenvironments\normalizedbodyfontsize#parameter\endcsname
+% \lastnamedcs
+% \else
+% \csname\??fontenvironments\s!default#parameter\endcsname
+% \dimexpr\normalizedbodyfontsize\relax
+% \fi
+% \relax}
+
+% \setupbodyfontenvironment [all] [12pt] [x=4pt,small=4pt]
+% \setupbodyfontenvironment [pagella] [12pt] [x=4pt,small=4pt]
+%
+% \setupbodyfont[pagella,12pt]
+%
+% \starttext normal {\tx tx} {\small small} \stoptext
+
\permanent\def\currentbodyfontdimension#parameter% there can be factors here
{\the\dimexpr
\ifcsname\??fontenvironments\fontclass\normalizedbodyfontsize#parameter\endcsname
@@ -2308,6 +2473,8 @@
\orelse\ifcsname\??fontenvironments\fontclass\s!default#parameter\endcsname
\lastnamedcs
\dimexpr\normalizedbodyfontsize\relax
+ \orelse\ifcsname\??fontenvironments\v!all\normalizedbodyfontsize#parameter\endcsname
+ \lastnamedcs
\orelse\ifcsname\??fontenvironments\normalizedbodyfontsize#parameter\endcsname
\lastnamedcs
\else
@@ -2614,23 +2781,28 @@
\protected\def\font_basics_predefined#1%
{\font_basics_predefine{\??predefinedfont#1}{#1}}
-%D Handy helper:
-
-\permanent\protected\def\savedefinedfont[#1]% hm, how about scales
- {\bgroup
- \definedfont[#1]%
- \xdef\saveddefinedfontid {\number\fontid\font}%
- \xdef\saveddefinedfontname{\fontname\font}%
- \egroup}
-
-\mutable\def\saveddefinedfontid {\number\fontid\font}
-\mutable\def\saveddefinedfontname{\fontname\font}
+% %D Handy helper:
+%
+% % not used and also not okay wrt scales
+%
+% \permanent\protected\def\savedefinedfont[#1]% hm, how about scales
+% {\bgroup
+% \definedfont[#1]%
+% \xdef\saveddefinedfontid {\number\fontid\font}%
+% \xdef\saveddefinedfontname{\fontname\font}%
+% \egroup}
+%
+% \mutable\def\saveddefinedfontid {\number\fontid\font}
+% \mutable\def\saveddefinedfontname{\fontname\font}
%D Ugly helper:
\permanent\protected\def\saverunningstyleandcolor
{\enforced\permanent\protected\edef\restorerunningstyleandcolor
{\setfontid \number\fontid\font
+ \glyphscale \the\glyphscale
+ \glyphxscale \the\glyphxscale
+ \glyphyscale \the\glyphyscale
\c_attr_colormodel \the\c_attr_colormodel
\c_attr_color \the\c_attr_color
\c_attr_transparency\the\c_attr_transparency
@@ -2690,4 +2862,32 @@
\permanent\protected\def\usefontpath[#1]%
{\clf_addfontpath{#1}}
+%D Experiment (one can use a list):
+%D
+%D \starttyping
+%D \setupfonts
+%D [serif=dejavuserif*default,
+%D sans=dejavusans*default,
+%D mono=dejavusansmono*none]
+%D
+%D {\rm A \char1234\ B \char1236\ C}
+%D {\ss A \char1234\ B \char1236\ C}
+%D {\ss A \char1234\ B \char1236\ C}
+%D \stoptyping
+
+\appendtoks
+ \edef\m_list{\fontsparameter\s!serif}%
+ \ifempty\m_list\else
+ \registerfallbackfont[\s!serif][\m_list]%
+ \fi
+ \edef\m_list{\fontsparameter\s!sans}%
+ \ifempty\m_list\else
+ \registerfallbackfont[\s!sans][\m_list]%
+ \fi
+ \edef\m_list{\fontsparameter\s!mono}%
+ \ifempty\m_list\else
+ \registerfallbackfont[\s!mono][\m_list]%
+ \fi
+\to \everysetupfonts
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-lib.mklx b/Master/texmf-dist/tex/context/base/mkxl/font-lib.mklx
index 72c2d4ba9f5..6caf1daf8df 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-lib.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-lib.mklx
@@ -15,54 +15,71 @@
\unprotect
+\newinteger\scaledfontmode
+\newinteger\scaledfontsize
+\newinteger\lastfontid
+
+\newinteger\c_font_future_glyph_scale
+\newinteger\c_font_scaled_font_mode_saved
+\newinteger\c_font_scaled_points
+
+\ifdefined\globalbodyfontsize \else \newdimension\globalbodyfontsize \fi
+\ifdefined\localbodyfontsize \else \newdimension\localbodyfontsize \fi
+\ifdefined\bodyfontsize \else \newdimension\bodyfontsize \fi
+
\registerctxluafile{font-ini}{autosuffix}
\registerctxluafile{font-log}{}
\registerctxluafile{font-con}{autosuffix} % kind of early
%registerctxluafile{font-cft}{}
\registerctxluafile{font-enc}{}
\registerctxluafile{font-fmp}{autosuffix}
-\registerctxluafile{font-agl}{} % if needed we can comment this and delay loading
-\registerctxluafile{font-cid}{} % cid maps
-\registerctxluafile{font-map}{optimize}
+\registerctxluafile{font-agl}{} % if needed we can comment this and delay loading
+\registerctxluafile{font-cid}{} % cid maps
+\registerctxluafile{font-map}{}
% helpers
-\registerctxluafile{font-otr}{optimize} % opentype fontloader
-\registerctxluafile{font-web}{} % opentype fontloader
-\registerctxluafile{font-cff}{optimize} % quadratic outlines
-\registerctxluafile{font-ttf}{optimize} % cubic outlines
-\registerctxluafile{font-dsp}{optimize} % ... for this one
-\registerctxluafile{font-hsh}{} % hashes used by context
-\registerctxluafile{font-vir}{}
+\registerctxluafile{font-otr}{} % opentype fontloader
+\registerctxluafile{font-web}{} % opentype fontloader
+\registerctxluafile{font-cff}{autosuffix} % quadratic outlines
+\registerctxluafile{font-ttf}{autosuffix} % cubic outlines
+\registerctxluafile{font-dsp}{autosuffix}
+\registerctxluafile{font-hsh}{autosuffix} % hashes used by context
\registerctxluafile{font-vfc}{autosuffix}
-\registerctxluafile{font-prv}{} % needs hashes
-\registerctxluafile{font-nod}{optimize}
-\registerctxluafile{font-oti}{} % otf initialization
-\registerctxluafile{font-ott}{} % otf tables (first)
-\registerctxluafile{font-otl}{}
+\registerctxluafile{font-prv}{} % needs hashes
+\registerctxluafile{font-vir}{}
+\registerctxluafile{font-nod}{}
+\registerctxluafile{font-oti}{} % otf initialization
+\registerctxluafile{font-ott}{} % otf tables (first)
+\registerctxluafile{font-otl}{autosuffix}
\registerctxluafile{font-oto}{}
-\registerctxluafile{font-otj}{autosuffix,optimize}
+\registerctxluafile{font-otj}{autosuffix}
\registerctxluafile{font-oup}{}
\registerctxluafile{font-ota}{autosuffix}
-% \registerctxluafile{font-ots-pre-scale}{autosuffix,optimize}
-\registerctxluafile{font-ots}{autosuffix,optimize}
-\registerctxluafile{font-otd}{optimize}
+\registerctxluafile{font-ots}{autosuffix}
+\registerctxluafile{font-otd}{autosuffix}
\registerctxluafile{font-otc}{}
\registerctxluafile{font-oth}{}
-\registerctxluafile{font-osd}{}
+% \doifelsefileexists{font-osd-new.lmt}{
+% \registerctxluafile{font-osd-new}{autosuffix}
+% } {
+ \registerctxluafile{font-osd}{}
+% }
%registerctxluafile{font-osm}{}
\registerctxluafile{font-ogr}{autosuffix}
% we use otf code for type one
-\registerctxluafile{font-onr}{optimize}
-\registerctxluafile{font-one}{optimize}
+\registerctxluafile{font-onr}{autosuffix}
+\registerctxluafile{font-one}{autosuffix}
\registerctxluafile{font-afk}{}
+\registerctxluafile{font-txt}{autosuffix}
+
% tfm
-\registerctxluafile{font-tpk}{optimize}
-\registerctxluafile{font-tfm}{}
+\registerctxluafile{font-tpk}{autosuffix}
+\registerctxluafile{font-tfm}{autosuffix}
% name database
@@ -79,14 +96,12 @@
\registerctxluafile{node-fnt}{autosuffix} % here
-\registerctxluafile{font-mps}{autosuffix} % outline fun
-
\registerctxluafile{font-lua}{}
\registerctxluafile{font-enh}{autosuffix}
\registerctxluafile{good-ini}{}
-\registerctxluafile{good-gen}{}
+\registerctxluafile{good-gen}{autosuffix}
\registerctxluafile{good-ctx}{}
\registerctxluafile{good-mth}{autosuffix}
@@ -95,26 +110,25 @@
% extensions, order matters
-\registerctxluafile{font-imp-ligatures}{}
+\registerctxluafile{font-imp-checks}{autosuffix}
+\registerctxluafile{font-imp-ligatures}{autosuffix}
\registerctxluafile{font-imp-tex}{}
\registerctxluafile{font-imp-reorder}{}
-\registerctxluafile{font-imp-properties}{}
+\registerctxluafile{font-imp-properties}{autosuffix}
\registerctxluafile{font-imp-unicode}{}
+\registerctxluafile{font-imp-text}{autosuffix}
\registerctxluafile{font-imp-math}{autosuffix}
\registerctxluafile{font-imp-notused}{}
-\registerctxluafile{font-imp-effects}{}
-\registerctxluafile{font-imp-quality}{}
+\registerctxluafile{font-imp-effects}{autosuffix}
+\registerctxluafile{font-imp-quality}{autosuffix}
\registerctxluafile{font-imp-italics}{}
\registerctxluafile{font-imp-dimensions}{}
\registerctxluafile{font-imp-spacekerns}{}
\registerctxluafile{font-imp-tweaks}{}
\registerctxluafile{font-imp-combining}{}
-
-\doifelsefileexists{font-imp-scripts.lua} {
- \registerctxluafile{font-imp-scripts}{}
-} {
- % not yet, lmtx feature
-}
+\registerctxluafile{font-imp-scripts}{autosuffix}
+\registerctxluafile{font-imp-sanitize}{autosuffix} % fixes for indic fonts
+\registerctxluafile{font-imp-digits}{autosuffix}
\registerctxluafile{font-imp-tracing}{autosuffix} % comes last!
@@ -122,7 +136,7 @@
\registerctxluafile{font-aux}{}
-\registerctxluafile{font-lig}{} % only for experiments so try to avoid it
+\registerctxluafile{font-lig}{autosuffix} % only for experiments so try to avoid it
%D Some low level helpers
%D
@@ -153,4 +167,14 @@
\permanent \def\cleanfontname #1{\clf_cleanfontname{#1}}
\permanent\protected\def\setfontofid #1{\clf_setfontofid\numexpr#1\relax}
+%D I have to put it someplace, so here:
+%D
+%D \starttyping
+%D \definefontfeature[test][mode=plug,features=text]
+%D \definefont[FontA][Serif*test]
+%D \definefont[FontB][Serif*test]
+%D {\FontA aaa}{\FontB\glyphscale 1200 bbb}
+%D {\FontA aaa}{\FontB\glyphscale 1200 bbb}
+%D \stoptyping
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-lig.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-lig.lmt
new file mode 100644
index 00000000000..9a68b4697d3
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-lig.lmt
@@ -0,0 +1,41 @@
+if not modules then modules = { } end modules ['font-lig'] = {
+ version = 1.001,
+ comment = "companion to font-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files",
+}
+
+-- We keep this for compatibility reasons and demonstration purposes. We delay
+-- definition of the data table in order to save some memory.
+
+-- data['c'] = { 'a', 'b' }
+-- data['d'] = { 'c', 'c' }
+
+local next = next
+local setmetatableindex = table.setmetatableindex
+
+local data = { }
+
+setmetatableindex(data,function(t,k)
+ for first, seconds in next, characters.graphemes do
+ for second, combined in next, seconds do
+ data[combined] = { first, second }
+ end
+ end
+ setmetatableindex(data)
+ return t[k]
+end)
+
+local feature = {
+ name = "collapse",
+ type = "ligature",
+ prepend = true,
+ dataset = {
+ { data = data }, -- twice ?
+ { data = data },
+ }
+}
+
+-----.handlers.afm.addfeature(feature)
+fonts.handlers.otf.addfeature(feature)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-map.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-map.lmt
new file mode 100644
index 00000000000..be132138453
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-map.lmt
@@ -0,0 +1,518 @@
+if not modules then modules = { } end modules ['font-map'] = {
+ version = 1.001,
+ optimize = true,
+ comment = "companion to font-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local tonumber, next, type = tonumber, next, type
+
+local match, format, find, concat, gsub, lower = string.match, string.format, string.find, table.concat, string.gsub, string.lower
+local P, R, S, C, Ct, Cc, lpegmatch = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Ct, lpeg.Cc, lpeg.match
+local formatters = string.formatters
+local sortedhash, sortedkeys = table.sortedhash, table.sortedkeys
+
+local trace_loading = false trackers.register("fonts.loading", function(v) trace_loading = v end)
+local trace_mapping = false trackers.register("fonts.mapping", function(v) trace_mapping = v end)
+
+local report_fonts = logs.reporter("fonts","loading") -- not otf only
+
+-- force_ligatures was true for a while so that these emoji's with bad names work too
+
+local force_ligatures = false directives.register("fonts.mapping.forceligatures",function(v) force_ligatures = v end)
+
+local fonts = fonts or { }
+local mappings = fonts.mappings or { }
+fonts.mappings = mappings
+
+local allocate = utilities.storage.allocate
+
+local hex = R("AF","af","09")
+local hexfour = (hex*hex*hex^-2) / function(s) return tonumber(s,16) end
+local hexsix = (hex*hex*hex^-4) / function(s) return tonumber(s,16) end
+local dec = (R("09")^1) / tonumber
+local period = P(".")
+local unicode = (P("uni") + P("UNI")) * (hexfour * (period + P(-1)) * Cc(false) + Ct(hexfour^1) * Cc(true)) -- base planes
+local ucode = (P("u") + P("U") ) * (hexsix * (period + P(-1)) * Cc(false) + Ct(hexsix ^1) * Cc(true)) -- extended
+local index = P("index") * dec * Cc(false)
+
+local parser = unicode + ucode + index
+local parsers = { }
+
+local function makenameparser(str)
+ if not str or str == "" then
+ return parser
+ else
+ local p = parsers[str]
+ if not p then
+ p = P(str) * period * dec * Cc(false)
+ parsers[str] = p
+ end
+ return p
+ end
+end
+
+local f_single = formatters["%04X"]
+local f_double = formatters["%04X%04X"]
+local s_unknown = "FFFD"
+
+local function tounicode16(unicode)
+ if unicode < 0xD7FF or (unicode > 0xDFFF and unicode <= 0xFFFF) then
+ return f_single(unicode)
+ elseif unicode >= 0x00E000 and unicode <= 0x00F8FF then
+ return s_unknown
+ elseif unicode >= 0x0F0000 and unicode <= 0x0FFFFF then
+ return s_unknown
+ elseif unicode >= 0x100000 and unicode <= 0x10FFFF then
+ return s_unknown
+ elseif unicode >= 0x00D800 and unicode <= 0x00DFFF then
+ return s_unknown
+ else
+ unicode = unicode - 0x10000
+ return f_double((k//0x400)+0xD800,unicode%0x400+0xDC00)
+ end
+end
+
+local function tounicode16sequence(unicodes)
+ local t = { }
+ for l=1,#unicodes do
+ local u = unicodes[l]
+ if u < 0xD7FF or (u > 0xDFFF and u <= 0xFFFF) then
+ t[l] = f_single(u)
+ elseif unicode >= 0x00E000 and unicode <= 0x00F8FF then
+ t[l] = s_unknown
+ elseif unicode >= 0x0F0000 and unicode <= 0x0FFFFF then
+ t[l] = s_unknown
+ elseif unicode >= 0x100000 and unicode <= 0x10FFFF then
+ t[l] = s_unknown
+ -- elseif unicode >= 0x00D800 and unicode <= 0x00DFFF then
+ elseif unicode >= 0x00D7FF and unicode <= 0x00DFFF then
+ t[l] = s_unknown
+ else
+ u = u - 0x10000
+ t[l] = f_double((k//0x400)+0xD800,u%0x400+0xDC00)
+ end
+ end
+ return concat(t)
+end
+
+
+local hash = { }
+local conc = { }
+
+table.setmetatableindex(hash,function(t,k)
+ local v
+ if k < 0xD7FF or (k > 0xDFFF and k <= 0xFFFF) then
+ v = f_single(k)
+ else
+ local k = k - 0x10000
+ v = f_double((k//0x400)+0xD800,k%0x400+0xDC00)
+ end
+ t[k] = v
+ return v
+end)
+
+local function tounicode(k)
+ if type(k) == "table" then
+ local n = #k
+ for l=1,n do
+ conc[l] = hash[k[l]]
+ end
+ return concat(conc,"",1,n)
+ elseif k >= 0x00E000 and k <= 0x00F8FF then
+ return s_unknown
+ elseif k >= 0x0F0000 and k <= 0x0FFFFF then
+ return s_unknown
+ elseif k >= 0x100000 and k <= 0x10FFFF then
+ return s_unknown
+ -- elseif k >= 0x00D800 and k <= 0x00DFFF then
+ elseif k >= 0x00D7FF and k <= 0x00DFFF then
+ return s_unknown
+ else
+ return hash[k]
+ end
+end
+
+local function fromunicode16(str)
+ if #str == 4 then
+ return tonumber(str,16)
+ else
+ local l, r = match(str,"(....)(....)")
+ return 0x10000 + (tonumber(l,16)-0xD800)*0x400 + tonumber(r,16) - 0xDC00
+ end
+end
+
+-- Slightly slower:
+--
+-- local p = C(4) * (C(4)^-1) / function(l,r)
+-- if r then
+-- return (tonumber(l,16))*0x400 + tonumber(r,16) - 0xDC00
+-- else
+-- return tonumber(l,16)
+-- end
+-- end
+--
+-- local function fromunicode16(str)
+-- return lpegmatch(p,str)
+-- end
+
+mappings.makenameparser = makenameparser
+mappings.tounicode = tounicode
+mappings.tounicode16 = tounicode16
+mappings.tounicode16sequence = tounicode16sequence
+mappings.fromunicode16 = fromunicode16
+
+-- mozilla emoji has bad lig names: name = gsub(name,"(u[a-f0-9_]+)%-([a-f0-9_]+)","%1_%2")
+
+local ligseparator = P("_")
+local varseparator = P(".")
+local namesplitter = Ct(C((1 - ligseparator - varseparator)^1) * (ligseparator * C((1 - ligseparator - varseparator)^1))^0)
+
+-- maybe: ff fi fl ffi ffl => f_f f_i f_l f_f_i f_f_l
+
+-- local function test(name)
+-- local split = lpegmatch(namesplitter,name)
+-- print(string.formatters["%s: [% t]"](name,split))
+-- end
+
+-- test("i.f_")
+-- test("this")
+-- test("this.that")
+-- test("japan1.123")
+-- test("such_so_more")
+-- test("such_so_more.that")
+
+-- to be completed .. for fonts that use unicodes for ligatures which
+-- is a actually a bad thing and should be avoided in the first place
+
+do
+
+ local overloads = {
+ IJ = { name = "I_J", unicode = { 0x49, 0x4A }, mess = 0x0132 },
+ ij = { name = "i_j", unicode = { 0x69, 0x6A }, mess = 0x0133 },
+ ff = { name = "f_f", unicode = { 0x66, 0x66 }, mess = 0xFB00 },
+ fi = { name = "f_i", unicode = { 0x66, 0x69 }, mess = 0xFB01 },
+ fl = { name = "f_l", unicode = { 0x66, 0x6C }, mess = 0xFB02 },
+ ffi = { name = "f_f_i", unicode = { 0x66, 0x66, 0x69 }, mess = 0xFB03 },
+ ffl = { name = "f_f_l", unicode = { 0x66, 0x66, 0x6C }, mess = 0xFB04 },
+ fj = { name = "f_j", unicode = { 0x66, 0x6A } },
+ fk = { name = "f_k", unicode = { 0x66, 0x6B } },
+
+ -- endash = { name = "endash", unicode = 0x2013, mess = 0x2013 },
+ -- emdash = { name = "emdash", unicode = 0x2014, mess = 0x2014 },
+ }
+
+ local o = allocate { }
+
+ for k, v in next, overloads do
+ local name = v.name
+ local mess = v.mess
+ if name then
+ o[name] = v
+ end
+ if mess then
+ o[mess] = v
+ end
+ o[k] = v
+ end
+
+ mappings.overloads = o
+
+end
+
+function mappings.addtounicode(data,filename,checklookups,forceligatures)
+ local resources = data.resources
+ local unicodes = resources.unicodes
+ if not unicodes then
+ if trace_mapping then
+ report_fonts("no unicode list, quitting tounicode for %a",filename)
+ end
+ return
+ end
+ local properties = data.properties
+ local descriptions = data.descriptions
+ local overloads = mappings.overloads
+ -- we need to move this code
+ unicodes['space'] = unicodes['space'] or 32
+ unicodes['hyphen'] = unicodes['hyphen'] or 45
+ unicodes['zwj'] = unicodes['zwj'] or 0x200D
+ unicodes['zwnj'] = unicodes['zwnj'] or 0x200C
+ --
+ local private = fonts.constructors and fonts.constructors.privateoffset or 0xF0000 -- 0x10FFFF
+ local unicodevector = fonts.encodings.agl.unicodes or { } -- loaded runtime in context
+ local contextvector = fonts.encodings.agl.ctxcodes or { } -- loaded runtime in context
+ local missing = { }
+ local nofmissing = 0
+ local oparser = nil
+ local cidnames = nil
+ local cidcodes = nil
+ local cidinfo = properties.cidinfo
+ local usedmap = cidinfo and fonts.cid.getmap(cidinfo)
+ local uparser = makenameparser() -- hm, every time?
+ if usedmap then
+ oparser = usedmap and makenameparser(cidinfo.ordering)
+ cidnames = usedmap.names
+ cidcodes = usedmap.unicodes
+ end
+ local ns = 0
+ local nl = 0
+ --
+ -- in order to avoid differences between runs due to hash randomization we
+ -- run over a sorted list
+ --
+ local dlist = sortedkeys(descriptions)
+ --
+ -- for du, glyph in next, descriptions do
+ for i=1,#dlist do
+ local du = dlist[i]
+ local glyph = descriptions[du]
+ local name = glyph.name
+ if name then
+ local overload = overloads[name] or overloads[du]
+ if overload then
+ -- get rid of weird ligatures
+ -- glyph.name = overload.name
+ glyph.unicode = overload.unicode
+ else
+ local gu = glyph.unicode -- can already be set (number or table)
+ if not gu or gu == -1 or du >= private or (du >= 0xE000 and du <= 0xF8FF) or du == 0xFFFE or du == 0xFFFF then
+ local unicode = unicodevector[name] or contextvector[name]
+ if unicode then
+ glyph.unicode = unicode
+ ns = ns + 1
+ end
+ -- cidmap heuristics, beware, there is no guarantee for a match unless
+ -- the chain resolves
+ if (not unicode) and usedmap then
+ local foundindex = lpegmatch(oparser,name)
+ if foundindex then
+ unicode = cidcodes[foundindex] -- name to number
+ if unicode then
+ glyph.unicode = unicode
+ ns = ns + 1
+ else
+ local reference = cidnames[foundindex] -- number to name
+ if reference then
+ local foundindex = lpegmatch(oparser,reference)
+ if foundindex then
+ unicode = cidcodes[foundindex]
+ if unicode then
+ glyph.unicode = unicode
+ ns = ns + 1
+ end
+ end
+ if not unicode or unicode == "" then
+ local foundcodes, multiple = lpegmatch(uparser,reference)
+ if foundcodes then
+ glyph.unicode = foundcodes
+ if multiple then
+ nl = nl + 1
+ unicode = true
+ else
+ ns = ns + 1
+ unicode = foundcodes
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ -- a.whatever or a_b_c.whatever or a_b_c (no numbers) a.b_
+ --
+ -- It is not trivial to find a solution that suits all fonts. We tried several alternatives
+ -- and this one seems to work reasonable also with fonts that use less standardized naming
+ -- schemes. The extra private test is tested by KE and seems to work okay with non-typical
+ -- fonts as well.
+ --
+ if not unicode or unicode == "" then
+ local split = lpegmatch(namesplitter,name)
+ local nsplit = split and #split or 0 -- add if
+ if nsplit == 0 then
+ -- skip
+ elseif nsplit == 1 then
+ local base = split[1]
+ local u = unicodes[base] or unicodevector[base] or contextvector[name]
+ if not u then
+ -- skip
+ elseif type(u) == "table" then
+ -- unlikely
+ if u[1] < private then
+ unicode = u
+ glyph.unicode = unicode
+ end
+ elseif u < private then
+ unicode = u
+ glyph.unicode = unicode
+ end
+ else
+ local t = { }
+ local n = 0
+ for l=1,nsplit do
+ local base = split[l]
+ local u = unicodes[base] or unicodevector[base] or contextvector[name]
+ if not u then
+ break
+ elseif type(u) == "table" then
+ if u[1] >= private then
+ break
+ end
+ n = n + 1
+ t[n] = u[1]
+ else
+ if u >= private then
+ break
+ end
+ n = n + 1
+ t[n] = u
+ end
+ end
+ if n > 0 then
+ if n == 1 then
+ unicode = t[1]
+ else
+ unicode = t
+ end
+ glyph.unicode = unicode
+ end
+ end
+ nl = nl + 1
+ end
+ -- last resort (we might need to catch private here as well)
+ if not unicode or unicode == "" then
+ local foundcodes, multiple = lpegmatch(uparser,name)
+ if foundcodes then
+ glyph.unicode = foundcodes
+ if multiple then
+ nl = nl + 1
+ unicode = true
+ else
+ ns = ns + 1
+ unicode = foundcodes
+ end
+ end
+ end
+ -- check using substitutes and alternates
+ local r = overloads[unicode]
+ if r then
+ unicode = r.unicode
+ glyph.unicode = unicode
+ end
+ --
+ if not unicode then
+ missing[du] = true
+ nofmissing = nofmissing + 1
+ end
+ else
+ -- maybe a message or so
+ end
+ end
+ else
+ local overload = overloads[du]
+ if overload then
+ glyph.unicode = overload.unicode
+ elseif not glyph.unicode then
+ missing[du] = true
+ nofmissing = nofmissing + 1
+ end
+ end
+ end
+ if type(checklookups) == "function" then
+ checklookups(data,missing,nofmissing)
+ end
+
+ local unicoded = 0
+ local collected = fonts.handlers.otf.readers.getcomponents(data) -- neglectable overhead
+
+ local function resolve(glyph,u)
+ local n = #u
+ for i=1,n do
+ if u[i] > private then
+ n = 0
+ break
+ end
+ end
+ if n > 0 then
+ if n > 1 then
+ glyph.unicode = u
+ else
+ glyph.unicode = u[1]
+ end
+ unicoded = unicoded + 1
+ end
+ end
+
+ if not collected then
+ -- move on
+ elseif forceligatures or force_ligatures then
+ for i=1,#dlist do
+ local du = dlist[i]
+ if du >= private or (du >= 0xE000 and du <= 0xF8FF) then
+ local u = collected[du] -- always tables
+ if u then
+ resolve(descriptions[du],u)
+ end
+ end
+ end
+ else
+ for i=1,#dlist do
+ local du = dlist[i]
+ if du >= private or (du >= 0xE000 and du <= 0xF8FF) then
+ local glyph = descriptions[du]
+ if glyph.class == "ligature" and not glyph.unicode then
+ local u = collected[du] -- always tables
+ if u then
+ resolve(glyph,u)
+ end
+ end
+ end
+ end
+ end
+
+ if trace_mapping and unicoded > 0 then
+ report_fonts("%n ligature tounicode mappings deduced from gsub ligature features",unicoded)
+ end
+ if trace_mapping then
+ -- for unic, glyph in sortedhash(descriptions) do
+ for i=1,#dlist do
+ local du = dlist[i]
+ local glyph = descriptions[du]
+ local name = glyph.name or "-"
+ local index = glyph.index or 0
+ local unicode = glyph.unicode
+ if unicode then
+ if type(unicode) == "table" then
+ local unicodes = { }
+ for i=1,#unicode do
+ unicodes[i] = formatters("%U",unicode[i])
+ end
+ report_fonts("internal slot %U, name %a, unicode %U, tounicode % t",index,name,du,unicodes)
+ else
+ report_fonts("internal slot %U, name %a, unicode %U, tounicode %U",index,name,du,unicode)
+ end
+ else
+ report_fonts("internal slot %U, name %a, unicode %U",index,name,du)
+ end
+ end
+ end
+ if trace_loading and (ns > 0 or nl > 0) then
+ report_fonts("%s tounicode entries added, ligatures %s",nl+ns,ns)
+ end
+end
+
+-- local parser = makenameparser("Japan1")
+-- local parser = makenameparser()
+-- local function test(str)
+-- local b, a = lpegmatch(parser,str)
+-- print((a and table.serialize(b)) or b)
+-- end
+-- test("a.sc")
+-- test("a")
+-- test("uni1234")
+-- test("uni1234.xx")
+-- test("uni12349876")
+-- test("u123400987600")
+-- test("index1234")
+-- test("Japan1.123")
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-mat.mklx b/Master/texmf-dist/tex/context/base/mkxl/font-mat.mklx
index 3fc6275a65d..76f6f87b973 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-mat.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-mat.mklx
@@ -15,13 +15,40 @@
\unprotect
+%D The original (\MKIV) approach to bidi is that we have two extra families for
+%D regular, bold and pseudobold:
+%D
+%D regular normal=0 l2r=1 r2l=2
+%D bold normal=3 l2r=4 r2l=5
+%D pseudobold normal=6 l2r=7 r2l=8
+%D
+%D where l2r is just an alias. Because we're now using the mirror lookup (like
+%D we do a smaller lookup) in the engine we not just have:
+%D
+%D regular normal=0
+%D bold normal=3
+%D pseudobold normal=6
+%D
+%D And when one can wonder if pseudobold is needed (just bolden); we can then
+%D actually go down to only two families. It is one of these cases when it hurts
+%D to throw away a nice old mechanism that worked quite well so here we keep it
+%D commented. For what it's worth: this variant switches a bit faster too and
+%D produces less logging but I doubt if anyone will notice that.
+
+%D We now have bidi handled via a tweak in the goodie file which means that we
+%D could simplify the implementation and get rid of the (four) extra families
+%D needed. For now we retain the zero/three designation for mr/mb but that might
+%D go away. Actually we could drop the number of families in the engine to sixteen
+%D again or even four if we need the space for more classes or something else.
+
%D Be nice:
\ifdefined\??fontinstanceready \else \installcorenamespace{fontinstanceready} \fi
\ifdefined\??fontinstancebasic \else \installcorenamespace{fontinstancebasic} \fi
\ifdefined\??fontinstanceclass \else \installcorenamespace{fontinstanceclass} \fi
-%D The order 3 2 1 of size matters: needed for math-fbk relative size storage!
+%D The order 3 2 1 of size matters is historic and was needed for math-fbk relative
+%D size storage! It is no longer relevant.
%D \macros
%D {textonly}
@@ -35,7 +62,9 @@
%D We currently use only one math family but in the future we might consider using a
%D second one for bold math. For the moment we keep the \MKII\ method of using a
%D token register for definitions but we already dropped the text and symbols ones
-%D since they now live in the same family.
+%D since they now live in the same family. When we go always compact we can simplify
+%D the code even more. For previous implementations see the \MKIV\ code and the
+%D repository pre October 2022.
\newtoks \t_font_math_strategies
\newconditional\c_font_synchronize_math_fonts \settrue\c_font_synchronize_math_fonts
@@ -52,30 +81,21 @@
%D Because we want to keep mr=.. and mb=... settings (read: not break downward
%D compatibility by enforcing mrlr etc) we need a bit more code that optimal.
-% todo: \c_font_fam_mr
-
-\aliased\let\c_font_fam_mr \zerocount % math regular
-\aliased\let\c_font_fam_mr_lr\plusone % math regular l2r
-\aliased\let\c_font_fam_mr_rl\plustwo % math regular r2l
-
-\aliased\let\c_font_fam_mb \plusthree % math bold
-\aliased\let\c_font_fam_mb_lr\plusfour % math bold l2r
-\aliased\let\c_font_fam_mb_rl\plusfive % math bold r2l
+\aliased\let\c_font_fam_mr\zerocount % math regular
+\aliased\let\c_font_fam_mb\plusthree % math bold
\definesystemattribute[mathfamily][public]
-\newconditional\c_font_bidirectional_mathstrategy % can be default, not that much overhead: \settrue\c_font_bidirectional_mathstrategy
-\newconditional\c_font_complete_bold_mathstrategy \settrue\c_font_complete_bold_mathstrategy
+% when we are always true we can as well remove this test:
-% \frozen ...
+\newconditional\c_font_complete_bold_mathstrategy \settrue\c_font_complete_bold_mathstrategy
\immutable\def\mathtextsuffix {-text}
\immutable\def\mathscriptsuffix {-script}
\immutable\def\mathscriptscriptsuffix{-scriptscript}
-%D Beware: truefontname also does a fallback on defaultfontclass so there
-%D can be some interference here, which is why we use a different method
-%D for bold.
+%D Beware: truefontname also does a fallback on defaultfontclass so there can be
+%D some interference here, which is why we use a different method for bold.
\def\font_helpers_set_math_family_a
{\ifcsname\??fontinstanceready\fontclass -\fontbody-\s!mm-\fontfamily-\fontsize\endcsname \setfalse\c_font_auto_size
@@ -101,33 +121,40 @@
\settrue \c_font_auto_size
\fi}
-%def\mathsizesuffix{\ifcase\fontface\or\mathtextsuffix\or\mathscriptsuffix\or\mathscriptscriptsuffix\fi}
-\mutable\let\mathsizesuffix\empty
+\mutable\lettonothing\mathsizesuffix
\mutable\let\fontfamily\relax % for now public but it is a helper
+\newinteger\c_math_last_family_used
+
\def\font_helpers_set_math_family_indeed_normal#mrtag#family% \fontface etc are also used later on
{\let\savedfontbody\fontbody
\let\fontfamily#family%
+\c_math_last_family_used\zerocount
% the order is important as we depend on known id's when completing fonts
- % enabling is needed when we have fallbacks which spoils the families
- \let\mathsizesuffix\mathscriptscriptsuffix\let\fontface\!!plusthree
+ % enabling is needed when we have fallbacks which spoils the families; per
+ % mid 2022 this is no longer true as we do fallbacks differently
+ \let\mathsizesuffix\mathscriptscriptsuffix
+ \let\fontface\!!plusthree
\font_helpers_set_math_family_a\scriptscriptfont#mrtag\font % defines
- \font_helpers_set_math_family_a\scriptscriptfont#mrtag\font % enables
- \let\mathsizesuffix\mathscriptsuffix \let\fontface\!!plustwo
+ \font_helpers_set_math_family_a\scriptscriptfont#mrtag\font % enables / still needed ?
+ \let\mathsizesuffix\mathscriptsuffix
+ \let\fontface\!!plustwo
\font_helpers_set_math_family_a\scriptfont #mrtag\font % defines
- \font_helpers_set_math_family_a\scriptfont #mrtag\font % enables
- \let\mathsizesuffix\mathtextsuffix \let\fontface\!!plusone
+ \font_helpers_set_math_family_a\scriptfont #mrtag\font % enables / still needed ?
+ \let\mathsizesuffix\mathtextsuffix
+ \let\fontface\!!plusone
\font_helpers_set_math_family_a\textfont #mrtag\font % defines
- \font_helpers_set_math_family_a\textfont #mrtag\font % enables
- \let\mathsizesuffix\empty \let\fontface\!!zerocount
+ \font_helpers_set_math_family_a\textfont #mrtag\font % enables / still needed ?
+ \lettonothing\mathsizesuffix
+ \let\fontface\!!zerocount
\let\fontbody\savedfontbody
\setfalse\c_font_auto_size}
\def\font_helpers_set_math_family_set_scales_compact
{% these are used when no font setting is there, the settings come before setting the parameters
- % and are stored with the family
- \glyphtextscale \plusthousand
+ % and are stored with the family ... this is not really needed because the size is used otherwise
+ \glyphtextscale \plusthousand
\glyphscriptscale \numexpr\plusthousand*\dimexpr\scriptface \relax/\dimexpr\textface\relax\relax
\glyphscriptscriptscale \numexpr\plusthousand*\dimexpr\scriptscriptface\relax/\dimexpr\textface\relax\relax}
@@ -139,15 +166,18 @@
\def\font_helpers_set_math_family_indeed_compact#mrtag#family% \fontface etc are also used later on
{\let\savedfontbody\fontbody
\let\fontfamily#family%
+\c_math_last_family_used\zerocount
\font_helpers_set_math_family_set_scales_compact
% the order is important as we depend on known id's when completing fonts
% enabling is needed when we have fallbacks which spoils the families
- \let\mathsizesuffix\mathtextsuffix \let\fontface\!!plusone
+ \let\mathsizesuffix\mathtextsuffix
+ \let\fontface\!!plusone
\font_helpers_set_math_family_a\textfont #mrtag\font % defines
- \font_helpers_set_math_family_a\textfont #mrtag\font % enables
+ \font_helpers_set_math_family_a\textfont #mrtag\font % enables / still needed ?
\scriptfont #mrtag\font % reuses
\scriptscriptfont#mrtag\font % reuses
- \let\mathsizesuffix\empty \let\fontface\!!zerocount
+ \lettonothing\mathsizesuffix
+ \let\fontface\!!zerocount
\let\fontbody\savedfontbody
\setfalse\c_font_auto_size}
@@ -163,17 +193,22 @@
\let\defaultfontclass\fontclass % else truefontname falls back on the wrong one
\let\savedfontbody\fontbody
\let\fontfamily#familytag%
+\c_math_last_family_used\zerocount
\font_helpers_set_math_family_set_scales_normal
- \let\mathsizesuffix\mathscriptscriptsuffix\let\fontface\!!plusthree
+ \let\mathsizesuffix\mathscriptscriptsuffix
+ \let\fontface\!!plusthree
\font_helpers_set_math_family_bold_a\scriptscriptfont#mbfam#mrfam% defines
- \font_helpers_set_math_family_bold_a\scriptscriptfont#mbfam#mrfam% enables
- \let\mathsizesuffix\mathscriptsuffix \let\fontface\!!plustwo
+ \font_helpers_set_math_family_bold_a\scriptscriptfont#mbfam#mrfam% enables / still needed ?
+ \let\mathsizesuffix\mathscriptsuffix
+ \let\fontface\!!plustwo
\font_helpers_set_math_family_bold_a\scriptfont #mbfam#mrfam% defines
- \font_helpers_set_math_family_bold_a\scriptfont #mbfam#mrfam% enables
- \let\mathsizesuffix\mathtextsuffix \let\fontface\!!plusone
+ \font_helpers_set_math_family_bold_a\scriptfont #mbfam#mrfam% enables / still needed ?
+ \let\mathsizesuffix\mathtextsuffix
+ \let\fontface\!!plusone
\font_helpers_set_math_family_bold_a\textfont #mbfam#mrfam% defines
- \font_helpers_set_math_family_bold_a\textfont #mbfam#mrfam% enables
- \let\mathsizesuffix\empty \let\fontface\!!zerocount
+ \font_helpers_set_math_family_bold_a\textfont #mbfam#mrfam% enables / still needed ?
+ \lettonothing\mathsizesuffix
+ \let\fontface\!!zerocount
\let\fontbody\savedfontbody
\let\defaultfontclass\savedfontclass
\setfalse\c_font_auto_size}
@@ -183,12 +218,15 @@
\let\defaultfontclass\fontclass % else truefontname falls back on the wrong one
\let\savedfontbody\fontbody
\let\fontfamily#familytag%
- \let\mathsizesuffix\mathtextsuffix \let\fontface\!!plusone
+\c_math_last_family_used\zerocount
+ \let\mathsizesuffix\mathtextsuffix
+ \let\fontface\!!plusone
\font_helpers_set_math_family_bold_a\textfont #mbfam#mrfam% defines
- \font_helpers_set_math_family_bold_a\textfont #mbfam#mrfam% enables
- \scriptfont #mbfam\scriptfont #mrfam% reuses
- \scriptscriptfont#mbfam\scriptscriptfont#mrfam% reuses
- \let\mathsizesuffix\empty \let\fontface\!!zerocount
+ \font_helpers_set_math_family_bold_a\textfont #mbfam#mrfam% enables / still needed ?
+ \scriptfont #mbfam\textfont#mbfam% reuses
+ \scriptscriptfont#mbfam\textfont#mbfam% reuses
+ \lettonothing\mathsizesuffix
+ \let\fontface\!!zerocount
\let\fontbody\savedfontbody
\let\defaultfontclass\savedfontclass
\setfalse\c_font_auto_size}
@@ -255,36 +293,6 @@
%D little in restoring global states and, what's more important, we get rid of large
%D math parameter push/pop in tracingall when not needed.
-% \def\font_helpers_preset_math_family_indeed#fam#familytag%
-% {\expandafter\let\expandafter\v_font_math_one\csname\??fontinstanceclass\fontclass-\fontbody-\s!mm-#familytag-\fontsize-1\endcsname
-% \ifrelax\v_font_math_one
-% \font_helpers_preset_math_family_warning
-% \orelse\ifnum\fontid\textfont#fam=\fontid\v_font_math_one\else
-% \font_helpers_preset_math_family_indeed_changed#fam#familytag%
-% \fi}
-
-% \def\font_helpers_preset_math_family_warning
-% {\writestatus{fonts}{math: unset for global bodyfont \fontclass\space at \fontbody}}
-
-% \def\font_helpers_preset_math_family_indeed_changed_normal#fam#familytag%
-% {\font_helpers_set_math_family_set_scales_normal
-% \scriptscriptfont#fam\csname\??fontinstanceclass\fontclass-\fontbody-\s!mm-#familytag-\fontsize-3\endcsname
-% \scriptfont #fam\csname\??fontinstanceclass\fontclass-\fontbody-\s!mm-#familytag-\fontsize-2\endcsname
-% \textfont #fam\v_font_math_one}
-
-% \def\font_helpers_preset_math_family_indeed_changed_compact#fam#familytag%
-% {\font_helpers_set_math_family_set_scales_compact
-% \scriptscriptfont#fam\v_font_math_one
-% \scriptfont #fam\v_font_math_one
-% \textfont #fam\v_font_math_one}
-
-% \def\font_helpers_preset_math_family_indeed_changed
-% {\ifconditional\c_font_compact
-% \expandafter\font_helpers_preset_math_family_indeed_changed_compact
-% \else
-% \expandafter\font_helpers_preset_math_family_indeed_changed_normal
-% \fi}
-
\def\font_helpers_preset_math_family_indeed_normal#fam#familytag%
{\expandafter\let\expandafter\font_math_last_font\csname\??fontinstanceclass\fontclass-\fontbody-\s!mm-#familytag-\fontsize-1\endcsname
\font_math_last_font
@@ -329,87 +337,22 @@
%D 0 while in rl mode 0 is a copy of 1. There is no real overhead involved in this.
%D This also permits different font definitions for normal and mixed.
-\let\m_font_class_direction\empty
-\let\m_font_class_features \empty
-\let\m_font_class_fallbacks\empty
-\let\m_font_class_goodies \empty
-
-\let\m_font_direction\empty
-\let\m_font_features \empty
-\let\m_font_fallbacks\empty
-\let\m_font_goodies \empty
-
-\appendtoks % can be analyzed once
- % why here ..
- %\edef\m_font_class_direction{\ifcsname\??fontclass\fontclass\s!mm\s!direction\endcsname\csname\??fontclass\fontclass\s!mm\s!direction\endcsname\fi}%
- \edef\m_font_class_direction{\begincsname\??fontclass\fontclass\s!mm\s!direction\endcsname}%
- % ...
- \ifx\m_font_class_direction\v!both
- \settrue\c_font_bidirectional_mathstrategy
- \else
- \setfalse\c_font_bidirectional_mathstrategy
- \fi
-\to \t_font_math_strategies
-
-\def\font_helpers_bidirectional_mathstrategy_yes
- {\font_helpers_set_math_family\c_font_fam_mr_lr\s!mrlr
- \font_helpers_set_math_family\c_font_fam_mr_rl\s!mrrl
- \ifnum\fontid\textfont\c_font_fam_mr=\fontid\textfont\c_font_fam_mr_lr\else
- \font_helpers_bidirectional_mathstrategy_yes_changed
- \fi}
-
-\def\font_helpers_bidirectional_mathstrategy_yes_changed
- {\textfont \c_font_fam_mr\textfont \c_font_fam_mr_lr
- \scriptfont \c_font_fam_mr\scriptfont \c_font_fam_mr_lr
- \scriptscriptfont\c_font_fam_mr\scriptscriptfont\c_font_fam_mr_lr}
-
-\def\font_helpers_bidirectional_mathstrategy_nop
- {\font_helpers_set_math_family\c_font_fam_mr\s!mr
- \ifnum\fontid\textfont\c_font_fam_mr_rl=\fontid\textfont\c_font_fam_mr\else
- \font_helpers_bidirectional_mathstrategy_nop_changed
- \fi}
+\lettonothing\m_font_class_direction
+\lettonothing\m_font_class_features
+\lettonothing\m_font_class_fallbacks
+\lettonothing\m_font_class_goodies
-\def\font_helpers_bidirectional_mathstrategy_nop_changed
- {\textfont \c_font_fam_mr_lr\textfont \c_font_fam_mr
- \scriptfont \c_font_fam_mr_lr\scriptfont \c_font_fam_mr
- \scriptscriptfont\c_font_fam_mr_lr\scriptscriptfont\c_font_fam_mr
- \textfont \c_font_fam_mr_rl\textfont \c_font_fam_mr
- \scriptfont \c_font_fam_mr_rl\scriptfont \c_font_fam_mr
- \scriptscriptfont\c_font_fam_mr_rl\scriptscriptfont\c_font_fam_mr}
+\lettonothing\m_font_direction
+\lettonothing\m_font_features
+\lettonothing\m_font_fallbacks
+\lettonothing\m_font_goodies
\appendtoks
- \ifconditional\c_font_bidirectional_mathstrategy
- \font_helpers_bidirectional_mathstrategy_yes
- \else
- \font_helpers_bidirectional_mathstrategy_nop
- \fi
+ \font_helpers_set_math_family\c_font_fam_mr\s!mr
\to \t_font_math_strategies
-\def\font_helpers_complete_bold_mathstrategy_yes_bidi
- {\font_helpers_set_math_family_bold\c_font_fam_mb_lr\s!mblr\c_font_fam_mr_lr
- \font_helpers_set_math_family_bold\c_font_fam_mb_rl\s!mbrl\c_font_fam_mr_rl
- \ifnum\fontid\textfont\c_font_fam_mb=\fontid\textfont\c_font_fam_mb_lr\else
- \font_helpers_complete_bold_mathstrategy_yes_bidi_changed
- \fi}
-
-\def\font_helpers_complete_bold_mathstrategy_yes_bidi_changed
- {\textfont \c_font_fam_mb\textfont \c_font_fam_mb_lr
- \scriptfont \c_font_fam_mb\scriptfont \c_font_fam_mb_lr
- \scriptscriptfont\c_font_fam_mb\scriptscriptfont\c_font_fam_mb_lr}
-
\def\font_helpers_complete_bold_mathstrategy_yes
- {\font_helpers_set_math_family_bold\c_font_fam_mb\s!mb\c_font_fam_mr\relax
- \ifnum\fontid\textfont\c_font_fam_mb_rl=\fontid\textfont\c_font_fam_mb\else
- \font_helpers_complete_bold_mathstrategy_yes_changed
- \fi}
-
-\def\font_helpers_complete_bold_mathstrategy_yes_changed
- {\textfont \c_font_fam_mb_rl\textfont \c_font_fam_mb
- \scriptfont \c_font_fam_mb_rl\scriptfont \c_font_fam_mb
- \scriptscriptfont\c_font_fam_mb_rl\scriptscriptfont\c_font_fam_mb
- \textfont \c_font_fam_mb_lr\textfont \c_font_fam_mb
- \scriptfont \c_font_fam_mb_lr\scriptfont \c_font_fam_mb
- \scriptscriptfont\c_font_fam_mb_lr\scriptscriptfont\c_font_fam_mb}
+ {\font_helpers_set_math_family_bold\c_font_fam_mb\s!mb\c_font_fam_mr\relax}
\def\font_helpers_complete_bold_mathstrategy_nop
{\ifnum\fontid\textfont\c_font_fam_mb=\fontid\textfont\c_font_fam_mr\else
@@ -417,23 +360,13 @@
\fi}
\def\font_helpers_complete_bold_mathstrategy_nop_changed
- {\textfont \c_font_fam_mb \textfont \c_font_fam_mr
- \scriptfont \c_font_fam_mb \scriptfont \c_font_fam_mr
- \scriptscriptfont\c_font_fam_mb \scriptscriptfont\c_font_fam_mr
- \textfont \c_font_fam_mb_lr\textfont \c_font_fam_mr_lr
- \scriptfont \c_font_fam_mb_lr\scriptfont \c_font_fam_mr_lr
- \scriptscriptfont\c_font_fam_mb_lr\scriptscriptfont\c_font_fam_mr_lr
- \textfont \c_font_fam_mb_rl\textfont \c_font_fam_mr_rl
- \scriptfont \c_font_fam_mb_rl\scriptfont \c_font_fam_mr_rl
- \scriptscriptfont\c_font_fam_mb_rl\scriptscriptfont\c_font_fam_mr_rl}
+ {\textfont \c_font_fam_mb\textfont \c_font_fam_mr
+ \scriptfont \c_font_fam_mb\scriptfont \c_font_fam_mr
+ \scriptscriptfont\c_font_fam_mb\scriptscriptfont\c_font_fam_mr}
\def\font_helpers_apply_complete_bold_mathstrategy
{\ifconditional\c_font_complete_bold_mathstrategy
- \ifconditional\c_font_bidirectional_mathstrategy
- \font_helpers_complete_bold_mathstrategy_yes_bidi
- \else
- \font_helpers_complete_bold_mathstrategy_yes
- \fi
+ \font_helpers_complete_bold_mathstrategy_yes
\else
\font_helpers_complete_bold_mathstrategy_nop
\fi}
@@ -443,48 +376,31 @@
\to \t_font_math_strategies
\ifdefined\defaultmathfamily \else
- \setnewconstant\defaultmathfamily\zerocount
+ \setnewconstant\defaultmathfamily\zerocount % no longer used, always zero
\fi
\appendtoks
- \fam\defaultmathfamily % all characters and symbols are in this family
+ \fam\zerocount % all characters and symbols are in this family
\to \everymathematics
\protected\def\font_helpers_synchronize_math_family_mr
- {\c_attr_mathfamily\ifconditional\c_font_bidirectional_mathstrategy
- \ifconditional\c_math_right_to_left
- \plustwo
- \else
- \plusone
- \fi
- \else
- \zerocount
- \fi}
+ {\c_attr_mathfamily\zerocount
+ \font_helpers_synchronize_math_parameters_normal}
\protected\def\font_helpers_synchronize_math_family_mb
- {\c_attr_mathfamily\ifconditional\c_font_bidirectional_mathstrategy
- \ifconditional\c_math_right_to_left
- \ifconditional\c_font_pseudo_bold_math_state\pluseight\else\plusfive\fi
- \else
- \ifconditional\c_font_pseudo_bold_math_state\plusseven\else\plusfour\fi
- \fi
- \else
- \ifconditional\c_font_pseudo_bold_math_state\plussix\else\plusthree\fi
- \fi}
+ {\c_attr_mathfamily\ifconditional\c_font_pseudo_bold_math_state\plussix\else\plusthree\fi
+ \font_helpers_synchronize_math_parameters_bold}
\installcorenamespace{fontmathsynchronizer}
\installcorenamespace{fontmathstoredstrategy}
-\letvalue{\??fontmathsynchronizer\s!tf }\font_helpers_synchronize_math_family_mr
-\letvalue{\??fontmathsynchronizer\s!sl }\font_helpers_synchronize_math_family_mr
-\letvalue{\??fontmathsynchronizer\s!it }\font_helpers_synchronize_math_family_mr
-\letvalue{\??fontmathsynchronizer\s!bf }\font_helpers_synchronize_math_family_mb
-\letvalue{\??fontmathsynchronizer\s!bs }\font_helpers_synchronize_math_family_mb
-\letvalue{\??fontmathsynchronizer\s!bi }\font_helpers_synchronize_math_family_mb
-\letvalue{\??fontmathsynchronizer\empty}\font_helpers_synchronize_math_family_mr
-
-% \def\font_helpers_synchronize_math_family
-% {\csname\??fontmathsynchronizer\ifcsname\??fontmathsynchronizer\fontalternative\endcsname\fontalternative\fi\endcsname}
+\letcsname\??fontmathsynchronizer\s!tf \endcsname\font_helpers_synchronize_math_family_mr
+\letcsname\??fontmathsynchronizer\s!sl \endcsname\font_helpers_synchronize_math_family_mr
+\letcsname\??fontmathsynchronizer\s!it \endcsname\font_helpers_synchronize_math_family_mr
+\letcsname\??fontmathsynchronizer\s!bf \endcsname\font_helpers_synchronize_math_family_mb
+\letcsname\??fontmathsynchronizer\s!bs \endcsname\font_helpers_synchronize_math_family_mb
+\letcsname\??fontmathsynchronizer\s!bi \endcsname\font_helpers_synchronize_math_family_mb
+\letcsname\??fontmathsynchronizer\empty\endcsname\font_helpers_synchronize_math_family_mr
\def\font_helpers_synchronize_math_family
{\ifcsname\??fontmathsynchronizer\fontalternative\endcsname
@@ -501,7 +417,6 @@
\fi
\to \t_font_math_strategies
-%def\font_helpers_synchronize_math_bold_strategy{\csname\??fontmathstoredstrategy\fontclass\endcsname}
\def\font_helpers_synchronize_math_bold_strategy{\begincsname\??fontmathstoredstrategy\fontclass\endcsname}
\newconditional\c_font_pseudo_bold_math_state
@@ -573,10 +488,12 @@
\permanent\protected\def\autobigmath{\synchronizebigmathflag\plusone\synchronizebigmath}
\permanent\protected\def\bigmath {\synchronizebigmathflag\plustwo\synchronizebigmath}
-\mutable\let\bigmathfontsize\empty
+\mutable\lettonothing\bigmathfontsize
\permanent\protected\def\synchronizebigmath
- {\ifx\bigmathfontsize\fontsize
+ {\ifconditional\c_font_compact
+ % no need
+ \orelse\ifx\bigmathfontsize\fontsize
% already in sync
\else
\let\bigmathfontsize\fontsize
@@ -592,4 +509,75 @@
\synchronizebigmath
\fi}
+%D This is an experiment!
+
+\permanent\protected\def\mx {\ifmmode\scaledmathstyle\dimexpression\plusthousand*(\xtextface /\textface)\relax\fi}
+\permanent\protected\def\mxx{\ifmmode\scaledmathstyle\dimexpression\plusthousand*(\xxtextface/\textface)\relax\fi}
+
+% permanent\protected\def\setmscale#1{\ifmmode\scaledmathstyle\numericscale#1\relax\fi}
+
+\installcorenamespace{mscaled}
+
+\mutable\def\mathscalefactor{0.7} % 1/sqrt(2} = 0.70710678118655
+
+\newinteger\c_math_m_scaled \c_math_m_scaled\plusthousand
+
+\permanent\protected\def\setmscale#1%
+ {\ifmmode
+ \iftok{#1}{-}%
+ \c_math_m_scaled\numexpr(\numericscale\mathscalefactor)*\c_math_m_scaled/\plusthousand\relax
+ \orelse\iftok{#1}{=}%
+ \c_math_m_scaled\plusthousand
+ \else
+ \c_math_m_scaled\numericscale#1\relax
+ \fi
+ \scaledmathstyle\c_math_m_scaled
+ \fi}
+
+%D This is nasty, as the engine only stores the last set family parameters (per style) which
+%D in our case can be bold.
+
+\def\font_helpers_synchronize_math_parameters_normal
+ {\c_math_last_family_used\mathstylefontid\textstyle\zerocount
+ \textfont \c_font_fam_mr\textfont \c_font_fam_mr
+ \scriptfont \c_font_fam_mr\scriptfont \c_font_fam_mr
+ \scriptscriptfont\c_font_fam_mr\scriptscriptfont\c_font_fam_mr}
+
+\def\font_helpers_synchronize_math_parameters_bold
+ {\c_math_last_family_used\mathstylefontid\textstyle\zerocount
+ \textfont \c_attr_mathfamily\textfont \c_attr_mathfamily
+ \scriptfont \c_attr_mathfamily\scriptfont \c_attr_mathfamily
+ \scriptscriptfont\c_attr_mathfamily\scriptscriptfont\c_attr_mathfamily}
+
+\appendtoks
+ \ifnum\c_math_last_family_used=\mathstylefontid\textstyle\zerocount\else
+ \font_helpers_synchronize_math_parameters_normal
+ \fi
+\to\everybodyfont
+
+%D Something new, see type {type-imp-antykwa} for an example:
+
+% if we get more:
+
+% \installcorenamespace {fractionbar}
+% \installcorenamespace {radicalbar}
+
+% \def\installfractionbar#1#2{\defcsname\??fractionbar#1\endcsname{#2}}
+% \def\installradicalbar #1#2{\defcsname\??radicalbar #1\endcsname{#2}}
+
+% \def\fractionbarunicode{\ifcsname\??fractionbar\fontclass\endcsname\lastnamedcs\else\zerocount\fi}
+% \def\radicalbarunicode {\ifcsname\??radicalbar \fontclass\endcsname\lastnamedcs\else\zerocount\fi}
+
+\mutable\lettonothing\currentmathfontclass
+
+\def\math_synchronize_setup
+ {\let\currentmathfontclass\fontclass
+ \fastsetup\fontclass}
+
+\appendtoks
+ \ifx\fontclass\currentmathfontclass\else
+ \math_synchronize_setup
+ \fi
+\to \everymathematics
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-mpf.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-mpf.lmt
index b1e6a00dd55..18f3365db9a 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-mpf.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-mpf.lmt
@@ -56,31 +56,35 @@ local function setmetaglyphs(category,fontid,unicode,specification)
local units = shapes.parameters.units
local scale = tfmdata.parameters.size / units
local shape = shapes.glyphs[unicode]
- --
- local llx, lly, urx, ury = unpack(shape.boundingbox)
- llx = llx * scale
- urx = urx * scale
- lly = lly * scale
- ury = ury * scale
- --
- local newdata = { }
- characters[unicode] = newdata -- so that we can register commands
- fonts.dropins.swapone("mps",tfmdata,shape,unicode)
- --
- local olddata = characters[unicode]
- newdata.width = urx - llx
- newdata.height = ury
- newdata.depth = -lly
- newdata.unicode = unicode
- -- commands = { { "offset", -llx, 0, newdata.commands[1][1], newdata.commands[1][2] } }
- if llx ~= 0 then
- newdata.commands = { { "offset", -llx, 0 }, newdata.commands[1] }
+ if shape then
+ --
+ local llx, lly, urx, ury = unpack(shape.boundingbox)
+ llx = llx * scale
+ urx = urx * scale
+ lly = lly * scale
+ ury = ury * scale
+ --
+ local newdata = { }
+ characters[unicode] = newdata -- so that we can register commands
+ fonts.dropins.swapone("mps",tfmdata,shape,unicode)
+ --
+ local olddata = characters[unicode]
+ newdata.width = urx - llx
+ newdata.height = ury
+ newdata.depth = -lly
+ newdata.unicode = unicode
+ -- commands = { { "offset", -llx, 0, newdata.commands[1][1], newdata.commands[1][2] } }
+ if llx ~= 0 then
+ newdata.commands = { { "offset", -llx, 0 }, newdata.commands[1] }
+ end
+ -- pass dimensions to lua
+ characters[unicode] = newdata
+ -- pass dimensions to tex
+ addcharacters(fontid, { characters = { [unicode] = newdata } })
+ return fontid, unicode
+ else
+ logs.report("metaglyph", "bad shape %U in font %i", unicode, fontid)
end
- -- pass dimensions to lua
- characters[unicode] = newdata
- -- pass dimensions to tex
- addcharacters(fontid, { characters = { [unicode] = newdata } })
- return fontid, unicode
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-ogr.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-ogr.lmt
index 698593ac7e0..3b4f9f86784 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-ogr.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-ogr.lmt
@@ -36,9 +36,14 @@ otf.pngenabled = true
-- what here and what in backend ...
+local report_fonts = logs.reporter("backend","fonts")
+local trace_fonts trackers.register("backend.fonts",function(v) trace_fonts = v end)
+
+local slotcommand = fonts.helpers.commands.slot
+
do
- -- This is a prelude to something better but I'm still experimenting.
+ -- This is a prelude to something better but I'm still experimenting. We should delay more.
local dropins = { }
fonts.dropins = dropins
@@ -59,7 +64,8 @@ do
local t_properties = t_tfmdata.properties
local d_tfmdata = setmetatableindex({ },t_tfmdata)
local d_properties = setmetatableindex({ },t_properties)
- d_properties.basefontname = "ContextRuntimeFont" .. droppedin
+ local d_basefontname = "ContextRuntimeFont" .. droppedin
+ d_properties.basefontname = d_basefontname
d_tfmdata.properties = d_properties
local d_characters = { } -- setmetatableindex({ },t_characters) -- hm, index vs unicode
local d_descriptions = { } -- setmetatableindex({ },t_descriptions) -- hm, index vs unicode
@@ -75,6 +81,9 @@ do
d_properties.indexdata = { indexdata, ... } -- can take quite some memory
local slot = #fonts + 1
fonts[slot] = { id = droppedin }
+ if trace_fonts then
+ report_fonts("registering dropin %a using method %a",d_basefontname,method)
+ end
return slot, droppedin, d_tfmdata, d_properties
end
@@ -84,9 +93,10 @@ do
if method and shapes then
local characters = tfmdata.characters
local descriptions = tfmdata.descriptions
- local droppedin, tfmdrop, dropchars, dropdescs, colrshapes
+ local droppedin, tfmdrop, dropchars, dropdescs, colrshapes, props
local idx = 255
local slot = 0
+ -- sorted ?
for k, v in next, characters do
local index = v.index
if index then
@@ -97,7 +107,7 @@ do
if idx >= 255 then
idx = 1
colrshapes = setmetatableindex({ },shapes)
- slot, droppedin, tfmdrop = dropins.provide(method,tfmdata,colrshapes)
+ slot, droppedin, tfmdrop, props = dropins.provide(method,tfmdata,colrshapes)
dropchars = tfmdrop.characters
dropdescs = tfmdrop.descriptions
else
@@ -105,7 +115,7 @@ do
end
colrshapes[idx] = shape -- so not: description
-- todo: prepend
- v.commands = { { "slot", slot, idx } }
+ v.commands = { slotcommand[slot][idx] }
-- hack to prevent that type 3 also gets 'use' flags .. todo
local c = { commands = false, index = idx, dropin = tfmdrop }
local d = { } -- { index = idx, dropin = tfmdrop }
@@ -122,46 +132,6 @@ do
end
end
--- function dropins.swap(method,tfmdata,shapes,...) -- by unicode
--- if method and shapes then
--- local characters = tfmdata.characters
--- local descriptions = tfmdata.descriptions
--- local droppedin, tfmdrop, dropchars, dropdescs, colrshapes
--- local idx = 255
--- local slot = 0
--- -- we can have a variant where shaped are by unicode and not by index
--- for k, v in next, characters do
--- local description = descriptions[k]
--- if description then
--- local shape = shapes[k]
--- if shape then
--- if idx >= 255 then
--- idx = 1
--- colrshapes = setmetatableindex({ },shapes)
--- slot, droppedin, tfmdrop = dropins.provide(method,tfmdata,colrshapes)
--- dropchars = tfmdrop.characters
--- dropdescs = tfmdrop.descriptions
--- else
--- idx = idx + 1
--- end
--- colrshapes[idx] = shape -- so not: description
--- -- todo: prepend
--- v.commands = { { "slot", slot, idx } }
--- -- hack to prevent that type 3 also gets 'use' flags .. todo
--- local c = { commands = false, index = idx, dropin = tfmdrop }
--- local d = { } -- index = idx, dropin = tfmdrop }
--- setmetatableindex(c,v)
--- setmetatableindex(d,description)
--- dropchars[idx] = c
--- dropdescs[idx] = d -- not needed
--- end
--- end
--- end
--- else
--- -- error
--- end
--- end
-
function dropins.swap(method,tfmdata,shapes) -- by unicode
if method and shapes then
local characters = tfmdata.characters
@@ -190,7 +160,7 @@ do
end
colrshapes[idx] = shape -- so not: description
-- todo: prepend
- v.commands = { { "slot", slot, idx } }
+ v.commands = { slotcommand[slot][idx] }
-- hack to prevent that type 3 also gets 'use' flags .. todo
local c = { commands = false, index = idx, dropin = tfmdrop }
local d = { } -- index = idx, dropin = tfmdrop }
@@ -238,7 +208,7 @@ do
end
colrshapes[idx] = shape.code -- so not: description
-- todo: prepend
- character.commands = { { "slot", slot, idx } }
+ character.commands = { slotcommand[slot][idx] }
-- hack to prevent that type 3 also gets 'use' flags .. todo
local c = { commands = false, index = idx, dropin = tfmdrop }
-- local d = { } -- index = idx, dropin = tfmdrop }
@@ -474,7 +444,7 @@ do -- this will move to its own module
end
--- This sits here for historcal reasons so for now we keep it here.
+-- This sits here for historical reasons so for now we keep it here.
local startactualtext = nil
local stopactualtext = nil
@@ -487,20 +457,8 @@ function otf.getactualtext(s)
return startactualtext(s), stopactualtext()
end
--- This is also somewhat specific.
-
-local color_direct = function() return false end
-local color_indirect = color_direct
-
-updaters.register("backend.update",function()
- color_direct = lpdf.fonts.color_direct
- color_indirect = lpdf.fonts.color_indirect
-end)
-
local sharedpalettes = { } do
- local register = attributes.colors.register
-
local colors = attributes.list[attributes.private('color')] or { }
local transparencies = attributes.list[attributes.private('transparency')] or { }
@@ -510,20 +468,10 @@ local sharedpalettes = { } do
local v = values[i]
if v == "textcolor" then
values[i] = false
- else
- local c = nil
- local t = nil
- if type(v) == "table" then
- c = register(name,"rgb",
- max(round((v.r or 0)*255),255)/255,
- max(round((v.g or 0)*255),255)/255,
- max(round((v.b or 0)*255),255)/255
- )
- else
- c = colors[v]
- t = transparencies[v]
- end
- values[i] = color_indirect(c,t)
+ elseif type(v) == "table" then
+ values[i] = { kind = "values", data = v }
+ else -- freezing
+ values[i] = { kind = "attributes", color = colors[v], transparency = transparencies[v] }
end
end
end
@@ -532,83 +480,73 @@ end
local initializeoverlay do
- local function autoconvert(t,k)
- local v = { }
- for i=1,#k do
- local p = k[i]
- v[i] = color_direct(p[1]/255, p[2]/255, p[3]/255)
- end
- t[k] = v
- return v
- end
-
initializeoverlay = function(tfmdata,kind,value) -- we really need the id ... todo
if value then
local resources = tfmdata.resources
local palettes = resources.colorpalettes
if palettes then
- --
- local converted = resources.converted
- if not converted then
- converted = setmetatableindex(autoconvert)
- resources.converted = converted
- end
- local colorvalues = sharedpalettes[value]
- local default = false -- so the text color (bad for icon overloads)
- if colorvalues then
- default = colorvalues[#colorvalues]
+ local colorvalues = false
+ local colordata = sharedpalettes[value]
+ if colordata and #colordata > 0 then
+ colorvalues = {
+ kind = "user",
+ data = colordata,
+ }
else
- colorvalues = converted[palettes[tonumber(value) or 1] or palettes[1]] or { }
- end
- local classes = #colorvalues
- if classes == 0 then
- return
+ colordata = palettes[tonumber(value) or 1] or palettes[1]
+ if colordata and #colordata > 0 then
+ colorvalues = {
+ kind = "font",
+ data = colordata,
+ }
+ end
end
- --
- local characters = tfmdata.characters
- local descriptions = tfmdata.descriptions
- local droppedin, tfmdrop, dropchars, dropdescs, colrshapes
- local idx = 255
- local slot = 0
- --
- -- maybe delay in which case we have less fonts as we can be sparse
- --
- for k, v in next, characters do
- local index = v.index
- if index then
- local description = descriptions[k]
- if description then
- local colorlist = description.colors
- if colorlist then
- if idx >= 255 then
- idx = 1
- colrshapes = { }
- slot, droppedin, tfmdrop = fonts.dropins.provide("color",tfmdata,colrshapes,colorvalues)
- dropchars = tfmdrop.characters
- dropdescs = tfmdrop.descriptions
- else
- idx = idx + 1
- end
- --
- colrshapes[idx] = description
- -- todo: use extender
- local u = { "use", 0 }
- for i=1,#colorlist do
- u[i+2] = colorlist[i].slot
+ if colorvalues then
+ local characters = tfmdata.characters
+ local descriptions = tfmdata.descriptions
+ local droppedin, tfmdrop, dropchars, dropdescs, colrshapes
+ local idx = 255
+ local slot = 0
+ --
+ -- maybe delay in which case we have less fonts as we can be sparse
+ --
+ for k, v in next, characters do
+ local index = v.index
+ if index then
+ local description = descriptions[k]
+ if description then
+ local colorlist = description.colors
+ if colorlist then
+ if idx >= 255 then
+ idx = 1
+ colrshapes = { }
+ slot, droppedin, tfmdrop = fonts.dropins.provide("color",tfmdata,colrshapes,colorvalues)
+ dropchars = tfmdrop.characters
+ dropdescs = tfmdrop.descriptions
+ else
+ idx = idx + 1
+ end
+ --
+ colrshapes[idx] = description
+ -- todo: use extender
+ local u = { "use", 0 }
+ for i=1,#colorlist do
+ u[i+2] = colorlist[i].slot
+ end
+ v.commands = { u, slotcommand[slot][idx] }
+ -- hack to prevent that type 3 also gets 'use' flags .. todo
+ local c = { commands = false, index = idx, dropin = tfmdata }
+ local d = { } -- index = idx, dropin = tfmdrop
+ setmetatableindex(c,v)
+ setmetatableindex(d,description)
+ dropchars[idx] = c
+ dropdescs[idx] = d -- not needed
end
- v.commands = { u, { "slot", slot, idx } }
- -- hack to prevent that type 3 also gets 'use' flags .. todo
- local c = { commands = false, index = idx, dropin = tfmdata }
- local d = { } -- index = idx, dropin = tfmdrop
- setmetatableindex(c,v)
- setmetatableindex(d,description)
- dropchars[idx] = c
- dropdescs[idx] = d -- not needed
end
end
end
+ return true
end
- return true
end
end
end
@@ -619,6 +557,7 @@ local initializeoverlay do
manipulators = {
base = initializeoverlay,
node = initializeoverlay,
+ plug = initializeoverlay,
}
}
@@ -696,6 +635,7 @@ local initializesvg do
manipulators = {
base = initializesvg,
node = initializesvg,
+ plug = initializesvg,
}
}
@@ -737,6 +677,7 @@ local initializepng do
manipulators = {
base = initializepng,
node = initializepng,
+ plug = initializepng,
}
}
@@ -746,6 +687,7 @@ local initializepng do
manipulators = {
base = initializepng,
node = initializepng,
+ plug = initializepng,
}
}
@@ -779,6 +721,7 @@ do
manipulators = {
base = initializecolor,
node = initializecolor,
+ plug = initializecolor,
}
}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-one.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-one.lmt
new file mode 100644
index 00000000000..453f611927a
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-one.lmt
@@ -0,0 +1,847 @@
+if not modules then modules = { } end modules ['font-one'] = {
+ version = 1.001,
+ optimize = true,
+ comment = "companion to font-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+--[[ldx--
+<p>Some code may look a bit obscure but this has to do with the fact that we also use
+this code for testing and much code evolved in the transition from <l n='tfm'/> to
+<l n='afm'/> to <l n='otf'/>.</p>
+
+<p>The following code still has traces of intermediate font support where we handles
+font encodings. Eventually font encoding went away but we kept some code around in
+other modules.</p>
+
+<p>This version implements a node mode approach so that users can also more easily
+add features.</p>
+--ldx]]--
+
+local fonts, logs, trackers, containers, resolvers = fonts, logs, trackers, containers, resolvers
+
+local next, type, tonumber, rawget = next, type, tonumber, rawget
+local match, gsub = string.match, string.gsub
+local abs = math.abs
+local P, S, R, Cmt, C, Ct, Cs, Carg = lpeg.P, lpeg.S, lpeg.R, lpeg.Cmt, lpeg.C, lpeg.Ct, lpeg.Cs, lpeg.Carg
+local lpegmatch, patterns = lpeg.match, lpeg.patterns
+local sortedhash = table.sortedhash
+
+local trace_features = false trackers.register("afm.features", function(v) trace_features = v end)
+local trace_indexing = false trackers.register("afm.indexing", function(v) trace_indexing = v end)
+local trace_loading = false trackers.register("afm.loading", function(v) trace_loading = v end)
+local trace_defining = false trackers.register("fonts.defining", function(v) trace_defining = v end)
+
+local report_afm = logs.reporter("fonts","afm loading")
+
+local setmetatableindex = table.setmetatableindex
+local derivetable = table.derive
+
+local findbinfile = resolvers.findbinfile
+
+local privateoffset = fonts.constructors and fonts.constructors.privateoffset or 0xF0000 -- 0x10FFFF
+
+local definers = fonts.definers
+local readers = fonts.readers
+local constructors = fonts.constructors
+
+local afm = constructors.handlers.afm
+local pfb = constructors.handlers.pfb
+local otf = fonts.handlers.otf
+
+local otfreaders = otf.readers
+local otfenhancers = otf.enhancers
+
+local afmfeatures = constructors.features.afm
+local registerafmfeature = afmfeatures.register
+
+local afmenhancers = constructors.enhancers.afm
+local registerafmenhancer = afmenhancers.register
+
+afm.version = 1.513 -- incrementing this number one up will force a re-cache
+afm.cache = containers.define("fonts", "one", afm.version, true)
+afm.autoprefixed = true -- this will become false some day (catches texnansi-blabla.*)
+
+afm.helpdata = { } -- set later on so no local for this
+afm.syncspace = true -- when true, nicer stretch values
+
+local overloads = fonts.mappings.overloads
+
+local applyruntimefixes = fonts.treatments and fonts.treatments.applyfixes
+
+--[[ldx--
+<p>We cache files. Caching is taken care of in the loader. We cheat a bit by adding
+ligatures and kern information to the afm derived data. That way we can set them faster
+when defining a font.</p>
+
+<p>We still keep the loading two phased: first we load the data in a traditional
+fashion and later we transform it to sequences. Then we apply some methods also
+used in opentype fonts (like <t>tlig</t>).</p>
+--ldx]]--
+
+function afm.load(filename)
+ filename = resolvers.findfile(filename,'afm') or ""
+ if filename ~= "" and not fonts.names.ignoredfile(filename) then
+ local name = file.removesuffix(file.basename(filename))
+ local data = containers.read(afm.cache,name)
+ local attr = lfs.attributes(filename)
+ local size = attr and attr.size or 0
+ local time = attr and attr.modification or 0
+ --
+ local pfbfile = file.replacesuffix(name,"pfb")
+ local pfbname = resolvers.findfile(pfbfile,"pfb") or ""
+ if pfbname == "" then
+ pfbname = resolvers.findfile(file.basename(pfbfile),"pfb") or ""
+ end
+ local pfbsize = 0
+ local pfbtime = 0
+ if pfbname ~= "" then
+ local attr = lfs.attributes(pfbname)
+ pfbsize = attr.size or 0
+ pfbtime = attr.modification or 0
+ end
+ if not data or data.size ~= size or data.time ~= time or data.pfbsize ~= pfbsize or data.pfbtime ~= pfbtime then
+ report_afm("reading %a",filename)
+ data = afm.readers.loadfont(filename,pfbname)
+ if data then
+ afmenhancers.apply(data,filename)
+ -- otfreaders.addunicodetable(data) -- only when not done yet
+ fonts.mappings.addtounicode(data,filename)
+ otfreaders.stripredundant(data)
+ -- otfreaders.extend(data)
+ otfreaders.pack(data)
+ data.size = size
+ data.time = time
+ data.pfbsize = pfbsize
+ data.pfbtime = pfbtime
+ report_afm("saving %a in cache",name)
+ -- data.resources.unicodes = nil -- consistent with otf but here we save not much
+ data = containers.write(afm.cache, name, data)
+ data = containers.read(afm.cache,name)
+ end
+ end
+ if data then
+ -- constructors.addcoreunicodes(unicodes)
+ otfreaders.unpack(data)
+ otfreaders.expand(data) -- inline tables
+ otfreaders.addunicodetable(data) -- only when not done yet
+ otfenhancers.apply(data,filename,data)
+ if applyruntimefixes then
+ applyruntimefixes(filename,data)
+ end
+ end
+ return data
+ end
+end
+
+-- we run a more advanced analyzer later on anyway
+
+local uparser = fonts.mappings.makenameparser() -- each time
+
+local function enhance_unify_names(data, filename)
+ local unicodevector = fonts.encodings.agl.unicodes -- loaded runtime in context
+ local unicodes = { }
+ local names = { }
+ local private = data.private or privateoffset
+ local descriptions = data.descriptions
+ for name, blob in sortedhash(data.characters) do -- sorting is nicer for privates
+ local code = unicodevector[name] -- or characters.name_to_unicode[name]
+ if not code then
+ code = lpegmatch(uparser,name)
+ if type(code) ~= "number" then
+ code = private
+ private = private + 1
+ report_afm("assigning private slot %U for unknown glyph name %a",code,name)
+ end
+ end
+ local index = blob.index
+ unicodes[name] = code
+ names[name] = index
+ blob.name = name
+ descriptions[code] = {
+ boundingbox = blob.boundingbox,
+ width = blob.width,
+ kerns = blob.kerns,
+ index = index,
+ name = name,
+ }
+ end
+ for unicode, description in next, descriptions do
+ local kerns = description.kerns
+ if kerns then
+ local krn = { }
+ for name, kern in next, kerns do
+ local unicode = unicodes[name]
+ if unicode then
+ krn[unicode] = kern
+ else
+ -- print(unicode,name)
+ end
+ end
+ description.kerns = krn
+ end
+ end
+ data.characters = nil
+ data.private = private
+ local resources = data.resources
+ local filename = resources.filename or file.removesuffix(file.basename(filename))
+ resources.filename = resolvers.unresolve(filename) -- no shortcut
+ resources.unicodes = unicodes -- name to unicode
+ resources.marks = { } -- todo
+ -- resources.names = names -- name to index
+end
+
+local everywhere = { ["*"] = { ["*"] = true } } -- or: { ["*"] = { "*" } }
+local noflags = { false, false, false, false }
+
+local function enhance_normalize_features(data)
+ local ligatures = setmetatableindex("table")
+ local kerns = setmetatableindex("table")
+ local extrakerns = setmetatableindex("table")
+ for u, c in next, data.descriptions do
+ local l = c.ligatures
+ local k = c.kerns
+ local e = c.extrakerns
+ if l then
+ ligatures[u] = l
+ for u, v in next, l do
+ l[u] = { ligature = v }
+ end
+ c.ligatures = nil
+ end
+ if k then
+ kerns[u] = k
+ for u, v in next, k do
+ k[u] = v -- { v, 0 }
+ end
+ c.kerns = nil
+ end
+ if e then
+ extrakerns[u] = e
+ for u, v in next, e do
+ e[u] = v -- { v, 0 }
+ end
+ c.extrakerns = nil
+ end
+ end
+ local features = {
+ gpos = { },
+ gsub = { },
+ }
+ local sequences = {
+ -- only filled ones
+ }
+ if next(ligatures) then
+ features.gsub.liga = everywhere
+ data.properties.hasligatures = true
+ sequences[#sequences+1] = {
+ features = {
+ liga = everywhere,
+ },
+ flags = noflags,
+ name = "s_s_0",
+ nofsteps = 1,
+ order = { "liga" },
+ type = "gsub_ligature",
+ steps = {
+ {
+ coverage = ligatures,
+ },
+ },
+ }
+ end
+ if next(kerns) then
+ features.gpos.kern = everywhere
+ data.properties.haskerns = true
+ sequences[#sequences+1] = {
+ features = {
+ kern = everywhere,
+ },
+ flags = noflags,
+ name = "p_s_0",
+ nofsteps = 1,
+ order = { "kern" },
+ type = "gpos_pair",
+ steps = {
+ {
+ format = "kern",
+ coverage = kerns,
+ },
+ },
+ }
+ end
+ if next(extrakerns) then
+ features.gpos.extrakerns = everywhere
+ data.properties.haskerns = true
+ sequences[#sequences+1] = {
+ features = {
+ extrakerns = everywhere,
+ },
+ flags = noflags,
+ name = "p_s_1",
+ nofsteps = 1,
+ order = { "extrakerns" },
+ type = "gpos_pair",
+ steps = {
+ {
+ format = "kern",
+ coverage = extrakerns,
+ },
+ },
+ }
+ end
+ -- todo: compress kerns
+ data.resources.features = features
+ data.resources.sequences = sequences
+end
+
+local function enhance_fix_names(data)
+ for k, v in next, data.descriptions do
+ local n = v.name
+ local r = overloads[n]
+ if r then
+ local name = r.name
+ if trace_indexing then
+ report_afm("renaming characters %a to %a",n,name)
+ end
+ v.name = name
+ v.unicode = r.unicode
+ end
+ end
+end
+
+--[[ldx--
+<p>These helpers extend the basic table with extra ligatures, texligatures
+and extra kerns. This saves quite some lookups later.</p>
+--ldx]]--
+
+local addthem = function(rawdata,ligatures)
+ if ligatures then
+ local descriptions = rawdata.descriptions
+ local resources = rawdata.resources
+ local unicodes = resources.unicodes
+ -- local names = resources.names
+ for ligname, ligdata in next, ligatures do
+ local one = descriptions[unicodes[ligname]]
+ if one then
+ for _, pair in next, ligdata do
+ local two = unicodes[pair[1]]
+ local three = unicodes[pair[2]]
+ if two and three then
+ local ol = one.ligatures
+ if ol then
+ if not ol[two] then
+ ol[two] = three
+ end
+ else
+ one.ligatures = { [two] = three }
+ end
+ end
+ end
+ end
+ end
+ end
+end
+
+local function enhance_add_ligatures(rawdata)
+ addthem(rawdata,afm.helpdata.ligatures)
+end
+
+--[[ldx--
+<p>We keep the extra kerns in separate kerning tables so that we can use
+them selectively.</p>
+--ldx]]--
+
+-- This is rather old code (from the beginning when we had only tfm). If
+-- we unify the afm data (now we have names all over the place) then
+-- we can use shcodes but there will be many more looping then. But we
+-- could get rid of the tables in char-cmp then. Als, in the generic version
+-- we don't use the character database. (Ok, we can have a context specific
+-- variant).
+
+local function enhance_add_extra_kerns(rawdata) -- using shcodes is not robust here
+ local descriptions = rawdata.descriptions
+ local resources = rawdata.resources
+ local unicodes = resources.unicodes
+ local function do_it_left(what)
+ if what then
+ for unicode, description in next, descriptions do
+ local kerns = description.kerns
+ if kerns then
+ local extrakerns
+ for complex, simple in next, what do
+ complex = unicodes[complex]
+ simple = unicodes[simple]
+ if complex and simple then
+ local ks = kerns[simple]
+ if ks and not kerns[complex] then
+ if extrakerns then
+ extrakerns[complex] = ks
+ else
+ extrakerns = { [complex] = ks }
+ end
+ end
+ end
+ end
+ if extrakerns then
+ description.extrakerns = extrakerns
+ end
+ end
+ end
+ end
+ end
+ local function do_it_copy(what)
+ if what then
+ for complex, simple in next, what do
+ complex = unicodes[complex]
+ simple = unicodes[simple]
+ if complex and simple then
+ local complexdescription = descriptions[complex]
+ if complexdescription then -- optional
+ local simpledescription = descriptions[complex]
+ if simpledescription then
+ local extrakerns
+ local kerns = simpledescription.kerns
+ if kerns then
+ for unicode, kern in next, kerns do
+ if extrakerns then
+ extrakerns[unicode] = kern
+ else
+ extrakerns = { [unicode] = kern }
+ end
+ end
+ end
+ local extrakerns = simpledescription.extrakerns
+ if extrakerns then
+ for unicode, kern in next, extrakerns do
+ if extrakerns then
+ extrakerns[unicode] = kern
+ else
+ extrakerns = { [unicode] = kern }
+ end
+ end
+ end
+ if extrakerns then
+ complexdescription.extrakerns = extrakerns
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ -- add complex with values of simplified when present
+ do_it_left(afm.helpdata.leftkerned)
+ do_it_left(afm.helpdata.bothkerned)
+ -- copy kerns from simple char to complex char unless set
+ do_it_copy(afm.helpdata.bothkerned)
+ do_it_copy(afm.helpdata.rightkerned)
+end
+
+--[[ldx--
+<p>The copying routine looks messy (and is indeed a bit messy).</p>
+--ldx]]--
+
+local function adddimensions(data) -- we need to normalize afm to otf i.e. indexed table instead of name
+ if data then
+ for unicode, description in next, data.descriptions do
+ local bb = description.boundingbox
+ if bb then
+ local ht = bb[4]
+ local dp = -bb[2]
+ if ht == 0 or ht < 0 then
+ -- no need to set it and no negative heights, nil == 0
+ else
+ description.height = ht
+ end
+ if dp == 0 or dp < 0 then
+ -- no negative depths and no negative depths, nil == 0
+ else
+ description.depth = dp
+ end
+ end
+ end
+ end
+end
+
+local function copytotfm(data)
+ if data and data.descriptions then
+ local metadata = data.metadata
+ local resources = data.resources
+ local properties = derivetable(data.properties)
+ local descriptions = derivetable(data.descriptions)
+ local goodies = derivetable(data.goodies)
+ local characters = { }
+ local parameters = { }
+ local unicodes = resources.unicodes
+ --
+ for unicode, description in next, data.descriptions do -- use parent table
+ characters[unicode] = { }
+ end
+ --
+ local filename = constructors.checkedfilename(resources)
+ local fontname = metadata.fontname or metadata.fullname
+ local fullname = metadata.fullname or metadata.fontname
+ local endash = 0x2013
+ local emdash = 0x2014
+ local space = 0x0020 -- space
+ local spacer = "space"
+ local spaceunits = 500
+ --
+ local monospaced = metadata.monospaced
+ local charwidth = metadata.charwidth
+ local italicangle = metadata.italicangle
+ local charxheight = metadata.xheight and metadata.xheight > 0 and metadata.xheight
+ properties.monospaced = monospaced
+ parameters.italicangle = italicangle
+ parameters.charwidth = charwidth
+ parameters.charxheight = charxheight
+ -- nearly the same as otf, catches
+ local d_endash = descriptions[endash]
+ local d_emdash = descriptions[emdash]
+ local d_space = descriptions[space]
+ if not d_space or d_space == 0 then
+ d_space = d_endash
+ end
+ if d_space then
+ spaceunits, spacer = d_space.width or 0, "space"
+ end
+ if properties.monospaced then
+ if spaceunits == 0 and d_emdash then
+ spaceunits, spacer = d_emdash.width or 0, "emdash"
+ end
+ else
+ if spaceunits == 0 and d_endash then
+ spaceunits, spacer = d_emdash.width or 0, "endash"
+ end
+ end
+ if spaceunits == 0 and charwidth then
+ spaceunits, spacer = charwidth or 0, "charwidth"
+ end
+ if spaceunits == 0 then
+ spaceunits = tonumber(spaceunits) or 500
+ end
+ if spaceunits == 0 then
+ spaceunits = 500
+ end
+ --
+ parameters.slant = 0
+ parameters.space = spaceunits
+ parameters.spacestretch = 500
+ parameters.spaceshrink = 333
+ parameters.xheight = 400
+ parameters.quad = 1000
+ --
+ if italicangle and italicangle ~= 0 then
+ parameters.italicangle = italicangle
+ parameters.italicfactor = math.cos(math.rad(90+italicangle))
+ parameters.slant = - math.tan(italicangle*math.pi/180)
+ end
+ if monospaced then
+ parameters.spacestretch = 0
+ parameters.spaceshrink = 0
+ elseif afm.syncspace then
+ parameters.spacestretch = spaceunits/2
+ parameters.spaceshrink = spaceunits/3
+ end
+ parameters.extraspace = parameters.spaceshrink
+ if charxheight then
+ parameters.xheight = charxheight
+ else
+ -- same as otf
+ local x = 0x0078 -- x
+ if x then
+ local x = descriptions[x]
+ if x then
+ parameters.xheight = x.height
+ end
+ end
+ --
+ end
+ --
+ if metadata.sup then
+ local dummy = { 0, 0, 0 }
+ parameters[ 1] = metadata.designsize or 0
+ parameters[ 2] = metadata.checksum or 0
+ parameters[ 3],
+ parameters[ 4],
+ parameters[ 5] = unpack(metadata.space or dummy)
+ parameters[ 6] = metadata.quad or 0
+ parameters[ 7] = metadata.extraspace or 0
+ parameters[ 8],
+ parameters[ 9],
+ parameters[10] = unpack(metadata.num or dummy)
+ parameters[11],
+ parameters[12] = unpack(metadata.denom or dummy)
+ parameters[13],
+ parameters[14],
+ parameters[15] = unpack(metadata.sup or dummy)
+ parameters[16],
+ parameters[17] = unpack(metadata.sub or dummy)
+ parameters[18] = metadata.supdrop or 0
+ parameters[19] = metadata.subdrop or 0
+ parameters[20],
+ parameters[21] = unpack(metadata.delim or dummy)
+ parameters[22] = metadata.axisheight or 0
+ end
+ --
+ parameters.designsize = (metadata.designsize or 10)*65536
+ parameters.ascender = abs(metadata.ascender or 0)
+ parameters.descender = abs(metadata.descender or 0)
+ parameters.units = 1000
+ --
+ properties.spacer = spacer
+ properties.format = fonts.formats[filename] or "type1"
+ properties.filename = filename
+ properties.fontname = fontname
+ properties.fullname = fullname
+ properties.psname = fullname
+ properties.name = filename or fullname or fontname
+ properties.private = properties.private or data.private or privateoffset
+ --
+if not CONTEXTLMTXMODE or CONTEXTLMTXMODE == 0 then
+ properties.encodingbytes = 2
+end
+ --
+ if next(characters) then
+ return {
+ characters = characters,
+ descriptions = descriptions,
+ parameters = parameters,
+ resources = resources,
+ properties = properties,
+ goodies = goodies,
+ }
+ end
+ end
+ return nil
+end
+
+--[[ldx--
+<p>Originally we had features kind of hard coded for <l n='afm'/> files but since I
+expect to support more font formats, I decided to treat this fontformat like any
+other and handle features in a more configurable way.</p>
+--ldx]]--
+
+function afm.setfeatures(tfmdata,features)
+ local okay = constructors.initializefeatures("afm",tfmdata,features,trace_features,report_afm)
+ if okay then
+ return constructors.collectprocessors("afm",tfmdata,features,trace_features,report_afm)
+ else
+ return { } -- will become false
+ end
+end
+
+local function addtables(data)
+ local resources = data.resources
+ local lookuptags = resources.lookuptags
+ local unicodes = resources.unicodes
+ if not lookuptags then
+ lookuptags = { }
+ resources.lookuptags = lookuptags
+ end
+ setmetatableindex(lookuptags,function(t,k)
+ local v = type(k) == "number" and ("lookup " .. k) or k
+ t[k] = v
+ return v
+ end)
+ if not unicodes then
+ unicodes = { }
+ resources.unicodes = unicodes
+ setmetatableindex(unicodes,function(t,k)
+ setmetatableindex(unicodes,nil)
+ for u, d in next, data.descriptions do
+ local n = d.name
+ if n then
+ t[n] = u
+ end
+ end
+ return rawget(t,k)
+ end)
+ end
+ constructors.addcoreunicodes(unicodes) -- do we really need this?
+end
+
+local function afmtotfm(specification)
+ local afmname = specification.filename or specification.name
+ if specification.forced == "afm" or specification.format == "afm" then -- move this one up
+ if trace_loading then
+ report_afm("forcing afm format for %a",afmname)
+ end
+ else
+ local tfmname = findbinfile(afmname,"ofm") or ""
+ if tfmname ~= "" then
+ if trace_loading then
+ report_afm("fallback from afm to tfm for %a",afmname)
+ end
+ return -- just that
+ end
+ end
+ if afmname ~= "" then
+ -- weird, isn't this already done then?
+ local features = constructors.checkedfeatures("afm",specification.features.normal)
+ specification.features.normal = features
+ constructors.hashinstance(specification,true) -- also weird here
+ --
+ specification = definers.resolve(specification) -- new, was forgotten
+ local cache_id = specification.hash
+ local tfmdata = containers.read(constructors.cache, cache_id) -- cache with features applied
+ if not tfmdata then
+ local rawdata = afm.load(afmname)
+ if rawdata and next(rawdata) then
+ addtables(rawdata)
+ adddimensions(rawdata)
+ tfmdata = copytotfm(rawdata)
+ if tfmdata and next(tfmdata) then
+ local shared = tfmdata.shared
+ if not shared then
+ shared = { }
+ tfmdata.shared = shared
+ end
+ shared.rawdata = rawdata
+ shared.dynamics = { }
+ tfmdata.changed = { }
+ shared.features = features
+ shared.processes = afm.setfeatures(tfmdata,features)
+ end
+ elseif trace_loading then
+ report_afm("no (valid) afm file found with name %a",afmname)
+ end
+ tfmdata = containers.write(constructors.cache,cache_id,tfmdata)
+ end
+ return tfmdata
+ end
+end
+
+--[[ldx--
+<p>As soon as we could intercept the <l n='tfm'/> reader, I implemented an
+<l n='afm'/> reader. Since traditional <l n='pdftex'/> could use <l n='opentype'/>
+fonts with <l n='afm'/> companions, the following method also could handle
+those cases, but now that we can handle <l n='opentype'/> directly we no longer
+need this features.</p>
+--ldx]]--
+
+local function read_from_afm(specification)
+ local tfmdata = afmtotfm(specification)
+ if tfmdata then
+ tfmdata.properties.name = specification.name
+ tfmdata.properties.id = specification.id
+ tfmdata = constructors.scale(tfmdata, specification)
+ local allfeatures = tfmdata.shared.features or specification.features.normal
+ constructors.applymanipulators("afm",tfmdata,allfeatures,trace_features,report_afm)
+ fonts.loggers.register(tfmdata,'afm',specification)
+ end
+ return tfmdata
+end
+
+--[[ldx--
+<p>We have the usual two modes and related features initializers and processors.</p>
+--ldx]]--
+
+registerafmfeature {
+ name = "mode",
+ description = "mode",
+ initializers = {
+ base = otf.modeinitializer,
+ node = otf.modeinitializer,
+ }
+}
+
+registerafmfeature {
+ name = "features",
+ description = "features",
+ default = true,
+ initializers = {
+ node = otf.nodemodeinitializer,
+ base = otf.basemodeinitializer,
+ },
+ processors = {
+ node = otf.featuresprocessor,
+ }
+}
+
+-- readers
+
+fonts.formats.afm = "type1"
+fonts.formats.pfb = "type1"
+
+local function check_afm(specification,fullname)
+ local foundname = findbinfile(fullname, 'afm') or "" -- just to be sure
+ if foundname == "" then
+ foundname = fonts.names.getfilename(fullname,"afm") or ""
+ end
+ if fullname and foundname == "" and afm.autoprefixed then
+ local encoding, shortname = match(fullname,"^(.-)%-(.*)$") -- context: encoding-name.*
+ if encoding and shortname and fonts.encodings.known[encoding] then
+ shortname = findbinfile(shortname,'afm') or "" -- just to be sure
+ if shortname ~= "" then
+ foundname = shortname
+ if trace_defining then
+ report_afm("stripping encoding prefix from filename %a",afmname)
+ end
+ end
+ end
+ end
+ if foundname ~= "" then
+ specification.filename = foundname
+ specification.format = "afm"
+ return read_from_afm(specification)
+ end
+end
+
+function readers.afm(specification,method)
+ local fullname = specification.filename or ""
+ local tfmdata = nil
+ if fullname == "" then
+ local forced = specification.forced or ""
+ if forced ~= "" then
+ tfmdata = check_afm(specification,specification.name .. "." .. forced)
+ end
+ if not tfmdata then
+ local check_tfm = readers.check_tfm
+ method = (check_tfm and (method or definers.method or "afm or tfm")) or "afm"
+ if method == "tfm" then
+ tfmdata = check_tfm(specification,specification.name)
+ elseif method == "afm" then
+ tfmdata = check_afm(specification,specification.name)
+ elseif method == "tfm or afm" then
+ tfmdata = check_tfm(specification,specification.name) or check_afm(specification,specification.name)
+ else -- method == "afm or tfm" or method == "" then
+ tfmdata = check_afm(specification,specification.name) or check_tfm(specification,specification.name)
+ end
+ end
+ else
+ tfmdata = check_afm(specification,fullname)
+ end
+ return tfmdata
+end
+
+function readers.pfb(specification,method) -- only called when forced
+ local original = specification.specification
+ if trace_defining then
+ report_afm("using afm reader for %a",original)
+ end
+ specification.forced = "afm"
+ local function swap(name)
+ local value = specification[swap]
+ if value then
+ specification[swap] = gsub("%.pfb",".afm",1)
+ end
+ end
+ swap("filename")
+ swap("fullname")
+ swap("forcedname")
+ swap("specification")
+ return readers.afm(specification,method)
+end
+
+-- now we register them
+
+registerafmenhancer("unify names", enhance_unify_names)
+registerafmenhancer("add ligatures", enhance_add_ligatures)
+registerafmenhancer("add extra kerns", enhance_add_extra_kerns)
+registerafmenhancer("normalize features", enhance_normalize_features)
+registerafmenhancer("check extra features", otfenhancers.enhance)
+registerafmenhancer("fix names", enhance_fix_names)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-onr.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-onr.lmt
new file mode 100644
index 00000000000..d28c247df63
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-onr.lmt
@@ -0,0 +1,614 @@
+if not modules then modules = { } end modules ['font-onr'] = {
+ version = 1.001,
+ optimize = true,
+ comment = "companion to font-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+--[[ldx--
+<p>Some code may look a bit obscure but this has to do with the fact that we also use
+this code for testing and much code evolved in the transition from <l n='tfm'/> to
+<l n='afm'/> to <l n='otf'/>.</p>
+
+<p>The following code still has traces of intermediate font support where we handles
+font encodings. Eventually font encoding went away but we kept some code around in
+other modules.</p>
+
+<p>This version implements a node mode approach so that users can also more easily
+add features.</p>
+--ldx]]--
+
+local fonts, logs, trackers, resolvers = fonts, logs, trackers, resolvers
+
+local next, type, tonumber, rawset = next, type, tonumber, rawset
+local match, lower, gsub, strip, find = string.match, string.lower, string.gsub, string.strip, string.find
+local char, byte, sub = string.char, string.byte, string.sub
+local abs = math.abs
+----- bxor, rshift = bit32.bxor, bit32.rshift
+local P, S, R, V, Cmt, C, Ct, Cs, Carg, Cf, Cg, Cc = lpeg.P, lpeg.S, lpeg.R, lpeg.V, lpeg.Cmt, lpeg.C, lpeg.Ct, lpeg.Cs, lpeg.Carg, lpeg.Cf, lpeg.Cg, lpeg.Cc
+local lpegmatch, patterns = lpeg.match, lpeg.patterns
+
+local trace_indexing = false trackers.register("afm.indexing", function(v) trace_indexing = v end)
+local trace_loading = false trackers.register("afm.loading", function(v) trace_loading = v end)
+
+local report_afm = logs.reporter("fonts","afm loading")
+local report_pfb = logs.reporter("fonts","pfb loading")
+
+local handlers = fonts.handlers
+
+local afm = handlers.afm or { }
+handlers.afm = afm
+afm.version = 1.513 -- incrementing this number one up will force a re-cache
+
+local pfb = handlers.pfb or { }
+handlers.pfb = pfb
+pfb.version = 1.002
+
+local readers = afm.readers or { }
+afm.readers = readers
+
+--[[ldx--
+<p>We start with the basic reader which we give a name similar to the built in <l n='tfm'/>
+and <l n='otf'/> reader.</p>
+<p>We use a new (unfinished) pfb loader but I see no differences between the old
+and new vectors (we actually had one bad vector with the old loader).</p>
+--ldx]]--
+
+local get_indexes, get_shapes
+
+do
+
+ local decrypt
+
+ do
+
+ local r, c1, c2, n = 0, 0, 0, 0
+
+ local function step(c)
+ local cipher = byte(c)
+ -- local plain = bxor(cipher,rshift(r,8))
+ local plain = (cipher ~ ((r >> 8) & 0xFFFFFFFF))
+ -- r = ((cipher + r) * c1 + c2) % 65536
+ r = ((cipher + r) * c1 + c2) % 0x10000
+ return char(plain)
+ end
+
+ decrypt = function(binary,initial,seed)
+ r, c1, c2, n = initial, 52845, 22719, seed
+ binary = gsub(binary,".",step)
+ return sub(binary,n+1)
+ end
+
+ -- local pattern = Cs((P(1) / step)^1)
+ --
+ -- decrypt = function(binary,initial,seed)
+ -- r, c1, c2, n = initial, 52845, 22719, seed
+ -- binary = lpegmatch(pattern,binary)
+ -- return sub(binary,n+1)
+ -- end
+
+ end
+
+ local charstrings = P("/CharStrings")
+ local subroutines = P("/Subrs")
+ local encoding = P("/Encoding")
+ local dup = P("dup")
+ local put = P("put")
+ local array = P("array")
+ local name = P("/") * C((R("az","AZ","09")+S("-_."))^1)
+ local digits = R("09")^1
+ local cardinal = digits / tonumber
+ local spaces = P(" ")^1
+ local spacing = patterns.whitespace^0
+
+ local routines, vector, chars, n, m
+
+ local initialize = function(str,position,size)
+ n = 0
+ m = size
+ return position + 1
+ end
+
+ local setroutine = function(str,position,index,size,filename)
+ if routines[index] then
+ -- we have passed the end
+ return false
+ end
+ local forward = position + size
+ local stream = decrypt(sub(str,position+1,forward),4330,4)
+ routines[index] = { byte(stream,1,#stream) }
+ n = n + 1
+ if n >= m then
+ -- m should be index now but can we assume ordering?
+ return #str
+ end
+ return forward + 1
+ end
+
+ local setvector = function(str,position,name,size,filename)
+ local forward = position + tonumber(size)
+ if n >= m then
+ return #str
+ elseif forward < #str then
+ if n == 0 and name ~= ".notdef" then
+ report_pfb("reserving .notdef at index 0 in %a",filename) -- luatex needs that
+ n = n + 1
+ end
+ vector[n] = name
+ n = n + 1
+ return forward
+ else
+ return #str
+ end
+ end
+
+ local setshapes = function(str,position,name,size,filename)
+ local forward = position + tonumber(size)
+ local stream = sub(str,position+1,forward)
+ if n > m then
+ return #str
+ elseif forward < #str then
+ if n == 0 and name ~= ".notdef" then
+ report_pfb("reserving .notdef at index 0 in %a",filename) -- luatex needs that
+ n = n + 1
+ end
+ vector[n] = name
+ n = n + 1
+ chars [n] = decrypt(stream,4330,4)
+ return forward
+ else
+ return #str
+ end
+ end
+
+ local p_rd = spacing * (P("RD") + P("-|"))
+ local p_np = spacing * (P("NP") + P( "|"))
+ local p_nd = spacing * (P("ND") + P( "|"))
+
+ local p_filterroutines = -- dup <i> <n> RD or -| <n encrypted bytes> NP or |
+ (1-subroutines)^0 * subroutines * spaces * Cmt(cardinal,initialize)
+ * (Cmt(cardinal * spaces * cardinal * p_rd * Carg(1), setroutine) * p_np + (1-p_nd))^1
+
+ local p_filtershapes = -- /foo <n> RD <n encrypted bytes> ND
+ (1-charstrings)^0 * charstrings * spaces * Cmt(cardinal,initialize)
+ * (Cmt(name * spaces * cardinal * p_rd * Carg(1) , setshapes) * p_nd + P(1))^1
+
+ local p_filternames = Ct (
+ (1-charstrings)^0 * charstrings * spaces * Cmt(cardinal,initialize)
+ * (Cmt(name * spaces * cardinal * Carg(1), setvector) + P(1))^1
+ )
+
+ -- /Encoding 256 array
+ -- 0 1 255 {1 index exch /.notdef put} for
+ -- dup 0 /Foo put
+
+ local p_filterencoding =
+ (1-encoding)^0 * encoding * spaces * digits * spaces * array * (1-dup)^0
+ * Cf(
+ Ct("") * Cg(spacing * dup * spaces * cardinal * spaces * name * spaces * put)^1
+ ,rawset)
+
+ -- if one of first 4 not 0-9A-F then binary else hex
+
+ local key = spacing * P("/") * R("az","AZ")
+ local str = spacing * Cs { (P("(")/"") * ((1 - P("\\(") - P("\\)") - S("()")) + V(1))^0 * (P(")")/"") }
+ local num = spacing * (R("09") + S("+-."))^1 / tonumber
+ local arr = spacing * Ct (S("[{") * (num)^0 * spacing * S("]}"))
+ local boo = spacing * (P("true") * Cc(true) + P("false") * Cc(false))
+ local nam = spacing * P("/") * Cs(R("az","AZ")^1)
+
+ local p_filtermetadata = (
+ P("/") * Carg(1) * ( (
+ C("version") * str
+ + C("Copyright") * str
+ + C("Notice") * str
+ + C("FullName") * str
+ + C("FamilyName") * str
+ + C("Weight") * str
+ + C("ItalicAngle") * num
+ + C("isFixedPitch") * boo
+ + C("UnderlinePosition") * num
+ + C("UnderlineThickness") * num
+ + C("FontName") * nam
+ + C("FontMatrix") * arr
+ + C("FontBBox") * arr
+ + C("FontType") * num
+ ) ) / function (t,k,v) t[lower(k)] = v end
+ + P(1)
+ )^0 * Carg(1)
+
+ -- cache this?
+
+ local filecache = containers.define("fonts", "pfb", pfb.version, true)
+ local cleanname = fonts.handlers.otf.readers.helpers.cleanname
+
+ local caching = true -- mainly for MS and HH as they test huge files with many instances
+
+ local function loadpfbvector(filename,shapestoo,streams)
+ -- for the moment limited to encoding only
+
+ local fullname = resolvers.findfile(filename)
+
+ if not fullname or fullname == "" then
+ report_pfb("unknown file %a",filename)
+ return
+ end
+
+ local fileattr = lfs.attributes(fullname)
+ local filesize = fileattr and fileattr.size or 0
+ local filetime = fileattr and fileattr.modification or 0
+ local fileformat = "pfb"
+ local filehash = cleanname(file.basename(filename))
+
+ local names = nil
+ local encoding = nil
+ local metadata = nil
+ local glyphs = { }
+
+ local data = caching and containers.read(filecache,filehash)
+ if data and data.filetime == filetime and data.filesize == filesize and data.fileformat == fileformat then
+ names = data.names
+ encoding = data.encoding
+ metadata = data.metadata
+ end
+
+ if shapestoo or streams then
+ -- not cached
+ elseif names then
+ return names, encoding, glyphs, metadata
+ end
+
+ local data = io.loaddata(fullname)
+
+ if not data then
+ report_pfb("no data in %a",filename)
+ return
+ end
+
+ if not (find(data,"!PS-AdobeFont-",1,true) or find(data,"%!FontType1",1,true)) then
+ report_pfb("no font in %a",filename)
+ return
+ end
+
+ local ascii, binary = match(data,"(.*)eexec%s+......(.*)")
+
+ if not binary then
+ report_pfb("no binary data in %a",filename)
+ return
+ end
+
+ binary = decrypt(binary,55665,4)
+
+ if not encoding then
+ encoding = lpegmatch(p_filterencoding,ascii)
+ end
+ if not metadata then
+ metadata = lpegmatch(p_filtermetadata,ascii,1,{})
+ end
+
+ glyphs = { }
+ routines = { }
+ vector = { }
+ chars = { }
+
+ if shapestoo or streams then
+ -- io.savedata("foo.txt",binary)
+ lpegmatch(p_filterroutines,binary,1,filename)
+ lpegmatch(p_filtershapes, binary,1,filename)
+ local data = {
+ dictionaries = {
+ {
+ charstrings = chars,
+ charset = vector,
+ subroutines = routines,
+ }
+ },
+ }
+ local version = metadata.FontType or 1
+ -- only cff 1 in type 1 fonts
+ fonts.handlers.otf.readers.parsecharstrings(false,data,glyphs,true,"cff",streams,true,true)
+ elseif not names then
+ lpegmatch(p_filternames,binary,1,filename)
+ end
+
+ names = names or vector
+ routines = nil
+ vector = nil
+ chars = nil
+
+ if caching then
+ containers.write(filecache,filehash,{
+ filesize = filesize,
+ fileformat = fileformat,
+ filetime = filetime,
+ names = names,
+ encoding = encoding,
+ metadata = metadata,
+ })
+ end
+
+ return names, encoding, glyphs, metadata
+
+ end
+
+ pfb.loadvector = loadpfbvector
+
+ get_indexes = function(data,pfbname)
+ local vector = loadpfbvector(pfbname)
+ if vector then
+ local characters = data.characters
+ if trace_loading then
+ report_afm("getting index data from %a",pfbname)
+ end
+ for index=0,#vector do -- hm, zero, often space or notdef
+ local name = vector[index]
+ local char = characters[name]
+ if char then
+ if trace_indexing then
+ report_afm("glyph %a has index %a",name,index)
+ end
+ char.index = index
+ else
+ if trace_indexing then
+ report_afm("glyph %a has index %a but no data",name,index)
+ end
+ end
+ end
+ end
+ end
+
+ get_shapes = function(pfbname)
+ local vector, encoding, glyphs = loadpfbvector(pfbname,true)
+ return glyphs
+ end
+
+end
+
+--[[ldx--
+<p>We start with the basic reader which we give a name similar to the built in <l n='tfm'/>
+and <l n='otf'/> reader. We only need data that is relevant for our use. We don't support
+more complex arrangements like multiple master (obsolete), direction specific kerning, etc.</p>
+--ldx]]--
+
+local spacer = patterns.spacer
+local whitespace = patterns.whitespace
+local lineend = patterns.newline
+local spacing = spacer^0
+local number = spacing * S("+-")^-1 * (R("09") + S("."))^1 / tonumber
+local name = spacing * C((1 - whitespace)^1)
+local words = spacing * ((1 - lineend)^1 / strip)
+local rest = (1 - lineend)^0
+local fontdata = Carg(1)
+local semicolon = spacing * P(";")
+local plus = spacing * P("plus") * number
+local minus = spacing * P("minus") * number
+
+-- kern pairs
+
+local function addkernpair(data,one,two,value)
+ local chr = data.characters[one]
+ if chr then
+ local kerns = chr.kerns
+ if kerns then
+ kerns[two] = tonumber(value)
+ else
+ chr.kerns = { [two] = tonumber(value) }
+ end
+ end
+end
+
+local p_kernpair = (fontdata * P("KPX") * name * name * number) / addkernpair
+
+-- char metrics
+
+local chr = false
+local ind = 0
+
+local function start(data,version)
+ data.metadata.afmversion = version
+ ind = 0
+ chr = { }
+end
+
+local function stop()
+ ind = 0
+ chr = false
+end
+
+local function setindex(i)
+ if i < 0 then
+ ind = ind + 1 -- ?
+ else
+ ind = i
+ end
+ chr = {
+ index = ind
+ }
+end
+
+local function setwidth(width)
+ chr.width = width
+end
+
+local function setname(data,name)
+ data.characters[name] = chr
+end
+
+local function setboundingbox(boundingbox)
+ chr.boundingbox = boundingbox
+end
+
+local function setligature(plus,becomes)
+ local ligatures = chr.ligatures
+ if ligatures then
+ ligatures[plus] = becomes
+ else
+ chr.ligatures = { [plus] = becomes }
+ end
+end
+
+local p_charmetric = ( (
+ P("C") * number / setindex
+ + P("WX") * number / setwidth
+ + P("N") * fontdata * name / setname
+ + P("B") * Ct((number)^4) / setboundingbox
+ + P("L") * (name)^2 / setligature
+ ) * semicolon )^1
+
+local p_charmetrics = P("StartCharMetrics") * number * (p_charmetric + (1-P("EndCharMetrics")))^0 * P("EndCharMetrics")
+local p_kernpairs = P("StartKernPairs") * number * (p_kernpair + (1-P("EndKernPairs" )))^0 * P("EndKernPairs" )
+
+local function set_1(data,key,a) data.metadata[lower(key)] = a end
+local function set_2(data,key,a,b) data.metadata[lower(key)] = { a, b } end
+local function set_3(data,key,a,b,c) data.metadata[lower(key)] = { a, b, c } end
+
+-- Notice string
+-- EncodingScheme string
+-- MappingScheme integer
+-- EscChar integer
+-- CharacterSet string
+-- Characters integer
+-- IsBaseFont boolean
+-- VVector number number
+-- IsFixedV boolean
+
+local p_parameters = P(false)
+ + fontdata
+ * ((P("FontName") + P("FullName") + P("FamilyName"))/lower)
+ * words / function(data,key,value)
+ data.metadata[key] = value
+ end
+ + fontdata
+ * ((P("Weight") + P("Version"))/lower)
+ * name / function(data,key,value)
+ data.metadata[key] = value
+ end
+ + fontdata
+ * P("IsFixedPitch")
+ * name / function(data,pitch)
+ data.metadata.monospaced = toboolean(pitch,true)
+ end
+ + fontdata
+ * P("FontBBox")
+ * Ct(number^4) / function(data,boundingbox)
+ data.metadata.boundingbox = boundingbox
+ end
+ + fontdata
+ * ((P("CharWidth") + P("CapHeight") + P("XHeight") + P("Descender") + P("Ascender") + P("ItalicAngle"))/lower)
+ * number / function(data,key,value)
+ data.metadata[key] = value
+ end
+ + P("Comment") * spacing * ( P(false)
+ + (fontdata * C("DESIGNSIZE") * number * rest) / set_1 -- 1
+ + (fontdata * C("TFM designsize") * number * rest) / set_1
+ + (fontdata * C("DesignSize") * number * rest) / set_1
+ + (fontdata * C("CODINGSCHEME") * words * rest) / set_1 --
+ + (fontdata * C("CHECKSUM") * number * words * rest) / set_1 -- 2
+ + (fontdata * C("SPACE") * number * plus * minus * rest) / set_3 -- 3 4 5
+ + (fontdata * C("QUAD") * number * rest) / set_1 -- 6
+ + (fontdata * C("EXTRASPACE") * number * rest) / set_1 -- 7
+ + (fontdata * C("NUM") * number * number * number * rest) / set_3 -- 8 9 10
+ + (fontdata * C("DENOM") * number * number * rest) / set_2 -- 11 12
+ + (fontdata * C("SUP") * number * number * number * rest) / set_3 -- 13 14 15
+ + (fontdata * C("SUB") * number * number * rest) / set_2 -- 16 17
+ + (fontdata * C("SUPDROP") * number * rest) / set_1 -- 18
+ + (fontdata * C("SUBDROP") * number * rest) / set_1 -- 19
+ + (fontdata * C("DELIM") * number * number * rest) / set_2 -- 20 21
+ + (fontdata * C("AXISHEIGHT") * number * rest) / set_1 -- 22
+ )
+
+local fullparser = ( P("StartFontMetrics") * fontdata * name / start )
+ * ( p_charmetrics + p_kernpairs + p_parameters + (1-P("EndFontMetrics")) )^0
+ * ( P("EndFontMetrics") / stop )
+
+local infoparser = ( P("StartFontMetrics") * fontdata * name / start )
+ * ( p_parameters + (1-P("EndFontMetrics")) )^0
+ * ( P("EndFontMetrics") / stop )
+
+-- infoparser = ( P("StartFontMetrics") * fontdata * name / start )
+-- * ( p_parameters + (1-P("EndFontMetrics") - P("StartCharMetrics")) )^0
+-- * ( (P("EndFontMetrics") + P("StartCharMetrics")) / stop )
+
+local function read(filename,parser)
+ local afmblob = io.loaddata(filename)
+ if afmblob then
+ local data = {
+ resources = {
+ filename = resolvers.unresolve(filename),
+ version = afm.version,
+ creator = "context mkiv",
+ },
+ properties = {
+ hasitalics = false,
+ },
+ goodies = {
+ },
+ metadata = {
+ filename = file.removesuffix(file.basename(filename))
+ },
+ characters = {
+ -- a temporary store
+ },
+ descriptions = {
+ -- the final store
+ },
+ }
+ if trace_loading then
+ report_afm("parsing afm file %a",filename)
+ end
+ lpegmatch(parser,afmblob,1,data)
+ return data
+ else
+ if trace_loading then
+ report_afm("no valid afm file %a",filename)
+ end
+ return nil
+ end
+end
+
+function readers.loadfont(afmname,pfbname)
+ local data = read(resolvers.findfile(afmname),fullparser)
+ if data then
+ if not pfbname or pfbname == "" then
+ pfbname = resolvers.findfile(file.replacesuffix(file.nameonly(afmname),"pfb"))
+ end
+ if pfbname and pfbname ~= "" then
+ data.resources.filename = resolvers.unresolve(pfbname)
+ get_indexes(data,pfbname)
+ return data
+ else -- if trace_loading then
+ report_afm("no pfb file for %a",afmname)
+ -- better than loading the afm file: data.resources.filename = rawname
+ -- but that will still crash the backend so we just return nothing now
+ end
+ end
+end
+
+-- for now, todo: n and check with otf (no afm needed here)
+
+function readers.loadshapes(filename)
+ local fullname = resolvers.findfile(filename) or ""
+ if fullname == "" then
+ return {
+ filename = "not found: " .. filename,
+ glyphs = { }
+ }
+ else
+ return {
+ filename = fullname,
+ format = "opentype",
+ glyphs = get_shapes(fullname) or { },
+ units = 1000,
+ }
+ end
+end
+
+
+function readers.getinfo(filename)
+ local data = read(resolvers.findfile(filename),infoparser)
+ if data then
+ return data.metadata
+ end
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-ota.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-ota.lmt
index 6475c57e64b..157270ef18d 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-ota.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-ota.lmt
@@ -42,7 +42,7 @@ local ischar = nuts.ischar
local isnextchar = nuts.isnextchar
----- isprevchar = nuts.isprevchar
-local end_of_math = nuts.end_of_math
+local endofmath = nuts.endofmath
local nodecodes = nodes.nodecodes
local disc_code = nodecodes.disc
@@ -216,8 +216,8 @@ function analyzers.setstate(head,font) -- latin
end
first = false
if id == math_code then
- -- current = end_of_math(current)
- nxt = getnext(end_of_math(current))
+ -- current = endofmath(current)
+ nxt = getnext(endofmath(current))
end
elseif id == disc_code then
-- always in the middle .. it doesn't make much sense to assign a property
@@ -231,7 +231,7 @@ function analyzers.setstate(head,font) -- latin
end
first = false
if id == math_code then
- current = end_of_math(current)
+ current = endofmath(current)
end
end
::NEXT::
@@ -430,8 +430,8 @@ function methods.arab(head,font,attr)
first = nil
end
if id == math_code then -- a bit duplicate as we test for glyphs twice
- -- current = end_of_math(current)
- nxt = getnext(end_of_math(current))
+ -- current = endofmath(current)
+ nxt = getnext(endofmath(current))
end
end
-- current = getnext(current)
@@ -560,8 +560,8 @@ do
wrapup()
end
if id == math_code then -- a bit duplicate as we test for glyphs twice
- -- current = end_of_math(current)
- nxt = getnext(end_of_math(current))
+ -- current = endofmath(current)
+ nxt = getnext(endofmath(current))
end
end
-- current = getnext(current)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-otd.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-otd.lmt
new file mode 100644
index 00000000000..3f1b212dbb3
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-otd.lmt
@@ -0,0 +1,284 @@
+if not modules then modules = { } end modules ['font-otd'] = {
+ version = 1.001,
+ optimize = true,
+ comment = "companion to font-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local type = type
+local match = string.match
+local sequenced = table.sequenced
+
+local trace_dynamics = false trackers.register("otf.dynamics", function(v) trace_dynamics = v end)
+local trace_applied = false trackers.register("otf.applied", function(v) trace_applied = v end)
+
+local report_otf = logs.reporter("fonts","otf loading")
+local report_process = logs.reporter("fonts","otf process")
+
+local allocate = utilities.storage.allocate
+
+local fonts = fonts
+local otf = fonts.handlers.otf
+local hashes = fonts.hashes
+local definers = fonts.definers
+local constructors = fonts.constructors
+local specifiers = fonts.specifiers
+
+local fontidentifiers = hashes.identifiers
+local fontresources = hashes.resources
+local fontproperties = hashes.properties
+local fontdynamics = hashes.dynamics
+
+local contextsetups = specifiers.contextsetups
+local contextnumbers = specifiers.contextnumbers
+local contextmerged = specifiers.contextmerged
+
+local setmetatableindex = table.setmetatableindex
+
+local a_to_script = { }
+local a_to_language = { }
+
+-- we can have a scripts hash in fonts.hashes
+
+function otf.setdynamics(font,attribute)
+ -- local features = contextsetups[contextnumbers[attribute]] -- can be moved to caller
+ local features = contextsetups[attribute]
+ if features then
+ local dynamics = fontdynamics[font]
+ dynamic = contextmerged[attribute] or 0
+ local script, language
+ if dynamic == 2 then -- merge
+ language = features.language or fontproperties[font].language or "dflt"
+ script = features.script or fontproperties[font].script or "dflt"
+ else -- if dynamic == 1 then -- replace
+ language = features.language or "dflt"
+ script = features.script or "dflt"
+ end
+ if script == "auto" then
+ -- checkedscript and resources are defined later so we cannot shortcut them -- todo: make installer
+ script = definers.checkedscript(fontidentifiers[font],fontresources[font],features)
+ end
+ local ds = dynamics[script] -- can be metatable magic (less testing)
+-- or dynamics.dflt
+ if not ds then
+ ds = { }
+ dynamics[script] = ds
+ end
+ local dsl = ds[language]
+-- or ds.dflt
+ if not dsl then
+ dsl = { }
+ ds[language] = dsl
+ end
+ local dsla = dsl[attribute]
+ if not dsla then
+ local tfmdata = fontidentifiers[font]
+ a_to_script [attribute] = script
+ a_to_language[attribute] = language
+ -- we need to save some values .. quite messy
+ local properties = tfmdata.properties
+ local shared = tfmdata.shared
+ local s_script = properties.script
+ local s_language = properties.language
+ local s_mode = properties.mode
+ local s_features = shared.features
+ properties.mode = "node"
+ properties.language = language
+ properties.script = script
+ properties.dynamics = true -- handy for tracing
+ shared.features = { }
+ -- end of save
+ local set = constructors.checkedfeatures("otf",features)
+ set.mode = "node" -- really needed
+ dsla = otf.setfeatures(tfmdata,set)
+ if trace_dynamics then
+ report_otf("setting dynamics %s: attribute %a, script %a, language %a, set %a",contextnumbers[attribute],attribute,script,language,set)
+ end
+ -- we need to restore some values
+ properties.script = s_script
+ properties.language = s_language
+ properties.mode = s_mode
+ shared.features = s_features
+ -- end of restore
+ dynamics[script][language][attribute] = dsla -- cache
+ elseif trace_dynamics then
+ -- report_otf("using dynamics %s: attribute %a, script %a, language %a",contextnumbers[attribute],attribute,script,language)
+ end
+ return dsla
+ end
+end
+
+function otf.scriptandlanguage(tfmdata,attr)
+ local properties = tfmdata.properties
+ if attr and attr > 0 then
+ return a_to_script[attr] or properties.script or "dflt", a_to_language[attr] or properties.language or "dflt"
+ else
+ return properties.script or "dflt", properties.language or "dflt"
+ end
+end
+
+-- we reimplement the dataset resolver
+
+local autofeatures = fonts.analyzers.features
+local featuretypes = otf.tables.featuretypes
+local defaultscript = otf.features.checkeddefaultscript
+local defaultlanguage = otf.features.checkeddefaultlanguage
+
+local resolved = { } -- we only resolve a font,script,language,attribute pair once
+local wildcard = "*"
+
+-- what about analyze in local and not in font
+
+-- needs checking: some added features can pass twice
+
+local P, C, Cc, lpegmatch = lpeg.P, lpeg.C, lpeg.Cc, lpeg.match
+
+local pattern = P("always") * (P(-1) * Cc(true) + P(":") * C((1-P(-1))^1))
+
+local function initialize(sequence,script,language,s_enabled,a_enabled,font,attr,dynamic,ra,autoscript,autolanguage)
+ local features = sequence.features
+ if features then
+ local order = sequence.order
+ if order then
+ local featuretype = featuretypes[sequence.type or "unknown"]
+ local lookupdone = false
+ for i=1,#order do --
+ local kind = order[i] --
+ local e_e
+ local a_e = a_enabled and a_enabled[kind] -- the value (location)
+ if a_e ~= nil then
+ e_e = a_e
+ else
+ e_e = s_enabled and s_enabled[kind] -- the value (font)
+ end
+ if e_e then
+ local usedattribute, usedscript, usedlanguage, usedlookup
+ local valid = type(e_e) == "string" and lpegmatch(pattern,e_e)
+ if valid then
+ -- we have hit always
+ usedattribute = autofeatures[kind] or false
+ usedlanguage = "*"
+ usedscript = "*"
+ usedlookup = { valid, usedattribute, sequence, kind }
+ else
+ -- we already checked for e_e
+ local scripts = features[kind] --
+ local languages = scripts[script] or scripts[wildcard]
+ if not languages and autoscript then
+ langages = defaultscript(featuretype,autoscript,scripts)
+ end
+ if languages then
+ -- we need detailed control over default because we want to trace
+ -- only first attribute match check, so we assume simple fina's
+ -- local valid = false
+ if languages[language] then
+ valid = e_e
+ elseif languages[wildcard] then
+ valid = e_e
+ elseif autolanguage and defaultlanguage(featuretype,autolanguage,languages) then
+ valid = e_e
+ end
+ end
+ if valid then
+ usedattribute = autofeatures[kind] or false
+ usedlanguage = script
+ usedscript = language
+ usedlookup = { valid, usedattribute, sequence, kind }
+ end
+ end
+ if not usedlookup then
+ -- go on
+ elseif lookupdone then
+ if trace_applied then
+ report_process(
+ "font %s, dynamic %a (%a), feature %a, script %a, language %a, lookup %a, value %a, nofsteps %a, lookup already set by %a",
+ font,attr or 0,dynamic,kind,usedscript,usedlanguage,sequence.name,valid,sequence.nofsteps,ra[#ra][4])
+ end
+ else
+ ra[#ra+1] = usedlookup
+ if trace_applied then
+ report_process(
+ "font %s, dynamic %a (%a), feature %a, script %a, language %a, lookup %a, value %a, nofsteps %a",
+ font,attr or 0,dynamic,kind,usedscript,usedlanguage,sequence.name,valid,sequence.nofsteps)
+ else
+ return -- no need to look further
+ end
+ lookupdone = true
+ end
+ end
+ end
+ end
+ end
+end
+
+-- there is some fuzzy language/script state stuff in properties (temporary)
+
+function otf.dataset(tfmdata,font,attr) -- attr only when explicit (as in special parbuilder)
+
+ local script, language, s_enabled, a_enabled, dynamic
+
+ if attr and attr ~= 0 then
+ dynamic = contextmerged[attr] or 0
+ -- local features = contextsetups[contextnumbers[attr]] -- could be a direct list
+ local features = contextsetups[attr]
+ a_enabled = features -- location based
+ if dynamic == 1 then -- or dynamic == -1 then
+ -- replace
+ language = features.language or "dflt"
+ script = features.script or "dflt"
+ elseif dynamic == 2 then -- or dynamic == -2 then
+ -- merge
+ local properties = tfmdata.properties
+ s_enabled = tfmdata.shared.features -- font based
+ language = features.language or properties.language or "dflt"
+ script = features.script or properties.script or "dflt"
+ else
+ -- error
+ local properties = tfmdata.properties
+ language = properties.language or "dflt"
+ script = properties.script or "dflt"
+ end
+ else
+ local properties = tfmdata.properties
+ language = properties.language or "dflt"
+ script = properties.script or "dflt"
+ s_enabled = tfmdata.shared.features -- can be made local to the resolver
+ dynamic = 0
+ end
+
+ local res = resolved[font]
+ if not res then
+ res = { }
+ resolved[font] = res
+ end
+ local rs = res[script]
+ if not rs then
+ rs = { }
+ res[script] = rs
+ end
+ local rl = rs[language]
+ if not rl then
+ rl = { }
+ rs[language] = rl
+ end
+ local ra = rl[attr]
+ if ra == nil then -- attr can be false
+ ra = {
+ -- indexed but we can also add specific data by key in:
+ }
+ rl[attr] = ra
+ local sequences = tfmdata.shared.reorderedsequences or tfmdata.resources.sequences
+ if sequences then
+ local autoscript = (s_enabled and s_enabled.autoscript ) or (a_enabled and a_enabled.autoscript )
+ local autolanguage = (s_enabled and s_enabled.autolanguage) or (a_enabled and a_enabled.autolanguage)
+ for s=1,#sequences do
+ -- just return nil or ra step
+ initialize(sequences[s],script,language,s_enabled,a_enabled,font,attr,dynamic,ra,autoscript,autolanguage)
+ end
+ end
+ end
+ return ra
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-otj.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-otj.lmt
index e9e9d524e4f..5ef3fd5c3a5 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-otj.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-otj.lmt
@@ -85,8 +85,8 @@ local tonut = nuts.tonut
local getnext = nuts.getnext
local getprev = nuts.getprev
local getid = nuts.getid
-local getfont = nuts.getfont
local getchar = nuts.getchar
+local getcharspec = nuts.getcharspec
local setchar = nuts.setchar
----- getxoffset = nuts.getxoffset
----- getyoffset = nuts.getyoffset
@@ -99,6 +99,8 @@ local yscaled = nuts.yscaled
local getboth = nuts.getboth
local getdisc = nuts.getdisc
local setdisc = nuts.setdisc
+local getreplace = nuts.getreplace
+local setreplace = nuts.setreplace
local setoffsets = nuts.setoffsets
local addxoffset = nuts.addxoffset
local addyoffset = nuts.addyoffset
@@ -111,21 +113,27 @@ local setwidth = nuts.setwidth
local getwidth = nuts.getwidth
local addxymargins = nuts.addxymargins -- we delegate scaling
local copynode = nuts.copy
+local setattrlist = nuts.setattrlist
local nextchar = nuts.traversers.char
local nextglue = nuts.traversers.glue
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local properties = nodes.properties.data
local fontkern = nuts.pool and nuts.pool.fontkern
local italickern = nuts.pool and nuts.pool.italickern
+local function somekern(makekern,amount,current)
+ local kern = makekern(amount)
+ setattrlist(kern,current)
+ return kern
+end
+
local useitalickerns = false
local useadvance = false
-local usezwjkerns = true -- when useadvance
directives.register("fonts.injections.useitalics", function(v)
if v then
@@ -510,8 +518,8 @@ local function dir(n)
end
local function showchar(n,nested)
- local char = getchar(n)
- report_injections("%wfont %s, char %U, glyph %c",nested and 2 or 0,getfont(n),char,char)
+ local char, font = getcharspec(n)
+ report_injections("%wfont %s, char %U, glyph %c",nested and 2 or 0,font,char,char)
end
local function show(n,what,nested,symbol)
@@ -659,12 +667,12 @@ end
-- addmargins(current,-leftkern)
-- elseif prev and getid(prev) == glue_code then
-- if useitalickerns then
--- head = insert_node_before(head,current,italickern(leftkern))
+-- head = insertnodebefore(head,current,italickern(leftkern))
-- else
-- setwidth(prev, getwidth(prev) + leftkern)
-- end
-- else
--- head = insert_node_before(head,current,fontkern(leftkern))
+-- head = insertnodebefore(head,current,fontkern(leftkern))
-- end
-- end
-- end
@@ -742,7 +750,7 @@ end
-- if useadvance then
-- addmargins(n,-leftkern)
-- else
--- pre = insert_node_before(pre,n,fontkern(leftkern))
+-- pre = insertnodebefore(pre,n,fontkern(leftkern))
-- done = true
-- end
-- end
@@ -763,7 +771,7 @@ end
-- if useadvance then
-- addmargins(n,-leftkern)
-- else
--- post = insert_node_before(post,n,fontkern(leftkern))
+-- post = insertnodebefore(post,n,fontkern(leftkern))
-- done = true
-- end
-- end
@@ -784,7 +792,7 @@ end
-- if useadvance then
-- addmargins(n,-leftkern)
-- else
--- replace = insert_node_before(replace,n,fontkern(leftkern))
+-- replace = insertnodebefore(replace,n,fontkern(leftkern))
-- done = true
-- end
-- end
@@ -842,12 +850,12 @@ local function inject_kerns_only_kerns(head,where)
leftkern = xscaled(current,leftkern)
if prev and getid(prev) == glue_code then
if useitalickerns then
- head = insert_node_before(head,current,italickern(leftkern))
+ head = insertnodebefore(head,current,italickern(leftkern))
else
setwidth(prev,getwidth(prev) + leftkern)
end
else
- head = insert_node_before(head,current,fontkern(leftkern))
+ head = insertnodebefore(head,current,somekern(fontkern,leftkern,current))
end
end
end
@@ -858,7 +866,7 @@ local function inject_kerns_only_kerns(head,where)
if i then
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- setlink(posttail,fontkern(xscaled(current,leftkern)))
+ setlink(posttail,somekern(fontkern,xscaled(current,leftkern),current))
done = true
end
end
@@ -868,7 +876,7 @@ local function inject_kerns_only_kerns(head,where)
if i then
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- setlink(replacetail,fontkern(xscaled(current,leftkern)))
+ setlink(replacetail,somekern(fontkern,xscaled(current,leftkern),current))
done = true
end
end
@@ -878,7 +886,7 @@ local function inject_kerns_only_kerns(head,where)
-- glyph|disc|glyph (special case)
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- replace = fontkern(xscaled(current,leftkern))
+ replace = somekern(fontkern,xscaled(current,leftkern),current)
done = true
end
end
@@ -906,7 +914,7 @@ local function inject_kerns_only_kerns(head,where)
if i then
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- pre = insert_node_before(pre,n,fontkern(xscaled(n,leftkern)))
+ pre = insertnodebefore(pre,n,somekern(fontkern,xscaled(n,leftkern),n))
done = true
end
end
@@ -922,7 +930,7 @@ local function inject_kerns_only_kerns(head,where)
if i then
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- post = insert_node_before(post,n,fontkern(xscaled(n,leftkern)))
+ post = insertnodebefore(post,n,somekern(fontkern,xscaled(n,leftkern),n))
done = true
end
end
@@ -938,7 +946,7 @@ local function inject_kerns_only_kerns(head,where)
if i then
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- replace = insert_node_before(replace,n,fontkern(xscaled(n,leftkern)))
+ replace = insertnodebefore(replace,n,somekern(fontkern,xscaled(n,leftkern),n))
done = true
end
end
@@ -1009,14 +1017,8 @@ local function inject_kerns_only_margins(head,where)
if i then
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- if usezwjkerns then
- replace = copynode(current)
- setchar(replace,0x200D) -- zwj
- addxymargins(replace,-leftkern)
- else
- replace = fontkern(xscaled(current,leftkern))
- end
- setdisc(prevdisc,pre,post,replace) -- setreplace
+ -- prev disc | current
+ addxymargins(current,-leftkern) -- NEEDS CHECKING
end
end
end
@@ -1141,23 +1143,23 @@ end
-- rightkern = 0
-- elseif prev and getid(prev) == glue_code then
-- if useitalickerns then
--- head = insert_node_before(head,current,italickern(leftkern))
+-- head = insertnodebefore(head,current,italickern(leftkern))
-- else
-- setwidth(prev,getwidth(prev)+leftkern)
-- end
-- else
--- head = insert_node_before(head,current,fontkern(leftkern))
+-- head = insertnodebefore(head,current,fontkern(leftkern))
-- end
-- end
-- if rightkern ~= 0 then
-- if next and getid(next) == glue_code then
-- if useitalickerns then
--- insert_node_after(head,current,italickern(rightkern))
+-- insertnodeafter(head,current,italickern(rightkern))
-- else
-- setwidth(next, getwidth(next)+rightkern)
-- end
-- else
--- insert_node_after(head,current,fontkern(rightkern))
+-- insertnodeafter(head,current,fontkern(rightkern))
-- end
-- end
-- end
@@ -1260,11 +1262,11 @@ end
-- end
-- else
-- if leftkern ~= 0 then
--- pre = insert_node_before(pre,n,fontkern(leftkern))
+-- pre = insertnodebefore(pre,n,fontkern(leftkern))
-- done = true
-- end
-- if rightkern ~= 0 then
--- insert_node_after(pre,n,fontkern(rightkern))
+-- insertnodeafter(pre,n,fontkern(rightkern))
-- done = true
-- end
-- end
@@ -1298,11 +1300,11 @@ end
-- end
-- else
-- if leftkern ~= 0 then
--- post = insert_node_before(post,n,fontkern(leftkern))
+-- post = insertnodebefore(post,n,fontkern(leftkern))
-- done = true
-- end
-- if rightkern ~= 0 then
--- insert_node_after(post,n,fontkern(rightkern))
+-- insertnodeafter(post,n,fontkern(rightkern))
-- done = true
-- end
-- end
@@ -1336,11 +1338,11 @@ end
-- end
-- else
-- if leftkern ~= 0 then
--- replace = insert_node_before(replace,n,fontkern(leftkern))
+-- replace = insertnodebefore(replace,n,fontkern(leftkern))
-- done = true
-- end
-- if rightkern ~= 0 then
--- insert_node_after(replace,n,fontkern(rightkern))
+-- insertnodeafter(replace,n,fontkern(rightkern))
-- done = true
-- end
-- end
@@ -1361,7 +1363,7 @@ end
-- if useadvance then
-- addmargins(pre,-rightkern)
-- else
--- pre = insert_node_before(pre,pre,fontkern(rightkern))
+-- pre = insertnodebefore(pre,pre,fontkern(rightkern))
-- done = true
-- end
-- end
@@ -1380,7 +1382,7 @@ end
-- if useadvance then
-- addmargins(replace,-rightkern)
-- else
--- replace = insert_node_before(replace,replace,fontkern(rightkern))
+-- replace = insertnodebefore(replace,replace,fontkern(rightkern))
-- done = true
-- end
-- end
@@ -1454,38 +1456,36 @@ local function inject_positions_only_kerns(head,where)
rightkern = 0
elseif prev and getid(prev) == glue_code then
if useitalickerns then
- head = insert_node_before(head,current,italickern(leftkern))
+ head = insertnodebefore(head,current,italickern(leftkern))
else
setwidth(prev,getwidth(prev)+leftkern)
end
else
- head = insert_node_before(head,current,fontkern(leftkern))
+ head = insertnodebefore(head,current,somekern(fontkern,leftkern,current))
end
end
if rightkern ~= 0 then
if next and getid(next) == glue_code then
if useitalickerns then
- insert_node_after(head,current,italickern(rightkern))
+ insertnodeafter(head,current,italickern(rightkern))
else
setwidth(next, getwidth(next)+rightkern)
end
else
- insert_node_after(head,current,fontkern(rightkern))
+ insertnodeafter(head,current,somekern(fontkern,rightkern,current))
end
end
- else
+ elseif next then
local i = p.emptyinjections
if i then
-- glyph|disc|glyph (special case)
local rightkern = i.rightkern
- if rightkern and rightkern ~= 0 then
- if next and getid(next) == disc_code then
- if replace then
- -- error, we expect an empty one
- else
- replace = fontkern(xscaled(current,rightkern)) -- maybe also leftkern
- done = true --KE
- end
+ if rightkern and rightkern ~= 0 and getid(next) == disc_code then
+ local replace = getreplace(next)
+ if replace then
+ -- can't happen
+ else
+ setreplace(next,somekern(fontkern,xscaled(current,rightkern),current))
end
end
end
@@ -1497,7 +1497,7 @@ local function inject_positions_only_kerns(head,where)
if i then
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- setlink(posttail,fontkern(xscaled(current,leftkern)))
+ setlink(posttail,somekern(fontkern,xscaled(current,leftkern),current))
done = true
end
end
@@ -1507,7 +1507,7 @@ local function inject_positions_only_kerns(head,where)
if i then
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- setlink(replacetail,fontkern(xscaled(current,leftkern)))
+ setlink(replacetail,somekern(fontkern,xscaled(current,leftkern),current))
done = true
end
end
@@ -1517,7 +1517,7 @@ local function inject_positions_only_kerns(head,where)
-- new .. okay?
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- replace = fontkern(xscaled(current,leftkern))
+ replace = somekern(fontkern,xscaled(current,leftkern),current)
done = true
end
end
@@ -1549,11 +1549,11 @@ local function inject_positions_only_kerns(head,where)
addyoffset(n,yscaled(n,yoffset))
end
if leftkern and leftkern ~= 0 then
- pre = insert_node_before(pre,n,fontkern(xscaled(n,leftkern)))
+ pre = insertnodebefore(pre,n,somekern(fontkern,xscaled(n,leftkern),n))
done = true
end
if rightkern and rightkern ~= 0 then
- insert_node_after(pre,n,fontkern(xscaled(n,rightkern)))
+ insertnodeafter(pre,n,somekern(fontkern,xscaled(n,rightkern),n))
done = true
end
end
@@ -1574,11 +1574,11 @@ local function inject_positions_only_kerns(head,where)
addyoffset(n,yscaled(n,yoffset))
end
if leftkern and leftkern ~= 0 then
- post = insert_node_before(post,n,fontkern(xscaled(n,leftkern)))
+ post = insertnodebefore(post,n,somekern(fontkern,xscaled(n,leftkern),n))
done = true
end
if rightkern and rightkern ~= 0 then
- insert_node_after(post,n,fontkern(xscaled(n,rightkern)))
+ insertnodeafter(post,n,somekern(fontkern,xscaled(n,rightkern),n))
done = true
end
end
@@ -1599,11 +1599,11 @@ local function inject_positions_only_kerns(head,where)
addyoffset(n,yscaled(n,yoffset))
end
if leftkern and leftkern ~= 0 then
- replace = insert_node_before(replace,n,fontkern(xscaled(n,leftkern)))
+ replace = insertnodebefore(replace,n,somekern(fontkern,xscaled(n,leftkern),n))
done = true
end
if rightkern and rightkern ~= 0 then
- insert_node_after(replace,n,fontkern(xscaled(n,rightkern)))
+ insertnodeafter(replace,n,somekern(fontkern,xscaled(n,rightkern),n))
done = true
end
end
@@ -1620,7 +1620,7 @@ local function inject_positions_only_kerns(head,where)
-- glyph|pre glyphs
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- pre = insert_node_before(pre,pre,fontkern(xscaled(prevglyph,rightkern)))
+ pre = insertnodebefore(pre,pre,somekern(fontkern,xscaled(prevglyph,rightkern),prevglyph))
done = true
end
end
@@ -1634,7 +1634,7 @@ local function inject_positions_only_kerns(head,where)
-- glyph|replace glyphs
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- replace = insert_node_before(replace,replace,fontkern(xscaled(prevglyph,rightkern)))
+ replace = insertnodebefore(replace,replace,somekern(fontkern,xscaled(prevglyph,rightkern),prevglyph))
done = true
end
end
@@ -1694,25 +1694,17 @@ local function inject_positions_only_margins(head,where)
if leftkern ~= 0 or rightkern ~= 0 or yoffset ~= 0 then
addxymargins(n,-leftkern,-rightkern,yoffset) -- also scales
end
- else
+ elseif next then
local i = p.emptyinjections
if i then
-- glyph|disc|glyph (special case)
local rightkern = i.rightkern
- if rightkern and rightkern ~= 0 then
- if next and getid(next) == disc_code then
- if replace then
- -- error, we expect an empty one
- else
- if usezwjkerns then
- replace = copynode(current)
- setchar(replace,0x200D) -- zwj
- addxymargins(replace,false,-rightkern)
- else
- replace = fontkern(xscaled(current,rightkern)) -- maybe also leftkern
- end
- done = true --KE
- end
+ if rightkern and rightkern ~= 0 and getid(next) == disc_code then
+ local replace = getreplace(next)
+ if replace then
+ -- can't happen
+ else
+ setreplace(next,somekern(fontkern,xscaled(current,rightkern),current))
end
end
end
@@ -1741,14 +1733,8 @@ local function inject_positions_only_margins(head,where)
-- new .. okay?
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- if usezwjkerns then
- replace = copynode(current)
- setchar(replace,0x200D) -- zwj
- addxymargins(replace,-leftkern)
- else
- replace = fontkern(xscaled(current,leftkern))
- end
- setdisc(prevdisc,pre,post,replace)
+ -- prev disc | current
+ addxymargins(current,-leftkern) -- NEEDS CHECKING
end
end
end
@@ -1934,8 +1920,8 @@ local function processmark(p,n,pn) -- p = basenode
--
-- todo: head and check for prev / next kern
--
- insert_node_before(n,n,fontkern(-wn))
- insert_node_after(n,n,fontkern(-wn))
+ insertnodebefore(n,n,somekern(fontkern,-wn,n))
+ insertnodeafter(n,n,somekern(fontkern,-wn,n))
end
end
end
@@ -2057,40 +2043,38 @@ local function inject_everything(head,where)
rightkern = 0
elseif prev and getid(prev) == glue_code then
if useitalickerns then
- head = insert_node_before(head,current,italickern(leftkern))
+ head = insertnodebefore(head,current,italickern(leftkern))
else
setwidth(prev, getwidth(prev) + leftkern)
end
else
- head = insert_node_before(head,current,fontkern(leftkern))
+ head = insertnodebefore(head,current,somekern(fontkern,leftkern,current))
end
end
if rightkern and rightkern ~= 0 then
rightkern = xscaled(current,rightkern)
if next and getid(next) == glue_code then
if useitalickerns then
- insert_node_after(head,current,italickern(rightkern))
+ insertnodeafter(head,current,italickern(rightkern))
else
setwidth(next, getwidth(next) + rightkern)
end
else
- insert_node_after(head,current,fontkern(rightkern))
+ insertnodeafter(head,current,somekern(fontkern,rightkern,current))
end
end
end
- else
+ elseif next then
local i = p.emptyinjections
if i then
-- glyph|disc|glyph (special case)
local rightkern = i.rightkern
- if rightkern and rightkern ~= 0 then
- if next and getid(next) == disc_code then
- if replace then
- -- error, we expect an empty one
- else
- replace = fontkern(xscaled(current,rightkern))
- done = true
- end
+ if rightkern and rightkern ~= 0 and getid(next) == disc_code then
+ local replace = getreplace(next)
+ if replace then
+ -- can't happen
+ else
+ setreplace(next,somekern(fontkern,xscaled(current,rightkern),current))
end
end
end
@@ -2103,7 +2087,7 @@ local function inject_everything(head,where)
if i then
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- setlink(posttail,fontkern(xscaled(current,leftkern)))
+ setlink(posttail,somekern(fontkern,xscaled(current,leftkern),current))
done = true
end
end
@@ -2113,7 +2097,7 @@ local function inject_everything(head,where)
if i then
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- setlink(replacetail,fontkern(xscaled(current,leftkern)))
+ setlink(replacetail,somekern(fontkern,xscaled(current,leftkern),current))
done = true
end
end
@@ -2122,7 +2106,7 @@ local function inject_everything(head,where)
if i then
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- replace = fontkern(xscaled(current,leftkern))
+ replace = somekern(fontkern,xscaled(current,leftkern),current)
done = true
end
end
@@ -2168,12 +2152,12 @@ local function inject_everything(head,where)
end
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- pre = insert_node_before(pre,n,fontkern(xscaled(n,leftkern)))
+ pre = insertnodebefore(pre,n,somekern(fontkern,xscaled(n,leftkern),n))
done = true
end
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- insert_node_after(pre,n,fontkern(xscaled(n,rightkern)))
+ insertnodeafter(pre,n,somekern(fontkern,xscaled(n,rightkern),n))
done = true
end
if hasmarks then
@@ -2199,13 +2183,13 @@ local function inject_everything(head,where)
end
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- post = insert_node_before(post,n,fontkern(xscaled(n,leftkern)))
+ post = insertnodebefore(post,n,somekern(fontkern,xscaled(n,leftkern),n))
done = true
end
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
done = true
- insert_node_after(post,n,fontkern(xscaled(n,rightkern)))
+ insertnodeafter(post,n,somekern(fontkern,xscaled(n,rightkern),n))
end
if hasmarks then
local pm = i.markbasenode
@@ -2230,12 +2214,12 @@ local function inject_everything(head,where)
end
local leftkern = i.leftkern
if leftkern and leftkern ~= 0 then
- replace = insert_node_before(replace,n,fontkern(xscaled(n,leftkern)))
+ replace = insertnodebefore(replace,n,somekern(fontkern,xscaled(n,leftkern),n))
done = true
end
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- insert_node_after(replace,n,fontkern(xscaled(n,rightkern)))
+ insertnodeafter(replace,n,somekern(fontkern,xscaled(n,rightkern),n))
done = true
end
if hasmarks then
@@ -2257,7 +2241,7 @@ local function inject_everything(head,where)
-- glyph|pre glyphs
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- pre = insert_node_before(pre,pre,fontkern(xscaled(prevglyph,rightkern)))
+ pre = insertnodebefore(pre,pre,somekern(fontkern,xscaled(prevglyph,rightkern),prevglyph))
done = true
end
end
@@ -2271,7 +2255,7 @@ local function inject_everything(head,where)
-- glyph|replace glyphs
local rightkern = i.rightkern
if rightkern and rightkern ~= 0 then
- replace = insert_node_before(replace,replace,fontkern(xscaled(prevglyph,rightkern)))
+ replace = insertnodebefore(replace,replace,somekern(fontkern,xscaled(prevglyph,rightkern),prevglyph))
done = true
end
end
@@ -2419,14 +2403,13 @@ local function injectspaces(head)
for n in nextglue, head do
local prev, next = getspaceboth(n)
- local prevchar = prev and ischar(prev)
- local nextchar = next and ischar(next)
+ local prevchar, prevfont = getcharspec(prev)
+ local nextchar, nextfont = getcharspec(next)
if nextchar then
- local font = getfont(next)
- local trig = triggers[font]
+ local trig = triggers[nextfont]
if trig then
- if lastfont ~= font then
- updatefont(font,trig)
+ if lastfont ~= nextfont then
+ updatefont(nextfont,trig)
end
if rightkerns then
rightkern = rightkerns[nextchar]
@@ -2435,11 +2418,10 @@ local function injectspaces(head)
end
end
if prevchar then
- local font = getfont(prev)
- local trig = triggers[font]
+ local trig = triggers[prevfont]
if trig then
- if lastfont ~= font then
- updatefont(font,trig)
+ if lastfont ~= prevfont then
+ updatefont(prevfont,trig)
end
if leftkerns then
leftkern = leftkerns[prevchar]
@@ -2459,8 +2441,8 @@ local function injectspaces(head)
end
lnew = lnew * xscale
rnew = rnew * xscale
- head = insert_node_before(head,n,italickern(lnew))
- insert_node_after(head,n,italickern(rnew))
+ head = insertnodebefore(head,n,italickern(lnew))
+ insertnodeafter(head,n,italickern(rnew))
else
local new = old + (leftkern + rightkern) * factor
if trace_spaces then
@@ -2476,7 +2458,7 @@ local function injectspaces(head)
report_spaces("%C [%p + %p]",prevchar,old,new)
end
new = new * xscale
- insert_node_after(head,n,italickern(new)) -- tricky with traverse but ok
+ insertnodeafter(head,n,italickern(new)) -- tricky with traverse but ok
else
local new = old + leftkern * factor * xscale
if trace_spaces then
@@ -2495,7 +2477,7 @@ local function injectspaces(head)
if trace_spaces then
report_spaces("[%p + %p] %C",old,new,nextchar)
end
- insert_node_after(head,n,italickern(new))
+ insertnodeafter(head,n,italickern(new))
else
new = old + new
if trace_spaces then
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-otl.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-otl.lmt
new file mode 100644
index 00000000000..065a2c2eee3
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-otl.lmt
@@ -0,0 +1,912 @@
+if not modules then modules = { } end modules ['font-otl'] = {
+ version = 1.001,
+ comment = "companion to font-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files",
+}
+
+-- After some experimenting with an alternative loader (one that is needed for
+-- getting outlines in mp) I decided not to be compatible with the old (built-in)
+-- one. The approach used in font-otn is as follows: we load the font in a compact
+-- format but still very compatible with the ff data structures. From there we
+-- create hashes to access the data efficiently. The implementation of feature
+-- processing is mostly based on looking at the data as organized in the glyphs and
+-- lookups as well as the specification. Keeping the lookup data in the glyphs is
+-- very instructive and handy for tracing. On the other hand hashing is what brings
+-- speed. So, the in the new approach (the old one will stay around too) we no
+-- longer keep data in the glyphs which saves us a (what in retrospect looks a bit
+-- like) a reconstruction step. It also means that the data format of the cached
+-- files changes. What method is used depends on that format. There is no fundamental
+-- change in processing, and not even in data organation. Most has to do with
+-- loading and storage.
+
+-- todo: less tounicodes
+
+local lower = string.lower
+local type, next, tonumber, tostring, unpack = type, next, tonumber, tostring, unpack
+local abs = math.abs
+local derivetable, sortedhash = table.derive, table.sortedhash
+local formatters = string.formatters
+
+local setmetatableindex = table.setmetatableindex
+local allocate = utilities.storage.allocate
+local registertracker = trackers.register
+local registerdirective = directives.register
+local starttiming = statistics.starttiming
+local stoptiming = statistics.stoptiming
+local elapsedtime = statistics.elapsedtime
+local findbinfile = resolvers.findbinfile
+
+----- trace_private = false registertracker("otf.private", function(v) trace_private = v end)
+----- trace_subfonts = false registertracker("otf.subfonts", function(v) trace_subfonts = v end)
+local trace_loading = false registertracker("otf.loading", function(v) trace_loading = v end)
+local trace_features = false registertracker("otf.features", function(v) trace_features = v end)
+----- trace_dynamics = false registertracker("otf.dynamics", function(v) trace_dynamics = v end)
+----- trace_sequences = false registertracker("otf.sequences", function(v) trace_sequences = v end)
+----- trace_markwidth = false registertracker("otf.markwidth", function(v) trace_markwidth = v end)
+local trace_defining = false registertracker("fonts.defining", function(v) trace_defining = v end)
+
+local report_otf = logs.reporter("fonts","otf loading")
+
+local fonts = fonts
+local otf = fonts.handlers.otf
+
+otf.version = 3.133 -- beware: also sync font-mis.lua and in mtx-fonts
+otf.cache = containers.define("fonts", "otl", otf.version, true)
+otf.svgcache = containers.define("fonts", "svg", otf.version, true)
+otf.pngcache = containers.define("fonts", "png", otf.version, true)
+otf.pdfcache = containers.define("fonts", "pdf", otf.version, true)
+otf.mpscache = containers.define("fonts", "mps", otf.version, true)
+
+otf.svgenabled = false
+otf.pngenabled = false
+
+local otfreaders = otf.readers
+
+local hashes = fonts.hashes
+local definers = fonts.definers
+local readers = fonts.readers
+local constructors = fonts.constructors
+
+local otffeatures = constructors.features.otf
+local registerotffeature = otffeatures.register
+
+local otfenhancers = constructors.enhancers.otf
+local registerotfenhancer = otfenhancers.register
+
+local forceload = false
+local cleanup = 0 -- mk: 0=885M 1=765M 2=735M (regular run 730M)
+local syncspace = true
+local forcenotdef = false
+
+local privateoffset = fonts.constructors and fonts.constructors.privateoffset or 0xF0000 -- 0x10FFFF
+
+local applyruntimefixes = fonts.treatments and fonts.treatments.applyfixes
+
+local wildcard = "*"
+local default = "dflt"
+
+local formats = fonts.formats
+
+formats.otf = "opentype"
+formats.ttf = "truetype"
+formats.ttc = "truetype"
+
+registerdirective("fonts.otf.loader.cleanup", function(v) cleanup = tonumber(v) or (v and 1) or 0 end)
+registerdirective("fonts.otf.loader.force", function(v) forceload = v end)
+registerdirective("fonts.otf.loader.syncspace", function(v) syncspace = v end)
+registerdirective("fonts.otf.loader.forcenotdef", function(v) forcenotdef = v end)
+
+-- otfenhancers.patch("before","migrate metadata","cambria",function() end)
+
+registerotfenhancer("check extra features", function() end) -- placeholder
+
+-- Kai has memory problems on osx so here is an experiment (I only tested on windows as
+-- my test mac is old and gets no updates and is therefore rather useless.):
+
+local checkmemory = utilities.lua and utilities.lua.checkmemory
+local threshold = 100 -- MB
+local tracememory = false
+
+registertracker("fonts.otf.loader.memory",function(v) tracememory = v end)
+
+if not checkmemory then -- we need a generic plug (this code might move):
+
+ local collectgarbage = collectgarbage
+
+ checkmemory = function(previous,threshold) -- threshold in MB
+ local current = collectgarbage("count")
+ if previous then
+ local checked = (threshold or 64)*1024
+ if current - previous > checked then
+ collectgarbage("collect")
+ current = collectgarbage("count")
+ end
+ end
+ return current
+ end
+
+end
+
+function otf.load(filename,sub,instance)
+ local base = file.basename(file.removesuffix(filename))
+ local name = file.removesuffix(base) -- already no suffix
+ local attr = lfs.attributes(filename)
+ local size = attr and attr.size or 0
+ local time = attr and attr.modification or 0
+ -- sub can be number of string
+ if sub == "" then
+ sub = false
+ end
+ local hash = name
+ if sub then
+ hash = hash .. "-" .. sub
+ end
+ if instance then
+ hash = hash .. "-" .. instance
+ end
+ hash = containers.cleanname(hash)
+ local data = containers.read(otf.cache,hash)
+ local reload = not data or data.size ~= size or data.time ~= time or data.tableversion ~= otfreaders.tableversion
+ if forceload then
+ report_otf("forced reload of %a due to hard coded flag",filename)
+ reload = true
+ end
+ if reload then
+ report_otf("loading %a, hash %a",filename,hash)
+ --
+ starttiming(otfreaders,true)
+ data = otfreaders.loadfont(filename,sub or 1,instance) -- we can pass the number instead (if it comes from a name search)
+ if data then
+ -- todo: make this a plugin
+ local used = checkmemory()
+ local resources = data.resources
+ local svgshapes = resources.svgshapes
+ local pngshapes = resources.pngshapes
+ if cleanup == 0 then
+ checkmemory(used,threshold,tracememory)
+ end
+ if svgshapes then
+ resources.svgshapes = nil
+ if otf.svgenabled then
+ local timestamp = os.date()
+ -- work in progress ... a bit boring to do
+ containers.write(otf.svgcache,hash, {
+ svgshapes = svgshapes,
+ timestamp = timestamp,
+ })
+ data.properties.svg = {
+ hash = hash,
+ timestamp = timestamp,
+ }
+ end
+ if cleanup > 1 then
+ collectgarbage("collect")
+ else
+ checkmemory(used,threshold,tracememory)
+ end
+ end
+ if pngshapes then
+ resources.pngshapes = nil
+ if otf.pngenabled then
+ local timestamp = os.date()
+ -- work in progress ... a bit boring to do
+ containers.write(otf.pngcache,hash, {
+ pngshapes = pngshapes,
+ timestamp = timestamp,
+ })
+ data.properties.png = {
+ hash = hash,
+ timestamp = timestamp,
+ }
+ end
+ if cleanup > 1 then
+ collectgarbage("collect")
+ else
+ checkmemory(used,threshold,tracememory)
+ end
+ end
+ --
+ otfreaders.compact(data)
+ if cleanup == 0 then
+ checkmemory(used,threshold,tracememory)
+ end
+ otfreaders.rehash(data,"unicodes")
+ otfreaders.addunicodetable(data)
+ otfreaders.extend(data)
+ if cleanup == 0 then
+ checkmemory(used,threshold,tracememory)
+ end
+ if context then
+ otfreaders.condense(data)
+ end
+ otfreaders.pack(data)
+ report_otf("loading done")
+ report_otf("saving %a in cache",filename)
+ data = containers.write(otf.cache, hash, data)
+ if cleanup > 1 then
+ collectgarbage("collect")
+ else
+ checkmemory(used,threshold,tracememory)
+ end
+ stoptiming(otfreaders)
+ if elapsedtime then
+ report_otf("loading, optimizing, packing and caching time %s", elapsedtime(otfreaders))
+ end
+ if cleanup > 3 then
+ collectgarbage("collect")
+ else
+ checkmemory(used,threshold,tracememory)
+ end
+ data = containers.read(otf.cache,hash) -- this frees the old table and load the sparse one
+ if cleanup > 2 then
+ collectgarbage("collect")
+ else
+ checkmemory(used,threshold,tracememory)
+ end
+ else
+ stoptiming(otfreaders)
+ data = nil
+ report_otf("loading failed due to read error")
+ end
+ end
+ if data then
+ if trace_defining then
+ report_otf("loading from cache using hash %a",hash)
+ end
+ --
+ otfreaders.unpack(data)
+ otfreaders.expand(data) -- inline tables
+ otfreaders.addunicodetable(data) -- only when not done yet
+ --
+ otfenhancers.apply(data,filename,data) -- in context one can also use treatments
+ --
+ -- constructors.addcoreunicodes(data.resources.unicodes) -- still needed ?
+ --
+ if applyruntimefixes then
+ applyruntimefixes(filename,data) -- e.g. see treatments.lfg
+ end
+ --
+ data.metadata.math = data.resources.mathconstants
+ --
+ -- delayed tables (experiment)
+ --
+ local classes = data.resources.classes
+ if not classes then
+ local descriptions = data.descriptions
+ classes = setmetatableindex(function(t,k)
+ local d = descriptions[k]
+ local v = (d and d.class or "base") or false
+ t[k] = v
+ return v
+ end)
+ data.resources.classes = classes
+ end
+ --
+ end
+
+ return data
+end
+
+-- modes: node, base, none
+
+function otf.setfeatures(tfmdata,features)
+ local okay = constructors.initializefeatures("otf",tfmdata,features,trace_features,report_otf)
+ if okay then
+ return constructors.collectprocessors("otf",tfmdata,features,trace_features,report_otf)
+ else
+ return { } -- will become false
+ end
+end
+
+-- the first version made a top/mid/not extensible table, now we just
+-- pass on the variants data and deal with it in the tfm scaler (there
+-- is no longer an extensible table anyway)
+--
+-- we cannot share descriptions as virtual fonts might extend them (ok,
+-- we could use a cache with a hash
+--
+-- we already assign an empty table to characters as we can add for
+-- instance protruding info and loop over characters; one is not supposed
+-- to change descriptions and if one does so one should make a copy!
+
+-- local function best_done_here(tfmdata,characters,descriptions)
+-- local validlookups, lookuplist = fonts.handlers.otf.collectlookups(
+-- { resources = tfmdata.resources },"flac","math","dflt"
+-- )
+-- if validlookups then
+-- -- it's quite likely just one step
+-- for i=1,#lookuplist do
+-- local lookup = lookuplist[i]
+-- local steps = lookup.steps
+-- local nofsteps = lookup.nofsteps
+-- for i=1,nofsteps do
+-- local coverage = steps[i].coverage
+-- if coverage then
+-- for k, v in next, coverage do
+-- local f = characters[v]
+-- if f then
+-- local d = descriptions[k]
+-- local c = characters[k]
+-- if c then
+-- c.flataccent = v
+-- end
+-- if d then
+-- d.flataccent = v
+-- end
+-- if not f.unicode then
+-- f.unicode = c.unicode
+-- end
+-- end
+-- end
+-- end
+-- end
+-- end
+-- end
+-- end
+
+local function copytotfm(data,cache_id)
+ if data then
+ local metadata = data.metadata
+ local properties = derivetable(data.properties)
+ local descriptions = derivetable(data.descriptions)
+ local goodies = derivetable(data.goodies)
+ local characters = { } -- newtable if we knwo how many
+ local parameters = { }
+ local mathparameters = { }
+ --
+ local resources = data.resources
+ local unicodes = resources.unicodes
+ local spaceunits = 500
+ local spacer = "space"
+ local designsize = metadata.designsize or 100
+ local minsize = metadata.minsize or designsize
+ local maxsize = metadata.maxsize or designsize
+ local mathspecs = metadata.math
+ --
+ if designsize == 0 then
+ designsize = 100
+ minsize = 100
+ maxsize = 100
+ end
+ if mathspecs then
+ for name, value in next, mathspecs do
+ mathparameters[name] = value
+ end
+ end
+ for unicode in next, data.descriptions do -- use parent table
+ characters[unicode] = { }
+ end
+ if mathspecs then
+ for unicode, character in next, characters do
+ local d = descriptions[unicode] -- we could use parent table here
+ local m = d.math
+ if m then
+ --
+ local italic = m.italic
+ if italic and italic ~= 0 then
+ character.italic = italic
+ end
+ --
+ local variants = m.variants
+ local parts = m.parts
+ local partsitalic = m.partsitalic
+ local partsorientation = m.partsorientation
+ if variants then
+ local c = character
+ for i=1,#variants do
+ local un = variants[i]
+ c.next = un
+ c = characters[un]
+ end -- c is now last in chain
+ c.parts = parts
+ c.partsorientation = partsorientation
+ if partsitalic and partsitalic ~= 0 then
+ c.partsitalic = partsitalic
+ end
+ elseif parts then
+ character.parts = parts
+ character.partsorientation = partsorientation
+ if partsitalic and partsitalic ~= 0 then
+ character.partsitalic = partsitalic
+ end
+ end
+ --
+ local topanchor = m.topanchor or m.accent -- for now
+ if topanchor then
+ character.topanchor = topanchor
+ end
+ --
+ local kerns = m.kerns
+ if kerns then
+ character.mathkerns = kerns
+ end
+ end
+ end
+-- best_done_here(data,characters,descriptions)
+ end
+ -- we need a runtime lookup because of running from cdrom or zip, brrr (shouldn't
+ -- we use the basename then?)
+ local filename = constructors.checkedfilename(resources)
+ local fontname = metadata.fontname
+ local fullname = metadata.fullname or fontname
+ local psname = fontname or fullname
+ local subfont = metadata.subfontindex
+ local units = metadata.units or 1000
+ --
+ if units == 0 then -- catch bugs in fonts
+ units = 1000 -- maybe 2000 when ttf
+ metadata.units = 1000
+ report_otf("changing %a units to %a",0,units)
+ end
+ --
+ local monospaced = metadata.monospaced
+ local charwidth = metadata.averagewidth -- or unset
+ local charxheight = metadata.xheight -- or unset
+ local italicangle = metadata.italicangle
+ local hasitalics = metadata.hasitalics
+ properties.monospaced = monospaced
+ properties.hasitalics = hasitalics
+ parameters.italicangle = italicangle
+ parameters.charwidth = charwidth
+ parameters.charxheight = charxheight
+ --
+ local space = 0x0020
+ local emdash = 0x2014
+ if monospaced then
+ if descriptions[space] then
+ spaceunits, spacer = descriptions[space].width, "space"
+ end
+ if not spaceunits and descriptions[emdash] then
+ spaceunits, spacer = descriptions[emdash].width, "emdash"
+ end
+ if not spaceunits and charwidth then
+ spaceunits, spacer = charwidth, "charwidth"
+ end
+ else
+ if descriptions[space] then
+ spaceunits, spacer = descriptions[space].width, "space"
+ end
+ if not spaceunits and descriptions[emdash] then
+ spaceunits, spacer = descriptions[emdash].width/2, "emdash/2"
+ end
+ if not spaceunits and charwidth then
+ spaceunits, spacer = charwidth, "charwidth"
+ end
+ end
+ spaceunits = tonumber(spaceunits) or units/2
+ --
+ parameters.slant = 0
+ parameters.space = spaceunits -- 3.333 (cmr10)
+ parameters.spacestretch = 1*units/2 -- 500 -- 1.666 (cmr10)
+ parameters.spaceshrink = 1*units/3 -- 333 -- 1.111 (cmr10)
+ parameters.xheight = 2*units/5 -- 400
+ parameters.quad = units -- 1000
+ if spaceunits < 2*units/5 then
+ -- todo: warning
+ end
+ if italicangle and italicangle ~= 0 then
+ parameters.italicangle = italicangle
+ parameters.italicfactor = math.cos(math.rad(90+italicangle))
+ parameters.slant = - math.tan(italicangle*math.pi/180)
+ end
+ if monospaced then
+ parameters.spacestretch = 0
+ parameters.spaceshrink = 0
+ elseif syncspace then --
+ parameters.spacestretch = spaceunits/2
+ parameters.spaceshrink = spaceunits/3
+ end
+ parameters.extraspace = parameters.spaceshrink -- 1.111 (cmr10)
+ if charxheight then
+ parameters.xheight = charxheight
+ else
+ local x = 0x0078
+ if x then
+ local x = descriptions[x]
+ if x then
+ parameters.xheight = x.height
+ end
+ end
+ end
+ --
+ parameters.designsize = (designsize/10)*65536
+ parameters.minsize = (minsize /10)*65536
+ parameters.maxsize = (maxsize /10)*65536
+ parameters.ascender = abs(metadata.ascender or 0)
+ parameters.descender = abs(metadata.descender or 0)
+ parameters.units = units
+ parameters.vheight = metadata.defaultvheight
+ --
+ properties.space = spacer
+ properties.format = data.format or formats.otf
+ properties.filename = filename
+ properties.fontname = fontname
+ properties.fullname = fullname
+ properties.psname = psname
+ properties.name = filename or fullname
+ properties.subfont = subfont
+ --
+if not CONTEXTLMTXMODE or CONTEXTLMTXMODE == 0 then
+ --
+ properties.encodingbytes = 2
+elseif CONTEXTLMTXMODE then
+ local duplicates = resources and resources.duplicates
+ if duplicates then
+ local maxindex = data.nofglyphs or metadata.nofglyphs
+ if maxindex then
+ for u, d in sortedhash(duplicates) do
+ local du = descriptions[u]
+ if du then
+ for uu in sortedhash(d) do
+ maxindex = maxindex + 1
+ descriptions[uu].dupindex = du.index
+ descriptions[uu].index = maxindex
+ end
+ else
+ -- report_otf("no %U in font %a, duplicates ignored",u,filename)
+ end
+ end
+ end
+ end
+ --
+end
+ --
+ -- properties.name = specification.name
+ -- properties.sub = specification.sub
+ --
+ properties.private = properties.private or data.private or privateoffset
+ --
+ return {
+ characters = characters,
+ descriptions = descriptions,
+ parameters = parameters,
+ mathparameters = mathparameters,
+ resources = resources,
+ properties = properties,
+ goodies = goodies,
+ }
+ end
+end
+
+-- These woff files are a kind of joke in a tex environment because one can simply convert
+-- them to ttf/otf and use them as such (after all, we cache them too). The successor format
+-- woff2 is more complex so there we can as well call an external converter which in the end
+-- makes this code kind of obsolete before it's even used. Although ... it might become a
+-- more general conversion plug in.
+
+local converters = {
+ woff = {
+ cachename = "webfonts",
+ action = otf.readers.woff2otf,
+ }
+}
+
+-- We can get differences between daylight saving etc ... but it makes no sense to
+-- mess with trickery .. so be it when you use a different binary.
+
+local function checkconversion(specification)
+ local filename = specification.filename
+ local converter = converters[lower(file.suffix(filename))]
+ if converter then
+ local base = file.basename(filename)
+ local name = file.removesuffix(base)
+ local attr = lfs.attributes(filename)
+ local size = attr and attr.size or 0
+ local time = attr and attr.modification or 0
+ if size > 0 then
+ local cleanname = containers.cleanname(name)
+ local cachename = caches.setfirstwritablefile(cleanname,converter.cachename)
+ if not io.exists(cachename) or (time ~= lfs.attributes(cachename).modification) then
+ report_otf("caching font %a in %a",filename,cachename)
+ converter.action(filename,cachename) -- todo infoonly
+ lfs.touch(cachename,time,time)
+ end
+ specification.filename = cachename
+ end
+ end
+end
+
+local function otftotfm(specification)
+ local cache_id = specification.hash
+ local tfmdata = containers.read(constructors.cache,cache_id)
+ if not tfmdata then
+
+ checkconversion(specification) -- for the moment here
+
+ local name = specification.name
+ local sub = specification.sub
+ local subindex = specification.subindex
+ local filename = specification.filename
+ local features = specification.features.normal
+ local instance = specification.instance or (features and features.axis)
+ local rawdata = otf.load(filename,sub,instance)
+ if rawdata and next(rawdata) then
+ local descriptions = rawdata.descriptions
+ rawdata.lookuphash = { } -- to be done
+ tfmdata = copytotfm(rawdata,cache_id)
+ if tfmdata and next(tfmdata) then
+ -- at this moment no characters are assigned yet, only empty slots
+ local features = constructors.checkedfeatures("otf",features)
+ local shared = tfmdata.shared
+ if not shared then
+ shared = { }
+ tfmdata.shared = shared
+ end
+ shared.rawdata = rawdata
+ -- shared.features = features -- default
+ shared.dynamics = { }
+ -- shared.processes = { }
+ tfmdata.changed = { }
+ shared.features = features
+ shared.processes = otf.setfeatures(tfmdata,features)
+ end
+ end
+ containers.write(constructors.cache,cache_id,tfmdata)
+ end
+ return tfmdata
+end
+
+local function read_from_otf(specification)
+ local tfmdata = otftotfm(specification)
+ if tfmdata then
+ -- this late ? .. needs checking
+ tfmdata.properties.name = specification.name
+ tfmdata.properties.sub = specification.sub
+ tfmdata.properties.id = specification.id
+ --
+ tfmdata = constructors.scale(tfmdata,specification)
+ local allfeatures = tfmdata.shared.features or specification.features.normal
+ constructors.applymanipulators("otf",tfmdata,allfeatures,trace_features,report_otf)
+ constructors.setname(tfmdata,specification) -- only otf?
+ fonts.loggers.register(tfmdata,file.suffix(specification.filename),specification)
+ end
+ return tfmdata
+end
+
+-- local function checkmathsize(tfmdata,mathsize)
+-- local mathdata = tfmdata.shared.rawdata.metadata.math
+-- local mathsize = tonumber(mathsize)
+-- if mathdata then -- we cannot use mathparameters as luatex will complain
+-- local parameters = tfmdata.parameters
+-- parameters.scriptpercentage = mathdata.ScriptPercentScaleDown
+-- parameters.scriptscriptpercentage = mathdata.ScriptScriptPercentScaleDown
+-- parameters.mathsize = mathsize -- only when a number !
+-- -- print(mathdata.ScriptPercentScaleDown,mathdata.ScriptScriptPercentScaleDown)
+-- end
+-- end
+--
+-- registerotffeature {
+-- name = "mathsize",
+-- description = "apply mathsize specified in the font",
+-- initializers = {
+-- base = checkmathsize,
+-- node = checkmathsize,
+-- }
+-- }
+
+-- readers
+
+function otf.collectlookups(rawdata,kind,script,language)
+ if not kind then
+ return
+ end
+ if not script then
+ script = default
+ end
+ if not language then
+ language = default
+ end
+ local lookupcache = rawdata.lookupcache
+ if not lookupcache then
+ lookupcache = { }
+ rawdata.lookupcache = lookupcache
+ end
+ local kindlookup = lookupcache[kind]
+ if not kindlookup then
+ kindlookup = { }
+ lookupcache[kind] = kindlookup
+ end
+ local scriptlookup = kindlookup[script]
+ if not scriptlookup then
+ scriptlookup = { }
+ kindlookup[script] = scriptlookup
+ end
+ local languagelookup = scriptlookup[language]
+ if not languagelookup then
+ local sequences = rawdata.resources.sequences
+ local featuremap = { }
+ local featurelist = { }
+ if sequences then
+ for s=1,#sequences do
+ local sequence = sequences[s]
+ local features = sequence.features
+ if features then
+ features = features[kind]
+ if features then
+ -- features = features[script] or features[default] or features[wildcard]
+ features = features[script] or features[wildcard]
+ if features then
+ -- features = features[language] or features[default] or features[wildcard]
+ features = features[language] or features[wildcard]
+ if features then
+ if not featuremap[sequence] then
+ featuremap[sequence] = true
+ featurelist[#featurelist+1] = sequence
+ end
+ end
+ end
+ end
+ end
+ end
+ if #featurelist == 0 then
+ featuremap, featurelist = false, false
+ end
+ else
+ featuremap, featurelist = false, false
+ end
+ languagelookup = { featuremap, featurelist }
+ scriptlookup[language] = languagelookup
+ end
+ return unpack(languagelookup)
+end
+
+-- moved from font-oth.lua, todo: also afm
+
+local function getgsub(tfmdata,k,kind,value,script,language)
+ local shared = tfmdata.shared
+ local rawdata = shared and shared.rawdata
+ if rawdata then
+ local sequences = rawdata.resources.sequences
+ if sequences then
+ local properties = tfmdata.properties
+ local validlookups, lookuplist = otf.collectlookups(rawdata,kind,script or properties.script,language or properties.language)
+ if validlookups then
+ -- local choice = tonumber(value) or 1 -- no random here (yet)
+ for i=1,#lookuplist do
+ local lookup = lookuplist[i]
+ local steps = lookup.steps
+ local nofsteps = lookup.nofsteps
+ for i=1,nofsteps do
+ local coverage = steps[i].coverage
+ if coverage then
+ local found = coverage[k]
+ if found then
+ return found, lookup.type
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+end
+
+otf.getgsub = getgsub -- returns value, gsub_kind
+
+function otf.getsubstitution(tfmdata,k,kind,value,script,language)
+ local found, kind = getgsub(tfmdata,k,kind,value,script,language)
+ if not found then
+ --
+ elseif kind == "gsub_single" then
+ return found
+ elseif kind == "gsub_alternate" then
+ local choice = tonumber(value) or 1 -- no random here (yet)
+ return found[choice] or found[1] or k
+ end
+ return k
+end
+
+otf.getalternate = otf.getsubstitution
+
+function otf.getmultiple(tfmdata,k,kind,value,script,language)
+ local found, kind = getgsub(tfmdata,k,kind,value,script,language)
+ if found and kind == "gsub_multiple" then
+ return found
+ end
+ return { k }
+end
+
+function otf.getkern(tfmdata,left,right,kind,value,script,language)
+ local kerns = getgsub(tfmdata,left,kind or "kern",true,script,language) -- for now we use getsub
+ if kerns then
+ local found = kerns[right]
+ local kind = type(found)
+ if kind == "table" then
+ found = found[1][3] -- can be more clever
+ elseif kind ~= "number" then
+ found = false
+ end
+ if found then
+ return found * tfmdata.parameters.factor
+ end
+ end
+ return 0
+end
+
+local function check_otf(forced,specification,suffix)
+ local name = specification.name
+ if forced then
+ name = specification.forcedname -- messy
+ end
+ local fullname = findbinfile(name,suffix) or ""
+ if fullname == "" then
+ fullname = fonts.names.getfilename(name,suffix) or ""
+ end
+ if fullname ~= "" and not fonts.names.ignoredfile(fullname) then
+ specification.filename = fullname
+ return read_from_otf(specification)
+ end
+end
+
+local function opentypereader(specification,suffix)
+ local forced = specification.forced or ""
+ if formats[forced] then
+ return check_otf(true,specification,forced)
+ else
+ return check_otf(false,specification,suffix)
+ end
+end
+
+readers.opentype = opentypereader -- kind of useless and obsolete
+
+function readers.otf(specification) return opentypereader(specification,"otf") end
+function readers.ttf(specification) return opentypereader(specification,"ttf") end
+function readers.ttc(specification) return opentypereader(specification,"ttf") end
+
+function readers.woff(specification)
+ checkconversion(specification)
+ opentypereader(specification,"")
+end
+
+-- this will be overloaded
+
+function otf.scriptandlanguage(tfmdata,attr)
+ local properties = tfmdata.properties
+ return properties.script or "dflt", properties.language or "dflt"
+end
+
+-- a little bit of abstraction
+
+local function justset(coverage,unicode,replacement)
+ coverage[unicode] = replacement
+end
+
+otf.coverup = {
+ stepkey = "steps",
+ actions = {
+ chainsubstitution = justset,
+ chainposition = justset,
+ substitution = justset,
+ alternate = justset,
+ multiple = justset,
+ kern = justset,
+ pair = justset,
+ single = justset,
+ ligature = function(coverage,unicode,ligature)
+ local first = ligature[1]
+ local tree = coverage[first]
+ if not tree then
+ tree = { }
+ coverage[first] = tree
+ end
+ for i=2,#ligature do
+ local l = ligature[i]
+ local t = tree[l]
+ if not t then
+ t = { }
+ tree[l] = t
+ end
+ tree = t
+ end
+ tree.ligature = unicode
+ end,
+ },
+ register = function(coverage,featuretype,format)
+ return {
+ format = format,
+ coverage = coverage,
+ }
+ end
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-ots.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-ots.lmt
index 37f76b258a7..e7fcfc57675 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-ots.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-ots.lmt
@@ -8,6 +8,11 @@ if not modules then modules = { } end modules ['font-ots'] = { -- sequences
}
--[[ldx--
+<p>I need to check the description at the microsoft site ... it has been improved
+so maybe there are some interesting details there. Most below is based on old and
+incomplete documentation and involved quite a bit of guesswork (checking with the
+abstract uniscribe of those days. But changing things is tricky!</p>
+
<p>This module is a bit more split up that I'd like but since we also want to test
with plain <l n='tex'/> it has to be so. This module is part of <l n='context'/>
and discussion about improvements and functionality mostly happens on the
@@ -162,13 +167,10 @@ local trace_testruns = false registertracker("otf.testruns", function
local forcediscretionaries = false
local forcepairadvance = false -- for testing
-directives.register("otf.forcediscretionaries",function(v)
- forcediscretionaries = v
-end)
+local repeatlastmultiple = context and true
-directives.register("otf.forcepairadvance",function(v)
- forcepairadvance = v
-end)
+directives.register("otf.forcediscretionaries", function(v) forcediscretionaries = v end)
+directives.register("otf.forcepairadvance", function(v) forcepairadvance = v end)
local report_direct = logs.reporter("fonts","otf direct")
local report_subchain = logs.reporter("fonts","otf subchain")
@@ -193,7 +195,6 @@ local getboth = nuts.getboth
local setboth = nuts.setboth
local getid = nuts.getid
local getstate = nuts.getstate
-local setsubtype = nuts.setsubtype
local getchar = nuts.getchar
local setchar = nuts.setchar
local getdisc = nuts.getdisc
@@ -210,41 +211,39 @@ local getscales = nuts.getscales
---------------------------------------------------------------------------------------
-- Beware: In ConTeXt components no longer are real components. We only keep track of
--- their positions because some complex ligatures might need that. For the moment we
--- use an x_ prefix because for now generic follows the other approach.
+-- their positions because some complex ligatures might need that.
-local copy_no_components = nuts.copy_no_components
-local copy_only_glyphs = nuts.copy_only_glyphs
-local count_components = nuts.count_components
-local set_components = nuts.set_components
-local get_components = nuts.get_components
-local flush_components = nuts.flush_components
+local components = nuts.components
+local copynocomponents = components.copynocomponents
+local copyonlyglyphs = components.copyonlyglyphs
+local countcomponents = components.count
+local setcomponents = components.set
+local getcomponents = components.get
+local flushcomponents = components.flush
---------------------------------------------------------------------------------------
local ischar = nuts.ischar
local isnextchar = nuts.isnextchar -- only makes sense when we know we need next
local isprevchar = nuts.isprevchar -- only makes sense when we know we need prev
-local usesfont = nuts.uses_font
-
-local insert_node_after = nuts.insert_after
-local copy_node = nuts.copy
-local copy_node_list = nuts.copy_list
-local remove_node = nuts.remove
-local find_node_tail = nuts.tail
-local flush_node_list = nuts.flush_list
-local flush_node = nuts.flush_node
-local end_of_math = nuts.end_of_math
-local start_of_par = nuts.start_of_par
+local usesfont = nuts.usesfont
+
+local insertnodeafter = nuts.insertafter
+local copynode = nuts.copy
+local copynodelist = nuts.copylist
+local removenode = nuts.remove
+local findnodetail = nuts.tail
+local flushnodelist = nuts.flushlist
+local flushnode = nuts.flushnode
+local endofmath = nuts.endofmath
+
+local startofpar = nuts.startofpar
local setmetatable = setmetatable
local setmetatableindex = table.setmetatableindex
local nextnode = nuts.traversers.node
------ zwnj = 0x200C
------ zwj = 0x200D
-
local nodecodes = nodes.nodecodes
local glyphcodes = nodes.glyphcodes
@@ -259,7 +258,6 @@ local lefttoright_code = nodes.dirvalues.lefttoright
local righttoleft_code = nodes.dirvalues.righttoleft
local discretionarydisc_code = nodes.disccodes.discretionary
-local ligatureglyph_code = glyphcodes.ligature
local injections = nodes.injections
local setmark = injections.setmark
@@ -294,9 +292,9 @@ local marks = false
local classes = false
local currentfont = false
local currentdynamic = false
-local currentscale = false
-local currentxscale = false
-local currentyscale = false
+local currentscale = 1000
+local currentxscale = 1000
+local currentyscale = 1000
local factor = 0
local threshold = 0
local checkmarks = false
@@ -320,12 +318,21 @@ local checkstep = (tracers and tracers.steppers.check) or function()
local registerstep = (tracers and tracers.steppers.register) or function() end
local registermessage = (tracers and tracers.steppers.message) or function() end
--- local function checkdisccontent(d)
--- local pre, post, replace = getdisc(d)
--- if pre then for n in traverse_id(glue_code,pre) do report("pre: %s",nodes.idstostring(pre)) break end end
--- if post then for n in traverse_id(glue_code,post) do report("pos: %s",nodes.idstostring(post)) break end end
--- if replace then for n in traverse_id(glue_code,replace) do report("rep: %s",nodes.idstostring(replace)) break end end
--- end
+do
+
+ local setchr = setchar
+ local direct = nil
+
+ setchar = function(n,c)
+ direct = fonts.collections.direct
+ setchar = function(n,c)
+ setchr(n,c)
+ direct(n)
+ end
+ setchar(n,c)
+ end
+
+end
local function logprocess(...)
if trace_steps then
@@ -383,7 +390,7 @@ local function cref(dataset,sequence,index)
return "no valid dataset"
end
local merged = sequence.merged and "merged " or ""
- if index then
+ if index and index > 1 then
return formatters["feature %a, type %a, %schain lookup %a, index %a"](
dataset[4],sequence.type,merged,sequence.name,index)
else
@@ -421,17 +428,17 @@ end
-- However, for arabic we need to keep them around for the sake of mark placement
-- and indices.
-local function flattendisk(head,disc)
+local function flattendisk(head,disc) -- happen seldom, otherwise can be a helper
local pre, post, replace, pretail, posttail, replacetail = getdisc(disc,true)
local prev, next = getboth(disc)
local ishead = head == disc
setdisc(disc)
- flush_node(disc)
+ flushnode(disc)
if pre then
- flush_node_list(pre)
+ flushnodelist(pre)
end
if post then
- flush_node_list(post)
+ flushnodelist(post)
end
if ishead then
if replace then
@@ -458,10 +465,10 @@ local function flattendisk(head,disc)
end
end
-local function appenddisc(disc,list)
+local function appenddisc(disc,list) -- happen seldom, otherwise can be a helper
local pre, post, replace, pretail, posttail, replacetail = getdisc(disc,true)
local posthead = list
- local replacehead = copy_node_list(list)
+ local replacehead = copynodelist(list)
if post then
setlink(posttail,posthead)
else
@@ -483,16 +490,15 @@ local function markstoligature(head,start,stop,char)
local next = getnext(stop)
setprev(start)
setnext(stop)
- local base = copy_no_components(start,copyinjection)
+ local base = copynocomponents(start,copyinjection)
if head == start then
head = base
end
resetinjection(base)
setchar(base,char)
- setsubtype(base,ligatureglyph_code)
- set_components(base,start)
+ setcomponents(base,start)
setlink(prev,base,next)
- flush_components(start)
+ flushcomponents(start)
return head, base
end
end
@@ -507,12 +513,14 @@ end
-- we can have more granularity here but for now we only do a simple check
-local no_left_ligature_code = 1
-local no_right_ligature_code = 2
-local no_left_kern_code = 4
-local no_right_kern_code = 8
+local glyphoptioncodes = tex.glyphoptioncodes
+
+local no_left_ligature_code = glyphoptioncodes.noleftligature
+local no_right_ligature_code = glyphoptioncodes.norightligature
+----- no_left_kern_code = glyphoptioncodes.noleftkern
+local no_right_kern_code = glyphoptioncodes.norightkern
-local has_glyph_option = nuts.has_glyph_option
+local hasglyphoption = nuts.hasglyphoption
-- in lmtx we need to check the components and can be slightly more clever
@@ -520,18 +528,18 @@ local function inhibited(start,stop)
for n in nextnode, start do
-- we asume glyph nodes
if n == start then
- if has_glyph_option(n,no_right_ligature_code) then
+ if hasglyphoption(n,no_right_ligature_code) then
return true
end
elseif n == stop then
- if has_glyph_option(n,no_left_ligature_code) then
+ if hasglyphoption(n,no_left_ligature_code) then
return true
else
return false
end
- elseif has_glyph_option(n,no_left_ligature_code) then
+ elseif hasglyphoption(n,no_left_ligature_code) then
return true
- elseif has_glyph_option(n,no_right_ligature_code) then
+ elseif hasglyphoption(n,no_right_ligature_code) then
return true
end
end
@@ -539,9 +547,10 @@ local function inhibited(start,stop)
end
local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfound,hasmarks) -- brr head
- if start == stop and getchar(start) == char then
+ if start == stop and getchar(start) == char and not hasmarks then
resetinjection(start)
setchar(start,char)
+ -- fonts.collections.direct(start)
return head, start
end
if inhibited(start,stop) then
@@ -552,15 +561,15 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
local comp = start
setprev(start)
setnext(stop)
- local base = copy_no_components(start,copyinjection)
+ local base = copynocomponents(start,copyinjection)
if start == head then
head = base
end
resetinjection(base)
setchar(base,char)
+ -- fonts.collections.direct(base)
setoptions(base,getoptions(start) | getoptions(stop)) -- maybe only lig options
- setsubtype(base,ligatureglyph_code)
- set_components(base,comp)
+ setcomponents(base,comp)
setlink(prev,base,next)
if not discfound then
local deletemarks = not skiphash or hasmarks
@@ -574,7 +583,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
local char = getchar(start)
if not marks[char] then
baseindex = baseindex + componentindex
- componentindex = count_components(start,marks)
+ componentindex = countcomponents(start,marks)
-- we can be more clever here: "not deletemarks or (skiphash and not skiphash[char])"
-- and such:
elseif not deletemarks then
@@ -583,9 +592,9 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
if trace_marks then
logwarning("%s: keep ligature mark %s, gets index %s",pref(dataset,sequence),gref(char),getligaindex(start))
end
- local n = copy_node(start)
+ local n = copynode(start)
copyinjection(n,start) -- is this ok ? we position later anyway
- head, current = insert_node_after(head,current,n) -- unlikely that mark has components
+ head, current = insertnodeafter(head,current,n) -- unlikely that mark has components
elseif trace_marks then
logwarning("%s: delete ligature mark %s",pref(dataset,sequence),gref(char))
end
@@ -610,7 +619,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
break
end
end
- flush_components(components)
+ flushcomponents(components)
else
-- discfound ... forget about marks .. probably no scripts that hyphenate and have marks
local discprev, discnext = getboth(discfound)
@@ -622,8 +631,8 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
if not replace then
-- looks like we never come here as it's not okay
local prev = getprev(base)
- -- local comp = get_components(base) -- already set
- local copied = copy_only_glyphs(comp)
+ -- local comp = getcomponents(base) -- already set
+ local copied = copyonlyglyphs(comp)
if pre then
setlink(discprev,pre)
else
@@ -640,7 +649,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou
setlink(prev,discfound,next)
setboth(base)
-- here components have a pointer so we can't free it!
- set_components(base,copied)
+ setcomponents(base,copied)
replace = base
if forcediscretionaries then
setdisc(discfound,pre,post,replace,discretionarydisc_code)
@@ -657,32 +666,69 @@ end
local function multiple_glyphs(head,start,multiple,skiphash,what,stop) -- what to do with skiphash matches here
local nofmultiples = #multiple
if nofmultiples > 0 then
+ local first = start
resetinjection(start)
setchar(start,multiple[1])
if nofmultiples > 1 then
- local sn = getnext(start)
- for k=2,nofmultiples do
+ -- local sn = getnext(start)
+ for i=2,nofmultiples do
-- untested:
--
-- while ignoremarks and marks[getchar(sn)] then
-- local sn = getnext(sn)
-- end
- local n = copy_node(start) -- ignore components
+ local n = copynode(start) -- ignore components
resetinjection(n)
- setchar(n,multiple[k])
- insert_node_after(head,start,n)
+ setchar(n,multiple[i])
+ insertnodeafter(head,start,n)
start = n
end
- if what == true then
- -- we're ok
- elseif what > 1 then
- local m = multiple[nofmultiples]
- for i=2,what do
- local n = copy_node(start) -- ignore components
- resetinjection(n)
- setchar(n,m)
- insert_node_after(head,start,n)
- start = n
+ end
+ if what ~= true then
+ -- This is just some experimental code; we might introduce gsub_extensible
+ -- some day instead. Beware: when we have a feature that mixes alternates and
+ -- multiples we need to make sure we don't handle the alternate string values
+ -- here.
+ local kind = type(what)
+ local m, f, l
+ if kind == "string" then
+ local what, n = string.match(what,"^repeat(.-)[:=](%d+)$")
+ if what == "middle" then
+ m = tonumber(n)
+ elseif what == "first" then
+ f = tonumber(n)
+ elseif what == "last" then
+ l = tonumber(n)
+ end
+ elseif kind == "table" then
+ -- won't happen because currently we don't split these values
+ m = what.middle
+ f = what.first
+ l = what.last
+ end
+ if f or m or l then
+ if m and m > 1 and nofmultiples == 3 then
+ local middle = getnext(first)
+ for i=2,m do
+ local n = copynode(middle) -- ignore components
+ resetinjection(n)
+ insertnodeafter(head,first,n)
+ end
+ end
+ if f and f > 1 then
+ for i=2,f do
+ local n = copynode(first) -- ignore components
+ resetinjection(n)
+ insertnodeafter(head,first,n)
+ end
+ end
+ if l and l > 1 then
+ for i=2,l do
+ local n = copynode(start) -- ignore components
+ resetinjection(n)
+ insertnodeafter(head,start,n)
+ start = n
+ end
end
end
end
@@ -777,7 +823,12 @@ end
-- simplified. Anyway, it can be way messier: marks that get removed as well as
-- marks that are kept.
+-- Blocking is nasty: (ff\zwj l) vs (ff\zwj l) vs (ffl) vs (f\zwj fl}
+
function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skiphash)
+ if start and hasglyphoption(start,no_right_ligature_code) then
+ return head, start, false, nil
+ end
local current = getnext(start)
if not current then
return head, start, false, nil
@@ -787,8 +838,8 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
if skiphash and skiphash[startchar] then
while current do
local nxt, char = isnextchar(current,currentfont,currentdynamic,currentscale,currentxscale,currentyscale)
- if char then
- local lg = ligature[char]
+ if char and not hasglyphoption(current,no_left_ligature_code) then
+ local lg = not tonumber(ligature) and ligature[char]
if lg then
stop = current
ligature = lg
@@ -801,14 +852,14 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
end
end
if stop then
- local lig = ligature.ligature
- if lig then
+ local ligature = tonumber(ligature) or ligature.ligature
+ if ligature then
if trace_ligatures then
local stopchar = getchar(stop)
- head, start = markstoligature(head,start,stop,lig)
+ head, start = markstoligature(head,start,stop,ligature)
logprocess("%s: replacing %s upto %s by ligature %s case 1",pref(dataset,sequence),gref(startchar),gref(stopchar),gref(getchar(start)))
else
- head, start = markstoligature(head,start,stop,lig)
+ head, start = markstoligature(head,start,stop,ligature)
end
return head, start, true, false
else
@@ -823,8 +874,10 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
if char then
if skiphash and skiphash[char] then
current = nxt
+ elseif hasglyphoption(current,no_left_ligature_code) then
+ break
else
- local lg = ligature[char]
+ local lg = not tonumber(ligature) and ligature[char]
if lg then
if marks[char] then
hasmarks = true
@@ -852,26 +905,30 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
--
-- Challenge for Kai (latinmodern): \hyphenation{fii-f-f-iif} fiiffiif
--
- if discfound then
+ if tonumber(ligature) then
+ -- we're already done (endpoint reached)
+ elseif discfound then
+ -- todo: check for no right ligature
-- don't assume marks in a disc and we don't run over a disc (for now)
local pre, post, replace = getdisc(discfound)
local match
if replace then
local nxt, char = isnextchar(replace,currentfont,currentdynamic,currentscale,currentxscale,currentyscale)
- if char and ligature[char] then
+ if char and ligature[char] and not hasglyphoption(replace,no_left_ligature_code) then
match = true
end
end
if not match and pre then
local nxt, char = isnextchar(pre,currentfont,currentdynamic,currentscale,currentxscale,currentyscale)
- if char and ligature[char] then
+ if char and ligature[char] and not hasglyphoption(pre,no_left_ligature_code) then
match = true
end
end
-- is this test ok:
if not match and not pre or not replace then
- local nxt, char = isnextchar(getnext(discfound),currentfont,currentdynamic,currentscale,currentxscale,currentyscale)
- if char and ligature[char] then
+ local ndf = getnext(discfound)
+ local nxt, char = isnextchar(ndf,currentfont,currentdynamic,currentscale,currentxscale,currentyscale)
+ if char and ligature[char] and not hasglyphoption(ndf,no_left_ligature_code) then
match = true
end
end
@@ -881,9 +938,9 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
local prev = getprev(start)
if stop then
setnext(stop)
- local copy = copy_node_list(start)
+ local copy = copynodelist(start)
local tail = stop -- was: getprev(stop) -- Kai: needs checking on your samples
- local liat = find_node_tail(copy)
+ local liat = findnodetail(copy)
if pre then
setlink(liat,pre)
end
@@ -894,7 +951,7 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
replace = start
else
setnext(start)
- local copy = copy_node(start)
+ local copy = copynode(start)
if pre then
setlink(copy,pre)
end
@@ -914,27 +971,30 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
start = discfound
return head, start, true, true
end
+ ligature = ligature.ligature
+ else
+ ligature = ligature.ligature
end
- local lig = ligature.ligature
- if lig then
+ -- local ligature = tonumber(ligature) or ligature.ligature
+ if ligature then
if stop then
if trace_ligatures then
local stopchar = getchar(stop)
- -- head, start = toligature(head,start,stop,lig,dataset,sequence,skiphash,discfound,hasmarks)
- head, start = toligature(head,start,stop,lig,dataset,sequence,skiphash,false,hasmarks)
- logprocess("%s: replacing %s upto %s by ligature %s case 2",pref(dataset,sequence),gref(startchar),gref(stopchar),gref(lig))
+ -- head, start = toligature(head,start,stop,ligature,dataset,sequence,skiphash,discfound,hasmarks)
+ head, start = toligature(head,start,stop,ligature,dataset,sequence,skiphash,false,hasmarks)
+ logprocess("%s: replacing %s upto %s by ligature %s case 2",pref(dataset,sequence),gref(startchar),gref(stopchar),gref(ligature))
-- we can have a rare case of multiple disc in a lig but that makes no sense language wise but if really
-- needed we could backtrack if we're in a disc node
else
- -- head, start = toligature(head,start,stop,lig,dataset,sequence,skiphash,discfound,hasmarks)
- head, start = toligature(head,start,stop,lig,dataset,sequence,skiphash,false,hasmarks)
+ -- head, start = toligature(head,start,stop,ligature,dataset,sequence,skiphash,discfound,hasmarks)
+ head, start = toligature(head,start,stop,ligature,dataset,sequence,skiphash,false,hasmarks)
end
else
-- weird but happens (in some arabic font)
resetinjection(start)
- setchar(start,lig)
+ setchar(start,ligature)
if trace_ligatures then
- logprocess("%s: replacing %s by (no real) ligature %s case 3",pref(dataset,sequence),gref(startchar),gref(lig))
+ logprocess("%s: replacing %s by (no real) ligature %s case 3",pref(dataset,sequence),gref(startchar),gref(ligature))
end
end
return head, start, true, false
@@ -946,7 +1006,7 @@ function handlers.gsub_ligature(head,start,dataset,sequence,ligature,rlmode,skip
end
function handlers.gpos_single(head,start,dataset,sequence,kerns,rlmode,skiphash,step,injection)
- if has_glyph_option(start,no_right_kern_code) then
+ if hasglyphoption(start,no_right_kern_code) then
return head, start, false
else
local startchar = getchar(start)
@@ -967,7 +1027,7 @@ function handlers.gpos_single(head,start,dataset,sequence,kerns,rlmode,skiphash,
end
function handlers.gpos_pair(head,start,dataset,sequence,kerns,rlmode,skiphash,step,injection)
- if has_glyph_option(start,no_right_kern_code) then
+ if hasglyphoption(start,no_right_kern_code) then
return head, start, false
else
local snext = getnext(start)
@@ -1078,7 +1138,7 @@ function handlers.gpos_mark2base(head,start,dataset,sequence,markanchors,rlmode,
end
return head, start, true
elseif trace_bugs then
- -- onetimemessage(currentfont,basechar,"no base anchors",report_fonts)
+ -- onetimemessage(currentfont,basechar,"no base anchors")
logwarning("%s: mark %s is not anchored to %s",pref(dataset,sequence),gref(markchar),gref(basechar))
end
elseif trace_bugs then
@@ -1145,7 +1205,7 @@ function handlers.gpos_mark2ligature(head,start,dataset,sequence,markanchors,rlm
end
elseif trace_bugs then
-- logwarning("%s: char %s is missing in font",pref(dataset,sequence),gref(basechar))
- onetimemessage(currentfont,basechar,"no base anchors",report_fonts)
+ onetimemessage(currentfont,basechar,"no base anchors")
end
elseif trace_bugs then
logwarning("%s: prev node is no char, case %i",pref(dataset,sequence),1)
@@ -1310,7 +1370,7 @@ as less as needed but that would also make the code even more messy.</p>
-- To be done (example needed): what if > 1 steps
--- this is messy: do we need this disc checking also in alternaties?
+-- this is messy: do we need this disc checking also in alternates?
local function reportzerosteps(dataset,sequence)
logwarning("%s: no steps",cref(dataset,sequence))
@@ -1346,7 +1406,7 @@ function chainprocs.gsub_remove(head,start,stop,dataset,sequence,currentlookup,r
if trace_chains then
logprocess("%s: removing character %s",cref(dataset,sequence,chainindex),gref(getchar(start)))
end
- head, start = remove_node(head,start,true)
+ head, start = removenode(head,start,true)
return head, getprev(start), true
end
@@ -1475,6 +1535,9 @@ assume rather stupid ligatures (no complex disc nodes).</p>
-- compare to handlers.gsub_ligature which is more complex ... why
function chainprocs.gsub_ligature(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash,chainindex)
+ if start and hasglyphoption(start,no_right_ligature_code) then
+ return head, start, false, 0, false
+ end
local mapping = currentlookup.mapping
if mapping == nil then
mapping = getmapping(dataset,sequence,currentlookup)
@@ -1493,55 +1556,19 @@ function chainprocs.gsub_ligature(head,start,stop,dataset,sequence,currentlookup
local last = stop
local nofreplacements = 1
while current do
- -- todo: ischar ... can there really be disc nodes here?
--- local id = getid(current)
--- if id == disc_code then
--- if not discfound then
--- discfound = current
--- end
--- if current == stop then
--- break -- okay? or before the disc
--- else
--- current = getnext(current)
--- end
--- else
--- local schar = getchar(current)
--- if skiphash and skiphash[schar] then -- marks
--- -- if current == stop then -- maybe add this
--- -- break
--- -- else
--- current = getnext(current)
--- -- end
--- else
--- local lg = ligatures[schar]
--- if lg then
--- ligatures = lg
--- last = current
--- nofreplacements = nofreplacements + 1
--- if marks[char] then
--- hasmarks = true
--- end
--- if current == stop then
--- break
--- else
--- current = getnext(current)
--- end
--- else
--- break
--- end
--- end
--- end
- --
- local nxt, schar, id = isnextchar(current,currentfont,currentdynamic,currentscale,currentxscale,currentyscale)
- if schar then
- if skiphash and skiphash[schar] then -- marks
+ local nxt, char, id = isnextchar(current,currentfont,currentdynamic,currentscale,currentxscale,currentyscale)
+ if char then
+ if current and hasglyphoption(current,no_left_ligature_code) then
+ break
+ end
+ if skiphash and skiphash[char] then -- marks
-- if current == stop then -- maybe add this
-- break
-- else
current = nxt
-- end
- else
- local lg = ligatures[schar]
+ else
+ local lg = not tonumber(ligatures) and ligatures[char]
if lg then
ligatures = lg
last = current
@@ -1570,9 +1597,9 @@ function chainprocs.gsub_ligature(head,start,stop,dataset,sequence,currentlookup
else
break
end
- --
end
- local ligature = ligatures.ligature
+ -- we can avoid the tonumber as already done but messy
+ local ligature = tonumber(ligatures) or ligatures.ligature
if ligature then
if chainindex then
stop = last
@@ -1600,7 +1627,7 @@ end
function chainprocs.gpos_single(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash,chainindex)
-- we actually should check no_left_kern_code with next
- if not has_glyph_option(start,no_right_kern_code) then
+ if not hasglyphoption(start,no_right_kern_code) then
local mapping = currentlookup.mapping
if mapping == nil then
mapping = getmapping(dataset,sequence,currentlookup)
@@ -1630,7 +1657,7 @@ end
function chainprocs.gpos_pair(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash,chainindex) -- todo: injections ?
-- we actually should check no_left_kern_code with next
- if not has_glyph_option(start,no_right_kern_code) then
+ if not hasglyphoption(start,no_right_kern_code) then
local mapping = currentlookup.mapping
if mapping == nil then
mapping = getmapping(dataset,sequence,currentlookup)
@@ -1926,7 +1953,7 @@ function chainprocs.gpos_cursive(head,start,stop,dataset,sequence,currentlookup,
end
end
elseif trace_bugs then
- onetimemessage(currentfont,startchar,"no entry anchors",report_fonts)
+ onetimemessage(currentfont,startchar,"no entry anchors")
end
break
end
@@ -1982,7 +2009,7 @@ do if not userkern then -- generic
local setkern = nuts.setkern -- not injections.setkern
userkern = function(k)
- local n = copy_node(thekern)
+ local n = copynode(thekern)
setkern(n,k)
return n
end
@@ -1999,13 +2026,13 @@ local function checked(head)
if next then
setlink(kern,next)
end
- flush_node(current)
+ flushnode(current)
head = kern
current = next
else
local prev, next = getboth(current)
setlink(prev,kern,next)
- flush_node(current)
+ flushnode(current)
current = next
end
else
@@ -2022,14 +2049,11 @@ local function setdiscchecked(d,pre,post,replace)
setdisc(d,pre,post,replace)
end
-local noflags = { false, false, false, false }
-
-local function chainrun(head,start,last,dataset,sequence,rlmode,skiphash,ck)
+local function chainrun(head,start,last,dataset,sequence,rlmode,skiphash,ck,where)
local size = ck[5] - ck[4] + 1
local chainlookups = ck[6]
local done = false
-
-- current match
if chainlookups then
-- Lookups can be like { 1, false, 3 } or { false, 2 } or basically anything and
@@ -2040,21 +2064,31 @@ local function chainrun(head,start,last,dataset,sequence,rlmode,skiphash,ck)
-- if nofchainlookups > size then
-- -- bad rules
-- end
-
local chainlookup = chainlookups[1]
- for j=1,#chainlookup do
- local chainstep = chainlookup[j]
- local chainkind = chainstep.type
- local chainproc = chainprocs[chainkind]
- if chainproc then
- local ok
- head, start, ok = chainproc(head,start,last,dataset,sequence,chainstep,rlmode,skiphash)
- if ok then
- done = true
+ if chainlookup then
+ for j=1,#chainlookup do
+ local chainstep = chainlookup[j]
+ if chainstep then
+ local chainkind = chainstep.type
+ local chainproc = chainprocs[chainkind]
+ if chainproc then
+ local ok
+ -- HH: chainindex 1 added here (for KAI to check too), there are weird ligatures e.g.
+ -- char + mark -> char where mark has to disappear
+ -- head, start, ok = chainproc(head,start,last,dataset,sequence,chainstep,rlmode,skiphash,1)
+ head, start, ok = chainproc(head,start,last,dataset,sequence,chainstep,rlmode,skiphash)
+ if ok then
+ done = true
+ end
+ else
+ logprocess("%s: %s is not yet supported (1)",cref(dataset,sequence),chainkind)
+ end
+ else
+ logprocess("%s: has an issue (1)",cref(dataset,sequence))
end
- else
- logprocess("%s: %s is not yet supported (1)",cref(dataset,sequence),chainkind)
end
+ else
+ -- whatever
end
else
@@ -2095,23 +2129,28 @@ local function chainrun(head,start,last,dataset,sequence,rlmode,skiphash,ck)
if chainlookup then
for j=1,#chainlookup do
local chainstep = chainlookup[j]
- local chainkind = chainstep.type
- local chainproc = chainprocs[chainkind]
- if chainproc then
- local ok, n
- head, start, ok, n = chainproc(head,start,last,dataset,sequence,chainstep,rlmode,skiphash,i)
- -- messy since last can be changed !
- if ok then
- done = true
- if n and n > 1 and i + n > nofchainlookups then
- -- this is a safeguard, we just ignore the rest of the lookups
- i = size -- prevents an advance
- break
+ if chainstep then
+ local chainkind = chainstep.type
+ local chainproc = chainprocs[chainkind]
+ if chainproc then
+ local ok, n
+ head, start, ok, n = chainproc(head,start,last,dataset,sequence,chainstep,rlmode,skiphash,i)
+ -- messy since last can be changed !
+ if ok then
+ done = true
+ if n and n > 1 and i + n > nofchainlookups then
+ -- this is a safeguard, we just ignore the rest of the lookups
+ i = size -- prevents an advance
+ break
+ end
end
+ else
+ -- actually an error
+ logprocess("%s: %s is not yet supported (2)",cref(dataset,sequence),chainkind)
end
else
-- actually an error
- logprocess("%s: %s is not yet supported (2)",cref(dataset,sequence),chainkind)
+ logprocess("%s: has an issue (2)",cref(dataset,sequence))
end
end
else
@@ -2139,7 +2178,7 @@ local function chainrun(head,start,last,dataset,sequence,rlmode,skiphash,ck)
else
done = true
if trace_contexts then
- logprocess("%s: skipping match",cref(dataset,sequence))
+ logprocess("%s: skipping match @ %i",cref(dataset,sequence),where)
end
end
end
@@ -2169,6 +2208,8 @@ local function chaindisk(head,start,dataset,sequence,rlmode,skiphash,ck)
local last = start
local prev = getprev(start)
local hasglue = false
+ local useddisc = nil -- new 2022-09-25
+ local usedstart = start -- new 2022-09-25
-- fishy: so we can overflow and then go on in the sweep?
-- todo : id can also be glue_code as we checked spaces
@@ -2239,7 +2280,7 @@ local function chaindisk(head,start,dataset,sequence,rlmode,skiphash,ck)
tail = prev
setprev(current,sweepnode)
else
- tail = find_node_tail(head)
+ tail = findnodetail(head)
end
setnext(sweepnode,current)
setprev(head)
@@ -2310,6 +2351,7 @@ local function chaindisk(head,start,dataset,sequence,rlmode,skiphash,ck)
if keepdisc then
keepdisc = false
if notmatchpost[current] ~= notmatchreplace[current] then
+-- print(notmatchpost[current],notmatchreplace[current])
backtrackdisc = current
end
-- we assume a simple text only replace (we could use nuts.count)
@@ -2330,15 +2372,14 @@ local function chaindisk(head,start,dataset,sequence,rlmode,skiphash,ck)
end
end
end
+
local done = false
if lookaheaddisc then
-
local cf = start
local cl = getprev(lookaheaddisc)
local cprev = getprev(start)
local insertedmarks = 0
-
while cprev do
local nxt, char = isnextchar(cf,currentfont,currentdynamic,currentscale,currentxscale,currentyscale)
if char and marks[char] then
@@ -2357,13 +2398,13 @@ local function chaindisk(head,start,dataset,sequence,rlmode,skiphash,ck)
head = lookaheaddisc
end
local pre, post, replace = getdisc(lookaheaddisc)
- local new = copy_node_list(cf) -- br, how often does that happen
+ local new = copynodelist(cf) -- br, how often does that happen
local cnew = new
if pre then
- setlink(find_node_tail(cf),pre)
+ setlink(findnodetail(cf),pre)
end
if replace then
- local tail = find_node_tail(new)
+ local tail = findnodetail(new)
setlink(tail,replace)
end
for i=1,insertedmarks do
@@ -2377,14 +2418,14 @@ local function chaindisk(head,start,dataset,sequence,rlmode,skiphash,ck)
end
if not notmatchpre[lookaheaddisc] then
local ok = false
- cf, start, ok = chainrun(cf,start,cl,dataset,sequence,rlmode,skiphash,ck)
+ cf, start, ok = chainrun(cf,start,cl,dataset,sequence,rlmode,skiphash,ck,1)
if ok then
done = true
end
end
if not notmatchreplace[lookaheaddisc] then
local ok = false
- new, cnew, ok = chainrun(new,cnew,clast,dataset,sequence,rlmode,skiphash,ck)
+ new, cnew, ok = chainrun(new,cnew,clast,dataset,sequence,rlmode,skiphash,ck,2)
if ok then
done = true
end
@@ -2395,16 +2436,16 @@ local function chaindisk(head,start,dataset,sequence,rlmode,skiphash,ck)
setdisc(lookaheaddisc,cf,post,new)
end
start = getprev(lookaheaddisc)
+if done then -- new 2022-12-22 : discretionary-001.tex
+ useddisc = lookaheaddisc -- new 2022-09-25
+end
sweephead[cf] = getnext(clast) or false
sweephead[new] = getnext(cl) or false
-
elseif backtrackdisc then
-
local cf = getnext(backtrackdisc)
local cl = start
local cnext = getnext(start)
local insertedmarks = 0
-
while cnext do
local nxt, char = isnextchar(cnext,currentfont,currentdynamic,currentscale,currentxscale,currentyscale)
if char and marks[char] then
@@ -2419,8 +2460,8 @@ local function chaindisk(head,start,dataset,sequence,rlmode,skiphash,ck)
setprev(cf)
setnext(cl)
local pre, post, replace, pretail, posttail, replacetail = getdisc(backtrackdisc,true)
- local new = copy_node_list(cf)
- local cnew = find_node_tail(new)
+ local new = copynodelist(cf)
+ local cnew = findnodetail(new)
for i=1,insertedmarks do
cnew = getprev(cnew)
end
@@ -2430,14 +2471,14 @@ local function chaindisk(head,start,dataset,sequence,rlmode,skiphash,ck)
end
if not notmatchpost[backtrackdisc] then
local ok = false
- cf, start, ok = chainrun(cf,start,last,dataset,sequence,rlmode,skiphash,ck)
+ cf, start, ok = chainrun(cf,start,last,dataset,sequence,rlmode,skiphash,ck,3)
if ok then
done = true
end
end
if not notmatchreplace[backtrackdisc] then
local ok = false
- new, cnew, ok = chainrun(new,cnew,clast,dataset,sequence,rlmode,skiphash,ck)
+ new, cnew, ok = chainrun(new,cnew,clast,dataset,sequence,rlmode,skiphash,ck,4)
if ok then
done = true
end
@@ -2458,33 +2499,60 @@ local function chaindisk(head,start,dataset,sequence,rlmode,skiphash,ck)
setdisc(backtrackdisc,pre,post,replace)
end
start = getprev(backtrackdisc)
+if done then -- new 2022-12-22 : discretionary-001.tex
+ useddisc = backtrackdisc -- new 2022-09-25
+end
sweephead[post] = getnext(clast) or false
sweephead[replace] = getnext(last) or false
-
else
local ok = false
- head, start, ok = chainrun(head,start,last,dataset,sequence,rlmode,skiphash,ck)
+ head, start, ok = chainrun(head,start,last,dataset,sequence,rlmode,skiphash,ck,5)
if ok then
done = true
end
end
-
- return head, start, done
+-- test case ?
+ if useddisc and start ~= usedstart then -- make this option per font -- new 2022-09-25
+ start = getnext(start) -- new 2022-09-25
+ end -- new 2022-09-25
+ return head, start, done, useddisc -- new 2022-09-25
end
-local function chaintrac(head,start,dataset,sequence,rlmode,skiphash,ck,match,discseen,sweepnode)
- local rule = ck[1]
- local lookuptype = ck[8] or ck[2]
- local nofseq = #ck[3]
- local first = ck[4]
- local last = ck[5]
- local char = getchar(start)
- logwarning("%s: rule %s %s at char %s for (%s,%s,%s) chars, lookuptype %a, %sdisc seen, %ssweeping",
- cref(dataset,sequence),rule,match and "matches" or "nomatch",
- gref(char),first-1,last-first+1,nofseq-last,lookuptype,
- discseen and "" or "no ", sweepnode and "" or "not ")
+local chaintrac do
+
+ local level = 0
+ local last = { }
+
+ chaintrac = function(head,start,dataset,sequence,rlmode,skiphash,ck,match,discseen,sweepnode)
+ if dataset then
+ level = level + 1
+ last[level] = start
+ local rule = ck[1]
+ local lookuptype = ck[8] or ck[2]
+ local nofseq = #ck[3] -- ck[3].n
+ local first = ck[4]
+ local last = ck[5]
+ local char = getchar(start)
+ logwarning("+ %i : %s: rule %s %s at char %s for (%s,%s,%s) chars, lookuptype %a, %sdisc seen, %ssweeping",
+ level,cref(dataset,sequence),rule,match and "matches" or "nomatch",
+ gref(char),first-1,last-first+1,nofseq-last,lookuptype,
+ discseen and "" or "no ", sweepnode and "" or "not ")
+ else
+ -- (start,done)
+ local what = start and "done" or "continue"
+ local where = head == last[level] and "same" or "different"
+ local char = getchar(head)
+ if char then
+ logwarning("- %i : %s at char %s, %s node",level,what,gref(char),where)
+ else
+ logwarning("- %i : %s, %s node",level,what,where)
+ end
+ level = level - 1
+ end
+ end
+
end
-- The next one is quite optimized but still somewhat slow, fonts like ebgaramond
@@ -2498,6 +2566,9 @@ end
-- the previous disc .. such be it (<before><disc><current=fl><after> with only f done)
local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,skiphash)
+ if not contexts then
+ return head, start, false
+ end
-- optimizing for rlmode gains nothing
local sweepnode = sweepnode
local sweeptype = sweeptype
@@ -2533,167 +2604,299 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s
-- fonts can have many steps (each doing one check) or many contexts
-- todo: make a per-char cache so that we have small contexts (when we have a context
- -- n == 1 and otherwise it can be more so we can even distingish n == 1 or more)
+ -- n == 1 and otherwise it can be more so we can even distinguish n == 1 or more)
local nofcontexts = contexts.n -- #contexts
local startchar = nofcontext == 1 or ischar(start,currentfont) -- already checked
for k=1,nofcontexts do -- does this disc mess work well with n > 1
- local ck = contexts[k]
- local seq = ck[3]
- local f = ck[4] -- first current
+ local ck = contexts[k]
+ local seq = ck[3]
+ local f = ck[4] -- first current
+ local last = start
if not startchar or not seq[f][startchar] then
-- report("no hit in %a at %i of %i contexts",sequence.type,k,nofcontexts)
goto next
end
- local s = seq.n -- or #seq
- local l = ck[5] -- last current
- local current = start
- local last = start
-
+ local s = seq.n -- or #seq
if s == 1 then
- goto next
- end
+ -- bit weird case: why use a chain, but it is a hit
+ else
+ local l = ck[5] -- last current
+ local current = start
+ -- local last = start
- -- current match
+ -- current match
- if l > f then
- -- before/current/after | before/current | current/after
- local discfound -- = nil
- local n = f + 1
- last = startnext -- the second in current (first already matched)
- while n <= l do
- if postreplace and not last then
- last = getnext(sweepnode)
- sweeptype = nil
- end
- if last then
- local nxt, char, id = isnextchar(last,currentfont,currentdynamic,currentscale,currentxscale,currentyscale)
- if char then
- if skiphash and skiphash[char] then
- skipped = true
- if trace_skips then
- show_skip(dataset,sequence,char,ck,classes[char])
- end
- last = nxt
- elseif seq[n][char] then
- if n < l then
+ if l > f then
+ -- before/current/after | before/current | current/after
+ local discfound -- = nil
+ local n = f + 1
+ last = startnext -- the second in current (first already matched)
+ while n <= l do
+ if postreplace and not last then
+ last = getnext(sweepnode)
+ sweeptype = nil
+ end
+ if last then
+ local nxt, char, id = isnextchar(last,currentfont,currentdynamic,currentscale,currentxscale,currentyscale)
+ if char then
+ if skiphash and skiphash[char] then
+ skipped = true
+ if trace_skips then
+ show_skip(dataset,sequence,char,ck,classes[char])
+ end
last = nxt
- end
- n = n + 1
- elseif discfound then
- notmatchreplace[discfound] = true
- if notmatchpre[discfound] then
- goto next
+ elseif seq[n][char] then
+ if n < l then
+ last = nxt
+ end
+ n = n + 1
+ elseif discfound then
+ notmatchreplace[discfound] = true
+ if notmatchpre[discfound] then
+ goto next
+ else
+ break
+ end
else
- break
- end
- else
- goto next
- end
- elseif char == false then
- if discfound then
- notmatchreplace[discfound] = true
- if notmatchpre[discfound] then
goto next
+ end
+ elseif char == false then
+ if discfound then
+ notmatchreplace[discfound] = true
+ if notmatchpre[discfound] then
+ goto next
+ else
+ break
+ end
else
- break
+ goto next
end
- else
- goto next
- end
- elseif id == disc_code then
- -- elseif id == disc_code and (not discs or discs[last]) then
- discseen = true
- discfound = last
- notmatchpre[last] = nil
- notmatchpost[last] = true
- notmatchreplace[last] = nil
- local pre, post, replace = getdisc(last)
- if pre then
- local n = n
- while pre do
- if seq[n][getchar(pre)] then
- n = n + 1
- if n > l then
+ elseif id == disc_code then
+ -- elseif id == disc_code and (not discs or discs[last]) then
+ discseen = true
+ discfound = last
+ notmatchpre[last] = nil
+ notmatchpost[last] = true
+ notmatchreplace[last] = nil
+ local pre, post, replace = getdisc(last)
+ if pre then
+ local n = n
+ while pre do
+ if seq[n][getchar(pre)] then
+ n = n + 1
+ if n > l then
+ break
+ end
+ pre = getnext(pre)
+ else
+ notmatchpre[last] = true
break
end
- pre = getnext(pre)
- else
+ end
+ if n <= l then
notmatchpre[last] = true
- break
end
- end
- if n <= l then
+ else
notmatchpre[last] = true
end
+ if replace then
+ -- so far we never entered this branch
+ while replace do
+ if seq[n][getchar(replace)] then
+ n = n + 1
+ if n > l then
+ break
+ end
+ replace = getnext(replace)
+ else
+ notmatchreplace[last] = true
+ if notmatchpre[last] then
+ goto next
+ else
+ break
+ end
+ end
+ end
+ -- why here again
+ if notmatchpre[last] then
+ goto next
+ end
+ end
+ -- maybe only if match
+ last = nxt
else
- notmatchpre[last] = true
+ goto next
end
- if replace then
- -- so far we never entered this branch
- while replace do
- if seq[n][getchar(replace)] then
- n = n + 1
- if n > l then
- break
+ else
+ goto next
+ end
+ end
+ end
+
+ -- before
+
+ if f > 1 then
+ -- if startprev then -- new 2022-09-25
+ local prev = startprev
+ if prereplace and prev == checkdisc then
+ prev = getprev(sweepnode)
+ end
+ if prev then
+ local discfound -- = nil
+ local n = f - 1
+ while n >= 1 do
+ if prev then
+ local prv, char, id = isprevchar(prev,currentfont,currentdynamic,currentscale,currentxscale,currentyscale)
+ if char then
+ if skiphash and skiphash[char] then
+ skipped = true
+ if trace_skips then
+ show_skip(dataset,sequence,char,ck,classes[char])
+ end
+ prev = prv
+ elseif seq[n][char] then
+ if n > 1 then
+ prev = prv
+ end
+ n = n - 1
+ elseif discfound then
+ notmatchreplace[discfound] = true
+ if notmatchpost[discfound] then
+ goto next
+ else
+ break
+ end
+ else
+ goto next
end
- replace = getnext(replace)
- else
- notmatchreplace[last] = true
- if notmatchpre[last] then
+ elseif char == false then
+ if discfound then
+ notmatchreplace[discfound] = true
+ if notmatchpost[discfound] then
+ goto next
+ end
+ else
goto next
+ end
+ break
+ elseif id == disc_code then
+ -- elseif id == disc_code and (not discs or discs[prev]) then
+ -- the special case: f i where i becomes dottless i ..
+ discseen = true
+ discfound = prev
+ notmatchpre[prev] = true
+ notmatchpost[prev] = nil
+ notmatchreplace[prev] = nil
+ local pre, post, replace, pretail, posttail, replacetail = getdisc(prev,true)
+ -- weird test: needs checking
+ if pre ~= start and post ~= start and replace ~= start then
+ if post then
+ local n = n
+ while posttail do
+ if seq[n][getchar(posttail)] then
+ n = n - 1
+ if posttail == post or n < 1 then
+ break
+ else
+ posttail = getprev(posttail)
+ end
+ else
+ notmatchpost[prev] = true
+ break
+ end
+ end
+ if n >= 1 then
+ notmatchpost[prev] = true
+ end
+ else
+ notmatchpost[prev] = true
+ end
+ if replace then
+ -- we seldom enter this branch (e.g. on brill efficient)
+ while replacetail do
+ if seq[n][getchar(replacetail)] then
+ n = n - 1
+ if replacetail == replace or n < 1 then
+ break
+ else
+ replacetail = getprev(replacetail)
+ end
+ else
+ notmatchreplace[prev] = true
+ if notmatchpost[prev] then
+ goto next
+ else
+ break
+ end
+ end
+ end
+ else
+ -- notmatchreplace[prev] = true -- not according to Kai
+ end
+ end
+ -- prev = getprev(prev)
+ prev = prv
+ -- elseif id == glue_code and seq[n][32] and isspace(prev,threshold,id) then
+ -- elseif seq[n][32] and spaces[prev] then
+ -- n = n - 1
+ -- prev = prv
+ elseif id == glue_code then
+ local sn = seq[n]
+ if (sn[32] and spaces[prev]) or sn[0xFFFC] then
+ n = n - 1
+ prev = prv
else
- break
+ goto next
end
+ elseif seq[n][0xFFFC] then
+ n = n - 1
+ prev = prv
+ else
+ goto next
end
- end
- -- why here again
- if notmatchpre[last] then
+ else
goto next
end
end
- -- maybe only if match
- last = nxt
else
goto next
end
- else
- goto next
- end
+ -- else -- new 2022-09-25
+ -- goto next -- new 2022-09-25
+ -- end -- new 2022-09-25
end
- end
- -- before
+ -- after
- if f > 1 then
- if startprev then
- local prev = startprev
- if prereplace and prev == checkdisc then
- prev = getprev(sweepnode)
+ if s > l then
+ local current = last and getnext(last)
+ if not current and postreplace then
+ current = getnext(sweepnode)
end
- if prev then
+ if current then
local discfound -- = nil
- local n = f - 1
- while n >= 1 do
- if prev then
- local prv, char, id = isprevchar(prev,currentfont,currentdynamic,currentscale,currentxscale,currentyscale)
+ local n = l + 1
+ while n <= s do
+ if current then
+ local nxt, char, id = isnextchar(current,currentfont,currentdynamic,currentscale,currentxscale,currentyscale)
if char then
if skiphash and skiphash[char] then
skipped = true
if trace_skips then
show_skip(dataset,sequence,char,ck,classes[char])
end
- prev = prv
+ current = nxt -- was absent
elseif seq[n][char] then
- if n > 1 then
- prev = prv
+ if n < s then -- new test
+ current = nxt -- was absent
end
- n = n - 1
+ n = n + 1
elseif discfound then
notmatchreplace[discfound] = true
- if notmatchpost[discfound] then
+ if notmatchpre[discfound] then
goto next
else
break
@@ -2704,239 +2907,109 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s
elseif char == false then
if discfound then
notmatchreplace[discfound] = true
- if notmatchpost[discfound] then
+ if notmatchpre[discfound] then
goto next
+ else
+ break
end
else
goto next
end
- break
elseif id == disc_code then
- -- elseif id == disc_code and (not discs or discs[prev]) then
- -- the special case: f i where i becomes dottless i ..
- discseen = true
- discfound = prev
- notmatchpre[prev] = true
- notmatchpost[prev] = nil
- notmatchreplace[prev] = nil
- local pre, post, replace, pretail, posttail, replacetail = getdisc(prev,true)
- -- weird test: needs checking
- if pre ~= start and post ~= start and replace ~= start then
- if post then
- local n = n
- while posttail do
- if seq[n][getchar(posttail)] then
- n = n - 1
- if posttail == post or n < 1 then
- break
- else
- posttail = getprev(posttail)
- end
- else
- notmatchpost[prev] = true
+ -- elseif id == disc_code and (not discs or discs[current]) then
+ discseen = true
+ discfound = current
+ notmatchpre[current] = nil
+ notmatchpost[current] = true
+ notmatchreplace[current] = nil
+ local pre, post, replace = getdisc(current)
+ -- no detailed checking here, todo ?
+ if pre then
+ local n = n
+ while pre do
+ if seq[n][getchar(pre)] then
+ n = n + 1
+ if n > s then
break
+ else
+ pre = getnext(pre)
end
+ else
+ notmatchpre[current] = true
+ break
end
- if n >= 1 then
- notmatchpost[prev] = true
- end
- else
- notmatchpost[prev] = true
end
- if replace then
- -- we seldom enter this branch (e.g. on brill efficient)
- while replacetail do
- if seq[n][getchar(replacetail)] then
- n = n - 1
- if replacetail == replace or n < 1 then
- break
- else
- replacetail = getprev(replacetail)
- end
+ if n <= s then
+ notmatchpre[current] = true
+ end
+ else
+ notmatchpre[current] = true
+ end
+ if replace then
+ -- so far we never entered this branch
+ while replace do
+ if seq[n][getchar(replace)] then
+ n = n + 1
+ if n > s then
+ break
else
- notmatchreplace[prev] = true
- if notmatchpost[prev] then
- goto next
- else
- break
- end
+ replace = getnext(replace)
+ end
+ else
+ notmatchreplace[current] = true
+ if notmatchpre[current] then
+ goto next
+ else
+ break
end
end
- else
- -- notmatchreplace[prev] = true -- not according to Kai
end
+ else
+ -- notmatchreplace[current] = true -- not according to Kai
end
- -- prev = getprev(prev)
- prev = prv
- -- elseif id == glue_code and seq[n][32] and isspace(prev,threshold,id) then
- -- elseif seq[n][32] and spaces[prev] then
- -- n = n - 1
- -- prev = prv
+ current = getnext(current)
elseif id == glue_code then
local sn = seq[n]
- if (sn[32] and spaces[prev]) or sn[0xFFFC] then
- n = n - 1
- prev = prv
+ if (sn[32] and spaces[current]) or sn[0xFFFC] then
+ n = n + 1
+ current = nxt
else
goto next
end
elseif seq[n][0xFFFC] then
- n = n - 1
- prev = prv
- else
- goto next
- end
- else
- goto next
- end
- end
- else
- goto next
- end
- else
- goto next
- end
- end
-
- -- after
-
- if s > l then
- local current = last and getnext(last)
- if not current and postreplace then
- current = getnext(sweepnode)
- end
- if current then
- local discfound -- = nil
- local n = l + 1
- while n <= s do
- if current then
- local nxt, char, id = isnextchar(current,currentfont,currentdynamic,currentscale,currentxscale,currentyscale)
- if char then
- if skiphash and skiphash[char] then
- skipped = true
- if trace_skips then
- show_skip(dataset,sequence,char,ck,classes[char])
- end
- current = nxt -- was absent
- elseif seq[n][char] then
- if n < s then -- new test
- current = nxt -- was absent
- end
- n = n + 1
- elseif discfound then
- notmatchreplace[discfound] = true
- if notmatchpre[discfound] then
- goto next
- else
- break
- end
- else
- goto next
- end
- elseif char == false then
- if discfound then
- notmatchreplace[discfound] = true
- if notmatchpre[discfound] then
- goto next
- else
- break
- end
- else
- goto next
- end
- elseif id == disc_code then
- -- elseif id == disc_code and (not discs or discs[current]) then
- discseen = true
- discfound = current
- notmatchpre[current] = nil
- notmatchpost[current] = true
- notmatchreplace[current] = nil
- local pre, post, replace = getdisc(current)
- -- no detailed checking here, todo ?
- if pre then
- local n = n
- while pre do
- if seq[n][getchar(pre)] then
- n = n + 1
- if n > s then
- break
- else
- pre = getnext(pre)
- end
- else
- notmatchpre[current] = true
- break
- end
- end
- if n <= s then
- notmatchpre[current] = true
- end
- else
- notmatchpre[current] = true
- end
- if replace then
- -- so far we never entered this branch
- while replace do
- if seq[n][getchar(replace)] then
- n = n + 1
- if n > s then
- break
- else
- replace = getnext(replace)
- end
- else
- notmatchreplace[current] = true
- if notmatchpre[current] then
- goto next
- else
- break
- end
- end
- end
- else
- -- notmatchreplace[current] = true -- not according to Kai
- end
- current = getnext(current)
- elseif id == glue_code then
- local sn = seq[n]
- if (sn[32] and spaces[current]) or sn[0xFFFC] then
n = n + 1
current = nxt
else
goto next
end
- elseif seq[n][0xFFFC] then
- n = n + 1
- current = nxt
else
goto next
end
- else
- goto next
end
+ else
+ goto next
end
- else
- goto next
end
end
-
if trace_contexts then
chaintrac(head,start,dataset,sequence,rlmode,skipped and skiphash,ck,true,discseen,sweepnode)
end
if discseen or sweepnode then
+ -- When we process a disc we can collapse and therefore we backtrack one node (start) and
+ -- reprocess. This is needed because there might be more in the collapsed list.
head, start, done = chaindisk(head,start,dataset,sequence,rlmode,skipped and skiphash,ck)
else
- head, start, done = chainrun(head,start,last,dataset,sequence,rlmode,skipped and skiphash,ck)
+ head, start, done = chainrun(head,start,last,dataset,sequence,rlmode,skipped and skiphash,ck,6)
+ end
+ if trace_contexts then
+ chaintrac(start,done)
end
if done then
break
-- else
-- next context
end
- ::next::
- -- if trace_chains then
- -- chaintrac(head,start,dataset,sequence,rlmode,skipped and skiphash,ck,false,discseen,sweepnode)
- -- end
+ ::next::
end
if discseen then
notmatchpre = { }
@@ -2955,21 +3028,46 @@ handlers.gsub_reversecontextchain = handle_contextchain
handlers.gpos_contextchain = handle_contextchain
handlers.gpos_context = handle_contextchain
--- this needs testing
+-- local function chained_contextchain(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash)
+-- local steps = currentlookup.steps
+-- local nofsteps = currentlookup.nofsteps
+-- if nofsteps > 1 then
+-- reportmoresteps(dataset,sequence)
+-- end
+-- -- probably wrong
+-- local l = steps[1].coverage[getchar(start)]
+-- if l then
+-- return handle_contextchain(head,start,dataset,sequence,l,rlmode,skiphash)
+-- else
+-- return head, start, false
+-- end
+-- end
+
+-- new 2022-09-25
local function chained_contextchain(head,start,stop,dataset,sequence,currentlookup,rlmode,skiphash)
local steps = currentlookup.steps
local nofsteps = currentlookup.nofsteps
- if nofsteps > 1 then
- reportmoresteps(dataset,sequence)
- end
- -- probably wrong
- local l = steps[1].coverage[getchar(start)]
- if l then
- return handle_contextchain(head,start,dataset,sequence,l,rlmode,skiphash)
+ local char = getchar(start)
+ if nofsteps == 1 then
+ local s = steps[1]
+ local l = s.coverage[char]
+ if l then
+ return handle_contextchain(head,start,dataset,sequence,l,rlmode,skiphash)
+ end
else
- return head, start, false
+ for i=1,nofsteps do
+ local s = steps[i]
+ local l = s.coverage[char]
+ if l then
+ local h, s, d = handle_contextchain(head,start,dataset,sequence,l,rlmode,skiphash)
+ if d then
+ return h, s, d
+ end
+ end
+ end
end
+ return head, start, false
end
chainprocs.gsub_context = chained_contextchain
@@ -3108,7 +3206,7 @@ do -- overcome local limit
end
-- Functions like kernrun, comprun etc evolved over time and in the end look rather
--- complex. It's a bit of a compromis between extensive copying and creating subruns.
+-- complex. It's a bit of a compromise between extensive copying and creating subruns.
-- The logic has been improved a lot by Kai and Ivo who use complex fonts which
-- really helped to identify border cases on the one hand and get insight in the diverse
-- ways fonts implement features (not always that consistent and efficient). At the same
@@ -3215,7 +3313,8 @@ local function kernrun(disc,k_run,...)
if done and trace_testruns then
report_disc("done",disc)
end
- return nextstart, done
+ -- return nextstart, done
+ return nextstart
end
-- fonts like ebgaramond do ligatures this way (less efficient than e.g. dejavu which
@@ -3268,7 +3367,8 @@ local function comprun(disc,c_run,...) -- vararg faster than the whole list
setdisc(disc,pre,post,replace)
end
--
- return getnext(disc), renewed
+ -- return getnext(disc), renewed
+ return getnext(disc)
end
-- if we can hyphenate in a lig then unlikely a lig so we
@@ -3323,7 +3423,7 @@ local function testrun(disc,t_run,c_run,...)
next = getnext(tail)
setnext(tail)
setprev(head)
- local new = copy_node_list(head)
+ local new = copynodelist(head)
if posttail then
setlink(posttail,head)
else
@@ -3396,7 +3496,8 @@ local function testrun(disc,t_run,c_run,...)
end
end
-- next can have changed (copied list)
- return getnext(disc), renewed
+ -- return getnext(disc), renewed
+ return getnext(disc)
end
-- 1{2{\oldstyle\discretionary{3}{4}{5}}6}7\par
@@ -3474,7 +3575,7 @@ local function t_run_single(start,stop,lookupcache)
while s do
local nxt, char = isnextchar(s,currentfont,currentdynamic,currentscale,currentxscale,currentyscale)
if char then
- local lg = lookupmatch[char]
+ local lg = not tonumber(lookupmatch) and lookupmatch[char]
if lg then
if sstop then
d = 1
@@ -3504,7 +3605,7 @@ local function t_run_single(start,stop,lookupcache)
break
end
end
- if l and l.ligature then -- so we test for ligature
+ if l and (tonumber(l) or l.ligature) then -- so we test for ligature
lastd = d
end
end
@@ -3618,7 +3719,7 @@ local function t_run_multiple(start,stop,steps,nofsteps)
while s do
local nxt, char = isnextchar(s,currentfont,currentdynamic,currentscale,currentxscale,currentyscale)
if char then
- local lg = lookupmatch[char]
+ local lg = not tonumber(lookupmatch) and lookupmatch[char]
if lg then
if sstop then
d = 1
@@ -3648,7 +3749,7 @@ local function t_run_multiple(start,stop,steps,nofsteps)
break
end
end
- if l and l.ligature then
+ if l and (tonumber(l) or l.ligature) then
lastd = d
end
end
@@ -3759,7 +3860,14 @@ do
-- about 15% on arabtype .. then moving the a test also saves a bit (even when
-- often a is not set at all so that one is a bit debatable
- local otfdataset = nil -- todo: make an installer
+ -- local otfdataset = nil
+ local otfdataset
+
+ otfdataset = function(...)
+ -- delayed alias
+ otfdataset = otf.dataset
+ return otfdataset(...)
+ end
local getfastdisc = { __index = function(t,k)
local v = usesfont(k,currentfont)
@@ -3783,9 +3891,9 @@ do
if nesting == 1 then
currentfont = font
currentdynamic = dynamic
- currentscale = false
- currentxscale = false
- currentyscale = false
+ currentscale = 1000
+ currentxscale = 1000
+ currentyscale = 1000
tfmdata = fontdata[font]
descriptions = tfmdata.descriptions -- only needed in gref so we could pass node there instead
characters = tfmdata.characters -- but this branch is not entered that often anyway
@@ -3796,11 +3904,11 @@ do
factor = getthreshold(font)
checkmarks = tfmdata.properties.checkmarks
- if not otfdataset then
- otfdataset = otf.dataset
- end
+ -- if not otfdataset then
+ -- otfdataset = otf.dataset
+ -- end
- discs = fastdisc and n and n > 1 and setmetatable({},getfastdisc) -- maybe inline
+ discs = fastdisc and n and n > 1 and setmetatable({},getfastdisc)
spaces = setmetatable({},getfastspace)
elseif currentfont ~= font then
@@ -3817,7 +3925,7 @@ do
local initialrl = 0
- if getid(head) == par_code and start_of_par(head) then
+ if getid(head) == par_code and startofpar(head) then
initialrl = pardirstate(head)
elseif direction == righttoleft_code then
initialrl = -1
@@ -3834,7 +3942,7 @@ do
-- We don't goto the next node when a disc node is created so that we can then treat
-- the pre, post and replace. It's a bit of a hack but works out ok for most cases.
- for s=1,#datasets do
+ for s=1,#datasets do -- todo: datasets.n
local dataset = datasets[s]
local state = dataset[2]
local sequence = dataset[3] -- sequences[s] -- also dataset[5]
@@ -3847,12 +3955,11 @@ do
local steps = sequence.steps
local nofsteps = sequence.nofsteps
local skiphash = sequence.skiphash
-
if not steps then
-- This permits injection, watch the different arguments. Watch out, the arguments passed
-- are not frozen as we might extend or change this. Is this used at all apart from some
-- experiments?
- local h, ok = handler(head,dataset,sequence,initialrl,font,dynamic) -- less arguments now
+ local h = handler(head,dataset,sequence,initialrl,font,dynamic) -- less arguments now
if h and h ~= head then
head = h
end
@@ -3862,7 +3969,7 @@ do
-- the before and after lists in the loader. But first I need to see a font that uses multiple
-- matches.
--
- local start = find_node_tail(head)
+ local start = findnodetail(head)
local rlmode = 0 -- how important is this .. do we need to check for dir?
local merged = steps.merged
while start do
@@ -3925,28 +4032,24 @@ do
start = nxt
elseif id == disc_code then
if not discs or discs[start] == true then
- local ok
if gpossing then
- start, ok = kernrun(start,k_run_single, lookupcache,step,dataset,sequence,rlmode,skiphash,handler)
+ start = kernrun(start,k_run_single, lookupcache,step,dataset,sequence,rlmode,skiphash,handler)
elseif forcetestrun then
- start, ok = testrun(start,t_run_single,c_run_single,lookupcache,step,dataset,sequence,rlmode,skiphash,handler)
+ start = testrun(start,t_run_single,c_run_single,lookupcache,step,dataset,sequence,rlmode,skiphash,handler)
else
- start, ok = comprun(start,c_run_single, lookupcache,step,dataset,sequence,rlmode,skiphash,handler)
+ start = comprun(start,c_run_single, lookupcache,step,dataset,sequence,rlmode,skiphash,handler)
end
- -- if ok then
- -- done = true
- -- end
else
start = nxt
end
elseif id == math_code then
- start = getnext(end_of_math(start))
+ start = getnext(endofmath(start))
elseif id == dir_code then
topstack, rlmode = txtdirstate(start,dirstack,topstack,rlparmode)
start = nxt
- -- elseif id == par_code and start_of_par(start) then
+ -- elseif id == par_code and startofpar(start) then
-- rlparmode, rlmode = pardirstate(start)
- -- start = nxt
+ -- start = nxt
else
start = nxt
end
@@ -3995,23 +4098,22 @@ do
start = nxt
elseif id == disc_code then
if not discs or discs[start] == true then
- local ok
if gpossing then
- start, ok = kernrun(start,k_run_multiple, steps,nofsteps,dataset,sequence,rlmode,skiphash,handler)
+ start = kernrun(start,k_run_multiple, steps,nofsteps,dataset,sequence,rlmode,skiphash,handler)
elseif forcetestrun then
- start, ok = testrun(start,t_run_multiple,c_run_multiple,steps,nofsteps,dataset,sequence,rlmode,skiphash,handler)
+ start = testrun(start,t_run_multiple,c_run_multiple,steps,nofsteps,dataset,sequence,rlmode,skiphash,handler)
else
- start, ok = comprun(start,c_run_multiple, steps,nofsteps,dataset,sequence,rlmode,skiphash,handler)
+ start = comprun(start,c_run_multiple, steps,nofsteps,dataset,sequence,rlmode,skiphash,handler)
end
else
start = nxt
end
elseif id == math_code then
- start = getnext(end_of_math(start))
+ start = getnext(endofmath(start))
elseif id == dir_code then
topstack, rlmode = txtdirstate(start,dirstack,topstack,rlparmode)
start = nxt
- -- elseif id == par_code and start_of_par(start) then
+ -- elseif id == par_code and startofpar(start) then
-- rlparmode, rlmode = pardirstate(start)
-- start = nxt
else
@@ -4039,9 +4141,9 @@ do
currentfont = font
currentdynamic = false
- currentscale = false
- currentxscale = false
- currentyscale = false
+ currentscale = 1000
+ currentxscale = 1000
+ currentyscale = 1000
tfmdata = fontdata[font]
descriptions = tfmdata.descriptions -- only needed in gref so we could pass node there instead
characters = tfmdata.characters -- but this branch is not entered that often anyway
@@ -4123,13 +4225,13 @@ do
-- a different font|state or glue (happens often)
start = nxt
elseif id == math_code then
- start = getnext(end_of_math(start))
+ start = getnext(endofmath(start))
elseif id == dir_code then
topstack, rlmode = txtdirstate(start,dirstack,topstack,rlparmode)
start = nxt
- -- elseif id == par_code and start_of_par(start) then
+ -- elseif id == par_code and startofpar(start) then
-- rlparmode, rlmode = pardirstate(start)
- -- start = nxt
+ -- start = nxt
else
start = nxt
end
@@ -4144,49 +4246,60 @@ end
-- so far
-local plugins = { }
-otf.plugins = plugins
+do
-local report = logs.reporter("fonts")
+ local plugins = { }
+ otf.plugins = plugins
-function otf.registerplugin(name,f)
- if type(name) == "string" and type(f) == "function" then
- plugins[name] = { name, f }
- report()
- report("plugin %a has been loaded, please be aware of possible side effects",name)
- report()
- if logs.pushtarget then
- logs.pushtarget("log")
- end
- report("Plugins are not officially supported unless stated otherwise. This is because")
- report("they bypass the regular font handling and therefore some features in ConTeXt")
- report("(especially those related to fonts) might not work as expected or might not work")
- report("at all. Some plugins are for testing and development only and might change")
- report("whenever we feel the need for it.")
- report()
- if logs.poptarget then
- logs.poptarget()
+ local report = logs.reporter("fonts")
+ local warned = false
+ local okay = { text = true }
+
+ function otf.registerplugin(name,f)
+ if type(name) == "string" and type(f) == "function" then
+ plugins[name] = { name, f }
+ if okay[name] then
+ -- no warning (e.g. the diagnostic text plugin)
+ else
+ report("plugin %a has been loaded, please be aware of possible side effects",name)
+ if not warned then
+ if logs.pushtarget then
+ logs.pushtarget("log")
+ end
+ report("Plugins are not officially supported unless stated otherwise. This is because")
+ report("they bypass the regular font handling and therefore some features in ConTeXt")
+ report("(especially those related to fonts) might not work as expected or might not work")
+ report("at all. Some plugins are for testing and development only and might change")
+ report("whenever we feel the need for it.")
+ report()
+ if logs.poptarget then
+ logs.poptarget()
+ end
+ warned = true
+ end
+ end
end
end
-end
-function otf.plugininitializer(tfmdata,value)
- if type(value) == "string" then
- tfmdata.shared.plugin = plugins[value]
+ function otf.plugininitializer(tfmdata,value)
+ if type(value) == "string" then
+ tfmdata.shared.plugin = plugins[value]
+ end
end
-end
-function otf.pluginprocessor(head,font,dynamic,direction) -- n
- local s = fontdata[font].shared
- local p = s and s.plugin
- if p then
- if trace_plugins then
- report_process("applying plugin %a",p[1])
+ function otf.pluginprocessor(head,font,dynamic,direction) -- n
+ local s = fontdata[font].shared
+ local p = s and s.plugin
+ if p then
+ if trace_plugins then
+ report_process("applying plugin %a",p[1])
+ end
+ return p[2](head,font,dynamic,direction)
+ else
+ return head, false
end
- return p[2](head,font,dynamic,direction)
- else
- return head, false
end
+
end
function otf.featuresinitializer(tfmdata,value)
@@ -4208,8 +4321,8 @@ registerotffeature {
}
}
--- Moved here (up) a bit. This doesn't really belong in generic so it will
--- move to a context module some day.
+-- Moved here (up) a bit. This doesn't really belong in generic so it will move to a
+-- context module some day.
local function markinitializer(tfmdata,value)
local properties = tfmdata.properties
@@ -4231,245 +4344,9 @@ registerotffeature {
-- we use a different call:
--
-- function(head,dataset,sequence,initialrl,font,dynamic)
--- return head, done
+-- return head
-- end
--
-- Also see (!!).
otf.handlers = handlers
-
-if context then
- return
-else
- -- todo: move the following code someplace else
-end
-
-local setspacekerns = nodes.injections.setspacekerns if not setspacekerns then os.exit() end
-
-local tag = "kern"
-
--- if fontfeatures then
-
--- function handlers.trigger_space_kerns(head,dataset,sequence,initialrl,font,dynamic)
--- local features = fontfeatures[font]
--- local enabled = features and features.spacekern and features[tag]
--- if enabled then
--- setspacekerns(font,sequence)
--- end
--- return head, enabled
--- end
-
--- else -- generic (no hashes)
-
- function handlers.trigger_space_kerns(head,dataset,sequence,initialrl,font,dynamic)
- local shared = fontdata[font].shared
- local features = shared and shared.features
- local enabled = features and features.spacekern and features[tag]
- if enabled then
- setspacekerns(font,sequence)
- end
- return head, enabled
- end
-
--- end
-
--- There are fonts out there that change the space but we don't do that kind of
--- things in TeX.
-
-local function hasspacekerns(data)
- local resources = data.resources
- local sequences = resources.sequences
- local validgpos = resources.features.gpos
- if validgpos and sequences then
- for i=1,#sequences do
- local sequence = sequences[i]
- local steps = sequence.steps
- if steps and sequence.features[tag] then
- local kind = sequence.type
- if kind == "gpos_pair" or kind == "gpos_single" then
- for i=1,#steps do
- local step = steps[i]
- local coverage = step.coverage
- local rules = step.rules
- if rules then
- -- not now: analyze (simple) rules
- elseif not coverage then
- -- nothing to do
- elseif kind == "gpos_single" then
- -- maybe a message that we ignore
- elseif kind == "gpos_pair" then
- local format = step.format
- if format == "move" or format == "kern" then
- local kerns = coverage[32]
- if kerns then
- return true
- end
- for k, v in next, coverage do
- if v[32] then
- return true
- end
- end
- elseif format == "pair" then
- local kerns = coverage[32]
- if kerns then
- for k, v in next, kerns do
- local one = v[1]
- if one and one ~= true then
- return true
- end
- end
- end
- for k, v in next, coverage do
- local kern = v[32]
- if kern then
- local one = kern[1]
- if one and one ~= true then
- return true
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- return false
-end
-
-otf.readers.registerextender {
- name = "spacekerns",
- action = function(data)
- data.properties.hasspacekerns = hasspacekerns(data)
- end
-}
-
-local function spaceinitializer(tfmdata,value) -- dynamic
- local resources = tfmdata.resources
- local spacekerns = resources and resources.spacekerns
- if value and spacekerns == nil then
- local rawdata = tfmdata.shared and tfmdata.shared.rawdata
- local properties = rawdata.properties
- if properties and properties.hasspacekerns then
- local sequences = resources.sequences
- local validgpos = resources.features.gpos
- if validgpos and sequences then
- local left = { }
- local right = { }
- local last = 0
- local feat = nil
- for i=1,#sequences do
- local sequence = sequences[i]
- local steps = sequence.steps
- if steps then
- -- we don't support space kerns in other features
- local kern = sequence.features[tag]
- if kern then
- local kind = sequence.type
- if kind == "gpos_pair" or kind == "gpos_single" then
- if feat then
- for script, languages in next, kern do
- local f = feat[script]
- if f then
- for l in next, languages do
- f[l] = true
- end
- else
- feat[script] = languages
- end
- end
- else
- feat = kern
- end
- for i=1,#steps do
- local step = steps[i]
- local coverage = step.coverage
- local rules = step.rules
- if rules then
- -- not now: analyze (simple) rules
- elseif not coverage then
- -- nothing to do
- elseif kind == "gpos_single" then
- -- makes no sense in TeX
- elseif kind == "gpos_pair" then
- local format = step.format
- if format == "move" or format == "kern" then
- local kerns = coverage[32]
- if kerns then
- for k, v in next, kerns do
- right[k] = v
- end
- end
- for k, v in next, coverage do
- local kern = v[32]
- if kern then
- left[k] = kern
- end
- end
- elseif format == "pair" then
- local kerns = coverage[32]
- if kerns then
- for k, v in next, kerns do
- local one = v[1]
- if one and one ~= true then
- right[k] = one[3]
- end
- end
- end
- for k, v in next, coverage do
- local kern = v[32]
- if kern then
- local one = kern[1]
- if one and one ~= true then
- left[k] = one[3]
- end
- end
- end
- end
- end
- end
- last = i
- end
- else
- -- no steps ... needed for old one ... we could use the basekerns
- -- instead
- end
- end
- end
- left = next(left) and left or false
- right = next(right) and right or false
- if left or right then
- spacekerns = {
- left = left,
- right = right,
- }
- if last > 0 then
- local triggersequence = {
- -- no steps, see (!!)
- features = { [tag] = feat or { dflt = { dflt = true, } } },
- flags = noflags,
- name = "trigger_space_kerns",
- order = { tag },
- type = "trigger_space_kerns",
- left = left,
- right = right,
- }
- insert(sequences,last,triggersequence)
- end
- end
- end
- end
- resources.spacekerns = spacekerns
- end
- return spacekerns
-end
-
-registerotffeature {
- name = "spacekern",
- description = "space kern injection",
- default = true,
- initializers = {
- node = spaceinitializer,
- },
-}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-phb-imp-binary.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-phb-imp-binary.lmt
new file mode 100644
index 00000000000..39a6057ea90
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-phb-imp-binary.lmt
@@ -0,0 +1,114 @@
+if not modules then modules = { } end modules ['font-phb-imp-binary'] = {
+ version = 1.000, -- 2016.10.10,
+ comment = "companion to font-txt.mkiv",
+ author = "Hans Hagen",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files",
+}
+
+-- The hb library comes in versions and the one I tested in 2016 was part of the inkscape
+-- suite. In principle one can have incompatibilities due to updates but that is the nature
+-- of a library. When a library ie expected one has better use the system version, if only
+-- to make sure that different programs behave the same.
+--
+-- The main reason for testing this approach was that when Idris was working on his fonts,
+-- we wanted to know how different shapers deal with it and the hb command line program
+-- could provide uniscribe output. For the context shaper uniscribe is the reference, also
+-- because Idris started out with Volt a decade ago.
+--
+-- This file uses the indirect approach by calling the executable. This file uses context
+-- features and is not generic.
+
+local next, tonumber, pcall = next, tonumber, pcall
+
+local concat = table.concat
+local reverse = table.reverse
+local formatters = string.formatters
+local removefile = os.remove
+local resultof = os.resultof
+local savedata = io.savedata
+
+local report = utilities.hb.report or print
+local packtoutf8 = utilities.hb.helpers.packtoutf8
+
+-- output : [index=cluster@x_offset,y_offset+x_advance,y_advance|...]
+-- result : { index, cluster, x_offset, y_offset, x_advance, y_advance }
+
+local P, Ct, Cc = lpeg.P, lpeg.Ct, lpeg.Cc
+local lpegmatch = lpeg.match
+
+local zero = Cc(0)
+local number = lpeg.patterns.integer / tonumber + zero
+local index = lpeg.patterns.cardinal / tonumber
+local cluster = index
+local offset = (P("@") * number * (P(",") * number + zero)) + zero * zero
+local advance = (P("+") * number * (P(",") * number + zero)) + zero * zero
+local glyph = Ct(index * P("=") * cluster * offset * advance)
+local pattern = Ct(P("[") * (glyph * P("|")^-1)^0 * P("]"))
+
+local shapers = {
+ native = "ot,uniscribe,fallback",
+ uniscribe = "uniscribe,ot,fallback",
+ fallback = "fallback"
+}
+
+local runner = sandbox.registerrunner {
+ method = "resultof",
+ name = "harfbuzz",
+ -- program = {
+ -- windows = "hb-shape.exe",
+ -- unix = "hb-shape"
+ -- },
+ program = "hb-shape",
+ checkers = {
+ shaper = "string",
+ features = "string",
+ script = "string",
+ language = "string",
+ direction = "string",
+ textfile = "writable",
+ fontfile = "readable",
+ },
+ template = string.longtostring [[
+ --shaper=%shaper%
+ --output-format=text
+ --no-glyph-names
+ --features="%features%"
+ --script=%script%
+ --language=%language%
+ --direction=%direction%
+ --text-file=%textfile%
+ --font-file=%fontfile%
+ ]],
+}
+
+local tempfile = "font-phb.tmp"
+local reported = false
+
+function utilities.hb.methods.binary(font,data,rlmode,text,leading,trailing)
+ if runner then
+ savedata(tempfile,packtoutf8(text,leading,trailing))
+ local result = runner {
+ shaper = shapers[data.shaper] or shapers.native,
+ features = data.features,
+ script = data.script or "dflt",
+ language = data.language or "dflt",
+ direction = rlmode < 0 and "rtl" or "ltr",
+ textfile = tempfile,
+ fontfile = data.filename,
+ }
+ removefile(tempfile)
+ if result then
+ -- return jsontolua(result)
+ result = lpegmatch(pattern,result) -- { index cluster xo yo xa ya }
+ if rlmode < 0 then
+ return reverse(result) -- we can avoid this
+ else
+ return result
+ end
+ end
+ elseif reported then
+ report("no runner available")
+ reported = true
+ end
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-phb-imp-internal.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-phb-imp-internal.lmt
new file mode 100644
index 00000000000..fb2251abe40
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-phb-imp-internal.lmt
@@ -0,0 +1,160 @@
+if not modules then modules = { } end modules ['font-phb-imp-internal'] = {
+ version = 1.000, -- 2016.10.10,
+ comment = "companion to font-txt.mkiv",
+ original = "derived from font-phb-imp-library",
+ author = "Hans Hagen",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files",
+}
+
+-- The hb library comes in versions and the one I tested in 2016 was part of the inkscape
+-- suite. In principle one can have incompatibilities due to updates but that is the nature
+-- of a library. When a library ie expected one has better use the system version, if only
+-- to make sure that different programs behave the same.
+--
+-- The main reason for testing this approach was that when Idris was working on his fonts,
+-- we wanted to know how different shapers deal with it and the hb command line program
+-- could provide uniscribe output. For the context shaper uniscribe is the reference, also
+-- because Idris started out with Volt a decade ago.
+--
+-- We treat the lib as a black box as it should be. At some point Kai Eigner made an ffi
+-- binding and that one was adapted to the plugin approach of context. It saved me the
+-- trouble of looking at source files to figure it all out. Below is the adapted code.
+--
+-- This is basically the ffi variant but with the hb function calls delegated to a simple
+-- runtime library. That library was a side effect of playing a day with delayed loading
+-- like ffi does in luametatex, which seems to work ok for what we call optional libraries
+-- in lmtx. I didn't really test the next code well (and will probably do that when Idris
+-- needs some comparison with uniscribe etc). There are nowadays probably other ways to do
+-- this but this is what we had and so we can keep the test code that has been around for
+-- a while (which is needed because some old articles need it.)
+--
+-- The following setup doesn't really fit into the way we set up internal libraries
+-- but if isn't used in the same sense anyway so we stick to what we already had in
+-- the ffi variant (also because it uses helpers here and we want to keep the client
+-- variant too). We don't need to be generic as other macro packages follow a different
+-- route.
+--
+-- Last time I checked "fiets" got no ligature with the "ot" shaper but it did get one
+-- with the "uniscribe" shaper ... somewhat puzzling .. but "effe" worked okay. Maybe
+-- there is some built-in heuristic interfering? When Idris an I tested fonts we had
+-- similar differences with arabic so maybe we miss a point here.
+--
+-- native font plugin > hb > string : fi-
+-- font plugin > hb > text : U+00066 U+00069 U+0002D
+-- font plugin > hb > result : U+00066 U+00069 U+0002D
+--
+-- uniscribe font plugin > hb > string : fi-
+-- font plugin > hb > text : U+00066 U+00069 U+0002D
+-- font plugin > hb > result : U+0FB01 U+0002D
+--
+-- native font plugin > hb > string : ets
+-- font plugin > hb > text : U+00065 U+00074 U+00073
+-- font plugin > hb > result : U+00065 U+00074 U+00073
+--
+-- uniscribe font plugin > hb > string : ets
+-- font plugin > hb > text : U+00065 U+00074 U+00073
+-- font plugin > hb > result : U+00065 U+00074 U+00073
+--
+-- native font plugin > hb > string : fiets
+-- font plugin > hb > text : U+00066 U+00069 U+00065 U+00074 U+00073
+-- font plugin > hb > result : U+00066 U+00069 U+00065 U+00074 U+00073
+--
+-- uniscribe font plugin > hb > string : fiets
+-- font plugin > hb > text : U+00066 U+00069 U+00065 U+00074 U+00073
+-- font plugin > hb > result : U+0FB01 U+00065 U+00074 U+00073
+
+local report = utilities.hb.report or print
+
+local hblib = optional and (optional.hb or optional.test)
+
+if not hblib then
+ report("no hblib found, you can try the ffi variant")
+ return
+end
+
+local hb_initialize = hblib.initialize
+local hb_getversion = hblib.getversion
+local hb_getshapers = hblib.getshapers
+local hb_loadfont = hblib.loadfont
+local hb_shapestring = hblib.shapestring
+
+if not hb_initialize then
+ report("no functions in hblib found, you can try the ffi variant")
+ return
+end
+
+local loaddata = io.loaddata
+local findlib = resolvers.findlib
+local concat = table.concat
+local utfchar = utf.char
+local packtoutf8 = utilities.hb.helpers.packtoutf8
+local packtoutf32 = utilities.hb.helpers.packtoutf32
+local report = utilities.hb.report or print
+local fontdata = fonts.hashes.identifiers
+local initialized = nil
+local loaded = { }
+local shared = { }
+local libname = os.name == "windows" and "libharfbuzz-0" or "libharfbuzz"
+
+local shapers = {
+ native = { "ot", "uniscribe", "fallback" },
+ uniscribe = { "uniscribe", "ot", "fallback" },
+ -- uniscribe = { "uniscribe", "fallback" }, -- stalls without fallback when no uniscribe present
+ fallback = { "fallback" },
+}
+
+local mode = 32
+
+function utilities.hb.methods.internal(font,data,rlmode,text,leading,trailing)
+ if initialized == nil then
+ local filename = findlib(libname)
+ initialized = hb_initialize(filename)
+ if initialized then
+ report("using hb library version %a, supported shapers: %,t",hb_getversion(),hb_getshapers())
+ else
+ report("unable to locate hb library")
+ initialize = false
+ end
+ end
+ if initialized then
+ local instance = loaded[font]
+ if instance == nil then
+ local tfmdata = fontdata[font]
+ local resources = tfmdata.resources
+ local filename = resources.filename
+ instance = shared[filename]
+ if instance == nil then
+ local wholefont = loaddata(filename)
+ if wholefont then
+ instance = hb_loadfont(font,wholefont)
+ end
+ if not instance then
+ instance = false
+ end
+ shared[filename] = instance
+ end
+ loaded[font] = instance
+ end
+ if instance then
+ if mode ==32 then
+ text = packtoutf32(text,leading,trailing)
+ else
+ text = packtoutf8(text,leading,trailing) -- doesn't work ok (no time not to figure it out)
+ end
+ local result = hb_shapestring (
+ instance,
+ data.script or "dflt",
+ data.language or "dflt",
+ rlmode < 0 and "rtl" or "ltr",
+ shapers[data.shaper] or shapers.native,
+ data.featureset or { },
+ text,
+ rlmode < 0,
+ mode
+ )
+ -- inspect(result)
+ return result
+ end
+ end
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-phb.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-phb.lmt
new file mode 100644
index 00000000000..67b068885b9
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-phb.lmt
@@ -0,0 +1,560 @@
+if not modules then modules = { } end modules ['font-phb'] = {
+ version = 1.000, -- 2016.10.10,
+ comment = "companion to font-txt.mkiv",
+ original = "derived from a prototype by Kai Eigner",
+ author = "Hans Hagen", -- so don't blame KE
+ copyright = "TAT Zetwerk / PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files",
+}
+
+-- Some (historic) explanation can be found in the font-phb.lua file. To summarize:
+-- this code kind of old and originates from the times that Idris was making a font
+-- that should work with context and uniscribe. When we started with mkiv there were
+-- no libraries, but at some point Kai Eigner made an ffi interface to the harfbuzz
+-- library that showed up. His code was adapted to ConTeXt so that we could test
+-- Idris fonts (the library could use uniscribe which served as refeence for his
+-- fonts). Some experiences were was wrapped up in articles. Interesting was that
+-- sometimes context, uniscribe and/or native hb could not agree on how to interpret
+-- font features and subtle differences could occur.
+--
+-- This file is made from font-phb.lua and I stripped the components code because
+-- it made no sense. The files were eventually added because I did some cleanup and
+-- didn't want to carry old stuff around without also sort of maintaining it. I can
+-- probably strip away even more code. I might pick up this thread when Idris picks
+-- up his font making.
+--
+-- Todo: use the new (context) advance and offset features.
+
+local next, tonumber, pcall, rawget = next, tonumber, pcall, rawget
+
+local concat = table.concat
+local sortedhash = table.sortedhash
+local formatters = string.formatters
+
+local fonts = fonts
+local otf = fonts.handlers.otf
+local texthandler = otf.texthandler
+
+local fontdata = fonts.hashes.identifiers
+
+local nuts = nodes.nuts
+local tonode = nuts.tonode
+local tonut = nuts.tonut
+
+local remove_node = nuts.remove
+
+local getboth = nuts.getboth
+local getnext = nuts.getnext
+local setnext = nuts.setnext
+local getprev = nuts.getprev
+local setprev = nuts.setprev
+local getid = nuts.getid
+local getchar = nuts.getchar
+local setchar = nuts.setchar
+local setlink = nuts.setlink
+local setoffsets = nuts.setoffsets
+local getwidth = nuts.getwidth
+local setwidth = nuts.setwidth
+
+local copy_node = nuts.copy
+local find_tail = nuts.tail
+
+local nodepool = nuts.pool
+local new_kern = nodepool.fontkern
+local new_glyph = nodepool.glyph
+
+local nodecodes = nodes.nodecodes
+local glyph_code = nodecodes.glyph
+local glue_code = nodecodes.glue
+
+local skipped = {
+ -- we assume that only valid features are set but maybe we need a list
+ -- of valid hb features as there can be many context specific ones
+ mode = true,
+ features = true,
+ language = true,
+ script = true,
+}
+
+local seenspaces = {
+ [0x0020] = true,
+ [0x00A0] = true,
+ [0x0009] = true, -- indeed
+ [0x000A] = true, -- indeed
+ [0x000D] = true, -- indeed
+}
+
+-- helpers
+
+local helpers = { }
+local methods = { }
+local initialized = { } -- we don't polute the shared table
+
+local method = "internal" -- a bit misleading name: it's the optional module
+local shaper = "native" -- "uniscribe"
+local report = logs.reporter("font plugin","hb")
+
+utilities.hb = {
+ methods = methods,
+ helpers = helpers,
+ report = report,
+}
+
+do
+
+ local toutf8 = string.toutf8
+ local toutf32 = string.toutf32
+
+ function helpers.packtoutf8(text,leading,trailing)
+ if leading then
+ text[0] = 32
+ end
+ if trailing then
+ text[#text+1] = 32
+ end
+ return toutf8(text)
+ end
+
+ function helpers.packtoutf32(text,leading,trailing)
+ if leading then
+ text[0] = 32
+ end
+ if trailing then
+ text[#text+1] = 32
+ end
+ return toutf32(text)
+ end
+
+end
+
+local function initialize(font)
+
+ local tfmdata = fontdata[font]
+ local resources = tfmdata.resources
+ local shared = tfmdata.shared
+ local filename = resources.filename
+ local features = shared.features
+ local descriptions = shared.rawdata.descriptions
+ local characters = tfmdata.characters
+ local featureset = { }
+ local copytochar = shared.copytochar -- indextounicode
+ local spacewidth = nil -- unscaled
+ local factor = tfmdata.parameters.factor
+ local marks = resources.marks or { }
+
+ -- could be shared but why care about a few extra tables
+
+ if not copytochar then
+ copytochar = { }
+ -- let's make sure that we have an indexed table and not a hash
+ local max = 0
+ for k, v in next, descriptions do
+ if v.index > max then
+ max = v.index
+ end
+ end
+ for i=0,max do
+ copytochar[i] = i
+ end
+ -- the normal mapper
+ for k, v in next, descriptions do
+ copytochar[v.index] = k
+ end
+ shared.copytochar = copytochar
+ end
+
+ -- independent from loop as we have unordered hashes
+
+ if descriptions[0x0020] then
+ spacewidth = descriptions[0x0020].width
+ elseif descriptions[0x00A0] then
+ spacewidth = descriptions[0x00A0].width
+ end
+
+ for k, v in sortedhash(features) do
+ if #k > 4 then
+ -- unknown ones are ignored anyway but we can assume that the current
+ -- (and future) extra context features use more verbose names
+ elseif skipped[k] then
+ -- we don't want to pass language and such so we block a few features
+ -- explicitly
+ elseif v == "yes" or v == true then
+ featureset[#featureset+1] = k .. "=1" -- cf command line (false)
+ elseif v == "no" or v == false then
+ featureset[#featureset+1] = k .. "=0" -- cf command line (true)
+ elseif type(v) == "number" then
+ featureset[#featureset+1] = k .. "=" .. v -- cf command line (alternate)
+ else
+ -- unset
+ end
+ end
+
+ local data = {
+ language = features.language, -- do we need to uppercase and padd to 4 ?
+ script = features.script, -- do we need to uppercase and padd to 4 ?
+ features = #featureset > 0 and concat(featureset,",") or "", -- hash
+ featureset = #featureset > 0 and featureset or nil,
+ copytochar = copytochar,
+ spacewidth = spacewidth,
+ filename = filename,
+ marks = marks,
+ factor = factor,
+ characters = characters, -- the loaded font (we use its metrics which is more accurate)
+ method = features.method or method,
+ shaper = features.shaper or shaper,
+ }
+ initialized[font] = data
+ return data
+end
+
+-- In many cases this gives compatible output but especially with respect to spacing and user
+-- discretionaries that mix fonts there can be different outcomes. We also have no possibility
+-- to tweak and cheat. Of course one can always run a normal node mode pass with specific
+-- features first but then one can as well do all in node mode. So .. after a bit of playing
+-- around I redid this one from scratch and also added tracing.
+
+local trace_colors = false trackers.register("fonts.plugins.hb.colors", function(v) trace_colors = v end)
+local trace_details = false trackers.register("fonts.plugins.hb.details",function(v) trace_details = v end)
+local check_id = false
+
+local setcolor = nodes.tracers.colors.set
+local resetcolor = nodes.tracers.colors.reset
+
+table.setmetatableindex(methods,function(t,k)
+ local l = "font-phb-imp-" .. k .. ".lmt"
+ report("start loading method %a from %a",k,l)
+ dofile(resolvers.findfile(l))
+ local v = rawget(t,k)
+ if v then
+ report("loading method %a succeeded",k)
+ else
+ report("loading method %a failed",k)
+ v = function() return { } end
+ end
+ t[k] = v
+ return v
+end)
+
+local inandout do
+
+ local utfbyte = utf.byte
+ local utfchar = utf.char
+ local utf3208 = utf.utf32_to_utf8_le
+
+ inandout = function(text,result,first,last,copytochar)
+ local s = { }
+ local t = { }
+ local r = { }
+ local f = formatters["%05U"]
+ for i=1,#text do
+ local c = text[i]
+ -- t[#t+1] = f(utfbyte(utf3208(c)))
+ s[#s+1] = utfchar(c)
+ t[#t+1] = f(c)
+ end
+ for i=first,last do
+ r[#r+1] = f(copytochar[result[i][1]])
+ end
+ return s, t, r
+ end
+
+end
+
+local function harfbuzz(head,font,dynamic,rlmode,start,stop,text,leading,trailing)
+ local data = initialized[font]
+
+ if not data then
+ data = initialize(font)
+ end
+
+ if check_id then
+ if getid(start) ~= glyph_code then
+ report("error: start is not a glyph")
+ return head
+ elseif getid(stop) ~= glyph_code then
+ report("error: stop is not a glyph")
+ return head
+ end
+ end
+ local size = #text -- original text, without spaces
+ local result = methods[data.method](font,data,rlmode,text,leading,trailing)
+ local length = result and #result or 0
+
+ if length == 0 then
+ -- report("warning: no result")
+ return head
+ end
+
+ local factor = data.factor
+ local marks = data.marks
+ local spacewidth = data.spacewidth
+ local copytochar = data.copytochar
+ local characters = data.characters
+
+ -- the text analyzer is only partially clever so we must assume that we get
+ -- inconsistent lists
+
+ -- we could check if something has been done (replacement or kern or so) but
+ -- then we pass around more information and need to check a lot and spaces
+ -- are kind of spoiling that game (we need a different table then) .. more
+ -- pain than gain
+
+ -- we could play with 0xFFFE as boundary
+
+ local current = start
+ local prev = nil
+ local glyph = nil
+
+ local first = 1
+ local last = length
+ local next = nil -- todo: keep track of them
+ local prev = nil -- todo: keep track of them
+
+ if leading then
+ first = first + 1
+ end
+ if trailing then
+ last = last - 1
+ end
+
+ local position = first
+ local cluster = 0
+ local glyph = nil
+ local index = 0
+ local count = 1
+ local saved = nil
+
+ if trace_details then
+ report("start run, original size: %i, result index: %i upto %i",size,first,last)
+ local s, t, r = inandout(text,result,first,last,copytochar)
+ report("method : %s",data.method)
+ report("shaper : %s",data.shaper)
+ report("string : %t",s)
+ report("text : % t",t)
+ report("result : % t",r)
+ end
+
+ -- okay, after some experiments, it became clear that more complex code aimed at
+ -- optimization doesn't pay off as complexity also demands more testing
+
+ for i=first,last do
+ local r = result[i]
+ local unicode = copytochar[r[1]] -- can be private of course
+ --
+ cluster = r[2] + 1 -- starts at zero
+ --
+ if position == cluster then
+ if i == first then
+ index = 1
+ if trace_details then
+ report("[%i] position: %i, cluster: %i, index: %i, starting",i,position,cluster,index)
+ end
+ else
+ index = index + 1
+ if trace_details then
+ report("[%i] position: %i, cluster: %i, index: %i, next step",i,position,cluster,index)
+ end
+ end
+ elseif position < cluster then
+ -- a new cluster
+ current = getnext(current)
+ position = position + 1
+ size = size - 1
+ for p=position,cluster-1 do
+ head, current = remove_node(head,current,true)
+ if trace_details then
+ report("[%i] position: %i, cluster: %i, index: -, removing node",i,p,cluster)
+ end
+ size = size - 1
+ end
+ position = cluster
+ index = 1
+ glyph = nil
+ if trace_details then
+ report("[%i] position: %i, cluster: %i, index: %i, arriving",i,cluster,position,index)
+ end
+ else -- maybe a space got properties
+ if trace_details then
+ report("position: %i, cluster: %i, index: %i, quitting due to fatal inconsistency",position,cluster,index)
+ end
+ return head
+ end
+ local copied = false
+ if glyph then
+ if trace_details then
+ report("[%i] position: %i, cluster: %i, index: %i, copying glyph, unicode %U",i,position,cluster,index,unicode)
+ end
+ local g = copy_node(glyph)
+ if trace_colors then
+ resetcolor(g)
+ end
+ setlink(current,g,getnext(current))
+ current = g
+ copied = true
+ else
+ if trace_details then
+ report("[%i] position: %i, cluster: %i, index: %i, using glyph, unicode %U",i,position,cluster,index,unicode)
+ end
+ glyph = current
+ end
+ --
+ if not current then
+ if trace_details then
+ report("quitting due to unexpected end of node list")
+ end
+ return head
+ end
+ --
+ local id = getid(current)
+ if id ~= glyph_code then
+ if trace_details then
+ report("glyph expected in node list")
+ end
+ return head
+ end
+ --
+ -- really, we can get a tab (9), lf (10), or cr(13) back in cambria .. don't ask me why
+ --
+ local prev, next = getboth(current)
+ --
+ -- assign glyph: first in run
+ --
+ setchar(current,unicode)
+ if trace_colors then
+ count = (count == 8) and 1 or count + 1
+ setcolor(current,"trace:"..count)
+ end
+ --
+ local x_offset = r[3] -- r.dx
+ local y_offset = r[4] -- r.dy
+ local x_advance = r[5] -- r.ax
+ ----- y_advance = r[6] -- r.ay
+ local left = 0
+ local right = 0
+ local dx = 0
+ local dy = 0
+ if trace_details then
+ if x_offset ~= 0 or y_offset ~= 0 or x_advance ~= 0 then -- or y_advance ~= 0
+ report("[%i] position: %i, cluster: %i, index: %i, old, xoffset: %p, yoffset: %p, xadvance: %p, width: %p",
+ i,position,cluster,index,x_offset*factor,y_offset*factor,x_advance*factor,characters[unicode].width)
+ end
+ end
+ if y_offset ~= 0 then
+ dy = y_offset * factor
+ end
+ if rlmode >= 0 then
+ -- l2r marks and rest
+ if x_offset ~= 0 then
+ dx = x_offset * factor
+ end
+ local width = characters[unicode].width
+ local delta = x_advance * factor
+ if delta ~= width then
+ -- right = -(delta - width)
+ right = delta - width
+ end
+ elseif marks[unicode] then -- why not just the next loop
+ -- r2l marks
+ if x_offset ~= 0 then
+ dx = -x_offset * factor
+ end
+ else
+ -- r2l rest
+ local width = characters[unicode].width
+ local delta = (x_advance - x_offset) * factor
+ if delta ~= width then
+ left = delta - width
+ end
+ if x_offset ~= 0 then
+ right = x_offset * factor
+ end
+ end
+ if copied or dx ~= 0 or dy ~= 0 then
+ setoffsets(current,dx,dy)
+ end
+ if left ~= 0 then
+ setlink(prev,new_kern(left),current) -- insertbefore
+ if current == head then
+ head = prev
+ end
+ end
+ if right ~= 0 then
+ local kern = new_kern(right)
+ setlink(current,kern,next)
+ current = kern
+ end
+ if trace_details then
+ if dy ~= 0 or dx ~= 0 or left ~= 0 or right ~= 0 then
+ report("[%i] position: %i, cluster: %i, index: %i, new, xoffset: %p, yoffset: %p, left: %p, right: %p",i,position,cluster,index,dx,dy,left,right)
+ end
+ end
+ end
+ --
+ if trace_details then
+ report("[-] position: %i, cluster: %i, index: -, at end",position,cluster)
+ end
+ if size > 1 then
+ current = getnext(current)
+ for i=1,size-1 do
+ if trace_details then
+ report("[-] position: %i + %i, cluster: -, index: -, removing node",position,i)
+ end
+ head, current = remove_node(head,current,true)
+ end
+ end
+ --
+ -- We see all kind of interesting spaces come back (like tabs in cambria) so we do a bit of
+ -- extra testing here.
+ --
+ if leading then
+ local r = result[1]
+ local unicode = copytochar[r[1]]
+ if seenspaces[unicode] then
+ local x_advance = r[5]
+ local delta = x_advance - spacewidth
+ if delta ~= 0 then
+ -- nothing to do but jump one slot ahead
+ local prev = getprev(start)
+ if getid(prev) == glue_code then
+ local dx = delta * factor
+ setwidth(prev,getwidth(prev) + dx)
+ if trace_details then
+ report("compensating leading glue by %p due to codepoint %U",dx,unicode)
+ end
+ else
+ report("no valid leading glue node")
+ end
+ end
+ end
+ end
+ --
+ if trailing then
+ local r = result[length]
+ local unicode = copytochar[r[1]]
+ if seenspaces[unicode] then
+ local x_advance = r[5]
+ local delta = x_advance - spacewidth
+ if delta ~= 0 then
+ local next = getnext(stop)
+ if getid(next) == glue_code then
+ local dx = delta * factor
+ setwidth(next,getwidth(next) + dx)
+ if trace_details then
+ report("compensating trailing glue by %p due to codepoint %U",dx,unicode)
+ end
+ else
+ report("no valid trailing glue node")
+ end
+ end
+ end
+ end
+ --
+ if trace_details then
+ report("run done")
+ end
+ return head
+end
+
+otf.registerplugin("harfbuzz",function(head,font,dynamic,direction)
+ return texthandler(head,font,dynamic,direction,harfbuzz)
+end)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-pre.mkxl b/Master/texmf-dist/tex/context/base/mkxl/font-pre.mkxl
index e6e6930e1a8..701362dced2 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-pre.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-pre.mkxl
@@ -47,12 +47,21 @@
%
% dtls flac :math
+%D The missing feature:
+%D
+%D \starttyping
+%D \ruledhbox{\char"2012}\par % figuredash
+%D \ruledhbox{0}\par
+%D \stoptyping
+
\definefontfeature
[always]
[mode=node, % we had 'auto', but let's try 'node' for a while and see what the impact is
script=auto, % on speed; 'base' just doesn't play well with dynamics; some day we can even
autoscript=position,
autolanguage=position,
+ textcontrol=collapsehyphens,
+ checkmissing=yes,
kern=yes, % consider skipping the base passes when no base mode is used
mark=yes,
mkmk=yes,
@@ -61,14 +70,24 @@
\definefontfeature
[default]
[always]
- [liga=yes,
-% ccmp=yes, % maybe too
-% locl=yes, % maybe too
-% calt=yes, % maybe too
-% clig=yes, % maybe too
-% rlig=yes, % maybe too
- tlig=yes,
- trep=yes] % texligatures=yes,texquotes=yes
+ [liga=yes]
+
+ % ccmp=yes, % maybe too
+ % locl=yes, % maybe too
+ % calt=yes, % maybe too
+ % clig=yes, % maybe too
+ % rlig=yes, % maybe too
+ % tlig=yes, % no longer default (texligatures=yes)
+ % trep=yes, % no longer default (texquotes=yes)
+
+% if needed users can add this to a local cont-loc.mkxl in texmf-local:
+
+% \definefontfeature
+% [default]
+% [default]
+% [textcontrol=,
+% tlig=yes,
+% trep=yes]
\definefontfeature
[original] % a clone of default so we can revert
@@ -77,17 +96,13 @@
\definefontfeature
[smallcaps]
[always]
- [smcp=yes,
- tlig=yes,
- trep=yes] % texligatures=yes,texquotes=yes
+ [smcp=yes]
\definefontfeature
[oldstyle]
[always]
[onum=yes,
- liga=yes,
- tlig=yes,
- trep=yes] % texligatures=yes,texquotes=yes
+ liga=yes]
\definefontfeature
[inlinenumbers]
@@ -114,9 +129,7 @@
\definefontfeature % == default unless redefined
[ligatures]
[always]
- [liga=yes,
- tlig=yes,
- trep=yes]
+ [liga=yes]
\definefontfeature
[letterspacing]
@@ -131,20 +144,15 @@
[complete]
[always]
[compose=yes,
- liga=yes,
-% ccmp=yes,
-% locl=yes,
-% calt=yes,
-% clig=yes,
-% rlig=yes,
- tlig=yes,
- trep=yes]
+ liga=yes]
\definefontfeature
[none]
[mode=none,
features=no]
+% \definefontfeature[none][none][textcontrol=collapsehyphens]
+
\definefontfeature
[semitic-complete]
[mode=node,analyze=yes,language=dflt,ccmp=yes,
@@ -171,7 +179,7 @@
\definefontfeature
[syriac]
[arabic]
- [fin2=yes,fin3=yes,med2=yes]
+ [fin2=yes,fin3=yes,med2=yes] % script=syrc
\definefontfeature
[reordercombining]
@@ -193,13 +201,18 @@
[semitic-simple]
[script=hebr]
-% indic
+% indic:
+%
+% conjuncts : auto | continue | quit (default)
+% movematra : auto | leftbeforebase | default
\definefontfeature
[indic-common]
[mode=node,
language=dflt,
% localized
+ indic=auto, % we need to handle fuzzy fonts
+ % localized
locl=yes,
% positioning
kern=yes,
@@ -398,74 +411,38 @@
[mathematics]
[mode=base,
% mode=none, % better, maybe do this last
- kern=yes,
- % liga=yes, % makes no sense
- % tlig=yes, % makes no sense
- % trep=yes, % makes no sense
- mathnolimitsmode={0,800}, % this looks okay on the average font
+ kern=yes, % =force
+ % flac=yes, % handled differently
+ % liga=yes, % makes no sense
mathalternates=yes,
- mathitalics=yes, % we pass them
- mathdimensions=all,
+ % mathitalics=yes, % we pass them
+ % mathdimensions=all,
% mathkerns=yes,
% staircase=yes,
compactmath=yes,
+ flattenaccents=yes,
% mathgaps=yes,
+ mathexpansion=math,
language=dflt,
script=math]
-\definefontfeature
- [oldmath]
- [oldmath=yes]
-
\ifdefined\mathnolimitsmode
\mathnolimitsmode\plusone % font driven (only opentype)
\fi
-\mathitalicsmode\plusone % 1 : add to simple noad
-%mathitalicsmode\plusthree % 2 : add italic kerns for diagnostics
-
-% \adaptfontfeature[*math*][mathnolimitsmode=1000] % only subscript
+% \ifdefined\variablefam
+% \variablefam 63
+% \fi
\definefontfeature
- [mathematics-l2r]
- [mathematics]
- []
+ [collapseitalics]
+ [collapseitalics=yes]
-\definefontfeature
- [mathematics-r2l]
- [mathematics]
- [rtlm=yes,
- locl=yes]
+\definefontfeature[virtualmath] [mathematics]
-\definefontfeature[virtualmath] [mathematics]
-\definefontfeature[virtualmath-l2r] [mathematics-l2r]
-\definefontfeature[virtualmath-r2l] [mathematics-r2l]
-
-\definefontfeature[math-text] [mathematics] [ssty=no]
-\definefontfeature[math-script] [mathematics] [ssty=1,mathsize=yes]
-\definefontfeature[math-scriptscript] [mathematics] [ssty=2,mathsize=yes]
-
-\definefontfeature[math-text-l2r] [mathematics-l2r] [ssty=no]
-\definefontfeature[math-script-l2r] [mathematics-l2r] [ssty=1,mathsize=yes]
-\definefontfeature[math-scriptscript-l2r] [mathematics-l2r] [ssty=2,mathsize=yes]
-
-\definefontfeature[math-text-r2l] [mathematics-r2l] [ssty=no]
-\definefontfeature[math-script-r2l] [mathematics-r2l] [ssty=1,mathsize=yes]
-\definefontfeature[math-scriptscript-r2l] [mathematics-r2l] [ssty=2,mathsize=yes]
-
-% this will go away: could be a mode in the engine
-
-\definefontfeature[math-nostack-text] [math-text] [nostackmath=yes]
-\definefontfeature[math-nostack-script] [math-script] [nostackmath=yes]
-\definefontfeature[math-nostack-scriptscript][math-scriptscript][nostackmath=yes]
-
-% \definefontfeature[mathtext] [math-text]
-% \definefontfeature[mathscript] [math-script]
-% \definefontfeature[mathscriptscript] [math-scriptscript]
-
-% \definefontfeature
-% [missing]
-% [missing=yes]
+\definefontfeature[math-text] [mathematics] [ssty=no]
+\definefontfeature[math-script] [mathematics] [ssty=1]
+\definefontfeature[math-scriptscript] [mathematics] [ssty=2]
%D Nice to have too:
@@ -486,6 +463,27 @@
% [boldened]
% [extend=1.2]
+%D Tweaks:
+%D
+%D \starttyping
+%D \setupbodyfont[dejavu]
+%D
+%D \starttext
+%D \startTEXpage[align={tolerant,stretch},offset=1ex]
+%D {\addff{camelcasing} \samplefile{tufte}\par}
+%D {\addff{uppercasing} \samplefile{tufte}\par}
+%D {\addff{lowercasing} \samplefile{tufte}\par}
+%D {\addff{primes} 123'345''\par}
+%D \stopTEXpage
+%D \stoptext
+%D \stoptyping
+
+\definefontfeature[primes] [primes=yes] % text
+\definefontfeature[uppercasing][uppercasing=yes]
+\definefontfeature[lowercasing][lowercasing=yes]
+\definefontfeature[camelcasing][camelcasing=yes]
+\definefontfeature[tabledigits][tabledigits=yes,tnum=yes]
+
%D Neat:
% By eye:
@@ -863,6 +861,12 @@
\permanent\protected\def\setsuperiors{\doaddfeature{f:superiors}}
\permanent\protected\def\setfractions{\doaddfeature{f:fractions}}
+\permanent\protected\def\resetsmallcaps{\dosubtractfeature{f:smallcaps}}
+\permanent\protected\def\resetoldstyle {\dosubtractfeature{f:oldstyle}}
+\permanent\protected\def\resettabular {\dosubtractfeature{f:tabular}}
+\permanent\protected\def\resetsuperiors{\dosubtractfeature{f:superiors}}
+\permanent\protected\def\resetfractions{\dosubtractfeature{f:fractions}}
+
% \permanent\protected\def\frc#1#2%
% {\dontleavehmode
% \begingroup
@@ -899,15 +903,22 @@
\pushoverloadmode
-\let\infofont \relax
-\let\infofontbold \relax
-\let\smallinfofont \relax
-\let\smallinfofontbold\relax
+% \let\infofont \relax
+% \let\infofontbold \relax
+% \let\smallinfofont \relax
+% \let\smallinfofontbold\relax
+%
+% \definefont[infofont] [file:dejavusansmono*none at 6pt]
+% \definefont[infofontbold] [file:dejavusansmono-bold*none at 6pt]
+% \definefont[smallinfofont] [file:dejavusansmono*none at 3pt]
+% \definefont[smallinfofontbold][file:dejavusansmono-bold*none at 3pt]
+%
+% after testing for quite a while moved from cont-loc.mkxl
-\definefont[infofont] [file:dejavusansmono*none at 6pt]
-\definefont[infofontbold] [file:dejavusansmono-bold*none at 6pt]
-\definefont[smallinfofont] [file:dejavusansmono*none at 3pt]
-\definefont[smallinfofontbold][file:dejavusansmono-bold*none at 3pt]
+\protected\def\infofont {\definefrozenfont[infofont] [file:dejavusansmono*none at 6pt]\infofont}
+\protected\def\infofontbold {\definefrozenfont[infofontbold] [file:dejavusansmono-bold*none at 6pt]\infofontbold}
+\protected\def\smallinfofont {\definefrozenfont[smallinfofont] [file:dejavusansmono*none at 3pt]\smallinfofont}
+\protected\def\smallinfofontbold{\definefrozenfont[smallinfofontbold][file:dejavusansmono-bold*none at 3pt]\smallinfofontbold}
%D Optimization (later we overload in math). Also needed in order to get \type {\ss}
%D properly defined.
@@ -940,11 +951,9 @@
\startsetups experiment:fonts:compact
\settrue\c_font_compact
-
% \definefontfeature[virtualmath] [mathematics] [compactmath=yes]
% \definefontfeature[virtualmath-l2r] [mathematics-l2r][compactmath=yes]
% \definefontfeature[virtualmath-r2l] [mathematics-r2l][compactmath=yes]
-
% \definefontfeature[math-text] [mathematics] [compactmath=yes]
% \definefontfeature[math-script] [mathematics] [compactmath=yes]
% \definefontfeature[math-scriptscript] [mathematics] [compactmath=yes]
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-sel.mklx b/Master/texmf-dist/tex/context/base/mkxl/font-sel.mklx
index a25b7fab7c5..9e5c53894e1 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-sel.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-sel.mklx
@@ -269,7 +269,7 @@
\edef\currentselectfont{\expandnamespacevalue\??fontshortstyle{#style}\s!rm}%
\setupcurrentselectfont[#settings]%
\else
- \let\currentselectfont\empty
+ \lettonothing\currentselectfont
\setupcurrentselectfont[#style]%
\fi}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-set.mklx b/Master/texmf-dist/tex/context/base/mkxl/font-set.mklx
index fd6a2f1ff51..421217c8b98 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-set.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-set.mklx
@@ -34,7 +34,7 @@
% \enablemode[lmmath]
-\let\m_font_fallback_name\empty
+\lettonothing\m_font_fallback_name
% keep as reference:
%
@@ -43,10 +43,14 @@
% \clf_resetnullfont % in luatex 0.70 this will also do the previous
% \glet\font_preloads_reset_nullfont\relax}
+% \def\font_preload_check_mode
+% {\doifelsemode{lmmath}
+% {\def\m_font_fallback_name{modern-designsize-virtual}}% this will stay
+% {\def\m_font_fallback_name{modern-designsize}}% % this might become 'modern'
+% \glet\font_preload_check_mode\relax}
+
\def\font_preload_check_mode
- {\doifelsemode{lmmath}
- {\def\m_font_fallback_name{modern-designsize-virtual}}% this will stay
- {\def\m_font_fallback_name{modern-designsize}}% % this might become 'modern'
+ {\def\m_font_fallback_name{modern}%
\glet\font_preload_check_mode\relax}
\def\font_preload_default_fonts
@@ -88,7 +92,7 @@
{\glet\font_preload_default_fonts_tt\relax
\glet\font_preload_default_fonts_mm\relax
\glet\font_preloads_third_stage \relax
-% \glet\font_preloads_fourth_stage \relax
+ \glet\font_preloads_fourth_stage \relax
}
\def\font_preloads_zero_stage_indeed
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-sol.mklx b/Master/texmf-dist/tex/context/base/mkxl/font-sol.mklx
index 8f3d3d712cb..064f39b9d1d 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-sol.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-sol.mklx
@@ -107,11 +107,11 @@
}%
\relax}
-\let\currentfontsolution\empty
+\lettonothing\currentfontsolution
\permanent\protected\def\resetfontsolution % resets all
{\clf_resetfontsolution
- \let\currentfontsolution\empty}
+ \lettonothing\currentfontsolution}
\permanent\protected\def\startfontsolution % [#1]
{\pushmacro\currentfontsolution
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-sty.mklx b/Master/texmf-dist/tex/context/base/mkxl/font-sty.mklx
index 503356a4a88..49fa52d3882 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-sty.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-sty.mklx
@@ -142,8 +142,8 @@
%D These commands are not grouped! Grouping is most probably done by the calling
%D macro's and would lead to unnecessary overhead.
-\let\m_current_convert_font \empty
-\let\m_current_convert_font_dt\empty
+\lettonothing\m_current_convert_font
+\lettonothing\m_current_convert_font_dt
\permanent\protected\def\doconvertfont#specification% takes second argument / this command is obsolete
{\edef\m_current_convert_font{#specification}%
@@ -180,7 +180,7 @@
\setfalse\fontattributeisset
-\mutable\let\currentdetokenizedstyleparameter\empty
+\mutable\lettonothing\currentdetokenizedstyleparameter
\permanent\protected\def\dousestyleparameter#value%
{\edef\currentstyleparameter{#value}%
@@ -231,12 +231,12 @@
\c!method=\v!command]
\appendtoks
- \letvalue{\??stylecheck\currentstyle}\relax
+ \letcsname\??stylecheck\currentstyle\endcsname\relax
\edef\p_method{\styleparameter\c!method}%
\ifx\p_method\v!command
- \frozen\instance\setuevalue{\e!start\currentstyle}{\font_styles_apply_start{\currentstyle}}%
- \frozen\instance\setuevalue{\e!stop \currentstyle}{\font_styles_apply_stop}%
- \frozen\instance\setuevalue {\currentstyle}{\font_styles_apply_grouped{\currentstyle}}% no longer groupedcommand here
+ \frozen\instance\protected\edefcsname\e!start\currentstyle\endcsname{\font_styles_apply_start{\currentstyle}}%
+ \frozen\instance\protected\edefcsname\e!stop \currentstyle\endcsname{\font_styles_apply_stop}%
+ \frozen\instance\protected\edefcsname \currentstyle\endcsname{\font_styles_apply_grouped{\currentstyle}}% no longer groupedcommand here
\fi
\to \everydefinestyle
@@ -248,7 +248,7 @@
{\endgroup}
\protected\def\font_styles_apply_grouped#name% assumes that the next is { or \bgroup
- {\bgroup
+ {\bgroup % \beginsimplegroup
\def\currentstyle{\font_styles_use_defined{#name}}%
\afterassignment\currentstyle
\let\nexttoken}
@@ -259,8 +259,8 @@
\protected\def\font_styles_use_generic#specification%
{\let\currentstyle\s!unknown % reasonable generic tag
- \letstyleparameter\c!style\empty
- \letstyleparameter\c!color\empty
+ \resetstyleparameter\c!style
+ \resetstyleparameter\c!color
\setupcurrentstyle[#specification]%
\usestylestyleandcolor\c!style\c!color}
@@ -281,20 +281,20 @@
\fi
\endcsname{#name}}
-\setvalue{\??styleargument1}#name%
+\defcsname\??styleargument1\endcsname#name%
{\expandafter\triggergroupedcommandcs\begincsname#name\endcsname}
-\setvalue{\??styleargument2}#name%
+\defcsname\??styleargument2\endcsname#name%
{\triggergroupedcommand{\font_styles_use_defined{#name}}} % or {\font_styles_apply_grouped{#name}}
-\setvalue{\??styleargument3}#specification%
+\defcsname\??styleargument3\endcsname#specification%
{\doifelseassignment{#specification}\font_styles_assignment\font_styles_direct{#specification}}
-\setvalue{\??styleargument4}#name%
+\defcsname\??styleargument4\endcsname#name%
{\expandafter\triggergroupedcommandcs\begincsname\??stylehack#name\endcsname}
-\setvalue{\??stylehack\s!math}% dirty trick
- {\groupedcommand\normalstartimath\normalstopimath}
+\defcsname\??stylehack\s!math\endcsname% dirty trick
+ {\groupedcommandcs\normalstartimath\normalstopimath}
% \def\font_styles_assignment#specification{\groupedcommand{\font_styles_use_generic{#specification}}{}}
% \def\font_styles_direct #specification{\groupedcommand{\definedfont[#specification]}{}}
@@ -322,13 +322,13 @@
{\endgroup
\autoinsertnextspace} % will be configurable, maybe also in \definestartstop
-\setvalue{\??styleenvironment1}#name%
+\defcsname\??styleenvironment1\endcsname#name%
{\csname#name\endcsname}
-\setvalue{\??styleenvironment2}#name%
+\defcsname\??styleenvironment2\endcsname#name%
{\font_styles_use_defined{#name}}
-\setvalue{\??styleenvironment3}#specification%
+\defcsname\??styleenvironment3\endcsname#specification%
{\doifelseassignment{#specification}\font_styles_start_assignment\font_styles_start_direct{#specification}}
\def\font_styles_start_assignment#specification{\font_styles_use_generic{#specification}}
@@ -346,6 +346,12 @@
% {\bf test \mine test \sl test \mine test \bs oeps \mine oeps {\tt test \mine \bf test}}
+% too messy for this:
+%
+% \definestylecollection[mine]
+% \definestyleinstance[mine][tt][tf][\nohyphencollapsing]
+% {\tt\mine test--test \bf test--test}
+
\installcorenamespace{stylecollection}
\permanent\tolerant\protected\def\definestylecollection[#name]%
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-sym.mklx b/Master/texmf-dist/tex/context/base/mkxl/font-sym.mklx
index c908ad849d3..9e6482c8dd7 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-sym.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-sym.mklx
@@ -56,19 +56,17 @@
% potential generalization:
%
-% \letvalue{\??fontfile:t:\s!rm}\s!Serif
-% \letvalue{\??fontfile:t:\s!ss}\s!Sans
-% \letvalue{\??fontfile:t:\s!tt}\s!Mono
-%
-% \letvalue{\??fontfile:a:\s!rm}\s!Regular
-% \letvalue{\??fontfile:a:\s!ss}\s!Support
-% \letvalue{\??fontfile:a:\s!tt}\s!Type
-%
-% \letvalue{\??fontfile:s:\s!bf}\s!Bold
-% \letvalue{\??fontfile:s:\s!sl}\s!Slanted
-% \letvalue{\??fontfile:s:\s!it}\s!Italic
-% \letvalue{\??fontfile:s:\s!bs}\s!BoldSlanted
-% \letvalue{\??fontfile:s:\s!bi}\s!BoldItalic
+% \letcsname\??fontfile:t:\s!rm\endcsname\s!Serif
+% \letcsname\??fontfile:t:\s!ss\endcsname\s!Sans
+% \letcsname\??fontfile:t:\s!tt\endcsname\s!Mono
+% \letcsname\??fontfile:a:\s!rm\endcsname\s!Regular
+% \letcsname\??fontfile:a:\s!ss\endcsname\s!Support
+% \letcsname\??fontfile:a:\s!tt\endcsname\s!Type
+% \letcsname\??fontfile:s:\s!bf\endcsname\s!Bold
+% \letcsname\??fontfile:s:\s!sl\endcsname\s!Slanted
+% \letcsname\??fontfile:s:\s!it\endcsname\s!Italic
+% \letcsname\??fontfile:s:\s!bs\endcsname\s!BoldSlanted
+% \letcsname\??fontfile:s:\s!bi\endcsname\s!BoldItalic
%
% \def\v_font_string_a{\executeifdefined{\??fontfile:t:\fontstyle}\s!Serif}
% \def\v_font_string_a{\executeifdefined{\??fontfile:t:\fontstyle}\s!Serif}
@@ -129,9 +127,9 @@
\installcorenamespace{symbolfont}
-\mutable\let\skedsymbolfont \empty % for diagnostics
-\mutable\let\currentsymbolfont\empty
-\mutable\let\askedsymbolfont \empty
+\mutable\lettonothing\skedsymbolfont % for diagnostics
+\mutable\lettonothing\currentsymbolfont
+\mutable\lettonothing\askedsymbolfont
\permanent\protected\def\setscaledstyledsymbolicfont#1#2#3% quite a slowdown, glyphfontfile
{\edef\askedsymbolfont{\truefontname{\glyphfontfile{#3}} at \the\dimexpr#2\dimexpr\currentfontbodyscale\dimexpr#1}%
@@ -170,6 +168,17 @@
\currentsymbolfont
\gletcsname\??symbolfont\askedsymbolfont\endcsname\lastrawfontcall}
+% \definefontfeature[colored][colr=yes]
+% \definefontsynonym[flags][file:BabelStoneFlagsDual.ttf*colored]
+% \definesymbol[BR][{\getnamedglyphdirect {flags}{br}}]
+% \definesymbol[PT][{\getnamedglyphdirect {flags}{pt}}]
+% \definesymbol[BR][{\getnamedglyphdirectscaled{.7}{flags}{br}}]
+% \definesymbol[PT][{\getnamedglyphdirectscaled{.7}{flags}{pt}}]
+%
+% \def\glyphscaled#1{\cldcontext{math.floor(\the\glyphscale*#1)}\relax}
+% \definesymbol[BR][{\glyphscale\glyphscaled{.7}\getnamedglyphdirect{flags}{br}}]
+% \definesymbol[PT][{\glyphscale\glyphscaled{.7}\getnamedglyphdirect{flags}{pt}}]
+
\permanent\protected\def\getnamedglyphstyled#fontname#character{{\setstyledsymbolicfont{#fontname}\clf_fontchar{#character}}}
\permanent\protected\def\getnamedglyphdirect#fontname#character{{\setdirectsymbolicfont{#fontname}\clf_fontchar{#character}}}
\permanent\protected\def\getglyphstyled #fontname#character{{\setstyledsymbolicfont{#fontname}\doifelsenumber{#character}\char\donothing#character}}
@@ -177,6 +186,9 @@
\permanent\protected\def\resolvedglyphstyled#fontname#character{{\setstyledsymbolicfont{#fontname}\clf_tochar{#character}}}
\permanent\protected\def\resolvedglyphdirect#fontname#character{{\setdirectsymbolicfont{#fontname}\clf_tochar{#character}}}
+\permanent\protected\def\getnamedglyphdirectscaled#scale#fontname#character%
+ {{\setscaleddirectsymbolicfont\fontbody{#scale}{#fontname}\clf_fontchar{#character}}}
+
% this one is wrong:
\permanent\protected\def\getscaledglyph#scale#name#content%
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-tex.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-tex.lmt
index c960953a700..2d21687df7e 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-tex.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-tex.lmt
@@ -6,22 +6,23 @@ if not modules then modules = { } end modules ['font-mpf'] = {
license = "see context related readme files"
}
-local formatters = string.formatters
-local sortedhash = table.sortedhash
+local formatters = string.formatters
+local sortedhash = table.sortedhash
-local addcharacters = fonts.constructors.addcharacters
-local fontdata = fonts.hashes.identifiers
+local addcharacters = fonts.constructors.addcharacters
+local fontdata = fonts.hashes.identifiers
+local fontchars = fonts.hashes.characters
-local otf = fonts.handlers.otf
-local otfregister = otf.features.register
+local otf = fonts.handlers.otf
+local otfregister = otf.features.register
------ getshapes = fonts.dropins.getshapes
+----- getshapes = fonts.dropins.getshapes
-local register = fonts.collections.register
-local checkenabled = fonts.collections.checkenabled
-local newprivateslot = fonts.helpers.newprivateslot
+local register = fonts.collections.register
+local checkenabled = fonts.collections.checkenabled
+local newprivateslot = fonts.helpers.newprivateslot
-local currentfont = font.current
+local currentfont = font.current
-- hm, seems to gobble the first \char
@@ -34,7 +35,7 @@ local function makeglyphbox(char,spec)
width = b.width,
height = b.height,
depth = b.depth,
- objnum = tex.saveboxresource(b,nil,nil,true),
+ objnum = tex.boxresources.save(b,nil,nil,true),
}
end
@@ -84,6 +85,32 @@ local function setboxglyph(specification)
end
end
+local function setboxdirectly(font,unicode,box) -- hash based on wd/ht/dp
+ if box then
+ local tfmdata = fontdata[font]
+ local glyphboxes = (tfmdata.glyphboxes or 0) + 1
+ tfmdata.glyphboxes = glyphboxes
+ local private = newprivateslot(formatters["BG:%05X"](glyphboxes))
+ local newdata = {
+ width = box.width or 0,
+ height = box.height or 0,
+ depth = box.depth or 0,
+ unicode = unicode,
+ objnum = tex.boxresources.save(box,nil,nil,true),
+ }
+ local specification = {
+ code = newdata
+ }
+ tfmdata.characters[private] = newdata
+ addcharacters(font, { characters = { [private] = newdata } })
+ fonts.dropins.swapone("box",tfmdata,specification,private)
+ checkenabled()
+ return private
+ end
+end
+
+fonts.helpers.setboxdirectly = setboxdirectly
+
local boxes = table.setmetatableindex("table")
function fonts.helpers.registerglyphbox(specification)
@@ -158,3 +185,34 @@ fonts.handlers.otf.features.register {
-- fonts.helpers.registerboxglyph { category = "demo", unicode = 104 }
-- fonts.helpers.registerboxglyph { category = "demo", unicode = 105 }
-- fonts.helpers.registerboxglyph { category = "demo", unicode = 106 }
+
+local callbacks = fonts.callbacks or { }
+fonts.callbacks = callbacks
+
+function callbacks.devirtualize(chardata,f,c)
+ if chardata.commands then
+ local h = node.hpack(nodes.pool.glyph(f,c))
+ local p = setboxdirectly(f,c,h)
+ chardata.oldcommands = chardata.commands
+ chardata.commands = { { "char", p } }
+ chardata.callback = false
+ end
+end
+
+local function processcallback(f,c)
+ local characters = fontchars[f]
+ local chardata = characters[c]
+ if chardata then
+ local callback = chardata.callback
+ if callback then
+ local action = type(callback) == "function" and callback or callbacks[callback]
+ if action then
+ action(chardata,f,c)
+ end
+ end
+ end
+end
+
+callback.register("process_character",processcallback)
+
+callbacks.callback = processcallback
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-tfm.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-tfm.lmt
new file mode 100644
index 00000000000..9fce8fc5fae
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-tfm.lmt
@@ -0,0 +1,682 @@
+if not modules then modules = { } end modules ['font-tfm'] = {
+ version = 1.001,
+ comment = "companion to font-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+if not context then return end -- use luatex-fonts-tfm.lua instead
+
+local next, type = next, type
+local match, format = string.match, string.format
+local concat, sortedhash = table.concat, table.sortedhash
+local idiv = number.idiv
+
+local trace_defining = false trackers.register("fonts.defining", function(v) trace_defining = v end)
+local trace_features = false trackers.register("tfm.features", function(v) trace_features = v end)
+
+local report_defining = logs.reporter("fonts","defining")
+local report_tfm = logs.reporter("fonts","tfm loading")
+
+local findbinfile = resolvers.findbinfile
+local setmetatableindex = table.setmetatableindex
+
+local fonts = fonts
+local handlers = fonts.handlers
+local helpers = fonts.helpers
+local readers = fonts.readers
+local constructors = fonts.constructors
+local encodings = fonts.encodings
+
+local tfm = constructors.handlers.tfm
+tfm.version = 1.000
+tfm.maxnestingdepth = 5
+tfm.maxnestingsize = 65536*1024
+
+local otf = fonts.handlers.otf
+local otfenhancers = otf.enhancers
+
+local tfmfeatures = constructors.features.tfm
+local registertfmfeature = tfmfeatures.register
+
+local tfmenhancers = constructors.enhancers.tfm
+local registertfmenhancer = tfmenhancers.register
+
+local charcommand = helpers.commands.char
+
+constructors.resolvevirtualtoo = false -- wil be set in font-ctx.lua
+
+fonts.formats.tfm = "type1" -- we need to have at least a value here
+fonts.formats.ofm = "type1" -- we need to have at least a value here
+
+--[[ldx--
+<p>The next function encapsulates the standard <l n='tfm'/> loader as
+supplied by <l n='luatex'/>.</p>
+--ldx]]--
+
+-- this might change: not scaling and then apply features and do scaling in the
+-- usual way with dummy descriptions but on the other hand .. we no longer use
+-- tfm so why bother
+
+-- ofm directive blocks local path search unless set; btw, in context we
+-- don't support ofm files anyway as this format is obsolete
+
+-- we need to deal with nested virtual fonts, but because we load in the
+-- frontend we also need to make sure we don't nest too deep (esp when sizes
+-- get large)
+--
+-- (VTITLE Example of a recursion)
+-- (MAPFONT D 0 (FONTNAME recurse)(FONTAT D 2))
+-- (CHARACTER C A (CHARWD D 1)(CHARHT D 1)(MAP (SETRULE D 1 D 1)))
+-- (CHARACTER C B (CHARWD D 2)(CHARHT D 2)(MAP (SETCHAR C A)))
+-- (CHARACTER C C (CHARWD D 4)(CHARHT D 4)(MAP (SETCHAR C B)))
+--
+-- we added the same checks as below to the luatex engine
+
+function tfm.setfeatures(tfmdata,features)
+ local okay = constructors.initializefeatures("tfm",tfmdata,features,trace_features,report_tfm)
+ if okay then
+ return constructors.collectprocessors("tfm",tfmdata,features,trace_features,report_tfm)
+ else
+ return { } -- will become false
+ end
+end
+
+local depth = { } -- table.setmetatableindex("number")
+
+-- Normally we just load the tfm data and go on. However there was some demand for
+-- loading good old tfm /pfb files where afm files were lacking and even enc files
+-- of dubious quality so we now support loading such (often messy) setups too.
+--
+-- Because such fonts also use (ugly) tweaks achieve some purpose (like swapping
+-- accents) we need to delay the unicoding actions till after the features have been
+-- applied.
+--
+-- It must be noted that in ConTeXt we don't expect this to be used at all. Here is
+-- example:
+--
+-- tfm metrics + pfb vector for index + pfb file for shapes
+--
+-- \font\foo=file:csr10.tfm:reencode=auto;mode=node;liga=yes;kern=yes
+--
+-- tfm metrics + pfb vector for index + enc file for tfm mapping + pfb file for shapes
+--
+-- \font\foo=file:csr10.tfm:reencode=csr.enc;mode=node;liga=yes;kern=yes
+--
+-- tfm metrics + enc file for mapping to tfm + bitmaps shapes
+--
+-- \font\foo=file:csr10.tfm:reencode=csr.enc;bitmap=yes;mode=node;liga=yes;kern=yes
+--
+-- One can add features:
+--
+-- fonts.handlers.otf.addfeature {
+-- name = "czechdqcheat",
+-- type = "substitution",
+-- data = {
+-- quotedblright = "csquotedblright",
+-- },
+-- }
+--
+-- So "czechdqcheat=yes" is then a valid feature. And yes, it's a cheat.
+
+local loadtfmvf = tfm.readers.loadtfmvf
+
+local function read_from_tfm(specification)
+ local filename = specification.filename
+ local size = specification.size
+ depth[filename] = (depth[filename] or 0) + 1
+ if trace_defining then
+ report_defining("loading tfm file %a at size %s",filename,size)
+ end
+ local tfmdata = loadtfmvf(filename,size)
+ if tfmdata then
+
+ local features = specification.features and specification.features.normal or { }
+ local features = constructors.checkedfeatures("tfm",features)
+ specification.features.normal = features
+
+ -- If reencode returns a new table, we assume that we're doing something
+ -- special. An 'auto' reencode picks up its vector from the pfb file.
+
+ local getmapentry = fonts.mappings.getentry
+
+ if getmapentry and not features.reencode then
+ -- This can happen multiple times but not that often so we don't
+ -- optimize this.
+ local encoding, pfbfile, encfile = getmapentry(filename)
+ if encoding and pfbfile then
+ features.reencode = encfile
+ features.pfbfile = pfbfile
+ end
+ end
+ local newtfmdata = (depth[filename] == 1) and tfm.reencode(tfmdata,specification)
+ if newtfmdata then
+ tfmdata = newtfmdata
+ end
+
+ local resources = tfmdata.resources or { }
+ local properties = tfmdata.properties or { }
+ local parameters = tfmdata.parameters or { }
+ local shared = tfmdata.shared or { }
+ --
+ shared.features = features
+ shared.resources = resources
+ --
+ properties.id = specification.id
+ properties.name = tfmdata.name -- todo: fallback
+ properties.fontname = tfmdata.fontname -- todo: fallback
+ properties.psname = tfmdata.psname -- todo: fallback
+ properties.fullname = tfmdata.fullname -- todo: fallback
+ properties.filename = specification.filename -- todo: fallback
+ properties.format = tfmdata.format or fonts.formats.tfm -- better than nothing
+ properties.usedbitmap = tfmdata.usedbitmap
+ properties.designsize = tfmdata.designsize -- let's be nice
+ parameters.designsize = tfmdata.designsize -- needed because of pdf position synchronzing
+ --
+ if getmapentry and newtfmdata then
+ properties.filename = features.pfbfile
+ end
+ --
+ tfmdata.properties = properties
+ tfmdata.resources = resources
+ tfmdata.parameters = parameters
+ tfmdata.shared = shared
+ --
+ shared.rawdata = { resources = resources }
+ shared.features = features
+ --
+ -- The next branch is only entered when we have a proper encoded file i.e.
+ -- unicodes and such. It really nakes no sense to do feature juggling when
+ -- we have no names and unicodes.
+ --
+ if newtfmdata then
+ --
+ -- Some opentype processing assumes these to be present:
+ --
+ if not resources.marks then
+ resources.marks = { }
+ end
+ if not resources.sequences then
+ resources.sequences = { }
+ end
+ if not resources.features then
+ resources.features = {
+ gsub = { },
+ gpos = { },
+ }
+ end
+ if not tfmdata.changed then
+ tfmdata.changed = { }
+ end
+ if not tfmdata.descriptions then
+ tfmdata.descriptions = tfmdata.characters
+ end
+ --
+ -- It might be handy to have this:
+ --
+ otf.readers.addunicodetable(tfmdata)
+ --
+ -- We make a pseudo opentype font, e.g. kerns and ligatures etc:
+ --
+ tfmenhancers.apply(tfmdata,filename)
+ --
+ -- Now user stuff can kick in.
+ --
+ constructors.applymanipulators("tfm",tfmdata,features,trace_features,report_tfm)
+ --
+ -- As that can also mess with names and such, we are now ready for finalizing
+ -- the unicode information. This is a different order that for instance type one
+ -- (afm) files. First we try to deduce unicodes from already present information.
+ --
+ otf.readers.unifymissing(tfmdata)
+ --
+ -- Next we fill in the gaps, based on names from teh agl. Probably not much will
+ -- happen here.
+ --
+ fonts.mappings.addtounicode(tfmdata,filename)
+ --
+ local tounicode = fonts.mappings.tounicode
+ for unicode, v in next, tfmdata.characters do
+ local u = v.unicode
+ if u then
+ v.tounicode = tounicode(u)
+ end
+ end
+ --
+ -- However, when we use a bitmap font those vectors can't be constructed because
+ -- that information is not carried with those fonts (there is no name info, nor
+ -- proper index info, nor unicodes at that end). So, we provide it ourselves.
+ --
+ if tfmdata.usedbitmap then
+ tfm.addtounicode(tfmdata)
+ end
+ end
+ --
+ shared.processes = next(features) and tfm.setfeatures(tfmdata,features) or nil
+ --
+ fonts.loggers.register(tfmdata,'tfm',specification)
+ --
+ if size < 0 then
+ size = idiv(65536 * -size,100)
+ end
+
+ parameters.factor = 1 -- already scaled
+ parameters.units = 1000 -- just in case
+ parameters.size = size
+ parameters.slant = parameters.slant or parameters[1] or 0
+ parameters.space = parameters.space or parameters[2] or 0
+ parameters.spacestretch = parameters.spacestretch or parameters[3] or 0
+ parameters.spaceshrink = parameters.spaceshrink or parameters[4] or 0
+ parameters.xheight = parameters.xheight or parameters[5] or 0
+ parameters.quad = parameters.quad or parameters[6] or 0
+ parameters.extraspace = parameters.extraspace or parameters[7] or 0
+ --
+ constructors.enhanceparameters(parameters) -- official copies for us
+ --
+ properties.private = properties.private or tfmdata.private or privateoffset
+ --
+ if newtfmdata then
+ --
+ -- We do nothing as we assume flat tfm files. It would become real messy
+ -- otherwise and I don't have something for testing on my system anyway.
+ --
+ else
+ -- already loaded
+ local fonts = tfmdata.fonts
+ if fonts then
+ for i=1,#fonts do
+ local font = fonts[i]
+ local id = font.id
+ if not id then
+ local name = font.name
+ local size = font.size
+ if name and size then
+ local data, id = constructors.readanddefine(name,size)
+ if id then
+ font.id = id
+ font.name = nil
+ font.size = nil
+ end
+ end
+ end
+ end
+ end
+ end
+ --
+ properties.haskerns = true
+ properties.hasligatures = true
+ properties.hasitalics = true
+ resources.unicodes = { }
+ resources.lookuptags = { }
+ --
+ depth[filename] = depth[filename] - 1
+ --
+ return tfmdata
+ else
+ depth[filename] = depth[filename] - 1
+ end
+end
+
+local function check_tfm(specification,fullname) -- we could split up like afm/otf
+ local foundname = findbinfile(fullname, 'tfm') or ""
+ if foundname == "" then
+ foundname = findbinfile(fullname, 'ofm') or "" -- not needed in context
+ end
+ if foundname == "" then
+ foundname = fonts.names.getfilename(fullname,"tfm") or ""
+ end
+ if foundname ~= "" then
+ specification.filename = foundname
+ specification.format = "ofm"
+ return read_from_tfm(specification)
+ elseif trace_defining then
+ report_defining("loading tfm with name %a fails",specification.name)
+ end
+end
+
+readers.check_tfm = check_tfm
+
+function readers.tfm(specification)
+ local fullname = specification.filename or ""
+ if fullname == "" then
+ local forced = specification.forced or ""
+ if forced ~= "" then
+ fullname = specification.name .. "." .. forced
+ else
+ fullname = specification.name
+ end
+ end
+ return check_tfm(specification,fullname)
+end
+
+readers.ofm = readers.tfm
+
+-- The reencoding acts upon the 'reencode' feature which can have values 'auto' or
+-- an enc file. You can also specify a 'pfbfile' feature (but it defaults to the
+-- tfm filename) and a 'bitmap' feature. When no enc file is given (auto) we will
+-- get the vectors from the pfb file.
+
+do
+
+ local outfiles = { }
+
+ local tfmcache = table.setmetatableindex(function(t,tfmdata)
+ local id = font.define(tfmdata)
+ t[tfmdata] = id
+ return id
+ end)
+
+ local encdone = table.setmetatableindex("table")
+
+ function tfm.reencode(tfmdata,specification)
+
+ local features = specification.features
+
+ if not features then
+ return
+ end
+
+ local features = features.normal
+
+ if not features then
+ return
+ end
+
+ local tfmfile = file.basename(tfmdata.name)
+ local encfile = features.reencode -- or features.enc
+ local pfbfile = features.pfbfile -- or features.pfb
+ local bitmap = features.bitmap -- or features.pk
+
+ if not encfile then
+ return
+ end
+
+ local pfbfile = pfbfile or outfiles[tfmfile]
+
+ if pfbfile == nil then
+ if bitmap then
+ pfbfile = false
+ elseif type(pfbfile) ~= "string" then
+ pfbfile = tfmfile
+ end
+ if type(pfbfile) == "string" then
+ pfbfile = file.addsuffix(pfbfile,"pfb")
+ -- pdf.mapline(tfmfile .. "<" .. pfbfile)
+ report_tfm("using type1 shapes from %a for %a",pfbfile,tfmfile)
+ else
+ report_tfm("using bitmap shapes for %a",tfmfile)
+ pfbfile = false -- use bitmap
+ end
+ outfiles[tfmfile] = pfbfile
+ end
+
+ local encoding = false
+ local vector = false
+ if type(pfbfile) == "string" then
+ local pfb = constructors.handlers.pfb
+ if pfb and pfb.loadvector then
+ local v, e = pfb.loadvector(pfbfile)
+ if v then
+ vector = v
+ end
+ if e then
+ encoding = e
+ end
+ end
+ end
+ if type(encfile) == "string" and encfile ~= "auto" then
+ encoding = fonts.encodings.load(file.addsuffix(encfile,"enc"))
+ if encoding then
+ encoding = encoding.vector
+ end
+ end
+ if not encoding then
+ report_tfm("bad encoding for %a, quitting",tfmfile)
+ return
+ end
+
+ local unicoding = fonts.encodings.agl and fonts.encodings.agl.unicodes
+ local virtualid = tfmcache[tfmdata]
+ local tfmdata = table.copy(tfmdata) -- good enough for small fonts
+ local characters = { }
+ local originals = tfmdata.characters
+ local indices = { }
+ local parentfont = { "font", 1 } -- can be zero (self referencing)
+ local private = tfmdata.privateoffset or constructors.privateoffset
+ local reported = encdone[tfmfile][encfile] -- bah, encdone for tfm or pfb ?
+ -- create characters table
+
+ -- vector : pfbindex -> name
+ -- encoding : tfmindex -> name
+
+ -- we store the order also because some tex encodings (see math-vfu) needs
+ -- that for remapping with non standard glyphs names cq. lack of unicode
+ -- slot information
+
+ for k, v in next, originals do
+ v.order = k
+ end
+
+ local backmap = vector and table.swapped(vector)
+ local done = { } -- prevent duplicate
+
+ for tfmindex, name in sortedhash(encoding) do -- predictable order
+ local original = originals[tfmindex]
+ if original then
+ local unicode = unicoding[name]
+ if unicode then
+ original.unicode = unicode
+ else
+ unicode = private
+ private = private + 1
+ if trace_defining and not reported then
+ report_tfm("glyph %a in font %a with encoding %a gets unicode %U",name,tfmfile,encfile,unicode)
+ end
+ end
+ characters[unicode] = original
+ indices[tfmindex] = unicode
+ original.name = name -- so one can lookup weird names
+ if backmap then
+ original.index = backmap[name] -- the pfb index
+ else -- probably bitmap
+ original.commands = { parentfont, charcommand[tfmindex] } -- or "slot"
+ original.oindex = tfmindex
+ end
+ done[name] = true
+ elseif not done[name] then
+ report_tfm("bad index %a in font %a with name %a",tfmindex,tfmfile,name)
+ end
+ end
+
+ encdone[tfmfile][encfile] = true
+
+ -- redo kerns and ligatures
+
+-- for k, v in next, characters do
+-- print(k,v.width)
+-- end
+
+ for k, v in next, characters do
+ local kerns = v.kerns
+ if kerns then
+ local t = { }
+ for k, v in next, kerns do
+ local i = indices[k]
+ if i then
+ t[i] = v
+ end
+ end
+ v.kerns = next(t) and t or nil
+ end
+ local ligatures = v.ligatures
+ if ligatures then
+ local t = { }
+ for k, v in next, ligatures do
+ local i = indices[k]
+ if i then
+ t[i] = v
+ v.char = indices[v.char]
+ end
+ end
+ v.ligatures = next(t) and t or nil
+ end
+ local parts = v.parts
+ if parts then
+ local t = { }
+ for i=1,#parts do
+ local p = parts[i]
+ local g = p.glyph
+ t[i] = {
+ glyph = indices[g] or g,
+ extender = p.extender,
+ }
+ end
+ v.parts = t
+ end
+ local next = v.next
+ if next then
+ v.next = indices[next]
+ end
+ end
+
+ -- wrap up
+
+ tfmdata.fonts = { { id = virtualid } }
+ tfmdata.characters = characters
+ tfmdata.fullname = tfmdata.fullname or tfmdata.name
+ tfmdata.psname = file.nameonly(pfbfile or tfmdata.name)
+ tfmdata.filename = pfbfile
+ -- tfmdata.format = bitmap and "type3" or "type1"
+ tfmdata.format = "type1"
+ tfmdata.usedbitmap = bitmap and virtualid
+ tfmdata.private = private
+
+ return tfmdata
+ end
+
+end
+
+-- Now we implement the regular features handlers. We need to convert the
+-- tfm specific structures to opentype structures. In basemode they are
+-- converted back so that is a bit of a waste but it's fast enough.
+
+do
+
+ local everywhere = { ["*"] = { ["*"] = true } } -- or: { ["*"] = { "*" } }
+ local noflags = { false, false, false, false }
+
+ local function enhance_normalize_features(data)
+ local ligatures = setmetatableindex("table")
+ local kerns = setmetatableindex("table")
+ local characters = data.characters
+ for u, c in next, characters do
+ local l = c.ligatures
+ local k = c.kerns
+ if l then
+ ligatures[u] = l
+ for u, v in next, l do
+ l[u] = { ligature = v.char }
+ end
+ c.ligatures = nil
+ end
+ if k then
+ kerns[u] = k
+ for u, v in next, k do
+ k[u] = v -- { v, 0 }
+ end
+ c.kerns = nil
+ end
+ end
+
+ for u, l in next, ligatures do
+ for k, v in next, l do
+ local vl = v.ligature
+ local dl = ligatures[vl]
+ if dl then
+ for kk, vv in next, dl do
+ v[kk] = vv -- table.copy(vv)
+ end
+ end
+ end
+ end
+
+ local features = {
+ gpos = { },
+ gsub = { },
+ }
+ local sequences = {
+ -- only filled ones
+ }
+ if next(ligatures) then
+ features.gsub.liga = everywhere
+ data.properties.hasligatures = true
+ sequences[#sequences+1] = {
+ features = {
+ liga = everywhere,
+ },
+ flags = noflags,
+ name = "s_s_0",
+ nofsteps = 1,
+ order = { "liga" },
+ type = "gsub_ligature",
+ steps = {
+ {
+ coverage = ligatures,
+ },
+ },
+ }
+ end
+ if next(kerns) then
+ features.gpos.kern = everywhere
+ data.properties.haskerns = true
+ sequences[#sequences+1] = {
+ features = {
+ kern = everywhere,
+ },
+ flags = noflags,
+ name = "p_s_0",
+ nofsteps = 1,
+ order = { "kern" },
+ type = "gpos_pair",
+ steps = {
+ {
+ format = "kern",
+ coverage = kerns,
+ },
+ },
+ }
+ end
+ data.resources.features = features
+ data.resources.sequences = sequences
+ data.shared.resources = data.shared.resources or resources
+ end
+
+ registertfmenhancer("normalize features", enhance_normalize_features)
+ registertfmenhancer("check extra features", otfenhancers.enhance)
+
+end
+
+-- As with type one (afm) loading, we just use the opentype ones:
+
+registertfmfeature {
+ name = "mode",
+ description = "mode",
+ initializers = {
+ base = otf.modeinitializer,
+ node = otf.modeinitializer,
+ }
+}
+
+registertfmfeature {
+ name = "features",
+ description = "features",
+ default = true,
+ initializers = {
+ base = otf.basemodeinitializer,
+ node = otf.nodemodeinitializer,
+ },
+ processors = {
+ node = otf.featuresprocessor,
+ }
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-tpk.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-tpk.lmt
new file mode 100644
index 00000000000..fc6789402fa
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-tpk.lmt
@@ -0,0 +1,1397 @@
+if not modules then modules = { } end modules ['font-tpk'] = {
+ version = 1.001,
+ optimize = true,
+ comment = "companion to font-lib.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- The bitmap loader is more or less derived from the luatex version (taco)
+-- which is derived from pdftex (thanh) who uses code from dvips (thomas)
+-- adapted by piet ... etc. The tfm and vf readers are also derived from
+-- luatex. All do things a bit more luaish and errors are of course mine.
+
+local next = next
+----- extract, band, lshift, rshift = bit32.extract, bit32.band, bit32.lshift, bit32.rshift
+----- idiv = number.idiv
+local char = string.char
+local concat, insert, remove, copy = table.concat, table.insert, table.remove, table.copy
+local tobitstring = number.tobitstring
+local formatters = string.formatters
+local round = math.round
+
+local streams = utilities.streams
+local openstream = streams.open
+local streamsize = streams.size
+local readcardinal1 = streams.readcardinal1
+local readcardinal2 = streams.readcardinal2
+local readcardinal3 = streams.readcardinal3
+local readcardinal4 = streams.readcardinal4
+local readinteger1 = streams.readinteger1
+local readinteger2 = streams.readinteger2
+local readinteger3 = streams.readinteger3
+local readinteger4 = streams.readinteger4
+local readbyte = streams.readbyte
+local readbytes = streams.readbytes
+local readstring = streams.readstring
+local skipbytes = streams.skipbytes
+local getposition = streams.getposition
+local setposition = streams.setposition
+
+if not fonts then fonts = { handlers = { tfm = { } } } end
+
+local handlers = fonts.handlers
+local tfm = handlers.tfm or { }
+handlers.tfm = tfm
+tfm.version = 1.006
+
+local readers = tfm.readers or { }
+tfm.readers = readers
+
+-- Performance is no real issue here so I didn't optimize too much. After
+-- all, these files are small and we mostly use opentype or type1 fonts.
+
+do
+
+ local function readbitmap(glyph,s,flagbyte)
+
+ local inputbyte = 0
+ local bitweight = 0
+ local dynf = 0
+ local remainder = 0
+ local realfunc = nil
+ local repeatcount = 0
+
+ local function getnyb() -- can be inlined
+ if bitweight == 0 then
+ bitweight = 16
+ inputbyte = readbyte(s)
+ -- return extract(inputbyte,4,4)
+ return (inputbyte >> 4) & 0xF
+ else
+ bitweight = 0
+ return inputbyte & 15
+ end
+ end
+
+ local function getbit() -- can be inlined
+ -- bitweight = rshift(bitweight,1)
+ bitweight = (bitweight >> 1) & 0xFFFFFFFF
+ if bitweight == 0 then -- actually we can check for 1
+ inputbyte = readbyte(s)
+ bitweight = 128
+ end
+ return inputbyte & bitweight
+ end
+
+ local function pkpackednum()
+ local i = getnyb(s)
+ if i == 0 then
+ repeat
+ j = getnyb()
+ i = i + 1
+ until (j ~= 0)
+ if i > 3 then
+ return handlehuge(i,j)
+ else
+ for i=1,i do
+ j = j * 16 + getnyb()
+ end
+ return j - 15 + (13 - dynf) * 16 + dynf
+ end
+ elseif i <= dynf then
+ return i
+ elseif i < 14 then
+ return (i - dynf - 1) * 16 + getnyb() + dynf + 1
+ elseif i == 14 then
+ repeatcount = pkpackednum()
+ else
+ repeatcount = 1
+ end
+ return realfunc()
+ end
+
+ local function rest()
+ if remainder < 0 then
+ remainder = -remainder
+ return 0
+ elseif remainder > 4000 then
+ remainder = 4000 - remainder
+ return 4000
+ elseif remainder > 0 then
+ local i = remainder
+ remainder = 0
+ realfunc = pkpackednum
+ return i
+ else
+ -- error = "pk issue that shouldn't happen"
+ return 0
+ end
+ end
+
+ local function handlehuge(i,j)
+ while i ~= 0 do
+ -- j = lshift(j,4) + getnyb()
+ j = ((j << 4) & 0xFFFFFFFF) + getnyb()
+ i = i - 1
+ end
+ remainder = j - 15 + (13 - dynf) * 16 + dynf
+ realfunc = rest
+ return rest()
+ end
+
+ local gpower = { [0] =
+ 0, 1, 3, 7, 15, 31, 63, 127,
+ 255, 511, 1023, 2047, 4095, 8191, 16383, 32767,
+ 65535
+ }
+
+ local raster = { }
+ local r = 0
+ glyph.stream = raster
+
+ local xsize = glyph.xsize
+ local ysize = glyph.ysize
+ local word = 0
+ local wordweight = 0
+ local wordwidth = (xsize + 15) // 16
+ local rowsleft = 0
+ local turnon = (flagbyte & 8) == 8 and true or false
+ local hbit = 0
+ local count = 0
+ --
+ realfunc = pkpackednum
+ dynf = flagbyte // 16
+ --
+ if dynf == 14 then
+ bitweight = 0
+ for i=1,ysize do
+ word = 0
+ wordweight = 32768
+ for j=1,xsize do
+ if getbit() ~= 0 then
+ word = word + wordweight
+ end
+ -- wordweight = rshift(wordweight,1)
+ wordweight = (wordweight >> 1) & 0xFFFFFFFF
+ if wordweight == 0 then
+ r = r + 1
+ raster[r] = word
+ word = 0
+ wordweight = 32768
+ end
+ end
+ if wordweight ~= 32768 then
+ r = r + 1
+ raster[r] = word
+ end
+ end
+ else
+ rowsleft = ysize
+ hbit = xsize
+ repeatcount = 0
+ wordweight = 16
+ word = 0
+ bitweight = 0
+ while rowsleft > 0 do
+ count = realfunc()
+ while count ~= 0 do
+ if count < wordweight and count < hbit then
+ if turnon then
+ word = word + gpower[wordweight] - gpower[wordweight - count]
+ end
+ hbit = hbit - count
+ wordweight = wordweight - count
+ count = 0
+ elseif count >= hbit and hbit <= wordweight then
+ if turnon then
+ word = word + gpower[wordweight] - gpower[wordweight - hbit]
+ end
+ r = r + 1
+ raster[r] = word
+ for i=1,repeatcount*wordwidth do
+ r = r + 1
+ raster[r] = raster[r - wordwidth]
+ end
+ rowsleft = rowsleft - repeatcount - 1
+ repeatcount = 0
+ word = 0
+ wordweight = 16
+ count = count - hbit
+ hbit = xsize
+ else
+ if turnon then
+ word = word + gpower[wordweight]
+ end
+ r = r + 1
+ raster[r] = word
+ word = 0
+ count = count - wordweight
+ hbit = hbit - wordweight
+ wordweight = 16
+ end
+ end
+ turnon = not turnon
+ end
+ if rowsleft ~= 0 or hbit ~= xsize then
+ print("ERROR",rowsleft,hbit,xsize)
+ -- error = "error while unpacking, more bits than required"
+ end
+ end
+
+ end
+
+ function readers.showpk(glyph)
+ local xsize = glyph.xsize
+ local ysize = glyph.ysize
+ local stream = glyph.stream
+ local result = { }
+ local rr = { }
+ local r = 0
+ local s = 0
+ local cw = (xsize+ 7) // 8
+ local rw = (xsize+15) // 16
+ local extra = 2 * rw == cw
+ local b
+ for y=1,ysize do
+ r = 0
+ for x=1,rw-1 do
+ s = s + 1 ; b = stream[s]
+ r = r + 1 ; rr[r] = tobitstring(b,16,16)
+ end
+ s = s + 1 ; b = stream[s]
+ if extra then
+ r = r + 1 ; rr[r] = tobitstring(b,16,16)
+ else
+ -- r = r + 1 ; rr[r] = tobitstring(extract(b,8+(8-cw),cw),cw,cw)
+ r = r + 1 ; rr[r] = tobitstring((b >> (8+(8-cw))) &~ (-1 << cw),cw,cw)
+ end
+ result[y] = concat(rr)
+ end
+ return concat(result,"\n")
+ end
+
+ local template = formatters [ [[
+%.3N 0 %i %i %i %i d1
+q
+%i 0 0 %i %i %i cm
+BI
+ /W %i
+ /H %i
+ /IM true
+ /BPC 1
+ /D [1 0]
+ID %t
+EI
+Q]] ]
+
+ function readers.pktopdf(glyph,data,factor)
+ local width = data.width * factor
+ local xsize = glyph.xsize or 0
+ local ysize = glyph.ysize or 0
+ local xoffset = glyph.xoffset or 0
+ local yoffset = glyph.yoffset or 0
+ local stream = glyph.stream
+
+ local dpi = 1
+ local newdpi = 1
+
+ local xdpi = dpi * xsize / newdpi
+ local ydpi = dpi * ysize / newdpi
+
+ local llx = - xoffset
+ local lly = yoffset - ysize + 1
+ local urx = llx + xsize + 1
+ local ury = lly + ysize
+
+ local result = { }
+ local r = 0
+ local s = 0
+ local cw = (xsize+ 7) // 8
+ local rw = (xsize+15) // 16
+ local extra = 2 * rw == cw
+ local b
+ for y=1,ysize do
+ for x=1,rw-1 do
+ s = s + 1 ; b = stream[s]
+ -- r = r + 1 ; result[r] = char(extract(b,8,8),extract(b,0,8))
+ r = r + 1 ; result[r] = char((b >> 8) & 0xFF,b & 0xFF)
+ end
+ s = s + 1 ; b = stream[s]
+ if extra then
+ -- r = r + 1 ; result[r] = char(extract(b,8,8),extract(b,0,8))
+ r = r + 1 ; result[r] = char((b >> 8) & 0xFF,b & 0xFF)
+ else
+ -- r = r + 1 ; result[r] = char(extract(b,8,8))
+ r = r + 1 ; result[r] = char((b >> 8) & 0xFF)
+ end
+ end
+ return template(width,llx,lly,urx,ury,xdpi,ydpi,llx,lly,xsize,ysize,result), width
+ end
+
+ function readers.loadpk(filename)
+ local s = openstream(filename)
+ local preamble = readcardinal1(s)
+ local version = readcardinal1(s)
+ local comment = readstring(s,readcardinal1(s))
+ local designsize = readcardinal4(s)
+ local checksum = readcardinal4(s)
+ local hppp = readcardinal4(s)
+ local vppp = readcardinal4(s)
+ if preamble ~= 247 or version ~= 89 or not vppp then
+ return { error = "invalid preamble" }
+ end
+ local glyphs = { }
+ local data = {
+ designsize = designsize,
+ comment = comment,
+ hppp = hppp,
+ vppp = vppp,
+ glyphs = glyphs,
+ }
+ while true do
+ local flagbyte = readcardinal1(s)
+ if flagbyte < 240 then
+ local c = flagbyte & 7
+ local length, index, width, pixels, xsize, ysize, xoffset, yoffset
+ if c >= 0 and c <= 3 then
+ length = (flagbyte & 7) * 256 + readcardinal1(s) - 3
+ index = readcardinal1(s)
+ width = readinteger3(s)
+ pixels = readcardinal1(s)
+ xsize = readcardinal1(s)
+ ysize = readcardinal1(s)
+ xoffset = readcardinal1(s)
+ yoffset = readcardinal1(s)
+ if xoffset > 127 then
+ xoffset = xoffset - 256
+ end
+ if yoffset > 127 then
+ yoffset = yoffset - 256
+ end
+ elseif c >= 4 and c <= 6 then
+ length = (flagbyte & 3) * 65536 + readcardinal1(s) * 256 + readcardinal1(s) - 4
+ index = readcardinal1(s)
+ width = readinteger3(s)
+ pixels = readcardinal2(s)
+ xsize = readcardinal2(s)
+ ysize = readcardinal2(s)
+ xoffset = readcardinal2(s)
+ yoffset = readcardinal2(s)
+ else -- 7
+ length = readcardinal4(s) - 9
+ index = readcardinal4(s)
+ width = readinteger4(s)
+ pixels = readcardinal4(s)
+ readcardinal4(s)
+ xsize = readcardinal4(s)
+ ysize = readcardinal4(s)
+ xoffset = readcardinal4(s)
+ yoffset = readcardinal4(s)
+ end
+ local glyph = {
+ index = index,
+ width = width,
+ pixels = pixels,
+ xsize = xsize,
+ ysize = ysize,
+ xoffset = xoffset,
+ yoffset = yoffset,
+ }
+ if length <= 0 then
+ data.error = "bad packet"
+ return data
+ end
+ readbitmap(glyph,s,flagbyte)
+ glyphs[index] = glyph
+ elseif flagbyte == 240 then
+ -- k[1] x[k]
+ skipbytes(s,readcardinal1(s))
+ elseif flagbyte == 241 then
+ -- k[2] x[k]
+ skipbytes(s,readcardinal2(s)*2)
+ elseif flagbyte == 242 then
+ -- k[3] x[k]
+ skipbytes(s,readcardinal3(s)*3)
+ elseif flagbyte == 243 then
+ -- k[4] x[k]
+ skipbytes(s,readcardinal4(s)*4) -- readinteger4
+ elseif flagbyte == 244 then
+ -- y[4]
+ skipbytes(s,4)
+ elseif flagbyte == 245 then
+ break
+ elseif flagbyte == 246 then
+ -- nop
+ else
+ data.error = "unknown pk command"
+ break
+ end
+ end
+ return data
+ end
+
+end
+
+do
+
+ local leftboundary = -1
+ local rightboundary = -2
+ local boundarychar = 65536
+
+ local function toparts(extensible)
+ local top = extensible.top or 0
+ local middle = extensible.middle or 0
+ local extender = extensible.extender or 0
+ local bottom = extensible.bottom or 0
+ local extend = extender ~= 0 and { glyph = extender, extender = 1 }
+ if bottom == 0 and top == 0 and middle == 0 then
+ if extend then
+ return {
+ { glyph = extender },
+ extend,
+ }
+ end
+ else
+ local list = { }
+ local l = 0
+ if bottom ~= 0 then
+ l = l + 1 ; list[l] = { glyph = bottom }
+ end
+ if extend then
+ l = l + 1 ; list[l] = extend
+ end
+ if middle ~= 0 then
+ l = l + 1 ; list[l] = { glyph = middle }
+ if extend then
+ l = l + 1 ; list[l] = extend
+ end
+ end
+ if top ~= 0 then
+ l = l + 1 ; list[l] = { glyph = top }
+ end
+ return list
+ end
+ end
+
+ -- We don't cache because we hardly load tfm files multiple times and we need
+ -- to copy them anyway.
+
+ tfm.cache = containers.define("fonts", "tfm", tfm.version, true, true) -- reload: true
+
+ local filecache = tfm.cache
+ local cleanname = fonts.handlers.otf.readers.helpers.cleanname
+
+ local caching = true -- mainly for MS and HH as they test huge files with many instances
+
+ function readers.loadtfm(filename)
+ local data
+ --
+ local fileattr = lfs.attributes(filename)
+ local filesize = fileattr and fileattr.size or 0
+ local filetime = fileattr and fileattr.modification or 0
+ local fileformat = "tfm"
+ local filehash = cleanname(file.basename(filename))
+ --
+ data = caching and containers.read(filecache,filehash)
+ --
+ if data and data.filetime == filetime and data.filesize == filesize and data.fileformat == fileformat then
+ return data
+ end
+ --
+ local function someerror(m)
+ if not data then
+ data = { }
+ end
+ data.error = m or "fatal error"
+ return data
+ end
+ --
+ local s = openstream(filename)
+ if not s then
+ return someerror()
+ end
+ --
+ local wide = false
+ local header = 0
+ local max = 0
+ local size = streamsize(s)
+ local glyphs = table.setmetatableindex(function(t,k)
+ local v = {
+ -- we default because boundary chars have no dimension s
+ width = 0,
+ height = 0,
+ depth = 0,
+ italic = 0,
+ }
+ t[k] = v
+ return v
+ end)
+ local parameters = { }
+ local direction = 0
+ --
+ local lf, lh, bc, ec, nw, nh, nd, ni, nl, nk, ne, np
+ --
+ lf = readcardinal2(s)
+ if lf ~= 0 then
+ header = 6
+ max = 255
+ wide = false
+ lh = readcardinal2(s)
+ bc = readcardinal2(s)
+ ec = readcardinal2(s)
+ nw = readcardinal2(s)
+ nh = readcardinal2(s)
+ nd = readcardinal2(s)
+ ni = readcardinal2(s)
+ nl = readcardinal2(s)
+ nk = readcardinal2(s)
+ ne = readcardinal2(s)
+ np = readcardinal2(s)
+ else
+ header = 14
+ max = 65535
+ wide = readcardinal4(s) == 0
+ if not wide then
+ return someerror("invalid format")
+ end
+ lf = readcardinal4(s)
+ lh = readcardinal4(s)
+ bc = readcardinal4(s)
+ ec = readcardinal4(s)
+ nw = readcardinal4(s)
+ nh = readcardinal4(s)
+ nd = readcardinal4(s)
+ ni = readcardinal4(s)
+ nl = readcardinal4(s)
+ nk = readcardinal4(s)
+ ne = readcardinal4(s)
+ np = readcardinal4(s)
+ direction = readcardinal4(s)
+ end
+ if (bc > ec + 1) or (ec > max) then
+ return someerror("file is too small")
+ end
+ if bc > max then
+ bc, ec = 1, 0
+ end
+ local nlw = (wide and 2 or 1) * nl
+ local neew = (wide and 2 or 1) * ne
+ local ncw = (wide and 2 or 1) * (ec - bc + 1)
+ if lf ~= (header + lh + ncw + nw + nh + nd + ni + nlw + nk + neew + np) then
+ return someerror("file is too small")
+ end
+ if nw == 0 or nh == 0 or nd == 0 or ni == 0 then
+ return someerror("no glyphs")
+ end
+ if lf * 4 > size then
+ return someerror("file is too small")
+ end
+ local slh = lh
+ if lh < 2 then
+ return someerror("file is too small")
+ end
+ local checksum = readcardinal4(s)
+ local designsize = readcardinal2(s)
+ designsize = designsize * 256 + readcardinal1(s)
+ -- designsize = designsize * 16 + rshift(readcardinal1(s),4)
+ designsize = designsize * 16 + (readcardinal1(s) >> 4)
+ if designsize < 0xFFFF then
+ return someerror("weird designsize")
+ end
+ --
+ local alpha = 16
+ local z = designsize
+ while z >= 040000000 do
+ -- z = rshift(z,1)
+ z = (z >> 1) & 0xFFFFFFFF
+ alpha = alpha + alpha
+ end
+ local beta = 256 // alpha
+ alpha = alpha * z
+ --
+ local function readscaled()
+ local a, b, c, d = readbytes(s,4)
+ -- local n = idiv(rshift(rshift(d*z,8)+c*z,8)+b*z,beta)
+ local n = (((((((d * z) >> 8) & 0xFFFFFFFF) + c * z) >> 8) & 0xFFFFFFFF) + b * z) // beta
+ if a == 0 then
+ return n
+ elseif a == 255 then
+ return n - alpha
+ else
+ return 0
+ end
+ end
+ --
+ local function readunscaled()
+ local a, b, c, d = readbytes(s,4)
+ if a > 127 then
+ a = a - 256
+ end
+ -- return a * 0xFFFFF + b * 0xFFF + c * 0xF + rshift(d,4)
+ return a * 0xFFFFF + b * 0xFFF + c * 0xF + ((d >> 4) & 0xFFFFFFFF)
+ end
+ --
+ while lh > 2 do -- can be one-liner
+ skipbytes(s,4)
+ lh = lh - 1
+ end
+ local saved = getposition(s)
+ setposition(s,(header + slh + ncw) * 4 + 1)
+ local widths = { } for i=0,nw-1 do widths [i] = readscaled() end
+ local heights = { } for i=0,nh-1 do heights[i] = readscaled() end
+ local depths = { } for i=0,nd-1 do depths [i] = readscaled() end
+ local italics = { } for i=0,ni-1 do italics[i] = readscaled() end
+ if widths[0] ~= 0 or heights[0] ~= 0 or depths[0] ~= 0 then
+ return someerror("invalid dimensions")
+ end
+ --
+ local blabel = nl
+ local bchar = boundarychar
+ --
+ local ligatures = { }
+ if nl > 0 then
+ for i=0,nl-1 do
+ local a, b, c, d = readbytes(s,4)
+ ligatures[i] = {
+ skip = a,
+ nxt = b,
+ op = c,
+ rem = d,
+ }
+ if a > 128 then
+ if 256 * c + d >= nl then
+ return someerror("invalid ligature table")
+ end
+ if a == 255 and i == 0 then
+ bchar = b
+ end
+ else
+ if c < 128 then
+ -- whatever
+ elseif 256 * (c - 128) + d >= nk then
+ return someerror("invalid ligature table")
+ end
+ if (a < 128) and (i - 0 + a + 1 >= nl) then
+ return someerror("invalid ligature table")
+ end
+ end
+ if a == 255 then
+ blabel = 256 * c + d
+ end
+ end
+ end
+ local allkerns = { }
+ for i=0,nk-1 do
+ allkerns[i] = readscaled()
+ end
+ local extensibles = { }
+ for i=0,ne-1 do
+ extensibles[i] = wide and {
+ top = readcardinal2(s),
+ middle = readcardinal2(s),
+ bottom = readcardinal2(s),
+ extender = readcardinal2(s),
+ } or {
+ top = readcardinal1(s),
+ middle = readcardinal1(s),
+ bottom = readcardinal1(s),
+ extender = readcardinal1(s),
+ }
+ end
+ for i=1,np do
+ if i == 1 then
+ parameters[i] = readunscaled()
+ else
+ parameters[i] = readscaled()
+ end
+ end
+ for i=1,7 do
+ if not parameters[i] then
+ parameters[i] = 0
+ end
+ end
+ --
+ setposition(s,saved)
+ local extras = false
+ if blabel ~= nl then
+ local k = blabel
+ while true do
+ local l = ligatures[k]
+ local skip = l.skip
+ if skip <= 128 then
+ -- if l.op >= 128 then
+ -- extras = true -- kern
+ -- else
+ extras = true -- ligature
+ -- end
+ end
+ if skip == 0 then
+ k = k + 1
+ else
+ if skip >= 128 then
+ break
+ end
+ k = k + skip + 1
+ end
+ end
+ end
+ if extras then
+ local ligas = { }
+ local kerns = { }
+ local k = blabel
+ while true do
+ local l = ligatures[k]
+ local skip = l.skip
+ if skip <= 128 then
+ local nxt = l.nxt
+ local op = l.op
+ local rem = l.rem
+ if op >= 128 then
+ kerns[nxt] = allkerns[256 * (op - 128) + rem]
+ else
+ ligas[nxt] = { type = op * 2 + 1, char = rem }
+ end
+ end
+ if skip == 0 then
+ k = k + 1
+ else
+ if skip >= 128 then
+ break;
+ end
+ k = k + skip + 1
+ end
+ end
+ if next(kerns) then
+ local glyph = glyphs[leftboundary]
+ glyph.kerns = kerns
+ glyph.remainder = 0
+ end
+ if next(ligas) then
+ local glyph = glyphs[leftboundary]
+ glyph.ligatures = ligas
+ glyph.remainder = 0
+ end
+ end
+ for i=bc,ec do
+ local glyph, width, height, depth, italic, tag, remainder
+ if wide then
+ width = readcardinal2(s)
+ height = readcardinal1(s)
+ depth = readcardinal1(s)
+ italic = readcardinal1(s)
+ tag = readcardinal1(s)
+ remainder = readcardinal2(s)
+ else
+ width = readcardinal1(s)
+ height = readcardinal1(s)
+ -- depth = extract(height,0,4)
+ depth = height & 0xF
+ -- height = extract(height,4,4)
+ height = (height >> 4) & 0xF
+ italic = readcardinal1(s)
+ -- tag = extract(italic,0,2)
+ tag = italic & 0x03
+ -- italic = extract(italic,2,6)
+ italic = (italic >> 2) & 0xFF
+ remainder = readcardinal1(s)
+ end
+ if width == 0 then
+ -- nothing
+ else
+ if width >= nw or height >= nh or depth >= nd or italic >= ni then
+ return someerror("invalid dimension index")
+ end
+ local extensible, nextinsize
+ if tag == 0 then
+ -- nothing special
+ else
+ local r = remainder
+ if tag == 1 then
+ if r >= nl then
+ return someerror("invalid ligature index")
+ end
+ elseif tag == 2 then
+ if r < bc or r > ec then
+ return someerror("invalid chain index")
+ end
+ while r < i do
+ local g = glyphs[r]
+ if g.tag ~= list_tag then
+ break
+ end
+ r = g.remainder
+ end
+ if r == i then
+ return someerror("cycles in chain")
+ end
+ nextinsize = r
+ elseif tag == 3 then
+ if r >= ne then
+ return someerror("bad extensible")
+ end
+ extensible = extensibles[r] -- remainder ?
+ remainder = 0
+ end
+ end
+ local glyph = {
+ width = widths [width],
+ height = heights[height],
+ depth = depths [depth],
+ italic = italics[italic],
+ tag = tag,
+ -- index = i,
+ remainder = remainder,
+ extensible = extensible,
+ next = nextinsize,
+ }
+ if extensible then
+ extensible = toparts(extensible)
+ if extensible then
+ glyph.parts = extensible
+ glyph.partsorientation = "vertical"
+ glyph.partsitalic = glyph.italic
+ end
+ end
+ glyphs[i] = glyph
+ end
+ end
+ for i=bc,ec do
+ local glyph = glyphs[i]
+ if glyph.tag == 1 then
+ -- ligature
+ local k = glyph.remainder
+ local l = ligatures[k]
+ if l.skip > 128 then
+ k = 256 * l.op + l.rem
+ end
+ local ligas = { }
+ local kerns = { }
+ while true do
+ local l = ligatures[k]
+ local skip = l.skip
+ if skip <= 128 then
+ local nxt = l.nxt
+ local op = l.op
+ local rem = l.rem
+ if op >= 128 then
+ local kern = allkerns[256 * (op - 128) + rem]
+ if nxt == bchar then
+ kerns[rightboundary] = kern
+ end
+ kerns[nxt] = kern
+ else
+ local ligature = { type = op * 2 + 1, char = rem }
+ if nxt == bchar then
+ ligas[rightboundary] = ligature
+ end
+ ligas[nxt] = ligature -- shared
+ end
+ end
+ if skip == 0 then
+ k = k + 1
+ else
+ if skip >= 128 then
+ break
+ end
+ k = k + skip + 1
+ end
+ end
+ if next(kerns)then
+ glyph.kerns = kerns
+ glyph.remainder = 0
+ end
+ if next(ligas) then
+ glyph.ligatures = ligas
+ glyph.remainder = 0
+ end
+ end
+ end
+ --
+ if bchar ~= boundarychar then
+ glyphs[rightboundary] = copy(glyphs[bchar])
+ end
+ --
+ -- for k, v in next, glyphs do
+ -- v.tag = nil
+ -- v.remainder = nil
+ -- end
+ --
+ data = {
+ name = file.nameonly(filename),
+ fontarea = file.pathpart(filename),
+ glyphs = glyphs,
+ parameters = parameters,
+ designsize = designsize,
+ size = designsize,
+ direction = direction,
+ -- checksum = checksum,
+ -- embedding = "unknown",
+ -- extend = 1000,
+ -- slant = 0,
+ -- squeeze = 0,
+ -- format = "unknown",
+ -- identity = "unknown",
+ -- mode = 0,
+ -- streamprovider = 0,
+ -- tounicode = 0,
+ -- type = "unknown",
+ -- units_per_em = 0,
+ -- used = false,
+ -- width = 0,
+ -- writingmode = "unknown",
+ }
+ --
+ data.filesize = filesize
+ data.fileformat = fileformat
+ data.filetime = filetime
+ if caching then
+ containers.write(filecache,filehash,data)
+ end
+ --
+ return data
+ end
+
+end
+
+do
+
+ local pushcommand = fonts.helpers.commands.push
+ local popcommand = fonts.helpers.commands.pop
+ local slotcommand = fonts.helpers.commands.slot
+
+ local w, x, y, z, f
+ local stack
+ local s, result, r
+ local alpha, beta, z
+
+ local function scaled1()
+ local a = readbytes(s,1)
+ if a == 0 then
+ return 0
+ elseif a == 255 then
+ return - alpha
+ else
+ return 0 -- error
+ end
+ end
+
+ local function scaled2()
+ local a, b = readbytes(s,2)
+ local sw = (b*z) // beta
+ if a == 0 then
+ return sw
+ elseif a == 255 then
+ return sw - alpha
+ else
+ return 0 -- error
+ end
+ end
+
+ local function scaled3()
+ local a, b, c = readbytes(s,3)
+ -- local sw = idiv(rshift(c*z,8)+b*z,beta)
+ local sw = ((((c * z) >> 8) & 0xFFFFFFFF) + b * z) // beta
+ if a == 0 then
+ return sw
+ elseif a == 255 then
+ return sw - alpha
+ else
+ return 0 -- error
+ end
+ end
+
+ local function scaled4()
+ local a, b, c, d = readbytes(s,4)
+ -- local sw = idiv( rshift(rshift(d*z,8)+(c*z),8)+b*z,beta)
+ local sw = (((((d * z) >> 8) & 0xFFFFFFFF + (c * z)) >> 8) & 0xFFFFFFFF + b * z) // beta
+ if a == 0 then
+ return sw
+ elseif a == 255 then
+ return sw - alpha
+ else
+ return 0 -- error
+ end
+ end
+
+ local function dummy()
+ end
+
+ local actions = {
+
+ [128] = function() r = r + 1 result[r] = slotcommand[f or 1][readcardinal1(s)] p = p + 1 end,
+ [129] = function() r = r + 1 result[r] = slotcommand[f or 1][readcardinal2(s)] p = p + 2 end,
+ [130] = function() r = r + 1 result[r] = slotcommand[f or 1][readcardinal3(s)] p = p + 3 end,
+ [131] = function() r = r + 1 result[r] = slotcommand[f or 1][readcardinal4(s)] p = p + 4 end,
+
+ [132] = function()
+ r = r + 1
+ result[r] = { "rule", scaled4(), scaled4() }
+ p = p + 8
+ end,
+
+ [133] = function()
+ r = r + 1 result[r] = pushcommand
+ r = r + 1 result[r] = slotcommand[f or 1][readcardinal1(s)]
+ r = r + 1 result[r] = popcommand
+ p = p + 1
+ end,
+ [134] = function()
+ r = r + 1 result[r] = pushcommand
+ r = r + 1 result[r] = slotcommand[f or 1][readcardinal2(s)]
+ r = r + 1 result[r] = popcommand
+ p = p + 2
+ end,
+ [135] = function()
+ r = r + 1 result[r] = pushcommand
+ r = r + 1 result[r] = slotcommand[f or 1][readcardinal3(s)]
+ r = r + 1 result[r] = popcommand
+ p = p + 3
+ end,
+ [136] = function()
+ r = r + 1 result[r] = pushcommand
+ r = r + 1 result[r] = slotcommand[f or 1][readcardinal4(s)]
+ r = r + 1 result[r] = popcommand
+ p = p + 4
+ end,
+
+ [137] = function()
+ r = r + 1 result[r] = pushcommand
+ r = r + 1 result[r] = { "rule", scaled4(), scaled4() }
+ r = r + 1 result[r] = popcommand
+ p = p + 8
+ end,
+
+ [138] = dummy, -- nop
+ [139] = dummy, -- bop
+ [140] = dummy, -- eop
+
+ [141] = function()
+ insert(stack, { w, x, y, z })
+ r = r + 1
+ result[r] = pushcommand
+ end,
+ [142] = function()
+ local t = remove(stack)
+ if t then
+ w, x, y, z = t[1], t[2], t[3], t[4]
+ r = r + 1
+ result[r] = popcommand
+ end
+ end,
+
+ [143] = function() r = r + 1 result[r] = { "right", scaled1() } p = p + 1 end,
+ [144] = function() r = r + 1 result[r] = { "right", scaled2() } p = p + 2 end,
+ [145] = function() r = r + 1 result[r] = { "right", scaled3() } p = p + 3 end,
+ [146] = function() r = r + 1 result[r] = { "right", scaled4() } p = p + 4 end,
+
+ [148] = function() w = scaled1() r = r + 1 result[r] = { "right", w } p = p + 1 end,
+ [149] = function() w = scaled2() r = r + 1 result[r] = { "right", w } p = p + 2 end,
+ [150] = function() w = scaled3() r = r + 1 result[r] = { "right", w } p = p + 3 end,
+ [151] = function() w = scaled4() r = r + 1 result[r] = { "right", w } p = p + 4 end,
+
+ [153] = function() x = scaled1() r = r + 1 result[r] = { "right", x } p = p + 1 end,
+ [154] = function() x = scaled2() r = r + 1 result[r] = { "right", x } p = p + 2 end,
+ [155] = function() x = scaled3() r = r + 1 result[r] = { "right", x } p = p + 3 end,
+ [156] = function() x = scaled4() r = r + 1 result[r] = { "right", x } p = p + 4 end,
+
+ [157] = function() r = r + 1 result[r] = { "down", scaled1() } p = p + 1 end,
+ [158] = function() r = r + 1 result[r] = { "down", scaled2() } p = p + 2 end,
+ [159] = function() r = r + 1 result[r] = { "down", scaled3() } p = p + 3 end,
+ [160] = function() r = r + 1 result[r] = { "down", scaled4() } p = p + 4 end,
+
+ [162] = function() y = scaled1() r = r + 1 result[r] = { "down", y } p = p + 1 end,
+ [163] = function() y = scaled2() r = r + 1 result[r] = { "down", y } p = p + 2 end,
+ [164] = function() y = scaled3() r = r + 1 result[r] = { "down", y } p = p + 3 end,
+ [165] = function() y = scaled3() r = r + 1 result[r] = { "down", y } p = p + 4 end,
+
+ [167] = function() z = scaled1() r = r + 1 ; result[r] = { "down", z } p = p + 4 end,
+ [168] = function() z = scaled2() r = r + 1 ; result[r] = { "down", z } p = p + 4 end,
+ [169] = function() z = scaled3() r = r + 1 ; result[r] = { "down", z } p = p + 4 end,
+ [170] = function() z = scaled4() r = r + 1 ; result[r] = { "down", z } p = p + 4 end,
+
+ [147] = function() r = r + 1 result[r] = { "right", w } end,
+ [152] = function() r = r + 1 result[r] = { "right", x } end,
+ [161] = function() r = r + 1 result[r] = { "down", y } end,
+ [166] = function() r = r + 1 result[r] = { "down", z } end,
+
+ [235] = function() f = readcardinal1(s) p = p + 1 end,
+ [236] = function() f = readcardinal2(s) p = p + 3 end,
+ [237] = function() f = readcardinal3(s) p = p + 3 end,
+ [238] = function() f = readcardinal4(s) p = p + 4 end,
+
+ [239] = function() local n = readcardinal1(s) r = r + 1 result[r] = { "special", readstring(s,n) } p = p + 1 + n end,
+ [240] = function() local n = readcardinal2(s) r = r + 1 result[r] = { "special", readstring(s,n) } p = p + 2 + n end,
+ [241] = function() local n = readcardinal3(s) r = r + 1 result[r] = { "special", readstring(s,n) } p = p + 3 + n end,
+ [242] = function() local n = readcardinal4(s) r = r + 1 result[r] = { "special", readstring(s,n) } p = p + 4 + n end,
+
+ [250] = function() local n = readcardinal1(s) r = r + 1 result[r] = { "pdf", readstring(s,n) } p = p + 1 + n end,
+ [251] = function() local n = readcardinal2(s) r = r + 1 result[r] = { "pdf", readstring(s,n) } p = p + 2 + n end,
+ [252] = function() local n = readcardinal3(s) r = r + 1 result[r] = { "pdf", readstring(s,n) } p = p + 3 + n end,
+ [253] = function() local n = readcardinal4(s) r = r + 1 result[r] = { "pdf", readstring(s,n) } p = p + 4 + n end,
+
+ }
+
+ table.setmetatableindex(actions,function(t,cmd)
+ local v
+ if cmd >= 0 and cmd <= 127 then
+ v = function()
+ if f == 0 then
+ f = 1
+ end
+ r = r + 1 ; result[r] = slotcommand[f][cmd]
+ end
+ elseif cmd >= 171 and cmd <= 234 then
+ cmd = cmd - 170
+ v = function()
+ r = r + 1 ; result[r] = { "font", cmd }
+ end
+ else
+ v = dummy
+ end
+ t[cmd] = v
+ return v
+ end)
+
+ function readers.loadvf(filename,data)
+ --
+ local function someerror(m)
+ if not data then
+ data = { }
+ end
+ data.error = m or "fatal error"
+ return data
+ end
+ --
+ s = openstream(filename)
+ if not s then
+ return someerror()
+ end
+ --
+ local cmd = readcardinal1(s)
+ if cmd ~= 247 then
+ return someerror("bad preamble")
+ end
+ cmd = readcardinal1(s)
+ if cmd ~= 202 then
+ return someerror("bad version")
+ end
+ local header = readstring(s,readcardinal1(s))
+ local checksum = readcardinal4(s)
+ local designsize = readcardinal4(s) // 16
+ local fonts = data and data.fonts or { }
+ local glyphs = data and data.glyphs or { }
+ --
+ alpha = 16
+ z = designsize
+ while z >= 040000000 do
+ -- z = rshift(z,1)
+ z = (z >> 1) & 0xFFFFFFFF
+ alpha = alpha + alpha
+ end
+ beta = 256 // alpha
+ alpha = alpha * z
+ --
+ cmd = readcardinal1(s)
+ while true do
+ local n
+ if cmd == 243 then
+ n = readcardinal1(s) + 1
+ elseif cmd == 244 then
+ n = readcardinal2(s) + 1
+ elseif cmd == 245 then
+ n = readcardinal3(s) + 1
+ elseif cmd == 246 then
+ n = readcardinal4(s) + 1
+ else
+ break
+ end
+ local checksum = skipbytes(s,4)
+ local size = scaled4()
+ local designsize = readcardinal4(s) // 16
+ local pathlen = readcardinal1(s)
+ local namelen = readcardinal1(s)
+ local path = readstring(s,pathlen)
+ local name = readstring(s,namelen)
+ fonts[n] = { path = path, name = name, size = size }
+ cmd = readcardinal1(s)
+ end
+ local index = 0
+ while cmd and cmd <= 242 do
+ local width = 0
+ local length = 0
+ local checksum = 0
+ if cmd == 242 then
+ length = readcardinal4(s)
+ checksum = readcardinal4(s)
+ width = readcardinal4(s)
+ else
+ length = cmd
+ checksum = readcardinal1(s)
+ width = readcardinal3(s)
+ end
+ w, x, y, z, f = 0, 0, 0, 0, false
+ stack, result, r, p = { }, { }, 0, 0
+ while p < length do
+ local cmd = readcardinal1(s)
+ p = p + 1
+ actions[cmd]()
+ end
+ local glyph = glyphs[index]
+ if glyph then
+ glyph.width = width
+ glyph.commands = result
+ else
+ glyphs[index] = {
+ width = width,
+ commands = result,
+ }
+ end
+ index = index + 1
+ if #stack > 0 then
+ -- error: more pushes than pops
+ end
+ if packet_length ~= 0 then
+ -- error: invalid packet length
+ end
+ cmd = readcardinal1(s)
+ end
+ if readcardinal1(s) ~= 248 then
+ -- error: no post
+ end
+ s, result, r = nil, nil, nil
+ if data then
+ data.glyphs = data.glyphs or glyphs
+ data.fonts = data.fonts or fonts
+ return data
+ else
+ return {
+ name = file.nameonly(filename),
+ fontarea = file.pathpart(filename),
+ glyphs = glyphs,
+ designsize = designsize,
+ header = header,
+ fonts = fonts,
+ }
+ end
+ end
+
+ -- the replacement loader (not sparse):
+
+ function readers.loadtfmvf(tfmname,size)
+ local vfname = file.addsuffix(file.nameonly(tfmfile),"vf")
+ local tfmfile = tfmname
+ local vffile = resolvers.findbinfile(vfname,"ovf")
+ if tfmfile and tfmfile ~= "" then
+ if size < 0 then
+ size = (65536 * -size) // 100
+ end
+ local data = readers.loadtfm(tfmfile)
+ if data.error then
+ return data
+ end
+ if vffile and vffile ~= "" then
+ data = readers.loadvf(vffile,data)
+ if data.error then
+ return data
+ end
+ end
+ local designsize = data.designsize
+ local glyphs = data.glyphs
+ local parameters = data.parameters
+ local fonts = data.fonts
+ if size ~= designsize then
+ local factor = size / designsize
+ for index, glyph in next, glyphs do
+ if next(glyph) then
+ glyph.width = round(factor*glyph.width)
+ glyph.height = round(factor*glyph.height)
+ glyph.depth = round(factor*glyph.depth)
+ local italic = glyph.italic
+ if italic == 0 then
+ glyph.italic = nil
+ else
+ glyph.italic = round(factor*glyph.italic)
+ end
+ --
+ local kerns = glyph.kerns
+ if kerns then
+ for index, kern in next, kerns do
+ kerns[index] = round(factor*kern)
+ end
+ end
+ --
+ local commands = glyph.commands
+ if commands then
+ for i=1,#commands do
+ local c = commands[i]
+ local t = c[1]
+ if t == "down" or t == "right" then
+ c[2] = round(factor*c[2])
+ elseif t == "rule" then
+ c[2] = round(factor*c[2])
+ c[3] = round(factor*c[3])
+ end
+ end
+ end
+ else
+ glyphs[index] = nil
+ end
+ end
+ for i=2,30 do
+ local p = parameters[i]
+ if p then
+ parameters[i] = round(factor*p)
+ else
+ break
+ end
+ end
+ if fonts then
+ for k, v in next, fonts do
+ v.size = round(factor*v.size)
+ end
+ end
+ else
+ for index, glyph in next, glyphs do
+ if next(glyph) then
+ if glyph.italic == 0 then
+ glyph.italic = nil
+ end
+ else
+ glyphs[index] = nil
+ end
+ end
+ end
+ --
+ parameters.slant = parameters[1]
+ parameters.space = parameters[2]
+ parameters.spacestretch = parameters[3]
+ parameters.spaceshrink = parameters[4]
+ parameters.xheight = parameters[5]
+ parameters.quad = parameters[6]
+ parameters.extraspace = parameters[7]
+ --
+ for i=1,7 do
+ parameters[i] = nil -- so no danger for async
+ end
+ --
+ data.characters = glyphs
+ data.glyphs = nil
+ data.size = size
+ -- we assume type1 for now ... maybe the format should be unknown
+ data.filename = tfmfile -- file.replacesuffix(tfmfile,"pfb")
+ data.format = "unknown"
+ --
+ return data
+ end
+ end
+
+end
+
+-- inspect(readers.loadtfmvf(resolvers.findfile("mi-iwonari.tfm")))
+-- inspect(readers.loadtfm(resolvers.findfile("texnansi-palatinonova-regular.tfm")))
+-- inspect(readers.loadtfm(resolvers.findfile("cmex10.tfm")))
+-- inspect(readers.loadtfm(resolvers.findfile("cmr10.tfm")))
+-- local t = readers.loadtfmvf("texnansi-lte50019.tfm")
+-- inspect(t)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-ttf.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-ttf.lmt
new file mode 100644
index 00000000000..fa0e3c494bd
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-ttf.lmt
@@ -0,0 +1,1496 @@
+if not modules then modules = { } end modules ['font-ttf'] = {
+ version = 1.001,
+ optimize = true,
+ comment = "companion to font-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- This version is different from previous in the sense that we no longer store
+-- contours but keep points and contours (endpoints) separate for a while
+-- because later on we need to apply deltas and that is easier on a list of
+-- points.
+
+-- The code is a bit messy. I looked at the ff code but it's messy too. It has
+-- to do with the fact that we need to look at points on the curve and control
+-- points in between. This also means that we start at point 2 and have to look
+-- at point 1 when we're at the end. We still use a ps like storage with the
+-- operator last in an entry. It's typical code that evolves stepwise till a
+-- point of no comprehension.
+
+-- For deltas we need a rather complex loop over points that can have holes and
+-- be less than nofpoints and even can have duplicates and also the x and y value
+-- lists can be shorter than etc. I need fonts in order to complete this simply
+-- because I need to visualize in order to understand (what the standard tries
+-- to explain).
+
+-- 0 point then none applied
+-- 1 points then applied to all
+-- otherwise inferred deltas using nearest
+-- if no lower point then use highest referenced point
+-- if no higher point then use lowest referenced point
+-- factor = (target-left)/(right-left)
+-- delta = (1-factor)*left + factor * right
+
+local next, type, unpack = next, type, unpack
+----- band, rshift = bit32.band, bit32.rshift
+local sqrt, round, abs, min, max = math.sqrt, math.round, math.abs, math.min, math.max
+local char, rep = string.char, string.rep
+local concat = table.concat
+local setmetatableindex = table.setmetatableindex
+
+local report = logs.reporter("otf reader","ttf")
+
+local trace_deltas = false
+
+local readers = fonts.handlers.otf.readers
+local streamreader = readers.streamreader
+
+local setposition = streamreader.setposition
+local getposition = streamreader.getposition
+local skipbytes = streamreader.skip
+local readbyte = streamreader.readcardinal1 -- 8-bit unsigned integer
+local readushort = streamreader.readcardinal2 -- 16-bit unsigned integer
+local readulong = streamreader.readcardinal4 -- 24-bit unsigned integer
+local readchar = streamreader.readinteger1 -- 8-bit signed integer
+local readshort = streamreader.readinteger2 -- 16-bit signed integer
+local read2dot14 = streamreader.read2dot14 -- 16-bit signed fixed number with the low 14 bits of fraction (2.14) (F2DOT14)
+local readinteger = streamreader.readinteger1
+local readcardinaltable = streamreader.readcardinaltable
+local readintegertable = streamreader.readintegertable
+
+directives.register("fonts.streamreader",function()
+
+ streamreader = utilities.streams
+
+ setposition = streamreader.setposition
+ getposition = streamreader.getposition
+ skipbytes = streamreader.skip
+ readbyte = streamreader.readcardinal1
+ readushort = streamreader.readcardinal2
+ readulong = streamreader.readcardinal4
+ readchar = streamreader.readinteger1
+ readshort = streamreader.readinteger2
+ read2dot14 = streamreader.read2dot14
+ readinteger = streamreader.readinteger1
+ readcardinaltable = streamreader.readcardinaltable
+ readintegertable = streamreader.readintegertable
+
+end)
+
+local short = 2
+local ushort = 2
+local ulong = 4
+
+local helpers = readers.helpers
+local gotodatatable = helpers.gotodatatable
+
+local function mergecomposites(glyphs,shapes)
+
+ -- todo : deltas
+
+ local function merge(index,shape,components)
+ local contours = { }
+ local points = { }
+ local nofcontours = 0
+ local nofpoints = 0
+ local offset = 0
+ local deltas = shape.deltas
+ for i=1,#components do
+ local component = components[i]
+ local subindex = component.index
+ local subshape = shapes[subindex]
+ local subcontours = subshape.contours
+ local subpoints = subshape.points
+ if not subcontours then
+ local subcomponents = subshape.components
+ if subcomponents then
+ subcontours, subpoints = merge(subindex,subshape,subcomponents)
+ end
+ end
+ if subpoints then
+ local matrix = component.matrix
+ local xscale = matrix[1]
+ local xrotate = matrix[2]
+ local yrotate = matrix[3]
+ local yscale = matrix[4]
+ local xoffset = matrix[5]
+ local yoffset = matrix[6]
+ local count = #subpoints
+ if xscale == 1 and yscale == 1 and xrotate == 0 and yrotate == 0 then
+ for i=1,count do
+ local p = subpoints[i]
+ nofpoints = nofpoints + 1
+ points[nofpoints] = {
+ p[1] + xoffset,
+ p[2] + yoffset,
+ p[3]
+ }
+ end
+ else
+ for i=1,count do
+ local p = subpoints[i]
+ local x = p[1]
+ local y = p[2]
+ nofpoints = nofpoints + 1
+ points[nofpoints] = {
+ -- unifractur : u n
+ -- seguiemj : 0x270E 0x2710
+ xscale * x + xrotate * y + xoffset,
+ yscale * y + yrotate * x + yoffset,
+-- xscale * x + yrotate * y + xoffset,
+-- xrotate * x + yscale * y + yoffset,
+ p[3]
+ }
+ end
+ end
+ local subcount = #subcontours
+ if subcount == 1 then
+ nofcontours = nofcontours + 1
+ contours[nofcontours] = offset + subcontours[1]
+ else
+ for i=1,#subcontours do
+ nofcontours = nofcontours + 1
+ contours[nofcontours] = offset + subcontours[i]
+ end
+ end
+ offset = offset + count
+ else
+ report("missing contours composite %s, component %s of %s, glyph %s",index,i,#components,subindex)
+ end
+ end
+ shape.points = points -- todo : phantom points
+ shape.contours = contours
+ shape.components = nil
+ return contours, points
+ end
+
+ for index=0,#glyphs do
+ local shape = shapes[index]
+ if shape then
+ local components = shape.components
+ if components then
+ merge(index,shape,components)
+ end
+ end
+ end
+
+end
+
+local function readnothing(f)
+ return {
+ type = "nothing",
+ }
+end
+
+-- begin of converter
+
+local function curveto(m_x,m_y,l_x,l_y,r_x,r_y) -- todo: inline this
+ return
+ l_x + 2/3 *(m_x-l_x), l_y + 2/3 *(m_y-l_y),
+ r_x + 2/3 *(m_x-r_x), r_y + 2/3 *(m_y-r_y),
+ r_x, r_y, "c"
+end
+
+-- We could omit the operator which saves some 10%:
+--
+-- #2=lineto #4=quadratic #6=cubic #3=moveto (with "m")
+--
+-- This is tricky ... something to do with phantom points .. however, the hvar
+-- and vvar tables should take care of the width .. the test font doesn't have
+-- those so here we go then (we need a flag for hvar).
+--
+-- h-advance left-side-bearing v-advance top-side-bearing
+--
+-- We had two loops (going backward) but can do it in one loop .. but maybe we
+-- should only accept fonts with proper hvar tables.
+
+-- dowidth is kind of hack ... fonts are not always ok wrt these extra points
+
+local xv = { } -- we share this cache
+local yv = { } -- we share this cache
+
+local function applyaxis(glyph,shape,deltas,dowidth)
+ local points = shape.points
+ if points then
+ local nofpoints = #points
+ local dw = 0
+ local dl = 0
+ for i=1,#deltas do
+ local deltaset = deltas[i]
+ local xvalues = deltaset.xvalues
+ local yvalues = deltaset.yvalues
+ if xvalues and yvalues then
+ local dpoints = deltaset.points
+ local factor = deltaset.factor
+ if dpoints then
+ local cnt = #dpoints
+ if dowidth then
+ cnt = cnt - 4
+ end
+ if cnt > 0 then
+ -- Not the most efficient solution but we seldom do this. We
+ -- actually need to avoid the extra points here but I'll deal
+ -- with that when needed.
+ local contours = shape.contours
+ local nofcontours = #contours
+ local first = 1
+ local firstindex = 1
+ for contour=1,nofcontours do
+ local last = contours[contour]
+ if last >= first then
+ local lastindex = cnt
+ if firstindex < cnt then
+ for currentindex=firstindex,cnt do
+ local found = dpoints[currentindex]
+ if found <= first then
+ firstindex = currentindex
+ end
+ if found == last then
+ lastindex = currentindex
+ break
+ elseif found > last then
+ -- \definefontfeature[book][default][axis={weight=800}]
+ -- \definefont[testfont][file:Commissioner-vf-test.ttf*book]
+ -- \testfont EΘÄΞ
+ while lastindex > 1 and dpoints[lastindex] > last do
+ lastindex = lastindex - 1
+ end
+ --
+ break
+ end
+ end
+ end
+ -- print("unicode: ",glyph.unicode or "?")
+ -- print("contour: ",first,contour,last)
+ -- print("index : ",firstindex,lastindex,cnt)
+ -- print("points : ",dpoints[firstindex],dpoints[lastindex])
+ local function find(i)
+ local prv = lastindex
+ for j=firstindex,lastindex do
+ local nxt = dpoints[j] -- we could save this lookup when we return it
+ if nxt == i then
+ return false, j, false
+ elseif nxt > i then
+ return prv, false, j
+ end
+ prv = j
+ end
+ return prv, false, firstindex
+ end
+ -- We need the first and last points untouched so we first
+ -- collect data.
+ for point=first,last do
+ local d1, d2, d3 = find(point)
+ local p2 = points[point]
+ if d2 then
+ xv[point] = xvalues[d2]
+ yv[point] = yvalues[d2]
+ else
+ local n1 = dpoints[d1]
+ local n3 = dpoints[d3]
+ -- Some day I need to figure out these extra points but
+ -- I'll wait till the standard is more clear and fonts
+ -- become better (ntg-context: fraunces.ttf > abcdef).
+ if n1 > nofpoints then
+ n1 = nofpoints
+ end
+ if n3 > nofpoints then
+ n3 = nofpoints
+ end
+ --
+ local p1 = points[n1]
+ local p3 = points[n3]
+ local p1x = p1[1]
+ local p2x = p2[1]
+ local p3x = p3[1]
+ local p1y = p1[2]
+ local p2y = p2[2]
+ local p3y = p3[2]
+ local x1 = xvalues[d1]
+ local y1 = yvalues[d1]
+ local x3 = xvalues[d3]
+ local y3 = yvalues[d3]
+ --
+ local fx
+ local fy
+ --
+ if p1x == p3x then
+ if x1 == x3 then
+ fx = x1
+ else
+ fx = 0
+ end
+ elseif p2x <= min(p1x,p3x) then
+ if p1x < p3x then
+ fx = x1
+ else
+ fx = x3
+ end
+ elseif p2x >= max(p1x,p3x) then
+ if p1x > p3x then
+ fx = x1
+ else
+ fx = x3
+ end
+ else
+ fx = (p2x - p1x)/(p3x - p1x)
+-- fx = round(fx)
+ fx = (1 - fx) * x1 + fx * x3
+ end
+ --
+ if p1y == p3y then
+ if y1 == y3 then
+ fy = y1
+ else
+ fy = 0
+ end
+ elseif p2y <= min(p1y,p3y) then
+ if p1y < p3y then
+ fy = y1
+ else
+ fy = y3
+ end
+ elseif p2y >= max(p1y,p3y) then
+ if p1y > p3y then
+ fy = y1
+ else
+ fy = y3
+ end
+ else
+ fy = (p2y - p1y)/(p3y - p1y)
+-- fy = round(fy)
+ fy = (1 - fy) * y1 + fy * y3
+ end
+ -- -- maybe:
+ -- if p1y ~= p3y then
+ -- fy = (p2y - p1y)/(p3y - p1y)
+ -- fy = (1 - fy) * y1 + fy * y3
+ -- elseif abs(p1y-p2y) < abs(p3y-p2y) then
+ -- fy = y1
+ -- else
+ -- fy = y3
+ -- end
+ --
+ xv[point] = fx
+ yv[point] = fy
+ end
+ end
+ if lastindex < cnt then
+ firstindex = lastindex + 1
+ end
+ end
+ first = last + 1
+ end
+
+ for i=1,nofpoints do
+ local pi = points[i]
+ local fx = xv[i]
+ local fy = yv[i]
+ if fx ~= 0 then
+ pi[1] = pi[1] + factor * fx
+ end
+ if fy ~= 0 then
+ pi[2] = pi[2] + factor * fy
+ end
+ end
+ else
+ report("bad deltapoint data, maybe a missing hvar table")
+ end
+ else
+ for i=1,nofpoints do
+ local p = points[i]
+ local x = xvalues[i]
+ if x then
+ local y = yvalues[i]
+ if x ~= 0 then
+ p[1] = p[1] + factor * x
+ end
+ if y ~= 0 then
+ p[2] = p[2] + factor * y
+ end
+ else
+ break
+ end
+ end
+ end
+ if dowidth then
+ local h = nofpoints + 2 -- weird, the example font seems to have left first
+ local l = nofpoints + 1
+ ----- v = nofpoints + 3
+ ----- t = nofpoints + 4
+ local x = xvalues[h]
+ if x then
+ dw = dw + factor * x
+ end
+ local x = xvalues[l]
+ if x then
+ dl = dl + factor * x
+ end
+ end
+ end
+ end
+ -- for i=1,nofpoints do
+ -- local p = points[i]
+ -- p[1] = round(p[1])
+ -- p[2] = round(p[2])
+ -- end
+ if dowidth then
+ local width = glyph.width or 0
+ -- local lsb = glyph.lsb or 0
+ glyph.width = width + dw - dl
+ end
+ else
+ report("no points for glyph %a",glyph.name)
+ end
+end
+
+-- round or not ?
+
+-- local quadratic = true -- both methods work, todo: install a directive
+local quadratic = false
+
+local function contours2outlines_normal(glyphs,shapes) -- maybe accept the bbox overhead
+-- for index=1,#glyphs do
+ for index=0,#glyphs-1 do
+ local shape = shapes[index]
+ if shape then
+ local glyph = glyphs[index]
+ local contours = shape.contours
+ local points = shape.points
+ if contours then
+ local nofcontours = #contours
+ local segments = { }
+ local nofsegments = 0
+ glyph.segments = segments
+ if nofcontours > 0 then
+ local px = 0
+ local py = 0
+ local first = 1
+ for i=1,nofcontours do
+ local last = contours[i]
+ if last >= first then
+ local first_pt = points[first]
+ local first_on = first_pt[3]
+ -- todo no new tables but reuse lineto and quadratic
+ if first == last then
+ first_pt[3] = "m" -- "moveto"
+ nofsegments = nofsegments + 1
+ segments[nofsegments] = first_pt
+ else -- maybe also treat n == 2 special
+ local first_on = first_pt[3]
+ local last_pt = points[last]
+ local last_on = last_pt[3]
+ local start = 1
+ local control_pt = false
+ if first_on then
+ start = 2
+ else
+ if last_on then
+ first_pt = last_pt
+ else
+ first_pt = { (first_pt[1]+last_pt[1])/2, (first_pt[2]+last_pt[2])/2, false }
+ end
+ control_pt = first_pt
+ end
+ local x = first_pt[1]
+ local y = first_pt[2]
+ if not done then
+ xmin = x
+ ymin = y
+ xmax = x
+ ymax = y
+ done = true
+ end
+ nofsegments = nofsegments + 1
+ segments[nofsegments] = { x, y, "m" } -- "moveto"
+ if not quadratic then
+ px = x
+ py = y
+ end
+ local previous_pt = first_pt
+ for i=first,last do
+ local current_pt = points[i]
+ local current_on = current_pt[3]
+ local previous_on = previous_pt[3]
+ if previous_on then
+ if current_on then
+ -- both normal points
+ local x, y = current_pt[1], current_pt[2]
+ nofsegments = nofsegments + 1
+ segments[nofsegments] = { x, y, "l" } -- "lineto"
+ if not quadratic then
+ px, py = x, y
+ end
+ else
+ control_pt = current_pt
+ end
+ elseif current_on then
+ local x1 = control_pt[1]
+ local y1 = control_pt[2]
+ local x2 = current_pt[1]
+ local y2 = current_pt[2]
+ nofsegments = nofsegments + 1
+ if quadratic then
+ segments[nofsegments] = { x1, y1, x2, y2, "q" } -- "quadraticto"
+ else
+ x1, y1, x2, y2, px, py = curveto(x1, y1, px, py, x2, y2)
+ segments[nofsegments] = { x1, y1, x2, y2, px, py, "c" } -- "curveto"
+ end
+ control_pt = false
+ else
+ local x2 = (previous_pt[1]+current_pt[1])/2
+ local y2 = (previous_pt[2]+current_pt[2])/2
+ local x1 = control_pt[1]
+ local y1 = control_pt[2]
+ nofsegments = nofsegments + 1
+ if quadratic then
+ segments[nofsegments] = { x1, y1, x2, y2, "q" } -- "quadraticto"
+ else
+ x1, y1, x2, y2, px, py = curveto(x1, y1, px, py, x2, y2)
+ segments[nofsegments] = { x1, y1, x2, y2, px, py, "c" } -- "curveto"
+ end
+ control_pt = current_pt
+ end
+ previous_pt = current_pt
+ end
+ if first_pt == last_pt then
+ -- we're already done, probably a simple curve
+ else
+ nofsegments = nofsegments + 1
+ local x2 = first_pt[1]
+ local y2 = first_pt[2]
+ if not control_pt then
+ segments[nofsegments] = { x2, y2, "l" } -- "lineto"
+ elseif quadratic then
+ local x1 = control_pt[1]
+ local y1 = control_pt[2]
+ segments[nofsegments] = { x1, y1, x2, y2, "q" } -- "quadraticto"
+ else
+ local x1 = control_pt[1]
+ local y1 = control_pt[2]
+ x1, y1, x2, y2, px, py = curveto(x1, y1, px, py, x2, y2)
+ segments[nofsegments] = { x1, y1, x2, y2, px, py, "c" } -- "curveto"
+ -- px, py = x2, y2
+ end
+ end
+ end
+ end
+ first = last + 1
+ end
+ end
+ end
+ end
+ end
+end
+
+local function contours2outlines_shaped(glyphs,shapes,keepcurve)
+-- for index=1,#glyphs do
+ for index=0,#glyphs-1 do
+ local shape = shapes[index]
+ if shape then
+ local glyph = glyphs[index]
+ local contours = shape.contours
+ local points = shape.points
+ if contours then
+ local nofcontours = #contours
+ local segments = keepcurve and { } or nil
+ local nofsegments = 0
+ if keepcurve then
+ glyph.segments = segments
+ end
+ if nofcontours > 0 then
+ local xmin, ymin, xmax, ymax, done = 0, 0, 0, 0, false
+ local px, py = 0, 0 -- we could use these in calculations which saves a copy
+ local first = 1
+ for i=1,nofcontours do
+ local last = contours[i]
+ if last >= first then
+ local first_pt = points[first]
+ local first_on = first_pt[3]
+ -- todo no new tables but reuse lineto and quadratic
+ if first == last then
+ -- this can influence the boundingbox
+ if keepcurve then
+ first_pt[3] = "m" -- "moveto"
+ nofsegments = nofsegments + 1
+ segments[nofsegments] = first_pt
+ end
+ else -- maybe also treat n == 2 special
+ local first_on = first_pt[3]
+ local last_pt = points[last]
+ local last_on = last_pt[3]
+ local start = 1
+ local control_pt = false
+ if first_on then
+ start = 2
+ else
+ if last_on then
+ first_pt = last_pt
+ else
+ first_pt = { (first_pt[1]+last_pt[1])/2, (first_pt[2]+last_pt[2])/2, false }
+ end
+ control_pt = first_pt
+ end
+ local x = first_pt[1]
+ local y = first_pt[2]
+ if not done then
+ xmin, ymin, xmax, ymax = x, y, x, y
+ done = true
+ else
+ if x < xmin then xmin = x elseif x > xmax then xmax = x end
+ if y < ymin then ymin = y elseif y > ymax then ymax = y end
+ end
+ if keepcurve then
+ nofsegments = nofsegments + 1
+ segments[nofsegments] = { x, y, "m" } -- "moveto"
+ end
+ if not quadratic then
+ px = x
+ py = y
+ end
+ local previous_pt = first_pt
+ for i=first,last do
+ local current_pt = points[i]
+ local current_on = current_pt[3]
+ local previous_on = previous_pt[3]
+ if previous_on then
+ if current_on then
+ -- both normal points
+ local x = current_pt[1]
+ local y = current_pt[2]
+ if x < xmin then xmin = x elseif x > xmax then xmax = x end
+ if y < ymin then ymin = y elseif y > ymax then ymax = y end
+ if keepcurve then
+ nofsegments = nofsegments + 1
+ segments[nofsegments] = { x, y, "l" } -- "lineto"
+ end
+ if not quadratic then
+ px = x
+ py = y
+ end
+ else
+ control_pt = current_pt
+ end
+ elseif current_on then
+ local x1 = control_pt[1]
+ local y1 = control_pt[2]
+ local x2 = current_pt[1]
+ local y2 = current_pt[2]
+ if quadratic then
+ if x1 < xmin then xmin = x1 elseif x1 > xmax then xmax = x1 end
+ if y1 < ymin then ymin = y1 elseif y1 > ymax then ymax = y1 end
+ if keepcurve then
+ nofsegments = nofsegments + 1
+ segments[nofsegments] = { x1, y1, x2, y2, "q" } -- "quadraticto"
+ end
+ else
+ x1, y1, x2, y2, px, py = curveto(x1, y1, px, py, x2, y2)
+ if x1 < xmin then xmin = x1 elseif x1 > xmax then xmax = x1 end
+ if y1 < ymin then ymin = y1 elseif y1 > ymax then ymax = y1 end
+ if x2 < xmin then xmin = x2 elseif x2 > xmax then xmax = x2 end
+ if y2 < ymin then ymin = y2 elseif y2 > ymax then ymax = y2 end
+ if px < xmin then xmin = px elseif px > xmax then xmax = px end
+ if py < ymin then ymin = py elseif py > ymax then ymax = py end
+ if keepcurve then
+ nofsegments = nofsegments + 1
+ segments[nofsegments] = { x1, y1, x2, y2, px, py, "c" } -- "curveto"
+ end
+ end
+ control_pt = false
+ else
+ local x2 = (previous_pt[1]+current_pt[1])/2
+ local y2 = (previous_pt[2]+current_pt[2])/2
+ local x1 = control_pt[1]
+ local y1 = control_pt[2]
+ if quadratic then
+ if x1 < xmin then xmin = x1 elseif x1 > xmax then xmax = x1 end
+ if y1 < ymin then ymin = y1 elseif y1 > ymax then ymax = y1 end
+ if keepcurve then
+ nofsegments = nofsegments + 1
+ segments[nofsegments] = { x1, y1, x2, y2, "q" } -- "quadraticto"
+ end
+ else
+ x1, y1, x2, y2, px, py = curveto(x1, y1, px, py, x2, y2)
+ if x1 < xmin then xmin = x1 elseif x1 > xmax then xmax = x1 end
+ if y1 < ymin then ymin = y1 elseif y1 > ymax then ymax = y1 end
+ if x2 < xmin then xmin = x2 elseif x2 > xmax then xmax = x2 end
+ if y2 < ymin then ymin = y2 elseif y2 > ymax then ymax = y2 end
+ if px < xmin then xmin = px elseif px > xmax then xmax = px end
+ if py < ymin then ymin = py elseif py > ymax then ymax = py end
+ if keepcurve then
+ nofsegments = nofsegments + 1
+ segments[nofsegments] = { x1, y1, x2, y2, px, py, "c" } -- "curveto"
+ end
+ end
+ control_pt = current_pt
+ end
+ previous_pt = current_pt
+ end
+ if first_pt == last_pt then
+ -- we're already done, probably a simple curve
+ elseif not control_pt then
+ if keepcurve then
+ nofsegments = nofsegments + 1
+ segments[nofsegments] = { first_pt[1], first_pt[2], "l" } -- "lineto"
+ end
+ else
+ local x1 = control_pt[1]
+ local y1 = control_pt[2]
+ local x2 = first_pt[1]
+ local y2 = first_pt[2]
+ if x1 < xmin then xmin = x1 elseif x1 > xmax then xmax = x1 end
+ if y1 < ymin then ymin = y1 elseif y1 > ymax then ymax = y1 end
+ if quadratic then
+ if keepcurve then
+ nofsegments = nofsegments + 1
+ segments[nofsegments] = { x1, y1, x2, y2, "q" } -- "quadraticto"
+ end
+ else
+ x1, y1, x2, y2, px, py = curveto(x1, y1, px, py, x2, y2)
+ if x2 < xmin then xmin = x2 elseif x2 > xmax then xmax = x2 end
+ if y2 < ymin then ymin = y2 elseif y2 > ymax then ymax = y2 end
+ if px < xmin then xmin = px elseif px > xmax then xmax = px end
+ if py < ymin then ymin = py elseif py > ymax then ymax = py end
+ if keepcurve then
+ nofsegments = nofsegments + 1
+ segments[nofsegments] = { x1, y1, x2, y2, px, py, "c" } -- "curveto"
+ end
+ -- px, py = x2, y2
+ end
+ end
+ end
+ end
+ first = last + 1
+ end
+ -- See readers.hvar where we set the delta lsb as well as the adapted
+ -- width. At this point we do know the boundingbox's llx. The xmax is
+ -- not that relevant. It needs more testing!
+ --
+ xmin = glyph.boundingbox[1]
+ --
+ local dlsb = glyph.dlsb
+ if dlsb then
+ xmin = xmin + dlsb
+ glyph.dlsb = nil -- save space
+ end
+ --
+ glyph.boundingbox = { round(xmin), round(ymin), round(xmax), round(ymax) }
+ end
+ end
+ end
+ end
+end
+
+-- optimize for zero
+
+local c_zero = char(0)
+local s_zero = char(0,0)
+
+-- local shorthash = setmetatableindex(function(t,k)
+-- -- t[k] = char(band(rshift(k,8),0xFF),band(k,0xFF)) return t[k]
+-- t[k] = char((k >> 8) & 0xFF,k & 0xFF) return t[k]
+-- end)
+
+local function toushort(n)
+ -- return char(band(rshift(n,8),0xFF),band(n,0xFF))
+ return char((n >> 8) & 0xFF,n & 0xFF)
+ -- return shorthash[n]
+end
+
+local function toshort(n)
+ if n < 0 then
+ n = n + 0x10000
+ end
+ -- return char(band(rshift(n,8),0xFF),band(n,0xFF))
+ return char((n >> 8) & 0xFF,n & 0xFF)
+ -- return shorthash[n]
+end
+
+-- todo: we can reuse result, xpoints and ypoints
+
+local chars = setmetatableindex(function(t,k)
+ for i=0,255 do local v = char(i) t[i] = v end return t[k]
+end)
+
+local function repackpoints(glyphs,shapes)
+ local noboundingbox = { 0, 0, 0, 0 }
+ local result = { } -- reused
+ local xpoints = { } -- reused
+ local ypoints = { } -- reused
+ for index=0,#glyphs do
+ local shape = shapes[index]
+ if shape then
+ local r = 0
+ local glyph = glyphs[index]
+ local contours = shape.contours
+ local nofcontours = contours and #contours or 0
+ local boundingbox = glyph.boundingbox or noboundingbox
+ r = r + 1 result[r] = toshort(nofcontours)
+ r = r + 1 result[r] = toshort(boundingbox[1]) -- xmin
+ r = r + 1 result[r] = toshort(boundingbox[2]) -- ymin
+ r = r + 1 result[r] = toshort(boundingbox[3]) -- xmax
+ r = r + 1 result[r] = toshort(boundingbox[4]) -- ymax
+ if nofcontours > 0 then
+ for i=1,nofcontours do
+ r = r + 1 result[r] = toshort(contours[i]-1)
+ end
+ r = r + 1 result[r] = s_zero -- no instructions
+ local points = shape.points
+ local currentx = 0
+ local currenty = 0
+ -- local xpoints = { }
+ -- local ypoints = { }
+ local x = 0
+ local y = 0
+ local lastflag = nil
+ local nofflags = 0
+ for i=1,#points do
+ local pt = points[i]
+ local px = pt[1]
+ local py = pt[2]
+ local fl = pt[3] and 0x01 or 0x00
+ if px == currentx then
+ fl = fl + 0x10
+ else
+ local dx = round(px - currentx)
+ x = x + 1
+ if dx < -255 or dx > 255 then
+ xpoints[x] = toshort(dx)
+ elseif dx < 0 then
+ fl = fl + 0x02
+ -- xpoints[x] = char(-dx)
+ xpoints[x] = chars[-dx]
+ elseif dx > 0 then
+ fl = fl + 0x12
+ -- xpoints[x] = char(dx)
+ xpoints[x] = chars[dx]
+ else
+ fl = fl + 0x02
+ xpoints[x] = c_zero
+ end
+ end
+ if py == currenty then
+ fl = fl + 0x20
+ else
+ local dy = round(py - currenty)
+ y = y + 1
+ if dy < -255 or dy > 255 then
+ ypoints[y] = toshort(dy)
+ elseif dy < 0 then
+ fl = fl + 0x04
+ -- ypoints[y] = char(-dy)
+ ypoints[y] = chars[-dy]
+ elseif dy > 0 then
+ fl = fl + 0x24
+ -- ypoints[y] = char(dy)
+ ypoints[y] = chars[dy]
+ else
+ fl = fl + 0x04
+ ypoints[y] = c_zero
+ end
+ end
+ currentx = px
+ currenty = py
+ if lastflag == fl then
+ if nofflags == 255 then
+ -- This happens in koeieletters!
+ lastflag = lastflag + 0x08
+ r = r + 1 result[r] = char(lastflag,nofflags-1)
+ nofflags = 1
+ lastflag = fl
+ else
+ nofflags = nofflags + 1
+ end
+ else -- if > 255
+ if nofflags == 1 then
+ -- r = r + 1 result[r] = char(lastflag)
+ r = r + 1 result[r] = chars[lastflag]
+ elseif nofflags == 2 then
+ r = r + 1 result[r] = char(lastflag,lastflag)
+ elseif nofflags > 2 then
+ lastflag = lastflag + 0x08
+ r = r + 1 result[r] = char(lastflag,nofflags-1)
+ end
+ nofflags = 1
+ lastflag = fl
+ end
+ end
+ if nofflags == 1 then
+ -- r = r + 1 result[r] = char(lastflag)
+ r = r + 1 result[r] = chars[lastflag]
+ elseif nofflags == 2 then
+ r = r + 1 result[r] = char(lastflag,lastflag)
+ elseif nofflags > 2 then
+ lastflag = lastflag + 0x08
+ r = r + 1 result[r] = char(lastflag,nofflags-1)
+ end
+ -- r = r + 1 result[r] = concat(xpoints)
+ -- r = r + 1 result[r] = concat(ypoints)
+ r = r + 1 result[r] = concat(xpoints,"",1,x)
+ r = r + 1 result[r] = concat(ypoints,"",1,y)
+ end
+ -- can be helper or delegated to user
+ local stream = concat(result,"",1,r)
+ local length = #stream
+ local padding = ((length+3) // 4) * 4 - length
+ if padding > 0 then
+ -- stream = stream .. rep("\0",padding) -- can be a repeater
+ if padding == 1 then
+ padding = "\0"
+ elseif padding == 2 then
+ padding = "\0\0"
+ else
+ padding = "\0\0\0"
+ end
+ padding = stream .. padding
+ end
+ glyph.stream = stream
+ end
+ end
+end
+
+-- end of converter
+
+local flags = { }
+
+local function readglyph(f,nofcontours) -- read deltas here, saves space
+ local points = { }
+ -- local instructions = { }
+ local contours = { } -- readintegertable(f,nofcontours,short)
+ for i=1,nofcontours do
+ contours[i] = readshort(f) + 1
+ end
+ local nofpoints = contours[nofcontours]
+ local nofinstructions = readushort(f)
+ skipbytes(f,nofinstructions)
+ -- because flags can repeat we don't know the amount ... in fact this is
+ -- not that efficient (small files but more mem)
+ local i = 1
+ while i <= nofpoints do
+ local flag = readbyte(f)
+ flags[i] = flag
+ if (flag & 0x08) ~= 0 then
+ local n = readbyte(f)
+ if n == 1 then
+ i = i + 1
+ flags[i] = flag
+ else
+ for j=1,n do
+ i = i + 1
+ flags[i] = flag
+ end
+ end
+ end
+ i = i + 1
+ end
+ -- first come the x coordinates, and next the y coordinates and they
+ -- can be repeated
+ local x = 0
+ for i=1,nofpoints do
+ local flag = flags[i]
+ -- local short = (flag & 0x02) ~= 0
+ -- local same = (flag & 0x10) ~= 0
+ if (flag & 0x02) ~= 0 then
+ if (flag & 0x10) ~= 0 then
+ x = x + readbyte(f)
+ else
+ x = x - readbyte(f)
+ end
+ elseif (flag & 0x10) ~= 0 then
+ -- copy
+ else
+ x = x + readshort(f)
+ end
+ points[i] = { x, 0, (flag & 0x01) ~= 0 }
+ end
+ local y = 0
+ for i=1,nofpoints do
+ local flag = flags[i]
+ -- local short = (flag & 0x04) ~= 0
+ -- local same = (flag & 0x20) ~= 0
+ if (flag & 0x04) ~= 0 then
+ if (flag & 0x20) ~= 0 then
+ y = y + readbyte(f)
+ else
+ y = y - readbyte(f)
+ end
+ elseif (flag & 0x20) ~= 0 then
+ -- copy
+ else
+ y = y + readshort(f)
+ end
+ points[i][2] = y
+ end
+ return {
+ type = "glyph",
+ points = points,
+ contours = contours,
+ nofpoints = nofpoints,
+ }
+end
+
+local function readcomposite(f)
+ local components = { }
+ local nofcomponents = 0
+ local instructions = false
+ while true do
+ local flags = readushort(f)
+ local index = readushort(f)
+ ----- f_words = (flags & 0x0001) ~= 0
+ local f_xyarg = (flags & 0x0002) ~= 0
+ ----- f_round = (flags & 0x0006) ~= 0 -- 2 + 4
+ ----- f_scale = (flags & 0x0008) ~= 0
+ ----- f_reserved = (flags & 0x0010) ~= 0
+ ----- f_more = (flags & 0x0020) ~= 0
+ ----- f_xyscale = (flags & 0x0040) ~= 0
+ ----- f_matrix = (flags & 0x0080) ~= 0
+ ----- f_instruct = (flags & 0x0100) ~= 0
+ ----- f_usemine = (flags & 0x0200) ~= 0
+ ----- f_overlap = (flags & 0x0400) ~= 0
+ local f_offset = (flags & 0x0800) ~= 0
+ ----- f_uoffset = (flags & 0x1000) ~= 0
+ local xscale = 1
+ local xrotate = 0
+ local yrotate = 0
+ local yscale = 1
+ local xoffset = 0
+ local yoffset = 0
+ local base = false
+ local reference = false
+ if f_xyarg then
+ if (flags & 0x0001) ~= 0 then -- f_words
+ xoffset = readshort(f)
+ yoffset = readshort(f)
+ else
+ xoffset = readchar(f) -- signed byte, stupid name
+ yoffset = readchar(f) -- signed byte, stupid name
+ end
+ else
+ if (flags & 0x0001) ~= 0 then -- f_words
+ base = readshort(f)
+ reference = readshort(f)
+ else
+ base = readchar(f) -- signed byte, stupid name
+ reference = readchar(f) -- signed byte, stupid name
+ end
+ end
+ if (flags & 0x0008) ~= 0 then -- f_scale
+ xscale = read2dot14(f)
+ yscale = xscale
+ if f_xyarg and f_offset then
+ xoffset = xoffset * xscale
+ yoffset = yoffset * yscale
+ end
+ elseif (flags & 0x0040) ~= 0 then -- f_xyscale
+ xscale = read2dot14(f)
+ yscale = read2dot14(f)
+ if f_xyarg and f_offset then
+ xoffset = xoffset * xscale
+ yoffset = yoffset * yscale
+ end
+ elseif (flags & 0x0080) ~= 0 then -- f_matrix
+ xscale = read2dot14(f) -- xxpart
+ xrotate = read2dot14(f) -- yxpart
+ yrotate = read2dot14(f) -- xypart
+ yscale = read2dot14(f) -- yypart
+ if f_xyarg and f_offset then
+ xoffset = xoffset * sqrt(xscale ^2 + yrotate^2) -- was xrotate
+ yoffset = yoffset * sqrt(xrotate^2 + yscale ^2) -- was yrotate
+ end
+ end
+ nofcomponents = nofcomponents + 1
+ components[nofcomponents] = {
+ index = index,
+ usemine = (flags & 0x0200) ~= 0, -- f_usemine
+ round = (flags & 0x0006) ~= 0, -- f_round,
+ base = base,
+ reference = reference,
+ matrix = { xscale, xrotate, yrotate, yscale, xoffset, yoffset },
+ }
+ if (flags & 0x0100) ~= 0 then
+ instructions = true
+ end
+ if (flags & 0x0020) == 0 then -- f_more
+ break
+ end
+ end
+ return {
+ type = "composite",
+ components = components,
+ }
+end
+
+-- function readers.cff(f,offset,glyphs,doshapes) -- false == no shapes (nil or true otherwise)
+
+-- The glyf table depends on the loca table. We have one entry to much
+-- in the locations table (the last one is a dummy) because we need to
+-- calculate the size of a glyph blob from the delta, although we not
+-- need it in our usage (yet). We can remove the locations table when
+-- we're done (todo: cleanup finalizer).
+
+function readers.loca(f,fontdata,specification)
+ if specification.glyphs then
+ local datatable = fontdata.tables.loca
+ if datatable then
+ -- locations are relative to the glypdata table (glyf)
+ local offset = fontdata.tables.glyf.offset
+ local format = fontdata.fontheader.indextolocformat
+ local profile = fontdata.maximumprofile
+ local nofglyphs = profile and profile.nofglyphs
+ local locations = { }
+ setposition(f,datatable.offset)
+ if format == 1 then
+ if not nofglyphs then
+ nofglyphs = (datatable.length // 4) - 1
+ end
+ for i=0,nofglyphs do
+ locations[i] = offset + readulong(f)
+ end
+ fontdata.nofglyphs = nofglyphs
+ else
+ if not nofglyphs then
+ nofglyphs = (datatable.length // 2) - 1
+ end
+ for i=0,nofglyphs do
+ locations[i] = offset + readushort(f) * 2
+ end
+ end
+ fontdata.nofglyphs = nofglyphs
+ fontdata.locations = locations
+ end
+ end
+end
+
+function readers.glyf(f,fontdata,specification) -- part goes to cff module
+ local tableoffset = gotodatatable(f,fontdata,"glyf",specification.glyphs)
+ if tableoffset then
+ local locations = fontdata.locations
+ if locations then
+ local glyphs = fontdata.glyphs
+ local nofglyphs = fontdata.nofglyphs
+ local filesize = fontdata.filesize
+ local nothing = { 0, 0, 0, 0 }
+ local shapes = { }
+ local loadshapes = specification.shapes or specification.instance or specification.streams
+ for index=0,nofglyphs-1 do
+ local location = locations[index]
+ local length = locations[index+1] - location
+ if location >= filesize then
+ report("discarding %s glyphs due to glyph location bug",nofglyphs-index+1)
+ fontdata.nofglyphs = index - 1
+ fontdata.badfont = true
+ break
+ elseif length > 0 then
+ setposition(f,location)
+ local nofcontours = readshort(f)
+ glyphs[index].boundingbox = {
+ readshort(f), -- xmin
+ readshort(f), -- ymin
+ readshort(f), -- xmax
+ readshort(f), -- ymax
+ }
+ if not loadshapes then
+ -- save space
+ elseif nofcontours == 0 then
+ shapes[index] = readnothing(f)
+ elseif nofcontours > 0 then
+ shapes[index] = readglyph(f,nofcontours)
+ else
+ shapes[index] = readcomposite(f,nofcontours)
+ end
+ else
+ if loadshapes then
+ shapes[index] = readnothing(f)
+ end
+ glyphs[index].boundingbox = nothing
+ end
+ end
+ if loadshapes then
+ if readers.gvar then
+ readers.gvar(f,fontdata,specification,glyphs,shapes)
+ end
+ mergecomposites(glyphs,shapes)
+ if specification.instance then
+ if specification.streams then
+ repackpoints(glyphs,shapes)
+ else
+ contours2outlines_shaped(glyphs,shapes,specification.shapes)
+ end
+ elseif specification.shapes then
+ if specification.streams then
+ repackpoints(glyphs,shapes)
+ else
+ contours2outlines_normal(glyphs,shapes)
+ end
+ elseif specification.streams then
+ repackpoints(glyphs,shapes)
+ end
+ end
+ end
+ end
+end
+
+-- gvar is a bit crazy format and one can really wonder if the bit-jugling obscurity
+-- is still needed in these days .. cff is much nicer with these blends while the ttf
+-- coding variant looks quite horrible
+
+local function readtuplerecord(f,nofaxis)
+ local record = { }
+ for i=1,nofaxis do
+ record[i] = read2dot14(f)
+ end
+ return record
+end
+
+-- (1) the first is a real point the rest deltas
+-- (2) points can be present more than once (multiple deltas then)
+
+local function readpoints(f)
+ local count = readbyte(f)
+ if count == 0 then
+ -- second byte not used, deltas for all point numbers
+ return nil, 0 -- todo
+ else
+ if count < 128 then
+ -- no second byte, use count
+ elseif (count & 0x80) ~= 0 then
+ count = (count & 0x7F) * 256 + readbyte(f)
+ else
+ -- bad news
+ end
+ local points = { }
+ local p = 0
+ local n = 1 -- indices
+ while p < count do
+ local control = readbyte(f)
+ local runreader = (control & 0x80) ~= 0 and readushort or readbyte
+ local runlength = (control & 0x7F)
+ for i=1,runlength+1 do
+ n = n + runreader(f)
+ p = p + 1
+ points[p] = n
+ end
+ end
+ return points, p
+ end
+end
+
+local function readdeltas(f,nofpoints)
+ local deltas = { }
+ local p = 0
+ while nofpoints > 0 do
+ local control = readbyte(f)
+ if control then
+ local allzero = (control & 0x80) ~= 0
+ local runlength = (control & 0x3F) + 1
+ if allzero then
+ for i=1,runlength do
+ p = p + 1
+ deltas[p] = 0
+ end
+ else
+ local runreader = (control & 0x40) ~= 0 and readshort or readinteger
+ for i=1,runlength do
+ p = p + 1
+ deltas[p] = runreader(f)
+ end
+ end
+ nofpoints = nofpoints - runlength
+ else
+ -- it happens
+ break
+ end
+ end
+ -- saves space
+ if p > 0 then
+ return deltas
+ else
+ -- forget about all zeros
+ end
+end
+
+function readers.gvar(f,fontdata,specification,glyphdata,shapedata)
+ -- this is one of the messiest tables
+ local instance = specification.instance
+ if not instance then
+ return
+ end
+ local factors = specification.factors
+ if not factors then
+ return
+ end
+ local tableoffset = gotodatatable(f,fontdata,"gvar",specification.variable or specification.shapes)
+ if tableoffset then
+ local version = readulong(f) -- 1.0
+ local nofaxis = readushort(f)
+ local noftuples = readushort(f)
+ local tupleoffset = tableoffset + readulong(f)
+ local nofglyphs = readushort(f)
+ local flags = readushort(f)
+ local dataoffset = tableoffset + readulong(f)
+ local data = { }
+ local tuples = { }
+ local glyphdata = fontdata.glyphs
+ local dowidth = not fontdata.variabledata.hvarwidths
+ -- there is one more offset (so that one can calculate the size i suppose)
+ -- so we could test for overflows but we simply assume sane font files
+ if (flags & 0x0001) ~= 0 then
+ for i=1,nofglyphs+1 do
+ data[i] = dataoffset + readulong(f)
+ end
+ else
+ for i=1,nofglyphs+1 do
+ data[i] = dataoffset + 2*readushort(f)
+ end
+ end
+ --
+ if noftuples > 0 then
+ setposition(f,tupleoffset)
+ for i=1,noftuples do
+ tuples[i] = readtuplerecord(f,nofaxis)
+ end
+ end
+ local nextoffset = false
+ local startoffset = data[1]
+ for i=1,nofglyphs do -- hm one more cf spec
+ nextoffset = data[i+1]
+ local glyph = glyphdata[i-1]
+ local name = trace_deltas and glyph.name
+ if startoffset == nextoffset then
+ if name then
+ report("no deltas for glyph %a",name)
+ end
+ else
+ local shape = shapedata[i-1] -- todo 0
+ if not shape then
+ if name then
+ report("no shape for glyph %a",name)
+ end
+ else
+ lastoffset = startoffset
+ setposition(f,startoffset)
+ local flags = readushort(f)
+ local count = (flags & 0x0FFF)
+ local offset = startoffset + readushort(f) -- to serialized
+ local deltas = { }
+ local allpoints = (shape.nofpoints or 0) -- + 1
+ local shared = false
+ local nofshared = 0
+ if (flags & 0x8000) ~= 0 then -- has shared points
+ -- go to the packed stream (get them once)
+ local current = getposition(f)
+ setposition(f,offset)
+ shared, nofshared = readpoints(f)
+ offset = getposition(f)
+ setposition(f,current)
+ -- and back to the table
+ end
+ for j=1,count do
+ local size = readushort(f) -- check
+ local flags = readushort(f)
+ local index = (flags & 0x0FFF)
+ local haspeak = (flags & 0x8000) ~= 0
+ local intermediate = (flags & 0x4000) ~= 0
+ local private = (flags & 0x2000) ~= 0
+ local peak = nil
+ local start = nil
+ local stop = nil
+ local xvalues = nil
+ local yvalues = nil
+ local points = shared -- we default to shared
+ local nofpoints = nofshared -- we default to shared
+ -- local advance = 4
+ if haspeak then
+ peak = readtuplerecord(f,nofaxis)
+ -- advance = advance + 2*nofaxis
+ else
+ if index+1 > #tuples then
+ report("error, bad tuple index",index)
+ end
+ peak = tuples[index+1] -- hm, needs checking, only peak?
+ end
+ if intermediate then
+ start = readtuplerecord(f,nofaxis)
+ stop = readtuplerecord(f,nofaxis)
+ -- advance = advance + 4*nofaxis
+ end
+ -- get the deltas
+ if size > 0 then
+ local current = getposition(f)
+ -- goto the packed stream
+ setposition(f,offset)
+ if private then
+ points, nofpoints = readpoints(f)
+ end -- else
+ if nofpoints == 0 then
+ nofpoints = allpoints + 4
+ end
+ if nofpoints > 0 then
+ -- a nice test is to do only one
+ xvalues = readdeltas(f,nofpoints)
+ yvalues = readdeltas(f,nofpoints)
+ end
+ -- resync offset
+ offset = offset + size
+ -- back to the table
+ setposition(f,current)
+ end
+ if not xvalues and not yvalues then
+ points = nil
+ end
+ local s = 1
+ for i=1,nofaxis do
+ local f = factors[i]
+ local peak = peak and peak [i] or 0
+ -- local start = start and start[i] or 0
+ -- local stop = stop and stop [i] or 0
+ local start = start and start[i] or (peak < 0 and peak or 0)
+ local stop = stop and stop [i] or (peak > 0 and peak or 0) -- or 1 ?
+-- local stop = stop and stop [i] or (peak > 0 and peak or 1) -- or 1 ?
+ -- do we really need these tests ... can't we assume sane values
+ if start > peak or peak > stop then
+ -- * 1
+ elseif start < 0 and stop > 0 and peak ~= 0 then
+ -- * 1
+ elseif peak == 0 then
+ -- * 1
+ elseif f < start or f > stop then
+ -- * 0
+ s = 0
+ break
+ elseif f < peak then
+ s = s * (f - start) / (peak - start)
+ elseif f > peak then
+ s = s * (stop - f) / (stop - peak)
+ else
+ -- * 1
+ end
+ end
+ if s == 0 then
+ if name then
+ report("no deltas applied for glyph %a",name)
+ end
+ else
+ deltas[#deltas+1] = {
+ factor = s,
+ points = points,
+ xvalues = xvalues,
+ yvalues = yvalues,
+ }
+ end
+ end
+ if shape.type == "glyph" then
+ applyaxis(glyph,shape,deltas,dowidth)
+ else
+ -- todo: args_are_xy_values mess .. i have to be really bored
+ -- and motivated to deal with it
+ shape.deltas = deltas
+ end
+ end
+ end
+ startoffset = nextoffset
+ end
+ end
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-txt.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-txt.lmt
new file mode 100644
index 00000000000..aae69ddd383
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-txt.lmt
@@ -0,0 +1,570 @@
+if not modules then modules = { } end modules ['font-txt'] = {
+ version = 1.001,
+ comment = "companion to font-ini.mkiv",
+ original = "derived from a prototype by Kai Eigner",
+ author = "Hans Hagen", -- so don't blame KE
+ copyright = "TAT Zetwerk / PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- The next code is derived from a snippet handler prototype by Kai Eigner and
+-- resembles the main loop of the Lua font handler but I decided use a more generic
+-- (and pluggable) approach and not hook it into the already present opentype
+-- handler. This is cleaner as it cannot interfere with the Lua font processor
+-- (which does some more things) and is also better performance wise. It also makes
+-- it possible to support other handlers as history has proven that there are no
+-- universal solution in computer land. Most of the disc logic is kept but done
+-- slightly different.
+--
+-- The code is heavily optimized and generalized so there can be errors. As
+-- mentioned, the plug mode can be used for alternative font handlers. A font is
+-- still loaded but the node and base mode handlers are ignored. Plugins are
+-- unlikely to work well in context as they can mess up attribute driven subsystem,
+-- so they are not officially supported. The language and script options are
+-- available in the usual way.
+--
+-- The code collects snippets, either or not with spacing around them and partially
+-- running over disc nodes. The r2l "don't assume disc and collect larger chunks" is
+-- not robust so I got rid of that branch. This is somewhat similar to the Lua font
+-- handler.
+--
+-- An alternative is to run over longer strings with dummy chars (unicode objects) as
+-- markers for whatever is in the list but that becomes tricky with mixed fonts and
+-- reconstruction becomes a bit of a mess then, especially because disc nodes force
+-- us to backtrack and look at several solutions. It also has a larger memory
+-- footprint. Some tests demonstrated that it has no gain and only adds complexity.
+--
+-- This (derived) variant is better suited for context and seems to work ok in the
+-- generic variant. I also added some context specific tracing to the code. This
+-- variant uses the plug model provided in the context font system. So, in context,
+-- using the built in Lua handler is the better alternative, also because it has
+-- extensive tracing features. Context users would loose additional functionality
+-- that has been provided for a decade and therefore plugins are not officially
+-- supported (at least not by me, unless I use them myself).
+--
+-- There is no checking here for already processed characters so best not mix this
+-- variant with code that does similar things. If this code evolves depends on the
+-- useability. Kai's code can now be found on github where it is used with a harfbuzz
+-- library. We add this kind of stuff because occasionally we compare engines and
+-- Kai sends me examples and I then need to check context.
+--
+-- One important difference between Kai's approach and the one used in ConTeXt is
+-- that we use utf-32 instead of utf-8. Once I figured out that clusters were just
+-- indices into the original text that made more sense. The first implementation
+-- used the command line tool (binary), then I went for ffi (library).
+--
+-- Beware: this file only implements the framework for plugins. Plugins themselves
+-- are in other files (e.g. font-phb*.lua). On the todo list is a uniscribe plugin
+-- because that is after all the reference for opentype support, but that interface
+-- needs a bit more work (so it might never happen).
+--
+-- Usage: see m-fonts-plugins.mkiv. As it's a nice test for ffi support that file
+-- migth be added to the distribution somewhere in the middle of 2017 when the ffi
+-- interface has been tested a bit more. Okay, it's 2012 now and we're way past that
+-- date but we never had a reason for adding it to the ConTeXt distribution. It
+-- should still work okay because I occasionally checked it against progress made in
+-- the engines and used newer helpers.
+--
+-- Here is an example of usage:
+--
+-- \starttext
+-- \definefontfeature[test][mode=plug,features=text]
+-- \start
+-- \showfontkerns
+-- \definedfont[Serif*test]
+-- \input tufte \par
+-- \stop
+-- \stoptext
+
+local fonts = fonts
+local otf = fonts.handlers.otf
+local nodes = nodes
+
+local utfchar = utf.char
+
+local nuts = nodes.nuts
+
+local getnext = nuts.getnext
+local setnext = nuts.setnext
+local getprev = nuts.getprev
+local setprev = nuts.setprev
+local getid = nuts.getid
+local getsubtype = nuts.getsubtype
+local getfont = nuts.getfont
+local getchar = nuts.getchar
+local getdisc = nuts.getdisc
+local setdisc = nuts.setdisc
+local getboth = nuts.getboth
+local getscales = nuts.getscales
+local setlink = nuts.setlink
+local getkern = nuts.getkern
+local getwidth = nuts.getwidth
+
+local ischar = nuts.ischar
+local isglyph = nuts.isglyph
+local usesfont = nuts.usesfont
+
+local copy_node_list = nuts.copylist
+local find_node_tail = nuts.tail
+local flushlist = nuts.flushlist
+local freenode = nuts.free
+local endofmath = nuts.endofmath
+
+local startofpar = nuts.startofpar
+
+local nodecodes = nodes.nodecodes
+
+local glyph_code = nodecodes.glyph
+local glue_code = nodecodes.glue
+local disc_code = nodecodes.disc
+local kern_code = nodecodes.kern
+local math_code = nodecodes.math
+local dir_code = nodecodes.dir
+local par_code = nodecodes.par
+
+local righttoleft_code = nodes.dirvalues.righttoleft
+
+local txtdirstate = otf.helpers.txtdirstate
+local pardirstate = otf.helpers.pardirstate
+
+local fonthashes = fonts.hashes
+local fontdata = fonthashes.identifiers
+
+local function deletedisc(head)
+ local current = head
+ local next = nil
+ while current do
+ next = getnext(current)
+ if getid(current) == disc_code then
+ local pre, post, replace, pre_tail, post_tail, replace_tail = getdisc(current,true)
+ setdisc(current)
+ if pre then
+ flushlist(pre)
+ end
+ if post then
+ flushlist(post)
+ end
+ local p, n = getboth(current)
+ if replace then
+ if current == head then
+ head = replace
+ setprev(replace) -- already nil
+ else
+ setlink(p,replace)
+ end
+ setlink(replace_tail,n) -- was: setlink(n,replace_tail)
+ elseif current == head then
+ head = n
+ setprev(n)
+ else
+ setlink(p,n)
+ end
+ freenode(current)
+ end
+ current = next
+ end
+ return head
+end
+
+-- As we know that we have the same font we can probably optimize this a bit more.
+-- Although we can have more in disc nodes than characters and kerns we only support
+-- those two types.
+
+local function eqnode(n,m) -- no real improvement in speed
+ local n_char = isglyph(n)
+ if n_char then
+ return n_char == ischar(m,getfont(n))
+ elseif n_id == kern_code then
+ return getkern(n) == getkern(m)
+ end
+end
+
+local function equalnode(n,m)
+ if not n then
+ return not m
+ elseif not m then
+ return false
+ end
+ local n_char, n_id = isglyph(n)
+ if n_char then
+ return n_char == ischar(m,n_id) -- n_id == n_font
+ elseif n_id == whatsit_code then
+ return false
+ elseif n_id == glue_code then
+ return true
+ elseif n_id == kern_code then
+ return getkern(n) == getkern(m)
+ elseif n_id == disc_code then
+ local n_pre, n_post, n_replace = getdisc(n)
+ local m_pre, m_post, m_replace = getdisc(m)
+ while n_pre and m_pre do
+ if not eqnode(n_pre,m_pre) then
+ return false
+ end
+ n_pre = getnext(n_pre)
+ m_pre = getnext(m_pre)
+ end
+ if n_pre or m_pre then
+ return false
+ end
+ while n_post and m_post do
+ if not eqnode(n_post,m_post) then
+ return false
+ end
+ n_post = getnext(n_post)
+ m_post = getnext(m_post)
+ end
+ if n_post or m_post then
+ return false
+ end
+ while n_replace and m_replace do
+ if not eqnode(n_replace,m_replace) then
+ return false
+ end
+ n_replace = getnext(n_replace)
+ m_replace = getnext(m_replace)
+ end
+ if n_replace or m_replace then
+ return false
+ end
+ return true
+ end
+ return false
+end
+
+-- The spacing hackery is not nice. The text can get leading and trailing spaces
+-- and even mid spaces while the start and stop nodes not always are glues then
+-- so the plugin really needs to do some testing there. We could pass more context
+-- but it doesn't become much better.
+--
+-- The attribute gets passed for tracing purposes. We could support it (not that
+-- hard to do) but as we don't test strickly for fonts (in disc nodes) we are not
+-- compatible anyway. It would also mean more testing. So, don't use this mixed
+-- with node and base mode in context.
+--
+-- We don't distinguish between modes in treatment (so no r2l assumptions) and
+-- no cheats for scripts that might not use discretionaries. Such hacks can work
+-- in predictable cases but in context one can use a mix all kind of things and
+-- users do that. On the other hand, we do support longer glyph runs in both modes
+-- so there we gain a bit.
+
+do
+
+ local currentscale, currentxscale, currentyscale
+
+ local function texthandler(head,font,dynamic,rlmode,handler,startspacing,stopspacing,nesting)
+ if not head then
+ return
+ end
+ if startspacing == nil then
+ startspacing = false
+ end
+ if stopspacing == nil then
+ stopspacing = false
+ end
+
+ if getid(head) == par_code and startofpar(head) then
+ rlmode = pardirstate(head)
+ elseif rlmode == righttoleft_code then
+ rlmode = -1
+ else
+ rlmode = 0
+ end
+
+ local dirstack = { }
+ local rlparmode = 0
+ local topstack = 0
+ local text = { }
+ local size = 0
+ local current = head
+ local start = nil
+ local stop = nil
+ local startrlmode = rlmode
+
+ local function handle(leading,trailing) -- what gets passed can become configureable: e.g. utf 8
+ local stop = current or start -- hm, what with outer stop
+ if getid(stop) ~= glyph_code then
+ stop = getprev(stop)
+ end
+ head = handler(head,font,dynamic,rlmode,start,stop,text,leading,trailing) -- handler can adapt text
+ size = 0
+ text = { }
+ start = nil
+ end
+
+ while current do
+ local char, id = ischar(current,font,dynamic,currentscale,currentxscale,currentyscale)
+ if char then
+ if not start then
+ start = current
+ startrlmode = rlmode
+ end
+ local char = getchar(current)
+ size = size + 1
+ text[size] = char
+ current = getnext(current)
+ elseif char == false then
+ -- so a mixed font
+ if start and size > 0 then
+ handle(startspacing,false)
+ end
+ startspacing = false
+ local s, sx, sy = getscales(current)
+ if s ~= currentscale or sx ~= currentxscale or sy ~= currentyscale then
+ if start and size > 0 then
+ handle(startspacing,false)
+ end
+ startspacing = false
+ currentscale, currentxscale, currentyscale = s, sx, sy
+ -- todo: safeguard against a loop
+ else
+ current = getnext(current)
+ currentscale, currentxscale, currentyscale = false, false, false
+ end
+ elseif id == glue_code then
+ -- making this branch optional i.e. always use the else doesn't really
+ -- make a difference in performance (in hb) .. tricky anyway as we can
+ local width = getwidth(current)
+ if width > 0 then
+ if start and size > 0 then
+ handle(startspacing,true)
+ end
+ startspacing = true
+ stopspacing = false
+ else
+ if start and size > 0 then
+ head = handle(startspacing)
+ end
+ startspacing = false
+ stopspacing = false
+ end
+ current = getnext(current)
+ elseif id == disc_code and usesfont(current,font) then -- foo|-|bar : has hbox
+ -- This looks much like the original code but I don't see a need to optimize
+ -- for e.g. deva or r2l fonts. If there are no disc nodes then we won't see
+ -- this branch anyway and if there are, we should just deal with them.
+ --
+ -- There is still some weird code here ... start/stop and such. When I'm in
+ -- the mood (or see a need) I'll rewrite this bit.
+
+ -- bug: disc in last word moves to end (in practice not an issue as one
+ -- doesn't want a break there)
+
+ local pre = nil
+ local post = nil
+ local currentnext = getnext(current)
+ local current_pre, current_post, current_replace = getdisc(current)
+ setdisc(current) -- why, we set it later
+ if start then
+ pre = copy_node_list(start,current)
+ stop = getprev(current)
+ -- why also current and not:
+ -- pre = copy_node_list(start,stop)
+ if start == head then
+ head = current
+ end
+ setlink(getprev(start),current)
+ setlink(stop,current_pre)
+ current_pre = start
+ setprev(current_pre)
+ start = nil
+ stop = nil
+ startrlmode = rlmode
+ end
+ while currentnext do
+ local char, id = ischar(currentnext,font)
+ if char or id == disc_code then
+ stop = currentnext
+ currentnext = getnext(currentnext)
+ elseif id == glue_code then
+ local width = getwidth(currentnext)
+ if width and width > 0 then
+ stopspacing = true
+ else
+ stopspacing = false
+ end
+ break
+ else
+ break
+ end
+ end
+ if stop then
+ local currentnext = getnext(current)
+ local stopnext = getnext(stop)
+ post = copy_node_list(currentnext,stopnext)
+ if current_post then
+ setlink(find_node_tail(current_post),currentnext)
+ else
+ setprev(currentnext)
+ current_post = currentnext
+ end
+ setlink(current,stopnext)
+ setnext(stop)
+ stop = nil
+ end
+ if pre then
+ setlink(find_node_tail(pre),current_replace)
+ current_replace = pre
+ pre = nil
+ end
+ if post then
+ if current_replace then
+ setlink(find_node_tail(current_replace),post)
+ else
+ current_replace = post
+ end
+ post = nil
+ end
+ size = 0 -- hm, ok, start is also nil now
+ text = { }
+ if current_pre then
+ current_pre = texthandler(current_pre,font,dynamic,rlmode,handler,startspacing,false,"pre")
+ end
+ if current_post then
+ current_post = texthandler(current_post,font,dynamic,rlmode,handler,false,stopspacing,"post")
+ end
+ if current_replace then
+ current_replace = texthandler(current_replace,font,dynamic,rlmode,handler,startspacing,stopspacing,"replace")
+ end
+ startspacing = false
+ stopspacing = false
+ local cpost = current_post and find_node_tail(current_post)
+ local creplace = current_replace and find_node_tail(current_replace)
+ local cpostnew = nil
+ local creplacenew = nil
+ local newcurrent = nil
+ while cpost and equalnode(cpost,creplace) do
+ cpostnew = cpost
+ creplacenew = creplace
+ if creplace then
+ creplace = getprev(creplace)
+ end
+ cpost = getprev(cpost)
+ end
+ if cpostnew then
+ if cpostnew == current_post then
+ current_post = nil
+ else
+ setnext(getprev(cpostnew))
+ end
+ flushlist(cpostnew)
+ if creplacenew == current_replace then
+ current_replace = nil
+ else
+ setnext(getprev(creplacenew))
+ end
+ local c = getnext(current)
+ setlink(current,creplacenew)
+ local creplacenewtail = find_node_tail(creplacenew)
+ setlink(creplacenewtail,c)
+ newcurrent = creplacenewtail
+ end
+ current_post = current_post and deletedisc(current_post)
+ current_replace = current_replace and deletedisc(current_replace)
+ local cpre = current_pre
+ local creplace = current_replace
+ local cprenew = nil
+ local creplacenew = nil
+ while cpre and equalnode(cpre, creplace) do
+ cprenew = cpre
+ creplacenew = creplace
+ if creplace then
+ creplace = getnext(creplace)
+ end
+ cpre = getnext(cpre)
+ end
+ if cprenew then
+ cpre = current_pre
+ current_pre = getnext(cprenew)
+ if current_pre then
+ setprev(current_pre)
+ end
+ setnext(cprenew)
+ flushlist(cpre)
+ creplace = current_replace
+ current_replace = getnext(creplacenew)
+ if current_replace then
+ setprev(current_replace)
+ end
+ setlink(getprev(current),creplace)
+ if current == head then
+ head = creplace
+ end
+ setlink(creplacenew,current)
+ end
+ setdisc(current,current_pre,current_post,current_replace)
+ current = currentnext
+ else
+ if start and size > 0 then
+ handle(startspacing,stopspacing)
+ end
+ startspacing = false
+ stopspacing = false
+ if id == math_code then
+ current = getnext(endofmath(current))
+ elseif id == dir_code then
+ startspacing = false
+ topstack, rlmode = txtdirstate(current,dirstack,topstack,rlparmode)
+ current = getnext(current)
+ -- elseif id == par_code and startofpar(current) then
+ -- startspacing = false
+ -- rlparmode, rlmode = pardirstate(current)
+ -- current = getnext(current)
+ else
+ current = getnext(current)
+ end
+ end
+ end
+ if start and size > 0 then
+ handle(startspacing,stopspacing)
+ end
+ return head, true
+ end
+
+ function fonts.handlers.otf.texthandler(head,font,dynamic,direction,action)
+ currentscale = false
+ currentxscale = false
+ currentyscale = false
+ if action then
+ return texthandler(head,font,dynamic,direction == righttoleft_code and -1 or 0,action)
+ else
+ return head, false
+ end
+ end
+
+ -- Next comes a tracer plug into context.
+
+ ----- texthandler = fonts.handlers.otf.texthandler
+ local report_text = logs.reporter("otf plugin","text")
+ local nofruns = 0
+ local nofsnippets = 0
+ local f_unicode = string.formatters["%U"]
+
+ local function showtext(head,font,dynamic,rlmode,start,stop,list,before,after)
+ if list then
+ nofsnippets = nofsnippets + 1
+ local plus = { }
+ for i=1,#list do
+ local u = list[i]
+ list[i] = utfchar(u)
+ plus[i] = f_unicode(u)
+ end
+ report_text("%03i : [%s] %t [%s]-> % t", nofsnippets, before and "+" or "-", list, after and "+" or "-", plus)
+ else
+ report_text()
+ report_text("invalid list")
+ report_text()
+ end
+ return head, false
+ end
+
+ fonts.handlers.otf.registerplugin("text",function(head,font,dynamic,direction)
+ nofruns = nofruns + 1
+ nofsnippets = 0
+ report_text("start run %i",nofruns)
+ local h, d = texthandler(head,font,dynamic,direction,showtext)
+ report_text("stop run %i",nofruns)
+ return h, d
+ end)
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-unk.mkxl b/Master/texmf-dist/tex/context/base/mkxl/font-unk.mkxl
index 986a5c9bfa2..e44803ecc46 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-unk.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-unk.mkxl
@@ -42,11 +42,12 @@
\definefontsynonym [MonoCaps] [unknown]
\definefontsynonym [MathRoman] [unknown]
-\definefontsynonym [MathRomanL2R] [MathRoman]
-\definefontsynonym [MathRomanR2L] [MathRoman]
\definefontsynonym [MathRomanBold] [MathRoman]
-\definefontsynonym [MathRomanBoldL2R] [MathRomanBold]
-\definefontsynonym [MathRomanBoldR2L] [MathRomanBold]
+
+\definefontsynonym [MathRomanL2R] [MathRoman] % obsolete
+\definefontsynonym [MathRomanR2L] [MathRoman] % obsolete
+\definefontsynonym [MathRomanBoldL2R] [MathRomanBold] % obsolete
+\definefontsynonym [MathRomanBoldR2L] [MathRomanBold] % obsolete
\definefontsynonym [Handwriting] [unknown]
\definefontsynonym [Calligraphic] [unknown]
@@ -110,7 +111,7 @@
\s!sl=SerifSlanted sa 1,
\s!bi=SerifBoldItalic sa 1,
\s!bs=SerifBoldSlanted sa 1,
- \s!sc=SerifCaps sa 1]
+ \s!sc=SerifCaps sa 1] % obsolete, is a font feature now
\definebodyfont [default] [ss]
[\s!tf=Sans sa 1,
@@ -119,7 +120,7 @@
\s!sl=SansSlanted sa 1,
\s!bi=SansBoldItalic sa 1,
\s!bs=SansBoldSlanted sa 1,
- \s!sc=SansCaps sa 1]
+ \s!sc=SansCaps sa 1] % obsolete, is a font feature now
\definebodyfont [default] [tt]
[\s!tf=Mono sa 1,
@@ -128,20 +129,24 @@
\s!sl=MonoSlanted sa 1,
\s!bi=MonoBoldItalic sa 1,
\s!bs=MonoBoldSlanted sa 1,
- \s!sc=MonoCaps sa 1]
+ \s!sc=MonoCaps sa 1] % obsolete, is a font feature now
+
+% \definebodyfont [default] [mm]
+% [\s!mr =MathRoman mo 1,
+% \s!mrlr=MathRomanL2R mo 1,
+% \s!mrrl=MathRomanR2L mo 1,
+% \s!mb =MathRomanBold mo 1,
+ % \s!mblr=MathRomanBoldL2R mo 1,
+% \s!mbrl=MathRomanBoldR2L mo 1]
\definebodyfont [default] [mm]
- [\s!mr =MathRoman mo 1,
- \s!mrlr=MathRomanL2R mo 1,
- \s!mrrl=MathRomanR2L mo 1,
- \s!mb =MathRomanBold mo 1,
- \s!mblr=MathRomanBoldL2R mo 1,
- \s!mbrl=MathRomanBoldR2L mo 1]
-
-\definebodyfont [default] [hw]
+ [\s!mr=MathRoman mo 1,
+ \s!mb=MathRomanBold mo 1]
+
+\definebodyfont [default] [hw] % only for lucida, can be just a typeface
[\s!tf=Handwriting sa 1]
-\definebodyfont [default] [cg]
+\definebodyfont [default] [cg] % only for lucida, can be just a typeface
[\s!tf=Calligraphy sa 1]
%D These definitions come into action as soon as names are mapped onto real file
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-var.mklx b/Master/texmf-dist/tex/context/base/mkxl/font-var.mklx
index 421521f50f5..aeec18054d4 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-var.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-var.mklx
@@ -38,17 +38,19 @@
\immutable\def\defaultfontbody {\normalizedbodyfontsize}
\immutable\let\defaultfontstyle \s!rm
\immutable\let\defaultfontalternative\s!tf
-\immutable\let\defaultfontsize \empty
\immutable\let\defaultfontface \!!zerocount
-\mutable\let\globalfontclass\empty
-\mutable\let\fontclass \empty
+\immutable\lettonothing\defaultfontsize
+
\mutable\let\fontbody \defaultfontbody
\mutable\let\fontstyle \defaultfontstyle
\mutable\let\fontalternative\defaultfontalternative
\mutable\let\fontsize \defaultfontsize
\mutable\let\fontface \!!zerocount
+\mutable\lettonothing\globalfontclass
+\mutable\lettonothing\fontclass
+
\installmacrostack\fontstyle
% we can use an indirect mapping for fontclasses (map string onto numbers) and indeed this
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-vfc.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-vfc.lmt
index 9330bdea0b2..6e9cd401350 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-vfc.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-vfc.lmt
@@ -18,25 +18,35 @@ local setmetatableindex = table.setmetatableindex
-- Helpers dealing with virtual fonts: beware, these are final values so
-- don't change the content of tables fetched from here!
-local push = { "push" }
-local pop = { "pop" }
-local dummy = { "comment" }
+local pushcommand = { "push" }
+local popcommand = { "pop" }
+local dummycommand = { "comment" }
+
+local slotcommand = setmetatableindex(function(t,k)
+ local v = setmetatableindex(function(tt,kk)
+ local vv = { "slot", k, kk }
+ tt[kk] = vv
+ return vv
+ end)
+ t[k] = v
+ return v
+end)
function helpers.prependcommands(commands,...)
- insert(commands,1,push)
+ insert(commands,1,pushcommand)
for i=select("#",...),1,-1 do
local s = (select(i,...))
if s then
insert(commands,1,s)
end
end
- insert(commands,pop)
+ insert(commands,popcommand)
return commands
end
function helpers.appendcommands(commands,...)
- insert(commands,1,push)
- insert(commands,pop)
+ insert(commands,1,pushcommand)
+ insert(commands,popcommand)
for i=1,select("#",...) do
local s = (select(i,...))
if s then
@@ -47,20 +57,20 @@ function helpers.appendcommands(commands,...)
end
function helpers.prependcommandtable(commands,t)
- insert(commands,1,push)
+ insert(commands,1,pushcommand)
for i=#t,1,-1 do
local s = t[i]
if s then
insert(commands,1,s)
end
end
- insert(commands,pop)
+ insert(commands,popcommand)
return commands
end
function helpers.appendcommandtable(commands,t)
- insert(commands,1,push)
- insert(commands,pop)
+ insert(commands,1,pushcommand)
+ insert(commands,popcommand)
for i=1,#t do
local s = t[i]
if s then
@@ -71,20 +81,38 @@ function helpers.appendcommandtable(commands,t)
end
helpers.commands = utilities.storage.allocate {
- char = setmetatableindex(function(t,k) local v = { "slot", 0, k } t[k] = v return v end),
- right = setmetatableindex(function(t,k) local v = { "right", k } t[k] = v return v end),
- left = setmetatableindex(function(t,k) local v = { "left", k } t[k] = v return v end),
- down = setmetatableindex(function(t,k) local v = { "down", k } t[k] = v return v end),
- up = setmetatableindex(function(t,k) local v = { "up", k } t[k] = v return v end),
- push = push,
- pop = pop,
- dummy = dummy,
+ char = setmetatableindex(function(t,k) local v = { "char", k } t[k] = v return v end),
+ stay = setmetatableindex(function(t,k) local v = { "stay", k } t[k] = v return v end),
+ right = setmetatableindex(function(t,k) local v = { "right", k } t[k] = v return v end),
+ left = setmetatableindex(function(t,k) local v = { "left", k } t[k] = v return v end),
+ down = setmetatableindex(function(t,k) local v = { "down", k } t[k] = v return v end),
+ up = setmetatableindex(function(t,k) local v = { "up", k } t[k] = v return v end),
+ push = pushcommand,
+ pop = popcommand,
+ dummy = dummycommand,
+ slot = slotcommand,
}
+local codeinjections = backends.codeinjections
+local vfstartcolor = codeinjections.vfstartcolor
+local vfstopcolor = codeinjections.vfstopcolor
+----- vfliteral = codeinjections.vfliteral
+
helpers.vfinjectors = {
- -- backend specific: startcolor, stopcolor etc
+ -- startcolor = function(h,v,packet) codeinjections.vfstartcolor(h,v,packet) end,
+ -- stopcolor = function(h,v,packet) codeinjections.vfstartcolor(h,v,packet) end,
+ -- literal = function(h,v,packet) codeinjections.vfliteral (h,v,packer) end,
+ startcolor = function(h,v,packet) vfstartcolor(h,v,packet) end,
+ stopcolor = function(h,v,packet) vfstopcolor (h,v,packet) end,
+ -- literal = function(h,v,packet) vfliteral (h,v,packer) end,
}
+updaters.register("backends.injections.latebindings",function()
+ vfstartcolor = backends.codeinjections.vfstartcolor
+ vfstopcolor = backends.codeinjections.vfstopcolor
+ -- vfliteral = backends.codeinjections.vfliteral
+end)
+
-- maybe round()
local defaultline = 16384
@@ -94,7 +122,7 @@ helpers.vfspecials = {
backgrounds = setmetatableindex(function(t,h)
local v = setmetatableindex(function(t,d)
local v = setmetatableindex(function(t,w)
- local v = { "frame", w, h, d, defaultline, true, true }
+ local v = { "frame", w, h, d, defaultline, false, false }
t[w] = v
return v
end)
@@ -108,7 +136,7 @@ helpers.vfspecials = {
outlines = setmetatableindex(function(t,h)
local v = setmetatableindex(function(t,d)
local v = setmetatableindex(function(t,w)
- local v = { "frame", w, h, d, defaultline, false, true }
+ local v = { "frame", w, h, d, defaultline, true, false }
t[w] = v
return v
end)
@@ -153,21 +181,28 @@ local scaled = {
-- additional ones are never scaled (color etc)
}
+-- normally we don't have these, and if so, only in old school fonts
+-- in which case we don't have extensions so ...
+
function helpers.scalecommands(list,hdelta,vdelta)
local n = #list
for i=1,n do
- local key = list[i][1]
- if scaled[list[i][1]] then
+ local cmd = list[i]
+ if scaled[cmd[1]] then
local result = { }
for i=1,n do
local cmd = list[i]
- local key = ivc[1]
+ local key = cmd[1]
if key == "right" or key == "left" then
result[i] = { key, cmd[2]*hdelta }
elseif key == "down" or key == "up" then
result[i] = { key, cmd[2]*vdelta }
- elseif key == "offset" or key == "rule" then
+ elseif key == "offset" then
+ result[i] = { key, cmd[2]*hdelta, cmd[3]*vdelta, cmd[4], cmd[5], cmd[6] }
+ elseif key == "rule" then
result[i] = { key, cmd[2]*hdelta, cmd[3]*vdelta }
+ elseif key == "line" then
+ result[i] = { key, cmd[2]*hdelta, cmd[3]*vdelta, cmd[4]*vdelta, cmd[5] }
-- elseif key == "frame" then
-- result[i] = cmd -- already scaled, for now
else
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-vir.lmt b/Master/texmf-dist/tex/context/base/mkxl/font-vir.lmt
index f60639d6ad8..84da09064e1 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-vir.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/font-vir.lmt
@@ -38,6 +38,8 @@ vf.whatever = whatever
vf.helpers = helpers
vf.predefined = predefined
+local slotcommand = predefined.slot
+
setmetatableindex(whatever, function(t,k) local v = { } t[k] = v return v end)
local function checkparameters(g,f)
@@ -78,7 +80,7 @@ local function combine_assign(g, name, from, to, start, force)
for i=from,to do
if fc[i] and (force or not gc[i]) then
gc[i] = fastcopy(fc[i],true) -- can be optimized
- gc[i].commands = { { "slot", hn, start } }
+ gc[i].commands = { slotcommand[hn][start] }
gd[i] = fd[i]
end
start = start + 1
@@ -107,7 +109,7 @@ local function combine_names(g,name,force)
for k, v in next, fc do
if force or not gc[k] then
gc[k] = fastcopy(v,true)
- gc[k].commands = { { "slot", hn, k } }
+ gc[k].commands = { slotcommand[hn][k] }
gd[i] = fd[i]
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/good-gen.lmt b/Master/texmf-dist/tex/context/base/mkxl/good-gen.lmt
new file mode 100644
index 00000000000..49b37930470
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/good-gen.lmt
@@ -0,0 +1,220 @@
+if not modules then modules = { } end modules ['good-gen'] = {
+ version = 1.000,
+ comment = "companion to font-lib.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- depends on ctx
+
+local type, next = type, next
+local lower = string.lower
+local filesuffix, replacesuffix = file.suffix, file.replacesuffix
+local fonts = fonts
+
+----- trace_goodies = false trackers.register("fonts.goodies", function(v) trace_goodies = v end)
+----- report_goodies = logs.reporter("fonts","goodies")
+
+local allocate = utilities.storage.allocate
+local texsp = tex.sp
+local fontgoodies = fonts.goodies or { }
+local findfile = resolvers.findfile
+
+
+local typefaces = fonts.typefaces or { }
+fonts.typefaces = typefaces
+
+-- the following takes care of explicit file specifications
+--
+-- files = {
+-- name = "antykwapoltawskiego",
+-- list = {
+-- ["AntPoltLtCond-Regular.otf"] = {
+-- -- name = "antykwapoltawskiego",
+-- style = "regular",
+-- weight = "light",
+-- width = "condensed",
+-- },
+-- },
+-- }
+
+-- files
+
+local function initialize(goodies)
+ local files = goodies.files
+ if files then
+ fonts.names.register(files)
+ end
+end
+
+fontgoodies.register("files", initialize)
+
+-- some day we will have a define command and then we can also do some
+-- proper tracing
+--
+-- fonts.typefaces["antykwapoltawskiego-condensed"] = {
+-- shortcut = "rm",
+-- shape = "serif",
+-- fontname = "antykwapoltawskiego",
+-- normalweight = "light",
+-- boldweight = "medium",
+-- width = "condensed",
+-- size = "default",
+-- features = "default",
+-- }
+
+local function initialize(goodies)
+ local typefaces = goodies.typefaces
+ if typefaces then
+ local ft = fonts.typefaces
+ for k, v in next, typefaces do
+ ft[k] = v
+ end
+ end
+end
+
+fontgoodies.register("typefaces", initialize)
+
+local compositions = { }
+
+function fontgoodies.getcompositions(tfmdata)
+ return compositions[file.nameonly(tfmdata.properties.filename or "")]
+end
+
+local function initialize(goodies)
+ local gc = goodies.compositions
+ if gc then
+ for k, v in next, gc do
+ compositions[k] = v
+ end
+ end
+end
+
+fontgoodies.register("compositions", initialize)
+
+-- extra treatments (on top of defaults): \loadfontgoodies[mytreatments]
+
+local treatmentdata = fonts.treatments.data
+
+local function initialize(goodies)
+ local treatments = goodies.treatments
+ if treatments then
+ for name, data in next, treatments do
+ treatmentdata[name] = data -- always wins
+ end
+ end
+end
+
+fontgoodies.register("treatments", initialize)
+
+local filenames = fontgoodies.filenames or allocate()
+fontgoodies.filenames = filenames
+
+local filedata = filenames.data or allocate()
+filenames.data = filedata
+
+local function initialize(goodies) -- design sizes are registered global
+ local fn = goodies.filenames
+ if fn then
+ for usedname, alternativenames in next, fn do
+ filedata[usedname] = alternativenames
+ end
+ end
+end
+
+fontgoodies.register("filenames", initialize)
+
+function fontgoodies.filenames.resolve(name)
+ local fd = filedata[name]
+ if fd and findfile(name) == "" then
+ for i=1,#fd do
+ local fn = fd[i]
+ if findfile(fn) ~= "" then
+ return fn
+ end
+ end
+ elseif filesuffix(name) == "any" then
+ -- This is a bit weird place but it's a kind of fallback option in case
+ -- we can't resolve due to a name conflict.
+ local sequence = fonts.readers.sequence
+ for i=1,#sequence do
+ local fn = replacesuffix(name,sequence[i])
+ if findfile(fn) ~= "" then
+ return fn
+ end
+ end
+ else
+ -- no lookup, just use the regular mechanism
+ end
+ return name
+end
+
+local designsizes = fontgoodies.designsizes or allocate()
+fontgoodies.designsizes = designsizes
+
+local designdata = designsizes.data or allocate()
+designsizes.data = designdata
+
+local function initialize(goodies) -- design sizes are registered global
+ local gd = goodies.designsizes
+ if gd then
+ for name, data in next, gd do
+ local ranges = { }
+ for size, file in next, data do
+ if size ~= "default" then
+ ranges[#ranges+1] = { texsp(size), file } -- also lower(file)
+ end
+ end
+ table.sort(ranges,function(a,b) return a[1] < b[1] end)
+ designdata[lower(name)] = { -- overloads, doesn't merge!
+ default = data.default,
+ ranges = ranges,
+ }
+ end
+ end
+end
+
+fontgoodies.register("designsizes", initialize)
+
+function fontgoodies.designsizes.register(name,size,specification)
+ local d = designdata[name]
+ if not d then
+ d = {
+ ranges = { },
+ default = nil, -- so we have no default set
+ }
+ designdata[name] = d
+ end
+ if size == "default" then
+ d.default = specification
+ else
+ if type(size) == "string" then
+ size = texsp(size) -- hm
+ end
+ local ranges = d.ranges
+ ranges[#ranges+1] = { size, specification }
+ end
+end
+
+function fontgoodies.designsizes.filename(name,spec,size,force) -- returns nil of no match
+ local data = designdata[lower(name)]
+ if data then
+ if not spec or spec == "" or spec == "default" then
+ return data.default
+ elseif not force and texconditionals["c_font_compact"] then
+ return data.default
+ elseif spec == "auto" then
+ local ranges = data.ranges
+ if ranges then
+ for i=1,#ranges do
+ local r = ranges[i]
+ if r[1] >= size then -- todo: rounding so maybe size - 100
+ return r[2]
+ end
+ end
+ end
+ return data.default or (ranges and ranges[#ranges][2])
+ end
+ end
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/good-mth.lmt b/Master/texmf-dist/tex/context/base/mkxl/good-mth.lmt
index 87b6787df6a..6b0c320b247 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/good-mth.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/good-mth.lmt
@@ -21,181 +21,21 @@ local fontgoodies = fonts.goodies or { }
local fontcharacters = fonts.hashes.characters
-local trace_defining = false trackers.register("math.defining", function(v) trace_defining = v end)
+local trace_defining = false trackers.register ("math.defining", function(v) trace_defining = v end)
+local use_math_goodies = true directives.register("math.nogoodies", function(v) use_math_goodies = not v end)
local report_math = logs.reporter("mathematics","initializing")
local nuts = nodes.nuts
-
local setlink = nuts.setlink
local nodepool = nuts.pool
-
local new_kern = nodepool.kern
local new_glyph = nodepool.glyph
local new_hlist = nodepool.hlist
local new_vlist = nodepool.vlist
-local insert_node_after = nuts.insert_after
-
-local helpers = fonts.helpers
-local upcommand = helpers.commands.up
-local rightcommand = helpers.commands.right
-local charcommand = helpers.commands.char
-local prependcommands = helpers.prependcommands
-
--- experiment, we have to load the definitions immediately as they precede
--- the definition so they need to be initialized in the typescript
-
-local function withscriptcode(tfmdata,unicode,data,action)
- if type(unicode) == "string" then
- local p, u = match(unicode,"^(.-):(.-)$")
- if u then
- u = tonumber(u)
- if u then
- local slots = fonts.helpers.mathscriptslots(tfmdata,u)
- if slots then
- if p == "*" then
- action(u,data)
- for i=1,#slots do
- action(slots[i],data)
- end
- else
- p = tonumber(p)
- if p then
- action(slots[p],data)
- end
- end
- end
- end
- end
- else
- action(unicode,data)
- end
-end
-
-local function finalize(tfmdata,feature,value)
--- if tfmdata.mathparameters then -- funny, cambria text has this
- local goodies = tfmdata.goodies
- if goodies then
- local virtualized = mathematics.virtualized
- for i=1,#goodies do
- local goodie = goodies[i]
- local mathematics = goodie.mathematics
- local dimensions = mathematics and mathematics.dimensions
- if dimensions then
- if trace_defining then
- report_math("overloading dimensions in %a @ %p",tfmdata.properties.fullname,tfmdata.parameters.size)
- end
- local characters = tfmdata.characters
- local descriptions = tfmdata.descriptions
- local parameters = tfmdata.parameters
- local factor = parameters.factor
- local hfactor = parameters.hfactor
- local vfactor = parameters.vfactor
- --
- tfmdata.type = "virtual"
- tfmdata.properties.virtualized = true
- --
- local function overloadone(unicode,data)
- local character = characters[unicode]
- if not character then
- local c = virtualized[unicode]
- if c then
- character = characters[c]
- end
- end
- if character then
- local width = data.width
- local height = data.height
- local depth = data.depth
- if trace_defining and (width or height or depth) then
- report_math("overloading dimensions of %C, width %p, height %p, depth %p",
- unicode,width or 0,height or 0,depth or 0)
- end
- if width then character.width = width * hfactor end
- if height then character.height = height * vfactor end
- if depth then character.depth = depth * vfactor end
- --
- local xoffset = data.xoffset
- local yoffset = data.yoffset
- if xoffset == "llx" then
- local d = descriptions[unicode]
- if d then
- xoffset = - d.boundingbox[1] * hfactor
- character.width = character.width + xoffset
- xoffset = rightcommand[xoffset]
- else
- xoffset = nil
- end
- elseif xoffset and xoffset ~= 0 then
- xoffset = rightcommand[xoffset * hfactor]
- else
- xoffset = nil
- end
- if yoffset and yoffset ~= 0 then
- yoffset = upcommand[yoffset * vfactor]
- else
- yoffset = nil
- end
- if xoffset or yoffset then
- local commands = characters.commands
- if commands then
- prependcommands(commands,yoffset,xoffset)
- else
- local slot = charcommand[unicode]
- if xoffset and yoffset then
- character.commands = { xoffset, yoffset, slot }
- elseif xoffset then
- character.commands = { xoffset, slot }
- else
- character.commands = { yoffset, slot }
- end
- end
- end
- elseif trace_defining then
- report_math("no overloading dimensions of %C, not in font",unicode)
- end
- end
- local function overload(dimensions)
- for unicode, data in next, dimensions do
- withscriptcode(tfmdata,unicode,data,overloadone)
- end
- end
- if value == nil then
- value = { "default" }
- end
- if value == "all" or value == true then
- for name, value in next, dimensions do
- overload(value)
- end
- else
- if type(value) == "string" then
- value = utilities.parsers.settings_to_array(value)
- end
- if type(value) == "table" then
- for i=1,#value do
- local d = dimensions[value[i]]
- if d then
- overload(d)
- end
- end
- end
- end
- end
- end
- end
-end
-
-registerotffeature {
- name = "mathdimensions",
- description = "manipulate math dimensions",
- -- default = true,
- manipulators = {
- base = finalize,
- node = finalize,
- }
-}
+local insertnodeafter = nuts.insertafter
local function initialize(goodies)
local mathgoodies = goodies.mathematics
@@ -224,122 +64,6 @@ end
fontgoodies.register("mathematics", initialize)
--- local enabled = false directives.register("fontgoodies.mathkerning",function(v) enabled = v end)
-
-local function initialize(tfmdata)
--- if enabled and tfmdata.mathparameters then -- funny, cambria text has this
- if tfmdata.mathparameters then -- funny, cambria text has this
- local goodies = tfmdata.goodies
- if goodies then
- local characters = tfmdata.characters
- if characters[0x1D44E] then -- 119886
- -- we have at least an italic a
- for i=1,#goodies do
- local mathgoodies = goodies[i].mathematics
- if mathgoodies then
- local kerns = mathgoodies.kerns
- if kerns then
- local function kernone(unicode,data)
- local chardata = characters[unicode]
- if chardata and (not chardata.mathkerns or data.force) then
- chardata.mathkerns = data
- end
- end
- for unicode, data in next, kerns do
- withscriptcode(tfmdata,unicode,data,kernone)
- end
- return
- end
- end
- end
- else
- return -- no proper math font anyway
- end
- end
- end
-end
-
-registerotffeature {
- name = "mathkerns",
- description = "math kerns",
- -- default = true,
- initializers = {
- base = initialize,
- node = initialize,
- }
-}
-
--- math italics (not really needed)
---
--- it would be nice to have a \noitalics\font option
-
-local function initialize(tfmdata)
- local goodies = tfmdata.goodies
- if goodies then
- local shared = tfmdata.shared
- for i=1,#goodies do
- local mathgoodies = goodies[i].mathematics
- if mathgoodies then
- local mathitalics = mathgoodies.italics
- if mathitalics then
- local properties = tfmdata.properties
- if properties.setitalics then
- mathitalics = mathitalics[file.nameonly(properties.name)] or mathitalics
- if mathitalics then
- if trace_goodies then
- report_goodies("loading mathitalics for font %a",properties.name)
- end
- local corrections = mathitalics.corrections
- local defaultfactor = mathitalics.defaultfactor
- -- properties.mathitalic_defaultfactor = defaultfactor -- we inherit outer one anyway (name will change)
- if corrections then
- fontgoodies.registerpostprocessor(tfmdata, function(tfmdata) -- this is another tfmdata (a copy)
- -- better make a helper so that we have less code being defined
- local properties = tfmdata.properties
- local parameters = tfmdata.parameters
- local characters = tfmdata.characters
- properties.mathitalic_defaultfactor = defaultfactor
- properties.mathitalic_defaultvalue = defaultfactor * parameters.quad
- if trace_goodies then
- report_goodies("assigning mathitalics for font %a",properties.name)
- end
- local quad = parameters.quad
- local hfactor = parameters.hfactor
- for k, v in next, corrections do
- local c = characters[k]
- if c then
- if v > -1 and v < 1 then
- c.italic = v * quad
- else
- c.italic = v * hfactor
- end
- else
- report_goodies("invalid mathitalics entry %U for font %a",k,properties.name)
- end
- end
- end)
- end
- return -- maybe not as these can accumulate
- end
- end
- end
- end
- end
- end
-end
-
-registerotffeature {
- name = "mathitalics",
- description = "additional math italic corrections",
- -- default = true,
- initializers = {
- base = initialize,
- node = initialize,
- }
-}
-
--- fontgoodies.register("mathitalics", initialize)
-
local function mathradicalaction(n,h,v,font,mchar,echar)
local characters = fontcharacters[font]
local mchardata = characters[mchar]
@@ -365,7 +89,7 @@ local function mathradicalaction(n,h,v,font,mchar,echar)
local kern = new_kern(height-v)
list = setlink(kern,list)
local list = new_vlist(kern)
- insert_node_after(n,n,list)
+ insertnodeafter(n,n,list)
end
local function mathhruleaction(n,h,v,font,bchar,mchar,echar)
@@ -401,7 +125,7 @@ local function mathhruleaction(n,h,v,font,bchar,mchar,echar)
local kern = new_kern(height-v)
list = setlink(kern,list)
local list = new_vlist(kern)
- insert_node_after(n,n,list)
+ insertnodeafter(n,n,list)
end
local function initialize(tfmdata)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/grph-epd.lmt b/Master/texmf-dist/tex/context/base/mkxl/grph-epd.lmt
new file mode 100644
index 00000000000..505599fff18
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/grph-epd.lmt
@@ -0,0 +1,58 @@
+if not modules then modules = { } end modules ['grph-epd'] = {
+ version = 1.001,
+ comment = "companion to grph-epd.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local variables = interfaces.variables
+local settings_to_hash = utilities.parsers.settings_to_hash
+local codeinjections = backends.registered.pdf.codeinjections
+
+local trace = false trackers.register("figures.merging", function(v) trace = v end)
+
+local report = logs.reporter("backend","merging")
+
+local function mergegoodies(optionlist)
+ local options = settings_to_hash(optionlist)
+ local yes = options[variables.yes]
+ local all = options[variables.all]
+ if next(options) then
+ report("% t",table.sortedkeys(options))
+ end
+ if all or yes or options[variables.reference] then
+ codeinjections.mergereferences()
+ end
+ if all or options[variables.comment] then
+ codeinjections.mergecomments()
+ end
+ if all or yes or options[variables.bookmark] then
+ codeinjections.mergebookmarks()
+ end
+ if all or options[variables.field] then
+ codeinjections.mergefields()
+ end
+ if all or options[variables.layer] then
+ codeinjections.mergeviewerlayers()
+ end
+ if all or options[variables.media] then
+ codeinjections.mergerenditions()
+ end
+ codeinjections.flushmergelayer()
+end
+
+function figures.mergegoodies(optionlist)
+ -- todo: we can use runlocal instead
+ context.stepwise(function()
+ -- we use stepwise because we might need to define symbols
+ -- for stamps that have no default appearance
+ mergegoodies(optionlist)
+ end)
+end
+
+interfaces.implement {
+ name = "figure_mergegoodies",
+ actions = figures.mergegoodies,
+ arguments = "string"
+}
diff --git a/Master/texmf-dist/tex/context/base/mkiv/grph-epd.lua b/Master/texmf-dist/tex/context/base/mkxl/grph-epd.lua
index 0993270f14a..0993270f14a 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/grph-epd.lua
+++ b/Master/texmf-dist/tex/context/base/mkxl/grph-epd.lua
diff --git a/Master/texmf-dist/tex/context/base/mkxl/grph-epd.mkxl b/Master/texmf-dist/tex/context/base/mkxl/grph-epd.mkxl
index 7ff9b86756e..a26ee3235f0 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/grph-epd.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/grph-epd.mkxl
@@ -15,11 +15,11 @@
\unprotect
-\registerctxluafile{grph-epd}{}
+\registerctxluafile{grph-epd}{autosuffix}
% hm, this one is globally overloaded
-\mutable\let\mergedfigurereference\empty
+\mutable\lettonothing\mergedfigurereference
\defineoverlay[system:graphics:epdf][\directsetup{system:graphics:epdf}]
diff --git a/Master/texmf-dist/tex/context/base/mkxl/grph-fig.mkxl b/Master/texmf-dist/tex/context/base/mkxl/grph-fig.mkxl
index 92d2c7dc69a..e25c9cf3291 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/grph-fig.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/grph-fig.mkxl
@@ -31,7 +31,7 @@
\newconstant\c_grph_buffers_mode
-\mutable\let\lasttypesetbuffer\empty
+\mutable\lettonothing\lasttypesetbuffer
\permanent\protected\def\typesetbuffer {\bgroup\setconstant\c_grph_buffers_mode\plusone \grph_buffers_typeset}
\permanent\protected\def\typesetbufferonly{\bgroup\setconstant\c_grph_buffers_mode\zerocount\grph_buffers_typeset}
@@ -78,7 +78,9 @@
\installcorenamespace{typesettingfile}
\tolerant\permanent\protected\def\definetypesetting[#1]#*[#2]#*[#3]% <name> options settings-a
- {\ifparameter#1\or\setuvalue{\??typesettingfile#1}{\grph_typesetting_process_indeed{#2}{#3}}\fi}
+ {\ifparameter#1\or
+ \frozen\instance\protected\defcsname\??typesettingfile#1\endcsname{\grph_typesetting_process_indeed{#2}{#3}}%
+ \fi}
\tolerant\permanent\protected\def\typesetfile[#1]#*[#2]#*[#3]% <name> filename settings-b | filename options settings
{\ifcsname\??typesettingfile#1\endcsname
@@ -100,45 +102,57 @@
\endgroup}
%D Whatever ... hardly used ... but historic ... needs checking ... will probably
-%D become m-fig-nn.mkiv .. or I will extend it cq. clean it up when I needed it.
-%D After all, it's documented in old manuals.
-
-\newcount\c_grph_steps_reference
-\newdimen\d_grph_steps_x
-\newdimen\d_grph_steps_y
-\newbox \b_grph_steps_colorbar
+%D become m-fig-nn.mkiv .. or I will extend it cq. clean it up when I needed it;
+%D after all, it's documented in old manuals.
+%D
+%D \stoptyping
+%D \startfigure[mycow][t:/sources/cow.pdf][width=4cm]
+%D % one can also use layers
+%D \stopfigure
+%D
+%D \externalfigure[mycow]
+%D \stoptyping
+
+\newinteger \c_grph_steps_reference
+\newdimension\d_grph_steps_x
+\newdimension\d_grph_steps_y
+\newbox \b_grph_steps_colorbar
\ifdefined\referring\else \mutable\let\referring\relax \fi
\ifdefined\marking \else \mutable\let\marking \relax \fi
\ifdefined\remark \else \mutable\let\remark \relax \fi
\ifdefined\colorbar \else \mutable\let\colorbar \relax \fi
-\tolerant\protected\def\grph_steps_place_figure#1#2#3#4[#5]%
- {\hpack
- {\setbox\scratchbox\hpack
- {\useexternalfigure[\s!dummy][#2][#3,#5]%
- \externalfigure[\s!dummy]}%
- \grph_steps_calculate
- \startpositioning
- \enforced\let\referring\grph_steps_one_referring
- \enforced\let\marking \grph_steps_one_marking
- \enforced\let\remark \grph_steps_one_remark
- \enforced\let\colorbar \grph_steps_one_colorbar
- \position(0,0){\box\scratchbox}%
- \linewidth\onepoint
- \setuppositioning
- [\c!unit=pt,%
- \c!xscale=\withoutpt\the\d_grph_steps_x,%
- \c!yscale=\withoutpt\the\d_grph_steps_y,%
- \c!factor=1]%
- \ignorespaces#4%
- \enforced\let\referring\grph_steps_two_referring
- \enforced\let\marking \grph_steps_two_marking
- \enforced\let\remark \grph_steps_two_remark
- \enforced\let\colorbar \grph_steps_two_colorbar
- \ignorespaces#4\removeunwantedspaces % or just grab #4 unspaced
- \stoppositioning
- \ifvoid\b_grph_steps_colorbar\else\box\b_grph_steps_colorbar\fi}} % not really needed
+\tolerant\protected\def\grph_steps_place_figure#1#2#3#4#5%
+ {\hbox\bgroup
+ \setbox\scratchbox\hbox % somehow a space creeps in
+ {% we can use \nospaces\plusone
+ \useexternalfigure[\s!dummy][#2][#3,#5]%
+ \externalfigure[\s!dummy]}%
+ \setbox\scratchbox\hbox
+ {\externalfigure[#2][#3,#5]}%
+ \grph_steps_calculate
+ \startpositioning
+ \enforced\let\referring\grph_steps_one_referring
+ \enforced\let\marking \grph_steps_one_marking
+ \enforced\let\remark \grph_steps_one_remark
+ \enforced\let\colorbar \grph_steps_one_colorbar
+ \position(0,0){\box\scratchbox}%
+ \linewidth\onepoint
+ \setuppositioning
+ [\c!unit=pt,%
+ \c!xscale=\toscaled\d_grph_steps_x,%
+ \c!yscale=\toscaled\d_grph_steps_y,%
+ \c!factor=1]%
+ \ignorespaces#4%
+ \enforced\let\referring\grph_steps_two_referring
+ \enforced\let\marking \grph_steps_two_marking
+ \enforced\let\remark \grph_steps_two_remark
+ \enforced\let\colorbar \grph_steps_two_colorbar
+ \ignorespaces#4\removeunwantedspaces % or just grab #4 unspaced
+ \stoppositioning
+ \ifvoid\b_grph_steps_colorbar\else\box\b_grph_steps_colorbar\fi
+ \egroup}
\protected\def\grph_steps_one_referring(#1,#2)#*(#3,#4)#*[#5]%
{\position(#1,#2){\grph_steps_goto(#3,#4){\externalfigureparameter\c!frames}[#5]}}
@@ -174,10 +188,12 @@
{\grph_steps_test_figure{#1}{#2}{#3}{#4}%
\letexternalfigureparameter\c!frames\v!on}%
{\letexternalfigureparameter\c!frames\v!off}%
- \setvalue{\??externalfigureinstance#1}%
- {\grph_steps_place_figure{#1}{#2}{#3}{#4}}}
+ \tolerant\defcsname\??externalfigureinstance#1\endcsname[##1]%
+ {\grph_steps_place_figure{#1}{#2}{#3}{#4}{##1}%
+ % this is a dirty hack but ok for an old macro
+ \enforced\let\figurestatus\plusone}}
-\aliased\let\stopfigure\relax
+\permanent\protected\lettonothing\stopfigure
\ifdefined\referring \else \let\referring\relax \fi
\ifdefined\marking \else \let\marking \relax \fi
@@ -203,9 +219,9 @@
\position(0,0)
{\basegrid
[\c!nx=\externalfigureparameter\c!xmax,%
- \c!dx=\withoutpt\the\d_grph_steps_x,%
+ \c!dx=\toscaled\d_grph_steps_x,%
\c!ny=\externalfigureparameter\c!ymax,%
- \c!dy=\withoutpt\the\d_grph_steps_y,%
+ \c!dy=\toscaled\d_grph_steps_y,%
\c!xstep=1,%
\c!ystep=1,%
\c!scale=1,%
@@ -213,8 +229,8 @@
\c!unit=pt]}%
\setuppositioning
[\c!unit=pt,%
- \c!xscale=\withoutpt\the\d_grph_steps_x,%
- \c!yscale=\withoutpt\the\d_grph_steps_y,%
+ \c!xscale=\toscaled\d_grph_steps_x,%
+ \c!yscale=\toscaled\d_grph_steps_y,%
\c!factor=1]%
\linewidth\onepoint
\ignorespaces#4\removeunwantedspaces % or just grab #4 unspaced
@@ -248,7 +264,7 @@
\definesystemconstant{vwb}
\tolerant\protected\def\grph_steps_three_referring(#1,#2)#*(#3,#4)#*[#5]%
- {\advance\c_grph_steps_reference\plusone
+ {\advanceby\c_grph_steps_reference\plusone
\position(#1,#2)
{\hbox{\the\c_grph_steps_reference}}%
\position(#1,#2)
@@ -275,15 +291,15 @@
\setexternalfigureparameter\c!ymax{24}%
\fi
\d_grph_steps_y\figureheight
- \divide\d_grph_steps_y \externalfigureparameter\c!ymax
+ \divideby\d_grph_steps_y \externalfigureparameter\c!ymax
\d_grph_steps_x\d_grph_steps_y
\scratchdimen\figurewidth
- \advance\scratchdimen\d_grph_steps_y
- \divide \scratchdimen\d_grph_steps_y
+ \advanceby\scratchdimen\d_grph_steps_y
+ \divideby \scratchdimen\d_grph_steps_y
\setexternalfigureparameter\c!xmax{\number\scratchdimen}%
\else
- \d_grph_steps_x\figurewidth \divide\d_grph_steps_x \externalfigureparameter\c!xmax\relax
- \d_grph_steps_y\figureheight \divide\d_grph_steps_y \externalfigureparameter\c!ymax\relax
+ \d_grph_steps_x\figurewidth \divideby\d_grph_steps_x \externalfigureparameter\c!xmax\relax
+ \d_grph_steps_y\figureheight \divideby\d_grph_steps_y \externalfigureparameter\c!ymax\relax
\fi}
\tolerant\def\grph_steps_comment#1(#2,#3)#*(#4,#5)#*[#6]#*#:#7% {kader}(x,y)(h,b)[...]{tekst}
@@ -298,7 +314,7 @@
{\gotobox{\vpack{\grph_steps_area(#1,#2)#3{}}}[#4]}
\tolerant\def\grph_steps_text#1(#2,#3)#*(#4,#5)#*[#6]%
- {\advance\c_grph_steps_reference\plusone
+ {\advanceby\c_grph_steps_reference\plusone
\hbox % \hpack ?
{\quad
\thisissomeinternal\s!vwb{#6}%
diff --git a/Master/texmf-dist/tex/context/base/mkxl/grph-inc.lmt b/Master/texmf-dist/tex/context/base/mkxl/grph-inc.lmt
index 4fa562cb8cd..e55ac471b1e 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/grph-inc.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/grph-inc.lmt
@@ -78,9 +78,10 @@ local resolveprefix = resolvers.resolve
local texgetbox = tex.getbox
local texsetbox = tex.setbox
-local hpack = node.hpack
+local hpack = nodes.hpack
local new_latelua = nodes.pool.latelua
+local new_hlist = nodes.pool.hlist
local context = context
@@ -174,8 +175,8 @@ local imagekeys = {
}
local imagesizes = {
- art = true, bleed = true, crop = true,
- media = true, none = true, trim = true,
+ art = true, bleed = true, crop = true,
+ media = true, none = true, trim = true,
}
local imagetypes = { [0] =
@@ -190,26 +191,28 @@ images.keys = imagekeys
images.types = imagetypes
images.sizes = imagesizes
+local codeinjections = backends.codeinjections
+
local function createimage(specification)
- return backends.codeinjections.newimage(specification)
+ return codeinjections.newimage(specification)
end
local function copyimage(specification)
- return backends.codeinjections.copyimage(specification)
+ return codeinjections.copyimage(specification)
end
local function scanimage(specification)
- return backends.codeinjections.scanimage(specification)
+ return codeinjections.scanimage(specification)
end
local function embedimage(specification)
- -- write the image to file
- return backends.codeinjections.embedimage(specification)
+ -- write the image to file
+ return codeinjections.embedimage(specification)
end
local function wrapimage(specification)
-- create an image rule
- return backends.codeinjections.wrapimage(specification)
+ return codeinjections.wrapimage(specification)
end
images.create = createimage
@@ -303,9 +306,10 @@ local remappers = allocate() figures.remappers = remappers
local converters = allocate() figures.converters = converters
local identifiers = allocate() figures.identifiers = identifiers
local programs = allocate() figures.programs = programs
+local conversions = allocate() figures.conversions = conversions
-local defaultformat = "pdf"
-local defaultprefix = "m_k_i_v_"
+local defaultformat <const> = "pdf"
+local defaultprefix <const> = "m_k_i_v_"
figures.localpaths = allocate {
".", "..", "../.."
@@ -321,7 +325,8 @@ local figure_paths = allocate(table.copy(figures.localpaths))
figures.paths = figure_paths
local figures_order = allocate {
- "pdf", "mps", "jpg", "png", "jp2", "jbig", "svg", "eps", "tif", "gif", "mov", "buffer", "tex", "cld", "auto",
+ -- "mov" is gone
+ "pdf", "mps", "jpg", "png", "jp2", "jbig", "svg", "eps", "tif", "gif", "buffer", "tex", "cld", "auto",
}
local figures_formats = allocate { -- magic and order will move here
@@ -335,7 +340,7 @@ local figures_formats = allocate { -- magic and order will move here
["eps"] = { list = { "eps", "ai" } },
["gif"] = { list = { "gif" } },
["tif"] = { list = { "tif", "tiff" } },
- ["mov"] = { list = { "mov", "flv", "mp4" } }, -- "avi" is not supported
+ -- ["mov"] = { list = { "mov", "flv", "mp4" } }, -- "avi" is not supported
["buffer"] = { list = { "tmp", "buffer", "buf" } },
["tex"] = { list = { "tex" } },
["cld"] = { list = { "cld" } },
@@ -440,14 +445,14 @@ function figures.setorder(list) -- can be table or string
end
end
-local function guessfromstring(str)
+local function guessfromstring(str,name)
if str then
for i=1,#figures_magics do
local pattern = figures_magics[i]
if lpegmatch(pattern.pattern,str) then
local format = pattern.format
- if trace_figures then
- report_inclusion("file %a has format %a",filename,format)
+ if trace_figures and name then
+ report_inclusion("file %a has format %a",name,format)
end
return format
end
@@ -554,6 +559,11 @@ function figures.setpaths(locationset,pathlist)
end
end
end
+ -- new
+ if environment.arguments.path then
+ table.insert(t,1,environment.arguments.path)
+ end
+ --
figure_paths = t
last_pathlist = pathlist
figures.paths = figure_paths
@@ -587,6 +597,7 @@ local function new() -- we could use metatables status -> used -> request but it
controls = false,
display = false,
mask = false,
+ crop = false,
conversion = false,
resolution = false,
color = false,
@@ -671,6 +682,13 @@ function figures.current()
return callstack[#callstack] or lastfiguredata
end
+function figures.setconversion(format,conversion)
+ if conversion == "reset" or conversion == "" then
+ conversion = nil
+ end
+ conversions[format] = conversion
+end
+
local function get(category,tag,default)
local value = lastfiguredata and lastfiguredata[category]
value = value and value[tag]
@@ -766,18 +784,23 @@ local function register(askedname,specification)
local conversion = wipe(specification.conversion)
local resolution = wipe(specification.resolution)
local arguments = wipe(specification.arguments)
+ local crop = wipe(specification.crop)
local newformat = conversion
if not newformat or newformat == "" then
newformat = defaultformat
end
+ --
+ conversion = conversions[format] or conversion
+ --
if trace_conversion then
- report_inclusion("checking conversion of %a, fullname %a, old format %a, new format %a, conversion %a, resolution %a, arguments %a",
+ report_inclusion("checking conversion of %a, fullname %a, old format %a, new format %a, conversion %a, resolution %a, crop %a, arguments %a",
askedname,
specification.fullname,
format,
newformat,
conversion or "default",
resolution or "default",
+ crop or "default",
arguments or ""
)
end
@@ -793,7 +816,7 @@ local function register(askedname,specification)
end
end
-- end of quick hack
- local converter = (not remapper) and (newformat ~= format or resolution or arguments) and converters[format]
+ local converter = (not remapper) and (newformat ~= format or resolution or arguments) and converters[format] -- no crop here
if converter then
local okay = converter[newformat]
if okay then
@@ -813,6 +836,10 @@ local function register(askedname,specification)
local oldname = specification.fullname
local newpath = file.dirname(oldname)
local oldbase = file.basename(oldname)
+ local runpath = environment.arguments.runpath
+ if runpath and runpath ~= "" and newpath == environment.arguments.path then
+ newpath = runpath
+ end
--
-- problem: we can have weird filenames, like a.b.c (no suffix) and a.b.c.gif
-- so we cannot safely remove a suffix (unless we do that for known suffixes)
@@ -853,6 +880,10 @@ local function register(askedname,specification)
if arguments then
hash = hash .. "[a:" .. arguments .. "]"
end
+ if crop then
+ hash = hash .. "[c:" .. crop .. "]"
+ end
+ newbase = gsub(newbase,"%.","_") -- nicer to have no suffix in the name
if hash ~= "" then
newbase = newbase .. "_" .. md5.hex(hash)
end
@@ -877,7 +908,7 @@ local function register(askedname,specification)
if trace_conversion then
report_inclusion("converting %a (%a) from %a to %a",askedname,oldname,format,newformat)
end
- converter(oldname,newname,resolution or "", arguments or "")
+ converter(oldname,newname,resolution or "", arguments or "",specification) -- in retrospect a table
else
if trace_conversion then
report_inclusion("no need to convert %a (%a) from %a to %a",askedname,oldname,format,newformat)
@@ -971,18 +1002,19 @@ local function locate(request) -- name, format, cache
local askedconversion = request.conversion
local askedresolution = request.resolution
local askedarguments = request.arguments
+ local askedcrop = request.crop
local askedhash = f_hash_part(
askedname,
askedconversion or "default",
askedresolution or "default",
+ askedcrop or "default",
askedarguments or ""
)
- local foundname = figures_found[askedhash]
+ local foundname = figures_found[askedhash]
if foundname then
return foundname
end
--
- --
local askedformat = request.format
if not askedformat or askedformat == "" or askedformat == "unknown" then
askedformat = file.suffix(askedname) or ""
@@ -1004,14 +1036,30 @@ local function locate(request) -- name, format, cache
end
else
local foundname = resolvers.findbinfile(askedname)
- if not foundname or not isfile(foundname) then -- foundname can be dummy
+ -- we need a neutral isfile
+ if foundname then
+ if hashed.scheme == "file" and not isfile(foundname) then
+ foundname = false
+ end
+ end
+ if not foundname then -- foundname can be dummy
if trace_figures then
report_inclusion("unknown url %a",askedname)
end
-- url not found
return register(askedname)
end
- local guessedformat = figures.guess(foundname)
+ -- ok for now but we need a loadbinfile option to emulate a file
+ -- so that we justy share it .. we now rely on os caching of files
+ -- but normally scheme based files are not that large anyway
+ local guessedformat = false
+ if hashed.scheme == "file" then
+ guessedformat = figures.guess(foundname)
+ else
+ -- kind of costly: todo pseudo file and just acccess
+ local found, data = resolvers.loadbinfile(foundname)
+ guessedformat = figures.guessfromstring(data)
+ end
if askedformat ~= guessedformat then
if trace_figures then
report_inclusion("url %a has unknown format",askedname)
@@ -1029,6 +1077,7 @@ local function locate(request) -- name, format, cache
cache = askedcache,
conversion = askedconversion,
resolution = askedresolution,
+ crop = askedcrop,
arguments = askedarguments,
})
end
@@ -1066,6 +1115,7 @@ local function locate(request) -- name, format, cache
conversion = askedconversion,
resolution = askedresolution,
arguments = askedarguments,
+ crop = askedcrop,
internal = internal,
})
elseif quitscanning then
@@ -1086,6 +1136,7 @@ local function locate(request) -- name, format, cache
cache = askedcache,
conversion = askedconversion,
resolution = askedresolution,
+ crop = askedcrop,
arguments = askedarguments,
})
end
@@ -1105,6 +1156,7 @@ local function locate(request) -- name, format, cache
cache = askedcache,
conversion = askedconversion,
resolution = askedresolution,
+ crop = askedcrop,
arguments = askedarguments,
})
end
@@ -1119,6 +1171,7 @@ local function locate(request) -- name, format, cache
cache = askedcache,
conversion = askedconversion,
resolution = askedresolution,
+ crop = askedcrop,
arguments = askedarguments,
})
end
@@ -1143,6 +1196,7 @@ local function locate(request) -- name, format, cache
cache = askedcache,
conversion = askedconversion,
resolution = askedresolution,
+ crop = askedcrop,
arguments = askedarguments,
})
end
@@ -1178,6 +1232,7 @@ local function locate(request) -- name, format, cache
cache = askedcache,
conversion = askedconversion,
resolution = askedresolution,
+ crop = askedcrop,
arguments = askedarguments
})
end
@@ -1206,6 +1261,7 @@ local function locate(request) -- name, format, cache
cache = askedcache,
conversion = askedconversion,
resolution = askedresolution,
+ crop = askedcrop,
arguments = askedarguments,
})
end
@@ -1231,6 +1287,7 @@ local function locate(request) -- name, format, cache
cache = askedcache,
conversion = askedconversion,
resolution = askedresolution,
+ crop = askedcrop,
arguments = askedarguments,
})
end
@@ -1241,6 +1298,7 @@ local function locate(request) -- name, format, cache
return register(askedname, { -- these two are needed for hashing 'found'
conversion = askedconversion,
resolution = askedresolution,
+ crop = askedcrop,
arguments = askedarguments,
})
end
@@ -1269,8 +1327,7 @@ function figures.identify(data)
for i=1,#list do
local identifier = list[i]
local data = identifier(data)
--- if data and (not data.status and data.status.status > 0) then
- if data and (not data.status and data.status.status > 0) then
+ if data and data.status and (not data.status and data.status.status > 0) then
break
end
end
@@ -1373,7 +1430,7 @@ end
function figures.dummy(data)
data = data or callstack[#callstack] or lastfiguredata
local dr, du, nr = data.request, data.used, figures.boxnumber
- local box = hpack(node.new("hlist")) -- we need to set the dir (luatex 0.60 buglet)
+ local box = hpack(new_hlist()) -- we need to set the dir (luatex 0.60 buglet)
du.width = du.width or figures.defaultwidth
du.height = du.height or figures.defaultheight
du.depth = du.depth or figures.defaultdepth
@@ -1448,13 +1505,14 @@ end
local pagecount = { }
-function checkers.generic(data)
+function checkers.generic(data) -- called by checkers.pdf/png/jpg
local dr, du, ds = data.request, data.used, data.status
local name = du.fullname or "unknown generic"
local page = du.page or dr.page
local size = dr.size or "crop"
local color = dr.color or "natural"
local mask = dr.mask or "none"
+ local crop = dr.crop or "none"
local conversion = dr.conversion
local resolution = dr.resolution
local arguments = dr.arguments
@@ -1476,6 +1534,7 @@ function checkers.generic(data)
size,
color,
mask,
+ crop,
conversion,
resolution,
arguments
@@ -1643,35 +1702,35 @@ includers.nongeneric = includers_nongeneric
-- -- -- mov -- -- --
-function checkers.mov(data)
- local dr, du, ds = data.request, data.used, data.status
- local width = todimen(dr.width or figures.defaultwidth)
- local height = todimen(dr.height or figures.defaultheight)
- local foundname = du.fullname
- dr.width, dr.height = width, height
- du.width, du.height, du.foundname = width, height, foundname
- if trace_inclusion then
- report_inclusion("including movie %a, width %p, height %p",foundname,width,height)
- end
- -- we need to push the node.write in between ... we could make a shared helper for this
- ctx_startfoundexternalfigure(width .. "sp",height .. "sp")
- context(function()
- nodeinjections.insertmovie {
- width = width,
- height = height,
- factor = bpfactor,
- ["repeat"] = dr["repeat"],
- controls = dr.controls,
- preview = dr.preview,
- label = dr.label,
- foundname = foundname,
- }
- end)
- ctx_stopfoundexternalfigure()
- return data
-end
-
-includers.mov = includers.nongeneric
+-- function checkers.mov(data)
+-- local dr, du, ds = data.request, data.used, data.status
+-- local width = todimen(dr.width or figures.defaultwidth)
+-- local height = todimen(dr.height or figures.defaultheight)
+-- local foundname = du.fullname
+-- dr.width, dr.height = width, height
+-- du.width, du.height, du.foundname = width, height, foundname
+-- if trace_inclusion then
+-- report_inclusion("including movie %a, width %p, height %p",foundname,width,height)
+-- end
+-- -- we need to push the node.write in between ... we could make a shared helper for this
+-- ctx_startfoundexternalfigure(width .. "sp",height .. "sp")
+-- context(function()
+-- nodeinjections.insertmovie {
+-- width = width,
+-- height = height,
+-- factor = bpfactor,
+-- ["repeat"] = dr["repeat"],
+-- controls = dr.controls,
+-- preview = dr.preview,
+-- label = dr.label,
+-- foundname = foundname,
+-- }
+-- end)
+-- ctx_stopfoundexternalfigure()
+-- return data
+-- end
+--
+-- includers.mov = includers.nongeneric
-- -- -- mps -- -- --
@@ -2071,6 +2130,7 @@ implement {
{ "preview" },
{ "display" },
{ "mask" },
+ { "crop" },
{ "conversion" },
{ "resolution" },
{ "color" },
@@ -2158,3 +2218,94 @@ implement {
end
end
}
+
+implement {
+ name = "setfigureconversion",
+ arguments = "2 strings",
+ actions = figures.setconversion
+}
+
+-- for the moment we keep this here:
+
+do
+
+ local stores = setmetatableindex("table")
+ local defaultwidth = 6553600 -- maybe bp
+
+ function images.resetstore(name)
+ stores[name] = { }
+ end
+
+ local function resetdata(name,n)
+ local store = stores[name]
+ store[n] = false
+ end
+
+ local function storedata(name,data)
+ local store = stores[name]
+ store[#store+1] = data
+ return #store
+ end
+
+ local function fetchdata(name,n)
+ local store = stores[name]
+ return store and store[n]
+ end
+
+ images.storedata = storedata
+ images.fetchdata = fetchdata
+ images.resetdata = resetdata
+
+ -- function images.filetostore(name,kind,filename)
+ -- return storedata(name, {
+ -- data = io.loaddata(filename),
+ -- kind = kind or file.suffix(filename),
+ -- })
+ -- end
+ --
+ -- function images.datatostore(name,kind,data)
+ -- return storedata(name, {
+ -- data = data,
+ -- kind = kind,
+ -- })
+ -- end
+
+ -- local embedimage = images.embed
+ -- local wrapimage = images.wrap
+
+ function images.embedfromstore(name,n,reset)
+ local blob = fetchdata(name,n)
+ if blob then
+ local kind = blob.kind
+ if kind then
+ local identify = graphics.identifiers[kind]
+ local inject = backends.codeinjections[kind]
+ if identify and inject then
+ local info = blob.info or identify(blob.data,"string") -- could already be done
+ if info then
+ info.width = defaultwidth
+ info.height = (info.ysize /info.xsize) * defaultwidth
+ local image = blob.image
+ if not image then
+ image = inject(info,"string")
+ blob.image = image
+ end
+ image.width = info.width
+ image.height = info.height
+ context(wrapimage(image))
+ -- if reset then
+ -- resetdata(name,n)
+ -- end
+ end
+ end
+ end
+ end
+ end
+
+ implement {
+ name = "embedimagefromstore",
+ arguments = { "string", "integer", "boolean" },
+ actions = images.embedfromstore,
+ }
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/grph-inc.mkxl b/Master/texmf-dist/tex/context/base/mkxl/grph-inc.mkxl
index 3c2e8e5c1d9..b8fd40a8991 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/grph-inc.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/grph-inc.mkxl
@@ -114,14 +114,15 @@
\c!ownerpassword =,
\c!compact =,
\c!cmyk =,
+ \c!crop =\v!yes,
]
%D Defining figures.
-\newcount\c_grph_include_nesting
+\newinteger\c_grph_include_nesting
-\newtoks \everyexternalfigureresets % for the moment still public
-\newtoks \everyexternalfigurechecks % for the moment still public
+\newtoks \everyexternalfigureresets % for the moment still public
+\newtoks \everyexternalfigurechecks % for the moment still public
% \useexternalfigure[alpha][cow]
% \useexternalfigure[beta] [cow] [width=1cm]
@@ -210,12 +211,12 @@
\fi}
\def\grph_include_use_indeed#1#2#3#4%
- {\dodoglobal\setvalue{\??externalfigureinstance#1}{\grph_include_setup{#2}{#3}{#4}}%
+ {\dodoglobal\defcsname\??externalfigureinstance#1\endcsname{\grph_include_setup{#2}{#3}{#4}}%
\grph_include_analyze_collection[#2][#4]}
% inclusion
-\permanent\tolerant\protected\def\externalfigure[#1]#*[#2]#*[#3]%
+\permanent\tolerant\protected\def\externalfigure[#1]#,[#2]#,[#3]%
{\ifhastok={#2}%
\grph_include_place[#1][][#2]%
\else
@@ -273,7 +274,7 @@
\def\grph_include_place[#1][#2][#3]% [label][file][settings] | [file][settings] | [file][parent][settings]
{\bgroup
- \advance\c_grph_include_nesting\plusone
+ \advanceby\c_grph_include_nesting\plusone
\edef\currentexternalfigure{\the\c_grph_include_nesting}%
\checkexternalfigureparent % each inherits from the root
%
@@ -332,6 +333,7 @@
compact {\externalfigureparameter\c!compact}% experiment, share fonts
userpassword {\externalfigureparameter\c!userpassword}%
ownerpassword{\externalfigureparameter\c!ownerpassword}%
+ crop {\externalfigureparameter\c!crop}%
\ifempty\p_width \else
width \dimexpr\p_width\relax
\fi
@@ -405,6 +407,9 @@
\dostoptagged
\egroup}
+\permanent\protected\def\setfigureconversion[#1]#*[#2]%
+ {\clf_setfigureconversion{#1}{#2}}
+
%D Next we provide a cross referenced scale-up mechanism:
\def\strc_references_cross_forward#1#2%
@@ -601,11 +606,17 @@
%D Internal graphics are handled at the \TEX\ end:
+% strut=none also avoids the \noindent! otherwise we're in hmode when
+% blank happens and we get a lineskip
+
\def\grph_include_process_tex#1%
{\framed
- [\c!strut=\v!no,\c!align=\v!normal,\c!frame=\v!off,
+ [\c!strut=\v!none,\c!align=\v!normal,\c!frame=\v!off,
\c!offset=\v!overlay,\c!width=\v!fit,\c!height=\v!fit]
- {\blank[\v!disable]#1\endgraf\removelastskip}} % disable should stay here!
+ {\blank[\v!disable]%
+ #1\endgraf
+ \removelastskip}} % disable should stay here!
+
% used al lua end:
@@ -709,11 +720,8 @@
\mutable\let\feedbackexternalfigure\relax % hook
-\permanent\protected\def\getfiguredimensions
- {\dodoubleempty\grph_include_get_dimensions}
-
-\def\grph_include_get_dimensions[#1][#2]%
- {\startnointerference
+\permanent\tolerant\protected\def\getfiguredimensions[#1]#*[#2]%
+ {\startnointerference % we can use \nospaces\plusone
\settrue\c_grph_include_test_only
\externalfigure[#1][#2,\c!display=,\c!mask=,\c!object=\v!no]%
\stopnointerference}
@@ -780,10 +788,10 @@
\newconditional\c_grph_include_in_collection
-\newdimen\d_grph_include_collection_minwidth
-\newdimen\d_grph_include_collection_maxwidth
-\newdimen\d_grph_include_collection_minheight
-\newdimen\d_grph_include_collection_maxheight
+\newdimension \d_grph_include_collection_minwidth
+\newdimension \d_grph_include_collection_maxwidth
+\newdimension \d_grph_include_collection_minheight
+\newdimension \d_grph_include_collection_maxheight
\def\grph_include_analyze_collection[#1][#2]%
{\ifconditional\c_grph_include_in_collection
@@ -798,7 +806,7 @@
\ifdim\scratchdimen<\d_grph_include_collection_minheight \d_grph_include_collection_minheight\scratchdimen \fi
\fi}
-\mutable\let\currentexternalfigurecollection\empty
+\mutable\lettonothing\currentexternalfigurecollection
\permanent\protected\def\startexternalfigurecollection[#1]%
{\begingroup
@@ -855,16 +863,16 @@
% Experimental (will become cleaner):
\permanent\tolerant\protected\def\includesvgfile[#1]#*[#2]%
- {\dontleavehmode\begingroup
+ {\hbox\bgroup % no \dontleavehmode
\getdummyparameters[\c!offset=\zeropoint,#2]%
\clf_includesvgfile{#1}\dimexpr\dummyparameter\c!offset\relax
- \endgroup}
+ \egroup}
\permanent\tolerant\protected\def\includesvgbuffer[#1]#*[#2]%
- {\dontleavehmode\begingroup
+ {\hbox\bgroup % no \dontleavehmode
\getdummyparameters[\c!offset=\zeropoint,#2]%
\clf_includesvgbuffer{#1}\dimexpr\dummyparameter\c!offset\relax
- \endgroup}
+ \egroup}
% Bonus:
diff --git a/Master/texmf-dist/tex/context/base/mkxl/grph-pat.mkxl b/Master/texmf-dist/tex/context/base/mkxl/grph-pat.mkxl
index 92fd5ad749a..3b51dc25873 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/grph-pat.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/grph-pat.mkxl
@@ -64,7 +64,7 @@
\endgroup}
\permanent\tolerant\protected\def\applypattern[#1]#*[#2]%
- {\hbox\bgroup
+ {\hpack\bgroup
\letdummyparameter\c!name \s!dummy
\letdummyparameter\c!width \zeropoint
\letdummyparameter\c!height\zeropoint
diff --git a/Master/texmf-dist/tex/context/base/mkxl/grph-raw.mkxl b/Master/texmf-dist/tex/context/base/mkxl/grph-raw.mkxl
index 66194551bfc..c84a3682fd3 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/grph-raw.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/grph-raw.mkxl
@@ -59,6 +59,6 @@
\permanent\protected\def\startbitmapimage[#1]#2\stopbitmapimage
{\bitmapimage[#1]{#2}}
-\aliased\let\stopbitmapimage\relax
+\permanent\protected\lettonothing\stopbitmapimage
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/grph-rul.lmt b/Master/texmf-dist/tex/context/base/mkxl/grph-rul.lmt
index d8da5f76054..c33319658a1 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/grph-rul.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/grph-rul.lmt
@@ -22,6 +22,8 @@ local tonode = nuts.tonode
local getattribute = tex.getattribute
+local direct_value = tokens.values.direct
+
local a_color = attributes.private('color')
local a_transparency = attributes.private('transparency')
local a_colormodel = attributes.private('colormodel')
@@ -29,20 +31,19 @@ local a_colormodel = attributes.private('colormodel')
local floor = math.floor
local getrandom = utilities.randomizer.get
-do
-
- local function unsupported() end
-
- ruleactions.mp = unsupported
- ruleactions.fill = unsupported
- ruleactions.draw = unsupported
- ruleactions.stroke = unsupported
- ruleactions.box = unsupported
-
-end
+updaters.register("backends.injections.latebindings",function()
+ local codeinjections = backends.codeinjections
+ ruleactions.mp = codeinjections.ruleactionmp
+ ruleactions.fill = codeinjections.ruleactionfill
+ ruleactions.draw = codeinjections.ruleactiondraw
+ ruleactions.stroke = codeinjections.ruleactionstroke
+ ruleactions.box = codeinjections.ruleactionbox
+end)
interfaces.implement {
name = "frule",
+ public = true,
+ protected = true,
arguments = { {
{ "width", "dimension" },
{ "height", "dimension" },
@@ -64,34 +65,37 @@ interfaces.implement {
else
setattrlist(rule,true)
end
- context(tonode(rule)) -- will become context.nodes.flush
+ context(tonode(rule))
end
}
interfaces.implement {
- name = "outlinerule",
- public = true,
+ name = "roundedoutline",
protected = true,
- arguments = { {
- { "width", "dimension" },
- { "height", "dimension" },
- { "depth", "dimension" },
- { "line", "dimension" },
- } } ,
- actions = function(t)
- local rule = outlinerule(t.width,t.height,t.depth,t.line)
+ arguments = { "dimension", "dimension", "dimension", "dimension", "dimension", "string" },
+ actions = function(w,h,d,l,r,c)
+ local rule = userrule {
+ width = w,
+ height = h,
+ depth = d,
+ line = l,
+ radius = r,
+ corner = c,
+ }
setattrlist(rule,true)
- context(tonode(rule)) -- will become context.nodes.flush
+ context(tonode(rule))
end
}
interfaces.implement {
name = "framedoutline",
+ -- public = true,
+ -- protected = true,
arguments = { "dimension", "dimension", "dimension", "dimension" },
actions = function(w,h,d,l)
local rule = outlinerule(w,h,d,l)
setattrlist(rule,true)
- context(tonode(rule)) -- will become context.nodes.flush
+ context(tonode(rule))
end
}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/grph-rul.mkxl b/Master/texmf-dist/tex/context/base/mkxl/grph-rul.mkxl
index 034e91734e3..5c192e3453c 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/grph-rul.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/grph-rul.mkxl
@@ -17,7 +17,7 @@
\unprotect
-\permanent\protected\def\frule{\relax\clf_frule} % will become a public implementer
+% \permanent\protected\def\frule{\relax\clf_frule} % will become a public implementer
% just for fun:
diff --git a/Master/texmf-dist/tex/context/base/mkxl/grph-trf.lmt b/Master/texmf-dist/tex/context/base/mkxl/grph-trf.lmt
index f68d6a6a807..7ca15e2a067 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/grph-trf.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/grph-trf.lmt
@@ -10,8 +10,19 @@ if not modules then modules = { } end modules ['grph-trf'] = {
local sind, cosd, tand, abs = math.sind, math.cosd, math.tand, math.abs
+local isdimen = tex.isdimen
local setdimension = tex.setdimensionvalue
+local d_grph_rotate_x_size = isdimen("d_grph_rotate_x_size")
+local d_grph_rotate_y_size = isdimen("d_grph_rotate_y_size")
+local d_grph_rotate_x_position = isdimen("d_grph_rotate_x_position")
+local d_grph_rotate_y_position = isdimen("d_grph_rotate_y_position")
+local d_grph_rotate_x_offset = isdimen("d_grph_rotate_x_offset")
+local d_grph_rotate_y_offset = isdimen("d_grph_rotate_y_offset")
+local d_grph_rotate_new_width = isdimen("d_grph_rotate_new_width")
+local d_grph_rotate_new_height = isdimen("d_grph_rotate_new_height")
+local d_grph_rotate_new_depth = isdimen("d_grph_rotate_new_depth")
+
local function analyzerotate(rotation,width,height,depth,total,notfit,obeydepth)
--
-- print(rotation,width,height,depth,notfit,obeydepth)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/grph-trf.mkxl b/Master/texmf-dist/tex/context/base/mkxl/grph-trf.mkxl
index c7e0f5e2f21..53080b6a13f 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/grph-trf.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/grph-trf.mkxl
@@ -26,15 +26,28 @@
\registerctxluafile{grph-trf}{autosuffix}
+% See below
+
+\newdimension\d_grph_rotate_x_size
+\newdimension\d_grph_rotate_y_size
+\newdimension\d_grph_rotate_x_offset
+\newdimension\d_grph_rotate_y_offset
+\newdimension\d_grph_rotate_x_position
+\newdimension\d_grph_rotate_y_position
+
+\newdimension\d_grph_rotate_new_width
+\newdimension\d_grph_rotate_new_height
+\newdimension\d_grph_rotate_new_depth
+
% local:
-\newdimen\d_grph_scale_x_size
-\newdimen\d_grph_scale_y_size
-\newdimen\d_grph_scale_x_offset
-\newdimen\d_grph_scale_y_offset
+\newdimension\d_grph_scale_x_size
+\newdimension\d_grph_scale_y_size
+\newdimension\d_grph_scale_x_offset
+\newdimension\d_grph_scale_y_offset
-\newdimen\d_grph_scale_h_size
-\newdimen\d_grph_scale_v_size
+\newdimension\d_grph_scale_h_size
+\newdimension\d_grph_scale_v_size
\newconditional\c_grph_scale_done
\newconditional\c_grph_scale_scaling_done
@@ -42,28 +55,28 @@
\newconditional\c_grph_scale_swap_factor
-\newdimen\d_grph_scale_wd
-\newdimen\d_grph_scale_ht
-\newdimen\d_grph_scale_dp
+\newdimension\d_grph_scale_wd
+\newdimension\d_grph_scale_ht
+\newdimension\d_grph_scale_dp
% global
-\newdimen\d_grph_scale_used_x_size
-\newdimen\d_grph_scale_used_y_size
+\newdimension\d_grph_scale_used_x_size
+\newdimension\d_grph_scale_used_y_size
-\newcount\c_grph_scale_used_x_scale
-\newcount\c_grph_scale_used_y_scale
+\newinteger\c_grph_scale_used_x_scale
+\newinteger\c_grph_scale_used_y_scale
-\let \m_grph_scale_used_x_scale\!!plusone
-\let \m_grph_scale_used_y_scale\!!plusone
+\let\m_grph_scale_used_x_scale\!!plusone
+\let\m_grph_scale_used_y_scale\!!plusone
-\newdimen\d_grph_scale_outer_v_size % we cannot manipulate any global vsize !
+\newdimension\d_grph_scale_outer_v_size % we cannot manipulate any global vsize !
% scratch:
-\let\m_grph_scale_temp \empty
-\let\m_grph_scale_temp_x\empty
-\let\m_grph_scale_temp_y\empty
+\lettonothing\m_grph_scale_temp
+\lettonothing\m_grph_scale_temp_x
+\lettonothing\m_grph_scale_temp_y
% public:
@@ -104,10 +117,10 @@
{\bgroup
% this is quite common so we might make this a helper
\ifarguments
- \let\currentscale\empty
+ \lettonothing\currentscale
\or
\ifhastok={#1}%
- \let\currentscale\empty
+ \lettonothing\currentscale
\setupcurrentscale[#1]%
\else
\edef\currentscale{#1}%
@@ -117,7 +130,7 @@
\setupcurrentscale[#2]%
\fi
%
- \dowithnextboxcs\grph_scale_finish\hbox}
+ \dowithnextboxcs\grph_scale_finish\naturalhbox} % intercept direction
\def\grph_scale_finish
{% todo: p_scale_
@@ -558,7 +571,7 @@
{\hbox}
\def\grph_scale_fast_yes#1%
- {\edef\finalscaleboxxscale{\withoutpt\the\dimexpr#1\onepoint/1000\relax}% brrr
+ {\edef\finalscaleboxxscale{\toscaled\dimexpr#1\onepoint/1000\relax}% brrr
\let\finalscaleboxyscale\finalscaleboxxscale
\dowithnextboxcs\grph_scale_fast_finish\hbox} % container ?
@@ -645,11 +658,11 @@
\scratchheight\dimexpr\ht\nextbox/\clippingparameter\c!ny\relax
\scratchyoffset\dimexpr-\clippingparameter\c!y\scratchheight-\clippingparameter\c!sy\scratchheight+\scratchheight\relax
\scratchheight\clippingparameter\c!sy\scratchheight
- \advance\scratchyoffset \ht\nextbox
+ \advanceby\scratchyoffset \ht\nextbox
\fi
\setbox\nextbox\naturalhpack
- {\advance\scratchxoffset -\clippingparameter\c!leftoffset \relax
- \advance\scratchyoffset -\clippingparameter\c!bottomoffset\relax
+ {\advanceby\scratchxoffset -\clippingparameter\c!leftoffset \relax
+ \advanceby\scratchyoffset -\clippingparameter\c!bottomoffset\relax
\hskip-\scratchxoffset
\lower\scratchyoffset
\box\nextbox}%
@@ -657,8 +670,8 @@
\ht\nextbox\zeropoint
\dp\nextbox\zeropoint
\setbox\nextbox\naturalhpack
- {\advance\scratchwidth \dimexpr\clippingparameter\c!leftoffset +\clippingparameter\c!rightoffset\relax
- \advance\scratchheight\dimexpr\clippingparameter\c!bottomoffset+\clippingparameter\c!topoffset \relax
+ {\advanceby\scratchwidth \dimexpr\clippingparameter\c!leftoffset +\clippingparameter\c!rightoffset\relax
+ \advanceby\scratchheight\dimexpr\clippingparameter\c!bottomoffset+\clippingparameter\c!topoffset \relax
\dostartclipping{\clippingparameter\c!mp}\scratchwidth\scratchheight
\box\nextbox
\dostopclipping}%
@@ -758,28 +771,28 @@
%D register and these are actually kind of constants not used in further
%D calculations):
-\mutable\dimendef\d_grph_rotate_x_size \zeropoint
-\mutable\dimendef\d_grph_rotate_y_size \zeropoint
-\mutable\dimendef\d_grph_rotate_x_offset \zeropoint
-\mutable\dimendef\d_grph_rotate_y_offset \zeropoint
-\mutable\dimendef\d_grph_rotate_x_position\zeropoint
-\mutable\dimendef\d_grph_rotate_y_position\zeropoint
-
-\mutable\dimendef\d_grph_rotate_new_width \zeropoint
-\mutable\dimendef\d_grph_rotate_new_height\zeropoint
-\mutable\dimendef\d_grph_rotate_new_depth \zeropoint
+% mutable\dimendef\d_grph_rotate_x_size \zeropoint
+% mutable\dimendef\d_grph_rotate_y_size \zeropoint
+% mutable\dimendef\d_grph_rotate_x_offset \zeropoint
+% mutable\dimendef\d_grph_rotate_y_offset \zeropoint
+% mutable\dimendef\d_grph_rotate_x_position\zeropoint
+% mutable\dimendef\d_grph_rotate_y_position\zeropoint
+%
+% mutable\dimendef\d_grph_rotate_new_width \zeropoint
+% mutable\dimendef\d_grph_rotate_new_height\zeropoint
+% mutable\dimendef\d_grph_rotate_new_depth \zeropoint
%D These aren't:
-\newdimen\d_grph_rotate_used_height
+\newdimension\d_grph_rotate_used_height
-\newdimen\d_grph_rotate_width
-\newdimen\d_grph_rotate_height
-\newdimen\d_grph_rotate_depth
+\newdimension\d_grph_rotate_width
+\newdimension\d_grph_rotate_height
+\newdimension\d_grph_rotate_depth
-\newdimen\d_grph_rotate_saved_width
-\newdimen\d_grph_rotate_saved_height
-\newdimen\d_grph_rotate_saved_depth
+\newdimension\d_grph_rotate_saved_width
+\newdimension\d_grph_rotate_saved_height
+\newdimension\d_grph_rotate_saved_depth
\newconditional\c_grph_rotate_obey_depth
\newconditional\c_grph_rotate_not_fit
@@ -795,8 +808,8 @@
\c!offset=\v!overlay,
\c!frame=\v!off]
-\let\p_rotation_location\empty
-\let\p_rotation_rotation\empty
+\lettonothing\p_rotation_location
+\lettonothing\p_rotation_rotation
\permanent\tolerant\protected\def\rotate[#1]% \bgroup: \rotate kan argument zijn
{\bgroup
diff --git a/Master/texmf-dist/tex/context/base/mkxl/hand-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/hand-ini.mkxl
index 3fd82f239b4..3a4193f1aba 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/hand-ini.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/hand-ini.mkxl
@@ -73,7 +73,7 @@
% \def\fonthandlingerror{\writestatus\m!fonts{font handling is replaced by features in mkiv}}
%
-% \let\fonthandling\empty
+% \lettonothing\fonthandling
%
% \protected\def\startfonthandling #1{\fonthandlingerror\fonthandlingerror\gobbleuntil\stopfonthandling} % can't happen
% \protected\def\definefonthandling {\dotripleempty\dodefinefonthandling}
@@ -107,7 +107,7 @@
%D New in \LMTX: can be used grouped.
-\permanent\protected\def\noexpansion {\bitwiseflip\glyphoptions\noexpansioncode}
-\permanent\protected\def\noprotrusion{\bitwiseflip\glyphoptions\noprotrusioncode}
+\permanent\protected\def\noexpansion {\bitwiseflip\glyphoptions\noexpansionglyphoptioncode}
+\permanent\protected\def\noprotrusion{\bitwiseflip\glyphoptions\noprotrusionglyphoptioncode}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/java-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/java-ini.mkxl
index f0e260eeaa3..c3a3b817c0b 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/java-ini.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/java-ini.mkxl
@@ -100,7 +100,6 @@
\permanent\protected\def\startJScode
{\begingroup
- \obeylualines
\obeyluatokens
\enforced\let\u\m_java_escape_u
\java_start_code}
@@ -108,11 +107,10 @@
\def\java_start_code#1\stopJScode
{\normalexpanded{\endgroup\clf_storejavascriptcode{#1}}}
-\aliased\let\stopJScode\relax
+\permanent\protected\lettonothing\stopJScode
\permanent\protected\def\startJSpreamble
{\begingroup
- \obeylualines
\obeyluatokens
\enforced\let\u\m_java_escape_u
\java_start_preamble}
@@ -120,7 +118,7 @@
\def\java_start_preamble#1\stopJSpreamble
{\normalexpanded{\endgroup\clf_storejavascriptpreamble{#1}}}
-\aliased\let\stopJSpreamble\relax
+\permanent\protected\lettonothing\stopJSpreamble
\permanent\protected\def\setJSpreamble #1#2{\clf_setjavascriptpreamble {#1}{#2}}
\permanent\protected\def\addtoJSpreamble#1#2{\clf_addtojavascriptpreamble{#1}{#2}}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/l-number.lmt b/Master/texmf-dist/tex/context/base/mkxl/l-number.lmt
new file mode 100644
index 00000000000..e13ac8260f1
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/l-number.lmt
@@ -0,0 +1,105 @@
+if not modules then modules = { } end modules ['l-number'] = {
+ version = 1.001,
+ comment = "companion to luat-lib.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- See l-number.lua for the more generic (also 5.2) versions of the
+-- functions below ... that file evolved over time.
+
+local tonumber = tonumber
+local format = string.format
+local concat = table.concat
+local floor = math.floor
+
+number = number or { }
+local number = number
+
+-- print(number.tobitstring(8))
+-- print(number.tobitstring(14))
+-- print(number.tobitstring(66))
+-- print(number.tobitstring(0x00))
+-- print(number.tobitstring(0xFF))
+-- print(number.tobitstring(46260767936,4))
+
+local t = {
+ "0", "0", "0", "0", "0", "0", "0", "0",
+ "0", "0", "0", "0", "0", "0", "0", "0",
+ "0", "0", "0", "0", "0", "0", "0", "0",
+ "0", "0", "0", "0", "0", "0", "0", "0",
+}
+
+function number.tobitstring(b,m,w)
+ if not w then
+ w = 32
+ end
+ local n = w
+ for i=0,w-1 do
+ local v = (b>>i) & 0x1 -- bextract(b,i)
+ local k = w - i
+ if v == 1 then
+ n = k
+ t[k] = "1"
+ else
+ t[k] = "0"
+ end
+ end
+ if w then
+ return concat(t,"",1,w)
+ elseif m then
+ m = 33 - m * 8
+ if m < 1 then
+ m = 1
+ end
+ return concat(t,"",1,m)
+ elseif n < 8 then
+ return concat(t)
+ elseif n < 16 then
+ return concat(t,"",9)
+ elseif n < 24 then
+ return concat(t,"",17)
+ else
+ return concat(t,"",25)
+ end
+end
+
+function number.valid(str,default)
+ return tonumber(str) or default or nil
+end
+
+function number.toevenhex(n)
+ local s = format("%X",n)
+ if #s % 2 == 0 then
+ return s
+ else
+ return "0" .. s
+ end
+end
+
+function number.bytetodecimal(b)
+ local d = floor(b * 100 / 255 + 0.5)
+ if d > 100 then
+ return 100
+ elseif d < -100 then
+ return -100
+ else
+ return d
+ end
+end
+
+function number.decimaltobyte(d)
+ local b = floor(d * 255 / 100 + 0.5)
+ if b > 255 then
+ return 255
+ elseif b < -255 then
+ return -255
+ else
+ return b
+ end
+end
+
+function number.idiv(i,d)
+ return i // d
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/l-unicode.lmt b/Master/texmf-dist/tex/context/base/mkxl/l-unicode.lmt
new file mode 100644
index 00000000000..f2c94b1c2d2
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/l-unicode.lmt
@@ -0,0 +1,808 @@
+if not modules then modules = { } end modules ['l-unicode'] = {
+ version = 1.001,
+ optimize = true,
+ comment = "companion to luat-lib.mkxl",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- See l-unicode.lua for the more generic (also 5.2) versions of the
+-- functions below ... that file evolved over time.
+--
+-- In lua 5.3+ we have:
+--
+-- utf8.char(···) : concatinated
+-- utf8.charpatt : "[\0-\x7F\xC2-\xF4][\x80-\xBF]*"
+-- utf8.codes(s) : for p, c in utf8.codes(s) do body end
+-- utf8.codepoint(s [, i [, j]])
+-- utf8.len(s [, i])
+-- utf8.offset(s, n [, i])
+
+utf = utf or { }
+unicode = nil
+
+local type = type
+local char, byte, format, sub, gmatch, rep = string.char, string.byte, string.format, string.sub, string.gmatch, string.rep
+local concat = table.concat
+local P, C, R, Cs, Ct, Cmt, Cc, Carg, Cp = lpeg.P, lpeg.C, lpeg.R, lpeg.Cs, lpeg.Ct, lpeg.Cmt, lpeg.Cc, lpeg.Carg, lpeg.Cp
+
+local lpegmatch = lpeg.match
+local patterns = lpeg.patterns
+local tabletopattern = lpeg.utfchartabletopattern
+
+local finder = lpeg.finder
+local replacer = lpeg.replacer
+
+local p_utftype = patterns.utftype
+local p_utfstricttype = patterns.utfstricttype
+local p_utfoffset = patterns.utfoffset
+local p_utf8character = patterns.utf8character
+local p_utf8char = patterns.utf8char
+local p_utf8byte = patterns.utf8byte
+local p_utfbom = patterns.utfbom
+local p_newline = patterns.newline
+local p_whitespace = patterns.whitespace
+
+local utfchar = string.utfcharacter
+local utfbyte = string.utfvalue
+local utflength = string.utflength
+local utfcharacters = string.utfcharacters
+local utfbytepairs = string.bytepairs
+
+-- string.utfvalues
+-- string.characters
+-- string.characterpairs
+-- string.bytes
+-- string.utflength
+-- string.utfvalues
+
+utf.char = utfchar
+utf.byte = utfbyte
+utf.len = utflength
+utf.length = utflength
+utf.characters = utfcharacters
+utf.bytepairs = utfbytepairs
+
+function utf.filetype(data)
+ return data and lpegmatch(p_utftype,data) or "unknown"
+end
+
+do
+
+ local toentities = Cs (
+ (
+ patterns.utf8one
+ + (
+ patterns.utf8two
+ + patterns.utf8three
+ + patterns.utf8four
+ ) / function(s) local b = utfbyte(s) if b < 127 then return s else return format("&#%X;",b) end end
+ )^0
+ )
+
+ patterns.toentities = toentities
+
+ function utf.toentities(str)
+ return lpegmatch(toentities,str)
+ end
+
+end
+
+do
+
+ local one = P(1)
+ local two = C(1) * C(1)
+ local four = C(R(utfchar(0xD8),utfchar(0xFF))) * C(1) * C(1) * C(1)
+
+ local pattern =
+ P("\254\255") * Cs( (
+ four / function(a,b,c,d)
+ local ab = 0xFF * byte(a) + byte(b)
+ local cd = 0xFF * byte(c) + byte(d)
+ return utfchar((ab-0xD800)*0x400 + (cd-0xDC00) + 0x10000)
+ end
+ + two / function(a,b)
+ return utfchar(byte(a)*256 + byte(b))
+ end
+ + one
+ )^1 )
+ + P("\255\254") * Cs( (
+ four / function(b,a,d,c)
+ local ab = 0xFF * byte(a) + byte(b)
+ local cd = 0xFF * byte(c) + byte(d)
+ return utfchar((ab-0xD800)*0x400 + (cd-0xDC00) + 0x10000)
+ end
+ + two / function(b,a)
+ return utfchar(byte(a)*256 + byte(b))
+ end
+ + one
+ )^1 )
+
+ function string.toutf(s) -- in string namespace
+ return lpegmatch(pattern,s) or s -- todo: utf32
+ end
+
+end
+
+do
+
+ local validatedutf = Cs (
+ (
+ patterns.utf8one
+ + patterns.utf8two
+ + patterns.utf8three
+ + patterns.utf8four
+ + P(1) / "�"
+ )^0
+ )
+
+ patterns.validatedutf = validatedutf
+
+ function utf.is_valid(str)
+ return type(str) == "string" and lpegmatch(validatedutf,str) or false
+ end
+
+end
+
+if not utf.sub then
+
+ -- also negative indices, upto 10 times slower than a c variant
+
+ local b, e, n, first, last = 0, 0, 0, 0, 0
+
+ local function slide_zero(s,p)
+ n = n + 1
+ if n >= last then
+ e = p - 1
+ else
+ return p
+ end
+ end
+
+ local function slide_one(s,p)
+ n = n + 1
+ if n == first then
+ b = p
+ end
+ if n >= last then
+ e = p - 1
+ else
+ return p
+ end
+ end
+
+ local function slide_two(s,p)
+ n = n + 1
+ if n == first then
+ b = p
+ else
+ return true
+ end
+ end
+
+ local pattern_zero = Cmt(p_utf8character,slide_zero)^0
+ local pattern_one = Cmt(p_utf8character,slide_one )^0
+ local pattern_two = Cmt(p_utf8character,slide_two )^0
+
+ local pattern_first = C(p_utf8character)
+
+ function utf.sub(str,start,stop)
+ if not start then
+ return str
+ end
+ if start == 0 then
+ start = 1
+ end
+ if not stop then
+ if start < 0 then
+ local l = utflength(str) -- we can inline this function if needed
+ start = l + start
+ else
+ start = start - 1
+ end
+ b, n, first = 0, 0, start
+ lpegmatch(pattern_two,str)
+ if n >= first then
+ return sub(str,b)
+ else
+ return ""
+ end
+ end
+ if start < 0 or stop < 0 then
+ local l = utf.length(str)
+ if start < 0 then
+ start = l + start
+ if start <= 0 then
+ start = 1
+ else
+ start = start + 1
+ end
+ end
+ if stop < 0 then
+ stop = l + stop
+ if stop == 0 then
+ stop = 1
+ else
+ stop = stop + 1
+ end
+ end
+ end
+ if start == 1 and stop == 1 then
+ return lpegmatch(pattern_first,str) or ""
+ elseif start > stop then
+ return ""
+ elseif start > 1 then
+ b, e, n, first, last = 0, 0, 0, start - 1, stop
+ lpegmatch(pattern_one,str)
+ if n >= first and e == 0 then
+ e = #str
+ end
+ return sub(str,b,e)
+ else
+ b, e, n, last = 1, 0, 0, stop
+ lpegmatch(pattern_zero,str)
+ if e == 0 then
+ e = #str
+ end
+ return sub(str,b,e)
+ end
+ end
+
+ -- local n = 100000
+ -- local str = string.rep("123456àáâãäå",100)
+ --
+ -- for i=-15,15,1 do
+ -- for j=-15,15,1 do
+ -- if utf.xsub(str,i,j) ~= utf.sub(str,i,j) then
+ -- print("error",i,j,"l>"..utf.xsub(str,i,j),"s>"..utf.sub(str,i,j))
+ -- end
+ -- end
+ -- if utf.xsub(str,i) ~= utf.sub(str,i) then
+ -- print("error",i,"l>"..utf.xsub(str,i),"s>"..utf.sub(str,i))
+ -- end
+ -- end
+
+ -- print(" 1, 7",utf.xsub(str, 1, 7),utf.sub(str, 1, 7))
+ -- print(" 0, 7",utf.xsub(str, 0, 7),utf.sub(str, 0, 7))
+ -- print(" 0, 9",utf.xsub(str, 0, 9),utf.sub(str, 0, 9))
+ -- print(" 4 ",utf.xsub(str, 4 ),utf.sub(str, 4 ))
+ -- print(" 0 ",utf.xsub(str, 0 ),utf.sub(str, 0 ))
+ -- print(" 0, 0",utf.xsub(str, 0, 0),utf.sub(str, 0, 0))
+ -- print(" 4, 4",utf.xsub(str, 4, 4),utf.sub(str, 4, 4))
+ -- print(" 4, 0",utf.xsub(str, 4, 0),utf.sub(str, 4, 0))
+ -- print("-3, 0",utf.xsub(str,-3, 0),utf.sub(str,-3, 0))
+ -- print(" 0,-3",utf.xsub(str, 0,-3),utf.sub(str, 0,-3))
+ -- print(" 5,-3",utf.xsub(str,-5,-3),utf.sub(str,-5,-3))
+ -- print("-3 ",utf.xsub(str,-3 ),utf.sub(str,-3 ))
+
+end
+
+function utf.remapper(mapping,option,action) -- static also returns a pattern
+ local variant = type(mapping)
+ if variant == "table" then
+ action = action or mapping
+ if option == "dynamic" then
+ local pattern = false
+ table.setmetatablenewindex(mapping,function(t,k,v) rawset(t,k,v) pattern = false end)
+ return function(str)
+ if not str or str == "" then
+ return ""
+ else
+ if not pattern then
+ pattern = Cs((tabletopattern(mapping)/action + p_utf8character)^0)
+ end
+ return lpegmatch(pattern,str)
+ end
+ end
+ elseif option == "pattern" then
+ return Cs((tabletopattern(mapping)/action + p_utf8character)^0)
+ -- elseif option == "static" then
+ else
+ local pattern = Cs((tabletopattern(mapping)/action + p_utf8character)^0)
+ return function(str)
+ if not str or str == "" then
+ return ""
+ else
+ return lpegmatch(pattern,str)
+ end
+ end, pattern
+ end
+ elseif variant == "function" then
+ if option == "pattern" then
+ return Cs((p_utf8character/mapping + p_utf8character)^0)
+ else
+ local pattern = Cs((p_utf8character/mapping + p_utf8character)^0)
+ return function(str)
+ if not str or str == "" then
+ return ""
+ else
+ return lpegmatch(pattern,str)
+ end
+ end, pattern
+ end
+ else
+ -- is actually an error
+ return function(str)
+ return str or ""
+ end
+ end
+end
+
+-- local remap = utf.remapper { a = 'd', b = "c", c = "b", d = "a" }
+-- print(remap("abcd 1234 abcd"))
+
+function utf.replacer(t) -- no precheck, always string builder
+ local r = replacer(t,false,false,true)
+ return function(str)
+ return lpegmatch(r,str)
+ end
+end
+
+function utf.subtituter(t) -- with precheck and no building if no match
+ local f = finder (t)
+ local r = replacer(t,false,false,true)
+ return function(str)
+ local i = lpegmatch(f,str)
+ if not i then
+ return str
+ elseif i > #str then
+ return str
+ else
+ -- return sub(str,1,i-2) .. lpegmatch(r,str,i-1) -- slower
+ return lpegmatch(r,str)
+ end
+ end
+end
+
+-- inspect(utf.split("a b c d"))
+-- inspect(utf.split("a b c d",true))
+
+local utflinesplitter = p_utfbom^-1 * lpeg.tsplitat(p_newline)
+local utfcharsplitter_ows = p_utfbom^-1 * Ct(C(p_utf8character)^0)
+local utfcharsplitter_iws = p_utfbom^-1 * Ct((p_whitespace^1 + C(p_utf8character))^0)
+local utfcharsplitter_raw = Ct(C(p_utf8character)^0)
+
+patterns.utflinesplitter = utflinesplitter
+
+function utf.splitlines(str)
+ return lpegmatch(utflinesplitter,str or "")
+end
+
+function utf.split(str,ignorewhitespace) -- new
+ if ignorewhitespace then
+ return lpegmatch(utfcharsplitter_iws,str or "")
+ else
+ return lpegmatch(utfcharsplitter_ows,str or "")
+ end
+end
+
+function utf.totable(str) -- keeps bom
+ return lpegmatch(utfcharsplitter_raw,str)
+end
+
+-- 0 EF BB BF UTF-8
+-- 1 FF FE UTF-16-little-endian
+-- 2 FE FF UTF-16-big-endian
+-- 3 FF FE 00 00 UTF-32-little-endian
+-- 4 00 00 FE FF UTF-32-big-endian
+--
+-- \000 fails in <= 5.0 but is valid in >=5.1 where %z is depricated
+
+-- utf.name = {
+-- [0] = 'utf-8',
+-- [1] = 'utf-16-le',
+-- [2] = 'utf-16-be',
+-- [3] = 'utf-32-le',
+-- [4] = 'utf-32-be'
+-- }
+
+function utf.magic(f) -- not used
+ local str = f:read(4) or ""
+ local off = lpegmatch(p_utfoffset,str)
+ if off < 4 then
+ f:seek('set',off)
+ end
+ return lpegmatch(p_utftype,str)
+end
+
+local utf_16_be_getbom = patterns.utfbom_16_be^-1
+local utf_16_le_getbom = patterns.utfbom_16_le^-1
+local utf_32_be_getbom = patterns.utfbom_32_be^-1
+local utf_32_le_getbom = patterns.utfbom_32_le^-1
+
+local utf_16_be_linesplitter = utf_16_be_getbom * lpeg.tsplitat(patterns.utf_16_be_nl)
+local utf_16_le_linesplitter = utf_16_le_getbom * lpeg.tsplitat(patterns.utf_16_le_nl)
+local utf_32_be_linesplitter = utf_32_be_getbom * lpeg.tsplitat(patterns.utf_32_be_nl)
+local utf_32_le_linesplitter = utf_32_le_getbom * lpeg.tsplitat(patterns.utf_32_le_nl)
+
+local more = 0
+
+local p_utf16_to_utf8_be = C(1) * C(1) /function(left,right)
+ local now = 256*byte(left) + byte(right)
+ if more > 0 then
+ now = (more-0xD800)*0x400 + (now-0xDC00) + 0x10000
+ more = 0
+ return utfchar(now)
+ elseif now >= 0xD800 and now <= 0xDBFF then
+ more = now
+ return "" -- else the c's end up in the stream
+ else
+ return utfchar(now)
+ end
+end
+
+local p_utf16_to_utf8_le = C(1) * C(1) /function(right,left)
+ local now = 256*byte(left) + byte(right)
+ if more > 0 then
+ now = (more-0xD800)*0x400 + (now-0xDC00) + 0x10000
+ more = 0
+ return utfchar(now)
+ elseif now >= 0xD800 and now <= 0xDBFF then
+ more = now
+ return "" -- else the c's end up in the stream
+ else
+ return utfchar(now)
+ end
+end
+
+local p_utf32_to_utf8_be = C(1) * C(1) * C(1) * C(1) /function(a,b,c,d)
+ return utfchar(256*256*256*byte(a) + 256*256*byte(b) + 256*byte(c) + byte(d))
+end
+
+local p_utf32_to_utf8_le = C(1) * C(1) * C(1) * C(1) /function(a,b,c,d)
+ return utfchar(256*256*256*byte(d) + 256*256*byte(c) + 256*byte(b) + byte(a))
+end
+
+p_utf16_to_utf8_be = P(true) / function() more = 0 end * utf_16_be_getbom * Cs(p_utf16_to_utf8_be^0)
+p_utf16_to_utf8_le = P(true) / function() more = 0 end * utf_16_le_getbom * Cs(p_utf16_to_utf8_le^0)
+p_utf32_to_utf8_be = P(true) / function() more = 0 end * utf_32_be_getbom * Cs(p_utf32_to_utf8_be^0)
+p_utf32_to_utf8_le = P(true) / function() more = 0 end * utf_32_le_getbom * Cs(p_utf32_to_utf8_le^0)
+
+patterns.utf16_to_utf8_be = p_utf16_to_utf8_be
+patterns.utf16_to_utf8_le = p_utf16_to_utf8_le
+patterns.utf32_to_utf8_be = p_utf32_to_utf8_be
+patterns.utf32_to_utf8_le = p_utf32_to_utf8_le
+
+local utf16_to_utf8_be = function(s)
+ if s and s ~= "" then
+ return lpegmatch(p_utf16_to_utf8_be,s)
+ else
+ return s
+ end
+end
+
+local utf16_to_utf8_be_t = function(t)
+ if not t then
+ return nil
+ elseif type(t) == "string" then
+ t = lpegmatch(utf_16_be_linesplitter,t)
+ end
+ for i=1,#t do
+ local s = t[i]
+ if s ~= "" then
+ t[i] = lpegmatch(p_utf16_to_utf8_be,s)
+ end
+ end
+ return t
+end
+
+local utf16_to_utf8_le = function(s)
+ if s and s ~= "" then
+ return lpegmatch(p_utf16_to_utf8_le,s)
+ else
+ return s
+ end
+end
+
+local utf16_to_utf8_le_t = function(t)
+ if not t then
+ return nil
+ elseif type(t) == "string" then
+ t = lpegmatch(utf_16_le_linesplitter,t)
+ end
+ for i=1,#t do
+ local s = t[i]
+ if s ~= "" then
+ t[i] = lpegmatch(p_utf16_to_utf8_le,s)
+ end
+ end
+ return t
+end
+
+local utf32_to_utf8_be = function(s)
+ if s and s ~= "" then
+ return lpegmatch(p_utf32_to_utf8_be,s)
+ else
+ return s
+ end
+end
+
+local utf32_to_utf8_be_t = function(t)
+ if not t then
+ return nil
+ elseif type(t) == "string" then
+ t = lpegmatch(utf_32_be_linesplitter,t)
+ end
+ for i=1,#t do
+ local s = t[i]
+ if s ~= "" then
+ t[i] = lpegmatch(p_utf32_to_utf8_be,s)
+ end
+ end
+ return t
+end
+
+local utf32_to_utf8_le = function(s)
+ if s and s ~= "" then
+ return lpegmatch(p_utf32_to_utf8_le,s)
+ else
+ return s
+ end
+end
+
+local utf32_to_utf8_le_t = function(t)
+ if not t then
+ return nil
+ elseif type(t) == "string" then
+ t = lpegmatch(utf_32_le_linesplitter,t)
+ end
+ for i=1,#t do
+ local s = t[i]
+ if s ~= "" then
+ t[i] = lpegmatch(p_utf32_to_utf8_le,s)
+ end
+ end
+ return t
+end
+
+utf.utf16_to_utf8_le_t = utf16_to_utf8_le_t
+utf.utf16_to_utf8_be_t = utf16_to_utf8_be_t
+utf.utf32_to_utf8_le_t = utf32_to_utf8_le_t
+utf.utf32_to_utf8_be_t = utf32_to_utf8_be_t
+
+utf.utf16_to_utf8_le = utf16_to_utf8_le
+utf.utf16_to_utf8_be = utf16_to_utf8_be
+utf.utf32_to_utf8_le = utf32_to_utf8_le
+utf.utf32_to_utf8_be = utf32_to_utf8_be
+
+function utf.utf8_to_utf8_t(t)
+ return type(t) == "string" and lpegmatch(utflinesplitter,t) or t
+end
+
+function utf.utf16_to_utf8_t(t,endian)
+ return endian and utf16_to_utf8_be_t(t) or utf16_to_utf8_le_t(t) or t
+end
+
+function utf.utf32_to_utf8_t(t,endian)
+ return endian and utf32_to_utf8_be_t(t) or utf32_to_utf8_le_t(t) or t
+end
+
+do
+
+ local function little(b)
+ if b < 0x10000 then
+ return char(b%256,(b>>8))
+ else
+ b = b - 0x10000
+ local b1 = (b>>10) + 0xD800
+ local b2 = b%1024 + 0xDC00
+ return char(b1%256,(b1>>8),b2%256,(b2>>8))
+ end
+ end
+
+ local function big(b)
+ if b < 0x10000 then
+ return char((b>>8),b%256)
+ else
+ b = b - 0x10000
+ local b1 = (b>>10) + 0xD800
+ local b2 = b%1024 + 0xDC00
+ return char((b1>>8),b1%256,(b2>>8),b2%256)
+ end
+ end
+
+ local l_remap = Cs((p_utf8byte/little+P(1)/"")^0)
+ local b_remap = Cs((p_utf8byte/big +P(1)/"")^0)
+
+ local function utf8_to_utf16_be(str,nobom)
+ if nobom then
+ return lpegmatch(b_remap,str)
+ else
+ return char(254,255) .. lpegmatch(b_remap,str)
+ end
+ end
+
+ local function utf8_to_utf16_le(str,nobom)
+ if nobom then
+ return lpegmatch(l_remap,str)
+ else
+ return char(255,254) .. lpegmatch(l_remap,str)
+ end
+ end
+
+ utf.utf8_to_utf16_be = utf8_to_utf16_be
+ utf.utf8_to_utf16_le = utf8_to_utf16_le
+
+ function utf.utf8_to_utf16(str,littleendian,nobom)
+ if littleendian then
+ return utf8_to_utf16_le(str,nobom)
+ else
+ return utf8_to_utf16_be(str,nobom)
+ end
+ end
+
+end
+
+local pattern = Cs (
+ (p_utf8byte / function(unicode ) return format( "0x%04X", unicode) end) *
+ (p_utf8byte * Carg(1) / function(unicode,separator) return format("%s0x%04X",separator,unicode) end)^0
+)
+
+function utf.tocodes(str,separator)
+ return lpegmatch(pattern,str,1,separator or " ")
+end
+
+function utf.ustring(s)
+ return format("U+%05X",type(s) == "number" and s or utfbyte(s))
+end
+
+function utf.xstring(s)
+ return format("0x%05X",type(s) == "number" and s or utfbyte(s))
+end
+
+function utf.toeight(str)
+ if not str or str == "" then
+ return nil
+ end
+ local utftype = lpegmatch(p_utfstricttype,str)
+ if utftype == "utf-8" then
+ return sub(str,4) -- remove the bom
+ elseif utftype == "utf-16-be" then
+ return utf16_to_utf8_be(str) -- bom gets removed
+ elseif utftype == "utf-16-le" then
+ return utf16_to_utf8_le(str) -- bom gets removed
+ else
+ return str
+ end
+end
+
+do
+
+ local p_nany = p_utf8character / ""
+ local cache = { }
+
+ function utf.count(str,what)
+ if type(what) == "string" then
+ local p = cache[what]
+ if not p then
+ p = Cs((P(what)/" " + p_nany)^0)
+ cache[p] = p
+ end
+ return #lpegmatch(p,str)
+ else -- 4 times slower but still faster than / function
+ return #lpegmatch(Cs((P(what)/" " + p_nany)^0),str)
+ end
+ end
+
+end
+
+utf.values = string.utfvalues
+
+function utf.chrlen(u) -- u is number
+ return
+ (u < 0x80 and 1) or
+ (u < 0xE0 and 2) or
+ (u < 0xF0 and 3) or
+ (u < 0xF8 and 4) or
+ (u < 0xFC and 5) or
+ (u < 0xFE and 6) or 0
+end
+
+-- hashing saves a little but not that much in practice
+--
+-- local utf32 = table.setmetatableindex(function(t,k) local v = toutf32(k) t[k] = v return v end)
+
+do
+
+ local extract = bit32.extract
+ local char = string.char
+
+ function utf.toutf32string(n)
+ if n <= 0xFF then
+ return
+ char(n) ..
+ "\000\000\000"
+ elseif n <= 0xFFFF then
+ return
+ char(extract(n, 0,8)) ..
+ char(extract(n, 8,8)) ..
+ "\000\000"
+ elseif n <= 0xFFFFFF then
+ return
+ char(extract(n, 0,8)) ..
+ char(extract(n, 8,8)) ..
+ char(extract(n,16,8)) ..
+ "\000"
+ else
+ return
+ char(extract(n, 0,8)) ..
+ char(extract(n, 8,8)) ..
+ char(extract(n,16,8)) ..
+ char(extract(n,24,8))
+ end
+ end
+
+end
+
+-- goodie:
+
+function string.utfpadd(s,n)
+ if n and n ~= 0 then
+ local l = utflength(s)
+ if n > 0 then
+ local d = n - l
+ if d > 0 then
+ return rep(c or " ",d) .. s
+ end
+ else
+ local d = - n - l
+ if d > 0 then
+ return s .. rep(c or " ",d)
+ end
+ end
+ end
+ return s
+end
+
+-- goodies
+
+do
+
+ lpeg.UP = P
+
+ function lpeg.US(str)
+ local p = P(false)
+ for uc in utfcharacters(str) do
+ p = p + P(uc)
+ end
+ return p
+ end
+
+ local range = p_utf8byte * p_utf8byte + Cc(false) -- utf8byte is already a capture
+
+ function lpeg.UR(str,more)
+ local first, last
+ if type(str) == "number" then
+ first = str
+ last = more or first
+ else
+ first, last = lpegmatch(range,str)
+ if not last then
+ return P(str)
+ end
+ end
+ if first == last then
+ return P(str)
+ end
+ if not utfchar then
+ utfchar = utf.char -- maybe delayed
+ end
+ if utfchar and (last - first < 8) then -- a somewhat arbitrary criterium
+ local p = P(false)
+ for i=first,last do
+ p = p + P(utfchar(i))
+ end
+ return p -- nil when invalid range
+ else
+ local f = function(b)
+ return b >= first and b <= last
+ end
+ -- tricky, these nested captures
+ return p_utf8byte / f -- nil when invalid range
+ end
+ end
+
+ -- print(lpeg.match(lpeg.Cs((C(lpeg.UR("αω"))/{ ["χ"] = "OEPS" })^0),"αωχαω"))
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-def.mkxl b/Master/texmf-dist/tex/context/base/mkxl/lang-def.mkxl
index 85c1f3ac775..cd5fd4ba34e 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lang-def.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/lang-def.mkxl
@@ -269,12 +269,50 @@
\c!rightquotation=\leftguillemot,
\c!date={\v!day,{.},\space,\v!month,\space,\v!year}]
+\installlanguage % for now we copy from slovenian
+ [\s!sq]
+ [\c!command=\v!no,
+ \s!lefthyphenmin=2,
+ \s!righthyphenmin=2,
+ \c!spacing=\v!packed,
+ \c!leftsentence=\hbox{\endash\space},
+ \c!rightsentence=\hbox{\space\endash},
+ \c!leftsubsentence=\endash,
+ \c!rightsubsentence=\endash,
+ \c!leftquote=\guilsingleright,
+ \c!rightquote=\guilsingleleft,
+ \c!leftquotation=\rightguillemot,
+ \c!rightquotation=\leftguillemot,
+ \c!date={\v!day,{.},\space,\v!month,\space,\v!year}]
+
+\installlanguage
+ [\s!hy]
+ [\c!spacing=\v!packed,
+ \c!leftsentence=\endash, % *sentences not confirmed
+ \c!rightsentence=\endash,
+ \c!leftsubsentence=\endash,
+ \c!rightsubsentence=\endash,
+ \c!leftquote=\guilsingleleft,
+ \c!rightquote=\guilsingleright,
+ \c!leftquotation=\leftguillemot
+ \c!rightquotation=\rightguillemot
+ \c!date={\v!day,\space,\v!month,\space,\v!year}, % word
+ % \c!date={\v!day,{.},\v!month,{.},\v!year}, % numbers
+ \s!patterns=\s!hy,
+ \s!lefthyphenmin=2,
+ \s!righthyphenmin=2]
+
\installlanguage [\s!polish] [\s!pl]
\installlanguage [\s!czech] [\s!cs]
\installlanguage [\s!slovak] [\s!sk]
\installlanguage [\s!croatian] [\s!hr]
\installlanguage [\s!slovenian] [\s!sl]
\installlanguage [slovene] [\s!sl] % both possible (mojca: still needed?)
+\installlanguage [\s!albanian] [\s!sq]
+\installlanguage [\s!armenian] [\s!hy]
+
+\installlanguage [\s!hye] [\s!hy] % Eastern Armenian
+\installlanguage [\s!hyw] [\s!hy] % Western Armenian
% Cyrillic Languages
@@ -350,6 +388,21 @@
\c!rightquotation=\upperrightdoublesixquote,
\c!date={\v!day,\space,\v!month,\space,\v!year}]
+\installlanguage
+ [\s!bg]
+ [\s!lefthyphenmin=2,
+ \s!righthyphenmin=2,
+ \c!spacing=\v!packed,
+ \c!leftsentence=\leftguillemot,
+ \c!rightsentence=\rightguillemot,
+ \c!leftsubsentence=\lowerleftdoubleninequote,
+ \c!rightsubsentence=\upperrightdoubleninequote,
+ \c!leftquote=\lowerleftsingleninequote,
+ \c!rightquote=\upperrightsinglesixquote,
+ \c!leftquotation=\lowerleftdoubleninequote,
+ \c!rightquotation=\upperrightdoublesixquote,
+ \c!date={\v!day,\space,\v!month,\space,\v!year}]
+
\installlanguage [\s!russian] [\s!ru]
\installlanguage [\s!ukrainian] [\s!ua]
\installlanguage [\s!belarussian][\s!be]
@@ -357,6 +410,7 @@
\installlanguage [\s!sr-latn] [\s!sr]
\installlanguage [\s!sr-cyrl] [\s!sr]
\installlanguage [\s!macedonian] [\s!mk]
+\installlanguage [\s!bulgarian] [\s!bg]
% Uralic Languages: Cheremiss, Estonian, Finnish, Karelian, Laap,
@@ -486,7 +540,7 @@
\installlanguage [\s!arabic] [\s!ar]
\installlanguage
- [\s!pe]
+ [\s!farsi]
[\c!spacing=\v!broad,
\c!leftsentence=\emdash,
\c!rightsentence=\emdash,
@@ -498,9 +552,9 @@
\c!rightquotation=\rightguillemot,
\c!date={\v!day,\space,\v!month,\space,\v!year}]
-\installlanguage [\s!persian] [\s!pe]
-\installlanguage [\s!fa] [\s!pe] % these two are redundant but sometimes might
-\installlanguage [\s!farsi] [\s!fa] % sound more natural .. best set labels to 'pe'
+\installlanguage [\s!fa] [\s!farsi]
+\installlanguage [\s!persian] [\s!farsi]
+\installlanguage [\s!pe] [\s!farsi]
% Just aliases to "ar" for now
@@ -538,21 +592,23 @@
% Artificial Languages: Esperanto
\installlanguage
- [\s!esperanto]
- [%\c!spacing=\v!packed,
- %\c!leftsentence=\emdash,
- %\c!rightsentence=\emdash,
- %\c!leftsubsentence=\emdash,
- %\c!rightsubsentence=\emdash,
- %\c!leftquote=\lowerleftdoubleninequote,
- %\c!rightquote=\upperrightdoublesixquote,
- %\c!leftquotation=\lowerleftdoubleninequote,
- %\c!rightquotation=\upperrightdoublesixquote,
- %\c!date={\v!year,~m.,\space,\v!month,\space,\v!day,~d.},
+ [\s!eo]
+ [\c!spacing=\v!packed,
+ \c!leftsentence=\endash,
+ \c!rightsentence=\endash,
+ \c!leftsubsentence=\endash,
+ \c!rightsubsentence=\endash,
+ \c!leftquote=\upperleftsinglesixquote, %U+2018,
+ \c!rightquote=\upperrightsingleninequote, %U+2019,
+ \c!leftquotation=\upperleftdoublesixquote, %U+201C,
+ \c!rightquotation=\upperrightdoubleninequote, %U+201D,
+ \c!date={\v!day,-a\space de\space,\v!month,\space \v!year},
\s!patterns=eo,
\s!lefthyphenmin=2,
\s!righthyphenmin=2]
+\installlanguage[\s!esperanto][\c!default=\s!eo]
+
% Baltic Languages: Lettish/Latvian, Lietuvių/Lithuanian
\installlanguage
@@ -622,7 +678,7 @@
% Greek
\installlanguage
- [\s!gr]
+ [\s!gr] % grc el-monotonic-greek.tex
[\c!spacing=\v!packed,
\c!leftsentence=\emdash,
\c!rightsentence=\emdash,
@@ -633,7 +689,7 @@
\c!leftquotation=«,
\c!rightquotation=»,
\c!date={\v!day\space\v!month\space\v!year},
- \s!patterns=\s!agr] % ok?
+ \s!patterns=\s!gr]
\installlanguage [\s!greek] [\s!gr]
@@ -808,7 +864,31 @@
\installlanguage [\s!thai] [\s!th]
-%D Malayalam (needs to be checked)
+%D Indic languages (Å›rÄ«rÄman)
+%
+%
+%D Sanskit (someone needs to define the parameters):
+%D
+%D The file \type {lang-sa.lua} contains sanskrit hyphenation patterns for devanagari,
+%D bengali, telugu, kannada, malayalam and roman(iast.
+
+\installlanguage
+ [\s!sa]
+ [\c!spacing=\v!broad,
+ \c!leftsentence=\endash,
+ \c!rightsentence=\endash,
+ \c!leftsubsentence=\emdash,
+ \c!rightsubsentence=\emdash,
+ \c!leftquote=\upperleftsinglesixquote,
+ \c!rightquote=\upperrightsingleninequote,
+ \c!leftquotation=\upperleftdoublesixquote,
+ \c!rightquotation=\upperrightdoubleninequote,
+ \c!date={\v!month,\space,\v!day,{,\space},\v!year},
+ \s!patterns=\s!sa,
+ \s!lefthyphenmin=1,
+ \s!righthyphenmin=1]
+
+%D Malayalam needs some fine-tuning
\installlanguage
[\s!ml]
@@ -826,7 +906,22 @@
\s!lefthyphenmin=2,
\s!righthyphenmin=3]
-\installlanguage [\s!malayalam] [\s!ml]
+\installlanguage [\s!ml][\c!default=\s!sa,\s!patterns=\s!ml]
+\installlanguage [\s!ta][\c!default=\s!sa,\s!patterns=ta]
+\installlanguage [\s!kn][\c!default=\s!sa,\s!patterns=kn]
+\installlanguage [\s!te][\c!default=\s!sa,\s!patterns=te]
+\installlanguage [\s!gu][\c!default=\s!sa,\s!patterns=gu]
+\installlanguage [\s!bn][\c!default=\s!sa,\s!patterns=bn]
+\installlanguage [\s!hi][\c!default=\s!sa,\s!patterns=hi]
+
+\installlanguage [\s!tamil] [\s!ta]
+\installlanguage [\s!kannada] [\s!kn]
+\installlanguage [\s!telugu] [\s!te]
+\installlanguage [\s!gujarati] [\s!gu]
+\installlanguage [\s!hindi] [\s!hi]
+\installlanguage [\s!bengali] [\s!bn]
+\installlanguage [\s!sanskrit] [\s!sa]
+\installlanguage [\s!malayalam][\s!ml]
%D Todo: generate this one from languages.data
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-dis.lmt b/Master/texmf-dist/tex/context/base/mkxl/lang-dis.lmt
index 263225691f0..36fea59c02d 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lang-dis.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/lang-dis.lmt
@@ -26,6 +26,7 @@ local getsubtype = nuts.getsubtype
local setsubtype = nuts.setsubtype
local getchar = nuts.getchar
local setchar = nuts.setchar
+local getdiscpart = nuts.getdiscpart
local getdisc = nuts.getdisc
local setdisc = nuts.setdisc
local getlanguage = nuts.getlanguage
@@ -36,10 +37,10 @@ local isglyph = nuts.isglyph
local copy_node = nuts.copy
local remove_node = nuts.remove
-local flush_list = nuts.flush_list
-local flush_node = nuts.flush_node
+----- flushnode = nuts.flushnode
local nextdisc = nuts.traversers.disc
+local nextglyph = nuts.traversers.glyph
local new_disc = nuts.pool.disc
@@ -49,6 +50,12 @@ local disccodes = nodes.disccodes
local disc_code = nodecodes.disc
local glyph_code = nodecodes.glyph
+local discoptioncodes = tex.discoptioncodes
+local pre_part_code = discoptioncodes.pre
+local post_part_code = discoptioncodes.post
+local replace_part_code = discoptioncodes.replace
+local always_part_code = discoptioncodes.always
+
local explicitdisc_code = disccodes.explicit
local a_visualize = attributes.private("visualizediscretionary")
@@ -77,6 +84,20 @@ function languages.visualizediscretionaries(head)
end
end
end
+ for g in nextglyph, head do
+ if getattr(g,a_visualize) then
+ local c = getdiscpart(g)
+ if c == pre_part_code then
+ setlistcolor(g,"darkmagenta")
+ elseif c == post_part_code then
+ setlistcolor(g,"darkcyan")
+ elseif c == replace_part_code then
+ setlistcolor(g,"darkyellow")
+ elseif c == always_part_code then
+ setlistcolor(g,"darkgray")
+ end
+ end
+ end
return head
end
@@ -124,12 +145,12 @@ end
local wiped = 0
-local flatten_discretionaries = nuts.flatten_discretionaries -- todo in nodes
+local flattendiscretionaries = nuts.flattendiscretionaries -- todo in nodes
--- if flatten_discretionaries then
+-- if flattendiscretionaries then
function languages.flatten(head)
- local h, n = flatten_discretionaries(head)
+ local h, n = flattendiscretionaries(head)
wiped = wiped + n
return h, n > 0
end
@@ -152,7 +173,7 @@ local flatten_discretionaries = nuts.flatten_discretionaries -- todo in nodes
-- head = h
-- end
-- wiped = wiped + 1
--- flush_node(delayed)
+-- flushnode(delayed)
-- return head
-- end
--
@@ -184,7 +205,7 @@ local flatten = languages.flatten
nodes.handlers.flattenline = flatten
function nodes.handlers.flatten(head,where)
- if head and (where == "box" or where == "adjusted_hbox") then
+ if head and (where == "box" or where == "adjustedhbox") then
return flatten(head)
end
return head
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-frq.mkxl b/Master/texmf-dist/tex/context/base/mkxl/lang-frq.mkxl
index 6b9853af574..7a35b8d510a 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lang-frq.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/lang-frq.mkxl
@@ -94,7 +94,7 @@
\permanent\protected\def\startcharactertable[#1]#2\stopcharactertable % \dimexpr has fuzzy lookahead
{\startnointerference
\gdefcsname\??frequencywidths#1\endcsname{#2}% the width vector
- \scratchcounter\zerocount \def\charfreq##1 ##2 {\advance\scratchcounter\plusone} #2%
+ \scratchcounter\zerocount \def\charfreq##1 ##2 {\advanceby\scratchcounter\plusone} #2%
\xdefcsname\??frequencycounts#1\endcsname{\the\scratchcounter}% the character count
\stopnointerference}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-hup.lmt b/Master/texmf-dist/tex/context/base/mkxl/lang-hup.lmt
new file mode 100644
index 00000000000..2099f9d1b7c
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/lang-hup.lmt
@@ -0,0 +1,264 @@
+if not modules then modules = { } end modules ['lang-hup'] = {
+ version = 1.001,
+ comment = "companion to lang-hup.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local type, next = type, next
+local utfchar = utf.char
+local concat, sortedhash = table.concat, table.sortedhash
+local basename = file.basename
+
+local status = status
+local nodes = nodes
+
+local is_letter = characters.is_letter
+local is_hyphenator = characters.is_hyphenator
+
+local specialskips = nodes.specialskipcodes
+local nodecodes = nodes.nodecodes
+local disc_code = nodecodes.disc
+local glyph_code = nodecodes.glyph
+local glue_code = nodecodes.glue
+local hlist_code = nodecodes.hlist
+local kern_code = nodecodes.kern
+local par_code = nodecodes.par
+local line_code = nodes.listcodes.line
+local fontkern_code = nodes.kerncodes.fontkern
+local nuts = nodes.nuts
+local getlist = nuts.getlist
+local getnext = nuts.getnext
+local getprev = nuts.getprev
+local getid = nuts.getid
+local getsubtype = nuts.getsubtype
+local getreplace = nuts.getreplace
+local getdiscpart = nuts.getdiscpart
+local isnextglyph = nuts.isnextglyph
+local nexthlist = nuts.traversers.list
+local nextglyph = nuts.traversers.glyph
+local traverse = nuts.traverse
+
+local setcolor = nodes.tracers.colors.set
+local setaction = nodes.tasks.setaction
+
+local hash = table.setmetatableindex("number")
+
+local report = logs.reporter("hyphenated")
+local trace_detail = false
+
+local characters = fonts.hashes.characters
+
+local word = { }
+local w = 0
+
+----- function collect(word,head)
+local function collect(head)
+ local last = nil
+ while head do
+ local nxt, char, id = isnextglyph(head)
+ if char then
+ local u = characters[id][char].unicode -- we could cache it
+ if type(u) == "table" then
+ for i=1,#u do
+ local c = u[i]
+ if is_letter[c] or is_hyphenator[c] then
+ -- word[#word+1] = utfchar(c)
+ w = w + 1 ; word[w] = utfchar(c)
+ end
+ end
+ else
+ local c = u or char
+ if is_letter[c] or is_hyphenator[c] then
+ -- word[#word+1] = utfchar(c)
+ w = w + 1 ; word[w] = utfchar(c)
+ end
+ end
+ last = head
+ elseif id == disc_code then
+ -- collect(word,getreplace(head))
+ collect(getreplace(head))
+ elseif id == kern_code and getsubtype(head,fontkern_code) then
+ -- we're ok
+ else
+ break
+ end
+ head = nxt
+ end
+ return last and getdiscpart(last) == 1
+end
+
+local function getpostpart(current)
+ for n, id, subtype in traverse(current) do
+ if id == glue_code then
+ if not specialskips[subtype] then
+ break
+ end
+ elseif id == glyph_code or id == disc_code then
+ return n
+ elseif id ~= par_code then
+ break
+ end
+ end
+end
+
+local function findprepart(current)
+ for n, id, subtype in traverse(current,true,true) do
+ if id == glue_code then
+ if not specialskips[subtype] then
+ break
+ end
+ elseif id == glyph_code and getdiscpart(n) == 1 then
+ return n
+ else
+ break
+ end
+ end
+end
+
+local function getprepart(disc)
+ local back = disc
+ for n, id, subtype in traverse(getprev(disc),true) do
+ if id == glyph_code or id == disc_code or (id == kern_code and subtype == fontkern_code) then
+ back = n
+ else
+ return back
+ end
+ end
+ return back
+end
+
+function nodes.handlers.showhyphenation(head)
+ -- local word = { }
+ w = 0
+ for current, id, subtype, list in nexthlist, head do
+ if list and subtype == line_code then
+ -- if #word > 0 then
+ if w > 0 then
+ local after = getpostpart(list)
+ -- local more = collect(word,after)
+ local more = collect(after)
+ if more then
+ goto skip
+ else
+ -- local result = concat(word)
+ local result = concat(word,"",1,w)
+ if trace_detail then
+ local r = status.readstate
+ report("around line %s in file %s: %s",r.linenumber or "-",basename(r.filename),result)
+ end
+ hash[result] = hash[result] + 1
+ -- word = { }
+ w = 0
+ end
+ end
+ local last = findprepart(list)
+ if last then
+ local before = getprepart(last)
+ -- collect(word,before)
+ collect(before)
+ end
+ ::skip::
+ end
+ end
+ return head
+end
+
+local initialize initialize = function()
+ logs.registerfinalactions(function()
+ logs.startfilelogging(report,"hyphenated words")
+ if hash and next(hash) then
+ local oldname = file.nameonly(tex.jobname) .. "-hyphenated-words-old.txt"
+ local newname = file.nameonly(tex.jobname) .. "-hyphenated-words-new.txt"
+ local old = string.splitlines(string.strip(io.loaddata(oldname) or "")) or { }
+ local hsh = table.tohash(old)
+ local new = { }
+ for word, count in sortedhash(hash) do
+ report("%4i : %s",count,word)
+ if not hsh[word] then
+ new[#new+1] = word
+ end
+ end
+ logs.stopfilelogging()
+ report("old word list : %a",oldname)
+ report("new word list : %a",newname)
+ report("to be checked : %a",#new)
+ io.savedata(newname,concat(new,"\n"))
+ else
+ report("nothing hyphenated")
+ logs.stopfilelogging()
+ end
+ end)
+ --
+ statistics.register("hyphenation",function()
+ local n = 0
+ local m = 0
+ for k, v in sortedhash(hash) do
+ n = n + 1
+ m = m + v
+ end
+ return string.format("%i hyphenated words, %i unique words",m,n)
+ end)
+ initialize = false
+end
+
+trackers.register("hyphenation.applied", function(v)
+ setaction("finalizers","nodes.handlers.showhyphenation",v)
+ if v and initialize then
+ initialize()
+ end
+end)
+
+trackers.register("hyphenation.applied.console", function(v)
+ setaction("finalizers","nodes.handlers.showhyphenation",v)
+ trace_detail = v
+ if v and initialize then
+ initialize()
+ end
+end)
+
+-- local c, f = isglyph(current)
+-- local char = chardata[f][c]
+-- if char and type(char.unicode) == "table" then -- hackery test
+
+local ligature_code = 0x8000 + nodes.glyphcodes.ligature
+local ligature_mode = false
+
+local color_n = { "red", "green", "blue" }
+local color_l = { "darkred", "darkgreen", "darkblue" }
+
+function nodes.handlers.visualizehyphenation(head)
+ for current, id, subtype, list in nexthlist, head do
+ if list and subtype == line_code then
+ if ligature_mode then
+ for n in nextglyph, list do
+ local d = getdiscpart(n)
+ local s = getsubtype(n)
+ if d > 0 and d < 4 then
+ if s == ligature_code then
+ setcolor(n,color_l[d])
+ else
+ setcolor(n,color_n[d])
+ end
+ elseif s == ligature_code then
+ setcolor(n,"darkgray")
+ end
+ end
+ else
+ for n in nextglyph, list do
+ local d = getdiscpart(n)
+ if d > 0 and d < 4 then
+ setcolor(n,color_n[d])
+ end
+ end
+ end
+ end
+ end
+ return head
+end
+
+trackers.register("hyphenation.applied.visualize", { true, false, "ligatures" }, function(v)
+ setaction("finalizers","nodes.handlers.visualizehyphenation",v)
+ ligature_mode = v == "ligatures"
+end)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-hup.mkxl b/Master/texmf-dist/tex/context/base/mkxl/lang-hup.mkxl
new file mode 100644
index 00000000000..444863cc599
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/lang-hup.mkxl
@@ -0,0 +1,34 @@
+%D \module
+%D [ file=lang-hup,
+%D version=2021.03.19,
+%D title=\CONTEXT\ Language Macros,
+%D subtitle=Hyphenation tracing,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%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 Language Macros / hyphenation tracing}
+
+\unprotect
+
+\registerctxluafile{lang-hup}{autosuffix}
+
+%D \starttyping
+%D \starttext
+%D
+%D \enabletrackers[hyphenation.applied]
+%D \enabletrackers[hyphenation.applied.console]
+%D
+%D \dontcomplain \dostepwiserecurse{0}{15}{1}{
+%D {\advanceby\hsize -#1cm \input tufte \par}
+%D }
+%D
+%D \stoptext
+%D \stoptyping
+
+\protect \endinput
+
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-hyp.lmt b/Master/texmf-dist/tex/context/base/mkxl/lang-hyp.lmt
index c356dbf3c47..1ac2604f209 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lang-hyp.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/lang-hyp.lmt
@@ -656,12 +656,12 @@ if context then
local setprev = nuts.setprev
local setnext = nuts.setnext
- local insert_before = nuts.insert_before
- local insert_after = nuts.insert_after
+ local insertbefore = nuts.insertbefore
+ local insertafter = nuts.insertafter
local copy_node = nuts.copy
- local copy_list = nuts.copy_list
+ local copylist = nuts.copylist
local remove_node = nuts.remove
- local end_of_math = nuts.end_of_math
+ local endofmath = nuts.endofmath
local node_tail = nuts.tail
local nexthlist = nuts.traversers.hlist
@@ -1014,7 +1014,7 @@ featureset.hyphenonly = hyphenonly == v_yes
-- [nodecodes.rule] = true,
-- [nodecodes.dir] = true,
-- [nodecodes.whatsit] = true,
- -- [nodecodes.ins] = true,
+ -- [nodecodes.insert] = true,
-- [nodecodes.adjust] = true,
--
-- [nodecodes.math] = true,
@@ -1044,8 +1044,8 @@ featureset.hyphenonly = hyphenonly == v_yes
local stop = nil
local word = { } -- we reuse this table
local size = 0
- local leftchar = false
- local rightchar = false -- utfbyte("-")
+ -- local leftchar = false
+ -- local rightchar = false -- utfbyte("-")
local leftexchar = false
local rightexchar = false -- utfbyte("-")
local leftmin = 0
@@ -1087,7 +1087,7 @@ featureset.hyphenonly = hyphenonly == v_yes
nuts.setvisual(p,"penalty")
end
last = getprev(last)
- first, last = insert_after(first,last,p)
+ first, last = insertafter(first,last,p)
end
local function synchronizefeatureset(a)
@@ -1245,7 +1245,7 @@ featureset.hyphenonly = hyphenonly == v_yes
local glyph = copy_node(stop)
setchar(glyph,characters[replacement])
if head then
- insert_after(current,current,glyph)
+ insertafter(current,current,glyph)
else
head = glyph
end
@@ -1256,7 +1256,7 @@ featureset.hyphenonly = hyphenonly == v_yes
local glyph = copy_node(stop)
setchar(glyph,characters[list[i]])
if head then
- insert_after(current,current,glyph)
+ insertafter(current,current,glyph)
else
head = glyph
end
@@ -1265,7 +1265,7 @@ featureset.hyphenonly = hyphenonly == v_yes
end
if rightchar then
local glyph = copy_node(stop)
- insert_after(current,current,glyph)
+ insertafter(current,current,glyph)
setchar(glyph,rightchar)
end
return head
@@ -1291,7 +1291,7 @@ featureset.hyphenonly = hyphenonly == v_yes
setattrlist(disc,attrnode)
end
-- could be a replace as well
- insert_before(first,current,disc)
+ insertbefore(first,current,disc)
elseif type(r) == "table" then
local disc = new_disc()
local pre = r[1]
@@ -1325,7 +1325,7 @@ featureset.hyphenonly = hyphenonly == v_yes
if attrnode then
setattrlist(disc,attrnode)
end
- insert_before(first,current,disc)
+ insertbefore(first,current,disc)
else
setchar(current,characters[r])
if i < rsize then
@@ -1340,14 +1340,13 @@ featureset.hyphenonly = hyphenonly == v_yes
first, current = remove_node(first,current,true)
end
end
-
end
local function inject(leftchar,rightchar,code,attrnode)
if first ~= current then
local disc = new_disc()
first, current, glyph = remove_node(first,current)
- first, current = insert_before(first,current,disc)
+ first, current = insertbefore(first,current,disc)
if trace_visualize then
setcolor(glyph,"darkred") -- these get checked
setcolor(disc,"darkgreen") -- in the colorizer
@@ -1372,7 +1371,7 @@ featureset.hyphenonly = hyphenonly == v_yes
local function injectseries(current,last,next,attrnode)
local disc = new_disc()
local start = current
- first, current = insert_before(first,current,disc)
+ first, current = insertbefore(first,current,disc)
setprev(start)
setnext(last)
if next then
@@ -1380,7 +1379,7 @@ featureset.hyphenonly = hyphenonly == v_yes
else
setnext(current)
end
- local pre = copy_list(start)
+ local pre = copylist(start)
local post = nil
local replace = start
setdisc(disc,pre,post,replace,automaticdisc_code,hyphenpenalty) -- ex ?
@@ -1547,10 +1546,10 @@ featureset.hyphenonly = hyphenonly == v_yes
skipping = true
end
-- elseif strict and strict[id] then
- -- current = id == math_code and getnext(end_of_math(current)) or getnext(current)
+ -- current = id == math_code and getnext(endofmath(current)) or getnext(current)
-- size = 0
else
- current = id == math_code and getnext(end_of_math(current)) or getnext(current)
+ current = id == math_code and getnext(endofmath(current)) or getnext(current)
end
if size > 0 then
if dictionary and size > charmin and leftmin + rightmin <= size then
@@ -1645,7 +1644,7 @@ featureset.hyphenonly = hyphenonly == v_yes
function hyphenators.handler(head,groupcode)
if usedmethod then
- if optimize and (groupcode == "hbox" or groupcode == "adjusted_hbox") then
+ if optimize and (groupcode == "hbox" or groupcode == "adjustedhbox") then
if getcount("hyphenstate") > 0 then
forced = false
return usedmethod(head)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-hyp.mkxl b/Master/texmf-dist/tex/context/base/mkxl/lang-hyp.mkxl
index 87423d6d365..355804ca3fb 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lang-hyp.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/lang-hyp.mkxl
@@ -43,7 +43,7 @@
%D and such are now more or less default in \CONTEXT\ so we can simplify some of the
%D code. We also use the new penalty mechanism.
-\newcount\compoundhyphenpenalty
+\newinteger\compoundhyphenpenalty
% \ifcase\contextlmtxmode
% \hyphenpenaltymode\plusfour
@@ -62,15 +62,29 @@
\installcorenamespace{hyphenation}
\installcorenamespace{hyphenationfeatures}
-\installparameterhandler \??hyphenation {hyphenation}
-\installsetuphandler \??hyphenation {hyphenation}
+\installparameterhandler \??hyphenation {hyphenation}
+\installrootparameterhandler \??hyphenation {hyphenation}
+\installsetuphandler \??hyphenation {hyphenation}
+
+% \installbasicsetuphandler \??hyphenation {hyphenation}
\setuphyphenation
[\c!method=\s!default,
+ \c!hyphens=\v!yes,
\s!righthyphenchar=0, % number tzt g: etc
\s!lefthyphenchar=0] % number
\appendtoks
+ % \edef\p_hyphens{\roothyphenationparameter\c!hyphens}%
+ \edef\p_hyphens{\hyphenationparameter\c!hyphens}%
+ \ifx\p_hyphens\v!no
+ \nohyphencollapsing
+ \else
+ \dohyphencollapsing
+ \fi
+\to \everysetuphyphenation
+
+\appendtoks
\clf_sethyphenationmethod{\hyphenationparameter\c!method}%
\to \everysetuphyphenation
@@ -93,19 +107,19 @@
% [\c!method=\s!traditional] % no translations
\permanent\tolerant\protected\def\definehyphenationfeatures[#1]#*[#2]%
- {\begingroup
- \letdummyparameter\c!characters \empty % maybe \s!characters
- \letdummyparameter\c!hyphens \empty % maybe \s!hyphens
- \letdummyparameter\c!joiners \empty % maybe \s!joiners
- \letdummyparameter\c!rightwords \zerocount % maybe \s!rightwords
- \letdummyparameter\s!lefthyphenmin \zerocount
- \letdummyparameter\s!righthyphenmin \zerocount
- \letdummyparameter\s!hyphenmin \zerocount
- \letdummyparameter\s!lefthyphenchar \zerocount
- \letdummyparameter\s!righthyphenchar\zerocount
- \letdummyparameter\c!alternative \empty
- \letdummyparameter\c!rightedge \empty
- \letdummyparameter\c!rightchars \empty
+ {\begingroup % maybe simple handler
+ \resetdummyparameter\c!characters % maybe \s!characters
+ \resetdummyparameter\c!hyphens % maybe \s!hyphens
+ \resetdummyparameter\c!joiners % maybe \s!joiners
+ \letdummyparameter \c!rightwords \zerocount % maybe \s!rightwords
+ \letdummyparameter \s!lefthyphenmin \zerocount
+ \letdummyparameter \s!righthyphenmin \zerocount
+ \letdummyparameter \s!hyphenmin \zerocount
+ \letdummyparameter \s!lefthyphenchar \zerocount
+ \letdummyparameter \s!righthyphenchar\zerocount
+ \resetdummyparameter\c!alternative
+ \resetdummyparameter\c!rightedge
+ \resetdummyparameter\c!rightchars
\getdummyparameters[#2]%
\clf_definehyphenationfeatures
{#1}%
@@ -196,9 +210,6 @@
% \sethyphenationfeatures
% [default,fences]
-% \setuphyphenation % will be default
-% [method=expanded]
-
\protect \endinput
% \starttext
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/lang-ini.lmt
index 5f2dd1a55d3..64f1e82d029 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lang-ini.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/lang-ini.lmt
@@ -10,18 +10,20 @@ if not modules then modules = { } end modules ['lang-ini'] = {
-- discard language when redefined
-- 002D : hyphen-minus (ascii)
+-- 002D : hyphen-minus (ascii)
-- 2010 : hyphen
-- 2011 : nonbreakable hyphen
-- 2013 : endash (compound hyphen)
---~ language:hyphenation(string) string = language:hyphenation() language:clear_hyphenation()
-
-- todo: no foo:bar but foo(bar,...)
+-- https://wortschatz.uni-leipzig.de/de/download/German : lots of lists
+
local type, tonumber, next = type, tonumber, next
-local utfbyte = utf.byte
+local utfbyte, utflength = utf.byte, utf.length
local format, gsub, gmatch, find = string.format, string.gsub, string.gmatch, string.find
-local concat, sortedkeys, sortedpairs, keys, insert = table.concat, table.sortedkeys, table.sortedpairs, table.keys, table.insert
+local concat, sortedkeys, sortedhash, keys, insert, tohash = table.concat, table.sortedkeys, table.sortedhash, table.keys, table.insert, table.tohash
+local setmetatableindex = table.setmetatableindex
local utfvalues, strip, utfcharacters = string.utfvalues, string.strip, utf.characters
local context = context
@@ -29,11 +31,14 @@ local commands = commands
local implement = interfaces.implement
local settings_to_array = utilities.parsers.settings_to_array
-local settings_to_set = utilities.parsers.settings_to_set
+local settings_to_set = utilities.parsers.settings_to_set
local trace_patterns = false trackers.register("languages.patterns", function(v) trace_patterns = v end)
+local trace_goodies = false trackers.register("languages.goodies", function(v) trace_goodies = v end)
+local trace_applied = false trackers.register("languages.applied", function(v) trace_applied = v end)
local report_initialization = logs.reporter("languages","initialization")
+local report_goodies = logs.reporter("languages","goodies")
local prehyphenchar = language.prehyphenchar -- global per language
local posthyphenchar = language.posthyphenchar -- global per language
@@ -94,6 +99,9 @@ local function tolang(what) -- returns lang object
if not what then
what = currentlanguage()
end
+ if type(what) == "userdata" then
+ return what
+ end
local tag = numbers[what]
local data = tag and registered[tag] or registered[what]
if data then
@@ -114,7 +122,7 @@ function languages.getdata(tag) -- or number
end
end
--- languages.tolang = tolang
+languages.tolang = tolang
-- patterns=en
-- patterns=en,de
@@ -156,11 +164,16 @@ local function sethjcodes(instance,loaded,what,factor)
loaded.codehash = h
end
--
- local function setcode(l)
- local u = uccodes[l]
+ local function setcode(code)
+ local l = lccodes[code] -- just in case we get a mixture
+ local u = uccodes[code] -- just in case we get a mixture
local s = l
+ if type(s) ~= "number" then
+ l = code
+ s = code
+ end
if hjcounts then
- local c = hjcounts[l]
+ local c = hjcounts[s]
if c then
c = c.count
if not c then
@@ -178,20 +191,30 @@ local function sethjcodes(instance,loaded,what,factor)
end
end
sethjcode(instance,l,s)
- h[l] = s
if u ~= l and type(u) == "number" then
sethjcode(instance,u,s)
- h[u] = lccodes[l]
+ h[u] = s
end
end
--
local s = tex.savinghyphcodes
tex.savinghyphcodes = 0
if type(c) == "table" then
- for l in next, c do
- setcode(utfbyte(l))
+ if #c > 0 then
+ -- list: { U, U, U, "chr", "chr", ... }
+ for i=1,#c do
+ local v = c[i]
+ setcode(type(v) == "string" and utfbyte(v) or v)
+ end
+ else
+ -- hash: { ["chr"] = true, ... }
+ for k, v in sortedhash(c) do
+ if v then
+ setcode(utfbyte(k))
+ end
+ end
end
- else
+ elseif type(c) == "string" then
for l in utfvalues(c) do
setcode(l)
end
@@ -200,9 +223,35 @@ local function sethjcodes(instance,loaded,what,factor)
end
end
+local function addhjcodestoinstance(instance,characters)
+ if type(characters) == "table" then
+ local nofcharacters = #characters
+ if nofcharacters > 0 then
+ -- list: { U, U, U, "chr", "chr", ... }
+ for i=1,nofcharacters do
+ local v = characters[i]
+ local h = type(v) == "string" and utfbyte(v) or v
+ sethjcode(instance,h,h)
+ end
+ else
+ -- hash: { ["chr"] = true, ... }
+ for k, v in next, characters do
+ if v then
+ local h = type(k) == "string" and utfbyte(k) or k
+ sethjcode(instance,h,h)
+ end
+ end
+ end
+ elseif type(characters) == "string" then
+ for h in utfvalues(characters) do
+ sethjcode(instance,h,h)
+ end
+ end
+end
+
-- 2'2 conflicts with 4' ... and luatex barks on it
-local P, R, Cs, Ct, lpegmatch, lpegpatterns = lpeg.P, lpeg.R, lpeg.Cs, lpeg.Ct, lpeg.match, lpeg.patterns
+local P, S, R, C, Cs, Ct, lpegmatch, lpegpatterns = lpeg.P, lpeg.S, lpeg.R, lpeg.C, lpeg.Cs, lpeg.Ct, lpeg.match, lpeg.patterns
local utfsplit = utf.split
@@ -316,8 +365,8 @@ local function loaddefinitions(tag,specification)
if trace_patterns then
report_initialization("clearing patterns for language %a",tag)
end
- instance:clear_patterns()
- instance:clear_hyphenation()
+ instance:clearpatterns()
+ instance:clearhyphenation()
ploaded = { }
eloaded = { }
elseif not dataused[definition] then
@@ -358,12 +407,12 @@ local function loaddefinitions(tag,specification)
end
if #ploaded > 0 then
-- why not always clear
- instance:clear_patterns()
+ instance:clearpatterns()
instance:patterns(unique(tag,requested,ploaded))
end
if #eloaded > 0 then
-- why not always clear
- instance:clear_hyphenation()
+ instance:clearhyphenation()
instance:hyphenation(concat(eloaded," "))
end
if type(shared) == "string" then
@@ -450,65 +499,6 @@ function languages.unload(tag)
end
end
-if environment.initex then
-
- function languages.getnumber()
- return 0
- end
-
-else
-
- function languages.getnumber(tag,default,patterns,factor)
- local l = registered[tag]
- if l then
- if l.dirty then
- l.factor = factor == v_yes and true or false
- if trace_patterns then
- report_initialization("checking patterns for %a with default %a",tag,default)
- end
- -- patterns is already resolved to parent patterns if applicable
- if patterns and patterns ~= "" then
- if l.patterns ~= patterns then
- l.patterns = patterns
- if trace_patterns then
- report_initialization("loading patterns for %a using specification %a",tag,patterns)
- end
- loaddefinitions(tag,l)
- else
- -- unchanged
- end
- elseif l.patterns == "" then
- l.patterns = tag
- if trace_patterns then
- report_initialization("loading patterns for %a using tag",tag)
- end
- local ok = loaddefinitions(tag,l)
- if not ok and tag ~= default then
- l.patterns = default
- if trace_patterns then
- report_initialization("loading patterns for %a using default",tag)
- end
- loaddefinitions(tag,l)
- end
- end
- l.loaded = true
- l.dirty = false
- end
- return l.number
- else
- return 0
- end
- end
-
- numbers[0] = "null"
-
- registered.null = {
- number = 0,
- instance = new_language(0),
- }
-
-end
-
-- not that usefull, global values
function languages.prehyphenchar (what) return prehyphenchar (tolang(what)) end
@@ -524,13 +514,22 @@ function languages.postexhyphenchar(what) return postexhyphenchar(tolang(what))
-- e['user-friendly'] = 'user=friend-ly'
-- e['exceptionally-friendly'] = 'excep-tionally=friend-ly'
-local invalid = { "{", "}", "-" }
+local invalid = { "{", "}", "(", ")", "-", " " }
local function collecthjcodes(data,str)
local found = data.extras and data.extras.characters or { }
- for s in utfcharacters(str) do
- if not found[s] then
- found[s] = true
+ if type(str) == "string" then
+ for s in utfcharacters(str) do
+ if not found[s] then
+ found[s] = true
+ end
+ end
+ elseif type(str) == "table" then
+ for i=1,#str do
+ local s = str[i]
+ if not found[s] then
+ found[s] = true
+ end
end
end
for i=1,#invalid do -- less checks this way
@@ -564,6 +563,30 @@ function languages.setexceptions(tag,str)
end
end
+function languages.setpatterns(tag,str)
+ local data, instance = resolve(tag)
+ if data then
+ str = strip(str) -- we need to strip leading spaces
+ collecthjcodes(data,str)
+ instance:patterns(str)
+ end
+end
+
+local function setwordhandler(tag,action)
+ local data, instance = resolve(tag)
+ if data then
+ instance:setwordhandler(action)
+ end
+end
+
+languages.setwordhandler = setwordhandler
+
+function languages.setoptions(tag,str)
+ languages.addgoodiesdata(tag,{ { words = str } })
+ -- for now:
+ languages.setgoodieshandler { tag = tag, goodies = tag }
+end
+
function languages.hyphenate(tag,str)
-- todo: does this still work?
local data, instance = resolve(tag)
@@ -574,6 +597,878 @@ function languages.hyphenate(tag,str)
end
end
+-- This code is here for some testing (and discussion) but it might end up in its
+-- own module. I wrote it after listening to the end March 2021 live concert of
+-- Mandoki Soulmates: Hungarian Pictures (music is the greatest unifier) with his
+-- usual incredible international lineup. After that, and realizing that we needed
+-- to deal better with some language issues as follow up on a mailing list thread, I
+-- needed only a few loops of relistening the concert to implement it. In
+-- restrospect this was a language feature that should have been there a while ago.
+
+local expand ; do
+
+ local nuts = nodes.nuts
+ local nextglyph = nuts.traversers.glyph
+ local setoptions = nuts.setoptions
+
+ local getnext = nuts.getnext
+ local getprev = nuts.getprev
+ local setchar = nuts.setchar
+ local setnext = nuts.setnext
+ local setlink = nuts.setlink
+ local setfield = nuts.setfield
+ local setdisc = nuts.setdisc
+ local getprop = nuts.getprop
+ local setprop = nuts.setprop
+ local setattrlist = nuts.setattrlist
+
+ local new_disc = nuts.pool.disc
+ local new_glyph = nuts.pool.glyph
+ local copy_node = nuts.copy
+ local flushlist = nuts.flushlist
+
+ local glyphoptioncodes = tex.glyphoptioncodes
+
+ local lower = characters.lower
+ local replacer = utf.replacer
+ local utfchartabletopattern = lpeg.utfchartabletopattern
+
+ local report = logs.reporter("languages","goodies")
+
+ -- can be shared
+
+ local goodiesdata = setmetatableindex(function(t,k)
+ local v = {
+ properties = { },
+ replacements = { },
+ characters = { },
+ exceptions = { },
+ substitutions = { },
+ }
+ t[k] = v
+ return v
+ end)
+
+ -- can be a helper
+
+ local compound_disc_code = tex.discoptioncodes.preword | tex.discoptioncodes.postword
+
+ local function setcompound(current,id,first,last,lh,rh,hyphen)
+ local prev = getprev(current)
+ -- local language = tolang(id)
+ -- local prechar = prehyphenchar(language)
+ -- local postchar = posthyphenchar(language)
+ local prechar = prehyphenchar(id)
+ local postchar = posthyphenchar(id)
+ local pre = prechar and copy_node(current)
+ local post = postchar and copy_node(current)
+ local replace = hyphen and prechar and copy_node(current)
+ local disc = new_disc()
+ if pre then
+ setchar(pre,prechar)
+ end
+ if post then
+ setchar(post,postchar)
+ end
+ if replace then
+ setchar(replace,prechar)
+ end
+ setattrlist(disc,current)
+ setoptions(disc,0x3) -- todo foo_code
+ setdisc(disc,pre,post,replace)
+ setlink(prev,disc,current)
+ if lh then
+ setfield(first,"rhmin",rh)
+ end
+
+ if rh then
+ setfield(current,"lhmin",lh)
+ end
+
+ end
+
+ local setcompounds = setmetatableindex(function(t,l)
+ local v = setmetatableindex(function(t,r)
+ local v = function(current,id,first,last) return setcompound(current,id,first,last,l,r) end
+ t[r] = v
+ return v
+ end)
+ t[l] = v
+ return v
+ end)
+
+ local sethyphens = setmetatableindex(function(t,l)
+ local v = setmetatableindex(function(t,r)
+ local v = function(current,id,first,last) return setcompound(current,id,first,last,l,r,true) end
+ t[r] = v
+ return v
+ end)
+ t[l] = v
+ return v
+ end)
+
+ local function replaceword(first,last,old,new,oldlen)
+ local oldlen = utflength(old)
+ local newlen = utflength(new)
+ if newlen == 0 then
+ -- forget about it
+ elseif newlen <= oldlen then
+ for s in utfvalues(new) do
+ setchar(first,s)
+ first = getnext(first)
+ end
+ if newlen < oldlen then
+ -- first is one ahead
+ local after = getnext(last)
+ local before = getprev(first)
+ setnext(last)
+ setlink(before,after)
+ flushlist(first)
+ end
+ else
+ local i = 0
+ local l = getnext(last)
+ for s in utfvalues(new) do
+ i = i + 1
+ if i > oldlen then
+ local g = copy_node(first)
+ setlink(first,g,l)
+ setchar(g,s)
+ first = g
+ elseif i == oldlen then
+ setchar(first,s)
+ else
+ setchar(first,s)
+ first = getnext(first)
+ end
+ end
+ end
+ end
+
+ -- local optioncodes = table.copy(glyphoptioncodes)
+ --
+ -- optioncodes.nokerns = optioncodes.noleftkern | optioncodes.norightkern
+ -- optioncodes.noligatures = optioncodes.noleftligature | optioncodes.norightligature
+
+ local lh, rh = false, false
+
+ local cache = setmetatableindex(function(t,k)
+ local v = 0
+ if k == "compound" then
+ v = setcompounds[lh][rh]
+ elseif k == "hyphen" then
+ v = sethyphens[lh][rh]
+ else
+ v = 0
+ for s in gmatch(k,"%w+") do
+ local o = glyphoptioncodes[s]
+ -- local o = optioncodes[s]
+ if o then
+ v = v | o
+ end
+ end
+ end
+ t[k] = v
+ return v
+ end)
+
+ local function checkglyphproperties(options)
+ -- we sort, just to be sure
+ for word, list in sortedhash(options) do
+ if type(list) == "string" then
+ options[word] = options[list]
+ else
+ for index, option in sortedhash(list) do
+ if type(option) == "string" then
+ list[index] = cache[option]
+ end
+ end
+ end
+ end
+ end
+
+ -- statistics.starttiming(languages)
+ -- statistics.stoptiming(languages)
+
+ -- 1: restart 2: exceptions+patterns 3: patterns *: next word
+
+ local sequencers = utilities.sequencers
+ local newsequencer = sequencers.new
+ local appendgroup = sequencers.appendgroup
+ local prependaction = sequencers.prependaction
+ local appendaction = sequencers.appendaction
+ local enableaction = sequencers.enableaction
+ local disableaction = sequencers.disableaction
+
+ local template = {
+ arguments = "s",
+ returnvalues = "r,i",
+ results = "r,i",
+ }
+
+ local registeredactions = setmetatableindex ( function(t,tag)
+ local actions = newsequencer(template)
+ appendgroup(actions,"user")
+ t[tag] = actions
+ return actions
+ end )
+
+ languages.registeredactions = registeredactions
+
+ function languages.installhandler(tag,func)
+ local todo = not rawget(registeredactions,tag)
+ local actions = registeredactions[tag]
+ appendaction(actions,"user",func)
+ enableaction(actions,func)
+ report("installing handler %a for language %a",func,tag)
+ if todo then
+ setwordhandler(tag,function(n,original,remapped,length,first,last)
+ local runner = actions.runner
+ if runner then
+ if getprop(first,"replaced") then
+ -- maybe some deadcycles
+ else
+ local r, result = runner(original)
+ if not r or original == r then
+ return result or 0
+ else
+ setprop(first,"replaced",true)
+ replaceword(first,last,original,r,length)
+ return 1
+ end
+ end
+ end
+ return 2
+ end)
+ end
+ end
+
+ local appliedoptions = setmetatableindex("table")
+ languages.appliedoptions = appliedoptions
+
+ languages.setgoodieshandler = function(specification) -- will become a table specifier
+ if type(specification) == "table" then
+ local tag = specification.tag
+ local goodies = specification.goodies or tag
+ local result = specification.result or 2
+ local data = goodiesdata[goodies]
+ local properties = data.properties
+ local replacements = data.replacements
+ local substitutions = data.substitutions
+ local characters = data.characters
+ local exceptions = data.exceptions
+ local replacer = nil
+ local substituter = nil
+ local d, instance = resolve(tag)
+ local done = false
+ -- check if something at all
+ if type(characters) == "table" and characters and next(characters) then
+ addhjcodestoinstance(instance,characters)
+ if trace_goodies then
+ report_goodies("registering %a characters for %a",goodies,tag)
+ end
+ done = true
+ end
+ if type(properties) == "table" and next(properties) then
+ checkglyphproperties(properties) -- checks in place!
+ if trace_goodies then
+ report_goodies("registering %a properties for %a",goodies,tag)
+ end
+ done = true
+ end
+ if type(replacements) == "table" and next(replacements) then
+ replacer = Cs((utfchartabletopattern(replacements) / replacements + 1)^0)
+ if trace_goodies then
+ report_goodies("registering %a replacer for %a",goodies,tag)
+ end
+ done = true
+ end
+ if type(substitutions) == "table" and next(substitutions) then
+ substituter = Cs((utfchartabletopattern(substitutions) / substitutions + 1)^0)
+ if trace_goodies then
+ report_goodies("registering %a substitutor for %a",goodies,tag)
+ end
+ done = true
+ end
+ if type(exceptions) == "table" and next(exceptions) then
+ done = true
+ else
+ exceptions = false
+ end
+ if done then
+ local registered = registeredactions[tag]
+ local applied = appliedoptions[tag]
+ setwordhandler(tag,function(n,original,remapped,length,first,last)
+ local runner = registered.runner
+ if runner then
+ if getprop(first,"replaced") then
+ -- maybe some deadcycles
+ else
+ local r, result = runner(original)
+ if not r then
+ if trace_goodies then
+ report_goodies("kept by runner: %s => %s, result %i",original,remapped, result or 0)
+ end
+ return result or 0
+ elseif original == r then
+ if result then
+ if trace_goodies then
+ report_goodies("kept by runner: %s => %s, result %i",original,remapped, result)
+ end
+ return result
+ else
+ if trace_goodies then
+ report_goodies("kept by runner: %s => %s, continue",original,remapped)
+ end
+ end
+ else
+ if trace_goodies then
+ report_goodies("replaced by runner: %s => %s => %s, restart",original,remapped,r)
+ end
+ setprop(first,"replaced",true)
+ replaceword(first,last,original,r,length)
+ return 1
+ end
+ end
+ end
+ local result = 2
+ local o = properties[remapped]
+ ::again::
+ if o then
+ if trace_goodies then
+ report("properties: %s %s",original,remapped)
+ end
+ if trace_applied then
+ applied[original] = (applied[original] or 0) + 1
+ end
+ local index = 0
+ for g, c in nextglyph, first do
+ index = index + 1
+ local oi = o[index]
+ if oi then
+ if type(oi) == "function" then
+ oi(g,n,first,last) -- maybe return value
+ result = 1
+ else
+ setoptions(g,oi)
+ end
+ end
+ if g == last then
+ break
+ end
+ end
+ return result
+ end
+ if replacer then
+ -- todo: check lengths so that we can avoid a check
+ if getprop(first,"replaced") then
+ -- maybe some deadcycles
+ else
+ local r = lpegmatch(replacer,original)
+ if original == r then
+ if trace_goodies then
+ report_goodies("kept: %s => %s",original,remapped)
+ end
+ else
+ if trace_goodies then
+ report_goodies("replaced: %s => %s => %s",original,remapped,r)
+ end
+ setprop(first,"replaced",true)
+ replaceword(first,last,original,r,length)
+ result = 1
+ end
+ end
+ return result
+ end
+ if substituter then
+ if getprop(first,"replaced") then
+ -- maybe some deadcycles
+ else
+ local r = lpegmatch(substituter,original)
+ if original == r then
+ if trace_goodies then
+ report_goodies("kept: %s => %s",original,remapped)
+ end
+ else
+ if trace_goodies then
+ report_goodies("substituted: %s => %s => %s",original,remapped,r)
+ end
+ setprop(first,"replaced",true)
+ if not properties[r] then
+ o = expand(r)
+ properties[original] = o
+ goto again
+ end
+ end
+ end
+ end
+ if exceptions then
+ local exception = exceptions[original]
+ if exception then
+ if trace_goodies then
+ report_goodies("exception: %s => %s",original,exception)
+ end
+ result = exception
+ else
+ result = 3
+ end
+ return result
+ end
+ if trace_goodies then
+ report_goodies("ignored: %s => %s",original,remapped)
+ end
+ return result
+ end)
+ elseif trace_goodies then
+ report_goodies("nothing useable in %a for %a",goodies,tag)
+ end
+ else
+ setwordhandler(tag)
+ end
+ end
+
+ local norightligature_option = glyphoptioncodes.norightligature
+ local noleftligature_option = glyphoptioncodes.noleftligature
+ local norightkern_option = glyphoptioncodes.norightkern
+ local noleftkern_option = glyphoptioncodes.noleftkern
+
+ local function applyaction(oc,v,n)
+ if oc == "noligature" then
+ if n > 0 then
+ local vv = v[n-1]
+ if vv then
+ v[n-1] = vv | norightligature_option
+ else
+ v[n-1] = norightligature_option
+ end
+ end
+ v[n] = noleftligature_option
+ elseif oc == "compound" then
+ if n > 1 then
+ -- v[n] = setcompound
+ v[n] = setcompounds[lh][rh]
+ return true
+ end
+ elseif oc == "hyphen" then
+ if n > 1 then
+ v[n] = sethyphens[lh][rh]
+ return true
+ end
+ elseif oc == "nokern" then
+ if n > 0 then
+ local vv = v[n-1]
+ if vv then
+ v[n-1] = vv | norightkern_option
+ else
+ v[n-1] = norightkern_option
+ end
+ end
+ v[n] = noleftkern_option
+ elseif oc == "noleftkern" then
+ v[n] = noleftkern_option
+ elseif oc == "norightkern" then
+ if n > 0 then
+ local vv = v[n-1]
+ if vv then
+ v[n-1] = vv | norightkern_option
+ else
+ v[n-1] = norightkern_option
+ end
+ end
+ else
+ for s in gmatch(oc,"%w+") do
+ if applyaction(s,v,n) then
+ return
+ end
+ end
+ end
+ end
+
+ -- a|b : a:norightligature b:noleftligature
+ -- a=b : a:norightkern b:noleftkern
+ -- a<b : b:noleftkern
+ -- a>b : a:norightkern
+ -- a-b : hyphen
+ -- a+b : compound
+
+ local actions = {
+ ["|"] = "noligature",
+ ["="] = "nokern",
+ ["<"] = "noleftkern",
+ [">"] = "norightkern",
+ ["+"] = "compound",
+ ["-"] = "hyphen",
+ }
+
+ local function analyzed(m,a,t,k)
+ local v = { }
+ local n = 1
+ if m == true then
+ for c in gmatch(k,".") do
+ local ac = a[c]
+ if not ac then
+ n = n + 1
+ else
+ applyaction(ac,v,n)
+ end
+ end
+ elseif type(m) == "number" then
+ local i = 0
+ for c in gmatch(k,".") do
+ local ac = a[c]
+ if not ac then
+ n = n + 1
+ else
+ i = i + 1
+ if i == m then
+ applyaction(ac,v,n)
+ break
+ end
+ end
+ end
+ elseif type(m) == "table" then
+ -- happens here, otherwise no stable caching key, we could hash these too
+ m = tohash(m)
+ local i = 0
+ for c in gmatch(k,".") do
+ local ac = a[c]
+ if not ac then
+ n = n + 1
+ else
+ i = i + 1
+ if m[i] then
+ applyaction(ac,v,n)
+ end
+ end
+ end
+ else
+ -- error
+ end
+ t[k] = v
+ return v
+ end
+
+ local cache = setmetatableindex(function(t,m)
+ local v = setmetatableindex(function(t,a)
+ local v = setmetatableindex(function(t,k)
+ return analyzed(m,a,t,k)
+ end)
+ t[m] = v
+ return v
+ end)
+ t[m] = v
+ return v
+ end)
+
+ expand = function(str)
+ return analyzed(true,actions,{},str)
+ end
+
+ -- maybe also a skip symbol
+
+ local replace1 = Cs ( ( S("|=<>+-.0123456789")/"" + lpegpatterns.utf8character )^0 )
+ local replace2 = Cs ( ( S("|=<>+-.0123456789") + lpegpatterns.utf8character/".")^0 )
+
+ local function stripped(str)
+ -- todo : lpeg
+ str = gsub(str,"%-%-[^\n]*\n","")
+ str = gsub(str,"%%[^\n]*\n","")
+ str = gsub(str,"%s+"," ")
+ str = gsub(str,"^%s+","")
+ str = gsub(str,"%s+$","")
+ return str
+ end
+
+ local registerexceptions do
+
+ local lbrace = P("{")
+ local rbrace = P("}")
+ local lbracket = P("[")
+ local rbracket = P("]")
+ local lparent = P("(")
+ local rparent = P(")")
+ local hyphen = P("-")
+
+ local p = Cs ( (
+ lbrace * ((1-rbrace)^0) * rbrace
+ * lbrace * ((1-rbrace)^0) * rbrace
+ * lbrace * C((1-rbrace)^0) * rbrace * (lparent * C((1-rparent)^0) * rparent)^0 / function(a,b) return b or a end
+ + (lbracket * (1-rbracket)^0 * rbracket) / ""
+ + hyphen / ""
+ + lpegpatterns.utf8character
+ )^0 )
+
+ registerexceptions = function(target,str)
+ local kind = type(str)
+ if kind == "string" then
+ for v in gmatch(stripped(str),"%S+") do
+ local k = lpegmatch(p,v)
+ if k ~= v then
+ target[k] = v
+ end
+ end
+ elseif kind == "table" then
+ local n = #str
+ if n > 0 then
+ for i=1,n do
+ local v = str[i]
+ local k = lpegmatch(p,v)
+ if k ~= v then
+ target[k] = v
+ end
+ end
+ else
+ -- maybe check for sanity
+ for k, v in next, str do
+ target[k] = v
+ end
+ end
+ end
+ end
+
+ end
+
+ function languages.strippedgoodiewords(str)
+ return lpegmatch(replace1,stripped(str))
+ end
+
+ local splitter = lpeg.tsplitat(" ")
+
+ local function addgoodies(tag,list,filename)
+ local np = 0
+ local nd = 0
+ local nw = 0
+ local nl = #list
+ --
+ local data = goodiesdata[tag]
+ local properties = data.properties
+ local replacements = data.replacements
+ local substitutions = data.substitutions
+ local characters = data.characters
+ local exceptions = data.exceptions
+ if filename then
+ if not data.goodies then
+ data.goodies = { }
+ end
+ insert(data.goodies,filename)
+ end
+ --
+ lh = false
+ rh = false
+ --
+ for i=1,nl do
+ local l = list[i]
+ if type(l) == "table" then
+ local w = l.words
+ local p = l.patterns
+ local s = l.substitutions
+ local c = l.characters
+ local e = l.exceptions
+ lh = l.left or false -- for practical reasons these are semi-global
+ rh = l.right or false -- for practical reasons these are semi-global
+ if c then
+ for v in utfvalues(c) do
+ characters[v] = true
+ end
+ end
+ if w then
+ local prefixes = l.prefixes
+ local nofprefixes = 0
+ local suffixes = l.suffixes
+ local nofsuffixes = 0
+ if prefixes then
+ prefixes = lpegmatch(splitter,lower(stripped(prefixes)))
+ nofprefixes = #prefixes
+ end
+ if suffixes then
+ suffixes = lpegmatch(splitter,lower(stripped(suffixes)))
+ nofsuffixes = #suffixes
+ end
+ w = lower(stripped(w))
+ if p then
+ local pattern = Cs((utfchartabletopattern(p) / p + 1)^0)
+ w = lpegmatch(pattern,w)
+ np = np + 1
+ else
+ nd = nd + 1
+ end
+ local m = l.matches
+ if not m then
+ m = true
+ end
+ local a = l.actions
+ if a then
+ setmetatableindex(a,actions)
+ else
+ a = actions
+ end
+ local cach = cache[m][a]
+ if nofprefixes > 0 then
+ if nofsuffixes > 0 then
+ for wrd in gmatch(w,"%S+") do
+ properties[lpegmatch(replace1,wrd)] = cach[lpegmatch(replace2,wrd)]
+ nw = nw + 1
+ for i=1,nofprefixes do
+ local tmp = prefixes[i] .. wrd
+ for i=1,nofsuffixes do
+ local str = tmp .. suffixes[i]
+ properties[lpegmatch(replace1,str)] = cach[lpegmatch(replace2,str)]
+ nw = nw + 1
+ end
+ end
+ end
+ else
+ for wrd in gmatch(w,"%S+") do
+ properties[lpegmatch(replace1,wrd)] = cach[lpegmatch(replace2,wrd)]
+ nw = nw + 1
+ for i=1,nofprefixes do
+ local str = prefixes[i] .. wrd
+ properties[lpegmatch(replace1,str)] = cach[lpegmatch(replace2,str)]
+ nw = nw + 1
+ end
+ end
+ end
+ elseif nofsuffixes > 0 then
+ for wrd in gmatch(w,"%S+") do
+ properties[lpegmatch(replace1,wrd)] = cach[lpegmatch(replace2,wrd)]
+ nw = nw + 1
+ for i=1,nofsuffixes do
+ local str = wrd .. suffixes[i]
+ properties[lpegmatch(replace1,str)] = cach[lpegmatch(replace2,str)]
+ nw = nw + 1
+ end
+ end
+ else
+ for wrd in gmatch(w,"%S+") do
+ properties[lpegmatch(replace1,wrd)] = cach[lpegmatch(replace2,wrd)]
+ nw = nw + 1
+ end
+ end
+ elseif s then
+ for k, v in next, s do
+ substitutions[k] = v
+ end
+ elseif p then
+ for k, v in next, p do
+ replacements[k] = v
+ end
+ elseif e then
+ registerexceptions(exceptions,e)
+ end
+ end
+ end
+
+ lh = false
+ rh = false
+
+ return { np = np, nd = nd, nw = nw, nl = nl }
+ end
+
+ function languages.goodiefiles(tag)
+ local d = goodiesdata[tag]
+ return d and d.goodies
+ end
+
+ function languages.addgoodiesfile(tag,filename)
+ local fullname = resolvers.findfile(file.addsuffix(filename,"llg")) or ""
+ if fullname == "" then
+ report_goodies("file %a is not found",filename)
+ else
+ local list = table.load(fullname)
+ if not list then
+ report_goodies("file %a is invalid",fullname)
+ else
+ list = list.options
+ if not list then
+ report_goodies("file %a has no options",fullname)
+ else
+ local ok = addgoodies(tag,list,filename)
+ report_goodies("tag %a, file %a loaded, %i lists, %i via patterns, %i direct, %i words",
+ tag,fullname,ok.nl,ok.np,ok.nd,ok.nw)
+ end
+ end
+ end
+ end
+
+ function languages.addgoodiesdata(tag,list)
+ local ok = addgoodies(tag,list)
+ report_goodies("tag %a, data loaded, %i lists, %i via patterns, %i direct, %i words",
+ tag,ok.nl,ok.np,ok.nd,ok.nw)
+ end
+
+end
+
+if environment.initex then
+
+ function languages.getnumber()
+ return 0
+ end
+
+else
+
+ function languages.getnumber(tag,default,patterns,goodies,factor)
+ local l = registered[tag]
+ if l then
+ if l.dirty then
+ l.factor = factor == v_yes and true or false
+ if trace_patterns then
+ report_initialization("checking patterns for %a with default %a",tag,default)
+ end
+ -- patterns is already resolved to parent patterns if applicable
+ if patterns and patterns ~= "" then
+ if l.patterns ~= patterns then
+ l.patterns = patterns
+ if trace_patterns then
+ report_initialization("loading patterns for %a using specification %a",tag,patterns)
+ end
+ loaddefinitions(tag,l)
+ else
+ -- unchanged
+ end
+ elseif l.patterns == "" then
+ l.patterns = tag
+ if trace_patterns then
+ report_initialization("loading patterns for %a using tag",tag)
+ end
+ local ok = loaddefinitions(tag,l)
+ if not ok and tag ~= default then
+ l.patterns = default
+ if trace_patterns then
+ report_initialization("loading patterns for %a using default",tag)
+ end
+ loaddefinitions(tag,l)
+ end
+ end
+ if goodies and goodies ~= "" then
+ goodies = settings_to_array(goodies)
+ for i=1,#goodies do
+ local goodie = goodies[i]
+ -- we can cache this but it doesn't pay off to do so
+ languages.addgoodiesfile(tag,goodie)
+ end
+ languages.setgoodieshandler {
+ tag = tag,
+ goodies = tag,
+ }
+ end
+ l.loaded = true
+ l.dirty = false
+ end
+ return l.number
+ else
+ return 0
+ end
+ end
+
+ numbers[0] = "null"
+
+ registered.null = {
+ number = 0,
+ instance = new_language(0),
+ }
+
+end
+
-- hyphenation.define ("zerolanguage")
-- hyphenation.loadpatterns ("zerolanguage") -- else bug
-- hyphenation.loadexceptions("zerolanguage") -- else bug
@@ -582,7 +1477,7 @@ languages.logger = languages.logger or { }
function languages.logger.report()
local result, r = { }, 0
- for tag, l in sortedpairs(registered) do
+ for tag, l in sortedhash(registered) do
if l.loaded then
r = r + 1
result[r] = format("%s:%s:%s",tag,l.parent,l.number)
@@ -617,7 +1512,7 @@ end)
implement {
name = "languagenumber",
actions = { languages.getnumber, context },
- arguments = "4 strings"
+ arguments = "5 strings"
}
implement {
@@ -650,6 +1545,18 @@ implement {
}
implement {
+ name = "setlanguagepatterns",
+ actions = languages.setpatterns,
+ arguments = "2 strings"
+}
+
+implement {
+ name = "setlanguageoptions",
+ actions = languages.setoptions,
+ arguments = "2 strings"
+}
+
+implement {
name = "currentprehyphenchar",
actions = function()
local c = prehyphenchar(tolang())
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/lang-ini.mkxl
index 5df975c661f..1f4b741c292 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lang-ini.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/lang-ini.mkxl
@@ -58,9 +58,9 @@
%D \startmode[*nl] dutch \stopmode}
%D \stoptyping
-\mutable\let\askedlanguage \empty
-\mutable\let\currentlanguage \empty
-\mutable\let\currentmainlanguage\empty
+\mutable\lettonothing\askedlanguage
+\mutable\lettonothing\currentlanguage
+\mutable\lettonothing\currentmainlanguage
%D \macros
%D {defaultlanguage,languageparameter,specificlanguageparameter}
@@ -191,7 +191,7 @@
% \language[#1] gave unwanted side effect of loading language specifics
-\mutable\let\currentsetuplanguage\empty
+\mutable\lettonothing\currentsetuplanguage
\permanent\tolerant\protected\def\installlanguage[#1]#*[#2]%
{\ifcondition\validassignment{#2}%
@@ -210,7 +210,7 @@
\fi}
\def\lang_basics_install_indeed#1#2%
- {\ifcstok{\specificlanguageparameter{#1}\c!command}\v!no\orelse\ifcsname#1\endcsname\else
+ {\ifcstok{\specificlanguageparameter{#1}\c!define}\v!no\orelse\ifcsname#1\endcsname\else
\frozen\instance\protected\defcsname#1\endcsname{\lang_basics_set_current[#2]}%
\fi}
@@ -268,10 +268,13 @@
\setuplanguage
[\s!default]
[\s!patterns=,
+ \s!goodies=,
\s!lefthyphenmin=2,
\s!righthyphenmin=2,
\s!lefthyphenchar=-1,
\s!righthyphenchar=45,
+ \s!explicitlefthyphenchar=\languageparameter\s!lefthyphenchar,
+ \s!explicitrighthyphenchar=\languageparameter\s!righthyphenchar,
% used in compound i.e. interfaced with c! and can be anything so no numbers
\c!lefthyphen=,
\c!righthyphen=-,
@@ -369,16 +372,17 @@
{\currentlanguage}%
{\defaultlanguage\currentlanguage}%
{\languageparameter\s!patterns}%
+ {\languageparameter\s!goodies}%
{\languageparameter\c!factor}%
\relax
\normallanguage\csname\??languagenumbers\currentlanguage\endcsname}
\let\lang_basics_synchronize_nop\zerocount % not loaded anyway
-\letvalue{\??languagenumbers}\lang_basics_synchronize_nop % initime
+\letcsname\??languagenumbers\endcsname\lang_basics_synchronize_nop % initime
\appendtoks
- \letvalue{\??languagenumbers}\lang_basics_synchronize_yes % runtime
+ \letcsname\??languagenumbers\endcsname\lang_basics_synchronize_yes % runtime
\to \everydump
\def\lang_basics_synchronize
@@ -391,8 +395,8 @@
\the\everylanguage
\relax}
-\newcount\hyphenstate
-\newcount\hyphenminoffset
+\newinteger\hyphenstate
+\newinteger\hyphenminoffset
% This is the old implementation: a hack that sets the min values, because we want
% to keep the language set:
@@ -416,30 +420,81 @@
% \uchyph\plusone :
-% \chardef \completehyphenationmodecode \numexpr
-\permanent \integerdef \completehyphenationmodecode \numexpr
- \normalhyphenationmodecode % \discretionary
- + \automatichyphenationmodecode % -
- + \explicithyphenationmodecode % \-
- + \syllablehyphenationmodecode % pattern driven
- + \uppercasehyphenationmodecode % replaces \uchyph
- + \compoundhyphenationmodecode % replaces \compoundhyphenmode
- % \strictstarthyphenationmodecode % replaces \hyphenationbounds (strict = original tex)
- % \strictendhyphenationmodecode % replaces \hyphenationbounds (strict = original tex)
- + \automaticpenaltyhyphenationmodecode % replaces \hyphenpenaltymode (otherwise use \exhyphenpenalty)
- + \explicitpenaltyhyphenationmodecode % replaces \hyphenpenaltymode (otherwise use \exhyphenpenalty)
- + \permitgluehyphenationmodecode % turn glue into kern in \discretionary
- + \permitallhyphenationmodecode % okay, let's be even more tolerant
- + \permitmathreplacehyphenationmodecode % and again we're more permissive
+% \chardef \completehyphenationcode \numexpr
+\permanent \integerdef \completehyphenationcode \numexpr
+ \normalhyphenationcode % \discretionary
+ + \automatichyphenationcode % -
+ + \explicithyphenationcode % \-
+ + \syllablehyphenationcode % pattern driven
+ + \uppercasehyphenationcode % replaces \uchyph
+ + \compoundhyphenationcode % replaces \compoundhyphenmode
+ % \strictstarthyphenationcode % replaces \hyphenationbounds (strict = original tex)
+ % \strictendhyphenationcode % replaces \hyphenationbounds (strict = original tex)
+ + \automaticpenaltyhyphenationcode % replaces \hyphenpenaltymode (otherwise use \exhyphenpenalty)
+ + \explicitpenaltyhyphenationcode % replaces \hyphenpenaltymode (otherwise use \exhyphenpenalty)
+ + \permitgluehyphenationcode % turn glue into kern in \discretionary
+ + \permitallhyphenationcode % okay, let's be even more tolerant
+ + \permitmathreplacehyphenationcode % and again we're more permissive
+ + \forcehandlerhyphenationcode % kick in the handler (could be an option)
+ + \feedbackcompoundhyphenationcode % feedback compound snippets
+ + \ignoreboundshyphenationcode % just in case we have hyphens at the edges
+ + \collapsehyphenationcode % collapse -- and ---
\relax
-\permanent\protected\def\dohyphens{\hyphenationmode\completehyphenationmodecode}
-\permanent\protected\def\nohyphens{\hyphenationmode\zerocount}
+\permanent \integerdef \partialhyphenationcode \numexpr
+ \ignoreboundshyphenationcode % just in case we have hyphens at the edges
+% + \explicithyphenationcode % \-
+ + \collapsehyphenationcode % collapse -- and ---
+\relax
+
+\hccode"002D "002D
+
+\permanent\protected\def\keephyphensequences
+ {\hccode"2010 \zerocount
+ \hccode"2013 \zerocount
+ \hccode"2014 \zerocount}
+
+\permanent\protected\def\collapsehyphensequences
+ {\hccode"2010 "2010\relax
+ \hccode"2013 "2013\relax
+ \hccode"2014 "2014\relax}
+
+\collapsehyphensequences
+
+% maybe a (un)setter for handlers
+
+\permanent\protected\def\dohyphens {\hyphenationmode\completehyphenationcode}
+\permanent\protected\def\nohyphens {\hyphenationmode\partialhyphenationcode}
+
+% \permanent\protected\def\dohyphens
+% {\ifbitwiseand\hyphenationmode\collapsehyphenationcode
+% \hyphenationmode\completehyphenationcode
+% \else
+% \hyphenationmode\numexpr\completehyphenationcode-\collapsehyphenationcode\relax
+% \fi}
+
+% \permanent\protected\def\nohyphens
+% {\ifbitwiseand\hyphenationmode\collapsehyphenationcode
+% \hyphenationmode\partialhyphenationcode
+% \else
+% \hyphenationmode\numexpr\partialhyphenationcode-\collapsehyphenationcode\relax
+% \fi}
+
+\permanent\protected\def\dohyphencollapsing{\hyphenationmode\bitwiseflip\hyphenationmode \collapsehyphenationcode}
+\permanent\protected\def\nohyphencollapsing{\hyphenationmode\bitwiseflip\hyphenationmode-\collapsehyphenationcode}
+
+\permanent\protected\def\doexplicithyphens{\hyphenationmode\bitwiseflip\hyphenationmode \explicithyphenationcode}
+\permanent\protected\def\noexplicithyphens{\hyphenationmode\bitwiseflip\hyphenationmode-\explicithyphenationcode}
\permanent\protected\def\usehyphensparameter#1%
{\edef\p_hyphens{#1\c!hyphens}%
- \ifx\p_hyhens\v!no
- \nohyphens
+ \ifx\p_hyphens\v!no
+ \ifbitwiseand\hyphenationmode\collapsehyphenationcode
+ \nohyphens
+ \else
+ \nohyphens
+ \nohyphencollapsing
+ \fi
\fi}
\dohyphens
@@ -447,26 +502,37 @@
%D The rest stays the same as in mkiv:
\permanent\protected\def\lesshyphens
- {\advance\hyphenminoffset\plusone
+ {\advanceby\hyphenminoffset\plusone
\lang_basics_synchronize_min_max}
\permanent\protected\def\morehyphens
{\ifcase\hyphenminoffset \else
- \advance\hyphenminoffset\minusone
+ \advanceby\hyphenminoffset\minusone
\fi
\lang_basics_synchronize_min_max}
+% \protected\def\lang_basics_synchronize_min_max % maybe store this at the lua end
+% {% these values are stored along with glyph nodes
+% \lefthyphenmin \numexpr0\languageparameter\s!lefthyphenmin +\hyphenminoffset\relax
+% \righthyphenmin\numexpr0\languageparameter\s!righthyphenmin+\hyphenminoffset\relax
+% \hyphenationmin\numexpr0\languageparameter\s!hyphenmin\relax
+% % these values are stored with the language (global!)
+% \prehyphenchar \languageparameter\s!righthyphenchar\relax
+% \posthyphenchar\languageparameter\s!lefthyphenchar \relax}
+
\protected\def\lang_basics_synchronize_min_max % maybe store this at the lua end
{% these values are stored along with glyph nodes
\lefthyphenmin \numexpr0\languageparameter\s!lefthyphenmin +\hyphenminoffset\relax
\righthyphenmin\numexpr0\languageparameter\s!righthyphenmin+\hyphenminoffset\relax
\hyphenationmin\numexpr0\languageparameter\s!hyphenmin\relax
% these values are stored with the language (global!)
- \prehyphenchar \languageparameter\s!righthyphenchar\relax
- \posthyphenchar\languageparameter\s!lefthyphenchar \relax}
+ \prehyphenchar \languageparameter\s!righthyphenchar\relax
+ \posthyphenchar \languageparameter\s!lefthyphenchar \relax
+ \preexhyphenchar \languageparameter\s!explicitrighthyphenchar\relax
+ \postexhyphenchar\languageparameter\s!explicitlefthyphenchar \relax}
\appendtoks
- \lang_basics_synchronize_min_max
+ \lang_basics_synchronize_min_max % todo: also sync when already in language
\to \everylanguage
\permanent\protected\def\unhyphenated
@@ -478,7 +544,7 @@
%D You can setup the default language to reset settings.
-\mutable\let\currentlanguagesetups\empty
+\mutable\lettonothing\currentlanguagesetups
\appendtoks
\edef\currentlanguagesetups{\languageparameter\c!setups}%
@@ -562,7 +628,7 @@
\popoverloadmode
-\newcount\mainlanguagenumber
+\newinteger\mainlanguagenumber
%D Beware: you might need to use \type {\dontleavehmode} outside and|/|or \type {\par}
%D inside the group!
@@ -734,10 +800,22 @@
\clf_setlanguageexceptions{\askedlanguage}{#2}%
\endgroup}
+\permanent\let\stoppatterns\relax
+
+\tolerant\permanent\protected\def\startpatterns[#1]#:#2\stoppatterns
+ {\begingroup
+ \edef\askedlanguage{\reallanguagetag{#1}}%
+ \ifempty\askedlanguage
+ \let\askedlanguage\currentlanguage
+ \fi
+ \clf_setlanguagepatterns{\askedlanguage}{#2}%
+ \endgroup}
+
+
\pushoverloadmode
-\permanent\protected\def\hyphenation
- {\clf_setlanguageexceptions{\currentlanguage}}
+\permanent\protected\def\hyphenation{\clf_setlanguageexceptions{\currentlanguage}}
+\permanent\protected\def\patterns {\clf_setlanguagepatterns {\currentlanguage}}
\popoverloadmode
@@ -749,10 +827,14 @@
\protected\def\lang_basics_traced_discretionary#1#2#3#4%
{\normaldiscretionary#1{\darkred#2}{\darkgreen#3}{\darkblue#4}}
+\def\lang_basics_trace_discretionary_yes{\enforced\let\discretionary\traceddiscretionary} % indirect because of overload
+\def\lang_basics_trace_discretionary_nop{\enforced\let\discretionary\normaldiscretionary} % indirect because of overload
+
+
\installtextracker
{discretionaries}
- {\enforced\let\discretionary\traceddiscretionary}
- {\enforced\let\discretionary\normaldiscretionary}
+ {\lang_basics_trace_discretionary_yes}
+ {\lang_basics_trace_discretionary_nop}
\permanent\protected\def\samplediscretionary
{\traceddiscretionary
@@ -773,15 +855,56 @@
%D {ef{\norightligaturing f}icient ff fi}\par
%D \stoptyping
-\immutable\chardef\nokerningcode \numexpr\noleftkerncode +\norightkerncode \relax
-\immutable\chardef\noligaturingcode\numexpr\noleftligaturecode+\norightligaturecode\relax
+\immutable\chardef\nokerningcode \numexpr\noleftkernglyphoptioncode +\norightkernglyphoptioncode \relax
+\immutable\chardef\noligaturingcode\numexpr\noleftligatureglyphoptioncode+\norightligatureglyphoptioncode\relax
\permanent\protected\def\nokerning {\bitwiseflip\glyphoptions\nokerningcode}
\permanent\protected\def\noligaturing{\bitwiseflip\glyphoptions\noligaturingcode}
-\permanent\protected\def\noleftkerning {\bitwiseflip\glyphoptions\noleftkerncode}
-\permanent\protected\def\noleftligaturing {\bitwiseflip\glyphoptions\noleftligaturecode}
-\permanent\protected\def\norightkerning {\bitwiseflip\glyphoptions\norightkerncode}
-\permanent\protected\def\norightligaturing{\bitwiseflip\glyphoptions\norightligaturecode}
+\permanent\protected\def\noleftkerning {\bitwiseflip\glyphoptions\noleftkernglyphoptioncode}
+\permanent\protected\def\noleftligaturing {\bitwiseflip\glyphoptions\noleftligatureglyphoptioncode}
+\permanent\protected\def\norightkerning {\bitwiseflip\glyphoptions\norightkernglyphoptioncode}
+\permanent\protected\def\norightligaturing{\bitwiseflip\glyphoptions\norightligatureglyphoptioncode}
+
+% This is not really language related but let's define it here:
+
+\permanent\protected\def\noitaliccorrection{\bitwiseflip\glyphoptions\noitaliccorrectionglyphoptioncode}
+
+%D Also \LMTX:
+
+% \startlanguageoptions[de]
+% Zapf|innovation
+% \stoplanguageoptions
+
+\permanent\let\stoplanguageoptions\relax
+
+\permanent\protected\def\startlanguageoptions
+ {\begingroup
+ \catcode`|\othercatcode
+ \lang_startlanguageoptions}
+
+\tolerant\def\lang_startlanguageoptions[#1]#:#2\stoplanguageoptions
+ {\edef\askedlanguage{\reallanguagetag{#1}}%
+ \ifempty\askedlanguage
+ \let\askedlanguage\currentlanguage
+ \fi
+ \clf_setlanguageoptions{\askedlanguage}{#2}%
+ \endgroup}
+
+% \startluacode
+% table.save("oeps-fixes.llg", {
+% name = "demo",
+% options = {
+% { patterns = { fio = "f|io" }, words = [[ fioot fiots ]] },
+% { patterns = { fio = "t|h" }, words = [[ this that ]] },
+% },
+% })
+% \stopluacode
+%
+% \setuplanguage[en][goodies={oeps-fixes.llg}] \setupbodyfont[ebgaramond]
+%
+% \starttext
+% fiets fiots fiats fioot this that
+% \stoptext
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-lab.lmt b/Master/texmf-dist/tex/context/base/mkxl/lang-lab.lmt
new file mode 100644
index 00000000000..b82721b7656
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/lang-lab.lmt
@@ -0,0 +1,195 @@
+if not modules then modules = { } end modules ['lang-lab'] = {
+ version = 1.001,
+ comment = "companion to lang-lab.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local format, find = string.format, string.find
+local next, rawget, type = next, rawget, type
+local lpegmatch = lpeg.match
+local formatters = string.formatters
+
+local prtcatcodes = catcodes.numbers.prtcatcodes -- todo: use different method
+
+local trace_labels = false trackers.register("languages.labels", function(v) trace_labels = v end)
+local report_labels = logs.reporter("languages","labels")
+
+languages.labels = languages.labels or { }
+local labels = languages.labels
+
+local context = context
+local implement = interfaces.implement
+
+local variables = interfaces.variables
+local settings_to_array = utilities.parsers.settings_to_array
+
+local splitter = lpeg.splitat(":")
+
+local function split(tag)
+ return lpegmatch(splitter,tag)
+end
+
+labels.split = split
+
+-- We don't store labels at the \LUA\ end because we want to obey grouping. Otherwise we
+-- would need to start using tables that relate to the group level.
+
+local contextsprint = context.sprint
+
+local f_setlabeltextpair = formatters["\\setlabeltextpair{%s}{%s}{%s}{%s}{%s}"]
+local f_key_key = formatters["\\v!%s:\\v!%s"]
+local f_key_raw = formatters["\\v!%s:%s"]
+local f_raw_key = formatters["%s:\\v!%s"]
+local f_raw_raw = formatters["%s:%s"]
+local f_key = formatters["\\v!%s"]
+local f_raw = formatters["%s"]
+
+local function definelanguagelabels(data,class,tag,rawtag)
+ for language, text in next, data.labels do
+ if text == "" then
+ -- skip
+ elseif type(text) == "table" then
+ contextsprint(prtcatcodes,f_setlabeltextpair(class,language,tag,text[1],text[2]))
+ if trace_labels then
+ report_labels("language %a, defining label %a as %a and %a",language,rawtag,text[1],text[2])
+ end
+ else
+ contextsprint(prtcatcodes,f_setlabeltextpair(class,language,tag,text,""))
+ if trace_labels then
+ report_labels("language %a, defining label %a as %a",language,rawtag,text)
+ end
+ end
+ end
+end
+
+-- local function definelanguagelabels(data,class,tag,rawtag)
+-- local setlabeltextopair = context.setlabeltextpair
+-- context.pushcatcodes("prt")
+-- for language, text in next, data.labels do
+-- if text == "" then
+-- -- skip
+-- elseif type(text) == "table" then
+-- setlabeltextopair(class,language,tag,text[1],text[2])
+-- if trace_labels then
+-- report_labels("language %a, defining label %a as %a and %a",language,rawtag,text[1],text[2])
+-- end
+-- else
+-- setlabeltextopair(class,language,tag,text,"")
+-- if trace_labels then
+-- report_labels("language %a, defining label %a as %a",language,rawtag,text)
+-- end
+-- end
+-- end
+-- context.popcatcodes()
+-- end
+
+function labels.define(class,name,prefixed)
+ local list = languages.data.labels[name]
+ if list then
+ report_labels("defining label set %a",name)
+ for tag, data in next, list do
+ tag = variables[tag] or tag
+ if data.hidden then
+ -- skip
+ elseif prefixed then
+ local first, second = lpegmatch(splitter,tag)
+ if second then
+ if rawget(variables,first) then
+ if rawget(variables,second) then
+ definelanguagelabels(data,class,f_key_key(first,second),tag)
+ else
+ definelanguagelabels(data,class,f_key_raw(first,second),tag)
+ end
+ elseif rawget(variables,second) then
+ definelanguagelabels(data,class,f_raw_key(first,second),tag)
+ else
+ definelanguagelabels(data,class,f_raw_raw(first,second),tag)
+ end
+ elseif rawget(variables,rawtag) then
+ definelanguagelabels(data,class,f_key(tag),tag)
+ else
+ definelanguagelabels(data,class,tag,tag)
+ end
+ else
+ definelanguagelabels(data,class,tag,tag)
+ end
+ end
+ else
+ report_labels("unknown label set %a",name)
+ end
+end
+
+-- function labels.check()
+-- for category, list in next, languages.data.labels do
+-- for tag, specification in next, list do
+-- for language, text in next, specification.labels do
+-- if type(text) == "string" and find(text,",") then
+-- report_labels("warning: label with comma found, category %a, language %a, tag %a, text %a",
+-- category, language, tag, text)
+-- end
+-- end
+-- end
+-- end
+-- end
+--
+-- labels.check()
+
+-- interface
+
+interfaces.implement {
+ name = "definelabels",
+ actions = labels.define,
+ arguments = { "string", "string", "boolean" }
+}
+
+-- function commands.setstrippedtextprefix(str)
+-- context(string.strip(str))
+-- end
+
+-- list : { "a", "b", "c" }
+-- separator : ", "
+-- last : " and "
+
+-- text : "a,b,c"
+-- separators : "{, },{ and }"
+
+local function concatcommalist(settings) -- it's too easy to forget that this one is there
+ local list = settings.list or settings_to_array(settings.text or "")
+ local size = #list
+ local command = settings.command and context[settings.command] or context
+ if size > 1 then
+ local separator, last = " ", " "
+ if settings.separators then
+ local set = settings_to_array(settings.separators)
+ separator = set[1] or settings.separator or separator
+ last = set[2] or settings.last or last
+ else
+ separator = settings.separator or separator
+ last = settings.last or last
+ end
+ command(list[1])
+ for i=2,size-1 do
+ context(separator)
+ command(list[i])
+ end
+ context(last)
+ end
+ if size > 0 then
+ command(list[size])
+ end
+end
+
+implement {
+ name = "concatcommalist",
+ actions = concatcommalist,
+ arguments = {
+ {
+ { "text" },
+ { "separators" },
+ { "separator" },
+ { "last" },
+ }
+ }
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-lab.mkxl b/Master/texmf-dist/tex/context/base/mkxl/lang-lab.mkxl
index 369049ed162..a1d758f0979 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lang-lab.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/lang-lab.mkxl
@@ -13,7 +13,7 @@
\writestatus{loading}{ConTeXt Language Macros / Labels}
-\registerctxluafile{lang-lab}{}
+\registerctxluafile{lang-lab}{autosuffix}
\registerctxluafile{lang-txt}{}
\unprotect
@@ -21,7 +21,7 @@
%D Left-overs:
\ifdefined\sixperemspace \else
- \permanent\def\sixperemspace{\normalUchar"2006}
+ \permanent\edef\sixperemspace{\normalUchar"2006}
\fi
%D In this module we deal with language dependant labels and prefixes, like in {\em
@@ -60,7 +60,7 @@
\installcorenamespace{label}
-% \let\currentlabelcategory\empty
+% \lettonothing\currentlabelcategory
\permanent\tolerant\protected\def\definelabelclass[#1]#*[#2]%
{\normalexpanded
@@ -77,17 +77,18 @@
% hm, not interfaced
-\mutable\let\thetextprefix\empty
+\mutable\lettonothing\thetextprefix
\mutable\let\currenttextprefixclass\s!unknown
-\mutable\let\currenttextprefixname \empty
\mutable\let\currenttextprefixtag \s!unknown
+\mutable\lettonothing\currenttextprefixname
+
\protected\def\lang_labels_define_class_indeed#1#2#3#4#5#6#7#8#9%
- {\permanent\instance\protected\defcsname setup#1text\endcsname{\protecttextprefixes#2\def\currenttextprefixclass{#1}\lang_labels_text_prefix_setup}%
- \permanent\instance\protected\defcsname preset#1text\endcsname{\protecttextprefixes 1\def\currenttextprefixclass{#1}\lang_labels_text_prefix_setup}%
- \permanent\instance\protected\defcsname copy#1text\endcsname{\protecttextprefixes 1\def\currenttextprefixclass{#1}\lang_labels_text_prefix_copy }%
- \permanent\instance\protected\defcsname start#1text\endcsname{\protecttextprefixes 1\def\currenttextprefixclass{#1}\lang_labels_text_prefix_start[#1]}%
+ {\permanent\instance\protected\defcsname setup#1text\endcsname{\protecttextprefixes #2\def\currenttextprefixclass{#1}\lang_labels_text_prefix_setup}%
+ \permanent\instance\protected\defcsname preset#1text\endcsname{\protecttextprefixes\plusone\def\currenttextprefixclass{#1}\lang_labels_text_prefix_setup}%
+ \permanent\instance\protected\defcsname copy#1text\endcsname{\protecttextprefixes\plusone\def\currenttextprefixclass{#1}\lang_labels_text_prefix_copy }%
+ \permanent\instance\protected\defcsname start#1text\endcsname{\protecttextprefixes\plusone\def\currenttextprefixclass{#1}\lang_labels_text_prefix_start[#1]}%
\permanent\instance \letcsname stop#1text\endcsname \relax
\permanent\instance\def#4{\reallanguagetag{\defaultlanguage\currentmainlanguage}}%
\ifnum#2=\plustwo % used for math and tags
@@ -223,8 +224,8 @@
\expandafter\lang_labels_text_prefix_assign_dumb
\fi{#1}}
-\let\m_lang_labels_left \empty
-\let\m_lang_labels_right\empty
+\lettonothing\m_lang_labels_left
+\lettonothing\m_lang_labels_right
\def\lang_labels_text_prefix_assign_yes#1[#2,#3,#4]%
{\def\m_lang_labels_left {#2}% no longer an edef ... else \Word undefined expansion issues
@@ -278,7 +279,7 @@
\definelabelclass [head] [0] % titles
\definelabelclass [label] [0] % texts
-\definelabelclass [mathlabel] [0] % functions
+\definelabelclass [mathlabel] [2] % functions
\definelabelclass [taglabel] [2] % tags
\clf_definelabels{head}{titles}\s!true\relax
@@ -365,10 +366,10 @@
last {\detokenize\expandafter{\normalexpanded{\labeltext{and-2}}}}%
\relax}
-\setuplabeltext [\s!nl] [and-1={{, }}, and-2={{ en }}] % 1, 2 en 3
-\setuplabeltext [\s!en] [and-1={{, }}, and-2={{, }}] % 1, 2, 3
-\setuplabeltext [\s!de] [and-1={{, }}, and-2={{ und }}] % 1, 2 und 3
-\setuplabeltext [\s!hr] [and-1={{, }}, and-2={{ i }}] % 1, 2 i 3
+\setuplabeltext [\s!nl] [and-1={{, }},and-2={{ en }}] % 1, 2 en 3
+\setuplabeltext [\s!en] [and-1={{, }},and-2={{, }}] % 1, 2, 3
+\setuplabeltext [\s!de] [and-1={{, }},and-2={{ und }}] % 1, 2 und 3
+\setuplabeltext [\s!hr] [and-1={{, }},and-2={{ i }}] % 1, 2 i 3
%D Goodie (handy at \LUA\ end):
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-mis.mkxl b/Master/texmf-dist/tex/context/base/mkxl/lang-mis.mkxl
index 7b6c9085736..374379a0b3f 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lang-mis.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/lang-mis.mkxl
@@ -119,27 +119,10 @@
%D \installdiscretionary | -
%D \stoptyping
%D
-%D Some alternative definitions are:
-%D
-%D \startbuffer
-%D \installdiscretionary * -
-%D \installdiscretionary + -
-%D \installdiscretionary / -
-%D \installdiscretionary ~ -
-%D \stopbuffer
-%D
-%D \typebuffer
-%D
-%D after which we can say:
-%D
-%D \start \getbuffer
-%D \starttest
-%D \test {test**test**test}
-%D \test {test++test++test}
-%D \test {test//test//test}
-%D \test {test~~test~~test}
-%D \stoptest
-%D \stop
+%D We used to have an installable mechanism but in the perspective of \MKIV\ and
+%D especialy \LMTX\ it no longer makes sense to complicate the code, so from now on
+%D we only deal with the active bar. Older code can be seen in the archives. It also
+%D means that we now just hardcode the bar. We also deal with math differently.
%D \macros
%D {compoundhyphen}
@@ -163,7 +146,6 @@
\ifdefined\postwordbreak\else \permanent\protected\def\postwordbreak {\penalty\zerocount \hskip\zeropoint\relax} \fi
\ifdefined\hspaceamount \else \def\hspaceamount#1#2{.16667\emwidth} \fi % will be overloaded
-%frozen\protected\def\permithyphenation{\ifhmode\prewordbreak\fi} % doesn't remove spaces
\permanent\protected\def\permithyphenation{\ifhmode\wordboundary\fi} % doesn't remove spaces
%D \macros
@@ -173,7 +155,7 @@
%D In the previous macros we provided two hooks which can be used to support nested
%D sub||sentences. In \CONTEXT\ these hooks are used to insert a small space when
%D needed.
-
+%D
%D The following piece of code is a torture test compound handling. The \type
%D {\relax} before the \type {\ifmmode} is needed because of the alignment scanner
%D (in \ETEX\ this problem is not present because there a protected macro is not
@@ -186,22 +168,10 @@
%D \stopformula
\installcorenamespace{discretionaryaction}
-\installcorenamespace{discretionarytext}
-\installcorenamespace{discretionarymath}
-\installcorenamespace{discretionaryboth}
\installcorenamespace{discretionarymode}
-\permanent\protected\def\installdiscretionary#1#2%
- {\edefcsname\??discretionarymath\detokenize{#1}\endcsname{\detokenize{#1}}% ?
- \defcsname \??discretionarytext\detokenize{#1}\endcsname{#2}%
- \defcsname \??discretionaryboth\detokenize{#1}\endcsname{\lang_discretionaries_command#1}%
- \scratchcounter\expandafter`\detokenize{#1}%
- \expandafter\uedcatcodecommand\expandafter\ctxcatcodes\expandafter\scratchcounter\csname\??discretionaryboth\detokenize{#1}\endcsname}
-
-\permanent\protected\def\handlemathmodediscretionary#1{\ifcsname\??discretionarymath\detokenize{#1}\endcsname\lastnamedcs}
-\permanent\protected\def\handletextmodediscretionary#1{\ifcsname\??discretionarytext\detokenize{#1}\endcsname\lastnamedcs}
-
-\permanent\protected\def\installdiscretionaries#1#2{\writestatus\m!system{use \string \installdiscretionary}} % obsolete
+\aliased\let\installdiscretionaries\gobbletwoarguments % this alias will go
+\aliased\let\installdiscretionary \gobbletwoarguments % this alias will go
\setnewconstant\discretionarymode\plusone
@@ -209,25 +179,22 @@
\permanent\protected\def\obeydiscretionaries {\discretionarymode\plusone}
\def\lang_discretionaries_command
- {% if direct if, we need \relax for lookahead in math mode
- \csname\??discretionarymode
+ {\begincsname\??discretionarymode
\ifcase\discretionarymode
n%
- \orelse\ifmmode
- m%
\else
t%
\fi
\endcsname}
-\setvalue{\??discretionarymode n}#1%
- {\detokenize{#1}}
+% \catcode\barasciicode\activecatcode
+% \amcode \barasciicode\othercatcode
-%D The macro \type{\lang_discretionaries_check_before} takes care of loners like
-%D \type{||word}, while it counterpart \type {\lang_discretionaries_check_after} is
-%D responsible for handling the comma.
+\letcatcodecommand\ctxcatcodes\barasciicode\lang_discretionaries_command
-\newsignal\d_lang_discretionaries_breakpoint % todo: never consulted so maybe obsolete
+%D The macro \type {\lang_discretionaries_check_before} takes care of loners like
+%D \type {||word}, while it counterpart \type {\lang_discretionaries_check_after} is
+%D responsible for handling the comma.
\newconditional\punctafterdiscretionary
\newconditional\spaceafterdiscretionary
@@ -259,73 +226,58 @@
\ifx :\nexttoken \settrue \punctafterdiscretionary \orelse
\ifx ;\nexttoken \settrue \punctafterdiscretionary \fi}
-\letvalue{\??discretionarymode m}\handlemathmodediscretionary
+\edefcsname\??discretionarymode n\endcsname
+ {\detokenize{|}}
-\setvalue{\??discretionarymode t}#1%
+\defcsname\??discretionarymode t\endcsname#1|%
{\bgroup
- \let\nextnextnext\egroup
- \def\next##1#1%
- {\def\next{\activedododotextmodediscretionary#1{##1}}%
- \futurelet\nexttoken\next}%
- \next}
+ \def\next{\lang_discretionaries_handle{#1}}%
+ \futurelet\nexttoken\next}%
-\let\lang_discretionaries_token \relax
-\let\lang_discretionaries_action\relax
-
-\permanent\protected\def\activedododotextmodediscretionary#1#2%
- {\edef\lang_discretionaries_token{\detokenize{#2}}%
- \def\lang_discretionaries_action{\handletextmodediscretionary{#1}}%
+\permanent\protected\def\lang_discretionaries_handle#1%
+ {\edef\lang_discretionaries_token{\detokenize{#1}}%
\lang_discretionaries_check_after
\ifempty\lang_discretionaries_token
- \ifx#1\nexttoken % takes care of ||| and +++ and ......
- \ifcsname\??discretionaryaction\string#1\endcsname
+ \ifx|\nexttoken % takes care of |||
+ \ifcsname\??discretionaryaction\string|\endcsname
\lastnamedcs
\orelse\ifconditional\spaceafterdiscretionary
- %\prewordbreak\hbox{\string#1}\relax
- \wordboundary\hbox{\string#1}\relax
+ \wordboundary\hbox{\letterbar}\relax
\orelse\ifconditional\punctafterdiscretionary
- %\prewordbreak\hbox{\string#1}\relax
- \wordboundary\hbox{\string#1}\wordboundary
+ \wordboundary\hbox{\letterbar}\wordboundary
\else
- %\prewordbreak\hbox{\string#1}\prewordbreak
- \wordboundary\hbox{\string#1}\wordboundary
+ \wordboundary\hbox{\letterbar}\wordboundary
\fi
- \def\nextnextnext{\afterassignment\egroup\let\next=}%
+ \def\next{\afterassignment\egroup\let\next=}%
\else
\lang_discretionaries_check_before
- % the next line has been changed (20050203)
- % \prewordbreak\hbox{\lang_discretionaries_action\nexttoken}\postwordbreak
- % but an hbox blocks a possible \discretionary
\ifcsname\??discretionaryaction\endcsname
\lastnamedcs
\orelse\ifconditional\spaceafterdiscretionary
- %\prewordbreak\lang_discretionaries_action\relax
- \wordboundary\lang_discretionaries_action\relax
+ \wordboundary\defaultdiscretionaryhyphen\relax
\orelse\ifconditional\punctafterdiscretionary
- %\prewordbreak\lang_discretionaries_action\relax
- \wordboundary\lang_discretionaries_action\relax
+ \wordboundary\defaultdiscretionaryhyphen\relax
\else
- %\prewordbreak\lang_discretionaries_action\prewordbreak
- \wordboundary\lang_discretionaries_action\wordboundary
+ \wordboundary\defaultdiscretionaryhyphen\wordboundary
\fi
+ \let\next\egroup
\fi
\orelse\ifcsname\??discretionaryaction\lang_discretionaries_token\endcsname
\lastnamedcs
+ \let\next\egroup
\else
\lang_discretionaries_check_before
\ifconditional\spaceafterdiscretionary
- %\prewordbreak\hbox{#2}\relax
- \wordboundary\hbox{#2}\relax
+ \wordboundary\hbox{#1}\relax
\orelse\ifconditional\punctafterdiscretionary
- %\prewordbreak\hbox{#2}\relax
- \wordboundary\hbox{#2}\relax
+ \wordboundary\hbox{#1}\relax
\else
- %\prewordbreak\discretionary{\hbox{#2}}{}{\hbox{#2}}\postwordbreak
- \wordboundary\discretionary{\hbox{#2}}{}{\hbox{#2}}\wordboundary
- %\discretionary options \plusthree{\hbox{#2}}{}{\hbox{#2}}%
+ \wordboundary\discretionary{\hbox{#1}}{}{\hbox{#1}}\wordboundary
+ %\discretionary options \plusthree{\hbox{#1}}{}{\hbox{#1}}%
\fi
+ \let\next\egroup
\fi
- \nextnextnext}
+ \next}
%D \macros
%D {directdiscretionary}
@@ -334,7 +286,7 @@
%D use the more direct approach:
\permanent\protected\def\directdiscretionary
- {\csname\??discretionarymode
+ {\begincsname\??discretionarymode
\ifcase\discretionarymode
n%
\else
@@ -343,7 +295,7 @@
\endcsname}
\permanent\protected\def\indirectdiscretionary
- {\csname\??discretionarymode
+ {\begincsname\??discretionarymode
\ifcase\discretionarymode
n%
\else
@@ -351,17 +303,14 @@
\fi
\endcsname}
-\setuvalue{\??discretionarymode d}#1%
- {\edef\lang_discretionaries_token{\detokenize{#1}}%
- \let\lang_discretionaries_action\compoundhyphen
- \ifcsname\??discretionaryaction\lang_discretionaries_token\endcsname
+\protected\defcsname\??discretionarymode d\endcsname#1%
+ {\ifcsname\??discretionaryaction\detokenize{#1}\endcsname
\expandafter\lastnamedcs
\else
\expandafter\indirectdiscretionary
\fi{#1}}
-\setuvalue{\??discretionarymode i}#1%
- %{\prewordbreak\discretionary{\hbox{#1}}{}{\hbox{#1}}\postwordbreak}
+\protected\defcsname\??discretionarymode i\endcsname#1%
{\wordboundary\discretionary{\hbox{#1}}{}{\hbox{#1}}\wordboundary}
%{\discretionary options \plusthree{\hbox{#1}}{}{\hbox{#1}}}
@@ -387,13 +336,10 @@
\def\lang_discretionaries_hyphen_like#1#2%
{\ifconditional\spaceafterdiscretionary
- %prewordbreak\hbox{#1}\relax
\wordboundary\hbox{#1}\relax
\orelse\ifconditional\punctafterdiscretionary
- %prewordbreak\hbox{#1}\relax
\wordboundary\hbox{#1}\relax
\else
- %\prewordbreak#2\postwordbreak % was prewordbreak
\wordboundary#2\wordboundary
\fi}
@@ -411,78 +357,55 @@
\definetextmodediscretionary (
{\ifdim\lastskip>\zeropoint
- %(\prewordbreak
(\wordboundary
\else
- %\prewordbreak\discretionary{}{(-}{(}\prewordbreak
\wordboundary\discretionary{}{(-}{(}\wordboundary
%\discretionary options \plusthree{}{(-}{(}%
\fi}
\definetextmodediscretionary ~
- %{\prewordbreak\discretionary{-}{}{\thinspace}\postwordbreak}
{\wordboundary\discretionary{-}{}{\thinspace}\wordboundary}
%{\discretionary options \plusthree{-}{}{\thinspace}}
\definetextmodediscretionary '
- %{\prewordbreak\discretionary{-}{}{'}\postwordbreak}
{\wordboundary\discretionary{-}{}{'}\wordboundary}
%{\discretionary options \plusthree{-}{}{'}}
\definetextmodediscretionary ^
- %{\prewordbreak\discretionary{\hbox{\normalstartimath|\normalstopimath}}{}{\hbox{\normalstartimath|\normalstopimath}}%
- % \postwordbreak} % bugged
{\wordboundary
\discretionary{\hbox{\normalstartimath|\normalstopimath}}{}{\hbox{\normalstartimath|\normalstopimath}}%
\wordboundary} % bugged
%{\discretionary options \plusthree{\hbox{\normalstartimath|\normalstopimath}}{}{\hbox{\normalstartimath|\normalstopimath}}}
\definetextmodediscretionary <
- %{\beginofsubsentence\prewordbreak\beginofsubsentencespacing
{\beginofsubsentence\wordboundary\beginofsubsentencespacing
\aftergroup\ignorespaces} % tricky, we need to go over the \nextnextnext
\definetextmodediscretionary >
{\removeunwantedspaces
- %\endofsubsentencespacing\prewordbreak\endofsubsentence}
\endofsubsentencespacing\wordboundary\endofsubsentence}
\definetextmodediscretionary =
{\removeunwantedspaces
- %\prewordbreak\midsentence\prewordbreak
\wordboundary\midsentence\wordboundary
\aftergroup\ignorespaces}
% french
-%definetextmodediscretionary : {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{:}:}
-%definetextmodediscretionary ; {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{;};}
-%definetextmodediscretionary ? {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{?}?}
-%definetextmodediscretionary ! {\removeunwantedspaces\prewordbreak\kern\hspaceamount\empty{!}!}
-
\definetextmodediscretionary : {\removeunwantedspaces\wordboundary\kern\hspaceamount\empty{:}:}
\definetextmodediscretionary ; {\removeunwantedspaces\wordboundary\kern\hspaceamount\empty{;};}
\definetextmodediscretionary ? {\removeunwantedspaces\wordboundary\kern\hspaceamount\empty{?}?}
\definetextmodediscretionary ! {\removeunwantedspaces\wordboundary\kern\hspaceamount\empty{!}!}
-%definetextmodediscretionary * {\prewordbreak\discretionary{-}{}{\kern.05\emwidth}\prewordbreak}
\definetextmodediscretionary * {\wordboundary\discretionary{-}{}{\kern.05\emwidth}\wordboundary}
% spanish
-%definetextmodediscretionary ?? {\prewordbreak\questiondown}
-%definetextmodediscretionary !! {\prewordbreak\exclamdown}
-
\definetextmodediscretionary ?? {\wordboundary\questiondown}
\definetextmodediscretionary !! {\wordboundary\exclamdown}
-%D \installdiscretionary | +
-%D \installdiscretionary + =
-
\permanent\protected\def\defaultdiscretionaryhyphen{\compoundhyphen}
-\installdiscretionary | \defaultdiscretionaryhyphen % installs in ctx and prt will fall back on it
-
%D \macros
%D {fakecompoundhyphen}
%D
@@ -500,7 +423,7 @@
\def\lang_compounds_fake_hyphen
{\enforced\permanent\protected\def##1|%
{\doifelsenothing{##1}\compoundhyphen{##1}%
- \kern\d_lang_discretionaries_breakpoint
+ \wordboundary % was a signal
\allowbreak}}
%D \macros
@@ -549,9 +472,9 @@
%D so test\compound{}test can be used instead of test||test
%D \stoptyping
-\bgroup
-
- \catcode\barasciicode\activecatcode
+% \bgroup
+%
+% \catcode\barasciicode\activecatcode
\permanent\protected\gdef\compound#1{|#1|}
@@ -559,7 +482,7 @@
\enforced\permanent\protected\def|#1|{\ifx#1\empty\empty-\else#1\fi}%
\to \everysimplifycommands
-\egroup
+% \egroup
%D Here we hook some code into the clean up mechanism needed for verbatim data.
@@ -583,4 +506,6 @@
{\ifnum\posthyphenchar>\zerocount\char\posthyphenchar\fi}%
{\ifnum\posthyphenchar>\zerocount\char\posthyphenchar\fi}}
+% \setcatcodetable\prtcatcodes % because we activated the bar
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-rep.lmt b/Master/texmf-dist/tex/context/base/mkxl/lang-rep.lmt
new file mode 100644
index 00000000000..fcaff523a35
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/lang-rep.lmt
@@ -0,0 +1,467 @@
+if not modules then modules = { } end modules ['lang-rep'] = {
+ version = 1.001,
+ comment = "companion to lang-rep.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- A BachoTeX 2013 experiment, probably not that useful. Eventually I used a simpler
+-- more generic example. I'm sure no one ever notices of even needs this code.
+--
+-- As a follow up on a question by Alan about special treatment of dropped caps I wonder
+-- if I can make this one more clever (probably in a few more dev steps). For instance
+-- injecting nodes or replacing nodes. It's a prelude to a kind of lpeg for nodes,
+-- although (given experiences so far) we don't really need that. After all, each problem
+-- is somewhat unique.
+
+local type, tonumber, next = type, tonumber, next
+local gmatch, gsub = string.gmatch, string.gsub
+local utfbyte, utfsplit = utf.byte, utf.split
+local P, C, U, Cc, Ct, Cs, lpegmatch = lpeg.P, lpeg.C, lpeg.patterns.utf8character, lpeg.Cc, lpeg.Ct, lpeg.Cs, lpeg.match
+local find = string.find
+
+local zwnj = 0x200C
+local grouped = P("{") * ( Ct((U/utfbyte-P("}"))^1) + Cc(false) ) * P("}")-- grouped
+local splitter = Ct((
+ #P("{") * (
+ P("{}") / function() return zwnj end
+ + Ct(Cc("discretionary") * grouped * grouped * grouped)
+ + Ct(Cc("noligature") * grouped)
+ )
+ + U/utfbyte
+ )^1)
+
+local stripper = P("{") * Cs((1-P(-2))^0) * P("}") * P(-1)
+
+local trace_replacements = false trackers.register("languages.replacements", function(v) trace_replacements = v end)
+local trace_details = false trackers.register("languages.replacements.details", function(v) trace_details = v end)
+
+local report_replacement = logs.reporter("languages","replacements")
+
+local glyph_code = nodes.nodecodes.glyph
+local glue_code = nodes.nodecodes.glue
+
+local spaceskip_code = nodes.gluecodes.spaceskip
+local xspaceskip_code = nodes.gluecodes.xspaceskip
+
+local nuts = nodes.nuts
+
+local getnext = nuts.getnext
+local getprev = nuts.getprev
+local getattr = nuts.getattr
+local getid = nuts.getid
+local getsubtype = nuts.getsubtype
+local getchar = nuts.getchar
+local isglyph = nuts.isglyph
+
+local setlink = nuts.setlink
+local setnext = nuts.setnext
+local setprev = nuts.setprev
+local setchar = nuts.setchar
+local setattrlist = nuts.setattrlist
+local setoptions = nuts.setoptions
+
+local glyphoptioncodes = tex.glyphoptioncodes
+local norightligature_option = glyphoptioncodes.norightligature
+local noleftligature_option = glyphoptioncodes.noleftligature
+
+local insertbefore = nuts.insertbefore
+local insertafter = nuts.insertafter
+local remove_node = nuts.remove
+local copy_node = nuts.copy
+local flushlist = nuts.flushlist
+
+local nodepool = nuts.pool
+local new_disc = nodepool.disc
+
+local texsetattribute = tex.setattribute
+local unsetvalue = attributes.unsetvalue
+
+local enableaction = nodes.tasks.enableaction
+
+local v_reset = interfaces.variables.reset
+
+local implement = interfaces.implement
+
+local processors = typesetters.processors
+local splitprocessor = processors.split
+
+local replacements = languages.replacements or { }
+languages.replacements = replacements
+
+local a_replacements = attributes.private("replacements")
+
+local lists = { }
+local last = 0
+local trees = { }
+
+table.setmetatableindex(lists,function(lists,name)
+ last = last + 1
+ local list = { }
+ local data = { name = name, list = list, attribute = last }
+ lists[last] = data
+ lists[name] = data
+ trees[last] = list
+ return data
+end)
+
+lists[v_reset].attribute = unsetvalue -- so we discard 0
+
+-- todo: glue kern attr
+
+local function add(root,word,replacement)
+ local processor, replacement = splitprocessor(replacement,true) -- no check
+ replacement = lpegmatch(stripper,replacement) or replacement
+ local list = utfsplit(word) -- ,true)
+ local size = #list
+ for i=1,size do
+ local l = utfbyte(list[i])
+ if not root[l] then
+ root[l] = { }
+ end
+ if i == size then
+ local special = find(replacement,"{",1,true)
+ local newlist = lpegmatch(splitter,replacement)
+ root[l].final = {
+ word = word,
+ replacement = replacement,
+ processor = processor,
+ oldlength = size,
+ newcodes = newlist,
+ special = special,
+ }
+ end
+ root = root[l]
+ end
+end
+
+function replacements.add(category,word,replacement)
+ local root = lists[category].list
+ if type(word) == "table" then
+ for word, replacement in next, word do
+ add(root,word,replacement)
+ end
+ else
+ add(root,word,replacement or "")
+ end
+end
+
+-- local strip = lpeg.stripper("{}")
+
+function languages.replacements.addlist(category,list)
+ local root = lists[category].list
+ if type(list) == "string" then
+ for new in gmatch(list,"%S+") do
+ local old = gsub(new,"[{}]","")
+ -- local old = lpegmatch(strip,new)
+ add(root,old,new)
+ end
+ else
+ for i=1,#list do
+ local new = list[i]
+ local old = gsub(new,"[{}]","")
+ -- local old = lpegmatch(strip,new)
+ add(root,old,new)
+ end
+ end
+end
+
+local function tonodes(list,template)
+ local head, current
+ for i=1,#list do
+ local new = copy_node(template)
+ setchar(new,list[i])
+ if head then
+ head, current = insertafter(head,current,new)
+ else
+ head, current = new, new
+ end
+ end
+ return head
+end
+
+local ispunctuation = characters.is_punctuation
+
+-- We can try to be clever and use the fact that there is no match to skip
+-- over to the next word but it is gives fuzzy code so for now I removed
+-- that optimization (when I really need a high performance version myself
+-- I will look into it (but so far I never used this mechanism myself).
+--
+-- We used to have the hit checker as function but is got messy when checks
+-- for punctuation was added.
+
+local function replace(head,first,last,final,hasspace,overload)
+ local current = first
+ local prefirst = getprev(first) or head
+ local postlast = getnext(last)
+ local oldlength = final.oldlength
+ local newcodes = final.newcodes
+ local newlength = newcodes and #newcodes or 0
+ if trace_replacements then
+ report_replacement("replacing word %a by %a",final.word,final.replacement)
+ end
+ if hasspace or final.special then
+ -- It's easier to delete and insert so we do just that. On the todo list is
+ -- turn injected spaces into glue but easier might be to let the char break
+ -- handler do that ...
+ local prev = getprev(current)
+ local next = getnext(last)
+ local list = current
+ setnext(last)
+ setlink(prev,next)
+ current = prev
+ if not current then
+ head = nil
+ end
+ local i = 1
+ while i <= newlength do
+ local codes = newcodes[i]
+ if type(codes) == "table" then
+ local method = codes[1]
+ if method == "discretionary" then
+ local pre, post, replace = codes[2], codes[3], codes[4]
+ if pre then
+ pre = tonodes(pre,first)
+ end
+ if post then
+ post = tonodes(post,first)
+ end
+ if replace then
+ replace = tonodes(replace,first)
+ end
+ -- todo: also set attr
+ local new = new_disc(pre,post,replace)
+ setattrlist(new,first)
+ head, current = insertafter(head,current,new)
+ elseif method == "noligature" then
+ -- not that efficient to copy but ok for testing
+ local list = codes[2]
+ if list then
+ local n = #list
+ for i=1,n do
+ local new = copy_node(first)
+ setchar(new,list[i])
+ if i == 1 then
+ setoptions(new,norightligature_option)
+ elseif i == n then
+ setoptions(new,glyphoptioncodes.noleftligature | norightligature_option)
+ else
+ setoptions(new,glyphoptioncodes.noleftligature)
+ end
+ head, current = insertafter(head,current,new)
+ end
+ else
+ -- local new = copy_node(first)
+ -- setchar(new,zwnj)
+ -- head, current = insertafter(head,current,new)
+ setoptions(current,norightligature_option)
+ end
+ else
+ report_replacement("unknown method %a",method or "?")
+ end
+ else
+ local new = copy_node(first)
+ setchar(new,codes)
+ head, current = insertafter(head,current,new)
+ end
+ i = i + 1
+ end
+ flushlist(list)
+ elseif newlength == 0 then
+ -- we overload
+ elseif oldlength == newlength then
+ if final.word ~= final.replacement then
+ for i=1,newlength do
+ setchar(current,newcodes[i])
+ current = getnext(current)
+ end
+ end
+ current = getnext(final)
+ elseif oldlength < newlength then
+ for i=1,newlength-oldlength do
+ local n = copy_node(current)
+ setchar(n,newcodes[i])
+ head, current = insertbefore(head,current,n)
+ current = getnext(current)
+ end
+ for i=newlength-oldlength+1,newlength do
+ setchar(current,newcodes[i])
+ current = getnext(current)
+ end
+ else
+ for i=1,oldlength-newlength do
+ head, current = remove_node(head,current,true)
+ end
+ for i=1,newlength do
+ setchar(current,newcodes[i])
+ current = getnext(current)
+ end
+ end
+ if overload then
+ overload(final,getnext(prefirst),getprev(postlast))
+ end
+ return head, postlast
+end
+
+-- we handle just one space
+
+function replacements.handler(head)
+ local current = head
+ local overload = attributes.applyoverloads
+ local mode = false -- we're in word or punctuation mode
+ local wordstart = false
+ local wordend = false
+ local prevend = false
+ local prevfinal = false
+ local tree = false
+ local root = false
+ local hasspace = false
+ while current do
+ local id = getid(current) -- or use the char getter
+ if id == glyph_code then
+ local a = getattr(current,a_replacements)
+ if a then
+ -- we have a run
+ tree = trees[a]
+ if tree then
+ local char = getchar(current)
+ local punc = ispunctuation[char]
+ if mode == "punc" then
+ if not punc then
+ if root then
+ local final = root.final
+ if final then
+ head = replace(head,wordstart,wordend,final,hasspace,overload)
+ elseif prevfinal then
+ head = replace(head,wordstart,prevend,prevfinal,hasspace,overload)
+ end
+ prevfinal = false
+ root = false
+ end
+ mode = "word"
+ end
+ elseif mode == "word" then
+ if punc then
+ if root then
+ local final = root.final
+ if final then
+ head = replace(head,wordstart,wordend,final,hasspace,overload)
+ elseif prevfinal then
+ head = replace(head,wordstart,prevend,prevfinal,hasspace,overload)
+ end
+ prevfinal = false
+ root = false
+ end
+ mode = "punc"
+ end
+ else
+ mode = punc and "punc" or "word"
+ end
+ if root then
+ root = root[char]
+ if root then
+ wordend = current
+ end
+ else
+ if prevfinal then
+ head = replace(head,wordstart,prevend,prevfinal,hasspace,overload)
+ prevfinal = false
+ end
+ root = tree[char]
+ if root then
+ wordstart = current
+ wordend = current
+ prevend = false
+ hasspace = false
+ end
+ end
+ else
+ root= false
+ end
+ else
+ tree = false
+ end
+ current = getnext(current)
+ elseif root then
+ local final = root.final
+ if mode == "word" and id == glue_code then
+ local s = getsubtype(current)
+ if s == spaceskip_code or s == xspaceskip_code then
+ local r = root[32] -- maybe more types
+ if r then
+ if not prevend then
+ local f = root.final
+ if f then
+ prevend = wordend
+ prevfinal = f
+ end
+ end
+ wordend = current
+ root = r
+ hasspace = true
+ goto moveon
+ end
+ end
+ end
+ if final then
+ head, current = replace(head,wordstart,wordend,final,hasspace,overload)
+ elseif prevfinal then
+ head, current = replace(head,wordstart,prevend,prevfinal,hasspace,overload)
+ end
+ prevfinal = false
+ root = false
+ ::moveon::
+ current = getnext(current)
+ else
+ current = getnext(current)
+ end
+ end
+ if root then
+ local final = root.final
+ if final then
+ head = replace(head,wordstart,wordend,final,hasspace,overload)
+ elseif prevfinal then
+ head = replace(head,wordstart,prevend,prevfinal,hasspace,overload)
+ end
+ end
+ return head
+end
+
+local enabled = false
+
+function replacements.set(n)
+ if n == v_reset then
+ n = unsetvalue
+ else
+ n = lists[n].attribute
+ if not enabled then
+ enableaction("processors","languages.replacements.handler")
+ if trace_replacements then
+ report_replacement("enabling replacement handler")
+ end
+ enabled = true
+ end
+ end
+ texsetattribute(a_replacements,n)
+end
+
+-- interface
+
+implement {
+ name = "setreplacements",
+ actions = replacements.set,
+ arguments = "string"
+}
+
+implement {
+ name = "addreplacements",
+ actions = replacements.add,
+ arguments = "3 strings",
+}
+
+implement {
+ name = "addreplacementslist",
+ actions = replacements.addlist,
+ arguments = "2 strings",
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-rep.mkxl b/Master/texmf-dist/tex/context/base/mkxl/lang-rep.mkxl
index 36e48424249..03b761bb746 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lang-rep.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/lang-rep.mkxl
@@ -19,7 +19,7 @@
\unprotect
-\registerctxluafile{lang-rep}{}
+\registerctxluafile{lang-rep}{autosuffix}
\definesystemattribute[replacements][public,global]
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-tra.lmt b/Master/texmf-dist/tex/context/base/mkxl/lang-tra.lmt
new file mode 100644
index 00000000000..2591659280a
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/lang-tra.lmt
@@ -0,0 +1,372 @@
+if not modules then modules = { } end modules ['lang-tra'] = {
+ version = 1.001,
+ comment = "companion to lang-tra.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- The indic transliterations was researched by kauśika and after some experiments
+-- we settled on the current approach (mappings and a more specific lpeg).
+
+-- Todo: initial and final in addition to mapping so that we can do hebrew and
+-- such.
+
+local concat, setmetatableindex = table.concat, table.setmetatableindex
+local nospaces = string.nospaces
+local utfbyte, utfchar, utfsplit, utfvalues = utf.byte, utf.char, utf.split, utf.values
+local C, Cc, Cs, lpegmatch = lpeg.C, lpeg.Cc, lpeg.Cs, lpeg.match
+local utfchartabletopattern = lpeg.utfchartabletopattern
+local utfcharacterpattern = lpeg.patterns.utf8character
+
+local nuts = nodes.nuts
+
+local nextchar = nuts.traversers.char
+
+local getattr = nuts.getattr
+local setchar = nuts.setchar
+local getnext = nuts.getnext
+local isnextchar = nuts.isnextchar
+
+local insertafter = nuts.insertafter
+local copynode = nuts.copy
+local removenode = nuts.remove
+
+local texsetattribute = tex.setattribute
+
+local registervalue = attributes.registervalue
+local getvalue = attributes.getvalue
+
+local transliteration = { }
+languages.transliteration = transliteration
+
+local a_transliteration = attributes.private("transliteration")
+local unsetvalue = attributes.unsetvalue
+
+local implement = interfaces.implement
+local context = context
+
+local zwj = utf.char(0x200D)
+
+-- local lastmapping = 0
+local loadedmappings = { }
+local loadedlibraries = { }
+local exceptions = { }
+
+local report = logs.reporter("transliteration")
+local trace = false trackers.register("languages.transliteration", function(v) trace = v end)
+
+local converters = {
+-- ["iast to deva"] = function(m)
+-- local t_svara = m.svara
+-- local p_svara = utfchartabletopattern(t_svara)
+-- local t_vyanjana = m.vyanjana
+-- local p_vyanjana = utfchartabletopattern(t_vyanjana)
+-- local t_maatra = m.maatra
+-- local p_maatra = utfchartabletopattern(t_maatra)
+-- local t_viraama = m.viraama
+-- local p_viraama = utfchartabletopattern(t_viraama)
+-- local t_boundary = m.boundary
+-- local p_boundary = utfchartabletopattern(t_boundary)
+-- local t_yogavaaha = m.yogavaaha
+-- local p_yogavaaha = utfchartabletopattern(t_yogavaaha)
+-- local p_svara_boundary = 1 - p_svara - p_vyanjana - p_yogavaaha
+-- local p = Cs ( (
+-- p_svara / t_svara
+-- + p_vyanjana / t_vyanjana
+-- + p_viraama / t_viraama
+-- + p_yogavaaha / t_yogavaaha
+-- + C(utfcharacterpattern)
+-- )^0 )
+-- return function(s)
+-- -- for now
+-- -- s = zwj .. s
+-- --
+-- return lpegmatch(p,s) or s
+-- end
+-- end,
+ ["mapping"] = function(m)
+ local t_mapping = m.mapping
+ if t_mapping then
+ local t_exceptions = m.exceptions
+ local p = Cs ( (
+ utfchartabletopattern(t_mapping) / t_mapping
+ + C(utfcharacterpattern)
+ )^0 )
+ -- lpeg.print(p)
+ return function(s,e)
+ return (e and e[s]) or t_exceptions[s] or lpegmatch(p,s) or s
+ end
+ else
+ return false
+ end
+ end,
+ ["default"] = function(m)
+ local t_exceptions = m.exceptions
+ return function(s,e)
+ return (e and e[s]) or t_exceptions[s] or s
+ end
+ end,
+}
+
+function transliteration.use(library)
+ local lib = loadedlibraries[library]
+ if lib == nil then
+ -- todo: use library loader
+ local data = require("lang-imp-" .. library)
+ if data then
+ local transliterations = data.transliterations
+ if transliterations then
+ for name, d in table.sortedhash(transliterations) do
+ local vector = d.vector
+ if not d.exceptions then
+ d.exceptions = { }
+ end
+ if vector then
+ report("vector %a in %a is %sloaded",name,library," already")
+ else
+ d.vector = (converters[name] or converters.mapping or converters.default)(d)
+ or (converters.default)(d)
+ report("vector %a in set %a is %sloaded",name,library,"")
+ end
+ d.library = library
+ d.name = name
+ d.mapping = nil -- for now, saves memory
+ loadedmappings[name] = d
+ loadedmappings[nospaces(name)] = d
+ end
+ else
+ report("library %a has no transliterations",library)
+ end
+ loadedlibraries[library] = data
+ else
+ loadedlibraries[library] = false
+ end
+ end
+end
+
+local enable = false
+
+enable = function()
+ nodes.tasks.enableaction("processors", "languages.transliteration.handler")
+ enable = false
+end
+
+function transliteration.register(parent,name)
+ local p = exceptions[parent]
+ if p then
+ if trace then
+ report("%a has exceptions that default to %a",name,parent)
+ end
+ exceptions[name] = setmetatableindex({ },p)
+ else
+ if trace then
+ report("%a has independent exceptions",name)
+ end
+ exceptions[name] = { }
+ end
+end
+
+function transliteration.set(name,vector)
+ if enable then
+ enable()
+ end
+ local a = registervalue(a_transliteration, {
+ m = loadedmappings[vector],
+ e = exceptions[name],
+ })
+ if trace then
+ report("setting transliteration %i, name %a, vector %a",a,name,vector)
+ end
+ texsetattribute(a_transliteration,a)
+end
+
+function transliteration.exception(name,old,new)
+ local m = loadedmappings[name]
+ if m then
+ m.exceptions[old] = new
+ else
+ local e = exceptions[name]
+ if not e then
+ e = { }
+ exceptions[name] = e
+ end
+ e[old] = new
+ end
+end
+
+-- When there is need I will improve the performance of the next handler.
+
+function transliteration.handler(head)
+ local aprev = nil
+ local vector = nil
+ local except = nil
+ local current = head
+ local first = nil
+ local last = nil
+ local list = { }
+ local size = 0
+
+ -- we need a more clever one: run over small ranges in order to keep colors etc
+
+ -- actually we can generalize the replacer elsewhere
+
+ local function flush(nxt)
+ if vector then
+ -- we can do some optimization here by having the split as replacement
+ local old = concat(list,"",1,size)
+ local new = vector(old,except)
+ if old ~= new then
+ if trace then
+ report("old: %s",old)
+ report("new: %s",new)
+ end
+ local c = first
+ local x = false
+ for s in utfvalues(new) do
+ if x then
+ head, c = insertafter(head,c,copynode(first))
+ setchar(c,s)
+ else
+ setchar(c,s)
+ if c == last then
+ x = true
+ else
+ c = getnext(c)
+ end
+ end
+ end
+ if not x then
+ while c do
+ head, c = removenode(head,c,true)
+ if c == nxt then
+ break
+ end
+ end
+ end
+ end
+ end
+ end
+
+ while current do
+ local nxt, chr, more = isnextchar(current)
+ if chr then
+ local a = getattr(current,a_transliteration)
+ if a then
+ if a ~= aprev then
+ if first then
+ flush(nxt)
+ first = nil
+ size = 0
+ end
+ aprev = a
+ local data = getvalue(a_transliteration,a)
+ if data then
+ local m = data.m
+ if m then
+ vector = m.vector
+ except = data.e
+ else
+ vector = nil
+ except = nil
+ end
+ else
+ vector = nil
+ except = nil
+ end
+ end
+ if not first then
+ first = current
+ end
+ last = current
+ size = size + 1
+ list[size] = utfchar(chr)
+ if not more then
+ flush(nxt)
+ first = nil
+ size = 0
+ -- we can go ahead one next
+ end
+ else
+ if first then
+ flush(nxt)
+ first = nil
+ size = 0
+ end
+ end
+ end
+ current = nxt
+ end
+ if first then
+ flush(nxt)
+ end
+ return head
+end
+
+interfaces.implement {
+ name = "usetransliteration",
+ public = true,
+ protected = true,
+ arguments = "optional",
+ actions = transliteration.use,
+}
+
+implement {
+ name = "settransliteration",
+ arguments = "2 strings",
+ actions = transliteration.set,
+}
+
+implement {
+ name = "registertransliteration",
+ arguments = "3 strings",
+ actions = transliteration.register,
+}
+
+implement {
+ name = "transliterationexception",
+ arguments = "3 strings",
+ actions = transliteration.exception,
+}
+
+nodes.tasks.prependaction("processors", "normalizers", "languages.transliteration.handler", nil, "nut", "disabled" )
+
+local function transliterate(scheme,str)
+ if str and str ~= "" then
+ local m = loadedmappings[scheme]
+ local c = m and m.vector
+ context(c and c(str) or str)
+ end
+end
+
+local getbuffer = buffers.getcontent
+
+implement {
+ name = "transliterate",
+ public = true,
+ protected = true,
+ arguments = { "optional", "string" },
+ actions = transliterate,
+}
+
+implement {
+ name = "transliteratebuffer",
+ public = true,
+ protected = true,
+ arguments = { "optional", "string" },
+ actions = function(scheme,name) transliterate(scheme,getbuffer(name)) end,
+}
+
+implement {
+ name = "transliterated",
+ public = true,
+ arguments = { "optional", "string" },
+ actions = transliterate,
+}
+
+implement {
+ name = "transliteratedbuffer",
+ public = true,
+ arguments = { "optional", "string" },
+ actions = function(scheme,name) transliterate(scheme,getbuffer(name)) end,
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-tra.mkxl b/Master/texmf-dist/tex/context/base/mkxl/lang-tra.mkxl
index b087832e04b..66a020a141d 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lang-tra.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/lang-tra.mkxl
@@ -13,30 +13,74 @@
\writestatus{loading}{ConTeXt Language Macros / Transliteration}
-\registerctxluafile{lang-tra}{}
+\registerctxluafile{lang-tra}{autosuffix}
\unprotect
+\installcorenamespace {transliteration}
+
+\installcommandhandler \??transliteration {transliteration} \??transliteration
+
\definesystemattribute[transliteration][public,global]
-\installcorenamespace {transliteration}
+\newtoks\everytransliterations
+
+\appendtoks
+ \disablediscretionaries
+ % \let~=\lettertilde
+ \enforced\letcharcode\tildeasciicode\lettertilde
+ % \let|=\letterbar
+ % \enforced\letcharcode\barasciicode\letterbar
+\to \everytransliterations
-\permanent\tolerant\protected\def\definetransliteration[#1]#*[#2]%
- {\clf_definedtransliteration{#1}{#2}}
+\def\lang_transliteration_common
+ {\usetransliterationstyleandcolor\c!style\c!color
+ \uselanguageparameter\transliterationparameter
+ \clf_settransliteration{\currenttransliteration}{\transliterationparameter\c!vector}%
+ \the\everytransliterations}
-\permanent\protected\def\settransliteration[#1]%
- {\clf_settransliteration{#1}}
+\permanent\tolerant\protected\def\settransliteration[#1]#;#2%
+ {\edef\currenttransliteration{#1#2}%
+ \lang_transliteration_common}
-\permanent\protected\def\starttransliteration[#1]%
+\permanent\protected\def\transliterationexception[#1]#2#3%
+ {\clf_transliterationexception{#1}{#2}{#3}}
+
+\permanent\tolerant\protected\def\starttransliteration[#1]#*[#2]%
{\begingroup
- \clf_settransliteration{#1}}
+ \edef\currenttransliteration{#1}%
+ \ifparameter#2\or
+ \setupcurrenttransliteration[#2]%
+ \fi
+ \transliterationparameter\c!before\relax
+ \lang_transliteration_common}
\permanent\protected\def\stoptransliteration
- {\endgroup}
+ {\transliterationparameter\c!after\relax
+ \endgroup}
+
+\permanent\tolerant\protected\def\transliteration[#1]#;#2%
+ {\groupedcommand
+ {\edef\currenttransliteration{#1#2}%
+ \lang_transliteration_common
+ \transliterationparameter\c!left\relax}
+ {\transliterationparameter\c!right\relax}}
+
+\appendtoks
+ \clf_registertransliteration{\currenttransliterationparent}{\currenttransliteration}%
+ \ifcstok{\transliterationparameter\c!define}\v!yes
+ \frozen\protected\instance\edefcsname\e!start\currenttransliteration\endcsname{\starttransliteration[\currenttransliteration]}%
+ \frozen\protected\instance\edefcsname\e!stop \currenttransliteration\endcsname{\stoptransliteration}%
+ \frozen\protected\instance\edefcsname \currenttransliteration\endcsname{\transliteration[\currenttransliteration]}%
+ \fi
+\to \everydefinetransliteration
\permanent\protected\def\resettransliteration
{\c_attr_transliteration\attributeunsetvalue}
+\setuptransliteration
+ [\c!define=\v!yes]
+
\appendtoks
\resettransliteration
\to \everyinitializeverbatim
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-url.lmt b/Master/texmf-dist/tex/context/base/mkxl/lang-url.lmt
new file mode 100644
index 00000000000..b918464d032
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/lang-url.lmt
@@ -0,0 +1,259 @@
+if not modules then modules = { } end modules ['lang-url'] = {
+ version = 1.001,
+ comment = "companion to lang-url.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local next = next
+local utfcharacters, utfbyte, utfchar = utf.characters, utf.byte, utf.char
+local min, max = math.min, math.max
+local setmetatableindex = table.setmetatableindex
+
+local context = context
+local ctx_pushcatcodes = context.pushcatcodes
+local ctx_popcatcodes = context.popcatcodes
+
+local implement = interfaces.implement
+local variables = interfaces.variables
+
+local v_before = variables.before
+local v_after = variables.after
+
+local is_letter = characters.is_letter
+
+--[[
+<p>Hyphenating <l n='url'/>'s is somewhat tricky and a matter of taste. I did
+consider using a dedicated hyphenation pattern or dealing with it by node
+parsing, but the following solution suits as well. After all, we're mostly
+dealing with <l n='ascii'/> characters.</p>
+]]--
+
+local urls = { }
+languages.urls = urls
+
+local characters = utilities.storage.allocate {
+ ["!"] = "before",
+ ['"'] = "before",
+ ["#"] = "before",
+ ["$"] = "before",
+ ["%"] = "before",
+ ["&"] = "before",
+ ["("] = "before",
+ ["*"] = "before",
+ ["+"] = "before",
+ [","] = "before",
+ ["-"] = "before",
+ ["."] = "before",
+ ["/"] = "before",
+ [":"] = "before",
+ [";"] = "before",
+ ["<"] = "before",
+ ["="] = "before",
+ [">"] = "before",
+ ["?"] = "before",
+ ["@"] = "before",
+ ["["] = "before",
+ ["\\"] = "before",
+ ["^"] = "before",
+ ["_"] = "before",
+ ["`"] = "before",
+ ["{"] = "before",
+ ["|"] = "before",
+ ["~"] = "before",
+
+ ["'"] = "after",
+ [")"] = "after",
+ ["]"] = "after",
+ ["}"] = "after",
+}
+
+local mapping = utilities.storage.allocate {
+ -- [utfchar(0xA0)] = "~", -- nbsp (catch)
+}
+
+urls.characters = characters
+urls.mapping = mapping
+urls.lefthyphenmin = 2
+urls.righthyphenmin = 3
+urls.discretionary = nil
+urls.packslashes = false
+
+directives.register("hyphenators.urls.packslashes",function(v) urls.packslashes = v end)
+
+local trace = false trackers.register("hyphenators.urls",function(v) trace = v end)
+local report = logs.reporter("hyphenators","urls")
+
+-- local ctx_a = context.a
+-- local ctx_b = context.b
+-- local ctx_d = context.d
+-- local ctx_c = context.c
+-- local ctx_l = context.l
+-- local ctx_C = context.C
+-- local ctx_L = context.L
+
+-- local function action(hyphenatedurl,str,left,right,disc)
+-- --
+-- left = max( left or urls.lefthyphenmin, 2)
+-- right = min(#str-(right or urls.righthyphenmin)+2,#str)
+-- disc = disc or urls.discretionary
+-- --
+-- local word = nil
+-- local prev = nil
+-- local pack = urls.packslashes
+-- local length = 0
+-- --
+-- for char in utfcharacters(str) do
+-- length = length + 1
+-- char = mapping[char] or char
+-- local b = utfbyte(char)
+-- if prev == char and prev == "/" then
+-- ctx_c(b)
+-- elseif char == disc then
+-- ctx_d()
+-- else
+-- if prev == "/" then
+-- ctx_d()
+-- end
+-- local how = characters[char]
+-- if how == v_before then
+-- word = false
+-- ctx_b(b)
+-- elseif how == v_after then
+-- word = false
+-- ctx_a(b)
+-- else
+-- local letter = is_letter[char]
+-- if length <= left or length >= right then
+-- if word and letter then
+-- ctx_L(b)
+-- else
+-- ctx_C(b)
+-- end
+-- elseif word and letter then
+-- ctx_l(b)
+-- else
+-- ctx_c(b)
+-- end
+-- word = letter
+-- end
+-- end
+-- if pack then
+-- prev = char
+-- else
+-- prev = nil
+-- end
+-- end
+-- end
+
+local function action(hyphenatedurl,str,left,right,disc)
+ --
+ left = max( left or urls.lefthyphenmin, 2)
+ right = min(#str-(right or urls.righthyphenmin)+2,#str)
+ disc = disc or urls.discretionary
+ --
+ local word = nil
+ local pack = urls.packslashes
+ local length = 0
+ local list = utf.split(str)
+ local size = #list
+ local prev = nil
+
+ for i=1,size do
+ local what = nil
+ local dodi = false
+ local char = list[i]
+ length = length + 1
+ char = mapping[char] or char
+ if char == disc then
+ dodi = true
+ elseif pack and char == "/" and (list[i+1] == "/" or prev == "/") then
+ what = "c"
+ else
+ local how = characters[char]
+ if how == v_before then
+ what = "b"
+ elseif how == v_after then
+ word = false
+ what = "a"
+ else
+ local letter = is_letter[char]
+ if length <= left or length >= right then
+ if word and letter then
+ what = "L"
+ else
+ what = "C"
+ end
+ elseif word and letter then
+ what = "l"
+ else
+ what = "c"
+ end
+ word = letter
+ end
+ end
+ if dodi then
+ list[i] = "\\lang_url_d "
+ else
+ list[i] = "\\lang_url_" .. what .. "{" .. utfbyte(char) .. "}"
+ end
+ prev = char
+ end
+ if trace then
+ report("old : %s",str)
+ report("new : %t",list)
+ end
+ ctx_pushcatcodes("prtcatcodes")
+ context("%t",list)
+ ctx_popcatcodes()
+end
+
+-- urls.action = function(_,...) action(...) end -- sort of obsolete
+
+table.setmetatablecall(hyphenatedurl,action) -- watch out: a caller
+
+-- todo, no interface in mkiv yet
+
+local registerfunction = context.functions.register
+local unregisterfunction = context.functions.unregister
+local savelua = token.savelua
+
+local function restorevalues(savedchars,restore)
+ for k, v in next, savedchars do
+ characters[k] = v
+ end
+ unregisterfunction(restore)
+end
+
+function urls.setcharacters(str,value) -- 1, 2 == before, after
+ local savedchars = { }
+ local newvalue = value or v_before
+ for s in utfcharacters(str) do
+ local oldvalue = characters[s]
+ if oldvalue ~= newvalue then
+ savedchars[s] = oldvalue
+ characters[s] = newvalue
+ end
+ end
+ if next(savedchars) then
+ local restore = nil
+ restore = registerfunction(function() restorevalues(savedchars,restore) end)
+ savelua(restore)
+ end
+end
+
+-- .urls.setcharacters("')]}",2)
+
+implement {
+ name = "sethyphenatedurlcharacters",
+ actions = urls.setcharacters,
+ arguments = "2 strings",
+}
+
+implement {
+ name = "hyphenatedurl",
+ scope = "private",
+ actions = function(...) action(hyphenatedurl,...) end,
+ arguments = { "string", "integer", "integer", "string" }
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lang-url.mkxl b/Master/texmf-dist/tex/context/base/mkxl/lang-url.mkxl
index 04a55fcf93f..2d41c6c3258 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lang-url.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/lang-url.mkxl
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\registerctxluafile{lang-url}{}
+\registerctxluafile{lang-url}{autosuffix}
\unprotect
@@ -57,13 +57,15 @@
\enforced\let\{\letterleftbrace
\enforced\let\}\letterrightbrace
\enforced\let\|\letterbar
- \enforced\let~=\lettertilde
- \enforced\let|=\letterbar
+ % \enforced\let~=\lettertilde
+ % \enforced\let|=\letterbar
+ \enforced\letcharcode\tildeasciicode\lettertilde
+ \enforced\letcharcode\barasciicode \letterbar
\enforced\let\Ux\eUx
\to \everyhyphenatedurl
-\mutable\let\hyphenatedurlseparator \empty % \periodcentered
-\mutable\let\hyphenatedurldiscretionary\empty
+\mutable\lettonothing\hyphenatedurlseparator % \periodcentered
+\mutable\lettonothing\hyphenatedurldiscretionary
\setnewconstant\hyphenatedurllefthyphenmin \plusthree
\setnewconstant\hyphenatedurlrighthyphenmin\plusthree
diff --git a/Master/texmf-dist/tex/context/base/mkxl/layo-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/layo-ini.lmt
index 1570075d9a1..2d922b16a08 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/layo-ini.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/layo-ini.lmt
@@ -12,6 +12,9 @@ if not modules then modules = { } end modules ['layo-ini'] = {
local texgetcount = tex.getcount
local conditionals = tex.conditionals
+local c_realpageno = tex.iscount("realpageno")
+local c_pagenoshift = tex.iscount("pagenoshift")
+
layouts = {
status = { },
}
@@ -26,14 +29,14 @@ function status.leftorrightpageaction(left,right)
return left, right
elseif conditionals.layoutissinglesided then
return left, right
- elseif texgetcount("pagenoshift") % 2 == 0 then
- if texgetcount("realpageno") % 2 == 0 then
+ elseif texgetcount(c_pagenoshift) % 2 == 0 then
+ if texgetcount(c_realpageno) % 2 == 0 then
return right, left
else
return left, right
end
else
- if texgetcount("realpageno") % 2 == 0 then
+ if texgetcount(c_realpageno) % 2 == 0 then
return left, right
else
return right, left
@@ -46,10 +49,10 @@ function status.isleftpage(r)
return false
elseif conditionals.layoutissinglesided then
return false
- elseif texgetcount("pagenoshift") % 2 == 0 then
- return (r or texgetcount("realpageno")) % 2 == 0
+ elseif texgetcount(c_pagenoshift) % 2 == 0 then
+ return (r or texgetcount(c_realpageno)) % 2 == 0
else
- return not (r or texgetcount("realpageno")) % 2 == 0
+ return not (r or texgetcount(c_realpageno)) % 2 == 0
end
end
@@ -96,8 +99,12 @@ function layouts.setupcanvas(specification)
canvas.marked = specification.print
--
local copies = specification.copies
- if type(copies) == "number" and copies < 2 then
- canvas.copies = false
+ if type(copies) == "number" then
+ if copies < 2 then
+ canvas.copies = false
+ else
+ canvas.copies = copies
+ end
end
--
local doublesided = specification.doublesided
diff --git a/Master/texmf-dist/tex/context/base/mkxl/layo-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/layo-ini.mkxl
index 73b7e978e16..a3ed6236ba4 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/layo-ini.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/layo-ini.mkxl
@@ -22,8 +22,8 @@
\ifdefined\layoutisdoublesided \else \newconditional\layoutisdoublesided \fi
\ifdefined\layoutissinglesided \else \newconditional\layoutissinglesided \fi
-\ifdefined\pagenoshift \else \newcount \pagenoshift \fi
-\ifdefined\realpageno \else \newcount \realpageno \fi
+\ifdefined\pagenoshift \else \newinteger \pagenoshift \fi
+\ifdefined\realpageno \else \newinteger \realpageno \fi
\registerctxluafile{layo-ini}{autosuffix}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/libs-imp-curl.lmt b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-curl.lmt
index b307397948c..0aa6d0855bd 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/libs-imp-curl.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-curl.lmt
@@ -19,6 +19,7 @@ if not curllib then return end
local next, type = next, type
local lower, gsub = string.lower, string.gsub
+local dirname = file.dirname
local mapping = {
["acceptencoding"] = 102,
@@ -272,12 +273,17 @@ local function fetch(options)
o[index] = value
end
end
+ -- if o.capath == true then
+ -- o.capath = libpath
+ -- end
return curl_fetch(o)
elseif t == "string" then
return curl_fetch { [mapping.url] = options }
else
report("invalid argument")
end
+ else
+ report("no curl library loaded")
end
end
@@ -286,10 +292,19 @@ local curl = {
escape = function (s) return okay() and curl_escape (s) end,
unescape = function (s) return okay() and curl_unescape (s) end,
fetch = fetch,
+ libfile = libfile,
+ libpath = dirname(libfile),
}
-- inspect(curl.fetch("http://www.pragma-ade.com/index.html"))
-- inspect(curl.fetch { url = "http://www.pragma-ade.com/index.html" })
+--
+-- inspect(curl.fetch {
+-- url = "https://www.ctan.org/json/2.0/packages",
+-- sslverifyhost = 0,
+-- sslverifypeer = 0,
+-- -- capath = true
+-- } )
package.loaded[libname] = curl
diff --git a/Master/texmf-dist/tex/context/base/mkxl/libs-imp-foreign.lmt b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-foreign.lmt
new file mode 100644
index 00000000000..7b177307850
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-foreign.lmt
@@ -0,0 +1,65 @@
+if not modules then modules = { } end modules ['libs-imp-foreign'] = {
+ version = 1.001,
+ comment = "companion to luat-imp-foreign.mkxl",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- See libs-imp-foreign.mkxl for some comments.
+
+local report = logs.reporter("foreign")
+
+local libname = "foreign"
+----- libfile = "libffi-7"
+local libfile = "libffi*"
+----- libfile = "d:/inkscape/bin/libffi-7.dll" -- libffi*
+
+local libforeign = resolvers.libraries.validoptional(libname)
+
+if package.loaded[libname] then
+ return package.loaded[libname]
+end
+
+local function okay()
+ -- Don't worry, when one overloads this flag the engine will abort with an
+ -- error message anyway, but it's less nice.
+ if not status.permit_loadlib then
+ report()
+ report("opening foreign libraries is not enabled")
+ report()
+ os.exit()
+ elseif libforeign and resolvers.libraries.optionalloaded(libname,libfile) then
+ okay = function() return true end
+ else
+ okay = function() return false end
+ end
+ return okay()
+end
+
+local foreignload = libforeign.load
+
+local foreign = {
+ types = libforeign.types,
+ abivalues = libforeign.abivalues,
+ totable = libforeign.totable,
+ newbuffer = libforeign.newbuffer,
+ getbuffer = libforeign.getbuffer,
+ load = function(name)
+ if okay() then
+ local fullname = resolvers.findlib(name)
+ if fullname and fullname ~= "" then
+ return foreignload(fullname)
+ else
+ -- report an error
+ end
+ end
+ end,
+}
+
+-- In due time I'll add the struct and array methods using Lua 5.4 features.
+
+package .loaded[libname] = foreign
+optional.loaded[libname] = foreign
+
+return foreign
diff --git a/Master/texmf-dist/tex/context/base/mkxl/libs-imp-foreign.mkxl b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-foreign.mkxl
new file mode 100644
index 00000000000..5c266358629
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-foreign.mkxl
@@ -0,0 +1,204 @@
+% permitloadlib=true
+
+%D \module
+%D [ file=libs-imp-foreign,
+%D version=2021.03.10,
+%D title=\CONTEXT\ Extra Modules,
+%D subtitle=Basic FFI,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%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 module was added as a side track of a user wanting to run a library that is
+%D not (has support) built in. In order to identify issues I wondered if we could
+%D have an additional feature to the already present optional libraries (of course
+%D with the usual loadlib protection. Keep in mind that loading libraries creates a
+%D dependency and an api can change. And in a long term program like any \TEX\
+%D program we don't want that (at least I don't want users to be forced to install
+%D lots of additional source code and dependencies in order to compile \LUAMETATEX\
+%D successfully.
+%D
+%D So, I looked around for alternatives to ffi and ran into the (stable since 5
+%D years) alien module (by Fabio Mascarenhas) that uses the rather portable libffi
+%D but it does have some dependencies. For callbacks you need to set some parameters
+%D normally dealt with when configuring and compiling which does creates a
+%D dependency. So, in the end I just took its keyword driven approach but wrapped it
+%D in alternative code that more matches other modules and assumes \LUA\ 5.4.
+%D
+%D Additional features like arrays and structs will be implemented when we need them
+%D using modern \LUA\ 5.4 features (string packing, toclose, etc). For now I
+%D consider all this an experiment and will pick up the thread when I have an
+%D example.
+%D
+%D So, how far do we go? I think as soon as a library becomes more complex, say with
+%D multi|-|dimensional arrays one should just write a proper interface. So we limit
+%D ourselves here. One problem with more complex datastructures is that it opens the
+%D door to abuse thanks to uncontrolled memory access.
+
+\registerctxluafile{libs-imp-foreign}{autosuffix}
+
+\continueifinputfile{libs-imp-foreign.mkxl}
+
+%D The difference in performance is not that significant because the time spent in
+%D the called function is the bottleneck here.
+
+\usemodule[article-basic] \setupbodyfont[8pt] \noheaderandfooterlines
+
+\starttext
+
+\startluacode
+
+ local NC, BC, NR = context.NC, context.BC, context.NR
+
+ function document.identify(kpse,set_program_name,find_file)
+ context.starttabulate { "|l|lp|" }
+ BC() context.type("kpse") NC() context.typ(tostring(kpse)) NC() NR()
+ BC() context.type("set_program_name") NC() context.typ(tostring(set_program_name)) NC() NR()
+ BC() context.type("find_file") NC() context.typ(tostring(find_file)) NC() NR()
+ context.stoptabulate()
+ end
+
+ function document.lookup(find_file,filename,filetype,present,n)
+
+ local c = os.clock()
+ for i=1,n do
+ if find_file(filename,filetype,present) then
+ -- okay
+ end
+ end
+ c = os.clock() - c
+
+ context.starttabulate()
+ BC() context("asked") NC() context.type(filename) NC() NR()
+ BC() context("found") NC() context.type(find_file(filename,filetype,present)) NC() NR()
+ if n > 0 then
+ BC() context("times") NC() context(n) NC() NR()
+ BC() context("seconds") NC() context(" %0.3f",c) NC() NR()
+ BC() context("lookup") NC() context(" %0.6f",c/n) NC() NR()
+ end
+ context.stoptabulate()
+ end
+\stopluacode
+
+\starttitle[title=kpse via foreign]
+
+\startluacode
+
+ local foreign = optional.loaded.foreign
+
+ local kplib = (os.platform == "win64" and "kpathsea*w64")
+ or (os.platform == "win32" and "kpathsea*w32")
+ or "libkpathsea"
+
+ local kpse = foreign.load(kplib)
+
+ local set_program_name = kpse:register {
+ name = "kpse_set_program_name",
+ arguments = { "string", "string" }
+ }
+
+ local find_file = kpse:register {
+ name = "kpse_find_file",
+ arguments = { "string", "int", "int" },
+ result = "string",
+ }
+ local path_expand = kpse:register {
+ name = "kpse_path_expand",
+ arguments = { "string" },
+ result = "string",
+ }
+ local all_path_search = kpse:register {
+ name = "kpse_all_path_search",
+ arguments = { "string", "string" },
+ result = "pointer",
+ finalizer = function(p)
+ return foreign.totable(p,"string") -- unknown n, so NULL terminated
+ end
+ }
+
+ -- print(kpse)
+ -- print(set_program_name)
+ -- print(kpse:registered("kpse_set_program_name"))
+ -- print(kpse:available("kpse_set_program_name"))
+ -- print(kpse:available("set_program_name"))
+ -- print(kpse:available("kpse_find_file"))
+
+ -- inspect(kpse:registered ())
+ -- inspect(foreign.types())
+ -- inspect(foreign.abivalues())
+
+ local set_program_name = kpse:registered("kpse_set_program_name")
+ local find_file = kpse:registered("kpse_find_file")
+
+ set_program_name("luatex","luatex")
+
+ document.lookup(find_file, "libs-imp-foreign.mkxl", 26, 0, 100000)
+ document.lookup(find_file, "oeps.tex", 26, 0, 10000)
+ document.lookup(find_file, "metafun.mp", 16, 0, 5000)
+ document.lookup(find_file, "logo10.afm", 4, 0, 2500)
+
+ document.identify(kpse, set_program_name, find_file)
+
+ -- set_program_name("pdftex","pdftex")
+ --
+ -- local t = path_expand("$TEXINPUTS")
+ -- local p = all_path_search(t,"oeps.tex")
+ --
+ -- inspect(t)
+ -- inspect(p)
+
+\stopluacode
+
+\stoptitle
+
+\registerctxluafile{libs-imp-kpse}{autosuffix}
+
+\starttitle[title=kpse via optional / string]
+
+\startluacode
+
+ local kpse = optional.loaded.kpse
+
+ local set_program_name = kpse.set_program_name
+ local find_file = kpse.find_file
+
+ kpse.set_program_name("luatex")
+
+ document.lookup(find_file, "libs-imp-foreign.mkxl", "tex", false, 100000)
+ document.lookup(find_file, "oeps.tex", "tex", false, 10000)
+ document.lookup(find_file, "metafun.mp", "mp", false, 5000)
+ document.lookup(find_file, "logo10.afm", "afm", false, 2500)
+
+ document.identify(kpse, set_program_name, find_file)
+
+\stopluacode
+
+\stoptitle
+
+\starttitle[title=kpse via optional / number]
+
+\startluacode
+
+ local kpse = optional.loaded.kpse
+
+ local set_program_name = kpse.set_program_name
+ local find_file = kpse.find_file
+
+ kpse.set_program_name("luatex")
+
+ document.lookup(find_file, "libs-imp-foreign.mkxl", 26, false, 100000)
+ document.lookup(find_file, "oeps.tex", 26, false, 10000)
+ document.lookup(find_file, "metafun.mp", 16, false, 5000)
+ document.lookup(find_file, "logo10.afm", 4, false, 2500)
+
+ document.identify(kpse, set_program_name, find_file)
+
+\stopluacode
+
+\stoptitle
+
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkxl/libs-imp-graphicsmagick.lmt b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-graphicsmagick.lmt
index 6f5d1d967fd..f70261366b7 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/libs-imp-graphicsmagick.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-graphicsmagick.lmt
@@ -55,15 +55,21 @@ function graphicsmagick.convert(specification)
--
report("run %s, input file %a, outputfile %a",nofruns,inputname,outputname)
--
- gm_execute { inputfile = inputname, outputfile = outputname }
+ specification.inputfile = inputname
+ specification.outputfile = outputname
+ --
+ local okay, detail = gm_execute(specification)
+ if not okay then
+ report("error %a",detail)
+ end
--
statistics.stoptiming(graphicsmagick)
end
end
-function graphicsmagick.statistics(report)
+function graphicsmagick.statistics(feedback)
local runtime = statistics.elapsedtime(graphicsmagick)
- if report then
+ if feedback then
report("nofruns %s, runtime %s",nofruns,runtime)
else
return {
diff --git a/Master/texmf-dist/tex/context/base/mkxl/libs-imp-imagemagick.lmt b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-imagemagick.lmt
new file mode 100644
index 00000000000..cce632eb389
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-imagemagick.lmt
@@ -0,0 +1,94 @@
+if not modules then modules = { } end modules ['libs-imp-imagemagick'] = {
+ version = 1.001,
+ comment = "companion to luat-lib.mkxl",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files",
+}
+
+-- \registerctxluafile{libs-imp-imagemagick}{autosuffix}
+-- \starttext
+-- \startluacode
+-- utilities.imagemagick.convert {
+-- inputname = "hacker.jpg",
+-- outputname = "m_k_v_i_hacker.png",
+-- options = { "-rotate", 90, "-noise", 2 },
+-- }
+-- context.externalfigure { "hacker.png" }
+-- \stopluacode
+-- \stoptext
+
+local libname = "imagemagick"
+local libfile = { "CORE_RL_MagickCore_", "CORE_RL_MagickWand_" }
+
+local imlib = resolvers.libraries.validoptional(libname)
+
+if not imlib then return end
+
+local function okay()
+ if resolvers.libraries.optionalloaded(libname,libfile) then
+ okay = function() return true end
+ else
+ okay = function() return false end
+ end
+ return okay()
+end
+
+local imagemagick = utilities.imagemagick or { }
+utilities.imagemagick = imagemagick
+
+local im_execute = imlib.execute
+local nofruns = 0
+local report = logs.reporter(libname)
+
+function imagemagick.convert(specification)
+ if okay() then
+ --
+ nofruns = nofruns + 1
+ statistics.starttiming(imagemagick)
+ --
+ local inputname = specification.inputname
+ if not inputname or inputname == "" then
+ report("invalid run %s, no inputname specified",nofruns)
+ statistics.stoptiming(imagemagick)
+ return false
+ end
+ local outputname = specification.outputname
+ if not outputname or outputname == "" then
+ outputname = file.replacesuffix(inputname,"pdf")
+ end
+ --
+ if not lfs.isfile(inputname) then
+ report("invalid run %s, input file %a is not found",nofruns,inputname)
+ statistics.stoptiming(imagemagick)
+ return false
+ end
+ --
+ report("run %s, input file %a, outputfile %a",nofruns,inputname,outputname)
+ --
+ specification.inputfile = inputname
+ specification.outputfile = outputname
+ --
+ local okay, detail = im_execute(specification)
+ if not okay then
+ report("error %a (make sure options start with one -) ",detail)
+ end
+ --
+ statistics.stoptiming(imagemagick)
+ end
+end
+
+function imagemagick.statistics(feedback)
+ local runtime = statistics.elapsedtime(imagemagick)
+ if feedback then
+ report("nofruns %s, runtime %s",nofruns,runtime)
+ else
+ return {
+ runtime = runtime,
+ nofruns = nofruns,
+ }
+ end
+end
+
+-- imagemagick.convert { inputname = "t:/sources/hacker.jpg", outputname = "e:/tmp/hacker.png" }
+-- imagemagick.statistics(true)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/libs-imp-lz4.lmt b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-lz4.lmt
new file mode 100644
index 00000000000..2367a640dc5
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-lz4.lmt
@@ -0,0 +1,46 @@
+if not modules then modules = { } end modules ['libs-imp-lz4'] = {
+ version = 1.001,
+ comment = "companion to luat-lib.mkxl",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- https://packages.msys2.org/package/mingw-w64-x86_64-lz4?repo=mingw64
+
+-- Instead of linking in libs like this we now do them optional. After all, once
+-- we start adding more and more stuff statically we en dup with a mess.
+
+local libname = "lz4"
+local libfile = "liblz4"
+
+local lz4lib = resolvers.libraries.validoptional(libname)
+
+if not lz4lib then return end
+
+local lz4_compress = lz4lib.compress
+----- lz4_decompress = lz4lib.decompress
+local lz4_decompresssize = lz4lib.decompresssize
+local lz4_framecompress = lz4lib.framecompress
+local lz4_framedecompress = lz4lib.framedecompress
+
+local function okay()
+ if resolvers.libraries.optionalloaded(libname,libfile) then
+ okay = function() return true end
+ else
+ okay = function() return false end
+ end
+ return okay()
+end
+
+local lz4 = {
+ compress = function (...) return okay() and lz4_compress (...) end,
+ -- decompress = function (...) return okay() and lz4_decompress (...) end,
+ decompresssize = function (...) return okay() and lz4_decompresssize (...) end,
+ framecompress = function (...) return okay() and lz4_framecompress (...) end,
+ framedecompress = function (...) return okay() and lz4_framedecompress(...) end,
+}
+
+package.loaded[libname] = lz4
+
+return lz4
diff --git a/Master/texmf-dist/tex/context/base/mkxl/libs-imp-lzma.lmt b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-lzma.lmt
new file mode 100644
index 00000000000..eeecaf35369
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-lzma.lmt
@@ -0,0 +1,54 @@
+if not modules then modules = { } end modules ['libs-imp-lzma'] = {
+ version = 1.001,
+ comment = "companion to luat-lib.mkxl",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- Instead of linking in libs like this we now do them optional. After all, once
+-- we start adding more and more stuff statically we en dup with a mess.
+
+-- e:\tex-context\tex\texmf-win64\bin\lib\luametatex\lzma\liblzma.dll
+
+local libname = "lzma"
+local libfile = "liblzma"
+
+local lzmalib = resolvers.libraries.validoptional(libname)
+
+if not lzmalib then return end
+
+local lzma_compress = lzmalib.compress
+local lzma_decompress = lzmalib.decompress
+
+local function okay()
+ if resolvers.libraries.optionalloaded(libname,libfile) then
+ okay = function() return true end
+ else
+ okay = function() return false end
+ end
+ return okay()
+end
+
+local lzma = {
+ compress = function (...) return okay() and lzma_compress (...) end,
+ decompress = function (...) return okay() and lzma_decompress (...) end,
+}
+
+package.loaded[libname] = lzma
+
+-- local raw = io.loaddata("e:/luatex/luametatex-source.tar")
+-- local old = io.loaddata("e:/luatex/luametatex-source.tar.xz")
+-- local new = lzma.decompress(old)
+-- local xz1 = lzma.compress(raw,9)
+-- local xz2 = lzma.decompress(xz1)
+
+-- print("raw",raw and #raw)
+-- print("old",old and #old)
+-- print("new",new and #new)
+-- print("chk",new == raw)
+-- print("xz1",xz1 and #xz1)
+-- print("xz2",xz2 and #xz2)
+-- print("chk",xz2 == raw)
+
+return lzma
diff --git a/Master/texmf-dist/tex/context/base/mkxl/libs-imp-lzo.lmt b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-lzo.lmt
new file mode 100644
index 00000000000..1cc84a9e388
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-lzo.lmt
@@ -0,0 +1,37 @@
+if not modules then modules = { } end modules ['libs-imp-lzo'] = {
+ version = 1.001,
+ comment = "companion to luat-lib.mkxl",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- https://packages.msys2.org/package/mingw-w64-x86_64-lzo2?repo=mingw64
+
+local libname = "lzo"
+local libfile = "liblzo"
+
+local lzolib = resolvers.libraries.validoptional(libname)
+
+if not lzolib then return end
+
+local lzo_compress = lzolib.compress
+local lzo_decompresssize = lzolib.decompresssize
+
+local function okay()
+ if resolvers.libraries.optionalloaded(libname,libfile) then
+ okay = function() return true end
+ else
+ okay = function() return false end
+ end
+ return okay()
+end
+
+local lzo = {
+ compress = function (...) return okay() and lzo_compress (...) end,
+ decompresssize = function (...) return okay() and lzo_decompresssize(...) end,
+}
+
+package.loaded[libname] = lzo
+
+return lzo
diff --git a/Master/texmf-dist/tex/context/base/mkxl/libs-imp-mujs.mkxl b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-mujs.mkxl
index a8fe5801f39..5a64f6fc8c4 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/libs-imp-mujs.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-mujs.mkxl
@@ -31,7 +31,6 @@
\protected\def\startecmacode % \stopecmacode
{\begingroup
- \obeylualines
\obeyluatokens
\luat_start_ecma_code_indeed}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/libs-imp-zint.lmt b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-zint.lmt
index 2c346ae7d5f..0ae3b12967d 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/libs-imp-zint.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-zint.lmt
@@ -28,8 +28,9 @@ utilities.zint = zint
local zintlib_execute = zintlib.execute
-local next, type, unpack = next, type, unpack
+local next, type, unpack, rawget = next, type, unpack, rawget
local lower, gsub = string.lower, string.gsub
+local formatters = string.formatters
local mapping = {
["code 11"] = 1, ["pharma one-track"] = 51, ["aztec code"] = 92,
@@ -65,6 +66,12 @@ local mapping = {
["logmars"] = 50, ["kix code"] = 90, ["rmqr"] = 145,
}
+for k, v in table.sortedhash(mapping) do
+ mapping[gsub(lower(k),"[^a-z0-9]","")]= v
+end
+
+mapping.qr = mapping.qrcode
+
table.setmetatableindex(mapping,function(t,k)
local s = gsub(lower(k),"[^a-z0-9]","")
local v = rawget(t,s) or false
@@ -72,21 +79,52 @@ table.setmetatableindex(mapping,function(t,k)
return v
end)
+-- local options = {
+-- -- DATA_MODE = 0 -- Binary
+-- -- UNICODE_MODE = 1 -- UTF-8
+-- -- GS1_MODE = 2 -- GS1
+-- -- GS1PARENS_MODE = 16 -- process parentheses as GS1 AI delimiters (instead of square brackets)
+-- square = 100 -- DM_SQUARE : only consider square versions on automatic symbol size selection
+-- -- DMRE = 101 -- DM_DMRE : consider DMRE versions on automatic symbol size selection
+-- }
+
local report = logs.reporter("zint")
local context = context
local shown = false
+local sqrt = math.sqrt
+
+local f_rectangle = formatters["( unitsquare xyscaled (%N,-%N) shifted (%N,-%N) )"]
+local f_hexagon = formatters["( fullhexagon scaled %N shifted (%N,-%N) )"]
+local f_circle = formatters["( fullcircle scaled %N shifted (%N,-%N) )"]
+local f_string = formatters['draw textext("%s") scaled (%N/10) shifted (%N,-%N);']
------ f_rectangle = string.formatters["%sofill unitsquare xysized (%N,%N) shifted (%N,%N);"]
+local aliases = {
+ isbnx = "isbn",
+ ISBNX = "ISBN",
+}
local function execute(specification)
if okay() then
- local code = specification.code
- local text = specification.text
+ local code = specification.code
+ local text = specification.text
+ local option = specification.option
+ --
+ if option then
+ option = gsub(option,"^%-+","")
+ end
+ specification.option = option
+ --
if code then
+ code = aliases[code] or code
+ --
+ if lower(code) == "isbn" then
+ specification.text = text and gsub(text,"[^%d]","") or ""
+ end
+ --
local id = mapping[code]
if id then
specification.code = id
- local result = zintlib_execute(specification)
+ local result, detail = zintlib_execute(specification)
if result then
-- not that fast but if needed we can speed it up
context.startMPcode()
@@ -98,36 +136,39 @@ local function execute(specification)
local n = #rectangles
for i=1,n do
local r = rectangles[i]
- context("%sofill unitsquare xysized (%N,%N) shifted (%N,%N);",
- i == n and "d" or "n",r[3],r[4],r[1],r[2])
- -- rectangles[i] = f_rectangle(i == n and "d" or "n",r[3],r[4],r[1],r[2])
+ rectangles[i] = f_rectangle(r[3],r[4],r[1],r[2])
end
- -- context("% t",rectangles)
+ context("fill % && t && cycle;",rectangles)
end
if hexagons then
local n = #hexagons
- for i=1,#hexagons do
- context("%sofill (%N,%N)--(%N,%N)--(%N,%N)--(%N,%N)--(%N,%N)--(%N,%N)--cycle;",
- i == n and "d" or "n",unpack(hexagons[i]))
+ local s = sqrt(2) / 2 -- can be finetuned if needed
+ for i=1,n do
+ local h = hexagons[i]
+ hexagons[i] = f_hexagon(s*h[3],h[1],h[2])
end
+ context("fill % && t && cycle;",hexagons)
end
if circles then
local n = #circles
- for i=1,#circles do
+ for i=1,n do
local c = circles[i]
- context("%sofill unitcircle scaled %N shifted (%N,%N);",
- i == n and "d" or "n",c[3],c[1],c[2])
+ circles[i] = f_circle(c[3],c[1],c[2])
end
+ context("eofill % && t && cycle;",circles)
end
if strings then
-- We set the font at the encapsulating level.
- for i=1,#strings do
+ local n = #strings
+ for i=1,n do
local s = strings[i]
- context('draw textext("%s") scaled (%N/10) shifted (%N,%N);',
- s[4],s[3],s[1],s[2])
+ strings[i] = f_string(s[4],s[3],s[1],s[2])
end
+ context("% t",strings)
end
context.stopMPcode()
+ else
+ report("something went wrong: %s",detail or "unknown error")
end
else
report("unknown barcode alternative %a",code)
@@ -156,6 +197,7 @@ interfaces.implement {
{
{ "code" },
{ "text" },
+ { "option" },
}
}
}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/libs-imp-zint.mkxl b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-zint.mkxl
index b2adf05ad82..9905e047095 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/libs-imp-zint.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-zint.mkxl
@@ -11,16 +11,18 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-%D Using \type {zint} seems to be the easiest way to generate
-%D (PDF417) barcodes so therefore we now have this module. There
-%D are proper (also windows) binaries at:
+%D Using \type {zint} seems to be the easiest way to generate (PDF417) barcodes so
+%D therefore we now have this module. There are proper (also windows) binaries at:
%D
%D \starttyping
%D http://www.zint.org.uk
%D \stoptyping
%D
-%D There is a bit more code than needed as we want to be able to
-%D feed names.
+%D There is a bit more code than needed as we want to be able to feed names.
+%D
+%D % e:\tex-context\tex\texmf-win64\bin\lib\luametatex\zint\libzint.dll
+
+% \enabletrackers[*res*]
\registerctxluafile{libs-imp-zint}{autosuffix}
@@ -32,13 +34,14 @@
{\bgroup
\usedzintfont
\getdummyparameters
- [\c!alternative=,\c!text=,#1]%
+ [\c!alternative=,\c!text=,\c!option=,#1]%
\scale
[#1]%
{\clf_zint
- code {\dummyparameter\c!alternative}
- text {\dummyparameter\c!text}
- \relax}
+ code {\dummyparameter\c!alternative}
+ text {\dummyparameter\c!text}
+ option {\dummyparameter\c!option}
+ \relax}%
\egroup}
\protect
@@ -47,18 +50,78 @@
\starttext
-% \dorecurse{1000}{
+\dontcomplain
+
+% \dorecurse{1}{
+% \startTEXpage
+% \barcode[alternative=PDF417,text={Hans Hagen}]%
+% \blank
+% \barcode[alternative=PDF417,text={Ton Otten}]%
+% \blank
+% \barcode[alternative=ISBN,text=9789490688011]%
+% \blank
+% \barcode[alternative=isbn,text=9789490688011,width=3cm]%
+% \blank
+% \dontleavehmode
+% \barcode[alternative=qr code,text={This is ConTeXt MKIV : #1}]
+% \barcode[alternative=qr code,text={This is ConTeXt LMTX}]
+% \barcode[alternative=qr code,text={\cldloadfile{tufte}},width=3cm]
+% \blank
+% \barcode[alternative=datamatrix,text=whatever,width=3cm,option=square]
+% \scale[width=3cm,height=3cm]{\barcode[alternative=datamatrix,text=whatever,width=3cm,option=square]}
+% \barcode[alternative=datamatrix,text={helloworld}]
+% \barcode[alternative=datamatrix,text={hello world}]
+% \stopTEXpage
+% }
+
\startTEXpage
- \barcode[alternative=PDF417,text={Hans Hagen}]%
- \blank
- \barcode[alternative=PDF417,text={Ton Otten}]%
- \blank
- \barcode[alternative=ISBN,text=9789490688011]%
- \blank
- \barcode[alternative=isbn,text=9789490688011,width=3cm]%
+ \startluacode
+ for i=1,100 do
+ context.dontleavehmode()
+ context.barcode {
+ alternative = "datamatrix",
+ text = string.rep("!",i),
+ }
+ context.space()
+ context.allowbreak()
+ end
+ \stopluacode
+ \stopTEXpage
+
+ \startTEXpage
+ \startluacode
+ for i=1,100 do
+ context.dontleavehmode()
+ context.barcode {
+ alternative = "datamatrix",
+ text = string.rep("!",i),
+ option = "square",
+ }
+ context.space()
+ context.allowbreak()
+ end
+ \stopluacode
\stopTEXpage
-% }
+ \startluacode
+ for i=1,25 do
+ context.startTEXpage()
+ context.dontleavehmode()
+ context(i)
+ context.space()
+ context.barcode {
+ alternative = "datamatrix",
+ text = string.rep("!",i),
+ }
+ context.space()
+ context.barcode {
+ alternative = "datamatrix",
+ text = string.rep("!",i),
+ option = "square",
+ }
+ context.stopTEXpage()
+ end
+ \stopluacode
\stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkxl/libs-imp-zstd.lmt b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-zstd.lmt
new file mode 100644
index 00000000000..958c34cc45c
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/libs-imp-zstd.lmt
@@ -0,0 +1,98 @@
+if not modules then modules = { } end modules ['libs-imp-zstd'] = {
+ version = 1.001,
+ comment = "companion to luat-lib.mkxl",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- Instead of linking in libs like this we now do them optional. After all, once
+-- we start adding more and more stuff statically we en dup with a mess. In fact,
+-- this lib was the reason for no longer embedding lzo and lz4.
+
+-- c:/data/develop/tex-context/tex/texmf-win64/bin/lib/luametatex/lua/copies/curl/libzstd.dll
+
+-- require("libs-imp-zstd.lmt") -- only loads
+--
+-- local zstd = require("zstd") -- activates
+--
+-- local data = io.loaddata("t:/sources/char-def.lua")
+-- local comp = zstd.compress (data)
+-- local back = zstd.decompress(comp)
+--
+-- print(#data,#comp,#back,#back==#data)
+
+local libname = "zstd"
+local libfile = "libzstd"
+
+local zstdlib = resolvers.libraries.validoptional(libname)
+
+if not zstdlib then return end
+
+local zstd_compress = zstdlib.compress
+local zstd_decompress = zstdlib.decompress
+
+local function okay()
+ if resolvers.libraries.optionalloaded(libname,libfile) then
+ okay = function() return true end
+ else
+ okay = function() return false end
+ end
+ return okay()
+end
+
+local zstd = {
+ compress = function (s) return okay() and zstd_compress (s) end,
+ decompress = function (s) return okay() and zstd_decompress(s) end,
+}
+
+package.loaded[libname] = zstd
+
+return zstd
+
+-- local foreign = optional.loaded.foreign
+-- local newbuffer = foreign.newbuffer
+-- local getbuffer = foreign.getbuffer
+--
+-- local zstd = foreign.load("libzstd")
+--
+-- local ZSTD_compressBound = zstd:register {
+-- name = "ZSTD_compressBound",
+-- result = "int",
+-- arguments = { "int" },
+-- }
+--
+-- local ZSTD_getFrameContentSize = zstd:register {
+-- name = "ZSTD_getFrameContentSize",
+-- result = "int",
+-- arguments = { "pointer", "int" },
+-- }
+--
+-- local ZSTD_compress = zstd:register {
+-- name = "ZSTD_compress",
+-- result = "int",
+-- arguments = { "pointer", "int", "string", "int", "int" },
+-- arguments = { "pointer", "int", "pointer", "int", "int" },
+-- }
+--
+-- local ZSTD_decompress = zstd:register {
+-- name = "ZSTD_decompress",
+-- result = "int",
+-- arguments = { "pointer", "int", "string", "int" },
+-- }
+--
+-- local function zstd_compress(source,level)
+-- local sourcesize = #source
+-- local targetsize = ZSTD_compressBound(sourcesize)
+-- local target = newbuffer(targetsize)
+-- local result = ZSTD_compress(target,targetsize,source,sourcesize,tonumber(level) or 3)
+-- return getbuffer(target,result)
+-- end
+--
+-- local function zstd_decompress(source)
+-- local sourcesize = #source
+-- local targetsize = ZSTD_getFrameContentSize(source,sourcesize)
+-- local target = newbuffer(targetsize)
+-- local result = ZSTD_decompress(target,targetsize,source,sourcesize)
+-- return getbuffer(target,result)
+-- end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/libs-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/libs-ini.lmt
new file mode 100644
index 00000000000..4ce0e8e503d
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/libs-ini.lmt
@@ -0,0 +1,206 @@
+if not modules then modules = { } end modules ['libs-ini'] = {
+ version = 1.001,
+ comment = "companion to luat-lib.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- This is a loader for optional libraries in luametatex with context lmtx. It's
+-- kind of experimental. We also use a different locator than in mkiv because we
+-- don't support loading lua libraries and swiglibs any more. Of course one can try
+-- the regular lua loaders but we just assume that a user then knows what (s)he is
+-- doing. At some point this variant will divert more from the original loader
+-- file 'libs-ini.lua'.
+
+local type, unpack = type, unpack
+local find = string.find
+
+-- here we implement the resolver
+
+local nameonly = file.nameonly
+local joinfile = file.join
+local addsuffix = file.addsuffix
+local qualifiedpath = file.is_qualified_path
+
+local isfile = lfs.isfile
+
+local findfile = resolvers.findfile
+local expandpaths = resolvers.expandedpathlistfromvariable
+
+local report = logs.reporter("resolvers","libraries")
+local trace = false
+local silent = false
+
+trackers.register("resolvers.lib", function(v) trace = v end)
+trackers.register("resolvers.lib.silent", function(v) silent = v end)
+
+local function findlib(required) -- todo: cache
+ local suffix = os.libsuffix or "so"
+ if not qualifiedpath(required) then
+ local list = directives.value("system.librarynames" )
+ local only = nameonly(required)
+ if type(list) == "table" then
+ list = list[only]
+ if type(list) ~= "table" then
+ list = { only }
+ end
+ else
+ list = { only }
+ end
+ if trace then
+ report("using lookup list for library %a: % | t",only,list)
+ end
+ for i=1,#list do
+ local name = list[i]
+ local found = findfile(name,"lib")
+ if not found or found == "" then
+ found = findfile(addsuffix(name,suffix),"lib")
+ end
+ if found and found ~= "" then
+ if trace then
+ report("library %a resolved via %a path to %a",name,"tds lib",found)
+ end
+ return found
+ end
+ end
+ if expandpaths then
+ local list = expandpaths("PATH")
+ local base = addsuffix(only,suffix)
+ for i=1,#list do
+ local full = joinfile(list[i],base)
+ local found = isfile(full) and full
+ if found and found ~= "" then
+ if trace then
+ report("library %a resolved via %a path to %a",full,"system",found)
+ end
+ return found
+ end
+ end
+ end
+ elseif isfile(addsuffix(required,suffix)) then
+ if trace then
+ report("library with qualified name %a %sfound",required,"")
+ end
+ return required
+ else
+ if trace then
+ report("library with qualified name %a %sfound",required,"not ")
+ end
+ end
+ return false
+end
+
+local foundlibraries = table.setmetatableindex(function(t,k)
+ local v = findlib(k)
+ t[k] = v
+ return v
+end)
+
+function resolvers.findlib(required)
+ return foundlibraries[required]
+end
+
+-- here we implement the loader
+
+local libraries = { }
+resolvers.libraries = libraries
+
+local report = logs.reporter("optional")
+
+if optional then optional.loaded = { } end
+
+function libraries.validoptional(name)
+ local thelib = optional and optional[name]
+ if not thelib then
+ -- forget about it, no message here
+ elseif thelib.initialize then
+ return thelib
+ else
+ report("invalid optional library %a",libname)
+ end
+end
+
+function libraries.optionalloaded(name,libnames)
+ local thelib = optional and optional[name]
+ if not thelib then
+ report("no optional %a library found",name)
+ else
+ local thelib_initialize = thelib.initialize
+ if not thelib_initialize then
+ report("invalid optional library %a",name)
+ else
+ if type(libnames) == "string" then
+ libnames = { libnames }
+ end
+ if type(libnames) == "table" then
+ for i=1,#libnames do
+ local libname = libnames[i]
+ local filename = foundlibraries[libname]
+ if filename and filename ~= "" then
+ libnames[i] = filename
+ else
+ report("unable to locate library %a",libname)
+ return
+ end
+ end
+ local initialized = thelib_initialize(unpack(libnames))
+ if not initialized then
+ report("unable to initialize library '% + t'",libnames)
+ elseif not silent then
+ report("using library '% + t'",libnames)
+ end
+ return initialized
+ end
+ end
+ end
+end
+
+-- local patterns = {
+-- "libs-imp-%s.mkxl",
+-- "libs-imp-%s.mklx",
+-- }
+--
+-- local function action(name,foundname)
+-- -- could be one command
+-- context.startreadingfile()
+-- context.input(foundname)
+-- context.stopreadingfile()
+-- end
+--
+-- interfaces.implement {
+-- name = "uselibrary",
+-- arguments = "string"
+-- actions = function(name)
+-- resolvers.uselibrary {
+-- category = "color definition",
+-- name = name,
+-- patterns = patterns,
+-- action = action,
+-- onlyonce = true,
+-- }
+-- end
+-- }
+
+-- We overload the standard 'require' function. Because we're in LuaMetaTeX we are
+-- more likely to find 'lmt' files when we deal with the TeX and MetaPost part but
+-- user files likely have the 'lua' suffix.
+
+do
+
+ local dofile = dofile
+ local savedrequire = require
+
+ function require(name,version)
+ if find(name,"%.lua$") or find(name,"%.lmt$") then
+ local m = dofile(findfile(name))
+ if m then
+ package.loaded[name] = m
+ return m
+ end
+ else
+ return savedrequire(name)
+ end
+ end
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/libs-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/libs-ini.mkxl
index d77046fbffe..bc1fe92e0e8 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/libs-ini.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/libs-ini.mkxl
@@ -11,10 +11,12 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\registerctxluafile{libs-ini}{} % shared with mkiv
+\registerctxluafile{libs-ini}{autosuffix}
-\registerctxluafile{libs-imp-curl}{autosuffix}
-\registerctxluafile{libs-imp-ghostscript}{autosuffix}
+% These are used by the graphic converters:
+
+\registerctxluafile{libs-imp-curl} {autosuffix}
+\registerctxluafile{libs-imp-ghostscript} {autosuffix}
\registerctxluafile{libs-imp-graphicsmagick}{autosuffix}
% These are loaded on demand:
@@ -22,11 +24,16 @@
% \registerctxluafile{libs-imp-mysql}{autosuffix}
% \registerctxluafile{libs-imp-sqlite}{autosuffix}
% \registerctxluafile{libs-imp-postgress}{autosuffix}
+
+% \registerctxluafile{libs-imp-lzo}{autosuffix}
+% \registerctxluafile{libs-imp-lz4}{autosuffix}
+% \registerctxluafile{libs-imp-zstd}{autosuffix}
+
% \registerctxluafile{libs-imp-kpse}{autosuffix}
+% \registerctxluafile{libs-imp-hb}{autosuffix}
\unprotect
-% \permanent\protected\def\uselibrary[#1]%
-% {\clf_uselibrary{#1}}
+% \permanent\protected\def\uselibrary[#1]{\clf_uselibrary{#1}}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-ano.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-ano.lmt
index 86bcd4ad5dd..55b145730b8 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-ano.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-ano.lmt
@@ -10,8 +10,16 @@ if not modules then modules = { } end modules ['lpdf-ano'] = {
-- todo: /AA << WC << ... >> >> : WillClose actions etc
--- internal references are indicated by a number (and turned into <autoprefix><number>)
--- we only flush internal destinations that are referred
+-- Internal references are indicated by a number (and turned into <autoprefix><number>)
+-- we only flush internal destinations that are referred.
+
+-- In the end one can wonder if it was worth the effort to keep up with annotations.
+-- Where acrobat at least supports most (can differ per version) other viewers
+-- support partial. For instance sumatra (that I use for testing) can open an
+-- external links but doesn't go to the page. So don't report issues before making
+-- sure that it's not your browser that fails. One cannto complain about what comes
+-- for free (browsers) but one should also not praise non commercial software to
+-- much without looking critical at how it performs.
local next, tostring, tonumber, rawget, type = next, tostring, tonumber, rawget, type
local rep, format, find = string.rep, string.format, string.find
@@ -20,8 +28,6 @@ local lpegmatch = lpeg.match
local formatters = string.formatters
local sortedkeys, concat = table.sortedkeys, table.concat
-local backends, lpdf = backends, lpdf
-
local trace_references = false trackers.register("references.references", function(v) trace_references = v end)
local trace_destinations = false trackers.register("references.destinations", function(v) trace_destinations = v end)
local trace_bookmarks = false trackers.register("references.bookmarks", function(v) trace_bookmarks = v end)
@@ -45,9 +51,10 @@ local settings_to_array = utilities.parsers.settings_to_array
local allocate = utilities.storage.allocate
local setmetatableindex = table.setmetatableindex
-local nodeinjections = backends.pdf.nodeinjections
-local codeinjections = backends.pdf.codeinjections
-local registrations = backends.pdf.registrations
+local pdfbackend = backends.registered.pdf
+local nodeinjections = pdfbackend.nodeinjections
+local codeinjections = pdfbackend.codeinjections
+local registrations = pdfbackend.registrations
local javascriptcode = interactions.javascripts.code
@@ -74,6 +81,7 @@ local getpos = jobpositions.getpos
local gethpos = jobpositions.gethpos
local getvpos = jobpositions.getvpos
+local lpdf = lpdf
local pdfdictionary = lpdf.dictionary
local pdfarray = lpdf.array
local pdfreference = lpdf.reference
@@ -85,21 +93,15 @@ local pdfaddtonames = lpdf.addtonames
local pdfaddtopageattributes = lpdf.addtopageattributes
local pdfrectangle = lpdf.rectangle
-local pdfflushobject
-local pdfshareobjectreference
-local pdfreserveobject
-local pdfpagereference
-local pdfdelayedobject
-local pdfregisterannotation
+local pdfflushobject = lpdf.flushobject
+local pdfshareobjectreference = lpdf.shareobjectreference
+local pdfreserveobject = lpdf.reserveobject
+local pdfpagereference = lpdf.pagereference
+local pdfdelayedobject = lpdf.delayedobject
-updaters.register("backend.update.lpdf",function()
- pdfflushobject = lpdf.flushobject
- pdfshareobjectreference = lpdf.shareobjectreference
- pdfreserveobject = lpdf.reserveobject
- pdfpagereference = lpdf.pagereference
- pdfdelayedobject = lpdf.delayedobject
- pdfregisterannotation = lpdf.registerannotation
-end)
+-- defined later on:
+
+local pdfregisterannotation
-- todo: 3dview
@@ -118,6 +120,10 @@ local pdf_named = pdfconstant("Named")
local autoprefix = "#"
local usedautoprefixes = { }
+function codeinjections.setautoprefix(prefix)
+ autoprefix = prefix ~= "" and prefix or autoprefix
+end
+
local function registerautoprefix(name)
local internal = autoprefix .. name
if usedautoprefixes[internal] == nil then
@@ -392,6 +398,8 @@ local v_minheight = variables.minheight
local v_fit = variables.fit
local v_tight = variables.tight
+local c_realpageno = tex.iscount("realpageno")
+
-- nicer is to create dictionaries and set properties but it's a bit overkill
-- The problem with the following settings is that they are guesses: we never know
@@ -472,7 +480,7 @@ end)
local function flushdestination(specification)
local names = specification.names
local view = specification.view
- local r = pdfpagereference(texgetcount("realpageno"))
+ local r = pdfpagereference(texgetcount(c_realpageno))
if (references.innermethod ~= v_name) and (view == defaultview or not view or view == "") then
r = pagedestinations[r]
else
@@ -760,6 +768,8 @@ local nofused = 0
local nofspecial = 0
local share = true
+local refobjects = { }
+
local f_annot = formatters["<< /Type /Annot %s /Rect [ %.6N %.6N %.6N %.6N ] >>"]
local f_quadp = formatters["<< /Type /Annot %s /QuadPoints [ %s ] /Rect [ %.6N %.6N %.6N %.6N ] >>"]
@@ -809,8 +819,18 @@ local function finishreference(specification)
else
specifier = f_annot(prerolled,llx,lly,urx,ury)
end
+ local objref = hashed[specifier]
+ local refatt = specification.reference
+ specification.objref = objref
nofused = nofused + 1
- return pdfregisterannotation(hashed[specifier])
+ if refatt then
+ refobjects[refatt] = objref
+ end
+ return pdfregisterannotation(objref)
+end
+
+function codeinjections.getrefobj(refatt) -- bad name but experiment anyway
+ return refobjects[refatt]
end
local function finishannotation(specification)
@@ -824,18 +844,20 @@ local function finishannotation(specification)
pdfdelayedobject(annot,objref)
else
objref = pdfdelayedobject(annot)
+ specification.objref = objref
end
nofspecial = nofspecial + 1
return pdfregisterannotation(objref)
end
-function nodeinjections.reference(width,height,depth,prerolled,mesh)
+function nodeinjections.reference(reference,width,height,depth,prerolled,mesh)
if prerolled then
if trace_references then
report_references("link: width %p, height %p, depth %p, prerolled %a",width,height,depth,prerolled)
end
return new_latelua {
action = finishreference,
+ reference = reference,
width = width,
height = height,
depth = depth,
@@ -868,15 +890,16 @@ end
local annotations = nil
-function lpdf.registerannotation(n)
+pdfregisterannotation = function(n)
if annotations then
annotations[#annotations+1] = pdfreference(n)
else
annotations = pdfarray { pdfreference(n) } -- no need to use lpdf.array cum suis
end
+ return n
end
-pdfregisterannotation = lpdf.registerannotation
+lpdf.registerannotation = pdfregisterannotation
function lpdf.annotationspecification()
if annotations then
@@ -1070,7 +1093,7 @@ end
function specials.deltapage(var,actions)
local p = tonumber(var.operation)
if p then
- p = references.checkedrealpage(p + texgetcount("realpageno"))
+ p = references.checkedrealpage(p + texgetcount(c_realpageno))
return pdflinkpage(p)
end
end
@@ -1219,31 +1242,6 @@ function executers.show(arguments)
}
end
-local pdf_movie = pdfconstant("Movie")
-local pdf_start = pdfconstant("Start")
-local pdf_stop = pdfconstant("Stop")
-local pdf_resume = pdfconstant("Resume")
-local pdf_pause = pdfconstant("Pause")
-
-local function movie_or_sound(operation,arguments)
- arguments = (type(arguments) == "table" and arguments) or settings_to_array(arguments)
- return pdfdictionary {
- S = pdf_movie,
- T = format("movie %s",arguments[1] or "noname"),
- Operation = operation,
- }
-end
-
-function executers.startmovie (arguments) return movie_or_sound(pdf_start ,arguments) end
-function executers.stopmovie (arguments) return movie_or_sound(pdf_stop ,arguments) end
-function executers.resumemovie(arguments) return movie_or_sound(pdf_resume,arguments) end
-function executers.pausemovie (arguments) return movie_or_sound(pdf_pause ,arguments) end
-
-function executers.startsound (arguments) return movie_or_sound(pdf_start ,arguments) end
-function executers.stopsound (arguments) return movie_or_sound(pdf_stop ,arguments) end
-function executers.resumesound(arguments) return movie_or_sound(pdf_resume,arguments) end
-function executers.pausesound (arguments) return movie_or_sound(pdf_pause ,arguments) end
-
function specials.action(var)
local operation = var.operation
if var.operation and operation ~= "" then
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-aux.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-aux.lmt
index 91636ad04e0..441f4cf9c3a 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-aux.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-aux.lmt
@@ -11,7 +11,7 @@ local format, concat = string.format, table.concat
local utfchar, utfbyte, char = utf.char, utf.byte, string.char
local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns
local P, C, R, S, Cc, Cs, V = lpeg.P, lpeg.C, lpeg.R, lpeg.S, lpeg.Cc, lpeg.Cs, lpeg.V
-local rshift = bit32.rshift
+----- rshift = bit32.rshift
lpdf = lpdf or { }
@@ -23,7 +23,8 @@ local cache = table.setmetatableindex(function(t,k) -- can be made weak
v = format("%04x",v)
else
v = v - 0x10000
- v = format("%04x%04x",rshift(v,10)+0xD800,v%1024+0xDC00)
+ -- v = format("%04x%04x",rshift(v,10)+0xD800,v%1024+0xDC00)
+ v = format("%04x%04x",(v >> 10) + 0xD800,v%1024+0xDC00)
end
t[k] = v
return v
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-col.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-col.lmt
index ea60e0551d8..c1499b75e4e 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-col.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-col.lmt
@@ -13,35 +13,29 @@ local concat = table.concat
local round = math.round
local formatters = string.formatters
-local backends, lpdf, nodes = backends, lpdf, nodes
-
local allocate = utilities.storage.allocate
-local nodeinjections = backends.pdf.nodeinjections
-local codeinjections = backends.pdf.codeinjections
-local registrations = backends.pdf.registrations
+local pdfbackend = backends.registered.pdf
+local nodeinjections = pdfbackend.nodeinjections
+local codeinjections = pdfbackend.codeinjections
+local registrations = pdfbackend.registrations
+local nodes = nodes
local nodepool = nodes.nuts.pool
local register = nodepool.register
local setstate = nodepool.setstate
+local lpdf = lpdf
local pdfconstant = lpdf.constant
local pdfdictionary = lpdf.dictionary
local pdfarray = lpdf.array
local pdfreference = lpdf.reference
local pdfverbose = lpdf.verbose
-local pdfflushobject
-local pdfdelayedobject
-local pdfflushstreamobject
-local pdfshareobjectreference
-
-updaters.register("backend.update.lpdf",function()
- pdfflushobject = lpdf.flushobject
- pdfdelayedobject = lpdf.delayedobject
- pdfflushstreamobject = lpdf.flushstreamobject
- pdfshareobjectreference = lpdf.shareobjectreference
-end)
+local pdfflushobject = lpdf.flushobject
+local pdfdelayedobject = lpdf.delayedobject
+local pdfflushstreamobject = lpdf.flushstreamobject
+local pdfshareobjectreference = lpdf.shareobjectreference
local addtopageattributes = lpdf.addtopageattributes
local adddocumentcolorspace = lpdf.adddocumentcolorspace
@@ -553,7 +547,9 @@ end
lpdf.color = lpdfcolor
interfaces.implement {
- name = "lpdf_color",
+ name = "pdfcolor",
+ public = true,
+ untraced = true,
actions = { lpdfcolor, context },
arguments = "integer"
}
@@ -585,7 +581,7 @@ function lpdf.pdfcolor(attribute) -- bonus, for pgf and friends
return lpdfcolor(1,attribute)
end
-function lpdf.transparency(ct,default) -- kind of overlaps with transparencycode
+local function lpdftransparency(ct,default) -- kind of overlaps with transparencycode
-- beware, we need this hack because normally transparencies are not
-- yet registered and therefore the number is not not known ... we
-- might use the attribute number itself in the future
@@ -601,6 +597,8 @@ function lpdf.transparency(ct,default) -- kind of overlaps with transparencycode
end
end
+lpdf.transparency = lpdftransparency
+
function lpdf.colorvalue(model,ca,default)
local cv = colorsvalue(ca)
if cv then
@@ -673,11 +671,10 @@ end
-- by registering we getconversion for free (ok, at the cost of overhead)
local intransparency = false
-local pdfcolor = lpdf.color
function lpdf.rgbcode(model,r,g,b)
if colors.supported then
- return pdfcolor(model,registercolor(nil,'rgb',r,g,b))
+ return lpdfcolor(model,registercolor(nil,'rgb',r,g,b))
else
return ""
end
@@ -685,7 +682,7 @@ end
function lpdf.cmykcode(model,c,m,y,k)
if colors.supported then
- return pdfcolor(model,registercolor(nil,'cmyk',c,m,y,k))
+ return lpdfcolor(model,registercolor(nil,'cmyk',c,m,y,k))
else
return ""
end
@@ -693,7 +690,7 @@ end
function lpdf.graycode(model,s)
if colors.supported then
- return pdfcolor(model,registercolor(nil,'gray',s))
+ return lpdfcolor(model,registercolor(nil,'gray',s))
else
return ""
end
@@ -701,7 +698,7 @@ end
function lpdf.spotcode(model,n,f,d,p)
if colors.supported then
- return pdfcolor(model,registercolor(nil,'spot',n,f,d,p)) -- incorrect
+ return lpdfcolor(model,registercolor(nil,'spot',n,f,d,p)) -- incorrect
else
return ""
end
@@ -727,18 +724,12 @@ end
do
- local pdfprint, pdfcolor, pdftransparency
-
- updaters.register("backend.update.lpdf",function()
- pdfprint = lpdf.print
- pdfcolor = lpdf.color
- pdftransparency = lpdf.transparency
- end)
+ local lpdfprint = lpdf.print
local c_cache = setmetatableindex(function(t,m)
-- We inherit the outer transparency.
local v = setmetatableindex(function(t,c)
- local p = "q " .. pdfcolor(m,c)
+ local p = "q " .. lpdfcolor(m,c)
t[c] = p
return p
end)
@@ -747,10 +738,10 @@ do
end)
local t_cache = setmetatableindex(function(t,transparency)
- local p = pdftransparency(transparency)
+ local p = lpdftransparency(transparency)
local v = setmetatableindex(function(t,colormodel)
local v = setmetatableindex(function(t,color)
- local v = "q " .. pdfcolor(colormodel,color) .. " " .. p
+ local v = "q " .. lpdfcolor(colormodel,color) .. " " .. p
t[color] = v
return v
end)
@@ -761,35 +752,29 @@ do
return v
end)
- updaters.register("backend.update.lpdf",function()
-
- local vfinjectors = fonts.helpers.vfinjectors
-
- vfinjectors.pdf = function(pos_h,pos_v,packet)
- pdfprint(packet[2],packet[3])
- end
-
- vfinjectors.startcolor = function(pos_h,pos_v,packet)
- local color = type(packet) == "table" and packet[2] or packet
- if color then
- local m, c = colortoattributes(color)
- local t = transparencytoattribute(color)
- if t and t ~= unsetvalue then
- pdfprint("page", t_cache[t][m][c]) -- "q " .. pdfcolor(m,c) .. " " .. pdftransparency(t)
- else
- pdfprint("page", c_cache[m][c]) -- "q " .. pdfcolor(m,c))
- end
+ -- function codeinjections.vfliteral(pos_h,pos_v,packet)
+ -- lpdfprint(packet[2],packet[3])
+ -- end
+
+ function codeinjections.vfstartcolor(pos_h,pos_v,packet)
+ local color = type(packet) == "table" and packet[2] or packet
+ if color then
+ local m, c = colortoattributes(color)
+ local t = transparencytoattribute(color)
+ if t and t ~= unsetvalue then
+ lpdfprint("page", t_cache[t][m][c]) -- "q " .. lpdfcolor(m,c) .. " " .. lpdftransparency(t)
else
- pdfprint("page", "q")
+ lpdfprint("page", c_cache[m][c]) -- "q " .. lpdfcolor(m,c))
end
+ else
+ lpdfprint("page", "q")
end
+ end
- vfinjectors.stopcolor = function()
- -- pdfprint("text", "Q")
- pdfprint("page", "Q")
- end
-
- end)
+ function codeinjections.vfstopcolor()
+ -- lpdfprint("text", "Q")
+ lpdfprint("page", "Q")
+ end
end
@@ -797,19 +782,16 @@ end
do
- local color = lpdf.color
- local transparency = lpdf.transparency
-
local fonts = { }
lpdf.fonts = fonts
fonts.color_indirect = function(c,t)
if c and t then
- return color(1,c) .. " " .. transparency(t)
+ return lpdfcolor(1,c) .. " " .. lpdftransparency(t)
elseif c then
- return color(1,c)
+ return lpdfcolor(1,c)
elseif t then
- return transparency(t)
+ return lpdftransparency(t)
else
return false
end
@@ -818,8 +800,8 @@ do
local colors = attributes.colors
local rgbtocmyk = colors.rgbtocmyk
- local f_cmyk = formatters["%.3N %.3f %.3N %.3N k"]
- local f_rgb = formatters["%.3N %.3f %.3N rg"]
+ local f_cmyk = formatters["%.3N %.3N %.3N %.3N k"]
+ local f_rgb = formatters["%.3N %.3N %.3N rg"]
local f_gray = formatters["%.3N g"]
fonts.color_direct = function(r,g,b)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-emb.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-emb.lmt
index 4337e5931dd..f63dcf6ef75 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-emb.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-emb.lmt
@@ -38,8 +38,6 @@ local format = string.format
local concat, sortedhash, sort = table.concat, table.sortedhash, table.sort
local utfchar = utf.char
local random, round, max, abs, ceiling = math.random, math.round, math.max, math.abs, math.ceiling
-local extract, lshift, rshift, band, bor = bit32.extract, bit32.lshift, bit32.rshift, bit32.band, bit32.bor
-local idiv = number.idiv
local setmetatableindex = table.setmetatableindex
local pdfnull = lpdf.null
@@ -49,15 +47,9 @@ local pdfconstant = lpdf.constant
local pdfstring = lpdf.string
local pdfreference = lpdf.reference
-local pdfreserveobject
-local pdfflushobject
-local pdfflushstreamobject
-
-updaters.register("backend.update.lpdf",function()
- pdfreserveobject = lpdf.reserveobject
- pdfflushobject = lpdf.flushobject
- pdfflushstreamobject = lpdf.flushstreamobject
-end)
+local pdfreserveobject = lpdf.reserveobject
+local pdfflushobject = lpdf.flushobject
+local pdfflushstreamobject = lpdf.flushstreamobject
local report_fonts = logs.reporter("backend","fonts")
@@ -68,7 +60,8 @@ local dimenfactors = number.dimenfactors
local bpfactor = dimenfactors.bp
local ptfactor = dimenfactors.pt
-trackers.register("backend.pdf.fonts",function(v) trace_fonts = v end)
+trackers.register("backend.fonts", function(v) trace_fonts = v end)
+trackers.register("backend.fonts.details",function(v) trace_details = v end)
local readers = fonts.handlers.otf.readers
local getinfo = readers.getinfo
@@ -82,37 +75,47 @@ local getmapentry = fonts.mappings.getentry
-- needs checking: signed vs unsigned
+-- todo: use streams.tocardinal4 etc
+
local tocardinal1 = char
local function tocardinal2(n)
- return char(extract(n,8,8),extract(n,0,8))
+ -- return char(extract8(n,8),extract8(n,0))
+ return char((n>>8)&0xFF,(n>>0)&0xFF)
end
local function tocardinal3(n)
- return char(extract(n,16,8),extract(n,8,8),extract(n,0,8))
+ -- return char(extract8(n,16),extract8(n,8),extract8(n,0))
+ return char((n>>16)&0xFF,(n>>8)&0xFF,(n>>0)&0xFF)
end
local function tocardinal4(n)
- return char(extract(n,24,8),extract(n,16,8),extract(n,8,8),extract(n,0,8))
+ -- return char(extract8(n,24),extract8(n,16),extract8(n,8),extract8(n,0))
+ return char((n>>24)&0xFF,(n>>16)&0xFF,(n>>8)&0xFF,(n>>0)&0xFF)
end
local function tointeger2(n)
- return char(extract(n,8,8),extract(n,0,8))
+ -- return char(extract8(n,8),extract8(n,0))
+ return char((n>>8)&0xFF,(n>>0)&0xFF)
end
local function tointeger3(n)
- return char(extract(n,16,8),extract(n,8,8),extract(n,0,8))
+ -- return char(extract8(n,16),extract8(n,8),extract8(n,0))
+ return char((n>>16)&0xFF,(n>>8)&0xFF,(n>>0)&0xFF)
end
local function tointeger4(n)
- return char(extract(n,24,8),extract(n,16,8),extract(n,8,8),extract(n,0,8))
+ -- return char(extract8(n,24),extract8(n,16),extract8(n,8),extract8(n,0))
+ return char((n>>24)&0xFF,(n>>16)&0xFF,(n>>8)&0xFF,(n>>0)&0xFF)
end
local function tocardinal8(n)
- local l = idiv(n,0x100000000)
+ local l = n // 0x100000000
local r = n % 0x100000000
- return char(extract(l,24,8),extract(l,16,8),extract(l,8,8),extract(l,0,8),
- extract(r,24,8),extract(r,16,8),extract(r,8,8),extract(r,0,8))
+ -- return char(extract8(l,24) & 0xFF,extract8(l,16) & 0xFF,extract8(l,8) & 0xFF,extract8(l,0) & 0xFF,
+ -- extract8(r,24) & 0xFF,extract8(r,16) & 0xFF,extract8(r,8) & 0xFF,extract8(r,0) & 0xFF)
+ return char((l>>24)&0xFF,(l>>16)&0xFF,(l>>8)&0xFF,(l>>0)&0xFF,
+ (r>>24)&0xFF,(r>>16)&0xFF,(r>>8)&0xFF,(r>>0)&0xFF)
end
-- A couple of shared helpers.
@@ -130,7 +133,7 @@ do
local tounicode = fonts.mappings.tounicode
-local tounicode_template = [[
+local tounicode_template <const> = [[
%%!PS-Adobe-3.0 Resource-CMap
%%%%DocumentNeededResources: ProcSet (CIDInit)
%%%%IncludeResource: ProcSet (CIDInit)
@@ -176,7 +179,7 @@ end
if unicode then
unicode = tounicode(unicode)
else
- unicode = "FFFD"
+ unicode = "FFFD" -- wide only
end
mapping[length] = f_mapping(index,unicode)
end
@@ -189,11 +192,11 @@ end
return blob
end
- widtharray = function(details,indices,maxindex,units)
+ widtharray = function(details,indices,maxindex,units,correction)
local widths = pdfarray()
- local length = 0
- local factor = 10000 / units
if maxindex > 0 then
+ local length = 0
+ local factor = 10000 / (units * (correction or 1))
local lastindex = -1
local sublist = nil
for index=1,maxindex do
@@ -201,8 +204,10 @@ end
if data then
local width = data.width -- hm, is inaccurate for cff, so take from elsewhere
if width then
- -- width = round(width * 10000 / units) / 10
- width = round(width * factor) / 10
+ if correction then
+ -- width = round(width * 10000 / units) / 10
+ width = round(width * factor) / 10
+ end
else
width = 0
end
@@ -226,42 +231,61 @@ end
return widths
end
- collectindices = function(descriptions,indices)
+ -- we need to go through indices because descriptions can be different (take
+ -- basemode remappings)
+
+ collectindices = function(descriptions,indices,used,hash)
local minindex = 0xFFFF
local maxindex = 0
local reverse = { }
- -- todo: already at definition time trigger copying streams
- -- and add extra indices ... first i need a good example of
- -- a clash
- -- for unicode, data in next, descriptions do
- -- local i = data.index or unicode
- -- if reverse[i] then
- -- print("CLASH")
- -- else
- -- reverse[i] = data
- -- end
- -- end
+ local copies = { }
+ local include = { }
+ local resolved = { }
+
+ setmetatable(used,nil) -- prevent more index allocations
for unicode, data in next, descriptions do
- reverse[data.index or unicode] = data
+ local index = data.index
+ reverse[index or unicode] = data
+ if used[index] and data.dupindex then
+ copies[index] = data.dupindex
+ end
end
- for index in next, indices do
- if index > maxindex then
- maxindex = index
+ for index, usedindex in next, indices do
+ if usedindex > maxindex then
+ maxindex = usedindex
end
- if index < minindex then
- minindex = index
+ if usedindex < minindex then
+ minindex = usedindex
end
- indices[index] = reverse[index]
+ include[usedindex] = copies[index] or index
+ resolved[usedindex] = reverse[index]
end
if minindex > maxindex then
minindex = maxindex
end
- return indices, minindex, maxindex
+ if trace_details then
+ report_fonts("embedded: hash %a, minindex %i, maxindex %i",hash,minindex,maxindex)
+ for k, v in sortedhash(include) do
+ local d = resolved[k]
+ if d.dupindex then
+ report_fonts(" 0x%04X : 0x%04X (duplicate 0x%05X)",k,v,d.index)
+ else
+ report_fonts(" 0x%04X : 0x%04X",k,v)
+ end
+ end
+ end
+ return resolved, include, minindex, maxindex
end
includecidset = false
forcecidset = false -- for private testing only
+ function lpdf.setincludecidset(v)
+ -- incredible ... it's obselete, no viewer needs it so why still this crap
+ -- so in the end it had to be introduced again
+ includecidset = v
+ end
+
directives.register("backend.pdf.forcecidset",function(v)
forcecidset = v
end)
@@ -269,16 +293,16 @@ end
tocidsetdictionary = function(indices,min,max)
if includecidset or forcecidset then
local b = { }
- local m = idiv(max+7,8)
+ local m = (max + 7) // 8
for i=0,max do
b[i] = 0
end
- b[0] = bor(b[0],lshift(1,7)) -- force notdef into the file
+ b[0] = b[0] | (1 << 7) -- force notdef into the file
for i=min,max do
if indices[i] then
- local bi = idiv(i,8)
+ local bi = i // 8
local ni = i % 8
- b[bi] = bor(b[bi],lshift(1,7-ni))
+ b[bi] = b[bi] | (1 << (7-ni))
end
end
b = char(unpack(b,0,#b))
@@ -425,7 +449,7 @@ do
"fullname", "postscriptname",
}
- local template = [[
+ local template <const> = [[
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
@@ -473,12 +497,12 @@ do
local i = 1
local k = 0
while i <= count do
- i = lshift(i,1)
+ i = i << 1
k = k + 1
end
- local searchrange = lshift(i,3)
+ local searchrange = i << 3
local entryselector = k - 1
- local rangeshift = lshift(count,4) - lshift(i,3)
+ local rangeshift = (count << 4) - (i << 3)
local index = {
tocardinal4(0x00010000), -- tables.version
tocardinal2(count),
@@ -495,7 +519,7 @@ do
if data then
local csum = checksum(data)
local dlength = #data
- local length = idiv(dlength+3,4) * 4
+ local length = ((dlength + 3) // 4) * 4
local padding = length - dlength
nl = nl + 1 ; list[nl] = data
for i=1,padding do
@@ -694,8 +718,9 @@ do
local indices = details.indices
local metabbox = { fontheader.xmin, fontheader.ymin, fontheader.xmax, fontheader.ymax }
local indices,
+ include,
minindex,
- maxindex = collectindices(descriptions,indices)
+ maxindex = collectindices(descriptions,indices,details.used,details.hash)
local glyphstreams = tablecreators.glyf(fontfile)
local locations = tablecreators.loca(fontfile)
local horizontals = tablecreators.hmtx(fontfile)
@@ -728,7 +753,7 @@ do
report_fonts("missing .notdef in font %a",basefontname)
end
-- todo: use a rep for h/v
- for index=1,minindex-1 do
+ for index=1,minindex-1 do -- no needed in new low range
locations[index] = lastoffset
h = h + 1 ; horizontals[h] = zero4
if vertical then
@@ -736,18 +761,19 @@ do
end
end
end
+
for index=minindex,maxindex do
locations[index] = lastoffset
local data = indices[index]
if data then
- local blob = blobs[index] -- we assume padding
+ local blob = blobs[include[index]] -- we assume padding
if blob and #blob > 0 then
g = g + 1 ; glyphstreams[g] = blob
- h = h + 1 ; horizontals [h] = tocardinal2(data.width or 0)
- h = h + 1 ; horizontals [h] = tocardinal2(data.boundingbox[1])
+ h = h + 1 ; horizontals [h] = tocardinal2(round(data.width or 0))
+ h = h + 1 ; horizontals [h] = tocardinal2(round(data.boundingbox[1]))
if vertical then
- v = v + 1 ; verticals[v] = tocardinal2(data.height or 0)
- v = v + 1 ; verticals[v] = tocardinal2(data.boundingbox[3])
+ v = v + 1 ; verticals[v] = tocardinal2(round(data.height or 0)) -- how about depth
+ v = v + 1 ; verticals[v] = tocardinal2(round(data.boundingbox[3]))
end
streamoffset = streamoffset + #blob
lastoffset = tocardinal4(streamoffset)
@@ -765,6 +791,7 @@ do
end
end
end
+
locations[maxindex+1] = lastoffset -- cf spec
--
local nofglyphs = maxindex + 1 -- include zero
@@ -799,7 +826,7 @@ do
--
local units = metadata.units
local basefont = pdfconstant(basefontname)
- local widths = widtharray(details,indices,maxindex,units)
+ local widths = widtharray(details,indices,maxindex,units,1)
local object = details.objectnumber
local tounicode = tounicodedictionary(details,indices,maxindex,basefontname,true)
local tocidset = tocidsetdictionary(indices,minindex,maxindex)
@@ -846,6 +873,7 @@ do
FontName = basefont,
Flags = 4,
FontBBox = fontbbox,
+-- FontMatrix = pdfarray { 0.001, 0, 0, 0.001, 0, 0 },
Ascent = scale(ascender),
Descent = scale(descender),
ItalicAngle = round(italicangle or 0),
@@ -853,7 +881,7 @@ do
StemV = scale(stemv),
XHeight = scale(xheight),
FontFile2 = pdfreference(pdfflushstreamobject(fontdata)),
- CIDSet = tocidset,
+ CIDSet = tocidset, -- no longer needed but verifyers want it
Metadata = fontmeta and pdfreference(pdfflushstreamobject(fontmeta)) or nil,
}
local parent = pdfdictionary {
@@ -905,21 +933,21 @@ do
todictinteger = function(n)
if not n then
- return char(band(139,0xFF))
+ return char(139 & 0xFF)
elseif n >= -107 and n <= 107 then
- return char(band(n + 139,0xFF))
+ return char((n + 139) & 0xFF)
elseif n >= 108 and n <= 1131 then
n = 0xF700 + n - 108
- return char(band(rshift(n,8),0xFF),band(n,0xFF))
+ return char((n >> 8) & 0xFF, n & 0xFF)
elseif n >= -1131 and n <= -108 then
n = 0xFB00 - n - 108
- return char(band(rshift(n,8),0xFF),band(n,0xFF))
+ return char((n >> 8) & 0xFF, n & 0xFF)
elseif n >= -32768 and n <= 32767 then
- -- return int2tag .. tointeger2(n)
- return char(28,extract(n,8,8),extract(n,0,8))
+ -- return char(28,extract8(n,8),extract8(n,0))
+ return char(28,(n>>8)&0xFF,(n>>0)&0xFF)
else
- -- return int4tag .. tointeger4(n)
- return char(29,extract(n,24,8),extract(n,16,8),extract(n,8,8),extract(n,0,8))
+ -- return char(29,extract8(n,24&0xFF,extract8(n,16),extract8(n,8),extract8(n,0))
+ return char(29,(n>>24)&0xFF,(n>>16)&0xFF,(n>>8)&0xFF,(n>>0)&0xFF)
end
end
@@ -933,11 +961,11 @@ do
-- elseif n >= -1131 and n <= 1131 then
-- return encoder[n]
-- elseif n >= -32768 and n <= 32767 then
- -- -- return int2tag .. tointeger2(n)
- -- return char(28,extract(n,8,8),extract(n,0,8))
+ -- -- return char(28,extract8(n,8),extract8(n,0))
+ -- return char(28,(n>>8)&0xFF,(n>>0)&0xFF)
-- else
- -- -- return int4tag .. tointeger4(n)
- -- return char(29,extract(n,24,8),extract(n,16,8),extract(n,8,8),extract(n,0,8))
+ -- -- return char(29,extract8(n,24),extract8(n,16),extract8(n,8),extract8(n,0))
+ -- return char(29,(n>>24)&0xFF,(n>>16)&0xFF,(n>>8)&0xFF,(n>>0)&0xFF)
-- end
-- end
@@ -945,7 +973,6 @@ do
return int4tag .. tointeger4(n)
end
- local e = false
local z = byte("0")
local dp = 10
local ep = 11
@@ -959,6 +986,7 @@ do
local s = fg(v)
local t = { [0] = realtag }
local n = 0
+ local e = false
for s in gmatch(s,".") do
if s == "e" or s == "E" then
e = true
@@ -1001,6 +1029,73 @@ do
return t
end
+ -- -- An alternative
+ --
+ -- local fg = formatters["%0.14gE%i"]
+ --
+ -- todictreal = function(v)
+ -- local E = 0
+ -- if v >= 10.0 then
+ -- while v >= 10.0 do
+ -- v = v / 10.0
+ -- E = E + 1
+ -- end
+ -- elseif v < 1.0 then
+ -- while v < 1.0 do
+ -- v = v * 10.0
+ -- E = E - 1
+ -- end
+ -- end
+ -- local s = fg(v,E)
+ -- local t = { [0] = realtag }
+ -- local n = 0
+ -- local e = false
+ -- for s in gmatch(s,".") do
+ -- if s == "e" or s == "E" then
+ -- e = true
+ -- elseif s == "+" then
+ -- -- skip
+ -- elseif s == "-" then
+ -- n = n + 1
+ -- if e then
+ -- t[n] = em
+ -- e = false
+ -- else
+ -- t[n] = mn
+ -- end
+ -- else
+ -- if e then
+ -- n = n + 1
+ -- t[n] = ep
+ -- e = false
+ -- end
+ -- n = n + 1
+ -- if s == "." then
+ -- t[n] = dp
+ -- else
+ -- t[n] = byte(s) - z
+ -- end
+ -- end
+ -- end
+ -- n = n + 1
+ -- t[n] = es
+ -- if (n % 2) ~= 0 then
+ -- n = n + 1
+ -- t[n] = es
+ -- end
+ -- local j = 0
+ -- for i=1,n,2 do
+ -- j = j + 1
+ -- t[j] = char(t[i]*0x10+t[i+1])
+ -- end
+ -- -- print(v,s)
+ -- -- for i=0,j do
+ -- -- print(string.format("%02X",utf.byte(t[i])))
+ -- -- end
+ -- t = concat(t,"",0,j)
+ -- return t
+ -- end
+
todictnumber = function(n)
if not n or n == 0 then
return todictinteger(0)
@@ -1037,7 +1132,8 @@ do
local function todictdeltas(t)
local r = { }
for i=1,#t do
- r[i] = todictnumber(t[i]-(t[i-1] or 0))
+-- r[i] = todictnumber(t[i]-(t[i-1] or 0))
+ r[i] = todictnumber(t[i]+(t[i-1] or 0))
end
return concat(r)
end
@@ -1114,7 +1210,7 @@ do
--
local charstrings = fontfile.charstrings
local nofglyphs = #charstrings + 1
- local fontmatrix = { 0.001, 0, 0, 0.001, 0, 0 } -- todo
+-- local fontmatrix = { 0.001, 0, 0, 0.001, 0, 0 } -- todo
local fontbbox = fontfile.fontbbox
local defaultwidth = cffinfo.defaultwidth or 0
local nominalwidth = cffinfo.nominalwidth or 0
@@ -1127,6 +1223,8 @@ do
local bluefuzz = cffinfo.bluefuzz
local stdhw = cffinfo.stdhw
local stdvw = cffinfo.stdvw
+ local stemsnaph = cffinfo.stemsnaph
+ local stemsnapv = cffinfo.stemsnapv
--
if defaultwidth == 0 then defaultwidth = nil end
if nomimalwidth == 0 then nominalwidth = nil end
@@ -1137,8 +1235,10 @@ do
if bluescale then bluescale = todictnumber(bluescale) end
if blueshift then blueshift = todictnumber(blueshift) end
if bluefuzz then bluefuzz = todictnumber(bluefuzz) end
- if stdhw then stdhw = todictdeltas(stdhw) end
- if stdvw then stdvw = todictdeltas(stdvw) end
+ if stemsnaph then stemsnaph = todictarray(stemsnaph) end
+ if stemsnapv then stemsnapv = todictarray(stemsnapv) end
+ if stdhw then stdhw = todictnumber(stdhw) end
+ if stdvw then stdvw = todictnumber(stdvw) end
--
local fontversion = todictstring(fontfile,fontheader.fontversion or "uknown version")
local familyname = todictstring(fontfile,cffinfo.familyname or names.family or basefontname)
@@ -1151,7 +1251,7 @@ do
local underlineposition = todictnumber(cffinfo.underlineposition)
local underlinethickness = todictnumber(cffinfo.underlinethickness)
local charstringtype = todictnumber(2)
- local fontmatrix = todictarray(fontmatrix)
+-- local fontmatrix = todictarray(fontmatrix)
local ros = todictstring(fontfile,"Adobe") -- registry
.. todictstring(fontfile,"Identity") -- identity
.. todictnumber(0) -- supplement
@@ -1165,18 +1265,21 @@ do
--
local defaultwidthx = todictnumber(defaultwidth)
local nominalwidthx = todictnumber(nominalwidth)
+ -- the order of the blues is important!
local private = ""
- .. (defaultwidthx and (defaultwidthx .. todictkey(20)) or "")
- .. (nominalwidthx and (nominalwidthx .. todictkey(21)) or "")
- .. (bluevalues and (bluevalues .. todictkey(6)) or "")
- .. (otherblues and (otherblues .. todictkey(7)) or "")
- .. (familyblues and (familyblues .. todictkey(8)) or "")
- .. (familyotherblues and (familyotherblues .. todictkey(9)) or "")
- .. (bluescale and (bluescale .. todictkey(12,9)) or "")
- .. (blueshift and (blueshift .. todictkey(12,10)) or "")
- .. (bluefuzz and (bluefuzz .. todictkey(12,11)) or "")
- .. (stdhw and (stdhw .. todictkey(12,12)) or "")
- .. (stdvw and (stdvw .. todictkey(12,13)) or "")
+ .. (bluevalues and (bluevalues .. todictkey( 6)) or "")
+ .. (otherblues and (otherblues .. todictkey( 7)) or "")
+ .. (familyblues and (familyblues .. todictkey( 8)) or "")
+ .. (familyotherblues and (familyotherblues .. todictkey( 9)) or "")
+ .. (bluescale and (bluescale .. todictkey(12, 9)) or "")
+ .. (blueshift and (blueshift .. todictkey(12,10)) or "")
+ .. (bluefuzz and (bluefuzz .. todictkey(12,11)) or "")
+ .. (stdhw and (stdhw .. todictkey(10)) or "")
+ .. (stdvw and (stdvw .. todictkey(11)) or "")
+ .. (stemsnaph and (stemsnaph .. todictkey(12,12)) or "")
+ .. (stemsnapv and (stemsnapv .. todictkey(12,13)) or "")
+ .. (defaultwidthx and (defaultwidthx .. todictkey(20)) or "")
+ .. (nominalwidthx and (nominalwidthx .. todictkey(21)) or "")
local privatesize = todictnumber(#private)
local privatespec = privatesize .. privateoffset
--
@@ -1219,7 +1322,7 @@ do
.. underlineposition .. todictkey(12, 3)
.. underlinethickness .. todictkey(12, 4)
.. charstringtype .. todictkey(12, 6)
- .. fontmatrix .. todictkey(12, 7)
+-- .. fontmatrix .. todictkey(12, 7)
.. strokewidth .. todictkey(12, 8)
.. topvars
}
@@ -1246,6 +1349,10 @@ do
--
-- fdselect
--
+ -- see printer mail thread / experiments with Leah Neukirchen: some printers
+ -- (probaby with an old GS on board) need this matrix because oitherwise they
+ -- accumulate the top one (resulting in very tiny invisible results)
+ --
local fdselect =
tocardinal1(3) -- format
.. tocardinal2(1) -- n of ranges
@@ -1253,7 +1360,7 @@ do
.. tocardinal2(0) -- first gid
.. tocardinal1(0) -- fd index
-- entry 2
--- .. tocardinal2(fontfile.sparsemax-1) -- sentinel
+ -- .. tocardinal2(fontfile.sparsemax-1) -- sentinel
.. tocardinal2(fontfile.sparsemax) -- sentinel
--
fdselectoffset = todictoffset(offset)
@@ -1275,8 +1382,8 @@ do
offset = writestring(target,private,offset,"private")
--
local fdarray = {
- fontname .. todictkey(12,38)
- .. privatespec .. todictkey(18)
+ fontname .. todictkey(12,38)
+ .. privatespec .. todictkey(18) -- case 1
}
fdarrayoffset = todictoffset(offset)
offset = writeindex(target,fdarray,offset,"fdarray")
@@ -1288,19 +1395,18 @@ do
.. charsetoffset .. todictkey(15)
.. fdarrayoffset .. todictkey(12,36)
.. fdselectoffset .. todictkey(12,37)
- .. privatespec .. todictkey(18)
+ .. privatespec .. todictkey(18) -- case 2
target[dictof] = topdict .. topvars
--
target = concat(target)
-- if trace_details then
- -- local name = "temp.cff"
- -- report_fonts("saving %a",name)
- -- io.savedata(name,target)
- -- inspect(fonts.handlers.otf.readers.cffcheck(name))
+ -- local name = "temp.cff"
+ -- report_fonts("saving %a",name)
+ -- io.savedata(name,target)
+ -- inspect(fonts.handlers.otf.readers.cffcheck(name))
-- end
return target
end
-
end
-- todo: check widths (missing a decimal)
@@ -1313,31 +1419,85 @@ do
local blobs = streams.streams
local fontheader = streams.fontheader
local maximumprofile = streams.maximumprofile
- local names = streams.names
+ local names = streams.names -- not used
local descriptions = details.rawdata.descriptions
local metadata = details.rawdata.metadata
local indices = details.indices
+ local used = details.used
+ local usedfonts = details.usedfonts -- in case of multiple loaded t1 fonts with no common description
local metabbox = { fontheader.xmin, fontheader.ymin, fontheader.xmax, fontheader.ymax }
local correction = 1
-
- -- (*) We share code with type1 and when we have old school tfm with
- -- pfb but without descriptions we're kind of toast.
-
if not descriptions or not next(descriptions) then
- -- This is good enough, we only need indices and widths.
- descriptions = details.fontdata.characters
- -- This is a hack, we have no basepoints.
- correction = details.fontdata.parameters.size / 1000
- -- And this needs checking.
- correction = correction * bpfactor / ptfactor
- metadata = { }
+ -- (*) We share code with type1 and when we have old school tfm with pfb shapes
+ -- we don't have descriptions, so we need to construct these. This could be done
+ -- earlier but then we lack info about sharing. Horrible hackery. If Type1 wasn't
+ -- obsolete I'd make a dedicated mainwriter that does the index and width collect
+ -- more efficient but there is no gain now.
+ if true then
+ descriptions = { }
+ setmetatable(indices,nil)
+ setmetatable(used,nil)
+ for u in next, usedfonts do
+ local param = fonts.hashes.parameters[u]
+ local chars = fonts.hashes.characters[u]
+ local units = 1000 -- to be checked (picked up)
+ correction = param.size / 1000
+ -- correction = correction * bpfactor / ptfactor
+ local factor = 1000 / (units * correction)
+ if false then
+-- if true then
+ for k, v in sortedhash(chars) do
+ if descriptions[k] then
+ local w1 = descriptions[k].width
+ local w2 = round((v.advance or v.width or 0) * factor)
+ if w1 ~= w2 then
+ local w = v.advance or v.width or 0
+ print(
+ u,k,utf.char(k),
+ w1,w2,
+ ((v.advance or v.width or 0)*param.designsize/param.size) / 1000
+ )
+ end
+ else
+ descriptions[k] = {
+ index = v.index,
+ width = round((v.advance or v.width or 0) * factor),
+ unicode = v.unicode,
+ }
+ end
+ end
+ else
+ for k, v in next, chars do
+ if descriptions[k] then
+ -- done
+ else
+ local index = v.index
+ if indices[index] or used[index] then -- play safe
+ descriptions[k] = {
+ index = index,
+ width = round((v.advance or v.width or 0) * factor),
+ unicode = v.unicode,
+ }
+ end
+ end
+ end
+ end
+ end
+ correction = false
+ else
+ -- This is tricky as it can be the wrong one and incomplete so a first come
+ -- and go issue. The basepoint correction needs checking.
+ descriptions = details.fontdata.characters
+ correction = details.fontdata.parameters.size / 1000
+ correction = correction * bpfactor / ptfactor
+ end
+ metadata = { }
end
-
--
-
local indices,
+ include,
minindex,
- maxindex = collectindices(descriptions,indices)
+ maxindex = collectindices(descriptions,indices,used,details.hash)
local streamoffset = 0
local glyphstreams,
charmappings = tablecreators.cff(fontfile)
@@ -1357,9 +1517,14 @@ do
if minindex == 0 then
minindex = 1
end
+ --
for index=minindex,maxindex do
- if indices[index] then
- local blob = blobs[index] or "\14"
+ local idx = include[index]
+ if idx then
+ local blob = blobs[idx]
+ if not blob then
+ blob = "\14"
+ end
sparsemax = sparsemax + 1
glyphstreams[sparsemax] = blob
charmappings[sparsemax] = tocardinal2(index)
@@ -1379,10 +1544,16 @@ do
--
fontfile = closefontfile(fontfile)
--
- local units = fontheader.units or metadata.units
-
+ local units = fontheader.units or metadata.units
+ if units ~= 1000 then
+ -- maybe only otf
+ -- public sans has 2000 so we need to mess different from e.g. ttf
+ report_fonts("width units in %a are %i, forcing 1000 instead",basefontname,units)
+ units = 1000
+ end
+ --
local basefont = pdfconstant(basefontname)
- local widths = widtharray(details,indices,maxindex,units * correction)
+ local widths = widtharray(details,indices,maxindex,units,correction)
local object = details.objectnumber
local tounicode = tounicodedictionary(details,indices,maxindex,basefontname,true)
local tocidset = tocidsetdictionary(indices,minindex,maxindex)
@@ -1396,7 +1567,7 @@ do
if stemv then
stemv = (stemv/65)^2 + 50
else
--- stemv = 2
+ -- stemv = 2
end
--
local function scale(n)
@@ -1431,6 +1602,7 @@ do
FontName = basefont,
Flags = 4,
FontBBox = fontbbox,
+-- FontMatrix = pdfarray { 0.001, 0, 0, 0.001, 0, 0 },
Ascent = scale(ascender),
Descent = scale(descender),
ItalicAngle = round(italicangle or 0),
@@ -1502,7 +1674,7 @@ do
local f_image_w = formatters["%.6N 0 d0 %s"]
local f_image_d = formatters["%.6N 0 d0 1 0 0 1 0 %.6N cm /%s Do"]
local f_stream = formatters["%.6N 0 d0 %s"]
- local f_stream_c = formatters["%.6N 0 0 0 0 0 d1 %s"]
+ local f_stream_c = formatters["%.6N 0 0 0 0 0 d1 %s"] -- last four bbox
local f_stream_d = formatters["%.6N 0 d0 1 0 0 1 0 %.6N cm %s"]
-- local f_stream_s = formatters["%.6N 0 0 %.6N 0 0 cm /%s Do"]
@@ -1522,7 +1694,7 @@ do
-- pk inclusion (not really tested but not really used either)
function methods.pk(filename)
- local pkfullname = resolvers.findpk(basedfontname,resolution)
+ local pkfullname = resolvers.findpk(filename,resolution)
if not pkfullname or pkfullname == "" then
return
end
@@ -1619,6 +1791,7 @@ do
local xforms = pdfdictionary()
local nofglyphs = 0
local scale = 10 * details.parameters.size/details.parameters.designsize
+ scale = scale * (7200/7227) -- test on extensibles
local units = details.parameters.units
local function boxtopdf(image,data) -- image == glyph
nofglyphs = nofglyphs + 1
@@ -1781,6 +1954,47 @@ do
end
end
+ local function registercolors(hash)
+ local kind = hash.kind
+ local data = hash.data
+ local direct = lpdf.fonts.color_direct
+ local indirect = lpdf.fonts.color_indirect
+ if kind == "font" then
+ return setmetatableindex(function(t,k)
+ local h = data[k]
+ local v = h and direct(h[1]/255,h[2]/255,h[3]/255) or false
+ t[k] = v
+ return v
+ end)
+ elseif kind == "user" then
+ return setmetatableindex(function(t,k)
+ local list = data[k]
+ local v
+ if list then
+ local kind = list.kind
+ if kind == "values" then
+ local d = list.data
+ v = direct(d.r or 0,d.g or 0,d.b or 0)
+ elseif kind == "attributes" then
+ v = indirect(list.color,list.transparency)
+ else
+ v = false -- textcolor
+ end
+ else
+ v = false -- textcolor
+ end
+ t[k] = v
+ return v
+ end)
+ else
+ return { }
+ end
+ end
+
+ -- we register way too much ... we can delay the t3 definition
+
+ local usedcharacters = lpdf.usedcharacters
+
function methods.color(filename,details)
local colrshapes = details.properties.indexdata[1]
local colrvalues = details.properties.indexdata[2]
@@ -1793,26 +2007,35 @@ do
local dropid = dropdata.properties.id
local dropunits = dropdata.parameters.units -- shared
local descriptions = dropdata.descriptions
+ local directcolors = registercolors(colrvalues)
+ local fontslots = usedcharacters[dropid]
usedfonts[dropid] = dropid
local w = description.width or 0
local s = #colorlist
- local l = nil
+ local l = false
local t = { f_width(w) }
local n = 1
- local d = colrvalues[#colrvalues]
+ local d = #colrvalues
for i=1,s do
local entry = colorlist[i]
- local v = colrvalues[entry.class] or d
- if v and l ~= v then
- n = n + 1 ; t[n] = v
- l = v
+ local class = entry.class or d
+ if class then
+ -- false is textcolor (we should actually go back)
+ local c = directcolors[class]
+ if c and l ~= c then
+ n = n + 1 ; t[n] = c
+ l = c
+ end
end
local e = descriptions[entry.slot]
if e then
- n = n + 1 ; t[n] = f_char(dropid,e.index)
+ n = n + 1 ; t[n] = f_char(dropid,fontslots[e.index])
end
end
- return concat(t," "), w / dropunits
+ -- we're not going to hash this ... could be done if needed (but who mixes different
+ -- color schemes ...)
+ t = concat(t," ")
+ return t, w / dropunits
end
end
local function getresources()
@@ -1833,7 +2056,7 @@ do
if not method then
return
end
- local glyphs, scalefactor, glyphtopdf, reset, getresources = method(basedfontname,details)
+ local glyphs, scalefactor, glyphtopdf, reset, getresources = method(basefontname,details)
if not glyphs then
return
end
@@ -1842,8 +2065,9 @@ do
local factor = parameters.factor -- normally 1
local fontmatrix = pdfarray { scalefactor, 0, 0, scalefactor, 0, 0 }
local indices,
+ include,
minindex,
- maxindex = collectindices(details.fontdata.characters,details.indices)
+ maxindex = collectindices(details.fontdata.characters,details.indices,details.used,details.hash)
local widths = pdfarray()
local differences = pdfarray()
local charprocs = pdfdictionary()
@@ -1873,7 +2097,7 @@ do
for index, data in sortedhash(indices) do
local name = f_index(index)
- local glyph = glyphs[index]
+ local glyph = glyphs[include[index]]
if glyph then
local stream, width = glyphtopdf(glyph,data)
if stream then
@@ -1951,7 +2175,7 @@ local loadstreamdata = fonts.handlers.otf.loadstreamdata
-- we can actually now number upwards (so not use fontid in /F)
-local objects = setmetatableindex(function(t,k)
+local objects = setmetatableindex(lpdf.usedfontobjects,function(t,k) -- defined in lpdf-lmt.lmt
local v
if type(k) == "number" then
local h = getstreamhash(k)
@@ -1974,7 +2198,7 @@ end)
local n = 0
-local names = setmetatableindex(function(t,k)
+local names = setmetatableindex(lpdf.usedfontnames,function(t,k) -- defined in lpdf-lmt.lmt
local v
if type(k) == "number" then
local h = getstreamhash(k)
@@ -1998,6 +2222,13 @@ function lpdf.flushfonts()
statistics.starttiming(objects)
+ -- We loop over used characters (old approach, when we wanted to be equivalent wrt
+ -- indices with luatex) but can also decide to use usedindices. However, we then
+ -- don't have the id.
+
+ -- we can combine the two for loops .. todo
+-- inspect(lpdf.usedcharacters)
+
for fontid, used in sortedhash(lpdf.usedcharacters) do
-- for a bitmap we need a different hash unless we stick to a fixed high
@@ -2012,6 +2243,7 @@ function lpdf.flushfonts()
local resources = fontdata.resources
local properties = fontdata.properties -- writingmode and type3
local parameters = fontdata.parameters -- used in type3
+-- print("before",fontid,hash,parent,rawdata)
if not rawdata then
-- we have a virtual font that loaded directly ... at some point i will
-- sort this out (in readanddefine we need to do a bit more) .. the problem
@@ -2037,6 +2269,8 @@ function lpdf.flushfonts()
fontdata = fontdata,
filename = resources.filename or properties.filename or "unset",
indices = { },
+ usedfonts = { [fontid] = true },
+ used = used,
rawdata = rawdata,
properties = properties, -- we assume consistency
parameters = parameters, -- we assume consistency
@@ -2049,10 +2283,12 @@ function lpdf.flushfonts()
noffonts = noffonts + 1
end
end
+-- print("after ",fontid,hash,parent)
if parent then
+ parent.usedfonts[fontid] = true
local indices = parent.indices
- for k in next, used do
- indices[k] = true
+ for k, v in next, used do
+ indices[k] = v
end
end
end
@@ -2063,21 +2299,23 @@ function lpdf.flushfonts()
for hash, details in sortedhash(mainfonts) do
local filename = details.filename
if next(details.indices) then
- if trace_fonts then
- report_fonts("embedding %a hashed as %a",filename,hash)
- end
local properties = details.properties
local bitmap = properties.usedbitmap
local method = properties.method -- will be pk | pdf | svg | ...
+ if trace_fonts then
+ if method then
+ report_fonts("embedding %a hashed as %a using method %a",filename,hash,method)
+ else
+ report_fonts("embedding %a hashed as %a",filename,hash)
+ end
+ end
if bitmap or method then
local format = "type3"
local writer = mainwriters[format]
- if writer then
- if trace_fonts then
- report_fonts("using main writer %a",format)
- end
- writer(details)
+ if trace_fonts then
+ report_fonts("using main writer %a",format)
end
+ writer(details)
else
local format = properties.format
local writer = mainwriters[format]
@@ -2189,7 +2427,10 @@ function lpdf.flushfonts()
-- report_fonts("no indices for %a",filename)
end
if trace_fonts then
- report_fonts("embedded indices: % t",table.sortedkeys(details.indices))
+ local indices = details.indices
+ if indices and next(indices) then
+ report_fonts("embedded indices: % t",table.sortedkeys(details.indices))
+ end
end
mainfonts[details.hash] = false -- done
end
@@ -2206,15 +2447,6 @@ end)
-- this is temporary
-function lpdf.setomitcidset(v)
- -- dummy: no longer needed
- includecidset = not toboolean(v)
-end
-
-function lpdf.setomitcharset(v)
- -- dummy
-end
-
function lpdf.getfontobjectnumber(k)
return objects[k]
end
@@ -2223,11 +2455,4 @@ function lpdf.getfontname(k)
return names[k]
end
--- local done = false -- todo:
-
--- updaters.register("backend.update",function()
--- if not done then
- lpdf.registerdocumentfinalizer(lpdf.flushfonts,1,"wrapping up fonts")
--- done = true
--- end
--- end)
+lpdf.registerdocumentfinalizer(lpdf.flushfonts,1,"wrapping up fonts")
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-epa.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-epa.lmt
index b37e9c0432a..26bb9f70318 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-epa.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-epa.lmt
@@ -17,7 +17,6 @@ local concat, merged = table.concat, table.merged
local abs = math.abs
local expandname = file.expandname
local allocate = utilities.storage.allocate
-local bor, band = bit32.bor, bit32.band
local isfile = lfs.isfile
local trace_links = false trackers.register("figures.links", function(v) trace_links = v end)
@@ -30,27 +29,22 @@ local report_comment = logs.reporter("backend","comment")
local report_field = logs.reporter("backend","field")
local report_outline = logs.reporter("backend","outline")
-local lpdf = lpdf
-local backends = backends
local context = context
-local nodeinjections = backends.pdf.nodeinjections
+local pdfbackend = backends.registered.pdf
+local nodeinjections = pdfbackend.nodeinjections
+local codeinjections = pdfbackend.codeinjections
+----- registrations = pdfbackend.registrations
local setmacro = tokens.setters.macro
+local lpdf = lpdf
local pdfarray = lpdf.array
local pdfdictionary = lpdf.dictionary
local pdfconstant = lpdf.constant
local pdfreference = lpdf.reference
-
-local pdfreserveobject
-local pdfgetpos
-
-updaters.register("backend.update.lpdf",function()
- pdfreserveobject = lpdf.reserveobject
- pdfgetpos = lpdf.getpos
-end)
-
+local pdfreserveobject = lpdf.reserveobject
+local pdfgetpos = lpdf.getpos
local pdfcopyboolean = lpdf.copyboolean
local pdfcopyunicode = lpdf.copyunicode
local pdfcopyarray = lpdf.copyarray
@@ -70,7 +64,6 @@ local loadpdffile = lpdf.epdf.load
local nameonly = file.nameonly
local variables = interfaces.variables
-local codeinjections = backends.pdf.codeinjections
----- urlescaper = lpegpatterns.urlescaper
----- utftohigh = lpegpatterns.utftohigh
local escapetex = characters.filters.utf.private.escape
@@ -85,7 +78,7 @@ local layerspec = {
"epdfcontent"
}
-local getpos = function() getpos = backends.codeinjections.getpos return getpos() end
+local getpos = function() getpos = codeinjections.getpos return getpos() end
local collected = allocate()
local tobesaved = allocate()
@@ -548,7 +541,7 @@ local annotationflags = lpdf.flags.annotations
local function copyF(v,lock) -- todo: bxor 24
if lock then
- v = bor(v or 0,annotationflags.ReadOnly + annotationflags.Locked + annotationflags.LockedContents)
+ v = (v or 0) | (annotationflags.ReadOnly + annotationflags.Locked + annotationflags.LockedContents)
end
if v then
return pdfcopyinteger(v)
@@ -556,7 +549,7 @@ local function copyF(v,lock) -- todo: bxor 24
end
-- Speed is not really an issue so we don't optimize this code too much. In the end (after
--- testing we end up with less code that we started with.
+-- testing) we ended up with less code that we started with.
function codeinjections.mergecomments(specification)
local specification, fullname, document = validdocument(specification)
@@ -715,7 +708,7 @@ local function flagstoset(flag,flags)
local t = { }
if flags then
for k, v in next, flags do
- if band(flag,v) ~= 0 then
+ if (flag & v) ~= 0 then
t[k] = true
end
end
@@ -874,6 +867,33 @@ function codeinjections.mergefields(specification)
end
end
+-- The crappy parts of pdf .. too unpredictable.
+
+function codeinjections.mergerenditions(specification)
+-- local specification, fullname, document = validdocument(specification)
+-- if not document then
+-- return ""
+-- end
+-- local pagenumber = specification.page or 1
+-- local pagedata = document.pages[pagenumber]
+-- local annotations = pagedata and pagedata.Annots
+-- if annotations and #annotations > 0 then
+-- local llx, lly, urx, ury, width, height, xscale, yscale = getmediasize(specification,pagedata,xscale,yscale)
+-- initializelayer(height,width)
+-- --
+-- for i=1,#annotations do
+-- -- we keep the order
+-- local annotation = annotations[i]
+-- if annotation then
+-- local subtype = annotation.Subtype
+-- if subtype == "Screen" then
+-- print("not done")
+-- end
+-- end
+-- end
+-- end
+end
+
-- Beware, bookmarks can be in pdfdoc encoding or in unicode. However, in mkiv we
-- write out the strings in unicode (hex). When we read them in, we check for a bom
-- and convert to utf.
@@ -1021,7 +1041,7 @@ function codeinjections.mergebookmarks(specification)
end
if specification then
local fullname = specification.fullname
- local bookmarks = backends.codeinjections.getbookmarks(fullname)
+ local bookmarks = codeinjections.getbookmarks(fullname)
local realpage = tonumber(specification.page) or 1
for i=1,#bookmarks do
local b = bookmarks[i]
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-fld.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-fld.lmt
index eacbb085d88..3077b19c006 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-fld.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-fld.lmt
@@ -62,22 +62,20 @@ local trace_fields = false trackers.register("backends.fields", function(v) tra
local report_fields = logs.reporter("backend","fields")
-local backends, lpdf = backends, lpdf
-
local variables = interfaces.variables
local context = context
local references = structures.references
local settings_to_array = utilities.parsers.settings_to_array
-local pdfbackend = backends.pdf
-
+local pdfbackend = backends.registered.pdf
local nodeinjections = pdfbackend.nodeinjections
local codeinjections = pdfbackend.codeinjections
local registrations = pdfbackend.registrations
local registeredsymbol = codeinjections.registeredsymbol
+local lpdf = lpdf
local pdfstream = lpdf.stream
local pdfdictionary = lpdf.dictionary
local pdfarray = lpdf.array
@@ -86,28 +84,17 @@ local pdfunicode = lpdf.unicode
local pdfstring = lpdf.string
local pdfconstant = lpdf.constant
local pdfaction = lpdf.action
-
-local pdfflushobject
-local pdfshareobjectreference
-local pdfshareobject
-local pdfreserveobject
-local pdfpagereference
-local pdfmajorversion
-
-updaters.register("backend.update.lpdf",function()
- pdfflushobject = lpdf.flushobject
- pdfshareobjectreference = lpdf.shareobjectreference
- pdfshareobject = lpdf.shareobject
- pdfreserveobject = lpdf.reserveobject
- pdfpagereference = lpdf.pagereference
- pdfmajorversion = lpdf.majorversion
-end)
-
+local pdfflushobject = lpdf.flushobject
+local pdfshareobjectreference = lpdf.shareobjectreference
+local pdfshareobject = lpdf.shareobject
+local pdfreserveobject = lpdf.reserveobject
+local pdfpagereference = lpdf.pagereference
+local pdfmajorversion = lpdf.majorversion
local pdfcolor = lpdf.color
local pdfcolorvalues = lpdf.colorvalues
local pdflayerreference = lpdf.layerreference
-local hpack_node = node.hpack
+local hpack_node = nodes.hpack
local submitoutputformat = 0 -- 0=unknown 1=HTML 2=FDF 3=XML => not yet used, needs to be checked
@@ -685,7 +672,7 @@ end
local fields, radios, clones, fieldsets, calculationset = { }, { }, { }, { }, nil
-local xfdftemplate = [[
+local xfdftemplate <const> = [[
<?xml version='1.0' encoding='UTF-8'?>
<xfdf xmlns='http://ns.adobe.com/xfdf/'>
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-fmt.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-fmt.lmt
index c6a3f25ff5e..7ceacc62d68 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-fmt.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-fmt.lmt
@@ -19,15 +19,16 @@ local trace_variables = false trackers.register("backend.variables", function(v
local report_backend = logs.reporter("backend","profiles")
-local backends, lpdf = backends, lpdf
-
-local codeinjections = backends.pdf.codeinjections
+local pdfbackend = backends.registered.pdf
+----- nodeinjections = pdfbackend.nodeinjections
+local codeinjections = pdfbackend.codeinjections
local variables = interfaces.variables
local viewerlayers = attributes.viewerlayers
local colors = attributes.colors
local transparencies = attributes.transparencies
+local lpdf = lpdf
local pdfdictionary = lpdf.dictionary
local pdfarray = lpdf.array
local pdfconstant = lpdf.constant
@@ -903,12 +904,6 @@ function codeinjections.setformat(s)
majorversion,minorversion)
end
--
- -- cid sets can always omitted now, but those validators still complain so let's
- -- for a while keep it (for luigi):
- --
- lpdf.setomitcidset (formatspecification.include_cidsets == false and 1 or 0) -- why a number
- lpdf.setomitcharset(formatspecification.include_charsets == false and 1 or 0) -- why a number
- --
-- maybe block by pdf version
--
codeinjections.settaggingsupport(formatspecification.tagging)
@@ -919,6 +914,11 @@ function codeinjections.setformat(s)
-- rgb = spec.rgb_colors and variables.yes or variables.no,
-- }
--
+ local rgb = spec.rgb_colors and variables.yes or variables.no
+ local cmy = spec.cmyk_colors and variables.yes or variables.no
+ report_backend("permitted colorspaces: rgb %a, cmyk %a",rgb,cmy)
+ -- token.expandmacro ("colo_force_colormodel",true,rgb,true,cmy)
+ --
colors.forcesupport(
spec.gray_scale or false,
spec.rgb_colors or false,
@@ -958,6 +958,8 @@ function codeinjections.setformat(s)
report_backend("error, format is already set to %a, ignoring %a",formatname,noname.format)
end
end
+ -- we could just pass the spec to the backend
+ lpdf.setincludecidset(spec.include_cidsets)
else
report_backend("error, format %a is not supported",format)
end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-fnt.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-fnt.lmt
index ee16303b060..36f2961055a 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-fnt.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-fnt.lmt
@@ -13,12 +13,7 @@ local tonumber, rawget = tonumber, rawget
local pdfe = lpdf.epdf
local pdfreference = lpdf.reference
-
-local pdfreserveobject
-
-updaters.register("backend.update.lpdf",function()
- pdfreserveobject = lpdf.reserveobject
-end)
+local pdfreserveobject = lpdf.reserveobject
local tobemerged = { }
local trace_merge = false trackers.register("graphics.fonts",function(v) trace_merge = v end)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-grp.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-grp.lmt
index 6adbe8c3c91..585d114599a 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-grp.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-grp.lmt
@@ -11,28 +11,21 @@ local formatters, gsub = string.formatters, string.gsub
local concat = table.concat
local round = math.round
-local backends, lpdf = backends, lpdf
-
-local nodeinjections = backends.pdf.nodeinjections
-
local colors = attributes.colors
local basepoints = number.dimenfactors.bp
-local nodeinjections = backends.pdf.nodeinjections
-local codeinjections = backends.pdf.codeinjections
-local registrations = backends.pdf.registrations
+local pdfbackend = backends.registered.pdf
+local nodeinjections = pdfbackend.nodeinjections
+local codeinjections = pdfbackend.codeinjections
+local registrations = pdfbackend.registrations
+local lpdf = lpdf
local pdfdictionary = lpdf.dictionary
local pdfarray = lpdf.array
local pdfconstant = lpdf.constant
local pdfboolean = lpdf.boolean
local pdfreference = lpdf.reference
-
-local pdfflushobject
-
-updaters.register("backend.update.lpdf",function()
- pdfflushobject = lpdf.flushobject
-end)
+local pdfflushobject = lpdf.flushobject
local createimage = images.create
local wrapimage = images.wrap
@@ -113,70 +106,174 @@ end
-- we could derive the colorspace if we strip the data
-- and divide by x*y
-local template = "q BI %s ID %s > EI Q"
-local factor = 72/300
+-- todo: map onto png
-function nodeinjections.injectbitmap(t)
- -- encoding is ascii hex, no checking here
- local xresolution, yresolution = t.xresolution or 0, t.yresolution or 0
- if xresolution == 0 or yresolution == 0 then
- return -- fatal error
- end
- local colorspace = t.colorspace
- if colorspace ~= "rgb" and colorspace ~= "cmyk" and colorspace ~= "gray" then
- -- not that efficient but ok
- local d = gsub(t.data,"[^0-9a-f]","")
- local b = math.round(#d / (xresolution * yresolution))
- if b == 2 then
- colorspace = "gray"
- elseif b == 6 then
- colorspace = "rgb"
- elseif b == 8 then
- colorspace = "cmyk"
+
+do
+
+ local template = "q BI %s ID %s > EI Q"
+ local factor = 72/300
+
+ local methods = { }
+
+ methods.hex = function(t)
+ -- encoding is ascii hex, no checking here
+ local xresolution, yresolution = t.xresolution or 0, t.yresolution or 0
+ if xresolution == 0 or yresolution == 0 then
+ return -- fatal error
end
+ local colorspace = t.colorspace
+ if colorspace ~= "rgb" and colorspace ~= "cmyk" and colorspace ~= "gray" then
+ -- not that efficient but ok
+ local d = gsub(t.data,"[^0-9a-f]","")
+ local b = round(#d / (xresolution * yresolution))
+ if b == 2 then
+ colorspace = "gray"
+ elseif b == 6 then
+ colorspace = "rgb"
+ elseif b == 8 then
+ colorspace = "cmyk"
+ end
+ end
+ colorspace = lpdf.colorspaceconstants[colorspace]
+ if not colorspace then
+ return -- fatal error
+ end
+ --the original length L is required for pdf 2.0 (4096 max)
+ local d = pdfdictionary {
+ W = xresolution,
+ H = yresolution,
+ CS = colorspace,
+ BPC = 8,
+ F = pdfconstant("AHx"),
+ -- CS = nil,
+ -- BPC = 1,
+ -- IM = true,
+ }
+ -- for some reasons it only works well if we take a 1bp boundingbox
+ local urx, ury = 1/basepoints, 1/basepoints
+ -- urx = (xresolution/300)/basepoints
+ -- ury = (yresolution/300)/basepoints
+ local width, height = t.width or 0, t.height or 0
+ if width == 0 and height == 0 then
+ width = factor * xresolution / basepoints
+ height = factor * yresolution / basepoints
+ elseif width == 0 then
+ width = height * xresolution / yresolution
+ elseif height == 0 then
+ height = width * yresolution / xresolution
+ end
+ local a = pdfdictionary {
+ BBox = pdfarray { 0, 0, round(urx * basepoints), round(ury * basepoints) }
+ }
+ local image = createimage {
+ stream = formatters[template](d(),t.data),
+ width = width,
+ height = height,
+ bbox = { 0, 0, round(urx), round(ury) },
+ attr = a(),
+ nobbox = true,
+ }
+ return wrapimage(image)
end
- colorspace = lpdf.colorspaceconstants[colorspace]
- if not colorspace then
- return -- fatal error
+
+ -- local lpegmatch = lpeg.match
+ -- local pattern = lpeg.Cs((lpeg.patterns.space/"" + lpeg.patterns.hextobyte)^0)
+
+ local zlibcompress = xzip.compress
+ local hextocharacters = string.hextocharacters
+ local compresslevel = 3
+
+ methods.png = function(t)
+ -- encoding is ascii hex, no checking here
+ local xresolution = t.xresolution or 0
+ local yresolution = t.yresolution or 0
+ local data = t.data or ""
+ if xresolution == 0 or yresolution == 0 or data == "" then
+ return -- fatal error
+ end
+ data = hextocharacters(data)
+ if not data then
+ return
+ end
+ local colorspace = t.colorspace
+ local colordepth = 8
+ local colors = 1
+-- if colorspace ~= "rgb" and colorspace ~= "gray" then
+-- -- not that efficient but ok
+-- local d = gsub(t.data,"[^0-9a-f]","")
+-- local b = round(#d / (xresolution * yresolution))
+-- if b == 2 then
+-- colorspace = "gray"
+-- colors = 1
+-- elseif b == 6 then
+-- colorspace = "rgb"
+-- colors = 3
+-- elseif b == 8 then
+-- return -- for now, todo: convert
+-- end
+-- end
+ if colorspace ~= "rgb" and colorspace ~= "gray" then
+ local b = round(#data / (xresolution * yresolution))
+ if b == 1 then
+ colorspace = "gray"
+ colors = 1
+ elseif b == 3 then
+ colorspace = "rgb"
+ colors = 3
+ elseif b == 4 then
+ return -- for now, todo: convert
+ end
+ end
+ colorspace = lpdf.colorspaceconstants[colorspace]
+ if not colorspace then
+ return -- fatal error
+ end
+ local width = t.width
+ local height = t.height
+ if width == 0 and height == 0 then
+ width = factor * xresolution / basepoints
+ height = factor * yresolution / basepoints
+ elseif width == 0 then
+ width = height * xresolution / yresolution
+ elseif height == 0 then
+ height = width * yresolution / xresolution
+ end
+ -- data = zlibcompress(lpegmatch(pattern,data),compresslevel)
+ data = zlibcompress(data,compresslevel)
+ local xobject = pdfdictionary {
+ Type = pdfconstant("XObject"),
+ Subtype = pdfconstant("Image"),
+ Width = xresolution,
+ Height = yresolution,
+ BitsPerComponent = 8,
+ ColorSpace = colorspace,
+ Length = #data,
+ Filter = pdfconstant("FlateDecode"),
+ }
+ local image = createimage {
+-- bbox = { 0, 0, round(width/xresolution), round(height/yresolution) }, -- mandate
+ bbox = { 0, 0, round(width), round(height) }, -- mandate
+ width = round(width),
+ height = round(height),
+ nolength = true,
+ nobbox = true,
+ notype = true,
+ stream = data,
+ attr = xobject(),
+ }
+ return wrapimage(image)
end
- local d = pdfdictionary {
- W = xresolution,
- H = yresolution,
- CS = colorspace,
- BPC = 8,
- F = pdfconstant("AHx"),
- -- CS = nil,
- -- BPC = 1,
- -- IM = true,
- }
- -- for some reasons it only works well if we take a 1bp boundingbox
- local urx, ury = 1/basepoints, 1/basepoints
- -- urx = (xresolution/300)/basepoints
- -- ury = (yresolution/300)/basepoints
- local width, height = t.width or 0, t.height or 0
- if width == 0 and height == 0 then
- width = factor * xresolution / basepoints
- height = factor * yresolution / basepoints
- elseif width == 0 then
- width = height * xresolution / yresolution
- elseif height == 0 then
- height = width * yresolution / xresolution
+
+ function nodeinjections.injectbitmap(t)
+ if t.colorspace == "cmyk" then
+ return methods.hex(t)
+ else
+ return (methods[t.format or "hex"] or methods.hex)(t)
+ end
end
- local a = pdfdictionary {
- BBox = pdfarray { 0, 0, urx * basepoints, ury * basepoints }
- }
- local image = createimage {
- stream = formatters[template](d(),t.data),
- width = width,
- height = height,
- bbox = { 0, 0, urx, ury },
- attr = a(),
- nobbox = true,
- }
- return wrapimage(image)
-end
--- general graphic helpers
+end
function codeinjections.setfigurealternative(data,figure)
local request = data.request
@@ -287,8 +384,9 @@ function lpdf.registerpattern(specification)
},
}
- local resources = lpdf.collectedresources{ patterns = false }
- local attributes = d()
+ -- local resources = lpdf.collectedresources{ patterns = false } -- we don't want duplicates, so no serialize here:
+ local resources = lpdf.collectedresources{ patterns = false, serialize = false }
+ local attributes = d -- () -- we need to check for patterns
local onlybounds = 1
local patternobj = saveboxresource(specification.number,attributes,resources,true,onlybounds)
lpdf.adddocumentpattern("Pt" .. nofpatterns,lpdf.reference(patternobj ))
@@ -299,4 +397,4 @@ function lpdf.patternstream(n,width,height)
return f_pattern("Pt" .. n,width*basepoints,height*basepoints)
end
-backends.pdf.codeinjections.registerpattern = lpdf.registerpattern
+codeinjections.registerpattern = lpdf.registerpattern
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-img.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-img.lmt
index 50034c36025..c241ccdb72a 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-img.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-img.lmt
@@ -11,19 +11,29 @@ if not modules then modules = { } end modules ['lpdf-img'] = {
-- At some point we can also use it for fonts. For small images performance is ok
-- with pure lua but for bigger images we can use some helpers. Normally in a
-- typesetting workflow non-interlaced images are used. One should convert
--- interlaced images to more efficient non-interlaced ones (ok, we can cache
--- them if needed).
+-- interlaced images to more efficient non-interlaced ones (ok, we can cache them if
+-- needed).
--
--- The \LUA\ code is slightly optimized so we could have done with less lines if
--- we wanted but best gain a little. The idea is that we collect striped (in stages)
--- so that we can play with substitutions.
+-- The \LUA\ code is slightly optimized so we could have done with less lines if we
+-- wanted but best gain a little. The idea is that we collect striped (in stages) so
+-- that we can play with substitutions. We keep this variant commented but not
+-- embedding it saves some 14K bytecode in the format.
+--
+-- We keep the \LUA\ code commented because it is what I started with from the \PNG\
+-- specification. It was one fo the first things needed for dropping the backend so
+-- actually this was part of the first \LUA\ based \PDF\ backend, the one that for a
+-- while was part of \MKIV. That bit of development was not widely advertized and
+-- just for me to make the transition and prove that it could be done. At some point
+-- I decided to not provide a generic backend so that cdoe went away. Reminder:
+-- there ended up some code here that was needed for font related png too (and I'd
+-- already forgotten about: I need to document that).
local type = type
local concat, move = table.concat, table.move
local ceil, min = math.ceil, math.min
local char, byte, find, gmatch = string.char, string.byte, string.find, string.gmatch
-local idiv = number.idiv
-local band, rshift = bit32.band, bit32.rshift
+----- idiv = number.idiv
+----- band, rshift = bit32.band, bit32.rshift
local loaddata = io.loaddata
local setmetatableindex = table.setmetatableindex
@@ -45,21 +55,16 @@ local pdfconstant = lpdf.constant
local pdfstring = lpdf.string
local pdfreference = lpdf.reference
local pdfverbose = lpdf.verbose
+local pdfflushstreamobject = lpdf.flushstreamobject
+local pdfmajorversion = lpdf.majorversion
+local pdfminorversion = lpdf.minorversion
-local pdfflushstreamobject
-local pdfmajorversion
-local pdfminorversion
-
-updaters.register("backend.update.lpdf",function()
- pdfflushstreamobject = lpdf.flushstreamobject
- pdfmajorversion = lpdf.majorversion
- pdfminorversion = lpdf.minorversion
-end)
+local codeinjections = backends.registered.pdf.codeinjections
local createimage = images.create
-local zlibcompress = (xzip or zlib).compress
-local zlibdecompress = (xzip or zlib).decompress
+local zlibcompress = xzip.compress
+local zlibdecompress = xzip.decompress
local trace = false
@@ -72,14 +77,36 @@ trackers.register("graphics.backend", function(v) trace = v end)
local injectors = { }
lpdf.injectors = injectors
--- todo: load from a virtual file
+-- local function loadcontent(filename,method)
+-- return method == "string" and filename or loaddata(filename)
+-- end
+
+-- local function newcontent(filename,method)
+-- return newreader(filename,method)
+-- end
-local function loadcontent(filename,method)
- return method == "string" and filename or loaddata(filename)
+local function loadcontent(filename,method,wipe)
+ if method == "string" then
+ return filename
+ else
+ local found, data = resolvers.loadbinfile(filename)
+ if wipe then
+ resolvers.cleanupbinfile(filename)
+ end
+ return data
+ end
end
-local function newcontent(filename,method)
- return newreader(filename,method)
+local function newcontent(filename,method,wipe)
+ if method == "string" then
+ return newreader(filename,method)
+ else
+ local found, data = resolvers.loadbinfile(filename)
+ if wipe then
+ resolvers.cleanupbinfile(filename)
+ end
+ return newreader(data or "", "string")
+ end
end
--
@@ -115,7 +142,7 @@ do
local xsize = specification.xsize
local ysize = specification.ysize
local colordepth = specification.colordepth
- local content = loadcontent(filename,method)
+ local content = loadcontent(filename,method,true)
local xobject = pdfdictionary {
Type = pdfconstant("XObject"),
Subtype = pdfconstant("Image"),
@@ -157,7 +184,7 @@ do
-- todo: set filename
local xsize = specification.xsize
local ysize = specification.ysize
- local content = loadcontent(filename,method)
+ local content = loadcontent(filename,method,true)
local xobject = pdfdictionary {
Type = pdfconstant("XObject"),
Subtype = pdfconstant("Image"),
@@ -197,6 +224,7 @@ do
local pnginterlace = pngdecode.interlace
local pngexpand = pngdecode.expand
local pngtocmyk = pngdecode.tocmyk
+ local pngtomask = pngdecode.tomask
local filtermask, decodemask, decodestrip, transpose, expand, tocmyk
@@ -205,7 +233,7 @@ do
local function newoutput(size)
if newindex then
- return newindex(size,0)
+ return newindex(size,char(0))
end
local t = newtable and newtable(size,0) or { }
for i=1,size do
@@ -250,10 +278,10 @@ do
end
elseif filter == 3 then
for j=n+1,n+bpp do
- t[j] = (t[j] + idiv(t[j-len],2)) % 256
+ t[j] = (t[j] + (t[j-len] // 2)) % 256
end
for j=n+bpp+1,n+m do
- t[j] = (t[j] + idiv(t[j-bpp] + t[j-len],2)) % 256
+ t[j] = (t[j] + (t[j-bpp] + t[j-len]) // 2) % 256
end
elseif filter == 4 then
for j=n+1,n+bpp do
@@ -282,95 +310,95 @@ do
return t
end
- local filtermask_l = function (content,xsize,ysize,colordepth,colorspace,hasfilter)
- local mask = { }
- local bytes = colordepth == 16 and 2 or 1
- local bpp = colorspace == "DeviceRGB" and 3 or 1
- local length = #content
- local size = ysize * xsize * ((bpp+1)*bytes + (hasfilter and 1 or 0))
- local n = 1
- local l = 1
- if bytes == 2 then
- if bpp == 1 then
- for i=1,ysize do
- if hasfilter then
- content[n] = "" ; n = n + 1
- end
- for j=1,xsize do
- content[n] = chars[content[n]] ; n = n + 1
- content[n] = chars[content[n]] ; n = n + 1
- mask[l] = chars[content[n]] ; l = l + 1
- content[n] = "" ; n = n + 1
- mask[l] = chars[content[n]] ; l = l + 1
- content[n] = "" ; n = n + 1
- end
- end
- elseif bpp == 3 then
- for i=1,ysize do
- if hasfilter then
- content[n] = "" ; n = n + 1
- end
- for j=1,xsize do
- content[n] = chars[content[n]] ; n = n + 1
- content[n] = chars[content[n]] ; n = n + 1
- content[n] = chars[content[n]] ; n = n + 1
- content[n] = chars[content[n]] ; n = n + 1
- content[n] = chars[content[n]] ; n = n + 1
- content[n] = chars[content[n]] ; n = n + 1
- mask[l] = chars[content[n]] ; l = l + 1
- content[n] = "" ; n = n + 1
- mask[l] = chars[content[n]] ; l = l + 1
- content[n] = "" ; n = n + 1
- end
- end
- else
- return "", ""
- end
- else
- if bpp == 1 then
- for i=1,ysize do
- if hasfilter then
- content[n] = "" ; n = n + 1
- end
- for j=1,xsize do
- content[n] = chars[content[n]] ; n = n + 1
- mask[l] = chars[content[n]] ; l = l + 1
- content[n] = "" ; n = n + 1
- end
- end
- elseif bpp == 3 then
- for i=1,ysize do
- if hasfilter then
- content[n] = "" ; n = n + 1
- end
- for j=1,xsize do
- content[n] = chars[content[n]] ; n = n + 1
- content[n] = chars[content[n]] ; n = n + 1
- content[n] = chars[content[n]] ; n = n + 1
- mask[l] = chars[content[n]] ; l = l + 1
- content[n] = "" ; n = n + 1
- end
- end
- else
- return "", ""
- end
- end
- return concat(content), concat(mask)
- end
-
- local decodemask_l = function(content,xsize,ysize,colordepth,colorspace)
- local bytes = colordepth == 16 and 2 or 1
- local bpp = colorspace == "DeviceRGB" and 3 or 1
- local slice = bytes*(bpp+1)
- local length = #content
- local size = ysize * xsize * ((bpp+1)*bytes + 1) -- assume filter
- content = openstring(content)
- content = readbytetable(content,length)
- setmetatableindex(content,zero)
- applyfilter(content,xsize,ysize,slice)
- content, mask = filtermask(content,xsize,ysize,colordepth,colorspace,true)
- return content, mask
- end
+ -- local filtermask_l = function (content,xsize,ysize,colordepth,colorspace,hasfilter)
+ -- local mask = { }
+ -- local bytes = colordepth == 16 and 2 or 1
+ -- local bpp = colorspace == "DeviceRGB" and 3 or 1
+ -- local length = #content
+ -- local size = ysize * xsize * ((bpp+1)*bytes + (hasfilter and 1 or 0))
+ -- local n = 1
+ -- local l = 1
+ -- if bytes == 2 then
+ -- if bpp == 1 then
+ -- for i=1,ysize do
+ -- if hasfilter then
+ -- content[n] = "" ; n = n + 1
+ -- end
+ -- for j=1,xsize do
+ -- content[n] = chars[content[n]] ; n = n + 1
+ -- content[n] = chars[content[n]] ; n = n + 1
+ -- mask[l] = chars[content[n]] ; l = l + 1
+ -- content[n] = "" ; n = n + 1
+ -- mask[l] = chars[content[n]] ; l = l + 1
+ -- content[n] = "" ; n = n + 1
+ -- end
+ -- end
+ -- elseif bpp == 3 then
+ -- for i=1,ysize do
+ -- if hasfilter then
+ -- content[n] = "" ; n = n + 1
+ -- end
+ -- for j=1,xsize do
+ -- content[n] = chars[content[n]] ; n = n + 1
+ -- content[n] = chars[content[n]] ; n = n + 1
+ -- content[n] = chars[content[n]] ; n = n + 1
+ -- content[n] = chars[content[n]] ; n = n + 1
+ -- content[n] = chars[content[n]] ; n = n + 1
+ -- content[n] = chars[content[n]] ; n = n + 1
+ -- mask[l] = chars[content[n]] ; l = l + 1
+ -- content[n] = "" ; n = n + 1
+ -- mask[l] = chars[content[n]] ; l = l + 1
+ -- content[n] = "" ; n = n + 1
+ -- end
+ -- end
+ -- else
+ -- return "", ""
+ -- end
+ -- else
+ -- if bpp == 1 then
+ -- for i=1,ysize do
+ -- if hasfilter then
+ -- content[n] = "" ; n = n + 1
+ -- end
+ -- for j=1,xsize do
+ -- content[n] = chars[content[n]] ; n = n + 1
+ -- mask[l] = chars[content[n]] ; l = l + 1
+ -- content[n] = "" ; n = n + 1
+ -- end
+ -- end
+ -- elseif bpp == 3 then
+ -- for i=1,ysize do
+ -- if hasfilter then
+ -- content[n] = "" ; n = n + 1
+ -- end
+ -- for j=1,xsize do
+ -- content[n] = chars[content[n]] ; n = n + 1
+ -- content[n] = chars[content[n]] ; n = n + 1
+ -- content[n] = chars[content[n]] ; n = n + 1
+ -- mask[l] = chars[content[n]] ; l = l + 1
+ -- content[n] = "" ; n = n + 1
+ -- end
+ -- end
+ -- else
+ -- return "", ""
+ -- end
+ -- end
+ -- return concat(content), concat(mask)
+ -- end
+
+ -- local decodemask_l = function(content,xsize,ysize,colordepth,colorspace)
+ -- local bytes = colordepth == 16 and 2 or 1
+ -- local bpp = colorspace == "DeviceRGB" and 3 or 1
+ -- local slice = bytes*(bpp+1)
+ -- local length = #content
+ -- local size = ysize * xsize * ((bpp+1)*bytes + 1) -- assume filter
+ -- content = openstring(content)
+ -- content = readbytetable(content,length)
+ -- setmetatableindex(content,zero)
+ -- applyfilter(content,xsize,ysize,slice)
+ -- content, mask = filtermask(content,xsize,ysize,colordepth,colorspace,true)
+ -- return content, mask
+ -- end
local filtermask_c = function(content,xsize,ysize,colordepth,colorspace)
local bytes = colordepth == 16 and 2 or 1
@@ -388,12 +416,12 @@ do
return pngsplitmask(content,xsize,ysize,bpp,bytes,mask,filter)
end
- local function decodestrip_l(s,nx,ny,slice)
- local input = readbytetable(s,ny*(nx*slice+1))
- setmetatableindex(input,zero)
- applyfilter(input,nx,ny,slice)
- return input, true
- end
+ -- local function decodestrip_l(s,nx,ny,slice)
+ -- local input = readbytetable(s,ny*(nx*slice+1))
+ -- setmetatableindex(input,zero)
+ -- applyfilter(input,nx,ny,slice)
+ -- return input, true
+ -- end
local function decodestrip_c(s,nx,ny,slice)
local input = readstring(s,ny*(nx*slice+1))
@@ -409,204 +437,204 @@ do
local xblock = { 8, 4, 4, 2, 2, 1, 1 }
local yblock = { 8, 8, 4, 4, 2, 2, 1 }
- local function transpose_l(xsize,ysize,slice,pass,input,output,filter)
- local xstart = xstart[pass]
- local xstep = xstep[pass]
- local ystart = ystart[pass]
- local ystep = ystep[pass]
- local nx = idiv(xsize + xstep - xstart - 1,xstep)
- local ny = idiv(ysize + ystep - ystart - 1,ystep)
- local offset = filter and 1 or 0
- local xstep = xstep * slice
- local xstart = xstart * slice
- local xsize = xsize * slice
- local target = ystart * xsize + xstart + 1
- local ystep = ystep * xsize
- local start = 1
- local plus = nx * xstep
- local step = plus - xstep
- if not output then
- output = newoutput(xsize*(parts or slice)*ysize)
- end
- if slice == 1 then
- for j=0,ny-1 do
- start = start + offset
- local target = target + j * ystep
- for target=target,target+step,xstep do
- output[target] = input[start]
- start = start + slice
- end
- end
- elseif slice == 2 then
- for j=0,ny-1 do
- start = start + offset
- local target = target + j * ystep
- for target=target,target+step,xstep do
- output[target] = input[start]
- output[target+1] = input[start+1]
- start = start + slice
- end
- end
- elseif slice == 3 then
- for j=0,ny-1 do
- start = start + offset
- local target = target + j * ystep
- for target=target,target+step,xstep do
- output[target] = input[start]
- output[target+1] = input[start+1]
- output[target+2] = input[start+2]
- start = start + slice
- end
- end
- elseif slice == 4 then
- for j=0,ny-1 do
- start = start + offset
- local target = target + j * ystep
- for target=target,target+step,xstep do
- output[target] = input[start]
- output[target+1] = input[start+1]
- output[target+2] = input[start+2]
- output[target+3] = input[start+3]
- start = start + slice
- end
- end
- else
- local delta = slice - 1
- for j=0,ny-1 do
- start = start + offset
- local target = target + j * ystep
- for target=target,target+step,xstep do
- move(input,start,start+delta,target,output)
- start = start + slice
- end
- end
- end
- return output;
- end
+ -- local function transpose_l(xsize,ysize,slice,pass,input,output,filter)
+ -- local xstart = xstart[pass]
+ -- local xstep = xstep[pass]
+ -- local ystart = ystart[pass]
+ -- local ystep = ystep[pass]
+ -- local nx = idiv(xsize + xstep - xstart - 1,xstep)
+ -- local ny = idiv(ysize + ystep - ystart - 1,ystep)
+ -- local offset = filter and 1 or 0
+ -- local xstep = xstep * slice
+ -- local xstart = xstart * slice
+ -- local xsize = xsize * slice
+ -- local target = ystart * xsize + xstart + 1
+ -- local ystep = ystep * xsize
+ -- local start = 1
+ -- local plus = nx * xstep
+ -- local step = plus - xstep
+ -- if not output then
+ -- output = newoutput(xsize*(parts or slice)*ysize)
+ -- end
+ -- if slice == 1 then
+ -- for j=0,ny-1 do
+ -- start = start + offset
+ -- local target = target + j * ystep
+ -- for target=target,target+step,xstep do
+ -- output[target] = input[start]
+ -- start = start + slice
+ -- end
+ -- end
+ -- elseif slice == 2 then
+ -- for j=0,ny-1 do
+ -- start = start + offset
+ -- local target = target + j * ystep
+ -- for target=target,target+step,xstep do
+ -- output[target] = input[start]
+ -- output[target+1] = input[start+1]
+ -- start = start + slice
+ -- end
+ -- end
+ -- elseif slice == 3 then
+ -- for j=0,ny-1 do
+ -- start = start + offset
+ -- local target = target + j * ystep
+ -- for target=target,target+step,xstep do
+ -- output[target] = input[start]
+ -- output[target+1] = input[start+1]
+ -- output[target+2] = input[start+2]
+ -- start = start + slice
+ -- end
+ -- end
+ -- elseif slice == 4 then
+ -- for j=0,ny-1 do
+ -- start = start + offset
+ -- local target = target + j * ystep
+ -- for target=target,target+step,xstep do
+ -- output[target] = input[start]
+ -- output[target+1] = input[start+1]
+ -- output[target+2] = input[start+2]
+ -- output[target+3] = input[start+3]
+ -- start = start + slice
+ -- end
+ -- end
+ -- else
+ -- local delta = slice - 1
+ -- for j=0,ny-1 do
+ -- start = start + offset
+ -- local target = target + j * ystep
+ -- for target=target,target+step,xstep do
+ -- move(input,start,start+delta,target,output)
+ -- start = start + slice
+ -- end
+ -- end
+ -- end
+ -- return output;
+ -- end
local transpose_c = pnginterlace
-- print(band(rshift(v,4),0x03),extract(v,4,2))
-- print(band(rshift(v,6),0x03),extract(v,6,2))
- local function expand_l(t,xsize,ysize,parts,run,factor,filter)
- local size = ysize * xsize + 1 -- a bit of overshoot, needs testing, probably a few bytes us ok
- local xline = filter and (run+1) or run
- local f = filter and 1 or 0
- local l = xline - 1
- local n = 1
- local o = newoutput(size)
- local k = 0
- if factor then
- if parts == 4 then
- for i=1,ysize do
- for j=n+f,n+l do
- local v = t[j]
- if v == 0 then
- k = k + 2
- else
- k = k + 1 ; o[k] = extract4(v,4) * 0x11
- k = k + 1 ; o[k] = extract4(v,0) * 0x11
- end
- end
- k = i * xsize
- n = n + xline
- end
- elseif parts == 2 then
- for i=1,ysize do
- for j=n+f,n+l do
- local v = t[j]
- if v == 0 then
- k = k + 4
- else
- k = k + 1 ; o[k] = extract2(v,6) * 0x55
- k = k + 1 ; o[k] = extract2(v,4) * 0x55
- k = k + 1 ; o[k] = extract2(v,2) * 0x55
- k = k + 1 ; o[k] = extract2(v,0) * 0x55
- end
- end
- k = i * xsize
- n = n + xline
- end
- else
- for i=1,ysize do
- for j=n+f,n+l do
- local v = t[j]
- if v == 0 then
- k = k + 8
- else
- k = k + 1 ; if band(v,0x80) ~= 0 then o[k] = 0xFF end -- o[k] = extract1(v,7) * 0xFF
- k = k + 1 ; if band(v,0x40) ~= 0 then o[k] = 0xFF end -- o[k] = extract1(v,6) * 0xFF
- k = k + 1 ; if band(v,0x20) ~= 0 then o[k] = 0xFF end -- o[k] = extract1(v,5) * 0xFF
- k = k + 1 ; if band(v,0x10) ~= 0 then o[k] = 0xFF end -- o[k] = extract1(v,4) * 0xFF
- k = k + 1 ; if band(v,0x08) ~= 0 then o[k] = 0xFF end -- o[k] = extract1(v,3) * 0xFF
- k = k + 1 ; if band(v,0x04) ~= 0 then o[k] = 0xFF end -- o[k] = extract1(v,2) * 0xFF
- k = k + 1 ; if band(v,0x02) ~= 0 then o[k] = 0xFF end -- o[k] = extract1(v,1) * 0xFF
- k = k + 1 ; if band(v,0x01) ~= 0 then o[k] = 0xFF end -- o[k] = extract1(v,0) * 0xFF
- end
- end
- k = i * xsize
- n = n + xline
- end
- end
- else
- if parts == 4 then
- for i=1,ysize do
- for j=n+f,n+l do
- local v = t[j]
- if v == 0 then
- k = k + 2
- else
- k = k + 1 ; o[k] = extract4(v,4)
- k = k + 1 ; o[k] = extract4(v,0)
- end
- end
- k = i * xsize
- n = n + xline
- end
- elseif parts == 2 then
- for i=1,ysize do
- for j=n+f,n+l do
- local v = t[j]
- if v == 0 then
- k = k + 4
- else
- k = k + 1 ; o[k] = extract2(v,6)
- k = k + 1 ; o[k] = extract2(v,4)
- k = k + 1 ; o[k] = extract2(v,2)
- k = k + 1 ; o[k] = extract2(v,0)
- end
- end
- k = i * xsize
- n = n + xline
- end
- else
- for i=1,ysize do
- for j=n+f,n+l do
- local v = t[j]
- if v == 0 then
- k = k + 8
- else
- k = k + 1 ; if band(v,0x80) ~= 0 then o[k] = 1 end -- o[k] = extract1(v,7)
- k = k + 1 ; if band(v,0x40) ~= 0 then o[k] = 1 end -- o[k] = extract1(v,6)
- k = k + 1 ; if band(v,0x20) ~= 0 then o[k] = 1 end -- o[k] = extract1(v,5)
- k = k + 1 ; if band(v,0x10) ~= 0 then o[k] = 1 end -- o[k] = extract1(v,4)
- k = k + 1 ; if band(v,0x08) ~= 0 then o[k] = 1 end -- o[k] = extract1(v,3)
- k = k + 1 ; if band(v,0x04) ~= 0 then o[k] = 1 end -- o[k] = extract1(v,2)
- k = k + 1 ; if band(v,0x02) ~= 0 then o[k] = 1 end -- o[k] = extract1(v,1)
- k = k + 1 ; if band(v,0x01) ~= 0 then o[k] = 1 end -- o[k] = extract1(v,0)
- end
- end
- k = i * xsize
- n = n + xline
- end
- end
- end
- for i=size,xsize * ysize +1,-1 do
- o[i] = nil
- end
- return o, false
- end
+ -- local function expand_l(t,xsize,ysize,parts,run,factor,filter)
+ -- local size = ysize * xsize + 1 -- a bit of overshoot, needs testing, probably a few bytes us ok
+ -- local xline = filter and (run+1) or run
+ -- local f = filter and 1 or 0
+ -- local l = xline - 1
+ -- local n = 1
+ -- local o = newoutput(size)
+ -- local k = 0
+ -- if factor then
+ -- if parts == 4 then
+ -- for i=1,ysize do
+ -- for j=n+f,n+l do
+ -- local v = t[j]
+ -- if v == 0 then
+ -- k = k + 2
+ -- else
+ -- k = k + 1 ; o[k] = extract4(v,4) * 0x11
+ -- k = k + 1 ; o[k] = extract4(v,0) * 0x11
+ -- end
+ -- end
+ -- k = i * xsize
+ -- n = n + xline
+ -- end
+ -- elseif parts == 2 then
+ -- for i=1,ysize do
+ -- for j=n+f,n+l do
+ -- local v = t[j]
+ -- if v == 0 then
+ -- k = k + 4
+ -- else
+ -- k = k + 1 ; o[k] = extract2(v,6) * 0x55
+ -- k = k + 1 ; o[k] = extract2(v,4) * 0x55
+ -- k = k + 1 ; o[k] = extract2(v,2) * 0x55
+ -- k = k + 1 ; o[k] = extract2(v,0) * 0x55
+ -- end
+ -- end
+ -- k = i * xsize
+ -- n = n + xline
+ -- end
+ -- else
+ -- for i=1,ysize do
+ -- for j=n+f,n+l do
+ -- local v = t[j]
+ -- if v == 0 then
+ -- k = k + 8
+ -- else
+ -- k = k + 1 ; if band(v,0x80) ~= 0 then o[k] = 0xFF end -- o[k] = extract1(v,7) * 0xFF
+ -- k = k + 1 ; if band(v,0x40) ~= 0 then o[k] = 0xFF end -- o[k] = extract1(v,6) * 0xFF
+ -- k = k + 1 ; if band(v,0x20) ~= 0 then o[k] = 0xFF end -- o[k] = extract1(v,5) * 0xFF
+ -- k = k + 1 ; if band(v,0x10) ~= 0 then o[k] = 0xFF end -- o[k] = extract1(v,4) * 0xFF
+ -- k = k + 1 ; if band(v,0x08) ~= 0 then o[k] = 0xFF end -- o[k] = extract1(v,3) * 0xFF
+ -- k = k + 1 ; if band(v,0x04) ~= 0 then o[k] = 0xFF end -- o[k] = extract1(v,2) * 0xFF
+ -- k = k + 1 ; if band(v,0x02) ~= 0 then o[k] = 0xFF end -- o[k] = extract1(v,1) * 0xFF
+ -- k = k + 1 ; if band(v,0x01) ~= 0 then o[k] = 0xFF end -- o[k] = extract1(v,0) * 0xFF
+ -- end
+ -- end
+ -- k = i * xsize
+ -- n = n + xline
+ -- end
+ -- end
+ -- else
+ -- if parts == 4 then
+ -- for i=1,ysize do
+ -- for j=n+f,n+l do
+ -- local v = t[j]
+ -- if v == 0 then
+ -- k = k + 2
+ -- else
+ -- k = k + 1 ; o[k] = extract4(v,4)
+ -- k = k + 1 ; o[k] = extract4(v,0)
+ -- end
+ -- end
+ -- k = i * xsize
+ -- n = n + xline
+ -- end
+ -- elseif parts == 2 then
+ -- for i=1,ysize do
+ -- for j=n+f,n+l do
+ -- local v = t[j]
+ -- if v == 0 then
+ -- k = k + 4
+ -- else
+ -- k = k + 1 ; o[k] = extract2(v,6)
+ -- k = k + 1 ; o[k] = extract2(v,4)
+ -- k = k + 1 ; o[k] = extract2(v,2)
+ -- k = k + 1 ; o[k] = extract2(v,0)
+ -- end
+ -- end
+ -- k = i * xsize
+ -- n = n + xline
+ -- end
+ -- else
+ -- for i=1,ysize do
+ -- for j=n+f,n+l do
+ -- local v = t[j]
+ -- if v == 0 then
+ -- k = k + 8
+ -- else
+ -- k = k + 1 ; if band(v,0x80) ~= 0 then o[k] = 1 end -- o[k] = extract1(v,7)
+ -- k = k + 1 ; if band(v,0x40) ~= 0 then o[k] = 1 end -- o[k] = extract1(v,6)
+ -- k = k + 1 ; if band(v,0x20) ~= 0 then o[k] = 1 end -- o[k] = extract1(v,5)
+ -- k = k + 1 ; if band(v,0x10) ~= 0 then o[k] = 1 end -- o[k] = extract1(v,4)
+ -- k = k + 1 ; if band(v,0x08) ~= 0 then o[k] = 1 end -- o[k] = extract1(v,3)
+ -- k = k + 1 ; if band(v,0x04) ~= 0 then o[k] = 1 end -- o[k] = extract1(v,2)
+ -- k = k + 1 ; if band(v,0x02) ~= 0 then o[k] = 1 end -- o[k] = extract1(v,1)
+ -- k = k + 1 ; if band(v,0x01) ~= 0 then o[k] = 1 end -- o[k] = extract1(v,0)
+ -- end
+ -- end
+ -- k = i * xsize
+ -- n = n + xline
+ -- end
+ -- end
+ -- end
+ -- for i=size,xsize * ysize +1,-1 do
+ -- o[i] = nil
+ -- end
+ -- return o, false
+ -- end
local expand_c = pngexpand
@@ -672,8 +700,8 @@ do
local xstep = xstep[pass]
local ystart = ystart[pass]
local ystep = ystep[pass]
- local nx = idiv(xsize + xstep - xstart - 1,xstep)
- local ny = idiv(ysize + ystep - ystart - 1,ystep)
+ local nx = (xsize + xstep - xstart - 1) // xstep
+ local ny = (ysize + ystep - ystart - 1) // ystep
if nx > 0 and ny > 0 then
local input, filter
if parts then
@@ -715,164 +743,177 @@ do
return r
end
- local function createmask_l(content,palette,transparent,xsize,ysize,colordepth,colorspace)
- if palette then
- local r = expandvector(transparent)
- local size = xsize*ysize
- local len = ceil(xsize*colordepth/8) + 1
- local o = newoutput(xsize*ysize)
- local u = setmetatableindex(zero)
- content = zlibdecompress(content)
- content = openstring(content)
- for i=0,ysize-1 do
- local t = readbytetable(content,len)
- local k = i * xsize
- local filter = t[1]
- if filter == 0 then
- elseif filter == 1 then
- for j=3,len do
- t[j] = (t[j] + t[j-1]) % 256
- end
- elseif filter == 2 then
- for j=2,len do
- t[j] = (t[j] + u[j]) % 256
- end
- elseif filter == 3 then
- local j = 2
- t[j] = (t[j] + idiv(u[j],2)) % 256
- for j=3,len do
- t[j] = (t[j] + idiv(t[j-1] + u[j],2)) % 256
- end
- elseif filter == 4 then
- local j = 2
- local p = j - len
- local b = t[p]
- if b < 0 then
- b = - b
- end
- if b > 0 then
- t[j] = (t[j] + b) % 256
- end
- for j=3,len do
- local p = j - len
- local a = t[j-1]
- local b = t[p]
- local c = t[p-1]
- local pa = b - c
- local pb = a - c
- local pc = pa + pb
- if pa < 0 then pa = - pa end
- if pb < 0 then pb = - pb end
- if pc < 0 then pc = - pc end
- t[j] = (t[j] + ((pa <= pb and pa <= pc and a) or (pb <= pc and b) or c)) % 256
- end
- end
- if colordepth == 8 then
- for j=2,len do
- local v = t[j]
- k = k + 1 ; o[k] = r[v]
- end
- elseif colordepth == 4 then
- for j=2,len do
- local v = t[j]
- k = k + 1 ; o[k] = r[extract4(v,4)]
- k = k + 1 ; o[k] = r[extract4(v,0)]
- end
- elseif colordepth == 2 then
- for j=2,len do
- local v = t[j]
- k = k + 1 ; o[k] = r[extract2(v,6)]
- k = k + 1 ; o[k] = r[extract2(v,4)]
- k = k + 1 ; o[k] = r[extract2(v,2)]
- k = k + 1 ; o[k] = r[extract2(v,0)]
- end
- else
- for j=2,len do
- local v = t[j]
- k = k + 1 ; o[k] = r[extract1(v,7)]
- k = k + 1 ; o[k] = r[extract1(v,6)]
- k = k + 1 ; o[k] = r[extract1(v,5)]
- k = k + 1 ; o[k] = r[extract1(v,4)]
- k = k + 1 ; o[k] = r[extract1(v,3)]
- k = k + 1 ; o[k] = r[extract1(v,2)]
- k = k + 1 ; o[k] = r[extract1(v,1)]
- k = k + 1 ; o[k] = r[extract1(v,0)]
- end
- end
- u = t
- end
- return concat(o,"",1,size)
- end
- end
+ -- local function createmask_l(content,palette,transparent,xsize,ysize,colordepth,colorspace)
+ -- if palette then
+ -- local r = expandvector(transparent)
+ -- local size = xsize*ysize
+ -- local len = ceil(xsize*colordepth/8) + 1
+ -- local o = newoutput(xsize*ysize)
+ -- local u = setmetatableindex(zero)
+ -- content = zlibdecompress(content)
+ -- content = openstring(content)
+ -- for i=0,ysize-1 do
+ -- local t = readbytetable(content,len)
+ -- local k = i * xsize
+ -- local filter = t[1]
+ -- if filter == 0 then
+ -- elseif filter == 1 then
+ -- for j=3,len do
+ -- t[j] = (t[j] + t[j-1]) % 256
+ -- end
+ -- elseif filter == 2 then
+ -- for j=2,len do
+ -- t[j] = (t[j] + u[j]) % 256
+ -- end
+ -- elseif filter == 3 then
+ -- local j = 2
+ -- t[j] = (t[j] + idiv(u[j],2)) % 256
+ -- for j=3,len do
+ -- t[j] = (t[j] + idiv(t[j-1] + u[j],2)) % 256
+ -- end
+ -- elseif filter == 4 then
+ -- local j = 2
+ -- local p = j - len
+ -- local b = t[p]
+ -- if b < 0 then
+ -- b = - b
+ -- end
+ -- if b > 0 then
+ -- t[j] = (t[j] + b) % 256
+ -- end
+ -- for j=3,len do
+ -- local p = j - len
+ -- local a = t[j-1]
+ -- local b = t[p]
+ -- local c = t[p-1]
+ -- local pa = b - c
+ -- local pb = a - c
+ -- local pc = pa + pb
+ -- if pa < 0 then pa = - pa end
+ -- if pb < 0 then pb = - pb end
+ -- if pc < 0 then pc = - pc end
+ -- t[j] = (t[j] + ((pa <= pb and pa <= pc and a) or (pb <= pc and b) or c)) % 256
+ -- end
+ -- end
+ -- if colordepth == 8 then
+ -- for j=2,len do
+ -- local v = t[j]
+ -- k = k + 1 ; o[k] = r[v]
+ -- end
+ -- elseif colordepth == 4 then
+ -- for j=2,len do
+ -- local v = t[j]
+ -- k = k + 1 ; o[k] = r[extract4(v,4)]
+ -- k = k + 1 ; o[k] = r[extract4(v,0)]
+ -- end
+ -- elseif colordepth == 2 then
+ -- for j=2,len do
+ -- local v = t[j]
+ -- k = k + 1 ; o[k] = r[extract2(v,6)]
+ -- k = k + 1 ; o[k] = r[extract2(v,4)]
+ -- k = k + 1 ; o[k] = r[extract2(v,2)]
+ -- k = k + 1 ; o[k] = r[extract2(v,0)]
+ -- end
+ -- else
+ -- for j=2,len do
+ -- local v = t[j]
+ -- k = k + 1 ; o[k] = r[extract1(v,7)]
+ -- k = k + 1 ; o[k] = r[extract1(v,6)]
+ -- k = k + 1 ; o[k] = r[extract1(v,5)]
+ -- k = k + 1 ; o[k] = r[extract1(v,4)]
+ -- k = k + 1 ; o[k] = r[extract1(v,3)]
+ -- k = k + 1 ; o[k] = r[extract1(v,2)]
+ -- k = k + 1 ; o[k] = r[extract1(v,1)]
+ -- k = k + 1 ; o[k] = r[extract1(v,0)]
+ -- end
+ -- end
+ -- u = t
+ -- end
+ -- return concat(o,"",1,size)
+ -- end
+ -- end
+
+ -- We had this for a while (the reference now):
+ --
+ -- local function createmask_c(content,palette,transparent,xsize,ysize,colordepth,colorspace)
+ -- if palette then
+ -- local r = expandvector(transparent)
+ -- local size = xsize*ysize
+ -- local len = ceil(xsize*colordepth/8)
+ -- local o = newoutput(size)
+ -- content = zlibdecompress(content)
+ -- content = pngapplyfilter(content,len,ysize,1) -- nostrip (saves copy)
+ -- content = openstring(content)
+ -- for i=0,ysize-1 do
+ -- local t = readbytetable(content,len)
+ -- local k = i * xsize
+ -- if colordepth == 8 then
+ -- for j=1,len do
+ -- local v = t[j]
+ -- k = k + 1 ; o[k] = r[v]
+ -- end
+ -- elseif colordepth == 4 then
+ -- for j=1,len do
+ -- local v = t[j]
+ -- k = k + 1 ; o[k] = r[(v >> 4) & 0x0F] -- r[extract4(v,4)]
+ -- k = k + 1 ; o[k] = r[(v >> 0) & 0x0F] -- r[extract4(v,0)]
+ -- end
+ -- elseif colordepth == 2 then
+ -- for j=1,len do
+ -- local v = t[j]
+ -- k = k + 1 ; o[k] = r[(v >> 6) & 0x03] -- r[extract2(v,6)]
+ -- k = k + 1 ; o[k] = r[(v >> 4) & 0x03] -- r[extract2(v,4)]
+ -- k = k + 1 ; o[k] = r[(v >> 2) & 0x03] -- r[extract2(v,2)]
+ -- k = k + 1 ; o[k] = r[(v >> 0) & 0x03] -- r[extract2(v,0)]
+ -- end
+ -- else
+ -- for j=1,len do
+ -- local v = t[j]
+ -- k = k + 1 ; o[k] = r[(v >> 7) & 0x01] -- r[extract1(v,7)]
+ -- k = k + 1 ; o[k] = r[(v >> 6) & 0x01] -- r[extract1(v,6)]
+ -- k = k + 1 ; o[k] = r[(v >> 5) & 0x01] -- r[extract1(v,5)]
+ -- k = k + 1 ; o[k] = r[(v >> 4) & 0x01] -- r[extract1(v,4)]
+ -- k = k + 1 ; o[k] = r[(v >> 3) & 0x01] -- r[extract1(v,3)]
+ -- k = k + 1 ; o[k] = r[(v >> 2) & 0x01] -- r[extract1(v,2)]
+ -- k = k + 1 ; o[k] = r[(v >> 1) & 0x01] -- r[extract1(v,1)]
+ -- k = k + 1 ; o[k] = r[(v >> 0) & 0x01] -- r[extract1(v,0)]
+ -- end
+ -- end
+ -- end
+ -- return concat(o,"",1,size)
+ -- end
+ -- end
+ --
+ -- But this is nicer for memory usage:
local function createmask_c(content,palette,transparent,xsize,ysize,colordepth,colorspace)
if palette then
- local r = expandvector(transparent)
- local size = xsize*ysize
- local len = ceil(xsize*colordepth/8)
- local o = newoutput(size)
- content = zlibdecompress(content)
- content = pngapplyfilter(content,len,ysize,1) -- nostrip (saves copy)
- content = openstring(content)
- for i=0,ysize-1 do
- local t = readbytetable(content,len)
- local k = i * xsize
- if colordepth == 8 then
- for j=1,len do
- local v = t[j]
- k = k + 1 ; o[k] = r[v]
- end
- elseif colordepth == 4 then
- for j=1,len do
- local v = t[j]
- k = k + 1 ; o[k] = r[extract4(v,4)]
- k = k + 1 ; o[k] = r[extract4(v,0)]
- end
- elseif colordepth == 2 then
- for j=1,len do
- local v = t[j]
- k = k + 1 ; o[k] = r[extract2(v,6)]
- k = k + 1 ; o[k] = r[extract2(v,4)]
- k = k + 1 ; o[k] = r[extract2(v,2)]
- k = k + 1 ; o[k] = r[extract2(v,0)]
- end
- else
- for j=1,len do
- local v = t[j]
- k = k + 1 ; o[k] = r[extract1(v,7)]
- k = k + 1 ; o[k] = r[extract1(v,6)]
- k = k + 1 ; o[k] = r[extract1(v,5)]
- k = k + 1 ; o[k] = r[extract1(v,4)]
- k = k + 1 ; o[k] = r[extract1(v,3)]
- k = k + 1 ; o[k] = r[extract1(v,2)]
- k = k + 1 ; o[k] = r[extract1(v,1)]
- k = k + 1 ; o[k] = r[extract1(v,0)]
- end
- end
- end
- return concat(o,"",1,size)
- end
- end
-
- local function tocmyk_l(content,colordepth)
- local l = #content
- local t = { }
- local n = 0
- if colordepth == 8 then
- for i=1,l,3 do
- local r, g, b = byte(content,i,i+2)
- n = n + 1 ; t[n] = char(255-r,255-g,255-b,0) -- a tad faster than chars[...]
- end
- else
- for i=1,l,6 do
- local r1, r2, g1, g2, b1, b2 = byte(content,i,i+5)
- n = n + 1 ; t[n] = char(255-r1,255-r2,255-g1,255-g2,255-b1,255-b2,0,0)
- end
+ local len = ceil(xsize*colordepth/8)
+ content = zlibdecompress(content)
+ content = pngapplyfilter(content,len,ysize,1) -- nostrip (saves copy)
+ return pngtomask(content,transparent,xsize,ysize,colordepth)
end
- return concat(t)
end
- local tocmyk_c = pngtocmyk or tocmyk_l
+ -- local function tocmyk_l(content,colordepth)
+ -- local l = #content
+ -- local t = { }
+ -- local n = 0
+ -- if colordepth == 8 then
+ -- for i=1,l,3 do
+ -- local r, g, b = byte(content,i,i+2)
+ -- n = n + 1 ; t[n] = char(255-r,255-g,255-b,0) -- a tad faster than chars[...]
+ -- end
+ -- else
+ -- for i=1,l,6 do
+ -- local r1, r2, g1, g2, b1, b2 = byte(content,i,i+5)
+ -- n = n + 1 ; t[n] = char(255-r1,255-r2,255-g1,255-g2,255-b1,255-b2,0,0)
+ -- end
+ -- end
+ -- return concat(t)
+ -- end
+
+ local tocmyk_c = pngtocmyk
local function converttocmyk(content,colorspace,colordepth)
if colorspace == "DeviceRGB" and colordepth == 8 or colordepth == 16 then
@@ -885,16 +926,16 @@ do
return content, colorspace
end
- local function switch(v)
- if v then
- filtermask = filtermask_l
- decodemask = decodemask_l
- decodestrip = decodestrip_l
- transpose = transpose_l
- expand = expand_l
- createmask = createmask_l
- tocmyk = tocmyk_l
- else
+ -- local function switch(v)
+ -- if v then
+ -- filtermask = filtermask_l
+ -- decodemask = decodemask_l
+ -- decodestrip = decodestrip_l
+ -- transpose = transpose_l
+ -- expand = expand_l
+ -- createmask = createmask_l
+ -- tocmyk = tocmyk_l
+ -- else
filtermask = filtermask_c
decodemask = decodemask_c
decodestrip = decodestrip_c
@@ -902,15 +943,15 @@ do
expand = expand_c
createmask = createmask_c
tocmyk = tocmyk_c
- end
- end
+ -- end
+ -- end
- if pngapplyfilter then
- switch(false)
- directives.register("graphics.png.purelua",switch)
- else
- switch(true)
- end
+ -- if pngapplyfilter then
+ -- switch(false)
+ -- directives.register("graphics.png.purelua",switch)
+ -- else
+ -- switch(true)
+ -- end
local alwaysdecode = false -- trucky with palettes
local compresslevel = 3
@@ -955,7 +996,7 @@ do
if not idat then
return
end
- local pngfile = newcontent(filename,method)
+ local pngfile = newcontent(filename,method,true)
if not pngfile then
return
end
@@ -1125,7 +1166,7 @@ do
palette = pdfarray {
pdfconstant("Indexed"),
pdfconstant(colorspace),
- idiv(#palette,nofbytes),
+ #palette // nofbytes,
pdfreference(pdfflushstreamobject(palette)),
}
end
@@ -1140,6 +1181,7 @@ do
Filter = filter,
ColorSpace = palette or pdfconstant(colorspace),
Length = #content,
+-- Decode = pdfarray { 0, .5, 0, .5, 0, .5 } -- darker (test for luatex list)
} + specification.attr
if mask then
local d = pdfdictionary {
@@ -1149,6 +1191,7 @@ do
Height = ysize,
BitsPerComponent = palette and 8 or colordepth,
ColorSpace = pdfconstant("DeviceGray"),
+-- Decode = pdfarray { 0, .5, 0, .5, 0, .5 }, -- lighter (test for luatex list)
}
xobject.SMask = pdfreference(pdfflushstreamobject(mask,d()))
end
@@ -1200,38 +1243,41 @@ do
s = - s
end
if s > 0 then
- if s == 1 then
- for i=1,y do
- local r = d[i]
- for j=1,x do
- n = n + 1 ; t[n] = chars[r[j]]
- end
- end
- elseif s == 2 then
- for i=1,y do
- local r = d[i]
- for j=1,x do
- local c = r[j]
- n = n + 1 ; t[n] = chars[c[1]]
- n = n + 1 ; t[n] = chars[c[2]]
- n = n + 1 ; t[n] = chars[c[3]]
- -- n = n + 1 ; t[n] = char(c[1],c[2],c[3]) -- test this
- end
- end
- elseif s == 3 then
- for i=1,y do
- local r = d[i]
- for j=1,x do
- local c = r[j]
- n = n + 1 ; t[n] = chars[c[1]]
- n = n + 1 ; t[n] = chars[c[2]]
- n = n + 1 ; t[n] = chars[c[3]]
- n = n + 1 ; t[n] = chars[c[4]]
- -- n = n + 1 ; t[n] = char(c[1],c[2],c[3],c[4]) -- test this
- end
- end
- end
- return concat(t)
+ -- if true then
+ return string.packrowscolumns(d)
+ -- end
+ -- if s == 1 then
+ -- for i=1,y do
+ -- local r = d[i]
+ -- for j=1,x do
+ -- n = n + 1 ; t[n] = chars[r[j]]
+ -- end
+ -- end
+ -- elseif s == 2 then
+ -- for i=1,y do
+ -- local r = d[i]
+ -- for j=1,x do
+ -- local c = r[j]
+ -- n = n + 1 ; t[n] = chars[c[1]]
+ -- n = n + 1 ; t[n] = chars[c[2]]
+ -- n = n + 1 ; t[n] = chars[c[3]]
+ -- -- n = n + 1 ; t[n] = char(c[1],c[2],c[3]) -- test this
+ -- end
+ -- end
+ -- elseif s == 3 then
+ -- for i=1,y do
+ -- local r = d[i]
+ -- for j=1,x do
+ -- local c = r[j]
+ -- n = n + 1 ; t[n] = chars[c[1]]
+ -- n = n + 1 ; t[n] = chars[c[2]]
+ -- n = n + 1 ; t[n] = chars[c[3]]
+ -- n = n + 1 ; t[n] = chars[c[4]]
+ -- -- n = n + 1 ; t[n] = char(c[1],c[2],c[3],c[4]) -- test this
+ -- end
+ -- end
+ -- end
+ -- return concat(t)
else
local z = d[0] and 0 or 1
if s == -1 then
@@ -1273,7 +1319,7 @@ do
elseif colorspace == 2 then
colorspace = "DeviceRGB"
elseif colorspace == 3 then
- colorspace = "DeviceCMYK"
+ colorspace = "DeviceCMYK"
end
local colordepth = (specification.colordepth or 2) == 16 or 8
local index = specification.index
@@ -1309,8 +1355,10 @@ do
}
xobject.SMask = pdfreference(pdfflushstreamobject(pack(specification,"mask"),d()))
end
+ local w = specification.width
+ local h = specification.height
return createimage {
- bbox = { 0, 0, specification.width/xsize, specification.height/ysize }, -- mandate
+ bbox = { 0, 0, w and (w/xsize) or xsize, h and (h/ysize) or ysize }, -- mandate
-- nolength = true,
nobbox = true,
notype = true,
@@ -1319,7 +1367,7 @@ do
}
end
- backends.pdf.codeinjections.bitmap = injectors.bitmap
+ codeinjections.bitmap = injectors.bitmap
end
@@ -1346,6 +1394,6 @@ end
-- return true
-- end
-backends.pdf.codeinjections.jpg = lpdf.injectors.jpg
-backends.pdf.codeinjections.jp2 = lpdf.injectors.jp2
-backends.pdf.codeinjections.png = lpdf.injectors.png
+codeinjections.jpg = lpdf.injectors.jpg
+codeinjections.jp2 = lpdf.injectors.jp2
+codeinjections.png = lpdf.injectors.png
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-ini.lmt
index 27625606aa6..d4b0ccc64e4 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-ini.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-ini.lmt
@@ -7,10 +7,57 @@ if not modules then modules = { } end modules ['lpdf-ini'] = {
license = "see context related readme files"
}
--- beware of "too many locals" here
+-- This file is the starting point for PDF related features. Although quite a bit
+-- evolved over time, most of what we do in MkIV and LMTX already was available in
+-- MkII (with e.g. pdfTeX) anyway, but it was implemented in TeX. We're talking of
+-- arbitrary annotations, media like audio and video, widgets (aka forms) with
+-- chains and appearances, comments, attachments, javascript based manipulation of
+-- layers, graphic trickery like shading, color spaces, transparancy, flash stuff,
+-- executing commands, accessing the interface, etc. In that respect there isn't
+-- much really new here, after all MkII was there before the turn of the century,
+-- but it's just more fun to maintain it in Lua than in low level TeX. Also, because
+-- we no longer deal with other engines, there is no need to go low level TeX, which
+-- makes for better code.
+--
+-- However, over the decades PDF evolved and it shows. For instance audio and video
+-- support changed and became worse. Some things were dropped (smil, flash, movies,
+-- audio). Using appearances for widgets became a pain because it sort of assumes
+-- that you construct these forms in acrobat which then leads to bugs becoming
+-- features which means that certain things simply don't work (initializations,
+-- chained widgets, funny dingabt defaults, etc), probably because they never were
+-- tested when viewers evolved.
+--
+-- Attachment are also a fragile bit. And comments that at some point became
+-- dependent on rendering annotations ... it all deserves no beauty price because
+-- reliable simplicity was replaced by unreliable complexity. Something that might
+-- work today often didn't in the past and might fail in the future, if only because
+-- it more relates to the viewer user interface, maybe changing security demands or
+-- whatever. We cannot predict this. A side effect is that we keep adapting and even
+-- worse, have to remove features that originally were expected to stay (media
+-- stuff). To some extend it's a waste of time to get it all supported, also because
+-- the open source viewers lag behind. It makes no sense to keep tons of code
+-- arround that will never be used (again).
+--
+-- Also, I don't think that these PDF features were added with something else than
+-- Acrobat in mind: a flexible system like TeX that actually could inject these low
+-- level features right from the moment that they showed up (and before they were
+-- fully tested) is not mainstream enough to be taken into account. One cannot blame
+-- a commercial product for its own priorities. The evolution of the web might also
+-- have interfered with the agendas.
+--
+-- As a consequence, the code that we use is spread over files and it might change
+-- over time as we try to adapt. But it's easy for the mentioned features to fix one
+-- aspect and break another. Eventually we might see more of these fancy features to
+-- be removed because they make no sense on the long run, than such features being
+-- added. In retrospect maybe many such features were just experiments: anchored in
+-- time for throw away documents (like presentations), never meant to be used on the
+-- long term. In that respect PDF is a disappointment.
+
+-- Comment: beware of "too many locals" problem here.
local setmetatable, getmetatable, type, next, tostring, tonumber, rawset = setmetatable, getmetatable, type, next, tostring, tonumber, rawset
-local char, byte, format, gsub, concat, match, sub, gmatch = string.char, string.byte, string.format, string.gsub, table.concat, string.match, string.sub, string.gmatch
+local concat = table.concat
+local char, byte, format, sub, tohex = string.char, string.byte, string.format, string.sub, string.tohex
local utfchar, utfbyte, utfvalues = utf.char, utf.byte, utf.values
local sind, cosd, max, min = math.sind, math.cosd, math.max, math.min
local sort, sortedhash = table.sort, table.sortedhash
@@ -18,37 +65,24 @@ local P, C, R, S, Cc, Cs, V = lpeg.P, lpeg.C, lpeg.R, lpeg.S, lpeg.Cc, lpeg.Cs,
local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns
local formatters = string.formatters
local isboolean = string.is_boolean
-local rshift = bit32.rshift
local report_objects = logs.reporter("backend","objects")
local report_finalizing = logs.reporter("backend","finalizing")
local report_blocked = logs.reporter("backend","blocked")
-local implement = interfaces.implement
-
+local implement = interfaces and interfaces.implement
local context = context
-- In ConTeXt MkIV we use utf8 exclusively so all strings get mapped onto a hex
-- encoded utf16 string type between <>. We could probably save some bytes by using
--- strings between () but then we end up with escaped ()\ too.
+-- strings between () but then we end up with escaped ()\ characters too.
pdf = type(pdf) == "table" and pdf or { }
local factor = number.dimenfactors.bp
-local codeinjections = { }
-local nodeinjections = { }
-
-local backends = backends
-
-local pdfbackend = {
- comment = "backend for directly generating pdf output",
- nodeinjections = nodeinjections,
- codeinjections = codeinjections,
- registrations = { },
- tables = { },
-}
-
-backends.pdf = pdfbackend
+local pdfbackend = backends and backends.registered.pdf or { }
+local codeinjections = pdfbackend.codeinjections
+local nodeinjections = pdfbackend.nodeinjections
lpdf = lpdf or { }
local lpdf = lpdf
@@ -62,34 +96,51 @@ end)
local trace_finalizers = false trackers.register("backend.finalizers", function(v) trace_finalizers = v end)
local trace_resources = false trackers.register("backend.resources", function(v) trace_resources = v end)
+do
+
+ -- This is for a future feature (still under investigation and consideration). So,
+ -- it is work in progress (and brings a harmless overhead for now).
+
+ local initializers = { }
+
+ function lpdf.registerinitializer(initialize)
+ initializers[#initializers+1] = initialize
+ end
+
+ function lpdf.initialize(f)
+ for i=1,#initializers do
+ initializers[i]()
+ end
+ end
+
+end
+
local pdfreserveobject
local pdfimmediateobject
-updaters.register("backend.update.lpdf",function()
- pdfreserveobject = lpdf.reserveobject
- pdfimmediateobject = lpdf.immediateobject
+updaters.register("backends.pdf.latebindings",function()
+ pdfreserveobject = lpdf.reserveobject
+ pdfimmediateobject = lpdf.immediateobject
end)
do
- updaters.register("backend.update.lpdf",function()
+ local pdfgetmatrix, pdfhasmatrix, pdfgetpos
+
+ updaters.register("backends.pdf.latebindings",function()
job.positions.registerhandlers {
getpos = drivers.getpos,
getrpos = drivers.getrpos,
gethpos = drivers.gethpos,
getvpos = drivers.getvpos,
}
- lpdf.getpos = drivers.getpos
- end)
-
- local pdfgetmatrix, pdfhasmatrix, pdfgetpos
-
- updaters.register("backend.update.lpdf",function()
pdfgetmatrix = lpdf.getmatrix
pdfhasmatrix = lpdf.hasmatrix
- pdfgetpos = lpdf.getpos
+ pdfgetpos = drivers.getpos
end)
+ function lpdf.getpos() return pdfgetpos() end
+
-- local function transform(llx,lly,urx,ury,rx,sx,sy,ry)
-- local x1 = llx * rx + lly * sy
-- local y1 = llx * sx + lly * ry
@@ -146,27 +197,6 @@ do
end
--- we could use a hash of predefined unicodes
-
--- local function tosixteen(str) -- an lpeg might be faster (no table)
--- if not str or str == "" then
--- return "<feff>" -- not () as we want an indication that it's unicode
--- else
--- local r, n = { "<feff" }, 1
--- for b in utfvalues(str) do
--- n = n + 1
--- if b < 0x10000 then
--- r[n] = format("%04x",b)
--- else
--- r[n] = format("%04x%04x",rshift(b,10),b%1024+0xDC00)
--- end
--- end
--- n = n + 1
--- r[n] = ">"
--- return concat(r)
--- end
--- end
-
local tosixteen, fromsixteen, topdfdoc, frompdfdoc, toeight, fromeight
do
@@ -177,8 +207,7 @@ do
v = format("%04x",v)
else
v = v - 0x10000
- v = format("%04x%04x",rshift(v,10)+0xD800,v%1024+0xDC00)
- -- v = format("%04x%04x",rshift(v-0x10000,10)+0xD800,v%1024+0xDC00)
+ v = format("%04x%04x",(v>>10)+0xD800,v%1024+0xDC00)
end
t[k] = v
return v
@@ -194,6 +223,8 @@ do
end
end
+ -- we could make a helper for this
+
local more = 0
local pattern = C(4) / function(s) -- needs checking !
@@ -220,8 +251,8 @@ do
end
end
- local toregime = regimes.toregime
- local fromregime = regimes.fromregime
+ local toregime = regimes and regimes.toregime
+ local fromregime = regimes and regimes.fromregime
local escaped = Cs(Cc("(") * (S("\\()\n\r\t\b\f")/"\\%0" + P(1))^0 * Cc(")"))
topdfdoc = function(str,default)
@@ -323,22 +354,54 @@ do
end
+local pdfescaped do
+
+ local replacer = S("\0\t\n\r\f ()[]{}/%%#\\") / {
+ ["\00"]="#00",
+ ["\09"]="#09",
+ ["\10"]="#0a",
+ ["\12"]="#0c",
+ ["\13"]="#0d",
+ [ " " ]="#20",
+ [ "#" ]="#23",
+ [ "%" ]="#25",
+ [ "(" ]="#28",
+ [ ")" ]="#29",
+ [ "/" ]="#2f",
+ [ "[" ]="#5b",
+ [ "\\"]="#5c",
+ [ "]" ]="#5d",
+ [ "{" ]="#7b",
+ [ "}" ]="#7d",
+ } + P(1)
+
+ local p_escaped_1 = Cs(Cc("/") * replacer^0)
+ local p_escaped_2 = Cs( replacer^0)
+
+ pdfescaped = function(str,slash)
+ return lpegmatch(slash and p_escaped_1 or p_escaped_2,str) or str
+ end
+
+ lpdf.escaped = pdfescaped
+
+end
+
local tostring_a, tostring_d
do
- local f_key_null = formatters["/%s null"]
- local f_key_value = formatters["/%s %s"]
- -- local f_key_dictionary = formatters["/%s << % t >>"]
+ local f_key_null = formatters["%s null"]
+ local f_key_value = formatters["%s %s"]
+ -- local f_key_dictionary = formatters["%s << % t >>"]
-- local f_dictionary = formatters["<< % t >>"]
- local f_key_dictionary = formatters["/%s << %s >>"]
+ local f_key_dictionary = formatters["%s << %s >>"]
local f_dictionary = formatters["<< %s >>"]
- -- local f_key_array = formatters["/%s [ % t ]"]
+ -- local f_key_array = formatters["%s [ % t ]"]
-- local f_array = formatters["[ % t ]"]
- local f_key_array = formatters["/%s [ %s ]"]
+ local f_key_array = formatters["%s [ %s ]"]
local f_array = formatters["[ %s ]"]
- local f_key_number = formatters["/%s %N"] -- always with max 9 digits and integer is possible
- local f_tonumber = formatters["%N"] -- always with max 9 digits and integer is possible
+ local f_key_number = formatters["%s %N"] -- always with max 9 digits and integer is possible
+ local f_tonumber = formatters["%N"] -- always with max 9 digits and integer is possible
tostring_d = function(t,contentonly,key)
if next(t) then
@@ -363,6 +426,9 @@ do
local v = t[k]
local tv = type(v)
-- mostly tables
+ --
+ k = pdfescaped(k,true)
+ --
if tv == "table" then
-- local mv = getmetatable(v)
-- if mv and mv.__lpdftype then
@@ -393,7 +459,7 @@ do
if contentonly then
return r
elseif key then
- return f_key_dictionary(key,r)
+ return f_key_dictionary(pdfescaped(key,true),r)
else
return f_dictionary(r)
end
@@ -443,7 +509,7 @@ do
if contentonly then
return r
elseif key then
- return f_key_array(key,r)
+ return f_key_array(pdfescaped(key,true),r)
else
return f_array(r)
end
@@ -620,29 +686,10 @@ do
for i=-1,9 do cache[i] = pdfnumber(i) end
- local replacer = S("\0\t\n\r\f ()[]{}/%%#\\") / {
- ["\00"]="#00",
- ["\09"]="#09",
- ["\10"]="#0a",
- ["\12"]="#0c",
- ["\13"]="#0d",
- [ " " ]="#20",
- [ "#" ]="#23",
- [ "%" ]="#25",
- [ "(" ]="#28",
- [ ")" ]="#29",
- [ "/" ]="#2f",
- [ "[" ]="#5b",
- [ "\\"]="#5c",
- [ "]" ]="#5d",
- [ "{" ]="#7b",
- [ "}" ]="#7d",
- } + P(1)
-
- local escaped = Cs(Cc("/") * replacer^0)
+ local escaped = lpdf.escaped
local cache = table.setmetatableindex(function(t,k)
- local v = setmetatable({ lpegmatch(escaped,k) }, mt_c)
+ local v = setmetatable({ escaped(k,true) }, mt_c)
t[k] = v
return v
end)
@@ -654,12 +701,6 @@ do
return cache[str]
end
- local escaped = Cs(replacer^0)
-
- function lpdf.escaped(str)
- return lpegmatch(escaped,str) or str
- end
-
end
local pdfnull, pdfboolean, pdfreference, pdfverbose
@@ -725,6 +766,8 @@ lpdf.reference = pdfreference
lpdf.verbose = pdfverbose
lpdf.literal = pdfliteral
+if not callbacks then return lpdf end
+
-- three priority levels, default=2
local pagefinalizers = { { }, { }, { } }
@@ -748,6 +791,8 @@ end
resetpageproperties()
+lpdf.registerinitializer(resetpageproperties)
+
local function addtopageresources (k,v) pageresources [k] = v end
local function addtopageattributes (k,v) pageattributes [k] = v end
local function addtopagesattributes(k,v) pagesattributes[k] = v end
@@ -807,13 +852,12 @@ function lpdf.finalizepage(shipout)
end
end
+local finalized = false
+
function lpdf.finalizedocument()
- if not environment.initex then
+ if not environment.initex and not finalized then
run(documentfinalizers,"document")
- function lpdf.finalizedocument()
- -- report_finalizing("serious error: the document is finalized multiple times")
- function lpdf.finalizedocument() end
- end
+ finalized = true
end
end
@@ -868,7 +912,6 @@ do
local function flushcatalog()
if checkcatalog() then
catalog.Type = nil
--- pdfsetcatalog(catalog())
end
end
@@ -928,6 +971,12 @@ do
local d_extgstates, d_colorspaces, d_patterns, d_shades
local p_extgstates, p_colorspaces, p_patterns, p_shades
+ lpdf.registerinitializer(function()
+ r_extgstates = nil ; r_colorspaces = nil ; r_patterns = nil ; r_shades = nil ;
+ d_extgstates = nil ; d_colorspaces = nil ; d_patterns = nil ; d_shades = nil ;
+ p_extgstates = nil ; p_colorspaces = nil ; p_patterns = nil ; p_shades = nil ;
+ end)
+
local function checkextgstates () if d_extgstates then addtopageresources("ExtGState", p_extgstates ) end end
local function checkcolorspaces() if d_colorspaces then addtopageresources("ColorSpace",p_colorspaces) end end
local function checkpatterns () if d_patterns then addtopageresources("Pattern", p_patterns ) end end
@@ -946,7 +995,7 @@ do
local pdfgetfontobjectnumber
- updaters.register("backend.update.lpdf",function()
+ updaters.register("backends.pdf.latebindings",function()
pdfgetfontobjectnumber = lpdf.getfontobjectnumber
end)
@@ -1051,73 +1100,6 @@ function lpdf.rotationcm(a)
return format("%.6F %.6F %.6F %.6F 0 0 cm",c,s,-s,c)
end
--- ! -> universaltime
-
-do
-
- -- It's a bit of a historical mess here.
-
- local osdate, ostime, ostimezone = os.date, os.time, os.timezone
-
- local metadata = nil
- local timestamp = osdate("%Y-%m-%dT%X") .. ostimezone(true)
-
- function lpdf.getmetadata()
- if not metadata then
- local contextversion = environment.version
- local luatexversion = format("%1.2f",LUATEXVERSION)
- local luatexfunctionality = tostring(LUATEXFUNCTIONALITY)
- metadata = {
- producer = format("LuaTeX-%s",luatexversion),
- creator = format("LuaTeX %s %s + ConTeXt LMTX %s",luatexversion,luatexfunctionality,contextversion),
- luatexversion = luatexversion,
- contextversion = contextversion,
- luatexfunctionality = luatexfunctionality,
- luaversion = tostring(LUAVERSION),
- platform = os.platform,
- time = timestamp,
- }
- end
- return metadata
- end
-
- function lpdf.settime(n)
- if n then
- n = converters.totime(n)
- if n then
- converters.settime(n)
- timestamp = osdate("%Y-%m-%dT%X") .. ostimezone(true) -- probably not ok
- end
- end
- if metadata then
- metadata.time = timestamp
- end
- return timestamp
- end
-
- lpdf.settime(tonumber(resolvers.variable("start_time")) or tonumber(resolvers.variable("SOURCE_DATE_EPOCH"))) -- bah
-
- function lpdf.pdftimestamp(str)
- local t = type(str)
- if t == "string" then
- local Y, M, D, h, m, s, Zs, Zh, Zm = match(str,"^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)([%+%-])(%d%d):(%d%d)$")
- return Y and format("D:%s%s%s%s%s%s%s%s'%s'",Y,M,D,h,m,s,Zs,Zh,Zm)
- else
- return osdate("D:%Y%m%d%H%M%S",t == "number" and str or ostime()) -- maybe "!D..." : universal time
- end
- end
-
- function lpdf.id(date)
- local banner = environment.jobname or tex.jobname or "unknown"
- if not date then
- return banner
- else
- return format("%s | %s",banner,timestamp)
- end
- end
-
-end
-
-- return nil is nicer in test prints
function lpdf.checkedkey(t,key,variant)
@@ -1196,15 +1178,16 @@ end
-- return formatters["BT /Span << /ActualText (CONTEXT) >> BDC [<feff>] TJ % t EMC ET"](code)
-do
+if implement then
local f_actual_text_p = formatters["BT /Span << /ActualText <feff%s> >> BDC %s EMC ET"]
local f_actual_text_b = formatters["BT /Span << /ActualText <feff%s> >> BDC"]
- local s_actual_text_e = "EMC ET"
local f_actual_text_b_not = formatters["/Span << /ActualText <feff%s> >> BDC"]
- local s_actual_text_e_not = "EMC"
local f_actual_text = formatters["/Span <</ActualText %s >> BDC"]
+ local s_actual_text_e <const> = "EMC ET"
+ local s_actual_text_e_not <const> = "EMC"
+
local context = context
local pdfdirect = nodes.pool.directliteral -- we can use nuts.write deep down
local tounicode = fonts.mappings.tounicode
@@ -1257,19 +1240,24 @@ do
end
--- interface
+-- Bah, tikz uses \immediate for some reason which is probably a bug, so the usage
+-- will deal with that. However, we will not provide the serialization.
+
+if implement then
+
+ implement { name = "pdfbackendcurrentresources", public = true, untraced = true, actions = { lpdf.collectedresources, context } }
+ implement { name = "pdfbackendsetcatalog", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = lpdf.addtocatalog }
+ implement { name = "pdfbackendsetinfo", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = function(a,b,c) lpdf.addtoinfo(a,b,c) end } -- gets adapted
+ implement { name = "pdfbackendsetname", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = lpdf.addtonames }
+ implement { name = "pdfbackendsetpageattribute", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = lpdf.addtopageattributes }
+ implement { name = "pdfbackendsetpagesattribute", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = lpdf.addtopagesattributes }
+ implement { name = "pdfbackendsetpageresource", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = lpdf.addtopageresources }
+ implement { name = "pdfbackendsetextgstate", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = function(a,b) lpdf.adddocumentextgstate (a,pdfverbose(b)) end }
+ implement { name = "pdfbackendsetcolorspace", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = function(a,b) lpdf.adddocumentcolorspace(a,pdfverbose(b)) end }
+ implement { name = "pdfbackendsetpattern", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = function(a,b) lpdf.adddocumentpattern (a,pdfverbose(b)) end }
+ implement { name = "pdfbackendsetshade", usage = "value", public = true, protected = true, arguments = "2 arguments", actions = function(a,b) lpdf.adddocumentshade (a,pdfverbose(b)) end }
-implement { name = "lpdf_collectedresources", actions = { lpdf.collectedresources, context } }
-implement { name = "lpdf_addtocatalog", arguments = "2 strings", actions = lpdf.addtocatalog }
-implement { name = "lpdf_addtoinfo", arguments = "2 strings", actions = function(a,b,c) lpdf.addtoinfo(a,b,c) end } -- gets adapted
-implement { name = "lpdf_addtonames", arguments = "2 strings", actions = lpdf.addtonames }
-implement { name = "lpdf_addtopageattributes", arguments = "2 strings", actions = lpdf.addtopageattributes }
-implement { name = "lpdf_addtopagesattributes", arguments = "2 strings", actions = lpdf.addtopagesattributes }
-implement { name = "lpdf_addtopageresources", arguments = "2 strings", actions = lpdf.addtopageresources }
-implement { name = "lpdf_adddocumentextgstate", arguments = "2 strings", actions = function(a,b) lpdf.adddocumentextgstate (a,pdfverbose(b)) end }
-implement { name = "lpdf_adddocumentcolorspace", arguments = "2 strings", actions = function(a,b) lpdf.adddocumentcolorspace(a,pdfverbose(b)) end }
-implement { name = "lpdf_adddocumentpattern", arguments = "2 strings", actions = function(a,b) lpdf.adddocumentpattern (a,pdfverbose(b)) end }
-implement { name = "lpdf_adddocumentshade", arguments = "2 strings", actions = function(a,b) lpdf.adddocumentshade (a,pdfverbose(b)) end }
+end
-- more helpers: copy from lepd to lpdf
@@ -1331,11 +1319,16 @@ end
do
- -- This is obsolete but old viewers might still use it as directive
- -- for what to send to a postscript printer.
+ -- This is obsolete but old viewers might still use it as directive for what to
+ -- send to a postscript printer.
local a_procset, d_procset
+ lpdf.registerinitializer(function()
+ a_procset = nil
+ d_procset = nil
+ end)
+
function lpdf.procset(dict)
if not a_procset then
a_procset = pdfarray {
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-lmt.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-lmt.lmt
index fbc002a9327..1d47c162071 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-lmt.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-lmt.lmt
@@ -7,17 +7,17 @@ if not modules then modules = { } end modules ['lpdf-lmt'] = {
license = "see context related readme files"
}
--- The code below was originally in back-lpd.lua but it makes more sense in
--- this namespace. I will rename variables.
---
--- There is no way that a lua based backend can compete with the original one
--- for relative simple text runs. And we're talking seconds here on say 500
--- pages with paragraphs alternativng between three fonts and colors. But such
+-- The code below was originally in back-lpd.lua but it makes more sense in this
+-- namespace. I will rename variables.
+
+-- There is no way that a lua based backend can compete performance wise with the
+-- original one for relative simple text runs. And we're talking seconds here on say
+-- 500 pages with paragraphs alternativng between three fonts and colors. But such
-- documents are rare so in practice we are quite okay, especially because in
--- ConTeXt we can gain quite a bit elsewhere. So, when we loose 30% on such
--- simple documents, we break even on for instance the manual, and gain 30% on
--- Thomas's turture test (also for other reasons). But .. who knows what magic
--- I can cook up in due time.
+-- ConTeXt we can gain quite a bit elsewhere. So, when we loose 30% on such simple
+-- documents, we break even on for instance the manual, and gain 30% on Thomas's
+-- turture test (also for other reasons). But .. who knows what magic I can cook up
+-- in due time.
-- If you consider this complex, watch:
--
@@ -35,70 +35,81 @@ if not modules then modules = { } end modules ['lpdf-lmt'] = {
local type, next, unpack, tonumber, rawget = type, next, unpack, tonumber, rawget
local char, rep, find = string.char, string.rep, string.find
local formatters, splitupstring = string.formatters, string.splitup
-local band, extract = bit32.band, bit32.extract
local concat, sortedhash = table.concat, table.sortedhash
local setmetatableindex = table.setmetatableindex
local loaddata = io.loaddata
-local bpfactor = number.dimenfactors.bp
-
--- local md5HEX = md5.HEX
-local osuuid = os.uuid
-local zlibcompress = (xzip or zlib).compress
-
-local nuts = nodes.nuts
-local tonut = nodes.tonut
-
-local pdfreference = lpdf.reference
-local pdfdictionary = lpdf.dictionary
-local pdfarray = lpdf.array
-local pdfconstant = lpdf.constant
-local pdfliteral = lpdf.literal -- not to be confused with a whatsit!
-
-local pdfreserveobject
-local pdfpagereference
-local pdfflushobject
-local pdfsharedobject
-local pdfflushstreamobject
-local pdfdeferredobject
-local pdfimmediateobject
-
-local pdfgetfontname
-local pdfgetfontobjectnumber
-
-local pdfgetpagereference
-
-updaters.register("backend.update.lpdf",function()
- pdfreserveobject = lpdf.reserveobject
- pdfpagereference = lpdf.pagereference
- pdfflushobject = lpdf.flushobject
- pdfsharedobject = lpdf.shareobjectreference
- pdfflushstreamobject = lpdf.flushstreamobject
- pdfdeferredobject = lpdf.deferredobject
- pdfimmediateobject = lpdf.immediateobject
- --
- pdfgetfontname = lpdf.getfontname
- pdfgetfontobjectnumber = lpdf.getfontobjectnumber
- --
- pdfgetpagereference = lpdf.getpagereference
-end)
-
-local pdf_pages = pdfconstant("Pages")
-local pdf_page = pdfconstant("Page")
-local pdf_xobject = pdfconstant("XObject")
-local pdf_form = pdfconstant("Form")
-
-local fonthashes = fonts.hashes
-local characters = fonthashes.characters
-local descriptions = fonthashes.descriptions
-local parameters = fonthashes.parameters
-local properties = fonthashes.properties
-
-local report = logs.reporter("backend")
-local report_objects = logs.reporter("backend","objects")
+local bpfactor <const> = number.dimenfactors.bp
+
+local osuuid = os.uuid
+local zlibcompresssize = xzip.compresssize
+
+local nuts = nodes.nuts
+local tonut = nodes.tonut
+local tonode = nuts.tonode
+
+local pdfreference = lpdf.reference
+local pdfdictionary = lpdf.dictionary
+local pdfarray = lpdf.array
+local pdfconstant = lpdf.constant
+local pdfliteral = lpdf.literal -- not to be confused with a whatsit!
+
+local pdfreserveobject -- forward reference
+local pdfpagereference -- forward reference
+local pdfgetpagereference -- forward reference
+local pdfsharedobject -- forward reference
+local pdfflushobject -- forward reference
+local pdfflushstreamobject -- forward reference
+local pdfdeferredobject -- forward reference
+local pdfimmediateobject -- forward reference
+
+local pdfincludeimage -- forward reference
+
+local pdf_pages = pdfconstant("Pages")
+local pdf_page = pdfconstant("Page")
+local pdf_xobject = pdfconstant("XObject")
+local pdf_form = pdfconstant("Form")
+local pdf_pattern = pdfconstant("Pattern")
+
+local fonthashes = fonts.hashes
+local characters = fonthashes.characters
+local descriptions = fonthashes.descriptions
+local parameters = fonthashes.parameters
+local properties = fonthashes.properties
+
+local report = logs.reporter("backend")
+local report_objects = logs.reporter("backend","objects")
+local report_fonts = logs.reporter("backend","fonts")
+local report_encryption = logs.reporter("backend","encryption")
+
+local trace_objects = false trackers.register("backend.objects", function(v) trace_objects = v end)
+local trace_details = false trackers.register("backend.details", function(v) trace_details = v end)
+local trace_indices = false trackers.register("backend.fonts.details", function(v) trace_indices = v end)
+
+-- These two tables used a font id as index and will be metatabled in lpdf-emb.lmt:
+
+local usedfontnames = { }
+local usedfontobjects = { }
+
+lpdf.usedfontnames = usedfontnames
+lpdf.usedfontobjects = usedfontobjects
+
+-- experiment:
+
+local function compressdata(data,size)
+ local guess = ((size // 4096) + 1) * 2048
+ local comp = zlibcompresssize(data,guess,3)
+ -- if comp then
+ -- report()
+ -- report("size %i, guess %i, result %i => %s / %s",size,guess,#comp,guess>=#comp and "hit" or "miss")
+ -- report()
+ -- end
+ return comp
+end
-local trace_objects = false trackers.register("backend.objects", function(v) trace_objects = v end)
-local trace_details = false trackers.register("backend.details", function(v) trace_details = v end)
+-- local function compressdata(data,size)
+-- return zlibcompress(data,3)
+-- end
-- we collect them:
@@ -106,8 +117,10 @@ local flushers = { }
-- used variables
-local pdf_h, pdf_v
-local need_tm, need_tf, cur_tmrx, cur_factor, cur_f, cur_e
+local pdf_h = 0
+local pdf_v = 0
+
+local need_tm, need_tf, need_font, cur_tmrx, cur_factor
local need_width, need_mode, done_width, done_mode
local mode
local f_pdf_cur, f_pdf, fs_cur, fs, f_cur, f_x_scale, f_y_scale
@@ -116,11 +129,14 @@ local usedfonts, usedxforms, usedximages, usedxgroups
local getxformname, getximagename
local boundingbox, shippingmode, objectnumber
local tmrx, tmry, tmsx, tmsy, tmtx, tmty
-local cmrx, cmry, cmsx, cmsy, cmtx, cmty
+----- cmrx, cmry, cmsx, cmsy, cmtx, cmty
+local cmrx, cmry, cmtx, cmty
local tmef
+local c_effect
local function usefont(t,k) -- a bit redundant hash
- local v = pdfgetfontname(k)
+ -- local v = pdfgetfontname(k)
+ local v = usedfontnames[k]
t[k] = v
return v
end
@@ -128,7 +144,7 @@ end
local function reset_variables(specification)
pdf_h, pdf_v = 0, 0
cmrx, cmry = 1.0, 1.0
- cmsx, cmsy = 0.0, 0.0
+ -- cmsx, cmsy = 0.0, 0.0
cmtx, cmty = 0.0, 0.0
tmrx, tmry = 1.0, 1.0
tmsx, tmsy = 0.0, 0.0
@@ -136,6 +152,7 @@ local function reset_variables(specification)
tmef = 1.0
need_tm = false
need_tf = false
+ need_font = true
need_width = 0
need_mode = 0
done_width = false
@@ -152,10 +169,9 @@ local function reset_variables(specification)
f_x_scale = 1.0
f_y_scale = 1.0
cur_factor = 0
- cur_f = false
- cur_e = false
tj_delta = 0.0
cw = 0.0
+ c_effect = nil
usedfonts = setmetatableindex(usefont)
usedxforms = { }
usedximages = { }
@@ -175,23 +191,59 @@ end
-- fonts
local fontcharacters
-local fontdescriptions
+----- fontdescriptions
local fontparameters
local fontproperties
-local usedcharacters = setmetatableindex("table")
local pdfcharacters
+local getstreamhash = fonts.handlers.otf.getstreamhash
+
+local usedfontstreams = { }
+
+local usedindices = setmetatableindex(function(t,k)
+ local n = 0
+-- n = 31
+ local v = setmetatableindex(function(tt,kk)
+ if n >= 0xFFFF then
+ report_fonts("registering character index: overflow in hash %a, todo: use overflow font")
+ else
+ n = n + 1
+ end
+ if trace_indices then
+ report_fonts("registering character index: hash %a, charindex 0x%05X, slotindex 0x%04X",k,kk,n)
+ end
+ local vv = n
+ tt[kk] = vv
+ return vv
+ end)
+ t[k] = v
+ return v
+end)
+
+local usedcharacters = setmetatableindex(function(t,k)
+ local h, d = getstreamhash(k)
+ if trace_indices then
+ report_fonts("registering index table: hash %a, fontid %i",h,k)
+ end
+ usedfontstreams[h] = d
+ local v = usedindices[h]
+ t[k] = v
+ return v
+end)
+
+lpdf.usedfontstreams = usedfontstreams -- [streamhash] -> fontdata
+lpdf.usedcharacters = usedcharacters -- [fontid] -> indices
+lpdf.usedindices = usedindices -- [streamhash][index] -> realindex (can also be dupindex)
+
local horizontalmode = true
local scalefactor = 1
local threshold = 655360
-local thresfactor = 100
+----- thresfactor = 100
local tjfactor = 100 / 65536
-lpdf.usedcharacters = usedcharacters
-
function flushers.updatefontstate(font)
fontcharacters = characters[font]
- fontdescriptions = descriptions[font]
+ -- fontdescriptions = descriptions[font]
fontparameters = parameters[font]
fontproperties = properties[font]
local size = fontparameters.size -- or bad news
@@ -213,9 +265,10 @@ function flushers.updatefontstate(font)
end
end
--- helpers
+-- helpers (maybe in collapse mode we have to go %.9N)
local f_cm = formatters["%.6N %.6N %.6N %.6N %.6N %.6N cm"]
+local f_cz = formatters["%.6N 0 0 %.6N %.6N %.6N cm"]
local f_tm = formatters["%.6N %.6N %.6N %.6N %.6N %.6N Tm"]
local saved_text_pos_v = 0
@@ -226,8 +279,10 @@ local function begin_text()
saved_text_pos_v = pdf_v
b = b + 1 ; buffer[b] = "BT"
need_tf = true
+ need_font = true
need_width = 0
need_mode = 0
+ c_effect = nil
mode = "text"
end
@@ -246,28 +301,32 @@ local function end_text()
mode = "page"
end
-local saved_chararray_pos_h
-local saved_chararray_pos_v
+local begin_chararray, end_chararray do
-local saved_b = 0
+ local saved_chararray_pos_h
+ local saved_chararray_pos_v
-local function begin_chararray()
- saved_chararray_pos_h = pdf_h
- saved_chararray_pos_v = pdf_v
- cw = horizontalmode and saved_chararray_pos_h or - saved_chararray_pos_v
- tj_delta = 0
- saved_b = b
- b = b + 1 ; buffer[b] = " ["
- mode = "chararray"
-end
+ local saved_b = 0
+
+ begin_chararray = function()
+ saved_chararray_pos_h = pdf_h
+ saved_chararray_pos_v = pdf_v
+ cw = horizontalmode and saved_chararray_pos_h or - saved_chararray_pos_v
+ tj_delta = 0
+ saved_b = b
+ b = b + 1 ; buffer[b] = " ["
+ mode = "chararray"
+ end
+
+ end_chararray = function()
+ b = b + 1 ; buffer[b] = "] TJ"
+ buffer[saved_b] = concat(buffer,"",saved_b,b)
+ b = saved_b
+ pdf_h = saved_chararray_pos_h
+ pdf_v = saved_chararray_pos_v
+ mode = "text"
+ end
-local function end_chararray()
- b = b + 1 ; buffer[b] = "] TJ"
- buffer[saved_b] = concat(buffer,"",saved_b,b)
- b = saved_b
- pdf_h = saved_chararray_pos_h
- pdf_v = saved_chararray_pos_v
- mode = "text"
end
local function begin_charmode()
@@ -304,7 +363,8 @@ end
local function pdf_set_pos(h,v)
local move = calc_pdfpos(h,v)
if move then
- b = b + 1 ; buffer[b] = f_cm(cmrx, cmsx, cmsy, cmry, cmtx*bpfactor, cmty*bpfactor)
+ -- b = b + 1 ; buffer[b] = f_cm(cmrx, cmsx, cmsy, cmry, cmtx*bpfactor, cmty*bpfactor)
+ b = b + 1 ; buffer[b] = f_cz(cmrx, cmry, cmtx*bpfactor, cmty*bpfactor)
pdf_h = pdf_h + cmtx
pdf_v = pdf_v + cmty
end
@@ -336,7 +396,8 @@ local function pdf_reset_pos()
return
end
end
- b = b + 1 ; buffer[b] = f_cm(cmrx, cmsx, cmsy, cmry, cmtx*bpfactor, cmty*bpfactor)
+ -- b = b + 1 ; buffer[b] = f_cm(cmrx, cmsx, cmsy, cmry, cmtx*bpfactor, cmty*bpfactor)
+ b = b + 1 ; buffer[b] = f_cz(cmrx, cmry, cmtx*bpfactor, cmty*bpfactor)
pdf_h = pdf_h + cmtx
pdf_v = pdf_v + cmty
end
@@ -344,7 +405,8 @@ end
local function pdf_set_pos_temp(h,v)
local move = calc_pdfpos(h,v)
if move then
- b = b + 1 ; buffer[b] = f_cm(cmrx, cmsx, cmsy, cmry, cmtx*bpfactor, cmty*bpfactor)
+ -- b = b + 1 ; buffer[b] = f_cm(cmrx, cmsx, cmsy, cmry, cmtx*bpfactor, cmty*bpfactor)
+ b = b + 1 ; buffer[b] = f_cz(cmrx, cmry, cmtx*bpfactor, cmty*bpfactor)
end
end
@@ -412,42 +474,18 @@ do
-- as fontparameters already has checked / set it we can also have a variable
-- for it so
- local naturalwidth = nil
- local hshift = false
- local vshift = false
-
- -- local naturalwidths = setmetatableindex(function(t,font)
- -- local d = descriptions[font]
- -- local c = characters[font]
- -- local f = parameters[font].hfactor or parameters[font].factor
- -- local v = setmetatableindex(function(t,char)
- -- local w
- -- local e = d and d[char]
- -- if e then
- -- w = e.width
- -- if w then
- -- w = w * f
- -- end
- -- end
- -- if not w then
- -- e = c and c[char]
- -- if e then
- -- w = e.width or 0
- -- end
- -- end
- -- if not w then
- -- w = 0
- -- end
- -- t[char] = w
- -- return w
- -- end)
- -- t[font] = v
- -- return v
- -- end)
+ local characterwidth = nil
+ -- local descriptionwidth = nil
+ local hshift = false
+ local vshift = false
+
+ -- The width array uses the original dimensions! This is different from e.g.
+ -- luatex where we have more widths arrays and these reflect the cheated
+ -- widths (goes wrong elsewhere).
-- when changing this, check math: compact-001.tex (rule width)
- local naturalwidths = setmetatableindex(function(t,font)
+ local characterwidths = setmetatableindex(function(t,font)
local d = descriptions[font]
local c = characters[font]
local f = parameters[font].hfactor or parameters[font].factor
@@ -455,7 +493,17 @@ do
local w
local e = c and c[char]
if e then
- w = e.width or 0
+-- w = e.width or 0
+-- local a = e.advance
+-- if a then
+-- w = a
+-- end
+ local a = e.advance
+ if a then
+ w = a
+ else
+ w = e.width or 0
+ end
end
if not w then
e = d and d[char]
@@ -476,36 +524,77 @@ do
return v
end)
- local function setup_fontparameters(font,factor,f,e,sx,sy)
- local slant = fontparameters.slantfactor or 0
- local extend = fontparameters.extendfactor or 1
- local squeeze = fontparameters.squeezefactor or 1
- local expand = 1 + factor / 1000000
- local format = fontproperties.format
- if e then
- extend = extend * e
- end
- tmef = expand
- tmrx = expand * extend
- tmsy = slant
- tmry = squeeze
- need_width = fontparameters.width or 0
- need_mode = fontparameters.mode or 0
+ -- it's about time to get rid of the pdftex based model but i'll wait with that till after
+ -- the first release so that we have some test period ... when we go compact even less
+
+ -- the descriptions are used for the width array
+
+ local collapse = true
+
+ experiments.register("backend.pdf.collapsefonts",function(v)
+ collapse = v
+ end)
+
+ local function setup_fontparameters(font,factor,sx,sy,effect)
+ local format = fontproperties.format
+ local expand = 1 + factor / 1000000
+ tmef = expand
+
+ -- local slant = fontparameters.slantfactor or 0
+ -- local squeeze = fontparameters.squeezefactor or 1
+ -- local extend = fontparameters.extendfactor or 1
+ -- tmrx = extend * expand
+ -- tmry = squeeze
+ -- tmsy = slant
+ -- need_width = fontparameters.width or 0
+ -- need_mode = fontparameters.mode or 0
+
+ if effect then
+ if effect ~= c_effect then
+ tmsy = effect.slant or fontparameters.slantfactor or 0
+ tmry = effect.squeeze or fontparameters.squeezefactor or 1
+ tmrx = effect.extend or fontparameters.extendfactor or 1
+ need_mode = effect.mode or fontparameters.mode or 0
+ need_width = effect.line or fontparameters.width or 0 -- scale sensitive!
+ c_effect = effect
+ else
+ -- we could check if effects have changed but effects use unique tables; for
+ -- now they win over font effects (only used in math)
+ end
+ else
+ tmsy = fontparameters.slantfactor or 0
+ tmry = fontparameters.squeezefactor or 1
+ tmrx = fontparameters.extendfactor or 1
+ need_mode = fontparameters.mode or 0
+ need_width = fontparameters.width or 0
+ c_effect = nil
+ end
+
+ tmrx = expand * tmrx
+
f_cur = font
f_pdf = usedfonts[font] -- cache
cur_factor = factor
- cur_f = f
- cur_e = e
tj_delta = 0
- f_x_scale = 1.0
- f_y_scale = 1.0
- fs = fontparameters.size * bpfactor
- if f then
- fs = fs * f
- end
- -- kind of special:
- if format == "opentype" or format == "type1" then
- fs = fs * 1000 / fontparameters.units -- can we avoid this ?
+ cw = 0
+ --
+ fs = fontparameters.size * bpfactor
+ if collapse then
+ local sc = fs / 10
+ -- kind of special:
+ if format == "opentype" or format == "type1" then
+ sc = sc * 1000 / fontparameters.units -- can we avoid this ?
+ end
+ --
+ fs = 10
+ --
+ tmrx = tmrx * sc
+ tmry = tmry * sc
+ else
+ -- kind of special:
+ if format == "opentype" or format == "type1" then
+ fs = fs * 1000 / fontparameters.units -- can we avoid this ?
+ end
end
--
f_x_scale = sx
@@ -517,7 +606,8 @@ do
tmry = tmry * f_y_scale
end
--
- naturalwidth = naturalwidths[font]
+ characterwidth = characterwidths[font]
+ -- descriptionwidth = descriptionwidths[font]
--
hshift = fontparameters.hshift
vshift = fontparameters.vshift
@@ -532,6 +622,9 @@ do
local width_factor = 72.27 / 72000.0
+ local last_fs
+ local last_fpdf
+
local function set_font()
-- if need_width and need_width ~= 0 then
if need_width ~= 0 then
@@ -549,7 +642,13 @@ do
b = b + 1 ; buffer[b] = s_mode
done_mode = false
end
- b = b + 1 ; buffer[b] = f_font(f_pdf,fs)
+ -- no need when the same
+ if need_font or last_fs ~= fs or last_pdf ~= f_pdf then
+ b = b + 1 ; buffer[b] = f_font(f_pdf,fs)
+ last_fs = fs
+ last_pdf = f_pdf
+ need_font = false
+ end
f_pdf_cur = f_pdf
fs_cur = fs
need_tf = false
@@ -589,32 +688,67 @@ do
return v
end)
- -- local trace_threshold = false trackers.register("backends.pdf.threshold", function(v) trace_threshold = v end)
+ local trace_threshold = false trackers.register("backends.pdf.threshold", function(v) trace_threshold = v end)
- -- local f_skip = formatters["%.2N"]
+ ----- f_skip = formatters["%.2N"]
-- I will redo this mess ... we no longer have the mkiv pdf generator that we used in
-- luatex (a precursor to lmtx and also for comparison) but only in lmtx now so ...
-- time to move on I guess.
- flushers.character = function(current,pos_h,pos_v,pos_r,font,char,data,f,e,factor,sx,sy) -- ,naturalwidth,width)
- if sx ~= f_x_scale or sy ~= f_y_scale or need_tf or font ~= f_cur or f_pdf ~= f_pdf_cur or fs ~= fs_cur or mode == "page" then
+ -- factor is for hz
+
+ flushers.character = function(current,pos_h,pos_v,pos_r,font,char,data,csx,csy,factor,sx,sy) -- ,naturalwidth,width)
+
+ local s = data.scale
+ local x = data.xoffset
+ local y = data.yoffset
+ if s then
+ sx = s * sx
+ sy = s * sy
+ end
+ if csx then
+ sx = sx * csx
+ csx = 1
+ end
+ if csy then
+ sy = sy * csy
+ csy = 1
+ end
+
+ local effect = data.effect
+
+ -- if sx ~= f_x_scale or sy ~= f_y_scale or need_tf or font ~= f_cur or f_pdf ~= f_pdf_cur or fs ~= fs_cur then
+ if sx ~= f_x_scale or sy ~= f_y_scale or need_tf or font ~= f_cur or f_pdf ~= f_pdf_cur or fs ~= fs_cur
+ or mode == "page"
+ or effect ~= c_effect
+ then
pdf_goto_textmode()
- setup_fontparameters(font,factor,f,e,sx,sy)
+ setup_fontparameters(font,factor,sx,sy,effect) -- too often due to page
set_font()
- elseif cur_tmrx ~= tmrx or cur_factor ~= factor or cur_f ~= f or cur_e ~= e then
- setup_fontparameters(font,factor,f,e,sx,sy)
+ -- elseif mode == "page" then
+ -- pdf_goto_textmode()
+ -- set_font()
+ elseif cur_tmrx ~= tmrx or cur_factor ~= factor then
+ setup_fontparameters(font,factor,sx,sy,effect)
need_tm = true
end
+ if x then
+ pos_h = pos_h + x * tmef * f_x_scale
+ end
+ if y then
+ pos_v = pos_v + y * f_y_scale
+ end
+
local move = calc_pdfpos(pos_h,pos_v)
- -- if trace_threshold then
- -- report(
- -- "font %i, char %C, factor %i, naturalwidth %p, move %l, tm %l, hpos %p, delta %p, threshold %p, cw %p",
- -- font,char,factor,naturalwidth[char],move,need_tm,pos_h,tj_delta,threshold,cw
- -- )
- -- end
+ if trace_threshold then
+ report_fonts(
+ "before: font %i, char %C, factor %i, naturalwidth %p, move %l, tm %l, hpos %p, delta %p, threshold %p, cw %p",
+ font,char,factor,characterwidth[char],move,need_tm,pos_h,tj_delta,threshold,cw
+ )
+ end
if move or need_tm then
if not need_tm then
@@ -635,7 +769,6 @@ do
if hshift then pos_h = pos_h + hshift end
if vshift then pos_v = pos_v - vshift end
-
if need_tm then
pdf_goto_textmode()
set_textmatrix(pos_h,pos_v)
@@ -643,7 +776,7 @@ do
move = calc_pdfpos(pos_h,pos_v)
end
if move then
- local d = tj_delta * scalefactor / f_x_scale
+ local d = tj_delta * scalefactor / (tmef * f_x_scale)
if d <= -0.5 or d >= 0.5 then
if mode == "char" then
end_charmode()
@@ -654,28 +787,28 @@ do
end
end
+ if trace_threshold then
+ report_fonts(
+ "after : font %i, char %C, factor %i, naturalwidth %p, move %l, tm %l, hpos %p, delta %p, threshold %p, cw %p",
+ font,char,factor,characterwidth[char],move,need_tm,pos_h,tj_delta,threshold,cw
+ )
+ end
+
if mode == "chararray" then
begin_charmode()
end
- cw = cw + naturalwidth[char] * tmef * f_x_scale
+ cw = cw + characterwidth[char] * tmef * f_x_scale
- local index = data.index or char
+ local slot = pdfcharacters[data.index or char] -- registers usage
- b = b + 1 ; buffer[b] = font > 0 and h_hex_4[index] or h_hex_2[index]
-
- if not pdfcharacters[index] then
- pdfcharacters[index] = true
- end
+ b = b + 1 ; buffer[b] = font > 0 and h_hex_4[slot] or h_hex_2[slot]
end
flushers.fontchar = function(font,char,data)
local dummy = usedfonts[font]
- local index = data.index or char
- if not pdfcharacters[index] then
- pdfcharacters[index] = true
- end
+ local slot = pdfcharacters[data.index or char] -- registers usage
return dummy
end
@@ -794,9 +927,9 @@ do
local nodeproperties = nodes.properties.data
- local s_matrix_0 = "1 0 0 1 0 0 cm"
- local f_matrix_2 = formatters["%.6N 0 0 %.6N 0 0 cm"]
- local f_matrix_4 = formatters["%.6N %.6N %.6N %.6N 0 0 cm"]
+ local s_matrix_0 <const> = "1 0 0 1 0 0 cm"
+ local f_matrix_2 = formatters["%.6N 0 0 %.6N 0 0 cm"]
+ local f_matrix_4 = formatters["%.6N %.6N %.6N %.6N 0 0 cm"]
local flushsetmatrix = function(current,pos_h,pos_v)
local p = nodeproperties[current]
@@ -965,16 +1098,22 @@ local localconverter = nil -- will be set
local flushimage do
- local rulecodes = nodes.rulecodes
- local newrule = nodes.pool.rule
+ local pdfbackend = backends.registered.pdf
+ local nodeinjections = pdfbackend.nodeinjections
+ local codeinjections = pdfbackend.codeinjections
+
+ local newimagerule = nuts.pool.imagerule
+ local newboxrule = nuts.pool.boxrule
local setprop = nuts.setprop
local getprop = nuts.getprop
+ local setattrlist = nuts.setattrlist
local getwhd = nuts.getwhd
- local flushlist = nuts.flush_list
+ local flushlist = nuts.flushlist
local getdata = nuts.getdata
+ local rulecodes = nodes.rulecodes
local normalrule_code = rulecodes.normal
local boxrule_code = rulecodes.box
local imagerule_code = rulecodes.image
@@ -985,6 +1124,7 @@ local flushimage do
local fractionrule_code = rulecodes.fraction
local radicalrule_code = rulecodes.radical
local outlinerule_code = rulecodes.outline
+ ----- virtualrule_code = rulecodes.virtual
local processrule = nodes.rules.process
@@ -992,8 +1132,8 @@ local flushimage do
local f_im = formatters["/Im%d Do"]
local f_gr = formatters["/Gp%d Do"]
- local s_b = "q"
- local s_e = "Q"
+ local s_b <const> = "q"
+ local s_e <const> = "Q"
local f_v = formatters["[] 0 d 0 J %.6N w 0 0 m %.6N 0 l S"]
local f_h = formatters["[] 0 d 0 J %.6N w 0 0 m 0 %.6N l S"]
@@ -1021,13 +1161,19 @@ local flushimage do
lpdf.getxformname = getxformname
- local function saveboxresource(box,attributes,resources,immediate,kind,margin)
+ local pdfcollectedresources = lpdf.collectedresources
+
+ function codeinjections.saveboxresource(box,attributes,resources,immediate,kind,margin,onum)
n = n + 1
local immediate = true
local margin = margin or 0 -- or dimension
- local objnum = pdfreserveobject()
+ local objnum = onum or pdfreserveobject()
local list = tonut(type(box) == "number" and tex.takebox(box) or box)
--
+ if resources == true then
+ resources = pdfcollectedresources()
+ end
+ --
local width, height, depth = getwhd(list)
--
local l = {
@@ -1043,6 +1189,11 @@ local flushimage do
index = objnum,
objnum = objnum,
}
+ local r = boxresources[objnum]
+ if r then
+ flushlist(l.list)
+ l.list = nil -- added
+ end
boxresources[objnum] = l
if immediate then
localconverter(list,"xform",objnum,l)
@@ -1054,7 +1205,7 @@ local flushimage do
return objnum
end
- local function useboxresource(index,wd,ht,dp)
+ function nodeinjections.useboxresource(index,wd,ht,dp)
local l = boxresources[index]
if l then
if wd or ht or dp then
@@ -1062,10 +1213,10 @@ local flushimage do
else
wd, ht, dp = l.width, l.height, l.depth
end
- local rule = newrule(wd,ht,dp) -- newboxrule
- rule.subtype = boxrule_code
- setprop(tonut(rule),"index",index)
- return rule, wd, ht, dp
+ local rule = newboxrule(wd,ht,dp)
+ setattrlist(rule,true)
+ setprop(rule,"index",index)
+ return tonode(rule), wd, ht, dp
else
report("no box resource %S",index)
end
@@ -1080,21 +1231,15 @@ local flushimage do
end
end
- local function getboxresourcebox(index)
+ nodeinjections.getboxresourcedimensions = getboxresourcedimensions
+
+ function codeinjections.getboxresourcebox(index)
local l = boxresources[index]
if l then
return l.list
end
end
- -- updaters.register("backend.update.tex",function()
- updaters.register("backend.update.lpdf",function()
- tex.saveboxresource = saveboxresource
- tex.useboxresource = useboxresource
- tex.getboxresourcedimensions = getboxresourcedimensions
- tex.getboxresourcebox = getboxresourcebox
- end)
-
-- a bit of a mess: index is now objnum but that has to change to a proper index
-- ... an engine inheritance
@@ -1125,10 +1270,11 @@ local flushimage do
usedxforms[objnum] = true
pdf_goto_pagemode()
calc_pdfpos(pos_h,pos_v)
- tx = cmtx * bpfactor
- ty = cmty * bpfactor
+ local tx = cmtx * bpfactor
+ local ty = cmty * bpfactor
b = b + 1 ; buffer[b] = s_b
- b = b + 1 ; buffer[b] = f_cm(rx,0,0,ry,tx,ty)
+ -- b = b + 1 ; buffer[b] = f_cm(rx,0,0,ry,tx,ty)
+ b = b + 1 ; buffer[b] = f_cz(rx, ry,tx,ty)
b = b + 1 ; buffer[b] = f_fm(name)
b = b + 1 ; buffer[b] = s_e
end
@@ -1176,7 +1322,7 @@ local flushimage do
BBox = pdfarray(bbox),
Resources = lpdf.collectedresources { serialize = false },
}
- local objnum = pdfflushstreamobject(content,wrapper,false)
+ local objnum = pdfflushstreamobject(content,wrapper,false) -- why not compressed ?
groups = groups + 1
usedxgroups[groups] = objnum
return f_gr(groups)
@@ -1187,12 +1333,6 @@ local flushimage do
-- end of experiment
- local pdfincludeimage
-
- updaters.register("backend.update.lpdf",function()
- pdfincludeimage = lpdf.includeimage
- end)
-
local function flushpdfximage(current,pos_h,pos_v,pos_r,size_h,size_v)
local width,
@@ -1230,11 +1370,11 @@ local flushimage do
rx, ry = bpfactor, bpfactor
end
- if band(transform,7) > 3 then
+ if (transform & 7) > 3 then
-- mirror
rx, tx = -rx, -tx
end
- local t = band(transform + rotation,3)
+ local t = (transform + rotation) & 3
if t == 0 then
-- nothing
elseif t == 1 then
@@ -1257,11 +1397,11 @@ local flushimage do
local t = transform + rotation
- if band(transform,7) > 3 then
+ if (transform & 7) > 3 then
t = t + 1
end
- t = band(t,3)
+ t = t & 3
if t == 0 then
-- no transform
@@ -1318,7 +1458,6 @@ local flushimage do
-- to be sorted out
-- local ty = pos_v - depth
local ty = pos_v -- we assume that depth is dealt with in the caller (for now)
-
usedximages[index] = objnum
pdf_goto_pagemode()
@@ -1344,15 +1483,13 @@ local flushimage do
-- small sizes which is needed for inaccurate viewers.
flushers.rule = function(current,pos_h,pos_v,pos_r,size_h,size_v,subtype)
-
if subtype == emptyrule_code then
return
elseif subtype == boxrule_code then
return flushpdfxform(current,pos_h,pos_v,pos_r,size_h,size_v)
elseif subtype == imagerule_code then
return flushpdfximage(current,pos_h,pos_v,pos_r,size_h,size_v)
- end
- if subtype == userrule_code or subtype >= overrule_code and subtype <= radicalrule_code then
+ elseif subtype == userrule_code or (subtype >= overrule_code and subtype <= radicalrule_code) then
pdf_goto_pagemode()
b = b + 1 ; buffer[b] = s_b
pdf_set_pos_temp(pos_h,pos_v)
@@ -1363,15 +1500,24 @@ local flushimage do
pdf_goto_pagemode()
- -- local saved_b = b
-
b = b + 1 ; buffer[b] = s_b
local dim_h = size_h * bpfactor
local dim_v = size_v * bpfactor
local rule
-
- if dim_v <= one_bp then
+ --
+ -- this fails for showglyphs so and i have no reason to look into it now and rectangles
+ -- do a better job anyway
+ --
+ if subtype == outlinerule_code then
+ local linewidth = getdata(current)
+ pdf_set_pos_temp(pos_h,pos_v)
+ if linewidth > 0 then
+ rule = f_w(linewidth * bpfactor,dim_h,dim_v)
+ else
+ rule = f_o(dim_h,dim_v)
+ end
+ elseif dim_v <= one_bp then
pdf_set_pos_temp(pos_h,pos_v + 0.5 * size_v)
rule = f_v(dim_v,dim_h)
elseif dim_h <= one_bp then
@@ -1379,24 +1525,12 @@ local flushimage do
rule = f_h(dim_h,dim_v)
else
pdf_set_pos_temp(pos_h,pos_v)
- if subtype == outlinerule_code then
- local linewidth = getdata(current)
- if linewidth > 0 then
- rule = f_w(linewidth * bpfactor,dim_h,dim_v)
- else
- rule = f_o(dim_h,dim_v)
- end
- else
- rule = f_f(dim_h,dim_v)
- end
+ rule = f_f(dim_h,dim_v)
end
b = b + 1 ; buffer[b] = rule
b = b + 1 ; buffer[b] = s_e
- -- buffer[saved_b] = concat(buffer," ",saved_b,b)
- -- b = saved_b
-
end
flushers.simplerule = function(pos_h,pos_v,pos_r,size_h,size_v)
@@ -1440,7 +1574,7 @@ local flushimage do
local d = -depth + half
local w = width - line
local t = total - line
- if baseline then
+ if baseline and w > 0 then
rule = f_y(line,half,d,w,t,half,w)
else
rule = f_x(line,half,d,w,t)
@@ -1458,7 +1592,7 @@ end
--- basics
-local wrapup, registerpage do
+local wrapupdocument, registerpage do
local pages = { }
local maxkids = 10
@@ -1492,11 +1626,12 @@ local wrapup, registerpage do
return list
end
- function lpdf.setpageorder(mapping)
+ function lpdf.setpageorder(mapping,p)
-- mapping can be a hash so:
local list = table.sortedkeys(mapping)
local n = #list
- if n == nofpages then
+ local nop = p or nofpages
+ if n == nop then
local done = { }
local hash = { }
for i=1,n do
@@ -1514,7 +1649,7 @@ local wrapup, registerpage do
end
pages = done
else
- report("invalid page order, %i entries expected",nofpages)
+ report("invalid page order, %i entries expected",nop)
end
end
@@ -1533,7 +1668,7 @@ local wrapup, registerpage do
-- lpdf.setpageorder(t)
-- end
- wrapup = function(driver)
+ wrapupdocument = function(driver)
-- hook (to reshuffle pages)
local pagetree = { }
@@ -1604,13 +1739,10 @@ local wrapup, registerpage do
pdfflushobject(page.objnum,object)
end
lpdf.addtocatalog("Pages",pdfreference(parent))
-
end
end
-pdf_h, pdf_v = 0, 0
-
local function initialize(driver,details)
reset_variables(details)
reset_buffer()
@@ -1621,7 +1753,309 @@ end
-- todo: more clever resource management: a bit tricky as we can inject
-- stuff in the page stream
-local compact = false
+local compact = false
+local encryptstream = false
+local encryptobject = false
+local encdict = nil
+local majorversion = 1
+local minorversion = 7
+
+-- Encryption
+
+-- This stuff is poorly documented so it took a while to figure out a way that made
+-- loading in a few programe working. Of course one you see the solution one can
+-- claim that it's easy and trivial. In the end we could even make acrobat accepting
+-- the file: it doesn't like the catalog to be in an object stream which to me
+-- smells like a bug.
+
+do
+
+ -- move up (some already) or better: lpdf-aes.lmt or so
+
+ local byte, sub, bytes, tohex, tobytes = string.byte, string.sub, string.bytes, string.tohex, string.tobytes
+ local P, S, V, Cs, lpegmatch, patterns = lpeg.P, lpeg.S, lpeg.V, lpeg.Cs, lpeg.match, lpeg.patterns
+
+ local digest256 = sha2.digest256
+ local digest384 = sha2.digest384
+ local digest512 = sha2.digest512
+
+ local aesencode = aes.encode
+ local aesdecode = aes.decode
+ local aesrandom = aes.random
+
+ -- random and padding functions are gone here
+
+ local function validpassword(str)
+ return #str > 127 and sub(str,1,127) or str
+ end
+
+ local encryptionkey = false
+ local objectparser = false
+
+ do
+
+ local function ps_encrypt(str)
+ -- string is already unescaped
+ str = aesencode(str,encryptionkey,true,true,true)
+ return "<" .. tohex(str) .. ">"
+ end
+
+ local function hex_encrypt(str)
+ -- string needs to be decoded
+ str = tobytes(str)
+ str = aesencode(str,encryptionkey,true,true,true)
+ return "<" .. tohex(str) .. ">"
+ end
+
+ local whitespace = S("\000\009\010\012\013\032")^1
+ local anything = patterns.anything
+ local space = patterns.space
+ local spacing = whitespace^0
+ local newline = patterns.eol
+ local cardinal = patterns.cardinal
+
+ local p_psstring = (
+ P("(")
+ * Cs(P { ( P("\\")/"" * anything + P("(") * V(1) * P(")") + (1 - P(")")) )^0 })
+ * P(")")
+ ) / ps_encrypt
+
+ local p_hexstring = (
+ P("<")
+ * Cs((1-P(">"))^1)
+ * P(">")
+ ) / hex_encrypt
+
+ local p_comment = P("%") * (1-newline)^1 * newline^1
+ local p_name = P("/") * (1 - whitespace - S("<>/[]()"))^1
+ local p_number = patterns.number
+ local p_boolean = P("true") + P("false")
+ local p_null = P("null")
+ local p_reference = cardinal * spacing * cardinal * spacing * P("R")
+
+ local p_other = p_name + p_reference + p_psstring + p_hexstring + p_number
+ + p_boolean + p_null + p_comment
+
+ local p_dictionary = { "dictionary",
+ dictionary = (
+ P("<<")
+ * (spacing * p_name * spacing * V("whatever"))^0
+ * spacing
+ * P(">>")
+ ),
+ array = (
+ P("[")
+ * (spacing * V("whatever"))^0
+ * spacing
+ * P("]")
+ ),
+ whatever = (
+ V("dictionary")
+ + V("array")
+ + p_other
+ ),
+ }
+
+ local p_object = P { "object",
+ dictionary = p_dictionary.dictionary,
+ array = p_dictionary.array,
+ whatever = p_dictionary.whatever,
+ object = spacing * (V("dictionary") + V("array") + p_other)
+ }
+
+ -- local p_object = cardinal
+ -- * spacing
+ -- * cardinal
+ -- * spacing
+ -- * P("obj")
+ -- * p_object
+ -- * P(1)^0
+ --
+ -- objectparser = Cs(p_object^1)
+
+ objectparser = Cs(p_object^1)
+
+ end
+
+ local function makehash(password,salt,userkey)
+ local k = digest256(password .. salt .. (userkey or ""))
+ local n = 0
+ while true do
+ local k1 = rep(password .. k .. (userkey or ""),64)
+ local k2 = sub(k,1,16)
+ local iv = sub(k,17,32)
+ local e = aesencode(k1,k2,iv)
+ local m = 0
+ local i = 1
+ for b in bytes(e) do
+ m = m + b
+ if i == 16 then
+ break
+ else
+ i = i + 1
+ end
+ end
+ m = m % 3
+ if m == 0 then
+ k = digest256(e)
+ elseif m == 1 then
+ k = digest384(e)
+ else
+ k = digest512(e)
+ end
+ n = n + 1
+ if n >= 64 and byte(sub(e,-1)) <= (n - 32) then
+ break
+ end
+ end
+ return sub(k,1,32)
+ end
+
+ local options = {
+ -- unknown = 0x0001, -- bit 1
+ -- unknown = 0x0002, -- bit 2
+ print = 0x0004, -- bit 3
+ modify = 0x0008, -- bit 4
+ extract = 0x0010, -- bit 5
+ add = 0x0020, -- bit 6
+ -- unknown = 0x0040, -- bit 7
+ -- unknown = 0x0080, -- bit 8
+ fillin = 0x0100, -- bit 9
+ access = 0x0200, -- bit 10
+ assemble = 0x0400, -- bit 11
+ quality = 0x0800, -- bit 12
+ -- unknown = 0x1000, -- bit 13
+ -- unknown = 0x2000, -- bit 14
+ -- unknown = 0x4000, -- bit 15
+ -- unknown = 0x8000, -- bit 16
+ }
+
+ -- 1111 0000 1100 0011
+
+ local mandate = 0x0200
+ local defaults = options.print | options.extract | options.quality
+
+ -- majorversion = 2
+ -- minorversion = 0
+
+ function lpdf.setencryption(specification)
+ if not encryptstream then
+ local ownerpassword = specification.ownerpassword
+ local userpassword = specification.userpassword
+ local optionlist = specification.permissions
+ if type(ownerpassword) == "string" and ownerpassword ~= "" then
+ --
+ if type(userpassword) ~= "string" then
+ userpassword = ""
+ end
+ userpassword = validpassword(userpassword)
+ ownerpassword = validpassword(ownerpassword)
+ --
+ encryptionkey = aesrandom(32) -- used earlier on
+ --
+ local permissions = mandate
+ if optionlist then
+ optionlist = utilities.parsers.settings_to_array(optionlist)
+ for i=1,#optionlist do
+ local p = options[optionlist[i]]
+ if p then
+ permissions = permissions | p
+ end
+ end
+ else
+ permissions = permissions | defaults
+ end
+ --
+ permissions = permissions | 0xF0C3 -- needs work
+ --
+ optionlist = { }
+ for k, v in sortedhash(options) do
+ if permissions & v == v then
+ optionlist[#optionlist+1] = k
+ end
+ end
+ --
+ local uservalidationsalt = aesrandom(8)
+ local userkeysalt = aesrandom(8)
+ local userhash = makehash(userpassword,uservalidationsalt)
+ local userkey = userhash .. uservalidationsalt .. userkeysalt -- U
+ local userintermediate = makehash(userpassword,userkeysalt)
+ local useraes = aesencode(encryptionkey,userintermediate) -- UE
+ --
+ local ownervalidationsalt = aesrandom(8)
+ local ownerkeysalt = aesrandom(8)
+ local ownerhash = makehash(ownerpassword,ownervalidationsalt,userkey)
+ local ownerkey = ownerhash .. ownervalidationsalt .. ownerkeysalt -- O
+ local ownerintermediate = makehash(ownerpassword,ownerkeysalt,userkey)
+ local owneraes = aesencode(encryptionkey,ownerintermediate) -- OE
+ --
+ -- still not ok test in qpdf
+ --
+ local permissionsstring = sio.tocardinal4(0xFFFFFFFF)
+ .. sio.tocardinal4(permissions)
+ .. "T" -- EncryptMetadata
+ .. "adb"
+ .. aesrandom(4)
+ local permissionsaes = aesencode(permissionsstring,encryptionkey)
+ --
+ permissionsaes = tohex(permissionsaes)
+ userkey = tohex(userkey)
+ ownerkey = tohex(ownerkey)
+ useraes = tohex(useraes)
+ owneraes = tohex(owneraes)
+ --
+ encdict = pdfdictionary {
+ Filter = pdfconstant("Standard"),
+ V = 5, -- variant
+ R = 6, -- revision
+ Length = 256, -- not needed
+ StmF = pdfconstant("StdCF"),
+ StrF = pdfconstant("StdCF"),
+ P = permissions,
+ Perms = pdfliteral(permissionsaes,true), -- #16
+ U = pdfliteral(userkey, true), -- #48
+ O = pdfliteral(ownerkey, true), -- #48
+ UE = pdfliteral(useraes, true), -- #32
+ OE = pdfliteral(owneraes, true), -- #32
+ CF = {
+ StdCF = {
+ AuthEvent = pdfconstant("DocOpen"),
+ CFM = pdfconstant("AESV3"),
+ Length = 32, -- #encryptionkey
+ }
+ },
+ -- bonus
+ EncryptMetadata = true,
+ }
+ --
+ encryptstream = function(str)
+ return aesencode(str,encryptionkey,true,true,true) -- random-iv add-iv add-padding
+ end
+ encryptobject = function(obj)
+ if obj then
+ if type(obj) == "table" then
+ obj = obj()
+ end
+ return lpegmatch(objectparser,obj) or obj
+ end
+ end
+ --
+ report_encryption("stream objects get encrypted")
+ if not objectstream then
+ report_encryption("strings are not encrypted, enable object streams")
+ end
+ report_encryption("permissions: % t",optionlist)
+ if userpassword == "" then
+ report_encryption("no user password")
+ end
+ --
+ end
+ end
+ end
+
+ backends.registered.pdf.codeinjections.setencryption = lpdf.setencryption
+
+end
do
@@ -1677,12 +2111,16 @@ do
end
end)
-
end
local flushdeferred -- defined later
local level = 0
+local state = true
+
+function lpdf.setpagestate(s)
+ state = s
+end
local finalize do
@@ -1694,12 +2132,16 @@ local finalize do
finalize = function(driver,details)
+ if not details then
+ report("something is wrong, no details in 'finalize'")
+ end
+
level = level + 1
pdf_goto_pagemode() -- for now
local objnum = details.objnum
- local specification = details.specification
+ local specification = details.specification or { }
local content = concat(buffer,"\n",1,b)
@@ -1713,7 +2155,8 @@ local finalize do
if next(usedfonts) then
fonts = pdfdictionary { }
for k, v in next, usedfonts do
- fonts[f_font(v)] = pdfreference(pdfgetfontobjectnumber(k)) -- we can overload for testing
+-- fonts[f_font(v)] = pdfreference(pdfgetfontobjectnumber(k)) -- we can overload for testing
+ fonts[f_font(v)] = pdfreference(usedfontobjects[k]) -- we can overload for testing
end
end
@@ -1756,7 +2199,7 @@ local finalize do
boundingbox[4] * bpfactor,
}
- local contentsobj = pdfflushstreamobject(content,false,false)
+ local contentsobj = pdfflushstreamobject(content,false,true)
pageattributes.Type = pdf_page
pageattributes.Contents = pdfreference(contentsobj)
@@ -1769,6 +2212,10 @@ local finalize do
-- resources can be indirect
+if state == "ignore" or state == false then
+
+else
+
registerpage(pageattributes)
lpdf.finalizepage(true)
@@ -1783,6 +2230,8 @@ local finalize do
if CropBox then pageattributes.CropBox = pdfsharedobject(CropBox ) end
if BleedBox then pageattributes.BleedBox = pdfsharedobject(BleedBox) end
+end
+
else
local xformtype = specification.type or 0
@@ -1821,9 +2270,16 @@ local finalize do
wrapper.Matrix = pdfarray { 1, 0, 0, 1, 0, 0 }
end
- -- todo: additional = resources
+ local patterns = true
- local boxresources = lpdf.collectedresources { serialize = false }
+ if attributes.Type and attributes.Type == pdf_pattern then
+ patterns = false
+ end
+
+ local boxresources = lpdf.collectedresources {
+ patterns = patterns,
+ serialize = false,
+ }
boxresources.Font = fonts
boxresources.XObject = xforms
@@ -1831,7 +2287,7 @@ local finalize do
-- wrapper.Resources = pdfreference(pdfflushobject(boxresources))
if resources ~= "" then
- boxresources = boxresources + resources
+ boxresources = boxresources + resources
end
if attributes ~= "" then
wrapper = wrapper + attributes
@@ -1840,7 +2296,7 @@ local finalize do
wrapper.Resources = next(boxresources) and boxresources or nil
wrapper.ProcSet = lpdf.procset()
- pdfflushstreamobject(content,wrapper,false,specification.objnum)
+ pdfflushstreamobject(content,wrapper,true,specification.objnum)
end
@@ -1866,17 +2322,6 @@ local finalize do
end
-updaters.register("backend.update",function()
- local saveboxresource = tex.boxresources.save
- --
- -- also in lpdf-res .. brrr .. needs fixing
- --
- backends.codeinjections.registerboxresource = function(n,offset)
- local r = saveboxresource(n,nil,nil,false,0,offset or 0)
- return r
- end
-end)
-
-- now comes the pdf file handling
local objects = { }
@@ -1892,9 +2337,6 @@ local cache = false
local info = ""
local catalog = ""
local lastdeferred = false
-local majorversion = 1
-local minorversion = 7
-local trailerid = true
directives.register("backend.pdf.threshold",function(v)
if v then
@@ -1918,8 +2360,8 @@ local f_stream_b_d_u = formatters["%i 0 obj\010<< %s /Length %i >>\010stream\010
local f_stream_b_d_c = formatters["%i 0 obj\010<< %s /Filter /FlateDecode /Length %i >>\010stream\010"]
local f_stream_b_d_r = formatters["%i 0 obj\010<< %s >>\010stream\010"]
------ s_object_e = "\010endobj\010"
-local s_stream_e = "\010endstream\010endobj\010"
+----- s_object_e <const> = "\010endobj\010"
+local s_stream_e <const> = "\010endstream\010endobj\010"
do
@@ -2019,23 +2461,30 @@ local addtocache, flushcache, cache do
First = #list + 1,
}
objects[cache] = offset
- local b = nil
- local e = s_stream_e
+ local fb
if compress then
- local comp = zlibcompress(data,3)
- if comp and #comp < #data then
+ local size = #data
+ local comp = compressdata(data,size)
+ if comp and #comp < size then
data = comp
- b = f_stream_b_d_c(cache,strobj(),#data)
+ fb = f_stream_b_d_c
else
- b = f_stream_b_d_u(cache,strobj(),#data)
+ fb = f_stream_b_d_u
end
else
- b = f_stream_b_d_u(cache,strobj(),#data)
+ fb = f_stream_b_d_u
+ end
+ local size = #data
+ if encryptstream then
+ data = encryptstream(data)
+ size = #data
end
+ local b = fb(cache,strobj(),size)
+ local e = s_stream_e
flush(f,b)
flush(f,data)
flush(f,e)
- offset = offset + #b + #data + #e
+ offset = offset + #b + size + #e
data, d = { }, 0
list, l = { }, 0
coffset = 0
@@ -2047,13 +2496,14 @@ end
do
- local names = { }
- local cache = { }
- local nofpages = 0
+ local names = { }
+ local cache = { }
+ local nofpages = 0
- local texgetcount = tex.getcount
+ local texgetcount = tex.getcount
+ local c_realpageno = tex.iscount("realpageno")
- function lpdf.reserveobject(name)
+ pdfreserveobject = function(name)
nofobjects = nofobjects + 1
objects[nofobjects] = false
if name then
@@ -2067,22 +2517,26 @@ do
return nofobjects
end
- function lpdf.pagereference(n,complete) -- true | false | nil | n [true,false]
- if nofpages == 0 then
- nofpages = structures.pages.nofpages
- if nofpages == 0 then
- nofpages = 1
- end
- end
+ pdfpagereference = function(n,complete) -- true | false | nil | n [true,false]
if n == true or not n then
complete = n
- n = texgetcount("realpageno")
+ n = texgetcount(c_realpageno)
end
- local r = n > nofpages and pdfgetpagereference(nofpages) or pdfgetpagereference(n)
+ if n > nofpages then
+ nofpages = n
+ end
+ local r = pdfgetpagereference(n)
return complete and pdfreference(r) or r
end
- function lpdf.nofpages()
+ lpdf.reserveobject = pdfreserveobject
+ lpdf.pagereference = pdfpagereference
+
+ function lpdf.lastreferredpage()
+ return nofpages
+ end
+
+ function lpdf.nofpages() -- this will change: document nofpages
return structures.pages.nofpages
end
@@ -2100,7 +2554,7 @@ do
return n
end
- function lpdf.flushobject(name,data)
+ pdfflushobject = function(name,data)
if data then
local named = names[name]
if named then
@@ -2128,7 +2582,7 @@ do
end
end
- function lpdf.flushstreamobject(data,dict,compressed,objnum) -- default compressed
+ pdfflushstreamobject = function(data,dict,compressed,objnum) -- default compressed
if trace_objects then
report_objects("flushing stream object of %s bytes",#data)
end
@@ -2136,15 +2590,16 @@ do
local kind = compressed == "raw" and "raw" or "stream"
local nolength = nil
if compressed == "raw" then
- compressed = nil
+ compressed = false
nolength = true
-- data = string.formatters["<< %s >>stream\n%s\nendstream"](attr,data)
end
+
return pdfdeferredobject {
objnum = objnum,
immediate = true,
nolength = nolength,
- compresslevel = compressed == false and 0 or nil,
+ compresslevel = compressed,
type = "stream",
string = data,
attr = (dtype == "string" and dict) or (dtype == "table" and dict()) or nil,
@@ -2159,7 +2614,7 @@ do
return pdfdeferredobject {
objnum = objnum,
immediate = true,
- compresslevel = compressed == false and 0 or nil,
+ compresslevel = compressed,
type = "stream",
file = filename,
attr = (dtype == "string" and dict) or (dtype == "table" and dict()) or nil,
@@ -2182,7 +2637,7 @@ do
end
end
- function lpdf.shareobjectreference(content)
+ pdfsharedobject = function(content)
if content == nil then
-- invalid object not created
else
@@ -2201,6 +2656,11 @@ do
end
end
+ lpdf.flushobject = pdfflushobject
+ lpdf.flushstreamobject = pdfflushstreamobject
+ lpdf.shareobjectreference = pdfsharedobject
+ lpdf.sharedobject = pdfsharedobject
+
end
local pages = table.setmetatableindex(function(t,k)
@@ -2209,15 +2669,20 @@ local pages = table.setmetatableindex(function(t,k)
return v
end)
-function lpdf.getpagereference(n)
+pdfgetpagereference = function(n)
return pages[n]
end
+lpdf.getpagereference = pdfgetpagereference
+
local function flushnormalobj(data,n)
if not n then
nofobjects = nofobjects + 1
n = nofobjects
end
+ if encryptobject then
+ data = encryptobject(data)
+ end
data = f_object(n,data)
if level == 0 then
objects[n] = offset
@@ -2244,49 +2709,84 @@ local function flushstreamobj(data,n,dict,comp,nolength)
n = nofobjects
end
local size = #data
+ if comp ~= false then
+ comp = compress and size > threshold
+ end
+ if encryptobject then
+ dict = encryptobject(dict)
+ end
if level == 0 then
local b = nil
local e = s_stream_e
if nolength then
- b = f_stream_b_d_r(n,dict)
- elseif comp ~= false and compress and size > threshold then
- local compdata = zlibcompress(data,3)
- if compdata then
- local compsize = #compdata
- if compsize > size - threshold then
- b = dict and f_stream_b_d_u(n,dict,size) or f_stream_b_n_u(n,size)
+ -- probleem: we need to adapt length!
+ b = f_stream_b_d_r(n,dict) -- raw object, already treated
+ if encryptstream then
+ print("check length")
+ data = encryptstream(data)
+ size = #data
+ end
+ else
+ if comp then
+ local compdata = compressdata(data,size)
+ if compdata then
+ local compsize = #compdata
+ if compsize <= size - threshold then
+ data = compdata
+ size = compsize
+ else
+ comp = false
+ end
else
- data = compdata
- b = dict and f_stream_b_d_c(n,dict,compsize) or f_stream_b_n_c(n,compsize)
+ comp = false
end
+ end
+ if encryptstream then
+ data = encryptstream(data)
+ size = #data
+ end
+ if comp then
+ b = dict and f_stream_b_d_c(n,dict,size) or f_stream_b_n_c(n,size)
else
b = dict and f_stream_b_d_u(n,dict,size) or f_stream_b_n_u(n,size)
end
- else
- b = dict and f_stream_b_d_u(n,dict,size) or f_stream_b_n_u(n,size)
end
flush(f,b)
flush(f,data)
flush(f,e)
objects[n] = offset
- offset = offset + #b + #data + #e
+ offset = offset + #b + size + #e
else
if nolength then
- data = f_stream_d_r(n,dict,data)
- elseif comp ~= false and compress and size > threshold then
- local compdata = zlibcompress(data,3)
- if compdata then
- local compsize = #compdata
- if compsize > size - threshold then
- data = dict and f_stream_d_u(n,dict,size,data) or f_stream_n_u(n,size,data)
+ if encryptstream then
+ print("check length")
+ data = encryptstream(data)
+ end
+ data = f_stream_d_r(n,dict,data) -- raw object, already treated
+ else
+ if comp then
+ local compdata = compressdata(data,size)
+ if compdata then
+ local compsize = #compdata
+ if compsize <= size - threshold then
+ data = compdata
+ size = compsize
+ else
+ comp = false
+ end
else
- data = dict and f_stream_d_c(n,dict,compsize,compdata) or f_stream_n_c(n,compsize,compdata)
+ comp = false
end
+ end
+ if encryptstream then
+ data = encryptstream(data)
+ size = #data
+ end
+ if comp then
+ data = dict and f_stream_d_c(n,dict,size,data) or f_stream_n_c(n,size,data)
else
data = dict and f_stream_d_u(n,dict,size,data) or f_stream_n_u(n,size,data)
end
- else
- data = dict and f_stream_d_u(n,dict,size,data) or f_stream_n_u(n,size,data)
end
if not lastdeferred then
lastdeferred = n
@@ -2312,7 +2812,7 @@ flushdeferred = function() -- was forward defined
end
end
-function lpdf.immediateobject(a,b,c,d)
+pdfimmediateobject = function(a,b,c,d)
local kind --, immediate
local objnum, data, attr, filename
local compresslevel, objcompression, nolength
@@ -2375,7 +2875,7 @@ function lpdf.immediateobject(a,b,c,d)
end
-- todo: immediate
if kind == "stream" then
- flushstreamobj(data,objnum,attr,compresslevel and compresslevel > 0 or nil,nolength)
+ flushstreamobj(data,objnum,attr,compresslevel,nolength) -- nil == auto
elseif objectstream and objcompression ~= false then
addtocache(objnum,data)
else
@@ -2384,7 +2884,10 @@ function lpdf.immediateobject(a,b,c,d)
return objnum
end
-lpdf.deferredobject = lpdf.immediateobject
+pdfdeferredobject = pdfimmediateobject
+
+lpdf.deferredobject = pdfimmediateobject
+lpdf.immediateobject = pdfimmediateobject
-- In lua 5.4 the methods are now moved one metalevel deeper so we need to get them
-- from mt.__index instead. (I did get that at first.) It makes for a slightly (imo)
@@ -2411,9 +2914,22 @@ local openfile, closefile do
local close = false
local update = false
- -- local removefile = os.remove
+ directives.enable("backend.pdf.inmemory", function(v) inmemory = true end)
+
+ -- local banner <const> = "%\xCC\xD5\xC1\xD4\xC5\xD8\xD0\xC4\xC6\010" -- LUATEXPDF (+128)
+ local banner <const> = "%\xC3\xCF\xCE\xD4\xC5\xD8\xD4\xD0\xC4\xC6\010" -- CONTEXTPDF (+128)
openfile = function(filename)
+ --
+ local arguments = environment.arguments
+ if arguments.ownerpassword then
+ lpdf.setencryption {
+ ownerpassword = arguments.ownerpassword,
+ userpassword = arguments.userpassword,
+ permissions = arguments.permissions,
+ }
+ end
+ --
if inmemory then
local n = 0
f = { }
@@ -2443,7 +2959,9 @@ local openfile, closefile do
else
f = io.open(filename,"wb")
if not f then
- -- message
+ report()
+ report("quitting because file %a cannot be opened for writing",filename)
+ report()
os.exit()
end
-- f:setvbuf("full",64*1024)
@@ -2455,12 +2973,10 @@ local openfile, closefile do
f:write(s)
end
end
- local v = f_pdf_tag(majorversion,minorversion)
- -- local b = "%\xCC\xD5\xC1\xD4\xC5\xD8\xD0\xC4\xC6\010" -- LUATEXPDF (+128)
- local b = "%\xC3\xCF\xCE\xD4\xC5\xD8\xD4\xD0\xC4\xC6\010" -- CONTEXTPDF (+128)
- flush(f,v)
- flush(f,b)
- offset = offset + #v + #b
+ local version = f_pdf_tag(majorversion,minorversion)
+ flush(f,version)
+ flush(f,banner)
+ offset = offset + #version + #banner
end
closefile = function(abort)
@@ -2486,15 +3002,17 @@ local openfile, closefile do
local xrefoffset = offset
local lastfree = 0
local noffree = 0
+ --
+ local os = objectstream
+ if encryptstream then
+ objectstream = false
+ end
local catalog = lpdf.getcatalog()
+ objectstream = os
+ --
local info = lpdf.getinfo()
- if trailerid == true then
- trailerid = md5.HEX(osuuid())
- elseif trailerid and #trailerid > 32 then
- trailerid = md5.HEX(trailerid)
- else
- trailerid = false
- end
+ local trailerid = lpdf.gettrailerid()
+
if objectstream then
flushdeferred()
flushcache()
@@ -2520,8 +3038,8 @@ local openfile, closefile do
if strm then
o = -o
end
- c1 = extract(o,8,8)
- c2 = extract(o,0,8)
+ c1 = (o>>8)&0xFF
+ c2 = (o>>0)&0xFF
if strm then
objects[i] = char(2,c1,c2,streams[o][i])
else
@@ -2533,8 +3051,8 @@ local openfile, closefile do
for i=nofobjects,1,-1 do
local o = objects[i]
if not o then
- local f1 = extract(lastfree,8,8)
- local f2 = extract(lastfree,0,8)
+ local f1 = (lastfree>>8)&0xFF
+ local f2 = (lastfree>>0)&0xFF
objects[i] = char(0,f1,f2,0)
lastfree = i
end
@@ -2551,9 +3069,9 @@ local openfile, closefile do
if strm then
o = -o
end
- c1 = extract(o,16,8)
- c2 = extract(o, 8,8)
- c3 = extract(o, 0,8)
+ c1 = (o>>16)&0xFF
+ c2 = (o>> 8)&0xFF
+ c3 = (o>> 0)&0xFF
if strm then
objects[i] = char(2,c1,c2,c3,streams[o][i])
else
@@ -2565,9 +3083,9 @@ local openfile, closefile do
for i=nofobjects,1,-1 do
local o = objects[i]
if not o then
- local f1 = extract(lastfree,16,8)
- local f2 = extract(lastfree, 8,8)
- local f3 = extract(lastfree, 0,8)
+ local f1 = (lastfree>>16)&0xFF
+ local f2 = (lastfree>> 8)&0xFF
+ local f3 = (lastfree>> 0)&0xFF
objects[i] = char(0,f1,f2,f3,0)
lastfree = i
end
@@ -2584,10 +3102,10 @@ local openfile, closefile do
if strm then
o = -o
end
- c1 = extract(o,24,8)
- c2 = extract(o,16,8)
- c3 = extract(o, 8,8)
- c4 = extract(o, 0,8)
+ c1 = (o>>24)&0xFF
+ c2 = (o>>16)&0xFF
+ c3 = (o>> 8)&0xFF
+ c4 = (o>> 0)&0xFF
if strm then
objects[i] = char(2,c1,c2,c3,c4,streams[o][i])
else
@@ -2599,10 +3117,10 @@ local openfile, closefile do
for i=nofobjects,1,-1 do
local o = objects[i]
if not o then
- local f1 = extract(lastfree,24,8)
- local f2 = extract(lastfree,16,8)
- local f3 = extract(lastfree, 8,8)
- local f4 = extract(lastfree, 0,8)
+ local f1 = (lastfree>>24)&0xFF
+ local f2 = (lastfree>>16)&0xFF
+ local f3 = (lastfree>> 8)&0xFF
+ local f4 = (lastfree>> 0)&0xFF
objects[i] = char(0,f1,f2,f3,f4,0)
lastfree = i
end
@@ -2611,36 +3129,72 @@ local openfile, closefile do
end
objects[0] = rep("\0",1+nofbytes+1)
local data = concat(objects,"",0,nofobjects)
+ local size = #data
local xref = pdfdictionary {
- Type = pdfconstant("XRef"),
- Size = nofobjects + 1,
- W = pdfarray { 1, nofbytes, 1 },
- Root = catalog,
- Info = info,
- ID = trailerid and pdfarray { pdfliteral(trailerid,true), pdfliteral(trailerid,true) } or nil,
+ Type = pdfconstant("XRef"),
+ Size = nofobjects + 1,
+ W = pdfarray { 1, nofbytes, 1 },
+ Root = catalog,
+ Info = info,
+ ID = trailerid and pdfarray { pdfliteral(trailerid,true), pdfliteral(trailerid,true) } or nil,
+ Encrypt = encdict or nil,
}
- if compress then
- local comp = zlibcompress(data,3)
- if comp then
- data = comp
- flush(f,f_stream_b_d_c(nofobjects,xref(),#data))
+ local fb
+ -- if encryptstream then
+ -- if compress then
+ -- local comp = compressdata(data,size)
+ -- if comp then
+ -- data = comp
+ -- size = #data
+ -- fb = f_stream_b_d_c
+ -- xref.Filter = pdfarray {
+ -- pdfconstant("Crypt"), -- identity
+ -- pdfconstant("FlateDecode")
+ -- }
+ -- else
+ -- xref.Filter = pdfconstant("Crypt") -- identity
+ -- end
+ -- else
+ -- xref.Filter = pdfconstant("Crypt") -- identity
+ -- end
+ -- fb = f_stream_b_d_u
+ -- else
+ if compress then
+ local comp = compressdata(data,size)
+ if comp then
+ data = comp
+ size = #data
+ fb = f_stream_b_d_c
+ else
+ fb = f_stream_b_d_u
+ end
else
- flush(f,f_stream_b_d_u(nofobjects,xref(),#data))
+ fb = f_stream_b_d_u
end
- else
- flush(f,f_stream_b_d_u(nofobjects,xref(),#data))
- end
+ -- end
+ -- no encryption of data here
+ flush(f,fb(nofobjects,xref(),size))
flush(f,data)
flush(f,s_stream_e)
flush(f,f_startxref(xrefoffset))
else
flushdeferred()
+ --
+ -- if encryptstream then
+ -- -- unencrypted !
+ -- local eo = encryptobject
+ -- encryptobject = false
+ -- encdict = pdfreference(pdfimmediateobject(tostring(encdict)))
+ -- encryptobject = eo
+ -- end
+ --
xrefoffset = offset
flush(f,f_xref(nofobjects+1))
local trailer = pdfdictionary {
- Size = nofobjects+1,
- Root = catalog,
- Info = info,
+ Size = nofobjects + 1,
+ Root = catalog,
+ Info = info,
+ Encrypt = encdict or nil,
}
for i=1,nofobjects do
local o = objects[i]
@@ -2676,20 +3230,22 @@ end
-- For the moment we overload it here, although back-fil.lua eventually will
-- be merged with back-pdf as it's pdf specific, or maybe back-imp-pdf or so.
-do -- updaters.register("backend.update.pdf",function()
+do
-- We overload img but at some point it will even go away, so we just
-- reimplement what we need in context. This will change completely i.e.
-- we will drop the low level interface!
- local codeinjections = backends.pdf.codeinjections
+ local pdfbackend = backends.registered.pdf
+ local nodeinjections = pdfbackend.nodeinjections
+ local codeinjections = pdfbackend.codeinjections
local imagetypes = images.types -- pdf png jpg jp2 jbig2 stream
local img_none = imagetypes.none
- local rulecodes = nodes.rulecodes
-
- local setprop = nodes.nuts.setprop
+ local newimagerule = nuts.pool.imagerule
+ local setattrlist = nuts.setattrlist
+ local setprop = nuts.setprop
local report_images = logs.reporter("backend","images")
@@ -2697,7 +3253,6 @@ do -- updaters.register("backend.update.pdf",function()
local indices = { }
local bpfactor = number.dimenfactors.bp
- local imagerule_code = rulecodes.image
function codeinjections.newimage(specification)
return specification
@@ -2707,7 +3262,8 @@ do -- updaters.register("backend.update.pdf",function()
return setmetatableindex(original)
end
- function codeinjections.scanimgage(specification)
+ function codeinjections.scanimage(specification)
+ -- placeholder, doesn't give back dimensions etc but will be plugged in
return specification
end
@@ -2763,8 +3319,7 @@ do -- updaters.register("backend.update.pdf",function()
specification.type = kind
specification.kind = kind
end
- local compress = compresslevel and compresslevel > 0 or nil
- flushstreamobj(stream,objnum,dict,compress,nolength)
+ flushstreamobj(stream,objnum,dict,compresslevel,nolength)
specification.objnum = objnum
specification.rotation = specification.rotation or 0
specification.orientation = specification.orientation or 0
@@ -2786,17 +3341,17 @@ do -- updaters.register("backend.update.pdf",function()
embedimage(specification)
end
--
- local width = specification.width or 0
- local height = specification.height or 0
- local depth = specification.depth or 0
- -- newimagerule
- local n = nodes.pool.rule(width,height,depth)
- n.subtype = imagerule_code
- setprop(tonut(n),"index",specification.index)
- return n
+ local n = newimagerule(
+ specification.width or 0,
+ specification.height or 0,
+ specification.depth or 0
+ )
+ setattrlist(n,true)
+ setprop(n,"index",specification.index)
+ return tonode(n)
end
- function lpdf.includeimage(index)
+ pdfincludeimage = function(index)
local specification = indices[index]
if specification then
local bbox = specification.bbox
@@ -2818,109 +3373,9 @@ do -- updaters.register("backend.update.pdf",function()
end
end
-end -- )
-
-do -- updaters.register("backend.update.lpdf",function()
-
- -- todo: an md5 or sha2 hash can save space
- -- todo: make a type 3 font instead
- -- todo: move to lpdf namespace
+ lpdf.includeimage = pdfincludeimage
- local pdfimage
- local newpdf
- local openpdf
- local closepdf
- local copypage
-
-
- updaters.register("backend.update.lpdf",function()
- pdfimage = lpdf.epdf.image
- newpdf = pdfimage.new
- openpdf = pdfimage.open
- closepdf = pdfimage.close
- copypage = pdfimage.copy
- end)
-
- local embedimage = images.embed
-
- local nofstreams = 0
- local topdf = { }
- local toidx = { }
-
- local function storedata_s(pdf)
- local idx = toidx[pdf]
- if not idx then
- nofstreams = nofstreams + 1
- idx = nofstreams
- toidx[pdf] = nofstreams
- topdf[idx] = pdf
- end
- return idx
- end
-
- local function vfimage_s(id,wd,ht,dp,pos_h,pos_v)
- local index = topdf[id]
- if type(index) == "string" then
- local pdfdoc = newpdf(index,#index)
- local image = copypage(pdfdoc)
- local bbox = image.bbox
- image.width = bbox[3] - bbox[1]
- image.height = bbox[4] - bbox[2]
- embedimage(image)
- index = image.index
- topdf[id] = index
- end
- flushimage(index,wd,ht,dp,pos_h,pos_v)
- end
-
- local function storedata_n(name,page)
- local idx = toidx[pdf]
- if not idx then
- nofstreams = nofstreams + 1
- idx = nofstreams
- toidx[pdf] = nofstreams
- topdf[idx] = pdf
- end
- return idx
- end
-
- -- We need to have a way to close such a pdf ... esp for fonts.
-
- local pdfdocs = { }
-
- local function vfimage_n(name,page,wd,ht,dp,pos_h,pos_v)
- local d = pdfdocs[name]
- if not d then
- d = { doc = openpdf(name), pages = { } }
- pdfdocs[name] = d
- end
- local index = d.pages[page]
- if not index then
- local image = copypage(d.doc,page)
- local bbox = image.bbox
- image.width = bbox[3] - bbox[1]
- image.height = bbox[4] - bbox[2]
- embedimage(image)
- index = image.index
- d.pages[page] = index
- end
- flushimage(index,wd,ht,dp,pos_h,pos_v)
- end
-
- function lpdf.pdfvfimage(wd,ht,dp,data,name)
- if type(data) == "number" then
- return { "lua", function(font,char,pos_h,pos_v)
- vfimage_n(name,data,wd,ht,dp,pos_h,pos_v)
- end }
- else
- return { "lua", function(font,char,pos_h,pos_v)
- local id = storedata_s(data)
- vfimage_s(id,wd,ht,dp,pos_h,pos_v)
- end }
- end
- end
-
-end -- )
+end
-- The driver.
@@ -2937,18 +3392,23 @@ do
return pdfname
end
- -- todo: prevent twice
+-- local outputfilename ; do -- old todo usedname in ^^
+-- local filename = nil
+-- outputfilename = function(driver,usedname)
+-- if usedname and usedname ~= "" then
+-- filename = addsuffix(usedname,"pdf")
+-- elseif not filename or filename == "" then
+-- filename = addsuffix(tex.jobname,"pdf")
+-- end
+-- return filename
+-- end
+-- end
+ -- todo: prevent twice
local function prepare(driver)
if not environment.initex then
- -- install new functions in pdf namespace
--- updaters.apply("backend.update.pdf")
- -- install new functions in lpdf namespace
- updaters.apply("backend.update.lpdf")
- -- adapt existing shortcuts to lpdf namespace
--- updaters.apply("backend.update.tex")
--- -- adapt existing shortcuts to tex namespace
- updaters.apply("backend.update")
+ --
+ backends.initialize("pdf") -- also does bindings
--
pdfname = tex.jobname .. ".pdf"
openfile(pdfname)
@@ -2957,6 +3417,7 @@ do
if pdfname then
lpdf.finalizedocument()
closefile()
+ pdfname = nil
end
end)
--
@@ -2965,14 +3426,27 @@ do
lpdf.finalizepage(true)
end
end)
- -- --
- lpdf.registerdocumentfinalizer(wrapup,nil,"wrapping up")
+ --
+ lpdf.registerdocumentfinalizer(wrapupdocument,nil,"wrapping up")
--
statistics.register("result saved in file", function()
local outputfilename = environment.outputfilename or environment.jobname or tex.jobname or "<unset>"
+ outputfilename = string.gsub(outputfilename,"^%./+","") -- todo: make/use a helper
return string.format("%s.%s, compresslevel %s, objectcompresslevel %s",outputfilename,"pdf",lpdf.getcompression())
end)
--
+ luatex.registerstopactions(function()
+ if pdfname then
+ local r = lpdf.lastreferredpage() -- somehow referenced
+ local s = lpdf.getnofpages() -- in page tree, saved in file
+ local t = lpdf.nofpages() -- in tuc file
+ if r > s then
+ report()
+ report("referred pages: %i, saved pages %i, pages from tuc file: %i, possible corrupt file",r,s,t)
+ report()
+ end
+ end
+ end)
end
converter = drivers.converters.lmtx
useddriver = driver
@@ -2996,8 +3470,13 @@ do
converter(driver,texgetbox(boxnumber),"page")
end
- localconverter = function(...)
- converter(useddriver,...)
+-- localconverter = function(...)
+-- print(...) -- ok when we add this
+-- converter(useddriver,...) -- otherwise nil .. lua bug
+-- end
+
+ localconverter = function(a,b,c,d)
+ converter(useddriver,a,b,c,d)
end
drivers.install {
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-mis.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-mis.lmt
index afb149d8af7..a3a78c49ff8 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-mis.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-mis.lmt
@@ -20,15 +20,15 @@ local format, gsub, formatters = string.format, string.gsub, string.formatters
local concat, flattened = table.concat, table.flattened
local settings_to_array = utilities.parsers.settings_to_array
-local backends, lpdf, nodes = backends, lpdf, nodes
-
-local nodeinjections = backends.pdf.nodeinjections
-local codeinjections = backends.pdf.codeinjections
-local registrations = backends.pdf.registrations
+local pdfbackend = backends and backends.registered.pdf or { }
+local nodeinjections = pdfbackend.nodeinjections
+local codeinjections = pdfbackend.codeinjections
+local registrations = pdfbackend.registrations
local getpagedimensions = layouts.getpagedimensions
local getcanvas = layouts.getcanvas
+local nodes = nodes
local nuts = nodes.nuts
local copy_node = nuts.copy
@@ -36,6 +36,7 @@ local nodepool = nuts.pool
local setstate = nodepool.setstate
local register = nodepool.register
+local lpdf = lpdf
local pdfdictionary = lpdf.dictionary
local pdfarray = lpdf.array
local pdfconstant = lpdf.constant
@@ -44,26 +45,16 @@ local pdfunicode = lpdf.unicode
local pdfverbose = lpdf.verbose
local pdfstring = lpdf.string
local pdfaction = lpdf.action
+local pdfflushobject = lpdf.flushobject
+local pdfflushstreamobject = lpdf.flushstreamobject
+local pdfminorversion = lpdf.minorversion
-local pdfflushobject
-local pdfflushstreamobject
-local pdfminorversion
-
-updaters.register("backend.update.lpdf",function()
- pdfflushobject = lpdf.flushobject
- pdfflushstreamobject = lpdf.flushstreamobject
- pdfminorversion = lpdf.minorversion
-end)
-
-local formattedtimestamp = lpdf.pdftimestamp
local adddocumentextgstate = lpdf.adddocumentextgstate
local addtocatalog = lpdf.addtocatalog
local addtoinfo = lpdf.addtoinfo
local addtopageattributes = lpdf.addtopageattributes
local addtonames = lpdf.addtonames
-local pdfgetmetadata = lpdf.getmetadata
-
local texset = tex.set
local variables = interfaces.variables
@@ -195,80 +186,9 @@ end
lpdf.registerpagefinalizer (flushpageactions, "page actions")
lpdf.registerdocumentfinalizer(flushdocumentactions,"document actions")
---- info : this can change and move elsewhere
-
-local identity = { }
-
-function codeinjections.setupidentity(specification)
- for k, v in next, specification do
- if v ~= "" then
- identity[k] = v
- end
- end
-end
+-- the code above will move to scrn-ini
-function codeinjections.getidentityvariable(name)
- return identity[name]
-end
-
-local done = false -- using "setupidentity = function() end" fails as the meaning is frozen in register
-
-local function setupidentity()
- if not done then
- local metadata = pdfgetmetadata()
- local creator = metadata.creator
- local version = metadata.contextversion
- local time = metadata.time
- local jobname = environment.jobname or tex.jobname or "unknown"
- --
- local title = identity.title
- if not title or title == "" then
- title = tex.jobname
- end
- addtoinfo("Title", pdfunicode(title), title)
- local subtitle = identity.subtitle or ""
- if subtitle ~= "" then
- addtoinfo("Subject", pdfunicode(subtitle), subtitle)
- end
- local author = identity.author or ""
- if author ~= "" then
- addtoinfo("Author", pdfunicode(author), author) -- '/Author' in /Info, 'Creator' in XMP
- end
- addtoinfo("Creator", pdfunicode(creator), creator)
- addtoinfo("CreationDate", pdfstring(formattedtimestamp(time)))
- local date = identity.date or ""
- local pdfdate = date and formattedtimestamp(date)
- if pdfdate then
- addtoinfo("ModDate", pdfstring(pdfdate), date)
- else
- -- users should enter the date in 2010-01-19T23:27:50+01:00 format
- -- and if not provided that way we use the creation time instead
- addtoinfo("ModDate", pdfstring(formattedtimestamp(time)),time)
- end
- local keywords = identity.keywords or ""
- if keywords ~= "" then
- keywords = concat(settings_to_array(keywords), " ")
- addtoinfo("Keywords", pdfunicode(keywords), keywords)
- end
- local id = lpdf.id()
- addtoinfo("ID", pdfstring(id), id) -- needed for pdf/x
- --
- addtoinfo("ConTeXt.Version",version)
- addtoinfo("ConTeXt.Time",os.date("%Y-%m-%d %H:%M"))
- addtoinfo("ConTeXt.Jobname",jobname)
- addtoinfo("ConTeXt.Url","www.pragma-ade.com")
- addtoinfo("ConTeXt.Support","contextgarden.net")
- addtoinfo("TeX.Support","tug.org")
- --
- done = true
- else
- -- no need for a message
- end
-end
-
-lpdf.registerpagefinalizer(setupidentity,"identity")
-
--- or when we want to be able to set things after pag e1:
+-- or when we want to be able to set things after page 1:
--
-- lpdf.registerdocumentfinalizer(setupidentity,1,"identity")
@@ -363,7 +283,7 @@ local pagespecs = {
[v_doublesided] = {
mode = "UseNone",
layout = "TwoColumnRight",
- fit = true,
+ fit = true,
},
[v_singlesided] = {
mode = "UseNone"
@@ -447,7 +367,6 @@ local function documentspecification()
end
end
end
-
-- maybe interfaces.variables
local layout = spec.layout
local mode = spec.mode
@@ -619,6 +538,8 @@ local function featurecreep()
conversion = getset("structure:conversions",p.block,conversionset,1,"numbers")
end
end
+ -- If needed we can do some preroll on a prefix (label) but this is a rather useless
+ -- feature (creep) anyway so why bother.
conversion = conversion and map[conversion] or map.numbers
if number == 1 or oldlabel ~= label or oldconversion ~= conversion then
list[#list+1] = i - 1 -- pdf starts numbering at 0
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-mov.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-mov.lmt
deleted file mode 100644
index 42ba6fb008f..00000000000
--- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-mov.lmt
+++ /dev/null
@@ -1,68 +0,0 @@
-if not modules then modules = { } end modules ['lpdf-mov'] = {
- version = 1.001,
- comment = "companion to lpdf-ini.mkiv",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files"
-}
-
-local format = string.format
-
-local lpdf = lpdf
-local context = context
-
-local nodeinjections = backends.pdf.nodeinjections
-local pdfconstant = lpdf.constant
-local pdfdictionary = lpdf.dictionary
-local pdfarray = lpdf.array
-local pdfborder = lpdf.border
-local write_node = node.write
-
-function nodeinjections.insertmovie(specification)
- -- managed in figure inclusion: width, height, factor, repeat, controls, preview, label, foundname
- local width = specification.width
- local height = specification.height
- local factor = specification.factor or number.dimenfactors.bp
- local moviedict = pdfdictionary {
- F = specification.foundname,
- Aspect = pdfarray { factor * width, factor * height },
- Poster = (specification.preview and true) or false,
- }
- local controldict = pdfdictionary {
- ShowControls = (specification.controls and true) or false,
- Mode = (specification["repeat"] and pdfconstant("Repeat")) or nil,
- }
- local bs, bc = pdfborder()
- local action = pdfdictionary {
- Subtype = pdfconstant("Movie"),
- Border = bs,
- C = bc,
- T = format("movie %s",specification.label),
- Movie = moviedict,
- A = controldict,
- }
- write_node(nodeinjections.annotation(width,height,0,action())) -- test: context(...)
-end
-
-function nodeinjections.insertsound(specification)
- -- managed in interaction: repeat, label, foundname
- local soundclip = interactions.soundclips.soundclip(specification.label)
- if soundclip then
- local controldict = pdfdictionary {
- Mode = (specification["repeat"] and pdfconstant("Repeat")) or nil
- }
- local sounddict = pdfdictionary {
- F = soundclip.filename
- }
- local bs, bc = pdfborder()
- local action = pdfdictionary {
- Subtype = pdfconstant("Movie"),
- Border = bs,
- C = bc,
- T = format("sound %s",specification.label),
- Movie = sounddict,
- A = controldict,
- }
- write_node(nodeinjections.annotation(0,0,0,action())) -- test: context(...)
- end
-end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-pde.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-pde.lmt
index 7fb14ada262..68712d58d9d 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-pde.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-pde.lmt
@@ -80,13 +80,12 @@ local getversion = pdfe.getversion
local getbox = pdfe.getbox
local getstatus = pdfe.getstatus
local unencrypt = pdfe.unencrypt
-
local dictionarytotable = pdfe.dictionarytotable
local arraytotable = pdfe.arraytotable
local pagestotable = pdfe.pagestotable
local readwholestream = pdfe.readwholestream
-
local getfromreference = pdfe.getfromreference
+local getfromobject = pdfe.getfromobject
local report_epdf = logs.reporter("epdf")
@@ -121,6 +120,8 @@ encryptioncodes = allocate(swapped(encryptioncodes,encryptioncodes)
pdfe.objectcodes = objectcodes
pdfe.encryptioncodes = encryptioncodes
+-- lpdf_epdf.objectcodes = objectcodes
+
local null_object_code = objectcodes.null
local reference_object_code = objectcodes.reference
@@ -136,47 +137,6 @@ local dictionary_object_code = objectcodes.dictionary
local stream_object_code = objectcodes.stream
local reference_object_code = objectcodes.reference
-local checked_access
-local get_flagged -- from pdfe -> lpdf
-
-if lpdf.dictionary then
-
- -- we're in context
-
- local pdfdictionary = lpdf.dictionary
- local pdfarray = lpdf.array
- local pdfconstant = lpdf.constant
- local pdfstring = lpdf.string
- local pdfunicode = lpdf.unicode
-
- get_flagged = function(t,f,k)
- local tk = t[k] -- triggers resolve
- local fk = f[k]
- if not fk then
- return tk
- elseif fk == "name" then
- return pdfconstant(tk)
- elseif fk == "array" then
- return pdfarray(tk)
- elseif fk == "dictionary" then
- return pdfarray(tk)
- elseif fk == "rawtext" then
- return pdfstring(tk)
- elseif fk == "unicode" then
- return pdfunicode(tk)
- else
- return tk
- end
- end
-
-else
-
- get_flagged = function(t,f,k)
- return t[k]
- end
-
-end
-
-- We need to convert the string from utf16 although there is no way to
-- check if we have a regular string starting with a bom. So, we have
-- na dilemma here: a pdf doc encoded string can be invalid utf.
@@ -198,6 +158,13 @@ local some_reference
local some_string = lpdf.frombytes
+function lpdf_epdf.objecttype(object)
+ if type(object) == "table" then
+ local kind = object.__type__
+ return kind and objectcodes[kind]
+ end
+end
+
local function get_value(document,t,key)
if not key then
return
@@ -220,22 +187,131 @@ local function get_value(document,t,key)
elseif kind == dictionary_object_code then
return some_dictionary(value[2],document)
elseif kind == stream_object_code then
- return some_stream(value,document)
+ return some_stream(value,value[2],document) -- needs checking
elseif kind == reference_object_code then
return some_reference(value,document)
end
return value
end
+local checked_access
+local get_flagged -- from pdfe -> lpdf
+
+if lpdf.dictionary then
+
+ -- these are used in mtx-pdf.lua
+
+ local pdfdictionary = lpdf.dictionary
+ local pdfarray = lpdf.array
+ local pdfconstant = lpdf.constant
+ local pdfreference = lpdf.reference
+ local pdfliteral = lpdf.literal
+
+ local copy_array, copy_dictionary
+
+ local function copyobject(object,key,value)
+ if not value then
+ value = object.__raw__[key]
+ end
+ local t = type(value)
+ if t == "string" then
+ return pdfconstant(value)
+ elseif t ~= "table" then
+ return value
+ end
+ local kind = value[1]
+ if kind == name_object_code then
+ return pdfconstant(value[2])
+ elseif kind == string_object_code then
+ return pdfliteral(value[2],value[3])
+ elseif kind == array_object_code then
+ return copyarray(object[key])
+ elseif kind == dictionary_object_code then
+ return copydictionary(object[key])
+ elseif kind == null_object_code then
+ return pdfnull()
+ elseif kind == reference_object_code then
+ return pdfreference(value[3])
+ else
+ -- report("weird: %s", objecttypes[kind] or "?")
+ end
+ end
+
+ copyarray = function(object)
+ local target = pdfarray()
+ local source = object.__raw__
+ for i=1,#source do
+ target[i] = copyobject(object,i,source[i])
+ end
+ return target
+ end
+
+ copydictionary = function(object)
+ local target = pdfdictionary()
+ local source = object.__raw__
+ for key, value in sortedhash(source) do
+ target[key] = copyobject(object,key,value)
+ end
+ return target
+ end
+
+ get_flagged = function(t,f)
+ local kind = t.__type__
+ if kind == name_object_code then
+ return pdfconstant(f)
+ elseif kind == array_object_code then
+ return copyarray(t)
+ elseif kind == dictionary_object_code then
+ return copydictionary(t)
+ elseif kind == stream_object_code then
+ return copydictionary(t)
+ elseif kind == string_object_code then
+ return pdfunicode(f)
+ elseif kind == null_object_code then
+ return pdfnull()
+ elseif kind == reference_object_code then
+ return pdfreference(t[3])
+ else
+ return f
+ end
+ end
+
+ function lpdf_epdf.verboseobject(document,n)
+ if document and n then
+ local object = document.objects[n]
+ if object then
+ local t = { n .. " 0 obj" }
+ if lpdf.epdf.objecttype(object) == "stream" then
+ t[#t+1] = object("dictionary")()
+ t[#t+1] = "stream"
+ t[#t+1] = tostring(object(true))
+ t[#t+1] = "endstream"
+ else
+ t[#t+1] = tostring(object())
+ end
+ t[#t+1] = "endobj"
+ return concat(t,"\n")
+ end
+ end
+ end
+
+else
+
+ get_flagged = function(t,f)
+ return t[k] -- hm
+ end
+
+end
+
some_dictionary = function (d,document)
local f = dictionarytotable(d,true)
local t = setmetatable({ __raw__ = f, __type__ = dictionary_object_code }, {
- __index = function(t,k)
- return get_value(document,f,k)
- end,
- __call = function(t,k)
- return get_flagged(t,f,k)
- end,
+ __index = function(t,k)
+ return get_value(document,f,k)
+ end,
+ __call = function(t)
+ return get_flagged(t,f)
+ end,
} )
return t, "dictionary"
end
@@ -247,8 +323,8 @@ some_array = function (a,document)
__index = function(t,k)
return get_value(document,f,k)
end,
- __call = function(t,k)
- return get_flagged(t,f,k)
+ __call = function(t)
+ return get_flagged(t,f)
end,
__len = function(t,k)
return n
@@ -263,8 +339,10 @@ some_stream = function(s,d,document)
__index = function(t,k)
return get_value(document,f,k)
end,
- __call = function(t,raw)
- if raw == false then
+ __call = function(t,how)
+ if how == "dictionary" then
+ return get_flagged(t,f)
+ elseif how == false then
return readwholestream(s,false) -- original
else
return readwholestream(s,true) -- uncompressed
@@ -284,7 +362,10 @@ some_reference = function(r,document)
elseif kind == array_object_code then
cached = some_array(object,document)
elseif kind == stream_object_code then
+ -- optionally not cached
cached = some_stream(object,b,document)
+ elseif kind == string_object_code then
+ cached = some_string(object,document)
else
cached = { kind, object, b, c }
-- really cache this?
@@ -295,6 +376,20 @@ some_reference = function(r,document)
return cached
end
+local function some_object(document,n)
+ local kind, object, b, c = getfromobject(document.__data__,n)
+ if kind == dictionary_object_code then
+ return some_dictionary(object,document)
+ elseif kind == array_object_code then
+ return some_array(object,document)
+ elseif kind == stream_object_code then
+ return some_stream(object,b,document)
+ else
+ -- really cache this?
+ return { kind, object, b, c }
+ end
+end
+
local resolvers = { }
lpdf_epdf.resolvers = resolvers
@@ -422,7 +517,7 @@ function resolvers.pages(document)
__xrefs__[pagedata] = pagereference
__cache__[pagereference] = pagedata
else
- report_epdf("missing pagedata for page %i, case %i",pagenumber,1)
+ report_epdf("missing pagedata for page %i, case %i",pagenumber,1)
end
else
report_epdf("missing pagedata for page %i, case %i",pagenumber,2)
@@ -462,12 +557,14 @@ function lpdf_epdf.load(filename,userpassword,ownerpassword,fromstring)
__data__ = false
end
if __data__ then
+ local __cache__ = { }
+ local __xrefs__ = { }
document = {
filename = filename,
nofcopied = 0,
copied = { },
- __cache__ = { },
- __xrefs__ = { },
+ __cache__ = __cache__,
+ __xrefs__ = __xrefs__,
__fonts__ = { },
__copied__ = { },
__data__ = __data__,
@@ -481,6 +578,17 @@ function lpdf_epdf.load(filename,userpassword,ownerpassword,fromstring)
document.majorversion, document.minorversion = getversion(__data__)
--
document.nofpages = getnofpages(__data__)
+ -- we could also use cached but this proxy hides it
+ -- setmetatableindex(__cache__,function(t,objnum)
+ document.objects = setmetatableindex(function(t,objnum)
+ local cached = __cache__[objnum]
+ if not cached then
+ cached = some_object(document,objnum)
+ __cache__[objnum] = cached
+ __xrefs__[cached] = objnum
+ end
+ return cached
+ end)
else
document = false
end
@@ -841,17 +949,10 @@ if images then do
local pdfnull = lpdf.null
local pdfliteral = lpdf.literal
- local pdfreserveobject
- local shareobjectreference
- local pdfflushobject
- local pdfflushstreamobject
-
- updaters.register("backend.update.lpdf",function()
- pdfreserveobject = lpdf.reserveobject
- shareobjectreference = lpdf.shareobjectreference
- pdfflushobject = lpdf.flushobject
- pdfflushstreamobject = lpdf.flushstreamobject
- end)
+ local pdfreserveobject = lpdf.reserveobject
+ local shareobjectreference = lpdf.shareobjectreference
+ local pdfflushobject = lpdf.flushobject
+ local pdfflushstreamobject = lpdf.flushstreamobject
local report = logs.reporter("backend","xobjects")
@@ -989,6 +1090,7 @@ if images then do
copydictionary = function (xref,copied,object)
local target = pdfdictionary()
local source = object.__raw__
+ -- hm .. no need to sort here as we create a hash
-- for key, value in next, source do
for key, value in sortedhash(source) do
if plugins then
@@ -1182,11 +1284,11 @@ if images then do
end
lpdf_epdf.image = {
- open = openpdf,
- close = closepdf,
- new = newpdf,
- query = querypdf,
- copy = copypage,
+ open = openpdf,
+ close = closepdf,
+ new = newpdf,
+ query = querypdf,
+ copy = copypage,
}
-- lpdf.injectors.pdf = function(specification)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-ren.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-ren.lmt
index 3794250d9ea..ea34505fab9 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-ren.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-ren.lmt
@@ -14,11 +14,11 @@ local formatters = string.formatters
local settings_to_array = utilities.parsers.settings_to_array
local getrandom = utilities.randomizer.get
-local backends, lpdf, nodes, node = backends, lpdf, nodes, node
+local pdfbackend = backends.registered.pdf
+local nodeinjections = pdfbackend.nodeinjections
+local codeinjections = pdfbackend.codeinjections
+local registrations = pdfbackend.registrations
-local nodeinjections = backends.pdf.nodeinjections
-local codeinjections = backends.pdf.codeinjections
-local registrations = backends.pdf.registrations
local viewerlayers = attributes.viewerlayers
local references = structures.references
@@ -36,26 +36,22 @@ local v_reset = variables.reset
local v_auto = variables.auto
local v_random = variables.random
+local lpdf = lpdf
local pdfconstant = lpdf.constant
local pdfdictionary = lpdf.dictionary
local pdfarray = lpdf.array
local pdfreference = lpdf.reference
-
-local pdfflushobject
-local pdfreserveobject
-
-updaters.register("backend.update.lpdf",function()
- pdfflushobject = lpdf.flushobject
- pdfreserveobject = lpdf.reserveobject
-end)
-
+local pdfflushobject = lpdf.flushobject
+local pdfreserveobject = lpdf.reserveobject
local addtopageattributes = lpdf.addtopageattributes
local addtopageresources = lpdf.addtopageresources
local addtocatalog = lpdf.addtocatalog
local escaped = lpdf.escaped
+local nodes = nodes
local nuts = nodes.nuts
+
local copy_node = nuts.copy
local nodepool = nuts.pool
@@ -98,7 +94,8 @@ local pagelayers, pagelayersreference, cache = nil, nil, { }
local alphabetic = { }
local escapednames = table.setmetatableindex(function(t,k)
- local v = escaped(k)
+-- local v = escaped(k)
+ local v = escaped(k,true)
t[k] = v
return v
end)
@@ -155,7 +152,8 @@ local function useviewerlayer(name) -- move up so that we can use it as local
else
hidelayers[#hidelayers+1] = nr
end
- pagelayers[escapednames[tag]] = dr -- check
+ -- pagelayers[escapednames[tag]] = dr -- check
+ pagelayers[tag] = dr -- check
else
-- todo: message
end
@@ -245,7 +243,8 @@ function executers.togglelayer(arguments) return setlayer(pdf_toggle,arguments)
-- injection
-local f_bdc = formatters["/OC /%s BDC"]
+-- local f_bdc = formatters["/OC /%s BDC"]
+local f_bdc = formatters["/OC %s BDC"]
local s_emc = "EMC"
function codeinjections.startlayer(name) -- used in mp
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-res.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-res.lmt
deleted file mode 100644
index d3c591343fc..00000000000
--- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-res.lmt
+++ /dev/null
@@ -1,41 +0,0 @@
-if not modules then modules = { } end modules ['lpdf-res'] = {
- version = 1.001,
- comment = "companion to lpdf-ini.mkiv",
- author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
- copyright = "PRAGMA ADE / ConTeXt Development Team",
- license = "see context related readme files"
-}
-
-local codeinjections = backends.codeinjections
-
-local nuts = nodes.nuts
-local tonut = nodes.tonut
-
-local setwhd = nuts.setwhd
-local setlist = nuts.setlist
-
-local new_hlist = nuts.pool.hlist
-
-local boxresources = tex.boxresources
-local saveboxresource = boxresources.save
-local useboxresource = boxresources.use
-local getboxresourcedimensions = boxresources.getdimensions
-
-local pdfcollectedresources = lpdf.collectedresources
-
-function codeinjections.registerboxresource(n,offset)
- local r = saveboxresource(n,nil,pdfcollectedresources(),true,0,offset or 0) -- direct, todo: accept functions as attr/resources
- return r
-end
-
-function codeinjections.restoreboxresource(index)
- local hbox = new_hlist()
- local list, wd, ht, dp = useboxresource(index)
- setlist(hbox,tonut(list))
- setwhd(hbox,wd,ht,dp)
- return hbox -- so we return a nut !
-end
-
-function codeinjections.boxresourcedimensions(index)
- return getboxresourcedimensions(index)
-end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-rul.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-rul.lmt
index efcc6207372..4efa17bb0bc 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-rul.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-rul.lmt
@@ -6,8 +6,10 @@ if not modules then modules = { } end modules ['lpdf-rul'] = {
license = "see context related readme files"
}
-local tonumber, next, type = tonumber, next, type
-local concat = table.concat
+-- todo: split backend and pdf
+
+local tonumber, tostring, next, type = tonumber, tostring, next, type
+local concat, setmetatableindex = table.concat, table.setmetatableindex
local attributes = attributes
local nodes = nodes
@@ -31,12 +33,25 @@ local floor = math.floor
local getrandom = utilities.randomizer.get
local formatters = string.formatters
+local setdimen = tex.setdimen
+local isdimen = tex.isdimen
+local setmacro = tokens.setters.macro
+
+local codeinjections = backends.registered.pdf.codeinjections
+
+local d_rule_width = isdimen("d_rule_width")
+local d_rule_height = isdimen("d_rule_height")
+local d_rule_depth = isdimen("d_rule_depth")
+local d_rule_h = isdimen("d_rule_h")
+local d_rule_v = isdimen("d_rule_v")
+local d_rule_line = isdimen("d_rule_line")
+local d_rule_offset = isdimen("d_rule_offset")
+local d_rule_factor = isdimen("d_rule_factor")
+
-- This is very pdf specific. Maybe move some to lpdf-rul.lua some day.
local pdfprint ; pdfprint = function(...) pdfprint = lpdf.print return pdfprint(...) end
--- updaters.register("backend.update",function() pdfprint = lpdf.print end)
-
do
local simplemetapost = metapost.simple
@@ -48,7 +63,7 @@ do
-- local maxcachesize = 8*1024
-- local cachethreshold = 1024/2
- local cache = table.setmetatableindex(function(t,k)
+ local cache = setmetatableindex(function(t,k)
local v = simplemetapost("rulefun",k) -- w, h, d
cachesize = cachesize + #v
if cachesize > maxcachesize then
@@ -70,49 +85,82 @@ do
local replacer = utilities.templates.replacer
-- todo: RuleColor -> just string ?
-
- local predefined = {
+ -- todo: fetch them instead fo push them
+
+-- local predefined = {
+-- ["fake:word"] = replacer [[
+-- FakeWord(%width%,%height%,%depth%,%line%,%color%);
+-- ]],
+-- ["fake:rule"] = replacer[[
+-- %initializations%
+-- FakeRule(%width%,%height%,%depth%,%line%,%color%);
+-- ]],
+-- ["fake:rest"] = replacer [[
+-- RuleDirection := "%direction%" ;
+-- RuleOption := "%option%" ;
+-- RuleWidth := %width% ;
+-- RuleHeight := %height% ;
+-- RuleDepth := %depth% ;
+-- RuleH := %h% ;
+-- RuleV := %v% ;
+-- RuleThickness := %line% ;
+-- RuleFactor := %factor% ;
+-- RuleOffset := %offset% ;
+-- def RuleColor = %color% enddef ;
+-- %data%;
+-- ]]
+-- }
+
+ local predefined = {
["fake:word"] = replacer [[
-FakeWord(%width%,%height%,%depth%,%line%,%color%);
+FakeWord(RuleWidth,RuleHeight,RuleDepth,RuleThickness,RuleColor);
]],
["fake:rule"] = replacer[[
%initializations%
-FakeRule(%width%,%height%,%depth%,%line%,%color%);
+FakeRule(RuleWidth,RuleHeight,RuleDepth,RuleThickness,RuleColor);
]],
["fake:rest"] = replacer [[
-RuleDirection := "%direction%" ;
-RuleOption := "%option%" ;
-RuleWidth := %width% ;
-RuleHeight := %height% ;
-RuleDepth := %depth% ;
-RuleH := %h% ;
-RuleV := %v% ;
-RuleThickness := %line% ;
-RuleFactor := %factor% ;
-RuleOffset := %offset% ;
-def RuleColor = %color% enddef ;
%data%;
]]
}
local initialized = false ;
- local rule_mp = function(p,h,v,i,n)
- local name = p.name or "fake:rest"
- local code = (predefined[name] or predefined["fake:rest"]) {
+ local function rule_mp(p,h,v,i,n)
+ local name = p.name or "fake:rest"
+ local ht = p.height or 0
+ local dp = p.depth or 0
+ local total = ht + dp
+ local code = (predefined[name] or predefined["fake:rest"]) {
data = p.data or "",
- width = p.width * bpfactor,
- height = p.height * bpfactor,
- depth = p.depth * bpfactor,
- factor = (p.factor or 0) * bpfactor, -- needs checking
- offset = p.offset or 0,
- line = (p.line or 65536) * bpfactor,
- color = mpcolor(p.ma,p.ca,p.ta),
- option = p.option or "",
- direction = p.direction or lefttoright_code,
- h = h * bpfactor,
- v = v * bpfactor,
+ -- -- width = p.width * bpfactor,
+ -- -- height = p.height * bpfactor,
+ -- -- depth = p.depth * bpfactor,
+ -- width = h * bpfactor,
+ -- height = v * bpfactor * ht / total,
+ -- depth = v * bpfactor * dp / total,
+ -- factor = (p.factor or 0) * bpfactor, -- needs checking
+ -- offset = p.offset or 0,
+ -- line = (p.line or 65536) * bpfactor,
+ -- color = mpcolor(p.ma,p.ca,p.ta),
+ -- option = p.option or "",
+ -- direction = p.direction or lefttoright_code,
+ -- h = h * bpfactor,
+ -- v = v * bpfactor,
}
+ --
+ setdimen("d_rule_width", h)
+ setdimen("d_rule_height", v * ht / total)
+ setdimen("d_rule_depth", v * dp / total)
+ setdimen("d_rule_h", h)
+ setdimen("d_rule_v", v)
+ setdimen("d_rule_line", p.line or 65536)
+ setdimen("d_rule_offset", (p.offset or 0) * 65536)
+ setdimen("d_rule_factor", (p.factor or 0)) -- needs checking
+ setmacro("m_rule_option", p.option or "")
+ setmacro("m_rule_direction", p.direction or lefttoright_code)
+ setmacro("m_rule_color", mpcolor(p.ma,p.ca,p.ta))
+ --
if not initialized then
initialized = true
simplemetapost("rulefun",formatters["randomseed := %s;"](getrandom("rulefun",0,4095)))
@@ -129,9 +177,7 @@ def RuleColor = %color% enddef ;
end
end
- updaters.register("backend.update.lpdf",function()
- ruleactions.mp = rule_mp
- end)
+ codeinjections.ruleactionmp = rule_mp
end
@@ -141,195 +187,241 @@ do
-- course one can use mp instead. It could be improved but at the cost of more
-- code than I'm willing to add for something hardly used.
- local function round(p,kind)
- local method = tonumber(p.corner) or 0
- if method < 0 or method > 27 then
- method = 0
+ local linemapping = {
+ [interfaces.variables.round] = "ltrb",
+ [ "0"] = "ltrb", ["ltrb"] = "ltrb", ["trbl"] = "ltrb", ["rblt"] = "ltrb", ["bltr"] = "ltrb",
+ --
+ ["1"] = "ltrb", ["2"] = "ltrb", ["3"] = "ltrb", ["4"] = "ltrb",
+ ["5"] = "ltrb", ["6"] = "ltrb", ["7"] = "ltrb", ["8"] = "ltrb",
+ --
+ [ "9"] = "lbr", ["lbr"] = "lbr", ["rbl"] = "lbr",
+ ["10"] = "tlb", ["tlb"] = "tlb", ["blt"] = "tlb",
+ ["11"] = "ltr", ["ltr"] = "ltr", ["rtl"] = "lrt",
+ ["12"] = "lbr", ["lbr"] = "lbr", ["rbl"] = "lbr",
+ --
+ ["13"] = "rt", ["rt"] = "rt", ["tr"] = "rt",
+ ["14"] = "rb", ["rb"] = "rb", ["br"] = "rb",
+ ["15"] = "bl", ["bl"] = "bl", ["lb"] = "bl",
+ ["16"] = "tl", ["tl"] = "tl", ["lt"] = "tl",
+ --
+ ["32"] = "lr", ["lr"] = "lr", ["rl"] = "lr",
+ ["33"] = "tb", ["tb"] = "tb", ["bt"] = "tb",
+ --
+ ["28"] = "l", ["l"] = "l",
+ ["29"] = "r", ["r"] = "r",
+ ["30"] = "b", ["b"] = "b",
+ ["31"] = "t", ["t"] = "t",
+ }
+
+ local roundmapping = {
+ [interfaces.variables.round] = "ltrb",
+ [ "0"] = "ltrb", ["ltrb"] = "ltrb", ["trbl"] = "ltrb", ["rblt"] = "ltrb", ["bltr"] = "ltrb",
+ --
+ [ "9"] = "lbr", ["lbr"] = "lbr", ["rbl"] = "lbr",
+ ["10"] = "tlb", ["tlb"] = "tlb", ["blt"] = "tlb",
+ ["11"] = "ltr", ["ltr"] = "ltr", ["rtl"] = "lrt",
+ ["12"] = "lbr", ["lbr"] = "lbr", ["rbl"] = "lbr",
+ --
+ ["13"] = "rt", ["rt"] = "rt", ["tr"] = "rt",
+ ["14"] = "rb", ["rb"] = "rb", ["br"] = "rb",
+ ["15"] = "bl", ["bl"] = "bl", ["lb"] = "bl",
+ ["16"] = "tl", ["tl"] = "tl", ["lt"] = "tl",
+ --
+ ["32"] = "lr", ["lr"] = "lr", ["rl"] = "lr",
+ ["33"] = "tb", ["tb"] = "tb", ["bt"] = "tb",
+ --
+ ["28"] = "l", ["l"] = "l",
+ ["29"] = "r", ["r"] = "r",
+ ["30"] = "b", ["b"] = "b",
+ ["31"] = "t", ["t"] = "t",
+ }
+
+ setmetatableindex(linemapping,function(t,k)
+ local v = tonumber(k)
+ if v then
+ v = tostring(v)
+ else
+ v = "ltrb"
+ end
+ t[k] = v
+ return v
+ end)
+
+ setmetatableindex(roundmapping,function(t,k)
+ local v = tonumber(k)
+ if v then
+ v = tostring(v)
+ else
+ v = "ltrb"
end
+ t[k] = v
+ return v
+ end)
+
+ local function round(p,kind,corner)
local width = p.width or 0
local height = p.height or 0
local depth = p.depth or 0
- local total = height + depth
local radius = p.radius or 655360
- local line = p.line or 65536
- local how = (method > 8 or kind ~= "fill") and "S" or "f"
+ local line = (p.line or 65536) * bpfactor
local half = line / 2
- local xmin = half * bpfactor
- local xmax = ( width - half) * bpfactor
- local ymax = ( height - half) * bpfactor
- local ymin = (-depth + half) * bpfactor
- local full = ( radius + half)
- local xxmin = full * bpfactor
- local xxmax = ( width - full) * bpfactor
- local yymax = ( height - full) * bpfactor
- local yymin = (-depth + full) * bpfactor
- line = line * bpfactor
- if xxmin <= xxmax and yymin <= yymax then
- local list = nil
- if method == 0 then
- list = {
- "q", line, "w", xxmin, ymin, "m", xxmax, ymin, "l", xmax, ymin, xmax, yymin, "y",
- xmax, yymax, "l", xmax, ymax, xxmax, ymax, "y", xxmin, ymax, "l", xmin, ymax,
- xmin, yymax, "y", xmin, yymin, "l", xmin, ymin, xxmin, ymin, "y", "h", how, "Q",
- }
- elseif method == 1 then
+ local xxmin = 0
+ local xxmax = width * bpfactor
+ local yymax = height * bpfactor
+ local yymin = -depth * bpfactor
+ local xmin = xxmin + half
+ local xmax = xxmax - half
+ local ymax = yymax - half
+ local ymin = yymin + half
+ local list = nil
+ if radius == 0 then
+ local method = linemapping[corner]
+ if method == "ltrb" then
list = {
- "q", line, "w", xxmin, ymin, "m", xxmax, ymin, "l", xmax, ymin, xmax, yymin, "y",
- xmax, ymax, "l", xmin, ymax, "l", xmin, yymin, "l", xmin, ymin, xxmin, ymin, "y",
- "h", how, "Q",
+ "q", line, "w", xmin, ymin, "m", xmax, ymin, "l", xmax, ymax, "l", xmin, ymax,
+ kind == "fill" and "l h f Q" or "l h S Q"
}
- elseif method == 2 then
- list = {
- "q", line, "w", xxmin, ymin, "m", xmax, ymin, "l", xmax, ymax, "l", xxmin, ymax,
- "l", xmin, ymax, xmin, yymax, "y", xmin, yymin, "l", xmin, ymin, xxmin, ymin,
- "y", "h", how, "Q",
- }
- elseif method == 3 then
- list = {
- "q", line, "w", xmin, ymin, "m", xmax, ymin, "l", xmax, yymax, "l", xmax, ymax,
- xxmax, ymax, "y", xxmin, ymax, "l", xmin, ymax, xmin, yymax, "y", xmin, ymin,
- "l", "h", how, "Q",
- }
-
- elseif method == 4 then
- list = {
- "q", line, "w", xmin, ymin, "m", xxmax, ymin, "l", xmax, ymin, xmax, yymin, "y",
- xmax, yymax, "l", xmax, ymax, xxmax, ymax, "y", xmin, ymax, "l", xmin, ymin, "l",
- "h", how, "Q",
- }
- elseif method == 5 then
- list = {
- "q", line, "w", xmin, ymin, "m", xmax, ymin, "l", xmax, yymax, "l", xmax, ymax,
- xxmax, ymax, "y", xmin, ymax, "l", xmin, ymin, "l", "h", how, "Q",
- }
- elseif method == 6 then
- list = {
- "q", line, "w", xmin, ymin, "m", xxmax, ymin, "l", xmax, ymin, xmax, yymin, "y",
- xmax, ymax, "l", xmin, ymax, "l", xmin, ymin, "l", "h", how, "Q",
- }
- elseif method == 7 then
- list = {
- "q", line, "w", xxmin, ymin, "m", xmax, ymin, "l", xmax, ymax, "l", xmin, ymax,
- "l", xmin, yymin, "l", xmin, ymin, xxmin, ymin, "y", "h", how, "Q",
- }
- elseif method == 8 then
- list = {
- "q", line, "w", xmin, ymin, "m", xmax, ymin, "l", xmax, ymax, "l", xxmin, ymax,
- "l", xmin, ymax, xmin, yymax, "y", xmin, ymin, "l", "h", how, "Q",
- }
- elseif method == 9 then
- list = {
- "q", line, "w", xmin, ymax, "m", xmin, yymin, "l", xmin, ymin, xxmin, ymin, "y",
- xxmax, ymin, "l", xmax, ymin, xmax, yymin, "y", xmax, ymax, "l", how, "Q",
- }
- elseif method == 10 then
- list = {
- "q", line, "w", xmax, ymax, "m", xxmin, ymax, "l", xmin, ymax, xmin, yymax, "y",
- xmin, yymin, "l", xmin, ymin, xxmin, ymin, "y", xmax, ymin, "l", how, "Q",
- }
- elseif method == 11 then
- list = {
- "q", line, "w", xmax, ymin, "m", xmax, yymax, "l", xmax, ymax, xxmax, ymax, "y",
- xxmin, ymax, "l", xmin, ymax, xmin, yymax, "y", xmin, ymin, "l", how, "Q",
- }
- elseif method == 12 then
- list = {
- "q", line, "w", xmin, ymax, "m", xxmax, ymax, "l", xmax, ymax, xmax, yymax, "y",
- xmax, yymin, "l", xmax, ymin, xxmax, ymin, "y", xmin, ymin, "l", how, "Q",
- }
- elseif method == 13 then
- list = {
- "q", line, "w", xmin, ymax, "m", xxmax, ymax, "l", xmax, ymax, xmax, yymax, "y",
- xmax, ymin, "l", how, "Q",
- }
- elseif method == 14 then
- list = {
- "q", line, "w", xmax, ymax, "m", xmax, yymin, "l", xmax, ymin, xxmax, ymin, "y",
- xmin, ymin, "l", how, "Q",
- }
- elseif method == 15 then
- list = {
- "q", line, "w", xmax, ymin, "m", xxmin, ymin, "l", xmin, ymin, xmin, yymin, "y",
- xmin, ymax, "l", how, "Q",
- }
- elseif method == 16 then
- list = {
- "q", line, "w", xmin, ymin, "m", xmin, yymax, "l", xmin, ymax, xxmin, ymax, "y",
- xmax, ymax, "l", how, "Q",
- }
- elseif method == 17 then
- list = {
- "q", line, "w", xxmax, ymax, "m", xmax, ymax, xmax, yymax, "y", how, "Q",
- }
- elseif method == 18 then
- list = {
- "q", line, "w", xmax, yymin, "m", xmax, ymin, xxmax, ymin, "y", how, "Q",
- }
- elseif method == 19 then
- list = {
- "q", line, "w", xxmin, ymin, "m", xmin, ymin, xmin, yymin, "y", how, "Q",
- }
- elseif method == 20 then
- list = {
- "q", line, "w", xmin, yymax, "m", xmin, ymax, xxmin, ymax, "y", how, "Q",
- }
- elseif method == 21 then
- list = {
- "q", line, "w", xxmax, ymax, "m", xmax, ymax, xmax, yymax, "y", xmin, yymax, "m",
- xmin, ymax, xxmin, ymax, "y", how, "Q",
- }
- elseif method == 22 then
- list = {
- "q", line, "w", xxmax, ymax, "m", xmax, ymax, xmax, yymax, "y", xmax, yymin, "m",
- xmax, ymin, xxmax, ymin, "y", how, "Q",
- }
- elseif method == 23 then
- list = {
- "q", line, "w", xmax, yymin, "m", xmax, ymin, xxmax, ymin, "y", xxmin, ymin, "m",
- xmin, ymin, xmin, yymin, "y", how, "Q",
- }
- elseif method == 24 then
- list = {
- "q", line, "w", xxmin, ymin, "m", xmin, ymin, xmin, yymin, "y", xmin, yymax, "m",
- xmin, ymax, xxmin, ymax, "y", how, "Q",
- }
- elseif method == 25 then
- list = {
- "q", line, "w", xxmax, ymax, "m", xmax, ymax, xmax, yymax, "y", xmax, yymin, "m",
- xmax, ymin, xxmax, ymin, "y", xxmin, ymin, "m", xmin, ymin, xmin, yymin, "y",
- xmin, yymax, "m", xmin, ymax, xxmin, ymax, "y", how, "Q",
- }
- elseif method == 26 then
+ elseif method == "l" then
+ list = { "q", line, "w", xmin, yymin, "m", xmin, yymax, "l S Q" }
+ elseif method == "r" then
+ list = { "q", line, "w", xmax, yymin, "m", xmax, yymax, "l S Q" }
+ elseif method == "b" then
+ list = { "q", line, "w", xxmin, ymin, "m", xxmax, ymin, "l S Q" }
+ elseif method == "t" then
+ list = { "q", line, "w", xxmin, ymax, "m", xxmax, ymax, "l S Q" }
+ elseif method == "lr" then
+ list = { "q", line, "w", xmin, yymin, "m", xmin, yymax, "l", xmax, yymin, "m", xmax, yymax, "l S Q" }
+ elseif method == "tb" then
+ list = { "q", line, "w", xxmin, ymin, "m", xxmax, ymin, "l", xxmin, ymax, "m", xxmax, ymax, "l S Q" }
+ elseif method == "lbr" then
+ list = { "q", line, "w", xmin, yymax, "m", xmin, ymin, "l", xmax, ymin, "l", xmax, yymax, "l S Q" }
+ elseif method == "tlb" then
+ list = { "q", line, "w", xxmax, ymax, "m", xmin, ymax, "l", xmin, ymin, "l", xxmax, ymin, "l S Q" }
+ elseif method == "ltr" then
+ list = { "q", line, "w", xmin, yymin, "m", xmin, ymax, "l", xmax, ymax, "l", xmax, yymin, "l S Q" }
+ elseif method == "lbr" then
+ list = { "q", line, "w", xxmin, ymax, "m", xmax, ymax, "l", xmax, ymin, "l", xxmin, ymin, "l S Q" }
+ elseif method == "rt" then
+ list = { "q", line, "w", xxmin, ymax, "m", xmax, ymax, "l", xmax, yymin, "l S Q" }
+ elseif method == "rb" then
+ list = { "q", line, "w", xmax, yymax, "m", xmax, ymin, "l", xxmin, ymin, "l S Q" }
+ elseif method == "bl" then
+ list = { "q", line, "w", xxmax, ymin, "m", xmin, ymin, "l", xmin, yymax, "l S Q" }
+ elseif method == "tl" then
+ list = { "q", line, "w", xmin, yymin, "m", xmin, ymax, "l", xxmax, ymax, "l S Q" }
+ else
+ return
+ end
+ else
+ local method = roundmapping[corner]
+ local done = kind ~= "fill" and "h S Q" or "h f Q" -- todo
+ local full = ( radius + half)
+ local xxxmin = full * bpfactor
+ local xxxmax = ( width - full) * bpfactor
+ local yyymax = ( height - full) * bpfactor
+ local yyymin = (-depth + full) * bpfactor
+ if xxxmin > xxxmax or yyymin > yyymax then
+ return
+ elseif method == "ltrb" then
list = {
- "q", line, "w", xmax, yymin, "m", xmax, ymin, xxmax, ymin, "y", xmin, yymax, "m",
- xmin, ymax, xxmin, ymax, "y", how, "Q",
+ "q", line, "w", xxxmin, ymin, "m", xxxmax, ymin, "l", xmax, ymin, xmax, yyymin, "y", xmax, yyymax, "l", xmax, ymax, xxxmax, ymax, "y",
+ xxxmin, ymax, "l", xmin, ymax, xmin, yyymax, "y", xmin, yyymin, "l", xmin, ymin, xxxmin, ymin, "y", done,
}
-
- elseif method == 27 then
+ elseif method == "1" then -- ll lr
+ list = { "q", line, "w", xxxmin, ymin, "m", xxxmax, ymin, "l", xmax, ymin, xmax, yyymin, "y", xmax, ymax, "l", xmin, ymax, "l", xmin, yyymin, "l", xmin, ymin, xxxmin, ymin, "y", done }
+ elseif method == "2" then -- ll ul
+ list = { "q", line, "w", xxxmin, ymin, "m", xmax, ymin, "l", xmax, ymax, "l", xxxmin, ymax, "l", xmin, ymax, xmin, yyymax, "y", xmin, yyymin, "l", xmin, ymin, xxxmin, ymin, "y", done }
+ elseif method == "3" then -- ul ur
+ list = { "q", line, "w", xmin, ymin, "m", xmax, ymin, "l", xmax, yyymax, "l", xmax, ymax, xxxmax, ymax, "y", xxxmin, ymax, "l", xmin, ymax, xmin, yyymax, "y", xmin, ymin, "l", done }
+ elseif method == "4" then -- ur lr
+ list = { "q", line, "w", xmin, ymin, "m", xxxmax, ymin, "l", xmax, ymin, xmax, yyymin, "y", xmax, yyymax, "l", xmax, ymax, xxxmax, ymax, "y", xmin, ymax, "l", xmin, ymin, "l", done }
+ elseif method == "5" then -- ur
+ list = { "q", line, "w", xmin, ymin, "m", xmax, ymin, "l", xmax, yyymax, "l", xmax, ymax, xxxmax, ymax, "y", xmin, ymax, "l", xmin, ymin, "l", done }
+ elseif method == "6" then -- lr
+ list = { "q", line, "w", xmin, ymin, "m", xxxmax, ymin, "l", xmax, ymin, xmax, yyymin, "y", xmax, ymax, "l", xmin, ymax, "l", xmin, ymin, "l", done }
+ elseif method == "7" then -- ur
+ list = { "q", line, "w", xxxmin, ymin, "m", xmax, ymin, "l", xmax, ymax, "l", xmin, ymax, "l", xmin, yyymin, "l", xmin, ymin, xxxmin, ymin, "y", done } -- outlier
+ elseif method == "8" then -- ul
+ list = { "q", line, "w", xmin, ymin, "m", xmax, ymin, "l", xmax, ymax, "l", xxxmin, ymax, "l", xmin, ymax, xmin, yyymax, "y", xmin, ymin, "l", done }
+ elseif method == "lbr" then
+ list = { "q", line, "w", xmin, yymax, "m", xmin, yyymin, "l", xmin, ymin, xxxmin, ymin, "y", xxxmax, ymin, "l", xmax, ymin, xmax, yyymin, "y", xmax, yymax, "l S Q" }
+ elseif method == "tlb" then
+ list = { "q", line, "w", xxmax, ymax, "m", xxxmin, ymax, "l", xmin, ymax, xmin, yyymax, "y", xmin, yyymin, "l", xmin, ymin, xxxmin, ymin, "y", xxmax, ymin, "l S Q" }
+ elseif method == "ltr" then
+ list = { "q", line, "w", xmax, yymin, "m", xmax, yyymax, "l", xmax, ymax, xxxmax, ymax, "y", xxxmin, ymax, "l", xmin, ymax, xmin, yyymax, "y", xmin, yymin, "l S Q" }
+ elseif method == "lbr" then
+ list = { "q", line, "w", xxmin, ymax, "m", xxxmax, ymax, "l", xmax, ymax, xmax, yyymax, "y", xmax, yyymin, "l", xmax, ymin, xxxmax, ymin, "y", xxmin, ymin, "l S Q" }
+ elseif method == "lr" then
+ list = { "q", line, "w", xxxmin, ymin, "m", xmin, ymin, xmin, yyymin, "y", xmin, yyymax, "l", xmin, ymax, xxxmin, ymax, "y",
+ xxxmax, ymax, "m", xmax, ymax, xmax, yyymax, "y", xmax, yyymin, "l", xmax, ymin, xxxmax, ymin, "y S Q" }
+ elseif method == "tb" then
+ list = { "q", line, "w", xmax, yyymin, "m", xmax, ymin, xxxmax, ymin, "y", xxxmin, ymin, "l", xmin, ymin, xmin, yyymin, "y",
+ xmax, yyymax, "m", xmax, ymax, xxxmax, ymax, "y", xxxmin, ymax, "l", xmin, ymax, xmin, yyymax, "y S Q" }
+ elseif method == "rt" then
+ list = { "q", line, "w", xxmin, ymax, "m", xxxmax, ymax, "l", xmax, ymax, xmax, yyymax, "y", xmax, yymin, "l S Q" }
+ elseif method == "rb" then
+ list = { "q", line, "w", xmax, yymax, "m", xmax, yyymin, "l", xmax, ymin, xxxmax, ymin, "y", xxmin, ymin, "l S Q" }
+ elseif method == "bl" then
+ list = { "q", line, "w", xxmax, ymin, "m", xxxmin, ymin, "l", xmin, ymin, xmin, yyymin, "y", xmin, yymax, "l S Q" }
+ elseif method == "tl" then
+ list = { "q", line, "w", xmin, yymin, "m", xmin, yyymax, "l", xmin, ymax, xxxmin, ymax, "y", xxmax, ymax, "l S Q" }
+ elseif method == "17" then -- urx
+ list = { "q", line, "w", xxxmax, ymax, "m", xmax, ymax, xmax, yyymax, "y S Q" }
+ elseif method == "18" then -- lrt
+ list = { "q", line, "w", xmax, yyymin, "m", xmax, ymin, xxxmax, ymin, "y S Q" }
+ elseif method == "19" then -- llx
+ list = { "q", line, "w", xxxmin, ymin, "m", xmin, ymin, xmin, yyymin, "y S Q" }
+ elseif method == "20" then -- urx
+ list = { "q", line, "w", xmin, yyymax, "m", xmin, ymax, xxxmin, ymax, "y S Q" }
+ elseif method == "21" then -- ulx urx
+ list = { "q", line, "w", xmax, yyymax, "m", xmax, ymax, xxxmax, ymax, "y", xxxmin, ymax, "m", xmin, ymax, xmin, yyymax, "y S Q" }
+ elseif method == "22" then -- urt lrt
+ list = { "q", line, "w", xxxmax, ymax, "m", xmax, ymax, xmax, yyymax, "y", xmax, yyymin, "m", xmax, ymin, xxxmax, ymin, "y S Q" }
+ elseif method == "23" then -- llx lrx
+ list = { "q", line, "w", xmax, yyymin, "m", xmax, ymin, xxxmax, ymin, "y", xxxmin, ymin, "m", xmin, ymin, xmin, yyymin, "y S Q" }
+ elseif method == "24" then -- ulx llx
+ list = { "q", line, "w", xxxmin, ymin, "m", xmin, ymin, xmin, yyymin, "y", xmin, yyymax, "m", xmin, ymax, xxxmin, ymax, "y S Q" }
+ elseif method == "25" then -- llx lrx urx ulx
list = {
- "q", line, "w", xxmax, ymax, "m", xmax, ymax, xmax, yymax, "y", xxmin, ymin, "m",
- xmin, ymin, xmin, yymin, "y", how, "Q",
+ "q", line, "w", xxxmax, ymax, "m", xmax, ymax, xmax, yyymax, "y", xmax, yyymin, "m", xmax, ymin, xxxmax, ymin, "y", xxxmin, ymin, "m",
+ xmin, ymin, xmin, yyymin, "y", xmin, yyymax, "m", xmin, ymax, xxxmin, ymax, "y S Q",
}
+ elseif method == "26" then
+ list = { "q", line, "w", xmax, yyymin, "m", xmax, ymin, xxxmax, ymin, "y", xmin, yyymax, "m", xmin, ymax, xxxmin, ymax, "y S Q" }
+ elseif method == "27" then
+ list = { "q", line, "w", xxxmax, ymax, "m", xmax, ymax, xmax, yyymax, "y", xxxmin, ymin, "m", xmin, ymin, xmin, yyymin, "y S Q" }
+ elseif method == "l" then
+ list = { "q", line, "w", xxxmin, ymin, "m", xmin, ymin, xmin, yyymin, "y", xmin, yyymax, "l", xmin, ymax, xxxmin, ymax, "y S Q" }
+ elseif method == "r" then
+ list = { "q", line, "w", xxxmax, ymax, "m", xmax, ymax, xmax, yyymax, "y", xmax, yyymin, "l", xmax, ymin, xxxmax, ymin, "y S Q" }
+ elseif method == "b" then
+ list = { "q", line, "w", xmax, yyymin, "m", xmax, ymin, xxxmax, ymin, "y", xxxmin, ymin, "l", xmin, ymin, xmin, yyymin, "y S Q" }
+ elseif method == "t" then
+ list = { "q", line, "w", xmax, yyymax, "m", xmax, ymax, xxxmax, ymax, "y", xxxmin, ymax, "l", xmin, ymax, xmin, yyymax, "y S Q" }
+ else
+ return
end
- pdfprint("direct",concat(list," "))
end
+ pdfprint("direct",concat(list," "))
end
- local f_rectangle = formatters["%.6N w %.6N %.6N %.6N %.6N re %s"]
- local f_baselined = formatters["%.6N w %.6N %.6N %.6N %.6N re s %.6N %.6N m %.6N %.6N l s"]
- local f_dashlined = formatters["%.6N w %.6N %.6N %.6N %.6N re s [%.6N %.6N] 2 d %.6N %.6N m %.6N %.6N l s"]
+ local f_rectangle = formatters["q %.6N w %.6N %.6N %.6N %.6N re %s Q"]
+ local f_baselined = formatters["q %.6N w %.6N %.6N %.6N %.6N re s %.6N %.6N m %.6N %.6N l s Q"]
+ local f_dashlined = formatters["q %.6N w %.6N %.6N %.6N %.6N re s [%.6N %.6N] 2 d %.6N %.6N m %.6N %.6N l s Q"]
+ local f_dashtwice = formatters["q %.6N w %.6N %.6N %.6N %.6N re s [%.6N %.6N] 2 d %.6N %.6N m %.6N %.6N l s %.6N %.6N m %.6N %.6N l s Q"]
local f_radtangle = formatters[
-[[%.6N w %.6N %.6N m
+[[q %.6N w %.6N %.6N m
%.6N %.6N l %.6N %.6N %.6N %.6N y
%.6N %.6N l %.6N %.6N %.6N %.6N y
%.6N %.6N l %.6N %.6N %.6N %.6N y
%.6N %.6N l %.6N %.6N %.6N %.6N y
-h %s]]
+h %s Q]]
]
local rule_any = function(p,h,v,i,n)
- if p.corner then
- return round(p,i)
+ local corner = p.corner
+ if corner then
+ return round(p,i,corner)
else
local l = (p.line or 65536)*bpfactor
local r = p and (p.radius or 0)*bpfactor or 0
@@ -359,30 +451,30 @@ h %s]]
local h = h * bpfactor
local d = d * bpfactor
local o = l / 2
- if (d >= 0 and h >= 0) or (d <= 0 and h <= 0) then
+ local u = p.double
+ if p.baseline ~= false and ((d >= 0 and h >= 0) or (d <= 0 and h <= 0)) then
local dashed = tonumber(p.dashed)
if dashed and dashed > 5*line then
dashed = dashed * bpfactor
local delta = (w - 2*dashed*floor(w/(2*dashed)))/2
- pdfprint("direct",f_dashlined(l,o,o,w-l,h+d-l,dashed,dashed,delta,d,w-delta,d))
+ if u then
+ u = u * bpfactor
+ pdfprint("direct",f_dashtwice(l,o,o,w-l,h+d-l,dashed,dashed,delta,d,w-delta,d,delta,d+u,w-delta,d+u))
+ else
+ pdfprint("direct",f_dashlined(l,o,o,w-l,h+d-l,dashed,dashed,delta,d,w-delta,d))
+ end
else
pdfprint("direct",f_baselined(l,o,o,w-l,h+d-l,0,d,w,d))
end
else
- pdfprint("direct",f_rectangle(l,o,o,w-l,h+d-l))
+ pdfprint("direct",f_rectangle(l,o,o,w-l,h+d-l,"s"))
end
end
- updaters.register("backend.update.lpdf",function()
- ruleactions.fill = rule_any
- ruleactions.draw = rule_any
- ruleactions.stroke = rule_any
- ruleactions.box = rule_box
- end)
+ codeinjections.ruleactionfill = rule_any
+ codeinjections.ruleactiondraw = rule_any
+ codeinjections.ruleactionstroke = rule_any
+ codeinjections.ruleactionbox = rule_box
end
-
- ruleactions.mp = unsupported
-
-
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-tag.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-tag.lmt
index 44a84ea59bb..f6a881208f3 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-tag.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-tag.lmt
@@ -18,16 +18,14 @@ local trace_info = false trackers.register("structures.tags.info", function(v)
local report_tags = logs.reporter("backend","tags")
-local backends = backends
-local lpdf = lpdf
-local nodes = nodes
-
-local nodeinjections = backends.pdf.nodeinjections
-local codeinjections = backends.pdf.codeinjections
+local pdfbackend = backends.registered.pdf
+local nodeinjections = pdfbackend.nodeinjections
+local codeinjections = pdfbackend.codeinjections
local enableaction = nodes.tasks.enableaction
local disableaction = nodes.tasks.disableaction
+local lpdf = lpdf
local pdfdictionary = lpdf.dictionary
local pdfarray = lpdf.array
local pdfboolean = lpdf.boolean
@@ -39,18 +37,13 @@ local pdfmakenametree = lpdf.makenametree
local addtocatalog = lpdf.addtocatalog
local addtopageattributes = lpdf.addtopageattributes
-local pdfflushobject
-local pdfreserveobject
-local pdfpagereference
-
-updaters.register("backend.update.lpdf",function()
- pdfflushobject = lpdf.flushobject
- pdfreserveobject = lpdf.reserveobject
- pdfpagereference = lpdf.pagereference
-end)
+local pdfflushobject = lpdf.flushobject
+local pdfreserveobject = lpdf.reserveobject
+local pdfpagereference = lpdf.pagereference
local texgetcount = tex.getcount
+local nodes = nodes
local nodecodes = nodes.nodecodes
local hlist_code = nodecodes.hlist
@@ -87,6 +80,8 @@ local parent_ref -- delayed
local root -- delayed
local names = { }
local tree = { }
+local firstintree = false
+local lastintree = false
local elements = { }
local structurestags = structures.tags
@@ -139,24 +134,59 @@ end
-- mostly the same as the annotations tree
+local usenamespace = false experiments.register("structures.tags.namespaces", function(v) usenamespace = v end)
+
+local namespaceurls = {
+ mathml = "http://www.w3.org/1998/Math/MathML",
+}
+
local function finishstructure()
if root and #structure_kids > 0 then
local nums = pdfarray()
local n = 0
- for i=1,#tree do
- n = n + 1 ; nums[n] = i - 1
- n = n + 1 ; nums[n] = pdfreference(pdfflushobject(tree[i]))
+ for i=firstintree,lastintree do
+ local ti = tree[i]
+ if ti then
+ n = n + 1 ; nums[n] = i - 1
+ n = n + 1 ; nums[n] = pdfreference(pdfflushobject(ti))
+ else
+ report_tags("beware: missing page %i in tree", i)
+ end
end
local parenttree = pdfdictionary {
Nums = nums
}
local idtree = pdfmakenametree(names)
--
- local rolemap = pdfdictionary()
+ local rolemaps = usenamespace and { }
+ local rolemap = pdfdictionary() -- main one
for k, v in next, usedmapping do
k = usedlabels[k] or k
local p = properties[k]
- rolemap[k] = pdfconstant(p and p.pdf or "Span") -- or "Div"
+ if not p then
+ print("UNDEFINED", k)
+ end
+ local n = p and p.namespace
+ if rolemaps and n then
+ local r = rolemaps[n]
+ if not r then
+ r = pdfdictionary()
+ rolemaps[n] = r
+ end
+ r[k] = pdfconstant(k) -- maybe other tag
+ else
+ rolemap[k] = pdfconstant(p and p.pdf or "Span") -- or "Div"
+ end
+ end
+ local namespaces = rolemaps and next(rolemaps) and pdfarray { } or nil
+ if namespaces then
+ for k, v in table.sortedhash(rolemaps) do
+ namespaces[#namespaces+1] = pdfdictionary {
+ Type = pdfconstant("Namespace"),
+ NS = pdfunicode(namespaceurls[k] or k),
+ RoleMapNS = v,
+ }
+ end
end
local structuretree = pdfdictionary {
Type = pdfconstant("StructTreeRoot"),
@@ -164,6 +194,7 @@ local function finishstructure()
ParentTree = pdfreference(pdfflushobject(parent_ref,parenttree)),
IDTree = idtree,
RoleMap = rolemap, -- sorted ?
+ Namespaces = namespaces,
}
pdfflushobject(structure_ref,structuretree)
addtocatalog("StructTreeRoot",pdfreference(structure_ref))
@@ -179,7 +210,20 @@ local function finishstructure()
end
--
for fulltag, element in sortedhash(elements) do -- sorting is easier on comparing pdf
- pdfflushobject(element.knum,element.kids)
+ local kids = element.kids
+ -- if element.tag == "link" then
+ -- local d = kids[2]
+ -- if type(d) == "table" then
+ -- local refatt = element.refatt
+ -- if refatt then
+ -- local refobj = codeinjections.getrefobj(refatt)
+ -- if refobj then
+ -- d.Obj = pdfreference(refobj)
+ -- end
+ -- end
+ -- end
+ -- end
+ pdfflushobject(element.knum,kids)
end
end
end
@@ -191,12 +235,26 @@ local index, pageref, pagenum, list = 0, nil, 0, nil
local pdf_mcr = pdfconstant("MCR")
local pdf_struct_element = pdfconstant("StructElem")
local pdf_s = pdfconstant("S")
+local pdf_objr = pdfconstant("OBJR")
local function initializepage()
index = 0
pagenum = texgetcount("realpageno")
pageref = pdfreference(pdfpagereference(pagenum))
list = pdfarray()
+ -- hm, can be later than 1
+ if not firstintree then
+ if pagenum > 1 then
+ report_tags("beware: first page in tree is %i", pagenum)
+ end
+ firstintree = pagenum
+ lastintree = pagenum
+ end
+ if pagenum > lastintree then
+ lastintree = pagenum
+ else
+ -- report_tags("beware: page order problem in tree at page %i", pagenum)
+ end
tree[pagenum] = list -- we can flush after done, todo
end
@@ -237,7 +295,7 @@ local function makeelement(fulltag,parent)
local attributes = nil
if tagname == "ignore" then
return false
- elseif tagname == "mstackertop" or tagname == "mstackerbot" or tagname == "mstackermid"then
+ elseif tagname == "mstackertop" or tagname == "mstackerbot" or tagname == "mstackermid" then
-- TODO
return true
elseif tagname == "tabulatecell" then
@@ -324,7 +382,10 @@ end
local f_BDC = formatters["/%s <</MCID %s>> BDC"]
-local function makecontent(parent,id,specification)
+local a_destination = attributes.private('destination')
+local a_reference = attributes.private('reference')
+
+local function makecontent(start,parent,id,specification)
local tag = parent.tag
local kids = parent.kids
local last = index
@@ -341,6 +402,16 @@ local function makecontent(parent,id,specification)
kids[#kids+1] = d
elseif pagenum == parent.pnum then
kids[#kids+1] = last
+ -- if tag == "link" then
+ -- local ra = getattr(start,a_reference)
+ -- if ra then
+ -- parent.refatt = ra
+ -- kids[#kids+1] = pdfdictionary {
+ -- Type = pdf_objr,
+ -- Obj = pdfreference(0),
+ -- }
+ -- end
+ -- end
else
local d = pdfdictionary {
Type = pdf_mcr,
@@ -366,15 +437,25 @@ end
local EMCliteral = nil
local visualize = nil
+local enabled = true
+
+updaters.register("tagging.state.disable",function() enabled = false end)
+updaters.register("tagging.state.enable", function() enabled = true end)
+
function nodeinjections.addtags(head)
+ if not enabled then
+ return
+ end
+
if not EMCliteral then
EMCliteral = register(setstate("EMC"))
end
- local last = nil
- local ranges = { }
- local range = nil
+ local last = nil
+ local ranges = { }
+ local range = nil
+ local nofranges = 0
if not root then
structure_kids = pdfarray()
@@ -388,28 +469,23 @@ function nodeinjections.addtags(head)
for n, id in nextnode, head do
if id == glyph_code then
-- maybe also disc
-if getchar(n) ~= 0 then
- local at = getattr(n,a_tagged) or false -- false: pagebody or so, so artifact
- -- if not at then
- -- range = nil
- -- elseif ...
- if last ~= at then
- range = { at, "glyph", n, n, list } -- attr id start stop list
- ranges[#ranges+1] = range
- last = at
- elseif range then
- range[4] = n -- stop
+ if getchar(n) ~= 0 then
+ local at = getattr(n,a_tagged) or false -- false: pagebody or so, so artifact
+ if last ~= at then
+ range = { at, "glyph", n, n, list } -- attr id start stop list
+ nofranges = nofranges + 1
+ ranges[nofranges] = range
+ last = at
+ elseif range then
+ range[4] = n -- stop
+ end
end
-end
elseif id == hlist_code or id == vlist_code then
local at = getattr(n,a_image)
if at then
local at = getattr(n,a_tagged) or false -- false: pagebody or so, so artifact
- -- if not at then
- -- range = nil
- -- else
- ranges[#ranges+1] = { at, "image", n, n, list } -- attr id start stop list
- -- end
+ nofranges = nofranges + 1
+ ranges[nofranges] = { at, "image", n, n, list } -- attr id start stop list
last = nil
else
local list = getlist(n)
@@ -429,7 +505,7 @@ end
-- inspect(ranges)
if trace_tags then
- for i=1,#ranges do
+ for i=1,nofranges do
local range = ranges[i]
local attr = range[1]
local id = range[2]
@@ -471,7 +547,12 @@ end
end
end
- for i=1,#ranges do
+-- local function inject(start,stop,list,literal,left,right)
+-- setlink(getprev(start) or list or true,literal,left or true,start)
+-- setlink(stop,right or true,copy_node(EMCliteral),getnext(stop))
+-- end
+
+ for i=1,nofranges do
local range = ranges[i]
local attr = range[1]
@@ -516,7 +597,7 @@ end
end
end
if prev then
- literal = setstate(makecontent(prev,id,specification))
+ literal = setstate(makecontent(start,prev,id,specification))
elseif ignore then
literal = setstate(makeignore(specification))
else
@@ -662,7 +743,7 @@ end
-- -- else
-- prev = prv
-- r = r + 1
--- result[r] = makecontent(prev,id)
+-- result[r] = makecontent(start,prev,id)
-- -- end
-- end
--
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-u3d.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-u3d.lmt
index 6e02fde3044..5307818d07e 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-u3d.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-u3d.lmt
@@ -21,10 +21,9 @@ local tonumber = tonumber
local formatters, find = string.formatters, string.find
local cos, sin, sqrt, pi, atan2, abs = math.cos, math.sin, math.sqrt, math.pi, math.atan2, math.abs
-local backends, lpdf = backends, lpdf
-
-local nodeinjections = backends.pdf.nodeinjections
+local nodeinjections = backends.registered.pdf.nodeinjections
+local lpdf = lpdf
local pdfconstant = lpdf.constant
local pdfboolean = lpdf.boolean
local pdfunicode = lpdf.unicode
@@ -32,14 +31,8 @@ local pdfdictionary = lpdf.dictionary
local pdfarray = lpdf.array
local pdfnull = lpdf.null
local pdfreference = lpdf.reference
-
-local pdfflushstreamobject
-local pdfflushstreamfileobject
-
-updaters.register("backend.update.lpdf",function()
- pdfflushstreamobject = lpdf.flushstreamobject
- pdfflushstreamfileobject = lpdf.flushstreamfileobject
-end)
+local pdfflushstreamobject = lpdf.flushstreamobject
+local pdfflushstreamfileobject = lpdf.flushstreamfileobject
local checkedkey = lpdf.checkedkey
local limited = lpdf.limited
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-wid.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-wid.lmt
index 268ca119e02..3047402bc93 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-wid.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-wid.lmt
@@ -23,6 +23,10 @@ if not modules then modules = { } end modules ['lpdf-wid'] = {
-- the other fragile bit. And, now that adobe quits flash in 2020 we're without any
-- video anyway. Also, it won't play on all platforms and devices so let's wait for
-- html5 media in pdf then.
+--
+-- See mail by Michal Vlasák to the mailing list that discusses current support in
+-- viewers and also mentions (and submitted) a few fixes wrt embedding media. The
+-- old sound and movie features are gone.
local tonumber, next = tonumber, next
local gmatch, gsub, find, lower = string.gmatch, string.gsub, string.find, string.lower
@@ -36,16 +40,17 @@ local sortedhash, sortedkeys = table.sortedhash, table.sortedkeys
local report_media = logs.reporter("backend","media")
local report_attachment = logs.reporter("backend","attachment")
-local backends = backends
-local lpdf = lpdf
-local nodes = nodes
local context = context
local texgetcount = tex.getcount
+local getmacro = tokens.getters.macro
+
+local hpacknode = nodes.hpack
-local nodeinjections = backends.pdf.nodeinjections
-local codeinjections = backends.pdf.codeinjections
-local registrations = backends.pdf.registrations
+local pdfbackend = backends.registered.pdf
+local nodeinjections = pdfbackend.nodeinjections
+local codeinjections = pdfbackend.codeinjections
+local registrations = pdfbackend.registrations
local executers = structures.references.executers
local variables = interfaces.variables
@@ -55,6 +60,12 @@ local v_auto = variables.auto
local v_embed = variables.embed
local v_max = variables.max
local v_yes = variables.yes
+local v_no = variables.no
+local v_compress = variables.compress
+local v_list = variables.list
+local v_title = variables.title
+
+local lpdf = lpdf
local pdfconstant = lpdf.constant
local pdfnull = lpdf.null
@@ -70,25 +81,12 @@ local pdfborder = lpdf.border
local pdftransparencyvalue = lpdf.transparencyvalue
local pdfcolorvalues = lpdf.colorvalues
-local pdfflushobject
-local pdfflushstreamobject
-local pdfflushstreamfileobject
-local pdfreserveobject
-local pdfpagereference
-local pdfshareobjectreference
-
-updaters.register("backend.update.lpdf",function()
- pdfflushobject = lpdf.flushobject
- pdfflushstreamobject = lpdf.flushstreamobject
- pdfflushstreamfileobject = lpdf.flushstreamfileobject
- pdfreserveobject = lpdf.reserveobject
- pdfpagereference = lpdf.pagereference
- pdfshareobjectreference = lpdf.shareobjectreference
-end)
-
-
-local hpack_node = node.hpack
-local write_node = node.write -- test context(...) instead
+local pdfflushobject = lpdf.flushobject
+local pdfflushstreamobject = lpdf.flushstreamobject
+local pdfflushstreamfileobject = lpdf.flushstreamfileobject
+local pdfreserveobject = lpdf.reserveobject
+local pdfpagereference = lpdf.pagereference
+local pdfshareobjectreference = lpdf.shareobjectreference
-- symbols
@@ -267,7 +265,7 @@ local function flushembeddedfiles()
for tag, reference in sortedhash(filestreams) do
if not reference then
report_attachment("unreferenced file, tag %a",tag)
- elseif referenced[tag] == "hidden" then
+ elseif referenced[tag] == "hidden" or referenced[tag] == "forced" then
e[#e+1] = pdfstring(tag)
e[#e+1] = reference -- already a reference
f[#f+1] = reference -- collect all file description references
@@ -377,6 +375,9 @@ function codeinjections.embedfile(specification)
}
local r = pdfreference(pdfflushobject(d))
filestreams[hash] = r
+ if specification.forcereference == true then
+ referenced[hash] = "forced"
+ end
return r
end
end
@@ -459,12 +460,12 @@ function nodeinjections.attachfile(specification)
AP = appearance,
OC = analyzelayer(specification.layer),
-- F = pdfnull(), -- another rediculous need to satisfy validation
- F = bit32.band(bit32.bor(flags,4),(1023-1-2-32-256)), -- set 3, clear 1,2,6,9; PDF 32000-1, p385
+ F = (flags | 4) & (1023-1-2-32-256), -- set 3, clear 1,2,6,9; PDF 32000-1, p385
}
local width = specification.width or 0
local height = specification.height or 0
local depth = specification.depth or 0
- local box = hpack_node(nodeinjections.annotation(width,height,depth,d()))
+ local box = hpacknode(nodeinjections.annotation(width,height,depth,d()))
box.width = width
box.height = height
box.depth = depth
@@ -565,12 +566,12 @@ function nodeinjections.comment(specification) -- brrr: seems to be done twice
Parent = pdfreference(nd),
}
d.Popup = pdfreference(nc)
- box = hpack_node(
+ box = hpacknode(
nodeinjections.annotation(0,0,0,d(),nd),
nodeinjections.annotation(width,height,depth,c(),nc)
)
else
- box = hpack_node(nodeinjections.annotation(width,height,depth,d()))
+ box = hpacknode(nodeinjections.annotation(width,height,depth,d()))
end
box.width = width -- redundant
box.height = height -- redundant
@@ -617,32 +618,45 @@ end
local ms, mu, mf = { }, { }, { }
local function delayed(label)
- local a = pdfreserveobject()
- mu[label] = a
- return pdfreference(a)
+ local reserved = mu[label]
+ if not reserved then
+ reserved = pdfreserveobject()
+ mu[label] = reserved
+ end
+ return pdfreference(reserved)
+end
+
+local function checkedreference(ref)
+ local set, bug = structures.references.identify("",ref)
+ if not bug and #set > 0 then
+ return pdfaction(set)
+ end
end
local function insertrenderingwindow(specification)
- local label = specification.label
- -- local openpage = specification.openpage
- -- local closepage = specification.closepage
- if specification.option == v_auto then
- if openpageaction then
- -- \handlereferenceactions{\v!StartRendering{#2}}
+ local actions = nil
+ local label = specification.label
+ local openpage = specification.openpage
+ local closepage = specification.closepage
+ local option = settings_to_hash(specification.option)
+ if option[v_auto] then
+ if not openpage or openpage == "" then
+ openpage = variables.StartCurrentRendering
end
- if closepageaction then
- -- \handlereferenceactions{\v!StopRendering {#2}}
+ if not closepage or closepage == "" then
+ closepage = variables.StopCurrentRendering
end
end
- local actions = nil
+ openpage = checkedreference(openpage)
+ closepage = checkedreference(closepage)
if openpage or closepage then
actions = pdfdictionary {
- PO = (openpage and lpdfaction(openpage )) or nil,
- PC = (closepage and lpdfaction(closepage)) or nil,
+ PO = openpage,
+ PC = closepage,
}
end
local page = tonumber(specification.page) or texgetcount("realpageno") -- todo
- local r = mu[label] or pdfreserveobject() -- why the reserve here?
+ local r = mu[label] or pdfreserveobject() -- reserve, child refers to parent
local a = pdfdictionary {
S = pdfconstant("Rendition"),
R = mf[label],
@@ -654,136 +668,138 @@ local function insertrenderingwindow(specification)
Subtype = pdfconstant("Screen"),
P = pdfreference(pdfpagereference(page)),
A = a, -- needed in order to make the annotation clickable (i.e. don't bark)
+ T = pdfunicode(label), -- for JS
Border = bs,
C = bc,
AA = actions,
}
local width = specification.width or 0
local height = specification.height or 0
- if height == 0 or width == 0 then
- -- todo: sound needs no window
- end
- write_node(nodeinjections.annotation(width,height,0,d(),r)) -- save ref
+ context(nodeinjections.annotation(width,height,0,d(),r)) -- save ref
return pdfreference(r)
end
-- some dictionaries can have a MH (must honor) or BE (best effort) capsule
local function insertrendering(specification)
- local label = specification.label
+ local label = specification.label
local option = settings_to_hash(specification.option)
if not mf[label] then
local filename = specification.filename
- local isurl = find(filename,"://",1,true)
- local mimetype = specification.mimetype or specification.mime
- -- local start = pdfdictionary {
- -- Type = pdfconstant("MediaOffset"),
- -- S = pdfconstant("T"), -- time
- -- T = pdfdictionary { -- time
- -- Type = pdfconstant("Timespan"),
- -- S = pdfconstant("S"),
- -- V = 3, -- time in seconds
- -- },
- -- }
- -- local start = pdfdictionary {
- -- Type = pdfconstant("MediaOffset"),
- -- S = pdfconstant("F"), -- frame
- -- F = 100 -- framenumber
- -- }
- -- local start = pdfdictionary {
- -- Type = pdfconstant("MediaOffset"),
- -- S = pdfconstant("M"), -- mark
- -- M = "somemark",
- -- }
- -- local parameters = pdfdictionary {
- -- BE = pdfdictionary {
- -- B = start,
- -- }
- -- }
- -- local parameters = pdfdictionary {
- -- Type = pdfconstant(MediaPermissions),
- -- TF = pdfstring("TEMPALWAYS") }, -- TEMPNEVER TEMPEXTRACT TEMPACCESS TEMPALWAYS
- -- }
- local descriptor = pdfdictionary {
- Type = pdfconstant("Filespec"),
- F = filename,
- }
- if isurl then
- descriptor.FS = pdfconstant("URL")
- elseif option[v_embed] then
- descriptor.EF = codeinjections.embedfile {
- file = filename,
- mimetype = mimetype, -- yes or no
- compress = false,
+ if filename and filename ~= "" then
+ local isurl = find(filename,"://",1,true)
+ local mimetype = specification.mimetype or specification.mime
+ -- local start = pdfdictionary {
+ -- Type = pdfconstant("MediaOffset"),
+ -- S = pdfconstant("T"), -- time
+ -- T = pdfdictionary { -- time
+ -- Type = pdfconstant("Timespan"),
+ -- S = pdfconstant("S"),
+ -- V = 3, -- time in seconds
+ -- },
+ -- }
+ -- local start = pdfdictionary {
+ -- Type = pdfconstant("MediaOffset"),
+ -- S = pdfconstant("F"), -- frame
+ -- F = 100 -- framenumber
+ -- }
+ -- local start = pdfdictionary {
+ -- Type = pdfconstant("MediaOffset"),
+ -- S = pdfconstant("M"), -- mark
+ -- M = "somemark",
+ -- }
+ -- local parameters = pdfdictionary {
+ -- BE = pdfdictionary {
+ -- B = start,
+ -- }
+ -- }
+ local parameters = pdfdictionary {
+ Type = pdfconstant("MediaPermissions"),
+ TF = pdfstring("TEMPALWAYS"), -- TEMPNEVER TEMPEXTRACT TEMPACCESS TEMPALWAYS / needed for acrobat/wmp
}
+ local descriptor = pdfdictionary {
+ Type = pdfconstant("Filespec"),
+ F = filename,
+ }
+ if isurl then
+ descriptor.FS = pdfconstant("URL")
+ descriptor = pdfreference(pdfflushobject(descriptor))
+ elseif option[v_embed] then
+ descriptor = codeinjections.embedfile {
+ file = filename,
+ mimetype = mimetype, -- yes or no
+ title = option[v_title],
+ compress = option[v_compress] or false,
+ forcereference = option[v_list] ~= v_no,
+ }
+ end
+ local clip = pdfdictionary {
+ Type = pdfconstant("MediaClip"),
+ S = pdfconstant("MCD"),
+ N = label,
+ CT = mimetype,
+ Alt = pdfarray { "", "file not found" }, -- language id + message
+ D = descriptor,
+ P = pdfreference(pdfflushobject(parameters)),
+ }
+ local rendition = pdfdictionary {
+ Type = pdfconstant("Rendition"),
+ S = pdfconstant("MR"),
+ N = pdfunicode(label),
+ C = pdfreference(pdfflushobject(clip)),
+ }
+ mf[label] = pdfreference(pdfflushobject(rendition))
end
- local clip = pdfdictionary {
- Type = pdfconstant("MediaClip"),
- S = pdfconstant("MCD"),
- N = label,
- CT = mimetype,
- Alt = pdfarray { "", "file not found" }, -- language id + message
- D = pdfreference(pdfflushobject(descriptor)),
- -- P = pdfreference(pdfflushobject(parameters)),
- }
- local rendition = pdfdictionary {
- Type = pdfconstant("Rendition"),
- S = pdfconstant("MR"),
- N = label,
- C = pdfreference(pdfflushobject(clip)),
- }
- mf[label] = pdfreference(pdfflushobject(rendition))
- end
-end
-
-local function insertrenderingobject(specification) -- todo
- local label = specification.label
- if not mf[label] then
- report_media("unknown medium, label %a",label)
- local clip = pdfdictionary { -- does not work that well one level up
- Type = pdfconstant("MediaClip"),
- S = pdfconstant("MCD"),
- N = label,
- D = pdfreference(unknown), -- not label but objectname, hm .. todo?
- }
- local rendition = pdfdictionary {
- Type = pdfconstant("Rendition"),
- S = pdfconstant("MR"),
- N = label,
- C = pdfreference(pdfflushobject(clip)),
- }
- mf[label] = pdfreference(pdfflushobject(rendition))
end
end
function codeinjections.processrendering(label)
local specification = interactions.renderings.rendering(label)
- if not specification then
- -- error
- elseif specification.type == "external" then
+ if specification then
insertrendering(specification)
else
- insertrenderingobject(specification)
+ -- error
end
end
+-- needed mapping for access from JS
+
+local function flushrenderings()
+ if next(mf) then
+ local r = pdfarray()
+ for label, reference in sortedhash(mf) do
+ r[#r+1] = pdfunicode(label)
+ r[#r+1] = reference -- already a reference
+ end
+ lpdf.addtonames("Renditions",pdfreference(pdfflushobject(pdfdictionary{ Names = r })))
+ end
+end
+
+lpdf.registerdocumentfinalizer(flushrenderings,"renderings")
+
function codeinjections.insertrenderingwindow(specification)
local label = specification.label
codeinjections.processrendering(label)
ms[label] = insertrenderingwindow(specification)
end
-local function set(operation,arguments)
- codeinjections.processrendering(arguments)
- return pdfdictionary {
- S = pdfconstant("Rendition"),
- OP = operation,
- R = mf[arguments],
- AN = ms[arguments] or delayed(arguments),
- }
+local function set(operation,label)
+ if not label or label == "" then
+ -- This one is local to the window so unlikely to be set.
+ label = getmacro("currentrendering")
+ end
+ if label and label ~= "" then
+ codeinjections.processrendering(label)
+ return pdfdictionary {
+ S = pdfconstant("Rendition"),
+ OP = operation,
+ R = mf[label],
+ AN = ms[label] or delayed(label),
+ }
+ end
end
-function executers.startrendering (arguments) return set(0,arguments) end
-function executers.stoprendering (arguments) return set(1,arguments) end
-function executers.pauserendering (arguments) return set(2,arguments) end
-function executers.resumerendering(arguments) return set(3,arguments) end
+function executers.startrendering (label) return set(0,label) end
+function executers.stoprendering (label) return set(1,label) end
+function executers.pauserendering (label) return set(2,label) end
+function executers.resumerendering(label) return set(3,label) end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lpdf-xmp.lmt b/Master/texmf-dist/tex/context/base/mkxl/lpdf-xmp.lmt
index 313488a3945..e147c796fe0 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lpdf-xmp.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/lpdf-xmp.lmt
@@ -8,10 +8,13 @@ if not modules then modules = { } end modules ['lpdf-xmp'] = {
}
local tostring, type = tostring, type
-local format, gsub = string.format, string.gsub
+local format, gsub, match = string.format, string.gsub, string.match
+local concat = table.concat
+local settings_to_array = utilities.parsers.settings_to_array
local utfchar = utf.char
local xmlfillin = xml.fillin
local md5HEX = md5.HEX
+local osdate, ostime, ostimezone, osuuid = os.date, os.time, os.timezone, os.uuid
local trace_xmp = false trackers.register("backend.xmp", function(v) trace_xmp = v end)
local trace_info = false trackers.register("backend.info", function(v) trace_info = v end)
@@ -19,21 +22,17 @@ local trace_info = false trackers.register("backend.info", function(v) trace_in
local report_xmp = logs.reporter("backend","xmp")
local report_info = logs.reporter("backend","info")
-local backends, lpdf = backends, lpdf
-
-local codeinjections = backends.pdf.codeinjections -- normally it is registered
+local backends = backends
+local pdfbackend = backends.registered.pdf
+local codeinjections = pdfbackend.codeinjections
+local lpdf = lpdf
local pdfdictionary = lpdf.dictionary
local pdfconstant = lpdf.constant
+local pdfunicode = lpdf.unicode
+local pdfstring = lpdf.string
local pdfreference = lpdf.reference
-
-local pdfgetmetadata = lpdf.getmetadata
-
-local pdfflushstreamobject
-
-updaters.register("backend.update.lpdf",function()
- pdfflushstreamobject = lpdf.flushstreamobject
-end)
+local pdfflushstreamobject = lpdf.flushstreamobject
-- The XMP packet wrapper is kind of fixed, see page 10 of XMPSpecificationsPart1.pdf from
-- XMP-Toolkit-SDK-CC201607.zip. So we hardcode the id.
@@ -45,7 +44,8 @@ local xpacket = format ( [[
<?xpacket end="w"?>]], utfchar(0xFEFF) )
-local mapping = {
+local unknown = { false, false }
+local mapping = table.setmetatableindex ( {
-- user defined keys (pdfx:)
["ConTeXt.Jobname"] = { "context", "rdf:Description/pdfx:ConTeXt.Jobname" },
["ConTeXt.Time"] = { "date", "rdf:Description/pdfx:ConTeXt.Time" },
@@ -64,10 +64,11 @@ local mapping = {
["Producer"] = { "metadata","rdf:Description/pdf:Producer" },
-- ["Trapped"] = { "pdf", "rdf:Description/pdf:Trapped" }, -- '/False' in /Info, but 'False' in XMP
-- Dublin Core schema
- ["Author"] = { "metadata","rdf:Description/dc:creator/rdf:Seq/rdf:li" },
["Format"] = { "metadata","rdf:Description/dc:format" }, -- optional, but nice to have
- ["Subject"] = { "metadata","rdf:Description/dc:description/rdf:Alt/rdf:li" },
- ["Title"] = { "metadata","rdf:Description/dc:title/rdf:Alt/rdf:li" },
+ -- These were dc:.../rdf:Seq/rdf:li but there was a (invalidating) bug in the iso
+ ["Author"] = { "metadata","rdf:Description/dc:creator" },
+ ["Subject"] = { "metadata","rdf:Description/dc:description" },
+ ["Title"] = { "metadata","rdf:Description/dc:title" },
-- XMP Basic schema
["CreateDate"] = { "date", "rdf:Description/xmp:CreateDate" },
["CreationDate"] = { "date", "rdf:Description/xmp:CreationDate" }, -- dummy
@@ -94,72 +95,113 @@ local mapping = {
["AuthorsPosition"] = { "metadata", "rdf:Description/photoshop:AuthorsPosition" },
["Copyright"] = { "metadata", "rdf:Description/photoshop:Copyright" },
["CaptionWriter"] = { "metadata", "rdf:Description/photoshop:CaptionWriter" },
-}
+}, function() return unknown end )
-local included = backends.included
-local lpdfid = lpdf.id
-function lpdf.id() -- overload of ini
- return lpdfid(included.date)
-end
+local metadata = nil
+local trailerid = true
+local creationdate = false
+local modificationdate = false
-local trailerid = nil
-local dates = nil
+local function pdftimestamp(str)
+ local t = type(str)
+ if t == "string" then
+ local Y, M, D, h, m, s, Zs, Zh, Zm = match(str,"^(%d%d%d%d)%-(%d%d)%-(%d%d)T(%d%d):(%d%d):(%d%d)([%+%-])(%d%d):(%d%d)$")
+ return Y and format("D:%s%s%s%s%s%s%s%s'%s'",Y,M,D,h,m,s,Zs,Zh,Zm)
+ else
+ return osdate("D:%Y%m%d%H%M%S",t == "number" and str or ostime()) -- maybe "!D..." : universal time
+ end
+end
-local function update()
- if trailer_id then
- local b = toboolean(trailer_id) or trailer_id == ""
- if b then
- trailer_id = "This file is processed by ConTeXt and LuaTeX."
- else
- trailer_id = tostring(trailer_id)
- end
- local h = md5HEX(trailer_id)
- if b then
- report_info("using frozen trailer id")
- else
- report_info("using hashed trailer id %a (%a)",trailer_id,h)
- end
- trailerid = format("[<%s> <%s>]",h,h)
+local function pdfgetmetadata()
+ if not metadata then
+ local contextversion = environment.version
+ local luatexversion = format("%1.2f",LUATEXVERSION)
+ local luatexfunctionality = tostring(LUATEXFUNCTIONALITY)
+ local jobname = environment.jobname or tex.jobname or "unknown"
+ local documentid = trailerid and ("uuid:" .. osuuid()) or "no unique document id here"
+ local instanceid = trailerid and ("uuid:" .. osuuid()) or "no unique instance id here"
+ metadata = creationdate and {
+ producer = format("LuaMetaTeX-%s",luatexversion),
+ creator = format("LuaMetaTeX %s %s + ConTeXt LMTX %s",luatexversion,luatexfunctionality,contextversion),
+ luatexversion = luatexversion,
+ contextversion = contextversion,
+ luatexfunctionality = luatexfunctionality,
+ luaversion = tostring(LUAVERSION),
+ platform = os.platform,
+ creationdate = creationdate,
+ modificationdate = modificationdate,
+ id = format("%s | %s",jobname,creationdate),
+ documentid = documentid,
+ instanceid = instanceid,
+ jobname = jobname,
+ } or {
+ producer = "LuaMetaTeX",
+ creator = "LuaMetaTeX + ConTeXt LMTX",
+ id = jobname,
+ documentid = documentid,
+ instanceid = instanceid,
+ jobname = jobname,
+ }
+ -- inspect(metadata)
end
- --
- local t = type(dates)
- if t == "number" or t == "string" then
- local d = converters.totime(dates)
- if d then
- included.date = true
- included.id = "fake"
- report_info("forced date/time information %a will be used",lpdf.settime(d))
- trailerid = false
- elseif t == "string" then
- dates = toboolean(dates)
- included.date = dates
- if dates ~= false then
- included.id = true
- else
- report_info("no date/time but fake id information will be added")
- trailerid = true
- included.id = "fake"
+ return metadata
+end
+
+local function pdfsetmetadate(n,both)
+ if n then
+ n = converters.totime(n)
+ if n then
+ creationdate = osdate("%Y-%m-%dT%H:%M:%S",ostime(n)) .. ostimezone()
+ if both then
+ modificationdate = creationdate
end
end
end
+ return creationdate
+end
+
+lpdf.pdftimestamp = pdftimestamp
+
+function lpdf.gettrailerid()
+ if trailerid == true then
+ return md5.HEX(osuuid())
+ elseif type(trailerid) == "string" then
+ return md5.HEX(trailerid)
+ else
+ return false
+ end
end
-lpdf.registerdocumentfinalizer(update,"trailer id and dates",1)
+-- string: use that, true: uuid, false: nothing
-directives.register("backend.trailerid", function(v) trailerid = v end)
-directives.register("backend.date", function(v) dates = v end)
+directives.register("backend.trailerid", function(v)
+ trailerid = type(v) and v or toboolean(v)
+end)
+
+-- year-mm-dd : use that for creation and modification
-local function permitdetail(what)
- local m = mapping[what]
- if m then
- return included[m[1]] and m[2]
+local function setdates(v)
+ local t = type(v)
+ if t == "number" or t == "string" then
+ local d = converters.totime(v)
+ if d then
+ report_info("forced date/time information %a will be used",pdfsetmetadate(d,true))
+ return
+ end
+ end
+ if toboolean(v) then
+ creationdate = osdate("%Y-%m-%dT%H:%M:%S") .. ostimezone()
+ modificationdate = creationdate
else
- return included[what] and true or false
+ creationdate = false
+ modificationdate = false
end
end
-lpdf.permitdetail = permitdetail
+setdates(true)
+
+directives.register("backend.date", setdates)
-- maybe some day we will load the xmp file at runtime
@@ -200,7 +242,7 @@ local function valid_xmp()
end
function lpdf.addxmpinfo(tag,value,check)
- local pattern = permitdetail(tag)
+ local pattern = mapping[tag][2]
if type(pattern) == "string" then
xmlfillin(xmp or valid_xmp(),pattern,value,check)
end
@@ -212,12 +254,12 @@ local pdfaddtoinfo = lpdf.addtoinfo
local pdfaddxmpinfo = lpdf.addxmpinfo
function lpdf.addtoinfo(tag,pdfvalue,strvalue)
- local pattern = permitdetail(tag)
- if pattern then
+ local pattern = mapping[tag][2]
+ if pattern or strvalue == true then
pdfaddtoinfo(tag,pdfvalue)
end
if type(pattern) == "string" then
- local value = strvalue or gsub(tostring(pdfvalue),"^%((.*)%)$","%1") -- hack
+ local value = (type(strvalue) == "string" and strvalue) or gsub(tostring(pdfvalue),"^%((.*)%)$","%1") -- hack
if trace_info then
report_info("set %a to %a",tag,value)
end
@@ -239,23 +281,91 @@ end
-- flushing
-local add_xmp_blob = true directives.register("backend.xmp",function(v) add_xmp_blob = v end)
+local add_xmp_blob = true
+local indentity_done = false -- using "setupidentity = function() end" fails as the meaning is frozen in register
+
+local function setupidentity()
+ if not done then
+ --
+ local identity = interactions.general.getidentity()
+ local title = identity.title
+ local subtitle = identity.subtitle
+ local author = identity.author
+ local date = identity.date
+ local keywords = identity.keywords
+ --
+ if date and date ~= "" then
+ pdfsetmetadate(date)
+ end
+ if keywords then
+ keywords = concat(settings_to_array(keywords), " ")
+ end
+ --
+ local metadata = pdfgetmetadata()
+ local creator = metadata.creator
+ local contextversion = metadata.contextversion
+ local id = metadata.id
+ local jobname = metadata.jobname
+ local creator = metadata.creator
+ local creation = metadata.creationdate
+ local modification = metadata.modificationdate
+ --
+ if creator then
+ pdfaddtoinfo("Creator",pdfunicode(creator),creator)
+ end
+ if creation then
+ pdfaddtoinfo("CreationDate",pdfstring(pdftimestamp(creation)),creation)
+ end
+ if modification then
+ pdfaddtoinfo("ModDate",pdfstring(pdftimestamp(modification)),modification)
+ end
+ if id then
+ pdfaddtoinfo("ID",pdfstring(id),id) -- needed for pdf/x
+ end
+ --
+ if title ~= "" then
+ pdfaddtoinfo("Title",pdfunicode(title),title)
+ end
+ if subtitle ~= "" then
+ pdfaddtoinfo("Subject",pdfunicode(subtitle),subtitle)
+ end
+ if author ~= "" then
+ pdfaddtoinfo("Author",pdfunicode(author),author) -- '/Author' in /Info, 'Creator' in XMP
+ end
+ if keywords and keywords ~= "" then
+ pdfaddtoinfo("Keywords",pdfunicode(keywords),keywords)
+ end
+ --
+ if contextversion then
+ pdfaddtoinfo("ConTeXt.Version",contextversion)
+ end
+ if creation then
+ pdfaddtoinfo("ConTeXt.Time",creation)
+ end
+ if jobname then
+ pdfaddtoinfo("ConTeXt.Jobname",jobname)
+ end
+ --
+ pdfaddtoinfo("ConTeXt.Url","www.pragma-ade.com")
+ pdfaddtoinfo("ConTeXt.Support","contextgarden.net")
+ pdfaddtoinfo("TeX.Support","tug.org")
+ --
+ done = true
+ else
+ -- no need for a message
+ end
+end
local function flushxmpinfo()
commands.pushrandomseed()
- commands.setrandomseed(os.time())
+ commands.setrandomseed(ostime())
- local documentid = "no unique document id here"
- local instanceid = "no unique instance id here"
local metadata = pdfgetmetadata()
local time = metadata.time
local producer = metadata.producer
local creator = metadata.creator
-
- if included.id ~= "fake" then
- documentid = "uuid:" .. os.uuid()
- instanceid = "uuid:" .. os.uuid()
- end
+ local documentid = metadata.documentid
+ local instanceid = metadata.instanceid
pdfaddtoinfo("Producer",producer)
pdfaddtoinfo("Creator",creator)
@@ -297,15 +407,14 @@ local function flushxmpinfo()
end
local r = pdfflushstreamobject(blob,md,false) -- uncompressed
lpdf.addtocatalog("Metadata",pdfreference(r))
+
end
commands.poprandomseed() -- hack
end
--- this will be enabled when we can inhibit compression for a stream at the lua end
-
+lpdf.registerpagefinalizer(setupidentity,"identity")
lpdf.registerdocumentfinalizer(flushxmpinfo,1,"metadata")
-directives.register("backend.verbosexmp", function(v)
- verbose = v
-end)
+directives.register("backend.xmp", function(v) add_xmp_blob = v end)
+directives.register("backend.verbosexmp", function(v) verbose = v end)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/luat-bas.mkxl b/Master/texmf-dist/tex/context/base/mkxl/luat-bas.mkxl
index 0add4ce6926..20d6c88fcab 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/luat-bas.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/luat-bas.mkxl
@@ -23,9 +23,8 @@
\registerctxluafile{l-string} {}
\registerctxluafile{l-table} {}
\registerctxluafile{l-boolean} {}
-\registerctxluafile{l-number} {}
+\registerctxluafile{l-number} {autosuffix}
\registerctxluafile{l-math} {}
-%registerctxluafile{l-aux} {}
\registerctxluafile{l-io} {}
\registerctxluafile{l-os} {}
\registerctxluafile{l-file} {}
@@ -33,8 +32,7 @@
\registerctxluafile{l-md5} {}
\registerctxluafile{l-sha} {}
\registerctxluafile{l-dir} {}
-\registerctxluafile{l-unicode} {optimize}
-%registerctxluafile{l-utils} {}
+\registerctxluafile{l-unicode} {autosuffix}
\registerctxluafile{l-url} {}
\registerctxluafile{l-set} {}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/luat-cnf.lmt b/Master/texmf-dist/tex/context/base/mkxl/luat-cnf.lmt
new file mode 100644
index 00000000000..ea9eb0d8937
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/luat-cnf.lmt
@@ -0,0 +1,227 @@
+if not modules then modules = { } end modules ['luat-cnf'] = {
+ version = 1.001,
+ comment = "companion to luat-lib.mkxl",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local type = type
+local format, concat = string.format, table.concat
+
+local report = logs.reporter("system")
+
+luatex = luatex or { }
+local luatex = luatex
+
+texconfig.functionsize = 32768
+texconfig.propertiessize = 10000
+
+-- These lists need updating! If we decide to keep them at all.
+
+local stub = [[
+
+-- checking
+
+storage = storage or { }
+luatex = luatex or { }
+
+-- as soon as possible
+
+texconfig.functionsize = 32768
+texconfig.propertiessize = 10000
+
+luatex.starttime = os.gettimeofday()
+
+-- this will happen after the format is loaded
+
+function texconfig.init()
+
+ -- development
+
+ local builtin, globals = { }, { }
+
+ libraries = { -- we set it here as we want libraries also 'indexed'
+ basiclua = {
+ -- always
+ "string", "table", "coroutine", "debug", "file", "io", "lpeg", "math", "os", "package",
+ -- bonus
+ "bit32", "utf8",
+ },
+ basictex = {
+ -- always
+ "callback", "font", "lua", "node", "status", "tex", "texconfig", "texio", "token",
+ -- not in luametatex
+ "img", "pdf", "lang",
+ -- in luametatex
+ "language",
+ },
+ extralua = {
+ -- not in luametatex
+ "unicode", "utf", "gzip", "zip", "zlib",
+ -- in luametatex
+ "xzip", "xmath", "xcomplex", "xdecimal", "basexx",
+ -- maybe some day in luametatex
+ "lz4", "lzo",
+ -- always (mime can go)
+ "lfs","socket", "mime", "md5", "sha2", "fio", "sio",
+ },
+ extratex = {
+ -- not in luametatex
+ "kpse",
+ -- always
+ "pdfe", "mplib",
+ -- in luametatex
+ "pdfdecode", "pngdecode",
+ },
+ obsolete = {
+ "epdf",
+ "fontloader", -- can be filled by luat-log
+ "kpse",
+ },
+ functions = {
+ "assert", "pcall", "xpcall", "error", "collectgarbage",
+ "dofile", "load","loadfile", "require", "module",
+ "getmetatable", "setmetatable",
+ "ipairs", "pairs", "rawequal", "rawget", "rawset", "next",
+ "tonumber", "tostring",
+ "type", "unpack", "select", "print",
+ },
+ builtin = builtin, -- to be filled
+ globals = globals, -- to be filled
+ }
+
+ for k, v in next, _G do
+ globals[k] = tostring(v)
+ end
+
+ local function collect(t,fnc)
+ local lib = { }
+ for k, v in next, t do
+ if fnc then
+ lib[v] = _G[v]
+ else
+ local keys = { }
+ local gv = _G[v]
+ local tv = type(gv)
+ if tv == "table" then
+ for k, v in next, gv do
+ keys[k] = tostring(v) -- true -- by tostring we cannot call overloads functions (security)
+ end
+ end
+ lib[v] = keys
+ builtin[v] = keys
+ end
+ end
+ return lib
+ end
+
+ libraries.basiclua = collect(libraries.basiclua)
+ libraries.basictex = collect(libraries.basictex)
+ libraries.extralua = collect(libraries.extralua)
+ libraries.extratex = collect(libraries.extratex)
+ libraries.functions = collect(libraries.functions,true)
+ libraries.obsolete = collect(libraries.obsolete)
+
+ -- shortcut and helper
+
+ local setbytecode = lua.setbytecode
+ local getbytecode = lua.getbytecode
+ local callbytecode = lua.callbytecode or function(i)
+ local b = getbytecode(i)
+ if type(b) == "function" then
+ b()
+ return true
+ else
+ return false
+ end
+ end
+
+ local function init(start)
+ local i = start
+ local t = os.clock()
+ while true do
+ -- local b = callbytecode(i)
+ local e, b = pcall(callbytecode,i)
+ if not e then
+ print(string.format("fatal error : unable to load bytecode register %%i, maybe wipe the cache first\n",i))
+ os.exit()
+ end
+ if b then
+ setbytecode(i,nil) ;
+ i = i + 1
+ else
+ break
+ end
+ end
+ return i - start, os.clock() - t
+ end
+
+ -- the stored tables and modules
+
+ storage.noftables , storage.toftables = init(0)
+ storage.nofmodules, storage.tofmodules = init(%s)
+
+ if modules then
+ local loaded = package.loaded
+ for module, _ in next, modules do
+ loaded[module] = true
+ end
+ end
+
+ texconfig.init = function() end
+
+end
+
+CONTEXTLMTXMODE = 1
+
+-- we provide a qualified path
+
+callback.register('find_format_file',function(name)
+ texconfig.formatname = name
+ return name
+end)
+
+-- done, from now on input and callbacks are internal
+]]
+
+local keys = {
+ "buffersize", "expandsize", "filesize", "fontsize", "hashsize", "inputsize",
+ "languagesize", "marksize", "insertsize", "nestsize", "nodesize", "parametersize", "poolsize",
+ "savesize", "stringsize", "tokensize", "errorlinesize", "halferrorlinesize",
+}
+
+local function makestub()
+ local name = environment.jobname .. ".lui"
+ report("creating stub file %a using directives:",name)
+ report()
+ firsttable = firsttable or lua.firstbytecode
+ local t = {
+ "-- This file is generated, don't change it!\n"
+ }
+ for i=1,#keys do
+ local target = keys[i]
+ local key = "luametatex." .. target
+ local val = directives.value(key)
+ if type(val) == "number" then
+ val = { size = val }
+ end
+ if type(val) == "table" then
+ local s = { }
+ local v = val.size if v then s[#s+1] = format("size = %10i",v) end
+ local v = val.plus if v then s[#s+1] = format("plus = %10i",v) end
+ local v = val.step if v then s[#s+1] = format("step = %10i",v) end
+ if #s > 0 then
+ s = format("%-17s = { %s }",target,concat(s,", "))
+ report(" %s",s)
+ t[#t+1] = "texconfig." .. s
+ end
+ end
+ end
+ t[#t+1] = ""
+ t[#t+1] = format(stub,firsttable)
+ io.savedata(name,concat(t,"\n"))
+ report()
+end
+
+lua.registerinitexfinalizer(makestub,"create stub file")
diff --git a/Master/texmf-dist/tex/context/base/mkxl/luat-cod.lmt b/Master/texmf-dist/tex/context/base/mkxl/luat-cod.lmt
index 49d90777df6..f96f5c57757 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/luat-cod.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/luat-cod.lmt
@@ -17,32 +17,31 @@ local texconfig, lua = texconfig, lua
-- some basic housekeeping
-texconfig.kpse_init = false -- not needed in lmtx
-texconfig.shell_escape = 't' -- not needed in lmtx
-
-texconfig.max_in_open = 2000
-texconfig.nest_size = 10000
-texconfig.param_size = 100000
-texconfig.save_size = 500000
-texconfig.stack_size = 100000
-texconfig.buffer_size = 10000000
-texconfig.token_size = 10000000
-texconfig.node_size = 50000000
-
-texconfig.max_print_line = 100000
-texconfig.max_strings = 500000
-texconfig.max_pool = 10000000
-
-texconfig.hash_extra = 200000
-
-texconfig.expand_depth = 10000
-texconfig.function_size = 32768
-texconfig.properties_size = 10000
-texconfig.error_line = 250
-texconfig.half_error_line = 125
-
-texconfig.level_max = 500
-texconfig.level_chr = 46 -- period
+---------.kpse_init = false -- not needed in lmtx
+---------.shell_escape = 't' -- not needed in lmtx
+
+-- texconfig.max_in_open = 2000
+-- texconfig.nest_size = 10000
+-- texconfig.param_size = 100000
+-- texconfig.save_size = 500000
+-- texconfig.stack_size = 100000
+-- texconfig.buffer_size = 10000000
+-- texconfig.token_size = 10000000
+-- texconfig.token_size = { size = 10000000, step = 2000000 }
+-- texconfig.node_size = 50000000
+
+---------.max_print_line = 100000
+-- texconfig.max_strings = 500000
+-- texconfig.max_strings = { size = 600000, step = 200000 }
+-- texconfig.max_pool = 10000000
+-- texconfig.hash_extra = 250000
+-- texconfig.expand_depth = 10000
+
+-- texconfig.error_line = 250
+-- texconfig.half_error_line = 125
+
+texconfig.functionsize = 32768
+texconfig.propertiessize = 10000
-- registering bytecode chunks
@@ -94,34 +93,12 @@ function lua.registercode(filename,options)
lua.lastbytecode = n
end
elseif environment.initex then
- texio.write_nl(format("\nerror loading file: %s (aborting)",filename))
+ texio.writenl(format("\nerror loading file: %s (aborting)",filename))
os.exit()
end
end
end
-local finalizers = { }
-
-function lua.registerfinalizer(f,comment)
- comment = comment or "unknown"
- if type(f) == "function" then
- finalizers[#finalizers+1] = { action = f, comment = comment }
- else
- print(format("\nfatal error: invalid finalizer, action: %s\n",comment))
- os.exit()
- end
-end
-
-function lua.finalize(logger)
- for i=1,#finalizers do
- local finalizer = finalizers[i]
- finalizer.action()
- if logger then
- logger("finalize action: %s",finalizer.comment)
- end
- end
-end
-
-- A first start with environments. This will be overloaded later.
environment = environment or { }
@@ -161,9 +138,7 @@ if LUATEXFORMATID == nil then
LUATEXFORMATID = status.format_id or 0
end
-if JITSUPPORTED == nil then
- JITSUPPORTED = false
-end
+JITSUPPORTED = false
if INITEXMODE == nil then
INITEXMODE = status.run_state == 0 -- initializing updating production
@@ -176,6 +151,37 @@ environment.jitsupported = JITSUPPORTED
environment.initex = INITEXMODE
environment.initexmode = INITEXMODE
+if INITEXMODE then
+
+ local finalizers = { }
+
+ function lua.registerinitexfinalizer(f,comment)
+ comment = comment or "unknown"
+ if type(f) == "function" then
+ finalizers[#finalizers+1] = { action = f, comment = comment }
+ else
+ print(format("\nfatal error: invalid finalizer, action: %s\n",comment))
+ os.exit()
+ end
+ end
+
+ function lua.finalizeinitex(logger)
+ for i=1,#finalizers do
+ local finalizer = finalizers[i]
+ finalizer.action()
+ if logger then
+ logger("finalize action: %s",finalizer.comment)
+ end
+ end
+ end
+
+else
+
+ function lua.registerinitexfinalizer() end
+ function lua.finalizeinitex () end
+
+end
+
-- if INITEXMODE then
-- -- we have about that amount so we preallocate then which gives less
-- -- reallocations (we're talking tiny record so no real gain)
@@ -284,7 +290,10 @@ local function open_data_file(name)
return {
reader = function()
return f:read("*line")
- end
+ end,
+ -- close = function()
+ -- f:close()
+ -- end
}
else
return false
@@ -301,7 +310,7 @@ callback.register("trace_memory", function(what,success)
logs.report("tex memory","bumping category %a %s, details: %s",
what,success,table.sequenced(status["get"..what.."state"]()))
elseif texio then
- texio.write_nl(format("bumping tex '%s' memory %s",
+ texio.writenl(format("bumping tex '%s' memory %s",
what,success))
end
-- os.exit()
diff --git a/Master/texmf-dist/tex/context/base/mkxl/luat-fio.lmt b/Master/texmf-dist/tex/context/base/mkxl/luat-fio.lmt
index c70ed54e4aa..ce8b5ab278b 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/luat-fio.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/luat-fio.lmt
@@ -9,11 +9,6 @@ if not modules then modules = { } end modules ['luat-fio'] = {
local format = string.format
local concat = table.concat
-texconfig.kpse_init = false -- can go away
-texconfig.shell_escape = 't' -- can go away
-texconfig.max_print_line = 100000 -- can go away
-texconfig.max_in_open = 1000 -- can go away
-
if not resolvers.initialized() then
resolvers.reset()
@@ -32,7 +27,7 @@ if not resolvers.initialized() then
local ioflush = io.flush
local ioread = io.read
- local writenl = texio.write_nl
+ local writenl = texio.writenl
local function terminal()
writenl("\ntex console > ")
@@ -85,8 +80,8 @@ if not resolvers.initialized() then
return name
end
- register('find_log_file' , find_any_file, true)
- register('find_format_file', find_any_file, true)
+ register('find_log_file' , find_any_file, true) -- why do we have this callback if we just return the name
+ register('find_format_file', find_any_file, true) -- why do we have this callback if we just return the name
-- register('find_data_file' , find_data_file, true)
register('open_data_file' , open_data_file, true)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/luat-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/luat-ini.lmt
index 3bfd191b981..3202ea42b1a 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/luat-ini.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/luat-ini.lmt
@@ -25,20 +25,12 @@ if not global then
global = _G
end
-LUATEXVERSION = status.luatex_version/100
- + tonumber(status.luatex_revision)/10000
-
-LUATEXENGINE = status.luatex_engine and string.lower(status.luatex_engine)
- or (string.find(status.banner,"LuajitTeX",1,true) and "luajittex" or "luatex")
-
+LUATEXVERSION = status.luatex_version/100 + tonumber(status.luatex_revision)/10000
+LUATEXENGINE = string.lower(status.luatex_engine or "luametatex")
LUATEXFUNCTIONALITY = status.development_id or 6346
-
LUATEXFORMATID = status.format_id or 0
-
-JITSUPPORTED = LUATEXENGINE == "luajittex" or jit
-
+JITSUPPORTED = false
INITEXMODE = status.ini_version
-
CONTEXTLMTXMODE = 1
function os.setlocale()
diff --git a/Master/texmf-dist/tex/context/base/mkxl/luat-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/luat-ini.mkxl
index 9a78c3934c4..d1a84f60cc3 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/luat-ini.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/luat-ini.mkxl
@@ -21,21 +21,18 @@
%D will keep code outside \TEX\ files as much as possible. The solutions evolved
%D with the engine but one can find some history in the \MKIV\ files and articles.
-%ifdefined\setnaturalcatcodes \else \let\setnaturalcatcodes\relax \fi
-\ifdefined\obeylualines \else \let\obeylualines \relax \fi
-\ifdefined\obeyluatokens \else \let\obeyluatokens \relax \fi
+\ifdefined\obeyluatokens \else \let\obeyluatokens\relax \fi
%D A few more goodies:
-\aliased\let\stoplua \relax % tex catcodes
-\aliased\let\stopluacode\relax % lua catcodes
+\permanent\protected\lettonothing\stoplua % tex catcodes
+\permanent\protected\lettonothing\stopluacode % lua catcodes
-%D In the meantime the \LUATEX\ interface has become stable but we still
-%D see traces of old here (needs checking).
+%D In the meantime the \LUATEX\ interface has become stable but we still see traces
+%D of old here (needs checking).
\permanent\protected\def\startlua % \stoplua
{\begingroup
- \obeylualines
\luat_start_lua_indeed}
\def\luat_start_lua_indeed#1\stoplua
@@ -43,7 +40,6 @@
\permanent\protected\def\startluacode % \stopluacode
{\begingroup
- \obeylualines
\obeyluatokens
\luat_start_lua_code_indeed}
@@ -58,14 +54,37 @@
\ifdefined\obeyspaces \else \let\obeyspaces \relax \fi
\ifdefined\obeyedspace \else \let\obeyedspace \relax \fi
-\aliased\let\obeylualines\relax % not used, will go away
-
\newtoks\everyluacode
%D It is nicer for checking with \type {s-system-macros} if we have some meaning:
\pushoverloadmode
- \let\-\explicitdiscretionary
+
+ % We anyway need this:
+
+ \permanent\protected\def\superexplicitdiscretionary
+ {\begingroup
+ \hyphenationmode\explicithyphenationmodecode\explicitdiscretionary
+ \endgroup}
+
+ % Conceptually the best:
+
+ \aliased\let\-\explicitdiscretionary
+
+ % But we could do this to be compatible:
+
+ % \permanent\protected\def\-{\begingroup\hyphenationmode\explicithyphenationmodecode\explicitdiscretionary\endgroup}
+
+ % Or maybe even this:
+
+ % \aliased\let\lang_explicit_discretionary_nop\explicitdiscretionary
+ %
+ % \permanent\protected\def\lang_explicit_discretionary_yes-%
+ % {\superexplicitdiscretionary}
+ %
+ % \permanent\protected\def\-%
+ % {\doifelsenextcharcs-\lang_explicit_discretionary_yes\lang_explicit_discretionary_nop}
+
\popoverloadmode
\ifdefined\n \else \mutable\def\n{n} \fi \ifdefined\r \else \mutable\def\r{r} \fi
@@ -168,7 +187,6 @@
\permanent\protected\def\startluaparameterset[#1]% \stopluaparameterset
{\begingroup
- \obeylualines
\obeyluatokens
\luat_start_lua_parameter_set{#1}}
@@ -176,7 +194,7 @@
{\ctxlua{parametersets["#1"]={#2}}%
\endgroup}
-\aliased\let\stopluaparameterset\relax
+\permanent\protected\lettonothing\stopluaparameterset
\permanent\def\luaparameterset#1#2{\ctxlua{parametersets["#1"]={#2} context("#1")}}
@@ -207,7 +225,6 @@
\permanent\protected\def\ctxluacode
{\begingroup
- \obeylualines
\obeyluatokens
\catcode\leftbraceasciicode \plusone
\catcode\rightbraceasciicode\plustwo
@@ -237,7 +254,7 @@
\installsystemnamespace{ctxfunction}
\permanent\protected\def\startctxfunctiondefinition #1 % \stopctxfunctiondefinition
- {\begingroup \obeylualines \obeyluatokens \luat_start_lua_function_definition_indeed{#1}}
+ {\begingroup \obeyluatokens \luat_start_lua_function_definition_indeed{#1}}
\installsystemnamespace{luafunction}
@@ -250,15 +267,15 @@
{\expandafter\chardef\csname\??luafunction#1\endcsname#2\relax
\edefcsname#1\endcsname{\noexpand\luafunction\csname\??luafunction#1\endcsname}}
-\aliased\let\stopctxfunctiondefinition\relax
+\permanent\protected\lettonothing\stopctxfunctiondefinition
\permanent\protected\def\startctxfunction #1 % \stopctxfunction
- {\begingroup \obeylualines \obeyluatokens \luat_start_lua_function_indeed{#1}}
+ {\begingroup \obeyluatokens \luat_start_lua_function_indeed{#1}}
\def\luat_start_lua_function_indeed#1#2\stopctxfunction
{\endgroup\edefcsname\??ctxfunction#1\endcsname{\noexpand\luafunction\ctxcommand{ctxfunction(\!!bs#2\!!es)}\relax}}
-\aliased\let\stopctxfunction\relax
+\permanent\protected\lettonothing\stopctxfunction
\permanent\def\ctxfunction#1%
{\begincsname\??ctxfunction#1\endcsname}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/luat-lib.mkxl b/Master/texmf-dist/tex/context/base/mkxl/luat-lib.mkxl
index 61f9ccfd0fd..cb161cafa7c 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/luat-lib.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/luat-lib.mkxl
@@ -15,19 +15,19 @@
\registerctxluafile{util-str}{}
\registerctxluafile{util-tab}{}
-\registerctxluafile{util-fil}{optimize}
-\registerctxluafile{util-sac}{optimize}
+\registerctxluafile{util-fil}{autosuffix}
+\registerctxluafile{util-sac}{autosuffix}
\registerctxluafile{util-sto}{} % could also be done in trac-deb.mkiv
-\registerctxluafile{util-pck}{}
+\registerctxluafile{util-pck}{autosuffix}
\registerctxluafile{util-prs}{}
\registerctxluafile{util-fmt}{}
\registerctxluafile{util-dim}{}
-\registerctxluafile{trac-set}{}
+\registerctxluafile{trac-set}{autosuffix}
\registerctxluafile{luat-log}{autosuffix}
\registerctxluafile{trac-inf}{autosuffix}
\registerctxluafile{util-lua}{}
-\registerctxluafile{util-deb}{} % could also be done in trac-deb.mkiv
+\registerctxluafile{util-deb}{autosuffix}
\registerctxluafile{util-tpl}{} % needs tracker
\registerctxluafile{util-seq}{}
@@ -46,6 +46,7 @@
\registerctxluafile{util-soc-imp-tp} {}
\registerctxluafile{util-zip}{}
+\registerctxluafile{util-tar}{}
\registerctxluafile{data-ini}{}
\registerctxluafile{data-exp}{}
@@ -60,8 +61,10 @@
\registerctxluafile{data-pre}{} % after data-res
\registerctxluafile{data-bin}{} % before data-tex
\registerctxluafile{data-tex}{} % after data-pre
-\registerctxluafile{data-vir}{}
+\registerctxluafile{data-vir}{autosuffix}
\registerctxluafile{data-zip}{}
+\registerctxluafile{data-dec}{}
+\registerctxluafile{data-tar}{}
%registerctxluafile{data-crl}{}
\registerctxluafile{data-sch}{}
\registerctxluafile{data-tre}{}
@@ -72,9 +75,9 @@
\registerctxluafile{data-aux}{}
\registerctxluafile{luat-cbk}{autosuffix}
-\registerctxluafile{luat-run}{}
+\registerctxluafile{luat-run}{autosuffix}
\registerctxluafile{luat-fio}{autosuffix}
-\registerctxluafile{luat-cnf}{}
+\registerctxluafile{luat-cnf}{autosuffix,initexonly}
\registerctxluafile{luat-lua}{}
\registerctxluafile{luat-sto}{}
\registerctxluafile{luat-ini}{autosuffix}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/luat-log.lmt b/Master/texmf-dist/tex/context/base/mkxl/luat-log.lmt
index 522f4ac4ff6..0c2405b7598 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/luat-log.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/luat-log.lmt
@@ -14,7 +14,8 @@ if not modules then modules = { } end modules ['luat-log'] = {
-- mtxrun.
--
-- We use different targets: "terminal" "logfile", "both" and have no number
--- channel.
+-- channel. Actually, the log channels are now numeric (1,2,3) as with other
+-- symbolics.
local next, type, select, print = next, type, select, print
local format, gmatch, find = string.format, string.gmatch, string.find
@@ -24,8 +25,9 @@ local utfchar = utf.char
local datetime = os.date
local openfile = io.open
-local write_nl = texio.write_nl
-local write = texio.write
+local writenl = texio.writeselectornl
+local writelf = texio.writeselectorlf
+local write = texio.writeselector
local setmetatableindex = table.setmetatableindex
local formatters = string.formatters
@@ -119,14 +121,17 @@ do
status_yes = formatters["%-15s : %s\n"],
status_nop = formatters["%-15s :\n"],
},
- targets = setmetatableindex( {
- logfile = "logfile",
- log = "logfile",
- file = "logfile",
- console = "terminal",
- terminal = "terminal",
- both = "terminal_and_logfile",
- }, function(t,k) t[k] = "terminal_and_logfile" end),
+ targets = setmetatableindex( { -- 1, 2, 3,
+ logfile = 2,
+ log = 2,
+ file = 2,
+ console = 1,
+ terminal = 1,
+ both = 3,
+ },
+ function(t,k)
+ local v = 3 t[k] = v return v
+ end),
},
ansi = {
formats = {
@@ -141,14 +146,14 @@ do
status_yes = formatters["%-15s : %s\n"],
status_nop = formatters["%-15s :\n"],
},
- targets = setmetatableindex( {
+ targets = setmetatableindex( { 1, 1, 1,
logfile = false,
log = false,
file = false,
- console = "terminal",
- terminal = "terminal",
- both = "terminal",
- }, function(t,k) t[k] = "terminal" end),
+ console = 1,
+ terminal = 1,
+ both = 1,
+ }, function(t,k) local v = 1 t[k] = v return v end),
}
}
@@ -161,13 +166,14 @@ do
writer = function(...)
if target then
- write_nl(target,...)
+ writenl(target,...)
end
end
newline = function()
if target then
- write_nl(target,"\n")
+ writelf(target)
+ -- writenl(target,"")
end
end
@@ -175,13 +181,13 @@ do
if not target then
-- ignore
elseif c ~= nil then
- write_nl(target,report_yes(translations[a],formatters[formats[b]](c,...)))
+ writenl(target,report_yes(translations[a],formatters[formats[b]](c,...)))
elseif b then
- write_nl(target,report_yes(translations[a],formats[b]))
+ writenl(target,report_yes(translations[a],formats[b]))
elseif a then
- write_nl(target,report_nop(translations[a]))
+ writenl(target,report_nop(translations[a]))
else
- write_nl(target,"\n")
+ writenl(target)
end
end
@@ -203,13 +209,13 @@ do
if not target then
-- ignore
elseif c ~= nil then
- write_nl(target,subreport_yes(translations[a],translations[s],formatters[formats[b]](c,...)))
+ writenl(target,subreport_yes(translations[a],translations[s],formatters[formats[b]](c,...)))
elseif b then
- write_nl(target,subreport_yes(translations[a],translations[s],formats[b]))
+ writenl(target,subreport_yes(translations[a],translations[s],formats[b]))
elseif a then
- write_nl(target,subreport_nop(translations[a],translations[s]))
+ writenl(target,subreport_nop(translations[a],translations[s]))
else
- write_nl(target,"\n")
+ writenl(target)
end
end
@@ -231,13 +237,13 @@ do
if not target then
-- ignore
elseif c ~= nil then
- write_nl(target,status_yes(translations[a],formatters[formats[b]](c,...)))
+ writenl(target,status_yes(translations[a],formatters[formats[b]](c,...)))
elseif b then
- write_nl(target,status_yes(translations[a],formats[b]))
+ writenl(target,status_yes(translations[a],formats[b]))
elseif a then
- write_nl(target,status_nop(translations[a]))
+ writenl(target,status_nop(translations[a]))
else
- write_nl(target,"\n")
+ writenl(target)
end
end
@@ -248,7 +254,7 @@ do
whereto = "both"
target = targets[whereto]
end
- if target == "terminal" or target == "terminal_and_logfile" then
+ if target == targets.both or target == targets.terminal then
logs.flush = io.flush
else
logs.flush = ignore
@@ -277,8 +283,8 @@ do
end
setprocessor = function(f)
- local writeline = write_nl
- write_nl = function(target,...)
+ local writeline = writenl
+ writenl = function(target,...)
if target then
writeline(target,f(...))
end
@@ -620,25 +626,39 @@ if package.helpers.report then
package.helpers.report = logs.reporter("package loader") -- when used outside mtxrun
end
+-- logs.errors=missing references,missing characters
+-- logs.errors=characters
+-- logs.errors=missing
+-- logs.errors=*
+-- logs.quitonerror=missing modules
+
do
local finalactions = { }
local fatalerrors = { }
local possiblefatal = { }
+ local quitonerror = { }
local loggingerrors = false
function logs.loggingerrors()
return loggingerrors
end
- directives.register("logs.errors",function(v)
+ local function register(v)
loggingerrors = v
if type(v) == "string" then
- fatalerrors = settings_to_hash(v)
+ local target = settings_to_hash(v)
+ for k, v in next, target do
+ target[k] = string.topattern(k)
+ end
+ return target
else
- fatalerrors = { }
+ return { }
end
- end)
+ end
+
+ directives.register("logs.errors", function(v) fatalerrors = register(v) end)
+ directives.register("logs.quitonerror",function(v) quitonerror = register(v) end)
function logs.registerfinalactions(...)
insert(finalactions,...) -- so we can force an order if needed
@@ -648,6 +668,7 @@ do
local report = nil
local state = nil
local target = nil
+ local fatal = false
local function startlogging(t,r,w,s)
target = t
@@ -678,6 +699,10 @@ do
end
poptarget()
state = oldstate
+ if fatal then
+ logs.report("error logging","error marked as fatal")
+ luatex.abort()
+ end
end
function logs.startfilelogging(...)
@@ -698,6 +723,18 @@ do
end
if fatalerrors[w] then
possiblefatal[w] = true
+ else
+ for k, v in next, quitonerror do
+ if find(w,v) then
+ fatal = true
+ end
+ end
+ for k, v in next, fatalerrors do
+ if find(w,v) then
+ possiblefatal[w] = true
+ break
+ end
+ end
end
return startlogging("terminal",r,w,...)
end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/luat-run.lmt b/Master/texmf-dist/tex/context/base/mkxl/luat-run.lmt
new file mode 100644
index 00000000000..f6b2ea06368
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/luat-run.lmt
@@ -0,0 +1,306 @@
+if not modules then modules = { } end modules ['luat-run'] = {
+ version = 1.001,
+ comment = "companion to luat-lib.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local next = next
+local find = string.find
+local insert, remove = table.insert, table.remove
+local osexit = os.exit
+
+-- trace_job_status is also controlled by statistics.enable that is set via the directive system.nostatistics
+
+local trace_lua_dump = false trackers.register("system.dump", function(v) trace_lua_dump = v end)
+local trace_temp_files = false trackers.register("system.tempfiles", function(v) trace_temp_files = v end)
+local trace_job_status = true trackers.register("system.jobstatus", function(v) trace_job_status = v end)
+local trace_tex_status = false trackers.register("system.texstatus", function(v) trace_tex_status = v end)
+
+local report_lua = logs.reporter("system","lua")
+local report_tex = logs.reporter("system","status")
+local report_tempfiles = logs.reporter("resolvers","tempfiles")
+
+luatex = luatex or { }
+local luatex = luatex
+local synctex = luatex.synctex
+
+if not synctex then
+ synctex = table.setmetatableindex(function() return function() end end)
+ luatex.synctex = synctex
+end
+
+local startactions = { }
+local stopactions = { }
+local dumpactions = { }
+local pageactions = { }
+
+function luatex.registerstartactions(...) insert(startactions, ...) end
+function luatex.registerstopactions (...) insert(stopactions, ...) end
+function luatex.registerdumpactions (...) insert(dumpactions, ...) end
+function luatex.registerpageactions (...) insert(pageactions, ...) end
+
+local setexitcode = lua.setexitcode or status.setexitcode or function() end
+
+local function start_run()
+ if logs.start_run then
+ logs.start_run()
+ end
+ -- logs.report("engine","%s version %s, format id %s",LUATEXENGINE,LUATEXVERSION,LUATEXFORMATID)
+ for i=1,#startactions do
+ startactions[i]()
+ end
+end
+
+local function stop_run(badrun)
+ for i=1,#stopactions do
+ stopactions[i]()
+ end
+ local quit = logs.finalactions()
+ if trace_job_status then
+ statistics.show()
+ end
+ if trace_tex_status then
+ logs.newline()
+ for k, v in table.sortedhash(status.list()) do
+ if type(v) ~= "table" then
+ report_tex("%S=%S",k,v)
+ end
+ end
+ end
+ if quit then
+ setexitcode(1)
+ if type(quit) == "table" then
+ logs.newline()
+ report_tex("quitting due to: %, t",quit)
+ logs.newline()
+ end
+ elseif badrun and badrun > 0 then
+ setexitcode(1)
+ end
+ if logs.stop_run then
+ logs.stop_run()
+ end
+end
+
+-- watch out for synctex here:
+
+function callbacks.functions.start_page_number()
+ synctex.start()
+ logs.start_page_number()
+end
+
+function callbacks.functions.stop_page_number()
+ logs.stop_page_number()
+ for i=1,#pageactions do
+ pageactions[i]()
+ end
+ synctex.stop()
+end
+
+local function pre_dump_actions()
+ for i=1,#dumpactions do
+ dumpactions[i]()
+ end
+ lua.finalizeinitex(trace_lua_dump and report_lua or nil)
+end
+
+local function wrapup_synctex()
+ synctex.wrapup()
+end
+
+-- For Taco ...
+
+local sequencers = utilities.sequencers
+local appendgroup = sequencers.appendgroup
+local appendaction = sequencers.appendaction
+local wrapupactions = sequencers.new { }
+local cleanupactions = sequencers.new { }
+
+appendgroup(wrapupactions,"system")
+appendgroup(wrapupactions,"user")
+
+appendgroup(cleanupactions,"system")
+appendgroup(cleanupactions,"user")
+
+local function wrapup_run(someerror)
+ local runner = wrapupactions.runner
+ if runner then
+ runner(someerror) -- we could use the error flag in lmtx
+ end
+end
+
+local function cleanup_run()
+ local runner = cleanupactions.runner
+ if runner then
+ runner()
+ end
+end
+
+function luatex.wrapup(action)
+ appendaction(wrapupactions,"user",action)
+end
+
+function luatex.cleanup(action)
+ appendaction(cleanupactions,"user",action)
+end
+
+function luatex.abort()
+ cleanup_run()
+ setexitcode(1)
+ osexit(1)
+end
+
+appendaction(wrapupactions,"system",synctex.wrapup)
+
+-- this can be done later
+
+callbacks.register('start_run', start_run, "actions performed at the beginning of a run")
+callbacks.register('stop_run', stop_run, "actions performed at the end of a run")
+callbacks.register("pre_dump", pre_dump_actions, "lua related finalizers called before we dump the format") -- comes after \everydump
+callbacks.register('wrapup_run', wrapup_run, "actions performed after closing files")
+
+-- an example:
+
+local tempfiles = { }
+
+function luatex.registertempfile(name,extrasuffix,keep) -- namespace might change
+ if extrasuffix then
+ name = name .. ".mkiv-tmp" -- maybe just .tmp
+ end
+ if trace_temp_files and not tempfiles[name] then
+ if keep then
+ report_tempfiles("%s temporary file %a","registering",name)
+ else
+ report_tempfiles("%s temporary file %a","unregistering",name)
+ end
+ end
+ tempfiles[name] = keep or false
+ return name
+end
+
+function luatex.cleanuptempfiles()
+ for name, keep in next, tempfiles do
+ if not keep then
+ if trace_temp_files then
+ report_tempfiles("%s temporary file %a","removing",name)
+ end
+ os.remove(name)
+ end
+ end
+ tempfiles = { }
+end
+
+luatex.registerstopactions(luatex.cleanuptempfiles)
+
+-- Reporting filenames has been simplified since lmtx because we don't need the
+-- traditional () {} <> etc methods (read: that directive option was never chosen).
+
+local report_open = logs.reporter("open source")
+local report_close = logs.reporter("close source")
+local report_load = logs.reporter("load resource")
+
+local register = callbacks.register
+
+local level = 0
+local total = 0
+local stack = { }
+
+function luatex.currentfile()
+ return stack[#stack] or tex.jobname
+end
+
+local function report_start(name,rest)
+ if rest then
+ -- luatex
+ if name ~= 1 then
+ insert(stack,false)
+ return
+ end
+ name = rest
+ end
+ if find(name,"virtual://",1,true) then
+ insert(stack,false)
+ else
+ insert(stack,name)
+ total = total + 1
+ level = level + 1
+ -- report_open("%i > %i > %s",level,total,name or "?")
+ report_open("level %i, order %i, name %a",level,total,name or "?")
+ synctex.setfilename(name)
+ end
+end
+
+local function report_stop()
+ local name = remove(stack)
+ if name then
+ -- report_close("%i > %i > %s",level,total,name or "?")
+ report_close("level %i, order %i, name %a",level,total,name or "?")
+ level = level - 1
+ name = stack[#stack]
+-- synctex.setfilename(stack[#stack] or tex.jobname)
+ if name then
+ synctex.setfilename(name)
+ end
+ end
+end
+
+local function report_none()
+end
+
+register("start_file",report_start)
+register("stop_file", report_stop)
+
+directives.register("system.reportfiles", function(v)
+ if v then
+ register("start_file",report_start)
+ register("stop_file", report_stop)
+ else
+ register("start_file",report_none)
+ register("stop_file", report_none)
+ end
+end)
+
+-- start_run doesn't work
+
+-- luatex.registerstartactions(function()
+-- if environment.arguments.sandbox then
+-- sandbox.enable()
+-- end
+-- end)
+
+local report = logs.reporter("csname overload")
+local reported = { }
+
+callback.register("handle_overload", function(fatal,overload,csname,flags)
+ if not reported[csname] then
+ logs.newline()
+ local readstate = status.readstate
+ local filename = readstate.filename
+ local linenumber = readstate.linenumber
+ local flags = tokens.flags and tokens.flags(csname) or { }
+ if filename and linenumber then
+ report("%s, protection level %i, control sequence %a, properties '% t', file %a, line %i",
+ fatal and "fatal error" or "warning",overload,csname,flags,filename,linenumber)
+ else
+ report("%s, protection level %i, control sequence %a, properties '% t'",
+ fatal and "fatal error" or "warning",overload,csname,flags)
+ end
+ reported[csname] = true
+ logs.newline()
+ if fatal then
+ cleanup_run()
+ setexitcode(1)
+ osexit(1)
+ end
+ end
+end)
+
+-- bonus
+
+if environment.initex then
+
+ luatex.registerdumpactions(statistics.showmemory)
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/luat-usr.mkxl b/Master/texmf-dist/tex/context/base/mkxl/luat-usr.mkxl
index 199d22b8e6f..04aa520b34c 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/luat-usr.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/luat-usr.mkxl
@@ -60,7 +60,6 @@
%
\frozen\instance\protected\xdefcsname\s!start#1\s!code\endcsname
{\begingroup
- \obeylualines
\obeyluatokens
\csname\??luacode#1\endcsname}%
%
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lxml-ctx.mkxl b/Master/texmf-dist/tex/context/base/mkxl/lxml-ctx.mkxl
index f4b2edc798f..8515e618730 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lxml-ctx.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/lxml-ctx.mkxl
@@ -20,9 +20,9 @@
\unprotect
-\settrue \xmllshowbuffer
-\setfalse\xmllshowtitle
-\settrue \xmllshowwarning
+\settrue \xmllshowbuffertoo
+\setfalse\xmllshowtitletoo
+\settrue \xmllshowwarningtoo
\definehead
[lshowtitle]
@@ -35,10 +35,10 @@
\permanent\protected\def\xmllshow#1%
{\ctxlua{xml.ctx.tshow {
pattern = \!!bs\detokenize{#1}\!!es,
- \ifconditional\xmllshowtitle
+ \ifconditional\xmllshowtitletoo
title = "lshowtitle",
\fi
- \ifconditional\xmllshowwarning
+ \ifconditional\xmllshowwarningtoo
warning = true,
\fi
} }}
@@ -46,11 +46,11 @@
\permanent\protected\def\xmllshowbuffer#1#2#3%
{\ctxlua{xml.ctx.tshow {
pattern = \!!bs\detokenize{#2}\!!es,
- \ifconditional\xmllshowbuffer
+ \ifconditional\xmllshowbuffertoo
xmlroot = "#1",
attribute = "#3",
\fi
- \ifconditional\xmllshowwarning
+ \ifconditional\xmllshowwarningtoo
warning = true,
\fi
} }}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/lxml-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/lxml-ini.mkxl
index 01d0f883f96..be249c1f3bd 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/lxml-ini.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/lxml-ini.mkxl
@@ -195,6 +195,23 @@
%xmlpopdocument
\endgroup}
+% This still doesn't solve a problem with weird grouping (start inside xml and
+% end outside, so one has to do proper grouping inside xml mode).
+%
+% \def\lxml_process#1#2#3#4#5% flag \loader id name what initializersetup
+% {%\begingroup
+% \pushmacro\xmldocument
+% \edef\xmldocument{#3}% #2 can be \xmldocument and set as such
+% #2{#3}{#4}%
+% \pushcatcodetable
+% \setcatcodetable\notcatcodes
+% \doifelsenothing{#5}%
+% {\xmlsetup{#3}{xml:process}}%
+% {\xmlsetup{#3}{#5}}%
+% \popcatcodetable
+% \popmacro\xmldocument
+% }%\endgroup}
+
\permanent\protected\def\xmlprocessfile {\lxml_process\plusone \xmlload}
\permanent\protected\def\xmlprocessdata {\lxml_process\zerocount\xmlloaddata}
\permanent\protected\def\xmlprocessbuffer{\lxml_process\zerocount\xmlloadbuffer}
@@ -256,7 +273,7 @@
\doinitializeverbatim
\beginofverbatimlines}
-\aliased\let\stopxmldisplayverbatim\relax
+\permanent\protected\lettonothing\stopxmldisplayverbatim
\permanent\tolerant\protected\def\startxmlinlineverbatim[#1]%
{\begingroup
@@ -269,7 +286,7 @@
\enforced\let\stopxmlinlineverbatim\endgroup
\doinitializeverbatim}
-\aliased\let\stopxmlinlineverbatim\relax
+\permanent\protected\lettonothing\stopxmlinlineverbatim
% processing instructions
@@ -305,10 +322,10 @@
\installdirectcommandhandler \??xml {xml}
-\letvalue{\??xmldefaults\v!normal}\zerocount
-\letvalue{\??xmldefaults\v!none }\zerocount
-\letvalue{\??xmldefaults\v!text }\plusone
-\letvalue{\??xmldefaults\v!hidden}\plustwo
+\letcsname\??xmldefaults\v!normal\endcsname\zerocount
+\letcsname\??xmldefaults\v!none \endcsname\zerocount
+\letcsname\??xmldefaults\v!text \endcsname\plusone
+\letcsname\??xmldefaults\v!hidden\endcsname\plustwo
\permanent\protected\def\xmldefaulttotext
{\ifcase\xmlprocessingmode
@@ -334,7 +351,7 @@
\doif{\directxmlparameter\c!entities}\v!yes\clf_xmlloadentities
\to \everysetupxml
-\permanent\def\xmlmapvalue #1#2#3{\setvalue{\??xmlmapvalue#1:#2}{#3}} % keep #3 to grab spaces
+\permanent\def\xmlmapvalue #1#2#3{\defcsname\??xmlmapvalue#1:#2\endcsname{#3}} % keep #3 to grab spaces
\permanent\def\xmldoifelsevalue #1#2{\ifcsname\??xmlmapvalue#1:#2\endcsname\expandafter\firstoftwoarguments\else\expandafter\secondoftwoarguments\fi}
\permanent\def\xmlvalue#1#2% #3
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-acc.mklx b/Master/texmf-dist/tex/context/base/mkxl/math-acc.mklx
index 9d86566302b..6e25c413fe3 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/math-acc.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-acc.mklx
@@ -18,136 +18,149 @@
\unprotect
-% This module permits overloading of accents so that we can do fancy things. The
-% implementation is similar to stackers. By default accenst are defined in a simple
-% way. Contrary to extensibles accents cannot grow indefinitely. Alas the
-% implementation of accents is different too, in the sense that they are
-% prepositioned i.e. are already raised. (In my opinion for no real reason as they
-% need to adapt anyway).
-%
-% $ \ruledhbox{$H$} \hat{H} \ruledhbox{$\widehat{H}$} \widehat{H} $
-%
-% One alternative is:
-%
-% \definemathoverextensible [top] [hoed] ["FE302]
-% \definemathoverextensible [top] [slang] ["FE303]
-%
-% $ \hoed{H} \ruledhbox{$\hoed{H}$} \ruledhbox{$\hoed{\tf H}$} \slang{H} $
-%
-% But that nills the italic correction (and I'm in nood to mess with that again).
-%
-% \definemathaccents [myaccents] [color=darkred]
-% \definemathtopaccent [myaccents] [mywidehat] ["0302]
-%
-% $ \hat{H} \widehat{H} \mywidehat{H} $
-
+%D This module permits overloading of accents so that we can do fancy things. The
+%D implementation is similar to stackers. By default accenst are defined in a simple
+%D way. Contrary to extensibles accents cannot grow indefinitely. Alas the
+%D implementation of accents is different too, in the sense that they are
+%D prepositioned i.e. are already raised. (In my opinion for no real reason as they
+%D need to adapt anyway).
+%D
+%D In \MKIV\ we used virtual characters in the "FE* range but in \LMTX\ we do it a bit
+%D different as we have a more powerful virtual subsystem. For details on the older
+%D but neat approach see the lua and mkiv files.
+%D
%D Older implementations are kept in the \MKII\ and \MKIV\ modules for educational
%D purposes.
\installcorenamespace{mathaccents}
-\installcommandhandler \??mathaccents {mathaccents} \??mathaccents
+\installcommandhandler \??mathaccents {mathaccent} \??mathaccents
+
+\aliased\let\setupmathaccents\setupmathaccent
\setupmathaccents
[\c!top=,
\c!bottom=,
\c!mathstyle=,
\c!color=,
+ \c!stretch=\v!no,
\c!define=\v!yes] % not used
-\definemathaccents
+\definemathaccent
[\v!both]
-\definemathaccents
+\definemathaccent
[\v!top]
[\v!both]
-\definemathaccents
+\definemathaccent
[\v!bottom]
[\v!both]
\permanent\tolerant\protected\def\definemathtopaccent[#1]#*[#2]#*[#3]% class name top
{\ifparameter#3\or
- \frozen\instance\setuevalue{#2}{\math_accents_make_double {#1}\plusone{\number#3}\zerocount}%
+ \frozen\protected\instance\edefcsname#2\endcsname{\math_accent_make_double {#1}\plusone{\number#3}\zerocount}%
\else
- \frozen\instance\setuevalue{#1}{\math_accents_make_double\noexpand\currentmathaccents\plusone{\number#2}\zerocount}%
+ \frozen\protected\instance\edefcsname#1\endcsname{\math_accent_make_double\noexpand\currentmathaccent\plusone{\number#2}\zerocount}%
\fi}
\permanent\tolerant\protected\def\definemathbottomaccent[#1]#*[#2]#*[#3]% class name bottom
{\ifparameter#3\or
- \frozen\instance\setuevalue{#2}{\math_accents_make_double {#1}\plustwo\zerocount{\number#3}}%
+ \frozen\protected\instance\edefcsname#2\endcsname{\math_accent_make_double {#1}\plustwo\zerocount{\number#3}}%
\else
- \frozen\instance\setuevalue{#1}{\math_accents_make_double\noexpand\currentmathaccents\plustwo\zerocount{\number#2}}%
+ \frozen\protected\instance\edefcsname#1\endcsname{\math_accent_make_double\noexpand\currentmathaccent\plustwo\zerocount{\number#2}}%
\fi}
\permanent\tolerant\protected\def\definemathdoubleaccent[#1]#*[#2]#*[#3]#*[#4]% class name top bottom
{\ifparameter#4\or
- \frozen\instance\setuevalue{#2}{\math_accents_make_double {#1}\plusthree{\number#3}{\number#4}}%
+ \frozen\protected\instance\edefcsname#2\endcsname{\math_accent_make_double {#1}\plusthree{\number#3}{\number#4}}%
\else
- \frozen\instance\setuevalue{#1}{\math_accents_make_double\noexpand\currentmathaccents\plusthree{\number#2}{\number#3}}%
+ \frozen\protected\instance\edefcsname#1\endcsname{\math_accent_make_double\noexpand\currentmathaccent\plusthree{\number#2}{\number#3}}%
\fi}
-\let\math_accents_color_pop\donothing
-
-\def\math_accents_color_push_yes
- {\pushcolor[\p_math_accent_color]%
- \let\math_accents_color_pop\popcolor}
-
-\def\math_accents_color_push_nop
- {\let\math_accents_color_pop\donothing}
-
-\protected\def\math_accents_make_double#class#kind#top#bottom#content%
- {\begingroup
- \edef\currentmathaccents {#class}%
- \edef\p_math_accent_color{\mathaccentsparameter\c!color}%
- \startusemathstyleparameter\mathaccentsparameter
- \ifempty\p_math_accent_color
- \math_accents_color_push_nop
- \else
- \math_accents_color_push_yes
- \fi
+\installlocalcurrenthandler \??mathaccents {mathaccent}
+
+\tolerant\protected\def\math_accent_make_double#class#kind#top#bottom#*[#settings]#:#content%
+ {\beginmathgroup
+ \setlocalmathaccentcurrent{#class}% \edef\currentmathaccent{#class}%
+ \startusemathstyleparameter\mathaccentparameter\c!mathstyle
+ \setupcurrentmathaccent[#settings]%
+ \edef\m_fixed{\ifcstok{\mathaccentparameter\c!stretch}\v!yes\else\s!fixed\fi}%
+ \Umathaccent
+ \usedcolorparameterattributes{\mathaccentparameter\c!color}%
+ % nooverflow % there is never na overflow anyway but we do accept thekey
\ifcase#kind\or
- \Umathaccent \fam\zerocount#top
+ top \m_fixed
+ \fam\zerocount#top
\or
- \Umathaccent bottom \fam\zerocount#bottom
+ bottom \m_fixed
+ \fam\zerocount#bottom
\or
- \Umathaccent both \fam\zerocount#top
- \fam\zerocount#bottom
+ both \m_fixed
+ \fam\zerocount#top
+ \fam\zerocount#bottom
\fi
- {\math_accents_color_pop#content}%
+ {\ifconditional\c_math_accent_auto_dotless\mathdotless\fi#content}%
\stopusemathstyleparameter
- \endgroup}
+ \endmathgroup}
%D Relative new:
-\newconditional\c_math_accents_auto_dotless \settrue\c_math_accents_auto_dotless % cf opentype math
-
-\aliased\let\normalgrave\grave \permanent\protected\def\dotlessgrave#1{\normalgrave{\mathdotless#1}}
-\aliased\let\normalddot \ddot \permanent\protected\def\dotlessddot #1{\normalddot {\mathdotless#1}}
-\aliased\let\normalbar \bar \permanent\protected\def\dotlessbar #1{\normalbar {\mathdotless#1}}
-\aliased\let\normalacute\acute \permanent\protected\def\dotlessacute#1{\normalacute{\mathdotless#1}}
-\aliased\let\normalhat \hat \permanent\protected\def\dotlesshat #1{\normalhat {\mathdotless#1}}
-\aliased\let\normalcheck\check \permanent\protected\def\dotlesscheck#1{\normalcheck{\mathdotless#1}}
-\aliased\let\normalbreve\breve \permanent\protected\def\dotlessbreve#1{\normalbreve{\mathdotless#1}}
-\aliased\let\normaldot \dot \permanent\protected\def\dotlessdot #1{\normaldot {\mathdotless#1}}
-\aliased\let\normalring \ring \permanent\protected\def\dotlessring #1{\normalring {\mathdotless#1}}
-\aliased\let\normaltilde\tilde \permanent\protected\def\dotlesstilde#1{\normaltilde{\mathdotless#1}}
-\aliased\let\normaldddot\dddot \permanent\protected\def\dotlessdddot#1{\normaldddot{\mathdotless#1}}
-
-\def\math_accents_auto_dotless#1#2{\ifconditional\c_math_accents_auto_dotless\expandafter#2\else\expandafter#1\fi}
-
-\permanent\protected\def\grave {\math_accents_auto_dotless\normalgrave \dotlessgrave }
-\permanent\protected\def\ddot {\math_accents_auto_dotless\normalddot \dotlessddot }
-\permanent\protected\def\bar {\math_accents_auto_dotless\normalbar \dotlessbar }
-\permanent\protected\def\acute {\math_accents_auto_dotless\normalacute \dotlessacute }
-\permanent\protected\def\hat {\math_accents_auto_dotless\normalhat \dotlesshat }
-\permanent\protected\def\check {\math_accents_auto_dotless\normalcheck \dotlesscheck }
-\permanent\protected\def\breve {\math_accents_auto_dotless\normalbreve \dotlessbreve }
-\permanent\protected\def\dot {\math_accents_auto_dotless\normaldot \dotlessdot }
-\permanent\protected\def\ring {\math_accents_auto_dotless\normalring \dotlessring }
-\permanent\protected\def\tilde {\math_accents_auto_dotless\normaltilde \dotlesstilde }
-\permanent\protected\def\dddot {\math_accents_auto_dotless\normaldddot \dotlessdddot }
+\newconditional\c_math_accent_auto_dotless \settrue\c_math_accent_auto_dotless % cf opentype math
+
+% \aliased\let\normalgrave\grave
+% \aliased\let\normalddot \ddot
+% \aliased\let\normalbar \bar
+% \aliased\let\normalacute\acute
+% \aliased\let\normalhat \hat \aliased\let\normalwidehat \widehat
+% \aliased\let\normalcheck\check
+% \aliased\let\normalbreve\breve
+% \aliased\let\normaldot \dot
+% \aliased\let\normalring \ring
+% \aliased\let\normaltilde\tilde
+% \aliased\let\normaldddot\dddot
+
+\pushoverloadmode
+
+% These retain the given unicode values ... but can stretch when configured
+% to do so: \setupmathaccent[\v!top][\c!stretch=\v!yes]
+
+\definemathtopaccent[\v!top][grave]["0060] % these are old school
+\definemathtopaccent[\v!top][ddot] ["00A8]
+\definemathtopaccent[\v!top][bar] ["00AF]
+\definemathtopaccent[\v!top][acute]["00B4]
+\definemathtopaccent[\v!top][hat] ["02C6]
+\definemathtopaccent[\v!top][check]["02C7]
+\definemathtopaccent[\v!top][breve]["02D8]
+\definemathtopaccent[\v!top][dot] ["02D9]
+\definemathtopaccent[\v!top][ring] ["02DA]
+\definemathtopaccent[\v!top][tilde]["02DC]
+\definemathtopaccent[\v!top][dddot]["20DB]
+
+\definemathaccent
+ [\v!top:\v!stretch]
+ [\v!top]
+ [\c!stretch=\v!yes]
+
+%D We have a problem. We can use stackers but then we need to adapt the dimensions
+%D which is font dependent. So, for now we keep them as accents.
+
+\definemathtopaccent[\v!top:\v!stretch][widegrave]["0300] % these are generic modern
+\definemathtopaccent[\v!top:\v!stretch][wideddot] ["0308]
+\definemathtopaccent[\v!top:\v!stretch][widebar] ["0304]
+\definemathtopaccent[\v!top:\v!stretch][wideacute]["0301]
+\definemathtopaccent[\v!top:\v!stretch][widehat] ["0302]
+\definemathtopaccent[\v!top:\v!stretch][widecheck]["030C]
+\definemathtopaccent[\v!top:\v!stretch][widebreve]["0306]
+\definemathtopaccent[\v!top:\v!stretch][widedot] ["0307]
+\definemathtopaccent[\v!top:\v!stretch][widering] ["030A]
+\definemathtopaccent[\v!top:\v!stretch][widetilde]["0303]
+\definemathtopaccent[\v!top:\v!stretch][widedddot]["20DB]
+
+\definemathtopaccent[\v!top:\v!stretch][vec] ["20D7] % clumsy notation for vectors
\aliased\let\mathring\ring % for a while
+\popoverloadmode
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-act.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-act.lmt
index 9da79976484..370415c8185 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/math-act.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-act.lmt
@@ -9,24 +9,46 @@ if not modules then modules = { } end modules ['math-act'] = {
-- Here we tweak some font properties (if needed). The commented sections
-- have been removed (no longer viable) but can be found in the .lua variant.
-local type, next = type, next
-local fastcopy, insert, remove = table.fastcopy, table.insert, table.remove
+-- The tweaks here evolved from experiments with, discussions about and upgrades of
+-- the math subsystem, a project that Mikael Sundvist and I started end 2021 and
+-- that is still ongoing in 2023 (and probably beyond as we find new challenges as
+-- we go).
+
+local type, next, tonumber = type, next, tonumber
+local fastcopy, copytable, insert, remove, concat = table.fastcopy, table.copy, table.insert, table.remove, table.concat
local formatters = string.formatters
+local byte = string.byte
+local setmetatableindex, sortedkeys, sortedhash = table.setmetatableindex, table.sortedkeys, table.sortedhash
+local lpegmatch = lpeg.match
local trace_defining = false trackers.register("math.defining", function(v) trace_defining = v end)
local trace_collecting = false trackers.register("math.collecting", function(v) trace_collecting = v end)
+local trace_tweaking = false trackers.register("math.tweaks", function(v) trace_tweaking = v end)
local report_math = logs.reporter("mathematics","initializing")
+local report_mathtweak = logs.reporter("mathematics","tweak")
+
+local getfontoffamily = tex.getfontoffamily
+local texget = tex.get
+local fontcharacters = fonts.hashes.characters
+local chardata = characters.data
+local extensibles = mathematics.extensibles
local context = context
local commands = commands
local mathematics = mathematics
local texsetdimen = tex.setdimen
+local texisdimen = tex.isdimen
local abs = math.abs
+local blocks = characters.blocks
+local stepper = utilities.parsers.stepper
+
local helpers = fonts.helpers
local upcommand = helpers.commands.up
+local downcommand = helpers.commands.down
local rightcommand = helpers.commands.right
+local leftcommand = helpers.commands.left
local charcommand = helpers.commands.char
local prependcommands = helpers.prependcommands
@@ -37,6 +59,14 @@ local appendaction = sequencers.appendaction
local fontchars = fonts.hashes.characters
local fontproperties = fonts.hashes.properties
+local mathgaps = mathematics.gaps
+
+local d_scratchleftoffset = texisdimen("scratchleftoffset")
+local d_scratchrightoffset = texisdimen("scratchrightoffset")
+
+local use_math_goodies = true directives.register("math.nogoodies", function(v) use_math_goodies = not v end)
+local checkitalics = false trackers .register("math.checkitalics", function(v) checkitalics = v end)
+
local mathfontparameteractions = sequencers.new {
name = "mathparameters",
arguments = "target,original",
@@ -46,20 +76,56 @@ appendgroup("mathparameters","before") -- user
appendgroup("mathparameters","system") -- private
appendgroup("mathparameters","after" ) -- user
-function fonts.constructors.assignmathparameters(original,target)
+function fonts.constructors.assignmathparameters(original,target) -- wrong way around
local runner = mathfontparameteractions.runner
if runner then
runner(original,target)
end
end
-function mathematics.initializeparameters(target,original)
+-- we need a better reset because the following will scale
+
+local undefined <const> = 0x3FFFFFFF -- maxdimen or undefined_math_parameter
+
+function mathematics.initializeparameters(target,original,nodimensions)
local mathparameters = original.mathparameters
if mathparameters and next(mathparameters) then
- mathparameters = mathematics.dimensions(mathparameters)
- if not mathparameters.SpaceBeforeScript then
- mathparameters.SpaceBeforeScript = mathparameters.SpaceAfterScript
+ if nodimensions ~= "noscale" then
+ mathparameters = mathematics.dimensions(mathparameters)
end
+ --
+ -- if not mathparameters.MinConnectorOverlap then mathparameters.MinConnectorOverlap = undefined end
+ if not mathparameters.SubscriptShiftDownWithSuperscript then mathparameters.SubscriptShiftDownWithSuperscript = mathparameters.SubscriptShiftDown * 1.5 end
+ -- if not mathparameters.FractionDelimiterSize then mathparameters.FractionDelimiterSize = undefined end
+ -- if not mathparameters.FractionDelimiterDisplayStyleSize then mathparameters.FractionDelimiterDisplayStyleSize = undefined end
+ -- if not mathparameters.SkewedDelimiterTolerance then mathparameters.SkewedDelimiterTolerance = undefined end
+ -- some more can be undefined:
+ if not mathparameters.PrimeRaisePercent then mathparameters.PrimeRaisePercent = 0 end
+ if not mathparameters.PrimeRaiseComposedPercent then mathparameters.PrimeRaiseComposedPercent = 0 end
+ if not mathparameters.PrimeShiftUp then mathparameters.PrimeShiftUp = mathparameters.SuperscriptShiftUp end
+ if not mathparameters.PrimeBaselineDropMax then mathparameters.PrimeBaselineDropMax = mathparameters.SuperscriptBaselineDropMax end
+ if not mathparameters.PrimeShiftUpCramped then mathparameters.PrimeShiftUpCramped = mathparameters.SuperscriptShiftUpCramped end
+ if not mathparameters.PrimeSpaceAfter then mathparameters.PrimeSpaceAfter = 0 end
+ if not mathparameters.PrimeWidthPercent then mathparameters.PrimeWidthPercent = 50 end
+ if not mathparameters.SpaceBeforeScript then mathparameters.SpaceBeforeScript = mathparameters.SpaceAfterScript end
+ if not mathparameters.NoLimitSupFactor then mathparameters.NoLimitSupFactor = 0 end
+ if not mathparameters.NoLimitSubFactor then mathparameters.NoLimitSubFactor = 0 end
+ if not mathparameters.AccentTopShiftUp then mathparameters.AccentTopShiftUp = 0 end
+ if not mathparameters.AccentBottomShiftDown then mathparameters.AccentBottomShiftDown = 0 end
+ if not mathparameters.FlattenedAccentTopShiftUp then mathparameters.AccentTopShiftUp = 0 end
+ if not mathparameters.FlattenedAccentBottomShiftDown then mathparameters.AccentBottomShiftDown = 0 end
+ if not mathparameters.AccentBaseDepth then mathparameters.AccentBaseDepth = 0 end
+ if not mathparameters.AccentFlattenedBaseDepth then mathparameters.AccentFlattenedBaseDepth = 0 end
+ if not mathparameters.AccentTopOvershoot then mathparameters.AccentTopOvershoot = 0 end
+ if not mathparameters.AccentBottomOvershoot then mathparameters.AccentBottomOvershoot = 0 end
+ if not mathparameters.AccentSuperscriptDrop then mathparameters.AccentSuperscriptDrop = 0 end
+ if not mathparameters.AccentSuperscriptPercent then mathparameters.AccentSuperscriptPercent = 0 end
+ if not mathparameters.AccentExtendMargin then mathparameters.AccentExtendMargin = 50 end
+ if not mathparameters.DelimiterPercent then mathparameters.DelimiterPercent = 100 end
+ if not mathparameters.DelimiterShortfall then mathparameters.DelimiterShortfall = 0 end
+ if not mathparameters.RadicalKernAfterExtensible then mathparameters.RadicalKernAfterExtensible = 0 end
+ if not mathparameters.RadicalKernBeforeExtensible then mathparameters.RadicalKernBeforeExtensible = 0 end
+ --
target.mathparameters = mathparameters
end
end
@@ -74,182 +140,3651 @@ local how = {
RadicalDegreeBottomRaisePercent = "unscaled",
NoLimitSupFactor = "unscaled",
NoLimitSubFactor = "unscaled",
+ PrimeRaisePercent = "unscaled",
+ PrimeRaiseComposedPercent = "unscaled",
+ PrimeWidthPercent = "unscaled",
+ AccentTopOvershoot = "unscaled",
+ AccentBottomOvershoot = "unscaled",
+ AccentSuperscriptPercent = "unscaled",
+ DelimiterPercent = "unscaled",
+ --
+ RadicalRuleThickness = "vertical",
+ OverbarRuleThickness = "vertical",
+ FractionRuleThickness = "vertical",
+ UnderbarRuleThickness = "vertical",
}
+local function scaleparameters(mathparameters,parameters)
+ if mathparameters and next(mathparameters) and parameters then
+ local factor = parameters.factor
+ local hfactor = parameters.hfactor
+ local vfactor = parameters.vfactor
+ for name, value in next, mathparameters do
+ local h = how[name]
+ if h == "unscaled" then
+ -- kept
+ elseif h == "horizontal" then
+ value = value * hfactor
+ elseif h == "vertical" then
+ value = value * vfactor
+ else
+ value = value * factor
+ end
+ mathparameters[name] = value
+ end
+ end
+end
+
function mathematics.scaleparameters(target,original)
if not target.properties.math_is_scaled then
+ scaleparameters(target.mathparameters,target.parameters)
+ target.properties.math_is_scaled = true
+ end
+end
+
+-- AccentBaseHeight vs FlattenedAccentBaseHeight
+
+-- function mathematics.checkaccentbaseheight(target,original)
+-- local mathparameters = target.mathparameters
+-- if mathparameters and mathparameters.AccentBaseHeight == 0 then
+-- if trace_defining then
+-- report_math("zero AccentBaseHeight corrected %a @ %p",target.properties.fullname,target.parameters.size)
+-- end
+-- mathparameters.AccentBaseHeight = target.parameters.xheight -- needs checking
+-- end
+-- end
+
+function mathematics.overloadparameters(target,original)
+ if use_math_goodies then
local mathparameters = target.mathparameters
if mathparameters and next(mathparameters) then
- local parameters = target.parameters
- local factor = parameters.factor
- local hfactor = parameters.hfactor
- local vfactor = parameters.vfactor
- for name, value in next, mathparameters do
- local h = how[name]
- if h == "unscaled" then
- -- kept
- elseif h == "horizontal" then
- value = value * hfactor
- elseif h == "vertical"then
- value = value * vfactor
- else
- value = value * factor
+ local goodies = target.goodies
+ if goodies then
+ for i=1,#goodies do
+ local goodie = goodies[i]
+ local mathematics = goodie.mathematics
+ if mathematics then
+ local parameters = mathematics.parameters
+ local bigslots = mathematics.bigslots or mathematics.bigs
+ if parameters then
+ if trace_defining then
+ report_math("overloading math parameters in %a @ %p",target.properties.fullname,target.parameters.size)
+ end
+ for name, value in next, parameters do
+ local tvalue = type(value)
+ local oldvalue = mathparameters[name]
+ local newvalue = oldvalue
+ if tvalue == "number" then
+ newvalue = value
+ elseif tvalue == "string" then
+ -- delay till all set
+ elseif tvalue == "function" then
+ newvalue = value(oldvalue,target,original)
+ elseif not tvalue then
+ newvalue = nil
+ end
+ if trace_defining and oldvalue ~= newvalue then
+ report_math("overloading math parameter %a: %S => %S",name,oldvalue or 0,newvalue)
+ end
+ mathparameters[name] = newvalue
+ end
+ for name, value in next, parameters do
+ local tvalue = type(value)
+ if tvalue == "string" then
+ local newvalue = mathparameters[value]
+ if not newvalue then
+ local code = loadstring("return " .. value,"","t",mathparameters)
+ if type(code) == "function" then
+ local okay, v = pcall(code)
+ if okay then
+ newvalue = v
+ end
+ end
+ end
+ if newvalue then
+ -- split in number and string
+ mathparameters[name] = newvalue
+ elseif trace_defining then
+ report_math("ignoring math parameter %a: %S",name,value)
+ end
+ end
+ end
+ end
+ if bigslots then
+ target.bigslots = bigslots
+ end
+ end
end
- mathparameters[name] = value
end
end
- target.properties.math_is_scaled = true
end
end
--- AccentBaseHeight vs FlattenedAccentBaseHeight
+-- a couple of predefined tweaks:
-function mathematics.checkaccentbaseheight(target,original)
- local mathparameters = target.mathparameters
- if mathparameters and mathparameters.AccentBaseHeight == 0 then
- mathparameters.AccentBaseHeight = target.parameters.x_height -- needs checking
+local datasets = { }
+local mathtweaks = { datasets = datasets }
+mathematics.tweaks = mathtweaks
+
+-- can be a common helper:
+
+local f_u = formatters["%U"]
+
+local function unicodecharlist(t)
+ local r = { }
+ local n = 0
+ for u in sortedhash(t) do
+ n = n + 1 ; r[n] = f_u(u)
end
+ return concat(r," ")
end
-function mathematics.checkprivateparameters(target,original)
- local mathparameters = target.mathparameters
- if mathparameters then
+local function report_tweak(fmt,target,original,...)
+ if fmt then
+ local metadata = (original and original.shared.rawdata.metadata) or
+ (target and target .shared.rawdata.metadata)
local parameters = target.parameters
- local properties = target.properties
if parameters then
- local size = parameters.size
- if size then
- if not mathparameters.FractionDelimiterSize then
- mathparameters.FractionDelimiterSize = 1.01 * size
+ report_mathtweak(
+ "%a, size %P, math size %i, %s",
+ metadata and metadata.fontname or "unknown",
+ parameters.size or 655360,
+ parameters.mathsize or 1,
+ string.formatters[fmt](...)
+ )
+ else
+ print("something is wrong")
+ end
+ else
+ report_mathtweak("")
+ end
+end
+
+local function feedback_tweak(tweak,target,original,done)
+ if not done or (type(done) == "table" and not next(done)) then
+if trace_tweaking then -- for now
+ report_tweak("no need for %a",target,original,tweak)
+end
+ elseif trace_tweaking then
+ report_tweak("tweak %a applied to: %s",target,original,tweak,unicodecharlist(done))
+ end
+end
+
+mathtweaks.subsets = {
+ acenorsuvxz = { 0x1D44E, 0x1D450, 0x1D452, 0x1D45B, 0x1D45C, 0x1D45F, 0x1D460, 0x1D462, 0x1D463, 0x1D465, 0x1D467 },
+ bhklt = { 0x1D44F, 0x1D455, 0x1D458, 0x1D459, 0x1D461 },
+ d = { 0x1D451 },
+ f = { 0x1D453 },
+ gjqy = { 0x1D454, 0x1D457, 0x1D45E, 0x1D466 },
+ i = { 0x1D456 },
+ mw = { 0x1D45A, 0x1D464 },
+ p = { 0x1D45D },
+ dotless = { 0x00049, 0x0004A, 0x00131, 0x00237, 0x1D6A4, 0x1D6A5 },
+ integrals = { 0x0222B, 0x0222C, 0x0222D, 0x0222E, 0x0222F, 0x02230, 0x02231, 0x02232, 0x02233, 0x02A0B, 0x02A0C, 0x02A0D, 0x02A0E, 0x02A0F, 0x02A10, 0x02A11, 0x02A12, 0x02A13, 0x02A14, 0x02A15, 0x02A16, 0x02A17, 0x02A18, 0x02A19, 0x02A1A, 0x02A1B, 0x02A1C, 0x02320, 0x02321 },
+ horizontalfences = { 0x0203E, 0x023B4, 0x023B5, 0x023DC, 0x023DD, 0x023DE, 0x023DF, 0x023E0, 0x023E1 }, -- not really used
+}
+
+local function getalso(target,original)
+ local also = target.tweakalso -- maybe
+ if not also then
+ also = { }
+ -- for k, v in sortedhash(target.characters) do
+ for k, v in next, target.characters do
+ local u = v.unicode
+ if u and k ~= u then
+ local a = also[u]
+ if a then
+ a[#a+1] = k
+ else
+ also[u] = { k }
+ end
+ end
+ end
+ target.tweakalso = also
+ end
+ return also
+end
+
+-- {
+-- tweak = "dimensions",
+-- list = {
+-- ["lowercasegreeksansserifbolditalic"] = {
+-- -- delta = 0x003B1 - 0x1D7AA,
+-- slant = -0.2,
+-- line = 0.1,
+-- mode = 1,
+-- width = 0.675,
+-- -- scale = 0.975,
+-- squeeze = 0.975,
+-- extend = .7,
+-- },
+-- },
+-- },
+
+ -- ["0x7C.variants.*"] = { squeeze = 0.10, height = 0.10, depth = 0.10 },
+
+local detail do
+
+ local splitter = lpeg.tsplitat(".")
+
+ detail = function(characters,k)
+ if type(k) == "string" then
+ local t = lpegmatch(splitter,k)
+ local n = #t
+ if n > 0 then
+ local base = tonumber(t[1]) or tonumber(t[1],16)
+ if base then
+ local c = characters[base]
+ if c and n > 1 then
+ local list = t[2]
+ if list == "parts" then
+ local nxt = c.next
+ while nxt do
+ c = characters[nxt]
+ nxt = c.next
+ end
+ c = c.parts
+ if c then
+ local index = t[3]
+ if index == "*" then
+ return t
+ else
+ if index == "top" then
+ index = #c
+ elseif index == "bottom" then
+ index = 1
+ else
+ index = tonumber(index)
+ end
+ if index then
+ c = c[index]
+ if c then
+ return c.glyph
+ end
+ end
+ end
+ end
+ elseif list == "variants" then
+ local index = t[3]
+ if index == "*" then
+ local t = { }
+ local nxt = c.next
+ while nxt do
+ t[#t+1] = nxt
+ c = characters[nxt]
+ nxt = c.next
+ end
+ return t
+ else
+ index = tonumber(index)
+ if index then
+ local nxt = c.next
+ while nxt and index > 1 do
+ c = characters[nxt]
+ nxt = c.next
+ index = index - 1
+ end
+ return nxt
+ end
+ end
+ end
+ end
+ end
+ end
+ else
+ return k
+ end
+ end
+
+end
+
+-- This temporary tweak was used when we (MS & HH) were fixing the Latin Modern
+-- parameters that relate to script placement. We started from the original cmr
+-- ratios combined with the formal specification and ended up with the following
+-- values. In the end we rejected this tweak and setteled for checking and fixing:
+--
+-- SubscriptShiftDown
+-- SubscriptShiftDownWithSuperscript
+-- SuperscriptShiftUp
+-- SuperscriptShiftUpCramped
+--
+-- because it looks a bit arbitrary what values are set. We keep the code below
+-- as documentation.
+
+-- do
+-- -- modern
+-- --
+-- -- local factors = {
+-- -- scripts = {
+-- -- SubscriptBaselineDropMin = 0.116,
+-- -- SubscriptShiftDown = 0.348,
+-- -- SubscriptShiftDownWithSuperscript = 0.573,
+-- -- SubscriptTopMax = 0.800,
+-- -- SuperscriptBaselineDropMax = 0.896,
+-- -- SuperscriptBottomMaxWithSubscript = 0.800,
+-- -- SuperscriptBottomMin = 0.250,
+-- -- SuperscriptShiftUp = 0.958,
+-- -- SuperscriptShiftUpCramped = 0.958,
+-- -- }
+-- -- }
+--
+-- -- -- cambria
+-- --
+-- -- local factors = {
+-- -- scripts = {
+-- -- SubscriptBaselineDropMin = 0.279,
+-- -- SubscriptShiftDown = 0.364,
+-- -- SubscriptShiftDownWithSuperscript = 0.547,
+-- -- SubscriptTopMax = 0.662,
+-- -- SuperscriptBaselineDropMax = 0.401,
+-- -- SuperscriptBottomMaxWithSubscript = 0.667,
+-- -- SuperscriptBottomMin = 0.208,
+-- -- SuperscriptShiftUp = 0.654,
+-- -- SuperscriptShiftUpCramped = 0.654,
+-- -- }
+-- -- }
+--
+-- -- after some tests and inspection
+-- --
+--
+-- local factors = {
+-- scripts = {
+-- SubscriptBaselineDropMin = 0.100, -- harmless but small (seldom triggered)
+-- SubscriptShiftDown = 0.400, -- by inspection in several files
+-- SubscriptShiftDownWithSuperscript = 0.400, -- as above
+-- SubscriptTopMax = 0.800, -- Microsoft recommendation
+-- SuperscriptBaselineDropMax = 0.100, -- see SubscriptBaselineDropMin
+-- SuperscriptBottomMaxWithSubscript = 0.800, -- Microsoft recommendation
+-- SuperscriptBottomMin = 0.250, -- Microsoft recommendation
+-- SuperscriptShiftUp = 0.650, -- by inspection, but also a bit gamble
+-- SuperscriptShiftUpCramped = 0.650, -- see above, non-TeX
+-- }
+-- }
+--
+-- datasets.fixparameters = factors
+--
+-- function mathtweaks.fixparameters(target,original,parameters)
+-- local mathparameters = target.mathparameters
+-- if mathparameters and next(mathparameters) then
+-- local xheight = target.parameters.xheight
+-- -- todo : options
+-- for k, v in next, factors.scripts do
+-- mathparameters[k] = v * xheight
+-- end
+-- end
+-- end
+--
+-- end
+
+do
+
+ local stepper = utilities.parsers.stepper
+ local count = 0
+ local toeffect = fonts.toeffect
+ local privateslot = fonts.helpers.privateslot
+
+ local function adapt(list,target,original,targetcharacters,originalcharacters,k,v,compact,n)
+ k = mathgaps[k] or k
+ local character = targetcharacters[k]
+ if character then
+-- if not character.tweaked then -- todo: add a force
+ local t = type(v)
+ if t == "number" then
+ v = list[v]
+ t = type(v)
+ end
+ if t == "table" and next(v) then
+
+ local axis = tonumber(v.axis)
+ if axis then
+ axis = target.mathparameters.AxisHeight * axis
+ end
+
+ local factor = v.factor
+ if factor then
+ local m = v
+ v = setmetatableindex({
+ width = factor,
+ height = factor,
+ depth = factor,
+ squeeze = factor,
+ extend = factor,
+ }, v)
+ end
+ local originalslot = v.original
+ if not originalslot then
+ local delta = v.delta
+ if delta then
+ originalslot = k + delta
+ end
+ end
+ if originalslot then
+ originalslot = mathgaps[originalslot] or originalslot
+ local data = targetcharacters[originalslot]
+ if data then
+ data = copytable(data)
+ data.unicode = originalslot
+ targetcharacters[k] = data
+ character = data
+ else
+ report_mathtweak("no slot %U",originalslot)
+ return
+ end
+ end
+ --
+ local width = character.width
+ local height = character.height
+ local depth = character.depth
+ local italic = character.italic
+ local topanchor = character.topanchor
+ local bottomanchor = character.bottomanchor
+ --
+ local widthfactor = v.width
+ local heightfactor = v.height
+ local depthfactor = v.depth
+ local italicfactor = v.italic
+ local anchorfactor = v.anchor
+ local advancefactor = v.advance
+ local xoffsetfactor = v.xoffset
+ local yoffsetfactor = v.yoffset
+ local scalefactor = v.scale
+ local total = (height or 0) + (depth or 0)
+ if scalefactor ~= 1 then
+ character.scale = scalefactor
+ end
+ if width and width ~= 0 then
+ if advancefactor then
+ character.advance = advancefactor * width
+ else
+ character.advance = character.advance or width -- so advance is oldwidth
+ end
+ if widthfactor then
+ character.width = widthfactor * width
+ end
+ if xoffsetfactor then
+ character.xoffset = xoffsetfactor * width
+ end
+ end
+ if height and height ~= 0 then
+ if heightfactor then
+ character.height = heightfactor * height
+ end
+ end
+ if depth and depthfactor then
+ character.depth = depthfactor * depth
+ end
+ if yoffsetfactor then
+ character.yoffset = yoffsetfactor * total
+ end
+
+ if axis then
+ character.height = (character.height or 0) - axis
+ character.depth = (character.depth or 0) + axis
+ character.yoffset = (character.yoffset or 0) + axis
+ end
+
+ if italicfactor then
+ if italic then
+ character.italic = italicfactor * italic
+ elseif width and italicfactor ~= 1 then
+ character.italic = italicfactor * width
+ end
+ end
+ if anchorfactor then
+ character.topanchor = anchorfactor * (topanchor or width)
+ end
+-- if anchorfactor then
+-- character.bottomaccent = anchorfactor * (bottomanchor or width)
+-- end
+ -- begin experiment
+ local line = v.wline
+ if line then
+ local parameters = target.parameters
+ v.line = parameters.hfactor * line / parameters.units
+ end
+ -- end experiment
+ character.effect = toeffect(v) -- todo: move wline test inside here
+ -- begin experiment
+ v.line = line
+ -- end experiment
+ if trace_tweaking then
+ report_tweak("adapting dimensions of %U ",target,original,k)
+ end
+ -- missing when private
+ local originaldata = originalcharacters[k] -- or targetcharacters[k]
+ local smaller = originaldata and originaldata.smaller
+ if compact and smaller and smaller ~= k then
+ adapt(list,target,original,targetcharacters,originalcharacters,smaller,v,compact,n+1)
+ end
+ count = count + 1
+ else
+ report_mathtweak("invalid dimension entry %U",k)
+ end
+-- character.tweaked = true
+ if v.all then
+ local nxt = character.next
+ if nxt then
+ adapt(list,target,original,targetcharacters,originalcharacters,nxt,v,compact,n)
+ else
+ local parts = character.parts
+ if parts then
+ for i=1,#parts do
+ adapt(list,target,original,targetcharacters,originalcharacters,parts[i],v,compact,n)
+ end
+ end
+ end
+ end
+-- end
+ else
+ report_tweak("no character %U",target,original,k)
+ end
+ end
+
+ function mathtweaks.dimensions(target,original,parameters)
+ local list = parameters.list
+ if list then
+ local targetcharacters = target.characters
+ local originalcharacters = original.characters
+ local compact = target.parameters.textscale and true or false
+ count = 0
+ for k, v in sortedhash(list) do
+ local t = type(k)
+ if t == "number" then
+ adapt(list,target,original,targetcharacters,originalcharacters,k,v,compact,1)
+ elseif t == "string" then
+ local d = privateslot(k) or detail(targetcharacters,k) -- watch the private here
+ local t = type(d)
+ if t == "table" then
+ for i=1,#d do
+ adapt(list,target,original,targetcharacters,originalcharacters,d[i],v,compact,1)
+ end
+ elseif t == "number" then
+ adapt(list,target,original,targetcharacters,originalcharacters,d,v,compact,1)
+ elseif d then
+ -- some kind of error
+ else
+ local r = blocks[k]
+ if r then
+ local done = false
+ for i=r.first,r.last do
+ adapt(list,target,original,targetcharacters,originalcharacters,i,v,compact,1)
+ end
+ else
+ stepper(k,function(n)
+ adapt(list,target,original,targetcharacters,originalcharacters,n,v,compact,1)
+ end)
+ end
+ end
+ -- elseif t == "table" then
+ -- for i=1,#t do
+ -- adapt(list,target,original,targetcharacters,originalcharacters,t[i],v,compact,1)
+ -- end
+ end
+ end
+ if trace_tweaking and count > 0 then
+ report_mathtweak("%i dimensions adapted",count)
+ end
+ end
+ end
+
+end
+
+do
+
+ function mathtweaks.message(target,original,parameters)
+ report_mathtweak(parameters.text or "no message")
+ end
+
+ function mathtweaks.showinfo(target,original,parameters)
+ local mathparameters = target.mathparameters
+ for k, v in sortedhash(mathparameters) do
+ report_mathtweak("%s : %s",k,v)
+ end
+ end
+
+end
+
+
+do
+
+ function mathtweaks.wipevariants(target,original,parameters)
+ local list = parameters.list
+ if list then
+ local targetcharacters = target.characters
+ -- local originalcharacters = original.characters
+ local count = 0
+ -- local also = getalso(target,original)
+ local done = false
+ for k, v in sortedhash(list) do
+ local ori = targetcharacters[k]
+ local nxt = ori.next
+ local cnt = v
+ if nxt then
+ local prt = nil
+ local lst = { }
+ while nxt do
+ local chr = targetcharacters[nxt]
+ lst[#lst+1] = chr
+ nxt = chr.next
+ if not nxt then
+ prt = chr.parts
+ break
+ end
+ end
+ if prt then
+ count = count + 1
+ if cnt ~= "*" then
+ if #lst < cnt then
+ cnt = #lst
+ end
+ ori = lst[cnt]
+ end
+ ori.parts = prt
+ end
+ if not trace_tweaking then
+ done = true
+ elseif done then
+ done[k] = true
+ else
+ done = { [k] = true }
+ end
+ end
+ end
+ feedback_tweak("wipevariants",target,original,done)
+ end
+ end
+
+end
+
+do
+
+ function mathtweaks.replace(target,original,parameters)
+ local list = parameters.list
+ if list then
+ local targetcharacters = target.characters
+ local originalcharacters = original.characters
+ local unicodes = original.resources.unicodes
+ if unicodes then
+ local count = 0
+ for k, v in sortedhash(list) do
+ if type(v) == "string" then
+ v = unicodes[v]
+ end
+ if type(v) == "number" then
+ targetcharacters[mathgaps[k] or k] = targetcharacters[mathgaps[v] or v]
+ count = count + 1
+ end
+ end
+ if trace_tweaking and count > 0 then
+ report_tweak("%i permanent replacements",target,original,count)
+ end
+ end
+ end
+ end
+
+ function mathtweaks.substitute(target,original,parameters)
+ local list = parameters.list
+ if list then
+ local targetcharacters = target.characters
+ local originalcharacters = original.characters
+ local getsubstitution = fonts.handlers.otf.getsubstitution
+ local count = 0
+ for k, v in next, list do -- no need for sortedhash(list) unless we report
+ local sub = getsubstitution(original,k,v,true)
+ if sub then
+ targetcharacters[mathgaps[k] or k] = targetcharacters[mathgaps[sub] or sub]
+ count = count + 1
+ end
+ end
+ if trace_tweaking and count > 0 then
+ report_tweak("%i permanent substitutions",target,original,count)
+ end
+ end
+ end
+
+end
+
+do
+
+ -- maybe we'll have a different name
+
+ function mathtweaks.kernpairs(target,original,parameters)
+ local list = parameters.list
+ if list then
+ local targetcharacters = target.characters
+ local originalcharacters = original.characters
+ local done = false
+
+ local function add(v,n)
+ local chardata = targetcharacters[mathgaps[n] or n]
+ if chardata then
+ local width = chardata.width
+ if width then
+ local kerns = chardata.kerns or { }
+ for kk, vv in next, v do
+-- for kk, vv in sortedhash(v) do
+ stepper(kk,function(nn) -- todo: also make stepper accept a table
+ local t = mathgaps[nn] or nn
+ if t then
+ kerns[t] = vv * width
+ if not trace_tweaking then
+ done = true
+ elseif done then
+ done[t] = true
+ else
+ done = { [t] = true }
+ end
+ end
+ end)
+ end
+ chardata.kerns = kerns
+ end
+ end
+ end
+
+ for k, v in next, list do -- no need for sortedhash(list) unless we report
+ stepper(k,function(n) -- todo: also make stepper accept a table
+ add(v,n)
+ end)
+ end
+
+-- for k, v in next, list do -- no need for sortedhash(list) unless we report
+-- local chardata = targetcharacters[mathgaps[k] or k]
+-- if chardata then
+-- local width = chardata.width
+-- if width then
+-- local kerns = chardata.kerns or { }
+-- for kk, vv in next, v do
+-- local t = mathgaps[kk] or kk
+-- if t then
+-- kerns[t] = vv * width
+-- count = count + 1
+-- end
+-- end
+-- chardata.kerns = kerns
+-- end
+-- end
+-- end
+
+ feedback_tweak("kernpairs",target,original,done)
+ end
+ end
+
+end
+
+do
+
+ local nps = fonts.helpers.newprivateslot
+
+ local list = {
+ { 0x2032, nps("delimited ghost 0x2032"), 1 },
+ { 0x2033, nps("delimited ghost 0x2033"), 2, 0x2032 },
+ { 0x2034, nps("delimited ghost 0x2034"), 3, 0x2032 },
+ { 0x2057, nps("delimited ghost 0x2057"), 4, 0x2032 },
+ { 0x2035, nps("delimited ghost 0x2035"), 1 },
+ { 0x2036, nps("delimited ghost 0x2036"), 2, 0x2035 },
+ { 0x2037, nps("delimited ghost 0x2037"), 3, 0x2035 },
+ }
+
+ datasets.fixprimes = list
+
+ function mathtweaks.fixprimes(target,original,parameters)
+ local targetcharacters = target.characters
+ local factor = parameters.factor or 1
+ local fake = tonumber(parameters.fake)
+ for i=1,#list do
+ local entry = list[i]
+ local unicode = entry[1]
+ local count = entry[3]
+ local used = fonts.handlers.otf.getsubstitution(target,unicode,"ssty",true,"math","dflt") or unicode
+ local data = targetcharacters[used]
+ if data then
+ targetcharacters[unicode] = data
+ local oldheight = data.height or 0
+ local newheight = factor * oldheight
+ data.yoffset = newheight - (oldheight or 0)
+ data.height = newheight
+ data.smaller = nil
+ elseif not fake then
+ report_tweak("missing %i prime %U",target,original,count,unicode)
+ end
+ end
+ if fake then
+ for i=1,#list do
+ local entry = list[i]
+ local count = entry[3]
+ if count > 1 then
+ local unicode = entry[1]
+ local original = entry[4]
+ local data = targetcharacters[original]
+ if data then
+ local oldwidth = data.width
+ local xoffset = fake * oldwidth
+ local newwidth = oldwidth + (count - 1) * xoffset
+ targetcharacters[unicode] = {
+ width = newwidth,
+ height = data.height,
+ unicode = unicode,
+ commands = {
+ { "offset", 0, 0, original },
+ { "offset", xoffset, 0, original },
+ count > 2 and { "offset", 2 * xoffset, 0, original } or nil,
+ count > 3 and { "offset", 3 * xoffset, 0, original } or nil,
+ },
+ }
+ end
+ end
+ end
+ end
+ end
+
+ function mathtweaks.addprimed(target,original,parameters)
+ local characters = target.characters
+ for i=1,#list do
+ local entry = list[i]
+ local basecode = entry[1]
+ local movecode = entry[2]
+ local basedata = characters[basecode]
+ if basedata then
+ local baseheight = basedata.height or 0
+ local basewidth = basedata.width or 0
+ local used = baseheight
+ local total = baseheight
+ characters[movecode] = { -- todo:share
+ width = basewidth,
+ height = used,
+ unicode = basecode, -- 0xFFFD or space or so
+ -- callback = "devirtualize",
+ commands = {
+ downcommand[used],
+ { "rule", used, 0 },
+ },
+ }
+ basedata.partsorientation = "vertical"
+ basedata.parts = {
+ {
+ advance = used,
+ ["end"] = used,
+ extender = 1,
+ glyph = movecode,
+ start = used,
+ },
+ {
+ advance = total,
+ ["end"] = 0,
+ glyph = basecode,
+ start = total,
+ },
+ }
+ if trace_tweaking then
+ report_tweak("primed %U added",target,original,basecode)
+ end
+ end
+ end
+ end
+
+end
+
+do
+
+ local nps = fonts.helpers.newprivateslot
+
+ local privates = {
+ [0x2212] = nps("unary minus"),
+ [0x002B] = nps("unary plus"),
+ [0x00B1] = nps("unary plus minus"),
+ [0x2213] = nps("unary minus plus"),
+ }
+
+ -- these are the values tested with texgyre-bonum
+
+ local predefined = {
+ ["unary minus"] = {
+ original = 0x2212,
+ extend = .5,
+ width = .5,
+ unicode = 0x002D, -- hyphen minus
+ },
+ ["unary plus"] = {
+ original = 0x002B,
+ extend = .5,
+ squeeze = .5,
+ width = .5,
+ height = .5,
+ yoffset = .2,
+ mode = 2,
+ wline = .5,
+ unicode = 0x002B,
+ },
+ ["unary plus minus"] = {
+ original = 0x00B1,
+ extend = .5,
+ squeeze = .5,
+ width = .5,
+ height = .5,
+ yoffset = .2,
+ mode = 2,
+ wline = .5,
+ },
+ ["unary minus plus"] = {
+ original = 0x2213,
+ extend = .5,
+ squeeze = .5,
+ width = .5,
+ height = .5,
+ yoffset = .2,
+ mode = 2,
+ wline = .5,
+ },
+ }
+
+ -- {
+ -- tweak = "addprivates",
+ -- list = {
+ -- -- for specific parameters see act file
+ -- ["unary minus"] = { preset = "unary minus" },
+ -- ["unary plus"] = { preset = "unary plus" },
+ -- ["unary plus minus"] = { preset = "unary plus minus" },
+ -- ["unary minus plus"] = { preset = "unary minus plus" },
+ -- },
+ -- },
+
+ function mathtweaks.addprivates(target,original,parameters)
+ local list = parameters.list or predefined
+ if list then
+ local targetcharacters = target.characters
+ local targetparameters = target.parameters
+ local originalcharacters = original.characters
+ local processedprivates = { }
+ for name, v in sortedhash(list) do
+ if type(v) == "table" then
+ local preset = v.preset
+ if preset then
+ local p = predefined[preset]
+ if p then
+ v = table.combine(p,v)
+ p.preset = nil
+ else
+ goto next
+ end
+ end
+ local charslot = v.original
+ if charslot then
+ local chardata = targetcharacters[charslot]
+ if chardata then
+ local clonedata = copytable(chardata)
+ local cloneslot = nps(name)
+ local unicode = v.unicode or clonedata.unicode
+ clonedata.uncode = unicode
+ targetcharacters[cloneslot] = clonedata
+ if trace_tweaking then
+ report_tweak("cloning %a from %C into %U with tounicode %U",target,original,name,charslot,cloneslot,unicode)
+ end
+ end
+ processedprivates[name] = v
+ end
+ ::next::
+ end
+ end
+ mathtweaks.dimensions(target,original,{
+ tweak = parameters.tweak,
+ list = processedprivates,
+ })
+ end
+ end
+
+end
+
+-- do
+--
+-- function mathtweaks.fixanchors(target,original,parameters)
+-- local targetcharacters= target.characters
+-- local factor = tonumber(parameters.factor) or 0
+-- if factor ~= 0 then
+-- local done = false
+-- for k, v in next, targetcharacters do
+-- local a = v.topanchor
+-- if a and a > 0 then
+-- v.topanchor = a * factor
+-- count = count + 1
+-- if not trace_tweaking then
+-- done = true
+-- elseif done then
+-- done[u] = true
+-- else
+-- done = { [u] = true }
+-- end
+-- end
+-- end
+-- end
+-- feedback_tweak("fixanchors",target,original,done)
+-- end
+--
+-- end
+
+-- do
+--
+-- -- actually this should be a an engine feature driven by category because we don't
+-- -- want this in display mode .. only a test for MS and HH
+--
+-- local issymbol = characters.is_symbol
+--
+-- function mathtweaks.oldstylemath(target,original,parameters)
+-- local chardata = characters.data
+-- local characters = target.characters
+-- local axis = target.mathparameters.AxisHeight
+-- local delta = (parameters.factor or .1) * axis
+-- target.mathparameters.AxisHeight = (axis - delta)
+-- for k, v in sortedhash(characters) do
+-- if issymbol[k] then -- quick hack, engine knows
+-- v.yoffset = -delta
+-- v.height = (v.height or 0) - delta
+-- v.depth = (v.depth or 0) - delta
+-- end
+-- end
+-- end
+--
+-- function mathtweaks.oldstylemath(target,original,parameters)
+-- -- not relevant
+-- end
+--
+-- end
+
+do
+
+ function mathtweaks.simplifykerns(target,original,parameters)
+ local characters = target.characters
+ local done = false
+ -- for u, v in sortedhash(characters) do
+ for u, v in next, characters do
+ local mathkerns = v.mathkerns
+ if mathkerns then
+ local k = mathkerns.topleft
+ if k then
+ k = k[#k].kern
+ if k then
+ v.topleft = k
+ end
+ end
+ local k = mathkerns.topright
+ if k then
+ k = k[#k].kern
+ if k then
+ v.topright = k
+ end
+ end
+ local k = mathkerns.bottomleft
+ if k then
+ k = k[1].kern -- todo get value at baseline
+ if k then
+ v.bottomleft = k
+ end
+ end
+ local k = mathkerns.bottomright
+ if k then
+ k = k[1].kern -- todo get value at baseline
+ if k then
+ v.bottomright = k
+ end
+ end
+ v.mathkerns = nil
+ if not trace_tweaking then
+ done = true
+ elseif done then
+ done[u] = true
+ else
+ done = { [u] = true }
+ end
+ end
+ end
+ feedback_tweak("simplifykerns",target,original,done)
+ end
+
+end
+
+do
+
+ local function wipe(whatever,target,original,parameters,field,move,integrals)
+ local targetcharacters = target.characters
+ local targetdescriptions = target.descriptions
+ local factor = target.parameters.factor
+ local correct = parameters.correct
+ local done = false
+ local function getllx(u)
+ local d = targetdescriptions[u]
+ if d then
+ local b = d.boundingbox
+ if b then
+ local llx = b[1]
+ if llx < 0 then
+ return - llx
+ end
+ end
+ end
+ return false
+ end
+ local function step(s)
+ while s do
+ local u = mathgaps[s] or s
+ local c = targetcharacters[u]
+ if c then
+ if field == "topanchor" then
+ if c.topanchor then
+ c.topanchor = nil
+ else
+ goto smaller
+ end
+ else
+ local okay = false
+ local italic = c.italic
+ if move and not c.advance then -- advance check prevents double move
+ local width = c.width or 0
+ c.advance = width
+ if correct then
+ local llx = getllx(u)
+ if llx then
+ local topanchor = c.topanchor
+ llx = llx * factor
+ width = width + llx
+ c.xoffset = llx
+ if topanchor then
+ c.topanchor = topanchor + llx
+ end
+ -- too bad (schola e^x):
+ -- c.bottomleft = (c.bottomleft or 0) - llx
+ -- c.topleft = (c.topleft or 0) - llx
+ okay = true
+ end
+ end
+ if italic and italic ~= 0 then
+ c.width = width + italic
+ c.bottomright = - italic
+ okay = true
+ else
+ c.width = width
+ end
+ end
+ if italic then
+ c.italic = nil
+ okay = true
+ end
+ if okay then
+ if not trace_tweaking then
+ done = true
+ elseif done then
+ done[u] = true
+ else
+ done = { [u] = true }
+ end
+ else
+ goto smaller
+ end
+ end
+ goto smaller
+ ::smaller::
+ s = c.smaller
+ ::variants::
+ -- no italics here anyway but we could check them some day
+ else
+ break
+ end
+ end
+ end
+ local list = parameters.list -- todo: ranges
+ if list == "letters" or parameters.letters then
+ local chardata = characters.data
+ -- for k, v in sortedhash(targetcharacters) do
+ for k, v in next, targetcharacters do
+ if v.italic then
+ local d = chardata[v.unicode]
+ local c = d and d.category
+ if c == "ll" or c == "lu" then
+ step(k)
+ end
+ end
+ end
+ return
+ elseif not list or list == "all" or list == true or parameters.all then
+ list = sortedkeys(targetcharacters)
+ elseif type(list) == "string" then
+ list = { list }
+ end
+ for i=1,#list do
+ local l = list[i]
+ local t = type(l)
+ if not l then
+ -- can be false
+ elseif t == "table" then
+ for i=1,#l do
+ step(l[i])
+ end
+ elseif t == "number" then
+ step(l)
+ else
+ local r = blocks[l]
+ if r then
+ for i=r.first,r.last do
+ step(i)
+ end
+ else
+ stepper(l,step)
+ end
+ end
+ end
+ feedback_tweak(whatever,target,original,done)
+ end
+
+ function mathtweaks.wipeanchors(target,original,parameters)
+ wipe("wipeanchors",target,original,parameters,"topanchor")
+ end
+
+ function mathtweaks.wipeitalics(target,original,parameters)
+ if not checkitalics then
+ wipe("wipeitalics",target,original,parameters,"italic")
+ end
+ end
+
+ function mathtweaks.moveitalics(target,original,parameters)
+ wipe("moveitalics",target,original,parameters,"italic",true)
+ end
+
+ -- function mathtweaks.fixdigits(target,original,parameters)
+ -- mathtweaks.fixanchors(target,original,{ list = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } })
+ -- end
+
+end
+
+do
+
+ function mathtweaks.topanchors(target,original,parameters)
+ local characters = target.characters
+ local list = parameters.list
+ if list then
+ local done = false
+ for u, v in sortedhash(list) do
+ local c = characters[k]
+ if c then
+ local w = c.width
+ if w and w ~= 0 then
+ c.topanchor = v * w
+ if trace_tweaking then
+ -- todo
+ end
+ if not trace_tweaking then
+ done = true
+ elseif done then
+ done[u] = true
+ else
+ done = { [u] = true }
+ end
+ end
+ end
+ end
+ feedback_tweak("topanchors",target,original,done)
+ end
+ end
+
+ function mathtweaks.movelimits(target,original,parameters)
+ local characters = target.characters
+ local list = parameters.list
+ if list then
+ local factor = parameters.factor or 1
+ local also = getalso(target,original)
+ local done = { }
+ local function relocate(u,factor)
+ if done[u] then
+ return
+ end
+ done[u] = true
+ local c = characters[u]
+ if c then
+ local italic = c.italic
+ if italic then
+ if italic ~= 0 then
+ local width = c.width or 0
+ local half = (italic/2) * factor
+ c.topanchor = width + half
+ c.bottomanchor = width - half
+ c.bottomright = - italic * (parameters.icfactor or 1)
+ if trace_tweaking then
+ -- todo
+ end
+ end
+ c.italic = nil
+ end
+ local s = c.smaller
+ if s then
+ relocate(s,factor)
+ end
+ local n = c.next
+ if n then
+ relocate(n,factor)
+ end
+ -- Kind of tricky: we configure the engine to use the vitalic
+ -- so when we tweak we need to set that to zero.
+ local parts = c.parts
+ local italic = c.partsitalic
+ if parts and italic then
+ if italic ~= 0 then
+ local tchar = characters[parts[#parts].glyph]
+ local bchar = characters[parts[1].glyph]
+ local width = tchar.width or 0
+ local half = (italic/2) * factor
+ tchar.topanchor = width + half
+ bchar.bottomanchor = width - half
+ bchar.bottomright = - italic
+ if trace_tweaking then
+ -- todo
+ end
+ tchar.italic = nil
+ bchar.italic = nil
+ end
+ c.vitalic = nil
+ end
+ if also then
+ local a = also[u]
+ if a then
+ for i=1,#a do
+ relocate(a[i],factor)
+ end
+ end
+ end
+ end
+ end
+ if #list > 0 then
+ for i=1,#list do
+ relocate(list[i],factor)
+ end
+ else
+ for k, v in sortedhash(list) do
+ relocate(k,tonumber(v) or factor)
+ end
+ end
+ feedback_tweak("movelimits",target,original,done)
+ end
+ end
+
+end
+
+do
+
+ -- musical timestamp: March 2022, Antonio Sanches (Bad Hombre), live performance in NL
+
+ function mathtweaks.kerns(target,original,parameters)
+ local kerns = parameters.list
+ if kerns then
+ local characters = target.characters
+ local done = false
+ local function setone(uc,data)
+ local function set(unicode)
+ unicode = mathgaps[unicode] or unicode
+ local chardata = characters[unicode]
+ if chardata then
+ local width = chardata.width or 0
+ local k = data.topleft ; if k and k ~= 0 then chardata.topleft = k * width end
+ local k = data.topright ; if k and k ~= 0 then chardata.topright = k * width end
+ local k = data.bottomleft ; if k and k ~= 0 then chardata.bottomleft = k * width end
+ local k = data.bottomright ; if k and k ~= 0 then chardata.bottomright = k * width end
+ if not trace_tweaking then
+ done = true
+ elseif done then
+ done[unicode] = true
+ else
+ done = { [unicode] = true }
+ end
+ end
+ end
+ local unicode = detail(characters,uc)
+ if type(unicode) == "table" then
+ for i=1,#unicode do
+ set(unicode[i])
+ end
+ elseif unicode then
+ set(unicode)
+ end
+ end
+ for unicode, data in next, kerns do
+ setone(unicode,data) -- withscriptcode(tfmdata,unicode,data,kernone)
+ -- also smaller
+ end
+ feedback_tweak("kerns",target,original,done)
+ end
+ end
+
+end
+
+do
+
+ function mathtweaks.margins(target,original,parameters)
+ local margins = parameters.list
+ if margins then
+ local characters = target.characters
+ local done = false
+ local function setone(unicode,data)
+ unicode = mathgaps[unicode] or unicode
+ local chardata = characters[unicode]
+ if chardata then
+ local width = chardata.width or 0
+ local total = (chardata.height or 0) + (chardata.depth or 0)
+ local k = data.left ; if k and k ~= 0 then chardata.leftmargin = k * width end
+ local k = data.right ; if k and k ~= 0 then chardata.rightmargin = k * width end
+ local k = data.top ; if k and k ~= 0 then chardata.topmargin = k * total end
+ local k = data.bottom ; if k and k ~= 0 then chardata.bottommargin = k * total end
+ if not trace_tweaking then
+ done = true
+ elseif done then
+ done[unicode] = true
+ else
+ done = { [unicode] = true }
+ end
+ end
+ end
+ for unicode, data in next, margins do
+ setone(unicode,data) -- withscriptcode(tfmdata,unicode,data,kernone)
+ -- also smaller
+ end
+ feedback_tweak("margins",target,original,done)
+ end
+ end
+
+end
+
+do
+
+ -- musical timestamp: June 2022, Porcupine Tree - Rats Return
+
+ -- we can actually share these and flag them as being tweaked
+
+ local function scale(t,width,total)
+ local r = { }
+ for i=1,#t do
+ local ti = t[i]
+ local kern = ti.kern
+ local height = ti.height
+ if kern then
+ kern = width * kern
+ end
+ if height then
+ height = total * height
+ end
+ r[i] = {
+ kern = kern or 0,
+ height = height or 0,
+ }
+ end
+ return r
+ end
+
+ function mathtweaks.staircase(target,original,parameters)
+ local kerns = parameters.list
+ if kerns then
+ local characters = target.characters
+ local function kernone(unicode,data)
+ local chardata = characters[mathgaps[unicode] or unicode]
+ local total = (chardata.height or 0) + (chardata.depth or 0)
+ local width = chardata.width or 0
+ if data then
+ local tl = data.topleft ; if tl then tl = scale(tl,width,total) end
+ local tr = data.topright ; if tr then tr = scale(tr,width,total) end
+ local bl = data.bottomleft ; if bl then bl = scale(bl,width,total) end
+ local br = data.bottomright ; if br then br = scale(br,width,total) end
+ chardata.mathkerns = {
+ topleft = tl,
+ ropright = tr,
+ bottomleft = bl,
+ bottomright = br,
+ }
+ else
+ chardata.mathkerns = nil
+ end
+ end
+ for unicode, data in next, kerns do
+ kernone(unicode,data) -- withscriptcode(tfmdata,unicode,data,kernone)
+ -- also smaller
+ end
+ end
+ end
+
+end
+
+do
+
+ -- local list = {
+ -- [0x203E] = { factor = .4 }, -- overbar
+ -- [0x203E] = { factor = .7 }, -- underbar
+ -- [0x23DE] = { factor = .4 }, -- overbrace
+ -- [0x23DF] = { factor = .7 }, -- underbrace
+ -- [0x23DC] = { factor = .4 }, -- overparent
+ -- [0x23DD] = { factor = .7 }, -- underparent
+ -- [0x23B4] = { factor = .4 }, -- overbracket
+ -- [0x23B5] = { factor = .7 }, -- underbracket
+ -- }
+
+ -- We can patch the dimensions in-place or we can use additional characters in
+ -- the private namespace.
+
+ -- local addprivate = fonts.helpers.addprivate
+ -- local newnextglyph = addprivate(target,formatters["M-N-%H"](nextglyph),newnextdata)
+
+ local nps = fonts.helpers.newprivateslot
+
+ local umbracepiece = nps("um brace piece") -- will be created
+ local lmbracepiece = nps("lm brace piece") -- will be created
+ local cmbracepiece = nps("cm brace piece") -- will be created : center piece for brace builder hack
+
+ local ulbracepiece = nps("ul brace piece")
+ local urbracepiece = nps("ur brace piece")
+ local llbracepiece = nps("ll brace piece")
+ local lrbracepiece = nps("lr brace piece")
+
+ local over = { factor = "over" }
+ local under = { factor = "under" }
+
+ local candidates = {
+ over = {
+ [0x203E] = over, -- overbar
+ [0x23DE] = over, -- overbrace
+ [0x23DC] = over, -- overparent
+ [0x23B4] = over, -- overbracket
+ },
+ under = {
+ [0x23DF] = under, -- underbrace
+ [0x23DD] = under, -- underparent
+ [0x23B5] = under, -- underbracket
+ },
+ accent = {
+ [0x0300] = over, -- widegrave
+ [0x0308] = over, -- wideddot
+ [0x0304] = over, -- widebar
+ [0x0301] = over, -- wideacute
+ [0x0302] = over, -- widehat
+ [0x030C] = over, -- widecheck
+ [0x0306] = over, -- widebreve
+ [0x0307] = over, -- widedot
+ [0x030A] = over, -- widering
+ [0x0303] = over, -- widetilde
+ [0x20DB] = over, -- widedddot
+ },
+ }
+
+ datasets.accentdimensions = candidates
+
+ local function adapt(c,factor,baseheight,basedepth)
+-- if not c.tweaked then
+ local height = c.height or 0
+ local depth = c.depth or 0
+ local yoffset = 0
+ if factor == "over" then
+ local h = height - baseheight
+ yoffset = h - height
+ height = h
+ depth = depth - baseheight
+ elseif factor == "under" then
+ local d = depth - basedepth
+ yoffset = depth - d
+ depth = d
+ height = height - baseheight
+ elseif height > 0 then
+ local h = tonumber(factor) * height
+ yoffset = h - height
+ height = h
+ elseif depth > 0 then
+ local d = tonumber(factor) * depth
+ yoffset = depth - d
+ depth = d
+ end
+ c.yoffset = yoffset ~= 0 and yoffset or nil
+ c.height = height > 0 and height or nil
+ c.depth = depth > 0 and depth or nil
+-- c.tweaked = true
+-- end
+ end
+
+ local function process(target,original,characters,list,baseheight,basedepth)
+ if list then
+ for k, v in sortedhash(list) do -- sort for tracing
+ local c = characters[k]
+ if c and not c.yoffset then
+ local factor = v.factor
+ if factor then
+ adapt(c,factor,baseheight,basedepth)
+ local nc = c.next
+ local nv = 0
+ local ns = 0
+ while nc do
+ local c = characters[nc]
+ if c then
+ adapt(c,factor,baseheight,basedepth)
+ nv = nv + 1
+ nc = c.next
+ if not nc then
+ local hv = c.parts
+ if hv then
+ for i=1,#hv do
+ local c = characters[hv[i].glyph]
+ if c then
+ adapt(c,factor,baseheight,basedepth)
+ ns = ns + 1
+ end
+ end
+ end
+ break
+ end
+ else
+ break
+ end
+ end
+ if trace_tweaking then
+ report_tweak("adapting extensible (%i sizes, %i parts) %U",target,original,k,nv,ns)
+ end
+ end
+ end
+ end
+ end
+ end
+
+ function mathtweaks.accentdimensions(target,original,parameters)
+ local list = parameters.list or { "over", "under" }
+ if list then
+ local characters = target.characters
+ local baseheight = target.mathparameters.AccentBaseHeight or 0
+ local basedepth = target.mathparameters.AccentBaseDepth or 0
+ for k, v in sortedhash(list) do -- sort for tracing
+ local t = type(v)
+ if t == "string" then
+ v = candidates[v]
+ t = type(v)
+ end
+ if t == "table" then
+ process(target,original,characters,v,baseheight,basedepth)
+ end
+ end
+ end
+ end
+
+end
+
+do
+
+ local addprivate = fonts.helpers.addprivate
+ local privateslot = fonts.helpers.privateslot
+
+ -- function mathtweaks.addrules(target,original,parameters)
+ -- local characters = target.characters
+ -- local height = target.mathparameters.OverbarRuleThickness
+ -- local depth = target.mathparameters.UnderbarRuleThickness
+ -- local width = target.parameters.emwidth/2
+ -- local step = 0.8 * width
+ -- characters[0x203E] = { -- over
+ -- width = width,
+ -- height = height,
+ -- depth = 0,
+ -- unicode = 0x203E,
+ -- commands = { { "rule", height, width } },
+ -- parts = {
+ -- { advance = width, ["end"] = step, glyph = 0x203E, start = 0 },
+ -- { advance = width, ["end"] = 0, glyph = 0x203E, start = step, extender = 1 },
+ -- }
+ -- }
+ -- characters[0x0332] = { -- under
+ -- width = width,
+ -- height = 0,
+ -- depth = depth,
+ -- yoffset = -depth,
+ -- unicode = 0x0332,
+ -- commands = { { "rule", height, width } },
+ -- parts = {
+ -- { advance = width, ["end"] = step, glyph = 0x0332, start = 0 },
+ -- { advance = width, ["end"] = 0, glyph = 0x0332, start = step, extender = 1 },
+ -- }
+ -- }
+ -- end
+
+ function mathtweaks.addrules(target,original,parameters)
+ local characters = target.characters
+ local thickness = target.mathparameters.OverbarRuleThickness
+ local width = target.parameters.emwidth / 2
+ local step = 0.8 * width
+ characters[0x203E] = { -- over
+ width = width,
+ height = thickness / 2,
+ depth = thickness / 2,
+ yoffset = - thickness / 2,
+ unicode = 0x203E,
+ commands = { { "rule", thickness, width } },
+ parts = {
+ { advance = width, ["end"] = step, glyph = 0x203E, start = 0 },
+ { advance = width, ["end"] = 0, glyph = 0x203E, start = step, extender = 1 },
+ },
+ partsorientation = "horizontal",
+ }
+ --
+ characters[0x0332] = characters[0x203E]
+ --
+ -- lucida lacks them ...
+ --
+ local half = thickness / 2
+ local double = thickness * 2
+ --
+ if not characters[0x23B4] then
+ local tpiece = addprivate(target,"bracket-piece-top",{
+ width = thickness,
+ height = half,
+ depth = double,
+ yoffset = - double,
+ commands = { { "rule", thickness * 2.5, thickness } },
+ })
+ characters[0x23B4] = { -- over
+ width = width,
+ height = half,
+ depth = double,
+ unicode = 0x23B4,
+ commands = { { "rule", thickness, width } },
+ parts = {
+ { advance = thickness, glyph = tpiece, ["end"] = 0, start = half },
+ { advance = width, glyph = 0x203E, ["end"] = step, start = step, extender = 1 },
+ { advance = thickness, glyph = tpiece, ["end"] = half, start = 0 },
+ },
+ partsorientation = "horizontal",
+ }
+ end
+ if not characters[0x23B5] then
+ local bpiece = addprivate(target,"bracket-piece-bottom",{
+ width = thickness,
+ height = double,
+ depth = half,
+ yoffset = - half,
+ commands = { { "rule", thickness * 2.5, thickness } },
+ })
+ characters[0x23B5] = { -- over
+ width = width,
+ height = double,
+ depth = half,
+ unicode = 0x23B5,
+ commands = { { "rule", thickness, width } },
+ parts = {
+ { advance = thickness, glyph = bpiece, ["end"] = 0, start = half },
+ { advance = width, glyph = 0x203E, ["end"] = step, start = step, extender = 1 },
+ { advance = thickness, glyph = bpiece, ["end"] = half, start = 0 },
+ },
+ partsorientation = "horizontal",
+ }
+ end
+ --
+ end
+
+ local force = false experiments.register("math.arrows", function(v) force = v end)
+
+ local function tighten(target,unicode,left,right,squeeze,yoffset)
+ local name = string.formatters["math tightened %U %.3N %.3N %.3N %.3N"](unicode,left,right,squeeze,yoffset)
+ local slot = privateslot(target,name)
+ if not slot then
+ local characters = target.characters
+ local data = copytable(characters[unicode])
+ local width = data.width
+ data.advance = width
+ data.width = width * (1-left-right)
+ data.xoffset = width * -left
+ if squeeze ~= 1 then
+ data.effect = { squeeze = squeeze }
+ end
+ if yoffset ~= 0 then
+ data.yoffset = (data.height or 0) * yoffset
+ end
+ slot = addprivate(target,name,data)
+ end
+ return slot
+ end
+
+ local function create(target,unicode,list,overloads)
+ local characters = target.characters
+ local chardata = characters[unicode]
+ if chardata then
+ local endpoint = unicode
+ while chardata.next do
+ chardata = characters[chardata.next]
+ end
+ if chardata and (force or overloads[unicode] == false or not chardata.parts) then
+ if not list then
+ -- chardata.parts = nil -- when we test
+ chardata.parts = { { glyph = unicode } }
+ else
+ local overload = overloads[unicode]
+ local parts = { }
+ for i=1,#list do
+ local part = list[i]
+ local glyph = part.glyph or unicode
+ local check = overloads[glyph]
+ local left = (check and check.left ) or part.left or 0
+ local right = (check and check.right ) or part.right or 0
+ local squeeze = check and check.squeeze or 1
+ local yoffset = check and check.yoffset or 0
+ if left~= 0 or right ~= 0 or squeeze ~= 1 or yoffset ~= 0 then
+ glyph = tighten(target,glyph,left,right,squeeze,yoffset)
+ end
+ local width = characters[glyph].width
+ local step = width/2
+ if part.extensible then
+ parts[#parts+1] = {
+ advance = width,
+ glyph = glyph,
+ ["end"] = step,
+ start = step,
+ extender = 1,
+ }
+ else
+ parts[#parts+1] = {
+ advance = width,
+ glyph = glyph,
+ ["end"] = 0,
+ start = step,
+ }
+ end
+ end
+ if #parts == #list then
+ chardata.parts = parts
+ end
end
- if not mathparameters.FractionDelimiterDisplayStyleSize then
- mathparameters.FractionDelimiterDisplayStyleSize = 2.40 * size
+ end
+ end
+ end
+
+ -- Unicode math lacks the arrow snippet while it does have fence snippets. Also, some
+ -- fonts have a relbar that doesn't match the double arrow.
+ --
+ -- {
+ -- tweak = "addarrows",
+ -- list = { [0x3D] = { squeeze = .85, yoffset = .0975 } }
+ -- },
+ --
+ -- We have no begin and end snippet, so I played with centering and rules at the edges
+ --
+ -- [0x21A9] = { -- hookleftarrow
+ -- { glyph = 0x2212, left = slack, extensible = true },
+ -- { glyph = 0x21A9, right = slack },
+ -- { glyph = 0x2212, right = slack, extensible = true },
+ -- }
+ --
+ -- but in the end rejected it.
+
+ local function initialize(left, right, slack)
+ -- We save some space with locals. When no glyph is given the unicode itself is
+ -- used which also saves some.
+ local single = { glyph = 0x2212, left = slack, right = slack, extensible = true }
+ local double = { glyph = 0x003D, left = slack, right = slack, extensible = true }
+ local triple = { glyph = 0x2261, left = slack, right = slack, extensible = true }
+ ----- spacer = { glyph = 0x0020, left = slack, right = slack, extensible = true }
+ local slackslack = { left = slack, right = slack }
+ local leftslack = { left = left, right = slack }
+ local slackright = { left = slack, right = right }
+ ----- centered = { spacer, { }, spacer }
+ local centered = false -- the luametatex engine does this
+ local singleright = { single, slackright }
+ local leftsingle = { leftslack, single }
+ return {
+ --
+ [0x002D] = { { left = slack, right = slack, glyph = 0x2212 }, single }, -- rel
+ --
+ [0x2190] = leftsingle, -- leftarrow
+ [0x219E] = leftsingle, -- twoheadleftarrow
+ [0x21BC] = leftsingle, -- leftharpoonup
+ [0x21BD] = leftsingle, -- leftharpoondown
+ --
+ [0x2192] = singleright, -- rightarrow
+ [0x21A0] = singleright, -- twoheadrightarrow
+ [0x21C0] = singleright, -- rightharpoonup
+ [0x21C1] = singleright, -- rightharpoondown
+ --
+ [0x003D] = { slackslack, double }, -- equaltext
+ [0x2261] = { slackslack, triple }, -- triplerel
+ [0x27F8] = { leftslack, double }, -- Leftarrow
+ [0x27F9] = { double, slackright }, -- Rightarrow
+ --
+ [0x21A9] = centered, -- hookleftarrow
+ [0x21AA] = centered, -- hookrightarrow
+ [0x21CB] = centered, -- leftrightharpoons
+ [0x21CC] = centered, -- rightleftharpoons
+ [0x21C4] = centered, -- rightoverleftarrow
+ [0x21C6] = centered, -- leftoverrightarrow
+ [0x21A6] = centered, -- mapsto
+ --
+ [0x203E] = { slackslack, { left = slack, right = slack, extensible = true } }, -- bar
+ --
+ [0x27F7] = { { glyph = 0x2190, left = left, right = slack }, single, { glyph = 0x2192, left = slack, right = right } }, -- leftrightarrow rightleftarrow
+ [0x27FA] = { { glyph = 0x27F8, left = left, right = slack }, double, { glyph = 0x27F9, left = slack, right = right } }, -- Leftrightarrow Rightleftarrow
+ }
+ end
+
+ datasets.addarrows = { }
+
+ function mathtweaks.addarrows(target,original,parameters)
+ local overloads = parameters.list or { } -- { [unicode] = { left = .1, right = .1 } }
+ local left = parameters.left or 0.05
+ local right = parameters.right or 0.05
+ local slack = parameters.slack or 0.1
+ local arrows = initialize(left,right,slack)
+ -- inspect(arrows)
+ for unicode, list in sortedhash(arrows) do
+ create(target,unicode,list,overloads)
+ end
+ datasets.addarrows = sortedkeys(arrows)
+ if trace_tweaking then
+ report_tweak("arrows added",target,original)
+ end
+ end
+
+end
+
+do -- this could be combined with the previous
+
+ function mathtweaks.addparts(target,original,parameters)
+ local characters = target.characters
+ local list = parameters.list
+ if list then
+ for unicode, data in sortedhash(list) do
+ local template = data.template
+ if template then
+ local source = characters[template]
+ local target = characters[unicode]
+ if source and target then
+ local sequence = data.sequence
+ if sequence then
+ local parts = source.parts
+ if parts then
+ local p = { }
+ for i=1,#sequence do
+ local step = sequence[i]
+ local glyph = step.glyph
+ if glyph == "first" or glyph == "last" then
+ local g = glyph == "first" and 1 or #parts
+ local c = fastcopy(parts[g])
+ local f = step.factor
+ if f then
+ c["end"] = f * (c["end"] or 0)
+ c.start = f * (c.start or 0)
+ end
+ p[#p+1] = c
+ else
+ local c = characters[glyph]
+ if c then
+ p[#p+1] = {
+ glyph = glyph,
+ advance = c.width,
+ start = 0,
+ ["end"] = 0,
+ }
+ end
+ end
+ end
+ if #p > 0 then
+ target.parts = p
+ if not data.horizontal then
+ target.partsorientation = "vertical"
+ end
+ end
+ end
+ end
+ end
end
- elseif properties then
- report_math("invalid parameters in font %a",properties.fullname or "?")
+ end
+ end
+ end
+
+end
+
+function mathtweaks.action(target,original,parameters)
+ local action = parameters.action
+ if type(action) == "function" then
+ action(target,original,parameters)
+ end
+end
+
+do
+
+ local list = {
+ { 0x00A0, "s", 1 }, -- nbsp
+ { 0x2000, "q", 1/2 }, -- enquad
+ { 0x2001, "q", 1 }, -- emquad
+ { 0x2002, "q", 1/2 }, -- enspace
+ { 0x2003, "q", 1 }, -- emspace
+ { 0x2004, "q", 1/3 }, -- threeperemspace
+ { 0x2005, "q", 1/4 }, -- fourperemspace
+ { 0x2006, "q", 1/6 }, -- sixperemspace
+ { 0x2007, "c", byte('0') }, -- figurespace
+ { 0x2008, "c", byte('.') }, -- punctuationspace
+ { 0x2009, "q", 1/8 }, -- breakablethinspace
+ { 0x200A, "q", 1/8 }, -- hairspace
+ { 0x200B, "q", 0 }, -- zerowidthspace
+ { 0x202F, "q", 1/8 }, -- narrownobreakspace
+ { 0x205F, "s", 1/2 }, -- math thinspace
+ }
+
+ datasets.checkspacing = list
+
+ function mathtweaks.checkspacing(target,original,parameters)
+ local characters = target.characters
+ local parameters = target.parameters
+ for i=1,#list do
+ local entry = list[i]
+ local unicode = entry[1]
+ local data = characters[unicode]
+ if not data then
+ local method = entry[2]
+ local fraction = entry[3]
+ local width = 0
+ local height = 0
+ -- local depth = 0
+ if method == "c" then
+ local template = characters[fraction]
+ width = template.width
+ height = template.height
+ -- depth = template.depth
+ elseif method == "s" then
+ width = fraction * parameters.space -- space
+ height = 0
+ -- depth = 0
+ else
+ width = fraction * parameters.quad -- quad
+ height = 0
+ -- depth = 0
+ end
+ if trace_tweaking then
+ report_tweak("setting width of %U to %p",target,original,unicode,width)
+ end
+ characters[unicode] = {
+ width = width,
+ -- advance = width,
+ height = height,
+ -- depth = depth,
+ unicode = unicode,
+ commands = {
+ -- { "slot", 0, 32 },
+ },
+ }
+ end
+ end
+ end
+
+end
+
+do
+
+ -- mirror
+ -- smaller
+
+ local nps = fonts.helpers.newprivateslot
+
+ local radicalbarextender = nps("radical bar extender") -- we reserve it here
+
+ local list = {
+ 0x221A,
+ }
+
+ local function fix(target,original,characters,unicode)
+ local data = characters[unicode]
+ if data then
+ local height = data.height or 0
+ local depth = data.depth or 0
+ if depth > height then
+ if trace_tweaking then
+ report_tweak("swapping height and depth of radical %U",target,original,unicode)
+ end
+ data.height = depth
+ data.depth = height
+ if data.rorrim then
+ -- the original does the magic
+ else
+ data.yoffset = depth - height
+ end
+ end
+ local smaller = data.smaller
+ if smaller then
+ fix(target,original,characters,smaller)
+ end
+ local mirror = data.mirror
+ if mirror then
+ fix(target,original,characters,mirror)
+ end
+ end
+ end
+
+ function mathtweaks.fixradicals(target,original,parameters)
+ local characters = target.characters
+ for i=1,#list do
+ local unicode = list[i]
+ fix(target,original,characters,unicode)
+ end
+ end
+
+ local function fix(target,original,characters,u,l)
+ local data = characters[u]
+ if data then
+ data.innerlocation = l.location == "right" and 2 or 1
+ data.innerxoffset = (l.hfactor or 1) * (data.width or 0)
+ data.inneryoffset = (l.vfactor or 1) * ((data.height or 0) + (data.depth or 0))
+ end
+ end
+
+ function mathtweaks.radicaldegreeanchors(target,original,parameters)
+ local list = parameters.list
+ if list then
+ local characters = target.characters
+ for unicode, l in sortedhash(list) do -- resolve variants
+ local u = detail(characters,unicode) or unicode
+ if type(u) == "table" then
+ for i=1,#u do
+ fix(target,original,characters,u[i],l)
+ end
+ else
+ fix(target,original,characters,u,l)
+ end
+ end
+ end
+ end
+
+end
+
+do
+
+ local done = nil
+
+ local function fix(target,original,characters,unicode,axis)
+ if done[unicode] then
+ return
+ end
+ done[unicode] = true
+ local data = characters[unicode]
+ if data then
+ local height = data.height or 0
+ local depth = data.depth or 0
+ if trace_tweaking then
+ report_tweak("swapping height and depth of %U",target,original,unicode)
+ end
+ local half = (height + depth)/2
+ if data.rorrim then
+ -- the original does the magic
else
- report_math("invalid parameters in font")
+ data.yoffset = depth - (half - axis)
+ end
+ height = half + axis
+ depth = half - axis
+ data.height = height
+ data.depth = depth
+ local smaller = data.smaller
+ if smaller then
+ fix(target,original,characters,smaller,axis)
+ end
+ local mirror = data.mirror
+ if mirror then
+ fix(target,original,characters,mirror,axis)
+ end
+ local next = data.next
+ if next then
+ fix(target,original,characters,next,axis)
+ end
+ end
+ end
+
+ function mathtweaks.fixoldschool(target,original,parameters)
+ local characters = target.characters
+ local list = mathtweaks.subsets.integrals
+ local also = getalso(target,original)
+ local axis = target.mathparameters.AxisHeight
+ done = { }
+ for i=1,#list do
+ local unicode = list[i]
+ fix(target,original,characters,unicode,axis)
+ end
+ if also then
+ local a = also[u]
+ if a then
+ for i=1,#a do
+ fix(target,original,characters,a[i],axis)
+ end
+ end
+ end
+ done = nil
+ end
+
+ -- After the next one I rewarded myself by (again) watching Joe Parrish interpretation
+ -- of Shostakovich 10 Mvmt. II - Metal several times (video on yt, track on bandcamp)
+ -- ... timestamp: awaiting the new Albion (Official) single; their work comes in parts.
+
+ function mathtweaks.fixintegrals(target,original,parameters)
+ local characters = target.characters
+ local integral = characters[0x222B]
+ if integral and not integral.parts then
+ local top = characters[0x2320]
+ local mid = characters[0x23AE]
+ local bot = characters[0x2321]
+ if top and mid and bot then
+ top = top.height
+ mid = mid.height
+ bot = bot.height
+ integral.partsitalic = integral.italic
+ integral.parts = {
+ { advance = bot, ["end"] = bot/3, glyph = 0x2321, start = bot/3 },
+ { advance = mid, ["end"] = mid/2, glyph = 0x23AE, start = mid/2, extender = 1 },
+ { advance = top, ["end"] = top/3, glyph = 0x2320, start = top/3 },
+ }
+ integral.partsorientation = "vertical"
+ if trace_tweaking then
+ report_tweak("fixing the integral extensible",target,original)
+ end
end
- elseif properties then
- report_math("no parameters in font %a",properties.fullname or "?")
else
- report_math("no parameters and properties in font")
+ report_tweak("no need to fix the integral extensible",target,original)
end
end
+
end
-function mathematics.overloadparameters(target,original)
- local mathparameters = target.mathparameters
- if mathparameters and next(mathparameters) then
- local goodies = target.goodies
- if goodies then
- for i=1,#goodies do
- local goodie = goodies[i]
- local mathematics = goodie.mathematics
- local parameters = mathematics and mathematics.parameters
- if parameters then
- if trace_defining then
- report_math("overloading math parameters in %a @ %p",target.properties.fullname,target.parameters.size)
- end
- for name, value in next, parameters do
- local tvalue = type(value)
- if tvalue == "string" then
- report_math("comment for math parameter %a: %s",name,value)
+do
+
+ local list = { 0x2061, 0x2062, 0x2063, 0x2064 }
+
+ datasets.wipecues = list
+
+ function mathtweaks.wipecues(target,original,parameters)
+ local characters = target.characters
+ local tobewiped = parameters.list or list
+ local done = false
+ for i=1,#tobewiped do
+ local unicode = tobewiped[i]
+ characters[unicode] = {
+ width = 0,
+ height = 0,
+ depth = 0,
+ unicode = unicode,
+ }
+ if not trace_tweaking then
+ done = true
+ elseif done then
+ done[unicode] = true
+ else
+ done = { [unicode] = true }
+ end
+ end
+ feedback_tweak("wipecues",target,original,done)
+ end
+
+end
+
+do
+
+ local mapping = {
+ [0x002F] = 0x2044,
+ }
+
+ datasets.fixslashes = mapping
+
+ function mathtweaks.fixslashes(target,original,parameters)
+ local characters = target.characters
+ -- local done = false
+ for normal, weird in sortedhash(mapping) do
+ local normalone = characters[normal]
+ local weirdone = characters[weird]
+ if normalone and weirdone and not normalone.next then
+ normalone.next = weirdone.next
+ -- if not trace_tweaking then
+ -- done = true
+ -- elseif done then
+ -- done[normal] = true
+ -- else
+ -- done = { [normal] = true }
+ -- end
+ end
+ weirdone = copytable(normalone)
+ characters[weird] = weirdone
+ weirdone.unicode = weird
+ end
+ -- feedback_tweak("fixslashes",target,original,done)
+ if trace_tweaking then
+ report_tweak("slashes fixed",target,original)
+ end
+ end
+
+end
+
+do -- see pagella for an extensive example
+
+ local nps = fonts.helpers.newprivateslot
+
+ local mapping = {
+ [0x0300] = { 0x0060, false, nps("flat 0x0060 1") },
+ [0x0308] = { 0x00A8, false, nps("flat 0x00A8 1") },
+ [0x0304] = { 0x00AF, false, nps("flat 0x00AF 1") },
+ [0x0301] = { 0x00B4, false, nps("flat 0x00B4 1") },
+ [0x0302] = { 0x02C6, true, nps("flat 0x02C6 1") },
+ [0x030C] = { 0x02C7, true, nps("flat 0x02C7 1") },
+ [0x0306] = { 0x02D8, false, nps("flat 0x02D8 1") },
+ [0x0307] = { 0x02D9, false, nps("flat 0x02D9 1") },
+ [0x030A] = { 0x02DA, false, nps("flat 0x02DA 1") },
+ [0x0303] = { 0x02DC, true, nps("flat 0x02DC 1") },
+ [0x20DB] = { 0x20DB, false, nps("flat 0x20DB 1") },
+ }
+
+ datasets.fixaccents = mapping
+ datasets.extendaccents = mapping
+ datasets.flattenaccents = mapping
+ datasets.copyaccents = mapping
+
+ function mathtweaks.fixaccents(target,original,parameters)
+ local characters = target.characters
+ local done = false
+ for stretching, entry in sortedhash(mapping) do
+ local alias = entry[1]
+ local stretchingdata = characters[stretching]
+ if stretchingdata and stretchingdata.width == 0 then
+ local topanchor = stretchingdata.topanchor or 0
+ local width = -topanchor
+ topanchor = width/2
+ stretchingdata.width = width
+ stretchingdata.advance = 0
+ stretchingdata.topanchor = topanchor
+ stretchingdata.commands = { rightcommand[width + topanchor], charcommand[stretching] }
+ if not trace_tweaking then
+ done = true
+ elseif done then
+ done[stretching] = true
+ else
+ done = { [stretching] = true }
+ end
+ end
+ end
+ feedback_tweak("fixaccents",target,original,done)
+ end
+
+ -- all true|number false
+
+ function mathtweaks.extendaccents(target,original,parameters)
+ local characters = target.characters
+ local all = parameters.all
+ local count = tonumber(all)
+ local done = false
+ for stretching, entry in sortedhash(mapping) do
+ local extend = entry[2]
+ if extend then
+ local last = characters[stretching]
+ local cnt = 1
+ local okay = false
+ while last do
+ if all or (count and cnt > count) then
+ last.extensible = true
+ local flataccent = last.flataccent
+ if flataccent then
+ characters[flataccent].extensible = true
+ okay = true
+ end
+ end
+ local n = last.next
+ if n then
+ last = characters[n]
+ else
+ last.extensible = true
+ local flataccent = last.flataccent
+ if flataccent then
+ characters[flataccent].extensible = true
+ okay = true
+ end
+ break
+ end
+ cnt = cnt + 1
+ end
+ if okay then
+ if not trace_tweaking then
+ done = true
+ elseif done then
+ done[stretching] = true
+ else
+ done = { [stretching] = true }
+ end
+ end
+ end
+ end
+ feedback_tweak("extendaccents",target,original,done)
+ end
+
+ -- force true false
+ -- height factor 0.8
+ -- offset factor 0.9|calculated
+ -- squeeze factor 0.1|calculated
+
+ function mathtweaks.flattenaccents(target,original,parameters)
+ local characters = target.characters
+ local force = parameters.force
+ local squeeze = parameters.squeeze or 0.8
+ local ofactor = parameters.offset or (squeeze/2)
+ local hfactor = parameters.height or (1 - ofactor)
+ local done = false
+ for stretching, entry in sortedhash(mapping) do
+ local last = characters[stretching]
+ while last do
+ if force or not last.flataccent then
+ local slot = entry[3]
+ local data = copytable(last)
+ local height = data.height or 0
+ data.effect = { squeeze = squeeze }
+ data.height = hfactor * height
+ data.yoffset = ofactor * height
+ characters[slot] = data
+ last.flataccent = slot
+ if not trace_tweaking then
+ done = true
+ elseif done then
+ done[stretching] = true
+ else
+ done = { [stretching] = true }
+ end
+ end
+ local n = last.next
+ if n then
+ last = characters[n]
+ else
+ break
+ end
+ end
+ end
+ feedback_tweak("flattenaccents",target,original,done)
+ end
+
+ function mathtweaks.copyaccents(target,original,parameters)
+ local characters = target.characters
+ local done = false
+ for stretching, entry in sortedhash(mapping) do
+ local alias = entry[1]
+ if alias ~= stretching then
+ local stretchingdata = characters[stretching]
+ if stretchingdata then
+ -- we need to nil [x|y]offsets
+ characters[alias] = {
+ width = stretchingdata.width,
+ height = stretchingdata.height,
+ depth = stretchingdata.depth,
+ next = stretchingdata.next,
+ commands = { charcommand[stretching] },
+ topanchor = stretchingdata.topanchor,
+ -- unicode = stretching, -- when we alias to combiners
+ unicode = alias, -- when we keep the original
+ }
+ if not trace_tweaking then
+ done = true
+ elseif done then
+ done[stretching] = true
+ else
+ done = { [stretching] = true }
+ end
+ end
+ end
+ end
+ feedback_tweak("copyaccents",target,original,done)
+ end
+
+end
+
+do
+
+ local single <const> = 0x003D
+ local double <const> = 0x2A75
+ local triple <const> = 0x2A76
+
+ function mathtweaks.addequals(target,original,parameters)
+ local characters = target.characters
+ local basechar = characters[single]
+ local width = basechar.width
+ local height = basechar.height
+ local depth = basechar.depth
+ local advance = (parameters.advance or 1/20) * width
+ local char = charcommand[single]
+ local left = leftcommand[advance]
+ characters[double] = {
+ unicode = double,
+ width = 2*width - 1*advance,
+ height = height,
+ depth = depth,
+-- callback = "devirtualize",
+ commands = { char, left, char },
+ }
+ characters[triple] = {
+ unicode = triple,
+ width = 3*width - 2*advance,
+ height = height,
+ depth = depth,
+-- callback = "devirtualize",
+ commands = { char, left, char, left, char },
+ }
+ if trace_tweaking then
+ report_tweak("double %U and triple %U equals added",target,original,double,triple)
+ end
+ end
+
+end
+
+do
+
+ -- If we really want, we can have variants that also match radicals but in practice
+ -- radicals and actuarians are never seen together. We could also have a smaller
+ -- extender.
+
+ local nps = fonts.helpers.newprivateslot
+
+ local radical <const> = 0x0221A
+ local actuarian <const> = nps("delimited right annuity") -- 0x020E7
+ local nairautca <const> = nps("delimited left annuity" )
+ local placehold <const> = nps("delimited ghost annuity")
+
+ function mathtweaks.addactuarian(target,original,parameters)
+ local characters = target.characters
+ local parameters = target.parameters
+ local linewidth = target.MathConstants.RadicalRuleThickness -- make option
+ local basechar = characters[radical]
+ local baseheight = (basechar.height or 0)/2
+ local basedepth = (basechar.depth or 0)/2
+ local basetotal = baseheight + basedepth
+ local used = baseheight
+ --
+ characters[0x020E7] = {
+ width = 6*linewidth,
+ height = baseheight,
+ depth = basedepth,
+ unicode = actuarian,
+ callback = "devirtualize",
+ commands = {
+ upcommand[baseheight-4*linewidth],
+ { "rule", linewidth, 4*linewidth },
+ downcommand[basetotal/2-linewidth],
+ { "rule", basetotal/2, linewidth },
+ },
+ }
+ --
+ characters[actuarian] = {
+ width = 2*linewidth,
+ height = baseheight,
+ depth = basedepth,
+ unicode = actuarian,
+ callback = "devirtualize",
+ commands = {
+ downcommand[basedepth],
+ { "rule", basetotal, linewidth },
+ },
+ parts = {
+ {
+ advance = basetotal,
+ ["end"] = used,
+ glyph = actuarian,
+ start = 0,
+ },
+ {
+ advance = basetotal,
+ ["end"] = 0,
+ extender = 1,
+ glyph = actuarian,
+ start = used,
+ },
+ }
+ }
+ characters[placehold] = {
+ width = 2*linewidth,
+ height = baseheight,
+ depth = basedepth,
+ unicode = actuarian, -- whatever
+ callback = "devirtualize",
+ commands = {
+ rightcommand[linewidth],
+ downcommand[basedepth],
+ { "rule", basetotal, 0 },
+ },
+ }
+ characters[nairautca] = {
+ width = 2*linewidth,
+ height = baseheight,
+ depth = basedepth,
+ unicode = actuarian, -- whatever
+ callback = "devirtualize",
+ -- commands = {
+ -- rightcommand[linewidth],
+ -- downcommand[basedepth],
+ -- { "rule", basetotal, linewidth },
+ -- },
+ commands = {
+ rightcommand[linewidth],
+ upcommand[baseheight-4*linewidth],
+ { "rule", 4*linewidth, linewidth },
+ },
+ parts = {
+ {
+ advance = basetotal,
+ ["end"] = used,
+ extender = 1,
+ glyph = placehold,
+ start = 0,
+ },
+ {
+ advance = basetotal,
+ ["end"] = 0,
+ glyph = nairautca,
+ start = used,
+ },
+ }
+ }
+ if trace_tweaking then
+ report_tweak("actuarian %U added",target,original,actuarian)
+ end
+ end
+
+end
+
+do
+
+ -- todo: make callback because we can delay it but then we need to stack
+ -- callbacks
+
+ local nps = fonts.helpers.newprivateslot
+
+ local list = {
+ -- { 0x0300, nps("delimited right grave"), nps("delimited ghost grave") },
+ { 0x0308, nps("delimited right ddot"), nps("delimited ghost ddot") },
+ { 0x0304, nps("delimited right bar"), nps("delimited ghost bar") },
+ -- { 0x0301, nps("delimited right acute"), nps("delimited ghost acute") },
+ { 0x0302, nps("delimited right hat"), nps("delimited ghost hat") },
+ { 0x030C, nps("delimited right check"), nps("delimited ghost check") },
+ { 0x0306, nps("delimited right breve"), nps("delimited ghost breve") },
+ { 0x0307, nps("delimited right dot"), nps("delimited ghost dot") },
+ { 0x030A, nps("delimited right ring"), nps("delimited ghost ring") },
+ { 0x0303, nps("delimited right tilde"), nps("delimited ghost tilde") },
+ { 0x20DB, nps("delimited right dddot"), nps("delimited ghost dddot") },
+ { 0x2020, nps("delimited right dagger"), nps("delimited ghost dagger") },
+ { 0x2021, nps("delimited right ddagger"), nps("delimited ghost ddagger") },
+ { 0x2217, nps("delimited right ast"), nps("delimited ghost ast") },
+ { 0x22C6, nps("delimited right star"), nps("delimited ghost star") },
+
+ { 0x231C, nps("delimited left upper corner"), nps("delimited ghost upper corner") },
+ { 0x231D, nps("delimited right upper corner"), nps("delimited ghost upper corner") },
+ { 0x231E, nps("delimited left lower corner"), nps("delimited ghost lower corner"), true },
+ { 0x231F, nps("delimited right lower corner"), nps("delimited ghost lower corner"), true },
+ }
+
+ function mathtweaks.addfourier(target,original,parameters)
+ local characters = target.characters
+ for i=1,#list do
+ local entry = list[i]
+ local basecode = entry[1]
+ local fouriercode = entry[2]
+ local movecode = entry[3]
+ local reverse = entry[4]
+ local basechar = characters[basecode]
+ if basechar then
+ local scale = parameters.scale or 1
+ local variant = parameters.variant
+ if variant then
+ for i=1,variant do
+ local okay = basechar.next
+ if okay then
+ basecode = okay
+ basechar = characters[basecode]
else
- local oldvalue = mathparameters[name]
- local newvalue = oldvalue
- if oldvalue then
- if tvalue == "number" then
- newvalue = value
- elseif tvalue == "function" then
- newvalue = value(oldvalue,target,original)
- elseif not tvalue then
- newvalue = nil
+ break
+ end
+ end
+ end
+ local baseheight = scale * (basechar.height or 0)
+ local basedepth = scale * (basechar.depth or 0)
+ local basewidth = scale * (basechar.width or 0)
+ local used = baseheight/2
+ local total = baseheight + basedepth
+if reverse then
+ used = total / 2 -- basedepth / 2
+end
+ characters[movecode] = {
+ width = basewidth,
+ height = used,
+ unicode = basecode,
+ -- callback = "devirtualize",
+ commands = {
+ downcommand[used],
+ { "rule", used, 0 },
+ },
+ }
+ local parts = {
+ {
+ advance = used,
+ ["end"] = used,
+ extender = 1,
+ glyph = movecode,
+ start = used,
+ },
+ {
+ advance = total,
+ ["end"] = 0,
+ glyph = fouriercode,
+ start = total,
+ },
+ }
+ if reverse then
+ parts[1], parts[2] = parts[2], parts[1]
+ end
+ characters[fouriercode] = {
+ width = basewidth,
+ height = baseheight,
+ depth = basedepth,
+ unicode = basecode,
+ -- callback = "devirtualize",
+ commands = {
+ scale == 1 and charcommand[basecode] or { "slot", 0, basecode, scale, scale },
+ },
+ partsorientation = "vertical",
+ parts = parts,
+ }
+ if trace_tweaking then
+ report_tweak("fourier %U added using %U",target,original,basecode,fouriercode)
+ end
+ end
+ end
+ end
+
+end
+
+do
+
+ -- \im{\left\Uchar"007C \frac{1}{2} \right\Uchar"007C}
+ -- \im{\left\Uchar"2016 \frac{1}{2} \right\Uchar"2016}
+ -- \im{\left\Uchar"2980 \frac{1}{2} \right\Uchar"2980}
+
+ local single <const> = 0x007C
+ local double <const> = 0x2016
+ local triple <const> = 0x2980
+
+ -- local nps = fonts.helpers.newprivateslot
+ --
+ -- local function variantlist(characters,unicode,chardata,what,total,used)
+ -- local parenthesis = characters[0x28].next
+ -- local width = chardata.width
+ -- local height = chardata.height
+ -- local depth = chardata.depth
+ -- local total = height + depth
+ -- local count = 1
+ -- while parenthesis do
+ -- local private = nps(what .. " size " .. count)
+ -- local pardata = characters[parenthesis]
+ -- local parheight = pardata.height
+ -- local pardepth = pardata.depth
+ -- local scale = (parheight+pardepth)/total
+ -- local offset = - pardepth + scale * depth
+ -- chardata.next = private
+ -- chardata = {
+ -- unicode = unicode,
+ -- width = width,
+ -- height = parheight,
+ -- depth = pardepth,
+ -- commands = {
+ -- { "offset", 0, offset, unicode, 1, scale }
+ -- },
+ -- }
+ -- characters[private] = chardata
+ -- parenthesis = pardata.next
+ -- if paranthesis then
+ -- pardata = characters[parenthesis]
+ -- end
+ -- count = count + 1
+ -- end
+ -- chardata.parts = {
+ -- {
+ -- advance = total,
+ -- ["end"] = used,
+ -- glyph = unicode,
+ -- start = 0,
+ -- -- start = used/5,
+ -- },
+ -- {
+ -- advance = total,
+ -- -- ["end"] = 0,
+ -- ["end"] = used/5, -- prevents small gap with inward curved endpoints
+ -- extender = 1,
+ -- glyph = unicode,
+ -- start = used,
+ -- },
+ -- }
+ -- chardata.partsorientation = "vertical"
+ -- end
+
+ local function variantlist(unicode,chardata,total,used)
+ chardata.varianttemplate = 0x0028
+ chardata.parts = {
+ {
+ advance = total,
+ ["end"] = used,
+ glyph = unicode,
+ start = 0,
+ -- start = used/5,
+ },
+ {
+ advance = total,
+ -- ["end"] = 0,
+ ["end"] = used/5, -- prevents small gap with inward curved endpoints
+ extender = 1,
+ glyph = unicode,
+ start = used,
+ },
+ }
+ chardata.partsorientation = "vertical"
+ end
+
+ function mathtweaks.addbars(target,original,parameters)
+ local characters = target.characters
+ local basechar = characters[single]
+ local width = basechar.width
+ local height = basechar.height
+ local depth = basechar.depth
+ local advance = (parameters.advance or 1/10) * width
+ local used = 1.2*height -- large overlap because no smaller pieces
+ local total = height + depth
+ --
+ -- variantlist(characters,single,basechar,"single bar",total,used)
+ variantlist(single,basechar,total,used)
+ --
+ basechar = {
+ unicode = double,
+ width = 2*width - 1*advance,
+ height = height,
+ depth = depth,
+-- callback = "devirtualize",
+ commands = {
+ charcommand[single],
+ leftcommand[advance],
+ charcommand[single],
+ },
+ }
+ characters[double] = basechar
+ -- variantlist(characters,double,basechar,"double bar",total,used)
+ variantlist(double,basechar,total,used)
+ --
+ basechar = {
+ unicode = triple,
+ width = 3*width - 2*advance,
+ height = height,
+ depth = depth,
+-- callback = "devirtualize",
+ commands = {
+ charcommand[single],
+ leftcommand[advance],
+ charcommand[single],
+ leftcommand[advance],
+ charcommand[single],
+ },
+ }
+ characters[triple] = basechar
+ -- variantlist(characters,triple,basechar,"triple bar",total,used)
+ variantlist(triple,basechar,total,used)
+ --
+ if trace_tweaking then
+ report_tweak("single, double and triple bars added",target,original)
+ end
+ end
+
+end
+
+do
+
+ -- lucida: \im{\cdot \ldot \cdots \ldots}
+
+ local snormal <const> = 0x002E
+ local sraised <const> = 0x22C5
+
+ local tnormal <const> = 0x2026
+ local traised <const> = 0x22EF
+
+ function mathtweaks.fixellipses(target,original,parameters)
+ local characters = target.characters
+ local function fix(normal,raised)
+ local normaldata = characters[normal]
+ if normaldata then
+ local raiseddata = copytable(normaldata)
+ characters[raised] = raiseddata
+ raiseddata.unicode = raised
+ local height = raiseddata.height
+ local yoffset = (parameters.yoffset or 2) * height
+ raiseddata.yoffset = yoffset
+ raiseddata.height = height + yoffset
+ if trace_tweaking then
+ report_tweak("taking %U from %U",target,original,raised,normal)
+ end
+ end
+ end
+ fix(snormal,sraised)
+ fix(tnormal,traised)
+ end
+
+end
+
+do
+
+ -- For Ton, who needs the high minus and plus for calculator signs in Dutch
+ -- school math books.
+
+ local list = {
+ { 0x207A, 0x002B, true },
+ { 0x207B, 0x2212, true },
+ { 0x208A, 0x002B, false },
+ { 0x208B, 0x2212, false },
+ }
+
+ datasets.addscripts = list
+
+ local function add(target,original,characters,unicode,template,super,baseheight,scale)
+ if not characters[unicode] then
+ local origdata = characters[template]
+ if origdata then
+ local width = scale * (origdata.width or 0)
+ local height = scale * (origdata.height or 0)
+ local depth = scale * (origdata.depth or 0)
+ local half = - (height + depth) / 2
+ local offset = super and baseheight/2 or -baseheight/4
+ characters[unicode] = {
+ width = width,
+ height = height + offset,
+ depth = depth - offset,
+ unicode = unicode,
+ commands = {
+ { "offset", 0, offset, template, scale, scale }
+ },
+ }
+ if trace_tweaking then
+ report_tweak("adding script %U scaled %0.3f",target,original,unicode,scale)
+ end
+ -- no need for smaller
+ end
+ end
+ end
+
+ function mathtweaks.addscripts(target,original,parameters)
+ local characters = target.characters
+ local baseheight = target.mathparameters.AccentBaseHeight
+ local scaledown = parameters.scale or target.mathparameters.ScriptScriptPercentScaleDown / 100
+ for i=1,#list do
+ local entry = list[i]
+ if entry then
+ add(target,original,characters,entry[1],entry[2],entry[3],baseheight,scaledown)
+ end
+ end
+ end
+
+end
+
+do
+
+ -- We started with the list that xits has in rtlm but most of them can be derived from
+ -- the database, and others need to be added.
+
+ -- Checked while watching/listening to Dave Matthews Band: The Central Park Concert
+ -- (with superb solos by Warren Haynes), a DVD I bought around when we started with the
+ -- LUATEX advanture.
+
+ local mirrors = {
+
+ [0x0002F] = true, -- slashes
+ [0x0005C] = true,
+ [0x000F7] = true,
+ [0x02044] = true,
+ [0x02215] = true,
+
+ [0x02032] = true, -- primes
+ [0x02033] = true,
+ [0x02034] = true,
+ [0x02057] = true,
+ [0x02035] = true,
+ [0x02036] = true,
+ [0x02037] = true,
+
+ [0x0221A] = true, -- radicals
+ [0x0221B] = true,
+ [0x0221C] = true,
+ [0x0221D] = true,
+
+ [0x0222B] = true, -- integrals
+ [0x0222C] = true,
+ [0x0222D] = true,
+ [0x0222E] = true,
+ [0x0222F] = true,
+ [0x02230] = true,
+ [0x02231] = true,
+ [0x02232] = true,
+ [0x02233] = true,
+
+ [0x02A0A] = true, -- seen in xits (to be checked)
+ [0x02A0B] = true,
+ [0x02A0C] = true,
+ [0x02A0D] = true,
+ [0x02A0E] = true,
+
+ [0x02140] = true,
+ [0x02201] = true,
+ [0x02202] = true,
+ [0x02203] = true,
+ [0x02204] = true,
+ [0x02211] = true,
+
+ [0x02239] = true,
+ [0x0225F] = true,
+ [0x0228C] = true,
+ [0x022A7] = true,
+ [0x022AA] = true,
+ [0x022AC] = true,
+ [0x022AD] = true,
+ [0x022AE] = true,
+ [0x022AF] = true,
+ [0x022F5] = true,
+ [0x022F8] = true,
+ [0x022F9] = true,
+ [0x022FF] = true,
+ [0x02320] = true,
+ [0x02321] = true,
+ [0x027C0] = true,
+ [0x029DC] = true,
+ [0x029F4] = true,
+
+ [0x02A0F] = true,
+ [0x02A10] = true,
+ [0x02A11] = true,
+ [0x02A12] = true,
+ [0x02A13] = true,
+ [0x02A14] = true,
+ [0x02A15] = true,
+ [0x02A16] = true,
+ [0x02A17] = true,
+ [0x02A18] = true,
+ [0x02A19] = true,
+ [0x02A1A] = true,
+ [0x02A1B] = true,
+ [0x02A1C] = true,
+ [0x02A20] = true,
+
+ [0x02A74] = true,
+ [0x02AA3] = true,
+ [0x02AE2] = true,
+ [0x02AE6] = true,
+ [0x1D715] = true,
+ }
+
+ local new = fonts.helpers.newprivateslot
+
+ local function add(target,original,characters,unicode,what)
+ local data = characters[unicode]
+ if data then
+ if not data.mirror then
+ local slot = new("mirror."..unicode)
+ local mirror = copytable(data)
+ data.mirror = slot
+ mirror.rorrim = unicode -- so we can check later
+ mirror.commands = {
+ { "offset", data.width, 0, unicode, -1, 1 }
+ }
+ if trace_tweaking then
+ report_tweak("adding mirror %U (%s)",target,original,unicode,what)
+ end
+ characters[slot] = mirror
+ elseif trace_tweaking then
+ report_tweak("skipping mirror %U (%s)",target,original,unicode,what)
+ end
+ local parts = data.parts
+ if parts then
+ for i=1,#parts do
+ add(target,original,characters,parts[i],"hpart")
+ end
+ end
+ local smaller = data.smaller
+ if smaller then
+ add(target,original,characters,"smaller")
+ end
+ local next = data.next
+ if next then
+ add(target,original,characters,next,"next")
+ end
+ end
+ end
+
+ -- todo: also check the rtlm table if present
+
+ function mathtweaks.addmirrors(target,original,parameters)
+ local characters = target.characters
+ -- for unicode, detail in sortedhash(characters) do
+ for unicode, detail in next, characters do
+ local data = chardata[unicode]
+ if data and data.mirror then
+ add(target,original,characters,unicode,"mirror")
+ end
+ end
+ for unicode, detail in sortedhash(mirrors) do
+ if characters[unicode] then
+ add(target,original,characters,unicode,"character")
+ elseif trace_tweaking then
+ report_tweak("ignoring mirror %U (%s)",target,original,unicode,what)
+ end
+ end
+ end
+
+end
+
+do
+
+ local reported = { }
+
+ function mathtweaks.version(target,original,parameters)
+ local metadata = original.shared.rawdata.metadata
+ if metadata then
+ local version = string.strip(metadata.version or "") -- some have trailing spaces
+ if version then
+ local expected = parameters.expected
+ local fontname = metadata.fontname or false
+ local message = parameters.message
+ -- version = tonumber(string.match(version,"%d+.%d+"))
+ if version ~= expected and not reported[fontname] then
+ report_tweak("version %a found, version %a expected",target,original,version,expected)
+ elseif trace_tweaking then
+ report_tweak("version %a found",target,original,version)
+ end
+ if message and message ~= "" and not reported[fontname] then
+ report_tweak()
+ report_tweak("%s",target,original,message)
+ report_tweak()
+ end
+ reported[fontname] = true
+ target.tweakversion = version
+ end
+ end
+ end
+
+end
+
+do
+
+ function mathtweaks.parameters(target,original,parameters)
+ local newparameters = parameters.list
+ local oldparameters = target.mathparameters
+ if newparameters and oldparameters then
+ newparameters = copytable(newparameters)
+ scaleparameters(newparameters,target.parameters)
+ for name, newvalue in next, newparameters do
+ oldparameters[name] = newvalue
+ end
+ end
+ end
+
+ function mathtweaks.bigslots(target,original,parameters)
+ local list = parameters.list
+ if list then
+ target.bigslots = list
+ end
+ end
+
+end
+
+-- do
+--
+-- function mathtweaks.diagnose(target,original,parameters)
+-- local characters = target.characters
+-- for k, v in sortedhash(characters) do
+-- local italic = v.italic
+-- if italic then
+-- report_tweak("italics: %C %p",target,original,k,italic)
+-- end
+-- end
+-- end
+--
+-- end
+
+do
+
+ function mathtweaks.setoptions(target,original,parameters)
+ local setlist = parameters.set or parameters.list
+ local resetlist = parameters.reset
+ if setlist or resetlist then
+ local properties = target.properties
+ local codes = tex.mathcontrolcodes
+ local oldcontrol = texget("mathfontcontrol")
+ local newcontrol = oldcontrol
+ -- todo: reset
+ if resetlist then
+ for i=1,#resetlist do
+ local v = tonumber(codes[resetlist[i]])
+ if v then
+ newcontrol = newcontrol & (not v)
+ end
+ end
+ end
+ if setlist then
+ for i=1,#setlist do
+ local v = tonumber(codes[setlist[i]])
+ if v then
+ newcontrol = newcontrol | v
+ end
+ end
+ end
+ newcontrol = newcontrol | codes.usefontcontrol
+ properties.mathcontrol = newcontrol
+ target.mathcontrol = newcontrol
+ if trace_tweaking then
+ report_tweak("forcing math font options 0x%08X instead of 0x%08X",target,original,newcontrol,oldcontrol)
+ end
+ end
+ end
+
+end
+
+do
+
+ function mathtweaks.setovershoots(target,original,parameters)
+ local list = parameters.list
+ if list then
+ local characters = target.characters
+ local emwidth = target.parameters.quad
+ local done = false
+ for i=1,#list do
+ local entry = list[i]
+ local target = entry.target
+ local top = entry.topovershoot
+ local quad = entry.quad
+ if target and top then
+ local range = blocks[target]
+ if range then
+ if quad then
+ quad = emwidth
+ end
+ for r = range.first, range.last do
+ local unicode = mathgaps[r] or r
+ local data = characters[unicode]
+ if data then
+ data.topovershoot = top * (quad or data.width or 0)
+ if not trace_tweaking then
+ done = true
+ elseif done then
+ done[r] = true
+ else
+ done = { [r] = true }
end
- if trace_defining and oldvalue ~= newvalue then
- report_math("overloading math parameter %a: %S => %S",name,oldvalue,newvalue)
+ end
+ end
+ end
+ end
+ end
+ feedback_tweak("setovershoots",target,original,done)
+ end
+ end
+
+ -- there is no real need for thios but let's play nice with memory anyway
+
+ local efindex = 0
+ local effects = setmetatableindex (function (t,k)
+ efindex = efindex + 1
+ local v = "tweakreplacealphabets" .. efindex
+ local e = fonts.specifiers.presetcontext(v,"",k)
+ -- print(k,v,e)
+ t[k] = v
+ return v
+ end)
+
+ function mathtweaks.replacealphabets(target,original,parameters)
+ local list = parameters.list
+ if list then
+ local features = target.specification.features.normal
+ local definedfont = fonts.definers.internal
+ local copiedglyph = fonts.handlers.vf.math.copy_glyph
+ -- does a deep copy, including parts and so
+ local getsubstitution = fonts.handlers.otf.getsubstitution
+ local fontdata = fonts.hashes.identifiers
+ --
+ local fonts = target.fonts
+ local size = target.size
+ local characters = target.characters
+ if not fonts then
+ fonts = { }
+ target.fonts = fonts
+ end
+ if #fonts == 0 then
+ fonts[1] = { id = 0, size = size } -- self, will be resolved later
+ end
+ for i=1,#list do
+ local entry = list[i]
+ local filename = entry.filename or parameters.filename
+ local feature = entry.feature
+ local thesource = entry.source
+ local thetarget = entry.target or thesource
+ if thesource and thetarget then
+ local sourcerange = type(thesource) == "table" and thesource or blocks[thesource] -- .gaps
+ local targetrange = type(thetarget) == "table" and thetarget or blocks[thetarget] -- .gaps
+ if sourcerange and targetrange then
+ local firsttarget = targetrange.first
+ local firstsource = sourcerange.first
+ local lastsource = sourcerange.last or firstsource
+ if firstsource and firsttarget then
+ local offset = firsttarget - firstsource
+ if filename then
+ local rscale = entry.rscale or 1 -- todo
+ size = size * rscale -- maybe use scale in vf command
+ -- load font, todo: set language and script, the effect hack is ugly
+ local fullname = filename
+ local effect = features.effect
+ if effect then
+ fullname = fullname .. "*" .. effects["effect={"..effect.."}"]
+ end
+ local id = definedfont {
+ name = fullname,
+ size = size,
+ }
+ local chars = fontchars[id]
+ local dropin = fontdata[id]
+ local index = false
+ for i=1,#fonts do
+ local f = fonts[i]
+ if f.id == id and f.size == size then
+ index = i
+ break
+ end
+ end
+ if not index then
+ index = #fonts + 1
+ fonts[index] = { id = id, size = size }
+ end
+ -- copy characters
+ for s=firstsource,lastsource do
+ local t = s + offset
+ local sourceunicode = mathgaps[s] or s
+ if chars[sourceunicode] then
+ local targetunicode = mathgaps[t] or t
+ if feature then
+ sourceunicode = getsubstitution(dropin,sourceunicode,feature,true,"math","dflt") or sourceunicode
+ end
+-- if trace_tweaking then
+-- report_tweak("copying %s %U from file %a to %s %U",target,original,thesource,sourceunicode,filename,thetarget,targetunicode)
+-- end
+ characters[targetunicode] = copiedglyph(target,characters,chars,sourceunicode,index)
+ end
+ end
+ --
+ local inherit = entry.inherit
+ if inherit then
+ local mathparameters = target.mathparameters
+ local dropparameters = fontdata[id].mathparameters
+ if dropparameters then
+ for name in sortedhash(inherit) do
+ local value = dropparameters[name]
+ if value then
+ mathparameters[name] = value
+ end
+ end
+ end
+ end
+ --
+ elseif feature then
+ for s=firstsource,lastsource do
+ local t = s + offset
+ local sourceunicode = mathgaps[s] or s
+ local targetunicode = mathgaps[t] or t
+ local variant = getsubstitution(original,sourceunicode,feature,true,"math","dflt")
+ local data = characters[variant]
+ if data then
+-- if trace_tweaking then
+-- report_tweak("copying %s %U from feature %a to %s %U",target,original,thesource,sourceunicode,feature,thetarget,targetunicode)
+-- end
+ characters[targetunicode] = copytable(data)
+ end
end
else
- report_math("invalid math parameter %a",name)
+ for s=firstsource,lastsource do
+ local t = s + offset
+ local sourceunicode = mathgaps[s] or s
+ local targetunicode = mathgaps[t] or t
+ if sourceunicode ~= targetunicode then
+ local data = characters[sourceunicode]
+ if data then
+-- if trace_tweaking then
+-- report_tweak("copying %s %U to %s %U",target,original,thesource,sourceunicode,thetarget,targetunicode)
+-- end
+ characters[targetunicode] = copytable(data)
+ end
+ end
+ end
end
- mathparameters[name] = newvalue
+ else
+ -- error
end
end
end
end
end
end
+
+ function mathtweaks.fallbacks(target,original,parameters)
+ local fallbacks = target.specification.fallbacks
+ if fallbacks then
+ local definitions = fonts.collections.definitions[fallbacks]
+ if definitions then
+ local list = { }
+ for i=1,#definitions do
+ local definition = definitions[i]
+ -- local check = definition.check
+ -- local force = definition.force
+ local first = definition.start
+ local last = definition.stop
+ local offset = definition.offset or first
+ list[#list+1] = {
+ filename = definition.font,
+ rscale = definition.rscale or 1,
+ source = { first = first, last = last },
+ target = { first = offset, last = offset + (last - first) },
+ }
+ end
+ mathtweaks.replacealphabets(target,original,{
+ tweak = "replacealphabets",
+ list = list,
+ } )
+ end
+ end
+ end
+
end
-local function applytweaks(when,target,original)
- local goodies = original.goodies
- if goodies then
- for i=1,#goodies do
- local goodie = goodies[i]
- local mathematics = goodie.mathematics
- local tweaks = mathematics and mathematics.tweaks
- if type(tweaks) == "table" then
- tweaks = tweaks[when]
- if type(tweaks) == "table" then
- if trace_defining then
- report_math("tweaking math of %a @ %p (%s)",target.properties.fullname,target.parameters.size,when)
+local apply_tweaks = true directives.register("math.applytweaks", function(v) apply_tweaks = v end)
+local applied_tweaks = 0
+
+local function tweaklist(target,original,tweaks)
+ if type(tweaks) == "table" then
+ for i=1,#tweaks do
+ local tweak = tweaks[i]
+ if type(tweak) == "table" then
+ local action = mathtweaks[tweak.tweak or ""]
+ if action then
+ local feature = tweak.feature
+ local features = target.specification.features.normal
+ if feature == nil or features[feature] then
+ local version = tweak.version
+ if version and version ~= target.tweakversion then
+ report_math("skipping tweak %a version %a",tweak.tweak,version)
+ elseif original then
+ action(target,original,tweak)
+ else
+ action(target,tweak)
+ end
end
- for i=1,#tweaks do
- local tweak= tweaks[i]
- local tvalue = type(tweak)
- if tvalue == "function" then
- tweak(target,original)
+ end
+ end
+ end
+ end
+end
+
+function mathtweaks.tweaks(target,original,parameters)
+ tweaklist(target,original,parameters.list)
+end
+
+local function applytweaks(when,target,original)
+ if apply_tweaks then
+ local goodies = original.goodies
+ if goodies then
+ local tweaked = target.tweaked or { }
+ if tweaked[when] then
+ if trace_defining then
+ report_math("tweaking math of %a @ %p (%s: %s)",target.properties.fullname,target.parameters.size,when,"done")
+ end
+ else
+ for i=1,#goodies do
+ local goodie = goodies[i]
+ local mathematics = goodie.mathematics
+ local tweaks = mathematics and mathematics.tweaks
+ if type(tweaks) == "table" then
+ statistics.starttiming(mathtweaks)
+ applied_tweaks = applied_tweaks + 1
+ tweaks = tweaks[when]
+ if trace_defining then
+ report_math("tweaking math of %a @ %p (%s: %s)",target.properties.fullname,target.parameters.size,when,"okay")
end
+ tweaklist(target,original,tweaks)
end
+ statistics.stoptiming(mathtweaks)
end
+ tweaked[when] = true
+ target.tweaked = tweaked
end
end
+ else
+ report_math("not tweaking math of %a @ %p (%s)",target.properties.fullname,target.parameters.size,when)
end
end
+local function tweakable(target)
+ local mathparameters = target.mathparameters
+-- local features = target.specification.features
+-- local mathscript = features and features.normal and features.normal.script == "math"
+-- return mathparameters and mathscript -- and target,properties.hasmath
+ return mathparameters
+end
+
function mathematics.tweakbeforecopyingfont(target,original)
- local mathparameters = target.mathparameters -- why not hasmath
- if mathparameters then
+ if use_math_goodies and tweakable(target) then
applytweaks("beforecopying",target,original)
end
end
function mathematics.tweakaftercopyingfont(target,original)
- local mathparameters = target.mathparameters -- why not hasmath
- if mathparameters then
+ if use_math_goodies and tweakable(target) then
applytweaks("aftercopying",target,original)
end
end
-sequencers.appendaction("mathparameters","system","mathematics.scaleparameters")
-sequencers.appendaction("mathparameters","system","mathematics.checkaccentbaseheight") -- should go in lfg instead
-sequencers.appendaction("mathparameters","system","mathematics.checkprivateparameters") -- after scaling !
-sequencers.appendaction("mathparameters","system","mathematics.overloadparameters")
+statistics.register("math tweaking time",function()
+ if applied_tweaks > 0 then
+ return string.format("%s seconds, %s math goodie tables", statistics.elapsedtime(mathtweaks),applied_tweaks)
+ end
+end)
-sequencers.appendaction("beforecopyingcharacters","system","mathematics.tweakbeforecopyingfont")
-sequencers.appendaction("aftercopyingcharacters", "system","mathematics.tweakaftercopyingfont")
+do
--- no, it's a feature now (see good-mth):
---
--- sequencers.appendaction("aftercopyingcharacters", "system","mathematics.overloaddimensions")
+ local defaults = {
+ {
+ source = "uppercasescript",
+ target = "uppercasecalligraphic",
+ },
+ {
+ source = "lowercasescript",
+ target = "lowercasecalligraphic",
+ },
+ {
+ source = "uppercaseboldscript",
+ target = "uppercaseboldcalligraphic",
+ },
+ {
+ source = "lowercaseboldscript",
+ target = "lowercaseboldcalligraphic",
+ },
+ }
--- a couple of predefined tweaks:
+ local reported = table.setmetatableindex("table")
+
+ function mathematics.checkaftercopyingfont(target,original)
+ if tweakable(target) then
+ local chardata = characters.data
+ local characters = target.characters
+ --
+ for i=1,#defaults do
+ -- we assume no ssty here yet .. todo
+ local default = defaults[i]
+ local block = blocks[default.target]
+ local first = block.first
+ local last = block.last
+ if not characters[mathgaps[first] or last] then
+ mathtweaks.replacealphabets(target,original,{
+ tweak = "replacealphabets",
+ list = { default }
+ })
+ end
+ end
+ --
+ local addvariant = mathematics.addvariant
+ local function register(old,new)
+ for i, cold in next, old do
+ local cnew = new[i]
+ addvariant(target,cold,cold,0xFE00)
+ addvariant(target,cnew,cnew,0xFE01)
+ addvariant(target,cnew,cold,0xFE00)
+ addvariant(target,cold,cnew,0xFE01)
+ end
+ end
+ local sr = mathematics.alphabets.sr.tf
+ local ca = mathematics.alphabets.ca.tf
+ register(sr.ucletters,ca.ucletters)
+ register(sr.lcletters,ca.lcletters)
+ --
+ if checkitalics then
+ local italics = 0
+ local metadata = original.shared.rawdata.metadata
+ local fontname = metadata and metadata.fontname or false
+ -- for k, v in sortedhash(characters) do
+ for k, v in next, characters do
+ local italic = v.italic
+ if italic then
+ local unicode = v.unicode
+ if unicode and not reported[fontname][unicode] then -- there can be variants
+ local data = chardata[unicode]
+ local description = data.description or ""
+ local category = data.category or "--"
+ report_tweak("italics: %C %p %s %s",target,original,k,italic,category,description)
+ reported[fontname][unicode] = true
+ end
+ italics = italics + 1
+ end
+ end
+ if italics > 0 then
+ report_tweak("still has %i italics",target,original,italics)
+ goto NEXTSTEP
+ end
+ end
-local tweaks = { }
-mathematics.tweaks = tweaks
+ target.properties.mathitalics = false
+ target.properties.textitalics = false
+ ::NEXTSTEP::
+ -- more to come
+ end
+ end
--- helpers
+end
-local setmetatableindex = table.setmetatableindex
+function mathematics.beforepassingfonttotex(target)
+ if tweakable(target) then
+ applytweaks("beforepassing",target,target)
+ end
+end
-local getfontoffamily = tex.getfontoffamily
+sequencers.appendaction("mathparameters","system","mathematics.overloadparameters")
+sequencers.appendaction("mathparameters","system","mathematics.scaleparameters")
+----------.appendaction("mathparameters","system","mathematics.checkaccentbaseheight") -- should go in lfg instead
+----------.appendaction("mathparameters","system","mathematics.checkprivateparameters") -- after scaling !
-local fontcharacters = fonts.hashes.characters
-local extensibles = utilities.storage.allocate()
-fonts.hashes.extensibles = extensibles
+sequencers.appendaction("beforecopyingcharacters","system","mathematics.tweakbeforecopyingfont")
+sequencers.appendaction("aftercopyingcharacters", "system","mathematics.tweakaftercopyingfont")
+sequencers.appendaction("aftercopyingcharacters", "system","mathematics.checkaftercopyingfont")
+sequencers.appendaction("beforepassingfonttotex", "system","mathematics.beforepassingfonttotex")
-local chardata = characters.data
-local extensibles = mathematics.extensibles
+-- no, it's a feature now (see good-mth):
+--
+-- sequencers.appendaction("aftercopyingcharacters", "system","mathematics.overloaddimensions")
-- we use numbers at the tex end (otherwise we could stick to chars)
@@ -261,6 +3796,8 @@ local e_unknown = extensibles.unknown
local unknown = { e_unknown, false, false }
+-- top curly bracket: 23DE
+
local function extensiblecode(font,unicode)
local characters = fontcharacters[font]
local character = characters[unicode]
@@ -279,15 +3816,7 @@ local function extensiblecode(font,unicode)
if not char then
return unknown
end
- if character.horiz_variants then
- if character.vert_variants then
- return { e_mixed, code, character }
- else
- local m = char.mathextensible
- local e = m and extensibles[m]
- return e and { e, code, character } or unknown
- end
- elseif character.vert_variants then
+ if character.parts then
local m = char.mathextensible
local e = m and extensibles[m]
return e and { e, code, character } or unknown
@@ -329,19 +3858,19 @@ local function horizontalcode(family,unicode)
local loffset = 0
local roffset = 0
if kind == e_left then
- local charlist = data[3].horiz_variants
+ local charlist = data[3].parts
if charlist then
local left = charlist[1]
loffset = abs((left["start"] or 0) - (left["end"] or 0))
end
elseif kind == e_right then
- local charlist = data[3].horiz_variants
+ local charlist = data[3].parts
if charlist then
local right = charlist[#charlist]
roffset = abs((right["start"] or 0) - (right["end"] or 0))
end
elseif kind == e_horizontal then
- local charlist = data[3].horiz_variants
+ local charlist = data[3].parts
if charlist then
local left = charlist[1]
local right = charlist[#charlist]
@@ -355,124 +3884,68 @@ end
mathematics.extensiblecode = extensiblecode
mathematics.horizontalcode = horizontalcode
-interfaces.implement {
+interfaces.implement { -- can be public with two times "integerargument"
name = "extensiblecode",
arguments = { "integer", "integer" },
actions = { extensiblecode, context }
}
-interfaces.implement {
+interfaces.implement { -- can be public with two times "integerargument"
name = "horizontalcode",
arguments = { "integer", "integer" },
actions = function(family,unicode)
local kind, loffset, roffset = horizontalcode(family,unicode)
- texsetdimen("scratchleftoffset", loffset)
- texsetdimen("scratchrightoffset",roffset)
+ texsetdimen(d_scratchleftoffset, loffset)
+ texsetdimen(d_scratchrightoffset,roffset)
context(kind)
end
}
-
-local stack = { }
-
-function mathematics.registerfallbackid(n,id,name)
- if trace_collecting then
- report_math("resolved fallback font %i, name %a, id %a, used %a",
- n,name,id,fontproperties[id].fontname)
+function mathematics.variantcode(unicode,variant)
+ local data = fontcharacters[getfontoffamily(texget("fam"))]
+ local char = data and data[unicode]
+ if char then
+ for i=1,variant do
+ local next = char.next
+ if next then
+ unicode = next
+ char = data[next]
+ else
+ break
+ end
+ end
end
- stack[#stack][n] = id
+ return unicode
end
-interfaces.implement { -- will be shared with text
- name = "registerfontfallbackid",
- arguments = { "integer", "integer", "string" },
- actions = mathematics.registerfallbackid,
-}
-
-function mathematics.resolvefallbacks(target,specification,fallbacks)
- local definitions = fonts.collections.definitions[fallbacks]
- if definitions then
- local size = specification.size -- target.size
- local list = { }
- insert(stack,list)
- context.pushcatcodes("prt") -- context.unprotect()
- for i=1,#definitions do
- local definition = definitions[i]
- local name = definition.font
- local features = definition.features or ""
- local size = size * (definition.rscale or 1)
- context.font_fallbacks_register_math(i,name,features,size)
- if trace_collecting then
- report_math("registering fallback font %i, name %a, size %a, features %a",i,name,size,features)
- end
- end
- context.popcatcodes()
- end
-end
-
-function mathematics.finishfallbacks(target,specification,fallbacks)
- local list = remove(stack)
- if list and #list > 0 then
- local definitions = fonts.collections.definitions[fallbacks]
- if definitions and #definitions > 0 then
- if trace_collecting then
- report_math("adding fallback characters to font %a",specification.hash)
- end
- local definedfont = fonts.definers.internal
- local copiedglyph = fonts.handlers.vf.math.copy_glyph
- local fonts = target.fonts
- local size = specification.size -- target.size
- local characters = target.characters
- if not fonts then
- fonts = { }
- target.fonts = fonts
- end
- if #fonts == 0 then
- fonts[1] = { id = 0, size = size } -- self, will be resolved later
- end
- local done = { }
- for i=1,#definitions do
- local definition = definitions[i]
- local name = definition.font
- local start = definition.start
- local stop = definition.stop
- local gaps = definition.gaps
- local check = definition.check
- local force = definition.force
- local rscale = definition.rscale or 1
- local offset = definition.offset or start
- local id = list[i]
- if id then
- local index = #fonts + 1
- fonts[index] = { id = id, size = size }
- local chars = fontchars[id]
- local function remap(unic,unicode,gap)
- if check and not chars[unicode] then
- return
- end
- if force or (not done[unic] and not characters[unic]) then
- if trace_collecting then
- report_math("replacing math character %C by %C using vector %a and font id %a for %a%s%s",
- unic,unicode,fallbacks,id,fontproperties[id].fontname,check and ", checked",gap and ", gap plugged")
- end
- characters[unic] = copiedglyph(target,characters,chars,unicode,index)
- done[unic] = true
- end
- end
- local step = offset - start
- for unicode = start, stop do
- remap(unicode + step,unicode,false)
- end
- if gaps then
- for unic, unicode in next, gaps do
- remap(unic,unicode,true)
- remap(unicode,unicode,true)
- end
- end
- end
+function mathematics.variantcount(unicode)
+ local data = fontcharacters[getfontoffamily(texget("fam"))]
+ local char = data and data[unicode]
+ local count = 0
+ if char then
+ while true do
+ local next = char.next
+ if next then
+ count = count + 1
+ char = data[next]
+ else
+ break
end
- elseif trace_collecting then
- report_math("no fallback characters added to font %a",specification.hash)
end
end
+ return count
end
+
+interfaces.implement {
+ name = "mathvariantcode",
+ public = true,
+ arguments = { "integer", "integer" },
+ actions = { mathematics.variantcode, context },
+}
+
+interfaces.implement {
+ name = "mathvariantcount",
+ public = true,
+ arguments = "integer",
+ actions = { mathematics.variantcount, context },
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-ali.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-ali.lmt
new file mode 100644
index 00000000000..87ea67c727c
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-ali.lmt
@@ -0,0 +1,292 @@
+if not modules then modules = { } end modules ['math-ali'] = {
+ version = 1.001,
+ comment = "companion to math-ali.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local unpack = unpack
+local gsub = string.gsub
+local sort, keys = table.sort, table.keys
+local settings_to_array = utilities.parsers.settings_to_array
+local P, R, S, C, Cc, Ct, Cs = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Cc, lpeg.Ct, lpeg.Cs
+local lpegmatch = lpeg.match
+
+local context = context
+
+do
+
+ local rows = utilities.parsers.groupedsplitat(";")
+ local cols = utilities.parsers.groupedsplitat(",")
+
+ local actions = {
+ transpose = function(m)
+ local t = { }
+ for j=1,#m[1] do
+ local r = { }
+ for i=1,#m do
+ r[i] = m[i][j]
+ end
+ t[j] = r
+ end
+ return t
+ end,
+ negate = function(m)
+ for i=1,#m do
+ local mi = m[i]
+ for j=1,#mi do
+ mi[j] = - mi[j]
+ end
+ end
+ return m
+ end,
+ scale = function(m,s)
+ s = tonumber(s)
+ if s then
+ for i=1,#m do
+ local mi = m[i]
+ for j=1,#mi do
+ mi[j] = s*mi[j]
+ end
+ end
+ end
+ return m
+ end,
+ }
+
+ local useractions = {
+ }
+
+ interfaces.implement {
+ name = "simplematrix",
+ arguments = "2 strings",
+ actions = function(method,data)
+ local m = lpegmatch(rows,(gsub(data,"%s+"," ")))
+ for i=1,#m do
+ m[i] = lpegmatch(cols,m[i])
+ end
+ local methods = settings_to_array(method)
+ for i=1,#methods do
+ local detail = settings_to_array(methods[i])
+ local method = detail[1]
+ local action = actions[method] or useractions[method]
+ if action then
+ m = action(m,unpack(detail,2)) or m
+ end
+ end
+ for i=1,#m do
+ context("\\NC %{ \\NC }t \\NR",m[i])
+ end
+ end
+ }
+
+ function mathematics.registersimplematrix(name,action)
+ if type(action) == "function" then
+ useractions[name] = action
+ end
+ end
+
+ -- \cases{1, x>0 ; -1, x<0 }
+
+ interfaces.implement {
+ name = "simplecases",
+ arguments = "2 strings",
+ actions = function(method,data)
+ -- no methods yet
+ local m = lpegmatch(rows,(gsub(data,"%s+"," ")))
+ for i=1,#m do
+ m[i] = lpegmatch(cols,m[i])
+ end
+ for i=1,#m do
+ context("\\NC %{ \\NC }t \\NR",m[i])
+ end
+ end
+ }
+
+end
+
+do
+
+ local relations = {
+ ["<"] = "<", [">"] = ">",
+ ["!<"] = "≮", ["!>"] = "≯",
+ ["<<"] = "≪", [">>"] = "≫",
+ ["="] = "=", ["=="] = "=",
+ ["<>"] = "≠", ["!="] = "≠",
+ ["<="] = "≤", [">="] = "≥",
+ ["=<"] = "≦", ["=>"] = "≧",
+ ["!=<"] = "≰", ["!=>"] = "≱",
+ ["~"] = "≈", ["~~"] = "≈",
+ }
+
+ for k, v in next, table.copy(relations) do relations[v] = v end
+
+ -- local binaries = {
+ -- ["+"] = "+",
+ -- ["-"] = "-",
+ -- ["/"] = "/",
+ -- ["*"] = "",
+ -- }
+
+ local separators = {
+ [","] = true,
+ [";"] = true,
+ }
+
+ local alternatives = {
+ -- not that many
+ }
+
+ local p_sign = S("-+")
+ local p_script = S("^")^1
+ local p_number = R("09","..")^1 + lpeg.patterns.nestedbraces
+ local p_alpha = R("az","AZ")^1
+ local p_variable = p_alpha * (P("_") * (p_number + p_alpha))^-1
+
+ local spacing = P(" ")^0
+ local script = Cs(p_script * Cc("{") * p_sign^0 * (p_number + p_variable) * Cc("}"))
+ local sign = C(p_sign) + Cc("+")
+ local number = C(p_number)
+ local variable = C(p_variable)
+ -- local binary = lpeg.utfchartabletopattern(binaries) / binaries
+ local relation = lpeg.utfchartabletopattern(relations) / relations
+ local separator = lpeg.utfchartabletopattern(separators)
+
+ local snippet = Ct (
+ (
+ spacing * sign * spacing * number * spacing * variable
+ + spacing * sign * spacing * number * spacing * Cc(false)
+ + spacing * sign * spacing * Cc(false) * spacing * variable
+ ) * (script + Cc(false))
+ )
+
+ local parser = Ct ( Ct (
+ ( Ct ( snippet^1 ) * spacing * relation )^1
+ * ( Ct ( snippet^1 ) * spacing * separator^0 )
+ )^1 )
+
+ local num = "!"
+
+ local ctx_NC, ctx_NR = context.NC, context.NR
+ local ctx_typ = context.typ
+ local ctx_ord, ctx_rel = context.mathord, context.mathrel
+
+ local clean = table.setmetatableindex(function(t,k)
+ local v = gsub(k,"[{}]","")
+ t[k] = v
+ return v
+ end)
+
+ alternatives.equationsystem = function(action,str)
+ local rows = lpegmatch(parser,str)
+ if not rows then
+ ctx_typ("bad system, case 1: %s",1,str)
+ return
+ end
+ local nrow = #rows
+ local all = table.setmetatableindex("table")
+ for r=1,nrow do
+ local row = rows[r]
+ for s=1,#row,2 do
+ local set = row[s]
+ for v=1,#set do
+ local vvv = set[v]
+ local var = vvv[3]
+ if not var then
+ var = num
+ end
+ if set[var] then
+ print("bad system, two constants")
+ end
+ set[var] = set[v]
+ all[s][var] = true
+ set[v] = nil
+ end
+ end
+ end
+ --
+ local cnt = #rows[1]
+ for r=1,nrow do
+ if #rows[r] ~= cnt then
+ ctx_typ("bad system, case %i: %s",2,str)
+ return
+ end
+ end
+ for r=1,#rows[1] do
+ local a = keys(all[r])
+ sort(a,function(a,b)
+ return clean[a] < clean[b]
+ end)
+ all[r] = a
+ end
+ --
+ for r=1,nrow do
+ local row = rows[r]
+ for r=1,#row do
+ local set = row[r]
+ local how = all[r]
+ if #how > 0 then
+ -- local done = false
+ for i=1,#how do
+ local k = how[i]
+ local e = set[k]
+ if e then
+ ctx_NC()
+ -- if not done and e[1] == "+" then
+ if i == 1 and e[1] == "+" then
+ -- ctx_ord("")
+ -- ctx_hphantom(e[1])
+ -- ctx_ord("")
+ else
+ ctx_ord("")
+ context(e[1])
+ ctx_ord("")
+ -- done = true
+ end
+ ctx_NC()
+ if e[2] then
+ context(e[2])
+ -- done = true
+ end
+ if e[3] then
+ context(e[3])
+ -- done = true
+ end
+ if e[4] then
+ context(e[4])
+ -- done = true
+ end
+ else
+ ctx_NC()
+ -- ctx_mathord("")
+ ctx_NC()
+ end
+ end
+ else
+ ctx_NC()
+ ctx_ord("")
+ context(set)
+ ctx_ord("")
+ end
+ end
+ ctx_NR()
+ end
+ end
+
+ interfaces.implement {
+ name = "simplealign",
+ -- public = true,
+ protected = true,
+ arguments = "3 strings",
+ actions = function(alternative,action,str)
+ local a = alternatives[alternative]
+ if a then
+ a(action,str)
+ else
+ context(str)
+ end
+ end
+ }
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-ali.mkxl b/Master/texmf-dist/tex/context/base/mkxl/math-ali.mkxl
index 2007ed83ccf..baaa4666a85 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/math-ali.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-ali.mkxl
@@ -15,6 +15,8 @@
\unprotect
+\registerctxluafile{math-ali}{autosuffix}
+
%D The code here has been moved from other files. Beware: the \MKII\ and \MKIV\ code
%D is not gathered in files with the same name. In the meantime this code has been
%D adapted to \MKIV\ but more is possible. The code is somewhat complicated by the
@@ -27,96 +29,201 @@
% matrix : ok
% substack :
+% Alignment overhaul timestamp: around watching GhostNote Live in Utrecht 2022
+% (energizing funky professionalism).
+
+%D The following macros are moved to this module because here we deal mostly with
+%D alignment issues. In principle one should see strc-mat, math-ini and math-ali as
+%D a close operation. The \type {\displaywidth} is only known inside a display
+%D formula, so we need to catch it when still zero.
+
+\permanent\def\checkeddisplaywidth % hsize if zero
+ {\dimexpr
+ \ifzeropt\displaywidth
+ \hsize
+ \else
+ \displaywidth
+ \fi
+ \relax}
+
+\permanent\def\maximizeddisplaywidth % larger than zero but within hsize
+ {\dimexpr
+ \ifzeropt\displaywidth
+ \hsize
+ \orelse\ifdim\displaywidth>\hsize
+ \hsize
+ \else
+ \displaywidth
+ \fi
+ \relax}
+
%D \macros
%D {definemathalignment, setupmathalignment, startmathalignment}
%D
%D Modules may provide additional alignment features. The following kind of plain
%D mechanisms are provided by the core.
-\newtoks\t_math_align_a
-\newtoks\t_math_align_b
-\newtoks\t_math_align_c
+% \startformula
+% \startalign[m=3, n=2, align={1:right,2:left},distance=2em]
+% \NC 1.1 \NC = 1.2 \NC 2.1 \NC = 2.2 \NC 3.1 \NC = 3.2 \NR
+% \NC 1 \NC = 1 \NC 2 \NC = 2 \NC 3 \NC = 3 \NR
+% \NC 1.1 \NC = 1.2 \NC 2.1 \NC = 2.2 \NC 3.1 \NC = 3.2 \NR
+% \stopalign
+% \stopformula
+
+\newtoks \mathdisplayaligntweaks
+
+\newtoks \t_math_align_a
+\newtoks \t_math_align_b
+\newtoks \t_math_align_c
+\newgluespec \d_math_eqalign_distance
+\newgluespec \d_math_eqalign_rulethickness
+\newdimension\d_math_eqalign_number_distance
+\newinteger \c_math_eqalign_repeat
-\newskip\d_math_eqalign_distance
-\newskip\d_math_eqalign_rulethickness
+\mutable\def\displayopenupvalue{.25\bodyfontsize}
\protected\def\math_eqalign_distance
- {\relax
- \ifdim\d_math_eqalign_distance>\zeropoint
- % \hskip\d_math_eqalign_distance
- \tabskip\d_math_eqalign_distance
- \fi
+ {%global\expandafter\integerdef\csname\??mathbeginclass\the\c_math_eqalign_column\endcsname\mathbegincode
+ \global\expandafter\integerdef\csname\??mathendclass \the\c_math_eqalign_column\endcsname\mathendcode
\mathalignmentparameter\c!separator
\relax}
-\mutable\def\displayopenupvalue{.25\bodyfontsize}
-
\def\math_build_eqalign
{\scratchtoks\emptytoks
\d_math_eqalign_distance\mathalignmentparameter\c!distance\relax
+ \ifcstok{\mathalignmentparameter\c!align}\v!auto
+ \d_math_eqalign_number_distance\mathalignmentparameter\c!numberdistance\relax
+ \letmathalignmentparameter\c!align\v!middle
+ \else
+ \d_math_eqalign_number_distance\zeropoint
+ \fi
\scratchcounterone\mathalignmentparameter\c!m
\scratchcountertwo\mathalignmentparameter\c!n
- \etoksapp\scratchtoks{\the\t_math_align_a}%
+ \toksapp\scratchtoks\t_math_align_a
+ \toksapp\scratchtoks{\global\c_math_eqalign_repeat\zerocount}%
\scratchcounter\plusone
\dorecurse{\numexpr\scratchcounterone*\scratchcountertwo-\plusone\relax}
{\ifnum\scratchcounter=\scratchcountertwo
\scratchcounter\plusone
- \etoksapp\scratchtoks{\math_eqalign_distance}%
- \etoksapp\scratchtoks{\global\c_math_eqalign_column\zerocount}%
+ % preamble expansion hell ...
+ \toksapp\scratchtoks {\tabskip\d_math_eqalign_distance}%
+ % so ...
+ \toksapp\scratchtoks {\relax\math_eqalign_distance}%
+ \etoksapp\scratchtoks{\global\advanceby\c_math_eqalign_repeat\the\scratchcountertwo\relax}%
\else
- \advance\scratchcounter\plusone
+ \advanceby\scratchcounter\plusone
\fi
- \etoksapp\scratchtoks{\the\t_math_align_b}}%
- \etoksapp\scratchtoks{\the\t_math_align_c}}
+ \toksapp\scratchtoks\t_math_align_b}%
+ \toksapp\scratchtoks\t_math_align_c
+ \toksapp\scratchtoks{\global\c_math_eqalign_repeat\zerocount}}
-\def\math_math_in_eqalign#1%
- {\startforceddisplaymath
+\def\math_eqalign_set_defaults
+ {\normalbaselines % hm, spacing ?
+ \mathsurround\zeropoint
+ \tabskip\zeropoint
+ \everycr\emptytoks}
+
+%installcorenamespace{mathbeginclass} % not needed currently
+\installcorenamespace{mathendclass}
+
+%global\expandafter\integerdef\csname\??mathbeginclass\the\zerocount\endcsname\mathbegincode
+\global\expandafter\integerdef\csname\??mathendclass \the\zerocount\endcsname\mathendcode
+
+\protected\def\math_math_in_eqalign#1%
+ {\mathbeginclass\ifcsname\??mathendclass\the\numexpr\c_math_eqalign_column-\plusone\relax\endcsname\lastnamedcs\else\mathunsetcode\fi
+ \startforceddisplaymath
\tabskip\zeropoint
\everycr\emptytoks
- {{}#1{}}%
- \stopforceddisplaymath}
+ #1%
+ \stopforceddisplaymath
+ \ifnum\lastrightclass<\mathunsetcode
+ %global\expandafter\integerdef\csname\??mathbeginclass\the\c_math_eqalign_column\endcsname\lastleftclass
+ \global\expandafter\integerdef\csname\??mathendclass \the\c_math_eqalign_column\endcsname\lastrightclass
+ \fi
+ }
-\def\math_text_in_eqalign#1%
- {\startimath
+\noaligned\protected\def\math_text_in_eqalign#1%
+ {\mathbeginclass\mathordcode
+ \mathendclass \mathordcode
+ \startimath
\tabskip\zeropoint
\everycr\emptytoks
#1%
\stopimath}
-\permanent\protected\def\eqalign#1% why no halign here, probably because of displaywidth
- {\emptyhbox % why no \dontleavehmode
- \mskip\thinmuskip
- \vcenter
- {\math_openup\displayopenupvalue % was: \openup\jot
- \mathsurround\zeropoint
- \ialign{%
- \strut
- \hfil
- \startforceddisplaymath{\alignmark\alignmark}\stopforceddisplaymath
- \aligntab
- \startforceddisplaymath{{}\alignmark\alignmark{}}\stopforceddisplaymath
- \hfil\crcr
- #1\crcr}%
- }%
- \mskip\thinmuskip}
-
-% preamble is scanned for tabskips so we need the span to prevent an error message
-
-\setnewconstant\eqalignmode\plusone
-
-% use zeroskipplusfill
+% the preamble is scanned for tabskips so we need the span to prevent an error
+% message but we can probably do without that hack now .. best not change this
+% now .. what works now keeps working
+
+\setnewconstant\c_strc_formulas_check_width\plusone
+
+\newboundary\c_math_align_l_marker
+\newboundary\c_math_align_r_marker
+
+% formula : numbermethod down : default
+% formula : numberlocation overlay : option
+% mathalign : align ..| auto :
+% mathalign : adaptive yes : synchronize glue
+
+% \startplaceformula
+% \startformula[numbermethod=down,numberlocation=normal]
+% \medmuskip 4mu plus 2mu minus 2mu \showmakeup[mathglue]\showglyphs\showboxes
+% \startalign[adaptive=yes,align=auto]
+% \NC aaa+x+xxxxxxxx+x+xxxx \EQ x+xxx \NR[eq:two:zz]
+% \NC x+x \EQ x+x+x+xxx+x+x+xxx+xx+xx \NR[eq:two:xx]
+% \stopalign
+% \stopformula
+% \stopplaceformula
+%
+% \startplaceformula
+% \startformula[numbermethod=normal,numberlocation=normal]
+% \medmuskip 4mu plus 2mu minus 2mu \showmakeup[mathglue]\showglyphs\showboxes
+% \startalign[adaptive=no,align=middle]
+% \NC aaa+x+xxxxxxxx+x+xxxx \EQ x+xxx \NR[eq:two:zz]
+% \NC x+x \EQ x+x+x+xxx+x+x+xxx+xx+xx \NR[eq:two:xx]
+% \stopalign
+% \stopformula
+% \stopplaceformula
+
+\newconditional\c_math_align_overflow_mode \settrue\c_math_align_overflow_mode
+\newconditional\c_math_align_reformat_mode \settrue\c_math_align_reformat_mode
+\newconditional\c_strc_formulas_overlay_number \settrue\c_strc_formulas_overlay_number
+
+\protected\def\math_text_in_align
+ {\scratchcounter\numexpr\c_math_eqalign_row+\plusone\relax
+ \usemathalignmentstyleandcolor\c!textstyle\c!textcolor
+ \usemathalignmentstyleandcolor{\c!textstyle:\the\scratchcounter}{\c!textcolor:\the\scratchcounter}%
+ \mathalignmentparameter\c!text
+ \mathalignmentparameter{\c!text:\the\scratchcounter}}
+
+\def\math_align_initialize_class_states
+ {}
+
+\def\math_align_reset_class_states
+ {\lastleftclass \mathbegincode
+ \lastrightclass\mathendcode}
-\def\math_prepare_r_eqalign_no
- {\t_math_align_a
- {\strut
- \tabskip\zeropoint
- \alignmark\alignmark % for picking up the number
+\def\math_prepare_l_eqalign_no % \checkeddisplaymath
+ {\math_align_initialize_class_states
+ \t_math_align_a
+ {\relax
+ \strut
+ \math_text_in_align
+ \aligncontent % for picking up the number
+ \ifnum\c_strc_math_ragged_status=\plusthree
+ \tabskip\zeropoint\relax
+ \else
+ \tabskip\centeringskip
+ \fi
+ \boundary\c_math_align_l_marker
+ \math_align_reset_class_states
\aligntab
\math_first_in_eqalign
\hfil
\math_left_of_eqalign
\span
- \math_math_in_eqalign{\alignmark\alignmark}%
+ \math_math_in_eqalign{\aligncontent}%
\math_right_of_eqalign
\tabskip\zeropoint}%
\t_math_align_b
@@ -124,48 +231,60 @@
\math_next_in_eqalign
\math_left_of_eqalign
\span
- \math_math_in_eqalign{\alignmark\alignmark}%
+ \math_math_in_eqalign{\aligncontent}%
\math_right_of_eqalign
\tabskip\zeropoint}%
- \ifnum\mathraggedstatus=\plusone
+ \ifnum\c_strc_math_ragged_status=\plusthree
\t_math_align_c
{\hfil
+ \tabskip\zeropoint
\aligntab
\span
- \math_text_in_eqalign{\alignmark\alignmark}%
+ \boundary\c_math_align_r_marker
+ \math_alignment_rbox{\aligncontent}%
\tabskip\zeropoint}%
- \orelse\ifnum\mathraggedstatus=\plusthree
+ \orelse\ifnum\c_strc_math_ragged_status=\plusone
\t_math_align_c
{\hfil
- \tabskip\zeropoint\s!plus 1\s!fill
+ \tabskip\stretchingfillskip
\aligntab
\span
- \math_text_in_eqalign{\alignmark\alignmark}%
+ \boundary\c_math_align_r_marker
+ \math_alignment_rbox{\aligncontent}%
\tabskip\zeropoint}%
\else
\t_math_align_c
{\hfil
- \tabskip\centering
+ \tabskip\centeringskip
\aligntab
\span
- \llap{\math_text_in_eqalign{\alignmark\alignmark}}%
+ \boundary\c_math_align_r_marker
+ \math_alignment_rbox{\aligncontent}%
\tabskip\zeropoint}%
\fi
\math_build_eqalign
\the\mathdisplayaligntweaks
- \tabskip\centering}
+ \tabskip\zeropoint
+ \ifnum\c_strc_math_ragged_status=\plusthree
+ \tabskip\stretchingfillskip
+ \fi}
-\def\math_prepare_l_eqalign_no % \checkeddisplaymath
- {\t_math_align_a
- {\strut
- \tabskip\zeropoint
- \alignmark\alignmark % for picking up the number
+\def\math_prepare_r_eqalign_no
+ {\math_align_initialize_class_states
+ \t_math_align_a
+ {\relax
+ \strut
+ \math_text_in_align
+ \tabskip\centeringskip
+ \aligncontent % for picking up the number
+ \boundary\c_math_align_l_marker
+ \math_align_reset_class_states
\aligntab
\math_first_in_eqalign
\hfil
\math_left_of_eqalign
\span
- \math_math_in_eqalign{\alignmark\alignmark}%
+ \math_math_in_eqalign{\aligncontent}%
\math_right_of_eqalign
\tabskip\zeropoint}%
\t_math_align_b
@@ -173,108 +292,134 @@
\math_next_in_eqalign
\math_left_of_eqalign
\span
- \math_math_in_eqalign{\alignmark\alignmark}%
+ \math_math_in_eqalign{\aligncontent}%
\math_right_of_eqalign
\tabskip\zeropoint}%
- \ifnum\mathraggedstatus=\plusone
+ \ifnum\c_strc_math_ragged_status=\plusthree
\t_math_align_c
{\hfil
\aligntab
- \kern-\displaywidth
+ \hfill % the only one !
\span
- \rlap{\math_text_in_eqalign{\alignmark\alignmark}}%
- \tabskip\displaywidth}%
- \orelse\ifnum\mathraggedstatus=\plusthree
- \t_math_align_c
- {\hfil
- \tabskip\zeropoint\s!plus 1\s!fill
- \aligntab
- \kern-\displaywidth
- \span
- \math_rlap{\math_text_in_eqalign{\alignmark\alignmark}}%
- \tabskip\displaywidth}%
+ \boundary\c_math_align_r_marker
+ \math_alignment_lbox{\aligncontent}%
+ \tabskip\zeropoint}%
+ \orelse\ifnum\c_strc_math_ragged_status=\plusone
+ \ifnum\c_strc_math_number_variant=\plusone
+ \t_math_align_c
+ {\hfil
+ \tabskip\stretchingfillskip
+ \aligntab
+ \span
+ \boundary\c_math_align_r_marker
+ \math_alignment_lbox{\aligncontent}%
+ \tabskip\zeropoint}%
+ \else
+ \t_math_align_c
+ {\hfil
+ \tabskip\zeropoint
+ \aligntab
+ \span
+ \boundary\c_math_align_r_marker
+ \math_alignment_lbox{\aligncontent}%
+ \tabskip\stretchingfillskip}%
+ \fi
\else
\t_math_align_c
{\hfil
- \tabskip\centering
+ \tabskip\centeringskip % fails in some cases
\aligntab
- \kern-\displaywidth
\span
- \rlap{\math_text_in_eqalign{\alignmark\alignmark}}%
- \tabskip\displaywidth}%
+ \boundary\c_math_align_r_marker
+ \math_alignment_lbox{\aligncontent}%
+ \tabskip\zeropoint}%
\fi
\math_build_eqalign
\the\mathdisplayaligntweaks
- \tabskip\centering}
+ \tabskip\zeropoint}
-\def\math_halign_checked
- {\halign \ifcase\eqalignmode \or to \checkeddisplaywidth \fi}
+% \def\math_halign_checked_nop
+% {\halign
+% \ifconditional\c_math_align_overflow_mode
+% callback
+% attr
+% \mathnumberlocationattribute
+% \numexpr\ifconditional\c_math_align_reformat_mode\plusfour\else\plustwo\fi * \plussixteen\relax % just a signal
+% \fi}
+%
+% \def\math_halign_checked_yes
+% {\math_halign_checked_nop
+% \ifcase\c_strc_formulas_check_width\else
+% to \checkeddisplaywidth
+% \fi}
+%
+% \def\math_halign_checked
+% {\ifnum\c_strc_formulas_place_number_mode =\plusthree \math_halign_checked_yes \orelse
+% \ifnum\c_strc_formulas_number_mode =\plusthree \math_halign_checked_yes \orelse
+% \ifnum\c_strc_formulas_sub_number_mode =\plusthree \math_halign_checked_yes \orelse
+% \ifnum\c_strc_formulas_nested_number_mode=\plusthree \math_halign_checked_yes \else
+% \math_halign_checked_nop \fi}
-\def\math_both_eqalign_no_normal#1#2%
- {\ifmmode
- \the\mathdisplayaligntweaks
- \vcenter\bgroup
- \enforced\let\math_finish_eqalign_no\egroup
- \else
- \enforced\let\math_finish_eqalign_no\relax
- \fi
- #1%
- \math_halign_checked\expandafter\bgroup\the\scratchtoks\crcr#2\crcr\egroup
- \math_finish_eqalign_no}
+\def\math_halign_checked
+ {\enablematrixalign
+ \halign
+ \ifconditional\c_math_align_overflow_mode
+ callback
+ \s!attr
+ \mathnumberlocationattribute
+ \numexpr\ifconditional\c_math_align_reformat_mode\plusfour\else\plustwo\fi * \plussixteen\relax % just a signal
+ \fi
+ \ifcase\c_strc_formulas_check_width\else
+ to \checkeddisplaywidth
+ \fi}
\installcorenamespace {mathalignlocation}
-\defcsname\??mathalignlocation\v!top \endcsname{\let\math_alignment_halign_method\halign\tpack}
-\defcsname\??mathalignlocation\v!bottom\endcsname{\let\math_alignment_halign_method\halign\vpack}
-\defcsname\??mathalignlocation\v!center\endcsname{\let\math_alignment_halign_method\halign\vcenter}
-
-\let\math_alignment_halign_method\relax
+\defcsname\??mathalignlocation\v!top \endcsname{\tpack }
+\defcsname\??mathalignlocation\v!bottom\endcsname{\vpack }
+\defcsname\??mathalignlocation\v!center\endcsname{\vcenter}
-\def\math_both_eqalign_no_aligned#1%
- {\let\math_alignment_halign_method\math_halign_checked
- \ifmmode
- \the\mathdisplayaligntweaks
- \global\mathnumberstatus\plusone
- \ifcase\mathraggedstatus
- \def\math_finish_eqalign_no{\crcr\egroup}%
- \else % we're in a mathbox
- \ifcsname\??mathalignlocation\mathalignmentparameter\c!location\endcsname
- \lastnamedcs % top|bottom|center as suggested by HM
- \else
- \vcenter
- \fi
- \bgroup
- \def\math_finish_eqalign_no{\crcr\egroup\egroup}%
- \fi
- \fi
- #1%
- \math_alignment_halign_method\expandafter\bgroup\the\scratchtoks\crcr}
+%D Here we implement the user interface part. We start with basic math alignments:
-\def\math_rlap#1%
- {\setbox\scratchbox\hbox{#1}%
- \ifdim\wd\scratchbox>\d_math_number_correction
- \global\d_math_number_correction\wd\scratchbox
- \fi
- \box\scratchbox
- \global\mathnumberstatus\plustwo}
+\newinteger \c_math_eqalign_column
+\newinteger \c_math_eqalign_row
+\newconditional\c_math_eqalign_first
-\def\math_handle_eqalign_no_r_normal {\math_both_eqalign_no_normal \math_prepare_r_eqalign_no}
-\def\math_handle_eqalign_no_l_normal {\math_both_eqalign_no_normal \math_prepare_l_eqalign_no}
-\def\math_handle_eqalign_no_r_aligned{\math_both_eqalign_no_aligned\math_prepare_r_eqalign_no}
-\def\math_handle_eqalign_no_l_aligned{\math_both_eqalign_no_aligned\math_prepare_l_eqalign_no}
-\def\math_finish_eqalign_no {\crcr\egroup}
+\newtoks \everymathalignment
+\newtoks \everymathalignmentdone
-\aliased\let\reqalignno\relax % just in case someone used that
-\aliased\let\leqalignno\relax % just in case someone used that
-\aliased\let\eqalignno \relax % just in case someone used that
+\newdimension \d_math_eqalign_number_threshold
-%D Here we implement the user interface part. We start with basic math alignments:
+\definesystemattribute[mathnumberlocation] [public]
+\definesystemattribute[mathnumberthreshold][public]
-\newcount \c_math_eqalign_column
-\newconditional\c_math_eqalign_first
+\protected\def\math_alignment_lbox#1%
+ {\begingroup
+ \setbox\scratchbox\hbox{\resetformulaparameter\c!location#1}%
+ \ifzeropt\wd\scratchbox\else
+ %\enablematrixalign
+ \hpack
+ \s!attr \mathnumberlocationattribute \numexpr\c_strc_math_ragged_status * \plussixteen + \plusone\relax
+ \s!attr \mathnumberthresholdattribute \numexpr\d_math_eqalign_number_threshold\relax
+ {\strc_formulas_add_distance \plustwo\v!left\mathalignmentparameter
+ \box\scratchbox}%
+ \fi
+ \global\d_math_eqalign_number_threshold\zeropoint % move to begin of row
+ \endgroup}
-\newtoks \everymathalignment
-\newtoks \everymathalignmentdone
+\protected\def\math_alignment_rbox#1%
+ {\begingroup
+ \setbox\scratchbox\hbox{\resetformulaparameter\c!location#1}%
+ \ifzeropt\wd\scratchbox\else
+ %\enablematrixalign
+ \hpack
+ \s!attr \mathnumberlocationattribute \numexpr\c_strc_math_ragged_status * \plussixteen + \plustwo\relax
+ \s!attr \mathnumberthresholdattribute \numexpr\d_math_eqalign_number_threshold\relax
+ {\box\scratchbox
+ \strc_formulas_add_distance \plustwo\v!right\mathalignmentparameter}%
+ \fi
+ \global\d_math_eqalign_number_threshold\zeropoint % move to begin of row
+ \endgroup}
\permanent\tolerant\protected\def\math_alignment_NN[#1]#*[#2]%
{\aligntab
@@ -326,6 +471,7 @@
\enforced\let\NR\math_alignment_NR
\enforced\let\TB\math_common_TB
\global\settrue\c_math_eqalign_first
+ \global\s_strc_math_alignment_inbetween\zeroskip
\to \everymathalignment
\appendtoks
@@ -334,11 +480,9 @@
\pop_macro_EQ
\pop_macro_NN
\pop_macro_NC
+ \global\s_strc_math_alignment_inbetween\zeroskip
\to \everymathalignmentdone
-\let\math_alignment_snap_start\relax
-\let\math_alignment_snap_stop \relax
-
% % experimental:
%
% \def\math_alignment_snap_start
@@ -367,29 +511,76 @@
% \begingroup not permitted ($$...assignments...\halign... ).. check in luametatex
+% \definemathmatrix
+% [pmatrix]
+% [matrix:parentheses]
+% % [align=1:right]
+% [align=all:right]
+% % [align=2:right]
+% % [align={1:left,2:middle,3:right}]
+
+\newgluespec\s_strc_math_alignment_inbetween
+
+\def\strc_math_setup_spacing_aligned#1%
+ {\begingroup
+ % here we abuse the whitespace setter
+ \edef\v_spac_whitespace_current{#1\c!spaceinbetween}%
+ \ifempty\v_spac_whitespace_current
+ \global\s_strc_math_alignment_inbetween\zeroskip
+ \else
+ \spac_whitespace_setup
+ \global\s_strc_math_alignment_inbetween\parskip
+ \fi
+ \endgroup}
+
\permanent\tolerant\protected\def\math_alignment_start[#1]#*[#2]%
- {\edef\currentmathalignment{#1}%
+ {\begingroup
+ \edef\currentmathalignment{#1}%
\ifarguments\or\or
- \setupmathalignment[#1][#2]% bad! ungrouped
+ \setupmathalignment[#1][#2]%
+ \fi
+ \ifcstok{\mathalignmentparameter\c!adaptive}\v!yes
+ \settrue\c_math_align_reformat_mode
+ \else
+ \setfalse\c_math_align_reformat_mode
\fi
\math_alignment_snap_start
\the\everymathalignment
+ \c_math_eqalign_row \zerocount
\c_math_eqalign_column\zerocount
\edef\p_math_alignment_number{\mathalignmentparameter\c!number}%
\processcommacommand
[\mathalignmentparameter\c!align]%
- {\advance\c_math_eqalign_column\plusone\math_eqalign_set_column}% takes argument
+ {\advanceby\c_math_eqalign_column\plusone\math_eqalign_set_column}% takes argument
\global\c_math_eqalign_column\plusone
+ \strc_math_setup_spacing_aligned\mathalignmentparameter
\dostarttagged\t!math\empty
\dostarttagged\t!mtable\currentmathalignment
- \numberedeqalign}
+ % is this check still valid?
+ \ifmmode
+ % we're always in mathmode
+ \the\mathdisplayaligntweaks
+ \ifcsname\??mathalignlocation\mathalignmentparameter\c!location\endcsname
+ \lastnamedcs % top|bottom|center as suggested by HM
+ \else
+ \vcenter
+ \fi
+ \fi
+ \bgroup
+ \ifcstok{\formulaparameter\c!location}\v!left
+ \math_prepare_l_eqalign_no
+ \else
+ \math_prepare_r_eqalign_no
+ \fi
+ \math_halign_checked\expandafter\bgroup\the\scratchtoks\crcr}
\def\math_alignment_stop % can be protected
- {\math_finish_eqalign_no
+ {\crcr\egroup\egroup
\dostoptagged
\dostoptagged
\the\everymathalignmentdone
- \math_alignment_snap_stop}
+ \math_alignment_snap_stop
+ \endgroup}
\installcorenamespace{mathalignment}
\installcorenamespace{mathalignmentvariant}
@@ -397,19 +588,37 @@
\installcommandhandler \??mathalignment {mathalignment} \??mathalignment
\appendtoks
- \frozen\instance\setuevalue{\e!start\currentmathalignment}{\math_alignment_start[\currentmathalignment]}%
- \frozen\instance\setvalue {\e!stop \currentmathalignment}{\math_alignment_stop}%
+ \frozen\protected\instance\edefcsname\e!start\currentmathalignment\endcsname{\math_alignment_start[\currentmathalignment]}%
+ \noaligned\frozen\protected\instance \defcsname\e!stop \currentmathalignment\endcsname{\math_alignment_stop}%
\to \everydefinemathalignment
+% to be tested
+%
+% \appendtoks
+% \frozen\instance\protected\defcsname\e!start\currentmathalignment\endcsname{\math_alignment_start[\currentmathalignment]}%
+% \noaligned\frozen\instance\protected\defcsname\e!stop \currentmathalignment\endcsname{\math_alignment_stop}%
+% \to \everydefinemathalignment
+
\setupmathalignment
[\c!n=2,
\c!m=1,
\c!distance=\emwidth,
+ \c!spaceinbetween=\formulaparameter\c!spaceinbetween,
+ \c!numberthreshold=\zeropoint,
\c!grid=\v!math]
\definemathalignment[align] % default case (this is what amstex users expect)
\definemathalignment[\v!mathalignment] % prefered case (this is cleaner, less clashing)
+% this needs some consideration, it might be obsolete now:
+
+\protected\def\math_display_align_hack
+ {\everycr{\noalign{\penalty\interdisplaylinepenalty}}}
+
+\appendtoks
+ \math_display_align_hack
+\to \mathdisplayaligntweaks
+
% special case.. in case one mistypes ..
\ifdefined \startalignment
@@ -456,29 +665,33 @@
%
-\permanent\protected\def\numberedeqalign
- {\doifelse{\formulaparameter\c!location}\v!left
- \math_handle_eqalign_no_l_aligned
- \math_handle_eqalign_no_r_aligned}
-
\def\math_first_in_eqalign
{\global\c_math_eqalign_column\plusone
+ \global\advanceby\c_math_eqalign_row\plusone
\dostarttagged\t!mtablerow \empty
\dostarttagged\t!mtablecell\empty}
\def\math_next_in_eqalign
- {\global\advance\c_math_eqalign_column\plusone
+ {\global\advanceby\c_math_eqalign_column\plusone
\dostoptagged % finish cell
\dostarttagged\t!mtablecell\empty}
\def\math_left_of_eqalign
{\ifcsname\??mathalignmentvariant\number\c_math_eqalign_column\endcsname
\ifcase\lastnamedcs \or \relax \or \hfill \or \hfill \fi
+ \orelse\ifcsname\??mathalignmentvariant\number\zerocount\endcsname
+ \ifcase\lastnamedcs \or \relax \or \hfill \or \hfill \fi
+ \orelse\ifcsname\??mathalignmentvariant\number\numexpr\c_math_eqalign_column-\c_math_eqalign_repeat\relax\endcsname
+ \ifcase\lastnamedcs \or \relax \or \hfill \or \hfill \fi
\fi}
\def\math_right_of_eqalign
{\ifcsname\??mathalignmentvariant\number\c_math_eqalign_column\endcsname
\ifcase\lastnamedcs \or \hfill \or \relax \or \hfill \fi
+ \orelse\ifcsname\??mathalignmentvariant\number\zerocount\endcsname
+ \ifcase\lastnamedcs \or \hfill \or \relax \or \hfill \fi
+ \orelse\ifcsname\??mathalignmentvariant\number\numexpr\c_math_eqalign_column-\c_math_eqalign_repeat\relax\endcsname
+ \ifcase\lastnamedcs \or \hfill \or \relax \or \hfill \fi
\fi}
\newconditional\c_math_alignment_local_number % not used but when true puts in front (todo)
@@ -503,17 +716,37 @@
\fi
\fi}
-\def\math_eqalign_set_column#1% we could just add to the preamble (as with other alignments)
- {\expandafter\chardef\csname\??mathalignmentvariant\number\c_math_eqalign_column\expandafter\expandafter\expandafter\endcsname
- \ifcsname\??mathalignmentvariant#1\endcsname\lastnamedcs\else\zerocount\fi\relax}
+\protected\def\math_eqalign_set_column_indeed[#1:#2:#3]% we don't really check for all (so * will do too) ... yet
+ {\ifcstok{#2}\emptytoks
+ % current counter
+ \orelse\ifchknum#1\or
+ \c_math_eqalign_column#1\relax
+ \else
+ \c_math_eqalign_column\zerocount
+ \fi
+ \expandafter\integerdef\csname\??mathalignmentvariant\number\c_math_eqalign_column\endcsname
+ \ifcsname\??mathalignmentvariant#2\endcsname\lastnamedcs\else\zerocount\fi\relax}
-\letvalue{\??mathalignmentvariant\v!normal}\zerocount
-\letvalue{\??mathalignmentvariant\v!left }\plusone
-\letvalue{\??mathalignmentvariant\v!right }\plustwo
-\letvalue{\??mathalignmentvariant\v!middle}\plusthree
+\def\math_eqalign_set_column#1%
+ {\normalexpanded{\math_eqalign_set_column_indeed[#1::]}}
-\permanent\protected\def\math_align_NR_generic[#1][#2]%
- {\strc_formulas_place_number_nested{#1}{#2}\crcr}
+\def\math_eqalign_set_columns_step
+ {\advanceby\c_math_eqalign_column\plusone
+ %\c_math_matrix_columns\c_math_eqalign_column
+ \math_eqalign_set_column}
+
+\def\math_eqalign_set_columns#1%
+ {\c_math_eqalign_column\zerocount
+ \rawprocesscommacommand[#1]\math_eqalign_set_columns_step}
+
+% can't we reuse these numbers ?
+
+\letcsname\??mathalignmentvariant\v!normal \endcsname\zerocount
+\letcsname\??mathalignmentvariant\v!flushright\endcsname\plusone
+\letcsname\??mathalignmentvariant\v!left \endcsname\plusone
+\letcsname\??mathalignmentvariant\v!right \endcsname\plustwo
+\letcsname\??mathalignmentvariant\v!flushleft \endcsname\plustwo
+\letcsname\??mathalignmentvariant\v!middle \endcsname\plusthree
%D \starttyping
%D \placeformula[eqn0]\startformula \startalign[n=1] a\NR \stopalign \stopformula See \in[eqn0]
@@ -523,17 +756,6 @@
%D \stoptyping
%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
@@ -658,45 +880,102 @@
\setupmathcases
[\c!distance=\emwidth,
\c!strut=\v!yes, % new
- \c!numberdistance=2.5\emwidth,
- \c!left={\left\{\mskip\thinmuskip},
- \c!right={\right.}]
+ \c!spaceinbetween=\mathalignmentparameter\c!spaceinbetween,
+ %\c!numberdistance=2.5\emwidth,
+ \c!numberdistance=\zeropoint]
\appendtoks
\frozen\instance\protected\edefcsname\e!start\currentmathcases\endcsname{\math_cases_start[\currentmathcases]}%
\frozen\instance \defcsname \e!stop \currentmathcases\endcsname{\math_cases_stop}%
\to \everydefinemathcases
-\permanent\protected\def\math_cases_NC_zero
- {\math_cases_NC}
+%D Why not \unknown:
+%D
+%D \starttyping
+%D \definemathcases[mycases][simplecommand=mycases]
+%D
+%D \startformula
+%D \startmycases
+%D \NC 1 \NC x>0 \NR
+%D \NC -1 \NC x<0 \NR
+%D \stopmycases
+%D \stopformula
+%D
+%D \startformula
+%D \mycases{1,x>0;-1,x<0}
+%D \stopformula
+%D \stoptyping
-\permanent\protected\def\math_cases_MC_zero
- {\math_cases_NC
- \ifmmode\else
- \startimath
- \enforced\let\math_cases_end_math\stopimath
- \fi}
+\permanent\tolerant\protected\def\math_cases_simple[#1]#*[#2]#:#3%
+ {\begingroup
+ \edef\currentmathcases{#1}%
+ \setupcurrentmathcases[#2]%
+ \math_cases_start[\currentmathcases]%
+ \clf_simplecases{\mathcasesparameter\c!action}{#3}%
+ \math_cases_stop
+ \endgroup}
-\let\math_cases_end_math\relax
+\appendtoks
+ \edef\p_simplecommand{\mathcasesparameter\c!simplecommand}%
+ \ifempty\p_simplecommand\else
+ \frozen\protected\instance\edefcsname\p_simplecommand\endcsname{\math_cases_simple[\currentmathcases]}%
+ \fi
+\to \everydefinemathcases
-\permanent\protected\def\math_cases_NR_zero
- {\unskip
- \math_cases_end_math
+\let\math_cases_strut\relax
+
+\newinteger\c_math_cases_nc
+
+\def\math_cases_NC_zero
+ {\ifmmode\else\startimath\fi}
+
+\def\math_cases_NC_one
+ {\ifmmode\stopimath\fi
\aligntab
- \global\enforced\let\math_cases_NC\math_cases_NC_first
- \dodirectdoubleempty\math_cases_NR}
+ \ifmmode\else\startimath\fi}
+
+\def\math_cases_NC_two
+ {\ifmmode\stopimath\fi}
+
+\def\math_cases_TC_zero
+ {}
-\permanent\protected\def\math_cases_NC_first
- {\global\enforced\let\math_cases_NC\math_cases_NC_second}
+\def\math_cases_TC_one
+ {\ifmmode\stopimath\fi
+ \aligntab}
-\permanent\protected\def\math_cases_NC_second
- {\math_cases_end_math\aligntab}
+\permanent\protected\def\math_cases_NC
+ {\ifcase\c_math_cases_nc
+ \expandafter\math_cases_NC_zero
+ \or
+ \expandafter\math_cases_NC_one
+ \or
+ \expandafter\math_cases_NC_zero
+ \else
+ % error
+ \fi
+ \global\advanceby\c_math_cases_nc\plusone}
-\let\math_cases_NR\math_align_NR_generic
+\permanent\protected\def\math_cases_TC
+ {\ifcase\c_math_cases_nc
+ \expandafter\math_cases_TC_zero
+ \or
+ \expandafter\math_cases_TC_one
+ \or
+ \expandafter\math_cases_TC_two
+ \else
+ % error
+ \fi
+ \global\advanceby\c_math_cases_nc\plusone}
-\installmacrostack\math_cases_NC
+\noaligned\tolerant\permanent\protected\def\math_cases_NR[#1]#*[#2]%
+ {\unskip
+ \ifmmode\stopimath\fi
+ \aligntab
+ \global\c_math_cases_nc\zerocount
+ \strc_formulas_place_number_nested{#1}{#2}\crcr}
-\let\math_cases_strut\relax
+\installglobalmacrostack\c_math_cases_nc
\permanent\tolerant\protected\def\math_cases_start[#1]#*[#2]%
{\begingroup
@@ -710,58 +989,79 @@
\else
\enforced\let\math_cases_strut\relax
\fi
+ \push_macro_c_math_cases_nc
+ \mathatom \s!class \mathwrappedcode \bgroup
+ \scratchdimen\mathcasesparameter\c!leftmargin\relax
+ \ifzeropt\scratchdimen\else\kern\scratchdimen\fi
\mathcasesparameter\c!left
+ \math_fenced_start_wrap{\mathcasesparameter\c!fences}%
+ \mathatom \s!class \mathconstructcode \bgroup
\vcenter\bgroup
- \push_macro_math_cases_NC
- % \enforced\let\endmath\relax
- \enforced\let\NC\math_cases_NC_zero
- \enforced\let\MC\math_cases_MC_zero
- \enforced\let\NR\math_cases_NR_zero
+ \enforced\let\MC\math_cases_NC
+ \enforced\let\NC\math_cases_NC
+ \enforced\let\NR\math_cases_NR
+ \enforced\let\TC\math_cases_TC
\enforced\let\TB\math_common_TB
- \global\enforced\let\math_cases_NC\math_cases_NC_first
- \normalbaselines
- \mathsurround\zeropoint
- \everycr\emptytoks
- \tabskip\zeropoint
+ \math_eqalign_set_defaults
\global\c_math_eqalign_column\plusone
- \halign\bgroup
- \startimath
+ \global\c_math_eqalign_row\plusone
+ \global\c_math_cases_nc\zerocount
+ \strc_math_setup_spacing_aligned\mathcasesparameter
+ \enablematrixalign
+ \halign callback \s!attr \mathnumberlocationattribute \zerocount \bgroup % use \indexofregister here
+ \ifmmode\else\startimath\fi
\mathcasesparameter\c!style
- \alignmark\alignmark
- \stopimath
+ \aligncontent
+ \ifmmode\stopimath\fi
\hfil
\aligntab
- \hskip\mathcasesparameter\c!distance\relax
- \pop_macro_math_cases_NC
+ \kern\mathcasesparameter\c!distance\relax % hskip
\math_cases_strut % looks better
- \alignmark\alignmark
+ \aligncontent
\hfil
\aligntab
- \hskip\mathcasesparameter\c!numberdistance\relax
- % \let\formuladistance\!!zeropoint
- \span\math_text_in_eqalign{\alignmark\alignmark}%
+ \kern\mathcasesparameter\c!numberdistance\relax % hskip
+ \span\math_text_in_eqalign{\aligncontent}%
\crcr} % todo: number
-% When we have just protected we get an extra row but we can no flag
-% this as a proper alignment related command which means that uit gets
-% expanded.
-
\noaligned\permanent\protected\def\math_cases_stop
{\crcr
\egroup
- \pop_macro_math_cases_NC
\egroup
- \mathcasesparameter\c!right
+ \egroup
+ \math_fenced_stop_wrap
+ \mathcasesparameter\c!right\relax
+ \scratchdimen\mathcasesparameter\c!rightmargin\relax
+ \ifzeropt\scratchdimen\else\kern\scratchdimen\fi
+ \egroup
+ \pop_macro_c_math_cases_nc
\endgroup}
+% \definemathfence [cases] [\c!left="007B,\c!right=\v!none]
+% \definemathfence [sesac] [\c!left=\v!none,\c!right="007D]
+
\definemathcases[cases]
\definemathcases[\v!mathcases]
+% This might become key=cases in the end:
+
+\setupmathcases
+% [cases]
+ [\c!leftmargin=\zeropoint,
+ \c!rightmargin=\zeropoint,
+ \c!left=,
+ \c!right=,
+ \c!fences=cases]
+
+\definemathcases
+ [sesac]
+ [\c!fences=sesac]
+
%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 \NC 2 \NC y > 0 \NR
+%D \NC 7 \NC x = 7 \NR[+]
+%D \NC 4 \TC otherwise \NR
%D \stopcases \stopformula
%D \stopbuffer
%D
@@ -769,9 +1069,9 @@
%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 \NC 2 \NC y > 0 \NR[+]
+%D \NC 7 \NC x = 7 \NR
+%D \NC 4 \TC otherwise \NR
%D \stopcases \stopformula
%D \stopbuffer
%D
@@ -779,9 +1079,9 @@
%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 \NC 2 \NC y > 0 \NR
+%D \NC 7 \NC x = 7 \NR
+%D \NC 4 \TC otherwise \NR
%D \stopcases \stopformula
%D \stopbuffer
%D
@@ -789,9 +1089,9 @@
%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 \NC 2 \NC y > 0 \NR
+%D \NC 7 \NC x = 7 \NR
+%D \NC 4 \TC otherwise \NR
%D \stopcases \stopformula
%D \stopbuffer
%D
@@ -804,15 +1104,21 @@
%D different which is a side effect of getting the tagging right. In
%D retrospect the main alignment could be done this way but \unknown
+%D In the end is is way easier to not use alignments and just paste boxes together
+%D but let's be a bit texie.
+
\installcorenamespace{mathmatrix}
\installcommandhandler \??mathmatrix {mathmatrix} \??mathmatrix
\setupmathmatrix
[\c!distance=\emwidth,
+ \c!fences=,
\c!left=,
\c!right=,
\c!align=\v!middle,
+ \c!leftmargin=\zeropoint,
+ \c!rightmargin=\zeropoint,
\c!rulecolor=,
\c!rulethickness=\linewidth]
@@ -822,8 +1128,12 @@
\frozen\instance \defcsname \e!stop \currentmathmatrix\endcsname{\math_matrix_stop}% no u else lookahead problem
\to \everydefinemathmatrix
+\newinteger\c_math_matrix_columns
+
\def\math_matrix_start_table
{\global\c_math_eqalign_column\zerocount
+ \global\c_math_eqalign_row\zerocount
+ \global\c_math_matrix_columns\zerocount
\dostarttagged\t!math\empty
\dostarttagged\t!mtable\empty}
@@ -831,16 +1141,11 @@
{\dostoptagged
\dostoptagged}
-% \def\math_matrix_start_row
-% {\noalign{\global\c_math_eqalign_column\zerocount}%
-% \dostarttagged\t!mtablerow\empty}
-%
-% \def\math_matrix_stop_row
-% {\dostoptagged}
-
\def\math_matrix_start_row
{\beginlocalcontrol
+ \global\c_math_matrix_columns\c_math_eqalign_column
\global\c_math_eqalign_column\zerocount
+ \global\advanceby\c_math_eqalign_row\plusone
\dostarttagged\t!mtablerow\empty
\endlocalcontrol}
@@ -855,7 +1160,6 @@
\math_left_of_eqalign
\startimath
\math_matrix_set_style
- \tabskip\zeropoint
\everycr\emptytoks}
\protected\def\math_matrix_stop_cell
@@ -864,34 +1168,164 @@
\hss
\dostoptagged}
+% \dorecurse{10}{test }
+%
+% \startformula
+% \startmatrix[left=\left(,right=\right)]
+% \NC x \NC \NC yy \NC \NC zzz \NR
+% \NC x \NC \dots \NC yy \NC \dots \NC zzz \NR
+% \HF[2] \NR
+% \NC x \NC \dots \NC yy \NC \dots \NC zzz \NR
+% \HF \NR
+% \NC x \NC \dots \NC yy \NC \dots \NC zzz \NR
+% \NC \HF[2] \NR
+% \NC x \NC \dots \NC yy \NC \dots \NC zzz \NR
+% \NC \NC \HF[2][rule] \NR
+% \NC x \NC \dots \NC yy \NC \dots \NC zzz \NR
+% \HL
+% \NC x \VL \dots \VL yy \NC \dots \VL zzz \NR
+% \NC x \VL \dots \VL yy \NC \dots \VL zzz \NR
+% \HL
+% \stopmatrix
+% \stopformula
+%
+% \dorecurse{10}{test }
+%
+% \startformula
+% \startmatrix[left=\left(,right=\right)]
+% \NC \TT \ttx 1 \NC \TT \ttx 2 \NC \TT \ttx 3 \NC \NR
+% \LT \ttx 1 \NC a \NC \dots \NC aa \NC \dots \NC aaa \RT \ttx 1 \NR
+% \LT \ttx 2 \NC b \NC \dots \NC bb \NC \dots \NC bbb \RT \ttx 2 \NR
+% \LT \ttx 3 \NC c \NC \dots \NC cc \NC \dots \NC ccc \RT \ttx 3 \NR
+% \NC \BT \ttx 1 \NC \BT \ttx 2 \NC \BT \ttx 3 \NC \NR
+% \stopmatrix
+% \stopformula
+%
+% \dorecurse{10}{test }
+%
+% \startformula
+% \startmatrix[left=\left(,right=\right)]
+% \NC \TT \ttx 1 \NC \TT \ttx 2 \NC \TT \ttx 3 \NR
+% \LT \ttx 1 \NC a \NC \dots \NC aa \NC \dots \NC aaa \NR
+% \LT \ttx 2 \NC b \NC \dots \NC bb \NC \dots \NC bbb \NR
+% \LT \ttx 3 \NC c \NC \dots \NC cc \NC \dots \NC ccc \NR
+% \NC \BT \ttx 1 \NC \BT \ttx 2 \NC \BT \ttx 3 \NR
+% \stopmatrix
+% \stopformula
+%
+% \dorecurse{10}{test }
+
+\newtoks\everymathmatrix
+
+\tolerant\permanent\def\math_matrix_HF[#1]#*[#2]% [n] [name] | [name] | [n]
+ {\expandedloop
+ \plusone
+ \numexpr\ifchknum#1\or#1\else(\c_math_matrix_columns+\minusone)\fi*\plustwo\relax
+ \plusone
+ {\omit\span}%
+ \normalexpanded{\filler[%
+ \ifcsname\??filleralternative matrix:#1\endcsname matrix:#1\orelse
+ \ifcsname\??filleralternative matrix:#2\endcsname matrix:#2\orelse
+ \ifcsname\??filleralternative #1\endcsname #1\orelse
+ \ifcsname\??filleralternative #2\endcsname #2\else
+ matrix:\v!normal\fi
+ ]}}
+
+\appendtoks
+ \enforced\let\HF\math_matrix_HF
+\to \everymathmatrix
+
+\definefiller
+ [matrix:\v!normal]
+ [\c!symbol=\textperiod,
+ \c!style=\v!normal,
+ \c!method=\v!broad,
+ \c!width=\emwidth,
+ \c!leftmargin=-.1\emwidth,
+ \c!rightmargin=-.1\emwidth]
+
+\definefiller
+ [matrix:\v!middle]
+ [\c!symbol=\textperiod,
+ \c!style=\v!normal,
+ \c!method=\v!middle,
+ \c!width=\emwidth,
+ \c!leftmargin=.5\emwidth,
+ \c!rightmargin=.5\emwidth]
+
+\definefiller
+ [matrix:ldots]
+ [matrix:\v!normal]
+
+\definefiller
+ [matrix:cdots]
+ [matrix:\v!normal]
+ [\c!symbol=\cdot]
+
% We could construct a preamble with alignment and such embedded but the number
% of matrices with many rows is normally so low that it doesn't pay of at all.
-\protected\def\math_matrix_distance
+\newconditional\c_math_matrix_first
+\newconstant \c_math_matrix_anchor_mode
+
+% enabled : 1
+% left/both : 2
+% right/both : 4
+
+\permanent\protected\def\setmathmatrixanchoring[#1]%
+ {\c_math_matrix_anchor_mode\zerocount
+ \processaction
+ [#1]%
+ [\v!both=>\c_math_matrix_anchor_mode\plusone,%
+ \v!yes=>\c_math_matrix_anchor_mode\plusone]}
+
+\def\math_matrix_anchor
+ {\ifcase\c_math_matrix_anchor_mode\else
+ \markanchor{matrix}{\numexpr\c_math_eqalign_column+\plusone\relax}\c_math_eqalign_row
+ \fi}
+
+\protected\def\math_matrix_anchor_first
{\relax
- \ifdim\d_math_eqalign_distance>\zeropoint
- \hskip\d_math_eqalign_distance
- \fi
- \relax}
+ \ifcase\c_math_matrix_anchor_mode\else
+ \math_matrix_anchor
+ % \ifdim\d_math_eqalign_distance>\zeropoint
+ % \ifbitwiseand\c_math_matrix_anchor_mode\plustwo
+ % \kern.5\d_math_eqalign_distance
+ % \fi
+ % \fi
+ \fi}
+
+\protected\def\math_matrix_anchor_last
+ {\relax
+ \ifcase\c_math_matrix_anchor_mode\else
+ % \ifdim\d_math_eqalign_distance>\zeropoint
+ % \ifbitwiseand\c_math_matrix_anchor_mode\plusfour
+ % \kern.5\d_math_eqalign_distance
+ % \fi
+ % \fi
+ \math_matrix_anchor
+ \fi}
\def\math_matrix_preamble
{\math_matrix_strut
- \global\advance\c_math_eqalign_column\plusone
+ \math_matrix_anchor_first
+ \global\advanceby\c_math_eqalign_column\plusone
\math_matrix_start_cell
- \alignmark\alignmark
+ \aligncontent
\math_matrix_stop_cell
\aligntab
\aligntab
- \math_matrix_distance
- \global\advance\c_math_eqalign_column\plusone
+ \math_matrix_anchor
+ \kern.5\d_math_eqalign_distance % hskip
+ \aligncontent
+ \aligntab
+ \global\advanceby\c_math_eqalign_column\plusone
\math_matrix_start_cell
- \alignmark\alignmark
+ \aligncontent
\math_matrix_stop_cell}
-\newconditional\c_math_matrix_first
-
\permanent\protected\def\math_matrix_NR
- {\aligntab\omit
+ {\math_matrix_anchor_last
\math_matrix_stop_row
\math_matrix_pickup
\crcr
@@ -906,18 +1340,16 @@
\permanent\protected\def\math_matrix_pickup{\global\settrue \c_math_matrix_first}
\permanent\protected\def\math_matrix_NC_yes{\global\setfalse\c_math_matrix_first}
-\permanent\protected\def\math_matrix_NC_nop{\aligntab} % avoids lookahead
-
-% \def\math_matrix_stop_wrapup
-% {\crcr
-% \strut
-% \crcr
-% \noalign{\vskip-\struthtdp}}
+\permanent\protected\def\math_matrix_NC_nop{\aligntab\aligntab} % avoids lookahead
\def\math_matrix_check_rule_step#1%
- {\doifelsenumber{#1}
- {\scratchdimen#1\d_math_eqalign_rulethickness}
- {\edef\p_rulecolor{#1}}}
+ {\ifchkdim#1\or
+ \scratchdimen#1\relax
+ \orelse\ifchknum#1\or
+ \scratchdimen#1\d_math_eqalign_rulethickness
+ \else
+ \edef\p_rulecolor{#1}
+ \fi}
\def\math_matrix_check_rule[#1]%
{\d_math_eqalign_rulethickness\mathmatrixparameter\c!rulethickness\relax
@@ -930,45 +1362,299 @@
\dousecolorparameter\p_rulecolor
\fi}
+% These offset are an experiment so we abuse some existing keys or we have to
+% cook up new ones. Maybe we then should provide small medium big halfline etc.
+% but all depends on actual demand for this feature.
+
+% Musical timestamp VL, NL, SL: Bad Hombre II by Antonio Sanches
+%
+% \startformula
+% \startmatrix[left=\left(,right=\right)]
+% \NC 0 \NL 0 \NC 0 \NC 2x \NC 1 \NC 0 \NC 0 \NL \NR
+% \NC 0 \VL 0 \NC 0 \NC 0 \NC 2x \NC 0 \NC 0 \NL \NR
+% \NC 0 \VL 0 \NC 0 \NC 0 \NC 0 \NC 3x \NC 0 \NL \NR
+% \NC 0 \NL 0 \NC 0 \NC 0 \NC 0 \NC 0 \NC 4x \VL \NR
+% \stopmatrix
+% \stopformula
+%
+% \startformula
+% \startmatrix[left=\left(,right=\right)]
+% \SL[3] \NL \NL \NL \NL \NL \NR
+% \VL 2x \NL 1 \NL 0 \VL 0 \NL 0 \NL 0 \NL 0 \NL \NR
+% \VL 0 \NL 2x \NL 1 \VL 0 \NL 0 \NL 0 \NL 0 \NL \NR
+% \VL 0 \NL 0 \NL 2x \VL 0 \NL 0 \NL 0 \NL 0 \NL \NR
+% \SL[5] \NL \NL \NL \NR
+% \NL 0 \NL 0 \NL 0 \VL 2x \NL 1 \VL 0 \NL 0 \NL \NR
+% \NL 0 \NL 0 \NL 0 \VL 0 \NL 2x \VL 0 \NL 0 \NL \NR
+% \NL \NL \NL \SL[3] \NL \NL \NR
+% \NL 0 \NL 0 \NL 0 \NL 0 \NL 0 \VL 3x \VL 0 \NL \NR
+% \NL \NL \NL \NL \NL \SL[2] \NL \NR
+% \NL 0 \NL 0 \NL 0 \NL 0 \NL 0 \NL 0 \VL 3x \VL \NR
+% \NL \NL \NL \NL \NL \NL \SL[1] \NL \NR
+% \stopmatrix
+% \stopformula
+
+\definesystemattribute[mathalignmentvrule][public]
+\definesystemattribute[mathalignmenthrule][public]
+
+\setupmathmatrix
+ [%c!toffset=\zeropoint,
+ \c!toffset=.25\exheight,
+ \c!boffset=\mathmatrixparameter\c!toffset]
+
\noaligned\permanent\tolerant\protected\def\math_matrix_HL[#1]#*%
{\noalign\bgroup
\math_matrix_check_rule[#1]%
- \divide\scratchdimen\plustwo
- \autorule\s!height\scratchdimen\s!depth\scratchdimen\relax
+ \divideby\scratchdimen\plustwo
+ \ifdim\scratchdimen>\zeropoint
+ % \autorule\s!height\scratchdimen\s!depth\scratchdimen\relax
+ \scratchdistance\mathmatrixparameter\c!toffset\relax
+ \ifdim\scratchdistance>\zeropoint
+ \nohrule
+ \s!attr \mathalignmentvruleattribute\plustwo
+ \s!height\scratchdistance
+ \s!depth \zeropoint
+ \relax
+ \fi
+ \hrule
+ \s!attr \mathalignmentvruleattribute\plusthree
+ \s!height\scratchdimen
+ \s!depth \scratchdimen
+ \relax
+ \scratchdistance\mathmatrixparameter\c!boffset\relax
+ \ifdim\scratchdistance>\zeropoint
+ \nohrule
+ \s!attr \mathalignmentvruleattribute\plusfour
+ \s!height\zeropoint
+ \s!depth \scratchdistance
+ \relax
+ \fi
+ \else
+ % zero dimensions disable the rule
+ \fi
\egroup}
+\protected\def\math_matrix_vertical_rule_indeed#1#2%
+ {\math_matrix_check_rule[#2]%
+ \enablematrixrules
+ #1
+ \s!attr \mathalignmentvruleattribute\plusone
+ \s!width \scratchdimen
+ \s!top -\dimexpr\mathmatrixparameter\c!toffset\relax
+ \s!bottom-\dimexpr\mathmatrixparameter\c!boffset\relax
+ \relax}
+
+\protected\def\math_matrix_vertical_rule_yes{\math_matrix_vertical_rule_indeed\vrule }
+\protected\def\math_matrix_vertical_rule_nop{\math_matrix_vertical_rule_indeed\novrule}
+
+\installcorenamespace{mathmatrixrulealternative}
+
+\newboundary\c_math_matrix_vl_boundary
+%newboundary\c_math_matrix_sl_boundary
+
+\protected\def\math_matrix_horizontal_rule_indeed#1#2%
+ {\math_matrix_check_rule[#2]%
+ \global\setfalse\c_math_matrix_first
+ \global\settrue\c_math_matrix_sl_seen
+ \enablematrixrules
+ \leaders#1%
+ \s!attr \mathalignmenthruleattribute\plusone
+ \s!height .5\scratchdimen
+ \s!depth .5\scratchdimen
+ % \s!top -\dimexpr\mathmatrixparameter\c!toffset\relax
+ % \s!bottom-\dimexpr\mathmatrixparameter\c!boffset\relax
+ \hfilll
+ \kern\dimexpr.5\d_math_eqalign_distance\relax
+ \aligntab}
+
+\protected\def\math_matrix_horizontal_rule_yes{\math_matrix_horizontal_rule_indeed\hrule }
+\protected\def\math_matrix_horizontal_rule_nop{\math_matrix_horizontal_rule_indeed\nohrule}
+
+\def\math_matrix_hrule_progress_rest#1%
+ {\expandedloop
+ \plusone
+ \numexpr(\ifchknum#1\or#1\else\c_math_matrix_columns\fi)*\plustwo+\minusone\relax
+ \plusone
+ {\span\omit}}%
+
+\def\math_matrix_hrule_progress_first#1%
+ {\expandedloop
+ \plusone
+ \numexpr(\ifchknum#1\or#1\else\c_math_matrix_columns\fi+\minusone)*\plustwo+\plusone\relax
+ \plusone
+ {\span\omit}}%
+
+\def\math_matrix_hrule_progress
+ {\NL
+ \ifconditional\c_math_matrix_first
+ \expandafter\math_matrix_hrule_progress_first
+ \else
+ \expandafter\math_matrix_hrule_progress_rest
+ \fi}
+
+\tolerant\permanent\protected\def\SL[#1]#*[#2]#*% [n] [name] | [name] | [n]
+ {\ifcsname\??mathmatrixrulealternative#2\endcsname
+ \lastnamedcs{#1}{#2}%
+ \orelse\ifcsname\??mathmatrixrulealternative#1\endcsname
+ \lastnamedcs{#2}{#1}%
+ \else
+ \csname\??mathmatrixrulealternative\v!auto\endcsname{#1}{#2}%
+ \fi}
+
+\defcsname\??mathmatrixrulealternative\v!auto\endcsname#1#2%
+ {\math_matrix_hrule_progress{#1}%
+ % \ifzero\c_math_matrix_first
+ % \kern-\dimexpr\linewidth\relax
+ % \else
+ % \kern-\dimexpr.5\d_math_eqalign_distance+\linewidth\relax
+ % \fi
+ \kern-\dimexpr\ifzero\c_math_matrix_first\else.5\d_math_eqalign_distance+\fi\linewidth\relax
+ \math_matrix_horizontal_rule_yes{#2}%
+ %boundary\c_math_matrix_sl_boundary
+ \enforced\let\NR\math_matrix_NL_NR}
+
\permanent\tolerant\protected\def\math_matrix_VL[#1]#*%
+ {\span\omit
+ \ifconditional\c_math_matrix_first\else
+ \kern.5\d_math_eqalign_distance % hskip
+ \fi
+ \math_matrix_vertical_rule_yes{#1}%
+ \kern.5\d_math_eqalign_distance % hskip
+ \global\setfalse\c_math_matrix_first
+ \aligntab
+ \boundary\c_math_matrix_vl_boundary
+ \enforced\let\NR\math_matrix_NL_NR
+ }
+
+\permanent\tolerant\protected\def\math_matrix_NL[#1]#*%
+ {\span\omit
+ \ifconditional\c_math_matrix_first\else
+ \kern.5\d_math_eqalign_distance % hskip
+ \fi
+ \math_matrix_vertical_rule_nop{#1}%
+ \kern.5\d_math_eqalign_distance % hskip
+ \global\setfalse\c_math_matrix_first
+ \aligntab
+ \boundary\c_math_matrix_vl_boundary
+ \enforced\let\NR\math_matrix_NL_NR}
+
+\permanent\protected\def\math_matrix_NL_NR
+ {\ifnum\lastboundary=\c_math_matrix_vl_boundary
+ \ifconditional \c_math_matrix_sl_seen
+ \kern-1.5\d_math_eqalign_distance % hskip
+ \else
+ \kern-.5\d_math_eqalign_distance % hskip
+ \fi
+ \fi
+ \math_matrix_anchor_last
+ \math_matrix_stop_row
+ \math_matrix_pickup
+ \crcr
+ \math_matrix_start_row}
+
+\appendtoks
+ \enforced\let\NL\math_matrix_NL
+ \global\setfalse\c_math_matrix_sl_seen
+\to \everymathmatrix
+
+\permanent\tolerant\protected\def\math_matrix_VC[#1]#*%
{\NC
- \math_matrix_check_rule[#1]%
- \divide\d_math_eqalign_distance\plustwo
- \hskip-\d_math_eqalign_distance
- \autorule\s!width\scratchdimen\relax
- \hskip-\d_math_eqalign_distance
+ \math_matrix_vertical_rule_yes{#1}%
\NC}
-\newtoks\everymathmatrix
+\permanent\tolerant\protected\def\math_matrix_VT[#1]#*%
+ {\span\omit
+ \math_matrix_vertical_rule_yes{#1}%
+ \aligntab}
+
+\def\math_matrix_start_row
+ {\beginlocalcontrol
+ \global\c_math_matrix_columns\c_math_eqalign_column
+ \global\c_math_eqalign_column\zerocount
+ \global\advanceby\c_math_eqalign_row\plusone
+ \dostarttagged\t!mtablerow\empty
+ \endlocalcontrol}
\appendtoks
\enforced\let\NR\math_matrix_NR
\enforced\let\NC\math_matrix_NC
\enforced\let\MC\math_matrix_NC
- \enforced\let\HL\math_matrix_HL
- \enforced\let\VL\math_matrix_VL
+ \enforced\let\HL\math_matrix_HL % like the old ones
+ \enforced\let\VL\math_matrix_VL % like the old ones
+ \enforced\let\VC\math_matrix_VC % bonus, extra column
+ \enforced\let\VT\math_matrix_VT % bonus, idem but tight
\enforced\let\TB\math_common_TB
\to \everymathmatrix
+\definesystemattribute[mathmatrixornament][public]
+
+\newdimension\d_math_matrix_margin_l
+\newdimension\d_math_matrix_margin_r
+\newdimension\d_math_matrix_margin_t
+\newdimension\d_math_matrix_margin_b
+
+\newboundary \c_math_matrix_ornament_l
+\newboundary \c_math_matrix_ornament_r
+\newboundary \c_math_matrix_ornament_t
+\newboundary \c_math_matrix_ornament_b
+
+% anchors are wrong now
+
+\newconditional\c_math_matrix_text
+\newconditional\c_math_matrix_text_l
+\newconditional\c_math_matrix_text_r
+\newconditional\c_math_matrix_text_t
+\newconditional\c_math_matrix_text_b
+
+\def\math_matrix_ornaments#1#2%
+ {\NC
+ \enablematrixornaments
+ \global\settrue\c_math_matrix_text
+ \global\settrue#1
+ \boundary#2%
+ \ignorespaces}
+
+\permanent\protected\def\math_matrix_LT{\math_matrix_ornaments\c_math_matrix_text_l\c_math_matrix_ornament_l}
+\permanent\protected\def\math_matrix_RT{\math_matrix_ornaments\c_math_matrix_text_r\c_math_matrix_ornament_r}
+\permanent\protected\def\math_matrix_TT{\math_matrix_ornaments\c_math_matrix_text_t\c_math_matrix_ornament_t}
+\permanent\protected\def\math_matrix_BT{\math_matrix_ornaments\c_math_matrix_text_b\c_math_matrix_ornament_b}
+
+\appendtoks
+ \global\setfalse\c_math_matrix_text
+ \global\setfalse\c_math_matrix_text_l
+ \global\setfalse\c_math_matrix_text_r
+ \global\setfalse\c_math_matrix_text_t
+ \global\setfalse\c_math_matrix_text_b
+ \enforced\let\LT\math_matrix_LT
+ \enforced\let\RT\math_matrix_RT
+ \enforced\let\TT\math_matrix_TT
+ \enforced\let\BT\math_matrix_BT
+\to \everymathmatrix
+
\def\math_matrix_start_processing
- {\dontleavehmode
+ {\ifmmode
+ \mathatom \s!class \mathwrappedcode
+ \else
+ \dontleavehmode
+ \fi
\bgroup
+ \d_math_matrix_margin_l\mathmatrixparameter\c!leftmargin \relax
+ \d_math_matrix_margin_r\mathmatrixparameter\c!rightmargin\relax
+ \d_math_matrix_margin_t\strutdp
+ \d_math_matrix_margin_b\strutht
+ %\tabskip.5\d_math_eqalign_distance
\tabskip\zeropoint
\math_matrix_pickup
\the\everymathmatrix
%
- % \enforced\let\endmath\relax
- %
\setbox\nextbox\vbox\bgroup
\math_matrix_start_table
- \halign \bgroup
+ \halign
+ callback
+ \s!attr \mathmatrixornamentattribute "10
+ \s!attr \mathalignmentvruleattribute \plusone
+ \s!attr \mathalignmenthruleattribute \plusone
+ \bgroup
% preamble
\span\math_matrix_preamble
% done
@@ -981,9 +1667,9 @@
\egroup
\math_matrix_stop_table
\egroup
- \mathmatrixleft
+ \mathmatrixleft % experimental hook
\math_matrix_finish_nextbox
- \mathmatrixright
+ \mathmatrixright % experimental hook
\egroup}
\let\math_matrix_strut \strut
@@ -1004,21 +1690,8 @@
% \edef\p_rulecolor{\mathmatrixparameter\c!rulecolor}
\edef\math_matrix_set_style{\mathmatrixparameter\c!style}}
-\def\math_matrix_set_defaults
- {\normalbaselines % hm, spacing ?
- \mathsurround\zeropoint
- \tabskip\zeropoint}
-
-\def\math_matrix_set_columns_step
- {\advance\c_math_eqalign_column\plusone
- %\c_math_matrix_columns\c_math_eqalign_column
- \math_eqalign_set_column}
-
-\def\math_matrix_set_columns
- {\c_math_eqalign_column\zerocount
- \rawprocesscommacommand[\mathmatrixparameter\c!align]\math_matrix_set_columns_step}
-
-\newcount\c_math_eqalign_column_saved
+\newinteger\c_math_eqalign_column_saved
+\newinteger\c_math_eqalign_row_saved
% \installglobalmacrostack\c_math_matrix_first
@@ -1026,18 +1699,20 @@
{\begingroup
\globalpushmacro\c_math_matrix_first % hm, does that work?
\c_math_eqalign_column_saved\c_math_eqalign_column
+ \c_math_eqalign_row_saved\c_math_eqalign_row
\globalpushmacro\c_math_eqalign_first
\edef\currentmathmatrix{#1}%
\setupcurrentmathmatrix[#2]%
\math_matrix_check_settings
- \math_matrix_set_defaults
- \math_matrix_set_columns
+ \math_eqalign_set_defaults
+ \math_eqalign_set_columns{\mathmatrixparameter\c!align}%
\math_matrix_start_processing}
\def\math_matrix_stop
{\math_matrix_stop_processing
\globalpushmacro\c_math_eqalign_first
\global\c_math_eqalign_column\c_math_eqalign_column_saved
+ \global\c_math_eqalign_row\c_math_eqalign_row_saved
\globalpopmacro\c_math_matrix_first
\endgroup}
@@ -1050,25 +1725,47 @@
\installcorenamespace{mathmatrixalignlocation}
-\mutable\let\mathmatrixleft \empty % experimental hook
-\mutable\let\mathmatrixright\empty % experimental hook
+\mutable\lettonothing\mathmatrixleft % experimental hook
+\mutable\lettonothing\mathmatrixright % experimental hook
-\setvalue{\??mathmatrixalignlocation\v!top }{\raise\dimexpr(\nextboxdp-\nextboxht)/2 +\mathaxisheight\mathstyle\relax}
-\setvalue{\??mathmatrixalignlocation\v!high }{\raise\dimexpr(\nextboxdp-\nextboxht)/2\relax}
-\setvalue{\??mathmatrixalignlocation\v!center}{\relax}
-\setvalue{\??mathmatrixalignlocation\v!lohi} {\relax}
-\setvalue{\??mathmatrixalignlocation\v!normal}{\relax}
-\setvalue{\??mathmatrixalignlocation\v!bottom}{\lower\dimexpr(\nextboxdp-\nextboxht)/2 +\mathaxisheight\mathstyle\relax}
-\setvalue{\??mathmatrixalignlocation\v!low }{\lower\dimexpr(\nextboxdp-\nextboxht)/2\relax}
+\defcsname\??mathmatrixalignlocation\v!top \endcsname{\raise\dimexpr(\nextboxdp-\nextboxht)/2 +\mathaxisheight\mathstyle\relax}
+\defcsname\??mathmatrixalignlocation\v!high \endcsname{\raise\dimexpr(\nextboxdp-\nextboxht)/2\relax}
+\defcsname\??mathmatrixalignlocation\v!center\endcsname{\relax}
+\defcsname\??mathmatrixalignlocation\v!lohi \endcsname{\relax}
+\defcsname\??mathmatrixalignlocation\v!normal\endcsname{\relax}
+\defcsname\??mathmatrixalignlocation\v!bottom\endcsname{\lower\dimexpr(\nextboxdp-\nextboxht)/2 +\mathaxisheight\mathstyle\relax}
+\defcsname\??mathmatrixalignlocation\v!low \endcsname{\lower\dimexpr(\nextboxdp-\nextboxht)/2\relax}
\def\math_matrix_finish_nextbox
- {\begincsname\??mathmatrixalignlocation\mathmatrixparameter\c!location\endcsname\hbox\bgroup
+ {\scratchcounter\mathstyle\relax
+ \scratchwidth\wd\nextbox
+ \setbox\scratchbox\begincsname\??mathmatrixalignlocation\mathmatrixparameter\c!location\endcsname\hbox\bgroup
\normalstartimath
- \mathmatrixparameter\c!left
- \vcenter{\box\nextbox}%
- \mathmatrixparameter\c!right
+ \Ustyle\scratchcounter
+ \ifzeropt\d_math_matrix_margin_l\else\kern\d_math_matrix_margin_l\fi
+ \mathmatrixparameter\c!left\relax
+ \math_fenced_start_wrap{\mathmatrixparameter\c!fences}%
+ \mathatom \s!class \mathconstructcode {\vcenter{\box\nextbox}}% \was \vcenter
+ \math_fenced_stop_wrap
+ \mathmatrixparameter\c!right\relax
+ \ifzeropt\d_math_matrix_margin_r\else\kern\d_math_matrix_margin_r\fi
\normalstopimath
- \egroup}
+ \egroup
+ \ifconditional\c_math_matrix_text
+ \ifcstok{\mathmatrixparameter\c!left\mathmatrixparameter\c!right}\emptytoks\else
+ \scratchdistance\dimexpr(\wd\scratchbox-\scratchwidth)/\plustwo\relax
+ \advanceby\d_math_matrix_margin_l\scratchdistance
+ \advanceby\d_math_matrix_margin_r\scratchdistance
+ \clf_shiftmatrixornaments\scratchbox
+ \fi
+ \fi
+ \ifconditional\c_math_matrix_text_b
+ \dp\scratchbox\dimexpr\dp\scratchbox+\lineheight\relax
+ \fi
+ \ifconditional\c_math_matrix_text_t
+ \ht\scratchbox\dimexpr\ht\scratchbox+\lineheight\relax
+ \fi
+ \box\scratchbox}
\definemathmatrix[matrix]
\definemathmatrix[\v!mathmatrix]
@@ -1210,25 +1907,37 @@
{\math_matrix_stop
\endgroup}
-%D The following code is derived from Aditya's simplematrix prototype but
-%D adapted to regular mathmatrices (which saves some code so it can go into
-%D the core):
-
-\def\math_matrix_simple_row#1%
- {\rawprocesscommalist[#1]\math_matrix_simple_col
- \toksapp\scratchtoks{\NR}}
-
-\def\math_matrix_simple_col#1%
- {\toksapp\scratchtoks{\NC#1}}
+%D The following code is derived from Aditya's simplematrix prototype but adapted to
+%D regular mathmatrices. With a little help from \LUA\ we now have this:
+%D
+%D \startbuffer
+%D \definemathmatrix [Pmatrix] [matrix:parentheses]
+%D [align={all:right},
+%D simplecommand=Pmatrix]
+%D
+%D \definemathmatrix [Tmatrix] [Pmatrix]
+%D [action=transpose,
+%D simplecommand=Tmatrix]
+%D
+%D \definemathmatrix [Nmatrix] [Pmatrix]
+%D [action=negate,
+%D simplecommand=Nmatrix]
+%D
+%D \startformula
+%D \Pmatrix{ -1, 2, 3; 4,-5, 6; 7, 8,-9 } \neq
+%D \Tmatrix{ -1, 2, 3; 4,-5, 6; 7, 8,-9 } \neq
+%D \Nmatrix{ -1, 2, 3; 4,-5, 6; 7, 8,-9 }
+%D \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
\permanent\tolerant\protected\def\math_matrix_simple[#1]#*[#2]#:#3%
{\begingroup
\edef\currentmathmatrix{#1}%
\setupcurrentmathmatrix[#2]%
- \scratchtoks\emptytoks
- \processlist[];\math_matrix_simple_row[#3]%
\math_matrix_start[\currentmathmatrix]%
- \the\scratchtoks
+ \clf_simplematrix{\mathmatrixparameter\c!action}{#3}%
\math_matrix_stop
\endgroup}
@@ -1237,17 +1946,40 @@
\appendtoks
\edef\p_simplecommand{\mathmatrixparameter\c!simplecommand}%
\ifempty\p_simplecommand\else
- \frozen\instance\setuevalue{\p_simplecommand}{\math_matrix_simple[\currentmathmatrix]}%
+ \frozen\protected\instance\edefcsname\p_simplecommand\endcsname{\math_matrix_simple[\currentmathmatrix]}%
\fi
\to \everydefinemathmatrix
%D And predefine some matrices:
-\definemathmatrix[matrix:parentheses][\c!left={\left(\mskip\thinmuskip},\c!right={\mskip\thinmuskip\right)},\c!align=\v!middle]
-\definemathmatrix[matrix:brackets] [\c!left={\left[\mskip\thinmuskip},\c!right={\mskip\thinmuskip\right]},\c!align=\v!middle]
-\definemathmatrix[matrix:bars] [\c!left={\left|\mskip\thinmuskip},\c!right={\mskip\thinmuskip\right|},\c!align=\v!middle]
+% \definemathmatrix[matrix:parentheses][\c!left={\left(\mskip\thinmuskip},\c!right={\mskip\thinmuskip\right)},\c!align=\v!middle]
+% \definemathmatrix[matrix:brackets] [\c!left={\left[\mskip\thinmuskip},\c!right={\mskip\thinmuskip\right]},\c!align=\v!middle]
+% \definemathmatrix[matrix:bars] [\c!left={\left|\mskip\thinmuskip},\c!right={\mskip\thinmuskip\right|},\c!align=\v!middle]
+
+\definemathmatrix
+ [matrix:brackets]
+ [\c!fences=bracket,
+ \c!align=\v!middle]
-\definemathmatrix[thematrix][matrix:parentheses][\c!simplecommand=thematrix]
+\definemathmatrix
+ [matrix:parentheses]
+ [\c!fences=parenthesis,
+ \c!align=\v!middle]
+
+\definemathmatrix
+ [matrix:bars]
+ [\c!fences=bar,
+ \c!align=\v!middle]
+
+\definemathmatrix
+ [matrix:braces]
+ [\c!fences=brace,
+ \c!align=\v!middle]
+
+\definemathmatrix
+ [thematrix]
+ [matrix:parentheses]
+ [\c!simplecommand=thematrix]
%D \startbuffer
%D \startformula
@@ -1269,6 +2001,30 @@
%D
%D \typebuffer \getbuffer
+%D Mikael needed this matrix in one of his advanced math courses that ran begin april 2022
+%D where new concepts were introduced:
+
+% \definemathfence
+% [tekcarb]
+% [\c!left="005D,\c!right="005B]
+
+\definemathmatrix
+ [xıɹʇÉɯ]
+ [\c!fences=tekcarb]
+
+%D Fortunately we were read for it:
+%D
+%D \startbuffer
+%D \startformula
+%D \startxıɹʇÉɯ
+%D \NC a_1 \NC b_1 \NC c_1 \NR
+%D \NC a_2 \NC b_2 \NC c_2 \NR
+%D \stopxıɹʇÉɯ
+%D \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+
%D \macros
%D {startintertext}
%D
@@ -1339,7 +2095,7 @@
\enforced\let\NC\relax
\enforced\let\MC\relax
\enforced\let\NR\crcr
- \halign\bgroup\hfil\normalstartimath\scriptstyle\alignmark\alignmark\normalstopimath\hfil\crcr}
+ \halign\bgroup\hfil\normalstartimath\scriptstyle\aligncontent\normalstopimath\hfil\crcr}
\noaligned\permanent\protected\def\stopsubstack
{\crcr
@@ -1347,146 +2103,51 @@
\egroup
\endgroup}
-% %D \macros
-% %D {bordermatrix}
-% %D
-% %D In \PLAIN\ \TEX\ the width of a parenthesis is stored in
-% %D the \DIMENSION\ \type{\mathparentwd}. This value is derived from
-% %D the width of \type{\tenrm B}, so let's take care of it now:
-%
-% \ifdefined\mathparentwd \else \newdimen\mathparentwd \fi
-%
-% \let\normalbordermatrix\bordermatrix % move that code to here instead
-%
-% \protected\def\bordermatrix
-% {\begingroup
-% \setbox\scratchbox\hbox{\mr\char"239C}%
-% \global\mathparentwd\wd\scratchbox
-% \endgroup
-% \normalbordermatrix}
-%
-% \def\bordermatrix
-% {\begingroup
-% \mr
-% \global\mathparentwd\fontcharwd\font"239C\relax
-% \endgroup
-% \normalbordermatrix}
-
%D \macros{overset, underset}
%D
-%D The macros \type{\overset} and \type{\underset} are provided by
-%D \AMS\ packages in \LATEX. These macro allows you to place a symbol
-%D above or below another symbol, irrespective of whether the other
-%D symbol is a relation or something else, and without influencing the
-%D spacing. For most cases there is a better way to do such things
-%D (declaring a math command with limop option, or using accents), but
-%D occasionally these macros can be useful, for example:
-%D
-%D \startbuffer
-%D \startformula
-%D \overset{*}{X} \underset{*}{X}
-%D \stopformula
-%D \stopbuffer
-%D \typebuffer \getbuffer
-%D
-%D Use these macros sparingly. Remember, \TEX\ was designed for
-%D mathematics, so there is usually a proper method for typesetting
-%D common math notation.
+%D The macros \type {\overset} and \type {\underset} are provided by \AMS\ packages
+%D in \LATEX. These macro allows you to place a symbol above or below another
+%D symbol, irrespective of whether the other symbol is a relation or something else,
+%D and without influencing the spacing. Because in \LUAMETATEX\ we're less limited,
+%D we have rather simple definitions compared to \MKIV. One cna also do:
%D
-%D These macros are a cleaner version of \type {\binrel@} and
-%D \type {\binrel@@} macros in \AMSTEX\ packages.
-
-\def\math_binrel_apply#1%
- {\begingroup
- \setbox\scratchbox\hbox
- {\thinmuskip 0mu
- \medmuskip -1mu
- \thickmuskip -1mu
- \setbox\scratchbox\hbox{\normalstartimath#1\mathsurround\zeropoint\normalstopimath}%
- \kern-\wd\scratchbox
- \normalstartimath{}#1{}\mathsurround\zeropoint\normalstopimath}%
- \ifdim\wd\scratchbox<\zeropoint
- \endgroup
- \expandafter\mathbin
- \orelse\ifdim\wd\scratchbox>\zeropoint
- \endgroup
- \doubleexpandafter\mathrel
- \else
- \endgroup
- \doubleexpandafter\firstofoneargument
- \fi}
-
-\permanent\protected\def\overset#1#2%
- {\math_binrel_apply{#2}{\mathop{\kern\zeropoint#2}\limits\normalsuperscript{#1}}}
+%D \starttyping
+%D $b\limits^a$
+%D $<\limits^a$
+%D \stoptyping
-\permanent\protected\def\underset#1#2%
- {\math_binrel_apply{#2}{\mathop{\kern\zeropoint#2}\limits\normalsubscript {#1}}}
+\permanent\protected\def\overset #1#2{\mathrel{#2}\limits\normalsuperscript{#1}}
+\permanent\protected\def\underset#1#2{\mathrel{#2}\limits\normalsubscript {#1}}
%D The following code comes from \type {math-str.mkiv}.
%D
-%D Here we implement a basic math alignment mechanism. Numbers are also handled. The macros
-%D \type {\startinnermath} and \type {\stopinnermath} can be overloaded in specialized
-%D modules.
+%D Here we implement a basic math alignment mechanism. Numbers are also handled. The
+%D macros \type {\startinnermath} and \type {\stopinnermath} can be overloaded in
+%D specialized modules.
\installcorenamespace{mathinnerstart}
\installcorenamespace{mathinnerstop}
-% \protected\def\startinnermath{\csname\??mathinnerstart\formulaparameter\c!align\endcsname}
-% \protected\def\stopinnermath {\csname\??mathinnerstop \formulaparameter\c!align\endcsname}
-
\permanent\protected\def\startinnermath{\expandnamespaceparameter\??mathinnerstart\formulaparameter\c!align\v!normal}
\permanent\protected\def\stopinnermath {\expandnamespaceparameter\??mathinnerstop \formulaparameter\c!align\v!normal}
-\permanent\protected\def\mathinnerstrut
- {\doif{\formulaparameter\c!strut}\v!yes\strut}
-
\permanent\protected\def\defineinnermathhandler#1#2#3%
{\defcsname\??mathinnerstart#1\endcsname{#2}%
\defcsname\??mathinnerstop #1\endcsname{#3}}
-\installtextracker
- {formulas.boxes}
- {\enforced\let\math_hbox\ruledhbox}
- {\enforced\let\math_hbox\hbox}
-
-\let\math_hbox\hbox
+\def\strc_math_flush_number_box{\box\b_strc_formulas_number}
-\newconstant\mathraggedstatus % normal left center right
-\newconstant\mathnumberstatus % nothing normal shift_right
+% \newdimension \d_strc_math_display_width
+% \newdimension \d_strc_math_indent
+% \newconditional\c_strc_math_indent
-\newdimen\d_math_number_correction
-
-\def\math_box_llapped_math_no
- {\ifcase\mathraggedstatus\or
- \box\b_strc_formulas_number
- \or
- \llap{\box\b_strc_formulas_number}%
- \or
- \llap{\box\b_strc_formulas_number}%
- \fi}
-
-\def\math_box_rlapped_math_no
- {\ifcase\mathraggedstatus\or
- \rlap{\box\b_strc_formulas_number}%
- \or
- \rlap{\box\b_strc_formulas_number}%
- \or
- \box\b_strc_formulas_number
- \fi}
-
-\newconditional\c_strc_math_has_number
\newconditional\c_strc_math_display_overflow
\newconstant \c_strc_math_number_location
-\newdimen \d_strc_math_number_width
-\newdimen \d_strc_math_display_width
-\newbox \b_strc_math_display
+\newconstant \c_strc_math_number_variant
\newconstant \c_strc_formulas_frame_mode
-\newdimen \d_strc_math_indent
-\newconditional\c_strc_math_indent
-
-\newdimen\d_strc_math_framed_width
+\newdimension \d_strc_math_framed_width
-\setvalue{\??formulaoption\v!frame}%
+\defcsname\??formulaoption\v!frame\endcsname
{\edef\p_frame{\formulaparameter\c!frame}%
\ifx\p_frame\v!number
\c_strc_formulas_frame_mode\plustwo % inside frame
@@ -1496,27 +2157,137 @@
% mode: 0=no frame | 1=number inside frame | 2=number outside frame
-\def\strc_math_flush_aligned
- {\ifcase\c_strc_math_vertical
- \ifcase\mathraggedstatus\or\hfill\or\hfill\fi
- \box\b_strc_math_display
- \ifcase\mathraggedstatus\or\or\hfill\or\hfill\fi
- \else
- \ifconditional\c_strc_math_indent
- \ifzeropt\d_strc_math_indent\else
- \hangafter\plusone
- \hangindent\d_strc_math_indent
+% it is a bit of a mess because we solve all kind of bordercases but at some
+% point it will become clean
+
+\def\strc_math_flush_aligned_boxed_direct_yes
+ {\dontleavehmode
+ \box\b_strc_math_display
+ \llap{\box\b_strc_formulas_number}}
+
+\def\strc_math_flush_aligned_boxed_direct_nop
+ {\dontleavehmode
+ \box\b_strc_math_display}
+
+\def\strc_math_flush_aligned_left_number_indeed
+ {\ifvoid\b_strc_formulas_number\else
+ \scratchwidth\wd\b_strc_formulas_number
+ \setbox\b_strc_formulas_number\hbox to \displaywidth{\hss\hbox{\box\b_strc_formulas_number}}%
+ \ifcase\c_strc_math_number_location\or
+ \boxxoffset\b_strc_formulas_number\dimexpr-\displaywidth+\scratchwidth\relax
+ \boxyoffset\b_strc_formulas_number-\d_strc_math_first_height
+ \htdp\b_strc_formulas_number\zeropoint
+ \box\b_strc_formulas_number % left
+ \fi
+ \fi}
+
+\def\strc_math_flush_aligned_right_number_indeed
+ {\ifvoid\b_strc_formulas_number\else
+ \scratchwidth\wd\b_strc_formulas_number
+ \setbox\b_strc_formulas_number\hbox to \displaywidth{\hss\hbox{\box\b_strc_formulas_number}}%
+ \ifcase\c_strc_math_number_location\or\else
+ \boxyoffset\b_strc_formulas_number\d_strc_math_last_depth
+ \htdp\b_strc_formulas_number\zeropoint
+ \box\b_strc_formulas_number % right
+ \fi
+ \fi}
+
+\protected\def\strc_math_flush_aligned_indeed
+ {\ifcase\c_strc_math_ragged_status
+ % align: error
+ \strc_math_flush_aligned_boxed_direct_yes
+ \or
+ % align: flushleft, number right
+ \strc_math_flush_aligned_boxed_direct_yes
+ \or
+ % align: middle
+ \ifnum\c_strc_math_split_mode=\c_strc_math_line_mode
+ \leftskip \zeropoint
+ \rightskip\zeropoint
+ \strc_math_flush_aligned_boxed_direct_yes
+ \orelse\ifnum\c_strc_math_split_mode=\c_strc_math_wrap_mode
+ \dontleavehmode
+ \vbox\bgroup
+ \strc_math_flush_aligned_left_number_indeed
+ \unvbox\b_strc_math_display
+ \strc_math_flush_aligned_right_number_indeed
+ \egroup
+ \orelse\ifhmode
+ % untested
+ \dontleavehmode
+ \strc_math_flush_aligned_left_number_indeed
+ \box\b_strc_math_display
+ \strc_math_flush_aligned_right_number_indeed
+ \orelse\ifvbox\b_strc_math_display
+ \strc_math_flush_aligned_left_number_indeed
+ \unvbox\b_strc_math_display
+ \strc_math_flush_aligned_right_number_indeed
+ \else
+ % untested
+ \dontleavehmode
+ \strc_math_flush_aligned_left_number_indeed
+ \box\b_strc_math_display
+ \strc_math_flush_aligned_right_number_indeed
+ \fi
+ \or
+ % align: flushright
+ % packaged, number (kind of ugly as we now stick in the margin)
+ \ifcase\c_strc_math_n_of_lines\or
+ \dontleavehmode
+ \kern-\wd\b_strc_formulas_number
+ \box\b_strc_math_display
+ \ifcase\c_strc_math_n_of_lines\or
+ \box\b_strc_formulas_number
+ \else
+ \llap{\box\b_strc_formulas_number}%
\fi
+ \orelse\iftrue % can become option
+ \ifdim\d_strc_math_last_width>\wd\b_strc_formulas_number
+ \ifdim\d_strc_math_max_width<\d_strc_math_last_width
+ \strc_math_flush_aligned_boxed_direct_yes
+ \else
+ \dontleavehmode
+ \kern-\wd\b_strc_formulas_number
+ \box\b_strc_math_display
+ \box\b_strc_formulas_number
+ \fi
+ \else
+ % delay number till later
+ \strc_math_flush_aligned_boxed_direct_nop
+ \fi
+ \else
+ % delay number till later
+ \strc_math_flush_aligned_boxed_direct_nop
\fi
- \edef\p_interlinespace{\formulaparameter\c!interlinespace}%
- \ifempty\p_interlinespace\else\baselineskip\p_interlinespace\fi
- \global\d_strc_math_indent\zeropoint
- \ifcase\mathraggedstatus\or\raggedleft\or\raggedcenter\or\raggedright\fi
- \unhbox\b_strc_math_display
+ \fi
+ \ifvmode
+ \nointerlineskip
+ \fi}
+
+\protected\def\strc_math_flush_aligned_simple
+ {\ifcase\c_strc_math_ragged_status\or\or\hfill\or\hfill\fi
+ \box\b_strc_math_display
+ \ifcase\c_strc_math_ragged_status\or\hfill\or\hfill\or\fi}
+
+\protected\def\strc_math_flush_aligned
+ {\ifnum\c_strc_math_split_mode=\c_strc_math_line_mode
+ \strc_math_flush_aligned_simple
+ \orelse\ifconditional\c_strc_math_indent
+ % in this case the already set text align is overloaded
+ \strc_math_setup_align_auto
+ \strc_math_flush_aligned_indeed
+ \else
+ % normally we don't end up here
+ \strc_math_setup_spacing_aligned\mathalignmentparameter
+ \begingroup
+ \forgetall
+ \unhbox\b_strc_math_display
+ \par
+ \endgroup
\fi}
\def\strc_math_flush_box_normal
- {\ifcase\c_strc_math_vertical
+ {\ifnum\c_strc_math_split_mode=\c_strc_math_line_mode
\hbox to \displaywidth\bgroup
\strc_math_flush_aligned
\egroup
@@ -1529,9 +2300,9 @@
\setformulaframedparameter\c!align{\formulaparameter\c!align}%
\letformulaframedparameter\c!strut\v!no
\d_framed_formula\ht\b_strc_math_display
- \ifcase\mathraggedstatus\or\hfill\or\hfill \fi
+ \ifcase\c_strc_math_ragged_status\or \or\hfill\or\hfill\fi
\inheritedformulaframedframed{\box\b_strc_math_display}%
- \ifcase\mathraggedstatus\or \or\hfill\or\hfill\fi}
+ \ifcase\c_strc_math_ragged_status\or\hfill\or\hfill \fi}
\def\strc_math_flush_box_framed_display
{\let\currentformulaframed\currentformula
@@ -1541,7 +2312,7 @@
\def\strc_math_flush_box_framed_fit_inline
{\let\currentformulaframed\currentformula
- \letformulaframedparameter\c!location\empty
+ \resetformulaframedparameter\c!location
\letformulaframedparameter\c!width\v!fit
\strc_math_flush_box_framed_common}
@@ -1553,6 +2324,9 @@
% combiners
+\def\strc_math_flush_number_box_left {\ifconditional\c_strc_formulas_overlay_number\rlap\fi{\strc_math_flush_number_box}}
+\def\strc_math_flush_number_box_right{\ifconditional\c_strc_formulas_overlay_number\llap\fi{\strc_math_flush_number_box}}
+
\def\strc_math_flush_box
{\ifcase\c_strc_formulas_frame_mode
\strc_math_flush_box_normal
@@ -1563,10 +2337,10 @@
\def\strc_math_number_right_normal
{\strc_math_flush_aligned
\hss % hss makes room for number
- \math_box_llapped_math_no}
+ \strc_math_flush_number_box_right}
\def\strc_math_number_left_normal
- {\math_box_rlapped_math_no
+ {\strc_math_flush_number_box_left
\strc_math_flush_aligned
\hss} % hss makes room for number
@@ -1577,10 +2351,10 @@
\strc_math_flush_box_framed_display
\fi
\hss % hss makes room for number
- \math_box_llapped_math_no}
+ \strc_math_flush_number_box}
\def\strc_math_number_left_normal_outside
- {\math_box_rlapped_math_no
+ {\strc_math_flush_number_box
\hss % hss makes room for number
\ifconditional\c_strc_formulas_tight
\strc_math_flush_box_framed_fit_display
@@ -1592,13 +2366,13 @@
{\setbox\b_strc_math_display\hpack to \dimexpr\displaywidth-\d_framed_locator_lo-\d_framed_locator_ro\relax\bgroup
\strc_math_flush_aligned
\hss
- \math_box_llapped_math_no
+ \strc_math_flush_number_box
\egroup
\strc_math_flush_box_framed_fit_inline}
\def\strc_math_number_left_normal_inside
{\setbox\b_strc_math_display\hpack to \dimexpr\displaywidth-\d_framed_locator_lo-\d_framed_locator_ro\relax\bgroup
- \math_box_rlapped_math_no
+ \strc_math_flush_number_box
\hss
\strc_math_flush_aligned
\egroup
@@ -1610,14 +2384,14 @@
\par
\hpack to \displaywidth\bgroup
\hss
- \math_box_llapped_math_no
+ \strc_math_flush_number_box_right
\egroup
\egroup}
\def\strc_math_number_left_overflow
{\vpack\bgroup
\hpack to \displaywidth\bgroup
- \math_box_rlapped_math_no
+ \strc_math_flush_number_box_left
\hss
\egroup
\strc_math_flush_box
@@ -1629,14 +2403,14 @@
%\hskip\zeropoint % nicely breaks the line without introducing funny vertical spacing ... why o why
\hpack to \displaywidth\bgroup
\hss
- \math_box_llapped_math_no
+ \strc_math_flush_number_box
\egroup
\egroup}
\def\strc_math_number_left_overflow_outside
{\vpack\bgroup
\hpack to \dimexpr\displaywidth-\d_framed_locator_lo\relax\bgroup
- \math_box_rlapped_math_no
+ \strc_math_flush_number_box
\hss
\egroup
\hskip\zeropoint % nicely breaks the line without introducing funny vertical spacing ... why o why
@@ -1648,8 +2422,8 @@
\box\b_strc_math_display
\hpack to \displaywidth\bgroup
\hss
- \math_box_llapped_math_no
- \hskip\d_framed_locator_ro
+ \strc_math_flush_number_box
+ \kern\d_framed_locator_ro
\egroup
\egroup
\strc_math_flush_box_framed_fit_inline}
@@ -1657,8 +2431,8 @@
\def\strc_math_number_left_overflow_inside
{\setbox\b_strc_math_display\vpack\bgroup
\hpack to \displaywidth\bgroup
- % \hskip\d_framed_locator_lo
- \math_box_rlapped_math_no
+ % \kern\d_framed_locator_lo
+ \strc_math_flush_number_box
\hss
\egroup
\box\b_strc_math_display
@@ -1667,17 +2441,28 @@
% checkers
+\setupmathalignment
+ [\c!numberdistance=\formulaparameter\c!numberdistance]
+
+\protected\def\d_strc_math_total_display_width
+ {\dimexpr
+ \d_strc_math_display_width+\wd\b_strc_formulas_number
+ \ifconditional\c_strc_formulas_overlay_number
+ \ifcase\c_strc_math_ragged_status\or\or+\wd\b_strc_formulas_number\or\fi
+ \fi
+ \relax}
+
\def\strc_math_number_check
{\d_strc_math_display_width\wd\b_strc_math_display
\ifconditional\c_strc_formulas_tight
- \ifdim\d_strc_math_display_width>\displaywidth
+ \ifdim\d_strc_math_total_display_width>\displaywidth
\settrue\c_strc_math_display_overflow
\else
- \displaywidth\d_strc_math_display_width
+ \displaywidth\d_strc_math_total_display_width
\setfalse\c_strc_math_display_overflow
\fi
\else
- \ifdim\d_strc_math_display_width>\displaywidth
+ \ifdim\dimexpr\d_strc_math_total_display_width+\formulaparameter\c!numberthreshold\relax>\displaywidth
\settrue\c_strc_math_display_overflow
\else
\setfalse\c_strc_math_display_overflow
@@ -1686,13 +2471,13 @@
\def\strc_math_number_check_outside
{\d_strc_math_display_width\naturalwd\b_strc_math_display
- \ifdim\dimexpr\d_strc_math_display_width+\d_framed_locator_lo+\d_framed_locator_ro\relax>\displaywidth
+ \ifdim\dimexpr\d_strc_math_total_display_width+\d_framed_locator_lo+\d_framed_locator_ro\relax>\displaywidth
\settrue\c_strc_math_display_overflow
\else
\setfalse\c_strc_math_display_overflow
\fi
% still ok?
- \ifnum\mathraggedstatus=\plustwo
+ \ifnum\c_strc_math_ragged_status=\plustwo
\d_strc_math_framed_width\dimexpr\displaywidth-2\wd\b_strc_formulas_number\relax
\else
\d_strc_math_framed_width\dimexpr\displaywidth- \wd\b_strc_formulas_number\relax
@@ -1713,7 +2498,7 @@
\def\strc_math_traced_state_yes
{\llap{\setbox\scratchbox\hbox{\infofont
- \ifcase\mathraggedstatus unset\or right\or middle\or left\fi
+ \ifcase\c_strc_math_ragged_status unset\or flushleft\or middle\or flushright\fi
\space
\ifcase\c_strc_formulas_frame_mode no\or out\or in\fi
\space
@@ -1729,25 +2514,89 @@
% packaging
+\installcorenamespace{mathboxlocation}
+
+\defcsname\??mathboxlocation\v!left \endcsname
+ {\c_strc_math_number_location\plusone}
+\defcsname\??mathboxlocation\v!flushright\endcsname
+ {\c_strc_math_number_location\plusone}
+
+\defcsname\??mathboxlocation\v!right\endcsname
+ {\c_strc_math_number_location\plustwo}
+\defcsname\??mathboxlocation\v!flushleft\endcsname
+ {\c_strc_math_number_location\plustwo}
+
+\defcsname\??mathboxlocation\v!atrightmargin\endcsname
+ {\c_strc_math_number_location\plustwo
+ \c_strc_math_number_variant \plusone}
+
\protected\def\strc_math_box_start#1%
- {\hsize\displaywidth % \checkeddisplaymath
- \global\mathnumberstatus\plusone
- \mathraggedstatus#1\relax
- %
- \global\d_math_number_correction\zeropoint
- %
- \edef\p_location{\formulaparameter\c!location}%
+ {\c_strc_math_ragged_status#1\relax % already set
\useformulacolorparameter\c!color
- \c_strc_math_number_location\ifx\p_location\v!left\plusone\orelse\ifx\p_location\v!right\plustwo\else\zerocount\fi
+ \c_strc_math_number_location\zerocount
+ \c_strc_math_number_variant \zerocount
+ \begincsname\??mathboxlocation\formulaparameter\c!location\endcsname
+ %
+ % We collect the math formula in an hbox. Dimensions don't really play
+ % a role yet but beware of nesting!
%
- %\strc_formulas_place_number % not here as we can have inner alignment numbers
\dontcomplain
- \setbox\b_strc_math_display\math_hbox\bgroup % \checkeddisplaymath
- \mathinnerstrut
+ %\holdingmigrations\plusfour
+ \setbox\b_strc_math_display\hbox retain \plusfour\bgroup
\startforceddisplaymath}
+\protected\def\strc_math_box_stop
+ {\stopforceddisplaymath
+ \egroup
+ % preroll left and right offsets
+ \ifcase\c_strc_formulas_frame_mode
+ % no frame
+ \else
+ \strc_math_number_check_offsets
+ \fi
+ \ifcase\c_strc_formulas_frame_mode
+ \strc_math_number_check
+ \or
+ \strc_math_number_check_outside
+ \else
+ \strc_math_number_check_inside
+ \fi
+ \strc_math_traced_state
+ \ifnum\c_strc_math_split_mode=\c_strc_math_line_mode
+ \noindent % \noindentation % not \dontleavehmode
+ \hbox to \displaywidth \bgroup
+ \else
+ \bgroup
+ \strc_math_show_margins
+ \fi
+ \ifcase\c_strc_math_number_location
+ \strc_math_flush_box
+ \or % number left
+ \ifzeropt\wd\b_strc_formulas_number
+ \strc_math_flush_number_no
+ \else
+ \strc_math_flush_number_left
+ \fi
+ \else % number right
+ \ifzeropt\wd\b_strc_formulas_number
+ \strc_math_flush_number_no
+ \else
+ \strc_math_flush_number_right
+ \fi
+ \fi
+ \egroup}
+
+\defineinnermathhandler\v!left {\strc_math_box_start\plusthree}{\strc_math_box_stop}
+\defineinnermathhandler\v!flushright{\strc_math_box_start\plusthree}{\strc_math_box_stop}
+\defineinnermathhandler\v!right {\strc_math_box_start\plusone }{\strc_math_box_stop}
+\defineinnermathhandler\v!flushleft {\strc_math_box_start\plusone }{\strc_math_box_stop}
+\defineinnermathhandler\v!center {\strc_math_box_start\plustwo }{\strc_math_box_stop}
+\defineinnermathhandler\v!middle {\strc_math_box_start\plustwo }{\strc_math_box_stop}
+\defineinnermathhandler\v!normal {\strc_math_box_start\plustwo }{\strc_math_box_stop}
+\defineinnermathhandler\v!atmargin {\strc_math_box_start\plusfour }{\strc_math_box_stop}
+
\def\strc_math_flush_number_no
- {\ifcase\c_strc_math_vertical
+ {\ifnum\c_strc_math_split_mode=\c_strc_math_line_mode
\ifconditional\c_strc_math_display_overflow
\ifcase\c_strc_formulas_frame_mode
\strc_math_flush_box_normal
@@ -1774,7 +2623,7 @@
\fi}
\def\strc_math_flush_number_left
- {\ifcase\c_strc_math_vertical
+ {\ifnum\c_strc_math_split_mode=\c_strc_math_line_mode
\ifconditional\c_strc_math_display_overflow
\ifcase\c_strc_formulas_frame_mode
\strc_math_number_left_overflow
@@ -1793,13 +2642,13 @@
\fi
\fi
\else
- \box\b_strc_formulas_number
- \hfill
- \strc_math_flush_aligned
+ % \box\b_strc_formulas_number
+ % \hfill
+ \strc_math_flush_aligned % we flush in here, otherwise wrong positioning of number (we need to unvbox)
\fi}
\def\strc_math_flush_number_right
- {\ifcase\c_strc_math_vertical
+ {\ifnum\c_strc_math_split_mode=\c_strc_math_line_mode
\ifconditional\c_strc_math_display_overflow
\ifcase\c_strc_formulas_frame_mode
\strc_math_number_right_overflow
@@ -1819,86 +2668,10 @@
\fi
\else
\strc_math_flush_aligned
- \hfill
- \box\b_strc_formulas_number
+ % \hfill
+ % \box\b_strc_formulas_number % we flush in here
\fi}
-\protected\def\strc_math_box_stop
- {\stopforceddisplaymath
- \egroup
- % check number
- \d_strc_math_number_width\wd\b_strc_formulas_number
- %
- \ifcase\mathnumberstatus
- \setfalse\c_strc_math_has_number
- \or\ifzeropt\d_strc_math_number_width
- \setfalse\c_strc_math_has_number
- \else
- \settrue\c_strc_math_has_number
- \fi\fi
- % preroll left and right offsets
- \ifcase\c_strc_formulas_frame_mode
- % no frame
- \else
- \strc_math_number_check_offsets
- \fi
- \ifcase\c_strc_formulas_frame_mode
- \strc_math_number_check
- \or
- \strc_math_number_check_outside
- \else
- \strc_math_number_check_inside
- \fi
- \noindent % \noindentation % not \dontleavehmode
- \hskip\d_strc_formulas_display_margin_left % was kern but that doesn't indent
- \strc_math_traced_state
- \ifcase\c_strc_math_vertical
- \hbox to \displaywidth \bgroup
- \or
- \vbox \bgroup \hsize\displaywidth
- \or
- \bgroup \hsize\displaywidth
- \fi
- \ifcase\mathnumberstatus
- \strc_math_flush_box
- \or % status 1
- \ifcase\c_strc_math_number_location
- \strc_math_flush_box
- \or % number left
- \ifzeropt\wd\b_strc_formulas_number
- \strc_math_flush_number_no
- \else
- \strc_math_flush_number_left
- \fi
- \else % number right
- \ifzeropt\wd\b_strc_formulas_number
- \strc_math_flush_number_no
- \else
- \strc_math_flush_number_right
- \fi
- \fi
- \or % status 2
- \hskip\d_math_number_correction % probably no longer used
- \strc_math_flush_box
- \hss
- \else
- \strc_math_flush_box
- \fi
- \ifcase\c_strc_math_vertical
- \or
- \or
- \par
- \fi
- \egroup}
-
-\defineinnermathhandler\v!left {\strc_math_box_start\plusone }{\strc_math_box_stop}
-\defineinnermathhandler\v!middle {\strc_math_box_start\plustwo }{\strc_math_box_stop}
-\defineinnermathhandler\v!right {\strc_math_box_start\plusthree}{\strc_math_box_stop}
-\defineinnermathhandler\v!flushleft {\strc_math_box_start\plusthree}{\strc_math_box_stop}
-\defineinnermathhandler\v!center {\strc_math_box_start\plustwo }{\strc_math_box_stop}
-\defineinnermathhandler\v!flushright{\strc_math_box_start\plusone }{\strc_math_box_stop}
-\defineinnermathhandler\v!normal {\strc_math_box_start\plustwo }{\strc_math_box_stop}
-
%D Some inline math tweak.
\appendtoks
@@ -1947,6 +2720,229 @@
{\afterdisplayspace
\endgroup}
+%D Kind of new (February 2022):
+
+\installcorenamespace {maththreshold}
+
+\setupmathematics[\c!threshold=\zeropoint]
+
+\permanent\protected\def\installmaththreshold#1#2%
+ {\expandafter\gluespecdef\csname\??maththreshold#1\endcsname#2\relax}
+
+\installmaththreshold\v!none {\zeropoint}
+\installmaththreshold\v!small {3\emwidth plus 0.50\emwidth minus 0.25\emwidth}
+\installmaththreshold\v!medium{4\emwidth plus 0.75\emwidth minus 0.50\emwidth}
+\installmaththreshold\v!big {5\emwidth plus 1.00\emwidth minus 0.75\emwidth}
+
+\appendtoks
+ \edef\p_threshold{\mathematicsparameter\c!threshold}%
+ \maththreshold\ifcsname\??maththreshold\p_threshold\endcsname\lastnamedcs\else\p_threshold\fi\relax
+% \to \everymath % \everymathematics
+\to \everymathematics
+
+%D Here is simple alignment mechanism:
+
+\installcorenamespace{mathsimplealign}
+
+\installcommandhandler \??mathsimplealign {mathsimplealign} \??mathsimplealign
+
+\setupmathsimplealign
+ [\c!distance=\v!math,
+ \c!leftmargin=\zeropoint,
+ \c!rightmargin=\zeropoint,
+ \c!left=,
+ \c!right=,
+ \c!strut=\v!yes,
+ \c!spaceinbetween=\mathalignmentparameter\c!spaceinbetween,
+ \c!align=\v!all:\v!middle,
+ \c!textdistance=.25\emwidth]
+
+\appendtoks
+ \frozen\instance\protected\edefcsname\e!start\currentmathsimplealign\endcsname{\math_simplealign_start[\currentmathsimplealign]}%
+ \frozen\instance \defcsname \e!stop \currentmathsimplealign\endcsname{\math_simplealign_stop}%
+\to \everydefinemathsimplealign
+
+\permanent\protected\def\math_simplealign_NC
+ {\aligntab}
+
+\permanent\protected\def\math_simplealign_EQ
+ {\aligntab=\aligntab}
+
+\noaligned\tolerant\permanent\protected\def\math_simplealign_NR[#1]#*[#2]%
+ {\unskip
+ \strc_formulas_place_number_nested{#1}{#2}\crcr}
+
+\permanent\tolerant\protected\def\math_simplealign_start[#1]#*[#2]%
+ {\begingroup
+ \edef\currentmathsimplealign{#1}%
+ \ifarguments\or\or
+ \setupcurrentmathsimplealign[#2]%
+ \fi
+ \edef\p_strut{\mathsimplealignparameter\c!strut}%
+ \ifx\p_strut\v!yes
+ \enforced\let\math_align_strut\strut
+ \else
+ \enforced\let\math_align_strut\relax
+ \fi
+ \mathatom \s!class \mathwrappedcode \bgroup
+ \scratchdimen\mathsimplealignparameter\c!leftmargin\relax
+ \ifzeropt\scratchdimen\else\kern\scratchdimen\fi
+ \mathsimplealignparameter\c!left\relax
+ \math_fenced_start_wrap{\mathsimplealignparameter\c!fences}%
+ \mathatom \s!class \mathconstructcode \bgroup
+ \vcenter\bgroup
+ \enforced\let\MC\math_simplealign_NC
+ \enforced\let\NC\math_simplealign_NC
+ \enforced\let\NR\math_simplealign_NR
+ \enforced\let\EQ\math_simplealign_EQ
+ \enforced\let\TB\math_common_TB
+ \math_eqalign_set_defaults
+ \math_eqalign_set_columns{\mathsimplealignparameter\c!align}%
+ \global\c_math_eqalign_column\zerocount
+ \global\c_math_eqalign_row\plusone
+ \edef\m_simplealign_distance{\mathsimplealignparameter\c!distance}%
+ \strc_math_setup_spacing_aligned\mathcasesparameter
+ \enablematrixalign
+ \halign callback \s!attr \mathnumberlocationattribute \zerocount \bgroup
+ \global\c_math_eqalign_column\zerocount
+ \global\advanceby\c_math_eqalign_row\zerocount
+ \ignorespaces
+ \aligncontent % dummy
+ \removeunwantedspaces
+ \lastleftclass \mathbegincode
+ \lastrightclass\mathendcode
+ \aligntab
+ \global\advanceby\c_math_eqalign_column\plusone
+ \math_left_of_eqalign % \hfil
+ \ignorespaces
+ \math_align_strut
+ \startforceddisplaymath
+ \aligncontent
+ \stopforceddisplaymath
+ \removeunwantedspaces
+ \math_right_of_eqalign % \hfil
+ \aligntab
+ \aligntab
+ \global\advanceby\c_math_eqalign_column\plusone
+ \math_left_of_eqalign % \hfil
+ \ifx\m_simplealign_distance\v!math
+ \mathbeginclass\lastrightclass
+ \else
+ \kern\m_simplealign_distance
+ \fi
+ \ignorespaces
+ \math_align_strut
+ \startforceddisplaymath
+ \aligncontent
+ \stopforceddisplaymath
+ \removeunwantedspaces
+ \math_right_of_eqalign % \hfil
+ \crcr}
+
+\noaligned\permanent\protected\def\math_simplealign_stop
+ {\crcr
+ \egroup
+ \egroup
+ \egroup
+ \math_fenced_stop_wrap
+ \mathsimplealignparameter\c!right\relax
+ \scratchdimen\mathsimplealignparameter\c!rightmargin\relax
+ \ifzeropt\scratchdimen\else\kern\scratchdimen\fi
+ \setbox\scratchbox\hbox{\mathsimplealignparameter\c!text}%
+ \ifvoid\scratchbox\else
+ \kern\mathsimplealignparameter\c!textdistance % hskip
+ \vcenter{\box\scratchbox}%
+ \fi
+ \egroup
+ \endgroup}
+
+%D It's not that spectacular apart from spacing being proper inter atom spacing
+%D using one of the new \LUAMETATEX\ mechanisms.
+%D
+%D \starttyping
+%D \definemathsimplealign
+%D [whatever]
+%D [left={\startmathfenced[sesac]},
+%D right=\stopmathfenced]
+%D
+%D % distance=math,
+%D % distance=\zeropoint,
+%D % distance=1cm,
+%D % align={all:left}]
+%D
+%D \startformula
+%D \startwhatever[text=simple]
+%D \NC x \NC = \NC r \NC \cos\theta \NR
+%D \NC y \NC = \NC \frac{1}{2} \NC \sin\theta \NR
+%D \NC 9 \NC = \NC 123 \NC \sin\theta \NR
+%D \stopwhatever
+%D \stopformula
+%D \stoptyping
+
+%D Usage \type {\sum _ {\mstack {i \in V_{0}, i \neq j}}}, documented by Mikael:
+
+\permanent\protected\def\mstack#1% todo: make it configurable
+ {\begingroup
+ \scratchtoks\emptytoks \setcharstrut(\relax
+ \processcommalist[#1]{\iftok\scratchtoks\emptytoks\else\toksapp\scratchtoks{\mathstrut\NR}\fi\toksapp\scratchtoks}%
+ \expandafter\startsubstack\the\scratchtoks\mathstrut\stopsubstack
+ \endgroup}
+
+%D Similar to simplecases:
+%D
+%D \starttyping
+%D \startformula
+%D \equationsystem {
+%D {(1-a)}x^{2x} - 3y_2 + 14z = 2 + x,
+%D {(1-a)}x^2 - 3y_2 + 4z <= 62,
+%D {(1-a)}x^a - 3y_2 + 4z >= 12,
+%D {(1-a)}x^{2a} - 3y_2 + 24z != 4,
+%D x^^2 - 3y_2 + 4z ~ 1,
+%D x^^2 - 3y_2 + 4z ≠ 1,
+%D -2x - 4z <> 10,
+%D }
+%D \stopformula
+%D \stoptyping
+
+\permanent\tolerant\protected\def\math_align_simple[#1]#*[#2]#:#3%
+ {\begingroup
+ \edef\currentmathsimplealign{#1}%
+ \setupcurrentmathsimplealign[#2]%
+ \math_simplealign_start[\currentmathsimplealign]%
+ \clf_simplealign{\mathsimplealignparameter\c!alternative}{\mathsimplealignparameter\c!action}{#3}%
+ \math_simplealign_stop
+ \endgroup}
+
+\appendtoks
+ \edef\p_simplecommand{\mathsimplealignparameter\c!simplecommand}%
+ \ifempty\p_simplecommand\else
+ \frozen\protected\instance\edefcsname\p_simplecommand\endcsname{\math_align_simple[\currentmathsimplealign]}%
+ \fi
+\to \everydefinemathsimplealign
+
+\definemathsimplealign % new !
+ [equationsystem]
+ [\c!simplecommand=equationsystem,
+ \c!alternative=equationsystem, % for the moment we use this key
+ \c!align={all:right},
+ \c!distance=\v!math,
+ \c!left=,
+ \c!right=]
+
+\definemathsimplealign
+ [lequationsystem]
+ [equationsystem]
+ [\c!simplecommand=lequationsystem,
+ \c!left={\startmathfenced[cases]},
+ \c!right=\stopmathfenced]
+
+\definemathsimplealign
+ [requationsystem]
+ [equationsystem]
+ [\c!simplecommand=requationsystem,
+ \c!left={\startmathfenced[sesac]},
+ \c!right=\stopmathfenced]
+
\protect \endinput
% \placeformula \startformula[-] \startmatrix
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-brl.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-brl.lmt
new file mode 100644
index 00000000000..ad934635066
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-brl.lmt
@@ -0,0 +1,526 @@
+return {
+ ["comment"]="taken from blog by Murray Sargent as well as wikipedia",
+ ["copyright"]="unknown",
+ ["nemeth"]={
+ [33]="â ¯",
+ [35]="⠨⠼",
+ [36]="⠈⠎",
+ [37]="⠈⠴",
+ [38]="⠸⠯",
+ [39]="â „",
+ [40]="â ·",
+ [41]="â ¾",
+ [42]="⠈⠼",
+ [43]="â ¬",
+ [44]="â  ",
+ [45]="⠸⠤",
+ [46]="⠸⠲",
+ [47]="⠸⠌",
+ [58]="⠸⠒",
+ [59]="⠸⠆",
+ [60]="â €â â …â €",
+ [61]="⠀⠨⠅⠀",
+ [62]="⠀⠨⠂⠀",
+ [63]="⠸⠦",
+ [64]="â ˆâ ",
+ [91]="⠈⠷",
+ [92]="⠸⠡",
+ [93]="⠈⠾",
+ [94]="⠸⠣",
+ [123]="⠨⠷",
+ [124]="â ¡",
+ [125]="⠨⠾",
+ [126]="⠈⠱",
+ [162]="⠈⠉",
+ [163]="⠈⠇",
+ [167]="⠈⠠⠎",
+ [169]="⠷⠠⠉⠾",
+ [174]="â ·â  râ ¾",
+ [176]="⠘⠨⠡",
+ [177]="⠬⠤",
+ [182]="⠈⠠â ",
+ [183]="â ¡",
+ [215]="⠈⠡",
+ [247]="⠨⠌",
+ [913]="⠨⠠â ",
+ [914]="⠨⠠⠃",
+ [915]="⠨⠠⠛",
+ [916]="⠨⠠⠙",
+ [917]="⠨⠠⠑",
+ [918]="⠨⠠⠵",
+ [919]="⠨⠠⠱",
+ [920]="⠨⠠⠹",
+ [921]="⠨⠠⠊",
+ [922]="⠨⠠⠅",
+ [923]="⠨⠠⠇",
+ [924]="⠨⠠â ",
+ [925]="⠨⠠â ",
+ [926]="⠨⠠⠭",
+ [927]="⠨⠠⠕",
+ [928]="⠨⠠â ",
+ [929]="⠨⠠⠗",
+ [931]="⠨⠠⠎",
+ [932]="⠨⠠⠞",
+ [933]="⠨⠠⠥",
+ [934]="⠨⠠⠋",
+ [935]="⠨⠠⠯",
+ [936]="⠨⠠⠽",
+ [937]="⠨⠠⠺",
+ [945]="â ¨â ",
+ [946]="⠨⠃",
+ [947]="⠨⠛",
+ [948]="⠨⠙",
+ [949]="⠨⠈⠑",
+ [950]="⠨⠵",
+ [951]="⠨⠱",
+ [952]="⠨⠹",
+ [953]="⠨⠊",
+ [954]="⠨⠅",
+ [955]="⠨⠇",
+ [956]="â ¨â ",
+ [957]="â ¨â ",
+ [958]="⠨⠭",
+ [959]="⠨⠕",
+ [960]="â ¨â ",
+ [961]="⠨⠗",
+ [962]="⠨⠒",
+ [963]="⠨⠎",
+ [964]="⠨⠞",
+ [965]="⠨⠥",
+ [966]="⠨⠈⠋",
+ [967]="⠨⠯",
+ [968]="⠨⠽",
+ [969]="⠨⠺",
+ [977]="⠨⠈⠹",
+ [981]="⠨⠋",
+ [982]="⠨⠈â ",
+ [1008]="⠨⠈⠅",
+ [1013]="⠨⠑",
+ [8212]="⠤⠤",
+ [8213]="⠤⠤⠤⠤",
+ [8216]="â  â ¦",
+ [8217]="â ´â  ",
+ [8220]="â ¦",
+ [8221]="â ´",
+ [8224]="⠸⠻",
+ [8225]="⠸⠸⠻",
+ [8226]="⠔⠔",
+ [8230]="â „â „â „",
+ [8240]="⠈⠴⠴",
+ [8241]="⠈⠴⠴⠴",
+ [8242]="â „",
+ [8243]="â „â „",
+ [8463]="⠈⠓",
+ [8467]="⠈⠇",
+ [8491]="⠈⠠â ",
+ [8592]="⠀⠫⠪⠒⠒⠀",
+ [8593]="⠀⠫⠣⠒⠒⠕⠀",
+ [8594]="⠀⠫⠒⠒⠕⠀",
+ [8595]="⠀⠫⠩⠒⠒⠕⠀",
+ [8596]="⠀⠫⠪⠒⠒⠕⠀",
+ [8597]="⠀⠫⠣⠪⠒⠒⠕⠀",
+ [8598]="⠀⠫⠘⠪⠒⠒⠀",
+ [8599]="⠀⠫⠘⠒⠒⠕⠀",
+ [8600]="⠀⠫⠰⠒⠒⠕⠀",
+ [8601]="⠀⠫⠰⠪⠒⠒⠀",
+ [8602]="⠀⠳⠈⠫⠪⠒⠒⠻⠀",
+ [8603]="⠀⠳⠈⠫⠒⠒⠕⠻⠀",
+ [8604]="⠀⠫⠪⠔⠒⠢⠀",
+ [8605]="⠀⠫⠔⠒⠢⠕⠀",
+ [8606]="⠀⠫⠪⠪⠒⠒⠀",
+ [8607]="⠀⠫⠣⠒⠒⠕⠕⠀",
+ [8608]="⠀⠫⠒⠒⠕⠕⠀",
+ [8609]="⠀⠫⠩⠒⠒⠕⠕⠀",
+ [8610]="⠀⠫⠪⠒⠒⠠⠽⠀",
+ [8611]="⠀⠫⠠⠯⠒⠒⠕⠀",
+ [8612]="⠀⠫⠪⠒⠒⠳⠀",
+ [8613]="⠀⠫⠣⠳⠒⠒⠕⠀",
+ [8614]="⠀⠫⠳⠒⠒⠕⠀",
+ [8615]="⠀⠫⠩⠳⠒⠒⠕⠀",
+ [8616]="⠀⠫⠣⠪⠒⠒⠕⠳⠀",
+ [8617]="⠀⠫⠪⠒⠒⠈⠽⠀",
+ [8618]="⠀⠫⠈⠯⠒⠒⠕⠀",
+ [8621]="⠀⠫⠪⠔⠒⠢⠕⠀",
+ [8622]="⠀⠳⠈⠫⠪⠒⠒⠕⠻⠀",
+ [8623]="⠀⠫⠩⠔⠢⠔⠕⠀",
+ [8628]="⠀⠫⠩⠠⠳⠒⠕⠀",
+ [8629]="⠀⠫⠪⠒⠈⠳⠀",
+ [8634]="⠀⠫⠢⠔⠕⠀",
+ [8635]="⠀⠫⠪⠢⠔⠀",
+ [8636]="⠀⠫⠈⠪⠒⠒⠀",
+ [8637]="⠀⠫⠠⠪⠒⠒⠀",
+ [8638]="⠀⠫⠣⠒⠒⠠⠕⠀",
+ [8639]="⠀⠫⠣⠒⠒⠈⠕⠀",
+ [8640]="⠀⠫⠒⠒⠈⠕⠀",
+ [8641]="⠀⠫⠒⠒⠠⠕⠀",
+ [8642]="⠀⠫⠩⠒⠒⠈⠕⠀",
+ [8643]="⠀⠫⠩⠒⠒⠠⠕⠀",
+ [8644]="⠀⠫⠒⠒⠕⠫⠪⠒⠒⠀",
+ [8645]="⠀⠫⠣⠒⠒⠕â â «â ©â ’â ’â •â €",
+ [8646]="⠀⠫⠪⠒⠒⠫⠒⠒⠕⠀",
+ [8647]="⠀⠫⠪⠒⠒⠫⠪⠒⠒⠀",
+ [8648]="⠀⠫⠣⠒⠒⠕â â «â £â ’â ’â •â €",
+ [8649]="⠀⠫⠒⠒⠕⠫⠒⠒⠕⠀",
+ [8650]="⠀⠫⠩⠒⠒⠕â â «â ©â ’â ’â •â €",
+ [8651]="⠀⠫⠈⠪⠒⠒⠫⠒⠒⠠⠕⠀",
+ [8652]="⠀⠫⠒⠒⠈⠕⠫⠠⠪⠒⠒⠀",
+ [8653]="⠀⠳⠈⠫⠪⠶⠶⠻⠀",
+ [8654]="⠀⠳⠈⠫⠪⠶⠶⠕⠻⠀",
+ [8655]="⠀⠳⠈⠫⠶⠶⠕⠻⠀",
+ [8656]="⠀⠫⠪⠶⠶⠀",
+ [8657]="⠀⠫⠣⠶⠶⠕⠀",
+ [8658]="⠀⠫⠶⠶⠕⠀",
+ [8659]="⠀⠫⠩⠶⠶⠕⠀",
+ [8660]="⠀⠫⠪⠶⠶⠕⠀",
+ [8661]="⠀⠫⠣⠪⠶⠶⠕⠀",
+ [8662]="⠀⠫⠘⠪⠶⠶⠀",
+ [8663]="⠀⠫⠘⠶⠶⠕⠀",
+ [8664]="⠀⠫⠰⠶⠶⠕⠀",
+ [8665]="⠀⠫⠰⠪⠶⠶⠀",
+ [8666]="⠀⠫⠪⠸⠸⠀",
+ [8667]="⠀⠫⠸⠸⠕⠀",
+ [8668]="⠀⠫⠪⠢⠤⠔⠒⠢⠀",
+ [8669]="⠀⠫⠢⠤⠔⠒⠢⠕⠀",
+ [8670]="⠀⠳⠳⠈⠫⠣⠒⠒⠕⠻⠀",
+ [8671]="⠀⠳⠳⠈⠫⠩⠒⠒⠕⠻⠀",
+ [8672]="⠀⠫⠪⠒⠀⠒⠀",
+ [8673]="⠀⠫⠣⠒⠀⠒⠕⠀",
+ [8674]="⠀⠫⠒⠀⠒⠕⠀",
+ [8675]="⠀⠫⠩⠒⠀⠒⠕⠀",
+ [8676]="⠀⠳⠫⠪⠒⠒⠀",
+ [8677]="⠀⠫⠒⠒⠕⠳⠀",
+ [8692]="⠀⠨⠡⠈⠫⠒⠒⠕⠻⠀",
+ [8693]="⠀⠫⠩⠒⠒⠕â â «â £â ’â ’â •â €",
+ [8694]="⠀⠫⠒⠒⠕⠫⠒⠒⠕⠫⠒⠒⠕⠀",
+ [8695]="⠀⠳⠈⠫⠪⠒⠒⠻⠀",
+ [8696]="⠀⠳⠈⠫⠒⠒⠕⠻⠀",
+ [8697]="⠀⠳⠈⠫⠪⠒⠒⠕⠻⠀",
+ [8698]="⠀⠳⠳⠈⠫⠪⠒⠒⠻⠀",
+ [8699]="⠀⠳⠳⠈⠫⠒⠒⠕⠻⠀",
+ [8700]="⠀⠳⠳⠈⠫⠪⠒⠒⠕⠻⠀",
+ [8704]="⠈⠯",
+ [8706]="⠈⠙",
+ [8707]="⠈⠿",
+ [8708]="⠌⠈⠿",
+ [8709]="⠸⠴",
+ [8711]="⠨⠫",
+ [8712]="⠀⠈⠑⠀",
+ [8713]="⠀⠌⠈⠑⠀",
+ [8715]="⠀⠈⠢⠀",
+ [8716]="⠀⠌⠈⠢⠀",
+ [8718]="⠸⠳",
+ [8721]="⠨⠠⠎",
+ [8722]="â ¤",
+ [8723]="⠤⠬",
+ [8724]="â â ¬â £â ¡â »",
+ [8725]="⠸⠌",
+ [8727]="⠈⠼",
+ [8728]="⠨⠡",
+ [8730]="⠜",
+ [8731]="⠣⠒⠜",
+ [8732]="⠣⠲⠜",
+ [8733]="⠀⠸⠿⠀",
+ [8734]="â  â ¿",
+ [8735]="⠫⠪⠨⠗⠻",
+ [8736]="â «â ª",
+ [8737]="⠫⠪⠈⠫â â »",
+ [8739]="⠀⠳⠀",
+ [8740]="⠀⠌⠳⠀",
+ [8741]="⠀⠫⠇⠀",
+ [8742]="⠀⠌⠫⠇⠀",
+ [8743]="⠈⠩",
+ [8744]="⠈⠬",
+ [8745]="⠨⠩",
+ [8746]="⠨⠬",
+ [8747]="â ®",
+ [8748]="⠮⠮",
+ [8749]="⠮⠮⠮",
+ [8750]="⠮⠈⠫⠉⠻",
+ [8754]="⠮⠈⠫⠪⠢⠔⠻",
+ [8755]="⠮⠈⠫⠢⠔⠕⠻",
+ [8756]="⠀⠠⠡⠀",
+ [8757]="⠀⠈⠌⠀",
+ [8758]="â €â â ‚â €",
+ [8759]="⠀⠰⠆⠀",
+ [8760]="⠨⠤",
+ [8761]="⠀⠤â â ‚â €",
+ [8762]="â €â â ¤â ©â ¡â ¡â £â ¡â ¡â »â €",
+ [8763]="â €â â ˆâ ±â ©â ¡â £â ¡â »â €",
+ [8764]="⠀⠈⠱⠀",
+ [8765]="⠀⠠⠱⠀",
+ [8770]="⠀⠱⠈⠱⠀",
+ [8771]="⠀⠈⠱⠱⠀",
+ [8773]="⠀⠈⠱⠨⠅⠀",
+ [8776]="⠀⠈⠱⠈⠱⠀",
+ [8778]="⠀⠈⠱⠈⠱⠱⠀",
+ [8779]="⠀⠈⠱⠈⠱⠈⠱⠀",
+ [8780]="⠀⠠⠱⠨⠅⠀",
+ [8781]="⠀⠫⠠⠫⠈⠀",
+ [8782]="⠀⠈⠣⠠⠣⠀",
+ [8783]="⠀⠈⠣⠱⠀",
+ [8784]="â €â â ¨â …⠣⠡⠻⠀",
+ [8785]="â €â â ¨â …⠩⠡⠣⠡⠻⠀",
+ [8788]="â €â â ‚⠨⠅⠀",
+ [8789]="⠀⠨⠅â â ‚â €",
+ [8790]="⠀⠨⠡⠈⠨⠅⠻⠀",
+ [8791]="â €â â ¨â …⠣⠨⠡⠻⠀",
+ [8792]="â €â â ¨â …⠣⠫â â »â €",
+ [8793]="â €â â ¨â …⠣⠸⠣⠻⠀",
+ [8794]="â €â â ¨â …⠣⠸⠩⠻⠀",
+ [8795]="â €â â ¨â …⠣⠫⠎⠻⠀",
+ [8796]="â €â â ¨â …⠣⠫⠞⠻⠀",
+ [8797]="â €â â ¨â …⠣⠙⠑⠋⠻⠀",
+ [8798]="â €â â ¨â …â £â â »â €",
+ [8799]="â €â â ¨â …⠣⠸⠢⠻⠀",
+ [8800]="⠀⠌⠨⠅⠀",
+ [8801]="⠀⠸⠇⠀",
+ [8802]="⠀⠌⠸⠇⠀",
+ [8804]="â €â â …⠱⠀",
+ [8805]="⠀⠨⠂⠱⠀",
+ [8806]="â €â â …⠨⠅⠀",
+ [8807]="⠀⠨⠂⠨⠅⠀",
+ [8808]="â €â â …⠌⠨⠅⠀",
+ [8809]="⠀⠨⠂⠌⠨⠅⠀",
+ [8810]="â €â â …â ˆâ â …⠻⠀",
+ [8811]="⠀⠨⠂⠈⠨⠂⠻⠀",
+ [8813]="⠀⠌⠈⠣⠠⠣⠀",
+ [8814]="⠀⠌â â …â €",
+ [8815]="⠀⠌⠨⠂⠀",
+ [8816]="⠀⠌â â …⠱⠀",
+ [8817]="⠀⠌⠨⠂⠱⠀",
+ [8818]="â €â â …⠈⠱⠀",
+ [8819]="⠀⠨⠂⠈⠱⠀",
+ [8820]="⠀⠌â â …⠈⠱⠀",
+ [8821]="⠀⠌⠨⠂⠈⠱⠀",
+ [8822]="â €â â …⠨⠂⠀",
+ [8823]="⠀⠨⠂â â …â €",
+ [8824]="⠀⠌â â …⠨⠂⠀",
+ [8825]="⠀⠌⠨⠂â â …â €",
+ [8826]="⠀⠨â â …â €",
+ [8827]="⠀⠨⠨⠂⠀",
+ [8830]="⠀⠨â â …⠈⠱⠀",
+ [8831]="⠀⠨⠨⠂⠈⠱⠀",
+ [8834]="⠀⠸â â …â €",
+ [8835]="⠀⠸⠨⠂⠀",
+ [8836]="⠀⠌⠸â â …â €",
+ [8837]="⠀⠌⠸⠨⠂⠀",
+ [8838]="⠀⠸â â …⠱⠀",
+ [8839]="⠀⠸⠨⠂⠱⠀",
+ [8840]="⠀⠌⠸â â …⠱⠀",
+ [8841]="⠀⠌⠸⠨⠂⠱⠀",
+ [8842]="⠀⠸â â …⠌⠱⠀",
+ [8843]="⠀⠸⠨⠂⠌⠱⠀",
+ [8844]="⠨⠬⠈⠫⠪⠒⠻",
+ [8845]="⠡⠈⠨⠬⠻",
+ [8846]="⠬⠈⠨⠬⠻",
+ [8853]="⠫⠉⠸⠫⠬⠻",
+ [8854]="⠫⠉⠸⠫⠤⠻",
+ [8855]="⠫⠉⠸⠫⠈⠡⠻",
+ [8856]="⠫⠉⠸⠫⠸⠌⠻",
+ [8857]="⠫⠉⠸⠫⠡⠻",
+ [8859]="⠫⠉⠸⠫⠈⠼⠻",
+ [8860]="⠫⠉⠸⠫⠨⠅⠻",
+ [8861]="⠫⠉⠸⠫⠤⠤⠻",
+ [8862]="⠫⠲⠸⠫⠬⠻",
+ [8863]="⠫⠲⠸⠫⠤⠻",
+ [8864]="⠫⠲⠸⠫⠈⠡⠻",
+ [8865]="⠫⠲⠸⠫⠡⠻",
+ [8866]="⠀⠫⠳⠒⠀",
+ [8867]="⠀⠫⠒⠳⠀",
+ [8868]="⠀⠫⠩⠳⠒⠀",
+ [8869]="⠀⠫â â € or ⠀⠫⠣⠳⠒⠀",
+ [8886]="⠀⠫⠨⠡⠒⠡⠀",
+ [8887]="⠀⠫⠡⠒⠨⠡⠀",
+ [8888]="⠀⠫⠒⠨⠡⠀",
+ [8895]="⠫⠞⠨⠗⠻",
+ [8901]="â ¡",
+ [8902]="â «â Ž",
+ [8909]="⠀⠠⠱⠱⠀",
+ [8918]="⠀⠡⠈â â …⠻⠀",
+ [8919]="⠀⠡⠈⠨⠂⠻⠀",
+ [8920]="â €â â …â ˆâ â …â ˆâ â …⠻⠀",
+ [8921]="⠀⠨⠂⠈⠨⠂⠈⠨⠂⠻⠀",
+ [8924]="⠀⠱â â …â €",
+ [8925]="⠀⠱⠨⠂⠀",
+ [8942]="⠀⠩⠒⠒⠒⠀",
+ [8943]="⠀⠒⠒⠒",
+ [8944]="⠀⠘⠒⠒⠒⠀",
+ [8945]="⠀⠰⠒⠒⠒⠀",
+ [8946]="⠀⠱⠈⠈⠑⠻⠀",
+ [8949]="â €â â ˆâ ‘⠣⠡⠻⠀",
+ [8950]="⠀⠱⠈⠑⠀",
+ [8954]="⠀⠱⠈⠈⠢⠻⠀",
+ [8957]="⠀⠱⠈⠢⠀",
+ [8968]="⠈⠘⠷",
+ [8969]="⠈⠘⠾",
+ [8970]="⠈⠰⠷",
+ [8971]="⠈⠰⠾",
+ [8994]="⠀⠫â â €",
+ [8995]="⠀⠫⠄⠀",
+ [9632]="⠫⠸⠲",
+ [9633]="â «â ²",
+ [9644]="⠫⠸⠗",
+ [9645]="â «â —",
+ [9650]="⠫⠸⠞",
+ [9651]="â «â ž",
+ [9660]="⠸⠨⠫",
+ [9675]="â «â ‰",
+ [9679]="⠫⠸⠉",
+ [9707]="⠫⠲⠸⠫⠳⠻",
+ [10178]="⠀⠫â â €",
+ [10179]="⠀⠨⠡⠈⠸â â …⠻⠀",
+ [10180]="⠀⠨⠡⠈⠸⠨⠂⠻⠀",
+ [10204]="⠀⠫⠨⠡⠒⠒⠀",
+ [10205]="⠀⠫⠳⠒⠒⠀",
+ [10206]="⠀⠫⠒⠒⠳⠀",
+ [10207]="⠫⠣⠳⠒⠒⠨⠡",
+ [10214]="⠈⠸⠷",
+ [10215]="⠈⠸⠾",
+ [10216]="⠨⠨⠷",
+ [10217]="⠨⠨⠾",
+ [10229]="⠀⠫⠪⠒⠒⠒⠀",
+ [10230]="⠀⠫⠒⠒⠒⠕⠀",
+ [10231]="⠀⠫⠪⠒⠒⠒⠕⠀",
+ [10232]="⠀⠫⠪⠶⠶⠶⠀",
+ [10233]="⠀⠫⠶⠶⠶⠕⠀",
+ [10234]="⠀⠫⠪⠶⠶⠶⠕⠀",
+ [10235]="⠀⠫⠪⠒⠒⠒⠳⠀",
+ [10236]="⠀⠫⠳⠒⠒⠒⠕⠀",
+ [10237]="⠀⠫⠪⠶⠶⠶⠳⠀",
+ [10238]="⠀⠫⠳⠶⠶⠶⠕⠀",
+ [10239]="⠀⠫⠢⠤⠔⠒⠢⠤⠔⠒⠢⠕⠀",
+ [10529]="⠀⠫⠘⠪⠒⠒⠕⠀",
+ [10530]="⠀⠫⠰⠪⠒⠒⠕⠀",
+ [10627]="⠨⠸⠷",
+ [10628]="⠨⠸⠾",
+ [10641]="⠡⠈⠨⠨⠷⠻",
+ [10642]="⠡⠈⠨⠨⠾⠻",
+ [10692]="⠫⠲⠸⠫⠔⠻",
+ [10693]="⠫⠲⠸⠫⠢⠻",
+ [10694]="⠫⠲⠸⠫⠈⠼⠻",
+ [10698]="â â «â žâ £â ¡â »",
+ [10699]="â «â žâ ±",
+ [10700]="â «â žâ Ž",
+ [10726]="⠫⠳⠶⠶⠳",
+ [10764]="⠮⠮⠮⠮",
+ [10765]="⠮⠈⠱⠻",
+ [10766]="⠮⠈⠱⠱⠻",
+ [10774]="⠮⠈⠫⠲⠻",
+ [10776]="⠮⠈⠈⠡⠻",
+ [10777]="⠮⠈⠨⠩⠻",
+ [10778]="⠮⠈⠨⠬⠻",
+ [10779]="⠣⠮",
+ [10780]="â ©â ®",
+ [10786]="â â ¬â £â ¨â ¡â »",
+ [10787]="â â ¬â £â ¸â £â »",
+ [10788]="â â ¬â £â ˆâ ±â »",
+ [10789]="â â ¬â ©â ¡â »",
+ [10794]="â â ±â ©â ¡â »",
+ [10800]="â â ˆâ ¡â £â ¡â »",
+ [10801]="⠈⠡⠱",
+ [10808]="⠫⠉⠸⠫⠨⠌⠻",
+ [10809]="⠫⠞⠸⠫⠬⠻",
+ [10810]="⠫⠞⠸⠫⠤⠻",
+ [10811]="⠫⠞⠸⠫⠈⠡⠻",
+ [10816]="⠡⠈⠨⠩⠻",
+ [10817]="⠤⠈⠨⠬⠻",
+ [10818]="⠱⠨⠬",
+ [10819]="⠱⠨⠩",
+ [10833]="â â ˆâ ©â £â ¡â »",
+ [10834]="â â ˆâ ¬â £â ¡â »",
+ [10844]="⠱⠈⠈⠩⠻",
+ [10845]="⠱⠈⠈⠬⠻",
+ [10846]="⠱⠱⠈⠩",
+ [10847]="⠈⠩⠱",
+ [10848]="⠈⠩⠱⠱",
+ [10850]="⠱⠱⠈⠬",
+ [10851]="⠈⠬⠱⠱",
+ [10854]="â €â â ¨â …⠩⠡⠻⠀",
+ [10855]="â €â â ¸â ‡â £â ¡â »â €",
+ [10858]="â €â â ˆâ ±â £â ¡â »â €",
+ [10860]="⠀⠈⠱⠱⠈⠱⠀",
+ [10861]="â €â â ˆâ ±â ¨â …⠣⠡⠻⠀",
+ [10862]="â €â â ¨â …⠣⠈⠼⠻⠀",
+ [10863]="â €â â ˆâ ±â ˆâ ±â £â ¸â £â »â €",
+ [10864]="⠀⠈⠱⠈⠱⠨⠅⠀",
+ [10865]="⠀⠨⠅⠬⠀",
+ [10866]="⠀⠬⠨⠅⠀",
+ [10867]="⠀⠨⠅⠈⠱⠀",
+ [10868]="â €â â ‚â â ‚⠨⠅⠀",
+ [10869]="⠀⠨⠅⠨⠅⠀",
+ [10870]="⠀⠨⠅⠨⠅⠨⠅⠀",
+ [10871]="â €â â ¨â …⠩⠡⠡⠣⠡⠡⠻⠀",
+ [10872]="â €â â ¸â ‡â £â ¡â ¡â ¡â ¡â »â €",
+ [10873]="â €â â …⠈⠨⠡⠻⠀",
+ [10874]="⠀⠨⠂⠈⠨⠡⠻⠀",
+ [10875]="â €â â â …⠣⠸⠦⠻⠀",
+ [10876]="â €â â ¨â ‚⠣⠸⠦⠻⠀",
+ [10885]="â €â â …⠈⠱⠈⠱⠀",
+ [10886]="⠀⠨⠂⠈⠱⠈⠱⠀",
+ [10891]="â €â â …⠨⠅⠨⠂⠀",
+ [10892]="⠀⠨⠂⠨⠅â â …â €",
+ [10893]="â €â â …⠈⠱⠱⠀",
+ [10894]="⠀⠨⠂⠈⠱⠱⠀",
+ [10895]="â €â â …⠈⠱⠨⠂⠀",
+ [10896]="⠀⠨⠂⠈⠱â â …â €",
+ [10897]="â €â â …⠨⠂⠨⠅⠀",
+ [10898]="⠀⠨⠂â â …⠨⠅⠀",
+ [10905]="⠀⠨⠅â â …â €",
+ [10906]="⠀⠨⠅⠨⠂⠀",
+ [10909]="⠀⠈⠱â â …â €",
+ [10910]="⠀⠈⠱⠨⠂⠀",
+ [10911]="⠀⠈⠱â â …⠨⠅⠀",
+ [10912]="⠀⠈⠱⠨⠂⠨⠅⠀",
+ [10926]="⠀⠈⠣⠨⠅⠀",
+ [10927]="⠀⠨â â …⠱⠀",
+ [10928]="⠀⠨⠨⠂⠱⠀",
+ [10929]="⠀⠨â â …⠌⠱⠀",
+ [10930]="⠀⠨⠨⠂⠌⠱⠀",
+ [10931]="⠀⠨â â …⠨⠅⠀",
+ [10932]="⠀⠨⠨⠂⠨⠅⠀",
+ [10933]="⠀⠨â â …⠌⠨⠅⠀",
+ [10934]="⠀⠨⠨⠂⠌⠨⠅⠀",
+ [10935]="⠀⠨â â …⠈⠱⠈⠱⠀",
+ [10936]="⠀⠨⠨⠂⠈⠱⠈⠱⠀",
+ [10937]="⠀⠨â â …⠌⠈⠱⠈⠱⠀",
+ [10938]="⠀⠨⠨⠂⠌⠈⠱⠈⠱⠀",
+ [10939]="⠀⠨â â …⠈⠨â â …⠻⠀",
+ [10940]="⠀⠨⠨⠂⠈⠨⠨⠂⠻⠀",
+ [10941]="⠀⠡⠈⠸â â …⠻⠀",
+ [10942]="⠀⠡⠈⠸⠨⠂⠻⠀",
+ [10943]="â €â â ¸â â …⠩⠬⠻⠀",
+ [10944]="â €â â ¸â ¨â ‚⠩⠬⠻⠀",
+ [10945]="â €â â ¸â â …⠩⠈⠡⠻⠀",
+ [10946]="â €â â ¸â ¨â ‚⠩⠈⠡⠻⠀",
+ [10949]="⠀⠸â â …⠨⠅⠀",
+ [10950]="⠀⠸⠨⠂⠨⠅⠀",
+ [10951]="⠀⠸â â …⠈⠱⠀",
+ [10952]="⠀⠸⠨⠂⠈⠱⠀",
+ [10953]="⠀⠸â â …⠈⠱⠈⠱⠀",
+ [10954]="⠀⠸⠨⠂⠈⠱⠈⠱⠀",
+ [10955]="⠀⠸â â …⠌⠨⠅⠀",
+ [10956]="⠀⠸⠨⠂⠌⠨⠅⠀",
+ [10963]="⠀⠸â â …⠸⠨⠂⠀",
+ [10964]="⠀⠸⠨⠂⠸â â …â €",
+ [10965]="⠀⠸â â …â ¸â â …â €",
+ [10966]="⠀⠸⠨⠂⠸⠨⠂⠀",
+ [10967]="⠀⠸⠨⠂â â ¸â â …â €",
+ [10991]="⠀⠫⠩⠨⠡⠒⠒⠀",
+ [10992]="⠀⠫⠣⠨⠡⠒⠒⠀",
+ [10993]="⠀⠫⠣⠨⠡⠒⠒⠳⠀",
+ [10994]="⠀⠱⠈⠫⠇⠻⠀",
+ [10995]="⠀⠈⠱⠈⠫⠇⠻⠀",
+ [10996]="⠀⠳⠳⠳⠀",
+ [11039]="⠫⠸⠢",
+ [11040]="â «â ¢",
+ [11041]="â «â –",
+ [11042]="⠫⠸⠖",
+ [11052]="⠫⠸⠑",
+ [11053]="â «â ‘",
+ [11056]="⠀⠨⠡⠈⠫⠪⠒⠒⠻⠀",
+ [11057]="⠀⠫⠪⠒⠒⠫⠪⠒⠒⠫⠪⠒⠒⠀",
+ [11058]="⠀⠫⠪⠒⠒⠈⠫⠉⠸⠫⠬⠻⠀",
+ [11203]="⠫⠸⠦",
+ },
+ ["source"]="https://devblogs.microsoft.com/math-in-office/unicode-math-braille-sequences/",
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-com.mkxl b/Master/texmf-dist/tex/context/base/mkxl/math-com.mkxl
new file mode 100644
index 00000000000..27f014d4409
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-com.mkxl
@@ -0,0 +1,89 @@
+%D \module
+%D [ file=math-com,
+%D version=2022.07.17,
+%D title=\CONTEXT\ Math Macros,
+%D subtitle=Combinations,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%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 Math Macros / Initializations}
+
+%D This module might be extended.
+
+\unprotect
+
+% \startcombination[2*2]
+% \startcontent
+% \startplaceformula\startformula[width=\combinationwidth,title=a]1+x\stopformula\stopplaceformula
+% \stopcontent
+% \startcaption\stopcaption
+% \startcontent
+% \startplaceformula\startformula[width=\combinationwidth,title=b]2+x\stopformula\stopplaceformula
+% \stopcontent
+% \startcaption\stopcaption
+% \startcontent
+% \startplaceformula\startformula[width=\combinationwidth,xxxxx=c]3+x\stopformula\stopplaceformula
+% \stopcontent
+% \startcaption\stopcaption
+% \startcontent
+% \startplaceformula\startformula[width=\combinationwidth,title=d]4+x\stopformula\stopplaceformula
+% \stopcontent
+% \startcaption\stopcaption
+% \stopcombination
+%
+% \startplaceformula[a]
+% \startcombination[formula][nx=2,ny=2]
+% \startformula[width=\combinationwidth,title=a]1+x\stopformula
+% \startformula[width=\combinationwidth,title=b]2+x\stopformula
+% \startformula[width=\combinationwidth,xxxxx=c]3+x\stopformula
+% \startformula[width=\combinationwidth,title=d]4+x\stopformula
+% \stopcombination
+% \stopplaceformula
+%
+% \startplaceformula[a]
+% \startformulacombination[nx=2,ny=2]
+% \startformula[width=\combinationwidth,title=a]1+x\stopformula
+% \startformula[width=\combinationwidth,title=b]2+x\stopformula
+% \startformula[width=\combinationwidth,xxxxx=c]3+x\stopformula
+% \startformula[width=\combinationwidth,title=d]4+x\stopformula
+% \stopformulacombination
+% \stopplaceformula
+
+\defcsname\??combinationmethod\v!formula\endcsname
+ {\vcenter}
+
+\defcsname\??combinationmethod\v!formula:\v!start\endcsname
+ {\startformula
+ \dostarttagged\t!formulaset\empty
+ \global\settrue\c_strc_formulas_inside_formulas
+ \bgroup
+ \setupformulas[\c!width=\combinationwidth]%
+ \enforced\tolerant\protected\def\startformula[##1]%
+ {\startcontent
+ \strc_formulas_nested_formula_start[\c!width=\combinationwidth,##1]}%
+ \enforced\protected\def\stopformula
+ {\normalexpanded
+ {\strc_formulas_nested_formula_stop
+ \stopcontent
+ \startcaption
+ \formulaparameter\c!title
+ \stopcaption}}}
+
+\defcsname\??combinationmethod\v!formula:\v!stop\endcsname
+ {\egroup
+ \global\setfalse\c_strc_formulas_inside_formulas
+ \dostoptagged
+ \stopformula
+ \the\everyresetformulas}
+
+\definecombination[\v!formula][method=formula,width=\hsize]
+
+\protected\def\startformulacombination{\startcombination[\v!formula]}
+\protected\def\stopformulacombination {\stopcombination}
+
+\protect
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-def.mkxl b/Master/texmf-dist/tex/context/base/mkxl/math-def.mkxl
index 1f3da649d1d..be33bac8619 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/math-def.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-def.mkxl
@@ -18,61 +18,61 @@
\pushoverloadmode % cap etc
\startluacode
- mathematics.define(\number\defaultmathfamily)
+ mathematics.define()
-- mathematics.xml.registerentities()
\stopluacode
\popoverloadmode
-\activatemathcharacters
-
-%D The \mfunction macro is an alternative for \hbox with a controlable font
-%D switch.
-
-\definemathcommand [arccos] [nolop] {\mfunctionlabeltext{arccos}}
-\definemathcommand [arcsin] [nolop] {\mfunctionlabeltext{arcsin}}
-\definemathcommand [arctan] [nolop] {\mfunctionlabeltext{arctan}}
-\definemathcommand [arccosh] [nolop] {\mfunctionlabeltext{arccosh}}
-\definemathcommand [arcsinh] [nolop] {\mfunctionlabeltext{arcsinh}}
-\definemathcommand [arctanh] [nolop] {\mfunctionlabeltext{arctanh}}
-\definemathcommand [acos] [nolop] {\mfunctionlabeltext{acos}}
-\definemathcommand [asin] [nolop] {\mfunctionlabeltext{asin}}
-\definemathcommand [atan] [nolop] {\mfunctionlabeltext{atan}}
-\definemathcommand [arg] [nolop] {\mfunctionlabeltext{arg}}
-\definemathcommand [cosh] [nolop] {\mfunctionlabeltext{cosh}}
-\definemathcommand [cos] [nolop] {\mfunctionlabeltext{cos}}
-\definemathcommand [coth] [nolop] {\mfunctionlabeltext{coth}}
-\definemathcommand [cot] [nolop] {\mfunctionlabeltext{cot}}
-\definemathcommand [csc] [nolop] {\mfunctionlabeltext{csc}}
-\definemathcommand [deg] [nolop] {\mfunctionlabeltext{deg}}
-\definemathcommand [det] [limop] {\mfunctionlabeltext{det}}
-\definemathcommand [dim] [nolop] {\mfunctionlabeltext{dim}}
-\definemathcommand [exp] [nolop] {\mfunctionlabeltext{exp}}
-\definemathcommand [gcd] [limop] {\mfunctionlabeltext{gcd}}
-\definemathcommand [hom] [nolop] {\mfunctionlabeltext{hom}}
-\definemathcommand [inf] [limop] {\mfunctionlabeltext{inf}}
-\definemathcommand [injlim] [limop] {\mfunctionlabeltext{injlim}}
-\definemathcommand [ker] [nolop] {\mfunctionlabeltext{ker}}
-\definemathcommand [lg] [nolop] {\mfunctionlabeltext{lg}}
-\definemathcommand [liminf] [limop] {\mfunctionlabeltext{liminf}}
-\definemathcommand [limsup] [limop] {\mfunctionlabeltext{limsup}}
-\definemathcommand [lim] [limop] {\mfunctionlabeltext{lim}}
-\definemathcommand [ln] [nolop] {\mfunctionlabeltext{ln}}
-\definemathcommand [log] [nolop] {\mfunctionlabeltext{log}}
-\definemathcommand [median] [limop] {\mfunctionlabeltext{median}}
-\definemathcommand [max] [limop] {\mfunctionlabeltext{max}}
-\definemathcommand [min] [limop] {\mfunctionlabeltext{min}}
-\definemathcommand [mod] [limop] {\mfunctionlabeltext{mod}}
-%definemathcommand [div] [limop] {\mfunctionlabeltext{div}} % overloads \div symbol
-\definemathcommand [projlim] [limop] {\mfunctionlabeltext{projlim}}
-\definemathcommand [Pr] [limop] {\mfunctionlabeltext{Pr}}
-\definemathcommand [sec] [nolop] {\mfunctionlabeltext{sec}}
-\definemathcommand [sinh] [nolop] {\mfunctionlabeltext{sinh}}
-\definemathcommand [sin] [nolop] {\mfunctionlabeltext{sin}}
-\definemathcommand [sup] [limop] {\mfunctionlabeltext{sup}}
-\definemathcommand [tanh] [nolop] {\mfunctionlabeltext{tanh}}
-\definemathcommand [tan] [nolop] {\mfunctionlabeltext{tan}}
-\definemathcommand [diff] {\mfunctionlabeltext{diff}}
+% \activatemathcharacters
+
+%D The \mfunction macro is an alternative for \hbox with a controlable font switch.
+
+\definemathfunction [arccos]
+\definemathfunction [arcsin]
+\definemathfunction [arctan]
+\definemathfunction [arccosh]
+\definemathfunction [arcsinh]
+\definemathfunction [arctanh]
+\definemathfunction [acos]
+\definemathfunction [asin]
+\definemathfunction [atan]
+\definemathfunction [arg]
+\definemathfunction [cosh]
+\definemathfunction [cos]
+\definemathfunction [coth]
+\definemathfunction [cot]
+\definemathfunction [csc]
+\definemathfunction [deg]
+\definemathfunction [det] [\c!mathlimits=\v!yes]
+\definemathfunction [dim]
+\definemathfunction [exp]
+\definemathfunction [gcd] [\c!mathlimits=\v!yes]
+\definemathfunction [hom]
+\definemathfunction [inf] [\c!mathlimits=\v!auto]
+\definemathfunction [inv] [\c!mathlimits=\v!auto]
+\definemathfunction [injlim] [\c!mathlimits=\v!auto]
+\definemathfunction [ker]
+\definemathfunction [lg]
+\definemathfunction [liminf] [\c!mathlimits=\v!auto]
+\definemathfunction [limsup] [\c!mathlimits=\v!auto]
+\definemathfunction [lim] [\c!mathlimits=\v!auto]
+\definemathfunction [ln]
+\definemathfunction [log]
+\definemathfunction [median] [\c!mathlimits=\v!yes]
+\definemathfunction [max] [\c!mathlimits=\v!auto]
+\definemathfunction [min] [\c!mathlimits=\v!auto]
+\definemathfunction [mod] [\c!mathlimits=\v!yes]
+%definemathfunction [div] [\c!mathlimits=\v!yes]
+\definemathfunction [projlim] [\c!mathlimits=\v!auto]
+\definemathfunction [Pr] [\c!mathlimits=\v!yes]
+\definemathfunction [sec]
+\definemathfunction [sinh]
+\definemathfunction [sin]
+\definemathfunction [sup] [\c!mathlimits=\v!auto]
+\definemathfunction [tanh]
+\definemathfunction [tan]
+\definemathfunction [diff]
\aliased\let\normalmatharg\arg % todo: maybe automatically
@@ -104,15 +104,14 @@
%D equalscoloncolon, coloncolonapprox, approxcoloncolon,
%D colonsim, simcoloncolon}
%D
-%D The following colon related definitions are provided by Aditya
-%D Mahajan who derived them from \type {mathtools.sty} and \type
-%D {colonequals.sty}. This will be redone as part of the overhaul
-%D and font updates.
+%D The following colon related definitions are provided by Aditya Mahajan who
+%D derived them from \type {mathtools.sty} and \type {colonequals.sty}. This will be
+%D redone as part of the overhaul and font updates.
%D
-%D In $a := b$ the colon is not vertically centered with the equal
-%D to. Also the distance between colon and equal to is a bit large.
-%D So, we define a vertically centered colon \tex {centercolon} and
-%D a few macros for colon and double colon relation symbols.
+%D In $a := b$ the colon is not vertically centered with the equal to. Also the
+%D distance between colon and equal to is a bit large. So, we define a vertically
+%D centered colon \tex {centercolon} and a few macros for colon and double colon
+%D relation symbols.
%D
%D \startlines
%D \formula {A \centercolon B}
@@ -140,28 +139,28 @@
\pushoverloadmode
-\definemathcommand [colonsep] {\mkern-1.2mu}
-\definemathcommand [doublecolonsep] {\mkern-0.9mu}
-
-\definemathcommand [centercolon] [rel] {\mathstylevcenteredhbox\colon}
-\definemathcommand [colonminus] [rel] {\centercolon\colonsep\mathrel{-}}
-%definemathcommand [minuscolon] [rel] {\mathrel{-}\colonsep\centercolon} % native char
-%definemathcommand [colonequals] [rel] {\centercolon\colonsep=} % native char
-%definemathcommand [equalscolon] [rel] {=\centercolon\colonsep} % native char
-\definemathcommand [colonapprox] [rel] {\centercolon\colonsep\approx}
-\definemathcommand [approxcolon] [rel] {\approx\centercolon\colonsep}
-\definemathcommand [colonsim] [rel] {\centercolon\colonsep\sim}
-\definemathcommand [simcolon] [rel] {\sim\centercolon\colonsep}
-
-\definemathcommand [coloncolon] [rel] {\centercolon\doublecolonsep\centercolon}
-\definemathcommand [coloncolonminus] [rel] {\coloncolon\colonsep\mathrel{-}}
-\definemathcommand [minuscoloncolon] [rel] {\mathrel{-}\colonsep\coloncolon}
-\definemathcommand [coloncolonequals] [rel] {\coloncolon\colonsep=} % native char
-\definemathcommand [equalscoloncolon] [rel] {=\coloncolon\colonsep}
-\definemathcommand [coloncolonapprox] [rel] {\coloncolon\colonsep\approx}
-\definemathcommand [approxcoloncolon] [rel] {\approx\coloncolon\colonsep}
-\definemathcommand [coloncolonsim] [rel] {\coloncolon\colonsep\sim}
-\definemathcommand [simcoloncolon] [rel] {\sim\coloncolon\colonsep}
+\definemathcommand [colonsep] {\mkern-1.2mu}
+\definemathcommand [doublecolonsep] {\mkern-0.9mu}
+
+\definemathcommand [centercolon] [\s!relation] {\mathstylevcenteredhbox\colon}
+\definemathcommand [colonminus] [\s!relation] {\centercolon\colonsep\mathrel{-}}
+%definemathcommand [minuscolon] [\s!relation] {\mathrel{-}\colonsep\centercolon} % native char
+%definemathcommand [colonequals] [\s!relation] {\centercolon\colonsep=} % native char
+%definemathcommand [equalscolon] [\s!relation] {=\centercolon\colonsep} % native char
+\definemathcommand [colonapprox] [\s!relation] {\centercolon\colonsep\approx}
+\definemathcommand [approxcolon] [\s!relation] {\approx\centercolon\colonsep}
+\definemathcommand [colonsim] [\s!relation] {\centercolon\colonsep\sim}
+\definemathcommand [simcolon] [\s!relation] {\sim\centercolon\colonsep}
+
+\definemathcommand [coloncolon] [\s!relation] {\centercolon\doublecolonsep\centercolon}
+\definemathcommand [coloncolonminus] [\s!relation] {\coloncolon\colonsep\mathrel{-}}
+\definemathcommand [minuscoloncolon] [\s!relation] {\mathrel{-}\colonsep\coloncolon}
+\definemathcommand [coloncolonequals] [\s!relation] {\coloncolon\colonsep=} % native char
+\definemathcommand [equalscoloncolon] [\s!relation] {=\coloncolon\colonsep}
+\definemathcommand [coloncolonapprox] [\s!relation] {\coloncolon\colonsep\approx}
+\definemathcommand [approxcoloncolon] [\s!relation] {\approx\coloncolon\colonsep}
+\definemathcommand [coloncolonsim] [\s!relation] {\coloncolon\colonsep\sim}
+\definemathcommand [simcoloncolon] [\s!relation] {\sim\coloncolon\colonsep}
\popoverloadmode
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-del.mkxl b/Master/texmf-dist/tex/context/base/mkxl/math-del.mkxl
index 07e6d794874..35d71460baa 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/math-del.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-del.mkxl
@@ -31,10 +31,10 @@
% Actually we can do better now with lua hacks.
-\newcount\c_math_delimiter_nesting
+\newinteger\c_math_delimiter_nesting
-\permanent\protected\def\leftfakedelimiter {\advance\c_math_delimiter_nesting\minusone\gobbleoneargument}
-\permanent\protected\def\rightfakedelimiter{\advance\c_math_delimiter_nesting\plusone \gobbleoneargument}
+\permanent\protected\def\leftfakedelimiter {\advanceby\c_math_delimiter_nesting\minusone\gobbleoneargument}
+\permanent\protected\def\rightfakedelimiter{\advanceby\c_math_delimiter_nesting\plusone \gobbleoneargument}
\permanent\protected\def\checkdelimiters#1%
{\c_math_delimiter_nesting\zerocount
@@ -66,7 +66,7 @@
% A new experiment:
% Hm, we already have \definemathextensible so we need to preserve that one. We now
-% use \definemathdelimiter.
+% use \definemathdelimiter. This mechanism will probably disappear so don't use it!
\installcorenamespace {mathdelimiter}
@@ -85,11 +85,12 @@
\appendtoks
\ifcstok{\mathdelimiterparameter\c!define}\v!yes
+ % we can intercept auto here
\frozen\instance\setuevalue\currentmathdelimiter{\mathdelimiter[\currentmathdelimiter]}%
\fi
\to \everydefinemathdelimiter
-\permanent\tolerant\protected\def\mathdelimiter[#1]#*[#2]%
+\permanent\tolerant\protected\def\mathdelimiter[#1]#*[#2]% so not really used (for now)
{\mathop
{\edef\currentmathdelimiter{#1}%
\iftok{#2}\emptytoks
@@ -118,7 +119,11 @@
\mskip\p_rightoffset
\fi}}
-\definemathdelimiter[integral][\c!symbol="222B]
+% \definemathdelimiter[integral][\c!symbol="222B]
+
+\permanent\protected\def\integral{\int\Umathadapttoright}
+
+\aliased\let\Umathadaptsize\Umathadapttoright
% \setupmathdelimiter[integral][rightoffset=-3mu,exact=yes,factor=2]
%
@@ -134,7 +139,7 @@
% \ruledhbox{$\int f\frac{1}{2}$}
% \stoplines
-\permanent\protected\def\autointegral#1#2#3%
+\permanent\protected\def\autointegral#1#2#3% this one is obsolete now
{\ifmmode
\setbox\nextbox\mathstylehbox{#3}%
\scratchdimen\ifdim\nextboxht>\nextboxdp\nextboxht\else\nextboxdp\fi
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-dif.mkxl b/Master/texmf-dist/tex/context/base/mkxl/math-dif.mkxl
new file mode 100644
index 00000000000..ad53ee25a27
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-dif.mkxl
@@ -0,0 +1,48 @@
+%D \module
+%D [ file=math-dif,
+%D version=2022.05.31, % moved code
+%D title=\CONTEXT\ Math Macros,
+%D subtitle=Differentials,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%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 Math Macros / Differentials}
+
+\unprotect
+
+\pushoverloadmode
+
+ % For new times sake:
+
+ \let\normal_math_dd\dd
+ \let\normal_math_DD\DD
+
+ \def\c!differentiald{differentiald} % for now
+
+ \def\upright_math_dd{\mathatom \s!unpack \mathdifferentialcode{\mathupright d}}
+ \def\upright_math_DD{\mathatom \s!unpack \mathdifferentialcode{\mathupright D}}
+
+ \permanent\protected\def\dd
+ {\ifcstok{\mathematicsparameter\c!differentiald}\s!upright
+ \upright_math_dd
+ \else
+ \normal_math_dd
+ \fi}
+
+ \permanent\protected\def\DD
+ {\ifcstok{\mathematicsparameter\c!differentiald}\s!upright
+ \upright_math_DD
+ \else
+ \normal_math_DD
+ \fi}
+
+ % \setupmathematics[differentiald=upright]
+
+\popoverloadmode
+
+\protect
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-dim.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-dim.lmt
new file mode 100644
index 00000000000..cb2a489116b
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-dim.lmt
@@ -0,0 +1,251 @@
+if not modules then modules = { } end modules ['math-dim'] = {
+ version = 1.001,
+ comment = "companion to math-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- The radical_rule value is also used as a trigger. In luatex the accent
+-- placement happens either the opentype way (using topaccent cum suis) or the
+-- traditional way. In order to determine what method to use the \Umathradicalrule
+-- setting is consulted to determine what method to use. This is more efficient
+-- than analyzing the (potentially spread over multiple families) situation. For
+-- this reason we need to set the radical_rule here. It used to be "<unset>" in
+-- which case the engine takes the rulethickness. In c-speak:
+--
+-- int compat_mode = (radical_rule(cur_style) == undefined_math_parameter) ;
+--
+-- In the meantime things have been updated and we now have two code paths.
+
+local abs, next = math.abs, next
+
+local defaults = {
+ axis = { default = { "AxisHeight", "axisheight" }, },
+ accent_base_height = { default = { "AccentBaseHeight", "xheight" }, },
+ flattened_accent_base_height = { default = { "FlattenedAccentBaseHeight", "xheight" }, },
+ fraction_del_size = { default = { "FractionDelimiterSize", "delim2" },
+ cramped_display_style = { "FractionDelimiterDisplayStyleSize", "delim1" },
+ display_style = { "FractionDelimiterDisplayStyleSize", "delim1" }, },
+ fraction_denom_down = { default = { "FractionDenominatorShiftDown", "denom2" },
+ cramped_display_style = { "FractionDenominatorDisplayStyleShiftDown", "denom1" },
+ display_style = { "FractionDenominatorDisplayStyleShiftDown", "denom1" }, },
+ fraction_denom_vgap = { default = { "FractionDenominatorGapMin", "defaultrulethickness" },
+ cramped_display_style = { "FractionDenominatorDisplayStyleGapMin", "3*defaultrulethickness" },
+ display_style = { "FractionDenominatorDisplayStyleGapMin", "3*defaultrulethickness" }, },
+ fraction_num_up = { default = { "FractionNumeratorShiftUp", "num2" },
+ cramped_display_style = { "FractionNumeratorDisplayStyleShiftUp", "num1" },
+ display_style = { "FractionNumeratorDisplayStyleShiftUp", "num1" }, },
+ fraction_num_vgap = { default = { "FractionNumeratorGapMin", "defaultrulethickness" },
+ cramped_display_style = { "FractionNumeratorDisplayStyleGapMin", "3*defaultrulethickness" },
+ display_style = { "FractionNumeratorDisplayStyleGapMin", "3*defaultrulethickness" }, },
+ skewed_fraction_hgap = { default = { "SkewedFractionHorizontalGap", "mathquad/2" },
+ cramped_display_style = { "SkewedFractionHorizontalGap", "mathquad/2" },
+ display_style = { "SkewedFractionHorizontalGap", "mathquad/2" }, },
+ skewed_fraction_vgap = { default = { "SkewedFractionVerticalGap", "xheight" },
+ cramped_display_style = { "SkewedFractionVerticalGap", "xheight" },
+ display_style = { "SkewedFractionVerticalGap", "xheight" }, },
+ fraction_rule = { default = { "FractionRuleThickness", "defaultrulethickness" }, },
+ limit_above_bgap = { default = { "UpperLimitBaselineRiseMin", "bigopspacing3" }, },
+ limit_above_vgap = { default = { "UpperLimitGapMin", "bigopspacing1" }, },
+ limit_above_kern = { default = { "0", "bigopspacing5" }, },
+ limit_below_bgap = { default = { "LowerLimitBaselineDropMin", "bigopspacing4" }, },
+ limit_below_vgap = { default = { "LowerLimitGapMin", "bigopspacing2" }, },
+ limit_below_kern = { default = { "0", "bigopspacing5" }, },
+ math_operator_size = { default = { "DisplayOperatorMinHeight", "mathxheight*3" }, }, -- 2
+ overbar_kern = { default = { "OverbarExtraAscender", "defaultrulethickness" }, },
+ overbar_rule = { default = { "OverbarRuleThickness", "defaultrulethickness" }, },
+ overbar_vgap = { default = { "OverbarVerticalGap", "3*defaultrulethickness" }, },
+ quad = { default = { "fontsize(f)", "mathquad" }, },
+ radical_kern = { default = { "RadicalExtraAscender", "defaultrulethickness" }, },
+ radical_rule = { default = { "RadicalRuleThickness", "defaultrulethickness" }, },
+ -- default = { "surdheight(f)", "defaultrulethickness" },
+ radical_vgap = { default = { "RadicalVerticalGap", "defaultrulethickness+(abs(defaultrulethickness)/4)" },
+ display_style = { "RadicalDisplayStyleVerticalGap", "defaultrulethickness+(abs(mathxheight)/4)" }, },
+ space_after_script = { default = { "SpaceAfterScript", "scriptspace" }, },
+ space_before_script = { default = { "SpaceAfterScript", "scriptspace" }, },
+ stack_denom_down = { default = { "StackBottomShiftDown", "denom2" },
+ cramped_display_style = { "StackBottomDisplayStyleShiftDown", "denom1" },
+ display_style = { "StackBottomDisplayStyleShiftDown", "denom1" }, },
+ stack_num_up = { default = { "StackTopShiftUp", "num3" },
+ cramped_display_style = { "StackTopDisplayStyleShiftUp", "num1" },
+ display_style = { "StackTopDisplayStyleShiftUp", "num1" }, },
+ stack_vgap = { default = { "StackGapMin", "3*defaultrulethickness" },
+ cramped_display_style = { "StackDisplayStyleGapMin", "7*defaultrulethickness" },
+ display_style = { "StackDisplayStyleGapMin", "7*defaultrulethickness" }, },
+ sub_shift_down = { default = { "SubscriptShiftDown", "sub1" }, },
+ sub_shift_drop = { default = { "SubscriptBaselineDropMin", "subdrop" }, },
+ sub_sup_shift_down = { default = { "SubscriptShiftDown", "sub2" }, },
+ sub_top_max = { default = { "SubscriptTopMax", "abs(mathxheight*4)/5" }, },
+ subsup_vgap = { default = { "SubSuperscriptGapMin", "4*defaultrulethickness" }, },
+ sup_bottom_min = { default = { "SuperscriptBottomMin", "abs(mathxheight)/4" }, },
+ sup_shift_drop = { default = { "SuperscriptBaselineDropMax", "supdrop" }, },
+ sup_shift_up = { cramped_display_style = { "SuperscriptShiftUpCramped", "sup3" },
+ cramped_script_script_style = { "SuperscriptShiftUpCramped", "sup3" },
+ cramped_script_style = { "SuperscriptShiftUpCramped", "sup3" },
+ cramped_text_style = { "SuperscriptShiftUpCramped", "sup3" },
+ display_style = { "SuperscriptShiftUp", "sup1" },
+ script_script_style = { "SuperscriptShiftUp", "sup2" },
+ script_style = { "SuperscriptShiftUp", "sup2" },
+ text_style = { "SuperscriptShiftUp", "sup2" }, },
+ sup_sub_bottom_max = { default = { "SuperscriptBottomMaxWithSubscript", "abs(mathxheight*4)/5" }, },
+ underbar_kern = { default = { "UnderbarExtraDescender", "0" }, },
+ underbar_rule = { default = { "UnderbarRuleThickness", "defaultrulethickness" }, },
+ underbar_vgap = { default = { "UnderbarVerticalGap", "3*defaultrulethickness" }, },
+ connector_overlap_min = { default = { "MinConnectorOverlap", "0.25*defaultrulethickness" }, },
+ over_delimiter_vgap = { default = { "StretchStackGapBelowMin", "bigopspacing1" }, },
+ over_delimiter_bgap = { default = { "StretchStackTopShiftUp", "bigopspacing3" }, },
+ under_delimiter_vgap = { default = { "StretchStackGapAboveMin", "bigopspacing2" }, },
+ under_delimiter_bgap = { default = { "StretchStackBottomShiftDown", "bigopspacing4" }, },
+ radical_degree_before = { default = { "RadicalKernBeforeDegree", "(5/18)*quad" }, },
+ radical_degree_after = { default = { "RadicalKernAfterDegree", "(-10/18)*quad" }, },
+ radical_degree_raise = { default = { "RadicalDegreeBottomRaisePercent", "60" }, },
+ no_limit_sub_factor = { default = { "NoLimitSubFactor", "0" }, },
+ no_limit_sup_factor = { default = { "NoLimitSupFactor", "0" }, },
+}
+
+local styles = {
+ 'display_style',
+ 'cramped_display_style',
+ 'text_style',
+ 'cramped_text_style',
+ 'script_style',
+ 'cramped_script_style',
+ 'script_script_style',
+ 'cramped_script_script_style',
+}
+
+for k, v in next, defaults do
+ for _, s in next, styles do
+ if not v[s] then
+ v[s] = v.default
+ end
+ end
+end
+
+-- we cannot use a metatable because we do a copy (takes a bit more work)
+--
+-- local mt = { } setmetatable(defaults,mt)
+--
+-- mt.__index = function(t,s)
+-- return t.default or t.text_style or 0
+-- end
+--
+-- This will all go away in \LMTX\ because it makes no sense to support old fonts any longer,
+-- even when we assemble them one really needs to think about proper values. Okay, there is
+-- some historic value in here.
+
+function mathematics.dimensions(dimens) -- beware, dimens get spoiled
+ if dimens.SpaceAfterScript then
+ return table.fastcopy(dimens), { }
+ elseif dimens.AxisHeight or dimens.axisheight then
+ local t = { }
+ local mathxheight = dimens.xheight or 10*65536
+ local mathquad = dimens.quad or 10*65536
+ local defaultrulethickness = dimens.FractionDenominatorGapMin or dimens.defaultrulethickness or 0.4*65536
+ dimens["0"] = 0
+ dimens["60"] = 60
+ dimens["0.25*defaultrulethickness"] = defaultrulethickness / 4
+ dimens["3*defaultrulethickness"] = 3 * defaultrulethickness
+ dimens["4*defaultrulethickness"] = 4 * defaultrulethickness
+ dimens["7*defaultrulethickness"] = 7 * defaultrulethickness
+ dimens["(5/18)*quad"] = (mathquad * 5) / 18
+ dimens["(-10/18)*quad"] = - (mathquad * 10) / 18
+ dimens["mathxheight*3"] = mathxheight * 3 -- needs checking
+ dimens["abs(mathxheight*4)/5"] = abs(mathxheight * 4) / 5
+ dimens["defaultrulethickness+(abs(defaultrulethickness)/4)"] = defaultrulethickness+(abs(defaultrulethickness) / 4)
+ dimens["defaultrulethickness+(abs(mathxheight)/4)"] = defaultrulethickness+(abs(mathxheight) / 4)
+ dimens["abs(mathxheight)/4"] = abs(mathxheight) / 4
+ dimens["abs(mathxheight*4)/5"] = abs(mathxheight * 4) / 5
+ dimens["<not set>"] = false
+ dimens["scriptspace"] = false -- at macro level
+ for variable, styles in next, defaults do
+ local tt = { }
+ for style, default in next, styles do
+ local one = default[1]
+ local two = default[2]
+ local value = dimens[one]
+ if value then
+ tt[style] = value
+ else
+ value = dimens[two]
+ if value == false then
+ tt[style] = nil
+ else
+ tt[style] = value or 0
+ end
+ end
+ end
+ t[variable] = tt
+ end
+ local d = {
+ AccentBaseHeight = t . accent_base_height . text_style,
+ FlattenedAccentBaseHeight = t . flattened_accent_base_height . text_style,
+ AxisHeight = t . axis . text_style,
+ -- DelimitedSubFormulaMinHeight
+ DisplayOperatorMinHeight = t . math_operator_size . text_style, -- no longer let tex decide (weird values)
+ FractionDenominatorDisplayStyleGapMin = t . fraction_denom_vgap . display_style,
+ FractionDenominatorDisplayStyleShiftDown = t . fraction_denom_down . display_style,
+ FractionDenominatorGapMin = t . fraction_denom_vgap . text_style,
+ FractionDenominatorShiftDown = t . fraction_denom_down . text_style,
+ FractionNumeratorDisplayStyleGapMin = t . fraction_num_vgap . display_style,
+ FractionNumeratorDisplayStyleShiftUp = t . fraction_num_up . display_style,
+ FractionNumeratorGapMin = t . fraction_num_vgap . text_style,
+ FractionNumeratorShiftUp = t . fraction_num_up . text_style,
+ FractionRuleThickness = t . fraction_rule . text_style,
+ FractionDelimiterSize = t . fraction_del_size . text_style,
+ FractionDelimiterDisplayStyleSize = t . fraction_del_size . display_style,
+ LowerLimitBaselineDropMin = t . limit_below_bgap . text_style,
+ LowerLimitGapMin = t . limit_below_vgap . text_style,
+ -- MathLeading
+ MinConnectorOverlap = t . connector_overlap_min . text_style,
+ OverbarExtraAscender = t . overbar_kern . text_style,
+ OverbarRuleThickness = t . overbar_rule . text_style,
+ OverbarVerticalGap = t . overbar_vgap . text_style,
+ RadicalDisplayStyleVerticalGap = t . radical_vgap . display_style,
+ RadicalExtraAscender = t . radical_kern . text_style,
+ RadicalRuleThickness = t . radical_rule . text_style,
+ RadicalVerticalGap = t . radical_vgap . text_style,
+ RadicalKernBeforeDegree = t . radical_degree_before . display_style,
+ RadicalKernAfterDegree = t . radical_degree_after . display_style,
+ RadicalDegreeBottomRaisePercent = t . radical_degree_raise . display_style,
+ -- ScriptPercentScaleDown
+ -- ScriptScriptPercentScaleDown
+ SkewedFractionHorizontalGap = t . skewed_fraction_hgap . default,
+ SkewedFractionVerticalGap = t . skewed_fraction_vgap . default,
+ SpaceAfterScript = t . space_after_script . text_style,
+ StackBottomDisplayStyleShiftDown = t . stack_denom_down . display_style,
+ StackBottomShiftDown = t . stack_denom_down . text_style,
+ StackDisplayStyleGapMin = t . stack_vgap . display_style,
+ StackGapMin = t . stack_vgap . text_style,
+ StackTopDisplayStyleShiftUp = t . stack_num_up . display_style,
+ StackTopShiftUp = t . stack_num_up . text_style,
+ StretchStackGapBelowMin = t . over_delimiter_vgap . text_style,
+ StretchStackTopShiftUp = t . over_delimiter_bgap . text_style,
+ StretchStackGapAboveMin = t . under_delimiter_vgap . text_style,
+ StretchStackBottomShiftDown = t . under_delimiter_bgap . text_style,
+ SubSuperscriptGapMin = t . subsup_vgap . text_style,
+ SubscriptBaselineDropMin = t . sub_shift_drop . text_style,
+ SubscriptShiftDown = t . sub_shift_down . text_style,
+ SubscriptShiftDownWithSuperscript = t . sub_sup_shift_down . text_style,
+ SubscriptTopMax = t . sub_top_max . text_style,
+ SuperscriptBaselineDropMax = t . sup_shift_drop . text_style,
+ SuperscriptBottomMaxWithSubscript = t . sup_sub_bottom_max . text_style,
+ SuperscriptBottomMin = t . sup_bottom_min . text_style,
+ SuperscriptShiftUp = t . sup_shift_up . text_style,
+ SuperscriptShiftUpCramped = t . sup_shift_up . cramped_text_style,
+ UnderbarExtraDescender = t . underbar_kern . text_style,
+ UnderbarRuleThickness = t . underbar_rule . text_style,
+ UnderbarVerticalGap = t . underbar_vgap . text_style,
+ UpperLimitBaselineRiseMin = t . limit_above_bgap . text_style,
+ UpperLimitGapMin = t . limit_above_vgap . text_style,
+ }
+ -- too fragile for tx/px ... even the same values give different results
+ -- d.DisplayOperatorMinHeight = nil
+ -- d.AccentBaseHeight = 0 -- here? still? or maybe undedined i.e. maxdimen
+ return d, t -- t only for diagnostics
+ else
+ return { }, { }
+ end
+end
+
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-dld.mklx b/Master/texmf-dist/tex/context/base/mkxl/math-dld.mklx
new file mode 100644
index 00000000000..dcbb17c5eca
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-dld.mklx
@@ -0,0 +1,265 @@
+%D \module
+%D [ file=math-dld,
+%D version=2022.07.29,
+%D title=\CONTEXT\ Math Macros,
+%D subtitle=delimiteds,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%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 Math Macros / Delimited}
+
+\unprotect
+
+%D This is a variant on radicals but in the end it was better to just define a new
+%D environment for this. This is because we don't have the rule and we want a
+%D different control over the spacing. We also don't want the degree.
+
+% Todo: also add the mp plugin here but that more fun stuff for later (when we pick
+% up school math).
+
+\installcorenamespace{mathdelimited}
+\installcorenamespace{mathdelimitedalternative}
+
+\installcommandhandler \??mathdelimited {mathdelimited} \??mathdelimited
+
+\setupmathdelimited
+ [\c!alternative=\v!normal,
+ \c!mpoffset=.25\exheight,
+ \c!topoffset=\zeropoint,
+ \c!bottomoffset=\zeropoint,
+ \c!height=\zeropoint,
+ \c!depth=\zeropoint,
+ \c!strut=\v!height,
+ \c!source=\zerocount,
+ \c!size=\zerocount,
+ \c!left=\zerocount,
+ \c!right=\zerocount,
+ \c!leftmargin=\zeropoint,
+ \c!rightmargin=\zeropoint]
+
+\appendtoks
+ \ifcstok{\mathdelimitedparameter\c!rightmargin}\v!no\else
+ \frozen\protected\instance\edefcsname\currentmathdelimited\endcsname{\math_delimited_handle{\currentmathdelimited}}
+ \fi
+\to \everydefinemathdelimited
+
+\mutable\lettonothing\currentmathdelimited
+
+\tolerant\protected\def\math_delimited_handle#tag#*[#settings]#:#body%
+ {\begingroup
+ \edef\currentmathdelimited{#tag}%
+ \setupcurrentmathdelimited[#settings]%
+ \math_delimited_alternative{%
+ \begincsname\??mathwhateverstrut\mathdelimitedparameter\c!strut\endcsname
+ \scratchdimen\mathdelimitedparameter\c!leftmargin \relax\ifzeropt\scratchdimen\else\kern\scratchdimen\fi
+ #body%
+ \scratchdimen\mathdelimitedparameter\c!rightmargin\relax\ifzeropt\scratchdimen\else\kern\scratchdimen\fi
+ }%
+ \endgroup}
+
+\def\math_delimited_alternative{\csname\??mathdelimitedalternative\mathdelimitedparameter\c!alternative\endcsname}
+
+\protected\def\math_delimited_common
+ {\Udelimited
+ \s!height\dimexpr\mathdelimitedparameter\c!height+\mathdelimitedparameter\c!topoffset\relax
+ \s!depth \dimexpr\mathdelimitedparameter\c!depth+\mathdelimitedparameter\c!bottomoffset\relax
+ \s!source\numexpr\namedboxanchor{\mathdelimitedparameter\c!source}\relax
+ \s!style \normalmathstyle
+ \s!size \numexpr\namedboxanchor{\mathdelimitedparameter\c!size}\relax
+ \zerocount \mathdelimitedparameter\c!left
+ \zerocount \mathdelimitedparameter\c!right
+ \relax}
+
+\defcsname\??mathdelimitedalternative\v!default\endcsname % #body%
+ {\math_delimited_common} % {#body}}
+
+\defcsname\??mathdelimitedalternative\v!normal\endcsname#body%
+ {\edef\p_color{\mathdelimitedparameter\c!color}%
+ \ifempty\p_color
+ \math_delimited_common{#body}% {} really needed as \rootdelimited expands first
+ \else
+ \pushcolor[\p_color]%
+ \math_delimited_common
+ {\popcolor#body}%
+ \fi}
+
+
+%integerdef\delimitedrightgraveuc \privatecharactercode{delimited right grave}
+\integerdef\delimitedrightddotuc \privatecharactercode{delimited right ddot}
+\integerdef\delimitedrightbaruc \privatecharactercode{delimited right bar}
+%integerdef\delimitedrightacuteuc \privatecharactercode{delimited right acute}
+\integerdef\delimitedrighthatuc \privatecharactercode{delimited right hat}
+\integerdef\delimitedrightcheckuc \privatecharactercode{delimited right check}
+\integerdef\delimitedrightbreveuc \privatecharactercode{delimited right breve}
+\integerdef\delimitedrightdotuc \privatecharactercode{delimited right dot}
+\integerdef\delimitedrightringuc \privatecharactercode{delimited right ring}
+\integerdef\delimitedrighttildeuc \privatecharactercode{delimited right tilde}
+\integerdef\delimitedrightdddotuc \privatecharactercode{delimited right dddot}
+\integerdef\delimitedrightdaggeruc \privatecharactercode{delimited right dagger}
+\integerdef\delimitedrightddaggeruc \privatecharactercode{delimited right ddagger}
+\integerdef\delimitedrightastuc \privatecharactercode{delimited right ast}
+\integerdef\delimitedrightstaruc \privatecharactercode{delimited right star}
+
+% \integerdef\delimitedrighthatuc \privatecharactercode{delimited right hat}
+% \integerdef\delimitedrighttildeuc \privatecharactercode{delimited right tilde}
+% \integerdef\delimitedrightcheckuc \privatecharactercode{delimited right check}
+
+% todo: some more .. are the offsets okay?
+% breve and acute does not make sense
+
+\definemathdelimited
+ [marked]
+ [\c!command=\v!no,
+ \c!topoffset=.2\exheight]
+
+\definemathdelimited
+ [ddotmarked]
+ [marked]
+ [\c!right=\delimitedrightddotuc]
+
+\definemathdelimited
+ [barmarked]
+ [marked]
+ [\c!right=\delimitedrightbaruc]
+
+\definemathdelimited
+ [hatmarked]
+ [marked]
+ [\c!right=\delimitedrighthatuc]
+
+\definemathdelimited
+ [checkmarked]
+ [marked]
+ [\c!right=\delimitedrightcheckuc]
+
+\definemathdelimited
+ [brevemarked]
+ [marked]
+ [\c!right=\delimitedrightbreveuc]
+
+\definemathdelimited
+ [dotmarked]
+ [marked]
+ [\c!right=\delimitedrightdotuc]
+
+\definemathdelimited
+ [ringmarked]
+ [marked]
+ [\c!right=\delimitedrightringuc]
+
+\definemathdelimited
+ [tildemarked]
+ [marked]
+ [\c!right=\delimitedrighttildeuc]
+
+\definemathdelimited
+ [dddotmarked]
+ [marked]
+ [\c!right=\delimitedrightdddotuc]
+
+% The following ones are
+% not really belonging here,
+% but convenient
+
+\definemathdelimited
+ [daggermarked]
+ [marked]
+ [\c!size=1,
+ \c!right=\delimitedrightdaggeruc]
+
+\definemathdelimited
+ [ddaggermarked]
+ [marked]
+ [\c!size=1,
+ \c!right=\delimitedrightddaggeruc]
+
+\definemathdelimited
+ [astmarked]
+ [\c!size=1,
+ \c!right=\delimitedrightastuc]
+
+\definemathdelimited
+ [starmarked]
+ [marked]
+ [\c!size=1,
+ \c!right=\delimitedrightstaruc]
+
+% More contextual
+
+\definemathdelimited
+ [fourier]
+ [\c!topoffset=.2\exheight,
+ \c!right=\delimitedrighthatuc]
+
+\definemathdelimited
+ [inversefourier]
+ [fourier]
+ [\c!right=\delimitedrightcheckuc]
+
+\definemathdelimited
+ [fuzzyfourier]
+ [fourier]
+ [\c!right=\delimitedrighttildeuc]
+
+% \definemathdelimited
+% [bannuity]
+% [%topoffset=.2\exheight,
+% \c!strut=no,
+% \c!rightmargin=.05\emwidth,
+% \c!right=\delimitedrightanutityuc]
+
+% $ \autofences \fourier{(z+\frac12)} + \courier{(z+\frac12)} + \xourier{(z+\frac12)} $
+
+\definemathdelimited [primed] [\c!right="2032,\c!size=1,\c!topoffset=.2\exheight]
+\definemathdelimited [doubleprimed] [primed] [\c!right="2033]
+\definemathdelimited [tripleprimed] [primed] [\c!right="2034]
+\definemathdelimited [quadrupleprimed] [primed] [\c!right="2057]
+\definemathdelimited [reverseprimed] [primed] [\c!right="2035]
+\definemathdelimited [doublereverseprimed] [primed] [\c!right="2036]
+\definemathdelimited [triplereverseprimed] [primed] [\c!right="2037]
+
+%
+
+\integerdef\delimitedleftuppercorner \privatecharactercode{delimited left upper corner}
+\integerdef\delimitedrightuppercorner\privatecharactercode{delimited right upper corner}
+\integerdef\delimitedleftlowercorner \privatecharactercode{delimited left lower corner}
+\integerdef\delimitedrightlowercorner\privatecharactercode{delimited right lower corner}
+
+\definemathdelimited
+ [leftuppermarked]
+ [marked]
+ [\c!left=\delimitedleftuppercorner]
+
+\definemathdelimited
+ [rightuppermarked]
+ [marked]
+ [\c!right=\delimitedrightuppercorner]
+
+\definemathdelimited
+ [uppermarked]
+ [marked]
+ [\c!left=\delimitedleftuppercorner,
+ \c!right=\delimitedrightuppercorner]
+
+\definemathdelimited
+ [leftlowermarked]
+ [marked]
+ [\c!left=\delimitedleftlowercorner]
+
+\definemathdelimited
+ [rightlowermarked]
+ [marked]
+ [\c!right=\delimitedrightlowercorner]
+
+\definemathdelimited
+ [lowermarked]
+ [marked]
+ [\c!left=\delimitedleftlowercorner,
+ \c!right=\delimitedrightlowercorner]
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-ext.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-ext.lmt
new file mode 100644
index 00000000000..e1dc74e48e6
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-ext.lmt
@@ -0,0 +1,109 @@
+if not modules then modules = { } end modules ['math-ext'] = {
+ version = 1.001,
+ comment = "companion to math-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- local basename = file.basename
+-- local sortedhash = table.sortedhash
+--
+-- local mathematics = mathematics
+-- local extras = mathematics.extras or { }
+-- mathematics.extras = extras
+--
+-- local characters = characters
+-- local chardata = characters.data
+-- local mathpairs = characters.mathpairs
+--
+-- local trace_virtual = false
+-- local report_math = logs.reporter("mathematics")
+--
+-- trackers.register("math.virtual", function(v) trace_virtual = v end)
+--
+-- local mathplus = { }
+--
+-- function extras.add(unicode)
+-- local min = mathematics.extrabase
+-- local max = min + 0xFFF
+-- if unicode >= min and unicode <= max then
+-- if chardata[unicode] then
+-- mathplus[unicode] = true
+-- else
+-- report_math("extra %U is not a registered code point",unicode)
+-- end
+-- else
+-- report_math("extra %U should be in range %U - %U",unicode,min,max)
+-- end
+-- end
+--
+-- function extras.copy(target,original)
+-- local characters = target.characters
+-- local properties = target.properties
+-- local parameters = target.parameters
+-- for unicode in sortedhash(mathplus) do
+-- local extradesc = chardata[unicode]
+-- local nextinsize = extradesc.nextinsize
+-- if nextinsize then
+-- local extrachar = characters[unicode]
+-- local first = 1
+-- local charused = unicode
+-- if not extrachar then
+-- for i=1,#nextinsize do
+-- local slot = nextinsize[i]
+-- extrachar = characters[slot]
+-- if extrachar then
+-- characters[unicode] = extrachar
+-- first = i + 1
+-- charused = slot
+-- break
+-- end
+-- end
+-- end
+-- if not extrachar then
+-- if trace_virtual then
+-- report_math("extra %U in %a at %p with class %a and name %a is not mapped",
+-- unicode,basename(properties.fullname),parameters.size,
+-- extradesc.mathclass,extradesc.mathname)
+-- end
+-- elseif not extrachar.next then
+-- local nextused = false
+-- for i=first,#nextinsize do
+-- local nextslot = nextinsize[i]
+-- local nextbase = characters[nextslot]
+-- if nextbase then
+-- local nextnext = nextbase and nextbase.next
+-- if nextnext then
+-- local nextchar = characters[nextnext]
+-- if nextchar then
+-- extrachar.next = nextchar
+-- nextused = nextslot
+-- break
+-- end
+-- end
+-- end
+-- end
+-- if trace_virtual then
+-- if nextused then
+-- report_math("extra %U in %a at %p with class %a and name %a maps onto %U with next %U",
+-- unicode,basename(properties.fullname),parameters.size,charused,
+-- extradesc.mathclass,extradesc.mathname,nextused)
+-- else
+-- report_math("extra %U in %a at %p with class %a and name %a maps onto %U with no next",
+-- unicode,basename(properties.fullname),parameters.size,charused,
+-- extradesc.mathclass,extradesc.mathname)
+-- end
+-- end
+-- else
+-- if trace_virtual then
+-- report_math("extra %U in %a at %p with class %a and name %a maps onto %U with no next", -- own next
+-- unicode,basename(properties.fullname),parameters.size,charused,
+-- extradesc.mathclass,extradesc.mathname)
+-- end
+-- end
+-- end
+-- end
+-- end
+--
+-- utilities.sequencers.appendaction(mathactions,"system","mathematics.extras.copy")
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-fbk.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-fbk.lmt
new file mode 100644
index 00000000000..1cc02a49fbe
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-fbk.lmt
@@ -0,0 +1,791 @@
+if not modules then modules = { } end modules ['math-fbk'] = {
+ version = 1.001,
+ comment = "companion to math-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- This will partly be redone and go via definitions in goodies where we can share
+-- some across fonts. That makes most sense for those patches that might need some
+-- finetuning depending on the font.
+
+local next, type = next, type
+
+local trace_fallbacks = false trackers.register("math.fallbacks", function(v) trace_fallbacks = v end)
+
+local report_fallbacks = logs.reporter("math","fallbacks")
+
+local formatters = string.formatters
+local fastcopy = table.fastcopy
+local byte = string.byte
+local sortedhash = table.sortedhash
+local setmetatableindex = table.setmetatableindex
+
+local fallbacks = { }
+mathematics.fallbacks = fallbacks
+
+----- helpers = fonts.helpers
+----- charcommand = helpers.commands.char
+----- slotcommand = helpers.commands.slot
+----- leftcommand = helpers.commands.left
+----- rightcommand = helpers.commands.right
+----- upcommand = helpers.commands.up
+----- downcommand = helpers.commands.down
+----- popcommand = helpers.commands.pop
+----- pushcommand = helpers.commands.push
+
+local virtualcharacters = { }
+local virtualforced = { }
+
+local hashes = fonts.hashes
+local identifiers = hashes.identifiers
+local lastmathids = hashes.lastmathids
+
+-- we need a trick (todo): if we define scriptscript, script and text in
+-- that order we could use their id's .. i.e. we could always add a font
+-- table with those id's .. in fact, we could also add a whole lot more
+-- as it doesn't hurt
+
+function fallbacks.apply(target,original)
+ local mathparameters = target.mathparameters
+ if not mathparameters or not next(mathparameters) then
+ return
+ end
+ -- we also have forcedsize ... at this moment we already passed through
+ -- constructors.scale so we have this set
+ local parameters = target.parameters
+ local properties = target.properties
+ local mathsize = parameters.mathsize
+ if mathsize < 1 or mathsize > 3 then
+ return
+ end
+ local characters = target.characters
+ local size = parameters.size
+ local usedfonts = target.fonts
+ local compactmath = properties.compactmath
+ if not usedfonts then
+ usedfonts = { { id = 0 } } -- we need at least one entry (automatically done anyway)
+ target.fonts = usedfonts
+ end
+ -- not used
+ local textid, scriptid, scriptscriptid
+ local textindex, scriptindex, scriptscriptindex
+ local textdata, scriptdata, scriptscriptdata
+ if mathsize == 3 then
+ -- scriptscriptsize
+ textid = 0
+ scriptid = 0
+ scriptscriptid = 0
+ elseif mathsize == 2 then
+ -- scriptsize
+ textid = 0
+ scriptid = lastmathids[3] or 0
+ scriptscriptid = lastmathids[3] or 0
+ else
+ -- textsize
+ textid = 0
+ scriptid = lastmathids[2] or 0
+ scriptscriptid = lastmathids[3] or 0
+ end
+ if textid and textid ~= 0 then
+ textindex = #usedfonts + 1
+ textdata = target
+ usedfonts[textindex] = { id = textid }
+ else
+ textdata = target
+ end
+ if compactmath then
+ scriptid = textid
+ scriptscriptid = textid
+ end
+ if scriptid and scriptid ~= 0 then
+ scriptindex = #usedfonts + 1
+ scriptdata = identifiers[scriptid]
+ usedfonts[scriptindex] = { id = scriptid }
+ else
+ scriptindex = textindex
+ scriptdata = textdata
+ end
+ if scriptscriptid and scriptscriptid ~= 0 then
+ scriptscriptindex = #usedfonts + 1
+ scriptscriptdata = identifiers[scriptscriptid]
+ usedfonts[scriptscriptindex] = { id = scriptscriptid }
+ else
+ scriptscriptindex = scriptindex
+ scriptscriptdata = scriptdata
+ end
+ -- report_fallbacks("used textid: %S, used script id: %S, used scriptscript id: %S",textid,scriptid,scriptscriptid)
+ local data = {
+ textdata = textdata,
+ scriptdata = scriptdata,
+ scriptscriptdata = scriptscriptdata,
+ textindex = textindex,
+ scriptindex = scriptindex,
+ scriptscriptindex = scriptscriptindex,
+ textid = textid,
+ scriptid = scriptid,
+ scriptscriptid = scriptscriptid,
+ characters = characters,
+ unicode = k,
+ target = target,
+ original = original,
+ size = size,
+ mathsize = mathsize,
+ }
+ target.mathrelation = data
+ --
+ local fullname = trace_fallbacks and target.properties.fullname
+ --
+ for k, v in sortedhash(virtualcharacters) do
+ if not characters[k] or virtualforced[k] then
+ local tv = type(v)
+ local cd = nil
+ if tv == "table" then
+ cd = v
+ elseif tv == "number" then
+ cd = characters[v]
+ elseif tv == "function" then
+ cd = v(data) -- ,k
+ end
+ if cd then
+ characters[k] = cd
+ else
+ -- something else
+ end
+ if trace_fallbacks and characters[k] then
+ report_fallbacks("extending math font %a with %U",fullname,k)
+ end
+ end
+ end
+ data.unicode = nil
+end
+
+utilities.sequencers.appendaction("aftercopyingcharacters","system","mathematics.fallbacks.apply")
+
+function fallbacks.install(unicode,value)
+ virtualcharacters[unicode] = value
+end
+
+-- a few examples:
+
+-- local addextra = mathematics.extras.add
+
+-- addextra(0xFE350) -- MATHEMATICAL DOUBLE ARROW LEFT END
+-- addextra(0xFE351) -- MATHEMATICAL DOUBLE ARROW MIDDLE PART
+-- addextra(0xFE352) -- MATHEMATICAL DOUBLE ARROW RIGHT END
+--
+-- local leftarrow = charcommand[0x2190]
+-- local relbar = charcommand[0x2212]
+-- local rightarrow = charcommand[0x2192]
+--
+-- virtualcharacters[0xFE350] = function(data)
+-- -- return combined(data,0x2190,0x2212) -- leftarrow relbar
+-- local charone = data.characters[0x2190]
+-- local chartwo = data.characters[0x2212]
+-- if charone and chartwo then
+-- local size = data.size/2
+-- return {
+-- width = chartwo.width,
+-- height = size,
+-- depth = size,
+-- commands = {
+-- pushcommand,
+-- downcommand[size/2],
+-- leftarrow,
+-- popcommand,
+-- upcommand[size/2],
+-- relbar,
+-- }
+-- }
+-- end
+-- end
+--
+-- virtualcharacters[0xFE351] = function(data)
+-- -- return combined(data,0x2212,0x2212) -- relbar, relbar (isn't that just equal)
+-- local char = data.characters[0x2212]
+-- if char then
+-- local size = data.size/2
+-- return {
+-- width = char.width,
+-- height = size,
+-- depth = size,
+-- commands = {
+-- pushcommand,
+-- downcommand[size/2],
+-- relbar,
+-- popcommand,
+-- upcommand[size/2],
+-- relbar,
+-- }
+-- }
+-- end
+-- end
+--
+-- virtualcharacters[0xFE352] = function(data)
+-- -- return combined(data,0x2192,0x2212) -- rightarrow relbar
+-- local charone = data.characters[0x2192]
+-- local chartwo = data.characters[0x2212]
+-- if charone and chartwo then
+-- local size = data.size/2
+-- return {
+-- width = chartwo.width,
+-- height = size,
+-- depth = size,
+-- commands = {
+-- pushcommand,
+-- downcommand[size/2],
+-- relbar,
+-- popcommand,
+-- rightcommand[chartwo.width - charone.width],
+-- upcommand[size/2],
+-- rightarrow,
+-- }
+-- }
+-- end
+-- end
+
+---------------------------------------------------------------------------------
+-- these are moved to math-act.lmt (keep this code)
+---------------------------------------------------------------------------------
+
+-- local function accent_to_extensible(target,newchr,original,oldchr,height,depth,swap,offset,unicode)
+-- local characters = target.characters
+-- local olddata = characters[oldchr]
+-- -- brrr ... pagella has only next
+-- if olddata and not olddata.commands then -- not: and olddata.width > 0
+-- local addprivate = fonts.helpers.addprivate
+-- if swap then
+-- swap = characters[swap]
+-- height = swap.depth or 0
+-- depth = 0
+-- else
+-- height = height or 0
+-- depth = depth or 0
+-- end
+-- local oldheight = olddata.height or 0
+-- local correction = swap and
+-- downcommand[oldheight - height]
+-- or downcommand[oldheight + (offset or 0)]
+-- local newdata = {
+-- commands = { correction, charcommand[oldchr] },
+-- width = olddata.width,
+-- height = height,
+-- depth = depth,
+-- unicode = unicode,
+-- }
+-- local glyphdata = newdata
+-- local nextglyph = olddata.next
+-- while nextglyph do
+-- local oldnextdata = characters[nextglyph]
+-- if oldnextdata then
+-- local newnextdata = {
+-- commands = { correction, charcommand[nextglyph] },
+-- width = oldnextdata.width,
+-- height = height,
+-- depth = depth,
+-- }
+-- local newnextglyph = addprivate(target,formatters["M-N-%H"](nextglyph),newnextdata)
+-- newdata.next = newnextglyph
+-- local nextnextglyph = oldnextdata.next
+-- if nextnextglyph == nextglyph then
+-- break
+-- else
+-- olddata = oldnextdata
+-- newdata = newnextdata
+-- nextglyph = nextnextglyph
+-- end
+-- else
+-- report_fallbacks("error in fallback: no valid next, slot %X",nextglyph)
+-- break
+-- end
+-- end
+-- local hv = olddata.hparts
+-- if hv then
+-- hv = fastcopy(hv)
+-- newdata.hparts = hv
+-- for i=1,#hv do
+-- local hvi = hv[i]
+-- local oldglyph = hvi.glyph
+-- local olddata = characters[oldglyph]
+-- if olddata then
+-- local newdata = {
+-- commands = { correction, charcommand[oldglyph] },
+-- width = olddata.width,
+-- height = height,
+-- depth = depth,
+-- }
+-- hvi.glyph = addprivate(target,formatters["M-H-%H"](oldglyph),newdata)
+-- else
+-- report_fallbacks("error in fallback: no valid hparts, slot %X, index %i",oldglyph,i)
+-- end
+-- end
+-- end
+-- return glyphdata, true
+-- else
+-- return olddata, false
+-- end
+-- end
+--
+-- virtualcharacters[0x203E] = function(data) -- overbar
+-- local target = data.target
+-- local height = 0
+-- local depth = 0
+-- -- local mathparameters = target.mathparameters
+-- -- if mathparameters then
+-- -- height = mathparameters.OverbarVerticalGap
+-- -- depth = mathparameters.UnderbarVerticalGap
+-- -- else
+-- height = target.parameters.xheight/4
+-- depth = height
+-- -- end
+-- return accent_to_extensible(target,0x203E,data.original,0x0305,height,depth,nil,nil,0x203E)
+-- end
+--
+-- -- virtualcharacters[0xFE33E] = virtualcharacters[0x203E] -- convenient
+-- -- virtualcharacters[0xFE33F] = virtualcharacters[0x203E] -- convenient
+--
+-- virtualcharacters[0xFE33E] = function(data)
+-- local target = data.target
+-- local height = 0
+-- local depth = target.parameters.xheight/4
+-- return accent_to_extensible(target,0xFE33E,data.original,0x0305,height,depth,nil,nil,0x203E)
+-- end
+--
+-- virtualcharacters[0xFE33F] = function(data)
+-- local target = data.target
+-- local height = target.parameters.xheight/8
+-- local depth = height
+-- return accent_to_extensible(target,0xFE33F,data.original,0x0305,height,depth,nil,nil,0x203E)
+-- end
+--
+-- local function smashed(data,unicode,swap,private)
+-- local target = data.target
+-- local original = data.original
+-- local chardata = target.characters[unicode]
+-- if chardata and chardata.height > target.parameters.xheight then
+-- return accent_to_extensible(target,private,original,unicode,0,0,swap,nil,unicode)
+-- else
+-- return original.characters[unicode]
+-- end
+-- end
+--
+-- addextra(0xFE3DE) -- EXTENSIBLE OF 0x03DE : overbrace
+-- addextra(0xFE3DC) -- EXTENSIBLE OF 0x03DC : overparent
+-- addextra(0xFE3B4) -- EXTENSIBLE OF 0x03B4 : overbracket
+--
+-- virtualcharacters[0xFE3DE] = function(data) return smashed(data,0x23DE,0x23DF,0xFE3DE) end
+-- virtualcharacters[0xFE3DC] = function(data) return smashed(data,0x23DC,0x23DD,0xFE3DC) end
+-- virtualcharacters[0xFE3B4] = function(data) return smashed(data,0x23B4,0x23B5,0xFE3B4) end
+--
+-- addextra(0xFE3DF) -- EXTENSIBLE OF 0x03DF
+-- addextra(0xFE3DD) -- EXTENSIBLE OF 0x03DD
+-- addextra(0xFE3B5) -- EXTENSIBLE OF 0x03B5
+--
+-- virtualcharacters[0xFE3DF] = function(data) local c = data.target.characters[0x23DF] if c then c.unicode = 0x23DF return c end end
+-- virtualcharacters[0xFE3DD] = function(data) local c = data.target.characters[0x23DD] if c then c.unicode = 0x23DD return c end end
+-- virtualcharacters[0xFE3B5] = function(data) local c = data.target.characters[0x23B5] if c then c.unicode = 0x23B5 return c end end
+--
+-- -- todo: add some more .. numbers might change
+--
+-- addextra(0xFE302) -- EXTENSIBLE OF 0x0302
+-- addextra(0xFE303) -- EXTENSIBLE OF 0x0303
+--
+-- local function smashed(data,unicode,private)
+-- local target = data.target
+-- local height = target.parameters.xheight / 2
+-- local c, done = accent_to_extensible(target,private,data.original,unicode,height,0,nil,-height,unicode)
+-- if done then
+-- c.topanchor = nil -- or maybe also all the others
+-- end
+-- return c
+-- end
+--
+-- virtualcharacters[0xFE302] = function(data) return smashed(data,0x0302,0xFE302) end
+-- virtualcharacters[0xFE303] = function(data) return smashed(data,0x0303,0xFE303) end
+
+---------------------------------------------------------------------------------
+-- these are moved to math-act.lmt
+---------------------------------------------------------------------------------
+
+-- local function reference(index,char)
+-- if index then
+-- return slotcommand[index][char]
+-- else
+-- return charcommand[char]
+-- end
+-- end
+--
+-- local function raised(data,replacement,down)
+-- local character = data.scriptdata.characters[replacement]
+-- if character then
+-- local size = data.size
+-- return {
+-- width = character.width,
+-- height = character.height,
+-- depth = character.depth,
+-- commands = {
+-- down and downcommand[size/4] or upcommand[size/2],
+-- reference(data.scriptindex,replacement)
+-- }
+-- }
+-- end
+-- end
+--
+-- virtualcharacters[0x207A] = function(data) return raised(data,0x002B) end
+-- virtualcharacters[0x207B] = function(data) return raised(data,0x2212) end
+-- virtualcharacters[0x208A] = function(data) return raised(data,0x002B,true) end
+-- virtualcharacters[0x208B] = function(data) return raised(data,0x2212,true) end
+
+---------------------------------------------------------------------------------
+-- these are moved to math-act.lmt
+---------------------------------------------------------------------------------
+
+-- local function repeated(data,char,n,fraction)
+-- local character = data.characters[char]
+-- if character then
+-- local width = character.width
+-- local delta = width - character.italic -- width * fraction
+-- local c = charcommand[char]
+-- local r = rightcommand[right]
+-- local commands = { }
+-- for i=1,n-1 do
+-- width = width + delta
+-- commands[#commands+1] = c
+-- commands[#commands+1] = -delta
+-- end
+-- commands[#commands+1] = c
+-- return {
+-- width = width,
+-- height = character.height,
+-- depth = character.depth,
+-- commands = commands,
+-- }
+-- end
+-- end
+--
+-- virtualcharacters[0x222C] = function(data)
+-- return repeated(data,0x222B,2,1/8)
+-- end
+--
+-- virtualcharacters[0x222D] = function(data)
+-- return repeated(data,0x222B,3,1/8)
+-- end
+
+---------------------------------------------------------------------------------
+-- these are moved to math-act.lmt
+---------------------------------------------------------------------------------
+
+-- -- spacing (no need for a cache of widths)
+--
+-- local c_zero = byte('0')
+-- local c_period = byte('.')
+--
+-- local function spacefraction(data,fraction)
+-- local width = fraction * data.target.parameters.space
+-- return {
+-- width = width,
+-- -- commands = { rightcommand[width] }
+-- }
+-- end
+--
+-- local function charfraction(data,char)
+-- local width = data.target.characters[char].width
+-- return {
+-- width = width,
+-- -- commands = { rightcommand[width] }
+-- }
+-- end
+--
+-- local function quadfraction(data,fraction)
+-- local width = fraction * data.target.parameters.quad
+-- return {
+-- width = width,
+-- -- commands = { rightcommand[width] }
+-- }
+-- end
+--
+-- virtualcharacters[0x00A0] = function(data) return spacefraction(data,1) end -- nbsp
+-- virtualcharacters[0x2000] = function(data) return quadfraction (data,1/2) end -- enquad
+-- virtualcharacters[0x2001] = function(data) return quadfraction (data,1) end -- emquad
+-- virtualcharacters[0x2002] = function(data) return quadfraction (data,1/2) end -- enspace
+-- virtualcharacters[0x2003] = function(data) return quadfraction (data,1) end -- emspace
+-- virtualcharacters[0x2004] = function(data) return quadfraction (data,1/3) end -- threeperemspace
+-- virtualcharacters[0x2005] = function(data) return quadfraction (data,1/4) end -- fourperemspace
+-- virtualcharacters[0x2006] = function(data) return quadfraction (data,1/6) end -- sixperemspace
+-- virtualcharacters[0x2007] = function(data) return charfraction (data,c_zero) end -- figurespace
+-- virtualcharacters[0x2008] = function(data) return charfraction (data,c_period) end -- punctuationspace
+-- virtualcharacters[0x2009] = function(data) return quadfraction (data,1/8) end -- breakablethinspace
+-- virtualcharacters[0x200A] = function(data) return quadfraction (data,1/8) end -- hairspace
+-- virtualcharacters[0x200B] = function(data) return quadfraction (data,0) end -- zerowidthspace
+-- virtualcharacters[0x202F] = function(data) return quadfraction (data,1/8) end -- narrownobreakspace
+-- virtualcharacters[0x205F] = function(data) return spacefraction(data,1/2) end -- math thinspace
+
+-- -- another crazy hack .. doesn't work as we define scrscr first .. we now have smaller
+-- -- primes so we have smaller primes for the moment, big ones will become an option ..
+-- -- these primes in fonts are a real mess .. kind of a dead end, so don't wonder about
+-- -- the values below
+--
+-- local function smashed(data,unicode,optional)
+-- local oldchar = data.characters[unicode]
+-- if oldchar then
+-- local height = 0.85 * data.target.mathparameters.AccentBaseHeight
+-- local newchar = table.copy(oldchar)
+-- newchar.yoffset = height - oldchar.height
+-- newchar.height = height
+-- return newchar
+-- elseif not optional then
+-- report_fallbacks("missing %U prime in font %a",unicode,data.target.properties.fullname)
+-- end
+-- end
+--
+-- addextra(0xFE932) -- SMASHED PRIME 0x02032
+-- addextra(0xFE933) -- SMASHED PRIME 0x02033
+-- addextra(0xFE934) -- SMASHED PRIME 0x02034
+-- addextra(0xFE957) -- SMASHED PRIME 0x02057
+--
+-- addextra(0xFE935) -- SMASHED BACKWARD PRIME 0x02035
+-- addextra(0xFE936) -- SMASHED BACKWARD PRIME 0x02036
+-- addextra(0xFE937) -- SMASHED BACKWARD PRIME 0x02037
+--
+-- virtualcharacters[0xFE932] = function(data) return smashed(data,0x02032) end
+-- virtualcharacters[0xFE933] = function(data) return smashed(data,0x02033) end
+-- virtualcharacters[0xFE934] = function(data) return smashed(data,0x02034) end
+-- virtualcharacters[0xFE957] = function(data) return smashed(data,0x02057) end
+--
+-- virtualcharacters[0xFE935] = function(data) return smashed(data,0x02035,true) end
+-- virtualcharacters[0xFE936] = function(data) return smashed(data,0x02036,true) end
+-- virtualcharacters[0xFE937] = function(data) return smashed(data,0x02037,true) end
+--
+-- local hack = nil
+--
+-- function mathematics.getridofprime(target,original)
+-- local mathparameters = original.mathparameters
+-- if mathparameters and next(mathparameters) then
+-- local changed = original.changed
+-- if changed then
+-- hack = changed[0x02032]
+-- changed[0x02032] = nil
+-- changed[0x02033] = nil
+-- changed[0x02034] = nil
+-- changed[0x02057] = nil
+-- changed[0x02035] = nil
+-- changed[0x02036] = nil
+-- changed[0x02037] = nil
+-- end
+-- end
+-- end
+--
+-- function mathematics.setridofprime(target,original)
+-- local mathparameters = original.mathparameters
+-- if mathparameters and next(mathparameters) and original.changed then
+-- target.characters[0xFE931] = target.characters[hack or 0x2032]
+-- hack = nil
+-- end
+-- end
+--
+-- utilities.sequencers.appendaction("beforecopyingcharacters","system","mathematics.getridofprime")
+-- utilities.sequencers.appendaction("aftercopyingcharacters", "system","mathematics.setridofprime")
+
+-- local list = {
+-- { 0x02032, true },
+-- { 0x02033, true },
+-- { 0x02034, true },
+-- { 0x02057, true },
+-- { 0x02035, false },
+-- { 0x02036, false },
+-- { 0x02037, false },
+-- }
+--
+-- function mathematics.fixprimes(target,original)
+-- local mathparameters = original.mathparameters
+-- if mathparameters and next(mathparameters) then
+-- for i=1,#list do
+-- local entry = list[i]
+-- local char = original.characters[entry[1]]
+-- if char then
+-- local height = 0.85 * orginal.mathparameters.AccentBaseHeight
+-- char.yoffset = height - char.height
+-- char.height = height
+-- return char
+-- elseif entry[1] then
+-- report_fallbacks("missing %U prime in font %a",unicode,original.properties.fullname)
+-- end
+-- end
+-- end
+-- end
+--
+-- utilities.sequencers.appendaction("beforecopyingcharacters","system","mathematics.fixprimes")
+
+---------------------------------------------------------------------------------
+-- this one is not used
+---------------------------------------------------------------------------------
+
+-- addextra(0xFE941) -- EXTREMELY IDENTICAL TO
+--
+-- virtualcharacters[0xFE941] = function(data) -- this character is only needed for mathpairs
+-- local characters = data.target.characters
+-- local parameters = data.target.parameters
+-- local basechar = characters[0x003D]
+-- local width = basechar.width or 0
+-- local height = basechar.height or 0
+-- local depth = basechar.depth or 0
+-- return {
+-- unicode = 0xFE941,
+-- width = width,
+-- height = height, -- we cheat (no time now)
+-- depth = depth, -- we cheat (no time now)
+-- commands = {
+-- upcommand[height/2], -- sort of works
+-- charcommand[0x003D],
+-- leftcommand[width],
+-- downcommand[height], -- sort of works
+-- charcommand[0x003D],
+-- },
+-- }
+-- end
+
+---------------------------------------------------------------------------------
+-- these might move to math-act.lmt
+---------------------------------------------------------------------------------
+--
+-- actuarian (beware: xits has an ugly one)
+
+-- addextra(0xFE940) -- SMALL ANNUITY SYMBOL
+--
+-- local function actuarian(data)
+-- local characters = data.target.characters
+-- local parameters = data.target.parameters
+-- local basechar = characters[0x0078] -- x (0x0058 X) or 0x1D431
+-- local linewidth = parameters.xheight / 10
+-- local basewidth = basechar.width
+-- local baseheight = basechar.height
+-- return {
+-- -- todo: add alttext
+-- -- compromise: lm has large hooks e.g. \actuarial{a}
+-- width = basewidth + 4 * linewidth,
+-- height = basechar.height,
+-- depth = basechar.depth,
+-- unicode = 0x20E7,
+-- commands = {
+-- rightcommand[2 * linewidth],
+-- downcommand[- baseheight - 3 * linewidth],
+-- { "rule", linewidth, basewidth + 4 * linewidth },
+-- leftcommand[linewidth],
+-- downcommand[baseheight + 4 * linewidth],
+-- { "rule", baseheight + 5 * linewidth, linewidth },
+-- },
+-- }
+-- end
+--
+-- virtualcharacters[0x020E7] = actuarian -- checked
+-- -----------------[0xFE940] = actuarian -- unchecked
+
+-- local function equals(data,unicode,snippet,advance,n) -- mathpair needs them
+-- local characters = data.target.characters
+-- local parameters = data.target.parameters
+-- local basechar = characters[snippet]
+-- local width = n*basechar.width
+-- local advance = advance * parameters.quad -- for equals
+-- return {
+-- unicode = unicode,
+-- width = width - (n-1)*advance,
+-- height = basechar.height,
+-- depth = basechar.depth,
+-- commands = {
+-- charcommand[snippet],
+-- leftcommand[advance],
+-- charcommand[snippet],
+-- n > 2 and leftcommand[advance] or nil,
+-- n > 2 and charcommand[snippet] or nil,
+-- },
+-- }
+-- end
+--
+-- virtualcharacters[0x2A75] = function(data) return equals(data,0x2A75,0x003D, 1/5,2) end -- ==
+-- virtualcharacters[0x2A76] = function(data) return equals(data,0x2A76,0x003D, 1/5,3) end -- ===
+--
+-- local function bars(data,unicode,snippet,advance,n) -- mathpair needs them
+-- local characters = data.target.characters
+-- local parameters = data.target.parameters
+-- local basechar = characters[snippet]
+-- local width = n*basechar.width
+-- advance = advance * width
+-- return {
+-- unicode = unicode,
+-- width = width - (n-1)*advance,
+-- height = basechar.height,
+-- depth = basechar.depth,
+-- callback = "devirtualize",
+-- commands = {
+-- charcommand[snippet],
+-- leftcommand[advance],
+-- charcommand[snippet],
+-- n > 2 and leftcommand[advance] or nil,
+-- n > 2 and charcommand[snippet] or nil,
+-- },
+-- }
+-- end
+--
+-- virtualcharacters[0x2980] = function(data) return bars(data,0x2980,0x007C,1/10,3) end -- |||
+
+---------------------------------------------------------------------------------
+-- these might move to math-act.lmt -- lucida needs this -- no longer used
+---------------------------------------------------------------------------------
+
+-- virtualcharacters[0x305] = function(data)
+-- local target = data.target
+-- local height = target.parameters.xheight/8
+-- local width = target.parameters.emwidth/2
+-- local depth = height
+-- local used = 0.8 * width
+-- return {
+-- width = width,
+-- height = height,
+-- depth = depth,
+-- commands = { { "rule", height, width } },
+-- hparts = {
+-- {
+-- advance = width,
+-- ["end"] = used,
+-- glyph = 0x305,
+-- start = 0,
+-- },
+-- {
+-- advance = width,
+-- ["end"] = 0,
+-- extender = 1,
+-- glyph = 0x305,
+-- start = used,
+-- },
+-- }
+-- }
+-- end
+
+-- local function threedots(data,shift)
+-- local characters = data.target.characters
+-- local parameters = data.target.parameters
+-- local periodchar = characters[0x002E]
+-- local pluschar = characters[0x002B]
+-- local period = charcommand[0x002E]
+-- local periodwd = periodchar.width or 0
+-- local periodht = periodchar.height or 0
+-- local perioddp = periodchar.depth or 0
+-- local offset = 0
+-- if shift then
+-- local plusht = pluschar.height or 0
+-- local plusdp = pluschar.depth or 0
+-- local axis = (plusdp + plusht)//2 - plusdp
+-- offset = axis - periodht//2
+-- periodht = axis + periodht//2
+-- end
+-- return {
+-- width = 3*periodwd,
+-- height = periodht,
+-- depth = 0,
+-- commands = { upcommand[offset], period, period, period }
+-- }
+-- end
+--
+-- virtualcharacters[0x2026] = function(data) return threedots(data,false) end -- virtualforced[0x2026] = true
+-- virtualcharacters[0x22EF] = function(data) return threedots(data, true) end -- virtualforced[0x22EF] = true
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-fen.mkxl b/Master/texmf-dist/tex/context/base/mkxl/math-fen.mkxl
index 8aa0e62a8cb..1656f4b4a1c 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/math-fen.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-fen.mkxl
@@ -15,16 +15,6 @@
\unprotect
-% maybe always "method=auto" for:
-%
-% \switchtobodyfont[cambria]
-% \ruledhbox{$f(x)$}
-% \ruledhbox{\mathdelimitersmode6$f\left(x\right)$}
-% \ruledhbox{\mathdelimitersmode7$f\left(x\right)$}
-% \ruledhbox{$f\left(\frac{1}{x}\right)$}
-
-% todo: mathstyle
-
% \definemathfence [fancybracket] [bracket] [command=yes,color=blue]
%
% test $|x|$ test \par
@@ -54,12 +44,25 @@
\c!color=,
\c!command=,
\c!mathclass=,
+ \c!leftclass=\mathopencode,
+ \c!rightclass=\mathclosecode,
+ \c!middleclass=\mathmiddlecode,
+ \c!leftsource=\zerocount,
+ \c!middlesource=\zerocount,
+ \c!rightsource=\mathfenceparameter\c!source,
+ \c!source=\zerocount,
+ \c!height=\zeropoint,
+ \c!depth=\zeropoint,
+ \c!distance=\zerocount,
+ \c!topspace=\zeropoint,
+ \c!bottomspace=\zeropoint,
\c!factor=\v!auto]
\appendtoks
\edef\p_command{\mathfenceparameter\c!command}%
\ifx\p_command\v!yes
- \setuevalue\currentmathfence{\math_fenced_fenced[\currentmathfence]}%
+ % \instance
+ \protected\edefcsname\currentmathfence\endcsname{\math_fenced_fenced{\currentmathfence}}%
\fi
\to \everydefinemathfence
@@ -82,15 +85,31 @@
%D $ a + \fenced[bar] {\frac {b} {c}} + d $
%D \stoptyping
+% \startbuffer
+% $ \left( \frac{1}{x}^{2} \right)$
+% $ \left( x \right)$
+% $ \left( x^2 \right)$
+% $ \left( \frac{1}{x} \right)$
+% $ \left( \frac{1}{x}^2 \right)$
+% \stopbuffer
+%
+% \getbuffer\blank
+% {\setupmathfence[topspace=-2pt,bottomspace=-1pt]\getbuffer\blank}
+
+% todo : class -> number
+
\newconditional\c_math_fenced_mirror \settrue \c_math_fenced_mirror
\newconditional\c_math_fenced_sized \setfalse\c_math_fenced_sized
+\newinteger \c_math_fence_nesting
\installcorenamespace {mathfencesize}
-\setvalue{\??mathfencesize big}{1}
-\setvalue{\??mathfencesize Big}{2}
-\setvalue{\??mathfencesize bigg}{3}
-\setvalue{\??mathfencesize Bigg}{4}
+\defcsname\??mathfencesize big\endcsname{1}
+\defcsname\??mathfencesize Big\endcsname{2}
+\defcsname\??mathfencesize bigg\endcsname{3}
+\defcsname\??mathfencesize Bigg\endcsname{4}
+
+\let\math_fenced_trace\donothing
\def\math_fenced_force_size#1#2%
{\c_attr_mathsize\numexpr
@@ -98,119 +117,207 @@
+\ifcsname\??mathfencesize#2\endcsname\lastnamedcs\else#2\fi
\relax}
-\protected\def\math_fenced_inject#1#2#3#4%
- {\ifx#1\empty
- #2.%
+\def\math_fenced_common_factor_none
+ {\math_fenced_force_size\bigmathdelimitervariant\c_math_fence_nesting\relax
+ \Uvextensible
+ \s!axis
+ \s!exact}
+
+\def\math_fenced_common_factor_fixed
+ {\Uvextensible
+ \s!axis
+ \s!exact}
+
+\def\math_fenced_common_factor_unknown
+ {\scratchdimen\dimexpr\p_factor\bodyfontsize/2\relax
+ \Uvextensible
+ \s!height\scratchdimen
+ \s!depth\scratchdimen
+ \s!axis
+ \s!exact}
+
+\def\math_fenced_common_factor_force
+ {\Uvextensible
+ \s!height\mathfenceparameter\c!height
+ \s!depth\mathfenceparameter\c!depth
+ \s!axis
+ \s!exact}
+
+% \startTEXpage[offset=1dk]
+% \dm { \fenced[brace][middle="7C] { \frac{p}{q} \fence p,q \in \naturalnumbers} }\par
+% \dm { \fenced[brace][middle=`|] { \frac{p}{q} \fence p,q \in \naturalnumbers} }\par
+% \dm { \fenced[brace][middle=124] { \frac{p}{q} \fence p,q \in \naturalnumbers} }\par
+% \dm { \fenced[brace][middle=|] { \frac{p}{q} \fence p,q \in \naturalnumbers} }
+% \stopTEXpage
+
+\newconstant\c_math_fenced_class
+\newinteger \c_math_fence_check
+
+\protected\def\math_fenced_common#1#2#3#4% \Uwhatever class symbol source
+ {\c_math_fenced_class\math_class_by_parameter\mathfenceparameter#2%
+ \math_fenced_check_size_mismatch % we need to catch an unbalanced \F as we are sequential
+ \ifconditional\c_math_fenced_sized
+ \orelse\ifconditional\c_math_fenced_level_mode
+ \ifnum\c_math_fenced_class=\mathopencode
+ % \hpack{\infofont<L:\number\c_math_fenced_level:\number\c_attr_mathsize>}%
+ \integerdef\c_math_fenced_stack\c_attr_mathsize
+ \push_macro_c_math_fenced_stack
+ \orelse\ifnum\c_math_fenced_class=\mathclosecode
+ \pop_macro_c_math_fenced_stack
+ \c_attr_mathsize\c_math_fenced_stack
+ % \hpack{\infofont<R:\number\c_math_fenced_level:\number\c_attr_mathsize>}%
+ \fi
+ \fi
+ \edef\p_fence{#3}%
+ \ifempty\p_fence
+ \ifnum\c_math_fenced_class=\mathmiddlecode\else#1.\relax\fi
\else
+ \edef\p_factor {\mathfenceparameter\c!factor}%
+ \edef\p_size {\mathfenceparameter\c!size}%
\edef\p_mathclass{\mathfenceparameter\c!mathclass}%
- \ifconditional\c_math_fenced_sized
- \let\p_factor\v!fixed
- \else
- \edef\p_factor{\mathfenceparameter\c!factor}%
- \fi
- \ifempty\p_factor
- \ifempty\p_mathclass
- #2%
+ \ifnum\c_math_fenced_level>\zerocount
+ \math_fenced_common_factor_fixed
+ \orelse\ifconditional\c_math_fenced_sized
+ \math_fenced_common_factor_fixed
+ \orelse\ifempty\p_factor
+ \ifconditional\c_math_fenced_level_mode
+ \Uvextensible
\else
- #3%
- \s!class\p_mathclass
+ #1% \Uleft \Umiddle \Uleft
+ \ifx#1\Umiddle
+ nooverflow %
+ \fi
\fi
\orelse\ifx\p_factor\v!auto
- \ifempty\p_mathclass
- #2%
+ \ifconditional\c_math_fenced_level_mode
+ \Uvextensible
\else
- #3%
- \s!class\p_mathclass
+ #1% \Uleft \Umiddle \Uleft
+ \ifx#1\Umiddle
+ nooverflow %
+ \fi
\fi
\orelse\ifx\p_factor\v!none
- #3%
- \s!height\zeropoint % redundant with "exact"
- \s!depth\zeropoint % redundant with "exact"
- \ifempty\p_mathclass\else
- \s!class\p_mathclass
- \fi
- \s!axis
- \s!exact % new
- % #2%
+ \math_fenced_common_factor_none
+ \orelse\ifx\p_factor\v!fixed
+ \math_fenced_common_factor_fixed
+ \orelse\ifx\p_factor\v!force
+ \math_fenced_common_factor_force
\else
- %\scratchdimen\ifx\p_factor\v!fixed\scaledpoint\else\dimexpr\p_factor\bodyfontsize/2\relax\fi
- \scratchdimen\ifx\p_factor\v!fixed\zeropoint\else\dimexpr\p_factor\bodyfontsize/2\relax\fi
- #3%
- \s!height\scratchdimen
- \s!depth\scratchdimen
- \ifempty\p_mathclass\else
- \s!class\p_mathclass
- \fi
- \s!axis
- \s!exact
+ \math_fenced_common_factor_unknown
\fi
- \Udelimiter#4\fam#1\relax
- \fi}
-
-\permanent\def\math_fenced_left
- {\edef\p_left
- {\ifconditional\c_math_fenced_mirror
- \ifconditional\c_math_right_to_left
- \mathfenceparameter\c!right
+ \usedcolorparameterattributes{\mathfenceparameter\c!color}%
+ \s!class
+ \ifx\p_fence\v!none
+ \mathghostcode
+ \orelse\ifempty\p_mathclass
+ \c_math_fenced_class
\else
- \mathfenceparameter\c!left
+ \mathcodechecked\p_mathclass
\fi
- \else
- \mathfenceparameter\c!left
- \fi}%
- \math_fenced_color_push
- \math_fenced_inject\p_left\normalleft\Uleft\plusfour
- \math_fenced_color_pop}
-
-\permanent\def\math_fenced_middle
- {\edef\p_middle{\mathfenceparameter\c!middle}%
- \mskip\thinmuskip
- \math_fenced_color_push
- \math_fenced_inject\p_middle\normalmiddle\Umiddle\plusfour
- \math_fenced_color_pop
- \mskip\thinmuskip}
-
-\permanent\def\math_fenced_right
- {\edef\p_right
- {\ifconditional\c_math_fenced_mirror
- \ifconditional\c_math_right_to_left
- \mathfenceparameter\c!left
- \else
- \mathfenceparameter\c!right
- \fi
- \else
- \mathfenceparameter\c!right
- \fi}%
- \math_fenced_color_push
- \math_fenced_inject\p_right\normalright\Uright\plusfive
- \math_fenced_color_pop}
+ \s!source
+ \numexpr\namedboxanchor{\mathfenceparameter#4}\relax
+ %
+ \s!top \mathfenceparameter\c!topspace
+ \s!bottom \mathfenceparameter\c!bottomspace
+ %
+ \math_fenced_trace
+ \ifx\p_fence\v!none
+ \Udelimiter\mathghostcode\fam\zerocount
+ \orelse\ifchknum\p_fence\or
+ \Udelimiter\mathghostcode\fam\p_fence
+ \else
+ \p_fence
+ \fi
+ \fi
+ % we could use \s!attr \c_math_fenced_stack here
+ \ifconditional\c_math_fenced_sized
+ \orelse\ifcase\c_math_fenced_level
+ \c_attr_mathsize\attributeunsetvalue
+ \fi}
+
+\def\math_fenced_left
+ {\advanceby\c_math_fence_nesting\plusone
+ \math_fenced_common\Uleft\c!leftclass\math_fenced_p_left\c!leftsource}
-\def\math_fenced_color_do_push{\pushcolor[\p_math_fenced_color]}
-\let\math_fenced_color_do_pop \popcolor
+\def\math_fenced_right
+ {\math_fenced_common\Uright\c!rightclass\math_fenced_p_right\c!rightsource
+ \advanceby\c_math_fence_nesting\minusone}
-\let\math_fenced_color_push\donothing
-\let\math_fenced_color_pop \donothing
+\def\math_fenced_middle_normal
+ {\math_fenced_common\Umiddle\c!middleclass\math_fenced_p_middle\c!middlesource}
+
+\def\math_fenced_middle_sized
+ {\settrue\c_math_fenced_sized
+ \math_fenced_middle_normal
+ \setfalse\c_math_fenced_sized}
+
+\appendtoks
+ \let\math_fenced_middle\math_fenced_middle_normal
+ \enforced\let\fence\math_fenced_direct
+\to \everymathatom
+
+\let\math_fenced_middle\math_fenced_middle_normal
+
+\def\math_fenced_p_left
+ {\ifconditional\c_math_fenced_mirror
+ \ifconditional\c_math_right_to_left
+ \mathfenceparameter\c!right
+ \else
+ \mathfenceparameter\c!left
+ \fi
+ \else
+ \mathfenceparameter\c!left
+ \fi}
+
+\def\math_fenced_p_middle
+ {\mathfenceparameter\c!middle}%
+
+\def\math_fenced_p_right
+ {\ifconditional\c_math_fenced_mirror
+ \ifconditional\c_math_right_to_left
+ \mathfenceparameter\c!left
+ \else
+ \mathfenceparameter\c!right
+ \fi
+ \else
+ \mathfenceparameter\c!right
+ \fi}
\aliased\let\fence \relax
\aliased\let\fenced\relax
-\newcount\c_math_fenced_nesting
+\protected\def\math_fenced_middle_bar {\mfence |\relax}
+\protected\def\math_fenced_middle_colon{\mfence :\relax}
+\protected\def\math_fenced_middle_comma{\mathatom \s!leftclass \mathpunctuationcode \s!rightclass \mathmiddlecode {,}}
+
+\startsetups math:fence:set:bar
+ \aliased\let\suchthat\math_fenced_middle_bar
+ \aliased\let\where \math_fenced_middle_comma
+ \aliased\let\and \math_fenced_middle_comma
+\stopsetups
+
+\startsetups math:fence:set:colon
+ \aliased\let\suchthat\math_fenced_middle_colon
+ \aliased\let\where \math_fenced_middle_comma
+ \aliased\let\and \math_fenced_middle_comma
+\stopsetups
+
+\startsetups math:fence:set
+ \directsetup{math:fence:set:bar}
+\stopsetups
+
+\protected\def\math_fenced_middle_common
+ {\math_fenced_middle} % redefined inside atom
\protected\def\math_fenced_fenced_common
- {\startusemathstyleparameter\mathfenceparameter
- \enforced\let\fence\math_fenced_middle
- \edef\p_math_fenced_color{\mathfenceparameter\c!color}%
- \ifempty\p_math_fenced_color
- \let\math_fenced_color_push\donothing
- \let\math_fenced_color_pop \donothing
- \else
- \let\math_fenced_color_push\math_fenced_color_do_push
- \let\math_fenced_color_pop \math_fenced_color_do_pop
- \fi}
+ {\startusemathstyleparameter\mathfenceparameter\c!mathstyle
+ \usesetupsparameter\mathfenceparameter
+ \enforced\let\fence\math_fenced_middle_common}
\protected\def\math_fenced_fenced_start#1%
- {\advance\c_math_fenced_nesting\plusone
- \begingroup
+ {\begingroup
+ %{\beginmathgroup
\edef\currentmathfence{#1}%
\math_fenced_fenced_common
\math_fenced_left}
@@ -219,19 +326,85 @@
{\edef\currentmathfence{#1}%
\math_fenced_right
\stopusemathstyleparameter
- \endgroup
- \advance\c_math_fenced_nesting\minusone}
+ \endgroup}
+ %\endmathgroup}
-\tolerant\protected\def\math_fenced_fenced[#1]#*[#2]%
- {\advance\c_math_fenced_nesting\plusone
- \begingroup
- \edef\currentmathfence{#1}%
-% under test:
-\c_attr_mathsize\attributeunsetvalue
-\letmathfenceparameter\c!size\empty
-\letmathfenceparameter\c!factor\v!auto
-% so far
- \ifparameter#2\or\setupcurrentmathfence[#2]\fi
+\installlocalcurrenthandler \??mathfences {mathfence}
+
+%D The horizontal text variant was introduced for Alan Braslau. Because this is not
+%D used that often we only support double text arguments.
+%D
+%D Musical timestamp: I am The Moon by Tedeschi Trucks Band
+
+% \definemathfence [tupdownarrows] [text] [\c!left="2191,\c!right="2193]
+
+\protected\def\math_fenced_horizontal_common#1#2#3#4% \Uwhatever class symbol source
+ {\c_math_fenced_class\math_class_by_parameter\mathfenceparameter#2\relax
+ \edef\p_fence{#3}%
+ #1% \Uleft \Umiddle \Uleft
+ \usedcolorparameterattributes{\mathfenceparameter\c!color}%
+ \s!leftclass \mathunspacedcode
+ \s!rightclass \mathunspacedcode
+ \s!class \mathunspacedcode
+ \s!source \numexpr\namedboxanchor{\mathfenceparameter#4}\relax
+ \Udelimiter\mathghostcode\fam\p_fence}
+
+\tolerant\protected\def\math_fenced_horizontal#1#*[#2]#:#*#3#4%
+ {% \csname math\mathfenceparameter\c!mathclass\endcsname
+ \mathord \bgroup % class here
+ \setlocalmathfencecurrent{#1}% \edef\currentmathfence{#1}%
+ \setupcurrentmathfence[#2]%
+ % \usemathstyleparameter\mathfenceparameter\c!mathstyle
+ \setmathsmalltextbox\scratchboxone\hbox{\usemathfencestyleandcolor\c!leftstyle \c!leftcolor #3}%
+ \setmathsmalltextbox\scratchboxtwo\hbox{\usemathfencestyleandcolor\c!rightstyle\c!rightcolor#4}%
+ \let\math_fenced_common\math_fenced_horizontal_common
+ \edef\p_fenced_middle{\mathfenceparameter\c!middle}%
+ \ifempty\p_fenced_middle\else
+ \letmathfenceparameter\c!left \p_fenced_middle
+ \letmathfenceparameter\c!right\zerocount
+ \fi
+ \scratchdistance\mathfenceparameter\c!distance
+ \box\scratchboxone
+ \kern\scratchdistance
+ \math_fenced_fenced_start\currentmathfence
+ \math_fenced_fenced_stop \currentmathfence
+ \kern\scratchdistance
+ \box\scratchboxtwo
+ \egroup}
+
+\tolerant\protected\def\math_fenced_fenced#1%
+ {\ifcstok{\namedmathfenceparameter{#1}\c!text}\v!yes % not the best keyword
+ \expandafter\math_fenced_horizontal
+ \else
+ \expandafter\math_fenced_vertical
+ \fi{#1}}
+
+% two step because we don't want to define text itself as command
+
+\definemathfence
+ [\v!text]
+
+\setupmathfence
+ [\v!text]
+ [\c!text=\v!yes,
+ \c!command=\v!yes,
+ \c!distance=.125\emwidth]
+
+\tolerant\protected\def\math_fenced_vertical#1#*[#2]%
+ {\begingroup
+ %{\beginmathgroup
+ \setlocalmathfencecurrent{#1}% \edef\currentmathfence{#1}%
+ % under test:
+ \setfalse\c_math_fenced_level_mode
+ \c_attr_mathsize\attributeunsetvalue
+ %
+ \resetmathfenceparameter\c!size
+ \letmathfenceparameter\c!factor\v!auto
+ % so far
+ \ifparameter#2\or
+ \setupcurrentmathfence[#2]%
+ \bigmathdelimitervariant\mathfenceparameter\c!alternative\relax
+ \fi
\math_fenced_fenced_common
\edef\p_size{\mathfenceparameter\c!size}%
\ifempty\p_size
@@ -242,15 +415,19 @@
\protected\def\math_fenced_fenced_indeed_finish
{\stopusemathstyleparameter
- \endgroup
- \advance\c_math_fenced_nesting\minusone}
+ \endgroup}
+ %\endmathgroup}
\protected\def\math_fenced_fenced_indeed_fixed#1%
{\math_fenced_force_size\bigmathdelimitervariant\p_size
\settrue\c_math_fenced_sized
\math_fenced_left
\setfalse\c_math_fenced_sized
- #1%
+ \let\math_fenced_middle\math_fenced_middle_sized
+ % \enforced\let\middle\math_fenced_middle_sized
+\begingroup
+ #1% otherwise middle interferes
+\endgroup
\settrue\c_math_fenced_sized
\math_fenced_right
\setfalse\c_math_fenced_sized
@@ -264,17 +441,137 @@
\math_fenced_right
\math_fenced_fenced_indeed_finish}
+\protected\def\math_fenced_direct[#1]%
+ {\math_fenced_fenced{#1}}
+
\appendtoks
- \enforced\let\fenced\math_fenced_fenced
+ \enforced\let\fenced\math_fenced_direct
\to \everymathematics
-% todo: | in mathmode letter
+\permanent\tolerant\protected\def\startmathfenced[#1]#*[#2]%
+ {\begingroup
+ \def\currentmathfence{#1}%
+ \setupcurrentmathfence[#2]%
+ \math_fenced_fenced_start{#1}}
+
+\permanent\protected\def\stopmathfenced
+ {\math_fenced_fenced_stop\currentmathfence
+ \endgroup}
+
+\protected\def\math_fenced_start_wrap#1%
+ {\begingroup
+ \edef\m_math_fenced_wrap{#1}%
+ \ifempty\m_math_fenced_wrap \else
+ \math_fenced_fenced_start\m_math_fenced_wrap
+ \fi}
+
+\protected\def\math_fenced_stop_wrap
+ {\ifempty\m_math_fenced_wrap \else
+ \math_fenced_fenced_stop\m_math_fenced_wrap
+ \fi
+ \endgroup}
+
+% for torture testing mikael sundqvist:
+%
+% \setupmathfence[brace][middle=124]
%
+% \im{\fenced[brace] {\vec{x}\in\reals^3\middle\vert \vec{x}\neq \vec{0}}}
+% \im{\fenced[brace] {\vec{x}\in\reals^3\mid \vec{x}\neq \vec{0}}}
+% \im{\fenced[brace][size=0]{\vec{x}\in\reals^3\fence \vec{x}\neq \vec{0}}}
+
+\aliased\let\normalmid\mid
+
+\protected\def\mid{\ifcase\c_math_fence_nesting\normalmid\else\middle\vert\fi}
+
+% cases are defined in math-ali:
+
+\definemathfence [cases] [\c!left="007B,\c!right=\v!none]
+\definemathfence [sesac] [\c!left=\v!none,\c!right="007D]
+\definemathfence [tekcarb] [\c!left="005D,\c!right="005B] % used for xıɹʇÉɯ
+
+%D This is new:
+%D
+%D \starttyping
+%D $ \F0 \left( x + \F1 \left( x \right) + x \right) $
+%D $
+%D \F0 \left( x + \F1 \left( x + \F2 \left( x + \F3 \left( x + \F4 \left( x +
+%D 2
+%D + x \right) + x \right) + x \right) + x \right) + x \right)
+%D $
+%D $ \F1 \left( x + \F1 \left( x \right) + x \right) $
+%D $ \F3 \left( x + \F1 \left( x \right) + x \right) $
+%D $ \F1 \left( x + \F4 \left( x \right) + x \right) $
+%D $ \F4 \left( x + \F- \left( x \right) + x \right) $
+%D $ \F4
+%D \left( 1 +
+%D \F- \left( 2 +
+%D \F* \left( 3 +
+%D 4
+%D \right)
+%D + 5 +
+%D \F- \left( 6 +
+%D 7
+%D \right)
+%D \right)
+%D + 8
+%D \right)
+%D $
+%D \stoptyping
+%D
+%D \starttyping
+%D \startTEXpage[offset=1dk,width=20dk]
+%D \ruledhbox{$ \F3 \left( 1 + \F2 \left( a + b \right) + \left( a + b \right) \right) $}\par
+%D \ruledhbox{$ \left( 1 + \F3 \left( a + b \right) + \left( a + b \right) \right) $}\par
+%D \ruledhbox{$ \F3 \left( 1 + \F0 \left( a + b \right) \right) $}\par
+%D \ruledhbox{$ \F3 \left( 1 + \F= \left( a + b \right) \right) $}\par
+%D \ruledhbox{$ \F4 \left( 1 + \fenced[parenthesis]{a + b} \right) $}\par
+%D \ruledhbox{$ \F3 \left( 1 + \F- \left( a + b \right) \right) $}\par
+%D \ruledhbox{$ \left( \frac{1}{1+x} \right) $}\par
+%D \ruledhbox{$ \left( \frac{1}{1+x} \right) $}\par
+%D \stopTEXpage
+%D \stoptyping
+
+\newinteger \c_math_fenced_level
+\newconditional\c_math_fenced_level_mode
+
+\integerdef\c_math_fenced_stack \zerocount
+
+\installmacrostack \c_math_fenced_stack
+
+\installcorenamespace{fencelevels}
+\installcorenamespace{fencestack}
+
+\defcsname\??fencelevels+\endcsname{\advanceby\c_math_fenced_level\plusone }
+\defcsname\??fencelevels-\endcsname{\advanceby\c_math_fenced_level\minusone }
+\defcsname\??fencelevels=\endcsname {\c_math_fenced_level\zerocount}
+
+\letcsname\??fencelevels*\endcsname\donothing
+
+\def\math_fenced_check_size_mismatch
+ {\ifnum\c_math_fence_check=\c_math_fence_nesting
+ \c_attr_mathsize\attributeunsetvalue
+ \setfalse\c_math_fenced_level_mode
+ \c_math_fenced_level\zerocount
+ \fi}
+
+\permanent\protected\def\F#1%
+ {\ifconditional\c_math_fenced_level_mode\else
+ \c_math_fence_check\c_math_fence_nesting
+ \fi
+ \settrue\c_math_fenced_level_mode
+ \ifchknum#1\or
+ \c_math_fenced_level#1\relax
+ \orelse\ifcsname\??fencelevels#1\endcsname
+ \lastnamedcs
+ \else
+ \c_math_fenced_level\zerocount
+ \fi
+ \math_fenced_force_size\bigmathdelimitervariant\c_math_fenced_level\relax}
+
% \appendtoks
-% \let\bar\letterbar
+% \enforced\aliased\let|\letterbar
+% %\enforced\aliased\let\bar\letterbar
% \to \everymathematics
-%
-% but then we don't have it in embedded text too so ...
\definemathfence [parenthesis] [\c!left="0028,\c!right="0029]
\definemathfence [bracket] [\c!left="005B,\c!right="005D]
@@ -361,15 +658,15 @@
\definemathfence [leftopeninterval] [interval] [\c!left="2997,\c!right="2997]
\definemathfence [rightopeninterval] [interval] [\c!left="2998,\c!right="2998]
-\immutable\protected\def\Linterval {\math_fenced_fenced_start{interval}}
-\immutable\protected\def\Lointerval {\math_fenced_fenced_start{openinterval}}
-\immutable\protected\def\Llointerval {\math_fenced_fenced_start{leftopeninterval}}
-\immutable\protected\def\Lrointerval {\math_fenced_fenced_start{rightopeninterval}}
+\immutable\protected\def\Linterval {\math_fenced_fenced_start{interval}}
+\immutable\protected\def\Lointerval {\math_fenced_fenced_start{openinterval}}
+\immutable\protected\def\Llointerval {\math_fenced_fenced_start{leftopeninterval}}
+\immutable\protected\def\Lrointerval {\math_fenced_fenced_start{rightopeninterval}}
-\immutable\protected\def\Rinterval {\math_fenced_fenced_stop {interval}}
-\immutable\protected\def\Rointerval {\math_fenced_fenced_stop {openinterval}}
-\immutable\protected\def\Rlointerval {\math_fenced_fenced_stop {leftopeninterval}}
-\immutable\protected\def\Rrointerval {\math_fenced_fenced_stop {rightopeninterval}}
+\immutable\protected\def\Rinterval {\math_fenced_fenced_stop {interval}}
+\immutable\protected\def\Rointerval {\math_fenced_fenced_stop {openinterval}}
+\immutable\protected\def\Rlointerval {\math_fenced_fenced_stop {leftopeninterval}}
+\immutable\protected\def\Rrointerval {\math_fenced_fenced_stop {rightopeninterval}}
% \startformula
% \left{ \frac{1}{a} \right}
@@ -387,131 +684,167 @@
\pushoverloadmode
-\protected\def\left {\afterassignment\math_left \let\nexttoken}
-\protected\def\right {\afterassignment\math_right \let\nexttoken}
-\protected\def\middle{\afterassignment\math_middle\let\nexttoken}
+% \protected\def\left {\afterassignment\math_left \let\nexttoken}
+% \protected\def\right {\afterassignment\math_right \let\nexttoken}
+% \protected\def\middle{\afterassignment\math_middle\let\nexttoken}
-\popoverloadmode
-
-\let\leftorright\relax
-
-\newconditional\c_math_fenced_done
-\newconditional\c_math_fenced_unknown \settrue\c_math_fenced_unknown
-
-\permanent\protected\def\installmathfencepair#1#2#3#4%
- {\letcsname\??mathleft \normalmeaning#1\endcsname#2%
- \letcsname\??mathright\normalmeaning#3\endcsname#4}
+% \im { \left{ \frac{1}{2} \right} }
+% \im { \left\bgroup \frac{1}{2} \right\egroup }
+% \im { \left\{ \frac{1}{2} \right\} }
+% \im { \left\lbrace \frac{1}{2} \right\rbrace }
-\def\math_unknown_left {\setfalse\c_math_fenced_done\ifconditional\c_math_fenced_unknown\normalleft \nexttoken\fi}
-\def\math_unknown_right {\setfalse\c_math_fenced_done\ifconditional\c_math_fenced_unknown\normalright \nexttoken\fi}
-\def\math_unknown_middle{\setfalse\c_math_fenced_done\ifconditional\c_math_fenced_unknown\normalmiddle\nexttoken\fi}
+\def\math_fenced_x_left
+ {\advanceby\c_math_fence_nesting\plusone
+ \ifx\math_fenced_x_p_left\bgroup\let\math_fenced_x_p_left\letterleftbrace\fi
+ \math_fenced_common\Uleft\c!leftclass\math_fenced_x_p_left\c!leftsource}
-\letvalue{\??mathleft \s!unknown}\math_unknown_left
-\letvalue{\??mathright \s!unknown}\math_unknown_right
-\letvalue{\??mathmiddle\s!unknown}\math_unknown_middle
-
-\def\math_left
- {\settrue\c_math_fenced_done
- \ifcsname\??mathleft\normalmeaning\nexttoken\endcsname
- \expandafter\lastnamedcs
- \else
- \expandafter\math_unknown_left
- \fi}
-
-\def\math_right
- {\settrue\c_math_fenced_done
- \ifcsname\??mathright\normalmeaning\nexttoken\endcsname
- \expandafter\lastnamedcs
- \else
- \expandafter\math_unknown_right
- \fi}
+\def\math_fenced_x_right
+ {\ifx\math_fenced_x_p_right\egroup\let\math_fenced_x_p_right\letterrightbrace\fi
+ \math_fenced_common\Uright\c!rightclass\math_fenced_x_p_right\c!rightsource
+ \advanceby\c_math_fence_nesting\minusone}
-\def\math_middle
- {\settrue\c_math_fenced_done
- \ifcsname\??mathmiddle\normalmeaning\nexttoken\endcsname
- \expandafter\lastnamedcs
- \else
- \expandafter\math_unknown_middle
- \fi}
-
-\permanent\protected\def\lfence#1%
- {\settrue\c_math_fenced_done
- \let\nexttoken#1%
- \ifcsname\??mathleft\normalmeaning\nexttoken\endcsname
- \expandafter\lastnamedcs
- \else
- \expandafter\math_unknown_left
- \fi}
-
-\permanent\protected\def\rfence#1%
- {\settrue\c_math_fenced_done
- \let\nexttoken#1%
- \ifcsname\??mathright\normalmeaning\nexttoken\endcsname
- \expandafter\lastnamedcs
- \else
- \expandafter\math_unknown_right
- \fi}
-
-\permanent\protected\def\mfence#1%
- {\settrue\c_math_fenced_done
- \let\nexttoken#1%
- \ifcsname\??mathmiddle\normalmeaning\nexttoken\endcsname
- \expandafter\lastnamedcs
- \else
- \expandafter\math_unknown_middle
- \fi}
+\def\math_fenced_x_middle
+ {\math_fenced_common\Umiddle\c!middleclass\math_fenced_x_p_middle\c!middlesource}
-\normalexpanded{\installmathfencepair {|\detokenize {|}} \Ldoublebar {|\detokenize {|}} \Rdoublebar}
-\normalexpanded{\installmathfencepair {|\detokenize{||}} \Ltriplebar {|\detokenize{||}} \Rtriplebar}
+% the expandafter permits \left\Uchar...
-\installmathfencepair \bgroup \Lbrace \egroup \Rbrace
-\installmathfencepair \egroup \Rbracemirrored \bgroup \Lbracemirrored
+\protected\def\lfence{\afterassignment\math_fenced_x_left \expandafter\let\expandafter\math_fenced_x_p_left}
+\protected\def\rfence{\afterassignment\math_fenced_x_right \expandafter\let\expandafter\math_fenced_x_p_right}
+\protected\def\mfence{\afterassignment\math_fenced_x_middle\expandafter\let\expandafter\math_fenced_x_p_middle}
-\installmathfencepair \letteropenbrace \Lbrace \letterclosebrace \Rbrace % as we escape in mp textexts
+\aliased\let\left \lfence
+\aliased\let\right \rfence
+\aliased\let\middle\mfence
-\installmathfencepair . \Lnothing . \Rnothing
-\installmathfencepair . \Rnothingmirrored . \Lnothingmirrored
-
-\installmathfencepair [ \Lbracket ] \Rbracket
-\installmathfencepair ] \Rbracketmirrored [ \Lbracketmirrored
-
-\installmathfencepair ( \Lparenthesis ) \Rparenthesis
-\installmathfencepair ) \Rparenthesismirrored ( \Lparenthesismirrored
-
-\installmathfencepair < \Langle > \Rangle
-\installmathfencepair > \Ranglemirrored < \Langlemirrored
-
-\installmathfencepair / \Lsolidus / \Rsolidus
-%installmathfencepair / \Rsolidusmirrored / \Lsolidusmirrored
-
-\installmathfencepair | \Lbar | \Rbar
-%installmathfencepair | \Rbarmirrored | \Lbarmirrored
-
-\installmathfencepair ⌊ \Lfloor ⌋ \Rfloor
-\installmathfencepair ⌋ \Rfloormirrored ⌊ \Lfloormirrored
-\installmathfencepair ⌈ \Lceiling ⌉ \Rceiling
-\installmathfencepair ⌉ \Rceilingmirrored ⌈ \Lceilingmirrored
+\popoverloadmode
-\installmathfencepair ⟨ \Langle ⟩ \Rangle
-\installmathfencepair ⟩ \Ranglemirrored ⟨ \Langlemirrored
+% \let\leftorright\relax
-\installmathfencepair ⟪ \Ldoubleangle ⟫ \Rdoubleangle
-\installmathfencepair ⟫ \Rdoubleanglemirrored ⟪ \Ldoubleanglemirrored
+\newconditional\c_math_fenced_unknown \settrue\c_math_fenced_unknown
-\installmathfencepair ‖ \Ldoublebar ‖ \Rdoublebar
-%installmathfencepair ‖ \Rdoublebarmirrored ‖ \Ldoublebarmirrored
+% \permanent\protected\def\installmathfencepair#1#2#3#4%
+% {\letcsname\??mathleft \normalmeaningless#1\endcsname#2%
+% \letcsname\??mathright\normalmeaningless#3\endcsname#4}
-\installmathfencepair ⦀ \Ltriplebar ⦀ \Rtriplebar
-%installmathfencepair ⦀ \Rtriplebarmirrored ⦀ \Ltriplebarmirrored
+\permanent\protected\def\installmathfencepair#1#2#3#4%
+ {}
-% \installmathfencepair { \Lbrace } \Rbrace
-% \installmathfencepair } \Rbracemirrored { \Lbracemirrored
+% \def\math_unknown_left {\ifconditional\c_math_fenced_unknown\Uleft \nexttoken\fi}
+% \def\math_unknown_right {\ifconditional\c_math_fenced_unknown\Uright \nexttoken\fi}
+% \def\math_unknown_middle{\ifconditional\c_math_fenced_unknown\Umiddle nooverflow \nexttoken\fi}
-\installmathfencepair ⦗ \Linterval ⦘ \Rinterval
+% \def\math_unknown_left
+% {\let\math_fenced_p_left\nexttoken
+% \math_fenced_left}
+%
+% \def\math_unknown_right
+% {\let\math_fenced_p_right\nexttoken
+% \math_fenced_right}
+%
+% \def\math_unknown_middle
+% {\let\math_fenced_p_middle\nexttoken
+% \math_fenced_middle}
+%
+% \letcsname\??mathleft \s!unknown\endcsname\math_unknown_left
+% \letcsname\??mathright \s!unknown\endcsname\math_unknown_right
+% \letcsname\??mathmiddle\s!unknown\endcsname\math_unknown_middle
+%
+% \def\math_left
+% {\ifcsname\??mathleft\normalmeaningless\nexttoken\endcsname
+% \expandafter\lastnamedcs
+% \else
+% \expandafter\math_unknown_left
+% \fi}
+%
+% \def\math_right
+% {\ifcsname\??mathright\normalmeaningless\nexttoken\endcsname
+% \expandafter\lastnamedcs
+% \else
+% \expandafter\math_unknown_right
+% \fi}
+%
+% \def\math_middle
+% {\ifcsname\??mathmiddle\normalmeaningless\nexttoken\endcsname
+% \expandafter\lastnamedcs
+% \else
+% \expandafter\math_unknown_middle
+% \fi}
+%
+% \permanent\protected\def\lfence#1%
+% {\let\nexttoken#1%
+% \ifcsname\??mathleft\normalmeaningless\nexttoken\endcsname
+% \expandafter\lastnamedcs
+% \else
+% \expandafter\math_unknown_left
+% \fi}
+%
+% \permanent\protected\def\rfence#1%
+% {\let\nexttoken#1%
+% \ifcsname\??mathright\normalmeaningless\nexttoken\endcsname
+% \expandafter\lastnamedcs
+% \else
+% \expandafter\math_unknown_right
+% \fi}
+%
+% \permanent\protected\def\mfence#1%
+% {\let\nexttoken#1%
+% \ifcsname\??mathmiddle\normalmeaningless\nexttoken\endcsname
+% \expandafter\lastnamedcs
+% \else
+% \expandafter\math_unknown_middle
+% \fi}
+
+% \normalexpanded{\installmathfencepair {|\detokenize {|}} \Ldoublebar {|\detokenize {|}} \Rdoublebar}
+% \normalexpanded{\installmathfencepair {|\detokenize{||}} \Ltriplebar {|\detokenize{||}} \Rtriplebar}
+%
+% \installmathfencepair \bgroup \Lbrace \egroup \Rbrace
+% \installmathfencepair \egroup \Rbracemirrored \bgroup \Lbracemirrored
+%
+% \installmathfencepair \letteropenbrace \Lbrace \letterclosebrace \Rbrace % as we escape in mp textexts
+%
+% \installmathfencepair . \Lnothing . \Rnothing
+% \installmathfencepair . \Rnothingmirrored . \Lnothingmirrored
+%
+% \installmathfencepair [ \Lbracket ] \Rbracket
+% \installmathfencepair ] \Rbracketmirrored [ \Lbracketmirrored
+%
+% \installmathfencepair ( \Lparenthesis ) \Rparenthesis
+% \installmathfencepair ) \Rparenthesismirrored ( \Lparenthesismirrored
+%
+% \installmathfencepair < \Langle > \Rangle
+% \installmathfencepair > \Ranglemirrored < \Langlemirrored
+%
+% \installmathfencepair / \Lsolidus / \Rsolidus
+% %installmathfencepair / \Rsolidusmirrored / \Lsolidusmirrored
+%
+% \installmathfencepair | \Lbar | \Rbar
+% %installmathfencepair | \Rbarmirrored | \Lbarmirrored
+%
+% \installmathfencepair ⌊ \Lfloor ⌋ \Rfloor
+% \installmathfencepair ⌋ \Rfloormirrored ⌊ \Lfloormirrored
+% \installmathfencepair ⌈ \Lceiling ⌉ \Rceiling
+% \installmathfencepair ⌉ \Rceilingmirrored ⌈ \Lceilingmirrored
+%
+% \installmathfencepair ⟨ \Langle ⟩ \Rangle
+% \installmathfencepair ⟩ \Ranglemirrored ⟨ \Langlemirrored
+%
+% \installmathfencepair ⟪ \Ldoubleangle ⟫ \Rdoubleangle
+% \installmathfencepair ⟫ \Rdoubleanglemirrored ⟪ \Ldoubleanglemirrored
+%
+% \installmathfencepair ‖ \Ldoublebar ‖ \Rdoublebar
+% %installmathfencepair ‖ \Rdoublebarmirrored ‖ \Ldoublebarmirrored
+%
+% \installmathfencepair ⦀ \Ltriplebar ⦀ \Rtriplebar
+% %installmathfencepair ⦀ \Rtriplebarmirrored ⦀ \Ltriplebarmirrored
+%
+% % \installmathfencepair { \Lbrace } \Rbrace
+% % \installmathfencepair } \Rbracemirrored { \Lbracemirrored
+%
+% \installmathfencepair ⦗ \Linterval ⦘ \Rinterval
-\appendtoks
- \ignorediscretionaries % so $\mtext{a|b}$ works, this is ok because it's an \hbox
-\to \everymathematics
+% \appendtoks
+% \ignorediscretionaries % so $\mtext{a|b}$ works, this is ok because it's an \hbox
+% \to \everymathematics
% We unofficial support some synonyms as we need them for some fuzzy web related math.
@@ -537,33 +870,33 @@
\aliased\let\Lparen \Lparenthesis
\aliased\let\Rparen \Rparenthesis
-\installmathfencepair \lbrace \Lbrace \rbrace \Rbrace
-\installmathfencepair \lbracket \Lbracket \rbracket \Rbracket
-\installmathfencepair \lbrack \Lbracket \rbracket \Rbracket
-\installmathfencepair \lparenthesis \Lparenthesis \rparenthesis \Rparenthesis
-\installmathfencepair \lparent \Lparenthesis \rparent \Rparenthesis
-\installmathfencepair \lparen \Lparenthesis \rparen \Rparenthesis
-\installmathfencepair \langle \Langle \rangle \Rangle
-\installmathfencepair \llangle \Ldoubleangle \rrangle \Rdoubleangle
-%installmathfencepair \lbar \Lbar \rbar \Rbar
-\installmathfencepair \lVert \Ldoublebar \rVert \Rdoublebar
-\installmathfencepair \vert \Lbar \vert \Rbar
-\installmathfencepair \solidus \Lsolidus \solidus \Rsolidus
-\installmathfencepair \lfloor \Lfloor \rfloor \Rfloor
-\installmathfencepair \lceiling \Lceiling \rceiling \Rceiling
-\installmathfencepair \lceil \Lceiling \rceil \Rceiling
-
-\installmathfencepair \ulcorner \Luppercorner \urcorner \Ruppercorner
-\installmathfencepair \llcorner \Llowercorner \lrcorner \Rlowercorner
-\installmathfencepair \lmoustache \Lmoustache \rmoustache \Rmoustache
-\installmathfencepair \llbracket \Lopenbracket \rrbracket \Ropenbracket
-\installmathfencepair \lgroup \Lgroup \rgroup \Rgroup
-
-\installmathfencepair \linterval \Linterval \rinterval \Rinterval
-%installmathfencepair \linterv \Linterval \rinterv \Rinterval
-\installmathfencepair \lointerval \Linterval \rointerval \Rinterval
-\installmathfencepair \llointerval \Llointerval \rlointerval \Rlointerval
-\installmathfencepair \lrointerval \Lrointerval \rrointerval \Rrointerval
+% \installmathfencepair \lbrace \Lbrace \rbrace \Rbrace
+% \installmathfencepair \lbracket \Lbracket \rbracket \Rbracket
+% \installmathfencepair \lbrack \Lbracket \rbracket \Rbracket
+% \installmathfencepair \lparenthesis \Lparenthesis \rparenthesis \Rparenthesis
+% \installmathfencepair \lparent \Lparenthesis \rparent \Rparenthesis
+% \installmathfencepair \lparen \Lparenthesis \rparen \Rparenthesis
+% \installmathfencepair \langle \Langle \rangle \Rangle
+% \installmathfencepair \llangle \Ldoubleangle \rrangle \Rdoubleangle
+% %installmathfencepair \lbar \Lbar \rbar \Rbar
+% \installmathfencepair \lVert \Ldoublebar \rVert \Rdoublebar
+% \installmathfencepair \vert \Lbar \vert \Rbar
+% \installmathfencepair \solidus \Lsolidus \solidus \Rsolidus
+% \installmathfencepair \lfloor \Lfloor \rfloor \Rfloor
+% \installmathfencepair \lceiling \Lceiling \rceiling \Rceiling
+% \installmathfencepair \lceil \Lceiling \rceil \Rceiling
+
+% \installmathfencepair \ulcorner \Luppercorner \urcorner \Ruppercorner
+% \installmathfencepair \llcorner \Llowercorner \lrcorner \Rlowercorner
+% \installmathfencepair \lmoustache \Lmoustache \rmoustache \Rmoustache
+% \installmathfencepair \llbracket \Lopenbracket \rrbracket \Ropenbracket
+% \installmathfencepair \lgroup \Lgroup \rgroup \Rgroup
+
+% \installmathfencepair \linterval \Linterval \rinterval \Rinterval
+% %installmathfencepair \linterv \Linterval \rinterv \Rinterval
+% \installmathfencepair \lointerval \Linterval \rointerval \Rinterval
+% \installmathfencepair \llointerval \Llointerval \rlointerval \Rlointerval
+% \installmathfencepair \lrointerval \Lrointerval \rrointerval \Rrointerval
\aliased\let\textlbar\lbar \aliased\let\mathlbar\Lbar
\aliased\let\textrbar\lbar \aliased\let\mathrbar\Rbar
@@ -573,32 +906,37 @@
% \setupmathfences[color=darkgreen]
-\permanent\protected\def\{{\mathortext\lbrace \letterleftbrace } % or maybe a chardef
-\permanent\protected\def\}{\mathortext\rbrace \letterrightbrace } % or maybe a chardef
-\permanent\protected\def\[{\mathortext\lbracket \letterleftbracket } % or maybe a chardef
-\permanent\protected\def\]{\mathortext\rbracket \letterrightbracket } % or maybe a chardef
-\permanent\protected\def\({\mathortext\lparenthesis\letterleftparenthesis } % or maybe a chardef
-\permanent\protected\def\){\mathortext\rparenthesis\letterrightparenthesis} % or maybe a chardef
-\permanent\protected\def\|{\mathortext\vert \letterbar } % or maybe a chardef
-%permanent\protected\def\/{\mathortext\solidus \letterslash } % or maybe a chardef
-
-\installmathfencepair \{ \Lbrace \} \Rbrace
-\installmathfencepair \[ \Lbracket \] \Rbracket
-\installmathfencepair \( \Lparenthesis \) \Rparenthesis
-\installmathfencepair \< \Langle \> \Rangle
-\installmathfencepair \| \Lbar \| \Rbar
+% \permanent\protected\def\{{\mathortext\lbrace \letterleftbrace } % or maybe a chardef
+% \permanent\protected\def\}{\mathortext\rbrace \letterrightbrace } % or maybe a chardef
+% \permanent\protected\def\[{\mathortext\lbracket \letterleftbracket } % or maybe a chardef
+% \permanent\protected\def\]{\mathortext\rbracket \letterrightbracket } % or maybe a chardef
+% \permanent\protected\def\({\mathortext\lparenthesis\letterleftparenthesis } % or maybe a chardef
+% \permanent\protected\def\){\mathortext\rparenthesis\letterrightparenthesis} % or maybe a chardef
+% \permanent\protected\def\|{\mathortext\vert \letterbar } % or maybe a chardef
+% %permanent\protected\def\/{\mathortext\solidus \letterslash } % or maybe a chardef
+%
+% \installmathfencepair \{ \Lbrace \} \Rbrace
+% \installmathfencepair \[ \Lbracket \] \Rbracket
+% \installmathfencepair \( \Lparenthesis \) \Rparenthesis
+% \installmathfencepair \< \Langle \> \Rangle
+% \installmathfencepair \| \Lbar \| \Rbar
+
+% isn't that already the case .. still needed in lua mode ?
+
+\aliased\let\{\letterleftbrace
+\aliased\let\}\letterrightbrace
+\aliased\let\[\letterleftbracket
+\aliased\let\]\letterrightbracket
+\aliased\let\(\letterleftparenthesis
+\aliased\let\)\letterrightparenthesis
+\aliased\let\|\letterbar
+%aliased\let\/\letterslash % italic correction
\popoverloadmode
%D As we have overloaded \type {\left} and \type {\right} we also need a more
%D clever version of the following:
-% methods:
-%
-% 1: none
-% 2: lua
-% 3: tex
-
% variants:
%
% 1: step 1
@@ -606,85 +944,35 @@
% 3: htdp * 1.33^n
% 4: size * 1.33^n
-\setnewconstant\bigmathdelimitermethod \plustwo % \plusone
\setnewconstant\bigmathdelimitervariant\plusthree
\appendtoks
- \bigmathdelimitermethod \mathfenceparameter\c!method\relax
- \bigmathdelimitervariant\mathfenceparameter\c!alternative\relax
+ \bigmathdelimitervariant\mathfenceparameter\c!alternative\relax % controls lua
\to \everysetupmathfence
-\setupmathfence[\c!method=1,\c!alternative=2]
-
-% \protected\def\plainbigdelimiters % traditional method
-% {\bigmathdelimitermethod\plustwo}
-%
-% \plainbigdelimiters % is default for the moment but not so nice
+\setupmathfence[\c!alternative=5] % the rest will probably go
-\installcorenamespace{mathbig}
+\permanent\protected\def\choosemathbig
+ {\mathortext\math_choosemathbig_math\math_choosemathbig_text}
-\setvalue{\??mathbig1}{0.85}
-\setvalue{\??mathbig2}{1.15}
-\setvalue{\??mathbig3}{1.45}
-\setvalue{\??mathbig4}{1.75}
+\protected\def\math_choosemathbig_math#1#2% so we accept \big{||} as well
+ {\math_fenced_force_size\bigmathdelimitervariant{#1}\relax
+ \Uvextensible#2\relax
+ \c_attr_mathsize\attributeunsetvalue}
-\permanent\protected\def\choosemathbig#1#2% so we accept \big{||} as well
- {{\naturalhbox\bgroup
+\protected\def\math_choosemathbig_text#1#2% so we accept \big{||} as well
+ {\naturalhbox\bgroup
\startimath
- \ifcase\bigmathdelimitermethod
- \math_fenced_step#2\relax
- \or
- \math_fenced_force_size\bigmathdelimitervariant{#1}\relax
- \math_fenced_step#2\relax
- \else
- \math_fenced_step#2{\vpack to\csname\??mathbig#1\endcsname\bodyfontsize{}}%
- \fi
- \nulldelimiterspace\zeropoint\relax
+ \math_choosemathbig_math{#1}{#2}%
+ \nulldelimiterspace\zeropoint
\mathsurround\zeropoint
\stopimath
- \egroup}}
-
-% needs testing:
-%
-% \protected\def\choosemathbig#1#2% so we accept \big{||} as well
-% {{\naturalhbox\bgroup
-% \startimath
-% \ifcase\bigmathdelimitermethod
-% \Uvextensible#2\relax
-% \or
-% \math_fenced_force_size\bigmathdelimitervariant{#1}\relax
-% \Uvextensible#2\relax
-% \else
-% \scratchdimen.5\dimexpr\csname\??mathbig\number#1\endcsname\bodyfontsize+1.1\exheight\relax
-% \Uvextensible\s!axis \s!depth \scratchdimen \s!height \scratchdimen #2\relax
-% \fi
-% \nulldelimiterspace\zeropoint\relax
-% \mathsurround\zeropoint
-% \stopimath
-% \egroup}}
-
-\def\math_fenced_step#1#2%
- {\setfalse\c_math_fenced_unknown
- \setfalse\c_math_fenced_done
- \left#1\relax
- \ifconditional\c_math_fenced_done
- #2%
- \right.\relax
- \else
- \left.\relax
- #2%
- \setfalse\c_math_fenced_done
- \right#1\relax
- \ifconditional\c_math_fenced_done
- \else
- \right.\relax
- \fi
- \fi}
+ \egroup}
-\permanent\protected\def\mathdelimiterstep#1#2%
+\permanent\protected\def\mathdelimiterstep#1#2% not used, only in example
{\begingroup
\math_fenced_force_size\plusone{#1}%
- \math_fenced_step#2\relax
+ \Uvextensible#2\relax
\endgroup}
\definemathcommand [big] {\choosemathbig1}
@@ -692,18 +980,18 @@
\definemathcommand [bigg] {\choosemathbig3}
\definemathcommand [Bigg] {\choosemathbig4}
-\definemathcommand [bigl] [open] [one] {\big}
-\definemathcommand [bigm] [rel] [one] {\big}
-\definemathcommand [bigr] [close] [one] {\big}
-\definemathcommand [Bigl] [open] [one] {\Big}
-\definemathcommand [Bigm] [rel] [one] {\Big}
-\definemathcommand [Bigr] [close] [one] {\Big}
-\definemathcommand [biggl] [open] [one] {\bigg}
-\definemathcommand [biggm] [rel] [one] {\bigg}
-\definemathcommand [biggr] [close] [one] {\bigg}
-\definemathcommand [Biggl] [open] [one] {\Bigg}
-\definemathcommand [Biggm] [rel] [one] {\Bigg}
-\definemathcommand [Biggr] [close] [one] {\Bigg}
+\definemathcommand [bigl] [\s!open] [one] {\big}
+\definemathcommand [bigm] [\s!relation] [one] {\big} % why not just middle
+\definemathcommand [bigr] [\s!close] [one] {\big}
+\definemathcommand [Bigl] [\s!open] [one] {\Big}
+\definemathcommand [Bigm] [\s!relation] [one] {\Big}
+\definemathcommand [Bigr] [\s!close] [one] {\Big}
+\definemathcommand [biggl] [\s!open] [one] {\bigg}
+\definemathcommand [biggm] [\s!relation] [one] {\bigg}
+\definemathcommand [biggr] [\s!close] [one] {\bigg}
+\definemathcommand [Biggl] [\s!open] [one] {\Bigg}
+\definemathcommand [Biggm] [\s!relation] [one] {\Bigg}
+\definemathcommand [Biggr] [\s!close] [one] {\Bigg}
% \definemathfence [integral] [\c!left="222B]
%
@@ -718,11 +1006,6 @@
%definemathfence [fancybracket] [bracket] [command=yes,color=red]
-% experimental accents:
-%
-% \definemathoverextensible [top] [hoed] ["FE302]
-% \definemathoverextensible [top] [slang] ["FE303]
-
%D The nested fences recovery code is needed for mathml and the original
%D code can still be found in the mkiv file.
@@ -752,6 +1035,7 @@
\permanent\protected\def\enableautofences
{\clf_enableautofences
+ \setfalse\c_math_fences_auto
\glet\clf_enableautofences\relax % onlyonce anyway
\enforced\permanent\protected\gdef\enableautofences{\settrue\c_math_fences_auto}%
\enableautofences}
@@ -759,38 +1043,45 @@
\permanent\protected\def\disableautofences
{\setfalse\c_math_fences_auto}
-\protected\def\math_fences_used_left
+\permanent\protected\def\math_fences_used_left
{\ifconditional\c_math_fences_auto
\expandafter\math_fences_auto_left
\else
\expandafter\math_fences_normal_left
\fi}
-\protected\def\math_fences_used_right
+\permanent\protected\def\math_fences_used_right
{\ifconditional\c_math_fences_auto
\expandafter\math_fences_auto_right
\else
\expandafter\math_fences_normal_right
\fi}
-\protected\def\math_fences_used_middle
+\permanent\protected\def\math_fences_used_middle
{\ifconditional\c_math_fences_auto
\expandafter\math_fences_auto_middle
\else
\expandafter\math_fences_normal_middle
\fi}
-\protected\def\math_fences_used_both
+\permanent\protected\def\math_fences_used_both
{\ifconditional\c_math_fences_auto
\expandafter\math_fences_auto_both
\else
\expandafter\math_fences_normal_both
\fi}
-\permanent\let\left \math_fences_used_left
-\permanent\let\right \math_fences_used_right
-\permanent\let\middle \math_fences_used_middle
-\permanent\let\leftorright\math_fences_used_both
+\aliased\let\left \math_fences_used_left
+\aliased\let\right \math_fences_used_right
+\aliased\let\middle \math_fences_used_middle
+\aliased\let\leftorright\math_fences_used_both
+
+% \appendtoks
+% \enforced\let\left \math_fences_used_left
+% \enforced\let\right \math_fences_used_right
+% \enforced\let\middle \math_fences_used_middle
+% \enforced\let\leftorright\math_fences_used_both
+% \to \everymathematics
% wrappers
@@ -801,30 +1092,18 @@
\permanent\protected\def\stopcheckedfences
{\endgroup}
-% \appendtoks
- % maybe: safeguard against overloading
- %
- % \let\left \math_fences_used_left
- % \let\right \math_fences_used_right
- % \let\middle \math_fences_used_middle
- % \let\leftorright\math_fences_used_both
-% \to \everymathematics
-
\appendtoks
\ifempty\currentmathfence
- \doifelse{\mathfenceparameter\c!state}\v!auto\enableautofences\disableautofences
+ \ifcstok{\mathfenceparameter\c!state}\v!auto\enableautofences\else\disableautofences\fi
\fi
\to \everysetupmathfence
-\newconstant\c_math_fences_delimiters_mode \c_math_fences_delimiters_mode"16 % \numexpr"02+"04+"10\relax
-
-%permanent\protected\def\enableautofencemode {\mathdelimitersmode\plussix} % the shift (1) is too fragile
-\permanent\protected\def\enableautofencemode {\mathdelimitersmode\c_math_fences_delimiters_mode}
-\permanent\protected\def\disableautofencemode{\mathdelimitersmode\zerocount}
+\permanent\protected\def\enableautofencemode {\mathcheckfencesmode\plusone}
+\permanent\protected\def\disableautofencemode{\mathcheckfencesmode\zerocount}
\appendtoks
\ifempty\currentmathfence
- \doifelse{\mathfenceparameter\c!method}\v!auto\enableautofencemode\disableautofencemode
+ \ifcstok{\mathfenceparameter\c!method}\v!auto\enableautofencemode\else\disableautofencemode\fi
\fi
\to \everysetupmathfence
@@ -833,9 +1112,109 @@
%D The next characters were used for constructing nicer extensibles but
%D nowadays we have real characters.
-\immutable\Umathchardef\braceld\zerocount \defaultmathfamily "FF07A
-\immutable\Umathchardef\bracerd\zerocount \defaultmathfamily "FF07B
-\immutable\Umathchardef\bracelu\zerocount \defaultmathfamily "FF07C
-\immutable\Umathchardef\braceru\zerocount \defaultmathfamily "FF07D
+\immutable\Umathchardef\braceld\zerocount \zerocount "FF07A
+\immutable\Umathchardef\bracerd\zerocount \zerocount "FF07B
+\immutable\Umathchardef\bracelu\zerocount \zerocount "FF07C
+\immutable\Umathchardef\braceru\zerocount \zerocount "FF07D
+
+%D Some tracing:
+
+\definefont[mathindexfont][Mono sa .2]
+
+\def\math_fenced_trace_indeed
+ {%
+ \beginlocalcontrol
+ \registerboxanchor
+ \registeranchorbox
+ \registeredboxanchor
+ \plusone
+ \hbox
+ \s!anchors \boxanchorpresetcode{depth} \boxanchorpresetcode{height}
+ \s!yoffset -.1\exheight
+ \s!target \registeredboxanchor
+ \s!to \zeropoint
+ {\darkblue\hss\mathindexfont\ruledhbox{\number\c_math_fence_nesting}\hss}%
+ \endlocalcontrol
+ \s!source \registeredboxanchor
+ }
+
+% \def\math_fenced_trace_indeed
+% {%
+% \beginlocalcontrol
+% \registerboxanchor
+% \registeranchorbox
+% \registeredboxanchor
+% \plusone
+% \ruledhbox
+% \s!anchors \boxanchorpresetcode{depth} \boxanchorpresetcode{height}
+% \s!yoffset -.1\exheight
+% \s!target \registeredboxanchor
+% \s!to \zeropoint
+% {\darkblue\hss\mathindexfont\ruledhbox{\number\c_math_fence_nesting B}\hss}%
+% \registeranchorbox
+% \registeredboxanchor
+% \plusone
+% \ruledhbox
+% \s!anchors \boxanchorpresetcode{height} \boxanchorpresetcode{depth}
+% \s!yoffset .1\exheight
+% \s!target \registeredboxanchor
+% \s!to \zeropoint
+% {\darkgreen\hss\mathindexfont\ruledhbox{\number\c_math_fence_nesting T}\hss}%
+% \registeranchorbox
+% \registeredboxanchor
+% \plusone
+% \ruledhbox
+% \s!anchors \boxanchorpresetcode{left} \boxanchorpresetcode{right}
+% \s!xoffset -.1\emwidth
+% \s!target \registeredboxanchor
+% \s!to \zeropoint
+% {\darkred\hss\mathindexfont\ruledhbox{\number\c_math_fence_nesting L}}%
+% \registeranchorbox
+% \registeredboxanchor
+% \plusone
+% \ruledhbox
+% \s!anchors \boxanchorpresetcode{right} \boxanchorpresetcode{left}
+% \s!xoffset .1\emwidth
+% \s!target \registeredboxanchor
+% \s!to \zeropoint
+% {\darkyellow\mathindexfont\ruledhbox{\number\c_math_fence_nesting R}\hss}%
+% \endlocalcontrol
+% \s!source \registeredboxanchor
+% }
+
+\installtextracker
+ {math.fencenesting}
+ {\let\math_fenced_trace\math_fenced_trace_indeed}
+ {\let\math_fenced_trace\donothing}
+
+\appendtoks
+ \integerdef\c_math_fence_level\minusone
+ \c_math_fence_nesting\zerocount
+\to \everymathematics
+
+%D Experiment:
+
+\permanent\protected\def\autofences
+ {\setmathoptions\mathopencode\numexpression
+ \setmathoptions\mathopencode bor \autoinjectclassoptioncode
+ \relax
+ \setmathoptions\mathclosecode\numexpression
+ \setmathoptions\mathclosecode bor \autoinjectclassoptioncode
+ \relax
+ \setmathoptions\mathmiddlecode\numexpression
+ \setmathoptions\mathmiddlecode bor \autoinjectclassoptioncode
+ \relax}
+
+%D New (to be completed):
+
+% $x + \tupdownarrows{left}{right} + x$
+% $x + \tdownuparrows{left}{right} + x$
+% $x + \tupanddownarrows[color=red,leftcolor=green,rightcolor=blue]{left}{right} + x$
+
+\definemathfence [tupanddownarrows] [\v!text] [\c!left="2191,\c!right="2193]
+\definemathfence [tupdownarrows] [\v!text] [\c!left="21C5,\c!right=0]
+\definemathfence [tdownuparrows] [\v!text] [\c!middle="21F5]
+\definemathfence [tuparrow] [\v!text] [\c!middle="2191]
+\definemathfence [tdownarrow] [\v!text] [\c!middle="2193]
\protect
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-fnt.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-fnt.lmt
new file mode 100644
index 00000000000..911e0adb520
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-fnt.lmt
@@ -0,0 +1,151 @@
+if not modules then modules = { } end modules ['math-fnt'] = {
+ version = 1.001,
+ comment = "companion to math-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local round = math.round
+local setmetatableindex = table.setmetatableindex
+
+local nuts = nodes.nuts
+local tonut = nodes.tonut
+local tonode = nodes.tonode
+local nodepool = nuts.pool
+
+local vlist_code = nodes.nodecodes.vlist
+
+local new_hlist = nodepool.hlist
+local new_vlist = nodepool.vlist
+----- new_glyph = nodepool.glyph
+local new_glyph = nuts.newmathglyph
+
+local getattrlst = nuts.getattributelist
+local setattrlst = nuts.setattributelist
+local setwhd = nuts.setwhd
+local getwhd = nuts.getwhd
+local getid = nuts.getid
+
+local chardata = fonts.hashes.characters
+local addcharacters = font.addcharacters
+
+-- not yet ok for compact fonts .. needs checking .. or just make this non-compact only
+-- there's also an inaccuracy creeping in: \sqrt{\quad\blackrule[height=25pt,depth=25pt]}
+
+local cache = setmetatableindex(function(t,width)
+ local v = setmetatableindex(function(t,height)
+ local v = setmetatableindex(function(t,depth)
+ local v = setmetatableindex(function(t,font)
+ local v = setmetatableindex(function(t,char)
+ t[char] = v
+ return v
+ end)
+ t[font] = v
+ return v
+ end)
+ t[depth] = v
+ return v
+ end)
+ t[height] = v
+ return v
+ end)
+ t[width] = v
+ return v
+end)
+
+local function register_extensible(font,char,style,box)
+ -- We don't share (yet)!
+ local fontdata = chardata[font]
+ local oldchar = fontdata[char]
+ if oldchar and oldchar.keepvirtual then
+ -- for now, needed for iwona etc
+ return nil
+ else
+ local bx = tonut(box)
+ updaters.apply("tagging.state.disable") -- fast enough
+ nodes.handlers.finalizelist(bx)
+ updaters.apply("tagging.state.enable")
+ local id = getid(bx)
+ local al = getattrlst(bx)
+ local wd, ht, dp = getwhd(bx)
+ local unicode = oldchar.unicode or char
+ -- we cannot have self referencing t3 fonts
+ local oldcommands = oldchar.oldcommands
+ local newcommands = oldchar.commands
+ if oldcommands then
+ oldchar.commands = oldcommands
+ end
+ --
+ local p = fonts.hashes.parameters[font]
+ local sx = round(1000/p.extendfactor)
+ local sy = round(1000/p.squeezefactor)
+ -- we saved a scaled glyph stream so we now use an unscaled one ... horrible hack:
+ if sx ~= 1000 then
+ wd = wd * 7200/7227
+ end
+ if sy ~= 1000 then
+ ht = ht * 7200/7227
+ dp = dp * 7200/7227
+ end
+ --
+ -- local private = fonts.helpers.setboxdirectly(font,unicode,box)
+ local private = cache[wd][ht][dp][font][unicode]
+ if not private then
+ private = fonts.helpers.setboxdirectly(font,unicode,box)
+ cache[wd][ht][dp][font][unicode] = private
+ end
+ local glyph = new_glyph(font,private,al)
+ nuts.setscales(glyph,1000,sx,sy)
+ --
+ -- if fonts.hashes.properties[font].compactmath then
+ -- nuts.setscales(g,1000,1000,1000)
+ -- end
+ --
+ -- nasty, testcase: bold math sqrt extensible
+ --
+ local n = new_hlist(glyph)
+ --
+ if newcommands then
+ oldchar.commands = newcommands
+ end
+ --
+ -- local newchar = {
+ -- unicode = unicode,
+ -- width = wd,
+ -- height = ht,
+ -- depth = dp,
+ -- }
+ -- local p = oldchar.vparts
+ -- if p then
+ -- local first = fontdata[p[#p].glyph]
+ -- local last = fontdata[p[ 1].glyph]
+ -- if first then
+ -- newchar.topleft = first.topleft
+ -- newchar.topright = first.topright
+ -- end
+ -- if last then
+ -- newchar.bottomleft = last.bottomleft
+ -- newchar.bottomright = last.bottomright
+ -- end
+ -- end
+ -- addcharacters(font, { [private] = newchar })
+ -- so the dimensions of the box don't match the glyph scale!
+ setwhd(n,wd,ht,dp)
+ setattrlst(n,al)
+ if id == vlist_code then
+ n = new_vlist(n)
+ setwhd(n,wd,ht,dp)
+ setattrlst(n,al)
+ end
+ return tonode(n)
+ end
+end
+
+directives.register("math.extensibles", function(v)
+ callback.register("register_extensible", v and register_extensible or nil)
+end)
+
+-- Default per 2022-08-25
+
+callback.register("register_extensible", register_extensible)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-frc.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-frc.lmt
new file mode 100644
index 00000000000..c2ae2fbd5e4
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-frc.lmt
@@ -0,0 +1,74 @@
+if not modules then modules = { } end modules ['math-frc'] = {
+ version = 1.001,
+ comment = "companion to math-frc.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- obsolete
+--
+-- \def\math_frac_command_u
+-- {\clf_umathfraction % we can get this bakc to the tex end
+-- {\mathfractionparameter\c!rule}%
+-- \ifempty\p_math_fraction_fences
+-- \mathfractionparameter\c!left \space
+-- \mathfractionparameter\c!right\space
+-- \else
+-- \math_frac_no_delim\space
+-- \math_frac_no_delim\space
+-- \fi
+-- \dimexpr\mathfractionparameter\c!rulethickness\relax
+-- {\number\namedboxanchor{\mathfractionparameter\c!source}}%
+-- \relax}
+--
+-- local utfchar = utf.char
+--
+-- local context = context
+-- local variables = interfaces.variables
+--
+-- local v_no = variables.no
+-- local v_yes = variables.yes
+-- local v_hidden = variables.hidden
+--
+-- local resolved = {
+-- [0x007B] = "\\{",
+-- [0x007D] = "\\}",
+-- }
+--
+-- table.setmetatableindex(resolved, function(t,k)
+-- local v = utfchar(k)
+-- t[k] = v
+-- return v
+-- end)
+--
+-- local function umathfraction(how,left,right,width,source)
+-- source = tonumber(source) or 0
+-- if how == v_no then
+-- if left == 0x002E and right == 0x002E then
+-- context("\\Uatop source %i ",source)
+-- else
+-- context("\\Uatopwithdelims %s%s source %i ",resolved[left],resolved[right],source)
+-- end
+-- elseif how == v_yes or how == v_hidden then
+-- local norule = how == v_hidden and "norule" or ""
+-- if left == 0x002E and right == 0x002E then
+-- context("\\Uabove source %i %s %ssp",source,norule,width)
+-- else
+-- context("\\Uabovewithdelims %s%s source %i %s %ssp",resolved[left],resolved[right],source,norule,width)
+-- end
+-- else -- v_auto
+-- if left == 0x002E and right == 0x002E then
+-- context("\\Uover source %i ",source)
+-- else
+-- context("\\Uoverwithdelims %s%s source %i ",resolved[left],resolved[right],source)
+-- end
+-- end
+-- end
+--
+-- interfaces.implement {
+-- name = "umathfraction",
+-- actions = umathfraction,
+-- protected = true,
+-- arguments = { "string", "number", "number", "dimen", "string" }
+-- }
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-frc.mkxl b/Master/texmf-dist/tex/context/base/mkxl/math-frc.mkxl
index 8295195b5d6..47edc52c411 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/math-frc.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-frc.mkxl
@@ -11,31 +11,23 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+% todo : mathclass=\mathnothingcode, % todo also accept string
+
\writestatus{loading}{ConTeXt Math Macros / Fractions}
\unprotect
-%D I need to check it all again as there was a bug in luatex with dimensions that could
-%D resulted in side effects that made me mess with spacing.
-
-\permanent\protected\def\topstrut{\vrule\s!width\zeropoint\s!height\strutht\s!depth\zeropoint\relax}
-\permanent\protected\def\botstrut{\vrule\s!width\zeropoint\s!height\zeropoint\s!depth\strutdp\relax}
-
-\permanent\protected\def\mathtopstrut{\setbox\scratchbox\mathstylehbox{(}\vrule\s!width\zeropoint\s!height\ht\scratchbox\s!depth\zeropoint\relax}
-\permanent\protected\def\mathbotstrut{\setbox\scratchbox\mathstylehbox{(}\vrule\s!width\zeropoint\s!height\zeropoint\s!depth\dp\scratchbox\relax}
-
%D This module is reimplemented in \MKIV\ style.
-\registerctxluafile{math-frc}{}
+\registerctxluafile{math-frc}{autosuffix}
%D \macros
%D {frac, xfrac, xxfrac}
%D
-%D This is another one Tobias asked for. It replaces the primitive \type
-%D {\over}. We also take the opportunity to handle math style restoring,
-%D which makes sure units and chemicals come out ok. The \type {\frac}
-%D macro kind of replaces the awkward \type {\over} primitive. Say that
-%D we have the following formulas:
+%D This is another one Tobias asked for. It replaces the primitive \type {\over}. We
+%D also take the opportunity to handle math style restoring, which makes sure units
+%D and chemicals come out ok. The \type {\frac} macro kind of replaces the awkward
+%D \type {\over} primitive. Say that we have the following formulas:
%D
%D \startbuffer[sample]
%D test $\frac {1}{2}$ test $$1 + \frac {1}{2} = 1.5$$
@@ -78,23 +70,8 @@
%D So we stick to the next definitions (watch the local overloading of
%D \type {\xfrac}).
%D
-%D In the meantime, in \LUATEX, we have better control over styles so the
-%D following macros are different from the \MKII\ ones.
-
-% obsolete, is now c!mathstyle
-%
-% 0=auto, 1=displaystyle, 2=textstyle, 3=scriptstyle, 4=scriptscriptstyle, 5=mathstyle
-%
-% $\mathfracmode0 \frac{1}{2}$
-% $\mathfracmode1 \frac{1}{2}$
-% $\mathfracmode2 \frac{1}{2}$
-% $\mathfracmode3 \frac{1}{2}$
-% $\mathfracmode4 \frac{1}{2}$
-% $\mathfracmode5 \frac{1}{2}$
-%
-% we keep the constant for a while
-
-\setnewconstant\mathfracmode\zerocount
+%D In the meantime, in \LUATEX, we have better control over styles so the following
+%D macros are different from the \MKII\ ones.
\installcorenamespace{mathfractions}
\installcorenamespace{mathfractionstyle}
@@ -108,14 +85,23 @@
\setupmathfractions
[\c!mathstyle=,
+ \c!method=\v!vertical,
+ \c!mathnumeratorstyle=\mathfractionparameter\c!mathstyle,
+ \c!mathdenominatorstyle=\mathfractionparameter\c!mathstyle,
+ \c!mathclass=\mathfractioncode,
\c!alternative=\v!inner,
\c!margin=\zeropoint,
- \c!rulethickness=.25\exheight,
- \c!left=0x2E,
- \c!right=0x2E,
+ % \c!rulethickness=.1\exheight, % was .25 for above / atop
+ \c!rulethickness=\v!font,
+ \c!left="2E,
+ \c!right="2E,
+ \c!middle="2F,
\c!strut=\v!yes,
\c!topdistance=,
\c!bottomdistance=,
+ \c!source=\zerocount,
+ \c!hfactor=\plusthousand,
+ \c!vfactor=\plusthousand,
\c!rule=\v!auto]
\appendtoks
@@ -130,7 +116,7 @@
\math_fraction_set_distance
\to \everymathematics
-% why only displaystyle .. a bit weak
+% why only displaystyle .. a bit weak .. will become a set
\protected\def\math_fraction_set_distance_top
{\Umathfractionnumup \displaystyle\m_math_fraction_distance_top
@@ -167,42 +153,72 @@
% So far for control.
+% no : \ruledhbox{\m{\frac[strut=no] {28}{8\times29}}} \par
+% tight : \ruledhbox{\m{\frac[strut=tight]{28}{8\times29}}} \par
+% yes : \ruledhbox{\m{\frac[strut=yes] {28}{8\times29}}} \par
+% math : \ruledhbox{\m{\frac[strut=math] {28}{8\times29}}} \par
+% text : \ruledhbox{\m{\frac[strut=text] {28}{8\times29}}} \par
+
\installcorenamespace{mathfractionstrut}
\def\math_frac_no_strut
{\enforced\let\m_fractions_strut_top\relax
\enforced\let\m_fractions_strut_bot\relax}
-\setvalue{\??mathfractionstrut\v!yes}%
+\defcsname\??mathfractionstrut\v!yes\endcsname
{\enforced\let\m_fractions_strut_top\mathstrut
\enforced\let\m_fractions_strut_bot\mathstrut}
-\setvalue{\??mathfractionstrut\v!math}%
+\defcsname\??mathfractionstrut\v!math\endcsname
{\enforced\let\m_fractions_strut_top\mathstrut
\enforced\let\m_fractions_strut_bot\mathstrut}
-\letvalue{\??mathfractionstrut\v!no}\math_frac_no_strut
+\letcsname\??mathfractionstrut\v!no\endcsname\math_frac_no_strut
-\setvalue{\??mathfractionstrut\v!tight}%
- {\enforced\let\m_fractions_strut_top\mathbotstrut % indeed swapped name
- \enforced\let\m_fractions_strut_bot\mathtopstrut} % indeed swapped name
+\defcsname\??mathfractionstrut\v!tight\endcsname
+ {\enforced\let\m_fractions_strut_top\mathdepthstrut
+ \enforced\let\m_fractions_strut_bot\mathheightstrut}
+
+\defcsname\??mathfractionstrut\v!text\endcsname
+ {\enforced\let\m_fractions_strut_top\strut
+ \enforced\let\m_fractions_strut_bot\strut}
\math_frac_no_strut
-\newdimen\d_math_fraction_margin
+\newdimension\d_math_fraction_margin
+
+\def\math_fraction_margin_kern_indeed{\kern\d_math_fraction_margin}
+
+\let\math_fraction_margin_kern\relax
-\protected\def\math_frac#1%
- {\begingroup
- \edef\currentmathfraction{#1}%
+%D \starttyping
+%D $\Uover{2}{3} ^4$ % double script error but no longer because we use the prescripts
+%D ${\over{2}{3}}^4$ % no issue anyway because we wrap in {} (goes unnoticed)
+%D $\frac {2}{3} ^4$ % we wrap in \mathfrac so we can also use prescripts
+%D \stoptyping
+
+\installlocalcurrenthandler\??mathfractions {mathfraction}
+
+\tolerant\protected\def\math_frac#1#*[#2]%%
+ {\beginmathgroup
+ %
+ \setlocalmathfractioncurrent{#1}% \edef\currentmathfraction{#1}%
+ %
+ \ifparameter#2\or\setupcurrentmathfraction[#2]\fi
%
\edef\p_math_fraction_fences{\mathfractionparameter\c!fences}%
+ %
+ \math_atom_by_parameter\mathfractionparameter\bgroup
\ifempty\p_math_fraction_fences \else
\math_fenced_fenced_start\p_math_fraction_fences
\fi
%
- \d_math_fraction_margin\mathfractionparameter\c!margin
- %
- \edef\p_math_fractions_color{\mathfractionparameter\c!color}%
+ \d_math_fraction_margin\mathfractionparameter\c!margin\relax
+ \ifcase\d_math_fraction_margin
+ \let\math_fraction_margin_kern\relax
+ \else
+ \let\math_fraction_margin_kern\math_fraction_margin_kern_indeed
+ \fi
%
\edef\p_math_fractions_strut{\mathfractionparameter\c!strut}%
\ifcsname\??mathfractionstrut\p_math_fractions_strut\endcsname
@@ -211,231 +227,175 @@
\math_frac_no_strut
\fi
%
- \ifempty\p_math_fractions_color
- \expandafter\math_frac_normal
- \else
- \expandafter\math_frac_colored
- \fi}
+ \expandnamespaceparameter\??mathfractionalternative\mathfractionparameter\c!alternative\v!inner}
\protected\def\math_frac_wrapup
{\ifempty\p_math_fraction_fences \else
\math_fenced_fenced_stop\p_math_fraction_fences
\fi
- \endgroup}
-
-\protected\def\math_frac_colored#1#2%
- {\savecolor
- \colo_helpers_activate\p_math_fractions_color
- \math_frac_normal{\restorecolor#1}{\restorecolor#2}}
-
-\protected\def\math_frac_normal
- {\expandnamespaceparameter\??mathfractionalternative\mathfractionparameter\c!alternative\v!inner}
-
-% we use utfchar anyway so we can as well do all at the lua end
-
-\def\math_frac_no_delim{0x2E}
-
-\def\math_frac_command
- {\clf_mathfraction
- {\mathfractionparameter\c!rule}%
- \ifempty\p_math_fraction_fences
- \mathfractionparameter\c!left \space
- \mathfractionparameter\c!right\space
- \else
- \math_frac_no_delim\space
- \math_frac_no_delim\space
- \fi
- \dimexpr\mathfractionparameter\c!rulethickness\relax
- \relax}
+ \egroup
+ \endmathgroup}
+
+\integerdef\math_frac_no_delim "2E % or just \zerocount
% Having a \withmarginornot{#1}{#2} makes not much sense nor do 4 tests or 4 redundant
% kerns (longer node lists plus possible interference). A split in normal and margin
% also makes testing easier. When left and right margins are needed we might merge the
% variants again. After all, these are not real installers.
-
-% the denominator is in cramped!
-
-\setvalue{\??mathfractionalternative\v!inner}%
- {\ifcase\d_math_fraction_margin
- \expandafter\math_fraction_inner_normal
- \else
- \expandafter\math_fraction_inner_margin
- \fi}
-
-\setvalue{\??mathfractionalternative\v!outer}%
- {\ifcase\d_math_fraction_margin
- \expandafter\math_fraction_outer_normal
- \else
- \expandafter\math_fraction_outer_margin
- \fi}
-
-\setvalue{\??mathfractionalternative\v!both}%
- {\ifcase\d_math_fraction_margin
- \expandafter\math_fraction_both_normal
- \else
- \expandafter\math_fraction_both_margin
- \fi}
-
-% todo: store first state and reuse second time
-
-% \def\math_fraction_inner_normal#1#2%
-% {\Ustack{%
-% {%
-% {\usemathstyleparameter\mathfractionparameter{\m_fractions_strut_top#1}}%
-% \math_frac_command
-% {\usemathstyleparameter\mathfractionparameter{\m_fractions_strut_bot#2}}%
-% }%
-% }%
-% \math_frac_wrapup}
-%
-% \def\math_fraction_outer_normal#1#2%
-% {\Ustack{%
-% \usemathstyleparameter\mathfractionparameter
-% {%
-% {\m_fractions_strut_top#1}%
-% \math_frac_command
-% {\m_fractions_strut_bot#2}%
-% }%
-% }%
-% \math_frac_wrapup}
-%
-% \def\math_fraction_both_normal#1#2%
-% {\Ustack{%
-% \usemathstyleparameter\mathfractionparameter
-% {%
-% {\usemathstyleparameter\mathfractionparameter\m_fractions_strut_top#1}%
-% \math_frac_command
-% {\usemathstyleparameter\mathfractionparameter\m_fractions_strut_bot#2}%
-% }%
-% }%
-% \math_frac_wrapup}
%
-% \def\math_fraction_inner_margin#1#2%
-% {\Ustack{%
-% {%
-% {\kern\d_math_fraction_margin
-% \usemathstyleparameter\mathfractionparameter{\m_fractions_strut_top#1}%
-% \kern\d_math_fraction_margin}%
-% \math_frac_command
-% {\kern\d_math_fraction_margin
-% \usemathstyleparameter\mathfractionparameter{\m_fractions_strut_bot#2}%
-% \kern\d_math_fraction_margin}%
-% }%
-% }%
-% \math_frac_wrapup}
+% The denominator is normally in cramped mode!
%
-% \def\math_fraction_outer_margin#1#2%
-% {\Ustack{%
-% \usemathstyleparameter\mathfractionparameter
-% {%
-% {\kern\d_math_fraction_margin
-% \m_fractions_strut_top#1%
-% \kern\d_math_fraction_margin}%
-% \math_frac_command
-% {\kern\d_math_fraction_margin
-% \m_fractions_strut_bot#2%
-% \kern\d_math_fraction_margin}%
-% }%
-% }%
-% \math_frac_wrapup}
-%
-% \def\math_fraction_both_margin#1#2%
-% {\Ustack{%
-% \usemathstyleparameter\mathfractionparameter
-% {%
-% {\kern\d_math_fraction_margin
-% \usemathstyleparameter\mathfractionparameter\m_fractions_strut_top#1%
-% \kern\d_math_fraction_margin}%
-% \math_frac_command
-% {\kern\d_math_fraction_margin
-% \usemathstyleparameter\mathfractionparameter\m_fractions_strut_bot#2%
-% \kern\d_math_fraction_margin}%
-% }%
-% }%
-% \math_frac_wrapup}
+% See \MKIV\ for the old (more messy) implementation where we have to fight the over
+% related syntax (we now use a lmtx primitive).
+
+% timestamp: 01/2022 : (re)watching eNerdâ´ - Time Capsule 2020 a.k.a. Farewell Party
+% for Normalcy (UHD) with the soekris/neumanns combination
+
+\installcorenamespace{fractionmethods}
+
+\defcsname\??fractionmethods\v!vertical \v!no \v!none\endcsname{\Uatop}
+\defcsname\??fractionmethods\v!vertical \v!no \endcsname{\Uatopwithdelims
+ \Udelimiter\zerocount\fam\scratchcounterone
+ \Udelimiter\zerocount\fam\scratchcountertwo}
+\defcsname\??fractionmethods\v!vertical \v!yes \v!none\endcsname{\Uabove}
+\defcsname\??fractionmethods\v!vertical \v!yes \endcsname{\Uabovewithdelims
+ \Udelimiter\zerocount\fam\scratchcounterone
+ \Udelimiter\zerocount\fam\scratchcountertwo}
+\defcsname\??fractionmethods\v!vertical \v!hidden \v!none\endcsname{\Uabove}
+\defcsname\??fractionmethods\v!vertical \v!hidden \endcsname{\Uabovewithdelims
+ \Udelimiter\zerocount\fam\scratchcounterone
+ \Udelimiter\zerocount\fam\scratchcountertwo}
+\defcsname\??fractionmethods\v!vertical \v!auto \v!none\endcsname{\Uover}
+\defcsname\??fractionmethods\v!vertical \v!auto \endcsname{\Uoverwithdelims
+ \Udelimiter\zerocount\fam\scratchcounterone
+ \Udelimiter\zerocount\fam\scratchcountertwo}
+\defcsname\??fractionmethods\v!vertical \v!symbol \v!none\endcsname{\Ustretched
+ \Udelimiter\zerocount\fam\scratchcounterthree}
+\defcsname\??fractionmethods\v!vertical \v!symbol \endcsname{\Ustretchedwithdelims
+ \Udelimiter\zerocount\fam\scratchcounterone
+ \Udelimiter\zerocount\fam\scratchcountertwo
+ \Udelimiter\zerocount\fam\scratchcounterthree}
+\defcsname\??fractionmethods\v!horizontal \v!none\endcsname{\Uskewed
+ \Udelimiter\zerocount\fam\scratchcounterthree
+ \s!hfactor \numexpr\mathfractionparameter\c!hfactor\relax}
+\defcsname\??fractionmethods\v!horizontal \endcsname{\Uskewedwithdelims
+ \Udelimiter\zerocount\fam\scratchcounterone
+ \Udelimiter\zerocount\fam\scratchcountertwo
+ \Udelimiter\zerocount\fam\scratchcounterthree
+ \s!hfactor \numexpr\mathfractionparameter\c!hfactor\relax}
+\defcsname\??fractionmethods\v!line \v!none\endcsname{\Uskewed
+ \Udelimiter\zerocount\fam\scratchcounterthree
+ \s!noaxis \space
+ \s!hfactor \numexpr\mathfractionparameter\c!hfactor\relax}
+\defcsname\??fractionmethods\v!line \endcsname{\Uskewedwithdelims
+ \Udelimiter\zerocount\fam\scratchcounterone
+ \Udelimiter\zerocount\fam\scratchcountertwo
+ \Udelimiter\zerocount\fam\scratchcounterthree
+ \s!noaxis \space
+ \s!hfactor \numexpr\mathfractionparameter\c!hfactor\relax}
+
+\setupmathfractions % we now inherit !
+ [\c!topcolor=\mathfractionparameter\c!color,
+ \c!bottomcolor=\mathfractionparameter\c!color,
+ \c!rulecolor=\mathfractionparameter\c!color]
\def\math_frac_command_u
- {\clf_umathfraction
- {\mathfractionparameter\c!rule}%
- \ifempty\p_math_fraction_fences
- \mathfractionparameter\c!left \space
- \mathfractionparameter\c!right\space
- \else
- \math_frac_no_delim\space
- \math_frac_no_delim\space
- \fi
- \dimexpr\mathfractionparameter\c!rulethickness\relax
- \relax}
-
-\def\math_fraction_inner_normal#1#2%
- {\Ustack{% forces num style
- \math_frac_command_u
- {\usemathstyleparameter\mathfractionparameter{\m_fractions_strut_top#1}}%
- {\usemathstyleparameter\mathfractionparameter{\m_fractions_strut_bot#2}}%
- }%
- \math_frac_wrapup}
-
-\def\math_fraction_outer_normal#1#2%
- {\Ustack{% forces num style
- \usemathstyleparameter\mathfractionparameter
- \math_frac_command_u
- {\m_fractions_strut_top#1}%
- {\m_fractions_strut_bot#2}%
- }%
- \math_frac_wrapup}
-
-\def\math_fraction_both_normal#1#2%
- {\Ustack{% forces num style
- \usemathstyleparameter\mathfractionparameter
- \math_frac_command_u
- {\usemathstyleparameter\mathfractionparameter\m_fractions_strut_top#1}%
- {\usemathstyleparameter\mathfractionparameter\m_fractions_strut_bot#2}%
- }%
+ {\edef\p_method {\mathfractionparameter\c!method}%
+ \edef\p_rule {\mathfractionparameter\c!rule}%
+ \edef\p_thickness{\mathfractionparameter\c!rulethickness}%
+ \scratchcounterone \mathfractionparameter\c!left \relax
+ \scratchcountertwo \mathfractionparameter\c!right \relax
+ \scratchcounterthree \mathfractionparameter\c!middle \relax
+ \ifcsname
+ \??fractionmethods
+ \p_method
+ \ifx\p_method\v!horizontal
+ \orelse\ifx\p_method\v!line
+ \orelse\ifcsname\??fractionmethods\p_method\p_rule\endcsname
+ \p_rule
+ \else
+ \v!auto
+ \fi
+ \ifnum\scratchcounterone=\math_frac_no_delim
+ \ifnum\scratchcountertwo=\math_frac_no_delim
+ \v!none
+ \fi
+ \fi
+ \endcsname \lastnamedcs \else \csname\??fractionmethods\v!vertical\v!auto\endcsname \fi
+ \usedcolorparameterattributes{\mathfractionparameter\c!rulecolor}% was \c!color so we break compatibility !
+ thickness \ifx\p_thickness\v!font
+ \zeropoint
+ \s!font \space
+ \else
+ \dimexpr\p_thickness\relax
+ \fi
+ \s!class \math_class_by_parameter\mathfractionparameter\c!mathclass
+ \s!vfactor \numexpr\mathfractionparameter\c!vfactor\relax
+ \s!source \number\namedboxanchor{\mathfractionparameter\c!source}}
+
+\installcorenamespace{mathalignsimple} % this should move to math-ali
+
+\defcsname\??mathalignsimple\v!right \endcsname#1{#1\hfill}
+\defcsname\??mathalignsimple\v!flushleft \endcsname#1{#1\hfill}
+\defcsname\??mathalignsimple\v!left \endcsname#1{\hfill#1}
+\defcsname\??mathalignsimple\v!flushright\endcsname#1{\hfill#1}
+\defcsname\??mathalignsimple\v!middle \endcsname#1{\hfill#1\hfill}
+
+\protected\def\math_frac_aligned_top{\begincsname\??mathalignsimple\mathfractionparameter\c!topalign \endcsname}
+\protected\def\math_frac_aligned_bot{\begincsname\??mathalignsimple\mathfractionparameter\c!bottomalign\endcsname}
+
+% \protected\def\math_frac_aligned_top{\begincsname\??mathalignsimple\mathfractionparameter\c!align\endcsname}
+% \protected\def\math_frac_aligned_bot{\begincsname\??mathalignsimple\mathfractionparameter\c!align\endcsname}
+
+\protected\defcsname\??mathfractionalternative\v!inner\endcsname#1#2%
+ {%\beginmathgroup
+ \math_frac_command_u
+ {\dousecolorparameter{\mathfractionparameter\c!topcolor}%
+ \math_fraction_margin_kern
+ \usemathstyleparameter\mathfractionparameter\c!mathnumeratorstyle
+ \m_fractions_strut_top\math_frac_aligned_top{#1}%
+ \math_fraction_margin_kern}%
+ {\dousecolorparameter{\mathfractionparameter\c!bottomcolor}%
+ \math_fraction_margin_kern
+ \usemathstyleparameter\mathfractionparameter\c!mathdenominatorstyle
+ \m_fractions_strut_bot\math_frac_aligned_bot{#2}%
+ \math_fraction_margin_kern}%
+ %\endmathgroup
\math_frac_wrapup}
-\def\math_fraction_inner_margin#1#2%
- {\Ustack{%
- {%
- \math_frac_command_u
- {\kern\d_math_fraction_margin
- \usemathstyleparameter\mathfractionparameter{\m_fractions_strut_top#1}%
- \kern\d_math_fraction_margin}%
- {\kern\d_math_fraction_margin
- \usemathstyleparameter\mathfractionparameter{\m_fractions_strut_bot#2}%
- \kern\d_math_fraction_margin}%
- }%
- }%
+\protected\defcsname\??mathfractionalternative\v!outer\endcsname#1#2%
+ {\beginmathgroup
+ \usemathstyleparameter\mathfractionparameter\c!mathstyle
+ \math_frac_command_u
+ {\dousecolorparameter{\mathfractionparameter\c!topcolor}%
+ \math_fraction_margin_kern
+ \m_fractions_strut_top\math_frac_aligned_top{#1}%
+ \math_fraction_margin_kern}%
+ {\dousecolorparameter{\mathfractionparameter\c!bottomcolor}%
+ \math_fraction_margin_kern
+ \m_fractions_strut_bot\math_frac_aligned_bot{#2}%
+ \math_fraction_margin_kern}%
+ \endmathgroup
\math_frac_wrapup}
-\def\math_fraction_outer_margin#1#2%
- {\Ustack{%
- \usemathstyleparameter\mathfractionparameter
- {%
- \math_frac_command_u
- {\kern\d_math_fraction_margin
- \m_fractions_strut_top#1%
- \kern\d_math_fraction_margin}%
- {\kern\d_math_fraction_margin
- \m_fractions_strut_bot#2%
- \kern\d_math_fraction_margin}%
- }%
- }%
+\protected\defcsname\??mathfractionalternative\v!both\endcsname#1#2%
+ {\beginmathgroup
+ \usemathstyleparameter\mathfractionparameter\c!mathstyle
+ \math_frac_command_u
+ {\dousecolorparameter{\mathfractionparameter\c!topcolor}%
+ \math_fraction_margin_kern
+ \usemathstyleparameter\mathfractionparameter\c!mathnumeratorstyle
+ \m_fractions_strut_top\math_frac_aligned_top{#1}%
+ \math_fraction_margin_kern}%
+ {\dousecolorparameter{\mathfractionparameter\c!bottomcolor}%
+ \math_fraction_margin_kern
+ \usemathstyleparameter\mathfractionparameter\c!mathdenominatorstyle
+ \m_fractions_strut_bot\math_frac_aligned_bot{#2}%
+ \math_fraction_margin_kern}%
+ \endmathgroup
\math_frac_wrapup}
-\def\math_fraction_both_margin#1#2%
- {\Ustack{%
- \usemathstyleparameter\mathfractionparameter
- {%
- \math_frac_command_u
- {\kern\d_math_fraction_margin
- \usemathstyleparameter\mathfractionparameter\m_fractions_strut_top#1%
- \kern\d_math_fraction_margin}%
- {\kern\d_math_fraction_margin
- \usemathstyleparameter\mathfractionparameter\m_fractions_strut_bot#2%
- \kern\d_math_fraction_margin}%
- }%
- }%
- \math_frac_wrapup}
+\nulldelimiterspace\zeropoint % was 1.2pt
\definemathfraction[xfrac] [\c!alternative=\v!inner,\c!mathstyle=\s!script]
\definemathfraction[xxfrac][\c!alternative=\v!inner,\c!mathstyle=\s!scriptscript]
@@ -446,10 +406,8 @@
%D Spacing (sensitive for definition of \triggermathstyle:
-% \ifcase\contextlmtxmode
-
-\permanent\protected\def\nomathfractiongaps {\normalexpanded{\math_no_fraction_gaps \mathstyletrigger\mathstyle}} % maybe collect settings
-\permanent\protected\def\overlaymathfractiongaps{\normalexpanded{\math_overlay_fraction_gaps\mathstyletrigger\mathstyle}} % maybe collect settings
+\permanent\protected\def\nomathfractiongaps {\normalexpanded{\math_no_fraction_gaps \allmathstyles}}
+\permanent\protected\def\overlaymathfractiongaps{\normalexpanded{\math_overlay_fraction_gaps\allmathstyles}}
\protected\def\math_no_fraction_gaps#1%
{\Umathfractionnumup #1\zeropoint
@@ -458,40 +416,24 @@
\protected\def\math_overlay_fraction_gaps#1%
{\Umathfractionnumup #1\zeropoint
\Umathfractionnumvgap #1\zeropoint
- %Umathfractionrule #1\zeropoint
\Umathfractiondenomvgap#1\zeropoint
\Umathfractiondenomdown#1\zeropoint}
-% \else
-
-% \protected\def\math_no_fraction_gaps
-% {\Umathfractionnumup \mathstyle\zeropoint
-% \Umathfractiondenomdown\mathstyle\zeropoint}
-%
-% \protected\def\math_overlay_fraction_gaps
-% {\Umathfractionnumup \mathstyle\zeropoint
-% \Umathfractionnumvgap \mathstyle\zeropoint
-% %Umathfractionrule \mathstyle\zeropoint
-% \Umathfractiondenomvgap\mathstyle\zeropoint
-% \Umathfractiondenomdown\mathstyle\zeropoint}
-
-% \fi
-
\installcorenamespace{mathfractiondistance}
-\letvalue{\??mathfractiondistance\v!none }\nomathfractiongaps
-\letvalue{\??mathfractiondistance\v!no }\nomathfractiongaps
-\letvalue{\??mathfractiondistance\v!overlay}\overlaymathfractiongaps
+\letcsname\??mathfractiondistance\v!none \endcsname\nomathfractiongaps
+\letcsname\??mathfractiondistance\v!no \endcsname\nomathfractiongaps
+\letcsname\??mathfractiondistance\v!overlay\endcsname\overlaymathfractiongaps
\setupmathfractions
[\c!distance=\v!none]
+% we need to keep it local, so not everybodyfont
+
\appendtoks
\edef\p_distance{\rootmathfractionparameter\c!distance}%
\ifempty\p_distance\else
- \ifcsname\??mathfractiondistance\p_distance\endcsname
- \lastnamedcs
- \fi
+ \begincsname\??mathfractiondistance\p_distance\endcsname
\fi
\to \everymathematics
@@ -509,32 +451,47 @@
\ifempty\currentmathfraction
\edef\p_threshold{\mathfractionparameter\c!inlinethreshold}%
\ifempty\p_threshold
- \let\math_fraction_set_threshold_inline\relax
+ \let\math_fraction_set_threshold_inline\math_fraction_set_threshold_inline_auto
\orelse\ifx\p_threshold\v!auto
- \let\math_fraction_set_threshold_inline\relax
+ \let\math_fraction_set_threshold_inline\math_fraction_set_threshold_inline_auto
\else
- \let\math_fraction_set_threshold_inline\math_fraction_set_theshold_inline
+ \let\math_fraction_set_threshold_inline\math_fraction_set_threshold_inline_ratio
\fi
\edef\p_threshold{\mathfractionparameter\c!displaythreshold}%
\ifempty\p_threshold
- \let\math_fraction_set_threshold_display\relax
+ \let\math_fraction_set_threshold_display\math_fraction_set_threshold_display_auto
\orelse\ifx\p_threshold\v!auto
- \let\math_fraction_set_threshold_display\relax
+ \let\math_fraction_set_threshold_display\math_fraction_set_threshold_display_auto
\else
- \let\math_fraction_set_threshold_display\math_fraction_set_theshold_display
+ \let\math_fraction_set_threshold_display\math_fraction_set_threshold_display_ratio
\fi
\fi
\to \everysetupmathfraction
-\def\math_fraction_set_theshold_inline
+\def\math_fraction_set_threshold_inline_auto
+ {\Umathfractiondelsize\allmathstyles\maxdimen}
+
+\def\math_fraction_set_threshold_display_auto
+ {\Umathfractiondelsize\alldisplaystyles\maxdimen}
+
+\def\math_fraction_set_threshold_inline_ratio
{\edef\p_threshold{\mathfractionparameter\c!inlinethreshold}%
- \Umathfractiondelsize\textstyle \p_threshold\dimexpr\textface\relax
- \Umathfractiondelsize\scriptstyle \p_threshold\dimexpr\scriptface\relax
- \Umathfractiondelsize\scriptscriptstyle\p_threshold\dimexpr\scriptscriptface\relax}
+ \Umathfractiondelsize\alltextstyles \p_threshold\dimexpr\textface\relax
+ \Umathfractiondelsize\allscriptstyles \p_threshold\dimexpr\scriptface\relax
+ \Umathfractiondelsize\allscriptscriptstyles\p_threshold\dimexpr\scriptscriptface\relax}
-\def\math_fraction_set_theshold_display
+\def\math_fraction_set_threshold_display_ratio
{\edef\p_threshold{\mathfractionparameter\c!displaythreshold}%
- \Umathfractiondelsize\displaystyle \p_threshold\dimexpr\textface\relax}
+ \Umathfractiondelsize\alldisplaystyles\p_threshold\dimexpr\textface\relax}
+
+\setupmathfractions
+ [\c!inlinethreshold=1.2, % no unit but fraction
+ \c!displaythreshold=\v!auto, % no unit but fraction
+ \c!threshold=.25\exheight]
+
+\appendtoks
+ \Umathskeweddelimitertolerance\allmathstyles\mathfractionparameter\c!threshold
+\to \everymathematics % else original lost: \to \everybodyfont
%D \macros
%D {dfrac, tfrac, frac, dbinom, tbinom, binom}
@@ -559,15 +516,15 @@
% $$ {{a}\abovewithdelims()#1pt{b}} $$
% }
-\definemathfraction[i:frac] [\c!alternative=\v!inner,\c!mathstyle=] % was script and then small but nothing needed
-\definemathfraction[i:tfrac][\c!alternative=\v!inner,\c!mathstyle=\s!text] % was script (before luatex fix)
+\definemathfraction[i:frac] [\c!alternative=\v!inner,\c!mathstyle=\v!small]
+\definemathfraction[i:tfrac][\c!alternative=\v!inner,\c!mathstyle=\s!script]
\definemathfraction[i:sfrac][\c!alternative=\v!inner,\c!mathstyle=\s!scriptscript]
\definemathfraction[i:dfrac][\c!alternative=\v!inner,\c!mathstyle=\s!display]
-\definemathfraction[d:frac] [\c!alternative=\v!inner,\c!mathstyle=\s!cramped] % was cramped,text
-\definemathfraction[d:tfrac][\c!alternative=\v!both ,\c!mathstyle={\s!cramped,\s!text}] % was cramped,script (before luatex fix)
-\definemathfraction[d:sfrac][\c!alternative=\v!both ,\c!mathstyle={\s!cramped,\s!scriptscript}]
-\definemathfraction[d:dfrac][\c!alternative=\v!inner,\c!mathstyle=\s!display]
+\definemathfraction[d:frac] [\c!alternative=\v!inner,\c!mathstyle=\s!cramped]
+\definemathfraction[d:tfrac][\c!alternative=\v!inner,\c!mathstyle={\s!cramped,\s!script}]
+\definemathfraction[d:sfrac][\c!alternative=\v!inner,\c!mathstyle={\s!cramped,\s!scriptscript}]
+\definemathfraction[d:dfrac][\c!alternative=\v!both,\c!mathstyle=\s!display]
%D \protected\def\ShowMathFractions#1#2%
%D {\dontleavehmode
@@ -585,54 +542,80 @@
%D \ShowMathFractions{1}{b}\par
%D \blank
+% % There is no real need to support ams styling so this is now obsolete:
+
\permanent\protected\def\frac {\csname\inlineordisplaymath id:frac\endcsname}
\permanent\protected\def\tfrac{\csname\inlineordisplaymath id:tfrac\endcsname}
\permanent\protected\def\sfrac{\csname\inlineordisplaymath id:sfrac\endcsname}
\permanent\protected\def\dfrac{\csname\inlineordisplaymath id:dfrac\endcsname}
-\definemathfraction[ams] [\c!strut=\v!no,\c!alternative=\v!outer]
-\definemathfraction[i:ams:frac][ams][\c!mathstyle={\s!cramped,\s!text}]
-\definemathfraction[d:ams:frac][ams][\c!mathstyle={\s!cramped,\s!display}]
-
-\permanent\protected\def\ctxfrac{\csname\inlineordisplaymath id:frac\endcsname}
-\permanent\protected\def\amsfrac{\csname\inlineordisplaymath id:ams:frac\endcsname}
-
+% \definemathfraction[ams] [\c!strut=\v!no,\c!alternative=\v!outer]
+% \definemathfraction[i:ams:frac][ams][\c!mathstyle={\s!cramped,\s!text}]
+% \definemathfraction[d:ams:frac][ams][\c!mathstyle={\s!cramped,\s!display}]
+%
+% \permanent\protected\def\ctxfrac{\csname\inlineordisplaymath id:frac\endcsname}
+% \permanent\protected\def\amsfrac{\csname\inlineordisplaymath id:ams:frac\endcsname}
+%
% \appendtoks
-% \doifelse{\mathfractionparameter\c!option}{ams}%
-% {\let\frac\amsfrac}%
-% {\let\frac\ctxfrac}%
-% \to \everysetupmathfraction
-
-\appendtoks
- \doifelse{\mathematicsparameter\c!fractions}{ams}%
- {\enforced\let\frac\amsfrac}%
- {\enforced\let\frac\ctxfrac}%
-\to \everysetupmathematics
+% \doifelse{\mathematicsparameter\c!fractions}{ams}%
+% {\enforced\let\frac\amsfrac}%
+% {\enforced\let\frac\ctxfrac}%
+% \to \everysetupmathematics
+% % Also gone:
+%
% \definemathfraction[ddfrac][\c!mathstyle=\s!display]
% \definemathfraction[ttfrac][\c!mathstyle=\s!text]
% \definemathfraction[ssfrac][\c!mathstyle=\s!script]
-
+%
% \protected\def\binom #1#2{{\Ustack {{#1}\normalabovewithdelims()\zeropoint{#2}}}}
% \protected\def\dbinom#1#2{{\displaystyle{{#1}\normalabovewithdelims()\zeropoint{#2}}}}
% \protected\def\tbinom#1#2{{\textstyle {{#1}\normalabovewithdelims()\zeropoint{#2}}}}
+%
+% \definemathfraction
+% [binom]
+% [\c!alternative=\v!outer,
+% \c!rule=\v!no,
+% \c!left="28,
+% \c!right="29,
+% \c!mathstyle=\s!auto]
+%
+% \definemathfraction
+% [dbinom]
+% [binom]
+% [\c!mathstyle=\s!display]
+%
+% \definemathfraction
+% [tbinom]
+% [binom]
+% [\c!mathstyle=\s!text]
+
+\definemathfraction
+ [d:binom]
+ [d:frac]
+ [\c!rule=\v!no,
+ % \c!mathstyle=\s!display,
+ \c!left="28,
+ \c!right="29]
\definemathfraction
- [binom]
- [\c!alternative=\v!outer,
- \c!rule=\v!no,
- \c!left=0x28,
- \c!right=0x29,
- \c!mathstyle=\s!auto]
+ [i:binom]
+ [i:frac]
+ [\c!rule=\v!no,
+ %\c!mathstyle=\s!text,
+ \c!left="28,
+ \c!right="29]
+
+\permanent\protected\def\binom{\csname\inlineordisplaymath id:binom\endcsname}
\definemathfraction
[dbinom]
- [binom]
+ [d:binom]
[\c!mathstyle=\s!display]
\definemathfraction
[tbinom]
- [binom]
+ [i:binom]
[\c!mathstyle=\s!text]
%D \macros
@@ -660,25 +643,43 @@
%D
%D \getbuffer
-\permanent\protected\def\cfrac
- {\doifelsenextoptionalcs\math_cfrac_yes\math_cfrac_nop}
+% % we forget about this ams one ... no one uses it anyway
+%
+% \permanent\protected\def\cfrac
+% {\doifelsenextoptionalcs\math_cfrac_yes\math_cfrac_nop}
+%
+% \def\math_cfrac_nop {\math_cfrac_indeed[cc]}
+% \def\math_cfrac_yes[#1]{\math_cfrac_indeed[#1cc]}
+%
+% \def\math_cfrac_indeed[#1#2#3]#4#5%
+% {{\displaystyle
+% \frac
+% {\strut
+% \ifx r#1\hfill\fi#4\ifx l#1\hfill\fi}%
+% {\ifx r#2\hfill\fi#5\ifx l#2\hfill\fi}%
+% \ifzeropt\nulldelimiterspace\else
+% \kern-\nulldelimiterspace
+% \fi}}
+%
+% instead we predefine one:
-\def\math_cfrac_nop {\math_cfrac_indeed[cc]}
-\def\math_cfrac_yes[#1]{\math_cfrac_indeed[#1cc]}
+\definemathfraction
+ [cfrac]
+ [\c!mathstyle=\v!text]
-\def\math_cfrac_indeed[#1#2#3]#4#5%
- {{\displaystyle
- \frac
- {\strut
- \ifx r#1\hfill\fi#4\ifx l#1\hfill\fi}%
- {\ifx r#2\hfill\fi#5\ifx l#2\hfill\fi}%
- \kern-\nulldelimiterspace}}
+% so users can do this:
+%
+% \setupmathfraction
+% [cfrac]
+% [topalign=flushright]
+%
+% or define an child instance that presets it.
%D \macros
%D {splitfrac, splitdfrac}
%D
-%D Occasionally one needs to typeset multi||line fractions.
-%D These commands use \tex{genfrac} to create such fractions.
+%D Occasionally one needs to typeset multi||line fractions. These commands use \type
+%D {\genfrac} to create such fractions.
%D
%D \startbuffer
%D \startformula
@@ -696,55 +697,97 @@
%D \stopbuffer
%D
%D \typebuffer \getbuffer
-%D
-%D These macros are based on Michael J.~Downes posting on
-%D comp.text.tex on 2001/12/06 but adapted a bit.
-\permanent\protected\def\splitfrac #1#2{{\textstyle {{\textstyle#1\quad\hfill}\normalabove\zeropoint{\textstyle\hfill\quad\mathstrut#2}}}}
-\permanent\protected\def\splitdfrac#1#2{{\displaystyle{{ #1\quad\hfill}\normalabove\zeropoint{ \hfill\quad\mathstrut#2}}}}
+\defcsname\??mathalignsimple\v!split:\v!flushleft\endcsname#1%
+ {#1%
+ \ifchkdim\mathfractionparameter\c!distance\or\hskip\lastchkdim\fi
+ \hfill}
-%D For testing:
+\defcsname\??mathalignsimple\v!split:\v!flushright\endcsname#1%
+ {\hfill
+ \ifchkdim\mathfractionparameter\c!distance\or\hskip\lastchkdim\fi
+ \mathatom \s!class \mathordcode \s!unroll {}% prevents +/- seen as sign, unroll prevents empty box
+ #1}
-% \protected\def\ShowMathFractions#1#2%
-% {\mathematics{x+\tfrac{#1}{#2}+1+\frac{#1}{#2}+2+\sfrac{#1}{#2}+g}}
+\definemathfraction
+ [splitfrac]
+ [\c!mathnumeratorstyle=\v!text,
+ \c!mathdenominatorstyle=\v!text,
+ \c!topalign=\v!split:\v!flushleft,
+ \c!bottomalign=\v!split:\v!flushright,
+ \c!distance=\emwidth,
+ \c!rule=\v!no]
+
+\definemathfraction
+ [splitdfrac]
+ [splitfrac]
+ [\c!mathnumeratorstyle=\v!display,
+ \c!mathdenominatorstyle=\v!display]
%D More fracking (for Alan):
-\protected\def\math_frac_colored_vulgar#1#2%
- {\savecolor
- \colo_helpers_activate\p_math_fractions_color
- {\restorecolor#1}\Uskewed/{\restorecolor#2}}
+% \appendtoks
+% \Umathskewedfractionhgap\allmathstyles\namedmathfractionparameter\s!vfrac\c!hfactor\fontemwidth \mathstylefont\textstyle
+% \Umathskewedfractionvgap\allmathstyles\namedmathfractionparameter\s!vfrac\c!vfactor\fontexheight\mathstylefont\textstyle
+% \to \everymathematics
-\protected\def\math_frac_normal_vulgar#1#2%
- {{#1}\Uskewed/{#2}}
+\definemathfraction
+ [\v!horizontal]
+ [\c!method=\v!horizontal]
-\permanent\protected\def\vfrac#1#2%
- {\bgroup
- \edef\p_math_fractions_color{\namedmathfractionparameter\s!vfrac\c!color}%
- \ifempty\p_math_fractions_color
- \expandafter\math_frac_normal_vulgar
- \else
- \expandafter\math_frac_colored_vulgar
- \fi
- {#1}%
- {#2}%
- \egroup}
+\definemathfraction
+ [\s!vfrac]
+ [\v!horizontal]
+ [\c!hfactor=20,
+ \c!vfactor=10]
-\appendtoks
- \edef\p_hfactor{\namedmathfractionparameter\s!vfrac\c!hfactor}%
- \edef\p_vfactor{\namedmathfractionparameter\s!vfrac\c!vfactor}%
- \Umathskewedfractionhgap\textstyle \p_hfactor\fontemwidth \mathstylefont\textstyle
- \Umathskewedfractionhgap\scriptstyle \p_hfactor\fontemwidth \mathstylefont\scriptstyle
- \Umathskewedfractionhgap\scriptscriptstyle\p_hfactor\fontemwidth \mathstylefont\scriptscriptstyle
- \Umathskewedfractionvgap\textstyle \p_vfactor\fontexheight\mathstylefont\textstyle
- \Umathskewedfractionvgap\scriptstyle \p_vfactor\fontexheight\mathstylefont\scriptstyle
- \Umathskewedfractionvgap\scriptscriptstyle\p_vfactor\fontexheight\mathstylefont\scriptscriptstyle
-\to \everysetupmathfraction
+%D And a cheat (for Mikael):
-\setupmathfraction
- [\s!vfrac]
- [\c!hfactor=.2,
- \c!vfactor=.1]
+% \definemathfraction
+% [afrac]
+% [\c!mathclass=\mathrelationcode,
+% \c!rule=\v!symbol,
+% \c!middle="2192]
+
+%D New stretched fraction with middle symnbol:
+
+% \enableexperiments[math.arrows] % enforce construction of these in math-act
+%
+% {
+% tweak = "addarrows",
+% list = { [0x3D] = { squeeze = .85, yoffset = .0975 } } -- bonum
+% },
+
+\definemathfraction
+ [relfraction]
+ [\c!mathclass=\mathrelationcode,
+ \c!margin=.25\emwidth,
+ \c!rule=\v!symbol]
+
+\definemathfraction [bartext] [relfraction] [\c!middle="203E]
+\definemathfraction [leftarrowtext] [relfraction] [\c!middle="2190]
+\definemathfraction [rightarrowtext] [relfraction] [\c!middle="2192]
+\definemathfraction [twoheadleftarrowtext] [relfraction] [\c!middle="219E]
+\definemathfraction [twoheadrightarrowtext] [relfraction] [\c!middle="21A0]
+\definemathfraction [reltext] [relfraction] [\c!middle="002D]
+\definemathfraction [equaltext] [relfraction] [\c!middle="003D]
+\definemathfraction [mapstotext] [relfraction] [\c!middle="21A6]
+\definemathfraction [hookleftarrowtext] [relfraction] [\c!middle="21A9]
+\definemathfraction [hookrightarrowtext] [relfraction] [\c!middle="21AA]
+\definemathfraction [leftharpoondowntext] [relfraction] [\c!middle="21BD]
+\definemathfraction [leftharpoonuptext] [relfraction] [\c!middle="21BC]
+\definemathfraction [rightharpoondowntext] [relfraction] [\c!middle="21C1]
+\definemathfraction [rightharpoonuptext] [relfraction] [\c!middle="21C0]
+\definemathfraction [rightoverleftarrowtext] [relfraction] [\c!middle="21C4]
+\definemathfraction [leftrightharpoonstext] [relfraction] [\c!middle="21CB]
+\definemathfraction [rightleftharpoonstext] [relfraction] [\c!middle="21CC]
+\definemathfraction [triplereltext] [relfraction] [\c!middle="2261]
+\definemathfraction [leftrightarrowtext] [relfraction] [\c!middle="27F7]
+\definemathfraction [rightleftarrowtext] [relfraction] [\c!middle="27F7]
+\definemathfraction [Leftarrowtext] [relfraction] [\c!middle="27F8]
+\definemathfraction [Rightarrowtext] [relfraction] [\c!middle="27F9]
+\definemathfraction [Leftrightarrowtext] [relfraction] [\c!middle="27FA]
+\definemathfraction [Rightleftarrowtext] [relfraction] [\c!middle="27FA]
\protect \endinput
@@ -823,7 +866,7 @@
% \hss$\textstyle/$\hss
% \egroup
% \lower
-% \Umathskewedfractionvgap\textstyle
+% \Umathskewedfractionvgapskewedfractionvgap\textstyle
% \hbox\bgroup
% $\hskip\dimexpr\Umathskewedfractionhgap\textstyle/2\relax\scriptstyle#2$%
% \egroup
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-inc.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-inc.lmt
new file mode 100644
index 00000000000..7c32adde6ca
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-inc.lmt
@@ -0,0 +1,94 @@
+if not modules then modules = { } end modules ['back-inc'] = {
+ version = 1.001,
+ comment = "companion to back-exp.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- This is an experiment. If it's really useful then I'll make a more efficient
+-- local export facility.
+
+local tonumber, next = tonumber, next
+local utfbyte, utfchar, utfsplit = utf.byte, utf.char, utf.split
+local match, gsub = string.match, string.gsub
+local nspaces = string.nspaces
+local concat = table.concat
+local xmltext = xml.text
+local undent = buffers.undent
+
+local f_entity = string.formatters["&x%X;"]
+local f_blob = string.formatters['<?xml version="2.0"?>\n\n<!-- formula %i -->\n\n%s']
+
+local report_tags = logs.reporter("structure","tags")
+
+local all = nil
+local back = nil
+
+local function unmath(s)
+ local t = utfsplit(s)
+ for i=1,#t do
+ local ti = t[i]
+ local bi = utfbyte(ti)
+ if bi > 0xFFFF then
+ local ch = back[bi]
+ t[i] = ch and utfchar(ch) or f_entity(bi)
+ end
+ end
+ s = concat(t)
+ return s
+end
+
+local function beautify(s)
+ local b = match(s,"^( *)<m:math")
+ local e = match(s,"( *)</m:math>%s*$")
+ if b and e then
+ b = #b
+ e = #e
+ if e > b then
+ s = undent(nspaces[e-b] .. s)
+ elseif e < b then
+ s = undent((gsub(s,"^( *)",nspaces[b-e])))
+ end
+ end
+ return s
+end
+
+local function getblob(n)
+ if all == nil then
+ local name = file.nameonly(tex.jobname)
+ local full = name .. "-export/" .. name .. "-raw.xml"
+ if lfs.isfile(full) then
+ all = { }
+ back = { }
+ local root = xml.load(full)
+ for c in xml.collected(root,"formulacontent") do
+ local index = tonumber(c.at.n)
+ local data = beautify(xmltext(c,"math") or "")
+ if index and data then
+ all[index] = f_blob(index,data)
+ else
+ report_tags("no formula content id")
+ end
+ end
+ local it = mathematics.alphabets.regular.it
+ for k, v in next, it.digits do back[v] = k end
+ for k, v in next, it.ucletters do back[v] = k end
+ for k, v in next, it.lcletters do back[v] = k end
+ else
+ all = false
+ end
+ end
+ if all == false then
+ return ""
+ end
+ return unmath(all[n] or "")
+end
+
+interfaces.implement {
+ name = "xmlformulatobuffer",
+ arguments = { "integer", "string" },
+ actions = function(n,target)
+ buffers.assign(target,getblob(n))
+ end
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-inc.mkxl b/Master/texmf-dist/tex/context/base/mkxl/math-inc.mkxl
index 4db75e37e11..e2a44217d3d 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/math-inc.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-inc.mkxl
@@ -13,7 +13,7 @@
\writestatus{loading}{ConTeXt Math Macros / XML inclusion}
-\registerctxluafile{math-inc}{}
+\registerctxluafile{math-inc}{autosuffix}
%D I had some doubt about including this in \CONTEXT\ but it might serve some users
%D anyway. It's always the question to what extent one can be really roundtrip. I
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-ini.lmt
new file mode 100644
index 00000000000..f26f24c93b1
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-ini.lmt
@@ -0,0 +1,1170 @@
+if not modules then modules = { } end modules ['math-ini'] = {
+ version = 1.001,
+ comment = "companion to math-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- The way we do math in \CONTEXT\ \MKIV\ differs from other macro packages so you
+-- should not mix the somewhat unique (and bit weird) approach here with the more
+-- traditional (\TEX) approach. Also, we use char-def.lua as starting point and that
+-- file is quite \CONTEXT\ specific. When we added math to that there was no
+-- interest (quite the contrary) so we didn't went generic there which in retrospect
+-- also gives us the freedom to add more information, something that happens
+-- occasionally. Because that file is shared between \MKIV\ and \LMTX\ some
+-- information is only used by \LMTX. We also have quite some runs over the math
+-- list but that has been so since we started and performance will not degrade much
+-- by it; after all math is not that demanding. More details can be found in the
+-- manuals that discuss math. Most code (and concepts) date from 2005 so maybe I
+-- will upgrade the lot some day, although it has been adapted on the way to the
+-- changes in the engine(s).
+
+local next, type = next, type
+local formatters, find, nospaces = string.formatters, string.find, string.nospaces
+local utfchar, utfbyte = utf.char, utf.byte
+local sortedhash = table.sortedhash
+local toboolean = toboolean
+
+local context = context
+local commands = commands
+local implement = interfaces.implement
+
+local ctx_doifelsesomething = commands.doifelsesomething
+
+local trace_defining = false trackers.register("math.defining", function(v) trace_defining = v end)
+
+local report_math = logs.reporter("mathematics","initializing")
+
+mathematics = mathematics or { }
+local mathematics = mathematics
+
+mathematics.extrabase = fonts.privateoffsets.mathextrabase -- here we push some virtuals
+mathematics.privatebase = fonts.privateoffsets.mathbase -- here we push the ex
+
+local unsetvalue = attributes.unsetvalue
+local allocate = utilities.storage.allocate
+local chardata = characters.data
+
+local texsetattribute = tex.setattribute
+local setmathcode = tex.setmathcode
+local setdelcode = tex.setdelcode
+local texintegerdef = tex.integerdef
+
+setdelcode = function() end
+
+-- This is relatively new and experimental:
+
+do
+
+ local dictionaries = mathematics.dictionaries or { }
+ mathematics.dictionaries = dictionaries
+
+ local names = dictionaries.names or utilities.storage.allocate()
+ local groups = dictionaries.groups or utilities.storage.allocate()
+ local data = dictionaries.data or utilities.storage.allocate()
+ local sets = dictionaries.sets or utilities.storage.allocate()
+ local variants = dictionaries.variants or utilities.storage.allocate() -- todo: get from char-def
+ local defaults = dictionaries.defaults or utilities.storage.allocate() -- todo: get from char-def
+
+ storage.register("mathematics/dictionaries/names", names, "mathematics.dictionaries.names")
+ storage.register("mathematics/dictionaries/groups", groups, "mathematics.dictionaries.groups")
+ storage.register("mathematics/dictionaries/data", data, "mathematics.dictionaries.data")
+ storage.register("mathematics/dictionaries/sets", sets, "mathematics.dictionaries.sets")
+ storage.register("mathematics/dictionaries/variants", variants, "mathematics.dictionaries.variants")
+ storage.register("mathematics/dictionaries/defaults", defaults, "mathematics.dictionaries.defaults")
+
+ dictionaries.names = dictionaries.names or names
+ dictionaries.groups = dictionaries.groups or groups
+ dictionaries.data = dictionaries.data or data
+ dictionaries.sets = dictionaries.sets or sets
+ dictionaries.variants = dictionaries.variants or variants
+ dictionaries.defaults = dictionaries.defaults or defaults
+
+ if not sets.n then
+ sets.n = 0
+ end
+
+ function dictionaries.registergroup(name)
+ local group = rawget(names,name)
+ if not group then
+ group = #groups + 1
+ names[name] = group
+ names[group] = group
+ groups[group] = name
+ data[group] = { }
+ local csname = "math" .. nospaces(name) .. "dictionary"
+ texintegerdef(csname,group,"immutable")
+ end
+ return group
+ end
+
+ function dictionaries.registergroupset(name,set)
+ local s = sets[name]
+ if not s then
+ local d = dictionaries.registergroup(name)
+ local n = sets.n + 1
+ local l = utilities.parsers.settings_to_array(set)
+ local g = { }
+ for i=1,#l do
+ local n = names[l[i]]
+ if n then
+ g[#g+1] = n -- ordered
+ end
+ end
+ s = {
+ names = l,
+ groups = g,
+ group = d,
+ }
+ sets[name] = s
+ sets[d] = s
+
+ end
+ end
+
+ function dictionaries.groupset(name)
+ return sets[name] or { }
+ end
+
+ function dictionaries.groupsetgroup(name)
+ local s = sets[name]
+ if s then
+ return s.group
+ else
+ return names[name] or 0
+ end
+ end
+
+ function dictionaries.registercharacter(group,index,description,class)
+ local d = names[group] -- can be number or string
+ if d then
+ data[d][index] = description or true
+ local v = variants[index]
+ if not class then
+ class = true
+ end
+ if v then
+ v[d] = class
+ else
+ variants[index] = { [d] = class}
+ end
+ if not defaults[index] then
+ defaults[index] = d
+ end
+ end
+ end
+
+ implement {
+ name = "registergroupset",
+ arguments = "2 strings",
+ actions = dictionaries.registergroupset,
+ }
+
+ implement {
+ name = "groupsetgroup",
+ arguments = "string",
+ actions = { dictionaries.groupsetgroup, context },
+ }
+
+ local fontchardata = fonts.hashes.characters
+ local f_dictionary = false
+ local register = callback.register
+ local whatdetail = "all"
+
+ local function trace(n,properties,group,index,font,char)
+ -- local properties, group, index, font, char = nodes.nuts.getchardict(nodes.nuts.tonut(n))
+ if properties ~= 0 or group ~= 0 or index ~= 0 then
+ local char = fontchardata[font][char]
+ if char or whatdetail == "all" then
+ local unicode = char and char.unicode
+ if unicode then
+ local groupname = groups[group]
+ local indexname = false
+ if groupname then
+ indexname = data[group][index] -- dictionaries.data
+ else
+ groupname = "unknown"
+ end
+ if not indexname or indexname == true then
+ indexname = chardata[unicode]
+ indexname = indexname and indexname.description or "unknown"
+ end
+ if not f_dictionary then
+ f_dictionary = formatters["properties [%04X:%04X:%04X] [%s] %U : %s"]
+ end
+ return f_dictionary(properties,group,index,groupname,unicode,indexname)
+ end
+ end
+ end
+ end
+
+ trackers.register("math.dictionaries",function(v)
+ whatdetail = v
+ if whatdetail then
+ register("get_math_dictionary",trace)
+ else
+ register("get_math_dictionary")
+ end
+ end)
+
+ register("get_math_dictionary",trace)
+
+ -- This is experimental and a prelude to the long pending "relate math rendering to
+ -- some field" wish. In TeX characters and symbols are grouped by class but that is
+ -- mostly related to spacing etc. while we actually want to group by meaning. A
+ -- reasonable but incomplete starting point is:
+ --
+ -- https://www.w3.org/TR/MathML3/appendixa.html#parsing_DefEncAtt
+ --
+ -- But it has some weird short names mixed with long ones (and a strange suddenly
+ -- uppercase: Differential-Operator) but we are not bound to that at all. We will
+ -- probably remove and add categories anyway. This openmath stuff looks a bit
+ -- abandoned but we can use it as a start and playground anyway.
+ --
+ -- The char-def.lua file will have mathgroup entries reflecting this.
+ --
+ -- This is a good one (with nice roll-overs too):
+ --
+ -- https://en.wikipedia.org/wiki/List_of_mathematical_symbols_by_subject
+
+ if environment.initex then
+
+ local registergroup = mathematics.dictionaries.registergroup
+
+ registergroup("default")
+ registergroup("binary arithmetic")
+ registergroup("binary linear algebra")
+ registergroup("binary logical")
+ registergroup("binary relation")
+ registergroup("binary set")
+ registergroup("constant arithmetic")
+ registergroup("constant set")
+ registergroup("differential")
+ registergroup("integral")
+ registergroup("interval")
+ registergroup("lambda")
+ registergroup("limit")
+ registergroup("nary arithmetic")
+ registergroup("nary constructor")
+ registergroup("nary functional")
+ registergroup("nary linear algebra")
+ registergroup("nary logical")
+ registergroup("nary minmax")
+ registergroup("nary relation")
+ registergroup("nary set list")
+ registergroup("nary set relation")
+ registergroup("nary set")
+ registergroup("nary statistics")
+ registergroup("partial") -- partial differential
+ registergroup("product")
+ registergroup("quantifier")
+ registergroup("unary arithmetic")
+ registergroup("unary elementary")
+ registergroup("unary functional")
+ registergroup("unary linear algebra")
+ registergroup("unary logical")
+ registergroup("unary set")
+ registergroup("unary vector")
+
+ end
+
+ -- \Umathdictdef\vdash 1 \mathbinarylogicaldictionary "22A2 \mathrelationcode 0 "22A2
+ --
+ -- \startluacode
+ -- mathematics.dictionaries.registercharacter("binary logical",0x22A2,"implies")
+ -- \stopluacode
+
+end
+
+-- These are different from mkiv with luatex.
+
+local classes = allocate { unset = 64 } -- or -1
+local classnames = allocate { }
+local maxengineclass = 63
+local lastengineclass = 0
+local lastprivateclass = maxengineclass
+
+for k, v in next, nodes.noadcodes do
+ if type(k) == "string" then
+ classes[k] = v
+-- local n = classnames[v]
+-- if not n or #k < #n then
+-- classnames[v] = k
+-- end
+ elseif k > lastengineclass then
+ lastengineclass = k
+ end
+end
+
+local ordinary_class = classes.ordinary
+local operator_class = classes.operator
+local binary_class = classes.binary
+local relation_class = classes.relation
+local open_class = classes.open
+local close_class = classes.close
+local punctuation_class = classes.punctuation
+local middle_class = classes.middle
+local accent_class = classes.accent
+local radical_class = classes.radical
+local fraction_class = classes.fraction
+local under_class = classes.under
+local over_class = classes.over
+local fenced_class = classes.fenced
+local ghost_class = classes.ghost
+
+-- these will go
+
+classes.ord = ordinary_class
+classes.op = operator_class
+classes.bin = binary_class
+classes.rel = relation_class
+classes.opening = open_class -- will go
+classes.closing = close_class -- will go
+classes.punct = punctuation_class
+classes.frac = fraction_class
+classes.rad = radical_class
+classes.fen = fenced_class
+classes.gst = ghost_class
+
+-- these will go too
+
+classes.limop = operator_class
+classes.limoperator = operator_class
+classes.nolop = operator_class
+classes.nolimoperator = operator_class
+classes.large = operator_class
+classes.largeoperator = operator_class
+
+-- special in the engine : variable active inner vcenter
+
+local function registerengineclass(name,short)
+ local class = classes[name]
+ if not class then
+ if lastengineclass < maxengineclass then
+ lastengineclass = lastengineclass + 1
+ class = lastengineclass
+ classnames[class] = short or name
+ else
+ class = ordinary_class
+ end
+ else
+ classnames[class] = short or name
+ end
+ classes[class] = name
+ classes[name] = class
+ return class
+end
+
+-- predefined classes
+
+registerengineclass("ordinary", "ord")
+registerengineclass("operator", "ope")
+registerengineclass("binary", "bin")
+registerengineclass("relation", "rel")
+registerengineclass("open", "ope")
+registerengineclass("close", "clo")
+registerengineclass("punctuation", "pun")
+registerengineclass("variable", "var") -- not used
+registerengineclass("active", "act") -- not used
+registerengineclass("inner", "inn") -- not used
+registerengineclass("middle", "mid")
+registerengineclass("accent", "acc")
+registerengineclass("radical", "rad")
+registerengineclass("fraction", "fra")
+registerengineclass("under", "und")
+registerengineclass("over", "ove")
+registerengineclass("fenced", "fen")
+registerengineclass("ghost", "gho")
+registerengineclass("vcenter", "vce") -- not used
+
+-- additional classes
+
+registerengineclass("explicit", "xpl")
+registerengineclass("imaginary", "img")
+registerengineclass("differential", "dif")
+registerengineclass("exponential", "exp")
+registerengineclass("ellipsis", "ell")
+registerengineclass("function", "fnc")
+registerengineclass("digit", "dig")
+local division_class =
+registerengineclass("division", "div")
+registerengineclass("factorial", "fac")
+registerengineclass("wrapped", "wra")
+registerengineclass("construct", "con")
+registerengineclass("dimension", "dim")
+registerengineclass("unary", "una")
+registerengineclass("textpunctuation", "tpu")
+registerengineclass("unspaced", "uns")
+registerengineclass("experimental", "exp")
+registerengineclass("fake", "fak")
+registerengineclass("numbergroup", "ngr")
+
+registerengineclass("maybeordinary", "mor")
+registerengineclass("mayberelation", "mre")
+registerengineclass("maybebinary", "mbi")
+
+local specialclasses = tex.specialmathclasscodes
+
+classes["all"] = specialclasses["all"] classnames[specialclasses["all"] ] = "all"
+classes["begin"] = specialclasses["begin"] classnames[specialclasses["begin"]] = "beg"
+classes["end"] = specialclasses["end"] classnames[specialclasses["end"] ] = "end"
+
+callback.register("get_noad_class", function(n) return classnames[n] end)
+
+local function registerprivateclass(name,parent)
+ local class = parent and classes[parent] or classes[name]
+ if not class then
+ lastprivateclass = lastprivateclass + 1
+ class = lastprivateclass
+ classes[name] = class
+ -- also setup
+ end
+ return class
+end
+
+local function toengineclass(class)
+ if type(class) == "string" then
+ return classes[class] or ordinary_class
+ elseif class > lastengineclass then
+ return ordinary_class
+ else
+ return class
+ end
+end
+
+implement {
+ name = "registerengineclass",
+ public = true,
+ protected = true,
+ arguments = { "optional", "optional" },
+ actions = registerengineclass,
+}
+
+local topaccent_class = registerprivateclass("topaccent")
+local bottomaccent_class = registerprivateclass("bottomaccent")
+local delimiter_class = registerprivateclass("delimiter")
+local root_class = registerprivateclass("root")
+local prime_class = registerprivateclass("prime")
+
+registerprivateclass("botaccent","bottomaccent")
+
+local accents = allocate {
+ accent = true, -- some can be both
+ topaccent = true, [topaccent_class] = true,
+ bottomaccent = true, [bottomaccent_class] = true,
+ botaccent = true,
+ under = true, [under_class] = true,
+ over = true, [over_class] = true,
+ unknown = false,
+}
+
+local integer_value = tokens.values.integer
+
+implement {
+ name = "mathclassvalue",
+ -- usage = "value",
+ public = true,
+ arguments = "string",
+ actions = function(name)
+ -- return integer_value, classes[name] or ordinary_class
+ context(tostring(classes[name] or ordinary_class))
+ end
+}
+
+-- used in math-tag: so there we need to make things ord etc to fit within
+-- mathml
+
+local codes = allocate {
+ ordinary = ordinary_class, [ordinary_class] = "ordinary",
+ largeoperator = operator_class, [operator_class] = "largeoperator",
+ binaryoperator = binary_class, [binary_class] = "binaryoperator",
+ relation = relation_class, [relation_class] = "relation",
+ openingsymbol = open_class, [open_class] = "openingsymbol",
+ closingsymbol = close_class, [close_class] = "closingsymbol",
+ punctuation = punctuation_class, [punctuation_class] = "punctuation",
+ middlesymbol = middle_class, [middle_class] = "middlesymbol",
+}
+
+local extensibles = allocate {
+ unknown = 0,
+ l = 1, left = 1,
+ r = 2, right = 2,
+ h = 3, horizontal = 3,-- lr or rl
+ u = 5, up = 4,
+ d = 5, down = 5,
+ v = 6, vertical = 6,-- ud or du
+ m = 7, mixed = 7,
+}
+
+table.setmetatableindex(extensibles,function(t,k) t[k] = 0 return 0 end)
+
+local virtualized = allocate {
+}
+
+function mathematics.virtualize(unicode,virtual)
+
+ local function virtualize(k,v)
+ local c = virtualized[k]
+ if c == v then
+ report_math("character %C is already virtualized to %C",k,v)
+ elseif c then
+ report_math("character %C is already virtualized to %C, ignoring mapping to %C",k,c,v)
+ else
+ virtualized[k] = v
+ end
+ end
+
+ if type(unicode) == "table" then
+ for k, v in next, unicode do
+ virtualize(k,v)
+ end
+ elseif type(unicode) == "number" and type(virtual) == "number" then
+ virtualize(unicode,virtual)
+ -- else
+ -- error
+ end
+end
+
+mathematics.extensibles = extensibles
+mathematics.classes = classes
+mathematics.toengineclass = toengineclass
+mathematics.classnames = classnames
+mathematics.codes = codes
+-----------.accents = codes
+mathematics.virtualized = virtualized
+
+do
+
+ local skip = {
+ [accent_class] = true,
+ [topaccent_class] = true,
+ [bottomaccent_class] = true,
+ [over_class] = true,
+ [under_class] = true,
+ [radical_class] = true,
+ [root_class] = true,
+ }
+
+ local registercharacter = mathematics.dictionaries.registercharacter
+ local groupnames = mathematics.dictionaries.names
+
+ local setmathcharacter = function(class,family,slot,unicode,mset,dset,group)
+ if mset and class ~= ordinary_class then
+ setmathcode("global",slot,class,family,unicode)
+ mset = false
+ end
+ -- if dset and (class == open_class or class == close_class or class == middle_class or class == division_class) then
+ -- setdelcode("global",slot,family,unicode,0,0)
+ -- dset = false
+ -- end
+ if group then
+ group = groupnames[group] or 0
+ if group ~= 0 then
+ -- which one
+ registercharacter(group,unicode,nil,class)
+ -- registercharacter(group,slot,nil,class)
+ end
+ end
+ return mset, dset
+ end
+
+ local function report(class,family,unicode,name)
+ local nametype = type(name)
+ if nametype == "string" then
+ report_math("class %a, family %a, char %C, name %a",class,family,unicode,name)
+ elseif nametype == "number" then
+ report_math("class %a, family %a, char %C, number %U",class,family,unicode,name)
+ else
+ report_math("class %a, family %a, char %C",class,family,unicode)
+ end
+ end
+
+ local texmathchardef = tex.mathchardef
+
+ -- local setmathsymbol = function(name,class,family,slot,stretch,group) -- hex is nicer for tracing
+ -- if skip[class] then
+ -- return -- only in mkiv
+ -- elseif class == open_class or class == close_class or class == middle_class then
+ -- setdelcode("global",slot,family,slot,0,0) -- can go
+ -- elseif class == delimiter_class then -- open close or middle (bars)
+ -- setdelcode("global",slot,family,slot,0,0) -- can go
+ -- class = 0
+ -- else
+ -- if group then
+ -- group = groupnames[group] or 0
+ -- if group ~= 0 then
+ -- texmathchardef(name,class,family,slot,"permanent",0x1,group,slot)
+ -- return
+ -- end
+ -- end
+ -- end
+ -- texmathchardef(name,class,family,slot,"permanent")
+ -- end
+
+ local setmathsymbol = function(name,class,family,slot,stretch,group) -- hex is nicer for tracing
+ if skip[class] then
+ return -- only in mkiv
+ -- elseif class == open_class or class == close_class or class == middle_class then
+ else
+ if class == delimiter_class then -- open close or middle (bars)
+ class = ordinary_class
+ end
+ if group then
+ group = groupnames[group] or 0
+ if group ~= 0 then
+ texmathchardef(name,class,family,slot,"permanent",0x1,group,slot)
+ return
+ end
+ end
+ texmathchardef(name,class,family,slot,"permanent")
+ end
+ end
+
+ function mathematics.define()
+ if trace_defining then
+ logs.startfilelogging(report_math,"math defined from character definitions")
+ end
+ local family = 0
+ local data = characters.data
+ --
+ local function remap(first,last)
+ for unicode=utfbyte(first),utfbyte(last) do
+ setmathcode("global",unicode,ordinary_class,family,unicode)
+ end
+ end
+ remap("0","9")
+ remap("A","Z")
+ remap("a","z")
+ --
+ setdelcode("global",0x2E,0,0,0,0) -- period is special
+ --
+ for unicode, character in sortedhash(data) do
+ local symbol = character.mathsymbol
+ local mset = true
+ local dset = true
+ if symbol then
+ local other = data[symbol]
+ local class = other.mathclass
+ if class then
+ local engine = toengineclass(class)
+ if trace_defining then
+ report(engine,family,unicode,symbol)
+ end
+ mset, dset = setmathcharacter(engine,family,unicode,symbol,mset,dset,group)
+ end
+ local spec = other.mathspec
+ if spec then
+ for i=1,#spec do
+ local m = spec[i]
+ local class = m.class
+ if class then
+ local engine = toengineclass(class)
+ -- todo: trace
+ mset, dset = setmathcharacter(engine,family,unicode,symbol,mset,dset,group)
+ end
+ end
+ end
+ end
+ local class = character.mathclass
+ local spec = character.mathspec
+ local name = character.mathname
+ local stretch = character.mathstretch
+ local group = character.mathgroup
+ if spec then
+ local done = false
+ if class then
+ if name then
+ report_math("fatal error, conflicting mathclass and mathspec for %C",unicode)
+ os.exit()
+ else
+ class = classes[class] or ordinary_class
+ local engine = toengineclass(class)
+ if trace_defining then
+ report(engine,family,unicode)
+ end
+ mset, dset = setmathcharacter(engine,family,unicode,unicode,mset,dset,group)
+ done = true
+ end
+ end
+ for i=1,#spec do
+ local m = spec[i]
+ local name = m.name
+ local class = m.class or class
+ local group = m.group or group
+ local stretch = m.stretch or stretch
+ if class then
+ class = classes[class] or ordinary_class
+ else
+ class = ordinary_class
+ end
+ if class then
+ local engine = toengineclass(class)
+ if name then
+ if trace_defining then
+ report(engine,family,unicode,name)
+ end
+ setmathsymbol(name,engine,family,unicode,stretch,group)
+ else
+ name = (class == classes.ordinary or class == classes.digit) and character.adobename -- bad
+ if name and trace_defining then
+ report(engine,family,unicode,name)
+ end
+ end
+ if not done then
+ mset, dset = setmathcharacter(engine,family,unicode,m.unicode or unicode,mset,dset,group) -- see solidus
+ done = true
+ end
+ end
+ end
+ else
+ if class then
+ class = classes[class] or ordinary_class
+ else
+ class = ordinary_class
+ end
+ if name ~= nil then
+ local engine = toengineclass(class)
+ if name == false then
+ if trace_defining then
+ report(engine,family,unicode,name)
+ end
+ mset, dset = setmathcharacter(engine,family,unicode,unicode,mset,dset,group)
+ else
+ -- if not name then
+ -- name = character.contextname -- too dangerous, we loose textslash and a few more
+ -- end
+ if name then
+ if trace_defining then
+ report(engine,family,unicode,name)
+ end
+ setmathsymbol(name,engine,family,unicode,stretch,group)
+ else
+ if trace_defining then
+ report(engine,family,unicode,character.adobename)
+ end
+ end
+ mset, dset = setmathcharacter(engine,family,unicode,unicode,mset,dset,group)
+ end
+ elseif class ~= ordinary_class then
+ local engine = toengineclass(class)
+ if trace_defining then
+ report(engine,family,unicode,character.adobename)
+ end
+ mset, dset = setmathcharacter(engine,family,unicode,unicode,mset,dset,group)
+ end
+ end
+ end
+ --
+ if trace_defining then
+ logs.stopfilelogging()
+ end
+ end
+
+end
+
+-- needed for mathml analysis
+-- string with # > 1 are invalid
+-- we could cache
+
+do
+
+ local lpegmatch = lpeg.match
+ local utf8byte = lpeg.patterns.utf8byte * lpeg.P(-1)
+
+ -- function somechar(c)
+ -- local b = lpegmatch(utf8byte,c)
+ -- return b and chardata[b]
+ -- end
+
+ local somechar = table.setmetatableindex(function(t,k)
+ if k then
+ local b = lpegmatch(utf8byte,k)
+ local v = b and chardata[b] or false
+ t[k] = v
+ return v
+ end
+ end)
+
+ local function utfmathclass(chr, default)
+ local cd = somechar[chr]
+ return cd and cd.mathclass or default or "unknown"
+ end
+
+ local function utfmathlimop(chr)
+ local cd = somechar[chr]
+ return cd and cd.mathclass == "limop" or false
+ end
+
+ local function utfmathaccent(chr,default,asked1,asked2)
+ local cd = somechar[chr]
+ if not cd then
+ return default or false
+ end
+ if asked1 and asked1 ~= "" then
+ local mc = cd.mathclass
+ if mc and (mc == asked1 or mc == asked2) then
+ return true
+ end
+ local ms = cd.mathspec
+ if not ms then
+ local mp = cd.mathparent
+ if mp then
+ ms = chardata[mp].mathspec
+ end
+ end
+ if ms then
+ for i=1,#ms do
+ local msi = ms[i]
+ local mc = msi.class
+ if mc and (mc == asked1 or mc == asked2) then
+ return true
+ end
+ end
+ end
+ else
+ local mc = cd.mathclass
+ if mc then
+ return accents[mc] or default or false
+ end
+ local ms = cd.mathspec
+ if ms then
+ for i=1,#ms do
+ local msi = ms[i]
+ local mc = msi.class
+ if mc then
+ return accents[mc] or default or false
+ end
+ end
+ end
+ end
+ return default or false
+ end
+
+ local function utfmathstretch(chr,default) -- "h", "v", "b", ""
+ local cd = somechar[chr]
+ return cd and cd.mathstretch or default or ""
+ end
+
+ local function utfmathcommand(chr,default,asked1,asked2)
+ local cd = somechar[chr]
+ if not cd then
+ return default or ""
+ end
+ if asked1 then
+ local mn = cd.mathname
+ local mc = cd.mathclass
+ if mn and mc and (mc == asked1 or mc == asked2) then
+ return mn
+ end
+ local ms = cd.mathspec
+ if not ms then
+ local mp = cd.mathparent
+ if mp then
+ ms = chardata[mp].mathspec
+ end
+ end
+ if ms then
+ for i=1,#ms do
+ local msi = ms[i]
+ local mn = msi.name
+ if mn then
+ local mc = msi.class
+ if mc == asked1 or mc == asked2 then
+ return mn
+ end
+ end
+ end
+ end
+ else
+ local mn = cd.mathname
+ if mn then
+ return mn
+ end
+ local ms = cd.mathspec
+ if ms then
+ for i=1,#ms do
+ local msi = ms[i]
+ local mn = msi.name
+ if mn then
+ return mn
+ end
+ end
+ end
+ end
+ return default or ""
+ end
+
+ local function utfmathfiller(chr, default)
+ local cd = somechar[chr]
+ local cmd = cd and cd.mathfiller -- or cd.mathname
+ return cmd or default or ""
+ end
+
+ mathematics.utfmathclass = utfmathclass
+ mathematics.utfmathstretch = utfmathstretch
+ mathematics.utfmathcommand = utfmathcommand
+ mathematics.utfmathfiller = utfmathfiller
+ mathematics.utfmathaccent = utfmathaccent
+
+ -- interfaced
+
+ implement {
+ name = "utfmathclass",
+ public = true,
+ actions = { utfmathclass, context },
+ arguments = "argument"
+ }
+
+ implement {
+ name = "utfmathstretch",
+ public = true,
+ actions = { utfmathstretch, context },
+ arguments = "argument"
+ }
+
+ implement {
+ name = "utfmathcommand",
+ public = true,
+ actions = { utfmathcommand, context },
+ arguments = "argument"
+ }
+
+ implement {
+ name = "utfmathfiller",
+ public = true,
+ actions = { utfmathfiller, context },
+ arguments = "argument"
+ }
+
+ implement {
+ name = "utfmathcommandabove",
+ public = true,
+ actions = { utfmathcommand, context },
+ arguments = { "argument", false, "'topaccent'","'over'" }
+ }
+
+ implement {
+ name = "utfmathcommandbelow",
+ public = true,
+ actions = { utfmathcommand, context },
+ arguments = { "argument", false, "'bottomaccent'","'under'" }
+ }
+
+ implement {
+ name = "utfmathcommandfiller",
+ public = true,
+ actions = { utfmathfiller, context },
+ arguments = "argument"
+ }
+
+ -- todo: make this a helper:
+
+ implement {
+ name = "doifelseutfmathabove",
+ public = true,
+ actions = { utfmathaccent, ctx_doifelsesomething },
+ arguments = { "argument", false, "'topaccent'", "'over'" }
+ }
+
+ implement {
+ name = "doifelseutfmathbelow",
+ public = true,
+ actions = { utfmathaccent, ctx_doifelsesomething },
+ arguments = { "argument", false, "'bottomaccent'", "'under'" }
+ }
+
+ implement {
+ name = "doifelseutfmathaccent",
+ public = true,
+ actions = { utfmathaccent, ctx_doifelsesomething },
+ arguments = "argument",
+ }
+
+ implement {
+ name = "doifelseutfmathfiller",
+ public = true,
+ actions = { utfmathfiller, ctx_doifelsesomething },
+ arguments = "argument",
+ }
+
+ implement {
+ name = "doifelseutfmathlimop",
+ public = true,
+ actions = { utfmathlimop, ctx_doifelsesomething },
+ arguments = "argument"
+ }
+
+end
+
+-- helpers
+--
+-- 1: step 1
+-- 2: step 2
+-- 3: htdp * 1.33^n
+-- 4: size * 1.33^n
+-- 5: use lfg
+
+function mathematics.big(tfmdata,unicode,n,method)
+ local t = tfmdata.characters
+ local c = t[unicode]
+ if c and n > 0 then
+ if method == 1 or method == 2 or method == 5 then
+ if method == 5 then
+ local b = tfmdata.bigslots
+ if b then
+ n = (n > #b and b[#b]) or b[n] or n
+ end
+ elseif method == 2 then -- large steps
+ n = n * 2
+ end
+ local next = c.next
+ while next do
+ if n <= 1 then
+ return next
+ else
+ n = n - 1
+ local tn = t[next].next
+ if tn then
+ next = tn
+ else
+ return next
+ end
+ end
+ end
+ elseif method >= 3 then
+ local size = 1.33^n
+ if method == 4 then
+ size = tfmdata.parameters.size * size
+ else -- if method == 3 then
+ size = (c.height + c.depth) * size
+ end
+ local next = c.next
+ while next do
+ local cn = t[next]
+ if (cn.height + cn.depth) >= size then
+ return next
+ else
+ local tn = cn.next
+ if tn then
+ next = tn
+ else
+ return next
+ end
+ end
+ end
+ end
+ end
+ return unicode
+end
+
+do -- experimental
+
+ -- local categories = { } -- indexed + hashed
+ --
+ -- local a_mathcategory = attributes.private("mathcategory")
+ --
+ -- local function registercategory(category,tag,data) -- always same data for tag
+ -- local c = categories[category]
+ -- if not c then
+ -- c = { }
+ -- categories[category] = c
+ -- end
+ -- local n = c[tag]
+ -- if not n then
+ -- n = #c + 1
+ -- c[n] = data
+ -- n = n * 1000 + category
+ -- c[tag] = n
+ -- end
+ -- return n
+ -- end
+ --
+ -- function mathematics.getcategory(n)
+ -- local category = n % 1000
+ -- return category, categories[category][floor(n/1000)]
+ -- end
+ --
+ -- mathematics.registercategory = registercategory
+ --
+ -- function commands.taggedmathfunction(tag,label)
+ -- if label then
+ -- texsetattribute(a_mathcategory,registercategory(1,tag,tag))
+ -- context.mathlabeltext(tag)
+ -- else
+ -- texsetattribute(a_mathcategory,1)
+ -- context(tag)
+ -- end
+ -- end
+
+ local categories = { }
+ mathematics.categories = categories
+
+ local a_mathcategory = attributes.private("mathcategory")
+
+ local functions = storage.allocate()
+ categories.functions = functions
+ local noffunctions = 1000 -- offset
+
+ implement {
+ name = "tagmfunctiontxt",
+ arguments = { "string", "conditional" },
+ actions = function(tag,apply)
+ local delta = apply and 1000 or 0
+ texsetattribute(a_mathcategory,1000 + delta)
+ end
+ }
+
+ implement {
+ name = "tagmfunctionlab",
+ arguments = { "string", "conditional" },
+ actions = function(tag,apply)
+ local delta = apply and 1000 or 0
+ local n = functions[tag]
+ if not n then
+ noffunctions = noffunctions + 1
+ functions[noffunctions] = tag
+ functions[tag] = noffunctions
+ texsetattribute(a_mathcategory,noffunctions + delta)
+ else
+ texsetattribute(a_mathcategory,n + delta)
+ end
+ end
+ }
+
+end
+
+do
+
+ local list
+
+ function mathematics.resetattributes()
+ if not list then
+ list = { }
+ for k, v in next, attributes.numbers do
+ if find(k,"^math") then
+ list[#list+1] = v
+ end
+ end
+ end
+ for i=1,#list do
+ texsetattribute(list[i],unsetvalue)
+ end
+ end
+
+end
+
+implement {
+ name = "resetmathattributes",
+ public = true,
+ protected = true,
+ actions = mathematics.resetattributes
+}
+
+-- weird to do this here but it's a side affect of math anyway
+
+implement {
+ name = "enableasciimode",
+ onlyonce = true,
+ actions = resolvers.macros.enablecomment,
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/math-ini.mkxl
index 9f541c3512b..c76d7313a35 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/math-ini.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-ini.mkxl
@@ -3,7 +3,7 @@
%D version=2008.01.02,
%D title=\CONTEXT\ Math Macros,
%D subtitle=Initializations,
-%D author=Hans Hagen,
+%D author={Hans Hagen \& Mikael Sundqvist},
%D date=\currentdate,
%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
@@ -13,70 +13,715 @@
\writestatus{loading}{ConTeXt Math Macros / Initializations}
-% todo: hpack as we skip math anyway
-%
-% todo: 0x2061 : function application
-% todo: 0x2062 : invisible times
-% todo: 0x2063 : invisible comma
+%D This is the \LMTX\ version of math support what evolved over decades. We started
+%D out with native display math, battled for years with the heuristic spacing,
+%D assumptions wrt number locations etc. Advanced alignments were implemented with
+%D the help of Aditya. In \MKIV\ everything got upgraded, and we ended up with three
+%D models for spacing and numbering: traditional (display), improved (using some
+%D \LUATEX\ control options), and future (using emulated display) where we also
+%D could handle multi|-|line formulas well. As \LUAMETATEX\ evolved it became clear
+%D that we should drop the first two models completely and stick to the emulated
+%D display mode combined with the ability to format multi|-|line formulas in greater
+%D detail.
+%D
+%D One can wonder what this does with compatibility. Of course we try to be
+%D interface compatible but better micro typography spacing has consequences.
+%D However, in practice it looks like we get better results without too many side
+%D effects. Also, we're not bound to for instance \AMS\ math because \CONTEXT\ is
+%D not used by scientific publishers. In fact over the 15 plus years of development
+%D (2022), no professional publisher (or large scale \TEX\ user) ever expressed
+%D interest in \LUATEX\ and \LUAMETATEX, definitely not in relation to math, which
+%D made it even more easy to upgrade the engine as well as \CONTEXT\ math and over
+%D time users have demonstrated to appreciate improvements. We can do as we like, as
+%D long as users like it too. It's with that mindset that Mikael Sundqvist and I
+%D undertook this effort which took a year to mature. It started out with
+%D implementing advanced spacing models based on inter|-|atom properties and control
+%D but stepwise more got added and improved. We also settled on the fact that fonts
+%D will never be perfect and that we need runtime fixing. That took some work but in
+%D the end put less burden on the engine.
+%D
+%D After an extremely short discussion MS and HH decided that we will not support
+%D \quote {BS ISO 80000-2:2009} because it doesn't comply to the CMS quality
+%D standards and is BS anyway.
+
+%D Musical timestamp for the April 2022 math (inline) snapping sub activity: eNerdâ´
+%D Time Capsule 2020 a.k.a. Farewell Party for Normalcy (DSD on the squeezebox with
+%D a proper DAC connected but it can hardly keep up which also counts for me with MS
+%D testing faster than I can provide variants (www.youtube.com/watch?v=xzQCqAJNOSM).
+
+\unprotect
-% a bit tricky way to set ... no (pseudo) registers but math hash values:
+\newdimension \mathstrutht
+\newdimension \mathstrutdp
+\newinteger \mathnestinglevel
+
+\newcount \c_strc_math_n_of_lines
+\newdimension \d_strc_math_max_width
+\newdimension \d_strc_math_first_width
+\newdimension \d_strc_math_last_width
+\newdimension \d_strc_math_first_height
+\newdimension \d_strc_math_last_depth
+\newdimension \d_strc_math_display_width
+\newdimension \d_strc_math_indent
+\newconditional\c_strc_math_indent
+
+\registerctxluafile{math-ini}{autosuffix}
+\registerctxluafile{math-dim}{autosuffix}
+%registerctxluafile{math-act}{autosuffix}
+\registerctxluafile{math-ext}{autosuffix} % might go
+\registerctxluafile{math-vfu}{autosuffix}
+\registerctxluafile{math-ttv}{autosuffix}
+\registerctxluafile{math-map}{autosuffix}
+\registerctxluafile{math-act}{autosuffix}
+\registerctxluafile{math-ren}{autosuffix}
+\registerctxluafile{math-noa}{autosuffix}
+\registerctxluafile{math-tag}{autosuffix}
+\registerctxluafile{math-fbk}{autosuffix}
+%registerctxluafile{math-dir}{autosuffix}
+\registerctxluafile{math-spa}{autosuffix}
+\registerctxluafile{math-fnt}{autosuffix}
+\registerctxluafile{math-pre}{autosuffix}
+
+%D Basic spacing:
+
+% \mathfencesmode \plusone % gone
+
+\delimiterfactor \plusthousand
+\delimitershortfall \zeropoint
+
+% These need to be set because otherwise the engine will not honor some font
+% properties. It also permits tracing. These might become engine defaults. As a
+% consequence we no longer check for traditional fonts but one can use font control
+% options.
+
+% \mathcontrolmode\plusone
+
+\mathfontcontrol\numexpr
+ \zerocount
+ +\overrulemathcontrolcode % let the node family/font win over current family/font
+ +\underrulemathcontrolcode % idem
+ +\radicalrulemathcontrolcode % idem
+ +\fractionrulemathcontrolcode % idem
+ +\accentskewhalfmathcontrolcode % fall back to half width skewing when no topaccent is given
+ +\accentskewapplymathcontrolcode % use topaccent, otherwise use skew char
+ +\applyordinarykernpairmathcontrolcode % old fonts
+ +\applyverticalitalickernmathcontrolcode % best do this indeed
+ +\applyordinaryitalickernmathcontrolcode % best do this indeed
+ % +\applycharitalickernmathcontrolcode % not done
+ % +\reboxcharitalickernmathcontrolcode % old code path
+ +\applyboxeditalickernmathcontrolcode % best do this indeed
+ +\staircasekernmathcontrolcode % use these when set
+ +\applytextitalickernmathcontrolcode
+ +\checktextitalickernmathcontrolcode
+ % +\checkspaceitalickernmathcontrolcode % old code path
+ +\applyscriptitalickernmathcontrolcode
+ % +\italicshapekernmathcontrolcode % obsolete: instead of adding pre italic to the shift, inject a kern
+ +\analyzescriptnucleuscharmathcontrolcode
+ +\analyzescriptnucleuslistmathcontrolcode
+ +\analyzescriptnucleusboxmathcontrolcode
+ +\accenttopskewwithoffsetmathcontrolcode
+ % +\ignorekerndimensionsmathcontrolcode % xits needs this (bad depth of fences)
+ % +\ignoreflataccentsmathcontrolcode
+ +\extendaccentsmathcontrolcode
+ +\extenddelimitersmathcontrolcode
+\relax
+
+% \mathpenaltiesmode\plusone
+
+% These are frozen values because otherwise we need to sync them when the predefined
+% muskip (internal) registers are changed.
+
+\immutable\mugluespecdef\defaultthickermuskip 7mu plus 5mu
+\immutable\mugluespecdef\defaultthickmuskip 5mu plus 3mu minus 1mu
+\immutable\mugluespecdef\defaultmedmuskip 4mu plus 2mu minus 2mu
+\immutable\mugluespecdef\defaultthinmuskip 3mu
+\immutable\mugluespecdef\defaulttinymuskip 2mu minus 1mu
+\immutable\mugluespecdef\defaultpettymuskip 1mu minus 0.5mu
+
+\immutable\mugluespecdef\halfthickmuskip 2.5mu plus 1.5mu minus 0.5mu
+\immutable\mugluespecdef\halfmedmuskip 2mu plus 1mu minus 1mu
+\immutable\mugluespecdef\halfthinmuskip 1.5mu
+\immutable\mugluespecdef\halftinymuskip 1mu minus 0.5mu
+\immutable\mugluespecdef\halfpettymuskip 0.5mu minus 0.25mu
+
+\immutable\mugluespecdef\hairmuskip .15mu
+
+\immutable\integerdef \defaultrelpenalty 500
+\immutable\integerdef \defaultbinoppenalty 700
+\immutable\integerdef \defaultprerelpenalty -100
+\immutable\integerdef \defaultprebinoppenalty -100
+
+\newmuskip\thickermuskip \thickermuskip \defaultthickermuskip
+
+% Beware: we don't support mathinner any longer. We do have construct, wrapper, ellipsis etc
+% as replacements and all inner spacing is basically unset.
+
+\setnewconstant\mathunsetcode \mathclassvalue unset
+
+\setnewconstant\mathordinarycode \mathclassvalue ordinary \aliased\let\mathordcode \mathordinarycode
+\setnewconstant\mathoperatorcode \mathclassvalue operator \aliased\let\mathopcode \mathoperatorcode
+\setnewconstant\mathbinarycode \mathclassvalue binary \aliased\let\mathbincode \mathbinarycode
+\setnewconstant\mathrelationcode \mathclassvalue relation \aliased\let\mathrelcode \mathrelationcode
+\setnewconstant\mathopencode \mathclassvalue open
+\setnewconstant\mathclosecode \mathclassvalue close
+\setnewconstant\mathpunctuationcode \mathclassvalue punctuation \aliased\let\mathpunctcode\mathpunctuationcode
+\setnewconstant\mathinnercode \mathclassvalue inner
+\setnewconstant\mathovercode \mathclassvalue over
+\setnewconstant\mathundercode \mathclassvalue under
+\setnewconstant\mathfractioncode \mathclassvalue fraction
+\setnewconstant\mathradicalcode \mathclassvalue radical
+\setnewconstant\mathmiddlecode \mathclassvalue middle
+\setnewconstant\mathaccentcode \mathclassvalue accent
+\setnewconstant\mathfencedcode \mathclassvalue fenced % unlikely to be seen but can be used
+\setnewconstant\mathghostcode \mathclassvalue ghost % transparent for classes
+\setnewconstant\mathvariablecode \mathclassvalue variable
+\setnewconstant\mathactivecode \mathclassvalue active
+\setnewconstant\mathvcentercode \mathclassvalue vcenter
+\setnewconstant\mathimaginarycode \mathclassvalue imaginary
+\setnewconstant\mathdifferentialcode \mathclassvalue differential
+\setnewconstant\mathexponentialcode \mathclassvalue exponential
+\setnewconstant\mathellipsiscode \mathclassvalue ellipsis % replacement for inner
+\setnewconstant\mathfunctioncode \mathclassvalue function
+\setnewconstant\mathdigitcode \mathclassvalue digit
+\setnewconstant\mathexplicitcode \mathclassvalue explicit % only for for control
+\setnewconstant\mathdivisioncode \mathclassvalue division
+\setnewconstant\mathfactorialcode \mathclassvalue factorial
+\setnewconstant\mathwrappedcode \mathclassvalue wrapped % replacement for inner
+\setnewconstant\mathconstructcode \mathclassvalue construct % replacement for inner
+\setnewconstant\mathdimensioncode \mathclassvalue dimension
+\setnewconstant\mathtextpunctuationcode \mathclassvalue textpunctuation % for punctuation in text font followed by interword spacing
+\setnewconstant\mathunspacedcode \mathclassvalue unspaced % for cases where we don't want spacing at all
+\setnewconstant\mathexperimentalcode \mathclassvalue experimental % for MS and HH testing purposed only
+\setnewconstant\mathunarycode \mathclassvalue unary % dedicated to Alan
+\setnewconstant\mathnumbergroupcode \mathclassvalue numbergroup
+
+\setnewconstant\mathbegincode \mathclassvalue begin
+\setnewconstant\mathendcode \mathclassvalue end
+\setnewconstant\mathallcode \mathclassvalue all
+\setnewconstant\mathfakecode \mathclassvalue fake
+
+%D \starttyping
+%D \enabletrackers[math.suspicious]
+%D
+%D \Umathchardef \foo \mathmaybeordinarycode 0 `o
+%D \Umathchardef \oof \mathmayberelationcode 0 `=
+%D \Umathchardef \ofo \mathmaybebinarycode 0 `+
+%D
+%D \starttext
+%D $ \foo _ 1 \ofo \foo _ 2 \oof \foo _ 3 + 4 $
+%D \stoptext
+%D \stoptyping
+%D
+%D Gives:
+%D
+%D \starttyping
+%D mathematics > suspicious > class 36, U+1D45C ð‘œ
+%D mathematics > suspicious > class 38, U+0002B +
+%D mathematics > suspicious > class 37, U+0003D =
+%D \stoptyping
+
+\setnewconstant\mathmaybeordinarycode \mathclassvalue maybeordinary
+\setnewconstant\mathmayberelationcode \mathclassvalue mayberelation
+\setnewconstant\mathmaybebinarycode \mathclassvalue maybebinary
+
+%setnewconstant\mathtopaccentcode \mathclassvalue topaccent % these are private and above 31
+%setnewconstant\mathbottomaccentcode \mathclassvalue bottomaccent % these are private and above 31
+%setnewconstant\mathdelimitercode \mathclassvalue delimiter % these are private and above 31
+%setnewconstant\mathrootcode \mathclassvalue root % these are private and above 31
+%setnewconstant\mathprimecode \mathclassvalue prime % these are private and above 31
+
+%letmathspacing \mathimaginarycode \mathordinarycode \mathordinarycode \mathordinarycode \mathordinarycode
+%letmathspacing \mathdifferentialcode \mathordinarycode \mathordinarycode \mathordinarycode \mathordinarycode
+%letmathspacing \mathexponentialcode \mathordinarycode \mathordinarycode \mathordinarycode \mathordinarycode
+%letmathspacing \mathfunctioncode \mathordinarycode \mathordinarycode \mathordinarycode \mathordinarycode
+%letmathspacing \mathdigitcode \mathordinarycode \mathordinarycode \mathordinarycode \mathordinarycode
+
+\copymathspacing \mathimaginarycode \mathordinarycode
+\copymathspacing \mathdifferentialcode \mathordinarycode
+\copymathspacing \mathfactorialcode \mathordinarycode
+\copymathspacing \mathexponentialcode \mathordinarycode
+\copymathspacing \mathdigitcode \mathordinarycode
+\copymathspacing \mathfunctioncode \mathoperatorcode
+\copymathspacing \mathwrappedcode \mathfractioncode
+\copymathspacing \mathunarycode \mathordinarycode
+
+\copymathspacing \mathmaybeordinarycode \mathordinarycode
+\copymathspacing \mathmayberelationcode \mathrelationcode
+\copymathspacing \mathmaybebinarycode \mathbinarycode
+
+%copymathspacing \mathnumbergroupcode \mathpunctuationcode
+\copymathspacing \mathnumbergroupcode \mathrelationcode % for now
+
+\setnewconstant\mathlimopcode \plusone
+\setnewconstant\mathnolopcode \plusone
+
+%untraced\protected\def\mathordinary {\mathatom \s!class \mathordinarycode } % use \mathord
+%untraced\protected\def\mathoperator {\mathatom \s!class \mathoperatorcode } % use \mathop
+%untraced\protected\def\mathbinary {\mathatom \s!class \mathbinarycode } % use \mathbin
+%untraced\protected\def\mathrelation {\mathatom \s!class \mathrelationcode } % use \mathrel
+%untraced\protected\def\mathopen {\mathatom \s!class \mathopencode } % primitive
+%untraced\protected\def\mathclose {\mathatom \s!class \mathclosecode } % primitive
+%untraced\protected\def\mathpunctuation {\mathatom \s!class \mathpunctuationcode } % use \mathpunct
+%untraced\protected\def\mathinner {\mathatom \s!class \mathinnercode } % primitive
+%untraced\protected\def\mathover {\mathatom \s!class \mathovercode } % macro
+%untraced\protected\def\mathunder {\mathatom \s!class \mathundercode } % macro
+%untraced\protected\def\mathfraction {\mathatom \s!class \mathfractioncode } % use \mathfrac
+%untraced\protected\def\mathradical {\mathatom \s!class \mathradicalcode } % use \mathrad
+%untraced\protected\def\mathmiddle {\mathatom \s!class \mathmiddlecode } % primitive
+%untraced\protected\def\mathaccent {\mathatom \s!class \mathaccentcode } % primitive
+%untraced\protected\def\mathfenced {\mathatom \s!class \mathfencedcode } % primitive
+%untraced\protected\def\mathghost {\mathatom \s!class \mathghostcode } % primitive
+%untraced\protected\def\mathvariable {\mathatom \s!class \mathvariablecode } % useless
+%untraced\protected\def\mathactive {\mathatom \s!class \mathactivecode } % useless
+%untraced\protected\def\mathvcenter {\mathatom \s!class \mathvcentercode } % useless
+\untraced\protected\def\mathimaginary {\mathatom \s!class \mathimaginarycode }
+\untraced\protected\def\mathdifferential{\mathatom \s!class \mathdifferentialcode}
+\untraced\protected\def\mathexponential {\mathatom \s!class \mathexponentialcode }
+%untraced\protected\def\mathfunction {\mathatom \s!class \mathfunctioncode } % macro
+\untraced\protected\def\mathdigit {\mathatom \s!class \mathdigitcode }
+%untraced\protected\def\mathexplicit {\mathatom \s!class \mathexplicitcode } % dangerous
+\untraced\protected\def\mathdivision {\mathatom \s!class \mathdivisioncode }
+\untraced\protected\def\mathfactorial {\mathatom \s!class \mathfactorialcode }
+\untraced\protected\def\mathwrapped {\mathatom \s!class \mathwrappedcode }
+\untraced\protected\def\mathconstruct {\mathatom \s!class \mathconstructcode }
+\untraced\protected\def\mathdimension {\mathatom \s!class \mathdimensioncode }
+%untraced\protected\def\mathbegin {\mathatom \s!class \mathbegincode } % dangerous
+%untraced\protected\def\mathend {\mathatom \s!class \mathendcode } % dangerous
+\untraced\protected\def\mathunary {\mathatom \s!class \mathunarycode }
+
+% obsolete
+
+\setnewconstant\mathboxcode \zerocount
+\setnewconstant\mathchoicecode \zerocount
+\setnewconstant\mathalphacode \zerocount
+\setnewconstant\mathnothingcode \zerocount
+
+%D At some point we will drop these in the \LUAMETATEX\ engine becuase we have many
+%D more options there.
+
+\pushoverloadmode
+ \untraced\permanent\protected\def\binoppenalty {\setmathpostpenalty\mathbinarycode}
+ \untraced\permanent\protected\def\prebinoppenalty{\setmathprepenalty \mathbinarycode}
+ \untraced\permanent\protected\def\relpenalty {\setmathpostpenalty\mathrelationcode}
+ \untraced\permanent\protected\def\prerelpenalty {\setmathprepenalty \mathrelationcode}
+\popoverloadmode
+
+% %D These verbose commands are obsolete because there are plenty more classes in
+% %D \LMTX\ than in \MKIV.
+%
+% \permanent\protected\def\ordordspacing {\setmathspacing \mathordinarycode \mathordinarycode }
+% \permanent\protected\def\ordopspacing {\setmathspacing \mathordinarycode \mathoperatorcode }
+% \permanent\protected\def\ordbinspacing {\setmathspacing \mathordinarycode \mathbinarycode }
+% \permanent\protected\def\ordrelspacing {\setmathspacing \mathordinarycode \mathrelationcode }
+% \permanent\protected\def\ordopenspacing {\setmathspacing \mathordinarycode \mathopencode }
+% \permanent\protected\def\ordclosespacing {\setmathspacing \mathordinarycode \mathclosecode }
+% \permanent\protected\def\ordpunctspacing {\setmathspacing \mathordinarycode \mathpunctuationcode}
+% %permanent\protected\def\ordinnerspacing {\setmathspacing \mathordinarycode \mathinnercode }
+% %permanent\protected\def\ordfractionspacing {\setmathspacing \mathordinarycode \mathfractioncode }
+% %permanent\protected\def\ordradicalspacing {\setmathspacing \mathordinarycode \mathradicalcode }
+% \permanent\protected\def\ordmiddlespacing {\setmathspacing \mathordinarycode \mathmiddlecode }
+% %permanent\protected\def\ordaccentspacing {\setmathspacing \mathordinarycode \mathaccentcode }
+%
+% \permanent\protected\def\opordspacing {\setmathspacing \mathoperatorcode \mathordinarycode }
+% \permanent\protected\def\opopspacing {\setmathspacing \mathoperatorcode \mathoperatorcode }
+% \permanent\protected\def\opbinspacing {\setmathspacing \mathoperatorcode \mathbinarycode }
+% \permanent\protected\def\oprelspacing {\setmathspacing \mathoperatorcode \mathrelationcode }
+% \permanent\protected\def\opopenspacing {\setmathspacing \mathoperatorcode \mathopencode }
+% \permanent\protected\def\opclosespacing {\setmathspacing \mathoperatorcode \mathclosecode }
+% \permanent\protected\def\oppunctspacing {\setmathspacing \mathoperatorcode \mathpunctuationcode}
+% %permanent\protected\def\opinnerspacing {\setmathspacing \mathoperatorcode \mathinnercode }
+% %permanent\protected\def\opfractionspacing {\setmathspacing \mathoperatorcode \mathfractioncode }
+% %permanent\protected\def\opradicalspacing {\setmathspacing \mathoperatorcode \mathradicalcode }
+% \permanent\protected\def\opmiddlespacing {\setmathspacing \mathoperatorcode \mathmiddlecode }
+% %permanent\protected\def\opaccentspacing {\setmathspacing \mathoperatorcode \mathaccentcode }
+%
+% \permanent\protected\def\binordspacing {\setmathspacing \mathbinarycode \mathordinarycode }
+% \permanent\protected\def\binopspacing {\setmathspacing \mathbinarycode \mathoperatorcode }
+% \permanent\protected\def\binbinspacing {\setmathspacing \mathbinarycode \mathbinarycode }
+% \permanent\protected\def\binrelspacing {\setmathspacing \mathbinarycode \mathrelationcode }
+% \permanent\protected\def\binopenspacing {\setmathspacing \mathbinarycode \mathopencode }
+% \permanent\protected\def\binclosespacing {\setmathspacing \mathbinarycode \mathclosecode }
+% \permanent\protected\def\binpunctspacing {\setmathspacing \mathbinarycode \mathpunctuationcode}
+% %permanent\protected\def\bininnerspacing {\setmathspacing \mathbinarycode \mathinnercode }
+% %permanent\protected\def\binfractionspacing {\setmathspacing \mathbinarycode \mathfractioncode }
+% %permanent\protected\def\binradicalspacing {\setmathspacing \mathbinarycode \mathradicalcode }
+% \permanent\protected\def\binmiddlespacing {\setmathspacing \mathbinarycode \mathmiddlecode }
+% %permanent\protected\def\binaccentspacing {\setmathspacing \mathbinarycode \mathaccentcode }
%
-% \normalexpanded{\Umathlimitabovevgap\displaystyle=40\dimexpr\the\Umathlimitabovevgap\displaystyle\relax}
+% \permanent\protected\def\relordspacing {\setmathspacing \mathrelationcode \mathordinarycode }
+% \permanent\protected\def\relopspacing {\setmathspacing \mathrelationcode \mathoperatorcode }
+% \permanent\protected\def\relbinspacing {\setmathspacing \mathrelationcode \mathbinarycode }
+% \permanent\protected\def\relrelspacing {\setmathspacing \mathrelationcode \mathrelationcode }
+% \permanent\protected\def\relopenspacing {\setmathspacing \mathrelationcode \mathopencode }
+% \permanent\protected\def\relclosespacing {\setmathspacing \mathrelationcode \mathclosecode }
+% \permanent\protected\def\relpunctspacing {\setmathspacing \mathrelationcode \mathpunctuationcode}
+% %permanent\protected\def\relinnerspacing {\setmathspacing \mathrelationcode \mathinnercode }
+% %permanent\protected\def\relfractionspacing {\setmathspacing \mathrelationcode \mathfractioncode }
+% %permanent\protected\def\relradicalspacing {\setmathspacing \mathrelationcode \mathradicalcode }
+% \permanent\protected\def\relmiddlespacing {\setmathspacing \mathrelationcode \mathmiddlecode }
+% %permanent\protected\def\relaccentspacing {\setmathspacing \mathrelationcode \mathaccentcode }
+%
+% \permanent\protected\def\openordspacing {\setmathspacing \mathopencode \mathordinarycode }
+% \permanent\protected\def\openopspacing {\setmathspacing \mathopencode \mathoperatorcode }
+% \permanent\protected\def\openbinspacing {\setmathspacing \mathopencode \mathbinarycode }
+% \permanent\protected\def\openrelspacing {\setmathspacing \mathopencode \mathrelationcode }
+% \permanent\protected\def\openopenspacing {\setmathspacing \mathopencode \mathopencode }
+% \permanent\protected\def\openclosespacing {\setmathspacing \mathopencode \mathclosecode }
+% \permanent\protected\def\openpunctspacing {\setmathspacing \mathopencode \mathpunctuationcode}
+% %permanent\protected\def\openinnerspacing {\setmathspacing \mathopencode \mathinnercode }
+% %permanent\protected\def\openfractionspacing {\setmathspacing \mathopencode \mathfractioncode }
+% %permanent\protected\def\openradicalspacing {\setmathspacing \mathopencode \mathradicalcode }
+% \permanent\protected\def\openmiddlespacing {\setmathspacing \mathopencode \mathmiddlecode }
+% %permanent\protected\def\openaccentspacing {\setmathspacing \mathopencode \mathaccentcode }
+%
+% \permanent\protected\def\closeordspacing {\setmathspacing \mathclosecode \mathordinarycode }
+% \permanent\protected\def\closeopspacing {\setmathspacing \mathclosecode \mathoperatorcode }
+% \permanent\protected\def\closebinspacing {\setmathspacing \mathclosecode \mathbinarycode }
+% \permanent\protected\def\closerelspacing {\setmathspacing \mathclosecode \mathrelationcode }
+% \permanent\protected\def\closeopenspacing {\setmathspacing \mathclosecode \mathopencode }
+% \permanent\protected\def\closeclosespacing {\setmathspacing \mathclosecode \mathclosecode }
+% \permanent\protected\def\closepunctspacing {\setmathspacing \mathclosecode \mathpunctuationcode}
+% %permanent\protected\def\closeinnerspacing {\setmathspacing \mathclosecode \mathinnercode }
+% %permanent\protected\def\closefractionspacing {\setmathspacing \mathclosecode \mathfractioncode }
+% %permanent\protected\def\closeradicalspacing {\setmathspacing \mathclosecode \mathradicalcode }
+% \permanent\protected\def\closemiddlespacing {\setmathspacing \mathclosecode \mathmiddlecode }
+% %permanent\protected\def\closeaccentspacing {\setmathspacing \mathclosecode \mathaccentcode }
+%
+% \permanent\protected\def\punctordspacing {\setmathspacing \mathpunctuationcode \mathordinarycode }
+% \permanent\protected\def\punctopspacing {\setmathspacing \mathpunctuationcode \mathoperatorcode }
+% \permanent\protected\def\punctbinspacing {\setmathspacing \mathpunctuationcode \mathbinarycode }
+% \permanent\protected\def\punctrelspacing {\setmathspacing \mathpunctuationcode \mathrelationcode }
+% \permanent\protected\def\punctopenspacing {\setmathspacing \mathpunctuationcode \mathopencode }
+% \permanent\protected\def\punctclosespacing {\setmathspacing \mathpunctuationcode \mathclosecode }
+% \permanent\protected\def\punctpunctspacing {\setmathspacing \mathpunctuationcode \mathpunctuationcode}
+% %permanent\protected\def\punctinnerspacing {\setmathspacing \mathpunctuationcode \mathinnercode }
+% %permanent\protected\def\punctfractionspacing {\setmathspacing \mathpunctuationcode \mathfractioncode }
+% %permanent\protected\def\punctradicalspacing {\setmathspacing \mathpunctuationcode \mathradicalcode }
+% \permanent\protected\def\punctmiddlespacing {\setmathspacing \mathpunctuationcode \mathmiddlecode }
+% %permanent\protected\def\punctaccentspacing {\setmathspacing \mathpunctuationcode \mathaccentcode }
+%
+% %permanent\protected\def\innerordspacing {\setmathspacing \mathinnercode \mathordinarycode }
+% %permanent\protected\def\inneropspacing {\setmathspacing \mathinnercode \mathoperatorcode }
+% %permanent\protected\def\innerbinspacing {\setmathspacing \mathinnercode \mathbinarycode }
+% %permanent\protected\def\innerrelspacing {\setmathspacing \mathinnercode \mathrelationcode }
+% %permanent\protected\def\inneropenspacing {\setmathspacing \mathinnercode \mathopencode }
+% %permanent\protected\def\innerclosespacing {\setmathspacing \mathinnercode \mathclosecode }
+% %permanent\protected\def\innerpunctspacing {\setmathspacing \mathinnercode \mathpunctuationcode}
+% %permanent\protected\def\innerinnerspacing {\setmathspacing \mathinnercode \mathinnercode }
+% %permanent\protected\def\innerfractionspacing {\setmathspacing \mathinnercode \mathfractioncode }
+% %permanent\protected\def\innerradicalspacing {\setmathspacing \mathinnercode \mathradicalcode }
+% %permanent\protected\def\innermiddlespacing {\setmathspacing \mathinnercode \mathmiddlecode }
+% %permanent\protected\def\inneraccentspacing {\setmathspacing \mathinnercode \mathaccentcode }
+%
+% \permanent\protected\def\fractionordspacing {\setmathspacing \mathfractioncode \mathordinarycode }
+% \permanent\protected\def\fractionopspacing {\setmathspacing \mathfractioncode \mathoperatorcode }
+% \permanent\protected\def\fractionbinspacing {\setmathspacing \mathfractioncode \mathbinarycode }
+% \permanent\protected\def\fractionrelspacing {\setmathspacing \mathfractioncode \mathrelationcode }
+% \permanent\protected\def\fractionopenspacing {\setmathspacing \mathfractioncode \mathopencode }
+% \permanent\protected\def\fractionclosespacing {\setmathspacing \mathfractioncode \mathclosecode }
+% \permanent\protected\def\fractionpunctspacing {\setmathspacing \mathfractioncode \mathpunctuationcode}
+% %permanent\protected\def\fractioninnerspacing {\setmathspacing \mathfractioncode \mathinnercode }
+% %permanent\protected\def\fractionfractionspacing{\setmathspacing \mathfractioncode \mathfractioncode }
+% %permanent\protected\def\fractionradicalspacing {\setmathspacing \mathfractioncode \mathradicalcode }
+% \permanent\protected\def\fractionmiddlespacing {\setmathspacing \mathfractioncode \mathmiddlecode }
+% %permanent\protected\def\fractionaccentspacing {\setmathspacing \mathfractioncode \mathaccentcode }
+%
+% \permanent\protected\def\radicalordspacing {\setmathspacing \mathradicalcode \mathordinarycode }
+% \permanent\protected\def\radicalopspacing {\setmathspacing \mathradicalcode \mathoperatorcode }
+% \permanent\protected\def\radicalbinspacing {\setmathspacing \mathradicalcode \mathbinarycode }
+% \permanent\protected\def\radicalrelspacing {\setmathspacing \mathradicalcode \mathrelationcode }
+% \permanent\protected\def\radicalopenspacing {\setmathspacing \mathradicalcode \mathopencode }
+% \permanent\protected\def\radicalclosespacing {\setmathspacing \mathradicalcode \mathclosecode }
+% \permanent\protected\def\radicalpunctspacing {\setmathspacing \mathradicalcode \mathpunctuationcode}
+% %permanent\protected\def\radicalinnerspacing {\setmathspacing \mathradicalcode \mathinnercode }
+% %permanent\protected\def\radicalfractionspacing {\setmathspacing \mathradicalcode \mathfractioncode }
+% %permanent\protected\def\radicalradicalspacing {\setmathspacing \mathradicalcode \mathradicalcode }
+% \permanent\protected\def\radicalmiddlespacing {\setmathspacing \mathradicalcode \mathmiddlecode }
+% %permanent\protected\def\radicalaccentspacing {\setmathspacing \mathradicalcode \mathaccentcode }
+%
+% \permanent\protected\def\middleordspacing {\setmathspacing \mathmiddlecode \mathordinarycode }
+% \permanent\protected\def\middleopspacing {\setmathspacing \mathmiddlecode \mathoperatorcode }
+% \permanent\protected\def\middlebinspacing {\setmathspacing \mathmiddlecode \mathbinarycode }
+% \permanent\protected\def\middlerelspacing {\setmathspacing \mathmiddlecode \mathrelationcode }
+% \permanent\protected\def\middleopenspacing {\setmathspacing \mathmiddlecode \mathopencode }
+% \permanent\protected\def\middleclosespacing {\setmathspacing \mathmiddlecode \mathclosecode }
+% \permanent\protected\def\middlepunctspacing {\setmathspacing \mathmiddlecode \mathpunctuationcode}
+% %permanent\protected\def\middleinnerspacing {\setmathspacing \mathmiddlecode \mathinnercode }
+% %permanent\protected\def\middlefractionspacing {\setmathspacing \mathmiddlecode \mathfractioncode }
+% %permanent\protected\def\middleradicalspacing {\setmathspacing \mathmiddlecode \mathradicalcode }
+% \permanent\protected\def\middlemiddlespacing {\setmathspacing \mathmiddlecode \mathmiddlecode }
+% %permanent\protected\def\middleaccentspacing {\setmathspacing \mathmiddlecode \mathaccentcode }
+%
+% \permanent\protected\def\accentordspacing {\setmathspacing \mathaccentcode \mathordinarycode }
+% \permanent\protected\def\accentopspacing {\setmathspacing \mathaccentcode \mathoperatorcode }
+% \permanent\protected\def\accentbinspacing {\setmathspacing \mathaccentcode \mathbinarycode }
+% \permanent\protected\def\accentrelspacing {\setmathspacing \mathaccentcode \mathrelationcode }
+% \permanent\protected\def\accentopenspacing {\setmathspacing \mathaccentcode \mathopencode }
+% \permanent\protected\def\accentclosespacing {\setmathspacing \mathaccentcode \mathclosecode }
+% \permanent\protected\def\accentpunctspacing {\setmathspacing \mathaccentcode \mathpunctuationcode}
+% %permanent\protected\def\accentinnerspacing {\setmathspacing \mathaccentcode \mathinnercode }
+% %permanent\protected\def\accentfractionspacing {\setmathspacing \mathaccentcode \mathfractioncode }
+% %permanent\protected\def\accentradicalspacing {\setmathspacing \mathaccentcode \mathradicalcode }
+% \permanent\protected\def\accentmiddlespacing {\setmathspacing \mathaccentcode \mathmiddlecode }
+% %permanent\protected\def\accentaccentspacing {\setmathspacing \mathaccentcode \mathaccentcode }
+
+%D In the end Mikael and I prefer this but we need a high level interface:
+
+% \setmathignore\Umathspacebeforescript \plusone
+% \setmathignore\Umathspaceafterscript \plusone
+% \setmathignore\Umathradicaldegreebefore\plusone % done in math-rad.mklx
+
+\setmathignore \Umathspacebeforescript\zerocount
+\setmathignore \Umathspaceafterscript \zerocount
+
+\mathslackmode \plusone
+\mathgroupingmode \plusone
+%mathdoublescriptmode\zerocount % -1 will give an error (as usual) .. "LLRR (left class, right class)
+
+%D \starttyping
+%D \startTEXpage[offset=1dk]
+%D $ 1 {\red +} 2$\par
+%D $ 1 \color[red]{+} 2$\par
+%D \mathgroupingmode0
+%D $ 1 {\red +} 2$\par
+%D $ 1 \mathbinary{\red +} 2$\par
+%D $ 1 \color[red]{+} 2$\par
+%D \stopTEXpage
+%D \stoptyping
-% Todo in luatex maincontrol.w: also accept a number here:
+% $x ^^1__2 ^3_4 ^5_6 ^7_8 $
+
+\mathdoublescriptmode
+ "\tohexadecimal\mathfakecode
+ \tohexadecimal\mathfakecode
+ \tohexadecimal\mathfakecode
+
+\integerdef\defaultmathclassoptions\numexpr
+ \nopreslackclassoptioncode
+ +\nopostslackclassoptioncode
+ % +\lefttopkernclassoptioncode % applied in a late stage e.g. division
+ % +\righttopkernclassoptioncode % applied in a late stage e.g. division
+ % +\leftbottomkernclassoptioncode % applied in a late stage e.g. division
+ % +\rightbottomkernclassoptioncode % applied in a late stage e.g. division
+ % +\lookaheadforendclassoptioncode % signed whatevers
+ % +\noitaliccorrectionclassoptioncode
+ % +\openfenceclassoptioncode % the engine doesn't really used this property but maybe
+ % +\closefenceclassoptioncode % at some point we want to have to have access to it at
+ % +\middlefenceclassoptioncode % lua end ... so we keep it (also in the engine) commented
+ % +\checkligatureclassoptioncode % no font provides this so it is more a compatibility feature
+ % +\checkkernpairclassoptioncode
+ % +\flattenclassoptioncode
+ % +\omitpenaltyclassoptioncode % old school check, we do pairwise instead
+ % +\carryoverlefttopkernclassoptioncode
+ % +\carryoverleftbottomkernclassoptioncode
+ % +\carryoverrighttopkernclassoptioncode
+ % +\carryoverrightbottomkernclassoptioncode
+ % +\preferdelimiterdimensionsclassoptioncode
+\relax
+
+\setmathoptions\mathordinarycode\numexpr
+ \noitaliccorrectionclassoptioncode
+ % +\checkligatureclassoptioncode
+ +\checkkernpairclassoptioncode
+ % +\flattenclassoptioncode
+\relax
+
+\setmathoptions\mathoperatorcode\numexpr
+ \defaultmathclassoptions
+ % +\checkligatureclassoptioncode
+ +\checkkernpairclassoptioncode
+ % up to Mikael to decide, ok with italic chars, maybe less so with raw ints:
+ % +\operatoritaliccorrectionclassoptioncode
+\relax
+
+% we tweak away weird italics so only special cases see this:
+%
+% \def\IntOr{\Umathchar\mathordinarycode"00"00222B }
+% \def\IntOp{\Umathchar\mathoperatorcode"00"00222B }
+%
+% \showglyphs \showfontitalics
+% $\IntOp\limits x \quad \IntOp\limits^1_2 x \quad \IntOp\nolimits^1_2 x $\blank
+% $\IntOr\limits x \quad \IntOr\limits^1_2 x \quad \IntOr\nolimits^1_2 x $\blank
%
-% case set_math_param_cmd:
-% p = cur_chr;
-% get_token();
-% if (cur_cmd != math_style_cmd) {
+% $\mathop{f} (x) \quad \mathop{f}\limits (x) \quad \mathop{f}\nolimits (x)$\blank
+% $\mathop{f}^a_b (x) \quad \mathop{f}\limits^a_b (x) \quad \mathop{f}\nolimits^a_b (x)$\blank
+
+\setmathoptions\mathbinarycode\numexpr
+ \defaultmathclassoptions
+ +\lookaheadforendclassoptioncode
+ +\noitaliccorrectionclassoptioncode
+ % +\checkligatureclassoptioncode
+ +\checkkernpairclassoptioncode
+ % +\flattenclassoptioncode
+\relax
+
+\setmathoptions\mathrelationcode\numexpr
+ \defaultmathclassoptions
+ +\noitaliccorrectionclassoptioncode
+ % +\checkligatureclassoptioncode
+ +\checkkernpairclassoptioncode
+ % +\flattenclassoptioncode
+ % +\omitpenaltyclassoptioncode
+\relax
+
+\setmathoptions\mathopencode\numexpr
+ \defaultmathclassoptions
+ +\noitaliccorrectionclassoptioncode
+ % +\openfenceclassoptioncode
+ % +\checkligatureclassoptioncode
+ +\checkkernpairclassoptioncode
+\relax
+
+\setmathoptions\mathclosecode\numexpr
+ \defaultmathclassoptions
+ +\noitaliccorrectionclassoptioncode
+ % +\closefenceclassoptioncode
+ % +\checkligatureclassoptioncode
+ +\checkkernpairclassoptioncode
+ +\raiseprimeclassoptioncode
+\relax
+
+\setmathoptions\mathpunctuationcode\numexpr
+ \defaultmathclassoptions
+ +\noitaliccorrectionclassoptioncode
+ % +\checkligatureclassoptioncode
+ % +\flattenclassoptioncode
+ +\checkkernpairclassoptioncode
+ +\removeitaliccorrectionclassoptioncode
+\relax
+
+\setmathoptions\mathvariablecode\numexpr
+ \noitaliccorrectionclassoptioncode
+\relax
+
+\setmathoptions\mathactivecode\numexpr
+ \noitaliccorrectionclassoptioncode
+\relax
+
+%setmathoptions\mathinnercode\numexpr
+% \noitaliccorrectionclassoptioncode
+% +\flattenclassoptioncode
+%relax
+
+\setmathoptions\mathmiddlecode\numexpr
+ \noitaliccorrectionclassoptioncode
+ % +\middlefenceclassoptioncode
+ +\raiseprimeclassoptioncode
+ +\carryoverlefttopkernclassoptioncode
+ +\carryoverleftbottomkernclassoptioncode
+ +\carryoverrighttopkernclassoptioncode
+ +\carryoverrightbottomkernclassoptioncode
+ +\preferdelimiterdimensionsclassoptioncode
+\relax
+
+\setmathoptions\mathfractioncode\numexpr
+ \defaultmathclassoptions
+ +\raiseprimeclassoptioncode
+ +\carryoverlefttopkernclassoptioncode
+ +\carryoverleftbottomkernclassoptioncode
+ +\carryoverrighttopkernclassoptioncode
+ +\carryoverrightbottomkernclassoptioncode
+ +\preferdelimiterdimensionsclassoptioncode
+\relax
+
+\setmathoptions\mathradicalcode\numexpr
+ \defaultmathclassoptions
+ +\raiseprimeclassoptioncode
+ +\carryoverlefttopkernclassoptioncode
+ +\carryoverleftbottomkernclassoptioncode
+ +\carryoverrighttopkernclassoptioncode
+ +\carryoverrightbottomkernclassoptioncode
+ +\preferdelimiterdimensionsclassoptioncode
+\relax
+
+\setmathoptions\mathaccentcode\numexpr
+ \defaultmathclassoptions
+ +\autoinjectclassoptioncode
+\relax
+
+% ord spacing but with support for \m{m^2/x__3}
+
+\setmathoptions\mathdivisioncode\numexpr
+ \nopreslackclassoptioncode
+ +\nopostslackclassoptioncode
+ +\lefttopkernclassoptioncode
+ % +\righttopkernclassoptioncode
+ % +\leftbottomkernclassoptioncode
+ +\rightbottomkernclassoptioncode
+\relax
+
+\setmathoptions\mathbegincode\numexpr
+ \nopostslackclassoptioncode
+\relax
+
+\setmathoptions\mathendcode\numexpr
+ \nopreslackclassoptioncode
+\relax
+
+% Fenced is only used internally as these fences become open, middle and close
+% subtypes. If we don't set the following we should actually also define the
+% spacing rules.
+
+\setmathoptions\mathfencedcode\numexpr
+ \unpackclassoptioncode
+ +\carryoverlefttopkernclassoptioncode
+ +\carryoverleftbottomkernclassoptioncode
+ +\carryoverrighttopkernclassoptioncode
+ +\carryoverrightbottomkernclassoptioncode
+ +\preferdelimiterdimensionsclassoptioncode
+\relax
+
+% test case for \lefttopkernclassoptioncode and \leftbottomkernclassoptioncode in cambria close:
%
-% plus two new math styles: larger/smaller
+% \setupbodyfont[cambria]
+% %\enableexperiments[math.extensibles]
+% %\disableexperiments[math.extensibles]
%
-% \protected\def\Umathshow#1%
-% {\hbox{\infofont(\string#1:\the#1\textstyle,\the#1\scriptstyle,\the#1\scriptscriptstyle)}}
+% \startTEXpage[offset=1dk]
+% \startformula \showglyphs
+% \left\{ \mathatom class \mathfractioncode {\raise .6ex\hbox{\blackrule[color=blue, height=3cm,depth=3cm]}} \right\} ^1 _4 +
+% \left\( \mathatom class \mathfractioncode {\raise .6ex\hbox{\blackrule[color=green, height=4cm,depth=4cm]}} \right\) ^2 _3 -
+% \left\{ \mathatom class \mathfractioncode {\raise .6ex\hbox{\blackrule[color=red, height=2cm,depth=2cm]}} \right\} ^3 _2 +
+% \left\( \mathatom class \mathfractioncode {\raise .6ex\hbox{\blackrule[color=yellow,height=1cm,depth=1cm]}} \right\) ^4 _1
+% \stopformula
+% \stopTEXpage
-%D This module provides namespaces for math fonts, thereby permitting mixed usage of
-%D math fonts. Although not strictly needed, we also provide a family name mapping
-%D mechanism as used in the (original) AMS math definition files, but here these
-%D names can recursively be remapped and if needed, dynamically be changed. We've
-%D tried to minimize the number of definition commands and use plain \TEX\
-%D definitions as fallback. We've tried to follow a couple of conventions from plain
-%D and AMS math in order to achieve backward compatinility. We also kept an eye on
-%D future usage of these modules in the perspective of MathML and unicode fonts.
+%D For now \unknown (todo: make it adapt to style but we're in text anyway)
-%D There is a subtle issue with grouping: the \type {\begingroup} method will not
-%D restore a changed mathstyle so best avoid that one. However, there are cases where
-%D we really need to use such grouping.
+\permanent\protected\def\math_discretionary_plus {\discretionary class \mathbinarycode {$+$}{$+$}{$+$}}
+\permanent\protected\def\math_discretionary_minus{\discretionary class \mathbinarycode {$-$}{$-$}{$-$}}
-% Weird, these fail, maybe amp is solved in a later state from char noads (needs a
-% fix in luatex):
-%
-% $\char"26$
-% $\a$
-% $\string&$
+\newtoks\everymathdiscretionaries
-% mathop applied to characters centers it vertically
+\appendtoks
+ \enforced\let\+\math_discretionary_plus
+ \enforced\let\-\math_discretionary_minus
+\to \everymathdiscretionaries
-\unprotect
+\appendtoks
+ \ifconditional\c_math_discretionaries
+ \the\everymathdiscretionaries
+ \fi
+\to \everymathematics
-%D We move these definitions into the format:
+\setfalse\c_math_discretionaries
-% test [[\char948 \cldcontext{utf.char(948)}]]
-% test $[[\char948 \cldcontext{utf.char(948)}]]$
+\installtexexperiment
+ {mathematics.discretionaries}
+ {\settrue \c_math_discretionaries}
+ {\setfalse\c_math_discretionaries}
-\registerctxluafile{math-ini}{}
-\registerctxluafile{math-dim}{}
-\registerctxluafile{math-act}{autosuffix}
-\registerctxluafile{math-ext}{}
-\registerctxluafile{math-vfu}{autosuffix}
-\registerctxluafile{math-ttv}{}
-\registerctxluafile{math-map}{optimize}
-\registerctxluafile{math-ren}{}
-\registerctxluafile{math-noa}{autosuffix,optimize}
-\registerctxluafile{math-tag}{autosuffix}
-\registerctxluafile{math-fbk}{}
-\registerctxluafile{math-dir}{}
-\registerctxluafile{math-spa}{}
+%D This is moved here from supp-mat:
+
+\permanent\protected\def\dimension#1%
+ {\mathematics
+ {\mathatom
+ \s!leftclass \mathdimensioncode
+ \s!rightclass \mathordinarycode
+ {\tf #1}}}
+
+\permanent\protected\def\nodimension#1%
+ {#1}
%D A starter:
%D
@@ -90,24 +735,12 @@
%D
%D \start \blank \getbuffer \blank \stop
-\newcount\mathnestinglevel
+% \newinteger\mathnestinglevel % see top
\appendtoks
- \advance\mathnestinglevel\plusone
+ \advanceby\mathnestinglevel\plusone
\to \everymathematics
-%D A few compatibility helpers:
-
-\permanent\def\Umathbotaccent{\Umathaccent \s!bottom }
-\permanent\def\Umathtopaccent{\Umathaccent \s!top }
-\permanent\def\Umathaccents {\Umathaccent \s!both } % strange highlighting
-
-\ifdefined\Umathcharclass \else
- \permanent\def\Umathcharclass{\numexpr\cldcontext{tex.getmathcode(token.scan_int())[1]}\relax}
- \permanent\def\Umathcharfam {\numexpr\cldcontext{tex.getmathcode(token.scan_int())[2]}\relax}
- \permanent\def\Umathcharslot {\numexpr\cldcontext{tex.getmathcode(token.scan_int())[3]}\relax}
-\fi
-
%D The attributes that we will use (todo: pack some into one but uglier code):
\definesystemattribute[mathalphabet] [public]
@@ -121,16 +754,26 @@
\definesystemattribute[mathitalics] [public]
\definesystemattribute[mathkernpairs] [public]
\definesystemattribute[mathbidi] [public]
-\definesystemattribute[mathdomain] [public]
+%definesystemattribute[mathdomain] [public]
\definesystemattribute[mathcollapsing] [public]
\definesystemattribute[mathunstack] [public]
+\definesystemattribute[mathvariant] [public]
+\definesystemattribute[mathnumbers] [public]
+\definesystemattribute[mathspacing] [public]
+\definesystemattribute[mathfencing] [public]
\definesystemattribute[displaymath] [public]
-\mathflattenmode 31
+% \mathflattenmode\numexpr
+% \ordmathflattencode
+% +\binmathflattencode
+% +\relmathflattencode
+% +\punctmathflattencode
+% +\innermathflattencode
+% \relax
\ifdefined\ordlimits\else
- \let\ordlimits\limits
+ \let\ordlimits\Umathlimits % downward compatible
\fi
\appendtoks
@@ -142,9 +785,7 @@
\c_attr_displaymath\plusone
\to \everybeforedisplayformula
-\defaultmathfamily \zerocount % 255
-
-\permanent\protected\def\resetmathattributes{\clf_resetmathattributes}
+% defined at lua end \permanent\protected\def\resetmathattributes{\resetmathattributes}
% handy
@@ -166,15 +807,33 @@
\settrue\indisplaymath
\fi}
+\permanent\protected\def\forceinlinemath
+ {\ifmmode
+ \textstyle
+ \setfalse\indisplaymath
+ \fi}
+
+% \permanent\protected\def\startforceddisplaymath
+% {\startimath
+% \displaystyle
+% \begingroup
+% \settrue\indisplaymath}
+%
+% \permanent\protected\def\stopforceddisplaymath
+% {\endgroup
+% \stopimath}
+
+% \def\startidmath{\Ustartmathmode \displaystyle}
+% \def\stopidmath {\Ustopmathmode}
+
\permanent\protected\def\startforceddisplaymath
- {\startimath
- \displaystyle
- \begingroup
+ {\Ustartmathmode \displaystyle
+ \begingroup % can go
\settrue\indisplaymath}
\permanent\protected\def\stopforceddisplaymath
- {\endgroup
- \stopimath}
+ {\endgroup % can go
+ \Ustopmathmode}
\permanent\protected\def\startpickupmath % for the moment private
{\ifconditional\indisplaymath
@@ -199,9 +858,9 @@
\permanent\protected\def\rawmathematics#1% slow but only for tracing
{\begingroup
\ifmmode
- \clf_resetmathattributes#1%
+ \resetmathattributes#1%
\else
- \startimath\clf_resetmathattributes#1\stopimath
+ \startimath\resetmathattributes#1\stopimath
\fi
\endgroup}
@@ -223,19 +882,6 @@
\installmacrostack\currentmathematics
-% \permanent\protected\def\startmathematics % no grouping, if ever then also an optional second
-% {\doifelsenextoptionalcs\math_mathematics_start_yes\math_mathematics_start_nop}
-%
-% \protected\def\math_mathematics_start_yes[#1]%
-% {\push_macro_currentmathematics
-% \edef\currentmathematics{#1}% check for valid
-% \the\everyswitchmathematics}
-%
-% \protected\def\math_mathematics_start_nop
-% {\push_macro_currentmathematics
-% \let\currentmathematics\empty
-% \the\everyswitchmathematics}
-
\permanent\protected\tolerant\def\startmathematics[#1]% no grouping, if ever then also an optional second
{\push_macro_currentmathematics
\edef\currentmathematics{#1}% check for valid
@@ -250,7 +896,6 @@
% Now we redefine \type {\mathematics} and \type {\m}:
\pushoverloadmode
-
\permanent\protected\def\mathematics{\doifelsenextoptionalcs\math_m_yes\math_m_nop}
\aliased\let\m \mathematics % we keep the simple versions
@@ -267,7 +912,7 @@
\fi}
\def\math_m_yes_math[#1]#2%
- {#2}
+ {#2} % grouping permits \mathbf etc
\def\math_m_yes_text[#1]%
{\begingroup
@@ -304,7 +949,7 @@
\def\math_m_yes_text_normal#1%
{\the\everyswitchmathematics\relax
\normalstartimath
- #1%
+ \begingroup#1\endgroup % grouping permits aftergroups trickery
\normalstopimath
\endgroup}
@@ -314,26 +959,40 @@
#1%
\else
\normalstartimath
- #1%
+ \begingroup#1\endgroup % grouping permits aftergroups trickery
\normalstopimath
\fi}
-% e.g.: \definemathematics[i:mp][setups=i:tight,openup=yes]
+%D We wrap in a construct so that we can do:
+%D
+%D \starttyping
+%D \startformula
+%D \dm{f(x) = \frac{x}{y}} \mtp{,}
+%D \im{g(x) = \frac{x}{y}} \mtp{.}
+%D \stopformula
+%D \stoptyping
-\immutable\mugluespecdef\defaultthickmuskip 5mu plus 5mu
-\immutable\mugluespecdef\defaultmedmuskip 4mu plus 2mu minus 4mu
-\immutable\mugluespecdef\defaultthinmuskip 3mu
+\permanent\protected\def\dm#1%
+ {\relax
+ \ifmmode
+ %\beginmathgroup\forcedisplaymath#1\endmathgroup
+ \mathconstruct{\forcedisplaymath#1}%
+ \else
+ \startimath\begingroup\forcedisplaymath#1\endgroup\stopimath
+ \fi}
-\immutable\mugluespecdef\halfthickmuskip 2.5mu plus 2.5mu
-\immutable\mugluespecdef\halfmedmuskip 2.0mu plus 1.0mu minus 2.0mu
-\immutable\mugluespecdef\halfthinmuskip 1.5mu
+\permanent\protected\def\im#1%
+ {\relax
+ \ifmmode
+ %\beginmathgroup\forceinlinemath#1\endmathgroup
+ \mathconstruct{\forceinlinemath#1}%
+ \else
+ \startimath#1\stopimath
+ \fi}
-\immutable\mugluespecdef\hairmuskip .15mu
+% \aliased\let\m \mathematics % we keep the simple versions
-\immutable\integerdef \defaultrelpenalty 500
-\immutable\integerdef \defaultbinoppenalty 700
-\immutable\integerdef \defaultprerelpenalty -100
-\immutable\integerdef \defaultprebinoppenalty -100
+% e.g.: \definemathematics[i:mp][setups=i:tight,openup=yes]
% we need to control these otherwise:
%
@@ -344,6 +1003,8 @@
\thickmuskip \defaultthickmuskip
\medmuskip \defaultmedmuskip
\thinmuskip \defaultthinmuskip
+ \tinymuskip \defaulttinymuskip
+ \pettymuskip \defaultpettymuskip
\relpenalty \defaultrelpenalty
\binoppenalty \defaultbinoppenalty
\prebinoppenalty\maxdimen
@@ -354,6 +1015,8 @@
\thickmuskip \defaultthickmuskip
\medmuskip \defaultmedmuskip
\thinmuskip \defaultthinmuskip
+ \tinymuskip \defaulttinymuskip
+ \pettymuskip \defaultpettymuskip
\relpenalty \defaultrelpenalty
\binoppenalty \defaultbinoppenalty
\prebinoppenalty\defaultprebinoppenalty
@@ -364,6 +1027,8 @@
\thickmuskip \halfthickmuskip
\medmuskip \halfmedmuskip
\thinmuskip \halfthinmuskip
+ \tinymuskip \halftinymuskip
+ \pettymuskip \halfpettymuskip
\relpenalty \defaultrelpenalty
\binoppenalty \defaultbinoppenalty
\prebinoppenalty\maxdimen
@@ -375,10 +1040,14 @@
\thickmuskip \halfthickmuskip
\medmuskip \halfmedmuskip
\thinmuskip \halfthinmuskip
+ \tinymuskip \halftinymuskip
+ \pettymuskip \halfpettymuskip
\else
\thickmuskip 1\halfthickmuskip
\medmuskip 1\halfmedmuskip
\thinmuskip 1\halfthinmuskip
+ \tinymuskip 1\halftinymuskip
+ \pettymuskip 1\halfpettymuskip
\fi
\relpenalty \defaultrelpenalty
\binoppenalty \maxdimen
@@ -391,10 +1060,14 @@
\thickmuskip \halfthickmuskip
\medmuskip \halfmedmuskip
\thinmuskip \halfthinmuskip
+ \tinymuskip \halftinymuskip
+ \pettymuskip \halfpettymuskip
\else
\thickmuskip 1\halfthickmuskip
\medmuskip 1\halfmedmuskip
\thinmuskip 1\halfthinmuskip
+ \tinymuskip 1\halftinymuskip
+ \pettymuskip 1\halfpettymuskip
\fi
\relpenalty \maxdimen
\binoppenalty \maxdimen
@@ -402,8 +1075,372 @@
\prerelpenalty \maxdimen
\stopsetups
+% this will reset the spacing to default values
+
+% \Umathspacingmode\allmathstyles\plusone % always pair driven
+
+%D \starttyping
+%D \startformula
+%D f(x) = \sin x \mt{,} x
+%D \stopformula
+%D
+%D $f(x) = \sin x \mt{,} x$
+%D \stoptyping
+
+% mu based: 18mu == quad, preferred
+
+\newmuskip\mathinterwordmuskip
+
+% Hans:
+%
+% \mathinterwordmuskip 9mu plus .45mu minus .225mu
+%
+% Lansburg, p. 296: "A quad---nothing less, but also nothing more---is set between all independent formulas, independent of their length,
+% height or character.
+
+\mathinterwordmuskip 18mu
+
+\permanent\protected\def\mtp#1{\mathatom class \mathtextpunctuationcode {\hbox{#1}}} % only at the outer level (text, display)
+
+% granular, but more clutter
+%
+% \newgluespec\mathinterwordtextskip
+% \newgluespec\mathinterwordscriptskip
+% \newgluespec\mathinterwordscriptscriptskip
+%
+% \appendtoks
+% \mathinterwordtextskip \fontinterwordspace\textfont \zerocount \fontinterwordstretch\textfont \zerocount \fontinterwordshrink\textfont \zerocount \relax
+% \mathinterwordscriptskip \fontinterwordspace\scriptfont \zerocount \fontinterwordstretch\scriptfont \zerocount \fontinterwordshrink\scriptfont \zerocount \relax
+% \mathinterwordscriptscriptskip \fontinterwordspace\scriptscriptfont\zerocount \fontinterwordstretch\scriptscriptfont\zerocount \fontinterwordshrink\scriptscriptfont\zerocount \relax
+% \to \everymathematics
+%
+% \inherited\setmathspacing \mathtextpunctuationcode \mathordcode \allmathstyles \mathinterwordtextskip
+% \inherited\setmathspacing \mathtextpunctuationcode \mathordcode \allscriptstyles \mathinterwordscriptskip
+% \inherited\setmathspacing \mathtextpunctuationcode \mathordcode \allscriptscriptstyles \mathinterwordscriptscriptskip
+
+\startsetups math:spacing:presets
+ \resetmathspacing
+ %
+ % \inherited\setmathspacing \mathordinarycode \mathordinarycode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathordinarycode \mathoperatorcode \allmathstyles \thinmuskip
+ \inherited\setmathspacing \mathordinarycode \mathbinarycode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathordinarycode \mathbinarycode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathordinarycode \mathrelationcode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathordinarycode \mathrelationcode \allunsplitstyles \pettymuskip
+ % \inherited\setmathspacing \mathordinarycode \mathopencode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathordinarycode \mathmiddlecode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathordinarycode \mathmiddlecode \allunsplitstyles \pettymuskip
+ % \inherited\setmathspacing \mathordinarycode \mathclosecode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathordinarycode \mathpunctuationcode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathordinarycode \mathconstructcode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathordinarycode \mathconstructcode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathordinarycode \mathellipsiscode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathordinarycode \mathellipsiscode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathordinarycode \mathfractioncode \allsplitstyles \tinymuskip
+ \inherited\setmathspacing \mathordinarycode \mathfractioncode \allunsplitstyles \pettymuskip
+ % \inherited\setmathspacing \mathordinarycode \mathradicalcode \allsplitstyles \tinymuskip % 220705 Results in an unwanted space
+ % \inherited\setmathspacing \mathordinarycode \mathradicalcode \allunsplitstyles \pettymuskip % 220705 Results in an unwanted space
+ %
+ \inherited\setmathspacing \mathoperatorcode \mathordinarycode \allmathstyles \thinmuskip
+ \inherited\setmathspacing \mathoperatorcode \mathoperatorcode \allmathstyles \thinmuskip
+ % \inherited\setmathspacing \mathoperatorcode \mathbinarycode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathoperatorcode \mathrelationcode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathoperatorcode \mathrelationcode \allunsplitstyles \pettymuskip
+ % \inherited\setmathspacing \mathoperatorcode \mathopencode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathoperatorcode \mathmiddlecode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathoperatorcode \mathmiddlecode \allunsplitstyles \pettymuskip
+ % \inherited\setmathspacing \mathoperatorcode \mathclosecode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathoperatorcode \mathpunctuationcode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathoperatorcode \mathconstructcode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathoperatorcode \mathconstructcode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathoperatorcode \mathellipsiscode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathoperatorcode \mathellipsiscode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathoperatorcode \mathfractioncode \allmathstyles \thinmuskip
+ \inherited\setmathspacing \mathoperatorcode \mathradicalcode \allmathstyles \thinmuskip
+ %
+ \inherited\setmathspacing \mathbinarycode \mathordinarycode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathbinarycode \mathordinarycode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathbinarycode \mathoperatorcode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathbinarycode \mathoperatorcode \allunsplitstyles \pettymuskip
+ %% \inherited\setmathspacing \mathbinarycode \mathbinarycode \allmathstyles \zeromuskip
+ %% \inherited\setmathspacing \mathbinarycode \mathrelationcode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathbinarycode \mathopencode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathbinarycode \mathopencode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathbinarycode \mathmiddlecode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathbinarycode \mathmiddlecode \allunsplitstyles \pettymuskip
+ %% \inherited\setmathspacing \mathbinarycode \mathclosecode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathbinarycode \mathpunctuationcode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathbinarycode \mathpunctuationcode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathbinarycode \mathconstructcode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathbinarycode \mathconstructcode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathbinarycode \mathellipsiscode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathbinarycode \mathellipsiscode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathbinarycode \mathfractioncode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathbinarycode \mathfractioncode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathbinarycode \mathradicalcode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathbinarycode \mathradicalcode \allunsplitstyles \pettymuskip
+ %
+ \inherited\setmathspacing \mathrelationcode \mathordinarycode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathrelationcode \mathordinarycode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathrelationcode \mathoperatorcode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathrelationcode \mathoperatorcode \allunsplitstyles \pettymuskip
+ %% \inherited\setmathspacing \mathrelationcode \mathbinarycode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathrelationcode \mathrelationcode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathrelationcode \mathopencode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathrelationcode \mathopencode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathrelationcode \mathmiddlecode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathrelationcode \mathmiddlecode \allunsplitstyles \thinmuskip
+ % \inherited\setmathspacing \mathrelationcode \mathclosecode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathrelationcode \mathpunctuationcode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathrelationcode \mathpunctuationcode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathrelationcode \mathconstructcode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathrelationcode \mathconstructcode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathrelationcode \mathellipsiscode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathrelationcode \mathellipsiscode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathrelationcode \mathfractioncode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathrelationcode \mathfractioncode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathrelationcode \mathradicalcode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathrelationcode \mathradicalcode \allunsplitstyles \pettymuskip
+ %
+ % \inherited\setmathspacing \mathopencode \mathordinarycode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathopencode \mathoperatorcode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathopencode \mathbinarycode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathopencode \mathrelationcode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathopencode \mathopencode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathopencode \mathmiddlecode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathopencode \mathclosecode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathopencode \mathpunctuationcode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathopencode \mathconstructcode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathopencode \mathellipsiscode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathopencode \mathfractioncode \allmathstyles \pettymuskip
+ % \inherited\setmathspacing \mathopencode \mathradicalcode \allmathstyles \zeromuskip
+ %
+ \inherited\setmathspacing \mathclosecode \mathordinarycode \allmathstyles \tinymuskip
+ \inherited\setmathspacing \mathclosecode \mathoperatorcode \allmathstyles \thinmuskip
+ \inherited\setmathspacing \mathclosecode \mathbinarycode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathclosecode \mathbinarycode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathclosecode \mathrelationcode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathclosecode \mathrelationcode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathclosecode \mathopencode \alltextstyles \tinymuskip
+ \inherited\setmathspacing \mathclosecode \mathopencode \alldisplaystyles \thinmuskip
+ \inherited\setmathspacing \mathclosecode \mathopencode \allunsplitstyles \pettymuskip
+ % \inherited\setmathspacing \mathclosecode \mathmiddlecode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathclosecode \mathclosecode \allmathstyles \zeromuskip
+ % \inherited\setmathspacing \mathclosecode \mathpunctuationcode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathclosecode \mathconstructcode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathclosecode \mathconstructcode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathclosecode \mathfactorialcode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathclosecode \mathellipsiscode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathclosecode \mathellipsiscode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathclosecode \mathfractioncode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathclosecode \mathfractioncode \allunsplitstyles \pettymuskip
+ % \inherited\setmathspacing \mathclosecode \mathradicalcode \allmathstyles \zeromuskip
+ %
+ \inherited\setmathspacing \mathpunctuationcode \mathordinarycode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathordinarycode \allunsplitstyles \tinymuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathoperatorcode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathoperatorcode \allunsplitstyles \tinymuskip
+ % \inherited\setmathspacing \mathpunctuationcode \mathbinarycode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathrelationcode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathrelationcode \allunsplitstyles \tinymuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathopencode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathopencode \allunsplitstyles \tinymuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathmiddlecode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathmiddlecode \allunsplitstyles \tinymuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathclosecode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathclosecode \allunsplitstyles \tinymuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathpunctuationcode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathpunctuationcode \allunsplitstyles \tinymuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathconstructcode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathconstructcode \allunsplitstyles \tinymuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathellipsiscode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathellipsiscode \allunsplitstyles \tinymuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathfractioncode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathfractioncode \allunsplitstyles \tinymuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathradicalcode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathradicalcode \allunsplitstyles \tinymuskip
+ %
+ \inherited\setmathspacing \mathconstructcode \mathordinarycode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathconstructcode \mathordinarycode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathconstructcode \mathoperatorcode \allmathstyles \thinmuskip
+ \inherited\setmathspacing \mathconstructcode \mathbinarycode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathconstructcode \mathbinarycode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathconstructcode \mathrelationcode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathconstructcode \mathrelationcode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathconstructcode \mathopencode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathconstructcode \mathopencode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathconstructcode \mathmiddlecode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathconstructcode \mathmiddlecode \allunsplitstyles \pettymuskip
+ % \inherited\setmathspacing \mathconstructcode \mathclosecode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathconstructcode \mathpunctuationcode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathconstructcode \mathpunctuationcode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathconstructcode \mathconstructcode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathconstructcode \mathconstructcode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathconstructcode \mathfractioncode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathconstructcode \mathfractioncode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathconstructcode \mathradicalcode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathconstructcode \mathradicalcode \allunsplitstyles \pettymuskip
+ %
+ \inherited\setmathspacing \mathellipsiscode \mathordinarycode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathellipsiscode \mathordinarycode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathellipsiscode \mathoperatorcode \allmathstyles \thinmuskip
+ \inherited\setmathspacing \mathellipsiscode \mathbinarycode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathellipsiscode \mathbinarycode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathellipsiscode \mathrelationcode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathellipsiscode \mathrelationcode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathellipsiscode \mathopencode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathellipsiscode \mathopencode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathellipsiscode \mathmiddlecode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathellipsiscode \mathmiddlecode \allunsplitstyles \pettymuskip
+ % \inherited\setmathspacing \mathellipsiscode \mathclosecode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathellipsiscode \mathpunctuationcode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathellipsiscode \mathpunctuationcode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathellipsiscode \mathconstructcode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathellipsiscode \mathconstructcode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathellipsiscode \mathellipsiscode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathellipsiscode \mathellipsiscode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathellipsiscode \mathfractioncode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathellipsiscode \mathfractioncode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathellipsiscode \mathradicalcode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathellipsiscode \mathradicalcode \allunsplitstyles \pettymuskip
+ %
+ \inherited\setmathspacing \mathfractioncode \mathordinarycode \allsplitstyles \tinymuskip
+ \inherited\setmathspacing \mathfractioncode \mathordinarycode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathfractioncode \mathoperatorcode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathfractioncode \mathoperatorcode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathfractioncode \mathbinarycode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathfractioncode \mathbinarycode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathfractioncode \mathrelationcode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathfractioncode \mathrelationcode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathfractioncode \mathopencode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathfractioncode \mathopencode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathfractioncode \mathmiddlecode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathfractioncode \mathmiddlecode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathfractioncode \mathclosecode \allmathstyles \pettymuskip
+ \inherited\setmathspacing \mathfractioncode \mathpunctuationcode \allsplitstyles \tinymuskip
+ \inherited\setmathspacing \mathfractioncode \mathpunctuationcode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathfractioncode \mathtextpunctuationcode \allmathstyles \tinymuskip
+ \inherited\setmathspacing \mathfractioncode \mathconstructcode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathfractioncode \mathconstructcode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathfractioncode \mathellipsiscode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathfractioncode \mathellipsiscode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathfractioncode \mathfractioncode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathfractioncode \mathfractioncode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathfractioncode \mathradicalcode \allsplitstyles \tinymuskip
+ \inherited\setmathspacing \mathfractioncode \mathradicalcode \allunsplitstyles \pettymuskip
+ %
+ \inherited\setmathspacing \mathradicalcode \mathordinarycode \allsplitstyles \tinymuskip
+ \inherited\setmathspacing \mathradicalcode \mathordinarycode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathradicalcode \mathoperatorcode \allmathstyles \thinmuskip
+ \inherited\setmathspacing \mathradicalcode \mathbinarycode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathradicalcode \mathbinarycode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathradicalcode \mathrelationcode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathradicalcode \mathrelationcode \allunsplitstyles \pettymuskip
+ % \inherited\setmathspacing \mathradicalcode \mathopencode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathradicalcode \mathmiddlecode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathradicalcode \mathmiddlecode \allunsplitstyles \pettymuskip
+ % \inherited\setmathspacing \mathradicalcode \mathclosecode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathradicalcode \mathpunctuationcode \allsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathradicalcode \mathpunctuationcode \allunsplitstyles \tinymuskip
+ \inherited\setmathspacing \mathradicalcode \mathconstructcode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathradicalcode \mathconstructcode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathradicalcode \mathellipsiscode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathradicalcode \mathellipsiscode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathradicalcode \mathfractioncode \allsplitstyles \tinymuskip
+ \inherited\setmathspacing \mathradicalcode \mathfractioncode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathradicalcode \mathradicalcode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathradicalcode \mathradicalcode \allunsplitstyles \pettymuskip
+ %
+ \inherited\setmathspacing \mathmiddlecode \mathordinarycode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathmiddlecode \mathordinarycode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathmiddlecode \mathoperatorcode \allmathstyles \thickmuskip
+ \inherited\setmathspacing \mathmiddlecode \mathbinarycode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathmiddlecode \mathbinarycode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathmiddlecode \mathrelationcode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathmiddlecode \mathrelationcode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathmiddlecode \mathopencode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathmiddlecode \mathopencode \allsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathmiddlecode \mathmiddlecode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathmiddlecode \mathmiddlecode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathmiddlecode \mathclosecode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathmiddlecode \mathclosecode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathmiddlecode \mathpunctuationcode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathmiddlecode \mathpunctuationcode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathmiddlecode \mathconstructcode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathmiddlecode \mathconstructcode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathmiddlecode \mathellipsiscode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathmiddlecode \mathellipsiscode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathmiddlecode \mathfractioncode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathmiddlecode \mathfractioncode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathmiddlecode \mathradicalcode \allsplitstyles \thickmuskip
+ \inherited\setmathspacing \mathmiddlecode \mathradicalcode \allmathstyles \pettymuskip
+ %
+ \inherited\setmathspacing \mathclosecode \mathdifferentialcode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathclosecode \mathdifferentialcode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathordinarycode \mathdifferentialcode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathordinarycode \mathdifferentialcode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathfactorialcode \mathordinarycode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathfactorialcode \mathordinarycode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathfactorialcode \mathfactorialcode \allmathstyles \zeromuskip
+ %
+ \inherited\setmathspacing \mathopencode \mathconstructcode \allmathstyles \thinmuskip
+ \inherited\setmathspacing \mathconstructcode \mathclosecode \allmathstyles \thinmuskip
+ %
+ \inherited\setmathspacing \mathdimensioncode \mathdimensioncode \allmathstyles \zeromuskip
+ \inherited\setmathspacing \mathordinarycode \mathdimensioncode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathordinarycode \mathdimensioncode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathdigitcode \mathdimensioncode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathdigitcode \mathdimensioncode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathclosecode \mathdimensioncode \allsplitstyles \thinmuskip
+ \inherited\setmathspacing \mathclosecode \mathdimensioncode \allunsplitstyles \pettymuskip
+ \inherited\setmathspacing \mathfunctioncode \mathbinarycode \allsplitstyles \medmuskip
+ \inherited\setmathspacing \mathfunctioncode \mathbinarycode \allunsplitstyles \pettymuskip
+ %
+ % \im{1\unit{hour} 20 \unit{minute} 56 \unit{second}}
+ %
+ \inherited\setmathspacing \mathdimensioncode \mathdigitcode \allmathstyles \thickmuskip
+ %
+ \inherited\setmathspacing \mathfakecode \mathallcode \allmathstyles \tinymuskip
+ \inherited\setmathspacing \mathallcode \mathfakecode \allmathstyles \tinymuskip
+ %
+ \inherited\setmathspacing \mathtextpunctuationcode \mathordinarycode \allmathstyles \mathinterwordmuskip
+ \inherited\setmathspacing \mathtextpunctuationcode \mathoperatorcode \allmathstyles \mathinterwordmuskip
+ \inherited\setmathspacing \mathtextpunctuationcode \mathbinarycode \allmathstyles \mathinterwordmuskip
+ \inherited\setmathspacing \mathtextpunctuationcode \mathrelationcode \allmathstyles \mathinterwordmuskip
+ \inherited\setmathspacing \mathtextpunctuationcode \mathopencode \allmathstyles \mathinterwordmuskip
+ \inherited\setmathspacing \mathtextpunctuationcode \mathmiddlecode \allmathstyles \mathinterwordmuskip
+ \inherited\setmathspacing \mathtextpunctuationcode \mathclosecode \allmathstyles \mathinterwordmuskip
+ \inherited\setmathspacing \mathtextpunctuationcode \mathpunctuationcode \allmathstyles \mathinterwordmuskip
+ \inherited\setmathspacing \mathtextpunctuationcode \mathconstructcode \allmathstyles \mathinterwordmuskip
+ \inherited\setmathspacing \mathtextpunctuationcode \mathellipsiscode \allmathstyles \mathinterwordmuskip
+ \inherited\setmathspacing \mathtextpunctuationcode \mathfractioncode \allmathstyles \mathinterwordmuskip
+ \inherited\setmathspacing \mathtextpunctuationcode \mathradicalcode \allmathstyles \mathinterwordmuskip
+ \inherited\setmathspacing \mathtextpunctuationcode \mathdifferentialcode \allmathstyles \mathinterwordmuskip
+ \inherited\setmathspacing \mathtextpunctuationcode \mathpunctuationcode \allmathstyles \mathinterwordmuskip
+ %
+ \inherited\setmathspacing \mathordinarycode \mathtextpunctuationcode \allmathstyles \tinymuskip
+ \inherited\setmathspacing \mathoperatorcode \mathtextpunctuationcode \allmathstyles \tinymuskip
+ \inherited\setmathspacing \mathbinarycode \mathtextpunctuationcode \allmathstyles \tinymuskip
+ \inherited\setmathspacing \mathrelationcode \mathtextpunctuationcode \allmathstyles \tinymuskip
+ \inherited\setmathspacing \mathopencode \mathtextpunctuationcode \allmathstyles \tinymuskip
+ \inherited\setmathspacing \mathmiddlecode \mathtextpunctuationcode \allmathstyles \tinymuskip
+ \inherited\setmathspacing \mathclosecode \mathtextpunctuationcode \allmathstyles \tinymuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathtextpunctuationcode \allmathstyles \tinymuskip
+ \inherited\setmathspacing \mathconstructcode \mathtextpunctuationcode \allmathstyles \tinymuskip
+ \inherited\setmathspacing \mathellipsiscode \mathtextpunctuationcode \allmathstyles \tinymuskip
+ \inherited\setmathspacing \mathfractioncode \mathtextpunctuationcode \allmathstyles \tinymuskip
+ \inherited\setmathspacing \mathradicalcode \mathtextpunctuationcode \allmathstyles \tinymuskip
+ \inherited\setmathspacing \mathdifferentialcode \mathtextpunctuationcode \allmathstyles \tinymuskip
+ \inherited\setmathspacing \mathpunctuationcode \mathtextpunctuationcode \allmathstyles \tinymuskip
+\stopsetups
+
+\directsetup{math:spacing:default}
+\directsetup{math:spacing:presets}
+
% \dorecurse{80}{test \m[i:tight]{\red \fakeformula} test }
+%setupmathematics [\c!setups=math:spacing:default]
+
\definemathematics[i:default][\c!setups=math:spacing:equal]
\definemathematics[i:half] [\c!setups=math:spacing:half]
\definemathematics[i:tight] [\c!setups=math:spacing:tight]
@@ -416,10 +1453,10 @@
% todo: only in mmode
% these commands are semi-public but should not be used directly (lua names wil change)
-\permanent\protected\def\setmathattribute #1#2{\ifmmode\clf_setmathattribute{#1}{#2}\fi}
-\permanent\protected\def\setmathalphabet #1{\ifmmode\clf_setmathalphabet{#1}\fi}
-\permanent\protected\def\setmathfontstyle #1{\ifmmode\clf_setmathstyle{#1}\fi}
-\permanent\protected\def\setmathfontalternate#1{\ifmmode\clf_setmathalternate\defaultmathfamily{#1}\fi}
+%permanent\protected\def\setmathattribute #1#2{\ifmmode\clf_setmathattribute{#1}{#2}\fi}
+%permanent\protected\def\setmathalphabet #1{\ifmmode\clf_setmathalphabet{#1}\fi}
+%permanent\protected\def\setmathfontstyle #1{\ifmmode\clf_setmathstyle{#1}\fi}
+%permanent\protected\def\setmathfontalternate#1{\ifmmode\clf_setmathalternate{#1}\fi}
\installcorenamespace{mathstylealternative} % might become a setuphandler
@@ -440,7 +1477,7 @@
\appendtoks
\edef\p_stylealternative{\mathematicsparameter\c!stylealternative}%
\ifempty\p_stylealternative\else
- \clf_presetmathalternate\defaultmathfamily{\p_stylealternative}%
+ \presetmathfontalternate{\p_stylealternative}%
\fi
\to \everymathematics
@@ -488,32 +1525,57 @@
\aliased\let\setmathfontstylealternative\setmathfontstylealternate
\aliased\let\mathalternate \setmathfontalternate
-\permanent\protected\def\mathupright {\setmathattribute\s!regular\s!tf\setmathfontstylealternate\s!tf}
-\permanent\protected\def\mathitalic {\setmathattribute\s!regular\s!it\setmathfontstylealternate\s!it}
-\permanent\protected\def\mathscript {\setmathalphabet \s!script \setmathfontstylealternate\s!script}
-\permanent\protected\def\mathfraktur {\setmathalphabet \s!fraktur \setmathfontstylealternate\s!fraktur}
-\permanent\protected\def\mathblackboard{\setmathalphabet \s!blackboard \setmathfontstylealternate\s!blackboard}
-
-\permanent\protected\def\mathrm {\setmathattribute\s!rm\s!tf \setmathfontstylealternate\s!tf}
-\permanent\protected\def\mathss {\setmathattribute\s!ss\s!tf \setmathfontstylealternate\s!tf}
-\permanent\protected\def\mathtt {\setmathattribute\s!tt\s!tf \setmathfontstylealternate\s!tf}
-
-\permanent\protected\def\mathtf {\setmathfontstyle\s!tf \setmathfontstylealternate\s!tf}
-\permanent\protected\def\mathsl {\setmathfontstyle\s!it \setmathfontstylealternate\s!it} % no sl
-\permanent\protected\def\mathit {\setmathfontstyle\s!it \setmathfontstylealternate\s!it}
-
-\permanent\protected\def\mathbf {\setmathfontstyle\s!bf \setmathfontstylealternate\s!bf}
-\permanent\protected\def\mathbs {\setmathfontstyle\s!bi \setmathfontstylealternate\s!bi} % no sl
-\permanent\protected\def\mathbi {\setmathfontstyle\s!bi \setmathfontstylealternate\s!bi}
-
-\aliased\let\mathdefault\mathitalic
+\permanent\protected\def\math_upright {\setmathattribute\s!regular\s!tf\setmathfontstylealternate\s!tf}
+\permanent\protected\def\math_italic {\setmathattribute\s!regular\s!it\setmathfontstylealternate\s!it}
+%permanent\protected\def\math_script {\setmathalphabet \s!script \setmathfontstylealternate\s!script\setmathvariant\s!handwriting}
+%permanent\protected\def\math_calligraphic{\setmathalphabet \s!script \setmathfontstylealternate\s!script\setmathvariant\s!calligraphy}
+\permanent\protected\def\math_script {\setmathalphabet \s!script \setmathfontstylealternate\s!script}
+\permanent\protected\def\math_calligraphic{\setmathalphabet \s!calligraphic\setmathfontstylealternate\s!calligraphic}
+\permanent\protected\def\math_fraktur {\setmathalphabet \s!fraktur \setmathfontstylealternate\s!fraktur}
+\permanent\protected\def\math_blackboard {\setmathalphabet \s!blackboard \setmathfontstylealternate\s!blackboard}
+
+\permanent\protected\def\mathupright {\mathgroupedcommandcs\math_upright }
+\permanent\protected\def\mathitalic {\mathgroupedcommandcs\math_italic }
+\permanent\protected\def\mathscript {\mathgroupedcommandcs\math_script }
+\permanent\protected\def\mathcalligraphic{\mathgroupedcommandcs\math_calligraphic}
+\permanent\protected\def\mathfraktur {\mathgroupedcommandcs\math_fraktur }
+\permanent\protected\def\mathblackboard {\mathgroupedcommandcs\math_blackboard }
+
+\permanent\protected\def\math_rm{\setmathattribute\s!rm\s!tf\setmathfontstylealternate\s!tf}
+\permanent\protected\def\math_ss{\setmathattribute\s!ss\s!tf\setmathfontstylealternate\s!tf}
+\permanent\protected\def\math_tt{\setmathattribute\s!tt\s!tf\setmathfontstylealternate\s!tf}
+
+\permanent\protected\def\math_tf{\setmathfontstyle\s!tf\setmathfontstylealternate\s!tf}
+\permanent\protected\def\math_sl{\setmathfontstyle\s!it\setmathfontstylealternate\s!it} % no sl
+\permanent\protected\def\math_it{\setmathfontstyle\s!it\setmathfontstylealternate\s!it}
+
+\permanent\protected\def\math_bf{\setmathfontstyle\s!bf\setmathfontstylealternate\s!bf}
+\permanent\protected\def\math_bs{\setmathfontstyle\s!bi\setmathfontstylealternate\s!bi} % no sl
+\permanent\protected\def\math_bi{\setmathfontstyle\s!bi\setmathfontstylealternate\s!bi}
+
+\permanent\protected\def\mathrm{\mathgroupedcommandcs\math_rm} % \relax not needed
+\permanent\protected\def\mathss{\mathgroupedcommandcs\math_ss}
+\permanent\protected\def\mathtt{\mathgroupedcommandcs\math_tt}
+
+\permanent\protected\def\mathtf{\mathgroupedcommandcs\math_tf}
+\permanent\protected\def\mathsl{\mathgroupedcommandcs\math_sl}
+\permanent\protected\def\mathit{\mathgroupedcommandcs\math_it}
+
+\permanent\protected\def\mathbf{\mathgroupedcommandcs\math_bf}
+\permanent\protected\def\mathbs{\mathgroupedcommandcs\math_bs}
+\permanent\protected\def\mathbi{\mathgroupedcommandcs\math_bi}
+
+\aliased\let\math_default\math_italic
+\aliased\let\mathdefault \math_italic
\appendtoks
\edef\p_default{\mathematicsparameter\c!default}%
\ifx\p_default\v!normal
- \enforced\let\mathdefault\mathupright
+ \enforced\let\mathdefault \math_upright
+ \enforced\let\math_default\math_upright
\else
- \enforced\let\mathdefault\mathitalic
+ \enforced\let\mathdefault \math_italic
+ \enforced\let\math_default\math_italic
\fi
\to \everysetupmathematics
@@ -530,27 +1592,28 @@
\aliased\let\Bbb\mathblackboard
-\permanent\protected\def\frak {\ifmmode\expandafter\mathfraktur \fi}
-\permanent\protected\def\cal {\ifmmode\expandafter\mathscript \fi}
-\permanent\protected\def\bbd {\ifmmode\expandafter\mathblackboard\fi}
-\permanent\protected\def\blackboard{\ifmmode\expandafter\mathblackboard\fi}
-\permanent\protected\def\fraktur {\ifmmode\expandafter\mathfraktur \fi}
-\permanent\protected\def\gothic {\ifmmode\expandafter\mathfraktur \fi}
-
-\permanent\protected\def\mathcal #1{{\mathscript #1}} % for AMS compatibility
-\permanent\protected\def\mathfrak#1{{\mathfraktur #1}} % for AMS compatibility
-\permanent\protected\def\mathbb #1{{\mathblackboard#1}} % for AMS compatibility
-
-\ifdefined\normaltf \else \permanent\let\normaltf\tf \fi \permanent\protected\def\tf{\ifmmode\mathtf\else\normaltf\fi}
-\ifdefined\normalbf \else \permanent\let\normalbf\bf \fi \permanent\protected\def\bf{\ifmmode\mathbf\else\normalbf\fi}
-\ifdefined\normalit \else \permanent\let\normalit\it \fi \permanent\protected\def\it{\ifmmode\mathit\else\normalit\fi}
-\ifdefined\normalsl \else \permanent\let\normalsl\sl \fi \permanent\protected\def\sl{\ifmmode\mathsl\else\normalsl\fi}
-\ifdefined\normalbi \else \permanent\let\normalbi\bi \fi \permanent\protected\def\bi{\ifmmode\mathbi\else\normalbi\fi}
-\ifdefined\normalbs \else \permanent\let\normalbs\bs \fi \permanent\protected\def\bs{\ifmmode\mathbs\else\normalbs\fi}
-
-\permanent\protected\def\rm{\ifmmode\mathrm\else\normalrm\fi}
-\permanent\protected\def\ss{\ifmmode\mathss\else\normalss\fi}
-\permanent\protected\def\tt{\ifmmode\mathtt\else\normaltt\fi}
+\permanent\protected\def\frak {\ifmmode\expandafter\mathfraktur \fi}
+\permanent\protected\def\cal {\ifmmode\expandafter\mathcalligraphic\fi}
+\permanent\protected\def\bbd {\ifmmode\expandafter\mathblackboard \fi}
+\permanent\protected\def\blackboard{\ifmmode\expandafter\mathblackboard \fi}
+\permanent\protected\def\fraktur {\ifmmode\expandafter\mathfraktur \fi}
+\permanent\protected\def\gothic {\ifmmode\expandafter\mathfraktur \fi}
+
+\aliased\let\mathcal \mathcalligraphic % for AMS compatibility
+\aliased\let\mathscr \mathscript % for AMS compatibility
+\aliased\let\mathfrak\mathfraktur % for AMS compatibility
+\aliased\let\mathbb \mathblackboard % for AMS compatibility
+
+\ifdefined\normaltf \else \permanent\let\normaltf\tf \fi \permanent\protected\def\tf{\ifmmode\expandafter\mathtf\else\expandafter\normaltf\fi}
+\ifdefined\normalbf \else \permanent\let\normalbf\bf \fi \permanent\protected\def\bf{\ifmmode\expandafter\mathbf\else\expandafter\normalbf\fi}
+\ifdefined\normalit \else \permanent\let\normalit\it \fi \permanent\protected\def\it{\ifmmode\expandafter\mathit\else\expandafter\normalit\fi}
+\ifdefined\normalsl \else \permanent\let\normalsl\sl \fi \permanent\protected\def\sl{\ifmmode\expandafter\mathsl\else\expandafter\normalsl\fi}
+\ifdefined\normalbi \else \permanent\let\normalbi\bi \fi \permanent\protected\def\bi{\ifmmode\expandafter\mathbi\else\expandafter\normalbi\fi}
+\ifdefined\normalbs \else \permanent\let\normalbs\bs \fi \permanent\protected\def\bs{\ifmmode\expandafter\mathbs\else\expandafter\normalbs\fi}
+
+\permanent\protected\def\rm{\ifmmode\expandafter\mathrm\else\expandafter\normalrm\fi}
+\permanent\protected\def\ss{\ifmmode\expandafter\mathss\else\expandafter\normalss\fi}
+\permanent\protected\def\tt{\ifmmode\expandafter\mathtt\else\expandafter\normaltt\fi}
\ifdefined\mr \else \let\mr\relax \fi % hm ... permanent
\ifdefined\mb \else \let\mb\relax \fi % hm ... permanent
@@ -562,7 +1625,7 @@
% 5: $e=mc^2 \quad \mb e=mc^2$
\prependtoks
- \mathdefault
+ \math_default
\to \everymathematics
%D We could set the rendering attribute at the \LUA\ end but as there can be many
@@ -582,7 +1645,7 @@
%D \stopformula
%D \stoptyping
-\newcount\c_math_renderings_attribute
+\newinteger\c_math_renderings_attribute
\appendtoks
\c_math_renderings_attribute\clf_mathrenderset{\mathematicsparameter\c!symbolset}\relax
@@ -607,22 +1670,22 @@
\permanent\protected\def\boldsymbol
{\mathortext\mathboldsymbol\bold}
-%D Helpers
-
-\permanent\def\utfmathclass #1{\clf_utfmathclass {#1}}
-\permanent\def\utfmathstretch#1{\clf_utfmathstretch{#1}}
-\permanent\def\utfmathcommand#1{\clf_utfmathcommand{#1}}
-\permanent\def\utfmathfiller #1{\clf_utfmathfiller {#1}}
+%D Helpers (defined at the \LUA\ end):
-\permanent\def\utfmathcommandabove #1{\clf_utfmathcommandabove {#1}}
-\permanent\def\utfmathcommandbelow #1{\clf_utfmathcommandbelow {#1}}
-\permanent\def\utfmathcommandfiller#1{\clf_utfmathcommandfiller{#1}}
-
-\permanent\protected\def\doifelseutfmathaccent#1{\clf_doifelseutfmathaccent{#1}}
-\permanent\protected\def\doifelseutfmathabove #1{\clf_doifelseutfmathabove {#1}}
-\permanent\protected\def\doifelseutfmathbelow #1{\clf_doifelseutfmathbelow {#1}}
-\permanent\protected\def\doifelseutfmathfiller#1{\clf_doifelseutfmathfiller{#1}}
-\permanent\protected\def\doifelseutfmathlimop #1{\clf_doifelseutfmathlimop {#1}}
+% \utfmathclass #1
+% \utfmathstretch #1
+% \utfmathcommand #1
+% \utfmathfiller #1
+%
+% \utfmathcommandabove #1..
+% \utfmathcommandbelow #1..
+% \utfmathcommandfiller #1..
+%
+% \doifelseutfmathaccent #1#2#3
+% \doifelseutfmathabove #1#2#3
+% \doifelseutfmathbelow #1#2#3
+% \doifelseutfmathfiller #1#2#3
+% \doifelseutfmathlimop #1#2#3
\aliased\let\doifutfmathaccentelse \doifelseutfmathaccent
\aliased\let\doifutfmathaboveelse \doifelseutfmathabove
@@ -632,36 +1695,46 @@
%D Not used that much:
-\installcorenamespace{mathcodecommand}
-
-\permanent\protected\def\mathlimop#1{\mathop{#1}} %no \limits
+\permanent\protected\def\mathlimop#1{\normalmathop{#1}} %no \limits
\permanent\protected\def\mathbox #1{\dontleavehmode\hbox\Ustartmath\mathsurround\zeropoint#1\Ustopmath}
-\permanent\protected\def\mathnolop#1{\mathop{#1}\nolimits}
-
-\aliased\let\mathnothing\firstofoneunexpanded
-\aliased\let\mathalpha \firstofoneunexpanded
-
-\setnewconstant\mathordcode \zerocount \letvalue{\??mathcodecommand ord}\mathord
-\setnewconstant\mathopcode \plusone \letvalue{\??mathcodecommand op}\mathop
-\setnewconstant\mathbincode \plustwo \letvalue{\??mathcodecommand bin}\mathbin
-\setnewconstant\mathrelcode \plusthree \letvalue{\??mathcodecommand rel}\mathrel
-\setnewconstant\mathopencode \plusfour \letvalue{\??mathcodecommand open}\mathopen
-\setnewconstant\mathclosecode \plusfive \letvalue{\??mathcodecommand close}\mathclose
-\setnewconstant\mathpunctcode \plussix \letvalue{\??mathcodecommand punct}\mathpunct
-\setnewconstant\mathalphacode \plusseven \letvalue{\??mathcodecommand alpha}\mathalpha
-\setnewconstant\mathinnercode \zerocount \letvalue{\??mathcodecommand inner}\mathinner
-\setnewconstant\mathnothingcode \zerocount \letvalue{\??mathcodecommand nothing}\mathnothing
-\setnewconstant\mathlimopcode \plusone \letvalue{\??mathcodecommand limop}\mathlimop
-\setnewconstant\mathnolopcode \plusone \letvalue{\??mathcodecommand nolop}\mathnolop
-\setnewconstant\mathboxcode \zerocount \letvalue{\??mathcodecommand box}\mathbox
-\setnewconstant\mathchoicecode \zerocount %letvalue{\??mathcodecommand choice}\mathnothing
-
-\setnewconstant\mathaccentcode \pluseight
-\setnewconstant\mathradicalcode \plusnine
-
-\permanent \def\mathcodenumber #1{\the\csname math#1code\endcsname}
-\permanent\protected\def\mathcodecommand#1{\csname\??mathcodecommand#1\endcsname}
-\permanent \def\mathcodechecked#1{\ifcsname math#1code\endcsname\lastnamedcs\else#1\fi}
+\permanent\protected\def\mathnolop#1{\normalmathop{#1}\nolimits}
+
+% \permanent\protected\def\mathlimop#1{\mathatom \mathoperatorcode options "C0000 {#1}} % auto "40000 + "80000
+% \permanent\protected\def\mathnolop#1{\mathatom \mathoperatorcode options "80000 {#1}}
+
+% \aliased\let\mathnothing\firstofoneunexpanded
+% \aliased\let\mathalpha \firstofoneunexpanded
+
+\ifdefined\mathop \else \aliased\let\mathop \normalmathoperator \aliased\let\normalmathop \normalmathoperator \fi
+\ifdefined\mathord \else \aliased\let\mathord \normalmathordinary \aliased\let\normalmathord \normalmathordinary \fi
+\ifdefined\mathbin \else \aliased\let\mathbin \normalmathbinary \aliased\let\normalmathbin \normalmathbinary \fi
+\ifdefined\mathrel \else \aliased\let\mathrel \normalmathrelation \aliased\let\normalmathrel \normalmathrelation \fi
+\ifdefined\mathpunct \else \aliased\let\mathpunct\normalmathpunctuation \aliased\let\normalmathpunct\normalmathpunctuation \fi
+\ifdefined\underline \else \aliased\let\underline\normalmathunderline \aliased\let\normalunderline\normalmathunderline \fi
+\ifdefined\overline \else \aliased\let\overline \normalmathoverline \aliased\let\normaloverline \normalmathoverline \fi
+
+\permanent\def\mathcodechecked#1%
+ {\numexpr
+ \iftok{#1}\emptytoks
+ \mathordinarycode
+ \orelse\ifchknum#1\or
+ \lastchknum
+ \orelse\ifchknum\begincsname math#1code\endcsname\or % maybe some day a hash for this
+ \lastchknum
+ \else
+ \mathordinarycode
+ \fi
+ \relax}
+
+\permanent\def\mathcodenumber#1%
+ {\the\mathcodechecked{#1}}
+
+\permanent\protected\def\mathcodecommand#1%
+ {\mathatom \s!class \mathcodechecked{#1}}
+
+\def\math_class_by_parameter #1#2{\normalexpanded{\noexpand\mathcodechecked{#1#2}}}
+\def\math_atom_by_parameter #1{\normalexpanded{\noexpand\math_atom_by_parameter_indeed{#1\c!mathclass}}}
+\def\math_atom_by_parameter_indeed#1{\mathatom \s!class \mathcodechecked{#1}}
% \startlines
% $\mathopnolimits{\rm d}x$
@@ -692,7 +1765,7 @@
\orelse\ifparameter#2\or
\frozen\protected\defcsname\??mathcommand#1\endcsname{\mathcodecommand{#2}{#4}}%
\else
- \frozen\protected\defcsname\??mathcommand#1\endcsname{\mathcodecommand{nothing}{#4}}%
+ \frozen\protected\defcsname\??mathcommand#1\endcsname{#4}%
\fi
\ifparameter#1\or % safeguard
\letcsname#1\expandafter\endcsname\csname\??mathcommand#1\endcsname
@@ -703,48 +1776,71 @@
%D Let's define a few comands here:
-%definemathcommand [mathstrut] {\vphantom{(}}
-%definemathcommand [joinrel] {\mathrel{\mkern-3mu}}
-\definemathcommand [joinrel] [rel] {\mkern-3mu}
+%definemathcommand [mathstrut] {\vphantom{(}}
+%definemathcommand [joinrel] {\mathrel{\mkern-3mu}}
+\definemathcommand [joinrel] [\s!relation] {\mkern-3mu}
\immutable\chardef\c_math_strut"28
-% \protected\def\math_strut_htdp#1%
-% {\s!height\fontcharht#1\c_math_strut
-% \s!depth \fontchardp#1\c_math_strut}
-%
-% now we need this (kind of inefficient):
+%D For the evolution of these struts see the git repositories and older code in
+%D \MKIV\ and \MKI\ (commented code removed end April 2022).
-\protected\def\math_strut_htdp#1% nasty!
- {\s!height\dimexpr\mathscale#1\fontcharht#1\c_math_strut/\glyphscale\relax
- \s!depth \dimexpr\mathscale#1\fontchardp#1\c_math_strut/\glyphscale\relax}
+\let\math_strut_math_style\normalmathstyle
-\protected\def\math_strut_normal
- {\vrule
- \s!width \zeropoint
- \normalexpanded{\math_strut_htdp{\mathstylefont\normalmathstyle}}%
- \relax}
+% using \s!font \mathstylefontid\mathstyle\fam would needs expansion and guesswork
-\protected\def\math_strut_visual
- {\hskip-.01\emwidth
- \vrule
- \s!width .02\emwidth
- \normalexpanded{\math_strut_htdp{\mathstylefont\normalmathstyle}}%
- \relax
- \hskip-.01\emwidth}
+\appendtoks
+ \Umathruleheight\allmainstyles \strutheightfactor\fontspecifiedsize\textfont \zerocount
+ \Umathruledepth \allmainstyles \strutdepthfactor \fontspecifiedsize\textfont \zerocount
+ \Umathruleheight\allscriptstyles \strutheightfactor\fontspecifiedsize\scriptfont \zerocount
+ \Umathruledepth \allscriptstyles \strutdepthfactor \fontspecifiedsize\scriptfont \zerocount
+ \Umathruleheight\allscriptscriptstyles\strutheightfactor\fontspecifiedsize\scriptscriptfont\zerocount
+ \Umathruledepth \allscriptscriptstyles\strutdepthfactor \fontspecifiedsize\scriptscriptfont\zerocount
+\to \everybodyfont
+
+\protected\def\math_strut
+ {\normalsrule
+ \s!width \zeropoint
+ \s!fam \fam
+ \s!char \c_math_strut
+ \relax}
-\permanent\protected\def\showmathstruts % let's not overload \math_strut_normal
- {\enforced\let\math_strut\math_strut_visual}
+\permanent\protected\def\math_strut_height
+ {\normalsrule
+ \s!width \zeropoint
+ \s!depth \zeropoint
+ \s!fam \fam
+ \s!char \c_math_strut
+ \relax}
-\let\math_strut\math_strut_normal
+\permanent\protected\def\math_strut_depth
+ {\normalsrule
+ \s!width \zeropoint
+ \s!height\zeropoint
+ \s!fam \fam
+ \s!char \c_math_strut
+ \relax}
-% \protected\def\mathstrut{\mathcodecommand{nothing}{\math_strut}}
+\permanent\protected\def\showmathstruts % let's not overload \math_strut_normal
+ {\showmakeup[strut]}
\pushoverloadmode
+ \permanent\protected\def\mathstrut {\math_strut}
+ \permanent\protected\def\mathheightstrut{\math_strut_height}
+ \permanent\protected\def\mathdepthstrut {\math_strut_depth}
+\popoverloadmode
- \definemathcommand [mathstrut] {\math_strut}
+\permanent\protected\def\topstrut{\srule\s!width\zeropoint\s!height\strutht \s!depth\zeropoint\relax}
+\permanent\protected\def\botstrut{\srule\s!width\zeropoint\s!height\zeropoint\s!depth\strutdp \relax}
-\popoverloadmode
+% \newdimension\mathstrutht % see top
+% \newdimension\mathstrutdp % see top
+
+\appendtoks
+ \mathstrutht\strutht
+ \mathstrutdp\strutdp
+ % \writestatus{!!!!!!}{\the\mathstrutht,\the\mathstrutdp}%
+\to \everymathematics
%D We could have a arg variant \unknown\ but not now.
@@ -762,18 +1858,6 @@
% \let\normalmathop\mathop % already defined
-% no longer needed as we no longer switch fonts
-%
-% \protected\def\mathop
-% {\normalmathop
-% \bgroup
-% % no: \let\rm\mf
-% \afterassignment\math_op\let\nexttoken=}
-%
-% \def\math_op{\ifx\nexttoken\bgroup\else\nexttoken\egroup\fi}
-
-% this one too: \letvalue{\??mathcodecommand op}\mathop ?
-
\permanent\protected\def\normalmbox
{\normalhbox\bgroup
\usemathematicsstyleandcolor\c!textstyle\c!textcolor % new
@@ -816,8 +1900,8 @@
\let\math_tags_mo\firstofoneunexpanded
\let\math_tags_mi\firstofoneunexpanded
-\protected\def\math_tags_mn#1{\begingroup\mathupright\math_set_o_both#1\endgroup}
-\protected\def\math_tags_ms#1{\begingroup\mathupright\math_set_p_both#1\endgroup} % why not just \text
+\protected\def\math_tags_mn#1{\begingroup\math_upright\math_set_o_both#1\endgroup}
+\protected\def\math_tags_ms#1{\begingroup\math_upright\math_set_p_both#1\endgroup} % why not just \text
% Once this is stable we can store the number at the tex end which is
% faster. Functions getnumbers >= 1000.
@@ -830,52 +1914,79 @@
\c!functionstyle=, % rm ss etc i.e. known alternatives, otherwise math
\c!functioncolor=]
-\protected\def\math_mfunction_styled
- {\begingroup
- \usemathematicscolorparameter\c!functioncolor
- \edef\p_functionstyle{\mathematicsparameter\c!functionstyle}%
- \ifempty\p_functionstyle
- \expandafter\math_mfunction_styled_none
- \orelse\ifcsname\??alternativestyle\p_functionstyle\endcsname
- \expandafter\math_mfunction_styled_text
- \else
- \expandafter\math_mfunction_styled_math
- \fi}
+% in char-def:
+%
+%
+% \Umathcode"2061 = \mathghostcode \zerocount "2061 % \applyfunction
+% \Umathcode"2062 = \mathghostcode \zerocount "2062 % \invisibletimes
+% \Umathcode"2063 = \mathghostcode \zerocount "2063 % \invisiblecomma
+% \Umathcode"2064 = \mathghostcode \zerocount "2063 % \invisibleplus
+
+%D For previous variants of the function styling you can check the git repository
+%D end April 2022.
+
+% \startTEXpage[offset=1dk]
+% $\sin(x) = 10$
+% \m[functionstyle=sans]{\sin(x) = 10}
+% \startformula \sin(x) = 10 \stopformula
+% \startformula[functionstyle=sans] \sin(x) = 10 \stopformula
+% \stopTEXpage
-\protected\def\math_mfunction_styled_text#1%
- %{\mathoptext{\csname\??alternativestyle\p_functionstyle\endcsname#1}%
- {\expandafter\mathoptext\expandafter{\lastnamedcs#1}%
+\protected\def\math_function_handle#1#2#3%
+ {\begingroup
+ \resetdummyparameter\c!mathlimits
+ \getdummyparameters[#1]%
+ \edef\p_limits{\dummyparameter\c!mathlimits}%
+ \mathatom
+ mathfont
+ class \mathfunctioncode
+ \ifx\p_limits\v!no
+ nolimits
+ \orelse\ifx\p_limits\v!yes
+ limits
+ \orelse\ifx\p_limits\v!auto
+ nolimits
+ limits
+ \fi
+ \bgroup % textfont
+ \math_tags_mfunctionlab{#3}\c_apply_function
+ \usemathematicscolorparameter\c!functioncolor
+ \edef\p_functionstyle{\mathematicsparameter\c!functionstyle}%
+ \ifempty\p_functionstyle
+ \expandafter\math_upright
+ \orelse\ifcsname\??alternativestyle\p_functionstyle\endcsname
+ \expandafter\lastnamedcs
+ \else
+ \expandafter\p_functionstyle
+ \fi
+ #2{#3}%
+ \egroup
\endgroup}
-\protected\def\math_mfunction_styled_math#1%
- {\p_functionstyle
- #1%
- \endgroup}
+\appendtoks
+ \edef\p_functionstyle{\formulaparameter\c!functionstyle}%
+ \ifempty\p_functionstyle\else
+ \letmathematicsparameter\c!functionstyle\p_functionstyle
+ \fi
+ \edef\p_functioncolor{\formulaparameter\c!functioncolor}%
+ \ifempty\p_functioncolor\else
+ \letmathematicsparameter\c!functioncolor\p_functioncolor
+ \fi
+\to \everybeforedisplayformula
-\protected\def\math_mfunction_styled_none#1%
- {\mathupright
- #1%
- \endgroup}
+\permanent\tolerant\protected\def\mfunction [#1]{\math_function_handle{#1}\firstofoneargument}
+\permanent\tolerant\protected\def\mfunctionlabeltext[#1]{\math_function_handle{#1}\mathlabeltext}
-\permanent\protected\def\mfunction#1%
- {\begingroup
- \math_tags_mfunctiontxt{#1}\c_apply_function
- \math_mfunction_styled{#1}%
- \endgroup}
-
-\permanent\protected\def\mfunctionlabeltext#1%
- {\begingroup
- \math_tags_mfunctionlab{#1}\c_apply_function
- \math_mfunction_styled{\mathlabeltext{#1}}%
- \endgroup}
+\permanent\tolerant\protected\def\definemathfunction[#1]#*[#2]%
+ {\frozen\protected\defcsname#1\endcsname{\math_function_handle{#2}\mathlabeltext{#1}}} % \instance
\let\math_tags_mfunctiontxt\gobbletwoarguments
\let\math_tags_mfunctionlab\gobbletwoarguments
-\permanent\protected\def\math_tags_mo_indeed#1{\begingroup \c_attr_mathcategory\plusone #1\endgroup}
-\permanent\protected\def\math_tags_mi_indeed#1{\begingroup \c_attr_mathcategory\plustwo #1\endgroup}
-\permanent\protected\def\math_tags_mn_indeed#1{\begingroup\mathupright\c_attr_mathcategory\plusthree\math_set_o_both#1\endgroup}
-\permanent\protected\def\math_tags_ms_indeed#1{\begingroup\mathupright\c_attr_mathcategory\plusfour \math_set_p_both#1\endgroup} % todo: mathoptext
+\permanent\protected\def\math_tags_mo_indeed#1{\begingroup \c_attr_mathcategory\plusone #1\endgroup}
+\permanent\protected\def\math_tags_mi_indeed#1{\begingroup \c_attr_mathcategory\plustwo #1\endgroup}
+\permanent\protected\def\math_tags_mn_indeed#1{\begingroup\math_upright\c_attr_mathcategory\plusthree\math_set_o_both#1\endgroup}
+\permanent\protected\def\math_tags_ms_indeed#1{\begingroup\math_upright\c_attr_mathcategory\plusfour \math_set_p_both#1\endgroup} % todo: mathoptext
\newconditional\c_apply_function
@@ -913,25 +2024,6 @@
\enforced\let\apply\math_tags_apply
\to\everymathematics
-% \def\mlimitsfunction #1{\mathlimopcomm{{\mr#1}}
-% \def\mnolimitsfunction#1{\mathnolopcomm{{\mr#1}}
-
-% %D Taco posted this solution as response to a mail by Olivier, so let's integrate
-% %D it here.
-%
-% \def\currentmscaledstyle{rm} % will be plugged into the typeface text=ss option
-%
-% \protected\def\math_function_style_opnolimits #1{\mathop{\mscaledtext{#1}}\nolimits}
-% \protected\def\math_function_style_mfunction #1{\mscaledtext{\math_tags_function{#1}}}
-% \protected\def\math_function_style_mfunctionlabeltext#1{\mscaledtext{\math_tags_functionlabeltext{#1}}}
-%
-% \protected\def\setmathfunctionstyle#1% rm ss tt (can be made faster if needed)
-% {\doifsomething{#1}
-% {\def\currentmscaledstyle{#1}%
-% \let\mathopnolimits \math_function_style_opnolimits
-% \let\mfunction \math_function_style_mfunction
-% \let\mfunctionlabeltext\math_function_style_mfunctionlabeltext}}
-
\mutable\def\currentmscaledstyle{rm} % will be plugged into the typeface text=ss option
\permanent\protected\def\mscaledtext#1%
@@ -971,37 +2063,47 @@
%D \donknuthmode $x_2$ x_2 \test{$x_2$} \test{x_2}
%D \stoptyping
%D
-%D The result is as expected: the first line typesets ok, while the second
-%D one triggers an error message.
-
-\setnewconstant\activemathcharcode "8000
-
-\newtoks\activatedmathcharacters
+%D The result is as expected: the first line typesets ok, while the second one
+%D triggers an error message.
-\permanent\protected\def\activatemathcharacter#1%
- {\appendtoks
- \global\mathcode#1=\activemathcharcode
- \to \activatedmathcharacters}
-
-\permanent\def\activatemathcharacters
- {\the\activatedmathcharacters}
-
-% beware, not runtime, so has to happen at format generation
+% \setnewconstant\activemathcharcode "8000
+%
+% \newtoks\activatedmathcharacters
+%
+% \permanent\protected\def\activatemathcharacter#1%
+% {\appendtoks
+% \global\mathcode#1=\activemathcharcode
+% \to \activatedmathcharacters}
+%
+% \permanent\def\activatemathcharacters
+% {\the\activatedmathcharacters}
+%
+% % beware, not runtime, so has to happen at format generation
+%
+% \activatemathcharacter\circumflexasciicode
+% \activatemathcharacter\underscoreasciicode
+% %activatemathcharacter\ampersandasciicode
-\activatemathcharacter\circumflexasciicode
-\activatemathcharacter\underscoreasciicode
-\activatemathcharacter\ampersandasciicode
+% % already done in catc-def.mkxl:
+%
+% \amcode \circumflexasciicode \superscriptcatcode
+% \amcode \underscoreasciicode \subscriptcatcode
+% \amcode \barasciicode \othercatcode
+% \amcode \tildeasciicode \othercatcode
-\permanent\def\normalmathaligntab{&} % \let\normalmathaligntab\aligntab does to work well in a let to & (a def works ok)
+% \Umathcode\circumflexasciicode="0 "0 \circumflexasciicode
+% \Umathcode\underscoreasciicode="0 "0 \underscoreasciicode
-\appendtoks
- \edef\p_ampersand{\mathematicsparameter\s!ampersand}%
- \ifx\p_ampersand\v!normal
- \enforced\let\specialmathaligntab\normalmathaligntab
- \else
- \enforced\let\specialmathaligntab\mathampersand
- \fi
-\to \everysetupmathematics
+% \permanent\def\normalmathaligntab{&}
+%
+% \appendtoks
+% \edef\p_ampersand{\mathematicsparameter\s!ampersand}%
+% \ifx\p_ampersand\v!normal
+% \enforced\let\specialmathaligntab\normalmathaligntab
+% \else
+% \enforced\let\specialmathaligntab\mathampersand
+% \fi
+% \to \everysetupmathematics
%D A simplified version of this code is:
%D
@@ -1039,15 +2141,14 @@
%D $A \char"26 B$
%D \stoptyping
%D
-%D fails with: \type{Misplaced alignment tab character &} and here is the
-%D reason.
+%D fails with: \type{Misplaced alignment tab character &} and here is the reason.
%D
-%D When we have a letter or other category a check happens for an active
-%D character and when it has one then it gets expanded and fed back into the
-%D scanner (sort of).
+%D When we have a letter or other category a check happens for an active character
+%D and when it has one then it gets expanded and fed back into the scanner (sort
+%D of).
%D
-%D A \type {\char} is also fed back as raw character and again when it's letter
-%D of other goes through the same process.
+%D A \type {\char} is also fed back as raw character and again when it's letter of
+%D other goes through the same process.
%D
%D This means that we cannot have a definition like:
%D
@@ -1063,152 +2164,38 @@
%D
%D Maybe we need an option to treat chars like chars.
-% \activatemathcharacter\primeasciicode
-
-% not used:
-%
-% \mathcode\spaceasciicode\activemathcharcode
-%
-% not used:
-%
-% \bgroup
-% \catcode\underscoreasciicode\activecatcode
-% \doglobal\appendtoks
-% \mathcode\underscoreasciicode\activemathcharcode
-% \let_\activemathunderscore
-% \to \everymathematics
-% \egroup
-
-% Here follows some plain legacy: primes.
-%
-% The \let\prime\math_prime_indeed might become an obsolete as we have \doubleprime
-% and \tripleprime and collapsing can nicely handle the script then.
-%
-% Collapsing to 0x2033 and 0x2034 happens elsewhere.
-%
-% \switchtobodyfont[modern]
-% \switchtobodyfont[cambria]
-% \switchtobodyfont[xits]
-% \switchtobodyfont[minion]
-% \setupbodyfont[dejavu]
-%
-% \startbuffer
-% \def\SampleLine#1{%
-% \NC#1
-% \NC\switchtobodyfont[#1]$f^2$ % 1
-% \NC\switchtobodyfont[#1]$f\prime^2$ % 2
-% \NC\switchtobodyfont[#1]$f\prime\prime^2$ % 3
-% \NC\switchtobodyfont[#1]$f\prime\prime\prime^2$ % 4
-% \NC\switchtobodyfont[#1]$f{\prime}^2$ % 5
-% \NC\switchtobodyfont[#1]$f{\prime\prime}^2$ % 6
-% \NC\switchtobodyfont[#1]$f{\prime\prime\prime}^2$ % 7
-% \NC\switchtobodyfont[#1]$f'(x)$ % 8
-% \NC\switchtobodyfont[#1]$f''(x)$ % 9
-% \NC\switchtobodyfont[#1]$f'''(x)$ % 10
-% \NC\NR
-% }
-%
-% \starttabulate[|Tl|Tc|Tc|Tc|Tc|Tc|Tc|Tc|Tc|Tc|Tc|]
-% \NC\NC1\NC2\NC3\NC4\NC5\NC6\NC7\NC8\NC9\NC10\NC\NR
-% \SampleLine{modern}
-% \SampleLine{cambria}
-% \SampleLine{xits}
-% \SampleLine{minion}
-% \stoptabulate
-% \stopbuffer
-%
-% \typebuffer \getbuffer
-
-% most math fonts have messed up primes, just test this: $\prime^{\prime^{\prime}}$
-
-{ \catcode\circumflexasciicode\othercatcode \immutable\glet\othercircumflextoken ^ }
-{ \catcode\circumflexasciicode\superscriptcatcode \immutable\glet\superscriptcircumflextoken^ }
+%D The commented prime related code (dating from \MKII\ times has been removed in
+%D April 2022 but it's in the archives. In \LUAMETATEX\ primes are part of the
+%D machinery and additional magic (as in \MKIV) happens elsewhere. There is no
+%D need to remember old stuff because \MKII\ times are long gone.
\ifdefined \prime \else
\Umathchardef\prime "0 "0 "2032
\fi
-% \let\math_prime_indeed_normal\prime
-%
-% \appendtoks
-% \let\math_prime_indeed_normal\prime % gets defined later
-% \let\mathfontprime\prime % for tracing
-% \let\prime\math_prime_indeed % so this is needed
-% \to \everydump
-%
-% \protected\def\math_prime_indeed
-% {\iffontchar\textfont\zerocount"FE325\relax
-% ^\bgroup
-% \expandafter\math_prime_indeed_virtual % virtual mess (using funny signal)
-% \else
-% % \expandafter\math_prime_indeed_normal % gets collapsed
-% \expandafter\math_prime_indeed_crapped % gets collapsed
-% \fi}
-%
-% \def\math_prime_indeed_crapped
-% {{^{\math_prime_indeed_normal}}}
-%
-% % \let\prime\math_prime_indeed
-%
-% \def\math_prime_indeed_virtual
-% {\math_prime_indeed_normal
-% \futurelet\nexttoken\math_prime_indeed_choice}
-%
-% \installcorenamespace{mathprime}
-%
-% \def\math_prime_indeed_choice
-% {\csname\??mathprime
-% \ifx '\nexttoken a\else
-% \ifx \math_prime_indeed_normal\nexttoken a\else
-% \ifx \prime\nexttoken a\else
-% \ifx\superscriptcircumflextoken\nexttoken b\else
-% \ifx\othercircumflextoken \nexttoken b\else
-% c\fi\fi\fi\fi\fi
-% \endcsname}
-%
-% \setvalue{\??mathprime a}#1{\math_prime_indeed_virtual}
-% \setvalue{\??mathprime b}#1#2{#2\egroup}
-% \setvalue{\??mathprime c}{\egroup}
+%D We also dropped the option to let ampersands be alignment tabs. That has never
+%D been a \CONTEXT\ feature|/|habit anyway.
+
+% \bgroup
%
-% \let\activemathprime\math_prime_indeed
+% \catcode\underscoreasciicode\activecatcode
+% \catcode\circumflexasciicode\activecatcode
%
-% \bgroup
+% \aliased\glet\specialmathaligntab\normalmathaligntab
%
-% \catcode\primeasciicode\activecatcode
+% \permanent\protected\gdef\obeymathcatcodes{%
+% \enforced\let _\normalsubscript
+% \enforced\let ^\normalsuperscript
+% }
%
-% \global\everymathematics\expandafter{\the\everymathematics\let'\math_prime_indeed} % todo: do this at the lua end
+% \doglobal\appendtoks
+% \enforced\let _\normalsubscript
+% \enforced\let ^\normalsuperscript
+% \to \everymathematics
%
% \egroup
-% $\char26$ gives an error because it expands to an active character that
-% then becomes an & which is then seen as an alignment character; anyway,
-% even when we switch like this the different meaning only happens when
-% we're in math mode which can be delayed till we're in a cell
-
-\bgroup
-
- \catcode\underscoreasciicode\activecatcode
- \catcode\circumflexasciicode\activecatcode
- \catcode\ampersandasciicode \activecatcode
-
- \aliased\glet\specialmathaligntab\normalmathaligntab
-
- \permanent\protected\gdef\obeymathcatcodes{%
- \enforced\let _\normalsubscript
- \enforced\let ^\normalsuperscript
- \enforced\def &\specialmathaligntab
- }
-
- \doglobal\appendtoks
- \enforced\let _\normalsubscript
- \enforced\let ^\normalsuperscript
- \enforced\let &\specialmathaligntab
- \to \everymathematics
-
- % \permanent\protected\gdef\normalmathampersands
- % {\let\specialmathaligntab\mathampersand}
-
-\egroup
+%D We keep this, just for the fun of it:
\newtoks\everydonknuthmode
\newtoks\everynonknuthmode
@@ -1365,8 +2352,8 @@
\installcorenamespace{mathaligndirection}
-\setvalue{\??mathaligndirection r2l}{\settrue\c_math_right_to_left}
-\setvalue{\??mathaligndirection\v!righttoleft}{\settrue\c_math_right_to_left}
+\defcsname\??mathaligndirection r2l\endcsname{\settrue\c_math_right_to_left}
+\defcsname\??mathaligndirection\v!righttoleft\endcsname{\settrue\c_math_right_to_left}
\appendtoks
\ifcsname\??mathaligndirection\mathematicsparameter\c!align\endcsname
@@ -1386,26 +2373,26 @@
\math_basics_synchronize_direction
\to \everyswitchmathematics
-% experimental (needed for an article)
-
-\installcorenamespace {mathbidi}
-
-\newcount\c_math_bidi
+% experimental (needed for an article) .. this is is no longer neded
-\def\math_bidi_enable {\clf_setmathdirection\plusone \relax\c_math_bidi\plusone}
-\def\math_bidi_disable{\clf_setmathdirection\zerocount\relax\c_math_bidi\attributeunsetvalue}
-
-\letvalue{\??mathbidi\v!yes}\math_bidi_enable
-\letvalue{\??mathbidi\v!no }\math_bidi_disable
-
-\appendtoks
- \edef\p_bidi{\mathematicsparameter\c!bidi}% still needed ?
- \ifcsname\??mathbidi\p_bidi\endcsname\lastnamedcs\else\math_bidi_disable\fi
-\to \everysetupmathematics
-
-\appendtoks
- \c_attr_mathbidi\ifconditional\c_math_right_to_left\c_math_bidi\else\attributeunsetvalue\fi
-\to \everyswitchmathematics
+% \installcorenamespace {mathbidi}
+%
+% \newcount\c_math_bidi
+%
+% \def\math_bidi_enable {\clf_setmathdirection\plusone \relax\c_math_bidi\plusone}
+% \def\math_bidi_disable{\clf_setmathdirection\zerocount\relax\c_math_bidi\attributeunsetvalue}
+%
+% \letcsname\??mathbidi\v!yes\endcsname\math_bidi_enable
+% \letcsname\??mathbidi\v!no \endcsname\math_bidi_disable
+%
+% \appendtoks
+% \edef\p_bidi{\mathematicsparameter\c!bidi}% still needed ?
+% \ifcsname\??mathbidi\p_bidi\endcsname\lastnamedcs\else\math_bidi_disable\fi
+% \to \everysetupmathematics
+%
+% \appendtoks
+% \c_attr_mathbidi\ifconditional\c_math_right_to_left\c_math_bidi\else\attributeunsetvalue\fi
+% \to \everyswitchmathematics
%D Delayed: greek.
%D
@@ -1425,23 +2412,9 @@
\newconstant\c_math_greek_attribute
-\setvalue{\??mathgreek\v!none }{1}
-\setvalue{\??mathgreek\v!normal}{2}
-\setvalue{\??mathgreek\v!italic}{3}
-
-% \appendtoks
-% \edef\p_sygreek{\mathematicsparameter\s!sygreek}%
-% \edef\p_lcgreek{\mathematicsparameter\s!lcgreek}%
-% \edef\p_ucgreek{\mathematicsparameter\s!ucgreek}%
-% \c_math_greek_attribute"% hex digits
-% \csname\??mathgreek\ifcsname\??mathgreek\p_sygreek\endcsname\p_sygreek\else\v!none\fi\endcsname
-% \csname\??mathgreek\ifcsname\??mathgreek\p_lcgreek\endcsname\p_lcgreek\else\v!none\fi\endcsname
-% \csname\??mathgreek\ifcsname\??mathgreek\p_ucgreek\endcsname\p_ucgreek\else\v!none\fi\endcsname
-% \relax
-% \ifcase\c_math_greek_attribute
-% \c_math_greek_attribute\attributeunsetvalue
-% \fi
-% \to \everyswitchmathematics
+\defcsname\??mathgreek\v!none \endcsname{1}
+\defcsname\??mathgreek\v!normal\endcsname{2}
+\defcsname\??mathgreek\v!italic\endcsname{3}
\appendtoks
\edef\p_sygreek{\mathematicsparameter\s!sygreek}% still needed ?
@@ -1481,11 +2454,16 @@
\setnewconstant\c_math_collapsing_attribute\attributeunsetvalue
-\letvalue{\??mathcollapsing 1}\plusone % specials
-\letvalue{\??mathcollapsing 2}\plustwo % specials + mathlist
-\letvalue{\??mathcollapsing 3}\plusthree % mathlist + specials
-\letvalue{\??mathcollapsing\v!none }\attributeunsetvalue
-\letvalue{\??mathcollapsing\v!reset}\attributeunsetvalue
+\letcsname\??mathcollapsing 0\endcsname\zerocount % enforced (primes)
+\letcsname\??mathcollapsing\s!tex \endcsname\zerocount
+\letcsname\??mathcollapsing 1\endcsname\plusone % enforced | specials
+\letcsname\??mathcollapsing\v!default\endcsname\plusone
+\letcsname\??mathcollapsing 2\endcsname\plustwo % enforced | specials | mathlist
+\letcsname\??mathcollapsing\v!all \endcsname\plustwo
+\letcsname\??mathcollapsing 3\endcsname\plusthree % enforced | mathlist | specials
+\letcsname\??mathcollapsing\v!list \endcsname\plusthree
+\letcsname\??mathcollapsing\v!none \endcsname\attributeunsetvalue
+\letcsname\??mathcollapsing\v!reset \endcsname\attributeunsetvalue
\def\math_collapsing_initialize
{\ifnum\c_math_collapsing_attribute=\attributeunsetvalue \else
@@ -1511,18 +2489,42 @@
%D Math italics (experiment)
%D We need keys but what names to use and because we have hardcoded solution
-%D we can stick to numbers.
+%D we can stick to numbers. At some point this will change because we can now
+%D control in in the engine and goodies per font.
-\installcorenamespace{mathitalics}
+% \installcorenamespace{mathitalics}
+%
+% \setnewconstant\c_math_italics_attribute\attributeunsetvalue
+%
+% \letcsname\??mathitalics 1\endcsname\plusone % fontitalics
+% \letcsname\??mathitalics 2\endcsname\plustwo % fontdata
+% \letcsname\??mathitalics 3\endcsname\plusthree % quad based
+% \letcsname\??mathitalics 4\endcsname\plusfour % combination of 1 and 3
+% \letcsname\??mathitalics \v!none\endcsname\attributeunsetvalue
+% \letcsname\??mathitalics\v!reset\endcsname\attributeunsetvalue
+%
+% \def\math_italics_initialize
+% {\ifnum\c_math_italics_attribute=\attributeunsetvalue \else
+% \clf_initializemathitalics % one time
+% \glet\math_italics_initialize\relax
+% \fi}
+%
+% \appendtoks
+% \edef\p_italics{\mathematicsparameter\s!italics}%
+% \c_math_italics_attribute
+% \ifcsname\??mathitalics\p_italics\endcsname\lastnamedcs\else\attributeunsetvalue\fi
+% \relax
+% % \math_italics_initialize
+% \to \everyswitchmathematics % only in mathematics
+%
+% \appendtoks
+% \math_italics_initialize
+% \c_attr_mathitalics\c_math_italics_attribute
+% \to \everymathematics
\setnewconstant\c_math_italics_attribute\attributeunsetvalue
-\letvalue{\??mathitalics 1}\plusone % fontitalics
-\letvalue{\??mathitalics 2}\plustwo % fontdata
-\letvalue{\??mathitalics 3}\plusthree % quad based
-\letvalue{\??mathitalics 4}\plusfour % combination of 1 and 3
-\letvalue{\??mathitalics\v!none }\attributeunsetvalue
-\letvalue{\??mathitalics\v!reset}\attributeunsetvalue
+% merge these:
\def\math_italics_initialize
{\ifnum\c_math_italics_attribute=\attributeunsetvalue \else
@@ -1533,9 +2535,14 @@
\appendtoks
\edef\p_italics{\mathematicsparameter\s!italics}%
\c_math_italics_attribute
- \ifcsname\??mathitalics\p_italics\endcsname\lastnamedcs\else\attributeunsetvalue\fi
+ \ifx\p_italics\v!none
+ \attributeunsetvalue
+ \orelse\ifx\p_italics\v!reset
+ \attributeunsetvalue
+ \else
+ \plusone
+ \fi
\relax
- % \math_italics_initialize
\to \everyswitchmathematics % only in mathematics
\appendtoks
@@ -1543,9 +2550,6 @@
\c_attr_mathitalics\c_math_italics_attribute
\to \everymathematics
-% \setupmathematics % done later
-% [\s!italics=3] % 4 is probably better
-
% looks nicer but can generate bogus csnames
%
% \setvalue{\??mathitalics1}{\math_italics_initialize\c_math_italics_attribute\plusone } % fontitalics
@@ -1600,29 +2604,29 @@
% \protected\def\disablemathpunctuation{\setfalse\automathpunctuation}
%
% \appendtoks
-% \doifelse{\mathematicsparameter\v!autopunctuation}\v!yes\settrue\setfalse\automathpunctuation
+% \doifelse{\mathematicsparameter\c!autopunctuation}\v!yes\settrue\setfalse\automathpunctuation
% \to \everyswitchmathematics
%
% \setupmathematics
-% [\v!autopunctuation=\v!no]
+% [\c!autopunctuation=\v!no]
%
% \def\math_punctuation_next{\ifx\nexttoken\blankspace\signalcharacter\fi}
%
% \protected\def\math_punctuation_comma {\textcomma \futurelet\nexttoken\math_punctuation_next}
% \protected\def\math_punctuation_period{\textperiod\futurelet\nexttoken\math_punctuation_next}
%
-% \setnewconstant\c_math_comma "002C
-% \setnewconstant\c_math_period "002E
+% \setnewconstant\commaasciicode "002C
+% \setnewconstant\periodasciicode "002E
% \setnewconstant\c_math_special"8000
%
% \bgroup
%
-% \catcode\c_math_comma \activecatcode
-% \catcode\c_math_period\activecatcode
+% \catcode\commaasciicode \activecatcode
+% \catcode\periodasciicode\activecatcode
%
% \protected\gdef\math_punctuation_initialize_indeed
-% {\mathcode\c_math_comma \c_math_special
-% \mathcode\c_math_period\c_math_special
+% {\mathcode\commaasciicode \c_math_special
+% \mathcode\periodasciicode\c_math_special
% \let,\math_punctuation_comma
% \let.\math_punctuation_period
% \c_attr_mathpunctuation\plustwo}
@@ -1662,29 +2666,49 @@
%
% The next one is more efficient as it produces more flat noad lists for numbers.
-\setnewconstant\c_math_comma "002C
-\setnewconstant\c_math_period "002E
-%setnewconstant\c_math_colon "003A
-\setnewconstant\c_math_semicolon"003B
-\setnewconstant\c_math_special "8000
+%D This is a dirty trick. In order to prevent a loop due to reinjection, when a
+%D active one is seen, the amcode is set to other. So, afterwards we need to
+%D reactivate. Eventually this feature will be dropped in favor of a more modern
+%D mechanism.
-% todo: use \Umathclass\c_math_comma\mathpunctcode etc for temporary switching
+%D These amcodes can be alignmenttab, superscript, subscript, letter, otherchar, or
+%D active. That way we can avoid the "8000 hackery and let characters keep the
+%D proper class. The code is checked when we run into an active character in math
+%D mode
-\def\math_set_o_comma {\Umathcode\c_math_comma \mathordcode \zerocount\c_math_comma}
-\def\math_set_p_comma {\Umathcode\c_math_comma \mathpunctcode\zerocount\c_math_comma}
-\def\math_set_o_period {\Umathcode\c_math_period \mathordcode \zerocount\c_math_period}
-\def\math_set_p_period {\Umathcode\c_math_period \mathpunctcode\zerocount\c_math_period}
-\def\math_set_o_semicolon{\Umathcode\c_math_semicolon\mathordcode \zerocount\c_math_semicolon}
-\def\math_set_p_semicolon{\Umathcode\c_math_semicolon\mathpunctcode\zerocount\c_math_semicolon}
+\def\math_activeate_comma {\amcode\commaasciicode \activecatcode}
+\def\math_activeate_period {\amcode\periodasciicode \activecatcode}
+\def\math_activeate_semicolon{\amcode\semicolonasciicode\activecatcode}
-\edef\math_set_o_both {\math_set_o_period\math_set_o_comma}
-\edef\math_set_p_both {\math_set_p_period\math_set_p_comma}
+\def\math_set_o_comma {\Umathcode\commaasciicode \mathordinarycode \zerocount\commaasciicode}
+\def\math_set_p_comma {\Umathcode\commaasciicode \mathpunctuationcode\zerocount\commaasciicode}
+\def\math_set_o_period {\Umathcode\periodasciicode \mathordinarycode \zerocount\periodasciicode}
+\def\math_set_p_period {\Umathcode\periodasciicode \mathpunctuationcode\zerocount\periodasciicode}
+\def\math_set_o_semicolon{\Umathcode\semicolonasciicode\mathordinarycode \zerocount\semicolonasciicode}
+\def\math_set_p_semicolon{\Umathcode\semicolonasciicode\mathpunctuationcode\zerocount\semicolonasciicode}
-\protected\def\math_punctuation_nop_comma {\begingroup\math_set_p_comma ,\endgroup}
-\protected\def\math_punctuation_nop_period {\begingroup\math_set_o_period .\endgroup}
-\protected\def\math_punctuation_nop_semicolon{\begingroup\math_set_p_semicolon;\endgroup}
+\edef\math_set_o_both{\math_set_o_period\math_set_o_comma}
+\edef\math_set_p_both{\math_set_p_period\math_set_p_comma}
-% todo: use new lookahead stuff
+% We cannot use \mathchardef'd variants because then are intercepted as active, so:
+
+\protected\def\math_punctuation_nop_comma {\begingroup\math_set_p_comma ,\endgroup\math_activeate_comma }
+\protected\def\math_punctuation_nop_period {\begingroup\math_set_o_period .\endgroup\math_activeate_period }
+\protected\def\math_punctuation_nop_semicolon{\begingroup\math_set_p_semicolon;\endgroup\math_activeate_semicolon}
+
+\def\math_punctuation_comma_next {\begingroup\Umathcode\commaasciicode \ifx\nexttoken\blankspace\mathpunctuationcode\else\mathordinarycode\fi\zerocount\commaasciicode ,\endgroup\math_activeate_comma }
+\def\math_punctuation_period_next {\begingroup\Umathcode\periodasciicode \ifx\nexttoken\blankspace\mathpunctuationcode\else\mathordinarycode\fi\zerocount\periodasciicode .\endgroup\math_activeate_period }
+\def\math_punctuation_semicolon_next{\begingroup\Umathcode\semicolonasciicode\ifx\nexttoken\blankspace\mathpunctuationcode\else\mathordinarycode\fi\zerocount\semicolonasciicode;\endgroup\math_activeate_semicolon}
+
+% So, nicer is:
+%
+% \protected\def\math_punctuation_nop_comma {\Umathclass\mathpunctuationcode\commaasciicode \math_activeate_comma }
+% \protected\def\math_punctuation_nop_period {\Umathclass\mathordinarycode \periodasciicode \math_activeate_period }
+% \protected\def\math_punctuation_nop_semicolon{\Umathclass\mathpunctuationcode\semicolonasciicode\math_activeate_semicolon}
+%
+% \def\math_punctuation_comma_next {\Umathclass\ifx\nexttoken\blankspace\mathpunctuationcode\else\mathordinarycode\fi\commaasciicode \math_activeate_comma }
+% \def\math_punctuation_period_next {\Umathclass\ifx\nexttoken\blankspace\mathpunctuationcode\else\mathordinarycode\fi\periodasciicode \math_activeate_period }
+% \def\math_punctuation_semicolon_next{\Umathclass\ifx\nexttoken\blankspace\mathpunctuationcode\else\mathordinarycode\fi\semicolonasciicode\math_activeate_semicolon}
\protected\def\math_punctuation_all_comma {\futurelet\nexttoken\math_punctuation_comma_next}
\protected\def\math_punctuation_all_period {\futurelet\nexttoken\math_punctuation_period_next}
@@ -1694,55 +2718,47 @@
\let\math_punctuation_yes_period \math_punctuation_nop_period
\let\math_punctuation_yes_semicolon\math_punctuation_all_semicolon
-\def\math_punctuation_comma_next {\begingroup\Umathcode\c_math_comma \ifx\nexttoken\blankspace\mathordcode\else\mathordcode\fi\zerocount\c_math_comma ,\endgroup}
-\def\math_punctuation_period_next {\begingroup\Umathcode\c_math_period \ifx\nexttoken\blankspace\mathordcode\else\mathordcode\fi\zerocount\c_math_period .\endgroup}
-\def\math_punctuation_semicolon_next{\begingroup\Umathcode\c_math_semicolon\ifx\nexttoken\blankspace\mathordcode\else\mathordcode\fi\zerocount\c_math_semicolon;\endgroup}
-
\installcorenamespace {mathautopunctuation}
\bgroup
- \catcode\c_math_comma \activecatcode
- \catcode\c_math_period \activecatcode
- \catcode\c_math_semicolon\activecatcode
+ % This can and will be replaced by classes:
+
+ \catcode\commaasciicode \activecatcode
+ \catcode\periodasciicode \activecatcode
+ \catcode\semicolonasciicode\activecatcode
- \setgvalue{\??mathautopunctuation\v!no}%
+ \gdefcsname\??mathautopunctuation\v!no\endcsname
{\let,\math_punctuation_nop_comma
\let.\math_punctuation_nop_period
\let;\math_punctuation_nop_semicolon}
- % more efficient list:
- %
- % \setgvalue{\??mathautopunctuation\v!no}%
- % {\Umathcode\c_math_period\mathordcode \zerocount\c_math_period
- % \Umathcode\c_math_comma \mathpunctcode\zerocount\c_math_comma }
-
- \setgvalue{\??mathautopunctuation\v!yes}%
+ \gdefcsname\??mathautopunctuation\v!yes\endcsname
{\let,\math_punctuation_yes_comma
\let.\math_punctuation_yes_period
\let;\math_punctuation_nop_semicolon}
- \setgvalue{\??mathautopunctuation\v!all}%
+ \gdefcsname\??mathautopunctuation\v!all\endcsname
{\let,\math_punctuation_all_comma
\let.\math_punctuation_all_period
\let;\math_punctuation_nop_semicolon}
- \setgvalue{\??mathautopunctuation comma}%
+ \gdefcsname\??mathautopunctuation comma\endcsname
{\let,\math_punctuation_yes_comma
\let.\math_punctuation_yes_period
\let;\math_punctuation_nop_semicolon}
- \setgvalue{\??mathautopunctuation\v!yes\string,semicolon}%
+ \gdefcsname\??mathautopunctuation\v!yes\string,semicolon\endcsname
{\let,\math_punctuation_yes_comma
\let.\math_punctuation_yes_period
\let;\math_punctuation_yes_semicolon}
- \setgvalue{\??mathautopunctuation comma\string,semicolon}%
+ \gdefcsname\??mathautopunctuation comma\string,semicolon\endcsname
{\let,\math_punctuation_yes_comma
\let.\math_punctuation_yes_period
\let;\math_punctuation_yes_semicolon}
- \setgvalue{\??mathautopunctuation\v!all\string,semicolon}%
+ \gdefcsname\??mathautopunctuation\v!all\string,semicolon\endcsname
{\let,\math_punctuation_all_comma
\let.\math_punctuation_all_period
\let;\math_punctuation_all_semicolon}
@@ -1750,25 +2766,32 @@
\egroup
% \appendtoks
-% \global\mathcode\c_math_comma \c_math_special
-% \global\mathcode\c_math_period \c_math_special
-% \global\mathcode\c_math_semicolon\c_math_special
+% \global\mathcode\commaasciicode \c_math_special
+% \global\mathcode\periodasciicode \c_math_special
+% \global\mathcode\semicolonasciicode\c_math_special
% \to \everyjob
-% \activatemathcharacter\c_math_comma
-% \activatemathcharacter\c_math_period
-% \activatemathcharacter\c_math_semicolon
+% \activatemathcharacter\commaasciicode
+% \activatemathcharacter\periodasciicode
+% \activatemathcharacter\semicolonasciicode
+
+% \appendtoks
+% \mathcode\commaasciicode \c_math_special
+% \mathcode\periodasciicode \c_math_special
+% \mathcode\semicolonasciicode\c_math_special
+% \begincsname\??mathautopunctuation\mathematicsparameter\c!autopunctuation\endcsname
+% \to \everymathematics
\appendtoks
- \mathcode\c_math_comma \c_math_special
- \mathcode\c_math_period \c_math_special
- \mathcode\c_math_semicolon\c_math_special
- \begincsname\??mathautopunctuation\mathematicsparameter\v!autopunctuation\endcsname
+ \math_activeate_comma
+ \math_activeate_period
+ \math_activeate_semicolon
+ \begincsname\??mathautopunctuation\mathematicsparameter\c!autopunctuation\endcsname
\to \everymathematics
\appendtoks
- \ifcsname\??mathautopunctuation\mathematicsparameter\v!autopunctuation\endcsname \else
- \letmathematicsparameter\v!autopunctuation\v!no
+ \ifcsname\??mathautopunctuation\mathematicsparameter\c!autopunctuation\endcsname \else
+ \letmathematicsparameter\c!autopunctuation\v!no
\fi
\to \everysetupmathematics
@@ -1776,7 +2799,93 @@
\permanent\protected\def\disablemathpunctuation{\csname\??mathautopunctuation\v!yes\endcsname}
\setupmathematics
- [\v!autopunctuation=\v!no] % no | yes | all | comma | yes,semicolon | all,semicolon
+ [\c!autopunctuation=\v!no] % no | yes | all | comma | yes,semicolon | all,semicolon
+
+%D The next replaces the above:
+
+% \startbuffer
+% \im{x + 1,222,333.44 + x}\par
+% \im{x + 1.222.333,44 + x}\par
+% \im{x + 1, 222, 333. 44 + x}\par
+% \im{(1.5, 1.5) + (1,5;1,5)}\par
+% \im{111 2222}\par
+% \im{f: \reals\to\reals}\par
+% \im{f : \reals\to\reals}\par
+% \im{f\colon\reals\to\reals}\par
+% \im{f \colon\reals\to\reals}\par
+% \stopbuffer
+%
+% \startTEXpage[offset=1dk]
+% \setupmathematics[autospacing=yes] \getbuffer \blank
+% \setupmathematics[autonumbers=1] \getbuffer \blank
+% \setupmathematics[autonumbers=2] \getbuffer \blank
+% \setupmathematics[autonumbers=3] \getbuffer \blank
+% \setupmathematics[autonumbers=4] \getbuffer \blank
+% \setupmathematics[autonumbers=5] \getbuffer \blank
+% \setupmathematics[autonumbers=6] \getbuffer \blank
+% \stopTEXpage
+
+\installcorenamespace{autospacing}
+
+\permanent\protected\def\enablemathautospacing
+ {\attribute\mathspacingattribute\plusone
+ \clf_initializemathspacing}
+
+\permanent\protected\def\disablemathautospacing
+ {\attribute\mathspacingattribute\attributeunsetvalue}
+
+\appendtoks
+ \ifcstok{\mathematicsparameter\c!autospacing}\v!yes
+ \enablemathautospacing
+ \else
+ \disablemathautospacing
+ \fi
+\to \everysetupmathematics
+
+\setupmathematics
+ [\c!autospacing=\v!no]
+
+\permanent\protected\def\enablemathautonumbers
+ {\attribute\mathnumbersattribute\plusone
+ \clf_initializemathnumbers}
+
+\permanent\protected\def\disablemathautonumbers
+ {\attribute\mathnumbersattribute\attributeunsetvalue}
+
+\appendtoks
+ \edef\p_autonumbers{\mathematicsparameter\c!autonumbers}%
+ \ifchknum\p_autonumbers\or
+ \enablemathautonumbers % default
+ \attribute\mathnumbersattribute\p_autonumbers\relax
+ \orelse\ifx\p_autonumbers\v!no
+ \disablemathautonumbers
+ \else
+ \enablemathautonumbers % default
+ \fi
+\to \everysetupmathematics
+
+\setupmathematics
+ [\c!autonumbers=\v!no]
+
+\installcorenamespace{autofencing}
+
+\permanent\protected\def\enablemathautofencing
+ {\attribute\mathfencingattribute\plusone
+ \clf_initializemathfencing}
+
+\permanent\protected\def\disablemathautofencing
+ {\attribute\mathfencingattribute\attributeunsetvalue}
+
+\appendtoks
+ \ifcstok{\mathematicsparameter\c!autofencing}\v!yes
+ \enablemathautofencing
+ \else
+ \disablemathautofencing
+ \fi
+\to \everysetupmathematics
+
+\setupmathematics
+ [\c!autofencing=\v!no]
%D The consequences of setting this are as follows:
%D
@@ -1831,25 +2940,31 @@
% 7 = crampedscriptscript
\permanent\def\uncramped#1%
- {{\ifmathstyle
+ {\beginmathgroup
+ \ifmathstyle
\or \displaystyle \or
\or \textstyle \or
\or \scriptstyle \or
\or \scriptscriptstyle \fi
- #1}}
+ #1%
+ \endmathgroup}
\permanent\def\cramped#1%
- {{\ifmathstyle
+ {\beginmathgroup
+ \ifmathstyle
\crampeddisplaystyle \or \or % 0 -> 1
\crampedtextstyle \or \or % 2 -> 3
\crampedscriptstyle \or \or % 4 -> 5
\crampedscriptscriptstyle \fi % 6 -> 7
- #1}}
+ #1%
+ \endmathgroup}
\permanent\def\triggermathstyle#1{\Ustyle\numexpr#1\relax}
%permanent\def\mathstyletrigger#1{\numexpr#1\relax}
\permanent\let\mathstyletrigger \firstofoneargument
+\def\triggeredmathstyle#1{\Ustyle\numexpr\number#1\relax} % expandable
+
\permanent\def\triggeredmathstyleparameter#1% to bypass the relax
{\ifcase\numexpr\normalmathstyle\relax
#1\displaystyle \or % 0
@@ -1915,6 +3030,9 @@
\textface
\fi}
+% \permanent\def\mathstyleface#1% #1 is number (\normalmathstyle)
+% {\mathstylefont#1\relax}
+
\permanent\def\mathsmallstyleface#1% #1 is number (\normalmathstyle)
{\ifcase\numexpr#1\relax
\scriptface \or
@@ -1928,6 +3046,19 @@
\scriptface
\fi}
+% \permanent\def\mathsmallstyleface#1% #1 is number (\normalmathstyle)
+% {\mathstylefont\ifcase\numexpr#1\relax
+% \scriptstyle \or
+% \scriptstyle \or
+% \scriptstyle \or
+% \scriptstyle \or
+% \scriptscriptstyle \or
+% \scriptscriptstyle \or
+% \scriptscriptstyle \or
+% \scriptscriptstyle \else
+% \scriptstyle
+% \fi}
+
\permanent\def\mathstylecommand#1#2#3%
{\ifcase\numexpr\normalmathstyle\relax
\expandafter#1\or
@@ -2024,32 +3155,38 @@
% to be tested: {#1} but it could have side effects
-% \protected\def\mathstylehbox#1% sensitive for: a \over b => {a\over b} or \frac{a}{b}
-% {\normalexpanded{\hbox\bgroup
-% \startimath\triggermathstyle\normalmathstyle}\mathsurround\zeropoint#1\stopimath\egroup}
-
\permanent\protected\def\mathstylehbox#1#% sensitive for: a \over b => {a\over b} or \frac{a}{b}
{\math_style_hbox{#1}}
\protected\def\math_style_hbox#1#2% sensitive for: a \over b => {a\over b} or \frac{a}{b}
{\normalexpanded{\hbox#1\bgroup
- \startimath\triggermathstyle\normalmathstyle}\mathsurround\zeropoint#2\stopimath\egroup}
+ \startimath\triggeredmathstyle\normalmathstyle}\mathsurround\zeropoint#2\stopimath\egroup}
+
+% adaptive variant:
+%
+% \protected\def\math_style_hbox#1#2% sensitive for: a \over b => {a\over b} or \frac{a}{b}
+% {\normalexpanded{\setbox\scratchbox\hbox#1\bgroup
+% \mathbeginclass\lastrightclass
+% \startimath\Ustyle\the\mathstyle\relax}%
+% \mathsurround\zeropoint#2\stopimath\egroup
+% \box\scratchbox
+% \mathrightclass\lastrightclass }
\permanent\protected\def\mathstylevbox#1%
{\normalexpanded{\vbox\bgroup
- \startimath\triggermathstyle\normalmathstyle}\mathsurround\zeropoint#1\stopimath\egroup}
+ \startimath\triggeredmathstyle\normalmathstyle}\mathsurround\zeropoint#1\stopimath\egroup}
\permanent\protected\def\mathstylevcenter#1%
{\normalexpanded{\vcenter\bgroup
- \startimath\triggermathstyle\normalmathstyle}\mathsurround\zeropoint#1\stopimath\egroup}
+ \startimath\triggeredmathstyle\normalmathstyle}\mathsurround\zeropoint#1\stopimath\egroup}
\permanent\protected\def\mathstylevcenteredhbox#1%
{\normalexpanded{\vcenter\bgroup\hbox\bgroup
- \startimath\triggermathstyle\normalmathstyle}\mathsurround\zeropoint#1\stopimath\egroup\egroup}
+ \startimath\triggeredmathstyle\normalmathstyle}\mathsurround\zeropoint#1\stopimath\egroup\egroup}
\permanent\protected\def\mathstylevcenteredvbox#1%
{\normalexpanded{\vcenter\bgroup\vbox\bgroup
- \startimath\triggermathstyle\normalmathstyle}\mathsurround\zeropoint#1\stopimath\egroup\egroup}
+ \startimath\triggeredmathstyle\normalmathstyle}\mathsurround\zeropoint#1\stopimath\egroup\egroup}
\permanent\protected\def\setmathsmalltextbox#1#2#%
{\normalizebodyfontsize\m_math_text_choice_face{\mathsmallstyleface\normalmathstyle}%
@@ -2218,7 +3355,7 @@
\crampedscriptstyle \or
\fi}
-\newcount\c_math_saved_style
+\newinteger\c_math_saved_style
\permanent\protected\def\pushmathstyle % assumes begingroup .. endgroup
{\c_math_saved_style\mathstyle}
@@ -2308,44 +3445,26 @@
\fi
}
-\permanent\tolerant\protected\def\setmathstyle[#1]#;#=% so we accept [] and {}
- {\edef\m_math_style_asked{#1#2}%
- \ifempty\m_math_style_asked \else
- \math_style_set_indeed
- \fi}
-
\permanent\def\installmathstyle#1#2%
{\ifcsname\??mathstylecommand#1\endcsname \else
- \setvalue{\??mathstylecommand#1}{#2}%
+ \defcsname\??mathstylecommand#1\endcsname{#2}%
\fi}
\def\math_style_collect#1%
{\csname\??mathstylecommand#1\endcsname}
-\setvalue{\??mathstylecommand\s!display }{\c_math_styles_state_style \plusone}
-\setvalue{\??mathstylecommand\s!text }{\c_math_styles_state_style \plustwo}
-\setvalue{\??mathstylecommand\s!script }{\c_math_styles_state_style \plusthree}
-\setvalue{\??mathstylecommand\s!scriptscript}{\c_math_styles_state_style \plusfour}
-
-\setvalue{\??mathstylecommand\s!uncramped }{\c_math_styles_state_cramped\plusone}
-\setvalue{\??mathstylecommand\s!cramped }{\c_math_styles_state_cramped\plustwo}
-\setvalue{\??mathstylecommand\v!normal }{\c_math_styles_state_cramped\plusone}
-\setvalue{\??mathstylecommand\v!packed }{\c_math_styles_state_cramped\plustwo}
+\defcsname\??mathstylecommand\s!display \endcsname{\c_math_styles_state_style \plusone}
+\defcsname\??mathstylecommand\s!text \endcsname{\c_math_styles_state_style \plustwo}
+\defcsname\??mathstylecommand\s!script \endcsname{\c_math_styles_state_style \plusthree}
+\defcsname\??mathstylecommand\s!scriptscript\endcsname{\c_math_styles_state_style \plusfour}
-\setvalue{\??mathstylecommand\v!small }{\c_math_styles_state_size \plusone}
-\setvalue{\??mathstylecommand\v!big }{\c_math_styles_state_size \plustwo}
-
-\permanent\protected\def\setupmathstyle[#1]%
- {\edef\m_math_style_asked{#1}%
- \ifempty\m_math_style_asked \else
- \math_style_set_indeed
- \fi}
+\defcsname\??mathstylecommand\s!uncramped \endcsname{\c_math_styles_state_cramped\plusone}
+\defcsname\??mathstylecommand\s!cramped \endcsname{\c_math_styles_state_cramped\plustwo}
+\defcsname\??mathstylecommand\v!normal \endcsname{\c_math_styles_state_cramped\plusone}
+\defcsname\??mathstylecommand\v!packed \endcsname{\c_math_styles_state_cramped\plustwo}
-\permanent\protected\def\usemathstyleparameter#1% faster local variant
- {\edef\m_math_style_asked{#1\c!mathstyle}%
- \ifempty\m_math_style_asked \else
- \math_style_set_indeed
- \fi}
+\defcsname\??mathstylecommand\v!small \endcsname{\c_math_styles_state_size \plusone}
+\defcsname\??mathstylecommand\v!big \endcsname{\c_math_styles_state_size \plustwo}
%D \startbuffer
%D \definemathstyle[mystyle][scriptscript]
@@ -2355,39 +3474,65 @@
%D
%D \typebuffer \blank \start \getbuffer \stop \blank
+% maybe move this to the lua end ...
+
\installcorenamespace {mathstyle}
-\permanent\tolerant\protected\def\definemathstyle[#1]#*[#2]%
- {\c_math_styles_state_style \zerocount
- \c_math_styles_state_cramped\zerocount
- \c_math_styles_state_size \zerocount
- \rawprocesscommacommand[#2]\math_style_collect
- \letcsname\??mathstyle#1\normalexpanded{\endcsname\math_style_add_to_cache_choice}}
+\letcsname\??mathstyle \endcsname\empty
+\letcsname\??mathstylecache\endcsname\empty
\def\math_style_set_indeed
{\ifcsname\??mathstyle\m_math_style_asked\endcsname
\lastnamedcs
+ \orelse\ifcsname\??mathstylecache\m_math_style_asked\endcsname
+ \lastnamedcs
\else
- \math_style_set_mathstyle_mathstyle
+ \math_style_set_mathstyle_mathstylecache\m_math_style_asked
\fi}
-\def\math_style_set_mathstyle_mathstyle
- {\ifcsname\??mathstylecache\m_math_style_asked\endcsname
+\permanent\def\expandedmathstyleparameter#1#2%
+ {\normalexpanded{\noexpand\math_style_set_expanded{#1#2}}}
+
+\def\math_style_set_expanded#1%
+ {\ifcsname\??mathstyle#1e\endcsname
+ \lastnamedcs
+ \orelse\ifcsname\??mathstylecache#1\endcsname
\lastnamedcs
\else
- \math_style_set_mathstyle_mathstylecache
+ \math_style_set_mathstyle_mathstylecache{#1}%
+ \fi}
+
+\permanent\protected\def\usemathstyleparameter#1#2%
+ {\edef\m_math_style_asked{#1#2}%
+ \ifempty\m_math_style_asked \else
+ \math_style_set_indeed
+ \fi}
+
+\permanent\tolerant\protected\def\setmathstyle[#1]#;#=% so we accept [] and {}
+ {\edef\m_math_style_asked{#1\c!mathstyle}%
+ \ifempty\m_math_style_asked \else
+ \math_style_set_indeed
+ \fi}
+
+\permanent\protected\def\setupmathstyle[#1]%
+ {\edef\m_math_style_asked{#1}%
+ \ifempty\m_math_style_asked \else
+ \math_style_set_indeed
\fi}
-\def\math_style_set_mathstyle_mathstylecache
- {\c_math_styles_state_style \zerocount
+\def\math_style_set_mathstyle_mathstylecache#1%
+ {\beginlocalcontrol % so we can expand
+ \edef\m_math_style_asked{#1}%
+ \c_math_styles_state_style \zerocount
\c_math_styles_state_cramped\zerocount
\c_math_styles_state_size \zerocount
\rawprocesscommacommand[\m_math_style_asked]\math_style_collect
\gletcsname\??mathstylecache\m_math_style_asked\normalexpanded{\endcsname\math_style_add_to_cache_choice}%
- \csname\??mathstylecache\m_math_style_asked\endcsname}
+ \endlocalcontrol
+ \csname\??mathstylecache#1\endcsname}
-\letvalue{\??mathstyle \??mathstyle }\math_style_set_mathstyle_mathstyle % still needed?
-\letvalue{\??mathstylecache\??mathstylecache}\math_style_set_mathstyle_mathstylecache % still needed?
+% \letcsname\??mathstyle \??mathstyle \endcsname\math_style_set_mathstyle_mathstyle % still needed?
+% \letcsname\??mathstylecache\??mathstylecache\endcsname\math_style_set_mathstyle_mathstylecache % still needed?
%D \startbuffer
%D $x\begingroup\setupmathstyle[script]x\endgroup x$
@@ -2402,21 +3547,21 @@
\ifempty\m_math_style_asked
\enforced\aliased\let\stopmathstyle\relax
\else
- \bgroup
+ \beginmathgroup % \bgroup
\math_style_set_indeed
- \enforced\aliased\let\stopmathstyle\egroup
+ \enforced\aliased\let\stopmathstyle\endmathgroup % \egroup
\fi}
\aliased\let\stopmathstyle\relax
-\permanent\protected\def\startusemathstyleparameter#1%
- {\edef\m_math_style_asked{#1\c!mathstyle}%
+\permanent\protected\def\startusemathstyleparameter#1#2%
+ {\edef\m_math_style_asked{#1#2}%
\ifempty\m_math_style_asked
\enforced\let\stopusemathstyleparameter\relax
\else
- \bgroup
+ \beginmathgroup % \bgroup
\math_style_set_indeed
- \enforced\let\stopusemathstyleparameter\egroup
+ \enforced\let\stopusemathstyleparameter\endmathgroup % \egroup
\fi}
\aliased\let\stopusemathstyleparameter\relax
@@ -2427,88 +3572,205 @@
\let\m_math_text_choice_face\relax
-% if needed we can get rid of the normalize (predo in font code)
+%D We accept a low level box specification so that one can make helpers:
+%D
+%D \startbuffer
+%D \startformula
+%D \startalign[m=2,align={middle}]
+%D \NC \text to 6cm{One\hfill} \NC a = 1 \NR
+%D \NC \text to 6cm{One Two\hfill} \NC b = 2 \NR
+%D \NC \text to 6cm{One Two Three\hfill} \NC c = 3 \NR
+%D \stopalign
+%D \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+
+% %mathscriptboxmode \plusthree % lists and boxes with \boundary=1 (also for testing and demo)
+% %mathscriptboxmode \plusone % collapsed and then removed, now control option
+% %mathscriptcharmode \plusone % idem
+%
+% %mathrulethicknessmode\plusone % adaptive
+% We keep this as reference:
+%
% \def\math_text_choice_font#1#2#%
% {\normalizebodyfontsize\m_math_text_choice_face{\mathstyleface\normalmathstyle}%
% \hbox#2\bgroup
+% \bgroup
+% \aftergroup\hss
+% \aftergroup\egroup
+% \hss
% \font_basics_switchtobodyfont\m_math_text_choice_face
% #1%
% \let\next}
-
+%
% \def\math_text_choice_word#1#2#%
% {\normalizebodyfontsize\m_math_text_choice_face{\mathstyleface\normalmathstyle}%
% \hbox#2\bgroup
+% \bgroup
+% \aftergroup\hss
+% \aftergroup\egroup
+% \hss
% \font_basics_switchtobodyfont\m_math_text_choice_face
% #1%
% \nospacing % \normalnospaces\plusone
% \let\next}
+%
+% % \ruledhbox{$\mathtext{abc ffi}$}
+% % \ruledhbox{$\mathword{abc ffi}$}
+%
+% \permanent\protected\def\mathtext {\mathortext{\math_text_choice_font\relax}\hbox}
+% \permanent\protected\def\mathword {\mathortext{\math_text_choice_word\relax}\hbox}
+%
+% \permanent\protected\def\mathtexttf{\mathortext{\math_text_choice_font\tf}\hbox}
+% \permanent\protected\def\mathtextit{\mathortext{\math_text_choice_font\it}\hbox}
+% \permanent\protected\def\mathtextsl{\mathortext{\math_text_choice_font\sl}\hbox}
+% \permanent\protected\def\mathtextbf{\mathortext{\math_text_choice_font\bf}\hbox}
+% \permanent\protected\def\mathtextbi{\mathortext{\math_text_choice_font\bi}\hbox}
+% \permanent\protected\def\mathtextbs{\mathortext{\math_text_choice_font\bs}\hbox}
+%
+% \permanent\protected\def\mathwordtf{\mathortext{\math_text_choice_word\tf}\hbox}
+% \permanent\protected\def\mathwordit{\mathortext{\math_text_choice_word\it}\hbox}
+% \permanent\protected\def\mathwordsl{\mathortext{\math_text_choice_word\sl}\hbox}
+% \permanent\protected\def\mathwordbf{\mathortext{\math_text_choice_word\bf}\hbox}
+% \permanent\protected\def\mathwordbi{\mathortext{\math_text_choice_word\bi}\hbox}
+% \permanent\protected\def\mathwordbs{\mathortext{\math_text_choice_word\bs}\hbox}
-%D We accept a low level box specification so that one can make helpers:
-%D
-%D \startbuffer
-%D \startformula
-%D \startalign[m=2,align={middle}]
-%D \NC \text to 6cm{One\hfill} \NC a = 1 \NR
-%D \NC \text to 6cm{One Two\hfill} \NC b = 2 \NR
-%D \NC \text to 6cm{One Two Three\hfill} \NC c = 3 \NR
-%D \stopalign
-%D \stopformula
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
+%D The split option is sort or a gimmick but one never knows how it might come in
+%D handy. It was also an interesting test for how easy we can get this done (an extra
+%D option as well as cheating in the line break function). And it was a good excuse
+%D to add options to glue (which was pending). Actually, the main reason for this
+%D trickery was that unrolling lists into the main math list could have strange side
+%D effects, due to glue being ignored in math in the libereak routine, so better get
+%D it working than explaining why if could have side effects.
-\def\math_text_choice_font#1#2#%
- {\normalizebodyfontsize\m_math_text_choice_face{\mathstyleface\normalmathstyle}%
- \hbox#2\bgroup
- \bgroup
- \aftergroup\hss
- \aftergroup\egroup
- \hss
- \font_basics_switchtobodyfont\m_math_text_choice_face
- #1%
- \let\next}
+%D The fact that one can pass e.g \type {to 4cm} before the content is an old and
+%D probably never used feature that we keep in order to remain compatible.
-\def\math_text_choice_word#1#2#%
- {\normalizebodyfontsize\m_math_text_choice_face{\mathstyleface\normalmathstyle}%
- \hbox#2\bgroup
- \bgroup
- \aftergroup\hss
- \aftergroup\egroup
- \hss
+\installcorenamespace{mathtext}
+
+\installcommandhandler \??mathtext {mathtext} \??mathtext
+
+\setupmathtext
+ [\s!leftclass=\mathtextparameter\s!class,
+ \s!rightclass=\mathtextparameter\s!class,
+ \s!class=\mathordinarycode]
+
+\appendtoks
+ \frozen\protected\edefcsname\currentmathtext\endcsname{\math_text_handle{\currentmathtext}}
+\to \everydefinemathtext
+
+\newtoks\everymathtext
+
+\tolerant\protected\def\math_text_handle_indeed#1#*[#2]#:#3#%
+ {\begingroup
+ \edef\currentmathtext{#1}%
+ \setupcurrentmathtext[#2]%
+ \normalizebodyfontsize\m_math_text_choice_face{\mathstyleface\normalmathstyle}%
+ \ifcstok{\mathtextparameter\c!alternative}\v!split
+ \mathatom
+ unroll
+ class \mathtextparameter\s!class
+ leftclass \mathtextparameter\s!leftclass
+ rightclass \mathtextparameter\s!rightclass
+ \bgroup
+ \hbox#3\bgroup
+ \aftergroup\egroup
+ \aftergroup\endgroup
+ \else
+ \hbox#3\bgroup
+ \atendofgroup\hss
+ \aftergroup\endgroup
+ \ifcstok{\mathtextparameter\c!alternative}\v!word
+ \nospacing % \normalnospaces\plusone
+ \fi
+ \hss
+ \fi
\font_basics_switchtobodyfont\m_math_text_choice_face
- #1%
- \nospacing % \normalnospaces\plusone
+ \usemathtextstyleandcolor\c!style\c!color
+ \the\everymathtext\relax
\let\next}
-% \ruledhbox{$\mathtext{abc ffi}$}
-% \ruledhbox{$\mathword{abc ffi}$}
+\protected\def\math_text_handle#1%
+ {\mathortext{\math_text_handle_indeed{#1}}\hbox}
+
+\definemathtext[mathtext]
+\definemathtext[mathtexttf][mathtext][\c!style=\tf]
+\definemathtext[mathtextit][mathtext][\c!style=\it]
+\definemathtext[mathtextsl][mathtext][\c!style=\sl]
+\definemathtext[mathtextbf][mathtext][\c!style=\bf]
+\definemathtext[mathtextbi][mathtext][\c!style=\bi]
+\definemathtext[mathtextbs][mathtext][\c!style=\bs]
+
+\definemathtext[mathword] [mathtext][\c!alternative=\v!word]
+\definemathtext[mathwordtf][mathword][\c!style=\tf]
+\definemathtext[mathwordit][mathword][\c!style=\it]
+\definemathtext[mathwordsl][mathword][\c!style=\sl]
+\definemathtext[mathwordbf][mathword][\c!style=\bf]
+\definemathtext[mathwordbi][mathword][\c!style=\bi]
+\definemathtext[mathwordbs][mathword][\c!style=\bs]
+
+\definemathtext[mathsplit] [mathtext] [\c!alternative=\v!split]
+\definemathtext[mathsplittf][mathsplit][\c!style=\tf]
+\definemathtext[mathsplitit][mathsplit][\c!style=\it]
+\definemathtext[mathsplitsl][mathsplit][\c!style=\sl]
+\definemathtext[mathsplitbf][mathsplit][\c!style=\bf]
+\definemathtext[mathsplitbi][mathsplit][\c!style=\bi]
+\definemathtext[mathsplitbs][mathsplit][\c!style=\bs]
-% I need to decide:
+% \startbuffer
+% $
+% { x\! \neq x!} \quad {\ss x\! \neq x!} \qquad
+% {\it x\! \neq x!} \quad {\ss \it x\! \neq x!} \qquad
+% {\fi x\! \neq x!} \quad {\ss \fi x\! \neq x!} \qquad
+% {\bi x\! \neq x!} \quad {\ss \bi x\! \neq x!}
+% $
+% \stopbuffer
%
-%mathscriptboxmode \zerocount % no kerning
-%mathscriptboxmode \plusone % lists
-\mathscriptboxmode \plustwo % lists and boxes
-\mathscriptcharmode \plusone % lists and boxes
-%mathscriptboxmode \plusthree % lists and boxes with \boundary=1 (also for testing and demo)
-\mathrulethicknessmode\plusone % adaptive
+% \startTEXpage[offset=1dk]
+% \getbuffer \par \automathtext \getbuffer
+% \stopTEXpage
+
+\newconditional\c_mathtextauto % we need aproper key: \settrue\c_mathtextauto
-\permanent\protected\def\mathtext {\mathortext{\math_text_choice_font\relax}\hbox}
-\permanent\protected\def\mathword {\mathortext{\math_text_choice_word\relax}\hbox}
+\permanent\protected\def\automathtext{\settrue\c_mathtextauto}
-\permanent\protected\def\mathtexttf{\mathortext{\math_text_choice_font\tf}\hbox}
-\permanent\protected\def\mathtextit{\mathortext{\math_text_choice_font\it}\hbox}
-\permanent\protected\def\mathtextsl{\mathortext{\math_text_choice_font\sl}\hbox}
-\permanent\protected\def\mathtextbf{\mathortext{\math_text_choice_font\bf}\hbox}
-\permanent\protected\def\mathtextbi{\mathortext{\math_text_choice_font\bi}\hbox}
-\permanent\protected\def\mathtextbs{\mathortext{\math_text_choice_font\bs}\hbox}
+\let\currentmathalphabet \s!rm
+\let\currentmathfontstyle\s!tf
-\permanent\protected\def\mathwordtf{\mathortext{\math_text_choice_word\tf}\hbox}
-\permanent\protected\def\mathwordit{\mathortext{\math_text_choice_word\it}\hbox}
-\permanent\protected\def\mathwordsl{\mathortext{\math_text_choice_word\sl}\hbox}
-\permanent\protected\def\mathwordbf{\mathortext{\math_text_choice_word\bf}\hbox}
-\permanent\protected\def\mathwordbi{\mathortext{\math_text_choice_word\bi}\hbox}
-\permanent\protected\def\mathwordbs{\mathortext{\math_text_choice_word\bs}\hbox}
+\permanent\protected\def\mathtextauto#1#2%
+ {\ifconditional\c_mathtextauto
+ \mathortext
+ {\mathpunct
+ {\begincsname\currentmathalphabet\endcsname
+ \begincsname mathtext\currentmathfontstyle\endcsname
+ {#1}}}%
+ {#1}%
+ \else
+ #2%
+ \fi}
+
+%D Actually in spac-hor.mkxl we defined them using \suggestedalias which redefines
+%D these so basically we now make that sort of obsolete.
+%D
+%D \starttyping
+%D $x\, x$\quad\automathtext$x\, x$
+%D \stoptyping
+
+\pushoverloadmode
+ \permanent\protected\def\.{\mathtextauto{.}{.}}
+ \permanent\protected\def\,{\mathtextauto{,}{\thinspace }}
+ \permanent\protected\def\:{\mathtextauto{:}{\medspace }}
+ \permanent\protected\def\;{\mathtextauto{;}{\thickspace}}
+ \permanent\protected\def\!{\mathtextauto{!}{\negthinspace}}
+ \permanent\protected\def\?{\mathtextauto{?}{?}}
+\popoverloadmode
+
+% \appendtoks
+% \reinstatecatcodecommand\barasciicode
+% \obeydiscretionaries
+% \to \everymathtext
%D Safeguard against redefinitions:
@@ -2522,53 +3784,7 @@
\enforced\let\text\mathtext
\to \everymathematics
-%D The next code is derived from plain \TEX. The names will change!
-
-\newcount\interdisplaylinepenalty \interdisplaylinepenalty\plushundred
-
-% Actually, not using an if saves one macro so there is no penalty
-% for splitting up this macro.
-%
-% \newif\ifdt@p
-%
-% \def\displ@y
-% {\global\dt@ptrue
-% \math_openup\displayopenupvalue % was \openup\jot
-% \everycr
-% {\noalign
-% {\ifdt@p
-% \global\dt@pfalse
-% \ifdim\prevdepth>-\thousandpoint
-% \vskip-\lineskiplimit
-% \vskip\normallineskiplimit
-% \fi
-% \else
-% \penalty\interdisplaylinepenalty
-% \fi}}}
-
-\newtoks\mathdisplayaligntweaks
-
-% this can become an option:
-
-\let\math_display_align_hack_indeed\relax
-
-\protected\def\math_display_align_hack % I don't like the global, maybe we should push and pop
- {\glet\math_display_align_hack_indeed\math_display_align_hack_remove_skip
- \math_openup\displayopenupvalue % was \math_openup\jot
- \everycr{\noalign{\math_display_align_hack_indeed}}}
-
-\def\math_display_align_hack_remove_skip
- {\ifdim\prevdepth>-\thousandpoint
- \vskip\dimexpr-\lineskiplimit+\normallineskiplimit\relax
- \fi
- \glet\math_display_align_hack_indeed\math_display_align_hack_insert_penalty}
-
-\def\math_display_align_hack_insert_penalty
- {\penalty\interdisplaylinepenalty}
-
-\appendtoks
- \math_display_align_hack
-\to \mathdisplayaligntweaks
+\newinteger\interdisplaylinepenalty \interdisplaylinepenalty\plushundred
%D Text in math:
@@ -2614,13 +3830,13 @@
\permanent\protected\def\smallmathsymbol#1%
{\mathematics{\mathbin{\normalexpanded{\raise.15\exheight\hbox{\normalstartimath
- \triggermathstyle{\the\numexpr\normalmathstyle+2\relax}#1%
+ \triggeredmathstyle{\the\numexpr\normalmathstyle+2\relax}#1%
\normalstopimath}}}}}
% this should be a primitive:
-\permanent\def\mathextensiblecode#1#2{\clf_extensiblecode\numexpr#1\relax\numexpr#2\relax}
-\permanent\def\mathhorizontalcode#1#2{\clf_horizontalcode\numexpr#1\relax\numexpr#2\relax}
+\permanent\def\mathextensiblecode#1#2{\clf_extensiblecode\numexpr#1\relax\numexpr#2\relax} % todo: use public lua but needs testing
+\permanent\def\mathhorizontalcode#1#2{\clf_horizontalcode\numexpr#1\relax\numexpr#2\relax} % todo: use public lua but needs testing
% experimental:
@@ -2762,52 +3978,30 @@
\permanent\protected\def\mathminus {\ifmmode –\orelse\iffontchar\font`−−\else –\fi}
\permanent\protected\def\mathplusminus{±}
-%D The \type {\displaywidth} is only known inside a display formula, so we need to catch
-%D it when still zero.
-
-\permanent\def\checkeddisplaywidth % hsize if zero
- {\dimexpr
- \ifzeropt\displaywidth
- \hsize
- \else
- \displaywidth
- \fi
- \relax}
-
-\permanent\def\maximizeddisplaywidth % larger than zero but within hsize
- {\dimexpr
- \ifzeropt\displaywidth
- \hsize
- \orelse\ifdim\displaywidth>\hsize
- \hsize
- \else
- \displaywidth
- \fi
- \relax}
-
-%D Experiment: (todo: same switch as italic, using \type {\everyswitchmathematics}).
-
-\newcount\c_math_domain_attribute
-
-\def\math_domain_initialize
- {\ifnum\c_math_domain_attribute=\attributeunsetvalue \else
- \clf_initializemathdomain % one time
- \glet\math_domain_initialize\relax
- \fi}
-
-\appendtoks
- \edef\p_domain{\mathematicsparameter\c!domain}%
- \ifempty\p_domain
- \c_math_domain_attribute\attributeunsetvalue
- \else
- \c_math_domain_attribute\clf_getmathdomain\p_domain\relax
- \math_domain_initialize
- \fi
-\to \everyswitchmathematics % only in mathematics
-
-\appendtoks
- \c_attr_mathdomain\c_math_domain_attribute
-\to \everymathematics
+%D Experiment, replaced by dictionaries but for now we keep the code as the domain key
+%D might come back.
+%
+% \newinteger\c_math_domain_attribute
+%
+% \def\math_domain_initialize
+% {\ifnum\c_math_domain_attribute=\attributeunsetvalue \else
+% \clf_initializemathdomain % one time
+% \glet\math_domain_initialize\relax
+% \fi}
+%
+% \appendtoks
+% \edef\p_domain{\mathematicsparameter\c!domain}%
+% \ifempty\p_domain
+% \c_math_domain_attribute\attributeunsetvalue
+% \else
+% \c_math_domain_attribute\clf_getmathdomain\p_domain\relax
+% \math_domain_initialize
+% \fi
+% \to \everyswitchmathematics % only in mathematics
+%
+% \appendtoks
+% \c_attr_mathdomain\c_math_domain_attribute
+% \to \everymathematics
\setupmathematics
[\s!italics=3] % for the moment only this one makes sense .. still experimental
@@ -2816,7 +4010,7 @@
\installcorenamespace{mathrules}
-\permanent\protected\def\enablemathrules{\letgvalue{\??mathrules\fontclass}\plusone}
+\permanent\protected\def\enablemathrules{\gletcsname\??mathrules\fontclass\endcsname\plusone}
\appendtoks
\mathrulesmode\ifcsname\??mathrules\fontclass\endcsname
@@ -2884,7 +4078,7 @@
\permanent\protected\def\math_scripts_unstack
{\clf_enablescriptunstacking
- \c_attr_mathunstack\plusone}
+ \c_attr_mathunstack\plustwo} % \plusone for the other way around
\ifdefined\stackscripts \else \aliased\let\stackscripts \relax \fi
\ifdefined\unstackscripts \else \aliased\let\unstackscripts\relax \fi
@@ -3002,6 +4196,299 @@
\normalsupmarkmode\plusone % 2 also disable ^[^+] in text mode
+\permanent\protected\tolerant\def\supscr[#1]#:#2%
+ {\ifchkdim#1\or\Umathopenupheight#1\relax\fi
+ \Usuperscript{#2}}
+
+\permanent\protected\tolerant\def\subscr[#1]#:#2%
+ {\ifchkdim#1\or\Umathopenupdepth #1\relax\fi
+ \Usubscript{#2}}
+
+\permanent\protected\tolerant\def\supsubscr[#1]#:#2#3%
+ {\ifchkdim#1\or\Umathopenupheight#1\relax\Umathopenupdepth#1\relax\fi
+ \Usuperscript{#2}\Usubscript{#3}}
+
+\permanent\protected\tolerant\def\subsupscr[#1]#:#*#2#3%
+ {\ifchkdim#1\or\Umathopenupheight#1\relax\Umathopenupdepth#1\relax\fi
+ \Usubscript{#2}\Usuperscript{#3}}
+
+\permanent\protected\tolerant\def\supprescr[#1]#:#2%
+ {\ifchkdim#1\or\Umathopenupheight#1\relax\fi
+ \Usuperprescript{#2}}
+
+\permanent\protected\tolerant\def\subprescr[#1]#:#2%
+ {\ifchkdim#1\or\Umathopenupdepth #1\relax\fi
+ \Usubprescript{#2}}
+
+\permanent\protected\tolerant\def\supsubprescr[#1]#:#2#3%
+ {\ifchkdim#1\or\Umathopenupheight#1\relax\Umathopenupdepth#1\relax\fi
+ \Usuperprescript{#2}\Usubprescript{#3}}
+
+\permanent\protected\tolerant\def\subsupprescr[#1]#:#*#2#3%
+ {\ifchkdim#1\or\Umathopenupheight#1\relax\Umathopenupdepth#1\relax\fi
+ \Usubprescript{#2}\Usuperprescript{#3}}
+
+%D For now (needed in asciimath):
+
+\def\math_relax_limits{\enforced\let\limits\relax}
+
+%D Something new:
+%D
+%D \starttyping
+%D \definemathpreset[whatever][factor=.5,style=all,list={fraction*gap}]
+%D % \presetmathematics[whatever] % less more zero
+%D \stoptyping
+%D
+%D as well as:
+%D
+%D \starttyping
+%D \setupmathspacing[narrow]
+%D \stoptyping
+
+\installcorenamespace{mathspacing}
+
+% \protected\def\math_spacing_set#1#2% maybe some day \allmathstyles
+% {\relax
+% #1\displaystyle #2%
+% #1\crampeddisplaystyle#2%
+% #1\textstyle #2%
+% #1\scriptstyle #2%
+% #1\crampedscriptstyle #2%
+% #1\scriptstyle #2%
+% #1\crampedscriptstyle #2%
+% \relax}
+%
+% \permanent\tolerant\protected\def\definemathspacing[#1]#*[#2]#*[#3]%
+% {\ifcstok{#2}\v!horizontal
+% \edefcsname\??mathspacing#1\endcsname
+% {\math_spacing_set\Umathxscale{\ifchknum#3\or#3\else\plusthousand\fi\relax}}%
+% \orelse\ifcstok{#2}\v!vertical
+% \edefcsname\??mathspacing#1\endcsname
+% {\math_spacing_set\Umathyscale{\ifchknum#3\or#3\else\plusthousand\fi\relax}}%
+% \else
+% \edefcsname\??mathspacing#1\endcsname
+% {\math_spacing_set\Umathxscale{\ifchknum#2\or\number#2\else\plusthousand\fi\relax}%
+% \math_spacing_set\Umathyscale{\ifchknum#3\or\number#3\orelse\ifchknum#2\or\number#2\else\plusthousand\fi\relax}}%
+% \fi}
+
+\permanent\tolerant\protected\def\definemathspacing[#1]#*[#2]#*[#3]%
+ {\ifcstok{#2}\v!horizontal
+ \edefcsname\??mathspacing#1\endcsname
+ {\Umathxscale\allmathstyles\ifchknum#3\or#3\else\plusthousand\fi\relax}%
+ \orelse\ifcstok{#2}\v!vertical
+ \edefcsname\??mathspacing#1\endcsname
+ {\Umathyscale\allmathstyles\ifchknum#3\or#3\else\plusthousand\fi\relax}%
+ \else
+ \edefcsname\??mathspacing#1\endcsname
+ {\Umathxscale\allmathstyles\ifchknum#2\or\number#2\else\plusthousand\fi\relax
+ \Umathyscale\allmathstyles\ifchknum#3\or\number#3\orelse\ifchknum#2\or\number#2\else\plusthousand\fi\relax}%
+ \fi}
+
+\definemathspacing[\v!normal] [1000] [1000]
+\definemathspacing[\v!tight] [\c!vertical] [900]
+\definemathspacing[\v!loose] [\c!vertical] [1100]
+\definemathspacing[\v!narrow][\c!horizontal] [900]
+\definemathspacing[\v!wide] [\c!horizontal] [1100]
+\definemathspacing[\v!less] [900] [900]
+\definemathspacing[\v!more] [1100] [1100]
+
+\permanent\protected\def\setupmathspacing[#1]%
+ {\begincsname\??mathspacing#1\endcsname}
+
+% \defcsname\??mathspacing +\endcsname
+% {\expandedloop\zerocount\plusseven\plusone
+% {\Umathxscale
+% \the\currentloopiterator
+% \numexpr\Umathxscale\the\currentloopiterator+\plushundred\relax
+% \Umathyscale
+% \the\currentloopiterator
+% \numexpr\Umathxscale\the\currentloopiterator+\plushundred\relax}}
+%
+% \defcsname\??mathspacing -\endcsname
+% {\expandedloop\zerocount\plusseven\plusone
+% {\Umathxscale
+% \the\currentloopiterator
+% \numexpr\Umathxscale\the\currentloopiterator-\plushundred\relax
+% \Umathyscale
+% \the\currentloopiterator
+% \numexpr\Umathxscale\the\currentloopiterator-\plushundred\relax}}
+
+% can become a lua call that globally defined it, then we can have
+% partials
+
+%D We're done with the double dollars:
+%D
+%D \startbuffer
+%D before $ i = 1 $ after\par
+%D before $ i = 2 \Ustopmath{} after\par
+%D before \Ustartmath i = 3 $ after\par
+%D before \Ustartmath i = 4 \Ustopmath{} after\par
+%D before $$ d = 1 $$ after\par
+%D before $$ d = 2 \Ustopdisplaymath{} after\par
+%D before \Ustartdisplaymath d = 3 $$ after\par
+%D before \Ustartdisplaymath d = 4 \Ustopdisplaymath{} after\par
+%D \stopbuffer
+%D
+%D \startpacked {\mathdisplaymode\zerocount \getbuffer} \stoppacked
+%D \startpacked {\mathdisplaymode\plusone \getbuffer} \stoppacked
+%D
+%D So we do:
+
+\mathdisplaymode\plusone
+
+%D Just to be sure:
+
+\immutable\integerdef\c_math_glyph_options_default\numexpr
+ \noexpansionglyphoptioncode
+ +\noprotrusionglyphoptioncode
+\relax
+
+\immutable\integerdef\c_math_glyph_options_hz\numexpr
+ \noprotrusionglyphoptioncode
+\relax
+
+\appendtoks
+ \ifcstok{\mathematicsparameter\v!hz}\v!yes
+ \glyphoptions\c_math_glyph_options_hz
+ \else
+ \glyphoptions\c_math_glyph_options_default
+ \fi
+\to \everymathematics
+
+%D Bonus for testing:
+
+% styles : regular sansserif monospaced fraktur script blackboard
+% alternatives : normal bold italic bolditalic
+% sets : ucletters lcletters digits ucgreek lcgreek symbols
+
+% \def\CheckMathHat#1{\ruledhbox{\im{\widehat{\Uchar#1}_1^2__3^^4}}}
+%
+% \dontleavehmode \traversemath{regular}{bold}{digits}{\CheckMathHat{#1}\hskip1em}
+
+\aliased\let\mathtraversecommand\relax
+
+\permanent\protected\def\traversemath#1#2#3#4%
+ {\pushmacro\mathtraversecommand
+ \enforced\def\mathtraversecommand##1{#4}%
+ \clf_traversemath{#1}{#2}{#3}\mathtraversecommand
+ \popmacro\mathtraversecommand}
+
+\permanent\protected\def\traverseblock#1#2%
+ {\pushmacro\mathtraversecommand
+ \enforced\def\mathtraversecommand##1{#2}%
+ \clf_traverseblock{#1}\mathtraversecommand
+ \popmacro\mathtraversecommand}
+
+%D Just some features:
+%D
+%D \starttyping
+%D $ x + \mathatom class \mathordcode {xxx} \Umathphantom + x $\par
+%D $ x + \mathatom class \mathordcode {xxx} \Umathvoid + x $\par
+%D $ x + \mathatom phantom class \mathordcode {xxx} + x $\par
+%D $ x + \mathatom void class \mathordcode {xxx} + x $\par
+%D
+%D \def\rab{\Umathchar"1"00"007C }
+%D
+%D $
+%D \color[green]{\rab\Umathadapttoright^{\black 1}_{\black 2}^^3__4}
+%D \color[blue] {\mathinner{\vrule height 30mm depth 30mm width 5mm}}
+%D \color[red] {\rab\Umathadapttoleft ^5_6^^{\black 7}__{\black 8}}
+%D $
+%D
+%D $
+%D \rab\Umathadapttoright^1_2^^3__4
+%D \mathinner{\vrule height 30mm depth 30mm width 5mm}
+%D \rab\Umathadapttoleft^5_6^^7__8
+%D $
+%D \stoptyping
+
+%D Just in case someone uses it:
+
+\appendtoks
+ \scriptspace.05\Umathquad\textstyle % for Mikael
+\to \everymathematics
+
+%D New:
+
+% \startformula
+% \mathatom class 0 all \mathbincode {a b c d} \breakhere
+% \mathatom class 0 all \mathfractioncode {a b c d} \breakhere
+% \base {FE03} \breakhere
+% \base[16]{FE03} \breakhere
+% \base[8] {7204}
+% \stopformula
+
+\permanent\tolerant\def\mathdigits#1%
+ {\ifmmode
+ \mathatom class \mathdigitcode all \mathdigitcode {#1}%
+ \else
+ #1%
+ \fi}
+
+\permanent\tolerant\protected\def\base[#1]#*#:#2%
+ {\ifmmode
+ \mathdigits{\tf#2}\ifparameter#1\or\subscript{\mathdigits{\tf#1}}\fi
+ \else
+ #2\ifparameter#1\or\low{#1}\fi
+ \fi}
+
+%D New:
+
+\permanent\tolerant\protected\def\definemathgroupset[#1]#*[#2]%
+ {\clf_registergroupset{#1}{#2}}
+
+\permanent\tolerant\protected\def\setmathgroupset[#1]%
+ {\mathdictgroup\clf_groupsetgroup{#1}\relax}
+
+%D Only for testing (limited line span):
+%D
+%D \starttyping
+%D test \im {z + \mathaxisbelow x + 2 - a = 1} test \par
+%D test \im {z + \mathaxisontop x + 2 - a = 1} test
+%D \stoptyping
+
+%D \starttyping
+%D $ x^2 + x_2 + x_2^2\mathaxisbelow\mathscriptbelow$\par
+%D $ x^g + x_g + x_g^g\mathaxisbelow\mathscriptbelow$
+%D \stoptyping
+
+\definesystemattribute[mathaxis][public]
+
+\def\math_axis_inject_indeed#1%
+ {\srule
+ \s!height \dimexpr\scratchdimentwo+\scratchdimenone\relax
+ \s!depth -\dimexpr\scratchdimentwo-\scratchdimenone\relax
+ \s!attr \mathaxisattribute#1%
+ \relax}
+
+\def\math_axis_inject#1#2%
+ {\mathatom \s!class \mathghostcode \s!unpack {
+ \showmakeup[strut]% todo: shortcut
+ \ifcase#1%
+ % nothing
+ \or
+ \scratchdimenone.5\Umathfractionrule\mathstyle
+ \scratchdimentwo\Umathaxis\mathstyle
+ \math_axis_inject_indeed#2%
+ \or
+ \scratchdimenone.25\Umathfractionrule\mathstyle
+ \scratchdimentwo\Umathsupshiftup\mathstyle
+ \math_axis_inject_indeed#2%
+ \scratchdimentwo-\Umathsubshiftdown\mathstyle
+ \math_axis_inject_indeed#2%
+ \scratchdimentwo-\Umathsubsupshiftdown\mathstyle
+ \math_axis_inject_indeed#2%
+ % \scratchdimenone.125\Umathfractionrule\mathstyle
+ \divideby\scratchdimenone\plustwo
+ \scratchdimentwo\Umathprimeshiftup\mathstyle
+ \math_axis_inject_indeed#2%
+ \fi}}
+
+\permanent\protected\def\mathaxisbelow {\math_axis_inject\plusone\plusone}
+\permanent\protected\def\mathaxisontop {\math_axis_inject\plusone\plustwo}
+\permanent\protected\def\mathscriptbelow{\math_axis_inject\plustwo\plusone}
+\permanent\protected\def\mathscriptontop{\math_axis_inject\plustwo\plustwo}
+
\protect \endinput
% % not used (yet)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-int.mkxl b/Master/texmf-dist/tex/context/base/mkxl/math-int.mkxl
index a8dcd3c9525..fd5ea37c953 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/math-int.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-int.mkxl
@@ -13,29 +13,10 @@
\writestatus{loading}{ConTeXt Math Macros / Integrals}
-% todo: int and sum etc can be stackers
+%D This is replaced by the operator module.
\unprotect
-%D \startbuffer
-%D $\int _a^b f(x) dx $ and also
-%D $\iint _a^b f(x,y) dxdy$,
-%D $\iiint _a^b f(x,y) dxdy$,
-%D \startformula
-%D \int _a^b f(x) dx \quad
-%D \iint _a^b f(x) dx \quad
-%D \iiint _a^b f(x) dx \quad
-%D \stopformula
-%D \stopbuffer
-%D
-%D Default: \getbuffer
-%D
-%D Displaylimits: \setupmathematics[integral=displaylimits] \getbuffer
-%D
-%D Limits: \setupmathematics[integral=limits] \getbuffer
-
-%D Adapted to mkiv by HH from code by AM.
-
\installcorenamespace{mathintegral}
\newconstant\mathintlimitmode
@@ -57,85 +38,22 @@
% none
\fi}
-\letvalue{\??mathintegral nolimits}\zerocount
-\letvalue{\??mathintegral displaylimits}\plusone
-\letvalue{\??mathintegral limits}\plustwo
-\letvalue{\??mathintegral autolimits}\plusthree
-\letvalue{\??mathintegral none}\plusfour
+\letcsname\??mathintegral nolimits\endcsname\zerocount
+\letcsname\??mathintegral displaylimits\endcsname\plusone
+\letcsname\??mathintegral limits\endcsname\plustwo
+\letcsname\??mathintegral autolimits\endcsname\plusthree
+\letcsname\??mathintegral none\endcsname\plusfour
\appendtoks
- \mathintlimitmode\executeifdefined{\??mathintegral\mathematicsparameter\s!integral}\zerocount
+ \mathintlimitmode
+ \ifcsname\??mathintegral\mathematicsparameter\s!integral\endcsname
+ \lastnamedcs
+ \else
+ \zerocount
+ \fi
\to \everyswitchmathematics
\setupmathematics
-% [\v!integral=nolimits]
- [\v!integral=autolimits]
-
-%D The following code is used for fallbacks and might become obsolete once
-%D we have enough \OPENTYPE\ math fonts.
-
-% \def\math_repeated_integal_i
-% {\int}
-
-% \def\math_repeated_integal_ii
-% {\math_repeated_integal_i
-% \math_repeated_integral_kern
-% \math_repeated_integal_i
-% \math_repeat_integral_finish
-% \intlimits}
-
-% \def\math_repeated_integal_iii
-% {\math_repeated_integal_i
-% \math_repeated_integral_kern
-% \math_repeated_integal_ii}
-%
-% \def\math_repeated_integal_iiii
-% {\math_repeated_integal_i
-% \math_repeated_integral_kern
-% \math_repeated_integal_iii}
-%
-% \protected\def\math_repeat_integral#1%
-% {\let\math_repeat_integral_finish\donothing
-% \iffontchar\textfont\zerocount#1\relax
-% \expandafter\math_repeat_integral_real
-% \else
-% \expandafter\math_repeat_integral_fake
-% \fi}
-%
-% \def\math_repeat_integral_fake#1#2%
-% {\let\math_repeat_integral_fake_symbol#2%
-% \futurelet\next\math_repeat_integral_fake_indeed}
-%
-% \def\math_repeat_integral_real#1#2%
-% {#1}
-%
-% \definemathcommand [iint] {\math_repeat_integral{"0222C}\normalint \math_repeated_integal_ii } % double
-% \definemathcommand [iiint] {\math_repeat_integral{"0222D}\normaliint \math_repeated_integal_iii } % tripple
-% \definemathcommand [iiiint] {\math_repeat_integral{"FFFFF}\normaliiint\math_repeated_integal_iiii} % quadruple
-%
-% \def\math_repeated_integral_kern
-% {\mkern-6mu\mathchoice{\mkern-3mu}{}{}{}}
-%
-% \def\math_repeat_integral_fake_indeed
-% {\ifx\next\limits
-% \math_repeated_integral_correction
-% \orelse\ifx\next\displaylimits
-% \math_repeated_integral_correction
-% \orelse\ifx\next\nolimits
-% % nothing
-% \orelse\ifcase\mathintlimitmode
-% % nothing
-% \else
-% \math_repeated_integral_correction
-% \fi
-% \math_repeat_integral_fake_symbol}
-%
-% \def\math_repeated_integral_correction
-% {\mkern-7mu\mathchoice{\mkern-2mu}{}{}{}%
-% \mathop\bgroup\mkern7mu\mathchoice{\mkern2mu}{}{}{}\let\math_repeat_integral_finish\egroup}
-%
-% %D If the \type{\limits} option is used after \type {\iint}, use \type
-% %D {\mathop} and fudge the left hand space a bit to make the subscript
-% %D visually centered.
+ [\c!integral=auto]
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-lop.mkxl b/Master/texmf-dist/tex/context/base/mkxl/math-lop.mkxl
new file mode 100644
index 00000000000..d4dbfa448a0
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-lop.mkxl
@@ -0,0 +1,190 @@
+%D \module
+%D [ file=math-lop,
+%D version=2022.02.10,
+%D title=\CONTEXT\ Math Macros,
+%D subtitle=Large operators,
+%D author={Hans Hagen & Mikael Sundqvist},
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%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 Math Macros / Large Operators}
+
+% $\textstyle \Uoperator \Udelimiter "0 \fam "222B {t} {b} {x}$\blank
+% $\textstyle \Uoperator \Udelimiter "0 \fam "222B {t} {b} {\frac{1}{x}}$\blank
+% $\displaystyle x + \Uoperator \Udelimiter "0 \fam "222B {t} {b} {\frac{1}{x}}$\blank
+% $ x + \Uoperator nolimits \Udelimiter "0 \fam "222B {t} {b} {\frac{1}{x}}$\blank
+% $ x + \Uoperator limits \Udelimiter "0 \fam "222B {t} {b} {\frac{1}{x}}$\blank
+
+\unprotect
+
+\installcorenamespace{mathoperators}
+\installcorenamespace{mathoperatormethod}
+
+\installcommandhandler \??mathoperators {mathoperator} \??mathoperators
+
+\setupmathoperator
+ [\c!left=\zerocount]% so we always have something
+
+\aliased\let\setupmathoperators\setupmathoperator
+
+\appendtoks
+ % todo: only define when there's left or right
+ \protected\instance\edefcsname\currentmathoperator\endcsname{\math_operator{\currentmathoperator}}%
+ % todo: under definition control
+ \protected\instance\edefcsname\e!start\currentmathoperator\endcsname{\math_operator_start{\currentmathoperator}}%
+ \protected\instance\edefcsname\e!stop \currentmathoperator\endcsname{\math_operator_stop}%
+\to \everydefinemathoperator
+
+% more generic:
+
+\defcsname\??mathoperatormethod\v!horizontal\endcsname{nolimits }
+\defcsname\??mathoperatormethod\v!vertical \endcsname{limits }
+
+% The ones we wlready had:
+
+\letcsname\??mathoperatormethod \v!auto\endcsname\empty
+\letcsname\??mathoperatormethod autolimits\endcsname\empty
+\letcsname\??mathoperatormethod nolimits\expandafter\endcsname\csname\??mathoperatormethod\v!horizontal\endcsname
+\letcsname\??mathoperatormethod limits\expandafter\endcsname\csname\??mathoperatormethod\v!vertical \endcsname
+
+%D With the auto option DisplayOperatorMinHeight will kick in unless we explicitly set the size or
+%D use the start|-|stop variant (which will size automatically). The default of this font parameter
+%D are a bit on the small size which doesn't work well with fonts other than Latin Modern that has
+%D a large one. Keep in mind that we have e.g. integrals as operators and not fixed characters.
+
+\installlocalcurrenthandler\??mathoperators {mathoperator}
+
+\protected\def\math_operator_operator#1#2%
+ {\setlocalmathoperatorcurrent{#1}% \edef\currentmathoperator{#1}%
+ \setupcurrentmathoperator[#2]%
+ \Uoperator
+ \usedcolorparameterattributes{\mathoperatorparameter\c!color}%
+ \begincsname\??mathoperatormethod\mathoperatorparameter\c!method\endcsname
+ \ifchkdim\mathoperatorparameter\c!size\or
+ \s!depth \mathoperatorparameter\c!size
+ \s!height\mathoperatorparameter\c!size
+ \s!axis % variants
+ \s!noaxis % extensibles (assumes also axis)
+ \s!exact % make sure we don't overshoot when there are no variants and extensibles
+ \orelse\ifcstok{\mathoperatorparameter\c!size}\v!auto
+ \s!auto
+ \fi
+ \s!class \mathoperatorcode
+ \s!attr \indexofregister \c_attr_mathsize \attributeunsetvalue
+ % todo: find a way to pick up or pass sup/sub to here
+ \Udelimiter \zerocount \fam \mathoperatorparameter\c!left
+ {\edef\m_operator_text{\mathoperatorparameter\c!top}%
+ \ifempty\m_operator_text\else
+ \mathstrut % todo: make option
+ \dousecolorparameter{\mathoperatorparameter\c!topcolor}
+ \m_operator_text
+ \fi}%
+ {\edef\m_operator_text{\mathoperatorparameter\c!bottom}%
+ \ifempty\m_operator_text\else
+ \mathstrut % todo: make option
+ \dousecolorparameter{\mathoperatorparameter\c!bottomcolor}
+ \m_operator_text
+ \fi}}
+
+\tolerant\protected\def\math_operator#1#*[#2]#*#:#=% mandate braces
+ {\math_operator_operator{#1}{#2}#3\Uright.}
+
+\tolerant\protected\def\math_operator_start#1#*[#2]%
+ {\math_operator_operator{#1}{#2}}
+
+\protected\def\math_operator_stop
+ {\Uright.}
+% {\Uright\Udelimiter\zerocount \fam \zerocount }
+
+% \def\math_operator_default_size % is now the auto option
+% {\ifconditional\indisplaymath\ifcase\Umathoperatorsize=\maxdimen\else
+% \Umathoperatorsize\displaystyle
+% \fi\fi}
+
+% TODO: Add 4 (inherited) classes and then define them automatically from char-def
+% instead.
+
+\definemathoperator [integrals]
+\definemathoperator [summations]
+\definemathoperator [products]
+\definemathoperator [operators]
+
+\setupmathoperators [integrals] [\c!size=\v!auto,\c!method=\mathematicsparameter\c!integral] % cf Mikael's wish
+\setupmathoperators [summations] [\c!size=\v!auto]
+\setupmathoperators [products] [\c!size=\v!auto]
+\setupmathoperators [operators] [\c!size=\v!auto]
+
+\setupmathematics[\c!integral=nolimits]
+
+\definemathoperator [integral] [integrals] [\c!left="222B] % these might go unless we decide
+\definemathoperator [iintegral] [integrals] [\c!left="222C] % to have verbose parents but who
+\definemathoperator [iiintegral] [integrals] [\c!left="222D] % will use them
+\definemathoperator [iiiintegral] [integrals] [\c!left="2A0C]
+
+\definemathoperator [int] [integrals] [\c!left="222B] % INTEGRAL
+\definemathoperator [iint] [integrals] [\c!left="222C] % DOUBLE INTEGRAL
+\definemathoperator [iiint] [integrals] [\c!left="222D] % TRIPLE INTEGRAL
+\definemathoperator [iiiint] [integrals] [\c!left="2A0C] % QUADRUPLE INTEGRAL OPERATOR
+\definemathoperator [oint] [integrals] [\c!left="222E] % CONTOUR INTEGRAL
+\definemathoperator [oiint] [integrals] [\c!left="222F] % SURFACE INTEGRAL
+\definemathoperator [oiiint] [integrals] [\c!left="2230] % VOLUME INTEGRAL
+\definemathoperator [intc] [integrals] [\c!left="2231] % CLOCKWISE INTEGRAL
+\definemathoperator [ointc] [integrals] [\c!left="2232] % CLOCKWISE CONTOUR INTEGRAL
+\definemathoperator [aointc] [integrals] [\c!left="2233] % ANTI CLOCKWISE CONTOUR INTEGRAL
+
+\definemathoperator [sumint] [integrals] [\c!left="2A0B] % Integral with sum
+\definemathoperator [barint] [integrals] [\c!left="2A0D] % Integral with bar
+\definemathoperator [doublebarint] [integrals] [\c!left="2A0E] % Integral with double bar
+\definemathoperator [slashint] [integrals] [\c!left="2A0F] % Integral with slash
+\definemathoperator [aodownintc] [integrals] [\c!left="2A11]
+\definemathoperator [rectangularpoleintc] [integrals] [\c!left="2A12]
+\definemathoperator [semicirclepoleintc] [integrals] [\c!left="2A13]
+\definemathoperator [circlepoleoutsideintc] [integrals] [\c!left="2A14]
+\definemathoperator [circlepoleinsideintc] [integrals] [\c!left="2A15]
+\definemathoperator [squareintc] [integrals] [\c!left="2A16]
+\definemathoperator [hookleftarrowint] [integrals] [\c!left="2A17]
+\definemathoperator [timesint] [integrals] [\c!left="2A18]
+\definemathoperator [capint] [integrals] [\c!left="2A19]
+\definemathoperator [cupint] [integrals] [\c!left="2A1A]
+\definemathoperator [upperint] [integrals] [\c!left="2A1B]
+\definemathoperator [lowerint] [integrals] [\c!left="2A1C]
+
+\definemathoperator [sum] [summations] [\c!left="2211] % N-ARY SUMMATION
+\definemathoperator [blackboardsum] [summations] [\c!left="2140] % blackboard summation
+\definemathoperator [modtwosum] [summations] [\c!left="2A0A] % modulo two summation
+
+
+\definemathoperator [prod] [products] [\c!left="220F] % N-ARY PRODUCT
+\definemathoperator [coprod] [products] [\c!left="2210] % N-ARY COPRODUCT
+
+% todo: middles too
+
+\definemathoperator [bigwedge] [operators] [\c!left="22C0] % N-ARY LOGICAL AND
+\definemathoperator [bigvee] [operators] [\c!left="22C1] % N-ARY LOGICAL OR
+\definemathoperator [bigcap] [operators] [\c!left="22C2] % N-ARY LOGICAL INTERSECTION
+\definemathoperator [bigcup] [operators] [\c!left="22C3] % N-ARY UNION
+\definemathoperator [bigodot] [operators] [\c!left="2A00] % N-ARY CIRCLED DOT OPERATOR
+\definemathoperator [bigoplus] [operators] [\c!left="2A01] % N-ARY CIRCLED PLUS OPERATOR
+\definemathoperator [bigotimes] [operators] [\c!left="2A02] % N-ARY CIRCLED TIMES OPERATOR
+\definemathoperator [bigudot] [operators] [\c!left="2A03] % N-ARY UNION OPERATOR WITH DOT
+\definemathoperator [biguplus] [operators] [\c!left="2A04] % N-ARY UNION OPERATOR WITH PLUS
+\definemathoperator [bigsqcap] [operators] [\c!left="2A05] % N-ARY SQUARE INTERSECTION OPERATOR
+\definemathoperator [bigsqcup] [operators] [\c!left="2A06] % N-ARY SQUARE UNION OPERATOR
+\definemathoperator [bigtimes] [operators] [\c!left="2A09] % N-ARY TIMES OPERATOR
+
+\definemathoperator [leftouterjoin] [operators] [\c!left="27D5] % left outer join
+\definemathoperator [rightouterjoin] [operators] [\c!left="27D6] % right outer join
+\definemathoperator [fullouterjoin] [operators] [\c!left="27D7] % full outer join
+\definemathoperator [bigbottom] [operators] [\c!left="27D8] % big bottom
+\definemathoperator [bigtop] [operators] [\c!left="27D9] % big top
+\definemathoperator [bigsolidus] [operators] [\c!left="29F8] % big solidus
+\definemathoperator [bigreversesolidus] [operators] [\c!left="29F9] % big reverse solidus
+\definemathoperator [bigdoublewedge] [operators] [\c!left="2A07] % big double wedge
+\definemathoperator [bigdoublevee] [operators] [\c!left="2A08] % big double vee
+
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-map.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-map.lmt
new file mode 100644
index 00000000000..98cc59c8942
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-map.lmt
@@ -0,0 +1,932 @@
+if not modules then modules = { } end modules ['math-map'] = {
+ version = 1.001,
+ optimize = true,
+ comment = "companion to math-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- todo: make sparse .. if self
+
+--[[ldx--
+<p>Remapping mathematics alphabets.</p>
+--ldx]]--
+
+-- oldstyle: not really mathematics but happened to be part of
+-- the mathematics fonts in cmr
+--
+-- persian: we will also provide mappers for other
+-- scripts
+
+-- todo: alphabets namespace
+-- maybe: script/scriptscript dynamic,
+
+-- superscripped primes get unscripted !
+
+-- to be looked into once the fonts are ready (will become font
+-- goodie):
+--
+-- (U+2202,U+1D715) : upright
+-- (U+2202,U+1D715) : italic
+-- (U+2202,U+1D715) : upright
+--
+-- plus add them to the regular vectors below so that they honor \it etc
+
+local type, next = type, next
+local merged, sortedhash = table.merged, table.sortedhash
+
+local allocate = utilities.storage.allocate
+
+local otffeatures = fonts.constructors.features.otf
+local registerotffeature = otffeatures.register
+
+local setmetatableindex = table.setmetatableindex
+
+local texgetattribute = tex.getattribute
+local texsetattribute = tex.setattribute
+
+local setmacro = tokens.setters.macro
+
+local texgetmode = tex.getmode
+local mathmode_code = tex.modelevels.math
+
+local trace_greek = false trackers.register("math.greek", function(v) trace_greek = v end)
+local report_remapping = logs.reporter("mathematics","remapping")
+
+mathematics = mathematics or { }
+local mathematics = mathematics
+
+local implement = interfaces.implement
+local context = context
+
+-- Unfortunately some alphabets have gaps (thereby troubling all applications that
+-- need to deal with math). Somewhat strange considering all those weird symbols that
+-- were added afterwards. The following trickery (and data) is only to be used for
+-- diagnostics and quick and dirty alphabet tracing (s-mat-10.mkiv) as we deal with
+-- it otherwise.
+
+-- todo: allocate
+
+mathematics.styles = allocate { "regular", "sansserif", "monospaced", "fraktur", "script", "calligraphic", "blackboard" }
+mathematics.alternatives = allocate { "normal", "bold", "italic", "bolditalic" }
+mathematics.sets = allocate { "ucletters", "lcletters", "digits", "ucgreek", "lcgreek", "symbols" }
+
+mathematics.charactersets = allocate {
+ ucletters = {
+ 0x00041, 0x00042, 0x00043, 0x00044, 0x00045,
+ 0x00046, 0x00047, 0x00048, 0x00049, 0x0004A,
+ 0x0004B, 0x0004C, 0x0004D, 0x0004E, 0x0004F,
+ 0x00050, 0x00051, 0x00052, 0x00053, 0x00054,
+ 0x00055, 0x00056, 0x00057, 0x00058, 0x00059,
+ 0x0005A,
+ },
+ lcletters = {
+ 0x00061, 0x00062, 0x00063, 0x00064, 0x00065,
+ 0x00066, 0x00067, 0x00068, 0x00069, 0x0006A,
+ 0x0006B, 0x0006C, 0x0006D, 0x0006E, 0x0006F,
+ 0x00070, 0x00071, 0x00072, 0x00073, 0x00074,
+ 0x00075, 0x00076, 0x00077, 0x00078, 0x00079,
+ 0x0007A,
+ },
+ digits = {
+ 0x00030, 0x00031, 0x00032, 0x00033, 0x00034,
+ 0x00035, 0x00036, 0x00037, 0x00038, 0x00039,
+ },
+ ucgreek = {
+ 0x0391, 0x0392, 0x0393, 0x0394, 0x0395,
+ 0x0396, 0x0397, 0x0398, 0x0399, 0x039A,
+ 0x039B, 0x039C, 0x039D, 0x039E, 0x039F,
+ 0x03A0, 0x03A1, 0x03A3, 0x03A4, 0x03A5,
+ 0x03A6, 0x03A7, 0x03A8, 0x03A9
+ },
+ lcgreek = {
+ 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5,
+ 0x03B6, 0x03B7, 0x03B8, 0x03B9, 0x03BA,
+ 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF,
+ 0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4,
+ 0x03C5, 0x03C6, 0x03C7, 0x03C8, 0x03C9,
+ 0x03D1, 0x03D5, 0x03D6, 0x03F0, 0x03F1,
+ 0x03F4, 0x03F5
+ },
+}
+
+local gaps = allocate {
+ [0x1D455] = 0x0210E, -- â„Ž h
+ [0x1D49D] = 0x0212C, -- ℬ script B
+ [0x1D4A0] = 0x02130, -- â„° script E
+ [0x1D4A1] = 0x02131, -- ℱ script F
+ [0x1D4A3] = 0x0210B, -- â„‹ script H
+ [0x1D4A4] = 0x02110, -- â„ script I
+ [0x1D4A7] = 0x02112, -- â„’ script L
+ [0x1D4A8] = 0x02133, -- ℳ script M
+ [0x1D4AD] = 0x0211B, -- â„› script R
+ [0x1D4BA] = 0x0212F, -- ℯ script e
+ [0x1D4BC] = 0x0210A, -- â„Š script g
+ -- [0x1D4C1] = 0x02113, -- exception: liter
+ [0x1D4C4] = 0x02134, -- â„´ script o
+ [0x1D506] = 0x0212D, -- â„­ fraktur C
+ [0x1D50B] = 0x0210C, -- ℌ fraktur H
+ [0x1D50C] = 0x02111, -- â„‘ fraktur I
+ [0x1D515] = 0x0211C, -- ℜ fraktur R
+ [0x1D51D] = 0x02128, -- ℨ fraktur Z
+ [0x1D53A] = 0x02102, -- â„‚ bb C
+ [0x1D53F] = 0x0210D, -- â„ bb H
+ [0x1D545] = 0x02115, -- â„• bb N
+ [0x1D547] = 0x02119, -- â„™ bb P
+ [0x1D548] = 0x0211A, -- â„š bb Q
+ [0x1D549] = 0x0211D, -- â„ bb R
+ [0x1D551] = 0x02124, -- ℤ bb Z
+}
+
+mathematics.gaps = gaps
+
+local function fillinmathgaps(tfmdata,key,value)
+ local mathgaps = mathematics.gaps
+ local characters = tfmdata.characters
+ local descriptions = tfmdata.descriptions
+ for gap, original in next, mathgaps do
+ if characters[original] and not characters[gap] then
+ characters [gap] = characters [original]
+ descriptions[gap] = descriptions[original]
+ end
+ end
+end
+
+registerotffeature {
+ name = "mathgaps",
+ description = "plug gaps in math alphabets",
+ comment = "regular document sources should not depend on this",
+ manipulators = {
+ base = fillinmathgaps,
+ node = fillinmathgaps,
+ }
+}
+
+-- we could use one level less and have tf etc be tables directly but the
+-- following approach permits easier remapping of a-a, A-Z and 0-9 to
+-- fallbacks; symbols is currently mostly greek
+
+local function todigit (n) local t = { } for i=0, 9 do t[0x00030+i] = n+i end return t end
+local function toupper (n) local t = { } for i=0,25 do t[0x00041+i] = n+i end return t end
+local function tolower (n) local t = { } for i=0,25 do t[0x00061+i] = n+i end return t end
+local function tovector(t) return t end
+
+-- how about 0x2A (ast) cq. 0x2217
+-- 0x2D (hyphen) cq. 0x2212
+-- 0x3A (colon) cq. 0x2236
+
+local regular_tf = {
+ digits = todigit(0x00030),
+ ucletters = toupper(0x00041),
+ lcletters = tolower(0x00061),
+ ucgreek = {
+ [0x0391]=0x0391, [0x0392]=0x0392, [0x0393]=0x0393, [0x0394]=0x0394, [0x0395]=0x0395,
+ [0x0396]=0x0396, [0x0397]=0x0397, [0x0398]=0x0398, [0x0399]=0x0399, [0x039A]=0x039A,
+ [0x039B]=0x039B, [0x039C]=0x039C, [0x039D]=0x039D, [0x039E]=0x039E, [0x039F]=0x039F,
+ [0x03A0]=0x03A0, [0x03A1]=0x03A1, [0x03A3]=0x03A3, [0x03A4]=0x03A4, [0x03A5]=0x03A5,
+ [0x03A6]=0x03A6, [0x03A7]=0x03A7, [0x03A8]=0x03A8, [0x03A9]=0x03A9,
+ },
+ lcgreek = {
+ [0x03B1]=0x03B1, [0x03B2]=0x03B2, [0x03B3]=0x03B3, [0x03B4]=0x03B4, [0x03B5]=0x03B5,
+ [0x03B6]=0x03B6, [0x03B7]=0x03B7, [0x03B8]=0x03B8, [0x03B9]=0x03B9, [0x03BA]=0x03BA,
+ [0x03BB]=0x03BB, [0x03BC]=0x03BC, [0x03BD]=0x03BD, [0x03BE]=0x03BE, [0x03BF]=0x03BF,
+ [0x03C0]=0x03C0, [0x03C1]=0x03C1, [0x03C2]=0x03C2, [0x03C3]=0x03C3, [0x03C4]=0x03C4,
+ [0x03C5]=0x03C5, [0x03C6]=0x03C6, [0x03C7]=0x03C7, [0x03C8]=0x03C8, [0x03C9]=0x03C9,
+ [0x03D1]=0x03D1, [0x03D5]=0x03D5, [0x03D6]=0x03D6, [0x03F0]=0x03F0, [0x03F1]=0x03F1,
+ [0x03F4]=0x03F4, [0x03F5]=0x03F5,
+ },
+ symbols = {
+ [0x2202]=0x2202, [0x2207]=0x2207,
+ [0x0027]=0x2032, -- prime
+ },
+}
+
+local regular_it = {
+ digits = tovector(regular_tf.digits),
+ ucletters = toupper(0x1D434),
+ lcletters = { -- H
+ [0x00061]=0x1D44E, [0x00062]=0x1D44F, [0x00063]=0x1D450, [0x00064]=0x1D451, [0x00065]=0x1D452,
+ [0x00066]=0x1D453, [0x00067]=0x1D454, [0x00068]=0x0210E, [0x00069]=0x1D456, [0x0006A]=0x1D457,
+ [0x0006B]=0x1D458, [0x0006C]=0x1D459, [0x0006D]=0x1D45A, [0x0006E]=0x1D45B, [0x0006F]=0x1D45C,
+ [0x00070]=0x1D45D, [0x00071]=0x1D45E, [0x00072]=0x1D45F, [0x00073]=0x1D460, [0x00074]=0x1D461,
+ [0x00075]=0x1D462, [0x00076]=0x1D463, [0x00077]=0x1D464, [0x00078]=0x1D465, [0x00079]=0x1D466,
+ [0x0007A]=0x1D467,
+ -- arabic
+ [0x00627] = 0x1EE00, [0x00628] = 0x1EE21, [0x0062A] = 0x1EE15, [0x0062B] = 0x1EE16,
+ [0x0062C] = 0x1EE22, [0x0062D] = 0x1EE07, [0x0062E] = 0x1EE17, [0x0062F] = 0x1EE03,
+ [0x00630] = 0x1EE18, [0x00631] = 0x1EE13, [0x00632] = 0x1EE06, [0x00633] = 0x1EE0E,
+ [0x00634] = 0x1EE14, [0x00635] = 0x1EE11, [0x00636] = 0x1EE19, [0x00637] = 0x1EE08,
+ [0x00638] = 0x1EE1A, [0x00639] = 0x1EE0F, [0x0063A] = 0x1EE1B, [0x00641] = 0x1EE10,
+ [0x00642] = 0x1EE12, [0x00643] = 0x1EE0A, [0x00644] = 0x1EE0B, [0x00645] = 0x1EE0C,
+ [0x00646] = 0x1EE0D, [0x00647] = 0x1EE24, [0x00648] = 0x1EE05, [0x0064A] = 0x1EE09,
+ [0x0066E] = 0x1EE1C, [0x0066F] = 0x1EE1F, [0x006A1] = 0x1EE1E, [0x006BA] = 0x1EE1D,
+ },
+ ucgreek = {
+ [0x0391]=0x1D6E2, [0x0392]=0x1D6E3, [0x0393]=0x1D6E4, [0x0394]=0x1D6E5, [0x0395]=0x1D6E6,
+ [0x0396]=0x1D6E7, [0x0397]=0x1D6E8, [0x0398]=0x1D6E9, [0x0399]=0x1D6EA, [0x039A]=0x1D6EB,
+ [0x039B]=0x1D6EC, [0x039C]=0x1D6ED, [0x039D]=0x1D6EE, [0x039E]=0x1D6EF, [0x039F]=0x1D6F0,
+ [0x03A0]=0x1D6F1, [0x03A1]=0x1D6F2, [0x03A3]=0x1D6F4, [0x03A4]=0x1D6F5, [0x03A5]=0x1D6F6,
+ [0x03A6]=0x1D6F7, [0x03A7]=0x1D6F8, [0x03A8]=0x1D6F9, [0x03A9]=0x1D6FA,
+ },
+ lcgreek = {
+ [0x03B1]=0x1D6FC, [0x03B2]=0x1D6FD, [0x03B3]=0x1D6FE, [0x03B4]=0x1D6FF, [0x03B5]=0x1D700,
+ [0x03B6]=0x1D701, [0x03B7]=0x1D702, [0x03B8]=0x1D703, [0x03B9]=0x1D704, [0x03BA]=0x1D705,
+ [0x03BB]=0x1D706, [0x03BC]=0x1D707, [0x03BD]=0x1D708, [0x03BE]=0x1D709, [0x03BF]=0x1D70A,
+ [0x03C0]=0x1D70B, [0x03C1]=0x1D70C, [0x03C2]=0x1D70D, [0x03C3]=0x1D70E, [0x03C4]=0x1D70F,
+ [0x03C5]=0x1D710, [0x03C6]=0x1D711, [0x03C7]=0x1D712, [0x03C8]=0x1D713, [0x03C9]=0x1D714,
+ [0x03D1]=0x1D717, [0x03D5]=0x1D719, [0x03D6]=0x1D71B, [0x03F0]=0x1D718, [0x03F1]=0x1D71A,
+ [0x03F4]=0x1D6F3, [0x03F5]=0x1D716,
+ },
+ symbols = {
+ [0x2202]=0x1D715, [0x2207]=0x1D6FB,
+ [0x0027]=0x2032, -- prime
+ },
+}
+
+local regular_bf= {
+ digits = todigit(0x1D7CE),
+ ucletters = toupper(0x1D400),
+ lcletters = tolower(0x1D41A),
+ ucgreek = {
+ [0x0391]=0x1D6A8, [0x0392]=0x1D6A9, [0x0393]=0x1D6AA, [0x0394]=0x1D6AB, [0x0395]=0x1D6AC,
+ [0x0396]=0x1D6AD, [0x0397]=0x1D6AE, [0x0398]=0x1D6AF, [0x0399]=0x1D6B0, [0x039A]=0x1D6B1,
+ [0x039B]=0x1D6B2, [0x039C]=0x1D6B3, [0x039D]=0x1D6B4, [0x039E]=0x1D6B5, [0x039F]=0x1D6B6,
+ [0x03A0]=0x1D6B7, [0x03A1]=0x1D6B8, [0x03A3]=0x1D6BA, [0x03A4]=0x1D6BB, [0x03A5]=0x1D6BC,
+ [0x03A6]=0x1D6BD, [0x03A7]=0x1D6BE, [0x03A8]=0x1D6BF, [0x03A9]=0x1D6C0,
+ },
+ lcgreek = {
+ [0x03B1]=0x1D6C2, [0x03B2]=0x1D6C3, [0x03B3]=0x1D6C4, [0x03B4]=0x1D6C5, [0x03B5]=0x1D6C6,
+ [0x03B6]=0x1D6C7, [0x03B7]=0x1D6C8, [0x03B8]=0x1D6C9, [0x03B9]=0x1D6CA, [0x03BA]=0x1D6CB,
+ [0x03BB]=0x1D6CC, [0x03BC]=0x1D6CD, [0x03BD]=0x1D6CE, [0x03BE]=0x1D6CF, [0x03BF]=0x1D6D0,
+ [0x03C0]=0x1D6D1, [0x03C1]=0x1D6D2, [0x03C2]=0x1D6D3, [0x03C3]=0x1D6D4, [0x03C4]=0x1D6D5,
+ [0x03C5]=0x1D6D6, [0x03C6]=0x1D6D7, [0x03C7]=0x1D6D8, [0x03C8]=0x1D6D9, [0x03C9]=0x1D6DA,
+ [0x03D1]=0x1D6DD, [0x03D5]=0x1D6DF, [0x03D6]=0x1D6E1, [0x03F0]=0x1D6DE, [0x03F1]=0x1D6E0,
+ [0x03F4]=0x1D6B9, [0x03F5]=0x1D6DC,
+ },
+ symbols = {
+ [0x2202]=0x1D6DB, [0x2207]=0x1D6C1,
+ [0x0027]=0x2032, -- prime
+ },
+}
+
+local regular_bi = {
+ digits = tovector(regular_bf.digits),
+ ucletters = toupper(0x1D468),
+ lcletters = tolower(0x1D482),
+ ucgreek = {
+ [0x0391]=0x1D71C, [0x0392]=0x1D71D, [0x0393]=0x1D71E, [0x0394]=0x1D71F, [0x0395]=0x1D720,
+ [0x0396]=0x1D721, [0x0397]=0x1D722, [0x0398]=0x1D723, [0x0399]=0x1D724, [0x039A]=0x1D725,
+ [0x039B]=0x1D726, [0x039C]=0x1D727, [0x039D]=0x1D728, [0x039E]=0x1D729, [0x039F]=0x1D72A,
+ [0x03A0]=0x1D72B, [0x03A1]=0x1D72C, [0x03A3]=0x1D72E, [0x03A4]=0x1D72F, [0x03A5]=0x1D730,
+ [0x03A6]=0x1D731, [0x03A7]=0x1D732, [0x03A8]=0x1D733, [0x03A9]=0x1D734,
+ },
+ lcgreek = {
+ [0x03B1]=0x1D736, [0x03B2]=0x1D737, [0x03B3]=0x1D738, [0x03B4]=0x1D739, [0x03B5]=0x1D73A,
+ [0x03B6]=0x1D73B, [0x03B7]=0x1D73C, [0x03B8]=0x1D73D, [0x03B9]=0x1D73E, [0x03BA]=0x1D73F,
+ [0x03BB]=0x1D740, [0x03BC]=0x1D741, [0x03BD]=0x1D742, [0x03BE]=0x1D743, [0x03BF]=0x1D744,
+ [0x03C0]=0x1D745, [0x03C1]=0x1D746, [0x03C2]=0x1D747, [0x03C3]=0x1D748, [0x03C4]=0x1D749,
+ [0x03C5]=0x1D74A, [0x03C6]=0x1D74B, [0x03C7]=0x1D74C, [0x03C8]=0x1D74D, [0x03C9]=0x1D74E,
+ [0x03D1]=0x1D751, [0x03D5]=0x1D753, [0x03D6]=0x1D755, [0x03F0]=0x1D752, [0x03F1]=0x1D754,
+ [0x03F4]=0x1D72D, [0x03F5]=0x1D750,
+ },
+ symbols = {
+ [0x2202]=0x1D74F, [0x2207]=0x1D735,
+ [0x0027]=0x2032, -- prime
+ },
+}
+
+local regular = {
+ tf = regular_tf,
+ it = regular_it,
+ bf = regular_bf,
+ bi = regular_bi,
+}
+
+local sansserif_tf = {
+ digits = todigit(0x1D7E2),
+ ucletters = toupper(0x1D5A0),
+ lcletters = tolower(0x1D5BA),
+ lcgreek = tovector(regular_tf.lcgreek),
+ ucgreek = tovector(regular_tf.ucgreek),
+ symbols = tovector(regular_tf.symbols),
+}
+
+local sansserif_it = {
+ digits = tovector(regular_tf.digits),
+ ucletters = toupper(0x1D608),
+ lcletters = tolower(0x1D622),
+ lcgreek = tovector(regular_tf.lcgreek),
+ ucgreek = tovector(regular_tf.ucgreek),
+ symbols = tovector(regular_tf.symbols),
+}
+
+local sansserif_bf = {
+ digits = todigit(0x1D7EC),
+ ucletters = toupper(0x1D5D4),
+ lcletters = tolower(0x1D5EE),
+ ucgreek = {
+ [0x0391]=0x1D756, [0x0392]=0x1D757, [0x0393]=0x1D758, [0x0394]=0x1D759, [0x0395]=0x1D75A,
+ [0x0396]=0x1D75B, [0x0397]=0x1D75C, [0x0398]=0x1D75D, [0x0399]=0x1D75E, [0x039A]=0x1D75F,
+ [0x039B]=0x1D760, [0x039C]=0x1D761, [0x039D]=0x1D762, [0x039E]=0x1D763, [0x039F]=0x1D764,
+ [0x03A0]=0x1D765, [0x03A1]=0x1D766, [0x03A3]=0x1D768, [0x03A4]=0x1D769, [0x03A5]=0x1D76A,
+ [0x03A6]=0x1D76B, [0x03A7]=0x1D76C, [0x03A8]=0x1D76D, [0x03A9]=0x1D76E,
+ },
+ lcgreek = {
+ [0x03B1]=0x1D770, [0x03B2]=0x1D771, [0x03B3]=0x1D772, [0x03B4]=0x1D773, [0x03B5]=0x1D774,
+ [0x03B6]=0x1D775, [0x03B7]=0x1D776, [0x03B8]=0x1D777, [0x03B9]=0x1D778, [0x03BA]=0x1D779,
+ [0x03BB]=0x1D77A, [0x03BC]=0x1D77B, [0x03BD]=0x1D77C, [0x03BE]=0x1D77D, [0x03BF]=0x1D77E,
+ [0x03C0]=0x1D77F, [0x03C1]=0x1D780, [0x03C2]=0x1D781, [0x03C3]=0x1D782, [0x03C4]=0x1D783,
+ [0x03C5]=0x1D784, [0x03C6]=0x1D785, [0x03C7]=0x1D786, [0x03C8]=0x1D787, [0x03C9]=0x1D788,
+ [0x03D1]=0x1D78B, [0x03D5]=0x1D78D, [0x03D6]=0x1D78F, [0x03F0]=0x1D78C, [0x03F1]=0x1D78E,
+ [0x03F4]=0x1D767, [0x03F5]=0x1D78A,
+ },
+ symbols = {
+ [0x2202]=0x1D789, [0x2207]=0x1D76F,
+ [0x0027]=0x2032, -- prime
+ },
+}
+
+local sansserif_bi = {
+ digits = tovector(sansserif_bf.digits),
+ ucletters = toupper(0x1D63C),
+ lcletters = tolower(0x1D656),
+ ucgreek = {
+ [0x0391]=0x1D790, [0x0392]=0x1D791, [0x0393]=0x1D792, [0x0394]=0x1D793, [0x0395]=0x1D794,
+ [0x0396]=0x1D795, [0x0397]=0x1D796, [0x0398]=0x1D797, [0x0399]=0x1D798, [0x039A]=0x1D799,
+ [0x039B]=0x1D79A, [0x039C]=0x1D79B, [0x039D]=0x1D79C, [0x039E]=0x1D79D, [0x039F]=0x1D79E,
+ [0x03A0]=0x1D79F, [0x03A1]=0x1D7A0, [0x03A3]=0x1D7A2, [0x03A4]=0x1D7A3, [0x03A5]=0x1D7A4,
+ [0x03A6]=0x1D7A5, [0x03A7]=0x1D7A6, [0x03A8]=0x1D7A7, [0x03A9]=0x1D7A8,
+ },
+ lcgreek = {
+ [0x03B1]=0x1D7AA, [0x03B2]=0x1D7AB, [0x03B3]=0x1D7AC, [0x03B4]=0x1D7AD, [0x03B5]=0x1D7AE,
+ [0x03B6]=0x1D7AF, [0x03B7]=0x1D7B0, [0x03B8]=0x1D7B1, [0x03B9]=0x1D7B2, [0x03BA]=0x1D7B3,
+ [0x03BB]=0x1D7B4, [0x03BC]=0x1D7B5, [0x03BD]=0x1D7B6, [0x03BE]=0x1D7B7, [0x03BF]=0x1D7B8,
+ [0x03C0]=0x1D7B9, [0x03C1]=0x1D7BA, [0x03C2]=0x1D7BB, [0x03C3]=0x1D7BC, [0x03C4]=0x1D7BD,
+ [0x03C5]=0x1D7BE, [0x03C6]=0x1D7BF, [0x03C7]=0x1D7C0, [0x03C8]=0x1D7C1, [0x03C9]=0x1D7C2,
+ [0x03D1]=0x1D7C5, [0x03D5]=0x1D7C7, [0x03D6]=0x1D7C9, [0x03F0]=0x1D7C6, [0x03F1]=0x1D7C8,
+ [0x03F4]=0x1D7A1, [0x03F5]=0x1D7C4,
+ },
+ symbols = {
+ [0x2202]=0x1D7C3, [0x2207]=0x1D7A9,
+ [0x0027]=0x2032, -- prime
+ },
+}
+
+local sansserif = {
+ tf = sansserif_tf,
+ it = sansserif_it,
+ bf = sansserif_bf,
+ bi = sansserif_bi,
+}
+
+local monospaced_tf = {
+ digits = todigit(0x1D7F6),
+ ucletters = toupper(0x1D670),
+ lcletters = tolower(0x1D68A),
+ lcgreek = tovector(sansserif_tf.lcgreek),
+ ucgreek = tovector(sansserif_tf.ucgreek),
+ symbols = tovector(sansserif_tf.symbols),
+}
+
+local monospaced_it = tovector(sansserif_it)
+local monospaced_bf = tovector(sansserif_bf)
+local monospaced_bi = tovector(sansserif_bi)
+
+local monospaced = {
+ tf = monospaced_tf,
+ it = monospaced_tf,
+ bf = monospaced_bf,
+ bi = monospaced_bf,
+}
+
+local blackboard_tf = {
+ digits = todigit(0x1D7D8),
+ ucletters = { -- C H N P Q R Z
+ [0x00041]=0x1D538, [0x00042]=0x1D539, [0x00043]=0x02102, [0x00044]=0x1D53B, [0x00045]=0x1D53C,
+ [0x00046]=0x1D53D, [0x00047]=0x1D53E, [0x00048]=0x0210D, [0x00049]=0x1D540, [0x0004A]=0x1D541,
+ [0x0004B]=0x1D542, [0x0004C]=0x1D543, [0x0004D]=0x1D544, [0x0004E]=0x02115, [0x0004F]=0x1D546,
+ [0x00050]=0x02119, [0x00051]=0x0211A, [0x00052]=0x0211D, [0x00053]=0x1D54A, [0x00054]=0x1D54B,
+ [0x00055]=0x1D54C, [0x00056]=0x1D54D, [0x00057]=0x1D54E, [0x00058]=0x1D54F, [0x00059]=0x1D550,
+ [0x0005A]=0x02124,
+ },
+ lcletters = {
+ -- tolower(0x1D552) :
+ [0x00061] = 0x1D552, [0x00062] = 0x1D553, [0x00063] = 0x1D554, [0x00064] = 0x1D555,
+ [0x00065] = 0x1D556, [0x00066] = 0x1D557, [0x00067] = 0x1D558, [0x00068] = 0x1D559,
+ [0x00069] = 0x1D55A, [0x0006A] = 0x1D55B, [0x0006B] = 0x1D55C, [0x0006C] = 0x1D55D,
+ [0x0006D] = 0x1D55E, [0x0006E] = 0x1D55F, [0x0006F] = 0x1D560, [0x00070] = 0x1D561,
+ [0x00071] = 0x1D562, [0x00072] = 0x1D563, [0x00073] = 0x1D564, [0x00074] = 0x1D565,
+ [0x00075] = 0x1D566, [0x00076] = 0x1D567, [0x00077] = 0x1D568, [0x00078] = 0x1D569,
+ [0x00079] = 0x1D56A, [0x0007A] = 0x1D56B,
+ -- arabic
+ [0x00628] = 0x1EEA1, [0x0062A] = 0x1EEB5, [0x0062B] = 0x1EEB6, [0x0062C] = 0x1EEA2,
+ [0x0062D] = 0x1EEA7, [0x0062E] = 0x1EEB7, [0x0062F] = 0x1EEA3, [0x00630] = 0x1EEB8,
+ [0x00631] = 0x1EEB3, [0x00632] = 0x1EEA6, [0x00633] = 0x1EEAE, [0x00634] = 0x1EEB4,
+ [0x00635] = 0x1EEB1, [0x00636] = 0x1EEB9, [0x00637] = 0x1EEA8, [0x00638] = 0x1EEBA,
+ [0x00639] = 0x1EEAF, [0x0063A] = 0x1EEBB, [0x00641] = 0x1EEB0, [0x00642] = 0x1EEB2,
+ [0x00644] = 0x1EEAB, [0x00645] = 0x1EEAC, [0x00646] = 0x1EEAD, [0x00648] = 0x1EEA5,
+ [0x0064A] = 0x1EEA9,
+ },
+ lcgreek = { -- gamma pi
+ [0x03B3]=0x0213C, [0x03C0]=0x0213D,
+ },
+ ucgreek = { -- Gamma pi
+ [0x0393]=0x0213E, [0x03A0]=0x0213F,
+ },
+ symbols = { -- sum
+ [0x2211]=0x02140,
+ [0x0027]=0x2032, -- prime
+ },
+}
+
+blackboard_tf.lcgreek = merged(regular_tf.lcgreek, blackboard_tf.lcgreek)
+blackboard_tf.ucgreek = merged(regular_tf.ucgreek, blackboard_tf.ucgreek)
+blackboard_tf.symbols = merged(regular_tf.symbols, blackboard_tf.symbols)
+
+local blackboard = {
+ tf = blackboard_tf,
+ it = blackboard_tf,
+ bf = blackboard_tf,
+ bi = blackboard_tf,
+}
+
+local fraktur_tf= {
+ digits = tovector(regular_tf.digits),
+ ucletters = { -- C H I R Z
+ [0x00041]=0x1D504, [0x00042]=0x1D505, [0x00043]=0x0212D, [0x00044]=0x1D507, [0x00045]=0x1D508,
+ [0x00046]=0x1D509, [0x00047]=0x1D50A, [0x00048]=0x0210C, [0x00049]=0x02111, [0x0004A]=0x1D50D,
+ [0x0004B]=0x1D50E, [0x0004C]=0x1D50F, [0x0004D]=0x1D510, [0x0004E]=0x1D511, [0x0004F]=0x1D512,
+ [0x00050]=0x1D513, [0x00051]=0x1D514, [0x00052]=0x0211C, [0x00053]=0x1D516, [0x00054]=0x1D517,
+ [0x00055]=0x1D518, [0x00056]=0x1D519, [0x00057]=0x1D51A, [0x00058]=0x1D51B, [0x00059]=0x1D51C,
+ [0x0005A]=0x02128,
+ },
+ lcletters = tolower(0x1D51E),
+ lcgreek = tovector(regular_tf.lcgreek),
+ ucgreek = tovector(regular_tf.ucgreek),
+ symbols = tovector(regular_tf.symbols),
+}
+
+local fraktur_bf = {
+ digits = tovector(regular_bf.digits),
+ ucletters = toupper(0x1D56C),
+ lcletters = tolower(0x1D586),
+ lcgreek = tovector(regular_bf.lcgreek),
+ ucgreek = tovector(regular_bf.ucgreek),
+ symbols = tovector(regular_bf.symbols),
+}
+
+local fraktur = { -- ok
+ tf = fraktur_tf,
+ bf = fraktur_bf,
+ it = fraktur_tf,
+ bi = fraktur_bf,
+}
+
+local script_tf = {
+ digits = tovector(regular_tf.digits),
+ ucletters = { -- B E F H I L M R -- P 2118
+ [0x00041]=0x1D49C, [0x00042]=0x0212C, [0x00043]=0x1D49E, [0x00044]=0x1D49F, [0x00045]=0x02130,
+ [0x00046]=0x02131, [0x00047]=0x1D4A2, [0x00048]=0x0210B, [0x00049]=0x02110, [0x0004A]=0x1D4A5,
+ [0x0004B]=0x1D4A6, [0x0004C]=0x02112, [0x0004D]=0x02133, [0x0004E]=0x1D4A9, [0x0004F]=0x1D4AA,
+ [0x00050]=0x1D4AB, [0x00051]=0x1D4AC, [0x00052]=0x0211B, [0x00053]=0x1D4AE, [0x00054]=0x1D4AF,
+ [0x00055]=0x1D4B0, [0x00056]=0x1D4B1, [0x00057]=0x1D4B2, [0x00058]=0x1D4B3, [0x00059]=0x1D4B4,
+ [0x0005A]=0x1D4B5,
+ },
+ lcletters = { -- E G O -- L 2113
+ [0x00061]=0x1D4B6, [0x00062]=0x1D4B7, [0x00063]=0x1D4B8, [0x00064]=0x1D4B9, [0x00065]=0x0212F,
+ [0x00066]=0x1D4BB, [0x00067]=0x0210A, [0x00068]=0x1D4BD, [0x00069]=0x1D4BE, [0x0006A]=0x1D4BF,
+ [0x0006B]=0x1D4C0, [0x0006C]=0x1D4C1, [0x0006D]=0x1D4C2, [0x0006E]=0x1D4C3, [0x0006F]=0x02134,
+ [0x00070]=0x1D4C5, [0x00071]=0x1D4C6, [0x00072]=0x1D4C7, [0x00073]=0x1D4C8, [0x00074]=0x1D4C9,
+ [0x00075]=0x1D4CA, [0x00076]=0x1D4CB, [0x00077]=0x1D4CC, [0x00078]=0x1D4CD, [0x00079]=0x1D4CE,
+ [0x0007A]=0x1D4CF,
+ },
+ lcgreek = tovector(regular_tf.lcgreek),
+ ucgreek = tovector(regular_tf.ucgreek),
+ symbols = tovector(regular_tf.symbols),
+}
+
+local script_bf = {
+ digits = tovector(regular_bf.digits),
+ ucletters = toupper(0x1D4D0),
+ lcletters = tolower(0x1D4EA),
+ lcgreek = tovector(regular_bf.lcgreek),
+ ucgreek = tovector(regular_bf.ucgreek),
+ symbols = tovector(regular_bf.symbols),
+}
+
+local script = {
+ tf = script_tf,
+ bf = script_bf,
+ it = script_tf,
+ bi = script_bf,
+}
+
+local calligraphic_tf = {
+ digits = tovector(regular_tf.digits),
+ ucletters = toupper(0x100020),
+ lcletters = tolower(0x100000),
+ lcgreek = tovector(regular_tf.lcgreek),
+ ucgreek = tovector(regular_tf.ucgreek),
+ symbols = tovector(regular_tf.symbols),
+}
+
+local calligraphic_bf = {
+ digits = tovector(regular_bf.digits),
+ ucletters = toupper(0x100060),
+ lcletters = tolower(0x100040),
+ lcgreek = tovector(regular_bf.lcgreek),
+ ucgreek = tovector(regular_bf.ucgreek),
+ symbols = tovector(regular_bf.symbols),
+}
+
+local calligraphic = {
+ tf = calligraphic_tf,
+ bf = calligraphic_bf,
+ it = calligraphic_tf,
+ bi = calligraphic_bf,
+}
+
+local alphabets = allocate {
+ regular = regular,
+ sansserif = sansserif,
+ monospaced = monospaced,
+ blackboard = blackboard,
+ fraktur = fraktur,
+ script = script,
+ calligraphic = calligraphic,
+}
+
+alphabets.tt = tovector(monospaced)
+alphabets.ss = tovector(sansserif)
+alphabets.rm = tovector(regular)
+alphabets.bb = tovector(blackboard)
+alphabets.fr = tovector(fraktur)
+alphabets.sr = tovector(script)
+alphabets.ca = tovector(calligraphic)
+
+monospaced.normal = tovector(monospaced_tf)
+monospaced.italic = tovector(monospaced_it)
+monospaced.bold = tovector(monospaced_bf)
+monospaced.bolditalic = tovector(monospaced_bi)
+
+sansserif.normal = tovector(sansserif_tf)
+sansserif.italic = tovector(sansserif_it)
+sansserif.bold = tovector(sansserif_bf)
+sansserif.bolditalic = tovector(sansserif_bi)
+
+regular.normal = tovector(regular_tf)
+regular.italic = tovector(regular_it)
+regular.bold = tovector(regular_bf)
+regular.bolditalic = tovector(regular_bi)
+
+blackboard.normal = tovector(blackboard_tf)
+blackboard.italic = tovector(blackboard_tf)
+blackboard.bold = tovector(blackboard_tf)
+blackboard.bolditalic = tovector(blackboard_tf)
+
+fraktur.normal = tovector(fraktur_tf)
+fraktur.italic = tovector(fraktur_bf)
+fraktur.bold = tovector(fraktur_tf)
+fraktur.bolditalic = tovector(fraktur_bf)
+
+script.normal = tovector(script_tf)
+script.italic = tovector(script_bf)
+script.bold = tovector(script_tf)
+script.bolditalic = tovector(script_bf)
+
+calligraphic.normal = tovector(calligraphic_tf)
+calligraphic.italic = tovector(calligraphic_bf)
+calligraphic.bold = tovector(calligraphic_tf)
+calligraphic.bolditalic = tovector(calligraphic_bf)
+
+alphabets.serif = tovector(regular)
+alphabets.type = tovector(monospaced)
+alphabets.teletype = tovector(monospaced)
+
+mathematics.alphabets = alphabets
+
+local mathremap = allocate { }
+mathematics.mapremap = mathremap
+
+local boldmap = allocate { }
+mathematics.boldmap = boldmap
+
+-- all math (a bit of redundancy here) (sorted for tracing)
+
+-- so we can do: mathematics.alphabets.blackboard.tf.digits
+
+for alphabet, styles in sortedhash(alphabets) do -- per 9/6/2011 we also have attr for missing
+ for style, data in sortedhash(styles) do
+ -- let's keep the long names (for tracing)
+ local n = #mathremap + 1
+ local d = {
+ attribute = n,
+ alphabet = alphabet,
+ style = style,
+ }
+ styles[style] = d
+ setmetatableindex(d,data) -- we could use a alphadata table
+ mathremap[n] = d
+ end
+end
+
+-- bold math
+
+local function remapbold(tf,bf)
+ local styles = mathematics.styles
+ local sets = mathematics.sets
+ for i=1,#styles do
+ for j=1,#sets do
+ local one = styles[i]
+ local two = sets[j]
+ local a = alphabets[one]
+ local tf = a[tf][two]
+ local bf = a[bf][two]
+ if tf and bf then
+ for k, v in next, tf do
+ boldmap[v] = bf[k]
+ end
+ end
+ end
+ end
+end
+
+remapbold("tf","bf")
+remapbold("it","bi")
+
+-- table.save("e:/tmp/a.lua",alphabets)
+-- table.save("e:/tmp/b.lua",boldmap)
+
+function mathematics.tostyle(attribute)
+ local r = mathremap[attribute]
+ return r and r.style or "tf"
+end
+
+function mathematics.toname(attribute)
+ local r = mathremap[attribute]
+ return r and r.alphabet or "regular"
+end
+
+-- of course we could do some div/mod trickery instead
+
+local mathalphabet = attributes.private("mathalphabet")
+
+function mathematics.getboth(alphabet,style)
+ local data = alphabet and alphabets[alphabet] or regular
+ data = data[style or "tf"] or data.tf
+ return data and data.attribute
+end
+
+function mathematics.getstyle(style)
+ local r = mathremap[texgetattribute(mathalphabet)]
+ local alphabet = r and r.alphabet or "regular"
+ local data = alphabets[alphabet][style]
+ return data and data.attribute
+end
+
+function mathematics.syncboth(alphabet,style)
+ local data = alphabet and alphabets[alphabet] or regular
+ data = style and data[style] or data.tf
+ texsetattribute(mathalphabet,data and data.attribute or texattribute[mathalphabet])
+end
+
+function mathematics.syncstyle(style)
+ local r = mathremap[texgetattribute(mathalphabet)]
+ local alphabet = r and r.alphabet or "regular"
+ local data = alphabets[alphabet][style]
+ texsetattribute(mathalphabet,data and data.attribute or texattribute[mathalphabet])
+end
+
+function mathematics.syncname(alphabet)
+ -- local r = mathremap[mathalphabet]
+ local r = mathremap[texgetattribute(mathalphabet)]
+ local style = r and r.style or "tf"
+ local data = alphabets[alphabet][style]
+ texsetattribute(mathalphabet,data and data.attribute or texattribute[mathalphabet])
+end
+
+implement {
+ name = "setmathattribute",
+ arguments = "2 arguments",
+ public = true,
+ protected = true,
+ actions = function(alphabet,style)
+ if texgetmode() == mathmode_code then
+ local data = alphabets[alphabet]
+ if not data then
+ alphabet = "regular"
+ data = regular
+ end
+ local used = data[style]
+ if not used then
+ style = "tf"
+ used = data.tf
+ end
+ setmacro("currentmathalphabet",alphabet == "regular" and "rm" or alphabet)
+ setmacro("currentmathfontstyle",style)
+ texsetattribute(mathalphabet,used and used.attribute or texattribute[mathalphabet])
+ end
+ end
+}
+
+implement {
+ name = "setmathfontstyle",
+ arguments = "argument",
+ public = true,
+ protected = true,
+ actions = function(style)
+ if texgetmode() == mathmode_code then
+ local r = mathremap[texgetattribute(mathalphabet)]
+ local alphabet = r and r.alphabet or "regular"
+ local data = alphabets[alphabet][style]
+ setmacro("currentmathfontstyle",style)
+ texsetattribute(mathalphabet,data and data.attribute or texattribute[mathalphabet])
+ end
+ end
+}
+
+implement {
+ name = "setmathalphabet",
+ arguments = "argument",
+ public = true,
+ protected = true,
+ actions = function(alphabet)
+ if texgetmode() == mathmode_code then
+ -- local r = mathremap[mathalphabet]
+ local a = texgetattribute(mathalphabet)
+ local r = mathremap[a]
+ local style = r and r.style or "tf"
+ local data = alphabets[alphabet][style]
+ texsetattribute(mathalphabet,data and data.attribute or a)
+ end
+ end
+}
+
+local islcgreek = regular_tf.lcgreek
+local isucgreek = regular_tf.ucgreek
+local issygreek = regular_tf.symbols
+local isgreek = merged(islcgreek,isucgreek,issygreek)
+
+local greekremapping = {
+ { what = "unchanged" }, -- upright
+ { what = "upright", it = "tf", bi = "bf" }, -- upright
+ { what = "italic", tf = "it", bf = "bi" }, -- italic
+}
+
+local usedremap = { }
+
+local function resolver(map)
+ return function (t,k)
+ local v =
+ map.digits [k] or
+ map.lcletters[k] or map.ucletters[k] or
+ map.lcgreek [k] or map.ucgreek [k] or
+ map.symbols [k] or k
+ t[k] = v
+ return v
+ end
+end
+
+for k, v in next, mathremap do
+ local t = { }
+ setmetatableindex(t,resolver(v))
+ usedremap[k] = t
+end
+
+local function remapgreek(mathalphabet,how,detail,char)
+ local r = mathremap[mathalphabet] -- what if 0
+ local alphabet = r and r.alphabet or "regular"
+ local style = r and r.style or "tf"
+ local remapping = greekremapping[how]
+ if trace_greek then
+ report_remapping("greek %s, %s char %C, alphabet %a %a, method %a","before",detail,char,alphabet,style,remapping.what)
+ end
+ local newstyle = remapping[style]
+ if newstyle then
+ local data = alphabets[alphabet][newstyle] -- always something
+ mathalphabet = data and data.attribute or mathalphabet
+ style = newstyle
+ end
+ if trace_greek then
+ report_remapping("greek %s, %s char %C, alphabet %a %a, method %a","after",detail,char,alphabet,style,remapping.what)
+ end
+ return mathalphabet, style
+end
+
+function mathematics.remapalphabets(char,mathalphabet,mathgreek)
+ if not mathalphabet then
+ return
+ end
+ local g = gaps[char]
+ if g then
+ report_remapping("gap character %U changed into %C",char,g)
+ char = g
+ return
+ end
+ if mathgreek and mathgreek > 0 then
+ if not isgreek[char] then
+ -- nothing needed
+ elseif islcgreek[char] then
+ local lc = (mathgreek >> 4) & 0x0F
+ if lc > 1 then
+ mathalphabet = remapgreek(mathalphabet,lc,"lowercase",char)
+ end
+ elseif isucgreek[char] then
+ local uc = (mathgreek >> 0) & 0x0F
+ if uc > 1 then
+ mathalphabet = remapgreek(mathalphabet,uc,"uppercase",char)
+ end
+ elseif issygreek[char] then
+ local sy = (mathgreek >> 8) & 0x0F
+ if sy > 1 then
+ mathalphabet = remapgreek(mathalphabet,sy,"symbol",char)
+ end
+ end
+ end
+ if mathalphabet > 0 then
+ local remap = usedremap[mathalphabet] -- redundant check
+ if remap then
+ local newchar = remap[char]
+ return newchar ~= char and newchar
+ end
+ end
+ -- return nil
+end
+
+-- begin of experiment
+
+local stylefallbacks = {
+ tf = "bf",
+ it = "bi",
+ bf = "tf",
+ bi = "it",
+}
+
+function mathematics.fallbackstyleattr(attribute)
+ local redirect = mathremap[attribute]
+ local alphabet = redirect.alphabet or "regular"
+ local style = redirect.style or "tf"
+ local fallback = stylefallbacks[style]
+ if fallback then
+ local data = alphabets[alphabet][fallback]
+ if data then
+ local attr = data.attribute
+ return attribute ~= attr and attr
+ end
+ end
+end
+
+-- end of experiment
+
+local function checkedcopy(characters,child,parent)
+ for k, v in next, child do
+ if not characters[v] then
+ characters[v] = characters[parent[k]]
+ end
+ end
+end
+
+function mathematics.addfallbacks(main)
+ local characters = main.characters
+ checkedcopy(characters,regular.bf.ucgreek,regular.tf.ucgreek)
+ checkedcopy(characters,regular.bf.lcgreek,regular.tf.lcgreek)
+ checkedcopy(characters,regular.bi.ucgreek,regular.it.ucgreek)
+ checkedcopy(characters,regular.bi.lcgreek,regular.it.lcgreek)
+end
+
+implement {
+ name = "traversemath",
+ arguments = { "string", "string", "string", "csname" },
+ actions = function(style,alternative,set,command)
+ local d = alphabets[style]
+ if d then
+ d = d[alternative]
+ if d then
+ d = d[set]
+ if d then
+ local c = context[command]
+ for k, v in sortedhash(d) do
+ c(v)
+ end
+ end
+ end
+ end
+ end
+}
+
+local blocks = characters.blocks
+
+implement {
+ name = "traverseblock",
+ arguments = { "string", "csname" },
+ actions = function(name,command)
+ local b = blocks[string.nospaces(name)]
+ if b then
+ local c = context[command]
+ for k = b.first, b.last do
+ c(gaps[k] or k)
+ end
+ end
+ end
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-noa.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-noa.lmt
index 118ab18267a..4a0cb57449e 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/math-noa.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-noa.lmt
@@ -7,6 +7,11 @@ if not modules then modules = { } end modules ['math-noa'] = {
license = "see context related readme files"
}
+-- TODO: SET CLASSES !
+
+-- if specials and (specials[1] == "char" or specials[1] == "font") then -- can we avoid this
+-- ... better create a reverse mapping from the already present vectors
+
-- beware: this is experimental code and there will be a more generic (attribute value
-- driven) interface too but for the moment this is ok (sometime in 2015-2016 i will
-- start cleaning up as by then the bigger picture is clear and code has been used for
@@ -30,7 +35,6 @@ local formatters, gmatch = string.formatters, string.gmatch
local sortedhash = table.sortedhash
local insert, remove = table.insert, table.remove
local div, round = math.div, math.round
-local bor, band = bit32.bor, bit32.band
local fonts = fonts
local nodes = nodes
@@ -48,42 +52,28 @@ local registerdirective = directives.register
local logreporter = logs.reporter
local setmetatableindex = table.setmetatableindex
+local texgetmode = tex.getmode
+local mathmode_code = tex.modelevels.math
+
local colortracers = nodes.tracers.colors
-local trace_remapping = false registertracker("math.remapping", function(v) trace_remapping = v end)
-local trace_processing = false registertracker("math.processing", function(v) trace_processing = v end)
-local trace_analyzing = false registertracker("math.analyzing", function(v) trace_analyzing = v end)
-local trace_normalizing = false registertracker("math.normalizing", function(v) trace_normalizing = v end)
-local trace_collapsing = false registertracker("math.collapsing", function(v) trace_collapsing = v end)
-local trace_fixing = false registertracker("math.fixing", function(v) trace_foxing = v end)
-local trace_patching = false registertracker("math.patching", function(v) trace_patching = v end)
-local trace_goodies = false registertracker("math.goodies", function(v) trace_goodies = v end)
-local trace_variants = false registertracker("math.variants", function(v) trace_variants = v end)
-local trace_alternates = false registertracker("math.alternates", function(v) trace_alternates = v end)
-local trace_italics = false registertracker("math.italics", function(v) trace_italics = v end)
-local trace_kernpairs = false registertracker("math.kernpairs", function(v) trace_kernpairs = v end)
-local trace_domains = false registertracker("math.domains", function(v) trace_domains = v end)
-local trace_families = false registertracker("math.families", function(v) trace_families = v end)
-local trace_fences = false registertracker("math.fences", function(v) trace_fences = v end)
-local trace_unstacking = false registertracker("math.unstack", function(v) trace_unstacking = v end)
-
-local check_coverage = true registerdirective("math.checkcoverage", function(v) check_coverage = v end)
-
-local report_processing = logreporter("mathematics","processing")
-local report_remapping = logreporter("mathematics","remapping")
-local report_normalizing = logreporter("mathematics","normalizing")
-local report_collapsing = logreporter("mathematics","collapsing")
-local report_fixing = logreporter("mathematics","fixing")
-local report_patching = logreporter("mathematics","patching")
-local report_goodies = logreporter("mathematics","goodies")
-local report_variants = logreporter("mathematics","variants")
-local report_alternates = logreporter("mathematics","alternates")
-local report_italics = logreporter("mathematics","italics")
-local report_kernpairs = logreporter("mathematics","kernpairs")
-local report_domains = logreporter("mathematics","domains")
-local report_families = logreporter("mathematics","families")
-local report_fences = logreporter("mathematics","fences")
-local report_unstacking = logreporter("mathematics","unstack")
+-- most trace/report will move into the closures
+
+local trace_remapping = false registertracker("math.remapping", function(v) trace_remapping = v end)
+local trace_processing = false registertracker("math.processing", function(v) trace_processing = v end)
+local trace_analyzing = false registertracker("math.analyzing", function(v) trace_analyzing = v end)
+local trace_normalizing = false registertracker("math.normalizing", function(v) trace_normalizing = v end)
+local trace_collapsing = false registertracker("math.collapsing", function(v) trace_collapsing = v end)
+local trace_goodies = false registertracker("math.goodies", function(v) trace_goodies = v end)
+
+local check_coverage = true registerdirective("math.checkcoverage", function(v) check_coverage = v end)
+local use_math_goodies = true registerdirective("math.nogoodies", function(v) use_math_goodies = not v end)
+
+local report_processing = logreporter("mathematics","processing")
+local report_remapping = logreporter("mathematics","remapping")
+local report_normalizing = logreporter("mathematics","normalizing")
+local report_collapsing = logreporter("mathematics","collapsing")
+local report_goodies = logreporter("mathematics","goodies")
local a_mathrendering = privateattribute("mathrendering")
local a_exportstatus = privateattribute("exportstatus")
@@ -106,41 +96,66 @@ local setattrlist = nuts.setattrlist
local setwidth = nuts.setwidth
local setheight = nuts.setheight
local setdepth = nuts.setdepth
+local setdelimiter = nuts.setdelimiter
+local setclass = nuts.setclass
local getfield = nuts.getfield
local getnext = nuts.getnext
local getprev = nuts.getprev
local getboth = nuts.getboth
+local isnext = nuts.isnext
+local isprev = nuts.isprev
+local isboth = nuts.isboth
local getid = nuts.getid
local getsubtype = nuts.getsubtype
local getchar = nuts.getchar
local getfont = nuts.getfont
local getfam = nuts.getfam
+local getcharspec = nuts.getcharspec
local getattr = nuts.getattr
local getattrs = nuts.getattrs
local getlist = nuts.getlist
local getwidth = nuts.getwidth
local getheight = nuts.getheight
local getdepth = nuts.getdepth
+local getwhd = nuts.getwhd
+local getdelimiter = nuts.getdelimiter
+local getleftdelimiter = nuts.getleftdelimiter
+local getrightdelimiter = nuts.getrightdelimiter
+local getnumerator = nuts.getnumerator
+local getdenominator = nuts.getdenominator
+local getdegree = nuts.getdegree
+local gettop = nuts.gettop
+local getmiddle = nuts.getmiddle
+local getbottom = nuts.getbottom
+local getchoice = nuts.getchoice
local getnucleus = nuts.getnucleus
local getsub = nuts.getsub
local getsup = nuts.getsup
local getsubpre = nuts.getsubpre
local getsuppre = nuts.getsuppre
+local getprime = nuts.getprime
local setnucleus = nuts.setnucleus
local setsub = nuts.setsub
local setsup = nuts.setsup
local setsubpre = nuts.setsubpre
local setsuppre = nuts.setsuppre
+local setprime = nuts.setprime
+
+local getoffsets = nuts.getoffsets
+local setoffsets = nuts.setoffsets
-local flush_node = nuts.flush
+local getoptions = nuts.getoptions
+local setoptions = nuts.setoptions
+
+local flushnode = nuts.flush
local copy_node = nuts.copy
local slide_nodes = nuts.slide
local set_visual = nuts.setvisual
-local mlist_to_hlist = nuts.mlist_to_hlist
+local mlisttohlist = nuts.mlisttohlist
local new_kern = nodepool.kern
local new_submlist = nodepool.submlist
@@ -152,6 +167,7 @@ local fonthashes = fonts.hashes
local fontdata = fonthashes.identifiers
local fontcharacters = fonthashes.characters
local fontitalics = fonthashes.italics
+local fontparameters = fonthashes.parameters
local variables = interfaces.variables
local texsetattribute = tex.setattribute
@@ -161,6 +177,10 @@ local unsetvalue = attributes.unsetvalue
local implement = interfaces.implement
local v_reset = variables.reset
+local v_small = variables.small
+local v_medium = variables.medium
+local v_big = variables.big
+local v_line = variables.line
local chardata = characters.data
@@ -178,55 +198,51 @@ local enableaction = tasks.enableaction
local setaction = tasks.setaction
local nodecodes = nodes.nodecodes
-local noadcodes = nodes.noadcodes
+----- noadcodes = nodes.noadcodes
local fencecodes = nodes.fencecodes
-
-local ordnoad_code = noadcodes.ord
-local opdisplaylimitsnoad_code = noadcodes.opdisplaylimits
-local oplimitsnoad_code = noadcodes.oplimits
-local opnolimitsnoad_code = noadcodes.opnolimits
-local binnoad_code = noadcodes.bin
-local relnode_code = noadcodes.rel
-local opennoad_code = noadcodes.open
-local closenoad_code = noadcodes.close
-local punctnoad_code = noadcodes.punct
-local innernoad_code = noadcodes.inner
-local undernoad_code = noadcodes.under
-local overnoad_code = noadcodes.over
-local vcenternoad_code = noadcodes.vcenter
-local ordlimitsnoad_code = noadcodes.ordlimits or oplimitsnoad_code
-
-local noad_code = nodecodes.noad -- attr nucleus sub sup
-local accent_code = nodecodes.accent -- attr nucleus sub sup accent
-local radical_code = nodecodes.radical -- attr nucleus sub sup left degree
-local fraction_code = nodecodes.fraction -- attr nucleus sub sup left right
-local subbox_code = nodecodes.subbox -- attr list
-local submlist_code = nodecodes.submlist -- attr list
-local mathchar_code = nodecodes.mathchar -- attr fam char
-local mathtextchar_code = nodecodes.mathtextchar -- attr fam char
-local delimiter_code = nodecodes.delimiter -- attr small_fam small_char large_fam large_char
------ style_code = nodecodes.style -- attr style
------ parameter_code = nodecodes.parameter -- attr style
-local math_choice = nodecodes.choice -- attr display text script scriptscript
-local fence_code = nodecodes.fence -- attr subtype
+local classes = mathematics.classes -- or nodes.noadcodes
+
+local ordinary_class = classes.ordinary
+local operator_class = classes.operator
+local binary_class = classes.binary
+local relation_class = classes.relation
+local open_class = classes.open
+local close_class = classes.close
+local middle_class = classes.middle
+local punctuation_class = classes.punctuation
+local fenced_class = classes.fenced
+local fraction_class = classes.fraction
+local radical_class = classes.radical
+local accent_class = classes.accent
+local numbergroup_class = classes.numbergroup
+local digit_class = classes.digit
+
+local noad_code = nodecodes.noad
+local accent_code = nodecodes.accent
+local radical_code = nodecodes.radical
+local fraction_code = nodecodes.fraction
+local subbox_code = nodecodes.subbox
+local submlist_code = nodecodes.submlist
+local mathchar_code = nodecodes.mathchar
+local mathtextchar_code = nodecodes.mathtextchar
+local delimiter_code = nodecodes.delimiter
+----- style_code = nodecodes.style
+----- parameter_code = nodecodes.parameter
+local math_choice = nodecodes.choice
+local fence_code = nodecodes.fence
local leftfence_code = fencecodes.left
local middlefence_code = fencecodes.middle
local rightfence_code = fencecodes.right
--- local mathclasses = mathematics.classes
--- local fenceclasses = {
--- [leftfence_code] = mathclasses.open,
--- [middlefence_code] = mathclasses.middle,
--- [rightfence_code] = mathclasses.close,
--- }
-
-- this initial stuff is tricky as we can have removed and new nodes with the same address
-- the only way out is a free-per-page list of nodes (not bad anyway)
-- local gf = getfield local gt = setmetatableindex("number") getfield = function(n,f) gt[f] = gt[f] + 1 return gf(n,f) end mathematics.GETFIELD = gt
-- local sf = setfield local st = setmetatableindex("number") setfield = function(n,f,v) st[f] = st[f] + 1 sf(n,f,v) end mathematics.SETFIELD = st
+-- TODO : get rid of done
+
local function process(start,what,n,parent)
if n then
@@ -243,11 +259,9 @@ local function process(start,what,n,parent)
local id = getid(start)
if trace_processing then
if id == noad_code then
- report_processing("%w%S, class %a",n*2,nutstring(start),noadcodes[getsubtype(start)])
+ report_processing("%w%S, class %a",n*2,nutstring(start),classes[getsubtype(start)])
elseif id == mathchar_code then
- local char = getchar(start)
- local font = getfont(start)
- local fam = getfam(start)
+ local char, font, fam = getcharspec(start)
report_processing("%w%S, family %a, font %a, char %a, shape %c",n*2,nutstring(start),fam,font,char,char)
else
report_processing("%w%S",n*2,nutstring(start))
@@ -276,49 +290,51 @@ local function process(start,what,n,parent)
end
elseif id == noad_code then
-- single characters are like this
- local noad = getnucleus(start) if noad then process(noad,what,n,start) end -- list
- noad = getsup (start) if noad then process(noad,what,n,start) end -- list
- noad = getsub (start) if noad then process(noad,what,n,start) end -- list
- if getsubpre then
- noad = getsuppre (start) if noad then process(noad,what,n,start) end -- list
- noad = getsubpre (start) if noad then process(noad,what,n,start) end -- list
- end
+ local noad = getnucleus(start) if noad then process(noad,what,n,start) end -- list
+ noad = getsup(start) if noad then process(noad,what,n,start) end -- list
+ noad = getsub(start) if noad then process(noad,what,n,start) end -- list
+ noad = getsuppre(start) if noad then process(noad,what,n,start) end -- list
+ noad = getsubpre(start) if noad then process(noad,what,n,start) end -- list
+ noad = getprime(start) if noad then process(noad,what,n,start) end -- list
elseif id == mathchar_code or id == mathtextchar_code or id == delimiter_code then
break
elseif id == subbox_code or id == submlist_code then
- local noad = getlist(start) if noad then process(noad,what,n,start) end -- list (not getlist !)
+ local noad = getlist(start) if noad then process(noad,what,n,start) end -- list (not getlist !)
elseif id == fraction_code then
- local noad = getfield(start,"num") if noad then process(noad,what,n,start) end -- list
- noad = getfield(start,"denom") if noad then process(noad,what,n,start) end -- list
- noad = getfield(start,"left") if noad then process(noad,what,n,start) end -- delimiter
- noad = getfield(start,"right") if noad then process(noad,what,n,start) end -- delimiter
+ local noad = getnumerator(start) if noad then process(noad,what,n,start) end -- list
+ noad = getdenominator(start) if noad then process(noad,what,n,start) end -- list
+ noad = getleftdelimiter(start) if noad then process(noad,what,n,start) end -- delimiter
+ noad = getdelimiter(start) if noad then process(noad,what,n,start) end -- delimiter
+ noad = getrightdelimiter(start) if noad then process(noad,what,n,start) end -- delimiter
elseif id == math_choice then
- local noad = getfield(start,"display") if noad then process(noad,what,n,start) end -- list
- noad = getfield(start,"text") if noad then process(noad,what,n,start) end -- list
- noad = getfield(start,"script") if noad then process(noad,what,n,start) end -- list
- noad = getfield(start,"scriptscript") if noad then process(noad,what,n,start) end -- list
+ local noad = getchoice(start,1) if noad then process(noad,what,n,start) end -- list
+ noad = getchoice(start,2) if noad then process(noad,what,n,start) end -- list
+ noad = getchoice(start,3) if noad then process(noad,what,n,start) end -- list
+ noad = getchoice(start,4) if noad then process(noad,what,n,start) end -- list
elseif id == fence_code then
- local noad = getfield(start,"delimiter") if noad then process(noad,what,n,start) end -- delimiter
+ local noad = getdelimiter(start) if noad then process(noad,what,n,start) end -- delimiter
+ noad = gettop(start) if noad then process(noad,what,n,start) end -- list
+ noad = getbottom(start) if noad then process(noad,what,n,start) end -- list
elseif id == radical_code then
- local noad = getnucleus(start) if noad then process(noad,what,n,start) end -- list
- noad = getsup (start) if noad then process(noad,what,n,start) end -- list
- noad = getsub (start) if noad then process(noad,what,n,start) end -- list
- if getsubpre then
- noad = getsuppre (start) if noad then process(noad,what,n,start) end -- list
- noad = getsubpre (start) if noad then process(noad,what,n,start) end -- list
- end
- noad = getfield(start,"left") if noad then process(noad,what,n,start) end -- delimiter
- noad = getfield(start,"degree") if noad then process(noad,what,n,start) end -- list
+ local noad = getnucleus(start) if noad then process(noad,what,n,start) end -- list
+ noad = getsup(start) if noad then process(noad,what,n,start) end -- list
+ noad = getsub(start) if noad then process(noad,what,n,start) end -- list
+ noad = getsuppre(start) if noad then process(noad,what,n,start) end -- list
+ noad = getsubpre(start) if noad then process(noad,what,n,start) end -- list
+ noad = getprime(start) if noad then process(noad,what,n,start) end -- delimiter
+ noad = getleftdelimiter(start) if noad then process(noad,what,n,start) end -- delimiter
+ noad = getrightdelimiter(start) if noad then process(noad,what,n,start) end -- delimiter
+ noad = getdegree(start) if noad then process(noad,what,n,start) end -- list
elseif id == accent_code then
- local noad = getnucleus(start) if noad then process(noad,what,n,start) end -- list
- noad = getsup (start) if noad then process(noad,what,n,start) end -- list
- noad = getsub (start) if noad then process(noad,what,n,start) end -- list
- if getsubpre then
- noad = getsuppre (start) if noad then process(noad,what,n,start) end -- list
- noad = getsubpre (start) if noad then process(noad,what,n,start) end -- list
- end
- noad = getfield(start,"accent") if noad then process(noad,what,n,start) end -- list
- noad = getfield(start,"bot_accent") if noad then process(noad,what,n,start) end -- list
+ local noad = getnucleus(start) if noad then process(noad,what,n,start) end -- list
+ noad = getsup(start) if noad then process(noad,what,n,start) end -- list
+ noad = getsub(start) if noad then process(noad,what,n,start) end -- list
+ noad = getsuppre(start) if noad then process(noad,what,n,start) end -- list
+ noad = getsubpre(start) if noad then process(noad,what,n,start) end -- list
+ noad = getprime(start) if noad then process(noad,what,n,start) end -- list
+ noad = gettop(start) if noad then process(noad,what,n,start) end -- list
+ noad = getmiddle(start) if noad then process(noad,what,n,start) end -- list
+ noad = getbottom(start) if noad then process(noad,what,n,start) end -- list
-- elseif id == style_code then
-- -- has a next
-- elseif id == parameter_code then
@@ -337,47 +353,49 @@ local function processnested(current,what,n)
local noad = nil
local id = getid(current)
if id == noad_code then
- noad = getnucleus(current) if noad then process(noad,what,n,current) end -- list
- noad = getsup (current) if noad then process(noad,what,n,current) end -- list
- noad = getsub (current) if noad then process(noad,what,n,current) end -- list
- if getsubpre then
- noad = getsuppre (current) if noad then process(noad,what,n,current) end -- list
- noad = getsubpre (current) if noad then process(noad,what,n,current) end -- list
- end
+ noad = getnucleus(current) if noad then process(noad,what,n,current) end -- list
+ noad = getsup(current) if noad then process(noad,what,n,current) end -- list
+ noad = getsub(current) if noad then process(noad,what,n,current) end -- list
+ noad = getsuppre(current) if noad then process(noad,what,n,current) end -- list
+ noad = getsubpre(current) if noad then process(noad,what,n,current) end -- list
+ noad = getprime(current) if noad then process(noad,what,n,current) end -- list
elseif id == subbox_code or id == submlist_code then
- noad = getlist(current) if noad then process(noad,what,n,current) end -- list (not getlist !)
+ noad = getlist(current) if noad then process(noad,what,n,current) end -- list (not getlist !)
elseif id == fraction_code then
- noad = getfield(current,"num") if noad then process(noad,what,n,current) end -- list
- noad = getfield(current,"denom") if noad then process(noad,what,n,current) end -- list
- noad = getfield(current,"left") if noad then process(noad,what,n,current) end -- delimiter
- noad = getfield(current,"right") if noad then process(noad,what,n,current) end -- delimiter
+ noad = getnumerator(current) if noad then process(noad,what,n,current) end -- list
+ noad = getdenominator(current) if noad then process(noad,what,n,current) end -- list
+ noad = getleftdelimiter(current) if noad then process(noad,what,n,current) end -- delimiter
+ noad = getdelimiter(current) if noad then process(noad,what,n,current) end -- delimiter
+ noad = getrightdelimiter(current) if noad then process(noad,what,n,current) end -- delimiter
elseif id == math_choice then
- noad = getfield(current,"display") if noad then process(noad,what,n,current) end -- list
- noad = getfield(current,"text") if noad then process(noad,what,n,current) end -- list
- noad = getfield(current,"script") if noad then process(noad,what,n,current) end -- list
- noad = getfield(current,"scriptscript") if noad then process(noad,what,n,current) end -- list
+ noad = getchoice(start,1) if noad then process(noad,what,n,current) end -- list
+ noad = getchoice(start,2) if noad then process(noad,what,n,current) end -- list
+ noad = getchoice(start,3) if noad then process(noad,what,n,current) end -- list
+ noad = getchoice(start,4) if noad then process(noad,what,n,current) end -- list
elseif id == fence_code then
- noad = getfield(current,"delimiter") if noad then process(noad,what,n,current) end -- delimiter
+ noad = getdelimiter(current) if noad then process(noad,what,n,current) end -- delimiter
+ noad = gettop(current) if noad then process(noad,what,n,current) end -- list
+ noad = getbottom(current) if noad then process(noad,what,n,current) end -- list
elseif id == radical_code then
- noad = getnucleus(current) if noad then process(noad,what,n,current) end -- list
- noad = getsup (current) if noad then process(noad,what,n,current) end -- list
- noad = getsub (current) if noad then process(noad,what,n,current) end -- list
- if getsubpre then
- noad = getsuppre (current) if noad then process(noad,what,n,current) end -- list
- noad = getsubpre (current) if noad then process(noad,what,n,current) end -- list
- end
- noad = getfield(current,"left") if noad then process(noad,what,n,current) end -- delimiter
- noad = getfield(current,"degree") if noad then process(noad,what,n,current) end -- list
+ noad = getnucleus(current) if noad then process(noad,what,n,current) end -- list
+ noad = getsup(current) if noad then process(noad,what,n,current) end -- list
+ noad = getsub(current) if noad then process(noad,what,n,current) end -- list
+ noad = getsuppre(current) if noad then process(noad,what,n,current) end -- list
+ noad = getsubpre(current) if noad then process(noad,what,n,current) end -- list
+ noad = getprime(current) if noad then process(noad,what,n,current) end -- list
+ noad = getleftdelimiter(current) if noad then process(noad,what,n,current) end -- delimiter
+ noad = getrightdelimiter(current) if noad then process(noad,what,n,current) end -- delimiter
+ noad = getdegree(current) if noad then process(noad,what,n,current) end -- list
elseif id == accent_code then
- noad = getnucleus(current) if noad then process(noad,what,n,current) end -- list
- noad = getsup (current) if noad then process(noad,what,n,current) end -- list
- noad = getsub (current) if noad then process(noad,what,n,current) end -- list
- if getsubpre then
- noad = getsuppre (current) if noad then process(noad,what,n,current) end -- list
- noad = getsubpre (current) if noad then process(noad,what,n,current) end -- list
- end
- noad = getfield(current,"accent") if noad then process(noad,what,n,current) end -- list
- noad = getfield(current,"bot_accent") if noad then process(noad,what,n,current) end -- list
+ noad = getnucleus(current) if noad then process(noad,what,n,current) end -- list
+ noad = getsup(current) if noad then process(noad,what,n,current) end -- list
+ noad = getsub(current) if noad then process(noad,what,n,current) end -- list
+ noad = getsuppre(current) if noad then process(noad,what,n,current) end -- list
+ noad = getsubpre(current) if noad then process(noad,what,n,current) end -- list
+ noad = getprime(current) if noad then process(noad,what,n,current) end -- list
+ noad = gettop(current) if noad then process(noad,what,n,current) end -- list
+ noad = getmiddle(current) if noad then process(noad,what,n,current) end -- list
+ noad = getbottom(current) if noad then process(noad,what,n,current) end -- list
end
end
@@ -385,47 +403,49 @@ local function processstep(current,process,n,id)
local noad = nil
local id = id or getid(current)
if id == noad_code then
- noad = getnucleus(current) if noad then process(noad,n,current) end -- list
- noad = getsup (current) if noad then process(noad,n,current) end -- list
- noad = getsub (current) if noad then process(noad,n,current) end -- list
- if getsubpre then
- noad = getsuppre (current) if noad then process(noad,n,current) end -- list
- noad = getsubpre (current) if noad then process(noad,n,current) end -- list
- end
+ noad = getnucleus(current) if noad then process(noad,n,current) end -- list
+ noad = getsup(current) if noad then process(noad,n,current) end -- list
+ noad = getsub(current) if noad then process(noad,n,current) end -- list
+ noad = getsuppre(current) if noad then process(noad,n,current) end -- list
+ noad = getsubpre(current) if noad then process(noad,n,current) end -- list
+ noad = getprime(current) if noad then process(noad,n,current) end -- list
elseif id == subbox_code or id == submlist_code then
- noad = getlist(current) if noad then process(noad,n,current) end -- list (not getlist !)
+ noad = getlist(current) if noad then process(noad,n,current) end -- list (not getlist !)
elseif id == fraction_code then
- noad = getfield(current,"num") if noad then process(noad,n,current) end -- list
- noad = getfield(current,"denom") if noad then process(noad,n,current) end -- list
- noad = getfield(current,"left") if noad then process(noad,n,current) end -- delimiter
- noad = getfield(current,"right") if noad then process(noad,n,current) end -- delimiter
+ noad = getnumerator(current) if noad then process(noad,n,current) end -- list
+ noad = getdenominator(current) if noad then process(noad,n,current) end -- list
+ noad = getleftdelimiter(current) if noad then process(noad,n,current) end -- delimiter
+ noad = getdelimiter(current) if noad then process(noad,n,current) end -- delimiter
+ noad = getrightdelimiter(current) if noad then process(noad,n,current) end -- delimiter
elseif id == math_choice then
- noad = getfield(current,"display") if noad then process(noad,n,current) end -- list
- noad = getfield(current,"text") if noad then process(noad,n,current) end -- list
- noad = getfield(current,"script") if noad then process(noad,n,current) end -- list
- noad = getfield(current,"scriptscript") if noad then process(noad,n,current) end -- list
+ noad = getchoice(start,1) if noad then process(noad,n,current) end -- list
+ noad = getchoice(start,2) if noad then process(noad,n,current) end -- list
+ noad = getchoice(start,3) if noad then process(noad,n,current) end -- list
+ noad = getchoice(start,4) if noad then process(noad,n,current) end -- list
elseif id == fence_code then
- noad = getfield(current,"delimiter") if noad then process(noad,n,current) end -- delimiter
+ noad = getdelimiter(current) if noad then process(noad,n,current) end -- delimiter
+ noad = gettop(current) if noad then process(noad,n,current) end -- list
+ noad = getbottom(current) if noad then process(noad,n,current) end -- list
elseif id == radical_code then
- noad = getnucleus(current) if noad then process(noad,n,current) end -- list
- noad = getsup (current) if noad then process(noad,n,current) end -- list
- noad = getsub (current) if noad then process(noad,n,current) end -- list
- if getsubpre then
- noad = getsuppre (current) if noad then process(noad,n,current) end -- list
- noad = getsubpre (current) if noad then process(noad,n,current) end -- list
- end
- noad = getfield(current,"left") if noad then process(noad,n,current) end -- delimiter
- noad = getfield(current,"degree") if noad then process(noad,n,current) end -- list
+ noad = getnucleus(current) if noad then process(noad,n,current) end -- list
+ noad = getsup(current) if noad then process(noad,n,current) end -- list
+ noad = getsub(current) if noad then process(noad,n,current) end -- list
+ noad = getsuppre(current) if noad then process(noad,n,current) end -- list
+ noad = getsubpre(current) if noad then process(noad,n,current) end -- list
+ noad = getprime(current) if noad then process(noad,n,current) end -- delimiter
+ noad = getleftdelimiter(current) if noad then process(noad,n,current) end -- delimiter
+ noad = getrightdelimiter(current) if noad then process(noad,n,current) end -- delimiter
+ noad = getdegree(current) if noad then process(noad,n,current) end -- list
elseif id == accent_code then
- noad = getnucleus(current) if noad then process(noad,n,current) end -- list
- noad = getsup (current) if noad then process(noad,n,current) end -- list
- noad = getsub (current) if noad then process(noad,n,current) end -- list
- if getsubpre then
- noad = getsuppre (current) if noad then process(noad,n,current) end -- list
- noad = getsubpre (current) if noad then process(noad,n,current) end -- list
- end
- noad = getfield(current,"accent") if noad then process(noad,n,current) end -- list
- noad = getfield(current,"bot_accent") if noad then process(noad,n,current) end -- list
+ noad = getnucleus(current) if noad then process(noad,n,current) end -- list
+ noad = getsup(current) if noad then process(noad,n,current) end -- list
+ noad = getsub(current) if noad then process(noad,n,current) end -- list
+ noad = getsuppre(current) if noad then process(noad,n,current) end -- list
+ noad = getsubpre(current) if noad then process(noad,n,current) end -- list
+ noad = getprime(current) if noad then process(noad,n,current) end -- list
+ noad = gettop(current) if noad then process(noad,n,current) end -- list
+ noad = getmiddle(current) if noad then process(noad,n,current) end -- list
+ noad = getbottom(current) if noad then process(noad,n,current) end -- list
end
end
@@ -451,7 +471,15 @@ local checked = { } -- simple case
local tracked = false trackers.register("fonts.missing", function(v) tracked = v end)
local cached = setmetatableindex("table") -- complex case
+local variantselectors = {
+ [0xFE00] = true,
+ [0xFE01] = true
+}
+
local function errorchar(font,char)
+ if variantselectors[char] then
+ return char
+ end
local done = unknowns[char]
if done then
unknowns[char] = done + 1
@@ -466,7 +494,7 @@ local function errorchar(font,char)
return fake
else
local kind, fake = fonts.checkers.placeholder(font,char)
- if not fake or kind ~= "char" then
+ if not fake or kind ~= "char" then -- Also check for "with" here?
fake = 0x3F
end
cached[font][char] = fake
@@ -499,6 +527,9 @@ do
local a_mathfamily = privateattribute("mathfamily")
local boldmap = mathematics.boldmap
+ local trace_families = false registertracker("math.families", function(v) trace_families = v end)
+ local report_families = logreporter("mathematics","families")
+
local familymap = { [0] =
"regular",
"regular",
@@ -584,8 +615,42 @@ do
end
end
end
+
+ -- families[delimiter_code] = function(pointer)
+ -- if getfield(pointer,"smallfamily") == 0 then
+ -- local a = getattr(pointer,a_mathfamily)
+ -- if a and a > 0 then
+ -- setattr(pointer,a_mathfamily,0)
+ -- if a > 5 then
+ -- -- no bold delimiters in unicode
+ -- a = a - 3
+ -- end
+ -- local fam = getfontoffamily(a)
+ -- local char = getfield(pointer,"smallchar")
+ -- local okay = fontcharacters[fam][char]
+ -- if okay then
+ -- setfield(pointer,"smallfamily",a)
+ -- elseif a > 2 then
+ -- setfield(pointer,"smallfamily",a-3)
+ -- end
+ -- local char = getfield(pointer,"largechar")
+ -- local okay = fontcharacters[fam][char]
+ -- if okay then
+ -- setfield(pointer,"largefamily",a)
+ -- elseif a > 2 then
+ -- setfield(pointer,"largefamily",a-3)
+ -- end
+ -- else
+ -- setfield(pointer,"smallfamily",0)
+ -- setfield(pointer,"largefamily",0)
+ -- end
+ -- end
+ -- end
+
+ -- has become:
+
families[delimiter_code] = function(pointer)
- if getfield(pointer,"small_fam") == 0 then
+ if getfam(pointer) == 0 then
local a = getattr(pointer,a_mathfamily)
if a and a > 0 then
setattr(pointer,a_mathfamily,0)
@@ -593,56 +658,23 @@ do
-- no bold delimiters in unicode
a = a - 3
end
- local char = getfield(pointer,"small_char")
- local okay = fontcharacters[getfontoffamily(a)][char]
- if okay then
- setfield(pointer,"small_fam",a)
- elseif a > 2 then
- setfield(pointer,"small_fam",a-3)
- end
- local char = getfield(pointer,"large_char")
+ local char = getchar(pointer)
local okay = fontcharacters[getfontoffamily(a)][char]
if okay then
- setfield(pointer,"large_fam",a)
+ setfam(pointer,a)
elseif a > 2 then
- setfield(pointer,"large_fam",a-3)
+ setfam(pointer,a-3)
end
else
- setfield(pointer,"small_fam",0)
- setfield(pointer,"large_fam",0)
+ setfam(pointer,0)
end
end
end
- -- will become:
-
- -- families[delimiter_code] = function(pointer)
- -- if getfam(pointer) == 0 then
- -- local a = getattr(pointer,a_mathfamily)
- -- if a and a > 0 then
- -- setattr(pointer,a_mathfamily,0)
- -- if a > 5 then
- -- -- no bold delimiters in unicode
- -- a = a - 3
- -- end
- -- local char = getchar(pointer)
- -- local okay = fontcharacters[getfontoffamily(a)][char]
- -- if okay then
- -- setfam(pointer,a)
- -- elseif a > 2 then
- -- setfam(pointer,a-3)
- -- end
- -- else
- -- setfam(pointer,0)
- -- end
- -- end
- -- end
-
families[mathtextchar_code] = families[mathchar_code]
function handlers.families(head,style,penalties)
processnoads(head,families,"families")
- return true -- not needed
end
end
@@ -651,14 +683,14 @@ end
do
- local a_mathalphabet = privateattribute("mathalphabet")
- local a_mathgreek = privateattribute("mathgreek")
+ local a_mathalphabet = privateattribute("mathalphabet")
+ local a_mathgreek = privateattribute("mathgreek")
- local relocate = { }
+ local relocate = { }
- local remapalphabets = mathematics.remapalphabets
- local fallbackstyleattr = mathematics.fallbackstyleattr
- local setnodecolor = colortracers.set
+ local remapalphabets = mathematics.remapalphabets
+ local fallbackstyleattr = mathematics.fallbackstyleattr
+ local fallbackalphabetattr = mathematics.fallbackalphabetattr
local function report_remap(tag,id,old,new,extra)
if new then
@@ -672,8 +704,7 @@ do
end
local function checked(pointer)
- local char = getchar(pointer)
- local font = getfont(pointer)
+ local char, font = getcharspec(pointer)
local data = fontcharacters[font]
if not data[char] then
local specials = characters.data[char].specials
@@ -702,8 +733,7 @@ do
-- local g, a = getattrs(pointer,a_mathgreek,a_mathalphabet)
-- if not a then a = 0 end
-- if not g then g = 0 end
- local char = getchar(pointer)
- local font = getfont(pointer)
+ local char, font, fam = getcharspec(pointer)
local characters = fontcharacters[font]
if a > 0 or g > 0 then
if a > 0 then
@@ -758,7 +788,6 @@ do
end
end
if not characters[char] then
- local fam = getfam(pointer)
local fnt = getfontoffamily(fam,1)
setchar(pointer,errorchar(font,char))
if font ~= fnt then
@@ -788,7 +817,6 @@ do
function handlers.relocate(head,style,penalties)
processnoads(head,relocate,"relocate")
- return true -- not needed
end
end
@@ -804,16 +832,15 @@ do
render[mathchar_code] = function(pointer)
local attr = getattr(pointer,a_mathrendering)
if attr and attr > 0 then
- local char = getchar(pointer)
+ local char, font = getcharspec(pointer)
local renderset = rendersets[attr]
if renderset then
local newchar = renderset[char]
if newchar then
- local font = getfont(pointer)
local characters = fontcharacters[font]
if characters and characters[newchar] then
setchar(pointer,newchar)
- setattr(pointer,a_exportstatus,char)
+ setattr(pointer,a_exportstatus,char) -- yes or no
end
end
end
@@ -822,7 +849,6 @@ do
function handlers.render(head,style,penalties)
processnoads(head,render,"render")
- return true -- not needed
end
end
@@ -831,57 +857,81 @@ end
-- empty and no larger next will be forced)
--
-- beware: we don't use \delcode but \Udelcode and as such have
--- no large_fam; also, we need to check for subtype and/or
--- small_fam not being 0 because \. sits in 0,0 by default
+-- no largefamily; also, we need to check for subtype and/or
+-- smallfamily not being 0 because \. sits in 0,0 by default
--
-- todo: just replace the character by an ord noad
-- and remove the right delimiter as well
do
+ -- todo: use registerattribute
+
local a_mathsize = privateattribute("mathsize") -- this might move into other fence code
local resize = { }
+ local trace_fences = false registertracker("math.fences", function(v) trace_fences = v end)
+ local report_fences = logreporter("mathematics","fences")
+
resize[fence_code] = function(pointer)
local subtype = getsubtype(pointer)
- if subtype == leftfence_code or subtype == rightfence_code then
+ -- if subtype == leftfence_code or subtype == rightfence_code then
local a = getattr(pointer,a_mathsize)
if a and a > 0 then
local method = div(a,100)
local size = a % 100
setattr(pointer,a_mathsize,0)
- local delimiter = getfield(pointer,"delimiter")
- local chr = getchar(delimiter)
- if chr > 0 then
- local fam = getfam(delimiter)
- local id = getfontoffamily(fam)
- if id > 0 then
- local data = fontdata[id]
- local char = mathematics.big(data,chr,size,method)
- local ht = getheight(pointer)
- local dp = getdepth(pointer)
- if ht == 1 or dp == 1 then -- 1 scaled point is a signal
- local chardata = data.characters[char]
+ local delimiter = getdelimiter(pointer)
+ if delimiter then
+ local oldchar, font, fam = getcharspec(delimiter)
+ if oldchar > 0 and font > 0 then
+ local ht = getheight(pointer)
+ local dp = getdepth(pointer)
+ local data = fontdata[font]
+ local characters = data.characters
+ local olddata = characters[oldchar]
+-- local oldheight = olddata.height or 0
+-- local olddepth = olddata.depth or 0
+ local template = olddata.varianttemplate
+ local newchar = mathematics.big(data,template or oldchar,size,method)
+ local newdata = characters[newchar]
+ local newheight = newdata.height or 0
+ local newdepth = newdata.depth or 0
+ if template then
+-- local ratio = (newheight + newdepth) / (oldheight + olddepth)
+-- setheight(pointer,ratio * oldheight)
+-- setdepth(pointer,ratio * olddepth)
+ setheight(pointer,newheight)
+ setdepth(pointer,newdepth)
+ if not olddata.extensible then
+ -- check this on bonum and antykwa
+ setoptions(pointer,0)
+ end
+ if trace_fences then
+-- report_fences("replacing %C using method %a, size %a, template %C and ratio %.3f",newchar,method,size,template,ratio)
+ report_fences("replacing %C using method %a, size %a and template %C",newchar,method,size,template)
+ end
+ else
+ -- 1 scaled point is a signal, for now
if ht == 1 then
- setheight(pointer,chardata.height)
+ setheight(pointer,newheight)
end
if dp == 1 then
- setdepth(pointer,chardata.depth)
+ setdepth(pointer,newdepth)
+ end
+ setchar(delimiter,newchar)
+ if trace_fences then
+ report_fences("replacing %C by %C using method %a and size %a",oldchar,char,method,size)
end
end
- if trace_fences then
- report_fences("replacing %C by %C using method %a and size %a",chr,char,method,size)
- end
- setchar(delimiter,char)
end
end
end
- end
+ -- end
end
function handlers.resize(head,style,penalties)
processnoads(head,resize,"resize")
- return true -- not needed
end
end
@@ -894,25 +944,24 @@ do
local autofences = { }
local dummyfencechar = 0x2E
- local function makefence(what,char)
- local d = new_delimiter() -- todo: attr
- local f = new_fence() -- todo: attr
+ local function makefence(what,char,template)
+ local d = new_delimiter()
+ local f = new_fence()
if char then
local sym = getnucleus(char)
- local chr = getchar(sym)
- local fam = getfam(sym)
+ local chr, fnt, fam = getcharspec(sym)
if chr == dummyfencechar then
chr = 0
end
setchar(d,chr)
setfam(d,fam)
- flush_node(sym)
+ flushnode(sym)
end
- setattrlist(d,char)
- setattrlist(f,char)
+ setattrlist(d,template)
+ setattrlist(f,template)
setsubtype(f,what)
- setfield(f,"delimiter",d)
- setfield(f,"class",-1) -- tex itself does this, so not fenceclasses[what]
+ setdelimiter(f,d)
+ setclass(f,-1) -- tex itself does this, so not fenceclasses[what]
return f
end
@@ -937,8 +986,9 @@ do
-- f_c or "?"
-- )
local list = new_submlist()
- setsubtype(noad,innernoad_code)
+ setsubtype(noad,fenced_class)
setnucleus(noad,list)
+ setattrlist(list,noad)
setlist(list,f_o)
setlink(f_o,o_next) -- prev of list is nil
setlink(c_prev,f_c) -- next of list is nil
@@ -950,9 +1000,9 @@ do
local midl = middle[current]
local next = getnext(current)
if midl then
- local fence = makefence(middlefence_code,current)
+ local fence = makefence(middlefence_code,current,current)
setnucleus(current)
- flush_node(current)
+ flushnode(current)
middle[current] = nil
-- replace_node
setlink(prev,fence,next)
@@ -974,11 +1024,11 @@ do
return close
else
local c_prev, c_next = getboth(close)
- local f_o = makefence(leftfence_code,open)
- local f_c = makefence(rightfence_code,close)
+ local f_o = makefence(leftfence_code,open,open)
+ local f_c = makefence(rightfence_code,close,close)
makelist(middle,open,f_o,o_next,c_prev,f_c)
setnucleus(close)
- flush_node(close)
+ flushnode(close)
-- open is now a list
setlink(open,c_next)
return open
@@ -986,8 +1036,8 @@ do
end
local function convert_open(open,last,middle) -- last is really last (final case)
- local f_o = makefence(leftfence_code,open)
- local f_c = makefence(rightfence_code)
+ local f_o = makefence(leftfence_code,open,open)
+ local f_c = makefence(rightfence_code,nil,open)
local o_next = getnext(open)
makelist(middle,open,f_o,o_next,last,nil)
-- open is now a list
@@ -996,12 +1046,12 @@ do
end
local function convert_close(first,close,middle)
- local f_o = makefence(leftfence_code)
+ local f_o = makefence(leftfence_code,nil,close)
local f_c = makefence(rightfence_code,close)
local c_prev = getprev(close)
local f_next = getnext(first)
- makelist(middle, close, f_o,f_next,c_prev,f_c)
- -- close is now a list
+ makelist(middle,close,f_o,f_next,c_prev,f_c)
+ -- close is now a list : inner but should be fenced
if c_prev ~= first then
setlink(first,close)
end
@@ -1010,7 +1060,7 @@ do
local stacks = setmetatableindex("table")
- -- 1=open 2=close 3=middle 4=both
+ -- 1=open 2=close 3=middle 4=both : todo check both
local function processfences(pointer,n,parent)
local current = pointer
@@ -1205,7 +1255,8 @@ do
if start_super == stop_super then
setsup(pointer,getnucleus(start_super))
else
- local list = new_submlist() -- todo attr
+ local list = new_submlist()
+ setattrlist(list,pointer)
setlist(list,start_super)
setsup(pointer,list)
end
@@ -1215,22 +1266,11 @@ do
setnext(stop_super)
end
if start_sub then
-
--- if mode == "sub" then
--- local sup = getsup(pointer)
--- if sup and not getsub(pointer) then
--- local nxt = getnext(pointer)
--- local new = new_noad(pointer)
--- setnucleus(new,new_submlist())
--- setlink(pointer,new,nxt)
--- pointer = new
--- end
--- end
-
if start_sub == stop_sub then
setsub(pointer,getnucleus(start_sub))
else
- local list = new_submlist() -- todo attr
+ local list = new_submlist()
+ setattrlist(list,pointer)
setlist(list,start_sub)
setsub(pointer,list)
end
@@ -1246,7 +1286,6 @@ do
function handlers.unscript(head,style,penalties)
processnoads(head,unscript,"unscript")
- return true -- not needed
end
end
@@ -1257,20 +1296,26 @@ do
local enabled = false
local a_unstack = privateattribute("mathunstack")
+ local trace_unstacking = false registertracker("math.unstack", function(v) trace_unstacking = v end)
+ local report_unstacking = logreporter("mathematics","unstack")
+
unstack[noad_code] = function(pointer)
- if getattr(pointer,a_unstack) then
+ local a = getattr(pointer,a_unstack)
+ if a then
local sup = getsup(pointer)
local sub = getsub(pointer)
if sup and sub then
-- if trace_unstacking then
-- report_unstacking() -- todo ... what to show ...
-- end
- local nxt = getnext(pointer)
- local new = new_noad(pointer)
- setnucleus(new,new_submlist())
- setsub(pointer)
- setsub(new,sub)
- setlink(pointer,new,nxt)
+ if a == 1 then
+ a = tex.noadoptioncodes.shiftedsubscript
+ elseif a == 2 then
+ a = tex.noadoptioncodes.shiftedsuperscript
+ else
+ a = 0
+ end
+ setoptions(pointer,getoptions(pointer) | a)
end
end
end
@@ -1278,7 +1323,7 @@ do
function handlers.unstack(head,style,penalties)
if enabled then
processnoads(head,unstack,"unstack")
- return true -- not needed
+
end
end
@@ -1325,10 +1370,13 @@ end
do
+ local trace_alternates = false registertracker("math.alternates", function(v) trace_alternates = v end)
+ local report_alternates = logreporter("mathematics","alternates")
+
local last = 0
local known = setmetatableindex(function(t,k)
- local v = bor(0,2^last)
+ local v = 0 | 2^last
t[k] = v
last = last + 1
return v
@@ -1340,68 +1388,71 @@ do
}
local function initializemathalternates(tfmdata)
- local goodies = tfmdata.goodies
- local autolist = defaults -- table.copy(defaults)
+ if use_math_goodies then
- local function setthem(newalternates)
- local resources = tfmdata.resources -- was tfmdata.shared
- local mathalternates = resources.mathalternates
- local alternates, attributes, registered, presets
- if mathalternates then
- alternates = mathalternates.alternates
- attributes = mathalternates.attributes
- registered = mathalternates.registered
- else
- alternates, attributes, registered = { }, { }, { }
- mathalternates = {
- attributes = attributes,
- alternates = alternates,
- registered = registered,
- presets = { },
- resets = { },
- hashes = setmetatableindex("table")
- }
- resources.mathalternates = mathalternates
- end
- --
- for name, data in sortedhash(newalternates) do
- if alternates[name] then
- -- ignore
+ local goodies = tfmdata.goodies
+ local autolist = defaults -- table.copy(defaults)
+
+ local function setthem(newalternates)
+ local resources = tfmdata.resources -- was tfmdata.shared
+ local mathalternates = resources.mathalternates
+ local alternates, attributes, registered, presets
+ if mathalternates then
+ alternates = mathalternates.alternates
+ attributes = mathalternates.attributes
+ registered = mathalternates.registered
else
- local attr = known[name]
- attributes[attr] = data
- alternates[name] = attr
- registered[#registered+1] = attr
+ alternates, attributes, registered = { }, { }, { }
+ mathalternates = {
+ attributes = attributes,
+ alternates = alternates,
+ registered = registered,
+ presets = { },
+ resets = { },
+ hashes = setmetatableindex("table")
+ }
+ resources.mathalternates = mathalternates
+ end
+ --
+ for name, data in sortedhash(newalternates) do
+ if alternates[name] then
+ -- ignore
+ else
+ local attr = known[name]
+ attributes[attr] = data
+ alternates[name] = attr
+ registered[#registered+1] = attr
+ end
end
end
- end
- if goodies then
- local done = { }
- for i=1,#goodies do
- -- first one counts
- -- we can consider sharing the attributes ... todo (only once scan)
- local mathgoodies = goodies[i].mathematics
- local alternates = mathgoodies and mathgoodies.alternates
- if alternates then
- if trace_goodies then
- report_goodies("loading alternates for font %a",tfmdata.properties.name)
- end
- for k, v in next, autolist do
- if not alternates[k] then
- alternates[k] = v
+ if goodies then
+ local done = { }
+ for i=1,#goodies do
+ -- first one counts
+ -- we can consider sharing the attributes ... todo (only once scan)
+ local mathgoodies = goodies[i].mathematics
+ local alternates = mathgoodies and mathgoodies.alternates
+ if alternates then
+ if trace_goodies then
+ report_goodies("loading alternates for font %a",tfmdata.properties.name)
end
+ for k, v in next, autolist do
+ if not alternates[k] then
+ alternates[k] = v
+ end
+ end
+ setthem(alternates)
+ return
end
- setthem(alternates)
- return
end
end
- end
- if trace_goodies then
- report_goodies("loading default alternates for font %a",tfmdata.properties.name)
+ if trace_goodies then
+ report_goodies("loading default alternates for font %a",tfmdata.properties.name)
+ end
+ setthem(autolist)
end
- setthem(autolist)
end
@@ -1424,6 +1475,7 @@ do
local fontresources = fonts.hashes.resources
local function getalternate(fam,tag,current)
+ -- fam is always zero, so we assume a very consistent setup
local resources = fontresources[getfontoffamily(fam)]
local attribute = unsetvalue
if resources then
@@ -1443,7 +1495,7 @@ do
else
local a = alternates[s] -- or known[s]
if a then
- attribute = bor(attribute,a)
+ attribute = attribute | a
end
end
end
@@ -1458,32 +1510,34 @@ do
end
end
if attribute > 0 and current and current > 0 then
- return bor(current,attribute)
+ return current | attribute
else
return attribute
end
end
- local function presetalternate(fam,tag)
- texsetattribute(a_mathalternate,getalternate(fam,tag))
- end
-
implement {
- name = "presetmathalternate",
- actions = presetalternate,
- arguments = { "integer", "string" }
+ name = "presetmathfontalternate",
+ arguments = "argument",
+ public = true,
+ protected = true,
+ actions = function(tag)
+ if texgetmode() == mathmode_code then
+ texsetattribute(a_mathalternate,getalternate(0,tag))
+ end
+ end,
}
- local function setalternate(fam,tag)
- local a = texgetattribute(a_mathalternate)
- local v = getalternate(fam,tag,a)
- texsetattribute(a_mathalternate,v)
- end
-
implement {
- name = "setmathalternate",
- actions = setalternate,
- arguments = { "integer", "string" }
+ name = "setmathfontalternate",
+ arguments = "argument",
+ public = true,
+ protected = true,
+ actions = function(tag)
+ if texgetmode() == mathmode_code then
+ texsetattribute(a_mathalternate,getalternate(0,tag,texgetattribute(a_mathalternate)))
+ end
+ end,
}
alternate[mathchar_code] = function(pointer) -- slow
@@ -1500,7 +1554,7 @@ do
local hashes = mathalternates.hashes
for i=1,#registered do
local r = registered[i]
- if band(a,r) ~= 0 then
+ if (a & r) ~= 0 then
local char = getchar(pointer)
local alt = hashes[i][char]
if alt == nil then
@@ -1515,7 +1569,7 @@ do
if trace_alternates then
local what = attributes[r]
report_alternates("alternate %a, value %a, replacing glyph %U by glyph %U",
- tostring(what.feature),tostring(what.value),getchar(pointer),alt)
+ tostring(what.feature),tostring(what.value),char,alt)
end
setchar(pointer,alt)
break
@@ -1527,9 +1581,10 @@ do
end
end
+ alternate[delimiter_code] = alternate[mathchar_code]
+
function handlers.alternates(head,style,penalties)
processnoads(head,alternate,"alternate")
- return true -- not needed
end
end
@@ -1549,130 +1604,160 @@ end
-- some juggling that we want to avoid but we need to do something here (in fact, we could
-- better fix the width of the character)
-do
-
- local a_mathitalics = privateattribute("mathitalics")
-
- local italics = { }
- local default_factor = 1/20
-
- local setcolor = colortracers.set
- local resetcolor = colortracers.reset
- local italic_kern = new_kern
-
- local c_positive_d = "trace:dg"
- local c_negative_d = "trace:dr"
-
- local function insert_kern(current,kern)
- local sub = new_submlist() -- todo: attr
- local noad = new_noad() -- todo: attr
- setlist(sub,kern)
- setnext(kern,noad)
- setnucleus(noad,current)
- return sub
- end
-
- registertracker("math.italics.visualize", function(v)
- if v then
- italic_kern = function(k)
- local n = new_kern(k) -- todo: attr
- set_visual(n,"italic")
- return n
- end
- else
- italic_kern = new_kern
- end
- end)
-
- local function getcorrection(method,font,char) -- -- or character.italic -- (this one is for tex)
-
- local visual = chardata[char].visual
-
- if method == 1 then
- -- check on state
- local italics = fontitalics[font]
- if italics then
- local character = fontcharacters[font][char]
- if character then
- local correction = character.italic
- if correction and correction ~= 0 then
- return correction, visual
- end
- end
- end
- elseif method == 2 then
- -- no check
- local character = fontcharacters[font][char]
- if character then
- local correction = character.italic
- if correction and correction ~= 0 then
- return correction, visual
- end
- end
- elseif method == 3 then
- -- check on visual
- if visual == "it" or visual == "bi" then
- local character = fontcharacters[font][char]
- if character then
- local correction = character.italic
- if correction and correction ~= 0 then
- return correction, visual
- end
- end
- end
- elseif method == 4 then
- -- combination of 1 and 3
- local italics = fontitalics[font]
- if italics and (visual == "it" or visual == "bi") then
- local character = fontcharacters[font][char]
- if character then
- local correction = character.italic
- if correction and correction ~= 0 then
- return correction, visual
- end
- end
- end
- end
-
- end
-
- italics[mathchar_code] = function(pointer,what,n,parent)
- local method = getattr(pointer,a_mathitalics)
- if method and method > 0 and method < 100 then
- local char = getchar(pointer)
- local font = getfont(pointer)
- local correction, visual = getcorrection(method,font,char)
- if correction and correction ~= 0 then
- local next_noad = getnext(parent)
- if not next_noad then
- if n == 1 then
- -- only at the outer level .. will become an option (always,endonly,none)
- if trace_italics then
- report_italics("method %a, flagging italic correction %p between %C and end math",method,correction,char)
- end
- if correction > 0 then
- correction = correction + 100
- else
- correction = correction - 100
- end
- correction = round(correction)
- setattr(pointer,a_mathitalics,correction)
- setattr(parent,a_mathitalics,correction)
- return -- so no reset later on
- end
- end
- end
- end
- setattr(pointer,a_mathitalics,unsetvalue)
- end
+-- do
+--
+-- local a_mathitalics = privateattribute("mathitalics")
+--
+-- local trace_italics = false registertracker("math.italics", function(v) trace_italics = v end)
+-- local report_italics = logreporter("mathematics","italics")
+--
+-- local italics = { }
+--
+-- local function getcorrection(method,font,char) -- -- or character.italic -- (this one is for tex)
+--
+-- local visual = chardata[char].visual
+--
+-- if method == 1 then
+-- -- check on state
+-- local italics = fontitalics[font]
+-- if italics then
+-- local character = fontcharacters[font][char]
+-- if character then
+-- local correction = character.italic
+-- if correction and correction ~= 0 then
+-- return correction, visual
+-- end
+-- end
+-- end
+-- elseif method == 2 then
+-- -- no check
+-- local character = fontcharacters[font][char]
+-- if character then
+-- local correction = character.italic
+-- if correction and correction ~= 0 then
+-- return correction, visual
+-- end
+-- end
+-- elseif method == 3 then
+-- -- check on visual
+-- if visual == "it" or visual == "bi" then
+-- local character = fontcharacters[font][char]
+-- if character then
+-- local correction = character.italic
+-- if correction and correction ~= 0 then
+-- return correction, visual
+-- end
+-- end
+-- end
+-- elseif method == 4 then
+-- -- combination of 1 and 3
+-- local italics = fontitalics[font]
+-- if italics and (visual == "it" or visual == "bi") then
+-- local character = fontcharacters[font][char]
+-- if character then
+-- local correction = character.italic
+-- if correction and correction ~= 0 then
+-- return correction, visual
+-- end
+-- end
+-- end
+-- end
+--
+-- end
+--
+-- -- basically the engine should set it
+--
+-- italics[mathchar_code] = function(pointer,what,n,parent)
+-- local method = getattr(pointer,a_mathitalics)
+-- if method and method > 0 and method < 100 then
+-- local char, font = getcharspec(pointer)
+-- local correction, visual = getcorrection(method,font,char)
+-- if correction and correction ~= 0 then
+-- local next_noad = getnext(parent)
+-- if not next_noad then
+-- if n == 1 then
+-- -- only at the outer level .. will become an option (always,endonly,none)
+-- if trace_italics then
+-- report_italics("method %a, flagging italic correction %p between %C and end math",method,correction,char)
+-- end
+-- if correction > 0 then
+-- correction = correction + 100
+-- else
+-- correction = correction - 100
+-- end
+-- correction = round(correction)
+-- setattr(pointer,a_mathitalics,correction)
+-- setattr(parent,a_mathitalics,correction)
+-- return -- so no reset later on
+-- end
+-- end
+-- end
+-- end
+-- setattr(pointer,a_mathitalics,unsetvalue)
+-- end
+--
+-- function handlers.italics(head,style,penalties)
+-- processnoads(head,italics,"italics")
+-- end
+--
+-- local enable = function()
+-- enableaction("math", "noads.handlers.italics")
+-- if trace_italics then
+-- report_italics("enabling math italics")
+-- end
+-- -- we enable math (unless already enabled elsewhere)
+-- typesetters.italics.enablemath()
+-- enable = false
+-- end
+--
+-- -- best do this only on math mode (less overhead)
+--
+-- function mathematics.setitalics(name)
+-- if enable then
+-- enable()
+-- end
+-- texsetattribute(a_mathitalics,name and name ~= v_reset and tonumber(name) or unsetvalue) -- maybe also v_none
+-- end
+--
+-- function mathematics.getitalics(name)
+-- if enable then
+-- enable()
+-- end
+-- context(name and name ~= v_reset and tonumber(name) or unsetvalue)
+-- end
+--
+-- function mathematics.resetitalics()
+-- texsetattribute(a_mathitalics,unsetvalue)
+-- end
+--
+-- implement {
+-- name = "initializemathitalics",
+-- actions = enable,
+-- onlyonce = true,
+-- }
+--
+-- implement {
+-- name = "setmathitalics",
+-- actions = mathematics.setitalics,
+-- arguments = "string",
+-- }
+--
+-- implement {
+-- name = "getmathitalics",
+-- actions = mathematics.getitalics,
+-- arguments = "string",
+-- }
+--
+-- implement {
+-- name = "resetmathitalics",
+-- actions = mathematics.resetitalics
+-- }
+--
+-- end
- function handlers.italics(head,style,penalties)
- processnoads(head,italics,"italics")
- return true -- not needed
- end
+do
local enable = function()
- enableaction("math", "noads.handlers.italics")
if trace_italics then
report_italics("enabling math italics")
end
@@ -1681,49 +1766,12 @@ do
enable = false
end
- -- best do this only on math mode (less overhead)
-
- function mathematics.setitalics(name)
- if enable then
- enable()
- end
- texsetattribute(a_mathitalics,name and name ~= v_reset and tonumber(name) or unsetvalue) -- maybe also v_none
- end
-
- function mathematics.getitalics(name)
- if enable then
- enable()
- end
- context(name and name ~= v_reset and tonumber(name) or unsetvalue)
- end
-
- function mathematics.resetitalics()
- texsetattribute(a_mathitalics,unsetvalue)
- end
-
implement {
name = "initializemathitalics",
actions = enable,
onlyonce = true,
}
- implement {
- name = "setmathitalics",
- actions = mathematics.setitalics,
- arguments = "string",
- }
-
- implement {
- name = "getmathitalics",
- actions = mathematics.getitalics,
- arguments = "string",
- }
-
- implement {
- name = "resetmathitalics",
- actions = mathematics.resetitalics
- }
-
end
do
@@ -1741,6 +1789,9 @@ do
local a_kernpairs = privateattribute("mathkernpairs")
local kernpairs = { }
+ local trace_kernpairs = false registertracker("math.kernpairs", function(v) trace_kernpairs = v end)
+ local report_kernpairs = logreporter("mathematics","kernpairs")
+
local function enable()
enableaction("math", "noads.handlers.kernpairs")
if trace_kernpairs then
@@ -1767,28 +1818,29 @@ do
kernpairs[mathchar_code] = function(pointer,what,n,parent)
if getattr(pointer,a_kernpairs) == 1 then
- local font = getfont(pointer)
- local list = hash[font]
+ local first, firstfont = getcharspec(pointer)
+ local list = hash[firstfont]
if list then
- local first = getchar(pointer)
local found = list[first]
if found then
- local next = getnext(parent)
- if next and getid(next) == noad_code then
- pointer = getnucleus(next)
- if pointer then
- if getfont(pointer) == font then
- local second = getchar(pointer)
- local kern = found[second]
+ local next = isnext(parent,noad_code)
+ if next then
+-- pointer = getnucleus(next)
+-- if pointer then
+ local second, secondfont = getcharspec(pointer)
+ if secondfont == firstfont then
+ local kern = found[second]
if kern then
- kern = kern * fonts.hashes.parameters[font].hfactor
+ kern = kern * fontparameters[firstfont].hfactor
if trace_kernpairs then
report_kernpairs("adding %p kerning between %C and %C",kern,first,second)
end
- setlink(parent,new_kern(kern),getnext(parent)) -- todo: attr
+ kern = new_kern(kern)
+ setlink(parent,kern,getnext(parent))
+ setattrlist(kern,pointer)
end
end
- end
+-- end
end
end
end
@@ -1796,65 +1848,311 @@ do
end
function handlers.kernpairs(head,style,penalties)
- processnoads(head,kernpairs,"kernpairs")
- return true -- not needed
+ if use_math_goodies then
+ processnoads(head,kernpairs,"kernpairs")
+ end
+ end
+
+end
+
+do
+
+ local a_numbers = privateattribute("mathnumbers")
+ local a_spacing = privateattribute("mathspacing")
+ local a_fencing = privateattribute("mathfencing")
+
+ local numbers = { }
+ local spacing = { }
+ local fencing = { }
+
+ local separators = {
+ [0x2E] = { 0x2E, 0x2C, 0x002E, 0x002C, 0x2008, 0x2008 }, -- . -- punctuationspace
+ [0x2C] = { 0x2C, 0x2E, 0x2008, 0x2008, 0x002E, 0x002C }, -- ,
+ }
+
+ local digits = {
+ [0x30] = true, [0x31] = true,
+ [0x32] = true, [0x33] = true,
+ [0x34] = true, [0x35] = true,
+ [0x36] = true, [0x37] = true,
+ [0x38] = true, [0x39] = true,
+ }
+
+ local snoloc = {
+ [punctuation_class] = 0x003A,
+ [relation_class] = 0x2236,
+ }
+
+ local colons = {
+ [0x003A] = snoloc,
+ [0x2236] = snoloc,
+ }
+
+ local middles = {
+ [0x007C] = true,
+ [0x2016] = true,
+ [0x2980] = true,
+ }
+
+ local singles = {
+ 0x007C,
+ 0x2016,
+ 0x2980,
+ }
+
+ local followedbyspace_code = tex.noadoptioncodes.followedbyspace
+
+ local function followedbyspace(n)
+ return n and (getoptions(n) & followedbyspace_code == followedbyspace_code)
+ end
+
+ local function followbyspace(n)
+ setoptions(n,getoptions(n) | followedbyspace_code)
+ end
+
+ numbers[mathchar_code] = function(pointer,what,n,parent)
+ local alternative = getattr(pointer,a_numbers)
+ if alternative then
+ local oldchar = getcharspec(pointer)
+ local found = separators[oldchar]
+ if found then
+ local prev, next = isboth(parent,noad_code)
+ if prev and next then
+ -- local lc = getcharspec(getnucleus(prev))
+ local lc = getcharspec(prev)
+ if digits[lc] then
+ -- local rc = getcharspec(getnucleus(next))
+ local rc = getcharspec(next)
+ if digits[rc] then
+ local newchar = found[alternative]
+ local class = followedbyspace(parent) and punctuation_class or ordinary_class
+ setsubtype(parent,class)
+ if newchar ~= oldchar then
+ setchar(pointer,newchar)
+ end
+ -- if trace_numbers then
+ -- report_numbers("digit separator digit")
+ -- end
+ end
+ end
+ end
+ return
+ end
+ found = digits[oldchar]
+ if found then
+ if followedbyspace(parent) then
+ local next = isnext(parent,noad_code)
+ if next then
+ -- local rc = getcharspec(getnucleus(next))
+ local rc = getcharspec(next)
+ if rc and digits[rc] then
+ local n = new_noad(numbergroup_class)
+ local s = new_submlist()
+ setnucleus(n,s)
+ setattrlist(n,pointer)
+ setattrlist(s,pointer)
+ setlink(parent,n,next)
+ -- if trace_numbers then
+ -- report_numbers("digit spacer digit")
+ -- end
+ end
+ end
+ end
+ return
+ end
+ end
+ end
+
+ spacing[mathchar_code] = function(pointer,what,n,parent)
+ if getattr(pointer,a_spacing) then
+ local oldchar = getcharspec(pointer)
+ local found = colons[oldchar]
+ if found then
+ local prev = isprev(parent,noad_code)
+ if prev then
+ local class = followedbyspace(prev) and relation_class or punctuation_class
+ local newchar = found[class]
+ setsubtype(parent,class)
+ if newchar ~= oldchar then
+ setchar(pointer,newchar)
+ end
+ -- if trace_spacing then
+ -- report_spacinf("spacer colon")
+ -- end
+ end
+ return
+ end
+ end
+ end
+
+ -- we can share code, see earlier
+
+ local function makefence(chr,fam,subtype,class,template)
+ local f = new_fence()
+ local d = new_delimiter()
+ setchar(d,chr)
+ setfam(d,fam)
+ setattrlist(d,template)
+ setattrlist(f,template)
+ setsubtype(f,subtype)
+ setdelimiter(f,d)
+ setclass(f,class) -- tex itself does this, so not fenceclasses[what]
+ return f
+ end
+
+ -- we loose scripts so maybe also copy these
+
+ fencing[mathchar_code] = function(pointer,what,n,parent)
+ if getattr(pointer,a_fencing) and pointer == getnucleus(parent) then
+ local oldchar = getcharspec(pointer)
+ local found = middles[oldchar]
+ if found then
+ local prev, next = getboth(parent)
+ if getcharspec(next) == oldchar and not followedbyspace(parent) then
+ local nextnext = getnext(next)
+ -- we need to preserve the followed property
+ if getcharspec(nextnext) == oldchar and not followedbyspace(next) then
+ oldchar = singles[3]
+ prev, parent = nuts.remove(prev,parent,true)
+ prev, parent = nuts.remove(prev,parent,true)
+ else
+ oldchar = singles[2]
+ prev, parent = nuts.remove(prev,parent,true)
+ end
+ next = getnext(parent)
+ pointer = getnucleus(parent)
+ setchar(pointer,oldchar)
+ end
+ if followedbyspace(prev) and followedbyspace(parent) then
+ local chr, fnt, fam = getcharspec(pointer)
+ local f1 = makefence(0,0,0,0,pointer)
+ local f2 = makefence(chr,fam,middlefence_code,middle_class,pointer)
+ setlink(prev,f1,f2,next)
+ flushnode(parent)
+followbyspace(f1)
+followbyspace(f2)
+ return true, f2
+ else
+ return true, parent
+ end
+ end
+ end
end
+ -- numbers
+
+ function handlers.numbers(head,style,penalties)
+ processnoads(head,numbers,"numbers")
+ end
+
+ local enable = function()
+ enableaction("math", "noads.handlers.numbers")
+ -- if trace_numbers then
+ -- report_numbers("enabling math numbers")
+ -- end
+ enable = false
+ end
+
+ implement {
+ name = "initializemathnumbers",
+ actions = enable,
+ onlyonce = true,
+ }
+
+ -- spacing
+
+ function handlers.spacing(head,style,penalties)
+ processnoads(head,spacing,"spacing")
+ end
+
+ local enable = function()
+ enableaction("math", "noads.handlers.spacing")
+ -- if trace_spacing then
+ -- report_spacing("enabling math spacing")
+ -- end
+ enable = false
+ end
+
+ implement {
+ name = "initializemathspacing",
+ actions = enable,
+ onlyonce = true,
+ }
+
+ -- fences
+
+ function handlers.fencing(head,style,penalties)
+ processnoads(head,fencing,"fencing")
+ end
+
+ local enable = function()
+ enableaction("math", "noads.handlers.fencing")
+ -- if trace_fencing then
+ -- report_fencing("enabling math fencing")
+ -- end
+ enable = false
+ end
+
+ implement {
+ name = "initializemathfencing",
+ actions = enable,
+ onlyonce = true,
+ }
+
end
-- primes and such
do
- -- is validpair stil needed?
+ -- is validpair stil needed? why not always now?
local a_mathcollapsing = privateattribute("mathcollapsing")
local collapse = { }
local mathlists = characters.mathlists
local validpair = {
- [ordnoad_code] = true,
- [opdisplaylimitsnoad_code] = true,
- [oplimitsnoad_code] = true,
- [opnolimitsnoad_code] = true,
- [binnoad_code] = true, -- new
- [relnode_code] = true,
- [opennoad_code] = true, -- new
- [closenoad_code] = true, -- new
- [punctnoad_code] = true, -- new
- [innernoad_code] = false,
- [undernoad_code] = false,
- [overnoad_code] = false,
- [vcenternoad_code] = false,
- [ordlimitsnoad_code] = true,
+ [ordinary_class] = true,
+ [operator_class] = true,
+ [binary_class] = true, -- new
+ [relation_class] = true,
+ [open_class] = true, -- new
+ [middle_class] = true, -- new
+ [close_class] = true, -- new
+ [punctuation_class] = true, -- new
+ [fraction_class] = true,
+ [accent_class] = true,
}
local reported = setmetatableindex("table")
- collapse[mathchar_code] = function(pointer,what,n,parent)
+ mathlists[39] = { [39] = { [39] = { enforced = 0x2034, [39] = { enforced = 0x2057 } }, enforced = 0x2033 }, enforced = 0x2032 }
+ mathlists[96] = { [96] = { [96] = { enforced = 0x2037 }, enforced = 0x2036 }, enforced = 0x2035 }
+ collapse[mathchar_code] = function(pointer,what,n,parent)
if parent and mathlists[getchar(pointer)] then
local found, last, lucleus, lsup, lsub, category
local tree = mathlists
local current = parent
while current and validpair[getsubtype(current)] do
- local nucleus = getnucleus(current) -- == pointer
- local sub = getsub(current)
- local sup = getsup(current)
- local char = getchar(nucleus)
+ local nucleus, prime, sup, sub = getnucleus(current,true)
+ local char = getchar(nucleus)
if char then
local match = tree[char]
if match then
local method = getattr(current,a_mathcollapsing)
if method and method > 0 and method <= 3 then
+ local enforced = match.enforced
local specials = match.specials
local mathlist = match.mathlist
local ligature
- if method == 1 then
- ligature = specials
+ if method == 0 then
+ ligature = enforced
+ elseif method == 1 then
+ ligature = enforced or specials
elseif method == 2 then
- ligature = specials or mathlist
+ ligature = enforced or specials or mathlist
else -- 3
- ligature = mathlist or specials
+ ligature = enforced or mathlist or specials
end
if ligature then
category = mathlist and "mathlist" or "specials"
@@ -1905,7 +2203,7 @@ do
end
while c ~= l do
local n = getnext(c)
- flush_node(c)
+ flushnode(c)
c = n
end
setlink(parent,l)
@@ -1915,7 +2213,6 @@ do
function noads.handlers.collapse(head,style,penalties)
processnoads(head,collapse,"collapse")
- return true -- not needed
end
local enable = function()
@@ -1927,135 +2224,73 @@ do
end
implement {
- name = "initializemathcollapsing",
- actions = enable,
- onlyonce = true,
+ name = "initializemathcollapsing",
+ actions = enable,
+ onlyonce = true,
}
end
do
- -- inner under over vcenter
local fixscripts = { }
- local movesub = {
+
+ local primes = {
-- primes
- [0x2032] = 0xFE932,
- [0x2033] = 0xFE933,
- [0x2034] = 0xFE934,
- [0x2057] = 0xFE957,
+ [0x2032] = true,
+ [0x2033] = true,
+ [0x2034] = true,
+ [0x2057] = true,
-- reverse primes
- [0x2035] = 0xFE935,
- [0x2036] = 0xFE936,
- [0x2037] = 0xFE937,
+ [0x2035] = true,
+ [0x2036] = true,
+ [0x2037] = true,
}
- mathematics.virtualize(movesub)
-
- local options_supported = tokens.defined("Unosuperscript")
-
- local function fixsupscript(parent,current,current_char,new_char)
- if new_char ~= current_char and new_char ~= true then
- setchar(current,new_char)
- if trace_fixing then
- report_fixing("fixing subscript, replacing superscript %U by %U",current_char,new_char)
- end
- else
- if trace_fixing then
- report_fixing("fixing subscript, superscript %U",current_char)
- end
- end
- if options_supported then
- setfield(parent,"options",0x08+0x22)
- end
- end
-
- -- local function movesubscript(parent,current_nucleus,oldchar,newchar)
- -- local prev = getprev(parent)
- -- if prev and getid(prev) == noad_code then
- -- local psup = getsup(prev)
- -- local psub = getsub(prev)
- -- if not psup and not psub then
- -- fixsupscript(prev,current_nucleus,oldchar,newchar)
- -- local nucleus = getnucleus(parent)
- -- local sub = getsub(parent)
- -- setsup(prev,nucleus)
- -- setsub(prev,sub)
- -- local dummy = copy_node(nucleus)
- -- setchar(dummy,0)
- -- setnucleus(parent,dummy)
- -- setsub(parent)
- -- elseif not psup then
- -- fixsupscript(prev,current_nucleus,oldchar,newchar)
- -- local nucleus = getnucleus(parent)
- -- setsup(prev,nucleus)
- -- local dummy = copy_node(nucleus)
- -- setchar(dummy,0)
- -- setnucleus(parent,dummy)
- -- end
- -- end
- -- end
-
- local function move_none_none(parent,prev,nuc,oldchar,newchar)
- fixsupscript(prev,nuc,oldchar,newchar)
- local sub = getsub(parent)
- setsup(prev,nuc)
- setsub(prev,sub)
- local dummy = copy_node(nuc)
- setchar(dummy,0)
- setnucleus(parent,dummy)
- setsub(parent)
- end
+ local fixable = {
+ [noad_code] = true,
+ [accent_code] = true,
+ [radical_code] = true,
+ [fraction_code] = true,
+ }
- local function move_none_psub(parent,prev,nuc,oldchar,newchar)
- fixsupscript(prev,nuc,oldchar,newchar)
- setsup(prev,nuc)
- local dummy = copy_node(nuc)
- setchar(dummy,0)
- setnucleus(parent,dummy)
- end
+ -- [prime|sub|sup]first
- fixscripts[mathchar_code] = function(pointer,what,n,parent,nested) -- todo: switch to turn in on and off
+ fixscripts[mathchar_code] = function(pointer,what,n,parent,nested) -- todo: switch to turn it on and off
if parent then
- local oldchar = getchar(pointer)
- local newchar = movesub[oldchar]
- if newchar then
+ local char = getchar(pointer)
+ if char and primes[char] then
local nuc = getnucleus(parent)
if pointer == nuc then
- local sub = getsub(pointer)
- local sup = getsup(pointer)
- if sub then
- if sup then
- -- print("[char] sub sup")
- else
- -- print("[char] sub ---")
+ local prev = getprev(parent)
+ if prev and fixable[getid(prev)] then
+ local prevsup = getsup(prev)
+ local prevsub = getsub(prev)
+ local primesup = getsup(parent)
+ local primesub = getsub(parent)
+ setfield(prev,"scriptorder",prevsub and 2 or 1) -- sub first, then prime
+ if primesup and not prevsup then
+ setsup(prev,primesup)
+ primesup = nil
end
- elseif sup then
- -- print("[char] --- sup")
- else
- local prev = getprev(parent)
- if prev and getid(prev) == noad_code then
- local psub = getsub(prev)
- local psup = getsup(prev)
- if psub then
- if psup then
- -- print("sub sup [char] --- ---")
- else
- -- print("sub --- [char] --- ---")
- move_none_psub(parent,prev,nuc,oldchar,newchar)
- end
- elseif psup then
- -- print("--- sup [char] --- ---")
- else
- -- print("[char] --- ---")
- move_none_none(parent,prev,nuc,oldchar,newchar)
- end
- else
- -- print("no prev [char]")
+ if primesub and not prevsub then
+ setsub(prev,primesub)
+ primesub = nil
+ end
+ setprime(prev,nuc)
+ setnucleus(parent)
+ if not primesup then
+ setsup(parent)
+ end
+ if not primesub then
+ setsub(parent)
+ end
+ if not (primesup or primesub) then
+ setlink(prev,getnext(parent))
+ flushnode(parent)
+ return true, prev, prev
end
end
- else
- -- print("[char]")
end
end
end
@@ -2063,95 +2298,136 @@ do
function noads.handlers.fixscripts(head,style,penalties)
processnoads(head,fixscripts,"fixscripts")
- return true -- not needed
end
end
--- variants
+-- variants (upgraded for script too)
do
- local variants = { }
- local validvariants = { -- fast check on valid
- [0x2229] = 0xFE00, [0x222A] = 0xFE00,
- [0x2268] = 0xFE00, [0x2269] = 0xFE00,
- [0x2272] = 0xFE00, [0x2273] = 0xFE00,
- [0x228A] = 0xFE00, [0x228B] = 0xFE00,
- [0x2293] = 0xFE00, [0x2294] = 0xFE00,
- [0x2295] = 0xFE00,
- [0x2297] = 0xFE00,
- [0x229C] = 0xFE00,
- [0x22DA] = 0xFE00, [0x22DB] = 0xFE00,
- [0x2A3C] = 0xFE00, [0x2A3D] = 0xFE00,
- [0x2A9D] = 0xFE00, [0x2A9E] = 0xFE00,
- [0x2AAC] = 0xFE00, [0x2AAD] = 0xFE00,
- [0x2ACB] = 0xFE00, [0x2ACC] = 0xFE00,
- }
+ local variants = { }
+ local chardata = characters.data
+ local a_variant = privateattribute("mathvariant")
+
+ local trace_variants = false registertracker("math.variants", function(v) trace_variants = v end)
+ local report_variants = logreporter("mathematics","variants")
+
+ local function setvariant(pointer,selector,char)
+ local tfmdata = fontdata[getfont(pointer)]
+ local mathvariants = tfmdata.resources.variants -- and variantdata / can be a hash
+ if mathvariants then
+ mathvariants = mathvariants[selector]
+ if mathvariants then
+ local variant = mathvariants[char]
+ if variant then
+ setchar(pointer,variant)
+ setattr(pointer,a_exportstatus,char) -- we don't export the variant as it's visual markup
+ if trace_variants then
+ report_variants("variant (%U,%U) replaced by %U",char,selector,variant)
+ end
+ else
+ if trace_variants then
+ report_variants("no variant (%U,%U)",char,selector)
+ end
+ end
+ end
+ end
+ end
variants[mathchar_code] = function(pointer,what,n,parent) -- also set export value
local char = getchar(pointer)
- local selector = validvariants[char]
- if selector then
- local next = getnext(parent)
- if next and getid(next) == noad_code then
- local nucleus = getnucleus(next)
- if nucleus and getid(nucleus) == mathchar_code and getchar(nucleus) == selector then
- local variant
- local tfmdata = fontdata[getfont(pointer)]
- local mathvariants = tfmdata.resources.variants -- and variantdata
- if mathvariants then
- mathvariants = mathvariants[selector]
- if mathvariants then
- variant = mathvariants[char]
+ local data = chardata[char]
+ if data then
+ local variants = data.variants
+ if variants then
+ local next = isnext(parent,noad_code)
+ if next then
+ local nucleus = getnucleus(next)
+ if nucleus and getid(nucleus) == mathchar_code then
+ local selector = getchar(nucleus)
+ if variants[selector] then
+ setvariant(pointer,selector,char)
+ setprev(next,pointer)
+ setnext(parent,getnext(next))
+ flushnode(next)
end
end
- if variant then
- setchar(pointer,variant)
- setattr(pointer,a_exportstatus,char) -- we don't export the variant as it's visual markup
- if trace_variants then
- report_variants("variant (%U,%U) replaced by %U",char,selector,variant)
- end
- else
- if trace_variants then
- report_variants("no variant (%U,%U)",char,selector)
- end
+ end
+ local selector = getattr(pointer,a_variant)
+ if selector and variants[selector] then
+ setvariant(pointer,selector,char)
+ end
+ end
+ end
+ end
+
+ function mathematics.addvariant(tfmdata,char,variant,selector)
+ if char and variant and selector then
+ local data = chardata[char]
+ if data then
+ local variants = data.variants
+ if variants and variants[selector] then
+ local resources = tfmdata.resources
+ local variants = resources.variants -- and variantdata
+ if not variants then
+ variants = { }
+ resources.variants = variants
end
- setprev(next,pointer)
- setnext(parent,getnext(next))
- flush_node(next)
+ local selectors = variants[selector]
+ if not selectors then
+ selectors = { }
+ variants[selector] = selectors
+ end
+ selectors[char] = variant
+ return true
end
end
end
+ return false
end
function handlers.variants(head,style,penalties)
processnoads(head,variants,"unicode variant")
- return true -- not needed
end
+ local valid = {
+ calligraphic = 0xFE00,
+ calligraphy = 0xFE00,
+ script = 0xFE01,
+ handwriting = 0xFE01,
+ }
+
+ function mathematics.setvariant(s)
+ texsetattribute(a_variant,valid[s] or unsetvalue)
+ end
+
+ implement {
+ name = "setmathvariant",
+ public = true,
+ protected = true,
+ arguments = "argument",
+ actions = mathematics.setvariant,
+ }
+
end
-- for manuals
do
+ -- Given the amount of classes this no longer makes much sense or we need to
+ -- extend it.
+
local classes = { }
local colors = {
- [relnode_code] = "trace:dr",
- [ordnoad_code] = "trace:db",
- [binnoad_code] = "trace:dg",
- [opennoad_code] = "trace:dm",
- [closenoad_code] = "trace:dm",
- [punctnoad_code] = "trace:dc",
- -- [opdisplaylimitsnoad_code] = "",
- -- [oplimitsnoad_code] = "",
- -- [opnolimitsnoad_code] = "",
- -- [ordlimitsnoad_code] = "",
- -- [innernoad_code = "",
- -- [undernoad_code] = "",
- -- [overnoad_code] = "",
- -- [vcenternoad_code] = "",
+ [relation_class] = "trace:dr",
+ [ordinary_class] = "trace:db",
+ [binary_class] = "trace:dg",
+ [open_class] = "trace:dm",
+ [middle_class] = "trace:dm",
+ [close_class] = "trace:dm",
+ [punctuation_class] = "trace:dc",
}
local setcolor = colortracers.set
@@ -2168,7 +2444,6 @@ do
function handlers.classes(head,style,penalties)
processnoads(head,classes,"classes")
- return true -- not needed
end
registertracker("math.classes",function(v)
@@ -2177,163 +2452,353 @@ do
end
--- experimental
do
- -- mathematics.registerdomain {
- -- name = "foo",
- -- parents = { "bar" },
- -- characters = {
- -- [0x123] = { char = 0x234, class = binary },
- -- },
- -- }
-
- local domains = { }
- local categories = { }
- local numbers = { }
- local a_mathdomain = privateattribute("mathdomain")
- mathematics.domains = categories
- local permitted = {
- ordinary = ordnoad_code,
- binary = binnoad_code,
- relation = relnode_code,
- punctuation = punctnoad_code,
- inner = innernoad_code,
- }
+ local traversehlist = nuts.traversers.hlist
- function mathematics.registerdomain(data)
- local name = data.name
- if not name then
- return
- end
- local attr = #numbers + 1
- categories[name] = data
- numbers[attr] = data
- data.attribute = attr
- -- we delay hashing
- return attr
- end
+ local getshift = nuts.getshift
+ local setwhd = nuts.setwhd
+ local setshift = nuts.setshift
- local enable
+ -- normalizer: can become engine feature (native tex loves shifts)
- enable = function()
- enableaction("math", "noads.handlers.domains")
- if trace_domains then
- report_domains("enabling math domains")
+ local function normalize(h)
+ for n, s in traversehlist, h do
+ if s > 0 then
+ local sh = getshift(n)
+ local ox, oy = getoffsets(n)
+ if sh ~= 0 then
+ local w, h, d = getwhd(n)
+ h = h - sh
+ d = d + sh
+ setshift(n)
+ setwhd(n,w,h > 0 and h or 0,d > 0 and d or 0)
+ setoffsets(n,ox,oy - sh)
+ end
+ end
+ local l = getlist(l)
+ if l then
+ normalize(l)
+ end
end
- enable = false
end
- function mathematics.setdomain(name)
- if enable then
- enable()
- end
- local data = name and name ~= v_reset and categories[name]
- texsetattribute(a_mathdomain,data and data.attribute or unsetvalue)
+ function handlers.normalize(h)
+ return normalize(h)
end
- function mathematics.getdomain(name)
- if enable then
- enable()
- end
- local data = name and name ~= v_reset and categories[name]
- context(data and data.attribute or unsetvalue)
- end
+end
- implement {
- name = "initializemathdomain",
- actions = enable,
- onlyonce = true,
- }
+do
- implement {
- name = "setmathdomain",
- arguments = "string",
- actions = mathematics.setdomain,
- }
+ local traversehlist = nuts.traversers.hlist
- implement {
- name = "getmathdomain",
- arguments = "string",
- actions = mathematics.getdomain,
- }
+ local texgetdimen = tex.getdimen
+ local texgetcount = tex.getcount
+
+ local newrule = nuts.pool.outlinerule
+ local newkern = nuts.pool.kern
+ local setcolor = nodes.tracers.colors.set
+
+ local a_mathsnap = attributes.private("mathsnap")
+
+ local d_mathstrutht = tex.isdimen("mathstrutht")
+ local d_mathstrutdp = tex.isdimen("mathstrutdp")
+ local c_mathnesting = tex.iscount("mathnestinglevel")
- local function makehash(data)
- local hash = { }
- local parents = data.parents
- if parents then
- local function merge(name)
- if name then
- local c = categories[name]
- if c then
- local hash = c.hash
- if not hash then
- hash = makehash(c)
+ local trace_snapping = false registertracker("math.snapping", function(v) trace_snapping = v end)
+ local report_snapping = logreporter("mathematics","snapping")
+
+ function handlers.snap(h,_,_,_,_,level)
+ -- if not level or level == 0 then
+ if texgetcount(c_mathnesting) == 1 then
+ local trace_color
+ if trace_snapping == "frame" then
+ trace_color = "darkgray"
+ elseif type(trace_snapping) == "string" then
+ trace_color = trace_snapping
+ else
+ trace_color = false
+ end
+ local ht, dp, dd, hs, ds, hd
+ for n, s in traversehlist, h do
+ local step = getattr(n,a_mathsnap)
+ if step then
+ local done = false
+ if not dd then
+ ht = texgetdimen(d_mathstrutht)
+ dp = texgetdimen(d_mathstrutdp)
+ hd = ht + dp
+ -- lineskip can be large in alignments
+ -- dd = hd / 12
+ dd = hd / 6
+ if step == 0xFFFF then
+ hs = dd
+ ds = dd
+ else
+ hs = ht/step
+ ds = dp/step
end
- for k, v in next, hash do
- hash[k] = v
+ end
+ local w, h, d = getwhd(n)
+ -- snap to line
+ ::height::
+ if h-dd < ht then
+ if trace_snapping == true then
+ report_snapping("adapting ht: old %p, new %p, lineskip %p",h,ht,dd)
end
+ done = true
+ setheight(n,ht)
+ goto depth
end
- end
- end
- if type(parents) == "string" then
- merge(parents)
- elseif type(parents) == "table" then
- for i=1,#parents do
- merge(parents[i])
- end
- end
- end
- local characters = data.characters
- if characters then
- for k, v in next, characters do
- -- local chr = n.char
- local cls = v.class
- if cls then
- v.code = permitted[cls]
- else
- -- invalid class
- end
- hash[k] = v
- end
- end
- data.hash = hash
- return hash
- end
-
- domains[mathchar_code] = function(pointer,what,n,parent)
- local attr = getattr(pointer,a_mathdomain)
- if attr then
- local domain = numbers[attr]
- if domain then
- local hash = domain.hash
- if not hash then
- hash = makehash(domain)
- end
- local char = getchar(pointer)
- local okay = hash[char]
- if okay then
- local chr = okay.char
- local cls = okay.code
- if chr and chr ~= char then
- setchar(pointer,chr)
+ if h > ht then
+-- while ht < (h-dd) do
+ while ht < h do
+ ht = round(ht + hs)
+ end
+ if h ~= ht then
+ setheight(n,ht)
+ if trace_snapping == true then
+ report_snapping("enlarging ht: old %p, new %p, step %p",h,ht,hs)
+ end
+ done = true
+ end
+ end
+ ::depth::
+ if d-dd < dp then
+ if trace_snapping == true then
+ report_snapping("adapting dp: old %p, new %p, lineskip %p",d,dp,dd)
+ end
+ setdepth(n,dp)
+ done = true
+ goto done
end
- if cls and cls ~= getsubtype(parent) then
- setsubtype(parent,cls)
+ if d > dp then
+-- while dp < (d-dd) do
+ while dp < d do
+ dp = round(dp + ds)
+ end
+ if d ~= dp then
+ setdepth(n,dp)
+ if trace_snapping == true then
+ report_snapping("enlarging dp: old %p, new %p, step %p",d,dp,ds)
+ end
+ done = true
+ end
+ end
+ ::done::
+ if done and trace_color then
+ -- w, h, d = getwhd(n)
+ -- local r = newrule(w,h,d,65536)
+ -- setcolor(r,trace_color)
+ -- setlink(r,newkern(-w),getlist(n))
+ -- setlist(n,r)
+
+ local old = newrule(w,h,d,65536)
+ setcolor(old,"middlegray")
+ w, h, d = getwhd(n)
+ local new = newrule(w,h,d,65536/4)
+ setcolor(new,trace_color)
+ setlink(old,newkern(-w),new,newkern(-w),getlist(n))
+ local ox, oy = getoffsets(n)
+ setoffsets(old,-ox,-oy)
+ setoffsets(new,-ox,-oy)
+ setlist(n,old)
end
end
end
end
end
- function handlers.domains(head,style,penalties)
- processnoads(head,domains,"domains")
- return true -- not needed
+ local valid = {
+ [v_reset] = unsetvalue,
+ [v_line] = 0xFFFF,
+ [v_small] = 8,
+ [v_medium] = 4,
+ [v_big] = 2,
+ }
+
+ function mathematics.setsnapping(s)
+ if not enabled then
+ enableaction("math", "noads.handlers.snap")
+ enabled = true
+ end
+ texsetattribute(a_mathsnap,valid[s] or unsetvalue)
end
+ implement {
+ name = "setmathsnapping",
+ public = true,
+ protected = true,
+ arguments = "argument",
+ actions = mathematics.setsnapping,
+ }
+
end
+-- experimental : replaced by dictionaries but for now we keep the code
+--
+-- do
+--
+-- -- mathematics.registerdomain {
+-- -- name = "foo",
+-- -- parents = { "bar" },
+-- -- characters = {
+-- -- [0x123] = { char = 0x234, class = binary },
+-- -- },
+-- -- }
+--
+-- local trace_domains = false registertracker("math.domains", function(v) trace_domains = v end)
+-- local report_domains = logreporter("mathematics","domains")
+--
+-- local domains = { }
+-- local categories = { }
+-- local numbers = { }
+-- local a_mathdomain = privateattribute("mathdomain")
+-- mathematics.domains = categories
+-- local permitted = {
+-- ordinary = ordinary_class,
+-- binary = binary_class,
+-- relation = relation_class,
+-- punctuation = punctuation_class,
+-- inner = innernoad_code,
+-- fenced = fenced_class,
+-- -- fraction = fraction_class,
+-- -- radical = radical_class,
+-- }
+--
+-- function mathematics.registerdomain(data)
+-- local name = data.name
+-- if not name then
+-- return
+-- end
+-- local attr = #numbers + 1
+-- categories[name] = data
+-- numbers[attr] = data
+-- data.attribute = attr
+-- -- we delay hashing
+-- return attr
+-- end
+--
+-- local enable
+--
+-- enable = function()
+-- enableaction("math", "noads.handlers.domains")
+-- if trace_domains then
+-- report_domains("enabling math domains")
+-- end
+-- enable = false
+-- end
+--
+-- function mathematics.setdomain(name)
+-- if enable then
+-- enable()
+-- end
+-- local data = name and name ~= v_reset and categories[name]
+-- texsetattribute(a_mathdomain,data and data.attribute or unsetvalue)
+-- end
+--
+-- function mathematics.getdomain(name)
+-- if enable then
+-- enable()
+-- end
+-- local data = name and name ~= v_reset and categories[name]
+-- context(data and data.attribute or unsetvalue)
+-- end
+--
+-- implement {
+-- name = "initializemathdomain",
+-- actions = enable,
+-- onlyonce = true,
+-- }
+--
+-- implement {
+-- name = "setmathdomain",
+-- arguments = "string",
+-- actions = mathematics.setdomain,
+-- }
+--
+-- implement {
+-- name = "getmathdomain",
+-- arguments = "string",
+-- actions = mathematics.getdomain,
+-- }
+--
+-- local function makehash(data)
+-- local hash = { }
+-- local parents = data.parents
+-- if parents then
+-- local function merge(name)
+-- if name then
+-- local c = categories[name]
+-- if c then
+-- local hash = c.hash
+-- if not hash then
+-- hash = makehash(c)
+-- end
+-- for k, v in next, hash do
+-- hash[k] = v
+-- end
+-- end
+-- end
+-- end
+-- if type(parents) == "string" then
+-- merge(parents)
+-- elseif type(parents) == "table" then
+-- for i=1,#parents do
+-- merge(parents[i])
+-- end
+-- end
+-- end
+-- local characters = data.characters
+-- if characters then
+-- for k, v in next, characters do
+-- -- local chr = n.char
+-- local cls = v.class
+-- if cls then
+-- v.code = permitted[cls]
+-- else
+-- -- invalid class
+-- end
+-- hash[k] = v
+-- end
+-- end
+-- data.hash = hash
+-- return hash
+-- end
+--
+-- domains[mathchar_code] = function(pointer,what,n,parent)
+-- local attr = getattr(pointer,a_mathdomain)
+-- if attr then
+-- local domain = numbers[attr]
+-- if domain then
+-- local hash = domain.hash
+-- if not hash then
+-- hash = makehash(domain)
+-- end
+-- local char = getchar(pointer)
+-- local okay = hash[char]
+-- if okay then
+-- local chr = okay.char
+-- local cls = okay.code
+-- if chr and chr ~= char then
+-- setchar(pointer,chr)
+-- end
+-- if cls and cls ~= getsubtype(parent) then
+-- setsubtype(parent,cls)
+-- end
+-- end
+-- end
+-- end
+-- end
+--
+-- function handlers.domains(head,style,penalties)
+-- processnoads(head,domains,"domains")
+-- end
+--
+-- end
+
-- just for me
function handlers.showtree(head,style,penalties)
@@ -2362,48 +2827,154 @@ do
end
--- the normal builder
+-- Musical timestamp: August 2022 with "Meditation by Cory Wong (Live @ Brooklyn
+-- Steel FEB 2022). Seen live earlier that year and its gets better and better!
+--
+-- As we also try to do here:
do
- local force_penalties = false
+ local trace_dictionaries = false registertracker("math.dictionaries", function(v) trace_dictionaries = v end)
+ local report_dictionaries = logreporter("mathematics","dictionaries")
+
+ local setnodecolor = colortracers.set
+ local getchardict = nuts.getchardict
+ local setchardict = nuts.setchardict
- -- registertracker("math.penalties",function(v)
- -- force_penalties = v
- -- end)
+ local dictionaries = { } noads.processors.dictionaries = dictionaries
+ local groups = mathematics.dictionaries.groups
+ local sets = mathematics.dictionaries.sets
+ local variants = mathematics.dictionaries.variants
+ local defaults = mathematics.dictionaries.defaults
- function builders.kernel.mlist_to_hlist(head,style,penalties)
- return mlist_to_hlist(head,style,force_penalties or penalties)
+ local function check(pointer,group,index)
+ local v = variants[index]
+ if v and v[group] then
+ return group, class
+ end
+ return 1
end
- -- function builders.kernel.mlist_to_hlist(head,style,penalties)
- -- local h = mlist_to_hlist(head,style,force_penalties or penalties)
- -- inspect(nodes.totree(h,true,true,true))
- -- return h
- -- end
+ dictionaries[mathchar_code] = function(pointer,what,n,parent)
+ local properties, oldgroup, index, font, char = getchardict(pointer)
+ local newgroup = 1
+ local newclass = false
+ local oldclass = getsubtype(pointer)
+ if (properties & 0x1) == 0x1 then
+ newclass = oldclass
+ newgroup = oldgroup
+ else
+ local set = sets[oldgroup]
+ if set then
+ local groups = set.groups
+ local nofgroups = groups and #groups
+ if nofgroups > 0 then
+ for i=1,nofgroups do
+ real, class = check(pointer,groups[i],index)
+ if real ~= 1 then
+ goto done
+ end
+ end
+ end
+ else
+ newgroup, newclass = check(pointer,group,index)
+ end
+ ::done::
+ if newgroup == 1 then
+ newgroup = defaults[index] or 1
+ end
+ setchardict(pointer,properties,newgroup,index)
+ if type(newclass) == "number" then
+ setsubtype(parent,newclass)
+ else
+ newclass = oldclass
+ end
+ end
+ if trace_dictionaries then
+ if newgroup > 1 then
+ local groupname = groups[newgroup]
+ if groupname then
+ setnodecolor(pointer,"dictionary:"..groupname)
+ end
+ end
+ report_dictionaries("group 0x%02X -> 0x%02X, class 0x%02X -> 0x%02X, index %05X, %U %c",oldgroup,newgroup,oldclass,newclass,index,char,char)
+ end
+ end
- implement {
- name = "setmathpenalties",
- arguments = "integer",
- actions = function(p)
- force_penalties = p > 0
- end,
+ function handlers.dictionaries(head,style,penalties)
+ processnoads(head,dictionaries,"dictionaries")
+ end
+
+end
+
+do
+
+ local trace_suspicious = false registertracker("math.suspicious", function(v) trace_suspicious = v end)
+ local report_suspicious = logreporter("mathematics","suspicious")
+
+ local suspicious = { } noads.processors.suspicious = suspicious
+
+ local candidates = {
+ [classes.maybeordinary] = "maybeordinary",
+ [classes.mayberelation] = "mayberelation",
+ [classes.maybebinary ] = "maybebinary",
}
+ local registered = setmetatableindex("table")
+
+ suspicious[mathchar_code] = function(pointer,what,n,parent)
+ local class = getsubtype(pointer)
+ local found = candidates[class]
+ if found then
+ local char = getchar(pointer)
+ if not registered[class][char] then
+ report_suspicious("class %a, %U %c",found,char,char)
+ registered[class][char] = true
+ end
+ end
+ end
+
+ function handlers.suspicious(head,style,penalties)
+ if trace_suspicious then
+ processnoads(head,suspicious,"suspicious")
+ end
+ end
end
+-- the normal builder
+
+-- do
+--
+-- local force_penalties = false
+--
+-- function builders.kernel.mlisttohlist(head,style,penalties)
+-- return mlisttohlist(head,style,force_penalties or penalties)
+-- end
+--
+-- implement {
+-- name = "setmathpenalties",
+-- arguments = "integer",
+-- actions = function(p)
+-- force_penalties = p > 0
+-- end,
+-- }
+--
+-- end
+
+builders.kernel.mlisttohlist = mlisttohlist
+
local actions = tasks.actions("math") -- head, style, penalties
local starttiming, stoptiming = statistics.starttiming, statistics.stoptiming
-function processors.mlist_to_hlist(head,style,penalties)
+function processors.mlisttohlist(head,style,penalties,beginclass,endclass,level)
starttiming(noads)
- head = actions(head,style,penalties)
+ head = actions(head,style,penalties,beginclass,endclass,level)
stoptiming(noads)
return head
end
-callbacks.register('mlist_to_hlist',processors.mlist_to_hlist,"preprocessing math list")
+callbacks.register('mlist_to_hlist',processors.mlisttohlist,"preprocessing math list")
-- tracing
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-pln.mkxl b/Master/texmf-dist/tex/context/base/mkxl/math-pln.mkxl
index 81008f37b22..fa44fda2cec 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/math-pln.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-pln.mkxl
@@ -17,38 +17,16 @@
\unprotect
-% we need proper unicode:
+% We need proper unicode:
\def\relbar{\mathrel{\smash-}} % - has the same height as + .. no clue what this refers to
-% might change
+%D This might change:
\permanent\protected\def\hrulefill{\leaders\hrule\hfill}
-%protected\def\dotfill {\cleaders\hbox{\normalstartimath\mathsurround\zeropoint\mkern1.5mu.\mkern1.5mu\normalstopimath}\hfill}
+%permanent\protected\def\dotfill {\cleaders\hbox{\normalstartimath\mathsurround\zeropoint\mkern1.5mu.\mkern1.5mu\normalstopimath}\hfill}
-% will move
-
-\permanent\def\oalign#1%
- {\leavevmode % plain tex uses this
- \vtop
- {\baselineskip\zeroskip
- \lineskip.25\exheight
- \ialign{\alignmark\alignmark\crcr#1\crcr}}}
-
-\permanent\def\ooalign % chars over each other
- {\lineskiplimit-\maxdimen
- \oalign}
-
-% needs checking
-
-\permanent\protected\def\choose{\atopwithdelims()}
-\permanent\protected\def\brack {\atopwithdelims[]}
-\permanent\protected\def\brace {\atopwithdelims\{\}}
-
-% needs checking
-
-\permanent\protected\def\buildrel#1\over#2%
- {\mathrel{\mathop{\kern\zeropoint#2}\limits^{#1}}}
+%D These need an update:
\permanent\protected\def\bmod
{\nonscript
@@ -65,72 +43,8 @@
\mkern18mu
(\mfunction{mod}\mskip\medmuskip#1)}
-\permanent\protected\def\cases#1%
- {\left\{%
- \mskip\thinmuskip
- \vcenter
- {\normalbaselines
- \mathsurround\zeropoint
- \ialign{%
- \normalstartimath\alignmark\alignmark\hfil\normalstopimath
- \aligntab
- \quad\alignmark\alignmark\hfil
- \crcr
- #1%
- \crcr}}%
- \right.}
-
-\permanent\protected\def\matrix#1%
- {\emptyhbox
- \mskip\thinmuskip
- \vcenter
- {\normalbaselines
- \mathsurround\zeropoint
- \ialign{%
- \hfil\normalstartimath\alignmark\alignmark\normalstopimath\hfil
- \aligntab
- \aligntab
- \quad\hfil\normalstartimath\alignmark\alignmark\normalstopimath\hfil
- \crcr
- \mathstrut
- \crcr
- \noalign{\kern-\baselineskip}
- #1\crcr
- \mathstrut
- \crcr
- \noalign{\kern-\baselineskip}}}%
- \mskip\thinmuskip}
-
-\permanent\protected\def\pmatrix#1%
- {\left(\matrix{#1}\right)}
-
-\permanent\protected\def\math_openup
- {\afterassignment\math_openup_indeed\scratchdimen}
-
-\aliased\let\math_closeup\relax
-
-\def\math_openup_indeed
- {\enforced\permanent\protected\edef\math_closeup
- {\lineskip \the\lineskip
- \baselineskip \the\baselineskip
- \lineskiplimit\the\lineskiplimit
- \relax}%
- \advance \lineskip \scratchdimen
- \advance \baselineskip \scratchdimen
- \advance \lineskiplimit \scratchdimen}
-
-\permanent\protected\def\openup {\math_openup } % the low level ones are used elsewhere
-\permanent\protected\def\closeup{\math_closeup} % the low level ones are used elsewhere
-
-\permanent\protected\def\displaylines#1%
- {\the\mathdisplayaligntweaks
- \tabskip\zeroskip
- \halign
- {\hbox to \displaywidth{%
- \normalstartimath\tabskip\zeroskip\everycr\emptytoks\hfil\displaystyle\alignmark\alignmark\hfil\normalstopimath}\crcr
- #1\crcr}}
-
-%D This comes from plain but I gave it a \CONTEXT\ touch:
+%D This comes from plain but I gave it a \CONTEXT\ touch. When Mikael and I are in
+%D the mood we will redo them in a more modern way.
\permanent\def\math_border_NC_indeed
{\enforced\global\def\math_border_NC{\aligntab}}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-pre.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-pre.lmt
new file mode 100644
index 00000000000..974623f27f5
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-pre.lmt
@@ -0,0 +1,189 @@
+if not modules then modules = { } end modules ['math-pre'] = {
+ version = 1.001,
+ optimize = true,
+ comment = "companion to math-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local type, tonumber = type, tonumber
+local gmatch, find, topattern = string.gmatch, string.find, string.topattern
+
+local parameterlist = tex.getmathparametervalues()
+local mathstylelist = tex.getmathstylenamevalues()
+local parameterhash = table.swapped(parameterlist)
+local mathstylehash = table.swapped(mathstylelist)
+
+local axis = parameterhash.axis
+
+local getmath = tex.getmath
+local setmath = tex.setmath
+
+local function expandparameters(t)
+ local result = { }
+ local kind = type(t)
+ local function expand(s)
+ s = topattern(s)
+ for i=1,#parameterlist do
+ local p = parameterlist[i]
+ if find(p,s) then
+ result[#result+1] = p
+ end
+ end
+ end
+ if kind == "string" then
+ for s in gmatch(t,"[^%s,]+") do
+ expand(s)
+ end
+ elseif kind == "table" then
+ for i=1,#t do
+ expand(t[i])
+ end
+ end
+ return result
+end
+
+function setmathparameters(t)
+ if t then
+ for i=1,#t do
+ local ti = t[i]
+ local list = ti.list
+ local factor = ti.factor or 1
+ local style = ti.style
+ local value = ti.value
+ local unit = ti.unit
+
+ local function set(li,si,value)
+ if value then
+ setmath(li,si,value)
+ elseif factor == 0 then
+ setmath(li,si,0)
+ elseif unit == "axis" then
+ setmath(li,si,factor * getmath(axis,i))
+ else
+ setmath(li,si,factor * getmath(li,i))
+ end
+ end
+
+ for i=1,#list do
+ local li = parameterhash[list[i]]
+ if li then
+ if style == "all" then
+ for si=0,7 do
+ set(li,si,value)
+ end
+ elseif type(style) == "string" then
+ local si = mathstylehash[style]
+ if si then
+ set(li,si,value)
+ end
+ else
+ for s=1,#style do
+ local si = mathstylehash[style[s]]
+ if si then
+ set(li,si,value)
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+end
+
+-- example
+
+local stacklist = {
+ "fractionnumvgap",
+ "fractiondenomvgap",
+ "fractionnumup",
+ "fractiondenomdown",
+ "stackdenomdown",
+ "stacknumup",
+ "stackvgap",
+}
+
+local presets = {
+ less = {
+ {
+ factor = .5,
+ -- factor = 0,
+ -- value = 655360,
+ -- unit = "axis",
+ list = stacklist,
+ -- style = { "display" },
+ -- style = "display",
+ style = "all"
+ },
+ },
+ more = {
+ {
+ factor = 2,
+ list = stacklist,
+ style = "all"
+ },
+ },
+ zero = {
+ {
+ factor = 0,
+ list = stacklist,
+ style = "all"
+ },
+ },
+}
+
+mathematics.presets = presets -- we might need to store these in the format file
+
+function mathematics.preset(list)
+ for s in gmatch(list,"[^%s,]+") do
+ setmathparameters(presets[s])
+ end
+end
+
+-- todo: append, prepend, inherit
+
+interfaces.implement {
+ name = "definemathpreset",
+ public = true,
+ protected = true,
+ arguments = { "optional", "hash" },
+ actions = function(name,t)
+ if next(t) then
+ local factor = t.factor
+ local style = t.style
+ local list = t.list
+ local unit = t.unit
+ if factor then
+ t.factor = tonumber(factor)
+ end
+ if style and style ~= "all" then
+ t.style = utilities.parsers.settings_to_array(style)
+ end
+ if list then
+ -- t.list = utilities.parsers.settings_to_array(list)
+ t.list = expandparameters(list)
+ end
+ if unit and unit ~= "axis" then
+ t.unit = nil
+ end
+ -- todo: value
+ local p = presets[name]
+ if p then
+ p[#p+1] = t
+ else
+ presets[name] = t
+ end
+ else
+ presets[name] = nil
+ end
+ end,
+}
+
+interfaces.implement {
+ name = "presetmathematics",
+ public = true,
+ protected = true,
+ arguments = "optional",
+ actions = mathematics.preset,
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-rad.mklx b/Master/texmf-dist/tex/context/base/mkxl/math-rad.mklx
index 8906efdc85a..703481c0820 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/math-rad.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-rad.mklx
@@ -23,26 +23,24 @@
%D Old stuff:
-% \def\rootradical{\Uroot \defaultmathfamily "221A } % can be done in char-def
-% \def\surdradical{\Uradical \defaultmathfamily "221A } % can be done in char-def
+% \def\rootradical{\Uroot 0 "221A } % can be done in char-def
+% \def\surdradical{\Uradical 0 "221A } % can be done in char-def
-\permanent\protected\def\root#1\of{\rootradical{#1}} % #2
+% \protected\def\sqrt{\doifelsenextoptionalcs\rootwithdegree\rootwithoutdegree} % will be redefined
-\protected\def\sqrt{\doifelsenextoptionalcs\rootwithdegree\rootwithoutdegree} % will be redefined
-
-\permanent\protected\def\styledrootradical#1#2% so that \text works ok ... \rootradical behaves somewhat weird
- {\normalexpanded{\rootradical
- {\normalunexpanded{#1}}%
- {\noexpand\triggermathstyle{\number\normalmathstyle}%
- \normalunexpanded{#2}}}}
+% \permanent\protected\def\styledrootradical#1#2% so that \text works ok ... \rootradical behaves somewhat weird
+% {\normalexpanded{\math_radical_common
+% {\normalunexpanded{#1}}%
+% {\noexpand\triggermathstyle{\number\normalmathstyle}%
+% \normalunexpanded{#2}}}}
% experimental new keyword: (maybe keywords should come after the symbol)
%
% \permanent\protected\def\styledrootradical#1#2% so that \text works ok ... \rootradical behaves somewhat weird
% {\Uroot style \normalmathstyle "0 "221A {#1}{#2}}
-\permanent\protected\def\rootwithdegree[#1]{\rootradical{#1}}
-\permanent\protected\def\rootwithoutdegree {\rootradical {}}
+% \permanent\protected\def\rootwithdegree[#1]{\math_radical_common{#1}}
+% \permanent\protected\def\rootwithoutdegree {\math_radical_common {}}
%D Even older stuff:
@@ -81,6 +79,20 @@
%D $ \sqrt[3]{5} \RR\sqrt[3]{5} \sqrt[3]{5} $\par
%D $ \sqrt[3]{5} {\RR\sqrt[3]{5}} \sqrt[3]{5} $\par
%D \stoptyping
+%D
+%D And:
+%D
+%D \starttyping
+%D \definemathradical[lsqrt][strut=yes]
+%D \definemathradical[msqrt][strut=math]
+%D \definemathradical[xsqrt][height=3ex,depth=2ex]
+%D
+%D $\sqrt[strut=no][3]{y}$
+%D $\sqrt[strut=no,n=5]{y}$
+%D $\sqrt[strut=no,n=5][6]{y}$
+%D $\sqrt[strut=math]{y}$
+%D $\sqrt[3]{y}$
+%D \stoptyping
\installcorenamespace{mathradical}
\installcorenamespace{mathradicalalternative}
@@ -89,43 +101,129 @@
\setupmathradical
[\c!alternative=\v!normal,
- \c!mpoffset=.25\exheight]
+ \c!mpoffset=.25\exheight,
+ \c!height=\zeropoint,
+ \c!depth=\zeropoint,
+ \c!strut=\v!height,
+ \c!source=\zerocount,
+ \c!left="221A,
+ \c!right=\zerocount,
+ \c!leftmargin=\zeropoint,
+ \c!rightmargin=\zeropoint]
\appendtoks
\frozen\protected\instance\edefcsname\currentmathradical\endcsname{\math_radical_handle{\currentmathradical}}
\to \everydefinemathradical
-\mutable\let\currentmathradical \empty
-\mutable\let\currentmathradicaldegree\empty
+\mutable\lettonothing\currentmathradical
+\mutable\lettonothing\currentmathradicaldegree
+
+\setmathignore\Umathradicaldegreebefore\plusone
+
+\installcorenamespace{mathwhateverstrut}
+
+\defcsname\??mathwhateverstrut\v!height\endcsname{\mathheightstrut}
+\defcsname\??mathwhateverstrut\v!depth \endcsname{\mathdepthstrut}
+\defcsname\??mathwhateverstrut\v!math \endcsname{\mathstrut}
+\defcsname\??mathwhateverstrut\v!yes \endcsname{\strut}
+%letcsname\??mathwhateverstrut\v!no \endcsname\relax
-\tolerant\protected\def\math_radical_handle#tag#*[#degree]#:#body%
+\tolerant\protected\def\math_radical_handle#tag#*[#settings]#*[#degree]#:#body%
{\begingroup
\edef\currentmathradical{#tag}%
- \edef\currentmathradicaldegree{#degree}%
+ \ifhastok={#settings}%
+ \lettonothing\currentmathradicaldegree
+ \setupcurrentmathradical[#settings]%
+ \ifparameter#degree\or
+ \edef\currentmathradicaldegree{#degree}%
+ \else
+ \edef\currentmathradicaldegree{\mathradicalparameter\c!n}%
+ \fi
+ \else
+ \edef\currentmathradicaldegree{#settings}%
+ \fi
\ifempty\currentmathradicaldegree
\let\currentmathradicaldegree\m_math_no_degree
\fi
- \math_radical_alternative{#body}%
+ \ifcase\mathradicalparameter\c!right\else
+ \let\currentmathradicaldegree\m_math_no_degree
+ \fi
+ \math_radical_alternative{%
+ \begincsname\??mathwhateverstrut\mathradicalparameter\c!strut\endcsname
+ \scratchdimen\mathradicalparameter\c!leftmargin \relax\ifzeropt\scratchdimen\else\kern\scratchdimen\fi
+ #body%
+ \scratchdimen\mathradicalparameter\c!rightmargin\relax\ifzeropt\scratchdimen\else\kern\scratchdimen\fi
+ }%
\endgroup}
\def\m_math_no_degree{{}}
+% for every font
+%
+% \appendtoks
+% \Umathradicaldegreebefore\allmathstyles\zeropoint
+% \to \everymathematics
+
+% style width [options: left middle right]
+
+%D \starttyping
+%D \definemathradical[esqrt][sqrt][height=\maxdimen,depth=\maxdimen]
+%D \definemathradical[fsqrt][sqrt][height=3ex,depth=2ex]
+%D \definemathradical[ssqrt][sqrt][height=-.5pt,depth=-.5pt]
+%D
+%D \def\TestSqrt#1%
+%D {test $ #1{x} + #1{\sin(x)} $ test\par
+%D test $ #1{x} + #1{\sin(x)} + #1{\frac{1}{x}} $ test\par
+%D test $ #1{x} + #1{x^2} $ test\par
+%D test $\left(#1{x} + #1{x^2} \right)$ test\par}
+%D
+%D \TestSqrt\sqrt \blank % dynamic
+%D \TestSqrt\esqrt\blank % equal
+%D \TestSqrt\fsqrt\blank % fixed
+%D \TestSqrt\ssqrt\blank % squeezed
+%D \stoptyping
+
\def\math_radical_alternative{\csname\??mathradicalalternative\mathradicalparameter\c!alternative\endcsname}
-\setvalue{\??mathradicalalternative\v!default}% #body%
- {\rootradical{\currentmathradicaldegree}} % {#body}}
+% We use a strut in the degree because not all fonts have the right gaps set up but
+% as struts are sort of predictable we can now fix all fonts in the lfg file.
-\setvalue{\??mathradicalalternative\v!normal}#body%
+\protected\def\math_radical_common#degree%
+ {\scratchcounter\ifcstok{\mathradicalparameter\c!rule}\v!symbol
+ \mathradicalparameter\c!top\relax
+ \else
+ \zerocount
+ \fi
+ \Urooted
+ \s!height\dimexpr\mathradicalparameter\c!height\relax
+ \s!depth \dimexpr\mathradicalparameter\c!depth\relax
+ \s!source\numexpr\namedboxanchor{\mathradicalparameter\c!source}\relax
+ \s!style \normalmathstyle
+ \ifzeronum\scratchcounter\else
+ top % \s!top
+ \fi
+ \zerocount \mathradicalparameter\c!left
+ \zerocount \mathradicalparameter\c!right
+ \ifzeronum\scratchcounter\else
+ \zerocount\scratchcounter
+ \fi
+ \relax
+ {\mathstrut#degree}}
+
+\defcsname\??mathradicalalternative\v!default\endcsname % #body%
+ {\math_radical_common{\currentmathradicaldegree}} % {#body}}
+
+\defcsname\??mathradicalalternative\v!normal\endcsname#body%
{\edef\p_color{\mathradicalparameter\c!color}%
\ifempty\p_color
- \styledrootradical{\currentmathradicaldegree}{#body}% {} really needed as \rootradical expands first
+ \math_radical_common{\currentmathradicaldegree}{#body}% {} really needed as \rootradical expands first
\orelse\ifempty\currentmathradicaldegree
\pushcolor[\p_color]%
- \styledrootradical{\currentmathradicaldegree}%
+ \math_radical_common{}%
{\popcolor#body}%
\else
\pushcolor[\p_color]%
- \styledrootradical{\popcolor\currentmathradicaldegree\pushcolor[\p_color]}%
+ \math_radical_common{\popcolor\currentmathradicaldegree\pushcolor[\p_color]}%
{\popcolor#body}%
\fi}
@@ -150,7 +248,7 @@
% todo: spacing .. this is just an experiment (article driven)
-\setvalue{\??mathradicalalternative\v!mp}#body% we could use dowithnextbox
+\defcsname\??mathradicalalternative\v!mp\endcsname#body% we could use dowithnextbox
{\begingroup
\scratchoffset\mathradicalparameter\c!mpoffset
\setbox\nextbox\mathstylehbox{#body}%
@@ -174,18 +272,23 @@
\scratchdimen \wd\scratchbox
\scratchtopoffset \dimexpr\scratchoffset+\dp\nextbox\relax
\scratchbottomoffset\dimexpr\scratchoffset+\ht\nextbox/2\relax
- \hpack to \scratchdimen{\hss\box\nextbox\hskip\scratchoffset}%
- \hskip-\scratchdimen
+ \hpack to \scratchdimen{\hss\box\nextbox\kern\scratchoffset}%
+ \kern-\scratchdimen
\lower\dimexpr\scratchtopoffset\box\scratchbox%
\ifx\currentmathradicaldegree\empty \else
\setbox\scratchbox\mathstylehbox{\scriptscriptstyle\currentmathradicaldegree\hss}%
\wd\scratchbox\scratchdimen
- \hskip-\scratchdimen
+ \kern-\scratchdimen
\raise\dimexpr\scratchbottomoffset\box\scratchbox
\fi
\endgroup}
-\definemathradical[sqrt][mp=minifun::math:radical:default]
+\pushoverloadmode
+
+\definemathradical[root][mp=minifun::math:radical:default]
+\definemathradical[sqrt][root]
+
+\popoverloadmode
% \setupmathradical[sqrt][alternative=normal,color=darkblue]
% \setupmathradical[sqrt][alternative=mp,color=darkgreen]
@@ -204,7 +307,8 @@
\c!mpoffset=.25\exheight]
\appendtoks
- \frozen\instance\setuevalue{\currentmathornament}{\math_ornament_handle{\currentmathornament}}%
+ \frozen\protected\instance\edefcsname\currentmathornament\endcsname
+ {\math_ornament_handle{\currentmathornament}}%
\to \everydefinemathornament
\protected\def\math_ornament_handle#tag#body%
@@ -213,7 +317,7 @@
\csname\??mathornamentalternative\mathornamentparameter\c!alternative\endcsname{#body}%
\endgroup}
-\setvalue{\??mathornamentalternative\v!mp}#body% we could use dowithnextbox
+\defcsname\??mathornamentalternative\v!mp\endcsname#body% we could use dowithnextbox
{\begingroup
\scratchoffset\mathornamentparameter\c!mpoffset
\setbox\nextbox\mathstylehbox{#body}%
@@ -227,7 +331,7 @@
% the width of the graphic determines the width of the final result
\setbox\scratchbox\hpack{\uniqueMPgraphic{\p_mp}}% todo: add code key + tag
\hpack to \wd\scratchbox{\hss\box\nextbox\hss}%
- \hskip-\wd\scratchbox
+ \kern-\wd\scratchbox
\box\scratchbox
\endgroup}
@@ -268,4 +372,34 @@
%
% \dorecurse{8}{$\mathhat{\blackrule[width=#1ex,color=gray]}$ }
+% \annuity {(x+1)} \Uchar"20E7
+
+\integerdef\delimitedleftanutityuc \privatecharactercode{delimited left annuity}
+\integerdef\delimitedrightanutityuc \privatecharactercode{delimited right annuity}
+\integerdef\radicalbarextenderuc \privatecharactercode{radical bar extender}
+
+\definemathradical
+ [rannuity]
+ [\c!left=\zerocount,
+ \c!right=\delimitedrightanutityuc,
+ \c!rightmargin=.05\emwidth]
+
+\definemathradical
+ [lannuity]
+ [\c!left=\delimitedleftanutityuc,
+ \c!right=\zerocount,
+ \c!leftmargin=.05\emwidth,
+ \c!rightmargin=.05\emwidth]
+
+\definemathradical
+ [lrannuity]
+ [\c!left=\delimitedleftanutityuc,
+ \c!right=\delimitedrightanutityuc,
+ \c!leftmargin=.05\emwidth,
+ \c!rightmargin=.05\emwidth]
+
+\definemathradical
+ [annuity]
+ [rannuity]
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-ren.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-ren.lmt
new file mode 100644
index 00000000000..cf429cb3a69
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-ren.lmt
@@ -0,0 +1,74 @@
+if not modules then modules = { } end modules ['math-ren'] = {
+ version = 1.001,
+ comment = "companion to math-ren.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local next = next
+local gsub = string.gsub
+
+local settings_to_array = utilities.parsers.settings_to_array
+local allocate = storage.allocate
+
+local renderings = { }
+mathematics.renderings = renderings
+
+local mappings = allocate()
+renderings.mappings = mappings
+
+local numbers = allocate()
+renderings.numbers = numbers
+
+local sets = allocate()
+renderings.sets = sets
+
+mappings["blackboard-to-bold"] = {
+ [0x1D538] = 0x1D400, [0x1D539] = 0x1D401, [0x02102] = 0x1D402, [0x1D53B] = 0x1D403, [0x1D53C] = 0x1D404,
+ [0x1D53D] = 0x1D405, [0x1D53E] = 0x1D406, [0x0210D] = 0x1D407, [0x1D540] = 0x1D408, [0x1D541] = 0x1D409,
+ [0x1D542] = 0x1D40A, [0x1D543] = 0x1D40B, [0x1D544] = 0x1D40C, [0x02115] = 0x1D40D, [0x1D546] = 0x1D40E,
+ [0x02119] = 0x1D40F, [0x0211A] = 0x1D410, [0x0211D] = 0x1D411, [0x1D54A] = 0x1D412, [0x1D54B] = 0x1D413,
+ [0x1D54C] = 0x1D414, [0x1D54D] = 0x1D415, [0x1D54E] = 0x1D416, [0x1D54F] = 0x1D417, [0x1D550] = 0x1D418,
+ [0x02124] = 0x1D419,
+}
+
+mappings["mikaels-favourites"] = {
+ [0x211D] = 0x1D411,
+ [0x211A] = 0x1D410,
+ [0x2124] = 0x1D419,
+ [0x2115] = 0x1D40D,
+}
+
+local function renderset(list) -- order matters
+ local tag = gsub(list," ","")
+ local n = sets[tag]
+ if not n then
+ local list = settings_to_array(tag)
+ local mapping = { }
+ for i=1,#list do
+ local m = mappings[list[i]]
+ if m then
+ for k, v in next, m do
+ mapping[k] = v
+ end
+ end
+ end
+ if next(mapping) then
+ n = #numbers + 1
+ numbers[n] = mapping
+ else
+ n = attributes.unsetvalue
+ end
+ sets[tag] = n
+ end
+ return n
+end
+
+mathematics.renderset = renderset
+
+interfaces.implement {
+ name = "mathrenderset",
+ actions = { renderset, context },
+ arguments = "string",
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-scr.mkxl b/Master/texmf-dist/tex/context/base/mkxl/math-scr.mkxl
index 555f549f133..207f7fbf6e3 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/math-scr.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-scr.mkxl
@@ -28,7 +28,7 @@
{\math_scripts_raised_symbol_indeed3\txx{#1}}}
\def\math_scripts_raised_symbol_indeed#1#2#3%
- {\mathord{{#2\raise.#1ex\hbox{#2\symbol[#3]}}}}
+ {\mathord{#2\raise.#1\exheight\hbox{#2\symbol[#3]}}} % redundant {} removed
\def\math_scripts_raised_number#1%
{\mathchoice
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-spa.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-spa.lmt
new file mode 100644
index 00000000000..126bb739b07
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-spa.lmt
@@ -0,0 +1,204 @@
+if not modules then modules = { } end modules ['math-spa'] = {
+ version = 1.001,
+ comment = "companion to math-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- for the moment (when testing) we use a penalty 1
+
+local setmetatableindex = table.setmetatableindex
+
+local boundary_code = nodes.nodecodes.boundary
+local hlist_code = nodes.nodecodes.hlist
+local kern_code = nodes.nodecodes.kern
+local penalty_code = nodes.nodecodes.penalty
+local glue_code = nodes.nodecodes.glue
+local line_code = nodes.listcodes.line
+local ghost_code = nodes.listcodes.ghost
+local middle_code = nodes.listcodes.middle
+local leftskip_code = nodes.gluecodes.leftskip
+local rightskip_code = nodes.gluecodes.rightskip
+
+local nuts = nodes.nuts
+local tonut = nodes.tonut
+local tonode = nodes.tonode
+
+local getid = nuts.getid
+local getsubtype = nuts.getsubtype
+local getnext = nuts.getnext
+local getwidth = nuts.getwidth
+local getdata = nuts.getdata
+local getdepth = nuts.getdepth
+local getheight = nuts.getheight
+local getlist = nuts.getlist
+local setglue = nuts.setglue
+local setwhd = nuts.setwhd
+local getdimensions = nuts.dimensions
+local getnormalizedline = node.direct.getnormalizedline
+local getbox = nuts.getbox
+local setoffsets = nuts.setoffsets
+local addxoffset = nuts.addxoffset
+
+local nextglue = nuts.traversers.glue
+local nextlist = nuts.traversers.list
+local nextboundary = nuts.traversers.boundary
+local nextnode = nuts.traversers.node
+
+local texsetdimen = tex.setdimen
+local texsetcount = tex.setcount
+local texisdimen = tex.isdimen
+local texiscount = tex.iscount
+
+local boundary = tex.boundaries.system("mathalign")
+local stages = { }
+local initial = { }
+
+local c_strc_math_n_of_lines = texiscount("c_strc_math_n_of_lines")
+local d_strc_math_max_width = texisdimen("d_strc_math_max_width")
+local d_strc_math_first_width = texisdimen("d_strc_math_first_width")
+local d_strc_math_last_width = texisdimen("d_strc_math_last_width")
+local d_strc_math_first_height = texisdimen("d_strc_math_first_height")
+local d_strc_math_last_depth = texisdimen("d_strc_math_last_depth")
+local d_strc_math_indent = texisdimen("d_strc_math_indent")
+
+stages[1] = function(specification,stage)
+ local box = getbox(specification.box)
+ local head = getlist(box)
+ local align = specification.alignstate
+ local distance = specification.distance
+ for s in nextboundary, head do
+ if getdata(s) == boundary then
+ -- todo: skip over ghost, maybe penalty, maybe glues all in one loop
+-- local n = getnext(s)
+-- if n and getid(n) == kern_code then -- also needed
+-- n = getnext(n)
+-- end
+-- while n and getid(n) == hlist_code and getsubtype(n) == ghost_code do
+-- n = getnext(n)
+-- end
+-- -- while n and getid(n) == glue_code do
+-- if n and getid(n) == glue_code then
+-- n = getnext(n)
+-- end
+ for n, id, subtype in nextnode, getnext(s) do
+ s = n
+ if id == kern_code then
+ -- move on (s_2 case)
+ elseif id == glue_code then
+ -- move on
+ elseif id == penalty_code then
+ -- move on (untested)
+ elseif id == hlist_code and subtype == ghost_code then
+ -- move on
+ else
+ break
+ end
+ end
+ distance = distance + getdimensions(head,s)
+ break
+ end
+ end
+ texsetdimen("global",d_strc_math_indent,distance)
+ if align == 2 then
+ for n in nextglue, head do
+ setglue(n,getwidth(n),0,0,0,0)
+ end
+ end
+end
+
+local function reposition(n,offset)
+ -- We need to relocate the local boxes that we use to push something left or
+ -- right ... quite horrible and one needs a bit twisted mindset for this.
+ for n, id, subtype, list in nextlist, getlist(n) do
+ if subtype == middle_code then
+ addxoffset(n,-offset)
+ end
+ end
+ -- this is tricky ... see line numbering so it might become a real shift
+ -- inside the box: setprops(n,"repositioned",true)
+ addxoffset(n,offset)
+end
+
+stages[2] = function(specification,stage)
+ local head = getlist(getbox(specification.box))
+ local align = specification.alignstate
+ local maxwidth = false
+ local cnt = 0
+ local lastwidth = 0
+ local firstheight = 0
+ local lastdepth = 0
+ for n, id, subtype, list in nextlist, head do
+ if subtype == line_code then
+ local t = getnormalizedline(n)
+ local m = t.rightskip + t.parfillrightskip
+ if not maxwidth then
+ maxwidth = m
+ firstheight = getheight(n)
+ firstwidth = m
+ elseif m < maxwidth then
+ maxwidth = m
+ end
+ cnt = cnt + 1
+ lastwidth = m
+ lastdepth = getdepth(n)
+ end
+ end
+ if stage == 2 and (align == 2 or align == 3) then
+ for n, id, subtype, list in nextlist, head do
+ if subtype == line_code then
+ if align == 1 then -- flushleft
+ -- todo
+ elseif align == 2 then -- middle
+ reposition(n,maxwidth/2)
+ elseif align == 3 then -- flushright
+ reposition(n,maxwidth)
+ end
+ end
+ end
+ end
+ texsetcount("global",c_strc_math_n_of_lines,cnt)
+ texsetdimen("global",d_strc_math_max_width,maxwidth)
+ texsetdimen("global",d_strc_math_first_width,firstwidth)
+ texsetdimen("global",d_strc_math_last_width,lastwidth)
+ texsetdimen("global",d_strc_math_first_height,firstheight)
+ texsetdimen("global",d_strc_math_last_depth,lastdepth)
+end
+
+stages[3] = stages[2]
+
+stages[4] = function(specification,stage)
+ local box = getbox(specification.box)
+ nuts.openup(specification,getlist(box))
+ local w, h, d = getdimensions(getlist(box),true) -- vertical
+ setwhd(box,w,h,d)
+end
+
+interfaces.implement {
+ name = "handlemathhang",
+ arguments = {
+ {
+ { "stage", "integer" },
+ -- { "method" },
+ { "alignstate", "integer" },
+ { "box", "integer" },
+ { "distance", "dimension" },
+ { "inbetween", "dimension" },
+ { "height", "dimension" },
+ { "depth", "dimension" },
+ { "splitmethod" },
+ }
+ },
+ actions = function(specification)
+ local stage = specification.stage
+ if stage == 1 then
+ initial = specification
+ else
+ setmetatableindex(specification,initial)
+ end
+ if stage > 0 and stage <= #stages then
+ stages[stage](specification,stage)
+ end
+ end
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-stc.mklx b/Master/texmf-dist/tex/context/base/mkxl/math-stc.mklx
index 944185c23c4..5922fb1166c 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/math-stc.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-stc.mklx
@@ -75,6 +75,9 @@
% at the lua end and some checking: use \mathhorizontalcode or \mathextensiblecode
% but in practice arrows etc are not used that often
+% At some point we can consider to use the more natural \LUAMETATEX\ features but the
+% problem is that we lack proper support in fonts and we also have less control.
+
\installcorenamespace {mathextensiblefallbacks}
% currently no italic correction ... problem is that we don't know yet if we have an italic
@@ -91,23 +94,34 @@
\ifcsname\??mathextensiblefallbacks\number\scratchunicode\endcsname
\lastnamedcs
\else
- \Umathchar \fam \zerocount \scratchunicode
+ \Umathchar\zerocount\zerocount\scratchunicode
\fi
\hss}}
-\def\math_stackers_regular
- {\mathstylehbox{\usemathstackerscolorparameter\c!color
- \hskip\d_math_stackers_offset_l
- \Umathaccent\fam\zerocount\scratchunicode
- {\hskip\dimexpr\scratchwidth-\d_math_stackers_offset_l-\d_math_stackers_offset_r}%
- \hskip\d_math_stackers_offset_r
- }}
+% \def\math_stackers_regular
+% {\mathstylehbox{\usemathstackerscolorparameter\c!color
+% \hskip\d_math_stackers_offset_l
+% \Umathaccent\zerocount\zerocount\scratchunicode
+% {\hskip\dimexpr\scratchwidth-\d_math_stackers_offset_l-\d_math_stackers_offset_r}%
+% \hskip\d_math_stackers_offset_r
+% }}
+
+% \def\math_stackers_stretch % we don't have that one yet
+% {\mathstylehbox{\usemathstackerscolorparameter\c!color
+% \hskip\d_math_stackers_offset_l
+% \Umathaccent\zerocount\zerocount\scratchunicode
+% {\hskip\dimexpr\hsize-\d_math_stackers_offset_l-\d_math_stackers_offset_r}%
+% \hskip\d_math_stackers_offset_r
+% }}
-\def\math_stackers_stretch % we don't have that one yet
+\def\math_stackers_regular
{\mathstylehbox{\usemathstackerscolorparameter\c!color
\hskip\d_math_stackers_offset_l
- \Umathaccent\fam\zerocount\scratchunicode
- {\hskip\dimexpr\hsize-\d_math_stackers_offset_l-\d_math_stackers_offset_r}%
+ \Uhextensible
+ middle
+ width \dimexpr\scratchwidth-\d_math_stackers_offset_l-\d_math_stackers_offset_r\relax
+ \zerocount\scratchunicode
+ \relax
\hskip\d_math_stackers_offset_r
}}
@@ -116,7 +130,7 @@
% $\Umathaccent 0 0 "2190{x}$ \par $\Umathaccent 0 0 "27F8{x}$\par
% $\Udelimiterunder 0 "2190{x}$ \par $\Udelimiterunder 0 "27F8{x}$\par
-\setvalue{\??mathextensiblefallbacks}%
+\defcsname\??mathextensiblefallbacks\endcsname
{\hpack{\vrule\s!width\scratchwidth\s!height.1\mathexheight\s!depth\zeropoint}}
% \def\math_stackers_with_fallback#codepoint%
@@ -153,7 +167,7 @@
\let\math_stackers_skip \hskip}
\def\math_stackers_skip_indeed#amount%
- {\filledhboxk{\unsetteststrut\strut\hskip#amount}} % \dontshowstruts
+ {\filledhboxk{\strut\hskip#amount}}
\let\math_stackers_start_tagged_mid\relax
\let\math_stackers_start_tagged_top\relax
@@ -177,15 +191,16 @@
[%c!alternative=\v!text, % text | mathematics
\c!left=,
\c!right=,
- \c!mathclass=\s!rel,
+ \c!mathclass=\s!relation,
\c!alternative=\v!normal,
- \c!voffset=.25\mathexheight,
+ \c!voffset=.25\mathexheight, % maybe less
\c!hoffset=\zeropoint,
\c!topoffset=\zeropoint, % for manual italic correction
\c!distance=\mathstackersparameter\c!voffset, % distance between symbol and base (can be different from voffset)
\c!minheight=\mathexheight,
\c!mindepth=\zeropoint,
- \c!minwidth=.5\mathemwidth,
+ % \c!minwidth=.5\mathemwidth,
+ \c!minwidth=.25\mathemwidth, % \iota
\c!order=\v!normal,
\c!strut=,
\c!color=, % todo: when I need it
@@ -201,19 +216,19 @@
\installcorenamespace {mathstackerslocation}
\installcorenamespace {mathstackersalternative}
-\letvalue{\??mathstackerslocation\v!top }\plusone % on top of baseline
-\letvalue{\??mathstackerslocation\v!high }\plustwo % 25 % down
-\letvalue{\??mathstackerslocation\v!middle }\plusthree % centered
-\letvalue{\??mathstackerslocation\v!low }\plusfour % 75 % down
-\letvalue{\??mathstackerslocation\v!bottom }\plusfive % below baseline
-\letvalue{\??mathstackerslocation }\zerocount
+\letcsname\??mathstackerslocation\v!top \endcsname\plusone % on top of baseline
+\letcsname\??mathstackerslocation\v!high \endcsname\plustwo % 25 % down
+\letcsname\??mathstackerslocation\v!middle \endcsname\plusthree % centered
+\letcsname\??mathstackerslocation\v!low \endcsname\plusfour % 75 % down
+\letcsname\??mathstackerslocation\v!bottom \endcsname\plusfive % below baseline
+\letcsname\??mathstackerslocation \endcsname\zerocount
%D First we implement the helper that deals with an extensible in the middle and
%D top and|/|or bottom texts:
-\let\m_math_stackers_text_top \empty
-\let\m_math_stackers_text_bottom\empty
-\let\m_math_stackers_text_middle\empty
+\lettonothing\m_math_stackers_text_top
+\lettonothing\m_math_stackers_text_bottom
+\lettonothing\m_math_stackers_text_middle
\def\math_stackers_flushtext#command#text%
{\ifdim\scratchleftoffset >\zeropoint\math_stackers_skip\scratchleftoffset \fi
@@ -242,8 +257,8 @@
% no checking, we assume sane use
-\letvalue{\??mathstackersalternative\v!normal }\math_stackers_content
-\letvalue{\??mathstackersalternative\v!default}\math_stackers_content
+\letcsname\??mathstackersalternative\v!normal \endcsname\math_stackers_content
+\letcsname\??mathstackersalternative\v!default\endcsname\math_stackers_content
\setupmathstackers
[\c!mp=math:stacker:\number\scratchunicode,
@@ -251,7 +266,7 @@
\c!mpdepth=\mathchardp\scratchunicode,
\c!mpoffset=.25\mathexheight]
-\setvalue{\??mathstackersalternative\v!mp}%
+\defcsname\??mathstackersalternative\v!mp\endcsname
{\normalexpanded{\math_stackers_mp_box
{\the\dimexpr\mathstackersparameter\c!mpheight}%
{\the\dimexpr\mathstackersparameter\c!mpdepth}%
@@ -284,8 +299,8 @@
% heads/tails + hoffset
\orelse\ifx\p_offset\v!min
% heads/tails - hoffset
- \advance\scratchleftoffset -\scratchhoffset
- \advance\scratchrightoffset-\scratchhoffset
+ \advanceby\scratchleftoffset -\scratchhoffset
+ \advanceby\scratchrightoffset-\scratchhoffset
\else % \v!normal
% hoffset
\scratchleftoffset\zeropoint
@@ -313,8 +328,8 @@
\scratchdepth\scratchdimen
\dp\scratchboxthree\scratchdepth
\fi
- \advance\scratchtopoffset -\scratchheight
- \advance\scratchbottomoffset-\scratchdepth
+ \advanceby\scratchtopoffset -\scratchheight
+ \advanceby\scratchbottomoffset-\scratchdepth
\ifdim\scratchtopoffset<\zeropoint
\scratchtopoffset\zeropoint
\fi
@@ -327,7 +342,7 @@
\edef\currentmathstackers{#category}%
\mathstackersparameter\c!left\relax
\dostarttagged\t!mstacker\currentmathstackers
- \ifmmode\math_class_by_parameter\mathstackersparameter\else\dontleavehmode\fi
+ \ifmmode\math_atom_by_parameter\mathstackersparameter\else\dontleavehmode\fi
{\edef\p_offset {\mathstackersparameter\c!offset}%
\edef\p_location {\mathstackersparameter\c!location}%
\edef\p_strut {\mathstackersparameter\c!strut}%
@@ -370,7 +385,8 @@
\scratchwidth\mathcharwd\scratchunicode
\ifdim\wd\scratchboxone>\scratchwidth
\scratchwidth\wd\scratchboxone
- \orelse\ifdim\wd\scratchboxtwo>\scratchwidth
+ \fi % no \elseif here
+ \ifdim\wd\scratchboxtwo>\scratchwidth
\scratchwidth\wd\scratchboxtwo
\fi
\else
@@ -398,13 +414,16 @@
\ifdim\scratchwidth<\scratchdimen
\scratchwidth\scratchdimen
\fi
- \advance\scratchwidth2\scratchhoffset
+ \advanceby\scratchwidth2\scratchhoffset
%
\ifcase#method\relax
\dostarttagged\t!mstackermid\empty
\setbox\scratchboxthree\csname\??mathstackersalternative\p_alternative\endcsname
\dostoptagged
\fi
+ \ifdim\wd\scratchboxthree>\scratchwidth
+ \scratchwidth\wd\scratchboxthree
+ \fi
%
\ifdim\wd\scratchboxone<\scratchwidth
\setbox\scratchboxone\hpack to \scratchwidth{\hss\unhbox\scratchboxone\hss}% unhboxing makes leaders work
@@ -492,9 +511,9 @@
\permanent\tolerant\protected\def\definemathextensible[#1]#*[#2]#*[#3]% category name unicode
{\ifarguments\or\or
- \frozen\setuevalue{#1}{\math_stackers_auto_normal\noexpand\currentmathstackers{\number#2}}%
+ \frozen\protected\edefcsname#1\endcsname{\math_stackers_auto_normal\noexpand\currentmathstackers{\number#2}}%
\or
- \frozen\setuevalue{#2}{\math_stackers_auto_normal{#1}{\number#3}}%
+ \frozen\protected\edefcsname#2\endcsname{\math_stackers_auto_normal{#1}{\number#3}}%
\fi}
\tolerant\protected\def\math_stackers_auto_normal#1#2#*[#3]#:#=#*#=%
@@ -522,20 +541,6 @@
{\math_stackers_triplet\zerocount{#category}{#codepoint}{#toptext}{#bottomtext}%
\endgroup}
-%D The next one deals with under and over extensibles (arrows mostly):
-
-\installcorenamespace {mathclasses}
-
-\letvalue{\??mathclasses }\mathord
-\letvalue{\??mathclasses rel}\mathrel
-\letvalue{\??mathclasses ord}\mathord
-
-\def\math_class_by_parameter#1%
- {\normalexpanded{\noexpand\math_class_by_parameter_indeed{#1\c!mathclass}}}
-
-\def\math_class_by_parameter_indeed#1%
- {\csname\??mathclasses\ifcsname\??mathclasses#1\endcsname#1\fi\endcsname}
-
% 1 0 name n 0 | 0 1 name n 0 | 1 1 name n n
\let\math_stackers_stop_group\endgroup
@@ -546,17 +551,18 @@
\edef\p_limits{\mathstackersparameter\c!mathlimits}%
\ifx\p_limits\v!yes
\def\math_stackers_stop_group{\egroup\endgroup\ordlimits}%
- \mathop\bgroup
+ % \mathop\bgroup
+ \mathaccent\bgroup
\else
\let\math_stackers_stop_group\endgroup
\fi}
-\newconstant\c_math_stackers_top
-\newconstant\c_math_stackers_bottom
-\newconstant\c_math_stackers_codepoint
-\newconstant\c_math_stackers_extracode
-\newdimen \d_math_stackers_offset_l
-\newdimen \d_math_stackers_offset_r
+\newconstant \c_math_stackers_top
+\newconstant \c_math_stackers_bottom
+\newconstant \c_math_stackers_codepoint
+\newconstant \c_math_stackers_extracode
+\newdimension\d_math_stackers_offset_l
+\newdimension\d_math_stackers_offset_r
\setupmathstackers[lt=\zeropoint,rt=\zeropoint,lb=\zeropoint,rb=\zeropoint]
@@ -571,7 +577,7 @@
\fi
\mathstackersparameter\c!left\relax
\dostarttagged\t!mstacker\currentmathstackers
- \ifmmode\math_class_by_parameter\mathstackersparameter\else\dontleavehmode\fi
+ \ifmmode\math_atom_by_parameter\mathstackersparameter\else\dontleavehmode\fi
{\edef\m_math_stackers_text_middle {#text}%
%
\edef\p_offset {\mathstackersparameter\c!offset}%
@@ -595,7 +601,7 @@
\ifdim\scratchwidth<\scratchdimen
\scratchwidth\scratchdimen
\fi
- \advance\scratchwidth2\scratchhoffset
+ \advanceby\scratchwidth2\scratchhoffset
%
%\scratchunicode\c_math_stackers_codepoint
\ifcase\c_math_stackers_bottom
@@ -680,33 +686,33 @@
\permanent\tolerant\protected\def\definemathoverextensible[#1]#*[#2]#*[#3]%
{\ifparameter#3\or
- \frozen\setuevalue{#2}{\math_stackers_make_double\plusone \zerocount{#1}{\number#3}{0}}%
+ \frozen\protected\edefcsname#2\endcsname{\math_stackers_make_double\plusone \zerocount{#1}{\number#3}{0}}%
\else
- \frozen\setuevalue{#1}{\math_stackers_make_double\plusone \zerocount\noexpand\currentmathstackers{\number#2}{0}}%
+ \frozen\protected\edefcsname#1\endcsname{\math_stackers_make_double\plusone \zerocount\noexpand\currentmathstackers{\number#2}{0}}%
\fi}
\permanent\tolerant\protected\def\definemathunderextensible[#1]#*[#2]#*[#3]%
{\ifparameter#3\or
- \frozen\setuevalue{#2}{\math_stackers_make_double\zerocount\plusone{#1}{\number#3}{0}}%
+ \frozen\protected\edefcsname#2\endcsname{\math_stackers_make_double\zerocount\plusone{#1}{\number#3}{0}}%
\else
- \frozen\setuevalue{#1}{\math_stackers_make_double\zerocount\plusone\noexpand\currentmathstackers{\number#2}{0}}%
+ \frozen\protected\edefcsname#1\endcsname{\math_stackers_make_double\zerocount\plusone\noexpand\currentmathstackers{\number#2}{0}}%
\fi}
\permanent\tolerant\protected\def\definemathdoubleextensible[#1]#*[#2]#*[#3]#*[#4]%
{\ifparameter#4\or
- \frozen\setuevalue{#2}{\math_stackers_make_double\plusone \plusone{#1}{\number#3}{\number#4}}%
+ \frozen\protected\edefcsname#2\endcsname{\math_stackers_make_double\plusone \plusone{#1}{\number#3}{\number#4}}%
\else
- \frozen\setuevalue{#1}{\math_stackers_make_double\plusone \plusone\noexpand\currentmathstackers{\number#2}{\number#3}}%
+ \frozen\protected\edefcsname#1\endcsname{\math_stackers_make_double\plusone \plusone\noexpand\currentmathstackers{\number#2}{\number#3}}%
\fi}
\permanent\tolerant\protected\def\definemathover[#category]#spacer[#command]#spacer[#topcode]%
- {\frozen\setuvalue{#command}{\math_stackers_handle_direct\plusone\zerocount{#category}{#topcode}{0}}}
+ {\frozen\protected\defcsname#command\endcsname{\math_stackers_handle_direct\plusone\zerocount{#category}{#topcode}{0}}}
\permanent\tolerant\protected\def\definemathunder[#category]#spacer[#command]#spacer[#bottomcode]%
- {\frozen\setuvalue{#command}{\math_stackers_handle_direct\zerocount\plusone{#category}{#bottomcode}{0}}}
+ {\frozen\protected\defcsname#command\endcsname{\math_stackers_handle_direct\zerocount\plusone{#category}{#bottomcode}{0}}}
\permanent\tolerant\protected\def\definemathdouble[#category]#spacer[#command]#spacer[#topcode]#spacer[#bottomcode]%
- {\frozen\setuvalue{#command}{\math_stackers_handle_direct\plusone\plusone{#category}{#topcode}{#bottomcode}}}
+ {\frozen\protected\defcsname#command\endcsname{\math_stackers_handle_direct\plusone\plusone{#category}{#topcode}{#bottomcode}}}
\permanent\tolerant\protected\def\mathover[#category]#spacer[#settings]#:#topcode#text%
{\begingroup
@@ -758,7 +764,7 @@
{\math_stackers_start_group{#category}%
\mathstackersparameter\c!left\relax
\dostarttagged\t!mstacker\currentmathstackers
- \ifmmode\math_class_by_parameter\mathstackersparameter\else\dontleavehmode\fi
+ \ifmmode\math_atom_by_parameter\mathstackersparameter\else\dontleavehmode\fi
{\edef\currentmathstackers{#category}%
%
\edef\p_offset {\mathstackersparameter\c!offset}%
@@ -806,7 +812,7 @@
\ifdim\scratchwidth<\scratchdimen
\scratchwidth\scratchdimen
\fi
- \advance\scratchwidth2\scratchhoffset
+ \advanceby\scratchwidth2\scratchhoffset
%
\ifdim\wd\scratchboxone<\scratchwidth
\setbox\scratchboxone\hpack to \scratchwidth{\hss\unhbox\scratchboxone\hss}%
@@ -883,16 +889,16 @@
\permanent\tolerant\protected\def\definemathovertextextensible[#1]#*[#2]#*[#3]%
{\ifparameter#3\or
- \frozen\setuevalue{#2}{\math_stackers_make_double_text\plusone{#1}{\number#3}}%
+ \frozen\protected\edefcsname#2\endcsname{\math_stackers_make_double_text\plusone{#1}{\number#3}}%
\else
- \frozen\setuevalue{#1}{\math_stackers_make_double_text\plusone\noexpand\currentmathstackers{\number#2}}%
+ \frozen\protected\edefcsname#1\endcsname{\math_stackers_make_double_text\plusone\noexpand\currentmathstackers{\number#2}}%
\fi}
\permanent\tolerant\protected\def\definemathundertextextensible[#1]#*[#2]#*[#3]%
{\ifparameter#3\or
- \frozen\setuevalue{#2}{\math_stackers_make_double_text\zerocount{#1}{\number#3}}%
+ \frozen\protected\edefcsname#2\endcsname{\math_stackers_make_double_text\zerocount{#1}{\number#3}}%
\else
- \frozen\setuevalue{#1}{\math_stackers_make_double_text\zerocount\noexpand\currentmathstackers{\number#2}}%
+ \frozen\protected\edefcsname#1\endcsname{\math_stackers_make_double_text\zerocount\noexpand\currentmathstackers{\number#2}}%
\fi}
\permanent\tolerant\protected\def\mathovertext[#category]%
@@ -917,11 +923,11 @@
\permanent\tolerant\protected\def\definemathtriplet[#1]#*[#2]#*[#3]% category name default
{\ifarguments\or
- \frozen\setuevalue{#1}{\math_stackers_auto_triplet_nop[\noexpand\currentmathstackers]}%
+ \frozen\protected\edefcsname#1\endcsname{\math_stackers_auto_triplet_nop[\noexpand\currentmathstackers]}%
\or
- \frozen\setuevalue{#2}{\math_stackers_auto_triplet_nop[#1]}%
+ \frozen\protected\edefcsname#2\endcsname{\math_stackers_auto_triplet_nop[#1]}%
\or
- \frozen\setuevalue{#2}{\math_stackers_auto_triplet_yes[#1][#3]}%
+ \frozen\protected\edefcsname#2\endcsname{\math_stackers_auto_triplet_yes[#1][#3]}%
\fi}
\tolerant\protected\def\math_stackers_auto_triplet_yes[#1][#2]#*[#3]#:#=#*#=% [#2]% #2 gobble spaces
@@ -982,7 +988,7 @@
\definemathstackers
[\v!vfenced]
[\v!both]
- [\c!mathclass=\s!ord,
+ [\c!mathclass=\s!ordinary,
\c!mathlimits=\v!yes]
% these are needed for mathml:
@@ -1028,8 +1034,8 @@
% \setupbodyfont[xits] \getbuffer
% \setupbodyfont[cambria] \getbuffer
-\immutable\protected\def\normaldoublebrace {\Umathaccents 0 \defaultmathfamily "23DE 0 \defaultmathfamily "23DF }
-\immutable\protected\def\normaldoubleparent{\Umathaccents 0 \defaultmathfamily "23DC 0 \defaultmathfamily "23DD }
+\immutable\protected\def\normaldoublebrace {\Umathaccent \s!both \zerocount \zerocount "23DE \zerocount \zerocount "23DF }
+\immutable\protected\def\normaldoubleparent{\Umathaccent \s!both \zerocount \zerocount "23DC \zerocount \zerocount "23DD }
% let's keep this
@@ -1070,6 +1076,7 @@
\definemathextensible [\v!reverse] [xrightharpoondown] ["21C1]
\definemathextensible [\v!reverse] [xrightharpoonup] ["21C0]
\definemathextensible [\v!reverse] [xrightoverleftarrow] ["21C4]
+\definemathextensible [\v!reverse] [xleftoverrightarrow] ["21C6]
\definemathextensible [\v!reverse] [xleftrightharpoons] ["21CB]
\definemathextensible [\v!reverse] [xrightleftharpoons] ["21CC]
\definemathextensible [\v!reverse] [xtriplerel] ["2261]
@@ -1092,28 +1099,11 @@
\definemathextensible [\v!mathematics] [mrightharpoondown] ["21C1]
\definemathextensible [\v!mathematics] [mrightharpoonup] ["21C0]
\definemathextensible [\v!mathematics] [mrightoverleftarrow] ["21C4]
+\definemathextensible [\v!mathematics] [mleftoverrightarrow] ["21C6]
\definemathextensible [\v!mathematics] [mleftrightharpoons] ["21CB]
\definemathextensible [\v!mathematics] [mrightleftharpoons] ["21CC]
\definemathextensible [\v!mathematics] [mtriplerel] ["2261]
-\definemathextensible [\v!mathematics] [eleftarrowfill] ["2190] % ["27F5]
-\definemathextensible [\v!mathematics] [erightarrowfill] ["2192] % ["27F6]
-\definemathextensible [\v!mathematics] [eleftrightarrowfill] ["27F7]
-\definemathextensible [\v!mathematics] [etwoheadrightarrowfill] ["27F9]
-\definemathextensible [\v!mathematics] [eleftharpoondownfill] ["21BD]
-\definemathextensible [\v!mathematics] [eleftharpoonupfill] ["21BC]
-\definemathextensible [\v!mathematics] [erightharpoondownfill] ["21C1]
-\definemathextensible [\v!mathematics] [erightharpoonupfill] ["21C0]
-
-\definemathextensible [\v!mathematics] [eoverbarfill] ["FE33E]
-\definemathextensible [\v!mathematics] [eunderbarfill] ["FE33F]
-\definemathextensible [\v!mathematics] [eoverbracefill] ["FE3DE]
-\definemathextensible [\v!mathematics] [eunderbracefill] ["FE3DF]
-\definemathextensible [\v!mathematics] [eoverparentfill] ["FE3DC]
-\definemathextensible [\v!mathematics] [eunderparentfill] ["FE3DD]
-\definemathextensible [\v!mathematics] [eoverbracketfill] ["FE3B4]
-\definemathextensible [\v!mathematics] [eunderbracketfill] ["FE3B5]
-
\definemathextensible [\v!text] [trel] ["002D]
\definemathextensible [\v!text] [tequal] ["003D]
\definemathextensible [\v!text] [tmapsto] ["21A6]
@@ -1132,6 +1122,7 @@
\definemathextensible [\v!text] [trightharpoondown] ["21C1]
\definemathextensible [\v!text] [trightharpoonup] ["21C0]
\definemathextensible [\v!text] [trightoverleftarrow] ["21C4]
+\definemathextensible [\v!text] [tleftoverrightarrow] ["21C6]
\definemathextensible [\v!text] [tleftrightharpoons] ["21CB]
\definemathextensible [\v!text] [trightleftharpoons] ["21CC]
\definemathextensible [\v!text] [ttriplerel] ["2261]
@@ -1169,41 +1160,37 @@
%D in the backend (okay, we still need to deal with some cut and paste issues but at
%D least we now know what we deal with.
-% alternatively we can move the original to FE*
+\definemathoverextensible [\v!vfenced] [overbar] ["203E]
+\definemathunderextensible [\v!vfenced] [underbar] ["203E] % ["0332]
+\definemathdoubleextensible [\v!vfenced] [doublebar] ["203E] ["203E] % ["0332]
-\definemathoverextensible [\v!vfenced] [overbar] ["FE33E] % ["203E]
-\definemathunderextensible [\v!vfenced] [underbar] ["FE33F] % ["203E]
-\definemathdoubleextensible [\v!vfenced] [doublebar] ["FE33E] ["FE33F]
+\definemathoverextensible [\v!vfenced] [overbrace] ["23DE]
+\definemathunderextensible [\v!vfenced] [underbrace] ["23DF]
+\definemathdoubleextensible [\v!vfenced] [doublebrace] ["23DE] ["23DF]
-\definemathoverextensible [\v!vfenced] [overbrace] ["FE3DE] % ["023DE]
-\definemathunderextensible [\v!vfenced] [underbrace] ["FE3DF] % ["023DF]
-\definemathdoubleextensible [\v!vfenced] [doublebrace] ["FE3DE] ["FE3DF]
+\definemathoverextensible [\v!vfenced] [overparent] ["23DC]
+\definemathunderextensible [\v!vfenced] [underparent] ["23DD]
+\definemathdoubleextensible [\v!vfenced] [doubleparent] ["23DC] ["23DD]
-\definemathoverextensible [\v!vfenced] [overparent] ["FE3DC] % ["023DC]
-\definemathunderextensible [\v!vfenced] [underparent] ["FE3DD] % ["023DD]
-\definemathdoubleextensible [\v!vfenced] [doubleparent] ["FE3DC] ["FE3DD]
-
-\definemathoverextensible [\v!vfenced] [overbracket] ["FE3B4] % ["023B4]
-\definemathunderextensible [\v!vfenced] [underbracket] ["FE3B5] % ["023B5]
-\definemathdoubleextensible [\v!vfenced] [doublebracket] ["FE3B4] ["FE3B5]
-
-% \protected\def\mathopwithlimits#1#2{\mathop{#1{#2}}\limits}
+\definemathoverextensible [\v!vfenced] [overbracket] ["23B4]
+\definemathunderextensible [\v!vfenced] [underbracket] ["23B5]
+\definemathdoubleextensible [\v!vfenced] [doublebracket] ["23B4] ["23B5]
%D For mathml:
-\definemathdoubleextensible [\v!both] [overbarunderbar] ["FE33E] ["FE33F]
-\definemathdoubleextensible [\v!both] [overbraceunderbrace] ["FE3DE] ["FE3DF]
-\definemathdoubleextensible [\v!both] [overparentunderparent] ["FE3DC] ["FE3DD]
-\definemathdoubleextensible [\v!both] [overbracketunderbracket] ["FE3B4] ["FE3B5]
+\definemathdoubleextensible [\v!both] [overbarunderbar] ["203E] ["203E]
+\definemathdoubleextensible [\v!both] [overbraceunderbrace] ["23DE] ["23DF]
+\definemathdoubleextensible [\v!both] [overparentunderparent] ["23DC] ["23DD]
+\definemathdoubleextensible [\v!both] [overbracketunderbracket] ["23B4] ["23B5]
-\definemathovertextextensible [\v!bothtext] [overbartext] ["FE33E]
-\definemathundertextextensible [\v!bothtext] [underbartext] ["FE33F]
-\definemathovertextextensible [\v!bothtext] [overbracetext] ["FE3DE]
-\definemathundertextextensible [\v!bothtext] [underbracetext] ["FE3DF]
-\definemathovertextextensible [\v!bothtext] [overparenttext] ["FE3DC]
-\definemathundertextextensible [\v!bothtext] [underparenttext] ["FE3DD]
-\definemathovertextextensible [\v!bothtext] [overbrackettext] ["FE3B4]
-\definemathundertextextensible [\v!bothtext] [underbrackettext] ["FE3B5]
+\definemathovertextextensible [\v!bothtext] [overbartext] ["203E]
+\definemathundertextextensible [\v!bothtext] [underbartext] ["203E]
+\definemathovertextextensible [\v!bothtext] [overbracetext] ["23DE]
+\definemathundertextextensible [\v!bothtext] [underbracetext] ["23DF]
+\definemathovertextextensible [\v!bothtext] [overparenttext] ["23DC]
+\definemathundertextextensible [\v!bothtext] [underparenttext] ["23DD]
+\definemathovertextextensible [\v!bothtext] [overbrackettext] ["23B4]
+\definemathundertextextensible [\v!bothtext] [underbrackettext] ["23B5]
%D Some bonus ones (for the moment here):
@@ -1217,8 +1204,7 @@
\definemathextensible [\v!chemistry] [cleftarrow] ["2190]
\definemathextensible [\v!chemistry] [crightarrow] ["2192]
\definemathextensible [\v!chemistry] [crightoverleftarrow] ["21C4]
-
-% for the moment:
+\definemathextensible [\v!chemistry] [cleftoverrightarrow] ["21C6]
\def\math_stackers_hacked_fill#1#2#3%
{\mathematics
@@ -1227,38 +1213,39 @@
\thickmuskip \zeromuskip
\medmuskip \zeromuskip
\thinmuskip \zeromuskip
- #1%
- \mkern-7\onemuskip
- \cleaders\mathstylehbox{\mkern-2\onemuskip#2\mkern-2\onemuskip}\hfill
- \mkern-7\onemuskip
- #3%
+ \tinymuskip \zeromuskip
+ \pettymuskip \zeromuskip
+ \ifrelax#1%
+ \cleaders\mathstylehbox{#2}\hfill
+ \else
+ #1%
+ \mkern-7\onemuskip
+ \cleaders\mathstylehbox{\mkern-2\onemuskip#2\mkern-2\onemuskip}\hfill
+ \mkern-7\onemuskip
+ #3%
+ \fi
\endgroup}}
-% These will be defined in char-def as well once we have \leaders<number>
-
-\immutable\protected\def\rightarrowfill {\math_stackers_hacked_fill \relbar \relbar \rightarrow}
-\immutable\protected\def\leftarrowfill {\math_stackers_hacked_fill \leftarrow \relbar \relbar }
-\immutable\protected\def\rightoverleftarrowfill{\math_stackers_hacked_fill \ctxdoublearrowfillleftend\ctxdoublearrowfillmiddlepart\ctxdoublearrowfillrightend}
-\immutable\protected\def\equalfill {\math_stackers_hacked_fill \Relbar \Relbar \Relbar}
-\immutable\protected\def\Rightarrowfill {\math_stackers_hacked_fill \Relbar \Relbar \Rightarrow}
-\immutable\protected\def\Leftarrowfill {\math_stackers_hacked_fill \Leftarrow \Relbar \Relbar}
-\immutable\protected\def\Leftrightarrowfill {\math_stackers_hacked_fill \Leftarrow \Relbar \Rightarrow}
-\immutable\protected\def\leftrightarrowfill {\math_stackers_hacked_fill \leftarrow \relbar \rightarrow}
-\immutable\protected\def\mapstofill {\math_stackers_hacked_fill{\mapstochar\relbar} \relbar \rightarrow}
-\immutable\protected\def\twoheadrightarrowfill {\math_stackers_hacked_fill \relbar \relbar \twoheadrightarrow}
-\immutable\protected\def\twoheadleftarrowfill {\math_stackers_hacked_fill \twoheadleftarrow \relbar \relbar}
-\immutable\protected\def\rightharpoondownfill {\math_stackers_hacked_fill \relbar \relbar \rightharpoondown}
-\immutable\protected\def\rightharpoonupfill {\math_stackers_hacked_fill \relbar \relbar \rightharpoonup}
-\immutable\protected\def\leftharpoondownfill {\math_stackers_hacked_fill \leftharpoondown \relbar \relbar}
-\immutable\protected\def\leftharpoonupfill {\math_stackers_hacked_fill \leftharpoonup \relbar \relbar}
-\immutable\protected\def\hookleftfill {\math_stackers_hacked_fill \leftarrow \relbar {\relbar\joinrel\rhook}}
-\immutable\protected\def\hookrightfill {\math_stackers_hacked_fill{\lhook\joinrel\relbar} \relbar \rightarrow}
-\immutable\protected\def\relfill {\math_stackers_hacked_fill \relbar \relbar \relbar}
-\immutable\protected\def\triplerelfill {\math_stackers_hacked_fill \equiv \equiv \equiv}
-
-% \permanent\protected\def\singlebond{{\xrel}} % or \def\singlebond{{\xrel[2]}}
-% \permanent\protected\def\doublebond{{\xequal}}
-% \permanent\protected\def\triplebond{{\xtriplerel}}
+\immutable\protected\def\rightarrowfill {\math_stackers_hacked_fill \relbar \relbar \rightarrow}
+\immutable\protected\def\leftarrowfill {\math_stackers_hacked_fill \leftarrow \relbar \relbar}
+\immutable\protected\def\rightoverleftarrowfill{\math_stackers_hacked_fill \relax \crightoverleftarrow \relax}
+\immutable\protected\def\leftoverrightarrowfill{\math_stackers_hacked_fill \relax \cleftoverrightarrow \relax}
+\immutable\protected\def\equalfill {\math_stackers_hacked_fill \Relbar \Relbar \Relbar}
+\immutable\protected\def\Rightarrowfill {\math_stackers_hacked_fill \Relbar \Relbar \Rightarrow}
+\immutable\protected\def\Leftarrowfill {\math_stackers_hacked_fill \Leftarrow \Relbar \Relbar}
+\immutable\protected\def\Leftrightarrowfill {\math_stackers_hacked_fill \Leftarrow \Relbar \Rightarrow}
+\immutable\protected\def\leftrightarrowfill {\math_stackers_hacked_fill \leftarrow \relbar \rightarrow}
+\immutable\protected\def\mapstofill {\math_stackers_hacked_fill{\mapstochar\relbar} \relbar \rightarrow}
+\immutable\protected\def\twoheadrightarrowfill {\math_stackers_hacked_fill \relbar \relbar \twoheadrightarrow}
+\immutable\protected\def\twoheadleftarrowfill {\math_stackers_hacked_fill \twoheadleftarrow \relbar \relbar}
+\immutable\protected\def\rightharpoondownfill {\math_stackers_hacked_fill \relbar \relbar \rightharpoondown}
+\immutable\protected\def\rightharpoonupfill {\math_stackers_hacked_fill \relbar \relbar \rightharpoonup}
+\immutable\protected\def\leftharpoondownfill {\math_stackers_hacked_fill \leftharpoondown \relbar \relbar}
+\immutable\protected\def\leftharpoonupfill {\math_stackers_hacked_fill \leftharpoonup \relbar \relbar}
+\immutable\protected\def\hookleftfill {\math_stackers_hacked_fill \leftarrow \relbar {\relbar\joinrel\rhook}}
+\immutable\protected\def\hookrightfill {\math_stackers_hacked_fill{\lhook\joinrel\relbar}\relbar \rightarrow}
+\immutable\protected\def\relfill {\math_stackers_hacked_fill \relbar \relbar \relbar}
+\immutable\protected\def\triplerelfill {\math_stackers_hacked_fill \equiv \equiv \equiv}
%D For the moment (needs checking):
@@ -1275,13 +1262,14 @@
\defineextensiblefiller [twoheadleftarrowfill] ["219E]
\defineextensiblefiller [twoheadrightarrowfill] ["21A0]
\defineextensiblefiller [mapstofill] ["21A6]
-%defineextensiblefiller [hookleftarrowfill] ["21A9]
-%defineextensiblefiller [hookrightarrowfill] ["21AA]
+%defineextensiblefiller [hookleftarrowfill] ["21A9] % not in fonts
+%defineextensiblefiller [hookrightarrowfill] ["21AA] % not in fonts
\defineextensiblefiller [leftharpoondownfill] ["21BD]
\defineextensiblefiller [leftharpoonupfill] ["21BC]
\defineextensiblefiller [rightharpoondownfill] ["21C1]
\defineextensiblefiller [rightharpoonupfill] ["21C0]
\defineextensiblefiller [rightoverleftarrowfill] ["21C4]
+\defineextensiblefiller [leftoverrightarrowfill] ["21C6]
%defineextensiblefiller [leftrightharpoonsfill] ["21CB] % yet undefined
%defineextensiblefiller [rightleftharpoonsfill] ["21CC] % yet undefined
\defineextensiblefiller [triplerelfill] ["2261]
@@ -1289,28 +1277,7 @@
\defineextensiblefiller [Leftarrowfill] ["27F8]
\defineextensiblefiller [Rightarrowfill] ["27F9]
\defineextensiblefiller [Leftrightarrowfill] ["27FA]
-%\defineextensiblefiller[Rightleftarrowfill] [.....]
-
-% These are fishy ... we need to check this because now these commands relax (there
-% are some entries in char-def.)
-%
-% %definemathoverextensible [overbarfill] ["FE33E]
-% %definemathunderextensible [underbarfill] ["FE33F]
-% \definemathoverextensible [overbracefill] ["FE3DE]
-% \definemathunderextensible [underbracefill] ["FE3DF]
-% \definemathoverextensible [overparentfill] ["FE3DC]
-% \definemathunderextensible [underparentfill] ["FE3DD]
-% \definemathoverextensible [overbracketfill] ["FE3B4]
-% \definemathunderextensible [underbracketfill] ["FE3B5]
-%
-% %defineextensiblefiller [overbarfill] ["FE33E]
-% %defineextensiblefiller [underbarfill] ["FE33F]
-% \defineextensiblefiller [overbracefill] ["FE3DE]
-% \defineextensiblefiller [underbracefill] ["FE3DF]
-% \defineextensiblefiller [overparentfill] ["FE3DC]
-% \defineextensiblefiller [underparentfill] ["FE3DD]
-% \defineextensiblefiller [overbracketfill] ["FE3B4]
-% \defineextensiblefiller [underbracketfill] ["FE3B5]
+\defineextensiblefiller [Rightleftarrowfill] ["27FA]
%D Extra:
@@ -1326,9 +1293,9 @@
\permanent\tolerant\protected\def\definemathunstacked[#1]#*[#2]#*[#3]% category name unicode
{\ifarguments\or\or
- \frozen\setuevalue{#1}{\math_stackers_unstacked_normal\noexpand\currentmathstackers{\number#2}}%
+ \frozen\protected\edefcsname#1\endcsname{\math_stackers_unstacked_normal\noexpand\currentmathstackers{\number#2}}%
\else
- \frozen\setuevalue{#2}{\math_stackers_unstacked_normal{#1}{\number#3}}%
+ \frozen\protected\edefcsname#2\endcsname{\math_stackers_unstacked_normal{#1}{\number#3}}%
\fi}
\protected\def\math_stackers_unstacked_normal#category#codepoint%
@@ -1338,15 +1305,15 @@
\ifempty\p_moffset \else
\mskip\p_moffset\relax
\fi
- \ifmmode\math_class_by_parameter\mathstackersparameter\else\dontleavehmode\fi
+ \ifmmode\math_atom_by_parameter\mathstackersparameter\else\dontleavehmode\fi
{\usemathstackerscolorparameter\c!color
- \Umathchar\zerocount\defaultmathfamily#codepoint}%
+ \Umathchar\zerocount\zerocount#codepoint}%
\ifempty\p_moffset \else
\mskip\p_moffset\relax
\fi
\endgroup}
-\definemathstackers [\v!wide] [\c!moffset=\thickmuskip,\c!mathclass=\s!rel]
+\definemathstackers [\v!wide] [\c!moffset=\thickmuskip,\c!mathclass=\s!relation]
\definemathunstacked [\v!wide] [And] ["0026] % \mathrel{\;&\;}
\definemathunstacked [\v!wide] [impliedby] ["27F8] % \mathrel{\;\Longleftarrow\;}
@@ -1359,7 +1326,7 @@
[\v!symbol]
[\c!voffset=-.3\mathexheight,
\c!hoffset=\zeropoint,
- \c!mathclass=ord,
+ \c!mathclass=\s!ordinary,
\c!topoffset=.4\mathemwidth, % poor man's italic correction
\c!middlecommand=\mathematics]
@@ -1370,10 +1337,10 @@
% \mathrel{\mathop{\hbox to \dimen0{\hss\copy4\hss}}
% \limits\normalsuperscript{\box0}\normalsubscript{\box2}}%
-% $\Uoverdelimiter \defaultmathfamily "2194 {xxxx}$
-% $\Uunderdelimiter\defaultmathfamily "2194 {xxxx}$
-% $\Udelimiterover \defaultmathfamily "2194 {xxxx}$
-% $\Udelimiterunder\defaultmathfamily "2194 {xxxx}$
-% $\Udelimiterover \defaultmathfamily "219A {\Udelimiterunder \defaultmathfamily "219B {xxxx}}$
+% $\Uoverdelimiter \zerocount "2194 {xxxx}$
+% $\Uunderdelimiter\zerocount "2194 {xxxx}$
+% $\Udelimiterover \zerocount "2194 {xxxx}$
+% $\Udelimiterunder\zerocount "2194 {xxxx}$
+% $\Udelimiterover \zerocount "219A {\Udelimiterunder \zerocount "219B {xxxx}}$
% $a \mathrel{\mathop{\filledhboxr{mid}}}\limits^{\filledhboxg{\strut top}}_{\filledhboxb{\strut bottom}} b$
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-tag.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-tag.lmt
index eb58b5450d5..eaba1ea5421 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/math-tag.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-tag.lmt
@@ -8,8 +8,13 @@ if not modules then modules = { } end modules ['math-tag'] = {
-- todo: have a local list with local tags that then get appended
-- todo: use tex.getmathcodes (no table)
+-- todo: add more spacing details + check text stuff for latest additions
+-- todo: some more font related cleanup + adaption to new scaling
+-- todo: tracing
+-- todo: maybe use lpeg matchers
--- use lpeg matchers
+-- todo: prime
+-- todo: middle in fraction
local find, match = string.find, string.match
local insert, remove, concat = table.insert, table.remove, table.concat
@@ -20,42 +25,48 @@ local nodes = nodes
local nuts = nodes.nuts
local tonut = nuts.tonut
-local getnext = nuts.getnext
-local getid = nuts.getid
local getchar = nuts.getchar
-local getfont = nuts.getfont
+local getprev = nuts.getprev
+local getcharspec = nuts.getcharspec
+local getdata = nuts.getdata
local getlist = nuts.getlist
local getfield = nuts.getfield
local getdisc = nuts.getdisc
-local getsubtype = nuts.getsubtype
local getattr = nuts.getattr
local getattrlist = nuts.getattrlist
local setattr = nuts.setattr
------ getcomponents = nuts.getcomponents -- not really needed
local getwidth = nuts.getwidth
+local getnumerator = nuts.getnumerator
+local getdenominator = nuts.getdenominator
+local getdelimiter = nuts.getdelimiter
+local getleftdelimiter = nuts.getleftdelimiter
+local getrightdelimiter = nuts.getrightdelimiter
+local getdegree = nuts.getdegree
+local gettop = nuts.gettop
+local getbottom = nuts.getbottom
+local getchoice = nuts.getchoice
+
local getnucleus = nuts.getnucleus
-local getsub = nuts.getsub
-local getsup = nuts.getsup
-local set_attributes = nuts.setattributes
+local setattributes = nuts.setattributes
local nextnode = nuts.traversers.node
local nodecodes = nodes.nodecodes
-local noad_code = nodecodes.noad -- attr nucleus sub sup
-local accent_code = nodecodes.accent -- attr nucleus sub sup accent
-local radical_code = nodecodes.radical -- attr nucleus sub sup left degree
-local fraction_code = nodecodes.fraction -- attr nucleus sub sup left right
-local subbox_code = nodecodes.subbox -- attr list
-local submlist_code = nodecodes.submlist -- attr list
-local mathchar_code = nodecodes.mathchar -- attr fam char
-local mathtextchar_code = nodecodes.mathtextchar -- attr fam char
-local delimiter_code = nodecodes.delimiter -- attr small_fam small_char large_fam large_char
-local style_code = nodecodes.style -- attr style
-local choice_code = nodecodes.choice -- attr display text script scriptscript
-local fence_code = nodecodes.fence -- attr subtype
+local noad_code = nodecodes.noad
+local accent_code = nodecodes.accent
+local radical_code = nodecodes.radical
+local fraction_code = nodecodes.fraction
+local subbox_code = nodecodes.subbox
+local submlist_code = nodecodes.submlist
+local mathchar_code = nodecodes.mathchar
+local mathtextchar_code = nodecodes.mathtextchar
+local delimiter_code = nodecodes.delimiter
+local style_code = nodecodes.style
+local choice_code = nodecodes.choice
+local fence_code = nodecodes.fence
local accentcodes = nodes.accentcodes
local fencecodes = nodes.fencecodes
@@ -64,9 +75,10 @@ local fixedtopaccent_code = accentcodes.fixedtop
local fixedbottomaccent_code = accentcodes.fixedbottom
local fixedbothaccent_code = accentcodes.fixedboth
-local leftfence_code = fencecodes.left
-local middlefence_code = fencecodes.middle
-local rightfence_code = fencecodes.right
+local leftfence_code = fencecodes.left
+local middlefence_code = fencecodes.middle
+local rightfence_code = fencecodes.right
+local operatorfence_code = fencecodes.operator
local kerncodes = nodes.kerncodes
@@ -94,12 +106,15 @@ local restart_tagged = tags.restart
local stop_tagged = tags.stop
local taglist = tags.taglist
-local chardata = characters.data
+----- chardata = characters.data
-local getmathcodes = tex.getmathcodes
-local mathcodes = mathematics.codes
-local ordinary_mathcode = mathcodes.ordinary
-local variable_mathcode = mathcodes.variable
+local getmathcodes = tex.getmathcodes
+----- mathcodes = mathematics.codes
+local mathcodes = mathematics.classes
+local ordinary_mathcode = mathcodes.ordinary
+local digit_mathcode = mathcodes.digit
+local punctuation_mathcode = mathcodes.punctuation
+local active_mathcode = mathcodes.active
local fromunicode16 = fonts.mappings.fromunicode16
local fontcharacters = fonts.hashes.characters
@@ -108,19 +123,31 @@ local report_tags = logs.reporter("structure","tags")
local process
+local function processnucleus(nucleus,prime)
+ if prime then
+ -- This should work wasn't it that browser handling of primes have an issue with
+ -- "big semi raised text" vs "small supposedly superscripted". So let's play safe
+ -- and use a superscript. Even then we get somewhat different positioning for the
+ -- same primed character in q sqrt and (e.g.) a sequential integral.
+ -- start_tagged("mrow", { prime = true })
+ start_tagged("msup", { prime = true })
+ process(nucleus)
+ process(prime)
+ stop_tagged()
+ else
+ process(nucleus)
+ end
+end
+
local function processsubsup(start)
-- At some point we might need to add an attribute signaling the
-- super- and subscripts because TeX and MathML use a different
-- order. The mrows are needed to keep mn's separated.
- local nucleus = getnucleus(start)
- local sup = getsup(start)
- local sub = getsub(start)
+ local nucleus, prime, sup, sub, presup, presub = getnucleus(start,true)
if sub then
if sup then
setattr(start,a_tagged,start_tagged("msubsup"))
- -- start_tagged("mrow")
- process(nucleus)
- -- stop_tagged()
+ processnucleus(nucleus,prime)
start_tagged("mrow", { subscript = true })
process(sub)
stop_tagged()
@@ -130,9 +157,7 @@ local function processsubsup(start)
stop_tagged()
else
setattr(start,a_tagged,start_tagged("msub"))
- -- start_tagged("mrow")
- process(nucleus)
- -- stop_tagged()
+ processnucleus(nucleus,prime)
start_tagged("mrow")
process(sub)
stop_tagged()
@@ -140,15 +165,13 @@ local function processsubsup(start)
end
elseif sup then
setattr(start,a_tagged,start_tagged("msup"))
- -- start_tagged("mrow")
- process(nucleus)
- -- stop_tagged()
+ processnucleus(nucleus,prime)
start_tagged("mrow")
process(sup)
stop_tagged()
stop_tagged()
else
- process(nucleus)
+ processnucleus(nucleus,prime)
end
end
@@ -161,17 +184,8 @@ local fencesstack = { }
-- glyph nodes and such can happen in under and over stuff
--- local function getunicode(n) -- instead of getchar
--- local char = getchar(n)
--- -- local font = getfontoffamily(getfield(n,"fam"))
--- local font = getfont(n)
--- local data = fontcharacters[font][char]
--- return data.unicode or char
--- end
-
local function getunicode(n) -- instead of getchar
- -- local char, font = isglyph(n) -- no, we have a mathchar
- local char, font = getchar(n), getfont(n)
+ local char, font = getcharspec(n)
local data = fontcharacters[font][char]
return data.unicode or char -- can be a table but unlikely for math characters
end
@@ -205,17 +219,28 @@ end
-- )
-- end
+-- I need to bring this in sync with new or removed mathml 3, not that there has
+-- been many changes. It will happen in sync with other mathml updates in context
+-- where we also keep adapting to a cycling between either or not support in
+-- browsers, the come-and-go of alternatives like ascii math and mathjax. It's the
+-- web and browser support that drives this, not tex and its community. So, maybe
+-- I'll add some more detail here, nto that it matters much in the long run where we
+-- only focus on structure and let the engine deal with the details. Another reason
+-- to update this is that we can add some tracing (lmtx only).
+
+-- This has been working ok for quite but in 2023 it's time to have a look at it
+-- again and see to what extend we need to adapt to new features. Around the time
+-- PG's Panopticom was put on youtube.
+
process = function(start) -- we cannot use the processor as we have no finalizers (yet)
local mtexttag = nil
- while start do
- local id = getid(start)
--- showtag(start,id,true)
+ for start, id, subtype in nextnode, start do -- current
if id == glyph_code or id == disc_code then
if not mtexttag then
mtexttag = start_tagged("mtext")
end
setattr(start,a_tagged,mtexttag)
- elseif mtexttag and id == kern_code and (getsubtype(start) == fontkern_code or getsubtype(start) == italickern_code) then -- italickern
+ elseif mtexttag and id == kern_code and subtype == fontkern_code or subtype == italickern_code then -- italickern
setattr(start,a_tagged,mtexttag)
else
if mtexttag then
@@ -225,26 +250,48 @@ process = function(start) -- we cannot use the processor as we have no finalizer
if id == mathchar_code then
local char = getchar(start)
local code = getmathcodes(char)
+-- local ch = chardata[char]
+-- local mc = ch and ch.mathclass
local tag
- if code == ordinary_mathcode or code == variable_mathcode then
- local ch = chardata[char]
- local mc = ch and ch.mathclass
- if mc == "number" then
- tag = "mn"
- elseif mc == "variable" or not mc then -- variable is default
- tag = "mi"
- else
- tag = "mo"
- end
+ local properties= { class = code }
+ -- we're a bit early so we can have active here and no rules get applied
+ -- so maybe we have to correct some later on
+ -- todo: we have way more now
+-- if code == ordinary_mathcode then
+-- if mc == "number" then
+-- tag = "mn"
+-- elseif mc == "variable" or not mc then -- variable is default
+-- tag = "mi"
+-- else
+-- tag = "mo"
+-- end
+-- else
+-- tag = "mo"
+-- end
+-- print(code,mathematics.classes[code])
+-- print(ordinary_mathcode,digit_mathcode,active_mathcode)
+ if code == ordinary_mathcode then
+ tag = "mi"
+ elseif code == digit_mathcode then
+ tag = "mn"
+-- elseif code == punctuation_mathcode or code == active_mathcode then
+-- tag = "mo"
else
tag = "mo"
end
+-- if mc == "open" or nc == "close" or mc == "middle" then
+-- properties = { maxsize = 1 }
+-- end
local a = getattr(start,a_mathcategory)
if a then
- setattr(start,a_tagged,start_tagged(tag,{ mathcategory = a }))
- else
- setattr(start,a_tagged,start_tagged(tag)) -- todo: a_mathcategory
+ -- todo / redo
+ if properties then
+ properties.mathcategory = a
+ else
+ properties = { mathcategory = a }
+ end
end
+ setattr(start,a_tagged,start_tagged(tag,properties))
stop_tagged()
-- showtag(start,id,false)
break -- okay?
@@ -287,7 +334,8 @@ process = function(start) -- we cannot use the processor as we have no finalizer
process(list)
end
else
- if tag ~= "mstackertop" and tag ~= "mstackermid" and tag ~= "mstackerbot" then
+if tag ~= "mtable" and tag ~= "mstackertop" and tag ~= "mstackermid" and tag ~= "mstackerbot" then
+-- if tag ~= "mstackertop" and tag ~= "mstackermid" and tag ~= "mstackerbot" then
tag = "mtext"
end
local text = start_tagged(tag)
@@ -297,7 +345,7 @@ process = function(start) -- we cannot use the processor as we have no finalizer
-- empty list
elseif not attr then
-- box comes from strange place
- set_attributes(list,a_tagged,text) -- only the first node ?
+ setattributes(list,a_tagged,text) -- only the first node ?
else
-- Beware, the first node in list is the actual list so we definitely
-- need to nest. This approach is a hack, maybe I'll make a proper
@@ -314,12 +362,12 @@ process = function(start) -- we cannot use the processor as we have no finalizer
-- local keep = { } -- win case we might need to move keep outside
for n, id, subtype in nextnode, list do
local mth = id == math_code and subtype
- if mth == 0 then -- hm left_code
- -- insert(keep,text)
- keep = text
- text = start_tagged("mrow")
- common = common + 1
- end
+if mth == 0 then -- begin in line
+ -- insert(keep,text)
+ keep = text
+ text = start_tagged("mrow")
+ common = common + 1
+end
local aa = getattr(n,a_tagged)
if aa then
local ac = cache[aa]
@@ -363,12 +411,12 @@ process = function(start) -- we cannot use the processor as we have no finalizer
runner(replace,depth+1)
end
end
- if mth == 1 then
- stop_tagged()
- -- text = remove(keep)
- text = keep
- common = common - 1
- end
+if mth == 1 then -- end in line
+ stop_tagged()
+ -- text = remove(keep)
+ text = keep
+ common = common - 1
+end
end
end
runner(list,0)
@@ -419,10 +467,13 @@ process = function(start) -- we cannot use the processor as we have no finalizer
end
end
elseif id == fraction_code then
- local num = getfield(start,"num")
- local denom = getfield(start,"denom")
- local left = getfield(start,"left")
- local right = getfield(start,"right")
+ --
+ -- if middle then we have a stacker!
+ --
+ local num = getnumerator(start)
+ local denom = getdenominator(start)
+ local left = getleftdelimiter(start)
+ local right = getrightdelimiter(start)
if left then
setattr(left,a_tagged,start_tagged("mo"))
process(left)
@@ -438,10 +489,10 @@ process = function(start) -- we cannot use the processor as we have no finalizer
stop_tagged()
end
elseif id == choice_code then
- local display = getfield(start,"display")
- local text = getfield(start,"text")
- local script = getfield(start,"script")
- local scriptscript = getfield(start,"scriptscript")
+ local display = getchoice(start,1)
+ local text = getchoice(start,2)
+ local script = getchoice(start,3)
+ local scriptscript = getchoice(start,4)
if display then
process(display)
end
@@ -455,29 +506,27 @@ process = function(start) -- we cannot use the processor as we have no finalizer
process(scriptscript)
end
elseif id == fence_code then
- local subtype = getsubtype(start)
- local delim = getfield(start,"delimiter")
+ local delimiter = getdelimiter(start)
+-- print(subtype,fencecodes[subtype],delimiter)
if subtype == leftfence_code then
- -- left
local properties = { }
insert(fencesstack,properties)
setattr(start,a_tagged,start_tagged("mfenced",properties)) -- needs checking
- if delim then
+ if delimiter then
start_tagged("ignore")
- local chr = getchar(delim)
+ local chr = getchar(delimiter)
if chr ~= 0 then
properties.left = chr
end
- process(delim)
+ process(delimiter)
stop_tagged()
end
start_tagged("mrow") -- begin of subsequence
elseif subtype == middlefence_code then
- -- middle
- if delim then
+ if delimiter then
start_tagged("ignore")
local top = fencesstack[#fencesstack]
- local chr = getchar(delim)
+ local chr = getchar(delimiter)
if chr ~= 0 then
local mid = top.middle
if mid then
@@ -486,7 +535,7 @@ process = function(start) -- we cannot use the processor as we have no finalizer
top.middle = { chr }
end
end
- process(delim)
+ process(delimiter)
stop_tagged()
end
stop_tagged() -- end of subsequence
@@ -497,28 +546,46 @@ process = function(start) -- we cannot use the processor as we have no finalizer
report_tags("missing right fence")
properties = { }
end
- if delim then
+ if delimiter then
start_tagged("ignore")
- local chr = getchar(delim)
+ local chr = getchar(delimiter)
if chr ~= 0 then
properties.right = chr
end
- process(delim)
+ process(delimiter)
stop_tagged()
end
stop_tagged() -- end of subsequence
stop_tagged()
- else
- -- can't happen
+ elseif subtype == operatorfence_code then
+ -- the same as left but different key
+ local properties = { }
+ insert(fencesstack,properties)
+ setattr(start,a_tagged,start_tagged("mfenced",properties)) -- needs checking
+ if delimiter then
+ local chr = getchar(delimiter)
+ if chr ~= 0 then
+ properties.operator = chr
+ end
+ process(delimiter)
+ end
+ processsubsup(start)
+ start_tagged("mrow") -- begin of subsequence
end
elseif id == radical_code then
- local left = getfield(start,"left")
- local degree = getfield(start,"degree")
+ local left = getleftdelimiter(start)
+ local right = getrightdelimiter(start)
+ local degree = getdegree(start)
if left then
start_tagged("ignore")
process(left) -- root symbol, ignored
stop_tagged()
end
+ if right then
+ start_tagged("ignore")
+ process(lright) -- actuarian symbol, ignored
+ stop_tagged()
+ end
if degree and hascontent(degree) then
setattr(start,a_tagged,start_tagged("mroot"))
processsubsup(start)
@@ -530,55 +597,58 @@ process = function(start) -- we cannot use the processor as we have no finalizer
stop_tagged()
end
elseif id == accent_code then
- local subtype = getsubtype(start)
- local accent = getfield(start,"accent")
- local bot_accent = getfield(start,"bot_accent")
- if bot_accent then
- if accent then
+ local topaccent = gettop(start)
+ local bottomaccent = getbottom(start)
+ if bottomaccent then
+ if topaccent then
setattr(start,a_tagged,start_tagged("munderover", {
accent = true,
- top = getunicode(accent),
- bottom = getunicode(bot_accent),
+ top = getunicode(topaccent),
+ bottom = getunicode(bottomaccent),
topfixed = subtype == fixedtopaccent_code or subtype == fixedbothaccent_code,
bottomfixed = subtype == fixedbottomaccent_code or subtype == fixedbothaccent_code,
}))
processsubsup(start)
- process(bot_accent)
- process(accent)
+ process(bottomaccent)
+ process(topaccent)
stop_tagged()
else
setattr(start,a_tagged,start_tagged("munder", {
accent = true,
- bottom = getunicode(bot_accent),
+ bottom = getunicode(bottomaccent),
bottomfixed = subtype == fixedbottomaccent_code or subtype == fixedbothaccent_code,
}))
processsubsup(start)
- process(bot_accent)
+ process(bottomaccent)
stop_tagged()
end
- elseif accent then
+ elseif topaccent then
setattr(start,a_tagged,start_tagged("mover", {
accent = true,
- top = getunicode(accent),
+ top = getunicode(topaccent),
topfixed = subtype == fixedtopaccent_code or subtype == fixedbothaccent_code,
}))
processsubsup(start)
- process(accent)
+ process(topaccent)
stop_tagged()
else
processsubsup(start)
end
elseif id == glue_code then
- -- setattr(start,a_tagged,start_tagged("mspace",{ width = getwidth(start) }))
- setattr(start,a_tagged,start_tagged("mspace"))
+ -- before processing, so other intermathglue is not tagged
+ local em = fonts.hashes.emwidths[nuts.getfont(start)]
+ local wd = getwidth(start)
+ if em and wd then
+ setattr(start,a_tagged,start_tagged("mspace",{ emfactor = wd/em }))
+ end
stop_tagged()
else
- setattr(start,a_tagged,start_tagged("merror", { detail = nodecodes[i] }))
+ --rule boundary
+ setattr(start,a_tagged,start_tagged("merror", { detail = nodecodes[id] }))
stop_tagged()
end
end
-- showtag(start,id,false)
- start = getnext(start)
end
if mtexttag then
stop_tagged()
@@ -594,3 +664,96 @@ function noads.handlers.tags(head,style,penalties)
stop_tagged()
stop_tagged()
end
+
+do
+
+ -- This one is meant for tracing (in m4all/m4mbo where it complements some other
+ -- tracing) but it actually can also replace the embedding feature although that
+ -- one might be better when we have more complex code with dependencies outside
+ -- the blob. I'll deal with that when it's needed (trivial). The current
+ -- interface is rather minimalistic.
+
+ local enabled = false
+ local export = false
+ local allmath = false
+ local warned = false
+
+ function mathematics.startcollecting()
+ if structures.tags.enabled() then
+ if not enabled then
+ nodes.tasks.enableaction("math", "noads.handlers.export")
+ end
+ enabled = true
+ export = structures.tags.localexport
+ allmath = { }
+ elseif not warned then
+ report_tags("math collecting only works when tagging is enabled")
+ warned = true
+ end
+ end
+
+ function mathematics.stopcollecting()
+ export = false
+ end
+
+ local function collected(asstring)
+ local a = allmath or { }
+ return asstring and concat(a) or a
+ end
+
+ mathematics.collected = collected
+
+ interfaces.implement {
+ name = "startcollectingmath",
+ -- public = true,
+ protected = true,
+ actions = mathematics.startcollecting
+ }
+
+ interfaces.implement {
+ name = "stopcollectingmath",
+ -- public = true,
+ protected = true,
+ actions = mathematics.stopcollecting
+ }
+
+ interfaces.implement {
+ name = "processcollectedmath",
+ -- public = true,
+ protected = true,
+ arguments = "2 strings",
+ actions = function(filename,buffername)
+ if filename and filename ~= "" then
+ io.savedata(filename,collected(true))
+ elseif buffername then
+ buffers.assign(buffername == interfaces.variables.yes and "" or buffername,collected(true))
+ else
+ return collected
+ end
+ end
+ }
+
+ interfaces.implement {
+ name = "collectedmath",
+ usage = "value",
+ protected = true,
+ public = true,
+ actions = function(what)
+ if what == "value" then
+ return tokens.values.integer, allmath and #allmath or 0
+ else
+ context(allmath and allmath[tokens.scanners.integer()] or nil)
+ end
+ end
+ }
+
+ function noads.handlers.export(head)
+ if export then
+ allmath[#allmath+1] = export(head)
+ end
+ return head
+ end
+
+ nodes.tasks.appendaction("math", "finalizers", "noads.handlers.export", nil, "nonut", "disabled")
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-toy.mkxl b/Master/texmf-dist/tex/context/base/mkxl/math-toy.mkxl
index 510872e3b62..34ea6f38c02 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/math-toy.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-toy.mkxl
@@ -20,16 +20,16 @@
%D \starttyping
%D \enabletrackers[math.toysymbol]
%D
-%D \definemathtoysymbol[Plus] [bin][+]
-%D \definemathtoysymbol[Minus][bin][-]
-%D \definemathtoysymbol[Equal][rel][=]
+%D \definemathtoysymbol[Plus] [binary] [+]
+%D \definemathtoysymbol[Minus][binary] [-]
+%D \definemathtoysymbol[Equal][relation][=]
%D
%D $\dorecurse{199}{x_{#1} \ifodd#1\relax\Plus\else\Minus\fi} x_{200} \Equal n$ \blank
%D \stoptyping
\permanent\tolerant\protected\def\definemathtoysymbol[#1]#*[#2]#*[#3]%
{\ifarguments\or\or\or
- \setuevalue{#1}{\math_toy_define_symbol_indeed{\mathcodechecked{#2}}{#3}}%
+ \protected\instance\edefcsname#1\endcsname{\math_toy_define_symbol_indeed{\mathcodechecked{#2}}{#3}}%
\fi}
\protected\def\math_toy_define_symbol_traced#1#2%
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-ttv.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-ttv.lmt
new file mode 100644
index 00000000000..3393ecc0391
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-ttv.lmt
@@ -0,0 +1,584 @@
+if not modules then modules = { } end modules ['math-ttv'] = {
+ version = 1.001,
+ comment = "traditional tex vectors, companion to math-vfu.lua",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files",
+ dataonly = true,
+}
+
+local vfmath = fonts.handlers.vf.math
+local setletters = vfmath.setletters
+local setdigits = vfmath.setdigits
+
+local mathencodings = fonts.encodings.math
+
+local nps = fonts.helpers.newprivateslot
+
+-- mathencodings["large-to-small-private"] = {
+-- [0xFE07A] = 0x7A, -- bracehtipdownleft
+-- [0xFE07B] = 0x7B, -- bracehtipdownright
+-- [0xFE07C] = 0x7C, -- bracehtipupleft
+-- [0xFE07D] = 0x7D, -- bracehtipupright
+-- }
+
+mathencodings["large-to-small-private"] = {
+ [nps("ul brace piece")] = 0x7A, -- bracehtipdownleft
+ [nps("ur brace piece")] = 0x7B, -- bracehtipdownright
+ [nps("ll brace piece")] = 0x7C, -- bracehtipupleft
+ [nps("lr brace piece")] = 0x7D, -- bracehtipupright
+}
+
+-- mathencodings["extensible-jmn-private"] = {
+-- [0xFE080] = 200, -- minusjmn
+-- [0xFE081] = 201, -- minusrightjmn
+-- [0xFE082] = 202, -- minusleftjmn
+-- [0xFE083] = 203, -- equaljmn
+-- [0xFE084] = 204, -- equalrightjmn
+-- [0xFE085] = 205, -- equalleftjmn
+-- [0xFE086] = 206, -- arrowleftjmn
+-- [0xFE087] = 207, -- arrowrightjmn
+-- [0xFE088] = 208, -- arrowdblleftjmn
+-- [0xFE089] = 209, -- arrowdblrightjmn
+-- }
+
+-- mathencodings["extensible-jmn-private"] = {
+-- [nps("rule middle piece")] = 200, -- minusjmn
+-- [nps("rule right piece")] = 201, -- minusrightjmn
+-- [nps("rule left piece")] = 202, -- minusleftjmn
+-- [nps("double rule middle piece")] = 203, -- equaljmn
+-- [nps("double rule right piece")] = 204, -- equalrightjmn
+-- [nps("double rule left piece")] = 205, -- equalleftjmn
+-- [nps("arrow left piece")] = 206, -- arrowleftjmn
+-- [nps("arrow right piece")] = 207, -- arrowrightjmn
+-- [nps("double arrow left piece")] = 208, -- arrowdblleftjmn
+-- [nps("double arrow right piece")] = 209, -- arrowdblrightjmn
+-- }
+
+-- varphi is part of the alphabet, contrary to the other var*s'
+
+mathencodings["large-to-small"] = {
+ [0x00028] = 0x00, -- (
+ [0x00029] = 0x01, -- )
+ [0x0005B] = 0x02, -- [
+ [0x0005D] = 0x03, -- ]
+ [0x0230A] = 0x04, -- lfloor
+ [0x0230B] = 0x05, -- rfloor
+ [0x02308] = 0x06, -- lceil
+ [0x02309] = 0x07, -- rceil
+ [0x0007B] = 0x08, -- {
+ [0x0007D] = 0x09, -- }
+ [0x027E8] = 0x0A, -- <
+ [0x027E9] = 0x0B, -- >
+ [0x0007C] = 0x0C, -- |
+ -- [0x0] = 0x0D, -- lVert rVert Vert
+ -- [0x0002F] = 0x0E, -- /
+ [0x0005C] = 0x0F, -- \
+ -- [0x0] = 0x3A, -- lgroup
+ -- [0x0] = 0x3B, -- rgroup
+ -- [0x0] = 0x3C, -- arrowvert
+ -- [0x0] = 0x3D, -- Arrowvert
+ [0x02195] = 0x3F, -- updownarrow
+ -- [0x0] = 0x40, -- lmoustache
+ -- [0x0] = 0x41, -- rmoustache
+ [0x0221A] = 0x70, -- sqrt
+ [0x021D5] = 0x77, -- Updownarrow
+ [0x02191] = 0x78, -- uparrow
+ [0x02193] = 0x79, -- downarrow
+ [0x021D1] = 0x7E, -- Uparrow
+ [0x021D3] = 0x7F, -- Downarrow
+ [0x0220F] = 0x59, -- prod
+ [0x02210] = 0x61, -- coprod
+ [0x02211] = 0x58, -- sum
+ [0x0222B] = 0x5A, -- intop
+ [0x0222E] = 0x49, -- ointop
+ [0x00302] = 0x62, -- widehat
+ [0x00303] = 0x65, -- widetilde
+ [0x022C0] = 0x5E, -- bigwedge
+ [0x022C1] = 0x5F, -- bigvee
+ [0x022C2] = 0x5C, -- bigcap
+ [0x022C3] = 0x5B, -- bigcup
+ [0x02044] = 0x0E, -- /
+}
+
+-- Beware: these are (in cm/lm) below the baseline due to limitations
+-- in the tfm format but the engine (combined with the mathclass) takes
+-- care of it. If we need them in textmode, we should make them virtual
+-- and move them up but we're in no hurry with that.
+
+mathencodings["tex-ex"] = {
+ [0x0220F] = 0x51, -- prod
+ [0x02210] = 0x60, -- coprod
+ [0x02211] = 0x50, -- sum
+ [0x0222B] = 0x52, -- intop
+ [0x0222E] = 0x48, -- ointop
+ [0x022C0] = 0x56, -- bigwedge
+ [0x022C1] = 0x57, -- bigvee
+ [0x022C2] = 0x54, -- bigcap
+ [0x022C3] = 0x53, -- bigcup
+ [0x02A00] = 0x4A, -- bigodot -- fixed BJ
+ [0x02A01] = 0x4C, -- bigoplus
+ [0x02A02] = 0x4E, -- bigotimes
+ -- [0x02A03] = , -- bigudot --
+ [0x02A04] = 0x55, -- biguplus
+ [0x02A06] = 0x46, -- bigsqcup
+}
+
+-- only math stuff is needed, since we always use an lm or gyre
+-- font as main font
+
+mathencodings["tex-mr"] = {
+ [0x00393] = 0x00, -- Gamma
+ [0x00394] = 0x01, -- Delta
+ [0x00398] = 0x02, -- Theta
+ [0x0039B] = 0x03, -- Lambda
+ [0x0039E] = 0x04, -- Xi
+ [0x003A0] = 0x05, -- Pi
+ [0x003A3] = 0x06, -- Sigma
+ [0x003A5] = 0x07, -- Upsilon
+ [0x003A6] = 0x08, -- Phi
+ [0x003A8] = 0x09, -- Psi
+ [0x003A9] = 0x0A, -- Omega
+-- [0x00060] = 0x12, -- [math]grave
+-- [0x000B4] = 0x13, -- [math]acute
+-- [0x002C7] = 0x14, -- [math]check
+-- [0x002D8] = 0x15, -- [math]breve
+-- [0x000AF] = 0x16, -- [math]bar
+-- [0x00021] = 0x21, -- !
+ [0x00028] = 0x28, -- (
+ [0x00029] = 0x29, -- )
+ [0x0002B] = 0x2B, -- +
+ [0x0002F] = 0x2F, -- /
+ [0x0003A] = 0x3A, -- :
+ [0x02236] = 0x3A, -- colon
+ [0x0003B] = 0x3B, -- ;
+ [0x0003C] = 0x3C, -- <
+ [0x0003D] = 0x3D, -- =
+ [0x0003E] = 0x3E, -- >
+ [0x0003F] = 0x3F, -- ?
+ [0x00391] = 0x41, -- Alpha
+ [0x00392] = 0x42, -- Beta
+ [0x02145] = 0x44,
+ [0x00395] = 0x45, -- Epsilon
+ [0x00397] = 0x48, -- Eta
+ [0x00399] = 0x49, -- Iota
+ [0x0039A] = 0x4B, -- Kappa
+ [0x0039C] = 0x4D, -- Mu
+ [0x0039D] = 0x4E, -- Nu
+ [0x0039F] = 0x4F, -- Omicron
+ [0x003A1] = 0x52, -- Rho
+ [0x003A4] = 0x54, -- Tau
+ [0x003A7] = 0x58, -- Chi
+ [0x00396] = 0x5A, -- Zeta
+ [0x0005B] = 0x5B, -- [
+ [0x0005D] = 0x5D, -- ]
+-- [0x0005E] = 0x5E, -- [math]hat -- the text one
+ [0x00302] = 0x5E, -- [math]hat -- the real math one
+-- [0x002D9] = 0x5F, -- [math]dot
+ [0x02146] = 0x64,
+ [0x02147] = 0x65,
+-- [0x002DC] = 0x7E, -- [math]tilde -- the text one
+ [0x00303] = 0x7E, -- [math]tilde -- the real one
+-- [0x000A8] = 0x7F, -- [math]ddot
+}
+
+mathencodings["tex-mr-missing"] = {
+ [0x02236] = 0x3A, -- colon
+}
+
+mathencodings["tex-ex-braces"] = {
+ [0x0007B] = 0x7B, -- {, braceleftbig
+ [0x0007D] = 0x7D, -- }, bracerightbig
+}
+
+mathencodings["tex-mi"] = {
+ [0x1D6E4] = 0x00, -- Gamma
+ [0x1D6E5] = 0x01, -- Delta
+ [0x1D6E9] = 0x02, -- Theta
+ [0x1D6F3] = 0x02, -- varTheta (not present in TeX)
+ [0x1D6EC] = 0x03, -- Lambda
+ [0x1D6EF] = 0x04, -- Xi
+ [0x1D6F1] = 0x05, -- Pi
+ [0x1D6F4] = 0x06, -- Sigma
+ [0x1D6F6] = 0x07, -- Upsilon
+ [0x1D6F7] = 0x08, -- Phi
+ [0x1D6F9] = 0x09, -- Psi
+ [0x1D6FA] = 0x0A, -- Omega
+ [0x1D6FC] = 0x0B, -- alpha
+ [0x1D6FD] = 0x0C, -- beta
+ [0x1D6FE] = 0x0D, -- gamma
+ [0x1D6FF] = 0x0E, -- delta
+ [0x1D716] = 0x0F, -- epsilon TODO: 1D716
+ [0x1D701] = 0x10, -- zeta
+ [0x1D702] = 0x11, -- eta
+ [0x1D703] = 0x12, -- theta TODO: 1D703
+ [0x1D704] = 0x13, -- iota
+ [0x1D705] = 0x14, -- kappa
+ [0x1D718] = 0x14, -- varkappa, not in tex fonts
+ [0x1D706] = 0x15, -- lambda
+ [0x1D707] = 0x16, -- mu
+ [0x1D708] = 0x17, -- nu
+ [0x1D709] = 0x18, -- xi
+ [0x1D70B] = 0x19, -- pi
+ [0x1D70C] = 0x1A, -- rho
+ [0x1D70E] = 0x1B, -- sigma
+ [0x1D70F] = 0x1C, -- tau
+ [0x1D710] = 0x1D, -- upsilon
+ [0x1D719] = 0x1E, -- phi
+ [0x1D712] = 0x1F, -- chi
+ [0x1D713] = 0x20, -- psi
+ [0x1D714] = 0x21, -- omega
+ [0x1D700] = 0x22, -- varepsilon (the other way around)
+ [0x1D717] = 0x23, -- vartheta
+ [0x1D71B] = 0x24, -- varpi
+ [0x1D71A] = 0x25, -- varrho
+ [0x1D70D] = 0x26, -- varsigma
+ [0x1D711] = 0x27, -- varphi (the other way around)
+ [0x021BC] = 0x28, -- leftharpoonup
+ [0x021BD] = 0x29, -- leftharpoondown
+ [0x021C0] = 0x2A, -- rightharpoonup
+ [0x021C1] = 0x2B, -- rightharpoondown
+-- [0xFE322] = 0x2C, -- lhook (hook for combining arrows)
+-- [0xFE323] = 0x2D, -- rhook (hook for combining arrows)
+ [nps("left hook piece")] = 0x2C, -- bracehtipdownleft
+ [nps("right hook piece")] = 0x2D, -- bracehtipdownleft
+ [0x025B7] = 0x2E, -- triangleright : cf lmmath / BJ
+ [0x025C1] = 0x2F, -- triangleleft : cf lmmath / BJ
+ [0x022B3] = 0x2E, -- triangleright : cf lmmath this a cramped triangles / BJ / see *
+ [0x022B2] = 0x2F, -- triangleleft : cf lmmath this a cramped triangles / BJ / see *
+-- [0x00041] = 0x30, -- 0
+-- [0x00041] = 0x31, -- 1
+-- [0x00041] = 0x32, -- 2
+-- [0x00041] = 0x33, -- 3
+-- [0x00041] = 0x34, -- 4
+-- [0x00041] = 0x35, -- 5
+-- [0x00041] = 0x36, -- 6
+-- [0x00041] = 0x37, -- 7
+-- [0x00041] = 0x38, -- 8
+-- [0x00041] = 0x39, -- 9
+--~ [0x0002E] = 0x3A, -- .
+ [0x0002C] = 0x3B, -- ,
+ [0x0003C] = 0x3C, -- <
+-- [0x0002F] = 0x3D, -- /, slash, solidus
+ [0x02044] = 0x3D, -- / AM: Not sure
+ [0x0003E] = 0x3E, -- >
+ [0x022C6] = 0x3F, -- star
+ [0x02202] = 0x40, -- partial
+--
+ [0x0266D] = 0x5B, -- flat
+ [0x0266E] = 0x5C, -- natural
+ [0x0266F] = 0x5D, -- sharp
+ [0x02323] = 0x5E, -- smile
+ [0x02322] = 0x5F, -- frown
+ [0x02113] = 0x60, -- ell
+--
+ [0x1D6A4] = 0x7B, -- imath (TODO: also 0131)
+ [0x1D6A5] = 0x7C, -- jmath (TODO: also 0237)
+ [0x02118] = 0x7D, -- wp
+ [0x020D7] = 0x7E, -- vec (TODO: not sure)
+-- 0x7F, -- (no idea what that could be)
+}
+
+mathencodings["tex-it"] = {
+-- [0x1D434] = 0x41, -- A
+ [0x1D6E2] = 0x41, -- Alpha
+-- [0x1D435] = 0x42, -- B
+ [0x1D6E3] = 0x42, -- Beta
+-- [0x1D436] = 0x43, -- C
+-- [0x1D437] = 0x44, -- D
+-- [0x1D438] = 0x45, -- E
+ [0x1D6E6] = 0x45, -- Epsilon
+-- [0x1D439] = 0x46, -- F
+-- [0x1D43A] = 0x47, -- G
+-- [0x1D43B] = 0x48, -- H
+ [0x1D6E8] = 0x48, -- Eta
+-- [0x1D43C] = 0x49, -- I
+ [0x1D6EA] = 0x49, -- Iota
+-- [0x1D43D] = 0x4A, -- J
+-- [0x1D43E] = 0x4B, -- K
+ [0x1D6EB] = 0x4B, -- Kappa
+-- [0x1D43F] = 0x4C, -- L
+-- [0x1D440] = 0x4D, -- M
+ [0x1D6ED] = 0x4D, -- Mu
+-- [0x1D441] = 0x4E, -- N
+ [0x1D6EE] = 0x4E, -- Nu
+-- [0x1D442] = 0x4F, -- O
+ [0x1D6F0] = 0x4F, -- Omicron
+-- [0x1D443] = 0x50, -- P
+ [0x1D6F2] = 0x50, -- Rho
+-- [0x1D444] = 0x51, -- Q
+-- [0x1D445] = 0x52, -- R
+-- [0x1D446] = 0x53, -- S
+-- [0x1D447] = 0x54, -- T
+ [0x1D6F5] = 0x54, -- Tau
+-- [0x1D448] = 0x55, -- U
+-- [0x1D449] = 0x56, -- V
+-- [0x1D44A] = 0x57, -- W
+-- [0x1D44B] = 0x58, -- X
+ [0x1D6F8] = 0x58, -- Chi
+-- [0x1D44C] = 0x59, -- Y
+-- [0x1D44D] = 0x5A, -- Z
+--
+-- [0x1D44E] = 0x61, -- a
+-- [0x1D44F] = 0x62, -- b
+-- [0x1D450] = 0x63, -- c
+-- [0x1D451] = 0x64, -- d
+-- [0x1D452] = 0x65, -- e
+-- [0x1D453] = 0x66, -- f
+-- [0x1D454] = 0x67, -- g
+-- [0x1D455] = 0x68, -- h
+ [0x0210E] = 0x68, -- Planck constant (h)
+-- [0x1D456] = 0x69, -- i
+-- [0x1D457] = 0x6A, -- j
+-- [0x1D458] = 0x6B, -- k
+-- [0x1D459] = 0x6C, -- l
+-- [0x1D45A] = 0x6D, -- m
+-- [0x1D45B] = 0x6E, -- n
+-- [0x1D45C] = 0x6F, -- o
+ [0x1D70A] = 0x6F, -- omicron
+-- [0x1D45D] = 0x70, -- p
+-- [0x1D45E] = 0x71, -- q
+-- [0x1D45F] = 0x72, -- r
+-- [0x1D460] = 0x73, -- s
+-- [0x1D461] = 0x74, -- t
+-- [0x1D462] = 0x75, -- u
+-- [0x1D463] = 0x76, -- v
+-- [0x1D464] = 0x77, -- w
+-- [0x1D465] = 0x78, -- x
+-- [0x1D466] = 0x79, -- y
+-- [0x1D467] = 0x7A, -- z
+}
+
+mathencodings["tex-tf"] = { }
+mathencodings["tex-ss"] = { }
+mathencodings["tex-tt"] = { }
+mathencodings["tex-bf"] = { }
+mathencodings["tex-bi"] = { }
+mathencodings["tex-fraktur"] = { }
+mathencodings["tex-fraktur-bold"] = { }
+
+mathencodings["tex-sy"] = {
+ [0x0002D] = 0x00, -- -
+ [0x02212] = 0x00, -- -
+-- [0x02201] = 0x00, -- complement
+-- [0x02206] = 0x00, -- increment
+-- [0x02204] = 0x00, -- not exists
+-- [0x000B7] = 0x01, -- cdot
+ [0x022C5] = 0x01, -- cdot
+ [0x000D7] = 0x02, -- times
+ [0x0002A] = 0x03, -- *
+ [0x02217] = 0x03, -- *
+ [0x000F7] = 0x04, -- div
+ [0x022C4] = 0x05, -- diamond
+ [0x000B1] = 0x06, -- pm
+ [0x02213] = 0x07, -- mp
+ [0x02295] = 0x08, -- oplus
+ [0x02296] = 0x09, -- ominus
+ [0x02297] = 0x0A, -- otimes
+ [0x02298] = 0x0B, -- oslash
+ [0x02299] = 0x0C, -- odot
+ [0x025EF] = 0x0D, -- bigcirc, Orb (either 25EF or 25CB) -- todo
+ [0x02218] = 0x0E, -- circ
+ [0x02219] = 0x0F, -- bullet
+ [0x02022] = 0x0F, -- bullet
+ [0x0224D] = 0x10, -- asymp
+ [0x02261] = 0x11, -- equiv
+ [0x02286] = 0x12, -- subseteq
+ [0x02287] = 0x13, -- supseteq
+ [0x02264] = 0x14, -- leq
+ [0x02265] = 0x15, -- geq
+ [0x02AAF] = 0x16, -- preceq
+-- [0x0227C] = 0x16, -- preceq, AM:No see 2AAF
+ [0x02AB0] = 0x17, -- succeq
+-- [0x0227D] = 0x17, -- succeq, AM:No see 2AB0
+ [0x0223C] = 0x18, -- sim
+ [0x02248] = 0x19, -- approx
+ [0x02282] = 0x1A, -- subset
+ [0x02283] = 0x1B, -- supset
+ [0x0226A] = 0x1C, -- ll
+ [0x0226B] = 0x1D, -- gg
+ [0x0227A] = 0x1E, -- prec
+ [0x0227B] = 0x1F, -- succ
+ [0x02190] = 0x20, -- leftarrow
+ [0x02192] = 0x21, -- rightarrow
+--~ [0xFE190] = 0x20, -- leftarrow
+--~ [0xFE192] = 0x21, -- rightarrow
+ [0x02191] = 0x22, -- uparrow
+ [0x02193] = 0x23, -- downarrow
+ [0x02194] = 0x24, -- leftrightarrow
+ [0x02197] = 0x25, -- nearrow
+ [0x02198] = 0x26, -- searrow
+ [0x02243] = 0x27, -- simeq
+ [0x021D0] = 0x28, -- Leftarrow
+ [0x021D2] = 0x29, -- Rightarrow
+ [0x021D1] = 0x2A, -- Uparrow
+ [0x021D3] = 0x2B, -- Downarrow
+ [0x021D4] = 0x2C, -- Leftrightarrow
+ [0x02196] = 0x2D, -- nwarrow
+ [0x02199] = 0x2E, -- swarrow
+ [0x0221D] = 0x2F, -- propto
+ [0x02032] = 0x30, -- prime
+ [0x0221E] = 0x31, -- infty
+ [0x02208] = 0x32, -- in
+ [0x0220B] = 0x33, -- ni
+ [0x025B3] = 0x34, -- triangle, bigtriangleup
+ [0x025BD] = 0x35, -- bigtriangledown
+ [0x00338] = 0x36, -- not
+-- 0x37, -- (beginning of arrow)
+ [0x02200] = 0x38, -- forall
+ [0x02203] = 0x39, -- exists
+ [0x000AC] = 0x3A, -- neg, lnot
+ [0x02205] = 0x3B, -- empty set
+ [0x0211C] = 0x3C, -- Re
+ [0x02111] = 0x3D, -- Im
+ [0x022A4] = 0x3E, -- top
+ [0x022A5] = 0x3F, -- bot, perp
+ [0x02135] = 0x40, -- aleph
+ [0x1D49C] = 0x41, -- script A
+ [0x0212C] = 0x42, -- script B
+ [0x1D49E] = 0x43, -- script C
+ [0x1D49F] = 0x44, -- script D
+ [0x02130] = 0x45, -- script E
+ [0x02131] = 0x46, -- script F
+ [0x1D4A2] = 0x47, -- script G
+ [0x0210B] = 0x48, -- script H
+ [0x02110] = 0x49, -- script I
+ [0x1D4A5] = 0x4A, -- script J
+ [0x1D4A6] = 0x4B, -- script K
+ [0x02112] = 0x4C, -- script L
+ [0x02133] = 0x4D, -- script M
+ [0x1D4A9] = 0x4E, -- script N
+ [0x1D4AA] = 0x4F, -- script O
+ [0x1D4AB] = 0x50, -- script P
+ [0x1D4AC] = 0x51, -- script Q
+ [0x0211B] = 0x52, -- script R
+ [0x1D4AE] = 0x53, -- script S
+ [0x1D4AF] = 0x54, -- script T
+ [0x1D4B0] = 0x55, -- script U
+ [0x1D4B1] = 0x56, -- script V
+ [0x1D4B2] = 0x57, -- script W
+ [0x1D4B3] = 0x58, -- script X
+ [0x1D4B4] = 0x59, -- script Y
+ [0x1D4B5] = 0x5A, -- script Z
+ [0x0222A] = 0x5B, -- cup
+ [0x02229] = 0x5C, -- cap
+ [0x0228E] = 0x5D, -- uplus
+ [0x02227] = 0x5E, -- wedge, land
+ [0x02228] = 0x5F, -- vee, lor
+ [0x022A2] = 0x60, -- vdash
+ [0x022A3] = 0x61, -- dashv
+ [0x0230A] = 0x62, -- lfloor
+ [0x0230B] = 0x63, -- rfloor
+ [0x02308] = 0x64, -- lceil
+ [0x02309] = 0x65, -- rceil
+ [0x0007B] = 0x66, -- {, lbrace
+ [0x0007D] = 0x67, -- }, rbrace
+ [0x027E8] = 0x68, -- <, langle
+ [0x027E9] = 0x69, -- >, rangle
+ [0x0007C] = 0x6A, -- |, mid, lvert, rvert
+ [0x02225] = 0x6B, -- parallel
+ -- [0x0 ] = 0x00, -- Vert, lVert, rVert, arrowvert, Arrowvert
+ [0x02195] = 0x6C, -- updownarrow
+ [0x021D5] = 0x6D, -- Updownarrow
+ [0x0005C] = 0x6E, -- \, backslash, setminus
+ [0x02216] = 0x6E, -- setminus
+ [0x02240] = 0x6F, -- wr
+ [0x0221A] = 0x70, -- sqrt. AM: Check surd??
+ [0x02A3F] = 0x71, -- amalg
+ [0x1D6FB] = 0x72, -- nabla
+-- [0x0222B] = 0x73, -- smallint (TODO: what about intop?)
+ [0x02294] = 0x74, -- sqcup
+ [0x02293] = 0x75, -- sqcap
+ [0x02291] = 0x76, -- sqsubseteq
+ [0x02292] = 0x77, -- sqsupseteq
+ [0x000A7] = 0x78, -- S
+ [0x02020] = 0x79, -- dagger, dag
+ [0x02021] = 0x7A, -- ddagger, ddag
+ [0x000B6] = 0x7B, -- P
+ [0x02663] = 0x7C, -- clubsuit
+ [0x02662] = 0x7D, -- diamondsuit
+ [0x02661] = 0x7E, -- heartsuit
+ [0x02660] = 0x7F, -- spadesuit
+ -- [0xFE321] = 0x37, -- mapstochar
+ -- [0xFE325] = 0x30, -- prime 0x02032
+ [nps("maps to piece")] = 0x37, -- mapstochar
+}
+
+mathencodings["tex-fraktur"] = {
+-- [0x1D504] = 0x41, -- A (fraktur A)
+-- [0x1D505] = 0x42, -- B
+ [0x0212D] = 0x43, -- C
+-- [0x1D507] = 0x44, -- D
+-- [0x1D508] = 0x45, -- E
+-- [0x1D509] = 0x46, -- F
+-- [0x1D50A] = 0x47, -- G
+ [0x0210C] = 0x48, -- H
+ [0x02111] = 0x49, -- I
+-- [0x1D50D] = 0x4A, -- J
+-- [0x1D50E] = 0x4B, -- K
+-- [0x1D50F] = 0x4C, -- L
+-- [0x1D510] = 0x4D, -- M
+-- [0x1D511] = 0x4E, -- N
+-- [0x1D512] = 0x4F, -- O
+-- [0x1D513] = 0x50, -- P
+-- [0x1D514] = 0x51, -- Q
+ [0x0211C] = 0x52, -- R
+-- [0x1D516] = 0x53, -- S
+-- [0x1D517] = 0x54, -- T
+-- [0x1D518] = 0x55, -- U
+-- [0x1D519] = 0x56, -- V
+-- [0x1D51A] = 0x57, -- W
+-- [0x1D51B] = 0x58, -- X
+-- [0x1D51C] = 0x59, -- Y
+ [0x02128] = 0x5A, -- Z (fraktur Z)
+-- [0x1D51E] = 0x61, -- a (fraktur a)
+-- [0x1D51F] = 0x62, -- b
+-- [0x1D520] = 0x63, -- c
+-- [0x1D521] = 0x64, -- d
+-- [0x1D522] = 0x65, -- e
+-- [0x1D523] = 0x66, -- f
+-- [0x1D524] = 0x67, -- g
+-- [0x1D525] = 0x68, -- h
+-- [0x1D526] = 0x69, -- i
+-- [0x1D527] = 0x6A, -- j
+-- [0x1D528] = 0x6B, -- k
+-- [0x1D529] = 0x6C, -- l
+-- [0x1D52A] = 0x6D, -- m
+-- [0x1D52B] = 0x6E, -- n
+-- [0x1D52C] = 0x6F, -- o
+-- [0x1D52D] = 0x70, -- p
+-- [0x1D52E] = 0x71, -- q
+-- [0x1D52F] = 0x72, -- r
+-- [0x1D530] = 0x73, -- s
+-- [0x1D531] = 0x74, -- t
+-- [0x1D532] = 0x75, -- u
+-- [0x1D533] = 0x76, -- v
+-- [0x1D534] = 0x77, -- w
+-- [0x1D535] = 0x78, -- x
+-- [0x1D536] = 0x79, -- y
+-- [0x1D537] = 0x7A, -- z
+}
+
+-- now that all other vectors are defined ...
+
+setletters(mathencodings, "tex-tf", 0x00041, 0x00061)
+setletters(mathencodings, "tex-mr", 0x00041, 0x00061)
+
+setletters(mathencodings, "tex-it", 0x1D434, 0x1D44E)
+setletters(mathencodings, "tex-ss", 0x1D5A0, 0x1D5BA)
+setletters(mathencodings, "tex-tt", 0x1D670, 0x1D68A)
+setletters(mathencodings, "tex-bf", 0x1D400, 0x1D41A)
+setletters(mathencodings, "tex-bi", 0x1D468, 0x1D482)
+setletters(mathencodings, "tex-fraktur", 0x1D504, 0x1D51E)
+setletters(mathencodings, "tex-fraktur-bold", 0x1D56C, 0x1D586)
+
+setdigits (mathencodings, "tex-mr", 0x00030)
+setdigits (mathencodings, "tex-tf", 0x00030)
+setdigits (mathencodings, "tex-ss", 0x1D7E2)
+setdigits (mathencodings, "tex-tt", 0x1D7F6)
+setdigits (mathencodings, "tex-bf", 0x1D7CE)
+
+-- setdigits (mathencodings, "tex-bi", 0x1D7CE)
+
+-- todo: add ss, tt, bf etc vectors
+-- todo: we can make ss tt etc an option
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-twk.mkxl b/Master/texmf-dist/tex/context/base/mkxl/math-twk.mkxl
new file mode 100644
index 00000000000..6ffb3681840
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-twk.mkxl
@@ -0,0 +1,99 @@
+ %D \module
+%D [ file=math-ini,
+%D version=2022.07.24,
+%D title=\CONTEXT\ Math Macros,
+%D subtitle=Extensions aka Tweaks,
+%D author={Hans Hagen \& Mikael Sundqvist},
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%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 Math Macros / Tweaks}
+
+%D This file deals with some ommisions in \UNICODE\ (at least we flag them as such).
+%D Some of the definitione done elsewhere will be moved here.
+
+\unprotect
+
+% Mathematics - Hollie + Metropole Orkest (conducted by Jules Buckley) .. more than minusses
+
+% \startbuffer
+% \startTEXpage[offset=2dk]\showmakeup[mathglue]\mathspacingmode1 % \tracingmath3\tracingonline2
+% $ a + - 1 $ \quad
+% $ - 2 $ \quad
+% $ \um 3 $ \quad
+% $ a + \um 4 $ \par
+% $ \ump 3 $ \quad
+% $ a + \ump 4 $ \quad
+% $ \up 5 $ \par
+% $ a - \up 6 $ \quad
+% $ \upm 5 $ \quad
+% $ a - \upm 6 $ \quad
+% \par
+% $\textstyle - + \um \up \upm \ump $ \quad
+% $\scriptstyle - + \um \up \upm \ump $ \quad
+% $\scriptscriptstyle - + \um \up \upm \ump $ \quad
+% \stopTEXpage
+% \stopbuffer
+%
+% \setupbodyfont[bonum] \getbuffer
+% \setupbodyfont[pagella] \getbuffer
+
+\immutable\Umathchardef \unaryminus \mathunarycode \zerocount \privatecharactercode{unary minus}
+\immutable\Umathchardef \unaryplus \mathunarycode \zerocount \privatecharactercode{unary plus}
+\immutable\Umathchardef \unaryplusminus \mathunarycode \zerocount \privatecharactercode{unary plus minus}
+\immutable\Umathchardef \unaryminusplus \mathunarycode \zerocount \privatecharactercode{unary minus plus}
+
+\permanent\protected\def\um {\mathortext\unaryminus \textminus}
+\permanent\protected\def\up {\mathortext\unaryplus \textplus}
+\permanent\protected\def\upm{\mathortext\unaryplusminus\textpm}
+\permanent\protected\def\ump{\mathortext\unaryminusplus\textmp}
+
+\permanent\protected\def\una#1{\mathatom \s!class \mathunarycode {#1}}
+\permanent\protected\def\bin#1{\mathatom \s!class \mathbinarycode {#1}}
+\permanent\protected\def\rel#1{\mathatom \s!class \mathrelationcode{#1}}
+\permanent\protected\def\ord#1{\mathatom \s!class \mathordinarycode{#1}}
+
+% $x + \+1$\par
+% $x + \-1$\par
+
+\immutable\Umathchardef\mathunaryplus \mathunarycode\zerocount"002B % these will go to char-def.lua
+\immutable\Umathchardef\mathunaryminus \mathunarycode\zerocount"2212 % these will go to char-def.lua
+\immutable\Umathchardef\mathunaryplusminus\mathunarycode\zerocount"00B1 % these will go to char-def.lua
+\immutable\Umathchardef\mathunaryminusplus\mathunarycode\zerocount"2213 % these will go to char-def.lua
+
+\permanent\protected\def\+{\mathortext\mathunaryplus \textplus }
+%permanent\protected\def\-{\mathortext\mathunaryminus \textminus }
+\permanent\protected\def\-{\mathortext\mathunaryminus \explicitdiscretionary}
+\permanent\protected\def\±{\mathortext\mathunaryplusminus\textpm}
+\permanent\protected\def\∓{\mathortext\mathunaryminusplus\textmp}
+
+% \permanent\protected\def\minute{\hbox shift -.8ex{$\char"2032$}}
+% \permanent\protected\def\second{\hbox shift -.8ex{$\char"2033$}}
+%
+% \permanent\protected\def\minute{$\char\privatecharactercode{prime 0x2032 1}$}
+% \permanent\protected\def\second{$\char\privatecharactercode{prime 0x2033 1}$}
+%
+% \permanent\protected\def\minute{$\Umathchar\zerocount\zerocount\privatecharactercode{prime 0x2032 1}$}
+% \permanent\protected\def\second{$\Umathchar\zerocount\zerocount\privatecharactercode{prime 0x2033 1}$}
+%
+% \immutable\Umathchardef\minute\zerocount\zerocount\privatecharactercode{prime 0x2032 1}
+% \immutable\Umathchardef\second\zerocount\zerocount\privatecharactercode{prime 0x2033 1}
+
+\immutable\chardef\textminute"2032
+\immutable\chardef\textsecond"2033
+
+% \immutable\Umathchardef\mathminute\zerocount\zerocount\privatecharactercode{prime 0x2032 1}
+% \immutable\Umathchardef\mathsecond\zerocount\zerocount\privatecharactercode{prime 0x2033 1}
+
+\immutable\Umathchardef\mathminute\zerocount\zerocount\textminute
+\immutable\Umathchardef\mathsecond\zerocount\zerocount\textsecond
+
+\permanent\protected\def\minute{\iffontchar\font\textminute\textminute\else\mathminute\fi}
+\permanent\protected\def\second{\iffontchar\font\textsecond\textsecond\else\mathsecond\fi}
+
+
+\protect
diff --git a/Master/texmf-dist/tex/context/base/mkxl/math-vfu.lmt b/Master/texmf-dist/tex/context/base/mkxl/math-vfu.lmt
index 6584b0158d5..f3e0ea81425 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/math-vfu.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/math-vfu.lmt
@@ -9,16 +9,22 @@ if not modules then modules = { } end modules ['math-vfu'] = {
-- All these math vectors .. thanks to Aditya and Mojca they become better and
-- better. If you have problems with math fonts or miss characters report it to the
-- ConTeXt mailing list. Also thanks to Boguslaw for finding a couple of errors.
--- This mechanism will eventually disappear.
--- 20D6 -> 2190
--- 20D7 -> 2192
+-- Although this mechanism was a candidate for obsolence, the fact that Iwona and
+-- Antykwa are nice fonts (especially for display) I decided to keep it around but
+-- in a bit upgraded way. It is also a test for virtual tfm/pfb fonts that we keep
+-- around but hardly gets tested. However, much is still pretty old code, dating
+-- from when we emulated \UNICODE\ math and \OPENTYPE\ math fonts using traditional
+-- fonts.
+
+-- Musical timestamp: Januari 2023 Riverside ID.Entity release date, after all we
+-- only use the following code for ther Polish Iwona, Kurier and Antykwa fonts.
local type, next, tonumber = type, next, tonumber
local max = math.max
-local fastcopy = table.copy
+local fastcopy, sortedhash = table.copy, table.sortedhash
-local fonts, nodes, mathematics = fonts, nodes, mathematics
+local fonts, mathematics = fonts, mathematics
local trace_virtual = false trackers.register("math.virtual", function(v) trace_virtual = v end)
local trace_timings = false trackers.register("math.timings", function(v) trace_timings = v end)
@@ -39,566 +45,547 @@ local vfmath = allocate()
fonts.handlers.vf.math = vfmath
local helpers = fonts.helpers
+
+local addprivate = helpers.addprivate
+local hasprivate = helpers.hasprivate
local vfcommands = helpers.commands
+
local rightcommand = vfcommands.right
local leftcommand = vfcommands.left
local downcommand = vfcommands.down
local upcommand = vfcommands.up
local push = vfcommands.push
local pop = vfcommands.pop
-
-local shared = { }
-
--- local back = { "slot", 1, 0x2215 }
---
--- local function negate(main,characters,id,size,unicode,basecode)
--- if not characters[unicode] then
--- local basechar = characters[basecode]
--- if basechar then
--- local ht, wd = basechar.height, basechar.width
--- characters[unicode] = {
--- width = wd,
--- height = ht,
--- depth = basechar.depth,
--- italic = basechar.italic,
--- kerns = basechar.kerns,
--- commands = {
--- { "slot", 1, basecode },
--- push,
--- downcommand[ht/5],
--- leftcommand[wd/2],
--- back,
--- push,
--- }
--- }
--- end
--- end
--- end
---
--- \Umathchardef\braceld="0 "1 "FF07A
--- \Umathchardef\bracerd="0 "1 "FF07B
--- \Umathchardef\bracelu="0 "1 "FF07C
--- \Umathchardef\braceru="0 "1 "FF07D
-
-local function brace(main,characters,id,size,unicode,first,rule,left,right,rule,last)
- if not characters[unicode] then
- characters[unicode] = {
- horiz_variants = {
- { extender = 0, glyph = first },
- { extender = 1, glyph = rule },
- { extender = 0, glyph = left },
- { extender = 0, glyph = right },
- { extender = 1, glyph = rule },
- { extender = 0, glyph = last },
- }
- }
- end
-end
-
-local function extension(main,characters,id,size,unicode,first,middle,last)
- local chr = characters[unicode]
- if not chr then
- return -- skip
- end
- local fw = characters[first]
- if not fw then
- return
- end
- local mw = characters[middle]
- if not mw then
- return
- end
- local lw = characters[last]
- if not lw then
- return
- end
- fw = fw.width
- mw = mw.width
- lw = lw.width
- if fw == 0 then
- fw = 1
- end
- if lw == 0 then
- lw = 1
- end
- chr.horiz_variants = {
- { extender = 0, glyph = first, ["end"] = fw/2, start = 0, advance = fw },
- { extender = 1, glyph = middle, ["end"] = mw/2, start = mw/2, advance = mw },
- { extender = 0, glyph = last, ["end"] = 0, start = lw/2, advance = lw },
- }
-end
-
-local function parent(main,characters,id,size,unicode,first,rule,last)
- if not characters[unicode] then
- characters[unicode] = {
- horiz_variants = {
- { extender = 0, glyph = first },
- { extender = 1, glyph = rule },
- { extender = 0, glyph = last },
- }
- }
+local slotcommand = vfcommands.slot
+local staycommand = vfcommands.stay
+
+local nps = fonts.helpers.newprivateslot
+local ps = fonts.helpers.privateslot
+
+do
+
+ local function horibar(main,unicode,rule,left,right,normal)
+ local characters = main.characters
+ if not characters[unicode] then
+ local height = main.mathparameters.defaultrulethickness or 4*65536/10
+ local f_rule = rule and formatters["M-HORIBAR-RULE-%H"](rule)
+ local p_rule = rule and hasprivate(main,f_rule)
+ if rule and left and right and normal then
+ local ldata = characters[left]
+ local mdata = characters[rule]
+ local rdata = characters[right]
+ local ndata = characters[normal]
+ local lwidth = ldata.width or 0
+ local mwidth = mdata.width or 0
+ local rwidth = rdata.width or 0
+ local nwidth = ndata.width or 0
+ local down = (mdata.height / 2) - height
+ --
+ local f_left = right and formatters["M-HORIBAR-LEFT-%H"](right)
+ local f_right = right and formatters["M-HORIBAR-RIGHT-%H"](right)
+ local p_left = left and hasprivate(main,f_left)
+ local p_right = right and hasprivate(main,f_right)
+ --
+ if not characters[p_rule] then
+ p_rule = addprivate(main,f_rule,{
+ height = height,
+ width = mwidth,
+ width = .95*mwidth,
+ commands = {
+ push,
+ leftcommand[.025*mwidth],
+ downcommand[down],
+ slotcommand[0][rule],
+ pop,
+ },
+ })
+ end
+ if not characters[p_left] then
+ p_left = addprivate(main,f_left,{
+ height = height,
+ width = lwidth,
+ width = .95*lwidth,
+ commands = {
+ push,
+ leftcommand[.025*lwidth],
+ downcommand[down],
+ slotcommand[0][left],
+ pop,
+ },
+ })
+ end
+ if not characters[p_right] then
+ p_right = addprivate(main,f_right,{
+ height = height,
+ width = rwidth,
+ width = .95*rwidth,
+ commands = {
+ push,
+ leftcommand[.025*rwidth],
+ downcommand[down],
+ slotcommand[0][right],
+ pop,
+ },
+ })
+ end
+ characters[unicode] = {
+ keepvirtual = true,
+ partsorientation = "horizontal",
+ height = height,
+ width = nwidth,
+ commands = {
+ downcommand[down],
+ slotcommand[0][normal]
+ },
+ parts = {
+ { glyph = p_left, ["end"] = 0.4*lwidth },
+ { glyph = p_rule, extender = 1, ["start"] = mwidth, ["end"] = mwidth },
+ { glyph = p_right, ["start"] = 0.6*rwidth },
+ }
+ }
+ else
+ local width = main.parameters.quad/4 or 4*65536
+ if not characters[p_rule] then
+ p_rule = addprivate(main,f_rule,{
+ height = height,
+ width = width,
+ commands = { push, { "rule", height, width }, pop },
+ })
+ end
+ characters[unicode] = {
+ keepvirtual = true,
+ partsorientation = "horizontal",
+ parts = {
+ { glyph = p_rule },
+ { glyph = p_rule, extender = 1, ["start"] = width/2, ["end"] = width/2 },
+ }
+ }
+ end
+ end
end
-end
-local step = 0.2 -- 0.1 is nicer but gives larger files
-
-local function make(main,characters,id,size,n,m)
- local old = 0xFF000 + n
- local c = characters[old]
- if c then
- local upslot = 0xFF100 + n
- local dnslot = 0xFF200 + n
- local uprule = 0xFF300 + m
- local dnrule = 0xFF400 + m
- local xu = main.parameters.x_height + 0.3*size
- local xd = 0.3*size
- local w = c.width or 0
- local h = c.height or 0
- local d = c.depth or 0
- local thickness = h - d
- local rulewidth = step*size -- we could use an overlap
- local slot = { "slot", id, old }
- local rule = { "rule", thickness, rulewidth }
- local up = upcommand[xu]
- local dn = downcommand[xd]
- local ht = xu + 3*thickness
- local dp = 0
- if not characters[uprule] then
- characters[uprule] = {
- width = rulewidth,
- height = ht,
- depth = dp,
- commands = { push, up, rule, pop },
- }
- end
- characters[upslot] = {
- width = w,
- height = ht,
- depth = dp,
- commands = { push, up, slot, pop },
- }
- local ht = 0
- local dp = xd + 3*thickness
- if not characters[dnrule] then
- characters[dnrule] = {
- width = rulewidth,
- height = ht,
- depth = dp,
- commands = { push, dn, rule, pop }
- }
+ -- local rootbarmiddle -- false = addprivate(main,formatters["M-R-%H"](next))
+ -- local rootbarright -- false = addprivate(main,formatters["M-R-%H"](next))
+
+ local function rootbar(main,unicode,rule,right,normal)
+ local characters = main.characters
+ if not characters[unicode] then
+ local height = main.mathparameters.defaultrulethickness or 4*65536/10
+ if rule and right and normal then
+ local mdata = characters[rule]
+ local rdata = characters[right]
+ local ndata = characters[normal]
+ local mwidth = mdata.width or 0
+ local rwidth = rdata.width or 0
+ local nwidth = ndata.width or 0
+ local down = (mdata.height / 2) - height
+ --
+ local f_rule = rule and formatters["M-ROOTBAR-RULE-%H"](rule)
+ local f_right = right and formatters["M-ROOTBAR-RIGHT-%H"](right)
+ local p_rule = rule and hasprivate(main,f_rule)
+ local p_right = right and hasprivate(main,f_right)
+ --
+ if not p_rule then
+ p_rule = addprivate(main,f_rule,{
+ height = height,
+ width = .95*mwidth,
+ commands = {
+ push,
+ leftcommand[.05*mwidth],
+ downcommand[down],
+ slotcommand[0][rule],
+ pop,
+ },
+ })
+ end
+ if right and not p_right then
+ p_right = addprivate(main,p_right,{
+ height = height,
+ width = .95*rwidth,
+ commands = {
+ push,
+ leftcommand[.05*rwidth],
+ downcommand[down],
+ slotcommand[0][right],
+ pop,
+ },
+ })
+ end
+ characters[unicode] = {
+ keepvirtual = true,
+ partsorientation = "horizontal",
+ height = height,
+ width = rwidth,
+ commands = {
+ slotcommand[0][p_right],
+ },
+ parts = {
+ { glyph = p_rule, extender = 1, ["start"] = mwidth, ["end"] = 0.9*mwidth },
+ { glyph = p_right, ["start"] = 0.6*rwidth },
+ }
+ }
+ end
end
- characters[dnslot] = {
- width = w,
- height = ht,
- depth = dp,
- commands = { push, dn, slot, pop },
- }
end
-end
-local function clipped(main,characters,id,size,unicode,original) -- push/pop needed?
- local minus = characters[original]
- if minus then
- local mu = size/18
- local step = 3*mu
- local width = minus.width
- if width > step then
- width = width - step
- step = step / 2
- else
- width = width / 2
- step = width
+ local function parent(main,unicode,first,rule,last,where)
+ local characters = main.characters
+ local chardata = characters[unicode]
+ if characters[unicode] then
+ local template = characters[first]
+ if template then
+ if not characters[rule] then
+ local xheight = main.mathparameters.xheight
+ local width = template.width / 4
+ local height = template.height
+ local depth = template.depth
+ local rheight = where == "top" and height or 3*height
+ local rdepth = where == "top" and 2*height or 0
+ characters[rule] = {
+ height = rheight,
+ depth = rdepth,
+ width = width,
+ commands = { push, { "rule", height, width }, pop },
+ }
+ characters[first].depth = rdepth
+ characters[last] .depth = rdepth
+ while true do
+ chardata.height = chardata.height - xheight
+ chardata.depth = 0
+ chardata.yoffset = -xheight
+ local next = chardata.next
+ if next then
+ unicode = next
+ chardata = characters[unicode]
+ else
+ break
+ end
+ end
+ end
+ chardata.keepvirtual = true
+ chardata.partsorientation = "horizontal"
+ chardata.parts = {
+ { glyph = first },
+ { glyph = rule, extender = 1 },
+ { glyph = last },
+ }
+ end
end
- characters[unicode] = {
- width = width,
- height = minus.height,
- depth = minus.depth,
- commands = {
- push,
- leftcommand[step],
- { "slot", id, original },
- pop,
- }
- }
end
-end
-local function raise(main,characters,id,size,unicode,private,n,id_of_smaller) -- this is a real fake mess
- local raised = fonts.hashes.characters[main.fonts[id_of_smaller].id][private] -- characters[private]
- if raised then
- local up = 0.85 * main.parameters.x_height
- local slot = { "slot", id_of_smaller, private }
- local commands = {
- push, upcommand[up], slot,
- }
- for i=2,n do
- commands[#commands+1] = slot
+ local function brace(main,unicode,first,rule,left,right,rule,last)
+ local characters = main.characters
+ local chardata = characters[unicode]
+ if chardata then
+ local template = characters[first]
+ if template then
+ if not characters[rule] then
+ local xheight = main.mathparameters.xheight
+ local width = template.width / 4
+ local height = template.height
+ local depth = template.depth
+ local rheight = 3*height
+ local rdepth = 2*height
+ characters[rule] = {
+ height = rheight,
+ depth = rdepth,
+ width = width,
+ commands = { push, { "rule", height, width }, pop },
+ }
+ characters[first].depth = rdepth
+ characters[last] .depth = rdepth
+ characters[left] .height = rheight
+ characters[right].height = rheight
+ while true do
+ chardata.height = chardata.height - xheight
+ chardata.depth = 0
+ chardata.yoffset = -xheight
+ local next = chardata.next
+ if next then
+ unicode = next
+ chardata = characters[unicode]
+ else
+ break
+ end
+ end
+ end
+ chardata.keepvirtual = true
+ chardata.partsorientation = "horizontal"
+ chardata.parts = {
+ { glyph = first },
+ { glyph = rule, extender = 1 },
+ { glyph = left },
+ { glyph = right },
+ { glyph = rule, extender = 1 },
+ { glyph = last },
+ }
+ end
end
- commands[#commands+1] = pop
- characters[unicode] = {
- width = n * raised.width,
- height = (raised.height or 0) + up,
- depth = (raised.depth or 0) - up,
- italic = raised.italic,
- commands = commands,
- }
end
-end
-local function dots(main,characters,id,size,unicode)
- local c = characters[0x002E]
- if c then
- local w = c.width
- local h = c.height
- local d = c.depth
- local mu = size/18
- local right3mu = rightcommand[3*mu]
- local right1mu = rightcommand[1*mu]
- local up1size = upcommand[.1*size]
- local up4size = upcommand[.4*size]
- local up7size = upcommand[.7*size]
- local right2muw = rightcommand[2*mu + w]
- local slot = { "slot", id, 0x002E }
- if unicode == 0x22EF then
- local c = characters[0x022C5]
- if c then
- local width = c.width
- local height = c.height
- local depth = c.depth
- local slot = { "slot", id, 0x022C5 }
+ local function dots(main,unicode)
+ local characters = main.characters
+ local c = characters[0x002E]
+ if c then
+ local w = c.width
+ local h = c.height
+ local d = c.depth
+ local size = main.parameters.size
+ local mu = size/18
+ local right3mu = rightcommand[3*mu]
+ local right1mu = rightcommand[1*mu]
+ local up1size = upcommand[.1*size]
+ local up4size = upcommand[.4*size]
+ local up7size = upcommand[.7*size]
+ local right2muw = rightcommand[2*mu + w]
+ local slot = slotcommand[0][0x002E]
+ if unicode == 0x22EF then
+ local c = characters[0x022C5]
+ if c then
+ local width = c.width
+ local height = c.height
+ local depth = c.depth
+ local slot = slotcommand[0][0x022C5]
+ -- local stay = staycommand[0x022C5]
+ -- local right3mu = rightcommand[width+3*mu]
+ characters[unicode] = {
+ width = 3*width + 2*3*mu,
+ height = height,
+ depth = depth,
+ commands = {
+ slot, right3mu, slot, right3mu, slot,
+ -- push, slot, right3mu, slot, right3mu, slot, pop,
+ -- stay, right3mu, stay, right3mu, stay,
+ }
+ }
+ end
+ elseif unicode == 0x22EE then
characters[unicode] = {
- width = 3*width + 2*3*mu,
- height = height,
- depth = depth,
+ width = w,
+ height = h+0.8*size,
+ depth = 0,
commands = {
- push, slot, right3mu, slot, right3mu, slot, pop,
+ -- push, push, slot, pop, up4size, push, slot, pop, up4size, slot, pop,
+ push, slot, pop, up4size, push, slot, pop, up4size, slot,
}
}
- end
- elseif unicode == 0x22EE then
- -- weird height !
- characters[unicode] = {
- width = w,
- height = h+(1.4)*size,
- depth = 0,
- commands = {
- push, push, slot, pop, up4size, push, slot, pop, up4size, slot, pop,
+ elseif unicode == 0x22F1 then
+ characters[unicode] = {
+ width = 3*w + 6*size/18,
+ height = h+0.7*size,
+ depth = 0,
+ commands = {
+ -- push,
+ right1mu,
+ push, up7size, slot, pop,
+ right2muw,
+ push, up4size, slot, pop,
+ right2muw,
+ push, up1size, slot, pop,
+ right1mu,
+ -- pop
+ }
}
- }
- elseif unicode == 0x22F1 then
+ elseif unicode == 0x22F0 then
+ characters[unicode] = {
+ width = 3*w + 6*size/18,
+ height = h+0.7*size,
+ depth = 0,
+ commands = {
+ -- push,
+ right1mu,
+ push, up1size, slot, pop,
+ right2muw,
+ push, up4size, slot, pop,
+ right2muw,
+ push, up7size, slot, pop,
+ right1mu,
+ -- pop
+ }
+ }
+ else
+ characters[unicode] = {
+ width = 3*w + 2*3*mu,
+ height = h,
+ depth = d,
+ commands = {
+ -- push, slot, right3mu, slot, right3mu, slot, pop,
+ slot, right3mu, slot, right3mu, slot,
+ }
+ }
+ end
+ end
+ end
+
+ local function jointwo(main,unicode,u1,d12,u2)
+ local characters = main.characters
+ local c1 = characters[u1]
+ local c2 = characters[u2]
+ if c1 and c2 then
+ local w1 = c1.width
+ local w2 = c2.width
+ local width
+ if d12 == false then
+ d12 = 0
+ width = w2
+ elseif d12 < 0 then
+ d12 = d12 * w2
+ width = w2
+ else
+ d12 = d12 * main.parameters.size/18 -- mu
+ width = w1 + w2 - d12
+ end
characters[unicode] = {
- width = 3*w + 6*size/18,
- height = 1.5*size,
- depth = 0,
+ width = width,
+ height = max(c1.height or 0, c2.height or 0),
+ depth = max(c1.depth or 0, c2.depth or 0),
commands = {
- push,
- right1mu,
- push, up7size, slot, pop,
- right2muw,
- push, up4size, slot, pop,
- right2muw,
- push, up1size, slot, pop,
- right1mu,
- pop
- }
+ -- { "inspect" },
+ -- { "trace" },
+ slotcommand[0][u1],
+ -- { "trace" },
+ d12 ~= 0 and leftcommand[d12] or false,
+ slotcommand[0][u2],
+ -- { "trace" },
+ },
}
- elseif unicode == 0x22F0 then
+ end
+ end
+
+ local function overlaytwo(main,unicode,u1,factor,u2) -- not ...
+ local characters = main.characters
+ local c1 = characters[u1]
+ local c2 = characters[u2]
+ if c1 and c2 then
+ local width = c2.width
characters[unicode] = {
- width = 3*w + 6*size/18,
- height = 1.5*size,
- depth = 0,
+ width = width,
+ height = max(c1.height or 0, c2.height or 0),
+ depth = max(c1.depth or 0, c2.depth or 0),
commands = {
push,
- right1mu,
- push, up1size, slot, pop,
- right2muw,
- push, up4size, slot, pop,
- right2muw,
- push, up7size, slot, pop,
- right1mu,
- pop
- }
+ slotcommand[0][u2], -- =
+ pop,
+ factor ~= 0 and rightcommand[factor*width] or false,
+ slotcommand[0][u1], -- /
+ },
}
- else
+ end
+ end
+
+ local function jointhree(main,unicode,u1,d12,u2,d23,u3)
+ local characters = main.characters
+ local c1 = characters[u1]
+ local c2 = characters[u2]
+ local c3 = characters[u3]
+ if c1 and c2 and c3 then
+ local w1 = c1.width
+ local w2 = c2.width
+ local w3 = c3.width
+ local mu = main.parameters.size/18
+ d12 = d12 * ds
+ d23 = d23 * ds
characters[unicode] = {
- width = 3*w + 2*3*mu,
- height = h,
- depth = d,
+ width = w1 + w2 + w3 - d12 - d23,
+ height = max(c1.height or 0, c2.height or 0, c3.height or 0),
+ depth = max(c1.depth or 0, c2.depth or 0, c3.depth or 0),
commands = {
- push, slot, right3mu, slot, right3mu, slot, pop,
+ -- push,
+ slotcommand[0][u1],
+ -- pop,
+ d12 ~= 0 and leftcommand[d12] or false,
+ -- push,
+ slotcommand[0][u2],
+ -- pop,
+ d23 ~= 0 and leftcommand[d23] or false,
+ -- push,
+ slotcommand[0][u3],
+ -- pop,
}
}
end
end
-end
-
-local function vertbar(main,characters,id,size,parent,scale,unicode)
- local cp = characters[parent]
- if cp then
- local sc = scale * size
- local pc = { "slot", id, parent }
- characters[unicode] = {
- width = cp.width,
- height = cp.height + sc,
- depth = cp.depth + sc,
- next = cp.next, -- can be extensible
- commands = {
- push, upcommand [sc], pc, pop,
- push, downcommand[sc], pc, pop,
- pc,
- },
- }
- cp.next = unicode
- end
-end
-
-local function jointwo(main,characters,id,size,unicode,u1,d12,u2,what)
- local c1 = characters[u1]
- local c2 = characters[u2]
- if c1 and c2 then
- local w1 = c1.width
- local w2 = c2.width
- local mu = size/18
- characters[unicode] = {
- width = w1 + w2 - d12 * mu,
- height = max(c1.height or 0, c2.height or 0),
- depth = max(c1.depth or 0, c2.depth or 0),
- commands = {
- { "slot", id, u1 },
- leftcommand[d12*mu],
- { "slot", id, u2 },
- },
- }
- end
-end
-local function jointhree(main,characters,id,size,unicode,u1,d12,u2,d23,u3)
- local c1 = characters[u1]
- local c2 = characters[u2]
- local c3 = characters[u3]
- if c1 and c2 and c3 then
- local w1 = c1.width
- local w2 = c2.width
- local w3 = c3.width
- local mu = size/18
+ local function stack(main,unicode,u1,d12,u2)
+ local characters = main.characters
+ local c1 = characters[u1]
+ if not c1 then
+ return
+ end
+ local c2 = characters[u2]
+ if not c2 then
+ return
+ end
+ local w1 = c1.width or 0
+ local h1 = c1.height or 0
+ local d1 = c1.depth or 0
+ local w2 = c2.width or 0
+ local h2 = c2.height or 0
+ local d2 = c2.depth or 0
+ local mu = main.parameters.size/18
characters[unicode] = {
- width = w1 + w2 + w3 - d12*mu - d23*mu,
- height = max(c1.height or 0, c2.height or 0, c3.height or 0),
- depth = max(c1.depth or 0, c2.depth or 0, c3.depth or 0),
+ width = w1,
+ height = h1 + h2 + d12*mu,
+ depth = d1,
commands = {
- { "slot", id, u1 },
- leftcommand[d12*mu],
- { "slot", id, u2 },
- leftcommand[d23*mu],
- { "slot", id, u3 },
+ slotcommand[0][u1],
+ leftcommand[w1/2 + w2/2],
+ downcommand[-h1 + d2 -d12*mu],
+ slotcommand[0][u2],
}
}
end
-end
-
-local function stack(main,characters,id,size,unicode,u1,d12,u2)
- local c1 = characters[u1]
- if not c1 then
- return
- end
- local c2 = characters[u2]
- if not c2 then
- return
- end
- local w1 = c1.width or 0
- local h1 = c1.height or 0
- local d1 = c1.depth or 0
- local w2 = c2.width or 0
- local h2 = c2.height or 0
- local d2 = c2.depth or 0
- local mu = size/18
- characters[unicode] = {
- width = w1,
- height = h1 + h2 + d12,
- depth = d1,
- commands = {
- { "slot", id, u1 },
- leftcommand[w1/2 + w2/2],
- downcommand[-h1 + d2 -d12*mu],
- { "slot", id, u2 },
- }
- }
-end
-local function repeated(main,characters,id,size,unicode,u,n,private,fraction) -- math-fbk.lua
- local c = characters[u]
- if c then
- local width = c.width
- local italic = fraction*width -- c.italic or 0 -- larger ones have funny italics
- local tc = { "slot", id, u }
- local tr = leftcommand[italic] -- see hack elsewhere
- local commands = { }
- for i=1,n-1 do
- commands[#commands+1] = tc
- commands[#commands+1] = tr
- end
- commands[#commands+1] = tc
- local next = c.next
- if next then
- repeated(main,characters,id,size,private,next,n,private+1,fraction)
- next = private
+ local function repeated(main,unicode,u,n,fraction)
+ local characters = main.characters
+ local c = characters[u]
+ if c then
+ if n == 1 then
+ -- skip this one
+ else
+ local width = c.width
+ local italic = fraction*width -- c.italic or 0 -- larger ones have funny italics
+ local tc = slotcommand[0][u]
+ local tr = leftcommand[italic] -- see hack elsewhere
+ local commands = { }
+ for i=1,n-1 do
+ commands[#commands+1] = tc
+ commands[#commands+1] = tr
+ end
+ commands[#commands+1] = tc
+ local next = c.next
+ if next then
+ local p = addprivate(main,formatters["M-R-%H"](next))
+ repeated(main,p,next,n,fraction)
+ next = p
+ end
+ characters[unicode] = {
+ width = width + (n-1)*(width-italic),
+ height = c.height,
+ depth = c.depth,
+ italic = italic,
+ commands = commands,
+ keepvirtual = true,
+ next = next,
+ }
+ end
end
- characters[unicode] = {
- width = width + (n-1)*(width-italic),
- height = c.height,
- depth = c.depth,
- italic = italic,
- commands = commands,
- next = next,
- }
- end
-end
-
-local function cloned(main,characters,id,size,source,target)
- local data = characters[source]
- if data then
- characters[target] = data
- return true
- end
-end
-
--- we use the fact that context defines the smallest sizes first .. a real dirty and ugly hack
-
-local data_of_smaller = nil
-local size_of_smaller = 0
-
-function vfmath.addmissing(main,id,size)
-
- local id_of_smaller = nil
-
- if size < size_of_smaller or size_of_smaller == 0 then
- data_of_smaller = main.fonts[id]
- id_of_smaller = id
- else
- id_of_smaller = #main.fonts + 1
- main.fonts[id_of_smaller] = data_of_smaller
end
- -- here id is the index in fonts (normally 14 or so) and that slot points to self
-
- local characters = main.characters
- local shared = main.shared
- local variables = main.goodies.mathematics and main.goodies.mathematics.variables or { }
- local joinrelfactor = variables.joinrelfactor or 3
-
- for i=0x7A,0x7D do
- make(main,characters,id,size,i,1)
- end
-
- brace (main,characters,id,size,0x23DE,0xFF17A,0xFF301,0xFF17D,0xFF17C,0xFF301,0xFF17B)
- brace (main,characters,id,size,0x23DF,0xFF27C,0xFF401,0xFF27B,0xFF27A,0xFF401,0xFF27D)
-
- parent (main,characters,id,size,0x23DC,0xFF17A,0xFF301,0xFF17B)
- parent (main,characters,id,size,0x23DD,0xFF27C,0xFF401,0xFF27D)
-
- -- negate (main,characters,id,size,0x2260,0x003D)
- dots (main,characters,id,size,0x2026) -- ldots
- dots (main,characters,id,size,0x22EE) -- vdots
- dots (main,characters,id,size,0x22EF) -- cdots
- dots (main,characters,id,size,0x22F1) -- ddots
- dots (main,characters,id,size,0x22F0) -- udots
-
- vertbar (main,characters,id,size,0x0007C,0.10,0xFF601) -- big : 0.85 bodyfontsize
- vertbar (main,characters,id,size,0xFF601,0.30,0xFF602) -- Big : 1.15 bodyfontsize
- vertbar (main,characters,id,size,0xFF602,0.30,0xFF603) -- bigg : 1.45 bodyfontsize
- vertbar (main,characters,id,size,0xFF603,0.30,0xFF604) -- Bigg : 1.75 bodyfontsize
- vertbar (main,characters,id,size,0x02016,0.10,0xFF605)
- vertbar (main,characters,id,size,0xFF605,0.30,0xFF606)
- vertbar (main,characters,id,size,0xFF606,0.30,0xFF607)
- vertbar (main,characters,id,size,0xFF607,0.30,0xFF608)
-
- clipped (main,characters,id,size,0xFF501,0x0002D) -- minus
- clipped (main,characters,id,size,0xFF502,0x02190) -- lefthead
- clipped (main,characters,id,size,0xFF503,0x02192) -- righthead
- clipped (main,characters,id,size,0xFF504,0xFE321) -- mapsto
- clipped (main,characters,id,size,0xFF505,0xFE322) -- lhook
- clipped (main,characters,id,size,0xFF506,0xFE323) -- rhook
- clipped (main,characters,id,size,0xFF507,0xFE324) -- mapsfrom
- clipped (main,characters,id,size,0xFF508,0x021D0) -- double lefthead
- clipped (main,characters,id,size,0xFF509,0x021D2) -- double righthead
- clipped (main,characters,id,size,0xFF50A,0x0003D) -- equal
- clipped (main,characters,id,size,0xFF50B,0x0219E) -- lefttwohead
- clipped (main,characters,id,size,0xFF50C,0x021A0) -- righttwohead
- clipped (main,characters,id,size,0xFF50D,0xFF350) -- lr arrow combi snippet
- clipped (main,characters,id,size,0xFF50E,0xFF351) -- lr arrow combi snippet
- clipped (main,characters,id,size,0xFF50F,0xFF352) -- lr arrow combi snippet
- clipped (main,characters,id,size,0xFF510,0x02261) -- equiv
-
- extension(main,characters,id,size,0x2190,0xFF502,0xFF501,0xFF501) -- \leftarrow
- extension(main,characters,id,size,0x2192,0xFF501,0xFF501,0xFF503) -- \rightarrow
-
- extension(main,characters,id,size,0x002D,0xFF501,0xFF501,0xFF501) -- \rel
- extension(main,characters,id,size,0x003D,0xFF50A,0xFF50A,0xFF50A) -- \equal
- extension(main,characters,id,size,0x2261,0xFF510,0xFF510,0xFF510) -- \equiv
-
- jointwo (main,characters,id,size,0x21A6,0xFE321,0,0x02192) -- \mapstochar\rightarrow
- jointwo (main,characters,id,size,0x21A9,0x02190,joinrelfactor,0xFE323) -- \leftarrow\joinrel\rhook
- jointwo (main,characters,id,size,0x21AA,0xFE322,joinrelfactor,0x02192) -- \lhook\joinrel\rightarrow
- jointwo (main,characters,id,size,0x27F5,0x02190,joinrelfactor,0x0002D) -- \leftarrow\joinrel\relbar
- jointwo (main,characters,id,size,0x27F6,0x0002D,joinrelfactor,0x02192,2) -- \relbar\joinrel\rightarrow
- jointwo (main,characters,id,size,0x27F7,0x02190,joinrelfactor,0x02192) -- \leftarrow\joinrel\rightarrow
- jointwo (main,characters,id,size,0x27F8,0x021D0,joinrelfactor,0x0003D) -- \Leftarrow\joinrel\Relbar
- jointwo (main,characters,id,size,0x27F9,0x0003D,joinrelfactor,0x021D2) -- \Relbar\joinrel\Rightarrow
- jointwo (main,characters,id,size,0x27FA,0x021D0,joinrelfactor,0x021D2) -- \Leftarrow\joinrel\Rightarrow
- jointhree(main,characters,id,size,0x27FB,0x02190,joinrelfactor,0x0002D,0,0xFE324) -- \leftarrow\joinrel\relbar\mapsfromchar
- jointhree(main,characters,id,size,0x27FC,0xFE321,0,0x0002D,joinrelfactor,0x02192) -- \mapstochar\relbar\joinrel\rightarrow
-
- extension(main,characters,id,size,0x21A6,0xFF504,0xFF501,0xFF503) -- \mapstochar\rightarrow
- extension(main,characters,id,size,0x21A9,0xFF502,0xFF501,0xFF506) -- \leftarrow\joinrel\rhook
- extension(main,characters,id,size,0x21AA,0xFF505,0xFF501,0xFF503) -- \lhook\joinrel\rightarrow
- extension(main,characters,id,size,0x27F5,0xFF502,0xFF501,0xFF501) -- \leftarrow\joinrel\relbar
- extension(main,characters,id,size,0x27F6,0xFF501,0xFF501,0xFF503) -- \relbar\joinrel\rightarrow
- extension(main,characters,id,size,0x27F7,0xFF502,0xFF501,0xFF503) -- \leftarrow\joinrel\rightarrow
- extension(main,characters,id,size,0x27F8,0xFF508,0xFF50A,0xFF50A) -- \Leftarrow\joinrel\Relbar
- extension(main,characters,id,size,0x27F9,0xFF50A,0xFF50A,0xFF509) -- \Relbar\joinrel\Rightarrow
- extension(main,characters,id,size,0x27FA,0xFF508,0xFF50A,0xFF509) -- \Leftarrow\joinrel\Rightarrow
- extension(main,characters,id,size,0x27FB,0xFF502,0xFF501,0xFF507) -- \leftarrow\joinrel\relbar\mapsfromchar
- extension(main,characters,id,size,0x27FC,0xFF504,0xFF501,0xFF503) -- \mapstochar\relbar\joinrel\rightarrow
-
- extension(main,characters,id,size,0x219E,0xFF50B,0xFF501,0xFF501) -- \twoheadleftarrow\joinrel\relbar
- extension(main,characters,id,size,0x21A0,0xFF501,0xFF501,0xFF50C) -- \relbar\joinrel\twoheadrightarrow
- extension(main,characters,id,size,0x21C4,0xFF50D,0xFF50E,0xFF50F) -- leftoverright
-
- -- 21CB leftrightharpoon
- -- 21CC rightleftharpoon
-
- stack(main,characters,id,size,0x2259,0x0003D,3,0x02227) -- \buildrel\wedge\over=
-
- jointwo(main,characters,id,size,0x22C8,0x022B3,joinrelfactor,0x022B2) -- \mathrel\triangleright\joinrel\mathrel\triangleleft (4 looks better than 3)
- jointwo(main,characters,id,size,0x22A7,0x0007C,joinrelfactor,0x0003D) -- \mathrel|\joinrel=
- jointwo(main,characters,id,size,0x2260,0x00338,0,0x0003D) -- \not\equal
- jointwo(main,characters,id,size,0x2284,0x00338,0,0x02282) -- \not\subset
- jointwo(main,characters,id,size,0x2285,0x00338,0,0x02283) -- \not\supset
- jointwo(main,characters,id,size,0x2209,0x00338,0,0x02208) -- \not\in
- jointwo(main,characters,id,size,0x2254,0x03A,0,0x03D) -- := (≔)
-
- repeated(main,characters,id,size,0x222C,0x222B,2,0xFF800,1/3)
- repeated(main,characters,id,size,0x222D,0x222B,3,0xFF810,1/3)
-
- if cloned(main,characters,id,size,0x2032,0xFE325) then
- raise(main,characters,id,size,0x2032,0xFE325,1,id_of_smaller) -- prime
- raise(main,characters,id,size,0x2033,0xFE325,2,id_of_smaller) -- double prime
- raise(main,characters,id,size,0x2034,0xFE325,3,id_of_smaller) -- triple prime
- -- to satisfy the prime resolver
- characters[0xFE932] = characters[0x2032]
- characters[0xFE933] = characters[0x2033]
- characters[0xFE934] = characters[0x2034]
- end
-
- -- there are more (needs discussion first):
-
- -- characters[0x20D6] = characters[0x2190]
- -- characters[0x20D7] = characters[0x2192]
-
- characters[0x02B9] = characters[0x2032] -- we're nice
+ vfmath.builders = {
+ horibar = horibar,
+ rootbar = rootbar,
+ parent = parent,
+ brace = brace,
+ dots = dots,
+ jointwo = jointwo,
+ overlaytwo = overlaytwo,
+ jointhree = jointhree,
+ stack = stack,
+ repeated = repeated,
+ }
- data_of_smaller = main.fonts[id]
- size_of_smaller = size
+ -- todo: move this to the lfg files
end
@@ -620,18 +607,21 @@ setmetatableindex(reverse, function(t,name)
return r
end)
+-- Used in fallbacks (might move):
+
local function copy_glyph(main,target,original,unicode,slot)
- local addprivate = fonts.helpers.addprivate
- local olddata = original[unicode]
+ local olddata = original[unicode]
if olddata then
local newdata = {
width = olddata.width,
height = olddata.height,
depth = olddata.depth,
italic = olddata.italic,
+ topanchor = olddata.topanchor,
kerns = olddata.kerns,
+ mathkerns = olddata.mathkerns,
tounicode = olddata.tounicode,
- commands = { { "slot", slot, unicode } },
+ commands = { slotcommand[slot][unicode] },
}
local glyphdata = newdata
local nextglyph = olddata.next
@@ -642,8 +632,13 @@ local function copy_glyph(main,target,original,unicode,slot)
width = oldnextdata.width,
height = oldnextdata.height,
depth = oldnextdata.depth,
+ italic = oldnextdata.italic,
+ topanchor = oldnextdata.topanchor,
+ kerns = olddata.kerns,
+ mathkerns = olddata.mathkerns,
tounicode = olddata.tounicode,
- commands = { { "slot", slot, nextglyph } },
+ smaller = olddata.smaller,
+ commands = { slotcommand[slot][nextglyph] },
}
local newnextglyph = addprivate(main,formatters["M-N-%H"](nextglyph),newnextdata)
newdata.next = newnextglyph
@@ -659,43 +654,32 @@ local function copy_glyph(main,target,original,unicode,slot)
break -- safeguard (when testing stuff)
end
end
- local hv = olddata.horiz_variants
- if hv then
- hv = fastcopy(hv)
- newdata.horiz_variants = hv
- for i=1,#hv do
- local hvi = hv[i]
- local oldglyph = hvi.glyph
- local olddata = original[oldglyph]
- local newdata = {
+ local oldparts = olddata.parts
+ if oldparts then
+ newparts = fastcopy(oldparts)
+ newdata.parts = newparts
+ newdata.partsorientation = olddata.partsorientation
+ newdata.partsitalic = olddata.partsitalic
+ for i=1,#newparts do
+ local newpart = newparts[i]
+ local oldglyph = newpart.glyph
+ local olddata = original[oldglyph]
+ local newdata = {
width = olddata.width,
height = olddata.height,
depth = olddata.depth,
tounicode = olddata.tounicode,
- commands = { { "slot", slot, oldglyph } },
+ commands = { slotcommand[slot][oldglyph] },
}
- hvi.glyph = addprivate(main,formatters["M-H-%H"](oldglyph),newdata)
+ newpart.glyph = addprivate(main,formatters["M-P-%H"](oldglyph),newdata)
end
end
- local vv = olddata.vert_variants
- if vv then
- vv = fastcopy(vv)
- newdata.vert_variants = vv
- for i=1,#vv do
- local vvi = vv[i]
- local oldglyph = vvi.glyph
- local olddata = original[oldglyph]
- local newdata = {
- width = olddata.width,
- height = olddata.height,
- depth = olddata.depth,
- tounicode = olddata.tounicode,
- commands = { { "slot", slot, oldglyph } },
- }
- vvi.glyph = addprivate(main,formatters["M-V-%H"](oldglyph),newdata)
- end
+ local smaller = olddata.smaller
+ if smaller then
+ local smallerdata = copy_glyph(main,target,original,smaller,slot)
+ glyphdata.smaller = addprivate(main,formatters["M-S-%H"](smaller),smallerdata)
end
- return newdata
+ return glyphdata
end
end
@@ -706,6 +690,71 @@ vfmath.copy_glyph = copy_glyph
-- route: use the "order" field. I can probably make it a bit leaner but it's not
-- worth spending much time on now.
+local noitalics = true -- false can be used to test the engine
+
+-- revision timestamp 2023: after watching ten times "Over The Mountain (feat.
+-- Sierra Hull)" - Cory Wong (Live @ Brooklyn Steel FEB 2022):
+--
+-- https://www.youtube.com/watch?v=lT-W-UEcsns
+-- https://www.youtube.com/watch?v=TPGbj1gFalA
+
+-- The following code is now only used for iwona and antykwa, so I simplified it a
+-- bit to suit that purpose. It might get even simpler.
+
+local function virtualize(s,uni,fci,skewchar,move,mathparameters,unicode,parameters)
+ if fci then
+ local kerns = fci.kerns
+ local width = fci.width
+ local height = fci.height
+ local depth = fci.depth
+ local italic = fci.italic
+ local advance = width
+ local bottomright
+ local topanchor
+ local yoffset
+ if kerns and skewchar then
+ local k = kerns[skewchar]
+ if k then
+ topanchor = width/2 + k
+ end
+ end
+ if italic and noitalics then
+ width = width + italic
+ bottomright = - italic
+ italic = nil
+ end
+ if move then -- 0x222B
+ local axis = move * mathparameters.axisheight
+ local half = (height + depth ) / 2
+ yoffset = depth - (half - axis)
+ height = half + axis
+ depth = half - axis
+ end
+ --
+ local next = fci.next
+ return {
+ advance = advance,
+ width = width,
+ height = height,
+ depth = depth,
+ italic = italic,
+ bottomright = bottomright,
+ topanchor = topanchor,
+ yoffset = yoffset,
+ commands = { slotcommand[s][uni] },
+ -- keepvirtual = true,
+ next = fci.next,
+ parts = fci.parts,
+ partsorientation = fci.partsorientation,
+ partsitalic = fci.partsitalic,
+ unicode = unicode,
+ name = fci.name,
+ }
+ else
+ -- error
+ end
+end
+
function vfmath.define(specification,set,goodies)
local name = specification.name -- symbolic name
local size = specification.size -- given size
@@ -716,6 +765,7 @@ function vfmath.define(specification,set,goodies)
local start = (trace_virtual or trace_timings) and os.clock()
local okset = { }
local n = 0
+ local f_extra = formatters["virtual.extra.%05X"]
for s=1,#set do
local ss = set[s]
local ssname = ss.name
@@ -739,7 +789,11 @@ function vfmath.define(specification,set,goodies)
end
else
f, id = fonts.constructors.readanddefine(ssname,size)
- names[ssname] = { f = f, id = id }
+ names[ssname] = {
+ f = f,
+ id = id,
+ fontname = ssname, -- diagnostics
+ }
end
if not f or id == 0 then
report_virtual("loading font %a subfont %s with name %a at %p is skipped, not found",name,s,ssname,size)
@@ -747,10 +801,11 @@ function vfmath.define(specification,set,goodies)
n = n + 1
okset[n] = ss
loaded[n] = f
- fontlist[n] = { id = id, size = size }
- if not shared[s] then
- shared[n] = { }
- end
+ fontlist[n] = {
+ id = id,
+ size = size,
+ fontname = ssname, -- diagnostics
+ }
if trace_virtual then
report_virtual("loading font %a subfont %s with name %a at %p as id %s using encoding %a",name,s,ssname,size,id,ss.vector)
end
@@ -768,7 +823,9 @@ function vfmath.define(specification,set,goodies)
hasitalics = true,
hasmath = true,
}
- local goodies = { }
+ if not goodies then
+ goodies = { }
+ end
local main = {
metadata = metadata,
properties = properties,
@@ -822,21 +879,24 @@ function vfmath.define(specification,set,goodies)
properties.fullname = fullname .. "-" .. unique
end
--
- if not parameters.x_height then
- parameters.x_height = 0
+ if not parameters.xheight then
+ parameters.xheight = 0
end
--
local already_reported = false
- local parameters_done = false
+ local parameters_done = false
+ local offset = 0 -- 0xFF000 -- todo: -- private
+ --
for s=1,n do
- local ss, fs = okset[s], loaded[s]
+ local ss = okset[s]
+ local fs = loaded[s]
if not fs then
-- skip, error
elseif add_optional and ss.optional then
-- skip, redundant
else
local newparameters = fs.parameters
- local newmathparameters = fs.mathparameters
+ local newmathparameters = fs.mathparameters and ss.parameters ~= false
if newmathparameters then
if not parameters_done or ss.parameters then
mathparameters = newmathparameters
@@ -845,35 +905,40 @@ function vfmath.define(specification,set,goodies)
elseif not newparameters then
report_virtual("no parameters set in font %a",name)
elseif ss.extension then
- mathparameters.math_x_height = newparameters.x_height or 0 -- math_x_height : height of x
- mathparameters.default_rule_thickness = newparameters[ 8] or 0 -- default_rule_thickness : thickness of \over bars
- mathparameters.big_op_spacing1 = newparameters[ 9] or 0 -- big_op_spacing1 : minimum clearance above a displayed op
- mathparameters.big_op_spacing2 = newparameters[10] or 0 -- big_op_spacing2 : minimum clearance below a displayed op
- mathparameters.big_op_spacing3 = newparameters[11] or 0 -- big_op_spacing3 : minimum baselineskip above displayed op
- mathparameters.big_op_spacing4 = newparameters[12] or 0 -- big_op_spacing4 : minimum baselineskip below displayed op
- mathparameters.big_op_spacing5 = newparameters[13] or 0 -- big_op_spacing5 : padding above and below displayed limits
+ mathparameters.xheight = newparameters.xheight or 0 -- mathxheight : height of x
+ mathparameters.defaultrulethickness = newparameters[ 8] or 0 -- defaultrulethickness : thickness of \over bars
+ mathparameters.bigopspacing1 = newparameters[ 9] or 0 -- bigopspacing1 : minimum clearance above a displayed op
+ mathparameters.bigopspacing2 = newparameters[10] or 0 -- bigopspacing2 : minimum clearance below a displayed op
+ mathparameters.bigopspacing3 = newparameters[11] or 0 -- bigopspacing3 : minimum baselineskip above displayed op
+ mathparameters.bigopspacing4 = newparameters[12] or 0 -- bigopspacing4 : minimum baselineskip below displayed op
+ mathparameters.bigopspacing5 = newparameters[13] or 0 -- bigopspacing5 : padding above and below displayed limits
-- report_virtual("loading and virtualizing font %a at size %p, setting ex parameters",name,size)
elseif ss.parameters then
- mathparameters.x_height = newparameters.x_height or mathparameters.x_height
- mathparameters.x_height = mathparameters.x_height or fp.x_height or 0 -- x_height : height of x
- mathparameters.num1 = newparameters[ 8] or 0 -- num1 : numerator shift-up in display styles
- mathparameters.num2 = newparameters[ 9] or 0 -- num2 : numerator shift-up in non-display, non-\atop
- mathparameters.num3 = newparameters[10] or 0 -- num3 : numerator shift-up in non-display \atop
- mathparameters.denom1 = newparameters[11] or 0 -- denom1 : denominator shift-down in display styles
- mathparameters.denom2 = newparameters[12] or 0 -- denom2 : denominator shift-down in non-display styles
- mathparameters.sup1 = newparameters[13] or 0 -- sup1 : superscript shift-up in uncramped display style
- mathparameters.sup2 = newparameters[14] or 0 -- sup2 : superscript shift-up in uncramped non-display
- mathparameters.sup3 = newparameters[15] or 0 -- sup3 : superscript shift-up in cramped styles
- mathparameters.sub1 = newparameters[16] or 0 -- sub1 : subscript shift-down if superscript is absent
- mathparameters.sub2 = newparameters[17] or 0 -- sub2 : subscript shift-down if superscript is present
- mathparameters.sup_drop = newparameters[18] or 0 -- sup_drop : superscript baseline below top of large box
- mathparameters.sub_drop = newparameters[19] or 0 -- sub_drop : subscript baseline below bottom of large box
- mathparameters.delim1 = newparameters[20] or 0 -- delim1 : size of \atopwithdelims delimiters in display styles
- mathparameters.delim2 = newparameters[21] or 0 -- delim2 : size of \atopwithdelims delimiters in non-displays
- mathparameters.axis_height = newparameters[22] or 0 -- axis_height : height of fraction lines above the baseline
+ mathparameters.xheight = newparameters.xheight
+ or mathparameters.xheight
+ or fs.xheight or 0 -- xheight : height of x
+ mathparameters.num1 = newparameters[ 8] or 0 -- num1 : numerator shift-up in display styles
+ mathparameters.num2 = newparameters[ 9] or 0 -- num2 : numerator shift-up in non-display, non-\atop
+ mathparameters.num3 = newparameters[10] or 0 -- num3 : numerator shift-up in non-display \atop
+ mathparameters.denom1 = newparameters[11] or 0 -- denom1 : denominator shift-down in display styles
+ mathparameters.denom2 = newparameters[12] or 0 -- denom2 : denominator shift-down in non-display styles
+ mathparameters.sup1 = newparameters[13] or 0 -- sup1 : superscript shift-up in uncramped display style
+ mathparameters.sup2 = newparameters[14] or 0 -- sup2 : superscript shift-up in uncramped non-display
+ mathparameters.sup3 = newparameters[15] or 0 -- sup3 : superscript shift-up in cramped styles
+ mathparameters.sub1 = newparameters[16] or 0 -- sub1 : subscript shift-down if superscript is absent
+ mathparameters.sub2 = newparameters[17] or 0 -- sub2 : subscript shift-down if superscript is present
+ mathparameters.supdrop = newparameters[18] or 0 -- supdrop : superscript baseline below top of large box
+ mathparameters.subdrop = newparameters[19] or 0 -- subdrop : subscript baseline below bottom of large box
+ mathparameters.delim1 = newparameters[20] or 0 -- delim1 : size of \atopwithdelims delimiters in display styles
+ mathparameters.delim2 = newparameters[21] or 0 -- delim2 : size of \atopwithdelims delimiters in non-displays
+ mathparameters.axisheight = newparameters[22] or 0 -- axisheight : height of fraction lines above the baseline
-- report_virtual("loading and virtualizing font %a at size %p, setting sy parameters",name,size)
end
+ -- We no longer care about kerns and ligatures here. We use backmack because we need to know
+ -- the original order and the loader has made a unicode font of it and weird glyph names have
+ -- spoiled that a bit too.
if ss.overlay then
+ -- This branch / option will go away.
local fc = fs.characters
local first = ss.first
if first then
@@ -889,29 +954,31 @@ function vfmath.define(specification,set,goodies)
else
local vectorname = ss.vector
if vectorname then
- local offset = 0xFF000 -- todo: -- private
local vector = mathencodings[vectorname]
- local rotcev = reverse[vectorname]
local isextension = ss.extension
- if vector and rotcev then
+ if vector then
local fc = fs.characters
local fd = fs.descriptions
- local si = shared[s]
+ local fp = fs.parameters
local fontname = fs.properties.name or "unknown"
local skewchar = ss.skewchar
local backmap = ss.backmap
- -- we need to know the original order because the loader has made a
- -- unicode font of it and weird glyphnames have spoiled that a bit
- if backmap then
+ local badones = ss.badones
+ local ignore = ss.ignore
+ local done = { }
+ local extras = { }
+ if backmap == false then
+ -- backmap = { }
+ elseif not backmap then
backmap = { }
for unicode, character in next, fc do
backmap[character.order or character.index or unicode] = unicode
end
+ ss.backmap = backmap
end
- for unicode, i in next, vector do
- -- So, here we can have an extra remapping (compared to mkiv).
- local index = backmap and backmap[i] or i
- local fci = fc[index]
+ for unicode, index in sortedhash(vector) do
+ local uni = backmap and backmap[index] or index
+ local fci = fc[uni]
if not fci then
local rf = reported[fontname]
if not rf then rf = { } reported[fontname] = rf end
@@ -933,161 +1000,74 @@ function vfmath.define(specification,set,goodies)
rv[unicode] = true
end
else
- local ref = si[index]
- if not ref then
- ref = { { 'slot', s, index } }
- si[index] = ref
- end
- local kerns = fci.kerns
- local width = fci.width
- local italic = fci.italic
--- if trace_virtual then
--- report_virtual("character %C uses index %H in vector %a for font %a, %s, %s",
--- unicode,index,vectorname,fontname,
--- kerns and "adding kerns" or "no kerns",
--- kerns and "adding italic" or "no italic"
--- )
--- end
- if italic and italic > 0 then
- -- int_a^b
- if isextension then
- width = width + italic -- for obscure reasons the integral as a width + italic correction
- end
- end
- if kerns then
- local krn = { }
- for k, v in next, kerns do -- kerns is sparse
- local rk = rotcev[k]
- if rk then
- krn[rk] = v -- kerns[k]
- end
- end
- if not next(krn) then
- krn = nil
- end
- local t = {
- width = width,
- height = fci.height,
- depth = fci.depth,
- italic = italic,
- kerns = krn,
- commands = ref,
- }
- if skewchar then
- local k = kerns[skewchar]
- if k then
- t.top_accent = width/2 + k
- end
- end
- characters[unicode] = t
+ local name = fci.name or ""
+ if ignore and ignore[name] then
+ -- get rid of ugly slanted antykwa { }
else
- characters[unicode] = {
- width = width,
- height = fci.height,
- depth = fci.depth,
- italic = italic,
- commands = ref,
- }
+ local u = mathematics.gaps[unicode] or unicode
+ local t = virtualize(s,uni,fci,skewchar,tonumber(badones and badones[name]),mathparameters,u,fp)
+ done[uni] = t
+ characters[unicode] = t
+ fci.unicode = u
end
end
end
+-- if ss.jmn then
+-- local extension = mathencodings["extensible-jmn-private"]
+-- for unicode, index in sortedhash(extension) do
+-- if not characters[unicode] then
+-- local uni = backmap and backmap[index] or index
+-- local fci = fc[uni]
+-- characters[unicode] = virtualize(s,uni,fci,skewchar,false,mathparameters,unicode,fp)
+-- end
+-- end
+-- end
if isextension then
- -- todo: if multiple ex, then 256 offsets per instance
local extension = mathencodings["large-to-small"]
- local variants_done = fs.variants_done
- for index, fci in next, fc do -- the raw ex file
- if type(index) == "number" then
- local ref = si[index]
- if not ref then
- ref = { { 'slot', s, index } }
- si[index] = ref
- end
- local italic = fci.italic
- local t = {
- width = fci.width,
- height = fci.height,
- depth = fci.depth,
- italic = italic,
- commands = ref,
- }
- local n = fci.next
- if n then
- t.next = offset + n
- elseif variants_done then
- local vv = fci.vert_variants
- if vv then
- t.vert_variants = vv
- end
- local hv = fci.horiz_variants
- if hv then
- t.horiz_variants = hv
- end
- else
- local vv = fci.vert_variants
- if vv then
- for i=1,#vv do
- local vvi = vv[i]
- vvi.glyph = vvi.glyph + offset
- end
- t.vert_variants = vv
- end
- local hv = fci.horiz_variants
- if hv then
- for i=1,#hv do
- local hvi = hv[i]
- hvi.glyph = hvi.glyph + offset
- end
- t.horiz_variants = hv
- end
- end
- characters[offset + index] = t
+ for uni, fci in sortedhash(fc) do
+ local name = fci.name or ""
+ if ignore and ignore[name] then
+ -- get rid of ugly antykwa bar
+ elseif not done[uni] then
+ local t = virtualize(s,uni,fci,skewchar,tonumber(badones and badones[name]),mathparameters,nil,fp)
+ local o = addprivate(main,f_extra(offset))
+ extras[uni] = o
+ characters[o] = t
+ done[uni] = t
+ offset = offset + 1
end
end
- fs.variants_done = true
- for unicode, index in next, extension do
- local cu = characters[unicode]
- if cu then
- cu.next = offset + index
- else
- local fci = fc[index]
- if not fci then
- -- do nothing
- else
- -- probably never entered
- local ref = si[index]
- if not ref then
- ref = { { 'slot', s, index } }
- si[index] = ref
- end
- local kerns = fci.kerns
- if kerns then
- local krn = { }
- -- for k=1,#kerns do
- -- krn[offset + k] = kerns[k]
- -- end
- for k, v in next, kerns do -- is kerns sparse?
- krn[offset + k] = v
- end
- characters[unicode] = {
- width = fci.width,
- height = fci.height,
- depth = fci.depth,
- italic = fci.italic,
- commands = ref,
- kerns = krn,
- next = offset + index,
- }
- else
- characters[unicode] = {
- width = fci.width,
- height = fci.height,
- depth = fci.depth,
- italic = fci.italic,
- commands = ref,
- next = offset + index,
- }
- end
+ for uni, fci in sortedhash(done) do
+ local next = fci.next
+ if next then
+ fci.next = extras[backmap and backmap[next] or next]
+ end
+ local parts = fci.parts
+ if parts then
+ local p = table.copy(parts)
+ for i=1,#p do
+ local part = p[i]
+ local glyph = part.glyph
+ part.glyph = extras[backmap and backmap[glyph] or glyph] or glyph
end
+ fci.keepvirtual = true
+ fci.parts = p
+ fci.partsorientation = "vertical" -- nasty as some are horizontal
+ fci.partsitalic = fci.partsitalic or fci.italic
+ end
+ end
+ for unicode, index in sortedhash(extension) do
+ local fci = characters[unicode]
+ if fci then
+ fci.next = extras[backmap[index] or index]
+ end
+ end
+ local extension = mathencodings["large-to-small-private"]
+ for unicode, index in sortedhash(extension) do
+ if not characters[unicode] then
+ local uni = backmap and backmap[index] or index
+ local fci = fc[uni]
+ characters[unicode] = virtualize(s,uni,fci,skewchar,false,mathparameters,unicode,fp)
end
end
end
@@ -1096,36 +1076,52 @@ function vfmath.define(specification,set,goodies)
end
end
end
- mathematics.extras.copy(main) --not needed here (yet)
+ -- mathematics.extras.copy(main) -- Not needed here (yet) ... might go.
end
end
--- inspect(characters[0x1D465])
--- inspect(fonts.encodings.math["tex-it"])
--- inspect(fontlist)
--
main.mathparameters = mathparameters -- still traditional ones
- -- This should change (some day) as it's the only place where we look forward,
- -- so better is to also reserve the id already which then involves some more
- -- management (so not now).
fontlist[#fontlist+1] = {
- -- id = font.nextid(),
- id = 0, -- self
- size = size,
+ id = 0,
+ size = size,
+ fontname = name, -- diagnostics
}
- vfmath.addmissing(main,#fontlist,size)
+ --
+ local addmissing = goodies.mathematics.addmissing
+ if type(addmissing) == "function" then
+ addmissing(main)
+ end
--
mathematics.addfallbacks(main)
--
main.properties.math_is_scaled = true -- signal
fonts.constructors.assignmathparameters(main,main)
--
- main.MathConstants = main.mathparameters -- we directly pass it to TeX (bypasses the scaler) so this is needed
+ mathematics.initializeparameters(main,main,"noscale")
+ main.mathconstants = main.mathparameters -- we directly pass it to TeX (bypasses the scaler) so this is needed
+ main.MathConstants = main.mathconstants
+ main.nomath = false
+ --
+ mathematics.tweaks.setoptions(main,main,{
+ tweak = "setoptions",
+ set = { "ignorekerndimensions" }
+ }) -- we have dp > ht fences
+ --
+ mathematics.tweaks.fixprimes(main, main, {
+ tweak = "fixprimes",
+ factor = 1, -- accent base height
+ fake = 0.9, -- replace multiples with this width proportion
+ })
+ --
+-- mathematics.tweaks.addbars(main,main,{
+-- tweak = "addbars",
+-- advance = 0.52,
+-- })
--
if trace_virtual or trace_timings then
report_virtual("loading and virtualizing font %a at size %p took %0.3f seconds",name,size,os.clock()-start)
end
--
- main.oldmath = true
return main
end
@@ -1135,7 +1131,7 @@ function mathematics.makefont(name,set,goodies)
end
end
--- helpers
+-- helpers (todo: gaps)
function vfmath.setletters(font_encoding, name, uppercase, lowercase)
local enc = font_encoding[name]
@@ -1151,3 +1147,145 @@ function vfmath.setdigits(font_encoding, name, digits)
enc[digits+i] = i + 0x30
end
end
+
+-- local function extension(main,characters,id,size,unicode,first,middle,last)
+-- local chr = characters[unicode]
+-- if not chr then
+-- return -- skip
+-- end
+-- local fw = characters[first]
+-- if not fw then
+-- return
+-- end
+-- local mw = characters[middle]
+-- if not mw then
+-- return
+-- end
+-- local lw = characters[last]
+-- if not lw then
+-- return
+-- end
+-- fw = fw.width
+-- mw = mw.width
+-- lw = lw.width
+-- if fw == 0 then
+-- fw = 1
+-- end
+-- if lw == 0 then
+-- lw = 1
+-- end
+-- chr.partsorientation = "horizontal"
+-- chr.parts = {
+-- { extender = 0, glyph = first, ["end"] = fw/2, start = 0, advance = fw },
+-- { extender = 1, glyph = middle, ["end"] = mw/2, start = mw/2, advance = mw },
+-- { extender = 0, glyph = last, ["end"] = 0, start = lw/2, advance = lw },
+-- }
+-- end
+
+-- local step = 0.2 -- 0.1 is nicer but gives larger files
+
+-- local function clipped(main,characters,id,size,unicode,original) -- push/pop needed?
+-- local minus = characters[original]
+-- if minus then
+-- local mu = size/18
+-- local step = 3*mu
+-- local width = minus.width
+-- if width > step then
+-- width = width - step
+-- step = step / 2
+-- else
+-- width = width / 2
+-- step = width
+-- end
+-- characters[unicode] = {
+-- width = width,
+-- height = minus.height,
+-- depth = minus.depth,
+-- commands = {
+-- push,
+-- leftcommand[step],
+-- slotcommand[0][original],
+-- pop,
+-- }
+-- }
+-- end
+-- end
+
+-- local function vertbar(main,characters,id,size,parent,scale,unicode)
+-- local cp = characters[parent]
+-- if cp then
+-- local sc = scale * size
+-- local pc = slotcommand[0][parent]
+-- characters[unicode] = {
+-- width = cp.width,
+-- height = cp.height + sc,
+-- depth = cp.depth + sc,
+-- next = cp.next, -- can be extensible
+-- commands = {
+-- push, upcommand [sc], pc, pop,
+-- push, downcommand[sc], pc, pop,
+-- pc,
+-- },
+-- }
+-- cp.next = unicode
+-- end
+-- end
+
+-- vertbar (main,characters,id,size,0x0007C,0.10,0xFF601) -- big : 0.85 bodyfontsize
+-- vertbar (main,characters,id,size,0xFF601,0.30,0xFF602) -- Big : 1.15 bodyfontsize
+-- vertbar (main,characters,id,size,0xFF602,0.30,0xFF603) -- bigg : 1.45 bodyfontsize
+-- vertbar (main,characters,id,size,0xFF603,0.30,0xFF604) -- Bigg : 1.75 bodyfontsize
+-- vertbar (main,characters,id,size,0x02016,0.10,0xFF605)
+-- vertbar (main,characters,id,size,0xFF605,0.30,0xFF606)
+-- vertbar (main,characters,id,size,0xFF606,0.30,0xFF607)
+-- vertbar (main,characters,id,size,0xFF607,0.30,0xFF608)
+
+-- clipped (main,characters,id,size,0xFF501,0x0002D) -- minus
+-- clipped (main,characters,id,size,0xFF502,0x02190) -- lefthead
+-- clipped (main,characters,id,size,0xFF503,0x02192) -- righthead
+-- clipped (main,characters,id,size,0xFF504,ps("maps to piece") -- mapsto
+-- clipped (main,characters,id,size,0xFF505,0xFE322) -- lhook
+-- clipped (main,characters,id,size,0xFF506,0xFE323) -- rhook
+-- clipped (main,characters,id,size,0xFF507,0xFE324) -- mapsfrom
+-- clipped (main,characters,id,size,0xFF508,0x021D0) -- double lefthead
+-- clipped (main,characters,id,size,0xFF509,0x021D2) -- double righthead
+-- clipped (main,characters,id,size,0xFF50A,0x0003D) -- equal
+-- clipped (main,characters,id,size,0xFF50B,0x0219E) -- lefttwohead
+-- clipped (main,characters,id,size,0xFF50C,0x021A0) -- righttwohead
+-- clipped (main,characters,id,size,0xFF50D,0xFF350) -- lr arrow combi snippet
+-- clipped (main,characters,id,size,0xFF50E,0xFF351) -- lr arrow combi snippet
+-- clipped (main,characters,id,size,0xFF50F,0xFF352) -- lr arrow combi snippet
+-- clipped (main,characters,id,size,0xFF510,0x02261) -- equiv
+
+-- extension(main,characters,id,size,0x2190,0xFF502,0xFF501,0xFF501) -- \leftarrow
+-- extension(main,characters,id,size,0x2192,0xFF501,0xFF501,0xFF503) -- \rightarrow
+
+-- extension(main,characters,id,size,0x002D,0xFF501,0xFF501,0xFF501) -- \rel
+-- extension(main,characters,id,size,0x003D,0xFF50A,0xFF50A,0xFF50A) -- \equal
+-- extension(main,characters,id,size,0x2261,0xFF510,0xFF510,0xFF510) -- \equiv
+
+-- local lh = ps("left hook piece")] -- was FE322
+-- local rh = ps("right hook piece")] -- was FE323
+
+-- jointwo (main,characters,id,size,0x21A6,ps("maps to piece"),0,0x02192) -- \mapstochar\rightarrow
+-- jointwo (main,characters,id,size,0x21A9,0x02190,joinrelfactor,0xFE323) -- \leftarrow\joinrel\rhook
+-- jointwo (main,characters,id,size,0x21AA,0xFE322,joinrelfactor,0x02192) -- \lhook\joinrel\rightarrow
+-- jointhree(main,characters,id,size,0x27FB,0x02190,joinrelfactor,0x0002D,0,0xFE324) -- \leftarrow\joinrel\relbar\mapsfromchar
+
+-- jointhree(main,characters,id,size,0x27FC,ps("maps to piece"),0,0x0002D,joinrelfactor,0x02192) -- \mapstochar\relbar\joinrel\rightarrow
+
+-- extension(main,characters,id,size,0x21A6,0xFF504,0xFF501,0xFF503) -- \mapstochar\rightarrow
+-- extension(main,characters,id,size,0x21A9,0xFF502,0xFF501,0xFF506) -- \leftarrow\joinrel\rhook
+-- extension(main,characters,id,size,0x21AA,0xFF505,0xFF501,0xFF503) -- \lhook\joinrel\rightarrow
+-- extension(main,characters,id,size,0x27F5,0xFF502,0xFF501,0xFF501) -- \leftarrow\joinrel\relbar
+-- extension(main,characters,id,size,0x27F6,0xFF501,0xFF501,0xFF503) -- \relbar\joinrel\rightarrow
+-- extension(main,characters,id,size,0x27F7,0xFF502,0xFF501,0xFF503) -- \leftarrow\joinrel\rightarrow
+-- extension(main,characters,id,size,0x27F8,0xFF508,0xFF50A,0xFF50A) -- \Leftarrow\joinrel\Relbar
+-- extension(main,characters,id,size,0x27F9,0xFF50A,0xFF50A,0xFF509) -- \Relbar\joinrel\Rightarrow
+-- extension(main,characters,id,size,0x27FA,0xFF508,0xFF50A,0xFF509) -- \Leftarrow\joinrel\Rightarrow
+-- extension(main,characters,id,size,0x27FB,0xFF502,0xFF501,0xFF507) -- \leftarrow\joinrel\relbar\mapsfromchar
+-- extension(main,characters,id,size,0x27FC,0xFF504,0xFF501,0xFF503) -- \mapstochar\relbar\joinrel\rightarrow
+
+-- extension(main,characters,id,size,0x219E,0xFF50B,0xFF501,0xFF501) -- \twoheadleftarrow\joinrel\relbar
+-- extension(main,characters,id,size,0x21A0,0xFF501,0xFF501,0xFF50C) -- \relbar\joinrel\twoheadrightarrow
+-- extension(main,characters,id,size,0x21C4,0xFF50D,0xFF50E,0xFF50F) -- leftoverright
diff --git a/Master/texmf-dist/tex/context/base/mkxl/meta-fig.mkxl b/Master/texmf-dist/tex/context/base/mkxl/meta-fig.mkxl
index b8a22f6feff..8348dfbaf41 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/meta-fig.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/meta-fig.mkxl
@@ -42,13 +42,16 @@
[MPpage]
[\c!align=,
\c!command=\meta_process_graphic_command,
+ \c!stacking=,
\c!instance=]
\permanent\protected\def\setupMPpage
{\setupfittingpage[MPpage]}
\protected\def\meta_process_graphic_command
- {\meta_process_graphic_instance{\fittingpageparameter\c!instance}}
+ {\meta_process_graphic_instance
+ {\fittingpageparameter\c!instance}%
+ {\fittingpageparameter\c!stacking}}
%D \macros
%D {MPfigure}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/meta-grd.mkxl b/Master/texmf-dist/tex/context/base/mkxl/meta-grd.mkxl
index 009149e46ed..99db410c6cc 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/meta-grd.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/meta-grd.mkxl
@@ -36,39 +36,39 @@
\startuseMPgraphic{meta:grd:basegrid}
begingroup ;
- save sc, dx, dy, wd, ht, ox, oy, ax, ay ;
+ save nx, ny, dx, dy, ox, oy, sx, sy ;
- sc = \directdummyparameter\c!factor*\directdummyparameter\c!scale ;
- dx = \MPdpar\directdummyparameter\c!dx*sc ;
- dy = \MPdpar\directdummyparameter\c!dy*sc ;
- wd = \directdummyparameter\c!nx*dx ;
- ht = \directdummyparameter\c!ny*dy ;
- ox = \MPdpar\directdummyparameter\c!xoffset\relax ;
- oy = \MPdpar\directdummyparameter\c!yoffset\relax ;
+ sc := \directdummyparameter\c!factor*\directdummyparameter\c!scale ;
+ nx := \directdummyparameter\c!nx ;
+ ny := \directdummyparameter\c!ny ;
+ dx := \MPdpar\directdummyparameter\c!dx * sc ;
+ dy := \MPdpar\directdummyparameter\c!dy * sc ;
+ ox := \MPdpar\directdummyparameter\c!xoffset ;
+ oy := \MPdpar\directdummyparameter\c!yoffset ;
+ sx := \directdummyparameter\c!xstep ;
+ sy := \directdummyparameter\c!ystep ;
if "\directdummyparameter\c!align" = "\v!middle" :
- ax = \MPdpar\directdummyparameter\c!dx/2
- ay = \MPdpar\directdummyparameter\c!dy/2
+ ax := dx / 2 ;
+ ay := dy / 2 ;
else :
- ax = 0 ;
- ay = 0 ;
+ ax := 0 ;
+ ay := 0 ;
fi ;
- draw image (
- for i=0 step dx until wd : draw (i,0) -- (i,ht) ; endfor ;
- for i=0 step dy until ht : draw (0,i) -- (wd,i) ; endfor ;
- )
+ draw lmt_grid [ nx = nx, ny = ny, dx = 1, dy = 1 ]
+ xyscaled (dx,dy) shifted (ax, ay)
withpen pencircle scaled \MPdpar\directdummyparameter\c!rulethickness\space
withcolor "\directdummyparameter\c!rulecolor" ;
draw image (
- if \directdummyparameter\c!xstep > 0 :
- for i=1 step \directdummyparameter\c!xstep until \directdummyparameter\c!nx :
+ if sx > 0 :
+ for i=1 step sx until nx :
draw thetextext.bot(decimal i,(i*dx-ax,oy));
endfor ;
fi ;
- if \directdummyparameter\c!ystep > 0 :
- for i=1 step \directdummyparameter\c!ystep until \directdummyparameter\c!ny :
+ if sy > 0 :
+ for i=1 step sy until ny :
draw thetextext.lft(decimal i,(ox,i*dy-ay)) ;
endfor ;
fi ;
diff --git a/Master/texmf-dist/tex/context/base/mkxl/meta-imp-bitmaps.mkxl b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-bitmaps.mkxl
new file mode 100644
index 00000000000..069b7420754
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-bitmaps.mkxl
@@ -0,0 +1,338 @@
+%D \module
+%D [ file=meta-imp-bitmaps,
+%D version=2021.08.03,
+%D title=\METAPOST\ Graphics,
+%D subtitle=Bitmap Manipulations,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\registerctxluafile{libs-imp-imagemagick}{autosuffix}
+\registerctxluafile{libs-imp-graphicsmagick}{autosuffix}
+
+% todo: load png directly
+
+\startluacode
+ local char = string.char
+ local concat = table.concat
+ local unpack = unpack
+
+ graphics.bitmaps.magick = "imagemagick"
+
+ function graphics.bitmaps.load(name)
+ local inputname = name
+ local outputname = file.replacesuffix("m_k_i_v_mp_" .. name,"pnm")
+ if file.suffix(inputname) == "pnm" then
+ -- no need to convert
+ else
+ local whattodo = table.setmetatableindex( {
+ inputname = inputname,
+ outputname = outputname,
+ }, specification)
+ utilities[graphics.bitmaps.magick].convert(whattodo)
+ end
+ --
+ local files = utilities.files
+ local f = files.open(outputname)
+ local function read(f)
+ while true do
+ local s = files.readcline(f)
+ if not s then
+ return ""
+ elseif string.find(s,"^#") then
+ -- again
+ else
+ return s
+ end
+ end
+ end
+ local pnm = read(f)
+ local xy = string.split(read(f)," ")
+ local xsize = tonumber(xy[1])
+ local ysize = tonumber(xy[2])
+ local bsize = tonumber(read(f))
+ local bitmap, colorspace
+ if xsize and ysize and bsize then
+ local read = files.readbytetable
+ local data = { }
+ if pnm == "P6" then
+ colorspace = 2 -- rgb
+ for i=1,ysize do
+ local tt = { }
+ for i=1,xsize do
+ tt[i] = read(f,3)
+ end
+ data[i] = tt
+ end
+ elseif pnm == "P5" then
+ colorspace = 1 -- gray
+ for i=1,ysize do
+ data[i] = read(f,xsize)
+ end
+ elseif pnm == "P4" then
+ colorspace = 1
+ -- todo
+ end
+ bitmap = {
+ xsize = xsize,
+ ysize = ysize,
+ bsize = bsize,
+ inputname = inputname,
+ outputname = outputname,
+ colorspace = colorspace,
+ data = data,
+ }
+ end
+ files.close(f)
+ return bitmap
+ end
+
+ function graphics.bitmaps.save(b)
+ local xsize = b.xsize
+ local ysize = b.ysize
+ local bsize = b.bsize
+ local colorspace = b.colorspace
+ if xsize and ysize and bsize then
+ local data = b.data
+ local pnm = nil
+ if colorspace == 2 then
+ pnm = "P6"
+ for i=1,ysize do
+ local t = data[i]
+ for i=1,xsize do
+ t[i] = char(unpack(t[i]))
+ end
+ data[i] = concat(t)
+ end
+ elseif colorspace == 1 then
+ pnm = "P5"
+ if xsize > 1024 then
+ local t = data[i]
+ for i=1,xsize do
+ t[i] = char(t[i])
+ end
+ else
+ for i=1,ysize do
+ data[i] = char(unpack(data[i]))
+ end
+ end
+ else
+ return
+ end
+ local result = concat {
+ pnm .. "\r",
+ xsize .. " " ..
+ ysize .. "\r",
+ bsize .. "\r",
+ concat(data)
+ }
+ local outputname = file.replacesuffix(b.outputname,file.suffix(b.inputname))
+ local inputname = b.outputname
+ io.savedata(inputname,result)
+ --
+ local whattodo = table.setmetatableindex( {
+ inputname = inputname,
+ outputname = outputname,
+ }, specification)
+ utilities[graphics.bitmaps.magick].convert(whattodo)
+ b.finalname = outputname
+ end
+ end
+
+ graphics.bitmaps.manipulators = { }
+
+ function graphics.bitmaps.manipulators.invert(b)
+ local xsize = b.xsize
+ local ysize = b.ysize
+ local data = b.data
+ local colorspace = b.colorspace
+ if colorspace == 1 then
+ for r=1,ysize do
+ local row = data[r]
+ for c=1,xsize do
+ row[c] = 255 - row[c]
+ end
+ end
+ elseif colorspace == 2 then
+ for r=1,ysize do
+ local row = data[r]
+ for c=1,xsize do
+ local column = row[c]
+ column[1] = 255 - column[1]
+ column[2] = 255 - column[2]
+ column[4] = 255 - column[3]
+ end
+ end
+ end
+ end
+
+\stopluacode
+
+\continueifinputfile{meta-imp-bitmaps.mkxl}
+
+\starttext
+
+\startluacode
+
+ local random = math.random
+
+ function graphics.bitmaps.manipulators.myframe(b,f)
+ local xsize = b.xsize
+ local ysize = b.ysize
+ local data = b.data
+ local colorspace = b.colorspace
+ if colorspace == 1 then
+ local f = f or 20
+ local fx = xsize - f + 1
+ local fy = ysize - f + 1
+ for c=1,xsize do
+ for r=1,random(f-5,f+5) do
+ data[r][c] = random(0,255)
+ end
+ for r=ysize,random(fy-5,fy+5),-1 do
+ data[r][c] = random(0,255)
+ end
+ end
+ for r=1,ysize do
+ local row = data[r]
+ for c=1,random(f-5,f+5) do
+ row[c] = random(0,255)
+ end
+ for c=xsize,random(fx-5,fx+5),-1 do
+ row[c] = random(0,255)
+ end
+ end
+ elseif colorspace == 2 then
+ local f = f or 20
+ local fx = xsize - f + 1
+ local fy = ysize - f + 1
+ for c=1,xsize do
+ for r=1,random(f-5,f+5) do
+ local v = random(0,255)
+ data[r][c] = { v, v, v }
+ end
+ for r=ysize,random(fy-5,fy+5),-1 do
+ local v = random(0,255)
+ data[r][c] = { v, v, v }
+ end
+ end
+ for r=1,ysize do
+ local row = data[r]
+ for c=1,random(f-5,f+5) do
+ local v = random(0,255)
+ row[c] = { v, v, v }
+ end
+ for c=xsize,random(fx-5,fx+5),-1 do
+ local v = random(0,255)
+ row[c] = { v, v, v }
+ end
+ end
+ end
+ end
+
+ function graphics.bitmaps.manipulators.colorize(b,m)
+ local xsize = b.xsize
+ local ysize = b.ysize
+ local data = b.data
+ local colorspace = b.colorspace
+ if colorspace == 1 then
+ for r=1,ysize do
+ local row = data[r]
+ for c=1,xsize do
+ local v = row[c]
+ row[c] = m[v] or { v, v, v }
+ end
+ end
+ b.colorspace = 2
+ end
+ end
+
+ function graphics.bitmaps.manipulators.evening(b,m)
+ local xsize = b.xsize
+ local ysize = b.ysize
+ local data = b.data
+ local colorspace = b.colorspace
+ if colorspace == 1 then
+ for r=1,ysize do
+ local row = data[r]
+ for c=1,xsize do
+ row[c] = row[c] // 2
+ end
+ end
+ end
+ end
+
+ context.startTEXpage()
+ local b = graphics.bitmaps.load("hacker.jpg")
+ graphics.bitmaps.manipulators.myframe(b,20)
+ graphics.bitmaps.save(b)
+ context.externalfigure { b.finalname }
+ context.stopTEXpage()
+
+ context.startTEXpage()
+ local b = graphics.bitmaps.load("mill.png")
+ graphics.bitmaps.manipulators.invert(b)
+ graphics.bitmaps.manipulators.myframe(b,20)
+ graphics.bitmaps.tocontext(b,50*65536,nil)
+ context.stopTEXpage()
+
+ do
+
+ local m = table.setmetatableindex(function(t,k) local v = { k, k, k } t[k] = v return v end)
+
+ -- local c = { 255, 0, 0 } for i=0x00,0x1F do m[i] = c end
+ -- local c = { 0, 255, 0 } for i=0x20,0x3F do m[i] = c end
+ -- local c = { 0, 0, 255 } for i=0x40,0x5F do m[i] = c end
+ -- local c = { 255, 255, 0 } for i=0x60,0x7F do m[i] = c end
+ -- local c = { 255, 0, 255 } for i=0x80,0x9F do m[i] = c end
+ -- local c = { 0, 255, 255 } for i=0xA0,0xBF do m[i] = c end
+ -- local c = { 255, 255, 255 } for i=0xC0,0xDF do m[i] = c end
+ -- local c = { 0, 0, 0 } for i=0xE0,0xFF do m[i] = c end
+
+ local c = { 0, 0, 255 } for i=0x40,0x5F do m[i] = c end
+ local c = { 0, 255, 0 } for i=0x80,0x9F do m[i] = c end
+ local c = { 255, 0, 0 } for i=0xB0,0xCF do m[i] = c end
+
+ context.startTEXpage()
+ local b = graphics.bitmaps.load("mill.png")
+ graphics.bitmaps.manipulators.colorize(b,m)
+ graphics.bitmaps.tocontext(b,50*65536,nil)
+ context.stopTEXpage()
+
+ end
+
+ context.startTEXpage()
+ local b = graphics.bitmaps.load("mill.png")
+ graphics.bitmaps.manipulators.evening(b)
+ graphics.bitmaps.tocontext(b,50*65536,nil)
+ context.stopTEXpage()
+
+\stopluacode
+
+\protected\def\MyImage#1{\ctxlua{
+ local b = graphics.bitmaps.load("#1")
+ graphics.bitmaps.manipulators.invert(b)
+ graphics.bitmaps.manipulators.myframe(b,20)
+ graphics.bitmaps.tocontext(b,50*65536,nil)
+}}
+
+% This is inefficient because textext processes twice, so a "todo".
+
+\startMPpage
+
+ picture p ; p := textext("\MyImage{mill.png}") ;
+
+ draw p ;
+ draw (boundingbox p) enlarged -.5mm
+ withpen pensquare scaled 1mm
+ withcolor "darkred"
+ withtransparency (1,.5)
+ ;
+
+\stopMPpage
+
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkxl/meta-imp-functions.lmt b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-functions.lmt
new file mode 100644
index 00000000000..195669d08ca
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-functions.lmt
@@ -0,0 +1,260 @@
+if not modules then modules = { } end modules ['meta-imp-functions'] = {
+ version = 1.001,
+ comment = "companion to meta-imp-functions.mkxl",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files",
+}
+
+local formatters = string.formatters
+local sequenced = table.sequenced
+
+local noffunctions = 0
+local version = 1
+
+local function preparecache(p)
+ noffunctions = noffunctions + 1
+local action = p.action
+p.action = nil
+ local hash = md5.HEX(sequenced(p))
+ local name = formatters["mkiv-%s-m-f-%03i.lua"](tex.jobname,noffunctions)
+p.action = action
+ return name, hash
+end
+
+local function getcache(p)
+ local cache = p.cache
+ if cache then
+ local name, hash = preparecache(p)
+ local data = table.load(name)
+ if data and data.hash == hash and data.version == version and data.data then
+ return hash, name, data.data
+ else
+ return hash, name, false
+ end
+ else
+ return false, false, false
+ end
+end
+
+local function setcache(hash,name,data)
+ local result = {
+ version = version,
+ hash = hash,
+ data = data,
+ }
+ table.save(name,result)
+end
+
+local injectpath = mp.inject.path
+local getparameterset = metapost.getparameterset
+
+local report = logs.reporter("metapost","functions")
+
+local functions = { }
+local actions = { }
+
+function mp.registerfunction(specification)
+ local name = specification.name
+ functions[name] = specification
+end
+
+function mp.registeraction(specification)
+ local name = specification.name
+ actions[name] = specification
+end
+
+metapost.registerscript("processfunction", function()
+ local specification = getparameterset("function")
+ local name = specification.name
+ local lua = specification.lua
+ local fnction = functions[name]
+ local action = lua and actions[lua]
+ if fnction then
+ if action then
+ specification.action = action.action
+ end
+ -- statistics.starttiming(functions)
+ fnction.action(specification)
+ -- statistics.stoptiming(functions)
+ end
+end)
+
+-- statistics.register("mp function time", function()
+-- return statistics.elapsedseconds(functions,"including feedback to metapost")
+-- end)
+
+-- Here comes the fancy stuff:
+
+local math = math
+local sqrt = math.sqrt
+
+local mathfunctions = math.functions or { }
+math.functions = mathfunctions
+
+-- Todo : reference where we got the factors from because those from
+--
+-- This is Runge-Kutta-Merson 4("5")
+-- See Table 4.1. Merson 4("5") of Hairer, Nørsett, Wanner - Solving Ordinary Differential Equations I (Springer, 2008)
+--
+-- function mathfunctions.rungekutta(specification)
+-- local f = specification.action or function(t,x,y) return x, y end
+-- local x = specification.x or 0
+-- local y = specification.y or 0
+-- local t = 0
+-- local tmax = specification.tmax or 1
+-- local dt = specification.dt or tmax/10
+-- local eps = specification.eps or dt/10
+-- local r = 1
+-- -- local result = { { x, y, x, y, x, y } }
+-- local result = { { x, y } }
+-- while t < tmax do
+-- local k1x, k1y = f(t, x,
+-- y)
+-- k1x = dt * k1x
+-- k1y = dt * k1y
+-- local k2x, k2y = f(t + (1/3) * dt, x + (1/3) * k1x,
+-- y + (1/3) * k1y)
+-- k2x = dt * k2x
+-- k2y = dt * k2y
+-- local k3x, k3y = f(t + (1/3) * dt, x + (1/6) * k1x + (1/6) * k2x,
+-- y + (1/6) * k1y + (1/6) * k2y)
+-- k3x = dt * k3x
+-- k3y = dt * k3y
+-- local k4x, k4y = f(t + (1/2) * dt, x + (1/8) * k1x + (3/8) * k3x,
+-- y + (1/8) * k1y + (3/8) * k3y)
+-- k4x = dt * k4x
+-- k4y = dt * k4y
+-- local k5x, k5y = f(t + dt, x + (1/2) * k1x - (3/2) * k3x - (2) * k4x,
+-- y + (1/2) * k1y - (3/2) * k3y - (2) * k4y)
+-- k5x = dt * k5x
+-- k5y = dt * k5y
+-- --
+-- local teps = sqrt(((1/10-1/6) * k1x + (3/10) * k3x + (2/5-2/3) * k4x + (1/5 -1/6) * k5x)^2 +
+-- ((1/10-1/6) * k1y + (3/10) * k3y + (2/5-2/3) * k4y + (1/5 -1/6) * k5y)^2 )
+-- if teps < eps then
+-- dt = 0.9 * dt * (eps/teps)^(1/4)
+-- x = x + (1/10) * k1x + (3/10) * k3x + (2/5) * k4x + (1/5) * k5x
+-- y = y + (1/10) * k1y + (3/10) * k3y + (2/5) * k4y + (1/5) * k5y
+-- r = r + 1
+-- -- result[r] = { x, y, x, y, x, y }
+-- result[r] = { x, y }
+-- t = t + dt
+-- else
+-- dt = 0.9 * dt * (eps/teps)^(1/3)
+-- end
+-- end
+-- return result
+-- end
+
+local function rungekutta(specification)
+ local f = specification.action or function(t,x,y) return x, y end
+ local x = specification.x or 0
+ local y = specification.y or 0
+ local tmin = specification.tmin or 0
+ local tmax = specification.tmax or 1
+ local t = tmin
+ local rmax = specification.maxpath or 0
+ local stepsize = specification.stepsize or "adaptive"
+ local dt = specification.dt or (tmax-tmin)/10
+ local eps = specification.eps or dt/10
+ local kind = specification.kind or specification.type -- xy x y
+ local adaptive = stepsize == "adaptive"
+ local r = 1
+ local result
+ if kind ~= "tx" and kind ~= "ty" then
+ kind = "xy"
+ end
+ if kind == "xy" then
+ -- result = { { x, y, x, y, x, y } }
+ result = { { x, y } }
+ elseif kind == "tx" then
+ -- result = { { x, x, t, x, t, x } }
+ result = { { t, x } }
+ else
+ -- result = { { x, y, t, y, t, y } }
+ result = { { t, y } }
+ end
+ local hash, name, data = getcache(specification)
+ if data then
+ -- print(hash,name,"REUSING")
+ return data
+ else
+ -- print(hash,name,"GENERATING")
+ end
+ if rmax == 0 then
+ rmax = 0xFFFF
+ end
+
+ while t < tmax do
+ local k1x, k1y = f(t, x,
+ y)
+ k1x = dt * k1x
+ k1y = dt * k1y
+ local k2x, k2y = f(t + (1/3) * dt, x + (1/3) * k1x,
+ y + (1/3) * k1y)
+ k2x = dt * k2x
+ k2y = dt * k2y
+ local k3x, k3y = f(t + (1/3) * dt, x + (1/6) * k1x + (1/6) * k2x,
+ y + (1/6) * k1y + (1/6) * k2y)
+ k3x = dt * k3x
+ k3y = dt * k3y
+ local k4x, k4y = f(t + (1/2) * dt, x + (1/8) * k1x + (3/8) * k3x,
+ y + (1/8) * k1y + (3/8) * k3y)
+ k4x = dt * k4x
+ k4y = dt * k4y
+ local k5x, k5y = f(t + dt, x + (1/2) * k1x - (3/2) * k3x - (2) * k4x,
+ y + (1/2) * k1y - (3/2) * k3y - (2) * k4y)
+ k5x = dt * k5x
+ k5y = dt * k5y
+ --
+ if adaptive then
+ local teps = sqrt(((1/10-1/6) * k1x + (3/10) * k3x + (2/5-2/3) * k4x + (1/5 -1/6) * k5x)^2 +
+ ((1/10-1/6) * k1y + (3/10) * k3y + (2/5-2/3) * k4y + (1/5 -1/6) * k5y)^2 )
+ local step = eps/teps
+ if teps < eps then
+ step = step^(1/4)
+ dt = 0.9 * dt * step
+ else
+ step = step^(1/3)
+ dt = 0.9 * dt * step
+ goto again
+ end
+ end
+ ::append::
+ t = t + dt
+ x = x + (1/10) * k1x + (3/10) * k3x + (2/5) * k4x + (1/5) * k5x
+ y = y + (1/10) * k1y + (3/10) * k3y + (2/5) * k4y + (1/5) * k5y
+ r = r + 1
+ if kind == "xy" then
+ result[r] = { x, y }
+ elseif kind == "tx" then
+ result[r] = { t, x }
+ else
+ result[r] = { t, y }
+ end
+ if r >= rmax then
+ -- report("pathmax is set to %i, quiting",rmax)
+ break
+ end
+ ::again::
+ end
+ if name and hash then
+ setcache(hash,name,result)
+ end
+ return result
+end
+
+mathfunctions.rungekutta = rungekutta
+
+mp.registerfunction {
+ name = "rungekutta",
+ action = function(specification)
+ local result = rungekutta(specification)
+ if result then
+ injectpath(result)
+ else
+ injectpath { { 0, 0 } }
+ end
+ end
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/meta-imp-functions.mkxl b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-functions.mkxl
new file mode 100644
index 00000000000..dd20ea8b821
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-functions.mkxl
@@ -0,0 +1,342 @@
+%D \module
+%D [ file=meta-imp-functions,
+%D version=2022.05.17,
+%D title=\METAPOST\ Graphics,
+%D subtitle=All kind of functions,
+%D author=Mikael Sundqvist & Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+% \useMPlibrary[functions]
+
+% todo: as with contours, cache
+
+\registerctxluafile{meta-imp-functions}{autosuffix}
+
+\startMPextensions
+ newscriptindex mfid_processfunction ; mfid_processfunction := scriptindex("processfunction") ;
+
+ presetparameters "function" [ name = "unknown", smoothen = false, maxpath = 65536 ] ;
+
+ def lmt_processfunction = applyparameters "function" "lmt_do_processfunction" enddef ;
+
+ vardef lmt_do_processfunction =
+ if getparameter "function" "smoothen" :
+ for k within (runscript mfid_processfunction) : pathpoint .. endfor nocycle
+ else :
+ (runscript mfid_processfunction)
+ fi
+ enddef ;
+\stopMPextensions
+
+\continueifinputfile{meta-imp-functions.mkxl}
+
+\starttext
+
+\startluacode
+ mp.registeraction {
+ name = "ms2",
+ action = function(t, x, y)
+ return -y, x
+ end
+ }
+\stopluacode
+
+\startMPpage
+ path p ; p := lmt_processfunction [
+ name = "rungekutta"
+ lua = "ms2",
+ x = 1,
+ y = 0,
+ tmax = 6pi,
+ dt = 0.001,
+ eps = 0.00001,
+ ] xysized (5cm,5cm) ;
+ draw p withcolor red withpen pencircle scaled 1 ;
+ path q ; q := for i within p : pathpoint .. endfor nocycle ;
+ draw q withcolor green withpen pencircle scaled 1/2 ;
+\stopMPpage
+
+%
+
+\startluacode
+ mp.registeraction {
+ name = "ms3",
+ action = function(t, x, y)
+ return 1, -t*y*y
+ end
+ }
+\stopluacode
+
+\startMPpage
+ path p ; p := lmt_processfunction [
+ name = "rungekutta"
+ lua = "ms3",
+ x = 0,
+ y = 2,
+ tmax = 10,
+ dt = 0.001,
+ eps = 0.00001,
+ ] xysized (5cm,5cm) ;
+ draw p withcolor red withpen pencircle scaled 6 ;
+\stopMPpage
+
+%
+
+\startluacode
+ mp.registeraction {
+ name = "ms4",
+ action = function(t, x, y)
+ return 1, -y
+ end
+ }
+\stopluacode
+
+\startMPpage
+ path p ; p := lmt_processfunction [
+ name = "rungekutta"
+ lua = "ms4",
+ x = 0,
+ y = 1,
+ tmax = 10,
+ dt = 0.001,
+ eps = 0.00001,
+ ] scaled 5cm ;
+ draw p withcolor red withpen pencircle scaled 6 ;
+\stopMPpage
+
+%
+
+\startluacode
+ mp.registeraction {
+ name = "ms5",
+ action = function(t, x, y)
+ return x + y + x*x + y*y, x - y - x*x + y*y
+ end
+ }
+\stopluacode
+
+\startMPpage
+ path b ; numeric s;
+
+ s := 1cm ;
+ b := ((-2.5,-2.5) -- (1.5,-2.5) -- (1.5,1.5) -- (-2.5,1.5) -- cycle) scaled s ;
+
+ for i = -3.05 step 0.1 until 2.5 :
+ for j = -3.05 step 0.1 until 2.5 :
+ draw lmt_processfunction [
+ name = "rungekutta",
+ lua = "ms5",
+ x = i,
+ y = j,
+ tmax = 10,
+ dt = 0.1,
+ eps = 0.001,
+ smoothen = true,
+ maxpath = 500, % crazy large paths .. so kind of bad spec here
+ ]
+ scaled s
+ withpen pencircle scaled 0.1
+ withcolor (uniformdeviate(1),uniformdeviate(1),uniformdeviate(1))
+ ;
+ endfor ;
+ endfor ;
+
+ % so how much slack ?
+
+ draw b withpen pencircle scaled 2 ;
+ clip currentpicture to b ;
+
+\stopMPpage
+
+% https://wolfram.com/xid/0dekz2-wla
+
+\startluacode
+ mp.registeraction {
+ name = "mma1",
+ action = function(t, x, y)
+ return 1, y*math.cos(x+y)
+ end
+ }
+\stopluacode
+
+\startMPpage
+ path p ; p := lmt_processfunction [
+ name = "rungekutta"
+ lua = "mma1",
+ x = 0,
+ y = 1,
+ tmax = 30,
+ dt = 0.001,
+ eps = 0.00001,
+ ] xysized(10cm,5cm) ;
+ draw p withcolor red withpen pencircle scaled 2 ;
+ drawpoints p withcolor blue withpen pencircle scaled 2 ;
+\stopMPpage
+
+% https://wolfram.com/xid/0dekz2-gpx
+
+\startluacode
+ mp.registeraction {
+ name = "mma2",
+ action = function(t, x, y)
+ return -y-x*x, 2*x-y*y*y
+ end
+ }
+\stopluacode
+
+\startMPpage
+ path p ; p := lmt_processfunction [
+ name = "rungekutta"
+ lua = "mma2",
+ x = 1,
+ y = 1,
+ tmax = 20,
+ dt = 0.001,
+ eps = 0.00001,
+ ] xysized(10cm,10cm) ;
+ draw p withcolor red withpen pencircle scaled 2 ;
+ drawpoints p withcolor blue withpen pencircle scaled 2 ;
+\stopMPpage
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% https://wolfram.com/xid/0dekz2-xixft
+
+\startluacode
+ mp.registeraction {
+ name = "mma3",
+ action = function(t, x, y)
+ return y, -0.1 * y - math.sin(x) + 0.5 * math.cos(t)
+ end
+ }
+\stopluacode
+
+\startMPpage
+ path p ; p := lmt_processfunction [
+ name = "rungekutta"
+ lua = "mma3",
+ x = 0,
+ y = 0,
+ tmax = 100,
+ dt = 0.001,
+ eps = 0.00001,
+ ] xysized(10cm,10cm) ;
+ draw p withcolor red withpen pencircle scaled 2 ;
+ drawpoints p withcolor blue withpen pencircle scaled 2 ;
+\stopMPpage
+
+% https://wolfram.com/xid/0dekz2-dmilmp
+% Stiff! Not working!
+
+% \startluacode
+% mp.registeraction {
+% name = "mma4",
+% action = function(t, x, y)
+% return y, - x + 1000 * (1 - x * x) * y
+% end
+% }
+% \stopluacode
+
+% \startMPpage % [instance=decimalfun]
+% path p ; p := lmt_processfunction [
+% name = "rungekutta"
+% lua = "mma4",
+% x = 2,
+% y = 0,
+% tmax = 2000,
+% dt = 0.01,
+% eps = 0.0001
+% ] xynormalized(10cm,10cm) ;
+% draw p
+% withpen pencircle scaled 2
+% withcolor red
+% ;
+% % drawpoints p withcolor blue withpen pencircle scaled 2 ;
+% \stopMPpage
+
+% https://wolfram.com/xid/0dekz2-d1orb
+% Discontinuous right-hand side
+
+\startluacode
+ mp.registeraction {
+ name = "mma5",
+ action = function(t, x, y)
+ return 1, - math.cos(y) + math.floor(t)
+ end
+ }
+\stopluacode
+
+\startMPpage
+ save n ; n := 0 ;
+ for i = "xy", "tx", "ty" :
+ path p ; p := lmt_processfunction [
+ name = "rungekutta",
+ type = i,
+ lua = "mma5",
+ x = 0,
+ y = 1,
+ tmax = 3,
+ dt = 0.001,
+ eps = 0.0001,
+ ] xysized(10cm,10cm) shifted (n*11cm,0) ;
+ draw p withcolor red withpen pencircle scaled 2 ;
+ drawpoints p withcolor blue withpen pencircle scaled 2 ;
+ n := n + 1 ;
+ endfor ;
+\stopMPpage
+
+\startluacode
+ mp.registeraction {
+ name = "mma6",
+ action = function(t, x, y)
+ return y, -x
+ end
+ }
+\stopluacode
+
+\startMPpage
+ save n ; n := 0 ;
+ for i = "xy", "tx", "ty" :
+ path p ; p := lmt_processfunction [
+ name = "rungekutta",
+ kind = i,
+ lua = "mma6",
+ x = 1,
+ y = 0,
+ tmin = 0,
+ tmax = 6.28,
+ dt = 0.001,
+ eps = 0.0000001,
+ ] xysized(10cm,10cm) shifted (n*11cm,0) ;
+ draw p withcolor red withpen pencircle scaled 2 ;
+ drawpoints p withcolor blue withpen pencircle scaled 2 ;
+ n := n + 1 ;
+ endfor ;
+\stopMPpage
+
+\startMPpage
+ save n ; n := 0 ;
+ for i = "xy", "tx", "ty" :
+ path p ; p := lmt_processfunction [
+ name = "rungekutta",
+ kind = i,
+ lua = "mma6",
+ x = 1,
+ y = 0,
+ tmin = 0,
+ tmax = 6,
+ stepsize = "fixed",
+ dt = 0.5,
+ maxpath = 3,
+ ] xysized(10cm,10cm) shifted (n*11cm,0) ;
+ draw p withcolor red withpen pencircle scaled 2 ;
+ drawpoints p withcolor blue withpen pencircle scaled 2 ;
+ n := n + 1 ;
+ endfor ;
+\stopMPpage
+
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkxl/meta-imp-gamesymbols.mkxl b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-gamesymbols.mkxl
index d79e59f69f4..fa1500b60b8 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/meta-imp-gamesymbols.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-gamesymbols.mkxl
@@ -22,64 +22,54 @@
%D execute the code and leave no traces in the text flow. The code itself is not
%D that spectacular:
+%D Todo: variant -2/-3 3D dice
+
\startMPcalculation{simplefun}
+ picture DiceDots[] ; pickup pencircle scaled 3/2 ;
+
+ DiceDots[ 1] := image ( draw(4,4) ; ) ;
+ DiceDots[ 2] := image ( draw(2,6) ; draw(6,2) ; ) ;
+ DiceDots[-2] := image ( draw(6,6) ; draw(2,2) ; ) ;
+ DiceDots[ 3] := image ( draw(2,6) ; draw(4,4) ; draw(6,2) ; ) ;
+ DiceDots[-3] := image ( draw(6,6) ; draw(4,4) ; draw(2,2) ; ) ;
+ DiceDots[ 4] := image ( draw(2,6) ; draw(6,6) ; draw(2,2) ; draw(6,2) ; ) ;
+ DiceDots[ 5] := image ( draw(2,6) ; draw(6,6) ; draw(4,4) ; draw(2,2) ; draw(6,2) ; ) ;
+ DiceDots[ 6] := image ( draw(2,6) ; draw(6,6) ; draw(2,4) ; draw(6,4) ; draw(2,2) ; draw(6,2) ; ) ;
+
def DiceFrame =
pickup pencircle scaled 1/2 ;
draw unitsquare scaled 8 ;
- pickup pencircle scaled 3/2 ;
+ % pickup pencircle scaled 3/2 ;
enddef ;
vardef DiceOne =
DiceFrame ;
- draw (4,4) ;
- enddef ;
- vardef DiceTwoA =
- DiceFrame ;
- draw (2,6) ; draw (6,2) ;
- enddef ;
- vardef DiceTwoB =
- DiceFrame ;
- draw (6,6) ; draw (2,2) ;
+ draw DiceDots[1] ;
enddef ;
vardef DiceTwo =
- if hasoption "mpsfont" "option" "reverse" :
- DiceTwoB
- else :
- DiceTwoA
- fi ;
- enddef ;
- vardef DiceThreeA =
- DiceFrame ;
- draw (2,6) ; draw (4,4) ; draw (6,2) ;
- enddef ;
- vardef DiceThreeB =
DiceFrame ;
- draw (6,6) ; draw (4,4) ; draw (2,2) ;
+ draw DiceDots[if hasoption "mpsfont" "option" "reverse" : - fi 2] ;
enddef ;
vardef DiceThree =
- if hasoption "mpsfont" "option" "reverse" :
- DiceThreeB
- else :
- DiceThreeA
- fi ;
+ DiceFrame ;
+ draw DiceDots[if hasoption "mpsfont" "option" "reverse" : - fi 3] ;
enddef ;
vardef DiceFour =
DiceFrame ;
- draw (2,6) ; draw (6,6) ; draw (2,2) ; draw (6,2) ;
+ draw DiceDots[4] ;
enddef ;
vardef DiceFive =
DiceFrame ;
- draw (2,6) ; draw (6,6) ; draw (4,4) ; draw (2,2) ; draw (6,2) ;
+ draw DiceDots[5] ;
enddef ;
vardef DiceSix =
DiceFrame ;
- draw (2,6) ; draw (6,6) ; draw (2,4) ; draw (6,4) ; draw (2,2) ; draw (6,2) ;
+ draw DiceDots[6] ;
enddef ;
vardef DiceBad =
- pickup pencircle scaled 1/2 ;
- draw unitsquare scaled 8 ;
+ DiceFrame ;
draw (1,7) -- (7,1) ; draw (1,1) -- (7,7) ;
enddef ;
@@ -101,9 +91,67 @@
lmt_registerglyph [ category = "dice", private = "invaliddice", code = "DiceBad;" ] ;
+ %D The transformations come from DICE3D.MF by Thomas A. Heim (1998)
+
+ transform t[];
+
+ numeric r ; r := sqrt(1/4) ;
+
+ hide((0,0) transformed t1 = (0,0)) ;
+ hide((1,0) transformed t1 = (r,r)) ;
+ hide((0,1) transformed t1 = (0,1)) ;
+
+ hide((0,0) transformed t2 = (0,0)) ;
+ hide((1,0) transformed t2 = (1,0)) ;
+ hide((0,1) transformed t2 = (r,r)) ;
+
+ t3 := t1 shifted (8,0) ; % front to right side
+ t4 := t2 shifted (0,8) ; % front to top
+
+ vardef Diced(expr a, b, c) =
+ draw image (
+ pickup pencircle scaled 1/2 ;
+ draw image (
+ % unitsquare smoothed 1/10
+ nodraw unitsquare scaled 8 transformed t4 ;
+ nodraw unitsquare scaled 8 transformed t3 ;
+ nodraw unitsquare scaled 8 ;
+ dodraw unitsquare scaled 8 ;
+ ) ;
+ draw DiceDots[a] ;
+ draw DiceDots[b] transformed t3 ;
+ draw DiceDots[c] transformed t4 ;
+ ) ;
+ enddef ;
+
+ lmt_registerglyph [ category = "dice", unicode = "123", code = "Diced(1,2,3);", width = 12, height = 12 ] ;
+ lmt_registerglyph [ category = "dice", unicode = "135", code = "Diced(1,3,5);", width = 12, height = 12 ] ;
+ lmt_registerglyph [ category = "dice", unicode = "142", code = "Diced(1,4,2);", width = 12, height = 12 ] ;
+ lmt_registerglyph [ category = "dice", unicode = "154", code = "Diced(1,5,4);", width = 12, height = 12 ] ;
+ lmt_registerglyph [ category = "dice", unicode = "214", code = "Diced(2,1,4);", width = 12, height = 12 ] ;
+ lmt_registerglyph [ category = "dice", unicode = "231", code = "Diced(2,3,1);", width = 12, height = 12 ] ;
+ lmt_registerglyph [ category = "dice", unicode = "246", code = "Diced(2,4,6);", width = 12, height = 12 ] ;
+ lmt_registerglyph [ category = "dice", unicode = "263", code = "Diced(2,6,3);", width = 12, height = 12 ] ;
+ lmt_registerglyph [ category = "dice", unicode = "312", code = "Diced(3,1,2);", width = 12, height = 12 ] ;
+ lmt_registerglyph [ category = "dice", unicode = "326", code = "Diced(3,2,6);", width = 12, height = 12 ] ;
+ lmt_registerglyph [ category = "dice", unicode = "351", code = "Diced(3,5,1);", width = 12, height = 12 ] ;
+ lmt_registerglyph [ category = "dice", unicode = "365", code = "Diced(3,6,5);", width = 12, height = 12 ] ;
+ lmt_registerglyph [ category = "dice", unicode = "415", code = "Diced(4,1,5);", width = 12, height = 12 ] ;
+ lmt_registerglyph [ category = "dice", unicode = "421", code = "Diced(4,2,1);", width = 12, height = 12 ] ;
+ lmt_registerglyph [ category = "dice", unicode = "456", code = "Diced(4,5,6);", width = 12, height = 12 ] ;
+ lmt_registerglyph [ category = "dice", unicode = "462", code = "Diced(4,6,2);", width = 12, height = 12 ] ;
+ lmt_registerglyph [ category = "dice", unicode = "513", code = "Diced(5,1,3);", width = 12, height = 12 ] ;
+ lmt_registerglyph [ category = "dice", unicode = "536", code = "Diced(5,3,6);", width = 12, height = 12 ] ;
+ lmt_registerglyph [ category = "dice", unicode = "541", code = "Diced(5,4,1);", width = 12, height = 12 ] ;
+ lmt_registerglyph [ category = "dice", unicode = "564", code = "Diced(5,6,4);", width = 12, height = 12 ] ;
+ lmt_registerglyph [ category = "dice", unicode = "624", code = "Diced(6,2,4);", width = 12, height = 12 ] ;
+ lmt_registerglyph [ category = "dice", unicode = "632", code = "Diced(6,3,2);", width = 12, height = 12 ] ;
+ lmt_registerglyph [ category = "dice", unicode = "645", code = "Diced(6,4,5);", width = 12, height = 12 ] ;
+ lmt_registerglyph [ category = "dice", unicode = "653", code = "Diced(6,5,3);", width = 12, height = 12 ] ;
+
\stopMPcalculation
-%D At the \TEX\ end we define three features. The reverse is just there for fun. The
+%D At the \TEX\ end we define four features. The reverse is just there for fun. The
%D digits features will map digits onto dice.
\definefontfeature
@@ -120,10 +168,48 @@
[dice:digits]
[dice:digits=yes]
+\definefontfeature
+ [dice:three]
+ [dice:three=yes]
+
%D The mapping to dice happens here:
\startluacode
+ -- before the digits feature
+
+ fonts.handlers.otf.addfeature("dice:three", {
+ type = "ligature",
+ order = { "dice:three" },
+ nocheck = true,
+ data = {
+ [123] = { 0x31, 0x32, 0x33 },
+ [135] = { 0x31, 0x33, 0x35 },
+ [142] = { 0x31, 0x34, 0x32 },
+ [154] = { 0x31, 0x35, 0x34 },
+ [214] = { 0x32, 0x31, 0x34 },
+ [231] = { 0x32, 0x33, 0x31 },
+ [246] = { 0x32, 0x34, 0x36 },
+ [263] = { 0x32, 0x36, 0x33 },
+ [312] = { 0x33, 0x31, 0x32 },
+ [326] = { 0x33, 0x32, 0x36 },
+ [351] = { 0x33, 0x35, 0x31 },
+ [365] = { 0x33, 0x36, 0x35 },
+ [415] = { 0x34, 0x31, 0x35 },
+ [421] = { 0x34, 0x32, 0x31 },
+ [456] = { 0x34, 0x35, 0x36 },
+ [462] = { 0x34, 0x36, 0x32 },
+ [513] = { 0x35, 0x31, 0x33 },
+ [536] = { 0x35, 0x33, 0x36 },
+ [541] = { 0x35, 0x34, 0x31 },
+ [564] = { 0x35, 0x36, 0x34 },
+ [624] = { 0x36, 0x32, 0x34 },
+ [632] = { 0x36, 0x33, 0x32 },
+ [645] = { 0x36, 0x34, 0x35 },
+ [653] = { 0x36, 0x35, 0x33 },
+ }
+ } )
+
-- local invalid = fonts.helpers.privateslot("invaliddice")
fonts.handlers.otf.addfeature("dice:digits", {
@@ -336,14 +422,20 @@
\definefont[DiceN][Serif*dice:normal]
\definefont[DiceR][Serif*dice:reverse]
\definefont[DiceD][Serif*dice:normal,dice:digits]
+ \definefont[DiceT][Serif*dice:normal,dice:three,dice:digits]
\startTEXpage[offset=3pt]
\DiceN
\dostepwiserecurse{"2680}{"2685}{1}{\char#1\quad}%
- \DiceN
+ \DiceR
\dostepwiserecurse{"2680}{"2685}{1}{\char#1\quad}%
\DiceD
\darkblue 2\quad5\quad3\quad0
\stopTEXpage
+ \startTEXpage[offset=3pt]
+ \showglyphs \DiceT 1 2 3 4 5 6
+ \showglyphs \DiceT 653 421
+ \stopTEXpage
+
\stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkxl/meta-imp-glyphs.mkxl b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-glyphs.mkxl
new file mode 100644
index 00000000000..96f7aecd3b6
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-glyphs.mkxl
@@ -0,0 +1,65 @@
+%D \module
+%D [ file=meta-imp-glyphs,
+%D version=2022.10.26, % moved from test files by MS and HH
+%D title=\METAPOST\ Graphics,
+%D subtitle=Glyph Shape Manipulations,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\startMPdefinitions
+
+ def LoadGlyph(expr tag, filename, unicode) =
+ glyphshape_start(filename,unicode) ;
+ expandafter picture scantokens(tag & "char");
+ expandafter path scantokens(tag & "bbox") ;
+ expandafter numeric scantokens(tag & "accent") ;
+ expandafter numeric scantokens(tag & "italic") ;
+ scantokens(tag & "char") := image (draw for i=1 upto glyphshape_n : glyphshape_path(i) && endfor cycle ;) ;
+ scantokens(tag & "bbox") := glyphshape_usedbox ;
+ scantokens(tag & "accent") := glyphshape_accent ;
+ scantokens(tag & "italic") := xpart urcorner glyphshape_usedbox - glyphshape_italic ;
+ glyphshape_stop ;
+ enddef ;
+
+ def ScaleGlyph(expr tag, s) =
+ scantokens(tag & "char") := scantokens(tag & "char") scaled s ;
+ scantokens(tag & "bbox") := scantokens(tag & "bbox") scaled s ;
+ scantokens(tag & "accent") := s * scantokens(tag & "accent") ;
+ scantokens(tag & "italic") := s * scantokens(tag & "italic") ;
+ enddef ;
+
+ def ShiftGlyph(expr tag, dx, dy) =
+ scantokens(tag & "char") := scantokens(tag & "char") shifted (dx, dy) ;
+ scantokens(tag & "bbox") := scantokens(tag & "bbox") shifted (dx, dy) ;
+ scantokens(tag & "accent") := scantokens(tag & "accent") + dx ;
+ scantokens(tag & "italic") := scantokens(tag & "italic") + dx ;
+ enddef ;
+
+ def DrawGlyph(expr tag) =
+ draw scantokens(tag & "char") withpen pencircle scaled 1 ;
+ draw scantokens(tag & "bbox") withcolor "darkyellow" ;
+ draw (scantokens(tag & "accent"), (ypart urcorner scantokens(tag & "bbox"))) withcolor "darkmagenta" withpen pencircle scaled 5 ;
+ draw (scantokens(tag & "italic"), .5(ypart urcorner scantokens(tag & "bbox"))) withcolor "orange" withpen pencircle scaled 5 ;
+ enddef ;
+
+\stopMPdefinitions
+
+\startMPdefinitions
+
+ def ShowShape(expr font, slot) =
+ glyphshape_start(font, slot) ;
+ draw for i=1 upto glyphshape_n : glyphshape_path(i) && endfor cycle ;
+ draw glyphshape_boundingbox withcolor red ;
+ draw glyphshape_usedline withcolor green ;
+ draw glyphshape_usedbox withcolor blue ;
+ draw (glyphshape_accent,glyphshape_depth) withcolor "orange" withpen pencircle scaled 5 ;
+ draw (glyphshape_italic,glyphshape_depth) withcolor "orange" withpen pencircle scaled 5 ;
+ glyphshape_stop ;
+ enddef;
+
+\stopMPdefinitions
diff --git a/Master/texmf-dist/tex/context/base/mkxl/meta-imp-kindergarten.mkxl b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-kindergarten.mkxl
new file mode 100644
index 00000000000..6b2402bf081
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-kindergarten.mkxl
@@ -0,0 +1,118 @@
+%D \module
+%D [ file=meta-imp-kindergarten,
+%D version=2020.00.00,
+%D title=\METAPOST\ Graphics,
+%D subtitle=Kindergarten Math,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+% \nopdfcompression
+
+%D For Arthur, who told me that about the urban legend that \CONTEXT\ can do only
+%D kindergarten math. Somehow I'd forgotten top add this to the distribution
+
+\startMPcalculation{simplefun}
+
+ pen KindergartenPen ; KindergartenPen := pencircle scaled 1 ;
+
+ % 10 x 10 grid
+
+ vardef KindergartenEqual =
+ draw image
+ (
+ draw (2,6) -- (9,5) ;
+ draw (2,4) -- (8,3) ;
+ )
+ shifted (0,-2)
+ withpen KindergartenPen
+ withcolor "KindergartenEqual"
+ enddef ;
+ vardef KindergartenPlus =
+ draw image
+ (
+ draw (1,4) -- (9,5) ;
+ draw (4,1) -- (5,8) ;
+ )
+ shifted (0,-2)
+ withpen KindergartenPen
+ withcolor "KindergartenPlus"
+ enddef ;
+ vardef KindergartenMinus =
+ draw image
+ (
+ draw (1,5) -- (9,4) ;
+ )
+ shifted (0,-2)
+ withpen KindergartenPen
+ withcolor "KindergartenMinus"
+ enddef ;
+ vardef KindergartenTimes =
+ draw image
+ (
+ draw (2,1) -- (9,8) ;
+ draw (8,1) -- (2,8) ;
+ )
+ shifted (0,-2)
+ withpen KindergartenPen
+ withcolor "KindergartenTimes"
+ enddef ;
+ vardef KindergartenDivided =
+ draw image
+ (
+ draw (2,1) -- (8,9) ;
+ )
+ shifted (0,-2)
+ withpen KindergartenPen
+ withcolor "KindergartenDivided"
+ enddef ;
+
+ lmt_registerglyphs [
+ name = "kindergarten",
+ units = 10,
+ % usecolor = true,
+ width = 10,
+ height = 8,
+ depth = 2,
+ ] ;
+
+ lmt_registerglyph [ category = "kindergarten", unicode = "0x003D",
+ code = "KindergartenEqual"
+ ] ;
+ lmt_registerglyph [ category = "kindergarten", unicode = "0x002B",
+ code = "KindergartenPlus"
+ ] ;
+ lmt_registerglyph [ category = "kindergarten", unicode = "0x2212",
+ code = "KindergartenMinus"
+ ] ;
+ lmt_registerglyph [ category = "kindergarten", unicode = "0x00D7",
+ code = "KindergartenTimes"
+ ] ;
+ lmt_registerglyph [ category = "kindergarten", unicode = "0x002F",
+ code = "KindergartenDivided"
+ ] ;
+
+\stopMPcalculation
+
+\definecolor[KindergartenEqual] [darkgreen]
+\definecolor[KindergartenPlus] [darkred]
+\definecolor[KindergartenMinus] [darkred]
+\definecolor[KindergartenTimes] [darkblue]
+\definecolor[KindergartenDivided][darkblue]
+
+\continueifinputfile{meta-imp-kindergarten.mkxl}
+
+\definefontfeature
+ [mathextra]
+ [metapost=kindergarten]
+
+\setupbodyfont[dejavu]
+
+\startTEXpage[offset=10pt]
+ $ y = 2 \times x + a - b / 3 $ \par
+ \hfill \infofont{kindergarten math}
+\stopTEXpage
diff --git a/Master/texmf-dist/tex/context/base/mkxl/meta-imp-magick.mkxl b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-magick.mkxl
new file mode 100644
index 00000000000..1adc7be83ac
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-magick.mkxl
@@ -0,0 +1,108 @@
+%D \module
+%D [ file=meta-imp-magick,
+%D version=2021.08.03,
+%D title=\METAPOST\ Graphics,
+%D subtitle=Magick Manipulations,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\registerctxluafile{libs-imp-graphicsmagick}{autosuffix}
+\registerctxluafile{libs-imp-imagemagick}{autosuffix}
+
+\startluacode
+ local converters = {
+ im = "imagemagick",
+ imagemagick = "imagemagick",
+ magick = "imagemagick",
+ }
+
+ local frozen = false
+ local convert = false
+
+ -- for some reason we cannot load both libraries
+
+ function mp.lmt_magick_convert()
+ local specification = metapost.getparameterset("magick")
+ local inputname = specification.filename
+ if inputname then
+ -- we don't want to trigger reuse when we have the same input file
+ local hash = md5.HEX(table.sequenced(specification))
+ local outputname = file.addsuffix("m_k_i_v_mp_fuzzy_" .. hash,file.suffix(inputname))
+ -- make the table a bit unique and don't polute it
+ local whattodo = table.setmetatableindex( {
+ inputname = inputname,
+ outputname = outputname,
+ }, specification)
+ luatex.registertempfile(outputname)
+ -- now do the magick
+ if not convert then
+ convert = utilities[converters[specification.converter or "gm"] or "graphicsmagick"].convert
+ end
+ convert(whattodo)
+ -- and return the result
+ return [[figure("]] .. outputname .. [[")]]
+ else
+ -- bad luck
+ return [[textext("missing filename")]]
+ end
+ end
+\stopluacode
+
+\startMPdefinitions
+
+ presetparameters "magick" [
+ filename = "unset",
+ % blur = [ radius = 10, sigma = 5 ],
+ % noise = [ type = 4 ],
+ ] ;
+
+ def lmt_magick = applyparameters "magick" "lmt_do_magick" enddef ;
+
+ vardef lmt_do_magick = lua.mp.lmt_magick_convert() enddef ;
+
+\stopMPdefinitions
+
+\continueifinputfile{meta-imp-magick.mkxl}
+
+\enabletrackers[*lib*]
+
+\startMPpage
+ presetparameters "magick" [
+ converter = "magick", % comment / uncomment
+ ] ;
+ draw lmt_magick [
+ filename = "hacker.jpg",
+ % for im
+ options = { "-rotate", 180 },
+ ] ysized 4cm ;
+
+ draw lmt_magick [
+ filename = "hacker.jpg",
+ % for gm
+ blur = [ radius = 10, sigma = 5 ],
+ noise = [ type = 2 ],
+ % for gm
+ options = { "-noise", 2 },
+ ] ysized 4cm shifted (8cm, -4cm) ;
+
+ draw lmt_magick [
+ filename = "hacker.jpg",
+ % for gm
+ blur = [ radius = 5, sigma = 3 ],
+ noise = [ type = 4 ],
+ % for gm
+ options = { "-noise", 4 },
+ ] ysized 4cm shifted (0, -4cm) ;
+
+ draw lmt_magick [
+ filename = "hacker.jpg",
+ blur = [ radius = 10, sigma = 5 ],
+ % for gm
+ noise = [ type = 4 ],
+ ] ysized 4cm shifted (8cm, 0cm) ;
+\stopMPpage
diff --git a/Master/texmf-dist/tex/context/base/mkxl/meta-imp-placeholders.mkxl b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-placeholders.mkxl
new file mode 100644
index 00000000000..aa48b814c02
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-placeholders.mkxl
@@ -0,0 +1,83 @@
+%D \module
+%D [ file=meta-imp-placeholders,
+%D version=2021.02.01,
+%D title=\METAPOST\ Graphics,
+%D subtitle=Missing Glyph Placeholders,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%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 a drop in for the already existing placeholder function. It could be made
+%D more clever by hashing similar shapes but as this is mostly a diagnostic feature
+%D we go a quick an ddirty two dimensional array.
+
+%D It is now mostly a file one can run to get an idea what the replace macro triggers
+%D so I've added it to the distribution.
+
+% \startMPcalculation{simplefun}
+% loadfile("mp-miss.mpxl") ;
+% \stopMPcalculation
+%
+% \startluacode
+%
+% local chardata = characters.data
+% local fontdata = fonts.hashes.identifiers
+% local mapping = fonts.checkers.mapping
+%
+% function fonts.checkers.placeholder(font,char)
+% local category = chardata[char].category or "lu" -- todo: unknown
+% local fakedata = mapping[category]
+% local tfmdata = fontdata[font]
+% local units = tfmdata.parameters.units or 1000
+% local slant = (tfmdata.parameters.slant or 0)/65536
+% local scale = units/1000
+% local rawdata = tfmdata.shared and tfmdata.shared.rawdata
+% local weight = (rawdata and rawdata.metadata and rawdata.metadata.pfmweight or 400)/400
+% local specification = {
+% code = "MissingGlyph",
+% scale = scale,
+% slant = slant,
+% weight = weight,
+% namespace = font,
+% shapes = { { shape = fakedata[1], color = fakedata[2] } },
+% }
+% fonts.helpers.setmetaglyphs("missing", font, char, specification)
+% end
+%
+% \stopluacode
+
+%D We enable the checker:
+
+% \enabletrackers[fonts.missing=replace]
+
+\replacemissingcharacters
+
+\continueifinputfile{meta-imp-placeholders.mkxl}
+
+% \enableexperiments[fonts.compact]
+
+% \showglyphs
+
+\startbuffer
+ \startlines[before=,after=]
+ \strut {\tf test \char 12345\ test \char 12346\ test}
+ \strut {\bf test \char 12345\ test \char 12346\ test}
+ \strut {\it test \char 12345\ test \char 12346\ test}
+ \strut {\bi test \char 12345\ test \char 12346\ test}
+ \strut {test á½€ Ï Ï† α ν á¿– ο Ï‚ test}
+ \stoplines
+\stopbuffer
+
+\starttext
+ \startTEXpage[offset=2pt,strut=no]
+ \getbuffer
+ \switchtobodyfont[pagella]
+ \getbuffer
+ \switchtobodyfont[dejavu]
+ \getbuffer
+ \stopTEXpage
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkxl/meta-imp-txt.lmt b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-txt.lmt
new file mode 100644
index 00000000000..e4b88bd3698
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/meta-imp-txt.lmt
@@ -0,0 +1,116 @@
+if not modules then modules = { } end modules ['meta-imp-txt'] = {
+ version = 1.001,
+ comment = "companion to meta-imp-txt.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files",
+}
+
+local setmetatableindex = table.setmetatableindex
+
+local texset = tex.set
+
+local scan = mp.scan
+local scannumeric = scan.numeric
+local scaninteger = scan.integer
+local scanboolean = scan.boolean
+local scanstring = scan.string
+
+local expandmacro = token.expandmacro -- todo
+
+local bpfactor = number.dimenfactors.bp
+
+local metapost = metapost
+metapost.parshapes = { }
+
+local parshapes = { }
+local properties = { }
+
+-- initialize shapes to 0 hsize
+
+function metapost.parshapes.reset()
+ parshapes = { }
+ properties = { }
+end
+
+function metapost.parshapes.next()
+ properties = { }
+ parshapes[#parshapes+1] = properties
+end
+
+function metapost.parshapes.inspect()
+ inspect(parshapes)
+end
+
+function metapost.parshapes.getshape(n)
+ return (parshapes and parshapes[n]) or parshapes or nil
+end
+
+function metapost.parshapes.get(index,name)
+ local v = parshapes[index][name]
+ if type(v) == "boolean" then
+ context(v and 1 or 0)
+ else
+ context(v)
+ end
+end
+
+function metapost.parshapes.wholeshape() -- maybe just collect them earlier
+ local t, n = { }, 0
+ for i=1,#parshapes do
+ local s = parshapes[i].shape
+ if s then
+ for i=1,#s do
+ n = n + 1
+ t[n] = s[i]
+ end
+ end
+ end
+ if n > 0 then
+ texset("parshape",t)
+ end
+end
+
+metapost.registerscript("setparshapeproperty", function()
+ local k = scanstring()
+ if k == "line" then
+ local entry = properties.shape[scannumeric()]
+ local indent = scannumeric() / bpfactor
+ local width = scannumeric() / bpfactor
+ entry[1] = indent
+ entry[2] = width
+ elseif k == "lines" then
+ properties.lines = scaninteger()
+ properties.shape = setmetatableindex(function(t,k)
+ local v = { 0, properties.width or 0 }
+ t[k] = v
+ return v
+ end)
+ elseif k == "first" then
+ properties[k] = scanboolean()
+ elseif k == "inspect" then
+ inspect(properties)
+ else
+ properties[k] = scannumeric() / bpfactor
+ end
+end)
+
+interfaces.implement {
+ name = "setparagraphmetashape",
+ public = true,
+ protected = true,
+ arguments = "optional",
+ actions = function(list)
+ if list and list ~= "" then
+ list = utilities.parsers.settings_to_array(list)
+ if #list > 0 then
+ metapost.parshapes.reset()
+ for i=1,#list do
+ metapost.parshapes.next()
+ expandmacro("spac_shapes_calculate","{"..list[i].."}")
+ end
+ metapost.parshapes.wholeshape()
+ end
+ end
+ end
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/meta-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/meta-ini.lmt
index ed7b2264f5d..be5a4f947ac 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/meta-ini.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/meta-ini.lmt
@@ -8,7 +8,6 @@ if not modules then modules = { } end modules ['meta-ini'] = {
local tonumber = tonumber
local format = string.format
-local concat = table.concat
local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns
local P, Cs, R, S, C, Cc = lpeg.P, lpeg.Cs, lpeg.R, lpeg.S, lpeg.C, lpeg.Cc
@@ -16,68 +15,68 @@ metapost = metapost or { }
local metapost = metapost
local context = context
-local colorhash = attributes.list[attributes.private('color')]
-local textype = tex.type
-local MPcolor = context.MPcolor
-
-do
-
- local dimenorname =
- lpegpatterns.validdimen / function(s)
- context("\\the\\dimexpr %s",s)
- end
- + (C(lpegpatterns.float) + Cc(1)) * lpegpatterns.space^0 * P("\\") * C(lpegpatterns.letter^1) / function(f,s)
- local t = textype(s)
- if t == "dimen" then
- context("\\the\\dimexpr %s\\%s\\relax",f,s)
- elseif t == "count" then
- context("\\the\\numexpr \\%s * %s\\relax",s,f) -- <n>\scratchcounter is not permitted
- end
- end
-
- local splitter = lpeg.splitat("::",true)
-
- interfaces.implement {
- name = "prepareMPvariable",
- arguments = "string",
- actions = function(v)
- if v == "" then
- -- MPcolor("black")
- context("black")
- else
- local typ, var = lpegmatch(splitter,v)
- if not var then
- -- parse
- if colorhash[v] then
- -- MPcolor(v)
- context("%q",var)
- elseif tonumber(v) then
- context(v)
- elseif not lpegmatch(dimenorname,v) then
- context("\\number %s",v) -- 0.4 ...
- end
- elseif typ == "d" then -- to be documented
- -- dimension
- context("\\the\\dimexpr %s\\relax",var)
- elseif typ == "n" then -- to be documented
- -- number
- context("\\the\\numexpr %s\\relax",var)
- elseif typ == "s" then -- to be documented
- -- string
- -- context(var)
- context("%q",var)
- elseif typ == "c" then -- to be documented
- -- color
- -- MPcolor(var)
- context("%q",var)
- else
- context(var)
- end
- end
- end
- }
-
-end
+-- local colorhash = attributes.list[attributes.private('color')]
+-- local textype = tex.type
+-- local MPcolor = context.MPcolor
+--
+-- do
+--
+-- local dimenorname =
+-- lpegpatterns.validdimen / function(s)
+-- context("\\the\\dimexpr %s",s)
+-- end
+-- + (C(lpegpatterns.float) + Cc(1)) * lpegpatterns.space^0 * P("\\") * C(lpegpatterns.letter^1) / function(f,s)
+-- local t = textype(s)
+-- if t == "dimen" then
+-- context("\\the\\dimexpr %s\\%s\\relax",f,s)
+-- elseif t == "count" then
+-- context("\\the\\numexpr \\%s * %s\\relax",s,f) -- <n>\scratchcounter is not permitted
+-- end
+-- end
+--
+-- local splitter = lpeg.splitat("::",true)
+--
+-- interfaces.implement {
+-- name = "prepareMPvariable",
+-- arguments = "string",
+-- actions = function(v)
+-- if v == "" then
+-- -- MPcolor("black")
+-- context("black")
+-- else
+-- local typ, var = lpegmatch(splitter,v)
+-- if not var then
+-- -- parse
+-- if colorhash[v] then
+-- -- MPcolor(v)
+-- context("%q",var)
+-- elseif tonumber(v) then
+-- context(v)
+-- elseif not lpegmatch(dimenorname,v) then
+-- context("\\number %s",v) -- 0.4 ...
+-- end
+-- elseif typ == "d" then -- to be documented
+-- -- dimension
+-- context("\\the\\dimexpr %s\\relax",var)
+-- elseif typ == "n" then -- to be documented
+-- -- number
+-- context("\\the\\numexpr %s\\relax",var)
+-- elseif typ == "s" then -- to be documented
+-- -- string
+-- -- context(var)
+-- context("%q",var)
+-- elseif typ == "c" then -- to be documented
+-- -- color
+-- -- MPcolor(var)
+-- context("%q",var)
+-- else
+-- context(var)
+-- end
+-- end
+-- end
+-- }
+--
+-- end
do
diff --git a/Master/texmf-dist/tex/context/base/mkxl/meta-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/meta-ini.mkxl
index 823d369f0af..16b97e8cc40 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/meta-ini.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/meta-ini.mkxl
@@ -11,8 +11,6 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-%D Some lmtx upgrading work needs to be done here.
-%D
%D For real \METAFUN\ magic see \type {https://art-aleatoire.com/}.
% initializations:
@@ -69,6 +67,8 @@
\newtoks \everyMPgraphic % mp % public or not ?
\appendtoks
+ \setcatcodetable\ctxcatcodes
+ % then this is not needed:
\restoreendofline % see interferences-001.tex
\to \everyMPgraphic
@@ -82,6 +82,7 @@
\installcorenamespace{mpgraphic}
\installcorenamespace{mpstaticgraphic}
\installcorenamespace{mpclip}
+\installcorenamespace{mpcategory}
\newtoks \t_meta_initializations % tex, each
@@ -101,17 +102,17 @@
\gtoksapp\t_meta_definitions{#2}%
\let\currentMPinstance\m_meta_saved_instance}
-\aliased\let\stopMPdefinitions\relax
+\permanent\protected\lettonothing\stopMPdefinitions
\permanent\tolerant\protected\def\startMPextensions#=#:#2\stopMPextensions % we could use buffers instead
{\clf_setmpextensions{#1}{#2}}
-\aliased\let\stopMPextensions\relax
+\permanent\protected\lettonothing\stopMPextensions
\permanent\protected\def\startMPinitializations#1\stopMPinitializations % for all instances, when enabled
{\gtoksapp\t_meta_initializations{#1}}
-\aliased\let\stopMPinitializations\relax
+\permanent\protected\lettonothing\stopMPinitializations
\permanent\tolerant\protected\def\startMPinclusions[#1]#*#=#:#3\stopMPinclusions
{\let\m_meta_saved_instance\currentMPinstance % \pushmacro
@@ -125,7 +126,7 @@
\gtoksapp\t_meta_inclusions{#3}%
\let\currentMPinstance\m_meta_saved_instance} % \popmacro
-\aliased\let\stopMPinclusions\relax
+\permanent\protected\lettonothing\stopMPinclusions
% The next was broken since we added instances so it will go away!
@@ -169,12 +170,11 @@
\t_meta_inclusions \emptytoks % in case we redefine
\to \everydefineMPinstance
-\permanent\protected\def\resetMPinstance[#1]%
- {\writestatus\m!metapost{reset will be implemented when needed}}
+% \permanent\protected\def\resetMPinstance[#1]%
+% {\writestatus\m!metapost{reset will be implemented when needed}}
\def\meta_analyze_graphicname[#1]%
- %{\normalexpanded{\meta_analyze_graphicname_indeed[#1::::]}}
- {\normalexpanded{\meta_analyze_graphicname_indeed[#1}::::]}
+ {\normalexpanded{\meta_analyze_graphicname_indeed[#1::::]}}
\def\meta_show_properties_indeed
{\writestatus{metapost}{name: \currentMPgraphicname, instance: \currentMPinstance, format: \currentMPformat}}
@@ -203,10 +203,11 @@
\mutable\def\currentMPinstance {\defaultMPinstance}
\mutable\def\currentMPformat {\currentMPinstance}
-\defineMPinstance[metafun] [\s!format=metafun,\s!extensions=\v!yes,\s!initializations=\v!yes]
-\defineMPinstance[minifun] [\s!format=minifun,\s!extensions=\v!yes,\s!initializations=\v!yes]
-\defineMPinstance[extrafun] [\s!format=metafun,\s!extensions=\v!yes,\s!initializations=\v!yes]
+\defineMPinstance[metafun] [\s!format=metafun,\s!extensions=\v!yes,\s!initializations=\v!yes,\c!method=\s!double]
+\defineMPinstance[minifun] [\s!format=minifun,\s!extensions=\v!yes,\s!initializations=\v!yes,\c!method=\s!double]
+\defineMPinstance[extrafun] [\s!format=metafun,\s!extensions=\v!yes,\s!initializations=\v!yes,\c!method=\s!double]
\defineMPinstance[lessfun] [\s!format=metafun]
+\defineMPinstance[scaledfun] [\s!format=metafun,\s!extensions=\v!yes,\s!initializations=\v!yes,\c!method=\s!scaled]
\defineMPinstance[doublefun] [\s!format=metafun,\s!extensions=\v!yes,\s!initializations=\v!yes,\c!method=\s!double]
\defineMPinstance[binaryfun] [\s!format=metafun,\s!extensions=\v!yes,\s!initializations=\v!yes,\c!method=\s!binary]
\defineMPinstance[decimalfun] [\s!format=metafun,\s!extensions=\v!yes,\s!initializations=\v!yes,\c!method=\s!decimal]
@@ -215,6 +216,7 @@
\defineMPinstance[metapost] [\s!format=mpost]
\defineMPinstance[nofun] [\s!format=mpost]
+\defineMPinstance[scaledpost] [\s!format=mpost,\c!method=\s!scaled]
\defineMPinstance[doublepost] [\s!format=mpost,\c!method=\s!double]
\defineMPinstance[binarypost] [\s!format=mpost,\c!method=\s!binary]
\defineMPinstance[decimalpost][\s!format=mpost,\c!method=\s!decimal]
@@ -281,32 +283,33 @@
\meta_relocate_graphic
\popMPboundingbox}
-\protected\def\meta_process_graphic_instance#1%
+\protected\def\meta_process_graphic_instance#1#2% used in startMPpage
{\edef\currentMPinstance{#1}%
\ifempty\currentMPinstance
\let\currentMPinstance\defaultMPinstance
\fi
+ \setmpcategoryparameter\c!stacking{#2}%
\edef\currentMPformat{\MPinstanceparameter\s!format}%
\meta_process_graphic}
\protected\def\meta_process_graphic#1% todo: extensions and inclusions outside beginfig
{\meta_start_current_graphic
\forgetall
- \edef\p_extensions{\MPinstanceparameter\s!extensions}%
\meta_process_graphic_start
\normalexpanded{\noexpand\clf_mpgraphic
instance {\currentMPinstance}%
format {\currentMPformat}%
data {#1;}%
initializations {\meta_flush_current_initializations}%
- \ifx\p_extensions\v!yes
- extensions {\clf_getmpextensions{\currentMPinstance}}% goes through tex again
+ \ifcstok{\MPinstanceparameter\s!extensions}\v!yes
+ extensions {\clf_getmpextensions{\currentMPinstance}}% goes through tex again, can be done better now
\fi
inclusions {\meta_flush_current_inclusions}%
definitions {\meta_flush_current_definitions}%
figure {\MPaskedfigure}%
+ filtering {\mpcategoryparameter\c!stacking}
method {\MPinstanceparameter\c!method}%
- namespace {\??graphicvariable\currentmpvariableclass:}%
+ namespace {\??graphicvariable\currentmpcategory:}%
\relax}%
\meta_process_graphic_stop
\meta_stop_current_graphic}
@@ -365,15 +368,15 @@
\permanent\protected\def\finalizeMPdrawing
{\MPdrawingdonetrue}
-\mutable\let\MPdrawingdata\empty
+\mutable\lettonothing\MPdrawingdata
\permanent\protected\def\resetMPdrawing
- {\glet\MPdrawingdata\empty
+ {\glettonothing\MPdrawingdata
\global\MPdrawingdonefalse}
\permanent\protected\def\pushMPdrawing
{\globalpushmacro\MPdrawingdata
- \glet\MPdrawingdata\empty}
+ \glettonothing\MPdrawingdata}
\permanent\protected\def\popMPdrawing
{\globalpopmacro\MPdrawingdata}
@@ -395,7 +398,7 @@
{\xdef\MPdrawingdata{\MPdrawingdata#2}}%
\egroup}
-\aliased\let\stopMPdrawing\relax
+\permanent\protected\lettonothing\stopMPdrawing
\permanent\def\MPdrawing#1%
{\relax
@@ -407,19 +410,19 @@
\permanent\protected\def\startMPclip#1#2\stopMPclip % todo: store at the lua end or just store less
{\gdefcsname\??mpclip#1\endcsname{#2}}
-\aliased\let\stopMPclip\relax
+\permanent\protected\lettonothing\stopMPclip
-\mutable\def\width {0 } % left-over
-\mutable\def\height{0 } % left-over
+\mutable\def\width {0 } % left-over, obsolete
+\mutable\def\height{0 } % left-over, obsolete
-\mutable\let\currentMPclip\empty
+\mutable\lettonothing\currentMPclip
\protected\def\meta_grab_clip_path#1#2#3%
{\begingroup
\d_overlay_width #2\relax
\d_overlay_height#3\relax
- \edef\width {\the\d_overlay_width \space}% hm
- \edef\height{\the\d_overlay_height\space}% hm
+ \edef\width {\the\d_overlay_width \space}% obsolete
+ \edef\height{\the\d_overlay_height\space}% obsolete
\edef\currentMPclip{#1}%
\ifcsname\??mpclip\currentMPclip\endcsname
\meta_grab_clip_path_yes
@@ -433,7 +436,7 @@
\normalexpanded{\noexpand\clf_mpsetclippath
instance {\currentMPinstance}%
format {\currentMPformat}%
- data {\csname\??mpclip\currentMPclip\endcsname}%
+ data {\begincsname\??mpclip\currentMPclip\endcsname}%
initializations {\meta_flush_current_initializations}%
useextensions {\MPinstanceparameter\s!extensions}%
inclusions {\meta_flush_current_inclusions}%
@@ -493,97 +496,59 @@
%D Currently the inheritance of backgrounds does not work and we might drop it
%D anyway (too messy)
-\newbox\b_meta_variable_box
-
-\mutable\let \currentmpvariableclass \empty % public
-
-\let \m_meta_current_variable \empty
-\let \m_meta_current_variable_template\empty
-
-% \installcorenamespace{graphicvariable} % already set
-
-\def\meta_prepare_variable_default{\MPcolor{black}} % just to be sure we use a color but ...
-
-\permanent\tolerant\protected\def\setupMPvariables[#1]#*[#2]%
- {\ifarguments
- \or
- \getrawparameters[\??graphicvariable:][#1]%
- \else
- \getrawparameters[\??graphicvariable#1:][#2]%
- \fi}
+\lettonothing\m_meta_current_variable
-\permanent\tolerant\protected\def\presetMPvariable[#1]#*[#2=#3]%
- {\ifcsname\??graphicvariable#1:#2\endcsname \else
- \defcsname\??graphicvariable#1:#2\endcsname{#3}%
- \fi}
+\installbasicnativeautosetuphandler \??mpcategory {mpcategory}
-\permanent\def\MPrawvar#1#2% no checking
- {\begincsname\??graphicvariable#1:#2\endcsname}
+\permanent\tolerant\protected\def\useMPvariables[#1]#*[#2]{} % no longer needed
-\permanent\def\MPvariable#1% todo: could be a framed chain
- {\begincsname\??graphicvariable\currentmpvariableclass:#1\endcsname}
+%D The uppercase ones are the official ones:
-\permanent\tolerant\protected\def\useMPvariables[#1]#*[#2]%
- {\edef\currentmpvariableclass{#1}%
- \meta_prepare_variables{#2}}
+\aliased\let\setupMPvariables\setupmpcategory
+\aliased\let\setMPvariables \setupmpcategory
-\protected\def\meta_prepare_variables#1%
- {\processcommalist[#1]\meta_prepare_variable}
+\def\meta_mpvar_default{\MPcolor{black}\space}
+%def\meta_mpvar_default{0 }
-\protected\def\meta_prepare_variable#1%
- {\edef\m_meta_current_variable_template
- {\??graphicvariable\currentmpvariableclass:#1}%
- \edef\m_meta_current_variable
- {\begincsname\m_meta_current_variable_template\endcsname}%
+\permanent\def\MPvar#1% todo: could be a framed chain
+ {\beginlocalcontrol
+ \edef\m_meta_current_variable{\mpcategoryparameter{#1}}%
+ \endlocalcontrol
\ifempty\m_meta_current_variable
- \expandafter\meta_prepare_variable_nop
+ \meta_mpvar_default
+ \orelse\ifchkdim\m_meta_current_variable\or
+ \todimension\m_meta_current_variable\space\space
+ % \orelse\ifchknum\m_meta_current_variable\or % we need to catch 1>2
+ \orunless\iftok{\ifchknum\m_meta_current_variable\or\tointeger\m_meta_current_variable\fi}\emptytoks
+ \tointeger\m_meta_current_variable\space\space
+ \orelse\ifcsname\??colorattribute\currentcolorprefix\m_meta_current_variable\endcsname
+ \MPcolor\m_meta_current_variable\space
+ \orelse\ifcsname\??colorattribute\m_meta_current_variable\endcsname
+ \MPcolor\m_meta_current_variable\space
\else
- \expandafter\meta_prepare_variable_yes
+ \m_meta_current_variable
\fi}
-\protected\def\meta_prepare_instance_variables
- {\expandafter\processcommalist\expandafter[\m_meta_instance_variables]\meta_prepare_instance_variable}
-
-\protected\def\meta_prepare_instance_variable#1%
- {\edef\m_meta_current_variable_template
- {\??graphicvariable\currentmpvariableclass:#1}%
- \edef\m_meta_current_variable
- {\ifcsname\m_meta_current_variable_template\endcsname
- \lastnamedcs
- \else
- \begincsname\??graphicvariable\currentMPgraphicname:#1\endcsname
- \fi}%
+\permanent\def\MPrawvar#1#2% todo: could be a framed chain
+ {\beginlocalcontrol
+ \edef\m_meta_current_variable{\namedmpcategoryparameter{#1}{#2}}%
+ \endlocalcontrol
\ifempty\m_meta_current_variable
- \expandafter\meta_prepare_variable_nop
+ \meta_mpvar_default
+ \orelse\ifchkdim\m_meta_current_variable\or
+ \todimension\m_meta_current_variable\space\space
+ % \orelse\ifchknum\m_meta_current_variable\or % we need to catch 1>2
+ \orunless\iftok{\ifchknum\m_meta_current_variable\or\tointeger\m_meta_current_variable\fi}\emptytoks
+ \tointeger\m_meta_current_variable\space\space
+ \orelse\ifcsname\??colorattribute\currentcolorprefix\m_meta_current_variable\endcsname
+ \MPcolor\m_meta_current_variable\space
+ \orelse\ifcsname\??colorattribute\m_meta_current_variable\endcsname
+ \MPcolor\m_meta_current_variable\space
\else
- \expandafter\meta_prepare_variable_yes
+ \m_meta_current_variable
\fi}
-\def\meta_prepare_variable_nop
- {\expandafter\letcsname\m_meta_current_variable_template\endcsname\meta_prepare_variable_default}
-
-\def\meta_prepare_variable_color % we use the attribute so we dont' go through namedcolor (why not)
- {\expandafter\edefcsname\m_meta_current_variable_template\endcsname{\MPcolor\m_meta_current_variable}}
-
-\def\meta_prepare_variable_number
- {\expandafter\edefcsname\m_meta_current_variable_template\endcsname{\number\m_meta_current_variable}}% also accepts 0.number
-
-\def\meta_prepare_variable_dimension
- {\expandafter\edefcsname\m_meta_current_variable_template\endcsname{\the\dimexpr\m_meta_current_variable}}
-
-\def\meta_prepare_variable_yes
- {\ifchkdim\m_meta_current_variable\or
- \meta_prepare_variable_dimension
- \orelse\ifchknum\m_meta_current_variable\or
- \meta_prepare_variable_number
- \else
- \doifelsecolor\m_meta_current_variable
- \meta_prepare_variable_color
- \meta_prepare_variable_dimension
- \fi}
-
-\aliased\let\MPvar \MPvariable
-\aliased\let\setMPvariables\setupMPvariables
+\aliased\let\MPvariable\MPvar
%D \macros
%D {startuniqueMPgraphic, uniqueMPgraphic}
@@ -631,8 +596,8 @@
%D \uniqueMPgraphic{meta:hash}{gap=10pt,angle=30}
%D \stoptyping
-\newcount\c_meta_object_counter
-\newbox \b_meta_graphic
+\newinteger\c_meta_object_counter
+\newbox \b_meta_graphic
% hm, isn't this already done elsewhere?
@@ -664,22 +629,26 @@
{\meta_relocate_box
\box\b_meta_graphic}
+% \protected\def\meta_reuse_box#1#2#3#4#5% space delimiting would save some tokens
+% {\MPllx#2\MPlly#3\MPurx#4\MPury#5%
+% \hpack container{\forcecolorhack\getobject{MP}{#1}}} % else no proper color intent
+
\protected\def\meta_reuse_box#1#2#3#4#5% space delimiting would save some tokens
{\MPllx#2\MPlly#3\MPurx#4\MPury#5%
- \hpack container{\forcecolorhack\getobject{MP}{#1}}} % else no proper color intent
+ \hpack container{\getobject{MP}{#1}}}
\protected\def\meta_use_box
{\setunreferencedobject{MP}}
\def\meta_handle_unique_graphic#1#2#3% when there are too many, we can store data at the lua end, although,
{\begingroup % when there are that many they're probably not that unique anyway
- \edef\currentmpvariableclass{#1}%
- \extendMPoverlaystamp{#2}% incl prepare
- \ifcsname\??mpgraphic\overlaystamp:#1\endcsname
+ % \currentmpcategory already set
+ \extendMPoverlaystamp{#2}% incl prepare (maybe move to lua)
+ \ifcsname\??mpgraphic\overlaystamp:#1\endcsname % todo: is now per instance !
\lastnamedcs
\else
\meta_enable_include % redundant
- \global\advance\c_meta_object_counter\plusone
+ \global\advanceby\c_meta_object_counter\plusone
\meta_use_box{\number\c_meta_object_counter}\hpack{\meta_process_graphic{#3}}% was vbox, graphic must end up as hbox
\xdefcsname\??mpgraphic\overlaystamp:#1\endcsname{\meta_reuse_box{\number\c_meta_object_counter}{\the\MPllx}{\the\MPlly}{\the\MPurx}{\the\MPury}}%
\csname\??mpgraphic\overlaystamp:#1\endcsname\empty
@@ -691,7 +660,7 @@
\permanent\protected\def\startuniqueMPgraphic
{\dodoublegroupempty\meta_start_unique_graphic}
-\aliased\let\stopuniqueMPgraphic\relax
+\permanent\protected\lettonothing\stopuniqueMPgraphic
\def\meta_start_unique_graphic#1%
{\normalexpanded{\meta_start_unique_graphic_indeed{#1}}}
@@ -699,27 +668,49 @@
\permanent\protected\def\meta_start_unique_graphic_indeed#1#2#3\stopuniqueMPgraphic
{\gdefcsname\??mpgraphic#1\endcsname{\meta_handle_unique_graphic{#1}{#2}{#3}}}
-\permanent\tolerant\protected\def\uniqueMPgraphic#=#*#=%
+% \permanent\tolerant\protected\def\uniqueMPgraphic#=#*#=%
+% {\meta_begin_graphic_group{#1}%
+% \checkmpcategoryparent
+% \let\currentmpcategory\currentMPgraphicname
+% \setupcurrentmpcategory[#2]%
+% \begincsname\??mpgraphic#1\endcsname\empty
+% \meta_end_graphic_group}
+
+\permanent\tolerant\protected\def\uniqueMPgraphic
+ {\futureexpandis[\meta_uniquempgraphic_yes\meta_uniquempgraphic_nop}
+
+\def\meta_uniquempgraphic_yes[#1]#*#=%
+ {% ugly code but we run on top of older code
+ \resetdummyparameter\c!instance
+ \getdummyparameters[#1]%
+ \edef\currentMPinstance{\dummyparameter\c!instance}%
+ % here we feed the instance into the analyzer
+ \meta_begin_graphic_group{\ifempty\currentMPinstance\else\currentMPinstance::\fi#1}%
+ \checkmpcategoryparent
+ \let\currentmpcategory\currentMPgraphicname
+ \setupcurrentmpcategory[#1]%
+ \begincsname\??mpgraphic#2\endcsname\empty
+ \meta_end_graphic_group}
+
+\tolerant\def\meta_uniquempgraphic_nop#=#*#=%
{\meta_begin_graphic_group{#1}%
- \setupMPvariables[#1][#2]%
+ \checkmpcategoryparent
+ \let\currentmpcategory\currentMPgraphicname
+ \setupcurrentmpcategory[#2]%
\begincsname\??mpgraphic#1\endcsname\empty
\meta_end_graphic_group}
\def\meta_handle_use_graphic#1#2#3%
{\begingroup
- \edef\currentmpvariableclass{#1}%
- \edef\m_meta_instance_variables{#2}%
- \ifempty\m_meta_instance_variables \else
- \meta_prepare_instance_variables
- \fi
+ % \currentmpcategory already set
\meta_enable_include % redundant
\meta_process_graphic{#3}%
\endgroup}
-\permanent\protected\def\startuseMPgraphic % todo, modernize
+\permanent\protected\def\startuseMPgraphic
{\dodoublegroupempty\meta_start_use_graphic}
-\aliased\let\stopuseMPgraphic\relax
+\permanent\protected\lettonothing\stopuseMPgraphic
\def\meta_start_use_graphic#1%
{\normalexpanded{\meta_start_use_graphic_indeed{#1}}}
@@ -727,10 +718,10 @@
\protected\def\meta_start_use_graphic_indeed#1#2#3\stopuseMPgraphic
{\gdefcsname\??mpgraphic#1\endcsname{\meta_handle_use_graphic{#1}{#2}{#3}}}
-\permanent\protected\def\startusableMPgraphic % redundant but handy % todo, modernize
+\permanent\protected\def\startusableMPgraphic
{\dodoublegroupempty\meta_start_usable_graphic}
-\aliased\let\stopusableMPgraphic\relax
+\permanent\protected\lettonothing\stopusableMPgraphic
\def\meta_start_usable_graphic#1%
{\normalexpanded{\meta_start_usable_graphic_indeed{#1}}}
@@ -740,22 +731,18 @@
\def\meta_handle_reusable_graphic#1#2#3%
{\begingroup
- \edef\currentmpvariableclass{#1}%
- \edef\m_meta_instance_variables{#2}%
- \ifempty\m_meta_instance_variables \else
- \meta_prepare_instance_variables
- \fi
+ % \currentmpcategory already set
\meta_enable_include % redundant
- \global\advance\c_meta_object_counter\plusone
+ \global\advanceby\c_meta_object_counter\plusone
\meta_use_box{\number\c_meta_object_counter}\hpack{\meta_process_graphic{#3}}% was vbox, graphic must end up as hbox
\xdefcsname\??mpgraphic#1\endcsname{\meta_reuse_box{\number\c_meta_object_counter}{\the\MPllx}{\the\MPlly}{\the\MPurx}{\the\MPury}}%
\csname\??mpgraphic#1\endcsname\empty
\endgroup}
-\permanent\protected\def\startreusableMPgraphic % todo, modernize
+\permanent\protected\def\startreusableMPgraphic
{\dodoublegroupempty\meta_start_reusable_graphic}
-\aliased\let\stopreusableMPgraphic\relax
+\permanent\protected\lettonothing\stopreusableMPgraphic
\def\meta_start_reusable_graphic#1%
{\normalexpanded{\meta_start_reusable_graphic_indeed{#1}}}
@@ -763,28 +750,120 @@
\protected\def\meta_start_reusable_graphic_indeed#1#2#3\stopreusableMPgraphic
{\gdefcsname\??mpgraphic#1\endcsname{\meta_handle_reusable_graphic{#1}{#2}{#3}}}
-\mutable\let\usedMPgraphicname\empty
+% \permanent\tolerant\protected\def\useMPgraphic#=#*#=%
+% {\meta_begin_graphic_group{#1}%
+% \ifcsname\??mpgraphic#1\endcsname
+% \edef\currentmpcategory{#1}%
+% \orelse\ifcsname\??mpgraphic\currentMPgraphicname\endcsname
+% \let\currentmpcategory\currentMPgraphicname
+% \else
+% \lettonothing\currentmpcategory
+% \fi
+% \ifempty\currentmpcategory
+% % message
+% \else
+% \checkmpcategoryparent
+% \doifsomething{#2}{\setupcurrentmpcategory[#2]}%
+% \csname\??mpgraphic\currentmpcategory\endcsname
+% \fi
+% \meta_end_graphic_group}
+
+\permanent\tolerant\protected\def\useMPgraphic
+ {\futureexpandis[\meta_usempgraphic_yes\meta_usempgraphic_nop}
+
+\def\meta_usempgraphic_yes[#1]#*#=%
+ {% ugly code but we run on top of older code
+ \resetdummyparameter\c!instance
+ \getdummyparameters[#1]%
+ \edef\currentMPinstance{\dummyparameter\c!instance}%
+ % here we feed the instance into the analyzer
+ \meta_begin_graphic_group{\ifempty\currentMPinstance\else\currentMPinstance::\fi#2}%
+ \ifcsname\??mpgraphic#2\endcsname
+ \edef\currentmpcategory{#2}%
+ \orelse\ifcsname\??mpgraphic\currentMPgraphicname\endcsname
+ \let\currentmpcategory\currentMPgraphicname
+ \else
+ \lettonothing\currentmpcategory
+ \fi
+ \ifempty\currentmpcategory
+ % message
+ \else
+ \checkmpcategoryparent
+ \setupcurrentmpcategory[#1]%
+ \csname\??mpgraphic\currentmpcategory\endcsname
+ \fi
+ \meta_end_graphic_group}
-\permanent\tolerant\protected\def\useMPgraphic#=#*#=%
+\tolerant\def\meta_usempgraphic_nop#=#*#=%
{\meta_begin_graphic_group{#1}%
\ifcsname\??mpgraphic#1\endcsname
- \edef\usedMPgraphicname{#1}%
+ \edef\currentmpcategory{#1}%
\orelse\ifcsname\??mpgraphic\currentMPgraphicname\endcsname
- \let\usedMPgraphicname\currentMPgraphicname
+ \let\currentmpcategory\currentMPgraphicname
\else
- \let\usedMPgraphicname\empty
+ \lettonothing\currentmpcategory
\fi
- \ifempty\usedMPgraphicname
+ \ifempty\currentmpcategory
% message
\else
- \doifsomething{#2}{\setupMPvariables[\usedMPgraphicname][#2]}%
- \csname\??mpgraphic\usedMPgraphicname\endcsname
+ \checkmpcategoryparent
+ \doifsomething{#2}{\setupcurrentmpcategory[#2]}%
+ \csname\??mpgraphic\currentmpcategory\endcsname
\fi
\meta_end_graphic_group}
\aliased\let\reuseMPgraphic \useMPgraphic % we can save a setup here if needed
\aliased\let\reusableMPgraphic\reuseMPgraphic % we can save a setup here if needed
+%D Saves an overlaydefinition:
+
+\permanent\protected\def\startoverlayMPgraphic
+ {\dodoublegroupempty\meta_start_overlay_graphic}
+
+\permanent\protected\lettonothing\stopoverlayMPgraphic
+
+\def\meta_start_overlay_graphic#1%
+ {\normalexpanded{%
+ \pack_overlay_define{#1}{\useMPgraphic{#1}}%
+ \meta_start_overlay_graphic_indeed{#1}}%
+ }
+
+\protected\def\meta_start_overlay_graphic_indeed#1#2#3\stopoverlayMPgraphic
+ {\gdefcsname\??mpgraphic#1\endcsname{\meta_handle_overlay_graphic{#1}{#2}{#3}}}
+
+\def\meta_handle_overlay_graphic#1#2#3%
+ {\begingroup
+ \edef\currentmpcategory{#1}%
+ \meta_process_graphic{#3;BoundToOverlayBox;}%
+ \endgroup}
+
+%D New in \LMTX:
+
+\newtoks\MPoverlaydata
+
+\permanent\protected\lettonothing\stopMPoverlaydata
+
+\permanent\protected\def\startMPoverlaydata
+ {\iftrialtypesetting
+ \expandafter\startMPoverlaydata_nop
+ \else
+ \expandafter\startMPoverlaydata_yes
+ \fi}
+
+\permanent\protected\def\startMPoverlaydata_nop#-\stopMPoverlaydata
+ {}
+
+\permanent\protected\def\startMPoverlaydata_yes#1\stopMPoverlaydata
+ {\xtoksapp\MPoverlaydata{#1;}}
+
+\def\includeMPoverlaydata % expandable
+ {\the\MPoverlaydata
+ \resetMPoverlaydata}
+
+\def\resetMPoverlaydata % expandable
+ {\localcontrolled{\global\MPoverlaydata\emptytoks}}
+
+
%D \macros
%D {startuniqueMPpagegraphic,uniqueMPpagegraphic}
%D
@@ -805,40 +884,27 @@
\permanent\tolerant\protected\def\startuniqueMPpagegraphic % todo the modern way
{\dodoublegroupempty\meta_start_unique_page_graphic}
-\aliased\let\stopuniqueMPpagegraphic\relax
+\permanent\protected\lettonothing\stopuniqueMPpagegraphic
\def\meta_start_unique_page_graphic#1%
{\normalexpanded{\meta_start_unique_page_graphic_indeed{#1}}}
-\protected\def\meta_start_unique_page_graphic_indeed#1#2#3\stopuniqueMPpagegraphic % inefficient, double storage
- {\gdefcsname\??mpgraphic o:#1\endcsname{\meta_handle_unique_graphic{o:#1}{#2}{#3}}% % but these also keep the state
- \gdefcsname\??mpgraphic e:#1\endcsname{\meta_handle_unique_graphic{e:#1}{#2}{#3}}} % and meaning will be redefined
+\protected\def\meta_start_unique_page_graphic_indeed#1#2#3\stopuniqueMPpagegraphic % inefficient, double storage
+ {\gdefcsname\??mpgraphic o:#1\endcsname{\meta_handle_unique_graphic{o:#1}{#2}{#3}}% % but these also keep the state
+ \gdefcsname\??mpgraphic e:#1\endcsname{\meta_handle_unique_graphic{e:#1}{#2}{#3}}} % and meaning will be redefined
\permanent\tolerant\protected\def\uniqueMPpagegraphic#=#=%
{\meta_begin_graphic_group{#1}%
\enforced\let\overlaystamp\overlaypagestamp
- \setupMPvariables[\m_meta_page_prefix:#1][#2]% prefix is new here
+ \setupmpcategory[\m_meta_page_prefix:#1][#2]% prefix is new here
\csname\??mpgraphic\m_meta_page_prefix:#1\endcsname\empty
\meta_end_graphic_group}
-%D One way of defining a stamp is:
-%D
-%D \starttyping
-%D \def\extendMPoverlaystamp#1%
-%D {\def\docommand##1%
-%D {\edef\overlaystamp{\overlaystamp:\MPvariable{##1}}}%
-%D \processcommalist[#1]\docommand}
-%D \stoptyping
-%D
-%D Since we need to feed \METAPOST\ with expanded dimensions, we introduce a
-%D dedicated expansion engine. We redefine \type {\extendMPoverlaystamp} to
-
\permanent\protected\def\extendMPoverlaystamp#1%
{\processcommalist[#1]\meta_extend_overlay_stamp}
\def\meta_extend_overlay_stamp#1%
- {\meta_prepare_instance_variable{#1}%
- \enforced\permanent\edef\overlaystamp{\overlaystamp:\MPvariable{#1}}}
+ {\enforced\permanent\edef\overlaystamp{\overlaystamp:\MPvariable{#1}}}
% \getMPdata % define at the lua end
% \rawMPdata % define at the lua end
@@ -879,7 +945,7 @@
\fi
\clf_mptexset{\detokenize{#2}}}
-\aliased\let\stopMPenvironment\relax
+\permanent\protected\lettonothing\stopMPenvironment
\permanent\protected\def\resetMPenvironment
{\clf_mptexreset}
@@ -901,25 +967,64 @@
%D
%D The most simple case:
-\permanent\tolerant\protected\def\startMPcode#=#:#2\stopMPcode
+% \permanent\tolerant\protected\def\startMPcode#=#:#2\stopMPcode
+% {\begingroup
+% \edef\currentMPinstance{#1}%
+% \ifempty\currentMPinstance
+% \let\currentMPinstance\defaultMPinstance
+% \fi
+% \lettonothing\currentMPgraphicname
+% \edef\currentMPformat{\MPinstanceparameter\s!format}%
+% \meta_enable_include
+% \meta_process_graphic{#2}%
+% \endgroup}
+
+\permanent\tolerant\protected\def\startMPcode
+ {\futureexpandis[\meta_start_mpcode_yes\meta_start_mpcode_nop}
+
+\tolerant\def\meta_start_mpcode_nop#:#=#:#2\stopMPcode
{\begingroup
\edef\currentMPinstance{#1}%
\ifempty\currentMPinstance
\let\currentMPinstance\defaultMPinstance
\fi
- \let\currentMPgraphicname\empty
+ \lettonothing\currentMPgraphicname
\edef\currentMPformat{\MPinstanceparameter\s!format}%
\meta_enable_include
\meta_process_graphic{#2}%
\endgroup}
-\aliased\let\stopMPcode\relax
+\def\meta_start_mpcode_yes[#1]#2\stopMPcode
+ {\begingroup
+ \resetdummyparameter\c!instance
+ \resetdummyparameter\c!stacking
+ \getdummyparameters[#1]%
+ \edef\currentMPinstance{\dummyparameter\c!instance}%
+ \setmpcategoryparameter\c!stacking{\dummyparameter\c!stacking}%
+ \ifempty\currentMPinstance
+ \let\currentMPinstance\defaultMPinstance
+ \fi
+ \lettonothing\currentMPgraphicname
+ \edef\currentMPformat{\MPinstanceparameter\s!format}%
+ \meta_enable_include
+ \meta_process_graphic{#2}%
+ \endgroup}
+
+\permanent\protected\lettonothing\stopMPcode
%D This one is not optimized because it's only used for small snippets, if it
%D is used at all.
+%D
+%D \starttyping
+%D test \MPcode {draw unitcircle scaled 1.5ExHeight} test test \MPcode [doublefun]
+%D {draw unitcircle scaled 3mm shifted (0,-1mm)} test
+%D \stoptyping
-\permanent\tolerant\protected\def\MPcode#=#:#*#=%
- {\ifparameter#1\or
+\permanent\tolerant\protected\def\MPcode[#1]#:#2%
+ {\dontleavehmode
+ \begingroup
+ \obeyMPboxdepth
+ \ifparameter#1\or
\meta_begin_graphic_group{#1}%
\meta_enable_include
\meta_process_graphic{#2}%
@@ -927,8 +1032,9 @@
\else
\let\currentMPinstance\defaultMPinstance
\meta_enable_include
- \meta_process_graphic{#1}%
- \fi}
+ \meta_process_graphic{#2}%
+ \fi
+ \endgroup}
% a bit nasty (also needed for compatibility:
@@ -949,15 +1055,12 @@
\permanent\tolerant\protected\def\startMPrun#=#:#2\stopMPrun
{\normalexpanded{\startuseMPgraphic{\iftok{#1}\emptytoks mprun\else#1\fi}}#2\stopuseMPgraphic}
-\aliased\let\stopMPrun\relax
+\permanent\protected\lettonothing\stopMPrun
-%D The \type {\resetMPenvironment} is a quick way to erase
-%D the token list.
-%D
-%D You should be aware of independencies. For instance, if you use a font
-%D in a graphic that is not used in the main document, you need to load the
-%D typescript at the outer level (either directly or by using the global
-%D option).
+%D The \type {\resetMPenvironment} is a quick way to erase the token list. You
+%D should be aware of independencies. For instance, if you use a font in a graphic
+%D that is not used in the main document, you need to load the typescript at the
+%D outer level (either directly or by using the global option).
%D
%D \starttyping
%D \usetypescript[palatino][texnansi]
@@ -973,8 +1076,7 @@
%D \stopMPpage
%D \stoptyping
-%D Loading specific \METAPOST\ related definitions is
-%D accomplished by:
+%D Loading specific \METAPOST\ related definitions is accomplished by:
\permanent\protected\def\useMPlibrary[#1]{\clf_useMPlibrary{#1}}
@@ -1003,30 +1105,26 @@
% \setupcolors[state=stop,conversion=never] % quite tricky ... type mismatch
-\startMPinitializations
- CurrentLayout:="\currentlayout";
-\stopMPinitializations
+% \startMPinitializations
+% CurrentLayout:="\currentlayout";
+% \stopMPinitializations
%D A dirty trick, ** in colo-ini.lua (mpcolor). We cannot use a vardef, because
%D that fails with spot colors.
-\startMPinitializations
- def OverlayLineColor=\ifempty\overlaylinecolor black \else\MPcolor{\overlaylinecolor} \fi enddef;
- def OverlayColor =\ifempty\overlaycolor black \else\MPcolor{\overlaycolor} \fi enddef;
-\stopMPinitializations
+% \startMPinitializations
+% def OverlayLineColor=\ifempty\overlaylinecolor black \else\MPcolor{\overlaylinecolor} \fi enddef;
+% def OverlayColor =\ifempty\overlaycolor black \else\MPcolor{\overlaycolor} \fi enddef;
+% \stopMPinitializations
\appendtoks
\disablediscretionaries
%\disablecompoundcharacters
-\to \everyMPgraphic
-
-\appendtoks
+ %
\baselineskip1\baselineskip
\lineheight 1\lineheight
\topskip 1\topskip
-\to \everyMPgraphic
-
-\appendtoks
+ %
\enforced\let\#\letterhash
\enforced\let\_\letterunderscore
\enforced\let\&\letterampersand
@@ -1034,14 +1132,6 @@
\enforced\let\}\letterclosebrace
\to \everyMPgraphic
-%D \macros
-%D {PDFMPformoffset}
-%D
-%D In \PDF, forms are clipped and therefore we have to take precautions to get this
-%D right. Since this is related to objects, we use the same offset as used there.
-
-\def\PDFMPformoffset{\objectoffset}
-
\newtoks\everyinsertMPfile
\startMPextensions
@@ -1171,8 +1261,8 @@
\permanent\tolerant\protected\def\startstaticMPgraphic#=#:#=#:#3\stopstaticMPgraphic
{\startreusableMPgraphic{\??mpstaticgraphic#1}{#2}#3\stopreusableMPgraphic}
-\aliased\let\stopstaticMPfigure \relax
-\aliased\let\stopstaticMPgraphic\relax
+\permanent\protected\lettonothing\stopstaticMPfigure
+\permanent\protected\lettonothing\stopstaticMPgraphic
\permanent\tolerant\protected\def\usestaticMPfigure[#1]#*[#2]%
{\ifarguments\or
@@ -1183,8 +1273,8 @@
%D Goody for preventing overflows:
-%frozen\def\MPdivten[#1]{\withoutpt\the\dimexpr#1pt/10\relax}
-\permanent\def\MPdivten[#1]{\thewithoutunit\dimexpr#1pt/10\relax}
+% frozen\def\MPdivten[#1]{\toscaled\dimexpr#1pt/10\relax}
+\permanent\def\MPdivten[#1]{\toscaled\dimexpr#1pt/10\relax}
%D There is no way to distinguish the black color that you get when you issue a
%D \type {draw} without color specification from a color that has an explicit black
@@ -1277,14 +1367,14 @@
\ifempty\currentMPinstance
\let\currentMPinstance\defaultMPinstance
\fi
- \let\currentMPgraphicname\empty
+ \lettonothing\currentMPgraphicname
\edef\currentMPformat{\MPinstanceparameter\s!format}%
\meta_enable_include
\meta_process_graphic{#2;draw origin}%
\egroup
\endgroup}
-\aliased\let\stopMPcalculation\relax
+\permanent\protected\lettonothing\stopMPcalculation
%D \macros
%D {setupMPgraphics}
@@ -1306,29 +1396,10 @@
\setupMPgraphics
[\c!color=\v!local]
-% %D This can save some runtime: rename the mpy file from a first run (when stable) to
-% %D another file and reuse it. One can also use the original filename, but a copy is
-% %D often better.
-% %D
-% %D \starttyping
-% %D \setupMPgraphics
-% %D [mpy=\jobname.mpy]
-% %D \stoptyping
-%
-% \mutable\let\MPdataMPYfile\empty
-%
-% \appendtoks
-% \edef\p_mpy{\directMPgraphicsparameter{mpy}}%
-% \ifempty\p_mpy \else
-% \let\MPdataMPYfile\p_mpy
-% \clf_registermpyfile{\p_mpy}%
-% \fi
-% \to \everysetupMPgraphics
-
%D Some more helpers (see \type {meta-grd.mkiv} for an example of usage):
-\permanent\def\MPdpar#1#2{\the\dimexpr#1#2\relax\empty}
-\permanent\def\MPnpar#1#2{\the\numexpr#1#2\relax\empty}
+\permanent\def\MPdpar#1#2{\the\dimexpr#1#2\relax\empty} % why \empty here
+\permanent\def\MPnpar#1#2{\the\numexpr#1#2\relax\empty} % why \empty here
\permanent\def\MPspar#1#2{"#1#2"}
%D Done.
diff --git a/Master/texmf-dist/tex/context/base/mkxl/meta-nod.mkxl b/Master/texmf-dist/tex/context/base/mkxl/meta-nod.mkxl
index 0fbfefde0c8..3cfc384aa19 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/meta-nod.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/meta-nod.mkxl
@@ -106,9 +106,9 @@
%D Hm, we started out simple but it now quickly becomes the usual mess of \TEX,
%D \METAPOST\ and \LUA. Hard to understand.
-\newcount\c_meta_nodes_n
+\newinteger\c_meta_nodes_n
-\aliased\let\stopnodes\relax
+\permanent\protected\lettonothing\stopnodes
\permanent\tolerant\protected\def\startnodes[#1]#:#2\stopnodes
{\hpack\bgroup
@@ -154,9 +154,9 @@
\fi
);%
}}%
- \advance\c_meta_nodes_n\plusone}
+ \advanceby\c_meta_nodes_n\plusone}
-\aliased\let\placenode\relax
+\permanent\protected\lettonothing\placenode
\appendtoks
\enforced\let\placenode\grph_nodes_node
@@ -165,23 +165,23 @@
\permanent\tolerant\protected\def\grph_nodes_fromto[#1]#*[#2]%
{\grph_nodes_fromto_indeed[#1][#2]}% get rid of {n,m} % todo: we can use #_ or so
-\letvalue{\??metanodesposition }\empty
-\setvalue{\??metanodesposition top}{.top}
-\setvalue{\??metanodesposition bottom}{.bot}
-\setvalue{\??metanodesposition left}{.lft}
-\setvalue{\??metanodesposition right}{.rt}
-\setvalue{\??metanodesposition upperleft}{.ulft}
-\setvalue{\??metanodesposition topleft}{.ulft}
-\setvalue{\??metanodesposition lefttop}{.ulft}
-\setvalue{\??metanodesposition upperright}{.urt}
-\setvalue{\??metanodesposition topright}{.urt}
-\setvalue{\??metanodesposition righttop}{.urt}
-\setvalue{\??metanodesposition lowerleft}{.llft}
-\setvalue{\??metanodesposition bottomleft}{.llft}
-\setvalue{\??metanodesposition leftbottom}{.llft}
-\setvalue{\??metanodesposition lowerright}{.lrt}
-\setvalue{\??metanodesposition bottomright}{.lrt}
-\setvalue{\??metanodesposition rightbottom}{.lrt}
+\letcsname\??metanodesposition \endcsname\empty
+\defcsname\??metanodesposition top\endcsname{.top}
+\defcsname\??metanodesposition bottom\endcsname{.bot}
+\defcsname\??metanodesposition left\endcsname{.lft}
+\defcsname\??metanodesposition right\endcsname{.rt}
+\defcsname\??metanodesposition upperleft\endcsname{.ulft}
+\defcsname\??metanodesposition topleft\endcsname{.ulft}
+\defcsname\??metanodesposition lefttop\endcsname{.ulft}
+\defcsname\??metanodesposition upperright\endcsname{.urt}
+\defcsname\??metanodesposition topright\endcsname{.urt}
+\defcsname\??metanodesposition righttop\endcsname{.urt}
+\defcsname\??metanodesposition lowerleft\endcsname{.llft}
+\defcsname\??metanodesposition bottomleft\endcsname{.llft}
+\defcsname\??metanodesposition leftbottom\endcsname{.llft}
+\defcsname\??metanodesposition lowerright\endcsname{.lrt}
+\defcsname\??metanodesposition bottomright\endcsname{.lrt}
+\defcsname\??metanodesposition rightbottom\endcsname{.lrt}
\def\grph_nodes_fromto_indeed[#1,#2][#3]% we can't group because etoksapp doesn't like that
{\begingroup
@@ -219,16 +219,18 @@
;%
}}}
-\setvalue{\??metanodesalternative }{draw}
-\setvalue{\??metanodesalternative arrow}{drawarrow}
-\setvalue{\??metanodesalternative doublearrow}{drawdblarrow}
-\setvalue{\??metanodesalternative doublearrows}{drawdoublearrows}
+\defcsname\??metanodesalternative \endcsname{draw}
+\defcsname\??metanodesalternative arrow\endcsname{drawarrow}
+\defcsname\??metanodesalternative doublearrow\endcsname{drawdblarrow}
+\defcsname\??metanodesalternative doublearrows\endcsname{drawdoublearrows}
-\setvalue{\??metanodesoption }{}
-\setvalue{\??metanodesoption dashed}{dashed evenly}
-\setvalue{\??metanodesoption dotted}{dashed withdots scaled .5}
+\defcsname\??metanodesoption \endcsname{}
+\defcsname\??metanodesoption dashed\endcsname{dashed evenly}
+\defcsname\??metanodesoption dotted\endcsname{dashed withdots scaled .5}
-\aliased\let\connectnodes\relax
+\permanent\protected\lettonothing\connectnodes
+\permanent\protected\lettonothing\mpcode
+\permanent\protected\lettonothing\nodeMPcode
\appendtoks
\enforced\let\connectnodes\grph_nodes_fromto
@@ -237,9 +239,6 @@
\permanent\protected\def\grph_nodes_code#1%
{\etoksapp\t_meta_nodes{#1}}
-\aliased\let\mpcode \relax
-\aliased\let\nodeMPcode\relax
-
\appendtoks
\enforced\let\nodeMPcode\grph_nodes_code
\enforced\let\mpcode \grph_nodes_code
diff --git a/Master/texmf-dist/tex/context/base/mkxl/meta-pdf.mkxl b/Master/texmf-dist/tex/context/base/mkxl/meta-pdf.mkxl
index d53ff7780f6..8dc0bdfac3c 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/meta-pdf.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/meta-pdf.mkxl
@@ -34,9 +34,7 @@
%D graphics. The color control flags are also gone as we now integrate into the
%D regular colorspace handling (i.e.\ no longer independent configurations.)
-\permanent\def\PDFMPformoffset{\ifdefined\objectoffset\objectoffset\else\zeropoint\fi} % obsolete, will go
-
-\mutable\let\MPfilename\empty
+\mutable\lettonothing\MPfilename
\permanent\protected\def\convertMPtoPDF#1#2#3% scaling no longer supported at this level (so #2 & #3 are ignored)
{\dostarttagged\t!mpgraphic\empty
diff --git a/Master/texmf-dist/tex/context/base/mkxl/meta-pdh.mkxl b/Master/texmf-dist/tex/context/base/mkxl/meta-pdh.mkxl
index e2d0e15b62c..7f16ca34040 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/meta-pdh.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/meta-pdh.mkxl
@@ -84,11 +84,12 @@
\ifdefined\makeMPintoPDFobject \else \newconstant\makeMPintoPDFobject \fi
\ifdefined\everyMPtoPDFconversion \else \newtoks \everyMPtoPDFconversion \fi
-\let\lastPDFMPobject \!!zerocount
-\let\currentPDFresources\empty
-\let\setMPextensions \relax
+\let\lastPDFMPobject\!!zerocount
+\let\setMPextensions\relax
-\def\PDFMPformoffset{\ifdefined\objectoffset\objectoffset\else\zeropoint\fi}
+\lettonothing\currentPDFresources
+
+\def\PDFMPformoffset{\ifdefined\objectoffset\objectoffset\else\zeropoint\fi} % no longer used
\def\resetMPvariables#1#2#3%
{\glet\MPwidth \!!zeropoint
@@ -139,7 +140,7 @@
%D A common hook.
-\let\MPfshowcommand\empty
+\lettonothing\MPfshowcommand
%D Objects.
@@ -465,7 +466,7 @@
%D \NC /N \NC smaller values, bigger inner circles \NC \NR
%D \stoptabulate
-% \newcount\currentPDFshade % 0 % global (document wide) counter
+% \newinteger\currentPDFshade % 0 % global (document wide) counter
%
% \def\dosetMPsomePDFshade#1#2%
% {\immediate\pdfobj
@@ -480,7 +481,7 @@
% /Function \the\pdflastobj\space 0 R
% /Coords [\MPshadeC]
% /Extend [true true]>>}%
-% \global\advance\currentPDFshade \plusone
+% \global\advanceby\currentPDFshade \plusone
% \ctxlua{lpdf.adddocumentshade("Sh\the\currentPDFshade",lpdf.reference(\the\pdflastobj))}%
% \setxvalue{\@@MPSK#2}{\noexpand\dohandleMPshade{\the\currentPDFshade}}}
%
diff --git a/Master/texmf-dist/tex/context/base/mkxl/meta-tex.mkxl b/Master/texmf-dist/tex/context/base/mkxl/meta-tex.mkxl
index 5937ce4083f..8642f94fff4 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/meta-tex.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/meta-tex.mkxl
@@ -15,9 +15,8 @@
\unprotect
-% Ok, we support this in MkIV because Mojca kept the pressure on. It
-% looks a bit like a hack. But in fact this method is obsolete and
-% eventually might go away.
+%D Ok, we support this in MkIV because Mojca kept the pressure on. It looks a bit
+%D like a hack. But in fact this method is obsolete and eventually might go away.
\installcorenamespace{graphictextext}
\installcorenamespace{graphictexdepth}
@@ -26,10 +25,10 @@
\permanent\protected\def\startTeXtexts#1\stopTeXtexts
{#1}
-\aliased\let\stopTeXtexts\relax
+\permanent\protected\lettonothing\stopTeXtexts
\permanent\tolerant\protected\def\TeXtext[#1]#:#2#3% contrary to mkii we don't process yet but we do expand
- {\setxvalue{\??graphictextext#2}{\meta_textext_indeed{#1}{#3}}}
+ {\xdefcsname\??graphictextext#2\endcsname{\meta_textext_indeed{#1}{#3}}}
\protected\def\meta_textext_indeed#1#2%
{\begingroup
@@ -45,10 +44,10 @@
\permanent\def\getTeXtext#1%
{\begincsname\??graphictextext#1\endcsname}
-\letvalue{\??graphictexdepth d}\syst_boxes_lower_nextbox_dp
-\letvalue{\??graphictexdepth \s!depth}\syst_boxes_lower_nextbox_dp
-\letvalue{\??graphictexdepth n}\donothing
-\letvalue{\??graphictexdepth\s!nodepth}\donothing
+\letcsname\??graphictexdepth d\endcsname\syst_boxes_lower_nextbox_dp
+\letcsname\??graphictexdepth \s!depth\endcsname\syst_boxes_lower_nextbox_dp
+\letcsname\??graphictexdepth n\endcsname\donothing
+\letcsname\??graphictexdepth\s!nodepth\endcsname\donothing
% old hackery, slightly modernized
@@ -157,6 +156,13 @@
\definefontsynonym[sans-bold-italic] [\s!SansBoldItalic]
\definefontsynonym[sans-bold-oblique] [\s!SansBoldSlanted]
+\definefontsynonym[sansserif-normal-normal] [\s!Sans]
+\definefontsynonym[sansserif-normal-italic] [\s!SansItalic]
+\definefontsynonym[sansserif-normal-oblique] [\s!SansSlanted]
+\definefontsynonym[sansserif-bold-normal] [\s!SansBold]
+\definefontsynonym[sansserif-bold-italic] [\s!SansBoldItalic]
+\definefontsynonym[sansserif-bold-oblique] [\s!SansBoldSlanted]
+
\definefontsynonym[mono-normal-normal] [\s!Mono]
\definefontsynonym[mono-normal-italic] [\s!MonoItalic]
\definefontsynonym[mono-normal-oblique] [\s!MonoSlanted]
@@ -166,70 +172,180 @@
\installcorenamespace {svgfamily}
-\setvalue{\??svgfamily }{serif}
-\setvalue{\??svgfamily serif}{serif}
-\setvalue{\??svgfamily sans}{sans}
-\setvalue{\??svgfamily mono}{mono}
+\defcsname\??svgfamily \endcsname{serif}
+\defcsname\??svgfamily serif\endcsname{serif}
+\defcsname\??svgfamily sans\endcsname{sans}
+\defcsname\??svgfamily mono\endcsname{mono}
-%D This can't change because otherwise \type {\scale[width=4cm]{graphic}} fails.
+\definelayer[svgmps][\c!method=\v!fit]
-\permanent\protected\def\svgscaled#1%
- {\fastsxsy{#1}{#1}\svgnormal}
+\permanent\protected\def\svgembeddedfigure#1%
+ {\clf_embedimagefromstore {svg} #1 true\relax}
-\permanent\protected\def\svgnormal#1#2#3#4% family weight style text
- {\bgroup
- \edef\p_family{#1}%
- \ifempty\p_family\else
- \edef\p_font{\ifcsname\??svgfamily#1\endcsname\lastnamedcs\else#1\fi-#2-#3}%
- \predefinedfont[\s!spec:\p_font*\s!default\space @ 10bp]%
- \fi
- #4%
- \egroup}
-
-\permanent\protected\def\svgcolored#1#2#3#4% r g b text
- {\colored[r=#1,g=#2,b=#3]{#4}}
-
-% \permanent\protected\def\svgplaced#1#2#3#4% dx dy width text
-% {\doifelsenothing{#3}%
-% {\hpack}%
-% {\hpack to #3}%
-% {\raise#2\onebasepoint\hbox{\kern#1\onebasepoint\relax#4}}}
-
-\permanent\protected\def\svgplaced#1#2#3#4% dx dy width text
- {\doifelsenothing{#3}%
- {\hpack}%
- {\hpack to #3}%
- {\offsetbox[\c!y=#2]\hbox{\kern#1\relax#4}}}
-
-\newdimen\grph_svg_scratchwidth % maybe \startsvgpos etc
-
-\permanent\protected\def\svgposchar#1#2#3% dx dy char
- {\setbox\scratchbox\hpack\bgroup
- \raise#2\onebasepoint\hbox\bgroup
- \kern\dimexpr#1\onebasepoint-\grph_svg_scratchwidth\relax
- \char#3\relax
- \egroup
- \egroup
- \advance\grph_svg_scratchwidth\wd\scratchbox
- \box\scratchbox}
-
-\permanent\protected\def\svgchar#1% char
+% todo: use the independent color and transparency mechanism
+
+\permanent\protected\def\svghashed#1%
+ {\clf_svghashed#1\relax}
+
+\permanent\protected\def\svg_normal_pcode#1#2#3%
+ {\glyph xoffset #1\onebasepoint yoffset #2\onebasepoint #3\relax}
+
+\permanent\protected\def\svg_normal_pchar#1#2#3%
+ {\glyph xoffset #1\onebasepoint yoffset #2\onebasepoint `#3\relax}
+
+\permanent\protected\def\svg_normal_pspace#1#2%
+ {\space}
+
+\permanent\protected\def\svg_normal_space
+ {\space}
+
+\permanent\protected\def\svg_normal_code#1%
{\char#1\relax}
-\definelayer[svgmps][\c!method=\v!fit]
+\permanent\protected\def\svg_normal_char#1%
+ {#1\relax}
-\permanent\protected\def\svgstartlayer
+\permanent\protected\def\svg_normal_start
{\resetlayer[svgmps]%
\setlayer[svgmps]\bgroup}
-\permanent\protected\def\svgstoplayer
+\permanent\protected\def\svg_normal_stop
{\egroup
\flushlayer[svgmps]}
-\permanent\protected\def\svgsetlayer#1#2%
- {\setlayer[svgmps][\c!x=#1\onebasepoint,\c!y=#2\onebasepoint]} % {#3}
+\permanent\protected\def\svg_normal_color_c#1#2#3%#4% % color
+ {\colored[r=#1,g=#2,b=#3]}%{#4}}
-\permanent\protected\def\svghashed#1%
- {\clf_svghashed#1\relax}
+\permanent\protected\def\svg_normal_color_o#1%#2% % opace
+ {\colored[a=1,t=#1]}%{#2}}
+
+\permanent\protected\def\svg_normal_color_b#1#2#3#4%#5% % both
+ {\colored[r=#1,g=#2,b=#3,a=1,t=#4]}% {#5}}
+
+\permanent\protected\def\svg_normal_set#1#2#3%
+ {\setlayer[svgmps]{\hbox xoffset #1\onebasepoint yoffset #2\onebasepoint to 10sp{#3}}}
+
+\permanent\protected\def\svg_normal_font#1#2#3%#4%
+ {\hbox\bgroup
+ \iftok{#2}\emptytoks\else
+ \edef\p_font{\ifcsname\??svgfamily#1\endcsname\lastnamedcs\else#1\fi-#2-#3}%
+ \ifcsname svg:\p_font\endcsname
+ \lastnamedcs
+ \else
+ \predefinefont[svg:\p_font][\s!spec:\p_font*\s!default\space @ 10bp]%
+ \csname svg:\p_font\endcsname
+ \fi
+ \fi
+ \let\next}
+ % #4%
+ % \egroup}
+
+\permanent\protected\def\svg_normal_size#1%#2%
+ {\hbox\bgroup
+ \glyphscale\numericscale#1\relax % we need a period !
+ \let\next}
+ % #2%
+ % \egroup}
+
+\permanent\protected\def\svg_traced_pcode#1#2#3%
+ {\writestatus{SVG TEXT}{....[poscode #1 #2 \Uchar #3]}%
+ \svg_normal_pcode{#1}{#2}{#3}}
+
+\permanent\protected\def\svg_traced_pchar#1#2#3%
+ {\writestatus{SVG TEXT}{....[poschar #1 #2 #3]}%
+ \svg_normal_pchar{#1}{#2}{#3}}
+
+\permanent\protected\def\svg_traced_pspace#1#2%
+ {\writestatus{SVG TEXT}{....[posspace #1 #2]}%
+ \svg_normal_pspace{#1}{#2}}
+
+\permanent\protected\def\svg_traced_code#1%
+ {\writestatus{SVG TEXT}{....[char \Uchar #1]}%
+ \svg_normal_code{#1}}
+
+\permanent\protected\def\svg_traced_char#1%
+ {\writestatus{SVG TEXT}{....[char #1]}%
+ \svg_normal_char{#1}}
+
+\permanent\protected\def\svg_traced_space
+ {\writestatus{SVG TEXT}{....[space]}%
+ \svg_normal_space}
+
+\permanent\protected\def\svg_traced_start
+ {\writestatus{SVG TEXT}{[start layer]}%
+ \svg_normal_start}
+
+\permanent\protected\def\svg_traced_stop
+ {\svg_normal_stop
+ \writestatus{SVG TEXT}{[stop layer]}}
+
+\permanent\protected\def\svg_traced_color_c#1#2#3#4%
+ {\writestatus{SVG TEXT}{..[start color #1 #2 #3]}%
+ \svg_normal_color_c{#1}{#2}{#3}{#4}%
+ \writestatus{SVG TEXT}{..[stop color]}}
+
+\permanent\protected\def\svg_traced_color_o#1#2%
+ {\writestatus{SVG TEXT}{..[start opace #1]}%
+ \svg_normal_color_o{#1}{#2}%
+ \writestatus{SVG TEXT}{..[stop opace]}}
+
+\permanent\protected\def\svg_traced_color_b#1#2#3#4#5%
+ {\writestatus{SVG TEXT}{..[start color #1 #2 #3 opace #4]}%
+ \svg_normal_color_b{#1}{#2}{#3}{#4}{#5}%
+ \writestatus{SVG TEXT}{..[stop color opace]}}
+
+\permanent\protected\def\svg_traced_set#1#2#3%
+ {\writestatus{SVG TEXT}{...[start set layer #1 #2]}%
+ \svg_normal_set{#1}{#2}{#3}%
+ \writestatus{SVG TEXT}{...[stop set setlayer]}}
+
+\permanent\protected\def\svg_traced_font#1#2#3#4%
+ {\writestatus{SVG TEXT}{.[start font #1 #2 #3]}%
+ \svg_normal_font{#1}{#2}{#3}{#4}%
+ \writestatus{SVG TEXT}{.[stop font]}}
+
+\permanent\protected\def\svg_traced_size#1#2%
+ {\writestatus{SVG TEXT}{.[start size #1]}%
+ \svg_normal_size{#1}{#2}%
+ \writestatus{SVG TEXT}{.[stop size]}}
+
+\permanent\protected\def\svg_normal_text
+ {\enforced\let\svgpcode \svg_normal_pcode
+ \enforced\let\svgpchar \svg_normal_pchar
+ \enforced\let\svgpspace\svg_normal_pspace
+ \enforced\let\svgcode \svg_normal_code
+ \enforced\let\svgchar \svg_normal_char
+ \enforced\let\svgspace \svg_normal_space
+ \enforced\let\svgstart \svg_normal_start
+ \enforced\let\svgstop \svg_normal_stop
+ \enforced\let\svgcolorc\svg_normal_color_c
+ \enforced\let\svgcoloro\svg_normal_color_o
+ \enforced\let\svgcolorb\svg_normal_color_b
+ \enforced\let\svgset \svg_normal_set
+ \enforced\let\svgfont \svg_normal_font
+ \enforced\let\svgsize \svg_normal_size}
+
+\permanent\protected\def\svg_traced_text
+ {\enforced\let\svgpcode \svg_traced_pcode
+ \enforced\let\svgpchar \svg_traced_pchar
+ \enforced\let\svgpspace\svg_traced_pspace
+ \enforced\let\svgcode \svg_traced_code
+ \enforced\let\svgchar \svg_traced_char
+ \enforced\let\svgspace \svg_traced_space
+ \enforced\let\svgstart \svg_traced_start
+ \enforced\let\svgstop \svg_traced_stop
+ \enforced\let\svgcolorc\svg_traced_color_c
+ \enforced\let\svgcoloro\svg_traced_color_o
+ \enforced\let\svgcolorb\svg_traced_color_b
+ \enforced\let\svgset \svg_traced_set
+ \enforced\let\svgfont \svg_traced_font
+ \enforced\let\svgsize \svg_traced_size}
+
+\installtextracker
+ {svg.text}
+ {\svg_traced_text}
+ {\svg_normal_text}
+
+\svg_normal_text
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-cnt.lmt b/Master/texmf-dist/tex/context/base/mkxl/mlib-cnt.lmt
index bddcb33b854..35ea4067a99 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/mlib-cnt.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-cnt.lmt
@@ -49,8 +49,6 @@ local next, type, tostring = next, type, tostring
local round, abs, min, max, floor = math.round, math.abs, math.min, math.max, math.floor
local concat, move = table.concat, table.move
-local bor = bit32.bor -- it's really time to ditch support for luajit
-
local starttiming = statistics.starttiming
local stoptiming = statistics.stoptiming
local resettiming = statistics.resettiming
@@ -196,7 +194,7 @@ local n_box = 0
local nofcontours = 0
--- We don't want cosmetics like axis and labels to trigger a calculation,
+-- We don't want cosmetics like axis and labels to trigger a calculation,
-- especially a slow one.
local hashfields = {
@@ -421,7 +419,7 @@ function mp.lmt_contours_start()
for j=1,ny do
local f = fi[j]
if f >= minr and f <= maxr then
- di[j] = bor(di[j],bit)
+ di[j] = di[j] | bit
end
end
end
@@ -1839,12 +1837,41 @@ local f_function_y = formatters [ [[
end
]] ]
+-- local f_color = formatters [ [[
+-- local math = math
+-- return function(f)
+-- return %s
+-- end
+-- ]] ]
+
local f_color = formatters [ [[
- local math = math
- return function(f)
- return %s
- end
-]] ]
+ local math = math
+ local min = math.min
+ local max = math.max
+ local abs = math.abs
+ local minz = %s
+ local maxz = %s
+ --
+ local color_value = 0
+ local color_step = mp.lmt_color_functions.step
+ local color_shade = mp.lmt_color_functions.shade
+
+ local function step(...)
+ return color_step(color_value,n,...)
+ end
+ local function shade(...)
+ return color_shade(color_value,n,...)
+ end
+ -- local function lin(l)
+ -- return l/n
+ -- end
+ %s
+ return function(f,z)
+ brightness_factor = f
+ function_value = z
+ return %s
+ end
+ ]] ]
function mp.lmt_surface_do(specification)
--
@@ -1900,7 +1927,7 @@ function mp.lmt_surface_do(specification)
local dy = (ymax - ymin) / ny
local xt = xmin
--
- local minf, maxf
+ local minf, maxf, minz, maxz
--
-- similar as contours but no data loop here
--
@@ -1910,12 +1937,6 @@ function mp.lmt_surface_do(specification)
return false -- fatal error
end
--
- local ccode = load(f_color(colorcode))
- local color = type(ccode) == "function" and ccode()
- if type(color) ~= "function" then
- return false -- fatal error
- end
- --
for i=0,nx do
local yt = ymin
for j=0,ny do
@@ -1948,8 +1969,16 @@ function mp.lmt_surface_do(specification)
maxf = fac
end
--
- data[i][j] = { x, y, fac }
- --
+ if not minz then
+ minz = z
+ maxz = z
+ elseif z < minz then
+ minz = z
+ elseif z > maxz then
+ maxz = z
+ end
+ data[i][j] = { x, y, fac, z }
+ --
yt = yt + dy
end
xt = xt + dx
@@ -1959,6 +1988,11 @@ function mp.lmt_surface_do(specification)
local range = maxf - minf
local cl = linecolor or 1
local enforce = attributes.colors.model == "cmyk"
+ local ccode = load(f_color(minz,maxz,preamble,colorcode))
+ local color = type(ccode) == "function" and ccode()
+ if type(color) ~= "function" then
+ return false -- fatal error
+ end
for i=0,nx-1 do
for j=0,ny-1 do
-- points
@@ -1992,7 +2026,7 @@ function mp.lmt_surface_do(specification)
-- else
-- -- fill and draw in one go to prevent artifacts
-- end
- local cr, cg, cb = color(cf)
+ local cr, cg, cb = color(cf,z1[4]) -- cf, zout
if not cr then cr = 0 end
if not cg then cg = 0 end
if not cb then cb = 0 end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-ctx.lmt b/Master/texmf-dist/tex/context/base/mkxl/mlib-ctx.lmt
index 2569a6066b2..8ed6b0b00c5 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/mlib-ctx.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-ctx.lmt
@@ -118,15 +118,15 @@ implement {
arguments = "string",
actions = function(name)
local value = metapost.variables[name]
- if value ~= nil then
- local tvalue = type(value)
- if tvalue == "table" then
- context(concat(value," "))
- elseif tvalue == "number" or tvalue == "boolean" then
- context(tostring(value))
- elseif tvalue == "string" then
- context(value)
- end
+ local tvalue = type(value)
+ if tvalue == "nil" then
+ context("0")
+ elseif tvalue == "table" then
+ context(concat(value," "))
+ elseif tvalue == "number" or tvalue == "boolean" then
+ context(tostring(value))
+ elseif tvalue == "string" then
+ context(value)
end
end
}
@@ -223,6 +223,7 @@ implement {
{ "figure" },
{ "method" },
{ "namespace" },
+ { "filtering" },
}
}
}
@@ -313,6 +314,7 @@ implement {
{ "inclusions" },
{ "method" },
{ "namespace" },
+ { "filtering" },
{ "width", "dimension" },
{ "height", "dimension" },
},
@@ -360,16 +362,6 @@ function mptex.reset()
end
implement {
- name = "mppushvariables",
- actions = metapost.pushvariables,
-}
-
-implement {
- name = "mppopvariables",
- actions = metapost.popvariables,
-}
-
-implement {
name = "mptexset",
arguments = "string",
actions = mptex.set
@@ -418,3 +410,18 @@ MP = MP or { } -- user namespace
table.setmetatablecall(mp,function(t,k,...) return t[k](...) end)
table.setmetatablecall(MP,function(t,k,...) return t[k](...) end)
+
+-- A secret option:
+
+implement {
+ name = "resetMPinstance",
+ protected = true,
+ public = true,
+ arguments = "optional",
+ actions = function(s)
+ if s and s ~= "" then
+ report_metapost("resetting instance %a",s)
+ metapost.reset(s)
+ end
+ end,
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-ctx.mkxl b/Master/texmf-dist/tex/context/base/mkxl/mlib-ctx.mkxl
index fb069b6ea88..91bcaa58b32 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/mlib-ctx.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-ctx.mkxl
@@ -15,6 +15,17 @@
\installcorenamespace{graphicvariable}
+% \unprotect
+
+% \newdimension\d_adaptive_width
+% \newdimension\d_adaptive_height
+% \newdimension\d_adaptive_depth
+% \newdimension\d_adaptive_line
+% \newdimension\d_adaptive_hsize
+% \newbox \b_adaptive_box
+
+% \protect
+
\registerctxluafile{mlib-fio}{autosuffix}
\registerctxluafile{mlib-run}{autosuffix}
\registerctxluafile{mlib-ctx}{autosuffix}
@@ -26,8 +37,10 @@
\registerctxluafile{mlib-lmp}{autosuffix}
\registerctxluafile{mlib-int}{autosuffix}
\registerctxluafile{mlib-lmt}{autosuffix}
-\registerctxluafile{mlib-cnt}{autosuffix,optimize}
-\registerctxluafile{mlib-svg}{autosuffix,optimize}
+\registerctxluafile{mlib-pos}{autosuffix}
+\registerctxluafile{mlib-cnt}{autosuffix}
+\registerctxluafile{mlib-svg}{autosuffix}
+\registerctxluafile{mlib-fnt}{autosuffix} % outline fun
\unprotect
diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-fio.lmt b/Master/texmf-dist/tex/context/base/mkxl/mlib-fio.lmt
index 9de61affef7..07c9275beca 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/mlib-fio.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-fio.lmt
@@ -9,10 +9,12 @@ if not modules then modules = { } end modules ['mlib-fio'] = {
local type = type
local find = string.find
local concat = table.concat
-local suffix, addsuffix = file.suffix, file.addsuffix
+local suffix, addsuffix, is_writable = file.suffix, file.addsuffix, file.is_writable
+local urlhashed = url.hashed
local findfile = resolvers.findfile
-local new_instance = mplib.new
+local mplibnew = mplib.new
+----- mplibexecute = mplib.execute
local trace_terminal = false trackers.register("metapost.terminal", function(v) trace_terminal = v end)
@@ -23,51 +25,54 @@ local report_error = logs.reporter("metapost","error")
mplib.realtimelogging = false
-local l, nl, dl = { }, 0, false
-local t, nt, dt = { }, 0, false
-local e, ne, de = { }, 0, false
-
-local function logger(target,str)
- if target == 1 then
- -- log
- elseif target == 2 or target == 3 then
- -- term
- if str == "\n" then
- mplib.realtimelogging = true
- if nl > 0 then
- report_logger(concat(l,"",1,nl))
- nl, dl = 0, false
- elseif not dl then
- report_logger("")
- dl = true
+local handlelog do
+
+ local l, nl, dl = { }, 0, false
+
+ handlelog = function(instance,target,str)
+ if target == 1 then
+ -- log
+ elseif target == 2 or target == 3 then
+ -- term
+ if str == "\n" then
+ mplib.realtimelogging = true
+ if nl > 0 then
+ report_logger(concat(l,"",1,nl))
+ nl, dl = 0, false
+ elseif not dl then
+ report_logger("")
+ dl = true
+ end
+ else
+ nl = nl + 1
+ l[nl] = str
end
- else
- nl = nl + 1
- l[nl] = str
+ elseif target == 4 then
+ report_error(str)
end
- elseif target == 4 then
- report_error(str)
end
+
end
local finders = { }
mplib.finders = finders -- also used in meta-lua.lua
local function validftype(ftype)
- if ftype == "mp" then
- return "mp"
- else
- return nil
- end
+ return ftype == "mp" and "mp" or nil
end
-- We can have a list!
+local findtexfile = resolvers.findtexfile
+local opentexfile = resolvers.opentexfile
+local splitlines = string.splitlines
+
local suffixlist = { "mpxl", "mpiv", "mp" } -- no "mf"
local function findmpfile(name,ftype)
local validtyp = validftype(ftype)
- local fullname = findfile(name,validtyp)
+ -- local fullname = findfile(name,validtyp)
+ local fullname = findtexfile(name,validtyp)
if fullname and fullname ~= "" then
return fullname
elseif suffix(name) == "" then
@@ -81,27 +86,47 @@ local function findmpfile(name,ftype)
return nil
end
+-- variant 1
+
+-- finders.file = function(specification,name,mode,kind)
+-- if mode == "r" then
+-- return findmpfile(name,kind)
+-- elseif is_writable(name) then
+-- return name
+-- else
+-- return nil
+-- end
+-- end
+
+-- variant 2
+
+-- finders.file = function(specification,name,mode,kind)
+-- if not mode or mode == "r" then
+-- return findmpfile(name,kind)
+-- elseif is_writable(name) then
+-- return name
+-- else
+-- return nil
+-- end
+-- end
+
+-- variant 3
+
finders.file = function(specification,name,mode,kind)
- if mode == "r" then
- return findmpfile(name,kind)
- elseif file.is_writable(name) then
- return name
+ if mode == "w" then
+ return is_writable(name) and name or nil
else
- return nil
+ return findmpfile(name,kind) or nil
end
end
local function finder(name,mode,kind) -- fake message for mpost.map and metafun.mpvi
- local specification = url.hashed(name)
+ local specification = urlhashed(name)
local finder = finders[specification.scheme] or finders.file
local found = finder(specification,name,mode,validftype(ftype))
return found
end
-local findtexfile = resolvers.findtexfile
-local opentexfile = resolvers.opentexfile
-local splitlines = string.splitlines
-
local function writetoterminal(terminaldata,maxterm,d)
local t = type(d)
local n = 0
@@ -259,8 +284,7 @@ local function handleerror(instance, message, helpinfo, interaction)
report(helpinfo)
report()
if interaction == 5 then
- -- todo
--- luatex.abort()
+ -- luatex.abort()
end
end
@@ -271,19 +295,40 @@ local function handlewarning(instance, message)
end
function mplib.new(specification)
- local instance
local openfile = fileopener()
- specification.find_file = finder
- specification.run_logger = logger
- specification.run_overload = overload
- specification.run_error = function(...) handleerror (instance,...) end
- specification.run_warning = function(...) handlewarning(instance,...) end
- specification.open_file = openfile
- specification.interaction = "silent"
- specification.job_name = tex.jobname -- mandate in order to get something back
- specification.halt_on_error = true
- instance = new_instance(specification)
+ local handlers = specification.handlers
+ local instance
+ instance = mplibnew {
+ -- used
+ bend_tolerance = specification.bendtolerance,
+ move_tolerance = specification.movetolerance,
+ math_mode = specification.mathmode,
+ run_script = specification.runscript,
+ run_internal = specification.runinternal,
+ script_error = specification.scripterror,
+ make_text = specification.maketext,
+ -- always
+ extensions = 1,
+ -- random_seed = specification.seed,
+ utf8_mode = true,
+ text_mode = true,
+ show_mode = true,
+ -- not used
+ -- noninteractive = true;
+ -- ini_version = true,
+ -- always
+ find_file = finder,
+ run_overload = overload,
+ open_file = openfile,
+ interaction = "silent",
+ job_name = tex.jobname, -- mandate in order to get something back
+ halt_on_error = true,
+ run_logger = handlers.log or function(...) handlelog (instance,...) end,
+ run_error = handlers.error or function(...) handleerror (instance,...) end,
+ run_warning = handlers.warning or function(...) handlewarning(instance,...) end,
+ }
return instance, openfile("terminal")
end
-mplib.finder = finder
+mplib.finder = finder
+-----.execute = executor
diff --git a/Master/texmf-dist/tex/context/base/mkxl/font-mps.lmt b/Master/texmf-dist/tex/context/base/mkxl/mlib-fnt.lmt
index 8cab9cf5c8f..3209b2ee6bd 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/font-mps.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-fnt.lmt
@@ -6,9 +6,10 @@ if not modules then modules = { } end modules ['font-mps'] = {
license = "see context related readme files"
}
-local tostring = tostring
-local concat = table.concat
-local formatters = string.formatters
+local type, tonumber, tostring = type, tonumber, tostring
+local concat, insert, remove = table.concat, table.insert, table.remove
+local formatters, match = string.formatters, string.match
+local utfbyte = utf.byte
-- QP0 [QP1] QP2 => CP0 [CP1 CP2] CP3
@@ -33,8 +34,8 @@ local f_dofill = formatters["fill %s;"]
local f_draw_trace = formatters["drawpathonly %s;"]
local f_draw = formatters["draw %s;"]
-local f_boundingbox = formatters["((%N,%N)--(%N,%N)--(%N,%N)--(%N,%N)--cycle)"]
-local f_vertical = formatters["((%N,%N)--(%N,%N))"]
+local f_rectangle = formatters["((%N,%N)--(%N,%N)--(%N,%N)--(%N,%N)--cycle)"]
+local f_line = formatters["((%N,%N)--(%N,%N))"]
function metapost.boundingbox(d,factor)
local bounds = d.boundingbox
@@ -43,7 +44,15 @@ function metapost.boundingbox(d,factor)
local lly = factor*bounds[2]
local urx = factor*bounds[3]
local ury = factor*bounds[4]
- return f_boundingbox(llx,lly,urx,lly,urx,ury,llx,ury)
+ return f_rectangle(llx,lly,urx,lly,urx,ury,llx,ury)
+end
+
+function metapost.baseline(d,factor)
+ local bounds = d.boundingbox
+ local factor = factor or 1
+ local llx = factor*bounds[1]
+ local urx = factor*bounds[3]
+ return f_line(llx,0,urx,0)
end
function metapost.widthline(d,factor)
@@ -52,7 +61,7 @@ function metapost.widthline(d,factor)
local lly = factor*bounds[2]
local ury = factor*bounds[4]
local width = factor*d.width
- return f_vertical(width,lly,width,ury)
+ return f_line(width,lly,width,ury)
end
function metapost.zeroline(d,factor)
@@ -60,7 +69,7 @@ function metapost.zeroline(d,factor)
local factor = factor or 1
local lly = factor*bounds[2]
local ury = factor*bounds[4]
- return f_vertical(0,lly,0,ury)
+ return f_line(0,lly,0,ury)
end
function metapost.paths(d,xfactor,yfactor)
@@ -118,6 +127,7 @@ function metapost.paths(d,xfactor,yfactor)
end
end
elseif segments then
+-- inspect(segments)
for i=1,#segments do
local segment = segments[i]
local operator = segment[#segment]
@@ -137,7 +147,7 @@ function metapost.paths(d,xfactor,yfactor)
elseif operator == "c" then -- "curveto"
size = size + 1
path[size] = f_curveto(xfactor*segment[1],yfactor*segment[2],xfactor*segment[3],yfactor*segment[4],xfactor*segment[5],yfactor*segment[6])
- elseif operator =="q" then -- "quadraticto"
+ elseif operator == "q" then -- "quadraticto"
size = size + 1
-- first is always a moveto
local prev = segments[i-1]
@@ -238,7 +248,7 @@ function metapost.maxbounds(data,index,factor)
if width > urx then
urx = width
end
- return f_boundingbox(
+ return f_rectangle(
factor*llx,factor*ymin,
factor*urx,factor*ymin,
factor*urx,factor*ymax,
@@ -250,58 +260,79 @@ end
-- right time. It's probably why I like watching https://www.youtube.com/watch?v=c5FqpddnJmc
-- so much: precisely (and perfectly) timed too.
-local texgetbox = tex.getbox
+local texgetbox = tex.getbox
+
+local nodecodes = nodes.nodecodes -- no nuts yet
+local rulecodes = nodes.rulecodes
-local nodecodes = nodes.nodecodes -- no nuts yet
-local rulecodes = nodes.rulecodes
+local rule_code = nodecodes.rule
-local rule_code = nodecodes.rule
+local normalrule_code = rulecodes.normal
+local outlinerule_code = rulecodes.outline
+local userrule_code = rulecodes.user
+local emptyrule_code = rulecodes.empty
-local normalrule_code = rulecodes.normal
-local outlinerule_code = rulecodes.outline
-local userrule_code = rulecodes.user
-local emptyrule_code = rulecodes.empty
+local nuts = nodes.nuts
+----- getwhd = nuts.getwhd
+local getexpansion = nuts.getexpansion
+local getscales = nuts.getscales
+local isglyph = nuts.isglyph
+local getglyphdimensions = nuts.getglyphdimensions
-local nuts = nodes.nuts
-local getwhd = nuts.getwhd
-local getexpansion = nuts.getexpansion
-local isglyph = nuts.isglyph
+local fonthashes = fonts.hashes
+local fontcharacters = fonthashes.characters
+local fontparameters = fonthashes.parameters
+local fontshapes = fonthashes.shapes
+local fontdescriptions = fonthashes.descriptions
-local characters = fonts.hashes.characters
-local parameters = fonts.hashes.parameters
-local shapes = fonts.hashes.shapes
-local topaths = metapost.paths
+local topaths = metapost.paths
-local f_text = formatters["mfun_do_outline_text_flush(%q,%i,%N,%N,%q)(%,t);"]
-local f_rule = formatters["mfun_do_outline_rule_flush(%q,%N,%N,%N,%N);"]
-local f_bounds = formatters["checkbounds(%N,%N,%N,%N);"]
-local s_nothing = "(origin scaled 10)"
+local f_text = formatters["mfun_do_outline_text_flush(%q,%i,%N,%N,%q)(%,t);"]
+local f_rule = formatters["mfun_do_outline_rule_flush(%q,%N,%N,%N,%N);"]
+local f_bounds = formatters["checkbounds(%N,%N,%N,%N);"]
+local s_nothing = "(origin scaled 10)"
-local sc = 10
-local fc = number.dimenfactors.bp
+local sc = 10
+local fc = number.dimenfactors.bp
-local function glyph(kind,font,char,advance,shift,ex)
- local character = characters[font][char]
+-- handle compact mode here:
+
+local function glyph(kind,font,char,advance,shift,ex,s,sx,sy)
+ local character = fontcharacters[font][char]
if character then
local index = character.index
if index then
- local shapedata = shapes[font]
- local glyphs = shapedata.glyphs -- todo: subfonts fonts.shapes.indexed(font,sub)
+ local shapedata = fontshapes[font]
+ local glyphs = shapedata.glyphs
if glyphs then
local glyf = glyphs[index]
if glyf then
local units = 1000 -- factor already takes shapedata.units into account
- local yfactor = (sc/units) * parameters[font].factor / 655.36
+ local yfactor = (sc/units) * fontparameters[font].factor / 655.36
local xfactor = yfactor
local shift = shift or 0
local advance = advance or 0
local exfactor = ex or 0
local wfactor = 1
local detail = kind == "p" and tostring(char) or ""
+ -- what about other effects
+ local xoffset = character.xoffset or 0
+ local yoffset = character.yoffset or 0 -- todo
+ --
if exfactor ~= 0 then
wfactor = (1+(ex/units)/1000)
xfactor = xfactor * wfactor
end
+ if xoffset ~= 0 then
+ advance = advance + s * sx * xoffset * fc / 1000000
+ end
+ if yoffset ~= 0 then
+ shift = shift + s * sy * yoffset * fc / 1000000
+ end
+ if s then
+ xfactor = (s/1000) * ((sx or 1000)/1000) * xfactor
+ yfactor = (s/1000) * ((sy or 1000)/1000) * yfactor
+ end
local paths = topaths(glyf,xfactor,yfactor)
if paths then
return f_text(kind,#paths,advance,shift,detail,paths) -- , character.width * fc * wfactor
@@ -324,15 +355,57 @@ local function reset()
end
local function flushcharacter(current, pos_h, pos_v, pod_r, font, char)
- local char, font = isglyph(current)
- local code = glyph(kind,font,char,pos_h*fc,pos_v*fc,getexpansion(current))
- if code then
- b = b + 1
- buffer[b] = code
+ if current then
+ local char, font = isglyph(current)
+ local s, sx, sy = getscales(current)
+ local code = glyph(kind,font,char,pos_h*fc,pos_v*fc,getexpansion(current),s,sx,sy)
+ if code then
+ b = b + 1
+ buffer[b] = code
+ end
+ else
+ logs.report("mlib-fnt","check 'flushcharacter', no current")
end
end
-local function flushrule(current, pos_h, pos_v, pos_r, size_h, size_v, subtype)
+-- Messy ... todo:
+
+-- local function flushcharacter(current,pos_h,pos_v,pos_r,font,char,data,csx,csy,factor,ssx,ssy)
+-- local width, height, depth, sx, sy
+-- if current then
+-- char, font = isglyph(current)
+-- width, height, depth, factor, sx, sy = getglyphdimensions(current)
+-- else
+-- if not data then
+-- data = fontcharacters[font][char] or { }
+-- end
+-- width = data.width or 0
+-- height = data.height or 0
+-- depth = data.depth or 0
+-- sx = 1
+-- sy = 1
+-- end
+-- if csx then
+-- sx = sx * csx
+-- end
+-- if csy then
+-- sy = sy * csy
+-- end
+-- if ssx then
+-- sx = sx * ssx
+-- end
+-- if ssy then
+-- sy = sy * ssy
+-- end
+-- local code = glyph(kind,font,char,pos_h*fc,pos_v*fc,factor,s,sx,sy)
+-- if code then
+-- b = b + 1
+-- buffer[b] = code
+-- end
+-- return width, height, depth
+-- end
+
+local function flushrule(current,pos_h,pos_v,pos_r,size_h,size_v,subtype)
if subtype == normalrule_code then
b = b + 1
buffer[b] = f_rule(kind,pos_h*fc,pos_v*fc,size_h*fc,size_v*fc)
@@ -396,3 +469,134 @@ function metapost.boxtomp(n,k)
return result
end
+-- This is a new set of commands:
+
+local loaded = table.setmetatableindex(function(t,k)
+ local v = fonts.definers.internal({ name = k } ,"<lmt:glyphshape:font>")
+ t[k] = v
+ return v
+end)
+
+local mpdata = 0
+local mpstack = { }
+
+function mp.lmt_glyphshape_start(id,character)
+ if type(id) == "string" then
+ id = loaded[id]
+ end
+ local fontid = (id and id ~= 0 and id) or font.current()
+ local shapedata = fontshapes [fontid] -- by index
+ local characters = fontcharacters [fontid] -- by unicode
+ local descriptions = fontdescriptions[fontid] -- by unicode
+ local mathgaps = mathematics.gaps -- not yet loaded
+ local shapeglyphs = shapedata.glyphs or { }
+ if type(character) == "string" and character ~= "" then
+ local hex = match(character,"^0x(.+)")
+ if hex then
+ character = tonumber(hex,16)
+ else
+ character = utfbyte(character)
+ end
+ else
+ character = tonumber(character)
+ end
+ local unicode = mathgaps[character] or character
+ local chardata = characters[unicode]
+ local descdata = descriptions[unicode]
+ if chardata then
+ glyph = shapeglyphs[chardata.index]
+ if glyph then
+ mpdata = glyph.mpdata
+ if not mpdata then
+ if glyph.segments or glyph.sequence then
+ local units = shapedata.units or 1000
+ local factor = 100/units
+ local width = (descdata.width or 0) * factor
+ local height = descdata.boundingbox[4] * factor
+ local depth = descdata.boundingbox[2] * factor
+ local math = descdata.math
+ local italic = (math and math.italic or 0) * factor
+ local accent = (math and math.accent or 0) * factor
+ mpdata = {
+ paths = metapost.paths(glyph,factor),
+ boundingbox = metapost.boundingbox(glyph,factor),
+ baseline = metapost.baseline(glyph,factor),
+ width = width,
+ height = height,
+ depth = depth,
+ italic = italic,
+ accent = accent,
+ usedbox = f_rectangle(0,depth,width,depth,width,height,0,height),
+ usedline = f_line(0,0,width,0),
+ }
+ glyph.mpdata = mpdata
+ else
+ print("CHECK 1",id,character)
+ end
+ end
+ end
+ else
+ print("CHECK 2",id,character)
+ end
+ insert(mpstack, mpdata)
+end
+
+local mpprint = mp.print
+local injectpair = mp.inject.pair
+local injectnumeric = mp.inject.numeric
+
+function mp.lmt_glyphshape_stop()
+ mpdata = remove(mpstack)
+end
+
+function mp.lmt_glyphshape_n()
+ if mpdata then
+ mpprint(#mpdata.paths)
+ else
+ injectnumeric(0)
+ end
+end
+
+function mp.lmt_glyphshape_path(i)
+ if mpdata then
+ mpprint(mpdata.paths[i])
+ else
+ injectpair(0,0)
+ end
+end
+
+function mp.lmt_glyphshape_boundingbox()
+ if mpdata then
+ mpprint(mpdata.boundingbox)
+ else
+ injectpair(0,0)
+ end
+end
+function mp.lmt_glyphshape_usedbox()
+ if mpdata then
+ mpprint(mpdata.usedbox)
+ else
+ injectpair(0,0)
+ end
+end
+
+function mp.lmt_glyphshape_baseline()
+ if mpdata then
+ mpprint(mpdata.baseline)
+ else
+ injectpair(0,0)
+ end
+end
+function mp.lmt_glyphshape_usedline()
+ if mpdata then
+ mpprint(mpdata.usedline)
+ else
+ injectpair(0,0)
+ end
+end
+
+function mp.lmt_glyphshape_width () injectnumeric(mpdata and mpdata.width or 0) end
+function mp.lmt_glyphshape_depth () injectnumeric(mpdata and mpdata.depth or 0) end
+function mp.lmt_glyphshape_height() injectnumeric(mpdata and mpdata.height or 0) end
+function mp.lmt_glyphshape_italic() injectnumeric(mpdata and mpdata.italic or 0) end
+function mp.lmt_glyphshape_accent() injectnumeric(mpdata and mpdata.accent or 0) end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-int.lmt b/Master/texmf-dist/tex/context/base/mkxl/mlib-int.lmt
index a936e55924e..647b7054c2b 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/mlib-int.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-int.lmt
@@ -7,27 +7,15 @@ if not modules then modules = { } end modules ['mlib-int'] = {
}
local factor = number.dimenfactors.bp
-local mpstring = mp.string
-local mpboolean = mp.boolean
+local isdimen = tex.isdimen
+local iscount = tex.iscount
local getdimen = tex.getdimen
local getcount = tex.getcount
local getmacro = tokens.getters.macro
local get = tex.get
-local emwidths = fonts.hashes.emwidths
-local exheights = fonts.hashes.exheights
local registerscript = metapost.registerscript
-
-local on_right_page = structures.pages.on_right
-local is_odd_page = structures.pages.is_odd
-local in_body_page = structures.pages.in_body
-local page_fraction = structures.pages.fraction
-local layout_has_changed = structures.pages.has_changed
-
-local function defaultcolormodel() -- can be helper
- local colormethod = getcount("MPcolormethod")
- return (colormethod == 0 or colormethod == 1) and 1 or 3
-end
+local registerdirect = metapost.registerdirect
do
@@ -52,109 +40,218 @@ do
end
end
- registerscript("year", function() return item("year") end)
- registerscript("month", function() return item("month") end)
- registerscript("day", function() return item("day") end)
- registerscript("hour", function() return item("hour") end)
- registerscript("minute", function() return item("min") end)
- registerscript("second", function() return item("sec") end)
+ registerdirect("year", function() return item("year") end)
+ registerdirect("month", function() return item("month") end)
+ registerdirect("day", function() return item("day") end)
+ registerdirect("hour", function() return item("hour") end)
+ registerdirect("minute", function() return item("min") end)
+ registerdirect("second", function() return item("sec") end)
+
+end
+
+do
+
+ -- These get swapped so the d_ numbers change.
+
+ registerdirect("PaperHeight", function() return getdimen("paperheight") * factor end)
+ registerdirect("PaperWidth", function() return getdimen("paperwidth") * factor end)
+ registerdirect("PrintPaperHeight", function() return getdimen("printpaperheight") * factor end)
+ registerdirect("PrintPaperWidth", function() return getdimen("printpaperwidth") * factor end)
+ registerdirect("BackSpace", function() return getdimen("backspace") * factor end)
+ registerdirect("CutSpace", function() return getdimen("cutspace") * factor end)
+
+ registerdirect("LeftEdgeWidth", function() return getdimen("leftedgewidth") * factor end)
+ registerdirect("LeftEdgeDistance", function() return getdimen("leftedgedistance") * factor end)
+ registerdirect("LeftMarginWidth", function() return getdimen("leftmarginwidth") * factor end)
+ registerdirect("LeftMarginDistance", function() return getdimen("leftmargindistance") * factor end)
+ registerdirect("RightMarginDistance", function() return getdimen("rightmargindistance") * factor end)
+ registerdirect("RightMarginWidth", function() return getdimen("rightmarginwidth") * factor end)
+ registerdirect("RightEdgeDistance", function() return getdimen("rightedgedistance") * factor end)
+ registerdirect("RightEdgeWidth", function() return getdimen("rightedgewidth") * factor end)
+
+ -- leftmargintotal rightmargintotal -- not yet
+ -- leftedgetotal rightedgetotal
+ -- leftsidetotal rightsidetotal
+ -- leftcombitotal rightcombitotal
+ -- innermargintotal outermargintotal
+ -- inneredgetotal outeredgetotal
+ -- innercombitotal outercombitotal
+ -- innersidetotal outersidetotal
+
+ local d_leftedgewidth = isdimen("leftedgewidth")
+ local d_leftedgedistance = isdimen("leftedgedistance")
+ local d_leftmarginwidth = isdimen("leftmarginwidth")
+ local d_leftmargindistance = isdimen("leftmargindistance")
+ local d_rightmargindistance = isdimen("rightmargindistance")
+ local d_rightmarginwidth = isdimen("rightmarginwidth")
+ local d_rightedgedistance = isdimen("rightedgedistance")
+ local d_rightedgewidth = isdimen("rightedgewidth")
+
+ registerdirect("InnerMarginDistance", function() return getdimen(d_leftmargindistance ) * factor end)
+ registerdirect("InnerMarginWidth", function() return getdimen(d_leftmarginwidth ) * factor end)
+ registerdirect("OuterMarginDistance", function() return getdimen(d_rightmargindistance) * factor end)
+ registerdirect("OuterMarginWidth", function() return getdimen(d_rightmarginwidth ) * factor end)
+ registerdirect("InnerEdgeDistance", function() return getdimen(d_leftmargindistance ) * factor end)
+ registerdirect("InnerEdgeWidth", function() return getdimen(d_leftmarginwidth ) * factor end)
+ registerdirect("OuterEdgeDistance", function() return getdimen(d_rightedgedistance ) * factor end)
+ registerdirect("OuterEdgeWidth", function() return getdimen(d_rightedgewidth ) * factor end)
+
+ -- local onrightpage = structures.pages.on_right
+
+ -- registerdirect("InnerMarginDistance", function() return getdimen(onrightpage() and "leftmargindistance" or "rightmargindistance") * factor end)
+ -- registerdirect("InnerMarginWidth", function() return getdimen(onrightpage() and "leftmarginwidth" or "rightmarginwidth" ) * factor end)
+ -- registerdirect("OuterMarginDistance", function() return getdimen(onrightpage() and "rightmargindistance" or "leftmargindistance" ) * factor end)
+ -- registerdirect("OuterMarginWidth", function() return getdimen(onrightpage() and "rightmarginwidth" or "leftmarginwidth" ) * factor end)
+ -- registerdirect("InnerEdgeDistance", function() return getdimen(onrightpage() and "leftmargindistance" or "rightmargindistance") * factor end)
+ -- registerdirect("InnerEdgeWidth", function() return getdimen(onrightpage() and "leftmarginwidth" or "rightmarginwidth" ) * factor end)
+ -- registerdirect("OuterEdgeDistance", function() return getdimen(onrightpage() and "rightedgedistance" or "leftedgedistance" ) * factor end)
+ -- registerdirect("OuterEdgeWidth", function() return getdimen(onrightpage() and "rightedgewidth" or "leftedgewidth" ) * factor end)
+
+ -- These have stable d_ numbers.
+
+ local d_topspace = isdimen("topspace") registerdirect("TopSpace", function() return getdimen(d_topspace) * factor end)
+ local d_bottomspace = isdimen("bottomspace") registerdirect("BottomSpace", function() return getdimen(d_bottomspace) * factor end)
+ local d_makeupheight = isdimen("makeupheight") registerdirect("MakeupHeight", function() return getdimen(d_makeupheight) * factor end)
+ local d_makeupwidth = isdimen("makeupwidth") registerdirect("MakeupWidth", function() return getdimen(d_makeupwidth) * factor end)
+ local d_topheight = isdimen("topheight") registerdirect("TopHeight", function() return getdimen(d_topheight) * factor end)
+ local d_topdistance = isdimen("topdistance") registerdirect("TopDistance", function() return getdimen(d_topdistance) * factor end)
+ local d_headerheight = isdimen("headerheight") registerdirect("HeaderHeight", function() return getdimen(d_headerheight) * factor end)
+ local d_headerdistance = isdimen("headerdistance") registerdirect("HeaderDistance", function() return getdimen(d_headerdistance) * factor end)
+ local d_textheight = isdimen("textheight") registerdirect("TextHeight", function() return getdimen(d_textheight) * factor end)
+ local d_footerdistance = isdimen("footerdistance") registerdirect("FooterDistance", function() return getdimen(d_footerdistance) * factor end)
+ local d_footerheight = isdimen("footerheight") registerdirect("FooterHeight", function() return getdimen(d_footerheight) * factor end)
+ local d_bottomdistance = isdimen("bottomdistance") registerdirect("BottomDistance", function() return getdimen(d_bottomdistance) * factor end)
+ local d_bottomheight = isdimen("bottomheight") registerdirect("BottomHeight", function() return getdimen(d_bottomheight) * factor end)
+ local d_textwidth = isdimen("textwidth") registerdirect("TextWidth", function() return getdimen(d_textwidth) * factor end)
+
+end
+
+do
+
+ local d_pagebackgroundoffset = isdimen("pagebackgroundoffset") registerdirect("PageOffset", function() return getdimen(d_pagebackgroundoffset) * factor end)
+ local d_pagebackgrounddepth = isdimen("pagebackgrounddepth") registerdirect("PageDepth", function() return getdimen(d_pagebackgrounddepth) * factor end)
+ local c_layoutcolumns = iscount("layoutcolumns") registerdirect("LayoutColumns", function() return getcount(c_layoutcolumns) end)
+ local d_layoutcolumndistance = isdimen("layoutcolumndistance") registerdirect("LayoutColumnDistance", function() return getdimen(d_layoutcolumndistance) * factor end)
+ local d_layoutcolumnwidth = isdimen("layoutcolumnwidth") registerdirect("LayoutColumnWidth", function() return getdimen(d_layoutcolumnwidth) * factor end)
+ local d_spinewidth = isdimen("spinewidth") registerdirect("SpineWidth", function() return getdimen(d_spinewidth) * factor end)
+ local d_paperbleed = isdimen("paperbleed") registerdirect("PaperBleed", function() return getdimen(d_paperbleed) * factor end)
+
+end
+
+do
+
+ local c_realpageno = iscount("realpageno") registerdirect("RealPageNumber", function() return getcount(c_realpageno) end)
+ local c_lastpageno = iscount("lastpageno") registerdirect("LastPageNumber", function() return getcount(c_lastpageno) end)
+
+ local c_userpageno = iscount("userpageno") registerdirect("PageNumber", function() return getcount(c_userpageno) end)
+ local c_lastpageno = iscount("lastpageno") registerdirect("NOfPages", function() return getcount(c_lastpageno) end)
+
+ local c_subpageno = iscount("subpageno") registerdirect("SubPageNumber", function() return getcount(c_subpageno) end)
+ local c_lastsubpageno = iscount("lastsubpageno") registerdirect("NOfSubPages", function() return getcount(c_lastsubpageno) end)
+
+ local c_mofcolumns = iscount("mofcolumns") registerdirect("CurrentColumn", function() return getcount(c_mofcolumns) end)
+ local c_nofcolumns = iscount("nofcolumns") registerdirect("NOfColumns", function() return getcount(c_nofcolumns) end)
+
+end
+
+do
+
+ registerdirect("BaseLineSkip", function() return get("baselineskip",true) * factor end)
+ registerdirect("TopSkip", function() return get("topskip",true) * factor end)
+ registerdirect("CurrentWidth", function() return get("hsize") * factor end)
+ registerdirect("CurrentHeight", function() return get("vsize") * factor end)
+ registerdirect("HSize", function() return get("hsize") * factor end)
+ registerdirect("VSize", function() return get("vsize") * factor end)
+
+ local emwidths = fonts.hashes.emwidths
+ local exheights = fonts.hashes.exheights
+
+ registerdirect("EmWidth", function() return emwidths [false] * factor end)
+ registerdirect("ExHeight", function() return exheights[false] * factor end)
end
-registerscript("PaperHeight", function() return getdimen("paperheight") * factor end)
-registerscript("PaperWidth", function() return getdimen("paperwidth") * factor end)
-registerscript("PrintPaperHeight", function() return getdimen("printpaperheight") * factor end)
-registerscript("PrintPaperWidth", function() return getdimen("printpaperwidth") * factor end)
-registerscript("TopSpace", function() return getdimen("topspace") * factor end)
-registerscript("BottomSpace", function() return getdimen("bottomspace") * factor end)
-registerscript("BackSpace", function() return getdimen("backspace") * factor end)
-registerscript("CutSpace", function() return getdimen("cutspace") * factor end)
-registerscript("MakeupHeight", function() return getdimen("makeupheight") * factor end)
-registerscript("MakeupWidth", function() return getdimen("makeupwidth") * factor end)
-registerscript("TopHeight", function() return getdimen("topheight") * factor end)
-registerscript("TopDistance", function() return getdimen("topdistance") * factor end)
-registerscript("HeaderHeight", function() return getdimen("headerheight") * factor end)
-registerscript("HeaderDistance", function() return getdimen("headerdistance") * factor end)
-registerscript("TextHeight", function() return getdimen("textheight") * factor end)
-registerscript("FooterDistance", function() return getdimen("footerdistance") * factor end)
-registerscript("FooterHeight", function() return getdimen("footerheight") * factor end)
-registerscript("BottomDistance", function() return getdimen("bottomdistance") * factor end)
-registerscript("BottomHeight", function() return getdimen("bottomheight") * factor end)
-registerscript("LeftEdgeWidth", function() return getdimen("leftedgewidth") * factor end)
-registerscript("LeftEdgeDistance", function() return getdimen("leftedgedistance") * factor end)
-registerscript("LeftMarginWidth", function() return getdimen("leftmarginwidth") * factor end)
-registerscript("LeftMarginDistance", function() return getdimen("leftmargindistance") * factor end)
-registerscript("TextWidth", function() return getdimen("textwidth") * factor end)
-registerscript("RightMarginDistance", function() return getdimen("rightmargindistance") * factor end)
-registerscript("RightMarginWidth", function() return getdimen("rightmarginwidth") * factor end)
-registerscript("RightEdgeDistance", function() return getdimen("rightedgedistance") * factor end)
-registerscript("RightEdgeWidth", function() return getdimen("rightedgewidth") * factor end)
-registerscript("InnerMarginDistance", function() return getdimen("innermargindistance") * factor end)
-registerscript("InnerMarginWidth", function() return getdimen("innermarginwidth") * factor end)
-registerscript("OuterMarginDistance", function() return getdimen("outermargindistance") * factor end)
-registerscript("OuterMarginWidth", function() return getdimen("outermarginwidth") * factor end)
-registerscript("InnerEdgeDistance", function() return getdimen("inneredgedistance") * factor end)
-registerscript("InnerEdgeWidth", function() return getdimen("inneredgewidth") * factor end)
-registerscript("OuterEdgeDistance", function() return getdimen("outeredgedistance") * factor end)
-registerscript("OuterEdgeWidth", function() return getdimen("outeredgewidth") * factor end)
-registerscript("PageOffset", function() return getdimen("pagebackgroundoffset") * factor end)
-registerscript("PageDepth", function() return getdimen("pagebackgrounddepth") * factor end)
-registerscript("LayoutColumns", function() return getcount("layoutcolumns") end)
-registerscript("LayoutColumnDistance", function() return getdimen("layoutcolumndistance") * factor end)
-registerscript("LayoutColumnWidth", function() return getdimen("layoutcolumnwidth") * factor end)
-registerscript("SpineWidth", function() return getdimen("spinewidth") * factor end)
-registerscript("PaperBleed", function() return getdimen("paperbleed") * factor end)
-
-registerscript("RealPageNumber", function() return getcount("realpageno") end)
-registerscript("LastPageNumber", function() return getcount("lastpageno") end)
-
-registerscript("PageNumber", function() return getcount("pageno") end)
-registerscript("NOfPages", function() return getcount("lastpageno") end)
-
-registerscript("SubPageNumber", function() return getcount("subpageno") end)
-registerscript("NOfSubPages", function() return getcount("lastsubpageno") end)
-
-registerscript("CurrentColumn", function() return getcount("mofcolumns") end)
-registerscript("NOfColumns", function() return getcount("nofcolumns") end)
-
-registerscript("BaseLineSkip", function() return get ("baselineskip",true) * factor end)
-registerscript("LineHeight", function() return getdimen("lineheight") * factor end)
-registerscript("BodyFontSize", function() return getdimen("bodyfontsize") * factor end)
-
-registerscript("TopSkip", function() return get ("topskip",true) * factor end)
-registerscript("StrutHeight", function() return getdimen("strutht") * factor end)
-registerscript("StrutDepth", function() return getdimen("strutdp") * factor end)
-
-registerscript("PageNumber", function() return getcount("pageno") end)
-registerscript("RealPageNumber", function() return getcount("realpageno") end)
-registerscript("NOfPages", function() return getcount("lastpageno") end)
-
-registerscript("CurrentWidth", function() return get ("hsize") * factor end)
-registerscript("CurrentHeight", function() return get ("vsize") * factor end)
-
-registerscript("EmWidth", function() return emwidths [false] * factor end)
-registerscript("ExHeight", function() return exheights[false] * factor end)
-
-registerscript("HSize", function() return get ("hsize") * factor end)
-registerscript("VSize", function() return get ("vsize") * factor end)
-registerscript("LastPageNumber", function() return getcount("lastpageno") end)
-
-registerscript("OverlayWidth", function() return getdimen("d_overlay_width") * factor end)
-registerscript("OverlayHeight", function() return getdimen("d_overlay_height") * factor end)
-registerscript("OverlayDepth", function() return getdimen("d_overlay_depth") * factor end)
-registerscript("OverlayLineWidth", function() return getdimen("d_overlay_linewidth") * factor end)
-registerscript("OverlayOffset", function() return getdimen("d_overlay_offset") * factor end)
-registerscript("OverlayRegion", function() mpstring(getmacro("m_overlay_region")) end)
---------------("CurrentLayout", function() mpstring(getmacro("currentlayout")) end)
-
--- should be direct
---
--- registerscript("PageFraction", page_fraction)
-
-registerscript("PageFraction", function() return mpboolean(page_fraction ()) end)
-registerscript("OnRightPage", function() return mpboolean(on_right_page ()) end)
-registerscript("OnOddPage", function() return mpboolean(is_odd_page ()) end)
-registerscript("InPageBody", function() return mpboolean(in_body_page ()) end)
-registerscript("LayoutHasChanged", function() return mpboolean(layout_has_changed()) end)
-
-registerscript("defaultcolormodel", defaultcolormodel)
+do
+
+ local d_lineheight = isdimen("lineheight") registerdirect("LineHeight", function() return getdimen(d_lineheight) * factor end)
+ local d_bodyfontsize = isdimen("bodyfontsize") registerdirect("BodyFontSize", function() return getdimen(d_bodyfontsize) * factor end)
+ local d_strutht = isdimen("strutht") registerdirect("StrutHeight", function() return getdimen(d_strutht) * factor end)
+ local d_strutdp = isdimen("strutdp") registerdirect("StrutDepth", function() return getdimen(d_strutdp) * factor end)
+
+end
+
+do
+
+ local d_overlay_width = isdimen("d_overlay_width") registerdirect("OverlayWidth", function() return getdimen(d_overlay_width) * factor end)
+ local d_overlay_height = isdimen("d_overlay_height") registerdirect("OverlayHeight", function() return getdimen(d_overlay_height) * factor end)
+ local d_overlay_depth = isdimen("d_overlay_depth") registerdirect("OverlayDepth", function() return getdimen(d_overlay_depth) * factor end)
+ local d_overlay_linewidth = isdimen("d_overlay_linewidth") registerdirect("OverlayLineWidth", function() return getdimen(d_overlay_linewidth) * factor end)
+ local d_overlay_offset = isdimen("d_overlay_offset") registerdirect("OverlayOffset", function() return getdimen(d_overlay_offset) * factor end)
+ registerdirect("OverlayRegion", function() return getmacro("m_overlay_region") end)
+ registerdirect("CurrentLayout", function() return getmacro("currentlayout") end)
+ registerdirect("OverlayColor", function() return getmacro("overlaycolor") end)
+ registerdirect("OverlayLineColor", function() return getmacro("overlaylinecolor") end)
+
+end
+
+do
+
+ registerdirect("LastChangedLayoutPage",function() return getcount("c_page_layouts_changed") end)
+ registerdirect("SwapMarginDimensions", function() token.expandmacro("swapmargindimensions") end)
+
+ registerdirect("PageFraction", structures.pages.fraction)
+ registerdirect("OnRightPage", structures.pages.on_right)
+ registerdirect("OnOddPage", structures.pages.is_odd)
+ registerdirect("InPageBody", structures.pages.in_body)
+ --------------("LayoutHasChanged", structures.pages.has_changed)
+
+end
+
+do
+
+ local function defaultcolormodel() -- can be helper
+ local colormethod = getcount("MPcolormethod")
+ return (colormethod == 0 or colormethod == 1) and 1 or 3
+ end
+
+ registerdirect("defaultcolormodel", defaultcolormodel)
+
+end
+
+do
+
+ -- see node-rul.*
+ -- offset is a multiplier
+ -- factor is the amount
+
+ -- TODO: dimensions are yet undefined so we will move this
+
+ registerdirect("RuleWidth", function() return getdimen("d_rule_width") * factor end)
+ registerdirect("RuleHeight", function() return getdimen("d_rule_height") * factor end)
+ registerdirect("RuleDepth", function() return getdimen("d_rule_depth") * factor end)
+ registerdirect("RuleH", function() return getdimen("d_rule_h") * factor end)
+ registerdirect("RuleV", function() return getdimen("d_rule_v") * factor end)
+ registerdirect("RuleThickness", function() return getdimen("d_rule_line") * factor end)
+ registerdirect("RuleOffset", function() return getdimen("d_rule_offset") / 65536 end) -- not factor
+ registerdirect("RuleDirection", function() return getmacro("m_rule_direction") end)
+ registerdirect("RuleFactor", function() return getdimen("d_rule_factor") * factor end)
+ registerdirect("RuleOption", function() return getmacro("m_rule_option") end)
+ registerscript("RuleColor", function() return getmacro("m_rule_color") end)
+
+end
+
+-- see typo-ada.*
+
+do
+
+ local d_adaptive_width = isdimen("d_adaptive_width") registerdirect("AdaptiveWidth", function() return getdimen(d_adaptive_width) * factor end)
+ local d_adaptive_height = isdimen("d_adaptive_height") registerdirect("AdaptiveHeight", function() return getdimen(d_adaptive_height) * factor end)
+ local d_adaptive_depth = isdimen("d_adaptive_depth") registerdirect("AdaptiveDepth", function() return getdimen(d_adaptive_depth) * factor end)
+ local d_adaptive_line = isdimen("d_adaptive_line") registerdirect("AdaptiveThickness", function() return getdimen(d_adaptive_line) * factor end)
+ registerdirect("AdaptiveColor", function() return getmacro("m_adaptive_color") end)
+
+ registerdirect("AdaptiveTotal", function()
+ return (getdimen(d_adaptive_height) + getdimen(d_adaptive_depth)) * factor
+ end)
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-lmp.lmt b/Master/texmf-dist/tex/context/base/mkxl/mlib-lmp.lmt
index 2b3e910babd..db23fcedecb 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/mlib-lmp.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-lmp.lmt
@@ -8,69 +8,145 @@ if not modules then modules = { } end modules ['mlib-lmp'] = {
-- path relates stuff ... todo: use a stack (or numeric index to list)
-local type = type
+local type, tonumber, tostring = type, tonumber, tostring
+local find, match = string.find, string.match
+local insert, remove, sort = table.insert, table.remove, table.sort
local aux = mp.aux
local mpnumeric = aux.numeric
local mppair = aux.pair
+local registerdirect = metapost.registerdirect
local registerscript = metapost.registerscript
local scan = mp.scan
+local skip = mp.skip
local get = mp.get
+local inject = mp.inject
+
local scannumber = scan.number
local scanstring = scan.string
+local scaninteger = scan.integer
+local scannumeric = scan.numeric
+local scanwhatever = scan.whatever
local scanpath = scan.path
local scanproperty = scan.property
+
local gethashentry = get.hashentry
-local p = nil
-local n = 0
+local bpfactor = number.dimenfactors.bp
-registerscript("pathreset", function()
- p = nil
- n = 0
-end)
+local injectwhatever = inject.whatever
+local injectboolean = inject.boolean
+local injectnumeric = inject.numeric
+local injectstring = inject.string
+local injectpair = inject.pair
+local injectpath = inject.path
-registerscript("pathlengthof", function()
- p = scanpath()
- n = p and #p or 1
- mpnumeric(n)
-end)
+local injectwhd = inject.whd -- scaled
+local injectxy = inject.xy
+local injectpt = inject.pt
-registerscript("pathpointof", function()
- local i = scannumber()
- if i > 0 and i <= n then
- local pi = p[i]
- mppair(pi[1],pi[2])
- end
-end)
+local report = logs.reporter("metapost", "log")
+local report_message = logs.reporter("metapost")
-registerscript("pathleftof", function()
- local i = scannumber()
- if i > 0 and i <= n then
- local pi = p[i]
- mppair(pi[5],pi[6])
- end
-end)
+local codes = metapost.codes
+local types = metapost.types
+local procodes = mplib.propertycodes
-registerscript("pathrightof", function()
- local i = scannumber()
- if i > 0 and i <= n then
- local pn
- if i == 1 then
- pn = p[2] or p[1]
- else
- pn = p[i+1] or p[1]
+local implement = interfaces.implement
+
+do
+
+ local function s(a,b)
+ local aa = a[1]
+ local bb = b[1]
+ if aa == bb then
+ aa = a[2]
+ bb = b[2]
end
- mppair(pn[3],pn[4])
+ return aa < bb
end
-end)
-local report = logs.reporter("metapost", "log")
-local codes = metapost.codes
-local types = metapost.types
-local procodes = mplib.propertycodes
+ registerscript("sortedpath", function()
+ local p = scanpath()
+ for i=1,#p do
+ local pi = p[i]
+ p[i] = { pi[1], pi[2] }
+ end
+ sort(p,s)
+ injectpath(p)
+ end)
+
+ registerscript("uniquepath", function()
+ local p = scanpath()
+ local u = { }
+ local n = 0
+ local xx = nil
+ local yy = nil
+ sort(p,s)
+ for i=1,#p do
+ local pi = p[i]
+ local x = pi[1]
+ local y = pi[2]
+ if x ~= xx or y ~= yy then
+ n = n + 1
+ u[n] = { x, y }
+ xx = x
+ yy = y
+ end
+ end
+ injectpath(u)
+ end)
+
+end
+
+do
+
+ local p = nil
+ local n = 0
+
+ registerscript("pathreset", function()
+ p = nil
+ n = 0
+ end)
+
+ registerdirect("pathlengthof", function()
+ p = scanpath()
+ n = p and #p or 1
+ return n
+ end)
+
+ registerdirect("pathpointof", function()
+ local i = scaninteger()
+ if i > 0 and i <= n then
+ local pi = p[i]
+ injectpair(pi[1],pi[2])
+ end
+ end)
+
+ registerdirect("pathleftof", function()
+ local i = scaninteger()
+ if i > 0 and i <= n then
+ local pi = p[i]
+ injectpair(pi[5],pi[6])
+ end
+ end)
+
+ registerdirect("pathrightof", function()
+ local i = scaninteger()
+ if i > 0 and i <= n then
+ local pn
+ if i == 1 then
+ pn = p[2] or p[1]
+ else
+ pn = p[i+1] or p[1]
+ end
+ injectpair(pn[3],pn[4])
+ end
+ end)
+
+end
registerscript("showproperty", function()
local k, s, p, d = scanproperty()
@@ -89,16 +165,480 @@ registerscript("showhashentry", function()
end
end)
-local getmacro = tokens.getters.macro
-local mpgnamespace = getmacro("??graphicvariable")
+-- local getmacro = tokens.getters.macro
+-- local mpgnamespace = getmacro("??graphicvariable")
+
+-- registerscript("mpv_numeric", function() injectnumeric (getmacro(mpgnamespace .. getmacro("currentmpcategory") .. ":" .. scanmpstring())) end)
+-- registerscript("mpv_dimension", function() return getmacro(mpgnamespace .. getmacro("currentmpcategory") .. ":" .. scanmpstring()) end)
+-- registerscript("mpv_string", function() injectstring (getmacro(mpgnamespace .. getmacro("currentmpcategory") .. ":" .. scanmpstring())) end)
+
+-- registerscript("mpvar", function() return getmacro(mpgnamespace .. getmacro("currentmpcategory") .. ":" .. scanmpstring(), true) end) -- Isn't it already edef'd?
+-- registerscript("mpvar", function() return getmacro(metapost.namespace .. scanmpstring(), true) end) -- Isn't it already edef'd?
+
+do
+
+ local expandtex = mp.expandtex
+
+ local tokenvalues = tokens.values
+ local dimension_value = tokenvalues.dimension
+ local integer_value = tokenvalues.integer
+ local boolean_value = tokenvalues.boolean
+ local string_value = tokenvalues.string
+ local unknown_value = tokenvalues.none
+
+ registerdirect("mpvard", function()
+ if not expandtex(dimension_value,"mpcategoryparameter",true,scanstring()) then
+ injectnumeric(0)
+ end
+ end)
+
+ registerdirect("mpvarn", function()
+ if not expandtex(integer_value,"mpcategoryparameter",true,scanstring()) then
+ injectnumeric(0)
+ end
+ end)
+
+ registerdirect("mpvars", function()
+ if not expandtex(string_value,"mpcategoryparameter",true,scanstring()) then
+ injectstring("")
+ end
+ end)
+
+ registerdirect("mpvarb", function()
+ if not expandtex(boolean_value,"mpcategoryparameter",true,scanstring()) then
+ injectboolean(false)
+ end
+ end)
+
+ registerdirect("mpvar", function()
+ if not expandtex(unknown_value,"mpcategoryparameter",true,scanstring()) then
+ injectnumeric(0)
+ end
+ end)
+
+ -- older:
+
+ registerscript("texvar", function()
+ if not expandtex(unknown_value,"mpcategoryparameter",true,scanstring()) then
+ injectnumeric(0)
+ end
+ end)
+
+ registerscript("texstr", function()
+ if not expandtex(string_value,"mpcategoryparameter",true,scanstring()) then
+ injectstring("")
+ end
+ end)
+
+end
+
+do
+
+ registerscript("textextanchor", function()
+ local x, y = match(scanstring(),"tx_anchor=(%S+) (%S+)") -- todo: make an lpeg
+ if x and y then
+ x = tonumber(x)
+ y = tonumber(y)
+ end
+ injectpair(x or 0,y or 0)
+ end)
+
+end
+
+do
+
+ local mpnamedcolor = attributes.colors.mpnamedcolor
+ local mpprint = mp.aux.print
+
+ mp.mf_named_color = function(str)
+ mpprint(mpnamedcolor(str))
+ end
+
+ -- todo: we can inject but currently we always get a string back so then
+ -- we need to deal with it upstream in the color module ... not now
+
+ registerscript("namedcolor",function() mpprint(mpnamedcolor(scanstring())) end)
+
+end
+
+do
+
+ local hashes = table.setmetatableindex("table")
+
+ -- There is no need to 'new' a hash in which case one can use any reasonable
+ -- tag. The registry aproach is mkiv compatible.
+
+ local registery = { }
+
+ -- registerdirect("lmt_hash_new", function()
+ -- -- local name = scanstring()
+ -- local name = scanwhatever()
+ -- hashes[name] = { }
+ -- end)
+
+ registerdirect("lmt_hash_new", function()
+ for i=1,#registry + 1 do
+ if not registry[i] then
+ registry[i] = { }
+ injectwhatever(i)
+ end
+ end
+ end)
+
+ registerdirect("lmt_hash_dispose", function()
+ -- local name = scanstring()
+ local name = scanwhatever()
+ hashes[name] = nil
+ -- when new'd
+ if registry[name] then
+ registry[name] = false
+ end
+ end)
+
+ registerdirect("lmt_hash_in", function()
+ -- local name = scanstring()
+ local name = scanwhatever()
+ -- local key = scanstring()
+ local key = scanwhatever()
+ local hash = hashes[name]
+ injectwhatever(hash and hash[key] and true or false)
+ end)
+
+ registerdirect("lmt_hash_to", function()
+ -- local name = scanstring()
+ local name = scanwhatever()
+ -- local key = scanstring()
+ local key = scanwhatever()
+ local value = scanwhatever()
+ local hash = hashes[name]
+ if hash then
+ hash[key] = value
+ end
+ end)
+
+ registerdirect("lmt_hash_from", function()
+ -- local name = scanstring()
+ local name = scanwhatever()
+ -- local key = scanstring()
+ local key = scanwhatever()
+ local hash = hashes[name]
+ injectwhatever(hash and hash[key] or false)
+ end)
+
+ interfaces.implement {
+ name = "MPfromhash",
+ arguments = "2 strings",
+ actions = function(name,key)
+ local hash = hashes[name] or hashes[tonumber(name)] or hashes[tostring(name)]
+ if hash then
+ local v = hash[key]
+ if v then
+ context(v)
+ end
+ end
+ end
+ }
+
+end
+
+do
+
+ local bpfactor = number.dimenfactors.bp
+ local nbdimensions = nodes.boxes.dimensions
+
+ registerdirect("boxdimensions", function()
+ local category = scanstring()
+ local index = scanwhatever()
+ injectwhd(nbdimensions(category,index))
+ end)
+
+end
+
+do
+
+ local skiptoken = skip.token
+
+ local comma_code = codes.comma
+
+ local getmacro = tokens.getters.macro
+ local setmacro = tokens.setters.macro
+
+ local getdimen = tex.getdimen
+ local getcount = tex.getcount
+ local gettoks = tex.gettoks
+ local setdimen = tex.setdimen
+ local setcount = tex.setcount
+ local settoks = tex.settoks
+
+ -- more helpers
+
+ registerdirect("getmacro", function() return getmacro(scanstring()) end)
+ registerdirect("getcount", function() return getcount(scanwhatever()) end)
+ registerdirect("gettoks", function() return gettoks (scanwhatever()) end)
+ registerdirect("getdimen", function() return getdimen(scanwhatever()) * bpfactor end)
+
+ registerscript("setmacro", function() setmacro(scanstring(),scanstring()) end)
+ registerscript("setdimen", function() setdimen(scanwhatever(),scannumeric()/bpfactor) end)
+ registerscript("setcount", function() setcount(scanwhatever(),scannumeric()) end)
+ registerscript("settoks", function() settoks (scanwhatever(),scanstring()) end)
+
+ registerscript("setglobalmacro", function() setmacro(scanstring(),scanstring(),"global") end)
+ registerscript("setglobaldimen", function() setdimen("global",scanwhatever(),scannumeric()/bpfactor) end)
+ registerscript("setglobalcount", function() setcount("global",scanwhatever(),scaninteger()) end)
+ registerscript("setglobaltoks", function() settoks ("global",scanwhatever(),scanstring()) end)
+
+ local utfnum = utf.byte
+ local utflen = utf.len
+ local utfsub = utf.sub
+
+ registerdirect("utfnum", function() return utfnum(scanstring()) end)
+ registerdirect("utflen", function() return utflen(scanstring()) end)
+
+ registerdirect("utfsub", function() -- we have an optional third argument so we explicitly scan a text argument
+ return utfsub(scanstring(),skiptoken(comma_code) and scannumeric(),skiptoken(comma_code) and scannumeric())
+ end)
+
+ local setlogging = metapost.setlogging
+
+ registerscript("message", function()
+ setlogging(false)
+ local str = scanstring()
+ setlogging(true)
+ report_message("message : %s",str)
+ end)
+
+end
+
+-- position fun
+
+do
+
+ local getcount = tex.getcount
+
+ local mpprint = mp.print
+ local mpfprint = mp.fprint
+
+ local mpscaninteger = mp.scan.integer
+ local mpscannumber = mp.scan.number
+
+ local jobpositions = job.positions
+ local getwhd = jobpositions.whd
+ local getxy = jobpositions.xy
+ local getx = jobpositions.x
+ local gety = jobpositions.y
+ local getposition = jobpositions.position
+ local getpage = jobpositions.page
+ local getparagraph = jobpositions.paragraph
+ local getregion = jobpositions.region
+ local getcolumn = jobpositions.column
+ local getmacro = tokens.getters.macro
+
+ local columnofpos = jobpositions.columnofpos
+ local getcolumndata = jobpositions.getcolumndata
+ -- local overlapping = jobpositions.overlapping
+ -- local onsamepage = jobpositions.onsamepage
+ -- local columnofpos = jobpositions.columnofpos
+
+ -- why not inject path directly
+
+ registerscript("positionpath", function()
+ local w, h, d = getwhd(scanstring())
+ if w then
+ mpfprint("((%p,%p)--(%p,%p)--(%p,%p)--(%p,%p)--cycle)",0,-d,w,-d,w,h,0,h)
+ else
+ mpprint("(origin--cycle)")
+ end
+ end)
+
+ registerscript("positioncurve", function()
+ local w, h, d = getwhd(scanstring())
+ if w then
+ mpfprint("((%p,%p)..(%p,%p)..(%p,%p)..(%p,%p)..cycle)",0,-d,w,-d,w,h,0,h)
+ else
+ mpprint("(origin--cycle)")
+ end
+ end)
+
+ registerscript("positionbox", function()
+ local p, x, y, w, h, d = getposition(scanstring())
+ if p then
+ mpfprint("((%p,%p)--(%p,%p)--(%p,%p)--(%p,%p)--cycle)",x,y-d,x+w,y-d,x+w,y+h,x,y+h)
+ else
+ mpprint("(%p,%p)--cycle",x or 0,y or 0)
+ end
+ end)
+
+ registerscript("positioncolumnbox", function()
+ local column = mpscaninteger()
+ local data = getcolumndata(getcount("realpageno"),column)
+ if data then
+ local x, y, w, h, d = data.x, data.y, data.w, data.h, data.d
+ mpfprint("((%p,%p)--(%p,%p)--(%p,%p)--(%p,%p)--cycle)",x,y-d,x+w,y-d,x+w,y+h,x,y+h)
+ else
+ mpprint("(0,0)--cycle")
+ end
+ end)
+
+ registerscript("overlaycolumnbox", function()
+ local column = mpscaninteger()
+ local data = getcolumndata(getcount("realpageno"),column)
+ if data then
+ local w, hd = data.w, data.h + data.d
+ mpfprint("((0,0)--(%p,0)--(%p,%p)--(0,%p)--cycle)",w,w,hd,hd)
+ else
+ mpprint("(0,0)--cycle")
+ end
+ end)
+
+ registerdirect("positionpage", function() return getpage (scanstring()) or 0 end)
+ registerdirect("positioncolumn", function() return getcolumn (scanstring()) or 0 end)
+ registerdirect("positionparagraph", function() return getparagraph(scanstring()) or 0 end)
+ registerdirect("positionregion", function() return getregion (scanstring()) or "unknown" end)
+ registerdirect("positionanchor", function() return getmacro ("MPanchorid") end)
+ registerdirect("positionwhd", function() injectwhd(getwhd(scanstring())) end)
+ registerdirect("positionxy", function() injectxy (getxy (scanstring())) end)
+ registerdirect("positionx", function() injectpt (getx (scanstring())) end)
+ registerdirect("positiony", function() injectpt (gety (scanstring())) end)
+
+ registerdirect("positioncolumnatx", function()
+ local realpage = mpscaninteger()
+ local xposition = mpscannumber()
+ return columnofpos(realpage,xposition)
+ end)
+
+end
+
+do
+
+ local modes = tex.modes
+ local systemmodes = tex.systemmodes
+
+ registerdirect("mode", function() injectboolean(modes [scanstring()] and true or false) end)
+ registerdirect("systemmode", function() injectboolean(systemmodes[scanstring()] and true or false) end)
+
+ -- for compatibility reasons we keep this (metafun manual):
+
+ local modes = tex.modes
+ local systemmodes = tex.systemmodes
+
+ function mp.mode(s)
+ injectboolean(modes[s] and true or false)
+ end
+
+ function mp.systemmode(s)
+ injectboolean(systemmodes[s] and true or false)
+ end
+
+ mp.processingmode = mp.mode
+
+end
+
+-- for alan's nodes:
+
+do
+
+ local lpegmatch, lpegpatterns, P = lpeg.match, lpeg.patterns, lpeg.P
+
+ -- todo: scansuffix / why no return boolean (first one)
+
+ registerdirect("isarray", function()
+ injectboolean(find(scanstring(),"%d") and true or false)
+ end)
+
+ registerdirect("prefix", function()
+ local str = scanstring()
+ return match(str,"^(.-)[%d%[]") or str
+ end)
+
+ local dimension = lpeg.counter(P("[") * lpegpatterns.integer * P("]") + lpegpatterns.integer)
+
+ registerdirect("dimension", function() return dimension(scanstring()) end)
+
+ -- todo : share with mlib-pps.lua metapost,isobject
+
+ -- registerdirect("isobject", function()
+ -- injectboolean(find(scanstring(),"mf_object="))
+ -- end
+
+ local p1 = P("mf_object=")
+ local p2 = lpegpatterns.eol * p1
+ local pattern = (1-p2)^0 * p2 + p1
+
+ registerdirect("isobject", function()
+ local str = scanstring()
+ injectboolean(pattern and str ~= "" and lpegmatch(pattern,str))
+ end)
+
+end
+
+-- key/values (moved here, old mechanism)
+
+do
+
+ local stack, top = { }, nil
+
+ local function setvariable(k,v)
+ if top then
+ top[k] = v
+ else
+ metapost.variables[k] = v
+ end
+ end
+
+ local function pushvariable(k)
+ local t = { }
+ if top then
+ insert(stack,top)
+ top[k] = t
+ else
+ metapost.variables[k] = t
+ end
+ top = t
+ end
+
+ local function popvariable()
+ top = remove(stack)
+ end
+
+ registerscript("passvariable", function() setvariable (scanstring(), scanwhatever()) end)
+ registerscript("pushvariable", function() pushvariable(scanstring()) end)
+ registerscript("popvariable", function() popvariable () end)
+
+ local stack = { }
+
+ local function pushvariables()
+ insert(stack,metapost.variables)
+ metapost.variables = { }
+ end
+
+ local function popvariables()
+ metapost.variables = remove(stack) or metapost.variables
+ end
+
+ metapost.setvariable = setvariable
+ metapost.pushvariable = pushvariable
+ metapost.popvariable = popvariable
+ metapost.pushvariables = pushvariables
+ metapost.popvariables = popvariables
+
+ implement {
+ name = "mppushvariables",
+ actions = pushvariables,
+ }
+
+ implement {
+ name = "mppopvariables",
+ actions = popvariables,
+ }
+
+end
-local scanmpstring = mp.scan.string
+do
-local injectnumeric = mp.inject.numeric
-local injectstring = mp.inject.string
+ local repeatable = utilities.randomizer.repeatable
--- registerscript("mpv_numeric", function() injectnumeric (getmacro(mpgnamespace .. getmacro("currentmpvariableclass") .. ":" .. scanmpstring())) end)
--- registerscript("mpv_dimension", function() return getmacro(mpgnamespace .. getmacro("currentmpvariableclass") .. ":" .. scanmpstring()) end)
--- registerscript("mpv_string", function() injectstring (getmacro(mpgnamespace .. getmacro("currentmpvariableclass") .. ":" .. scanmpstring())) end)
+ registerdirect("repeatablerandom", function()
+ return repeatable(scanstring())
+ end)
-registerscript("mpvar", function() return getmacro(mpgnamespace .. getmacro("currentmpvariableclass") .. ":" .. scanmpstring(), true) end) -- Isn't it already edef'd?
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-lmt.lmt b/Master/texmf-dist/tex/context/base/mkxl/mlib-lmt.lmt
index b7c869c3bac..ba86f075895 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/mlib-lmt.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-lmt.lmt
@@ -9,7 +9,7 @@ if not modules then modules = { } end modules ['mlib-lmt'] = {
-- todo: check for possible inject usage
local type = type
-local round = math.round
+local round, abs = math.round, math.abs
local aux = mp.aux
local mpdirect = aux.direct
@@ -79,6 +79,9 @@ end
function mp.lmt_svg_include()
local labelfile = metapost.getparameter { "labelfile" }
if labelfile and labelfile ~= "" then
+ labelfile = resolvers.findbinfile(labelfile)
+ end
+ if labelfile and labelfile ~= "" then
local labels = table.load(labelfile) -- todo: same path as svg file
if type(labels) == "table" then
for i=1,#labels do
@@ -103,8 +106,9 @@ function mp.lmt_svg_include()
end
local filename = metapost.getparameter { "filename" }
if filename and filename ~= "" then
+ local ok, data = resolvers.loadbinfile(filename)
mpdirect ( metapost.svgtomp {
- data = io.loaddata(filename),
+ data = data,
remap = true,
colormap = colormap,
id = filename,
@@ -132,7 +136,7 @@ function mp.lmt_svg_include()
end
registerscript("remaptext", function()
- local parameters = metapost.scanparameters()
+ local parameters = metapost.scanparameters(true) -- gobble the semi colon (avoid lookahead)
if parameters and parameters.label then
metapost.remaptext(parameters)
end
@@ -153,45 +157,40 @@ todecimal = xdecimal and xdecimal.new or tonumber -- bonus
-- mail on list by Mikael Sundqvist and Taco's analysis of near duplicate points (2021/02/11+)
-registerscript("scrutenized", function()
- local p = scanpath()
- local d = 10^scannumeric()
- for i=1,#p do
- local pi = p[i]
- pi[1] = round(pi[1] * d) / d
- pi[2] = round(pi[2] * d) / d
- end
- local x1 = round(p[1][1])
- local y1 = round(p[1][2])
- local n = 1
- local m = #p
- local t = { p[1], cycle = p.cycle }
- for i=2,m-1 do
- local pi = p[i]
- local x2 = r(pi[1])
- local y2 = r(pi[2])
- if x1 ~= x2 or y1 ~= y2 then
- n = n + 1
- t[n] = p[i]
+registerscript("scrutinized", function()
+ local pth = scanpath()
+ local d = 1/10^scannumeric() -- decimals
+ local p1 = pth[1]
+ local x1 = p1[1]
+ local y1 = p1[2]
+ local res = { pth[1] }
+ local r = 1
+ for i=2,#pth do
+ local pi = pth[i]
+ x2 = pi[1]
+ y2 = pi[2]
+ if abs(x1-x2) > d or abs(y1-y2) > d then
+ r = r + 1 res[r] = pi
x1 = x2
y1 = y2
+ else
+ res[r][5] = pi[5]
+ res[r][6] = pi[6]
end
end
- local x1 = r(p[1][1])
- local y1 = r(p[1][2])
- local x2 = r(p[m][1])
- local y2 = r(p[m][2])
- if x1 ~= x2 or y1 ~= y2 then
- n = n + 1
- t[n] = p[m]
+ if pth.cycle then
+ res.cycle = true
+ if abs(x1-p1[1]) > d or abs(y1-p1[2]) > d then
+ -- keep
+ else
+ res[r] = nil
+ end
end
- mp.path(t)
- -- injectpath(t)
+ injectpath(res)
end)
-- A goodie, mostly a side effect of updating the metafun manual.
-
local labtorgb = attributes.colors.labtorgb
registerscript("labtorgb", function()
diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-lua.lmt b/Master/texmf-dist/tex/context/base/mkxl/mlib-lua.lmt
index 068d17f32f9..19423e7b1d6 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/mlib-lua.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-lua.lmt
@@ -16,8 +16,6 @@ local report = logs.reporter("metapost","instance")
local codes = mplib.getcodes()
local types = mplib.gettypes()
--- for k,v in next, mplib do if type(v) == "function" then local f = v mplib[k] = function(...) print(k) return v(...) end end end
-
table.hashed(codes)
table.hashed(types)
@@ -29,85 +27,90 @@ local skip = mp.skip
local get = mp.get
local inject = mp.inject
+local bpfactor = number.dimenfactors.bp
local currentmpx = nil
local stack = { }
local function reports(s) report("%a scan %s", tostring(currentmpx),s) end -- temporary, till we're okay
local function reporti(s) report("%a inject %s",tostring(currentmpx),s) end -- temporary, till we're okay
-local scan_next = mplib.scan_next
-local scan_expression = mplib.scan_expression
-local scan_token = mplib.scan_token
-local scan_symbol = mplib.scan_symbol
-local scan_property = mplib.scan_property
-local scan_numeric = mplib.scan_numeric
-local scan_integer = mplib.scan_integer
-local scan_boolean = mplib.scan_boolean
-local scan_string = mplib.scan_string
-local scan_pair = mplib.scan_pair
-local scan_color = mplib.scan_color
-local scan_cmykcolor = mplib.scan_cmykcolor
-local scan_transform = mplib.scan_transform
-local scan_path = mplib.scan_path
-local scan_pen = mplib.scan_pen
-
-local skip_token = mplib.skip_token
-
-local get_hashentry = mplib.gethashentry
-
-scan.next = function(k) if trace then reporti("next") end return scan_next (currentmpx,k) end
-scan.expression = function(k) if trace then reporti("expression") end return scan_expression(currentmpx,k) end
-scan.token = function(k) if trace then reporti("token") end return scan_token (currentmpx,k) end
-scan.symbol = function(k,e) if trace then reporti("symbol") end return scan_symbol (currentmpx,k,e) end
-scan.property = function(k) if trace then reporti("property") end return scan_property (currentmpx,k) end
-scan.numeric = function() if trace then reporti("numeric") end return scan_numeric (currentmpx) end
-scan.integer = function() if trace then reporti("integer") end return scan_integer (currentmpx) end
-scan.boolean = function() if trace then reporti("boolean") end return scan_boolean (currentmpx) end
-scan.string = function() if trace then reporti("string") end return scan_string (currentmpx) end
-scan.pair = function(t) if trace then reporti("pair") end return scan_pair (currentmpx,t) end
-scan.color = function(t) if trace then reporti("color") end return scan_color (currentmpx,t) end
-scan.cmykcolor = function(t) if trace then reporti("cmykcolor") end return scan_cmykcolor (currentmpx,t) end
-scan.transform = function(t) if trace then reporti("transform") end return scan_transform (currentmpx,t) end
-scan.path = function(t) if trace then reporti("path") end return scan_path (currentmpx,t) end
-scan.pen = function(t) if trace then reporti("pen") end return scan_pen (currentmpx,t) end
-
-skip.token = function(t) return skip_token (currentmpx,t) end
-
-get.hashentry = function(n) return get_hashentry (currentmpx,n) end
+local scannext = mplib.scannext
+local scanexpression = mplib.scanexpression
+local scantoken = mplib.scantoken
+local scansymbol = mplib.scansymbol
+local scanproperty = mplib.scanproperty
+local scannumeric = mplib.scannumeric
+local scaninteger = mplib.scaninteger
+local scanboolean = mplib.scanboolean
+local scanstring = mplib.scanstring
+local scanpair = mplib.scanpair
+local scancolor = mplib.scancolor
+local scancmykcolor = mplib.scancmykcolor
+local scantransform = mplib.scantransform
+local scanpath = mplib.scanpath
+local scanpen = mplib.scanpen
+
+local skiptoken = mplib.skiptoken
+
+local gethashentry = mplib.gethashentry
+
+scan.next = function(k) if trace then reporti("next") end return scannext (currentmpx,k) end
+scan.expression = function(k) if trace then reporti("expression") end return scanexpression(currentmpx,k) end
+scan.token = function(k) if trace then reporti("token") end return scantoken (currentmpx,k) end
+scan.symbol = function(k,e) if trace then reporti("symbol") end return scansymbol (currentmpx,k,e) end
+scan.property = function(k) if trace then reporti("property") end return scanproperty (currentmpx,k) end
+scan.numeric = function() if trace then reporti("numeric") end return scannumeric (currentmpx) end
+scan.integer = function() if trace then reporti("integer") end return scaninteger (currentmpx) end
+scan.boolean = function() if trace then reporti("boolean") end return scanboolean (currentmpx) end
+scan.string = function() if trace then reporti("string") end return scanstring (currentmpx) end
+scan.pair = function(t) if trace then reporti("pair") end return scanpair (currentmpx,t) end
+scan.color = function(t) if trace then reporti("color") end return scancolor (currentmpx,t) end
+scan.cmykcolor = function(t) if trace then reporti("cmykcolor") end return scancmykcolor (currentmpx,t) end
+scan.transform = function(t) if trace then reporti("transform") end return scantransform (currentmpx,t) end
+scan.path = function(t,k,c) if trace then reporti("path") end return scanpath (currentmpx,t,k,c) end -- compact kind (prim) check
+scan.pen = function(t) if trace then reporti("pen") end return scanpen (currentmpx,t) end
+
+skip.token = function(t) return skiptoken (currentmpx,t) end
+get.hashentry = function(n) return gethashentry(currentmpx,n) end
local solvepath = mplib.solvepath
local getstatus = mplib.getstatus
-
-mp.solve = function(...)
- return solvepath(currentmpx,...)
-end
-
-local inject_path = mplib.inject_path
-local inject_numeric = mplib.inject_numeric
-local inject_pair = mplib.inject_pair
-local inject_boolean = mplib.inject_boolean
-local inject_integer = mplib.inject_integer
-local inject_string = mplib.inject_string
-local inject_color = mplib.inject_color
-local inject_cmykcolor = mplib.inject_cmykcolor
-local inject_transform = mplib.inject_transform
-local inject_whatever = mplib.inject_whatever
-
-
-------.path = function(t,cycle,curled) if trace then reporti("path") end return inject_path (currentmpx,t,cycle,curled) end
-inject.numeric = function(n) if trace then reporti("numeric") end return inject_numeric (currentmpx,n) end
-inject.pair = function(x,y) if trace then reporti("pair") end return inject_pair (currentmpx,x,y) end
-inject.boolean = function(b) if trace then reporti("boolean") end return inject_boolean (currentmpx,b) end
-inject.integer = function(i) if trace then reporti("integer") end return inject_integer (currentmpx,i) end
-inject.string = function(s) if trace then reporti("string") end return inject_string (currentmpx,s) end
-inject.color = function(r,g,b) if trace then reporti("color") end return inject_color (currentmpx,r,g,b) end
-inject.cmykcolor = function(c,m,y,k) if trace then reporti("cmykcolor") end return inject_cmykcolor(currentmpx,c,m,y,k) end
-inject.transform = function(x,y,xx,xy,yx,yy) if trace then reporti("transform") end return inject_transform(currentmpx,x,y,xx,xy,yx,yy) end
-inject.whatever = function(...) if trace then reporti("whatever") end return inject_whatever (currentmpx,...) end
+local expandtex = mplib.expandtex
+
+mp.solve = function(...) return solvepath(currentmpx,...) end
+mp.expandtex = function(...) return expandtex(currentmpx,...) end
+
+local injectpath = mplib.injectpath
+local injectnumeric = mplib.injectnumeric
+local injectpair = mplib.injectpair
+local injectboolean = mplib.injectboolean
+local injectinteger = mplib.injectinteger
+local injectstring = mplib.injectstring
+local injectcolor = mplib.injectcolor
+local injectcmykcolor = mplib.injectcmykcolor
+local injecttransform = mplib.injecttransform
+local injectwhatever = mplib.injectwhatever
+
+------.path = function(t,cycle,curled) if trace then reporti("path") end return injectpath (currentmpx,t,cycle,curled) end
+inject.numeric = function(n) if trace then reporti("numeric") end return injectnumeric (currentmpx,n) end
+inject.pair = function(x,y) if trace then reporti("pair") end return injectpair (currentmpx,x,y) end
+inject.boolean = function(b) if trace then reporti("boolean") end return injectboolean (currentmpx,b) end
+inject.integer = function(i) if trace then reporti("integer") end return injectinteger (currentmpx,i) end
+inject.string = function(s) if trace then reporti("string") end return injectstring (currentmpx,s) end
+inject.color = function(r,g,b) if trace then reporti("color") end return injectcolor (currentmpx,r,g,b) end
+inject.cmykcolor = function(c,m,y,k) if trace then reporti("cmykcolor") end return injectcmykcolor(currentmpx,c,m,y,k) end
+inject.transform = function(x,y,xx,xy,yx,yy) if trace then reporti("transform") end return injecttransform(currentmpx,x,y,xx,xy,yx,yy) end
+inject.whatever = function(...) if trace then reporti("whatever") end return injectwhatever (currentmpx,...) end
inject.triplet = inject.color
inject.quadruplet = inject.cmykcolor
+-- these can be optimized for zero:
+
+inject.whd = function(w,h,d) injectcolor (currentmpx,(w or 0)*bpfactor,(h or 0)*bpfactor,(d or 0)*bpfactor) end
+inject.xy = function(x,y) injectpair (currentmpx,(x or 0)*bpfactor,(y or 0)*bpfactor) end
+inject.pt = function(n) injectnumeric(currentmpx,(n or 0)*bpfactor) end
+
local function same(p,n)
local f = p[1]
local l = p[n]
@@ -124,30 +127,57 @@ local function same(p,n)
return false
end
--- local p = mp.scan.path()
--- mp.inject.path(p,true,true)
-
-function inject.path(p,close,connector)
+-- function inject.path(p,close,connector)
+-- local closed = false
+-- local curled = false
+-- local n = #p
+-- print("spec",p,close,connector)
+-- if close == nil then
+-- closed = (p.close or p.cycle or p.closed) and true or false
+-- else
+-- closed = close
+-- end
+-- if connector then
+-- if connector == "auto" then
+-- connector = #p[1] > 2
+-- end
+-- if connector == false or connector == "--" then
+-- curled = true
+-- -- elseif connector == true or connector == ".." then
+-- -- if close and not same(p,n) then
+-- -- p[n+1] = p[1]
+-- -- end
+-- end
+-- elseif p.curled then
+-- curled = true
+-- end
+-- if trace then reporti("path") end
+-- inspect(p)
+-- print(p,closed,curled)
+-- return injectpath(currentmpx,p,closed,curled)
+-- end
+
+function inject.path(p,connector,close)
+ local closed = false
local curled = false
local n = #p
- if p.close or p.cycle then
- close = true
+ if close == nil then
+ closed = (p.close or p.cycle or p.closed) and true or false
+ else
+ closed = close
end
- if n > 1 then
- -- [ ../true | --/false | nil/auto ]
- if connector == nil or connector == "auto" then
+ if connector then
+ if connector == "auto" then
connector = #p[1] > 2
end
if connector == false or connector == "--" then
curled = true
- elseif connector == true or connector == ".." then
- if close and not same(p,n) then
- p[n+1] = p[1]
- end
end
+ elseif p.curled then
+ curled = true
end
if trace then reporti("path") end
- return inject_path(currentmpx,p,close,curled)
+ return injectpath(currentmpx,p,closed,curled)
end
-- bonus:
@@ -156,7 +186,7 @@ scan .number = scan .numeric
inject.number = inject.numeric
table.setmetatablecall(inject,function(t,...)
- inject_whatever(currentmpx,...)
+ injectwhatever(currentmpx,...)
end)
-- experiment
@@ -166,20 +196,20 @@ function mp.autoinject(m)
if t == "table" then
local n = #t
if n == 2 then
- inject_pair(currentmpx,m)
+ injectpair(currentmpx,m)
elseif n == 3 then
- inject_color(currentmpx,m)
+ injectcolor(currentmpx,m)
elseif n == 4 then
- inject_cmykcolor(currentmpx,m)
+ injectcmykcolor(currentmpx,m)
elseif n == 6 then
- inject_transform(currentmpx,m)
+ injecttransform(currentmpx,m)
end
elseif t == "number" then
- inject_numeric(currentmpx,m)
+ injectnumeric(currentmpx,m)
elseif t == "string" then
- inject_string(currentmpx,m)
+ injectstring(currentmpx,m)
elseif t == "boolean" then
- inject_boolean(currentmpx,m)
+ injectboolean(currentmpx,m)
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-mat.lmt b/Master/texmf-dist/tex/context/base/mkxl/mlib-mat.lmt
index 3a63b32c784..68e3c98d1d6 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/mlib-mat.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-mat.lmt
@@ -16,78 +16,82 @@ local scancolor = scanners.color
local mppair = injectors.pair or mp.pair
local registerscript = metapost.registerscript
+local registerdirect = metapost.registerdirect
local m = xmath
local c = xcomplex
-local m_acos = m.acos registerscript("m_acos", function() return m_acos (scannumeric()) end)
-local m_acosh = m.acosh registerscript("m_acosh", function() return m_acosh (scannumeric()) end)
-local m_asin = m.asin registerscript("m_asin", function() return m_asin (scannumeric()) end)
-local m_asinh = m.asinh registerscript("m_asinh", function() return m_asinh (scannumeric()) end)
-local m_atan = m.atan registerscript("m_atan", function() return m_atan (scannumeric()) end)
-local m_atan2 = m.atan2 registerscript("m_atan2", function() return m_atan2 (scanpair ()) end)
-local m_atanh = m.atanh registerscript("m_atanh", function() return m_atanh (scannumeric()) end)
-local m_cbrt = m.cbrt registerscript("m_cbrt", function() return m_cbrt (scannumeric()) end)
-local m_ceil = m.ceil registerscript("m_ceil", function() return m_ceil (scannumeric()) end)
-local m_copysign = m.copysign registerscript("m_copysign", function() return m_copysign (scanpair ()) end)
-local m_cos = m.cos registerscript("m_cos", function() return m_cos (scannumeric()) end)
-local m_cosh = m.cosh registerscript("m_cosh", function() return m_cosh (scannumeric()) end)
-local m_deg = m.deg registerscript("m_deg", function() return m_deg (scannumeric()) end)
-local m_erf = m.erf registerscript("m_erf", function() return m_erf (scannumeric()) end)
-local m_erfc = m.erfc registerscript("m_erfc", function() return m_erfc (scannumeric()) end)
-local m_exp = m.exp registerscript("m_exp", function() return m_exp (scannumeric()) end)
-local m_exp2 = m.exp2 registerscript("m_exp2", function() return m_exp2 (scannumeric()) end)
-local m_expm1 = m.expm1 registerscript("m_expm1", function() return m_expm1 (scannumeric()) end)
-local m_fabs = m.fabs registerscript("m_fabs", function() return m_fabs (scannumeric()) end)
-local m_fdim = m.fdim registerscript("m_fdim", function() return m_fdim (scanpair ()) end)
-local m_floor = m.floor registerscript("m_floor", function() return m_floor (scannumeric()) end)
-local m_fma = m.fma registerscript("m_fma", function() return m_fma (scancolor ()) end)
-local m_fmax = m.fmax registerscript("m_fmax", function() return m_fmax (scannumeric()) end)
-local m_fmin = m.fmin registerscript("m_fmin", function() return m_fmin (scannumeric()) end)
-local m_fmod = m.fmod registerscript("m_fmod", function() return m_fmod (scanpair ()) end)
-local m_frexp = m.frexp registerscript("m_frexp", function() return m_frexp (scannumeric()) end)
-local m_gamma = m.gamma registerscript("m_gamma", function() return m_gamma (scannumeric()) end)
-local m_hypot = m.hypot registerscript("m_hypot", function() return m_hypot (scanpair ()) end)
-local m_isfinite = m.isfinite registerscript("m_isfinite", function() return m_isfinite (scannumeric()) end)
-local m_isinf = m.isinf registerscript("m_isinf", function() return m_isinf (scannumeric()) end)
-local m_isnan = m.isnan registerscript("m_isnan", function() return m_isnan (scannumeric()) end)
-local m_isnormal = m.isnormal registerscript("m_isnormal", function() return m_isnormal (scannumeric()) end)
-local m_j0 = m.j0 registerscript("m_j0", function() return m_j0 (scannumeric()) end)
-local m_j1 = m.j1 registerscript("m_j1", function() return m_j1 (scannumeric()) end)
-local m_jn = m.jn registerscript("m_jn", function() return m_jn (scanpair ()) end)
-local m_ldexp = m.ldexp registerscript("m_ldexp", function() return m_ldexp (scanpair ()) end)
-local m_lgamma = m.lgamma registerscript("m_lgamma", function() return m_lgamma (scannumeric()) end)
-local m_log = m.log registerscript("m_log", function() return m_log (scannumeric()) end)
-local m_log10 = m.log10 registerscript("m_log10", function() return m_log10 (scannumeric()) end)
-local m_log1p = m.log1p registerscript("m_log1p", function() return m_log1p (scannumeric()) end)
-local m_log2 = m.log2 registerscript("m_log2", function() return m_log2 (scannumeric()) end)
-local m_logb = m.logb registerscript("m_logb", function() return m_logb (scannumeric()) end)
-local m_modf = m.modf registerscript("m_modf", function() return m_modf (scannumeric()) end)
-local m_nearbyint = m.nearbyint registerscript("m_nearbyint", function() return m_nearbyint(scannumeric()) end)
-local m_nextafter = m.nextafter registerscript("m_nextafter", function() return m_nextafter(scanpair ()) end)
-local m_pow = m.pow registerscript("m_pow", function() return m_pow (scanpair ()) end)
-local m_rad = m.rad registerscript("m_rad", function() return m_rad (scannumeric()) end)
-local m_remainder = m.remainder registerscript("m_remainder", function() return m_remainder(scanpair ()) end)
-local m_remquo = m.remquo registerscript("m_remquo", function() return m_remquo (scannumeric()) end)
-local m_round = m.round registerscript("m_round", function() return m_round (scannumeric()) end)
-local m_scalbn = m.scalbn registerscript("m_scalbn", function() return m_scalbn (scanpair ()) end)
-local m_sin = m.sin registerscript("m_sin", function() return m_sin (scannumeric()) end)
-local m_sinh = m.sinh registerscript("m_sinh", function() return m_sinh (scannumeric()) end)
-local m_sqrt = m.sqrt registerscript("m_sqrt", function() return m_sqrt (scannumeric()) end)
-local m_tan = m.tan registerscript("m_tan", function() return m_tan (scannumeric()) end)
-local m_tanh = m.tanh registerscript("m_tanh", function() return m_tanh (scannumeric()) end)
-local m_tgamma = m.tgamma registerscript("m_tgamma", function() return m_tgamma (scannumeric()) end)
-local m_trunc = m.trunc registerscript("m_trunc", function() return m_trunc (scannumeric()) end)
-local m_y0 = m.y0 registerscript("m_y0", function() return m_y0 (scannumeric()) end)
-local m_y1 = m.y1 registerscript("m_y1", function() return m_y1 (scannumeric()) end)
-local m_yn = m.yn registerscript("m_yn", function() return m_yn (scanpair ()) end)
+local m_acos = m.acos registerdirect("m_acos", function() return m_acos (scannumeric()) end)
+local m_acosh = m.acosh registerdirect("m_acosh", function() return m_acosh (scannumeric()) end)
+local m_asin = m.asin registerdirect("m_asin", function() return m_asin (scannumeric()) end)
+local m_asinh = m.asinh registerdirect("m_asinh", function() return m_asinh (scannumeric()) end)
+local m_atan = m.atan registerdirect("m_atan", function() return m_atan (scannumeric()) end)
+local m_atan2 = m.atan2 registerdirect("m_atan2", function() return m_atan2 (scanpair ()) end)
+local m_atanh = m.atanh registerdirect("m_atanh", function() return m_atanh (scannumeric()) end)
+local m_cbrt = m.cbrt registerdirect("m_cbrt", function() return m_cbrt (scannumeric()) end)
+local m_ceil = m.ceil registerdirect("m_ceil", function() return m_ceil (scannumeric()) end)
+local m_copysign = m.copysign registerdirect("m_copysign", function() return m_copysign (scanpair ()) end)
+local m_cos = m.cos registerdirect("m_cos", function() return m_cos (scannumeric()) end)
+local m_cosh = m.cosh registerdirect("m_cosh", function() return m_cosh (scannumeric()) end)
+local m_deg = m.deg registerdirect("m_deg", function() return m_deg (scannumeric()) end)
+local m_erf = m.erf registerdirect("m_erf", function() return m_erf (scannumeric()) end)
+local m_erfc = m.erfc registerdirect("m_erfc", function() return m_erfc (scannumeric()) end)
+local m_exp = m.exp registerdirect("m_exp", function() return m_exp (scannumeric()) end)
+local m_exp2 = m.exp2 registerdirect("m_exp2", function() return m_exp2 (scannumeric()) end)
+local m_expm1 = m.expm1 registerdirect("m_expm1", function() return m_expm1 (scannumeric()) end)
+local m_fabs = m.fabs registerdirect("m_fabs", function() return m_fabs (scannumeric()) end)
+local m_fdim = m.fdim registerdirect("m_fdim", function() return m_fdim (scanpair ()) end)
+local m_floor = m.floor registerdirect("m_floor", function() return m_floor (scannumeric()) end)
+local m_fma = m.fma registerdirect("m_fma", function() return m_fma (scancolor ()) end)
+local m_fmax = m.fmax registerdirect("m_fmax", function() return m_fmax (scannumeric()) end)
+local m_fmin = m.fmin registerdirect("m_fmin", function() return m_fmin (scannumeric()) end)
+local m_fmod = m.fmod registerdirect("m_fmod", function() return m_fmod (scanpair ()) end)
+local m_frexp = m.frexp registerdirect("m_frexp", function() return m_frexp (scannumeric()) end)
+local m_gamma = m.gamma registerdirect("m_gamma", function() return m_gamma (scannumeric()) end)
+local m_hypot = m.hypot registerdirect("m_hypot", function() return m_hypot (scanpair ()) end)
+local m_isfinite = m.isfinite registerdirect("m_isfinite", function() return m_isfinite (scannumeric()) end)
+local m_isinf = m.isinf registerdirect("m_isinf", function() return m_isinf (scannumeric()) end)
+local m_isnan = m.isnan registerdirect("m_isnan", function() return m_isnan (scannumeric()) end)
+local m_isnormal = m.isnormal registerdirect("m_isnormal", function() return m_isnormal (scannumeric()) end)
+local m_j0 = m.j0 registerdirect("m_j0", function() return m_j0 (scannumeric()) end)
+local m_j1 = m.j1 registerdirect("m_j1", function() return m_j1 (scannumeric()) end)
+local m_jn = m.jn registerdirect("m_jn", function() return m_jn (scanpair ()) end)
+local m_ldexp = m.ldexp registerdirect("m_ldexp", function() return m_ldexp (scanpair ()) end)
+local m_lgamma = m.lgamma registerdirect("m_lgamma", function() return m_lgamma (scannumeric()) end)
+local m_log = m.log registerdirect("m_log", function() return m_log (scannumeric()) end)
+local m_log10 = m.log10 registerdirect("m_log10", function() return m_log10 (scannumeric()) end)
+local m_log1p = m.log1p registerdirect("m_log1p", function() return m_log1p (scannumeric()) end)
+local m_log2 = m.log2 registerdirect("m_log2", function() return m_log2 (scannumeric()) end)
+local m_logb = m.logb registerdirect("m_logb", function() return m_logb (scannumeric()) end)
+local m_modf = m.modf registerdirect("m_modf", function() return m_modf (scannumeric()) end)
+local m_nearbyint = m.nearbyint registerdirect("m_nearbyint", function() return m_nearbyint(scannumeric()) end)
+local m_nextafter = m.nextafter registerdirect("m_nextafter", function() return m_nextafter(scanpair ()) end)
+local m_pow = m.pow registerdirect("m_pow", function() return m_pow (scanpair ()) end)
+local m_rad = m.rad registerdirect("m_rad", function() return m_rad (scannumeric()) end)
+local m_remainder = m.remainder registerdirect("m_remainder", function() return m_remainder(scanpair ()) end)
+local m_remquo = m.remquo registerdirect("m_remquo", function() return m_remquo (scannumeric()) end)
+local m_round = m.round registerdirect("m_round", function() return m_round (scannumeric()) end)
+local m_scalbn = m.scalbn registerdirect("m_scalbn", function() return m_scalbn (scanpair ()) end)
+local m_sin = m.sin registerdirect("m_sin", function() return m_sin (scannumeric()) end)
+local m_sinh = m.sinh registerdirect("m_sinh", function() return m_sinh (scannumeric()) end)
+local m_sqrt = m.sqrt registerdirect("m_sqrt", function() return m_sqrt (scannumeric()) end)
+local m_tan = m.tan registerdirect("m_tan", function() return m_tan (scannumeric()) end)
+local m_tanh = m.tanh registerdirect("m_tanh", function() return m_tanh (scannumeric()) end)
+local m_tgamma = m.tgamma registerdirect("m_tgamma", function() return m_tgamma (scannumeric()) end)
+local m_trunc = m.trunc registerdirect("m_trunc", function() return m_trunc (scannumeric()) end)
+local m_y0 = m.y0 registerdirect("m_y0", function() return m_y0 (scannumeric()) end)
+local m_y1 = m.y1 registerdirect("m_y1", function() return m_y1 (scannumeric()) end)
+local m_yn = m.yn registerdirect("m_yn", function() return m_yn (scanpair ()) end)
if not (c and c.sin) then
return
end
-local c_topair = c.topair
-local c_new = c.new
+local c_topair = c.topair
+local c_totable = c.totable
+local c_new = c.new
+
+----- c_sin = c.sin registerdirect("c_sin", function() return c_totable(c_sin (c_new(scanpair()))) end)
local c_sin = c.sin registerscript("c_sin", function() return mppair(c_topair(c_sin (c_new(scanpair())))) end)
local c_cos = c.cos registerscript("c_cos", function() return mppair(c_topair(c_cos (c_new(scanpair())))) end)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-mpf.lmt b/Master/texmf-dist/tex/context/base/mkxl/mlib-mpf.lmt
index f24d7fde09c..34b2d079536 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/mlib-mpf.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-mpf.lmt
@@ -9,7 +9,7 @@ if not modules then modules = { } end modules ['mlib-mpf'] = {
-- moved from mlib-lua:
local type, tostring, tonumber, select, loadstring = type, tostring, tonumber, select, loadstring
-local find, match, gsub, gmatch = string.find, string.match, string.gsub, string.gmatch
+local find, gsub = string.find, string.gsub
local concat = table.concat
local formatters = string.formatters
@@ -31,8 +31,6 @@ local set = mp.set
local get = mp.get
local aux = mp.aux
local scan = mp.scan
-local skip = mp.skip
-local inject = mp.inject
do
@@ -41,7 +39,7 @@ do
local f_integer = formatters["%i"]
local f_numeric = formatters["%F"]
- -- no %n as that can produce -e notation and that is not so nice for scaled butmaybe we
+ -- no %n as that can produce -e notation and that is not so nice for scaled but maybe we
-- should then switch between ... i.e. make a push/pop for the formatters here ... not now.
local f_integer = formatters["%i"]
@@ -77,22 +75,38 @@ do
local runscripts = { }
local runnames = { }
+ local runmodes = { }
local nofscripts = 0
- function metapost.registerscript(name,f)
+ local function registerscript(name,mode,f)
nofscripts = nofscripts + 1
+ if not f then
+ f = mode
+ mode = "buffered"
+ end
if f then
runscripts[nofscripts] = f
runnames[name] = nofscripts
else
runscripts[nofscripts] = name
end
+ runmodes[nofscripts] = mode
if trace_script then
- report_script("registering script %a as %i",name,nofscripts)
+ report_script("registering %s script %a as %i",mode,name,nofscripts)
end
return nofscripts
end
+ metapost.registerscript = registerscript
+
+ function metapost.registerdirect(name,f)
+ registerscript(name,"direct",f)
+ end
+
+ function metapost.registertokens(name,f)
+ registerscript(name,"tokens",f)
+ end
+
function metapost.scriptindex(name)
local index = runnames[name] or 0
if trace_script then
@@ -111,30 +125,8 @@ do
local buffer = gbuffer
local n = 0
- local function mpdirect1(a)
- n = n + 1 buffer[n] = a
- end
- local function mpdirect2(a,b)
- n = n + 1 buffer[n] = a
- n = n + 1 buffer[n] = b
- end
- local function mpdirect3(a,b,c)
- n = n + 1 buffer[n] = a
- n = n + 1 buffer[n] = b
- n = n + 1 buffer[n] = c
- end
- local function mpdirect4(a,b,c,d)
- n = n + 1 buffer[n] = a
- n = n + 1 buffer[n] = b
- n = n + 1 buffer[n] = c
- n = n + 1 buffer[n] = d
- end
- local function mpdirect5(a,b,c,d,e)
+ local function mpdirect(a)
n = n + 1 buffer[n] = a
- n = n + 1 buffer[n] = b
- n = n + 1 buffer[n] = c
- n = n + 1 buffer[n] = d
- n = n + 1 buffer[n] = e
end
local function mpflush(separator)
@@ -142,6 +134,25 @@ do
n = 1
end
+ function metapost.getbuffer()
+ local b = { }
+ for i=1,n do
+ b[i] = buffer
+ end
+ return b, n
+ end
+
+ function metapost.setbuffer(b, s)
+ n = 0
+ for i=1,(s or #b) do
+ local bi = b[i]
+ if bi then
+ n = n + 1
+ buffer[n] = tostring(bi)
+ end
+ end
+ end
+
function metapost.runscript(code)
nesting = nesting + 1
runs = runs + 1
@@ -157,6 +168,26 @@ do
elseif trace_luarun then
report_luarun("%i: index: %i",nesting,code)
end
+ local m = runmodes[code]
+ if m == "direct" then
+ result = f()
+ if trace_luarun then
+ report_luarun("%i: direct: %a",nesting,type(result))
+ end
+ nesting = nesting - 1
+ return result, true -- string and tables as string and objects
+ elseif m == "tokens" then
+ result = f()
+ if trace_luarun then
+ report_luarun("%i: tokens: %a",nesting,type(result))
+ end
+ nesting = nesting - 1
+ return result -- string and tables as text to be scanned
+ else
+ if trace_luarun then
+ report_luarun("%i: no mode",nesting)
+ end
+ end
else
if trace_luarun then
report_luarun("%i: code: %s",nesting,code)
@@ -263,7 +294,7 @@ do
-- writers
- local function mpp(value)
+ local function rawmpp(value)
n = n + 1
local t = type(value)
if t == "number" then
@@ -284,13 +315,13 @@ do
local function mpprint(first,second,...)
if second == nil then
if first ~= nil then
- mpp(first)
+ rawmpp(first)
end
else
for i=1,select("#",first,second,...) do
local value = (select(i,first,second,...))
if value ~= nil then
- mpp(value)
+ rawmpp(value)
end
end
end
@@ -368,7 +399,7 @@ do
if type(x) == "table" then
buffer[n] = f_pair(x[1],x[2])
else
- buffer[n] = f_pair(x,y)
+ buffer[n] = f_pair(x,y or x)
end
end
@@ -377,7 +408,7 @@ do
if type(x) == "table" then
buffer[n] = f_pair_pt(x[1],x[2])
else
- buffer[n] = f_pair_pt(x,y)
+ buffer[n] = f_pair_pt(x,y or x)
end
end
@@ -569,11 +600,7 @@ do
end
end
- aux.direct = mpdirect1
- aux.direct1 = mpdirect1
- aux.direct2 = mpdirect2
- aux.direct3 = mpdirect3
- aux.direct4 = mpdirect4
+ aux.direct = mpdirect
aux.flush = mpflush
aux.print = mpprint
@@ -669,12 +696,29 @@ do
for k, v in next, aux do mp[k] = v end
+ -- mp.print = table.setmetatablecall(aux, function(t,...)
+ -- mpprint(...)
+ -- end)
+
+ mp.print = table.setmetatablecall(aux, function(t,first,second,...)
+ if second == nil then
+ if first ~= nil then
+ rawmpp(first)
+ end
+ else
+ for i=1,select("#",first,second,...) do
+ local value = (select(i,first,second,...))
+ if value ~= nil then
+ rawmpp(value)
+ end
+ end
+ end
+ end)
+
end
do
- -- Another experimental feature:
-
local mpnumeric = mp.numeric
local scanstring = scan.string
local scriptindex = metapost.scriptindex
@@ -687,32 +731,8 @@ do
-- once bootstrapped ... (needs pushed mpx instances)
- metapost.registerscript("scriptindex",function()
- local name = scanstring()
- local index = scriptindex(name)
- -- report_script("method %i, name %a, index %i",2,name,index)
- mpnumeric(index)
- end)
-
-end
-
--- the next will move to mlib-lmp.lua
-
-do
-
- local mpnamedcolor = attributes.colors.mpnamedcolor
- local mpprint = aux.print
- local scanstring = scan.string
-
- mp.mf_named_color = function(str)
- mpprint(mpnamedcolor(str))
- end
-
- -- todo: we can inject but currently we always get a string back so then
- -- we need to deal with it upstream in the color module ... not now
-
- metapost.registerscript("namedcolor",function()
- mpprint(mpnamedcolor(scanstring()))
+ metapost.registerdirect("scriptindex",function()
+ return scriptindex(scanstring())
end)
end
@@ -806,388 +826,14 @@ end
-- texts:
-do
-
- local mptriplet = mp.triplet
-
- local bpfactor = number.dimenfactors.bp
- local textexts = nil
- local mptriplet = mp.triplet
- local nbdimensions = nodes.boxes.dimensions
-
- function mp.mf_tt_initialize(tt)
- textexts = tt
- end
-
- function mp.mf_tt_dimensions(n)
- local box = textexts and textexts[n]
- if box then
- -- could be made faster with nuts but not critical
- mptriplet(box.width*bpfactor,box.height*bpfactor,box.depth*bpfactor)
- else
- mptriplet(0,0,0)
- end
- end
-
- function mp.mf_tb_dimensions(category,name)
- local w, h, d = nbdimensions(category,name)
- mptriplet(w*bpfactor,h*bpfactor,d*bpfactor)
- end
-
- function mp.report(a,b,c,...)
- if c then
- report_message("%s : %s",a,formatters[(gsub(b,"@","%%"))](c,...))
- elseif b then
- report_message("%s : %s",a,b)
- elseif a then
- report_message("%s : %s","message",a)
- end
- end
-
-end
-
-do
-
- local mpprint = aux.print
- local modes = tex.modes
- local systemmodes = tex.systemmodes
-
- function mp.mode(s)
- mpprint(modes[s] and true or false)
- end
-
- function mp.systemmode(s)
- mpprint(systemmodes[s] and true or false)
- end
-
- mp.processingmode = mp.mode
-
-end
-
--- for alan's nodes:
-
-do
-
- local mpprint = aux.print
- local mpquoted = aux.quoted
-
- function mp.isarray(str)
- mpprint(find(str,"%d") and true or false)
- end
-
- function mp.prefix(str)
- mpquoted(match(str,"^(.-)[%d%[]") or str)
- end
-
- -- function mp.dimension(str)
- -- local n = 0
- -- for s in gmatch(str,"%[?%-?%d+%]?") do --todo: lpeg
- -- n = n + 1
- -- end
- -- mpprint(n)
- -- end
-
- mp.dimension = lpeg.counter(P("[") * lpegpatterns.integer * P("]") + lpegpatterns.integer,mpprint)
-
- -- faster and okay as we don't have many variables but probably only
- -- basename makes sense and even then it's not called that often
-
- -- local hash = table.setmetatableindex(function(t,k)
- -- local v = find(k,"%d") and true or false
- -- t[k] = v
- -- return v
- -- end)
- --
- -- function mp.isarray(str)
- -- mpprint(hash[str])
- -- end
- --
- -- local hash = table.setmetatableindex(function(t,k)
- -- local v = '"' .. (match(k,"^(.-)%d") or k) .. '"'
- -- t[k] = v
- -- return v
- -- end)
- --
- -- function mp.prefix(str)
- -- mpprint(hash[str])
- -- end
-
-end
-
-do
-
- local scanstring = scan.string
- local scannumeric = scan.numeric
- local skiptoken = skip.token
-
- local injectstring = inject.string
- local injectnumeric = inject.numeric
-
- local registerscript = metapost.registerscript
-
- local comma_code = metapost.codes.comma
-
- local getmacro = tokens.getters.macro
- local setmacro = tokens.setters.macro
-
- local getdimen = tex.getdimen
- local getcount = tex.getcount
- local gettoks = tex.gettoks
- local setdimen = tex.setdimen
- local setcount = tex.setcount
- local settoks = tex.settoks
-
- local bpfactor = number.dimenfactors.bp
-
- -- more helpers
-
- registerscript("getmacro", function() injectstring (getmacro(scanstring())) end)
- registerscript("getdimen", function() injectnumeric(getdimen(scanstring())*bpfactor) end)
- registerscript("getcount", function() injectnumeric(getcount(scanstring())) end)
- registerscript("gettoks", function() injectstring (gettoks (scanstring())) end)
-
- registerscript("setmacro", function() setmacro(scanstring(),scanstring()) end)
- registerscript("setdimen", function() setdimen(scanstring(),scannumeric()/bpfactor) end)
- registerscript("setcount", function() setcount(scanstring(),scannumeric()) end)
- registerscript("settoks", function() settoks (scanstring(),scanstring()) end)
-
- registerscript("setglobalmacro", function() setmacro(scanstring(),scanstring(),"global") end)
- registerscript("setglobaldimen", function() setdimen("global",scanstring(),scannumeric()/bpfactor) end)
- registerscript("setglobalcount", function() setcount("global",scanstring(),scannumeric()) end)
- registerscript("setglobaltoks", function() settoks ("global",scanstring(),scanstring()) end)
-
-
- local utfnum = utf.byte
- local utflen = utf.len
- local utfsub = utf.sub
-
- registerscript("utfnum", function()
- injectnumeric(utfnum(scanstring()))
- end)
-
- registerscript("utflen", function()
- injectnumeric(utflen(scanstring()))
- end)
-
- registerscript("utfsub", function() -- we have an optional third argument so we explicitly scan a text argument
- injectstring(utfsub(scanstring(),skiptoken(comma_code) and scannumeric(),skiptoken(comma_code) and scannumeric()))
- end)
-
-end
-
--- position fun
-
-do
-
- local mpprint = mp.print
- local mpfprint = mp.fprint
- local mpquoted = mp.quoted
- local jobpositions = job.positions
- local getwhd = jobpositions.whd
- local getxy = jobpositions.xy
- local getposition = jobpositions.position
- local getpage = jobpositions.page
- local getregion = jobpositions.region
- local getmacro = tokens.getters.macro
-
- function mp.positionpath(name)
- local w, h, d = getwhd(name)
- if w then
- mpfprint("((%p,%p)--(%p,%p)--(%p,%p)--(%p,%p)--cycle)",0,-d,w,-d,w,h,0,h)
- else
- mpprint("(origin--cycle)")
- end
- end
-
- function mp.positioncurve(name)
- local w, h, d = getwhd(name)
- if w then
- mpfprint("((%p,%p)..(%p,%p)..(%p,%p)..(%p,%p)..cycle)",0,-d,w,-d,w,h,0,h)
- else
- mpprint("(origin--cycle)")
- end
- end
-
- function mp.positionbox(name)
- local p, x, y, w, h, d = getposition(name)
- if p then
- mpfprint("((%p,%p)--(%p,%p)--(%p,%p)--(%p,%p)--cycle)",x,y-d,x+w,y-d,x+w,y+h,x,y+h)
- else
- mpprint("(%p,%p)",x,y)
- end
- end
-
- function mp.positionxy(name)
- local x, y = getxy(name)
- if x then
- mpfprint("(%p,%p)",x,y)
- else
- mpprint("origin")
- end
- end
-
- function mp.positionpage(name)
- mpfprint("%i",getpage(name) or 0)
- end
-
- function mp.positionregion(name)
- local r = getregion(name)
- if r then
- mpquoted(r)
- else
- mpquoted("unknown")
- end
- end
-
- function mp.positionwhd(name)
- local w, h, d = getwhd(name)
- if w then
- mpfprint("(%p,%p,%p)",w,h,d)
- else
- mpprint("(0,0,0)")
- end
- end
-
- function mp.positionpxy(name)
- local p, x, y = getposition(name)
- if p then
- mpfprint("(%p,%p,%p)",p,x,y)
- else
- mpprint("(0,0,0)")
- end
- end
-
- function mp.positionanchor()
- mpquoted(getmacro("MPanchorid"))
- end
-
-end
-
-do
-
- -- local mppair = mp.pair
- --
- -- function mp.textextanchor(s)
- -- local x, y = match(s,"tx_anchor=(%S+) (%S+)") -- todo: make an lpeg
- -- if x and y then
- -- x = tonumber(x)
- -- y = tonumber(y)
- -- end
- -- mppair(x or 0,y or 0)
- -- end
-
- local injectpair = inject.pair
- local scanstring = scan.string
-
- metapost.registerscript("textextanchor", function()
- local x, y = match(scanstring(),"tx_anchor=(%S+) (%S+)") -- todo: make an lpeg
- if x and y then
- x = tonumber(x)
- y = tonumber(y)
- end
- injectpair(x or 0,y or 0)
- end)
-
-end
-
-do
-
- local mpprint = mp.print
- local mpquoted = mp.quoted
- local getmacro = tokens.getters.macro
-
- function mp.texvar(name)
- mpprint(getmacro(metapost.namespace .. name))
- end
-
- function mp.texstr(name)
- mpquoted(getmacro(metapost.namespace .. name))
- end
-
-end
-
-do
-
- local mpprint = aux.print
- local mpvprint = aux.vprint
-
- local hashes = { }
-
- function mp.newhash(name)
- if name then
- hashes[name] = { }
- else
- for i=1,#hashes+1 do
- if not hashes[i] then
- hashes[i] = { }
- mpvprint(i)
- return
- end
- end
- end
- end
-
- function mp.disposehash(n)
- if tonumber(n) then
- hashes[n] = false
- else
- hashes[n] = nil
- end
- end
-
- function mp.inhash(n,key)
- local h = hashes[n]
- mpvprint(h and h[key] and true or false)
- end
-
- function mp.tohash(n,key,value)
- local h = hashes[n]
- if h then
- if value == nil then
- h[key] = true
- else
- h[key] = value
- end
- end
+function mp.report(a,b,c,...)
+ if c then
+ report_message("%s : %s",a,formatters[(gsub(b,"@","%%"))](c,...))
+ elseif b then
+ report_message("%s : %s",a,b)
+ elseif a then
+ report_message("message : %s",a)
end
-
- function mp.fromhash(n,key)
- local h = hashes[n]
- mpvprint(h and h[key] or false)
- end
-
- interfaces.implement {
- name = "MPfromhash",
- arguments = "2 strings",
- actions = function(name,key)
- local h = hashes[name] or hashes[tonumber(name)]
- if h then
- local v = h[key] or h[tonumber(key)]
- if v then
- context(v)
- end
- end
- end
- }
-
-end
-
-do
-
- -- a bit overkill: just a find(str,"mf_object=") can be enough
- --
- -- todo : share with mlib-pps.lua metapost,isobject
-
- local mpboolean = aux.boolean
-
- local p1 = P("mf_object=")
- local p2 = lpegpatterns.eol * p1
- local pattern = (1-p2)^0 * p2 + p1
-
- function mp.isobject(str)
- mpboolean(pattern and str ~= "" and lpegmatch(pattern,str))
- end
-
end
function mp.flatten(t)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-pdf.lmt b/Master/texmf-dist/tex/context/base/mkxl/mlib-pdf.lmt
index c383d52ded1..3aeda8996b0 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/mlib-pdf.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-pdf.lmt
@@ -7,7 +7,7 @@ if not modules then modules = { } end modules ['mlib-pdf'] = {
}
local gsub = string.gsub
-local concat, insert, remove = table.concat, table.insert, table.remove
+local concat, insert, remove, sortedkeys = table.concat, table.insert, table.remove, table.sortedkeys
local abs, sqrt, round = math.abs, math.sqrt, math.round
local setmetatable, rawset, tostring, tonumber, type = setmetatable, rawset, tostring, tonumber, type
local P, S, C, Ct, Cc, Cg, Cf, Carg = lpeg.P, lpeg.S, lpeg.C, lpeg.Ct, lpeg.Cc, lpeg.Cg, lpeg.Cf, lpeg.Carg
@@ -23,10 +23,7 @@ local context = context
local allocate = utilities.storage.allocate
-local copy_node = node.copy
-local write_node = node.write
-
-local pen_info = mplib.pen_info
+local peninfo = mplib.peninfo
local getfields = mplib.getfields or mplib.fields -- todo: in lmtx get them once and then use gettype
local save_table = false
@@ -68,14 +65,9 @@ trackers.register("metapost.forcestroke",function(v)
force_stroke = v
end)
--- Because in MKiV we always have two passes, we save the objects. When an extra
--- mp run is done (due to for instance texts identifier in the parse pass), we
--- get a new result table and the stored objects are forgotten. Otherwise they
--- are reused.
-
-local function getobjects(result,figure,index)
- return figure:objects()
-end
+-- local function gettolerance(objects)
+-- return objects:tolerance()
+-- end
function metapost.convert(specification,result)
local flusher = specification.flusher
@@ -116,12 +108,10 @@ function pdfflusher.textfigure(font,size,text,width,height,depth) -- we could sa
context.MPtextext(font,size,text,0,-number.dimenfactors.bp*depth)
end
-local bend_tolerance = 131/65536
-
local rx, sx, sy, ry, tx, ty, divider = 1, 0, 0, 1, 0, 0, 1
local function pen_characteristics(object)
- local t = pen_info(object)
+ local t = peninfo(object)
rx, ry, sx, sy, tx, ty = t.rx, t.ry, t.sx, t.sy, t.tx, t.ty
divider = sx*sy - rx*ry
return not (sx == 1 and rx == 0 and ry == 0 and sy == 1 and tx == 0 and ty == 0), t.width
@@ -131,18 +121,39 @@ local function mpconcat(px, py) -- no tx, ty here / we can move this one inline
return (sy*px-ry*py)/divider,(sx*py-rx*px)/divider
end
-local function curved(ith,pth)
+local getbendtolerance = metapost.getbendtolerance
+
+local function curved(ith,pth,tolerance) --- still better than the build in
+ -- if pth.right_x == pth.x_coord then
+ -- if pth.right_y == pth.y_coord then
+ -- if ith.left_x == ith.x_coord then
+ -- if ith.left_y == ith.y_coord then
+ -- return false
+ -- end
+ -- end
+ -- end
+ -- end
local d = pth.left_x - ith.right_x
- if abs(ith.right_x - ith.x_coord - d) <= bend_tolerance and abs(pth.x_coord - pth.left_x - d) <= bend_tolerance then
- d = pth.left_y - ith.right_y
- if abs(ith.right_y - ith.y_coord - d) <= bend_tolerance and abs(pth.y_coord - pth.left_y - d) <= bend_tolerance then
- return false
+ local b = abs(ith.right_x - ith.x_coord - d)
+ if b <= tolerance then
+ b = abs(pth.x_coord - pth.left_x - d)
+ if b <= tolerance then
+ d = pth.left_y - ith.right_y
+ b = abs(ith.right_y - ith.y_coord - d)
+ if b <= tolerance then
+ b = abs(pth.y_coord - pth.left_y - d)
+ if b <= tolerance then
+-- print(tolerance,ith.curved,pth.curved,false)
+ return false
+ end
+ end
end
end
+-- print(tolerance,ith.curved,pth.curved,true)
return true
end
-local function flushnormalpath(path, t, open)
+local function flushnormalpath(path, t, open, tolerance)
local pth, ith, nt
local length = #path
if t then
@@ -154,10 +165,10 @@ local function flushnormalpath(path, t, open)
for i=1,length do
nt = nt + 1
pth = path[i]
- if not ith then
+ if not ith or pth.state == 1 then
t[nt] = f_m(pth.x_coord,pth.y_coord)
--- elseif curved(ith,pth) then
-elseif pth.curved then
+ elseif curved(ith,pth,tolerance) then
+-- elseif pth.curved then
t[nt] = f_c(ith.right_x,ith.right_y,pth.left_x,pth.left_y,pth.x_coord,pth.y_coord)
else
t[nt] = f_l(pth.x_coord,pth.y_coord)
@@ -167,8 +178,10 @@ elseif pth.curved then
if not open then
nt = nt + 1
local one = path[1]
--- if curved(pth,one) then
-if one.curved then
+ if one.state == 1 then
+ t[nt] = f_m(one.x_coord,one.y_coord)
+ elseif curved(pth,one,tolerance) then
+-- if one.curved then
t[nt] = f_c(pth.right_x,pth.right_y,one.left_x,one.left_y,one.x_coord,one.y_coord)
else
t[nt] = f_l(one.x_coord,one.y_coord)
@@ -182,7 +195,7 @@ if one.curved then
return t
end
-local function flushconcatpath(path, t, open)
+local function flushconcatpath(path, t, open, tolerance, transform)
local pth, ith, nt
local length = #path
if t then
@@ -191,15 +204,17 @@ local function flushconcatpath(path, t, open)
t = { }
nt = 0
end
- nt = nt + 1
- t[nt] = f_cm(sx,rx,ry,sy,tx,ty)
+ if transform then
+ nt = nt + 1
+ t[nt] = f_cm(sx,rx,ry,sy,tx,ty)
+ end
for i=1,length do
nt = nt + 1
pth = path[i]
- if not ith then
+ if not ith or pth.state == 1 then
t[nt] = f_m(mpconcat(pth.x_coord,pth.y_coord))
--- elseif curved(ith,pth) then
-elseif pth.curved then
+ elseif curved(ith,pth,tolerance) then
+-- elseif pth.curved then
local a, b = mpconcat(ith.right_x,ith.right_y)
local c, d = mpconcat(pth.left_x,pth.left_y)
t[nt] = f_c(a,b,c,d,mpconcat(pth.x_coord,pth.y_coord))
@@ -211,8 +226,10 @@ elseif pth.curved then
if not open then
nt = nt + 1
local one = path[1]
--- if curved(pth,one) then
-if one.curved then
+ if one.state == 1 then
+ t[nt] = f_m(one.x_coord,one.y_coord)
+ elseif curved(pth,one,tolerance) then
+-- if one.curved then
local a, b = mpconcat(pth.right_x,pth.right_y)
local c, d = mpconcat(one.left_x,one.left_y)
t[nt] = f_c(a,b,c,d,mpconcat(one.x_coord, one.y_coord))
@@ -256,7 +273,10 @@ local function toboundingbox(path)
end
end
-metapost.flushnormalpath = flushnormalpath
+
+function metapost.flushnormalpath(path, t, open, tolerance)
+ return flushnormalpath(path, t, open, tolerance or getbendtolerance())
+end
-- The flusher is pdf based, if another backend is used, we need to overload the
-- flusher; this is beta code, the organization will change (already upgraded in
@@ -327,7 +347,8 @@ end
-- end
-- end
-local stack = { }
+local stack = { } -- general stack (not related to stacking)
+local nostacking = { 0 } -- layers in figures
local function pushproperties(figure)
-- maybe there will be getters in lmtx
@@ -342,7 +363,7 @@ local function pushproperties(figure)
width = figure:width(),
height = figure:height(),
depth = figure:depth(),
- italic = figure:italcorr(), -- figure:italic() in lmtx
+ italic = figure:italic(),
number = slot,
}
insert(stack,properties)
@@ -359,6 +380,7 @@ function metapost.flush(specification,result)
local flusher = specification.flusher
local askedfig = specification.askedfig
local incontext = specification.incontext
+ local filtering = specification.filtering
local figures = result.fig
if figures then
flusher = flusher or pdfflusher
@@ -372,11 +394,19 @@ function metapost.flush(specification,result)
local textfigure = flusher.textfigure
-- local processspecial = flusher.processspecial or metapost.processspecial
local tocomment = flusher.tocomment
+ if type(filtering) ~= "table" or not next(filtering) then
+ filtering = false
+ end
+ -- patterns: we always use image 1 and then can use patterns for 2..n (or one number)
+ -- we can then do an intermediate flush
+
for index=1,#figures do
local figure = figures[index]
local properties = pushproperties(figure)
if askedfig == "direct" or askedfig == "all" or askedfig == properties.number then
- local objects = getobjects(result,figure,index)
+ local stacking = figure:stacking() -- This has to happen before fetching objects!
+ local objects = figure:objects()
+ local tolerance = figure:tolerance() or getbendtolerance()
local result = { }
local miterlimit = -1
local linecap = -1
@@ -409,245 +439,277 @@ function metapost.flush(specification,result)
-- resetplugins(result) -- we should move the colorinitializer here
local savedpath = nil
local savedhtap = nil
- for o=1,#objects do
- local object = objects[o]
- local objecttype = object.type
- if objecttype == "fill" or objecttype == "outline" then
- -- we use an indirect table as we want to overload
- -- entries but this is not possible in userdata
- --
- -- can be optimized if no path
- --
- local original = object
- local object = { }
- setmetatable(object, {
- __index = original
- })
- local before,
- after = processplugins(object)
- local evenodd = false
- local collect = false
- local both = false
- local flush = false
- local postscript = object.postscript
- if not object.istext then
- if postscript == "evenodd" then
- evenodd = true
- elseif postscript == "collect" then
- collect = true
- elseif postscript == "flush" then
- flush = true
- elseif postscript == "both" then
- both = true
- elseif postscript == "eoboth" then
- evenodd = true
- both = true
- end
- end
- --
- if flush and not savedpath then
- -- forget about it
- elseif collect then
- if not savedpath then
- savedpath = { object.path or false }
- savedhtap = { object.htap or false }
+ if stacking then
+ stacking = { }
+ for o=1,#objects do
+ local stack = objects[o].stacking
+ if stack then
+ if filtering then
+ stacking[stack] = filtering[stack]
else
- savedpath[#savedpath+1] = object.path or false
- savedhtap[#savedhtap+1] = object.htap or false
+ stacking[stack] = true
end
- else
- local objecttype = object.type -- can have changed
- if before then
- result = pluginactions(before,result,flushfigure)
- end
- local ml = object.miterlimit
- if ml and ml ~= miterlimit then
- miterlimit = ml
- result[#result+1] = f_M(ml)
- end
- local lj = object.linejoin
- if lj and lj ~= linejoin then
- linejoin = lj
- result[#result+1] = f_j(lj)
- end
- local lc = object.linecap
- if lc and lc ~= linecap then
- linecap = lc
- result[#result+1] = f_J(lc)
- end
- if both then
- if dashed ~= false then -- was just dashed test
- result[#result+1] = "[] 0 d"
- dashed = false
+ end
+ end
+ stacking = sortedkeys(stacking)
+ else
+ stacking = nostacking
+ end
+ for i=1,#stacking do
+ local stack = stacking[i]
+ for o=1,#objects do
+ local object = objects[o]
+ if stack == object.stacking then
+ local objecttype = object.type
+ if objecttype == "fill" or objecttype == "outline" then
+ -- we use an indirect table as we want to overload
+ -- entries but this is not possible in userdata
+ --
+ -- can be optimized if no path
+ --
+ local original = object
+ local object = { }
+ setmetatable(object, {
+ __index = original
+ })
+ local before,
+ after,
+ options = processplugins(object)
+ local evenodd = false
+ local collect = false
+ local both = false
+ local flush = false
+ local outline = force_outline
+ local envelope = false
+ local postscript = object.postscript
+ local tolerance = options and tonumber(options.tolerance) or tolerance
+ -- if not object.istext then
+ if postscript == "evenodd" then
+ evenodd = true
+ elseif postscript == "collect" then
+ collect = true
+ elseif postscript == "flush" then
+ flush = true
+ elseif postscript == "both" then
+ both = true
+ elseif postscript == "eoboth" then
+ evenodd = true
+ both = true
+ elseif postscript == "envelope" then
+ envelope = true
end
- else
- local dl = object.dash
- if dl then
- local d = f_d(concat(dl.dashes or {}," "),dl.offset)
- if d ~= dashed then
- dashed = d
- result[#result+1] = d
+ -- end
+ --
+ if flush and not savedpath then
+ -- forget about it
+ elseif collect then
+ if not savedpath then
+ savedpath = { object.path or false }
+ savedhtap = { object.htap or false }
+ else
+ savedpath[#savedpath+1] = object.path or false
+ savedhtap[#savedhtap+1] = object.htap or false
end
- elseif dashed ~= false then -- was just dashed test
- result[#result+1] = "[] 0 d"
- dashed = false
- end
- end
- local path = object.path -- newpath
- local transformed = false
- local penwidth = 1
- local open = path and path[1].left_type and path[#path].right_type -- at this moment only "end_point"
- local pen = object.pen
- if pen then
- if pen.type == "elliptical" then
- transformed, penwidth = pen_characteristics(original) -- boolean, value
- if penwidth ~= linewidth then
- result[#result+1] = f_w(penwidth)
- linewidth = penwidth
+ else
+ local objecttype = object.type -- can have changed
+ if envelope then
+ dashed, linewidth = "", 1 -- to be sure
end
- if objecttype == "fill" then
- objecttype = "both"
+ if before then
+ result = pluginactions(before,result,flushfigure)
end
- else -- calculated by mplib itself
- objecttype = "fill"
- end
- end
- if transformed then
- result[#result+1] = "q"
- end
- if path then
- if savedpath then
- for i=1,#savedpath do
- local path = savedpath[i]
- if transformed then
- flushconcatpath(path,result,open)
- else
- flushnormalpath(path,result,open)
- end
+ local ml = object.miterlimit
+ if ml and ml ~= miterlimit then
+ miterlimit = ml
+ result[#result+1] = f_M(ml)
+ end
+ local lj = object.linejoin
+ if lj and lj ~= linejoin then
+ linejoin = lj
+ result[#result+1] = f_j(lj)
+ end
+ local lc = object.linecap
+ if lc and lc ~= linecap then
+ linecap = lc
+ result[#result+1] = f_J(lc)
end
- savedpath = nil
- end
- if flush then
- -- ignore this path
- elseif transformed then
- flushconcatpath(path,result,open)
- else
- flushnormalpath(path,result,open)
- end
- if force_stroke then
- result[#result+1] = open and "S" or "h S"
- elseif objecttype == "fill" then
- result[#result+1] = evenodd and "h f*" or "h f" -- f* = eo
- elseif objecttype == "outline" then
if both then
- result[#result+1] = evenodd and "h B*" or "h B" -- B* = eo
+ if dashed ~= false then -- was just dashed test
+ result[#result+1] = "[] 0 d"
+ dashed = false
+ end
else
- result[#result+1] = open and "S" or "h S"
+ local dl = object.dash
+ if dl then
+ local d = f_d(concat(dl.dashes or {}," "),dl.offset)
+ if d ~= dashed then
+ dashed = d
+ result[#result+1] = d
+ end
+ elseif dashed ~= false then -- was just dashed test
+ result[#result+1] = "[] 0 d"
+ dashed = false
+ end
end
- elseif objecttype == "both" then
- result[#result+1] = evenodd and "h B*" or "h B" -- B* = eo -- b includes closepath
- end
- end
- if transformed then
- result[#result+1] = "Q"
- end
- local path = object.htap
- if path then
- if transformed then
- result[#result+1] = "q"
- end
- if savedhtap then
- for i=1,#savedhtap do
- local path = savedhtap[i]
+ local path = object.path -- newpath
+ local transformed = false
+ local penwidth = 1
+ local open = path and path[1].left_type and path[#path].right_type -- at this moment only "end_point"
+ local pen = object.pen
+ if pen then
+ if pen.type == "elliptical" or outline then
+ transformed, penwidth = pen_characteristics(original) -- boolean, value
+ if penwidth ~= linewidth then
+ result[#result+1] = f_w(penwidth)
+ linewidth = penwidth
+ end
+ if objecttype == "fill" then
+ objecttype = "both"
+ end
+ else -- calculated by mplib itself
+ objecttype = "fill"
+ end
+ end
+ if transformed then
+ result[#result+1] = "q"
+ end
+ if path then
+ if savedpath then
+ for i=1,#savedpath do
+ local path = savedpath[i]
+ local open = not path.cycle
+ if transformed then
+ flushconcatpath(path,result,open,tolerance,i==1)
+ else
+ flushnormalpath(path,result,open,tolerance)
+ end
+ end
+ savedpath = nil
+ end
+ if flush then
+ -- ignore this path
+ elseif transformed then
+ flushconcatpath(path,result,open,tolerance,true)
+ else
+ flushnormalpath(path,result,open,tolerance)
+ end
+ if outline or envelope then
+ result[#result+1] = open and "S" or "h S"
+ elseif objecttype == "fill" then
+ result[#result+1] = evenodd and "h f*" or "h f" -- f* = eo
+ elseif objecttype == "outline" then
+ if both then
+ result[#result+1] = evenodd and "h B*" or "h B" -- B* = eo
+ else
+ result[#result+1] = open and "S" or "h S"
+ end
+ elseif objecttype == "both" then
+ result[#result+1] = evenodd and "h B*" or "h B" -- B* = eo -- b includes closepath
+ end
+ end
+ if transformed then
+ result[#result+1] = "Q"
+ end
+ local path = object.htap
+ if path then
if transformed then
- flushconcatpath(path,result,open)
+ result[#result+1] = "q"
+ end
+ if savedhtap then
+ for i=1,#savedhtap do
+ local path = savedhtap[i]
+ local open = not path.cycle
+ if transformed then
+ flushconcatpath(path,result,open,tolerance,i==1)
+ else
+ flushnormalpath(path,result,open,tolerance)
+ end
+ end
+ savedhtap = nil
+ evenodd = true
+ end
+ if transformed then
+ flushconcatpath(path,result,open,tolerance,true)
else
- flushnormalpath(path,result,open)
+ flushnormalpath(path,result,open,tolerance)
+ end
+ if outline or envelope then
+ result[#result+1] = open and "S" or "h S"
+ elseif objecttype == "fill" then
+ result[#result+1] = evenodd and "h f*" or "h f" -- f* = eo
+ elseif objecttype == "outline" then
+ result[#result+1] = open and "S" or "h S"
+ elseif objecttype == "both" then
+ result[#result+1] = evenodd and "h B*" or "h B" -- B* = eo -- b includes closepath
end
+ if transformed then
+ result[#result+1] = "Q"
+ end
+ end
+ if after then
+ result = pluginactions(after,result,flushfigure)
end
- savedhtap = nil
- evenodd = true
end
- if transformed then
- flushconcatpath(path,result,open)
- else
- flushnormalpath(path,result,open)
+ if object.grouped then
+ -- can be qQ'd so changes can end up in groups
+ miterlimit, linecap, linejoin, dashed, linewidth = -1, -1, -1, "", false
end
- if force_stroke then
- result[#result+1] = open and "S" or "h S"
- elseif objecttype == "fill" then
- result[#result+1] = evenodd and "h f*" or "h f" -- f* = eo
- elseif objecttype == "outline" then
- result[#result+1] = open and "S" or "h S"
- elseif objecttype == "both" then
- result[#result+1] = evenodd and "h B*" or "h B" -- B* = eo -- b includes closepath
+ elseif objecttype == "start_clip" then
+ -- local evenodd = not object.istext and object.postscript == "evenodd"
+ local evenodd = object.postscript == "evenodd"
+ result[#result+1] = "q"
+ flushnormalpath(object.path,result,false,tolerance)
+ result[#result+1] = evenodd and "W* n" or "W n"
+ elseif objecttype == "stop_clip" then
+ result[#result+1] = "Q"
+ miterlimit, linecap, linejoin, dashed, linewidth = -1, -1, -1, "", false
+ elseif objecttype == "start_bounds" or objecttype == "stop_bounds" then
+ -- skip
+ elseif objecttype == "start_group" then
+ if lpdf.flushgroup then
+ local before, after = processplugins(object)
+ if before then
+ result[#result+1] = "q"
+ result = pluginactions(before,result,flushfigure)
+ insert(groupstack, {
+ after = after,
+ result = result,
+ bbox = toboundingbox(object.path),
+ })
+ result = { }
+ miterlimit, linecap, linejoin, dashed, linewidth = -1, -1, -1, "", false
+ else
+ insert(groupstack,false)
+ end
+ else
+ insert(groupstack,false)
end
- if transformed then
+ elseif objecttype == "stop_group" then
+ local data = remove(groupstack)
+ if data then
+ local reference = lpdf.flushgroup(concat(result,"\r"),data.bbox)
+ result = data.result
+ result[#result+1] = reference
+ result = pluginactions(data.after,result,flushfigure)
result[#result+1] = "Q"
+ miterlimit, linecap, linejoin, dashed, linewidth = -1, -1, -1, "", false
end
+ -- if objecttype == "text" then
+ -- result[#result+1] = "q"
+ -- local ot = object.transform -- 3,4,5,6,1,2
+ -- result[#result+1] = f_cm(ot[3],ot[4],ot[5],ot[6],ot[1],ot[2])
+ -- flushfigure(result) -- flush accumulated literals
+ -- result = { }
+ -- textfigure(object.font,object.dsize,object.text,object.width,object.height,object.depth)
+ -- result[#result+1] = "Q"
+ -- elseif objecttype == "special" then
+ -- if processspecial then
+ -- processspecial(object.prescript)
+ -- end
+ -- else
+ -- error
end
- if after then
- result = pluginactions(after,result,flushfigure)
- end
- end
- if object.grouped then
- -- can be qQ'd so changes can end up in groups
- miterlimit, linecap, linejoin, dashed, linewidth = -1, -1, -1, "", false
- end
- elseif objecttype == "start_clip" then
- local evenodd = not object.istext and object.postscript == "evenodd"
- result[#result+1] = "q"
- flushnormalpath(object.path,result,false)
- result[#result+1] = evenodd and "W* n" or "W n"
- elseif objecttype == "stop_clip" then
- result[#result+1] = "Q"
- miterlimit, linecap, linejoin, dashed, linewidth = -1, -1, -1, "", false
- elseif objecttype == "start_bounds" or objecttype == "stop_bounds" then
- -- skip
- elseif objecttype == "start_group" then
- if lpdf.flushgroup then
- local before, after = processplugins(object)
- if before then
- result[#result+1] = "q"
- result = pluginactions(before,result,flushfigure)
- insert(groupstack, {
- after = after,
- result = result,
- bbox = toboundingbox(object.path),
- })
- result = { }
- miterlimit, linecap, linejoin, dashed, linewidth = -1, -1, -1, "", false
- else
- insert(groupstack,false)
- end
- else
- insert(groupstack,false)
- end
- elseif objecttype == "stop_group" then
- local data = remove(groupstack)
- if data then
- local reference = lpdf.flushgroup(concat(result,"\r"),data.bbox)
- result = data.result
- result[#result+1] = reference
- result = pluginactions(data.after,result,flushfigure)
- result[#result+1] = "Q"
- miterlimit, linecap, linejoin, dashed, linewidth = -1, -1, -1, "", false
end
- -- if objecttype == "text" then
- -- result[#result+1] = "q"
- -- local ot = object.transform -- 3,4,5,6,1,2
- -- result[#result+1] = f_cm(ot[3],ot[4],ot[5],ot[6],ot[1],ot[2])
- -- flushfigure(result) -- flush accumulated literals
- -- result = { }
- -- textfigure(object.font,object.dsize,object.text,object.width,object.height,object.depth)
- -- result[#result+1] = "Q"
- -- elseif objecttype == "special" then
- -- if processspecial then
- -- processspecial(object.prescript)
- -- end
- -- else
- else
- -- error
end
end
end
@@ -715,7 +777,7 @@ function metapost.totable(result,askedfig)
local figure = result and result.fig and result.fig[1]
if figure then
local results = { }
- local objects = getobjects(result,figure,askedfig)
+ local objects = figure:objects()
for o=1,#objects do
local object = objects[o]
local result = { }
diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-pdf.mkxl b/Master/texmf-dist/tex/context/base/mkxl/mlib-pdf.mkxl
index 6ded235145c..744c461d7a4 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/mlib-pdf.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-pdf.mkxl
@@ -20,15 +20,15 @@
%D Some code is shared between MPLIB and MPS. The following variables are also
%D available for introspection and other purposes.
-\ifdefined\MPwidth \else \newdimen\MPwidth \fi
-\ifdefined\MPheight \else \newdimen\MPheight \fi
+\newdimension\MPwidth
+\newdimension\MPheight
-\ifdefined\MPllx \else \newdimen\MPllx \fi
-\ifdefined\MPlly \else \newdimen\MPlly \fi
-\ifdefined\MPurx \else \newdimen\MPurx \fi
-\ifdefined\MPury \else \newdimen\MPury \fi
+\newdimension\MPllx
+\newdimension\MPlly
+\newdimension\MPurx
+\newdimension\MPury
-\ifdefined\MPbox \else \newbox \MPbox \fi
+\ifdefined\MPbox\else \newbox\MPbox\fi
\permanent\protected\def\setMPboundingbox#1#2#3#4% at some point we might pass them as base or scaled points
{\global\MPllx #1\onebasepoint
@@ -46,7 +46,7 @@
\global\MPurx \zeropoint
\global\MPury \zeropoint}
-\aliased\let\popMPboundingbox\relax
+\permanent\protected\lettonothing\popMPboundingbox
\permanent\protected\def\pushMPboundingbox
{\enforced\permanent\protected\edef\popMPboundingbox
@@ -88,14 +88,23 @@
% MPLIB specific:
+% \permanent\protected\def\startMPLIBtoPDF#1#2#3#4%
+% {\meta_process_graphic_figure_start
+% \dostarttagged\t!mpgraphic\empty
+% \naturalhpack attr \imageattribute \plusone \bgroup
+% \dousecolorparameter\s!black\forcecolorhack
+% \setMPboundingbox{#1}{#2}{#3}{#4}%
+% \setbox\MPbox\vpack\bgroup
+% % \forgetall % already done elsewhere
+% \noindent} % forces the proper cm in the backend
+
\permanent\protected\def\startMPLIBtoPDF#1#2#3#4%
{\meta_process_graphic_figure_start
\dostarttagged\t!mpgraphic\empty
\naturalhpack attr \imageattribute \plusone \bgroup
- \dousecolorparameter\s!black\forcecolorhack
+ \dousecolorparameter\s!black
\setMPboundingbox{#1}{#2}{#3}{#4}%
\setbox\MPbox\vpack\bgroup
- % \forgetall % already done elsewhere
\noindent} % forces the proper cm in the backend
\permanent\protected\def\stopMPLIBtoPDF
diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-pos.lmt b/Master/texmf-dist/tex/context/base/mkxl/mlib-pos.lmt
new file mode 100644
index 00000000000..fd54d7b5fd0
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-pos.lmt
@@ -0,0 +1,63 @@
+if not modules then modules = { } end modules ['mlib-pos'] = {
+ version = 1.001,
+ comment = "companion to mlib-ctx.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files",
+}
+
+local jobpositions = job.positions
+local mpnumeric = mp.inject.numeric
+local mpstring = mp.inject.string
+local scanstring = mp.scan.string
+local factor = number.dimenfactors.bp
+local registerdirect = metapost.registerdirect
+
+local page = jobpositions.page
+local paragraph = jobpositions.paragraph
+local column = jobpositions.column
+local region = jobpositions.region
+local x = jobpositions.x
+local y = jobpositions.y
+local xy = jobpositions.xy
+local width = jobpositions.width
+local height = jobpositions.height
+local depth = jobpositions.depth
+local leftskip = jobpositions.leftskip
+local rightskip = jobpositions.rightskip
+local hsize = jobpositions.hsize
+local parindent = jobpositions.parindent
+local hangindent = jobpositions.hangindent
+local hangafter = jobpositions.hangafter
+local lowerleft = jobpositions.lowerleft
+local upperleft = jobpositions.upperleft
+local lowerright = jobpositions.lowerright
+local upperright = jobpositions.upperright
+
+registerdirect("getpospage", function() return page (scanstring()) end)
+registerdirect("getposparagraph", function() return paragraph (scanstring()) end)
+registerdirect("getposcolumn", function() return column (scanstring()) end)
+registerdirect("getposregion", function() return region (scanstring()) end)
+registerdirect("getposx", function() return x (scanstring()) * factor end)
+registerdirect("getposy", function() return y (scanstring()) * factor end)
+registerdirect("getposwidth", function() return width (scanstring()) * factor end)
+registerdirect("getposheight", function() return height (scanstring()) * factor end)
+registerdirect("getposdepth", function() return depth (scanstring()) * factor end)
+registerdirect("getposleftskip", function() return leftskip (scanstring()) * factor end)
+registerdirect("getposrightskip", function() return rightskip (scanstring()) * factor end)
+registerdirect("getposhsize", function() return hsize (scanstring()) * factor end)
+registerdirect("getposparindent", function() return parindent (scanstring()) * factor end)
+registerdirect("getposhangindent", function() return hangindent(scanstring()) * factor end)
+registerdirect("getposhangafter", function() return hangafter (scanstring()) * factor end)
+
+local t = { 0, 0 } -- let's share
+
+registerdirect("getposxy", function() local x, y = xy (scanstring()) t[1] = x * factor t[2] = y * factor return t end)
+registerdirect("getposupperleft", function() local x, y = upperleft (scanstring()) t[1] = x * factor t[2] = y * factor return t end)
+registerdirect("getposlowerleft", function() local x, y = lowerleft (scanstring()) t[1] = x * factor t[2] = y * factor return t end)
+registerdirect("getposupperright", function() local x, y = upperright(scanstring()) t[1] = x * factor t[2] = y * factor return t end)
+registerdirect("getposlowerright", function() local x, y = lowerright(scanstring()) t[1] = x * factor t[2] = y * factor return t end)
+registerdirect("getposllx", function() local x, y = lowerleft (scanstring()) return x * factor end)
+registerdirect("getposlly", function() local x, y = lowerleft (scanstring()) return y * factor end)
+registerdirect("getposurx", function() local x, y = upperright(scanstring()) return x * factor end)
+registerdirect("getposury", function() local x, y = upperright(scanstring()) return y * factor end)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-pps.lmt b/Master/texmf-dist/tex/context/base/mkxl/mlib-pps.lmt
index 32f23c39d27..b8f448964d3 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/mlib-pps.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-pps.lmt
@@ -6,14 +6,15 @@ if not modules then modules = { } end modules ['mlib-pps'] = {
license = "see context related readme files",
}
+local next = next
local format, gmatch, match, split, gsub = string.format, string.gmatch, string.match, string.split, string.gsub
local tonumber, type, unpack, next, select = tonumber, type, unpack, next, select
-local round, sqrt, min, max = math.round, math.sqrt, math.min, math.max
+local round, sqrt, min, max, abs = math.round, math.sqrt, math.min, math.max, math.abs
local insert, remove, concat = table.insert, table.remove, table.concat
local Cs, Cf, C, Cg, Ct, P, S, V, Carg = lpeg.Cs, lpeg.Cf, lpeg.C, lpeg.Cg, lpeg.Ct, lpeg.P, lpeg.S, lpeg.V, lpeg.Carg
local lpegmatch, tsplitat, tsplitter = lpeg.match, lpeg.tsplitat, lpeg.tsplitter
-local formatters = string.formatters
-local exists, savedata = io.exists, io.savedata
+local formatters, toboolean = string.formatters, string.toboolean
+local stepper = utilities.parsers.stepper
local mplib = mplib
local metapost = metapost
@@ -28,7 +29,7 @@ local mpscannumeric = scan.numeric
local injecttriplet = inject.triplet
-local registerscript = metapost.registerscript
+local registerdirect = metapost.registerdirect
local implement = interfaces.implement
local setmacro = interfaces.setmacro
@@ -36,8 +37,8 @@ local setmacro = interfaces.setmacro
local texsetbox = tex.setbox
local textakebox = tex.takebox -- or: nodes.takebox
local texrunlocal = tex.runlocal
-local copy_list = node.copy_list
-local flush_list = node.flush_list
+local copylist = nodes.copylist
+local flushlist = nodes.flushlist
local setmetatableindex = table.setmetatableindex
local sortedhash = table.sortedhash
@@ -115,7 +116,8 @@ local f_scn = formatters["%.3N"]
local f_shade = formatters["MpSh%s"]
local f_spot = formatters["/%s cs /%s CS %s SCN %s scn"]
-local s_cm_e = "Q"
+
+local s_cm_e <const> = "Q"
local function checked_color_pair(color,...)
if not color then
@@ -256,6 +258,8 @@ local function preset(t,k)
return v
end
+-- todo: nested startMPcode .. stopMPcode does weird
+
local function startjob(plugmode,kind,mpx)
insert(stack,top)
top = {
@@ -281,7 +285,7 @@ local function stopjob()
if top then
for slot, content in next, top.textexts do
if content then
- flush_list(content)
+ flushlist(content)
if trace_textexts then
report_textexts("freeing text %s",slot)
end
@@ -387,7 +391,7 @@ function models.rgb(cr)
elseif metapost.reducetogray then
if n == 1 then
local s = cr[1]
- checked_color_pair(f_gray,s,s)
+ return checked_color_pair(f_gray,s,s)
elseif n == 3 then
local r = cr[1]
local g = cr[2]
@@ -525,9 +529,9 @@ metapost.sxsy = sxsy
-- for stock mp we need to declare the booleans first
-local do_begin_fig = "; beginfig(1) ; "
-local do_end_fig = "; endfig ;"
-local do_safeguard = ";"
+local do_begin_fig <const> = "; beginfig(1) ; "
+local do_end_fig <const> = "; endfig ;"
+local do_safeguard <const> = ";"
function metapost.preparetextextsdata()
local textexts = top.textexts
@@ -566,7 +570,7 @@ local function checkaskedfig(askedfig) -- return askedfig, wrappit
end
-- This one is called from the \TEX\ end so the specification is different
--- from the specification to metapost,run cum suis! The definitions and
+-- from the specification to metapost.run cum suis! The definitions and
-- extension used to be handled here but are now delegated to the format
-- initializers because we need to accumulate them for nested instances (a
-- side effect of going single pass).
@@ -576,6 +580,7 @@ function metapost.graphic_base_pass(specification)
local top = startjob(true,"base",mpx)
local data = specification.data or ""
local inclusions = specification.inclusions or ""
+ local filtering = specification.filtering
local initializations = specification.initializations or ""
local askedfig,
wrappit = checkaskedfig(specification.figure)
@@ -587,6 +592,15 @@ function metapost.graphic_base_pass(specification)
top.mpx = mpx
top.data = data
top.initializations = initializations
+ if filtering then
+ if #filtering > 0 then
+ local t = { }
+ stepper(filtering,function(k) t[k] = true end)
+ filtering = next(t) and t or false
+ else
+ filtering = false
+ end
+ end
if trace_runs then
report_metapost("running job %s, asked figure %a",nofruns,askedfig)
end
@@ -594,6 +608,7 @@ function metapost.graphic_base_pass(specification)
mpx = mpx,
askedfig = askedfig,
incontext = true,
+ filtering = filtering,
data = {
inclusions,
wrappit and do_begin_fig or "",
@@ -709,15 +724,16 @@ function metapost.processplugins(object) -- each object (second pass)
if top and top.plugmode then
local prescript = object.prescript -- specifications
if prescript and #prescript > 0 then
- local before = { }
- local after = { }
- processoractions.runner(object,splitprescript(prescript) or { },before,after)
- return #before > 0 and before, #after > 0 and after
+ local before = { }
+ local after = { }
+ local options = splitprescript(prescript) or { }
+ processoractions.runner(object,options,before,after)
+ return #before > 0 and before, #after > 0 and after, options
else
local c = object.color
if c and #c > 0 then
local b, a = colorconverter(c)
- return { b }, { a }
+ return { b }, { a }, { }
end
end
end
@@ -742,7 +758,7 @@ local function cm(object)
local ry = fourth.x_coord - tx
if sx == 0 then sx = 0.00001 end
if sy == 0 then sy = 0.00001 end
- return sx, rx, ry, sy, tx, ty
+ return sx, rx, ry, sy, tx, ty -- different order elsewhere !
end
end
return 1, 0, 0, 1, 0, 0 -- weird case
@@ -760,6 +776,10 @@ end
local tx_reset, tx_process do
+ -- The dilemma is that we need to process the text in order to know the
+ -- dimensions but afterwards also need to apply color and such. So, we need
+ -- two passes, one immediately and one when we use it.
+
local eol = S("\n\r")^1
local cleaner = Cs((P("@@")/"@" + P("@")/"%%" + P(1))^0)
local splitter = Ct(
@@ -859,8 +879,8 @@ local tx_reset, tx_process do
mf_some_text(index,madetext,catcodes.numbers.ctxcatcodes) -- btex/etex ..
end
- registerscript("sometextext", function() mf_some_text(mpscannumeric(),mpscanstring(),mpscannumeric()) end)
- registerscript("madetextext", function() mf_made_text(mpscannumeric()) end)
+ registerdirect("sometextext", function() mf_some_text(mpscannumeric(),mpscanstring(),mpscannumeric()) end)
+ registerdirect("madetextext", function() mf_made_text(mpscannumeric()) end)
-- a label can be anything, also something mp doesn't like in strings
-- so we return an index instead
@@ -1014,6 +1034,10 @@ local tx_reset, tx_process do
end
end
+ local fasttrack = false -- we loose colors done with withcolor when true
+
+ directives.register("metapost.text.fasttrack", function(v) fasttrack = v end)
+
tx_process = function(object,prescript,before,after)
local data = top.texdata[metapost.properties.number] -- the current figure number, messy
local index = tonumber(prescript.tx_index)
@@ -1039,9 +1063,14 @@ local tx_reset, tx_process do
local mp_text = top.texstrings[mp_index]
local mp_hash = prescript.tx_cache
local box
+ local donebox = fasttrack and top.textexts[mp_index]
if mp_hash == "no" then
- texrunlocal("mptexttoks")
- box = textakebox("mptextbox")
+ if donebox then
+ box = copylist(donebox)
+ else
+ texrunlocal("mptexttoks")
+ box = textakebox("mptextbox")
+ end
else
local cache = data.texhash
if mp_hash then
@@ -1071,10 +1100,14 @@ local tx_reset, tx_process do
end
box = cache[mp_hash]
if box then
- box = copy_list(box)
+ box = copylist(box)
else
- texrunlocal("mptexttoks")
- box = textakebox("mptextbox")
+ if donebox then
+ box = copylist(donebox)
+ else
+ texrunlocal("mptexttoks")
+ box = textakebox("mptextbox")
+ end
cache[mp_hash] = box
end
end
@@ -1220,7 +1253,10 @@ local function sh_process(object,prescript,before,after)
end
end
end
-
+-- local transformation = prescript.sh_transformation
+-- if transformation then
+-- print("todo: " .. transformation)
+-- end
local steps = tonumber(prescript.sh_step) or 1
local sh_color_a = prescript.sh_color_a_1 or prescript.sh_color_a or "1"
local sh_color_b = prescript.sh_color_b_1 or prescript.sh_color_b or "1" -- sh_color_b_<sh_steps>
@@ -1303,18 +1339,25 @@ end
local function bm_process(object,prescript,before,after)
local bm_xresolution = prescript.bm_xresolution
+ local bm_yresolution = prescript.bm_yresolution
if bm_xresolution then
- before[#before+1] = f_cm_b(cm(object))
+-- before[#before+1] = f_cm_b(cm(object))
+local sx, rx, ry, sy, tx, ty = cm(object)
+local postscript = object.postscript
before[#before+1] = function()
- figures.bitmapimage {
- xresolution = tonumber(bm_xresolution),
- yresolution = tonumber(prescript.bm_yresolution),
- width = 1/basepoints,
- height = 1/basepoints,
- data = object.postscript
- }
+context.MPLIBscaledcm(function()
+ figures.bitmapimage {
+ xresolution = tonumber(bm_xresolution),
+ yresolution = tonumber(bm_yresolution),
+ width = 1/basepoints,
+ height = 1/basepoints,
+ data = postscript,
+ format = "png",
+ }
+ end
+, sx, rx, ry, sy, tx, ty)
end
- before[#before+1] = s_cm_e
+-- before[#before+1] = s_cm_e
object.path = false
object.color = false
object.grouped = true
@@ -1326,16 +1369,24 @@ end
local function ps_process(object,prescript,before,after)
local ps_label = prescript.ps_label
if ps_label then
- local op = object.path
- local first = op[1]
- local third = op[3]
- local x = first.x_coord
- local y = first.y_coord
- local w = third.x_coord - x
- local h = third.y_coord - y
- local properties = metapost.properties
- x = x - properties.llx
- y = properties.ury - y
+ local op = object.path
+ local first = op[1]
+ local third = op[3]
+ local x, y, w, h
+ if first and third then
+ local properties = metapost.properties
+ x = first.x_coord
+ y = first.y_coord
+ w = third.x_coord - x
+ h = third.y_coord - y
+ x = x - properties.llx
+ y = properties.ury - y
+ else
+ x = 0
+ y = 0
+ w = 0
+ h = 0
+ end
before[#before+1] = function()
context.MPLIBpositionwhd(ps_label,x,y,w,h)
end
@@ -1456,6 +1507,8 @@ local function tr_process(object,prescript,before,after)
sp_specs = concat(sp_specs,",")
definemultitonecolor(sp_name,sp_specs,"","")
sp_type = "named"
+ elseif sp_type == "named" then
+ cs = { 1 } -- factor 1
end
if sp_type == "named" then
-- we might move this to another namespace .. also, named can be a spotcolor
@@ -1526,21 +1579,29 @@ end
-- groups
+local function getcorners(path)
+-- if #path == 1 then
+-- return 0, 0, 0, 0
+-- else
+ local p1 = path[1]
+ local p2 = path[2]
+ local p3 = path[3]
+ local p4 = path[4]
+ return
+ min(p1.x_coord,p2.x_coord,p3.x_coord,p4.x_coord),
+ min(p1.y_coord,p2.y_coord,p3.y_coord,p4.y_coord),
+ max(p1.x_coord,p2.x_coord,p3.x_coord,p4.x_coord),
+ max(p1.y_coord,p2.y_coord,p3.y_coord,p4.y_coord)
+-- end
+end
+
local function gr_process(object,prescript,before,after)
local gr_state = prescript.gr_state
if not gr_state then
return
elseif gr_state == "start" then
local gr_type = utilities.parsers.settings_to_set(prescript.gr_type)
- local path = object.path
- local p1 = path[1]
- local p2 = path[2]
- local p3 = path[3]
- local p4 = path[4]
- local llx = min(p1.x_coord,p2.x_coord,p3.x_coord,p4.x_coord)
- local lly = min(p1.y_coord,p2.y_coord,p3.y_coord,p4.y_coord)
- local urx = max(p1.x_coord,p2.x_coord,p3.x_coord,p4.x_coord)
- local ury = max(p1.y_coord,p2.y_coord,p3.y_coord,p4.y_coord)
+ local llx, lly, urx, ury = getcorners(object.path)
before[#before+1] = function()
context.MPLIBstartgroup(
gr_type.isolated and 1 or 0,
@@ -1558,6 +1619,46 @@ local function gr_process(object,prescript,before,after)
object.grouped = true
end
+-- patterns
+
+local pattern_index = 0
+
+local function pt_process(object,prescript,before,after)
+ local pt_state = prescript.pt_state
+ if not pt_state then
+ return
+ else
+ local pt_action = prescript.pt_action
+ if pt_state == "start" then
+ local float = toboolean(prescript.pt_float) and 1 or 0
+ local llx, lly, urx, ury = getcorners(object.path)
+ if abs(llx) < 0.0001 then llx = 0 end
+ if abs(lly) < 0.0001 then lly = 0 end
+ if abs(urx) < 0.0001 then urx = 0 end
+ if abs(ury) < 0.0001 then ury = 0 end
+ before[#before+1] = function()
+ if pt_action == "set" then
+ pattern_index = pattern_index + 1
+ context.MPLIBstartsetpattern(pattern_index, llx, lly, urx, ury, float)
+ else
+ context.MPLIBstartgetpattern(pattern_index, llx, lly, urx, ury, float)
+ end
+ end
+ elseif pt_state == "stop" then
+ after[#after+1] = function()
+ if pt_action == "set" then
+ context.MPLIBstopsetpattern()
+ else
+ context.MPLIBstopgetpattern()
+ end
+ end
+ end
+ end
+ object.path = false
+ object.color = false
+ object.grouped = true
+end
+
-- outlines
local ot_reset, ot_process do
@@ -1637,6 +1738,7 @@ installplugin { name = "outline", reset = ot_reset, process = ot_process }
installplugin { name = "color", reset = cl_reset, process = cl_process }
installplugin { name = "text", reset = tx_reset, process = tx_process }
installplugin { name = "group", reset = gr_reset, process = gr_process }
+installplugin { name = "pattern", reset = pt_reset, process = pt_process }
installplugin { name = "graphictext", reset = gt_reset, process = gt_process }
installplugin { name = "shade", reset = sh_reset, process = sh_process }
installplugin { name = "bitmap", reset = bm_reset, process = bm_process }
diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-pps.mkxl b/Master/texmf-dist/tex/context/base/mkxl/mlib-pps.mkxl
index 2fa721445e8..521865e08cb 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/mlib-pps.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-pps.mkxl
@@ -76,15 +76,24 @@
\aliased\let\MPLIBsettextX\MPLIBsetNtextX
+% \permanent\permanent\protected\def\MPLIBgettextscaled#1#2#3% why a copy .. can be used more often
+% {\clf_mpgettext\MPtextbox #1%
+% \vpack to \zeropoint
+% {\vss
+% %\hpack to \zeropoint \s!container
+% \hcontainer to \zeropoint
+% {\scale
+% [\c!sx=#2,\c!sy=#3]%
+% {\raise\dp\MPtextbox\box\MPtextbox}\forcecolorhack\hss}}}
+
\permanent\permanent\protected\def\MPLIBgettextscaled#1#2#3% why a copy .. can be used more often
{\clf_mpgettext\MPtextbox #1%
\vpack to \zeropoint
{\vss
- %\hpack to \zeropoint \s!container
\hcontainer to \zeropoint
{\scale
[\c!sx=#2,\c!sy=#3]%
- {\raise\dp\MPtextbox\box\MPtextbox}\forcecolorhack\hss}}}
+ {\raise\dp\MPtextbox\box\MPtextbox}\hss}}}
\let\mlib_sx\!!zerocount % set at the lua end
\let\mlib_sy\!!zerocount % set at the lua end
@@ -99,24 +108,37 @@
% horrible (we could inline scale and matrix code):
+% \permanent\protected\def\MPLIBgettextscaledcm#1#2#3#4#5#6#7#8#9% 2-7: sx,rx,ry,sy,tx,ty
+% {\clf_mpgettext\MPtextbox #1%
+% \setbox\MPbox\hpack\bgroup
+% \dotransformnextbox{#2}{#3}{#4}{#5}{#6}{#7}% does push pop ... will be changed to proper lua call (avoid small numbers)
+% \vpack to \zeropoint\bgroup
+% \vss
+% %\hpack to \zeropoint \s!container \bgroup
+% \hcontainer to \zeropoint \bgroup
+% % \scale[\c!sx=#8,\c!sy=#9]{\raise\dp\MPtextbox\box\MPtextbox}%
+% % \scale[\c!sx=#8,\c!sy=#9,\c!depth=\v!no]{\box\MPtextbox}%
+% \fastsxsy{#8}{#9}{\raise\dp\MPtextbox\box\MPtextbox}%
+% % This gives: LuaTeX warning: Misplaced \pdfrestore .. don't ask me why.
+% % but I'll retry it some day soon.
+% % \dostartscaling{#8}{#9}%
+% % \raise\dp\MPtextbox\box\MPtextbox
+% % \dostopscaling
+% \forcecolorhack % can go away ... already in the scale macro
+% \hss
+% \egroup
+% \egroup
+% \egroup
+% \smashbox\MPbox
+% \box\MPbox}
+
\permanent\protected\def\MPLIBgettextscaledcm#1#2#3#4#5#6#7#8#9% 2-7: sx,rx,ry,sy,tx,ty
{\clf_mpgettext\MPtextbox #1%
\setbox\MPbox\hpack\bgroup
\dotransformnextbox{#2}{#3}{#4}{#5}{#6}{#7}% does push pop ... will be changed to proper lua call (avoid small numbers)
\vpack to \zeropoint\bgroup
- \vss
- %\hpack to \zeropoint \s!container \bgroup
- \hcontainer to \zeropoint \bgroup
- % \scale[\c!sx=#8,\c!sy=#9]{\raise\dp\MPtextbox\box\MPtextbox}%
- % \scale[\c!sx=#8,\c!sy=#9,\c!depth=\v!no]{\box\MPtextbox}%
- \fastsxsy{#8}{#9}{\raise\dp\MPtextbox\box\MPtextbox}%
- % This gives: LuaTeX warning: Misplaced \pdfrestore .. don't ask me why.
- % but I'll retry it some day soon.
- % \dostartscaling{#8}{#9}%
- % \raise\dp\MPtextbox\box\MPtextbox
- % \dostopscaling
- \forcecolorhack % can go away ... already in the scale macro
- \hss
+ \vss \hcontainer to \zeropoint \bgroup
+ \fastsxsy{#8}{#9}{\raise\dp\MPtextbox\box\MPtextbox}\hss
\egroup
\egroup
\egroup
@@ -150,6 +172,23 @@
\box\MPbox
\endgroup}
+\permanent\protected\def\MPLIBscaledcm#1#2#3#4#5#6#7% 2-7: sx,rx,ry,sy,tx,ty
+ {\begingroup
+% \setbox\MPbox
+ \hpack\bgroup
+ \dotransformnextbox{#2}{#3}{#4}{#5}{#6}{#7}%
+ %\dotransformnextbox{\luaexpr{#2/10}}{\luaexpr{#3/10}}{\luaexpr{#4/10}}{\luaexpr{#5/10}}{\luaexpr{#6/10}}{\luaexpr{#7/10}}%
+ \vpack to \zeropoint\bgroup
+ \vss
+ \hcontainer to \zeropoint \bgroup
+ #1\hss % used for mp bitmaps
+ %\fastsxsy{10}{10}{#1}\hss
+ \egroup
+ \egroup
+ \egroup
+% \smashbox\MPbox\box\MPbox
+ \endgroup}
+
\permanent\protected\def\MPLIBgraphictext#1% use at mp end
{\startTEXpage[\c!scale=10000]#1\stopTEXpage}
@@ -207,14 +246,55 @@
\box\scratchbox
\endgroup}
-\aliased\let\MPLIBstopgroup\relax
+\permanent\protected\lettonothing\MPLIBstopgroup
\permanent\protected\def\MPLIBstartgroup#1#2#3#4#5#6% isolated 0/1, knockout 0/1 llx lly urx ury
{\begingroup
\setbox\scratchbox\hpack\bgroup
\enforced\permanent\protected\def\MPLIBstopgroup{\mlib_stop_group{#1}{#2}{#3}{#4}{#5}{#6}}}
-% For now here ... will be cleaned up:
+%D Not that much code is needed because we already have a mechanism already. For
+%D some reason there is no option to use the current positions (pattern space mess)
+%D so we need a position. I could delegate this to the backend but patterns are
+%D selsom used.
+
+\permanent\protected\def\MPLIBstartsetpattern#1#2#3#4#5#6%
+ {\normalexpanded{\registerpattern[mp-pattern-#1]\ifnum#6=\zerocount[hoffset=\MPx{mp-pattern-#1},voffset=\MPy{mp-pattern-#1}]\fi}%
+ \bgroup
+ \dowithnextbox{%
+ \boxxoffset\nextbox-#2\onebasepoint
+ \boxyoffset\nextbox-#3\onebasepoint
+ \wd\nextbox\dimexpr#4\onebasepoint-#2\onebasepoint\relax
+ \ht\nextbox\dimexpr#5\onebasepoint-#3\onebasepoint\relax
+ \box\nextbox}%
+ \hpack\bgroup}
+
+\permanent\protected\def\MPLIBstopsetpattern
+ {\egroup
+ \egroup}
+
+\permanent\protected\def\MPLIBstartgetpattern#1#2#3#4#5#6%
+ {\setbox\nextbox\hpack\bgroup
+ \applypattern
+ [\c!name=mp-pattern-#1,
+% \c!width=2\dimexpr#4\onebasepoint-#2\onebasepoint\relax,
+ \c!width=\dimexpr#4\onebasepoint-#2\onebasepoint\relax,
+% \c!height=2\dimexpr#5\onebasepoint-#3\onebasepoint\relax]%
+ \c!height=\dimexpr#5\onebasepoint-#3\onebasepoint\relax]%
+ \hss
+ \egroup
+ % \boxyoffset\nextbox -.5\dimexpr#5\onebasepoint-#3\onebasepoint\relax
+ \boxyoffset\nextbox \dimexpr#3\onebasepoint\relax
+ % \boxxoffset\nextbox -.5\dimexpr#4\onebasepoint-#2\onebasepoint\relax
+ \boxxoffset\nextbox \dimexpr#2\onebasepoint\relax
+ \ht\nextbox\zeropoint
+ \wd\nextbox\zeropoint
+ \dp\nextbox\zeropoint
+ \normalexpanded{\ifnum#6=\zerocount\hpos{mp-pattern-#1}\fi}{\box\nextbox}}
+
+\permanent\protected\lettonothing\MPLIBstopgetpattern
+
+% For now here ... will be cleaned up and become macro calls instead:
\newtoks\mptexttoks
\newbox \mptextbox
diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-run.lmt b/Master/texmf-dist/tex/context/base/mkxl/mlib-run.lmt
index eacb148cc6c..0e955818e19 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/mlib-run.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-run.lmt
@@ -38,9 +38,13 @@ local emptystring = string.is_empty
local trace_graphics = false trackers.register("metapost.graphics", function(v) trace_graphics = v end)
local trace_tracingall = false trackers.register("metapost.tracingall", function(v) trace_tracingall = v end)
-local report_metapost = logs.reporter("metapost")
local texerrormessage = logs.texerrormessage
+local report_metapost = logs.reporter("metapost")
+local report_terminal = logs.reporter("metapost","terminal")
+local report_tracer = logs.reporter("metapost","trace")
+local report_error = logs.reporter("metapost","error")
+
local starttiming = statistics.starttiming
local stoptiming = statistics.stoptiming
@@ -90,17 +94,7 @@ local function prepareddata(data)
end
end
--- local function executempx(mpx,data)
--- local terminal = mpxterminals[mpx]
--- if terminal then
--- terminal.writer(data)
--- data = ""
--- elseif type(data) == "table" then
--- data = prepareddata(data,collapse)
--- end
--- metapost.nofruns = metapost.nofruns + 1
--- return mpx:execute(data)
--- end
+local execute = mplib.execute
local function executempx(mpx,data)
local terminal = mpxterminals[mpx]
@@ -111,7 +105,8 @@ local function executempx(mpx,data)
data = prepareddata(data,collapse)
end
metapost.nofruns = metapost.nofruns + 1
- return mpx:execute(data)
+ local result = execute(mpx,data)
+ return result
end
directives.register("mplib.texerrors", function(v) metapost.texerrors = v end)
@@ -184,6 +179,34 @@ end
local seed = nil
+local default_tolerance = 131/65536.0 -- a little below 0.001 * 0x7FFF/0x4000
+local bend_tolerance = default_tolerance
+local move_tolerance = default_tolerance
+
+----- bend_tolerance = 10/2000
+----- move_tolerance = bend_tolerance
+
+function metapost.setbendtolerance(t)
+ bend_tolerance = t or default_tolerance
+end
+function metapost.setmovetolerance(t)
+ move_tolerance = t or default_tolerance
+end
+function metapost.settolerance(t)
+ bend_tolerance = t or default_tolerance
+ move_tolerance = t or default_tolerance
+end
+
+function metapost.getbendtolerance()
+ return bend_tolerance
+end
+function metapost.getmovetolerance()
+ return move_tolerance
+end
+function metapost.gettolerance(t)
+ return bend_tolerance, move_tolerance
+end
+
function metapost.load(name,method)
starttiming(mplib)
if not seed then
@@ -196,16 +219,18 @@ function metapost.load(name,method)
end
method = method and methods[method] or "scaled"
local mpx, terminal = new_instance {
--- noninteractive = true;
--- ini_version = true,
- math_mode = method,
- run_script = metapost.runscript,
- script_error = metapost.scripterror,
- make_text = metapost.maketext,
- extensions = 1,
- -- random_seed = seed,
- utf8_mode = true,
- text_mode = true,
+ bendtolerance = bend_tolerance,
+ movetolerance = move_tolerance,
+ mathmode = method,
+ runscript = metapost.runscript,
+ runinternal = metapost.runinternal,
+ scripterror = metapost.scripterror,
+ maketext = metapost.maketext,
+ handlers = {
+ log = metapost.newlogger(),
+ -- warning = function(...) end,
+ -- error = function(...) end,
+ },
}
report_metapost("initializing number mode %a",method)
local result
@@ -369,180 +394,178 @@ function metapost.reset(mpx)
end
end
-local mp_tra = { }
-local mp_tag = 0
+if not metapost.process then
--- key/values
+ function metapost.process(specification)
+ metapost.run(specification)
+ end
-do
+end
- local stack, top = { }, nil
+-- run, process, convert and flush all work with a specification with the
+-- following (often optional) fields
+--
+-- mpx string or mp object
+-- data string or table of strings
+-- flusher table with flush methods
+-- askedfig string ("all" etc) or number
+-- incontext boolean
+-- plugmode boolean
- function metapost.setvariable(k,v)
- if top then
- top[k] = v
- else
- metapost.variables[k] = v
- end
- end
+do
- function metapost.pushvariable(k)
- local t = { }
- if top then
- insert(stack,top)
- top[k] = t
- else
- metapost.variables[k] = t
- end
- top = t
+ local function makebeginbanner(specification)
+ return formatters["%% begin graphic: n=%s\n\n"](metapost.n)
end
- function metapost.popvariable()
- top = remove(stack)
+ local function makeendbanner(specification)
+ return "\n% end graphic\n\n"
end
- local stack = { }
+ -- This is somewhat complex. We want a logger that is bound to an instance and
+ -- we implement the rest elsewhere so we need some hook. When we decide to move
+ -- the mlib-fio code here we can avoid some of the fuzzyness.
- function metapost.pushvariables()
- insert(stack,metapost.variables)
- metapost.variables = { }
- end
+ -- In the luatex lib we have log and error an dterm fields, but here we don't
+ -- because we handle that ourselves.
- function metapost.popvariables()
- metapost.variables = remove(stack) or metapost.variables
- end
+ -- mplib.realtimelogging = false
-end
+ local mp_tra = { }
+ local mp_tag = 0
+ local stack = { }
+ local logger = false
+ local logging = true
-if not metapost.process then
+ local function pushlogger(mpx,tra)
+ insert(stack,logger)
+ logger = tra or false
+ end
- function metapost.process(specification)
- metapost.run(specification)
+ local function poplogger(mpx)
+ logger = remove(stack) or false
end
-end
+ function metapost.checktracingonline(n)
+ -- todo
+ end
--- run, process, convert and flush all work with a specification with the
--- following (often optional) fields
---
--- mpx string or mp object
--- data string or table of strings
--- flusher table with flush methods
--- askedfig string ("all" etc) or number
--- incontext boolean
--- plugmode boolean
+ function metapost.setlogging(state)
+ logging = state
+ end
-local function makebeginbanner(specification)
- return formatters["%% begin graphic: n=%s\n\n"](metapost.n)
-end
+ function metapost.newlogger()
-local function makeendbanner(specification)
- return "\n% end graphic\n\n"
-end
+ -- In a traditional scenario there are three states: terminal, log as well
+ -- as both. The overhead of logging is large because metapost flushes each
+ -- character (maybe that should be improved but caching at the libs end also
+ -- has price, probably more than delegating to LUA).
-function metapost.run(specification)
- local mpx = specification.mpx
- local data = specification.data
- local converted = false
- local result = { }
- local mpxdone = type(mpx) == "string"
- if mpxdone then
- mpx = metapost.pushformat { instance = mpx, format = mpx }
- end
- if mpx and data then
- local tra = nil
- starttiming(metapost) -- why not at the outer level ...
- metapost.variables = { } -- todo also push / pop
- metapost.pushscriptrunner(mpx)
- if trace_graphics then
- tra = mp_tra[mpx]
- if not tra then
- mp_tag = mp_tag + 1
- local jobname = tex.jobname
- tra = {
- inp = io.open(formatters["%s-mplib-run-%03i.mp"] (jobname,mp_tag),"w"),
- log = io.open(formatters["%s-mplib-run-%03i.log"](jobname,mp_tag),"w"),
- }
- mp_tra[mpx] = tra
+ -- term=1 log=2 term+log =3
+
+ local l, nl, dl = { }, 0, false
+
+ return function(target,str)
+ if not logging then
+ return
+ elseif target == 4 then
+ report_error(str)
+ else
+ if logger and (target == 2 or target == 3) then
+ logger:write(str)
+ end
+ if target == 1 or target == 3 then
+ if str == "\n" then
+ mplib.realtimelogging = true
+ if nl > 0 then
+ report_tracer(concat(l,"",1,nl))
+ nl, dl = 0, false
+ elseif not dl then
+ report_tracer("")
+ dl = true
+ end
+ else
+ nl = nl + 1
+ l[nl] = str
+ end
+ end
end
- local banner = makebeginbanner(specification)
- tra.inp:write(banner)
- tra.log:write(banner)
end
- local function process(d,i)
- if d then
+
+ end
+
+ function metapost.run(specification)
+ local mpx = specification.mpx
+ local data = specification.data
+ local converted = false
+ local result = { }
+ local mpxdone = type(mpx) == "string"
+ if mpxdone then
+ mpx = metapost.pushformat { instance = mpx, format = mpx }
+ end
+ if mpx and data then
+ local tra = false
+ starttiming(metapost) -- why not at the outer level ...
+ metapost.variables = { } -- todo also push / pop
+ metapost.pushscriptrunner(mpx)
+ if trace_graphics then
+ tra = mp_tra[mpx]
+ if not tra then
+ mp_tag = mp_tag + 1
+ local jobname = tex.jobname
+ tra = {
+ inp = io.open(formatters["%s-mplib-run-%03i.mp"] (jobname,mp_tag),"w"),
+ log = io.open(formatters["%s-mplib-run-%03i.log"](jobname,mp_tag),"w"),
+ }
+ mp_tra[mpx] = tra
+ end
+ local banner = makebeginbanner(specification)
+ tra.inp:write(banner)
+ tra.log:write(banner)
+ pushlogger(mpx,tra and tra.log)
+ else
+ pushlogger(mpx,false)
+ end
+ if trace_tracingall then
+ executempx(mpx,"tracingall;")
+ end
+ --
+ if data then
if trace_graphics then
- if i then
- tra.inp:write(formatters["\n%% begin snippet %s\n"](i))
- end
- if type(d) == "table" then
- for i=1,#d do
- tra.inp:write(d[i])
+ if type(data) == "table" then
+ for i=1,#data do
+ tra.inp:write(data[i])
end
else
- tra.inp:write(d)
- end
- if i then
- tra.inp:write(formatters["\n%% end snippet %s\n"](i))
+ tra.inp:write(data)
end
end
starttiming(metapost.exectime)
- result = executempx(mpx,d)
+ result = executempx(mpx,data)
stoptiming(metapost.exectime)
- if trace_graphics and result then
- local str = result.log or result.error
- if str and str ~= "" then
- tra.log:write(str)
- end
- end
- if not metapost.reporterror(result) then
- if metapost.showlog then
- -- make function and overload in lmtx
- local str = result.term ~= "" and result.term or "no terminal output"
- if not emptystring(str) then
- metapost.lastlog = metapost.lastlog .. "\n" .. str
- report_metapost("log: %s",str)
- end
- end
- if result.fig then
- converted = metapost.convert(specification,result)
- end
+ if not metapost.reporterror(result) and result.fig then
+ converted = metapost.convert(specification,result)
end
- elseif i then
- report_metapost("error: invalid graphic component %s",i)
else
report_metapost("error: invalid graphic")
end
- end
-
--- local data = prepareddata(data)
- if type(data) == "table" then
- if trace_tracingall then
- executempx(mpx,"tracingall;")
- end
- process(data)
--- for i=1,#data do
--- process(data[i],i)
--- end
- else
- if trace_tracingall then
- data = "tracingall;" .. data
+ --
+ if trace_graphics then
+ local banner = makeendbanner(specification)
+ tra.inp:write(banner)
+ tra.log:write(banner)
end
- process(data)
+ stoptiming(metapost)
+ poplogger()
+ metapost.popscriptrunner()
end
- if trace_graphics then
- local banner = makeendbanner(specification)
- tra.inp:write(banner)
- tra.log:write(banner)
+ if mpxdone then
+ metapost.popformat()
end
- stoptiming(metapost)
- metapost.popscriptrunner()
- end
- if mpxdone then
- metapost.popformat()
+ return converted, result
end
- return converted, result
+
end
if not metapost.convert then
@@ -553,69 +576,6 @@ if not metapost.convert then
end
--- This will be redone as we no longer output svg of ps!
-
--- function metapost.directrun(formatname,filename,outputformat,astable,mpdata)
--- local fullname = file.addsuffix(filename,"mp")
--- local data = mpdata or io.loaddata(fullname)
--- if outputformat ~= "svg" then
--- outputformat = "mps"
--- end
--- if not data then
--- report_metapost("unknown file %a",filename)
--- else
--- local mpx = metapost.checkformat(formatname)
--- if not mpx then
--- report_metapost("unknown format %a",formatname)
--- else
--- report_metapost("processing %a",(mpdata and (filename or "data")) or fullname)
--- local result = executempx(mpx,data)
--- if not result then
--- report_metapost("error: no result object returned")
--- elseif result.status > 0 then
--- report_metapost("error: %s",(result.term or "no-term") .. "\n" .. (result.error or "no-error"))
--- else
--- if metapost.showlog then
--- metapost.lastlog = metapost.lastlog .. "\n" .. result.term
--- report_metapost("info: %s",result.term or "no-term")
--- end
--- local figures = result.fig
--- if figures then
--- local sorted = table.sortedkeys(figures)
--- if astable then
--- local result = { }
--- report_metapost("storing %s figures in table",#sorted)
--- for k=1,#sorted do
--- local v = sorted[k]
--- if outputformat == "mps" then
--- result[v] = figures[v]:postscript()
--- else
--- result[v] = figures[v]:svg() -- (3) for prologues
--- end
--- end
--- return result
--- else
--- local basename = file.removesuffix(file.basename(filename))
--- for k=1,#sorted do
--- local v = sorted[k]
--- local output
--- if outputformat == "mps" then
--- output = figures[v]:postscript()
--- else
--- output = figures[v]:svg() -- (3) for prologues
--- end
--- local outname = formatters["%s-%s.%s"](basename,v,outputformat)
--- report_metapost("saving %s bytes in %a",#output,outname)
--- io.savedata(outname,output)
--- end
--- return #sorted
--- end
--- end
--- end
--- end
--- end
--- end
-
function metapost.directrun(formatname,filename,outputformat,astable,mpdata)
report_metapost("producing postscript and svg is no longer supported")
end
@@ -656,9 +616,6 @@ do
format = "metafun", -- or: minifun
method = "double",
}
--- if not code then
--- code = ""
--- end
metapost.process {
mpx = mpx,
flusher = flusher,
diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-scn.lmt b/Master/texmf-dist/tex/context/base/mkxl/mlib-scn.lmt
index e68abf5873c..ed56e113d00 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/mlib-scn.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-scn.lmt
@@ -28,7 +28,7 @@ if not modules then modules = { } end modules ['mlib-scn'] = {
local type, next, rawget, getmetatable, tonumber = type, next, rawget, getmetatable, tonumber
local byte, gmatch = string.byte, string.gmatch
-local insert, remove = table.insert, table.remove
+local insert, remove, combine = table.insert, table.remove, table.combine
local mplib = mplib
local metapost = metapost
@@ -137,11 +137,6 @@ scanset = function() -- can be optimized, we now read twice
end
end
-local function scan_pair () return scanpair (true) end
-local function scan_color () return scancolor (true) end
-local function scan_cmykcolor() return scancmykcolor(true) end
-local function scan_transform() return scantransform(true) end
-
tokenscanners = {
[leftbrace_code] = scanset,
[numeric_code] = scannumeric,
@@ -154,10 +149,10 @@ typescanners = {
[types.numeric] = scannumeric,
[types.string] = scanstring,
[types.boolean] = scanboolean,
- [types.pair] = scan_pair,
- [types.color] = scan_color,
- [types.cmykcolor] = scan_cmykcolor,
- [types.transform] = scan_transform,
+ [types.pair] = function() return scanpair (true) end,
+ [types.color] = function() return scancolor (true) end,
+ [types.cmykcolor] = function() return scancmykcolor(true) end,
+ [types.transform] = function() return scantransform(true) end,
[types.path] = scanpath,
[types.pen] = scanpen,
}
@@ -167,6 +162,18 @@ table.setmetatableindex(tokenscanners,function()
return typescanners[e] or scanexpression
end)
+scanners.typescanners = typescanners
+scanners.tokenscanners = tokenscanners
+
+scanners.whatever = function()
+ local kind = scantoken(true)
+ if kind == leftdelimiter_code or kind == tag_code or kind == capsule_code then
+ return (typescanners[scanexpression(true)] or scanexpression)()
+ else
+ return tokenscanners[kind]()
+ end
+end
+
-- a key like 'color' has code 'declare'
local function scanparameters(fenced)
@@ -181,18 +188,29 @@ local function scanparameters(fenced)
end
while true do
-- local s = scansymbol()
- local s = scansymbol(false,false)
+ local s = scansymbol(false,false) -- keep expand
if s == close then
break;
elseif s == "," then
-- continue
else
- local t = scantoken(true)
- if t == equals_code or t == colon_code then
+-- local t = scantoken(true)
+-- if t == equals_code or t == colon_code then
+-- -- optional equal or :
+-- scantoken()
+-- else
+-- end
+-- local kind = scantoken(true)
+
+-- test:
+--
+ local kind = scantoken(true)
+ if kind == equals_code or kind == colon_code then
-- optional equal or :
scantoken()
+ local kind = scantoken(true)
end
- local kind = scantoken(true)
+
if kind == leftdelimiter_code or kind == tag_code or kind == capsule_code then
kind = scanexpression(true)
data[s] = (typescanners[kind] or scanexpression)()
@@ -222,23 +240,36 @@ local function get_parameters(nested)
if s == "]" then
break;
elseif s == "," then
- -- continue
- else
- local t = scantoken(true)
- if t == equals_code or t == colon_code then
- -- optional equal or :
- scantoken()
- end
- local kind = scantoken(true)
- if kind == leftdelimiter_code or kind == tag_code or kind == capsule_code then
- kind = scanexpression(true)
- data[s] = (typescanners[kind] or scanexpression)()
- elseif kind == leftbracket_code then
- data[s] = get_parameters(true)
+ goto again
+ elseif s == "[" then
+-- s = scannumeric()
+ s = scaninteger()
+ if scantoken() == rightbracket_code then
+ goto assign
else
- data[s] = tokenscanners[kind]()
+ report("] expected")
end
+ else
+ goto assign
+ end
+ ::assign::
+ local t = scantoken(true)
+ if t == equals_code or t == colon_code then
+ -- optional equal or :
+ scantoken()
end
+ local kind = scantoken(true)
+ if kind == leftdelimiter_code or kind == tag_code or kind == capsule_code then
+ kind = scanexpression(true)
+ data[s] = (typescanners[kind] or scanexpression)()
+ elseif kind == leftbracket_code then
+ data[s] = get_parameters(true)
+ elseif kind == comma_code then
+ goto again
+ else
+ data[s] = tokenscanners[kind]()
+ end
+ ::again::
end
return data
end
@@ -258,7 +289,27 @@ local function getparameters()
setmetatableindex(parameters,presets)
end
namespaces[namespace] = parameters
- --
+end
+
+local function mergeparameters()
+ local namespace = scanstring()
+ local parameters = get_parameters()
+ local target = namespaces[namespace]
+ if target then
+ combine(target,parameters)
+ else
+ -- same as below
+ local presets = presets[namespace]
+ local passed = passed[namespace]
+ if passed then
+ if presets then
+ setmetatableindex(passed,presets)
+ end
+ setmetatableindex(parameters,passed)
+ elseif presets then
+ setmetatableindex(parameters,presets)
+ end
+ end
end
local function applyparameters()
@@ -279,8 +330,9 @@ local function applyparameters()
end
namespaces[namespace] = parameters
-- till here
- mpprint(action)
+ -- mpprint(action)
namespaces = saved
+ return action
end
local knownparameters = { }
@@ -310,14 +362,14 @@ local function collectnames()
local t = scantoken(true)
-- (1) not really needed
if t == numeric_code then
- n = n + 1 l[n] = scaninteger(1)
+ n = n + 1 l[n] = scannumeric(1) -- so a float even if it is an index
elseif t == string_code then
n = n + 1 l[n] = scanstring(1)
elseif t == nullary_code then
n = n + 1 l[n] = scanboolean(1)
elseif t == leftbracket_code then
scantoken() -- leftbacket
- n = n + 1 l[n] = scaninteger(1)
+ n = n + 1 l[n] = scaninteger(1) -- forces an index
scantoken() -- rightbacket
elseif t == leftdelimiter_code or t == tag_code or t == capsule_code then
t = scanexpression(true)
@@ -380,9 +432,11 @@ end
-- todo:
-local function getparameter()
+local function getparameter(v)
local list, n = collectnames()
- local v = namespaces
+ if not v then
+ v = namespaces
+ end
for i=1,n do
local l = list[i]
local vl = v[l]
@@ -399,9 +453,9 @@ local function getparameter()
v = vl
end
if v == nil then
- return injectnumeric(0)
+ return 0
else
- return get(v)
+ return v
end
end
@@ -423,11 +477,12 @@ local function hasparameter()
end
v = vl
end
- if v == nil then
- return injectboolean(false)
- else
- return injectboolean(true)
- end
+ -- if v == nil then
+ -- return injectboolean(false)
+ -- else
+ -- return injectboolean(true)
+ -- end
+ return v ~= nil
end
local function hasoption()
@@ -439,7 +494,8 @@ local function hasoption()
local l = list[i]
local vl = v[l]
if vl == nil then
- return injectboolean(false)
+ -- return injectboolean(false)
+ return false
end
v = vl
end
@@ -450,18 +506,21 @@ local function hasoption()
-- no caching .. slow anyway
local o = list[n]
if v == o then
- return injectboolean(true)
+ -- return injectboolean(true)
+ return true
end
for vv in gmatch(v,"[^%s,]+") do
for oo in gmatch(o,"[^%s,]+") do
if vv == oo then
- return injectboolean(true)
+ -- return injectboolean(true)
+ return true
end
end
end
end
end
- return injectboolean(false)
+ -- return injectboolean(false)
+ return false
end
local function getparameterdefault()
@@ -478,7 +537,8 @@ local function getparameterdefault()
end
end
if vl == nil then
- return injectnumeric(0)
+ -- return injectnumeric(0)
+ return 0
else
if type(vl) == "string" then
local td = type(list[n])
@@ -488,7 +548,8 @@ local function getparameterdefault()
vl = vl == "true"
end
end
- return get(vl)
+ -- return get(vl)
+ return vl
end
else
for i=1,n-1 do
@@ -498,7 +559,8 @@ local function getparameterdefault()
if type(l) == "number" then
vl = v[1]
if vl == nil then
- return get(list[n])
+ -- return get(list[n])
+ return list[n]
end
else
local last = list[n]
@@ -514,26 +576,30 @@ local function getparameterdefault()
local l = list[i]
local vl = v[l]
if vl == nil then
- return injectnumeric(0)
+ -- return injectnumeric(0)
+ return 0
end
v = vl
end
if v == nil then
- return injectnumeric(0)
+ return 0
else
- return get(v)
+ return v
end
end
- return injectnumeric(0)
+ -- return injectnumeric(0)
+ return 0
else
- return get(last)
+ -- return get(last)
+ return last
end
end
end
v = vl
end
if v == nil then
- return get(list[n])
+ -- return get(list[n])
+ return list[n]
else
if type(v) == "string" then
local td = type(list[n])
@@ -543,7 +609,8 @@ local function getparameterdefault()
v = v == "true"
end
end
- return get(v)
+ -- return get(v)
+ return v
end
end
end
@@ -557,7 +624,8 @@ local function getparametercount()
break
end
end
- return injectnumeric(type(v) == "table" and #v or 0)
+ -- return injectnumeric(type(v) == "table" and #v or 0)
+ return type(v) == "table" and #v or 0
end
local function getmaxparametercount()
@@ -588,7 +656,8 @@ local function getmaxparametercount()
end
end
- return injectnumeric(n)
+ -- return injectnumeric(n)
+ return n
end
local validconnectors = {
@@ -603,7 +672,8 @@ local function getparameterpath()
if type(close) == "boolean" then
n = n - 1
else
- close = false
+ -- close = false
+ close = nil
end
local connector = list[n]
if type(connector) == "string" and validconnectors[connector] then
@@ -620,6 +690,11 @@ local function getparameterpath()
end
if type(v) == "table" then
return injectpath(v,connector,close)
+ elseif type(v) == "string" then
+ local code = load("return " .. v)
+ if code then
+ return code()
+ end
else
return injectpair(0,0)
end
@@ -688,28 +763,33 @@ end
-- return false
-- end
-function metapost.scanparameters()
--- scantoken() -- we scan the semicolon
+function metapost.scanparameters(gobblesemicolon)
+ if gobblesemicolon then
+ scantoken() -- we scan the semicolon
+ end
return get_parameters()
end
local registerscript = metapost.registerscript
+local registerdirect = metapost.registerdirect
+local registertokens = metapost.registertokens
-registerscript("getparameters", getparameters)
-registerscript("applyparameters", applyparameters)
-registerscript("presetparameters", presetparameters)
-registerscript("hasparameter", hasparameter)
-registerscript("hasoption", hasoption)
-registerscript("getparameter", getparameter)
-registerscript("getparameterdefault", getparameterdefault)
-registerscript("getparametercount", getparametercount)
-registerscript("getmaxparametercount",getmaxparametercount)
-registerscript("getparameterpath", getparameterpath)
-registerscript("getparameterpen", getparameterpen)
-registerscript("getparametertext", getparametertext)
---------------("getparameteroption", getparameteroption)
-registerscript("pushparameters", pushparameters)
-registerscript("popparameters", popparameters)
+registerdirect("getparameters", getparameters) -- nothing
+registertokens("applyparameters", applyparameters) -- action : todo "token"
+registerdirect("mergeparameters", mergeparameters) -- nothing
+registerdirect("presetparameters", presetparameters) -- nothing
+registerdirect("hasparameter", hasparameter) -- boolean
+registerdirect("hasoption", hasoption) -- boolean
+registerdirect("getparameter", getparameter) -- whatever
+registerdirect("getparameterdefault", getparameterdefault) -- whatever
+registerdirect("getparametercount", getparametercount) -- numeric
+registerdirect("getmaxparametercount",getmaxparametercount) -- numeric
+registerscript("getparameterpath", getparameterpath) -- tricky
+registerscript("getparameterpen", getparameterpen) -- tricky
+registerscript("getparametertext", getparametertext) -- tricky
+--------direct("getparameteroption", getparameteroption) -- boolean
+registerdirect("pushparameters", pushparameters) -- nothing
+registerdirect("popparameters", popparameters) -- nothing
function metapost.getparameter(list)
local n = #list
@@ -733,9 +813,275 @@ function metapost.setparameterset(namespace,t)
namespaces[namespace] = t
end
+function metapost.getparameterpreset(namespace,t)
+ return namespace and presets[namespace] or presets
+end
+
+local function setluaparameter()
+ local namespace = scanstring()
+ local name = scanstring()
+ local value = scanstring()
+ local code = load("return " .. value)
+ if type(code) == "function" then
+ local result = code()
+ if result then
+ local data = namespace and namespaces[namespace] or namespaces
+ data[name] = result
+ else
+ report("no result from lua code: %s",value)
+ end
+ else
+ report("invalid lua code: %s",value)
+ end
+end
+
+registerdirect("setluaparameter", setluaparameter)
+
+-- This is an experiment for Alan and me.
+
+do
+
+ local records = { }
+ local stack = setmetatableindex("table")
+ local nofrecords = 0
+ local interim = 0
+ local names = { }
+ -- local types = { }
+
+ registerdirect("newrecord", function()
+ scantoken() -- semicolon
+ local p = get_parameters()
+ local n = 0
+ if interim > 0 then
+ records[interim] = p
+ local top = stack[interim]
+ if top then
+ top = stack[interim][#top]
+ if top then
+ setmetatableindex(p,top)
+ end
+ end
+ n = interim
+ interim = 0
+ else
+ nofrecords = nofrecords + 1
+ records[nofrecords] = p
+ n = nofrecords
+ end
+ return n
+ end)
+
+ local function merge(old,new)
+ for knew, vnew in next, new do
+ local vold = old[knew]
+ if vold then
+ if type(vnew) == "table" then
+ if type(vold) == "table" then
+ merge(vold,vnew)
+ else
+ old[knew] = vnew
+ end
+ else
+ old[knew] = vnew
+ end
+ else
+ old[knew] = vnew
+ end
+ end
+ end
+
+ registerdirect("setrecord", function()
+ scantoken() -- semicolon
+ local p = get_parameters()
+ local n = 0
+ if interim > 0 then
+ local r = records[interim]
+ if r then
+ merge(r,p)
+ else
+ records[interim] = p
+ end
+ local top = stack[interim]
+ if top then
+ top = stack[interim][#top]
+ if top then
+ setmetatableindex(p,top)
+ end
+ end
+ n = interim
+ interim = 0
+ else
+ nofrecords = nofrecords + 1
+ records[nofrecords] = p
+ n = nofrecords
+ end
+ return n
+ end)
+
+
+ registerdirect("getrecord", function()
+ local n = scaninteger()
+ local v = records[n]
+ while true do
+ local t = scansymbol(true)
+ if t == ";" or t == ")" or t == ":" then
+ return v
+ elseif t == "." then
+ scansymbol()
+ elseif t == "#" or t == "##" then -- from tex's we get a double
+ scansymbol()
+ t = scansymbol()
+ v = v[t]
+ return type(v) == "table" and #v or 0
+ elseif t == "[" then
+ scansymbol()
+ t = scansymbol(true)
+ if t == "]" then
+ scansymbol()
+ return #v
+ else
+ t = scaninteger()
+ v = v[t]
+ if scansymbol() ~= "]" then
+ report("] expected")
+ end
+ end
+ else
+ t = scansymbol()
+ v = v[t]
+ end
+ end
+ end)
+
+-- registerdirect("getrecord", function()
+-- local n = scaninteger()
+-- local v = records[n]
+-- local l = 0
+-- while true do
+-- local t = scansymbol(true)
+-- if t == ";" or t == ":" then
+-- return v
+-- elseif t == "(" then
+-- scansymbol()
+-- l = l + 1
+-- elseif t == ")" then
+-- if l > 1 then
+-- scansymbol()
+-- l = l - 1
+-- elseif l == 1 then
+-- scansymbol()
+-- return v
+-- else
+-- return v
+-- end
+-- elseif t == "." then
+-- scansymbol()
+-- elseif t == "#" or t == "##" then -- from tex's we get a double
+-- scansymbol()
+-- t = scansymbol()
+-- v = v[t]
+-- local tv = type(v)
+-- return (tv == "table" or tv == "string") and #v or 0
+-- elseif t == "[" then
+-- scansymbol()
+-- t = scansymbol(true)
+-- if t == "#" or r == "##" then
+-- scansymbol()
+-- if scansymbol() ~= "]" then
+-- report("] expected")
+-- end
+-- return #v
+-- else
+-- t = scaninteger()
+-- v = v[t]
+-- if scansymbol() ~= "]" then
+-- report("] expected")
+-- end
+-- end
+-- else
+-- t = scansymbol()
+-- v = v[t]
+-- end
+-- end
+-- end)
+
+ registerdirect("cntrecord", function()
+ local n = scaninteger()
+ local v = records[n]
+ local l = 0
+ while true do
+ local t = scansymbol(true)
+ if t == ";" or t == ":" then
+ break
+ elseif t == "(" then
+ scansymbol()
+ l = l + 1
+ elseif t == ")" then
+ if l > 1 then
+ scansymbol()
+ l = l - 1
+ elseif l == 1 then
+ scansymbol()
+ break
+ else
+ break
+ end
+ elseif t == "." then
+ scansymbol()
+ elseif t == "[" then
+ scansymbol()
+ t = scaninteger()
+ v = v[t]
+ if scansymbol() ~= "]" then
+ report("] expected")
+ end
+ else
+ t = scansymbol()
+ v = v[t]
+ end
+ end
+ local tv = type(v)
+ return (tv == "table" or tv == "string") and #v or 0 -- integer
+ end)
+
+ function metapost.getrecord(name)
+ local index = names[name]
+ if index then
+ return records[index]
+ end
+ end
+
+ function metapost.setrecord(name,data)
+ if type(data) == "table" then
+ local index = names[name]
+ if index then
+ records[index] = data
+ end
+ end
+ end
+
+ function metapost.runinternal(action,index,kind,name)
+ if action == 0 then
+ -- allocate
+ names[name] = index
+ -- types[index] = kind
+ elseif action == 1 then
+ -- save
+ insert(stack[index],records[index])
+ interim = index
+ elseif action == 2 then
+ -- restore
+ records[index] = remove(stack[index]) or records[index]
+ elseif action == 3 then
+ metapost.checktracingonline(kind)
+ end
+ end
+
+end
+
-- goodies
-registerscript("definecolor", function()
+registerdirect("definecolor", function()
scantoken() -- we scan the semicolon
local s = get_parameters()
attributes.colors.defineprocesscolordirect(s)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-snc.lmt b/Master/texmf-dist/tex/context/base/mkxl/mlib-snc.lmt
new file mode 100644
index 00000000000..eddf6417a83
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-snc.lmt
@@ -0,0 +1,36 @@
+if not modules then modules = { } end modules ['mlib-snc'] = {
+ version = 1.001,
+ comment = "companion to anch-snc.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local scanners = mp.scan
+local scaninteger = scanners.integer
+local scanstring = scanners.string
+local factor = number.dimenfactors.bp
+local synchronizers = graphics.synchronizers
+local registerdirect = metapost.registerdirect
+
+-- no need for locals (yet)
+
+registerdirect("asnc_collect", function()
+ return synchronizers.collect(scaninteger(),scaninteger(),scanstring()) -- category realpage region
+end)
+
+registerdirect("asnc_extend", synchronizers.extend )
+registerdirect("asnc_prune", synchronizers.prune )
+registerdirect("asnc_collapse", synchronizers.collapse)
+registerdirect("asnc_getsize", synchronizers.getsize )
+
+registerdirect("asnc_gettop", function() return synchronizers.gettop (scaninteger()) * factor end)
+registerdirect("asnc_getbottom",function() return synchronizers.getbottom(scaninteger()) * factor end)
+registerdirect("asnc_getkind", function() return synchronizers.getkind (scaninteger()) end)
+registerdirect("asnc_gettask", function() return synchronizers.gettask (scaninteger()) end)
+
+registerdirect("asnc_getx", function() return synchronizers.getx() * factor end)
+registerdirect("asnc_gety", function() return synchronizers.gety() * factor end)
+registerdirect("asnc_getw", function() return synchronizers.getw() * factor end)
+registerdirect("asnc_geth", function() return synchronizers.geth() * factor end)
+registerdirect("asnc_getd", function() return synchronizers.getd() * factor end)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/mlib-svg.lmt b/Master/texmf-dist/tex/context/base/mkxl/mlib-svg.lmt
index dca2b6d191d..2dec349db34 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/mlib-svg.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/mlib-svg.lmt
@@ -7,6 +7,12 @@ if not modules then modules = { } end modules ['mlib-svg'] = {
license = "see context related readme files",
}
+-- todo: svg stripper
+
+-- todo: check clip: what if larger than bbox
+
+-- todo: when opacity is 1 don't flush it
+
-- Just a few notes:
--
-- There is no real need to boost performance here .. we can always make a fast
@@ -75,6 +81,14 @@ if not modules then modules = { } end modules ['mlib-svg'] = {
-- One can run into pretty crazy images, like lines that are fills being clipped
-- to some width. That's the danger of hiding yourself behind an interface I guess.
+--
+-- One would expect official examples to sort of follow the structure guideline,
+-- like putting gradient definitions in a "defs" element but forget about it ...
+-- structure seems not to be important (one can even wonder why "defs" is there at
+-- all). In the end all these systems (tex macro packages included) end up as a
+-- mess simply because conceptually wrong input gets accepted as normal. A side
+-- effect is that one starts to get a disliking. Anyway, at sime point I can just
+-- simplify some code because ugliness is part of the game.
local rawget, rawset, type, tonumber, tostring, next, setmetatable = rawget, rawset, type, tonumber, tostring, next, setmetatable
@@ -92,20 +106,20 @@ local xmltext, xmltextonly = xml.text, xml.textonly
local css = xml.css or { } -- testing
local function xmlinheritattributes(c,pa)
- local at = c.at
- local dt = c.dt
- if at and dt then
- if pa then
- setmetatableindex(at,pa)
- end
- for i=1,#dt do
- local dti = dt[i]
- if type(dti) == "table" then
- xmlinheritattributes(dti,at)
+ if not c.special then
+ local at = c.at
+ local dt = c.dt
+ if at and dt then
+ if pa then
+ setmetatableindex(at,pa)
+ end
+ for i=1,#dt do
+ local dti = dt[i]
+ if type(dti) == "table" then
+ xmlinheritattributes(dti,at)
+ end
end
end
- else
- -- comment of so
end
end
@@ -126,8 +140,12 @@ local trace_result = false trackers.register("metapost.svg.result", function(v)
local trace_colors = false trackers.register("metapost.svg.colors", function(v) trace_colors = v end)
local trace_fonts = false trackers.register("metapost.svg.fonts", function(v) trace_fonts = v end)
--- This is just an experiment. Todo: reset hash etc. Also implement
--- an option handler.
+-- This is just an experiment. Todo: reset hash etc. Also implement an option handler.
+
+local s_draw_image_start <const> = "draw image ("
+local s_draw_image_stop <const> = ") ;"
+
+local ignoredopacity = 1
local svghash = false do
@@ -189,7 +207,7 @@ local a2c do
a2c = function(x1, y1, rx, ry, angle, large, sweep, x2, y2, f1, f2, cx, cy)
- if (rx == 0 or ry == 0 ) or (x1 == x2 and y1 == y2) then
+ if (rx == 0 or ry == 0) or (x1 == x2 and y1 == y2) then
return { x1, y1, x2, y2, x2, y2 }
end
@@ -303,6 +321,8 @@ local factors = {
["in"] = 90,
["em"] = 12 * 1.25,
["ex"] = 8 * 1.25,
+ ["%"] = 0.1,
+ ["bp"] = 1,
}
metapost.svgfactors = factors
@@ -332,6 +352,7 @@ do
* (P("e") * S("+-")^0 * p_digit^1)^-1
local function convert (n) n = tonumber(n) return n end
+ local function convert_p (n,u) n = tonumber(n) if u == true then return n / 100 else return n end end
local function convert_r (n,u) n = tonumber(n) if u == true then return percentage_r * n elseif u then return u * n else return n end end
local function convert_x (n,u) n = tonumber(n) if u == true then return percentage_x * n elseif u then return u * n else return n end end
local function convert_y (n,u) n = tonumber(n) if u == true then return percentage_y * n elseif u then return u * n else return n end end
@@ -342,17 +363,20 @@ do
local p_percent = P("%") * Cc(true)
local c_number_n = C(p_number)
- local c_number_u = C(p_number) * (p_unit + p_percent)^-1
+ local c_number_u = C(p_number) * (p_percent + p_unit)^-1
p_number_n = c_number_n / convert
+ p_number_u = c_number_u / convert
p_number_x = c_number_u / convert_x
p_number_vx = c_number_u / convert_vx
p_number_y = c_number_u / convert_y
p_number_vy = c_number_u / convert_vy
p_number_r = c_number_u / convert_r
+ p_number_p = c_number_u / convert_p
asnumber = function(s) return s and lpegmatch(p_number, s) or 0 end
asnumber_r = function(s) return s and lpegmatch(p_number_r, s) or 0 end
+ asnumber_p = function(s) return s and lpegmatch(p_number_p, s) or 0 end
asnumber_x = function(s) return s and lpegmatch(p_number_x, s) or 0 end
asnumber_y = function(s) return s and lpegmatch(p_number_y, s) or 0 end
asnumber_vx = function(s) return s and lpegmatch(p_number_vx,s) or 0 end
@@ -366,7 +390,8 @@ do
asnumber_vx_t = function(s) return s and lpegmatch(p_number_vx_t,s) or zerotable end
asnumber_vy_t = function(s) return s and lpegmatch(p_number_vy_t,s) or zerotable end
- local p_numbersep = p_number_n + p_separator
+-- local p_numbersep = p_number_n + p_separator
+ local p_numbersep = p_number_u + p_separator
p_numbers = p_optseparator * P("(") * p_numbersep^0 * p_optseparator * P(")")
p_fournumbers = p_numbersep^4
p_path = Ct ( (
@@ -477,24 +502,22 @@ local colorcomponents, withcolor, thecolor, usedcolors do
whitesmoke = 0xF5F5F5, yellow = 0xFFFF00, yellowgreen = 0x9ACD32,
}
- local f_rgb = formatters['withcolor svgcolor(%.3N,%.3N,%.3N)']
- local f_cmyk = formatters['withcolor svgcmyk(%.3N,%.3N,%.3N,%.3N)']
- local f_gray = formatters['withcolor svggray(%.3N)']
- local f_rgba = formatters['withcolor svgcolor(%.3N,%.3N,%.3N) withtransparency (1,%.3N)']
- local f_graya = formatters['withcolor svggray(%.3N) withtransparency (1,%.3N)']
- local f_name = formatters['withcolor "%s"']
+ local f_rgb = formatters[' withcolor svgcolor(%.3N,%.3N,%.3N)']
+ local f_cmyk = formatters[' withcolor svgcmyk(%.3N,%.3N,%.3N,%.3N)']
+ local f_gray = formatters[' withcolor svggray(%.3N)']
+ local f_rgba = formatters[' withcolor svgcolor(%.3N,%.3N,%.3N) withopacity %.3N']
+ local f_graya = formatters[' withcolor svggray(%.3N) withopacity %.3N']
+ local f_name = formatters[' withcolor "%s"']
local f_svgrgb = formatters['svgcolor(%.3N,%.3N,%.3N)']
local f_svgcmyk = formatters['svgcmyk(%.3N,%.3N,%.3N,%.3N)']
local f_svggray = formatters['svggray(%.3N)']
local f_svgname = formatters['"%s"']
- local extract = bit32.extract
-
local triplets = setmetatableindex(function(t,k)
-- we delay building all these strings
local v = svgcolors[k]
if v then
- v = { extract(v,16,8)/255, extract(v,8,8)/255, extract(v,0,8)/255 }
+ v = { ((v>>16)&0xFF)/0xFF, ((v>>8)&0xFF)/0xFF, ((v>>0)&0xFF)/0xFF }
else
v = false
end
@@ -510,6 +533,13 @@ local colorcomponents, withcolor, thecolor, usedcolors do
local p_left = P("(")
local p_right = P(")")
local p_a = P("a")^-1
+ local p_r_a_color = p_left
+ * (p_fraction * p_separator^-1)^-3
+ * p_absolute^0
+ * p_right
+ local p_c_k_color = p_left
+ * (p_absolute + p_separator^-1)^-4
+ * p_right
local p_h_a_color = p_left
* p_angle
* p_separator * p_percent
@@ -524,25 +554,26 @@ local colorcomponents, withcolor, thecolor, usedcolors do
local hwbtorgb = colors.hwbtorgb
local forcedmodel = colors.forcedmodel
- local p_splitcolor =
+ local p_splitcolor = -- offet lowercase ff
P("#") * C(p_hexdigit*p_hexdigit)^1 / function(r,g,b)
if not r then
return "gray", 0
elseif not (g and b) then
- return "gray", tonumber(r or "0", 16) / 255 or 0
+ return "gray",
+ (r == "00" and 0) or (r == "ff" and 1) or (tonumber(r,16)/255)
else
return "rgb",
- tonumber(r or "0", 16) / 255 or 0,
- tonumber(g or "0", 16) / 255 or 0,
- tonumber(b or "0", 16) / 255 or 0
+ (r == "00" and 0) or (r == "ff" and 1) or (tonumber(r,16)/255),
+ (g == "00" and 0) or (g == "ff" and 1) or (tonumber(g,16)/255),
+ (b == "00" and 0) or (b == "ff" and 1) or (tonumber(b,16)/255)
end
end
+ P("rgb") * p_a
- * p_left * (p_fraction + p_separator)^-3 * (p_absolute + p_separator)^0 * p_right / function(r,g,b,a)
+ * p_r_a_color / function(r,g,b,a)
return "rgb", r or 0, g or 0, b or 0, a or false
end
+ P("cmyk")
- * p_left * (p_absolute + p_separator)^0 * p_right / function(c,m,y,k)
+ * p_c_k_color / function(c,m,y,k)
return "cmyk", c or 0, m or 0, y or 0, k or 0
end
+ P("hsl") * p_a
@@ -605,7 +636,7 @@ local colorcomponents, withcolor, thecolor, usedcolors do
tonumber(t[2]) or 0,
tonumber(t[3]) or 0,
tonumber(t[4]) or 0,
- tonumber(t[4]) or false
+ tonumber(t[5]) or false
elseif what == "cmyk" then
return
what,
@@ -623,19 +654,25 @@ local colorcomponents, withcolor, thecolor, usedcolors do
color = c
end
end
- local what, s1, s2, s3, s4 = registeredcolor(color)
- if what then
- return what, s1, s2, s3, s4
- end
- what, s1, s2, s3, s4 = lpegmatch(p_splitcolor,color)
- if not what then
- local t = triplets[color]
- if t then
- s1, s3, s3 = t[1], t[2], t[3]
- what = "rgb"
+ if color == "#000000" then
+ return "rgb", 0, 0, 0
+ elseif color == "#ffffff" then
+ return "rgb", 1, 1, 1
+ else
+ local what, s1, s2, s3, s4 = registeredcolor(color)
+ if not what then
+ what, s1, s2, s3, s4 = lpegmatch(p_splitcolor,color)
+ -- we could cache
+ if not what then
+ local t = triplets[color]
+ if t then
+ s1, s2, s3 = t[1], t[2], t[3]
+ what = "rgb"
+ end
+ end
end
+ return what, s1, s2, s3, s4
end
- return what, s1, s2, s3, s4
end
colorcomponents = function(color)
@@ -645,7 +682,6 @@ local colorcomponents, withcolor, thecolor, usedcolors do
withcolor = function(color)
local what, s1, s2, s3, s4 = validcolor(color)
- -- print(color,what, s1, s2, s3, s4)
if what == "rgb" then
if s4 then
if s1 == s2 and s1 == s3 then
@@ -714,6 +750,9 @@ local grabpath, grablist do
local m = { __index = function() return 0 end }
+ -- local t = { } -- no real saving here if we share
+ -- local n = 0
+
grabpath = function(str)
local p = lpegmatch(p_path,str) or { }
local np = #p
@@ -724,6 +763,7 @@ local grabpath, grablist do
setmetatable(p,m)
local t = { } -- no real saving here if we share
local n = 0
+ -- n = 0
local a = 0
local i = 0
local last = "M"
@@ -1166,108 +1206,167 @@ end
-- todo: viewbox helper
-local s_wrapped_start = "draw image ("
-local f_wrapped_stop = formatters[") shifted (0,%N) scaled %N ;"]
+local s_wrapped_start <const> = "draw image ("
+local f_wrapped_stop = formatters[") shifted (0,%N) scaled %N ;"]
local handletransform, handleviewbox do
local sind = math.sind
- --todo: better lpeg
-
- local f_rotatedaround = formatters[" rotatedaround((%N,%N),%N)"]
- local f_rotated = formatters[" rotated(%N)"]
- local f_shifted = formatters[" shifted(%N,%N)"]
- local f_slanted_x = formatters[" xslanted(%N)"]
- local f_slanted_y = formatters[" yslanted(%N)"]
- local f_scaled = formatters[" scaled(%N)"]
- local f_xyscaled = formatters[" xyscaled(%N,%N)"]
- local f_matrix = formatters[" transformed bymatrix(%N,%N,%N,%N,%N,%N)"]
-
- local s_transform_start = "draw image ( "
- local f_transform_stop = formatters[")%s ;"]
+ -- local f_rotatedaround = formatters["svg_p := svg_p rotatedaround((%N,%N),%N) ;"]
+ -- local f_rotated = formatters["svg_p := svg_p rotated(%N) ;"]
+ -- local f_shifted = formatters["svg_p := svg_p shifted(%N,%N) ;"]
+ -- local f_slanted_x = formatters["svg_p := svg_p xslanted(%N) ;"]
+ -- local f_slanted_y = formatters["svg_p := svg_p yslanted(%N) ;"]
+ -- local f_scaled = formatters["svg_p := svg_p scaled(%N) ;"]
+ -- local f_xyscaled = formatters["svg_p := svg_p xyscaled(%N,%N) ;"]
+ -- local f_matrix = formatters["svg_p := svg_p transformed bymatrix(%N,%N,%N,%N,%N,%N) ;"]
+ -- local s_transform_start <const> = "draw image ( begingroup ; save svg_p ; picture svg_p ; svg_p := image ( "
+ -- local f_transform_stop = formatters[" ; ) ; %s ; draw svg_p ; endgroup ; ) ; "]
+
+ local f_rotatedaround = formatters["rotatedaround((%N,%N),%N) "]
+ local f_rotated = formatters["rotated(%N) "]
+ local f_shifted = formatters["shifted(%N,%N) "]
+ local f_slanted_x = formatters["xslanted(%N) "]
+ local f_slanted_y = formatters["yslanted(%N) "]
+ local f_scaled = formatters["scaled(%N) "]
+ local f_xyscaled = formatters["xyscaled(%N,%N) "]
+ local f_matrix = formatters["transformed bymatrix(%N,%N,%N,%N,%N,%N) "]
+ local s_transform_start <const> = "draw image ( "
+ local f_transform_stop = formatters[") %s ; "]
+
+ local transforms = { }
+ local noftransforms = 0
local function rotate(r,x,y)
- if x then
- return r and f_rotatedaround(x,-(y or x),-r)
- elseif r then
- return f_rotated(-r)
- else
- return ""
+ if r then
+ noftransforms = noftransforms + 1
+ if x then
+ transforms[noftransforms] = f_rotatedaround(x,-(y or x),-r)
+ else
+ transforms[noftransforms] = f_rotated(-r)
+ end
end
end
local function translate(x,y)
+ if x == 0 then x = false end
+ if y == 0 then y = false end
if y then
- return f_shifted(x,-y)
+ noftransforms = noftransforms + 1
+ transforms[noftransforms] = f_shifted(x or 0,-y)
elseif x then
- return f_shifted(x,0)
- else
- return ""
+ noftransforms = noftransforms + 1
+ transforms[noftransforms] = f_shifted(x,0)
end
end
local function scale(x,y)
+ if x == 1 then x = false end
+ if y == 1 then y = false end
if y then
- return f_xyscaled(x,y)
+ noftransforms = noftransforms + 1
+ transforms[noftransforms] = f_xyscaled(x or 1,y)
elseif x then
- return f_scaled(x)
- else
- return ""
+ noftransforms = noftransforms + 1
+ transforms[noftransforms] = f_scaled(x)
end
end
- local function skewx(x)
+ local function skew(x,y)
+ -- if x = 0 then x = false end
+ -- if y = 0 then y = false end
if x then
- return f_slanted_x(sind(-x))
- else
- return ""
+ noftransforms = noftransforms + 1
+ transforms[noftransforms] = f_slanted_x(sind(-x))
end
- end
-
- local function skewy(y)
if y then
- return f_slanted_y(sind(-y))
- else
- return ""
+ noftransforms = noftransforms + 1
+ transforms[noftransforms] = f_slanted_y(sind(-y))
end
end
local function matrix(rx,sx,sy,ry,tx,ty)
- return f_matrix(rx or 1, sx or 0, sy or 0, ry or 1, tx or 0, - (ty or 0))
+ if not ty then
+ ty = 0
+ end
+ if not tx then
+ tx = 0
+ end
+ if not sx then
+ sx = 0
+ end
+ if not sy then
+ sy = 0
+ end
+ if not rx then
+ rx = 1
+ end
+ if not ry then
+ ry = 1
+ end
+ noftransforms = noftransforms + 1
+ -- transforms[noftransforms] = f_matrix(rx, sx, sy, ry, tx, -ty)
+ -- https://en.wikipedia.org/wiki/Rotation_matrix : we're counter clockwise
+ transforms[noftransforms] = f_matrix(rx, -sy, -sx, ry, tx, -ty)
end
- -- How to deal with units here? Anyway, order seems to matter.
-
- local p_transform = Cf ( Ct("") * (
- lpegpatterns.whitespace^0 * Cg(
- C("translate") * (p_numbers / translate) -- maybe xy
- + C("scale") * (p_numbers / scale)
- + C("rotate") * (p_numbers / rotate)
- + C("matrix") * (p_numbers / matrix)
- + C("skewX") * (p_numbers / skewx)
- + C("skewY") * (p_numbers / skewy)
+ local p_transform = (
+ p_space^0 * (
+ P("translate") * (p_numbers / translate) -- maybe xy
+ + P("scale") * (p_numbers / scale)
+ + P("rotate") * (p_numbers / rotate)
+ + P("matrix") * (p_numbers / matrix)
+ + P("skew") * (p_numbers / skew)
+ + P("translateX") * (p_numbers / translate)
+ + P("translateY") * (Cc(false) * p_numbers / translate)
+ + P("scaleX") * (p_numbers / translate)
+ + P("scaleY") * (Cc(false) * p_numbers / translate)
+ + P("skewX") * (p_numbers / skew)
+ + P("skewY") * (Cc(false) * p_numbers / skew)
)
- )^1, rawset)
+ )^1
+
+ -- indeed, we need to reverse the order ... not that pretty and counter intuitive too
+
+ local function combined()
+ if noftransforms == 1 then
+ return transforms[1]
+ elseif noftransforms == 2 then
+ return transforms[2] .. transforms[1]
+ elseif noftransforms == 3 then
+ return transforms[3] .. transforms[2] .. transforms[1]
+ else
+ -- the rare case (but anything can happen in svg and it gets worse)
+ local m = noftransforms + 1
+ for i=1,noftransforms//2 do
+ local j = m - i
+ transforms[i], transforms[j] = transforms[j], transforms[i]
+ end
+ return concat(transforms,"",1,noftransforms)
+ end
+ end
handletransform = function(at)
local t = at.transform
if t then
- local e = lpegmatch(p_transform,t)
- if e then
- e = concat({
- e.rotate or "",
- e.skewX or "",
- e.skewY or "",
- e.scale or "",
- e.translate or "",
- e.matrix or "",
- }, " ")
- return s_transform_start, f_transform_stop(e), t
+ noftransforms = 0
+ lpegmatch(p_transform,t)
+ if noftransforms > 0 then
+ -- currentpicture
+ return s_transform_start, f_transform_stop(combined()), t
end
end
end
+ handletransformstring = function(t)
+ if t then
+ noftransforms = 0
+ lpegmatch(p_transform,t)
+ return noftransforms > 0 and combined()
+ end
+ end
+
handleviewbox = function(v)
if v then
local x, y, w, h = lpegmatch(p_fournumbers,v)
@@ -1349,7 +1448,7 @@ do
-- ["missing-glyph"] = true,
-- ["mpath"] = true,
["path"] = true,
- -- ["pattern"] = true,
+ ["pattern"] = true,
["polygon"] = true,
["polyline"] = true,
["radialGradient"] = true,
@@ -1370,6 +1469,20 @@ do
-- ["vkern"] = true,
}
+ local usetags = {
+ ["circle"] = true,
+ ["ellipse"] = true,
+ ["g"] = true,
+ ["image"] = true,
+ ["line"] = true,
+ ["path"] = true,
+ ["polygon"] = true,
+ ["polyline"] = true,
+ ["rect"] = true,
+ -- ["text"] = true,
+ -- ["tspan"] = true,
+ }
+
local pathtracer = {
["stroke"] = "darkred",
["stroke-opacity"] = ".5",
@@ -1378,17 +1491,28 @@ do
["fill-opacity"] = ".75",
}
+ local skipspace = p_space^0
+ local colon = P(":")
+ local semicolon = P(";")
+ local eos = P(-1)
+
+ local someaction = (
+ skipspace * C((1 - (skipspace * (semicolon + eos + colon)))^1)
+ * colon
+ * skipspace * C((1 - (skipspace * (semicolon + eos)))^0)
+ * Carg(1) / function(k,v,a) a[k] = v end
+ + (p_space + semicolon)^1
+ )^1
+
local function handlechains(c)
if tags[c.tg] then
local at = c.at
local dt = c.dt
if at and dt then
- -- at["inkscape:connector-curvature"] = nil -- cleare entry and might prevent table growth
+ -- at["inkscape:connector-curvature"] = nil -- clear entry and might prevent table growth
local estyle = rawget(at,"style")
if estyle and estyle ~= "" then
- for k, v in gmatch(estyle,"%s*([^:]+):%s*([^;]+);?") do
- at[k] = v
- end
+ lpegmatch(someaction,estyle,1,at)
end
local eclass = rawget(at,"class")
if eclass and eclass ~= "" then
@@ -1477,17 +1601,43 @@ do
-- We can have root in definitions and then do a metatable lookup but use
-- is not used that often I guess.
- local function locate(id)
+ local function locate(id,c)
+ if id == none then
+ return
+ end
local res = definitions[id]
+ local ref
if res then
return res
end
- local ref = gsub(id,"^url%(#(.-)%)$","%1")
- local ref = gsub(ref,"^#","")
+ ref = gsub(id,"^url%(#(.-)%)$","%1")
+ ref = gsub(ref,"^#","")
-- we can make a fast id lookup
- local res = xmlfirst(root,"**[@id='"..ref.."']")
+ res = xmlfirst(root,"**[@id='"..ref.."']")
if res then
definitions[id] = res
+ return res
+ end
+ -- we expect resource paths to be specified but for now we want
+ -- them on the same path .. we could use the url splitter .. todo
+ ref = url.hashed(id)
+ if not ref.nosheme and ref.scheme == "file" then
+ local filename = ref.filename
+ local fragment = ref.fragment
+ if filename and filename ~= "" then
+ local fullname = resolvers.findbinfile(filename)
+ if lfs.isfile(fullname) then
+ report("loading use file: %s",fullname)
+ local root = xml.load(fullname)
+ res = xmlfirst(root,"**[@id='"..fragment.."']")
+ if res then
+ xmlinheritattributes(res,c) -- tricky
+ setmetatableindex(res.at,c.at)
+ definitions[id] = res
+ return res
+ end
+ end
+ end
end
return res
end
@@ -1503,7 +1653,7 @@ do
local spec = definitions[clippath] or locate(clippath)
- -- do we really need thsi crap
+ -- do we really need this crap
if not spec then
local index = match(clippath,"(%d+)")
if index then
@@ -1549,12 +1699,16 @@ do
-- break
elseif tg == "path" then
local ca = c.at
- local d = ca.d
+ local d = rawget(ca,"d")
if d then
local p = grabpath(d)
p.evenodd = ca["clip-rule"] == "evenodd"
p.close = true
- return p, clippath
+ local transform = rawget(ca,"transform")
+ if transform then
+ transform = handletransformstring(transform)
+ end
+ return p, clippath, transform
else
return
end
@@ -1564,95 +1718,297 @@ do
end
end
- local s_shade_linear = ' withshademethod "linear" '
- local s_shade_circular = ' withshademethod "circular" '
- local f_shade_step = formatters['withshadestep ( withshadefraction %N withshadecolors(%s,%s) )']
- local f_shade_one = formatters['withprescript "sh_center_a=%N %N"']
- local f_shade_two = formatters['withprescript "sh_center_b=%N %N"']
+ -- todo: clip = [ auto | rect(llx,lly,urx,ury) ]
+
+ local s_rotation_start <const> = "draw image ( "
+ local f_rotation_stop = formatters[") rotatedaround((0,0),-angle((%N,%N))) ;"]
+ local f_rotation_angle = formatters[") rotatedaround((0,0),-%N) ;"]
+
+ local s_offset_start <const> = "draw image ( "
+ local f_offset_stop = formatters[") shifted (%N,%N) ;"]
+ local s_size_start <const> = "draw image ( "
+ local f_size_stop = formatters[") xysized (%N,%N) ;"]
+
+ local handleoffset, handlesize do
+
+ handleoffset = function(at)
+ local x = asnumber_vx(rawget(at,"x"))
+ local y = asnumber_vy(rawget(at,"y"))
+ if x ~= 0 or y ~= 0 then
+ return s_offset_start, f_offset_stop(x,y)
+ end
+ end
+
+ handlesize = function(at)
+ local width = asnumber_x(rawget(at,"width"))
+ local height = asnumber_y(rawget(at,"height"))
+ if width == 0 or height == 0 then
+ -- bad scaling
+ elseif width == 1 and height == 1 then
+ -- no need for scaling
+ else
+ return s_size_start, f_size_stop(width,height)
+ end
+ end
+
+ end
+
+ function handlers.symbol(c)
+ local at = c.at
+ -- x y refX refY
+ local boffset, eoffset = handleoffset(at)
+ local bsize, esize = handlesize(at)
+ local btransform, etransform, transform = handletransform(at)
+
+ if boffset then
+ r = r + 1 result[r] = boffset
+ end
+ if btransform then
+ r = r + 1 result[r] = btransform
+ end
+ if bsize then
+ r = r + 1 ; result[r] = bsize
+ end
+
+-- local _x = at.x at.x = 0
+-- local _y = at.y at.y = 0
+-- local _w = at.width at.width = 0
+-- local _h = at.height at.height = 0
+
+ process(c,"/*")
+-- at.x = _x
+-- at.y = _y
+-- at.width = _w
+-- at.height = _h
+
+ if esize then
+ r = r + 1 result[r] = esize
+ end
+ if etransform then
+ r = r + 1 ; result[r] = etransform
+ end
+ if eoffset then
+ r = r + 1 result[r] = eoffset
+ end
+ end
+
+ -- do
+
+ local s_shade_linear = ' withshademethod "linear" '
+ local s_shade_circular = ' withshademethod "circular" '
+ local f_color = formatters[' withcolor "%s"']
+ local f_opacity = formatters[' withopacity %N']
+ local f_pen = formatters[' withpen pencircle scaled %N']
- local f_color = formatters['withcolor "%s"']
- local f_opacity = formatters['withtransparency (1,%N)']
- local f_pen = formatters['withpen pencircle scaled %N']
-- todo: gradient unfinished
-- todo: opacity but first we need groups in mp
- local function gradient(id)
- local spec = definitions[id] -- no locate !
- if spec then
- local kind = spec.tg
- local shade = nil
- local n = 1
- local a = spec.at
- if kind == "linearGradient" then
- shade = { s_shade_linear }
- --
- local x1 = rawget(a,"x1")
- local y1 = rawget(a,"y1")
- local x2 = rawget(a,"x2")
- local y2 = rawget(a,"y2")
- if x1 and y1 then
- n = n + 1 ; shade[n] = f_shade_one(asnumber_vx(x1),asnumber_vy(y1))
- end
- if x2 and y2 then
- n = n + 1 ; shade[n] = f_shade_one(asnumber_vx(x2),asnumber_vy(y2))
- end
- --
- elseif kind == "radialGradient" then
- shade = { s_shade_circular }
- --
- local cx = rawget(a,"cx") -- x center
- local cy = rawget(a,"cy") -- y center
- local r = rawget(a,"r" ) -- radius
- local fx = rawget(a,"fx") -- focal points
- local fy = rawget(a,"fy") -- focal points
- --
- if cx and cy then
- -- todo
- end
- if r then
- -- todo
- end
- if fx and fy then
- -- todo
- end
+ -- this is rather hard to deal with because browsers differ (at the time of writing)
+ -- and what they show on screen comes out different (or not at all) in print
+
+ -- todo: gradientUnits = "userSpaceOnUse" : use units instead of ratios
+
+ -- spreadMethod = "pad" : default
+ -- spreadMethod = "repeat" : crap
+ -- spreadMethod = "reflect" : crap
+
+ -- stop-opacity = "0" : strange, just use steps for that
+
+ -- todo: test for kind independently in caller, make a plug instead
+
+ local function pattern(id)
+ local c = definitions[id] -- no locate !
+ if c and c.tg == "pattern" then
+ -- just use result and then prune
+ local _r = r
+ local _result = result
+ r = 0
+ result = { }
+ --
+ -- handlers.pattern(spec)
+ --
+ -- inlined because of width
+ --
+ local at = c.at
+
+ local width = asnumber_x(rawget(at,"width"))
+ local height = asnumber_y(rawget(at,"height"))
+ if width == 0 or height == 0 then
+ -- bad scaling
+ width = nil
+ height = nil
+ elseif width == 1 and height == 1 then
+ -- no need for scaling
+ width = nil
+ height = nil
else
- report("unknown gradient %a",id)
- return
+ -- for now only relative
end
- -- local gu = a.gradientUnits
- -- local gt = a.gradientTransform
- -- local sm = a.spreadMethod
- local colora, colorb
- -- startcolor ?
- for c in xmlcollected(spec,"/stop") do
- local a = c.at
- local offset = rawget(a,"offset")
- local colorb = rawget(a,"stop-color")
- local opacity = rawget(a,"stop-opacity")
- if colorb then
- colorb = thecolor(colorb)
- end
- if not colora then
- colora = colorb
- end
- -- what if no percentage
- local fraction = offset and asnumber_r(offset)
- if not fraction then
- -- offset = tonumber(offset)
- -- for now
- fraction = xmlcount(spec,"/stop")/100
- end
+ local boffset, eoffset = handleoffset(at)
+ -- local bsize, esize = handlesize(at)
+ local btransform, etransform, transform = handletransform(at)
- if colora and colorb and color_a ~= "" and color_b ~= "" then
- n = n + 1 ; shade[n] = f_shade_step(fraction,colora,colorb)
- end
+ if boffset then
+ r = r + 1 result[r] = boffset
+ end
+ if btransform then
+ r = r + 1 result[r] = btransform
+ end
+ -- if bsize then
+ -- r = r + 1 ; result[r] = bsize
+ -- end
+
+ local _x = at.x at.x = 0
+ local _y = at.y at.y = 0
+ local _w = at.width at.width = 0
+ local _h = at.height at.height = 0
+
+ process(c,"/*")
+
+ at.x = _x
+ at.y = _y
+ at.width = _w
+ at.height = _h
+
+ -- if esize then
+ -- r = r + 1 result[r] = esize
+ -- end
+ if etransform then
+ r = r + 1 ; result[r] = etransform
+ end
+ if eoffset then
+ r = r + 1 result[r] = eoffset
+ end
+ --
+ local okay
+ if width and height then
+ okay = formatters[" withpattern image ( % t )\n withpatternscale(%N,%N)"](result,width,height)
+ else
+ okay = formatters[" withpattern image ( % t )"](result)
+ end
+ r = _r
+ result = _result
+ return okay
+ end
+ end
- colora = colorb
+ local gradient do
+
+ local f_shade_step = formatters['withshadestep ( withshadefraction %N withshadecolors (%s,%s) )']
+ local f_shade_step_opacity = formatters['withshadestep ( withshadefraction %N withshadecolors (%s,%s) withshadeopacity %N )']
+ local f_shade_center = formatters['withshadecenter (%N,%N)']
+ local f_shade_center_f = formatters['withshadecenterfraction (%N,%N)']
+ local f_shade_radius = formatters['withshaderadius (%N,%N) ']
+ local f_shade_radius_f = formatters['withshaderadiusfraction %N']
+ local f_shade_center_one = formatters['withshadecenterone (%N,%N)']
+ local f_shade_center_two = formatters['withshadecentertwo (%N,%N)']
+ local f_shade_center_one_f = formatters['withshadecenteronefraction (%N,%N)']
+ local f_shade_center_two_f = formatters['withshadecentertwofraction (%N,%N)']
+
+ gradient = function(id)
+ local spec = definitions[id] -- no locate !
+ if spec then
+ local kind = spec.tg
+ local shade = nil
+ local n = 1
+ local a = spec.at
+ -- bah
+ local gu = rawget(a, "gradientUnits") -- userSpaceOnUse
+ local gt = rawget(a, "gradientTransform")
+ local sm = rawget(a, "spreadMethod")
+ --
+ local userspace = gu == "userSpaceOnUse"
+ --
+ if kind == "linearGradient" then
+ shade = { s_shade_linear }
+ --
+ local x1 = rawget(a,"x1")
+ local y1 = rawget(a,"y1")
+ local x2 = rawget(a,"x2")
+ local y2 = rawget(a,"y2")
+ if x1 and y1 then
+ n = n + 1 ; shade[n] = f_shade_center_one_f(asnumber_p(x1),1-asnumber_p(y1))
+ end
+ if x2 and y2 then
+ n = n + 1 ; shade[n] = f_shade_center_two_f(asnumber_p(x2),1-asnumber_p(y2))
+ end
+ --
+ elseif kind == "radialGradient" then
+ shade = { s_shade_circular }
+ --
+ local cx = rawget(a,"cx") -- x center
+ local cy = rawget(a,"cy") -- y center
+ local r = rawget(a,"r" ) -- radius
+ local fx = rawget(a,"fx") -- focal points
+ local fy = rawget(a,"fy") -- focal points
+ --
+ if userspace then
+ if cx and cy then
+ n = n + 1 ; shade[n] = f_shade_center(asnumber_p(cx),asnumber_p(cy))
+ end
+ if fx and fy then
+ n = n + 1 ; shade[n] = f_shade_center_one(asnumber_p(fx),-asnumber_p(fy))
+ end
+ if r then
+ n = n + 1 ; shade[n] = f_shade_radius(asnumber_p(r))
+ end
+ if fx and fy then
+ -- todo
+ end
+ else
+ if cx and cy then
+ n = n + 1 ; shade[n] = f_shade_center_f(asnumber_p(cx),1-asnumber_p(cy))
+ end
+ if fx and fy then
+ n = n + 1 ; shade[n] = f_shade_center_one_f(asnumber_p(fx),1-asnumber_p(fy))
+ end
+ if r then
+ n = n + 1 ; shade[n] = f_shade_radius_f(asnumber_p(r))
+ end
+ if fx and fy then
+ -- todo
+ end
+ end
+ else
+ return
+ end
+ local colora, colorb
+ -- startcolor ?
+ for c in xmlcollected(spec,"/stop") do
+ local a = c.at
+ local offset = rawget(a,"offset")
+ local colorb = rawget(a,"stop-color")
+ -- local opacity = rawget(a,"stop-opacity") -- not in pdf for steps
+ if not colora then
+ colora = colorb
+ end
+ -- what if no percentage
+-- local fraction = offset and asnumber_r(offset) -- asnumber_p ?
+local fraction = offset and asnumber_p(offset)
+ if not fraction then
+ -- for now
+ fraction = xmlcount(spec,"/stop")/100 -- asnumber_p ?
+ end
+ if colora and colorb and colora ~= "" and colorb ~= "" then
+ n = n + 1
+ -- if opacity then
+ -- shade[n] = f_shade_step_opacity(fraction,thecolor(colora),thecolor(colorb),asnumber(o))
+ -- else
+ if userspace then
+ shade[n] = f_shade_step(fraction,thecolor(colora),thecolor(colorb))
+ else
+ shade[n] = f_shade_step(fraction,thecolor(colora),thecolor(colorb))
+ end
+ -- end
+ end
+ colora = colorb
+ end
+ return concat(shade,"\n ")
end
- return concat(shade," ")
end
+
end
local function drawproperties(stroke,at,opacity)
@@ -1676,9 +2032,13 @@ do
local o = at["stroke-opacity"] or (opacity and at["opacity"])
if o == "none" then
o = nil
+ elseif o == "transparent" then
+ o = f_opacity(0)
elseif o then
o = asnumber_r(o)
- if o and o ~= 1 then
+ if o == ignoredopacity then
+ o = nil
+ elseif o then
o = f_opacity(o)
else
o = nil
@@ -1687,78 +2047,92 @@ do
return p, d, c, o
end
- local s_opacity_start = "draw image ("
- local f_opacity_stop = formatters["setgroup currentpicture to boundingbox currentpicture withtransparency (1,%N)) ;"]
+ local s_opacity_start <const> = "draw image ("
+ local f_opacity_content = formatters["setgroup currentpicture to boundingbox currentpicture withopacity %N;"]
+ local s_opacity_stop <const> = ") ;"
local function sharedopacity(at)
local o = at["opacity"]
if o and o ~= "none" then
o = asnumber_r(o)
- if o and o ~= 1 then
- return s_opacity_start, f_opacity_stop(o)
+ if o == ignoredopacity then
+ return
+ end
+ if o then
+ return s_opacity_start, f_opacity_content(o), s_opacity_stop
end
end
end
+ -- it looks like none and transparent are both used (mozilla examples)
+
local function fillproperties(fill,at,opacity)
- local c = c ~= "none" and (gradient(fill) or withcolor(fill)) or nil
local o = at["fill-opacity"] or (opacity and at["opacity"])
- if o and o ~= "none" then
+ local c = nil
+ if c ~= "none" then
+ c = gradient(fill)
+ if not c then
+ c = pattern(fill)
+ if c then
+ if o and o ~= "none" then
+ o = asnumber_r(o)
+ if o ~= ignoredopacity then
+ return c, f_opacity(o), "pattern"
+ end
+ end
+ return c, false, "pattern"
+ else
+ c = withcolor(fill)
+ end
+ end
+ end
+ if not o and fill == "transparent" then
+ return nil, f_opacity(0), true
+ elseif o and o ~= "none" then
o = asnumber_r(o)
- if o == 1 then
+ if o == ignoredopacity then
return c
- elseif o then
- return c, f_opacity(o), o == 0
+ end
+ if o then
+ return c, f_opacity(o), (o == 1 and "invisible")
end
end
return c
end
- -- todo: clip = [ auto | rect(llx,lly,urx,ury) ]
+ local viewport do
- local s_offset_start = "draw image ( "
- local f_offset_stop = formatters[") shifted (%N,%N) ;"]
- local s_rotation_start = "draw image ( "
- local f_rotation_stop = formatters[") rotatedaround((0,0),-angle((%N,%N))) ;"]
- local f_rotation_angle = formatters[") rotatedaround((0,0),-%N) ;"]
+ local s_viewport_start <const> = "draw image ("
+ local s_viewport_stop <const> = ") ;"
+ local f_viewport_shift = formatters["currentpicture := currentpicture shifted (%N,%N);"]
+ local f_viewport_scale = formatters["currentpicture := currentpicture xysized (%N,%N);"]
+ local f_viewport_clip = formatters["clip currentpicture to (unitsquare xyscaled (%N,%N));"]
- local function offset(at)
- local x = asnumber_vx(rawget(at,"x"))
- local y = asnumber_vy(rawget(at,"y"))
- if x ~= 0 or y ~= 0 then
- return s_offset_start, f_offset_stop(x,y)
- end
- end
-
- local s_viewport_start = "draw image ("
- local s_viewport_stop = ") ;"
- local f_viewport_shift = formatters["currentpicture := currentpicture shifted (%03N,%03N);"]
- local f_viewport_scale = formatters["currentpicture := currentpicture xysized (%03N,%03N);"]
- local f_viewport_clip = formatters["clip currentpicture to (unitsquare xyscaled (%03N,%03N));"]
+ viewport = function(x,y,w,h,noclip,scale)
+ r = r + 1 ; result[r] = s_viewport_start
+ return function()
+ local okay = w ~= 0 and h ~= 0
+ if okay and scale then
+ r = r + 1 ; result[r] = f_viewport_scale(w,h)
+ end
+ if x ~= 0 or y ~= 0 then
+ r = r + 1 ; result[r] = f_viewport_shift(-x,y)
+ end
+ if okay and not noclip then
+ r = r + 1 ; result[r] = f_viewport_clip(w,-h)
+ end
- local function viewport(x,y,w,h,noclip,scale)
- r = r + 1 ; result[r] = s_viewport_start
- return function()
- local okay = w ~= 0 and h ~= 0
- if okay and scale then
- r = r + 1 ; result[r] = f_viewport_scale(w,h)
- end
- if x ~= 0 or y ~= 0 then
- r = r + 1 ; result[r] = f_viewport_shift(-x,y)
- end
- if okay and not noclip then
- r = r + 1 ; result[r] = f_viewport_clip(w,-h)
+ r = r + 1 ; result[r] = s_viewport_stop
end
-
- r = r + 1 ; result[r] = s_viewport_stop
end
+
end
-- maybe forget about defs and just always locate (and then backtrack
- -- over <g> if needed)
+ -- over <g> if needed) .. so, only store after locating
- function handlers.defs(c)
- for c in xmlcollected(c,"/*") do
+ function handledefinitions(c)
+ for c in xmlcollected(c,"defs/*") do
local a = c.at
if a then
local id = rawget(a,"id")
@@ -1768,31 +2142,39 @@ do
end
end
end
- end
-
- function handlers.symbol(c)
- if uselevel == 0 then
+ for c in xmlcollected(c,"(symbol|radialGradient|linearGradient)") do
local id = rawget(c.at,"id")
if id then
definitions["#" .. id ] = c
definitions["url(#" .. id .. ")"] = c
end
- else
- handlers.g(c)
end
end
- local uselevel = 0
- local bodyfontscale = 1
+ -- function handlers.defs(c)
+ -- for c in xmlcollected(c,"/*") do
+ -- local a = c.at
+ -- if a then
+ -- local id = rawget(a,"id")
+ -- if id then
+ -- definitions["#" .. id ] = c
+ -- definitions["url(#" .. id .. ")"] = c
+ -- end
+ -- end
+ -- end
+ -- end
+
+ -- lots of stuff todo: transform
+
+ local uselevel = 0
function handlers.use(c)
local at = c.at
local id = rawget(at,"href") or rawget(at,"xlink:href") -- better a rawget
- local res = locate(id)
+ local res = locate(id,c)
if res then
- -- width height ?
uselevel = uselevel + 1
- local boffset, eoffset = offset(at)
+ local boffset, eoffset = handleoffset(at)
local btransform, etransform, transform = handletransform(at)
if boffset then
@@ -1810,7 +2192,14 @@ do
at["transform"] = false
-- at["clip-path"] = false
- process(res,"/*")
+setmetatableindex(res.at,at)
+
+ local tg = res.tg
+-- if usetags[tg] then
+ process(res,".")
+-- else
+-- process(res,"/*")
+-- end
at["transform"] = _transform
-- at["clip-path"] = _clippath
@@ -1829,37 +2218,31 @@ do
end
end
- local f_no_draw = formatters['nodraw (%s)']
- local f_do_draw = formatters['draw (%s)']
- local f_no_fill_c = formatters['nofill (%s..cycle)']
- local f_do_fill_c = formatters['fill (%s..cycle)']
- local f_eo_fill_c = formatters['eofill (%s..cycle)']
- local f_no_fill_l = formatters['nofill (%s--cycle)']
- local f_do_fill_l = formatters['fill (%s--cycle)']
- local f_eo_fill_l = formatters['eofill (%s--cycle)']
- local f_do_fill = f_do_fill_c
- local f_eo_fill = f_eo_fill_c
- local f_no_fill = f_no_fill_c
--- local s_clip_start = 'draw image ('
--- local f_clip_stop_c = formatters[') ; clip currentpicture to (%s..cycle) ;']
--- local f_clip_stop_l = formatters[') ; clip currentpicture to (%s--cycle) ;']
--- local f_clip_stop = f_clip_stop_c
--- local f_eoclip_stop_c = formatters[') ; eoclip currentpicture to (%s..cycle) ;']
--- local f_eoclip_stop_l = formatters[') ; eoclip currentpicture to (%s--cycle) ;']
--- local f_eoclip_stop = f_eoclip_stop_c
- local s_clip_start = 'save p ; picture p ; p := image ('
- local f_clip_stop_c = formatters[') ; clip p to (%s..cycle) ; draw p ;']
- local f_clip_stop_l = formatters[') ; clip p to (%s--cycle) ; draw p ;']
- local f_clip_stop = f_clip_stop_c
- local f_eoclip_stop_c = formatters[') ; eoclip p to (%s..cycle) ; draw p ;']
- local f_eoclip_stop_l = formatters[') ; eoclip p to (%s--cycle) ; draw p ;']
- local f_eoclip_stop = f_eoclip_stop_c
+ local f_no_draw = formatters[' nodraw (%s)']
+ local f_do_draw = formatters[' draw (%s)']
+ local f_no_fill_c = formatters[' nofill closedcurve(%s)']
+ local f_do_fill_c = formatters[' fill closedcurve(%s)']
+ local f_eo_fill_c = formatters[' eofill closedcurve(%s)']
+ local f_no_fill_l = formatters[' nofill closedlines(%s)']
+ local f_do_fill_l = formatters[' fill closedlines(%s)']
+ local f_eo_fill_l = formatters[' eofill closedlines(%s)']
+ local f_closed_draw = formatters[' draw closedcurve(%s)']
+ local f_do_fill = f_do_fill_c
+ local f_eo_fill = f_eo_fill_c
+ local f_no_fill = f_no_fill_c
+ local s_clip_start <const> = 'save p ; picture p ; p := image ('
+ local f_clip_stop_c = formatters[') ; clip p to closedcurve(%s) %s ; draw p ;']
+ local f_clip_stop_l = formatters[') ; clip p to closedlines(%s) %s ; draw p ;']
+ local f_clip_stop = f_clip_stop_c
+ local f_eoclip_stop_c = formatters[') ; eoclip p to closedcurve(%s) %s ; draw p ;']
+ local f_eoclip_stop_l = formatters[') ; eoclip p to closedlines(%s) %s ; draw p ;']
+ local f_eoclip_stop = f_eoclip_stop_c
-- could be shared and then beginobject | endobject
local function flushobject(object,at,c,o)
local btransform, etransform = handletransform(at)
- local cpath = handleclippath(at)
+ local cpath, _, ctransform = handleclippath(at)
if cpath then
r = r + 1 ; result[r] = s_clip_start
@@ -1883,7 +2266,7 @@ do
r = r + 1 ; result[r] = etransform
end
- r = r + 1 ; result[r] = ";"
+ r = r + 1 ; result[r] = " ;"
if cpath then
local f_done = cpath.evenodd
@@ -1892,7 +2275,7 @@ do
else
f_done = f_done and f_eoclip_stop_l or f_clip_stop_l
end
- r = r + 1 ; result[r] = f_done(cpath[1])
+ r = r + 1 ; result[r] = f_done(cpath[1],ctransform or "")
end
end
@@ -1900,12 +2283,12 @@ do
local flush
- local f_linecap = formatters["interim linecap := %s ;"]
- local f_linejoin = formatters["interim linejoin := %s ;"]
- local f_miterlimit = formatters["interim miterlimit := %s ;"]
+ local f_linecap = formatters[" interim linecap := %s ;"]
+ local f_linejoin = formatters[" interim linejoin := %s ;"]
+ local f_miterlimit = formatters[" interim miterlimit := %s ;"]
- local s_begingroup = "begingroup;"
- local s_endgroup = "endgroup;"
+ local s_begingroup <const> = "begingroup;"
+ local s_endgroup <const> = "endgroup;"
local linecaps = { butt = "butt", square = "squared", round = "rounded" }
local linejoins = { miter = "mitered", bevel = "beveled", round = "rounded" }
@@ -1956,10 +2339,11 @@ do
local refy = rawget(at,"refY")
local width = rawget(at,"markerWidth")
local height = rawget(at,"markerHeight")
+ local units = rawget(at,"markerUnits") -- no parentat["stroke-width"], bad for m4mbo
local view = rawget(at,"viewBox")
local orient = rawget(at,"orient")
-- local ratio = rawget(at,"preserveAspectRatio")
- local units = asnumber(at["markerUnits"] or parentat["stroke-width"]) or 1
+ local units = units and asnumber(units) or 1
local angx = 0
local angy = 0
@@ -2119,7 +2503,7 @@ do
local stroke = at["stroke"] or "none"
local btransform, etransform = handletransform(at)
- local cpath = handleclippath(at)
+ local cpath, _, ctransform = handleclippath(at)
if cpath then
r = r + 1 ; result[r] = s_clip_start
@@ -2128,29 +2512,33 @@ do
local has_stroke = stroke and stroke ~= "none"
local has_fill = fill and fill ~= "none"
- local bopacity, eopacity
+ local bopacity, copacity, eopacity
if has_stroke and has_fill then
- bopacity, eopacity = sharedopacity(at)
+ bopacity, copacity, eopacity = sharedopacity(at)
end
- if bopacity then
+ if copacity then
r = r + 1 ; result[r] = bopacity
end
if has_fill then
- local color, opacity = fillproperties(fill,at,not has_stroke)
+ local color, opacity, option = fillproperties(fill,at,not has_stroke)
local f_xx_fill = at["fill-rule"] == "evenodd" and f_eo_fill or f_do_fill
if btransform then
r = r + 1 ; result[r] = btransform
end
- r = r + 1 result[r] = f_xx_fill(shape)
+ if option == "pattern" then
+ r = r + 1 result[r] = f_closed_draw(shape)
+ else
+ r = r + 1 result[r] = f_xx_fill(shape)
+ end
if color then
r = r + 1 ; result[r] = color
end
if opacity then
r = r + 1 ; result[r] = opacity
end
- r = r + 1 ; result[r] = etransform or ";"
+ r = r + 1 ; result[r] = etransform or " ;"
end
if has_stroke then
@@ -2172,7 +2560,7 @@ do
if opacity then
r = r + 1 ; result[r] = opacity
end
- r = r + 1 ; result[r] = etransform or ";"
+ r = r + 1 ; result[r] = etransform or " ;"
--
if list then
addmarkers(list,begmarker,midmarker,endmarker,at)
@@ -2183,12 +2571,13 @@ do
end
end
- if eopacity then
+ if copacity then
+ r = r + 1 ; result[r] = copacity
r = r + 1 ; result[r] = eopacity
end
if cpath then
- r = r + 1 ; result[r] = (cpath.evenodd and f_eoclip_stop or f_clip_stop)(cpath[1])
+ r = r + 1 ; result[r] = (cpath.evenodd and f_eoclip_stop or f_clip_stop)(cpath[1],ctransform)
end
end
@@ -2230,8 +2619,8 @@ do
y = y - height
- if rx then rx = asnumber(rx) end
- if ry then ry = asnumber(ry) end
+ if rx then rx = asnumber_x(rx) end
+ if ry then ry = asnumber_y(ry) end
if rx or ry then
if not rx then rx = ry end
@@ -2298,8 +2687,8 @@ do
function handlers.polyline(c) poly(c, ")") end
function handlers.polygon (c) poly(c,"--cycle)") end
- local s_image_start = "draw image ("
- local s_image_stop = ") ;"
+ local s_image_start <const> = "draw image ("
+ local s_image_stop <const> = ") ;"
function handlers.path(c)
local at = c.at
@@ -2319,9 +2708,11 @@ do
-- todo: image (nicer for transform too)
if fill and fill ~= "none" then
- local color, opacity = fillproperties(fill,at)
+ local color, opacity, option = fillproperties(fill,at)
local f_xx_fill = at["fill-rule"] == "evenodd"
- if shape.closed then
+ if option == "pattern" then
+ f_xx_fill = f_closed_draw
+ elseif shape.closed then
f_xx_fill = f_xx_fill and f_eo_fill or f_do_fill
elseif shape.curve then
f_xx_fill = f_xx_fill and f_eo_fill_c or f_do_fill_c
@@ -2339,7 +2730,7 @@ do
if opacity then
r = r + 1 ; result[r] = opacity
end
- r = r + 1 ; result[r] = etransform or ";"
+ r = r + 1 ; result[r] = etransform or " ;"
else
r = r + 1 ; result[r] = btransform or s_image_start
for i=1,n do
@@ -2354,7 +2745,7 @@ do
else
r = r + 1 ; result[r] = f_no_fill(shape[i])
end
- r = r + 1 ; result[r] = ";"
+ r = r + 1 ; result[r] = " ;"
end
r = r + 1 ; result[r] = etransform or s_image_stop
end
@@ -2386,9 +2777,9 @@ do
if opacity then
r = r + 1 ; result[r] = opacity
end
- r = r + 1 result[r] = etransform or ";"
+ r = r + 1 result[r] = etransform or " ;"
else
- r = r + 1 result[r] = btransform or "draw image ("
+ r = r + 1 result[r] = btransform or s_draw_image_start
for i=1,n do
r = r + 1 result[r] = f_do_draw(shape[i])
if pen then
@@ -2403,12 +2794,12 @@ do
if opacity then
r = r + 1 ; result[r] = opacity
end
- r = r + 1 ; result[r] = ";"
+ r = r + 1 ; result[r] = " ;"
end
if list then
addmarkers(list,begmarker,midmarker,endmarker,at)
end
- r = r + 1 ; result[r] = etransform or ") ;"
+ r = r + 1 ; result[r] = etransform or s_draw_image_stop
end
if wrapup then
wrapup()
@@ -2416,7 +2807,7 @@ do
end
if cpath then
- r = r + 1 ; result[r] = f_clip_stop(cpath[1])
+ r = r + 1 ; result[r] = f_clip_stop(cpath[1],"")
end
end
@@ -2435,9 +2826,10 @@ do
-- inclusion takes from data
-- specification.data = false
- local f_image = formatters[ [[figure("%s") xysized (%N,%N) shifted (%N,%N)]] ]
+ -- local f_image = formatters[ [[figure("%s") xysized (%N,%N) shifted (%N,%N)]] ]
+ local f_image = formatters[ [[svgembeddedfigure(%i) xysized (%N,%N) shifted (%N,%N)]] ]
- local nofimages = 0
+ -- local nofimages = 0
function handlers.image(c)
local at = c.at
@@ -2460,12 +2852,15 @@ do
h = h and asnumber_y(h)
x = x and asnumber_vx(x) or 0
y = y and asnumber_vy(y) or 0
- nofimages = nofimages + 1
- local name = "temp-svg-image-" .. nofimages .. "." .. kind
- local data = mime.decode("base64")(data)
- io.savedata(name,data)
+ local data = basexx.decode64(data)
+ -- local name = "temp-svg-image-" .. nofimages .. "." .. kind
+ local index = images.storedata("svg", {
+ kind = kind,
+ data = data,
+ info = graphics.identifiers[kind](data,"string"),
+ })
+ -- io.savedata(name,data)
if not w or not h then
- local info = graphics.identifiers[kind](data,"string")
if info then
-- todo: keep aspect ratio attribute
local xsize = info.xsize
@@ -2485,9 +2880,9 @@ do
-- safeguard:
if not w then w = h or 1 end
if not h then h = w or 1 end
- luatex.registertempfile(name)
- -- done:
- flushobject(f_image(name,w,h,x,y - h),at)
+ -- luatex.registertempfile(name)
+ -- flushobject(f_image(name,w,h,x,y - h),at)
+ flushobject(f_image(index,w,h,x,y - h),at)
else
-- nothing done
end
@@ -2508,7 +2903,7 @@ do
local at = c.at
local btransform, etransform, transform = handletransform(at)
- local cpath, clippath = handleclippath(at)
+ local cpath, clippath, ctransform = handleclippath(at)
if cpath then
r = r + 1 ; result[r] = s_clip_start
@@ -2523,7 +2918,7 @@ do
at["transform"] = false
at["clip-path"] = false
- process(c,"/*")
+ process(c,"/!(defs|symbol)") -- /*
at["transform"] = _transform
at["clip-path"] = _clippath
@@ -2539,7 +2934,7 @@ do
else
f_done = f_done and f_eoclip_stop_l or f_clip_stop_l
end
- r = r + 1 ; result[r] = f_done(cpath[1])
+ r = r + 1 ; result[r] = f_done(cpath[1],ctransform or "")
end
end
@@ -2554,37 +2949,40 @@ do
-- The size is a bit of an issue. I assume that the specified size relates to the
-- designsize but we want to be able to use other fonts.
- do
-
- local f_styled = formatters["\\svgstyled{%s}{%s}{%s}{%s}"]
- local f_colored = formatters["\\svgcolored{%.3N}{%.3N}{%.3N}{"]
--- local f_placed = formatters["\\svgplaced{%.3N}{%.3N}{}{"]
-local f_placed = formatters["\\svgplaced{%s}{%s}{}{"]
- local f_poschar = formatters["\\svgposchar{%.3N}{%.3N}{%s}"]
- local f_char = formatters["\\svgchar{%s}"]
+ -- a mix of text and spans and possibly wrap (where xy is to be ignored) ... bah ...
+ -- it's fuzzy when we have a span with positions mixed with text ... basically that
+ -- is a box and we can assume that an editor then has all positioned
- local f_scaled = formatters["\\svgscaled{%N}{%s}{%s}{%s}"]
- local f_normal = formatters["\\svgnormal{%s}{%s}{%s}"]
- local f_hashed = formatters["\\svghashed{%s}"]
-
- -- We move to the outer (x,y) and when we have an inner offset we
- -- (need to) compensate for that outer offset.
+ do
- -- local f_text_scaled_svg = formatters['(svgtext("%s") scaled %N shifted (%N,%N))']
- -- local f_text_normal_svg = formatters['(svgtext("%s") shifted (%N,%N))']
- -- local f_text_simple_svg = formatters['svgtext("%s")']
+ local s_start <const> = "\\svgstart "
+ local s_stop <const> = "\\svgstop "
+ local f_set = formatters["\\svgset{%N}{%N}"] -- we need a period
+ local f_color_c = formatters["\\svgcolorc{%.3N}{%.3N}{%.3N}{"]
+ local f_color_o = formatters["\\svgcoloro{%.3N}{"]
+ local f_color_b = formatters["\\svgcolorb{%.3N}{%.3N}{%.3N}{%.3N}{"]
+ local f_poscode = formatters["\\svgpcode{%N}{%N}{%s}"]
+ local f_poschar = formatters["\\svgpchar{%N}{%N}{%s}"]
+ local f_posspace = formatters["\\svgpspace{%N}{%N}"]
+ local f_code = formatters["\\svgcode{%s}"]
+ local f_char = formatters["\\svgchar{%s}"]
+ local s_space <const> = "\\svgspace "
+ local f_size = formatters["\\svgsize{%0.6f}"] -- we need a period
+ local f_font = formatters["\\svgfont{%s}{%s}{%s}"]
+ local f_hashed = formatters["\\svghashed{%s}"]
+
+ ----- p_texescape = lpegpatterns.texescape
local anchors = {
["start"] = "drt",
- ["end"] = "dflt",
+ ["end"] = "dlft",
["middle"] = "d",
}
- local f_text_normal_svg = formatters['(textext.%s("%s") shifted (%N,%N))']
- local f_text_simple_svg = formatters['textext.%s("%s")']
-
- -- or just maptext
+ -- we can now just use the lmt maptext feature
+ local f_text_normal_svg = formatters['(onetimetextext.%s("%s") shifted (%N,%N))']
+ local f_text_simple_svg = formatters['onetimetextext.%s("%s")']
local f_mapped_normal_svg = formatters['(svgtext("%s") shifted (%N,%N))']
local f_mapped_simple_svg = formatters['svgtext("%s")']
@@ -2599,8 +2997,6 @@ local f_placed = formatters["\\svgplaced{%s}{%s}{}{"]
return v
end)
- local p_texescape = lpegpatterns.texescape
-
-- For now as I need it for my (some 1500) test files.
local function checkedfamily(name)
@@ -2612,123 +3008,171 @@ local f_placed = formatters["\\svgplaced{%s}{%s}{}{"]
-- todo: only escape some chars and handle space
+ -- An arbitrary mix of text and spans with x/y is asking for troubles. The fact that the
+ -- description in the (proposed) standard is so complex indicates this (its also looks
+ -- like reveng application specs and doesn't aim at simplicity. Basically we have two
+ -- cases: positioned lines and words and such (text & span with xy), or just stripes of
+ -- text and span. Free flow automatically broken into lines text is kind of strange in
+ -- svg and the fact that glyph placement is dropped is both an indication that svg lost
+ -- part of its purpose and probably also that it never really was a standard (although
+ -- maybe today standards are just short term specifications. Who knows.
+
+ -- text with spans, all with x/y
+ -- text mixed with spans, no xy in inner elements
+ --
+ -- the spec says that nested x/y are absolute
+
local defaultsize = 10
- local function collect(t,c,x,y,size,scale,family,tx,ty)
- local at = c.at
- local ax = rawget(at,"x")
- local ay = rawget(at,"y")
- local dx = rawget(at,"dx")
- local dy = rawget(at,"dy")
- local v_fill = at["fill"]
- local v_family = at["font-family"]
- local v_style = at["font-style"]
- local v_weight = at["font-weight"]
- local v_size = at["font-size"]
+ local sensitive = { -- todo: characters.sensitive
+ ["#"] = true,
+ ["$"] = true,
+ ["%"] = true,
+ ["&"] = true,
+ ["\\"] = true,
+ ["{"] = true,
+ ["|"] = true,
+ ["}"] = true,
+ ["~"] = true,
+ }
+
+ -- messy: in nested spans (they happen) the x/y are not accumulated
+
+ local function validdelta(usedscale,d)
+ if d then
+ local value, unit = match(d,"^([%A]-)(%a+)")
+ value = tonumber(value) or 0
+ if not unit then
+ return value .. "bp"
+ elseif unit == "ex" or unit == "em" then
+ return (usedscale * value) .. unit
+ else
+ return value .. "bp"
+ end
+ else
+ return "0bp"
+ end
+ end
+
+ local cleanfontname = fonts.names.cleanname
+
+ local x_family = false
+ local x_weight = false
+ local x_style = false
+
+ local function collect(parent,t,c,x,y,size,scale,family,tx,ty,tdx,tdy)
+ if c.special then
+ return nil
+ end
+ local dt = c.dt
+ local nt = #dt
+ local at = c.at
+ local tg = c.tg
+ local ax = rawget(at,"x")
+ local ay = rawget(at,"y")
+ local v_opacity = tonumber(at["fill-opacity"])
+ local v_fill = at["fill"]
+ local v_family = at["font-family"]
+ local v_style = at["font-style"]
+ local v_weight = at["font-weight"]
+ local v_size = at["font-size"]
+ local v_lineheight = at["line-height"]
--
ax = ax and asnumber_vx(ax) or x
ay = ay and asnumber_vy(ay) or y
--
-local d_x = dx and asnumber_vx(dx) or 0
-local d_y = dy and asnumber_vy(dy) or 0
- --
if v_family then v_family = cssfamily(v_family) end
if v_style then v_style = cssstyle (v_style) end
if v_weight then v_weight = cssweight(v_weight) end
- if v_size then v_size = csssize (v_size,factors) or tonumber(v_size) end
+ if v_size then v_size = csssize (v_size,factors,size/100) or tonumber(v_size) end
--
if not v_family then v_family = family end
if not v_weight then v_weight = "normal" end
if not v_style then v_style = "normal" end
--
if v_family then
- v_family = fonts.names.cleanname(v_family)
+ v_family = cleanfontname(v_family)
v_family = checkedfamily(v_family)
end
--
usedfonts[v_family][v_weight][v_style] = true
--
+ local lh = v_lineheight and asnumber_vx(v_lineheight) or false
+ --
ax = ax - x
ay = ay - y
--
- local elayered = ax ~= 0 or ay ~= 0 or false
--- local eplaced = dx ~= 0 or dy ~= 0 or false
-local eplaced = d_x ~= 0 or d_y ~= 0 or false
- local usedsize, usedscaled
-
- if elayered then
- -- we're now at the outer level again so we need to scale
- -- back to the outer level values
- t[#t+1] = formatters["\\svgsetlayer{%0N}{%0N}{"](ax,-ay)
- usedsize = v_size or defaultsize
- usedscale = usedsize / defaultsize
- else
- -- we're nested so we can be scaled
- usedsize = v_size or size
- usedscale = (usedsize / defaultsize) / scale
- end
-usedscale = (10 / bodyfontscale) * usedscale
+ local usedsize = v_size or defaultsize
+ local usedscale = usedsize / defaultsize
--
- if eplaced then
-if dx then
- if not find(dx,"%a") then
- dx = dx .. "bp"
- elseif find(dx,"e") then
- dx = formatters["%s\\dimexpr %s\\relax"](usedscale,dx)
- end
-else
- dx = "0pt"
-end
-if dy then
- if not find(dy,"%a") then
- dy = dy .. "bp"
- elseif find(dy,"e") then
- dy = formatters["%s\\dimexpr %s\\relax"](usedscale,dy)
- end
-else
- dy = "0pt"
-end
- t[#t+1] = f_placed(dx,dy)
- end
+ -- todo: rotate : list of numbers
+ -- todo: lengthAdjust : spacing|spacingAndGlyphs
+ -- todo: textLength : scale to width
+ -- toto: font-size-adjust
+ -- toto: font-stretch
+ -- letter-spacing
+ -- word-spacing
+ -- writing-mode:lr-tb
--
--- if usedscale == 1 then
--- t[#t+1] = f_normal( v_family,v_weight,v_style)
--- else
- t[#t+1] = f_scaled(usedscale,v_family,v_weight,v_style)
--- end
+ local newfont = v_family ~= x_family or v_weight ~= x_weight or v_style ~= x_style
+ if newfont then
+ x_family = v_family
+ x_weight = v_weight
+ x_style = v_style
+ t[#t+1] = f_font(v_family,v_weight,v_style)
+ t[#t+1] = "{"
+ end
+ t[#t+1] = f_size(usedscale)
t[#t+1] = "{"
--
if trace_fonts then
+ -- we can hash and keep it when no change
report("element : %s",c.tg)
report(" font family : %s",v_family)
report(" font weight : %s",v_weight)
report(" font style : %s",v_style)
report(" parent size : %s",size)
- report(" parent scale : %s",scale)
- report(" used size : %s",usedsize)
- report(" used scale : %s",usedscale)
- report(" layered : %l",elayered)
+ -- report(" parent scale : %s",scale)
+ report(" used size : %s",v_size or defaultsize)
end
--
- local ecolored = v_fill and v_fill ~= "" or false
+ local ecolored = v_fill ~= "" and v_fill or false
+ local opacity = v_opacity ~= ignoredopacity and v_opacity or false
+ --
+ -- todo cmyk
+ --
if ecolored then
- -- todo cmyk
local r, g, b = colorcomponents(v_fill)
if r and g and b then
- t[#t+1] = f_colored(r,g,b)
+ if opacity then
+ t[#t+1] = f_color_b(r,g,b,opacity)
+ else
+ t[#t+1] = f_color_c(r,g,b)
+ end
+ elseif opacity then
+ t[#t+1] = f_color_o(opacity)
else
ecolored = false
end
+ elseif opacity then
+ t[#t+1] = f_color_o(opacity)
end
--
- local dt = c.dt
- local nt = #dt
+ local hasa = ax ~= 0 or ay ~= 0
+ if hasa then
+ -- we abuse the fact that flushing layers can be nested
+ t[#t+1] = f_set(ax or 0,ay or 0)
+ t[#t+1] = "{"
+ end
for i=1,nt do
local di = dt[i]
if type(di) == "table" then
- -- can be a tspan (should we pass dx too)
- collect(t,di,x,y,usedsize,usedscale,v_family)
+ -- when x or y then absolute else inline
+ if #di.dt > 0 then
+ collect(tg,t,di,x,y,usedsize,usedscale,v_family)
+ end
else
+ -- check for preserve
if i == 1 then
di = gsub(di,"^%s+","")
end
@@ -2737,117 +3181,162 @@ end
end
local chars = utfsplit(di)
if svghash then
+ -- dx dy
di = f_hashed(svghash[di])
- elseif tx then
- for i=1,#chars do
- chars[i] = f_poschar(
- (tx[i] or 0) - x,
- (ty[i] or 0) - y,
- utfbyte(chars[i])
- )
- end
- di = "{" .. concat(chars) .. "}"
else
- -- this needs to be texescaped ! and even quotes and newlines
- -- or we could register it but that's a bit tricky as we nest
- -- and don't know what we can expect here
- -- di = lpegmatch(p_texescape,di) or di
- for i=1,#chars do
- chars[i] = f_char(utfbyte(chars[i]))
+ if tx or ty or tdx or tdy then
+ local txi, tyi, tdxi, tdyi
+ for i=1,#chars do
+ txi = tx and (tx [i] or txi )
+ tyi = ty and (ty [i] or tyi )
+ tdxi = tdx and (tdx[i] or tdxi) or 0
+ tdyi = tdy and (tdy[i] or tdyi) or 0
+ local dx = (txi and (txi - x) or 0) + tdxi
+ local dy = (tyi and (tyi - y) or 0) + tdyi
+ local ci = chars[i]
+ if ci == " " then
+ chars[i] = f_posspace(dx, dy)
+ elseif sensitive[ci] then
+ chars[i] = f_poscode(dx, dy, utfbyte(ci))
+ else
+ chars[i] = f_poschar(dx, dy, ci)
+ end
+ end
+ di = "{" .. concat(chars) .. "}"
+ t[#t+1] = di
+ else
+ -- this needs to be texescaped ! and even quotes and newlines
+ -- or we could register it but that's a bit tricky as we nest
+ -- and don't know what we can expect here
+ -- di = lpegmatch(p_texescape,di) or di
+ for i=1,#chars do
+ local ci = chars[i]
+ if ci == " " then
+ chars[i] = s_space
+ elseif sensitive[ci] then
+ chars[i] = f_code(utfbyte(ci))
+ else
+ chars[i] = f_char(ci)
+ -- chars[i] = ci
+ end
+ end
+ di = concat(chars)
+ t[#t+1] = di
end
- di = concat(chars)
end
- t[#t+1] = di
+ end
+ end
+ if hasa then
+ if t[#t] == "{" then
+ t[#t] = nil
+ t[#t] = nil
+ else
+ t[#t+1] = "}"
end
end
--
- if ecolored then
+ if opacity or ecolored then
t[#t+1] = "}"
end
--
t[#t+1] = "}"
--
- if eplaced then
- t[#t+1] = "}"
- end
- if elayered then
+ if newfont then
t[#t+1] = "}"
end
--
return t
end
- local s_startlayer = "\\svgstartlayer "
- local s_stoplayer = "\\svgstoplayer "
+ -- case 1: just text, maybe with spans
+ -- case 2: only positioned spans
+ -- case 3: just text, seen as label
+
+ local textlevel = 0
function handlers.text(c)
+ if textlevel == 0 then
+ x_family = v_family
+ x_weight = v_weight
+ x_style = v_style
+ end
+ --
+ textlevel = textlevel + 1
+ -- analyze
local only = fullstrip(xmltextonly(c))
- -- if metapost.processing() then
- local at = c.at
- local x = rawget(at,"x")
- local y = rawget(at,"y")
+ local at = c.at
+ local x = rawget(at,"x")
+ local y = rawget(at,"y")
+
+ local dx = rawget(at,"dx")
+ local dy = rawget(at,"dy")
--- local dx = rawget(at,"dx")
--- local dy = rawget(at,"dy")
+ local tx = asnumber_vx_t(x)
+ local ty = asnumber_vy_t(y)
- local tx = asnumber_vx_t(x)
- local ty = asnumber_vy_t(y)
+ local tdx = asnumber_vx_t(dx)
+ local tdy = asnumber_vy_t(dy)
--- dx = dx and asnumber_vx(dx) or 0
--- dy = dy and asnumber_vy(dy) or 0
+ x = tx[1] or 0 -- catch bad x/y spec
+ y = ty[1] or 0 -- catch bad x/y spec
- x = tx[1] or 0 -- catch bad x/y spec
- y = ty[1] or 0 -- catch bad x/y spec
+ dx = tdx[1] or 0 -- catch bad x/y spec
+ dy = tdy[1] or 0 -- catch bad x/y spec
- local v_fill = at["fill"]
- if not v_fill or v_fill == "none" then
- v_fill = "black"
+ local v_fill = at["fill"]
+ if not v_fill or v_fill == "none" then
+ v_fill = "black"
+ end
+ local color, opacity, option = fillproperties(v_fill,at)
+ local anchor = anchors[at["text-anchor"] or "start"] or "drt"
+ local remap = metapost.remappedtext(only)
+ -- x = x + dx
+ -- y = y + dy
+ if remap then
+ if x == 0 and y == 0 then
+ only = f_mapped_simple_svg(remap.index)
+ else
+ only = f_mapped_normal_svg(remap.index,x,y)
end
- local color, opacity, invisible = fillproperties(v_fill,at)
- local anchor = anchors[at["text-anchor"] or "start"] or "drt"
- local r = metapost.remappedtext(only)
--- x = x + dx
--- y = y + dy
- if r then
- if x == 0 and y == 0 then
- only = f_mapped_simple_svg(r.index)
- else
- only = f_mapped_normal_svg(r.index,x,y)
- end
- flushobject(only,at,color,opacity)
- if trace_text then
- report("text: %s",only)
- end
- elseif not invisible then -- can be an option
- local scale = 1
- local textid = 0
- local result = { }
- local nx = #tx
- local ny = #ty
- --
- result[#result+1] = s_startlayer
- if nx > 1 or ny > 1 then
- concat(collect(result,c,x,y,defaultsize,1,"serif",tx,ty))
- else
- concat(collect(result,c,x,y,defaultsize,1,"serif"))
- end
- result[#result+1] = s_stoplayer
- result = concat(result)
- if x == 0 and y == 0 then
- result = f_text_simple_svg(anchor,result)
- else
- result = f_text_normal_svg(anchor,result,x,y)
- end
- flushobject(result,at,color,opacity)
- if trace_text then
- report("text: %s",result)
- end
- elseif trace_text then
+ flushobject(only,at,color,opacity)
+ if trace_text then
+ report("text: %s",only)
+ end
+ elseif option == "invisible" then
+ if trace_text then
report("invisible text: %s",only)
end
- -- elseif trace_text then
- -- report("ignored text: %s",only)
- -- end
+ else
+ local scale = 1
+ local textid = 0
+ local result = { }
+ local nx = #tx
+ local ny = #ty
+ local ndx = #tdx
+ local ndy = #tdy
+ --
+ local t = { }
+ t[#t+1] = s_start
+ if nx > 1 or ny > 1 or ndx > 1 or ndy > 1 then
+ collect(tg,t,c,x,y,defaultsize,1,"serif",tx,ty,tdx,tdy)
+ else
+ collect(tg,t,c,x,y,defaultsize,1,"serif")
+ end
+ t[#t+1] = s_stop
+ t = concat(t)
+ if x == 0 and y == 0 then
+ t = f_text_simple_svg(anchor,t)
+ else -- dx dy
+ t = f_text_normal_svg(anchor,t,x,y)
+ end
+ -- flushobject(t,at,color,opacity) -- otherwise mixup with transparency
+ flushobject(t,at,false,false)
+ if trace_text then
+ report("text: %s",result)
+ end
+ end
+ --
+ textlevel = textlevel - 1
end
function metapost.reportsvgfonts()
@@ -2892,8 +3381,6 @@ end
local btransform, etransform, transform = handletransform(at)
-bodyfontscale = tex.getdimen("bodyfontsize") / 65536
-
if trace then
report("view: %s, xpct %N, ypct %N","before",percentage_x,percentage_y)
end
@@ -2940,7 +3427,7 @@ bodyfontscale = tex.getdimen("bodyfontsize") / 65536
if bhacked then
r = r + 1 ; result[r] = bhacked
end
- local boffset, eoffset = offset(at)
+ local boffset, eoffset = handleoffset(at)
if boffset then
r = r + 1 result[r] = boffset
end
@@ -2948,7 +3435,7 @@ bodyfontscale = tex.getdimen("bodyfontsize") / 65536
at["transform"] = false
at["viewBox"] = false
- process(c,"/*")
+ process(c,"/!(defs|symbol)")
at["transform"] = transform
at["viewBox"] = viewbox
@@ -2997,6 +3484,7 @@ bodyfontscale = tex.getdimen("bodyfontsize") / 65536
function metapost.svgtomp(specification,pattern,notransform,normalize)
local mps = ""
local svg = specification.data
+ images.resetstore("svg")
if type(svg) == "string" then
svg = xmlconvert(svg)
end
@@ -3016,6 +3504,7 @@ bodyfontscale = tex.getdimen("bodyfontsize") / 65536
end
handlechains(c)
xmlinheritattributes(c) -- put this in handlechains
+ handledefinitions(c)
handlers.svg (
c,
specification.x,
@@ -3027,7 +3516,12 @@ bodyfontscale = tex.getdimen("bodyfontsize") / 65536
normalize,
specification.remap
)
- if trace_result then
+ if trace_result == "file" then
+ io.savedata(
+ tex.jobname .. "-svg-to-mp.tex",
+ "\\startMPpage[instance=doublefun]\n" .. concat(result,"\n") .. "\n\\stopMPpage\n"
+ )
+ elseif trace_result then
report("result graphic:\n %\n t",result)
end
if usedcolors and next(usedcolors) then
@@ -3061,7 +3555,8 @@ do
local bpfactor = number.dimenfactors.bp
function metapost.includesvgfile(filename,offset) -- offset in sp
- if lfs.isfile(filename) then
+ local fullname = resolvers.findbinfile(filename)
+ if lfs.isfile(fullname) then
context.startMPcode("doublefun")
context('draw lmt_svg [ filename = "%s", offset = %N ] ;',filename,(offset or 0)*bpfactor)
context.stopMPcode()
@@ -3089,8 +3584,9 @@ do
function metapost.showsvgpage(data)
local dd = data.data
if not dd then
- local fn = data.filename
- dd = fn and table.load(fn)
+ local filename = data.filename
+ local fullname = filename and resolvers.findbinfile(filename)
+ dd = fullname and table.load(fullname)
end
if type(dd) == "table" then
local comment = data.comment
diff --git a/Master/texmf-dist/tex/context/base/mkxl/mult-aux.mkxl b/Master/texmf-dist/tex/context/base/mkxl/mult-aux.mkxl
index 40667e17d85..08d75a5b3cf 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/mult-aux.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/mult-aux.mkxl
@@ -15,13 +15,19 @@
%D (interface might change). The code here evolved in an email exchange between me
%D and Wolgang Schuster.
+%D We use constant definitions here because we don't need to expand the keywords
+%D which saves a little on the stack (read: memory access). The gain in performance
+%D is normally not noticeable unless one has plenty of parameter checking, which
+%D can happen in some scenarios. Even then the gain is only there when one has
+%D thousands of runs on e.g. virtual platforms.
+
\writestatus{loading}{ConTeXt Multilingual Macros / Helpers}
\registerctxluafile{mult-aux}{}
\unprotect
-\immutable\edef\??empty{\Uchar25} \immutable\letvalue{\Uchar25}\empty % hex 19
+\immutable\cdef\??empty{\Uchar25} \immutable\letvalue{\Uchar25}\empty % hex 19
% \edef\s!parent{\Uchar29} % inlining  is ugly, a tiny bit faster, but neglectable on a run
@@ -84,7 +90,7 @@
% KEEP THIS:
%
-% \let\m_mult_interfaces_namespace\empty
+% \lettonothing\m_mult_interfaces_namespace
%
% \def\mult_interfaces_get_parameters#1[#2%
% {\if\noexpand#2]%
@@ -172,7 +178,7 @@
%D a comma and trigger a warning but we intercept that elsewhere. The alternative is
%D to skip to the comma first which takes more time.
-\let\m_mult_interfaces_namespace\empty
+\lettonothing\m_mult_interfaces_namespace
\def\mult_interfaces_get_parameters#1[%
{\def\m_mult_interfaces_namespace{#1}%
@@ -215,16 +221,16 @@
\stopinterface
-%D Used?
-
-\def\mult_check_for_assignment_indeed#-=#1#-^^^^0004%
- {\if#1^^^^0003\assignmentfalse\else\assignmenttrue\fi}
-
-\def\mult_check_for_assignment_indeed_begin_#-=#1#-^^^^0004%
- {\if#1^^^^0003}
-
-\def\mult_check_for_assignment#1%
- {\expandafter\mult_check_for_assignment_indeed\detokenize{#1}=^^^^0003^^^^0003^^^^0004}
+% % No longer used:
+%
+% \def\mult_check_for_assignment_indeed#-=#1#-^^^^0004%
+% {\if#1^^^^0003\assignmentfalse\else\assignmenttrue\fi}
+%
+% \def\mult_check_for_assignment_indeed_begin_#-=#1#-^^^^0004%
+% {\if#1^^^^0003}
+%
+% \def\mult_check_for_assignment#1%
+% {\expandafter\mult_check_for_assignment_indeed\detokenize{#1}=^^^^0003^^^^0003^^^^0004}
%D Beware, zero arguments is an assignment!
@@ -266,7 +272,7 @@
% slower: \def#3##1{\csname\ifcsname#1#2:##1\endcsname\expandafter\csstring\lastnamedcs\else\expandafter#5\csname#1#2:\s!parent\endcsname{##1}\fi\endcsname}%
%D pre-expansion can be a bit faster but handly any effect on a normal run so let's
-%D go for saving some memory
+%D go for saving some memory.
\def\mult_interfaces_detokenize{\expandafter\expandafter\expandafter\detokenize\expandafter\expandafter\expandafter}
@@ -336,7 +342,7 @@
% \startinterface english
\protected\def\mult_interfaces_install_parameter_set_handler#1#2#3#4#5#6%
{\frozen\protected\def#3##1{\defcsname#1#2:##1\endcsname}% ##1 {##2} (braces are mandate)
- \frozen\protected\def#4##1{\edefcsname#1#2:##1\endcsname}% ##1 {##2} (braces are mandate)
+ \frozen\protected\def#4##1{\edefcsname#1#2:##1\endcsname}% ##1 {##2} (braces are mandate)
\frozen\protected\def#5##1{\letcsname#1#2:##1\endcsname}% ##1 ##2
\frozen\protected\def#6##1{\letcsname#1#2:##1\endcsname\empty}}% ##1
% \stopinterface
@@ -355,8 +361,10 @@
\mutable\let\dousecurrentstyleparameter\relax
\mutable\let\dousecurrentcolorparameter\relax
-\mutable\let\currentstyleparameter\empty
-\mutable\let\currentcolorparameter\empty
+\mutable\lettonothing\currentstyleparameter
+\mutable\lettonothing\currentcolorparameter
+
+% maybe we should have \names ones too
\protected\def\mult_interfaces_install_style_and_color_handler#1#2#3#4%
{\frozen\protected\def#2##1##2% style color
@@ -400,35 +408,35 @@
{\let#8#4%
% watch out: no \edef#4{##1} before the ifarguments because #1 can have macros
\ifarguments
- \let#4\empty
+ \lettonothing#4%
\the#5% predefine
- \let#7\empty
+ \lettonothing#7%
\letcsname#1#4:\s!chain\endcsname\empty
- \edefcsname#1#4:\s!parent\endcsname{#3}%
+ \cdefcsname#1#4:\s!parent\endcsname{#3}%
\or
\edef#4{##1}%
\the#5% predefine
- \let#7\empty
- \edefcsname#1#4:\s!chain\endcsname{##1}%
- \edefcsname#1#4:\s!parent\endcsname{#3}%
+ \lettonothing#7%
+ \cdefcsname#1#4:\s!chain\endcsname{##1}%
+ \cdefcsname#1#4:\s!parent\endcsname{#3}%
\or
\edef#4{##1}%
\the#5% predefine
\relax
\ifhastok={##2}%
- \let#7\empty
- \edefcsname#1#4:\s!chain\endcsname{##1}%
- \edefcsname#1#4:\s!parent\endcsname{#3}%
+ \lettonothing#7%
+ \cdefcsname#1#4:\s!chain\endcsname{##1}%
+ \cdefcsname#1#4:\s!parent\endcsname{#3}%
\mult_interfaces_get_parameters{#1#4:}[##2]%
\else
\edef#7{##2}%
\ifempty#7%
- \edefcsname#1#4:\s!chain\endcsname{##1}%
- \edefcsname#1#4:\s!parent\endcsname{#3}%
+ \cdefcsname#1#4:\s!chain\endcsname{##1}%
+ \cdefcsname#1#4:\s!parent\endcsname{#3}%
\else
\mult_check_for_parent{#1}{#3}#4#7%
- \edefcsname#1#4:\s!chain\endcsname{\mult_interfaces_chain#1{##2}##1}%
- \edefcsname#1#4:\s!parent\endcsname{#1##2}%
+ \cdefcsname#1#4:\s!chain\endcsname{\mult_interfaces_chain#1{##2}##1}%
+ \cdefcsname#1#4:\s!parent\endcsname{#1##2}%
\fi
\fi
\or
@@ -436,8 +444,8 @@
\the#5% predefine
\edef#7{##2}%
\mult_check_for_parent{#1}{#3}#4#7%
- \edefcsname#1#4:\s!chain\endcsname{\mult_interfaces_chain#1{##2}##1}%
- \edefcsname#1#4:\s!parent\endcsname{#1##2}%
+ \cdefcsname#1#4:\s!chain\endcsname{\mult_interfaces_chain#1{##2}##1}%
+ \cdefcsname#1#4:\s!parent\endcsname{#1##2}%
\mult_interfaces_get_parameters{#1#4:}[##3]%
\fi
\the#6%
@@ -470,7 +478,7 @@
\the#4}%
\processcommalist[##1]#8%
\else
- \let#3\empty
+ \lettonothing#3%
\mult_interfaces_get_parameters{#1:}[##1]%
\the#4%
\fi
@@ -507,7 +515,7 @@
{\ifarguments
% \setuplayout
\let#6#3% % previous becomes current
- \let#3\empty % current becomes empty
+ \lettonothing#3% % current becomes empty
#2\doingrootsetroot
\the#5%
\the#8% switchsetups
@@ -516,7 +524,7 @@
% \setuplayout[key=value]
\let#7#3%
\let#6#3%
- \let#3\empty
+ \lettonothing#3%
#2\doingrootsetuproot
\mult_interfaces_get_parameters{#1:}[##1]%
\the#5%
@@ -577,10 +585,10 @@
\frozen\tolerant\protected\def#2[##1]##*[##2]##*[##3]%
{\let#7#3%
\ifarguments
- \let#3\empty
- \the#5%
+ \lettonothing#3%
+ \the#4%
\or
- \let#3\empty
+ \lettonothing#3%
\mult_interfaces_get_parameters{#1:}[##1]%
\the#4%
\or
@@ -619,11 +627,11 @@
\installparametersethandler {#1}{#2}%
\installrootparameterhandler{#1}{#2}}
-\permanent\protected\def\installbasicautosetuphandler#1#2#3% \??self name \??parent (can be \??self)
+\permanent\protected\def\installbasicautosetuphandler#1#2% \??self name \??parent (can be \??self)
{\installbasicparameterhandler{#1}{#2}%
\installautosetuphandler {#1}{#2}}
-\permanent\protected\def\installstylisticautosetuphandler#1#2#3% \??self name \??parent (can be \??self)
+\permanent\protected\def\installstylisticautosetuphandler#1#2% \??self name \??parent (can be \??self)
{\installbasicparameterhandler{#1}{#2}%
\installautosetuphandler {#1}{#2}%
\installstyleandcolorhandler {#1}{#2}}
@@ -755,17 +763,17 @@
{\frozen\tolerant\protected\defcsname#1\endcsname[##1]##*[##2]%
{\begingroup
\ifarguments
- \let#2\empty
+ \lettonothing#2%
\or
%\ifcondition\expandafter\mult_check_for_assignment_indeed_begin_\detokenize{##1}=^^^^0003^^^^0003^^^^0004%
% \ifcondition\mult_aux_no_assignment_indeed##1\ignorearguments
% \edef#2{##1}%
% \else
- % \let#2\empty
+ % \lettonothing#2%
% #3[##1]%
% \fi
\ifhastok={##1}%
- \let#2\empty
+ \lettonothing#2%
#3[##1]%
\else
\edef#2{##1}%
@@ -788,7 +796,7 @@
% First we had, in tune with the regular system variables:
%
% \starttyping
-% \protected\def\installnamespace#1{\setvalue{????#1}{@@@@#1}}
+% \protected\def\installnamespace#1{\defcsname ????#1\endcsname{@@@@#1}}
% \stoptyping
%
% The following variant is nicer and in principle faster but that gets unnoticed
@@ -810,25 +818,28 @@
% todo: register namespaces at lua end for logging and reverse resolve
% todo: move this to syst-ini so that we can use it real early
-\newcount\c_mult_interfaces_n_of_namespaces
+\newinteger\c_mult_interfaces_n_of_namespaces
+
+% \def\v_interfaces_prefix_template
+% {\number\c_mult_interfaces_n_of_namespaces>}
\def\v_interfaces_prefix_template
- {\number\c_mult_interfaces_n_of_namespaces>}
+ {\tohexadecimal\c_mult_interfaces_n_of_namespaces>}
\permanent\protected\def\installnamespace#1% for modules and users
{\ifcsname ????#1\endcsname
\writestatus\m!system{duplicate user namespace '#1'}\wait
\else
- \global\advance\c_mult_interfaces_n_of_namespaces\plusone
- \immutable\edefcsname ????#1\endcsname{\v_interfaces_prefix_template}%
+ \global\advanceby\c_mult_interfaces_n_of_namespaces\plusone
+ \global\immutable\cdefcsname ????#1\endcsname{\v_interfaces_prefix_template}%
\fi}
\permanent\protected\def\installcorenamespace#1%
{\ifcsname ??#1\endcsname
\writestatus\m!system{duplicate core namespace '#1'}\wait
\else
- \global\advance\c_mult_interfaces_n_of_namespaces\plusone
- \immutable\edefcsname ??#1\endcsname{\v_interfaces_prefix_template}%
+ \global\advanceby\c_mult_interfaces_n_of_namespaces\plusone
+ \global\immutable\cdefcsname ??#1\endcsname{\v_interfaces_prefix_template}%
\clf_registernamespace\c_mult_interfaces_n_of_namespaces{#1}%
\fi}
@@ -853,6 +864,7 @@
\permanent\protected\def\setdummyparameter #1{\defcsname\??dummy#1\endcsname}
\permanent\protected\def\setexpandeddummyparameter#1{\edefcsname\??dummy#1\endcsname}
\permanent\protected\def\letdummyparameter #1{\letcsname\??dummy#1\endcsname}
+\permanent\protected\def\resetdummyparameter #1{\letcsname\??dummy#1\endcsname\empty}
\edef\mult_interfaces_dummy{\??dummy} % nor immutable
@@ -957,6 +969,9 @@
\expandafter\firstofoneargument
\fi}
+\permanent\def\ifcommandhandler#1#2% namespace name
+ {\ifcsname#1#2:\s!parent\endcsname}
+
% another set of (fast) helpers (grep for usage):
\permanent\def\expandnamespaceparameter#1#2#3% \??xx \getp \c!xx \v!yy
@@ -977,11 +992,11 @@
%D Conventions:
%D
%D \starttyping
-%D \newcount \c_class_whatever
+%D \newinteger \c_class_whatever
%D \newconditional \c_class_whatever
%D \newconstant \c_class_whatever
-%D \newdimen \d_class_whatever
-%D \newskip \s_class_whatever
+%D \newdimension \d_class_whatever
+%D \newgluespec \s_class_whatever
%D \newmuskip \s_class_whatever
%D \newbox \b_class_whatever
%D \newtoks \t_class_whatever
@@ -997,8 +1012,8 @@
\mutable\let\c_mult_set\relax
\protected\def\mult_interfaces_install_definition_set#1#2#3#4#5#6#7%
- {\newcount#3%
- \let#6\empty
+ {\newinteger#3%
+ \lettonothing#6%
\protected\def#2%
{\expandafter\let\expandafter\c_mult_set\csname #1_t_#6\endcsname
\ifrelax\c_mult_set
@@ -1007,12 +1022,12 @@
\fi}
\frozen\protected\def#4##1%
{\pushmacro#6%
- \advance#3\plusone
+ \advanceby#3\plusone
\edef#6{##1}%
\unprotect}%
\frozen\protected\def#5%
{\protect
- \advance#3\minusone
+ \advanceby#3\minusone
\popmacro#6}%
\frozen\protected\def#7##1%
{\edef#6{##1}%
@@ -1068,20 +1083,21 @@
\expandafter\noexpand\csname current#2parent\endcsname
\expandafter\noexpand\csname inject#2parent\endcsname}}
-% The \LUA\ based variant is twice as fast as the above but as said, we don't use
-% this one that often. It's more about less tracing than speed here.
-
-\permanent\protected\def\installmacrostack#1%
- {\ifdefined#1\else\mutable\let#1\empty\fi
- \protected\gdefcsname push_macro_\csstring#1\endcsname{\localpushmacro#1}%
- \protected\gdefcsname pop_macro_\csstring#1\endcsname{\localpopmacro #1}}
+%D Cheaper (assumes grouping at some point):
-\permanent\protected\def\installglobalmacrostack#1%
- {\ifdefined#1\else\mutable\glet#1\empty\fi
- \protected\gdefcsname push_macro_\csstring#1\endcsname{\globalpushmacro#1}%
- \protected\gdefcsname pop_macro_\csstring#1\endcsname{\globalpopmacro #1}}
+\permanent\protected\def\mult_interfaces_install_local_current_injector#1#2#3#4%
+ {\protected\def#4##1%
+ {\advanceby#2\plusone
+ \edef#3{##1:\the#2}% \currentXXX
+ \edefcsname#1#3:\s!parent\endcsname{#1##1}}}
-% \showmacrostack can be used to see if there are different entries
+\permanent\protected\def\installlocalcurrenthandler#1#2% \??XXX {XXX}
+ {\expandafter\newinteger\csname#1:\s!counter\endcsname
+ \normalexpanded{\mult_interfaces_install_local_current_injector
+ {\noexpand#1}%
+ \expandafter\noexpand\csname #1:\s!counter\endcsname
+ \expandafter\noexpand\csname current#2\endcsname
+ \expandafter\noexpand\csname setlocal#2current\endcsname}}
% \unprotect
%
@@ -1169,4 +1185,71 @@
\permanent\protected\def\commalistprocessor#1{\csname\??commalistprocessor#1\endcsname}
+%D This is a special one, used in \METAPOST\ graphic support. It is english only because
+%D we have no multilingual interface in \METAFUN.
+
+\startinterface english
+ \let\mult_interfaces_install_native_auto_setup_handler\mult_interfaces_install_auto_setup_handler
+ \aliased\let\installbasicnativeautosetuphandler\installbasicsetuphandler
+\stopinterface
+
+\ifdefined\installnativebasicsetuphandler \else
+
+ \let\mult_interfaces_adef_yes\mult_interfaces_adef
+ \protected\def\mult_interfaces_adef_nop#1#2{\defcsname#1#2\endcsname}
+
+ \protected\def\mult_interfaces_install_native_auto_setup_handler#1#2#3#4#5#6#7#8%
+ {\newtoks#4%
+ \frozen\protected\def#5{\mult_interfaces_get_parameters{#1#3:}}%
+ \frozen\tolerant\protected\def#2[##1]##*[##2]##*[##3]%
+ {\let#7#3%
+ \ifarguments
+ \lettonothing#3%
+ \the#4%
+ \or
+ \lettonothing#3%
+ \let\mult_interfaces_adef\mult_interfaces_adef_nop
+ \mult_interfaces_get_parameters{#1:}[##1]%
+ \let\mult_interfaces_adef\mult_interfaces_adef_yes
+ \the#4%
+ \or
+ \def#8####1%
+ {\edef#3{####1}%
+ #6% checks parent and sets if needed
+ \let\mult_interfaces_adef\mult_interfaces_adef_nop
+ \mult_interfaces_get_parameters{#1#3:}[##2]%
+ \let\mult_interfaces_adef\mult_interfaces_adef_yes
+ \the#4}%
+ \processcommalist[##1]#8%
+ \or
+ \def#8####1%
+ {\edef#3{####1}%
+ \defcsname#1#3:\s!parent\endcsname{#1##2}%
+ \let\mult_interfaces_adef\mult_interfaces_adef_nop
+ \mult_interfaces_get_parameters{#1#3:}[##3]% always sets parent
+ \let\mult_interfaces_adef\mult_interfaces_adef_yes
+ \the#4}%
+ \processcommalist[##1]#8%
+ \fi
+ \let#3#7}}
+
+ \permanent\protected\def\installnativeautosetuphandler#1#2%
+ {\mutable\letcsname current#2\endcsname\empty
+ \normalexpanded
+ {\mult_interfaces_install_native_auto_setup_handler
+ {\noexpand#1}% \??aa
+ \expandafter\noexpand\csname setup#2\endcsname
+ \expandafter\noexpand\csname current#2\endcsname
+ \expandafter\noexpand\csname everysetup#2\endcsname
+ \expandafter\noexpand\csname setupcurrent#2\endcsname
+ \expandafter\noexpand\csname check#2parent\endcsname
+ \expandafter\noexpand\csname saved_setup_current#2\endcsname
+ \expandafter\noexpand\csname nested_setup_current#2\endcsname}}
+
+ \permanent\protected\def\installbasicnativeautosetuphandler#1#2%
+ {\installbasicparameterhandler {#1}{#2}%
+ \installnativeautosetuphandler{#1}{#2}}
+
+\fi
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/mult-def.mkxl b/Master/texmf-dist/tex/context/base/mkxl/mult-def.mkxl
index 13e22dadebf..de57d93b980 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/mult-def.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/mult-def.mkxl
@@ -15,14 +15,14 @@
\installcorenamespace{multilingual}
-\immutable\setvalue{\??multilingual czech}{cs}
-\immutable\setvalue{\??multilingual german}{de}
-\immutable\setvalue{\??multilingual english}{en}
-\immutable\setvalue{\??multilingual french}{fr}
-\immutable\setvalue{\??multilingual italian}{it}
-\immutable\setvalue{\??multilingual dutch}{nl}
-\immutable\setvalue{\??multilingual persian}{pe}
-\immutable\setvalue{\??multilingual romanian}{ro}
+\immutable\defcsname\??multilingual czech\endcsname{cs}
+\immutable\defcsname\??multilingual german\endcsname{de}
+\immutable\defcsname\??multilingual english\endcsname{en}
+\immutable\defcsname\??multilingual french\endcsname{fr}
+\immutable\defcsname\??multilingual italian\endcsname{it}
+\immutable\defcsname\??multilingual dutch\endcsname{nl}
+\immutable\defcsname\??multilingual persian\endcsname{pe}
+\immutable\defcsname\??multilingual romanian\endcsname{ro}
\permanent\def\userinterfacetag{\ifcsname\??multilingual\currentinterface\endcsname\lastnamedcs\else en\fi}
\permanent\def\userresponsestag{\ifcsname\??multilingual\currentresponses\endcsname\lastnamedcs\else en\fi}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/mult-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/mult-ini.lmt
index 7c60d5b33af..a58e600592f 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/mult-ini.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/mult-ini.lmt
@@ -17,7 +17,7 @@ local implement = interfaces.implement
local allocate = utilities.storage.allocate
local mark = utilities.storage.mark
-local prtcatcodes = catcodes.numbers.prtcatcodes
+----- prtcatcodes = catcodes.numbers.prtcatcodes
local vrbcatcodes = catcodes.numbers.vrbcatcodes
local contextsprint = context.sprint
local setmetatableindex = table.setmetatableindex
diff --git a/Master/texmf-dist/tex/context/base/mkxl/mult-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/mult-ini.mkxl
index 17f63ef93b9..19370814f76 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/mult-ini.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/mult-ini.mkxl
@@ -19,8 +19,10 @@
\unprotect
-\registerctxluafile{mult-ini}{autosuffix}
-\registerctxluafile{mult-fmt}{initexonly}
+\pushoverloadmode
+ \registerctxluafile{mult-ini}{autosuffix}
+ \registerctxluafile{mult-fmt}{initexonly}
+\popoverloadmode
%D \macros
%D [constanten,variabelen,commands]
@@ -53,14 +55,14 @@
%D \type {!!!!}. In the meantime some of these are obsolete (we had some 12
%D originally).
-\immutable\def\c!prefix!{c!}
-\immutable\def\k!prefix!{k!}
-\immutable\def\e!prefix!{e!}
-\immutable\def\f!prefix!{f!} % for the moment we keep this one
-\immutable\def\m!prefix!{m!}
-\immutable\def\s!prefix!{s!}
-\immutable\def\v!prefix!{v!}
-\immutable\def\t!prefix!{t!}
+\immutable\cdef\c!prefix!{c!}
+\immutable\cdef\k!prefix!{k!}
+\immutable\cdef\e!prefix!{e!}
+\immutable\cdef\f!prefix!{f!} % for the moment we keep this one
+\immutable\cdef\m!prefix!{m!}
+\immutable\cdef\s!prefix!{s!}
+\immutable\cdef\v!prefix!{v!}
+\immutable\cdef\t!prefix!{t!}
%D \macros
%D [constants,variables,commands]
@@ -71,22 +73,22 @@
%D \type {??}, and a system constant, which has the prefix \type {c!}. We'll se some
%D more of this.
-\immutable\def\??prefix {??}
-\immutable\def\@@prefix {@@}
+\immutable\cdef\??prefix {??}
+\immutable\cdef\@@prefix {@@}
%D Just to be complete we repeat some of the already defined system constants here.
%D Maybe their prefix \type {\s!} now falls into place.
-\def\s!next {next} \def\s!default {default}
-\def\s!dummy {dummy} \def\s!unknown {unknown}
+\cdef\s!next {next} \cdef\s!default {default}
+\cdef\s!dummy {dummy} \cdef\s!unknown {unknown}
-\def\s!do {do} \def\s!dodo {dodo}
+\cdef\s!do {do} \cdef\s!dodo {dodo}
-\def\s!complex {complex} \def\s!start {start}
-\def\s!simple {simple} \def\s!stop {stop}
+\cdef\s!complex {complex} \cdef\s!start {start}
+\cdef\s!simple {simple} \cdef\s!stop {stop}
-\def\s!true {true}
-\def\s!false {false}
+\cdef\s!true {true}
+\cdef\s!false {false}
%D The word \type {height} takes 6~token memory cells. The control sequence \type
%D {\height} on the other hand uses only one. Knowing this, we can improve the
@@ -107,32 +109,32 @@
%D than once. Savings like this should of course be implemented in english, just
%D because \TEX\ is english.
-\def\s!width {width}
-\def\s!height {height}
-\def\s!depth {depth}
-\def\s!spread {spread}
-\def\s!plus {plus}
-\def\s!minus {minus}
-\def\s!to {to}
-
-\def\s!fil {fil}
-\def\s!fill {fill}
-\def\s!filll {filll}
-
-\def\s!attr {attr}
-\def\s!axis {axis}
-\def\s!both {both}
-\def\s!bottom {bottom}
-\def\s!left {left}
-\def\s!options {options}
-\def\s!orientation{orientation}
-\def\s!reverse {reverse}
-\def\s!right {right}
-\def\s!top {top}
-\def\s!xmove {xmove}
-\def\s!xoffset {xoffset}
-\def\s!ymove {ymove}
-\def\s!yoffset {yoffset}
+\cdef\s!width {width}
+\cdef\s!height {height}
+\cdef\s!depth {depth}
+\cdef\s!spread {spread}
+\cdef\s!plus {plus}
+\cdef\s!minus {minus}
+\cdef\s!to {to}
+
+\cdef\s!fil {fil}
+\cdef\s!fill {fill}
+\cdef\s!filll {filll}
+
+\cdef\s!attr {attr}
+\cdef\s!axis {axis}
+\cdef\s!both {both}
+\cdef\s!bottom {bottom}
+\cdef\s!left {left}
+\cdef\s!options {options}
+\cdef\s!orientation{orientation}
+\cdef\s!reverse {reverse}
+\cdef\s!right {right}
+\cdef\s!top {top}
+\cdef\s!xmove {xmove}
+\cdef\s!xoffset {xoffset}
+\cdef\s!ymove {ymove}
+\cdef\s!yoffset {yoffset}
%D \macros
@@ -169,9 +171,9 @@
%D \def\e!name{meaning}
%D \stoptyping
-%permanent\protected\def\defineinterfaceconstant#1#2{\immutable\defcsname\c!prefix!#1\endcsname{#2}}
-\permanent\protected\def\defineinterfacevariable#1#2{\immutable\defcsname\v!prefix!#1\endcsname{#2}}
-\permanent\protected\def\defineinterfaceelement #1#2{\immutable\defcsname\e!prefix!#1\endcsname{#2}}
+%permanent\protected\def\defineinterfaceconstant#1#2{\immutable\cdefcsname\c!prefix!#1\endcsname{#2}}
+\permanent\protected\def\defineinterfacevariable#1#2{\immutable\cdefcsname\v!prefix!#1\endcsname{#2}}
+\permanent\protected\def\defineinterfaceelement #1#2{\immutable\cdefcsname\e!prefix!#1\endcsname{#2}}
%D Next come some interface independant constants:
%D
@@ -179,7 +181,7 @@
%D \definefileconstant {name} {meaning}
%D \stoptyping
-\permanent\protected\def\definefileconstant#1#2{\immutable\defcsname\f!prefix!#1\endcsname{#2}}
+\permanent\protected\def\definefileconstant#1#2{\immutable\cdefcsname\f!prefix!#1\endcsname{#2}}
%D And finaly we have the one argument, space saving constants
%D
@@ -188,13 +190,13 @@
%D \definemessageconstant {name}
%D \stoptyping
-\permanent\protected\def\definesystemconstant #1{\immutable\defcsname\s!prefix!#1\endcsname{#1}}
-\permanent\protected\def\definemessageconstant#1{\immutable\defcsname\m!prefix!#1\endcsname{#1}}
+\permanent\protected\def\definesystemconstant #1{\immutable\cdefcsname\s!prefix!#1\endcsname{#1}}
+\permanent\protected\def\definemessageconstant#1{\immutable\cdefcsname\m!prefix!#1\endcsname{#1}}
%D For now here:
-\permanent\protected\def\definetagconstant #1{\immutable\defcsname\t!prefix!#1\endcsname{#1}}
-\permanent\protected\def\aliastagconstant #1#2{\aliased \letcsname\t!prefix!#1\expandafter\endcsname\csname\t!prefix!#2\endcsname}
+\permanent\protected\def\definetagconstant #1{\immutable\cdefcsname\t!prefix!#1\endcsname{#1}}
+\permanent\protected\def\aliastagconstant #1#2{\aliased \letcsname\t!prefix!#1\expandafter\endcsname\csname\t!prefix!#2\endcsname}
%D In a parameter driven system, some parameters are shared by more system
%D components. In \CONTEXT\ we can distinguish parameters by a unique prefix. Such a
@@ -204,7 +206,7 @@
%D \definesystemvariable {name}
%D \stoptyping
-\permanent\protected\def\definesystemvariable#1{\immutable\edefcsname\??prefix#1\endcsname{\@@prefix#1}}
+\permanent\protected\def\definesystemvariable#1{\immutable\cdefcsname\??prefix#1\endcsname{\@@prefix#1}}
\definesystemvariable{ms}
@@ -355,7 +357,7 @@
\permanent\protected\def\startmessages #1 library: #2 %
{\begingroup
- \ifcsname\m!prefix!#2\endcsname\else\immutable\setgvalue{\m!prefix!#2}{#2}\fi
+ \ifcsname\m!prefix!#2\endcsname\else\immutable\gdefcsname\m!prefix!#2\endcsname{#2}\fi
\catcode\endoflineasciicode\othercatcode
\doifelseinset{#1}{\currentresponses,all}\mult_messages_start_yes\mult_messages_start_nop{#2}}
@@ -368,7 +370,7 @@
\aliased\let\stopmessages\relax
-\mutable\let\currentmessagetext\empty
+\mutable\lettonothing\currentmessagetext
\permanent\protected\def\setinterfacemessage#1#2#3%
{\ifcsname\m!prefix!#1\endcsname\else\immutable\gdefcsname\m!prefix!#1\endcsname{#1}\fi
@@ -683,11 +685,11 @@
\permanent\overloaded\protected\def\setinterfaceconstant#1#2%
{\clf_setinterfaceconstant{#1}{#2}%
- \immutable\defcsname\c!prefix!#1\endcsname{#1}}
+ \immutable\cdefcsname\c!prefix!#1\endcsname{#1}}
\permanent\overloaded\protected\def\setinterfacevariable#1#2%
{\clf_setinterfacevariable{#1}{#2}%
- \immutable\defcsname\v!prefix!#1\endcsname{#2}}
+ \immutable\cdefcsname\v!prefix!#1\endcsname{#2}}
%D \macros
%D {defineinterfaceconstant}
@@ -697,7 +699,7 @@
%D c||version, but for documentation purposes the x||alternative comes in handy.
\permanent\overloaded\protected\def\defineinterfaceconstant#1#2%
- {\immutable\defcsname\c!prefix!#1\endcsname{#2}}
+ {\immutable\cdefcsname\c!prefix!#1\endcsname{#2}}
%D \macros
%D {startelements}
@@ -714,9 +716,9 @@
\permanent\overloaded\protected\def\setinterfaceelement#1#2%
{\clf_setinterfaceelement{#1}{#2}%
\ifcsname\e!prefix!#1\endcsname
- \doifnotvalue{\e!prefix!#1}{#2}{\enforced\immutable\setvalue{\e!prefix!#1}{#2}}%
+ \doifnotvalue{\e!prefix!#1}{#2}{\enforced\immutable\defcsname\e!prefix!#1\endcsname{#2}}%
\else
- \enforced\immutable\setvalue{\e!prefix!#1}{#2}%
+ \enforced\immutable\defcsname\e!prefix!#1\endcsname{#2}%
\fi}
\permanent\protected\def\setinterfacecommand#1#2% \frozen ? \permanent ?
diff --git a/Master/texmf-dist/tex/context/base/mkxl/mult-prm.mkxl b/Master/texmf-dist/tex/context/base/mkxl/mult-prm.mkxl
index 2ec763c3943..1c04823493f 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/mult-prm.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/mult-prm.mkxl
@@ -71,7 +71,7 @@
"pdftracingfonts", "pdftrailer", "pdftrailerid", "pdfuniformdeviate",
"pdfuniqueresname", "pdfvorigin", "pdfxform", "pdfxformattr",
"pdfxformmargin", "pdfxformname", "pdfxformresources", "pdfximage",
- "pdfomitcidset", "pdfomitcharset",
+ "pdfomitcidset", "pdfomitcharset", "pdfomitinfodict",
},
aleph = { -- we don't bother
"Alephminorversion", "Alephrevision", "Alephversion",
diff --git a/Master/texmf-dist/tex/context/base/mkxl/mult-sys.mkxl b/Master/texmf-dist/tex/context/base/mkxl/mult-sys.mkxl
index 3e1d32a916d..428a8ddcf03 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/mult-sys.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/mult-sys.mkxl
@@ -44,10 +44,16 @@
% definesystemconstant {vn}
\definesystemconstant {afrikaans} \definesystemconstant {af}
+\definesystemconstant {albanian} \definesystemconstant {sq}
+\definesystemconstant {armenian} \definesystemconstant {hy}
+ \definesystemconstant {hye}
+ \definesystemconstant {hyw}
\definesystemconstant {ancientgreek} \definesystemconstant {agr}
\definesystemconstant {ancientlatin} \definesystemconstant {ala}
\definesystemconstant {arabic} \definesystemconstant {ar}
\definesystemconstant {belarussian} \definesystemconstant {be}
+\definesystemconstant {bengali} \definesystemconstant {bn}
+\definesystemconstant {bulgarian} \definesystemconstant {bg}
\definesystemconstant {bokmal} \definesystemconstant {nb}
\definesystemconstant {catalan} \definesystemconstant {ca}
\definesystemconstant {chinese} \definesystemconstant {cn}
@@ -57,18 +63,21 @@
\definesystemconstant {dutch} \definesystemconstant {nl}
\definesystemconstant {english} \definesystemconstant {en}
\definesystemconstant {estonian} \definesystemconstant {et}
-\definesystemconstant {esperanto} % \definesystemconstant {eo}
+\definesystemconstant {esperanto} \definesystemconstant {eo}
\definesystemconstant {farsi} \definesystemconstant {fa} % just persian
\definesystemconstant {finnish} \definesystemconstant {fi}
\definesystemconstant {french} \definesystemconstant {fr}
\definesystemconstant {gbenglish} \definesystemconstant {gb}
\definesystemconstant {german} \definesystemconstant {de}
\definesystemconstant {greek} \definesystemconstant {gr}
+\definesystemconstant {gujarati} \definesystemconstant {gu}
\definesystemconstant {hebrew} \definesystemconstant {he}
+\definesystemconstant {hindi} \definesystemconstant {hi}
\definesystemconstant {yiddish} \definesystemconstant {yi}
\definesystemconstant {hungarian} \definesystemconstant {hu}
\definesystemconstant {italian} \definesystemconstant {it}
\definesystemconstant {japanese} \definesystemconstant {ja}
+\definesystemconstant {kannada} \definesystemconstant {kn}
\definesystemconstant {korean} \definesystemconstant {kr}
\definesystemconstant {latin} \definesystemconstant {la}
\definesystemconstant {lithuanian} \definesystemconstant {lt}
@@ -81,11 +90,14 @@
\definesystemconstant {portuguese} \definesystemconstant {pt}
\definesystemconstant {romanian} \definesystemconstant {ro}
\definesystemconstant {russian} \definesystemconstant {ru}
+\definesystemconstant {sanskrit} \definesystemconstant {sa}
\definesystemconstant {slovak} \definesystemconstant {sk}
\definesystemconstant {slovenian} \definesystemconstant {sl}
\definesystemconstant {serbian} \definesystemconstant {sr}
\definesystemconstant {spanish} \definesystemconstant {es}
\definesystemconstant {swedish} \definesystemconstant {sv}
+\definesystemconstant {tamil} \definesystemconstant {ta}
+\definesystemconstant {telugu} \definesystemconstant {te}
\definesystemconstant {thai} \definesystemconstant {th} % mojca mentioned it at BT2013 but we need more info
\definesystemconstant {turkish} \definesystemconstant {tr}
\definesystemconstant {turkmen} \definesystemconstant {tk}
@@ -105,12 +117,15 @@
\definesystemconstant {action}
\definesystemconstant {all}
\definesystemconstant {ampersand}
+\definesystemconstant {anchor}
+\definesystemconstant {anchors}
\definesystemconstant {ascii}
\definesystemconstant {attribute}
\definesystemconstant {attr}
\definesystemconstant {author}
\definesystemconstant {auto}
\definesystemconstant {axis}
+\definesystemconstant {noaxis}
\definesystemconstant {exact}
\definesystemconstant {a}
\definesystemconstant {bf}
@@ -130,6 +145,7 @@
\definesystemconstant {bp}
\definesystemconstant {bs}
\definesystemconstant {b}
+\definesystemconstant {callback}
\definesystemconstant {calligraphy}
\definesystemconstant {Calligraphy}
\definesystemconstant {Caps}
@@ -141,10 +157,15 @@
\definesystemconstant {cg}
\definesystemconstant {chain}
\definesystemconstant {check}
+\definesystemconstant {char}
\definesystemconstant {child}
\definesystemconstant {cite}
\definesystemconstant {class}
+\definesystemconstant {leftclass}
+\definesystemconstant {rightclass}
+\definesystemconstant {calligraphic}
\definesystemconstant {clone}
+\definesystemconstant {close}
\definesystemconstant {cmyk}
\definesystemconstant {cm}
\definesystemconstant {code}
@@ -160,6 +181,7 @@
\definesystemconstant {data}
\definesystemconstant {dd}
\definesystemconstant {decimal}
+\definesystemconstant {delay}
\definesystemconstant {DefaultFont}
\definesystemconstant {default}
\definesystemconstant {depth}
@@ -179,6 +201,8 @@
\definesystemconstant {empty}
\definesystemconstant {em}
\definesystemconstant {environment}
+\definesystemconstant {explicitlefthyphenchar}
+\definesystemconstant {explicitrighthyphenchar}
\definesystemconstant {extensions}
\definesystemconstant {external}
\definesystemconstant {ex}
@@ -186,6 +210,7 @@
\definesystemconstant {fallbacks}
\definesystemconstant {fallback}
\definesystemconstant {false}
+\definesystemconstant {fam}
\definesystemconstant {fax}
\definesystemconstant {features}
\definesystemconstant {file}
@@ -193,11 +218,13 @@
\definesystemconstant {fill}
\definesystemconstant {fil}
\definesystemconstant {first}
+\definesystemconstant {fixed}
\definesystemconstant {float}
\definesystemconstant {font}
\definesystemconstant {forget}
\definesystemconstant {format}
\definesystemconstant {fraktur}
+\definesystemconstant {fraktion}
\definesystemconstant {full}
\definesystemconstant {f}
\definesystemconstant {global}
@@ -214,6 +241,7 @@
\definesystemconstant {hastitle}
\definesystemconstant {head}
\definesystemconstant {height}
+\definesystemconstant {hfactor}
\definesystemconstant {hw}
\definesystemconstant {hyphenmin}
\definesystemconstant {indeed}
@@ -282,13 +310,16 @@
\definesystemconstant {noheight}
\definesystemconstant {nomath}
\definesystemconstant {none}
+\definesystemconstant {noskips}
\definesystemconstant {normal}
\definesystemconstant {Normal}
\definesystemconstant {nowidth}
\definesystemconstant {numbering}
\definesystemconstant {number}
+\definesystemconstant {open}
+\definesystemconstant {operator}
\definesystemconstant {options}
-\definesystemconstant {ord}
+\definesystemconstant {ordinary}
\definesystemconstant {orientation}
\definesystemconstant {otr}
\definesystemconstant {pagefloat}
@@ -305,7 +336,7 @@
\definesystemconstant {register}
\definesystemconstant {Regular}
\definesystemconstant {regular}
-\definesystemconstant {rel}
+\definesystemconstant {relation}
\definesystemconstant {reset}
\definesystemconstant {reverse}
\definesystemconstant {rgb}
@@ -324,6 +355,7 @@
\definesystemconstant {SansSlanted}
\definesystemconstant {Sans}
\definesystemconstant {sans}
+\definesystemconstant {scaled}
\definesystemconstant {scriptscript}
\definesystemconstant {script}
\definesystemconstant {sc}
@@ -352,6 +384,7 @@
\definesystemconstant {smallcaps}
\definesystemconstant {small}
\definesystemconstant {somewhere}
+\definesystemconstant {source}
\definesystemconstant {special}
\definesystemconstant {spec}
\definesystemconstant {spot}
@@ -366,10 +399,12 @@
\definesystemconstant {Support}
\definesystemconstant {sygreek}
\definesystemconstant {symbol}
-\definesystemconstant {system} % not yet interfaces messages
+\definesystemconstant {system}
+\definesystemconstant {style}
\definesystemconstant {text}
\definesystemconstant {tex}
\definesystemconstant {tf}
+\definesystemconstant {target}
\definesystemconstant {third}
\definesystemconstant {topfloat}
\definesystemconstant {top}
@@ -382,12 +417,16 @@
\definesystemconstant {ucgreek}
\definesystemconstant {uncramped}
\definesystemconstant {unexpanded}
-\definesystemconstant {Unicode}
+\definesystemconstant {unpack}
\definesystemconstant {unknown}
+\definesystemconstant {Unicode}
+\definesystemconstant {unroll}
+\definesystemconstant {upright}
\definesystemconstant {userdata}
\definesystemconstant {userpage}
\definesystemconstant {user}
\definesystemconstant {vfrac}
+\definesystemconstant {vfactor}
\definesystemconstant {white}
\definesystemconstant {width}
\definesystemconstant {xml}
@@ -398,6 +437,8 @@
\definesystemconstant {ymove}
\definesystemconstant {yoffset}
+\definesystemconstant {syncpos}
+
%D As the name of their define command states, the next set of constants is used in
%D the message macro's.
@@ -417,6 +458,7 @@
\definemessageconstant {languages}
\definemessageconstant {layouts}
\definemessageconstant {lua}
+\definemessageconstant {math}
\definemessageconstant {metapost}
\definemessageconstant {publications}
\definemessageconstant {references}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-acc.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-acc.lmt
index 2c3302a3ea7..05de3c85110 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/node-acc.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-acc.lmt
@@ -26,15 +26,12 @@ local getnext = nuts.getnext
local setattr = nuts.setattr
local setlink = nuts.setlink
local setchar = nuts.setchar
-local setsubtype = nuts.setsubtype
local getwidth = nuts.getwidth
local setwidth = nuts.setwidth
local nextglyph = nuts.traversers.glyph
-local nextnode = nuts.traversers.node
local copy_node = nuts.copy
-local insert_after = nuts.insert_after
local nodecodes = nodes.nodecodes
local gluecodes = nodes.gluecodes
@@ -44,7 +41,6 @@ local glyph_code = nodecodes.glyph
local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
-local userskip_code = gluecodes.user
local spaceskip_code = gluecodes.spaceskip
local xspaceskip_code = gluecodes.xspaceskip
@@ -63,7 +59,8 @@ local slot = nil
local function injectspaces(head)
-- This can become two fast loops or we just move this to the backend where we can
-- also check for spaces (it actually is rather old code that relates to tagging
- -- and so, which was implemented rather early in the mkiv saga).
+ -- and so, which was implemented rather early in the mkiv saga). It can also become
+ -- a helper.
local p, p_id
local n = head
while n do
@@ -76,7 +73,7 @@ local function injectspaces(head)
local a = getattr(n,a_characters)
setchar(g,slot)
setlink(p,g,n)
- setwidth(n,getwidth(n) - getwidth(g))
+ setwidth(n,getwidth(n) - getwidth(g)) -- use criterium
if a then
setattr(g,a_characters,a)
end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-ali.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-ali.lmt
new file mode 100644
index 00000000000..510e56b8ec4
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-ali.lmt
@@ -0,0 +1,949 @@
+if not modules then modules = { } end modules ['node-ali'] = {
+ version = 1.001,
+ comment = "companion to node-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local setmetatableindex = table.setmetatableindex
+
+local a_alignchar = attributes.private("aligncharacter")
+
+local nuts = nodes.nuts
+local tonut = nuts.tonut
+local tonode = nuts.tonode
+local getwidth = nuts.getwidth
+local setwidth = nuts.setwidth
+local getid = nuts.getid
+local getattr = nuts.getattr
+local setnext = nuts.setnext
+local getnext = nuts.getnext
+local getprev = nuts.getprev
+local getboth = nuts.getboth
+local setglue = nuts.setglue
+local getglue = nuts.getglue
+local setglue = nuts.setglue
+local getwhd = nuts.getwhd
+local setwhd = nuts.setwhd
+local setpenalty = nuts.setpenalty
+local getlist = nuts.getlist
+local setlist = nuts.setlist
+local setattrlist = nuts.setattrlist
+local setprop = nuts.setprop
+local getprop = nuts.getprop
+local getfont = nuts.getfont
+local getchar = nuts.getchar
+local addmargins = nuts.addmargins
+local findtail = nuts.tail
+local hasglyph = nuts.hasglyph
+local getwordrange = nuts.getwordrange
+local dimensions = nuts.rangedimensions
+local flushnode = nuts.flush
+local hpack = nuts.hpack
+local repack = nuts.repack
+local insertbefore = nuts.insertbefore
+local insertafter = nuts.insertafter
+local effectiveglue = nuts.effectiveglue
+
+local newkern = nuts.pool.kern
+local newrule = nuts.pool.rule
+local newglue = nuts.pool.glue
+
+local traversers = nuts.traversers
+local nextrecord = traversers.alignrecord
+local nextunset = traversers.unset
+local nextglyph = traversers.glyph
+local nextglue = traversers.glue
+local nextpenalty = traversers.penalty
+local nextboundary = traversers.boundary
+local nextnode = traversers.node
+local nextlist = traversers.list
+local nextrule = traversers.rule
+
+local nodecodes = nodes.nodecodes
+local glyph_code = nodecodes.glyph
+local glue_code = nodecodes.glue
+local kern_code = nodecodes.kern
+local disc_code = nodecodes.disc
+local unset_code = nodecodes.unset
+local alignrecord_code = nodecodes.alignrecord
+local rule_code = nodecodes.rule
+
+local spaceskip_code = nodes.gluecodes.spaceskip
+local xspaceskip_code = nodes.gluecodes.xspaceskip
+local intermathskip_code = nodes.gluecodes.intermathskip
+local fontkern_code = nodes.kerncodes.fontkern
+local row_code = nodes.listcodes.alignment -- should be row
+local cell_code = nodes.listcodes.cell
+local line_code = nodes.listcodes.line
+local linepenalty_code = nodes.penaltycodes.linepanalty
+
+-- local preamble_pass <const> = tex.alignmentcontextcodes.preamble
+-- local preroll_pass <const> = tex.alignmentcontextcodes.preroll
+-- local wrapup_pass <const> = tex.alignmentcontextcodes.wrapup
+
+-- todo statistics and tracing
+
+local method = 2
+local unislots = fonts.hashes.unislots -- todo
+local chardata = fonts.hashes.characters
+
+function nodes.handlers.aligncharacter(head,where,attr,preamble)
+ if where == "preroll" then
+ local attr = getattr(attr,a_alignchar) -- 1 : value doesn't matter (for now)
+ if attr then
+ local widths = { }
+ local data = { }
+ local rows = 0
+ local cols = 0
+ for col in nextrecord, preamble do
+ cols = cols + 1
+ local w, s = getwidth(col,true)
+ widths[cols] = { col, w, s }
+ end
+ --
+ for row in nextunset, head do
+ rows = rows + 1
+ local c = 0
+ local d = { }
+ data[rows] = d
+ for col in nextunset, getlist(row) do
+ c = c + 1
+ if widths[c][2] then
+ local list = getlist(col)
+ -- if method == 1 then
+ -- local left = nil
+ -- local right = nil
+ -- local middle = nil
+ -- for g, char in nextglyph, list do
+ -- if not left then
+ -- left = g
+ -- end
+ -- if char == getattr(g,a_alignchar) then
+ -- middle = g
+ -- end
+ -- right = g
+ -- end
+ -- d[c] = middle and { col, left, middle, right, 0, 0, getwidth(middle) } or false
+ -- elseif method == 2 then
+ local middle = nil
+ -- we can either cache unislots or we can cache for this font
+ for g, char, font in nextglyph, list do
+ local unicode = getattr(g,a_alignchar)
+ if unicode then
+ if char == unicode then
+ middle = g
+ elseif unislots[font][char] == unicode then
+ middle = g
+ end
+ end
+ end
+ if middle then
+ local left, right = getwordrange(middle) -- not real gain but handy anyway (less code too)
+ -- local left = middle
+ -- local right = middle
+ -- for g, id, subtype in nextnode, middle do
+ -- if id == glyph_code or id == disc_code then
+ -- right = g
+ -- elseif id == kern_code and subtype == fontkern_code then
+ -- right = g
+ -- else
+ -- break
+ -- end
+ -- end
+ -- for g, id, subtype in prevnode, middle do
+ -- if id == glyph_code or id == disc_code then
+ -- left = g
+ -- elseif id == kern_code and subtype == fontkern_code then
+ -- left = g
+ -- else
+ -- break
+ -- end
+ -- end
+ d[c] = { col, left, middle, right, 0, 0, getwidth(middle) }
+ else
+ d[c] = false
+ end
+ -- else
+ -- local middle = nil
+ -- for g, char in nextglyph, list do
+ -- if char == getattr(g,a_alignchar) then
+ -- middle = g
+ -- end
+ -- end
+ -- if middle then
+ -- local left = list
+ -- local right = findtail(list)
+ -- if getid(left) == glue_code then
+ -- left = getnext(left)
+ -- end
+ -- if getid(right) == glue_code then
+ -- right = getprev(right)
+ -- end
+ -- d[c] = { col, left, middle, right, 0, 0, getwidth(middle) }
+ -- else
+ -- d[c] = false
+ -- end
+ -- end
+ else
+ d[c] = false
+ end
+ end
+ end
+ --
+ for col=1,cols do
+ local maxl = 0
+ local maxr = 0
+ local minm = 0
+ local maxm = 0
+ local colw = widths[col]
+ for row=1,rows do
+ local d = data[row][col]
+ if d then
+ local p = d[1]
+ local l = d[2]
+ local m = d[3]
+ local r = d[4]
+ if m then
+ local lw = l == m and 0 or dimensions(p,l,m)
+ local rw = m == r and 0 or dimensions(p,getnext(m),getnext(r))
+ d[5] = lw
+ d[6] = rw
+ if lw > maxl then
+ maxl = lw
+ end
+ if rw > maxr then
+ maxr = rw
+ end
+ local mw = d[7]
+ if maxm == 0 then
+ minm = mw
+ maxm = mw
+ else
+ if mw > maxm then
+ maxm = mw
+ end
+ if mw < minm then
+ minm = mw
+ end
+ end
+ end
+ end
+ end
+ --
+ local fixedwidth = colw[3] ~= 0
+ --
+ local old = colw[2]
+ local new = old
+ for row=1,rows do
+ local d = data[row][col]
+ if d then
+ local p = d[1]
+ local l = d[2]
+ local m = d[3]
+ local r = d[4]
+ if l and m and r then
+ local lw = d[5]
+ local rw = d[6]
+ local mw = d[7]
+ dl = maxl - lw
+ dr = maxr - rw
+ if dl ~= 0 or dr ~= 0 or mw ~= maxm then
+ local lst = getlist(p)
+ local wid = getwidth(p)
+ if dl ~= 0 then
+ local k = newkern(dl)
+ lst = insertbefore(lst,l,k)
+ setattrlist(k,m)
+ setlist(p,lst)
+ wid = wid + dl
+ end
+ if dr ~= 0 then
+ local k = newkern(dr)
+ insertafter(lst,r,k)
+ setattrlist(k,m)
+ wid = wid + dr
+ end
+ if mw ~= maxm then
+ local dw = (maxm - mw)
+ local dx = dw / 2
+ addmargins(m,-dx,-dx)
+ wid = wid + dw
+ end
+ setwidth(p,wid)
+ if wid > new then
+ new = wid
+ end
+ setlist(p,lst)
+ -- somewhat fuzzy:
+ if fixedwidth then
+ local l = hpack(h,getwidth(p),"exactly")
+ setglue(p,getglue(l))
+ setlist(l)
+ flushnode(l)
+ else
+ setglue(p)
+ end
+ --
+ end
+ end
+ end
+ end
+ if new > old then
+ if fixedwidth then
+ -- issue overflow warning
+ else
+ setwidth(colw[1],new)
+ end
+ end
+ end
+ end
+ end
+end
+
+local enabled = false
+
+interfaces.implement {
+ name = "enablealignmentcharacter",
+ -- onlyonce = true,
+ public = true,
+ protected = true,
+ actions = function()
+ if not enabled then
+ nodes.tasks.enableaction("alignments", "nodes.handlers.aligncharacter")
+ enabled = true
+ end
+ end,
+}
+
+-- This will go to math-ali.lmt
+
+do
+
+ local getdata = nuts.getdata
+ local removenode = nuts.remove
+ local getwhd = nuts.getwhd
+ local getheight = nuts.getheight
+ local getdepth = nuts.getdepth
+ local setheight = nuts.setheight
+ local setdepth = nuts.setdepth
+ local getglue = nuts.getglue
+ local setoffsets = nuts.setoffsets
+ local setsubtype = nuts.setsubtype
+
+ local baselineskip_code = nodes.gluecodes.baselineskip
+ local lineskip_code = nodes.gluecodes.lineskip
+
+ local alignrecord_code = nodecodes.alignrecord
+ local hlist_code = nodecodes.hlist
+ local unset_code = nodecodes.unset
+ -- local rule_code = nodecodes.rule
+
+ local nextnode = nuts.traversers.node
+
+ local texgetdimen = tex.getdimen
+ local texgetglue = tex.getglue
+ local texget = tex.get
+
+ local leftmarker = tex.boundaries.system("c_math_align_l_marker")
+ local rightmarker = tex.boundaries.system("c_math_align_r_marker")
+
+ local a_location = attributes.system("mathnumberlocation")
+ local a_threshold = attributes.system("mathnumberthreshold")
+
+ local v_first = interfaces.variables.first
+ local v_last = interfaces.variables.last
+ local v_both = interfaces.variables.both
+
+ -- Here:
+
+ local function openup(specification,head)
+ local inbetween = specification.inbetween or 0
+ local height = specification.height or 0
+ local depth = specification.depth or 0
+ local splitmethod = specification.splitmethod or ""
+ local lines = { }
+ for n, id, subtype, list in nextlist, head do
+ lines[#lines+1] = { n, subtype, getwhd(n) }
+ end
+ local noflines = #lines
+ if noflines > 0 then
+ local currentline = 1
+ for n, subtype in nextglue, head do
+ -- one day we can decide what to do with intertext stuff based on the
+ -- subtype but not now ... on our agenda (intertext etc)
+ if subtype == baselineskip_code or subtype == lineskip_code then
+ local nextline = currentline + 1
+ local amount, stretch, shrink = getglue(n)
+ local prevdp = lines[currentline][5]
+ local nextht = lines[nextline][4]
+ local delta = 0
+ if prevdp < depth then
+ setdepth(lines[currentline][1],depth)
+ delta = delta + (depth - prevdp)
+ end
+ if nextht < height then
+ setheight(lines[nextline][1],height)
+ delta = delta + (height - nextht)
+ end
+-- if subtype == lineskip_code then
+-- setglue(n,inbetween,stretch,shrink)
+ setsubtype(n,baselineskip_code)
+-- else
+ setglue(n,amount+inbetween-delta,stretch,shrink)
+-- end
+ curline = nextline
+-- if currentline > noflines then
+-- break
+-- end
+ end
+ end
+ if splitmethod ~= "" then
+ local currentline = 0
+ for n, subtype in nextpenalty, head do
+ if subtype == linepenalty_code then
+ if l == 1 then
+ if splitmethod == v_both or splitmethod == v_first then
+print("FIRST")
+ setpenalty(n, 10000)
+ end
+ elseif l == noflines then
+ if splitmethod == v_both or splitmethod == v_last then
+print("LAST")
+ setpenalty(n, 10000)
+ end
+ end
+ curline = currentline
+ end
+ end
+ end
+ local firstht = lines[1][4]
+ local lastdp = lines[noflines][5]
+ if firstht < height then
+ setheight(lines[1],height)
+ end
+ if lastdp < depth then
+ setdepth(lines[noflines],depth)
+ end
+ end
+ end
+
+ nuts.openup = openup
+
+ -- When present, the number is after the right marker. We need to move the
+ -- number when we want it at the left.
+ --
+ -- Todo: set a flag in mathalignment and support atttibutes on it so that
+ -- we can check if this is needed.
+
+ -- [dummy] [left -2] [second -1] [number 0]
+
+ -- In the end it makes more sense to just calculate the alignment in lua
+ -- but it is kind of fun to see how we can control alignments.
+
+ local totals = { }
+ local widths = { }
+ local records = { }
+ local deltas = { }
+ local cellwidths = { }
+
+ local a_flushleft <const> = 1
+ local a_centered <const> = 2
+ local a_flushright <const> = 3
+
+ local function first_pass(head,attr,preamble)
+ --
+ local width = 0
+ local hsize = texget("hsize")
+ local count = 0
+ local overflow = false
+totals = { } -- maybe use one table
+widths = { }
+records = { }
+deltas = { }
+ for n in nextrecord, preamble do
+ local wd = getwidth(n)
+ count = count + 1
+ width = width + wd
+ totals [count] = width
+ widths [count] = wd
+ records[count] = n
+ deltas [count] = 0
+ end
+ --
+ local lindex = 0
+ local rindex = 0
+ local lwidth = 0
+ local rwidth = 0
+ local centered = false
+ for row in nextunset, head do
+ local count = 0
+ local anchor = nil
+ local rochan = nil
+ -- local cellwidths = { }
+ for cell in nextunset, getlist(row) do
+ local list = getlist(cell)
+ count = count + 1
+ cellwidths[count] = getwidth(cell)
+ for bound in nextboundary, list do
+ local marker = getdata(bound)
+ if marker == leftmarker then
+ lindex = count
+ anchor = bound
+ rochan = list
+ elseif marker == rightmarker then
+ local n = getnext(bound)
+ if n and getid(n) == hlist_code then
+ local wd, ht, dp = getwhd(n)
+ local lc = getattr(n,a_location)
+ if lc then
+ -- todo: just store align in the outer attribute so once ...
+ local align = lc // 0x10
+ local location = lc % 0x10
+ local threshold = getattr(n,a_threshold)
+ if location == 1 then
+ -- number right
+ local m = 1
+ local s = align == a_centered and 2 or 1
+-- if align == 1 then
+ if align == a_flushleft then
+ -- flushleft
+ rwidth = wd
+-- elseif align == 3 then
+ elseif align == a_flushright then
+ -- flushright
+ rwidth = wd
+ elseif wd > lwidth then
+ lwidth = wd
+ rwidth = wd
+ centered = true
+ end
+ if totals[count-2] + cellwidths[count-1] + s*wd - s*threshold > hsize then
+ local total = ht + dp
+ setdepth(row,getdepth(row) + total)
+ setoffsets(n,0,-total)
+ local pr = records[count-1]
+ local cw = getwidth(pr)
+ if cw - wd > deltas[count-1] then
+ deltas[count-1] = cw - wd
+ end
+ overflow = true
+ end
+ elseif location == 2 then
+ -- number left
+-- if align == 1 then
+ if align == a_flushleft then
+ -- flushleft
+ lwidth = wd
+-- elseif align == 3 then
+ elseif align == a_flushright then
+ -- flushright
+ lwidth = wd
+ end
+ end
+ if location == 2 and anchor then
+ local l, l, n = removenode(list,n)
+ if l ~= list then
+ setlist(cell,l)
+ -- setwidth(cell,0)
+ end
+ insertafter(rochan,anchor,n)
+ end
+ end
+ end
+ rindex = count
+ end
+ end
+ end
+ end
+ --
+ if overflow then
+ if deltas[rindex-1] ~= 0 then
+ setwidth(records[rindex-1],deltas[rindex-1])
+ end
+ end
+ for count=1,#records do
+ if count == lindex then
+ if centered and overflow then
+ lwidth = lwidth - texgetdimen("d_math_eqalign_number_distance")
+ end
+ setwidth(records[count],lwidth)
+ elseif count == rindex then
+ setwidth(records[count],rwidth)
+ end
+ end
+ end
+
+ local function second_pass(head,attr,preamble)
+ local done = setmetatableindex("table")
+ local glues = { }
+ local okay = false
+ for row, id, subtype in nextlist, head do
+ if id == hlist_code and subtype == row_code then
+ for cell, id, subtype in nextlist, getlist(row) do
+ if id == hlist_code and subtype == cell_code then
+ for n, s in nextglue, getlist(cell) do
+ if s == intermathskip_code then
+ local e = effectiveglue(n,cell)
+ local g = getglue(n)
+ local f = getfont(n)
+ local a = done[f]
+ local d = a[g]
+ glues[n] = g
+ if not d then
+ a[g] = e
+ elseif d > e then
+ a[g] = e
+ okay = true
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ if okay then
+ for k, v in next, glues do
+ local g = done[getfont(k)][v]
+ if g then
+ setglue(k,g)
+ setprop(k,"fixedmathalign",true)
+ end
+ end
+ for row, id, subtype in nextlist, head do
+ if id == hlist_code and subtype == row_code then
+ for cell, id, subtype, list in nextlist, getlist(row) do
+ if list and id == hlist_code and subtype == cell_code then
+ local wd = getwidth(cell)
+ repack(cell,wd,"exactly")
+ end
+ end
+ end
+ end
+ end
+ end
+
+ local function third_pass(head,attr,preamble)
+ local inbetween, stretch, shrink = texgetglue("s_strc_math_alignment_inbetween")
+ openup({ inbetween = inbetween }, head)
+ end
+
+ -- This will become a bit more pluggable so that we have less checking.
+
+ -- maybe zero pass: preamble pass
+
+ function nodes.handlers.fixmathalign(head,where,attr,preamble)
+ if where == "preroll" then
+ local signal = getattr(attr,a_location)
+ if signal == 0x20 or signal == 0x40 then
+ first_pass(head,attr,preamble)
+ end
+ elseif where == "wrapup" then
+ local signal = getattr(attr,a_location)
+ if signal == 0x40 then
+ second_pass(head,attr,preamble)
+ end
+ if signal then
+ third_pass(head,attr,preamble)
+ end
+ end
+ end
+
+ --
+
+do
+
+ local a_mathalignmentvrule = attributes.private("mathalignmentvrule")
+ local a_mathalignmenthrule = attributes.private("mathalignmenthrule")
+
+ -- these loops will be combined
+
+ local dp = { }
+ local ht = { }
+
+ local function vrule_pass(head,attr,preamble)
+ local i = 0
+ for row, id, subtype, list in nextlist, head do
+ if id == hlist_code and subtype == row_code then
+ i = i + 1
+ local prv, nxt = getboth(row)
+ for cell, id, subtype, list in nextlist, list do
+ if list then
+ for n, id, subtype in nextrule, list do
+ local signal = getattr(n,a_mathalignmentvrule)
+ if signal then
+ if prv then
+ if getid(prv) ~= rule_code or not getattr(prv,a_mathalignmentvrule) then
+ prv = nil
+ end
+ end
+ if nxt then
+ if getid(nxt) ~= rule_code or not getattr(nxt,a_mathalignmentvrule) then
+ nxt = nil
+ end
+ end
+ local top = not prv and 0 or nil
+ local bot = not nxt and 0 or nil
+ setoffsets(n,nil,nil,d and -d or top,h and -h or bot)
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+
+ local function hrule_pass(head,attr,preamble)
+ local i = 0
+ for row, id, subtype, list in nextlist, head do
+ if id == hlist_code and subtype == row_code then
+ i = i + 1
+ local height = 0
+ local depth = 0
+ local done = false
+ for cell, id, subtype, list in nextlist, list do
+ if list then
+ for n, id, subtype in nextglue, list do
+ local signal = getattr(n,a_mathalignmenthrule)
+ if signal then
+ local w, h, d = getwhd(n)
+ if h and d then
+ if h > height then
+ height = h
+ end
+ if d > depth then
+ depth = d
+ end
+ done = true
+ end
+ end
+ end
+ end
+ end
+ if done then
+ setheight(row,height)
+ setdepth(row,depth)
+ dp[i] = height
+ ht[i] = depth
+ end
+ end
+ end
+ end
+
+ function nodes.handlers.mathmatrixrules(head,where,attr,preamble)
+ if where == "wrapup" then
+ dp = { }
+ ht = { }
+ local signal = getattr(attr,a_mathalignmenthrule)
+ if signal == 0x01 then -- matrix
+ hrule_pass(head,attr,preamble)
+ end
+ local signal = getattr(attr,a_mathalignmentvrule)
+ if signal == 0x01 then -- matrix
+ vrule_pass(head,attr,preamble)
+ end
+ end
+ end
+
+ local enabled = false
+
+ interfaces.implement {
+ name = "enablematrixrules",
+ -- onlyonce = true,
+ public = true,
+ protected = true,
+ actions = function()
+ if not enabled then
+ nodes.tasks.enableaction("alignments", "nodes.handlers.mathmatrixrules")
+ enabled = true
+ end
+ end,
+ }
+
+end
+
+ --
+
+ local a_ornament = attributes.system("mathmatrixornament")
+
+ local leftornament = tex.boundaries.system("c_math_matrix_ornament_l")
+ local rightornament = tex.boundaries.system("c_math_matrix_ornament_r")
+ local topornament = tex.boundaries.system("c_math_matrix_ornament_t")
+ local bottomornament = tex.boundaries.system("c_math_matrix_ornament_b")
+
+ local left = 0
+ local right = 0
+ local nofcells = 0
+ local found = false
+
+ local lefts = false
+ local rights = false
+ local tops = false
+ local bottoms = false
+
+ local function first_pass(head,attr,preamble)
+ nofcells = 0
+ left = 0
+ right = 0
+ found = false
+ lefts = { }
+ rights = { }
+ tops = { }
+ bottoms = { }
+ for n in nextrecord, preamble do
+ nofcells = nofcells + 1
+ end
+ local cells = { }
+ for row in nextunset, head do
+ local c = 0
+ for cell in nextunset, getlist(row) do
+ local list = getlist(cell)
+ c = c + 1
+ for bound in nextboundary, list do
+ local ornament = getdata(bound)
+ if ornament == leftornament then
+ if c == 1 then
+ local w = getwidth(cell)
+ if w > left then
+ left = w
+ end
+ setwidth(cell,0)
+ cells[c+1] = true
+ cells[c] = true
+ found = true
+ lefts[#lefts+1] = cell
+ end
+ elseif ornament == rightornament then
+ if c == nofcells then
+ local w = getwidth(cell)
+ if w > right then
+ right = w
+ end
+ setwidth(cell,0)
+ cells[c-1] = true
+ cells[c] = true
+ found = true
+ rights[#rights+1] = cell
+ end
+ elseif ornament == topornament then
+ setheight(row,0)
+ setdepth(row,0)
+ found = true
+ tops[#tops+1] = cell
+ elseif ornament == bottomornament then
+ setheight(row,0)
+ setdepth(row,0)
+ found = true
+ bottoms[#bottoms+1] = cell
+ end
+ end
+ end
+ end
+ if next(cells) then
+ local c = 0
+ for n in nextrecord, preamble do
+ c = c + 1
+ if cells[c] then
+ setwidth(n)
+ end
+ end
+ end
+ end
+
+ local function second_pass(box)
+ if found then
+ local head = getlist(nuts.getbox(box))
+ local leftmargin = texgetdimen("d_math_matrix_margin_l")
+ local rightmargin = texgetdimen("d_math_matrix_margin_r")
+ local topmargin = texgetdimen("d_math_matrix_margin_t")
+ local bottommargin = texgetdimen("d_math_matrix_margin_b")
+ for i=1,#lefts do
+ setoffsets(lefts[i],-(left+leftmargin),0)
+ end
+ for i=1,#rights do
+ setoffsets(rights[i], (rightmargin),0)
+ end
+ for i=1,#tops do
+ setoffsets(tops[i],0,topmargin)
+ end
+ for i=1,#bottoms do
+ setoffsets(bottoms[i],0,-bottommargin)
+ end
+ lefts = false
+ rights = false
+ tops = false
+ bottoms = false
+ end
+ end
+
+ function nodes.handlers.mathmatrixornaments(head,where,attr,preamble)
+ if where == "preroll" then
+ local signal = getattr(attr,a_ornament)
+ if signal == 0x10 then
+ first_pass(head,attr,preamble)
+ end
+ -- elseif where == "wrapup" then
+ -- local signal = getattr(attr,a_ornament)
+ -- if signal == 0x10 then
+ -- second_pass(head,attr,preamble)
+ -- end
+ end
+ end
+
+ interfaces.implement {
+ name = "shiftmatrixornaments",
+ actions = second_pass,
+ arguments = "integer",
+ }
+
+ local enabled = false
+
+ interfaces.implement {
+ name = "enablematrixalign",
+ -- onlyonce = true,
+ public = true,
+ protected = true,
+ actions = function()
+ if not enabled then
+ nodes.tasks.enableaction("alignments", "nodes.handlers.fixmathalign")
+ enabled = true
+ end
+ end,
+ }
+
+ local enabled = false
+
+ interfaces.implement {
+ name = "enablematrixornaments",
+ -- onlyonce = true,
+ public = true,
+ protected = true,
+ actions = function()
+ if not enabled then
+ nodes.tasks.enableaction("alignments", "nodes.handlers.mathmatrixornaments")
+ enabled = true
+ end
+ end,
+ }
+
+end
+
+local report = logs.reporter("alignment","preamble")
+local trace trackers.register("alignments.showstates",function(v) trace = v end)
+
+function nodes.handlers.showpreamble(head,where,attr,preamble)
+ if trace then
+ local c = 0
+ for n, id in nextnode, preamble do
+ if id == unset_code or id == alignrecord_code then
+ c = c + 1
+ report("stage %a, cell %i, width %p",where,c,getwidth(n))
+ elseif id == glue_code then
+ report("stage %a, tabskip %s",where,node.direct.gluetostring(n))
+ else
+ report("stage %a, node %a",where,nodecodes[id])
+ end
+ end
+ end
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-aux.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-aux.lmt
index d952ec41b51..a640addc1ed 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/node-aux.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-aux.lmt
@@ -10,71 +10,72 @@ if not modules then modules = { } end modules ['node-aux'] = {
local type, tostring = type, tostring
-local nodes = nodes
-local context = context
-
-local utfvalues = utf.values
-
-local nodecodes = nodes.nodecodes
-
-local glyph_code = nodecodes.glyph
-local hlist_code = nodecodes.hlist
-local vlist_code = nodecodes.vlist
-local attributelist_code = nodecodes.attributelist -- temporary
-local par_code = nodecodes.par
-
-local nuts = nodes.nuts
-local tonut = nuts.tonut
-local tonode = nuts.tonode
-local vianuts = nuts.vianuts
-
-local getbox = nuts.getbox
-local getnext = nuts.getnext
-local getid = nuts.getid
-local getsubtype = nuts.getsubtype
-local getlist = nuts.getlist
-local getattr = nuts.getattr
-local getboth = nuts.getboth
-local getprev = nuts.getprev
-local getwidth = nuts.getwidth
-local setwidth = nuts.setwidth
-local getboxglue = nuts.getboxglue
-local setboxglue = nuts.setboxglue
-
-local setfield = nuts.setfield
-local setattr = nuts.setattr
-local setlink = nuts.setlink
-local setlist = nuts.setlist
-local setnext = nuts.setnext
-local setprev = nuts.setprev
-local setattrlist = nuts.setattrlist
-
-local traversers = nuts.traversers
-local nextnode = traversers.node
-local nextglyph = traversers.glyph
-
-local flush_node = nuts.flush
-local flush_list = nuts.flush_list
-local hpack_nodes = nuts.hpack
-local unset_attribute = nuts.unset_attribute
-local first_glyph = nuts.first_glyph
-local copy_node = nuts.copy
-local find_tail = nuts.tail
-local getbox = nuts.getbox
-local count = nuts.count
-local isglyph = nuts.isglyph
-
-local nodepool = nuts.pool
-local new_glue = nodepool.glue
-local new_glyph = nodepool.glyph
-
-local unsetvalue = attributes.unsetvalue
-
-local current_font = font.current
-
-local texsetbox = tex.setbox
-
-local report_error = logs.reporter("node-aux:error")
+local nodes = nodes
+local context = context
+
+local utfvalues = utf.values
+
+local nodecodes = nodes.nodecodes
+
+local glyph_code = nodecodes.glyph
+local hlist_code = nodecodes.hlist
+local vlist_code = nodecodes.vlist
+local attribute_code = nodecodes.attribute -- temporary
+local par_code = nodecodes.par
+
+local nuts = nodes.nuts
+local tonut = nuts.tonut
+local tonode = nuts.tonode
+local vianuts = nuts.vianuts
+
+local getbox = nuts.getbox
+local getnext = nuts.getnext
+local getid = nuts.getid
+local getsubtype = nuts.getsubtype
+local getlist = nuts.getlist
+local getattr = nuts.getattr
+local getboth = nuts.getboth
+local getprev = nuts.getprev
+local getwidth = nuts.getwidth
+local setwidth = nuts.setwidth
+local getboxglue = nuts.getboxglue
+local setboxglue = nuts.setboxglue
+
+local setfield = nuts.setfield
+local setattr = nuts.setattr
+local setlink = nuts.setlink
+local setlist = nuts.setlist
+local setnext = nuts.setnext
+local setprev = nuts.setprev
+local setattrlist = nuts.setattrlist
+
+local traversers = nuts.traversers
+local nextnode = traversers.node
+local nextglyph = traversers.glyph
+
+local flushnode = nuts.flush
+local flushlist = nuts.flushlist
+local hpack_nodes = nuts.hpack
+local vpack_nodes = nuts.vpack
+local unsetattribute = nuts.unsetattribute
+local firstglyph = nuts.firstglyph
+local copy_node = nuts.copy
+local find_tail = nuts.tail
+local getbox = nuts.getbox
+local count = nuts.count
+local isglyph = nuts.isglyph
+
+local nodepool = nuts.pool
+local new_glue = nodepool.glue
+local new_glyph = nodepool.glyph
+
+local unsetvalue = attributes.unsetvalue
+
+local current_font = font.current
+
+local texsetbox = tex.setbox
+
+local report_error = logs.reporter("node-aux:error")
local function takebox(id)
local box = getbox(id)
@@ -111,7 +112,7 @@ end
function nuts.takelist(n)
local l = getlist(n)
setlist(n)
- flush_node(n)
+ flushnode(n)
return l
end
@@ -124,7 +125,7 @@ local function repackhlist(list,...)
local temp, b = hpack_nodes(list,...)
list = getlist(temp)
setlist(temp)
- flush_node(temp)
+ flushnode(temp)
return list, b
end
@@ -135,50 +136,38 @@ function nodes.repackhlist(list,...)
return tonode(list), b
end
-local function set_attributes(head,attr,value)
+local function setattributes(head,attr,value)
for n, id in nextnode, head do
setattr(n,attr,value)
if id == hlist_node or id == vlist_node then
- set_attributes(getlist(n),attr,value)
+ setattributes(getlist(n),attr,value)
end
end
end
-local function set_unset_attributes(head,attr,value)
+local function setunsetattributes(head,attr,value)
for n, id in nextnode, head do
if not getattr(n,attr) then
setattr(n,attr,value)
end
if id == hlist_code or id == vlist_code then
- set_unset_attributes(getlist(n),attr,value)
+ setunsetattributes(getlist(n),attr,value)
end
end
end
-local function unset_attributes(head,attr)
+local function unsetattributes(head,attr)
for n, id in nextnode, head do
setattr(n,attr,unsetvalue)
if id == hlist_code or id == vlist_code then
- unset_attributes(getlist(n),attr)
+ unsetattributes(getlist(n),attr)
end
end
end
--- for old times sake
-
-nuts.setattribute = nuts.setattr nodes.setattribute = nodes.setattr
-nuts.getattribute = nuts.getattr nodes.getattribute = nodes.getattr
-nuts.unsetattribute = nuts.unset_attribute nodes.unsetattribute = nodes.unset_attribute
-nuts.has_attribute = nuts.has_attribute nodes.has_attribute = nodes.has_attribute
-nuts.firstglyph = nuts.first_glyph nodes.firstglyph = nodes.first_glyph
-
-nuts.setattributes = set_attributes nodes.setattributes = vianuts(set_attributes)
-nuts.setunsetattributes = set_unset_attributes nodes.setunsetattributes = vianuts(set_unset_attributes)
-nuts.unsetattributes = unset_attributes nodes.unsetattributes = vianuts(unset_attributes)
-
function nuts.firstcharacter(n,untagged) -- tagged == subtype > 255
if untagged then
- return first_glyph(n)
+ return firstglyph(n)
else
for g in nextglyph ,n do
return g
@@ -232,7 +221,7 @@ local function tonodes(str,fnt,attr) -- (str,template_glyph) -- moved from blob-
n = copy_node(space)
elseif fonts then -- depedency
local parameters = fonts.hashes.identifiers[fnt].parameters
- space = new_glue(parameters.space,parameters.space_stretch,parameters.space_shrink)
+ space = new_glue(parameters.space,parameters.spacestretch,parameters.spaceshrink)
n = space
end
elseif template then
@@ -292,12 +281,12 @@ local function link(list,currentfont,currentattr,head,tail) -- an oldie, might b
elseif not head then
head = n
tail = find_tail(n)
- elseif getid(n) == attributelist_code then
+ elseif getid(n) == attribute_code then
-- weird case
report_error("weird node type in list at index %s:",i)
for i=1,#list do
local l = list[i]
- report_error("%3i: %s %S",i,getid(l) == attributelist_code and "!" or ">",l)
+ report_error("%3i: %s %S",i,getid(l) == attribute_code and "!" or ">",l)
end
os.exit()
else
@@ -352,7 +341,7 @@ local function rehpack(n,width)
local set, order, sign = getboxglue(temp)
setboxglue(n,set,order,sign)
setlist(temp)
- flush_node(temp)
+ flushnode(temp)
return n
end
@@ -365,8 +354,8 @@ end
do
local parcodes = nodes.parcodes
- local hmodepar_code = parcodes.hmode_par
- local vmodepar_code = parcodes.vmode_par
+ local hmodepar_code = parcodes.hmodepar
+ local vmodepar_code = parcodes.vmodepar
local getnest = tex.getnest
local getsubtype = nuts.getsubtype
@@ -386,11 +375,48 @@ do
end
end
- local getsubtype = nodes.getsubtype
+ local startofpar = nuts.startofpar
- function nodes.start_of_par(n)
- local s = getsubtype(n)
- return s == hmodepar_code or s == vmodepar_code
+ function nodes.startofpar(n)
+ return startofpar(tonut(n))
end
end
+
+function nodes.hpack(h,...) return tonode(hpack_nodes(tonut(h),...)) end
+function nodes.vpack(h,...) return tonode(vpack_nodes(tonut(h),...)) end
+
+--
+
+local report_slide = logs.reporter("nodes", "slide")
+
+function nuts.checkslide(head,banner)
+ local c = head
+ local x = nil
+ local b = false
+ while c do
+ local p, n = getboth(c)
+ if p and p ~= x then
+ b = true
+ end
+ x = c
+ c = n
+ end
+ if b then
+ report_slide("")
+ report_slide(banner or "?")
+ report_slide("")
+ c = head
+ x = nil
+ while c do
+ local p, n = getboth(c)
+ report_slide("%s %s",(p and p ~= x and "!") or " ",tostring(tonode(c)))
+ x = c
+ c = getnext(c)
+ end
+ report_slide("")
+ nuts.show(head)
+ report_slide("")
+ nuts.slide(head)
+ end
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-bck.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-bck.lmt
index 9dff3ac40cb..0982871a349 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/node-bck.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-bck.lmt
@@ -46,13 +46,13 @@ local setattributelist = nuts.setattributelist
local setprop = nuts.setprop
local takebox = nuts.takebox
-local findtail = nuts.tail
local nextnode = nuts.traversers.node
local nexthlist = nuts.traversers.hlist
local nextlist = nuts.traversers.list
-local flush_node_list = nuts.flush_list
+local flushnodelist = nuts.flushlist
+local flushnode = nuts.flush
local new_rule = nodepool.rule
local new_kern = nodepool.kern
@@ -61,12 +61,15 @@ local new_hlist = nodepool.hlist
local privateattributes = attributes.private
local unsetvalue = attributes.unsetvalue
+local getvalue = attributes.getvalue
+local hasvalues = attributes.hasvalues
+
local linefillers = nodes.linefillers
local a_background = privateattributes("background")
local a_alignbackground = privateattributes("alignbackground")
local a_linefiller = privateattributes("linefiller")
-local a_ruled = privateattributes("ruled")
+----- a_ruled = privateattributes("ruled")
local trace_alignment = false
local report_alignment = logs.reporter("backgrounds","alignment")
@@ -92,7 +95,7 @@ local function colored_a(current,list,template,id)
--
local a = getattr(template,a_linefiller)
if a then
- local d = linefillers.data[a%1000]
+ local d = getvalue(a_linefiller,a)
if d then
rule = linefillers.filler(template,d,width,height,depth)
end
@@ -116,7 +119,7 @@ local function colored_b(current,list,template,id,indent)
--
local a = getattr(template,a_linefiller)
if a then
- local d = linefillers.data[a%1000]
+ local d = getvalue(a_linefiller,a)
if d then
rule = linefillers.filler(template,d,width-indent,height,depth)
end
@@ -141,26 +144,30 @@ local currentrow = 0
local enabled = false
local alignments = false
+-- todo: more control over cell attributes
+
local function add_alignbackgrounds(head,list)
for current, id, subtype, list in nextlist, list do
if list and id == hlist_code and subtype == celllist_code then
for template in nexthlist, list do
local background = getattr(template,a_alignbackground)
if background then
- local list = colored_a(current,list,template)
+ local list = colored_a(current,list,template,id)
if list then
setlist(current,list)
end
- setattr(template,a_alignbackground,unsetvalue) -- or property
+ -- not that efficient:
+ setattr(template,a_alignbackground,unsetvalue)
end
break
end
end
end
+ -- we can store this differently now
local template = getprop(head,"alignmentchecked")
if template then
list = colored_b(head,list,template[1],hlist_code,template[2])
- flush_node_list(template)
+ flushnodelist(template[1])
templates[currentrow] = false
return list
end
@@ -190,7 +197,7 @@ local function add_backgrounds(head,id,list)
if background then
list = colored_a(head,list,head,id)
-- not needed
- setattr(head,a_background,unsetvalue) -- or property -- todo
+ setattr(head,a_background,unsetvalue) -- or property
return list
end
end
@@ -238,15 +245,6 @@ function nodes.handlers.backgroundsvbox(head,where)
return head
end
--- interfaces.implement {
--- name = "enablebackgroundboxes",
--- onlyonce = true,
--- actions = enableaction,
--- arguments = { "'shipouts'", "'nodes.handlers.backgrounds'" }
--- }
---
--- doing it in the shipout works as well but this is nicer
-
local function enable(alignmentstoo)
if not enabled then
enabled = true
@@ -266,7 +264,7 @@ interfaces.implement {
}
interfaces.implement {
- name = "enablebackgroundalign",
+ name = "enablebackgroundalign", --- move into next one
onlyonce = true,
actions = function()
enable(true)
@@ -275,7 +273,7 @@ interfaces.implement {
interfaces.implement {
name = "setbackgroundrowdata",
- arguments = { "integer", "integer", "dimension" },
+ arguments = { "integer", "integer", "dimension" }, -- todo: "box"
actions = function(row,box,indent)
row = row -1 -- better here than in tex
if box == 0 then
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-bck.mkxl b/Master/texmf-dist/tex/context/base/mkxl/node-bck.mkxl
index b456313df3b..4ee2b0fa9bc 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/node-bck.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-bck.mkxl
@@ -19,13 +19,15 @@
\unprotect
-\registerctxluafile{node-bck}{autosuffix,optimize}
+\registerctxluafile{node-bck}{autosuffix}
% \backgroundvbox[green] {\input tufte } \par
% \backgroundvbox[blue] {\input ward } \par
% \backgroundvbox[red] {\input knuth } \par
% \backgroundhbox[yellow]{\rotate[rotation=45]{hello world}} \par
+% todo: use new register feature (but not used that much so ...)
+
\permanent\def\colorattr#1%
{\ifcsname\??colorattribute\currentcolorprefix#1\endcsname
\node_backgrounds_thecolorattr{\currentcolorprefix#1}%
@@ -74,7 +76,7 @@
\permanent\protected\def\backgroundline{\dontleavehmode\node_backgrounds_boxes_add\hbox}
\def\node_backgrounds_boxes_add#1[#2]%
- {\clf_enablebackgroundboxes
+ {\localcontrolled{\clf_enablebackgroundboxes}% permits assignment
#1\backgroundcolorattr{#2}}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-bwc.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-bwc.lmt
new file mode 100644
index 00000000000..d22f620388b
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-bwc.lmt
@@ -0,0 +1,13 @@
+if not modules then modules = { } end modules ['node-bwc'] = {
+ version = 1.001,
+ comment = "companion to node-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- This is a backward compatinility list. Eventually it will go away although a few
+-- might stay around. We start with some real low level ones. But ... users are
+-- supposed to use nodes and nuts.
+--
+-- Gone.
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-cmp.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-cmp.lmt
index 21fd700f093..8870203513e 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/node-cmp.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-cmp.lmt
@@ -75,47 +75,42 @@ function node.kerning(first,last)
end
end
-local protect_glyph = direct.protect_glyph
-local unprotect_glyph = direct.unprotect_glyph
-local protect_glyphs = direct.protect_glyphs
-local unprotect_glyphs = direct.unprotect_glyphs
+local protectglyph = direct.protectglyph
+local unprotectglyph = direct.unprotectglyph
+local protectglyphs = direct.protectglyphs
+local unprotectglyphs = direct.unprotectglyphs
-function node.protect_glyphs(first,last)
- protect_glyphs(todirect(first), last and todirect(last) or nil)
+function node.protectglyphs(first,last)
+ protectglyphs(todirect(first), last and todirect(last) or nil)
end
-function node.unprotect_glyphs(first,last)
- unprotect_glyphs(todirect(first), last and todirect(last) or nil)
+function node.unprotectglyphs(first,last)
+ unprotectglyphs(todirect(first), last and todirect(last) or nil)
end
-function node.protect_glyph(first)
- protect_glyph(todirect(first))
+function node.protectglyph(first)
+ protectglyph(todirect(first))
end
-function node.unprotect_glyph(first)
- unprotect_glyph(todirect(first))
+function node.unprotectglyph(first)
+ unprotectglyph(todirect(first))
end
-local flatten_discretionaries = direct.flatten_discretionaries
-local check_discretionaries = direct.check_discretionaries
-local check_discretionary = direct.check_discretionary
+local flattendiscretionaries = direct.flattendiscretionaries
+local checkdiscretionaries = direct.checkdiscretionaries
+local checkdiscretionary = direct.checkdiscretionary
-function node.flatten_discretionaries(first)
- local h, count = flatten_discretionaries(todirect(first))
+function node.flattendiscretionaries(first)
+ local h, count = flattendiscretionaries(todirect(first))
return tonode(h), count
end
-function node.check_discretionaries(n)
- check_discretionaries(todirect(n))
-end
-
-function node.check_discretionary(n)
- check_discretionary(todirect(n))
-end
+function node.checkdiscretionaries(n) checkdiscretionaries(todirect(n)) end
+function node.checkdiscretionary (n) checkdiscretionary (todirect(n)) end
-local hpack = direct.hpack
-local vpack = direct.vpack
-local list_to_hlist = direct.mlist_to_hlist
+local hpack = direct.hpack
+local vpack = direct.vpack
+local mlisttohlist = direct.mlisttohlist
function node.hpack(head,...)
local h, badness = hpack(head and todirect(head) or nil,...)
@@ -127,17 +122,17 @@ function node.vpack(head,...)
return tonode(h), badness
end
-function node.mlist_to_hlist(head,...)
- return tonode(mlist_to_hlist(head and todirect(head) or nil,...))
+function node.mlisttohlist(head,...)
+ return tonode(mlisttohlist(head and todirect(head) or nil,...))
end
-local end_of_math = direct.end_of_math
-local find_attribute = direct.find_attribute
-local first_glyph = direct.first_glyph
+local endofmath = direct.endofmath
+local findattribute = direct.findattribute
+local firstglyph = direct.firstglyph
-function node.end_of_math(n)
+function node.endofmath(n)
if n then
- n = end_of_math(todirect(n))
+ n = endofmath(todirect(n))
if n then
return tonode(n)
end
@@ -145,9 +140,9 @@ function node.end_of_math(n)
return nil
end
-function node.find_attribute(n,a)
+function node.findattribute(n,a)
if n then
- local v, n = find_attribute(todirect(n),a)
+ local v, n = findattribute(todirect(n),a)
if n then
return v, tonode(n)
end
@@ -155,14 +150,14 @@ function node.find_attribute(n,a)
return nil
end
-function node.first_glyph(first,last)
- local n = first_glyph(todirect(first), last and todirect(last) or nil)
+function node.firstglyph(first,last)
+ local n = firstglyph(todirect(first), last and todirect(last) or nil)
return n and tonode(n) or nil
end
local dimensions = direct.dimensions
local rangedimensions = direct.rangedimensions
-local effective_glue = direct.effective_glue
+local effectiveglue = direct.effectiveglue
function node.dimensions(a,b,c,d,e)
if type(a) == "userdata" then
@@ -185,53 +180,30 @@ function node.rangedimensions(parent,first,last)
return rangedimenensions(todirect(parent),todirect(first),last and todirect(last))
end
-function node.effective_glue(list,parent)
- return effective_glue(list and todirect(list) or nil,parent and todirect(parent) or nil)
-end
-
-local uses_font = direct.uses_font
-local has_glyph = direct.has_glyph
-local protrusion_skippable = direct.protrusion_skippable
-local make_extensible = direct.make_extensible
-
-function node.uses_font(n,f)
- return uses_font(todirect(n),f)
-end
-
-function node.has_glyph(n)
- return has_glyph(todirect(n))
-end
-
-function node.protrusion_skippable(n)
- return protrusion_skippable(todirect(n))
+function node.effectiveglue(list,parent)
+ return effectiveglue(list and todirect(list) or nil,parent and todirect(parent) or nil)
end
-function node.make_extensible(...)
- local n = make_extensible(...)
- return n and tonode(n) or nil
-end
+local usesfont = direct.usesfont
+local hasglyph = direct.hasglyph
+local protrusionskippable = direct.protrusionskippable
-local last_node = direct.last_node
+function node.usesfont (n,f) return usesfont(todirect(n),f) end
+function node.hasglyph (n) return hasglyph(todirect(n)) end
+function node.protrusionskippable(n) return protrusionskippable(todirect(n)) end
-function node.last_node()
- local n = last_node()
- return n and tonode(n) or nil
-end
+local makeextensible = direct.make_extensible
+local lastnode = direct.lastnode
-local is_zero_glue = direct.is_zero_glue
-local getglue = direct.getglue
-local setglue = direct.setglue
+function node.makeextensible(...) local n = makeextensible(...) return n and tonode(n) or nil end
+function node.lastnode () local n = lastnode() return n and tonode(n) or nil end
-function node.is_zero_glue(n)
- return is_zero_glue(todirect(n))
-end
-
-function node.get_glue(n)
- return get_glue(todirect(n))
-end
+local iszeroglue = direct.iszeroglue
+local getglue = direct.getglue
+local setglue = direct.setglue
-function node.set_glue(n)
- return set_glue(todirect(n))
-end
+function node.iszeroglue(n) return iszeroglue(todirect(n)) end
+function node.getglue (n) return getglue (todirect(n)) end
+function node.setglue (n,...) return setglue (todirect(n),...) end
node.family_font = tex.getfontoffamily
diff --git a/Master/texmf-dist/tex/context/base/mkiv/node-dir.lua b/Master/texmf-dist/tex/context/base/mkxl/node-dir.lmt
index 762f20739da..246bf34e40b 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/node-dir.lua
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-dir.lmt
@@ -9,6 +9,9 @@ if not modules then modules = { } end modules ['node-dir'] = {
local nodes = nodes
local nuts = nodes.nuts
+local nodecodes = nodes.nodecodes
+local hlist_code = nodecodes.hlist
+local vlist_code = nodecodes.vlist
local normaldir_code = nodes.dircodes.normal
local line_code = nodes.listcodes.line
local lefttoright_code = nodes.dirvalues.lefttoright
@@ -16,15 +19,17 @@ local lefttoright_code = nodes.dirvalues.lefttoright
local getnext = nuts.getnext
local getlist = nuts.getlist
local getwhd = nuts.getwhd
+local getwidth = nuts.getwidth
local getdirection = nuts.getdirection
local setlist = nuts.setlist
local nextdir = nuts.traversers.dir
-local nexthlist = nuts.traversers.hlist
+local nextlist = nuts.traversers.list
local rangedimensions = nuts.rangedimensions
-local insert_before = nuts.insert_before
+local insertbefore = nuts.insertbefore
+local insertafter = nuts.insertafter
local new_rule = nuts.pool.rule
local new_kern = nuts.pool.kern
@@ -32,32 +37,8 @@ local new_kern = nuts.pool.kern
local setcolor = nodes.tracers.colors.set
local settransparency = nodes.tracers.transparencies.set
--- local function dirdimensions(parent,begindir) -- can be a helper
--- local level = 1
--- local enddir = begindir
--- local width = 0
--- for current, subtype in nextdir, getnext(begindir) do
--- if subtype == normaldir_code then -- todo
--- level = level + 1
--- else
--- level = level - 1
--- end
--- if level == 0 then -- does the type matter
--- enddir = current
--- width = rangedimensions(parent,begindir,enddir)
--- return width, enddir
--- end
--- end
--- if enddir == begindir then
--- width = rangedimensions(parent,begindir)
--- end
--- return width, enddir
--- end
-
local function dirdimensions(parent,begindir) -- can be a helper
- local level = 1
- local lastdir = nil
- local width = 0
+ local level = 1
for current, subtype in nextdir, getnext(begindir) do
if subtype == normaldir_code then -- todo
level = level + 1
@@ -69,6 +50,7 @@ local function dirdimensions(parent,begindir) -- can be a helper
end
end
return (rangedimensions(parent,begindir)), begindir
+-- return getwidth(parent), begindir
end
nuts.dirdimensions = dirdimensions
@@ -79,36 +61,37 @@ local function colorit(list,current,dir,w,h,d)
local color = dir == lefttoright_code and "trace:s" or "trace:o"
setcolor(rule,color)
settransparency(rule,color)
- list, current = insert_before(list,current,kern)
- list, current = insert_before(list,current,rule)
+ list, current = insertbefore(list,current,kern)
+ list, current = insertbefore(list,current,rule)
return list, current
end
-function nodes.tracers.directions(head)
- for hlist, subtype in nexthlist, head do
- if subtype == line_code then
- local list = getlist(hlist)
- local w, h, d = getwhd(hlist)
- list = colorit(list,list,getdirection(hlist),w,h,d)
- for current in nextdir, list do
- local dir, cancel = getdirection(current)
- if not cancel then
- local width = dirdimensions(hlist,current)
- list = colorit(list,current,dir,width,h,d)
+
+local function tracedirections(head)
+ for parent, id, subtype, list in nextlist, head do
+ if list then
+ if subtype == line_code then
+ local w, h, d = getwhd(parent)
+ list = colorit(list,list,getdirection(parent),w,h,d)
+ for current in nextdir, list do
+ local dir, cancel = getdirection(current)
+ if not cancel then
+ local width = dirdimensions(parent,current)
+ list = colorit(list,current,dir,width,h,d)
+ end
end
end
- setlist(hlist,list)
+ tracedirections(list)
end
end
return head
end
-local enabled = false
+nodes.tracers.directions = tracedirections
+
+-- so, not attribute driven, only shipout, so more a document wide tracer, maybe
+-- per page (so keep enabled and delayed disabled
trackers.register("nodes.directions", function(v)
- if not enabled then
- enabled = true
- nodes.tasks.appendaction("finalizers","after","nodes.tracers.directions",nil,"nut","enabled")
- end
- nodes.tasks.setaction(v)
+ nodes.tasks.setaction("shipouts","nodes.tracers.directions",v)
end)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-ext.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-ext.lmt
index 2f909cd3d1a..de2e8fa5478 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/node-ext.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-ext.lmt
@@ -18,7 +18,8 @@ local allocate = utilities.storage.allocate
local formatters = string.formatters
-local get = token.get_index -- getters
+local get = tokens.accessors.index
+
local scanners = tokens.scanners
local scaninteger = scanners.integer
local scanstring = scanners.string
@@ -50,7 +51,8 @@ local whatsitcodes = allocate { }
nodes.whatsitcodes = whatsitcodes
local lastwhatsit = 0
-nodes.subtypes.whatsit = whatsitcodes
+nodes.subtypes.whatsit = whatsitcodes
+nodes.subtypes[whatsit_code] = whatsitcodes
local function registerwhatsit(name)
lastwhatsit = lastwhatsit + 1
@@ -131,14 +133,10 @@ do
end
function backends.latelua(current,pos_h,pos_v) -- todo: pass pos_h and pos_v (more efficient in lmtx)
- local p = nodeproperties[current]
- if p then
- data = p.data
- else
- data = getdata(current)
- end
- noflatelua = noflatelua + 1
+ local prop = nodeproperties[current]
+ local data = prop and prop.data or getdata(current)
local kind = type(data)
+ noflatelua = noflatelua + 1
if kind == "table" then
data.action(data.specification or data)
elseif kind == "function" then
@@ -147,7 +145,7 @@ do
if kind ~= "string" then
data = serialize(data)
end
- if #data ~= "" then
+ if data and #data ~= "" then
local code = loadstring(data)
if code then
code()
@@ -164,6 +162,7 @@ do
name = "latelua",
public = true,
protected = true,
+ untraced = true,
actions = function()
local node = copynut(lateluanode)
local name = "latelua"
@@ -616,7 +615,7 @@ do
end,
}
- -- why ...
+ -- so we have them defined and can use them at the tex end .. still needed?
local open_command = get(token.create("openout"))
local write_command = get(token.create("write"))
diff --git a/Master/texmf-dist/tex/context/base/mkxl/back-ext.mkxl b/Master/texmf-dist/tex/context/base/mkxl/node-ext.mkxl
index a3d9d2633e8..2f0df1ba37c 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/back-ext.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-ext.mkxl
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-% \registerctxluafile{back-ext}{autosuffix}
+\registerctxluafile{node-ext}{autosuffix}
\unprotect
@@ -23,31 +23,24 @@
% rotation
-\permanent\protected\def\dostartrotation#1%
- {\forcecolorhack
- \clf_startrotation#1\relax} % todo: implement without Q q
+% \permanent\protected\def\dostartrotation#1{\forcecolorhack\clf_startrotation#1\relax}
+% \permanent\protected\def\dostoprotation {\clf_stoprotation\forcecolorhack}
-\permanent\protected\def\dostoprotation
- {\clf_stoprotation
- \forcecolorhack}
+\permanent\protected\def\dostartrotation#1{\clf_startrotation#1\relax}
+\permanent\protected\def\dostoprotation {\clf_stoprotation}
% scaling
-\permanent\protected\def\dostartscaling#1#2%
- {\forcecolorhack
- \clf_startscaling rx #1 ry #2\relax}
+% \permanent\protected\def\dostartscaling#1#2{\forcecolorhack\clf_startscaling rx #1 ry #2\relax}
+% \permanent\protected\def\dostopscaling {\clf_stopscaling\forcecolorhack}
-\permanent\protected\def\dostopscaling
- {\clf_stopscaling
- \forcecolorhack}
+\permanent\protected\def\dostartscaling#1#2{\clf_startscaling rx #1 ry #2\relax}
+\permanent\protected\def\dostopscaling {\clf_stopscaling}
% mirroring
-\permanent\protected\def\dostartmirroring
- {\clf_startmirroring}
-
-\permanent\protected\def\dostopmirroring
- {\clf_stopmirroring}
+\permanent\protected\def\dostartmirroring{\clf_startmirroring}
+\permanent\protected\def\dostopmirroring {\clf_stopmirroring}
% transform
@@ -73,11 +66,16 @@
%D \dostopclipping
%D \stoptyping
-\mutable\let\MPclippath\empty
+\mutable\lettonothing\MPclippath
+
+% \permanent\protected\def\dostartclipping#1#2#3% we can move this to lua and only set a box here
+% {\forcecolorhack
+% \meta_grab_clip_path{#1}{#2}{#3}%
+% \clf_startclipping{\MPclippath}%
+% \glet\MPclippath\empty}
\permanent\protected\def\dostartclipping#1#2#3% we can move this to lua and only set a box here
- {\forcecolorhack
- \meta_grab_clip_path{#1}{#2}{#3}%
+ {\meta_grab_clip_path{#1}{#2}{#3}%
\clf_startclipping{\MPclippath}%
\glet\MPclippath\empty}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-fin.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-fin.lmt
index 2ca7491a1b2..88050af8ac8 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/node-fin.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-fin.lmt
@@ -7,72 +7,66 @@ if not modules then modules = { } end modules ['node-fin'] = {
license = "see context related readme files",
}
--- this module is being reconstructed
--- local functions, only slightly slower
---
--- leaders are also triggers ... see colo-ext for an example (negate a box)
-
local next, type, format = next, type, string.format
local setmetatableindex = table.setmetatableindex
local attributes, nodes, node = attributes, nodes, node
-local nuts = nodes.nuts
-local tonut = nodes.tonut
+local nuts = nodes.nuts
+local tonut = nodes.tonut
-local getnext = nuts.getnext
-local getid = nuts.getid
-local getlist = nuts.getlist
-local getleader = nuts.getleader
-local getattr = nuts.getattr
-local getattrs = nuts.getattrs
-local getwidth = nuts.getwidth
-local getwhd = nuts.getwhd
-local getorientation = nuts.getorientation
-local has_dimensions = nuts.has_dimensions
-local getbox = nuts.getbox
+local getnext = nuts.getnext
+local getid = nuts.getid
+local getlist = nuts.getlist
+local getleader = nuts.getleader
+local getattr = nuts.getattr
+local getattrs = nuts.getattrs
+local getwidth = nuts.getwidth
+local getwhd = nuts.getwhd
+local hasgeometry = nuts.hasgeometry
+local hasdimensions = nuts.hasdimensions
+local getbox = nuts.getbox
-local setlist = nuts.setlist
-local setleader = nuts.setleader
+local setlist = nuts.setlist
+local setleader = nuts.setleader
-local copy_node = nuts.copy
-local find_tail = nuts.tail
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local copy_node = nuts.copy
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
+local appendaftertail = nuts.appendaftertail
-local nextnode = nuts.traversers.node
-local nextcontent = nuts.traversers.content
+local nextnode = nuts.traversers.node
+local nextcontent = nuts.traversers.content
-local nodecodes = nodes.nodecodes
-local rulecodes = nodes.rulecodes
+local nodecodes = nodes.nodecodes
+local rulecodes = nodes.rulecodes
-local boxrule_code = rulecodes.box
-local imagerule_code = rulecodes.image
-local emptyrule_code = rulecodes.empty
+local boxrule_code = rulecodes.box
+local imagerule_code = rulecodes.image
+local emptyrule_code = rulecodes.empty
+local virtualrule_code = rulecodes.virtual
-local container_code = nodes.listcodes.container
+local container_code = nodes.listcodes.container
-local glyph_code = nodecodes.glyph
-local disc_code = nodecodes.disc
-local glue_code = nodecodes.glue
-local rule_code = nodecodes.rule
-local hlist_code = nodecodes.hlist
-local vlist_code = nodecodes.vlist
+local glyph_code = nodecodes.glyph
+local disc_code = nodecodes.disc
+local glue_code = nodecodes.glue
+local rule_code = nodecodes.rule
+local hlist_code = nodecodes.hlist
+local vlist_code = nodecodes.vlist
-local texlists = tex.lists
-local texgetnest = tex.getnest
+local texlists = tex.lists
+local texgetnest = tex.getnest
-local states = attributes.states
-local numbers = attributes.numbers
-local a_trigger = attributes.private('trigger')
-local triggering = false
+local states = attributes.states
+local numbers = attributes.numbers
-local implement = interfaces.implement
+local implement = interfaces.implement
-local starttiming = statistics.starttiming
-local stoptiming = statistics.stoptiming
-local loadstripped = utilities.lua.loadstripped
-local unsetvalue = attributes.unsetvalue
+local starttiming = statistics.starttiming
+local stoptiming = statistics.stoptiming
+local loadstripped = utilities.lua.loadstripped
+local unsetvalue = attributes.unsetvalue
-- these two will be like trackers
@@ -86,7 +80,7 @@ nodes.plugindata = nil
-- inheritance: -0x7FFFFFFF -- we can best use nil and skip !
-local template = [[
+local template <const> = [[
local plugin = nodes.plugindata
local starttiming = statistics.starttiming
local stoptiming = statistics.stoptiming
@@ -139,7 +133,7 @@ end
-- the injectors
-local nsdata, nsnone, nslistwise, nsforced, nsselector, nstrigger
+local nsdata, nsnone, nslistwise, nsforced, nsselector
local current, current_selector = 0, 0 -- nb, stack has a local current !
local nsbegin, nsend, nsreset
@@ -149,7 +143,6 @@ function states.initialize(namespace,attribute,head)
nsforced = namespace.forced
nsselector = namespace.selector
nslistwise = namespace.listwise
- nstrigger = triggering and namespace.triggering and a_trigger
current = 0
current_selector = 0
nsstep = namespace.resolve_step
@@ -168,15 +161,10 @@ function states.finalize(namespace,attribute,head) -- is this one ok?
if id == hlist_code or id == vlist_code then
local content = getlist(head)
if content then
--- local list = insert_node_before(content,content,copy_node(nsnone)) -- two return values
- local list = insert_node_after(content,find_tail(content),copy_node(nsnone)) -- two return values
- if list ~= content then
- setlist(head,list)
- end
+ appendaftertail(content,copy_node(nsnone))
end
else
--- head = insert_node_before(head,head,copy_node(nsnone))
- head = insert_node_after(find_tail(head),head,copy_node(nsnone))
+ appendaftertail(head,copy_node(nsnone))
end
return head, true
end
@@ -197,52 +185,34 @@ local function process(attribute,head,inheritance,default) -- one attribute
elseif id == hlist_code or id == vlist_code then
-- tricky checking
local outer
- if subtype == container_code then
- check = true
-current = 0
- end
- if getorientation(stack) then
+ if subtype == container_code or hasgeometry(stack) then
outer = getattr(stack,attribute)
if outer then
if default and outer == inheritance then
if current ~= default then
- head = insert_node_before(head,stack,copy_node(nsdata[default]))
+ head = insertnodebefore(head,stack,copy_node(nsdata[default]))
current = default
end
elseif current ~= outer then
- head = insert_node_before(head,stack,copy_node(nsdata[c]))
+ head = insertnodebefore(head,stack,copy_node(nsdata[outer]))
current = outer
end
elseif default and inheritance then
if current ~= default then
- head = insert_node_before(head,stack,copy_node(nsdata[default]))
+ head = insertnodebefore(head,stack,copy_node(nsdata[default]))
current = default
end
elseif current > 0 then
- head = insert_node_before(head,stack,copy_node(nsnone))
+ head = insertnodebefore(head,stack,copy_node(nsnone))
current = 0
end
end
- -- begin nested --
- local list
- if nstrigger and getattr(stack,nstrigger) then
- if not outer then
- outer = getattr(stack,attribute)
- end
- if outer ~= inheritance then
- list = process(attribute,content,inheritance,outer)
- else
- list = process(attribute,content,inheritance,default)
- end
- else
- list = process(attribute,content,inheritance,default)
- end
+ local list = process(attribute,content,inheritance,default)
if content ~= list then
setlist(stack,list)
end
- -- end nested --
elseif id == rule_code then
- check = has_dimensions(stack)
+ check = subtype == virtualrule_code or hasdimensions(stack)
end
-- much faster this way than using a check() and nested() function
if check then
@@ -250,11 +220,11 @@ current = 0
if c then
if default and c == inheritance then
if current ~= default then
- head = insert_node_before(head,stack,copy_node(nsdata[default]))
+ head = insertnodebefore(head,stack,copy_node(nsdata[default]))
current = default
end
elseif current ~= c then
- head = insert_node_before(head,stack,copy_node(nsdata[c]))
+ head = insertnodebefore(head,stack,copy_node(nsdata[c]))
current = c
end
if leader then
@@ -266,32 +236,20 @@ current = 0
-- for improvement here
current = 0
end
- -- begin nested --
- local list
- if nstrigger and getattr(stack,nstrigger) then
- local outer = getattr(stack,attribute)
- if outer ~= inheritance then
- list = process(attribute,leader,inheritance,outer)
- else
- list = process(attribute,leader,inheritance,default)
- end
- else
- list = process(attribute,leader,inheritance,default)
- end
+ local list = process(attribute,leader,inheritance,default)
if leader ~= list then
setleader(stack,list)
end
- -- end nested --
current = savedcurrent
leader = false
end
elseif default and inheritance then
if current ~= default then
- head = insert_node_before(head,stack,copy_node(nsdata[default]))
+ head = insertnodebefore(head,stack,copy_node(nsdata[default]))
current = default
end
elseif current > 0 then
- head = insert_node_before(head,stack,copy_node(nsnone))
+ head = insertnodebefore(head,stack,copy_node(nsnone))
current = 0
end
check = false
@@ -314,22 +272,18 @@ local function simple(attribute,head)
check = true
leader = content
elseif id == hlist_code or id == vlist_code then
- if subtype == container_code then
- check = true
-current = 0
- end
- if getorientation(stack) then
+ if subtype == container_code or hasgeometry(stack) then
local outer = getattr(stack,attribute)
if outer then
if current ~= outer then
if current > 0 then
- head = insert_node_before(head,stack,copy_node(nsnone))
+ head = insertnodebefore(head,stack,copy_node(nsnone))
end
- head = insert_node_before(head,stack,copy_node(nsdata[c]))
+ head = insertnodebefore(head,stack,copy_node(nsdata[c]))
current = outer
end
elseif current > 0 then
- head = insert_node_before(head,stack,copy_node(nsnone))
+ head = insertnodebefore(head,stack,copy_node(nsnone))
current = 0
end
end
@@ -338,16 +292,16 @@ current = 0
setlist(stack,list)
end
elseif id == rule_code then
- check = has_dimensions(stack)
+ check = subtype == virtualrule_code or hasdimensions(stack)
end
if check then
local c = getattr(stack,attribute)
if c then
if current ~= c then
if current > 0 then
- head = insert_node_before(head,stack,copy_node(nsnone))
+ head = insertnodebefore(head,stack,copy_node(nsnone))
end
- head = insert_node_before(head,stack,copy_node(nsdata[c]))
+ head = insertnodebefore(head,stack,copy_node(nsdata[c]))
current = c
end
if leader then
@@ -364,7 +318,7 @@ current = 0
leader = false
end
elseif current > 0 then
- head = insert_node_before(head,stack,copy_node(nsnone))
+ head = insertnodebefore(head,stack,copy_node(nsnone))
current = 0
end
check = false
@@ -377,137 +331,13 @@ states.simple = function(namespace,attribute,head,default)
return simple(attribute,head,default)
end
--- we can force a selector, e.g. document wide color spaces, saves a little
--- watch out, we need to check both the selector state (like colorspace) and
--- the main state (like color), otherwise we get into troubles when a selector
--- state changes while the main state stays the same (like two glyphs following
--- each other with the same color but different color spaces e.g. \showcolor)
-
--- local function selective(attribute,head,inheritance,default) -- two attributes
--- local check = false
--- local leader = nil
--- for stack, id, subtype, content in nextcontent, head do
--- if id == glyph_code or id == disc_code then
--- check = true
--- elseif id == glue_code then
--- check = true
--- leader = content -- getleader(stack)
--- elseif id == hlist_code or id == vlist_code then
--- -- tricky checking
--- if subtype == container_code then
--- check = true
--- current = 0
--- end
--- local outer
--- if getorientation(stack) then
--- outer = getattr(stack,attribute)
--- if outer then
--- if default and outer == inheritance then
--- if current ~= default then
--- local data = nsdata[default]
--- head = insert_node_before(head,stack,copy_node(data[nsforced or getattr(stack,nsselector) or nsselector]))
--- current = default
--- end
--- else
--- local s = getattr(stack,nsselector)
--- -- local s = nsforced or getattr(stack,nsselector)
--- if current ~= outer or current_selector ~= s then
--- local data = nsdata[outer]
--- head = insert_node_before(head,stack,copy_node(data[nsforced or s or nsselector]))
--- current = outer
--- current_selector = s
--- end
--- end
--- elseif default and inheritance then
--- if current ~= default then
--- local data = nsdata[default]
--- head = insert_node_before(head,stack,copy_node(data[nsforced or getattr(stack,nsselector) or nsselector]))
--- current = default
--- end
--- elseif current > 0 then
--- head = insert_node_before(head,stack,copy_node(nsnone))
--- current, current_selector = 0, 0
--- end
--- end
--- -- begin nested
--- local list
--- if nstrigger and getattr(stack,nstrigger) then
--- if not outer then
--- outer = getattr(stack,attribute)
--- end
--- if outer ~= inheritance then
--- list = selective(attribute,content,inheritance,outer)
--- else
--- list = selective(attribute,content,inheritance,default)
--- end
--- else
--- list = selective(attribute,content,inheritance,default)
--- end
--- if content ~= list then
--- setlist(stack,list)
--- end
--- -- end nested
--- elseif id == rule_code then
--- if subtype == boxrule_code or subtype == imagerule_code or subtype == emptyrule_code then
--- -- so no redundant color stuff (only here, layers for instance should obey)
--- check = false
--- else
--- check = has_dimensions(stack)
--- end
--- end
--- if check then
--- local c = getattr(stack,attribute)
--- if c then
--- if default and c == inheritance then
--- if current ~= default then
--- local data = nsdata[default]
--- head = insert_node_before(head,stack,copy_node(data[nsforced or getattr(stack,nsselector) or nsselector]))
--- current = default
--- end
--- else
--- local s = getattr(stack,nsselector)
--- -- local s = nsforced or getattr(stack,nsselector)
--- if current ~= c or current_selector ~= s then
--- local data = nsdata[c]
--- head = insert_node_before(head,stack,copy_node(data[nsforced or s or nsselector]))
--- current = c
--- current_selector = s
--- end
--- end
--- if leader then
--- -- begin nested
--- local list
--- if nstrigger and getattr(stack,nstrigger) then
--- local outer = getattr(stack,attribute)
--- if outer ~= inheritance then
--- list = selective(attribute,leader,inheritance,outer)
--- else
--- list = selective(attribute,leader,inheritance,default)
--- end
--- else
--- list = selective(attribute,leader,inheritance,default)
--- end
--- if leader ~= list then
--- setleader(stack,list)
--- end
--- -- end nested
--- leader = false
--- end
--- elseif default and inheritance then
--- if current ~= default then
--- local data = nsdata[default]
--- head = insert_node_before(head,stack,copy_node(data[nsforced or getattr(stack,nsselector) or nsselector]))
--- current = default
--- end
--- elseif current > 0 then
--- head = insert_node_before(head,stack,copy_node(nsnone))
--- current, current_selector = 0, 0
--- end
--- check = false
--- end
--- end
--- return head
--- end
+-- We can force a selector, e.g. document wide color spaces, saves a little watch
+-- out, we need to check both the selector state (like colorspace) and the main
+-- state (like color), otherwise we get into troubles when a selector state changes
+-- while the main state stays the same (like two glyphs following each other with
+-- the same color but different color spaces e.g. \showcolor). The triggering
+-- mechanism has been removed because it was never really used, but the original can
+-- be seen in the mkiv (lua) code.
local function selective(attribute,head,inheritance,default) -- two attributes
local check = false
@@ -517,64 +347,53 @@ local function selective(attribute,head,inheritance,default) -- two attributes
check = true
elseif id == glue_code then
check = true
- leader = content -- getleader(stack)
+ leader = content
elseif id == hlist_code or id == vlist_code then
- -- tricky checking
- if subtype == container_code then
- check = true
-current = 0
- end
local outer, s
- if getorientation(stack) then
+ if subtype == container_code or hasgeometry(stack) then
outer, s = getattrs(stack,attribute,nsselector)
if outer then
if default and outer == inheritance then
if current ~= default then
- local data = nsdata[default]
- head = insert_node_before(head,stack,copy_node(data[nsforced or nsselector]))
+ local data = nsdata[default][nsforced or nsselector]
+ if data then
+ head = insertnodebefore(head,stack,copy_node(data))
+ end
current = default
end
elseif current ~= outer or current_selector ~= s then
- local data = nsdata[outer]
- head = insert_node_before(head,stack,copy_node(data[nsforced or s or nsselector]))
+ local data = nsdata[outer][nsforced or s or nsselector]
+ if data then
+ head = insertnodebefore(head,stack,copy_node(data))
+ end
current = outer
current_selector = s
end
elseif default and inheritance then
if current ~= default then
- local data = nsdata[default]
- head = insert_node_before(head,stack,copy_node(data[nsforced or s or nsselector]))
+ local data = nsdata[default][nsforced or s or nsselector]
+ if data then
+ head = insertnodebefore(head,stack,copy_node(data))
+ end
current = default
end
elseif current > 0 then
- head = insert_node_before(head,stack,copy_node(nsnone))
+ head = insertnodebefore(head,stack,copy_node(nsnone))
current, current_selector = 0, 0
end
end
- -- begin nested
- local list
- if nstrigger and getattr(stack,nstrigger) then
- if not outer then
- outer = getattr(stack,attribute)
- end
- if outer ~= inheritance then
- list = selective(attribute,content,inheritance,outer)
- else
- list = selective(attribute,content,inheritance,default)
- end
- else
- list = selective(attribute,content,inheritance,default)
- end
+ local list = selective(attribute,content,inheritance,default)
if content ~= list then
setlist(stack,list)
end
- -- end nested
elseif id == rule_code then
- if subtype == boxrule_code or subtype == imagerule_code or subtype == emptyrule_code then
+ if subtype == virtualrule_code then
+ check = true
+ elseif subtype == boxrule_code or subtype == imagerule_code or subtype == emptyrule_code then
-- so no redundant color stuff (only here, layers for instance should obey)
check = false
else
- check = has_dimensions(stack)
+ check = hasdimensions(stack)
end
end
if check then
@@ -582,43 +401,37 @@ current = 0
if c then
if default and c == inheritance then
if current ~= default then
- local data = nsdata[default]
- head = insert_node_before(head,stack,copy_node(data[nsforced or s or nsselector]))
+ local data = nsdata[default][nsforced or s or nsselector]
+ if data then
+ head = insertnodebefore(head,stack,copy_node(data))
+ end
current = default
end
elseif current ~= c or current_selector ~= s then
- local data = nsdata[c]
- head = insert_node_before(head,stack,copy_node(data[nsforced or s or nsselector]))
+ local data = nsdata[c][nsforced or s or nsselector]
+ if data then
+ head = insertnodebefore(head,stack,copy_node(data))
+ end
current = c
current_selector = s
end
if leader then
- -- begin nested
- local list
- if nstrigger and getattr(stack,nstrigger) then
- local outer = getattr(stack,attribute)
- if outer ~= inheritance then
- list = selective(attribute,leader,inheritance,outer)
- else
- list = selective(attribute,leader,inheritance,default)
- end
- else
- list = selective(attribute,leader,inheritance,default)
- end
+ local list = selective(attribute,leader,inheritance,default)
if leader ~= list then
setleader(stack,list)
end
- -- end nested
leader = false
end
elseif default and inheritance then
if current ~= default then
- local data = nsdata[default]
- head = insert_node_before(head,stack,copy_node(data[nsforced or s or nsselector]))
+ local data = nsdata[default][nsforced or s or nsselector]
+ if data then
+ head = insertnodebefore(head,stack,copy_node(data))
+ end
current = default
end
elseif current > 0 then
- head = insert_node_before(head,stack,copy_node(nsnone))
+ head = insertnodebefore(head,stack,copy_node(nsnone))
current, current_selector = 0, 0
end
check = false
@@ -640,7 +453,7 @@ end
-- Todo: make a better stacker. Keep track (in attribute) about nesting level. Not
-- entirely trivial and a generic solution is nicer (compares to the exporter).
-local function stacked(attribute,head,default) -- no triggering, no inheritance, but list-wise
+local function stacked(attribute,head,default) -- no inheritance, but list-wise
local stack = head
local current = default or 0
local depth = 0
@@ -661,17 +474,17 @@ local function stacked(attribute,head,default) -- no triggering, no inheritance,
-- the problem is that broken lines gets the attribute which can be a later one
local list
if subtype == container_code then
- check = true
-current = 0
+ check = true
+ current = 0
end
if nslistwise then
local a = getattr(stack,attribute)
if a and current ~= a and nslistwise[a] then -- viewerlayer / needs checking, see below
local p = current
current = a
- head = insert_node_before(head,stack,copy_node(nsdata[a]))
+ head = insertnodebefore(head,stack,copy_node(nsdata[a]))
list = stacked(attribute,content,current) -- two return values
- head, stack = insert_node_after(head,stack,copy_node(nsnone))
+ head, stack = insertnodeafter(head,stack,copy_node(nsnone))
current = p
else
list = stacked(attribute,content,current)
@@ -684,13 +497,13 @@ current = 0
end
end
elseif id == rule_code then
- check = has_dimensions(stack)
+ check = subtype == virtualrule_code or hasdimensions(stack)
end
if check then
local a = getattr(stack,attribute)
if a then
if current ~= a then
- head = insert_node_before(head,stack,copy_node(nsdata[a]))
+ head = insertnodebefore(head,stack,copy_node(nsdata[a]))
depth = depth + 1
current = a
end
@@ -707,7 +520,7 @@ current = 0
elseif default > 0 then
--
elseif current > 0 then
- head = insert_node_before(head,stack,copy_node(nsnone))
+ head = insertnodebefore(head,stack,copy_node(nsnone))
depth = depth - 1
current = 0
end
@@ -716,7 +529,7 @@ current = 0
stack = getnext(stack)
end
while depth > 0 do
- head = insert_node_after(head,stack,copy_node(nsnone))
+ head = insertnodeafter(head,stack,copy_node(nsnone))
depth = depth - 1
end
return head
@@ -726,119 +539,13 @@ states.stacked = function(namespace,attribute,head,default)
return stacked(attribute,head,default)
end
--- experimental
-
--- local function stacker(attribute,head,default) -- no triggering, no inheritance, but list-wise
---
--- -- nsbegin()
--- local stacked = false
---
--- local current = head
--- local previous = head
--- local attrib = default or unsetvalue
--- local check = false
--- local leader = false
---
--- while current do
--- local id = getid(current)
--- if id == glyph_code then
--- check = true
--- elseif id == glue_code then
--- leader = getleader(current)
--- if leader then
--- check = true
--- end
--- elseif id == hlist_code or id == vlist_code then
--- local content = getlist(current)
--- if content then
--- local list
--- if subtype == container_code then
--- check = true
--- current = 0
--- end
--- if nslistwise then
--- local a = getattr(current,attribute)
--- if a and attrib ~= a and nslistwise[a] then -- viewerlayer
--- head = insert_node_before(head,current,copy_node(nsdata[a]))
--- list = stacker(attribute,content,a)
--- if list ~= content then
--- setlist(current,list)
--- end
--- head, current = insert_node_after(head,current,copy_node(nsnone))
--- else
--- list = stacker(attribute,content,attrib)
--- if list ~= content then
--- setlist(current,list)
--- end
--- end
--- else
--- list = stacker(attribute,content,default)
--- if list ~= content then
--- setlist(current,list)
--- end
--- end
--- end
--- elseif id == rule_code then
--- check = has_dimensions(current)
--- end
---
--- if check then
--- local a = getattr(current,attribute) or unsetvalue
--- if a ~= attrib then
--- if not stacked then
--- stacked = true
--- nsbegin()
--- end
--- local n = nsstep(a)
--- if n then
--- head = insert_node_before(head,current,n) -- a
--- end
--- attrib = a
--- if leader then
--- -- tricky as a leader has to be a list so we cannot inject before
--- -- local list = stacker(attribute,leader,attrib)
--- -- leader = false
---
--- local content = getlist(leader)
--- if content then
--- local list = stacker(attribute,leader,attrib)
--- if leader ~= list then
--- setleader(current,list)
--- end
--- end
---
--- leader = false
--- end
--- end
--- check = false
--- end
---
--- previous = current
--- current = getnext(current)
--- end
---
--- if stacked then
--- local n = nsend()
--- while n do
--- head = insert_node_after(head,previous,n)
--- n = nsend()
--- end
--- end
---
--- return head
--- end
-
-local function stacker(attribute,head,default) -- no triggering, no inheritance, but list-wise
-
- -- nsbegin()
+local function stacker(attribute,head,default) -- no inheritance, but list-wise
local stacked = false
-
local current = head
local previous = head
local attrib = default or unsetvalue
local check = false
local leader = false
-
for current, id, subtype, content in nextcontent, head do
if id == glyph_code then
check = true
@@ -849,17 +556,16 @@ local function stacker(attribute,head,default) -- no triggering, no inheritance,
local list
if subtype == container_code then
check = true
--- attrib = default or unsetvalue -- or just umsetvalue
end
if nslistwise then
local a = getattr(current,attribute)
if a and attrib ~= a and nslistwise[a] then -- viewerlayer
- head = insert_node_before(head,current,copy_node(nsdata[a]))
+ head = insertnodebefore(head,current,copy_node(nsdata[a]))
list = stacker(attribute,content,a)
if list ~= content then
setlist(current,list)
end
- head, current = insert_node_after(head,current,copy_node(nsnone))
+ head, current = insertnodeafter(head,current,copy_node(nsnone))
else
list = stacker(attribute,content,attrib)
if list ~= content then
@@ -873,14 +579,15 @@ local function stacker(attribute,head,default) -- no triggering, no inheritance,
end
end
elseif id == rule_code then
- if subtype == boxrule_code or subtype == imagerule_code or subtype == emptyrule_code then
+ if subtype == virtualrule_code then
+ check = true
+ elseif subtype == boxrule_code or subtype == imagerule_code or subtype == emptyrule_code then
-- so no redundant color stuff (only here, layers for instance should obey)
check = false
else
- check = has_dimensions(current)
+ check = hasdimensions(current)
end
end
-
if check then
local a = getattr(current,attribute) or unsetvalue
if a ~= attrib then
@@ -890,14 +597,11 @@ local function stacker(attribute,head,default) -- no triggering, no inheritance,
end
local n = nsstep(a)
if n then
- head = insert_node_before(head,current,n) -- a
+ head = insertnodebefore(head,current,n) -- a
end
attrib = a
if leader then
-- tricky as a leader has to be a list so we cannot inject before
- -- local list = stacker(attribute,leader,attrib)
- -- leader = false
-
local content = getlist(leader)
if content then
local list = stacker(attribute,leader,attrib)
@@ -914,15 +618,13 @@ local function stacker(attribute,head,default) -- no triggering, no inheritance,
previous = current
end
-
if stacked then
local n = nsend()
while n do
- head = insert_node_after(head,previous,n)
+ head = insertnodeafter(head,previous,n)
n = nsend()
end
end
-
return head
end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-fin.mkxl b/Master/texmf-dist/tex/context/base/mkxl/node-fin.mkxl
index 6840c85ab53..aef7eea581e 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/node-fin.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-fin.mkxl
@@ -15,64 +15,69 @@
\unprotect
-\registerctxluafile{node-shp}{autosuffix,optimize}
-\registerctxluafile{node-fin}{autosuffix,optimize}
+\registerctxluafile{node-shp}{autosuffix}
+\registerctxluafile{node-fin}{autosuffix}
\permanent\protected\def\finalizeobjectbox #1{\clf_finalizebox#1\relax}
\permanent\protected\def\finalizeshipoutbox#1{\clf_finalizebox#1\relax}
-% Experimental (for Aditya), not in mkxl, if we need it, it has to be more
-% clever.
-
-% \permanent\protected\def\cleanupbox#1{\clf_cleanupbox#1\relax}
-
-% Tricky stuff: this might become obsolete. It is about time to check this out
-% now (after more than a decade)! The few times that we need this we can better
-% copy some of the sensitive attributes (mostly color).
-
-\definesystemattribute[trigger][public]
-
-\newcount\c_syst_attr_trigger
-
-\permanent\edef\startinheritattributes{\c_attr_trigger\plusone}
-\permanent\edef\stopinheritattributes {\c_attr_trigger\attributeunsetvalue}
-
-\permanent\def\syst_attr_trigger_copy_yes{\afterassignment\syst_attr_trigger_copy_indeed\c_syst_attr_trigger}
-\permanent\def\syst_attr_trigger_dump_yes{\afterassignment\syst_attr_trigger_dump_indeed\c_syst_attr_trigger}
-
-\def\syst_attr_trigger_copy_indeed
- {\ifvbox\c_syst_attr_trigger
- \vpack attr \triggerattribute \plusone {\unvcopy\c_syst_attr_trigger}%
- \else
- \hpack attr \triggerattribute \plusone {\unhcopy\c_syst_attr_trigger}%
- \fi}
-
-\def\syst_attr_trigger_dump_indeed
- {\ifvbox\c_syst_attr_trigger
- \vpack attr \triggerattribute \plusone {\unvbox\c_syst_attr_trigger}%
- \else
- \hpack attr \triggerattribute \plusone {\unhbox\c_syst_attr_trigger}%
- \fi}
-
-\permanent\protected\def\enableattributeinheritance
- {\clf_enablestatetriggering
- \enforced\let\attributedcopy\syst_attr_trigger_copy_yes
- \enforced\let\attributedbox \syst_attr_trigger_dump_yes}
-
-\permanent\protected\def\disableattributeinheritance
- {\clf_disablestatetriggering
- \enforced\let\attributedcopy\copy
- \enforced\let\attributedbox \box}
-
-\disableattributeinheritance
-
-\installtexdirective
- {attributes.inheritance}
- {\enableattributeinheritance}
- {\disableattributeinheritance}
-
-% \appendtoks
-% \enableattributeinheritance % might become default
-% \to\everyjob
+% % Tricky stuff: this might become obsolete. It is about time to check this out
+% % now (after more than a decade)! The few times that we need this we can better
+% % copy some of the sensitive attributes (mostly color).
+%
+% \definesystemattribute[trigger][public]
+%
+% \newinteger\c_syst_attr_trigger
+%
+% \permanent\edef\startinheritattributes{\c_attr_trigger\plusone}
+% \permanent\edef\stopinheritattributes {\c_attr_trigger\attributeunsetvalue}
+%
+% \permanent\def\syst_attr_trigger_copy_yes{\afterassignment\syst_attr_trigger_copy_indeed\c_syst_attr_trigger}
+% \permanent\def\syst_attr_trigger_dump_yes{\afterassignment\syst_attr_trigger_dump_indeed\c_syst_attr_trigger}
+%
+% \def\syst_attr_trigger_copy_indeed
+% {\ifvbox\c_syst_attr_trigger
+% \vpack attr \triggerattribute \plusone {\unvcopy\c_syst_attr_trigger}%
+% \else
+% \hpack attr \triggerattribute \plusone {\unhcopy\c_syst_attr_trigger}%
+% \fi}
+%
+% \def\syst_attr_trigger_dump_indeed
+% {\ifvbox\c_syst_attr_trigger
+% \vpack attr \triggerattribute \plusone {\unvbox\c_syst_attr_trigger}%
+% \else
+% \hpack attr \triggerattribute \plusone {\unhbox\c_syst_attr_trigger}%
+% \fi}
+%
+% \permanent\protected\def\enableattributeinheritance
+% {\clf_enablestatetriggering
+% \enforced\let\attributedcopy\syst_attr_trigger_copy_yes
+% \enforced\let\attributedbox \syst_attr_trigger_dump_yes}
+%
+% \permanent\protected\def\disableattributeinheritance
+% {\clf_disablestatetriggering
+% \enforced\let\attributedcopy\copy
+% \enforced\let\attributedbox \box}
+%
+% \disableattributeinheritance
+%
+% \installtexdirective
+% {attributes.inheritance}
+% {\enableattributeinheritance}
+% {\disableattributeinheritance}
+%
+% % \appendtoks
+% % \enableattributeinheritance % might become default
+% % \to\everyjob
+
+% This is just a compatibility hack:
+
+\newinteger\c_syst_attr_trigger
+
+\permanent\protected\def\attributedcopy{\afterassignment\syst_attr_copy\c_syst_attr_trigger}
+\permanent\protected\def\attributedbox {\afterassignment\syst_attr_box \c_syst_attr_trigger}
+
+\def\syst_attr_copy{\recolorbox\c_syst_attr_trigger\copy\c_syst_attr_trigger}
+\def\syst_attr_box {\recolorbox\c_syst_attr_trigger\box \c_syst_attr_trigger}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-fnt.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-fnt.lmt
index c96bdde3d1e..c5f9537413e 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/node-fnt.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-fnt.lmt
@@ -21,7 +21,7 @@ local trace_variants = false trackers.register("nodes.variants", function(
local force_discrun = true directives.register("nodes.discrun", function(v) force_discrun = v end)
local force_boundaryrun = true directives.register("nodes.boundaryrun", function(v) force_boundaryrun = v end)
-local force_basepass = true directives.register("nodes.basepass", function(v) force_basepass = v end)
+----- force_basepass = true directives.register("nodes.basepass", function(v) force_basepass = v end)
local keep_redundant = false directives.register("nodes.keepredundant",function(v) keep_redundant = v end)
local report_fonts = logs.reporter("fonts","processing")
@@ -64,15 +64,17 @@ local nextboundary = nuts.traversers.boundary
local nextdisc = nuts.traversers.disc
local nextchar = nuts.traversers.char
-local flush_node = nuts.flush
+local flushnode = nuts.flush
+local removefromlist = nuts.removefromlist
local disc_code = nodecodes.disc
local boundary_code = nodecodes.boundary
local wordboundary_code = boundarycodes.word
-local protect_glyphs = nuts.protect_glyphs
-local unprotect_glyphs = nuts.unprotect_glyphs
+local protectglyphs = nuts.protectglyphs
+local unprotectglyphs = nuts.unprotectglyphs
+local protectglyphsnone = nuts.protectglyphsnone
local setmetatableindex = table.setmetatableindex
@@ -136,146 +138,540 @@ fonts.hashes.processes = fontprocesses
local ligaturing = nuts.ligaturing
local kerning = nuts.kerning
-local function start_trace(head)
- run = run + 1
- report_fonts()
- report_fonts("checking node list, run %s",run)
- report_fonts()
- local n = head
- while n do
- local char, id = isglyph(n)
- if char then
- local font = id
- local dynamic = getglyphdata(n) or 0
- report_fonts("font %03i, dynamic %03i, glyph %C",font,dynamic,char)
- elseif id == disc_code then
- report_fonts("[disc] %s",nodes.listtoutf(n,true,false,n))
- elseif id == boundary_code then
- report_fonts("[boundary] %i:%i",getsubtype(n),getdata(n))
- else
- report_fonts("[%s]",nodecodes[id])
- end
- n = getnext(n)
- end
-end
+-- local function start_trace(head)
+-- run = run + 1
+-- report_fonts()
+-- report_fonts("checking node list, run %s",run)
+-- report_fonts()
+-- local n = head
+-- while n do
+-- local char, id = isglyph(n)
+-- if char then
+-- local font = id
+-- local dynamic = getglyphdata(n) or 0
+-- report_fonts("font %03i, dynamic %03i, glyph %C",font,dynamic,char)
+-- elseif id == disc_code then
+-- report_fonts("[disc] %s",nodes.listtoutf(n,true,false,n))
+-- elseif id == boundary_code then
+-- report_fonts("[boundary] %i:%i",getsubtype(n),getdata(n))
+-- else
+-- report_fonts("[%s]",nodecodes[id])
+-- end
+-- n = getnext(n)
+-- end
+-- end
+
+-- local function stop_trace(u,usedfonts,d,dynamicfonts,b,basefonts,r,redundant)
+-- report_fonts()
+-- report_fonts("statics : %s",u > 0 and concat(keys(usedfonts)," ") or "none")
+-- report_fonts("dynamics: %s",d > 0 and concat(keys(dynamicfonts)," ") or "none")
+-- report_fonts("built-in: %s",b > 0 and b or "none")
+-- report_fonts("removed : %s",r > 0 and r or "none")
+-- report_fonts()
+-- end
+
+-- This is the original handler and we keep it around as reference. It served us
+-- well for quite a while.
+
+-- do
+--
+-- local usedfonts
+-- local dynamicfonts
+-- local basefonts -- could be reused
+-- local basefont
+-- local prevfont
+-- local prevdynamic
+-- local variants
+-- local redundant -- could be reused
+-- local firstnone
+-- local lastfont
+-- local lastproc
+-- local lastnone
+--
+-- local d, u, b, r
+--
+-- local function protectnone()
+-- protectglyphs(firstnone,lastnone)
+-- firstnone = nil
+-- end
+--
+-- local function setnone(n)
+-- if firstnone then
+-- protectnone()
+-- end
+-- if basefont then
+-- basefont[2] = getprev(n)
+-- basefont = false
+-- end
+-- if not firstnone then
+-- firstnone = n
+-- end
+-- lastnone = n
+-- end
+--
+-- local function setbase(n)
+-- if firstnone then
+-- protectnone()
+-- end
+-- if force_basepass then
+-- if basefont then
+-- basefont[2] = getprev(n)
+-- end
+-- b = b + 1
+-- basefont = { n, false }
+-- basefonts[b] = basefont
+-- end
+-- end
+--
+-- local function setnode(n,font,dynamic) -- we could use prevfont and prevdynamic when we set then first
+-- if firstnone then
+-- protectnone()
+-- end
+-- if basefont then
+-- basefont[2] = getprev(n)
+-- basefont = false
+-- end
+-- if dynamic > 0 then
+-- local used = dynamicfonts[font]
+-- if not used then
+-- used = { }
+-- dynamicfonts[font] = used
+-- end
+-- if not used[dynamic] then
+-- local fd = setfontdynamics[font]
+-- if fd then
+-- used[dynamic] = fd[dynamic]
+-- d = d + 1
+-- end
+-- end
+-- else
+-- local used = usedfonts[font]
+-- if not used then
+-- lastfont = font
+-- lastproc = fontprocesses[font]
+-- if lastproc then
+-- usedfonts[font] = lastproc
+-- u = u + 1
+-- end
+-- end
+-- end
+-- end
+--
+-- function handlers.characters(head,groupcode,direction)
+-- -- either next or not, but definitely no already processed list
+-- starttiming(nodes)
+--
+-- usedfonts = { }
+-- dynamicfonts = { }
+-- basefonts = { }
+-- basefont = nil
+-- prevfont = nil
+-- prevdynamic = 0
+-- variants = nil
+-- redundant = nil
+-- firstnone = nil
+-- lastfont = nil
+-- lastproc = nil
+-- lastnone = nil
+--
+-- local fontmode = nil -- base none or other
+--
+-- d, u, b, r = 0, 0, 0, 0
+--
+-- if trace_fontrun then
+-- start_trace(head)
+-- end
+--
+-- -- There is no gain in checking for a single glyph and then having a fast path. On the
+-- -- metafun manual (with some 2500 single char lists) the difference is just noise.
+--
+-- for n, char, font, dynamic in nextchar, head do
+--
+-- if font ~= prevfont then
+-- prevfont = font
+-- fontmode = fontmodes[font]
+-- if fontmode == "none" then
+-- prevdynamic = 0
+-- variants = false
+-- setnone(n)
+-- elseif fontmode == "base" then
+-- prevdynamic = 0
+-- variants = false
+-- setbase(n)
+-- else
+-- -- local dynamic = getglyphdata(n) or 0 -- zero dynamic is reserved for fonts in context
+-- prevdynamic = dynamic
+-- variants = fontvariants[font]
+-- setnode(n,font,dynamic)
+-- end
+-- elseif fontmode == "node" then
+-- local dynamic = getglyphdata(n) or 0 -- zero dynamic is reserved for fonts in context
+-- if dynamic ~= prevdynamic then
+-- prevdynamic = dynamic
+-- variants = fontvariants[font]
+-- setnode(n,font,dynamic)
+-- end
+-- elseif firstnone then
+-- lastnone = n
+-- end
+--
+-- if variants then
+-- if (char >= 0xFE00 and char <= 0xFE0F) or (char >= 0xE0100 and char <= 0xE01EF) then
+-- -- if variants and char >= 0xFE00 then
+-- -- if char < 0xFE0F or (char >= 0xE0100 and char <= 0xE01EF) then
+-- local hash = variants[char]
+-- if hash then
+-- local p = getprev(n)
+-- if p then
+-- local char = ischar(p) -- checked
+-- local variant = hash[char]
+-- if variant then
+-- if trace_variants then
+-- report_fonts("replacing %C by %C",char,variant)
+-- end
+-- setchar(p,variant)
+-- if redundant then
+-- r = r + 1
+-- redundant[r] = n
+-- else
+-- r = 1
+-- redundant = { n }
+-- end
+-- end
+-- end
+-- elseif keep_redundant then
+-- -- go on, can be used for tracing
+-- elseif redundant then
+-- r = r + 1
+-- redundant[r] = n
+-- else
+-- r = 1
+-- redundant = { n }
+-- end
+-- end
+-- end
+--
+-- end
+--
+-- if firstnone then
+-- protectnone()
+-- end
+--
+-- if force_boundaryrun then
+--
+-- -- we can inject wordboundaries and then let the hyphenator do its work
+-- -- but we need to get rid of those nodes in order to build ligatures
+-- -- and kern (a rather context thing)
+--
+-- for b, subtype in nextboundary, head do
+-- if subtype == wordboundary_code then
+-- if redundant then
+-- r = r + 1
+-- redundant[r] = b
+-- else
+-- r = 1
+-- redundant = { b }
+-- end
+-- end
+-- end
+--
+-- end
+--
+-- if redundant then
+-- for i=1,r do
+-- local r = redundant[i]
+-- local p, n = getboth(r)
+-- if r == head then
+-- head = n
+-- setprev(n)
+-- else
+-- setlink(p,n)
+-- end
+-- if b > 0 then
+-- for i=1,b do
+-- local bi = basefonts[i]
+-- local b1 = bi[1]
+-- local b2 = bi[2]
+-- if b1 == b2 then
+-- if b1 == r then
+-- bi[1] = false
+-- bi[2] = false
+-- end
+-- elseif b1 == r then
+-- bi[1] = n
+-- elseif b2 == r then
+-- bi[2] = p
+-- end
+-- end
+-- end
+-- flushnode(r)
+-- end
+-- end
+--
+-- if force_discrun then
+-- -- basefont is not supported in disc only runs ... it would mean a lot of
+-- -- ranges .. we could try to run basemode as a separate processor run but not
+-- -- for now (we can consider it when the new node code is tested
+-- for disc in nextdisc, head do
+-- -- doing only replace is good enough because pre and post are normally used
+-- -- for hyphens and these come from fonts that part of the hyphenated word
+-- local r = getreplace(disc)
+-- if r then
+-- local prevfont = nil
+-- local prevdynamic = nil
+-- local none = false
+-- firstnone = nil
+-- basefont = nil
+-- for n, char, font, dynamic in nextchar, r do
+-- -- local dynamic = getglyphdata(n) or 0 -- zero dynamic is reserved for fonts in context
+-- if font ~= prevfont or dynamic ~= prevdynamic then
+-- prevfont = font
+-- prevdynamic = dynamic
+-- local fontmode = fontmodes[font]
+-- if fontmode == "none" then
+-- setnone(n)
+-- elseif fontmode == "base" then
+-- -- so the replace gets an extra treatment ... so be it
+-- setbase(n)
+-- else
+-- setnode(n,font,dynamic)
+-- end
+-- elseif firstnone then
+-- -- lastnone = n
+-- lastnone = nil
+-- end
+-- -- we assume one font for now (and if there are more and we get into issues then
+-- -- we can always remove the break)
+-- break
+-- end
+-- if firstnone then
+-- protectnone()
+-- end
+-- end
+-- end
+--
+-- end
+--
+-- if trace_fontrun then
+-- stop_trace(u,usedfonts,d,dynamicfonts,b,basefonts,r,redundant)
+-- end
+--
+-- -- in context we always have at least 2 processors
+-- if u == 0 then
+-- -- skip
+-- elseif u == 1 then
+-- for i=1,#lastproc do
+-- head = lastproc[i](head,lastfont,0,direction)
+-- end
+-- else
+-- for font, processors in next, usedfonts do -- unordered
+-- for i=1,#processors do
+-- head = processors[i](head,font,0,direction,u) -- u triggers disc optimizer
+-- end
+-- end
+-- end
+--
+-- if d == 0 then
+-- -- skip
+-- elseif d == 1 then
+-- local font, dynamics = next(dynamicfonts)
+-- for dynamic, processors in next, dynamics do -- unordered, dynamic can switch in between
+-- for i=1,#processors do
+-- head = processors[i](head,font,dynamic,direction)
+-- end
+-- end
+-- else
+-- for font, dynamics in next, dynamicfonts do
+-- for dynamic, processors in next, dynamics do -- unordered, dynamic can switch in between
+-- for i=1,#processors do
+-- head = processors[i](head,font,dynamic,direction,d) -- d triggers disc optimizer
+-- end
+-- end
+-- end
+-- end
+-- if b == 0 then
+-- -- skip
+-- elseif b == 1 then
+-- -- only one font
+-- local range = basefonts[1]
+-- local start = range[1]
+-- local stop = range[2]
+-- if (start or stop) and (start ~= stop) then
+-- local front = head == start
+-- if stop then
+-- start = ligaturing(start,stop)
+-- start = kerning(start,stop)
+-- elseif start then -- safeguard
+-- start = ligaturing(start)
+-- start = kerning(start)
+-- end
+-- if front and head ~= start then
+-- head = start
+-- end
+-- end
+-- else
+-- -- multiple fonts
+-- for i=1,b do
+-- local range = basefonts[i]
+-- local start = range[1]
+-- local stop = range[2]
+-- if start then -- and start ~= stop but that seldom happens
+-- local front = head == start
+-- local prev = getprev(start)
+-- local next = getnext(stop)
+-- if stop then
+-- start, stop = ligaturing(start,stop)
+-- start, stop = kerning(start,stop)
+-- else
+-- start = ligaturing(start)
+-- start = kerning(start)
+-- end
+-- -- is done automatically
+-- if prev then
+-- setlink(prev,start)
+-- end
+-- if next then
+-- setlink(stop,next)
+-- end
+-- -- till here
+-- if front and head ~= start then
+-- head = start
+-- end
+-- end
+-- end
+-- end
+--
+-- stoptiming(nodes)
+--
+-- if trace_characters then
+-- nodes.report(head)
+-- end
+--
+-- return head
+-- end
+--
+-- end
-local function stop_trace(u,usedfonts,d,dynamicfonts,b,basefonts,r,redundant)
- report_fonts()
- report_fonts("statics : %s",u > 0 and concat(keys(usedfonts)," ") or "none")
- report_fonts("dynamics: %s",d > 0 and concat(keys(dynamicfonts)," ") or "none")
- report_fonts("built-in: %s",b > 0 and b or "none")
- report_fonts("removed : %s",r > 0 and r or "none")
- report_fonts()
-end
+
+-- This variant uses less code but relies on the engine checking the textcontrol
+-- flags:
+--
+-- baseligatures : 0x02
+-- basekerns : 0x04
+-- noneprotected : 0x08
+--
+-- This permits one 'base' pass instead of multiple over ranges which is kind of
+-- tricky because we then can have clashes when we process replace fields
+-- independently. We can also protect 'none' in one go. It is actually not that
+-- much faster (and in some cases it might even be slower). We can make the code
+-- a bit leaner (no setbase and setnone).
do
local usedfonts
local dynamicfonts
- local basefonts -- could be reused
- local basefont
local prevfont
local prevdynamic
local variants
local redundant -- could be reused
- local firstnone
local lastfont
local lastproc
- local lastnone
-
- local d, u, b, r
-
- local function protectnone()
- protect_glyphs(firstnone,lastnone)
- firstnone = nil
- end
-
- local function setnone(n)
- if firstnone then
- protectnone()
- end
- if basefont then
- basefont[2] = getprev(n)
- basefont = false
- end
- if not firstnone then
- firstnone = n
- end
- lastnone = n
- end
-
- local function setbase(n)
- if firstnone then
- protectnone()
- end
- if force_basepass then
- if basefont then
- basefont[2] = getprev(n)
- end
- b = b + 1
- basefont = { n, false }
- basefonts[b] = basefont
- end
- end
-
- local function setnode(n,font,dynamic) -- we could use prevfont and prevdynamic when we set then first
- if firstnone then
- protectnone()
- end
- if basefont then
- basefont[2] = getprev(n)
- basefont = false
- end
- if dynamic > 0 then
- local used = dynamicfonts[font]
+ -- local basedone
+ -- local nonedone
+
+ -- local d, u, b, r
+ local d, u, r
+
+ -- local function setnone()
+ -- nonedone = true
+ -- end
+
+ -- local function setbase()
+ -- if force_basepass then
+ -- basedone = true
+ -- end
+ -- end
+
+-- local function setnode(font,dynamic) -- we could use prevfont and prevdynamic when we set them first
+-- if dynamic > 0 then
+-- local used = dynamicfonts[font]
+-- if not used then
+-- used = { }
+-- dynamicfonts[font] = used
+-- end
+-- if not used[dynamic] then
+-- local fd = setfontdynamics[font]
+-- if fd then
+-- used[dynamic] = fd[dynamic]
+-- d = d + 1
+-- end
+-- end
+-- else
+-- local used = usedfonts[font]
+-- if not used then
+-- lastfont = font
+-- lastproc = fontprocesses[font]
+-- if lastproc then
+-- usedfonts[font] = lastproc
+-- u = u + 1
+-- end
+-- end
+-- end
+-- end
+
+ local function setnode() -- we could use prevfont and prevdynamic when we set them first
+ if prevdynamic > 0 then
+ local used = dynamicfonts[prevfont]
if not used then
used = { }
- dynamicfonts[font] = used
+ dynamicfonts[prevfont] = used
end
- if not used[dynamic] then
- local fd = setfontdynamics[font]
+ if not used[prevdynamic] then
+ local fd = setfontdynamics[prevfont]
if fd then
- used[dynamic] = fd[dynamic]
+ used[prevdynamic] = fd[prevdynamic]
d = d + 1
end
end
else
- local used = usedfonts[font]
+ local used = usedfonts[prevfont]
if not used then
- lastfont = font
- lastproc = fontprocesses[font]
+ lastfont = prevfont
+ lastproc = fontprocesses[prevfont]
if lastproc then
- usedfonts[font] = lastproc
+ usedfonts[prevfont] = lastproc
u = u + 1
end
end
end
end
- function handlers.characters(head,groupcode,size,packtype,direction)
+ function handlers.characters(head,groupcode,direction)
-- either next or not, but definitely no already processed list
starttiming(nodes)
usedfonts = { }
dynamicfonts = { }
- basefonts = { }
- basefont = nil
- prevfont = nil
- prevdynamic = 0
- variants = nil
- redundant = nil
- firstnone = nil
+ prevfont = nil -- local
+ prevdynamic = 0 -- local
+ variants = nil -- local
+ redundant = nil -- local
lastfont = nil
lastproc = nil
- lastnone = nil
+ -- nonedone = nil
+ -- basedone = nil
+
+ local nonedone = nil
+ local basedone = nil
local fontmode = nil -- base none or other
- d, u, b, r = 0, 0, 0, 0
+ -- d, u, b, r = 0, 0, 0, 0
+ d, u, r = 0, 0, 0
- if trace_fontrun then
- start_trace(head)
- end
+ -- if trace_fontrun then
+ -- start_trace(head)
+ -- end
-- There is no gain in checking for a single glyph and then having a fast path. On the
-- metafun manual (with some 2500 single char lists) the difference is just noise.
@@ -288,34 +684,38 @@ do
if fontmode == "none" then
prevdynamic = 0
variants = false
- setnone(n)
+ -- setnone()
+ nonedone = true
elseif fontmode == "base" then
prevdynamic = 0
variants = false
- setbase(n)
+ -- setbase()
+ basedone = true
else
- -- local dynamic = getglyphdata(n) or 0 -- zero dynamic is reserved for fonts in context
prevdynamic = dynamic
variants = fontvariants[font]
- setnode(n,font,dynamic)
+ -- setnode(font,dynamic)
+ setnode()
end
elseif fontmode == "node" then
- local dynamic = getglyphdata(n) or 0 -- zero dynamic is reserved for fonts in context
if dynamic ~= prevdynamic then
prevdynamic = dynamic
variants = fontvariants[font]
- setnode(n,font,dynamic)
+ -- setnode(font,dynamic)
+ setnode()
end
- elseif firstnone then
- lastnone = n
end
+ -- we could just mark them and then have a separate pass .. happens seldom
+
if variants then
+ -- We need a proper test for this!
if (char >= 0xFE00 and char <= 0xFE0F) or (char >= 0xE0100 and char <= 0xE01EF) then
- -- if variants and char >= 0xFE00 then
- -- if char < 0xFE0F or (char >= 0xE0100 and char <= 0xE01EF) then
local hash = variants[char]
if hash then
+ -- local p, _, char = isprevchar(n)
+ -- if char then
+ -- local variant = hash[char]
local p = getprev(n)
if p then
local char = ischar(p) -- checked
@@ -348,27 +748,24 @@ do
end
- if firstnone then
- protectnone()
- end
-
if force_boundaryrun then
-
-- we can inject wordboundaries and then let the hyphenator do its work
-- but we need to get rid of those nodes in order to build ligatures
-- and kern (a rather context thing)
- for b, subtype in nextboundary, head do
- if subtype == wordboundary_code then
- if redundant then
- r = r + 1
- redundant[r] = b
- else
- r = 1
- redundant = { b }
- end
- end
- end
+ -- for b, subtype in nextboundary, head do
+ -- if subtype == wordboundary_code then
+ -- if redundant then
+ -- r = r + 1
+ -- redundant[r] = b
+ -- else
+ -- r = 1
+ -- redundant = { b }
+ -- end
+ -- end
+ -- end
+
+ head = removefromlist(head,boundary_code,wordboundary_code)
end
@@ -382,73 +779,51 @@ do
else
setlink(p,n)
end
- if b > 0 then
- for i=1,b do
- local bi = basefonts[i]
- local b1 = bi[1]
- local b2 = bi[2]
- if b1 == b2 then
- if b1 == r then
- bi[1] = false
- bi[2] = false
- end
- elseif b1 == r then
- bi[1] = n
- elseif b2 == r then
- bi[2] = p
- end
- end
- end
- flush_node(r)
+ flushnode(r)
end
end
+ -- todo: make this more clever
+
if force_discrun then
- -- basefont is not supported in disc only runs ... it would mean a lot of
- -- ranges .. we could try to run basemode as a separate processor run but not
- -- for now (we can consider it when the new node code is tested
for disc in nextdisc, head do
-- doing only replace is good enough because pre and post are normally used
-- for hyphens and these come from fonts that part of the hyphenated word
local r = getreplace(disc)
if r then
- local prevfont = nil
- local prevdynamic = nil
- local none = false
- firstnone = nil
- basefont = nil
+ prevfont = nil
+ prevdynamic = nil
+ -- fontmode = nil
for n, char, font, dynamic in nextchar, r do
- -- local dynamic = getglyphdata(n) or 0 -- zero dynamic is reserved for fonts in context
if font ~= prevfont or dynamic ~= prevdynamic then
prevfont = font
prevdynamic = dynamic
- local fontmode = fontmodes[font]
+ fontmode = fontmodes[font]
if fontmode == "none" then
- setnone(n)
+ -- setnone()
+ nonedone = true
elseif fontmode == "base" then
- -- so the replace gets an extra treatment ... so be it
- setbase(n)
+ -- setbase()
+ basedone = true
else
- setnode(n,font,dynamic)
+ setnode() -- (font,dynamic)
end
- elseif firstnone then
- -- lastnone = n
- lastnone = nil
end
-- we assume one font for now (and if there are more and we get into issues then
-- we can always remove the break)
break
end
- if firstnone then
- protectnone()
- end
end
end
end
- if trace_fontrun then
- stop_trace(u,usedfonts,d,dynamicfonts,b,basefonts,r,redundant)
+ -- if trace_fontrun then
+ -- stop_trace(u,usedfonts,d,dynamicfonts,b,basefonts,r,redundant)
+ -- end
+
+ if nonedone then
+ protectglyphsnone(head)
end
-- in context we always have at least 2 processors
@@ -465,6 +840,7 @@ do
end
end
end
+
if d == 0 then
-- skip
elseif d == 1 then
@@ -483,55 +859,13 @@ do
end
end
end
- if b == 0 then
- -- skip
- elseif b == 1 then
- -- only one font
- local range = basefonts[1]
- local start = range[1]
- local stop = range[2]
- if (start or stop) and (start ~= stop) then
- local front = head == start
- if stop then
- start = ligaturing(start,stop)
- start = kerning(start,stop)
- elseif start then -- safeguard
- start = ligaturing(start)
- start = kerning(start)
- end
- if front and head ~= start then
- head = start
- end
- end
- else
- -- multiple fonts
- for i=1,b do
- local range = basefonts[i]
- local start = range[1]
- local stop = range[2]
- if start then -- and start ~= stop but that seldom happens
- local front = head == start
- local prev = getprev(start)
- local next = getnext(stop)
- if stop then
- start, stop = ligaturing(start,stop)
- start, stop = kerning(start,stop)
- else
- start = ligaturing(start)
- start = kerning(start)
- end
- -- is done automatically
- if prev then
- setlink(prev,start)
- end
- if next then
- setlink(stop,next)
- end
- -- till here
- if front and head ~= start then
- head = start
- end
- end
+
+ if basedone then
+ local start = head
+ start = ligaturing(start)
+ start = kerning(start)
+ if head ~= start then
+ head = start
end
end
@@ -546,5 +880,5 @@ do
end
-handlers.protectglyphs = protect_glyphs
-handlers.unprotectglyphs = unprotect_glyphs
+handlers.protectglyphs = protectglyphs
+handlers.unprotectglyphs = unprotectglyphs
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-gcm.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-gcm.lmt
index 7f2a7bded8a..03a4acda8d8 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/node-gcm.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-gcm.lmt
@@ -14,8 +14,8 @@ local nuts = nodes.nuts
local getnext = nuts.getnext
local getsubtype = nuts.getsubtype
-local copy_node = nuts.copy
-local flush_list = nuts.flush_list
+local copynode = nuts.copy
+local flushlist = nuts.flushlist
local count = nuts.count
local isglyph = nuts.isglyph
local getprop = nuts.getprop
@@ -25,7 +25,7 @@ local fastcopy = table.fastcopy
local report_error = logs.reporter("node-aux:error")
-local function set_components(base,list)
+local function setcomponents(base,list)
local t = { }
local n = 0
local l = list
@@ -39,35 +39,35 @@ local function set_components(base,list)
end
-- not yet as we need them
--
- -- flush_list(l)
+ -- flushlist(l)
--
setprop(base,"components",n > 0 and t or false)
end
-local function get_components(base)
+local function getcomponents(base)
return getprop(base,"components")
end
-local function copy_no_components(base)
- local copy = copy_node(base)
+local function copynocomponents(base)
+ local copy = copynode(base)
setprop(copy,"components",false) -- no metatable lookup!
return copy
end
-local function copy_only_glyphs(base)
+local function copyonlyglyphs(base)
local t = getprop(base,"components") -- also metatable
if t then
return fastcopy(t)
end
end
-local function do_count(t,marks)
+local function docount(t,marks)
local n = 0
if t then
for i=1,#t do
local c = t[i]
if type(c) == "table" then
- n = n + do_count(t,marks)
+ n = n + docount(t,marks)
elseif not marks[c] then
n = n + 1
else
@@ -82,19 +82,19 @@ end
local done = false
-local function count_components(base,marks)
+local function countcomponents(base,marks)
local char = isglyph(base)
if char then
if getsubtype(base) == ligature_code then
if not done then
logs.report("fonts","!")
- logs.report("fonts","! check count_components with mkiv !")
+ logs.report("fonts","! check countcomponents with mkiv !")
logs.report("fonts","!")
done = true
end
local t = getprop(base,"components")
if t then
- return do_count(t,marks)
+ return docount(t,marks)
end
elseif not marks[char] then
return 1
@@ -103,12 +103,14 @@ local function count_components(base,marks)
return 0
end
-nuts.set_components = set_components
-nuts.get_components = get_components
-nuts.copy_only_glyphs = copy_only_glyphs
-nuts.copy_no_components = copy_no_components
-nuts.count_components = count_components
-nuts.flush_components = flush_list
+nuts.components = {
+ set = setcomponents,
+ get = getcomponents,
+ copyonlyglyphs = copyonlyglyphs,
+ copynocomponents = copynocomponents,
+ count = countcomponents,
+ flush = flushlist,
+}
nuts.setcomponents = function() report_error("unsupported: %a","setcomponents") end
nuts.getcomponents = function() report_error("unsupported: %a","getcomponents") end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-ini.lmt
index 4ba4b4000a1..f1b9bb45299 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/node-ini.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-ini.lmt
@@ -20,42 +20,40 @@ local sortedhash, sortedkeys, swapped = table.sortedhash, table.sortedkeys, tabl
few helper functions. These functions are rather optimized.</p>
--ldx]]--
-nodes = nodes or { }
-local nodes = nodes
-nodes.handlers = nodes.handlers or { }
-
-local mark = utilities.storage.mark
-local allocate = utilities.storage.allocate
-local formatcolumns = utilities.formatters.formatcolumns
-
-local getsubtypes = node.subtypes
-local getvalues = node.values
-
-tex.magicconstants = { -- we use tex.constants for something else
- running = -1073741824, -- null_flag
- maxdimen = 1073741823, -- max_dimen
- trueinch = 4736286,
-}
-
-local listcodes = mark(getsubtypes("list"))
-local rulecodes = mark(getsubtypes("rule"))
-local dircodes = mark(getsubtypes("dir"))
-local glyphcodes = mark(getsubtypes("glyph"))
-local disccodes = mark(getsubtypes("disc"))
-local gluecodes = mark(getsubtypes("glue"))
-local boundarycodes = mark(getsubtypes("boundary"))
-local penaltycodes = mark(getsubtypes("penalty"))
-local kerncodes = mark(getsubtypes("kern"))
-local mathcodes = mark(getsubtypes("math"))
-local noadcodes = mark(getsubtypes("noad"))
-local radicalcodes = mark(getsubtypes("radical"))
-local accentcodes = mark(getsubtypes("accent"))
-local fencecodes = mark(getsubtypes("fence"))
------ fractioncodes = mark(getsubtypes("fraction"))
-local parcodes = mark(getsubtypes("par"))
-
-local fillvalues = mark(getvalues("fill"))
-local dirvalues = mark(getvalues("dir"))
+nodes = nodes or { }
+local nodes = nodes
+nodes.handlers = nodes.handlers or { }
+
+local mark = utilities.storage.mark
+local allocate = utilities.storage.allocate
+local formatcolumns = utilities.formatters.formatcolumns
+
+local getsubtypes = node.subtypes
+local getvalues = node.values
+
+local listcodes = mark(getsubtypes("list"))
+local rulecodes = mark(getsubtypes("rule"))
+local dircodes = mark(getsubtypes("dir"))
+local markcodes = mark(getsubtypes("mark"))
+local glyphcodes = mark(getsubtypes("glyph"))
+local disccodes = mark(getsubtypes("disc"))
+local gluecodes = mark(getsubtypes("glue"))
+local boundarycodes = mark(getsubtypes("boundary"))
+local penaltycodes = mark(getsubtypes("penalty"))
+local kerncodes = mark(getsubtypes("kern"))
+local mathcodes = mark(getsubtypes("math"))
+local noadcodes = mark(getsubtypes("noad"))
+local radicalcodes = mark(getsubtypes("radical"))
+local accentcodes = mark(getsubtypes("accent"))
+local fencecodes = mark(getsubtypes("fence"))
+local choicecodes = mark(getsubtypes("choice"))
+----- fractioncodes = mark(getsubtypes("fraction"))
+local parcodes = mark(getsubtypes("par"))
+local attributecodes = mark(getsubtypes("attribute"))
+
+local fillvalues = mark(getvalues("fill"))
+local dirvalues = mark(getvalues("dir"))
+local mathvalues = mark(getvalues("math"))
local function simplified(t)
local r = { }
@@ -79,53 +77,84 @@ local noadoptions = allocate {
local nodecodes = simplified(node.types())
-gluecodes = allocate(swapped(gluecodes,gluecodes))
-dircodes = allocate(swapped(dircodes,dircodes))
-boundarycodes = allocate(swapped(boundarycodes,boundarycodes))
-noadcodes = allocate(swapped(noadcodes,noadcodes))
-radicalcodes = allocate(swapped(radicalcodes,radicalcodes))
-nodecodes = allocate(swapped(nodecodes,nodecodes))
-listcodes = allocate(swapped(listcodes,listcodes))
-glyphcodes = allocate(swapped(glyphcodes,glyphcodes))
-kerncodes = allocate(swapped(kerncodes,kerncodes))
-penaltycodes = allocate(swapped(penaltycodes,penaltycodes))
-mathcodes = allocate(swapped(mathcodes,mathcodes))
-disccodes = allocate(swapped(disccodes,disccodes))
-accentcodes = allocate(swapped(accentcodes,accentcodes))
-fencecodes = allocate(swapped(fencecodes,fencecodes))
-parcodes = allocate(swapped(parcodes,parcodes))
-rulecodes = allocate(swapped(rulecodes,rulecodes))
-noadoptions = allocate(swapped(noadoptions,noadoptions))
-
-dirvalues = allocate(swapped(dirvalues,dirvalues))
-fillvalues = allocate(swapped(fillvalues,fillvalues))
-
-nodes.gluecodes = gluecodes
-nodes.dircodes = dircodes
-nodes.boundarycodes = boundarycodes
-nodes.noadcodes = noadcodes
-nodes.listcodes = listcodes
-nodes.glyphcodes = glyphcodes
-nodes.kerncodes = kerncodes
-nodes.penaltycodes = penaltycodes
-nodes.mathcodes = mathcodes
-nodes.disccodes = disccodes
-nodes.accentcodes = accentcodes
-nodes.radicalcodes = radicalcodes
-nodes.fencecodes = fencecodes
-nodes.parcodes = parcodes
-nodes.rulecodes = rulecodes
+gluecodes = allocate(swapped(gluecodes,gluecodes))
+dircodes = allocate(swapped(dircodes,dircodes))
+markcodes = allocate(swapped(markcodes,markcodes))
+boundarycodes = allocate(swapped(boundarycodes,boundarycodes))
+noadcodes = allocate(swapped(noadcodes,noadcodes))
+radicalcodes = allocate(swapped(radicalcodes,radicalcodes))
+nodecodes = allocate(swapped(nodecodes,nodecodes))
+listcodes = allocate(swapped(listcodes,listcodes))
+glyphcodes = allocate(swapped(glyphcodes,glyphcodes))
+kerncodes = allocate(swapped(kerncodes,kerncodes))
+penaltycodes = allocate(swapped(penaltycodes,penaltycodes))
+mathcodes = allocate(swapped(mathcodes,mathcodes))
+disccodes = allocate(swapped(disccodes,disccodes))
+accentcodes = allocate(swapped(accentcodes,accentcodes))
+fencecodes = allocate(swapped(fencecodes,fencecodes))
+choicecodes = allocate(swapped(choicecodes,choicecodes))
+parcodes = allocate(swapped(parcodes,parcodes))
+attributecodes = allocate(swapped(attributecodes,attributecodes))
+rulecodes = allocate(swapped(rulecodes,rulecodes))
+noadoptions = allocate(swapped(noadoptions,noadoptions))
+
+dirvalues = allocate(swapped(dirvalues,dirvalues))
+fillvalues = allocate(swapped(fillvalues,fillvalues))
+mathvalues = allocate(swapped(mathvalues,mathvalues))
+
+nodes.gluecodes = gluecodes
+nodes.dircodes = dircodes
+nodes.markcodes = markcodes
+nodes.boundarycodes = boundarycodes
+nodes.noadcodes = noadcodes
+nodes.listcodes = listcodes
+nodes.glyphcodes = glyphcodes
+nodes.kerncodes = kerncodes
+nodes.penaltycodes = penaltycodes
+nodes.mathcodes = mathcodes
+nodes.disccodes = disccodes
+nodes.accentcodes = accentcodes
+nodes.radicalcodes = radicalcodes
+nodes.fencecodes = fencecodes
+nodes.choicecodes = choicecodes
+nodes.parcodes = parcodes
+nodes.attributecodes = attributecodes
+nodes.rulecodes = rulecodes
nodes.noadoptions = noadoptions
nodes.fillvalues = fillvalues
nodes.fillcodes = fillvalues -- for now
nodes.dirvalues = dirvalues
+nodes.mathvalues = mathvalues
nodes.nodecodes = nodecodes
+-- we will transition to more verbose subtypes (after other math is done)
+
+noadcodes.ord = noadcodes.ord or noadcodes.ordinary
+noadcodes.operator = noadcodes.op or noadcodes.operator
+noadcodes.bin = noadcodes.bin or noadcodes.binary
+noadcodes.rel = noadcodes.rel or noadcodes.relation
+noadcodes.punct = noadcodes.punct or noadcodes.punctuation
+noadcodes.rad = noadcodes.rad or noadcodes.radical
+noadcodes.frac = noadcodes.frac or noadcodes.fraction
+noadcodes.acc = noadcodes.acc or noadcodes.accent
+
+-- so for now:
+
+noadcodes.ordinary = noadcodes.ordinary or noadcodes.ord
+noadcodes.operator = noadcodes.operator or noadcodes.op
+noadcodes.binary = noadcodes.binary or noadcodes.bin
+noadcodes.relation = noadcodes.relation or noadcodes.rel
+noadcodes.punctuation = noadcodes.punctuation or noadcodes.punct
+noadcodes.radical = noadcodes.radical or noadcodes.rad
+noadcodes.fraction = noadcodes.fraction or noadcodes.frac
+noadcodes.accent = noadcodes.accent or noadcodes.acc
+
local subtypes = allocate {
glue = gluecodes,
dir = dircodes,
+ mark = markcodes,
boundary = boundarycodes,
noad = noadcodes,
glyph = glyphcodes,
@@ -136,7 +165,9 @@ local subtypes = allocate {
accent = accentcodes,
radical = radicalcodes,
fence = fencecodes,
+ choice = choicecodes,
par = parcodes,
+ attribute = attributecodes,
rule = rulecodes,
vlist = listcodes,
@@ -195,6 +226,27 @@ local texsetintegervalue = tex.setintegervalue
for i=0,nodecodes.glyph do
texsetintegervalue(nodecodes[i] .. "nodecode",i,"immutable")
end
+texsetintegervalue("tempnodecode",nodecodes.temp,"immutable") -- can happen in tables
+
for i=0,#gluecodes do
texsetintegervalue(gluecodes[i] .. "subtypecode",i,"immutable")
end
+
+nodes.specialskipcodes = {
+ [gluecodes.leftskip] = true,
+ [gluecodes.rightskip] = true,
+ [gluecodes.lefthangskip] = true,
+ [gluecodes.righthangskip] = true,
+ [gluecodes.parfillleftskip or parfillskip_code] = true,
+ [gluecodes.parfillrightskip or parfillskip_code] = true,
+ [gluecodes.indentskip] = true,
+ [gluecodes.correctionskip] = true,
+}
+
+table.setmetatableindex(listcodes,function(t,k)
+ -- fully qualified as yet unknown
+-- local v = mathematics.classnames[k - 0x100] or listcodes.unknown
+ local v = mathematics.classes[k - 0x100] or mathematics.classnames[k - 0x100] or listcodes.unknown
+ t[k] = v
+ return v
+end)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/node-ini.mkxl
index b3f17e04159..df2df0f182f 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/node-ini.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-ini.mkxl
@@ -15,34 +15,34 @@
\unprotect
-\newcount\filterstate \filterstate\plusone % hm, public
+\newinteger\filterstate \filterstate\plusone % hm, public
\registerctxluafile{node-cmp}{autosuffix}
\registerctxluafile{node-ini}{autosuffix}
\registerctxluafile{node-met}{autosuffix}
\registerctxluafile{node-nut}{autosuffix}
\registerctxluafile{node-res}{autosuffix}
-\registerctxluafile{node-ext}{autosuffix}
%registerctxluafile{node-ppt}{} % experimental, not used so probably useless
\registerctxluafile{node-aux}{autosuffix}
\registerctxluafile{node-gcm}{autosuffix}
-\registerctxluafile{node-tst}{}
+\registerctxluafile{node-tst}{autosuffix}
\registerctxluafile{node-tra}{autosuffix}
\registerctxluafile{node-snp}{autosuffix}
-\registerctxluafile{node-tsk}{}
+\registerctxluafile{node-tsk}{autosuffix}
\registerctxluafile{node-tex}{autosuffix}
-\registerctxluafile{node-dir}{} % experimental, not yet (and maybe never) used
+\registerctxluafile{node-dir}{autosuffix}
\registerctxluafile{node-pro}{autosuffix}
\registerctxluafile{node-ser}{autosuffix}
\registerctxluafile{node-acc}{autosuffix} % experimental
%registerctxluafile{node-prp}{} % makes no sense (yet)
\registerctxluafile{node-scn}{autosuffix}
-\registerctxluafile{node-syn}{autosuffix}
+\registerctxluafile{node-scn}{autosuffix}
\registerctxluafile{node-par}{autosuffix}
+%registerctxluafile{node-bwc}{autosuffix} % no longer used
%D This might go away (needs checking anyway, very old code):
-\newcount\c_node_tracers_show_box % box number
+\newinteger\c_node_tracers_show_box % box number
\permanent\protected\def\shownextnodes{\afterassignment\node_tracers_show_next\c_node_tracers_show_box}
\permanent\protected\def\showflatnodes{\afterassignment\node_tracers_show_flat\c_node_tracers_show_box}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-met.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-met.lmt
index a3f02d7093a..81d5b556134 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/node-met.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-met.lmt
@@ -10,7 +10,7 @@ if not modules then modules = { } end modules ['node-MET'] = {
-- the regular code is proven stable. No support otherwise.
-- luatex: todo: copylist should return h, t
--- todo: see if using insert_before and insert_after makes sense here
+-- todo: see if using insertbefore and insertafter makes sense here
-- This file is a side effect of the \LUATEX\ speed optimization project of Luigi
-- Scarso and me. As \CONTEXT\ spends over half its time in \LUA, we though that
@@ -65,84 +65,66 @@ end
-- We start with some helpers and provide all relevant basic functions in the
-- node namespace as well.
-nodes = nodes or { }
-local nodes = nodes
-
-local nodecodes = nodes.nodecodes
-
-nodes.tostring = node.tostring or tostring
-nodes.copy = node.copy
-nodes.copy_node = node.copy
-nodes.copy_list = node.copy_list
-nodes.delete = node.delete
-nodes.dimensions = node.dimensions
-nodes.rangedimensions = node.rangedimensions
-nodes.end_of_math = node.end_of_math
-nodes.flush = node.flush_node
-nodes.flush_node = node.flush_node
-nodes.flush_list = node.flush_list
-nodes.free = node.free
-nodes.insert_after = node.insert_after
-nodes.insert_before = node.insert_before
-nodes.hpack = node.hpack
-nodes.new = node.new
-nodes.tail = node.tail
-nodes.traverse = node.traverse
-nodes.traverse_id = node.traverse_id
-nodes.traverse_char = node.traverse_char
-nodes.traverse_glyph = node.traverse_glyph
-nodes.traverse_list = node.traverse_list
-nodes.slide = node.slide
-nodes.vpack = node.vpack
-nodes.fields = node.fields
-nodes.is_node = node.is_node
-nodes.setglue = node.setglue
-nodes.uses_font = node.uses_font
-
-nodes.first_glyph = node.first_glyph
-nodes.has_glyph = node.has_glyph or node.first_glyph
-
-nodes.current_attributes = node.current_attributes or node.current_attr
-nodes.has_field = node.has_field
-nodes.last_node = node.last_node
-nodes.usedlist = node.usedlist
-nodes.protrusion_skippable = node.protrusion_skippable
-nodes.check_discretionaries = node.check_discretionaries
-nodes.write = node.write
-nodes.flatten_discretionaries = node.flatten_discretionaries
-
-nodes.count = node.count
-nodes.length = node.length
-
-nodes.has_attribute = node.has_attribute
-nodes.set_attribute = node.set_attribute
-nodes.find_attribute = node.find_attribute
-nodes.unset_attribute = node.unset_attribute
-
-nodes.protect_glyph = node.protect_glyph
-nodes.protect_glyphs = node.protect_glyphs
-nodes.unprotect_glyph = node.unprotect_glyph
-nodes.unprotect_glyphs = node.unprotect_glyphs
-nodes.kerning = node.kerning
-nodes.ligaturing = node.ligaturing
-nodes.hyphenating = node.hyphenating
-nodes.mlist_to_hlist = node.mlist_to_hlist
-
-nodes.effective_glue = node.effective_glue
-nodes.getglue = node.getglue
-nodes.setglue = node.setglue
-nodes.is_zero_glue = node.is_zero_glue
-
-nodes.tonode = function(n) return n end
-nodes.tonut = function(n) return n end
+nodes = nodes or { }
+local nodes = nodes
+
+local nodecodes = nodes.nodecodes
+
+nodes.copy = node.copy
+nodes.copylist = node.copylist
+nodes.copy_node = node.copy
+nodes.currentattributes = node.currentattributes
+nodes.remove = node.remove
+nodes.fields = node.fields
+nodes.flush = node.flushnode
+nodes.flushlist = node.flushlist
+nodes.flushnode = node.flushnode
+nodes.getattribute = node.getattribute
+nodes.hasattribute = node.hasattribute
+nodes.hasfield = node.hasfield
+nodes.insertafter = node.insertafter
+nodes.insertbefore = node.insertbefore
+-----.appendafter = node.appendafter
+-----.prependbefore = node.prependbefore
+nodes.isnode = node.isnode
+nodes.isdirect = node.isdirect
+nodes.isnut = node.isdirect
+nodes.new = node.new
+nodes.setattribute = node.setattribute
+nodes.tail = node.tail
+nodes.tostring = node.tostring or tostring
+nodes.traverse = node.traverse
+nodes.traverseid = node.traverseid
+nodes.unsetattribute = node.unsetattribute
+nodes.write = node.write
+nodes.usedlist = node.usedlist
+
+nodes.getpropertiestable = node.get_properties_table
+nodes.getproperty = node.getproperty
+nodes.setproperty = node.setproperty
+
+-----.show = node.show
+nodes.serialized = node.serialized
+
+-- nodes.usedlist
+-- nodes.inuse
+-- nodes.instock
+-- nodes.type
+-- nodes.types
+-- nodes.subtypes
+-- nodes.values
+-- nodes.id
+
+-- nodes.tonode = function(n) return n end
+-- nodes.tonut = function(n) return n end
-- These are never used in \CONTEXT, only as a gimmick in node operators
-- so we keep them around.
--
--- Fro nwo I keep them in \LMTX\ but they will go away!
+-- Fot now I keep them in \LMTX\ but they will go away!
local n_getfield = node.getfield
-local n_getattr = node.get_attribute
+local n_getattr = node.getattribute
local n_setfield = node.setfield
local n_setattr = n_setfield
@@ -151,7 +133,7 @@ nodes.getfield = n_getfield
nodes.setfield = n_setfield
nodes.getattr = n_getattr
nodes.setattr = n_setattr
-nodes.takeattr = nodes.unset_attribute
+nodes.takeattr = nodes.unsetattribute
local function n_getid (n) return n_getfield(n,"id") end
local function n_getsubtype(n) return n_getfield(n,"subtype") end
@@ -215,12 +197,12 @@ nodes.setlink = n_setlink
nodes.getbox = node.getbox or tex.getbox
nodes.setbox = node.setbox or tex.setbox
-local n_flush_node = nodes.flush
+local n_flushnode = nodes.flushnode
local n_copy_node = nodes.copy
-local n_copy_list = nodes.copy_list
+local n_copy_list = nodes.copylist
local n_find_tail = nodes.tail
-local n_insert_after = nodes.insert_after
-local n_insert_before = nodes.insert_before
+local n_insertafter = nodes.insertafter
+local n_insertbefore = nodes.insertbefore
local n_slide = nodes.slide
local n_remove_node = node.remove -- not yet nodes.remove
@@ -231,7 +213,7 @@ local function remove(head,current,free_too)
if not t then
-- forget about it
elseif free_too then
- n_flush_node(t)
+ n_flushnode(t)
t = nil
else
n_setboth(t)
@@ -268,10 +250,10 @@ function nodes.replace(head,current,new) -- no head returned if false
if head == current then
head = new
end
- n_flush_node(current)
+ n_flushnode(current)
return head, new
else
- n_flush_node(current)
+ n_flushnode(current)
return new
end
end
@@ -280,14 +262,14 @@ end
function nodes.append(head,current,...)
for i=1,select("#",...) do
- head, current = n_insert_after(head,current,(select(i,...)))
+ head, current = n_insertafter(head,current,(select(i,...)))
end
return head, current
end
function nodes.prepend(head,current,...)
for i=1,select("#",...) do
- head, current = n_insert_before(head,current,(select(i,...)))
+ head, current = n_insertbefore(head,current,(select(i,...)))
end
return head, current
end
@@ -324,10 +306,6 @@ function nodes.concat(list) -- consider tail instead of slide
return head, tail
end
-function nodes.reference(n)
- return n and tonut(n) or "<none>"
-end
-
-- Here starts an experiment with metatables. Of course this only works with nodes
-- wrapped in userdata with a metatable.
--
@@ -436,7 +414,7 @@ metatable.__sub = function(first,second)
local tail = n_find_tail(first)
for i=1,second do
local prev = n_getprev(tail)
- n_flush_node(tail) -- can become flushlist/flushnode
+ n_flushnode(tail) -- can become flushlist/flushnode
if prev then
tail = prev
else
@@ -471,7 +449,7 @@ metatable.__add = function(first,second)
local head = second
for i=1,first do
local second = n_getnext(head)
- n_flush_node(head) -- can become flushlist/flushnode
+ n_flushnode(head) -- can become flushlist/flushnode
if second then
head = second
else
@@ -558,76 +536,3 @@ metatable.__unm = function(head)
n_setnext(last)
return first
end
-
--- see node-nut.lua for more info on going nuts
-
--- if not gonuts then
---
--- local nuts = { }
--- nodes.nuts = nuts
---
--- local function dummy(f) return f end
---
--- nodes.vianuts = dummy
--- nodes.vianodes = dummy
---
--- for k, v in next, nodes do
--- if type(v) == "function" then
--- nuts[k] = v
--- end
--- end
---
--- end
-
--- also handy
-
-local tonode = nodes.tonode
-local whatsit_code = nodecodes.whatsit
-local getfields = node.fields
-local sort = table.sort
-local whatsitkeys = { }
-local keys = { whatsit = whatsitkeys }
-local messyhack = table.tohash { -- temporary solution
- nodecodes.attributelist,
- nodecodes.attribute,
- nodecodes.action, -- hm
-}
-
-setmetatableindex(keys,function(t,k)
- local v = (k == "attributelist" or k == nodecodes.attributelist) and { } or getfields(k)
- if messyhack[k] then
- for i=1,#v do
- if v[i] == "subtype" then
- remove(v,i)
- break
- end
- end
- end
- if v[ 0] then v[#v+1] = "next" v[ 0] = nil end
- if v[-1] then v[#v+1] = "prev" v[-1] = nil end
- sort(v)
- t[k] = v
- return v
-end)
-
-setmetatableindex(whatsitkeys,function(t,k)
- local v = getfields(whatsit_code,k)
- if v[ 0] then v[#v+1] = "next" v[ 0] = nil end
- if v[-1] then v[#v+1] = "prev" v[-1] = nil end
- sort(v)
- t[k] = v
- return v
-end)
-
-local function nodefields(n)
- n = tonode(n)
- local id = n.id
- if id == whatsit_code then
- return whatsitkeys[n.subtype]
- else
- return keys[id]
- end
-end
-
-nodes.keys = keys -- [id][subtype]
-nodes.fields = nodefields -- (n)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-mig.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-mig.lmt
index c1991350935..3e545478496 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/node-mig.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-mig.lmt
@@ -6,8 +6,6 @@ if not modules then modules = { } end modules ['node-mig'] = {
license = "see context related readme files"
}
--- todo: insert_after
-
local format = string.format
local trace_migrations = false trackers.register("nodes.migrations", function(v) trace_migrations = v end)
@@ -51,6 +49,7 @@ local t_sweeps = 0
local trialtypesetting = context.trialtypesetting
function nodes.handlers.migrate(head,where)
+ -- is this still needed
if head and not trialtypesetting() and where == "alignment" then
if trace_migrations then
report_nodes("migration sweep %a",where)
@@ -112,7 +111,7 @@ local function check()
if not enabled then
enableaction("mvlbuilders", "nodes.handlers.migrate")
enabled = true
- texsetcount("automigrationmode",3)
+ texsetcount("automigrationmode",0xFFFF) -- just all of it
end
else
if enabled then
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-nut.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-nut.lmt
index 7ef087178cd..f17c5ce7a28 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/node-nut.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-nut.lmt
@@ -26,97 +26,124 @@ local glyph_code = nodecodes.glyph
local tonode = direct.tonode
local tonut = direct.todirect
-local is_node = direct.is_node
-local is_nut = direct.is_direct
+local isnode = direct.isnode
+local isnut = direct.isdirect
+local isdirect = direct.isdirect
local d_remove_node = direct.remove
-local d_flush_node = direct.flush_node
+local d_flushnode = direct.flushnode
local d_getnext = direct.getnext
local d_getprev = direct.getprev
local d_getid = direct.getid
local d_getlist = direct.getlist
local d_find_tail = direct.tail
-local d_insert_after = direct.insert_after
-local d_insert_before = direct.insert_before
+local d_insertafter = direct.insertafter
+local d_insertbefore = direct.insertbefore
local d_slide = direct.slide
local d_traverse = direct.traverse
local d_setlink = direct.setlink
local d_getboth = direct.getboth
local nuts = {
- check_discretionaries = direct.check_discretionaries,
+ addmargins = direct.addmargins,
+ addxoffset = direct.addxoffset,
+ addxymargins = direct.addxymargins,
+ addyoffset = direct.addyoffset,
+ append = direct.append,
+ appendaftertail = direct.appendaftertail,
+ checkdiscretionaries = direct.checkdiscretionaries,
+ collapsing = direct.collapsing,
copy = direct.copy,
- copy_list = direct.copy_list,
- copy_node = direct.copy,
- copy_only = direct.copy_only or direct.copy,
+ copylist = direct.copylist,
+ copynode = direct.copy,
+ copyonly = direct.copyonly,
count = direct.count,
- current_attributes = direct.current_attributes,
+ currentattributes = direct.currentattributes,
delete = direct.delete,
dimensions = direct.dimensions,
- naturalhsize = direct.naturalhsize,
- naturalwidth = direct.naturalwidth,
- effective_glue = direct.effective_glue,
- end_of_math = direct.end_of_math,
+ effectiveglue = direct.effectiveglue,
+ endofmath = direct.endofmath,
exchange = direct.exchange,
- find_attribute = direct.find_attribute,
- first_glyph = direct.first_glyph,
- flatten_discretionaries = direct.flatten_discretionaries,
- flush = d_flush_node,
- flush_components = direct.flush_components,
- flush_list = direct.flush_list,
- flush_node = direct.flush_node,
+ findattribute = direct.findattribute,
+ findnode = direct.findnode,
+ firstglyph = direct.firstglyph,
+ flattendiscretionaries = direct.flattendiscretionaries,
+ flattenleaders = direct.flattenleaders,
+ flush = d_flushnode,
+ flushlist = direct.flushlist,
+ flushnode = d_flushnode,
free = direct.free,
- getsynctexfields = direct.get_synctex_fields,
- getattr = direct.get_attribute,
- getattrs = direct.get_attributes,
+ freeze = direct.freeze,
+ getanchors = direct.getanchors,
+ getattr = direct.getattribute,
+ getattribute = direct.getattribute,
getattributelist = direct.getattributelist,
+ getattributes = direct.getattributes,
getattrlist = direct.getattributelist,
+ getattrs = direct.getattributes,
getboth = d_getboth,
+ getbottom = direct.getbottom,
getbox = direct.getbox,
getboxglue = direct.getglue,
getchar = direct.getchar,
- getcomponents = direct.getcomponents,
+ getchardict = direct.getchardict,
+ getcharspec = direct.getcharspec,
+ getchoice = direct.getchoice,
+ getclass = direct.getclass,
getdata = direct.getdata,
+ getdegree = direct.getdegree,
+ getdelimiter = direct.getdelimiter,
+ getmiddle = direct.getdelimiter,
+ getdenominator = direct.getdenominator,
getdepth = direct.getdepth,
getdir = direct.getdir,
getdirection = direct.getdirection,
getdisc = direct.getdisc,
+ getdiscpart = direct.getdiscpart,
getdiscretionary = direct.getdisc,
getexpansion = direct.getexpansion,
getfam = direct.getfam,
getfield = direct.getfield,
getfont = direct.getfont,
+ getgeometry = direct.getgeometry,
getglue = direct.getglue,
getglyphdata = direct.getglyphdata,
+ getglyphdimensions = direct.getglyphdimensions,
getheight = direct.getheight,
getid = d_getid,
+ getindex = direct.getindex,
+ getinputfields = direct.getinputfields,
getkern = direct.getkern,
+ getkerndimension = direct.getkerndimension,
getlang = direct.getlanguage,-- will become obsolete
getlanguage = direct.getlanguage,
getleader = direct.getleader,
+ getleftdelimiter = direct.getleftdelimiter,
getlist = d_getlist,
+ getlistdimensions = direct.getlistdimensions,
+ getmiddledelimiter = direct.getdelimiter,
getnext = d_getnext,
getnormalizedline = direct.getnormalizedline,
getnucleus = direct.getnucleus,
+ getnumerator = direct.getnumerator,
getoffsets = direct.getoffsets,
- -- getxyoffsets = direct.getxyoffsets,
- getscale = direct.getscale,
- getscales = direct.getscales,
- getxscale = direct.getxscale,
- getyscale = direct.getyscale,
- xscaled = direct.xscaled,
- yscaled = direct.yscaled,
- getxyscales = direct.getxyscales,
- getorientation = direct.getorientation,
getoptions = direct.getoptions,
+ getorientation = direct.getorientation,
+ getparstate = direct.getparstate,
getpenalty = direct.getpenalty,
getpost = direct.getpost,
getpre = direct.getpre,
getprev = d_getprev,
+ getprime = direct.getprime,
getreplace = direct.getreplace,
+ getrightdelimiter = direct.getrightdelimiter,
getruledata = direct.getdata, -- obsolete when we have the split
- getscript = direct.setscript,
+ getruledimensions = direct.getruledimensions,
+ getscale = direct.getscale,
+ getscales = direct.getscales,
+ getscript = direct.getscript,
getshift = direct.getshift,
+ getspeciallist = direct.getspeciallist,
getstate = direct.getstate,
getsub = direct.getsub,
getsubpre = direct.getsubpre,
@@ -124,91 +151,125 @@ local nuts = {
getsup = direct.getsup,
getsuppre = direct.getsuppre,
getsurround = direct.getkern,
+ gettop = direct.gettop,
gettotal = direct.gettotal,
+ getusedattributes = direct.getusedattributes,
getvalue = direct.getdata, -- obsolete
getwhd = direct.getwhd,
getwidth = direct.getwidth,
- has_attribute = direct.has_attribute,
- has_dimensions = direct.has_dimensions,
- has_field = direct.has_field,
- has_glyph = direct.has_glyph or direct.first_glyph,
+ getwordrange = direct.getwordrange,
+ getxscale = direct.getxscale,
+ getxyscales = direct.getxyscales,
+ getyscale = direct.getyscale,
+ gluetostring = direct.gluetostring,
+ hasattribute = direct.hasattribute,
+ hasdimensions = direct.hasdimensions,
+ hasfield = direct.hasfield,
+ hasgeometry = direct.hasgeometry,
+ hasglyph = direct.hasglyph,
+ hasglyphoption = direct.hasglyphoption,
hpack = direct.hpack,
hyphenating = direct.hyphenating,
- insert_after = d_insert_after,
- insert_before = d_insert_before,
- is_direct = is_direct,
- is_node = is_node,
- is_nut = direct.is_direct,
- is_zero_glue = direct.is_zero_glue,
- ischar = direct.is_char,
- isprevchar = direct.is_prev_char,
- isnextchar = direct.is_next_char,
- isprevglyph = direct.is_prev_glyph,
- isnextglyph = direct.is_next_glyph,
- isglyph = direct.is_glyph,
+ ignoremathskip = direct.ignoremathskip,
+ insertafter = d_insertafter,
+ insertbefore = d_insertbefore,
+ ischar = direct.ischar,
+ isdirect = isdirect,
+ isglyph = direct.isglyph,
+ isnextchar = direct.isnextchar,
+ isnextglyph = direct.isnextglyph,
+ isnode = isnode,
+ isnut = isdirect,
+ isprevchar = direct.isprevchar,
+ isprevglyph = direct.isprevglyph,
+ iszeroglue = direct.iszeroglue,
+ isnext = direct.isnext,
+ isprev = direct.isprev,
+ isboth = direct.isboth,
kerning = direct.kerning,
- last_node = direct.last_node,
+ lastnode = direct.lastnode,
length = direct.length,
ligaturing = direct.ligaturing,
+ makextensible = direct.makextensible,
migrate = direct.migrate,
- mlist_to_hlist = direct.mlist_to_hlist,
+ mlisttohlist = direct.mlisttohlist,
+ naturalhsize = direct.naturalhsize,
+ naturalwidth = direct.naturalwidth,
new = direct.new,
- protect_glyph = direct.protect_glyph,
- protect_glyphs = direct.protect_glyphs,
- protrusion_skippable = direct.protrusion_skippable,
+ newmathglyph = direct.newmathglyph,
+ patchattributes = direct.patchattributes,
+ prependbeforehead = direct.prependbeforehead,
+ protectglyph = direct.protectglyph,
+ protectglyphs = direct.protectglyphs,
+ protectglyphsnone = direct.protectglyphsnone,
+ protrusionskippable = direct.protrusionskippable,
rangedimensions = direct.rangedimensions,
- getglyphdimensions = direct.getglyphdimensions,
- getkerndimension = direct.getkerndimension,
remove = d_remove_node,
+ removefromlist = direct.removefromlist,
+ repack = direct.repack,
reverse = direct.reverse,
- set_attribute = direct.set_attribute,
- addmargins = direct.addmargins,
- addxymargins = direct.addxymargins,
- setattr = direct.set_attribute,
- setattrs = direct.set_attributes,
+ serialized = direct.serialized,
+ setanchors = direct.setanchors,
+ setattr = direct.setattribute,
+ setattribute = direct.setattribute,
setattributelist = direct.setattributelist,
+ setattributes = direct.setattributes,
setattrlist = direct.setattributelist,
+ setattrs = direct.setattributes,
setboth = direct.setboth,
+ setbottom = direct.setbottom,
setbox = direct.setbox,
setboxglue = direct.setglue,
setchar = direct.setchar,
- setcomponents = direct.setcomponents,
+ setchardict = direct.setchardict,
+ setchoice = direct.setchoice,
+ setclass = direct.setclass,
setdata = direct.setdata,
+ setdegree = direct.setdegree,
+ setdelimiter = direct.setdelimiter,
+ setdenominator = direct.setdenominator,
setdepth = direct.setdepth,
setdir = direct.setdir,
setdirection = direct.setdirection,
setdisc = direct.setdisc,
+ setdiscpart = direct.setdiscpart,
setdiscretionary = direct.setdisc,
setexpansion = direct.setexpansion,
setfam = direct.setfam,
setfield = direct.setfield,
setfont = direct.setfont,
+ setgeometry = direct.setgeometry,
setglue = direct.setglue,
setglyphdata = direct.setglyphdata,
setheight = direct.setheight,
+ setinputfields = direct.setinputfields,
setkern = direct.setkern,
setlang = direct.setlanguage,
setlanguage = direct.setlanguage,
setleader = direct.setleader,
+ setleftdelimiter = direct.setleftdelimiter,
setlink = d_setlink,
setlist = direct.setlist,
+ setmiddledelimiter = direct.setdelimiter,
setnext = direct.setnext,
setnucleus = direct.setnucleus,
- setscale = direct.setscale or direct.setscales,
- setscales = direct.setscales,
+ setnumerator = direct.setnumerator,
setoffsets = direct.setoffsets,
- addxoffset = direct.addxoffset,
- addyoffset = direct.addyoffset,
- setorientation = direct.setorientation,
setoptions = direct.setoptions,
+ setorientation = direct.setorientation,
setpenalty = direct.setpenalty,
setpost = direct.setpost,
setpre = direct.setpre,
setprev = direct.setprev,
+ setprime = direct.setprime,
setreplace = direct.setreplace,
+ setrightdelimiter = direct.setrightdelimiter,
setruledata = direct.setdata, -- obsolete when we have the split
- setscript = direct.getscript,
+ setscale = direct.setscale or direct.setscales,
+ setscales = direct.setscales,
+ setscript = direct.setscript,
setshift = direct.setshift,
+ setspeciallist = direct.setspeciallist,
setsplit = direct.setsplit,
setstate = direct.setstate,
setsub = direct.setsub,
@@ -217,44 +278,47 @@ local nuts = {
setsup = direct.setsup,
setsuppre = direct.setsuppre,
setsurround = direct.setkern,
- setsynctexfields = direct.set_synctex_fields,
setvalue = direct.setdata, -- obsolete
+ settop = direct.settop,
setwhd = direct.setwhd,
setwidth = direct.setwidth,
+ show = direct.show,
slide = d_slide,
- start_of_par = direct.start_of_par,
+ softenhyphens = direct.softenhyphens,
+ startofpar = direct.startofpar,
tail = d_find_tail,
- takeattr = direct.unset_attribute, -- ?
+ takeattr = direct.unsetattribute, -- ?
tonode = tonode,
tonut = tonut,
tostring = direct.tostring,
traverse = d_traverse,
- traverse_char = direct.traverse_char,
- traverse_glyph = direct.traverse_glyph,
- traverse_id = direct.traverse_id,
- traverse_list = direct.traverse_list,
- traverse_content = direct.traverse_content,
- unprotect_glyph = direct.unprotect_glyph,
- unprotect_glyphs = direct.unprotect_glyphs,
- unset_attribute = direct.unset_attribute,
- unset_attributes = direct.unset_attributes,
+ traversechar = direct.traversechar,
+ traversecontent = direct.traversecontent,
+ traverseglyph = direct.traverseglyph,
+ traverseid = direct.traverseid,
+ traverseleader = direct.traverseleader,
+ traverselist = direct.traverselist,
+ unprotectglyph = direct.unprotectglyph,
+ unprotectglyphs = direct.unprotectglyphs,
+ unsetattribute = direct.unsetattribute,
+ unsetattributes = direct.unsetattributes,
usedlist = direct.usedlist,
- uses_font = direct.uses_font,
+ usesfont = direct.usesfont,
+ verticalbreak = direct.verticalbreak,
vpack = direct.vpack,
write = direct.write,
- append = direct.append,
- has_glyph_option = direct.has_glyph_option,
- show = direct.show,
+ xscaled = direct.xscaled,
+ yscaled = direct.yscaled,
}
-nodes.nuts = nuts
+nodes.nuts = nuts
-nodes.is_node = is_node
-nodes.is_direct = is_nut
-nodes.is_nut = is_nut
+nodes.isnode = isnode
+nodes.isdirect = isnut
+nodes.isnut = isnut
-nodes.tonode = tonode
-nodes.tonut = tonut
+nodes.tonode = tonode
+nodes.tonut = tonut
function nuts.delete(head,current)
return d_remove_node(head,current,true)
@@ -272,10 +336,10 @@ function nuts.replace(head,current,new) -- no head returned if false
if head == current then
head = new
end
- d_flush_node(current)
+ d_flushnode(current)
return head, new
else
- d_flush_node(current)
+ d_flushnode(current)
return new
end
end
@@ -307,14 +371,14 @@ end
function nuts.append(head,current,...)
for i=1,select("#",...) do
- head, current = d_insert_after(head,current,(select(i,...)))
+ head, current = d_insertafter(head,current,(select(i,...)))
end
return head, current
end
function nuts.prepend(head,current,...)
for i=1,select("#",...) do
- head, current = d_insert_before(head,current,(select(i,...)))
+ head, current = d_insertbefore(head,current,(select(i,...)))
end
return head, current
end
@@ -361,7 +425,7 @@ function nuts.vianodes(f) return function(n,...) return tonut (f(tonode(n),...))
nodes.vianuts = nuts.vianuts
nodes.vianodes = nuts.vianodes
-function nodes.insert_list_after(h,c,n)
+function nodes.insertlistafter(h,c,n)
local t = n_tail(n)
if c then
local cn = n_getnext(c)
@@ -379,7 +443,7 @@ function nodes.insert_list_after(h,c,n)
return n, t
end
-function nuts.insert_list_after(h,c,n)
+function nuts.insertlistafter(h,c,n)
local t = d_tail(n)
if c then
local cn = d_getnext(c)
@@ -505,7 +569,7 @@ nuts.nestedtracedslide = nestedtracedslide
-- this might move
-local propertydata = direct.get_properties_table(true)
+local propertydata = direct.getpropertiestable(true)
local getattr = nuts.getattr
local setattr = nuts.setattr
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-par.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-par.lmt
index 125c1b687c1..7f2560f03d0 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/node-par.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-par.lmt
@@ -11,10 +11,10 @@ local stoptiming = statistics.stoptiming
local sequencers = utilities.sequencers
--- This is called a lot! I'm a bit reluctant with this one because it is
--- sensitive for order. In many other callbacks ther eis no action at the
--- tex end but here ... Anyway, it has been around for a while now (2019)
--- and so far I had no need for extensive usage so we're okay.
+-- This is called a lot! I'm a bit reluctant with this one because it is sensitive
+-- for order. In many other callbacks there is no action at the tex end but here ...
+-- Anyway, it has been around for a while now (2019) and so far I had no need for
+-- extensive usage so we're okay.
do
@@ -33,7 +33,7 @@ end
-- Originally this one was meant to deal with the indentation (like turn a box into
-- a skip or prevent it) but that never really was used. The return value still
--- detemines if an indentation box or skip is injected. Will I change that?
+-- determines if an indentation box or skip is injected. Will I change that?
do
@@ -95,6 +95,23 @@ do
end
+-- These are node handlers but fit it the overall paragraph handling so we
+-- hook it into the callback here.
+
+-- do
+
+-- local localboxactions = nodes.tasks.actions("localboxes")
+
+-- function localboxfilter(...)
+-- starttiming(builders)
+-- localboxactions(...)
+-- stoptiming(builders)
+-- end
+
+-- callbacks.register("local_box_filter",localboxfilter,"process local boxes")
+
+-- end
+
-- This means that we now have most callbacks in use, even the ones that I'm not sure
-- about. It also means that with the above enabled we might have performance now at
-- its worst. I can optimize this a little but it's not worth the effort (and added
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-pro.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-pro.lmt
index e736f2b76b6..9ad78bb204b 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/node-pro.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-pro.lmt
@@ -15,202 +15,140 @@ local nodes = nodes
local tasks = nodes.tasks
local nuts = nodes.nuts
local tonut = nodes.tonut
+local tonode = nodes.tonode
nodes.processors = nodes.processors or { }
local processors = nodes.processors
--- vbox: grouptype: vbox vtop output split_off split_keep | box_type: exactly|aditional
--- hbox: grouptype: hbox adjusted_hbox(=hbox_in_vmode) | box_type: exactly|aditional
+local tasks = nodes.tasks
+
+local report_nodes = logs.reporter("nodes","processors")
-local actions = tasks.actions("processors")
+local countnodes = nuts.countall
do
- local isglyph = nuts.isglyph
- local getnext = nuts.getnext
+ local function reconstruct(head)
+ return ",stream : " .. nodes.listtoutf(head,"",false,nil,true)
+ end
- local utfchar = utf.char
- local concat = table.concat
+ local before = nil
+ local count = 0
+ local show = false
- local n = 0
+ function processors.trace_glyph_run_b(head,groupcode)
+ count = count + 1
+ before = countnodes(head)
+ end
- local function reconstruct(head) -- we probably have a better one
- local t, n, h = { }, 0, head
- while h do
- n = n + 1
- local char, id = isglyph(h)
- if char then -- todo: disc etc
- t[n] = utfchar(char)
- else
- t[n] = "[]"
- end
- h = getnext(h)
- end
- return concat(t)
+ function processors.trace_glyph_run_a(head,groupcode)
+ report_nodes("processors: run %i, group %a, # before %a, # after %s%s",
+ count,groupcode,before,countnodes(head),
+ show and reconstruct(head) or ""
+ )
+ before = false
end
- function processors.tracer(what,head,groupcode,before,after,show)
- if not groupcode then
- groupcode = "unknown"
- elseif groupcode == "" then
- groupcode = "mvl"
- end
- n = n + 1
- if show then
- report_nodes("%s: location %a, group %a, # before %a, # after %s, stream: %s",what,n,groupcode,before,after,reconstruct(head))
+ local prependaction = tasks.prependaction
+ local appendaction = tasks.appendaction
+ local enableaction = tasks.enableaction
+ local disableaction = tasks.disableaction
+
+ trackers.register("nodes.callbacks", function(v)
+ if not v then
+ disableaction("processors","nodes.processors.trace_glyph_run_b")
+ disableaction("processors","nodes.processors.trace_glyph_run_a")
+ elseif before == nil then
+ prependaction("processors","before","nodes.processors.trace_glyph_run_b",nil,"nonut","enabled")
+ appendaction ("processors","after", "nodes.processors.trace_glyph_run_a",nil,"nonut","enabled")
+ before = false
else
- report_nodes("%s: location %a, group %a, # before %a, # after %s",what,n,groupcode,before,after)
+ enableaction("processors","nodes.processors.trace_glyph_run_b")
+ enableaction("processors","nodes.processors.trace_glyph_run_a")
+ show = v == "detail"
end
- end
+ end)
end
-processors.enabled = true -- this will become a proper state (like trackers)
-
-do
-
- -- local has_glyph = nodes.has_glyph
- local count_nodes = nodes.countall
+local glyph_run = tasks.actions("processors")
+local pre_linebreak_filter = tasks.actions("paragraphs")
+local post_linebreak_filter = tasks.actions("finalizers")
- local texget = tex.get
+processors.glyph_run = glyph_run
+processors.pre_linebreak_filter = pre_linebreak_filter
+processors.post_linebreak_filter = post_linebreak_filter
- local tracer = processors.tracer
+callbacks.register("glyph_run", glyph_run, "glyph processing")
+callbacks.register("pre_linebreak_filter", pre_linebreak_filter, "horizontal manipulations (before par break)")
+callbacks.register("post_linebreak_filter",post_linebreak_filter,"horizontal manipulations (after par break)")
- -- We've set \hlistcallbackmode=1 so glyph checking happens at the other end!
-
- local function pre_linebreak_filter(head,groupcode)
- -- local found = force_processors or has_glyph(head)
- -- if found then
- if trace_callbacks then
- local before = count_nodes(head,true)
- head = actions(head,groupcode)
- local after = count_nodes(head,true)
- tracer("pre_linebreak",head,groupcode,before,after,true)
- else
- head = actions(head,groupcode)
- end
- -- elseif trace_callbacks then
- -- local n = count_nodes(head,false)
- -- tracer("pre_linebreak",head,groupcode,n,n)
- -- end
- return head
- end
+do
+ local hpack = nodes.hpack
- local function hpack_filter(head,groupcode,size,packtype,direction,attributes)
- -- local found = force_processors or has_glyph(head)
- -- if found then
- --
- -- yes or no or maybe an option
- --
- if not direction then
- direction = texget("textdir")
- end
- --
- if trace_callbacks then
- local before = count_nodes(head,true)
- head = actions(head,groupcode,size,packtype,direction,attributes)
- local after = count_nodes(head,true)
- tracer("hpack",head,groupcode,before,after,true)
- else
- head = actions(head,groupcode,size,packtype,direction,attributes)
- end
- -- elseif trace_callbacks then
- -- local n = count_nodes(head,false)
- -- tracer("hpack",head,groupcode,n,n)
- -- end
- return head
+ function nodes.fullhpack(head,...)
+ return hpack((glyph_run(head)),...)
end
- processors.pre_linebreak_filter = pre_linebreak_filter
- processors.hpack_filter = hpack_filter
-
- do
-
- local hpack = nodes.hpack
-
- function nodes.fullhpack(head,...)
- return hpack((hpack_filter(head)),...)
- end
+ local hpack = nuts.hpack
+ function nuts.fullhpack(head,...)
+ return hpack(tonut(glyph_run(tonode(head))),...)
end
+end
- do
-
- local hpack = nuts.hpack
-
- function nuts.fullhpack(head,...)
- return hpack(tonut(hpack_filter(tonode(head))),...)
- end
+do
- end
+ ----- texnest = tex.nest
+ ----- getnest = tex.getnest
- callbacks.register('pre_linebreak_filter', pre_linebreak_filter, "horizontal manipulations (before par break)")
- callbacks.register('hpack_filter' , hpack_filter, "horizontal manipulations (before hbox creation)")
+ local getlist = nodes.getlist -- still nodes !
+ local setlist = nodes.setlist
+ local getsubtype = nodes.getsubtype
-end
+ local linelist_code = nodes.listcodes.line
-do
- -- Beware, these are packaged boxes so no first_glyph test needed. Maybe some day I'll add a hash
- -- with valid groupcodes. Watch out, much can pass twice, for instance vadjust passes two times,
+ local lineactions = tasks.actions("contributers")
+ local adjustactions = tasks.actions("adjusters")
- local actions = tasks.actions("finalizers") -- head, where
- local count_nodes = nodes.countall
+ -- this was the "contributers" callback but we changed the interface
- local tracer = processors.tracer
+ -- historically we use a different order than the callback
- local function post_linebreak_filter(head,groupcode)
- if trace_callbacks then
- local before = count_nodes(head,true)
- head = actions(head,groupcode)
- local after = count_nodes(head,true)
- tracer("post_linebreak",head,groupcode,before,after,true)
- else
- head = actions(head,groupcode)
+ function processors.append_line_filter(head,tail,where,index)
+ if tail then
+ if where == "box" then
+ -- here we don't return something, we operate on the line (content)
+ if getsubtype(tail) == linelist_code then -- always
+ local list = getlist(tail)
+ if list then
+ local result = lineactions(list,where,tail,index) -- tail is parent of list
+ if result and result ~= list then
+ setlist(tail,result)
+ end
+ end
+ end
+ elseif where == "postadjust" or where == "preadjust" then
+ -- we use the same order as for lines
+ return adjustactions(head,where,tail,index)
+ end
end
- return head
end
- processors.post_linebreak_filter = post_linebreak_filter
-
- callbacks.register("post_linebreak_filter", post_linebreak_filter,"horizontal manipulations (after par break)")
+ callbacks.register("append_line_filter", processors.append_line_filter, "things done with lines")
end
do
- ----- texnest = tex.nest
- local getnest = tex.getnest
-
- local getlist = nuts.getlist
- local setlist = nuts.setlist
- local getsubtype = nuts.getsubtype
-
- local linelist_code = nodes.listcodes.line
+ local actions = tasks.actions("alignments")
- local actions = tasks.actions("contributers")
-
- function processors.contribute_filter(groupcode)
- if groupcode == "box" then -- "pre_box"
- local whatever = getnest()
- if whatever then
- local line = whatever.tail
- if line then
- line = tonut(line)
- if getsubtype(line) == linelist_code then
- local head = getlist(line)
- if head then
- local result = actions(head,groupcode,line)
- if result and result ~= head then
- setlist(line,result)
- end
- end
- end
- end
- end
- end
+ function processors.alignment_filter(head,where,attr,preamble)
+ -- todo: add timing
+ actions(head,where,attr,preamble)
end
- callbacks.register("contribute_filter", processors.contribute_filter,"things done with lines")
+ callbacks.register("alignment_filter", processors.alignment_filter, "things done with alignments")
end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-ref.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-ref.lmt
index c02a37dd107..15c35cba992 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/node-ref.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-ref.lmt
@@ -7,15 +7,11 @@ if not modules then modules = { } end modules ['node-ref'] = {
license = "see context related readme files"
}
--- We supported pdf right from the start and in mkii this has resulted in
--- extensive control over the links. Nowadays pdftex provides a lot more
--- control over margins but as mkii supports multiple backends we stuck to
--- our own mechanisms. In mkiv again we implement our own handling. Eventually
--- we will even disable the pdf primitives.
-
--- helper, will end up in luatex
-
--- is grouplevel still used?
+-- We supported pdf right from the start and in mkii this has resulted in extensive
+-- control over the links. Nowadays pdftex provides a lot more control over margins
+-- but as mkii supports multiple backends we stuck to our own mechanisms. In mkiv
+-- again we implement our own handling. Eventually we will even disable the pdf
+-- primitives.
local tonumber = tonumber
local concat = table.concat
@@ -46,9 +42,22 @@ local report_reference = logs.reporter("backend","references")
local report_destination = logs.reporter("backend","destinations")
local report_area = logs.reporter("backend","areas")
+local texiscount = tex.iscount
local texsetcount = tex.setcount
----- texsetattribute = tex.setattribute
+local injectreference = backends.nodeinjections.reference
+local injectdestination = backends.nodeinjections.destination
+local prerollreference = backends.codeinjections.prerollreference
+
+updaters.register("backends.injections.latebindings",function()
+ injectreference = backends.nodeinjections.reference
+ injectdestination = backends.nodeinjections.destination
+ prerollreference = backends.codeinjections.prerollreference
+end)
+
+local c_lastreferenceattribute = texiscount("lastreferenceattribute")
+
local nuts = nodes.nuts
local nodepool = nuts.pool
@@ -80,7 +89,8 @@ local getdimensions = nuts.dimensions
local getrangedimensions = nuts.rangedimensions
local traverse = nuts.traverse
local find_node_tail = nuts.tail
-local start_of_par = nuts.start_of_par
+
+local startofpar = nuts.startofpar
local nodecodes = nodes.nodecodes
local gluecodes = nodes.gluecodes
@@ -99,7 +109,9 @@ local dir_code = nodecodes.dir
local par_code = nodecodes.par
local leftskip_code = gluecodes.leftskip
+local lefthang_code = gluecodes.lefthangskip
local rightskip_code = gluecodes.rightskip
+local righthang_code = gluecodes.righthangskip
local parfillleftskip_code = gluecodes.parfillleftskip
local parfillskip_code = gluecodes.parfillskip
@@ -109,7 +121,7 @@ local new_rule = nodepool.rule
local new_kern = nodepool.kern
local new_hlist = nodepool.hlist
-local flush_node = nuts.flush
+local flushnode = nuts.flush
local tosequence = nodes.tosequence
@@ -147,7 +159,7 @@ local inject_areas do
local v = vpack_list(start) -- use helper but happens seldom anyway so ...
local w, h, d = getwhd(v)
setlist(v) -- not needed
- flush_node(v)
+ flushnode(v)
if temp then
setnext(stop,temp)
end
@@ -237,7 +249,7 @@ local inject_areas do
end
end
- -- Setting these once and not passign them each nested call is faster and this injector is
+ -- Setting these once and not passing them each nested call is faster and this injector is
-- actually one of the more costly calls in a run (when we have lots of references to
-- check) and it's also a bti less code.
@@ -304,7 +316,7 @@ local inject_areas do
local function inject(head,skip,parent,pardir,txtdir)
local first, last, firstdir, reference
local current = head
- while current do
+ while current do -- tod: check with loop
local id = getid(current)
if id == hlist_code or id == vlist_code then
local r = getattr(current,attribute)
@@ -352,15 +364,16 @@ local inject_areas do
txtdir = not pop and direction -- we might need a stack
goto NEXT
elseif id == par_code then
- if start_of_par(current) then
+ if startofpar(current) then
pardir = getdirection(current)
end
goto NEXT
elseif id == glue_code then
+ -- local skiptype = ... 0=regular 1=left 2=right
local subtype = getsubtype(current)
- if subtype == leftskip_code or subtype == parfillleftskip_code then
+ if subtype == leftskip_code or subtype == lefthang_code or subtype == parfillleftskip_code then
goto NEXT
- elseif subtype == rightskip_code or subtype == parfillskip_code then
+ elseif subtype == rightskip_code or subtype == righthang_code or subtype == parfillskip_code then
if reference and (done[reference] or 0) == 0 then
head, current = inject_range(head,first,last,reference,parent,pardir,firstdir)
reference = nil
@@ -393,8 +406,8 @@ local inject_areas do
-- print("!!!!!!!!")
end
else
- -- todo: safeguard when we have a glyph or dics or ... so we might as well
- -- then scan for all possibel content nodes
+ -- todo: safeguard when we have a glyph or disc or ... so we might as well
+ -- then scan for all possible content nodes
reference = r
first = current
last = current
@@ -447,6 +460,7 @@ local colorize, justadd do
str = str .. " "
shift = (shift or 2) * exheight
end
+ -- todo: virtual rule, zero width hbox, offsets
local text = typesetters.tohpack(str,infofont)
local rule = new_rule(emwidth/5,4*exheight,3*exheight)
setshift(text,shift)
@@ -484,12 +498,12 @@ local colorize, justadd do
height = 65536/2
depth = height
end
+ -- todo: use virtual rules
local rule = setcoloring(new_rule(width,height,depth),1,u_color,u_transparency) -- gray color model
if width < 0 then
local kern = new_kern(width)
setwidth(rule,-width)
- setnext(kern,rule)
- setprev(rule,kern)
+ setlink(kern,rule)
return kern
elseif sr and sr ~= "" then
local text = addstring(what,sr,shift)
@@ -519,6 +533,8 @@ local nofreferences = 0
do
+ -- here we can't use attributes.registervalue etc (afaiks)
+
local stack = { }
local done = { }
local attribute = attributes.private('reference')
@@ -538,7 +554,7 @@ do
-- so some part of the backend work is already done here
stack[topofstack] = { r, h or false, d or false, codeinjections.prerollreference(r) }
-- texsetattribute(attribute,topofstack) -- todo -> at tex end
- texsetcount("lastreferenceattribute",topofstack)
+ texsetcount(c_lastreferenceattribute,topofstack)
end
function references.get(n) -- not public so functionality can change
@@ -563,7 +579,7 @@ do
if depth < dp then depth = dp end
end
-- logs.report("temp","used: ht=%p dp=%p",height,depth)
- local annot = nodeinjections.reference(width,height,depth,set,resolved.mesh)
+ local annot = injectreference(reference,width,height,depth,set,resolved.mesh)
if annot then
annot = tonut(annot) -- todo
nofreferences = nofreferences + 1
@@ -658,6 +674,8 @@ local nofdestinations = 0
do
+ -- here we can use attributes.registervalue etc
+
local stack = { }
local done = { }
local attribute = attributes.private('destination')
@@ -742,13 +760,13 @@ do
end
end
nofdestinations = nofdestinations + 1
- local annot = nodeinjections.destination(width,height,depth,name,view)
+ local annot = injectdestination(width,height,depth,name,view)
if annot then
annot = tonut(annot) -- obsolete soon
if result then
setlink(current,annot)
else
- result = annot
+ result = annot
end
current = find_node_tail(annot)
end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-res.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-res.lmt
index fbb1d1fe235..6fed08b6393 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/node-res.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-res.lmt
@@ -8,6 +8,7 @@ if not modules then modules = { } end modules ['node-res'] = {
local type, next, rawset = type, next, rawset
local gmatch, format = string.gmatch, string.format
+local round = math.round
--[[ldx--
<p>The next function is not that much needed but in <l n='context'/> we use
@@ -73,12 +74,13 @@ local setshift = nuts.setshift
local setwidth = nuts.setwidth
local setsubtype = nuts.setsubtype
local setleader = nuts.setleader
+local setclass = nuts.setclass
local setdata = nuts.setdata
-local setruledata = nuts.setruledata
+local setoffsets = nuts.setoffsets
local setvalue = nuts.setvalue
-local copy_nut = nuts.copy_only or nuts.copy
+local copy_nut = nuts.copyonly
local new_nut = nuts.new
local flush_nut = nuts.flush
@@ -181,10 +183,14 @@ local lefttoright_code = nodes.dirvalues.lefttoright
local rule = register_nut(new_nut(rule_code)) -- setdirection(rule, lefttoright_code)
local emptyrule = register_nut(new_nut(rule_code,rulecodes.empty)) -- setdirection(rule, lefttoright_code)
+local strutrule = register_nut(new_nut(rule_code,rulecodes.strut)) -- setdirection(rule, lefttoright_code)
local userrule = register_nut(new_nut(rule_code,rulecodes.user)) -- setdirection(rule, lefttoright_code)
local outlinerule = register_nut(new_nut(rule_code,rulecodes.outline)) -- setdirection(rule, lefttoright_code)
-local hlist = register_nut(new_nut(nodecodes.hlist)) setdirection(hlist,lefttoright_code)
-local vlist = register_nut(new_nut(nodecodes.vlist)) setdirection(vlist,lefttoright_code)
+local imagerule = register_nut(new_nut(rule_code,rulecodes.image)) -- setdirection(rule, lefttoright_code)
+local boxrule = register_nut(new_nut(rule_code,rulecodes.box)) -- setdirection(rule, lefttoright_code)
+local virtualrule = register_nut(new_nut(rule_code,rulecodes.virtual)) -- setdirection(rule, lefttoright_code)
+local hlist = register_nut(new_nut(nodecodes.hlist)) setdirection(hlist,lefttoright_code)
+local vlist = register_nut(new_nut(nodecodes.vlist)) setdirection(vlist,lefttoright_code)
function nutpool.glyph(fnt,chr)
local n = copy_nut(glyph)
@@ -355,6 +361,14 @@ function nutpool.emptyrule(width,height,depth) -- w/h/d == nil will let them ada
return n
end
+function nutpool.strutrule(width,height,depth) -- w/h/d == nil will let them adapt
+ local n = copy_nut(strutrule)
+ if width or height or depth then
+ setwhd(n,width,height,depth)
+ end
+ return n
+end
+
function nutpool.userrule(width,height,depth) -- w/h/d == nil will let them adapt
local n = copy_nut(userrule)
if width or height or depth then
@@ -369,12 +383,37 @@ function nutpool.outlinerule(width,height,depth,line) -- w/h/d == nil will let t
setwhd(n,width,height,depth)
end
if line then
- setruledata(n,line)
+ setdata(n,round(line)) -- has to be an integer
+ end
+ return n
+end
+
+function nutpool.imagerule(width,height,depth) -- w/h/d == nil will let them adapt
+ local n = copy_nut(imagerule)
+ if width or height or depth then
+ setwhd(n,width,height,depth)
+ end
+ return n
+end
+
+function nutpool.boxrule(width,height,depth) -- w/h/d == nil will let them adapt
+ local n = copy_nut(boxrule)
+ if width or height or depth then
+ setwhd(n,width,height,depth)
end
return n
end
-function nutpool.leader(width,list)
+function nutpool.virtualrule(width,height,depth) -- w/h/d == nil will let them adapt
+ local n = copy_nut(virtualrule)
+ if width or height or depth then
+ setdata(n,width)
+ setoffsets(n,nil,nil,height,depth)
+ end
+ return n
+end
+
+local function new_leader(width,list)
local n = copy_nut(cleader)
if width then
setwidth(n,width)
@@ -385,6 +424,12 @@ function nutpool.leader(width,list)
return n
end
+nutpool.leader = new_leader
+
+function nodepool.leader(width,list)
+ return tonode(new_leader(width,list and tonut(list)))
+end
+
function nutpool.leftmarginkern(glyph,width)
local n = copy_nut(left_margin_kern)
if not glyph then
@@ -419,11 +464,20 @@ function nutpool.temp()
return copy_nut(temp)
end
-function nutpool.noad() return copy_nut(noad) end
+function nutpool.noad(class)
+ local n = copy_nut(noad)
+ if class then
+ setsubtype(n,class)
+ setclass(n,class,class,class)
+ end
+ return n
+end
+
+-- maybe also the rest wrt subtype and class
+
function nutpool.delimiter() return copy_nut(delimiter) end nutpool.delim = nutpool.delimiter
function nutpool.fence() return copy_nut(fence) end
function nutpool.submlist() return copy_nut(submlist) end
-function nutpool.noad() return copy_nut(noad) end
function nutpool.fence() return copy_nut(fence) end
function nutpool.accent() return copy_nut(accent) end
function nutpool.radical() return copy_nut(radical) end
@@ -484,6 +538,7 @@ end
-- housekeeping
local function cleanup(nofboxes) -- todo
+ -- this is bonus, not really needed
local tracers = nodes.tracers
if tracers and tracers.steppers then -- to be resolved
tracers.steppers.reset() -- todo: make a registration subsystem
@@ -537,27 +592,42 @@ statistics.register("node memory usage", function() -- comes after cleanup !
end
end)
-lua.registerfinalizer(cleanup, "cleanup reserved nodes")
+lua.registerinitexfinalizer(cleanup, "cleanup reserved nodes")
do
- local glyph = glyph
- local traverse_id = nuts.traverse_id
+ local glyph = glyph
+ local traverseid = nuts.traverseid
- local traversers = table.setmetatableindex(function(t,k)
- local v = traverse_id(type(k) == "number" and k or nodecodes[k],glyph)
+ local traversers = table.setmetatableindex(function(t,k)
+ local v = traverseid(type(k) == "number" and k or nodecodes[k],glyph)
+ t[k] = v
+ return v
+ end)
+
+ local treversers = table.setmetatableindex(function(t,k)
+ local v = traverseid(type(k) == "number" and k or nodecodes[k],glyph,true)
t[k] = v
return v
end)
-- these are special:
- traversers.node = nuts.traverse (glyph)
- traversers.char = nuts.traverse_char (glyph)
- traversers.glyph = nuts.traverse_glyph (glyph)
- traversers.list = nuts.traverse_list (glyph)
- traversers.content = nuts.traverse_content(glyph)
+ traversers.node = nuts.traverse (glyph)
+ traversers.char = nuts.traversechar (glyph)
+ traversers.glyph = nuts.traverseglyph (glyph)
+ traversers.list = nuts.traverselist (glyph)
+ traversers.content = nuts.traversecontent(glyph)
+ traversers.leader = nuts.traverseleader (glyph)
+
+ treversers.node = nuts.traverse (glyph,true)
+ treversers.char = nuts.traversechar (glyph,true)
+ treversers.glyph = nuts.traverseglyph (glyph,true)
+ treversers.list = nuts.traverselist (glyph,true)
+ treversers.content = nuts.traversecontent(glyph,true)
+ treversers.leader = nuts.traverseleader (glyph,true)
nuts.traversers = traversers
+ nuts.treversers = treversers
end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-rul.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-rul.lmt
index a95c5272d36..7d638e7cd63 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/node-rul.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-rul.lmt
@@ -55,15 +55,15 @@ local getruledata = nuts.getruledata
local isglyph = nuts.isglyph
-local flushlist = nuts.flush_list
-local effective_glue = nuts.effective_glue
-local insert_node_after = nuts.insert_after
-local insert_node_before = nuts.insert_before
+local flushlist = nuts.flushlist
+local effectiveglue = nuts.effectiveglue
+local insertnodeafter = nuts.insertafter
+local insertnodebefore = nuts.insertbefore
local find_tail = nuts.tail
local setglue = nuts.setglue
local getrangedimensions = nuts.rangedimensions
local hpack_nodes = nuts.hpack
-local copy_list = nuts.copy_list
+local copylist = nuts.copylist
local nextlist = nuts.traversers.list
local nextglue = nuts.traversers.glue
@@ -111,6 +111,10 @@ local a_colormodel = privateattributes('colormodel')
local a_linefiller = privateattributes("linefiller")
local a_viewerlayer = privateattributes("viewerlayer")
+local registervalue = attributes.registervalue
+local getvalue = attributes.getvalue
+local texsetattribute = tex.setattribute
+
local v_both = variables.both
local v_left = variables.left
local v_right = variables.right
@@ -126,573 +130,575 @@ local dimenfactor = fonts.helpers.dimenfactor
local splitdimen = number.splitdimen
local setmetatableindex = table.setmetatableindex
-local magicconstants = tex.magicconstants
-local running = magicconstants.running
+local runningrule = tex.magicconstants.runningrule
local striprange = nuts.striprange
local processwords = nuts.processwords
local setcoloring = nuts.colors.set
-local rules = nodes.rules or { }
-nodes.rules = rules
-rules.data = rules.data or { }
-
-local nutrules = nuts.rules or { }
-nuts.rules = nutrules -- not that many
+do
-storage.register("nodes/rules/data", rules.data, "nodes.rules.data")
+ local rules = nodes.rules or { }
+ nodes.rules = rules
+ -- rules.data = rules.data or { }
-local data = rules.data
+ local nutrules = nuts.rules or { }
+ nuts.rules = nutrules -- not that many
--- we implement user rules here as it takes less code this way
+ -- we implement user rules here as it takes less code this way
-local function usernutrule(t,noattributes)
- local r = new_userrule(t.width or 0,t.height or 0,t.depth or 0)
- if noattributes == false or noattributes == nil then
- -- avoid fuzzy ones
- else
- setattrlist(r,true)
+ local function usernutrule(t,noattributes)
+ local r = new_userrule(t.width or 0,t.height or 0,t.depth or 0)
+ if noattributes == false or noattributes == nil then
+ -- avoid fuzzy ones
+ else
+ setattrlist(r,true)
+ end
+ properties[r] = t
+ return r
end
- properties[r] = t
- return r
-end
-nutrules.userrule = usernutrule
+ nutrules.userrule = usernutrule
-local function userrule(t,noattributes)
- return tonode(usernutrule(t,noattributes))
-end
+ local function userrule(t,noattributes)
+ return tonode(usernutrule(t,noattributes))
+ end
-rules.userrule = userrule
-local ruleactions = { }
+ rules.userrule = userrule
+ local ruleactions = { }
-rules .ruleactions = ruleactions
-nutrules.ruleactions = ruleactions -- convenient
+ rules .ruleactions = ruleactions
+ nutrules.ruleactions = ruleactions -- convenient
-local function mathaction(n,h,v,what)
- local font = getruledata(n)
- local actions = fontresources[font].mathruleactions
- if actions then
- local action = actions[what]
- if action then
- action(n,h,v,font)
+ local function mathaction(n,h,v,what)
+ local font = getruledata(n)
+ local actions = fontresources[font].mathruleactions
+ if actions then
+ local action = actions[what]
+ if action then
+ action(n,h,v,font)
+ end
end
end
-end
-local function mathradical(n,h,v)
- mathaction(n,h,v,"radicalaction")
-end
+ local function mathradical(n,h,v)
+ mathaction(n,h,v,"radicalaction")
+ end
-local function mathrule(n,h,v)
- mathaction(n,h,v,"hruleaction")
-end
+ local function mathrule(n,h,v)
+ mathaction(n,h,v,"hruleaction")
+ end
-local x
+ local x
-local function useraction(n,h,v)
- local p = properties[n]
- if p then
- local i = p.type or "draw"
- local a = ruleactions[i]
- if a then
- a(p,h,v,i,n)
+ local function useraction(n,h,v)
+ local p = properties[n]
+ if p then
+ local i = p.type or "draw"
+ local a = ruleactions[i]
+ if a then
+ a(p,h,v,i,n)
+ end
end
end
-end
-local subtypeactions = {
- [rulecodes.user] = useraction,
- [rulecodes.over] = mathrule,
- [rulecodes.under] = mathrule,
- [rulecodes.fraction] = mathrule,
- [rulecodes.radical] = mathradical,
-}
+ local subtypeactions = {
+ [rulecodes.user] = useraction,
+ [rulecodes.over] = mathrule,
+ [rulecodes.under] = mathrule,
+ [rulecodes.fraction] = mathrule,
+ [rulecodes.radical] = mathradical,
+ }
-function rules.process(n,h,v)
- local n = tonut(n) -- already a nut
- local s = getsubtype(n)
- local a = subtypeactions[s]
- if a then
- a(n,h,v)
+ function rules.process(n,h,v)
+ local n = tonut(n) -- already a nut
+ local s = getsubtype(n)
+ local a = subtypeactions[s]
+ if a then
+ a(n,h,v)
+ end
end
-end
---
+ local trace_ruled = false trackers.register("nodes.rules", function(v) trace_ruled = v end)
+ local report_ruled = logs.reporter("nodes","rules")
+ local enabled = false
-local trace_ruled = false trackers.register("nodes.rules", function(v) trace_ruled = v end)
-local report_ruled = logs.reporter("nodes","rules")
-
-function rules.define(settings)
- local nofdata = #data + 1
- data[nofdata] = settings
- local text = settings.text
- if text then
- local b = nuts.takebox(text)
- if b then
- nodepool.register(b)
- settings.text = getlist(b)
- else
- settings.text = nil
- end
- end
- return nofdata
-end
+ local texgetattribute = tex.getattribute
+ local unsetvalue = attributes.unsetvalue
-local function flush_ruled(head,f,l,d,level,parent,strip) -- not that fast but acceptable for this purpose
- local font = nil
- local char, id = isglyph(f)
- if char then
- font = id
- elseif id == hlist_code then
- font = getattr(f,a_runningtext)
- end
- if not font then
- -- saveguard ... we need to deal with rules and so (math)
- return head
- end
- local r, m
- if strip then
- if trace_ruled then
- local before = n_tosequence(f,l,true)
- f, l = striprange(f,l)
- local after = n_tosequence(f,l,true)
- report_ruled("range stripper, before %a, after %a",before,after)
- else
- f, l = striprange(f,l)
+ -- The setter is now the performance bottleneck but it is no longer
+ -- limited to a certain number of cases before we cycle resources.
+
+ function rules.set(settings)
+ if not enabled then
+ enableaction("shipouts","nodes.rules.handler")
+ enabled = true
end
- end
- if not f then
- return head
- end
- local wd, ht, dp = getrangedimensions(parent,f,getnext(l))
- local method = d.method
- local empty = d.empty == v_yes
- local offset = d.offset
- local dy = d.dy
- local order = d.order
- local max = d.max
- local mp = d.mp
- local rulethickness = d.rulethickness
- local unit = d.unit
- local ma = d.ma
- local ca = d.ca
- local ta = d.ta
- local colorspace = ma > 0 and ma or getattr(f,a_colormodel) or 1
- local color = ca > 0 and ca or getattr(f,a_color)
- local transparency = ta > 0 and ta or getattr(f,a_transparency)
- local foreground = order == v_foreground
- local layer = getattr(f,a_viewerlayer)
- local e = dimenfactor(unit,font) -- what if no glyph node
- local rt = tonumber(rulethickness)
- if rt then
- rulethickness = e * rulethickness / 2
- else
- local n, u = splitdimen(rulethickness)
- if n and u then -- we need to intercept ex and em and % and ...
- rulethickness = n * dimenfactor(u,fontdata[font]) / 2
- else
- rulethickness = 1/5
+ local text = settings.text
+ if text then
+ settings.text = tonut(text)
+ -- nodepool.register(text) -- todo: have a cleanup hook
end
- end
- --
- if level > max then
- level = max
- end
- if method == 0 then -- center
- offset = 2*offset
- m = (offset+(level-1)*dy)*e/2 + rulethickness/2
- else
- m = 0
+ -- todo: only when explicitly enabled
+ local attr = texgetattribute(a_ruled)
+ if attr ~= unsetvalue then
+ settings.nestingvalue = attr
+ settings.nestingdata = getvalue(a_ruled,attr) -- so still accessible when we wipe
+ end
+ texsetattribute(a_ruled,registervalue(a_ruled,settings))
end
- local function inject(r,wd,ht,dp)
- if layer then
- setattr(r,a_viewerlayer,layer)
+ attributes.setcleaner(a_ruled,function(t)
+ local text = t.text
+ if text then
+ flushlist(text)
+ end
+ end)
+
+ -- we could check the passed level on the real one ... (no need to pass level)
+
+ local function flush_ruled(head,f,l,d,level,parent,strip) -- not that fast but acceptable for this purpose
+ local level = d.stack or d.level or 1
+ if level > d.max then
+ -- todo: trace message
+ return head
+ end
+ local font = nil
+ local char, id = isglyph(f)
+ if char then
+ font = id
+ elseif id == hlist_code then
+ font = getattr(f,a_runningtext)
+ end
+ if not font then
+ -- saveguard ... we need to deal with rules and so (math)
+ return head
end
- if empty then
- head = insert_node_before(head,f,r)
- setlink(r,getnext(l))
- setprev(f)
- setnext(l)
- flushlist(f)
+ local r, m
+ if strip then
+ if trace_ruled then
+ local before = n_tosequence(f,l,true)
+ f, l = striprange(f,l)
+ local after = n_tosequence(f,l,true)
+ report_ruled("range stripper, before %a, after %a",before,after)
+ else
+ f, l = striprange(f,l)
+ end
+ end
+ if not f then
+ return head
+ end
+ local wd, ht, dp = getrangedimensions(parent,f,getnext(l))
+ local method = d.method
+ local empty = d.empty == v_yes
+ local offset = d.offset
+ local dy = d.dy
+ local order = d.order
+ local max = d.max
+ local mp = d.mp
+ local rulethickness = d.rulethickness
+ local unit = d.unit
+ local ma = d.ma
+ local ca = d.ca
+ local ta = d.ta
+ local colorspace = ma > 0 and ma or getattr(f,a_colormodel) or 1
+ local color = ca > 0 and ca or getattr(f,a_color)
+ local transparency = ta > 0 and ta or getattr(f,a_transparency)
+ local foreground = order == v_foreground
+ local layer = getattr(f,a_viewerlayer)
+ local e = dimenfactor(unit,font) -- what if no glyph node
+ local rt = tonumber(rulethickness)
+ if rt then
+ rulethickness = e * rulethickness / 2
else
- local k = new_kern(-wd)
- if foreground then
- insert_node_after(head,l,k)
- insert_node_after(head,k,r)
- l = r
+ local n, u = splitdimen(rulethickness)
+ if n and u then -- we need to intercept ex and em and % and ...
+ rulethickness = n * dimenfactor(u,fontdata[font]) / 2
else
- head = insert_node_before(head,f,r)
- insert_node_after(head,r,k)
+ rulethickness = 1/5
end
end
- if trace_ruled then
- report_ruled("level %a, width %p, height %p, depth %p, nodes %a, text %a",
- level,wd,ht,dp,n_tostring(f,l),n_tosequence(f,l,true))
+ --
+ if level > max then
+ level = max
+ end
+ if method == 0 then -- center
+ offset = 2*offset
+ m = (offset+(level-1)*dy)*e/2 + rulethickness/2
+ else
+ m = 0
end
- end
- if mp and mp ~= "" then
- local r = usernutrule {
- width = wd,
- height = ht,
- depth = dp,
- type = "mp",
- factor = e,
- offset = offset,
- line = rulethickness,
- data = mp,
- ma = colorspace,
- ca = color,
- ta = transparency,
- }
- inject(r,wd,ht,dp)
- else
- local tx = d.text
- if tx then
- local l = copy_list(tx)
- if d["repeat"] == v_yes then
- l = new_leader(wd,l)
- setattrlist(l,tx)
+ local function inject(r,wd,ht,dp)
+ if layer then
+ setattr(r,a_viewerlayer,layer)
end
- l = hpack_nodes(l,wd,"exactly")
- inject(l,wd,ht,dp)
+ if empty then
+ head = insertnodebefore(head,f,r)
+ setlink(r,getnext(l))
+ setprev(f)
+ setnext(l)
+ flushlist(f)
+ else
+ local k = new_kern(-wd)
+ if foreground then
+ insertnodeafter(head,l,k)
+ insertnodeafter(head,k,r)
+ l = r
+ else
+ head = insertnodebefore(head,f,r)
+ insertnodeafter(head,r,k)
+ end
+ end
+ if trace_ruled then
+ report_ruled("level %a, width %p, height %p, depth %p, nodes %a, text %a",
+ level,wd,ht,dp,n_tostring(f,l),n_tosequence(f,l,true))
+ end
+ end
+
+ if mp and mp ~= "" then
+ local r = usernutrule {
+ width = wd,
+ height = ht,
+ depth = dp,
+ type = "mp",
+ factor = e,
+ offset = offset - (level-1)*dy, -- br ... different direction
+ line = rulethickness,
+ data = mp,
+ ma = colorspace,
+ ca = color,
+ ta = transparency,
+ }
+ inject(r,wd,ht,dp)
else
- for i=1,level do
- local hd = (offset+(i-1)*dy)*e - m
+ local tx = d.text
+ if tx then
+ local l = copylist(tx)
+ if d["repeat"] == v_yes then
+ l = new_leader(wd,l)
+ setattrlist(l,tx)
+ end
+ l = hpack_nodes(l,wd,"exactly")
+ inject(l,wd,ht,dp)
+ else
+ local hd = (offset+(level-1)*dy)*e - m
local ht = hd + rulethickness
local dp = -hd + rulethickness
inject(setcoloring(new_rule(wd,ht,dp),colorspace,color,transparency),wd,ht,dp)
end
end
+ return head
end
- return head
-end
-
-rules.handler = function(head)
- return processwords(a_ruled,data,flush_ruled,head)
-end
-
-function rules.enable()
- enableaction("shipouts","nodes.rules.handler")
-end
-local trace_shifted = false trackers.register("nodes.shifting", function(v) trace_shifted = v end)
+ rules.handler = function(head)
+ local data = attributes.values[a_ruled]
+ --or-- local data = getvalues(a_ruled)
+ if data then
+ head = processwords(a_ruled,data,flush_ruled,head)
-local report_shifted = logs.reporter("nodes","shifting")
+ end
+ return head
+ end
-local a_shifted = attributes.private('shifted')
+ implement {
+ name = "setrule",
+ actions = rules.set,
+ arguments = {
+ {
+ { "continue" },
+ { "unit" },
+ { "order" },
+ { "level", "integer" },
+ { "stack", "integer" },
+ { "method", "integer" },
+ { "offset", "number" },
+ { "rulethickness" },
+ { "dy", "number" },
+ { "max", "number" },
+ { "ma", "integer" },
+ { "ca", "integer" },
+ { "ta", "integer" },
+ { "mp" },
+ { "empty" },
+ { "text", "box" },
+ { "repeat" },
+ }
+ }
+ }
-local shifts = nodes.shifts or { }
-nodes.shifts = shifts
-shifts.data = shifts.data or { }
+end
-storage.register("nodes/shifts/data", shifts.data, "nodes.shifts.data")
+do
-local data = shifts.data
+ local trace_shifted = false trackers.register("nodes.shifting", function(v) trace_shifted = v end)
+ local report_shifted = logs.reporter("nodes","shifting")
+ local a_shifted = attributes.private('shifted')
+ local enabled = false
-function shifts.define(settings)
- local nofdata = #data + 1
- data[nofdata] = settings
- return nofdata
-end
+ local shifts = nodes.shifts or { }
+ nodes.shifts = shifts
-local function flush_shifted(head,first,last,data,level,parent,strip) -- not that fast but acceptable for this purpose
- if true then
- first, last = striprange(first,last)
- end
- local prev = getprev(first)
- local next = getnext(last)
- setprev(first)
- setnext(last)
- local width, height, depth = getrangedimensions(parent,first,next)
- local list = hpack_nodes(first,width,"exactly") -- we can use a simple pack
- if first == head then
- head = list
- end
- if prev then
- setlink(prev,list)
+ function shifts.set(settings)
+ if not enabled then
+ -- we could disable when no more found
+ enableaction("shipouts","nodes.shifts.handler")
+ enabled = true
+ end
+ texsetattribute(a_shifted,registervalue(a_shifted,settings))
end
- if next then
- setlink(list,next)
+
+ local function flush_shifted(head,first,last,data,level,parent,strip) -- not that fast but acceptable for this purpose
+ if true then
+ first, last = striprange(first,last)
+ end
+ local prev = getprev(first)
+ local next = getnext(last)
+ setprev(first)
+ setnext(last)
+ local width, height, depth = getrangedimensions(parent,first,next)
+ local list = hpack_nodes(first,width,"exactly") -- we can use a simple pack
+ if first == head then
+ head = list
+ end
+ if prev then
+ setlink(prev,list)
+ end
+ if next then
+ setlink(list,next)
+ end
+ local raise = data.dy * dimenfactor(data.unit,fontdata[getfont(first)])
+ setshift(list,raise)
+ setwhd(list,width,height,depth)
+ if trace_shifted then
+ report_shifted("width %p, nodes %a, text %a",width,n_tostring(first,last),n_tosequence(first,last,true))
+ end
+ return head
end
- local raise = data.dy * dimenfactor(data.unit,fontdata[getfont(first)])
- setshift(list,raise)
- setwhd(list,width,height,depth)
- if trace_shifted then
- report_shifted("width %p, nodes %a, text %a",width,n_tostring(first,last),n_tosequence(first,last,true))
+
+ shifts.handler = function(head)
+ local data = attributes.values[a_shifted]
+ if data then
+ head = processwords(a_shifted,data,flush_shifted,head)
+ end
+ return head
end
- return head
-end
-shifts.handler = function(head)
- return processwords(a_shifted,data,flush_shifted,head)
-end
+ implement {
+ name = "setshift",
+ actions = shifts.set,
+ arguments = {
+ {
+ { "continue" },
+ { "unit" },
+ { "method", "integer" },
+ { "dy", "number" },
+ }
+ }
+ }
-function shifts.enable()
- enableaction("shipouts","nodes.shifts.handler")
end
-- linefillers
-local linefillers = nodes.linefillers or { }
-nodes.linefillers = linefillers
-linefillers.data = linefillers.data or { }
+do
-storage.register("nodes/linefillers/data", linefillers.data, "nodes.linefillers.data")
+ local linefillers = nodes.linefillers or { }
+ nodes.linefillers = linefillers
+ local enabled = false
-local data = linefillers.data
+ local usernutrule = nuts.rules.userrule
-function linefillers.define(settings)
- local nofdata = #data + 1
- data[nofdata] = settings
- return nofdata
-end
+ function linefillers.set(settings)
+ if not enabled then
+ enableaction("finalizers","nodes.linefillers.handler")
+ enabled = true
+ end
+ texsetattribute(a_linefiller,registervalue(a_linefiller,settings))
+ end
-local function linefiller(current,data,width,location)
- local height = data.height
- local depth = data.depth
- local mp = data.mp
- local ma = data.ma
- local ca = data.ca
- local ta = data.ta
- if mp and mp ~= "" then
- return usernutrule {
- width = width,
- height = height,
- depth = depth,
- type = "mp",
- line = data.rulethickness,
- data = mp,
- ma = ma,
- ca = ca,
- ta = ta,
- option = location,
- direction = getdirection(current),
- }
- else
- return setcoloring(new_rule(width,height,depth),ma,ca,ta)
+ local function linefiller(current,data,width,location)
+ local height = data.height
+ local depth = data.depth
+ local mp = data.mp
+ local ma = data.ma
+ local ca = data.ca
+ local ta = data.ta
+ if mp and mp ~= "" then
+ return usernutrule {
+ width = width,
+ height = height,
+ depth = depth,
+ type = "mp",
+ line = data.rulethickness,
+ data = mp,
+ ma = ma,
+ ca = ca,
+ ta = ta,
+ option = location,
+ direction = getdirection(current),
+ }
+ else
+ return setcoloring(new_rule(width,height,depth),ma,ca,ta)
+ end
end
-end
-function linefillers.filler(current,data,width,height,depth)
- if width and width > 0 then
- local height = height or data.height or 0
- local depth = depth or data.depth or 0
- if (height + depth) ~= 0 then
- local mp = data.mp
- local ma = data.ma
- local ca = data.ca
- local ta = data.ta
- if mp and mp ~= "" then
- return usernutrule {
- width = width,
- height = height,
- depth = depth,
- type = "mp",
- line = data.rulethickness,
- data = mp,
- ma = ma,
- ca = ca,
- ta = ta,
- option = location,
- direction = getdirection(current),
- }
- else
- return setcoloring(new_rule(width,height,depth),ma,ca,ta)
+ function linefillers.filler(current,data,width,height,depth)
+ if width and width > 0 then
+ local height = height or data.height or 0
+ local depth = depth or data.depth or 0
+ if (height + depth) ~= 0 then
+ local mp = data.mp
+ local ma = data.ma
+ local ca = data.ca
+ local ta = data.ta
+ if mp and mp ~= "" then
+ return usernutrule {
+ width = width,
+ height = height,
+ depth = depth,
+ type = "mp",
+ line = data.rulethickness,
+ data = mp,
+ ma = ma,
+ ca = ca,
+ ta = ta,
+ option = location,
+ direction = getdirection(current),
+ }
+ else
+ return setcoloring(new_rule(width,height,depth),ma,ca,ta)
+ end
end
end
end
-end
-local function getskips(list) -- this could be a helper
- local ls = nil
- local rs = nil
- local is = nil
- local pl = nil
- local pr = nil
- local ok = false
- for n, subtype in nextglue, list do
- if subtype == rightskip_code then
- rs = n
- elseif subtype == parfillrightskip_code then
- pr = n
- elseif subtype == leftskip_code then
- ls = n
- elseif subtype == indentskip_code then
- is = n
- elseif subtype == parfillleftskip_code then
- pl = n
+ local function getskips(list) -- this could be a helper
+ local ls = nil
+ local rs = nil
+ local is = nil
+ local pl = nil
+ local pr = nil
+ local ok = false
+ for n, subtype in nextglue, list do
+ if subtype == rightskip_code then
+ rs = n
+ elseif subtype == parfillrightskip_code then
+ pr = n
+ elseif subtype == leftskip_code then
+ ls = n
+ elseif subtype == indentskip_code then
+ is = n
+ elseif subtype == parfillleftskip_code then
+ pl = n
+ end
end
+ return is, ls, pl, pr, rs
end
- return is, ls, pl, pr, rs
-end
-function linefillers.handler(head)
- -- we have a normalized line ..
- for current, id, subtype, list in nextlist, head do
- if subtype == linelist_code and list then
- local a = getattr(current,a_linefiller)
- if a then
- local class = a % 1000
- local data = data[class]
- if data then
- local location = data.location
- local scope = data.scope
- local distance = data.distance
- local threshold = data.threshold
- local leftlocal = false
- local rightlocal = false
- --
- if scope == v_right then
- leftlocal = true
- elseif scope == v_left then
- rightlocal = true
- elseif scope == v_local then
- leftlocal = true
- rightlocal = true
- end
- --
- local is, ls, pl, pr, rs = getskips(list)
- if ls and rs then
- if location == v_left or location == v_both then
- local indentation = is and getwidth(is) or 0
- local leftfixed = ls and getwidth(ls) or 0
- local lefttotal = ls and effective_glue(ls,current) or 0
- local width = lefttotal - (leftlocal and leftfixed or 0) + indentation - distance
- if width > threshold then
- if is then
- setwidth(is,0)
- end
- setglue(ls,leftlocal and getwidth(ls) or nil)
- if distance > 0 then
- insert_node_after(list,ls,new_kern(distance))
- end
- insert_node_after(list,ls,linefiller(current,data,width,"left"))
+ linefillers.handler = function(head)
+ local data = attributes.values[a_linefiller]
+ if data then
+ -- we have a normalized line ..
+ for current, id, subtype, list in nextlist, head do
+ if subtype == linelist_code and list then
+ local a = getattr(current,a_linefiller)
+ if a then
+ local data = data[a]
+ if data then
+ local location = data.location
+ local scope = data.scope
+ local distance = data.distance
+ local threshold = data.threshold
+ local leftlocal = false
+ local rightlocal = false
+ --
+ if scope == v_right then
+ leftlocal = true
+ elseif scope == v_left then
+ rightlocal = true
+ elseif scope == v_local then
+ leftlocal = true
+ rightlocal = true
end
- end
- --
- if location == v_right or location == v_both then
- local rightfixed = rs and getwidth(rs) or 0
- local righttotal = rs and effective_glue(rs,current) or 0
- local parfixed = pr and getwidth(pr) or 0
- local partotal = pr and effective_glue(pr,current) or 0
- local width = righttotal - (rightlocal and rightfixed or 0) + partotal - distance
- if width > threshold then
- if pr then
- setglue(pr)
+ -- todo: initleft initright fillleft
+ local is, ls, pl, pr, rs = getskips(list)
+ if ls and rs then
+ if location == v_left or location == v_both then
+ local indentation = is and getwidth(is) or 0
+ local leftfixed = ls and getwidth(ls) or 0
+ local lefttotal = ls and effectiveglue(ls,current) or 0
+ local width = lefttotal - (leftlocal and leftfixed or 0) + indentation - distance
+ if width > threshold then
+ if is then
+ setwidth(is,0)
+ end
+ setglue(ls,leftlocal and getwidth(ls) or nil)
+ if distance > 0 then
+ insertnodeafter(list,ls,new_kern(distance))
+ end
+ insertnodeafter(list,ls,linefiller(current,data,width,"left"))
+ end
end
- setglue(rs,rightlocal and getwidth(rs) or nil)
- if distance > 0 then
- insert_node_before(list,rs,new_kern(distance))
+ --
+ if location == v_right or location == v_both then
+ local rightfixed = rs and getwidth(rs) or 0
+ local righttotal = rs and effectiveglue(rs,current) or 0
+ local parfixed = pr and getwidth(pr) or 0
+ local partotal = pr and effectiveglue(pr,current) or 0
+ local width = righttotal - (rightlocal and rightfixed or 0) + partotal - distance
+ if width > threshold then
+ if pr then
+ setglue(pr)
+ end
+ setglue(rs,rightlocal and getwidth(rs) or nil)
+ if distance > 0 then
+ insertnodebefore(list,rs,new_kern(distance))
+ end
+ insertnodebefore(list,rs,linefiller(current,data,width,"right"))
+ end
end
- insert_node_before(list,rs,linefiller(current,data,width,"right"))
+ else
+ -- error, not a properly normalized line
end
end
- else
- -- error, not a properly normalized line
end
end
end
end
+ return head
end
- return head
-end
-
-local enable = false
-
-function linefillers.enable()
- if not enable then
- -- we could now nil it
- enableaction("finalizers","nodes.linefillers.handler")
- enable = true
- end
-end
-
--- interface
-
-implement {
- name = "definerule",
- actions = { rules.define, context },
- arguments = {
- {
- { "continue" },
- { "unit" },
- { "order" },
- { "method", "integer" },
- { "offset", "number" },
- { "rulethickness" },
- { "dy", "number" },
- { "max", "number" },
- { "ma", "integer" },
- { "ca", "integer" },
- { "ta", "integer" },
- { "mp" },
- { "empty" },
- { "text", "integer" },
- { "repeat" },
- }
- }
-}
-implement {
- name = "enablerules",
- onlyonce = true,
- actions = rules.enable
-}
-
-implement {
- name = "defineshift",
- actions = { shifts.define, context },
- arguments = {
- {
- { "continue" },
- { "unit" },
- { "method", "integer" },
- { "dy", "number" },
+ implement {
+ name = "setlinefiller",
+ actions = linefillers.set,
+ arguments = {
+ {
+ { "method", "integer" },
+ { "location", "string" },
+ { "scope", "string" },
+ { "mp", "string" },
+ { "ma", "integer" },
+ { "ca", "integer" },
+ { "ta", "integer" },
+ { "depth", "dimension" },
+ { "height", "dimension" },
+ { "distance", "dimension" },
+ { "threshold", "dimension" },
+ { "rulethickness", "dimension" },
+ }
}
}
-}
-implement {
- name = "enableshifts",
- onlyonce = true,
- actions = shifts.enable
-}
-
-implement {
- name = "definelinefiller",
- actions = { linefillers.define, context },
- arguments = {
- {
- { "method", "integer" },
- { "location", "string" },
- { "scope", "string" },
- { "mp", "string" },
- { "ma", "integer" },
- { "ca", "integer" },
- { "ta", "integer" },
- { "depth", "dimension" },
- { "height", "dimension" },
- { "distance", "dimension" },
- { "threshold", "dimension" },
- { "rulethickness", "dimension" },
- }
- }
-}
-
-implement {
- name = "enablelinefillers",
- onlyonce = true,
- actions = linefillers.enable
-}
+end
-- We add a bonus feature here (experiment):
interfaces.implement {
name = "autorule",
+ protected = true,
+ public = true,
arguments = {
{
{ "width", "dimension" },
@@ -706,9 +712,9 @@ interfaces.implement {
},
actions = function(t)
local n = new_rule(
- t.width or running,
- t.height or running,
- t.depth or running
+ t.width or runningrule,
+ t.height or runningrule,
+ t.depth or runningrule
)
setattrlist(n,true)
setoffsets(n,t.xoffset,t.yoffset) -- ,t.left, t.right
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-rul.mkxl b/Master/texmf-dist/tex/context/base/mkxl/node-rul.mkxl
index 2b55561d85d..04c0e0dc30a 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/node-rul.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-rul.mkxl
@@ -71,102 +71,98 @@
%definesystemattribute[ruled]
%definesystemattribute[shifted]
-\registerctxluafile{node-rul}{autosuffix,optimize}
+\newdimension\d_rule_width
+\newdimension\d_rule_height
+\newdimension\d_rule_depth
+\newdimension\d_rule_h
+\newdimension\d_rule_v
+\newdimension\d_rule_line
+\newdimension\d_rule_offset
+\newdimension\d_rule_factor
+
+\mutable\lettonothing\m_rule_direction
+%mutable\lettonothing\m_rule_factor
+\mutable\lettonothing\m_rule_option
+\mutable\lettonothing\m_rule_color
+
+\registerctxluafile{node-rul}{autosuffix}
\installcorenamespace{bar}
-\installcorenamespace{barindex}
-\installcorenamespace{barattribute}
\installcorenamespace{barstack}
\installcommandhandler \??bar {bar} \??bar
-\newtoks\t_node_rules_checklist
-
-\mutable\let\c_node_rules_index\relax % temporary synonym (can be shared)
-\mutable\let\p_node_rules_color\empty
+\mutable\lettonothing\p_node_color % of just \p_*
+\mutable\lettonothing\p_node_text
+\mutable\lettonothing\p_node_offset
\aliased\let\setupbars\setupbar
\appendtoks
- \ifempty\currentbar
- \the\t_node_rules_checklist
- \else
- \node_rules_define
- \fi
-\to \everysetupbar
-
-\appendtoks
- \ifcsname\??barindex\currentbar\endcsname
- \lastnamedcs\zerocount
- \else
- \expandafter\newcount\csname\??barindex\currentbar\endcsname
- \fi
- % \normalexpanded{\t_node_rules_checklist{\node_rules_redefine{\currentbar}\the\t_node_rules_checklist}}%
- \normalexpanded{\t_node_rules_checklist{\the\t_node_rules_checklist\relax\node_rules_redefine{\currentbar}}}%
- % \etoksapp\t_node_rules_checklist{\node_rules_redefine{\currentbar}}%
- \node_rules_define
- \frozen\instance\setuevalue\currentbar{\node_rules_direct{\currentbar}}%
+ \frozen\protected\instance\edefcsname\currentbar\endcsname{\node_rules_direct{\currentbar}}%
\to \everydefinebar
-\newbox\b_node_rules
+% \protected\def\node_rules_direct#1%
+% {\groupedcommand
+% {\node_rules_set{#1}\barparameter\c!left}%
+% {\relax\barparameter\c!right}}
-\protected\def\node_rules_define
- {\edef\p_node_rules_color{\barparameter\c!color}%
- \edef\p_node_text{\barparameter\c!text}%
- \ifempty\p_node_text\else
- \setbox\b_node_rules\hbox{\p_node_text}%
- \fi
- \expandafter\integerdef\csname\??barattribute\currentbar\endcsname
- \clf_definerule
+\protected\def\node_rules_direct#1%
+ {\groupedcommand
+ {\dontleavehmode % this should not be needed but it is in \bTD
+ \node_rules_set{#1}%
+ \barparameter\c!left
+ }%\ignorespaces}%
+ {%\removeunwantedspaces
+ \barparameter\c!right}}
+
+\permanent\protected\def\inlinebar[#1]%
+ {\node_rules_direct{#1}}
+
+%D \overbar{Ãœber} \underbar{Unterstrich \underbar{steigt \overbar{auf} den \underbar{Unterberg}}}.
+%D
+%D \underbar {\underbar {\samplefile{tufte}}}\par
+%D \underbar {\underdot {\samplefile{tufte}}}\par
+%D \underbar {\underdot {\samplefile{tufte}}}\par
+%D \underdot {\underbar {\samplefile{tufte}}}\par
+%D \underbars{\underdot {\samplefile{tufte}}}\par
+%D \underbar {\underdots{\samplefile{tufte}}}\par
+%D \underdots{\underdots{\samplefile{tufte}}}\par
+
+\newinteger\c_node_rules_nesting % todo: same as colors
+\newinteger\c_node_rules_level
+\newinteger\c_node_rules_up
+\newinteger\c_node_rules_down
+
+\permanent\protected\def\node_rules_set#1%
+ {\edef\currentbar{#1}%
+ \advanceby\c_node_rules_level\plusone
+ \usebarstyleandcolor\c!foregroundstyle\c!foregroundcolor
+ \edef\p_node_color {\barparameter\c!color}% todo
+ \edef\p_node_text {\barparameter\c!text}%
+ \edef\p_node_offset{\barparameter\c!offset}%
+ % better is a dedicated key: up/down .. todo
+ \advanceby\ifdim\p_node_offset\onepoint<\zeropoint\c_node_rules_down\else\c_node_rules_up\fi\plusone
+ \clf_setrule
continue {\barparameter\c!continue}%
unit {\barparameter\c!unit}%
order {\barparameter\c!order}%
+ level \c_node_rules_level
+ stack \ifdim\p_node_offset\onepoint<\zeropoint\c_node_rules_down\else\c_node_rules_up\fi
rulethickness {\barparameter\c!rulethickness}%
method \barparameter\c!method
max \barparameter\c!max\space % number
- mp {\includeMPgraphic{\barparameter\c!mp}}
+ mp {\includeMPgraphic{\barparameter\c!mp}}
ma \c_attr_colormodel
- ca \rawcolorattribute\p_node_rules_color
- ta \rawtransparencyattribute\p_node_rules_color
- offset \barparameter\c!offset\space % number
- dy \barparameter\c!dy\space % number
- empty {\barparameter\c!empty}%
+ ca \rawcolorattribute\p_node_color
+ ta \rawtransparencyattribute\p_node_color
+ offset \p_node_offset\space % number
+ dy \barparameter\c!dy\space % number, also fraction
+ empty {\barparameter\c!empty}%
\ifempty\p_node_text\else
- % not that useful and efficient, more for testing something
- text \b_node_rules
- repeat {\barparameter\c!repeat}%
+ text \hbox{\p_node_text}%
+ repeat {\barparameter\c!repeat}%
\fi
- \relax
- \relax}
-
-\protected\def\node_rules_redefine#1%
- {\def\currentbar{#1}\node_rules_define}
-
-\protected\def\node_rules_direct#1%
- {\groupedcommand
- {\node_rules_set{#1}\barparameter\c!left}%
- {\relax\barparameter\c!right}}
-
-\permanent\protected\def\inlinebar[#1]%
- {\node_rules_direct{#1}}
-
-% \protected\def\inlinecurrentbar
-% {\node_rules_direct{\currentbar}}
-
-% store in properties
-
-\permanent\protected\def\node_rules_set#1% maybe reverse the 1000 (also maybe use more attributes instead of settings)
- {\edef\currentbar{#1}%
- \usebarstyleandcolor\c!foregroundstyle\c!foregroundcolor
- % maybe: \usebarstyleandcolor\c!textgroundstyle\c!textcolor
- % todo: move this to lua .. we callout anyway
- \expandafter\let\expandafter\c_node_rules_index\csname\??barindex#1\endcsname
- \advance\c_node_rules_index\plusone
- \clf_enablerules % will be relaxed
- \c_attr_ruled\numexpr
- \plusthousand*\c_node_rules_index
- % optimizing this one needs testing
- +\csname\??barattribute#1\ifcsname\??bar#1:\number\c_node_rules_index\s!parent\endcsname:\number\c_node_rules_index\fi\endcsname
\relax}
\permanent\protected\def\resetbar
@@ -193,22 +189,23 @@
\aliased\let\directsetbar\node_rules_set
-% ungrouped
-
-\newcount\c_node_rules_nesting % todo: same as colors
+% ungrouped % todo: use the lua based stacker
\permanent\protected\def\pushbar[#1]%
- {\global\advance\c_node_rules_nesting\plusone
- \edefcsname\??barstack\number\c_node_rules_nesting\endcsname{\c_attr_ruled\the\c_attr_ruled}%
+ {\global\advanceby\c_node_rules_nesting\plusone
+ \edefcsname\??barstack\number\c_node_rules_nesting\endcsname
+ {\c_node_rules_level\the\c_node_rules_level
+ \c_attr_ruled \the\c_attr_ruled}%
\node_rules_set{#1}}
\permanent\protected\def\popbar
- {\csname\??barstack\number\c_node_rules_nesting\endcsname
- \global\advance\c_node_rules_nesting\minusone}
+ {\csname\??barstack\number\c_node_rules_nesting\endcsname\relax
+ \global\advanceby\c_node_rules_nesting\minusone}
\setupbars
[\c!method=0, % new: 0=center nested, 1=stack nested
\c!continue=\v!no,
+ \c!level=\v!yes,
\c!empty=, % new: yes = hide text
\c!offset=0, % upwards, replaces: topoffset bottomoffset
\c!dy=0,
@@ -341,74 +338,43 @@
\definebar
[undergraphic]
[\c!mp=rules:under:dash,
+ \c!level=\v!auto,
\c!offset=-.2,
+ \c!dy=.4,
+ \c!continue=\v!yes,
\c!order=\v!background]
-\definebar[underrandom] [undergraphic][\c!mp=rules:under:random]
-\definebar[underrandoms][underrandom] [\c!continue=\v!yes]
+\definebar[underrandom] [undergraphic][\c!mp=rules:under:random,]
+\definebar[underrandoms][underrandom] [\c!continue=\v!no]
\definebar[underdash] [undergraphic][\c!mp=rules:under:dash]
-\definebar[underdashes] [underdash] [\c!continue=\v!yes]
+\definebar[underdashes] [underdash] [\c!continue=\v!no]
\definebar[underdot] [undergraphic][\c!mp=rules:under:dots]
-\definebar[underdots] [underdot] [\c!continue=\v!yes]
+\definebar[underdots] [underdot] [\c!continue=\v!no]
%D This will move: (a bit duplicated)
\installcorenamespace{shift}
-\installcorenamespace{shiftindex}
-\installcorenamespace{shiftattribute}
\installcommandhandler \??shift {shift} \??shift
-\newtoks\t_node_shifts_checklist
-
-\mutable\let\c_node_shifts_index\relax % temporary synonym (can be shared)
-
\let\setupshifts\setupshift
\appendtoks
- \ifempty\currentshift
- \the\t_node_shifts_checklist
- \else
- \node_shifts_define
- \fi
-\to \everysetupshift
-
-\appendtoks
- \ifcsname\??shiftindex\currentshift\endcsname
- \lastnamedcs\zerocount
- \else
- \expandafter\newcount\csname\??shiftindex\currentshift\endcsname
- \fi
- \normalexpanded{\t_node_shifts_checklist{\the\t_node_shifts_checklist\node_shifts_redefine{\currentshift}}}% order ?
- \node_shifts_define
- \frozen\instance\setuevalue\currentshift{\node_shifts_direct{\currentshift}}%
+ \frozen\protected\instance\edefcsname\currentshift\endcsname{\node_shifts_direct{\currentshift}}%
\to \everydefineshift
-\protected\def\node_shifts_define
- {\setevalue{\??shiftattribute\currentshift}{\number
- \clf_defineshift
- continue {\shiftparameter\c!continue}%
- unit {\shiftparameter\c!unit}%
- method \shiftparameter\c!method
- dy \shiftparameter\c!dy % number
- \relax}}
-
-\protected\def\node_shifts_redefine#1%
- {\def\currentshift{#1}\node_shifts_define}
-
\protected\def\node_shifts_set#1% todo: check parent ! todo: move attr etc to lua
{\def\currentshift{#1}%
- \expandafter\let\expandafter\c_node_shifts_index\csname\??shiftindex#1\endcsname
- \advance\c_node_shifts_index\plusone
- \clf_enableshifts % will be relaxed
- \c_attr_shifted\numexpr
- \plusthousand*\c_node_shifts_index
- +\csname\??shiftattribute#1\ifcsname\??shift#1:\number\c_node_shifts_index\s!parent\endcsname:\number\c_node_shifts_index\fi\endcsname
- \relax
\useshiftstyleandcolor\c!style\c!color
- \dosetupisolatedalign{\shiftparameter\c!align}} % weird feature that i probably needed once
+ \dosetupisolatedalign{\shiftparameter\c!align}% a weird feature that i probably needed once
+ \clf_setshift
+ continue {\shiftparameter\c!continue}%
+ unit {\shiftparameter\c!unit}%
+ method \shiftparameter\c!method
+ dy \shiftparameter\c!dy % number
+ \relax}
\permanent\protected\def\startshift[#1]%
{\begingroup
@@ -438,8 +404,8 @@
% we want these always so ...
-\expandafter\let\expandafter\shiftup \csname\v!shiftup \endcsname
-\expandafter\let\expandafter\shiftdown \csname\v!shiftdown \endcsname
+\expandafter\let\expandafter\shiftup \csname\v!shiftup \endcsname
+\expandafter\let\expandafter\shiftdown\csname\v!shiftdown\endcsname
% This is a weird helper.. these might go away:
@@ -463,67 +429,29 @@
% Phillips on drums). The Amsterdam concert is equally energizing.
\installcorenamespace{linefiller}
-\installcorenamespace{linefillerindex}
-\installcorenamespace{linefillerattribute}
\installcommandhandler \??linefiller {linefiller} \??linefiller
\definesystemattribute[linefiller][public]
-\newtoks\t_node_linefiller_checklist
-
-\mutable\let\c_node_linefiller_index\relax % temporary synonym (can be shared)
-
\aliased\let\setuplinefillers\setuplinefiller
-\appendtoks
- \ifempty\currentlinefiller
- \the\t_node_linefiller_checklist
- \else
- \node_linefiller_define
- \fi
-\to \everysetuplinefiller
-
-\appendtoks
- \ifcsname\??linefillerindex\currentlinefiller\endcsname
- \lastnamedcs\zerocount
- \else
- \expandafter\newcount\csname\??linefillerindex\currentlinefiller\endcsname
- \fi
- \etoksapp\t_node_linefiller_checklist{\t_node_linefiller_checklist\node_linefiller_redefine{\currentlinefiller}}%
- \node_linefiller_define
-\to \everydefinelinefiller
-
-\protected\def\node_linefiller_define
- {\edef\p_node_rules_color{\linefillerparameter\c!color}%
- \expandafter\integerdef\csname\??linefillerattribute\currentlinefiller\endcsname
- \clf_definelinefiller
+\protected\def\node_linefiller_set#1% todo: check parent ! todo: move attr etc to lua
+ {\def\currentlinefiller{#1}%
+ \edef\p_node_color{\linefillerparameter\c!color}%
+ \clf_setlinefiller
%method \linefillerparameter\c!method
location {\linefillerparameter\c!location}%
scope {\linefillerparameter\c!scope}%
mp {\includeMPgraphic{\linefillerparameter\c!mp}}%
ma \c_attr_colormodel
- ca \rawcolorattribute\p_node_rules_color
- ta \rawtransparencyattribute\p_node_rules_color
+ ca \rawcolorattribute\p_node_color
+ ta \rawtransparencyattribute\p_node_color
height \dimexpr\linefillerparameter\c!height\relax
depth \dimexpr\linefillerparameter\c!depth\relax
distance \dimexpr\linefillerparameter\c!distance\relax
threshold \dimexpr\linefillerparameter\c!threshold\relax
rulethickness \dimexpr\linefillerparameter\c!rulethickness\relax
- \relax
- \relax}
-
-\protected\def\node_linefiller_redefine#1%
- {\def\currentlinefiller{#1}\node_linefiller_define}
-
-\protected\def\node_linefiller_set#1% todo: check parent ! todo: move attr etc to lua
- {\def\currentlinefiller{#1}%
- \expandafter\let\expandafter\c_node_linefiller_index\csname\??linefillerindex#1\endcsname
- \advance\c_node_linefiller_index\plusone
- \clf_enablelinefillers
- \c_attr_linefiller\numexpr
- \plusthousand*\c_node_linefiller_index
- +\csname\??linefillerattribute#1\ifcsname\??linefiller#1:\number\c_node_linefiller_index\s!parent\endcsname:\number\c_node_linefiller_index\fi\endcsname
\relax}
\permanent\tolerant\protected\def\startlinefiller[#1]#*[#2]%
@@ -594,7 +522,6 @@
\node_linefiller_set{#3}% already sets the attribute
#1%
attr \backgroundattribute \plusone
- % attr \linefillerattribute \the\c_attr_linefiller
{\box\nextbox}%
\egroup}%
#2}
@@ -605,6 +532,6 @@
%D Bonus:
-\permanent\protected\def\autorule{\clf_autorule} % todo: public implementor
+% \autorule : defined at the lua end
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-scn.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-scn.lmt
index 0ec1ba387c9..1530174c22a 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/node-scn.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-scn.lmt
@@ -21,8 +21,6 @@ local getsubtype = nuts.getsubtype
local getlist = nuts.getlist
local setlist = nuts.setlist
-local end_of_math = nuts.end_of_math
-
local nodecodes = nodes.nodecodes
local gluecodes = nodes.gluecodes
local kerncodes = nodes.kerncodes
@@ -43,6 +41,8 @@ local userskip_code = gluecodes.userskip
local spaceskip_code = gluecodes.spaceskip
local xspaceskip_code = gluecodes.xspaceskip
local leaders_code = gluecodes.leaders
+local rightfillskip_code = gluecodes.rightparfillskip
+local righthangskip_code = gluecodes.righthangskip
local fontkern_code = kerncodes.fontkern
@@ -113,17 +113,54 @@ nuts.striprange = striprange
-- todo: switching inside math
--- handlers
+-- handlers (some are very specialized and demanding)
+
+local maxlevel = 1
-local function processwords(attribute,data,flush,head,parent,skip) -- we have hlistdir and local dir
+local function processwords(nesting,attribute,data,flush,head,parent,skip) -- we have hlistdir and local dir
local n = head
if n then
- local f, l, a, d, i, class
- local continue, leaders, done, strip, level = false, false, false, true, -1
+ local f, l, a, d, class
+ local continue, leaders, strip, level = false, false, true, -1
while n do
local id = getid(n)
- if id == glyph_code or id == rule_code or (id == hlist_code and getattr(n,a_runningtext)) then
+ if id == glyph_code
+ or id == rule_code
+ or (id == hlist_code and getattr(n,a_runningtext))
+ or id == disc_code
+ or id == boundary_code
+ then
local aa = getattr(n,attribute)
+ -- new approach
+ local dd, ll
+ if aa then
+ dd = data[aa]
+ ll = dd.level or 1
+ if nesting == 1 and ll > maxlevel then
+ maxlevel = ll
+ end
+ if ll == nesting then
+ -- we're okay
+ else
+ while true do
+ local nestingvalue = dd.nestingvalue
+ if nestingvalue then
+ dd = dd.nestingdata
+ ll = dd.level
+ if ll == nesting then
+ aa = nestingvalue
+ break
+ end
+ else
+ -- no matching level found
+ aa = nil
+ dd = nil
+ break
+ end
+ end
+ end
+ end
+ -- old approach
if aa and aa ~= skip then
if aa == a then
if not f then -- ?
@@ -131,101 +168,121 @@ local function processwords(attribute,data,flush,head,parent,skip) -- we have hl
end
l = n
else
- -- possible extensions: when in same class then keep spanning
- local newlevel, newclass = floor(aa/1000), aa%1000 -- will be configurable
- -- strip = not continue or level == 1 -- 0
if f then
- if class == newclass then -- and newlevel > level then
- head, done = flush(head,f,l,d,level,parent,false), true
+ if class == aa then -- and newlevel > level then
+ head = flush(head,f,l,d,level,parent,false)
else
- head, done = flush(head,f,l,d,level,parent,strip), true
+ head = flush(head,f,l,d,level,parent,strip)
end
end
f, l, a = n, n, aa
- level, class = newlevel, newclass
- d = data[class]
+ d = dd
+ class = aa
if d then
- local c = d.continue
- leaders = c == v_all
- continue = leaders or c == v_yes
+ continue = d.continue
+ level = d.level or 1
+ leaders = continue == v_all
+ continue = leaders or continue == v_yes
else
continue = true
+ level = 1
+ leaders = false
end
end
else
if f then
- head, done = flush(head,f,l,d,level,parent,strip), true
+ head = flush(head,f,l,d,level,parent,strip)
end
f, l, a = nil, nil, nil
end
if id == hlist_code then
local list = getlist(n)
if list then
- setlist(n,(processwords(attribute,data,flush,list,n,aa))) -- watch ()
+ setlist(n,processwords(nesting,attribute,data,flush,list,n,aa))
end
end
- elseif id == disc_code or id == boundary_code then
- if f then
- l = n
- end
- elseif id == kern_code and getsubtype(n) == fontkern_code then
- if f then
- l = n
+ goto next
+ -- elseif id == disc_code or id == boundary_code then
+ -- if f then
+ -- l = n
+ -- end
+ -- goto next
+ elseif id == kern_code then
+ if getsubtype(n) == fontkern_code then
+ if f then
+ l = n
+ end
+ goto next
+ else
+ goto rest
end
elseif id == math_code then
-- otherwise not consistent: a $b$ c vs a $b+c$ d etc
-- we need a special (optional) go over math variant
if f then
- head, done = flush(head,f,l,d,level,parent,strip), true
+ head = flush(head,f,l,d,level,parent,strip)
f, l, a = nil, nil, nil
end
+ goto next
elseif id == hlist_code or id == vlist_code then
if f then
- head, done = flush(head,f,l,d,level,parent,strip), true
+ head = flush(head,f,l,d,level,parent,strip)
f, l, a = nil, nil, nil
end
local list = getlist(n)
if list then
- setlist(n,(processwords(attribute,data,flush,list,n,skip))) -- watch ()
+ setlist(n,processwords(nesting,attribute,data,flush,list,n,skip))
end
+ goto next
elseif id == dir_code then -- only changes in dir, we assume proper boundaries
if f then
l = n
end
- elseif f then
+ goto next
+ end
+ ::rest::
+ if f then
if continue then
if id == penalty_code then
l = n
+ goto next
-- elseif id == kern_code then
-- l = n
+ -- goto next
elseif id == glue_code then
-- catch \underbar{a} \underbar{a} (subtype test is needed)
local subtype = getsubtype(n)
if getattr(n,attribute) and (subtype == userskip_code or subtype == spaceskip_code or subtype == xspaceskip_code or (leaders and subtype >= leaders_code)) then
l = n
else
- head, done = flush(head,f,l,d,level,parent,strip), true
+ head = flush(head,f,l,d,level,parent,strip)
f, l, a = nil, nil, nil
end
end
else
- head, done = flush(head,f,l,d,level,parent,strip), true
+ head = flush(head,f,l,d,level,parent,strip)
f, l, a = nil, nil, nil
end
end
+ ::next::
n = getnext(n)
end
if f then
- head, done = flush(head,f,l,d,level,parent,strip), true
+ head = flush(head,f,l,d,level,parent,strip)
end
- return head, true -- todo: done
- else
- return head, false
end
+ return head
end
nuts.processwords = function(attribute,data,flush,head,parent) -- we have hlistdir and local dir
- return processwords(attribute,data,flush,head,parent)
+ -- print("processing words at level "..1)io.flush()
+ maxlevel = 1
+ head = processwords(1,attribute,data,flush,head,parent)
+ for i=2,maxlevel do
+ -- print("processing words at level "..i)io.flush()
+ head = processwords(i,attribute,data,flush,head,parent)
+ end
+ return head
end
-- works on lines !
@@ -235,12 +292,11 @@ local function processranges(attribute,flush,head,parent,depth,skip)
local n = head
if n then
local f, l, a
- local done = false
while n do
local id = getid(n)
if id == glyph_code or id == rule_code then
local aa = getattr(n,attribute)
--- if aa and (not skip or aa ~= skip) then
+ -- if aa and (not skip or aa ~= skip) then
if aa then
if aa == a then
if not f then
@@ -249,13 +305,13 @@ local function processranges(attribute,flush,head,parent,depth,skip)
l = n
else
if f then
- head, done = flush(head,f,l,a,parent,depth), true
+ head = flush(head,f,l,a,parent,depth)
end
f, l, a = n, n, aa
end
else
if f then
- head, done = flush(head,f,l,a,parent,depth), true
+ head = flush(head,f,l,a,parent,depth)
end
f, l, a = nil, nil, nil
end
@@ -265,16 +321,21 @@ local function processranges(attribute,flush,head,parent,depth,skip)
else
-- weird
end
- elseif id == kern_code and getsubtype(n) == fontkern_code then
- if f then
- l = n
+ elseif id == kern_code then
+ if getsubtype(n) == fontkern_code then
+ if f then
+ l = n
+ end
end
-- elseif id == penalty_code then
elseif id == glue_code then
-- todo: leaders
+-- if getsubtype(n) == rightfillskip_code or getsubtype(n) == righthangskip_code then
+-- break
+-- end
elseif id == hlist_code or id == vlist_code then
local aa = getattr(n,attribute)
--- if aa and (not skip or aa ~= skip) then
+ -- if aa and (not skip or aa ~= skip) then
if aa then
if aa == a then
if not f then
@@ -283,30 +344,28 @@ local function processranges(attribute,flush,head,parent,depth,skip)
l = n
else
if f then
- head, done = flush(head,f,l,a,parent,depth), true
+ head = flush(head,f,l,a,parent,depth), true
end
f, l, a = n, n, aa
end
else
if f then
- head, done = flush(head,f,l,a,parent,depth), true
+ head = flush(head,f,l,a,parent,depth), true
end
f, l, a = nil, nil, nil
end
local list = getlist(n)
if list then
- setlist(n,(processranges(attribute,flush,list,n,depth+1,aa)))
+ setlist(n,processranges(attribute,flush,list,n,depth+1,aa))
end
end
n = getnext(n)
end
if f then
- head, done = flush(head,f,l,a,parent,depth), true
+ head = flush(head,f,l,a,parent,depth)
end
- return head, done
- else
- return head, false
end
+ return head
end
nuts.processranges = function(attribute,flush,head,parent) -- we have hlistdir and local dir
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-ser.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-ser.lmt
index 8fcbb31e473..e45d7f2497a 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/node-ser.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-ser.lmt
@@ -6,6 +6,8 @@ if not modules then modules = { } end modules ['node-ser'] = {
license = "see context related readme files"
}
+-- needs to be updated (mayeb fetch field types)
+
local type, tostring = type, tostring
local concat, tohash, sortedkeys, sortedhash, printtable, serialize = table.concat, table.tohash, table.sortedkeys, table.sortedhash, table.print, table.serialize
local formatters, format, rep = string.formatters, string.format, string.rep
@@ -14,15 +16,11 @@ local allocate = utilities.storage.allocate
local context = context
local nodes = nodes
-local node = node
-
-local getfields = node.fields
-
-local is_node = nodes.is_node
+local getfields = nodes.fields
+local isnode = nodes.isnode
local nodecodes = nodes.nodecodes
local subtypes = nodes.subtypes
-
local tonode = nodes.tonode
local tonut = nodes.tonut
@@ -43,12 +41,11 @@ local canbezero = {
}
local canbelist = {
- attribute = "<attribute>",
- node = "<node>",
- token = "<token>",
- attribute_list = "<attributes>",
- node_list = "<nodes>",
- token_list = "<tokens>",
+ attribute = "<attribute>",
+ node = "<node>",
+ token = "<token>",
+ node_list = "<nodes>",
+ token_list = "<tokens>",
}
local canbeignored = {
@@ -56,9 +53,9 @@ local canbeignored = {
}
local canbechar = {
- char = true,
- small_char = true,
- large_char = true,
+ char = true,
+ smallchar = true,
+ largechar = true,
}
local fieldtypes = table.setmetatableindex(function(t,k)
@@ -69,16 +66,22 @@ end)
nodes.fieldtypes = fieldtypes
+-- todo: subtype zero too
+
local function astable(n)
n = tonode(n)
if n then
- local fields = fieldtypes[n.id]
+ local id = n.id
+ local fields = fieldtypes[id]
if fields then
- local result = { }
- for field, fieldtype in sortedhash(fields) do
+ local subtype = n.subtype
+ local result = { }
+ for field, fieldtype in sortedhash(fields) do -- no need to sort
local value = n[field]
if value then
- if canbeignored[field] then
+ if field == "subtype" then
+ -- we always show them now
+ elseif canbeignored[field] then
value = nil
elseif canbezero[fieldtype] and value == 0 then
value = nil
@@ -90,16 +93,12 @@ local function astable(n)
end
end
end
- local id = n.id
- if id then
- id = nodecodes[id]
- result.id = id
- local subtype = n.subtype
- if subtype then
- local subtypes = subtypes[id]
- if subtypes then
- result.subtype = subtypes[subtype]
- end
+ id = nodecodes[id]
+ result.id = id
+ if subtype then
+ local subtypes = subtypes[id]
+ if subtypes then
+ result.subtype = subtypes[subtype]
end
end
return result
@@ -109,7 +108,7 @@ end
nodes.astable = astable
-setinspector("node",function(v) if is_node(v) then printtable(astable(v),tostring(v)) return true end end)
+setinspector("node",function(v) if isnode(v) then printtable(astable(v),tostring(v)) return true end end)
local function to_table(n,flat,verbose,noattributes,done)
local d = tonut(n)
@@ -123,7 +122,7 @@ local function to_table(n,flat,verbose,noattributes,done)
for field, fieldtype in sortedhash(fields) do
local value = n[field]
if value then
- if fieldtype == "attribute_list" or fieldtype == "attribute" then
+ if fieldtype == "attribute" then
if noattributes then
result[value] = canbeignored[value]
else
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-shp.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-shp.lmt
index 64508ecc746..fc149330be6 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/node-shp.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-shp.lmt
@@ -28,13 +28,57 @@ local getbox = nuts.getbox
local implement = interfaces.implement
+local v_yes = interfaces.variables.yes
+
local actions = tasks.actions("shipouts")
+handlers.finalizelist = actions
+
function handlers.finalizebox(box)
actions(getbox(box)) -- nut
end
-handlers.cleanuppage = nuts.flatten_discretionaries
+function handlers.finalizelist(list) -- beware of export: block it if needed
+ actions(list) -- nut
+end
+
+do
+
+ local flattendiscretionaries = nuts.flattendiscretionaries
+ local softenhyphens = nuts.softenhyphens
+
+ local report = logs.reporter("shipout")
+
+ local trace = false trackers.register("backend.cleanup", function(v) trace = v end)
+
+ local flatten = true -- also done as line option
+ local soften = true -- true by default
+
+ nodes.handlers.cleanuppage = function(head)
+ -- local count = 0
+ local found = 0
+ local replaced = 0
+ if flatten then
+ head, count = flattendiscretionaries(head,true) -- nested
+ end
+ if soften then
+ head, found, replaced = softenhyphens(head) -- could have been a lua loop
+ end
+ if trace then
+ report("%i discretionaries flattened, %i of %i discretionary hyphens softened",count,replaced,found)
+ end
+ return head
+ end
+
+ implement {
+ name = "setsofthyphens",
+ arguments = "string",
+ actions = function(v)
+ soften = v == v_yes
+ end
+ }
+
+end
-- interface
@@ -113,3 +157,53 @@ statistics.register("node frequencies", function()
return format("saved in %q",filename)
end
end)
+
+do -- for the moment:
+
+ local whatsitcodes = nodes.whatsitcodes
+ local whatsit_code = nodecodes.whatsit
+
+ local removables = {
+ [whatsitcodes.open] = true,
+ [whatsitcodes.close] = true,
+ [whatsitcodes.write] = true,
+ [whatsitcodes.savepos] = true,
+ [whatsitcodes.latelua] = true,
+ }
+
+ local setlist = nuts.setlist
+ local getlist = nuts.getlist
+ local remove = nuts.remove
+
+ local function cleanup(head)
+ for current, id, subtype in nextnode, head do
+ if id == whatsit_code then
+ if removables[subtype] then
+ head = remove(head,current,true)
+ end
+ elseif id == hlist_code or id == vlist_code then
+ local sl = getlist(current)
+ if sl then
+ local rl = cleanup(sl)
+ if rl ~= sl then
+ setlist(current,rl)
+ end
+ end
+ end
+ end
+ return head
+ end
+
+ function handlers.cleanupbox(box)
+ cleanup(getbox(box))
+ end
+
+ implement {
+ name = "cleanupbox",
+ public = true,
+ protected = true,
+ actions = handlers.cleanupbox,
+ arguments = "integerargument"
+ }
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-syn.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-syn.lmt
index ce5f0d2ddf4..fe607bac8b9 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/node-syn.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-syn.lmt
@@ -125,10 +125,10 @@ if not modules then modules = { } end modules ['node-syn'] = {
-- Some generic (more clever code) has been removed as I don't see things change
-- that much.
-local type, rawset = type, rawset
+local type, rawset, rawget = type, rawset, rawget
local concat = table.concat
local formatters = string.formatters
-local replacesuffix, suffixonly, nameonly = file.replacesuffix, file.suffix, file.nameonly
+local replacesuffix, suffixonly, nameonly, collapsepath = file.replacesuffix, file.suffix, file.nameonly, file.collapsepath
local openfile, renamefile, removefile = io.open, os.rename, os.remove
local report_system = logs.reporter("system")
@@ -143,27 +143,24 @@ local getlist = nuts.getlist
local setlist = nuts.setlist
local getnext = nuts.getnext
local getwhd = nuts.getwhd
-local getwidth = nuts.getwidth
local getsubtype = nuts.getsubtype
local nodecodes = nodes.nodecodes
local kerncodes = nodes.kerncodes
+local nextnode = nuts.traversers.node
+
local glyph_code = nodecodes.glyph
local disc_code = nodecodes.disc
local glue_code = nodecodes.glue
local penalty_code = nodecodes.penalty
local kern_code = nodecodes.kern
------ rule_code = nodecodes.rule
local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
-local dir_code = nodecodes.dir
local fontkern_code = kerncodes.fontkern
-local cancel_code = nodes.dircodes.cancel
-
-local insert_before = nuts.insert_before
-local insert_after = nuts.insert_after
+local insertbefore = nuts.insertbefore
+local insertafter = nuts.insertafter
local nodepool = nuts.pool
local new_latelua = nodepool.latelua
@@ -173,29 +170,29 @@ local new_kern = nodepool.kern
local getdimensions = nuts.dimensions
local getrangedimensions = nuts.rangedimensions
-local getsynctexfields = nuts.getsynctexfields or nuts.get_synctex_fields
-local forcesynctextag = tex.forcesynctextag or tex.force_synctex_tag
-local forcesynctexline = tex.forcesynctexline or tex.force_synctex_line
-local getsynctexline = tex.getsynctexline or tex.get_synctex_line
-local setsynctexmode = tex.setsynctexmode or tex.set_synctex_mode
+local getinputfields = nuts.getinputfields
+local forceinputstatefile = tex.forceinputstatefile
+local forceinputstateline = tex.forceinputstateline
+local getinputstateline = tex.getinputstateline
+local setinputstatemode = tex.setinputstatemode
local foundintree = resolvers.foundintree
local getpagedimensions = layouts.getpagedimensions
-local eol = "\010"
+local eol <const> = "\010"
----- f_glue = formatters["g%i,%i:%i,%i\010"]
----- f_glyph = formatters["x%i,%i:%i,%i\010"]
----- f_kern = formatters["k%i,%i:%i,%i:%i\010"]
----- f_rule = formatters["r%i,%i:%i,%i:%i,%i,%i\010"]
----- f_form = formatters["f%i,%i,%i\010"]
-local z_hlist = "[0,0:0,0:0,0,0\010"
-local z_vlist = "(0,0:0,0:0,0,0\010"
------ z_xform = "<0,0:0,0,0\010" -- or so
-local s_hlist = "]\010"
-local s_vlist = ")\010"
------ s_xform = ">\010"
+local z_hlist <const> = "[0,0:0,0:0,0,0\010"
+local z_vlist <const> = "(0,0:0,0:0,0,0\010"
+----- z_xform <const> = "<0,0:0,0,0\010" -- or so
+local s_hlist <const> = "]\010"
+local s_vlist <const> = ")\010"
+----- s_xform <const> = ">\010"
local f_hlist_1 = formatters["h%i,%i:%i,%i:%i,%i,%i\010"]
local f_hlist_2 = formatters["h%i,%i:%i,%s:%i,%i,%i\010"]
local f_vlist_1 = formatters["v%i,%i:%i,%i:%i,%i,%i\010"]
@@ -213,7 +210,7 @@ local paused = 0
local used = false
local never = false
--- the file name stuff
+-- the file name stuff (called tags in synctex)
local noftags = 0
local stnums = { }
@@ -230,7 +227,8 @@ local blockedsuffixes = {
-- lfg = true,
}
-local sttags = table.setmetatableindex(function(t,name)
+local sttags = table.setmetatableindex(function(t,fullname)
+ local name = collapsepath(fullname)
if blockedsuffixes[suffixonly(name)] then
-- Just so that I don't get the ones on my development tree.
nofblocked = nofblocked + 1
@@ -246,6 +244,9 @@ local sttags = table.setmetatableindex(function(t,name)
else
noftags = noftags + 1
t[name] = noftags
+ if name ~= fullname then
+ t[fullname] = noftags
+ end
stnums[noftags] = name
return noftags
end
@@ -257,17 +258,17 @@ end
function synctex.setfilename(name,line)
if paused == 0 and name then
- forcesynctextag(sttags[name])
+ forceinputstatefile(sttags[name])
if line then
- forcesynctexline(line)
+ forceinputstateline(line)
end
end
end
function synctex.resetfilename()
if paused == 0 then
- forcesynctextag(0)
- forcesynctexline(0)
+ forceinputstatefile(0)
+ forceinputstateline(0)
end
end
@@ -279,10 +280,10 @@ do
function synctex.pushline()
nesting = nesting + 1
if nesting == 1 then
- local l = getsynctexline()
+ local l = getinputstateline()
ignored = l and l > 0
if not ignored then
- forcesynctexline(texget("inputlineno"))
+ forceinputstateline(texget("inputlineno"))
end
end
end
@@ -290,7 +291,7 @@ do
function synctex.popline()
if nesting == 1 then
if not ignored then
- forcesynctexline()
+ forceinputstateline()
ignored = false
end
end
@@ -334,6 +335,7 @@ local function flushpreamble()
makenames()
filehandle = openfile(tmpfile,"wb")
if filehandle then
+ filehandle:setvbuf("full",64*1024)
filehandle:write("SyncTeX Version:1",eol)
writefiles()
filehandle:write("Output:pdf",eol)
@@ -372,22 +374,60 @@ local function flushpostamble()
enabled = false
end
+-- local x_hlist do
+--
+-- local function doaction_1(t,l,w,h,d)
+-- local pagewidth, pageheight = getpagedimensions()
+-- local x, y = getpos()
+-- filehandle:write(f_hlist_1(t,l,x,pageheight-y,w,h,d))
+-- nofobjects = nofobjects + 1
+-- end
+--
+-- local lasty = false
+--
+-- local function doaction_2(t,l,w,h,d)
+-- local pagewidth, pageheight = getpagedimensions()
+-- local x, y = getpos()
+-- y = pageheight - y
+-- filehandle:write(f_hlist_2(t,l,x,y == lasty and "=" or y,w,h,d))
+-- lasty = y
+-- nofobjects = nofobjects + 1
+-- end
+--
+-- local doaction = doaction_1
+--
+-- x_hlist = function(head,current,t,l,w,h,d)
+-- if filehandle then
+-- return insertbefore(head,current,new_latelua(function() doaction(t,l,w,h,d) end))
+-- else
+-- return head
+-- end
+-- end
+--
+-- directives.register("system.synctex.compression", function(v)
+-- doaction = tonumber(v) == 2 and doaction_2 or doaction_1
+-- end)
+--
+-- end
+
+-- local pagewidth, pageheight
+
local x_hlist do
- local function doaction_1(t,l,w,h,d)
+ local function doaction_1(data)
local pagewidth, pageheight = getpagedimensions()
local x, y = getpos()
- filehandle:write(f_hlist_1(t,l,x,pageheight-y,w,h,d))
+ filehandle:write(f_hlist_1(data[1],data[2],x,pageheight-y,data[3],data[4],data[5]))
nofobjects = nofobjects + 1
end
local lasty = false
- local function doaction_2(t,l,w,h,d)
+ local function doaction_2(data)
local pagewidth, pageheight = getpagedimensions()
local x, y = getpos()
y = pageheight - y
- filehandle:write(f_hlist_2(t,l,x,y == lasty and "=" or y,w,h,d))
+ filehandle:write(f_hlist_2(t[1],data[2],x,y == lasty and "=" or y,data[3],data[3],data[5]))
lasty = y
nofobjects = nofobjects + 1
end
@@ -396,7 +436,7 @@ local x_hlist do
x_hlist = function(head,current,t,l,w,h,d)
if filehandle then
- return insert_before(head,current,new_latelua(function() doaction(t,l,w,h,d) end))
+ return insertbefore(head,current,new_latelua { action = doaction, t, l, w, h, d })
else
return head
end
@@ -432,8 +472,8 @@ local function inject(head,first,last,tag,line)
d = depth
end
if trace then
- head = insert_before(head,first,new_rule(w,fulltrace and h or traceheight,fulltrace and d or tracedepth))
- head = insert_before(head,first,new_kern(-w))
+ head = insertbefore(head,first,new_rule(w,fulltrace and h or traceheight,fulltrace and d or tracedepth))
+ head = insertbefore(head,first,new_kern(-w))
end
head = x_hlist(head,first,tag,line,w,h,d)
return head
@@ -450,7 +490,7 @@ local function collect_min(head)
local line = 0
while true do
if id == glyph_code then
- local tc, lc = getsynctexfields(current)
+ local tc, lc = getinputfields(current)
if tc and tc > 0 then
tag = tc
line = lc
@@ -499,8 +539,8 @@ local function inject(parent,head,first,last,tag,line)
d = depth
end
if trace then
- head = insert_before(head,first,new_rule(w,fulltrace and h or traceheight,fulltrace and d or tracedepth))
- head = insert_before(head,first,new_kern(-w))
+ head = insertbefore(head,first,new_rule(w,fulltrace and h or traceheight,fulltrace and d or tracedepth))
+ head = insertbefore(head,first,new_kern(-w))
end
head = x_hlist(head,first,tag,line,w,h,d)
return head
@@ -517,7 +557,7 @@ local function collect_max(head,parent)
local line = 0
while true do
if id == glyph_code then
- local tc, lc = getsynctexfields(current)
+ local tc, lc = getinputfields(current)
if tc and tc > 0 then
if tag > 0 and (tag ~= tc or line ~= lc) then
head = inject(parent,head,first,last,tag,line)
@@ -544,24 +584,6 @@ local function collect_max(head,parent)
last = current
end
elseif id == glue_code then
- if tag > 0 then
- local tc, lc = getsynctexfields(current)
- if tc and tc > 0 then
- if tag ~= tc or line ~= lc then
- head = inject(parent,head,first,last,tag,line)
- tag = 0
- break
- end
- else
- head = inject(parent,head,first,last,tag,line)
- tag = 0
- break
- end
- else
- tag = 0
- break
- end
- id = nil -- so no test later on
elseif id == penalty_code then
-- go on (and be nice for math)
else
@@ -617,6 +639,7 @@ function synctex.start()
filehandle:write("{",nofsheets,eol)
-- this seems to work:
local pagewidth, pageheight = getpagedimensions()
+-- pagewidth, pageheight = getpagedimensions()
filehandle:write(z_hlist)
filehandle:write(f_vlist_1(0,0,0,pageheight,pagewidth,pageheight,0))
end
@@ -647,7 +670,7 @@ end
function synctex.enable()
if not never and not enabled then
enabled = true
- setsynctexmode(3) -- we want details
+ setinputstatemode(3) -- we want details
if not used then
nodes.tasks.enableaction("shipouts","luatex.synctex.collect")
report_system("synctex functionality is enabled, expect 5-10 pct runtime overhead!")
@@ -656,12 +679,14 @@ function synctex.enable()
for i=1,#enablers do
enablers[i](true)
end
+ -- we have a different trigger moment in lmtx
+ flushpreamble()
end
end
function synctex.disable()
if enabled then
- setsynctexmode(0)
+ setinputstatemode(0)
report_system("synctex functionality is disabled!")
enabled = false
for i=1,#disablers do
@@ -685,13 +710,13 @@ local filename = nil
function synctex.pause()
paused = paused + 1
if enabled and paused == 1 then
- setsynctexmode(0)
+ setinputstatemode(0)
end
end
function synctex.resume()
if enabled and paused == 1 then
- setsynctexmode(3)
+ setinputstatemode(3)
end
paused = paused - 1
end
@@ -731,17 +756,23 @@ end
implement {
name = "synctexblockfilename",
arguments = "string",
+ protected = true,
+ public = true,
actions = synctex.blockfilename,
}
implement {
name = "synctexsetfilename",
arguments = "string",
+ protected = true,
+ public = true,
actions = synctex.setfilename,
}
implement {
name = "synctexresetfilename",
+ protected = true,
+ public = true,
actions = synctex.resetfilename,
}
diff --git a/Master/texmf-dist/tex/context/base/mkii/tabl-com.mkii b/Master/texmf-dist/tex/context/base/mkxl/node-syn.mkxl
index 8a0bb9e0c48..5dcd624d6c3 100644
--- a/Master/texmf-dist/tex/context/base/mkii/tabl-com.mkii
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-syn.mkxl
@@ -1,8 +1,8 @@
%D \module
-%D [ file=tabl-com,
-%D version=2009.08.22,
-%D title=\CONTEXT\ Table Macros,
-%D subtitle=Common Code,
+%D [ file=node-syn,
+%D version=2006.08.20, % moved to separate module
+%D title=\CONTEXT\ Node Macros,
+%D subtitle=Synctex,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
@@ -11,11 +11,10 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\writestatus{loading}{ConTeXt Table Macros / Common Code}
+\registerctxluafile{node-syn}{autosuffix}
\unprotect
-\let\NC\relax
-\let\NR\relax
+%D There is nothing defined at the \TEX\ end.
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-tex.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-tex.lmt
index aae084740dc..b856d5d4b0e 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/node-tex.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-tex.lmt
@@ -14,12 +14,13 @@ local nuts = nodes.nuts
local hyphenate = language.hyphenate
+local collapsing = nuts.collapsing
local hyphenating = nuts.hyphenating
local ligaturing = nuts.ligaturing
local kerning = nuts.kerning
-function kernel.hyphenation(head)
- return (hyphenate(head)) -- nodes !
+function kernel.collapsing(head)
+ return (collapsing(head)) -- for now we don't pass the three character numbers
end
function kernel.hyphenating(head)
@@ -34,6 +35,7 @@ function kernel.kerning(head)
return (kerning(head))
end
+callbacks.register('collapse' , false, "normal collapsing routine, called elsewhere")
callbacks.register('hyphenate' , false, "normal hyphenation routine, called elsewhere")
callbacks.register('ligaturing', false, "normal ligaturing routine, called elsewhere")
callbacks.register('kerning' , false, "normal kerning routine, called elsewhere")
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-tra.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-tra.lmt
index 6060522bec4..1ef1bb8ad78 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/node-tra.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-tra.lmt
@@ -52,7 +52,6 @@ local isglyph = nuts.isglyph
local getdirection = nuts.getdirection
local getwidth = nuts.getwidth
-local flush_list = nuts.flush_list
local count_nodes = nuts.countall
local used_nodes = nuts.usedlist
@@ -86,7 +85,7 @@ local whatsit_code = nodecodes.whatsit
local dimenfactors = number.dimenfactors
local formatters = string.formatters
-local start_of_par = nuts.start_of_par
+local startofpar = nuts.startofpar
-- this will be reorganized:
@@ -157,7 +156,7 @@ local function tosequence(start,stop,compact)
elseif id == dir_code then
local d, p = getdirection(start)
n = n + 1 ; t[n] = "[<" .. (p and "-" or "+") .. d .. ">]" -- todo l2r etc
- elseif id == par_code and start_of_par(current) then
+ elseif id == par_code and startofpar(current) then
n = n + 1 ; t[n] = "[<" .. getdirection(start) .. ">]" -- todo l2r etc
elseif compact then
n = n + 1 ; t[n] = "[]"
@@ -308,57 +307,64 @@ end
nodes.showsimplelist = function(h,depth) showsimplelist(h,depth,0) end
local function listtoutf(h,joiner,textonly,last,nodisc)
- local w = { }
- local n = 0
- local g = formatters["<%i>"]
- local d = formatters["[%s|%s|%s]"]
- while h do
- local c, id = isglyph(h)
- if c then
- n = n + 1 ; w[n] = c >= 0 and utfchar(c) or g(c)
- if joiner then
- n = n + 1 ; w[n] = joiner
- end
- elseif id == disc_code then
- local pre, pos, rep = getdisc(h)
- if not nodisc then
- n = n + 1 ; w[n] = d(
- pre and listtoutf(pre,joiner,textonly) or "",
- pos and listtoutf(pos,joiner,textonly) or "",
- rep and listtoutf(rep,joiner,textonly) or ""
- )
- elseif rep then
- n = n + 1 ; w[n] = listtoutf(rep,joiner,textonly) or ""
- end
- if joiner then
- n = n + 1 ; w[n] = joiner
- end
- elseif textonly then
- if id == glue_code then
- if getwidth(h) > 0 then
- n = n + 1 ; w[n] = " "
+ if h then
+ local w = { }
+ local n = 0
+ local g = formatters["<%i>"]
+ local d = formatters["[%s|%s|%s]"]
+ while h do
+ local c, id = isglyph(h)
+ if c then
+ n = n + 1 ; w[n] = c >= 0 and utfchar(c) or g(c)
+ if joiner then
+ n = n + 1 ; w[n] = joiner
+ end
+ elseif id == disc_code then
+ local pre, pos, rep = getdisc(h)
+ if not nodisc then
+ n = n + 1 ; w[n] = d(
+ pre and listtoutf(pre,joiner,textonly) or "",
+ pos and listtoutf(pos,joiner,textonly) or "",
+ rep and listtoutf(rep,joiner,textonly) or ""
+ )
+ elseif rep then
+ n = n + 1 ; w[n] = listtoutf(rep,joiner,textonly) or ""
+ end
+ if joiner then
+ n = n + 1 ; w[n] = joiner
end
- elseif id == hlist_code or id == vlist_code then
- n = n + 1 ; w[n] = "["
- n = n + 1 ; w[n] = listtoutf(getlist(h),joiner,textonly,last,nodisc)
- n = n + 1 ; w[n] = "]"
+ elseif textonly then
+ if id == glue_code then
+ if getwidth(h) > 0 then
+ n = n + 1 ; w[n] = " "
+ end
+ elseif id == hlist_code or id == vlist_code then
+ local l = getlist(h)
+ n = n + 1 ; w[n] = "["
+ if l then
+ n = n + 1 ; w[n] = listtoutf(l,joiner,textonly,last,nodisc)
+ end
+ n = n + 1 ; w[n] = "]"
+ end
+ else
+ n = n + 1 ; w[n] = "[-]"
+ end
+ if h == last then
+ break
+ else
+ h = getnext(h)
end
- else
- n = n + 1 ; w[n] = "[-]"
- end
- if h == last then
- break
- else
- h = getnext(h)
end
+ return concat(w,"",1,(w[n] == joiner) and (n-1) or n)
+ else
+ return ""
end
- return concat(w,"",1,(w[n] == joiner) and (n-1) or n)
end
function nodes.listtoutf(h,joiner,textonly,last,nodisc)
if h then
local joiner = joiner == true and utfchar(0x200C) or joiner -- zwnj
- return listtoutf(tonut(h),joiner,textonly,last and tonut(last),nodisc)
+ return listtoutf(tonut(h),joiner,textonly,last and tonut(last) or nil,nodisc)
else
return ""
end
@@ -475,6 +481,8 @@ end
number.todimen = numbertodimen
nodes .todimen = nodetodimen
+-- todo: dk
+
function number.topoints (n,fmt) return numbertodimen(n,"pt",fmt) end
function number.toinches (n,fmt) return numbertodimen(n,"in",fmt) end
function number.tocentimeters (n,fmt) return numbertodimen(n,"cm",fmt) end
@@ -737,3 +745,51 @@ end
trackers.register("fonts.result.show", function(v)
nodes.tasks.setaction("processors","nodes.handlers.show",v)
end)
+
+-- This is a weird spot but it's just a compatibility hack:
+
+local getattributes = nuts.getattributes
+local patchattributes = nuts.patchattributes
+
+local texgetattribute = tex.getattribute
+
+function recolor(head,colormodel,color,transparency)
+ -- todo loop over content
+ for n, id in nextnode, head do
+ if id == glyph_code or id == rule_code then
+ local m, c, t = getattributes(n,a_colormodel,a_color,a_transparency)
+ if not c or c == 1 then
+ if not t then
+ patchattributes(n,a_colormodel,colormodel,a_color,color,a_transparency,transparency)
+ else
+ patchattributes(n,a_colormodel,colormodel,a_color,color)
+ end
+ else
+ if not t then
+ patchattributes(n,a_transparency,transparency)
+ end
+ end
+ -- maybe skip the visuals
+ elseif id == hlist_node or id == vlist_node then
+ recolor(getlist(n),colormodel,color,transparency)
+ end
+ end
+end
+
+local function recolorbox(head)
+ recolor(getlist(head),texgetattribute(a_colormodel),texgetattribute(a_color),texgetattribute(a_transparency))
+end
+
+nodes.handlers.recolor = recolorbox
+
+local getbox = nodes.nuts.getbox
+
+interfaces.implement {
+ name = "recolorbox",
+ public = true,
+ protected = true,
+ arguments = { "integer" },
+ actions = function(n)
+ recolor(getbox(n))
+ end
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-tsk.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-tsk.lmt
new file mode 100644
index 00000000000..c4871b56808
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-tsk.lmt
@@ -0,0 +1,1137 @@
+if not modules then modules = { } end modules ['node-tsk'] = {
+ version = 1.001,
+ comment = "companion to node-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- This might move to task-* and become less code as in sequencers
+-- we already have dirty flags as well. On the other hand, nodes are
+-- rather specialized and here we focus on node related tasks.
+
+local format = string.format
+
+local trace_tasks = false trackers.register("tasks.creation", function(v) trace_tasks = v end)
+
+local report_tasks = logs.reporter("tasks")
+
+local allocate = utilities.storage.allocate
+
+local context = context
+local nodes = nodes
+
+local tasks = nodes.tasks or { }
+nodes.tasks = tasks
+
+local tasksdata = { } -- no longer public
+
+local sequencers = utilities.sequencers
+local compile = sequencers.compile
+local nodeprocessor = sequencers.nodeprocessor
+
+local newsequencer = sequencers.new
+
+local appendgroup = sequencers.appendgroup
+----- prependgroup = sequencers.prependgroup
+----- replacegroup = sequencers.replacegroup
+local enablegroup = sequencers.enablegroup
+local disablegroup = sequencers.disablegroup
+
+local appendaction = sequencers.appendaction
+local prependaction = sequencers.prependaction
+local replaceaction = sequencers.replaceaction
+local enableaction = sequencers.enableaction
+local disableaction = sequencers.disableaction
+
+local frozengroups = "no"
+
+function tasks.freeze(kind)
+ frozengroups = kind or "tolerant" -- todo: hook into jobname
+end
+
+function tasks.new(specification) -- was: name,arguments,list
+ local name = specification.name
+ local sequence = specification.sequence
+ if name and sequence then
+ local tasklist = newsequencer {
+ name = name
+ -- we can move more to the sequencer now .. todo
+ }
+ tasksdata[name] = {
+ name = name,
+ list = tasklist,
+ runner = false,
+ frozen = { },
+ processor = specification.processor or nodeprocessor,
+ -- could be metatable but best freeze it
+ arguments = specification.arguments or 0,
+ templates = specification.templates,
+ }
+ for l=1,#sequence do
+ appendgroup(tasklist,sequence[l])
+ end
+ end
+end
+
+local function valid(name)
+ local data = tasksdata[name]
+ if not data then
+ report_tasks("unknown task %a",name)
+ else
+ return data
+ end
+end
+
+local function validgroup(name,group,what)
+ local data = tasksdata[name]
+ if not data then
+ report_tasks("unknown task %a",name)
+ else
+ local frozen = data.frozen[group]
+ if frozen then
+ if frozengroup == "no" then
+ -- default
+ elseif frozengroup == "strict" then
+ report_tasks("warning: group %a of task %a is frozen, %a applied but not supported",group,name,what)
+ return
+ else -- if frozengroup == "tolerant" then
+ report_tasks("warning: group %a of task %a is frozen, %a ignored",group,name,what)
+ end
+ end
+ return data
+ end
+end
+
+function tasks.freezegroup(name,group)
+ local data = valid(name)
+ if data then
+ data.frozen[group] = true
+ end
+end
+
+function tasks.restart(name)
+ local data = valid(name)
+ if data then
+ data.runner = false
+ end
+end
+
+function tasks.enableaction(name,action)
+ local data = valid(name)
+ if data then
+ enableaction(data.list,action)
+ data.runner = false
+ end
+end
+
+function tasks.disableaction(name,action)
+ local data = valid(name)
+ if data then
+ disableaction(data.list,action)
+ data.runner = false
+ end
+end
+
+function tasks.replaceaction(name,group,oldaction,newaction)
+ local data = valid(name)
+ if data then
+ replaceaction(data.list,group,oldaction,newaction)
+ data.runner = false
+ end
+end
+
+do
+
+ local enableaction = tasks.enableaction
+ local disableaction = tasks.disableaction
+
+ function tasks.setaction(name,action,value)
+ if value then
+ enableaction(name,action)
+ else
+ disableaction(name,action)
+ end
+ end
+
+end
+
+function tasks.enablegroup(name,group)
+ local data = validgroup(name,"enable group")
+ if data then
+ enablegroup(data.list,group)
+ data.runner = false
+ end
+end
+
+function tasks.disablegroup(name,group)
+ local data = validgroup(name,"disable group")
+ if data then
+ disablegroup(data.list,group)
+ data.runner = false
+ end
+end
+
+function tasks.appendaction(name,group,action,where,kind,state)
+ local data = validgroup(name,"append action")
+ if data then
+ local list = data.list
+ appendaction(list,group,action,where,kind)
+ if state == "disabled" or (state == "production" and environment.initex) then
+ disableaction(list,action)
+ end
+ data.runner = false
+ end
+end
+
+function tasks.prependaction(name,group,action,where,kind,state)
+ local data = validgroup(name,"prepend action")
+ if data then
+ local list = data.list
+ prependaction(list,group,action,where,kind)
+ if state == "disabled" or (state == "production" and environment.initex) then
+ disableaction(list,action)
+ end
+ data.runner = false
+ end
+end
+
+function tasks.removeaction(name,group,action)
+ local data = validgroup(name,"remove action")
+ if data then
+ removeaction(data.list,group,action)
+ data.runner = false
+ end
+end
+
+function tasks.showactions(name,group,action,where,kind)
+ local data = valid(name)
+ if data then
+ report_tasks("task %a, list:\n%s",name,nodeprocessor(data.list))
+ end
+end
+
+-- Optimizing for the number of arguments makes sense, but getting rid of
+-- the nested call (no problem but then we also need to register the
+-- callback with this mechanism so that it gets updated) does not save
+-- much time (24K calls on mk.tex).
+
+local created, total = 0, 0
+
+statistics.register("node list callback tasks", function()
+ if total > 0 then
+ return format("%s unique task lists, %s instances (re)created, %s calls",table.count(tasksdata),created,total)
+ else
+ return nil
+ end
+end)
+
+local function create(data,t)
+ created = created + 1
+ local runner = compile(data.list,data.processor,t)
+ if trace_tasks then
+ report_tasks("creating runner %a, %i actions enabled",t.name,data.list.steps or 0)
+ end
+ data.runner = runner
+ return runner
+end
+
+function tasks.actions(name)
+ local data = tasksdata[name]
+ if data then
+ local t = data.templates
+ if t then
+ t.name = data.name
+ return function(...)
+ total = total + 1
+ return (data.runner or create(data,t))(...)
+ end
+ end
+ end
+ return nil
+end
+
+function tasks.table(name) --maybe move this to task-deb.lua
+ local tsk = tasksdata[name]
+ local lst = tsk and tsk.list
+ local HL, NC, NR, bold, type = context.HL, context.NC, context.NR, context.bold, context.type
+ if lst then
+ local list, order = lst.list, lst.order
+ if list and order then
+ context.starttabulate { "|l|l|" }
+ NC() bold("category") NC() bold("function") NC() NR()
+ for i=1,#order do
+ HL()
+ local o = order[i]
+ local l = list[o]
+ if #l == 0 then
+ NC() type(o) NC() context("unset") NC() NR()
+ else
+ local done = false
+ for k, v in table.sortedhash(l) do
+ NC() if not done then type(o) done = true end NC() type(v) NC() NR()
+ end
+ end
+ end
+ context.stoptabulate()
+ end
+ end
+end
+
+-- -- shipouts everypar -- --
+
+-- the shipout handlers acts on boxes so we don't need to return something
+-- and also don't need to keep the state (done)
+
+local templates = {
+
+default = [[
+return function(head)
+ return head
+end
+]],
+
+process = [[
+local tonut = nodes.tonut
+local tonode = nodes.nuts.tonode
+
+%localize%
+
+return function(head)
+ local nuthead = tonut(head)
+
+%actions%
+ return tonode(nuthead)
+end
+]],
+
+step = [[
+ nuthead = tonut((%action%(tonode(nuthead))))
+]],
+
+nut = [[
+ nuthead = %action%(nuthead)
+]],
+
+nohead = [[
+ %action%(tonode(nuthead))
+]],
+
+nonut = [[
+ %action%(nuthead)
+]],
+
+}
+
+tasks.new {
+ name = "shipouts",
+ processor = nodeprocessor,
+ sequence = {
+ "before", -- users
+ "normalizers", -- system
+ "finishers", -- system
+ "after", -- users
+ "wrapup", -- system
+ },
+ templates = templates
+}
+
+tasks.new {
+ name = "everypar",
+ processor = nodeprocessor,
+ sequence = {
+ "before", -- users
+ "normalizers", -- system
+ "after", -- users
+ },
+ templates = templates,
+}
+
+-- -- alignment -- -- gets temp node ! (currently as that might change)
+
+tasks.new {
+ name = "alignments",
+ processor = nodeprocessor,
+ sequence = {
+ "before", -- users
+ "normalizers", -- system
+ "after", -- users
+ },
+ templates = {
+
+default = [[
+return function(head)
+end
+]],
+
+process = [[
+local tonut = nodes.tonut
+local tonode = nodes.nuts.tonode
+
+%localize%
+
+return function(head,where,attr,preamble)
+ local nuthead = tonut(head)
+ local nutattr = tonut(attr)
+ local nutpreamble = tonut(preamble)
+
+%actions%
+end
+]],
+
+step = [[
+ %action%(head,where,attr,preamble)
+]],
+
+nut = [[
+ %action%(nuthead,where,nutattr,nutpreamble)
+]],
+
+nohead = [[
+ %action%(head,where,attr,preamble)
+]],
+
+nonut = [[
+ %action%(nuthead,where,nutattr,nutpreamble)
+]],
+
+ }
+}
+
+-- -- finalizers -- --
+
+tasks.new {
+ name = "finalizers",
+ sequence = {
+ "before", -- for users
+ "normalizers",
+ "fonts",
+ "lists",
+ "after", -- for users
+ },
+ processor = nodeprocessor,
+ templates = {
+
+default = [[
+return function(head)
+ return head
+end
+]],
+
+process = [[
+local tonut = nodes.tonut
+local tonode = nodes.nuts.tonode
+
+%localize%
+
+return function(head,groupcode)
+ local nuthead = tonut(head)
+
+%actions%
+ return tonode(nuthead)
+end
+]],
+
+step = [[
+ nuthead = tonut((%action%(tonode(nuthead),groupcode)))
+]],
+
+nut = [[
+ nuthead = %action%(nuthead,groupcode)
+]],
+
+nohead = [[
+ %action%(tonode(nuthead),groupcode)
+]],
+
+nonut = [[
+ %action%(nuthead,groupcode)
+]],
+
+ }
+}
+
+-- -- processors -- --
+
+tasks.new {
+ name = "processors",
+ processor = nodeprocessor,
+ sequence = {
+ "before", -- for users
+ "normalizers",
+ "characters",
+ "words",
+ "fonts",
+ "lists",
+ "after", -- for users
+ },
+ templates = {
+
+default = [[
+return function(head)
+ return head
+end
+]],
+
+process = [[
+local tonut = nodes.tonut
+local tonode = nodes.nuts.tonode
+
+%localize%
+
+return function(head,groupcode,direction)
+ local nuthead = tonut(head)
+
+%actions%
+ return tonode(nuthead)
+end
+]],
+
+step = [[
+ nuthead = tonut((%action%(tonode(nuthead),groupcode,direction)))
+]],
+
+nut = [[
+ nuthead = %action%(nuthead,groupcode,direction)
+]],
+
+nohead = [[
+ %action%(tonode(nuthead),groupcode,direction)
+]],
+
+nonut = [[
+ %action%(nuthead,groupcode,direction)
+]],
+
+ }
+}
+
+-- -- paragraphs -- --
+
+tasks.new {
+ name = "paragraphs",
+ processor = nodeprocessor,
+ sequence = {
+ "before", -- for users
+ "lists",
+ "after", -- for users
+ },
+ templates = {
+
+default = [[
+return function(head)
+ return head
+end
+]],
+
+process = [[
+local tonut = nodes.tonut
+local tonode = nodes.nuts.tonode
+
+%localize%
+
+return function(head,groupcode)
+ local nuthead = tonut(head)
+
+%actions%
+ return tonode(nuthead)
+end
+]],
+
+step = [[
+ nuthead = tonut((%action%(tonode(nuthead),groupcode)))
+]],
+
+nut = [[
+ nuthead = %action%(nuthead,groupcode)
+]],
+
+nohead = [[
+ %action%(tonode(nuthead),groupcode)
+]],
+
+nonut = [[
+ %action%(nuthead,groupcode)
+]],
+
+ }
+}
+
+-- -- hpackers -- --
+
+-- tasks.new {
+-- name = "processors",
+-- processor = nodeprocessor,
+-- sequence = {
+-- "before", -- for users
+-- "normalizers",
+-- "characters",
+-- "words",
+-- "fonts",
+-- "lists",
+-- "after", -- for users
+-- },
+-- templates = {
+--
+-- default = [[
+-- return function(head)
+-- return head
+-- end
+-- ]],
+--
+-- process = [[
+-- local tonut = nodes.tonut
+-- local tonode = nodes.nuts.tonode
+--
+-- %localize%
+--
+-- return function(head,groupcode,size,packtype,direction,attributes)
+-- local nuthead = tonut(head)
+--
+-- %actions%
+-- return tonode(nuthead)
+-- end
+-- ]],
+--
+-- step = [[
+-- nuthead = tonut((%action%(tonode(nuthead),groupcode,size,packtype,direction,attributes)))
+-- ]],
+--
+-- nut = [[
+-- nuthead = %action%(nuthead,groupcode,size,packtype,direction,attributes)
+-- ]],
+--
+-- nohead = [[
+-- %action%(tonode(nuthead),groupcode,size,packtype,direction,attributes)
+-- ]],
+--
+-- nonut = [[
+-- %action%(nuthead,groupcode,size,packtype,direction,attributes)
+-- ]],
+--
+-- }
+-- }
+
+tasks.new {
+ name = "finalizers",
+ processor = nodeprocessor,
+ sequence = {
+ "before", -- for users
+ "normalizers",
+ "fonts",
+ "lists",
+ "after", -- for users
+ },
+ templates = {
+
+default = [[
+return function(head)
+ return head
+end
+]],
+
+process = [[
+local tonut = nodes.tonut
+local tonode = nodes.nuts.tonode
+
+%localize%
+
+return function(head)
+ local nuthead = tonut(head)
+
+%actions%
+ return tonode(nuthead)
+end
+]],
+
+step = [[
+ nuthead = tonut((%action%(tonode(nuthead))))
+]],
+
+nut = [[
+ nuthead = %action%(nuthead)
+]],
+
+nohead = [[
+ %action%(tonode(nuthead))
+]],
+
+nonut = [[
+ %action%(nuthead)
+]],
+
+ }
+}
+
+tasks.new {
+ name = "mvlbuilders",
+ processor = nodeprocessor,
+ sequence = {
+ "before", -- for users
+ "normalizers",
+ "after", -- for users
+ },
+ templates = {
+
+default = [[
+return function(head)
+ return head
+end
+]],
+
+-- process = [[
+-- local tonut = nodes.tonut
+-- local tonode = nodes.nuts.tonode
+--
+-- %localize%
+--
+-- return function(head,groupcode)
+-- local nuthead = tonut(head)
+--
+-- return function(nuthead,groupcode)
+--
+-- %actions%
+-- return tonode(nuthead)
+-- end
+-- ]],
+
+process = [[
+local tonut = nodes.tonut
+local tonode = nodes.nuts.tonode
+
+%localize%
+
+return function(nuthead,groupcode)
+
+%actions%
+ return nuthead
+end
+]],
+
+step = [[
+ nuthead = tonut((%action%(tonode(nuthead),groupcode)))
+]],
+
+nut = [[
+ nuthead = %action%(nuthead,groupcode)
+]],
+
+nohead = [[
+ %action%(tonode(nuthead),groupcode)
+]],
+
+nonut = [[
+ %action%(nuthead,groupcode)
+]],
+
+ }
+
+}
+
+tasks.new {
+ name = "vboxbuilders",
+ processor = nodeprocessor,
+ sequence = {
+ "before", -- for users
+ "normalizers",
+ "after", -- for users
+ },
+ templates = {
+
+default = [[
+return function(head)
+ return head
+end
+]],
+
+process = [[
+local tonut = nodes.tonut
+local tonode = nodes.nuts.tonode
+
+%localize%
+
+return function(head,groupcode,size,packtype,maxdepth,direction)
+ local nuthead = tonut(head)
+
+%actions%
+ return tonode(nuthead)
+end
+]],
+
+step = [[
+ nuthead = tonut((%action%(tonode(nuthead),groupcode,size,packtype,maxdepth,direction)))
+]],
+
+nut = [[
+ nuthead = %action%(nuthead,groupcode,size,packtype,maxdepth,direction)
+]],
+
+nohead = [[
+ %action%(tonode(nuthead),groupcode,size,packtype,maxdepth,direction)
+]],
+
+nonut = [[
+ %action%(nuthead,groupcode,size,packtype,maxdepth,direction)
+]],
+
+ }
+
+}
+
+tasks.new {
+ name = "vboxhandlers",
+ processor = nodeprocessor,
+ sequence = {
+ "before", -- for users
+ "normalizers",
+ "after", -- for users
+ },
+ templates = {
+
+default = [[
+return function(head)
+ return head
+end
+]],
+
+process = [[
+local tonut = nodes.tonut
+local tonode = nodes.nuts.tonode
+
+%localize%
+
+return function(head,groupcode)
+ local nuthead = tonut(head)
+
+%actions%
+ return tonode(nuthead)
+end
+]],
+
+step = [[
+ nuthead = tonut((%action%(tonode(nuthead),groupcode)))
+]],
+
+nut = [[
+ nuthead = %action%(nuthead,groupcode)
+]],
+
+nohead = [[
+ %action%(tonode(nuthead),groupcode)
+]],
+
+nonut = [[
+ %action%(nuthead,groupcode)
+]],
+
+ }
+
+}
+
+-- these operate on the content on a line, so no injections
+
+tasks.new {
+ name = "contributers",
+ processor = nodeprocessor,
+ sequence = {
+ "before", -- for users
+ "normalizers",
+ "after", -- for users
+ },
+ templates = {
+
+default = [[
+return function(head)
+ return head
+end
+]],
+
+process = [[
+local tonut = nodes.tonut
+local tonode = nodes.nuts.tonode
+
+%localize%
+
+-- we operate exclusively on nuts (no index yet)
+
+return function(head,where,tail)
+ local nuthead = tonut(head)
+ local nuttail = tonut(tail)
+
+%actions%
+ return tonode(nuthead)
+end
+]],
+
+step = [[
+ nuthead = tonut((%action%(tonode(nuthead),where,tonode(nuttail))))
+]],
+
+nut = [[
+ nuthead = %action%(nuthead,where,nuttail)
+]],
+
+nohead = [[
+ %action%(tonode(nuthead),where,tonode(nuttail))
+]],
+
+nonut = [[
+ %action%(nuthead,where,nuttail)
+]],
+
+ }
+
+}
+
+ tasks.new {
+ name = "adjusters",
+ processor = nodeprocessor,
+ sequence = {
+ "before", -- for users
+ "normalizers",
+ "after", -- for users
+ },
+ templates = {
+
+default = [[
+return function(head)
+ return head
+end
+]],
+
+process = [[
+local tonut = nodes.tonut
+local tonode = nodes.nuts.tonode
+local nodetail = nodes.nuts.tail
+
+%localize%
+
+-- we operate exclusively on nuts
+
+return function(head,where,tail,index)
+ local nuthead = tonut(head)
+ local nuttail = tonut(tail)
+
+%actions%
+ return tonode(nuthead)
+end
+]],
+
+step = [[
+ nuthead = tonut((%action%(tonode(nuthead),where,tonode(nuttail),index)))
+ nuttail = nodetail(nuthead)
+]],
+
+nut = [[
+ nuthead = %action%(nuthead,where,nuttail,index)
+ nuttail = nodetail(nuthead)
+]],
+
+nohead = [[
+ %action%(tonode(nuthead),where,tonode(nuttail),index)
+ nuttail = nodetail(nuthead)
+]],
+
+nonut = [[
+ %action%(nuthead,where,nuttail,index)
+ nuttail = nodetail(nuthead)
+]],
+
+ }
+
+}
+
+-- -- math -- --
+
+tasks.new {
+ name = "math",
+ processor = nodeprocessor,
+ sequence = {
+ "before",
+ "normalizers",
+ "builders",
+ "finalizers",
+ "after",
+ },
+ templates = {
+
+default = [[
+return function(head)
+ return head
+end
+]],
+
+process = [[
+local tonut = nodes.tonut
+local tonode = nodes.nuts.tonode
+
+%localize%
+
+return function(head,style,penalties,beginclass,endclass,level)
+ local nuthead = tonut(head)
+
+%actions%
+ return tonode(nuthead)
+end
+]],
+
+step = [[
+ nuthead = tonut((%action%(tonode(nuthead),style,penalties,beginclass,endclass,level)))
+]],
+
+nut = [[
+ nuthead = %action%(nuthead,style,penalties,beginclass,endclass,level)
+]],
+
+nohead = [[
+ %action%(tonode(nuthead),style,penalties,beginclass,endclass,level)
+]],
+
+nonut = [[
+ %action%(nuthead,style,penalties,beginclass,endclass,level)
+]],
+
+ }
+}
+
+-- tasks.new {
+-- name = "parbuilders",
+-- arguments = 1,
+-- processor = nodeprocessor,
+-- sequence = {
+-- "before", -- for users
+-- "lists",
+-- "after", -- for users
+-- }
+-- }
+
+-- tasks.new {
+-- name = "pagebuilders",
+-- arguments = 5,
+-- processor = nodeprocessor,
+-- sequence = {
+-- "before", -- for users
+-- "lists",
+-- "after", -- for users
+-- }
+-- }
+
+-- for now quite useless (too fuzzy)
+--
+-- tasks.new {
+-- name = "listbuilders",
+-- processor = nodeprocessor,
+-- sequence = {
+-- "before", -- for users
+-- "normalizers",
+-- "after", -- for users
+-- },
+-- templates = {
+-- -- we don't need a default
+-- default = [[
+-- return function(box,location,prevdepth)
+-- return box, prevdepth
+-- end
+-- ]],
+-- process = [[
+-- %localize%
+-- return function(box,location,prevdepth,mirrored)
+-- %actions%
+-- return box, prevdepth
+-- end
+-- ]],
+-- step = [[
+-- box, prevdepth = %action%(box,location,prevdepth,mirrored)
+-- ]],
+-- },
+-- }
+
+-- -- math -- --
+
+-- not really a node processor
+
+-- tasks.new {
+-- name = "newpar",
+-- processor = nodeprocessor,
+-- sequence = {
+-- "before",
+-- "normalizers",
+-- "after",
+-- },
+-- templates = {
+--
+-- default = [[
+-- return function(mode,indent)
+-- return indent
+-- end
+-- ]],
+--
+-- process = [[
+-- %localize%
+--
+-- return function(mode,indent)
+--
+-- %actions%
+-- return indent
+-- end
+-- ]],
+--
+-- step = [[
+-- indent = %action%(mode,indent)
+-- ]],
+--
+-- }
+-- }
+
+-- -- localboxes -- --
+
+tasks.new {
+ name = "localboxes",
+ processor = nodeprocessor,
+ sequence = {
+ "before", -- for users
+ "lists",
+ "after", -- for users
+ },
+ templates = {
+
+default = [[
+return function(head)
+end
+]],
+
+process = [[
+local tonut = nodes.tonut
+local tonode = nodes.nuts.tonode
+
+%localize%
+
+-- line,leftbox,rightbox,middlebox,linenumber,leftskip,rightskip,lefthang,righthang,indent,parinitleftskip,parinitrightskip,parfillleftskip,parfillrightskip,overshoot
+
+return function(line,leftbox,rightbox,middlebox,...)
+ nutline = tonut(line)
+ nutleftbox = leftbox and tonut(leftbox)
+ nutrightbox = rightbox and tonut(rightbox)
+ nutmiddlebox = middlebox and tonut(middlebox)
+%actions%
+end
+]],
+
+step = [[
+ tonut((%action%(line,leftbox,rightbox,middlebox,...)))
+]],
+
+nut = [[
+ %action%(nutline,nutleftbox,nutrightbox,nutmiddlebox,...)
+]],
+
+nohead = [[
+ %action%(line,leftbox,rightbox,middlebox,...)
+]],
+
+nonut = [[
+ %action%(nutline,nutleftbox,nutrightbox,nutmiddlebox,...)
+]],
+
+ }
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-tst.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-tst.lmt
new file mode 100644
index 00000000000..c28086f8146
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-tst.lmt
@@ -0,0 +1,97 @@
+if not modules then modules = { } end modules ['node-tst'] = {
+ version = 1.001,
+ comment = "companion to node-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local nodes, node = nodes, node
+
+local chardata = characters.data
+local nodecodes = nodes.nodecodes
+local gluecodes = nodes.gluecodes
+
+local glue_code = nodecodes.glue
+local penalty_code = nodecodes.penalty
+local kern_code = nodecodes.kern
+local glyph_code = nodecodes.glyph
+
+local abovedisplayshortskip_code = gluecodes.abovedisplayshortskip
+local belowdisplayshortskip_code = gluecodes.belowdisplayshortskip
+
+local nuts = nodes.nuts
+
+local getnext = nuts.getnext
+local getprev = nuts.getprev
+local getid = nuts.getid
+local getchar = nuts.getchar
+local getsubtype = nuts.getsubtype
+local getkern = nuts.getkern
+local getpenalty = nuts.getpenalty
+local getwidth = nuts.getwidth
+
+function nuts.somespace(n,all)
+ if n then
+ local id = getid(n)
+ if id == glue_code then
+ return (all or (getwidth(n) ~= 0)) and glue_code -- temp: or 0
+ elseif id == kern_code then
+ return (all or (getkern(n) ~= 0)) and kern_code
+ elseif id == glyph_code then
+ -- maybe more category checks are needed
+ return (chardata[getchar(n)].category == "zs") and glyph_code
+ end
+ end
+ return false
+end
+
+function nuts.somepenalty(n,value)
+ if n then
+ local id = getid(n)
+ if id == penalty_code then
+ if value then
+ return getpenalty(n) == value
+ else
+ return true
+ end
+ end
+ end
+ return false
+end
+
+function nuts.is_display_math(head)
+ local n = getprev(head)
+ while n do
+ local id = getid(n)
+ if id == penalty_code then
+ elseif id == glue_code then
+ if getsubtype(n) == abovedisplayshortskip_code then
+ return true
+ end
+ else
+ break
+ end
+ n = getprev(n)
+ end
+ n = getnext(head)
+ while n do
+ local id = getid(n)
+ if id == penalty_code then
+ elseif id == glue_code then
+ if getsubtype(n) == belowdisplayshortskip_code then
+ return true
+ end
+ else
+ break
+ end
+ n = getnext(n)
+ end
+ return false
+end
+
+nodes.leftmarginwidth = nodes.vianuts(nuts.leftmarginwidth)
+nodes.rightmarginwidth = nodes.vianuts(nuts.rightmarginwidth)
+nodes.somespace = nodes.vianuts(nuts.somespace)
+nodes.somepenalty = nodes.vianuts(nuts.somepenalty)
+nodes.is_display_math = nodes.vianuts(nuts.is_display_math)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/node-typ.lmt b/Master/texmf-dist/tex/context/base/mkxl/node-typ.lmt
new file mode 100644
index 00000000000..c09fd5f67c1
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/node-typ.lmt
@@ -0,0 +1,135 @@
+if not modules then modules = { } end modules ['node-typ'] = {
+ version = 1.001,
+ comment = "companion to node-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- code has been moved to blob-ini.lua
+
+local typesetters = nodes.typesetters or { }
+nodes.typesetters = typesetters
+
+local nuts = nodes.nuts
+local tonode = nuts.tonode
+local tonut = nuts.tonut
+
+local setlink = nuts.setlink
+local setchar = nuts.setchar
+local setattrlist = nuts.setattrlist
+
+local getfont = nuts.getfont
+
+local hpack_node_list = nuts.hpack
+local vpack_node_list = nuts.vpack
+local full_hpack_list = nuts.fullhpack
+
+local nodepool = nuts.pool
+local new_glyph = nodepool.glyph
+local new_glue = nodepool.glue
+
+local utfvalues = utf.values
+
+local currentfont = font.current
+local currentattributes = nodes.currentattributes
+local fontparameters = fonts.hashes.parameters
+
+-- when attrid == true then take from glyph or current else use the given value
+
+-- todo: glyphscale etc
+
+local function tonodes(str,fontid,spacing,templateglyph,attrid) -- quick and dirty
+ local head, prev = nil, nil
+ if not fontid then
+ fontid = templateglyph and getfont(templateglyph) or currentfont()
+ end
+ if attrid == true then
+ if templateglyph then
+ attrid = false -- we copy with the glyph
+ else
+ attrid = currentattributes()
+ end
+ end
+ local fp = fontparameters[fontid]
+ local s, p, m
+ if spacing then
+ s, p, m = spacing, 0, 0
+ else
+ s, p, m = fp.space, fp.spacestretch, fp.spaceshrink
+ end
+ local spacedone = false
+ for c in utfvalues(str) do
+ local next
+ if c == 32 then
+ if not spacedone then
+ next = new_glue(s,p,m)
+ spacedone = true
+ end
+ elseif templateglyph then
+ next = copy_glyph(templateglyph)
+ setchar(next,c)
+ spacedone = false
+ else
+ next = new_glyph(fontid or 1,c)
+ spacedone = false
+ end
+ if not next then
+ -- nothing
+ elseif not head then
+ if attrid then
+ setattrlist(next,attrid)
+ end
+ head = next
+ else
+ if attrid then
+ setattrlist(next,attrid)
+ end
+ setlink(prev,next)
+ end
+ prev = next
+ end
+ return head
+end
+
+local function tohpack(str,fontid,spacing)
+ return hpack_node_list(tonodes(str,fontid,spacing),"exactly")
+end
+
+local function tohbox(str,fontid,spacing)
+ return full_hpack_list(tonodes(str,fontid,spacing),"exactly")
+end
+
+local function tovpack(str,fontid,spacing)
+ -- vpack is just a hack, and a proper implementation is on the agenda
+ -- as it needs more info etc than currently available
+ return vpack_node_list(tonodes(str,fontid,spacing))
+end
+
+local tovbox = tovpack -- for now no vpack filter
+
+local tnuts = { }
+nuts.typesetters = tnuts
+
+tnuts.tonodes = tonodes
+tnuts.tohpack = tohpack
+tnuts.tohbox = tohbox
+tnuts.tovpack = tovpack
+tnuts.tovbox = tovbox
+
+typesetters.tonodes = function(...) local h, b = tonodes(...) return tonode(h), b end
+typesetters.tohpack = function(...) local h, b = tohpack(...) return tonode(h), b end
+typesetters.tohbox = function(...) local h, b = tohbox (...) return tonode(h), b end
+typesetters.tovpack = function(...) local h, b = tovpack(...) return tonode(h), b end
+typesetters.tovbox = function(...) local h, b = tovbox (...) return tonode(h), b end
+
+typesetters.hpack = typesetters.tohpack -- obsolete
+typesetters.hbox = typesetters.tohbox -- obsolete
+typesetters.vpack = typesetters.tovpack -- obsolete
+
+-- context(nodes.typesetters.tohpack("Hello World!"))
+-- context(nodes.typesetters.tohbox ("Hello World!"))
+-- context(nodes.typesetters.tohpack("Hello World!",1,100*1024*10))
+-- context(nodes.typesetters.tohbox ("Hello World!",1,100*1024*10))
+
+string.tonodes = function(...) return tonode(tonodes(...)) end -- quite convenient
diff --git a/Master/texmf-dist/tex/context/base/mkxl/norm-ctx.mkxl b/Master/texmf-dist/tex/context/base/mkxl/norm-ctx.mkxl
index 5cee04935b6..0ec92589642 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/norm-ctx.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/norm-ctx.mkxl
@@ -15,73 +15,8 @@
%D A few more might end up here (like the weird ones in syst-ini).
-\let\normalreqno\normaleqno
-
-% more friendly in setups:
-
-\aliased\let\ordordspacing \Umathordordspacing
-\aliased\let\ordopspacing \Umathordopspacing
-\aliased\let\ordbinspacing \Umathordbinspacing
-\aliased\let\ordrelspacing \Umathordrelspacing
-\aliased\let\ordopenspacing \Umathordopenspacing
-\aliased\let\ordclosespacing \Umathordclosespacing
-\aliased\let\ordpunctspacing \Umathordpunctspacing
-\aliased\let\ordinnerspacing \Umathordinnerspacing
-\aliased\let\opordspacing \Umathopordspacing
-\aliased\let\opopspacing \Umathopopspacing
-\aliased\let\opbinspacing \Umathopbinspacing
-\aliased\let\oprelspacing \Umathoprelspacing
-\aliased\let\opopenspacing \Umathopopenspacing
-\aliased\let\opclosespacing \Umathopclosespacing
-\aliased\let\oppunctspacing \Umathoppunctspacing
-\aliased\let\opinnerspacing \Umathopinnerspacing
-\aliased\let\binordspacing \Umathbinordspacing
-\aliased\let\binopspacing \Umathbinopspacing
-\aliased\let\binbinspacing \Umathbinbinspacing
-\aliased\let\binrelspacing \Umathbinrelspacing
-\aliased\let\binopenspacing \Umathbinopenspacing
-\aliased\let\binclosespacing \Umathbinclosespacing
-\aliased\let\binpunctspacing \Umathbinpunctspacing
-\aliased\let\bininnerspacing \Umathbininnerspacing
-\aliased\let\relordspacing \Umathrelordspacing
-\aliased\let\relopspacing \Umathrelopspacing
-\aliased\let\relbinspacing \Umathrelbinspacing
-\aliased\let\relrelspacing \Umathrelrelspacing
-\aliased\let\relopenspacing \Umathrelopenspacing
-\aliased\let\relclosespacing \Umathrelclosespacing
-\aliased\let\relpunctspacing \Umathrelpunctspacing
-\aliased\let\relinnerspacing \Umathrelinnerspacing
-\aliased\let\openordspacing \Umathopenordspacing
-\aliased\let\openopspacing \Umathopenopspacing
-\aliased\let\openbinspacing \Umathopenbinspacing
-\aliased\let\openrelspacing \Umathopenrelspacing
-\aliased\let\openopenspacing \Umathopenopenspacing
-\aliased\let\openclosespacing \Umathopenclosespacing
-\aliased\let\openpunctspacing \Umathopenpunctspacing
-\aliased\let\openinnerspacing \Umathopeninnerspacing
-\aliased\let\closeordspacing \Umathcloseordspacing
-\aliased\let\closeopspacing \Umathcloseopspacing
-\aliased\let\closebinspacing \Umathclosebinspacing
-\aliased\let\closerelspacing \Umathcloserelspacing
-\aliased\let\closeopenspacing \Umathcloseopenspacing
-\aliased\let\closeclosespacing\Umathcloseclosespacing
-\aliased\let\closepunctspacing\Umathclosepunctspacing
-\aliased\let\closeinnerspacing\Umathcloseinnerspacing
-\aliased\let\punctordspacing \Umathpunctordspacing
-\aliased\let\punctopspacing \Umathpunctopspacing
-\aliased\let\punctbinspacing \Umathpunctbinspacing
-\aliased\let\punctrelspacing \Umathpunctrelspacing
-\aliased\let\punctopenspacing \Umathpunctopenspacing
-\aliased\let\punctclosespacing\Umathpunctclosespacing
-\aliased\let\punctpunctspacing\Umathpunctpunctspacing
-\aliased\let\punctinnerspacing\Umathpunctinnerspacing
-\aliased\let\innerordspacing \Umathinnerordspacing
-\aliased\let\inneropspacing \Umathinneropspacing
-\aliased\let\innerbinspacing \Umathinnerbinspacing
-\aliased\let\innerrelspacing \Umathinnerrelspacing
-\aliased\let\inneropenspacing \Umathinneropenspacing
-\aliased\let\innerclosespacing\Umathinnerclosespacing
-\aliased\let\innerpunctspacing\Umathinnerpunctspacing
-\aliased\let\innerinnerspacing\Umathinnerinnerspacing
+\let\normalreqno \normaleqno
+%let\mathtopaccent \normaloverline
+%let\mathbottomaccent\normalunderline
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/pack-bck.mklx b/Master/texmf-dist/tex/context/base/mkxl/pack-bck.mklx
index 3c15beb5f4f..e754c24514a 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/pack-bck.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/pack-bck.mklx
@@ -131,7 +131,7 @@
\ifdim\scratchdimen<\zeropoint
\scratchdimen\pagegoal
\fi
- \advance\scratchdimen\dimexpr
+ \advanceby\scratchdimen\dimexpr
-\backgroundparameter\c!topoffset
-\backgroundparameter\c!bottomoffset
\relax
diff --git a/Master/texmf-dist/tex/context/base/mkxl/pack-box.mkxl b/Master/texmf-dist/tex/context/base/mkxl/pack-box.mkxl
index 77b0bbc69c8..5a66d394598 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/pack-box.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/pack-box.mkxl
@@ -51,10 +51,10 @@
%
% \anchor[text-1][preset=lefttop][framed settings]{HELLO WORLD}
-\mutable\let\currentanchor\empty
+\mutable\lettonothing\currentanchor
\permanent\tolerant\protected\def\defineanchor[#1]#*[#2]#*[#3]#*[#4]% name targetlayer layersetting framedsetting
- {\setvalue{\??anchor#1}{\pack_anchors_process_defined{#2}{#3}{#4}}}
+ {\defcsname\??anchor#1\endcsname{\pack_anchors_process_defined{#2}{#3}{#4}}}
\let\pack_anchors_process_defined_indeed\gobbletwooptionals
@@ -92,18 +92,18 @@
\def\pack_anchor_notdefined_two #1#2{\dowithnextbox{\pack_anchors_process_finish\currentanchor{#1}{#2}}\vbox}
\def\pack_anchors_process_indeed#1#2#3{\dowithnextbox{\pack_anchors_process_finish {#1}{#2}{#3}}\vbox}
-\newbox \b_pack_anchors
-\newdimen\d_pack_anchors_width
-\newdimen\d_pack_anchors_height
-\newdimen\d_pack_anchors_depth
+\newbox \b_pack_anchors
+\newdimension\d_pack_anchors_width
+\newdimension\d_pack_anchors_height
+\newdimension\d_pack_anchors_depth
% \definelayer[anchor]
-\newcount\c_pack_anchors_n
-\newtoks \t_pack_anchors_flush
+\newinteger\c_pack_anchors_n
+\newtoks \t_pack_anchors_flush
\protected\def\pack_anchors_register#1#2%
- {\global\advance\c_pack_anchors_n\plusone
+ {\global\advanceby\c_pack_anchors_n\plusone
\pagereference[\v!layer:\v!anchor:\number\c_pack_anchors_n]%
\putboxincache\v!anchor{\number\c_pack_anchors_n}\b_pack_anchors
% \xtoksapp\t_pack_anchors_flush{\pack_anchors_flush{\number\c_pack_anchors_n}{#1}{#2}}%
@@ -228,23 +228,23 @@
\installcorenamespace{collectorcorners}
-\setvalue{\??collectorcorners\v!middle}%
+\defcsname\??collectorcorners\v!middle\endcsname
{\ifdim\d_pack_layers_x_size>\zeropoint
- \advance\d_pack_layers_x_position.5\d_pack_layers_x_size
+ \advanceby\d_pack_layers_x_position.5\d_pack_layers_x_size
\fi
\ifdim\d_pack_layers_y_size>\zeropoint
- \advance\d_pack_layers_y_position.5\d_pack_layers_y_size
+ \advanceby\d_pack_layers_y_position.5\d_pack_layers_y_size
\fi}
-\setvalue{\??collectorcorners\v!bottom}%
+\defcsname\??collectorcorners\v!bottom\endcsname
{\ifdim\d_pack_layers_y_size>\zeropoint
- \advance\d_pack_layers_y_position-\d_pack_layers_y_size
+ \advanceby\d_pack_layers_y_position-\d_pack_layers_y_size
\d_pack_layers_y_position-\d_pack_layers_y_position
\fi}
-\setvalue{\??collectorcorners\v!right}%
+\defcsname\??collectorcorners\v!right\endcsname
{\ifdim\d_pack_layers_x_size>\zeropoint
- \advance\d_pack_layers_x_position-\d_pack_layers_x_size
+ \advanceby\d_pack_layers_x_position-\d_pack_layers_x_size
\d_pack_layers_x_position-\d_pack_layers_x_position
\fi}
@@ -271,13 +271,13 @@
\setbox\nextbox\hpack
{\alignedbox[\collectorparameter\c!location]\vpack{\box\nextbox}}%
\boxmaxdepth\zeropoint % really needed, nice example
- \global\advance\boxhdisplacement\d_pack_layers_x_position
+ \global\advanceby\boxhdisplacement\d_pack_layers_x_position
\ifdim\boxhdisplacement<\zeropoint
\global\setbox\b_pack_boxes_collector\hpack
{\kern-\boxhdisplacement
\box\b_pack_boxes_collector}%
\fi
- \global\advance\boxvdisplacement\d_pack_layers_y_position
+ \global\advanceby\boxvdisplacement\d_pack_layers_y_position
\ifdim\boxvdisplacement<\zeropoint
\global\setbox\b_pack_boxes_collector\hpack
{\lower-\boxvdisplacement
@@ -359,8 +359,8 @@
{\box\nextbox}%
\setcollector
[caption][#1]%
- {\letdummyparameter\c!style\empty
- \letdummyparameter\c!color\empty
+ {\resetdummyparameter\c!style
+ \resetdummyparameter\c!color
\getdummyparameters[#2]%
\dousestyleparameter{\directdummyparameter\c!style}%
\setupinterlinespace
@@ -393,8 +393,8 @@
\installsimpleframedcommandhandler \??layeredtext {layeredtext} \??layeredtext
-\newdimen\d_pack_layeredtexts_width
-\newdimen\d_pack_layeredtexts_height
+\newdimension\d_pack_layeredtexts_width
+\newdimension\d_pack_layeredtexts_height
\definelayer % private
[\??layeredtextlayer]
@@ -465,7 +465,7 @@
\permanent\tolerant\protected\def\ornamenttext[#1]#*[#2]% takes another argument
{\bgroup
- \doifelseassignment{#1}
+ \doifelseassignment{#1}%
{\letdummyparameter\c!alternative\v!a
\getdummyparameters[#1]%
\doifelse{\directdummyparameter\c!alternative}\v!a
@@ -509,7 +509,7 @@
%
% \affiliation{drawing}{\externalfigure[hakker][width=3cm]}
-\newcount\c_pack_boxes_bleeds
+\newinteger\c_pack_boxes_bleeds
\installcorenamespace {bleeding}
@@ -535,25 +535,25 @@
\installcorenamespace{bleedinglocation}
-\setvalue{\??bleedinglocation t}{\settrue\c_pack_boxes_t\scratchhoffset\zeropoint}
-\setvalue{\??bleedinglocation b}{\settrue\c_pack_boxes_b\scratchhoffset\zeropoint}
-\setvalue{\??bleedinglocation l}{\settrue\c_pack_boxes_l\scratchvoffset\zeropoint}
-\setvalue{\??bleedinglocation r}{\settrue\c_pack_boxes_r\scratchvoffset\zeropoint}
-\setvalue{\??bleedinglocation bl}{\settrue\c_pack_boxes_l\settrue\c_pack_boxes_b}
-\setvalue{\??bleedinglocation lb}{\settrue\c_pack_boxes_l\settrue\c_pack_boxes_b}
-\setvalue{\??bleedinglocation br}{\settrue\c_pack_boxes_r\settrue\c_pack_boxes_b}
-\setvalue{\??bleedinglocation rb}{\settrue\c_pack_boxes_r\settrue\c_pack_boxes_b}
-\setvalue{\??bleedinglocation tl}{\settrue\c_pack_boxes_l\settrue\c_pack_boxes_t}
-\setvalue{\??bleedinglocation lt}{\settrue\c_pack_boxes_l\settrue\c_pack_boxes_t}
-\setvalue{\??bleedinglocation tr}{\settrue\c_pack_boxes_r\settrue\c_pack_boxes_t}
-\setvalue{\??bleedinglocation rt}{\settrue\c_pack_boxes_r\settrue\c_pack_boxes_t}
-
-\mutable\let\currentbleedposition\empty
-\mutable\let\currentpageposition \empty
+\defcsname\??bleedinglocation t\endcsname{\settrue\c_pack_boxes_t\scratchhoffset\zeropoint}
+\defcsname\??bleedinglocation b\endcsname{\settrue\c_pack_boxes_b\scratchhoffset\zeropoint}
+\defcsname\??bleedinglocation l\endcsname{\settrue\c_pack_boxes_l\scratchvoffset\zeropoint}
+\defcsname\??bleedinglocation r\endcsname{\settrue\c_pack_boxes_r\scratchvoffset\zeropoint}
+\defcsname\??bleedinglocation bl\endcsname{\settrue\c_pack_boxes_l\settrue\c_pack_boxes_b}
+\defcsname\??bleedinglocation lb\endcsname{\settrue\c_pack_boxes_l\settrue\c_pack_boxes_b}
+\defcsname\??bleedinglocation br\endcsname{\settrue\c_pack_boxes_r\settrue\c_pack_boxes_b}
+\defcsname\??bleedinglocation rb\endcsname{\settrue\c_pack_boxes_r\settrue\c_pack_boxes_b}
+\defcsname\??bleedinglocation tl\endcsname{\settrue\c_pack_boxes_l\settrue\c_pack_boxes_t}
+\defcsname\??bleedinglocation lt\endcsname{\settrue\c_pack_boxes_l\settrue\c_pack_boxes_t}
+\defcsname\??bleedinglocation tr\endcsname{\settrue\c_pack_boxes_r\settrue\c_pack_boxes_t}
+\defcsname\??bleedinglocation rt\endcsname{\settrue\c_pack_boxes_r\settrue\c_pack_boxes_t}
+
+\mutable\lettonothing\currentbleedposition
+\mutable\lettonothing\currentpageposition
\permanent\tolerant\protected\def\bleed[#1]%
{\hbox\bgroup
- \global\advance\c_pack_boxes_bleeds\plusone
+ \global\advanceby\c_pack_boxes_bleeds\plusone
%
\enforced\permanent\xdef\bleedwidth {\the\hsize}%
\enforced\permanent\xdef\bleedheight{\the\vsize}%
@@ -694,10 +694,10 @@
\permanent\tolerant\protected\def\setlayertext[#1]#*[#2]#*[#3]%
{\bgroup
- \letdummyparameter\c!align\empty
- \letdummyparameter\c!width\hsize
- \letdummyparameter\c!color\empty
- \letdummyparameter\c!style\empty
+ \resetdummyparameter\c!align
+ \letdummyparameter \c!width\hsize
+ \resetdummyparameter\c!color
+ \resetdummyparameter\c!style
\getdummyparameters[#3]%
\dowithnextboxcontent
{\forgetall
@@ -859,10 +859,10 @@
\pack_boxes_offset_check[#1]%
\dowithnextboxcs\pack_boxes_offsetfinish\hbox}
-\newcount\c_pack_boxes_offset_level
+\newinteger\c_pack_boxes_offset_level
\def\pack_boxes_offset_check
- {\advance\c_pack_boxes_offset_level\plusone
+ {\advanceby\c_pack_boxes_offset_level\plusone
\edef\currentoffsetbox{\the\c_pack_boxes_offset_level}%
\checkoffsetboxparent
\setupcurrentoffsetbox}
@@ -1030,8 +1030,8 @@
\ifcase\scratchcounter
% just one
\else
- \scratchdimen\scratchwidth \divide\scratchdimen\wd\nextbox\scratchnx\scratchdimen\advance\scratchnx\plusone\relax
- \scratchdimen\scratchheight\divide\scratchdimen\ht\nextbox\scratchny\scratchdimen\advance\scratchny\plusone\relax
+ \scratchdimen\scratchwidth \divideby\scratchdimen\wd\nextbox\scratchnx\scratchdimen\advanceby\scratchnx\plusone\relax
+ \scratchdimen\scratchheight\divideby\scratchdimen\ht\nextbox\scratchny\scratchdimen\advanceby\scratchny\plusone\relax
% to be considered: methods
\ifcase\scratchcounter
\or % x and y
@@ -1118,4 +1118,224 @@
[\c!width=\overlaywidth,\c!height=\overlayheight]
{\overlayimage{#1}}}
+%D Here is an end December 2021 experimental feature: anchored boxes.
+
+\installcorenamespace{boxanchor}
+\installcorenamespace{boxanchorid}
+\installcorenamespace{boxanchorbox}
+\installcorenamespace{boxpreset}
+\installcorenamespace{boxanchors}
+
+\installparameterhandler \??boxanchor {boxanchor}
+\installsetuphandler \??boxanchor {boxanchor}
+
+\setupboxanchor
+ [\c!xoffset=\zeropoint,
+ \c!yoffset=\zeropoint]
+
+\newinteger\c_boxes_n_of_anchors
+
+\permanent\protected\def\defineanchorbox[#1]%
+ {\ifcsname\??boxanchorid#1\endcsname
+ \box\lastnamedcs\emptybox
+ \else
+ \global\advanceby\c_boxes_n_of_anchors\plusone
+ \expandafter\integerdef\csname\??boxanchorid #1\endcsname\c_boxes_n_of_anchors
+ \expandafter\newbox \csname\??boxanchorbox#1\endcsname
+ \fi}
+
+\permanent\protected\def\defineanchorboxoverlay[#1]%
+ {\defineanchorbox[#1:\v!background]%
+ \defineanchorbox[#1:\v!foreground]%
+ \defineoverlay[#1:\v!background][\overlayanchorbox{#1:\v!background}]%
+ \defineoverlay[#1:\v!foreground][\overlayanchorbox{#1:\v!foreground}]}
+
+\permanent\def\namedanchorbox#1%
+ {\begincsname\??boxanchorid#1\endcsname} % no checking
+
+\permanent\protected\def\overlayanchorbox#1%
+ {\begingroup
+ \scratchcounter\csname\??boxanchorbox#1\endcsname
+ \ifvoid\scratchcounter\else
+ \boxsource\scratchcounter\namedanchorbox{#1}%
+ \wd\scratchcounter\d_overlay_width
+ \ht\scratchcounter\d_overlay_height
+ \dp\scratchcounter\d_overlay_depth
+ \box\scratchcounter
+ \fi
+ \endgroup}
+
+\permanent\tolerant\protected\def\setanchorbox[#1]#*[#2]%
+ {\begingroup
+ \dowithnextbox
+ {\def\currentanchorbox{#1}%
+ \setupboxanchor[#2]%
+ \scratchcounterone\csname\??boxanchorbox#1\endcsname\relax
+ \scratchxoffset\boxanchorparameter\c!xoffset\relax
+ \scratchyoffset\boxanchorparameter\c!yoffset\relax
+ \boxtarget\nextbox \namedanchorbox {#1}\relax
+ \boxanchors\nextbox
+ % target
+ \numexpr
+ \ifcsname\??boxpreset\boxanchorparameter\c!target\endcsname
+ \lastnamedcs
+ \else
+ \halfwaytotallistanchorcode
+ \fi
+ \relax
+ % source
+ \numexpr
+ \ifcsname\??boxpreset\boxanchorparameter\c!source\endcsname
+ \lastnamedcs
+ \else
+ \halfwaytotallistanchorcode
+ \fi
+ \relax
+ \ifzeropt\scratchxoffset\else
+ \boxxoffset\nextbox\scratchxoffset
+ \fi
+ \ifzeropt\scratchyoffset\else
+ \boxyoffset\nextbox\scratchyoffset
+ \fi
+ \global\setbox\scratchcounterone\hpack\bgroup
+ \unhbox\scratchcounterone
+ \kern-\wd\nextbox
+ \box\nextbox
+ \egroup
+ \endgroup}}
+
+\expandafter\integerdef\csname\??boxpreset\v!left \endcsname\leftoriginlistanchorcode
+\expandafter\integerdef\csname\??boxpreset\v!left,\v!height \endcsname\leftheightlistanchorcode
+\expandafter\integerdef\csname\??boxpreset\v!left,\v!top \endcsname\leftheightlistanchorcode
+\expandafter\integerdef\csname\??boxpreset\v!left,\v!depth \endcsname\leftdepthlistanchorcode
+\expandafter\integerdef\csname\??boxpreset\v!left,\v!bottom \endcsname\leftdepthlistanchorcode
+
+\expandafter\integerdef\csname\??boxpreset\v!right \endcsname\rightoriginlistanchorcode
+\expandafter\integerdef\csname\??boxpreset\v!right,\v!height \endcsname\rightheightlistanchorcode
+\expandafter\integerdef\csname\??boxpreset\v!right,\v!top \endcsname\rightheightlistanchorcode
+\expandafter\integerdef\csname\??boxpreset\v!right,\v!depth \endcsname\rightdepthlistanchorcode
+\expandafter\integerdef\csname\??boxpreset\v!right,\v!bottom \endcsname\rightdepthlistanchorcode
+
+\expandafter\integerdef\csname\??boxpreset\v!line \endcsname\centeroriginlistanchorcode
+\expandafter\integerdef\csname\??boxpreset\v!height \endcsname\centerheightlistanchorcode
+\expandafter\integerdef\csname\??boxpreset\v!depth \endcsname\centerdepthlistanchorcode
+
+\expandafter\integerdef\csname\??boxpreset\v!middle \endcsname\halfwaytotallistanchorcode
+\expandafter\integerdef\csname\??boxpreset\v!middle,\v!height\endcsname\halfwayheightlistanchorcode
+\expandafter\integerdef\csname\??boxpreset\v!middle,\v!top \endcsname\halfwayheightlistanchorcode
+\expandafter\integerdef\csname\??boxpreset\v!middle,\v!depth \endcsname\halfwaydepthlistanchorcode
+\expandafter\integerdef\csname\??boxpreset\v!middle,\v!bottom\endcsname\halfwaydepthlistanchorcode
+\expandafter\integerdef\csname\??boxpreset\v!middle,\v!left \endcsname\halfwayleftlistanchorcode
+\expandafter\integerdef\csname\??boxpreset\v!middle,\v!right \endcsname\halfwayrightlistanchorcode
+
+% Musical timestamp: 2022-02-07 while listening Hypneurotic from The Blurred Horizon (n times);
+% Jim Matheos with Gavin Harrison; very hypnotic indeed.
+
+\permanent\def\boxanchorpresetcode#1%
+ {\ifcsname\??boxpreset#1\endcsname\lastnamedcs\else\halfwaytotallistanchorcode\fi}
+
+\newinteger\registeredboxanchor
+
+\installmacrostack\boxanchoringclass
+
+\mutable\lettonothing\boxanchoringclass
+
+\newinteger\c_anchor_auto_box_class
+
+\permanent\protected\def\startboxanchoring[#1]% + == auto
+ {\push_macro_boxanchoringclass
+ \iftok{#1}{+}%
+ \global\advanceby\c_anchor_auto_box_class\plusone
+ \edef\boxanchoringclass{\the\c_anchor_auto_box_class::}%
+ \else
+ \edef\boxanchoringclass{#1}
+ \fi}
+
+\permanent\protected\def\stopboxanchoring
+ {\pop_macro_boxanchoringclass}
+
+\permanent\protected\def\registerboxanchor
+ {\global\advanceby\registeredboxanchor\minusone}
+
+\permanent\protected\def\defineboxanchor[#1]%
+ {\registerboxanchor
+ \global\expandafter\integerdef\csname\??boxanchors#1\endcsname\registeredboxanchor}
+
+\permanent\protected\def\doifnotanchorbox#1%
+ {\ifcsname\??boxanchors#1\endcsname
+ \expandafter\gobbleoneargument
+ \else
+ \expandafter\firstofoneargument
+ \fi}
+
+\permanent\def\namedboxanchor#1%
+ {\normalexpanded{\ifcsname\??boxanchors#1\endcsname\lastnamedcs\orelse\ifchknum#1\or#1\else\zerocount\fi}}
+
+\permanent\def\namespacedboxanchor#1%
+ {boxanchor:\number\namedboxanchor{#1}}
+
+\installcorenamespace{boxanchorcontent}
+
+% \installparameterhandler \??boxanchorcontent {boxanchorcontent}
+% \installautosetuphandler \??boxanchorcontent {boxanchorcontent}
+
+\installcommandhandler \??boxanchorcontent {boxanchorcontent} \??boxanchorcontent % no real need but let's have a define too
+
+\setupboxanchorcontent
+ [\c!yoffset=\zeropoint,
+ \c!xoffset=\zeropoint,
+ \c!width=\zeropoint,
+ \c!location=\v!height,
+ \c!corner=\v!depth]
+
+\permanent\tolerant\protected\def\setboxanchor[#1]#*[#2]#*[#3]#*% assumes \defineboxanchor[#1]
+ {\begingroup
+ \dowithnextbox
+ {\ifhastok={#2}%
+ \setupcurrentboxanchorcontent[#2]%
+ \else
+ \def\currentboxanchorcontent{#2}%
+ \setupcurrentboxanchorcontent[#3]%
+ \fi
+ \scratchxoffset\boxanchorcontentparameter\c!xoffset
+ \scratchyoffset\boxanchorcontentparameter\c!yoffset
+ \scratchcounter\namedboxanchor{#1}%
+ \registeranchorbox
+ \scratchcounter
+ \plusone % order
+ \hbox
+ \s!anchors % check order of these:
+ \boxanchorpresetcode{\boxanchorcontentparameter\c!corner}
+ \boxanchorpresetcode{\boxanchorcontentparameter\c!location}
+ \ifzeropt\scratchxoffset\else \s!xoffset \scratchxoffset\fi
+ \ifzeropt\scratchyoffset\else \s!yoffset \scratchyoffset\fi
+ \s!target \scratchcounter
+ {\box\nextbox}%
+ \endgroup}}
+
+%D The name might change:
+
+\permanent\protected\def\mathrowanchored #1{\alignmentwrapsource\namedboxanchor{#1}\relax}
+\permanent\protected\def\mathcellanchored#1{\alignmentcellsource\namedboxanchor{#1}\relax}
+
+%permanent\protected\def\mathboxanchored#1#2{#2\Umathsource\namedboxanchor{#1}\relax}
+
+\permanent\tolerant\protected\def\mathboxanchored[#1]#:#2#3%
+ {#3\Umathsource\iftok{#1}{nucleus}#1\fi\namedboxanchor{\boxanchoringclass:#2}\relax}
+
+% to be used as:
+%
+% \scratchcounter\registeredboxanchor
+%
+% \registeranchorbox
+% \scratchcounter
+% \plusone
+% \ruledhbox{...}
+%
+% \hbox source \scratchcounter
+
+% \negatexlistsigncode
+% \negateylistsigncode
+% \negatelistsigncode
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/pack-com.mkxl b/Master/texmf-dist/tex/context/base/mkxl/pack-com.mkxl
index 44cfc9a4fa2..0fff4ca1bbf 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/pack-com.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/pack-com.mkxl
@@ -75,18 +75,24 @@
\globalresetsystemmode{combination}%
\to \everyinsidefloat
-\newcount\c_pack_combinations_nesting % local
-
-\newcount\c_pack_combinations_x % global
-\newcount\c_pack_combinations_y % global
-\newcount\c_pack_combinations_max % global
-
-\newdimen\d_pack_combinations_ht % global
-
-\newbox \b_pack_combinations_captions % global % can go
-\newbox \b_pack_combinations_temp % global % can go
-\newbox \b_pack_combinations_content % local
-\newbox \b_pack_combinations_caption % local
+\newinteger \c_pack_combinations_nesting % local
+
+\newinteger \c_pack_combinations_x % global
+\newinteger \c_pack_combinations_y % global
+\newinteger \c_pack_combinations_x_saved
+\newinteger \c_pack_combinations_y_saved
+\newinteger \c_pack_combinations_max % global
+\newinteger \c_pack_combinations_max_saved
+\newdimension\d_pack_combinations_ht % global
+\newdimension\d_pack_combinations_ht_saved
+\newbox \b_pack_combinations_captions % global % can go
+\newbox \b_pack_combinations_captions_saved
+\newbox \b_pack_combinations_temp % global % can go
+\newbox \b_pack_combinations_temp_saved
+\newbox \b_pack_combinations_content % local
+\newbox \b_pack_combinations_content_saved
+\newbox \b_pack_combinations_caption % local
+\newbox \b_pack_combinations_caption_saved
\installcorenamespace{combination}
@@ -95,21 +101,10 @@
\initializeboxstack{\??combination captions}
\initializeboxstack{\??combination temp}
-\newcount\c_pack_combinations_x_saved
-\newcount\c_pack_combinations_y_saved
-\newcount\c_pack_combinations_max_saved
-
-\newdimen\d_pack_combinations_ht_saved
-
-\newbox \b_pack_combinations_captions_saved
-\newbox \b_pack_combinations_temp_saved
-\newbox \b_pack_combinations_content_saved
-\newbox \b_pack_combinations_caption_saved
-
\setfalse\c_strc_constructions_define_commands
\def\pack_combinations_push
- {\advance\c_pack_combinations_nesting\plusone
+ {\advanceby\c_pack_combinations_nesting\plusone
\ifnum\c_pack_combinations_nesting>\plusone
\c_pack_combinations_x_saved \c_pack_combinations_x
\c_pack_combinations_y_saved \c_pack_combinations_y
@@ -136,7 +131,7 @@
\else
\globalresetsystemmode{combination}% why global
\fi
- \advance\c_pack_combinations_nesting\minusone}
+ \advanceby\c_pack_combinations_nesting\minusone}
\definelabel
[\v!combination] % handy for configuring
@@ -174,10 +169,10 @@
\settrue\c_strc_constructions_define_commands
\to \everydefinecombination
-\setvalue{\??combinationlocation\v!left }{\let\m_pack_combinations_leftfiller\relax}
-\setvalue{\??combinationlocation\v!right }{\let\m_pack_combinations_rightfiller\relax}
-\setvalue{\??combinationlocation\v!top }{\let\m_pack_combinations_valigner\depthonlybox}
-\setvalue{\??combinationlocation\v!middle}{\let\m_pack_combinations_valigner\halfwaybox}
+\defcsname\??combinationlocation\v!left \endcsname{\let\m_pack_combinations_leftfiller \relax}
+\defcsname\??combinationlocation\v!right \endcsname{\let\m_pack_combinations_rightfiller\relax}
+\defcsname\??combinationlocation\v!top \endcsname{\let\m_pack_combinations_valigner \depthonlybox}
+\defcsname\??combinationlocation\v!middle\endcsname{\let\m_pack_combinations_valigner \halfwaybox}
\def\pack_combinations_location_reset
{\let\m_pack_combinations_rightfiller\hfil
@@ -228,16 +223,101 @@
\newtoks\everycombination
-\aliased\let\combination\empty
+\aliased\lettonothing\combination
-\let\p_nx_ny\empty
+\lettonothing\p_nx_ny
-\permanent\protected\def\stopcombination
- {\bgroup\normalexpanded{\egroup{}\ntimes{{}{}}\c_pack_combinations_y}% brr
- \dostoptagged
- \egroup
- \pack_combinations_pop
- \egroup}
+% \permanent\tolerant\protected\def\startcombination[#1]#*[#2]% can be simplified
+% {\bgroup % so we can grab a group
+% \pack_combinations_push
+% \edef\currentcombination{#1}%
+% \edef\p_nx_ny{#2}%
+% %
+% \ifempty\p_nx_ny
+% \ifcondition\validassignment{#1}%
+% \lettonothing\currentcombination
+% \setupcurrentcombination[#1]%
+% \edef\p_nx_ny{\combinationparameter\c!nx*\combinationparameter\c!ny*}%
+% \else
+% \doifelseinstring{*}\currentcombination
+% {\edef\p_nx_ny{\currentcombination*\plusone*}%
+% \lettonothing\currentcombination}
+% {\doifelsenumber\currentcombination
+% {\edef\p_nx_ny{\currentcombination*\plusone*}%
+% \lettonothing\currentcombination}
+% {\edef\p_nx_ny{\combinationparameter\c!nx*\combinationparameter\c!ny*}}}%
+% \fi
+% \else
+% \ifcondition\validassignment{#2}%
+% \setupcurrentcombination[#2]%
+% \edef\p_nx_ny{\combinationparameter\c!nx*\combinationparameter\c!ny*}%
+% \else
+% \edef\p_nx_ny{\p_nx_ny*\plusone*}%
+% \fi
+% \fi
+% %
+% % test first:
+% %
+% % \ifempty\p_nx_ny
+% % \ifhastok={#1}%
+% % \lettonothing\currentcombination
+% % \setupcurrentcombination[#1]%
+% % \edef\p_nx_ny{\combinationparameter\c!nx*\combinationparameter\c!ny*}%
+% % \orelse\ifhastok*{\currentcombination}%
+% % \edef\p_nx_ny{\currentcombination*\plusone*}%
+% % \lettonothing\currentcombination
+% % \orelse\ifchknum\currentcombination\or
+% % \edef\p_nx_ny{\currentcombination*\plusone*}%
+% % \lettonothing\currentcombination
+% % \else
+% % \edef\p_nx_ny{\combinationparameter\c!nx*\combinationparameter\c!ny*}%
+% % \fi
+% % \orelse\ifhastok={#2}%
+% % \setupcurrentcombination[#2]%
+% % \edef\p_nx_ny{\combinationparameter\c!nx*\combinationparameter\c!ny*}%
+% % \else
+% % \edef\p_nx_ny{\p_nx_ny*\plusone*}%
+% % \fi
+% %
+% \forgetall
+% %
+% \the\everycombination
+% %
+% \enforced\let\startcontent\pack_common_content_start
+% \enforced\let\stopcontent \pack_common_content_stop
+% \enforced\let\startcaption\pack_common_caption_start
+% \enforced\let\stopcaption \pack_common_caption_stop
+% %
+% \edef\p_height {\combinationparameter\c!height}%
+% \edef\p_width {\combinationparameter\c!width}%
+% \edef\p_location{\combinationparameter\c!location}%
+% \edef\p_distance{\combinationparameter\c!distance}%
+% %
+% \pack_combinations_location_reset
+% \rawprocesscommacommand[\p_location]\pack_combinations_location_step
+% %
+% \dostarttaggedchained\t!combination\currentcombination\??combination
+% \vbox \ifx\p_height\v!fit\else to \p_height \fi \bgroup
+% \enforced\lettonothing\combination % permits \combination{}{} handy for cld
+% \normalexpanded{\pack_combinations_start_indeed[\p_nx_ny]}}
+%
+% \permanent\protected\def\stopcombination
+% {\bgroup\normalexpanded{\egroup{}\ntimes{{}{}}\c_pack_combinations_y}% brr
+% \dostoptagged
+% \egroup
+% \pack_combinations_pop
+% \egroup}
+
+\installcorenamespace{combinationmethod}
+
+% \defcsname\??combinationmethod:\v!start\endcsname
+% {}
+%
+% \defcsname\??combinationmethod\endcsname
+% {\vbox}
+%
+% \defcsname\??combinationmethod:\v!stop\endcsname
+% {}
\permanent\tolerant\protected\def\startcombination[#1]#*[#2]% can be simplified
{\bgroup % so we can grab a group
@@ -247,16 +327,16 @@
%
\ifempty\p_nx_ny
\ifcondition\validassignment{#1}%
- \let\currentcombination\empty
+ \lettonothing\currentcombination
\setupcurrentcombination[#1]%
\edef\p_nx_ny{\combinationparameter\c!nx*\combinationparameter\c!ny*}%
\else
\doifelseinstring{*}\currentcombination
{\edef\p_nx_ny{\currentcombination*\plusone*}%
- \let\currentcombination\empty}
+ \lettonothing\currentcombination}
{\doifelsenumber\currentcombination
{\edef\p_nx_ny{\currentcombination*\plusone*}%
- \let\currentcombination\empty}
+ \lettonothing\currentcombination}
{\edef\p_nx_ny{\combinationparameter\c!nx*\combinationparameter\c!ny*}}}%
\fi
\else
@@ -267,20 +347,21 @@
\edef\p_nx_ny{\p_nx_ny*\plusone*}%
\fi
\fi
+ \begincsname\??combinationmethod\combinationparameter\c!method:\v!start\endcsname
%
% test first:
%
% \ifempty\p_nx_ny
% \ifhastok={#1}%
-% \let\currentcombination\empty
+% \lettonothing\currentcombination
% \setupcurrentcombination[#1]%
% \edef\p_nx_ny{\combinationparameter\c!nx*\combinationparameter\c!ny*}%
% \orelse\ifhastok*{\currentcombination}%
% \edef\p_nx_ny{\currentcombination*\plusone*}%
-% \let\currentcombination\empty
+% \lettonothing\currentcombination
% \orelse\ifchknum\currentcombination\or
% \edef\p_nx_ny{\currentcombination*\plusone*}%
-% \let\currentcombination\empty
+% \lettonothing\currentcombination
% \else
% \edef\p_nx_ny{\combinationparameter\c!nx*\combinationparameter\c!ny*}%
% \fi
@@ -309,12 +390,25 @@
\rawprocesscommacommand[\p_location]\pack_combinations_location_step
%
\dostarttaggedchained\t!combination\currentcombination\??combination
- \vbox \ifx\p_height\v!fit\else to \p_height \fi \bgroup
- \enforced\let\combination\empty % permits \combination{}{} handy for cld
+% \vbox \ifx\p_height\v!fit\else to \p_height \fi \bgroup
+ \ifcsname\??combinationmethod\combinationparameter\c!method\endcsname
+ \lastnamedcs\else\vbox
+ \fi\ifx\p_height\v!fit\else to \p_height \fi \bgroup
+ \enforced\lettonothing\combination % permits \combination{}{} handy for cld
\normalexpanded{\pack_combinations_start_indeed[\p_nx_ny]}}
+\permanent\protected\def\stopcombination
+ {\bgroup\normalexpanded{\egroup{}\ntimes{{}{}}\c_pack_combinations_y}% brr
+ \dostoptagged
+ \egroup
+ \begincsname\??combinationmethod\combinationparameter\c!method:\v!stop\endcsname
+ \pack_combinations_pop
+ \egroup}
+
\let\pack_combinations_check_x_y\relax
+\aliased\let\combinationwidth\!!zeropoint
+
\protected\def\pack_combinations_start_indeed[#1*#2*#3]%
{\global\c_pack_combinations_x#1\relax
\global\c_pack_combinations_y#2\relax
@@ -324,16 +418,21 @@
\dotagcombination
\global\setbox\b_pack_combinations_captions\emptybox
\global\c_pack_combinations_max\c_pack_combinations_x
- \multiply\c_pack_combinations_y\c_pack_combinations_x
+ \multiplyby\c_pack_combinations_y\c_pack_combinations_x
\tabskip\zeropoint
+ \enforced\permanent\protected\edef\combinationwidth % \immutable
+ {\the\dimexpr
+ (\hsize-\numexpr\c_pack_combinations_x-\plusone\relax\dimexpr\combinationparameter\c!distance\relax)/\c_pack_combinations_x
+ \relax}%
\halign \ifx\p_width\v!fit\else to \p_width \fi \bgroup % repetitive preamble
+ % \halign noskips \ifx\p_width\v!fit\else to \p_width \fi \bgroup % repetitive preamble
\aligntab
\m_pack_combinations_leftfiller
- \alignmark\alignmark
+ \aligncontent
\m_pack_combinations_rightfiller
\aligntab
\tabskip\zeropoint \s!plus 1fill % \fillskip
- \alignmark\alignmark
+ \aligncontent
\cr
\pack_combinations_pickup}
@@ -359,10 +458,10 @@
\dostarttagged\t!combinationcaption\empty
\expandnamespacemacro\??combinationalternative\p_pack_combinations_alternative\v!text}
-\setvalue{\??combinationalternative\v!text}%
+\defcsname\??combinationalternative\v!text\endcsname
{\expandafterpars\pack_combinations_alternative_text_indeed}
-\setvalue{\??combinationalternative\v!label}%
+\defcsname\??combinationalternative\v!label\endcsname
{\expandafterpars\pack_combinations_alternative_label_indeed}
\def\pack_combinations_alternative_text_indeed
@@ -422,8 +521,8 @@
% we need to save the caption for a next alignment line
\pack_combinations_save_caption}%
\ifnum\c_pack_combinations_y>\plusone
- \global\advance\c_pack_combinations_y\minusone
- \global\advance\c_pack_combinations_x\minusone
+ \global\advanceby\c_pack_combinations_y\minusone
+ \global\advanceby\c_pack_combinations_x\minusone
\ifcase\c_pack_combinations_x
\doubleexpandafter\pack_combinations_pickup_package_pair_a
\else
@@ -488,7 +587,7 @@
\foundbox{\??combinationcaption:\number\c_pack_combinations_nesting}{\number\c_pack_combinations_x}%
\vss
\egroup
- \global\advance\c_pack_combinations_x\minusone
+ \global\advanceby\c_pack_combinations_x\minusone
\ifnum\c_pack_combinations_x>\zerocount % \c_pack_combinations_max
\expandafter\pack_combinations_flush_captions_yes_followup
\else
@@ -558,7 +657,7 @@
{\pack_combinations_float_hack_b{\recurselevel}}%
\to\scratchtoks}% brrr
\let\pack_combinations_check_x_y\pack_combinations_float_check_x_y
- \expanded{\startcombination[#1]\the\scratchtoks}\stopcombination
+ \normalexpanded{\startcombination[#1]\the\scratchtoks}\stopcombination
\resetlocalfloats
\egroup}
@@ -708,15 +807,15 @@
% watch the hsize/vsize tricks
-\newbox \b_pack_pairedboxes_first
-\newbox \b_pack_pairedboxes_second
-\newdimen\s_pack_pairedboxes_size
+\newbox \b_pack_pairedboxes_first
+\newbox \b_pack_pairedboxes_second
+\newdimension\s_pack_pairedboxes_size
\appendtoks
- \frozen\instance\setuevalue{\e!setup\currentpairedbox\e!endsetup}{\setuppairedbox [\currentpairedbox]}%
- \frozen\instance\setuevalue{\e!place\currentpairedbox }{\placepairedbox [\currentpairedbox]}% one argument is mandate anyway
- \frozen\instance\setuevalue{\e!start\e!place\currentpairedbox }{\startplacepairedbox[\currentpairedbox]}% one argument is mandate anyway
- \frozen\instance\setuevalue{\e!stop\e!place \currentpairedbox }{\stopplacepairedbox }%
+ \frozen\protected\instance\edefcsname\e!setup\currentpairedbox\e!endsetup\endcsname{\setuppairedbox [\currentpairedbox]}%
+ \frozen\protected\instance\edefcsname\e!place\currentpairedbox \endcsname{\placepairedbox [\currentpairedbox]}% one argument is mandate anyway
+ \frozen\protected\instance\edefcsname\e!start\e!place\currentpairedbox \endcsname{\startplacepairedbox[\currentpairedbox]}% one argument is mandate anyway
+ \frozen\protected\instance\edefcsname\e!stop\e!place \currentpairedbox \endcsname{\stopplacepairedbox }%
\to \everydefinepairedbox
\permanent\tolerant\protected\def\startplacepairedbox[#1]#*[#2]%
@@ -981,10 +1080,10 @@
\def\pack_sidebyside_one {\bgroup\setbox\scratchboxone\box\nextbox\dowithnextboxcs\pack_sidebyside_two \hbox}
\def\pack_topofeachother_two{\setbox\scratchboxtwo\box\nextbox
- \halign{\hss\alignmark\alignmark\hss\cr\box\scratchboxone\cr\box\scratchboxtwo\cr}%
+ \halign{\hss\aligncontent\hss\cr\box\scratchboxone\cr\box\scratchboxtwo\cr}%
\egroup\egroup}
\def\pack_sidebyside_two {\setbox\scratchboxtwo\box\nextbox
- \valign{\vss\alignmark\alignmark\vss\cr\box\scratchboxone\cr\box\scratchboxtwo\cr}%
+ \valign{\vss\aligncontent\vss\cr\box\scratchboxone\cr\box\scratchboxtwo\cr}%
\egroup\egroup}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/pack-cut.mkxl b/Master/texmf-dist/tex/context/base/mkxl/pack-cut.mkxl
index 0cd06ed43e8..772b2ba6466 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/pack-cut.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/pack-cut.mkxl
@@ -13,6 +13,8 @@
\unprotect
+% to be redone in a more modern way
+
%D \macros
%D {makecutbox, cuthbox, cutvbox, cutvtop}
%D
@@ -47,22 +49,23 @@
%D By setting the next macros one can influence the length of the marks as well as
%D the horizontal and vertical divisions.
-\newdimen\d_pack_cutmarks_width
-\newdimen\d_pack_cutmarks_height
-\newdimen\d_pack_cutmarks_depth
+\newdimension\d_pack_cutmarks_width
+\newdimension\d_pack_cutmarks_height
+\newdimension\d_pack_cutmarks_depth
-\newcount\horizontalcutmarks \horizontalcutmarks \plustwo
-\newcount\verticalcutmarks \verticalcutmarks \plustwo
-\newcount\cutmarkoffset \cutmarkoffset \plusone
+\newinteger \horizontalcutmarks \horizontalcutmarks \plustwo
+\newinteger \verticalcutmarks \verticalcutmarks \plustwo
+\newinteger \cutmarkoffset \cutmarkoffset \plusone
\mutable\let\cutmarksymbol \relax
-\mutable\let\cutmarktoptext \empty
-\mutable\let\cutmarkbottomtext \empty
-\mutable\let\cutmarkhoffset \empty
-\mutable\let\cutmarkvoffset \empty
\mutable\def\cutmarklength {2\bodyfontsize}
\mutable\def\cutmarkrulethickness{\onepoint}
+\mutable\lettonothing\cutmarktoptext
+\mutable\lettonothing\cutmarkbottomtext
+\mutable\lettonothing\cutmarkhoffset
+\mutable\lettonothing\cutmarkvoffset
+
\permanent\protected\def\horizontalcuts
{\hpack to \d_pack_cutmarks_width
{\dorecurse\horizontalcutmarks{\vrule\s!width\cutmarkrulethickness\s!height\cutmarklength\hfill}%
@@ -101,9 +104,8 @@
\vss}%
\hss}}
-\permanent\protected\def\makecutbox#1%
- {\bgroup
- \d_pack_cutmarks_height\ht#1%
+\permanent\protected\def\makecutbox#1% not grouped !
+ {\d_pack_cutmarks_height\ht#1%
\d_pack_cutmarks_depth \dp#1%
\d_pack_cutmarks_width \wd#1%
\setbox#1\hpack
@@ -121,7 +123,7 @@
{\scratchskip\ifempty\cutmarkhoffset\cutmarkoffset\scratchdimen\else\cutmarkhoffset\fi
\setbox\scratchbox\hpack{\verticalcuts}%
\llap{\copy\scratchbox\hskip\scratchskip}%
- \ifdim\d_pack_cutmarks_depth=\zeropoint
+ \ifzeropt\d_pack_cutmarks_depth
\hfill
\else
\bgroup
@@ -155,7 +157,7 @@
\wd#1\d_pack_cutmarks_width
\ht#1\d_pack_cutmarks_height
\dp#1\d_pack_cutmarks_depth
- \egroup}
+ \box#1}
\permanent\protected\def\cuthbox{\hpack\bgroup\dowithnextbox{\makecutbox\nextbox\flushnextbox\egroup}\hbox}
\permanent\protected\def\cutvbox{\vpack\bgroup\dowithnextbox{\makecutbox\nextbox\flushnextbox\egroup}\vbox}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/pack-lyr.mkxl b/Master/texmf-dist/tex/context/base/mkxl/pack-lyr.mkxl
index 3c0352bf3d1..b93d3296079 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/pack-lyr.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/pack-lyr.mkxl
@@ -97,51 +97,51 @@
\permanent\def\layeranchor{\currentlayer:\the\realpageno}
-\let\p_pack_layers_doublesided\empty
-\let\p_pack_layers_state \empty
-\let\p_pack_layers_option \empty
-\let\p_pack_layers_method \empty
-\let\p_pack_layers_preset \empty
-\let\p_pack_layers_rotation \empty
-\let\p_pack_layers_position \empty
-\let\p_pack_layers_hoffset \empty
-\let\p_pack_layers_voffset \empty
-\let\p_pack_layers_offset \empty
-\let\p_pack_layers_dx \empty
-\let\p_pack_layers_dy \empty
-\let\p_pack_layers_sx \empty
-\let\p_pack_layers_sy \empty
-\let\p_pack_layers_x \empty
-\let\p_pack_layers_y \empty
-\let\p_pack_layers_corner \empty
-\let\p_pack_layers_location \empty
-\let\p_pack_layers_line \empty
-\let\p_pack_layers_column \empty
-\let\p_pack_layers_width \empty
-\let\p_pack_layers_height \empty
-\let\p_pack_layers_direction \empty
-\let\p_pack_layers_region \empty
-
-\let\m_pack_layers_page \empty
-\let\m_pack_layers_target \empty
-\let\m_pack_layers_region \empty
-\let\m_pack_layers_anchor \empty
+\lettonothing\p_pack_layers_doublesided
+\lettonothing\p_pack_layers_state
+\lettonothing\p_pack_layers_option
+\lettonothing\p_pack_layers_method
+\lettonothing\p_pack_layers_preset
+\lettonothing\p_pack_layers_rotation
+\lettonothing\p_pack_layers_position
+\lettonothing\p_pack_layers_hoffset
+\lettonothing\p_pack_layers_voffset
+\lettonothing\p_pack_layers_offset
+\lettonothing\p_pack_layers_dx
+\lettonothing\p_pack_layers_dy
+\lettonothing\p_pack_layers_sx
+\lettonothing\p_pack_layers_sy
+\lettonothing\p_pack_layers_x
+\lettonothing\p_pack_layers_y
+\lettonothing\p_pack_layers_corner
+\lettonothing\p_pack_layers_location
+\lettonothing\p_pack_layers_line
+\lettonothing\p_pack_layers_column
+\lettonothing\p_pack_layers_width
+\lettonothing\p_pack_layers_height
+\lettonothing\p_pack_layers_direction
+\lettonothing\p_pack_layers_region
+
+\lettonothing\m_pack_layers_page
+\lettonothing\m_pack_layers_target
+\lettonothing\m_pack_layers_region
+\lettonothing\m_pack_layers_anchor
\newconditional\c_pack_layers_repeated
\newconditional\c_pack_layers_trace
-\newcount \c_pack_layers_current_data
+\newinteger \c_pack_layers_current_data
\newbox\b_layers \pushoverloadmode \mutable\let\b_layers\b_layers \popoverloadmode
-\newdimen\d_pack_layers_x_size
-\newdimen\d_pack_layers_y_size
-\newdimen\d_pack_layers_x_offset
-\newdimen\d_pack_layers_y_offset
-\newdimen\d_pack_layers_x_position
-\newdimen\d_pack_layers_y_position
+\newdimension\d_pack_layers_x_size
+\newdimension\d_pack_layers_y_size
+\newdimension\d_pack_layers_x_offset
+\newdimension\d_pack_layers_y_offset
+\newdimension\d_pack_layers_x_position
+\newdimension\d_pack_layers_y_position
-\newdimen\layerwidth
-\newdimen\layerheight
+\newdimension\layerwidth
+\newdimension\layerheight
\mutable\let\lastlayerxpos\!!zeropoint
\mutable\let\lastlayerypos\!!zeropoint
@@ -196,8 +196,8 @@
%D \setlayer [identifier] [optional parameters] {data}
%D \stoptyping
-\mutable\let\currentlayerwidth \empty
-\mutable\let\currentlayerheight\empty
+\mutable\lettonothing\currentlayerwidth
+\mutable\lettonothing\currentlayerheight
\permanent\tolerant\protected\def\setcurrentlayerdimensions[#1]#*[#2]% name left|right
{\edef\currentlayerwidth {\thelayerwidth {#2#1}}%
@@ -218,7 +218,7 @@
\edef\m_pack_layers_target{#2}%
\pack_layers_set_indeed{#3}%
\orelse\ifhastok={#2}%
- \let\m_pack_layers_target\empty
+ \lettonothing\m_pack_layers_target
\pack_layers_set_indeed{#2}%
\else
\edef\m_pack_layers_target{#2}%
@@ -227,7 +227,7 @@
\def\pack_layers_set_indeed#1%
{\page_backgrounds_recalculate % brrr
- \global\advance\c_pack_layers_current_data\plusone
+ \global\advanceby\c_pack_layers_current_data\plusone
\forgetall
\dontcomplain
\edef\p_pack_layers_option{\layerparameter\c!option}%
@@ -400,10 +400,12 @@
{\alignedbox[\p_pack_layers_location]\vpack{\box\nextbox}}%
\fi
\ifnum\p_pack_layers_line=\zerocount\else % no \ifcase, can be negative
- \advance\d_pack_layers_y_position\dimexpr\p_pack_layers_line\lineheight+\topskip-\lineheight-\ht\nextbox\relax
+ % \ifzero\p_pack_layers_line\else % todo: test this
+ \advanceby\d_pack_layers_y_position\dimexpr\p_pack_layers_line\lineheight+\topskip-\lineheight-\ht\nextbox\relax
\fi
\ifnum\p_pack_layers_column=\zerocount\else % no \ifcase, can be negative
- \advance\d_pack_layers_x_position\layoutcolumnoffset\p_pack_layers_column\relax
+ % \ifzero\p_pack_layers_column\else % todo: test this
+ \advanceby\d_pack_layers_x_position\layoutcolumnoffset\p_pack_layers_column\relax
\fi
\ifx\p_pack_layers_location\v!grid
\setbox\nextbox\hpack
@@ -414,14 +416,14 @@
\ifdim\scratchdimen<\getboxllx\b_layers_page
\gsetboxllx\b_layers_page\scratchdimen
\fi
- \advance\scratchdimen\wd\nextbox
+ \advanceby\scratchdimen\wd\nextbox
\wd\nextbox\ifdim\scratchdimen>\scratchwidth \scratchdimen \else \scratchwidth \fi
\scratchdimen\dimexpr\d_pack_layers_y_position+\d_pack_layers_y_offset\relax
\ifdim\scratchdimen<\getboxlly\b_layers_page
\gsetboxlly\b_layers_page\scratchdimen
\fi
% ll compensation
- \advance\scratchdimen\dimexpr\ht\nextbox+\dp\nextbox\relax
+ \advanceby\scratchdimen\dimexpr\ht\nextbox+\dp\nextbox\relax
\ht\nextbox\ifdim\scratchdimen>\scratchheight \scratchdimen \else \scratchheight \fi
\dp\nextbox\zeropoint
% placement
@@ -449,27 +451,29 @@
\def\pack_layers_set_bottom_positions
{\ifnum\p_pack_layers_line=\zerocount\else % can be < 0
+% {\ifzero\p_pack_layers_line\else % todo: test this
\edef\p_pack_layers_line{\the\numexpr-\p_pack_layers_line+\layoutlines+\plusone\relax}% use counter instead ?
\fi
\ifdim\d_pack_layers_y_size>\zeropoint
- \advance\d_pack_layers_y_position-\d_pack_layers_y_size
+ \advanceby\d_pack_layers_y_position-\d_pack_layers_y_size
\d_pack_layers_y_position-\d_pack_layers_y_position
\d_pack_layers_y_offset-\d_pack_layers_y_offset
\fi}
\def\pack_layers_set_right_positions
{\ifnum\p_pack_layers_column=\zerocount\else % can be < 0
+% {\ifzero\p_pack_layers_column\else % todo: test this
\edef\p_pack_layers_column{\the\numexpr-\layerparameter\c!column+\layoutcolumns+\plusone\relax}% use counter instead ?
\fi
\ifdim\d_pack_layers_x_size>\zeropoint
- \advance\d_pack_layers_x_position-\d_pack_layers_x_size
+ \advanceby\d_pack_layers_x_position-\d_pack_layers_x_size
\d_pack_layers_x_position-\d_pack_layers_x_position
\d_pack_layers_x_offset-\d_pack_layers_x_offset
\fi}
\def\pack_layers_set_middle_positions
- {\ifdim\d_pack_layers_x_size>\zeropoint \advance\d_pack_layers_x_position.5\d_pack_layers_x_size \fi
- \ifdim\d_pack_layers_y_size>\zeropoint \advance\d_pack_layers_y_position.5\d_pack_layers_y_size \fi}
+ {\ifdim\d_pack_layers_x_size>\zeropoint \advanceby\d_pack_layers_x_position.5\d_pack_layers_x_size \fi
+ \ifdim\d_pack_layers_y_size>\zeropoint \advanceby\d_pack_layers_y_position.5\d_pack_layers_y_size \fi}
%D Given the task to be accomplished, the previous macro is not even that
%D complicated. It mainly comes down to skipping to the right place and placing a
@@ -657,11 +661,11 @@
%
\pack_layers_bottom_fill}%
% \edef\currentlayer{#2}% :\the\realpageno}% local .. check \anchor
- % \edef\p_pack_layers_position{\layerparameter\c!position}% local
+ \edef\p_pack_layers_position{\layerparameter\c!position}% local
\ifx\p_pack_layers_position\v!yes
\edef\p_pack_layers_region{\layerparameter\c!region}%
\ifempty\p_pack_layers_region\else
- \anch_mark_tagged_box\nextbox\p_pack_layers_region % was \layeranchor
+ \anch_mark_tagged_box\nextbox\p_pack_layers_region\zerocount % was \layeranchor
\fi
\fi
\box\nextbox
diff --git a/Master/texmf-dist/tex/context/base/mkxl/pack-mat.mkxl b/Master/texmf-dist/tex/context/base/mkxl/pack-mat.mkxl
new file mode 100644
index 00000000000..a810c8a47ae
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/pack-mat.mkxl
@@ -0,0 +1,384 @@
+%D \module
+%D [ file=pack-rul, % was core-rul,
+%D version=2022.02.23,
+%D title=\CONTEXT\ Packaging Macros,
+%D subtitle=Ruled Math,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%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 Packaging Macros / Ruled Math}
+
+%D This is a by product of the math improvement activity by Mikael Sundqvist and
+%D myself. More might end up here and more control might be added.
+
+\unprotect
+
+% todo \v!mathframed
+% todo \v!mathstrikeout
+
+\newconditional\c_framed_math_framed
+
+\installtextracker
+ {framed.math}
+ {\settrue \c_framed_math_framed}
+ {\setfalse\c_framed_math_framed}
+
+\integerdef\c_framed_math_last_left \zerocount
+\integerdef\c_framed_math_last_right\zerocount
+
+\installglobalmacrostack\c_framed_math_last_left
+\installglobalmacrostack\c_framed_math_last_right
+
+\installcorenamespace{mathframed}
+
+\defineframed[\??mathframed]
+
+\setupframed[\??mathframed][\c!location=\v!middle]
+
+\tolerant\permanent\protected\def\definemathframed[#1]#*[#2]#*[#3]%
+ {\ifarguments\or
+ \defineframed[#1][\??mathframed]%
+ \or
+ \defineframed[#1][\??mathframed][#2]%
+ \or
+ \defineframed[#1][#2][#3]%
+ \fi
+ \tolerant\frozen\protected\defcsname#1\endcsname{\math_framed{#1}}}
+
+\definemathframed[mathframed]
+
+% \def\math_framed#1#*[#2]#:#3%
+% {\begingroup
+% \ifconditional\c_framed_math_framed
+% \defineboxanchor[temp]%
+% \fi
+% \setmathatomrule\mathbegincode\mathbincode\allmathstyles\mathbegincode\mathbincode % hm
+% \normalexpanded
+% {\setbox\scratchbox\hpack
+% \ifconditional\c_framed_math_framed
+% \s!source \namedboxanchor{temp}
+% \fi
+% \s!ymove \Umathaxis\Ustyle\mathstyle
+% \bgroup
+% \localframedwithsettings
+% [#1][#2]%
+% {\startimath
+% \Ustyle\mathstyle
+% #3%
+% \stopimath
+% \integerdef\c_framed_math_last_left \lastleftclass
+% \integerdef\c_framed_math_last_right\lastrightclass
+% \push_macro_c_framed_math_last_left
+% \push_macro_c_framed_math_last_right
+% }%
+% \egroup}%
+% \pop_macro_c_framed_math_last_left
+% \pop_macro_c_framed_math_last_right
+% \mathatom
+% \s!class \mathexplicitcode
+% \ifnum\c_framed_math_last_left <\zerocount\else\s!leftclass \c_framed_math_last_left \fi
+% \ifnum\c_framed_math_last_right<\zerocount\else\s!rightclass\c_framed_math_last_right\fi
+% \bgroup
+% \ifconditional\c_framed_math_framed
+% \setboxanchor[temp][\c!corner={\v!left ,\v!bottom},\c!location={\v!right,\v!height}]%
+% \hpack{\smallinfofont\the\c_framed_math_last_left}%
+% \setboxanchor[temp][\c!corner={\v!right,\v!bottom},\c!location={\v!left ,\v!height}]%
+% \hpack{\smallinfofont\the\c_framed_math_last_right}%
+% \fi
+% \box\scratchbox
+% \egroup
+% \endgroup}
+
+\dimensiondef\d_math_framed_offset\zeropoint
+
+\def\math_framed#1#*[#2]#:#3%
+ {\begingroup
+ \ifconditional\c_framed_math_framed
+ \defineboxanchor[temp]%
+ \fi
+ \setmathatomrule\mathbegincode\mathbincode\allmathstyles\mathbegincode\mathbincode % hm
+ %
+ \scratchdimen\Umathaxis\Ustyle\mathstyle
+ %
+ \edef\currentframed{#1}%
+ \setbox\scratchbox\hbox{\localframedwithsettings[#1][#2]%
+ {\strut\global\dimensiondef\d_math_framed_offset\dimexpr
+ \framedoffset/2
+% +2\d_framed_linewidth
+ \relax}}%
+ %
+ \setbox\scratchbox\hpack\bgroup
+ \startimath
+ \Ustyle\mathstyle
+ #3%
+ \stopimath
+ \normalexpanded{\aftergrouped{%
+ \integerdef\c_framed_math_last_left \the\lastleftclass
+ \integerdef\c_framed_math_last_right\the\lastrightclass
+ }}%
+ \egroup
+ %
+ \boxymove\scratchbox\dimexpr
+ \scratchdimen
+ -\d_math_framed_offset/2
+ \relax
+ %
+ \setbox\scratchbox\hpack
+ \localframedwithsettings
+ [#1][#2]%
+ {\box\scratchbox}%
+ %
+ \boxymove\scratchbox\scratchdimen
+ %
+ \ifconditional\c_framed_math_framed
+ \boxsource\scratchbox \namedboxanchor{temp}% test
+ \fi
+ %
+ \mathatom
+ \s!class \mathexplicitcode
+ \ifnum\c_framed_math_last_left <\zerocount\else\s!leftclass \c_framed_math_last_left \fi
+ \ifnum\c_framed_math_last_right<\zerocount\else\s!rightclass\c_framed_math_last_right\fi
+ \bgroup
+ \ifconditional\c_framed_math_framed
+ \setboxanchor[temp][\c!corner={\v!left ,\v!bottom},\c!location={\v!right,\v!height}]%
+ \hpack{\smallinfofont\the\c_framed_math_last_left}%
+ \setboxanchor[temp][\c!corner={\v!right,\v!bottom},\c!location={\v!left ,\v!height}]%
+ \hpack{\smallinfofont\the\c_framed_math_last_right}%
+ \fi
+ \box\scratchbox
+ \egroup
+ \endgroup}
+
+\defineoverlay[mathstrikeout][\useMPgraphic{\framedparameter{mp}}]
+
+\definemathframed
+ [mathstrikeout]
+ [\c!offset=\v!overlay,
+ \c!mp=mathstrikeout,
+ \c!rulethickness=1.5\linewidth,
+ \c!background={\v!foreground,mathstrikeout},
+ %\c!color=darkgreen,
+ \c!textstyle=\txx,
+ \c!mathstyle=\s!script,
+ \c!frame=\v!off,
+ \c!arrow=\v!yes]
+
+\definemathframed
+ [mathcrossout]
+ [mathstrikeout]
+ [\c!mp=mathcrossout,
+ strike:location=bottom]
+
+\permanent\protected\def\mathstrikeoutlabel
+ {\iftok{\framedparameter{strike:math}}\emptytoks
+ \useframedstyleandcolor\c!textstyle\c!color
+ \framedparameter{strike:text}%
+ \else
+ \startimath
+ \dousecolorparameter{\framedparameter\c!color}% mathcolor
+ \usemathstyleparameter\framedparameter\c!mathstyle
+ \framedparameter{strike:math}%
+ \stopimath
+ \fi}
+
+\startuseMPgraphic{mathstrikeout}
+ path arr ; arr := (llcorner OverlayBox -- urcorner OverlayBox) ;
+ if "\framedparameter{arrow}" = "yes" : drawarrow else : draw fi arr
+ withpen pencircle scaled OverlayLineWidth
+ withcolor OverlayColor
+ ;
+ label.top("\mathstrikeoutlabel", point 1 of arr)
+ withcolor OverlayColor
+ ;
+ % draw OverlayBox
+ % dashed evenly
+ % withpen pencircle scaled .5OverlayLineWidth
+ % withcolor OverlayColor
+ % ;
+ setbounds currentpicture to OverlayBox ;
+\stopuseMPgraphic
+
+\startuseMPgraphic{mathcrossout}
+ draw (
+ (llcorner OverlayBox -- urcorner OverlayBox) &&
+ (ulcorner OverlayBox -- lrcorner OverlayBox)
+ )
+ withpen pencircle scaled OverlayLineWidth
+ withcolor OverlayColor
+ ;
+ if "\framedparameter{strike:location}" = "bottom" :
+ label.bot("\mathstrikeoutlabel", center bottomboundary currentpicture)
+ else :
+ label.top("\mathstrikeoutlabel", center topboundary currentpicture)
+ fi
+ withcolor OverlayColor
+ ;
+ setbounds currentpicture to OverlayBox ;
+\stopuseMPgraphic
+
+%D \starttyping
+%D \enabletrackers[framed.math]
+%D
+%D \startTEXpage[offset=10pt,width=40dk]
+%D \showmakeup[mathglue]
+%D \def\MyTest#1%
+%D {$ x #1 x $\quad
+%D $ x \mathframed[offset=0pt]{#1} x $\quad
+%D $\displaystyle x #1 x $\quad
+%D $\displaystyle x \mathframed[offset=0pt]{#1} x $}
+%D \MyTest{>}\blank
+%D \MyTest{+}\blank
+%D \MyTest{!}\blank
+%D \MyTest{+\frac{1}{2}+}\blank
+%D \MyTest{\frac{1}{2}}\blank
+%D \stopTEXpage
+%D \stoptyping
+
+%D From the list:
+
+%D \starttyping
+%D \startformula[spaceinbetween=.5\lineheight]
+%D \left\{
+%D \mparagraph{Quaternion algebras\par over $\blackboard{Q}$ up to isomorphism}
+%D \right\}
+%D \alignhere \leftrightarrow
+%D \left\{
+%D \mparagraph
+%D [foregroundcolor=darkred,offset=.1ex,frame=on]
+%D {Finite subset of places of $\blackboard{Q}$\par of even cardinality}
+%D \right\}
+%D \breakhere \leftrightarrow
+%D \left\{
+%D \mparagraph{more text}
+%D \right\}
+%D \breakhere \leftrightarrow
+%D \left\{
+%D \mparagraph[foregroundcolor=darkblue]{and more text}
+%D \right\}
+%D \stopformula
+%D \stoptyping
+
+\permanent\tolerant\protected\def\mparagraph[#1]#*#:#2%
+ {\vcenter class \mathconstructcode \bgroup % \mathwrappedcode would be like fraction
+ \framed[\c!offset=\v!overlay,\c!frame=\v!overlay,\c!align=\v!middle,#1]{#2}%
+ \egroup}
+
+%D Moved from pack-rul.mkxl to here:
+
+%D \macros
+%D {mframed, minframed}
+%D
+%D See mkii and mkiv files for some history on this already rather old mechanism; it
+%D dates from the real beginning. In the meantime we used anchoring, and now we're
+%D doing it more \LMTX ish.
+
+% mframed xx\mframed {x^2 + \frac{2}{x} + \sqrt{\frac{2}{\sqrt{\frac{2}{x}}}}} \input tufte
+% inmframed xx\inmframed{x^2 + \frac{2}{x} + \sqrt{\frac{2}{\sqrt{\frac{2}{x}}}}} \input tufte
+% mcframed xx\mcframed {x^2 + \frac{2}{x} + \sqrt{\frac{2}{\sqrt{\frac{2}{x}}}}} \input tufte
+% mtframed xx\mtframed {x^2 + \frac{2}{x} + \sqrt{\frac{2}{\sqrt{\frac{2}{x}}}}} \input tufte
+
+\newinteger\c_framed_mstyle
+
+\installcorenamespace{mathframed}
+
+\installframedcommandhandler \??mathframed {mathframed} \??mathframed
+
+\newtoks \t_pack_framed_mathframed
+\newdimension\d_pack_framed_mathframed
+
+\appendtoks
+ \frozen\protected\instance\edefcsname\currentmathframed\endcsname{\pack_framed_mathframed[\currentmathframed]}%
+\to \everydefinemathframed
+
+\tolerant\protected\def\pack_framed_mathframed[#1]#*[#2]#:#3% needs testing !
+ {\begingroup
+ \edef\currentmathframed{#1}%
+ \setupcurrentmathframed[#2]%
+ \c_framed_mstyle\normalmathstyle
+ \edef\m_framed_location{\mathframedparameter\c!location}%
+ \ifx\m_framed_location\v!mathematics
+ \inheritedmathframedframed\bgroup
+ \setbox\scratchbox\hbox\bgroup
+ \Ustartmath
+ \triggermathstyle\c_framed_mstyle
+ \the\t_pack_framed_mathframed
+ \mathatom \mathunspacedcode\bgroup
+ #3%
+ \egroup
+ \Ustopmath
+ \egroup
+ \global\d_pack_framed_mathframed\dp\scratchbox
+ \dontleavehmode\box\scratchbox
+ \egroup
+ \else
+ \inheritedmathframedframed\bgroup
+ \hbox\bgroup
+ \Ustartmath
+ \triggermathstyle\c_framed_mstyle
+ #3%
+ \Ustopmath
+ \egroup
+ \egroup
+ \fi
+ \endgroup}
+
+\appendtoks
+ \c_strc_math_ragged_status \plustwo
+ \c_strc_formulas_check_width\zerocount
+\to \t_pack_framed_mathframed
+
+\installframedlocator \v!mathematics
+ {}
+ {\pack_framed_locator_set_lo
+ \ifzeropt\d_framed_locator_lo\else
+ \lower\dimexpr\d_framed_locator_lo+\d_pack_framed_mathframed\relax
+ \fi
+ \box\b_framed_normal}
+
+\definemathframed[mframed]
+\definemathframed[inmframed][\c!location=\v!low]
+\definemathframed[mcframed] [\c!location=\v!mathematics] % centered
+\definemathframed[mtframed] [\c!location=\v!mathematics,\c!offset=\v!overlay,\c!frame=\v!overlay] % tight
+
+%D So instead of the rather versatile \type {\framed}, we use \type {\mframed}:
+%D
+%D \startbuffer
+%D \startformula
+%D x \times \mframed{y} \times y^{z_z}
+%D x \times \inmframed{y} \times y^{z_z}
+%D \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D And:
+%D
+%D \startbuffer
+%D \startformula
+%D x \times \mframed{y} \times y^{\mframed{z}_{\mframed{z}}}
+%D \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D As usual, one can specify in what way the text should be framed. One should be
+%D aware of the fact that, inorder to preserve the proper spacing, the \type
+%D {offset} is set to \type {overlay} and \type {frameoffset} is used used instead.
+%D
+%D \startbuffer
+%D \startformula
+%D x \times y^{\mframed[framecolor=red]{z}_{z}}
+%D \stopformula
+%D \stopbuffer
+%D
+%D \typebuffer \getbuffer
+%D
+%D For inline use, we also provide the \type {\inmframed} alternative: we want $x
+%D \times \inmframed{y}$ in inline math, right?
+
+\protect
diff --git a/Master/texmf-dist/tex/context/base/mkxl/pack-mrl.mkxl b/Master/texmf-dist/tex/context/base/mkxl/pack-mrl.mkxl
index 8bbeeb7985e..fbc51bef558 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/pack-mrl.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/pack-mrl.mkxl
@@ -39,32 +39,82 @@
\installsimplecommandhandler \??blackrules {blackrules} \??blackrules
\permanent\protected\def\blackrule
- {\hpack\bgroup
+ {% this was \hpack\bgroup\dontleavehmode but we want leader support
+ \begingroup
\doifelsenextoptionalcs\pack_black_rule_pickup\pack_black_rule_indeed}
\def\pack_black_rule_pickup[#1]%
{\setupcurrentblackrules[#1]%
\pack_black_rule_indeed}
+% \def\pack_black_rule_indeed
+% {\edef\p_width {\directblackrulesparameter\c!width }%
+% \edef\p_height{\directblackrulesparameter\c!height}%
+% \edef\p_depth {\directblackrulesparameter\c!depth }%
+% \ifx\p_height\v!max
+% \setstrut
+% \orelse\ifx\p_depth\v!max
+% \setstrut
+% \fi
+% \useblackrulesstyleandcolor\c!style\c!color
+% \ifcsname\??blackruletype\directblackrulesparameter\c!type\endcsname
+% \lastnamedcs
+% \else
+% \vrule
+% \fi
+% \ifx\p_width \v!max\s!width \emwidth\orelse\ifempty\p_width \else\s!width \p_width \fi
+% \ifx\p_height\v!max\s!height\strutht\orelse\ifempty\p_height\else\s!height\p_height\fi
+% \ifx\p_depth \v!max\s!depth \strutdp\orelse\ifempty\p_depth \else\s!depth \p_depth \fi
+% \egroup}
+
\def\pack_black_rule_indeed
- {\edef\p_width {\directblackrulesparameter\c!width }%
- \edef\p_height{\directblackrulesparameter\c!height}%
- \edef\p_depth {\directblackrulesparameter\c!depth }%
+ {\edef\p_width {\directblackrulesparameter\c!width}%
+ \edef\p_height {\directblackrulesparameter\c!height}%
+ \edef\p_depth {\directblackrulesparameter\c!depth}%
+ \edef\p_stretch{\directblackrulesparameter\c!stretch}%
+ \edef\p_shrink {\directblackrulesparameter\c!shrink}%
\ifx\p_height\v!max
\setstrut
+ \let\p_height\strutdp
\orelse\ifx\p_depth\v!max
\setstrut
\fi
+ % \ifx\p_height\v!max
+ % \let\p_height\strutdp
+ % \fi
+ \ifx\p_depth\v!max
+ \let\p_depth\strutdp
+ \fi
+ \ifx\p_width\v!max
+ \let\p_width\emwidth
+ \fi
\useblackrulesstyleandcolor\c!style\c!color
+ \ifempty\p_stretch
+ \ifempty\p_shrink
+ \donefalse
+ \else
+ \donetrue
+ \leaders
+ \fi
+ \else
+ \donetrue
+ \leaders
+ \fi
\ifcsname\??blackruletype\directblackrulesparameter\c!type\endcsname
\lastnamedcs
\else
\vrule
\fi
- \ifx\p_width \v!max\s!width \emwidth\orelse\ifempty\p_width \else\s!width \p_width \fi
- \ifx\p_height\v!max\s!height\strutht\orelse\ifempty\p_height\else\s!height\p_height\fi
- \ifx\p_depth \v!max\s!depth \strutdp\orelse\ifempty\p_depth \else\s!depth \p_depth \fi
- \egroup}
+ \ifempty\p_height\else\s!height\p_height\fi
+ \ifempty\p_depth\else\s!depth\p_depth\fi
+ \ifdone
+ \hskip\ifempty\p_width\zeropoint\else\p_width\fi
+ \ifempty\p_stretch\else\s!plus\p_stretch\fi
+ \ifempty\p_shrink\else\s!minus\p_shrink\fi
+ \else
+ \ifempty\p_width\else\s!width\p_width\fi
+ \fi
+ \endgroup}
\setupblackrules
[\c!width=\emwidth,
@@ -99,7 +149,7 @@
%D would probably have taken more tokens.
\permanent\tolerant\protected\def\blackrules[#1]% probably never used
- {\hpack\bgroup
+ {\hpack\bgroup % we keep this because breaking into lines breaks compatibility
\ifarguments\or\setupcurrentblackrules[#1]\fi
\scratchwidth \directblackrulesparameter\c!width
\scratchheight \directblackrulesparameter\c!height
@@ -131,20 +181,20 @@
\s!depth \scratchdepth
\relax
\ifzeropt\scratchdistance\else
- \hskip\scratchdistance
+ \kern\scratchdistance % hskip
\fi}
\installcorenamespace{blackruletype}
-\setvalue{\??blackruletype mp}%
+\defcsname\??blackruletype mp\endcsname
{\frule
type {mp}%
data {\includeMPgraphic{\directblackrulesparameter\c!mp}}
line \dimexpr\directblackrulesparameter\c!rulethickness\relax
}
-\letvalue{\??blackruletype\s!no }\novrule
-%letvalue{\??blackruletype\s!yes}\vrule
+\letcsname\??blackruletype\s!no \endcsname\novrule
+%letcsname\??blackruletype\s!yes\endcsname\vrule
\setupblackrules
[\c!n=3,
@@ -189,7 +239,7 @@
\s!height\linewidth
\s!depth \zeropoint}}
-% \let\dovlwdhtdp\pack_rule_vl_indeed % used elsewhere .. not any more
+\let\dovlwdhtdp\pack_rule_vl_indeed % used elsewhere .. in font manual
%D \macros
%D {hairline, thinrule, thinrules, setupthinrules}
@@ -257,10 +307,10 @@
\c!background=,
\c!rulethickness=\linewidth]
-\letvalue{\??thinrulealternatives\v!a }\zerocount
-\letvalue{\??thinrulealternatives\v!b }\plusone
-\letvalue{\??thinrulealternatives\v!c }\plustwo
-\letvalue{\??thinrulealternatives\v!none}\zerocount
+\letcsname\??thinrulealternatives\v!a \endcsname\zerocount
+\letcsname\??thinrulealternatives\v!b \endcsname\plusone
+\letcsname\??thinrulealternatives\v!c \endcsname\plustwo
+\letcsname\??thinrulealternatives\v!none\endcsname\zerocount
\newconstant\c_pack_thinrules_type
@@ -562,7 +612,7 @@
%D
%D \typebuffer \start \getbuffer \stop
-\setvalue{\??textrulealternatives\v!top}#1%
+\defcsname\??textrulealternatives\v!top\endcsname#1%
{\page[\v!preference] % interferes
\directtextrulesparameter\c!before\relax
\blank[\v!samepage,\v!nowhite]%
@@ -571,14 +621,14 @@
\directtextrulesparameter\c!inbetween\relax
\endgraf}
-\setvalue{\??textrulealternatives\v!bottom}#1%
+\defcsname\??textrulealternatives\v!bottom\endcsname#1%
{\blank[\v!samepage,\v!nowhite]%
\pack_textrule_following{#1}%
\blank[\v!samepage,\v!nowhite]%
\directtextrulesparameter\c!after\relax
\page[\v!preference]}
-\setvalue{\??textrulealternatives\v!middle}#1%
+\defcsname\??textrulealternatives\v!middle\endcsname#1%
{\blank[\v!samepage,\v!nowhite]%
\directtextrulesparameter\c!inbetween\relax
\pack_textrule_following{#1}%
@@ -598,7 +648,7 @@
{\llap
{\usetextrulesstyleandcolor\c!style\c!color
#1%
- \hskip\leftmargindistance}}
+ \kern\leftmargindistance}} % hskip
{\color[\directtextrulesparameter\c!rulecolor]
{\vrule
\s!height\scratchheight
@@ -697,6 +747,8 @@
%D
%D \showsetup{fillinrules}
%D \showsetup{setupfillinrules}
+%D
+%D I NEED TO UPGRADE THIS!
\installcorenamespace{fillinrules}
@@ -742,7 +794,7 @@
\strut
#2%
\hfill\directfillinrulesparameter\c!separator
- \hskip\scratchdistance
+ \kern\scratchdistance % hskip
\egroup
\fi
\setupwhitespace[\v!big]%
@@ -831,12 +883,13 @@
\c!width=\scratchwidth,
\c!height=\scratchheight,
\c!depth=\scratchheight]}%
- \frozen\advance\rightskip \directfillinlinesparameter\c!margin\relax
+ \frozen\advanceby\rightskip \directfillinlinesparameter\c!margin\relax
\frozen\parfillskip\zeropoint\relax
\endgroup}
\permanent\tolerant\protected\def\fillinline[#1]%
- {\registerparwrapper
+ {\dontleavehmode
+ \registerparwrapper
{fillinline}%
{\pack_fillinline_before{#1}}%
{\pack_fillinline_after {#1}%
diff --git a/Master/texmf-dist/tex/context/base/mkxl/pack-obj.lmt b/Master/texmf-dist/tex/context/base/mkxl/pack-obj.lmt
index f021339b472..1e22515b95b 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/pack-obj.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/pack-obj.lmt
@@ -89,41 +89,6 @@ jobobjects.get = getobject
jobobjects.number = getobjectnumber
jobobjects.page = getobjectpage
--- implement {
--- name = "saveobject",
--- actions = saveobject
--- }
---
--- implement {
--- name = "setobject",
--- actions = setobject,
--- arguments = { "string", "integer", "integer" }
--- }
---
--- implement {
--- name = "objectnumber",
--- actions = { getobjectnumber, context },
--- arguments = "2 strings",
--- }
---
--- implement {
--- name = "objectpage",
--- actions = { getobjectpage, context },
--- arguments = "2 strings",
--- }
---
--- implement {
--- name = "doifelseobjectreferencefound",
--- actions = { getobject, commands.doifelse },
--- arguments = "string"
--- }
-
--- if false then
--- -- we can flush the inline ref ourselves now if we want
--- local flush = new_latelua("pdf.flushxform("..index..")")
--- flush.next = list
--- next.prev = flush
--- end
local data = table.setmetatableindex("table")
@@ -134,14 +99,23 @@ objects = {
local objects = objects
-function objects.register(ns,id,b,referenced,offset,mode)
- local n = objects.n + 1
- objects.n = n
+function objects.register(ns,id,b,referenced,offset,mode,delay)
+ -- The delay feature is just an experiment: a value of 1 delays the
+ -- flushing and 2 overloads the content. It might disappear again.
+ local found = data[ns][id]
nodes.handlers.finalizebox(b)
- if mode == 0 then
+ if found and delay == 2 then
+ data[ns][id] = {
+ codeinjections.registerboxresource(b,nil,nil,found[1]), -- hardcoded [1]
+ offset,
+ referenced or false,
+ mode,
+ }
+ return
+ elseif mode == 0 then
-- tex
data[ns][id] = {
- codeinjections.registerboxresource(b), -- a box number
+ codeinjections.registerboxresource(b,nil,delay), -- a box number
offset,
referenced or false,
mode,
@@ -149,7 +123,7 @@ function objects.register(ns,id,b,referenced,offset,mode)
else
-- box (backend)
data[ns][id] = {
- codeinjections.registerboxresource(b,offset), -- a box number
+ codeinjections.registerboxresource(b,offset,delay), -- a box number
false,
referenced,
mode,
@@ -179,11 +153,11 @@ function objects.restore(ns,id) -- why not just pass a box number here too (ok,
-- list is a rule
setlink(list,page)
end
- setbox("objectbox",hbox)
- settexdimen("objectoff",offset or 0)
+ setbox("b_pack_objects",hbox)
+ settexdimen("d_pack_objects_offset",offset or 0)
else
- setbox("objectbox",nil)
- settexdimen("objectoff",0) -- for good old times
+ setbox("b_pack_objects",nil)
+ settexdimen("d_pack_objects_offset",0) -- for good old times
end
if trace then
report("restoring object %a",id)
@@ -218,13 +192,13 @@ end
implement {
name = "registerreferencedobject",
- arguments = { "string", "string", "integer", true, "dimension", "integer" },
+ arguments = { "string", "string", "integer", true, "dimension", "integer", "integer" },
actions = objects.register,
}
implement {
name = "registerobject",
- arguments = { "string", "string", "integer", false, "dimension", "integer" },
+ arguments = { "string", "string", "integer", false, "dimension", "integer", "integer" },
actions = objects.register,
}
@@ -287,10 +261,10 @@ implement {
if object then
w, h, d, o = codeinjections.boxresourcedimensions(object[1])
end
- settexdimen("objectwd",w or 0)
- settexdimen("objectht",h or 0)
- settexdimen("objectdp",d or 0)
- settexdimen("objectoff",o or #objects > 2 and object[2] or 0)
+ settexdimen("d_pack_objects_width", w or 0)
+ settexdimen("d_pack_objects_height",h or 0)
+ settexdimen("d_pack_objects_depth", d or 0)
+ settexdimen("d_pack_objects_offset",o or #objects > 2 and object[2] or 0)
end
}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/pack-obj.mkxl b/Master/texmf-dist/tex/context/base/mkxl/pack-obj.mkxl
index 04fc90a5853..6334c6ce9ac 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/pack-obj.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/pack-obj.mkxl
@@ -39,34 +39,54 @@
\installcorenamespace {objects}
-\newif \ifinobject
-\newbox \objectbox
+\mutable\def\objectoffset{1cm} % Still public but use with care!
-\mutable\def\objectoffset{1cm}
-
-\newdimen\objectoff \permanent\def\objectmargin{\the\objectoff}
-\newdimen\objectwd \permanent\def\objectwidth {\the\objectwd}
-\newdimen\objectht \permanent\def\objectheight{\the\objectht}
-\newdimen\objectdp \permanent\def\objectdepth {\the\objectdp}
+\newif \ifinobject
+\newbox \b_pack_objects
+\newdimension\d_pack_objects_offset \permanent\def\objectmargin{\the\d_pack_objects_offset}
+\newdimension\d_pack_objects_width \permanent\def\objectwidth {\the\d_pack_objects_width}
+\newdimension\d_pack_objects_height \permanent\def\objectheight{\the\d_pack_objects_height}
+\newdimension\d_pack_objects_depth \permanent\def\objectdepth {\the\d_pack_objects_depth}
%D If I have time I will use the unreferenced variant for e.g. mp reuse. This can be
%D rewritten in \LUA\ anyway.
-\permanent\protected\def\setreferencedobject #1#2{\begingroup\synctexpause\objectoff\objectoffset\inobjecttrue\dowithnextbox{\pack_objects_set_yes{#1}{#2}}}
-\permanent\protected\def\settightreferencedobject #1#2{\begingroup\synctexpause\objectoff\zeropoint \inobjecttrue\dowithnextbox{\pack_objects_set_yes{#1}{#2}}}
-\permanent\protected\def\setunreferencedobject #1#2{\begingroup\synctexpause\objectoff\objectoffset\inobjecttrue\dowithnextbox{\pack_objects_set_nop{#1}{#2}}}
-\permanent\protected\def\settightunreferencedobject#1#2{\begingroup\synctexpause\objectoff\zeropoint \inobjecttrue\dowithnextbox{\pack_objects_set_nop{#1}{#2}}}
+\permanent\protected\def\setreferencedobject #1#2{\begingroup\synctexpause\d_pack_objects_offset\objectoffset\inobjecttrue\dowithnextbox{\pack_objects_set_yes{#1}{#2}}}
+\permanent\protected\def\settightreferencedobject #1#2{\begingroup\synctexpause\d_pack_objects_offset\zeropoint \inobjecttrue\dowithnextbox{\pack_objects_set_yes{#1}{#2}}}
+\permanent\protected\def\setunreferencedobject #1#2{\begingroup\synctexpause\d_pack_objects_offset\objectoffset\inobjecttrue\dowithnextbox{\pack_objects_set_nop{#1}{#2}}}
+\permanent\protected\def\settightunreferencedobject#1#2{\begingroup\synctexpause\d_pack_objects_offset\zeropoint \inobjecttrue\dowithnextbox{\pack_objects_set_nop{#1}{#2}}}
\aliased\let\setobject \setreferencedobject
\aliased\let\settightobject\settightreferencedobject
%D We can get subtle differences in boundingboxes but both methods work ok.
+% How useful is this ... delayed but refered objects .. messy concept.
+%
+% \def\InitIt{%
+% \c_pack_objects_delay\plusone
+% \setobject{test}{1}\hbox{test me 1}
+% \c_pack_objects_delay\zerocount
+% }
+%
+% \def\GetIt{%
+% \c_pack_objects_delay\plusone
+% \getobject{test}{1}
+% \c_pack_objects_delay\zerocount
+% }
+%
+% \def\SetIt{%
+% \c_pack_objects_delay\plustwo
+% \setobject{test}{1}\hbox{\bf HERE}% we cannot have interactivity in xforms
+% \c_pack_objects_delay\zerocount
+% }
+
\newconstant\c_pack_objects_offset_mode % 0=tex 1=box
+\newconstant\c_pack_objects_delay % 0=immediate 1=delay
\protected\def\pack_objects_set_yes#1#2%
{\ifcase\c_pack_objects_offset_mode
- \ifzeropt\objectoff
+ \ifzeropt\d_pack_objects_offset
\pack_objects_package_nop\nextbox
\else
\pack_objects_package_yes\nextbox
@@ -74,13 +94,18 @@
\else
\pack_objects_package_nop\nextbox
\fi
- \clf_registerreferencedobject{#1}{#2}\objectbox\objectoff\c_pack_objects_offset_mode
+ \clf_registerreferencedobject
+ {#1}{#2}%
+ \b_pack_objects
+ \d_pack_objects_offset
+ \c_pack_objects_offset_mode
+ \c_pack_objects_delay
\synctexresume
\endgroup}
\protected\def\pack_objects_set_nop#1#2%
{\ifcase\c_pack_objects_offset_mode
- \ifzeropt\objectoff
+ \ifzeropt\d_pack_objects_offset
\pack_objects_package_nop\nextbox
\else
\pack_objects_package_yes\nextbox
@@ -88,33 +113,36 @@
\else
\pack_objects_package_nop\nextbox
\fi
- \clf_registerobject{#1}{#2}\objectbox\objectoff\c_pack_objects_offset_mode
+ \clf_registerobject
+ {#1}{#2}%
+ \b_pack_objects
+ \d_pack_objects_offset
+ \c_pack_objects_offset_mode
+ \c_pack_objects_delay
\synctexresume
\endgroup}
\def\pack_objects_package_nop#1% we pack because otherwise \ruledhbox is still tight
- {\setbox\objectbox\hpack{\box#1}}
+ {\setbox\b_pack_objects\hpack{\box#1}}
\def\pack_objects_package_yes#1%
- {\objectwd\dimexpr\wd#1+2\objectoff\relax
- \objectht\dimexpr\ht#1+ \objectoff\relax
- \objectdp\dimexpr\dp#1+ \objectoff\relax
- \setbox\objectbox\hpack
- {\hskip\objectoff
- \box#1}%
- \wd\objectbox\objectwd
- \ht\objectbox\objectht
- \dp\objectbox\objectdp}
+ {\d_pack_objects_width \dimexpr\wd#1+2\d_pack_objects_offset\relax
+ \d_pack_objects_height\dimexpr\ht#1+ \d_pack_objects_offset\relax
+ \d_pack_objects_depth \dimexpr\dp#1+ \d_pack_objects_offset\relax
+ \setbox\b_pack_objects\hpack{\hskip\d_pack_objects_offset\box#1}%
+ \wd\b_pack_objects\d_pack_objects_width
+ \ht\b_pack_objects\d_pack_objects_height
+ \dp\b_pack_objects\d_pack_objects_depth}
\permanent\protected\def\getobject#1#2%
{\begingroup
\synctexpause
\clf_restoreobject{#1}{#2}%
- \ifzeropt\objectoff\else
- \objectoff-\objectoff
- \pack_objects_package_yes\objectbox
+ \ifzeropt\d_pack_objects_offset\else
+ \d_pack_objects_offset-\d_pack_objects_offset
+ \pack_objects_package_yes\b_pack_objects
\fi
- \box\objectbox
+ \box\b_pack_objects
\synctexresume
\endgroup}
@@ -155,7 +183,7 @@
%D For the moment here:
-\mutable\let\lastpredefinedsymbol\empty % some day we can do more at the lua end
+\mutable\lettonothing\lastpredefinedsymbol % some day we can do more at the lua end
\permanent\protected\def\predefinesymbol[#1]%
{\begingroup
diff --git a/Master/texmf-dist/tex/context/base/mkxl/pack-ori.lmt b/Master/texmf-dist/tex/context/base/mkxl/pack-ori.lmt
index a786b19ef13..81e8776b96a 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/pack-ori.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/pack-ori.lmt
@@ -30,8 +30,8 @@ local horizontal = {
[variables.middle] = 0x000,
[variables.flushleft] = 0x100,
[variables.flushright] = 0x200,
- [variables.left] = 0x300,
- [variables.right] = 0x400,
+ [variables.left] = 0x300, -- why not 0x100
+ [variables.right] = 0x400, -- why not 0x200
}
implement {
diff --git a/Master/texmf-dist/tex/context/base/mkxl/pack-ori.mkxl b/Master/texmf-dist/tex/context/base/mkxl/pack-ori.mkxl
index 4365db3ac66..584e70c2225 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/pack-ori.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/pack-ori.mkxl
@@ -36,7 +36,7 @@
\c!vertical=\v!normal]
\appendtoks
- \expandafter\chardef\csname\??orientations\currentorientation\endcsname\toorientation
+ \expandafter\integerdef\csname\??orientations\currentorientation\endcsname\toorientation
orientation {\orientationparameter\c!orientation}
horizontal {\orientationparameter\c!horizontal}
vertical {\orientationparameter\c!vertical}
@@ -51,6 +51,7 @@
\defineorientation[\v!right] [\c!orientation=\v!right]
\defineorientation[\v!top] [\c!orientation=\v!top]
\defineorientation[\v!bottom][\c!orientation=\v!bottom]
+\defineorientation[\v!line] [\c!orientation=\v!line]
%D There will be some more helpers here.
@@ -72,15 +73,14 @@
\fi
\relax}
-%D The \type {\immediateassignment} and \type {\immediateassigned} primitives are
-%D kind of obsolete and might be dropped (if not already) from \LUAMETATEX. Local
-%D scanning is, although it is a bit slower, more general. We didn't really need and
-%D use these primitives in \CONTEXT\ anyway, apart from some playing around with
-%D some full expansion, which made no sense in the end so it was dropped. When
-%D things get that hairy it's often a good reason to look into \LUA\ variants.
+%D The \type {\immediateassignment} and \type {\immediateassigned} primitives that
+%D are in \LUATEX\ are obsolete in \LUAMETATEX. Local scanning is, although it is
+%D a bit slower, more general. We didn't really need and use these primitives in
+%D \CONTEXT\ anyway, apart from some playing around with some full expansion, which
+%D made no sense in the end so it was dropped. When things get that hairy it's often
+%D a good reason to look into \LUA\ variants.
\def\auto_orientation#1%
- %{\immediateassignment\global\expandafter\chardef\csname\??orientations#1\endcsname\stringtoorientation{#1}% % quite fast
{\beginlocalcontrol\global\expandafter\chardef\csname\??orientations#1\endcsname\stringtoorientation{#1}\endlocalcontrol % good enough
%{\localcontrolled{\global\expandafter\chardef\csname\??orientations#1\endcsname\stringtoorientation{#1}}% % a bit slower
\csname\??orientations#1\endcsname}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/pack-pos.mkxl b/Master/texmf-dist/tex/context/base/mkxl/pack-pos.mkxl
index aee22081fdd..74ec38629db 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/pack-pos.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/pack-pos.mkxl
@@ -44,22 +44,22 @@
\c!xoffset=\zeropoint,
\c!yoffset=\zeropoint]
-\newdimen\d_pack_positioning_x_position
-\newdimen\d_pack_positioning_y_position
-\newdimen\d_pack_positioning_x_dimension
-\newdimen\d_pack_positioning_y_dimension
-\newdimen\d_pack_positioning_x_offset
-\newdimen\d_pack_positioning_y_offset
+\newdimension\d_pack_positioning_x_position
+\newdimension\d_pack_positioning_y_position
+\newdimension\d_pack_positioning_x_dimension
+\newdimension\d_pack_positioning_y_dimension
+\newdimension\d_pack_positioning_x_offset
+\newdimension\d_pack_positioning_y_offset
-\newbox\b_pack_positioning
+\newbox \b_pack_positioning
\permanent\tolerant\protected\def\startpositioning[#1]#*[#2]%
{\bgroup
\ifparameters
- \let\currentpositioning\empty
+ \lettonothing\currentpositioning
\or
\ifhastok={#1}%
- \let\currentpositioning\empty
+ \lettonothing\currentpositioning
\setupcurrentpositioning[#1]%
\else
\edef\currentpositioning{#1}%
@@ -84,13 +84,13 @@
\doifnot{\positioningparameter\c!offset}\v!yes
{\global\d_pack_positioning_x_offset\zeropoint
\global\d_pack_positioning_y_offset\zeropoint}%
- \global\advance\d_pack_positioning_x_dimension\d_pack_positioning_x_offset
- \global\advance\d_pack_positioning_y_dimension\d_pack_positioning_y_offset
+ \global\advanceby\d_pack_positioning_x_dimension\d_pack_positioning_x_offset
+ \global\advanceby\d_pack_positioning_y_dimension\d_pack_positioning_y_offset
\egroup
\vbox to \d_pack_positioning_y_dimension
{\vskip\d_pack_positioning_y_offset
\hbox to \d_pack_positioning_x_dimension
- {\hskip\d_pack_positioning_x_offset
+ {\kern\d_pack_positioning_x_offset
\box\b_pack_positioning
\hfill}
\vfill}%
@@ -100,10 +100,10 @@
{\setdimensionwithunit\scratchdimen{#1}{\positioningparameter\c!unit}%
\scratchdimen\positioningparameter#8\scratchdimen
\scratchdimen\positioningparameter#9\scratchdimen
- \advance\scratchdimen\positioningparameter#4\relax
+ \advanceby\scratchdimen\positioningparameter#4\relax
% == \scratchdimen\dimexpr#8\dimexpr#9\scratchdimen\relax+#4\relax
\doif{\positioningparameter#2}\v!relative
- {\advance\scratchdimen#3%
+ {\advanceby\scratchdimen#3%
\letpositioningparameter#4\zeropoint}%
#3\scratchdimen
\doifnot{\positioningparameter\c!state}\v!overlay
@@ -145,7 +145,7 @@
{\offinterlineskip % else we get an empty line
\vskip\d_pack_positioning_y_position
\hbox to \zeropoint
- {\hskip\d_pack_positioning_x_position
+ {\kern\d_pack_positioning_x_position
\box\nextbox
\hss}
\vss}%
diff --git a/Master/texmf-dist/tex/context/base/mkxl/pack-rul.lmt b/Master/texmf-dist/tex/context/base/mkxl/pack-rul.lmt
index d99f0a78e2c..12d131c8873 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/pack-rul.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/pack-rul.lmt
@@ -35,6 +35,8 @@ local equationlist_code = listcodes.equation
local texsetdimen = tex.setdimen
local texsetcount = tex.setcount
+local texisdimen = tex.isdimen
+local texiscount = tex.iscount
local implement = interfaces.implement
@@ -52,13 +54,13 @@ local getdirection = nuts.getdirection
local setshift = nuts.setshift
local setwidth = nuts.setwidth
local getwidth = nuts.getwidth
-local setboxglue = nuts.setboxglue
-local getboxglue = nuts.getboxglue
+local setboxglue = nuts.setglue
+local getboxglue = nuts.getglue
local hpack = nuts.hpack
local getdimensions = nuts.dimensions
local naturalhsize = nuts.naturalhsize
-local flush_node = nuts.flush
+local flushnode = nuts.flush
local traversers = nuts.traversers
local nexthlist = traversers.hlist
@@ -71,8 +73,18 @@ directives.register("framed.checkmath",function(v) checkformath = v end) -- expe
-- beware: dir nodes and pseudostruts can end up on lines of their own
-local function doreshapeframedbox(n)
- local box = getbox(n)
+local c_framednoflines = texiscount("framednoflines")
+local d_framedfirstheight = texisdimen("framedfirstheight")
+local d_framedlastdepth = texisdimen("framedlastdepth")
+local d_framedminwidth = texisdimen("framedminwidth")
+local d_framedmaxwidth = texisdimen("framedmaxwidth")
+local d_framedaveragewidth = texisdimen("framedaveragewidth")
+
+local function doreshapeframedbox(n,resync)
+ if resync then
+ resync = drivers.converters.resyncbox
+ end
+ local box = resync and resync(n) or getbox(n)
local noflines = 0
local nofnonzero = 0
local firstheight = nil
@@ -135,15 +147,15 @@ local function doreshapeframedbox(n)
if list and id == hlist_code then
-- called a lot so maybe a simple case is needed
if subtype == boxlist_code or subtype == linelist_code then
- -- getdirection is irrelevant here so it will go
- -- somehow a parfillskip also can get influenced
- local p = hpack(list,maxwidth,'exactly',getdirection(h)) -- multiple return value
+ -- -- getdirection is irrelevant here so it will go
+ -- local p = hpack(list,maxwidth,'exactly',getdirection(h)) -- multiple return value
+ local p = hpack(list,maxwidth,'exactly') -- multiple return value
local set, order, sign = getboxglue(p)
setboxglue(h,set,order,sign)
setlist(p)
- flush_node(p)
+ flushnode(p)
elseif checkformath and subtype == equationlist_code then
- -- display formulas use a shift
+ -- display formulas use a shift .. actually we never have display mode
if nofnonzero == 1 then
setshift(h,0)
end
@@ -167,15 +179,15 @@ local function doreshapeframedbox(n)
end
end
end
- texsetcount("global","framednoflines",noflines)
- texsetdimen("global","framedfirstheight",firstheight or 0) -- also signal
- texsetdimen("global","framedlastdepth",lastdepth or 0)
- texsetdimen("global","framedminwidth",minwidth)
- texsetdimen("global","framedmaxwidth",maxwidth)
- texsetdimen("global","framedaveragewidth",averagewidth)
+ texsetcount("global",c_framednoflines,noflines)
+ texsetdimen("global",d_framedfirstheight,firstheight or 0) -- also signal
+ texsetdimen("global",d_framedlastdepth,lastdepth or 0)
+ texsetdimen("global",d_framedminwidth,minwidth)
+ texsetdimen("global",d_framedmaxwidth,maxwidth)
+ texsetdimen("global",d_framedaveragewidth,averagewidth)
end
-local function doanalyzeframedbox(n) -- traverse_list
+local function doanalyzeframedbox(n)
local box = getbox(n)
local noflines = 0
local firstheight = nil
@@ -183,15 +195,7 @@ local function doanalyzeframedbox(n) -- traverse_list
if getwidth(box) ~= 0 then
local list = getlist(box)
if list then
- for n in nexthlist, list do
- local width, height, depth = getwhd(n)
- if not firstheight then
- firstheight = height
- end
- lastdepth = depth
- noflines = noflines + 1
- end
- for n in nextvlist, list do
+ for n in nextlist, list do
local width, height, depth = getwhd(n)
if not firstheight then
firstheight = height
@@ -199,14 +203,31 @@ local function doanalyzeframedbox(n) -- traverse_list
lastdepth = depth
noflines = noflines + 1
end
+ -- for n in nexthlist, list do
+ -- local width, height, depth = getwhd(n)
+ -- if not firstheight then
+ -- firstheight = height
+ -- end
+ -- lastdepth = depth
+ -- noflines = noflines + 1
+ -- end
+ -- for n in nextvlist, list do
+ -- local width, height, depth = getwhd(n)
+ -- if not firstheight then
+ -- firstheight = height
+ -- end
+ -- lastdepth = depth
+ -- noflines = noflines + 1
+ -- end
end
end
- texsetcount("global","framednoflines",noflines)
- texsetdimen("global","framedfirstheight",firstheight or 0)
- texsetdimen("global","framedlastdepth",lastdepth or 0)
+ texsetcount("global",c_framednoflines,noflines)
+ texsetdimen("global",d_framedfirstheight,firstheight or 0)
+ texsetdimen("global",d_framedlastdepth,lastdepth or 0)
end
implement { name = "doreshapeframedbox", actions = doreshapeframedbox, arguments = "integer" }
+implement { name = "doresyncframedbox", actions = doreshapeframedbox, arguments = { "integer", true } }
implement { name = "doanalyzeframedbox", actions = doanalyzeframedbox, arguments = "integer" }
local function maxboxwidth(box)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/pack-rul.mkxl b/Master/texmf-dist/tex/context/base/mkxl/pack-rul.mkxl
index b6a22d89492..36b4fc7b0c0 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/pack-rul.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/pack-rul.mkxl
@@ -18,7 +18,14 @@
%D packaging and expansion we also keep tracing reasonable. For instance, multiple
%D stacked backgrounds can slow down a run if not optimized this way.
-\registerctxluafile{pack-rul}{autosuffix,optimize}
+\newinteger \framednoflines
+\newdimension\framedfirstheight
+\newdimension\framedlastdepth
+\newdimension\framedminwidth
+\newdimension\framedmaxwidth
+\newdimension\framedaveragewidth
+
+\registerctxluafile{pack-rul}{autosuffix}
\unprotect
@@ -35,7 +42,7 @@
%D The linewidth is available in \type{\linewidth}. The preset value of .4pt equals
%D the default hard coded \TEX\ rule width.
-\newdimen\linewidth
+\newdimension\linewidth
\permanent\tolerant\protected\def\setuplinewidth[#1]%
{\assigndimension{#1}\linewidth{.2\points}{.4\points}{.6\points}}
@@ -114,6 +121,32 @@
{\installsimplecommandhandler{#1}{#2}{#3}%
\installinheritedframed{#2}}
+% corner options (with radius=0pt rectangular):
+%
+% 0 round ltrb trbl rblt bltr
+% 1 2 3 4 5 6 7 8 ltrb
+% 9 lbr rbl / 10 tlb blt / 11 ltr rtl / 12 lbr rbl
+% 13 rt tr / 14 rb br / 15 bl lb / 16 tl lt
+% 32 lr rl / 33 tb bt
+% 28 l / 29 r / 30 b / 31 t
+
+%D \starttyping
+%D \dostepwiserecurse{0}{33}{1}{
+%D \startTEXpage[offset=1dk]
+%D \dontleavehmode\ruledhbox{\framed
+%D [framecolor=red,
+%D framecorner=#1,
+%D frameradius=\zeropoint]
+%D {TEST #1}}
+%D \ruledhbox{\framed
+%D [framecolor=red,
+%D framecorner=#1,
+%D frameradius=10pt]
+%D {TEST #1}}
+%D \stopTEXpage
+%D }
+%D \stoptyping
+
% for regular framed
\setupframed
@@ -157,6 +190,7 @@
%\c!anchoring=,
\c!autowidth=\v!yes,
%\c!setups=,
+ \c!synchronize=,
\c!loffset=\zeropoint,
\c!roffset=\zeropoint,
\c!toffset=\zeropoint,
@@ -197,33 +231,36 @@
%D We will communicate through module specific variables, current framed
%D parameters and some reserved dimension registers.
-\newdimen\d_framed_target_wd
-\newdimen\d_framed_target_ht
-\newdimen\d_framed_target_dp
-\newdimen\d_framed_linewidth \aliased\let\ruledlinewidth\d_framed_linewidth % needed at lua end
-
-\let\p_framed_frame \empty % \framedparameter\c!frame
-\let\p_framed_backgroundoffset\empty
-\let\p_framed_foregroundstyle \empty
-\let\p_framed_autostrut \empty
-\let\p_framed_location \empty
-\let\p_framed_orientation \empty
-\let\p_framed_anchoring \empty
-\let\p_framed_autowidth \empty
-\let\p_framed_franalyze \empty
-\let\p_framed_backgroundcorner\empty
-\let\p_framed_backgroundradius\empty
-\let\p_framed_framecorner \empty
-\let\p_framed_frameradius \empty
-\let\p_framed_lines \empty
-\let\p_framed_empty \empty
-\let\p_framed_backgroundcolor \empty
-\let\p_framed_framecolor \empty
-\let\p_framed_component \empty
-\let\p_framed_background \empty
-\let\p_framed_rulethickness \empty
-\let\p_framed_foregroundcolor \empty
-\let\p_framed_setups \empty
+\newdimension\d_framed_target_wd
+\newdimension\d_framed_target_ht
+\newdimension\d_framed_target_dp
+%newdimen \d_framed_linewidth \aliased\let \ruledlinewidth\d_framed_linewidth % needed at lua end
+\newdimension\d_framed_linewidth \aliasdimension\ruledlinewidth\d_framed_linewidth % needed at lua end
+
+\lettonothing\p_framed_frame % \framedparameter\c!frame
+\lettonothing\p_framed_backgroundoffset
+\lettonothing\p_framed_foregroundstyle
+\lettonothing\p_framed_autostrut
+\lettonothing\p_framed_location
+\lettonothing\p_framed_orientation
+\lettonothing\p_framed_anchoring
+\lettonothing\p_framed_synchronize
+\lettonothing\p_framed_autowidth
+\lettonothing\p_framed_franalyze
+\lettonothing\p_framed_backgroundcorner
+\lettonothing\p_framed_backgroundradius
+\lettonothing\p_framed_framecorner
+\lettonothing\p_framed_frameradius
+\lettonothing\p_framed_lines
+\lettonothing\p_framed_empty
+\lettonothing\p_framed_backgroundcolor
+\lettonothing\p_framed_framecolor
+\lettonothing\p_framed_component
+\lettonothing\p_framed_background
+\lettonothing\p_framed_rulethickness
+\lettonothing\p_framed_foregroundcolor
+\lettonothing\p_framed_setups
+\lettonothing\p_framed_synchronize
%D We don't have to stick to a \TEX\ drawn rule, but also can use rounded
%D or even fancier shapes, as we will see later on.
@@ -262,32 +299,56 @@
corner {\p_framed_backgroundcorner}
\relax}}
+% we keep this as reference (should still work when uncommented)
+%
+% \def\pack_framed_stroked_box
+% {\edef\p_framed_framecorner{\framedparameter\c!framecorner}%
+% \ifx\p_framed_framecorner\v!rectangular
+% \pack_framed_stroked_box_normal
+% \else
+% \pack_framed_stroked_box_radius
+% \fi}
+%
+% \def\pack_framed_stroked_box_radius
+% {\edef\p_framed_frameradius{\framedparameter\c!frameradius}%
+% \ifzeropt\dimexpr\p_framed_frameradius\relax % just in case of .x\bodyfontsize
+% \pack_framed_stroked_box_normal
+% \orelse\ifx\p_framed_frame\v!on
+% \pack_framed_stroked_box_round
+% \fi}
+%
+% % \pack_framed_stroked_box_normal % later
+%
+% \def\pack_framed_stroked_box_round
+% {\raise\d_framed_target_dp\hpack{\frule
+% width \d_framed_target_wd
+% height \d_framed_target_ht
+% depth \d_framed_target_dp
+% line \d_framed_linewidth
+% radius \p_framed_frameradius\space
+% corner {\p_framed_framecorner}
+% \relax}}
+%
+% corner is the parent of framecorner and backgroundcorner (round value never checked)
+% when 'round' is passed it is not a number and therefore we get four sides
+
\def\pack_framed_stroked_box
{\edef\p_framed_framecorner{\framedparameter\c!framecorner}%
\ifx\p_framed_framecorner\v!rectangular
\pack_framed_stroked_box_normal
- \else
- \pack_framed_stroked_box_radius
- \fi}
-
-\def\pack_framed_stroked_box_radius
- {\edef\p_framed_frameradius{\framedparameter\c!frameradius}%
- \ifzeropt\dimexpr\p_framed_frameradius\relax % just in case of .x\bodyfontsize
- \pack_framed_stroked_box_normal
\orelse\ifx\p_framed_frame\v!on
\pack_framed_stroked_box_round
\fi}
-% \pack_framed_stroked_box_normal % later
-
-\def\pack_framed_stroked_box_round
- {\raise\d_framed_target_dp\hpack{\frule
- width \d_framed_target_wd
- height \d_framed_target_ht
- depth \d_framed_target_dp
- line \d_framed_linewidth
- radius \p_framed_frameradius\space
- corner {\p_framed_framecorner}
+\def\pack_framed_stroked_box_round % todo: variant without keywords
+ {\raise\d_framed_target_dp
+ \hpack{\clf_roundedoutline % we could access these at the lua end!
+ \d_framed_target_wd
+ \d_framed_target_ht
+ \d_framed_target_dp
+ \d_framed_linewidth
+ \framedparameter\c!frameradius
+ {\p_framed_framecorner}
\relax}}
% a lot of weird corners
@@ -404,13 +465,13 @@
%D
%D The resulting box is lowered to the right depth.
-\newdimen\d_overlay_width
-\newdimen\d_overlay_height
-\newdimen\d_overlay_depth
-\newdimen\d_overlay_offset
-\newdimen\d_overlay_linewidth
+\newdimension\d_overlay_width
+\newdimension\d_overlay_height
+\newdimension\d_overlay_depth
+\newdimension\d_overlay_offset
+\newdimension\d_overlay_linewidth
-\let\m_overlay_region\empty
+\lettonothing\m_overlay_region
% expandable ... in a future version the space will go (in mp one can use Overlay*)
@@ -427,11 +488,11 @@
%mutable \edef\overlaycorner {\framedparameter\c!backgroundcorner}
%mutable \edef\overlayradius {\framedparameter\c!backgroundradius}
-\permanent\def\usedoverlaywidth {\dimexpr\d_overlay_width \relax}
-\permanent\def\usedoverlayheight {\dimexpr\d_overlay_height \relax}
-\permanent\def\usedoverlaydepth {\dimexpr\d_overlay_depth \relax}
-\permanent\def\usedoverlayoffset {\dimexpr\d_overlay_offset \relax}
-\permanent\def\usedoverlaylinewidth{\dimexpr\d_overlay_linewidth\relax}
+\aliased\let\usedoverlaywidth \d_overlay_width
+\aliased\let\usedoverlayheight \d_overlay_height
+\aliased\let\usedoverlaydepth \d_overlay_depth
+\aliased\let\usedoverlayoffset \d_overlay_offset
+\aliased\let\usedoverlaylinewidth\d_overlay_linewidth
%D The next register is used to initialize overlays.
@@ -452,8 +513,12 @@
\vsize\d_overlay_height
\to \everyoverlay
+\protected\def\pack_overlay_define#1#2%
+ {\defcsname\??overlay#1\endcsname{\executedefinedoverlay{#1}{#2}}}
+
\permanent\tolerant\protected\def\defineoverlay[#1]#*[#2]% wil be overloaded
- {\def\pack_framed_define_overlay_indeed##1{\defcsname\??overlay##1\endcsname{\executedefinedoverlay{##1}{#2}}}%
+% {\def\pack_framed_define_overlay_indeed##1{\defcsname\??overlay##1\endcsname{\executedefinedoverlay{##1}{#2}}}%
+ {\def\pack_framed_define_overlay_indeed##1{\pack_overlay_define{##1}{#2}}%
\processcommalist[#1]\pack_framed_define_overlay_indeed}
\permanent\protected\def\executedefinedoverlay#1#2% we can share the definitions
@@ -497,7 +562,7 @@
\newtoks\everybackgroundbox
-\let\m_framed_background\empty % we might need a public name
+\lettonothing\m_framed_background % we might need a public name
\def\pack_framed_process_background
{\ifcsname\??overlaybuiltin\m_framed_background\endcsname
@@ -536,10 +601,10 @@
%D Beware, a backgroundbox can be empty which is another reason why we set the
%D width to zero instead of back-skipping.
-\newdimen\framedbackgroundwidth
-\newdimen\framedbackgroundheight
-\newdimen\framedbackgrounddepth
-\newdimen\framedbackgroundoffset
+\newdimension\framedbackgroundwidth
+\newdimension\framedbackgroundheight
+\newdimension\framedbackgrounddepth
+\newdimension\framedbackgroundoffset
\aliased\let\foregroundbox\relax
@@ -551,11 +616,14 @@
\edef\m_overlay_region{\reservedautoregiontag}%
\fi}
-\def\pack_framed_add_region % experiment
- {\anch_mark_tagged_box\b_framed_normal\m_overlay_region}
+\def\pack_framed_add_region % experiment, zerocount forces the given region
+ {\anch_mark_tagged_box\b_framed_normal\m_overlay_region\zerocount}
\def\pack_framed_add_background
- {\setbox\b_framed_normal\hpack % was vbox % see also *1*
+ {\ifconditional\c_pack_reanchor
+ \analyzelocalanchors\b_framed_normal
+ \fi
+ \setbox\b_framed_normal\hpack % was vbox % see also *1*
{%\pack_framed_forgetall % can be relaxed
\boxmaxdepth\maxdimen
\framedbackgroundoffset\d_framed_backgroundoffset
@@ -596,9 +664,9 @@
%D
%D We predefine two already familiar backgrounds:
-%letvalue{\??overlaybuiltin\v!screen }\pack_framed_background_box_gray
-\letvalue{\??overlaybuiltin\v!color }\pack_framed_background_box_color
-\letvalue{\??overlaybuiltin\v!foreground}\pack_framed_background_box_content % replaces: \defineoverlay[\v!foreground][\foregroundbox]
+%letcsname\??overlaybuiltin\v!screen \endcsname\pack_framed_background_box_gray
+\letcsname\??overlaybuiltin\v!color \endcsname\pack_framed_background_box_color
+\letcsname\??overlaybuiltin\v!foreground\endcsname\pack_framed_background_box_content % replaces: \defineoverlay[\v!foreground][\foregroundbox]
%D We can specify overlays as a comma separated list of overlays, a sometimes
%D handy feature.
@@ -614,7 +682,7 @@
\d_framed_target_ht\dimexpr\ht\b_framed_normal+ \d_framed_frameoffset\relax
\d_framed_target_dp\dimexpr\dp\b_framed_normal+ \d_framed_frameoffset+\framedparameter\c!framedepth\relax
\ifdim\d_framed_target_dp<\zeropoint
- \advance\d_framed_target_ht \d_framed_target_dp
+ \advanceby\d_framed_target_ht \d_framed_target_dp
\scratchdimen-\d_framed_target_dp
\d_framed_target_dp\zeropoint
\else
@@ -632,10 +700,48 @@
\box\b_framed_normal
\box\b_framed_extra}}
+%D A probably unknown feature:
+%D
+%D \startbuffer
+%D \hpack\bgroup
+%D \framed[framecolor=MyColor,frame=on] {!!!!!!!!}
+%D \framed[framecolor=MyColor,frame=closed]{!!!!!!!!}
+%D \framed[framecolor=MyColor,frame=small] {!!!!!!!!}
+%D \egroup
+%D \stopbuffer
+%D
+%D \typebuffer \startlinecorrection[blank] \getbuffer \stoplinecorrection
+
+% \def\pack_framed_stroked_box_normal_opened
+% {\setbox\scratchbox\vpack \bgroup
+% \csname\??framedtop\p_framed_frame\framedparameter\c!topframe\endcsname
+% \nointerlineskip % new (needed for fences)
+% \hpack \bgroup
+% \csname\??framedleft\p_framed_frame\framedparameter\c!leftframe\endcsname
+% \novrule
+% \s!width \d_framed_target_wd
+% \s!height\d_framed_target_ht
+% \s!depth \d_framed_target_dp
+% \csname\??framedright\p_framed_frame\framedparameter\c!rightframe\endcsname
+% \egroup
+% \nointerlineskip % new (needed for fences)
+% \csname\??framedbottom\p_framed_frame\framedparameter\c!bottomframe\endcsname
+% \egroup
+% \wd\scratchbox\d_framed_target_wd
+% \ht\scratchbox\d_framed_target_ht
+% \dp\scratchbox\d_framed_target_dp
+% \box\scratchbox}
+
+% less logging:
+
\def\pack_framed_stroked_box_normal_opened
{\setbox\scratchbox\vpack \bgroup
+ % \normaloffinterlineskip % sets baselineskip, lineskip and lineskiplimit
+ \baselineskip-\thousandpoint
+ \lineskip \zeropoint
+ \lineskiplimit\maxdimen
\csname\??framedtop\p_framed_frame\framedparameter\c!topframe\endcsname
- \nointerlineskip % new (needed for fences)
+ % \nointerlineskip % new (needed for fences)
\hpack \bgroup
\csname\??framedleft\p_framed_frame\framedparameter\c!leftframe\endcsname
\novrule
@@ -644,7 +750,7 @@
\s!depth \d_framed_target_dp
\csname\??framedright\p_framed_frame\framedparameter\c!rightframe\endcsname
\egroup
- \nointerlineskip % new (needed for fences)
+ % \nointerlineskip % new (needed for fences)
\csname\??framedbottom\p_framed_frame\framedparameter\c!bottomframe\endcsname
\egroup
\wd\scratchbox\d_framed_target_wd
@@ -655,7 +761,7 @@
\def\pack_framed_stroked_box_normal_closed
{\hpack\bgroup
\scratchdimen.5\d_framed_linewidth
- \hskip\scratchdimen
+ \kern\scratchdimen
\clf_framedoutline
\dimexpr\d_framed_target_wd-\d_framed_linewidth\relax
\dimexpr\d_framed_target_ht-\scratchdimen\relax
@@ -676,44 +782,61 @@
\def\pack_framed_r_rule{\kern-\d_framed_linewidth\vrule\s!width\d_framed_linewidth}
\def\pack_framed_l_rule{\vrule\s!width\d_framed_linewidth\kern-\d_framed_linewidth}
-\letvalue{\??framedtop \v!on \v!on}\pack_framed_t_rule
-\letvalue{\??framedtop \v!off\v!on}\pack_framed_t_rule
-\letvalue{\??framedtop \v!on }\pack_framed_t_rule
+\letcsname\??framedtop \v!on \v!on\endcsname\pack_framed_t_rule
+\letcsname\??framedtop \v!off\v!on\endcsname\pack_framed_t_rule
+\letcsname\??framedtop \v!on \endcsname\pack_framed_t_rule
-\letvalue{\??framedbottom\v!on \v!on}\pack_framed_b_rule
-\letvalue{\??framedbottom\v!off\v!on}\pack_framed_b_rule
-\letvalue{\??framedbottom\v!on }\pack_framed_b_rule
+\letcsname\??framedbottom\v!on \v!on\endcsname\pack_framed_b_rule
+\letcsname\??framedbottom\v!off\v!on\endcsname\pack_framed_b_rule
+\letcsname\??framedbottom\v!on \endcsname\pack_framed_b_rule
-\letvalue{\??framedleft \v!on \v!on}\pack_framed_l_rule
-\letvalue{\??framedleft \v!off\v!on}\pack_framed_l_rule
-\letvalue{\??framedleft \v!on }\pack_framed_l_rule
+\letcsname\??framedleft \v!on \v!on\endcsname\pack_framed_l_rule
+\letcsname\??framedleft \v!off\v!on\endcsname\pack_framed_l_rule
+\letcsname\??framedleft \v!on \endcsname\pack_framed_l_rule
-\letvalue{\??framedright \v!on \v!on}\pack_framed_r_rule
-\letvalue{\??framedright \v!off\v!on}\pack_framed_r_rule
-\letvalue{\??framedright \v!on }\pack_framed_r_rule
+\letcsname\??framedright \v!on \v!on\endcsname\pack_framed_r_rule
+\letcsname\??framedright \v!off\v!on\endcsname\pack_framed_r_rule
+\letcsname\??framedright \v!on \endcsname\pack_framed_r_rule
% no overlapping rules
-\def\pack_framed_t_rules{\hpack{\kern\d_framed_linewidth\vrule\s!width\dimexpr\d_framed_target_wd-2\d_framed_linewidth\relax\s!height\d_framed_linewidth}\nointerlineskip\kern-\d_framed_linewidth}
-\def\pack_framed_b_rules{\kern-\d_framed_linewidth\nointerlineskip\hpack{\kern\d_framed_linewidth\vrule\s!width\dimexpr\d_framed_target_wd-2\d_framed_linewidth\relax\s!height\d_framed_linewidth}}
-\def\pack_framed_r_rules{\kern-\d_framed_linewidth\vrule\s!height\dimexpr\d_framed_target_ht-\d_framed_linewidth\relax\s!depth-\d_framed_linewidth\s!width\d_framed_linewidth}
-\def\pack_framed_l_rules{\vrule\s!height\dimexpr\d_framed_target_ht-\d_framed_linewidth\relax\s!depth-\d_framed_linewidth\s!width\d_framed_linewidth\kern-\d_framed_linewidth}
+% \def\pack_framed_t_rules{\hpack{\kern\d_framed_linewidth\vrule\s!width\dimexpr\d_framed_target_wd-2\d_framed_linewidth\relax\s!height\d_framed_linewidth}\nointerlineskip\kern-\d_framed_linewidth}
+% \def\pack_framed_b_rules{\kern-\d_framed_linewidth\nointerlineskip\hpack{\kern\d_framed_linewidth\vrule\s!width\dimexpr\d_framed_target_wd-2\d_framed_linewidth\relax\s!height\d_framed_linewidth}}
+% \def\pack_framed_r_rules{\kern-\d_framed_linewidth\vrule\s!height\dimexpr\d_framed_target_ht-\d_framed_linewidth\relax\s!depth-\d_framed_linewidth\s!width\d_framed_linewidth}
+% \def\pack_framed_l_rules{\vrule\s!height\dimexpr\d_framed_target_ht-\d_framed_linewidth\relax\s!depth-\d_framed_linewidth\s!width\d_framed_linewidth\kern-\d_framed_linewidth}
+%
+% see above, less tracing
+%
+% \def\pack_framed_t_rules{\hpack{\kern\d_framed_linewidth\vrule\s!width\dimexpr\d_framed_target_wd-2\d_framed_linewidth\relax\s!height\d_framed_linewidth}\kern-\d_framed_linewidth}
+% \def\pack_framed_b_rules{\kern-\d_framed_linewidth\hpack{\kern\d_framed_linewidth\vrule\s!width\dimexpr\d_framed_target_wd-2\d_framed_linewidth\relax\s!height\d_framed_linewidth}}
+% \def\pack_framed_r_rules{\kern-\d_framed_linewidth\vrule\s!height\dimexpr\d_framed_target_ht-\d_framed_linewidth\relax\s!depth-\d_framed_linewidth\s!width\d_framed_linewidth}
+% \def\pack_framed_l_rules{\vrule\s!height\dimexpr\d_framed_target_ht-\d_framed_linewidth\relax\s!depth-\d_framed_linewidth\s!width\d_framed_linewidth\kern-\d_framed_linewidth}
+%
+% more modern:
+
+\def\pack_framed_rules_hrule{\hrule\s!height\d_framed_linewidth\s!left\d_framed_linewidth\s!right \d_framed_linewidth\relax}
+\def\pack_framed_rules_vrule{\vrule\s!width \d_framed_linewidth\s!top \d_framed_linewidth\s!bottom\d_framed_linewidth\relax}% \s!yoffset-\d_framed_linewidth}
-\letvalue{\??framedtop \v!small\v!small}\pack_framed_t_rules
-\letvalue{\??framedtop \v!off \v!small}\pack_framed_t_rules
-\letvalue{\??framedtop \v!small }\pack_framed_t_rules
+\def\pack_framed_t_rules{\pack_framed_rules_hrule\kern-\d_framed_linewidth}
+\def\pack_framed_b_rules{\kern-\d_framed_linewidth\pack_framed_rules_hrule}
+\def\pack_framed_r_rules{\kern-\d_framed_linewidth\pack_framed_rules_vrule}
+\def\pack_framed_l_rules{\pack_framed_rules_vrule\kern-\d_framed_linewidth}
-\letvalue{\??framedbottom\v!small\v!small}\pack_framed_b_rules
-\letvalue{\??framedbottom\v!off \v!small}\pack_framed_b_rules
-\letvalue{\??framedbottom\v!small }\pack_framed_b_rules
+\letcsname\??framedtop \v!small\v!small\endcsname\pack_framed_t_rules
+\letcsname\??framedtop \v!off \v!small\endcsname\pack_framed_t_rules
+\letcsname\??framedtop \v!small \endcsname\pack_framed_t_rules
-\letvalue{\??framedleft \v!small\v!small}\pack_framed_l_rules
-\letvalue{\??framedleft \v!off \v!small}\pack_framed_l_rules
-\letvalue{\??framedleft \v!small }\pack_framed_l_rules
+\letcsname\??framedbottom\v!small\v!small\endcsname\pack_framed_b_rules
+\letcsname\??framedbottom\v!off \v!small\endcsname\pack_framed_b_rules
+\letcsname\??framedbottom\v!small \endcsname\pack_framed_b_rules
-\letvalue{\??framedright \v!small\v!small}\pack_framed_r_rules
-\letvalue{\??framedright \v!off \v!small}\pack_framed_r_rules
-\letvalue{\??framedright \v!small }\pack_framed_r_rules
+\letcsname\??framedleft \v!small\v!small\endcsname\pack_framed_l_rules
+\letcsname\??framedleft \v!off \v!small\endcsname\pack_framed_l_rules
+\letcsname\??framedleft \v!small \endcsname\pack_framed_l_rules
+
+\letcsname\??framedright \v!small\v!small\endcsname\pack_framed_r_rules
+\letcsname\??framedright \v!off \v!small\endcsname\pack_framed_r_rules
+\letcsname\??framedright \v!small \endcsname\pack_framed_r_rules
% \framed
% [width=4cm,height=3cm,rulethickness=3mm,
@@ -775,11 +898,11 @@
% \presetlocalframed[\??framed]
-\newcount\c_pack_framed_nesting
+\newinteger\c_pack_framed_nesting
\permanent\tolerant\protected\def\framed[#1]%
{\bgroup
- \advance\c_pack_framed_nesting\plusone
+ \advanceby\c_pack_framed_nesting\plusone
\letcsname\??framed>\the\c_pack_framed_nesting:\s!parent\endcsname\??framed
\edef\currentframed{>\the\c_pack_framed_nesting}%
\pack_framed_initialize
@@ -794,7 +917,7 @@
\bgroup
\or
\ifhastok={#1}%
- \advance\c_pack_framed_nesting\plusone
+ \advanceby\c_pack_framed_nesting\plusone
\letcsname\??framed>\the\c_pack_framed_nesting:\s!parent\endcsname\??framed
\edef\currentframed{>\the\c_pack_framed_nesting}%
\pack_framed_initialize
@@ -823,7 +946,7 @@
\permanent\protected\def\normalframedwithsettings[#1]%
{\bgroup
- \advance\c_pack_framed_nesting\plusone
+ \advanceby\c_pack_framed_nesting\plusone
\letcsname\??framed>\the\c_pack_framed_nesting:\s!parent\endcsname\??framed
\bgroup
\edef\currentframed{>\the\c_pack_framed_nesting}%
@@ -881,6 +1004,7 @@
\edef\p_framed_background{\framedparameter\c!background}%
% not here, in calling macro: setups
\pack_framed_remove_depth
+ % beware, depth goes away when we have a frame, otherwise it's retained
\ifx\p_framed_frame\v!overlay \orelse \ifx\p_framed_frame\v!none \else
\ifempty\p_framed_rulethickness\else
\d_framed_linewidth\p_framed_rulethickness\relax
@@ -909,7 +1033,11 @@
%D can better be correct.
\protected\def\pack_framed_process_box_indeed#1#2% component box (assumes parameters set and grouped usage)
- {\setbox\b_framed_normal\box#2% could actually be \let\b_framed_normal#2
+ {%
+ %\setbox\b_framed_normal\box#2%
+ %\def\b_framed_normal{#2}% protected against overload
+ \enforced\let\b_framed_normal#2%
+ %
\edef\m_overlay_region{\framedparameter\c!region}%
\ifempty\m_overlay_region\else
\pack_framed_set_region
@@ -960,11 +1088,49 @@
%D \defineframed[test][hoffset=1cm]
%D \stoptyping
-\newdimen\d_framed_width
-\newdimen\d_framed_height
-\newdimen\d_framed_frameoffset
-\newdimen\d_framed_backgroundoffset
-\newdimen\d_framed_local_offset
+%D A byproduct of \type {\uleaders} in the 2022 math upgrade project:
+%D
+%D \starttyping
+%D \startsetups adaptive:test:a
+%D \setbox\usedadaptivebox\vbox to \usedadaptivetotal \bgroup
+%D \externalfigure
+%D [cow.pdf]
+%D [width=\framedmaxwidth,
+%D frame=on,
+%D height=\usedadaptivetotal]%
+%D \egroup
+%D \stopsetups
+%D
+%D \startsetups adaptive:test:b
+%D \setbox\usedadaptivebox\vbox to \usedadaptivetotal \bgroup
+%D \externalfigure
+%D [cow.pdf]
+%D [width=\usedadaptivewidth,
+%D frame=on,
+%D height=\usedadaptivetotal]%
+%D \egroup
+%D \stopsetups
+%D
+%D \framed[height=18cm,align=middle,adaptive=yes,top=,bottom=] {%
+%D \begstrut \samplefile{tufte} \endstrut
+%D \par
+%D \adaptivevbox
+%D [strut=yes,setups=adaptive:test:a]
+%D {\showstruts\strut\hsize5cm\hss}%
+%D \par
+%D \adaptivevbox
+%D [strut=yes,setups=adaptive:test:b]
+%D {\showstruts\strut\hsize5cm\hss}%
+%D \par
+%D \begstrut \samplefile{tufte} \endstrut
+%D }
+%D \stoptyping
+
+\newdimension\d_framed_width
+\newdimension\d_framed_height
+\newdimension\d_framed_frameoffset
+\newdimension\d_framed_backgroundoffset
+\newdimension\d_framed_local_offset
% todo: protect local \framednames
@@ -989,23 +1155,49 @@
\defineinterfaceconstant {fr!analyze} {fr:analyze} % private option
-\aliased\let\delayedbegstrut\relax
-\aliased\let\delayedendstrut\relax
-\aliased\let\delayedstrut \relax
-
-\mutable\let\localoffset\empty
-\mutable\let\localwidth \empty
-\mutable\let\localheight\empty
-\mutable\let\localformat\empty
-\mutable\let\localstrut \empty
-
-\mutable\let\framedwidth \empty
-\mutable\let\framedheight\empty
-\mutable\let\framedoffset\empty
-
-\aliased\let\localbegstrut\relax
-\aliased\let\localendstrut\relax
-\aliased\let\localstrut \relax
+\permanent\protected\lettonothing\delayedbegstrut
+\permanent\protected\lettonothing\delayedendstrut
+\permanent\protected\lettonothing\delayedstrut
+
+\permanent\protected\lettonothing\localbegstrut
+\permanent\protected\lettonothing\localendstrut
+\permanent\protected\lettonothing\localstrut
+
+\mutable\lettonothing\localoffset
+\mutable\lettonothing\localwidth
+\mutable\lettonothing\localheight
+\mutable\lettonothing\localformat
+
+\mutable\lettonothing\framedwidth
+\mutable\lettonothing\framedheight
+\mutable\lettonothing\framedoffset
+
+% better a constant:
+
+\newconditional\c_pack_resync
+\newconditional\c_pack_reanchor
+
+% \let\spac_framed_pop_local_anchors\relax
+
+\def\spac_framed_push_local_anchors
+ {\ifx\p_framed_synchronize\v!yes
+ \settrue\c_pack_resync
+ \settrue\c_pack_reanchor
+ \pushlocalanchors
+ % \aftergrouped{\aftergrouped{\poplocalanchors}}%
+ \aftergroup\poplocalanchors
+ \orelse\ifx\p_framed_synchronize\v!text
+ \settrue\c_pack_resync
+ \pushlocalanchors
+ \aftergroup\poplocalanchors
+ \orelse\ifx\p_framed_synchronize\v!background
+ \settrue\c_pack_reanchor
+ \pushlocalanchors
+ \aftergroup\poplocalanchors
+ \else
+ \setfalse\c_pack_resync
+ \setfalse\c_pack_reanchor
+ \fi}
\protected\def\pack_framed_process_indeed
{\d_framed_frameoffset\framedparameter\c!frameoffset
@@ -1037,10 +1229,19 @@
\edef\p_framed_location {\framedparameter\c!location}%
\edef\p_framed_orientation{\framedparameter\c!orientation}%
\edef\p_framed_anchoring {\framedparameter\c!anchoring}%
+ \edef\p_framed_synchronize{\framedparameter\c!synchronize}%
%
\edef\p_framed_autowidth {\framedparameter\c!autowidth}%
\edef\p_framed_franalyze {\framedparameter\c!fr!analyze}% experimental option
%
+ \ifempty\p_framed_synchronize
+ \setfalse\c_pack_resync
+ \setfalse\c_pack_reanchor
+% \let\spac_framed_pop_local_anchors\relax
+ \else
+ \spac_framed_push_local_anchors
+ \fi
+ %
\ifx\p_framed_frame\v!overlay % no frame, no offset, no framewidth
\setfalse\c_framed_has_frame
\let\localoffset\v!overlay
@@ -1088,8 +1289,13 @@
\fi
% the next check could move to heightalternative
\ifconditional\c_framed_has_height
- % obey user set height, also downward compatible
+ \ifcstok{\framedparameter\c!adaptive}\v!yes
+ \let\p_framed_adaptive\s!delay
+ \else
+ \lettonothing\p_framed_adaptive
+ \fi
\else
+ \lettonothing\p_framed_adaptive
\edef\p_framed_lines{\framedparameter\c!lines}%
\ifempty\p_framed_lines
\orelse\ifcase\p_framed_lines
@@ -1107,8 +1313,8 @@
% \d_framed_width\localhsize
% \fi
% i.e. disable (colsetbackgroundproblemintechniek)
- \advance\d_framed_width -2\d_framed_local_offset
- \advance\d_framed_height -2\d_framed_local_offset
+ \advanceby\d_framed_width -2\d_framed_local_offset
+ \advanceby\d_framed_height -2\d_framed_local_offset
\ifcsname\??framedstrutalternative\p_strut\endcsname
\lastnamedcs
\else
@@ -1116,9 +1322,9 @@
\fi
% the next check could move to strutalternative
\ifcase\c_framed_has_strut % none (not even noindent)
- \enforced\let\localbegstrut\relax
- \enforced\let\localendstrut\relax
- \enforced\let\localstrut \relax
+ \enforced\lettonothing\localbegstrut
+ \enforced\lettonothing\localendstrut
+ \enforced\lettonothing\localstrut
\or % no / overlay
\enforced\let\localbegstrut\pseudobegstrut
\enforced\let\localendstrut\pseudoendstrut
@@ -1129,16 +1335,16 @@
\enforced\let\localstrut \strut
\fi
\ifx\p_framed_autostrut\v!yes
- \enforced\let\delayedbegstrut\relax
- \enforced\let\delayedendstrut\relax
- \enforced\let\delayedstrut \relax
+ \enforced\lettonothing\delayedbegstrut
+ \enforced\lettonothing\delayedendstrut
+ \enforced\lettonothing\delayedstrut
\else
- \enforced\let\delayedbegstrut\localbegstrut
- \enforced\let\delayedendstrut\localendstrut
- \enforced\let\delayedstrut \localstrut
- \enforced\let\localbegstrut \relax
- \enforced\let\localendstrut \relax
- \enforced\let\localstrut \relax
+ \enforced\let \delayedbegstrut\localbegstrut
+ \enforced\let \delayedendstrut\localendstrut
+ \enforced\let \delayedstrut \localstrut
+ \enforced\lettonothing\localbegstrut
+ \enforced\lettonothing\localendstrut
+ \enforced\lettonothing\localstrut
\fi
\ifconditional\c_framed_has_height
\enforced\let\\\pack_framed_vboxed_newline
@@ -1174,17 +1380,17 @@
\fi
\pack_framed_check_extra_offsets
\edef\p_framed_background{\framedparameter\c!background}%
-% \ifempty\p_framed_background
-% \let\pack_framed_forgetall\forgetall
-% \else
-% \let\pack_framed_forgetall\relax
-% \forgetall
-% \fi
+ % \ifempty\p_framed_background
+ % \let\pack_framed_forgetall\forgetall
+ % \else
+ % \let\pack_framed_forgetall\relax
+ % \forgetall
+ % \fi
\edef\framedwidth {\the\ifdim\d_framed_width >\zeropoint \d_framed_width \else\zeropoint\fi}% public
\edef\framedheight{\the\ifdim\d_framed_height>\zeropoint \d_framed_height\else\zeropoint\fi}% public
\edef\framedoffset{\the\dimexpr\ifconditional\c_framed_has_offset\localoffset \else\zeropoint\fi}% public
% for now: i need to think of something better
- % \bitwiseflip \normalizelinemode -\clipwidthcode % now handled in analyzer
+ % \bitwiseflip \normalizelinemode -\clipwidthnormalizecode % now handled in analyzer
% but that's for later
\ifempty\p_framed_orientation
\let\pack_framed_stop_orientation\relax
@@ -1202,8 +1408,12 @@
\installcorenamespace{framedoffsetalternative}
% widths
+%
+% \inframed[adaptive=0500]{Just some words}
+% \inframed[adaptive=0] {Just some words}
+% \inframed[adaptive=-500]{Just some words}
-\setvalue{\??framedwidthalternative\empty}%
+\defcsname\??framedwidthalternative\empty\endcsname
{\ifconditional\c_framed_has_format
\settrue\c_framed_has_width
\d_framed_width\hsize
@@ -1212,7 +1422,7 @@
\d_framed_width\zeropoint
\fi}
-\setvalue{\??framedwidthalternative\v!fit}%
+\defcsname\??framedwidthalternative\v!fit\endcsname
{\ifconditional\c_framed_has_format
\settrue\c_framed_has_width
\d_framed_width\hsize
@@ -1221,7 +1431,7 @@
\d_framed_width\zeropoint
\fi}
-\setvalue{\??framedwidthalternative\v!fixed}% equals \v!fit but no shapebox
+\defcsname\??framedwidthalternative\v!fixed\endcsname % equals \v!fit but no shapebox
{\ifconditional\c_framed_has_format
\settrue\c_framed_has_width
\d_framed_width\hsize
@@ -1230,20 +1440,20 @@
\d_framed_width\zeropoint
\fi}
-\setvalue{\??framedwidthalternative\v!broad}%
+\defcsname\??framedwidthalternative\v!broad\endcsname
{\settrue\c_framed_has_width
\d_framed_width\hsize}
-\setvalue{\??framedwidthalternative\v!max}% idem broad
+\defcsname\??framedwidthalternative\v!max\endcsname % idem broad
{\settrue\c_framed_has_width
\d_framed_width\hsize}
-\setvalue{\??framedwidthalternative\v!local}%
+\defcsname\??framedwidthalternative\v!local\endcsname
{\settrue\c_framed_has_width
%\setlocalhsize
\d_framed_width\localhsize}
-\setvalue{\??framedwidthalternative\s!unknown}%
+\defcsname\??framedwidthalternative\s!unknown\endcsname
{\settrue\c_framed_has_width
\d_framed_width\localwidth}
@@ -1253,23 +1463,23 @@
% heights
-\setvalue{\??framedheightalternative\empty}%
+\defcsname\??framedheightalternative\empty\endcsname
{\setfalse\c_framed_has_height
\d_framed_height\zeropoint}
-\setvalue{\??framedheightalternative\v!fit}%
+\defcsname\??framedheightalternative\v!fit\endcsname
{\setfalse\c_framed_has_height
\d_framed_height\zeropoint}
-\setvalue{\??framedheightalternative\v!broad}%
+\defcsname\??framedheightalternative\v!broad\endcsname
{\setfalse\c_framed_has_height
\d_framed_height\zeropoint}
-\setvalue{\??framedheightalternative\v!max}%
+\defcsname\??framedheightalternative\v!max\endcsname
{\settrue\c_framed_has_height
\d_framed_height\vsize}
-\setvalue{\??framedheightalternative\s!unknown}%
+\defcsname\??framedheightalternative\s!unknown\endcsname
{\settrue\c_framed_has_height
\d_framed_height\localheight}
@@ -1279,49 +1489,49 @@
% struts (use let instead?)
-\setvalue{\??framedstrutalternative\v!no}%
+\defcsname\??framedstrutalternative\v!no\endcsname
{\c_framed_has_strut\plusone}
-\setvalue{\??framedstrutalternative\v!global}%
+\defcsname\??framedstrutalternative\v!global\endcsname
{\setstrut}
-\setvalue{\??framedstrutalternative\v!local}%
+\defcsname\??framedstrutalternative\v!local\endcsname
{\setfontstrut}
-\setvalue{\??framedstrutalternative\v!yes}%
+\defcsname\??framedstrutalternative\v!yes\endcsname
{\setstrut}
-\setvalue{\??framedstrutalternative\s!unknown}%
+\defcsname\??framedstrutalternative\s!unknown\endcsname
{\setstrut}
\def\framed_strut_alternative_unknown
{\setstrut}
-\setvalue{\??framedstrutalternative\v!none}% not even pseudo struts
+\defcsname\??framedstrutalternative\v!none\endcsname % not even pseudo struts
{\c_framed_has_strut\zerocount}
% offsets
-\setvalue{\??framedoffsetalternative\v!none}%
+\defcsname\??framedoffsetalternative\v!none\endcsname
{\setfalse\c_framed_has_offset
\c_framed_has_strut\plusone
\setfalse\c_framed_is_overlaid
\d_framed_local_offset\d_framed_linewidth}
-\setvalue{\??framedoffsetalternative\v!overlay}%
+\defcsname\??framedoffsetalternative\v!overlay\endcsname
{% \ifx\p_framed_frame\v!no \setfalse\c_framed_has_frame \fi % test first
\setfalse\c_framed_has_offset
\c_framed_has_strut\plusone
\settrue\c_framed_is_overlaid
\d_framed_local_offset\zeropoint}
-% \setvalue{\??framedoffsetalternative\v!strut}%
+% \defcsname\??framedoffsetalternative\v!strut\endcsname
% {\setfalse\c_framed_has_offset
% \c_framed_has_strut\plustwo
% \settrue\c_framed_is_overlaid
% \d_framed_local_offset\zeropoint}
-\setvalue{\??framedoffsetalternative\v!default}% new per 2-6-2000
+\defcsname\??framedoffsetalternative\v!default\endcsname % new per 2-6-2000
{\settrue \c_framed_has_offset
\c_framed_has_strut\plustwo
\setfalse\c_framed_is_overlaid
@@ -1336,7 +1546,7 @@
\let\defaultframeoffset\localoffset
\d_framed_local_offset\dimexpr\localoffset+\d_framed_linewidth\relax}
-\letvalue{\??framedoffsetalternative\s!unknown}\framed_offset_alternative_unknown
+\letcsname\??framedoffsetalternative\s!unknown\endcsname\framed_offset_alternative_unknown
% so far for alternatives
@@ -1412,6 +1622,19 @@
% options (btw, beware of location settings of derived functionality that bleed
% into this
+\def\pack_framed_profile_box
+ {\profilegivenbox\p_profile\b_framed_normal
+ \setbox\b_framed_normal\vpack{\unvbox\b_framed_normal}}
+
+\def\pack_framed_reverse_box
+ {\ifvbox\b_framed_normal
+ \edef\p_linedirection{\framedparameter\c!linedirection}%
+ \ifx\p_linedirection\v!reverse
+ \reversevboxcontent\b_framed_normal
+ \setbox\b_framed_normal\vpack{\unvbox\b_framed_normal}%
+ \fi
+ \fi}
+
\def\pack_framed_finish_a
{\ifreshapeframebox
\pack_framed_reshape_process
@@ -1437,29 +1660,20 @@
\pack_framed_reshape_reset
\fi}
-\def\pack_framed_profile_box
- {\profilegivenbox\p_profile\b_framed_normal
- \setbox\b_framed_normal\vpack{\unvbox\b_framed_normal}}
-
-\def\pack_framed_reverse_box
- {\ifvbox\b_framed_normal
- \edef\p_linedirection{\framedparameter\c!linedirection}%
- \ifx\p_linedirection\v!reverse
- \reversevboxcontent\b_framed_normal
- \setbox\b_framed_normal\vpack{\unvbox\b_framed_normal}%
- \fi
- \fi}
+% Musical timestamp for the adding the "freezespacing" feature: Porcupine Tree -
+% Herd Culling (Single Edit - Official Visualiser : some old sql code scrolling by
+% on some paper terminal font); scalefactors are in the range -1000..1000.
\protected\def\pack_framed_finish
- {%\pack_framed_stop_orientation % hm, wrong place ! should rotate the result (after reshape) .. moved down
+ {\edef\p_freeze{\framedparameter\c!freezespacing}%
+ \ifempty\p_freeze
+ % \orelse\ifx\p_freeze\v!yes
+ % \boxfreeze\b_framed_normal\zerocount
+ \else
+ \boxadapt\b_framed_normal\p_freeze\relax
+ \fi
\pack_framed_locator_before\p_framed_location
\ifconditional\c_framed_has_format
- %\ifconditional\c_framed_has_height \else
- % \edef\p_profile{\framedparameter\c!profile}%
- % \ifempty\p_profile\else
- % \pack_framed_profile_box
- % \fi
- %\fi
\ifempty\p_framed_anchoring\else
\pack_framed_reverse_box
\fi
@@ -1496,10 +1710,8 @@
\ht\b_framed_normal\d_framed_height
\else
\edef\p_framed_minheight{\framedparameter\c!minheight}%
- \ifempty\p_framed_minheight \else
- \ifdim\ht\b_framed_normal<\p_framed_minheight
- \ht\b_framed_normal\p_framed_minheight
- \fi
+ \ifempty\p_framed_minheight \orelse \ifdim\ht\b_framed_normal<\p_framed_minheight
+ \ht\b_framed_normal\p_framed_minheight
\fi
\fi
\edef\p_framed_empty{\framedparameter\c!empty}%
@@ -1523,15 +1735,13 @@
\d_framed_linewidth
\fi
\ifconditional\c_framed_has_offset
- \advance\d_framed_applied_offset\localoffset\relax
+ \advanceby\d_framed_applied_offset\localoffset\relax
\fi
\ifconditional\c_framed_has_extra_offset
\pack_framed_apply_extra_offsets % includes \d_framed_applied_offset
+ \orelse\ifzeropt\d_framed_applied_offset
\else
- \ifzeropt\d_framed_applied_offset
- \else
- \pack_framed_widen_box
- \fi
+ \pack_framed_widen_box
\fi
%
\ifrelax\postprocessframebox \else
@@ -1551,11 +1761,10 @@
\pack_framed_add_background
\fi
\fi
+% \pack_framed_pop_local_anchors
\pack_framed_locator_after\p_framed_location
- \iftrialtypesetting \else
- \ifempty\m_overlay_region\else
- \pack_framed_add_region
- \fi
+ \iftrialtypesetting \orelse \ifempty\m_overlay_region \else
+ \pack_framed_add_region
\fi
\box\b_framed_normal
\global\frameddimensionstate % global so to be used directly afterwards !
@@ -1620,10 +1829,10 @@
\def\pack_framed_locator_before#1{\begincsname\??framedlocatorbefore#1\endcsname}
\def\pack_framed_locator_after #1{\begincsname\??framedlocatorafter #1\endcsname}
-\newdimen\d_framed_locator_ht
-\newdimen\d_framed_locator_dp
-\newdimen\d_framed_locator_lo
-\newdimen\d_framed_locator_ro
+\newdimension\d_framed_locator_ht
+\newdimension\d_framed_locator_dp
+\newdimension\d_framed_locator_lo
+\newdimension\d_framed_locator_ro
\def\pack_framed_locator_set#1%
{\d_framed_locator_ht\dimexpr
@@ -1674,6 +1883,12 @@
% \framed[width=2cm,align=middle,location=lohi] {location\\equals\\lohi}
% \framed[width=2cm,align=middle,location=middle] {location\\equals\\middle}
% B}
+% \vskip2cm
+% \ruledhbox
+% {A
+% \framed[width=2cm,align=middle,location=keep] {location\\equals\\top}
+% \framed[width=2cm,align=middle,location=formula {location\\equals\\bottom}
+% B}
\installframedlocator \v!hanging % best with strut=no *1* / see mail to list by SB
{}
@@ -1753,7 +1968,7 @@
{\pack_framed_remove_depth}
{\pack_framed_restore_depth}
-\newdimen\d_framed_formula
+\newdimension\d_framed_formula
\installframedlocator \v!formula % private, will become a more generic name
{}
@@ -1765,9 +1980,9 @@
% also used in fastlocalframed
-\newdimen\d_framed_original_wd
-\newdimen\d_framed_original_ht
-\newdimen\d_framed_original_dp
+\newdimension\d_framed_original_wd
+\newdimension\d_framed_original_ht
+\newdimension\d_framed_original_dp
\def\pack_framed_remove_depth
{\d_framed_original_wd\wd\b_framed_normal
@@ -1817,151 +2032,14 @@
%D When we set \type{empty} to \type{yes}, we get ourselves a frame and/or background,
%D but no content, so actually we have a sort of phantom framed box.
-%D \macros
-%D {mframed, minframed}
-%D
-%D When Tobias asked how to frame mathematical elements in formulas, Taco's posted the
-%D next macro:
-%D
-%D \starttyping
-%D \def\mframed#1%
-%D {\relax
-%D \ifmmode
-%D \vcenter{\hbox{\framed{$\ifinner\else\displaystyle\fi#1$}}}%
-%D \else
-%D \framed{$#1$}%
-%D \fi}
-%D \stoptyping
-%D
-%D Because \type {\ifinner} does not (always) reports what one would expect, we move the
-%D test to the outer level. We also want to pass arguments,
-%D
-%D \starttyping
-%D \def\mframed%
-%D {\dosingleempty\domframed}
-%D
-%D \def\domframed[#1]#2% % tzt \dowithnextmathbox ?
-%D {\relax
-%D \ifmmode
-%D \ifinner
-%D \inframed[#1]{$#2$}%
-%D \else
-%D \vcenter{\hbox{\framed[#1]{$\displaystyle#2$}}}%
-%D \fi
-%D \else
-%D \inframed[#1]{$#2$}%
-%D \fi}
-%D \stoptyping
-%D
-%D Still better is the next alternative, if only because it takes care of setting the super-
-%D and subscripts styles
-
-\newcount\c_framed_mstyle
-
-\protected\def\pack_framed_math_strut
- {\Ustartmath
- \triggermathstyle\c_framed_mstyle
- \vphantom{(}%
- \Ustopmath}
-
-\installcorenamespace{mathframed}
-
-\installframedcommandhandler \??mathframed {mathframed} \??mathframed
-
-\newcount\c_pack_framed_mathframed
-\newtoks \t_pack_framed_mathframed
-
-\appendtoks
- \frozen\protected\instance\edefcsname\currentmathframed\endcsname{\pack_framed_mathframed[\currentmathframed]}%
-\to \everydefinemathframed
-
-\let\pack_framed_mc_one\relax
-\let\pack_framed_mc_two\relax
-
-\tolerant\protected\def\pack_framed_mathframed[#1]#*[#2]#:#3% needs testing !
- {\begingroup
- \edef\currentmathframed{#1}%
- \setupcurrentmathframed[#2]%
- \c_framed_mstyle\normalmathstyle
- \edef\m_framed_location{\mathframedparameter\c!location}%
- \ifx\m_framed_location\v!mathematics
- \enforced\let\normalstrut\pack_framed_math_pos % I don't like this overload!
- \orelse\ifx\m_framed_location\v!low\else
- \enforced\let\normalstrut\pack_framed_math_strut
- \fi
- \inheritedmathframedframed\bgroup
- \Ustartmath
- \triggermathstyle\c_framed_mstyle
- \the\t_pack_framed_mathframed
- #3%
- \Ustopmath
- \egroup
- \endgroup}
-
-\def\pack_framed_math_pos
- {\global\advance\c_pack_framed_mathframed\plusone
- \xdef\pack_framed_mc_one{mcf:1:\number\c_pack_framed_mathframed}%
- \xdef\pack_framed_mc_two{mcf:2:\number\c_pack_framed_mathframed}%
- \xypos\pack_framed_mc_two}
-
-\appendtoks
- \mathraggedstatus\plustwo % makes \startalign work
- \eqalignmode \zerocount % makes \startalign fit
-\to \t_pack_framed_mathframed
-
-\installframedlocator \v!mathematics
- {}
- {\lower\dimexpr\MPy\pack_framed_mc_two-\MPy\pack_framed_mc_one\relax
- \hpack{\xypos\pack_framed_mc_one\box\b_framed_normal}}
-
-\definemathframed[mframed]
-\definemathframed[inmframed][\c!location=\v!low]
-\definemathframed[mcframed] [\c!location=\v!mathematics]
-
-%D So instead of the rather versatile \type {\framed}, we use \type {\mframed}:
-%D
-%D \startbuffer
-%D \startformula
-%D x \times \mframed{y} \times y^{z_z}
-%D x \times \inmframed{y} \times y^{z_z}
-%D \stopformula
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-%D
-%D And:
-%D
-%D \startbuffer
-%D \startformula
-%D x \times \mframed{y} \times y^{\mframed{z}_{\mframed{z}}}
-%D \stopformula
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-%D
-%D As usual, one can specify in what way the text should be framed. One should be
-%D aware of the fact that, inorder to preserve the proper spacing, the \type
-%D {offset} is set to \type {overlay} and \type {frameoffset} is used used instead.
-%D
-%D \startbuffer
-%D \startformula
-%D x \times y^{\mframed[framecolor=red]{z}_{z}}
-%D \stopformula
-%D \stopbuffer
-%D
-%D \typebuffer \getbuffer
-%D
-%D For inline use, we also provide the \type {\inmframed} alternative: we want $x
-%D \times \inmframed{y}$ in inline math, right?
-
%D This previous framing macros needs a lot of alternatives for putting rules around
%D boxes, inserting offsets and aligning text. Each step is handled by separate macros.
-\newdimen\d_framed_applied_offset
-\newdimen\d_framed_loffset
-\newdimen\d_framed_roffset
-\newdimen\d_framed_toffset
-\newdimen\d_framed_boffset
+\newdimension\d_framed_applied_offset
+\newdimension\d_framed_loffset
+\newdimension\d_framed_roffset
+\newdimension\d_framed_toffset
+\newdimension\d_framed_boffset
\def\pack_framed_check_extra_offsets % we could check h and v indepently
{\setfalse\c_framed_has_extra_offset
@@ -1969,17 +2047,17 @@
\d_framed_roffset\framedparameter\c!roffset\relax
\d_framed_toffset\framedparameter\c!toffset\relax
\d_framed_boffset\framedparameter\c!boffset\relax
- \ifzeropt\d_framed_loffset\else \advance\d_framed_width -\d_framed_loffset \settrue\c_framed_has_extra_offset \fi
- \ifzeropt\d_framed_roffset\else \advance\d_framed_width -\d_framed_roffset \settrue\c_framed_has_extra_offset \fi
- \ifzeropt\d_framed_toffset\else \advance\d_framed_height-\d_framed_toffset \settrue\c_framed_has_extra_offset \fi
- \ifzeropt\d_framed_boffset\else \advance\d_framed_height-\d_framed_boffset \settrue\c_framed_has_extra_offset \fi}
+ \ifzeropt\d_framed_loffset\else \advanceby\d_framed_width -\d_framed_loffset \settrue\c_framed_has_extra_offset \fi
+ \ifzeropt\d_framed_roffset\else \advanceby\d_framed_width -\d_framed_roffset \settrue\c_framed_has_extra_offset \fi
+ \ifzeropt\d_framed_toffset\else \advanceby\d_framed_height-\d_framed_toffset \settrue\c_framed_has_extra_offset \fi
+ \ifzeropt\d_framed_boffset\else \advanceby\d_framed_height-\d_framed_boffset \settrue\c_framed_has_extra_offset \fi}
\def\pack_framed_apply_extra_offsets
{\setbox\b_framed_normal\vpack\bgroup
- \advance\d_framed_toffset\d_framed_applied_offset
- \advance\d_framed_boffset\d_framed_applied_offset
- \advance\d_framed_loffset\d_framed_applied_offset
- \advance\d_framed_roffset\d_framed_applied_offset
+ \advanceby\d_framed_toffset\d_framed_applied_offset
+ \advanceby\d_framed_boffset\d_framed_applied_offset
+ \advanceby\d_framed_loffset\d_framed_applied_offset
+ \advanceby\d_framed_roffset\d_framed_applied_offset
\kern\d_framed_toffset
\hpack\bgroup
\kern\d_framed_loffset
@@ -2120,7 +2198,7 @@
\fi}
\def\pack_framed_format_format_yes
- {\vbox to \d_framed_height
+ {\vbox to \d_framed_height \p_framed_adaptive
\bgroup
\let\postprocessframebox\relax
% \pack_framed_forgetall
@@ -2303,12 +2381,12 @@
%D It is possible to let the frame macro calculate the width of a centered box
%D automatically (\type {fit}). When doing so, we need to reshape the box:
-\newcount\framednoflines
-\newdimen\framedfirstheight
-\newdimen\framedlastdepth
-\newdimen\framedminwidth
-\newdimen\framedmaxwidth
-\newdimen\framedaveragewidth
+% \newinteger \framednoflines
+% \newdimension\framedfirstheight
+% \newdimension\framedlastdepth
+% \newdimension\framedminwidth
+% \newdimension\framedmaxwidth
+% \newdimension\framedaveragewidth
\def\pack_framed_reshape_reset
{\framednoflines \zerocount
@@ -2318,8 +2396,26 @@
\framedmaxwidth \zeropoint
\framedaveragewidth\zeropoint}
-\def\pack_framed_reshape_process{\ifvbox\b_framed_normal\clf_doreshapeframedbox\b_framed_normal\relax\fi}
-\def\pack_framed_reshape_analyze{\ifvbox\b_framed_normal\clf_doanalyzeframedbox\b_framed_normal\relax\fi}
+\def\pack_framed_reshape_process
+ {\ifvbox\b_framed_normal
+ \ifconditional\c_pack_resync
+ \clf_doresyncframedbox
+ \else
+ \clf_doreshapeframedbox
+ \fi\b_framed_normal\relax
+ \ifx\p_framed_adaptive\s!delay
+ \adaptivecheckbox\b_framed_normal
+ \fi
+ \fi}
+
+\def\pack_framed_reshape_analyze
+ {\ifvbox\b_framed_normal
+ \ifconditional\c_pack_resync
+ \clf_doresyncframedbox
+ \else
+ \clf_doanalyzeframedbox
+ \fi\b_framed_normal\relax
+ \fi}
% torture test / strange case (much depth) / method 2 needed
%
@@ -2629,29 +2725,33 @@
\frozen\instance\protected\edefcsname \currentframedtext\endcsname{\pack_framed_text_direct[\currentframedtext]}%
\to \everydefineframedtext
-\setvalue{\??framedtextlocation\v!left }{\letframedtextparameter\c!left \relax
- \letframedtextparameter\c!right\hfill}
+\defcsname\??framedtextlocation\v!left\endcsname
+ {\letframedtextparameter\c!left \relax
+ \letframedtextparameter\c!right\hfill}
-\setvalue{\??framedtextlocation\v!right }{\letframedtextparameter\c!left \hfill
- \letframedtextparameter\c!right\relax}
+\defcsname\??framedtextlocation\v!right\endcsname
+ {\letframedtextparameter\c!left \hfill
+ \letframedtextparameter\c!right\relax}
-\setvalue{\??framedtextlocation\v!middle}{\letframedtextparameter\c!left \hfill
- \letframedtextparameter\c!right\hfill}
+\defcsname\??framedtextlocation\v!middle\endcsname
+ {\letframedtextparameter\c!left \hfill
+ \letframedtextparameter\c!right\hfill}
-\setvalue{\??framedtextlocation\v!none }{\letframedtextparameter\c!left \relax
- \letframedtextparameter\c!right\relax
- \settrue\c_framed_text_location_none}
+\defcsname\??framedtextlocation\v!none\endcsname
+ {\letframedtextparameter\c!left \relax
+ \letframedtextparameter\c!right\relax
+ \settrue\c_framed_text_location_none}
\tolerant\protected\def\pack_framed_text_start[#1]#*[#2]#*[#3]% or #1#*[#2]#*[#3]% and pass {#1}
{\bgroup
- \edef\currentframedtext{#1}
+ \edef\currentframedtext{#1}%
\doifelseassignment{#2}
- {\pack_framed_text_start_continue\empty{#2}}
- {\pack_framed_text_start_continue{#2}{#3}}}
+ {\pack_framed_text_start_indeed\empty{#2}}
+ {\pack_framed_text_start_indeed{#2}{#3}}}
-% todo: sort out first/lastline ht/dp
+% todo: sort out first/lastline ht/dp . . will be a more advanced mechanism some day (soon)
-\def\pack_framed_text_start_continue#1#2%
+\def\pack_framed_text_start_indeed#1#2%
{\setupframedtexts[\currentframedtext][#2]%
\doifsomething{#1}{\setframedtextparameter\c!location{#1}}% does not listen to #3
\setfalse\c_framed_text_location_none
@@ -2673,7 +2773,7 @@
\else
\bgroup
\fi
- \vskip-\strutdp % brrr why is this needed ... needs to be sorted out, see testcase 1
+ % no longer: \vskip-\strutdp % brrr why is this needed ... needs to be sorted out, see testcase 1
\doinhibitblank
\useindentingparameter\framedtextparameter
\useframedtextstyleandcolor\c!style\c!color
@@ -2786,7 +2886,7 @@
\blank[\v!disable]%
\enforced\let\\\endgraf
\useframedtextstyleandcolor\c!style\c!color
- \vskip-\strutdp % brrr why is this needed ... needs to be sorted out, see testcase 1
+ % no longer: \vskip-\strutdp % brrr why is this needed ... needs to be sorted out, see testcase 1
\framedtextparameter\c!inner
\ifx\p_framed_text_strut\v!no
\let\pack_framed_strut\relax
@@ -2823,7 +2923,7 @@
\ifcsname\??regularframedlevel\currentframed\endcsname
% already defined, keeps settings
\else
- \expandafter\newcount\csname\??regularframedlevel\currentframed\endcsname
+ \expandafter\newinteger\csname\??regularframedlevel\currentframed\endcsname
\fi
\to \everypresetframed
@@ -2831,7 +2931,7 @@
\frozen\instance\setuevalue{\currentframed}{\pack_framed_defined_process[\currentframed]}%
\to \everydefineframed
-\newcount\c_temp_framed_crap
+\newinteger\c_temp_framed_crap
% \permanent\tolerant\protected\def\pack_framed_defined_process[#1]#*[#2]% official (not much checking, todo: parent)
% {\bgroup
@@ -2841,7 +2941,7 @@
% \else
% \let\c_pack_framed_temp\c_temp_framed_crap
% \fi
-% \advance\c_pack_framed_temp\plusone
+% \advanceby\c_pack_framed_temp\plusone
% \defcsname\??framed#1>\the\c_pack_framed_temp:\s!parent\endcsname{\??framed#1}% \inheritlocalframed
% \bgroup
% \edef\currentframed{#1>\the\c_pack_framed_temp}%
@@ -2857,7 +2957,7 @@
\else
\scratchcounter\c_temp_framed_crap
\fi
- \advance\scratchcounter\plusone
+ \advanceby\scratchcounter\plusone
\defcsname\??framed#1>\the\scratchcounter:\s!parent\endcsname{\??framed#1}% \inheritlocalframed
\bgroup
\edef\currentframed{#1>\the\scratchcounter}%
@@ -2949,8 +3049,8 @@
\scratchrightoffset \framedcontentparameter\c!rightoffset \relax
\scratchtopoffset \framedcontentparameter\c!topoffset \relax
\scratchbottomoffset\framedcontentparameter\c!bottomoffset\relax
- \advance\hsize\dimexpr-\scratchleftoffset-\scratchrightoffset \relax
- \advance\vsize\dimexpr-\scratchtopoffset -\scratchbottomoffset\relax
+ \advanceby\hsize\dimexpr-\scratchleftoffset-\scratchrightoffset \relax
+ \advanceby\vsize\dimexpr-\scratchtopoffset -\scratchbottomoffset\relax
\kern\scratchleftoffset
\vpack\bgroup
\vskip\scratchtopoffset
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-app.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-app.mkxl
index d75366cca0d..9a800841d92 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-app.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-app.mkxl
@@ -21,9 +21,9 @@
\installframedcommandhandler \??fittingpage {fittingpage} \??fittingpage
-\newdimen\d_page_fitting_width
-\newdimen\d_page_fitting_height
-\newbox \b_page_fitting
+\newdimension\d_page_fitting_width
+\newdimension\d_page_fitting_height
+\newbox \b_page_fitting
\definepapersize
[fittingpage]
@@ -75,6 +75,7 @@
\bgroup
\inheritedfittingpageframed
\bgroup
+ \pack_framed_initialize
\gobblespacetokens}
\protected\def\page_fitting_stop_normal % todo: figure out why a small mp image gets shifted
@@ -95,10 +96,10 @@
{\setbox\b_page_fitting\hpack\bgroup
\scale[\c!scale=\fittingpageparameter\c!scale]{\box\b_page_fitting}%
\egroup}%
- \ifdim\ht\b_page_fitting=\zeropoint
+ \ifzeropt\ht\b_page_fitting
\ht\b_page_fitting\onepoint
\fi
- \ifdim\wd\b_page_fitting=\zeropoint
+ \ifzeropt\wd\b_page_fitting
\wd\b_page_fitting\onepoint
\fi
\d_page_fitting_width \wd\b_page_fitting
@@ -123,7 +124,7 @@
\setupfittingpage
[%\c!scale=1000,
%\c!pagestate=,
- \c!strut=\v!no,
+ \c!strut=\v!none, % was no, but we get a noindent then (with the danger of a lineskip)
\c!align=\v!normal,
\c!offset=\v!overlay,
\c!width=\v!fit,
@@ -193,7 +194,7 @@
{\bgroup
\setupexternalfigure[\v!page:\v!figure][\c!offset=\v!overlay,#2]%
\startTEXpage[\c!offset=\namedexternalfigureparameter{\v!page:\v!figure}\c!offset,\c!align=\v!normal]%
- \externalfigure[#1]\ignorespaces} % so we can put some text below the graphic
+ \externalfigure[#1][\v!page:\v!figure]\ignorespaces} % so we can put some text below the graphic
\permanent\protected\def\stoppagefigure
{\stopTEXpage
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-bck.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-bck.mkxl
index 5683ba2505e..bdea7b2fe50 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-bck.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-bck.mkxl
@@ -19,6 +19,8 @@
\unprotect
+\startcontextdefinitioncode
+
% maybe use \currentframedhash here
%D For special purposes, users can question the \type {*background} mode. This mode
@@ -50,7 +52,7 @@
%D We keep calculations and checks to a minimum and also try to minimize
%D the amount of tracing due to expansion.
-\mutable\let\currentotrbackground\empty
+\mutable\lettonothing\currentotrbackground
%D This is the only spot where we have a low level dependency on the way
%D parent chains are defined but we want the speed.
@@ -227,8 +229,8 @@
%D cached in dedicated boxes. The offsets and depth of the page are used for
%D alignment purposes.
-%newdimen\pageoffset % bleed
-%newdimen\pagedepth % built-in
+%newdimension\pageoffset % bleed
+%newdimension\pagedepth % built-in
%D We need a bit more clever mechanism in order to handle layers well. This means
%D that we cannot calculate both background at the same time since something may
@@ -289,11 +291,11 @@
\box#1}%
\fi}
-\newdimen\pagebackgroundhoffset % THESE WILL BECOME OBSOLETE
-\newdimen\pagebackgroundvoffset
-\newdimen\pagebackgroundoffset % used elsewhere
-\newdimen\pagebackgrounddepth
-\newdimen\pagebackgroundcompensation
+\newdimension\pagebackgroundhoffset % THESE WILL BECOME OBSOLETE
+\newdimension\pagebackgroundvoffset
+\newdimension\pagebackgroundoffset % used elsewhere
+\newdimension\pagebackgrounddepth
+\newdimension\pagebackgroundcompensation
\def\page_backgrounds_set_offsets % used in menus (we can use ifcsname's here)
{\ifconditional\c_page_backgrounds_some \ifconditional\c_page_backgrounds_new
@@ -352,7 +354,7 @@
\def\page_backgrounds_set_box#1% #2%
{\global\setbox#1\vpack
{\dontcomplain
- \page_layouts_swap_margins
+ \page_layouts_swap_margins\v!background
\ifconditional\swapbackgroundmargins
\doifelsemarginswap \donothing
{\enforced\swapcsvalues\v!rightmargin\v!leftmargin
@@ -360,9 +362,6 @@
\fi
\calculatereducedvsizes
\offinterlineskip
- % \ifconditional#2\relax
- % \page_layouts_swap_margins_indeed % hm, this one gets nilled in \page_layouts_swap_margin anyway
- % \fi
\ifdim\topheight>\zeropoint
\kern\dimexpr-\topheight-\topdistance\relax
\page_backgrounds_set_box_row\v!top\topheight
@@ -486,8 +485,8 @@
\expandafter\page_backgrounds_setup_double
\fi[#1][#2][#3]}
-\newdimen\d_page_backgrounds_offset
-\newdimen\d_page_backgrounds_depth
+\newdimension\d_page_backgrounds_offset
+\newdimension\d_page_backgrounds_depth
\appendtoks
\edef\p_page_backgrounds_offset{\namedframedparameter{\??layoutbackgrounds\v!page}\c!offset}%
@@ -664,6 +663,8 @@
\permanent\let\popbackground\relax
+\stopcontextdefinitioncode
+
\protect \endinput
% %D The next series is used in local (for instance floating) backgrounds.
@@ -692,7 +693,7 @@
%
% \def\page_backgrounds_add_local_to_box_indeed#1%
% {\setbox#1\hbox{\localbackgroundframed{\??layoutbackgrounds\v!local}\v!local#1}%
-% \global\advance\localpositionnumber\plusone} % afterwards !
+% \global\advanceby\localpositionnumber\plusone} % afterwards !
%
% \let\page_backgrounds_add_local_to_box\gobbleoneargument
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-blk.lmt b/Master/texmf-dist/tex/context/base/mkxl/page-blk.lmt
new file mode 100644
index 00000000000..4a4441fd10c
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-blk.lmt
@@ -0,0 +1,100 @@
+if not modules then modules = { } end modules ['page-blk'] = {
+ version = 1.001,
+ comment = "companion to page-blk.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local context = context
+local implement = interfaces.implement
+local texgetcount = tex.getcount
+
+local c_realpageno = tex.iscount("realpageno")
+
+local blocks = { }
+local block = false
+
+implement {
+ name = "startpageblock",
+ arguments = "string",
+ actions = function(s)
+ local p = texgetcount(c_realpageno)
+ block = { p, p }
+ blocks[s] = block
+ end,
+}
+
+implement {
+ name = "stoppageblock",
+ actions = function()
+ local p = texgetcount(c_realpageno) - 1
+ block[2] = p
+ end,
+}
+
+implement {
+ name = "pageblockrealpage",
+ arguments = "string",
+ actions = function(name)
+ local b = blocks[name]
+ context(b and b[1] or 0)
+ end,
+}
+
+implement {
+ name = "flushpageblocks",
+ arguments = "string",
+ actions = function(list)
+ local count = 0
+ local order = utilities.parsers.settings_to_array(list)
+ local pages = { }
+ for i=1,#order do
+ local name = order[i]
+ local block = blocks[name]
+ if block then
+ for i=block[1],block[2] do
+ count = count + 1
+ pages[count] = i
+ end
+ end
+ end
+ -- if count ~= nofpages then
+ -- end
+ -- inspect(blocks)
+ -- inspect(pages)
+ if lpdf.setpageorder then
+ lpdf.setpageorder(pages) -- ,count)
+ end
+ end
+}
+
+-- maybe intercept nesting with error
+
+local currentpreroll = false
+local prerolled = { }
+
+implement {
+ name = "startprerollpageblock",
+ arguments = "string",
+ actions = function(name)
+ currentrealpage = texgetcount(c_realpageno)
+ currentpreroll = name
+ end
+}
+
+implement {
+ name = "stopprerollpageblock",
+ actions = function()
+ prerolled[currentpreroll] = texgetcount(c_realpageno) - currentrealpage
+ currentpreroll = false
+ end
+}
+
+implement {
+ name = "prerolledpages",
+ arguments = "string",
+ actions = function(name)
+ context(prerolled[name] or 0)
+ end
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-blk.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-blk.mkxl
new file mode 100644
index 00000000000..9553ea643b6
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-blk.mkxl
@@ -0,0 +1,192 @@
+%D \module
+%D [ file=page-blk,
+%D version=2022.06.04,
+%D title=\CONTEXT\ Page Macros,
+%D subtitle=Shuffling Pages,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%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 / Shuffling pages}
+
+%D This is a somewhat tricky module and although we have a somewhat abstract
+%D interface we are pretty much bound to \PDF\ output here. When large amounts of
+%D documents are to be generated and|/|or when saving a run makes sense the table
+%D of contents can be typeset at the end and moved to the beginning. However, it
+%D assumes a rather stable and predictable rendering. Don't use this without
+%D checking it really works out well.
+%D
+%D The low level backend code has been around for quite a while but we never had
+%D a real (need and therefore) interface for it. There actually is not that much
+%D code involved anyway. There is no need to backport it to \MKIV.
+
+\registerctxluafile{page-blk}{autosuffix}
+
+% Musical timestamp: end May 2022 xpropaganda (in loop mode to keep the pace).
+
+% pitfalls: we need to keep the toc in order (or generate it 'manually' based on
+% deltas but even then we get the numbers wrong)
+
+\unprotect
+
+\newinteger\c_pages_prerolled
+
+\permanent\protected\def\startpageblock[#1]%
+ {\page
+ \clf_startpageblock{#1}}
+
+\permanent\protected\def\stoppageblock
+ {\page
+ \clf_stoppageblock}
+
+\permanent\protected\def\flushpageblocks[#1]%
+ {\page
+ \clf_flushpageblocks{#1}}
+
+\permanent\def\pageblockrealpage#1%
+ {\clf_pageblockrealpage{#1}}
+
+\tolerant\permanent\protected\def\startprerollpageblock[#1]%
+ {\page
+ \clf_startprerollpageblock{#1}%
+ \global\c_pages_prerolled\realpageno % hack
+ \setuppaper[\c!method=\v!none]}
+
+\permanent\protected\def\stopprerollpageblock
+ {\page
+ \clf_stopprerollpageblock
+ \setcounter[realpage][\c_pages_prerolled]% hack
+ \setuppaper[\c!method=\v!normal]}
+
+\permanent\def\prerolledpages#1%
+ {\clf_prerolledpages{#1}}
+
+\protect \endinput
+
+\usemodule[article-basic]
+
+\setupinteraction[state=start]
+
+% \enabletrackers[*reference*]
+% \enabletrackers[*destination*]
+
+\useMPlibrary[dum]
+
+\starttext
+
+\def\AlphaOffset{0}
+\def\BetaOffset {0}
+
+% the flexible ones (can come from files)
+
+\startbuffer[alpha]
+ \startchapter[title=Alpha]
+ \dorecurse{20}{\samplefile{tufte}\par}
+ \stopchapter
+\stopbuffer
+
+\startbuffer[beta]
+ \startchapter[title=Beta]
+ \dorecurse{6}{\samplefile{tufte}\par}
+ \stopchapter
+\stopbuffer
+
+% the fixed ones
+
+\startbuffer[gamma]
+ \startchapter[title=Gamma]
+ \externalfigure[whatever-dummy-3][width=\textwidth]
+ \stopchapter
+\stopbuffer
+
+\startbuffer[rest]
+ \startchapter[title=Rest A]
+ \samplefile{tufte}
+ \stopchapter
+ \startchapter[title=Rest B]
+ \samplefile{tufte}
+ \blank
+ Alpha : \goto{page \AlphaPages}[realpage(\AlphaPages)]\par
+ Beta : \goto{page \BetaPages }[realpage(\BetaPages )]
+ \stopchapter
+\stopbuffer
+
+\startbuffer[contents]
+ \starttitle[title=Contents]
+ \placelist[chapter][criterium=text]
+ \stoptitle
+\stopbuffer
+
+% Preroll.
+
+\startprerollpageblock[alpha]
+ \start
+ \setuphead[chapter][incrementnumber=no]
+ \getbuffer[alpha]
+ \stop
+\stopprerollpageblock
+
+% \writestatus{!!!!!}{nofalphapages: \prerolledpages{alpha}}
+
+\startprerollpageblock[beta]
+ \start
+ \setuphead[chapter][incrementnumber=no]
+ \getbuffer[beta]
+ \stop
+\stopprerollpageblock
+
+% \writestatus{!!!!!}{nofbetapages: \prerolledpages{beta}}
+
+% Some titling.
+
+\startpageblock[titlepage]
+ \startstandardmakeup
+ \externalfigure[whatever-dummy-1][height=\textheight,width=\textwidth]
+ \stopstandardmakeup
+\stoppageblock
+
+\startpageblock[boguspage]
+ \startstandardmakeup
+ \externalfigure[whatever-dummy-2][height=\textheight,width=\textwidth]
+ \stopstandardmakeup
+\stoppageblock
+
+% The contents will end up here.
+
+% page 1
+
+% The main document.
+
+\setuppagenumber[number=2]
+
+\startpageblock[chapters]
+ % we have a predictable rest:
+
+ \edef\AlphaPages{\the\numexpr 4 \relax}
+ \edef\BetaPages {\the\numexpr 4 + \prerolledpages{alpha} \relax}
+
+ \getbuffer[rest]
+ \getbuffer[alpha]
+ \getbuffer[beta]
+ \getbuffer[gamma]
+\stoppageblock
+
+% This one will move:
+
+\setuppagenumber[number=1]
+
+\startpageblock[contents]
+ \getbuffer[contents]
+\stoppageblock
+
+\flushpageblocks
+ [titlepage,
+ boguspage,
+ contents,
+ chapters]
+
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-box.mklx b/Master/texmf-dist/tex/context/base/mkxl/page-box.mklx
index c8ceeb8282e..3d78e73d80f 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-box.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-box.mklx
@@ -59,15 +59,6 @@
\v_page_target_bottom_fill
\v_page_target_bottom}}
-\def\page_boxes_apply_offset % #box
- {\unless\ifzeropt\topoffset
- \expandafter\page_boxes_apply_offset_indeed
- \orelse\ifzeropt\backoffset
- \expandafter\gobbleoneargument
- \else
- \expandafter\page_boxes_apply_offset_indeed
- \fi}
-
\def\page_boxes_apply_offset_indeed#box%
{\scratchwidth \wd#box%
\scratchheight\ht#box%
@@ -75,12 +66,37 @@
\setbox#box\vpack
{\offinterlineskip
\vskip\topoffset
- \hskip\doifbothsides\backoffset\backoffset{-\backoffset}%
+ %\hskip\doifbothsides\backoffset\backoffset{-\backoffset}%
+ \hskip\doifbothsides++-\backoffset
\box#box}%
\wd#box\scratchwidth
\ht#box\scratchheight
\dp#box\scratchdepth}
+% a variant (no gain so we stay mkiv compatible):
+%
+% \def\page_boxes_apply_offset_indeed#box% this needs testing in real situations
+% {\boxxoffset#box\dimexpr\boxxoffset#box\doifbothsides++-\backoffset\relax
+% \boxyoffset#box\dimexpr\boxyoffset#box-\topoffset\relax}
+
+% \def\page_boxes_apply_offset % #box
+% {\unless\ifdim\topoffset=\zeropoint
+% \expandafter\page_boxes_apply_offset_indeed
+% \orunless\ifdim\backoffset=\zeropoint
+% \expandafter\page_boxes_apply_offset_indeed
+% \else
+% \expandafter\gobbleoneargument
+% \fi}
+
+\def\page_boxes_apply_offset % #box
+ {\unless\ifzeropt\topoffset
+ \expandafter\page_boxes_apply_offset_indeed
+ \orunless\ifzeropt\backoffset
+ \expandafter\page_boxes_apply_offset_indeed
+ \else
+ \expandafter\gobbleoneargument
+ \fi}
+
\def\page_boxes_apply_replicate
{\ifnum\layoutparameter\c!nx>\plusone
\expandafter\page_boxes_apply_replicate_indeed
@@ -93,9 +109,9 @@
\def\page_boxes_apply_replicate_indeed#box%
{\setbox#box\vpack
{\offinterlineskip
- \dorecurse{\layoutparameter\c!ny}
+ \dorecurse{\layoutparameter\c!ny}%
{\hpack{\dorecurse{\layoutparameter\c!nx}{\copy#box\kern\layoutparameter\c!dx}\unskip}%
- \vskip\layoutparameter\c!dy}
+ \vskip\layoutparameter\c!dy}%
\unskip}}
\def\page_boxes_apply_orientate_paper#box%
@@ -189,8 +205,8 @@
\scratchheight\ht#box%
\scratchdepth \dp#box%
\setbox#box\hpack
- {\advance\scratchheight\dimexpr\scratchdepth+2\scratchoffset\relax
- \advance\scratchwidth \scratchoffset
+ {\advanceby\scratchheight\dimexpr\scratchdepth+2\scratchoffset\relax
+ \advanceby\scratchwidth \scratchoffset
\ifconditional#right\relax
\scratchdimen-\scratchoffset
\kern\scratchdimen
@@ -221,10 +237,10 @@
\scratchheight\ht#box%
\scratchdepth \dp#box%
\setbox#box\hpack
- {\advance\scratchheight\dimexpr\scratchdepth+2\scratchoffset\relax
- \advance\scratchwidth \scratchoffset
+ {\advanceby\scratchheight\dimexpr\scratchdepth+2\scratchoffset\relax
+ \advanceby\scratchwidth \scratchoffset
\doifbothsides
- {\advance\scratchwidth\scratchoffset
+ {\advanceby\scratchwidth\scratchoffset
\scratchdimen-\scratchoffset
\kern\scratchdimen}%
{\scratchdimen\zeropoint}
@@ -243,14 +259,34 @@
% nearly always some displacement so no speedup test needed
+% \def\page_boxes_apply_offsets#1%
+% {\setbox#1\vpack to \paperheight
+% {\hsize\paperwidth
+% \vkern\topspace
+% \hkern\doifbothsides\backspace\backspace{\dimexpr\paperwidth-\backspace-\makeupwidth\relax}%
+% \box#1}%
+% \dp#1\zeropoint}
+
\def\page_boxes_apply_offsets#1%
{\setbox#1\vpack to \paperheight
{\hsize\paperwidth
\vkern\topspace
\hkern\doifbothsides\backspace\backspace{\dimexpr\paperwidth-\backspace-\makeupwidth\relax}%
+% \hkern\doifbothsides\backspace\backspace\cutspace
+% \page_layouts_swap_margins\v!page
+% \hkern\backspace
\box#1}%
\dp#1\zeropoint}
+% a variant (no gain so we stay mkiv compatible):
+%
+% \def\page_boxes_apply_offsets#1%
+% {\scratchhoffset\doifbothsides\backspace\backspace{\dimexpr\paperwidth-\backspace-\makeupwidth\relax}%
+% \boxxoffset#1\dimexpr\boxxoffset#1+\scratchhoffset\relax
+% \boxyoffset#1\dimexpr\boxyoffset#1-\topspace\relax
+% \wd#1\dimexpr\paperwidth+\scratchhoffset\relax
+% \ht#1\dimexpr\paperheight+\topspace\relax}
+
%D This is rather specialized:
\newconditional\c_page_areas_enabled
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-brk.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-brk.mkxl
index aca1d097d12..23ffc872d38 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-brk.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-brk.mkxl
@@ -40,13 +40,13 @@
% \definepagebreak[forsure][yes,+4]
\newconditional\c_page_breaks_enabled \settrue\c_page_breaks_enabled
-\newcount \c_page_breaks_prevpage
+\newinteger \c_page_breaks_prevpage
\newtoks\everybeforepagebreak
\newtoks\everyafterpagebreak
-\let\page_breaks_current_option \empty
-\let\page_breaks_current_options\empty
+\lettonothing\page_breaks_current_option
+\lettonothing\page_breaks_current_options
\installcorenamespace{pagebreakmethod}
\installcorenamespace{pagebreaks}
@@ -90,6 +90,7 @@
% disable reset after shipout
\global\pageornamentstate\plustwo
\fi
+ % maybe \ifcstok{#1}\emptytoks
\ifparameter#1\or
\page_breaks_handle{#1}%
\else % so, no pagebreak when \pagebreak[] ! ! !
@@ -287,8 +288,8 @@
\newtoks\everyaftercolumnbreak
\newtoks\everysynchronizecolumn
-\let\page_breaks_columns_current_option \empty
-\let\page_breaks_columns_current_options\empty
+\lettonothing\page_breaks_columns_current_option
+\lettonothing\page_breaks_columns_current_options
\def\page_breaks_columns_handle#1%
{\edef\page_breaks_columns_current_options{#1}%
@@ -341,8 +342,8 @@
%D Test page breaks.
-% \newdimen \d_page_tests_test
-% \newconstant\c_page_tests_mode
+% \newdimension\d_page_tests_test
+% \newconstant \c_page_tests_mode
\newconstant\testpagemethod % old
\newconstant\testpagetrigger % old
@@ -369,7 +370,7 @@
\relax}
\permanent\tolerant\protected\def\checkpage[#1]#*[#2]%
- {\relax % needed before \if
+ {\relax % look ahead prevention
\endgraf
\triggerpagebuilder
\relax
@@ -465,14 +466,17 @@
\definepagechecker[\s!unknown:2][\s!unknown:0][\c!method=2]
\definepagechecker[\s!unknown:3][\s!unknown:0][\c!method=3]
-\permanent\tolerant\protected\def\testpage [#1]#*[#2]{\normalexpanded{\checkpage[\s!unknown:1][\c!lines=#1,\c!offset=\ifparameter#2\or#2\else\zeropoint\fi]}} %
-\permanent\tolerant\protected\def\testpageonly[#1]#*[#2]{\normalexpanded{\checkpage[\s!unknown:2][\c!lines=#1,\c!offset=\ifparameter#2\or#2\else\zeropoint\fi]}} % no penalties added to the mvl
-\permanent\tolerant\protected\def\testpagesync[#1]#*[#2]{\normalexpanded{\checkpage[\s!unknown:3][\c!lines=#1,\c!offset=\ifparameter#2\or#2\else\zeropoint\fi]}} % force sync
+% the \relax prevents premature expansion in case of lookahead
+
+\permanent\tolerant\protected\def\testpage [#1]#*[#2]{\relax\normalexpanded{\checkpage[\s!unknown:1][\c!lines=#1,\c!offset=\ifparameter#2\or#2\else\zeropoint\fi]}} %
+\permanent\tolerant\protected\def\testpageonly[#1]#*[#2]{\relax\normalexpanded{\checkpage[\s!unknown:2][\c!lines=#1,\c!offset=\ifparameter#2\or#2\else\zeropoint\fi]}} % no penalties added to the mvl
+\permanent\tolerant\protected\def\testpagesync[#1]#*[#2]{\relax\normalexpanded{\checkpage[\s!unknown:3][\c!lines=#1,\c!offset=\ifparameter#2\or#2\else\zeropoint\fi]}} % force sync
%D Test column breaks.
\permanent\tolerant\protected\def\testcolumn[#1]#*[#2]%
- {\ifdefined\page_otr_command_test_column
+ {\relax % look ahead prevention
+ \ifdefined\page_otr_command_test_column
\ifparameter#2\or
\page_otr_command_test_column[#1][#2]%
\else
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-col.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-col.mkxl
index 43330c9a7c8..c2598afc172 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-col.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-col.mkxl
@@ -24,17 +24,15 @@
%D We reserve a counter for the number of columns as well as the current
%D column. Both are not to be changed by users!
-%newcount\nofcolumns \nofcolumns\plusone % already in core-ini.mkiv
-\newcount\mofcolumns \mofcolumns\plusone
-
-\newconstant\columndirection % 0:lr 1:rl
+%newinteger \nofcolumns \nofcolumns\plusone % already in core-ini.mkiv
+\newinteger \mofcolumns \mofcolumns\plusone
+\newdimension \columnwidth
+\newdimension \columndistance
+\newconstant \columndirection % 0:lr 1:rl
\setnewconstant\maxnofcolumns 50
\setnewconstant\allocatednofcolumns 0
-\newdimen\columnwidth
-\newdimen\columndistance
-
%D During initialization the temporary boxes are allocated. This enables us to
%D use as much columns as we want, without exhausting the pool of boxes too
%D fast. We could have packed them in one box, but we've got enough boxes.
@@ -125,7 +123,7 @@
\fi}
\protected\def\page_columns_all_next
- {\advance\mofcolumns\plusone
+ {\advanceby\mofcolumns\plusone
\edef\currentcolumn{\the\mofcolumns}%
\page_columns_action\relax
\ifnum\mofcolumns<\nofcolumns
@@ -141,7 +139,7 @@
\fi}
\protected\def\page_columns_rev_prev
- {\advance\mofcolumns\minusone
+ {\advanceby\mofcolumns\minusone
\edef\currentcolumn{\the\mofcolumns}%
\page_columns_action\relax
\ifnum\mofcolumns>\plusone
@@ -157,7 +155,7 @@
\protected\def\page_columns_mid_next
{\edef\currentcolumn{\the\mofcolumns}%
\page_columns_action\relax
- \advance\mofcolumns\plusone
+ \advanceby\mofcolumns\plusone
\ifnum\mofcolumns<\nofcolumns
\expandafter\page_columns_mid_next
\fi}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-com.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-com.mkxl
index a7d8aaba71a..ae408f384ad 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-com.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-com.mkxl
@@ -34,12 +34,12 @@
\installcorenamespace{pagecommentlocations}
\installcorenamespace{pagecommentstates}
-\newdimen\d_page_comments_offset
-\newdimen\d_page_comments_page_width
-\newdimen\d_page_comments_page_height
-\newdimen\d_page_comments_width
-\newdimen\d_page_comments_height
-\newdimen\d_page_comments_distance
+\newdimension\d_page_comments_offset
+\newdimension\d_page_comments_page_width
+\newdimension\d_page_comments_page_height
+\newdimension\d_page_comments_width
+\newdimension\d_page_comments_height
+\newdimension\d_page_comments_distance
\newconditional\c_page_comment_enabled
@@ -66,7 +66,7 @@
% \fi
-\setvalue{\??pagecommentstates\v!start}%
+\defcsname\??pagecommentstates\v!start\endcsname
{\d_page_comments_offset \directpagecommentparameter\c!offset \relax
\d_page_comments_distance\directpagecommentparameter\c!distance\relax
\d_page_comments_width \directpagecommentparameter\c!width \relax
@@ -76,41 +76,41 @@
\setuppapersize[\papersize][\v!pagecomment]%
\setupbackgrounds[\v!paper][\c!background=\v!pagecomment]} % maybe append if already set
-\setvalue{\??pagecommentstates\v!stop}%
+\defcsname\??pagecommentstates\v!stop\endcsname
{\setupbackgrounds[\v!paper][\c!background=]}
-\setvalue{\??pagecommentstates\v!none}%
+\defcsname\??pagecommentstates\v!none\endcsname
{}
-\setvalue{\??pagecommentlocations\v!bottom}%
+\defcsname\??pagecommentlocations\v!bottom\endcsname
{\setuplayout[\c!location=]%
\setuppapersize[\c!top=\vskip\d_page_comments_offset,\c!bottom=\vss,\c!left=\hskip\d_page_comments_offset,\c!right=]%
\d_page_comments_page_height\dimexpr\paperheight+2\d_page_comments_offset+\d_page_comments_distance+\d_page_comments_height\relax
\d_page_comments_page_width \dimexpr\paperwidth +2\d_page_comments_offset\relax
\defineoverlay[\v!pagecomment][\page_comments_top_bottom]}
-\setvalue{\??pagecommentlocations\v!top}%
+\defcsname\??pagecommentlocations\v!top\endcsname
{\setuplayout[\c!location=]%
\setuppapersize[\c!top=\vss,\c!bottom=\vskip\d_page_comments_offset,\c!left=\hskip\d_page_comments_offset,\c!right=]%
\d_page_comments_page_height\dimexpr\paperheight+2\d_page_comments_offset+\d_page_comments_distance+\d_page_comments_height\relax
\d_page_comments_page_width \dimexpr\paperwidth +2\d_page_comments_offset\relax
\defineoverlay[\v!pagecomment][\page_comments_top_bottom]}
-\setvalue{\??pagecommentlocations\v!left}%
+\defcsname\??pagecommentlocations\v!left\endcsname
{\setuplayout[\c!location=]%
\setuppapersize[\c!top=\vskip\d_page_comments_offset,\c!bottom=,\c!left=\hss,\c!right=\hskip\d_page_comments_offset]%
\d_page_comments_page_height\dimexpr\paperheight+2\d_page_comments_offset\relax
\d_page_comments_page_width \dimexpr\paperwidth +2\d_page_comments_offset+\d_page_comments_distance+\d_page_comments_width\relax
\defineoverlay[\v!pagecomment][\page_comments_left_right]}
-\setvalue{\??pagecommentlocations\v!right}%
+\defcsname\??pagecommentlocations\v!right\endcsname
{\setuplayout[\c!location=]%
\setuppapersize[\c!top=\vskip\d_page_comments_offset,\c!bottom=,\c!left=\hskip\d_page_comments_offset,\c!right =\hss]%
\d_page_comments_page_height\dimexpr\paperheight+2\d_page_comments_offset\relax
\d_page_comments_page_width \dimexpr\paperwidth +2\d_page_comments_offset+\d_page_comments_distance+\d_page_comments_width\relax
\defineoverlay[\v!pagecomment][\page_comments_left_right]}
-\setvalue{\??pagecommentlocations\v!none}%
+\defcsname\??pagecommentlocations\v!none\endcsname
{}% \setuppapersize[\c!bottom=,\c!top=,\c!left=,\c!right=]}
\protected\def\page_comments_top_bottom
@@ -163,7 +163,7 @@
\hskip\dimexpr\paperwidth+\d_page_comments_distance+\d_page_comments_offset\relax
\fi}}
-\permanent\protected\setvalue{\e!start\v!pagecomment}%
+\permanent\protected\defcsname\e!start\v!pagecomment\endcsname
{\global\settrue\c_page_comment_enabled
\grabbufferdatadirect\v!pagecomment{\e!start\v!pagecomment}{\e!stop\v!pagecomment}}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-cst.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-cst.mkxl
index a6f63a56219..6e5ed21686a 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-cst.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-cst.mkxl
@@ -64,33 +64,33 @@
\c!maxwidth=\makeupwidth]
\appendtoks % could become an option
- \frozen\instance\setuevalue{\e!start\currentpagegrid}{\startpagegrid[\currentpagegrid]}%
- \frozen\instance\setuevalue{\e!stop \currentpagegrid}{\stoppagegrid}%
+ \frozen\instance\protected\edefcsname\e!start\currentpagegrid\endcsname{\startpagegrid[\currentpagegrid]}%
+ \frozen\instance\protected\edefcsname\e!stop \currentpagegrid\endcsname{\stoppagegrid}%
\clf_definecolumnset {
name {\currentpagegrid}%
}%
\to \everydefinepagegrid
-\newdimen\d_page_grd_column_width
-\newdimen\d_page_grd_max_height
-\newdimen\d_page_grd_max_width
-\newdimen\d_page_grd_distance
+\newdimension\d_page_grd_column_width
+\newdimension\d_page_grd_max_height
+\newdimension\d_page_grd_max_width
+\newdimension\d_page_grd_distance
-\newdimen\d_page_grd_reserved_height
-\newdimen\d_page_grd_reserved_width
-\newcount\c_page_grd_reserved_state
+\newdimension\d_page_grd_reserved_height
+\newdimension\d_page_grd_reserved_width
+\newinteger \c_page_grd_reserved_state
-\newdimen\d_page_grd_gap_height
+\newdimension\d_page_grd_gap_height
-\newcount\c_page_grd_n_of_left
-\newcount\c_page_grd_n_of_right
-\newcount\c_page_grd_n_of_rows
-\newcount\c_page_grd_first_column
-\newcount\c_page_grd_last_column
+\newinteger \c_page_grd_n_of_left
+\newinteger \c_page_grd_n_of_right
+\newinteger \c_page_grd_n_of_rows
+\newinteger \c_page_grd_first_column
+\newinteger \c_page_grd_last_column
-\newbox \b_page_grd_collected
-\newbox \b_page_grd_column_rest
-\newbox \b_page_grd_column
+\newbox \b_page_grd_collected
+\newbox \b_page_grd_column_rest
+\newbox \b_page_grd_column
%D All the parameters are mandate!
@@ -128,10 +128,10 @@
{\bgroup
\enforced\let\startpagegrid\page_grd_start_dummy
\ifarguments
- \let\currentpagegrid\empty
+ \lettonothing\currentpagegrid
\or
\ifhastok={#1}%
- \let\currentpagegrid\empty
+ \lettonothing\currentpagegrid
\setupcurrentpagegrid[#1]%
\else
\def\currentpagegrid{#1}%
@@ -148,6 +148,8 @@
\d_page_grd_max_height\pagegridparameter\c!maxheight\relax
\d_page_grd_distance \pagegridparameter\c!distance\relax
%
+ \automigrationmode\zerocount % for now
+ %
\ifcase\c_page_grd_n_of_rows
\getrawnoflines{\dimexpr\d_page_grd_max_height-\strutheight+\topskip\relax}%
\c_page_grd_n_of_rows\noflines
@@ -253,7 +255,6 @@
\fi
\endgroup}
-
\protected\def\page_grd_command_set_vsize
{\clf_setvsizecolumnset{\currentpagegrid}%
\ifdim\d_page_grd_gap_height<\lineheight
@@ -302,7 +303,7 @@
\anch_mark_column_box\b_page_grd_column\privatescratchcounter
\page_marks_synchronize_column\c_page_grd_first_column\c_page_grd_last_column\privatescratchcounter\b_page_grd_column
\ifnum\privatescratchcounter>\c_page_grd_n_of_left
- \advance\privatescratchcounter-\c_page_grd_n_of_left
+ \advanceby\privatescratchcounter-\c_page_grd_n_of_left
\page_lines_add_numbers_to_box\b_page_grd_column\privatescratchcounter\c_page_grd_n_of_right\plustwo
\else
\page_lines_add_numbers_to_box\b_page_grd_column\privatescratchcounter\c_page_grd_n_of_left\plustwo
@@ -631,7 +632,7 @@
\c!default=\v!here,
\c!alternative=\v!a]
-\newdimen\d_page_grd_span_width
+\newdimension\d_page_grd_span_width
\let\page_grd_span_stop\relax
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-ffl.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-ffl.mkxl
index 350c4500073..02c56e2e9e5 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-ffl.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-ffl.mkxl
@@ -51,13 +51,93 @@
%D \startcontent \dorecurse{10}{\samplefile{ward} } \stopcontent
%D \stopfacingfloat
%D
+%D \flushfacingfloats[whatever]
+%D
%D \dorecurse{10}{\samplefile{sapolsky} }
+%D
+%D \flushpendingtopcontent
+%D
%D \stoptyping
%D
%D The idea is to flush related floats more or less in parallel.
\unprotect
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% \starttext
+%
+% \registertopcontent[3]\vbox{\framed[align=normal,width=\textwidth]{\samplefile{ward}}}
+% \registertopcontent[3]\vbox{\framed[align=normal,width=\textwidth]{\samplefile{davis}}}
+% \registertopcontent[5]\vbox{\framed[align=normal,width=\textwidth]{\samplefile{ward}}}
+%
+% \dorecurse{20}{\samplefile{tufte}\par}
+%
+% \stoptext
+
+\newdimension\d_page_adapts_preroll
+\newinteger \c_page_adapts_pushed
+
+% this assumes a constant textheight and no adaptations otherwise so we
+% should block these for already set pages in adaptheight .. or we can
+% make these independent (so not use adaptheight)
+
+\def\page_adapts_layout_preroll#1%
+ {\begingroup
+ \global\d_page_adapts_preroll\zeropoint
+ \def\page_adapts_layout_indeed##1%
+ {\setupcurrentadaptlayout[\c!top=\zeropoint,##1]%
+ \global\d_page_adapts_preroll\dimexpr\adaptlayoutparameter\c!top\relax}
+ \begincsname\??pageadaptations\number#1\endcsname
+ \endgroup}
+
+\permanent\protected\def\registertopcontent[#1]%
+ {\begingroup
+ \dowithnextbox
+ {\page_adapts_layout_preroll{#1}%
+ \scratchdimen\dimexpr
+ \htdp\nextbox+\d_page_adapts_preroll
+ \ifzeropt\d_page_adapts_preroll
+ +\lineheight
+ \fi
+ \relax
+ \putboxincache{\v!page:\number#1}{+}\nextbox
+ \normalexpanded{\adaptlayout[\number#1][\c!top=\the\scratchdimen]}%
+ \global\advanceby\c_page_adapts_pushed\plusone
+ \endgroup}}
+
+\def\page_otr_flush_top_content
+ {\scratchcounter\getboxcountfromcache{\v!page:\number\realpageno}\relax
+ \ifcase\scratchcounter\else
+ \dorecurse\scratchcounter
+ {\directboxfromcache{\v!page:\number\realpageno}\recurselevel
+ \nointerlineskip
+ \par}%
+ \disposeboxesincache{\v!page:\number\realpageno}%
+ \global\advanceby\c_page_adapts_pushed\minusone
+ \nointerlineskip
+ \fi}
+
+\permanent\protected\def\flushpendingtopcontent
+ {\ifcase\c_page_adapts_pushed\else
+ \null
+ \page
+ \expandafter\flushpendingtopcontent
+ \fi}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% \let\page_check_weird_page\relax
+
+\def\page_check_weird_page_indeed % for now only when facing floats
+ {\ifdim\vsize>\zeropoint\else
+ %\showmessage\m!layouts9{}%
+ \writestatus\m!layouts{forcing zero height page}%
+ \emptyhbox\page
+ \fi}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
% width:
%
% -- fit : do nothing
@@ -71,64 +151,104 @@
\setupfacingfloat
[\c!spaceinbetween=\v!big,
\c!inbetween={\blank[\v!big]},
- \c!width=\v!fit,
+ %\c!page=\v!left, % not used
%\c!style,
%\c!color,
- \c!page=\v!left]
+ \c!width=\v!fit]
+
+\newinteger\c_defining_facing_float
\appendtoks
- \ifempty\currentfacingfloatparent
- \normalexpanded{\definefacingfloat[\currentfacingfloat:\v!left ][\currentfacingfloat]}%
- \normalexpanded{\definefacingfloat[\currentfacingfloat:\v!right][\currentfacingfloat]}%
+ \advanceby\c_defining_facing_float\plusone
+ \ifcase\c_defining_facing_float\or
+ \expanded{
+ \definefacingfloat[\currentfacingfloat:\v!left ][\currentfacingfloat]%
+ \definefacingfloat[\currentfacingfloat:\v!right][\currentfacingfloat]%
+ }%
\fi
+ \advanceby\c_defining_facing_float\minusone
\to \everydefinefacingfloat
-\newcount\c_strc_floats_facing_saved
-\newcount\c_strc_floats_facing_flushed
-
-\newbox\b_strc_floats_facing_l
-\newbox\b_strc_floats_facing_r
+\newinteger\c_strc_floats_facing_saved
+\newinteger\c_strc_floats_facing_flushed
+\newbox \b_strc_floats_facing_l
+\newbox \b_strc_floats_facing_r
\let\m_strc_floats_state\relax
-\permanent\protected\def\strc_floats_facing_flush
- {\ifnum\c_strc_floats_facing_flushed<\c_strc_floats_facing_saved
- \ifodd\c_strc_floats_facing_flushed
- \ifodd\realpageno
- \strc_floats_facing_flush_indeed
- \doifelsependingpagecontent\relax{\null\page}%
- \fi
- \else
- \ifodd\realpageno\else
- \strc_floats_facing_flush_indeed
- \doifelsependingpagecontent\relax{\null\page}%
- \fi
- \fi
+\installcorenamespace {facingfloatflusher}
+
+\def\strc_floats_facing_flush_indeed_step#1#2#3%
+ {\ifnum#2<#3\relax
+ \advanceby#2\plusone
+ \donetrue
+ \writestatus
+ {facing}
+ {page: \the\scratchcounterone, location: #1, blob: \the#2, max: \the#3}%
+ \registertopcontent
+ [\scratchcounterone]
+ \hbox{\directboxfromcache{\currentfacingfloat:#1}{\the#2}}%
\fi}
-\permanent\protected\def\strc_floats_facing_flush_indeed
- {\global\advance\c_strc_floats_facing_flushed\plusone
- \floatingpenalty\zerocount
- \insert\namedinsertionnumber\s!topfloat\bgroup
- \forgetall
- \ifconditional\c_page_one_top_of_insert
- \ifconditional\c_page_one_correct_top_insert
- \topskipcorrection % [xx] new: see icare topbleed
- \kern-\lineskip
- \par
- \prevdepth\maxdimen
+\def\strc_floats_facing_flush_indeed#1%
+ {\begingroup
+ \edef\currentfacingfloat{#1}%
+ \glet\page_check_weird_page\page_check_weird_page_indeed % for now only when facing floats
+ \scratchcounterone \realpageno
+ \scratchcounterthree\getboxcountfromcache{\currentfacingfloat:\v!left }\relax
+ \scratchcounterfour \getboxcountfromcache{\currentfacingfloat:\v!right}\relax
+ \scratchcounterfive \zerocount
+ \scratchcountersix \zerocount
+ % find first empty spread i.e. odd (left) and even (right) empty
+ \ifdim\pagetotal>\zeropoint
+ \advanceby\scratchcounterone\plusone
+ \fi
+ \ifodd\scratchcounterone
+ \advanceby\scratchcounterone\plusone
+ \fi
+ \writestatus
+ {facing}
+ {page: \the\scratchcounterone, start checking}%
+ \doloop{%
+ \page_adapts_layout_preroll\scratchcounterone
+ \ifzeropt\d_page_adapts_preroll
+ % left empty
+ \advanceby\scratchcounterone\plusone
+ \page_adapts_layout_preroll\scratchcounterone
+ \ifzeropt\d_page_adapts_preroll
+ % right empty
+ \advanceby\scratchcounterone\minusone
+ \exitloop
+ \fi
+ \else
+ \advanceby\scratchcounterone\plustwo
\fi
+ }
+ \writestatus
+ {facing}
+ {page: \the\scratchcounterone, start flushing}%
+ \doloop{%
+ \ifodd\scratchcounterone
+ \strc_floats_facing_flush_indeed_step\v!right\scratchcountersix \scratchcounterfour
+ \else
+ \strc_floats_facing_flush_indeed_step\v!left \scratchcounterfive\scratchcounterthree
\fi
- \directboxfromcache{\currentfacingfloat}{\number\c_strc_floats_facing_flushed}%
- \vkern\s_page_one_between_top_insert
- \egroup
- \ifnum\c_strc_floats_facing_saved=\c_strc_floats_facing_flushed
- \global\c_strc_floats_facing_saved \zerocount
- \global\c_strc_floats_facing_flushed\zerocount
- \resetboxesincache{\currentfacingfloat}%
- \fi}
+ \ifnum\scratchcountersix<\scratchcounterfour
+ % more
+ \orelse\ifnum\scratchcounterfive<\scratchcounterthree
+ % more
+ \else
+ \exitloop
+ \fi
+ \advanceby\scratchcounterone\plusone
+ }
+ \disposeboxesincache{\currentfacingfloat:\v!right}%
+ \disposeboxesincache{\currentfacingfloat:\v!left}%
+ \page_check_weird_page_indeed
+ \endgroup}
-\aliased\let\flushfacingfloats\strc_floats_facing_flush
+\permanent\protected\tolerant\def\flushfacingfloats[#1]%
+ {\processcommalist[#1]\strc_floats_facing_flush_indeed}
\protected\def\strc_floats_facing_setup
{\edef\currentfacingfloat{\currentfacingfloat:\m_strc_floats_state}%
@@ -178,18 +298,12 @@
\permanent\protected\def\startfacingfloat[#1]%
{\begingroup
- % todo: \usepageparameter
-% \edef\p_page{\facingfloatparameter\c!page}%
-% \ifempty\p_page\else
-% \page[\p_page]%
-% \fi
- %
\edef\currentfacingfloat{#1}%
\edef\p_width{\facingfloatparameter\c!width}%
\letfacingfloatparameter\c!width\v!fit
\ifx\p_width\v!frame
\setbox\scratchbox\hpack{\inheritedfacingfloatframed{}}%
- \advance\hsize-\wd\scratchbox
+ \advanceby\hsize-\wd\scratchbox
\orelse\ifx\p_width\v!fit
% whatever
\else
@@ -220,6 +334,7 @@
\doloop{%
\strc_floats_facing_flush_wrap\b_strc_floats_facing_l\v!left
\strc_floats_facing_flush_wrap\b_strc_floats_facing_r\v!right
+ \global\advanceby\c_strc_floats_facing_saved\plusone
\ifvoid\b_strc_floats_facing_l\relax\ifvoid\b_strc_floats_facing_r\relax
\exitloop
\fi\fi}}
@@ -229,18 +344,26 @@
% todo
\else
\begingroup
- \setbox\scratchbox\vsplit#1 upto \textheight
+ \setbox\scratchboxone\hpack\bgroup
+ \edef\currentfacingfloat{\currentfacingfloat:#2}%
+ \inheritedfacingfloatframed{\strut}%
+ \egroup
+ \scratchdimenone\dimexpr\textheight-\htdp\scratchboxone+\lineheight\relax
+ \dontcomplain
+ \splittopskip\zeropoint
+ \setbox\scratchbox\vsplit#1 upto \scratchdimenone
+ \setsplitlisthtdp\scratchbox\strutht\strutdp
\setbox\scratchbox\hpack\bgroup
\edef\currentfacingfloat{\currentfacingfloat:#2}%
\inheritedfacingfloatframed{\box\scratchbox}%
\egroup
- \ifdim\ht\scratchbox<\dimexpr\textheight-\scratchdimen\relax
- \setbox\scratchbox\vbox{\box\scratchbox\directvspacing\p_spaceinbetween}%
- \else
- \setbox\scratchbox\vbox to \textheight{\box\scratchbox\vss}%
- \fi
- \global\advance\c_strc_floats_facing_saved\plusone
- \putboxincache{\currentfacingfloat}{\number\c_strc_floats_facing_saved}\scratchbox
+ \setbox\scratchbox\vbox
+ \ifdim\ht\scratchbox<\dimexpr\textheight-\scratchdimen\relax
+ {\box\scratchbox\directvspacing\p_spaceinbetween}%
+ \else
+ to \textheight{\box\scratchbox\vss}%
+ \fi
+ \putboxincache{\currentfacingfloat:#2}{+}\scratchbox
\endgroup
\fi}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-flt.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-flt.mkxl
index a97cc7f0d2e..8808ef00b6c 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-flt.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-flt.mkxl
@@ -24,12 +24,12 @@
\defineinsertion[\s!bottomfloat]
\defineinsertion[\s!pagefloat]
-\newdimen \d_page_floats_inserted_bottom
-\newdimen \d_page_floats_inserted_top
-\newdimen \d_page_floats_inserted_page
-\newcount \c_page_floats_n_of_top \c_page_floats_n_of_top \plustwo
-\newcount \c_page_floats_n_of_bottom \c_page_floats_n_of_bottom\zerocount
-\newcount \c_page_floats_n_of_page \c_page_floats_n_of_page \plustwo
+\newdimension\d_page_floats_inserted_bottom
+\newdimension\d_page_floats_inserted_top
+\newdimension\d_page_floats_inserted_page
+\newinteger \c_page_floats_n_of_top \c_page_floats_n_of_top \plustwo
+\newinteger \c_page_floats_n_of_bottom \c_page_floats_n_of_bottom\zerocount
+\newinteger \c_page_floats_n_of_page \c_page_floats_n_of_page \plustwo
\newconstant\c_page_floats_insertions_topskip_mode % 1 = no topskip
@@ -55,26 +55,25 @@
\newconditional\c_page_floats_center_box \settrue\c_page_floats_center_box
\newconditional\c_page_floats_center_box_local
\newconditional\c_page_floats_center_box_global
-\newconditional\c_page_floats_compress_flushed \settrue\c_page_floats_compress_flushed
+\newconditional\c_page_floats_compress_flushed \settrue\c_page_floats_compress_flushed
-\newdimen \d_page_floats_compress_distance
+\newdimension \d_page_floats_compress_distance
%D For the moment we keep this but they will become private too.
-\newcount\totalnoffloats % these will be redone ... handled at the lua end anyway
-\newcount\savednoffloats % these will be redone ... handled at the lua end anyway
-\newcount\nofcollectedfloats % communication channel
-\newdimen\maxcollectedfloatstotal % communication channel
+\newinteger \totalnoffloats % these will be redone ... handled at the lua end anyway
+\newinteger \savednoffloats % these will be redone ... handled at the lua end anyway
+\newinteger \nofcollectedfloats % communication channel
+\newdimension\maxcollectedfloatstotal % communication channel
+\newinteger \noffloatinserts % these will be redone ... handled at the lua end anyway
-\newcount\noffloatinserts % these will be redone ... handled at the lua end anyway
+\newbox \floattext
-\newbox \floattext
-
-\newdimen\floatwidth
-\newdimen\floatheight
-\newdimen\floatdepth
-\newdimen\floattextwidth
-\newdimen\floattextheight
+\newdimension\floatwidth
+\newdimension\floatheight
+\newdimension\floatdepth
+\newdimension\floattextwidth
+\newdimension\floattextheight
\newbox \floatbox
\newbox \savedfloatbox
@@ -182,10 +181,10 @@
%
% \placefloatwithsetups[somefigure]{}{\externalfigure[dummy][width=5cm,height=2cm]}
-\mutable\let\floatsetupcaption\empty
-\mutable\let\floatsetupcontent\empty
-\mutable\let\floatsetupwidth \empty
-\mutable\let\floatsetupheight \empty
+\mutable\lettonothing\floatsetupcaption
+\mutable\lettonothing\floatsetupcontent
+\mutable\lettonothing\floatsetupwidth
+\mutable\lettonothing\floatsetupheight
\aliased\let\placesetupfloat\gobbleoneoptional
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-flw.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-flw.mkxl
index ef92b9b52f9..c1d480e9856 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-flw.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-flw.mkxl
@@ -74,7 +74,7 @@
\fi
\to \everydefinetextflow
-\newcount\b_page_textflow_box
+\newinteger\b_page_textflow_box
\permanent\def\textflowcollector#1%
{\begincsname\??textflowbox#1\endcsname}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-imp.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-imp.mkxl
index 4ee7c159be3..00a0430e6e3 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-imp.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-imp.mkxl
@@ -55,13 +55,13 @@
\installcorenamespace{layoutarranger}
\installcorenamespace{layoutarrangeoption}
-\newcount \shippedoutpages
-\newcount \combinedpagescounter
+\newinteger \shippedoutpages
+\newinteger \combinedpagescounter
\newconstant \whichpagetoshipout % 0=all 1=odd 2=even
\newbox \shipoutscratchbox
\setnewconstant\shipoutfinalizemethod\plusone
-\mutable\let\pagestoshipout\empty % {1,3,6}
+\mutable\lettonothing\pagestoshipout % {1,3,6}
\permanent\protected\def\shipoutrange#1#2%
{\begingroup
@@ -100,9 +100,31 @@
\installshipoutmethod \v!none
{\page_shipouts_ignore}
+% \setuppaper[method=rotate,rotation=15] \showframe
+% \starttext \dorecurse{10}{\input knuth\endgraf} \stoptext
+
+\installshipoutmethod\v!rotate
+ {\page_shipouts_rotate}
+
+\protected\def\page_shipouts_rotate#1%
+ {\invokepagehandler\v!normal{\rotate[\c!rotation=\rootlayouttargetparameter\c!rotation]{#1}}}
+
+% inject an empty page after each page
+
+\def\page_shipouts_double#1%
+ {\page_shipouts_normal{#1}%
+ \page_shipouts_normal{\null}}
+
+\installshipoutmethod \v!doublesided
+ {\ifarrangingpages
+ \expandafter\page_shipouts_arrange
+ \else
+ \expandafter\page_shipouts_double
+ \fi}
+
% extension mechanism
-\newcount\c_page_boxes_flush_n % set at the lua end
+\newinteger\c_page_boxes_flush_n % set at the lua end
\let\page_boxes_flush_before\relax
\let\page_boxes_flush_after \relax
@@ -133,9 +155,9 @@
\def\page_shipouts_ignore#1%
{\begingroup
\writestatus\m!system
- {\ifarrangingpages arranged \fi page
+ {\ifarrangingpages arranged\normalspace\fi page\normalspace
\ifarrangingpages\the\arrangeno\else\the\realpageno\fi\normalspace
- not flushed}%
+ not\normalspace flushed}%
% \setbox\scratchbox\hpack
% {#1}% no finalize
\deadcycles\zerocount
@@ -160,6 +182,15 @@
\box\scratchbox
\endgroup}
+%D We just ignore \type {\shipout}.
+
+\pushoverloadmode
+
+\permanent\protected\def\shipout
+ {\begingroup\dowithnextboxcs\endgroup}
+
+\popoverloadmode
+
%D Also in normal \MKIV\ we nos use the indirect way so that we benefit from timing
%D and tracing.
@@ -171,10 +202,11 @@
\fi
\clf_shipoutpage#1\relax
\global\setbox#1\emptybox
- \global\deadcycles\zerocount}
+ \global\deadcycles\zerocount
+ \clf_cleanupattributes}
\def\page_shipouts_normal#1%
- {\global\advance\shippedoutpages\plusone
+ {\global\advanceby\shippedoutpages\plusone
% this is not resource safe!
\ifempty\pagestoshipout
\ifcase\whichpagetoshipout\relax
@@ -244,17 +276,17 @@
\mutable\def\arrangedrotationO{0}
\mutable\def\arrangedrotationE{0}
-\newcount\arrangedpageN
-\newcount\arrangedpageM
+\newinteger\arrangedpageN
+\newinteger\arrangedpageM
-\newcount\arrangedpageT \arrangedpageT\plusone
-\newcount\arrangedpageX \arrangedpageX\plusone
-\newcount\arrangedpageY \arrangedpageY\plusone
+\newinteger\arrangedpageT \arrangedpageT\plusone
+\newinteger\arrangedpageX \arrangedpageX\plusone
+\newinteger\arrangedpageY \arrangedpageY\plusone
\def\page_paper_set_offsets
{\global\paperoffset\v_page_target_offset
- \global\advance\paperwidth -2\dimexpr\paperoffset/\arrangedpageX\relax
- \global\advance\paperheight-2\dimexpr\paperoffset/\arrangedpageY\relax}
+ \global\advanceby\paperwidth -2\dimexpr\paperoffset/\arrangedpageX\relax
+ \global\advanceby\paperheight-2\dimexpr\paperoffset/\arrangedpageY\relax}
\permanent\protected\def\doinstallarrangedoption#1#2%
{\gdefcsname\??layoutarrangeoption#1\endcsname{#2}}
@@ -416,7 +448,7 @@
\scratchcounter\numexpr\realpageno-\plusone\relax
\dosetmodulo\scratchcounter\arrangedpageT\scratchcounter
\ifcase\scratchcounter\else
- \advance\scratchcounter \plusone
+ \advanceby\scratchcounter \plusone
\dostepwiserecurse\scratchcounter\arrangedpageT\plusone
{\noheaderandfooterlines\page_otr_insert_dummy_page}%
\fi
@@ -434,7 +466,7 @@
\box\scratchbox\box#5\hss}}
\permanent\protected\def\gotonextarrangepage
- {\global\advance\arrangeno\plusone}
+ {\global\advanceby\arrangeno\plusone}
\permanent\protected\def\outputarrangedbox#1%
{\begingroup
@@ -480,7 +512,7 @@
{\showmessage\m!system{23}{\the\realpageno.\the\pageno\ifnum\subpageno>0 .\the\subpageno\fi,\number#1}}
\permanent\protected\def\advancearrangedpageN
- {\global\advance\arrangedpageN\plusone}
+ {\global\advanceby\arrangedpageN\plusone}
% TOP
@@ -674,7 +706,7 @@
\wd\arrangedpageA\paperwidth
\outputarrangedbox\arrangedpageA
\egroup
- \ifdim\ht\arrangedpageB=\zeropoint
+ \ifzeropt\ht\arrangedpageB
\exitloop
\fi}%
\global\arrangedpageN\zerocount
@@ -1234,7 +1266,7 @@
\permanent\protected\protected\def\pusharrangedpageXY#1%
{\advancearrangedpageN
- \global\advance\arrangedpageM\plusone
+ \global\advanceby\arrangedpageM\plusone
\reportarrangedpage\arrangedpageN
\global\setbox\arrangedpageB\hpack \ifdim\v_page_target_width>\zeropoint to \v_page_target_width \fi
{\ifvoid\arrangedpageB\else
@@ -1335,16 +1367,15 @@
\installcorenamespace {pageshift}
\permanent\protected\tolerant\def\definepageshift[#1]#*[#2]#*[#3]%
- {\setvalue{\??pageshift#2:#1}{#3}}
-
-\let\page_boxes_h_shifts\empty
-\let\page_boxes_v_shifts\empty
+ {\defcsname\??pageshift#2:#1\endcsname{#3}}
-\newcount\c_page_boxes_h_shifts
-\newcount\c_page_boxes_v_shifts
+\lettonothing\page_boxes_h_shifts
+\lettonothing\page_boxes_v_shifts
-\newdimen\d_page_boxes_h_shifts
-\newdimen\d_page_boxes_v_shifts
+\newinteger \c_page_boxes_h_shifts
+\newinteger \c_page_boxes_v_shifts
+\newdimension\d_page_boxes_h_shifts
+\newdimension\d_page_boxes_v_shifts
\let\page_boxes_apply_shift_print\gobbleoneargument
\let\page_boxes_apply_shift_paper\gobbleoneargument
@@ -1352,7 +1383,7 @@
\def\page_boxes_filter_shift#1#2#3% #1=\dimenx #2=\xpageshifts #3=\nofxpageshifts
{#1\zeropoint
\ifempty#2\else
- \global\advance#3\plusone
+ \global\advanceby#3\plusone
\getfromcommacommand[#2][#3]%
\ifempty\commalistelement
\global#3\plusone % we cycle
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-inf.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-inf.mkxl
index 7e65d6e9a80..4865d5990cb 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-inf.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-inf.mkxl
@@ -22,23 +22,25 @@
\newtoks\everyresetversion
\newtoks\everysetupversion
-\mutable\let\currentversioninfo\empty
-\mutable\let\currentversiontext\empty
+\mutable\lettonothing\currentversioninfo
+\mutable\lettonothing\currentversiontext
\let\page_info_add_to_box\gobbleoneargument
\permanent\tolerant\protected\def\setupversion[#1]%
{\the\everyresetversion
- \doifelseassignment{#1}%
- {\getdummyparameters[\c!alternative=,\c!text=,#1]%
- \edef\currentversioninfo{\dummyparameter\c!alternative}%
- \edef\currentversiontext{\dummyparameter\c!text}}%
- {\edef\currentversioninfo{#1}%
- \let \currentversiontext\empty}%
+ \ifhastok={#1}%
+ \getdummyparameters[\c!alternative=,\c!text=,#1]%
+ \edef\currentversioninfo{\dummyparameter\c!alternative}%
+ \edef\currentversiontext{\dummyparameter\c!text}%
+ \else
+ \edef\currentversioninfo{#1}%
+ \lettonothing\currentversiontext
+ \fi
\ifcsname\??layoutinfo\currentversioninfo\endcsname
\let\page_info_add_to_box\page_info_add_to_box_indeed
\else
- \let\currentversioninfo\empty
+ \lettonothing\currentversioninfo
\let\page_info_add_to_box\gobbleoneargument
\fi
\the\everysetupversion}
@@ -49,13 +51,13 @@
{\begincsname\??layoutinfo\currentversioninfo\endcsname}
\permanent\protected\def\installversioninfo#1#2%
- {\setvalue{\??layoutinfo#1}{#2}}
+ {\defcsname\??layoutinfo#1\endcsname{#2}}
\permanent\protected\def\includeversioninfo#1%
{\begincsname\??layoutinfo#1\endcsname}
\installversioninfo\v!final
- {\let\currentversioninfo\empty
+ {\lettonothing\currentversioninfo
\let\page_info_add_to_box\gobbleoneargument}
\installversioninfo\v!concept
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/page-ini.lmt
new file mode 100644
index 00000000000..c2acd7f215f
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-ini.lmt
@@ -0,0 +1,374 @@
+if not modules then modules = { } end modules ['page-ini'] = {
+ version = 1.001,
+ comment = "companion to page-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- Some day I need to make this more efficient.
+
+local tonumber, rawget, rawset, type, next = tonumber, rawget, rawset, type, next
+local match = string.match
+local sort, tohash, insert, remove, sortedkeys = table.sort, table.tohash, table.insert, table.remove, table.sortedkeys
+local settings_to_array, settings_to_hash = utilities.parsers.settings_to_array, utilities.parsers.settings_to_hash
+
+local texgetcount = tex.getcount
+
+local tonut = nodes.tonut
+local nextlist = nodes.nuts.traversers.list
+local texlists = tex.lists
+
+local context = context
+local ctx_doif = commands.doif
+local ctx_doifelse = commands.doifelse
+
+local implement = interfaces.implement
+
+local data = table.setmetatableindex("table")
+local last = 0
+local pages = structures.pages
+local autolist = { }
+local report = logs.reporter("pages","mark")
+local active = false
+
+local trace = false trackers.register("pages.mark",function(v) trace = v end)
+
+local c_realpageno = tex.iscount("realpageno")
+
+function pages.mark(name,list,settings)
+ active = true
+ --
+ local realpage = texgetcount(c_realpageno)
+ if type(settings) == "string" then
+ settings = settings_to_hash(settings)
+ end
+ if not list or list == "" then
+ if trace then
+ report("marking current page %i as %a",realpage,name)
+ end
+ data[realpage][name] = settings or true
+ return
+ end
+ if type(list) == "string" then
+ list = settings_to_array(list)
+ end
+ if type(list) == "table" then
+ for i=1,#list do
+ local page = list[i]
+ local sign = false
+ if type(page) == "string" then
+ local f, t = match(page,"(%d+)[:%-](%d+)")
+ if f and t then
+ f, t = tonumber(f), tonumber(t)
+ if f and t and f <= t then
+ if trace then
+ report("marking page %i upto %i as %a",f,t,name)
+ end
+ for page=f,t do
+ data[page][name] = settings or true
+ end
+ end
+ page = false
+ else
+ local s, p = match(page,"([%+%-])(%d+)")
+ if s then
+ sign, page = s, p
+ end
+ end
+ end
+ if page then
+ page = tonumber(page)
+ if page then
+ if sign == "+" then
+ page = realpage + page
+ end
+ if sign == "-" then
+ report("negative page numbers are not supported")
+ else
+ if trace then
+ report("marking page %i as %a",page,name)
+ end
+ data[page][name] = settings or true
+ end
+ end
+ end
+ end
+ else
+ if trace then
+ report("marking current page %i as %a",realpage,name)
+ end
+ data[realpage][name] = settings or true
+ end
+end
+
+local tobemarked = { }
+
+function pages.markedlist(realpage)
+ if active and realpage then
+ local m = rawget(tobemarked,realpage) or rawget(data,realpage)
+ return m and next(m) and sortedkeys(m)
+ end
+end
+
+local function marked(name)
+ if active then
+ local realpage = texgetcount(c_realpageno)
+ if last ~= 0 then
+ for i=last,realpage-1 do
+ -- print(last)
+ local di = data[i]
+ if di then
+ tobemarked[i] = di
+ rawset(data,i,nil)
+ end
+ end
+ last = 0 -- needs checking
+ end
+ local pagedata = rawget(data,realpage)
+ return pagedata and pagedata[name] and true or false
+ else
+ return false
+ end
+end
+
+local function markedparameter(name,key)
+ if active then
+ local pagedata = rawget(data,texgetcount(c_realpageno))
+ if pagedata then
+ pagedata = pagedata[name]
+ if pagedata then
+ pagedata = pagedata[key]
+ end
+ end
+ return pagedata
+ end
+end
+
+local function toranges(marked)
+ local list = { }
+ local size = #marked
+ if size > 0 then
+ local first = marked[1]
+ local last = first
+ for i=2,size do
+ local page = marked[i]
+ if page > last + 1 then
+ list[#list+1] = { first, last }
+ first = page
+ end
+ last = page
+ end
+ list[#list+1] = { first, last }
+ --
+ active = true
+ end
+ return list
+end
+
+local function allmarked(list)
+ if active and list then
+ local collected = pages.collected
+ if collected then
+ if type(list) == "string" then
+ list = settings_to_hash(list)
+ elseif type(list) == "table" and #list > 0 then
+ list = tohash(list)
+ end
+ if type(list) == "table" then
+ local found = { }
+ for name in next, list do
+ for page, list in next, data do
+ if list[name] and collected[page] then
+ found[#found+1] = page
+ end
+ end
+ end
+ if #found > 0 then
+ sort(found)
+ if trace then
+ local ranges = toranges(found)
+ for i=1,#ranges do
+ local range = ranges[i]
+ local first = range[1]
+ local last = range[2]
+ if first == last then
+ report("marked page : %i",first)
+ else
+ report("marked range: %i upto %i",first,last)
+ end
+ end
+ end
+ return found
+ end
+ end
+ end
+ end
+end
+
+pages.marked = marked
+pages.toranges = toranges
+pages.allmarked = allmarked
+
+-- An alternative is to use an attribute and identify the state by parsing the node
+-- list but that's a bit overkill for a hardly used feature like this.
+
+-- Page actions are bound to a real page. When we set one, we need to bind to the
+-- current page unless we just flushed. So we also need to check the current page.
+
+-- \page ... \start : sync realpage
+-- \page \start : sync realpage
+-- \page \stop : reset synced because no content yet
+-- \page ... \stop : keep sync
+
+local function autopageaction()
+ if active then
+ local nofauto = #autolist
+ if nofauto > 0 then
+ local realpage = texgetcount(c_realpageno)
+ for i=1,nofauto do
+ local entry = autolist[i]
+ local names = entry[1]
+ local settings = entry[2]
+ for j=1,#names do
+ local name = names[j]
+ local list = data[realpage]
+ if not list[name] then
+ if trace then
+ report("automatically marking page %i as %a",realpage,name)
+ end
+ list[name] = settings or true
+ end
+ end
+ end
+ end
+ end
+end
+
+local function startmarked(name,settings)
+ active = true
+ --
+ insert(autolist, { settings_to_array(name), settings_to_hash(settings) })
+ autopageaction(true)
+end
+
+local function stopmarked()
+ local nofauto = #autolist
+ if nofauto > 0 then
+ if not texlists.pagehead then
+ local realpage = texgetcount(c_realpageno)
+ for i=1,nofauto do
+ local entry = autolist[i]
+ local names = entry[1]
+ for j=1,#names do
+ local name = names[j]
+ local list = data[realpage]
+ if list[name] then
+ if trace then
+ report("automatically unmarking page %i as %a",realpage,name)
+ end
+ list[name] = nil
+ end
+ end
+ end
+ end
+ remove(autolist)
+ end
+end
+
+implement {
+ name = "checkmarkedpages",
+ protected = true,
+ public = true,
+ actions = autopageaction,
+}
+
+implement {
+ name = "markpage",
+ arguments = "3 strings",
+ actions = pages.mark
+}
+
+implement {
+ name = "doifelsemarkedpage",
+ arguments = "argument",
+ protected = true,
+ public = true,
+ actions = { marked, ctx_doifelse }
+}
+
+implement {
+ name = "doifmarkedpage",
+ arguments = "argument",
+ protected = true,
+ public = true,
+ actions = { marked, ctx_doif }
+}
+
+implement {
+ name = "markedpageparameter",
+ arguments = "2 arguments",
+ public = true,
+ actions = function(name,key)
+ local value = markedparameter(name,key)
+ if value then
+ context(value)
+ end
+ end
+}
+
+implement {
+ name = "markedpages",
+ arguments = "string",
+ actions = function(name)
+ local t = allmarked(name)
+ if t then
+ context("%,t",t)
+ end
+ end
+}
+
+implement {
+ name = "startmarkpages",
+ arguments = "2 strings",
+ actions = startmarked,
+}
+
+implement {
+ name = "stopmarkpages",
+ protected = true,
+ public = true,
+ actions = stopmarked,
+}
+
+implement {
+ name = "doifelsependingpagecontent",
+ actions = function()
+ local h = texlists.contrib_head
+ -- local t = texlists.contrib_tail
+ local p = false
+ if h then
+ for n in nextlist, tonut(h) do
+ p = true
+ break
+ end
+ end
+ ctx_doifelse(p)
+ end,
+}
+
+-- implement {
+-- name = "pagestate",
+-- public = true,
+-- usage = "value",
+-- actions = function()
+-- local result = 0
+-- if nodes.nuts.getspeciallist("contributehead") then
+-- result = result | 1
+-- end
+-- if nodes.nuts.getspeciallist("pagehead") then
+-- result = result | 2
+-- end
+-- return tokens.values.integer, result
+-- end
+-- }
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-ini.mkxl
index 0a0993d44d3..38fe1e60d6d 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-ini.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-ini.mkxl
@@ -13,7 +13,7 @@
\writestatus{loading}{ConTeXt Page Macros / Initializations}
-\registerctxluafile{page-ini}{}
+\registerctxluafile{page-ini}{autosuffix}
%D The \type {\processpage} command has become obsolete. It's original
%D purpose was to flush only parts of a document but nowadays we have
@@ -28,10 +28,10 @@
%D Shipout control.
-\newcount\nofshipouts
+\newinteger\nofshipouts
\appendtoks
- \global\advance\nofshipouts\plusone
+ \global\advanceby\nofshipouts\plusone
\to \everyaftershipout
\newconditional\c_otr_shipout_enabled \settrue\c_otr_shipout_enabled
@@ -47,7 +47,7 @@
\protected\def\page_otr_shipout_nop
{\writestatus\m!system{ignoring shipout of real page \the\realpageno}%
- \global\advance\realpageno\minusone % else no flush of resources
+ \global\advanceby\realpageno\minusone % else no flush of resources
\dowithnextbox{\deadcycles\zerocount}}
% We don't support direct user \shipouts (weird: this does not work, bug?)
@@ -110,8 +110,15 @@
\installoutputroutine\savepagecontent
{\global\setbox\b_page_otr_saved\box\normalpagebox}
-\permanent\protected\def\flushpagecontent
- {\ifvoid\b_page_otr_saved\else\unvbox\b_page_otr_saved\fi}
+% \permanent\protected\def\flushpagecontent
+% {\ifvoid\b_page_otr_saved\else\unvbox\b_page_otr_saved\fi}
+
+\permanent\protected\def\flushpagecontent % used in postponing
+ {\ifvoid\b_page_otr_saved\else
+ \scratchdepth\dp\b_page_otr_saved
+ \unvbox\b_page_otr_saved
+ \prevdepth\scratchdepth
+ \fi}
% Test case: assumes one group level for output routine, todo:
% a toks.
@@ -148,6 +155,8 @@
%
% \stoptext
+\ifdefined\page_check_weird_page \else \let\page_check_weird_page\relax \fi
+
\def\page_otr_construct_and_shipout#1#2#3%
{\forgetall
\page_boxes_shipout{\page_boxes_constructed_page#1#2}% \hbox removed
@@ -162,7 +171,6 @@
\strc_pagenumbers_increment_counters % should hook into an every
\page_adapts_synchronize
\page_otr_check_for_pending_inserts
- \page_otr_command_flush_facing_floats
\page_floats_flush_page_floats % before postponed blocks
\page_spread_flush % defined later
\ifnum#3=\plusone
@@ -174,7 +182,8 @@
\fi
\else
\page_postponed_blocks_flush
- \fi}
+ \fi
+ \page_check_weird_page}
% Can't we get rid of this hackery? It's used in some widgets
% stuff so probably not.
@@ -224,17 +233,30 @@
\newconditional\c_page_marks_building_successive_pages \settrue\c_page_marks_building_successive_pages
-\def\page_marks_synchronize_page#1% box
- {\strc_markings_synchronize\v!page{#1}{\ifconditional\c_page_marks_building_successive_pages\v!keep\fi}}
-\def\page_marks_synchronize_column#1#2#3#4% first last column box
- {\ifnum#3=#1\relax
- \strc_markings_synchronize{\number#3,\v!column:\number#3,\v!first,\v!column:\v!first}{#4}{}%
- \orelse\ifnum#3=#2\relax
- \strc_markings_synchronize{\number#3,\v!column:\number#3,\v!last, \v!column:\v!last }{#4}{}%
- \else
- \strc_markings_synchronize{\number#3,\v!column:\number#3 }{#4}{}%
- \fi}
+\ifdefined\??markingclass
+
+ \def\page_marks_synchronize_page#1% box
+ {} % \strc_markings_synchronize\v!page{1}{#1}
+
+ \def\page_marks_synchronize_column#1#2#3#4% first last column box
+ {\strc_markings_synchronize\v!column{#3}{#4}}
+
+\else
+
+ \def\page_marks_synchronize_page#1% box
+ {\strc_markings_synchronize\v!page{#1}{\ifconditional\c_page_marks_building_successive_pages\v!keep\fi}}
+
+ \def\page_marks_synchronize_column#1#2#3#4% first last column box
+ {\ifnum#3=#1\relax
+ \strc_markings_synchronize{\number#3,\v!column:\number#3,\v!first,\v!column:\v!first}{#4}{}%
+ \orelse\ifnum#3=#2\relax
+ \strc_markings_synchronize{\number#3,\v!column:\number#3,\v!last,\v!column:\v!last}{#4}{}%
+ \else
+ \strc_markings_synchronize{\number#3,\v!column:\number#3}{#4}{}%
+ \fi}
+
+\fi
% Page body building
@@ -277,6 +299,7 @@
\appendtoks
\restoreglobalbodyfont
+ \restoreglobalinterlinespace
\pickupattributes
\to \everybeforepagebody
@@ -317,47 +340,41 @@
\aliased\let\doiftopofpageelse\doifelsetopofpage
-% %D Idea:
-%
-% \newinsert\thispageinsert % <- installinsertion
-%
-% \def\flushatthispage
-% {\bgroup
-% \dowithnextbox{\insert\thispageinsert{\box\nextbox}\egroup}%
-% \hbox}
-%
-% \appendtoks
-% \ifvoid\thispageinsert\else\hbox{\smashedbox\thispageinsert}\fi
-% \to \everyshipout
-
-% not yet in i-* file
-
\installcorenamespace{markedpage}
% todo: just define at the lua end ... less hassle
-\permanent\tolerant\protected\def\markpage [#1]#*[#2]{\clf_markpage {#1}{#2}}
-\permanent \def\markedpages [#1]{\clf_markedpages {#1}} % expandable
-\permanent\protected \def\doifelsemarkedpage#1{\clf_doifelsemarkedpage{#1}}
-\permanent\protected \def\startmarkpages [#1]{\clf_startmarkpages {#1}}
-\permanent\protected \def\stopmarkpages {\clf_stopmarkpages }
+\permanent\tolerant\protected\def\markpage [#1]#*[#2]#*[#3]{\clf_markpage{#1}{#2}{#3}}
+\permanent\tolerant\protected\def\startmarkpages [#1]#*[#2]{\clf_startmarkpages{#1}{#2}}
+%permanent \protected\def\stopmarkpages {\clf_stopmarkpages}
+\permanent \def\markedpages [#1]{\clf_markedpages{#1}} % expandable
+%permanent \protected\def\doifmarkedpage #1{\clf_doifmarkedpage{#1}}
+%permanent \protected\def\doifelsemarkedpage #1{\clf_doifelsemarkedpage{#1}}
+% \def\markedpageparameter #1#2{\clf_markedpageparameter{#1}{#2}}
+%permanent \protected\def\checkmarkedpages {\clf_checkmarkedpages}
+
+\appendtoks
+ \checkmarkedpages % defined at lua end
+\to \everyaftershipout
%D Experimental:
\newconstant\c_page_force_strut_depth_trace_mode
-\installtextracker
- {otr.forcestrutdepth}
- {\c_page_force_strut_depth_trace_mode\plusone}
- {\c_page_force_strut_depth_trace_mode\zerocount}
+% \installtextracker
+% {otr.forcestrutdepth}
+% {\c_page_force_strut_depth_trace_mode\plusone}
+% {\c_page_force_strut_depth_trace_mode\zerocount}
+
+% todo: only in mvl!
-\installoutputroutine\forcestrutdepth
- {\clf_forcestrutdepth\normalpagebox\strutdp\c_page_force_strut_depth_trace_mode
- \unvbox\normalpagebox}
+% \installoutputroutine\forcestrutdepth
+% {\clf_forcestrutdepth\normalpagebox\strutdp\c_page_force_strut_depth_trace_mode
+% \unvbox\normalpagebox}
-\installoutputroutine\forcestrutdepthplus % experimental
- {\clf_forcestrutdepthplus\normalpagebox\strutdp\c_page_force_strut_depth_trace_mode
- \unvbox\normalpagebox}
+% \installoutputroutine\forcestrutdepthplus % experimental
+% {\clf_forcestrutdepthplus\normalpagebox\strutdp\c_page_force_strut_depth_trace_mode
+% \unvbox\normalpagebox}
% maybe better:
%
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-inj.mklx b/Master/texmf-dist/tex/context/base/mkxl/page-inj.mklx
index fda757dbe57..02f853c5561 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-inj.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-inj.mklx
@@ -33,8 +33,14 @@
\let\page_boxes_flush_after \clf_flushpageinjectionsafter
\def\page_injections_flush_indeed
- {\scrn_canvas_synchronize_set{\pageinjectionparameter\c!width}{\pageinjectionparameter\c!height}%
- \invokepagehandler\v!normal{\inheritedpageinjectionframed{\texsetup\p_page_injectionalternative_rederingsetup}}%
+ {\begingroup
+ \setbox\scratchbox\normalhpack
+ {\inheritedpageinjectionframed{\texsetup\p_page_injectionalternative_rederingsetup}}%
+ \printpaperwidth \wd\scratchbox
+ \printpaperheight\ht\scratchbox
+ \scrn_canvas_synchronize_only
+ \invokepagehandler\v!normal{\box\scratchbox}%
+ \endgroup
\scrn_canvas_synchronize_reset}
\def\page_injections_flush_saved#name#parameters%
@@ -64,13 +70,13 @@
\fi}
\def\page_injections_direct_settings_parameters#settings% #parameters%
- {\let\currentpageinjection\empty
+ {\lettonothing\currentpageinjection
\checkpageinjectionparent
\setupcurrentpageinjection[#settings]%
\page_injections_direct_indeed}
\def\page_injections_direct_parameters% #parameters%
- {\let\currentpageinjection\empty
+ {\lettonothing\currentpageinjection
\checkpageinjectionparent
\page_injections_direct_indeed}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-ins.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-ins.mkxl
index 2ab7449ab11..8d2dfe84631 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-ins.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-ins.mkxl
@@ -56,11 +56,11 @@
\page_inserts_check_anchoring
\to \everystarttext % or \everyjob
-\newcount\currentinsertionnumber % This is a count and not a macro !
+\newinteger\currentinsertionnumber % This is a count and not a macro !
\newtoks\t_page_inserts_list
-\mutable\let\doprocessinsert\relax % probably kind of obsolete now
+\mutable\let\doprocessinsert\gobbleoneargument % probably kind of obsolete now
%D Maybe some day we will move settings here.
@@ -73,13 +73,6 @@
\protected\def\page_inserts_synchronize_registers
{\currentinsertionnumber\csname\??insertionnumber\currentinsertion\endcsname}
-% for practical reasons we still set these elsewhere but that might change in the future
-%
-% \global\count\currentinsertionnumber\numexpr\insertionparameter\c!factor/\insertionparameter\c!n\relax
-% \global\skip \currentinsertionnumber\insertionparameter\c!distance \relax
-% \global\dimen\currentinsertionnumber\insertionparameter\c!maxheight\relax}
-% \floatingpenalty\zerocount
-
\appendtoks
\ifempty\currentinsertionparent \else
\page_inserts_synchronize_registers
@@ -94,14 +87,14 @@
\permanent\protected\def\processinsertions
{\the\t_page_inserts_list}
-\permanent\protected\def\synchronizeinsertions
- {\let\doprocessinsert\page_inserts_synchronize
- \processinsertions}
-
-\protected\def\page_inserts_synchronize#1% yes or no
- {\ifvoid#1\else
- \insert#1{\unvbox#1}%
- \fi}
+% \permanent\protected\def\synchronizeinsertions
+% {\let\doprocessinsert\page_inserts_synchronize
+% \processinsertions}
+%
+% \protected\def\page_inserts_synchronize#1% yes or no
+% {\ifvoid#1\else
+% \page_inserts_inject#1{\unvbox#1}%
+% \fi}
\permanent\protected\def\doifelseinsertion#1%
{\ifcsname\??insertionnumber#1\endcsname
@@ -113,7 +106,7 @@
\aliased\let\doifinsertionelse\doifelseinsertion
% \protected\def\startinsertion[#1]%
-% {\insert\csname\??insertionnumber#1\endcsname\bgroup}
+% {\page_inserts_inject\csname\??insertionnumber#1\endcsname\bgroup}
%
% \protected\def\stopinsertion
% {\egroup}
@@ -124,12 +117,66 @@
% pass pass them explicitly. Actually, when we see an insertion node at that end,
% we already know the number.
+\insertmode\plustwo
+
+% \ifnum\insertmode=\plustwo
+
+ \protected\def\page_inserts_inject {\insert}
+
+ \protected\def\page_inserts_set_limit {\insertlimit}
+ \protected\def\page_inserts_set_distance {\insertdistance}
+ \protected\def\page_inserts_set_multiplier{\insertmultiplier}
+ \protected\def\page_inserts_set_penalty {\insertpenalty}
+ \protected\def\page_inserts_set_maxdepth {\insertmaxdepth}
+
+ \protected\def\page_inserts_get_limit {\insertlimit}
+ \protected\def\page_inserts_get_distance {\insertdistance}
+ \protected\def\page_inserts_get_multiplier{\insertmultiplier}
+ \protected\def\page_inserts_get_penalty {\insertpenalty}
+ \protected\def\page_inserts_get_maxdepth {\insertmaxdepth}
+
+ \protected\def\page_inserts_get_boxed {\insertbox}
+ \protected\def\page_inserts_get_copied {\insertcopy}
+ \protected\def\page_inserts_get_unboxed {\insertunbox}
+ \protected\def\page_inserts_get_uncopied {\insertuncopy}
+
+ \protected\def\page_inserts_get_height {\insertheight}
+ \protected\def\page_inserts_get_depth {\insertdepth}
+ \protected\def\page_inserts_get_width {\insertwidth}
+
+% \else
+%
+% \protected\def\page_inserts_inject {\insert}
+%
+% \protected\def\page_inserts_set_limit {\global\dimen}
+% \protected\def\page_inserts_set_distance {\global\skip }
+% \protected\def\page_inserts_set_multiplier{\global\count}
+%
+% \protected\def\page_inserts_get_limit {\dimen}
+% \protected\def\page_inserts_get_distance {\skip }
+% \protected\def\page_inserts_get_multiplier{\count}
+%
+% \protected\def\page_inserts_get_boxed {\box}
+% \protected\def\page_inserts_get_copied {\copy}
+% \protected\def\page_inserts_get_unboxed {\unvbox}
+% \protected\def\page_inserts_get_uncopied {\unvcopy}
+%
+% \protected\def\page_inserts_get_height {\ht}
+% \protected\def\page_inserts_get_depth {\dp}
+% \protected\def\page_inserts_get_width {\wd}
+%
+% \fi
+
+\newinteger\c_page_inserts_last_allocated
+
\appendtoks
\ifempty\currentinsertionparent
\ifcsname\??insertionnumber\currentinsertion\endcsname
% bad news
\else
- \expandafter\newinsert\csname\??insertionnumber\currentinsertion\endcsname
+ %expandafter\newinsert\csname\??insertionnumber\currentinsertion\endcsname
+ \global\advanceby\c_page_inserts_last_allocated\plusone
+ \global\expandafter\integerdef\csname\??insertionnumber\currentinsertion\endcsname\c_page_inserts_last_allocated
\page_inserts_synchronize_registers
\clf_defineinsertion
{\currentinsertion}%
@@ -137,12 +184,13 @@
number \currentinsertionnumber
}%
\relax
- \t_page_inserts_list\expandafter\expandafter\expandafter
- {\expandafter\the\expandafter\t_page_inserts_list
- \expandafter\page_inserts_process\csname\??insertionnumber\currentinsertion\endcsname}%
- \count\currentinsertionnumber\plusthousand
- \skip \currentinsertionnumber\zeropoint
- \dimen\currentinsertionnumber\maxdimen
+% \t_page_inserts_list\expandafter\expandafter\expandafter
+% {\expandafter\the\expandafter\t_page_inserts_list
+% \expandafter\page_inserts_process\csname\??insertionnumber\currentinsertion\endcsname}%
+ \xtoksapp\t_page_inserts_list{\page_inserts_process{\currentinsertion}}%
+ \page_inserts_set_multiplier\currentinsertionnumber\plusthousand
+ \page_inserts_set_distance \currentinsertionnumber\zeropoint
+ \page_inserts_set_limit \currentinsertionnumber\maxdimen
\fi
\else
\letcsname\??insertionnumber\currentinsertion\expandafter\endcsname
@@ -169,41 +217,10 @@
\def\page_insert_insertion_height#1%
{\dimexpr\expandafter\page_insert_insertion_height_indeed\csname\??insertionnumber#1\endcsname\relax}
-\def\page_insert_insertion_height_indeed#1%
- {\ifvoid#1\zeropoint\else1\skip#1+\ht#1\fi}
-
-%D Obsolete:
+% \def\page_insert_insertion_height_indeed#1%
+% {\ifvoid#1\zeropoint\else1\page_inserts_get_distance#1+\ht#1\fi}
-% \installcorenamespace{insertionbackup}
-%
-% \protected\def\installbackupinsertion#1%
-% {\ifcsname\??insertionbackup\string#1\endcsname \else
-% \expandafter\newinsert\csname\??insertionbackup\string#1\endcsname
-% \count\csname\??insertionbackup\string#1\endcsname\zerocount
-% \skip \csname\??insertionbackup\string#1\endcsname\zeropoint
-% \dimen\csname\??insertionbackup\string#1\endcsname\maxdimen
-% \fi}
-%
-% \protected\def\saveinsertionbox#1% hm, actually unknown
-% {\global\setbox\csname\??insertionbackup\string#1\endcsname
-% \ifdim\ht#1>\zeropoint\box#1\else\emptybox\fi}
-%
-% \protected\def\restoreinsertionbox#1%
-% {\ifvoid\backupinsertion#1\else % if void, we keep the content
-% \global\setbox#1\box\csname\??insertionbackup\string#1\endcsname
-% \fi}
-%
-% \protected\def\eraseinsertionbackup#1%
-% {\global\setbox\csname\??insertionbackup\string#1\endcsname\emptybox}
-%
-% \protected\def\saveinsertiondata#1%
-% {\global\skip \csname\??insertionbackup\string#1\endcsname\skip #1%
-% \global\count\csname\??insertionbackup\string#1\endcsname\count#1%
-% \global\dimen\csname\??insertionbackup\string#1\endcsname\dimen#1}
-%
-% \protected\def\restoreinsertiondata#1%
-% {\global\skip #1\skip \csname\??insertionbackup\string#1\endcsname
-% \global\count#1\count\csname\??insertionbackup\string#1\endcsname
-% \global\dimen#1\dimen\csname\??insertionbackup\string#1\endcsname}
+\def\page_insert_insertion_height_indeed#1%
+ {\ifzeropt\page_inserts_get_height#1\zeropoint\else\dimexpr\page_inserts_get_distance#1\relax+\page_inserts_get_height#1\fi}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-lay.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-lay.mkxl
index 21cb48f20de..5e2281a2f3f 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-lay.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-lay.mkxl
@@ -24,90 +24,92 @@
%D The dimensions related to layout areas are represented by real dimensions.
-\newdimen\paperheight \paperheight = 297mm
-\newdimen\paperwidth \paperwidth = 210mm
-\newdimen\paperoffset \paperoffset = \zeropoint
-\newdimen\paperbleed \paperbleed = \zeropoint
-\newdimen\spinewidth \spinewidth = \zeropoint
+\newdimension\paperheight \paperheight = 297mm
+\newdimension\paperwidth \paperwidth = 210mm
+\newdimension\paperoffset \paperoffset = \zeropoint
+\newdimension\paperbleed \paperbleed = \zeropoint
+\newdimension\spinewidth \spinewidth = \zeropoint
-\newdimen\printpaperheight \printpaperheight = \paperheight
-\newdimen\printpaperwidth \printpaperwidth = \paperwidth
+\newdimension\printpaperheight \printpaperheight = \paperheight
+\newdimension\printpaperwidth \printpaperwidth = \paperwidth
-\newdimen\makeupheight % calculated
-\newdimen\makeupwidth % calculated
+\newdimension\makeupheight % calculated
+\newdimension\makeupwidth % calculated
-\newdimen\textheight % calculated
-\newdimen\textwidth % calculated
+\newdimension\textheight % calculated
+\newdimension\textwidth % calculated
-\newdimen\topspace \topspace = 2cm
-\newdimen\backspace \backspace = \topspace
-\newdimen\cutspace \cutspace = \zeropoint
-\newdimen\bottomspace \bottomspace = \zeropoint
+\newdimension\topspace \topspace = 2cm
+\newdimension\backspace \backspace = \topspace
+\newdimension\cutspace \cutspace = \zeropoint
+\newdimension\bottomspace \bottomspace = \zeropoint
-\newdimen\headerheight \headerheight = 2cm
-\newdimen\footerheight \footerheight = \headerheight
+\newdimension\headerheight \headerheight = 2cm
+\newdimension\footerheight \footerheight = \headerheight
-\newdimen\topoffset \topoffset = \zeropoint
-\newdimen\backoffset \backoffset = \topoffset
+\newdimension\topoffset \topoffset = \zeropoint
+\newdimension\backoffset \backoffset = \topoffset
-\newdimen\leftmarginwidth \leftmarginwidth = 3cm
-\newdimen\rightmarginwidth \rightmarginwidth = \leftmarginwidth
+\newdimension\leftmarginwidth \leftmarginwidth = 3cm
+\newdimension\rightmarginwidth \rightmarginwidth = \leftmarginwidth
-\newdimen\leftedgewidth \leftedgewidth = 3cm
-\newdimen\rightedgewidth \rightedgewidth = \leftedgewidth
+\newdimension\leftedgewidth \leftedgewidth = 3cm
+\newdimension\rightedgewidth \rightedgewidth = \leftedgewidth
-\newdimen\topheight \topheight = \zeropoint
-\newdimen\bottomheight \bottomheight = \topheight
+\newdimension\topheight \topheight = \zeropoint
+\newdimension\bottomheight \bottomheight = \topheight
-\newcount\layoutlines \layoutlines = \zerocount
-\newcount\layoutcolumns \layoutcolumns = \zerocount
-\newdimen\layoutcolumndistance \layoutcolumndistance = \zeropoint
-\newdimen\layoutcolumnwidth \layoutcolumnwidth = \zeropoint
+\newinteger \layoutlines \layoutlines = \zerocount
+\newinteger \layoutcolumns \layoutcolumns = \zerocount
+\newdimension\layoutcolumndistance \layoutcolumndistance = \zeropoint
+\newdimension\layoutcolumnwidth \layoutcolumnwidth = \zeropoint
-\newdimen\totaltextwidth
+\newdimension\totaltextwidth
+
+\newdimension\textadaptive
%D The next series of dimensions are complemented by left and rights ones.
-\newdimen\margindistance
-\newdimen\edgedistance
-\newdimen\marginwidth
-\newdimen\edgewidth
+\newdimension\margindistance
+\newdimension\edgedistance
+\newdimension\marginwidth
+\newdimension\edgewidth
%D Because a distance does not really makes sense when there is no area, we use a
%D zero distance in case there is no area.
%D The horizontal distances are:
-\newdimen\leftedgedistance
-\newdimen\rightedgedistance
-\newdimen\leftmargindistance
-\newdimen\rightmargindistance
+\newdimension\leftedgedistance
+\newdimension\rightedgedistance
+\newdimension\leftmargindistance
+\newdimension\rightmargindistance
%D The vertical distances are:
-\newdimen\topdistance
-\newdimen\headerdistance
-\newdimen\textdistance
-\newdimen\footerdistance
-\newdimen\bottomdistance
+\newdimension\topdistance
+\newdimension\headerdistance
+\newdimension\textdistance
+\newdimension\footerdistance
+\newdimension\bottomdistance
-\newdimen\textovershoot % available in pagebuilder
+\newdimension\textovershoot % available in pagebuilder
%D We need to calculate the extra distances:
-\newdimen\naturalmarginwidth
-\newdimen\naturaledgewidth
-\newdimen\naturalmargindistance
-\newdimen\naturaledgedistance
-\newdimen\naturalleftedgedistance
-\newdimen\naturalrightedgedistance
-\newdimen\naturalleftmargindistance
-\newdimen\naturalrightmargindistance
-\newdimen\naturaltopdistance
-\newdimen\naturalheaderdistance
-\newdimen\naturaltextdistance
-\newdimen\naturalfooterdistance
-\newdimen\naturalbottomdistance
+\newdimension\naturalmarginwidth
+\newdimension\naturaledgewidth
+\newdimension\naturalmargindistance
+\newdimension\naturaledgedistance
+\newdimension\naturalleftedgedistance
+\newdimension\naturalrightedgedistance
+\newdimension\naturalleftmargindistance
+\newdimension\naturalrightmargindistance
+\newdimension\naturaltopdistance
+\newdimension\naturalheaderdistance
+\newdimension\naturaltextdistance
+\newdimension\naturalfooterdistance
+\newdimension\naturalbottomdistance
%D Now we've come to the setup and definition commands.
@@ -119,11 +121,20 @@
\installswitchcommandhandler \??layout {layout} \??layout
+\pushoverloadmode
+
+ \let\page_layouts_define\definelayout % ugly hack for MS
+
+ \permanent\protected\def\definelayout[#1]% intercept relative pages
+ {\normalexpanded{\page_layouts_define[\ifhastoks{+}{#1}\the\numexpr\realpageno#1\relax\else#1\fi]}}
+
+\popoverloadmode
+
\appendtoks
\doifnothing{\directlayoutparameter\c!state}{\letlayoutparameter\c!state\v!start}%
\to \everydefinelayout
-\newconditional \layouthaschanged \settrue\layouthaschanged % used in mp
+\newinteger\c_page_layouts_changed
\appendtoks
\ifcase\layoutsetupmode
@@ -143,7 +154,7 @@
\page_layouts_check_next
\or % \setuplayout[name]
\ifx\currentlayout\v!reset
- \let\currentlayout\empty
+ \lettonothing\currentlayout
\fi
\letlayoutparameter\c!state\v!normal % global ? still needed ?
\glet\currentlayout\currentlayout % global
@@ -151,17 +162,13 @@
\page_layouts_check_next
\or % \setuplayout (reverts to main layout)
\letlayoutparameter\c!state\v!normal % global ? still needed ?
- \glet\currentlayout\empty % global
+ \glettonothing\currentlayout % global
\page_layouts_synchronize
\page_layouts_check_next
\fi
- \global\settrue\layouthaschanged
+ \global\c_page_layouts_changed\realpageno
\to \everysetuplayout
-\appendtoks
- \global\setfalse\layouthaschanged
-\to \everyaftershipout
-
\permanent\def\doifelselayoutdefined#1%
{\ifcsname\namedlayouthash{#1}\c!state\endcsname % maybe a helper
\expandafter\firstoftwoarguments
@@ -173,6 +180,20 @@
\permanent\def\layoutdistance#1#2{\ifdim\zeropoint<#1#2\else\zeropoint\fi}
+\appendtoks
+ \global\pageextragoal\zeropoint
+\to \everysetuplayout
+
+\appendtoks
+ \global\pageextragoal \zeropoint
+\to \everysetupoutputroutine
+
+\immutable\integerdef\lasttextadaptive\zerocount
+
+\prependtoks
+ \enforced\integerdef\lasttextadaptive\plusone
+\to \everybeforeoutput
+
% \newconditional\reverselayout
\def\page_layouts_set_dimensions
@@ -218,12 +239,22 @@
\newtoks\everyswapmargins % watch the order !
+\newconditional\marginsareswapped
+
\appendtoks
+ \ifconditional\marginsareswapped
+ \setfalse\marginsareswapped
+ \else
+ \settrue\marginsareswapped
+ \fi
+ %
\enforced\swapcsvalues\leftmargindistance\rightmargindistance
\enforced\swapcsvalues\leftedgedistance \rightedgedistance
\enforced\swapcsvalues\leftmarginwidth \rightmarginwidth
\enforced\swapcsvalues\leftedgewidth \rightedgewidth
%
+ \enforced\swapcsvalues\backspace \cutspace
+ %
\enforced\swapcsvalues\leftmargintotal \rightmargintotal
\enforced\swapcsvalues\leftedgetotal \rightedgetotal
\enforced\swapcsvalues\leftsidetotal \rightsidetotal
@@ -303,8 +334,8 @@
\let\v_page_target_top_fill \relax
\let\v_page_target_bottom_fill\relax
-\let\papersize \empty
-\let\printpapersize\empty
+\lettonothing\papersize
+\lettonothing\printpapersize
\def\v_page_target_top {\namedlayouttargetparameter\papersize\c!top }
\def\v_page_target_bottom {\namedlayouttargetparameter\papersize\c!bottom}
@@ -399,7 +430,7 @@
\fi}
\protected\def\page_paper_setup_size_settings[#1]% sometimes used to set paper/print size
- {\let\currentlayouttarget\empty
+ {\lettonothing\currentlayouttarget
\edef\m_layouttarget_paper_saved{\page_paper_the_paper_size{\layouttargetparameter\c!page }}%
\edef\m_layouttarget_print_saved{\page_paper_the_print_size{\layouttargetparameter\c!paper}}%
\setupcurrentlayouttarget[#1]%
@@ -469,35 +500,58 @@
\global\c_page_target_print_orientation\uprotationangle
\global\c_page_target_print_reverse \uprotationangle}
-\letvalue{\??layoutpaper\v!reset}\page_paper_reset_paper
-\letvalue{\??layoutprint\v!reset}\page_paper_reset_print
-
-\setvalue{\??layoutpaper\v!landscape }{\global\settrue\c_page_target_paper_landscape}
-\setvalue{\??layoutpaper\v!mirrored }{\global\settrue\c_page_target_paper_mirror}
-\setvalue{\??layoutpaper\v!negative }{\global\settrue\c_page_target_paper_negate}
-\setvalue{\??layoutpaper\v!rotated }{\global\c_page_target_paper_orientation\rightrotationangle
- \global\c_page_target_paper_reverse \leftrotationangle}
-\setvalue{\??layoutpaper\number\rightrotationangle}{\global\c_page_target_paper_orientation\rightrotationangle
- \global\c_page_target_paper_reverse \leftrotationangle}
-\setvalue{\??layoutpaper\number\downrotationangle }{\global\c_page_target_paper_orientation\downrotationangle
- \global\c_page_target_paper_reverse \zerocount}
-\setvalue{\??layoutpaper\number\leftrotationangle }{\global\c_page_target_paper_orientation\leftrotationangle
- \global\c_page_target_paper_reverse \rightrotationangle}
-
-\setvalue{\??layoutprint\v!landscape }{\global\settrue\c_page_target_print_landscape}
-\setvalue{\??layoutprint\v!mirrored }{\global\settrue\c_page_target_print_mirror}
-\setvalue{\??layoutprint\v!negative }{\global\settrue\c_page_target_print_negate}
-\setvalue{\??layoutprint\v!rotated }{\global\c_page_target_print_orientation\rightrotationangle
- \global\c_page_target_print_reverse \leftrotationangle}
-\setvalue{\??layoutprint\number\rightrotationangle}{\global\c_page_target_print_orientation\rightrotationangle
- \global\c_page_target_print_reverse \leftrotationangle}
-\setvalue{\??layoutprint\number\downrotationangle }{\global\c_page_target_print_orientation\downrotationangle
- \global\c_page_target_print_reverse \zerocount}
-\setvalue{\??layoutprint\number\leftrotationangle }{\global\c_page_target_print_orientation\leftrotationangle
- \global\c_page_target_print_reverse \rightrotationangle}
-
-%def\page_paper_handle_page_option #1{\ifcsname\??layoutpaper#1\endcsname\csname\??layoutpaper#1\endcsname\fi}
-%def\page_paper_handle_print_option#1{\ifcsname\??layoutprint#1\endcsname\csname\??layoutprint#1\endcsname\fi}
+\letcsname\??layoutpaper\v!reset\endcsname\page_paper_reset_paper
+\letcsname\??layoutprint\v!reset\endcsname\page_paper_reset_print
+
+\defcsname\??layoutpaper\v!landscape\endcsname
+ {\global\settrue\c_page_target_paper_landscape}
+
+\defcsname\??layoutpaper\v!mirrored\endcsname
+ {\global\settrue\c_page_target_paper_mirror}
+
+\defcsname\??layoutpaper\v!negative\endcsname
+ {\global\settrue\c_page_target_paper_negate}
+
+\defcsname\??layoutpaper\v!rotated\endcsname
+ {\global\c_page_target_paper_orientation\rightrotationangle
+ \global\c_page_target_paper_reverse \leftrotationangle}
+
+\defcsname\??layoutpaper\number\rightrotationangle\endcsname
+ {\global\c_page_target_paper_orientation\rightrotationangle
+ \global\c_page_target_paper_reverse \leftrotationangle}
+
+\defcsname\??layoutpaper\number\downrotationangle\endcsname
+ {\global\c_page_target_paper_orientation\downrotationangle
+ \global\c_page_target_paper_reverse \zerocount}
+
+\defcsname\??layoutpaper\number\leftrotationangle\endcsname
+ {\global\c_page_target_paper_orientation\leftrotationangle
+ \global\c_page_target_paper_reverse \rightrotationangle}
+
+\defcsname\??layoutprint\v!landscape\endcsname
+ {\global\settrue\c_page_target_print_landscape}
+
+\defcsname\??layoutprint\v!mirrored\endcsname
+ {\global\settrue\c_page_target_print_mirror}
+
+\defcsname\??layoutprint\v!negative\endcsname
+ {\global\settrue\c_page_target_print_negate}
+
+\defcsname\??layoutprint\v!rotated\endcsname
+ {\global\c_page_target_print_orientation\rightrotationangle
+ \global\c_page_target_print_reverse \leftrotationangle}
+
+\defcsname\??layoutprint\number\rightrotationangle\endcsname
+ {\global\c_page_target_print_orientation\rightrotationangle
+ \global\c_page_target_print_reverse \leftrotationangle}
+
+\defcsname\??layoutprint\number\downrotationangle \endcsname
+ {\global\c_page_target_print_orientation\downrotationangle
+ \global\c_page_target_print_reverse \zerocount}
+
+\defcsname\??layoutprint\number\leftrotationangle \endcsname
+ {\global\c_page_target_print_orientation\leftrotationangle
+ \global\c_page_target_print_reverse \rightrotationangle}
\def\page_paper_handle_page_option #1{\begincsname\??layoutpaper#1\endcsname}
\def\page_paper_handle_print_option#1{\begincsname\??layoutprint#1\endcsname}
@@ -507,7 +561,7 @@
\edef\currentlayouttarget{#1}%
\fi}
-\newdimen\d_page_minimum_paper_size \d_page_minimum_paper_size\luaexpr{math.pi}\onebasepoint
+\newdimension\d_page_minimum_paper_size \d_page_minimum_paper_size\luaexpr{math.pi}\onebasepoint
\protected\def\page_paper_set_current_indeed[#1][#2]%
{\edef\m_page_asked_paper{#1}% can be the restores
@@ -516,7 +570,7 @@
\page_paper_set_restore\m_page_asked_paper\m_page_asked_print
%
% locate page target
- \let\currentlayouttarget\empty
+ \lettonothing\currentlayouttarget
\page_paper_reset_paper
\processcommacommand[\m_page_asked_paper]\page_paper_identify_target
\ifempty\currentlayouttarget
@@ -598,8 +652,8 @@
\def\page_paper_set_offsets % will move
{\global\paperoffset\v_page_target_offset
- \global\advance\paperwidth -2\paperoffset
- \global\advance\paperheight-2\paperoffset}
+ \global\advanceby\paperwidth -2\paperoffset
+ \global\advanceby\paperheight-2\paperoffset}
\fi
@@ -607,8 +661,8 @@
\let\synchronizegridsnapping\relax
\fi
-\let\p_page_layouts_width \empty
-\let\p_page_layouts_height\empty
+\lettonothing\p_page_layouts_width
+\lettonothing\p_page_layouts_height
\def\page_layouts_synchronize
{\setups[\layoutparameter\c!preset]\relax
@@ -622,6 +676,7 @@
\global\topheight \layoutparameter\c!top
\global\backspace \layoutparameter\c!backspace
\global\topspace \layoutparameter\c!topspace
+ \global\textadaptive \layoutparameter\c!adaptive
\page_layouts_set_dimensions
\synchronizegridsnapping
\usesetupsparameter\layoutparameter % depends on gridsnapping !
@@ -646,7 +701,7 @@
\ifdim\scratchdimen<\zeropoint
\scratchdimen\zeropoint
\fi
- \global\advance\makeupwidth\dimexpr
+ \global\advanceby\makeupwidth\dimexpr
-\rightmargindistance-\rightmarginwidth
-\rightedgedistance -\rightedgewidth
-\scratchdimen\relax
@@ -683,7 +738,7 @@
\ifdim\scratchdimen<\zeropoint
\scratchdimen\zeropoint
\fi
- \global\advance\makeupheight\dimexpr-\bottomdistance-\bottomheight-\scratchdimen\relax
+ \global\advanceby\makeupheight\dimexpr-\bottomdistance-\bottomheight-\scratchdimen\relax
\else
\global\makeupheight\layoutparameter\c!height\relax
\ifzeropt\bottomspace
@@ -731,9 +786,9 @@
\ifx\p_direction\v!reverse
\enforced\global\swapcsvalues\naturalleftedgedistance \naturalrightedgedistance
\enforced\global\swapcsvalues\naturalleftmargindistance\naturalrightmargindistance
- \enforced\global\swapcsvalues\leftedgedistance \rightedgedistance
\enforced\global\swapcsvalues\leftmargindistance \rightmargindistance
\enforced\global\swapcsvalues\leftmarginwidth \rightmarginwidth
+ \enforced\global\swapcsvalues\leftedgedistance \rightedgedistance
\enforced\global\swapcsvalues\leftedgewidth \rightedgewidth
\enforced\global\swapcsvalues\backspace \cutspace
\expandafter\setsystemmode
@@ -746,7 +801,7 @@
\global\layoutcolumndistance\layoutparameter\c!columndistance
\global\layoutcolumnwidth\dimexpr\makeupwidth-\layoutcolumns\layoutcolumndistance+\layoutcolumndistance\relax
\ifnum\layoutcolumns>\plusone
- \global\divide\layoutcolumnwidth\layoutcolumns
+ \global\divideby\layoutcolumnwidth\layoutcolumns
\dorecurse\layoutcolumns\page_layouts_check_pseudo_column
\fi}
@@ -754,11 +809,14 @@
{\xdefcsname\??layoutcolumn\recurselevel\endcsname
{\the\numexpr\recurselevel-\plusone\relax\dimexpr\layoutcolumnwidth+\layoutcolumndistance\relax}}
-\letvalue{\??layoutcolumn0}\zeropoint
+\aliased\letcsname\??layoutcolumn0\endcsname\zeropoint
\permanent\def\layoutcolumnoffset#1% can travel around so we can't use \lastnamedcs
{\csname\??layoutcolumn\ifcsname\??layoutcolumn#1\endcsname#1\else0\fi\endcsname}
+\permanent\protected\def\layoutlineoffset#1%
+ {\the\dimexpr\topskip-\strutht+#1\lineheight-\lineheight\relax}
+
\def\page_layouts_synchronize_at_start
{\ifdim\makeupheight=\layoutlines\lineheight \else % weird check
\page_layouts_synchronize
@@ -824,8 +882,40 @@
\glet\v_page_layouts_pre_check\relax
\page_layouts_synchronize}
+% \def\page_layouts_check_default
+% {\ifcsname\namedlayouthash\v_real_page_normal\c!state\endcsname
+% \page_layouts_check_default_indeed\v_real_page_normal
+% \orelse\ifcsname\namedlayouthash\v_real_page_reverse\c!state\endcsname
+% \page_layouts_check_default_indeed\v_real_page_reverse
+% \orelse\ifcsname\namedlayouthash\v_real_page_named\c!state\endcsname
+% \page_layouts_check_default_indeed\v_real_page_named
+% \orelse\ifcsname\namedlayouthash\v_real_page_current\c!state\endcsname
+% \page_layouts_check_default_indeed\v_real_page_current
+% \orelse\ifcsname\namedlayouthash\v_real_page_odd_or_even\c!state\endcsname
+% \page_layouts_check_default_indeed\v_real_page_odd_or_even
+% \orelse\ifrelax\v_page_layouts_pre_check
+% % okay
+% \else
+% \page_layouts_check_revert
+% \fi}
+
+% \showframe
+%
+% \setuplayout [width=100mm,height=200mm]
+% \definelayout[shorta][height=80mm]
+% \definelayout[shortb][height=130mm]
+%
+% \starttext
+% \definelayout[2][shorta] \definelayout[4][shortb]
+% \definelayout[7][shorta] \definelayout[8][shortb] % we need to check before
+% \dorecurse{20}{#1: \samplefile{knuth}\par}
+% \stoptext
+
\def\page_layouts_check_default
- {\ifcsname\namedlayouthash\v_real_page_normal\c!state\endcsname
+ {\ifrelax\v_page_layouts_pre_check\else
+ \page_layouts_check_revert
+ \fi
+ \ifcsname\namedlayouthash\v_real_page_normal\c!state\endcsname
\page_layouts_check_default_indeed\v_real_page_normal
\orelse\ifcsname\namedlayouthash\v_real_page_reverse\c!state\endcsname
\page_layouts_check_default_indeed\v_real_page_reverse
@@ -835,10 +925,10 @@
\page_layouts_check_default_indeed\v_real_page_current
\orelse\ifcsname\namedlayouthash\v_real_page_odd_or_even\c!state\endcsname
\page_layouts_check_default_indeed\v_real_page_odd_or_even
- \orelse\ifrelax\v_page_layouts_pre_check
- % okay
- \else
- \page_layouts_check_revert
+ % \orelse\ifrelax\v_page_layouts_pre_check
+ % % okay
+ % \else
+ % \page_layouts_check_revert
\fi}
\permanent\protected\def\installlayoutmethod#1#2%
@@ -847,13 +937,6 @@
\installlayoutmethod\v!default{\page_layouts_check_default}
\installlayoutmethod\v!normal {\page_layouts_check_default}
-% \def\page_layouts_check_next
-% {\csname\??layoutmethod\ifcsname\??layoutmethod\layoutparameter\c!method\endcsname
-% \layoutparameter\c!method
-% \else
-% \v!normal
-% \fi\endcsname}
-
\permanent\protected\def\page_layouts_check_next
{\ifcsname\??layoutmethod\layoutparameter\c!method\endcsname
\lastnamedcs
@@ -907,41 +990,55 @@
{\setfalse\c_page_layouts_location_is_set
\setfalse\c_page_layouts_location_is_middle
\let\v_page_target_left_fill \relax
- \let\v_page_target_right_fill \hss % ? \relax
+ \let\v_page_target_right_fill \hss % ? \relax
\let\v_page_target_top_fill \relax
\let\v_page_target_bottom_fill\vss} % \relax}
-\setvalue{\??layoutlocation\v!right }{\settrue\c_page_layouts_location_is_set
- \setfalse\c_page_layouts_location_is_middle
- \let\v_page_target_left_fill \hss
- \let\v_page_target_right_fill \relax}
-\setvalue{\??layoutlocation\v!left }{\settrue\c_page_layouts_location_is_set
- \setfalse\c_page_layouts_location_is_middle
- \let\v_page_target_left_fill \relax
- \let\v_page_target_right_fill \hss}
-\setvalue{\??layoutlocation\v!bottom }{\settrue\c_page_layouts_location_is_set
- \setfalse\c_page_layouts_location_is_middle
- \let\v_page_target_top_fill \vss
- \let\v_page_target_bottom_fill\relax}
-\setvalue{\??layoutlocation\v!top }{\settrue\c_page_layouts_location_is_set
- \setfalse\c_page_layouts_location_is_middle
- \let\v_page_target_top_fill \relax
- \let\v_page_target_bottom_fill\vss}
-\setvalue{\??layoutlocation\v!middle }{\settrue\c_page_layouts_location_is_set
- \settrue\c_page_layouts_location_is_middle
- \let\v_page_target_left_fill \hss
- \let\v_page_target_right_fill \hss
- \let\v_page_target_top_fill \vss
- \let\v_page_target_bottom_fill\vss}
-\setvalue{\??layoutlocation\empty }{\setfalse\c_page_layouts_location_is_set % default also signal to scrn_
- \setfalse\c_page_layouts_location_is_middle
- \let\v_page_target_right_fill \hss
- \let\v_page_target_bottom_fill\hss}
-\setvalue{\??layoutlocation\v!doublesided}{\settrue \c_page_target_print_doublesided}
-\setvalue{\??layoutlocation\v!singlesided}{\setfalse\c_page_target_print_doublesided}
+\defcsname\??layoutlocation\v!right\endcsname
+ {\settrue\c_page_layouts_location_is_set
+ \setfalse\c_page_layouts_location_is_middle
+ \let\v_page_target_left_fill \hss
+ \let\v_page_target_right_fill\relax}
+
+\defcsname\??layoutlocation\v!left\endcsname
+ {\settrue\c_page_layouts_location_is_set
+ \setfalse\c_page_layouts_location_is_middle
+ \let\v_page_target_left_fill \relax
+ \let\v_page_target_right_fill\hss}
+
+\defcsname\??layoutlocation\v!bottom\endcsname
+ {\settrue\c_page_layouts_location_is_set
+ \setfalse\c_page_layouts_location_is_middle
+ \let\v_page_target_top_fill \vss
+ \let\v_page_target_bottom_fill\relax}
+
+\defcsname\??layoutlocation\v!top\endcsname
+ {\settrue\c_page_layouts_location_is_set
+ \setfalse\c_page_layouts_location_is_middle
+ \let\v_page_target_top_fill \relax
+ \let\v_page_target_bottom_fill\vss}
+
+\defcsname\??layoutlocation\v!middle\endcsname
+ {\settrue\c_page_layouts_location_is_set
+ \settrue\c_page_layouts_location_is_middle
+ \let\v_page_target_left_fill \hss
+ \let\v_page_target_right_fill \hss
+ \let\v_page_target_top_fill \vss
+ \let\v_page_target_bottom_fill\vss}
+
+\defcsname\??layoutlocation\empty\endcsname
+ {\setfalse\c_page_layouts_location_is_set % default also signal to scrn_
+ \setfalse\c_page_layouts_location_is_middle
+ \let\v_page_target_right_fill \hss
+ \let\v_page_target_bottom_fill\hss}
+
+\defcsname\??layoutlocation\v!doublesided\endcsname
+ {\settrue\c_page_target_print_doublesided}
+
+\defcsname\??layoutlocation\v!singlesided\endcsname
+ {\setfalse\c_page_target_print_doublesided}
\def\page_target_check_centering_indeed#1%
- % {\ifcsname\??layoutlocation#1\endcsname\csname\??layoutlocation#1\endcsname\fi}
{\begincsname\??layoutlocation#1\endcsname}
\protected\def\page_target_check_centering
@@ -967,13 +1064,6 @@
\installlayoutalternative\v!default{\page_boxes_construct_content_default}
\installlayoutalternative\v!normal {\page_boxes_construct_content_default}
-% \def\page_boxes_construct_content % targetbox flusher box
-% {\csname\??layoutalternative\ifcsname\??layoutalternative\layoutparameter\c!alternative\endcsname
-% \layoutparameter\c!alternative
-% \else
-% \v!normal
-% \fi\endcsname}
-
\def\page_boxes_construct_content % targetbox flusher box
{\ifcsname\??layoutalternative\layoutparameter\c!alternative\endcsname
\expandafter\lastnamedcs
@@ -984,15 +1074,19 @@
%D \macros
%D {adaptlayout}
+% this will move to lua
+
\installcorenamespace{adaptlayout}
\installcorenamespace{pageadaptations}
\installsetuponlycommandhandler \??adaptlayout {adaptlayout}
-\newdimen\d_page_adepts_pushed_text_height
-\newdimen\d_page_adepts_pushed_footer_height
-\newdimen\d_page_adepts_height
-\newdimen\d_page_adapts_delta
+\newdimension\d_page_adapts_pushed_text_height
+\newdimension\d_page_adapts_pushed_footer_height
+\newdimension\d_page_adapts_height
+\newdimension\d_page_adapts_delta
+
+\appendtoks \global\d_page_adapts_delta\zeropoint \to \everyshipout
\permanent\protected\tolerant\def\adaptlayout[#1]#*[#2]%
{\ifparameter#2\or
@@ -1008,42 +1102,37 @@
\let\p_adapts_height\zeropoint
\let\p_adapts_lines \zerocount
-\def\page_adapts_layout_indeed#1%
- {\setupcurrentadaptlayout[\c!height=\zeropoint,\c!lines=\zerocount,#1]%
- \page_adepts_push
+\def\page_adapts_layout_indeed#1% called often
+ {\setupcurrentadaptlayout[\c!height=\zeropoint,\c!lines=\zerocount,\c!top=\zeropoint,#1]%
+ \page_adapts_push
\edef\p_adapts_height{\adaptlayoutparameter\c!height}%
\edef\p_adapts_lines {\adaptlayoutparameter\c!lines}%
\ifx\p_adapts_height\v!max
- \global\d_page_adepts_height\footerheight
+ \global\d_page_adapts_height\footerheight
\else
- \global\d_page_adepts_height\dimexpr
+ \global\d_page_adapts_height\dimexpr
\ifnum\p_adapts_lines=\zerocount
\p_adapts_height
\else
\p_adapts_lines\openlineheight
\fi
\relax
- \ifdim\d_page_adepts_height>\footerheight
- \global\d_page_adepts_height\footerheight
+ \ifdim\d_page_adapts_height>\footerheight
+ \global\d_page_adapts_height\footerheight
\fi
\fi
- \global\advance\textheight \d_page_adepts_height
- \global\advance\footerheight-\d_page_adepts_height
- \showmessage\m!layouts1{\the\d_page_adepts_height,\the\realpageno}%
+ %
+ \global\d_page_adapts_delta-\dimexpr\adaptlayoutparameter\c!top\relax
+ %
+ \global\advanceby\textheight \d_page_adapts_height
+ \global\advanceby\footerheight-\d_page_adapts_height
+ \showmessage\m!layouts1{\the\dimexpr\d_page_adapts_height,\the\realpageno}%
% this will become a better one (do we need insert correction?)
\page_otr_command_set_vsize
%
\page_backgrounds_recalculate
- \glet\page_adepts_push\relax
- \glet\page_adepts_pop\page_adepts_pop_indeed}
-
-% \def\page_adapts_check
-% {\csname\??pageadaptations\the\ifcsname\??pageadaptations\the\realpageno\endcsname\realpageno\else\zerocount\fi\endcsname}
-%
-% \def\page_adapts_reset
-% {\ifcsname\??pageadaptations\the\realpageno\endcsname
-% \global\undefinevalue{\??pageadaptations\the\realpageno}%
-% \fi}
+ \glet\page_adapts_push\relax
+ \glet\page_adapts_pop\page_adapts_pop_indeed}
\def\page_adapts_check
{\begincsname\??pageadaptations\the\realpageno\endcsname}
@@ -1053,30 +1142,30 @@
\gletcsname\??pageadaptations\the\realpageno\endcsname\relax
\fi}
-\def\page_adepts_push_indeed
- {\global\d_page_adepts_pushed_text_height \textheight
- \global\d_page_adepts_pushed_footer_height\footerheight}
+\def\page_adapts_push_indeed
+ {\global\d_page_adapts_pushed_text_height \textheight
+ \global\d_page_adapts_pushed_footer_height\footerheight}
-\def\page_adepts_pop_indeed
- {\global\textheight \d_page_adepts_pushed_text_height
- \global\footerheight\d_page_adepts_pushed_footer_height
+\def\page_adapts_pop_indeed
+ {\global\textheight \d_page_adapts_pushed_text_height
+ \global\footerheight\d_page_adapts_pushed_footer_height
\page_layouts_synchronize
- \glet\page_adepts_push\page_adepts_push_indeed
- \glet\page_adepts_pop\relax}
+ \glet\page_adapts_push\page_adapts_push_indeed
+ \glet\page_adapts_pop\relax}
\appendtoks \page_adapts_check \to \everystarttext
\appendtoks \page_adapts_reset \to \everyshipout
-\let\page_adepts_pop \relax
-\let\page_adepts_push\page_adepts_push_indeed
+\let\page_adapts_pop \relax
+\let\page_adapts_push\page_adapts_push_indeed
\protected\def\page_adapts_synchronize % used elsewhere
- {\page_adepts_pop
+ {\page_adapts_pop
\page_adapts_check}
\def\page_adapts_status_info % used elsewhere
- {\ifrelax\page_adepts_pop \else
- \space(adept: \the\d_page_adepts_height)\space
+ {\ifrelax\page_adapts_pop \else
+ \space(adept: \the\d_page_adapts_height)\space
\fi
\the\realpageno}
@@ -1099,10 +1188,10 @@
\let\doifelselayoutsomeline\secondofthreearguments
\fi
-\permanent\def\compensatevsizeheader {\advance\textheight-\dimexpr\headerheight+\headerdistance\relax}
-\permanent\def\compensatevsizefooter {\advance\textheight-\dimexpr\footerheight+\footerdistance\relax}
-\permanent\def\globalcompensatevsizeheader{\global\advance\textheight-\dimexpr\headerheight+\headerdistance\relax}
-\permanent\def\globalcompensatevsizefooter{\global\advance\textheight-\dimexpr\footerheight+\footerdistance\relax}
+\permanent\def\compensatevsizeheader {\advanceby\textheight-\dimexpr\headerheight+\headerdistance\relax}
+\permanent\def\compensatevsizefooter {\advanceby\textheight-\dimexpr\footerheight+\footerdistance\relax}
+\permanent\def\globalcompensatevsizeheader{\global\advanceby\textheight-\dimexpr\headerheight+\headerdistance\relax}
+\permanent\def\globalcompensatevsizefooter{\global\advanceby\textheight-\dimexpr\footerheight+\footerdistance\relax}
\permanent\def\compensatevsizeheaderzero{\headerheight\zeropoint\page_layouts_set_distances}
\permanent\def\compensatevsizefooterzero{\footerheight\zeropoint\page_layouts_set_distances}
@@ -1139,8 +1228,8 @@
\doifelselayoutsomeline\v!header\compensatevsizeheader\compensatevsizeheaderzero
\doifelselayoutsomeline\v!footer\compensatevsizefooter\compensatevsizefooterzero}
-\newdimen\innermakeupwidth % special purpose
-\newdimen\innermakeupmargin % special purpose
+\newdimension\innermakeupwidth % special purpose
+\newdimension\innermakeupmargin % special purpose
\newconditional\innermakeupcompensation \settrue\innermakeupcompensation
@@ -1161,8 +1250,8 @@
\global\innermakeupmargin\m_currentlayout_text_margin\relax
\fi
\scratchdimen\dimexpr\innermakeupmargin+\innermakeupmargin\relax
- \global\advance\innermakeupwidth-\scratchdimen
- \advance\textwidth-\scratchdimen} % local
+ \global\advanceby\innermakeupwidth-\scratchdimen
+ \advanceby\textwidth-\scratchdimen} % local
\permanent\protected\def\calculatehsizes % name will change
{\freezetextwidth
@@ -1220,7 +1309,7 @@
\expandafter\page_layouts_if_odd_else_again
\fi}
-\newdimen\texthoffset
+\newdimension\texthoffset
\permanent\protected\def\settexthoffset % name will change
{\texthoffset\doifbothsides\backspace\backspace{\dimexpr\paperwidth-\backspace-\makeupwidth\relax}}
@@ -1234,13 +1323,16 @@
\aliased\let\doifmarginswapelse\doifelsemarginswap
\protected\def\page_layouts_swap_margins % name will change, frozen?
- {\doifelsemarginswap\relax\page_layouts_swap_margins_indeed}
+ {\doifelsemarginswap\gobbleoneargument\page_layouts_swap_margins_indeed}
-\protected\def\page_layouts_swap_margins_indeed
- {\let\page_layouts_swap_margins \relax % to prevent local swapping
- \let\page_layouts_swap_margins_indeed\relax % to prevent local swapping
+\protected\def\page_layouts_swap_margins_indeed#1%
+ {\let\page_layouts_swap_margins\gobbleoneargument % to prevent local swapping
+ %\writestatus\m!layouts{swapping margins for #1}%
\the\everyswapmargins}
+\permanent\protected\def\swapmargindimensions
+ {\page_layouts_swap_margins\v!page}
+
\permanent\def\rightorleftpageaction
{\ifdoublesided
\expandafter\page_layouts_right_or_left_page_action
@@ -1320,17 +1412,27 @@
%D %showsetup{showgrid}
%D %showsetup{showusage}
-\fetchmodulecommand \showprint \f!page_run
-\fetchmodulecommand \showframe \f!page_run
-\fetchmodulecommand \showlayout \f!page_run
-\fetchmodulecommand \showsetups \f!page_run
-\fetchmodulecommand \showmargins \f!page_run
-\fetchmodulecommand \showgrid \f!page_run
+\fetchmodulecommand \showprint \f!page_run
+\fetchmodulecommand \showframe \f!page_run
+\fetchmodulecommand \showlayout \f!page_run
+\fetchmodulecommand \showsetups \f!page_run
+\fetchmodulecommand \showmargins \f!page_run
+\fetchmodulecommand \showgrid \f!page_run
+\fetchmodulecommand \showcentering\f!page_run
\glet\page_grids_add_to_box\gobbleoneargument
\glet\page_grids_add_to_one\gobbleoneargument
\glet\page_grids_add_to_mix\gobbleoneargument
+%D Play safe:
+
+\appendtoks
+ \ifnum\realpageno>\plusone
+ \page[\v!odd]%
+ \setuplayout
+ \fi
+\to \everysetuppagenumbering
+
%D The default dimensions are quite old and will not change. The funny fractions
%D were introduced when we went from fixed dimensions to relative ones. Since
%D \CONTEXT\ is a dutch package, the dimensions are based on the metric system. The
@@ -1392,8 +1494,9 @@
\c!setups=\systemsetupsprefix\s!default,
\c!clipoffset=\zeropoint,
\c!lines=0,
- \c!paper=, % for foxet
- \c!page=, % for foxet
+ \c!paper=,
+ \c!page=,
+ \c!adaptive=\zeropoint, % new: experiment
\c!columns=\plusone,
\c!columndistance=\zeropoint]
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-lin.mklx b/Master/texmf-dist/tex/context/base/mkxl/page-lin.mklx
index 3b3a3d71b73..71a0e0c6eda 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-lin.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-lin.mklx
@@ -56,7 +56,7 @@
\mutable\let\linenumber\!!zerocount
\newbox \b_page_lines_scratch
-\newcount \c_page_lines_reference
+\newinteger \c_page_lines_reference
\newconstant\c_page_lines_nesting
\newconditional\tracelinenumbering % we keep this for old times sake
@@ -94,9 +94,10 @@
\glet\page_postprocessors_linenumbers_column \page_postprocessors_linenumbers_column_indeed}
\def\page_lines_start_define
- {\setxvalue{\??linenumberinginstance\currentlinenumbering}%
+ {\xdefcsname\??linenumberinginstance\currentlinenumbering\endcsname
{\clf_registerlinenumbering
- continue {\ifnum\c_page_lines_mode=\zerocount\v!yes\else\v!no\fi}%
+ % continue {\ifnum\c_page_lines_mode=\zerocount\v!yes\else\v!no\fi}%
+ continue {\ifzero\c_page_lines_mode\v!yes\else\v!no\fi}%
start \linenumberingparameter\c!start
step \linenumberingparameter\c!step
method {\linenumberingparameter\c!method}%
@@ -107,7 +108,8 @@
{\clf_setuplinenumbering
\csname\??linenumberinginstance\currentlinenumbering\endcsname
{%
- continue {\ifnum\c_page_lines_mode=\zerocount\v!yes\else\v!no\fi}%
+ % continue {\ifnum\c_page_lines_mode=\zerocount\v!yes\else\v!no\fi}%
+ continue {\ifzero\c_page_lines_mode\v!yes\else\v!no\fi}%
}%
\relax}
@@ -116,7 +118,8 @@
\clf_setuplinenumbering
\lastnamedcs
{%
- continue {\ifnum\c_page_lines_mode=\zerocount\v!yes\else\v!no\fi}%
+ % continue {\ifnum\c_page_lines_mode=\zerocount\v!yes\else\v!no\fi}%
+ continue {\ifzero\c_page_lines_mode\v!yes\else\v!no\fi}%
start \linenumberingparameter\c!start
step \linenumberingparameter\c!step
method {\linenumberingparameter\c!method}%
@@ -130,7 +133,7 @@
\protected\def\page_lines_some_reference#1#2#3%
{\dontleavehmode\begingroup
- \global\advance\c_page_lines_reference\plusone
+ \global\advanceby\c_page_lines_reference\plusone
\c_attr_linereference\c_page_lines_reference
#3% todo: #3{#1} as there is no need to pass #1 as part of #3
% for the moment we use a simple system i.e. no prefixes etc .. todo: store as number
@@ -155,8 +158,10 @@
\setnewconstant\c_page_lines_location \plusone % 0=middle, 1=left, 2=right, 3=inner, 4=outer, 5=text, 6=begin, 7=end
\setnewconstant\c_page_lines_alignment\plusfive % 0=middle, 1=left, 2=right, 5=auto
-\newdimen\d_page_lines_width
-\newdimen\d_page_lines_distance
+\newdimension \d_page_lines_width
+\newdimension \d_page_lines_distance
+
+\newinteger \c_pages_lines_nesting
\newevery \beforeeverylinenumbering \relax
\newevery \aftereverylinenumbering \relax
@@ -193,12 +198,10 @@
% \startlinenumbering[<startvalue>|continue|settings|name]
% \startlinenumbering[name][<startvalue>|continue|settings]
-\newcount\c_pages_lines_nesting
-
\permanent\tolerant\protected\def\startlinenumbering[#1]#*[#2]%
{\begingroup
\page_postprocessors_linenumbers_check
- \advance\c_pages_lines_nesting\plusone
+ \advanceby\c_pages_lines_nesting\plusone
\ifnum\c_pages_lines_nesting>\plusone
\expandafter\gobbletwooptionals
\orelse\ifparameter#2\or
@@ -222,17 +225,17 @@
{\edef\m_argument{#1}%
\ifx\m_argument\v!continue
\c_page_lines_mode\zerocount
- \let\currentlinenumbering\empty
+ \lettonothing\currentlinenumbering
\else
\c_page_lines_mode\plusone
\ifx\m_argument\v!empty
- \let\currentlinenumbering\empty
+ \lettonothing\currentlinenumbering
\orelse\ifhastok={#1}%
- \let\currentlinenumbering\empty
+ \lettonothing\currentlinenumbering
\setupcurrentlinenumbering[#1]%
\else
\doifelsenumber\m_argument
- {\let\currentlinenumbering\empty
+ {\lettonothing\currentlinenumbering
\letlinenumberingparameter\c!start\m_argument}
{\let\currentlinenumbering\m_argument}%
\fi
@@ -285,17 +288,17 @@
\ifhmode \else
\ifx\p_location\v!text
\ifdim\leftskip>\zeropoint \else
- \advance\leftskip\linenumberingparameter\c!margin
+ \advanceby\leftskip\linenumberingparameter\c!margin
\settrue\c_page_lines_auto_narrow
\fi
\orelse\ifx\p_location\v!begin
\ifdim\leftskip>\zeropoint \else
- \advance\leftskip\linenumberingparameter\c!margin
+ \advanceby\leftskip\linenumberingparameter\c!margin
\settrue\c_page_lines_auto_narrow
\fi
\orelse\ifx\p_location\v!end
\ifdim\leftskip>\zeropoint \else
- \advance\rightskip\linenumberingparameter\c!margin
+ \advanceby\rightskip\linenumberingparameter\c!margin
\settrue\c_page_lines_auto_narrow
\fi
\fi
@@ -344,7 +347,9 @@
\def\page_lines_add_numbers_to_box#box#column#max#nesting%
{\bgroup
- \strc_tags_enable_indeed
+ \ifconditional\c_strc_tags_enabled
+ \strc_tags_enable_indeed
+ \fi
\b_page_lines_number #box\relax
\c_page_lines_column #column\relax
\c_page_lines_last_column#max\relax
@@ -466,13 +471,13 @@
\dostoptagged}%
\dostoptagged}
-\setuvalue{\??linenumberinghandler\v!left}%
+\protected\defcsname\??linenumberinghandler\v!left\endcsname
{\page_line_handle_left\p_align\leftmarginwidth\leftmargindistance}
-\setuvalue{\??linenumberinghandler\v!right}%
+\protected\defcsname\??linenumberinghandler\v!right\endcsname
{\page_line_handle_right\p_align\rightmarginwidth\rightmargindistance}
-\setuvalue{\??linenumberinghandler\v!inner}%
+\protected\defcsname\??linenumberinghandler\v!inner\endcsname
{\ifodd\realpageno
\ifx\p_align\v!inner
\page_line_handle_left\v!flushleft\leftmarginwidth\leftmargindistance
@@ -491,7 +496,7 @@
\fi
\fi}
-\setuvalue{\??linenumberinghandler\v!outer}%
+\protected\defcsname\??linenumberinghandler\v!outer\endcsname
{\ifodd\realpageno
\ifx\p_align\v!inner
\page_line_handle_right\v!flushleft\leftmarginwidth\leftmargindistance
@@ -572,8 +577,8 @@
\permanent\def\currentreferencelinenumber{\clf_filterreference{linenumber}}
-\let\m_page_lines_from\empty
-\let\m_page_lines_to \empty
+\lettonothing\m_page_lines_from
+\lettonothing\m_page_lines_to
\permanent\protected\def\doifelsesamelinereference#1#2#3%
{\doifelsereferencefound{lr:b:#1}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-mak.mklx b/Master/texmf-dist/tex/context/base/mkxl/page-mak.mklx
index 2a5cd435218..f0d01cc362c 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-mak.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-mak.mklx
@@ -184,11 +184,11 @@
\normalexpanded{\setuplayout[\m_page_makeup_name][\s!parent=\??layout]}% is remembered but checked later anyway
\fi}
-\setvalue{\??makeupdoublesided\v!yes}%
+\defcsname\??makeupdoublesided\v!yes\endcsname
{\emptyhbox
\page}
-\setvalue{\??makeupdoublesided\v!empty}%
+\defcsname\??makeupdoublesided\v!empty\endcsname
{\the\t_page_makeup_every_setup
% == \page[\v!dummy]
\page[\v!blank]%
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-mbk.mklx b/Master/texmf-dist/tex/context/base/mkxl/page-mbk.mklx
index 05b09c79e87..57c23abc6e3 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-mbk.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-mbk.mklx
@@ -69,6 +69,12 @@
\c!inbetween=\blank,
\c!bottom=\vfill]
+\definesystemconstant{marginblock}
+
+\resetboxesincache \s!marginblock \s!marginblock
+
+\setfalse\c_page_margin_blocks_enabled
+
\permanent\tolerant\protected\def\startmarginblock[#tag]%
{\begingroup
\edef\currentmarginblock{#tag}%
@@ -77,60 +83,45 @@
\page_margin_blocks_start_block_nop}
\permanent\protected\def\stopmarginblock
- {\doifelse{\marginblockparameter\c!state}\v!start
- \page_margin_blocks_stop_block_yes
- \page_margin_blocks_stop_block_nop
+ {\page_margin_blocks_stop_block
\endgroup}
-\def\page_margin_blocks_start_block_yes % 2 maal \vbox ivm \unvbox elders
- {\showmessage\m!layouts4\empty
- \global\settrue\c_page_margin_blocks_present
- \global\setbox\b_page_margin_blocks\vtop\bgroup\vbox\bgroup
- \hsize\marginblockparameter\c!width
- \ifvoid\b_page_margin_blocks\else
- \unvbox\b_page_margin_blocks
- \marginblockparameter\c!inbetween
- \fi
- \usealignparameter\marginblockparameter
- \usemarginblockstyleandcolor\c!style\c!color
- \begstrut
- \ignorespaces}
+\def\page_margin_blocks_start_block_yes
+ {%\showmessage\m!layouts4\empty
+ \global\settrue\c_page_margin_blocks_enabled
+ \dowithnextboxcs
+ \page_margin_blocks_start_block_save
+ \vbox\bgroup
+ \let\page_margin_blocks_stop_block\page_margin_blocks_stop_block_yes
+ \hsize\marginblockparameter\c!width
+ \usealignparameter\marginblockparameter
+ \usemarginblockstyleandcolor\c!style\c!color
+ \begstrut
+ \ignorespaces}
\def\page_margin_blocks_stop_block_yes
{\removeunwantedspaces
\endstrut
- \egroup
\egroup}
+\def\page_margin_blocks_start_block_save
+ {\putboxincache\s!marginblock{+}\nextbox}
+
\def\page_margin_blocks_start_block_nop
- {\showmessage\m!layouts5\empty
+ {%\showmessage\m!layouts5\empty
\marginblockparameter\c!before
\bgroup
+ \let\page_margin_blocks_stop_block\page_margin_blocks_stop_block_nop
\usemarginblockstyleandcolor\c!style\c!color}
\def\page_margin_blocks_stop_block_nop
{\egroup
\marginblockparameter\c!after}
-\def\page_margin_blocks_reshape
- {\ifdim\ht\b_page_margin_blocks_prepared>\zeropoint
- \beginofshapebox
- \unvbox\b_page_margin_blocks_prepared
- \endofshapebox
- \reshapebox
- {\box\shapebox}%
- \setbox\b_page_margin_blocks_prepared\vbox to \textheight
- {\marginblockparameter\c!top
- \flushshapebox
- \marginblockparameter\c!bottom}%
- \fi}
-
\permanent\protected\def\checkmarginblocks
- {\ifvoid\b_page_margin_blocks
- \global\setfalse\c_page_margin_blocks_present
- \else
- \page_margin_blocks_check_indeed
- \fi}
+ {\ifconditional\c_page_margin_blocks_enabled\ifcase\getboxcountfromcache\s!marginblock\else
+ \expandafter\page_margin_blocks_check_indeed
+ \fi\fi}
\def\page_margin_blocks_check_indeed
{\ifcsname\??marginblocklocation\marginblockparameter\c!location\endcsname
@@ -138,39 +129,58 @@
\csname\??marginblocklocation\marginblockparameter\c!location\endcsname
\else
\global\setbox\b_page_margin_blocks\emptybox
- \global\setfalse\c_page_margin_blocks_present
\fi}
\def\page_margin_blocks_prepare_box
- {\setbox\b_page_margin_blocks_prepared\vbox
- {\forgetall
- \splittopskip\topskip
- \ifvoid\b_page_margin_blocks\else
- \ifdim\ht\b_page_margin_blocks>\textheight
- \vsplit\b_page_margin_blocks to \textheight
- \else
- \unvbox\b_page_margin_blocks
- \fi
+ {\begingroup
+ \scratchcounter\zerocount
+ \localcontrolledloop \plusone \getboxcountfromcache\s!marginblock \plusone
+ {\scratchcounter\currentloopiterator
+ \setbox\scratchbox\vbox\bgroup
+ \marginblockparameter\c!top
+ \localcontrolledloop \plusone \scratchcounter \plusone
+ {\ifcase\currentloopiterator\or
+ \marginblockparameter\c!before
+ \else
+ \marginblockparameter\c!inbetween
+ \fi
+ \setbox\scratchbox\emptyvbox
+ \ht\scratchbox\getboxhtfromcache\s!marginblock{\number\currentloopiterator}%
+ \dp\scratchbox\getboxdpfromcache\s!marginblock{\number\currentloopiterator}%
+ \box\scratchbox
+ \marginblockparameter\c!after}%
+ \marginblockparameter\c!bottom
+ \egroup
+ \ifdim\htdp\scratchbox>\textheight
+ \advanceby\scratchcounter\minusone
+ %\writestatus{quit}{\the\scratchcounter=>\the\htdp\scratchbox}
+ \quitloop
+ \else
+ %\writestatus{progress}{\the\htdp\scratchbox}
\fi}%
- \page_margin_blocks_reshape
- \setbox\b_page_margin_blocks_prepared\vbox
- {\marginblockparameter\c!before
- \box\b_page_margin_blocks_prepared
- \marginblockparameter\c!after}}
+ \ifcase\scratchcounter\else
+ \global\setbox\b_page_margin_blocks_prepared\vbox to \textheight\bgroup
+ \marginblockparameter\c!top
+ \localcontrolledloop \plusone \scratchcounter \plusone
+ {\ifcase\currentloopiterator\or
+ \marginblockparameter\c!before
+ \else
+ \marginblockparameter\c!inbetween
+ \fi
+ \getboxfromcache\s!marginblock{\number\currentloopiterator}\scratchbox
+ \box\scratchbox
+ \marginblockparameter\c!after}%
+ \marginblockparameter\c!bottom
+ \egroup
+ \pruneboxesincache\s!marginblock
+ \ifcase\getboxcountfromcache\s!marginblock\relax
+ \global\settrue\c_page_margin_blocks_enabled
+ \fi
+ \fi
+ \endgroup}
% inner outer
-\setvalue{\??marginblocklocation\v!left }{\page_margin_blocks_set_l_box}
-\setvalue{\??marginblocklocation\v!right }{\page_margin_blocks_set_r_box}
-\setvalue{\??marginblocklocation\v!inmargin}{\doifbothsidesoverruled
- \page_margin_blocks_set_r_box
- \page_margin_blocks_set_r_box
- \page_margin_blocks_set_l_box}
-\setvalue{\??marginblocklocation\v!middle }{\doifbothsidesoverruled
- \page_margin_blocks_set_r_box
- \page_margin_blocks_set_l_box
- \page_margin_blocks_set_r_box}
-
\permanent\protected\def\page_margin_blocks_place_r_yes
{\setbox\b_page_margin_blocks_prepared\hbox to \rightmarginwidth
{\marginblockparameter\c!left
@@ -196,6 +206,21 @@
\def\page_margin_blocks_set_r_box{\enforced\aliased\let\placerightmarginblock\page_margin_blocks_place_r_yes}
\def\page_margin_blocks_set_l_box{\enforced\aliased\let\placeleftmarginblock \page_margin_blocks_place_l_yes}
+\letcsname\??marginblocklocation\v!left \endcsname\page_margin_blocks_set_l_box
+\letcsname\??marginblocklocation\v!right\endcsname\page_margin_blocks_set_r_box
+
+\defcsname\??marginblocklocation\v!inmargin\endcsname
+ {\doifbothsidesoverruled
+ \page_margin_blocks_set_r_box
+ \page_margin_blocks_set_r_box
+ \page_margin_blocks_set_l_box}
+
+\defcsname\??marginblocklocation\v!middle\endcsname
+ {\doifbothsidesoverruled
+ \page_margin_blocks_set_r_box
+ \page_margin_blocks_set_l_box
+ \page_margin_blocks_set_r_box}
+
% margin floats (keyword 'margin' in option list)
\protected\def\page_margin_blocks_process_float
@@ -204,40 +229,41 @@
\page_margin_blocks_process_float_nop}
\def\page_margin_blocks_process_float_yes
- {\global\setbox\b_page_margin_blocks\vbox
- {\hsize\marginblockparameter\c!width
- \unvcopy\b_page_margin_blocks
- \ifvoid\b_page_margin_blocks\else
- \expandafter\marginblockparameter\expandafter\c!inbetween
- \fi
- \box\floatbox
- \filbreak}%
- \ifdim\ht\b_page_margin_blocks>\textheight
- % page_floats_report_saved % no saving done anyway
- \else
- \page_floats_report_total
- \fi}
+ {\global\settrue\c_page_margin_blocks_enabled
+ \putboxincache\s!marginblock{+}\floatbox}
\def\page_margin_blocks_process_float_nop
{\handlefloatmethod\v!here}
-\def\page_margin_blocks_float_before
- {\ifconditional\c_page_margin_blocks_enabled
- \doifinset\v!margin\floatlocation\endgraf
- \fi}
-
-\def\page_margin_blocks_float_set_hsize
- {\ifconditional\c_page_margin_blocks_enabled
- \doifinset\v!margin\floatlocation{\hsize\rootmarginblockparameter\c!width}%
- \fi}
-
\appendtoks
- \ifvoid\b_page_margin_blocks \else
+ \ifcase\getboxcountfromcache\s!marginblock\else
\writestatus\m!layouts{beware: there are left-over margin floats!}%
\fi
\to \everystoptext
\permanent\protected\def\flushmarginblocks
- {\page_otr_command_flush_margin_blocks}
+ {\ifconditional\c_page_margin_blocks_enabled
+ \page_otr_command_flush_margin_blocks
+ \fi}
+
+\permanent\tolerant\protected\def\flushallmarginblocks[#1]%
+ {\ifconditional\c_page_margin_blocks_enabled
+ \begingroup
+ \scratchcounterone\getboxcountfromcache\s!marginblock\relax
+ \ifcase\scratchcounterone\else
+ \scratchcountertwo\ifparameter#1\or\numexpr\scratchcounterone-#1+\plusone\relax\else\plusone\fi
+ \localcontrolledloop \scratchcountertwo \scratchcounterone \plusone
+ {\ifcase\currentloopiterator\or
+ \marginblockparameter\c!before
+ \else
+ \marginblockparameter\c!inbetween
+ \fi
+ \getboxfromcache\s!marginblock{\number\currentloopiterator}\scratchbox
+ \box\scratchbox
+ \marginblockparameter\c!after}%
+ \pruneboxesincache\s!marginblock
+ \fi
+ \endgroup
+ \fi}
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-mcl.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-mcl.mkxl
index d36e76d94f4..3faf13db7a1 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-mcl.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-mcl.mkxl
@@ -54,19 +54,19 @@
\installframedcommandhandler \??multicolumns {multicolumns} \??multicolumns
-\newdimen \d_page_mcl_available_width
-\newdimen \d_page_mcl_distance
-\newdimen \d_page_mcl_leftskip
-\newdimen \d_page_mcl_rightskip
-\newdimen \d_page_mcl_used_width
-\newdimen \d_page_mcl_temp
-\newdimen \d_page_mcl_saved_pagetotal % brrr, still needed ?
+\newdimension \d_page_mcl_available_width
+\newdimension \d_page_mcl_distance
+\newdimension \d_page_mcl_leftskip
+\newdimension \d_page_mcl_rightskip
+\newdimension \d_page_mcl_used_width
+\newdimension \d_page_mcl_temp
+\newdimension \d_page_mcl_saved_pagetotal % brrr, still needed ?
-\newcount \c_page_mcl_balance_minimum
-\newcount \c_page_mcl_n_of_lines
+\newinteger \c_page_mcl_balance_minimum
+\newinteger \c_page_mcl_n_of_lines
\newbox \b_page_mcl_preceding
-\newdimen \d_page_mcl_preceding_height
+\newdimension \d_page_mcl_preceding_height
\newconditional\c_page_mcl_preceding_present
\newbox \b_page_mcl_rest_of_page
@@ -85,10 +85,10 @@
\newbox \b_page_mcl_balance_content
\newconstant \c_page_mcl_balance_tries_max
-\newcount \c_page_mcl_balance_tries
-\newdimen \d_page_mcl_balance_target
-\newdimen \d_page_mcl_balance_natural_height
-\newdimen \d_page_mcl_balance_step
+\newinteger \c_page_mcl_balance_tries
+\newdimension \d_page_mcl_balance_target
+\newdimension \d_page_mcl_balance_natural_height
+\newdimension \d_page_mcl_balance_step
\newconditional\c_page_mcl_balance_possible
\c_page_mcl_balance_tries_max 250 % 100 is too small when floats are involved
@@ -125,6 +125,7 @@
\fi \fi
\c_page_mcl_n_of_lines\noflines}
+
% \protected\def\page_mcl_command_set_vsize
% {%%\page_one_command_set_vsize % indeed?
% \page_mcl_set_n_of_lines\zeropoint
@@ -187,7 +188,7 @@
{\scratchdimen\dimexpr
\d_page_mcl_saved_pagetotal
-\d_page_mcl_preceding_height
- -\topskip
+ % -\topskip % no, this is already part of the saved total
\relax
\box\b_page_mcl_preceding
\kern\scratchdimen}
@@ -293,7 +294,7 @@
\settrue\c_page_mcl_balance_possible
\else % check criterium to available lines
\getnoflines{\ht\b_page_mcl_balance_content}%
- \divide\noflines \nofcolumns \relax
+ \divideby\noflines \nofcolumns \relax
\ifnum\noflines<\c_page_mcl_balance_minimum \relax
\ifdim\dimexpr\ht\b_page_mcl_balance_content+\openlineheight\relax>\makeupheight
\settrue\c_page_mcl_balance_possible % column exceeding text height
@@ -325,7 +326,7 @@
\def\page_mcl_balance_try_one
{\d_page_mcl_balance_target\dimexpr\ht\b_page_mcl_balance_content+\topskip-\baselineskip\relax
- \divide\d_page_mcl_balance_target \nofcolumns
+ \divideby\d_page_mcl_balance_target \nofcolumns
\vbadness\plustenthousand
\c_page_mcl_balance_tries\zerocount
\bgroup
@@ -344,18 +345,18 @@
\egroup}
\def\page_mcl_balance_try_one_attempt
- {\advance\c_page_mcl_balance_tries \plusone
+ {\advanceby\c_page_mcl_balance_tries \plusone
\global\setbox\b_page_mcl_rest_of_page\copy\b_page_mcl_balance_content\relax
\dohandleallcolumns{\page_mcl_split_column\b_page_mcl_rest_of_page\d_page_mcl_balance_target}%
\d_page_mcl_balance_natural_height\zeropoint
\dohandleallcolumns\page_mcl_balance_try_one_attempt_step
-\advance\d_page_mcl_balance_natural_height-33\scaledpoint % some slack
+\advanceby\d_page_mcl_balance_natural_height-33\scaledpoint % some slack
\ifnum\c_page_mcl_balance_tries>\c_page_mcl_balance_tries_max\relax
\exitloop
\orelse\ifdim\ht\b_page_mcl_rest_of_page>\zeropoint
- \advance\d_page_mcl_balance_target\d_page_mcl_balance_step\relax
+ \advanceby\d_page_mcl_balance_target\d_page_mcl_balance_step\relax
\orelse\ifdim\d_page_mcl_balance_natural_height>\ht\firstcolumnbox\relax
- \advance\d_page_mcl_balance_target\d_page_mcl_balance_step\relax
+ \advanceby\d_page_mcl_balance_target\d_page_mcl_balance_step\relax
\else
\exitloop
\fi}
@@ -464,7 +465,7 @@
%
\reseteverypar % todo
%
- \ifdim\pagetotal=\zeropoint \else
+ \ifzeropt\pagetotal\else
\verticalstrut
\vskip-\struttotal
\fi
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-mix.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-mix.mkxl
index 433d94ab6bb..3d11794834c 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-mix.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-mix.mkxl
@@ -31,9 +31,23 @@
% offsets (inner ones, so we change the hsize ... needed with backgrounds
% when no content we currently loose the page
-% luatex buglet:
+% nasty test case from mailing list (rest issue)
%
-% \ctxlua{tex.setbox("global",0,node.hpack(nodes.pool.glyph("a",font.current())))}\box0
+% \starttext
+% . \blank[32*big]
+% \startitemize
+% \item 0 \startchoice[text] \item 0 \item 0 \item 0 \item 0 \stopchoice
+% \item 0 \startchoice \item 0 \item 0 \item 0 \item 0 \stopchoice
+% \item 0 \startchoice \item 0 \item 0 \item 0 \item 0 \stopchoice
+% \item 0 \startchoice \item 0 \item 0 \item 0 \item 0 \stopchoice
+% \item 0 \startchoice \item 0 \item 0 \item 0 \item 0 \stopchoice
+% \item 0 \startchoice \item 0 \item 0 \item 0 \item 0 \stopchoice
+% \item 0 \startchoice \item 0 \item 0 \item 0 \item 0 \stopchoice \blank[6*big]
+% \item 0 \startchoice \item 0 \item 0 \item 0 \item 0 \stopchoice
+% \item 0 \startchoice \item 0 \item 0 \item 0 \item 0 \stopchoice
+% \item 0 \startchoice \item 0 \item 0 \item 0 \item 0 \stopchoice
+% \stopitemize
+% \stoptext
\registerctxluafile{page-mix}{}
@@ -93,29 +107,29 @@
\appendtoks % could become an option
\ifcstok{\mixedcolumnsparameter\c!define}\v!yes
- \frozen\instance\setuevalue{\e!start\currentmixedcolumns}{\startmixedcolumns[\currentmixedcolumns]}%
- \frozen\instance\setuevalue{\e!stop \currentmixedcolumns}{\stopmixedcolumns}%
+ \frozen\instance\protected\edefcsname\e!start\currentmixedcolumns\endcsname{\startmixedcolumns[\currentmixedcolumns]}%
+ \frozen\instance\protected\edefcsname\e!stop \currentmixedcolumns\endcsname{\stopmixedcolumns}%
\fi
\to \everydefinemixedcolumns
%D In order to avoid a mixup we use quite some local registers.
-\newdimen \d_page_mix_column_width
-\newdimen \d_page_mix_max_height
-\newdimen \d_page_mix_max_width
-\newdimen \d_page_mix_distance
-\newcount \c_page_mix_n_of_columns
-\newdimen \d_page_mix_threshold
-\newdimen \d_page_mix_leftskip
-\newdimen \d_page_mix_rightskip
+\newdimension \d_page_mix_column_width
+\newdimension \d_page_mix_max_height
+\newdimension \d_page_mix_max_width
+\newdimension \d_page_mix_distance
+\newinteger \c_page_mix_n_of_columns
+\newdimension \d_page_mix_threshold
+\newdimension \d_page_mix_leftskip
+\newdimension \d_page_mix_rightskip
-\newdimen \d_page_mix_balance_step
+\newdimension \d_page_mix_balance_step
\setnewconstant\c_page_mix_balance_cycles 500
\setnewconstant\c_page_mix_break_forced -123
\newbox \b_page_mix_preceding
-\newdimen \d_page_mix_preceding_height
+\newdimension \d_page_mix_preceding_height
\newbox \b_page_mix_collected
@@ -248,7 +262,7 @@
\global\setbox\b_page_mix_preceding\vbox % pack ?
{\forgetall
\page_otr_command_flush_top_insertions
- \ifdim\htdp\b_page_mix_preceding=\zeropoint \else
+ \ifzeropt\htdp\b_page_mix_preceding\else
\writestatus\m!columns{preceding error}%
\unvbox\b_page_mix_preceding
\fi
@@ -342,7 +356,7 @@
\installcorenamespace{mixedcolumnsseparator}
\permanent\protected\def\installmixedcolumnseparator#1#2%
- {\setvalue{\??mixedcolumnsseparator#1}{#2}}
+ {\defcsname\??mixedcolumnsseparator#1\endcsname{#2}}
\installmixedcolumnseparator\v!rule
{\vrule
@@ -387,7 +401,7 @@
%D \stopmixedcolumns
%D \stoptyping
-\mutable\let\currentmixedcolumnsmethod\empty
+\mutable\lettonothing\currentmixedcolumnsmethod
\installmacrostack\currentmixedcolumns
\installmacrostack\currentmixedcolumnsmethod
@@ -434,7 +448,7 @@
\def\page_mix_start_columns_b[#1][#2]%
{\ifhastok={#1}%
- \let\currentmixedcolumns\empty
+ \lettonothing\currentmixedcolumns
\page_mix_error_b
\page_mix_start_columns_checked\page_mix_start_columns_b_yes\page_mix_start_columns_b_nop[#1]%
\else
@@ -459,7 +473,7 @@
{\writestatus\m!columns{best use an instance of mixed columns}}
\def\page_mix_start_columns_c[#1][#2]%
- {\let\currentmixedcolumns\empty
+ {\lettonothing\currentmixedcolumns
\page_mix_start_columns_checked
\page_mix_start_columns_c_yes
\page_mix_start_columns_c_nop}
@@ -566,6 +580,7 @@
\d_page_mix_max_width\dimexpr\d_page_mix_max_width-\leftskip-\rightskip\relax
\d_page_mix_leftskip \leftskip
\d_page_mix_rightskip\rightskip
+ % \frozen ?
\leftskip \zeropoint
\rightskip\zeropoint
%
@@ -591,41 +606,43 @@
\useblankparameter \mixedcolumnsparameter
\useprofileparameter\mixedcolumnsparameter % new
%
+ \automigrationmode\zerocount % for now
+ %
\nofcolumns\c_page_mix_n_of_columns} % public
%D The otr method related hooks are defined next:
-% \setvalue{\??mixedcolumnsbefore\s!otr}%
+% \defcsname\??mixedcolumnsbefore\s!otr\endcsname
% {\par
-% \ifdim\pagetotal=\zeropoint \else
+% \ifzeropt\pagetotal\else
% \verticalstrut % probably no longer needed
% \vskip-\struttotal % probably no longer needed
% \fi}
-\newcount\c_page_mix_otr_nesting
+\newinteger\c_page_mix_otr_nesting
-% \setvalue{\??mixedcolumnsbefore\s!otr}%
+% \defcsname\??mixedcolumnsbefore\s!otr\endcsname
% {\par
-% \global\advance\c_page_mix_otr_nesting\plusone
+% \global\advanceby\c_page_mix_otr_nesting\plusone
% \ifcase\c_page_mix_otr_nesting\or
-% \ifdim\pagetotal=\zeropoint \else
+% \ifzeropt\pagetotal\else
% \obeydepth % we could handle this in pre material
% \fi
% \fi}
-\setvalue{\??mixedcolumnsbefore\s!otr}%
+\defcsname\??mixedcolumnsbefore\s!otr\endcsname
{\par
- \global\advance\c_page_mix_otr_nesting\plusone
+ \global\advanceby\c_page_mix_otr_nesting\plusone
\ifcase\c_page_mix_otr_nesting\or
- \ifdim\pagetotal=\zeropoint \else
- % make sure that whitespace an dblanks are done
+ \ifzeropt\pagetotal\else
+ % make sure that whitespace and blanks are done
\strut
\vskip-\lineheight
% no, bad spacing: \obeydepth % we could handle this in pre material
\fi
\fi}
-\setvalue{\??mixedcolumnsstart\s!otr}%
+\defcsname\??mixedcolumnsstart\s!otr\endcsname
{\ifcase\c_page_mix_otr_nesting\or
\scratchwidth\textwidth
\setupoutputroutine[\s!mixedcolumn]%
@@ -651,14 +668,14 @@
\usealignparameter\mixedcolumnsparameter
\usesetupsparameter\mixedcolumnsparameter}
-% \setvalue{\??mixedcolumnsstop\s!otr}%
+% \defcsname\??mixedcolumnsstop\s!otr\endcsname
% {\par
% \ifcase\c_page_mix_otr_nesting\or
% \c_page_mix_routine\c_page_mix_routine_balance
% \page_otr_trigger_output_routine
% \fi}
-\setvalue{\??mixedcolumnsstop\s!otr}%
+\defcsname\??mixedcolumnsstop\s!otr\endcsname
{\par
\ifcase\c_page_mix_otr_nesting\or
\doifelse{\mixedcolumnsparameter\c!balance}\v!yes
@@ -671,13 +688,13 @@
\fi
\fi}
-\setvalue{\??mixedcolumnsafter\s!otr}%
+\defcsname\??mixedcolumnsafter\s!otr\endcsname
{\ifcase\c_page_mix_otr_nesting\or
\prevdepth\strutdp
\page_otr_command_set_vsize
\page_otr_command_set_hsize
\fi
- \global\advance\c_page_mix_otr_nesting\minusone}
+ \global\advanceby\c_page_mix_otr_nesting\minusone}
%D The splitting and therefore balancing is done at the \LUA\ end. This gives
%D more readable code and also makes it easier to deal with insertions like
@@ -711,9 +728,9 @@
\relax
\deadcycles\zerocount}
-\newdimen\mixedcolumnseparatorheight
-\newdimen\mixedcolumnseparatordepth
-\newdimen\mixedcolumnseparatorwidth
+\newdimension\mixedcolumnseparatorheight
+\newdimension\mixedcolumnseparatordepth
+\newdimension\mixedcolumnseparatorwidth
\def\page_mix_routine_package_step
{% needs packaging anyway
@@ -854,7 +871,7 @@
\page_mix_construct_and_shipout\box\b_page_mix_collected\zerocount % three arguments
\setbox\b_page_mix_collected\vpack{\clf_mixflushrest}% we could avoid this
\clf_mixcleanup
- \ifdim\ht\b_page_mix_collected=\zeropoint
+ \ifzeropt\ht\b_page_mix_collected
\exitloop
\fi
\fi}%
@@ -918,10 +935,10 @@
%D Next we define the hooks:
-\letvalue{\??mixedcolumnsbefore\s!box}\donothing
-\letvalue{\??mixedcolumnsafter \s!box}\donothing
+\letcsname\??mixedcolumnsbefore\s!box\endcsname\donothing
+\letcsname\??mixedcolumnsafter \s!box\endcsname\donothing
-\setvalue{\??mixedcolumnsstart\s!box}%
+\defcsname\??mixedcolumnsstart\s!box\endcsname
{\edef\p_page_mix_strut{\mixedcolumnsparameter\c!strut}%
\setbox\b_page_mix_collected\vbox \bgroup
\let\currentoutputroutine\s!mixedcolumn % makes \column work
@@ -934,7 +951,7 @@
\ignorespaces
\fi}
-\setvalue{\??mixedcolumnsstop\s!box}%
+\defcsname\??mixedcolumnsstop\s!box\endcsname
{\ifx\p_page_mix_strut\v!yes
\removeunwantedspaces
\endstrut
@@ -982,7 +999,7 @@
% \setbox\scratchbox\vbox % tricky met objecten ?
% {\blank[\rootfloatparameter\c!spacebefore]
% \snaptogrid\vbox{\vskip\floatheight}}% copy?
-% \advance\dimen0\dimexpr\ht\scratchbox+2\openlineheight+.5\lineheight\relax\relax % needed because goal a bit higher
+% \advanceby\dimen0\dimexpr\ht\scratchbox+2\openlineheight+.5\lineheight\relax\relax % needed because goal a bit higher
% \ifdim\dimen0>\dimen2
% \global\setfalse\c_page_floats_room
% \else
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-mrk.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-mrk.mkxl
index 143fab180e1..597cff17d3b 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-mrk.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-mrk.mkxl
@@ -39,9 +39,9 @@
\newconditional\c_page_marks_add_page_lines
\newconditional\c_page_marks_add_more_number
-\newcount\c_page_marks_max
-\newcount\c_page_marks_nx
-\newcount\c_page_marks_ny
+\newinteger \c_page_marks_max
+\newinteger \c_page_marks_nx
+\newinteger \c_page_marks_ny
\startuniqueMPgraphic{print:color}{w,h,l,o}
loadmodule "crop" ;
@@ -103,7 +103,7 @@
\setbox\scratchbox\hpack \layoutcomponentboxattribute\bgroup
\useMPgraphic
{print:number}%
- {w=\the\scratchwidth ,h=\the\scratchheight,%
+ {w=\the\scratchwidth,h=\the\scratchheight,%
l=\pagecutmarklength,o=\pagecutmarkoffset,%
n=\number\ifcase\arrangeno\realpageno\else\arrangeno\fi}%
\egroup
@@ -143,7 +143,7 @@
\ifconditional\c_page_marks_add_more_number
\page_marks_add_number
\fi
- \global\advance\c_page_marks_max\minusone
+ \global\advanceby\c_page_marks_max\minusone
\ifnum\c_page_marks_max>\zerocount\else
\glet\page_marks_add_more\gobbleoneargument
\glet\page_marks_add_page\gobbleoneargument
@@ -186,41 +186,44 @@
\permanent\protected\def\page_marks_set#1%
{\begincsname\??layoutmarking#1\endcsname}
+\def\page_marks_setup_layout
+ {\setfalse\c_page_marks_add_page_lines
+ \setfalse\c_page_marks_add_more_color
+ \setfalse\c_page_marks_add_more_marking
+ \setfalse\c_page_marks_add_more_lines
+ \setfalse\c_page_marks_add_more_number
+ \global\c_page_marks_max\maxcount
+ \rawprocesscommacommand[\layoutparameter\c!marking]\page_marks_set
+ \ifnum\c_page_marks_max<\maxcount
+ \ifconditional\c_page_marks_add_page_lines \orelse
+ \ifconditional\c_page_marks_add_more_color \orelse
+ \ifconditional\c_page_marks_add_more_marking\orelse
+ \ifconditional\c_page_marks_add_more_lines \orelse
+ \ifconditional\c_page_marks_add_more_number \else
+ \settrue\c_page_marks_add_page_lines
+ \settrue\c_page_marks_add_more_number
+ \fi
+ \fi
+ \ifconditional\c_page_marks_add_page_lines
+ \let\page_marks_add_page\page_marks_add_page_indeed
+ \else
+ \let\page_marks_add_page\gobbleoneargument
+ \fi
+ % we can get a double set of (overlayed) lines .. needs to be redone (too many objects anyway)
+ \ifconditional\c_page_marks_add_more_lines
+ \let\page_marks_add_more\page_marks_add_more_indeed
+ \orelse\ifconditional\c_page_marks_add_more_color
+ \let\page_marks_add_more\page_marks_add_more_indeed
+ \orelse\ifconditional\c_page_marks_add_more_marking
+ \let\page_marks_add_more\page_marks_add_more_indeed
+ \orelse\ifconditional\c_page_marks_add_more_number
+ \let\page_marks_add_more\page_marks_add_more_indeed
+ \else
+ \let\page_marks_add_more\gobbleoneargument
+ \fi}
+
\appendtoks
- \setfalse\c_page_marks_add_page_lines
- \setfalse\c_page_marks_add_more_color
- \setfalse\c_page_marks_add_more_marking
- \setfalse\c_page_marks_add_more_lines
- \setfalse\c_page_marks_add_more_number
- \global\c_page_marks_max\maxcount
- \rawprocesscommacommand[\layoutparameter\c!marking]\page_marks_set
- \ifnum\c_page_marks_max<\maxcount
- \ifconditional\c_page_marks_add_page_lines \orelse
- \ifconditional\c_page_marks_add_more_color \orelse
- \ifconditional\c_page_marks_add_more_marking\orelse
- \ifconditional\c_page_marks_add_more_lines \orelse
- \ifconditional\c_page_marks_add_more_number \else
- \settrue\c_page_marks_add_page_lines
- \settrue\c_page_marks_add_more_number
- \fi
- \fi
- \ifconditional\c_page_marks_add_page_lines
- \let\page_marks_add_page\page_marks_add_page_indeed
- \else
- \let\page_marks_add_page\gobbleoneargument
- \fi
- % we can get a double set of (overlayed) lines .. needs to be redone (too many objects anyway)
- \ifconditional\c_page_marks_add_more_lines
- \let\page_marks_add_more\page_marks_add_more_indeed
- \orelse\ifconditional\c_page_marks_add_more_color
- \let\page_marks_add_more\page_marks_add_more_indeed
- \orelse\ifconditional\c_page_marks_add_more_marking
- \let\page_marks_add_more\page_marks_add_more_indeed
- \orelse\ifconditional\c_page_marks_add_more_number
- \let\page_marks_add_more\page_marks_add_more_indeed
- \else
- \let\page_marks_add_more\gobbleoneargument
- \fi
+ \page_marks_setup_layout
\to \everysetuplayout
\setuplayout
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-not.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-not.mkxl
index 82523cc66a3..a13e4884d40 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-not.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-not.mkxl
@@ -19,7 +19,7 @@
\unprotect
-\newdimen\totalinsertionheight
+\newdimension\totalinsertionheight
\permanent\protected\def\settotalinsertionheight
{\calculatetotalnoteheight
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-one.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-one.mkxl
index 9d0fb2065a2..8571c29829a 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-one.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-one.mkxl
@@ -35,6 +35,39 @@
\protected\def\page_one_command_set_float_hsize
{\global\hsize\textwidth}
+%D It's complicated:
+
+\newconditional\c_page_one_set_vsize_tmp
+
+\installtextracker{otr.insertheights}
+ {\settrue\c_page_one_set_vsize_tmp}
+ {\setfalse\c_page_one_set_vsize_tmp}
+
+\def\page_one_command_set_vsize_tmp
+ {\settotalinsertionheight
+ \writestatus
+ {set vsize one}
+ {insert heights=\the\insertheights,
+ total insertion height=\the\totalinsertionheight,
+ delta=\the\dimexpr\insertheights-\totalinsertionheight}%
+ \page_one_command_set_vsize_new}
+
+\def\page_one_command_set_vsize_old
+ {\settotalinsertionheight
+ \pagegoal\dimexpr
+ \vsize
+ -\totalinsertionheight
+ \relax}
+
+\def\page_one_command_set_vsize_new
+ {\pagegoal\dimexpr
+ \vsize
+ -\d_page_floats_inserted_top
+ -\d_page_floats_inserted_bottom
+ -\insertheights
+ \relax
+ }% no: \insertheights\zeropoint}
+
\protected\def\page_one_command_set_vsize
{\ifgridsnapping
\ifcase\layoutlines
@@ -46,15 +79,23 @@
\else
\global\vsize\textheight
\fi
- \global\advance\vsize\d_page_adapts_delta
+ %
+ \ifzeropt\textadaptive\else
+ \global\d_page_adapts_delta\textadaptive
+ \global\pageextragoal-\textadaptive
+ \fi
+ %
+ \global\advanceby\vsize\d_page_adapts_delta
% alternatively we could set it in builders.buildpage_filter
% \ifdim\pagegoal<\maxdimen .. \fi
- \pagegoal\dimexpr
- \vsize
- -\d_page_floats_inserted_top
- -\d_page_floats_inserted_bottom
- -\insertheights
- \relax}
+ % \writestatus{!!!!!!!!}{\the\vsize-> v:\the\pagevsize,g:\the\pagegoal,t:\the\pagetotal,i:\the\insertheights}%
+ \ifconditional\c_page_one_set_vsize_tmp
+ \page_one_command_set_vsize_tmp
+ \orelse\ifzeropt\insertheights
+ \page_one_command_set_vsize_old
+ \else
+ \page_one_command_set_vsize_new
+ \fi}
% 1 = partial page, 2 = whole page, 3 = partial page
@@ -62,7 +103,7 @@
\pushoverloadmode
\setnewconstant\kindofpagetextareas\plustwo % \plusone can become default some day
- \overloaded\mutable\let\kindofpagetextareas\kindofpagetextareas % fo rnow mutable, can become a key/value
+ \overloaded\mutable\let\kindofpagetextareas\kindofpagetextareas % for now mutable, can become a key/value
\popoverloadmode
\def\page_one_registered_text_area_a % two arguments: (un)vbox n
@@ -101,9 +142,9 @@
% \expandafter\firstofoneargument
\fi}
-\newdimen\d_page_one_natural_depth
-\newbox \b_page_one_bottom_notes
-\newbox \b_page_one_contents
+\newdimension\d_page_one_natural_depth
+\newbox \b_page_one_bottom_notes
+\newbox \b_page_one_contents
\let\page_one_command_package_show_state\relax
@@ -111,6 +152,103 @@
%
% we can also have bottom notes on top of bottom insertions
+% \protected\def\page_one_command_package_contents#1#2% \box<n> \unvbox<n> % this one will be redone (checked)
+% {\bgroup
+% \strc_notes_check_if_bottom_present
+% \d_page_one_natural_depth\dp#2\relax
+% % we need to set the height as otherwise the shrink will not kick in so the following
+% % no longer applies:
+% %
+% % \setbox\b_page_one_contents\vbox \ifconditional\c_notes_bottom_present to \textheight \fi
+% %
+% \setbox\b_page_one_contents\vbox to \textheight % probably no pack
+% {\page_otr_command_flush_top_insertions
+% % this is messy ... we will provide a more tight area (no big deal as we can
+% % do that at the lua end)
+% % \parfillskip\zeropoint
+% \page_one_registered_text_area_a#1#2% \unvbox <box>
+% %
+% \ifgridsnapping
+% \unskip % new per 2019-06-18, otherwise weird bottom floats
+% \vkern\dimexpr\openstrutdepth-\d_page_one_natural_depth\relax
+% \prevdepth\openstrutdepth
+% \page_otr_command_flush_bottom_insertions
+% \vfil
+% \orelse\ifcase\bottomraggednessmode
+% % ragged (default)
+% \unskip % new per 2019-06-18, otherwise weird bottom floats
+% \vkern\dimexpr\openstrutdepth-\d_page_one_natural_depth\relax
+% \prevdepth\openstrutdepth
+% % these have whitespace before but we can have some more options
+% % like a \vfill or so
+% \page_otr_command_flush_bottom_insertions
+% \vfil
+% \or
+% % align (normal)
+% \page_otr_command_flush_bottom_insertions
+% \or
+% % baseline
+% \unskip % new per 2019-06-18, otherwise weird bottom floats
+% \vkern\dimexpr\maxdepth-\d_page_one_natural_depth\relax
+% \page_otr_command_flush_bottom_insertions
+% \fi
+% \fakepagenotes}%
+% \page_one_command_package_show_state
+% \ifconditional\c_notes_bottom_present
+% \ifgridsnapping
+% \ifcase\layoutlines
+% \getrawnoflines\textheight
+% \else
+% \noflines\layoutlines
+% \fi
+% \scratchoffset\dimexpr\numexpr\noflines-\plusone\relax\lineheight+\topskip\relax
+% \else
+% \scratchoffset\ht\b_page_one_contents
+% \fi
+% \setbox\b_page_one_bottom_notes\hpack
+% {\lower\scratchoffset\vbox{\placebottomnotes\par\kern\zeropoint}}% kerns makes notes sit on bottom % pack ?
+% \smashbox\b_page_one_bottom_notes
+% \ht\b_page_one_contents\zeropoint
+% \page_one_registered_text_area_b
+% {\vpack to \textheight
+% {\box\b_page_one_contents
+% \box\b_page_one_bottom_notes}}%
+% \else
+% \ht\b_page_one_contents\textheight
+% \page_one_registered_text_area_b
+% {\box\b_page_one_contents}%
+% \fi
+% \egroup}
+
+%D \starttyping
+%D \setuplayout[height=middle] \showframe
+%D
+%D % \markpages[stretch][lines=2] % current page
+%D
+%D \starttext
+%D \brokenpenalty 10000 \clubpenalty 20000 \widowpenalty 20000
+%D \dorecurse{10}{\samplefile{tufte}\par} \page
+%D \startmarkpages[stretch][lines=2]
+%D \dorecurse{10}{\samplefile{tufte}\par} \page
+%D \stopmarkpages
+%D \dorecurse{10}{\samplefile{tufte}\par} \page
+%D \stoptext
+%D \stoptyping
+
+\newinteger\c_page_one_stretch % we use marked pages which actually slow down a little
+
+\def\page_one_check_stretch_contents
+ {\ifdim\dimexpr\textheight-\ht\b_page_one_contents\relax<\c_page_one_stretch\lineheight
+ \setbox\b_page_one_contents\vpack\bgroup
+ % no need to speed up low level
+ \scale[\c!height=\textheight,\c!width=\textwidth]{\box\b_page_one_contents}%
+ \egroup
+ \fi}
+
+\def\page_one_check_stretch_lines
+ {\edef\m_lines{\markedpageparameter\v!stretch\v!lines}%
+ \ifempty\m_lines\else\c_page_one_stretch\m_lines\fi}
+
\protected\def\page_one_command_package_contents#1#2% \box<n> \unvbox<n> % this one will be redone (checked)
{\bgroup
\strc_notes_check_if_bottom_present
@@ -120,11 +258,14 @@
%
% \setbox\b_page_one_contents\vbox \ifconditional\c_notes_bottom_present to \textheight \fi
%
- \setbox\b_page_one_contents\vbox to \textheight % probably no pack
+ \ifconditional\c_notes_bottom_present\else
+ \doifmarkedpage\v!stretch\page_one_check_stretch_lines
+ \fi
+ \setbox\b_page_one_contents\vbox \ifcase\c_page_one_stretch to \textheight\fi % probably no pack
{\page_otr_command_flush_top_insertions
% this is messy ... we will provide a more tight area (no big deal as we can
% do that at the lua end)
-% \parfillskip\zeropoint
+ % \parfillskip\zeropoint
\page_one_registered_text_area_a#1#2% \unvbox <box>
%
\ifgridsnapping
@@ -149,6 +290,7 @@
% baseline
\unskip % new per 2019-06-18, otherwise weird bottom floats
\vkern\dimexpr\maxdepth-\d_page_one_natural_depth\relax
+ % \srule depth \dimexpr\maxdepth-\d_page_one_natural_depth\relax
\page_otr_command_flush_bottom_insertions
\fi
\fakepagenotes}%
@@ -173,6 +315,9 @@
{\box\b_page_one_contents
\box\b_page_one_bottom_notes}}%
\else
+ \ifcase\c_page_one_stretch\else
+ \page_one_check_stretch_contents
+ \fi
\ht\b_page_one_contents\textheight
\page_one_registered_text_area_b
{\box\b_page_one_contents}%
@@ -189,20 +334,20 @@
\newconditional\c_page_one_top_of_insert
\newconditional\c_page_one_correct_top_insert \settrue\c_page_one_correct_top_insert % false moves up (tight)
-\newskip \s_page_one_between_top_insert
+\newgluespec \s_page_one_between_top_insert
\def\page_one_prepare_top_float
- {\ifdim\d_page_floats_inserted_top=\zeropoint
+ {\ifzeropt\d_page_floats_inserted_top
\settrue\c_page_one_top_of_insert
\else
\setfalse\c_page_one_top_of_insert
\fi
\s_page_one_between_top_insert\ifdim\d_strc_floats_top>\d_strc_floats_bottom\d_strc_floats_top\else\d_strc_floats_bottom\fi\relax
- \global\advance\d_page_floats_inserted_top\dimexpr\ht\floatbox+\dp\floatbox+\s_page_one_between_top_insert\relax}
+ \global\advanceby\d_page_floats_inserted_top\dimexpr\ht\floatbox+\dp\floatbox+\s_page_one_between_top_insert\relax}
\def\page_one_insert_top_float % maybe remember last beforeskip
{\floatingpenalty\zerocount
- \insert\namedinsertionnumber\s!topfloat\bgroup
+ \page_inserts_inject\namedinsertionnumber\s!topfloat\bgroup
\forgetall
\ifconditional\c_page_one_top_of_insert
\ifconditional\c_page_one_correct_top_insert
@@ -225,7 +370,7 @@
\noffloatinserts\zerocount
\let\totaltopinserted\!!zeropoint
\page_one_command_set_top_insertions_indeed
- \ifnum\rootfloatparameter\c!nbottom=\zerocount
+ \ifnum\rootfloatparameter\c!nbottom=\zerocount % \ifnum\c_page_floats_n_of_bottom=\zerocount
\ifnum\rootfloatparameter\c!nlines>\zerocount
\ifdim\totaltopinserted>\zeropoint\relax
\ifdim\dimexpr\rootfloatparameter\c!nlines\lineheight+\totaltopinserted\relax>\textheight
@@ -246,7 +391,7 @@
\xdef\totaltopinserted{\the\d_page_floats_inserted_top}%
\page_one_insert_top_float
\ifconditional\c_page_floats_some_waiting
- \advance\noffloatinserts \plusone
+ \advanceby\noffloatinserts \plusone
\else
\noffloatinserts\c_page_floats_n_of_top\relax
\fi
@@ -274,16 +419,16 @@
\def\page_one_command_set_bottom_insertions_indeed
{\ifnum\noffloatinserts<\c_page_floats_n_of_bottom\relax
\page_floats_get
- \global\advance\d_page_floats_inserted_bottom\dimexpr\ht\floatbox+\dp\floatbox+\d_strc_floats_top\relax
+ \global\advanceby\d_page_floats_inserted_bottom\dimexpr\ht\floatbox+\dp\floatbox+\d_strc_floats_top\relax
\ifdim\d_page_floats_inserted_bottom<\pagegoal\relax
\floatingpenalty\zerocount
- \insert\namedinsertionnumber\s!bottomfloat\bgroup
+ \page_inserts_inject\namedinsertionnumber\s!bottomfloat\bgroup
\forgetall
\blank[\rootfloatparameter\c!spacebefore]%
\page_otr_command_flush_float_box
\egroup
\ifconditional\c_page_floats_some_waiting
- \advance\noffloatinserts \plusone
+ \advanceby\noffloatinserts \plusone
\else
\noffloatinserts\c_page_floats_n_of_bottom
\fi
@@ -301,15 +446,25 @@
\fi
\page_one_command_set_bottom_insertions_indeed}
+% \protected\def\page_one_command_flush_top_insertions
+% {\ifzeropt\page_inserts_get_height\namedinsertionnumber\s!topfloat\else
+% \page_one_command_flush_top_insertions_indeed % less tracing
+% \fi
+% \global\d_page_floats_inserted_top\zeropoint}
+
\protected\def\page_one_command_flush_top_insertions
- {\ifvoid\namedinsertionnumber\s!topfloat\else
+ {\ifzeropt\page_inserts_get_height\namedinsertionnumber\s!topfloat\else
\page_one_command_flush_top_insertions_indeed % less tracing
+ \ifcase\bottomraggednessmode\or\else
+ % will be an option
+ \vskip\zeropoint plus \openstrutdepth minus \openstrutdepth
+ \fi
\fi
\global\d_page_floats_inserted_top\zeropoint}
\def\page_one_command_flush_top_insertions_indeed
{\ifgridsnapping
- \box\namedinsertionnumber\s!topfloat
+ \page_inserts_get_boxed\namedinsertionnumber\s!topfloat
\vkern-\topskip
\vkern\strutheight % [xx] new: see icare topbleed
\else
@@ -320,11 +475,11 @@
\vskip-\topskip % skip !
\vkern\strutheight
\fi
- \unvbox\namedinsertionnumber\s!topfloat
+ \page_inserts_get_unboxed\namedinsertionnumber\s!topfloat
\fi}
\protected\def\page_one_command_flush_bottom_insertions
- {\ifvoid\namedinsertionnumber\s!bottomfloat\else
+ {\ifzeropt\page_inserts_get_height\namedinsertionnumber\s!bottomfloat\else
\page_one_command_flush_bottom_insertions_indeed
\fi
\global\d_page_floats_inserted_bottom\zeropoint
@@ -332,13 +487,13 @@
\def\page_one_command_flush_bottom_insertions_indeed
{\ifgridsnapping
- % \floatparameter\c!bottombefore
- \snaptogrid\hbox{\box\namedinsertionnumber\s!bottomfloat}%
- % \floatparameter\c!bottomafter
+ % \rootfloatparameter\c!bottombefore
+ \snaptogrid\hbox{\page_inserts_get_boxed\namedinsertionnumber\s!bottomfloat}%
+ % \rootfloatparameter\c!bottomafter
\else
- \floatparameter\c!bottombefore
- \unvbox\namedinsertionnumber\s!bottomfloat
- \floatparameter\c!bottomafter
+ \rootfloatparameter\c!bottombefore
+ \page_inserts_get_unboxed\namedinsertionnumber\s!bottomfloat
+ \rootfloatparameter\c!bottomafter
\fi}
\protected\def\page_one_command_flush_floats
@@ -403,7 +558,7 @@
\protected\def\page_one_command_flush_margin_blocks
{\ifconditional\c_page_margin_blocks_present % \ifvoid\b_page_margin_blocks \else
- \ifdim\pagetotal=\zeropoint
+ \ifzeropt\pagetotal
\null % \fixedspace
\fi
\page_otr_command_next_page % \page
@@ -440,10 +595,10 @@
\or
% method 1 : safe
% too fuzzy as it can change and for a high page it's a lot : \scratchdimentwo .99\pagegoal
- \advance\scratchdimentwo -\strutdp
+ \advanceby\scratchdimentwo -\strutdp
\or
% method 2 : tight
- \advance\scratchdimenone -\onepoint
+ \advanceby\scratchdimenone -\onepoint
\fi
\relax % really needed ! ! ! !
\ifdim\scratchdimenone>\scratchdimentwo
@@ -476,14 +631,24 @@
% \page_floats_report_total
% \dohandlenextfloatindent}
+% \def\page_one_place_float_here_indeed
+% {\ifgridsnapping
+% % otherwise real bad outcome
+% \else
+% % this was not really applied (delayed)
+% % \baselinecorrection % this has to be done better (and definitely not in column mode)
+% % so we now use this:
+% \checkprevdepth
+% \fi
+% \doplacefloatbox
+% \page_floats_report_total
+% \dohandlenextfloatindent}
+
\def\page_one_place_float_here_indeed
{\ifgridsnapping
% otherwise real bad outcome
\else
- % this was not really applied (delayed)
- % \baselinecorrection % this has to be done better (and definitely not in column mode)
- % so we now use this:
- \checkprevdepth
+ \forcestrutdepth
\fi
\doplacefloatbox
\page_floats_report_total
@@ -633,9 +798,9 @@
\page_floats_report_total}
\def\page_one_place_float_bottom_indeed
- {\global\advance\d_page_floats_inserted_bottom\dimexpr\ht\floatbox+\dp\floatbox+\d_strc_floats_top\relax
+ {\global\advanceby\d_page_floats_inserted_bottom\dimexpr\ht\floatbox+\dp\floatbox+\d_strc_floats_top\relax
\floatingpenalty\zerocount
- \insert\namedinsertionnumber\s!bottomfloat\bgroup
+ \page_inserts_inject\namedinsertionnumber\s!bottomfloat\bgroup
\forgetall
\blank[\rootfloatparameter\c!spacebefore]%
\page_otr_command_flush_float_box
@@ -673,9 +838,6 @@
\endgroup
\fi}
-\protected\def\page_one_command_flush_facing_floats
- {\strc_floats_facing_flush}
-
\defineoutputroutine
[\s!singlecolumn]
[\s!page_otr_command_routine =\page_one_command_routine,
@@ -700,7 +862,6 @@
\s!page_otr_command_flush_all_floats =\page_one_command_flush_all_floats,
\s!page_otr_command_flush_margin_blocks =\page_one_command_flush_margin_blocks,
\s!page_otr_command_test_column =\page_one_command_test_page,
- \s!page_otr_command_flush_facing_floats =\page_one_command_flush_facing_floats
]
% \setupoutputroutine
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-otr.mklx b/Master/texmf-dist/tex/context/base/mkxl/page-otr.mklx
index f2a341d4bc0..d88a16c0604 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-otr.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-otr.mklx
@@ -86,18 +86,17 @@
\let\page_otr_specifics_preset\page_otr_specifics_preset_traced
\to \t_page_otr_tracers
-%D We have a couple of output routines and the default one is
-%D the single column routine. Then there is a multicolumn variant
-%D that can be used mixed, and a columnset variant that is more
-%D exclusive.
+%D We have a couple of output routines and the default one is the single column
+%D routine. Then there is a multicolumn variant that can be used mixed, and a
+%D columnset variant that is more exclusive.
\installcorenamespace{otrtriggers}
\newconstant\c_page_otr_eject_penalty \c_page_otr_eject_penalty -\plustenthousand
\newconstant\c_page_otr_super_penalty \c_page_otr_super_penalty -\plustwentythousand
-\newcount \c_page_otr_trigger_penalty \c_page_otr_trigger_penalty -100010
+\newinteger \c_page_otr_trigger_penalty \c_page_otr_trigger_penalty -100010
-\newcount \c_page_otr_columns % we will share this one
+\newinteger \c_page_otr_columns % we will share this one
\newif \ifinotr % we keep this (name) for old times sake
@@ -136,7 +135,7 @@
\endgroup}
\permanent\protected\def\installoutputroutine#invoke#action% \invoke \action
- {\global\advance\c_page_otr_trigger_penalty\minusone
+ {\global\advanceby\c_page_otr_trigger_penalty\minusone
\frozen\protected\edef#invoke{\page_otr_trigger{\number\c_page_otr_trigger_penalty}}%
\setvalue{\??otrtriggers\number\c_page_otr_trigger_penalty}{#action}}
@@ -176,26 +175,6 @@
#content\relax
\the\everyafteroutput}}
-% Just as fuzzy (and in 'one' we are okay with \aftergroup anyway):
-%
-% \ifdefined\everybeforeoutputgroup \else \newtoks\everybeforeoutputgroup \fi
-% \ifdefined\everyafteroutputgroup \else \newtoks\everyafteroutputgroup \fi
-%
-% \def\page_otr_set_engine_output_routine#content%
-% {\the\everybeforeoutputgroup
-% \global\output
-% {\inotrtrue
-% \the\everybeforeoutput
-% #content\relax
-% \the\everyafteroutput
-% \aftergroup\the\aftergroup\everyafteroutputgroup}}
-%
-% \appendtoks
-% \ifnum\c_page_postponed_mode=\plusone
-% \page_postponed_blocks_flush % and then not in \page_otr_construct_and_shipout
-% \fi
-% \to \everyafteroutputgroup
-
\page_otr_set_engine_output_routine\page_otr_triggered_output_routine
\installoutputroutine\synchronizeoutput % use \triggerpagebuilder instead
@@ -261,16 +240,14 @@
\penalty\c_page_otr_super_penalty
\resetpagebreak}
-%D For those who've read the plain \TEX\ book, we provide the next
-%D macro:
+%D For those who've read the plain \TEX\ book, we provide the next macro:
\permanent\protected\def\bye
{\writestatus\m!system{Sorry, you're not done yet, so no goodbye!}}
-%D We define a few constants because that (1) provides some checking
-%D and (2) is handier when aligning definitions (checks nicer). Most
-%D routines will use ard codes names but sometimes we want to adapt,
-%D which is why we have these:
+%D We define a few constants because that (1) provides some checking and (2) is
+%D handier when aligning definitions (checks nicer). Most routines will use ard
+%D codes names but sometimes we want to adapt, which is why we have these:
\definesystemconstant{page_otr_command_routine}
\definesystemconstant{page_otr_command_package_contents}
@@ -294,7 +271,6 @@
\definesystemconstant{page_otr_command_flush_all_floats}
\definesystemconstant{page_otr_command_flush_margin_blocks}
\definesystemconstant{page_otr_command_test_column}
-\definesystemconstant{page_otr_command_flush_facing_floats}
\definesystemconstant{singlecolumn}
\definesystemconstant{multicolumn} % will move
@@ -323,8 +299,7 @@
\s!page_otr_command_flush_saved_floats,
\s!page_otr_command_flush_all_floats,
\s!page_otr_command_flush_margin_blocks,
- \s!page_otr_command_test_column,
- \s!page_otr_command_flush_facing_floats]
+ \s!page_otr_command_test_column]
\appendtoks
\setupoutputroutine[\s!singlecolumn]%
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-par.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-par.mkxl
index c198784dc4d..4cfc3f9bfcb 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-par.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-par.mkxl
@@ -22,7 +22,7 @@
\definecounter[\v!paragraph]
-\permanent\let\showparagraphnumber\relax
+\permanent\lettonothing\showparagraphnumber
\appendtoks
\page_par_check_state
@@ -36,16 +36,16 @@
\lastnamedcs
\fi}
-\setvalue{\??paragraphnumberingvariants\v!start}%
+\defcsname\??paragraphnumberingvariants\v!start\endcsname
{\enforced\let\showparagraphnumber\page_par_show_number_normal}
-\setvalue{\??paragraphnumberingvariants\v!stop}%
- {\enforced\let\showparagraphnumber\relax}
+\defcsname\??paragraphnumberingvariants\v!stop\endcsname
+ {\enforced\lettonothing\showparagraphnumber}
-\setvalue{\??paragraphnumberingvariants\v!line}%
+\defcsname\??paragraphnumberingvariants\v!line\endcsname
{\enforced\let\showparagraphnumber\page_par_show_number_lines}
-\setvalue{\??paragraphnumberingvariants\v!reset}%
+\defcsname\??paragraphnumberingvariants\v!reset\endcsname
{\strc_counters_reset\v!paragraph
\enforced\let\showparagraphnumber\page_par_show_number_normal}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-pcl.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-pcl.mkxl
index 6d186a4cd4c..d6298982c77 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-pcl.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-pcl.mkxl
@@ -30,17 +30,17 @@
\definemeasure[threecolumns][\dimexpr\plusthree\columnwidth+\plustwo \columndistance\relax]
\definemeasure[fourcolumns] [\dimexpr\plusfour \columnwidth+\plusthree\columndistance\relax]
-\newcount \c_page_col_n_of_columns \c_page_col_n_of_columns\plusone
-\newcount \c_page_col_current \c_page_col_current \plusone
-\newdimen \d_page_col_distance
-\newdimen \d_page_col_max_height
-\newdimen \d_page_col_max_width
-%newdimen \d_page_col_balance_step
-\newdimen \d_page_col_column_width
-\newdimen \d_page_col_top_height
-\newdimen \d_page_col_top_width
-\newdimen \d_page_col_available
-\newdimen \d_page_col_sofar
+\newinteger \c_page_col_n_of_columns \c_page_col_n_of_columns\plusone
+\newinteger \c_page_col_current \c_page_col_current \plusone
+\newdimension \d_page_col_distance
+\newdimension \d_page_col_max_height
+\newdimension \d_page_col_max_width
+%newdimension \d_page_col_balance_step
+\newdimension \d_page_col_column_width
+\newdimension \d_page_col_top_height
+\newdimension \d_page_col_top_width
+\newdimension \d_page_col_available
+\newdimension \d_page_col_sofar
\newconditional\c_page_col_page
%D We need to step over empty columns.
@@ -70,7 +70,7 @@
\fi
\page_otr_eject_page
\scratchcounterone\c_page_col_current
- \advance\scratchcounterthree\plusone
+ \advanceby\scratchcounterthree\plusone
\fi
}%
\endgroup}
@@ -100,20 +100,6 @@
%D \unknown
-\protected\def\page_col_command_set_vsize % \page_one_command_set_vsize minus the pagegoal setting
- {\ifgridsnapping
- \ifcase\layoutlines
- \getrawnoflines\textheight
- \else
- \noflines\layoutlines
- \fi
- \global\vsize\noflines\openlineheight
- \else
- \global\vsize\textheight
- \fi}
-
-%D \unknown
-
\def\page_col_registered_text_area_b#1%
{\begingroup
\makeupwidth\d_page_col_column_width
@@ -196,12 +182,12 @@
\protected\def\page_col_command_side_float_output
{% % %
- \ifvoid\namedinsertionnumber\s!topfloat\else
- \scratchwidth\wd\namedinsertionnumber\s!topfloat
+ \ifzeropt\page_inserts_get_height\namedinsertionnumber\s!topfloat\else
+ \scratchwidth\page_inserts_get_width\namedinsertionnumber\s!topfloat\relax
\ifdim\scratchwidth>\d_page_col_top_width
\global\d_page_col_top_width \scratchwidth
\fi
- \global\d_page_col_top_height\ht\namedinsertionnumber\s!topfloat
+ \global\d_page_col_top_height\page_inserts_get_height\namedinsertionnumber\s!topfloat\relax
\fi
% % %
\setbox\scratchbox\vbox\bgroup
@@ -221,7 +207,7 @@
\ifdim\dimexpr\d_page_col_top_width>\d_page_col_sofar\relax
\begingroup
\floatingpenalty\zerocount
- \insert\namedinsertionnumber\s!topfloat\bgroup
+ \page_inserts_inject\namedinsertionnumber\s!topfloat\bgroup
\vbox to \d_page_col_top_height{\vss}
% can be an option
\page_col_command_flush_top_insertions
@@ -231,9 +217,11 @@
\endgroup
\fi
\fi
- \global\advance\c_page_col_current\plusone
+ \global\advanceby\c_page_col_current\plusone
\fi
%
+ \page_col_notes_synchronize
+ %
\page_col_command_set_vsize
\page_col_command_set_hsize}
@@ -241,13 +229,14 @@
\def\page_col_routine_package_step
{% needs packaging anyway
+ \mofcolumns\recurselevel % added
\getboxfromcache{\s!pagecolumn}{\number\recurselevel}\scratchbox
\page_lines_add_numbers_to_box\scratchbox\recurselevel\c_page_col_n_of_columns\plusone % new
\page_marks_synchronize_column\plusone\c_page_col_n_of_columns\recurselevel\scratchbox
% backgrounds
\anch_mark_column_box\scratchbox\recurselevel
- \mixedcolumnseparatorheight\ht\scratchbox
- \mixedcolumnseparatordepth \dp\scratchbox
+ \pagecolumnseparatorheight\ht\scratchbox
+ \pagecolumnseparatordepth \dp\scratchbox
\inheritedpagecolumnsframedbox\recurselevel\scratchbox}
\def\page_col_routine_package
@@ -304,10 +293,10 @@
% % method 0 : raw
% \or
% % method 1 : safe
-% \advance\scratchdimentwo -\strutdp
+% \advanceby\scratchdimentwo -\strutdp
% \or
% % method 2 : tight
-% \advance\scratchdimenone -\onepoint
+% \advanceby\scratchdimenone -\onepoint
% \fi
% \relax % really needed ! ! ! !
% \ifdim\scratchdimenone>\scratchdimentwo
@@ -345,10 +334,10 @@
% method 0 : raw
\or
% method 1 : safe
- \advance\scratchdimentwo -\strutdp
+ \advanceby\scratchdimentwo -\strutdp
\or
% method 2 : tight
- \advance\scratchdimenone -\onepoint
+ \advanceby\scratchdimenone -\onepoint
\fi
\relax % really needed ! ! ! !
\ifdim\scratchdimenone>\scratchdimentwo
@@ -371,7 +360,7 @@
{\ifnum\c_page_col_current=\c_page_col_n_of_columns
\c_page_col_current\plusone
\else
- \advance\c_page_col_current\plusone
+ \advanceby\c_page_col_current\plusone
\fi
\page_col_command_set_hsize
\hsize\d_page_col_available}
@@ -526,7 +515,7 @@
\xdef\totaltopinserted{\the\d_page_floats_inserted_top}%
\page_one_insert_top_float
\ifconditional\c_page_floats_some_waiting
- \advance\noffloatinserts \plusone
+ \advanceby\noffloatinserts \plusone
\else
\noffloatinserts\c_page_floats_n_of_top\relax
\fi
@@ -557,9 +546,9 @@
%D The separator code is more or less the same as mixed columns but we need
%D to compensate for the top floats so we comment a bit for now.
-\newdimen\pagecolumnseparatorheight
-\newdimen\pagecolumnseparatordepth
-\newdimen\pagecolumnseparatorwidth
+\newdimension\pagecolumnseparatorheight
+\newdimension\pagecolumnseparatordepth
+\newdimension\pagecolumnseparatorwidth
% \installcorenamespace{pagecolumnsseparator}
%
@@ -719,8 +708,8 @@
\c!direction=\v!normal]
\appendtoks % could become an option
- \frozen\instance\setuevalue{\e!start\currentpagecolumns}{\startpagecolumns[\currentpagecolumns]}%
- \frozen\instance\setuevalue{\e!stop \currentpagecolumns}{\stoppagecolumns}%
+ \frozen\instance\protected\edefcsname\e!start\currentpagecolumns\endcsname{\startpagecolumns[\currentpagecolumns]}%
+ \frozen\instance\protected\edefcsname\e!stop \currentpagecolumns\endcsname{\stoppagecolumns}%
\to \everydefinepagecolumns
\def\page_col_pickup_preceding
@@ -754,11 +743,52 @@
\endgroup
\fi}
+% \let\page_col_notes_initialize \relax
+% \let\page_col_notes_synchronize\relax
+% \let\page_col_notes_reset \relax
+%
+% \protected\def\page_col_command_set_vsize % \page_one_command_set_vsize minus the pagegoal setting
+% {\ifgridsnapping
+% \ifcase\layoutlines
+% \getrawnoflines\textheight
+% \else
+% \noflines\layoutlines
+% \fi
+% \global\vsize\noflines\openlineheight
+% \else
+% \global\vsize\textheight
+% \fi}
+
+\newconditional\c_page_col_notes_lastcolumn
+
+\def\page_col_notes_synchronize
+ {\insertstoring\zerocount
+ \ifnum\c_page_col_current=\c_page_col_n_of_columns\relax
+ \strc_notes_process\page_col_notes_inject
+ \ifconditional\c_page_col_notes_lastcolumn
+ \insertstoring\plusone
+ \fi
+ \else
+ \strc_notes_process\page_col_notes_delay
+ \ifconditional\c_page_col_notes_lastcolumn
+ \insertstoring\plustwo
+ \fi
+ \fi}
+
+\def\page_col_notes_delay {\setfalse\c_page_col_notes_lastcolumn\ifcstok{\noteparameter\c!location}\v!lastcolumn\settrue\c_page_col_notes_lastcolumn\insertstorage\currentnoteinsertionnumber\plusone \fi}
+\def\page_col_notes_inject{\setfalse\c_page_col_notes_lastcolumn\ifcstok{\noteparameter\c!location}\v!lastcolumn\settrue\c_page_col_notes_lastcolumn\insertstorage\currentnoteinsertionnumber\zerocount\fi}
+
+\def\page_col_notes_initialize {\insertstoring\zerocount\strc_notes_process\page_col_notes_delay}
+\def\page_col_notes_reset {\insertstoring\zerocount\strc_notes_process\page_col_notes_inject}
+
+\protected\def\page_col_command_set_vsize % different !
+ {\page_one_command_set_vsize}
+
\permanent\tolerant\protected\def\startpagecolumns[#1]%
{\begingroup
\begingroup
\doifelseassignment{#1}%
- {\let\currentpagecolumns\empty
+ {\lettonothing\currentpagecolumns
\setuppagecolumns[#1]}%
{\edef\currentpagecolumns{#1}}%
\edef\p_page{\pagecolumnsparameter\c!page}%
@@ -824,6 +854,8 @@
\setupfloats[\c!ntop=\plusthousand]%
% \setupfloats[\c!nbottom=\plusthousand]%
%
+ \page_col_notes_initialize
+ %
\page_col_command_set_vsize
\page_col_command_set_hsize
%
@@ -836,13 +868,14 @@
\enforced\let\stoppagecolumns\page_col_stop_nop}
\protected\def\page_col_stop_yes
- {\column % \page_otr_eject_page
- \page
+ {%\column % \page_otr_eject_page
+ \page % beware for empty pages
\endgroup
% \setupoutputroutine[\s!singlecolumn]%
\page_otr_command_set_vsize
\page_otr_command_set_hsize
\page
+ \page_col_notes_reset
\endgroup}
\protected\def\page_col_stop_nop
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-plg.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-plg.mkxl
index 10cc1447bf0..7671a39c442 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-plg.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-plg.mkxl
@@ -111,6 +111,8 @@
\unprotect
+\startcontextdefinitioncode
+
\installcorenamespace{layoutmakeupalternative}
\def\page_boxes_construct_content_makeup#1#2#3% targetbox flusher box
@@ -196,8 +198,8 @@
% to be done nicely (proper namespacing)
-\setvalue{\??layoutmakeupalternative\v!leftpage }{\csname\??layoutmakeupalternative\v!page\endcsname}
-\setvalue{\??layoutmakeupalternative\v!rightpage}{\csname\??layoutmakeupalternative\v!page\endcsname}
+\defcsname\??layoutmakeupalternative\v!leftpage \endcsname{\csname\??layoutmakeupalternative\v!page\endcsname}
+\defcsname\??layoutmakeupalternative\v!rightpage\endcsname{\csname\??layoutmakeupalternative\v!page\endcsname}
\permanent\protected\def\startpagelayout
{\bgroup
@@ -208,6 +210,8 @@
\def\page_layouts_start_layout[#1]#2\stoppagelayout
{\egroup
- \setvalue{\??layoutmakeupalternative#1}{#2}}
+ \defcsname\??layoutmakeupalternative#1\endcsname{#2}}
+
+\stopcontextdefinitioncode
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-pst.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-pst.mkxl
index 026c64d629e..45d049760fd 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-pst.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-pst.mkxl
@@ -49,17 +49,17 @@
%D and we also can erase buffers easier when we keep a local cache, especially as we
%D can flush per page.
-\newcount \c_page_postponed_blocks_next_page % set at the lua end
+\newinteger \c_page_postponed_blocks_next_page % set at the lua end
\newconditional\c_page_postponed_busy
-\mutable\let\currentpostponedpage\empty
+\mutable\lettonothing\currentpostponedpage
-\permanent\protected\setvalue{\e!start\v!postponing}%
+\permanent\protected\defcsname\e!start\v!postponing\endcsname
{\bgroup
\obeylines
\doifelsenextoptional{\egroup\page_postponed_blocks_start}{\egroup\page_postponed_blocks_start[0]}}
-\permanent\protected\setvalue{\e!stop\v!postponing}%
+\permanent\protected\defcsname\e!stop\v!postponing\endcsname
{\clf_registerpostponedblock{\currentpostponedpage}\relax}
\def\page_postponed_blocks_start[#1]%
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-sel.lmt b/Master/texmf-dist/tex/context/base/mkxl/page-sel.lmt
new file mode 100644
index 00000000000..a6ea84f472a
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-sel.lmt
@@ -0,0 +1,77 @@
+if not modules then modules = { } end modules ['page-sel'] = {
+ version = 1.001,
+ comment = "companion to page-sel.mkxl",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+--- maybe more will end up here
+
+local addsuffix = file.addsuffix
+local context = context
+
+do
+
+ local sections = { }
+
+ local function sectionpage(filename,reference,what)
+ local filedata = sections[filename]
+ if not filedata then
+ filedata = {
+ data = job.loadother(addsuffix(filename,"tuc")) or false,
+ list = { }
+ }
+ sections[filename] = filedata
+ end
+ local list = filedata.list
+ local entry = list[reference]
+ if not entry then
+ local first = 0
+ local last = 0
+ local data = filedata.data
+ if data then
+ local lists = data.structures.lists.collected
+ local pages = data.structures.pages.collected
+ if lists and pages then
+ for i=1,#lists do
+ local li = lists[i]
+ if li.references.reference == reference then
+ local level = li.metadata.level
+ first = li.references.realpage
+ last = pages[#pages].number
+ for j=i+1,#lists do
+ local lj = lists[j]
+ if lj.metadata.level == level then
+ last = lj.references.realpage - 1
+ break
+ end
+ end
+ end
+ end
+ end
+ end
+ entry = {
+ first = first,
+ last = last,
+ }
+ list[reference] = entry
+ end
+ context(what and entry.first or entry.last)
+ end
+
+ interfaces.implement {
+ name = "firstsectionpage",
+ public = true,
+ arguments = { "optional", "optional", true },
+ actions = sectionpage
+ }
+
+ interfaces.implement {
+ name = "lastsectionpage",
+ public = true,
+ arguments = { "optional", "optional", false },
+ actions = sectionpage
+ }
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-sel.mklx b/Master/texmf-dist/tex/context/base/mkxl/page-sel.mklx
index 1ec1b40e3df..6344a0cc9d4 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-sel.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-sel.mklx
@@ -19,6 +19,10 @@
\unprotect
+\registerctxluafile{page-sel}{autosuffix}
+
+\startcontextdefinitioncode
+
%D One can (mis)use this mechanism to (re)arrange pages of already produced files.
%D
%D \starttyping
@@ -51,7 +55,7 @@
\installsetuponlycommandhandler \??withpages {withpages}
% \installdirectcommandhandler \??withpages {withpages}
-\newcount\c_page_selectors_n
+\newinteger\c_page_selectors_n
\permanent\tolerant\protected\def\insertpages[#filename]#spacer[#emptylist]#spacer[#settings]%
{\doifelseassignment{#emptylist}
@@ -63,9 +67,9 @@
\dontcomplain
\getfiguredimensions[#filename]%
\setupcurrentwithpages
- [\c!width=\zeropoint,%
- \c!n=\noffigurepages,%
- \c!category=,%
+ [\c!width=\zeropoint,
+ \c!n=\noffigurepages,
+ \c!category=,
#settings]%
\global\c_page_selectors_n\directwithpagesparameter\c!n\relax
\scratchwidth\directwithpagesparameter\c!width\relax
@@ -85,9 +89,9 @@
\dontcomplain
\getfiguredimensions[#filename]%
\setupcurrentwithpages
- [\c!width=\zeropoint,%
- \c!n=\noffigurepages,%
- \c!category=,%
+ [\c!width=\zeropoint,
+ \c!n=\noffigurepages,
+ \c!category=,
#settings]%
\global\c_page_selectors_n\directwithpagesparameter\c!n\relax
\scratchwidth\directwithpagesparameter\c!width\relax
@@ -114,7 +118,8 @@
\egroup}
\def\page_selectors_filter_a_page#filename#page%
- {\hpack to \textwidth
+ {%\startpagemakeup
+ \hpack to \textwidth
{\ifdim\scratchwidth>\zeropoint
\rightorleftpageaction{\scratchwidth\zeropoint}{\hfill}%
\fi
@@ -128,17 +133,17 @@
\fi
\hss}%
\wd\scratchbox\zeropoint
- \box\scratchbox}
- \page}
+ \box\scratchbox}%
+ \page}%\stoppagemakeup}
\permanent\tolerant\protected\def\copypages[#filename]#spacer[#settings]#spacer[#figuresettings]%
{\bgroup
\getfiguredimensions[#filename]%
\setupcurrentwithpages
- [\c!marking=\v!off,%
- \c!offset=\zeropoint,%
- \c!n=\noffigurepages,%
- \c!category=,%
+ [\c!marking=\v!off,
+ \c!offset=\zeropoint,
+ \c!n=\noffigurepages,
+ \c!category=,
#settings]%
\global\c_page_selectors_n\directwithpagesparameter\c!n\relax
\scratchoffset\directwithpagesparameter\c!offset\relax
@@ -148,8 +153,8 @@
\centeredbox
{\doifelse{\directwithpagesparameter\c!marking}\v!on\cuthbox\hpack % only place where cuthbox is used
{\ifdim\scratchoffset>\zeropoint\relax
- \advance\vsize -2\scratchoffset
- \advance\hsize -2\scratchoffset
+ \advanceby\vsize -2\scratchoffset
+ \advanceby\hsize -2\scratchoffset
\externalfigure[#filename][\c!page=\recurselevel,#figuresettings,\c!scale=,\c!factor=\v!max,\c!offset=\v!overlay]%
\else
\externalfigure[#filename][\c!page=\recurselevel,#figuresettings,\c!offset=\v!overlay]%
@@ -211,7 +216,7 @@
\directwithpagesparameter\c!after
\egroup}
-\setvalue{\??combinepagesalternative\v!a}% use hpacks
+\defcsname\??combinepagesalternative\v!a\endcsname % use hpacks
{\global\combinedpagescounter\directwithpagesparameter\c!start\relax
\doloop
{\vbox to \textheight
@@ -236,9 +241,9 @@
\c!backgroundcolor=\directwithpagesparameter\c!backgroundcolor,
\c!frame=\directwithpagesparameter\c!frame]%
\fi
- \directwithpagesparameter\c!right}
+ \directwithpagesparameter\c!right}%
\directwithpagesparameter\c!bottom}%
- \global\advance\combinedpagescounter\plusone
+ \global\advanceby\combinedpagescounter\plusone
\hfil}%
\hfilneg}
\vfil}%
@@ -248,7 +253,7 @@
\exitloop
\fi}}
-\setvalue{\??combinepagesalternative\v!c}%
+\defcsname\??combinepagesalternative\v!c\endcsname
{\global\combinedpagescounter\directwithpagesparameter\c!start\relax
\doloop
{\vbox to \textheight
@@ -275,7 +280,7 @@
\c!backgroundcolor=\directwithpagesparameter\c!backgroundcolor,
\c!frame=\directwithpagesparameter\c!frame]%
\fi}}
- \global\advance\combinedpagescounter\plusone
+ \global\advanceby\combinedpagescounter\plusone
\directwithpagesparameter\c!bottom}}%
\hfil}%
\hfilneg}}%
@@ -287,13 +292,13 @@
\letcsname\??combinepagesalternative\v!horizontal\expandafter\endcsname\csname\??combinepagesalternative\v!a\endcsname
\letcsname\??combinepagesalternative\v!vertical \expandafter\endcsname\csname\??combinepagesalternative\v!c\endcsname
-\setvalue{\??combinepagesalternative\v!b}%
+\defcsname\??combinepagesalternative\v!b\endcsname
{\global\combinedpagescounter\directwithpagesparameter\c!start\relax
\doloop
{\startbaselinecorrection
\hbox to \textwidth
{\dorecurse\scratchnx
- {\global\advance\combinedpagescounter\plusone
+ {\global\advanceby\combinedpagescounter\plusone
\ifnum\combinedpagescounter>\c_page_selectors_n \else
\normalexpanded{\externalfigure
[\directwithpagesparameter\c!name]
@@ -331,20 +336,23 @@
\glet\slicedpagenumber\!!zerocount
\getfiguredimensions[#filename]%
\setupcurrentwithpages
- [\c!offset=\zeropoint,%
- \c!hoffset=\zeropoint,%
+ [\c!offset=\zeropoint,
+ \c!hoffset=\zeropoint,
\c!voffset=\zeropoint,
- \c!width=\figurewidth,%
- \c!height=\figureheight,%
- \c!n=\noffigurepages,%
- \c!category=,%
+ \c!width=\figurewidth,
+ \c!height=\figureheight,
+ \c!n=\noffigurepages,
+ \c!category=,
#oddsettings]%
\global\c_page_selectors_n\directwithpagesparameter\c!n\relax
\ifnum\c_page_selectors_n>\zerocount
\definepapersize
- [\s!dummy][\c!height=\directwithpagesparameter\c!height,\c!width=\directwithpagesparameter\c!width]%
+ [\s!dummy]
+ [\c!height=\directwithpagesparameter\c!height,
+ \c!width=\directwithpagesparameter\c!width]%
\setuppapersize
- [\s!dummy][\s!dummy]%
+ [\s!dummy]
+ [\s!dummy]%
\setuplayout
[\c!backspace=\zeropoint,\c!topspace=\zeropoint,
\c!height=\v!middle,\c!width=\v!middle,
@@ -359,9 +367,9 @@
\dorecurse\c_page_selectors_n
{\let\slicedpagestepy\recurselevel
\clip
- [\c!nx=\c_page_selectors_n,\c!ny=\c_page_selectors_n,\c!x=\slicedpagestepx,\c!y=\slicedpagestepy]
+ [\c!nx=\c_page_selectors_n,\c!ny=\c_page_selectors_n,\c!x=\slicedpagestepx,\c!y=\slicedpagestepy]%
{\scale
- [\c!scale=\number\c_page_selectors_n000]
+ [\c!scale=\number\c_page_selectors_n000]%
{\externalfigure[#filename][\c!page=\slicedpagenumber]}}%
\page}}%
\else
@@ -384,21 +392,21 @@
\permanent\protected\def\trimpages[#1]% was for a over decade in p-pdf-51.tex
{\begingroup
\getdummyparameters
- [\c!file=dummy,
+ [\c!file=dummy,%
\c!hoffset=\zeropoint,
\c!voffset=\zeropoint,
\c!width=17cm,
\c!height=24cm,
\c!x=\zeropoint,
\c!y=\zeropoint,
- #1]
+ #1]%
\getfiguredimensions
[\dummyparameter\c!file]
- [\c!object=\v!no]
+ [\c!object=\v!no]%
\dorecurse\noffigurepages
{\scale
[\c!width=\paperwidth,
- \c!height=\paperheight]
+ \c!height=\paperheight]%
{\offset
[\c!x=\dummyparameter\c!x,
\c!y=\dummyparameter\c!y]
@@ -417,4 +425,40 @@
\fi}}}}%
\endgroup}
+\stopcontextdefinitioncode
+
+%D Implemented in Lua:
+
+% crap.tex:
+%
+% \starttext
+% \dorecurse{10}{
+% \startchapter[title=Chapter #1,reference=chapter:#1]
+% \dorecurse{10}{
+% \startsubject[title=Subject #1]
+% \dorecurse{2}{\samplefile{tufte}\par}
+% \stopsubject
+% \startsection[title=Section #1.##1,reference=#1.##1]
+% \dorecurse{10}{\samplefile{tufte}\par}
+% \stopsection
+% }
+% \stopchapter
+% }
+% \stoptext
+%
+% load.tex:
+%
+% \starttext
+% \dostepwiserecurse {\firstsectionpage[crap][chapter:3]} {\lastsectionpage[crap][chapter:3]} {1} {
+% \startpagemakeup
+% \externalfigure[crap.pdf][page=#1]
+% \stoppagemakeup
+% }
+% \dostepwiserecurse {\firstsectionpage[crap][chapter:5]} {\lastsectionpage[crap][chapter:5]} {1} {
+% \dontleavehmode
+% \externalfigure[crap.pdf][page=#1,width=3cm,frame=on]%
+% \space\allowbreak
+% }
+% \stoptext
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-sid.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-sid.mkxl
index 3c1f1f7beea..13131fa8d9b 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-sid.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-sid.mkxl
@@ -32,46 +32,50 @@
%D Earth, sophisticated Massive Attack video clips, impressive Davie504 movies
%D and so on).
-\newdimen \d_page_sides_margin
-\newdimen \d_page_sides_height % includes the topskip
-\newdimen \d_page_sides_width
-\newdimen \d_page_sides_hsize
-\newdimen \d_page_sides_vsize
-\newdimen \d_page_sides_vsize_reset
-\newdimen \d_page_sides_progress
-\newdimen \d_page_sides_page_total
-
-\newdimen \d_page_sides_leftoffset
-\newdimen \d_page_sides_rightoffset
+\newdimension \d_page_sides_margin
+\newdimension \d_page_sides_height % includes the topskip
+\newdimension \d_page_sides_width
+\newdimension \d_page_sides_hsize
+\newdimension \d_page_sides_vsize
+\newdimension \d_page_sides_vsize_reset
+\newdimension \d_page_sides_progress
+\newdimension \d_page_sides_page_total
+\newdimension \d_page_sides_shape_down_shift
+
+\newdimension \d_page_sides_leftoffset
+\newdimension \d_page_sides_rightoffset
%newbox \b_page_sides_bottom
+\newbox \b_page_sides_spill_over
-\newcount \c_page_sides_lines_done
-\newcount \c_page_sides_checks_done
-\newcount \c_page_sides_n_of_lines
-\newcount \c_page_sides_n_of_hang
+\newinteger \c_page_sides_lines_done
+\newinteger \c_page_sides_checks_done
+\newinteger \c_page_sides_n_of_lines
+\newinteger \c_page_sides_n_of_hang
\newconstant \c_page_sides_float_type
-\newcount \c_page_sides_hangafter
+\newinteger \c_page_sides_hangafter
\newconditional \c_page_sides_short
\newconditional \c_page_sides_flag
-
-\newdimen \d_page_sides_shift
-\newdimen \d_page_sides_extrashift
-\newdimen \d_page_sides_leftshift
-\newdimen \d_page_sides_rightshift
-\newdimen \d_page_sides_leftskip
-\newdimen \d_page_sides_rightskip
-\newdimen \d_page_sides_maximum
-\newdimen \d_page_sides_topskip
-\newdimen \d_page_sides_bottomskip
-\newdimen \d_page_sides_midskip
-\newdimen \d_page_sides_downshift
-\newdimen \d_page_sides_pagetotal
-\newdimen \d_page_sides_topoffset
-\newdimen \d_page_sides_bottomoffset
-\newdimen \d_page_sides_toptotal
-\newdimen \d_page_sides_bottomtotal
+\newconditional \c_page_sides_shape_down
+\newconditional \c_page_sides_keep_together
+
+\newdimension \d_page_sides_shift
+\newdimension \d_page_sides_extrashift
+\newdimension \d_page_sides_leftshift
+\newdimension \d_page_sides_rightshift
+\newdimension \d_page_sides_leftskip
+\newdimension \d_page_sides_rightskip
+\newdimension \d_page_sides_maximum
+\newdimension \d_page_sides_topskip
+\newdimension \d_page_sides_bottomskip
+\newdimension \d_page_sides_midskip
+\newdimension \d_page_sides_downshift
+\newdimension \d_page_sides_pagetotal
+\newdimension \d_page_sides_topoffset
+\newdimension \d_page_sides_bottomoffset
+\newdimension \d_page_sides_toptotal
+\newdimension \d_page_sides_bottomtotal
\newconstant \c_page_sides_align
\newconstant \c_page_sides_skipmode
@@ -79,12 +83,12 @@
\newconstant \c_page_sides_method % sort of obsolete
-\newdimen \d_page_sides_progression
+\newdimension \d_page_sides_progression
-\newcount \c_page_sides_m_of_lines
+\newinteger \c_page_sides_m_of_lines
\newconditional \c_page_sides_delayed
-\newconditional \c_page_sides_check_same_page
+%newconditional \c_page_sides_check_same_page
\newif \iftracesidefloats % public (might change)
@@ -168,12 +172,12 @@
% cutspace
\fi
\fi
- \ifdim\d_page_sides_shift=\zeropoint \relax
+ \ifzeropt\d_page_sides_shift
\ifnum\c_page_sides_float_type=\plusfour
- \global\advance\d_page_sides_shift\d_page_sides_extrashift
+ \global\advanceby\d_page_sides_shift\d_page_sides_extrashift
\global\d_page_sides_extrashift\zeropoint
\orelse\ifnum\c_page_sides_float_type=\plusfive
- \global\advance\d_page_sides_shift\d_page_sides_extrashift
+ \global\advanceby\d_page_sides_shift\d_page_sides_extrashift
\global\d_page_sides_extrashift\zeropoint
\fi
\else
@@ -228,10 +232,10 @@
\global\d_page_sides_leftoffset \d_page_sides_rightskip
\global\d_page_sides_rightoffset\d_page_sides_leftskip
\ifdim\d_page_sides_rightskip>\zeropoint
- \global\advance\d_page_sides_rightskip\rightskip
+ \global\advanceby\d_page_sides_rightskip\rightskip
\fi
\ifdim\d_page_sides_leftskip >\zeropoint
- \global\advance\d_page_sides_leftskip \leftskip
+ \global\advanceby\d_page_sides_leftskip \leftskip
\fi}
%D Shifts get applied to the float box:
@@ -292,7 +296,7 @@
\box\floatbox
% somehow we need this \scratchbox magic, but at least it's the same as the
% tracer now
- \setbox\scratchbox\emptybox
+ \setbox\scratchbox\emptyhbox
\wd\scratchbox\hsize
\ht\scratchbox\d_page_sides_bottomtotal
\box\scratchbox
@@ -327,10 +331,11 @@
\getnoflines{\ht\floatbox}%
\privatescratchdimen\dimexpr\noflines\lineheight-\strutdp\relax
\getrawnoflines\d_page_sides_toptotal
- \advance\privatescratchdimen\noflines\lineheight
+ \advanceby\privatescratchdimen\noflines\lineheight
\page_sides_force_depth
\ht\floatbox\privatescratchdimen
\dp\floatbox\zeropoint
+ \else
\fi
\ifcase\c_page_sides_align \else
\global\d_page_sides_toptotal\zeropoint
@@ -346,22 +351,31 @@
% the top of the box is at the previous baseline
\ifcase\c_page_sides_align
% 0 normal
- \advance\privatescratchdimen\strutdp % or \openstrutdepth
+ \advanceby\privatescratchdimen\strutdp % or \openstrutdepth
\or % 1 height
- \advance\privatescratchdimen\strutdp % or \openstrutdepth
+ \advanceby\privatescratchdimen\strutdp % or \openstrutdepth
\or % 2 line
\or % 3 depth
- \advance\privatescratchdimen\lineheight % or \openlineheight
- \advance\privatescratchdimen\strutdp % or \openstrutdepth
+ \advanceby\privatescratchdimen\lineheight % or \openlineheight
+ \advanceby\privatescratchdimen\strutdp % or \openstrutdepth
\or % 4 grid
\privatescratchdimen\zeropoint
\or
- \advance\privatescratchdimen\strutht % or \openstrutheight
+ \advanceby\privatescratchdimen\strutht % or \openstrutheight
\fi
% new
\global\c_page_sides_lines_done\zerocount
- \ifnum\c_page_sides_n_of_lines>\zerocount
- \advance\privatescratchdimen\c_page_sides_n_of_lines\lineheight
+ \ifconditional\c_page_sides_shape_down
+ \global\d_page_sides_shape_down_shift\dimexpr
+ \privatescratchdimen
+ +\htdp\floatbox
+% -\lineheight
+ \relax
+ \advanceby\privatescratchdimen\c_page_sides_n_of_lines\lineheight
+\advanceby\privatescratchdimen2\lineheight
+ \else
+ \global\d_page_sides_shape_down_shift\zeropoint
+ \advanceby\privatescratchdimen\c_page_sides_n_of_lines\lineheight
\fi
\iftracesidefloats
\page_sides_apply_vertical_shift_traced % uses \privatescratchdimen
@@ -397,27 +411,56 @@
%D preceding material has more depth than that already. This way anchoring
%D becomes predictable.
+% \protected\def\page_sides_force_depth
+% {\iftracesidefloats
+% \begingroup
+% \c_page_force_strut_depth_trace_mode\plusone
+% \ifconditional\c_page_sides_check_same_page
+% \forcestrutdepthplus
+% \else
+% \forcestrutdepth
+% \fi
+% \endgroup
+% \else
+% \ifconditional\c_page_sides_check_same_page
+% \forcestrutdepthplus
+% \else
+% \forcestrutdepth
+% \fi
+% \fi
+% \page_otr_command_set_vsize} % new
+
+% test case:
+%
+% \starttext
+% \strut\vskip180mm \input ward
+% \subject{Test}
+% \placefigure[right,none]{none}{\blackrule[width=4cm,height=3cm]} test
+% \stoptext
+
\protected\def\page_sides_force_depth
{\iftracesidefloats
- \begingroup
- \c_page_force_strut_depth_trace_mode\plusone
- \ifconditional\c_page_sides_check_same_page
- \forcestrutdepthplus
- \else
- \forcestrutdepth
- \fi
- \endgroup
+ \enabletrackers[otr.forcestrutdepth]% \c_page_force_strut_depth_trace_mode\plusone
+ \fi
+ % \unless\ifvmode
+ % \writestatus{side floats}{confusion}
+ % \fi
+ % flush what we have and check
+ \forcestrutdepth
+ % trigger pagebuilder, \pageboundary gives nicer tracing
+ \iffalse
+ \penalty\zerocount % works too
\else
- \ifconditional\c_page_sides_check_same_page
- \forcestrutdepthplus
- \else
- \forcestrutdepth
- \fi
+ %\tracingpages\plusone \tracingonline\plustwo
+ \pageboundary\plustenthousand % becomes a penalty (after triggering the callback) (experimental!)
+ %\tracingpages\zerocount
\fi
- \page_otr_command_set_vsize} % new
+ \page_otr_command_set_vsize} % new, no longer really needed
\def\page_sides_flush_floats
- {\par
+ {\ifconditional\c_page_sides_shape_down\else
+ \par
+ \fi
\ifdim\d_page_sides_flush_criterium>\zeropoint
\page_sides_flush_floats_progress
\page_sides_flush_floats_after_next
@@ -472,10 +515,10 @@
\installcorenamespace{sidefloatsteps}
-\setvalue{\??sidefloatsteps\v!line }{\strut}
-\setvalue{\??sidefloatsteps\v!big }{\strut}
-\setvalue{\??sidefloatsteps\v!medium}{\halflinestrut} % was \halfstrut
-\setvalue{\??sidefloatsteps\v!small }{\noheightstrut} % was \quarterstrut
+\defcsname\??sidefloatsteps\v!line \endcsname{\strut}
+\defcsname\??sidefloatsteps\v!big \endcsname{\strut}
+\defcsname\??sidefloatsteps\v!medium\endcsname{\halflinestrut} % was \halfstrut
+\defcsname\??sidefloatsteps\v!small \endcsname{\noheightstrut} % was \quarterstrut
\def\page_sides_flush_floats_tracer
{\dontleavehmode
@@ -491,7 +534,7 @@
\egroup}}
\def\page_sides_flush_floats_normal
- {\ifdim\scratchdimen>\htdp\strutbox
+ {\ifdim\scratchdimen>\struthtdp
\strut
\else
\m_pages_strut
@@ -623,15 +666,19 @@
\def\page_sides_place_float
{\ifnum\c_page_sides_float_type=\plusfour \kern\d_page_sides_toptotal \fi
\ifnum\c_page_sides_float_type=\plusfive \kern\d_page_sides_toptotal \fi
- \ifgridsnapping
- \page_sides_place_float_grid
- \else
+ \ifconditional\c_page_sides_shape_down
\page_sides_place_float_normal
- \fi
- \par
- \kern-\d_page_sides_height
- \penalty10001 % oeps, this will change
- \normalbaselines}
+ \else
+ \ifgridsnapping
+ \page_sides_place_float_grid
+ \else
+ \page_sides_place_float_normal
+ \fi
+ \par
+ \kern-\d_page_sides_height
+ \penalty10001 % oeps, this will change
+ \normalbaselines
+ \fi}
\def\page_sides_place_float_normal
{\page_sides_push_float_inline\firstofoneargument}
@@ -653,17 +700,39 @@
\let\strc_floats_mark_par_as_free\relax
-\def\page_sides_push_float_inline#1%
- {\begingroup
- \reseteverypar % needed !
- \parskip\zeropoint % needed !
- \nointerlineskip
- \page_sides_set_skips
- \page_floats_report_total
- \relax
- \lefttoright
- \strc_floats_mark_par_as_free
- \ifcase\c_page_sides_float_type
+% \def\page_sides_push_float_inline#1%
+% {\begingroup
+% \reseteverypar % needed !
+% \parskip\zeropoint % needed !
+% \nointerlineskip
+% \page_sides_set_skips
+% \page_floats_report_total
+% \relax
+% %\lefttoright % not needed in lmtx
+% \strc_floats_mark_par_as_free
+% \ifcase\c_page_sides_float_type
+% % invalid
+% \or % backspace
+% \noindent#1{\llap{\rlap{\box\floatbox}\kern\d_page_sides_leftskip}}\hfill
+% \or % leftedge
+% \noindent#1{\llap{\box\floatbox\kern\d_page_sides_leftskip}}\hfill
+% \or % leftmargin
+% \noindent#1{\llap{\box\floatbox\kern\d_page_sides_leftskip}}\hfill
+% \or % leftside
+% \noindent#1{\box\floatbox}\hfill
+% \or % rightside
+% \hfill#1{\box\floatbox}%
+% \or % rightmargin
+% \hfill#1{\rlap{\kern\d_page_sides_rightskip\box\floatbox}}%
+% \or % rightedge
+% \hfill#1{\rlap{\kern\d_page_sides_rightskip\box\floatbox}}%
+% \or % cutspace
+% \hfill#1{\rlap{\kern\d_page_sides_rightskip\llap{\box\floatbox}}}%
+% \fi
+% \endgroup}
+
+\def\page_sides_push_float_inline_indeed#1%
+ {\ifcase\c_page_sides_float_type
% invalid
\or % backspace
\noindent#1{\llap{\rlap{\box\floatbox}\kern\d_page_sides_leftskip}}\hfill
@@ -681,16 +750,36 @@
\hfill#1{\rlap{\kern\d_page_sides_rightskip\box\floatbox}}%
\or % cutspace
\hfill#1{\rlap{\kern\d_page_sides_rightskip\llap{\box\floatbox}}}%
- \fi
- \endgroup}
+ \fi}
+
+\def\page_sides_push_float_inline#1%
+ {\ifconditional\c_page_sides_shape_down
+ \page_sides_set_skips
+ \page_floats_report_total
+ \global\setbox\floatbox\hbox to \hsize\bgroup
+ \page_sides_push_float_inline_indeed#1%
+ \egroup
+ \else
+ \begingroup
+ \reseteverypar % needed !
+ \parskip\zeropoint % needed !
+ \nointerlineskip
+ \page_sides_set_skips
+ \page_floats_report_total
+ \relax
+ %\lefttoright % not needed in lmtx
+ \strc_floats_mark_par_as_free
+ \page_sides_push_float_inline_indeed#1%
+ \endgroup
+ \fi}
% \def\page_sides_analyse_progress
% {\d_page_sides_progress\d_page_sides_vsize
% \ifconditional\c_page_sides_flag
-% \advance\d_page_sides_progress-\d_page_sides_page_total
+% \advanceby\d_page_sides_progress-\d_page_sides_page_total
% \global\setfalse\c_page_sides_flag
% \else
-% \advance\d_page_sides_progress-\pagetotal
+% \advanceby\d_page_sides_progress-\pagetotal
% \fi}
% test case
@@ -711,7 +800,7 @@
{%\page_otr_command_set_vsize % this is new, otherwise topfloats are not taken into account
\d_page_sides_progress\d_page_sides_vsize
\ifconditional\c_page_sides_flag
- \advance\d_page_sides_progress-\d_page_sides_page_total
+ \advanceby\d_page_sides_progress-\d_page_sides_page_total
\global\setfalse\c_page_sides_flag
\else
\ifdim\dimexpr\d_page_sides_progress+\d_page_sides_bottomtotal\relax>\pagegoal
@@ -719,7 +808,7 @@
% everypar and we hope that it triggers a flush, see test above
\pagegoal\dimexpr\pagegoal-\d_page_sides_bottomtotal\relax
\fi
- \advance\d_page_sides_progress-\pagetotal
+ \advanceby\d_page_sides_progress-\pagetotal
\fi}
\def\page_sides_analyse_space_stage_one
@@ -727,7 +816,7 @@
% \ifdim\pagegoal=\maxdimen
% \pagegoal\textheight % maybe
% \fi
- \global\d_page_sides_page_total \pagetotal % global
+ \global\d_page_sides_page_total\pagetotal % global
\ifnum\c_page_sides_float_type<\plusfour
\global\d_page_sides_width \zeropoint
\orelse\ifnum\c_page_sides_float_type>\plusfive
@@ -739,7 +828,7 @@
\global\d_page_sides_width\zeropoint
\fi
\global\d_page_sides_hsize \dimexpr\hsize-\d_page_sides_width\relax
- \global\d_page_sides_height\dimexpr\ht\floatbox+\dp\floatbox+\d_page_sides_toptotal\relax
+ \global\d_page_sides_height\dimexpr\htdp\floatbox+\d_page_sides_toptotal\relax
\global\d_page_sides_vsize \dimexpr\d_page_sides_height+\d_page_sides_page_total\relax
\scratchdimenone\d_page_sides_vsize
\scratchdimentwo\pagegoal
@@ -748,19 +837,19 @@
% method 0 : raw
\or
% method 1 : safe (default)
- \advance\scratchdimentwo -\strutdp
+ \advanceby\scratchdimentwo -\strutdp
\or
% method 2 : tight (grid default)
- \advance\scratchdimenone -\onepoint
+ \advanceby\scratchdimenone -\onepoint
\fi
\or
% tolerant
- \advance\scratchdimentwo -.5\strutdp
+ \advanceby\scratchdimentwo -.5\strutdp
\or
% verytolerant
- % \advance\scratchdimenone -\onepoint (maybe)
+ % \advanceby\scratchdimenone -\onepoint (maybe)
\else
- \advance\scratchdimentwo -\strutdp
+ \advanceby\scratchdimentwo -\strutdp
\fi}
\def\page_sides_analyse_space_stage_two
@@ -769,11 +858,11 @@
\global\setfalse\c_page_floats_room
\else
\ifdim\dimexpr\pagegoal-\d_page_sides_vsize\relax<\d_page_sides_bottomtotal
- % just weird: \global\advance\d_page_sides_vsize \scratchdimenone
+ % just weird: \global\advanceby\d_page_sides_vsize \scratchdimenone
\global\settrue\c_page_sides_short
% why was this \global\holdinginserts\plusone
\else
- \global\advance\d_page_sides_vsize \d_page_sides_bottomtotal % wins over inbetween
+ \global\advanceby\d_page_sides_vsize \d_page_sides_bottomtotal % wins over inbetween
\global\setfalse\c_page_sides_short
\fi
\global\settrue\c_page_floats_room
@@ -781,19 +870,22 @@
\def\page_sides_analyse_space
{\page_sides_analyse_space_stage_one
- \ifconditional\c_page_sides_check_same_page
- \ifdim\d_spac_prevcontent>\zeropoint
- \ifdim\dimexpr\scratchdimenone+\d_spac_prevcontent>\scratchdimentwo
- \clf_pushatsame
- \setbox\scratchbox\vpack{\clf_popatsame}%
- \page
- \box\scratchbox
- \vskip-\lineskip
- \page_sides_analyse_space_stage_one
- \fi
- \fi
- \fi
- \page_sides_analyse_space_stage_two}
+% \ifconditional\c_page_sides_check_same_page
+% \ifdim\d_spac_prevcontent>\zeropoint
+% \ifdim\dimexpr\scratchdimenone+\d_spac_prevcontent>\scratchdimentwo
+% \clf_pushatsame
+% \setbox\scratchbox\vpack{\clf_popatsame}%
+% \page
+% \box\scratchbox
+% \vskip-\lineskip
+% \page_sides_analyse_space_stage_one
+% \fi
+% \fi
+% \fi
+ \page_sides_analyse_space_stage_two
+ \ifconditional\c_page_sides_shape_down
+ \global\settrue\c_page_floats_room
+ \fi}
%D As we have no clear end of one or more paragraphs we only have pre float
%D skips.
@@ -807,6 +899,40 @@
\prevdepth\strutdp}
%\ignoreparskip}
+% \def\page_sides_handle_float#1%
+% {\page_sides_initialize_checker
+% \page_sides_check_horizontal_skips
+% \page_sides_check_vertical_skips
+% \page_sides_apply_horizontal_shift
+% \page_sides_check_previous_float
+% \page_sides_inject_before
+% \page_sides_inject_dummy_lines
+% \page_sides_relocate_float{#1}%
+% \page_sides_apply_vertical_shift
+% \page_sides_analyse_space
+% \ifconditional\c_page_floats_room
+% \global\setfalse\c_page_sides_delayed
+% % we're ok
+% \else
+% \global\settrue\c_page_sides_delayed
+% \global\c_page_sides_m_of_lines\c_page_sides_n_of_lines
+% \ifcase\c_page_sides_page_method
+% \page_otr_fill_and_eject_page
+% \or
+% \page_otr_force_new_page_one
+% \else
+% \page_otr_fill_and_eject_page
+% \fi
+% \global\c_page_sides_n_of_lines\c_page_sides_m_of_lines
+% \page_sides_analyse_space
+% %\page_sides_inject_before
+% \page_sides_inject_dummy_lines
+% \fi
+% \page_sides_place_float
+% \global\setfalse\c_page_sides_delayed
+% \page_sides_check_floats_reset
+% \page_sides_wrapup}
+
\def\page_sides_handle_float#1%
{\page_sides_initialize_checker
\page_sides_check_horizontal_skips
@@ -822,16 +948,21 @@
\global\setfalse\c_page_sides_delayed
% we're ok
\else
+ \ifconditional\c_page_sides_keep_together
+ \clf_interceptsamepagecontent\b_page_sides_spill_over
+ \fi
\global\settrue\c_page_sides_delayed
\global\c_page_sides_m_of_lines\c_page_sides_n_of_lines
\ifcase\c_page_sides_page_method
- \page_otr_fill_and_eject_page
+ \page_otr_fill_and_eject_page
\or
- \page_otr_force_new_page_one
+ \page_otr_force_new_page_one
\else
- \page_otr_fill_and_eject_page
+ \page_otr_fill_and_eject_page
+ \fi
+ \ifvoid\b_page_sides_spill_over\else
+ \box\b_page_sides_spill_over
\fi
- \global\c_page_sides_n_of_lines\c_page_sides_m_of_lines
\page_sides_analyse_space
%\page_sides_inject_before
\page_sides_inject_dummy_lines
@@ -845,7 +976,39 @@
{% we need to do this aftergroup
\aftergroup\par
\aftergroup\ignoreparskip
- \aftergroup\ignorespaces}
+ \aftergroup\ignorespaces
+ \aftergroup\page_sizes_delay_float}%
+
+\def\page_sides_local_float_flush
+ {\ifconditional\c_page_sides_shape_down
+ \ifnum\localboxlinenumber=\c_page_sides_n_of_lines\relax
+ \hpack to \localboxlinewidth
+ xoffset -\the\localboxlinewidth
+ yoffset -\d_page_sides_shape_down_shift
+ {\box\floatbox}%
+ \fi
+ \fi}
+
+%D Experimental and tricky:
+%D
+%D \starttext
+%D \samplefile{lorem} \blank[20*line]
+%D \startplacefigure[location={right,15*hang,force}]
+%D %\startplacefigure[location={right,15*hang}]
+%D \framed[width=30mm,height=20mm]{!!}
+%D \stopplacefigure
+%D \dorecurse{10}{\samplefile{lorem}}
+%D \stoptext
+
+\definelocalboxes
+ [\v!left:\v!float]
+ [\c!command=\page_sides_local_float_flush,
+ \c!location=\v!middle]
+
+\def\page_sizes_delay_float
+ {\ifconditional\c_page_sides_shape_down
+ \localbox[\v!left:\v!float]{}%
+ \fi}%
\def\page_sides_check_floats_indeed
{\page_sides_analyse_progress
@@ -911,7 +1074,7 @@
\ifx\p_sidethreshold\v!old
\d_page_sides_progression\dimexpr\d_page_sides_progress+\strutht-\roundingeps\relax
\c_page_sides_n_of_hang\d_page_sides_progression
- \divide\c_page_sides_n_of_hang \baselineskip\relax
+ \divideby\c_page_sides_n_of_hang \baselineskip\relax
\else
\d_page_sides_progression
\ifempty\p_sidethreshold
@@ -935,8 +1098,8 @@
\global\c_page_sides_lines_done\c_page_sides_n_of_hang
\else
\privatescratchcounter\c_page_sides_lines_done
- \advance\privatescratchcounter-\c_page_sides_n_of_hang
- \global\advance\c_page_sides_n_of_lines-\privatescratchcounter
+ \advanceby\privatescratchcounter-\c_page_sides_n_of_hang
+ \global\advanceby\c_page_sides_n_of_lines-\privatescratchcounter
\fi
\fi
\ifnum\c_page_sides_n_of_lines>\zerocount
@@ -946,8 +1109,8 @@
\dorecurse\c_page_sides_n_of_lines
{\toksapp\privatescratchtoks{\zeropoint\hsize}}%
\ifnum\c_page_sides_n_of_hang>\c_page_sides_n_of_lines
- \advance\c_page_sides_n_of_hang -\c_page_sides_n_of_lines\relax
- \advance\privatescratchcounter\c_page_sides_n_of_hang
+ \advanceby\c_page_sides_n_of_hang -\c_page_sides_n_of_lines\relax
+ \advanceby\privatescratchcounter\c_page_sides_n_of_hang
\dorecurse\c_page_sides_n_of_hang % weird, shouldn't that be scratchcounter
{\ifnum\c_page_sides_float_type>\plusfour
\toksapp\privatescratchtoks{\zeropoint\privatescratchdimen}%
@@ -966,7 +1129,7 @@
\global\c_page_sides_hangafter\hangafter
\fi
\fi
- \global\advance\c_page_sides_checks_done \plusone
+ \global\advanceby\c_page_sides_checks_done \plusone
\iftracesidefloats
\page_sides_check_floats_tracer
\fi}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-smp.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-smp.mkxl
index ccb0e989e82..2f620bdbca3 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-smp.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-smp.mkxl
@@ -13,6 +13,8 @@
\unprotect
+\startcontextdefinitioncode
+
%D The old one:
\definemixedcolumns
@@ -30,6 +32,7 @@
{\bgroup
\setsimplecolumnshsize[#1]%
\nopenalties
+ \enforced\permanent\protected\def\column{\vfill\break}% quick hack
\setbox\scratchbox\vbox\bgroup
\forgetall} % \blank[\v!disable]
@@ -49,8 +52,10 @@
\edef\rigidcolumnlines
{\directdummyparameter\c!lines}%
\setrigidcolumnhsize
- {\directdummyparameter\c!width}%
- {\directdummyparameter\c!distance}%
+ {\directdummyparameter\c!width}
+ {\directdummyparameter\c!distance}
{\directdummyparameter\c!n}}
+\stopcontextdefinitioncode
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-spr.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-spr.mkxl
index 49285c96fef..3d83126ce4a 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-spr.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-spr.mkxl
@@ -29,6 +29,7 @@
\freezetextwidth
\hsize\textwidth % local variant of \sethsize
\boxmaxdepth\maxdepth
+ \page_otr_flush_top_content
\noindent % content can be < \hsize
\page_otr_command_package_contents#2#3}}%
\dp#1\zeropoint
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-str.lmt b/Master/texmf-dist/tex/context/base/mkxl/page-str.lmt
new file mode 100644
index 00000000000..9c2562cc40b
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-str.lmt
@@ -0,0 +1,320 @@
+if not modules then modules = { } end modules ['page-str'] = {
+ version = 1.001,
+ comment = "companion to page-str.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- streams -> managers.streams
+
+-- work in progresss .. unfinished .. non-optimized
+
+local concat, insert, remove = table.concat, table.insert, table.remove
+
+local nodes, node = nodes, node
+
+local tasks = nodes.tasks
+
+local implement = interfaces.implement
+
+local nodecodes = nodes.nodecodes
+
+local nuts = nodes.nuts
+local tonut = nodes.tonut
+local slide_node_list = nuts.slide
+local write_node = nuts.write
+local flushnode = nuts.flush
+local copy_node_list = nuts.copylist
+local vpack_node_list = nuts.vpack
+local new_strut = nuts.pool.strutrule
+
+----- getbox = nuts.getbox
+local setlink = nuts.setlink
+local getlist = nuts.getlist
+local setlist = nuts.setlist
+local getwhd = nuts.getwhd
+local setwhd = nuts.setwhd
+local setattrlist = nuts.setattrlist
+
+local settings_to_array = utilities.parsers.settings_to_array
+
+local enableaction = nodes.tasks.enableaction
+
+local texgetdimen = tex.getdimen
+
+local trace_collecting = false trackers.register("streams.collecting", function(v) trace_collecting = v end)
+local trace_flushing = false trackers.register("streams.flushing", function(v) trace_flushing = v end)
+
+local report_streams = logs.reporter("streams")
+
+streams = streams or { } -- might move to the builders namespace
+local streams = streams
+
+-- maybe store head and tail ... first we need usage
+
+local data = { }
+local name = nil
+local stack = { }
+
+function streams.enable(newname)
+ if newname == "default" then
+ name = nil
+ else
+ name = newname
+ end
+end
+
+function streams.disable()
+ name = stack[#stack]
+end
+
+function streams.start(newname)
+ insert(stack,name)
+ name = newname
+end
+
+function streams.stop(newname)
+ name = remove(stack)
+end
+
+function streams.collect(head,where)
+ if name and head and name ~= "default" then
+ local head = tonut(head)
+ local dana = data[name]
+ if not dana then
+ dana = { }
+ data[name] = dana
+ end
+ local last = dana[#dana]
+ if last then
+ local tail = slide_node_list(last)
+ setlink(tail,head)
+ elseif last == false then
+ dana[#dana] = head
+ else
+ dana[1] = head
+ end
+ if trace_collecting then
+ report_streams("appending snippet %a to slot %s",name,#dana)
+ end
+ return nil
+ else
+ return head
+ end
+end
+
+function streams.push(thename)
+ if not thename or thename == "" then
+ thename = name
+ end
+ if thename and thename ~= "" then
+ local dana = data[thename]
+ if dana then
+ dana[#dana+1] = false
+ if trace_collecting then
+ report_streams("pushing snippet %a",thename)
+ end
+ end
+ end
+end
+
+function streams.flush(name,copy) -- problem: we need to migrate afterwards
+ local dana = data[name]
+ if dana then
+ local dn = #dana
+ if dn == 0 then
+ -- nothing to flush
+ elseif copy then
+ if trace_flushing then
+ report_streams("flushing copies of %s slots of %a",dn,name)
+ end
+ for i=1,dn do
+ local di = dana[i]
+ if di then
+ write_node(copy_node_list(getlist(di))) -- list, will be option
+ end
+ end
+ if copy then
+ data[name] = nil
+ end
+ else
+ if trace_flushing then
+ report_streams("flushing %s slots of %a",dn,name)
+ end
+ for i=1,dn do
+ local di = dana[i]
+ if di then
+ write_node(getlist(di)) -- list, will be option
+ setlist(di)
+ flushnode(di)
+ end
+ end
+ end
+ end
+end
+
+function streams.synchronize(list) -- this is an experiment !
+ -- we don't optimize this as we want to trace in detail
+ list = settings_to_array(list)
+ local max = 0
+ if trace_flushing then
+ report_streams("synchronizing list: % t",list)
+ end
+ for i=1,#list do
+ local dana = data[list[i]]
+ if dana then
+ local n = #dana
+ if n > max then
+ max = n
+ end
+ end
+ end
+ if trace_flushing then
+ report_streams("maximum number of slots: %s",max)
+ end
+ for m=1,max do
+ local height, depth = 0, 0
+ for i=1,#list do
+ local name = list[i]
+ local dana = data[name]
+ if dana then
+ local slot = dana[m]
+ if slot then
+ local vbox = vpack_node_list(slot)
+ local wd, ht, dp = getwhd(vbox)
+ if ht > height then
+ height = ht
+ end
+ if dp > depth then
+ depth = dp
+ end
+ dana[m] = vbox
+ if trace_flushing then
+ report_streams("slot %s of %a is packed to height %p and depth %p",m,name,ht,dp)
+ end
+ end
+ end
+ end
+ if trace_flushing then
+ report_streams("slot %s has max height %p and max depth %p",m,height,depth)
+ end
+ local strutht = texgetdimen("globalbodyfontstrutheight")
+ local strutdp = texgetdimen("globalbodyfontstrutdepth")
+ local struthtdp = strutht + strutdp
+ for i=1,#list do
+ local name = list[i]
+ local dana = data[name]
+ if dana then
+ local vbox = dana[m]
+ if vbox then
+ local wd, ht, dp = getwhd(vbox)
+ local delta_height = height - ht
+ local delta_depth = depth - dp
+ if delta_height > 0 or delta_depth > 0 then
+ if false then
+ -- actually we need to add glue and repack
+ setwhd(vbox,false,height,depth)
+ if trace_flushing then
+ report_streams("slot %s of %a with delta (%p,%p) is compensated",m,i,delta_height,delta_depth)
+ end
+ else
+ -- this is not yet ok as we also need to keep an eye on vertical spacing
+ -- so we might need to do some splitting or whatever
+ local list = getlist(vbox)
+ local tail = list and slide_node_list(list)
+ local n = 0
+ local delta = delta_height -- for tracing
+ while delta > 0 do
+ -- we need to add some interline penalties
+ local strut = new_strut(0,strutht,strutdp)
+ setattrlist(strut,vbox)
+ if tail then
+ -- todo: inject at a better place
+ setlink(tail,strut)
+ end
+ tail = strut
+ n = n + 1
+ delta = delta - struthtdp
+ end
+ dana[m] = vpack_node_list(getlist(vbox))
+ setlist(vbox)
+ flushnode(vbox)
+ if trace_flushing then
+ report_streams("slot %s:%s with delta (%p,%p) is compensated by %s lines",m,i,delta_height,delta_depth,n)
+ end
+ end
+ end
+ end
+ else
+ -- make dummy
+ end
+ end
+ end
+end
+
+-- hm, nut or node
+
+tasks.appendaction("mvlbuilders", "normalizers", "streams.collect")
+
+tasks.disableaction("mvlbuilders", "streams.collect")
+
+function streams.initialize()
+ enableaction("mvlbuilders","streams.collect")
+ function streams.initialize() end
+end
+
+-- todo: remove empty last { }'s
+-- todo: better names, enable etc
+
+implement {
+ name = "initializestream",
+ actions = streams.initialize,
+ onlyonce = true,
+}
+
+implement {
+ name = "enablestream",
+ actions = streams.enable,
+ arguments = "string"
+}
+
+implement {
+ name = "disablestream",
+ actions = streams.disable
+}
+
+implement {
+ name = "startstream",
+ actions = streams.start,
+ arguments = "string"
+}
+
+implement {
+ name = "stopstream",
+ actions = streams.stop
+}
+
+implement {
+ name = "flushstream",
+ actions = streams.flush,
+ arguments = "string"
+}
+
+implement {
+ name = "flushstreamcopy",
+ actions = streams.flush,
+ arguments = { "string", true }
+}
+
+implement {
+ name = "synchronizestream",
+ actions = streams.synchronize,
+ arguments = "string"
+}
+
+implement {
+ name = "pushstream",
+ actions = streams.push,
+ arguments = "string"
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-str.mkxl b/Master/texmf-dist/tex/context/base/mkxl/page-str.mkxl
index d6e01ea595c..e883d8859e5 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-str.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-str.mkxl
@@ -27,11 +27,11 @@
%D
%D Remark: marknotes are gone, at least for a while.
-\registerctxluafile{page-str}{}
+\registerctxluafile{page-str}{autosuffix}
\unprotect
-\mutable\let\currentoutputstream\empty
+\mutable\lettonothing\currentoutputstream
\newif \ifinoutputstream % will become a conditional or mode
\newtoks \everyenableoutputstream
diff --git a/Master/texmf-dist/tex/context/base/mkxl/page-txt.mklx b/Master/texmf-dist/tex/context/base/mkxl/page-txt.mklx
index f8db27f38e7..76aa15cabf5 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/page-txt.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/page-txt.mklx
@@ -90,8 +90,8 @@
\fi
\to \everysetuplayoutelement
-\mutable\let\currenttextstate \empty
-\mutable\let\previoustextstate\empty
+\mutable\lettonothing\currenttextstate
+\mutable\lettonothing\previoustextstate
\def\page_layouts_reset_element_status#vertical%
{\gdefcsname\??layouttextsreset#vertical\endcsname{\page_layouts_set_element_status_normal#vertical}}
@@ -175,7 +175,7 @@
\permanent\protected\def\setupfootertexts{\setuptexts[\v!footer]}
\permanent\protected\def\setupbottomtexts{\setuptexts[\v!bottom]}
-\mutable\let\currentlayoutelementstate\empty
+\mutable\lettonothing\currentlayoutelementstate
\permanent\tolerant\protected\def\setuptexts[#vertical]#spacer[#horizontal]#spacer[#a]#spacer[#b]#spacer[#c]#spacer[#d]%
{\ifarguments
@@ -219,9 +219,9 @@
%D Left and right texts are swapped on odd and even pages, but only when double
%D sided typesetting is enabled.
-\setvalue{\??layouttextstrut\v!yes}{\setstrut\strut} % maybe more variants
+\defcsname\??layouttextstrut\v!yes\endcsname{\setstrut\strut} % maybe more variants
-\let\m_page_layouts_element_content\empty
+\lettonothing\m_page_layouts_element_content
\protected\def\page_layouts_process_element_single#content%
{\edef\m_page_layouts_element_content{\detokenize{#content}}% so no \v!xxx
@@ -252,12 +252,12 @@
\def\page_layouts_process_element_limited#content% are the {}{}{} still needed?
{\limitated
left \p_width
- text {#content}
- sentinel {\unknown}
+ text {#content}%
+ sentinel {\unknown}%
\relax}
-\setvalue{\??layouttextspecial\v!pagenumber}{\page_layouts_place_page_number}
-\setvalue{\??layouttextspecial\v!date }{\currentdate}
+\defcsname\??layouttextspecial\v!pagenumber\endcsname{\page_layouts_place_page_number}
+\defcsname\??layouttextspecial\v!date \endcsname{\currentdate}
%D When specified, the texts are automatically limited in length.
@@ -270,9 +270,9 @@
%D Texts can be disabled, moved up and ignored, depending in the \type {status}
%D variable. This is handled by the next couple of macros.
-\newcount\c_page_layouts_element_state_n
+\newinteger\c_page_layouts_element_state_n
-\mutable\let\textlinestatus\empty
+\mutable\lettonothing\textlinestatus
\def\page_layouts_set_element_status#vertical%
{\c_page_layouts_element_state_n=0\namedlayoutelementparameter#vertical\c!n\relax
@@ -321,24 +321,24 @@
\newconditional\resyncaftertextline
-\setvalue{\??layouttextsline\v!normal}{\page_layouts_place_text_line_indeed}
-\setvalue{\??layouttextsline\empty }{\page_layouts_place_text_line_indeed}
+\defcsname\??layouttextsline\v!normal\endcsname{\page_layouts_place_text_line_indeed}
+\defcsname\??layouttextsline\empty \endcsname{\page_layouts_place_text_line_indeed}
-\letvalue{\??layouttextsline\v!none}\gobbletwoarguments
-\letvalue{\??layouttextsline\v!stop}\gobbletwoarguments
+\letcsname\??layouttextsline\v!none\endcsname\gobbletwoarguments
+\letcsname\??layouttextsline\v!stop\endcsname\gobbletwoarguments
-\setvalue{\??layouttextsline\v!high}#vertical#height%
+\defcsname\??layouttextsline\v!high\endcsname#vertical#height%
{\global\settrue\resyncaftertextline
\page_layouts_reset_element_status#vertical}
-\setvalue{\??layouttextsline\v!empty}#vertical#height%
+\defcsname\??layouttextsline\v!empty\endcsname#vertical#height%
{\page_layouts_reset_element_status#vertical}
-\setvalue{\??layouttextsline\v!start}#vertical#height%
+\defcsname\??layouttextsline\v!start\endcsname#vertical#height%
{\page_layouts_reset_element_status#vertical%
\page_layouts_place_text_line_indeed#vertical#height}
-\setvalue{\??layouttextsline\v!nomarking}#vertical#height%
+\defcsname\??layouttextsline\v!nomarking\endcsname#vertical#height%
{\bgroup
\page_layouts_reset_element_status#vertical%
\settrue\inhibitgetmarking
@@ -367,7 +367,7 @@
\page_layouts_place_text_line_indeed#vertical#height%
\endgroup}
-\letvalue{\??layouttextsline\s!unknown}\page_layouts_place_text_line_unknown
+\letcsname\??layouttextsline\s!unknown\endcsname\page_layouts_place_text_line_unknown
%D The following macro has to be called after a page is flushed.
@@ -451,8 +451,8 @@
\box\b_page_layouts_element
\vkern-#height\relax}
-\let\page_layouts_place_extra_text_left \empty % historic
-\let\page_layouts_place_extra_text_right\empty % historic
+\lettonothing\page_layouts_place_extra_text_left % historic
+\lettonothing\page_layouts_place_extra_text_right % historic
\def\page_layouts_place_text_line_right
{\hpack
@@ -478,13 +478,13 @@
\page_layouts_left_edge_element\c!righttext\c!rightstyle\c!rightcolor\c!rightwidth
\fi
\ifdim\leftmarginwidth>\zeropoint
- \page_layouts_left_margin_element\c!righttext\c!rightstyle\c!rightcolor\c!rightwidth\zerocount
+ \page_layouts_left_margin_element\c!righttext\c!rightstyle\c!rightcolor\c!rightwidth\plusone
\fi
\ifdim\makeupwidth>\zeropoint
\page_layouts_text_body_element_e_r_m_l
\fi
\ifdim\rightmarginwidth>\zeropoint
- \page_layouts_right_margin_element\c!lefttext\c!leftstyle\c!leftcolor\c!leftwidth\plusone
+ \page_layouts_right_margin_element\c!lefttext\c!leftstyle\c!leftcolor\c!leftwidth\zerocount
\fi
\ifdim\rightedgewidth>\zeropoint
\page_layouts_right_edge_element\c!lefttext\c!leftstyle\c!leftcolor\c!leftwidth
@@ -495,10 +495,10 @@
\ifempty\p_text
\kern\leftedgewidth
\else
- \hbox to \leftedgewidth\bgroup
- \hss
- \page_layouts_process_element_indeed#style#color#width%
- \egroup
+ \hbox to \leftedgewidth\bgroup
+ \hss
+ \page_layouts_process_element_indeed#style#color#width%
+ \egroup
\fi}
\def\page_layouts_left_edge_element#text#style#color#width%
@@ -526,6 +526,9 @@
% margin needs checking!
+% \hbox to \leftmarginwidth{\hss\layoutelementparameter\c!margintext}%
+% \hbox to \rightmarginwidth{\layoutelementparameter\c!margintext\hss}%
+
\def\page_layouts_left_margin_element_indeed#text#style#color#width#margintoo%
{\letfromlayoutelementparameter\p_text#text%
\ifempty\p_text
@@ -766,7 +769,7 @@
% this can be done better now, no meaning hackery needed
\edef\currentlayoutelement{\m_page_layouts_page_number_location_v:\m_page_layouts_page_number_location_h}%
\edef\tempstring{\detokenizedlayoutelementparameter\m_page_layouts_page_number_location_x}%
- \doif{\meaning\tempstring}{\meaning\page_layouts_place_page_number}
+ \doif{\normalmeaningless\tempstring}{\normalmeaningless\page_layouts_place_page_number}
{\resetlayoutelementparameter\m_page_layouts_page_number_location_x}%
\fi}
@@ -777,33 +780,33 @@
\let\page_layouts_place_extra_text_left \page_layouts_place_page_number_left
\let\page_layouts_place_extra_text_right\page_layouts_place_page_number_right
\else
- \let\page_layouts_place_extra_text_left \empty
- \let\page_layouts_place_extra_text_right\empty
+ \lettonothing\page_layouts_place_extra_text_left
+ \lettonothing\page_layouts_place_extra_text_right
\fi}
\def\page_layouts_identify_page_number_location
{\let\m_page_layouts_page_number_location_v\v!footer
\let\m_page_layouts_page_number_location_h\v!text
\let\m_page_layouts_page_number_location_x\c!middletext
- \processallactionsinset[\directpagenumberingparameter\c!location]
- [ \v!header=>\let\m_page_layouts_page_number_location_v\v!header,
- \v!footer=>\let\m_page_layouts_page_number_location_v\v!footer,
+ \processallactionsinset[\directpagenumberingparameter\c!location]%
+ [ \v!header=>\let\m_page_layouts_page_number_location_v\v!header,%
+ \v!footer=>\let\m_page_layouts_page_number_location_v\v!footer,%
\v!middle=>\let\m_page_layouts_page_number_location_h\v!text
- \let\m_page_layouts_page_number_location_x\c!middletext,
+ \let\m_page_layouts_page_number_location_x\c!middletext,%
\v!left=>\let\m_page_layouts_page_number_location_h\v!text
- \let\m_page_layouts_page_number_location_x\c!lefttext,
+ \let\m_page_layouts_page_number_location_x\c!lefttext,%
\v!right=>\let\m_page_layouts_page_number_location_h\v!text
- \let\m_page_layouts_page_number_location_x\c!righttext,
+ \let\m_page_layouts_page_number_location_x\c!righttext,%
\v!inleft=>\let\m_page_layouts_page_number_location_h\v!margin
- \let\m_page_layouts_page_number_location_x\c!lefttext,
+ \let\m_page_layouts_page_number_location_x\c!lefttext,%
\v!inright=>\let\m_page_layouts_page_number_location_h\v!margin
- \let\m_page_layouts_page_number_location_x\c!righttext,
+ \let\m_page_layouts_page_number_location_x\c!righttext,%
\v!inmargin=>\let\m_page_layouts_page_number_location_h\v!margin
- \def\m_page_layouts_page_number_location_x{\ifdoublesided\c!margintext\else\c!righttext\fi},
+ \def\m_page_layouts_page_number_location_x{\ifdoublesided\c!margintext\else\c!righttext\fi},%
\v!margin=>\let\m_page_layouts_page_number_location_h\v!margin
- \def\m_page_layouts_page_number_location_x{\ifdoublesided\c!margintext\else\c!righttext\fi},
+ \def\m_page_layouts_page_number_location_x{\ifdoublesided\c!margintext\else\c!righttext\fi},%
\v!atmargin=>\let\m_page_layouts_page_number_location_h\v!text
- \let\m_page_layouts_page_number_location_x\c!marginedgetext,
+ \let\m_page_layouts_page_number_location_x\c!marginedgetext,%
\v!marginedge=>\let\m_page_layouts_page_number_location_h\v!text
\let\m_page_layouts_page_number_location_x\c!marginedgetext]}
@@ -863,7 +866,7 @@
{\setbox\b_page_layouts_element\vpack
{\dontcomplain
\calculatereducedvsizes
- \page_layouts_swap_margins
+ \page_layouts_swap_margins\v!text
\offinterlineskip
\vkern\dimexpr-\topheight-\topdistance\relax
\the\toptextcontent
@@ -884,10 +887,6 @@
\smashbox\b_page_layouts_element
\box\b_page_layouts_element}
-% \ifdefined\page_prepare_backgrounds\else
-% \let\page_prepare_backgrounds\gobbleoneargument
-% \fi
-
% only for very special controlled cases or experiments:
\let\page_scale_text_box\gobbleoneargument
@@ -897,13 +896,12 @@
{\offinterlineskip
\calculatereducedvsizes
\calculatehsizes
- \page_layouts_swap_margins
+ \page_layouts_swap_margins\v!page
\vkern\dimexpr\headerheight+\headerdistance+\textdistance\relax
\dontleavehmode
- %\page_prepare_backgrounds{#2}%
\hpack to \makeupwidth
{\begingroup
- \page_layouts_swap_margins
+ % \page_layouts_swap_margins\v!page
\goleftonpage
\ifdim\leftedgewidth>\zeropoint
\the\leftedgetextcontent
@@ -942,6 +940,8 @@
%D overload the the stored version .. eventually i will clear up the experimental
%D mess.
+\ifdefined\page_otr_flush_top_content\else \let\page_otr_flush_top_content\relax \fi
+
\protected\def\settextpagecontent#1#2#3% #2 and #3 will disappear / is overloaded
{\setbox#1\hpack to \makeupwidth
{\hss % so don't change this
@@ -951,6 +951,7 @@
\freezetextwidth
\hsize\textwidth % local variant of \sethsize <<< in columns?
\boxmaxdepth\maxdepth
+ \page_otr_flush_top_content
\noindent % content can be < \hsize
\page_otr_command_package_contents#2#3}% this will vbox
\hss}%
diff --git a/Master/texmf-dist/tex/context/base/mkxl/phys-dim.mkxl b/Master/texmf-dist/tex/context/base/mkxl/phys-dim.mkxl
index 51ebbe17209..8277ba2317d 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/phys-dim.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/phys-dim.mkxl
@@ -168,18 +168,13 @@
% \definesymbol[units][times][\ifmmode\cdot\else\kern.2\emwidth\cdot\kern.2\emwidth\fi]
\permanent\protected\def\digitstextbinop#1% assumes preceding
- {\ifmmode#1\else\fourperemspace\nobreak#1\fourperemspace\fi}
+ {\ifmmode\mathord{#1}\else\nobreak#1\fi}
-%frozen\def\digitstimessymbol{\ifmmode\cdot\else\digitstextbinop\cdot\fi}
\frozen\def\digitstimessymbol{\digitstextbinop\times}
\frozen\protected\def\digitszeropadding {\hphantom{0}}
-%frozen\protected\def\digitsnegative {\phys_digits_normalized{0}{\phys_digits_raised{\textminus}}}
-%frozen\protected\def\digitspositive {\phys_digits_normalized{0}{\phys_digits_raised{\textplus}}}
\frozen\protected\def\digitsnegative {\phys_digits_normalized{0}{\mathematics{\negative}}}
\frozen\protected\def\digitspositive {\phys_digits_normalized{0}{\mathematics{\positive}}}
-%frozen\protected\def\digitsminus {\phys_digits_normalized{0}{\mathematics{-}}}
-%frozen\protected\def\digitsplus {\phys_digits_normalized{0}{\mathematics{+}}}
\frozen\protected\def\digitsminus {\phys_digits_normalized{0}{\mathminus}}
\frozen\protected\def\digitsplus {\phys_digits_normalized{0}{\mathplus}}
\frozen\protected\def\digitsplusminus {\phys_digits_normalized{0}{\mathplusminus}}
@@ -388,31 +383,45 @@
\frozen\protected\def\unitsmediumspace{\medspace}
\frozen\protected\def\unitsbigspace {\thickspace}
\frozen\protected\def\unitsbackspace {\negthinspace}
+\frozen\protected\def\unitsmathspace {\ifmmode\mathatomskip\mathdimensioncode\mathdimensioncode\mathstyle\fi}
\permanent\protected\def\installunitsseparator#1#2%
{\defcsname\??unitseparator#1\endcsname{#2}}
\protected\def\phys_units_separator
- {\ifcsname\??unitseparator\unitparameter\c!separator\endcsname\lastnamedcs\else\cdot\fi}
+ {\ifcsname\??unitseparator\unitparameter\c!separator\endcsname\lastnamedcs\else\ifmmode\mathord\cdot\else\cdot\fi\fi} % Made \cdot an "ord" in math mode -GP
-\installunitsseparator\v!normal {\cdot}
-\installunitsseparator\v!big {\unitsbigspace}
-\installunitsseparator\v!medium {\unitsmediumspace}
-\installunitsseparator\v!small {\unitssmallspace}
-\installunitsseparator\v!none {}
+\installunitsseparator\v!normal{\ifmmode\mathord\cdot\else\cdot\fi} % Made \cdot an "ord" in math mode -GP
+\installunitsseparator\v!big {\unitsbigspace}
+\installunitsseparator\v!medium{\unitsmediumspace}
+\installunitsseparator\v!small {\unitssmallspace}
+\installunitsseparator\v!none {}
+\installunitsseparator\v!math {\unitsmathspace}
\permanent\protected\def\installunitsspace#1#2%
{\defcsname\??unitspace#1\endcsname{#2}}
+% \protected\def\phys_units_space
+% {\unskip % weird, why is unskip needed
+% \ifcsname\??unitspace\unitparameter\c!space\endcsname\lastnamedcs\else\unitsmediumspace\fi}
+
+% \im{1 \unit{hour} 20 \unit{minute} 56 \unit{second}}
+% \im{\unit{1 hour} \unit{20 minute} 56 \unit{second}}
+
\protected\def\phys_units_space
- {\unskip % weird, why is unskip needed
- \ifcsname\??unitspace\unitparameter\c!space\endcsname\lastnamedcs\else\unitsmediumspace\fi}
+ {\ifmmode
+ % let the atoms do the work
+ \else
+ \unskip % weird, why is unskip needed
+ \ifcsname\??unitspace\unitparameter\c!space\endcsname\lastnamedcs\else\unitsmediumspace\fi
+ \fi}
\installunitsspace\v!normal{\unitsmediumspace}
\installunitsspace\v!big {\unitsbigspace}
\installunitsspace\v!medium{\unitsmediumspace}
\installunitsspace\v!small {\unitssmallspace}
\installunitsspace\v!none {}
+\installunitsspace\v!math {\unitsmathspace}
\newtoks \everyunits % we keep the old \units command so we need a longer one
@@ -441,15 +450,14 @@
% \the\everyunits
%\removeunwantedspaces % not ok yet
\useunitstyleandcolor\c!style\c!color
- \edef\scratchstringone{\unitparameter\c!alternative}%
\ifmmode
- \ifx\scratchstringone\v!text
+ \ifcstok{\unitparameter\c!alternative}\v!text
\expandafter\expandafter\expandafter\phys_units_direct_text_in_math
\else
\expandafter\expandafter\expandafter\phys_units_direct_math
\fi
\else
- \ifx\scratchstringone\v!mathematics
+ \ifcstok{\unitparameter\c!alternative}\v!mathematics
\expandafter\expandafter\expandafter\phys_units_direct_math_in_text
\else
\expandafter\expandafter\expandafter\phys_units_direct_text
@@ -499,9 +507,6 @@
{\edef\p_order{\unitparameter\c!order}%
\ifx\p_order\v!reverse\expandafter\clf_unit_reverse\else\expandafter\clf_unit_normal\fi{\detokenize{#1}}}
-\permanent\protected\def\digitstextbinnop#1%
- {\ifmmode#1\else#1\fourperemspace\fi}
-
\permanent\protected\def\unitsPUS#1#2#3{\phys_units_next\prefixtext{#1}\unittext{#2}\unitsraise{\suffixtext{#3}}\c_phys_units_state\plusone} % suffix
\permanent\protected\def\unitsPU #1#2{\phys_units_next\prefixtext{#1}\unittext{#2}\c_phys_units_state\plusthree} % unit
\permanent\protected\def\unitsPS #1#2{\phys_units_next\prefixtext{#1}\unitsraise{\suffixtext{#2}}\c_phys_units_state\plusone} % suffix
@@ -609,7 +614,10 @@
\def\phys_units_start
{\ifmmode
\dostarttagged\t!maction\t!unit
- \bgroup % make an mrow
+ \mathatom
+ \s!leftclass \mathdimensioncode
+ \s!rightclass \mathdimensioncode
+ \bgroup
\else
\dostarttagged\t!unit\empty
\fi
@@ -674,7 +682,7 @@
\setfalse\c_phys_units_dospace
\phys_units_start}
-\permanent\protected\def\unitsTIMES
+\permanent\protected\def\unitsTIMES % GP: Does this do anything? HH: yes "times"
{\ifnum\c_phys_units_state=\plusone % suffix
\else
\unitssmallspace
diff --git a/Master/texmf-dist/tex/context/base/mkxl/publ-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/publ-ini.mkxl
index 2f4d817f24b..b75a933adbf 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/publ-ini.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/publ-ini.mkxl
@@ -81,7 +81,7 @@
\defineinterfacevariable {btxlist} {btxlist}
\defineinterfacevariable {btxrendering} {btxrendering}
-\definelabelclass[btxlabel][2]
+\definelabelclass [btxlabel] [2]
\clf_definelabels{btxlabel}{btx}\s!false\relax
@@ -112,8 +112,8 @@
%D to split between cite and list here as it only complicates matters (timing) and is
%D not clear either.
-\mutable\let\currentbtxspecification \empty
-\mutable\let\currentbtxspecificationfallback\empty
+\mutable\lettonothing\currentbtxspecification
+\mutable\lettonothing\currentbtxspecificationfallback
\installmacrostack\currentbtxspecification
\installmacrostack\currentbtxspecificationfallback
@@ -139,7 +139,7 @@
\edef\currentbtxspecification{#1}%
\edef\currentbtxspecificationfallback{\namedbtxparameter\currentbtxspecification\c!default}%
\ifx\currentbtxspecificationfallback\currentbtxspecification
- \let\currentbtxspecificationfallback\empty
+ \lettonothing\currentbtxspecificationfallback
\fi
\clf_btxsetspecification{\currentbtxspecification}}
@@ -152,7 +152,7 @@
{\edef\currentbtxspecification{#1}%
\edef\currentbtxspecificationfallback{\namedbtxparameter\currentbtxspecification\c!default}%
\ifx\currentbtxspecificationfallback\currentbtxspecification
- \let\currentbtxspecificationfallback\empty
+ \lettonothing\currentbtxspecificationfallback
\fi
% has to be done explicitly: \loadbtxdefinitionfile[\currentbtxspecification]%
\ifempty\currentbtxspecification
@@ -363,12 +363,12 @@
\publ_command_yes{#1}}
\permanent\protected\def\definebtxcommand#1% {body} #1..#n{body}
- {\setuvalue{\??btxcommand\csstring#1}}%
+ {\protected\defcsname\??btxcommand\csstring#1\endcsname}%
% access
-\let\currentbtxtag \empty
-\let\currentbtxdataset\v!default
+\lettonothing\currentbtxtag
+\let \currentbtxdataset\v!default
\permanent\protected\def\setbtxentry[#1]% or maybe btxsetentry
{\edef\currentbtxtag{\clf_btxsetentry{\currentbtxdataset}{#1}}}
@@ -441,30 +441,31 @@
%D Variables:
-\mutable\let\currentbtxbacklink \empty \permanent\protected\def\btxsetbacklink {\def\currentbtxbacklink}
-\mutable\let\currentbtxcategory \empty \permanent\protected\def\btxsetcategory {\def\currentbtxcategory}
-\mutable\let\currentbtxcombis \empty \permanent\protected\def\btxsetcombis {\def\currentbtxcombis}
-\mutable\let\currentbtxdataset \empty \permanent\protected\def\btxsetdataset {\def\currentbtxdataset}
-\mutable\let\currentbtxfirst \empty \permanent\protected\def\btxsetfirst {\def\currentbtxfirst}
-\mutable\let\currentbtxsecond \empty \permanent\protected\def\btxsetsecond {\def\currentbtxsecond}
-\mutable\let\currentbtxsuffix \empty \permanent\protected\def\btxsetsuffix {\def\currentbtxsuffix}
-\mutable\let\currentbtxinternal \empty \permanent\protected\def\btxsetinternal {\def\currentbtxinternal}
-\mutable\let\currentbtxlefttext \empty \permanent\protected\def\btxsetlefttext {\def\currentbtxlefttext}
-\mutable\let\currentbtxrighttext \empty \permanent\protected\def\btxsetrighttext {\def\currentbtxrighttext}
-\mutable\let\currentbtxbefore \empty \permanent\protected\def\btxsetbefore {\def\currentbtxbefore}
-\mutable\let\currentbtxafter \empty \permanent\protected\def\btxsetafter {\def\currentbtxafter}
-\mutable\let\currentbtxlanguage \empty \permanent\protected\def\btxsetlanguage {\def\currentbtxlanguage}
-\mutable\let\currentbtxtag \empty \permanent\protected\def\btxsettag {\def\currentbtxtag}
-\mutable\let\currentbtxnumber \empty \permanent\protected\def\btxsetnumber {\def\currentbtxnumber}
-\mutable\let\currentbtxfirstinternal\empty \permanent\protected\def\btxsetfirstinternal{\def\currentbtxfirstinternal}
-\mutable\let\currentbtxlastinternal \empty \permanent\protected\def\btxsetlastinternal {\def\currentbtxlastinternal}
+\mutable\lettonothing\currentbtxbacklink \permanent\protected\def\btxsetbacklink {\def\currentbtxbacklink}
+\mutable\lettonothing\currentbtxcategory \permanent\protected\def\btxsetcategory {\def\currentbtxcategory}
+\mutable\lettonothing\currentbtxcombis \permanent\protected\def\btxsetcombis {\def\currentbtxcombis}
+\mutable\lettonothing\currentbtxdataset \permanent\protected\def\btxsetdataset {\def\currentbtxdataset}
+\mutable\lettonothing\currentbtxfirst \permanent\protected\def\btxsetfirst {\def\currentbtxfirst}
+\mutable\lettonothing\currentbtxsecond \permanent\protected\def\btxsetsecond {\def\currentbtxsecond}
+\mutable\lettonothing\currentbtxsuffix \permanent\protected\def\btxsetsuffix {\def\currentbtxsuffix}
+\mutable\lettonothing\currentbtxinternal \permanent\protected\def\btxsetinternal {\def\currentbtxinternal}
+\mutable\lettonothing\currentbtxlefttext \permanent\protected\def\btxsetlefttext {\def\currentbtxlefttext}
+\mutable\lettonothing\currentbtxrighttext \permanent\protected\def\btxsetrighttext {\def\currentbtxrighttext}
+\mutable\lettonothing\currentbtxbefore \permanent\protected\def\btxsetbefore {\def\currentbtxbefore}
+\mutable\lettonothing\currentbtxafter \permanent\protected\def\btxsetafter {\def\currentbtxafter}
+\mutable\lettonothing\currentbtxlanguage \permanent\protected\def\btxsetlanguage {\def\currentbtxlanguage}
+\mutable\lettonothing\currentbtxtag \permanent\protected\def\btxsettag {\def\currentbtxtag}
+\mutable\lettonothing\currentbtxnumber \permanent\protected\def\btxsetnumber {\def\currentbtxnumber}
+\mutable\lettonothing\currentbtxfirstinternal \permanent\protected\def\btxsetfirstinternal{\def\currentbtxfirstinternal}
+\mutable\lettonothing\currentbtxlastinternal \permanent\protected\def\btxsetlastinternal {\def\currentbtxlastinternal}
\mutable\let\currentbtxauthorvariant\v!normal \permanent\protected\def\btxsetauthorvariant{\def\currentbtxauthorvariant}
-\mutable\let\currentbtxfirstnames \empty \permanent\protected\def\btxsetfirstnames {\let\currentbtxfirstnames\currentbtxfirstnames_indeed}
-\mutable\let\currentbtxinitials \empty \permanent\protected\def\btxsetinitials {\let\currentbtxinitials \currentbtxinitials_indeed }
-\mutable\let\currentbtxjuniors \empty \permanent\protected\def\btxsetjuniors {\let\currentbtxjuniors \currentbtxjuniors_indeed }
-\mutable\let\currentbtxsurnames \empty \permanent\protected\def\btxsetsurnames {\let\currentbtxsurnames \currentbtxsurnames_indeed }
-\mutable\let\currentbtxvons \empty \permanent\protected\def\btxsetvons {\let\currentbtxvons \currentbtxvons_indeed }
+
+\mutable\lettonothing\currentbtxfirstnames \permanent\protected\def\btxsetfirstnames {\let\currentbtxfirstnames\currentbtxfirstnames_indeed}
+\mutable\lettonothing\currentbtxinitials \permanent\protected\def\btxsetinitials {\let\currentbtxinitials \currentbtxinitials_indeed }
+\mutable\lettonothing\currentbtxjuniors \permanent\protected\def\btxsetjuniors {\let\currentbtxjuniors \currentbtxjuniors_indeed }
+\mutable\lettonothing\currentbtxsurnames \permanent\protected\def\btxsetsurnames {\let\currentbtxsurnames \currentbtxsurnames_indeed }
+\mutable\lettonothing\currentbtxvons \permanent\protected\def\btxsetvons {\let\currentbtxvons \currentbtxvons_indeed }
\newconstant\currentbtxoverflow \permanent\protected\def\btxsetoverflow #1{\currentbtxoverflow #1\relax}
\newconstant\currentbtxconcat \permanent\protected\def\btxsetconcat #1{\currentbtxconcat #1\relax}
@@ -479,70 +480,70 @@
\protected\def\currentbtxsurnames_indeed {\clf_btxcurrentsurnames \numexpr\currentbtxauthorindex\relax}
\protected\def\currentbtxvons_indeed {\clf_btxcurrentvons \numexpr\currentbtxauthorindex\relax}
-\mutable\let\currentbtxfirstpage \empty \permanent\protected\def\btxsetfirstpage#1{\def\currentbtxfirstpage{\btx_page_number{#1}}}
-\mutable\let\currentbtxlastpage \empty \permanent\protected\def\btxsetlastpage #1{\def\currentbtxlastpage {\btx_page_number{#1}}}
-
-\mutable\let\currentbtxfield \empty
-\mutable\let\currentbtxfielddoi \empty
-\mutable\let\currentbtxfieldmonth \empty
-\mutable\let\currentbtxfieldyear \empty
-\mutable\let\currentbtxfieldurl \empty
-\mutable\let\currentbtxcriterium \empty
-\mutable\let\currentbtxlist \empty
-\mutable\let\currentbtxlistentry \empty
-\mutable\let\currentbtxlistindex \empty
-\mutable\let\currentbtxreference \empty
-\mutable\let\currentbtxrenderingtitle \empty
-\mutable\let\currentbtxcitetag \empty
+\mutable\lettonothing\currentbtxfirstpage \permanent\protected\def\btxsetfirstpage#1{\def\currentbtxfirstpage{\btx_page_number{#1}}}
+\mutable\lettonothing\currentbtxlastpage \permanent\protected\def\btxsetlastpage #1{\def\currentbtxlastpage {\btx_page_number{#1}}}
+
+\mutable\lettonothing\currentbtxfield
+\mutable\lettonothing\currentbtxfielddoi
+\mutable\lettonothing\currentbtxfieldmonth
+\mutable\lettonothing\currentbtxfieldyear
+\mutable\lettonothing\currentbtxfieldurl
+\mutable\lettonothing\currentbtxcriterium
+\mutable\lettonothing\currentbtxlist
+\mutable\lettonothing\currentbtxlistentry
+\mutable\lettonothing\currentbtxlistindex
+\mutable\lettonothing\currentbtxreference
+\mutable\lettonothing\currentbtxrenderingtitle
+\mutable\lettonothing\currentbtxcitetag
\mutable\def\currentbtxauthorvariant{normal}
\protected\def\btx_reset_list % not needed as we're grouped
- {\let\currentbtxcombis \empty
- \let\currentbtxcategory \empty
- \let\currentbtxinternal \empty
- \let\currentbtxlefttext \empty
- \let\currentbtxrighttext\empty
- \let\currentbtxbefore \empty
- \let\currentbtxafter \empty
- \let\currentbtxbacklink \empty
- \let\currentbtxlanguage \empty
- \let\currentbtxsuffix \empty
- %\let\currentbtxdataset \empty % will always be set
- %\let\currentbtxtag \empty % will always be set
- \let\currentbtxnumber \empty}
+ {\lettonothing\currentbtxcombis
+ \lettonothing\currentbtxcategory
+ \lettonothing\currentbtxinternal
+ \lettonothing\currentbtxlefttext
+ \lettonothing\currentbtxrighttext
+ \lettonothing\currentbtxbefore
+ \lettonothing\currentbtxafter
+ \lettonothing\currentbtxbacklink
+ \lettonothing\currentbtxlanguage
+ \lettonothing\currentbtxsuffix
+ %\lettonothing\currentbtxdataset % will always be set
+ %\lettonothing\currentbtxtag % will always be set
+ \lettonothing\currentbtxnumber}
\protected\def\btx_reset_cite % check for less .. not all resets needed when we're grouped (only subcites)
- {\let \currentbtxfirst \empty
- \let \currentbtxsecond \empty
- \let \currentbtxsuffix \empty
- \let \currentbtxinternal \empty
- \let \currentbtxlefttext \empty
- \let \currentbtxrighttext \empty
- \let \currentbtxbefore \empty
- \let \currentbtxafter \empty
- \let \currentbtxbacklink \empty
- \let \currentbtxlanguage \empty
- %\let \currentbtxdataset \empty % will always be set, beware of local reset ~
- %\let \currentbtxtag \empty % will always be set, beware of local reset ~
- \let \currentbtxnumber \empty
- \setconstant\currentbtxoverflow \zerocount
- \setconstant\currentbtxconcat \zerocount
- \setconstant\currentbtxcount \zerocount}
+ {\lettonothing\currentbtxfirst
+ \lettonothing\currentbtxsecond
+ \lettonothing\currentbtxsuffix
+ \lettonothing\currentbtxinternal
+ \lettonothing\currentbtxlefttext
+ \lettonothing\currentbtxrighttext
+ \lettonothing\currentbtxbefore
+ \lettonothing\currentbtxafter
+ \lettonothing\currentbtxbacklink
+ \lettonothing\currentbtxlanguage
+ %\lettonothing\currentbtxdataset % will always be set, beware of local reset ~
+ %\lettonothing\currentbtxtag % will always be set, beware of local reset ~
+ \lettonothing\currentbtxnumber
+ \setconstant\currentbtxoverflow\zerocount
+ \setconstant\currentbtxconcat\zerocount
+ \setconstant\currentbtxcount\zerocount}
\protected\def\btx_reset_page % probably not needed
- {\let \currentbtxfirstpage \empty
- \let \currentbtxlastpage \empty
- \let \currentbtxfirstinternal\empty
- \let \currentbtxlastinternal \empty
- \setconstant\currentbtxoverflow \zerocount
- \setconstant\currentbtxconcat \zerocount
- \setconstant\currentbtxcount \zerocount}
+ {\lettonothing\currentbtxfirstpage
+ \lettonothing\currentbtxlastpage
+ \lettonothing\currentbtxfirstinternal
+ \lettonothing\currentbtxlastinternal
+ \setconstant\currentbtxoverflow\zerocount
+ \setconstant\currentbtxconcat\zerocount
+ \setconstant\currentbtxcount\zerocount}
\protected\def\btx_reset_numbering % probably not needed
- {\let \currentbtxfirst \empty
- \let \currentbtxsecond\empty
- \let \currentbtxsuffix\empty
+ {\lettonothing\currentbtxfirst
+ \lettonothing\currentbtxsecond
+ \lettonothing\currentbtxsuffix
\setconstant\currentbtxconcat\zerocount}
%D Pages:
@@ -586,10 +587,10 @@
%D Lists:
-\newdimen\d_publ_number_width
+\newdimension\d_publ_number_width
-\ifdefined\btxblock \else \newcount\btxblock \fi \btxblock\plusone
-\ifdefined\btxcitecounter \else \newcount\btxcitecounter \fi % maybe pass this to lua
+\ifdefined\btxblock \else \newinteger\btxblock \fi \btxblock\plusone
+\ifdefined\btxcitecounter \else \newinteger\btxcitecounter \fi % maybe pass this to lua
\newtoks\everysetupbtxlistplacement % name will change
\newtoks\everysetupbtxciteplacement % name will change
@@ -775,9 +776,9 @@
\fi
%
\iflocation
- \letinteractionparameter\c!style\empty
-% \letinteractionparameter\c!color\empty
-% \letinteractionparameter\c!contrastcolor\empty
+ \resetinteractionparameter\c!style
+ %\resetinteractionparameter\c!color
+ %\resetinteractionparameter\c!contrastcolor
\fi
\to \everybtxlistrendering
@@ -805,9 +806,13 @@
\permanent\protected\def\btxdoifelsecombiinlist#1#2%
{\clf_btxdoifelsecombiinlist{#1}{#2}}
+\permanent\protected\def\btxdoifelsecitedone#1#2%
+ {\clf_btxdoifelsecitedone{#1}{#2}}
+
\aliased\let\btxdoifsameaspreviouscheckedelse\btxdoifelsesameaspreviouschecked
\aliased\let\btxdoifsameaspreviouselse \btxdoifelsesameasprevious
\aliased\let\btxdoifcombiinlistelse \btxdoifelsecombiinlist
+\aliased\let\btxdoifcitedoneelse \btxdoifelsecitedone
\tolerant\def\publ_place_list_indeed#1#2#*[#3]#*[#4]%
{\begingroup
@@ -873,6 +878,7 @@
filter {\btxrenderingparameter\c!filter}%
\relax
\ifnum\nofbtxlistentries>\zerocount
+ \clf_btxpreparelistentries{\currentbtxdataset}% could be put in collect
\forgetall
\btxrenderingparameter\c!before
\ifconditional#2\relax
@@ -891,7 +897,6 @@
\dostarttagged\t!list{btx}%
\startpacked[\v!blank]%
% sorting and so
- \clf_btxpreparelistentries{\currentbtxdataset}% could be put in collect
% next we analyze the width
\ifempty\currentbtxnumbering \else
\edef\p_width{\listparameter\c!width}%
@@ -901,7 +906,7 @@
\clf_btxfetchlistentries{\currentbtxdataset}%
\egroup
\d_publ_number_width\wd\scratchbox
- \letlistparameter\c!width\d_publ_number_width
+ \letlistparameter\c!width\d_publ_number_width % no need for _reference here, frozen
\fi
\fi
\doifelse{\listparameter\c!prefix}\v!yes\settrue\setfalse\c_publ_prefixed
@@ -919,12 +924,12 @@
\ifconditional#1\relax
\stopnamedsection
\fi
- \global\advance\btxblock\plusone
+ \global\advanceby\btxblock\plusone
\endgroup}
-\permanent\protected\def\placebtxrendering {\publ_place_list_indeed\conditionalfalse\conditionalfalse}
-\permanent\protected\def\completebtxrendering{\publ_place_list_indeed\conditionaltrue \conditionalfalse}
-\permanent\protected\def\flushbtxrendering {\publ_place_list_indeed\conditionalfalse\conditionaltrue }
+\permanent\protected\def\placebtxrendering {\publ_place_list_indeed\conditionalfalse\conditionalfalse}
+\permanent\protected\def\completebtxrendering {\publ_place_list_indeed\conditionaltrue \conditionalfalse}
+\permanent\protected\def\flushbtxrendering {\publ_place_list_indeed\conditionalfalse\conditionaltrue }
\aliased\let\completelistofpublications\completebtxrendering % for old times sake
\aliased\let\placelistofpublications \placebtxrendering % for old times sake
@@ -962,15 +967,15 @@
\permanent\protected\def\btxsetlisttag#1%
{\clf_btxflushlisttag{\currentbtxdataset}#1\relax}
-\newcount\c_btx_list_index
+\newinteger\c_btx_list_index
-\let\m_btx_list_action\empty
+\lettonothing\m_btx_list_action
\def\publ_flush_list_step_command
{\btxsetlisttag{\c_btx_list_index}
\expandafter\m_btx_list_action\expandafter{\currentbtxtag}%
\ifnum\c_btx_list_index<\nofbtxlistentries
- \advance\c_btx_list_index\plusone
+ \advanceby\c_btx_list_index\plusone
\expandafter\publ_flush_list_step_command
\else
\glet\m_btx_list_action\relax
@@ -980,7 +985,7 @@
{\btxsetlisttag{\c_btx_list_index}
\directsetup{\m_btx_list_action}%
\ifnum\c_btx_list_index<\nofbtxlistentries
- \advance\c_btx_list_index\plusone
+ \advanceby\c_btx_list_index\plusone
\expandafter\publ_flush_list_step_setup
\else
\glet\m_btx_list_action\relax
@@ -1043,11 +1048,11 @@
\permanent\protected\def\btxstartlistentry % maybe pass i
{\begingroup
- \global\advance\c_btx_list_reference\plusone}
+ \global\advanceby\c_btx_list_reference\plusone}
\permanent\protected\def\btxstoplistentry
{\iftrialtypesetting
- \global\advance\c_btx_list_reference\minusone
+ \global\advanceby\c_btx_list_reference\minusone
\fi
\endgroup}
@@ -1105,7 +1110,7 @@
\btx_reference_indeed
\egroup}
-\newcount\c_btx_list_reference
+\newinteger\c_btx_list_reference
\protected\def\btx_list_reference_inject
{\dontleavehmode\begingroup % no box
@@ -1166,8 +1171,8 @@
\aliased\let\btxcitereference\btx_cite_reference_inject
-\mutable\let\currentbtxnumbering \empty
-\mutable\let\currentbtxcitealternative \empty
+\mutable\lettonothing\currentbtxnumbering
+\mutable\lettonothing\currentbtxcitealternative
\appendtoks
\edef\currentbtxnumbering{\btxrenderingparameter\c!numbering}%
@@ -1177,7 +1182,7 @@
\letlistparameter\c!headnumber\v!always
\orelse\ifx\currentbtxnumbering\v!no
\letlistparameter\c!headnumber\v!no
- \let\currentbtxnumbering\empty
+ \lettonothing\currentbtxnumbering
% \letlistparameter\c!textcommand\outdented % needed? we can use titlealign
\letlistparameter\c!symbol \v!none
\letlistparameter\c!aligntitle \v!yes
@@ -1299,16 +1304,16 @@
\newconditional\btxinteractivetext
\newconditional\btxinteractivepage
-\mutable\let\currentbtxinteraction\empty
+\mutable\lettonothing\currentbtxinteraction
\installcorenamespace{btxinteraction}
-\setvalue{\??btxinteraction\v!number}{\settrue\btxinteractivenumber}
-\setvalue{\??btxinteraction\v!text }{\settrue\btxinteractivetext}
-\setvalue{\??btxinteraction\v!page }{\settrue\btxinteractivepage}
-\setvalue{\??btxinteraction\v!all }{\settrue\btxinteractivenumber
- \settrue\btxinteractivetext
- \settrue\btxinteractivepage}
+\defcsname\??btxinteraction\v!number\endcsname{\settrue\btxinteractivenumber}
+\defcsname\??btxinteraction\v!text \endcsname{\settrue\btxinteractivetext}
+\defcsname\??btxinteraction\v!page \endcsname{\settrue\btxinteractivepage}
+\defcsname\??btxinteraction\v!all \endcsname{\settrue\btxinteractivenumber
+ \settrue\btxinteractivetext
+ \settrue\btxinteractivepage}
% \setupbtx[interaction=page] % or text or number or all
% \setupbtxrendering[pagestate=start]
@@ -1319,7 +1324,7 @@
\ifx\currentbtxinteraction\v!stop
\setfalse\btxinteractive
\else
- \enforced\let\structurelistlocation\empty
+ \enforced\lettonothing\structurelistlocation
\settrue\btxinteractive
\begincsname\??btxinteraction\currentbtxinteraction\endcsname
\fi
@@ -1372,13 +1377,13 @@
% text : not to list, show in text
% always : mark for list, show in text
-\let\p_publ_cite_before \empty
-\let\p_publ_cite_after \empty
-\let\p_publ_cite_lefttext \empty
-\let\p_publ_cite_righttext\empty
+\lettonothing\p_publ_cite_before
+\lettonothing\p_publ_cite_after
+\lettonothing\p_publ_cite_lefttext
+\lettonothing\p_publ_cite_righttext
-\mutable\let\currentbtxciteuservariables\empty
-\mutable\let\currentbtxcitealternative \empty
+\mutable\lettonothing\currentbtxciteuservariables
+\mutable\lettonothing\currentbtxcitealternative
\permanent\protected\def\btxhybridcite % so one can alias the old
{\dontleavehmode
@@ -1389,7 +1394,7 @@
{\strictdoifelsenextoptional{\publ_cite_tags_options_indeed{#1}}{\publ_cite_tags_indeed{#1}}}
\protected\def\publ_cite_tags_indeed#1%
- {\letinteractionparameter\c!style\empty
+ {\resetinteractionparameter\c!style
\setbtxparametersetroot\s!cite % we need to get the default
\edef\currentbtxcitealternative{\btxparameter\c!alternative}%
\setbtxparameterset\s!cite\currentbtxcitealternative
@@ -1402,14 +1407,14 @@
{\doifelseassignment{#1}\publ_cite_tags_settings_indeed\publ_cite_tags_variants_indeed{#1}}
\def\publ_cite_tags_settings_indeed#1[#2]%
- {\letinteractionparameter\c!style\empty
- %\letinteractionparameter\c!color\empty
- \letdummyparameter\c!reference \empty
- \letdummyparameter\c!alternative\empty
- \letdummyparameter\c!before \empty
- \letdummyparameter\c!after \empty
- \letdummyparameter\c!lefttext \empty
- \letdummyparameter\c!righttext \empty
+ {\resetinteractionparameter\c!style
+ %\resetinteractionparameter\c!color
+ \resetdummyparameter\c!reference
+ \resetdummyparameter\c!alternative
+ \resetdummyparameter\c!before
+ \resetdummyparameter\c!after
+ \resetdummyparameter\c!lefttext
+ \resetdummyparameter\c!righttext
\getdummyparameters[#1]%
\edef\p_reference{\dummyparameter\c!reference}%
\ifempty\p_reference
@@ -1443,7 +1448,7 @@
\endgroup}
\def\publ_cite_tags_variants_indeed#1[#2]%
- {\letinteractionparameter\c!style\empty
+ {\resetinteractionparameter\c!style
\edef\currentbtxcitealternative{#1}%
\edef\currentbtxcitetag{#2}%
\setbtxparameterset\s!cite\currentbtxcitealternative
@@ -1502,7 +1507,7 @@
\permanent\protected\def\btxtextcitation {\publ_citation\v!text}
\permanent\protected\def\btxalwayscitation{\publ_citation\v!always}
-\tolerant\def\publ_citation#1[#2]#*[#3]% could be made more efficient but not now
+\tolerant\def\publ_citation#1[#2]#,[#3]% could be made more efficient but not now
{\dontleavehmode
\begingroup
\let\currentbtxcitemethod#1%
@@ -1526,8 +1531,14 @@
\endgroup
\fi}
+% \permanent\protected\def\btxmissing#1%
+% {\dontleavehmode{\tttf<#1>}}
+
+\permanent\protected\def\currentbtxmissingreference
+ {\clf_btxmissing{\currentbtxdataset}{\currentbtxreference}}
+
\permanent\protected\def\btxmissing#1%
- {\dontleavehmode{\tttf<#1>}}
+ {\dontleavehmode{\tttf<\clf_btxmissing{\currentbtxdataset}{#1}>}}
%D Compatibility:
@@ -1557,7 +1568,7 @@
%D Setup helpers, beware, we need to wrap this .. now we need to know
%D how setups are implemented.
-\setvalue{\??setup:\s!btx:\s!unknown}#1{\inframed{\tttf#1}}
+\defcsname\??setup:\s!btx:\s!unknown\endcsname#1{\inframed{\tttf#1}}
\def\publ_fast_setup_yes#1#2%
{\csname\??setup:\s!btx:%
@@ -1746,9 +1757,9 @@
% \installcorenamespace{btxjournal}
%
-% \letvalue{\s!btxjournal\v!long }\btxexpandedjournal
-% \letvalue{\s!btxjournal\v!short }\btxabbreviatedjournal
-% \letvalue{\s!btxjournal\v!normal}\firstofoneargument
+% \aliased\letcsname\s!btxjournal\v!long \endcsname\btxexpandedjournal
+% \aliased\letcsname\s!btxjournal\v!short \endcsname\btxabbreviatedjournal
+% \aliased\letcsname\s!btxjournal\v!normal\endcsname\firstofoneargument
%
% \protected\def\btxcheckedjournal
% {\expandnamespaceparameter\s!btxjournal\btxrenderingparameter\c!journalconversion}
@@ -1792,6 +1803,7 @@
filename {\dummyparameter\c!file}%
filetype {\dummyparameter\c!type}%
criterium {\dummyparameter\c!criterium}%
+ options {\dummyparameter\c!option}%
\relax
\endgroup}
@@ -1898,7 +1910,7 @@
% \btxusecommand[btx:apa:list:article:title]{foo}
% \btxstopstyle
-\mutable\let\m_btx_saved_current\empty
+\mutable\lettonothing\m_btx_saved_current
\permanent\protected\def\btxstartstyle[#1]%
{\begingroup
diff --git a/Master/texmf-dist/tex/context/base/mkxl/regi-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/regi-ini.lmt
new file mode 100644
index 00000000000..c0cd4f1c8ef
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/regi-ini.lmt
@@ -0,0 +1,367 @@
+if not modules then modules = { } end modules ['regi-ini'] = {
+ version = 1.001,
+ comment = "companion to regi-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+--[[ldx--
+<p>Regimes take care of converting the input characters into
+<l n='utf'/> sequences. The conversion tables are loaded at
+runtime.</p>
+--ldx]]--
+
+local tostring = tostring
+local utfchar = utf.char
+local P, Cs, Cc, lpegmatch = lpeg.P, lpeg.Cs, lpeg.Cc, lpeg.match
+local char, gsub, format, gmatch, byte, match, lower = string.char, string.gsub, string.format, string.gmatch, string.byte, string.match, string.lower
+local next = next
+local insert, remove, fastcopy = table.insert, table.remove, table.fastcopy
+local concat = table.concat
+local totable = string.totable
+
+local allocate = utilities.storage.allocate
+local sequencers = utilities.sequencers
+local textlineactions = resolvers.openers.helpers.textlineactions
+local setmetatableindex = table.setmetatableindex
+
+-- We will hook regime handling code into the input methods.
+
+local trace_translating = false trackers.register("regimes.translating", function(v) trace_translating = v end)
+
+local report_loading = logs.reporter("regimes","loading")
+local report_translating = logs.reporter("regimes","translating")
+
+regimes = regimes or { }
+local regimes = regimes
+
+local mapping = allocate {
+ utf = false
+}
+
+local backmapping = allocate {
+}
+
+-- regimes.mapping = mapping
+
+local synonyms = { -- backward compatibility list
+
+ ["windows-1250"] = "cp1250",
+ ["windows-1251"] = "cp1251",
+ ["windows-1252"] = "cp1252",
+ ["windows-1253"] = "cp1253",
+ ["windows-1254"] = "cp1254",
+ ["windows-1255"] = "cp1255",
+ ["windows-1256"] = "cp1256",
+ ["windows-1257"] = "cp1257",
+ ["windows-1258"] = "cp1258",
+
+ ["il1"] = "8859-1",
+ ["il2"] = "8859-2",
+ ["il3"] = "8859-3",
+ ["il4"] = "8859-4",
+ ["il5"] = "8859-9",
+ ["il6"] = "8859-10",
+ ["il7"] = "8859-13",
+ ["il8"] = "8859-14",
+ ["il9"] = "8859-15",
+ ["il10"] = "8859-16",
+
+ ["iso-8859-1"] = "8859-1",
+ ["iso-8859-2"] = "8859-2",
+ ["iso-8859-3"] = "8859-3",
+ ["iso-8859-4"] = "8859-4",
+ ["iso-8859-9"] = "8859-9",
+ ["iso-8859-10"] = "8859-10",
+ ["iso-8859-13"] = "8859-13",
+ ["iso-8859-14"] = "8859-14",
+ ["iso-8859-15"] = "8859-15",
+ ["iso-8859-16"] = "8859-16",
+
+ ["latin1"] = "8859-1",
+ ["latin2"] = "8859-2",
+ ["latin3"] = "8859-3",
+ ["latin4"] = "8859-4",
+ ["latin5"] = "8859-9",
+ ["latin6"] = "8859-10",
+ ["latin7"] = "8859-13",
+ ["latin8"] = "8859-14",
+ ["latin9"] = "8859-15",
+ ["latin10"] = "8859-16",
+
+ ["utf-8"] = "utf",
+ ["utf8"] = "utf",
+ [""] = "utf",
+
+ ["windows"] = "cp1252",
+
+ ["pdf"] = "pdfdoc",
+
+ ["437"] = "ibm",
+}
+
+local currentregime = "utf"
+
+local function loadregime(mapping,regime)
+ regime = lower(tostring(regime))
+ regime = synonyms[regime] or synonyms["windows-"..regime] or regime
+ local name = resolvers.findfile(format("regi-%s.lua",regime)) or ""
+ local data = name ~= "" and dofile(name)
+ if data then
+ vector = { }
+ for eightbit, unicode in next, data do
+ vector[char(eightbit)] = utfchar(unicode)
+ end
+ report_loading("vector %a is loaded",regime)
+ else
+ vector = false
+ report_loading("vector %a is unknown",regime)
+ end
+ mapping[regime] = vector
+ return vector
+end
+
+local function loadreverse(t,k)
+ local t = { }
+ local m = mapping[k]
+ if m then
+ for k, v in next, m do
+ t[v] = k
+ end
+ end
+ backmapping[k] = t
+ return t
+end
+
+setmetatableindex(mapping, loadregime)
+setmetatableindex(backmapping,loadreverse)
+
+regimes.mapping = mapping
+regimes.backmapping = backmapping
+
+local function fromregime(regime,line)
+ if line and #line > 0 then
+ -- local map = mapping[regime and synonyms[regime] or regime or currentregime]
+ local map = mapping[regime or currentregime]
+ if map then
+ line = gsub(line,".",map)
+ end
+ end
+ return line
+end
+
+local cache = { } -- if really needed we can copy vectors and hash defaults
+
+setmetatableindex(cache, function(t,k)
+ local v = { remappers = { } }
+ t[k] = v
+ return v
+end)
+
+local function toregime(vector,str,default) -- toregime('8859-1',"abcde Ä","?")
+ local d = default or "?"
+ local c = cache[vector].remappers
+ local r = c[d]
+ if not r then
+ local t = fastcopy(backmapping[vector])
+ -- r = utf.remapper(t) -- not good for defaults here
+ local pattern = Cs((lpeg.utfchartabletopattern(t)/t + lpeg.patterns.utf8character/d + P(1)/d)^0)
+ r = function(str)
+ if not str or str == "" then
+ return ""
+ else
+ return lpegmatch(pattern,str)
+ end
+ end
+ c[d] = r
+ end
+ return r(str)
+end
+
+local function disable()
+ currentregime = "utf"
+ sequencers.disableaction(textlineactions,"regimes.process")
+ return currentregime
+end
+
+local function enable(regime)
+ regime = synonyms[regime] or regime
+ if mapping[regime] == false then
+ disable()
+ else
+ currentregime = regime
+ sequencers.enableaction(textlineactions,"regimes.process")
+ end
+ return currentregime
+end
+
+regimes.toregime = toregime
+regimes.fromregime = fromregime
+regimes.translate = function(str,regime) return fromregime(regime,str) end
+regimes.enable = enable
+regimes.disable = disable
+
+-- The following function can be used when we want to make sure that utf gets passed
+-- unharmed. This is needed for modules.
+
+local level = 0
+
+function regimes.process(str,filename,currentline,noflines,coding)
+ if level == 0 and coding ~= "utf-8" then
+ str = fromregime(currentregime,str)
+ if trace_translating then
+ report_translating("utf: %s",str)
+ end
+ end
+ return str
+end
+
+local function push()
+ level = level + 1
+ if trace_translating then
+ report_translating("pushing level %s",level)
+ end
+end
+
+local function pop()
+ if level > 0 then
+ if trace_translating then
+ report_translating("popping level %s",level)
+ end
+ level = level - 1
+ end
+end
+
+regimes.push = push
+regimes.pop = pop
+
+function regimes.list()
+ local name = resolvers.findfile(format("regi-ini.lua",regime)) or ""
+ local okay = { }
+ if name then
+ local list = dir.glob(file.join(file.dirname(name),"regi-*.lua"))
+ for i=1,#list do
+ local name = list[i]
+ if name ~= "regi-ini.lua" then
+ okay[#okay+1] = match(name,"regi%-(.-)%.lua")
+ end
+ table.sort(okay)
+ end
+ end
+ return okay
+end
+
+sequencers.prependaction(textlineactions,"system","regimes.process")
+sequencers.disableaction(textlineactions,"regimes.process")
+
+-- Next we provide some hacks. Unfortunately we run into crappy encoded (read:
+-- mixed) encoded xml files that have these ë ä ö ü sequences instead of ë ä ö ü
+-- etc.
+
+local patterns = { }
+
+function regimes.cleanup(regime,str)
+ if not str or str == "" then
+ return str
+ end
+ local p = patterns[regime]
+ if p == nil then
+ regime = regime and synonyms[regime] or regime or currentregime
+ local vector = regime ~= "utf" and regime ~= "utf-8" and mapping[regime]
+ if vector then
+ local mapping = { }
+ for k, v in next, vector do
+ local split = totable(v)
+ for i=1,#split do
+ split[i] = utfchar(byte(split[i]))
+ end
+ split = concat(split)
+ if v ~= split then
+ mapping[split] = v
+ end
+ end
+ p = Cs((lpeg.utfchartabletopattern(mapping)/mapping+P(1))^0)
+ else
+ p = false
+ end
+ patterns[regime] = p
+ end
+ return p and lpegmatch(p,str) or str
+end
+
+-- local old = [[test ë ä ö ü crap]]
+-- local new = regimes.cleanup("cp1252",old)
+-- report_translating("%s -> %s",old,new)
+-- local old = "Pozn" .. char(0xE1) .. "mky"
+-- local new = fromregime("cp1250",old)
+-- report_translating("%s -> %s",old,new)
+
+-- interface (might move to regi-tex.lua)
+
+if interfaces then
+
+ local implement = interfaces.implement
+ local setmacro = interfaces.setmacro
+
+ implement {
+ name = "enableregime",
+ public = true,
+ protected = true,
+ arguments = "optional",
+ actions = function(regime) setmacro("currentregime",enable(regime)) end
+ }
+
+ implement {
+ name = "disableregime",
+ public = true,
+ protected = true,
+ actions = function() setmacro("currentregime",disable()) end
+ }
+
+ implement {
+ name = "pushregime",
+ public = true,
+ protected = true,
+ actions = push
+ }
+
+ implement {
+ name = "popregime",
+ public = true,
+ protected = true,
+ actions = pop
+ }
+
+ local stack = { }
+
+ implement {
+ name = "startregime",
+ public = true,
+ protected = true,
+ arguments = "optional",
+ actions = function(regime)
+ insert(stack,currentregime)
+ if trace_translating then
+ report_translating("start using %a",regime)
+ end
+ setmacro("currentregime",enable(regime))
+ end
+ }
+
+ implement {
+ name = "stopregime",
+ public = true,
+ protected = true,
+ actions = function()
+ if #stack > 0 then
+ local regime = remove(stack)
+ if trace_translating then
+ report_translating("stop using %a",regime)
+ end
+ setmacro("currentregime",enable(regime))
+ end
+ end
+ }
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/regi-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/regi-ini.mkxl
index 515b6afd6f9..da5bdf0816e 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/regi-ini.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/regi-ini.mkxl
@@ -11,27 +11,30 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\registerctxluafile{regi-ini}{}
+\registerctxluafile{regi-ini}{autosuffix}
\unprotect
%D \macros
%D {enableregime,disableregime,
%D startregime,stopregime,
+%D pushregime, popregime,
%D currentregime}
%D
%D Beware, the enable and disable commands are global switches, so best use the
%D start|/|stop commands.
-\mutable\let\currentregime\empty
+\mutable\lettonothing\currentregime
-\permanent\protected\def\enableregime[#1]{\clf_enableregime{#1}}
-\permanent\protected\def\disableregime {\clf_disableregime}
-\permanent\protected\def\startregime [#1]{\clf_startregime{#1}}
-\permanent\protected\def\stopregime {\clf_stopregime}
-
-% only for diagnostics:
-
-% \def\codepagename#1{\cldcontext{os.tocodepage("#1")}}
+%D These are defined at the \LUA\ end:
+%D
+%D \starttyping
+%D \enableregime[#1]
+%D \disableregime
+%D \startregime [#1]
+%D \stopregime
+%D \pushregime
+%D \popregime
+%D \stoptyping
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/scrn-bar.mklx b/Master/texmf-dist/tex/context/base/mkxl/scrn-bar.mklx
index 4cfcbde817e..5fbd47d6cf9 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/scrn-bar.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/scrn-bar.mklx
@@ -64,7 +64,7 @@
{\iflocation
\begingroup
\ifhastok={#tag}%
- \let\currentinteractionbar\empty
+ \lettonothing\currentinteractionbar
\setupcurrentinteractionbar[#tag]%
\edef\currentinteractionbar{\interactionbarparameter\c!alternative}%
\else
@@ -76,10 +76,10 @@
\endgroup
\fi}
-\newdimen\d_scrn_bar_width
-\newdimen\d_scrn_bar_height
-\newdimen\d_scrn_bar_depth
-\newdimen\d_scrn_bar_distance
+\newdimension\d_scrn_bar_width
+\newdimension\d_scrn_bar_height
+\newdimension\d_scrn_bar_depth
+\newdimension\d_scrn_bar_distance
%D Interaction buttons, in fact a row of tiny buttons, are typically only used for
%D navigational purposed. The next macro builds such a row based on a specification
@@ -112,7 +112,7 @@
\def\scrn_bar_buttons_indeed#settings#list%
{\begingroup
- %\let\currentinteractionbar\empty
+ %\lettonothing\currentinteractionbar
\setupcurrentinteractionbar[#settings]%
\d_scrn_bar_width \interactionbarparameter\c!width\relax
\d_scrn_bar_distance\interactionbarparameter\c!distance\relax
@@ -121,7 +121,7 @@
\fi
\doifnothing{\interactionbarparameter\c!height}{\letinteractionbarparameter\c!height\v!broad}%
\doifnothing{\interactionbarparameter\c!depth }{\letinteractionbarparameter\c!depth\zeropoint}%%%
- \letinteractionbarparameter\c!background\empty
+ \resetinteractionbarparameter\c!background
\setbox2\hbox{\inheritedinteractionbarframed{\symbol[\interactionparameter\c!symbolset][\v!previouspage]}}%
\scratchheight\ht2 % needed because we default to nothing
\letinteractionbarparameter\c!strut\v!no
@@ -129,17 +129,17 @@
\scratchcounterone\zerocount % new, was 1
\processallactionsinset
[#list]
- [ \v!page=>\advance\scratchcounterone\plusfour,
- \v!subpage=>\advance\scratchcounterone\plusfour,
- \s!unknown=>\advance\scratchcounterone\plusone]%
+ [ \v!page=>\advanceby\scratchcounterone\plusfour,
+ \v!subpage=>\advanceby\scratchcounterone\plusfour,
+ \s!unknown=>\advanceby\scratchcounterone\plusone]%
\ifzeropt\d_scrn_bar_width
\scratchdimenone\dimexpr2\emwidth+\d_scrn_bar_distance\relax
\scratchdimentwo\dimexpr\scratchcounterone\scratchdimenone-\d_scrn_bar_distance\relax
\else
\scratchdimenone\d_scrn_bar_width
\scratchdimentwo\dimexpr\scratchcounterone\d_scrn_bar_distance-\d_scrn_bar_distance\relax
- \advance\scratchdimenone -\scratchdimentwo
- \divide\scratchdimenone \scratchcounterone
+ \advanceby\scratchdimenone -\scratchdimentwo
+ \divideby\scratchdimenone \scratchcounterone
\scratchdimentwo\d_scrn_bar_width
\fi
\hbox to \scratchdimentwo
@@ -167,9 +167,6 @@
\def\scrn_bar_goto#action%
{\button{\symbol[#action]}[#action]\hss}
-% todo: this will be \letblackruleparameter\c!width\scratchdimenone (faster)
-% todo: make these setups
-
\def\scrn_bar_alternative_a
{\d_scrn_bar_width \interactionbarparameter\c!width
\d_scrn_bar_distance\interactionbarparameter\c!distance
@@ -306,23 +303,23 @@
\doloop
{\scratchcounterthree\numexpr(\nofsubpages/\recurselevel)+\plusone\relax % rounding
\scratchdimentwo\d_scrn_bar_distance
- \multiply\scratchdimentwo \scratchcounterthree
- \advance\scratchdimentwo -\d_scrn_bar_distance
+ \multiplyby\scratchdimentwo \scratchcounterthree
+ \advanceby\scratchdimentwo -\d_scrn_bar_distance
\scratchdimenone\d_scrn_bar_width
- \advance\scratchdimenone -\scratchdimentwo
- \divide\scratchdimenone \scratchcounterthree
+ \advanceby\scratchdimenone -\scratchdimentwo
+ \divideby\scratchdimenone \scratchcounterthree
\ifdim\scratchdimenone<\d_scrn_bar_distance\else
\scratchcountertwo\recurselevel
\exitloop
\fi}%
\ifnum\scratchcounterthree>\plusone
% this is not that well tested
- \advance\scratchcounterthree \minustwo
+ \advanceby\scratchcounterthree \minustwo
\scratchdimenone-\d_scrn_bar_distance
\scratchdimenone\scratchcounterthree\scratchdimenone
- \advance\scratchdimenone \d_scrn_bar_width
- \advance\scratchcounterthree \plusone
- \divide\scratchdimenone \scratchcounterthree
+ \advanceby\scratchdimenone \d_scrn_bar_width
+ \advanceby\scratchcounterthree \plusone
+ \divideby\scratchdimenone \scratchcounterthree
\fi
\doifelse{\interactionbarparameter\c!symbol}\v!yes
{\setupsymbolset[\interactionparameter\c!symbolset]%
@@ -334,7 +331,7 @@
\scratchcounterfive\zerocount
\dostepwiserecurse\firstsubpage\lastsubpage\plusone
{\donefalse
- \advance\scratchcounterfive \plusone
+ \advanceby\scratchcounterfive \plusone
\ifnum\recurselevel=\firstsubpage\relax \donetrue \fi
\ifnum\recurselevel=\lastsubpage \relax \donetrue \fi
\scratchcountersix\therealsubpageno\recurselevel\relax
diff --git a/Master/texmf-dist/tex/context/base/mkxl/scrn-but.mklx b/Master/texmf-dist/tex/context/base/mkxl/scrn-but.mklx
index 9832ffbbb26..e227516183d 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/scrn-but.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/scrn-but.mklx
@@ -328,8 +328,8 @@
\aliased\let\setupinteractionmenus\setupinteractionmenu
-\mutable\let\currentinteractionmenudistance\empty
-\mutable\let\currentinteractionmenustate \empty
+\mutable\lettonothing\currentinteractionmenudistance
+\mutable\lettonothing\currentinteractionmenustate
\let\scrn_menu_action\relax
@@ -418,23 +418,23 @@
%D After all, menus need some setup anyway. The offsets are added to the width or
%D height (this is different from \MKII).
-\newbox \b_scrn_menu
+\newbox \b_scrn_menu
-\newdimen\d_scrn_menu_next_distance
-\newdimen\d_scrn_menu_final_width
-\newdimen\d_scrn_menu_final_height
-\newdimen\d_scrn_menu_used_width
-\newdimen\d_scrn_menu_used_height
-\newdimen\d_scrn_menu_asked_width
-\newdimen\d_scrn_menu_asked_height
-\newdimen\d_scrn_menu_offset_top
-\newdimen\d_scrn_menu_offset_bottom
-\newdimen\d_scrn_menu_offset_left
-\newdimen\d_scrn_menu_offset_right
+\newdimension\d_scrn_menu_next_distance
+\newdimension\d_scrn_menu_final_width
+\newdimension\d_scrn_menu_final_height
+\newdimension\d_scrn_menu_used_width
+\newdimension\d_scrn_menu_used_height
+\newdimension\d_scrn_menu_asked_width
+\newdimension\d_scrn_menu_asked_height
+\newdimension\d_scrn_menu_offset_top
+\newdimension\d_scrn_menu_offset_bottom
+\newdimension\d_scrn_menu_offset_left
+\newdimension\d_scrn_menu_offset_right
\newconditional\c_scrn_menu_zerodimensions
-\mutable\let\currentinteractionmenulocation\empty
+\mutable\lettonothing\currentinteractionmenulocation
\def\scrn_menu_set_used
{\d_scrn_menu_offset_left \ifchkdim\interactionmenuparameter\c!leftoffset \or\lastchkdim\else\zeropoint\fi
@@ -475,14 +475,14 @@
\ht\b_scrn_menu\d_scrn_menu_asked_height
\dp\b_scrn_menu\zeropoint}
-\setvalue{\??menualign\v!right }{\let\scrn_menu_left_align\raggedright}
-\setvalue{\??menualign\v!left }{\let\scrn_menu_left_align\raggedleft}
-\setvalue{\??menualign\v!flushright}{\let\scrn_menu_left_align\raggedleft}
-\setvalue{\??menualign\v!flushleft }{\let\scrn_menu_left_align\raggedright}
-\setvalue{\??menualign\v!middle }{\let\scrn_menu_left_align\raggedcenter}
-\setvalue{\??menualign\v!low }{\let\scrn_menu_top_align\vss\let\scrn_menu_bottom_align\relax}
-\setvalue{\??menualign\v!high }{\let\scrn_menu_top_align\relax\let\scrn_menu_bottom_align\vss}
-\setvalue{\??menualign\v!lohi }{\let\scrn_menu_top_align\vss\let\scrn_menu_bottom_align\vss}
+\defcsname\??menualign\v!right \endcsname{\let\scrn_menu_left_align\raggedright}
+\defcsname\??menualign\v!left \endcsname{\let\scrn_menu_left_align\raggedleft}
+\defcsname\??menualign\v!flushright\endcsname{\let\scrn_menu_left_align\raggedleft}
+\defcsname\??menualign\v!flushleft \endcsname{\let\scrn_menu_left_align\raggedright}
+\defcsname\??menualign\v!middle \endcsname{\let\scrn_menu_left_align\raggedcenter}
+\defcsname\??menualign\v!low \endcsname{\let\scrn_menu_top_align\vss\let\scrn_menu_bottom_align\relax}
+\defcsname\??menualign\v!high \endcsname{\let\scrn_menu_top_align\relax\let\scrn_menu_bottom_align\vss}
+\defcsname\??menualign\v!lohi \endcsname{\let\scrn_menu_top_align\vss\let\scrn_menu_bottom_align\vss}
\let\scrn_menu_left_align \relax
\let\scrn_menu_right_align \relax
@@ -490,7 +490,7 @@
\let\scrn_menu_bottom_align\relax
\def\scrn_menu_set_align
- {\csname\??menualign\interactionmenuparameter\c!itemalign\endcsname}
+ {\begincsname\??menualign\interactionmenuparameter\c!itemalign\endcsname}
%D Hook into the pagebuilder (as less testing as possible):
@@ -523,13 +523,13 @@
\let\scrn_menu_packager\relax
-\setvalue{\??menupacker\v!vertical}% all menus
+\defcsname\??menupacker\v!vertical\endcsname % all menus
{\let\scrn_menu_packager\scrn_menu_packager_vertical
\setbox\b_scrn_menu\hbox{\scrn_menu_actions\currentinteractionmenulocation}%
\scrn_menu_apply_final
\box\b_scrn_menu}
-\setvalue{\??menupacker\v!horizontal}% all menus
+\defcsname\??menupacker\v!horizontal\endcsname % all menus
{\let\scrn_menu_packager\scrn_menu_packager_horizontal
\setbox\b_scrn_menu\vbox{\scrn_menu_actions\currentinteractionmenulocation}%
\scrn_menu_apply_final
@@ -608,7 +608,7 @@
%D positional info. The status variable is 0, 1 or~2: not found, found and found but
%D current page.
-\newcount \c_scrn_menu_position
+\newinteger \c_scrn_menu_position
\newconstant \c_scrn_menu_page_mode % 0=notfound 1=found 2=currentpage
\newconditional\c_scrn_menu_positioning
\newtoks \t_scrn_menu_meta_data
@@ -682,13 +682,13 @@
\endgroup
\ignorespaces}
-\aliased\let\startraw \aliased\let\stopraw\relax \ifdefined\raw\else \aliased\let\raw\relax \fi
-\aliased\let\startbut \aliased\let\stopbut\relax \ifdefined\but\else \aliased\let\but\relax \fi
-\aliased\let\startgot \aliased\let\stopgot\relax \ifdefined\got\else \aliased\let\got\relax \fi
-\aliased\let\startnop \aliased\let\stopnop\relax \ifdefined\nop\else \aliased\let\nop\relax \fi
-\aliased\let\starttxt \aliased\let\stoptxt\relax \ifdefined\txt\else \aliased\let\txt\relax \fi
-\aliased\let\startrul \aliased\let\stoprul\relax \ifdefined\rul\else \aliased\let\rul\relax \fi
-\aliased\let\startcom \aliased\let\stopcom\relax \ifdefined\com\else \aliased\let\com\relax \fi
+\aliased\let\startraw\relax \aliased\let\stopraw\relax \ifdefined\raw\else \aliased\let\raw\relax \fi
+\aliased\let\startbut\relax \aliased\let\stopbut\relax \ifdefined\but\else \aliased\let\but\relax \fi
+\aliased\let\startgot\relax \aliased\let\stopgot\relax \ifdefined\got\else \aliased\let\got\relax \fi
+\aliased\let\startnop\relax \aliased\let\stopnop\relax \ifdefined\nop\else \aliased\let\nop\relax \fi
+\aliased\let\starttxt\relax \aliased\let\stoptxt\relax \ifdefined\txt\else \aliased\let\txt\relax \fi
+\aliased\let\startrul\relax \aliased\let\stoprul\relax \ifdefined\rul\else \aliased\let\rul\relax \fi
+\aliased\let\startcom\relax \aliased\let\stopcom\relax \ifdefined\com\else \aliased\let\com\relax \fi
\protected\def\scrn_menu_raw_start[#action]#text\stopraw
{\scrn_menu_action_start
@@ -711,7 +711,7 @@
\scrn_menu_action_stop}
\def\scrn_button_make_position#currentparameter#inheritedframed#letparameter#setparameter#text#action%
- {\global\advance\c_scrn_menu_position\plusone
+ {\global\advanceby\c_scrn_menu_position\plusone
\doifelsereferencefound{#action}% 0=not found, 1=same page, >1=elsewhere
{\c_scrn_menu_page_mode\ifnum\currentreferencerealpage=\realpageno\plusone\else\plustwo\fi}%
{\c_scrn_menu_page_mode\plustwo}%
@@ -729,7 +729,7 @@
\permanent\protected\def\scrn_menu_got_start[#action]#text\stopgot
{\scrn_menu_action_start
\letinteractionmenuparameter\c!frame\v!off
- \letinteractionmenuparameter\c!background\empty
+ \resetinteractionmenuparameter\c!background
\scrn_button_make
\interactionmenuparameter
\inheritedinteractionmenuframed
@@ -742,7 +742,7 @@
\permanent\protected\def\scrn_menu_nop_start#text\stopnop
{\scrn_menu_action_start
\letinteractionmenuparameter\c!frame\v!off
- \letinteractionmenuparameter\c!background\empty
+ \resetinteractionmenuparameter\c!background
\letinteractionmenuparameter\c!empty\v!yes
\inheritedinteractionmenuframed{\ignorespaces#text\removeunwantedspaces}%
\scrn_menu_action_stop}
@@ -750,7 +750,7 @@
\permanent\protected\def\scrn_menu_txt_start#text\stoptxt
{\scrn_menu_action_start
\letinteractionmenuparameter\c!frame\v!off
- \letinteractionmenuparameter\c!background\empty
+ \resetinteractionmenuparameter\c!background
\inheritedinteractionmenuframed{\ignorespaces#text\removeunwantedspaces}%
\scrn_menu_action_stop}
@@ -763,13 +763,13 @@
{\ignorespaces#text\removeunwantedspaces
\ignorespaces}
-\permanent\protected\def\scrn_menu_raw#content\\{\scrn_menu_raw_start#content\stopraw} \aliased\let\stopraw\relax
-\permanent\protected\def\scrn_menu_but#content\\{\scrn_menu_but_start#content\stopbut} \aliased\let\stopbut\relax
-\permanent\protected\def\scrn_menu_got#content\\{\scrn_menu_got_start#content\stopgot} \aliased\let\stopgot\relax
-\permanent\protected\def\scrn_menu_nop#content\\{\scrn_menu_nop_start#content\stopnop} \aliased\let\stopnop\relax
-\permanent\protected\def\scrn_menu_txt#content\\{\scrn_menu_txt_start#content\stoptxt} \aliased\let\stoptxt\relax
-\permanent\protected\def\scrn_menu_rul#content\\{\scrn_menu_rul_start#content\stoprul} \aliased\let\stoprul\relax
-\permanent\protected\def\scrn_menu_com#content\\{\scrn_menu_com_start#content\stopcom} \aliased\let\stopcom\relax
+\permanent\protected\def\scrn_menu_raw#content\\{\scrn_menu_raw_start#content\stopraw}
+\permanent\protected\def\scrn_menu_but#content\\{\scrn_menu_but_start#content\stopbut}
+\permanent\protected\def\scrn_menu_got#content\\{\scrn_menu_got_start#content\stopgot}
+\permanent\protected\def\scrn_menu_nop#content\\{\scrn_menu_nop_start#content\stopnop}
+\permanent\protected\def\scrn_menu_txt#content\\{\scrn_menu_txt_start#content\stoptxt}
+\permanent\protected\def\scrn_menu_rul#content\\{\scrn_menu_rul_start#content\stoprul}
+\permanent\protected\def\scrn_menu_com#content\\{\scrn_menu_com_start#content\stopcom}
\newtoks\everysetmenucommands % public
@@ -1005,7 +1005,7 @@
\def\scrn_menu_menu_button_b#settings#dummy#text#action%
{\dontleavehmode \begingroup
- \let\currentbutton\empty
+ \lettonothing\currentbutton
\setupcurrentbutton[#settings]%
\scrn_button_make
\buttonparameter
diff --git a/Master/texmf-dist/tex/context/base/mkxl/scrn-fld.mklx b/Master/texmf-dist/tex/context/base/mkxl/scrn-fld.mklx
index 6c134268c60..d5dadcb78bf 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/scrn-fld.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/scrn-fld.mklx
@@ -110,13 +110,13 @@
\setupforms
[\c!method=XML] % no need for everyjob initialization as this is the default
-\mutable\let\currentfieldbackgroundcolor \empty
-\mutable\let\currentfieldbackgroundcolorvalue\empty
-\mutable\let\currentfieldbodycategory \empty
-\mutable\let\currentfieldframecolor \empty
-\mutable\let\currentfieldframecolorvalue \empty
-\mutable\let\currentfieldlabel \empty
-\mutable\let\currentfieldstackname \empty
+\mutable\lettonothing\currentfieldbackgroundcolor
+\mutable\lettonothing\currentfieldbackgroundcolorvalue
+\mutable\lettonothing\currentfieldbodycategory
+\mutable\lettonothing\currentfieldframecolor
+\mutable\lettonothing\currentfieldframecolorvalue
+\mutable\lettonothing\currentfieldlabel
+\mutable\lettonothing\currentfieldstackname
\appendtoks
\iflocation
@@ -327,7 +327,7 @@
%D (implemented as properties).
\appendtoks
- \let\currentfieldcategory\empty
+ \lettonothing\currentfieldcategory
\doifelse{\interactionparameter\c!fieldlayer}\v!auto
{\setupcurrentfieldcategory[\c!fieldlayer=\currentviewerlayer]}%
{\setupcurrentfieldcategory[\c!fieldlayer=]}%
@@ -476,13 +476,13 @@
\newconditional\fieldisvertical
\newconditional\fieldishorizontal
-\mutable\let\currentfieldtotalframed \empty
-\mutable\let\currentfieldlabelframed \empty
-\mutable\let\currentfieldcontentframed\empty
+\mutable\lettonothing\currentfieldtotalframed
+\mutable\lettonothing\currentfieldlabelframed
+\mutable\lettonothing\currentfieldcontentframed
-\mutable\let\fieldtotalframedparameterhash \empty % weird that we have to flag this
-\mutable\let\fieldlabelframedparameterhash \empty % idem
-\mutable\let\fieldcontentframedparameterhash\empty % idem
+\mutable\lettonothing\fieldtotalframedparameterhash % weird that we have to flag this
+\mutable\lettonothing\fieldlabelframedparameterhash % idem
+\mutable\lettonothing\fieldcontentframedparameterhash % idem
\permanent\tolerant\protected\def\field[#tag]#spacer[#label]% can be sped up with \setupcurrentfieldtotalframed etc
{\iflocation
@@ -620,12 +620,12 @@
%D Common stuff (obsolete)
-\newcount\c_scrn_field_system_n
+\newinteger\c_scrn_field_system_n
\permanent\def\currentsystemfield{sys::\number\c_scrn_field_system_n}
\permanent\protected\def\nextsystemfield
- {\global\advance\c_scrn_field_system_n\plusone}
+ {\global\advanceby\c_scrn_field_system_n\plusone}
%D \CONTEXT\ had tooltips right from the moment that it supported fields. Due to the
%D at that moment somewhat limited \PDF\ specification, they were implemented using
@@ -640,9 +640,9 @@
%D before \tooltip[left]{inbetween}{a very nice tip} after\par
%D \stoptyping
-\newbox \b_scrn_tooltip_anchor
-\newbox \b_scrn_tooltip_text
-\newcount\c_scrn_tooltip_n
+\newbox \b_scrn_tooltip_anchor
+\newbox \b_scrn_tooltip_text
+\newinteger\c_scrn_tooltip_n
\installcorenamespace{tooltip}
@@ -670,12 +670,12 @@
\tolerant\def\scrn_tooltip_ignore[#settings]#:#anchortext#tiptext%
{#anchortext}
-\mutable\let\currenttooltipname\empty
+\mutable\lettonothing\currenttooltipname
\tolerant\def\scrn_tooltip_indeed[#settings]#:#anchortext#tiptext% a more modern aproach (push buttons)
{\dontleavehmode \hbox \bgroup
\dontcomplain
- \global\advance\c_scrn_tooltip_n\plusone
+ \global\advanceby\c_scrn_tooltip_n\plusone
\edef\currenttooltipname{tooltip:\number\c_scrn_tooltip_n}%
\setbox\b_scrn_tooltip_anchor\hbox
{\strut#anchortext}%
@@ -683,7 +683,7 @@
{\setupcurrenttooltip[#settings]}%
{\setupcurrenttooltip[\c!location=#settings]}%
\setbox\b_scrn_tooltip_text\hbox
- {\lettooltipparameter\c!location\empty
+ {\resettooltipparameter\c!location
\inheritedtooltipframed{#tiptext}}%
\definesymbol
[\currenttooltipname:txt]
@@ -763,7 +763,7 @@
\definesymbol[\s!empty][]
\def\scrn_fieldstack_add#tag#settings#symbol%
- {\advance\scratchcounter\plusone
+ {\advanceby\scratchcounter\plusone
\edef\currentfieldstackname{#tag:\number\scratchcounter}%
\ifnum\scratchcounter=\fieldcategoryparameter\c!start\relax
\definefieldbody[\currentfieldstackname][\c!type=check,\c!values={#symbol,\s!empty},\c!default={#symbol}]%
@@ -811,13 +811,13 @@
%D \framed[background=WithTest]{toggle}
%D \stoptyping
-\newcount\c_scrn_rollbutton_n
+\newinteger\c_scrn_rollbutton_n
\permanent\tolerant\protected\def\overlayrollbutton[#1]#*[#2]#;#=#=%
{\iflocation
\bgroup
- \global\advance\c_scrn_rollbutton_n_button\plusone
- \global\advance\c_scrn_rollbutton_n_symbol\plusone
+ \global\advanceby\c_scrn_rollbutton_n_button\plusone
+ \global\advanceby\c_scrn_rollbutton_n_symbol\plusone
\definesymbol
[rollsymbol:\number\c_scrn_rollbutton_n_symbol]
[{\framed[\c!frame=\v!off,\c!width=\overlaywidth,\c!height=\overlayheight]{}}]%
@@ -866,7 +866,7 @@
% \stopTEXpage
% \stoptext
-\newcount\c_scrn_pushbutton_n
+\newinteger\c_scrn_pushbutton_n
\permanent\tolerant\protected\def\definepushbutton[#tag]#spacer[#settings]%
{\scrn_pushbutton_define_variant{#tag}{n}{push}%
@@ -881,7 +881,7 @@
\def\scrn_pushbutton_handle#tag#settings#reference%
{\bgroup
- \global\advance\c_scrn_pushbutton_n\plusone
+ \global\advanceby\c_scrn_pushbutton_n\plusone
\setupfield
[pushbutton]%
[\c!frame=\v!overlay,%
@@ -949,8 +949,8 @@
r=green,
d=blue]
-\newcount\c_scrn_rollbutton_n_button
-\newcount\c_scrn_rollbutton_n_symbol
+\newinteger\c_scrn_rollbutton_n_button
+\newinteger\c_scrn_rollbutton_n_symbol
\permanent\def\lastrollbuttonindex{\the\c_scrn_rollbutton_n_button}
@@ -978,15 +978,15 @@
\permanent\tolerant\protected\def\rollbutton[#tag]#spacer[#settings]#:#text[#reference]%
{\dontleavehmode
\bgroup
- \global\advance\c_scrn_rollbutton_n_button\plusone
- \global\advance\c_scrn_rollbutton_n_symbol\plusone
+ \global\advanceby\c_scrn_rollbutton_n_button\plusone
+ \global\advanceby\c_scrn_rollbutton_n_symbol\plusone
\ifparameter#tag\or
\ifparameter#settings\or
\edef\currentinteractionmenu{#tag}%
\setupcurrentinteractionmenu[#settings]%
\let\scrn_rollbutton_symbol\scrn_rollbutton_symbol_m
\orelse\ifhastok={#tag}%
- \let\currentbutton\empty
+ \lettonothing\currentbutton
\setupcurrentbutton[#tag]%
\let\scrn_rollbutton_symbol\scrn_rollbutton_symbol_b
\else
diff --git a/Master/texmf-dist/tex/context/base/mkxl/scrn-hlp.mklx b/Master/texmf-dist/tex/context/base/mkxl/scrn-hlp.mklx
index da2afd0d0c1..9f0c5dbdd07 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/scrn-hlp.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/scrn-hlp.mklx
@@ -53,8 +53,8 @@
% also status
-\newbox \b_scrn_help_box
-\newcount\c_scrn_help_n
+\newbox \b_scrn_help_box
+\newinteger\c_scrn_help_n
\definesystemattribute[help][public]
@@ -74,12 +74,12 @@
\frozen\instance\protected\edefcsname\e!stop \currenthelp\endcsname{\scrn_help_stop }%
\to \everydefinehelp
-\mutable\let\currenthelpreference\empty
-\mutable\let\currenthelpname \empty
+\mutable\lettonothing\currenthelpreference
+\mutable\lettonothing\currenthelpname
\protected\def\scrn_help_argument#category%
{\def\currenthelp{#category}%
- \global\advance\c_scrn_help_n\plusone
+ \global\advanceby\c_scrn_help_n\plusone
\edef\currenthelpname{help:\number\c_scrn_help_n}%
\doifelselocation\scrn_help_argument_indeed\scrn_help_argument_ignore}
@@ -98,7 +98,7 @@
{#target}
\tolerant\protected\def\scrn_help_start#category#spacer[#reference]%
- {\global\advance\c_scrn_help_n\plusone
+ {\global\advanceby\c_scrn_help_n\plusone
\edef\currenthelp{#category}%
\edef\currenthelpreference{#reference}%
\edef\currenthelpname{help:\number\c_scrn_help_n}%
diff --git a/Master/texmf-dist/tex/context/base/mkxl/scrn-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/scrn-ini.lmt
new file mode 100644
index 00000000000..2d01a1a28ef
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/scrn-ini.lmt
@@ -0,0 +1,62 @@
+if not modules then modules = { } end modules ['scrn-ini'] = {
+ version = 1.001,
+ comment = "companion to scrn-int.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local next = next
+
+-- We delay preroll because it needs a font and don't want to force a font load (at
+-- startup) because we preset a field so some are tokenlists as we need to preserve
+-- catcodes.
+
+interactions = { }
+interactions.general = interactions.general or { }
+local general = interactions.general
+
+local expand_macro = token.expand_macro
+
+local prerolled = { }
+local identitydata = { }
+
+local function setidentityvariable(key,value)
+ prerolled[key] = value
+end
+
+table.setmetatableindex(identitydata, function(t,k)
+ if k == "keywords" then
+ k = "keyword"
+ end
+ -- fetch and process at the tex end (catcode etc)
+ expand_macro("scrn_identity_get",true,k)
+ -- return the registered return value
+ local v = prerolled[k] or ""
+ if k == "title" and v == "" then
+ v = tex.jobname
+ end
+ return v
+end)
+
+function general.getidentityvariable(name)
+ return identitydata[name]
+end
+
+function general.getidentity()
+ return identitydata
+end
+
+interfaces.implement {
+ name = "setidentityvariable",
+ actions = setidentityvariable,
+ arguments = "2 strings",
+}
+
+interfaces.implement {
+ name = "setautoprefix",
+ actions = function(prefix)
+ backends.codeinjections.setautoprefix(prefix)
+ end,
+ arguments = "string",
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/scrn-ini.mklx b/Master/texmf-dist/tex/context/base/mkxl/scrn-ini.mklx
index c0246bc8328..1308ff6ec9b 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/scrn-ini.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/scrn-ini.mklx
@@ -15,7 +15,7 @@
\unprotect
-\registerctxluafile{scrn-ini}{}
+\registerctxluafile{scrn-ini}{autosuffix}
%D There is no interaction at all unless enabled by saying:
%D
@@ -184,56 +184,11 @@
%D Identity
-% \newconditional\c_scrn_identity_preroll
-%
-% \installtexdirective
-% {interaction.identity.preroll}
-% {\settrue \c_scrn_identity_preroll}
-% {\setfalse\c_scrn_identity_preroll}
-%
-% \def\scrn_identity_prerolled#1%
-% {\begingroup
-% \edef\tempstring{\interactionparameter#1}%
-% \ifempty\tempstring
-% \endgroup
-% \else
-% \the\everypreroll
-% \nodestostring\tempstring{\tempstring}%
-% \normalexpanded{\endgroup\setexpandedinteractionparameter{#1}{\tempstring}}%
-% \fi}
-%
-% \def\scrn_identity_synchronize
-% {\begingroup
-% \ifconditional\c_scrn_identity_preroll
-% \scrn_identity_prerolled\c!title
-% \scrn_identity_prerolled\c!subtitle
-% \scrn_identity_prerolled\c!author
-% \scrn_identity_prerolled\c!date
-% \scrn_identity_prerolled\c!keyword
-% \fi
-% \clf_setupidentity
-% title {\interactionparameter\c!title}%
-% subtitle {\interactionparameter\c!subtitle}%
-% author {\interactionparameter\c!author}%
-% % creator {ConTeXt - \contextversion}%
-% date {\interactionparameter\c!date}%
-% keywords {\interactionparameter\c!keyword}%
-% \relax
-% \endgroup}
-
-\def\scrn_identity_synchronize
- {\clf_setupidentity
- title {\prerolltostring{\interactionparameter\c!title}}%
- subtitle {\prerolltostring{\interactionparameter\c!subtitle}}%
- author {\prerolltostring{\interactionparameter\c!author}}%
- % creator {ConTeXt - \contextversion}% fixed
- date {\prerolltostring{\interactionparameter\c!date}}%
- keywords {\prerolltostring{\interactionparameter\c!keyword}}%
- \relax}
+%D We want to delay the preroll as it needs fonts so we now actively fetch from
+%D the \LUA\ end. So this one gets called by the time we need the value.
-\appendtoks
- \scrn_identity_synchronize
-\to \everysetupinteraction
+\def\scrn_identity_get#1%
+ {\clf_setidentityvariable{#1}{\prerolltostring{\interactionparameter{#1}}}}
% this comes before starttext
@@ -251,4 +206,8 @@
\scrn_identity_document {date}\c!date
\to \everystartdocument % or stop
+\appendtoks
+ \clf_setautoprefix{\interactionparameter\c!prefix}%
+\to \everysetupinteraction
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/scrn-pag.mklx b/Master/texmf-dist/tex/context/base/mkxl/scrn-pag.mklx
index 09c542678fd..312051d0c05 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/scrn-pag.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/scrn-pag.mklx
@@ -24,20 +24,20 @@
\installparameterhandler \??interactionscreen {interactionscreen}
\installsetuphandler \??interactionscreen {interactionscreen}
-\newdimen\canvaswidth
-\newdimen\canvasheight
-\newdimen\canvasbackoffset
-\newdimen\canvastopoffset
-\newdimen\canvasmaxwidth
-\newdimen\canvasmaxheight
-\newdimen\canvascropoffset
-\newdimen\canvastrimoffset
-\newdimen\canvasbleedoffset
-\newdimen\canvasartoffset
-
-\mutable\let\currentinteractionscreendelay \empty
-\mutable\let\currentinteractionscreenheight\empty
-\mutable\let\currentinteractionscreenwidth \empty
+\newdimension\canvaswidth
+\newdimension\canvasheight
+\newdimension\canvasbackoffset
+\newdimension\canvastopoffset
+\newdimension\canvasmaxwidth
+\newdimension\canvasmaxheight
+\newdimension\canvascropoffset
+\newdimension\canvastrimoffset
+\newdimension\canvasbleedoffset
+\newdimension\canvasartoffset
+
+\mutable\lettonothing\currentinteractionscreendelay
+\mutable\lettonothing\currentinteractionscreenheight
+\mutable\lettonothing\currentinteractionscreenwidth
\newconditional\c_scrn_canvas_tight_page
@@ -65,10 +65,10 @@
\donefalse
\ifdim\backspace>\canvaswidth
\ifdim\backspace>\zeropoint\relax
- \global\advance\canvasbackoffset -\canvaswidth
+ \global\advanceby\canvasbackoffset -\canvaswidth
\fi
\fi
- \global\advance\canvaswidth\dimexpr
+ \global\advanceby\canvaswidth\dimexpr
\makeupwidth
+ \rightcombitotal
+ 2\dimexpr
@@ -100,10 +100,10 @@
\global\canvasheight\dimexpr\topheight+\topdistance\relax
\ifdim\topspace>\canvasheight
\ifdim\topspace>\zeropoint\relax
- \global\advance\canvastopoffset -\canvasheight
+ \global\advanceby\canvastopoffset -\canvasheight
\fi
\fi
- \global\advance\canvasheight\dimexpr
+ \global\advanceby\canvasheight\dimexpr
\makeupheight
+ \bottomdistance
+ \bottomheight
@@ -140,10 +140,10 @@
\fi
\endgroup}
-\newdimen\layoutcropoffset
-\newdimen\layouttrimoffset
-\newdimen\layoutbleedoffset
-\newdimen\layoutartoffset
+\newdimension\layoutcropoffset
+\newdimension\layouttrimoffset
+\newdimension\layoutbleedoffset
+\newdimension\layoutartoffset
\appendtoks
\edef\p_cropoffset{\layoutparameter\c!cropoffset}%
@@ -210,7 +210,7 @@
}
\appendtoks
- \let\scrn_canvas_synchronize_common\empty
+ \lettonothing\scrn_canvas_synchronize_common
\to \everyaftershipout
\def\scrn_canvas_synchronize_only
@@ -289,12 +289,12 @@
%D Page transitions:
-\let\scrn_transitions_list\empty
+\lettonothing\scrn_transitions_list
\permanent\tolerant\protected\def\setuppagetransitions[#list]%
{\edef\scrn_transitions_list{#list}%
\ifx\scrn_transitions_list\v!reset
- \let\scrn_transitions_list\empty
+ \lettonothing\scrn_transitions_list
\fi}
\def\scrn_transitions_set
diff --git a/Master/texmf-dist/tex/context/base/mkxl/scrn-ref.lmt b/Master/texmf-dist/tex/context/base/mkxl/scrn-ref.lmt
new file mode 100644
index 00000000000..be298e2d1d2
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/scrn-ref.lmt
@@ -0,0 +1,57 @@
+if not modules then modules = { } end modules ['scrn-ref'] = {
+ version = 1.001,
+ comment = "companion to scrn-int.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+interactions = interactions or { }
+interactions.references = interactions.references or { }
+local references = interactions.references
+
+local codeinjections = backends.codeinjections
+
+local identify = structures.references.identify
+
+local implement = interfaces.implement
+
+local function check(what)
+ if what and what ~= "" then
+ local set, bug = identify("",what)
+ return not bug and #set > 0 and set
+ end
+end
+
+function references.setopendocumentaction(open)
+ local opendocument = check(open)
+ if opendocument then
+ codeinjections.registerdocumentopenaction(opendocument)
+ end
+end
+
+function references.setclosedocumentaction(close)
+ local closedocument = check(close)
+ if closedocument then
+ codeinjections.registerdocumentcloseaction(closedocument)
+ end
+end
+
+function references.setopenpageaction(open)
+ local openpage = check(open)
+ if openpage then
+ codeinjections.registerpageopenaction(openpage)
+ end
+end
+
+function references.setclosepageaction(close)
+ local closepage = check(close)
+ if closepage then
+ codeinjections.registerpagecloseaction(closepage)
+ end
+end
+
+implement { name = "setopendocumentaction", arguments = "string", actions = references.setopendocumentaction }
+implement { name = "setclosedocumentaction", arguments = "string", actions = references.setclosedocumentaction }
+implement { name = "setopenpageaction", arguments = "string", actions = references.setopenpageaction }
+implement { name = "setclosepageaction", arguments = "string", actions = references.setclosepageaction }
diff --git a/Master/texmf-dist/tex/context/base/mkxl/scrn-ref.mklx b/Master/texmf-dist/tex/context/base/mkxl/scrn-ref.mklx
index 63f76a0920d..b86677ab238 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/scrn-ref.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/scrn-ref.mklx
@@ -13,18 +13,18 @@
\writestatus{loading}{ConTeXt Screen Macros / References}
-\registerctxluafile{scrn-ref}{}
+\registerctxluafile{scrn-ref}{autosuffix}
\unprotect
\appendtoks
\doifsomething{\interactionparameter\c!calculate}%
{\clf_setfieldcalculationset{\interactionparameter\c!calculate}}%
- \doifelse{\interactionparameter\c!click }\v!yes
+ \doifelse{\interactionparameter\c!click}\v!yes
\settrue\setfalse\highlighthyperlinks
\doifelse{\interactionparameter\c!display}\v!new
\settrue\setfalse\gotonewwindow
- \doifnot {\interactionparameter\c!page}\v!no
+ \doifnot{\interactionparameter\c!page}\v!no
\scrn_reference_enable_page_destinations
\to \everysetupinteraction
@@ -51,10 +51,10 @@
\enabledirectives[destinations.offset=\the\dimexpr\interactionparameter\c!focusoffset\relax]%
\to \everysetupinteraction
-\mutable\let\currentinteractioncloseaction \empty
-\mutable\let\currentinteractionclosepageaction\empty
-\mutable\let\currentinteractionopenaction \empty
-\mutable\let\currentinteractionopenpageaction \empty
+\mutable\lettonothing\currentinteractioncloseaction
+\mutable\lettonothing\currentinteractionclosepageaction
+\mutable\lettonothing\currentinteractionopenaction
+\mutable\lettonothing\currentinteractionopenpageaction
%D We have to make sure of some settings:
diff --git a/Master/texmf-dist/tex/context/base/mkxl/scrn-wid.lmt b/Master/texmf-dist/tex/context/base/mkxl/scrn-wid.lmt
new file mode 100644
index 00000000000..caa09adbd93
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/scrn-wid.lmt
@@ -0,0 +1,317 @@
+if not modules then modules = { } end modules ['scrn-wid'] = {
+ version = 1.001,
+ comment = "companion to scrn-wid.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- Support for interactive features is handled elsewhere. Now that is some mess! In
+-- the early days one had media features like sound and movies that were easy to set
+-- up. Then at some point renditions came around which were more work and somewhat
+-- unreliable. Now, both mechanism are obsolete and replaced by rich media which is
+-- a huge mess and has no real concept of what media are supported. There's flash
+-- cq. shockwave (basically obsolete too), and for instance mp4 needs to be handled
+-- by a swf player, and there's u3d which somehow has its own specification. One
+-- would expect native support for video and audio to be en-par with browsers but
+-- alas ... pdf has lost the battle with html here due to a few decades of
+-- unstability and changing support. So far we could catch on and even were ahead
+-- but I wonder if we should keep doing that. As we can't trust support for media we
+-- can better not embed anything and just use a hyperlink to an external resource. No
+-- sane person will create media rich pdf's as long as it's that unpredictable. Just
+-- look at the specification and viewer preferences and decide.
+
+local next = next
+
+interactions = interactions or { }
+local interactions = interactions
+
+local context = context
+local implement = interfaces.implement
+
+local allocate = utilities.storage.allocate
+
+local attachments = allocate()
+local comments = allocate()
+local renderings = allocate()
+local linkedlists = allocate()
+
+interactions.attachments = attachments
+interactions.renderings = renderings
+interactions.linkedlists = linkedlists
+
+local texsetbox = tex.setbox
+
+local jobpasses = job.passes
+
+local texgetcount = tex.getcount
+
+local codeinjections = backends.codeinjections
+local nodeinjections = backends.nodeinjections
+
+local variables = interfaces.variables
+local v_auto = variables.auto
+
+local trace_attachments = false trackers.register("widgets.attachments", function(v) trace_attachments = v end)
+
+local report_attachments = logs.reporter("widgets","attachments")
+
+-- Symbols
+
+implement {
+ name = "presetsymbollist",
+ arguments = "string",
+ actions = function(list)
+ codeinjections.presetsymbollist(list)
+ end
+}
+
+-- Attachments
+--
+-- registered : unique id
+-- tag : used at the tex end
+-- file : name that the file has on the filesystem
+-- name : name that the file will get in the output
+-- title : up to the backend
+-- subtitle : up to the backend
+-- author : up to the backend
+-- method : up to the backend (hidden == no rendering)
+
+local nofautoattachments, lastregistered = 0, nil
+
+local function checkregistered(specification)
+ local registered = specification.registered
+ if not registered or registered == "" or registered == v_auto then
+ nofautoattachments = nofautoattachments + 1
+ lastregistered = "attachment-" .. nofautoattachments
+ specification.registered = lastregistered
+ return lastregistered
+ else
+ return registered
+ end
+end
+
+local function checkbuffer(specification)
+ local buffer = specification.buffer
+ if buffer ~= "" then
+ specification.data = buffers.getcontent(buffer) or "<no data>"
+ end
+end
+
+function attachments.register(specification) -- beware of tag/registered mixup(tag is namespace)
+ local registered = checkregistered(specification)
+ checkbuffer(specification)
+ attachments[registered] = specification
+ if trace_attachments then
+ report_attachments("registering %a",registered)
+ end
+ return specification
+end
+
+function attachments.insert(specification)
+ local registered = checkregistered(specification)
+ local r = attachments[registered]
+ if r then
+ if trace_attachments then
+ report_attachments("including registered %a",registered)
+ end
+ for k, v in next, r do
+ local s = specification[k]
+ if s == "" then
+ specification[k] = v
+ end
+ end
+ elseif trace_attachments then
+ report_attachments("including unregistered %a",registered)
+ end
+ checkbuffer(specification)
+ return nodeinjections.attachfile(specification)
+end
+
+implement {
+ name = "registerattachment",
+ actions = attachments.register,
+ arguments = {
+ {
+ { "tag" },
+ { "registered" },
+ { "title" },
+ { "subtitle" },
+ { "author" },
+ { "file" },
+ { "name" },
+ { "buffer" },
+ { "mimetype" },
+ }
+ }
+}
+
+implement {
+ name = "insertattachment",
+ actions = function(specification)
+ texsetbox("b_scrn_attachment_link",(attachments.insert(specification)))
+ end,
+ arguments = {
+ {
+ { "tag" },
+ { "registered" },
+ { "method" },
+ { "width", "dimen" },
+ { "height", "dimen" },
+ { "depth", "dimen" },
+ { "colormodel", "integer" },
+ { "colorvalue", "integer" },
+ { "color" },
+ { "transparencyvalue", "integer" },
+ { "symbol" },
+ { "layer" },
+ { "title" },
+ { "subtitle" },
+ { "author" },
+ { "file" },
+ { "name" },
+ { "buffer" },
+ { "mimetype" },
+ }
+ }
+}
+
+-- Comment
+
+function comments.insert(specification)
+ local buffer = specification.buffer
+ if buffer ~= "" then
+ specification.data = buffers.getcontent(buffer) or ""
+ end
+ return nodeinjections.comment(specification)
+end
+
+implement {
+ name = "insertcomment",
+ actions = function(specification)
+ texsetbox("b_scrn_comment_link",(comments.insert(specification)))
+ end,
+ arguments = {
+ {
+ { "tag" },
+ { "title" },
+ { "subtitle" },
+ { "author" },
+ { "width", "dimen" },
+ { "height", "dimen" },
+ { "depth", "dimen" },
+ { "nx" },
+ { "ny" },
+ { "colormodel", "integer" },
+ { "colorvalue", "integer" },
+ { "transparencyvalue", "integer" },
+ { "option" },
+ { "symbol" },
+ { "buffer" },
+ { "layer" },
+ { "space" },
+ }
+ }
+}
+
+-- Renderings
+
+function renderings.register(specification)
+ if specification.label then
+ renderings[specification.label] = specification
+ return specification
+ end
+end
+
+function renderings.rendering(label)
+ local rn = renderings[label]
+ if not rn then
+ -- todo: message
+ return renderings.register { label = label }
+ else
+ return rn
+ end
+end
+
+function renderings.var(label,key)
+ local rn = renderings[label]
+ return rn and rn[key] or ""
+end
+
+implement {
+ name = "renderingvar",
+ actions = { renderings.var, context },
+ arguments = "2 strings",
+}
+
+implement {
+ name = "registerrendering",
+ actions = renderings.register,
+ arguments = {
+ {
+ { "label" },
+ { "mime" },
+ { "filename" },
+ { "option" },
+ }
+ }
+}
+
+-- Rendering:
+
+implement {
+ name = "insertrenderingwindow",
+ actions = function(specification)
+ codeinjections.insertrenderingwindow(specification)
+ end,
+ arguments = {
+ {
+ { "label" },
+ { "width", "dimen" },
+ { "height", "dimen" },
+ { "option" },
+ { "page", "integer" },
+ { "openpage" },
+ { "closepage" },
+ }
+ }
+}
+
+-- Linkedlists (only a context interface)
+
+implement {
+ name = "definelinkedlist",
+ arguments = "string",
+ actions = function(tag)
+ -- no need
+ end
+}
+
+implement {
+ name = "enhancelinkedlist",
+ arguments = { "string", "integer" },
+ actions = function(tag,n)
+ local ll = jobpasses.gettobesaved(tag)
+ if ll then
+ ll[n] = texgetcount("realpageno")
+ end
+ end
+}
+
+implement {
+ name = "addlinklistelement",
+ arguments = "string",
+ actions = function(tag)
+ local tobesaved = jobpasses.gettobesaved(tag)
+ local collected = jobpasses.getcollected(tag) or { }
+ local currentlink = #tobesaved + 1
+ local noflinks = #collected
+ tobesaved[currentlink] = 0
+ local f = collected[1] or 0
+ local l = collected[noflinks] or 0
+ local p = collected[currentlink-1] or f
+ local n = collected[currentlink+1] or l
+ context.setlinkedlistproperties(currentlink,noflinks,f,p,n,l)
+ -- context.ctxlatelua(function() commands.enhancelinkedlist(tag,currentlink) end)
+ end
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/scrn-wid.mklx b/Master/texmf-dist/tex/context/base/mkxl/scrn-wid.mklx
index 5d1d67a99d2..382635882e6 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/scrn-wid.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/scrn-wid.mklx
@@ -13,7 +13,7 @@
\writestatus{loading}{ConTeXt Interaction Macros / Widgets}
-\registerctxluafile{scrn-wid}{}
+\registerctxluafile{scrn-wid}{autosuffix}
% todo: expansion in comments (default is expanded)
% todo: check renderings ... acrobat crashes too easily on missing one
@@ -94,11 +94,11 @@
\c!depth=\v!fit,
\c!location=\v!high]
-\mutable\let\currentattachmentdepth \empty
-\mutable\let\currentattachmentheight \empty
-\mutable\let\currentattachmentregistered\empty
-\mutable\let\currentattachmentsymbol \empty
-\mutable\let\currentattachmentwidth \empty
+\mutable\lettonothing\currentattachmentdepth
+\mutable\lettonothing\currentattachmentheight
+\mutable\lettonothing\currentattachmentregistered
+\mutable\lettonothing\currentattachmentsymbol
+\mutable\lettonothing\currentattachmentwidth
\permanent\tolerant\protected\def\registerattachment[#tag]#spacer[#settings]% we save (globally) at the lua end
{\ifarguments\else
@@ -171,7 +171,7 @@
\setupattachment[\currentattachment][#settings]%
\expandnamespaceparameter\??attachmentmethod\attachmentparameter\c!method\v!normal}
-\setvalue{\??attachmentmethod\v!normal}%
+\defcsname\??attachmentmethod\v!normal\endcsname
{\edef\currentattachmentsymbol{\attachmentparameter\c!symbol}%
\edef\currentattachmentwidth {\attachmentparameter\c!width }%
\edef\currentattachmentheight{\attachmentparameter\c!height}%
@@ -214,7 +214,7 @@
\dp\b_scrn_attachment_link\currentattachmentdepth
\expandnamespaceparameter\??attachmentlocation\attachmentparameter\c!location\s!unknown}
-\setvalue{\??attachmentmethod\v!hidden}%
+\defcsname\??attachmentmethod\v!hidden\endcsname
{\clf_insertattachment
tag {\currentattachment}%
registered {\currentattachmentregistered}%
@@ -249,14 +249,14 @@
\let\scrn_attachment_flush\scrn_attachment_flush_normal
-\setvalue{\??attachmentlocation\v!inmargin }{\inmargin {\scrn_attachment_flush}}
-\setvalue{\??attachmentlocation\v!leftedge }{\inleftedge {\scrn_attachment_flush}}
-\setvalue{\??attachmentlocation\v!rightedge }{\inrightedge {\scrn_attachment_flush}}
-\setvalue{\??attachmentlocation\v!leftmargin }{\inleftmargin {\scrn_attachment_flush}}
-\setvalue{\??attachmentlocation\v!rightmargin}{\inrightmargin{\scrn_attachment_flush}}
-\setvalue{\??attachmentlocation\v!high }{\high {\scrn_attachment_flush}}
+\defcsname\??attachmentlocation\v!inmargin \endcsname{\inmargin {\scrn_attachment_flush}}
+\defcsname\??attachmentlocation\v!leftedge \endcsname{\inleftedge {\scrn_attachment_flush}}
+\defcsname\??attachmentlocation\v!rightedge \endcsname{\inrightedge {\scrn_attachment_flush}}
+\defcsname\??attachmentlocation\v!leftmargin \endcsname{\inleftmargin {\scrn_attachment_flush}}
+\defcsname\??attachmentlocation\v!rightmargin\endcsname{\inrightmargin{\scrn_attachment_flush}}
+\defcsname\??attachmentlocation\v!high \endcsname{\high {\scrn_attachment_flush}}
-\setvalue{\??attachmentlocation\v!none}%
+\defcsname\??attachmentlocation\v!none\endcsname
{\global\setbox\b_scrn_attachment_collect\hbox\bgroup
\ifvoid\b_scrn_attachment_collect\else
\box\b_scrn_attachment_collect
@@ -265,7 +265,7 @@
\scrn_attachment_flush
\egroup}
-\setvalue{\??attachmentlocation\s!unknown}%
+\defcsname\??attachmentlocation\s!unknown\endcsname
{\ifvoid\b_scrn_attachment_collect\else
\box\b_scrn_attachment_collect
\fi}
@@ -403,15 +403,15 @@
\c!buffer=\v!comment,
\c!location=\v!high]
-\mutable\let\currentcommentdepth \empty
-\mutable\let\currentcommentheight\empty
-\mutable\let\currentcommentsymbol\empty
-\mutable\let\currentcommentwidth \empty
+\mutable\lettonothing\currentcommentdepth
+\mutable\lettonothing\currentcommentheight
+\mutable\lettonothing\currentcommentsymbol
+\mutable\lettonothing\currentcommentwidth
\appendtoks
- \frozen\instance\setuevalue \currentcomment {\scrn_comment_argument[\currentcomment]}%
- \frozen\instance\setuevalue{\e!start\currentcomment}{\scrn_comment_start [\currentcomment]}%
- \frozen\instance\setuevalue{\e!stop \currentcomment}{\scrn_comment_stop }%
+ \frozen\protected\instance\edefcsname \currentcomment\endcsname{\scrn_comment_argument[\currentcomment]}%
+ \frozen\protected\instance\edefcsname\e!start\currentcomment\endcsname{\scrn_comment_start [\currentcomment]}%
+ \frozen\protected\instance\edefcsname\e!stop \currentcomment\endcsname{\scrn_comment_stop }%
\to \everydefinecomment
\tolerant\protected\def\scrn_comment_argument[#category]#spacer[#title]#spacer[#settings]#:#text%%
@@ -461,7 +461,7 @@
%D Beware: comments symbols don't scale in acrobat (cf. spec but somewhat
%D weird, esp because for instance attachment symbols do scale).
-\setvalue{\??commentmethods\v!normal}%
+\defcsname\??commentmethods\v!normal\endcsname
{\edef\currentcommentsymbol{\commentparameter\c!symbol}%
\edef\currentcommentwidth {\commentparameter\c!width }%
\edef\currentcommentheight{\commentparameter\c!height}%
@@ -502,7 +502,7 @@
\dp\b_scrn_comment_link\currentcommentdepth
\expandnamespaceparameter\??commentlocation\commentparameter\c!location\s!unknown}
-\letvalue{\??commentmethods\v!hidden}\donothing
+\aliased\letcsname\??commentmethods\v!hidden\endcsname\donothing
\protected\def\scrn_comment_flush_traced
{\hpack\bgroup
@@ -527,14 +527,14 @@
% todo: dedicated margin classes
-\setvalue{\??commentlocation\v!inmargin }{\inmargin {\scrn_comment_flush}}
-\setvalue{\??commentlocation\v!leftedge }{\inleftedge {\scrn_comment_flush}}
-\setvalue{\??commentlocation\v!rightedge }{\inrightedge {\scrn_comment_flush}}
-\setvalue{\??commentlocation\v!leftmargin }{\inleftmargin {\scrn_comment_flush}}
-\setvalue{\??commentlocation\v!rightmargin}{\inrightmargin{\scrn_comment_flush}}
-\setvalue{\??commentlocation\v!high }{\high {\scrn_comment_flush}}
+\defcsname\??commentlocation\v!inmargin \endcsname{\inmargin {\scrn_comment_flush}}
+\defcsname\??commentlocation\v!leftedge \endcsname{\inleftedge {\scrn_comment_flush}}
+\defcsname\??commentlocation\v!rightedge \endcsname{\inrightedge {\scrn_comment_flush}}
+\defcsname\??commentlocation\v!leftmargin \endcsname{\inleftmargin {\scrn_comment_flush}}
+\defcsname\??commentlocation\v!rightmargin\endcsname{\inrightmargin{\scrn_comment_flush}}
+\defcsname\??commentlocation\v!high \endcsname{\high {\scrn_comment_flush}}
-\setvalue{\??commentlocation\v!none}%
+\defcsname\??commentlocation\v!none\endcsname
{\global\setbox\b_scrn_comment_collect\hbox\bgroup
\ifvoid\b_scrn_comment_collect\else
\box\b_scrn_comment_collect
@@ -543,7 +543,7 @@
\scrn_comment_flush
\egroup}
-\setvalue{\??commentlocation\s!unknown}%
+\defcsname\??commentlocation\s!unknown\endcsname
{\ifvoid\b_scrn_comment_collect\else
\box\b_scrn_comment_collect
\fi}
@@ -559,96 +559,69 @@
% \definecomment[\v!comment]
% \fi
-%D Soundclips:
+%D Conform Michals recommendations support for the old movie (and sound) annotations
+%D has been removed. This also means that movies are no longer a valid external figure
+%D format. So be it.
%D
-%D Defining sound tracks:
+%D Renderings (adapted to \MKIV\ by Michal Vlasák). We no longer have the \MKII\ internal
+%D and external rendering because over time all this widget stuff changed in \PDF\ and
+%D Acrobat.
%D
%D \starttyping
-%D \useexternalsoundtrack[label][file]
-%D \stoptyping
-%D
-%D associated actions: StartSound StopSound PauseSound ResumeSound
+%D \setupinteraction[state=start]
%D
-%D Todo: like external figures, also search on path,
-%D although, they need to be present ar viewing time, so ...
-
-\installcorenamespace{externalsoundtracks}
-
-\installsetuponlycommandhandler \??externalsoundtracks {externalsoundtracks}
-
-\setupexternalsoundtracks
- [\c!option=]
-
-\permanent\tolerant\protected\def\useexternalsoundtrack[#tag]#spacer[#filename]%
- {\clf_registersoundclip
- tag {#tag}%
- file {#filename}%
- \relax}
-
-\permanent\def\checksoundtrack#tag% yet untested in mkiv (also move management to lua)
- {\iflocation
- \clf_insertsoundclip
- tag {#tag}%
- repeat {\directexternalsoundtracksparameter\c!option}%
- \relax
- \fi}
-
-%D Renderings (not yet tested in mkvi):
-
-% Todo: multiple instances and inheritance .. will be done when needed i.e. when I
-% see usage. Probaly by that time this feature is dropped (as are other media
-% rel;ated ones).
-
-\mutable\let\currentrendering \empty
-\mutable\let\currentrenderingtype \empty
-\mutable\let\currentrenderingwindow\empty
+%D \starttext
+%D \startTEXpage[offset=10pt]
+%D % \definerenderingwindow[myrenderingwindow][width=\textwidth, height=\textwidth]
+%D % \definerenderingwindow[myrenderingwindow][width=\textwidth, height=\textwidth, openpageaction=StartRendering{myvideo}]
+%D \definerenderingwindow[myrenderingwindow][width=\textwidth, height=\textwidth, openpageaction=StartCurrentRendering, closepageaction=StopCurrentRendering]
+%D % \userendering[myvideo][video/mp4][edited.mp4][embed=yes, auto]
+%D \userendering[myvideo][video/mp4][woodwork.mp4][embed=yes, auto]
+%D % auto = openpageaction=StartCurrentRendering, closepageaction=StopCurrentRendering
+%D \placerenderingwindow[myrenderingwindow][myvideo]
+%D \blank
+%D \goto{start}[StartRendering{myvideo}]
+%D \goto{stop}[StopRendering{myvideo}]
+%D \stopTEXpage
+%D \stoptext
+%D \stoptyping
-\definereference[StartCurrentRendering] [\v!StartRendering {\currentrendering}]
-\definereference[StopCurrentRendering] [\v!StopRendering {\currentrendering}]
-\definereference[PauseCurrentRendering] [\v!PauseRendering {\currentrendering}]
-\definereference[ResumeCurrentRendering][\v!ResumeRendering{\currentrendering}]
+\mutable\lettonothing\currentrendering
+\mutable\lettonothing\currentrenderingwindow
-\permanent\tolerant\protected\def\useexternalrendering[#tag]#spacer[#mime]#spacer[#file]#spacer[#option]%
+\permanent\tolerant\protected\def\userendering[#tag]#spacer[#mime]#spacer[#file]#spacer[#option]%
{\clf_registerrendering
- type {external}%
label {#tag}%
mime {#mime}%
filename {#file}%
option {#option}%
\relax}
-\permanent\tolerant\protected\def\setinternalrendering[#tag]#spacer[#option]% {content} % crappy
- {\bgroup
- \dowithnextbox
- {\clf_registerrendering
- type {internal}%
- label {#tag}%
- mime {IRO}% brrr
- filename {#tag}%
- option {#option}%
- \relax
- \let\objectoffset\zeropoint
- \setobject{IRO}{#tag}\hpack{\box\nextbox}%
- \egroup}%
- \hbox}
+\permanent\tolerant\protected\let\useexternalrendering\userendering
-\permanent\def\renderingtype #tag{\clf_renderingvar{#tag}{type}}
\permanent\def\renderingoption#tag{\clf_renderingvar{#tag}{option}}
-\newdimen\d_scrn_rendering_width \d_scrn_rendering_width 8cm
-\newdimen\d_scrn_rendering_height \d_scrn_rendering_height 6cm
+\newdimension\d_scrn_rendering_width \d_scrn_rendering_width 8cm
+\newdimension\d_scrn_rendering_height \d_scrn_rendering_height 6cm
\let\m_scrn_rendering_page\!!zerocount
+%D \starttyping
+%D \definerenderingwindow[soundplace][width=0pt, height=0pt]
+%D \useexternalrendering[mainsound][audio/mp3][sound.mp3][embed=yes]
+%D \placerenderingwindow[soundplace][mainsound]
+%D \stoptyping
+
\installcorenamespace{renderingwindow}
\installframedcommandhandler \??renderingwindow {renderingwindow} \??renderingwindow
\appendtoks
- \letrenderingwindowparameter\c!openpageaction \empty
- \letrenderingwindowparameter\c!closepageaction\empty
- \setrenderingwindowparameter\c!width {\d_scrn_rendering_width }%
- \setrenderingwindowparameter\c!height {\d_scrn_rendering_height}%
+ \resetrenderingwindowparameter\c!openpageaction
+ \resetrenderingwindowparameter\c!closepageaction
+ \setrenderingwindowparameter \c!width {\d_scrn_rendering_width }%
+ \setrenderingwindowparameter \c!height {\d_scrn_rendering_height}%
+ \letrenderingwindowparameter \c!align \v!flushleft
\to \everypresetrenderingwindow
\permanent\tolerant\protected\def\placerenderingwindow[#window]#spacer[#rendering]% do all in lua
@@ -662,13 +635,7 @@
\else
\edef\currentrenderingwindow{#window}%
\fi
- \edef\currentrenderingtype{\renderingtype\currentrendering}%
- \ifx\currentrenderingtype\s!internal
- \getobjectdimensions{IRO}\currentrendering
- \d_scrn_rendering_height\dimexpr\objectheight+\objectdepth\relax
- \d_scrn_rendering_width\objectwidth\relax
- \getobjectreferencepage{IRO}\currentrendering\m_scrn_rendering_page
- \orelse\ifx\currentrenderingwindow\s!default
+ \ifx\currentrenderingwindow\s!default
\d_scrn_rendering_height\vsize
\d_scrn_rendering_width \hsize
\let\m_scrn_rendering_page\realpageno
@@ -677,19 +644,18 @@
\d_scrn_rendering_width \renderingwindowparameter\c!width
\let\m_scrn_rendering_page\realpageno
\fi
- % todo:
- % \handlereferenceactions{\renderingwindowparameter\c!openpageaction }\dosetuprenderingopenpageaction
- % \handlereferenceactions{\renderingwindowparameter\c!closepageaction}\dosetuprenderingclosepageaction
\letrenderingwindowparameter\c!offset\v!overlay
\inheritedrenderingwindowframed
{\vfilll
\dontleavehmode
\clf_insertrenderingwindow
- label {\currentrendering}%
- width \d_scrn_rendering_width
- height \d_scrn_rendering_height
- option {\renderingoption\currentrendering}%
- page \m_scrn_rendering_page
+ label {\currentrendering}%
+ width \d_scrn_rendering_width
+ height \d_scrn_rendering_height
+ option {\renderingoption\currentrendering}%
+ page \m_scrn_rendering_page
+ openpage {\renderingwindowparameter\c!openpageaction}%
+ closepage {\renderingwindowparameter\c!closepageaction}%
\relax
\hfill}%
\egroup}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/scrp-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/scrp-ini.lmt
new file mode 100644
index 00000000000..a8856f14877
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/scrp-ini.lmt
@@ -0,0 +1,918 @@
+if not modules then modules = { } end modules ['scrp-ini'] = {
+ version = 1.001,
+ comment = "companion to scrp-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- We need to rewrite this a bit ... rather old code ... will be done when japanese
+-- is finished.
+
+local tonumber, next = tonumber, next
+local setmetatableindex = table.setmetatableindex
+local utfbyte, utfsplit = utf.byte, utf.split
+local gmatch = string.gmatch
+
+local trace_analyzing = false trackers.register("scripts.analyzing", function(v) trace_analyzing = v end)
+local trace_injections = false trackers.register("scripts.injections", function(v) trace_injections = v end)
+local trace_splitting = false trackers.register("scripts.splitting", function(v) trace_splitting = v end)
+local trace_splitdetails = false trackers.register("scripts.splitting.details", function(v) trace_splitdetails = v end)
+
+local report_preprocessing = logs.reporter("scripts","preprocessing")
+local report_splitting = logs.reporter("scripts","splitting")
+
+local attributes = attributes
+local nodes = nodes
+local context = context
+
+local nodecodes = nodes.nodecodes
+
+local implement = interfaces.implement
+
+local glyph_code = nodecodes.glyph
+local glue_code = nodecodes.glue
+
+local emwidths = fonts.hashes.emwidths
+local exheights = fonts.hashes.exheights
+
+local a_script = attributes.private('script')
+
+local fontdata = fonts.hashes.identifiers
+local allocate = utilities.storage.allocate
+local setnodecolor = nodes.tracers.colors.set
+
+local enableaction = nodes.tasks.enableaction
+local disableaction = nodes.tasks.disableaction
+
+local nuts = nodes.nuts
+
+local getnext = nuts.getnext
+local getchar = nuts.getchar
+local getfont = nuts.getfont
+local getscript = nuts.getscript
+local getid = nuts.getid
+local getglyphdata = nuts.getglyphdata
+local setglyphdata = nuts.setglyphdata
+
+local isglyph = nuts.isglyph
+
+local firstglyph = nuts.firstglyph
+
+local nextglyph = nuts.traversers.glyph
+local nextchar = nuts.traversers.char
+
+local texsetglyphscript = tex.setglyphscript
+
+local nodepool = nuts.pool
+
+local new_glue = nodepool.glue
+local new_rule = nodepool.rule
+local new_penalty = nodepool.penalty
+
+scripts = scripts or { }
+local scripts = scripts
+
+local handlers = allocate()
+scripts.handlers = handlers
+
+local injectors = allocate()
+scripts.injectors = handlers
+
+local splitters = allocate()
+scripts.splitters = splitters
+
+local helpers = allocate()
+scripts.helpers = helpers
+
+local insertnodebefore, insertnodeafter do
+
+ local insertafter = nuts.insertafter
+ local insertbefore = nuts.insertbefore
+ local setattributelist = nuts.setattributelist
+
+ insertnodebefore = function (head,current,what) -- todo : lmtx
+ setattributelist(what,current)
+ head, current = insertbefore(head,current,what)
+ return head, current
+ end
+
+ insertnodeafter = function(head,current,what) -- todo : lmtx
+ setattributelist(what,current)
+ head, current = insertafter(head,current,what)
+ return head, current
+ end
+
+ helpers.insertnodebefore = insertnodebefore
+ helpers.insertnodeafter = insertnodeafter
+
+end
+
+local hash = characters.scripthash
+
+local numbertodataset = allocate()
+local numbertohandler = allocate()
+
+scripts.numbertodataset = numbertodataset
+scripts.numbertohandler = numbertohandler
+
+local defaults = {
+ inter_char_shrink_factor = 0,
+ inter_char_shrink_factor = 0,
+ inter_char_stretch_factor = 0,
+ inter_char_half_shrink_factor = 0,
+ inter_char_half_stretch_factor = 0,
+ inter_char_quarter_shrink_factor = 0,
+ inter_char_quarter_stretch_factor = 0,
+ inter_char_hangul_penalty = 0,
+
+ inter_word_stretch_factor = 0,
+}
+
+scripts.defaults = defaults -- so we can add more
+
+-- todo: copy more efficient than metatable
+
+function scripts.installmethod(handler)
+ local name = handler.name
+ handlers[name] = handler
+ local attributes = { }
+ local datasets = handler.datasets
+ if not datasets or not datasets.default then
+ report_preprocessing("missing (default) dataset in script %a",name)
+ datasets.default = { } -- slower but an error anyway
+ end
+
+ for k, v in next, datasets do
+ setmetatableindex(v,defaults)
+ end
+ setmetatableindex(attributes, function(t,k)
+ local v = datasets[k] or datasets.default
+ local a = 0
+ if v then
+ v.name = name -- for tracing
+ a = #numbertodataset + 1
+ numbertodataset[a] = v
+ numbertohandler[a] = handler
+ end
+ t[k] = a
+ return a
+ end)
+ handler.attributes = attributes
+end
+
+function scripts.installdataset(specification) -- global overload
+ local method = specification.method
+ local name = specification.name
+ local dataset = specification.dataset
+ if method and name and dataset then
+ local parent = specification.parent or ""
+ local handler = handlers[method]
+ if handler then
+ local datasets = handler.datasets
+ if datasets then
+ local defaultset = datasets.default
+ if defaultset then
+ if parent ~= "" then
+ local p = datasets[parent]
+ if p then
+ defaultset = p
+ else
+ report_preprocessing("dataset, unknown parent %a for method %a",parent,method)
+ end
+ end
+ setmetatable(dataset,defaultset)
+ local existing = datasets[name]
+ if existing then
+ for k, v in next, existing do
+ existing[k] = dataset
+ end
+ else
+ datasets[name] = dataset
+ end
+ else
+ report_preprocessing("dataset, no default for method %a",method)
+ end
+ else
+ report_preprocessing("dataset, no datasets for method %a",method)
+ end
+ else
+ report_preprocessing("dataset, no method %a",method)
+ end
+ else
+ report_preprocessing("dataset, invalid specification") -- maybe report table
+ end
+end
+
+local injectorenabled = false
+local splitterenabled = false
+
+local function getscriptdata(n)
+ local s = getscript(n)
+ if s then
+ return s and numbertodataset[s]
+ end
+end
+
+local function getinjector(n)
+ local s = getscript(n)
+ if s then
+ s = numbertohandler[s]
+ return s and s.injector
+ end
+end
+
+local function getsplitter(n)
+ local s = getscript(n)
+ if s then
+ s = numbertodataset[s]
+ return s and s.splitter
+ end
+end
+
+scripts.getdata = getscriptdata
+scripts.getinjector = getinjector
+scripts.getsplitter = getsplitter
+
+function scripts.set(name,method,preset)
+ local handler = handlers[method]
+ if handler then
+ local index = handler.attributes[preset]
+ if handler.injector then
+ if not injectorenabled then
+ enableaction("processors","scripts.injectors.handler")
+ injectorenabled = true
+ end
+ end
+ if handler.splitter then
+ if not splitterenabled then
+ enableaction("processors","scripts.splitters.handler")
+ splitterenabled = true
+ end
+ end
+ if handler.initializer then
+ handler.initializer(handler)
+ handler.initializer = nil
+ end
+ texsetglyphscript(index)
+ else
+ texsetglyphscript()
+ end
+end
+
+function scripts.reset()
+ texsetglyphscript()
+end
+
+-- 0=gray 1=red 2=green 3=blue 4=yellow 5=magenta 6=cyan 7=x-yellow 8=x-magenta 9=x-cyan
+
+-- local categories = allocate { -- rather bound to cjk ... will be generalized
+-- "korean",
+-- "chinese",
+-- "katakana",
+-- "hiragana",
+-- "full_width_open",
+-- "full_width_close",
+-- "half_width_open",
+-- "half_width_close",
+-- "full_width_punct",
+-- "hyphen",
+-- "non_starter",
+-- "jamo_initial",
+-- "jamo_medial",
+-- "jamo_final",
+-- "ethiopic_syllable",
+-- "ethiopic_word",
+-- "ethiopic_sentence",
+-- "breaking_tsheg",
+-- "nonbreaking_tsheg",
+-- }
+--
+-- scripts.categories = categories
+
+local scriptcolors = allocate {
+ -- todo: just named colors
+ hyphen = "trace:5",
+}
+
+scripts.colors = scriptcolors
+
+-- this can become setprop ...
+
+local propertydata = nodes.properties.data
+
+local function setscriptstatus(n,s)
+ local p = propertydata[n]
+ if p then
+ p.scriptstatus = s
+ else
+ propertydata[n] = { scriptstatus = s }
+ end
+end
+
+function getscriptstatus(n)
+ local p = propertydata[n]
+ if p then
+ return p.scriptstatus
+ end
+end
+
+scripts.setstatus = setscriptstatus
+scripts.getstatus = getscriptstatus
+
+--
+
+local function colorize(start,stop)
+ for n in nextglyph, start do
+ local kind = getscriptstatus(n)
+ if kind then
+ local ac = scriptcolors[kind]
+ if ac then
+ setnodecolor(n,ac)
+ end
+ end
+ if n == stop then
+ break
+ end
+ end
+end
+
+local function traced_process(head,first,last,process,a)
+ if start ~= last then
+ local f, l = first, last
+ local name = numbertodataset[a]
+ name = name and name.name or "?"
+ report_preprocessing("before %s: %s",name,nodes.tosequence(f,l))
+ process(head,first,last)
+ report_preprocessing("after %s: %s", name,nodes.tosequence(f,l))
+ end
+end
+
+function scripts.injectors.handler(head)
+ local start = firstglyph(head) -- we already have glyphs here (subtype 1)
+ if not start then
+ return head
+ else
+ local last_a, normal_process, lastfont, originals, first, last
+ local ok = false
+ while start do
+ local char, id = isglyph(start)
+ if char then
+ local a = getscript(start)
+ if a then
+ if a ~= last_a then
+ if first then
+ if ok then
+ if trace_analyzing then
+ colorize(first,last)
+ end
+ if trace_injections then
+ traced_process(head,first,last,normal_process,last_a)
+ else
+ normal_process(head,first,last)
+ end
+ ok = false
+ end
+ first, last = nil, nil
+ end
+ last_a = a
+ -- normal_process = getinjector(start)
+ normal_process = numbertohandler[a]
+ if normal_process then
+ normal_process = normal_process.injector
+ end
+ end
+ if normal_process then
+ if id ~= lastfont then
+ originals = fontdata[id].resources
+ if resources then
+ originals = resources.originals
+ else
+ originals = nil -- can't happen
+ end
+ lastfont = id
+ end
+ if originals and type(originals) == "number" then
+ char = originals[char] or char
+ end
+ local h = hash[char]
+ if h then
+ setscriptstatus(start,h)
+ if not first then
+ first, last = start, start
+ else
+ last = start
+ end
+ -- if cjk == "chinese" or cjk == "korean" then -- we need to prevent too much ( ) processing
+ ok = true
+ -- end
+ elseif first then
+ if ok then
+ if trace_analyzing then
+ colorize(first,last)
+ end
+ if trace_injections then
+ traced_process(head,first,last,normal_process,last_a)
+ else
+ normal_process(head,first,last)
+ end
+ ok = false
+ end
+ first, last = nil, nil
+ end
+ end
+ elseif first then
+ if ok then
+ if trace_analyzing then
+ colorize(first,last)
+ end
+ if trace_injections then
+ traced_process(head,first,last,normal_process,last_a)
+ else
+ normal_process(head,first,last)
+ end
+ ok = false
+ end
+ first, last = nil, nil
+ end
+ elseif id == glue_code then
+ if ok then
+ -- continue
+ elseif first then
+ -- no chinese or korean
+ first, last = nil, nil
+ end
+ elseif first then
+ if ok then
+ -- some chinese or korean
+ if trace_analyzing then
+ colorize(first,last)
+ end
+ if trace_injections then
+ traced_process(head,first,last,normal_process,last_a)
+ else
+ normal_process(head,first,last)
+ end
+ first, last, ok = nil, nil, false
+ elseif first then
+ first, last = nil, nil
+ end
+ end
+ start = getnext(start)
+ end
+ if ok then
+ if trace_analyzing then
+ colorize(first,last)
+ end
+ if trace_injections then
+ traced_process(head,first,last,normal_process,last_a)
+ else
+ normal_process(head,first,last)
+ end
+ end
+ return head
+ end
+end
+
+-- kind of experimental .. might move to it's own module
+
+-- function scripts.splitters.handler(head)
+-- return head
+-- end
+
+local function addwords(tree,data)
+ if not tree then
+ tree = { }
+ end
+ for word in gmatch(data,"%S+") do
+ local root = tree
+ local list = utfsplit(word,true)
+ for i=1,#list do
+ local l = utfbyte(list[i])
+ local r = root[l]
+ if not r then
+ r = { }
+ root[l] = r
+ end
+ if i == #list then
+ r.final = word -- true -- could be something else, like word in case of tracing
+ else
+ root = r
+ end
+ end
+ end
+ return tree
+end
+
+local loaded = { }
+
+function splitters.load(handler,files)
+ local files = handler.files
+ local tree = handler.tree or { }
+ handler.tree = tree
+ if not files then
+ return
+ elseif type(files) == "string" then
+ files = { files }
+ handler.files = files
+ end
+ if trace_splitting then
+ report_splitting("loading splitter data for language/script %a",handler.name)
+ end
+ loaded[handler.name or "unknown"] = (loaded[handler.name or "unknown"] or 0) + 1
+ statistics.starttiming(loaded)
+ for i=1,#files do
+ local filename = files[i]
+ local fullname = resolvers.findfile(filename)
+ if fullname == "" then
+ fullname = resolvers.findfile(filename .. ".gz")
+ end
+ if fullname ~= "" then
+ if trace_splitting then
+ report_splitting("loading file %a",fullname)
+ end
+ local suffix, gzipped = gzip.suffix(fullname)
+ if suffix == "lua" then
+ local specification = table.load(fullname,gzipped and gzip.load)
+ if specification then
+ local lists = specification.lists
+ if lists then
+ for i=1,#lists do
+ local entry = lists[i]
+ local data = entry.data
+ if data then
+ if entry.compression == "zlib" then
+ data = zlib.decompress(data)
+ if entry.length and entry.length ~= #data then
+ report_splitting("compression error in file %a",fullname)
+ end
+ end
+ if data then
+ addwords(tree,data)
+ end
+ end
+ end
+ end
+ end
+ else
+ local data = gzipped and io.loadgzip(fullname) or io.loaddata(fullname)
+ if data then
+ addwords(tree,data)
+ end
+ end
+ else
+ report_splitting("unknown file %a",filename)
+ end
+ end
+ statistics.stoptiming(loaded)
+ return tree
+end
+
+statistics.register("loaded split lists", function()
+ if next(loaded) then
+ return string.format("%s, load time: %s",table.sequenced(loaded),statistics.elapsedtime(loaded))
+ end
+end)
+
+-- function splitters.addlist(name,filename)
+-- local handler = scripts.handlers[name]
+-- if handler and filename then
+-- local files = handler.files
+-- if not files then
+-- files = { }
+-- elseif type(files) == "string" then
+-- files = { files }
+-- end
+-- handler.files = files
+-- if type(filename) == "string" then
+-- filename = utilities.parsers.settings_to_array(filename)
+-- end
+-- if type(filename) == "table" then
+-- for i=1,#filename do
+-- files[#files+1] = filenames[i]
+-- end
+-- end
+-- end
+-- end
+--
+-- commands.setscriptsplitterlist = splitters.addlist
+
+local categories = characters.categories or { }
+
+local function hit(root,head)
+ local current = getnext(head)
+ local lastrun = false
+ local lastfinal = false
+ while current do
+ local char = isglyph(current)
+ if char then
+ local newroot = root[char]
+ if newroot then
+ local final = newroot.final
+ if final then
+ lastrun = current
+ lastfinal = final
+ end
+ root = newroot
+ elseif categories[char] == "mn" then
+ -- continue
+ else
+ return lastrun, lastfinal
+ end
+ else
+ break
+ end
+ end
+ if lastrun then
+ return lastrun, lastfinal
+ end
+end
+
+local tree, attr, proc
+
+function splitters.handler(head) -- todo: also firstglyph test
+ local current = head
+ while current do
+ if getid(current) == glyph_code then
+ local a = getsplitter(current)
+ if a then
+ if a ~= attr then
+ local handler = numbertohandler[a]
+ tree = handler.tree or { }
+ attr = a
+ proc = a
+ end
+ if proc then
+ local root = tree[getchar(current)]
+ if root then
+ -- we don't check for attributes in the hitter (yet)
+ local last, final = hit(root,current)
+ if last then
+ local next = getnext(last)
+ if next then
+ local nextchar = isglyph(next)
+ if not nextchar then
+ -- we're done
+ elseif tree[nextchar] then
+ if trace_splitdetails then
+ if type(final) == "string" then
+ report_splitting("advance %s processing between <%s> and <%c>","with",final,nextchar)
+ else
+ report_splitting("advance %s processing between <%c> and <%c>","with",char,nextchar)
+ end
+ end
+ head, current = proc(handler,head,current,last,1)
+ else
+ if trace_splitdetails then
+ -- could be punctuation
+ if type(final) == "string" then
+ report_splitting("advance %s processing between <%s> and <%c>","without",final,nextchar)
+ else
+ report_splitting("advance %s processing between <%c> and <%c>","without",char,nextchar)
+ end
+ end
+ head, current = proc(handler,head,current,last,2)
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ current = getnext(current)
+ end
+ return head
+end
+
+local function marker(head,current,font,color) -- could become: nodes.tracers.marker
+ local ex = exheights[font]
+ local em = emwidths [font]
+ head, current = insertnodeafter(head,current,new_penalty(10000))
+ head, current = insertnodeafter(head,current,new_glue(-0.05*em))
+ head, current = insertnodeafter(head,current,new_rule(0.05*em,1.5*ex,0.5*ex))
+ setnodecolor(current,color)
+ return head, current
+end
+
+local last_a, last_f, last_s, last_q
+
+function splitters.insertafter(handler,head,first,last,detail)
+ local a = getscriptdata(first)
+ local f = getfont(first)
+ if a and a ~= last_a or f ~= last_f then
+ last_s = emwidths[f] * data.inter_word_stretch_factor
+ last_a = a
+ last_f = f
+ end
+ if trace_splitting then
+ head, last = marker(head,last,f,detail == 2 and "trace:r" or "trace:g")
+ end
+ if ignore then
+ return head, last
+ else
+ return insertnodeafter(head,last,new_glue(0,last_s))
+ end
+end
+
+-- word-xx.lua:
+--
+-- return {
+-- comment = "test",
+-- copyright = "not relevant",
+-- language = "en",
+-- timestamp = "2013-05-20 14:15:21",
+-- version = "1.00",
+-- lists = {
+-- {
+-- -- data = "we thrive information in thick worlds because of our marvelous and everyday capacity to select edit single out structure highlight group pair merge harmonize synthesize focus organize condense reduce boil down choose categorize catalog classify list abstract scan look into idealize isolate discriminate distinguish screen pigeonhole pick over sort integrate blend inspect filter lump skip smooth chunk average approximate cluster aggregate outline summarize itemize review dip into flip through browse glance into leaf through skim refine enumerate glean synopsize winnow the wheat from the chaff and separate the sheep from the goats",
+-- data = "abstract aggregate and approximate average because blend boil browse capacity catalog categorize chaff choose chunk classify cluster condense dip discriminate distinguish down edit enumerate everyday filter flip focus from glance glean goats group harmonize highlight idealize in information inspect integrate into isolate itemize leaf list look lump marvelous merge of organize our out outline over pair pick pigeonhole reduce refine review scan screen select separate sheep single skim skip smooth sort structure summarize synopsize synthesize the thick thrive through to we wheat winnow worlds",
+-- },
+-- },
+-- }
+
+scripts.installmethod {
+ name = "test",
+ splitter = splitters.insertafter,
+ initializer = splitters.load,
+ files = {
+ -- "scrp-imp-word-test.lua",
+ "word-xx.lua",
+ },
+ datasets = {
+ default = {
+ inter_word_stretch_factor = 0.25, -- of quad
+ },
+ },
+}
+
+-- new plugin:
+
+local registercontext = fonts.specifiers.registercontext
+local mergecontext = fonts.specifiers.mergecontext
+
+local otfscripts = characters.otfscripts
+
+local report_scripts = logs.reporter("scripts","auto feature")
+local trace_scripts = false trackers.register("scripts.autofeature",function(v) trace_scripts = v end)
+
+local autofontfeature = scripts.autofontfeature or { }
+scripts.autofontfeature = autofontfeature
+
+local cache_yes = { }
+local cache_nop = { }
+
+setmetatableindex(cache_yes,function(t,k) local v = { } t[k] = v return v end)
+setmetatableindex(cache_nop,function(t,k) local v = { } t[k] = v return v end)
+
+-- beware: we need to tag a done (otherwise too many extra instances ... but how
+-- often unpack? wait till we have a bitmap
+--
+-- we can consider merging this in handlers.characters(head) at some point as there
+-- already check for the dynamic attribute so it saves a pass, however, then we also
+-- need to check for a_scriptinjection there which nils the benefit
+--
+-- we can consider cheating: set all glyphs in a word as the first one but it's not
+-- playing nice
+
+function autofontfeature.handler(head)
+ for n, char, font in nextchar, head do
+ -- if getscript(n) then
+ -- -- already tagged by script feature, maybe some day adapt
+ -- else
+ local script = otfscripts[char]
+ if script then
+ local dynamic = getglyphdata(n) or 0
+ if dynamic > 0 then
+ local slot = cache_yes[font]
+ local attr = slot[script]
+ if not attr then
+ attr = mergecontext(dynamic,name,2)
+ slot[script] = attr
+ if trace_scripts then
+ report_scripts("script: %s, trigger %C, dynamic: %a, variant: %a",script,char,attr,"extended")
+ end
+ end
+ if attr ~= 0 then
+ n[0] = attr
+ -- maybe set scriptinjection when associated
+ end
+ else
+ local slot = cache_nop[font]
+ local attr = slot[script]
+ if not attr then
+ attr = registercontext(font,script,2)
+ slot[script] = attr
+ if trace_scripts then
+ report_scripts("script: %s, trigger %C, dynamic: %s, variant: %a",script,char,attr,"normal")
+ end
+ end
+ if attr ~= 0 then
+ setglyphdata(n,attr)
+ -- maybe set scriptinjection when associated
+ end
+ end
+ end
+ -- end
+ end
+ return head
+end
+
+function autofontfeature.enable()
+ report_scripts("globally enabled")
+ enableaction("processors","scripts.autofontfeature.handler")
+end
+
+function autofontfeature.disable()
+ report_scripts("globally disabled")
+ disableaction("processors","scripts.autofontfeature.handler")
+end
+
+implement {
+ name = "enableautofontscript",
+ actions = autofontfeature.enable
+}
+
+implement {
+ name = "disableautofontscript",
+ actions = autofontfeature.disable }
+
+implement {
+ name = "setscript",
+ actions = scripts.set,
+ arguments = "3 strings",
+}
+
+implement {
+ name = "resetscript",
+ actions = scripts.reset
+}
+
+-- some common helpers
+
+do
+
+ local parameters = fonts.hashes.parameters
+
+ local space, stretch, shrink, lastfont
+
+ local inter_character_space_factor = 1
+ local inter_character_stretch_factor = 1
+ local inter_character_shrink_factor = 1
+
+ local function space_glue(current)
+ -- local data = numbertodataset[getattr(current,a_scriptinjection)]
+ local data = getscriptdata(current)
+ if data then
+ inter_character_space_factor = data.inter_character_space_factor or 1
+ inter_character_stretch_factor = data.inter_character_stretch_factor or 1
+ inter_character_shrink_factor = data.inter_character_shrink_factor or 1
+ end
+ local font = getfont(current)
+ if lastfont ~= font then
+ local pf = parameters[font]
+ space = pf.space
+ stretch = pf.spacestretch
+ shrink = pf.spaceshrink
+ lastfont = font
+ end
+ return new_glue(
+ inter_character_space_factor * space,
+ inter_character_stretch_factor * stretch,
+ inter_character_shrink_factor * shrink
+ )
+ end
+
+ scripts.inserters = {
+
+ space_before = function(head,current)
+ return insertnodebefore(head,current,space_glue(current))
+ end,
+ space_after = function(head,current)
+ return insertnodeafter(head,current,space_glue(current))
+ end,
+
+ zerowidthspace_before = function(head,current)
+ return insertnodebefore(head,current,new_glue(0))
+ end,
+ zerowidthspace_after = function(head,current)
+ return insertnodeafter(head,current,new_glue(0))
+ end,
+
+ nobreakspace_before = function(head,current)
+ local g = space_glue(current)
+ local p = new_penalty(10000)
+ head, current = insertnodebefore(head,current,p)
+ return insertnodebefore(head,current,g)
+ end,
+ nobreakspace_after = function(head,current)
+ local g = space_glue(current)
+ local p = new_penalty(10000)
+ head, current = insertnodeafter(head,current,g)
+ return insertnodeafter(head,current,p)
+ end,
+
+ }
+
+end
+
+-- end of helpers
diff --git a/Master/texmf-dist/tex/context/base/mkxl/scrp-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/scrp-ini.mkxl
index 77412738b4d..99f064accff 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/scrp-ini.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/scrp-ini.mkxl
@@ -36,7 +36,7 @@
%D Todo: as in bidi mode we need a way to globally keep the setting.
-\registerctxluafile{scrp-ini}{}
+\registerctxluafile{scrp-ini}{autosuffix}
\registerctxluafile{scrp-cjk}{}
\registerctxluafile{scrp-eth}{}
\registerctxluafile{scrp-tha}{}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-ali.lmt b/Master/texmf-dist/tex/context/base/mkxl/spac-ali.lmt
index 5c434fcdf2a..9fa02467292 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/spac-ali.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/spac-ali.lmt
@@ -31,6 +31,7 @@ local nextlist = nuts.traversers.list
local new_stretch = nuts.pool.stretch
local a_realign = attributes.private("realign")
+local c_realpageno = tex.iscount("realpageno")
local texsetattribute = tex.setattribute
local texgetcount = tex.getcount
@@ -51,7 +52,7 @@ local nofrealigned = 0
-- raggedright 0 0 fil
-- raggedcenter 0 + 0 + -
-local function handler(head,leftpage,realpageno) -- traverse_list
+local function handler(head,leftpage,realpageno)
for current, id, subtype, list in nextlist, head do
if subtype == linelist_code then
local a = takeattr(current,a_realign)
@@ -103,7 +104,7 @@ local function handler(head,leftpage,realpageno) -- traverse_list
end
function alignments.handler(head)
- return handler(head,isleftpage(),texgetcount("realpageno"))
+ return handler(head,isleftpage(),texgetcount(c_realpageno))
end
local enabled = false
@@ -116,7 +117,7 @@ function alignments.set(n)
report_realign("enabled")
end
end
- texsetattribute(a_realign,texgetcount("realpageno") * 10 + n)
+ texsetattribute(a_realign,texgetcount(c_realpageno) * 10 + n)
end
interfaces.implement {
diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-ali.mkxl b/Master/texmf-dist/tex/context/base/mkxl/spac-ali.mkxl
index 78d09295db3..f5b0e2fb846 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/spac-ali.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/spac-ali.mkxl
@@ -19,7 +19,7 @@
%D variants. Starting at the last day of 2011 both methods are merged into one and
%D caching has been added, which makes switching twice as fast.
-\registerctxluafile{spac-ali}{autosuffix,optimize}
+\registerctxluafile{spac-ali}{autosuffix}
% Used once so ... replace it or use if more frequently ...
@@ -192,6 +192,9 @@
\permanent\protected\def\leftorrightvbox{\ifconditional\displaylefttoright\expandafter\lefttorightvbox\else\expandafter\righttoleftvbox\fi}
\permanent\protected\def\leftorrightvtop{\ifconditional\displaylefttoright\expandafter\lefttorightvtop\else\expandafter\righttoleftvtop\fi}
+\permanent\protected\def\rtltext{\groupedcommand{\dontleavehmode\righttoleft\ignorespaces}\removeunwantedspaces}
+\permanent\protected\def\ltrtext{\groupedcommand{\dontleavehmode\lefttoright\ignorespaces}\removeunwantedspaces}
+
% Tolerance and hyphenation
\ifdefined\lesshyphens \else \let\lesshyphens\relax \fi
@@ -294,8 +297,8 @@
\let\v_spac_align_space_amount \interwordspace
\def\v_spac_align_space_amount_x {.5\emwidth}
-\newskip\s_zero_plus_one_fil \s_zero_plus_one_fil = 0pt plus 1fil
-\newskip\s_zero_plus_zero \s_zero_plus_zero = 0pt plus 0pt
+\newgluespec\s_zero_plus_one_fil \s_zero_plus_one_fil = 0pt plus 1fil
+\newgluespec\s_zero_plus_zero \s_zero_plus_zero = 0pt plus 0pt
% \s!plus ... slower than inline
@@ -306,6 +309,8 @@
\rightskip \plusone\rightskip
\spaceskip \zeropoint
\xspaceskip \zeropoint
+ \parinitleftskip \zeropoint
+ \parinitrightskip \zeropoint
\parfillleftskip \zeropoint
\parfillskip \s_zero_plus_one_fil % new
\setfalse \raggedonelinerstate % now here
@@ -319,6 +324,8 @@
\rightskip \plusone\rightskip\s!plus\zeropoint
\spaceskip \v_spac_align_space_amount
\xspaceskip \v_spac_align_space_amount_x
+ \parinitleftskip \zeropoint
+ \parinitrightskip \zeropoint
\parfillleftskip \zeropoint
\parfillskip \s_zero_plus_zero
\parindent \zeropoint
@@ -332,6 +339,8 @@
\rightskip \plusone\rightskip\s!plus\spac_align_set_raggedness_middle
\spaceskip \v_spac_align_space_amount
\xspaceskip \v_spac_align_space_amount_x
+ \parinitleftskip \zeropoint
+ \parinitrightskip \zeropoint
\parfillleftskip \zeropoint
\parfillskip \s_zero_plus_zero
\parindent \zeropoint
@@ -345,6 +354,8 @@
\rightskip \plusone\rightskip\s!plus\spac_align_set_raggedness_right
\spaceskip \v_spac_align_space_amount
\xspaceskip \v_spac_align_space_amount_x
+ \parinitleftskip \zeropoint
+ \parinitrightskip \zeropoint
\parfillleftskip \zeropoint
\parfillskip \s_zero_plus_one_fil
%\parindent \parindent
@@ -357,6 +368,8 @@
\rightskip \plusone\rightskip\s!plus\zeropoint
\spaceskip \v_spac_align_space_amount
\xspaceskip \v_spac_align_space_amount_x
+ \parinitleftskip \zeropoint
+ \parinitrightskip \zeropoint
\parfillleftskip \zeropoint
\parfillskip \s_zero_plus_zero
\parindent \zeropoint
@@ -369,6 +382,8 @@
\rightskip \plusone\rightskip\s!plus\v_spac_align_fill_amount
\spaceskip \v_spac_align_space_amount
\xspaceskip \v_spac_align_space_amount_x
+ \parinitleftskip \zeropoint
+ \parinitrightskip \zeropoint
\parfillleftskip \zeropoint
\parfillskip \s_zero_plus_zero
\parindent \zeropoint
@@ -381,6 +396,8 @@
\rightskip \plusone\rightskip\s!plus\v_spac_align_fill_amount
\spaceskip \v_spac_align_space_amount
\xspaceskip \v_spac_align_space_amount_x
+ \parinitleftskip \zeropoint
+ \parinitrightskip \zeropoint
\parfillleftskip \zeropoint
\parfillskip \s_zero_plus_zero
%\parindent \parindent
@@ -394,6 +411,8 @@
\rightskip \plusone\rightskip\s!plus\v_spac_align_fill_amount_half
\spaceskip \v_spac_align_space_amount
\xspaceskip \v_spac_align_space_amount_x
+ \parinitleftskip \zeropoint
+ \parinitrightskip \zeropoint
\parfillleftskip \zeropoint
\parfillskip \s_zero_plus_zero
\parindent \zeropoint
@@ -404,8 +423,10 @@
\c_attr_alignstate\attributeunsetvalue
\leftskip \plusone\leftskip \s!plus\v_spac_align_fill_amount\relax
\rightskip \plusone\rightskip\s!plus\v_spac_align_fill_amount_negative\relax
- \spaceskip \zeropoint\relax
- \xspaceskip \zeropoint\relax
+ \spaceskip \zeropoint
+ \xspaceskip \zeropoint
+ \parinitleftskip \zeropoint
+ \parinitrightskip \zeropoint
\parfillleftskip \zeropoint
\parfillskip \zeropoint\s!plus\v_spac_align_fill_amount_double\relax
\parindent \zeropoint
@@ -416,8 +437,10 @@
\c_attr_alignstate\attributeunsetvalue
\leftskip \plusone\leftskip \s!plus\v_spac_align_fill_amount\relax
\rightskip \plusone\rightskip\s!plus\v_spac_align_fill_amount_negative\relax
- \spaceskip \zeropoint\relax
- \xspaceskip \zeropoint\relax
+ \spaceskip \zeropoint
+ \xspaceskip \zeropoint
+ \parinitleftskip \zeropoint
+ \parinitrightskip \zeropoint
\parfillskip \zeropoint
\parfillleftskip \zeropoint\s!plus\v_spac_align_fill_amount_extreme\relax
\parindent \zeropoint
@@ -429,13 +452,30 @@
\c_attr_alignstate\plusthree
\leftskip \plusone\leftskip \s!plus\zeropoint\relax
\rightskip \plusone\rightskip\s!plus\spac_align_set_raggedness_right\relax
- \spaceskip \zeropoint\relax
- \xspaceskip \zeropoint\relax
+ \spaceskip \zeropoint
+ \xspaceskip \zeropoint
+ \parinitleftskip \zeropoint
+ \parinitrightskip \zeropoint
\parfillleftskip \zeropoint
\parfillskip \s_zero_plus_zero
%\parindent \parindent
\relax}
+\permanent\protected\def\spac_align_set_horizontal_slanted
+ {\raggedstatus \zerocount
+ %\c_attr_alignstate\attributeunsetvalue
+ \c_attr_alignstate\plustwo
+ \leftskip \plusone\leftskip \s!plus\spac_align_set_raggedness_middle
+ \rightskip \plusone\rightskip\s!plus\spac_align_set_raggedness_middle
+ \spaceskip \zeropoint
+ \xspaceskip \zeropoint
+ \parinitleftskip \zeropoint
+ \parinitrightskip \zeropoint\s!plus\v_spac_align_fill_amount_extreme\relax
+ \parfillleftskip \zeropoint\s!plus\v_spac_align_fill_amount_extreme\relax
+ \parfillskip \zeropoint
+ \parindent \zeropoint
+ \relax}
+
\permanent\protected\def\spac_align_set_horizontal_extra
{\xspaceskip\zeropoint\s!plus\v_spac_align_fill_amount_space\relax}
@@ -495,6 +535,9 @@
\or
% 9 paragraph
\parfillskip\zeropoint
+ \or
+ % 10 slanted
+ \spac_align_set_horizontal_slanted
\fi
\relax}
@@ -567,28 +610,58 @@
\c_spac_align_state_direction \zerocount % what is default ?
\c_spac_align_state_page \zerocount
\c_spac_align_state_par_fill \zerocount
- \ifcsname\??aligncommand\m_spac_align_asked\endcsname
+ \ifcsname\??aligncommand\m_spac_align_named\endcsname
\lastnamedcs
\else
\rawprocesscommacommand[\m_spac_align_asked]\spac_align_collect
\fi
- \normalexpanded{\t_spac_align_collected
- {\setfalse\raggedonelinerstate % bad
- \the\t_spac_align_collected
- \spac_align_flush_horizontal
- \spac_align_flush_vertical
- \spac_align_flush_direction
- \spac_align_flush_page
- \spac_align_flush_parfill
- }}% kept, nice for tracing
+ % % kept, nice for tracing
+ %
+ % \normalexpanded{\t_spac_align_collected
+ % {\setfalse\raggedonelinerstate % bad
+ % \the\t_spac_align_collected
+ % \spac_align_flush_horizontal
+ % \spac_align_flush_vertical
+ % \spac_align_flush_direction
+ % \spac_align_flush_page
+ % \spac_align_flush_parfill
+ % }}%
+ %
+ % \etoksapp\t_spac_align_collected
+ % {\spac_align_flush_horizontal
+ % \spac_align_flush_vertical
+ % \spac_align_flush_direction
+ % \spac_align_flush_page
+ % \spac_align_flush_parfill}%
+ % \etokspre\t_spac_align_collected
+ % {\setfalse\raggedonelinerstate}% bad
+ %
+ \etoks\t_spac_align_collected
+ {\setfalse\raggedonelinerstate % bad
+ \the\t_spac_align_collected
+ \spac_align_flush_horizontal
+ \spac_align_flush_vertical
+ \spac_align_flush_direction
+ \spac_align_flush_page
+ \spac_align_flush_parfill}%
+ %
\enforced\permanent\protected\edef\raggedcommand {\the\t_spac_align_collected }%
\enforced\permanent\protected\edef\updateraggedskips{\spac_align_flush_horizontal}%
- \enforced\aliased\gletcsname\??alignmentnormalcache\m_spac_align_asked\endcsname\raggedcommand
- \enforced\aliased\gletcsname\??alignmentraggedcache\m_spac_align_asked\endcsname\updateraggedskips}
+ \enforced\aliased\gletcsname\??alignmentnormalcache\m_spac_align_named\endcsname\raggedcommand
+ \enforced\aliased\gletcsname\??alignmentraggedcache\m_spac_align_named\endcsname\updateraggedskips}
+
+\mutable\def\m_spac_align_named{\m_spac_align_asked}
\def\spac_align_collect#1%
{\csname\??aligncommand#1\endcsname}
+\permanent\protected\tolerant\def\definealign[#1]#*[#2]%
+ {\pushmacro\m_spac_align_named
+ \edef\m_spac_align_named{#1}%
+ \edef\m_spac_align_asked{#2}%
+ \spac_align_add_to_cache
+ \popmacro\m_spac_align_named}
+
% The local (key driven) setter:
\permanent\protected\def\spac_align_prepare#1% deferred
@@ -652,7 +725,7 @@
% Maybe we need something different in columns.
\permanent\protected\def\installalign#1#2% beware: commands must be unexpandable!
- {\ifcsname\??aligncommand#1\endcsname \else
+ {\ifcsname\??aligncommand#1\endcsname \else % : so maybe we should use \etoksapp
\defcsname\??aligncommand#1\endcsname{\toksapp\t_spac_align_collected{#2}}%
\fi}
@@ -699,6 +772,11 @@
\defcsname\??aligncommand l2r\endcsname{\c_spac_align_state_direction \plusone }
\defcsname\??aligncommand r2l\endcsname{\c_spac_align_state_direction \plustwo }
+
+\defcsname\??aligncommand\v!slanted \endcsname{\c_spac_align_state_horizontal\plusten
+ \c_spac_align_state_broad \plustwo }
+
+
\defcsname\??aligncommand\v!table \endcsname{\c_spac_align_state_vertical \plusthree
\c_spac_align_state_broad \plusone
\c_spac_align_state_horizontal\plustwo }
@@ -716,30 +794,42 @@
%defcsname\??aligncommand\v!nospacing \endcsname{\toksapp\t_spac_align_collected{\normalspacing\plusone}} % not yet
\defcsname\??aligncommand\v!hyphenated \endcsname{\toksapp\t_spac_align_collected{\dohyphens}}
\defcsname\??aligncommand\v!nothyphenated \endcsname{\toksapp\t_spac_align_collected{\nohyphens}}
+\defcsname\??aligncommand\v!collapsed \endcsname{\toksapp\t_spac_align_collected{\dohyphencollapsing}}
+\defcsname\??aligncommand\v!notcollapsed \endcsname{\toksapp\t_spac_align_collected{\nohyphencollapsing}}
+\defcsname\??aligncommand\v!explicit \endcsname{\toksapp\t_spac_align_collected{\nohyphens\doexplicithyphens}}
\defcsname\??aligncommand\v!tolerant \endcsname{\toksapp\t_spac_align_collected{\spac_align_set_tolerant}}
\defcsname\??aligncommand\v!verytolerant \endcsname{\toksapp\t_spac_align_collected{\spac_align_set_very_tolerant}}
\defcsname\??aligncommand\v!stretch \endcsname{\toksapp\t_spac_align_collected{\spac_align_set_stretch}}
\defcsname\??aligncommand\v!extremestretch \endcsname{\toksapp\t_spac_align_collected{\spac_align_set_extreme_stretch}}
-\defcsname\??aligncommand \v!final\endcsname{\c_spac_align_state_par_fill\plusone}
-\defcsname\??aligncommand1*\v!final\endcsname{\c_spac_align_state_par_fill\plusone}
-\defcsname\??aligncommand2*\v!final\endcsname{\c_spac_align_state_par_fill\plustwo} % hardcoded multiplier
-\defcsname\??aligncommand3*\v!final\endcsname{\c_spac_align_state_par_fill\plusthree}
-\defcsname\??aligncommand4*\v!final\endcsname{\c_spac_align_state_par_fill\plusfour}
+\defcsname\??aligncommand \v!final\endcsname{\c_spac_align_state_par_fill\plusone}
+\defcsname\??aligncommand 1*\v!final\endcsname{\c_spac_align_state_par_fill\plusone}
+\defcsname\??aligncommand 2*\v!final\endcsname{\c_spac_align_state_par_fill\plustwo} % hardcoded multiplier
+\defcsname\??aligncommand 3*\v!final\endcsname{\c_spac_align_state_par_fill\plusthree}
+\defcsname\??aligncommand 4*\v!final\endcsname{\c_spac_align_state_par_fill\plusfour}
% a one shot (only usefull in e.g. framed, also needs tolerance and stretch)
-\defcsname\??aligncommand \v!more\endcsname{\toksapp\t_spac_align_collected{\looseness\plusone}}
-\defcsname\??aligncommand1*\v!more\endcsname{\toksapp\t_spac_align_collected{\looseness\plusone}}
-\defcsname\??aligncommand2*\v!more\endcsname{\toksapp\t_spac_align_collected{\looseness\plustwo}}
+\defcsname\??aligncommand \v!more\endcsname{\toksapp\t_spac_align_collected{\looseness\plusone}}
+\defcsname\??aligncommand 1*\v!more\endcsname{\toksapp\t_spac_align_collected{\looseness\plusone}}
+\defcsname\??aligncommand 2*\v!more\endcsname{\toksapp\t_spac_align_collected{\looseness\plustwo}}
%defcsname\??aligncommand ...\endcsname{\toksapp\t_spac_align_collected{\nopenalties}}
%defcsname\??aligncommand ...\endcsname{\toksapp\t_spac_align_collected{\setdefaultpenalties}}
% experiment
-\defcsname\??aligncommand\v!always\endcsname{\toksapp\t_spac_align_collected{\bitwiseflip\hyphenationmode\forcecheckhyphenationmodecode}}
+\defcsname\??aligncommand \v!flushforward\endcsname{\c_spac_align_state_horizontal\ifconditional\inlinelefttoright\plustwo\else\plusthree\fi}
+\defcsname\??aligncommand\v!flushbackward\endcsname{\c_spac_align_state_horizontal\ifconditional\inlinelefttoright\plusthree\else\plustwo\fi}
+
+% experiment
+
+\defcsname\??aligncommand\v!always\endcsname{\toksapp\t_spac_align_collected{\bitwiseflip\hyphenationmode\forcecheckhyphenationcode}}
+
+% experiment
+
+\defcsname\??aligncommand\v!profile\endcsname{\toksapp\t_spac_align_collected{\setmainlineprofile}}
\definehspace [\v!final] [\emspaceamount]
@@ -782,6 +872,7 @@
\aliased\let\flushedrightlastline\spac_align_set_horizontal_flushedright_last_line
\aliased\let\ttraggedright \spac_align_set_horizontal_right_tt % a plain command
\aliased\let\forgetragged \spac_align_set_horizontal_none
+\aliased\let\raggedslanted \spac_align_set_horizontal_slanted
\appendtoks
\spac_align_set_horizontal_none
@@ -865,7 +956,7 @@
\defcsname\??alignhorizontal\v!flushright\endcsname{\enforced\let\raggedbox\spac_align_horizontal_flushright}
\defcsname\??alignhorizontal\v!center \endcsname{\enforced\let\raggedbox\spac_align_horizontal_center}
-% The next one can be in use so we keep it around but oen should
+% The next one can be in use so we keep it around but one should
% be aware of possible interference.
\permanent\protected\def\setraggedskips#1#2#3#4#5#6#7% never change this name (todo: inline this one .. less tracingall)
@@ -1073,6 +1164,28 @@
{\normalexpanded{\spac_word_right_indeed{#1}{\hpack{\thebox\nextbox}}}}
\hbox}
+% \protected\def\spac_word_right_indeed#1#2%
+% {\registerparwrapper
+% {\v!word:\v!right}
+% {\begingroup
+% \frozen\parfillskip \zeropoint
+% \frozen\finalhyphendemerits\zerocount
+% \endgroup}
+% {\doifelseparwrapper{\v!word:\v!right}%
+% {\doifelse{#1}\v!right{\kern-\rightskip}{\doifsomething{#1}{\kern-#1}}%
+% \strut \removeunwantedspaces
+% \hfill
+% \allowbreak % changed back from \hskip\zeropoint
+% \quad}%
+% {\allowbreak % changed back from \hskip\zeropoint
+% \break}%
+% \unregisterparwrapper{\v!word:\v!right}%
+% \strut
+% \hfill
+% \nobreak
+% #2%
+% \allowbreak}}
+
\protected\def\spac_word_right_indeed#1#2%
{\registerparwrapper
{\v!word:\v!right}
@@ -1080,20 +1193,14 @@
\frozen\parfillskip \zeropoint
\frozen\finalhyphendemerits\zerocount
\endgroup}
- {\doifelseparwrapper{\v!word:\v!right}%
- {\doifelse{#1}\v!right{\kern-\rightskip}{\doifsomething{#1}{\kern-#1}}%
- \strut \removeunwantedspaces
- \hfill
- \allowbreak % changed back from \hskip\zeropoint
- \quad}%
- {\allowbreak % changed back from \hskip\zeropoint
- \break}%
- \unregisterparwrapper{\v!word:\v!right}%
- \strut
- \hfill
- \nobreak
- #2%
- \allowbreak}}
+ {\doifelseparwrapper{\v!word:\v!right}{\unregisterparwrapper{\v!word:\v!right}}\donothing
+ \removeunwantedspaces
+ \doifelse{#1}\v!right{\kern-\rightskip}{\doifsomething{#1}{\kern-#1}}%
+ \hfilll
+ \discretionary{\strut}{\strut}{\strut}% \allowbreak % changed back from \hskip\zeropoint
+ \hfilll
+ \quad % decent spacing
+ #2}}
% \dorecurse{5}{something} \wordright{--someone} \endgraf
% \dorecurse{6}{something} \wordright{--someone} \endgraf
@@ -1150,6 +1257,9 @@
\letcsname\??alignsimplereverse\v!flushright\endcsname\spac_align_simple_left
\letcsname\??alignsimplereverse\v!middle \endcsname\spac_align_simple_middle
+\protected\def\spac_align_simple#1%
+ {\begincsname\??alignsimple#1\endcsname}
+
\permanent\protected\def\simplealignedbox#1#2%
{\hbox \ifdim#1>\zeropoint to #1
\ifcsname\??alignsimple#2\endcsname
diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-chr.lmt b/Master/texmf-dist/tex/context/base/mkxl/spac-chr.lmt
index ac90926e1ab..58071c431b8 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/spac-chr.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/spac-chr.lmt
@@ -28,6 +28,9 @@ local nodes, node = nodes, node
local nuts = nodes.nuts
+local getid = nuts.getid
+local getsubtype = nuts.getsubtype
+local setsubtype = nuts.setsubtype
local getboth = nuts.getboth
local getnext = nuts.getnext
local getprev = nuts.getprev
@@ -37,16 +40,13 @@ local getlanguage = nuts.getlanguage
local setchar = nuts.setchar
local setattrlist = nuts.setattrlist
local getfont = nuts.getfont
-local setsubtype = nuts.setsubtype
local isglyph = nuts.isglyph
local setcolor = nodes.tracers.colors.set
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local remove_node = nuts.remove
------ traverse_id = nuts.traverse_id
------ traverse_char = nuts.traverse_char
local nextchar = nuts.traversers.char
local nextglyph = nuts.traversers.glyph
@@ -62,10 +62,12 @@ local nodecodes = nodes.nodecodes
local gluecodes = nodes.gluecodes
local glyph_code = nodecodes.glyph
+local glue_code = nodecodes.glue
local spaceskip_code = gluecodes.spaceskip
local chardata = characters.data
-local is_punctuation = characters.is_punctuation
+local ispunctuation = characters.is_punctuation
+local canhavespace = characters.can_have_space
local typesetters = typesetters
@@ -95,7 +97,7 @@ local function inject_quad_space(unicode,head,current,fraction)
setattrlist(glue,current)
setattrlist(current) -- why reset all
setattr(glue,a_character,unicode)
- return insert_node_after(head,current,glue)
+ return insertnodeafter(head,current,glue)
end
local function inject_char_space(unicode,head,current,parent)
@@ -105,32 +107,33 @@ local function inject_char_space(unicode,head,current,parent)
setattrlist(glue,current)
setattrlist(current) -- why reset all
setattr(glue,a_character,unicode)
- return insert_node_after(head,current,glue)
+ return insertnodeafter(head,current,glue)
end
local function inject_nobreak_space(unicode,head,current,space,spacestretch,spaceshrink)
local glue = new_glue(space,spacestretch,spaceshrink)
local penalty = new_penalty(10000)
setattrlist(glue,current)
+ setattrlist(penalty,current)
setattrlist(current) -- why reset all
setattr(glue,a_character,unicode) -- bombs
- head, current = insert_node_after(head,current,penalty)
+ head, current = insertnodeafter(head,current,penalty)
if trace_nbsp then
local rule = new_rule(space)
local kern = new_kern(-space)
local penalty = new_penalty(10000)
setcolor(rule,"orange")
- head, current = insert_node_after(head,current,rule)
- head, current = insert_node_after(head,current,kern)
- head, current = insert_node_after(head,current,penalty)
+ head, current = insertnodeafter(head,current,rule)
+ head, current = insertnodeafter(head,current,kern)
+ head, current = insertnodeafter(head,current,penalty)
end
- return insert_node_after(head,current,glue)
+ return insertnodeafter(head,current,glue)
end
local function nbsp(head,current)
local para = fontparameters[getfont(current)]
local attr = getattr(current,a_alignstate) or 0
- if attr >= 1 or attr <= 3 then -- flushright
+ if attr >= 1 and attr <= 3 then -- flushright
head, current = inject_nobreak_space(0x00A0,head,current,para.space,0,0)
else
head, current = inject_nobreak_space(0x00A0,head,current,para.space,para.spacestretch,para.spaceshrink)
@@ -147,8 +150,9 @@ function characters.replacenbsp(head,original)
end
function characters.replacenbspaces(head)
+ -- todo: wiping as in characters.handler(head)
local wipe = false
- for current, char, font in nextglyph, head do -- can be anytime so no traverse_char
+ for current, char, font in nextglyph, head do -- can be anytime so no traversechar
if char == 0x00A0 then
if wipe then
head = remove_node(h,current,true)
@@ -184,18 +188,41 @@ local methods = {
-- maybe also 0x0008 : backspace
+ -- Watch out: a return value means "remove"!
+
+ [0x001E] = function(head,current) -- kind of special
+ local next = getnext(current)
+ if next and getid(next) == glue_code and getsubtype(next) == spaceskip_code then
+ -- remove when no valid character following
+ local nextnext = getnext(next)
+ if nextnext then
+ local char, font = isglyph(nextnext)
+ if char and not canhavespace[char] then
+ remove_node(head,next,true)
+ end
+ end
+ else
+ -- insert when valid character following
+ local char, font = isglyph(next)
+ if char and canhavespace[char] then
+ local p = fontparameters[font]
+ head, current = insertnodebefore(head,current,new_glue(p.space,p.spacestretch,p.spaceshrink))
+ end
+
+ end
+ return head, current
+ end,
+
[0x001F] = function(head,current) -- kind of special
local next = getnext(current)
if next then
local char, font = isglyph(next)
- if char then
- head, current = remove_node(head,current,true)
- if not is_punctuation[char] then
- local p = fontparameters[font]
- head, current = insert_node_before(head,current,new_glue(p.space,p.space_stretch,p.space_shrink))
- end
+ if char and not ispunctuation[char] then
+ local p = fontparameters[font]
+ head, current = insertnodebefore(head,current,new_glue(p.space,p.spacestretch,p.spaceshrink))
end
end
+ return head, current
end,
[0x00A0] = function(head,current) -- nbsp
@@ -226,7 +253,7 @@ local methods = {
end,
[0x00AD] = function(head,current) -- softhyphen
- return insert_node_after(head,current,languages.explicithyphen(current))
+ return insertnodeafter(head,current,languages.explicithyphen(current))
end,
[0x2000] = function(head,current) -- enquad
@@ -295,34 +322,6 @@ local methods = {
characters.methods = methods
--- function characters.handler(head) -- todo: use traverse_id
--- local current = head
--- while current do
--- local char, id = isglyph(current)
--- if char then
--- local next = getnext(current)
--- local method = methods[char]
--- if method then
--- if trace_characters then
--- report_characters("replacing character %C, description %a",char,lower(chardata[char].description))
--- end
--- local h = method(head,current)
--- if h then
--- head = remove_node(h,current,true)
--- end
--- end
--- current = next
--- else
--- current = getnext(current)
--- end
--- end
--- return head
--- end
-
--- this also works ok in math as we run over glyphs and these stay glyphs ... not sure
--- about scripts and such but that is not important anyway ... some day we can consider
--- special definitions in math
-
function characters.handler(head)
local wipe = false
for current, char in nextchar, head do
@@ -346,3 +345,30 @@ function characters.handler(head)
end
return head
end
+
+-- function characters.handler(head)
+-- local wiped = false
+-- for current, char in nextchar, head do
+-- local method = methods[char]
+-- if method then
+-- if wiped then
+-- wiped[#wiped+1] = current
+-- else
+-- wiped = { current }
+-- end
+-- if trace_characters then
+-- report_characters("replacing character %C, description %a",char,lower(chardata[char].description))
+-- end
+-- local h = method(head,current)
+-- if h then
+-- head = h
+-- end
+-- end
+-- end
+-- if wiped then
+-- for i=1,#wiped do
+-- head = remove_node(head,wiped[i],true)
+-- end
+-- end
+-- return head
+-- end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-chr.mkxl b/Master/texmf-dist/tex/context/base/mkxl/spac-chr.mkxl
index 82c8be0ec34..ef63b2b8204 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/spac-chr.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/spac-chr.mkxl
@@ -15,7 +15,7 @@
\unprotect
-\registerctxluafile{spac-chr}{autosuffix,optimize}
+\registerctxluafile{spac-chr}{autosuffix}
\definesystemattribute[characters][public]
@@ -66,13 +66,18 @@
\popoverloadmode
-\immutable\chardef\optionalspace"1F % will be space unless before punctuation
+\immutable\chardef\optionalspace "1F % will be space unless before punctuation
+\immutable\chardef\autoinsertedspace"1E % a more clever \autoinsertspace
% Shortcuts:
% unexpanded as otherwise we need to intercept / cleanup a lot
+\pushoverloadmode
+
\protected\def~{\nobreakspace}
+\popoverloadmode
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-def.mkxl b/Master/texmf-dist/tex/context/base/mkxl/spac-def.mkxl
index 294843cce71..729968c5de1 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/spac-def.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/spac-def.mkxl
@@ -56,12 +56,13 @@
\setupinterlinespace
[\c!minheight=\zeropoint, % only special purpose
- \c!mindepth=\zeropoint, % only special purpose
+ \c!mindepth=\zeropoint, % only special purpose
\c!height=.72,
\c!depth=.28,
\c!top=1.0,
+ \c!ntop=\minusone, % >= 0 : times lineheight
\c!bottom=0.4,
- \c!distance=\onepoint, % \dimexpr\openlineheight/10\relax
+ \c!distance=\onepoint, % \dimexpr\openlineheight/10\relax
\c!line=2.8\exheight,
\c!stretch=\zerocount,
\c!shrink=\zerocount]
diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-flr.mkxl b/Master/texmf-dist/tex/context/base/mkxl/spac-flr.mkxl
index 3ea90bc2c15..e6147facd90 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/spac-flr.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/spac-flr.mkxl
@@ -82,10 +82,10 @@
\endgroup
\ignorespaces}
-\setvalue{\??filleralternative\s!unknown}%
+\defcsname\??filleralternative\s!unknown\endcsname
{}
-\setvalue{\??filleralternative\v!symbol}%
+\defcsname\??filleralternative\v!symbol\endcsname
{\expandnamespaceparameter\??fillerleadermethod\fillerparameter\c!method\v!local
\ifdim\fillerparameter\c!offset>\zeropoint
\simplealignedspreadbox
@@ -100,23 +100,23 @@
\fi
\hfill}
-\setvalue{\??filleralternative\v!stretch}%
+\defcsname\??filleralternative\v!stretch\endcsname
{\hfill}
-\setvalue{\??filleralternative\v!space}%
+\defcsname\??filleralternative\v!space\endcsname
{\hskip\fillerparameter\c!distance\relax}
-\setvalue{\??filleralternative\v!rule}%
+\defcsname\??filleralternative\v!rule\endcsname
{\expandnamespaceparameter\??fillerleadermethod\fillerparameter\c!method\v!local
\hrule
\s!height\fillerparameter\c!height
\s!depth \fillerparameter\c!depth
\hfill}
-\letvalue{\??fillerleadermethod\s!local }\normalleaders % overflow ends up inbetween (current box)
-\letvalue{\??fillerleadermethod\v!global}\normalgleaders % overflow ends up inbetween (outermost box)
-\letvalue{\??fillerleadermethod\v!middle}\normalcleaders % overflow ends up before, after (current box)
-\letvalue{\??fillerleadermethod\v!broad }\normalxleaders % overflow ends up before, inbetween, after (current box)
+\letcsname\??fillerleadermethod\s!local \endcsname\normalleaders % overflow ends up inbetween (current box)
+\letcsname\??fillerleadermethod\v!global\endcsname\normalgleaders % overflow ends up inbetween (outermost box)
+\letcsname\??fillerleadermethod\v!middle\endcsname\normalcleaders % overflow ends up before, after (current box)
+\letcsname\??fillerleadermethod\v!broad \endcsname\normalxleaders % overflow ends up before, inbetween, after (current box)
\setupfillers
[\c!width=\emwidth,
diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-grd.mkxl b/Master/texmf-dist/tex/context/base/mkxl/spac-grd.mkxl
index 65739cabea7..33bf0c706d7 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/spac-grd.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/spac-grd.mkxl
@@ -101,11 +101,11 @@
% \definecolor[GridLineColor][red]
% \definecolor[GridTextColor][blue]
-\newdimen\d_spac_lines_correction_before
-\newdimen\d_spac_lines_correction_after
+\newdimension\d_spac_lines_correction_before
+\newdimension\d_spac_lines_correction_after
-\newbox \b_spac_lines_correction_before
-\newbox \b_spac_lines_correction_after
+\newbox \b_spac_lines_correction_before
+\newbox \b_spac_lines_correction_after
\def\spac_lines_initialize_corrections
{\setbox\b_spac_lines_correction_before\hpack{\setstrut\strut}%
@@ -176,7 +176,7 @@
{\ifdim\pagegoal<\maxdimen
\ifdim\pagetotal>\lineheight % or \topskip
\scratchdimen\pagetotal
- \advance\scratchdimen\lineheight
+ \advanceby\scratchdimen\lineheight
\ifdim\scratchdimen<\pagegoal
\baselinecorrection
\fi
diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-hor.lmt b/Master/texmf-dist/tex/context/base/mkxl/spac-hor.lmt
index 7db8d4d6f3f..a4a8f0ade52 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/spac-hor.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/spac-hor.lmt
@@ -10,24 +10,14 @@ local chardata = characters.data
local peekchar = tokens.scanners.peekchar
local ctx_space = context.space
-local can_have_space = table.tohash {
- "lu", "ll", "lt", "lm", "lo", -- letters
- -- "mn", "mc", "me", -- marks
- "nd", "nl", "no", -- numbers
- "ps", "pi", -- initial
- -- "pe", "pf", -- final
- -- "pc", "pd", "po", -- punctuation
- "sm", "sc", "sk", "so", -- symbols
- -- "zs", "zl", "zp", -- separators
- -- "cc", "cf", "cs", "co", "cn", -- others
-}
+local can_have_space = characters.can_have_space
interfaces.implement {
name = "autoinsertnextspace",
protected = true,
public = true,
actions = function()
- local char = peekchar()
+ local char = peekchar() -- nil means space command
if char then
local d = chardata[char]
if d and can_have_space[d.category] then
@@ -36,3 +26,35 @@ interfaces.implement {
end
end,
}
+
+local nuts = nodes.nuts
+local tonut = nodes.tonut
+local traverseglue = nuts.traversers.glue
+local setwidth = nodes.nuts.setwidth
+local indentskip_code = nodes.gluecodes.indentskip
+local texgetnest = tex.getnest
+
+local function lateindent(amount)
+ local head = tonut(texgetnest("top","head"))
+ if head then
+ for n, s in traverseglue, head do
+ if s == indentskip_code then
+ setwidth(n,amount or 0)
+ end
+ end
+ end
+end
+
+interfaces.implement {
+ name = "lateindent",
+ public = true,
+ protected = "true",
+ arguments = "dimension",
+ actions = lateindent,
+}
+interfaces.implement {
+ name = "lateundent",
+ public = true,
+ protected = "true",
+ actions = lateindent,
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-hor.mkxl b/Master/texmf-dist/tex/context/base/mkxl/spac-hor.mkxl
index f64207a2cb5..3c4fd1eb466 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/spac-hor.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/spac-hor.mkxl
@@ -13,20 +13,28 @@
\writestatus{loading}{ConTeXt Spacing Macros / Horizontal}
+% document: \enabledirectives[backends.spaces]
+
\unprotect
\registerctxluafile{spac-hor}{autosuffix}
\aliased\let\parfillrightskip\parfillskip
-\bitwiseflip \normalizelinemode \parindentskipcode
-\bitwiseflip \normalizelinemode \normalizelinecode
-\bitwiseflip \normalizelinemode \clipwidthcode
+\bitwiseflip \normalizelinemode \normalizelinenormalizecode
+\bitwiseflip \normalizelinemode \parindentskipnormalizecode
+\bitwiseflip \normalizelinemode \clipwidthnormalizecode
+\bitwiseflip \normalizelinemode \flattendiscretionariesnormalizecode
+\bitwiseflip \normalizelinemode \flattenhleadersnormalizecode
+%bitwiseflip \normalizelinemode \discardzerotabskipsnormalizecode
+
+\bitwiseflip \normalizeparmode \normalizeparnormalizeparcode
+\bitwiseflip \normalizeparmode \flattenvleadersnormalizeparcode
-\let\v_spac_indentation_current\empty % amount/keyword
+\lettonothing\v_spac_indentation_current % amount/keyword
-\newdimen \d_spac_indentation_par
-\parindent\d_spac_indentation_par % for the show
+\newdimension\d_spac_indentation_par
+\parindent \d_spac_indentation_par % for the show
\newconditional\c_spac_indentation_indent_first \settrue\c_spac_indentation_indent_first
\newconstant \c_spac_indentation_toggle_state
@@ -48,7 +56,7 @@
\aliased\let\synchronizeindenting\spac_indentation_setup_size
-\let\m_spac_indentation_options\empty
+\lettonothing\m_spac_indentation_options
\def\spac_indentation_setup_options[#1]%
{\edef\m_spac_indentation_options{#1}% comma separated list
@@ -91,7 +99,7 @@
\installcorenamespace {indentingpreset}
\permanent\tolerant\protected\def\defineindenting[#1]#*[#2]% todo: mixes
- {\ifarguments\else\setevalue{\??indentingpreset#1}{#2}\fi}
+ {\ifarguments\else\edefcsname\??indentingpreset#1\endcsname{#2}\fi}
\def\spac_indentation_apply_step_one_nested
{\expandafter\processcommacommand\expandafter[\lastnamedcs]\spac_indentation_apply_step_one}
@@ -377,7 +385,7 @@
\permanent\protected\def\newfrenchspacing{\spac_spacecodes_set_fixed{1050}}
\permanent\protected\def\nonfrenchspacing{\spac_spacecodes_set_stretch}
-\permanent\protected\def\installspacingmethod#1#2{\setvalue{\??spacecodemethod#1}{#2}}
+\permanent\protected\def\installspacingmethod#1#2{\defcsname\??spacecodemethod#1\endcsname{#2}}
\installspacingmethod \empty {} % keep values
\installspacingmethod \v!fixed {\frenchspacing } % equal spaces everywhere
@@ -390,6 +398,22 @@
\fi
\updateraggedskips}
+% test test\fsp. test % beats frenchspacing
+
+% \permanent\protected\def\fsp#1% fixed space puncuation
+% {\begingroup
+% \ifchknum`#1\or
+% \sfcode`#1\plusthousand
+% \fi
+% #1%
+% \endgroup}
+
+\permanent\protected\def\fsp#1% fixed space puncuation
+ {#1%
+ \ifchknum`#1\or
+ \spacefactor\plusthousand
+ \fi}
+
%D Here's a tweak .. if needed one can configure it in the configuration
%D so that initialization happens more efficient.
%D
@@ -517,23 +541,49 @@
\permanent\protected\def\fixedspaces
{\letcatcodecommand \ctxcatcodes \tildeasciicode\fixedspace
- \enforced\let~\fixedspace} % we need to renew it
+ %\enforced\let~\fixedspace} % we need to renew it
+ \enforced\letcharcode\tildeasciicode\fixedspace} % why this
\appendtoks
- \enforced\let~\space
+ %\enforced\let~\space
+ \enforced\letcharcode\tildeasciicode\space
\enforced\let\ \space
\to \everysimplifycommands
-\newsignal\d_spac_keep_unwanted_space_signal
+% \newsignal\d_spac_keep_unwanted_space_signal
+%
+% % \parindentmode\plusone
+%
+% \permanent\protected\def\keepunwantedspaces
+% {\ifhmode
+% \ifdim\lastskip=\d_spac_keep_unwanted_space_signal\else
+% \hskip\d_spac_keep_unwanted_space_signal\relax
+% \fi
+% \fi}
+%
+% \permanent\protected\def\removeunwantedspaces
+% {\ifhmode
+% \expandafter \spac_helpers_remove_unwantedspace
+% \fi}
+%
+% \def\spac_helpers_remove_unwantedspace
+% {\ifnum\lastnodetype=\gluenodecode\relax
+% \ifnum\lastnodesubtype=\indentskipsubtypecode\relax
+% % keep parindent
+% \orelse\ifdim\lastskip=\d_spac_keep_unwanted_space_signal\relax
+% \unskip
+% \else
+% \unskip
+% \doubleexpandafter\spac_helpers_remove_unwantedspace
+% \fi
+% \fi}
-% \parindentmode\plusone
+\newboundary\c_spac_keepspaces_boundary
\permanent\protected\def\keepunwantedspaces
- {\ifhmode
- \ifdim\lastskip=\d_spac_keep_unwanted_space_signal\else
- \hskip\d_spac_keep_unwanted_space_signal\relax
- \fi
- \fi}
+ {\ifhmode\ifnum\lastboundary=\c_spac_keepspaces_boundary\else
+ \boundary\c_spac_keepspaces_boundary
+ \fi\fi}
\permanent\protected\def\removeunwantedspaces
{\ifhmode
@@ -541,15 +591,15 @@
\fi}
\def\spac_helpers_remove_unwantedspace
- {\ifnum\lastnodetype=\gluenodecode\relax
- \ifnum\lastnodesubtype=\indentskipsubtypecode\relax
- % keep parindent
- \orelse\ifdim\lastskip=\d_spac_keep_unwanted_space_signal\relax
- \unskip
- \else
- \unskip
- \doubleexpandafter\spac_helpers_remove_unwantedspace
- \fi
+ {\ifnum\lastboundary=\c_spac_keepspaces_boundary
+ \expandafter\unboundary
+ \orunless\ifnum\lastnodetype=\gluenodecode
+ % no skip
+ \orelse\ifnum\lastnodesubtype=\indentskipsubtypecode
+ % keep parindent
+ \else
+ \unskip
+ \expandafter\spac_helpers_remove_unwantedspace
\fi}
\permanent\protected\def\onlynonbreakablespace
@@ -584,6 +634,8 @@
%D A couple of plain macros:
\ifdefined\enspace \else \permanent\protected\def\enspace{\kern .5\emwidth} \fi
+\ifdefined\emspace \else \permanent\protected\def\emspace{\kern \emwidth} \fi
+
\ifdefined\quad \else \permanent\protected\def\quad {\hskip \emwidth\relax} \fi
\ifdefined\enskip \else \permanent\protected\def\enskip {\hskip.5\emwidth\relax} \fi
\ifdefined\qquad \else \permanent\protected\def\qquad {\hskip 2\emwidth\relax} \fi
@@ -591,7 +643,7 @@
\permanent\protected\def\negenspace{\kern-.5\emwidth}
\permanent\protected\def\negemspace{\kern- \emwidth}
-\aliased\let\emspace\quad
+% \aliased\let\emspace\quad
\permanent\protected\def\charspace{ } % the unexpandable \space (as space can also be delimiter for numbers)
@@ -609,13 +661,13 @@
% Bovendien definieren we enkele extra \fill's:
-\newskip\s_spac_fil \s_spac_fil = \zeropoint \s!plus 1\s!fil \relax
-\newskip\s_spac_fill \s_spac_fill = \zeropoint \s!plus 1\s!fill \relax
-\newskip\s_spac_filll \s_spac_filll = \zeropoint \s!plus 1\s!filll\relax
+\newgluespec\s_spac_fil \s_spac_fil \zeropoint \s!plus 1\s!fil \relax
+\newgluespec\s_spac_fill \s_spac_fill \zeropoint \s!plus 1\s!fill \relax
+\newgluespec\s_spac_filll \s_spac_filll \zeropoint \s!plus 1\s!filll\relax
-\newskip\s_spac_neg_fil \s_spac_neg_fil = \zeropoint \s!plus-1\s!fil \relax
-\newskip\s_spac_neg_fill \s_spac_neg_fill = \zeropoint \s!plus-1\s!fill \relax
-\newskip\s_spac_neg_filll \s_spac_neg_filll = \zeropoint \s!plus-1\s!filll\relax
+\newgluespec\s_spac_neg_fil \s_spac_neg_fil \zeropoint \s!plus-1\s!fil \relax
+\newgluespec\s_spac_neg_fill \s_spac_neg_fill \zeropoint \s!plus-1\s!fill \relax
+\newgluespec\s_spac_neg_filll \s_spac_neg_filll \zeropoint \s!plus-1\s!filll\relax
\permanent\protected\def\hfilll {\hskip\s_spac_filll\relax}
\permanent\protected\def\vfilll {\vskip\s_spac_filll\relax}
@@ -633,9 +685,9 @@
\installcorenamespace{narrower}
\installcorenamespace{narrowermethod}
-\newskip\s_spac_narrower_left
-\newskip\s_spac_narrower_right
-\newskip\s_spac_narrower_middle
+\newgluespec\s_spac_narrower_left
+\newgluespec\s_spac_narrower_right
+\newgluespec\s_spac_narrower_middle
\installcommandhandler \??narrower {narrower} \??narrower
@@ -659,18 +711,18 @@
{\ifcsname\??narrowermethod#1\endcsname
\lastnamedcs
\else
- \global\advance\s_spac_narrower_middle#1\relax
+ \global\advanceby\s_spac_narrower_middle#1\relax
\fi}
\def\spac_narrower_initialize[#1]% hm, can be dorepeat directly
{\dorepeatwithcommand[#1]\spac_narrower_method_analyze}
-\installnarrowermethod \v!left {\global\advance\s_spac_narrower_left \narrowerparameter\c!left \relax}
-\installnarrowermethod \v!middle {\global\advance\s_spac_narrower_middle \narrowerparameter\c!middle\relax}
-\installnarrowermethod \v!right {\global\advance\s_spac_narrower_right \narrowerparameter\c!right \relax}
-\installnarrowermethod{-\v!left }{\global\advance\s_spac_narrower_left -\narrowerparameter\c!left \relax}
-\installnarrowermethod{-\v!middle}{\global\advance\s_spac_narrower_middle-\narrowerparameter\c!middle\relax}
-\installnarrowermethod{-\v!right }{\global\advance\s_spac_narrower_right -\narrowerparameter\c!right \relax}
+\installnarrowermethod \v!left {\global\advanceby\s_spac_narrower_left \narrowerparameter\c!left \relax}
+\installnarrowermethod \v!middle {\global\advanceby\s_spac_narrower_middle \narrowerparameter\c!middle\relax}
+\installnarrowermethod \v!right {\global\advanceby\s_spac_narrower_right \narrowerparameter\c!right \relax}
+\installnarrowermethod{-\v!left }{\global\advanceby\s_spac_narrower_left -\narrowerparameter\c!left \relax}
+\installnarrowermethod{-\v!middle}{\global\advanceby\s_spac_narrower_middle-\narrowerparameter\c!middle\relax}
+\installnarrowermethod{-\v!right }{\global\advanceby\s_spac_narrower_right -\narrowerparameter\c!right \relax}
\installnarrowermethod \v!reset {\global \s_spac_narrower_left \zeropoint
\global \s_spac_narrower_middle \zeropoint
\global \s_spac_narrower_right \zeropoint\relax}
@@ -686,8 +738,8 @@
\spac_narrower_start_apply{\narrowerparameter\v!default}%
\fi}
-\newskip \s_spac_narrower_left_last
-\newskip \s_spac_narrower_right_last
+\newgluespec \s_spac_narrower_left_last
+\newgluespec \s_spac_narrower_right_last
\newconditional\s_spac_narrower_last_swap
\def\spac_narrower_start_apply#1%
@@ -708,8 +760,8 @@
\fi
\else
\normalexpanded{\processcommalistwithparameters[\scratchstringone]}\spac_narrower_initialize
- \frozen\advance\leftskip \dimexpr\s_spac_narrower_left +\s_spac_narrower_middle\relax
- \frozen\advance\rightskip\dimexpr\s_spac_narrower_right+\s_spac_narrower_middle\relax
+ \frozen\advanceby\leftskip \dimexpr\s_spac_narrower_left +\s_spac_narrower_middle\relax
+ \frozen\advanceby\rightskip\dimexpr\s_spac_narrower_right+\s_spac_narrower_middle\relax
\fi
\seteffectivehsize}
@@ -728,7 +780,7 @@
\permanent\tolerant\protected\def\startnarrower[#1]%
{\begingroup
- \let\currentnarrower\empty
+ \lettonothing\currentnarrower
\ifparameter#1\or
\spac_narrower_start_apply{#1}%
\else
@@ -777,9 +829,9 @@
\aliased\let\stopnarrow\spac_narrower_stop
-\newdimen\d_spac_effective_hsize \permanent\protected\def\effectivehsize {\hsize}
-\newdimen\d_spac_effective_leftskip \permanent\protected\def\effectiveleftskip {\dimexpr\leftskip \relax}
-\newdimen\d_spac_effective_rightskip \permanent\protected\def\effectiverightskip{\dimexpr\rightskip\relax}
+\newdimension\d_spac_effective_hsize \permanent\protected\def\effectivehsize {\hsize}
+\newdimension\d_spac_effective_leftskip \permanent\protected\def\effectiveleftskip {\dimexpr\leftskip \relax}
+\newdimension\d_spac_effective_rightskip \permanent\protected\def\effectiverightskip{\dimexpr\rightskip\relax}
\permanent\protected\def\seteffectivehsize
{\setlocalhsize
@@ -793,8 +845,8 @@
\installcorenamespace{skipadaptionleft}
\installcorenamespace{skipadaptionright}
-\newskip\leftskipadaption
-\newskip\rightskipadaption
+\newgluespec\leftskipadaption
+\newgluespec\rightskipadaption
\defcsname\??skipadaptionleft \v!yes\endcsname{\ifzeropt\d_spac_indentation_par\narrowerparameter\c!left\else\d_spac_indentation_par\fi}
\letcsname\??skipadaptionleft \v!no \endcsname\zeropoint
@@ -809,8 +861,8 @@
\permanent\protected\def\dosetleftskipadaption #1{\leftskipadaption \ifcsname\??skipadaptionleft #1\endcsname\lastnamedcs\else#1\fi\relax}
\permanent\protected\def\dosetrightskipadaption#1{\rightskipadaption\ifcsname\??skipadaptionright#1\endcsname\lastnamedcs\else#1\fi\relax}
-\permanent\protected\def\doadaptleftskip #1{\normalexpanded{\dosetleftskipadaption {#1}}\permanent\advance\leftskip \leftskipadaption }
-\permanent\protected\def\doadaptrightskip#1{\normalexpanded{\dosetrightskipadaption{#1}}\permanent\advance\rightskip\rightskipadaption}
+\permanent\protected\def\doadaptleftskip #1{\normalexpanded{\dosetleftskipadaption {#1}}\frozen\advanceby\leftskip \leftskipadaption }
+\permanent\protected\def\doadaptrightskip#1{\normalexpanded{\dosetrightskipadaption{#1}}\frozen\advanceby\rightskip\rightskipadaption}
\permanent\protected\def\forgetbothskips
{\leftskip\zeropoint
@@ -836,12 +888,12 @@
\installcorenamespace{tolerancemethods}
-\mutable\let\bottomtolerance\empty % why not zero (not used annyway, but for now we keep it)
+\mutable\lettonothing\bottomtolerance % why not zero (not used annyway, but for now we keep it)
\permanent\protected\def\installtolerancemethod#1#2#3%
{\defcsname\??tolerancemethods#1:#2\endcsname{#3}}
-\installtolerancemethod \v!vertical \v!verystrict {\let\bottomtolerance\empty} % why not zero
+\installtolerancemethod \v!vertical \v!verystrict {\lettonothing\bottomtolerance} % why not zero
\installtolerancemethod \v!vertical \v!strict {\def\bottomtolerance{.050}}
\installtolerancemethod \v!vertical \v!tolerant {\def\bottomtolerance{.075}}
\installtolerancemethod \v!vertical \v!verytolerant {\def\bottomtolerance{.100}}
@@ -896,6 +948,8 @@
% \box\b_spac_indentations_a
% \endgroup}
+%D Struts are done differently now.
+%D
%D The only complication lays in \type{\strut}. In \PLAIN\ \TEX\ a \type{\strut} is
%D defined as:
%D
@@ -1000,8 +1054,8 @@
\definehspace [\v!default] [\spaceamount]
\definehspace [\v!none] [\zeropoint]
-%D Taken from Taco's math module (cq. \AMS\ macros), but
-%D adapted to \type {\hspace}:
+%D Taken from Taco's math module (cq. \AMS\ macros), but %D adapted to \type
+%D {\hspace}:
\permanent\protected\def\textormathspace #1#2#3{\ifmmode\mskip#1#2\else\kern #1\hspaceamount\empty{#3}\fi\relax}
\permanent\protected\def\textormathspacecommand #1#2#3{\ifmmode\mskip#1#2\else#3\fi\relax}
@@ -1017,28 +1071,30 @@
\overloaded\permanent\protected \def\negthickspace{\textormathspace-\thickmuskip3}
\overloaded\permanent\protected\edef\medspace {\textormathspacecommand+\medmuskip{\Uchar"205F}}
-% needed for unicode:
-
-% \protected\def\breakablethinspace {\breakabletextormathspace+\thinmuskip1}
-% \protected\def\twoperemspace {\hskip\dimexpr\emwidth/2\relax} % == \enspace
-% \protected\def\threeperemspace {\hskip\dimexpr\emwidth/3\relax}
-% \protected\def\fourperemspace {\hskip\dimexpr\emwidth/4\relax}
-% \protected\def\fiveperemspace {\hskip\dimexpr\emwidth/5\relax} % goodie
-% \protected\def\sixperemspace {\hskip\dimexpr\emwidth/6\relax}
-% \protected\def\figurespace {\begingroup\setbox\scratchbox\hbox{0}\hskip\wd\scratchbox\endgroup} % there is a command for this
-% \protected\def\punctuationspace {\begingroup\setbox\scratchbox\hbox{.}\hskip\wd\scratchbox\endgroup}
-% \protected\def\ideographicspace {\hskip\dimexpr\emwidth/1\relax}
-% \protected\def\ideographichalffillspace{\hskip\dimexpr\emwidth/2\relax}
-% \protected\def\nobreakspace {\penalty\plustenthousand\kern\interwordspace}
-% \protected\def\narrownobreakspace {\penalty\plustenthousand\thinspace}
-% \protected\def\zerowidthnobreakspace {\penalty\plustenthousand\kern\zeropoint}
-% \protected\def\zerowidthspace {\hskip\zeropoint}
+% maybe
+
+% \protected\def\breakablethinskip {\breakabletextormathspace+\thinmuskip1}
+% \protected\def\twoperemskip {\hskip\dimexpr\emwidth/2\relax} % == \enspace
+% \protected\def\threeperemskip {\hskip\dimexpr\emwidth/3\relax}
+% \protected\def\fourperemskip {\hskip\dimexpr\emwidth/4\relax}
+% \protected\def\fiveperemskip {\hskip\dimexpr\emwidth/5\relax} % goodie
+% \protected\def\sixperemskip {\hskip\dimexpr\emwidth/6\relax}
+% \protected\def\figureskip {\begingroup\setbox\scratchbox\hbox{0}\hskip\wd\scratchbox\endgroup} % there is a command for this
+% \protected\def\punctuationskip {\begingroup\setbox\scratchbox\hbox{.}\hskip\wd\scratchbox\endgroup}
+% \protected\def\ideographicskip {\hskip\dimexpr\emwidth/1\relax}
+% \protected\def\ideographichalffillskip{\hskip\dimexpr\emwidth/2\relax}
+% \protected\def\nobreakskip {\penalty\plustenthousand\kern\interwordspace}
+% \protected\def\narrownobreakskip {\penalty\plustenthousand\thinspace}
+% \protected\def\zerowidthnobreakskip {\penalty\plustenthousand\kern\zeropoint}
+% \protected\def\zerowidthskip {\hskip\zeropoint}
\definehspace[.5][.1250\emwidth] % hair
\definehspace[1] [.1667\emwidth] % thin
\definehspace[2] [.2222\emwidth] % med
\definehspace[3] [.2777\emwidth] % thick
+% These will be redefined anyway in math-ini:
+
\suggestedalias \, \thinspace
\suggestedalias \: \medspace
\suggestedalias \; \thickspace
@@ -1173,33 +1229,40 @@
%D \oeps}
%D \stoptyping
-\newsignal\d_spac_ignore_spaces_signal
-\newcount \c_spac_ignore_spaces
+% \newsignal \d_spac_ignore_spaces_signal
+% \newinteger\c_spac_ignore_spaces
+%
+% \permanent\protected\def\startignorespaces
+% {\advanceby\c_spac_ignore_spaces\plusone
+% \ifcase\c_spac_ignore_spaces\or \ifhmode
+% \hskip\d_spac_ignore_spaces_signal
+% \fi \fi
+% \ignorespaces}
+%
+% \permanent\protected\def\stopignorespaces
+% {\ifcase\c_spac_ignore_spaces \or
+% \ifhmode
+% \doloop\spac_ignore_spaces_body
+% \fi
+% \fi
+% \advanceby\c_spac_ignore_spaces\minusone}
+%
+% \def\spac_ignore_spaces_body
+% {\ifzeropt\lastskip
+% \exitloop
+% \orelse\ifdim\lastskip=\d_spac_ignore_spaces_signal
+% \unskip
+% \exitloop
+% \else
+% \unskip
+% \fi}
\permanent\protected\def\startignorespaces
- {\advance\c_spac_ignore_spaces\plusone
- \ifcase\c_spac_ignore_spaces\or \ifhmode
- \hskip\d_spac_ignore_spaces_signal
- \fi \fi
- \ignorespaces}
+ {\pushmacro\nospaces
+ \nospaces\plusone}
\permanent\protected\def\stopignorespaces
- {\ifcase\c_spac_ignore_spaces \or
- \ifhmode
- \doloop\spac_ignore_spaces_body
- \fi
- \fi
- \advance\c_spac_ignore_spaces\minusone}
-
-\def\spac_ignore_spaces_body
- {\ifzeropt\lastskip
- \exitloop
- \orelse\ifdim\lastskip=\d_spac_ignore_spaces_signal
- \unskip
- \exitloop
- \else
- \unskip
- \fi}
+ {\popmacro\nospaces}
%D \macros
%D {obeyfollowingtoken}
@@ -1215,4 +1278,25 @@
\permanent\protected\def\interwordspacesafter #1{\dofastloopcs{#1}\interwordspaceafter}
\permanent\protected\def\interwordspaces #1{\wordboundary\zwnj\dofastloopcs{\numexpr#1+\minusone}\interwordspaceafter}
+%D For mp:
+
+\installcorenamespace{mplocation}
+
+\defcsname\??mplocation\v!left \endcsname{1}
+\defcsname\??mplocation\v!right\endcsname{2}
+\defcsname\??mplocation\v!inner\endcsname{3}
+\defcsname\??mplocation\v!outer\endcsname{4}
+
+\permanent\def\mplocation#1{\ifcsname\??mplocation#1\endcsname\lastnamedcs\else0\fi}
+%permanent\def\mplocation#1{\csname\??mplocation\ifcsname\??mplocation#1\endcsname#1\else\v!left\fi\endcsname}
+
+% new: \lateindent \lateundent
+
+% \parinitleftskip1cm \parindent 1cm \indent test \par
+% \parinitleftskip1cm \parindent 1cm \undent test \par
+% \parinitleftskip1cm \parindent 1cm \indent \undent test \par
+% \parinitleftskip1cm \parindent 1cm \indent \strut \undent test \par
+% \parinitleftskip1cm \parindent 1cm \strut \lateindent 2cm test \par
+% \parinitleftskip1cm \parindent 1cm \strut \lateindent 2cm test \lateundent \par
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-lin.mkxl b/Master/texmf-dist/tex/context/base/mkxl/spac-lin.mkxl
index 53da64923af..d462caeaa1d 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/spac-lin.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/spac-lin.mkxl
@@ -63,7 +63,7 @@
\frozen\instance\letvalue {\e!stop \currentlines }\spac_lines_stop
\to \everydefinelines
-\let\p_lines_option\empty
+\lettonothing\p_lines_option
\let\spac_lines_break \relax
\let\spac_after_first_obeyed_line\relax
@@ -80,15 +80,15 @@
%D \setuplines[indentlist={0pt,1em,*}]
%D \starttyping
-\newcount\c_spac_lines_indent_cnt
-\newcount\c_spac_lines_indent_max
-\newdimen\d_spac_lines_indent
+\newinteger \c_spac_lines_indent_cnt
+\newinteger \c_spac_lines_indent_max
+\newdimension\d_spac_lines_indent
\def\spac_lines_indent_indeed
{\ifnum\c_spac_lines_indent_cnt=\c_spac_lines_indent_max
\c_spac_lines_indent_cnt\plusone
\else
- \advance\c_spac_lines_indent_cnt\plusone
+ \advanceby\c_spac_lines_indent_cnt\plusone
\fi
\getfromcommacommand[\m_spac_lines_indentlist][\c_spac_lines_indent_cnt]%
\ifx\commalistelement\wildcardsymbol
@@ -96,7 +96,7 @@
\else
\scratchdimen\dimexpr\commalistelement\relax
\hskip
- \ifdim\scratchdimen=\zeropoint
+ \ifzeropt\scratchdimen
\zeropoint
\else
\scratchdimen
diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-pag.mkxl b/Master/texmf-dist/tex/context/base/mkxl/spac-pag.mkxl
index d9f7c67a1ee..d61ddcbe6ae 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/spac-pag.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/spac-pag.mkxl
@@ -16,7 +16,7 @@
\unprotect
\newif \ifpagestatemismatch
-\newcount \realpagestateno
+\newinteger \realpagestateno
\newconstant\frozenpagestate
\permanent\protected\def\dotrackpagestate#1#2%
@@ -26,11 +26,11 @@
\permanent\protected\def\doforcedtrackpagestate#1#2%
{\ifcase\frozenpagestate
- \global\advance#2\plusone
+ \global\advanceby#2\plusone
\setpagestate[#1][\number#2]%
\fi}
-\let\m_spac_pagestates_realpage\empty
+\lettonothing\m_spac_pagestates_realpage
\newconditional\c_spac_pagestates_found
@@ -133,7 +133,7 @@
% \dorecurse{500}{\dontleavehmode\signalrightpage\doifrightpageelse{right}{left}\par} % given doublesided
-\newcount\nofraggedparagraphs
+\newinteger\nofraggedparagraphs
\definepagestate[\s!paragraph]
@@ -145,7 +145,7 @@
\installcorenamespace{pagechanges}
-\newif\ifpagechanged \mutable\let\lastchangedpage\empty
+\newif\ifpagechanged \mutable\lettonothing\lastchangedpage
\def\spac_pagechanges_check#1#2#3%
{\pagechangedfalse
@@ -155,7 +155,7 @@
\pagechangedtrue
\fi
\ifpagechanged
- \letgvalue{\??pagechanges#2:#1}\m_spac_pagestates_realpage
+ \gletcsname\??pagechanges#2:#1\endcsname\m_spac_pagestates_realpage
\glet\lastchangedpage\m_spac_pagestates_realpage
\else
\glet\lastchangedpage\realfolio
diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-par.mkxl b/Master/texmf-dist/tex/context/base/mkxl/spac-par.mkxl
index 134a60e2a02..f924165872a 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/spac-par.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/spac-par.mkxl
@@ -24,62 +24,67 @@
% this might move to syst-ini.mkxl
\setnewconstant\paragraphupdatecodes\numexpr
- \frozentolerancecode
- + \frozenloosenesscode
- + \frozenlinepenaltycode
- + \frozenwidowpenaltycode
- + \frozenclubpenaltycode
- + \frozenbrokenpenaltycode
- + \frozendemeritscode
+ \tolerancefrozenparcode
+ + \loosenessfrozenparcode
+ + \linepenaltyfrozenparcode
+ + \widowpenaltyfrozenparcode
+ + \clubpenaltyfrozenparcode
+ + \brokenpenaltyfrozenparcode
+ + \demeritsfrozenparcode
+ + \orphanpenaltyfrozenparcode
\relax
\setnewconstant\paragraphpenaltycodes\numexpr
- \frozenlinepenaltycode
- + \frozenwidowpenaltycode
- + \frozenclubpenaltycode
- + \frozenbrokenpenaltycode
+ \linepenaltyfrozenparcode
+ + \widowpenaltyfrozenparcode
+ + \clubpenaltyfrozenparcode
+ + \brokenpenaltyfrozenparcode
+ + \shapingpenaltyfrozenparcode
+ + \orphanpenaltyfrozenparcode
\relax
\setnewconstant\paragraphdemeritcodes\numexpr
- \frozendemeritscode
+ \demeritsfrozenparcode
\relax
\setnewconstant\paragraphshapecodes\numexpr
- \frozenhangcode
- + \frozenskipcode
- + \frozenparfillcode
- + \frozenshapecode
+ \hangfrozenparcode
+ + \skipfrozenparcode
+ + \parfillfrozenparcode
+ + \shapefrozenparcode
\relax
\setnewconstant\paragraphlinecodes\numexpr
- \frozenlinecode
+ \linefrozenparcode
\relax
\setnewconstant\paragraphhyphenationcodes\numexpr
- \frozenhyphenationcode
+ \hyphenationfrozenparcode
\relax
\setnewconstant\frozenparagraphdefault\numexpr
- \frozenhsizecode % \hsize
- + \frozenskipcode % \leftskip \rightskip
- + \frozenhangcode % \hangindent \hangafter
- + \frozenindentcode % \parindent
- + \frozenparfillcode % \parfillskip \parfillleftskip
- + \frozenadjustcode % \adjustspacing
- + \frozenprotrudecode % \protrudechars
- + \frozentolerancecode % \tolerance \pretolerance
- + \frozenstretchcode % \emergcystretch
- + \frozenloosenesscode % \looseness
- + \frozenlastlinecode % \lastlinefit
- + \frozenlinepenaltycode % \linepenalty \interlinepenalty \interlinepenalties
- + \frozenclubpenaltycode % \clubpenalty \clubpenalties
- + \frozenwidowpenaltycode % \widowpenalty \widowpenalties
- + \frozendisplaypenaltycode % \displaypenalty \displaypenalties
- + \frozenbrokenpenaltycode % \brokenpenalty
- + \frozendemeritscode % \doublehyphendemerits \finalhyphendemerits \adjdemerits
- + \frozenshapecode % \parshape
- % \frozenlinecode % \baselineskip \lineskip \lineskiplimit
- + \frozenhyphenationcode % \hyphenationmode
+ \hsizefrozenparcode % \hsize
+ + \skipfrozenparcode % \leftskip \rightskip
+ + \hangfrozenparcode % \hangindent \hangafter
+ + \indentfrozenparcode % \parindent
+ + \parfillfrozenparcode % \parfillskip \parfillleftskip
+ + \adjustfrozenparcode % \adjustspacing
+ + \protrudefrozenparcode % \protrudechars
+ + \tolerancefrozenparcode % \tolerance \pretolerance
+ + \stretchfrozenparcode % \emergcystretch
+ + \loosenessfrozenparcode % \looseness
+ + \lastlinefrozenparcode % \lastlinefit
+ + \linepenaltyfrozenparcode % \linepenalty \interlinepenalty \interlinepenalties
+ + \clubpenaltyfrozenparcode % \clubpenalty \clubpenalties
+ + \widowpenaltyfrozenparcode % \widowpenalty \widowpenalties
+ + \displaypenaltyfrozenparcode % \displaypenalty \displaypenalties
+ + \brokenpenaltyfrozenparcode % \brokenpenalty
+ + \demeritsfrozenparcode % \doublehyphendemerits \finalhyphendemerits \adjdemerits
+ + \shapefrozenparcode % \parshape
+ % \linefrozenparcode % \baselineskip \lineskip \lineskiplimit
+ + \hyphenationfrozenparcode % \hyphenationmode
+ + \shapingpenaltyfrozenparcode % \shapingpenaltymode
+ + \orphanpenaltyfrozenparcode
\relax
\permanent\protected\def\freezeparagraphproperties {\snapshotpar\frozenparagraphdefault}
@@ -104,9 +109,9 @@
\installcorenamespace {parwrapafter}
\installcorenamespace {parwrapcount}
-\let\spac_paragraph_wrap\relax
+\lettonothing\spac_paragraph_wrap
-\newcount\c_spac_paragraph_group_level
+\newinteger\c_spac_paragraph_group_level
\protected\def\spac_paragraph_update
{\c_spac_paragraph_group_level\currentgrouplevel\relax
@@ -125,7 +130,7 @@
\expandafter\newtoks\csname\??eparwrap\the\currentgrouplevel\endcsname}
\def\spac_paragraph_install_count#1%
- {\expandafter\newcount\csname\??parwrapcount#1\endcsname}
+ {\expandafter\newinteger\csname\??parwrapcount#1\endcsname}
\def\spac_paragraph_install_pair#1#2#3%
{\expandafter\newtoks\csname\??parwrapbefore#3\endcsname
@@ -143,17 +148,17 @@
\ifcsname\??parwrapbefore#3\endcsname \else
\spac_paragraph_install_pair#1#2{#3}%
\fi
- #1\csname\??parwrapbefore#3\endcsname{\advance\csname\??parwrapcount#3\endcsname\plusone\relax
+ #1\csname\??parwrapbefore#3\endcsname{\global\advanceby\csname\??parwrapcount#3\endcsname\plusone\relax % global, see (!)
\clf_setparwrapper{#3}#4}%
#2\csname\??parwrapafter #3\endcsname{#5}%
\clf_newparwrapper{#3}%
- \enforced\let\spac_paragraph_wrap\spac_paragraph_update}
+ \let\spac_paragraph_wrap\spac_paragraph_update}
\def\spac_register_par_wrapper_nop#1#2#3#4#5%
{\ifcsname\??parwrapcount#3\endcsname \else
\spac_paragraph_install_count{#3}%
\fi
- \csname\??parwrapcount#3\endcsname\plusone
+ \global\csname\??parwrapcount#3\endcsname\plusone % global, see (!)
#4\wrapuppar{#5}}
\protected\def\spac_register_par_wrapper
@@ -168,7 +173,7 @@
\csname\??eparwrap\the\currentgrouplevel\endcsname\emptytoks}
\permanent\protected\def\unregisterparwrapper#1%
- {\csname\??parwrapcount#1\endcsname\zerocount
+ {\global\csname\??parwrapcount#1\endcsname\zerocount % global, see (!)
\ifcsname\??parwrapbefore#1\endcsname
\lastnamedcs\emptytoks
\csname\??parwrapafter#1\endcsname\emptytoks
@@ -200,9 +205,19 @@
%appendtoks\spac_paragraph_wrap \to\everypar
%appendtoks\spac_paragraph_freeze \to\everypar
+% (!) testcase for global setting of count
+%
+% \starttext
+% \hsize3cm
+% Aaa\wordright{Aaa}\par
+% \sc{Bbb\wordright{Bbb}}\par
+% {\sc Ccc\wordright{Ccc}}\par
+% \sc{Ddd}\wordright{\sc{Ddd}}\par
+% \stoptext
+
\setparagraphfreezing
-\appendtoks\enforced\let\spac_paragraph_wrap\relax\to\everyforgetall
+\appendtoks\lettonothing\spac_paragraph_wrap\to\everyforgetall
%D In due time, the code below will be upgraded using the above mechanisms.
@@ -212,7 +227,7 @@
%D indentation as set (by the output routine) inside the group are forgotten
%D afterwards. (I must not forget its existence).
-\mutable\let\currentparagraphproperties\empty % visible for tracing
+\mutable\lettonothing\currentparagraphproperties % visible for tracing
\permanent\def\carryoverpar#1% #1 can be \endgroup or \egroup or ... expandable !
{\normalexpanded
@@ -240,8 +255,6 @@
\installcorenamespace{paragraphintro}
-\let\spac_paragraphs_flush_intro\relax % hook into everypar
-
\newtoks\t_spac_paragraphs_intro_first
\newtoks\t_spac_paragraphs_intro_next
\newtoks\t_spac_paragraphs_intro_each
@@ -250,8 +263,8 @@
\newconditional\c_spac_paragraphs_intro_next
\newconditional\c_spac_paragraphs_intro_each
-\let\spac_paragraphs_flush_intro\relax
-\let\spac_paragraphs_intro_step \relax
+\lettonothing\spac_paragraphs_flush_intro
+\lettonothing\spac_paragraphs_intro_step
\permanent\protected\tolerant\def\setupparagraphintro[#1]#*[#2]%
{\def\spac_paragraphs_intro_step##1%
@@ -267,7 +280,7 @@
\global\t_spac_paragraphs_intro_first\emptytoks
\global\t_spac_paragraphs_intro_next \emptytoks
\global\t_spac_paragraphs_intro_each \emptytoks
- \glet\spac_paragraphs_flush_intro\relax}
+ \glettonothing\spac_paragraphs_flush_intro}
\defcsname\??paragraphintro\v!first\endcsname#1%
{\global\settrue\c_spac_paragraphs_intro_first
@@ -362,7 +375,7 @@
\the\t_spac_paragraphs_intro_next
\the\t_spac_paragraphs_intro_each
\else
- \glet\spac_paragraphs_flush_intro\relax
+ \glettonothing\spac_paragraphs_flush_intro
\the\t_spac_paragraphs_intro_next
\fi}}
@@ -375,22 +388,22 @@
%D This macro collects data that will be flushed at the next paragraph. By using
%D this macro you can avoid interfering nodes (writes, etc).
-\aliased\let\flushpostponednodedata\relax % hook into everypar
+\lettonothing\flushpostponednodedata % hook into everypar
-\newbox \b_spac_postponed_data
-%newcount\c_spac_postponed_data
+\newbox \b_spac_postponed_data
+%newinteger\c_spac_postponed_data
% \installcorenamespace {postponednodesstack}
%
% \initializeboxstack\??postponednodesstack
%
% \protected\def\pushpostponednodedata
-% {\global\advance\c_spac_postponed_data\plusone
+% {\global\advanceby\c_spac_postponed_data\plusone
% \savebox\??postponednodesstack{\the\c_spac_postponed_data}{\box\b_spac_postponed_data}}
%
% \protected\def\poppostponednodedata
% {\global\setbox\b_spac_postponed_data\hbox{\foundbox\??postponednodesstack{\the\c_spac_postponed_data}}%
-% \global\advance\c_spac_postponed_data\minusone
+% \global\advanceby\c_spac_postponed_data\minusone
% \ifvoid\b_spac_postponed_data\else
% \enforced\glet\flushpostponednodedata\spac_postponed_data_flush
% \fi}
@@ -435,7 +448,7 @@
{\unhbox\b_spac_postponed_data
\scratchdimen\wd\nextbox
\unhbox\nextbox
- \ifcase\scratchdimen\else\kern-\b_spac_postponed_data\fi}%
+ \ifcase\scratchdimen\else\kern-\scratchdimen\fi}%
\endgroup}
\def\spac_postponed_data_flush
@@ -443,7 +456,7 @@
\ifvoid\b_spac_postponed_data\else
\hpack{\smashedbox\b_spac_postponed_data}% \box\b_spac_postponed_data
\fi
- \enforced\glet\flushpostponednodedata\relax
+ \enforced\glettonothing\flushpostponednodedata
}%\fi}
\permanent\protected\def\doflushatpar % might be renamed
diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-prf.lmt b/Master/texmf-dist/tex/context/base/mkxl/spac-prf.lmt
index 2223c77302d..d8f5169f191 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/spac-prf.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/spac-prf.lmt
@@ -1,4 +1,4 @@
- if not modules then modules = { } end modules ['spac-prf'] = {
+if not modules then modules = { } end modules ['spac-prf'] = {
version = 1.001,
comment = "companion to spac-prf.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
@@ -16,7 +16,6 @@ local formatters = string.formatters
local nodecodes = nodes.nodecodes
local gluecodes = nodes.gluecodes
-local listcodes = nodes.listcodes
local glyph_code = nodecodes.glyph
local disc_code = nodecodes.disc
@@ -34,10 +33,17 @@ local leaders_code = gluecodes.leaders
local lineskip_code = gluecodes.lineskip
local baselineskip_code = gluecodes.baselineskip
-local linelist_code = listcodes.line
+local strutrule_code = nodes.rulecodes.strut
+local linelist_code = nodes.listcodes.line
local texlists = tex.lists
local settexattribute = tex.setattribute
+local texgetdimen = tex.getdimen
+
+local d_strutht = tex.isdimen("strutht")
+local d_strutdp = tex.isdimen("strutdp")
+
+local newindex = lua.newindex
local nuts = nodes.nuts
local tonut = nodes.tonut
@@ -46,6 +52,7 @@ local tonode = nuts.tonode
local getreplace = nuts.getreplace
local getattr = nuts.getattr
local getid = nuts.getid
+local getboth = nuts.getboth
local getnext = nuts.getnext
local getprev = nuts.getprev
local getsubtype = nuts.getsubtype
@@ -59,6 +66,14 @@ local getwidth = nuts.getwidth
local getheight = nuts.getheight
local getdepth = nuts.getdepth
local getboxglue = nuts.getboxglue
+local effectiveglue = nuts.effectiveglue
+local findattribute = nuts.findattribute
+local getspeciallist = nuts.getspeciallist
+
+local getlistdimensions = nuts.getlistdimensions
+
+local nextnode = nuts.traversers.node
+local nextglue = nuts.traversers.glue
local setlink = nuts.setlink
local setlist = nuts.setlist
@@ -76,6 +91,8 @@ local theprop = nuts.theprop
local floor = math.floor
local ceiling = math.ceil
+local min = math.min
+local max = math.max
local new_rule = nuts.pool.rule
local new_glue = nuts.pool.glue
@@ -119,7 +136,7 @@ local function getprofile(line,step)
return
end
- local glue_set, glue_order, glue_sign = getboxglue(line)
+-- local glue_set, glue_order, glue_sign = getboxglue(line)
local heights = { }
local depths = { }
@@ -140,71 +157,24 @@ local function getprofile(line,step)
-- remember p
- local function progress()
- position = width
- width = position + wd
- p = floor((position - margin)/step + 0.5)
- w = floor((width + margin)/step - 0.5)
- if p < 0 then
- p = 0
- end
- if w < 0 then
- w = 0
- end
- if p > w then
- w, p = p, w
- end
- if w > max then
- for i=max+1,w+1 do
- heights[i] = 0
- depths [i] = 0
- end
- max = w
- end
- for i=p,w do
- if ht > heights[i] then
- heights[i] = ht
- end
- if dp > depths[i] then
- depths[i] = dp
- end
- end
- end
-
local function process(current) -- called nested in disc replace
- while current do
- local id = getid(current)
+ for current, id, subtype in nextnode, current do
if id == glyph_code then
wd, ht, dp = getwhd(current)
- progress()
elseif id == kern_code then
wd = getkern(current)
ht = 0
dp = 0
- progress()
elseif id == disc_code then
local replace = getreplace(current)
if replace then
process(replace)
end
+ goto done
elseif id == glue_code then
- local width, stretch, shrink, stretch_order, shrink_order = getglue(current)
- if glue_sign == 1 then
- if stretch_order == glue_order then
- wd = width + stretch * glue_set
- else
- wd = width
- end
- elseif glue_sign == 2 then
- if shrink_order == glue_order then
- wd = width - shrink * glue_set
- else
- wd = width
- end
- else
- wd = width
- end
- if getsubtype(current) >= leaders_code then
+ wd = effectiveglue(current, line) -- geteffectivewhd
+ -- tricky
+ if subtype >= leaders_code then
local leader = getleader(current)
local w
w, ht, dp = getwhd(leader) -- can become getwhd(current) after 1.003
@@ -212,12 +182,11 @@ local function getprofile(line,step)
ht = 0
dp = 0
end
- progress()
elseif id == hlist_code then
+ -- maybe: offsets
-- we could do a nested check .. but then we need to push / pop glue
local shift = getshift(current)
local w, h, d = getwhd(current)
- -- if getattr(current,a_specialcontent) then
if getprop(current,"specialcontent") then
-- like a margin note, maybe check for wd
wd = w
@@ -228,29 +197,49 @@ local function getprofile(line,step)
ht = h - shift
dp = d + shift
end
- progress()
elseif id == vlist_code or id == unset_code then
local shift = getshift(current) -- todo
- wd, ht, dp = getwhd(current)
- progress()
+ wd, ht, dp = getwhd(current) -- todo: use combined getter
elseif id == rule_code then
wd, ht, dp = getwhd(current)
- progress()
elseif id == math_code then
+ -- todo get glue
wd = getkern(current) + getwidth(current) -- surround
ht = 0
dp = 0
- progress()
- elseif id == marginkern_code then
- -- not in lmtx
- wd = getwidth(current)
- ht = 0
- dp = 0
- progress()
else
--- print(nodecodes[id])
+ goto done
+ end
+ -- progress
+ position = width
+ width = position + wd
+ p = floor((position - margin)/step + 0.5)
+ w = floor((width + margin)/step - 0.5)
+ if p < 0 then
+ p = 0
+ end
+ if w < 0 then
+ w = 0
+ end
+ if p > w then
+ w, p = p, w
end
- current = getnext(current)
+ if w > max then
+ for i=max+1,w+1 do
+ heights[i] = 0
+ depths [i] = 0
+ end
+ max = w
+ end
+ for i=p,w do
+ if ht > heights[i] then
+ heights[i] = ht
+ end
+ if dp > depths[i] then
+ depths[i] = dp
+ end
+ end
+ ::done::
end
end
@@ -269,9 +258,9 @@ end
profiling.get = getprofile
local function getpagelist()
- local pagehead = texlists.page_head
+ local pagehead = texlists.pagehead
if pagehead then
- pagehead = tonut(texlists.page_head)
+ pagehead = tonut(texlists.pagehead)
pagetail = find_node_tail(pagehead)
else
pagetail = nil
@@ -362,6 +351,7 @@ local function addprofile(node,profile,step)
return
end
local what = nil
+ -- beware: basically end of line so we actually need to put it elsewhere
if lastht == 0 and lastdp == 0 then
what = new_kern(lastwd)
else
@@ -470,12 +460,17 @@ end
-- lineskip | lineskiplimit
local function inject(top,bot,amount) -- todo: look at penalties
- local glue = new_glue(amount)
- --
- setattr(glue,a_profilemethod,0)
- setattr(glue,a_visual,getattr(top,a_visual))
- --
- setlink(top,glue,bot)
+ if amount ~= 0 then
+ local glue = new_glue(amount)
+ --
+ setattr(glue,a_profilemethod,0)
+ -- setattr(glue,a_visual,getattr(top,a_visual))
+ setattr(glue,a_visual,nodes.visualizers.modes.glue)
+ --
+ setlink(top,glue,bot)
+ --
+ report("injected correction %p at page",amount,tex.getcount("realpageno"))
+ end
end
methods[v_none] = function()
@@ -487,8 +482,8 @@ methods[v_strict] = function(top,bot,t_profile,b_profile,specification)
local top = tonut(top)
local bot = tonut(bot)
- local strutht = specification.height or texdimen.strutht
- local strutdp = specification.depth or texdimen.strutdp
+ local strutht = specification.height or texgetdimen(d_strutht)
+ local strutdp = specification.depth or texgetdimen(d_strutdp)
local lineheight = strutht + strutdp
local depth = getdepth(top)
@@ -523,8 +518,8 @@ methods[v_fixed] = function(top,bot,t_profile,b_profile,specification)
local top = tonut(top)
local bot = tonut(bot)
- local strutht = specification.height or texdimen.strutht
- local strutdp = specification.depth or texdimen.strutdp
+ local strutht = specification.height or texgetdimen(d_strutht)
+ local strutdp = specification.depth or texgetdimen(d_strutdp)
local lineheight = strutht + strutdp
local depth = getdepth(top)
@@ -545,7 +540,7 @@ methods[v_fixed] = function(top,bot,t_profile,b_profile,specification)
return true
end
- local delta = getdelta(t_profile,b_profile)
+ local delta = getdelta(t_profile,b_profile)
local dp = strutdp
while depth > lineheight - strutdp do
@@ -642,8 +637,6 @@ end
local function profilelist(line,mvl)
- local current = line
-
local top = nil
local bot = nil
@@ -666,11 +659,8 @@ local function profilelist(line,mvl)
pagehead, pagetail = getpagelist()
if pagetail then
- local current = pagetail
- while current do
- local id = getid(current)
+ for current, id, subtype in nextnode, pagetail do
if id == hlist_code then
- local subtype = getsubtype(current)
if subtype == linelist_code then
t_profile = hasprofile(current)
if t_profile then
@@ -690,13 +680,12 @@ local function profilelist(line,mvl)
else
break
end
- current = getnext(current)
end
end
end
- while current do
+ for current, id, subtype in nextnode, line do
local attr = getattr(current,a_profilemethod)
@@ -709,10 +698,7 @@ local function profilelist(line,mvl)
lastattr = attr
end
- local id = getid(current)
-
if id == hlist_code then -- check subtype
- local subtype = getsubtype(current)
if subtype == linelist_code then
if top == current then
-- skip
@@ -751,7 +737,6 @@ local function profilelist(line,mvl)
end
elseif id == glue_code then
if top then
- local subtype = getsubtype(current)
-- if subtype == lineskip_code or subtype == baselineskip_code then
local wd = getwidth(current)
if wd > 0 then
@@ -781,7 +766,6 @@ local function profilelist(line,mvl)
top = nil
bot = nil
end
- current = getnext(current)
end
if top then
t_profile = setprofile(top)
@@ -795,6 +779,8 @@ profiling.list = profilelist
local enabled = false
+-- todo: use attribute storage
+
function profiling.set(specification)
if not enabled then
enableaction("mvlbuilders", "builders.profiling.pagehandler")
@@ -818,10 +804,8 @@ function profiling.profilebox(specification)
local action = method and methods[method] or methods[v_strict]
local lastglue = nil
local distance = 0
- while current do
- local id = getid(current)
+ for current, id, subtype in nextnode, current do
if id == hlist_code then
- local subtype = getsubtype(current)
if subtype == linelist_code then
if top then
bot = current
@@ -855,7 +839,6 @@ function profiling.profilebox(specification)
bot = nil
end
elseif id == glue_code then
- local subtype = getsubtype(current)
if subtype == lineskip_code or subtype == baselineskip_code then
if top then
local wd = getwidth(current)
@@ -882,7 +865,6 @@ function profiling.profilebox(specification)
top = nil
bot = nil
end
- current = getnext(current)
end
if top then
@@ -947,3 +929,387 @@ interfaces.implement {
}
}
}
+
+-- The following is an experiment that I picked up after demoing this already old but never
+-- used feature and in the process it got applied to document of hundreds of pages. Actually
+-- performance is quite okay but this mechanism is not really meant for that scenario. We'll
+-- see where this ends. We could (an d might) integrate it in the above but the next is more
+-- lightweight while the previous was basically some exploration with lots of options.
+
+do
+
+ -- we could share the two arrays if needed
+
+ local a_lineprofile = attributes.private("lineprofile")
+
+ local registervalue = attributes.registervalue
+ local getvalue = attributes.getvalue
+ local texsetattribute = tex.setattribute
+
+ local function getdepthprofile(line,step,margin,max,list)
+
+ local width = 0
+ local position = 0
+ local profile = newindex(max+2,0)
+ local wd = 0
+ local ht = 0
+ local dp = 0
+
+ profile[0] = 0
+
+ local function process(current) -- called nested in disc replace
+ for current, id, subtype in nextnode, current do
+ if id == glyph_code then
+ wd, ht, dp = getwhd(current)
+ elseif id == kern_code then
+ wd = getkern(current)
+ dp = 0
+ elseif id == disc_code then
+ local replace = getreplace(current)
+ if replace then
+ process(replace)
+ end
+ goto done
+ elseif id == glue_code then
+ wd = effectiveglue(current, line) -- geteffectivewhd
+ -- tricky
+ if subtype >= leaders_code then
+ local leader = getleader(current)
+ local w
+ w, ht, dp = getwhd(leader)
+ else
+ dp = 0
+ end
+ elseif id == hlist_code then
+ local w, h, d, shift = getlistdimensions(current)
+ if getprop(current,"specialcontent") then
+ -- like a margin note, maybe check for wd
+ wd = w
+ dp = 0
+ else
+ wd = w
+ dp = d + shift
+ end
+ elseif id == vlist_code then
+ local shift
+ wd, ht, dp, shift = getlistdimensions(current)
+ dp = dp + shift
+ elseif id == rule_code then
+ if subtype == strutrule_code then
+ dp = 0
+ else
+ wd, ht, dp = getwhd(current)
+ end
+ elseif id == math_code then
+ -- todo get glue
+ wd = getkern(current) + getwidth(current) -- surround
+ dp = 0
+ else
+ goto done
+ end
+ -- progress
+ position = width
+ width = position + wd
+ p = floor((position - margin)/step + 0.5)
+ w = floor((width + margin)/step - 0.5)
+ if p < 0 then
+ p = 0
+ end
+ if w < 0 then
+ w = 0
+ end
+ if p > w then
+ w, p = p, w
+ end
+ if w > max then
+ for i=max+1,w+1 do
+ profile[i] = 0
+ end
+ max = w
+ end
+ for i=p,w do
+ if dp > profile[i] then
+ profile[i] = dp
+ end
+ end
+ ::done::
+ end
+ end
+
+ process(list)
+
+ return profile
+
+ end
+
+ local function getheightprofile(line,step,margin,max,list)
+
+ local width = 0
+ local position = 0
+ local profile = newindex(max+2,0)
+ local wd = 0
+ local ht = 0
+ local dp = 0
+
+ profile[0] = 0
+
+ local function process(current) -- called nested in disc replace
+ for current, id, subtype in nextnode, current do
+ if id == glyph_code then
+ wd, ht, dp = getwhd(current)
+ elseif id == kern_code then
+ wd = getkern(current)
+ ht = 0
+ elseif id == disc_code then
+ local replace = getreplace(current)
+ if replace then
+ process(replace)
+ end
+ goto done
+ elseif id == glue_code then
+ wd = effectiveglue(current, line) -- geteffectivewhd
+ -- tricky
+ if subtype >= leaders_code then
+ local leader = getleader(current)
+ local w
+ w, ht, dp = getwhd(leader)
+ else
+ ht = 0
+ end
+ elseif id == hlist_code then
+ local w, h, d, shift = getlistdimensions(current)
+ if getprop(current,"specialcontent") then
+ -- like a margin note, maybe check for wd
+ wd = w
+ ht = 0
+ else
+ wd = w
+ ht = h - shift
+ end
+ elseif id == vlist_code then
+ local shift
+ wd, ht, dp, shift = getlistdimensions(current)
+ ht = ht - shift
+ elseif id == rule_code then
+ if subtype == strutrule_code then
+ ht = 0
+ else
+ wd, ht, dp = getwhd(current)
+ end
+ elseif id == math_code then
+ -- todo get glue
+ wd = getkern(current) + getwidth(current) -- surround
+ ht = 0
+ else
+ goto done
+ end
+ -- progress
+ position = width
+ width = position + wd
+ p = floor((position - margin)/step + 0.5)
+ w = floor((width + margin)/step - 0.5)
+ if p < 0 then
+ p = 0
+ end
+ if w < 0 then
+ w = 0
+ end
+ if p > w then
+ w, p = p, w
+ end
+ if w > max then
+ for i=max+1,w+1 do
+ profile[i] = 0
+ end
+ max = w
+ end
+ for i=p,w do
+ if ht > profile[i] then
+ profile[i] = ht
+ end
+ end
+ ::done::
+ end
+ end
+
+ process(list)
+
+ return profile
+
+ end
+
+ local show_lineprofile = false
+ local show_linedetails = false
+
+ trackers.register("profiling.lines.show", function(v)
+ local visualizers = nodes.visualizers
+ glue_mode = visualizers.modes.glue
+ line_mode = visualizers.modes.line
+ show_lineprofile = v
+ visualizers.enable()
+ end)
+
+ trackers.register("profiling.lines.details", function(v)
+ show_linedetail = v
+ end)
+
+ local defaultstep = 65536 * 2 -- 2pt
+ local defaultmethod = "a"
+ local defaultfactor = 1
+
+ local v_yes = interfaces.variables.yes
+
+ -- I played with different methods (like only get depths and then on the fly check with heights
+ -- but there is no gain and it is also fuzzy. So for now we just do the whole scan.
+
+ function profilelines(list,prev)
+
+ if not list then
+ return
+ end
+
+ local _, start = findattribute(list,a_lineprofile)
+ if not start then
+ return
+ end
+
+ -- no height or depth ... skip
+ for current, subtype in nextglue, start do
+ if subtype == lineskip_code and not getprop(current,"profiled") then
+ local detail = getattr(current,a_lineprofile)
+ if detail then
+ local amount = getwidth(current)
+ if amount > 0 then
+ detail = getvalue(a_lineprofile,detail) or { }
+ --
+ local top, bot = getboth(current)
+ setprop(current,"profiled",amount) -- original amount, maybe move up
+ if not top and prev and detail.paragraph == v_yes then
+ top = prev
+ end
+ if top then
+ if getid(top) == penalty_code then
+ top = getprev(top)
+ end
+ if top and bot then
+ if getid(top) == hlist_code and getsubtype(top) == linelist_code then
+ if getid(bot) == hlist_code and getsubtype(bot) == linelist_code then
+ local toplist = getlist(top)
+ local botlist = getlist(bot)
+ if toplist and botlist then
+ --
+ local step = detail.step or defaultstep
+ local factor = tonumber(detail.factor) or defaultfactor
+ local method = detail.method or defaultmethod
+ local margin = step / 4
+ --
+ if factor > 1 then
+ factor = 1
+ elseif factor <= 0 then
+ factor = 0 -- we could actually go the other way
+ end
+ --
+ local natural = getdepth(top) + getheight(bot)
+ local added = factor * amount
+ local possible = natural - added
+ local overshoot = 0
+ local topmax = ceiling(getwidth(top)/step) + 1
+ local botmax = ceiling(getwidth(bot)/step) + 1
+ -- if method == "a" then
+ local depths = getdepthprofile (top,step,margin,topmax,toplist)
+ local heights = getheightprofile(bot,step,margin,botmax,botlist)
+ local steps = min(#depths,#heights)
+ for i=1,steps do
+ local o = heights[i] + depths[i] - possible
+ if o > overshoot then
+ -- we can quit when >= added
+ overshoot = o
+ -- if overshoot > added then
+ -- break
+ -- end
+ end
+ end
+ -- end
+ -- if overshoot < added / 2 then
+ -- overshoot = added / 2
+ -- end
+ if overshoot ~= amount then -- shouldn't we round
+ setwidth(current,overshoot)
+ if show_lineprofile then
+ setattr(current,a_visual,glue_mode)
+ setattr(bot,a_visual,line_mode)
+ setattr(top,a_visual,line_mode)
+ end
+ if show_linedetail then
+ report("lineskip changed from %p to %p on page %i",amount,overshoot,tex.getcount("realpageno"))
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ prev = nil
+ end
+ end
+
+ builders.profiling.profilelines = profilelines
+
+ function profiling.boxlinehandler(head)
+ if head then
+ profilelines(head)
+ end
+ return head
+ end
+
+ function profiling.pagelinehandler(head,...)
+ if head then
+ local h, t = getspeciallist("pagehead")
+ profilelines(head,t)
+ end
+ return head
+ end
+
+ -- actually we need a proper callback for this kind of things ...
+
+ function profiling.setlines(specification)
+ if not enabled then
+ enableaction("mvlbuilders", "builders.profiling.pagelinehandler")
+ enableaction("vboxbuilders", "builders.profiling.boxlinehandler")
+ enabled = true
+ end
+ texsetattribute(a_lineprofile,registervalue(a_lineprofile,specification))
+ end
+
+ interfaces.implement {
+ name = "setlineprofile",
+ actions = profiling.setlines,
+ arguments = {
+ {
+ { "name" },
+ { "method" },
+ { "step", "dimension" },
+ { "factor" },
+ { "paragraph" },
+ }
+ }
+ }
+
+ interfaces.implement {
+ name = "lineprofilebox",
+ public = true,
+ protected = true,
+ actions = function(box)
+ local okay = nuts.getbox(box)
+ local list = getlist(okay)
+ if list then
+ profiling.boxlinehandler(list)
+ end
+ end,
+ arguments = "integer"
+ }
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-prf.mklx b/Master/texmf-dist/tex/context/base/mkxl/spac-prf.mklx
index 6b4a966f2af..06038d8678c 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/spac-prf.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/spac-prf.mklx
@@ -52,21 +52,52 @@
\c!distance=\zeropoint,
\c!factor=\plusone]
-\defineprofile[halffixed] [\v!fixed][\c!factor=\plustwo]
-\defineprofile[quarterfixed][\v!fixed][\c!factor=\plusfour]
-\defineprofile[eightsfixed] [\v!fixed][\c!factor=\pluseight]
+\appendtoks
+ \ifcstok{\profileparameter\c!define}\v!yes
+ \frozen\protected\edefcsname\e!start\currentprofile\endcsname{\spac_profile_start{\currentprofile}}%
+ \frozen\protected\defcsname \e!stop \currentprofile\endcsname{\spac_profile_stop}%
+ \fi
+\to \everydefineprofile
+
+\def\spac_profile_set
+ {\clf_setprofile
+ name {\currentprofile}%
+ height \dimexpr\profileparameter\c!height\relax
+ depth \dimexpr\profileparameter\c!depth\relax
+ distance \dimexpr\profileparameter\c!distance\relax
+ factor \numexpr\profileparameter\c!factor\relax
+ lines \numexpr\profileparameter\c!lines\relax
+ method {\profileparameter\c!method}%
+ \relax}
+
+\tolerant\protected\def\spac_profile_start#profile#spacer[#settings]%
+ {\begingroup
+ \ifparameter#settings\or
+ \edef\currentprofile{#profile}%
+ \setupcurrentprofile[#settings]%
+ \orelse\ifhastok={#profile}%
+ \let\currentprofile\v!none
+ \setupcurrentprofile[#profile]%
+ \else
+ \edef\currentprofile{#profile}%
+ \fi
+ \spac_profile_set
+ \profileparameter\c!before}
+
+\protected\def\spac_profile_stop
+ {\par % otherwise not applied
+ \profileparameter\c!after
+ \endgroup}
+
+\permanent\protected\def\startprofile[#profile]%
+ {\spac_profile_start{#profile}}
+
+\permanent\protected\def\stopprofile
+ {\spac_profile_stop}
\permanent\protected\def\setprofile[#profile]%
{\edef\currentprofile{#profile}%
- \clf_setprofile
- name {\currentprofile}%
- height \dimexpr\profileparameter\c!height\relax
- depth \dimexpr\profileparameter\c!depth\relax
- distance \dimexpr\profileparameter\c!distance\relax
- factor \numexpr\profileparameter\c!factor\relax
- lines \numexpr\profileparameter\c!lines\relax
- method {\profileparameter\c!method}%
- \relax}
+ \spac_profile_set}
\permanent\protected\def\resetprofile
{\c_attr_profilemethod\attributeunsetvalue}
@@ -110,4 +141,46 @@
\relax
\endgroup}
+\defineprofile[halffixed] [\v!fixed][\c!factor=\plustwo]
+\defineprofile[quarterfixed][\v!fixed][\c!factor=\plusfour]
+\defineprofile[eightsfixed] [\v!fixed][\c!factor=\pluseight]
+
+% Finally some follow up on this experiment:
+
+\definesystemattribute[lineprofile] [public]
+
+\installcorenamespace {lineprofile}
+
+\installcommandhandler \??lineprofile {lineprofile} \??lineprofile
+
+\setuplineprofile
+ [\c!method=\v!a,
+ \c!step=.5\emwidth, % maybe 2pt
+ \c!paragraph=\v!no,
+ \c!factor=.125] % maybe 0.250
+
+\def\spac_line_profile_set
+ {\clf_setlineprofile
+ name {\currentlineprofile}%
+ step \dimexpr\lineprofileparameter\c!step\relax
+ factor {\lineprofileparameter\c!factor}%
+ method {\lineprofileparameter\c!method}%
+ paragraph {\lineprofileparameter\c!paragraph}%
+ \relax}
+
+\permanent\tolerant\protected\def\setlineprofile[#profile]%
+ {\edef\currentlineprofile{#profile}%
+ \spac_line_profile_set}
+
+\permanent\protected\def\resetlineprofile
+ {\c_attr_lineprofile\attributeunsetvalue}
+
+\permanent\protected\def\setmainlineprofile
+ {\lettonothing\currentlineprofile
+ \spac_line_profile_set}
+
+\appendtoks
+ \c_attr_lineprofile\attributeunsetvalue % or in general resetter
+\to \everyforgetall
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-ver.lmt b/Master/texmf-dist/tex/context/base/mkxl/spac-ver.lmt
index 2d4aace2437..06032bcce9d 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/spac-ver.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/spac-ver.lmt
@@ -33,7 +33,6 @@ if not modules then modules = { } end modules ['spac-ver'] = {
local next, type, tonumber = next, type, tonumber
local gmatch, concat = string.gmatch, table.concat
-local ceil, floor, abs = math.ceil, math.floor, math.abs
local lpegmatch = lpeg.match
local unpack = unpack or table.unpack
local allocate = utilities.storage.allocate
@@ -70,19 +69,12 @@ local v_split = variables.split
local v_min = variables.min
local v_max = variables.max
local v_none = variables.none
-local v_line = variables.line
-local v_noheight = variables.noheight
-local v_nodepth = variables.nodepth
-local v_line = variables.line
-local v_halfline = variables.halfline
-local v_line_m = "-" .. v_line
-local v_halfline_m = "-" .. v_halfline
local v_first = variables.first
local v_last = variables.last
local v_top = variables.top
local v_bottom = variables.bottom
-local v_minheight = variables.minheight
local v_maxheight = variables.maxheight
+local v_minheight = variables.minheight
local v_mindepth = variables.mindepth
local v_maxdepth = variables.maxdepth
local v_offset = variables.offset
@@ -98,13 +90,12 @@ local v_blines = variables.blines
local trace_vbox_vspacing = false trackers.register("vspacing.vbox", function(v) trace_vbox_vspacing = v end)
local trace_page_vspacing = false trackers.register("vspacing.page", function(v) trace_page_vspacing = v end)
-local trace_page_builder = false trackers.register("builders.page", function(v) trace_page_builder = v end)
local trace_collect_vspacing = false trackers.register("vspacing.collect", function(v) trace_collect_vspacing = v end)
local trace_vspacing = false trackers.register("vspacing.spacing", function(v) trace_vspacing = v end)
local trace_vsnapping = false trackers.register("vspacing.snapping", function(v) trace_vsnapping = v end)
local trace_specials = false trackers.register("vspacing.specials", function(v) trace_specials = v end)
-local remove_math_skips = true directives.register("vspacing.removemathskips", function(v) remnove_math_skips = v end)
+local remove_math_skips = true directives.register("vspacing.removemathskips", function(v) remnove_math_skips = v end)
local report_vspacing = logs.reporter("vspacing","spacing")
local report_collapser = logs.reporter("vspacing","collapsing")
@@ -117,6 +108,16 @@ local a_skiporder = attributes.private('skiporder')
local a_snapmethod = attributes.private('snapmethod')
local a_snapvbox = attributes.private('snapvbox')
+local d_bodyfontstrutheight = tex.isdimen("bodyfontstrutheight")
+local d_bodyfontstrutdepth = tex.isdimen("bodyfontstrutdepth")
+local d_globalbodyfontstrutheight = tex.isdimen("globalbodyfontstrutheight")
+local d_globalbodyfontstrutdepth = tex.isdimen("globalbodyfontstrutdepth")
+----- d_strutht = tex.isdimen("strutht")
+local d_strutdp = tex.isdimen("strutdp")
+local d_spac_overlay = tex.isdimen("d_spac_overlay")
+
+local c_spac_vspacing_ignore_parskip = tex.iscount("c_spac_vspacing_ignore_parskip")
+
local nuts = nodes.nuts
local tonut = nuts.tonut
@@ -127,8 +128,9 @@ local getid = nuts.getid
local getlist = nuts.getlist
local setlist = nuts.setlist
local getattr = nuts.getattr
-local getattrs = nuts.getattrs
local setattr = nuts.setattr
+local setattrs = nuts.setattrs
+local getattrs = nuts.getattrs
local getsubtype = nuts.getsubtype
local getbox = nuts.getbox
local getwhd = nuts.getwhd
@@ -147,14 +149,16 @@ local getheight = nuts.getheight
local setdepth = nuts.setdepth
local getdepth = nuts.getdepth
local setnext = nuts.setnext
+local setprev = nuts.setprev
local find_node_tail = nuts.tail
-local flush_node = nuts.flush_node
+local flushnode = nuts.flushnode
local remove_node = nuts.remove
local count_nodes = nuts.countall
local hpack_node = nuts.hpack
local vpack_node = nuts.vpack
-local start_of_par = nuts.start_of_par
+
+local startofpar = nuts.startofpar
local write_node = nuts.write
@@ -163,8 +167,6 @@ local nexthlist = nuts.traversers.hlist
local nodereference = nuts.reference
-local theprop = nuts.theprop
-
local listtoutf = nodes.listtoutf
local nodeidstostring = nodes.idstostring
@@ -187,6 +189,7 @@ local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
local rule_code = nodecodes.rule
local par_code = nodecodes.par
+local boundary_code = nodecodes.boundary
local userskip_code = gluecodes.userskip
local lineskip_code = gluecodes.lineskip
@@ -197,6 +200,8 @@ local splittopskip_code = gluecodes.splittopskip
local linelist_code = nodes.listcodes.line
+local setvisual = function(...) setvisual = nuts.setvisual return setvisual(...) end
+
local properties = nodes.properties.data
local vspacing = builders.vspacing or { }
@@ -289,7 +294,7 @@ end
local function validvbox(parentid,list)
if parentid == hlist_code then
local id = getid(list)
- if id == par_code and start_of_par(list) then
+ if id == par_code and startofpar(list) then
list = getnext(list)
if not next then
return nil
@@ -323,7 +328,7 @@ local function already_done(parentid,list,a_snapmethod) -- todo: done when only
-- problem: any snapped vbox ends up in a line
if list and parentid == hlist_code then
local id = getid(list)
- if id == par_code and start_of_par(list) then
+ if id == par_code and startofpar(list) then
list = getnext(list)
if not list then
return false
@@ -351,354 +356,368 @@ local function already_done(parentid,list,a_snapmethod) -- todo: done when only
return false
end
--- quite tricky: ceil(-something) => -0
-
-local function ceiled(n)
- if n < 0 or n < 0.01 then
- return 0
- else
- return ceil(n)
- end
-end
+-- check variables.none etc
-local function floored(n)
- if n < 0 or n < 0.01 then
- return 0
- else
- return floor(n)
- end
-end
+local snap_hlist do
--- check variables.none etc
+ local v_noheight = variables.noheight
+ local v_nodepth = variables.nodepth
+ local v_line = variables.line
+ local v_halfline = variables.halfline
+ local v_line_m = "-" .. v_line
+ local v_halfline_m = "-" .. v_halfline
-local function fixedprofile(current)
- local profiling = builders.profiling
- return profiling and profiling.fixedprofile(current)
-end
+ local floor = math.floor
+ local ceil = math.ceil
-local function snap_hlist(where,current,method,height,depth) -- method[v_strut] is default
- if fixedprofile(current) then
- return
- end
- local list = getlist(current)
- local t = trace_vsnapping and { }
- if t then
- t[#t+1] = formatters["list content: %s"](listtoutf(list))
- t[#t+1] = formatters["snap method: %s"](method.name) -- not interfaced
- t[#t+1] = formatters["specification: %s"](method.specification) -- not interfaced
+ local function fixedprofile(current)
+ local profiling = builders.profiling
+ return profiling and profiling.fixedprofile(current)
end
- local snapht, snapdp
- if method[v_local] then
- -- snapping is done immediately here
- snapht = texgetdimen("bodyfontstrutheight")
- snapdp = texgetdimen("bodyfontstrutdepth")
- if t then
- t[#t+1] = formatters["local: snapht %p snapdp %p"](snapht,snapdp)
- end
- elseif method[v_global] then
- snapht = texgetdimen("globalbodyfontstrutheight")
- snapdp = texgetdimen("globalbodyfontstrutdepth")
- if t then
- t[#t+1] = formatters["global: snapht %p snapdp %p"](snapht,snapdp)
- end
- else
- -- maybe autolocal
- -- snapping might happen later in the otr
- snapht = texgetdimen("globalbodyfontstrutheight")
- snapdp = texgetdimen("globalbodyfontstrutdepth")
- local lsnapht = texgetdimen("bodyfontstrutheight")
- local lsnapdp = texgetdimen("bodyfontstrutdepth")
- if snapht ~= lsnapht and snapdp ~= lsnapdp then
- snapht, snapdp = lsnapht, lsnapdp
- end
- if t then
- t[#t+1] = formatters["auto: snapht %p snapdp %p"](snapht,snapdp)
+
+ -- quite tricky: ceil(-something) => -0
+
+ local function ceiled(n)
+ if n < 0 or n < 0.01 then
+ return 0
+ else
+ return ceil(n)
end
end
- local wd, ht, dp = getwhd(current)
-
- local h = (method[v_noheight] and 0) or height or ht
- local d = (method[v_nodepth] and 0) or depth or dp
- local hr = method[v_hfraction] or 1
- local dr = method[v_dfraction] or 1
- local br = method[v_bfraction] or 0
- local ch = h
- local cd = d
- local tlines = method[v_tlines] or 1
- local blines = method[v_blines] or 1
- local done = false
- local plusht = snapht
- local plusdp = snapdp
- local snaphtdp = snapht + snapdp
- local extra = 0
-
- if t then
- t[#t+1] = formatters["hlist: wd %p ht %p (used %p) dp %p (used %p)"](wd,ht,h,dp,d)
- t[#t+1] = formatters["fractions: hfraction %s dfraction %s bfraction %s tlines %s blines %s"](hr,dr,br,tlines,blines)
+ local function floored(n)
+ if n < 0 or n < 0.01 then
+ return 0
+ else
+ return floor(n)
+ end
end
- if method[v_box] then
- local br = 1 - br
- if br < 0 then
- br = 0
- elseif br > 1 then
- br = 1
- end
- local n = ceiled((h+d-br*snapht-br*snapdp)/snaphtdp)
- local x = n * snaphtdp - h - d
- plusht = h + x / 2
- plusdp = d + x / 2
+ snap_hlist = function(where,current,method,height,depth) -- method[v_strut] is default
+ if fixedprofile(current) then
+ return
+ end
+ local list = getlist(current)
+ local t = trace_vsnapping and { }
if t then
- t[#t+1] = formatters["%s: plusht %p plusdp %p"](v_box,plusht,plusdp)
+ t[#t+1] = formatters["list content: %s"](listtoutf(list))
+ t[#t+1] = formatters["snap method: %s"](method.name) -- not interfaced
+ t[#t+1] = formatters["specification: %s"](method.specification) -- not interfaced
+ end
+ local snapht, snapdp
+ if method[v_local] then
+ -- snapping is done immediately here
+ snapht = texgetdimen(d_bodyfontstrutheight)
+ snapdp = texgetdimen(d_bodyfontstrutdepth)
+ if t then
+ t[#t+1] = formatters["local: snapht %p snapdp %p"](snapht,snapdp)
+ end
+ elseif method[v_global] then
+ snapht = texgetdimen(d_globalbodyfontstrutheight)
+ snapdp = texgetdimen(d_globalbodyfontstrutdepth)
+ if t then
+ t[#t+1] = formatters["global: snapht %p snapdp %p"](snapht,snapdp)
+ end
+ else
+ -- maybe autolocal
+ -- snapping might happen later in the otr
+ snapht = texgetdimen(d_globalbodyfontstrutheight)
+ snapdp = texgetdimen(d_globalbodyfontstrutdepth)
+ local lsnapht = texgetdimen(d_bodyfontstrutheight)
+ local lsnapdp = texgetdimen(d_bodyfontstrutdepth)
+ if snapht ~= lsnapht and snapdp ~= lsnapdp then
+ snapht, snapdp = lsnapht, lsnapdp
+ end
+ if t then
+ t[#t+1] = formatters["auto: snapht %p snapdp %p"](snapht,snapdp)
+ end
end
- elseif method[v_max] then
- local n = ceiled((h+d)/snaphtdp)
- local x = n * snaphtdp - h - d
- plusht = h + x / 2
- plusdp = d + x / 2
+
+ local wd, ht, dp = getwhd(current)
+
+ local h = (method[v_noheight] and 0) or height or ht
+ local d = (method[v_nodepth] and 0) or depth or dp
+ local hr = method[v_hfraction] or 1
+ local dr = method[v_dfraction] or 1
+ local br = method[v_bfraction] or 0
+ local ch = h
+ local cd = d
+ local tlines = method[v_tlines] or 1
+ local blines = method[v_blines] or 1
+ local done = false
+ local plusht = snapht
+ local plusdp = snapdp
+ local snaphtdp = snapht + snapdp
+ local extra = 0
+
if t then
- t[#t+1] = formatters["%s: plusht %p plusdp %p"](v_max,plusht,plusdp)
+ t[#t+1] = formatters["hlist: wd %p ht %p (used %p) dp %p (used %p)"](wd,ht,h,dp,d)
+ t[#t+1] = formatters["fractions: hfraction %s dfraction %s bfraction %s tlines %s blines %s"](hr,dr,br,tlines,blines)
end
- elseif method[v_min] then
- -- we catch a lone min
- if method.specification ~= v_min then
- local n = floored((h+d)/snaphtdp)
+
+ if method[v_box] then
+ local br = 1 - br
+ if br < 0 then
+ br = 0
+ elseif br > 1 then
+ br = 1
+ end
+ local n = ceiled((h+d-br*snapht-br*snapdp)/snaphtdp)
local x = n * snaphtdp - h - d
plusht = h + x / 2
plusdp = d + x / 2
- if plusht < 0 then
- plusht = 0
+ if t then
+ t[#t+1] = formatters["%s: plusht %p plusdp %p"](v_box,plusht,plusdp)
end
- if plusdp < 0 then
- plusdp = 0
+ elseif method[v_max] then
+ local n = ceiled((h+d)/snaphtdp)
+ local x = n * snaphtdp - h - d
+ plusht = h + x / 2
+ plusdp = d + x / 2
+ if t then
+ t[#t+1] = formatters["%s: plusht %p plusdp %p"](v_max,plusht,plusdp)
+ end
+ elseif method[v_min] then
+ -- we catch a lone min
+ if method.specification ~= v_min then
+ local n = floored((h+d)/snaphtdp)
+ local x = n * snaphtdp - h - d
+ plusht = h + x / 2
+ plusdp = d + x / 2
+ if plusht < 0 then
+ plusht = 0
+ end
+ if plusdp < 0 then
+ plusdp = 0
+ end
+ end
+ if t then
+ t[#t+1] = formatters["%s: plusht %p plusdp %p"](v_min,plusht,plusdp)
+ end
+ elseif method[v_none] then
+ plusht, plusdp = 0, 0
+ if t then
+ t[#t+1] = formatters["%s: plusht %p plusdp %p"](v_none,0,0)
end
end
- if t then
- t[#t+1] = formatters["%s: plusht %p plusdp %p"](v_min,plusht,plusdp)
- end
- elseif method[v_none] then
- plusht, plusdp = 0, 0
- if t then
- t[#t+1] = formatters["%s: plusht %p plusdp %p"](v_none,0,0)
- end
- end
- -- for now, we actually need to tag a box and then check at several points if something ended up
- -- at the top of a page
- if method[v_halfline] then -- extra halfline
- extra = snaphtdp/2
- plusht = plusht + extra
- plusdp = plusdp + extra
- if t then
- t[#t+1] = formatters["%s: plusht %p plusdp %p"](v_halfline,plusht,plusdp)
+ -- for now, we actually need to tag a box and then check at several points if something ended up
+ -- at the top of a page
+ if method[v_halfline] then -- extra halfline
+ extra = snaphtdp/2
+ plusht = plusht + extra
+ plusdp = plusdp + extra
+ if t then
+ t[#t+1] = formatters["%s: plusht %p plusdp %p"](v_halfline,plusht,plusdp)
+ end
end
- end
- if method[v_line] then -- extra line
- extra = snaphtdp
- plusht = plusht + extra
- plusdp = plusdp + extra
- if t then
- t[#t+1] = formatters["%s: plusht %p plusdp %p"](v_line,plusht,plusdp)
+ if method[v_line] then -- extra line
+ extra = snaphtdp
+ plusht = plusht + extra
+ plusdp = plusdp + extra
+ if t then
+ t[#t+1] = formatters["%s: plusht %p plusdp %p"](v_line,plusht,plusdp)
+ end
end
- end
- if method[v_halfline_m] then -- extra halfline
- extra = - snaphtdp/2
- plusht = plusht + extra
- plusdp = plusdp + extra
- if t then
- t[#t+1] = formatters["%s: plusht %p plusdp %p"](v_halfline_m,plusht,plusdp)
+ if method[v_halfline_m] then -- extra halfline
+ extra = - snaphtdp/2
+ plusht = plusht + extra
+ plusdp = plusdp + extra
+ if t then
+ t[#t+1] = formatters["%s: plusht %p plusdp %p"](v_halfline_m,plusht,plusdp)
+ end
end
- end
- if method[v_line_m] then -- extra line
- extra = - snaphtdp
- plusht = plusht + extra
- plusdp = plusdp + extra
- if t then
- t[#t+1] = formatters["%s: plusht %p plusdp %p"](v_line_m,plusht,plusdp)
+ if method[v_line_m] then -- extra line
+ extra = - snaphtdp
+ plusht = plusht + extra
+ plusdp = plusdp + extra
+ if t then
+ t[#t+1] = formatters["%s: plusht %p plusdp %p"](v_line_m,plusht,plusdp)
+ end
end
- end
- if method[v_first] then
- local thebox = current
- local id = getid(thebox)
- if id == hlist_code then
- thebox = validvbox(id,getlist(thebox))
- id = thebox and getid(thebox)
- end
- if thebox and id == vlist_code then
- local list = getlist(thebox)
- local lw, lh, ld
- for n in nexthlist, list do
- lw, lh, ld = getwhd(n)
- break
+ if method[v_first] then
+ local thebox = current
+ local id = getid(thebox)
+ if id == hlist_code then
+ thebox = validvbox(id,getlist(thebox))
+ id = thebox and getid(thebox)
end
- if lh then
- local wd, ht, dp = getwhd(thebox)
- if t then
- t[#t+1] = formatters["first line: height %p depth %p"](lh,ld)
- t[#t+1] = formatters["dimensions: height %p depth %p"](ht,dp)
+ if thebox and id == vlist_code then
+ local list = getlist(thebox)
+ local lw, lh, ld
+ for n in nexthlist, list do
+ lw, lh, ld = getwhd(n)
+ break
end
- local delta = h - lh
- ch, cd = lh, delta + d
- h, d = ch, cd
- local shifted = hpack_node(getlist(current))
- setshift(shifted,delta)
- setlist(current,shifted)
- done = true
- if t then
- t[#t+1] = formatters["first: height %p depth %p shift %p"](ch,cd,delta)
+ if lh then
+ local wd, ht, dp = getwhd(thebox)
+ if t then
+ t[#t+1] = formatters["first line: height %p depth %p"](lh,ld)
+ t[#t+1] = formatters["dimensions: height %p depth %p"](ht,dp)
+ end
+ local delta = h - lh
+ ch, cd = lh, delta + d
+ h, d = ch, cd
+ local shifted = hpack_node(getlist(current))
+ setshift(shifted,delta)
+ setlist(current,shifted)
+ done = true
+ if t then
+ t[#t+1] = formatters["first: height %p depth %p shift %p"](ch,cd,delta)
+ end
+ elseif t then
+ t[#t+1] = "first: not done, no content"
end
elseif t then
- t[#t+1] = "first: not done, no content"
- end
- elseif t then
- t[#t+1] = "first: not done, no vbox"
- end
- elseif method[v_last] then
- local thebox = current
- local id = getid(thebox)
- if id == hlist_code then
- thebox = validvbox(id,getlist(thebox))
- id = thebox and getid(thebox)
- end
- if thebox and id == vlist_code then
- local list = getlist(thebox)
- local lw, lh, ld
- for n in nexthlist, list do
- lw, lh, ld = getwhd(n)
- end
- if lh then
- local wd, ht, dp = getwhd(thebox)
- if t then
- t[#t+1] = formatters["last line: height %p depth %p" ](lh,ld)
- t[#t+1] = formatters["dimensions: height %p depth %p"](ht,dp)
+ t[#t+1] = "first: not done, no vbox"
+ end
+ elseif method[v_last] then
+ local thebox = current
+ local id = getid(thebox)
+ if id == hlist_code then
+ thebox = validvbox(id,getlist(thebox))
+ id = thebox and getid(thebox)
+ end
+ if thebox and id == vlist_code then
+ local list = getlist(thebox)
+ local lw, lh, ld
+ for n in nexthlist, list do
+ lw, lh, ld = getwhd(n)
end
- local delta = d - ld
- cd, ch = ld, delta + h
- h, d = ch, cd
- local shifted = hpack_node(getlist(current))
- setshift(shifted,delta)
- setlist(current,shifted)
- done = true
- if t then
- t[#t+1] = formatters["last: height %p depth %p shift %p"](ch,cd,delta)
+ if lh then
+ local wd, ht, dp = getwhd(thebox)
+ if t then
+ t[#t+1] = formatters["last line: height %p depth %p" ](lh,ld)
+ t[#t+1] = formatters["dimensions: height %p depth %p"](ht,dp)
+ end
+ local delta = d - ld
+ cd, ch = ld, delta + h
+ h, d = ch, cd
+ local shifted = hpack_node(getlist(current))
+ setshift(shifted,delta)
+ setlist(current,shifted)
+ done = true
+ if t then
+ t[#t+1] = formatters["last: height %p depth %p shift %p"](ch,cd,delta)
+ end
+ elseif t then
+ t[#t+1] = "last: not done, no content"
end
elseif t then
- t[#t+1] = "last: not done, no content"
+ t[#t+1] = "last: not done, no vbox"
end
- elseif t then
- t[#t+1] = "last: not done, no vbox"
- end
- end
- if method[v_minheight] then
- ch = floored((h-hr*snapht)/snaphtdp)*snaphtdp + plusht
- if t then
- t[#t+1] = formatters["minheight: %p"](ch)
- end
- elseif method[v_maxheight] then
- ch = ceiled((h-hr*snapht)/snaphtdp)*snaphtdp + plusht
- if t then
- t[#t+1] = formatters["maxheight: %p"](ch)
end
- else
- ch = plusht
- if t then
- t[#t+1] = formatters["set height: %p"](ch)
+ if method[v_minheight] then
+ ch = floored((h-hr*snapht)/snaphtdp)*snaphtdp + plusht
+ if t then
+ t[#t+1] = formatters["minheight: %p"](ch)
+ end
+ elseif method[v_maxheight] then
+ ch = ceiled((h-hr*snapht)/snaphtdp)*snaphtdp + plusht
+ if t then
+ t[#t+1] = formatters["maxheight: %p"](ch)
+ end
+ else
+ ch = plusht
+ if t then
+ t[#t+1] = formatters["set height: %p"](ch)
+ end
end
- end
- if method[v_mindepth] then
- cd = floored((d-dr*snapdp)/snaphtdp)*snaphtdp + plusdp
- if t then
- t[#t+1] = formatters["mindepth: %p"](cd)
+ if method[v_mindepth] then
+ cd = floored((d-dr*snapdp)/snaphtdp)*snaphtdp + plusdp
+ if t then
+ t[#t+1] = formatters["mindepth: %p"](cd)
+ end
+ elseif method[v_maxdepth] then
+ cd = ceiled((d-dr*snapdp)/snaphtdp)*snaphtdp + plusdp
+ if t then
+ t[#t+1] = formatters["maxdepth: %p"](cd)
+ end
+ else
+ cd = plusdp
+ if t then
+ t[#t+1] = formatters["set depth: %p"](cd)
+ end
end
- elseif method[v_maxdepth] then
- cd = ceiled((d-dr*snapdp)/snaphtdp)*snaphtdp + plusdp
- if t then
- t[#t+1] = formatters["maxdepth: %p"](cd)
+ if method[v_top] then
+ ch = ch + tlines * snaphtdp
+ if t then
+ t[#t+1] = formatters["top height: %p"](ch)
+ end
end
- else
- cd = plusdp
- if t then
- t[#t+1] = formatters["set depth: %p"](cd)
+ if method[v_bottom] then
+ cd = cd + blines * snaphtdp
+ if t then
+ t[#t+1] = formatters["bottom depth: %p"](cd)
+ end
end
- end
- if method[v_top] then
- ch = ch + tlines * snaphtdp
- if t then
- t[#t+1] = formatters["top height: %p"](ch)
+ local offset = method[v_offset]
+ if offset then
+ -- we need to set the attr
+ if t then
+ local wd, ht, dp = getwhd(current)
+ t[#t+1] = formatters["before offset: %p (width %p height %p depth %p)"](offset,wd,ht,dp)
+ end
+ local shifted = hpack_node(getlist(current))
+ setshift(shifted,offset)
+ setlist(current,shifted)
+ if t then
+ local wd, ht, dp = getwhd(current)
+ t[#t+1] = formatters["after offset: %p (width %p height %p depth %p)"](offset,wd,ht,dp)
+ end
+ setattr(shifted,a_snapmethod,0)
+ setattr(current,a_snapmethod,0)
end
- end
- if method[v_bottom] then
- cd = cd + blines * snaphtdp
- if t then
- t[#t+1] = formatters["bottom depth: %p"](cd)
+ if not height then
+ setheight(current,ch)
+ if t then
+ t[#t+1] = formatters["forced height: %p"](ch)
+ end
end
- end
- local offset = method[v_offset]
- if offset then
- -- we need to set the attr
- if t then
- local wd, ht, dp = getwhd(current)
- t[#t+1] = formatters["before offset: %p (width %p height %p depth %p)"](offset,wd,ht,dp)
+ if not depth then
+ setdepth(current,cd)
+ if t then
+ t[#t+1] = formatters["forced depth: %p"](cd)
+ end
end
- local shifted = hpack_node(getlist(current))
- setshift(shifted,offset)
- setlist(current,shifted)
+ local lines = (ch+cd)/snaphtdp
if t then
- local wd, ht, dp = getwhd(current)
- t[#t+1] = formatters["after offset: %p (width %p height %p depth %p)"](offset,wd,ht,dp)
+ local original = (h+d)/snaphtdp
+ local whatever = (ch+cd)/(texgetdimen(d_globalbodyfontstrutheight) + texgetdimen(d_globalbodyfontstrutdepth))
+ t[#t+1] = formatters["final lines : %p -> %p (%p)"](original,lines,whatever)
+ t[#t+1] = formatters["final height: %p -> %p"](h,ch)
+ t[#t+1] = formatters["final depth : %p -> %p"](d,cd)
end
- setattr(shifted,a_snapmethod,0)
- setattr(current,a_snapmethod,0)
- end
- if not height then
- setheight(current,ch)
+ -- todo:
+ --
+ -- if h < 0 or d < 0 then
+ -- h = 0
+ -- d = 0
+ -- end
if t then
- t[#t+1] = formatters["forced height: %p"](ch)
+ report_snapper("trace: %s type %s\n\t%\n\tt",where,nodecodes[getid(current)],t)
end
- end
- if not depth then
- setdepth(current,cd)
- if t then
- t[#t+1] = formatters["forced depth: %p"](cd)
+ if not method[v_split] then
+ -- so extra will not be compensated at the top of a page
+ extra = 0
end
+ return h, d, ch, cd, lines, extra
end
- local lines = (ch+cd)/snaphtdp
- if t then
- local original = (h+d)/snaphtdp
- local whatever = (ch+cd)/(texgetdimen("globalbodyfontstrutheight") + texgetdimen("globalbodyfontstrutdepth"))
- t[#t+1] = formatters["final lines : %p -> %p (%p)"](original,lines,whatever)
- t[#t+1] = formatters["final height: %p -> %p"](h,ch)
- t[#t+1] = formatters["final depth : %p -> %p"](d,cd)
- end
--- todo:
---
--- if h < 0 or d < 0 then
--- h = 0
--- d = 0
--- end
- if t then
- report_snapper("trace: %s type %s\n\t%\n\tt",where,nodecodes[getid(current)],t)
- end
- if not method[v_split] then
- -- so extra will not be compensated at the top of a page
- extra = 0
- end
- return h, d, ch, cd, lines, extra
+
end
-local categories = {
- [0] = "discard",
- [1] = "largest",
- [2] = "force",
- [3] = "penalty",
- [4] = "add",
- [5] = "disable",
- [6] = "nowhite",
- [7] = "goback",
- [8] = "packed",
- [9] = "overlay",
- [10] = "enable",
- [11] = "notopskip",
+local categories = { [0] =
+ "discard",
+ "largest",
+ "force",
+ "penalty",
+ "add",
+ "disable",
+ "nowhite",
+ "goback",
+ "packed",
+ "overlay",
+ "enable",
+ "notopskip",
}
categories = allocate(table.swapped(categories,categories))
@@ -731,6 +750,126 @@ vspacingdata.skip = vspacingdata.skip or { } -- allocate ?
storage.register("builders/vspacing/data/map", vspacingdata.map, "builders.vspacing.data.map")
storage.register("builders/vspacing/data/skip", vspacingdata.skip, "builders.vspacing.data.skip")
+local setspecification, getspecification
+
+-- 1 statepool : 2 : more overhead : a bit slower than properties
+-- 2 attributes : 1 : more overhead : feels faster than properties
+-- 3 properties : 3 : more natural : feels slower than attributes
+-- 4 data : 1 : more native : is little faster than attributes (limited penalty)
+
+-- testfile: t:/bugs/bottomfloats-001.tex
+
+local method = 1 -- better tracing
+-- local method = 2
+-- local method = 3
+-- local method = 4
+
+-- todo: not true but only visual a_visual,tex.getattribute(a_visual)
+
+if method == 1 then
+
+ local registervalue = attributes.registervalue
+ local getvalue = attributes.getvalue
+ local values = attributes.values
+
+ setspecification = function(n,category,penalty,order)
+ local detail = { category, penalty, order or 1 }
+ local value = registervalue(a_skipcategory,detail)
+ setattr(n,a_skipcategory,value)
+ end
+
+ getspecification = function(n)
+ local value = getattr(n,a_skipcategory)
+ if value then
+ local detail = getvalue(a_skipcategory,value)
+ -- local detail = attributes.values[a_skipcategory][value]
+ -- local detail = values[a_skipcategory][value]
+ if detail then
+ return detail[1], detail[2], detail[3]
+ end
+ end
+ return false, false, 1
+ end
+
+elseif method == 2 then
+
+ -- quite okay but more memory due to attributes (not many)
+
+ setspecification = function(n,category,penalty,order)
+ setattrs(n,false,a_skipcategory,category or nil,a_skippenalty,penalty or nil,a_skiporder,order or 1)
+ end
+
+ getspecification = function(n)
+ local c, p, o = getattrs(n,a_skipcategory,a_skippenalty,a_skiporder)
+ return c or false, p or false, o or 1
+ end
+
+elseif method == 3 then
+
+ -- more natural as we stay in lua
+
+ setspecification = function(n,category,penalty,order)
+ -- we know that there are no properties
+ properties[n] = {
+ [a_skipcategory] = category,
+ [a_skippenalty] = penalty,
+ [a_skiporder] = order or 1,
+ }
+ end
+
+ getspecification = function(n)
+ local p = properties[n]
+ if p then
+ return p[a_skipcategory], p[a_skippenalty], p[a_skiporder]
+ end
+ end
+
+elseif method == 4 then
+
+ -- quite efficient but needs testing because we limit values
+
+ local getdata = nuts.getdata
+ local setdata = nuts.setdata
+
+ setspecification = function(n,category,penalty,order)
+ if not category or category > 0xF then
+ category = 0xF
+ end
+ if not order or order > 0xFF then
+ order = 0xFF
+ end
+ if not penalty or penalty > 0x7FFFF then
+ penalty = 0x7FFFF
+ elseif penalty < -0x7FFFF then
+ penalty = -0x7FFFF
+ end
+ -- we need overflow checks
+ setdata(n, (penalty << 12) + (order << 4) + category)
+ end
+
+ getspecification = function(n)
+ local data = getdata(n)
+ if data and data ~= 0 then
+ local category = data & 0x0F
+ local order = (data >> 4) & 0xFF
+ local penalty = data >> 12
+ if category == 0xF then
+ category = nil
+ end
+ if order == 0xFF then
+ order = nil
+ end
+ if penalty == 0x7FFFF then
+ penalty = nil
+ end
+ return category, penalty, order
+ else
+ return nil, nil, nil
+ end
+ end
+
+end
+
do
local P, C, R, S, Cc, Cs = lpeg.P, lpeg.C, lpeg.R, lpeg.S, lpeg.Cc, lpeg.Cs
@@ -750,9 +889,10 @@ do
local k_fixed = variables.fixed
local k_flexible = variables.flexible
- local k_category = "category"
- local k_penalty = "penalty"
- local k_order = "order"
+
+ local k_category <const> = "category"
+ local k_penalty <const> = "penalty"
+ local k_order <const> = "order"
function vspacing.setmap(from,to)
map[from] = to
@@ -765,14 +905,12 @@ do
end
end
- local expandmacro = token.expand_macro
+ local expandmacro = token.expandmacro -- todo
-- local runlocal = tex.runlocal
-- local setmacro = tokens.setters.macro
-- local settoks = tex.settoks
local toscaled = tex.toscaled
- local setattrs = nuts.setattrs
-
local b_done = false
local b_packed = false
@@ -817,8 +955,10 @@ do
local function inject()
local n = new_glue(b_amount,b_stretch,b_shrink)
- setattrs(n,false,a_skipcategory,b_category,a_skippenalty,b_penalty,a_skiporder,b_order or 1)
+ setspecification(n,b_category,b_penalty,b_order or 1)
+ setvisual(k)
write_node(n)
+ -- todo: inject via value
end
local function flush()
@@ -833,6 +973,9 @@ do
-- local cmd = token.create("vspacingfromtempstring")
-- local cmd = token.create("vspacingpredefinedvalue") -- not yet known
+ ----- s_predefined = "s_spac_vspacing_predefined"
+ local s_predefined = tex.isskip("s_spac_vspacing_predefined")
+
local function handler(multiplier, keyword, detail)
if not keyword then
report_vspacing("unknown directive %a",s)
@@ -887,7 +1030,7 @@ do
-- setmacro("tempstring",keyword)
-- runlocal(ctx_vspacingfromtempstring)
--
- amount, stretch, shrink = texgetglue("scratchskip")
+ amount, stretch, shrink = texgetglue(s_predefined)
if not stretch then
stretch = 0
end
@@ -924,7 +1067,7 @@ do
end
b_done = false
b_packed = false
- b_grid = grid
+ b_grid = grid == true or grid == 1
before()
lpegmatch(pattern,str)
after()
@@ -941,19 +1084,25 @@ do
function vspacing.injectpenalty(penalty)
local n = new_glue()
- setattrs(n,false,a_skipcategory,categories.penalty,a_skippenalty,penalty,a_skiporder,1)
+ -- setattrs(n,false,a_skipcategory,categories.penalty,a_skippenalty,penalty,a_skiporder,1)
+ setspecification(n,categories.penalty,penalty,1)
+ setvisual(k)
write_node(n)
end
function vspacing.injectskip(amount)
local n = new_glue(amount)
- setattrs(n,false,a_skipcategory,categories.largest,a_skippenalty,false,a_skiporder,1)
+ -- setattrs(n,false,a_skipcategory,categories.largest,a_skippenalty,false,a_skiporder,1)
+ setspecification(n,categories.largest,false,1)
+ setvisual(k)
write_node(n)
end
function vspacing.injectdisable(amount)
local n = new_glue()
- setattrs(n,false,a_skipcategory,categories.disable,a_skippenalty,false,a_skiporder,1)
+ -- setattrs(n,false,a_skipcategory,categories.disable,a_skippenalty,false,a_skiporder,1)
+ setspecification(n,categories.disable,false,1)
+ setvisual(k)
write_node(n)
end
@@ -961,7 +1110,7 @@ end
-- implementation
--- alignment box begin_of_par vmode_par hmode_par insert penalty before_display after_display
+-- alignment box begin_of_par vmodepar hmodepar insert penalty before_display after_display
function vspacing.snapbox(n,how)
local sv = snapmethods[how]
@@ -1018,8 +1167,8 @@ end
do
- local insert_node_after = nuts.insert_after
- local insert_node_before = nuts.insert_before
+ local insertnodeafter = nuts.insertafter
+ local insertnodebefore = nuts.insertbefore
local abovedisplayskip_code = gluecodes.abovedisplayskip
local belowdisplayskip_code = gluecodes.belowdisplayskip
@@ -1059,7 +1208,7 @@ do
end
local function trace_skip(str,sc,so,sp,data)
- trace_list[#trace_list+1] = { "skip", formatters["%s | %p | category %s | order %s | penalty %s"](str, getwidth(data), sc or "-", so or "-", sp or "-") }
+ trace_list[#trace_list+1] = { "skip", formatters["%s | %p | category %s | order %s | penalty %s | subtype %s"](str, getwidth(data), sc or "-", so or "-", sp or "-", gluecodes[getsubtype(data)]) }
tracing_info = true
end
@@ -1115,16 +1264,22 @@ do
end
if width == 0 then
-- do nothing
- elseif where == "after" then
- head, current = insert_node_after(head,current,new_rule(w,h,d))
- head, current = insert_node_after(head,current,new_kern(width))
- head, current = insert_node_after(head,current,new_rule(w,h,d))
else
- local c = current
- head, current = insert_node_before(head,current,new_rule(w,h,d))
- head, current = insert_node_before(head,current,new_kern(width))
- head, current = insert_node_before(head,current,new_rule(w,h,d))
- current = c
+ local b = new_rule(w,h,d)
+ local k = new_kern(width)
+ local a = new_rule(w,h,d)
+ setvisual(k)
+ if where == "after" then
+ head, current = insertnodeafter(head,current,b)
+ head, current = insertnodeafter(head,current,k)
+ head, current = insertnodeafter(head,current,a)
+ else
+ local c = current
+ head, current = insertnodebefore(head,current,b)
+ head, current = insertnodebefore(head,current,k)
+ head, current = insertnodebefore(head,current,a)
+ current = c
+ end
end
if trace then
report_vspacing("inserting forced skip of %p",width)
@@ -1301,13 +1456,15 @@ do
end
--
local delta = n_ht + skips + p_dp
- texsetdimen("global","d_spac_overlay",-delta) -- for tracing
+ texsetdimen("global",d_spac_overlay,-delta) -- for tracing
-- we should adapt pagetotal ! (need a hook for that) .. now we have the wrong pagebreak
local k = new_kern(-delta)
- head = insert_node_before(head,n,k)
+ setvisual(k)
+ head = insertnodebefore(head,n,k)
if n_ht > p_ht then
local k = new_kern(n_ht-p_ht)
- head = insert_node_before(head,p,k)
+ setvisual(k)
+ head = insertnodebefore(head,p,k)
end
if trace_vspacing then
report_vspacing("overlaying, prev height: %p, prev depth: %p, next height: %p, skips: %p, move up: %p",p_ht,p_dp,n_ht,skips,delta)
@@ -1347,7 +1504,7 @@ do
-- quit, we're not on the mvl
else
-- inefficient when we're at the end of a page
- local c = tonut(texlists.page_head)
+ local c = tonut(texlists.pagehead)
while c and c ~= n do
local id = getid(c)
if id == hlist_code then
@@ -1367,6 +1524,21 @@ do
return remove_node(head,current,true)
end
+ -- where -> scope
+ -- what -> where (original context)
+
+ local checkslide = false
+
+ directives.register("vspacing.checkslide", function(v)
+ if v then
+ checkslide = function(head,where,what)
+ nuts.checkslide(head,where .. " : " .. what)
+ end
+ else
+ checkslide = false
+ end
+ end)
+
local function collapser(head,where,what,trace,snap,a_snapmethod) -- maybe also pass tail
if trace then
reset_tracing(head)
@@ -1390,10 +1562,11 @@ do
local pagetail
--
-- todo: keep_together: between headers
+ -- todo: make this nicer in the engine
--
local function getpagelist()
if not pagehead then
- pagehead = texlists.page_head
+ pagehead = texlists.pagehead -- pagehead, pagetail = tex.getlist("pagehead")
if pagehead then
pagehead = tonut(pagehead)
pagetail = find_node_tail(pagehead) -- no texlists.page_tail yet-- no texlists.page_tail yet
@@ -1401,6 +1574,12 @@ do
end
end
--
+ -- local function getpagelist()
+ -- if not pagehead then
+ -- pagehead, pagetail = texgetlist("pagehead")
+ -- end
+ -- end
+ --
local function compensate(n)
local g = 0
while n and getid(n) == glue_code do
@@ -1442,6 +1621,7 @@ do
local d = g - t
if d < -e then
local penalty = new_penalty(1000000)
+ setvisual(penalty)
setlink(penalty,head)
head = penalty
report_snapper("force pagebreak due to extra space at bottom: %p",e)
@@ -1470,6 +1650,7 @@ do
local function flush(why)
if penalty_data then
local p = new_penalty(penalty_data)
+ setvisual(p)
if trace then
trace_done("flushed due to " .. why,p)
end
@@ -1477,12 +1658,12 @@ do
local prev = getprev(current)
if getid(prev) == glue_code then -- maybe go back more, or maybe even push back before any glue
-- tricky case: spacing/grid-007.tex: glue penalty glue
- head = insert_node_before(head,prev,p)
+ head = insertnodebefore(head,prev,p)
else
- head = insert_node_before(head,current,p)
+ head = insertnodebefore(head,current,p)
end
else
- head = insert_node_before(head,current,p)
+ head = insertnodebefore(head,current,p)
end
-- if penalty_data > special_penalty_min and penalty_data < special_penalty_max then
local props = properties[p]
@@ -1501,22 +1682,22 @@ do
trace_done("flushed due to forced " .. why,glue_data)
end
head = forced_skip(head,current,getwidth(glue_data,width),"before",trace)
- flush_node(glue_data)
+ flushnode(glue_data)
else
local width, stretch, shrink = getglue(glue_data)
if width ~= 0 then
if trace then
trace_done("flushed due to non zero " .. why,glue_data)
end
- head = insert_node_before(head,current,glue_data)
+ head = insertnodebefore(head,current,glue_data)
elseif stretch ~= 0 or shrink ~= 0 then
if trace then
trace_done("flushed due to stretch/shrink in" .. why,glue_data)
end
- head = insert_node_before(head,current,glue_data)
+ head = insertnodebefore(head,current,glue_data)
else
-- report_vspacing("needs checking (%s): %p",gluecodes[getsubtype(glue_data)],w)
- flush_node(glue_data)
+ flushnode(glue_data)
end
end
end
@@ -1531,10 +1712,10 @@ do
--
if trace_vsnapping then
report_snapper("global ht/dp = %p/%p, local ht/dp = %p/%p",
- texgetdimen("globalbodyfontstrutheight"),
- texgetdimen("globalbodyfontstrutdepth"),
- texgetdimen("bodyfontstrutheight"),
- texgetdimen("bodyfontstrutdepth")
+ texgetdimen(d_globalbodyfontstrutheight),
+ texgetdimen(d_globalbodyfontstrutdepth),
+ texgetdimen(d_bodyfontstrutheight),
+ texgetdimen(d_bodyfontstrutdepth)
)
end
if trace then
@@ -1543,6 +1724,9 @@ do
if snap and where == "page" then
removetopsnap()
end
+ if checkslide then
+ checkslide(head,where,what)
+ end
while current do
local id = getid(current)
if id == hlist_code or id == vlist_code then
@@ -1613,7 +1797,8 @@ do
elseif id == glue_code then
local subtype = getsubtype(current)
if subtype == userskip_code then
- local sc, so, sp = getattrs(current,a_skipcategory,a_skiporder,a_skippenalty)
+ -- local sc, so, sp = getattrs(current,a_skipcategory,a_skiporder,a_skippenalty)
+ local sc, sp, so = getspecification(current)
if not so then
so = 1 -- the others have no default value
end
@@ -1647,7 +1832,7 @@ do
if trace then
trace_done("flush",glue_data)
end
- head = insert_node_before(head,current,glue_data)
+ head = insertnodebefore(head,current,glue_data)
if trace then
trace_natural("natural",current)
end
@@ -1737,7 +1922,7 @@ do
trace_skip("force",sc,so,sp,current)
end
glue_order = so
- flush_node(glue_data)
+ flushnode(glue_data)
head, current, glue_data = remove_node(head,current)
elseif glue_order == so then
-- is now exclusive, maybe support goback as combi, else why a set
@@ -1748,7 +1933,7 @@ do
if trace then
trace_skip("largest",sc,so,sp,current)
end
- flush_node(glue_data)
+ flushnode(glue_data)
head, current, glue_data = remove_node(head,current)
else
if trace then
@@ -1760,7 +1945,7 @@ do
if trace then
trace_skip("goback",sc,so,sp,current)
end
- flush_node(glue_data)
+ flushnode(glue_data)
head, current, glue_data = remove_node(head,current)
elseif sc == force then
-- last one counts, some day we can provide an accumulator and largest etc
@@ -1768,13 +1953,13 @@ do
if trace then
trace_skip("force",sc,so,sp,current)
end
- flush_node(glue_data)
+ flushnode(glue_data)
head, current, glue_data = remove_node(head,current)
elseif sc == penalty then
if trace then
trace_skip("penalty",sc,so,sp,current)
end
- flush_node(glue_data)
+ flushnode(glue_data)
glue_data = nil
head, current = remove_node(head,current,true)
elseif sc == add then
@@ -1855,7 +2040,7 @@ do
elseif glue_data then
local w = getwidth(current)
if w ~= 0 and w > getwidth(glue_data) then
-flush_node(glue_data)
+ flushnode(glue_data)
glue_data = current
if trace then
trace_natural("taking parskip",current)
@@ -1875,8 +2060,9 @@ flush_node(glue_data)
end
elseif subtype == topskip_code or subtype == splittopskip_code then
local next = getnext(current)
- if next and getattr(next,a_skipcategory) == notopskip then
- nuts.setglue(current) -- zero
+ -- if next and getattr(next,a_skipcategory) == notopskip then
+ if next and getspecification(next) == notopskip then
+ setglue(current) -- zero
end
if snap then
local s = getattr(current,a_snapmethod)
@@ -1963,6 +2149,7 @@ flush_node(glue_data)
if penalty_data then
tail = find_node_tail(head)
local p = new_penalty(penalty_data)
+ setvisual(p)
if trace then
trace_done("result",p)
end
@@ -1985,14 +2172,15 @@ flush_node(glue_data)
end
if force_glue then
head, tail = forced_skip(head,tail,getwidth(glue_data),"after",trace)
- flush_node(glue_data)
+ flushnode(glue_data)
glue_data = nil
elseif tail then
setlink(tail,glue_data)
-setnext(glue_data)
+ setnext(glue_data)
else
head = glue_data
end
+ -- texsetnest("top","prevdepth",0)
texnest[texnest.ptr].prevdepth = 0 -- appending to the list bypasses tex's prevdepth handler
end
if trace then
@@ -2007,6 +2195,22 @@ setnext(glue_data)
return head
end
+-- local function collapser(head,...)
+-- local current = head
+-- while current do
+-- local id = getid(current)
+-- if id == glue_code then
+-- if getsubtype(current) == userskip_code then
+-- local glue_data
+-- head, current, glue_data = remove_node(head,current)
+-- head, current = insertnodebefore(head,current,glue_data)
+-- end
+-- end
+-- current = getnext(current)
+-- end
+-- return head
+-- end
+
local stackhead, stacktail, stackhack = nil, nil, false
local function report(message,where,lst)
@@ -2020,6 +2224,8 @@ setnext(glue_data)
-- ugly code: we get partial lists (check if this stack is still okay) ... and we run
-- into temp nodes (sigh)
+ -- this really need a rework
+
local forceflush = false
function vspacing.pagehandler(newhead,where)
@@ -2027,26 +2233,27 @@ setnext(glue_data)
local newtail = find_node_tail(newhead) -- best pass that tail, known anyway
local flush = false
stackhack = true -- todo: only when grid snapping once enabled
- -- todo: fast check if head = tail
- for n, id, subtype in nextnode, newhead do -- we could just look for glue nodes
+
+ for n, id, subtype in nextnode, newhead do
if id ~= glue_code then
flush = true
elseif subtype == userskip_code then
- if getattr(n,a_skipcategory) then
+ -- local sc = getattr(n,a_skipcategory)
+ local sc = getspecification(n)
+ if sc then
stackhack = true
else
flush = true
end
elseif subtype == parskip_code then
-- if where == new_graf then ... end
- if texgetcount("c_spac_vspacing_ignore_parskip") > 0 then
- -- texsetcount("c_spac_vspacing_ignore_parskip",0)
+ if texgetcount(c_spac_vspacing_ignore_parskip) > 0 then
setglue(n)
-- maybe removenode
end
end
end
- texsetcount("c_spac_vspacing_ignore_parskip",0)
+ texsetcount(c_spac_vspacing_ignore_parskip,0)
if forceflush then
forceflush = false
@@ -2101,18 +2308,16 @@ setnext(glue_data)
forceflush = true
end
- local ignore = table.tohash {
- "split_keep",
- "split_off",
- -- "vbox",
+ local ignored = table.tohash {
+ "splitkeep",
+ "splitoff",
+-- "insert",
}
function vspacing.vboxhandler(head,where)
- if head and not ignore[where] and getnext(head) then
- if getnext(head) then -- what if a one liner and snapping?
- head = collapser(head,"vbox",where,trace_vbox_vspacing,true,a_snapvbox) -- todo: local snapper
- return head
- end
+ if head and not ignored[where] and getnext(head) then
+-- if getid(head) == glue_code and getsubtype(head) == topskip_code then
+ head = collapser(head,"vbox",where,trace_vbox_vspacing,true,a_snapvbox) -- todo: local snapper
end
return head
end
@@ -2154,7 +2359,9 @@ do
enabled = v
end)
- local ignoredepth = -65536000
+ local function ignoredepth()
+ return texgetdimen("ignoredepthcriterium") -- -65536000
+ end
-- A previous version analyzed the number of lines moved to the next page in
-- synchronizepage because prevgraf is unreliable in that case. However, we cannot
@@ -2166,7 +2373,7 @@ do
function vspacing.getnofpreviouslines(head)
if enabled then
if not thead then
- head = texlists.page_head
+ head = texlists.pagehead
end
local noflines = 0
if head then
@@ -2217,35 +2424,38 @@ do
if trace then
local newdepth = outer.prevdepth
local olddepth = newdepth
- if not texlists.page_head then
- newdepth = ignoredepth
- texset("prevdepth",ignoredepth)
- outer.prevdepth = ignoredepth
+ if not texlists.pagehead then
+ newdepth = ignoredepth()
+ texset("prevdepth",newdepth)
+ outer.prevdepth = newdepth
end
report("page %i, prevdepth %p => %p",texgetcount("realpageno"),olddepth,newdepth)
-- report("list %s",nodes.idsandsubtypes(head))
else
- if not texlists.page_head then
- texset("prevdepth",ignoredepth)
- outer.prevdepth = ignoredepth
+ if not texlists.pagehead then
+ local newdepth = ignoredepth()
+ texset("prevdepth",newdepth)
+ outer.prevdepth = newdepth
end
end
end
end
- local trace = false
- local last = nil
- local vmode_code = tex.modelevels.vertical
- local temp_code = nodecodes.temp
- local getnest = tex.getnest
- local getlist = tex.getlist
+ local trace = false
+ local abs = math.abs
+ -- local last = nil
+ local vmode_code = tex.modelevels.vertical
+ local temp_code = nodecodes.temp
+ local texgetnest = tex.getnest
+ local texgetlist = tex.getlist
+ local getnodetail = nodes.tail
- trackers.register("vspacing.forcestrutdepth",function(v) trace = v end)
+ -- trackers.register("vspacing.forcestrutdepth",function(v) trace = v end)
-- abs : negative is inner
function vspacing.checkstrutdepth(depth)
- local nest = getnest()
+ local nest = texgetnest()
if abs(nest.mode) == vmode_code and nest.head then
local tail = nest.tail
local id = tail.id
@@ -2254,10 +2464,10 @@ do
tail.depth = depth
end
nest.prevdepth = depth
- elseif id == temp_code and getnest("ptr") == 0 then
- local head = getlist("page_head")
+ elseif id == temp_code and texgetnest("ptr") == 0 then
+ local head = texgetlist("pagehead")
if head then
- tail = nodes.tail(head)
+ tail = getnodetail(head)
if tail and tail.id == hlist_code then
if tail.depth < depth then
tail.depth = depth
@@ -2277,69 +2487,234 @@ do
actions = vspacing.checkstrutdepth,
}
- function vspacing.forcestrutdepth(n,depth,trace_mode,plus)
- local box = texgetbox(n)
- if box then
- box = tonut(box)
- local head = getlist(box)
- if head then
- local tail = find_node_tail(head)
- if tail then
- if getid(tail) == hlist_code then
- local dp = getdepth(tail)
- if dp < depth then
- setdepth(tail,depth)
- outer.prevdepth = depth
- if trace or trace_mode > 0 then
- nuts.setvisual(tail,"depth")
+ -- function vspacing.forcestrutdepth(n,depth,trace_mode,plus)
+ -- local box = texgetbox(n)
+ -- if box then
+ -- box = tonut(box)
+ -- local head = getlist(box)
+ -- if head then
+ -- local tail = find_node_tail(head)
+ -- if tail then
+ -- if getid(tail) == hlist_code then
+ -- local dp = getdepth(tail)
+ -- if dp < depth then
+ -- setdepth(tail,depth)
+ -- outer.prevdepth = depth
+ -- if trace or trace_mode > 0 then
+ -- nuts.setvisual(tail,"depth")
+ -- end
+ -- end
+ -- end
+ -- -- last = nil
+ -- -- if plus then
+ -- -- -- penalty / skip ...
+ -- -- local height = 0
+ -- -- local sofar = 0
+ -- -- local same = false
+ -- -- local seen = false
+ -- -- local list = { }
+ -- -- last = nil
+ -- -- while tail do
+ -- -- local id = getid(tail)
+ -- -- if id == hlist_code or id == vlist_code then
+ -- -- local w, h, d = getwhd(tail)
+ -- -- height = height + h + d + sofar
+ -- -- sofar = 0
+ -- -- last = tail
+ -- -- elseif id == kern_code then
+ -- -- sofar = sofar + getkern(tail)
+ -- -- elseif id == glue_code then
+ -- -- if seen then
+ -- -- sofar = sofar + getwidth(tail)
+ -- -- seen = false
+ -- -- else
+ -- -- break
+ -- -- end
+ -- -- elseif id == penalty_code then
+ -- -- local p = getpenalty(tail)
+ -- -- if p >= 10000 then
+ -- -- same = true
+ -- -- seen = true
+ -- -- else
+ -- -- break
+ -- -- end
+ -- -- else
+ -- -- break
+ -- -- end
+ -- -- tail = getprev(tail)
+ -- -- end
+ -- -- texsetdimen("global","d_spac_prevcontent",same and height or 0)
+ -- -- end
+ -- end
+ -- end
+ -- end
+ -- end
+
+ local hlist_code = nodes.nodecodes.hlist
+ local insert_code = nodes.nodecodes.insert
+ local mark_code = nodes.nodecodes.mark
+ local line_code = nodes.listcodes.line
+
+ -- local nuts = nodes.nuts
+ -- local getid = nuts.getid
+ -- local getsubtype = nuts.getsubtype
+ -- local getdepth = nuts.getdepth
+ -- local setdepth = nuts.setdepth
+ local gettotal = nuts.gettotal
+ local getspeciallist = nuts.getspeciallist
+ local setspeciallist = nuts.setspeciallist
+
+ local triggerbuildpage = tex.triggerbuildpage
+
+ -- local texgetdimen = tex.getdimen
+ -- local texsetdimen = tex.setdimen
+ local texgetnest = tex.getnest
+ -- local texget = tex.get
+ -- local texset = tex.set
+
+ local trace = false trackers.register("otr.forcestrutdepth", function(v)
+ trace = v and function(n)
+ setvisual(nuts.tonut(n),nodes.visualizers.modes.depth)
+ end
+ end)
+
+ local treversenode = nuts.treversers.node
+
+ local function flushcontributions()
+ if texgetnest("ptr") == 0 then
+ -- this flushes the contributions
+ local prev = nil
+ local cycle = 1
+ while cycle <= 10 do
+ local head = getspeciallist("contributehead")
+ if head == prev then
+ -- This can happen .. maybe 10 is already too much ... e.g.
+ -- extreme side float case in m4all.
+ cycle = cycle + 1
+ else
+ triggerbuildpage()
+ prev = head
+ end
+ end
+ return true
+ else
+ return false
+ end
+ end
+
+ vspacing.flushcontributions = flushcontributions
+
+ function vspacing.forcestrutdepth()
+ -- check if in mvl
+ if flushcontributions() then
+ -- now we consult the last line (if present)
+ local head, tail = getspeciallist("pagehead")
+ if tail then
+ for n, id, subtype in treversenode, tail do
+ if id == hlist_code then
+ if subtype == line_code then
+ local strutdp = texgetdimen(d_strutdp)
+ local delta = strutdp - getdepth(n)
+ if delta > 0 then
+ setdepth(n,strutdp)
+ texset("pagetotal",texget("pagetotal") + delta)
+ texset("pagedepth",strutdp)
+ if trace then
+ trace(n)
+ end
end
end
+ break
+ elseif id == insert_code or id == mark_code then
+ -- prev
+ else
+ break
end
- last = nil
- if plus then
- -- penalty / skip ...
- local height = 0
- local sofar = 0
- local same = false
- local seen = false
- local list = { }
- last = nil
- while tail do
- local id = getid(tail)
- if id == hlist_code or id == vlist_code then
- local w, h, d = getwhd(tail)
- height = height + h + d + sofar
- sofar = 0
- last = tail
- elseif id == kern_code then
- sofar = sofar + getkern(tail)
- elseif id == glue_code then
- if seen then
- sofar = sofar + getwidth(tail)
- seen = false
- else
- break
- end
- elseif id == penalty_code then
- local p = getpenalty(tail)
- if p >= 10000 then
- same = true
- seen = true
+ end
+ end
+ else
+ local nest = texgetnest()
+ -- if abs(nest.mode) == vmode_code and nest.head then
+ local tail = nest.tail
+ if tail.id == hlist_code and tail.subtype == line_code then
+ local strutdp = texgetdimen(d_strutdp)
+ if tail.depth < strutdp then
+ tail.depth = strutdp
+ end
+ nest.prevdepth = strutdp
+ if trace then
+ trace(tail)
+ end
+ end
+ -- end
+ end
+ end
+
+ -- highly experimental, only for m4all now; todo: tracing
+
+ local setbox = nuts.setbox
+
+ function vspacing.interceptsamepagecontent(box)
+ if vspacing.flushcontributions() then
+ -- now we consult the last line (if present)
+ local head, tail = getspeciallist("pagehead")
+ if tail and getid(tail) == glue_code then
+ local prev = getprev(tail)
+ if prev and getid(prev) == penalty_code then
+ if getpenalty(prev) >= 10000 then
+ local state = nil
+ local first = nil
+ local last = tail
+ local c = getprev(prev)
+ while c do
+ if getid(c) == glue_code then
+ local p = getprev(c)
+ if p and getid(p) == penalty_code then
+ if getpenalty(p) < 10000 then
+ state = 1
+ end
else
+ state = 2
break
end
- else
- break
end
- tail = getprev(tail)
+ first = c
+ c = getprev(c)
+ end
+ if first and first ~= head then
+ setnext(getprev(first))
+ setprev(first)
+ local vbox = vpack_node(first)
+ setvisual(vbox)
+ setbox(box,vbox)
+ report_vspacing("same page intercept, case %i")
end
- texsetdimen("global","d_spac_prevcontent",same and height or 0)
end
end
end
end
end
+ interfaces.implement {
+ name = "interceptsamepagecontent",
+ arguments = "integer",
+ actions = vspacing.interceptsamepagecontent,
+ }
+
+ -- interfaces.implement {
+ -- name = "removelastline",
+ -- actions = function()
+ -- local h, t = getspeciallist("pagehead")
+ -- if t and getid(t) == hlist_code and getsubtype(t) == line_code then
+ -- local total = gettotal(t)
+ -- h = remove_node(h,t,true)
+ -- setspeciallist(h)
+ -- texset("pagetotal",texget("pagetotal") - total)
+ -- -- set prevdepth
+ -- end
+ -- end
+ -- }
+
function vspacing.pushatsame()
-- needs better checking !
if last then -- setsplit
@@ -2390,18 +2765,25 @@ do
scope = "private"
}
- implement {
- name = "forcestrutdepth",
- arguments = { "integer", "dimension", "integer" },
- actions = vspacing.forcestrutdepth,
- scope = "private"
- }
+ -- implement {
+ -- name = "forcestrutdepth",
+ -- arguments = { "integer", "dimension", "integer" },
+ -- actions = vspacing.forcestrutdepth,
+ -- scope = "private"
+ -- }
+
+ -- implement {
+ -- name = "forcestrutdepthplus",
+ -- arguments = { "integer", "dimension", "integer", true },
+ -- actions = vspacing.forcestrutdepth,
+ -- scope = "private"
+ -- }
implement {
- name = "forcestrutdepthplus",
- arguments = { "integer", "dimension", "integer", true },
+ name = "forcestrutdepth",
+ public = true,
+ protected = true,
actions = vspacing.forcestrutdepth,
- scope = "private"
}
implement {
@@ -2464,10 +2846,10 @@ do
-- interfaces.implement {
-- name = "fakenextstrutline",
-- actions = function()
- -- local head = texlists.page_head
+ -- local head = texlists.pagehead
-- if head then
-- local head = remove_node(head,find_node_tail(head),true)
- -- texlists.page_head = head
+ -- texlists.pagehead = head
-- buildpage()
-- end
-- end
@@ -2476,13 +2858,13 @@ do
implement {
name = "removelastline",
actions = function()
- local head = texlists.page_head
+ local head = texlists.pagehead
if head then
local tail = find_node_tail(head)
if tail then
-- maybe check for hlist subtype 1
local head = remove_node(head,tail,true)
- texlists.page_head = head
+ texlists.pagehead = head
buildpage()
end
end
@@ -2492,7 +2874,7 @@ do
implement {
name = "showpagelist", -- will improve
actions = function()
- local head = texlists.page_head
+ local head = texlists.pagehead
if head then
print("start")
while head do
@@ -2514,3 +2896,14 @@ do
}
end
+
+do
+
+ implement {
+ name = "injectzerobaselineskip",
+ protected = true,
+ public = true,
+ actions = { nodes.pool.baselineskip, context },
+ }
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/spac-ver.mkxl b/Master/texmf-dist/tex/context/base/mkxl/spac-ver.mkxl
index d116113399d..640d493b961 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/spac-ver.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/spac-ver.mkxl
@@ -15,7 +15,23 @@
\unprotect
-\registerctxluafile{spac-ver}{autosuffix,optimize}
+\newgluespec\bodyfontlineheight % why a skip
+\newdimen \bodyfontstrutheight
+\newdimen \bodyfontstrutdepth
+
+\newgluespec\globalbodyfontlineheight % why a skip
+\newdimen \globalbodyfontstrutheight
+\newdimen \globalbodyfontstrutdepth
+
+\newgluespec \s_spac_vspacing_predefined
+\newdimension\d_spac_overlay
+\newinteger \c_spac_vspacing_ignore_parskip
+
+% \overloaded\let\strutht \undefined \newdimen\strutht % already defined
+% \overloaded\let\strutdp \undefined \newdimen\strutdp
+% \overloaded\let\struthtdp\undefined \newdimen\struthtdp
+
+\registerctxluafile{spac-ver}{autosuffix}
% todo: use usernodes ?
@@ -59,7 +75,7 @@
\newif\iflocalinterlinespace
-\newskip \s_spac_vspacing_temp \s_spac_vspacing_temp\bigskipamount
+\newgluespec\s_spac_vspacing_temp \s_spac_vspacing_temp\bigskipamount
\mutable\def\skipfactor {.75}
\mutable\def\skipgluefactor{.25}
@@ -73,7 +89,7 @@
\relax}
\ifdefined\bodyfontinterlinespace \else
- \let\bodyfontinterlinespace\empty
+ \lettonothing\bodyfontinterlinespace
\fi
\permanent\protected\def\presetnormallineheight % each bodyfont
@@ -97,6 +113,7 @@
\edef\minimumlinedistance {\interlinespaceparameter\c!distance }%
\edef\normallineheight {\interlinespaceparameter\c!line }%
\edef\topskipfactor {\interlinespaceparameter\c!top }%
+ \edef\ntopskipfactor {\interlinespaceparameter\c!ntop }%
\edef\maxdepthfactor {\interlinespaceparameter\c!bottom }%
\edef\m_spac_vertical_baseline_stretch_factor{\interlinespaceparameter\c!stretch}%
\edef\m_spac_vertical_baseline_shrink_factor {\interlinespaceparameter\c!shrink }%
@@ -109,12 +126,13 @@
\installcorenamespace{interlinespacerelative}
-\aliased\let\setrelativeinterlinespace \relax % used elsewhere
-\mutable\let\currentrelativeinterlinespace\empty
+\aliased\let\setrelativeinterlinespace\relax % used elsewhere
+
+\mutable\lettonothing\currentrelativeinterlinespace
\defcsname\??interlinespacerelative\v!on \endcsname{\oninterlineskip}
\defcsname\??interlinespacerelative\v!off \endcsname{\offinterlineskip}
-\defcsname\??interlinespacerelative\v!reset\endcsname{\enforced\let\currentrelativeinterlinespace\empty
+\defcsname\??interlinespacerelative\v!reset\endcsname{\enforced\lettonothing\currentrelativeinterlinespace
\enforced\let\setrelativeinterlinespace\relax
\setfontparameters}
\defcsname\??interlinespacerelative\v!auto \endcsname{\enforced\let\setrelativeinterlinespace\spac_linespacing_set_relative_interlinespace}
@@ -230,10 +248,10 @@
%D Helpers
-\newskip \s_spac_lastskip
-\newdimen\d_spac_prevdepth
-\newcount\c_spac_spacefactor
-\newdimen\d_spac_prevcontent % set by lua
+\newgluespec \s_spac_lastskip
+\newdimension\d_spac_prevdepth
+\newinteger \c_spac_spacefactor
+%newdimension\d_spac_prevcontent % set by lua (no longer it seems)
% \permanent\overloaded\protected\def\removelastskip
% {\ifvmode\ifzeropt\lastskip\else\vskip-\lastskip\fi\fi}
@@ -339,7 +357,7 @@
\installcorenamespace{whitespacemethod}
-\newskip \s_spac_whitespace_parskip \s_spac_whitespace_parskip\zeropoint
+\newgluespec \s_spac_whitespace_parskip \s_spac_whitespace_parskip\zeropoint
\newconditional\c_spac_whitespace_flexible \settrue\c_spac_whitespace_flexible
\newconstant \c_spac_whitespace_grid_mode % option in layout / 1=permit_half_lines
@@ -419,8 +437,8 @@
{\ifcsname\??whitespacemethod#1\endcsname
\lastnamedcs
\else
- \s_spac_whitespace_parskip#1\fi
- \relax}
+ \s_spac_whitespace_parskip#1%
+ \fi\relax}
\permanent\protected\def\forgetparskip
{\s_spac_whitespace_parskip\zeropoint
@@ -447,10 +465,10 @@
% todo: when packed blocks blank, we need to enable forced
\newconditional\c_spac_packed_blank \settrue\c_spac_packed_blank
-\newcount \c_spac_packed_level
+\newinteger \c_spac_packed_level
\permanent\tolerant\protected\def\startpacked[#1]%
- {\global\advance\c_spac_packed_level\plusone
+ {\global\advanceby\c_spac_packed_level\plusone
\par
\ifnum\c_spac_packed_level=\plusone \ifvmode
\begingroup
@@ -465,7 +483,7 @@
\ifnum\c_spac_packed_level=\plusone \ifvmode
\endgroup
\fi \fi
- \global\advance\c_spac_packed_level\minusone}
+ \global\advanceby\c_spac_packed_level\minusone}
\permanent\protected\def\startunpacked
{\directdefaultvspacing % \blank
@@ -488,17 +506,18 @@
\installtextracker
{linecorrection.boxes}
- {\letfrozen\let\spac_lines_vbox\ruledvbox}
- {\letfrozen\let\spac_lines_vbox\vbox}
+ {\enforced\let\spac_lines_vbox\ruledvbox}
+ {\enforced\let\spac_lines_vbox\vbox}
\let\v_spac_lines_around_action_set\relax
-\let\m_spac_lines_around \empty
+
+\lettonothing\m_spac_lines_around
\newconstant\c_spac_lines_correction_mode
-\setvalue{\??linesaround\v!blank }{\blank}
-\letvalue{\??linesaround\empty }\relax
-\setvalue{\??linesaround\s!unknown}{\directcheckedvspacing\m_spac_lines_around} % \blank[\m_spac_lines_around]}
+\defcsname\??linesaround\v!blank \endcsname{\blank}
+\letcsname\??linesaround\empty \endcsname\relax
+\defcsname\??linesaround\s!unknown\endcsname{\directcheckedvspacing\m_spac_lines_around} % \blank[\m_spac_lines_around]}
\def\spac_lines_action_around % we used to let this one but it's cleaner this way
{\csname\??linesaround % i.e. do it twice
@@ -639,17 +658,17 @@
%D that can be prevented with \type {\dontleavehmode}. Never use \type
%D {\leavevmode}!
-\newdimen\strutdimen
-\newdimen\lineheight
-\newdimen\openlineheight
-\newdimen\openstrutheight
-\newdimen\openstrutdepth
-\newdimen\topskipgap
+\newdimension\strutdimen % not used
+\newdimension\lineheight
+\newdimension\openlineheight
+\newdimension\openstrutheight
+\newdimension\openstrutdepth
+\newdimension\topskipgap
-\newdimen\strutheight
-\newdimen\strutdepth
-\newdimen\struttotal
-\newdimen\strutwidth
+\newdimension\strutheight
+\newdimension\strutdepth
+\newdimension\struttotal
+\newdimension\strutwidth
\let\m_spac_vertical_baseline_stretch_factor \zerocount
\let\m_spac_vertical_baseline_shrink_factor \zerocount
@@ -659,6 +678,7 @@
\mutable\def\baselinefactor {2.8}
\mutable\def\topskipfactor {1.0}
\mutable\def\maxdepthfactor {0.5}
+\mutable\let\ntopskipfactor \minusone
\mutable\def\minimumstrutheight {\zeropoint}
\mutable\def\minimumstrutdepth {\zeropoint}
@@ -672,7 +692,7 @@
\mutable\def\systemmaxdepthfactor{\maxdepthfactor}
\ifdefined\globalbodyfontsize \else
- \newdimen\globalbodyfontsize
+ \newdimension\globalbodyfontsize
\globalbodyfontsize=12pt
\fi
@@ -699,12 +719,17 @@
\else
\systemtopskipfactor\globalbodyfontsize
\ifcase\bottomraggednessmode % ragged bottom
- \s!plus5\globalbodyfontsize
+ \s!plus
+ \ifnum\ntopskipfactor<\zerocount
+ 5\globalbodyfontsize % old hard coded value
+ \else
+ \ntopskipfactor\openlineheight
+ \fi
\fi
\fi
%\relax
\topskipgap\topskip
- \advance\topskipgap -\openstrutheight\relax
+ \advanceby\topskipgap -\openstrutheight\relax
\ifdim\minimumstrutheight>\zeropoint
\ifdim\topskip<\minimumstrutheight
\topskip\minimumstrutheight\relax
@@ -718,9 +743,9 @@
\permanent\protected\def\setmaxdepth
{\maxdepth\systemmaxdepthfactor\globalbodyfontsize}
-\newskip \usedbaselineskip % These used to be \normal... but that isn't pretty
-\newskip \usedlineskip % in the token interface, so thes few now have new
-\newdimen\usedlineskiplimit % names. They are public but not really user commands.
+\newgluespec \usedbaselineskip % These used to be \normal... but that isn't pretty
+\newgluespec \usedlineskip % in the token interface, so these few now have new
+\newdimension\usedlineskiplimit % names. They are public but not really user commands.
\permanent\protected\def\normalbaselines
{\baselineskip \usedbaselineskip
@@ -789,6 +814,8 @@
%D \starttyping
%D \rm \saveinterlinespace .... {\ss \restoreinterlinespace .... \endgraf}
%D \stoptyping
+%D
+%D This is no longer needed.
\aliased\let\restoreinterlinespace\relax
@@ -818,22 +845,20 @@
%D
%D But we do things differently.
-\newbox\strutbox
+\newbox\b_strut_box
+\newbox\b_strut_tmp
-\setbox\strutbox\hpack{\vrule\s!height8.5pt\s!depth3.5pt\s!width\zeropoint} % just a start
-
-% \permanent\protected\def\strut{\relax\ifmmode\copy\else\unhcopy\fi\strutbox}
-%
-% \protected\def\strut
-% {\relax
-% \ifmmode\copy\else\dontleavehmode\unhcopy\fi\strutbox}
-%
-% \aliased\let\normalstrut\strut
+\permanent\protected\def\strutbox % not to be used but this is sort of an alias
+ {\beginlocalcontrol
+ \setbox\b_strut_tmp\hpack{\normalsrule\s!height\strutht\s!depth\strutdp}% just a start
+ \endlocalcontrol
+ \b_strut_tmp}
%D The double \type {\hbox} construction enables us to backtrack boxes.
-\overloaded\let\strutht\undefined \newdimen\strutht
-\overloaded\let\strutdp\undefined \newdimen\strutdp
+% \overloaded\let\strutht \undefined \newdimension\strutht % see above
+% \overloaded\let\strutdp \undefined \newdimension\strutdp
+% \overloaded\let\struthtdp\undefined \newdimension\struthtdp
\permanent\protected\def\setstrut
{\ifgridsnapping
@@ -877,9 +902,9 @@
\dosetstrut}
\permanent\protected\def\setcharstrut#1%
- {\setbox\strutbox\hbox{#1}% no \hpack, in case we have smallcaps
- \strutht\ht\strutbox
- \strutdp\dp\strutbox
+ {\setbox\b_strut_box\hbox{#1}% no \hpack, in case we have smallcaps
+ \strutht\ht\b_strut_box
+ \strutdp\dp\b_strut_box
\dosetstrut}
\permanent\protected\def\settightstrut
@@ -896,13 +921,17 @@
\permanent\protected\def\charhtstrut
{\begingroup
\setcharstrut{GJY}%
- \vrule\s!width\zeropoint\s!depth\zeropoint\s!height\strutht
+ \normalsrule
+ \s!depth \zeropoint
+ \s!height\strutht
\endgroup}
\permanent\protected\def\chardpstrut
{\begingroup
\setcharstrut{gjy}%
- \vrule\s!width\zeropoint\s!depth\strutdp\s!height\zeropoint
+ \normalsrule
+ \s!depth \strutdp
+ \s!height\zeropoint
\endgroup}
%D Because of all the callbacks in mkiv, we avoid unnecessary boxes ... maybe use an
@@ -912,143 +941,82 @@
\permanent\protected\def\dosetstrut
{\enforced\let\strut\normalstrut
- \ifabsnum\dimexpr\strutht+\strutdp-\lineheight\relax<\plustwo
+ \struthtdp\dimexpr\strutht+\strutdp\relax
+ \ifabsnum\dimexpr\struthtdp-\lineheight\relax<\plustwo
% compensate rounding error /- 1sp to avoid too many
% 1sp baselineskips in for instance verbatim
% \strutht\dimexpr\lineheight-\strutdp\relax
% better:
\strutdp\dimexpr\lineheight-\strutht\relax
- \struttotal\lineheight
- \else
- \struttotal\dimexpr\strutht+\strutdp\relax
+ \struthtdp\lineheight
\fi
\strutheight\strutht
\strutdepth \strutdp
- \ifdim\strutwidth=\zeropoint
- \spac_struts_set_hide
- \else
- \spac_struts_set_vide
- \fi}
-
-\def\spac_struts_set_hide
- {\setbox\strutbox\hpack
- {\vrule
- \s!width \zeropoint
- \s!height\strutht
- \s!depth \strutdp}}
+ \struttotal \struthtdp}
\newconstant\c_strut_visual_mode
-\def\spac_struts_set_vide
- {\setbox\strutbox\hpack % at some time this extra wrapping was needed
- {\spac_struts_vide_hbox to \zeropoint
- {\ifcase\c_strut_visual_mode
- \spac_struts_black
- \or
- \spac_struts_color
- \else
- \spac_struts_black
- \fi}}}
-
-\def\spac_struts_black
- {\vrule
- \s!width \strutwidth
- \s!height\strutht
- \s!depth \strutdp
- \hss}
-
-\def\spac_struts_color
- {\hss % new, will be option
- \scratchwidth.1\struthtdp
- \begingroup
- \directcolor[f:b:t]%
- \vrule
- \s!width \scratchwidth
- \s!height\strutht
- \s!depth \strutdp
- \kern-\scratchwidth
- \vrule
- \s!width \scratchwidth
- \s!height\zeropoint
- \s!depth \strutdp
- \endgroup
- \kern-.625\scratchwidth
- \vrule
- \s!width .25\scratchwidth
- \s!height\strutht
- \s!depth \strutdp
- \hss}
-
-\let\spac_struts_vide_hbox\hbox % overloaded in trac-vis.mkiv
-
%D The dimen \type {\struttotal} holds the exact size of the strut; occasionally a
%D one scaled point difference can show up with the lineheight. This is more
%D efficient (less callbacks):
-\newbox\b_spac_struts_empty \setbox\b_spac_struts_empty\emptyhbox
-
-\def\spac_struts_set_hide
- {\setbox\strutbox\copy\b_spac_struts_empty
- \ht\strutbox\strutht
- \dp\strutbox\strutdp}
-
\permanent\protected\def\strut % still callbacks for \hbox{\strut}
{\relax
\dontleavehmode
- \copy\strutbox}
-
-% \protected\def\strut % slightly faster
-% {\relax
-% \ifmmode\copy\else\dontleavehmode\unhcopy\fi\strutbox}
+ \normalsrule
+ \s!height\strutht
+ \s!depth \strutdp
+ \relax}
\aliased\let\normalstrut\strut
\permanent\protected\def\halfstrut
{\relax
\dontleavehmode
- \begingroup
- \setbox\scratchbox\copy\strutbox
- \ht\scratchbox\dimexpr\strutht/\plustwo\relax
- \dp\scratchbox\dimexpr\strutdp/\plustwo\relax
- \box\scratchbox
- \endgroup}
+ \normalsrule
+ \s!height.5\strutht
+ \s!depth .5\strutdp
+ \relax}
\permanent\protected\def\quarterstrut
{\relax
\dontleavehmode
- \begingroup
- \setbox\scratchbox\copy\strutbox
- \ht\scratchbox\dimexpr\strutht/\plusfour\relax
- \dp\scratchbox\dimexpr\strutdp/\plusfour\relax
- \box\scratchbox
- \endgroup}
+ \normalsrule
+ \s!height.25\strutht
+ \s!depth .25\strutdp
+ \relax}
\permanent\protected\def\depthstrut
{\relax
\dontleavehmode
- \begingroup
- \setbox\scratchbox\copy\strutbox
- \ht\scratchbox\dimexpr\strutht-\struthtdp/\plustwo\relax % assumes that ht > lineheight/2
- \box\scratchbox
- \endgroup}
+ \normalsrule
+ \s!height\dimexpr\strutht-\struthtdp/\plustwo\relax
+ \s!depth \strutdp
+ \relax}
\permanent\protected\def\halflinestrut
{\relax
\dontleavehmode
- \begingroup
- \setbox\scratchbox\copy\strutbox
- \ht\scratchbox\dimexpr\strutht-.5\strutht-.5\strutdp\relax
- \box\scratchbox
- \endgroup}
+ \normalsrule
+ \s!height\dimexpr\strutht-.5\struthtdp\relax
+ \s!depth \strutdp
+ \relax}
\permanent\protected\def\noheightstrut
{\relax
\dontleavehmode
- \begingroup
- \setbox\scratchbox\copy\strutbox
- \ht\scratchbox\zeropoint
- \box\scratchbox
- \endgroup}
+ \normalsrule
+ \s!height\zeropoint
+ \s!depth \strutdp
+ \relax}
+
+\permanent\protected\def\nodepthstrut
+ {\relax
+ \dontleavehmode
+ \normalsrule
+ \s!height\strutht
+ \s!depth \zeropoint
+ \relax}
%D Sometimes a capstrut comes in handy
%D
@@ -1088,32 +1056,16 @@
\fi}
\permanent\protected\def\showstruts % adapts .. is wrong
- {\c_strut_visual_mode\zerocount
- \setteststrut
- \settestcrlf}
-
-\permanent\protected\def\showcolorstruts % adapts .. is wrong
- {\c_strut_visual_mode\plusone
- \setteststrut
+ {\showmakeup[strut]%
\settestcrlf}
-\permanent\protected\def\setteststrut
- {\strutwidth.8\onepoint
- \setstrut}
-
-\permanent\protected\def\dontshowstruts
- {\unsetteststrut
- \settestcrlf}
-
-\permanent\protected\def\unsetteststrut
- {\strutwidth\zeropoint
- \setstrut}
+\aliased\let\showcolorstruts\showstruts
\mutable\def\autostrutfactor{1.1}
\permanent\protected\def\setautostrut
{\begingroup
- \setbox\scratchbox\copy\strutbox
+ \setbox\scratchbox\copy\b_strut_box
\setstrut
\ifdim\strutht>\autostrutfactor\ht\scratchbox
\endgroup \setstrut
@@ -1131,10 +1083,10 @@
{\the\everysetnostrut}
\appendtoks
- \setbox\strutbox\copy\nostrutbox
- \enforced\let\strut \empty
- \enforced\let\endstrut\empty
- \enforced\let\begstrut\empty
+ % \setbox\strutbox\copy\nostrutbox
+ \enforced\lettonothing\strut
+ \enforced\lettonothing\endstrut
+ \enforced\lettonothing\begstrut
\to \everysetnostrut
%D When enabled, sigstruts will remove themselves if nothing goes inbetween. For
@@ -1144,30 +1096,25 @@
\permanent\protected\def\rightboundary {\protrusionboundary\plustwo}
\permanent\protected\def\signalcharacter{\boundary\plusone\char\zerocount\boundary\plustwo} % not the same as strut signals
-\newsignal\d_spac_struts_signal \setfalse\sigstruts
+%D \starttyping
+%D $ \ifhmode H1\fi x \ifhmode H2\fi $\par
+%D $ \ifmmode M1\fi x \ifmmode M2\fi $\par
+%D $$\ifvmode H1\fi x \ifvmode H2\fi$$\par
+%D $$\ifvmode M1\fi x \ifvmode M2\fi$$\par
+%D \stoptyping
\permanent\protected\def\begstrut
- {\relax\ifcase\strutht
- % \ignorespaces % maybe
- \else
- \spac_struts_beg
- \fi}
-
-\def\spac_struts_beg
- {\ifconditional\sigstruts
- \spac_struts_beg_signal
+ {\ifmmode
+ \strut
\else
- \spac_struts_beg_normal
+ \dontleavehmode
+ \ifcase\struthtdp\else
+ \spac_struts_beg
+ \fi
\fi
\ignorespaces}
-\def\spac_struts_beg_signal
- {\noindent\horizontalstrut
- \penalty\plustenthousand
- \hskip-\d_spac_struts_signal
- \hskip\d_spac_struts_signal}
-
-\def\spac_struts_beg_normal
+\def\spac_struts_beg
{\boundary\plusone
\strut
%\boundary\plusone
@@ -1176,36 +1123,22 @@
\hskip\zeropoint}
\permanent\protected\def\endstrut
- {\relax\ifhmode
- \ifcase\strutht
- % \removeunwantedspaces % maybe
- \else
+ {% \ifmmode M\fi
+ % \ifinner I\fi
+ \relax\ifhmode
+ %\removeunwantedspaces
+ \spac_helpers_remove_unwantedspace
+ \ifcase\struthtdp\else
\spac_struts_end
\fi
- \fi}
-
-\def\spac_struts_end
- {\ifconditional\sigstruts
- \spac_struts_end_signal
- \else
- \spac_struts_end_normal
- \fi}
-
-\def\spac_struts_end_signal
- {\ifdim\lastskip=\d_spac_struts_signal
- \unskip
- \unskip
- \unpenalty
- \setbox\scratchbox\lastbox
- \else
- \penalty\plustenthousand
- \hskip\zeropoint
+ \orelse\ifmmode
+ %\removeunwantedspaces hmode only anyway
+ \spac_helpers_remove_unwantedspace
\strut
\fi}
-\def\spac_struts_end_normal
- {\removeunwantedspaces
- \penalty\plustenthousand
+\def\spac_struts_end
+ {\penalty\plustenthousand
%\boundary\plustwo
\hskip\zeropoint
%\boundary\plustwo
@@ -1263,15 +1196,15 @@
\pushoverloadmode
-\overloaded\permanent\protected\def\offinterlineskip
- {\baselineskip-\thousandpoint
+\overloaded\permanent\protected\def\offinterlineskip % later we will overload this with a push pop
+ {\baselineskip \ignoredepthcriterium % -\thousandpoint
\lineskip \zeropoint
\lineskiplimit\maxdimen
% We also need this here now; thanks to taco for figuring that out!
\let\minimumlinedistance\zeropoint}
\overloaded\permanent\protected\def\nointerlineskip
- {\prevdepth-\thousandpoint}
+ {\prevdepth\ignoredepthcriterium}% -\thousandpoint
\aliased\let\normaloffinterlineskip\offinterlineskip % knuth's original
@@ -1346,6 +1279,13 @@
\frozen#1\numexpr#2+\plusone\relax\space\doexpandedrecurse{\the\numexpr#2\relax}{ #3}\zerocount\relax
\fi}
+% to be tested:
+%
+% \permanent\protected\def\setpenalties#1#2#3%
+% {\ifdefined#1% space before #3 prevents lookahead problems, needed when #3=text
+% \frozen#1\numexpr#2+\plusone\relax\space\expandedloop\plusone\numexpr#2\relax\plusone{ #3}\zerocount\relax
+% \fi}
+
%D \macros
%D {keeplinestogether}
%D
@@ -1354,12 +1294,12 @@
% just before margintexts ... will eventually be done differently in mkiv using
% attributes
-\newcount\c_spac_keep_lines_together
+\newinteger\c_spac_keep_lines_together
-\aliased\let\restoreinterlinepenalty\relax
+\permanent\protected\lettonothing\restoreinterlinepenalty
\protected\def\spac_penalties_restore
- {\global\enforced\let\restoreinterlinepenalty\relax
+ {\enforced\protected\glettonothing\restoreinterlinepenalty
\overloaded\global\resetpenalties\interlinepenalties
\global\c_spac_keep_lines_together\zerocount}
@@ -1401,6 +1341,7 @@
\resetpenalties\widowpenalties
\resetpenalties\clubpenalties
\resetpenalties\interlinepenalties
+ \resetpenalties\orphanpenalties
\stopsetups
%D We use \directsetup because it's faster and we know there is no csl:
@@ -1439,12 +1380,13 @@
\directsetup{\systemsetupsprefix\s!reset}
- \setpenalties \widowpenalties \plustwo \maxdimen
- \setpenalties \clubpenalties \plustwo \maxdimen
- \frozen \brokenpenalty \maxdimen
- \frozen \doublehyphendemerits \defaultdoublehyphendemerits
- \frozen \finalhyphendemerits \defaultfinalhyphendemerits
- \frozen \adjdemerits \defaultadjdemerits
+ \setpenalties \widowpenalties \plustwo \maxdimen
+ \setpenalties \clubpenalties \plustwo \maxdimen
+ \setpenalties \orphanpenalties \zerocount
+ \frozen \brokenpenalty \maxdimen
+ \frozen \doublehyphendemerits \defaultdoublehyphendemerits
+ \frozen \finalhyphendemerits \defaultfinalhyphendemerits
+ \frozen \adjdemerits \defaultadjdemerits
\stopsetups
@@ -1452,10 +1394,10 @@
%D To be checked:
-\newbox\b_spac_struts_saved
-
-\permanent\protected\def\savestrut {\setbox\b_spac_struts_saved\copy\strutbox}
-\permanent\protected\def\savedstrut{\copy \b_spac_struts_saved}
+% \newbox\b_spac_struts_saved
+%
+% \permanent\protected\def\savestrut {\setbox\b_spac_struts_saved\copy\b_strut_box}
+% \permanent\protected\def\savedstrut{\copy \b_spac_struts_saved}
%D Good old blank redone:
@@ -1473,13 +1415,13 @@
\installcorenamespace{gridsnapperattributes}
\installcorenamespace{gridsnappersets}
-\newskip \bodyfontlineheight
-\newdimen \bodyfontstrutheight
-\newdimen \bodyfontstrutdepth
+% \newgluespec \bodyfontlineheight % see top
+% \newdimension\bodyfontstrutheight % see top
+% \newdimension\bodyfontstrutdepth % see top
-\newskip \globalbodyfontlineheight % why a skip
-\newdimen \globalbodyfontstrutheight
-\newdimen \globalbodyfontstrutdepth
+% \newgluespec \globalbodyfontlineheight % see top
+% \newdimension\globalbodyfontstrutheight % see top
+% \newdimension\globalbodyfontstrutdepth % see top
\permanent\def\snappedvboxattribute{\ifgridsnapping attr\snapvboxattribute\c_attr_snapmethod\fi}
\permanent\def\setlocalgridsnapping{\ifgridsnapping \c_attr_snapvbox \c_attr_snapmethod\fi}
@@ -1497,7 +1439,7 @@
\ifcsname\??gridsnappersets#1\endcsname\lastnamedcs\else#1\fi}}
\permanent\protected\def\installsnapvalues#1#2%
- {\let\m_spac_snapper\empty
+ {\lettonothing\m_spac_snapper
\rawprocesscommacommand[#2]\spac_grids_expand_snapper
\edef\p_spac_snapper{#1:\m_spac_snapper}%
\ifcsname\??gridsnapperattributes\p_spac_snapper\endcsname
@@ -1633,6 +1575,18 @@
\synchronizelocallinespecs
\to \everysetuplocalinterlinespace
+%D More might be added here:
+
+\def\restoreglobalinterlinespace
+ {\mutable\let\normallineheight\globalbodyfontlineheight
+ \bodyfontlineheight \globalbodyfontlineheight
+ \bodyfontstrutheight\globalbodyfontstrutheight
+ \bodyfontstrutdepth \globalbodyfontstrutdepth}
+
+% \appendtoks
+% \restoreglobalinterlinespace % done elsewhere
+% \to \everybeforepagebody
+
%D We still have to synchronize these:
\permanent\protected\def\synchronizeskipamounts
@@ -1641,8 +1595,8 @@
\s!plus\skipgluefactor\baselineskip
\s!minus\skipgluefactor\baselineskip
\relax
- \medskipamount \bigskipamount \divide\medskipamount \plustwo
- \smallskipamount\bigskipamount \divide\smallskipamount\plusfour}
+ \medskipamount \bigskipamount \divideby\medskipamount \plustwo
+ \smallskipamount\bigskipamount \divideby\smallskipamount\plusfour}
%D Snapping.
@@ -1705,14 +1659,15 @@
\permanent\protected\def\setupgridsnapping[#1]% less overhead than setuplayout (needs testing)
{\setlayoutparameter\c!grid{#1}\synchronizegridsnapping}
-\mutable\let\checkedgridmethod\empty % these can become private
-\mutable\let\checkedgridscope \v!local % these can become private
+\mutable\lettonothing\checkedgridmethod % this can become private
+
+\mutable\let\checkedgridscope\v!local % this can become private
\permanent\protected\def\checkgridmethod#1%
{\edef\p_grid{#1}%
\ifempty\p_grid
- \let\checkedgridmethod\empty
- \let\checkedgridscope \v!local
+ \lettonothing\checkedgridmethod
+ \let\checkedgridscope\v!local
\else
\splitatcolon\p_grid\checkedgridscope\checkedgridmethod
\ifempty\checkedgridmethod
@@ -1908,7 +1863,7 @@
{\c_attr_skipcategory\pluseleven}
%permanent\def\vspacingfromscratchtoks {\scratchdimen\dimexpr\csname\??vspacingamount\the\scratchtoks\endcsname\relax}
-\permanent\def\vspacingpredefinedvalue#1{\scratchskip\glueexpr\csname\??vspacingamount#1\endcsname\relax}
+\permanent\def\vspacingpredefinedvalue#1{\s_spac_vspacing_predefined\glueexpr\csname\??vspacingamount#1\endcsname\relax}
%permanent\def\vspacingfromtempstring {\scratchdimen\dimexpr\csname\??vspacingamount\tempstring\endcsname\relax}
% \installcorenamespace{vspacingamountnormal}
@@ -1928,33 +1883,33 @@
%D The injector code (generated at the \LUA\ end). This will go away!
-\newtoks\everybeforeblankhandling
-\newtoks\everyafterblankhandling
-
-\newconditional\c_space_vspacing_done
-\newconditional\c_space_vspacing_fixed
-\newconditional\c_space_ignore_parskip
-
-\appendtoks
- \s_spac_vspacing_temp\zeropoint
- \c_attr_skipcategory\plusone
- \c_attr_skippenalty \attributeunsetvalue
- \c_attr_skiporder \attributeunsetvalue
- \ifgridsnapping
- \settrue\c_space_vspacing_fixed
- \else
- \setfalse\c_space_vspacing_fixed
- \fi
-\to \everybeforeblankhandling
-
-\appendtoks
- \s_spac_vspacing_temp\plusone\s_spac_vspacing_temp
- \ifconditional\c_space_vspacing_fixed \else
- \s!plus \skipgluefactor\s_spac_vspacing_temp
- \s!minus\skipgluefactor\s_spac_vspacing_temp
- \fi
- \relax
-\to \everyafterblankhandling
+% \newtoks\everybeforeblankhandling
+% \newtoks\everyafterblankhandling
+%
+% \newconditional\c_space_vspacing_done
+% \newconditional\c_space_vspacing_fixed
+% \newconditional\c_space_ignore_parskip
+%
+% \appendtoks
+% \s_spac_vspacing_temp\zeropoint
+% \c_attr_skipcategory\plusone
+% \c_attr_skippenalty \attributeunsetvalue
+% \c_attr_skiporder \attributeunsetvalue
+% \ifgridsnapping
+% \settrue\c_space_vspacing_fixed
+% \else
+% \setfalse\c_space_vspacing_fixed
+% \fi
+% \to \everybeforeblankhandling
+%
+% \appendtoks
+% \s_spac_vspacing_temp\plusone\s_spac_vspacing_temp
+% \ifconditional\c_space_vspacing_fixed \else
+% \s!plus \skipgluefactor\s_spac_vspacing_temp
+% \s!minus\skipgluefactor\s_spac_vspacing_temp
+% \fi
+% \relax
+% \to \everyafterblankhandling
% The main spacer:
@@ -2067,8 +2022,6 @@
%D used in itemize \unknown\ always test this:
-\newdimen\d_spac_overlay
-
\def\spac_overlay_lines
{\directcheckedvspacing{\v!back,\v!overlay}% \blank[\v!back,\v!overlay]%
\nointerlineskip}
@@ -2112,9 +2065,9 @@
\definevspacing[\s!default] [\v!white] % was big for a while
-\newcount\c_spac_vspacing_special_base \c_spac_vspacing_special_base = 32250 % 4000
-\newcount\c_spac_vspacing_special_step \c_spac_vspacing_special_step = 10 % 250
-\newcount\c_spac_vspacing_special_done
+\newinteger\c_spac_vspacing_special_base \c_spac_vspacing_special_base = 32250 % 4000
+\newinteger\c_spac_vspacing_special_step \c_spac_vspacing_special_step = 10 % 250
+\newinteger\c_spac_vspacing_special_done
% 2019-05-31 : upgraded a bit to more distinctive samepage-[level]-[0|1|2] names
@@ -2190,10 +2143,10 @@
\defcsname\??vspace#1:#2\endcsname{#3}%
\fi}
-\letvalue{\??vspace:\s!unknown}\zeropoint
+\letcsname\??vspace:\s!unknown\endcsname\zeropoint
\def\spac_vspace_unknown
- {\csname\??vspace:\s!unknown\endcsname}
+ {\csname\??vspace:\s!unknown\endcsname} % why not a let?
\permanent\tolerant\protected\def\vspace[#1]#*[#2]%
{\par
@@ -2235,12 +2188,12 @@
\c!location=\v!left,
\c!n=\zerocount]
-\let\m_spac_hanging_location\empty
+\lettonothing\m_spac_hanging_location
\permanent\tolerant\protected\def\starthanging[#1]%
{\dontleavehmode\bgroup
\ifhastok={#1}%
- \let\m_spac_hanging_location\empty
+ \lettonothing\m_spac_hanging_location
\setupcurrenthanging[#1]%
\else
\edef\m_spac_hanging_location{#1}%
@@ -2303,7 +2256,7 @@
\installcorenamespace{fixedalternatives}
-\aliased\let\stopfixed\relax
+\permanent\protected\lettonothing\stopfixed
\permanent\protected\def\startfixed
{\bgroup
@@ -2385,7 +2338,7 @@
% \prerollblank[2*line] \the\prerolledblank
% \prerollblank[-2*line] \the\prerolledblank
-\newskip\prerolledblank
+\newgluespec\prerolledblank
\permanent\protected\def\prerollblank[#1]%
{\begingroup
@@ -2402,13 +2355,11 @@
\kern\zeropoint
\blank[\p_blank]}%
% \dimexpr doesn't work well with skips
- \advance\scratchskip-\ht\scratchbox
+ \advanceby\scratchskip-\ht\scratchbox
\global\prerolledblank-\scratchskip
\fi
\endgroup}
-\newcount\c_spac_vspacing_ignore_parskip
-
% \setupwhitespace[line]
% \setuphead[subject][after={\blank[packed]},style=\bfb]
% \subject{foo}
@@ -2427,4 +2378,91 @@
\permanent\protected\def\ignoreparskip{\c_spac_vspacing_ignore_parskip\plusone}
+%D New, use with care:
+%D
+%D \starttyping
+%D test test test \hfill\break
+%D test \blankbefore test
+%D test \blankbefore[2*line] test
+%D test \blankbefore test
+%D test test test \hfill\break
+%D test \blankbefore test
+%D test \blankbefore test
+%D test \blankbefore test
+%D test test test \hfill\break
+%D test \blankafter test
+%D test \blankafter test
+%D test \blankafter test
+%D test test test \hfill\break
+%D test test test \hfill\break
+%D \stoptyping
+
+\permanent\tolerant\protected\def\blankbefore[#1]{\vadjust pre {\ifcstok{#1}\emptytoks\blank\else\blank[#1]\fi}}
+\permanent\tolerant\protected\def\blankafter [#1]{\vadjust post{\ifcstok{#1}\emptytoks\blank\else\blank[#1]\fi}}
+
+%D Experimental:
+
+\installcorenamespace{textdisplay}
+
+\installcommandhandler \??textdisplay {textdisplay} \??textdisplay
+
+\appendtoks
+ \frozen\protected\edefcsname\e!start\currenttextdisplay\endcsname{\spac_textdisplay_start{\currenttextdisplay}}%
+ \frozen\protected\edefcsname\e!stop \currenttextdisplay\endcsname{\spac_textdisplay_stop}%
+\to \everydefinetextdisplay
+
+\setuptextdisplay
+ [\c!factor=.5,
+ \c!after=\textdisplayparameter\c!before]
+
+\tolerant\protected\def\spac_textdisplay_start#1#:[#2]%
+ {\par
+ \begingroup
+ \whitespace
+ \forgetall
+ \edef\currenttextdisplay{#1}%
+ \setupcurrenttextdisplay[#2]%
+ \textdisplayparameter\c!before
+ \dpack
+ \bgroup
+ \strut
+ \vskip-\lineheight
+ \vpack
+ \s!yoffset -\textdisplayparameter\c!factor\strutdp
+ \bgroup}
+
+\protected\def\spac_textdisplay_stop
+ {\egroup
+ \vskip-\lineheight
+ \strut
+ \egroup
+ \textdisplayparameter\c!after
+ \endgroup
+ \par}
+
+\definetextdisplay[\v!textdisplay]
+
+% \useMPlibrary[dum]
+%
+% \definetextdisplay[steppedbystep][before={\blank[halfline]}]
+%
+% \starttext \showmakeup[line]
+% \dostepwiserecurse{10}{25}{1}{
+% xxxxxxxxxxxxxxxx\par
+% \starttextdisplay
+% \externalfigure[dummydummy][height=#1mm,text=no]%
+% \stoptextdisplay
+% xxxxxxxxxxxxxxxx\par
+% \starttextdisplay[before=\blank,after=\blank] % factor=.5
+% \externalfigure[dummydummy][height=#1mm,text=no]%
+% \stoptextdisplay
+% xxxxxxxxxxxxxxxx\par
+% \startsteppedbystep
+% \externalfigure[dummydummy][height=#1mm,text=no]%
+% \stopsteppedbystep
+% xxxxxxxxxxxxxxxx\par
+% \page
+% }
+% \stoptext
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-bkm.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-bkm.mkxl
index c5bd8732421..8e5e7e4b113 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/strc-bkm.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-bkm.mkxl
@@ -90,8 +90,8 @@
\expandafter\gobblethreeoptionals
\fi}
-\let\m_bookmarks_names \empty
-\let\m_bookmarks_opened\empty
+\lettonothing\m_bookmarks_names
+\lettonothing\m_bookmarks_opened
\tolerant\def\strc_bookmarks_place_yes[#1]#*[#2]#*[#3]%
{\begingroup
@@ -104,7 +104,7 @@
\let\m_bookmarks_names\v!all
\fi
\ifparameters\or\or
- \doifelseassignment{#2}{\let\m_bookmarks_opened\empty\setupcurrentbookmark[#2]}\donothing
+ \doifelseassignment{#2}{\lettonothing\m_bookmarks_opened\setupcurrentbookmark[#2]}\donothing
\or
\setupcurrentbookmark[#3]% no every so not all possible
\fi
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-blk.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-blk.mkxl
index 4cfbd51eb58..c8173953051 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/strc-blk.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-blk.mkxl
@@ -34,8 +34,8 @@
\appendtoks
\clf_definestructureblock{\currentblock}%
- \frozen\setuevalue{\e!begin\currentblock}{\strc_blocks_begin{\currentblock}}%
- \frozen\letvalue {\e!end \currentblock}\donothing
+ \frozen\protected\edefcsname\e!begin\currentblock\endcsname{\strc_blocks_begin{\currentblock}}%
+ \frozen \letcsname \e!end \currentblock\endcsname\donothing
\to \everydefineblock
% We need to prevent too much lookahead which will gobble newlines that are needed
@@ -43,12 +43,12 @@
% maybe: systemmode "block:<name>"
-\let\m_block \empty
-\let\m_subblock\empty
+\lettonothing\m_block
+\lettonothing\m_subblock
\protected\def\strc_blocks_begin#1%
- {\edef\m_block {#1}%
- \let \m_subblock\empty
+ {\edef\m_block{#1}%
+ \lettonothing\m_subblock
\doifelsenextoptionalcs\strc_blocks_begin_yes\strc_blocks_begin_nop}
\protected\def\strc_blocks_begin_yes[#1]%
@@ -73,6 +73,30 @@
{\clf_savestructureblock{\m_block}{\m_subblock}{#1}{\??block}}%
\plusone}
+% \tolerant\protected\def\strc_blocks_begin#1#*[#2]#*[#3]% #:#/% get rid of spaces and pars
+% {\edef\m_block{#1}%
+% \lettonothing\m_subblock
+% \ifhastok={#2}%
+% \expandafter\strc_blocks_begin_a % [settings]
+% \orelse\ifparameter#2\or
+% \expandafter\strc_blocks_begin_b % [tag] [settings]
+% \else
+% \expandafter\strc_blocks_begin_c %
+% \fi{#2}{#3}}% #4}
+%
+% \protected\def\strc_blocks_begin_a#1#2% settings dummy
+% {\normalexpanded{\buff_pickup{\??block}{\e!begin\m_block}{\e!end\m_block}}%
+% {}%
+% {\clf_savestructureblock{\m_block}{\m_subblock}{#1}{\??block}}%
+% \plusone}
+%
+% \protected\def\strc_blocks_begin_b#1#2% tag settings
+% {\edef\m_subblock{#1}%
+% \strc_blocks_begin_a{#2}{}}
+%
+% \protected\def\strc_blocks_begin_c#1#2%
+% {\strc_blocks_begin_a{}{}}
+
\let\strc_blocks_setup\relax
\newconstant \c_strc_blocks_index
@@ -145,11 +169,11 @@
\ifhastok={#3}%
\getparameters[\??blocktemp][\c!criterium=\v!text,#3]%
\def\strc_blocks_setup{\setupcurrentblock[#3]}%
- \clf_selectstructureblock{#1}{#2}{}{\csname\??blocktemp\c!criterium\endcsname}%
+ \clf_selectstructureblock{#1}{#2}{}{\begincsname\??blocktemp\c!criterium\endcsname}%
\else
\getparameters[\??blocktemp][\c!criterium=\v!text,#4]%
\def\strc_blocks_setup{\setupcurrentblock[#4]}%
- \clf_selectstructureblock{#1}{#2}{#3}{\csname\??blocktemp\c!criterium\endcsname}%
+ \clf_selectstructureblock{#1}{#2}{#3}{\begincsname\??blocktemp\c!criterium\endcsname}%
\fi
\endgroup}
@@ -168,4 +192,6 @@
\permanent\protected\def\processblocks{\strc_blocks_select [process]}
\permanent\protected\def\selectblocks {\strc_blocks_select [use]}
+\permanent\protected\def\doifelseblocksempty{\clf_doifelsestructureblocksempty} % {name}{tag}{criterium}
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-con.mklx b/Master/texmf-dist/tex/context/base/mkxl/strc-con.mklx
index 5e0ceb8338c..0f7750bfedb 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/strc-con.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-con.mklx
@@ -105,63 +105,61 @@
%aliased\let\currentconstructionhash \??construction
-\mutable\let\currentconstructionmain \empty
-\mutable\let\currentconstructionlevel \empty
-\mutable\let\currentconstructionhandler \empty
-
-\mutable\let\currentconstructionattribute \empty
-\mutable\let\currentconstructionbookmark \empty
-\mutable\let\currentconstructioncatcodes \empty
-\mutable\let\currentconstructioncoding \empty
-\mutable\let\currentconstructionexpansion \empty
-\mutable\let\currentconstructionincrementnumber\empty
-\mutable\let\currentconstructionlabel \empty
-\mutable\let\currentconstructionlist \empty
-\mutable\let\currentconstructionlistentry \empty
-\mutable\let\currentconstructionlistnumber \empty
-\mutable\let\currentconstructionmarking \empty
-\mutable\let\currentconstructionnumber \empty
-\mutable\let\currentconstructionreference \empty
-\mutable\let\currentconstructionreferencetext \empty
-\mutable\let\currentconstructionreferenceprefix\empty
-\mutable\let\currentconstructionsynchronize \empty
-\mutable\let\currentconstructiontitle \empty
-\mutable\let\currentconstructionxmlsetup \empty
+\mutable\lettonothing\currentconstructionmain
+\mutable\lettonothing\currentconstructionlevel
+\mutable\lettonothing\currentconstructionhandler
+\mutable\lettonothing\currentconstructionattribute
+\mutable\lettonothing\currentconstructionbookmark
+\mutable\lettonothing\currentconstructioncatcodes
+\mutable\lettonothing\currentconstructioncoding
+\mutable\lettonothing\currentconstructionexpansion
+\mutable\lettonothing\currentconstructionincrementnumber
+\mutable\lettonothing\currentconstructionlabel
+\mutable\lettonothing\currentconstructionlist
+\mutable\lettonothing\currentconstructionlistentry
+\mutable\lettonothing\currentconstructionlistnumber
+\mutable\lettonothing\currentconstructionmarking
+\mutable\lettonothing\currentconstructionnumber
+\mutable\lettonothing\currentconstructionreference
+\mutable\lettonothing\currentconstructionreferencetext
+\mutable\lettonothing\currentconstructionreferenceprefix
+\mutable\lettonothing\currentconstructionsynchronize
+\mutable\lettonothing\currentconstructiontitle
+\mutable\lettonothing\currentconstructionxmlsetup
\settrue\c_strc_constructions_define_commands % use with care, might become a proper key
\appendtoks
\ifempty\currentconstructionparent
- \letvalue{\??constructionmain\currentconstruction}\currentconstruction
+ \letcsname\??constructionmain\currentconstruction\endcsname\currentconstruction
\definelist[\currentconstruction]% goodie
\else
- \letvalue{\??constructionmain\currentconstruction}\currentconstructionparent
+ \letcsname\??constructionmain\currentconstruction\endcsname\currentconstructionparent
\definelist[\currentconstruction][\currentconstructionparent]% goodie
\fi
- \setevalue{\??constructionlevel\currentconstruction}{\number\constructionparameter\c!level}%
- \setevalue{\??constructionclass\currentconstruction}{\constructionparameter\s!handler}%
+ \edefcsname\??constructionlevel\currentconstruction\endcsname{\number\constructionparameter\c!level}%
+ \edefcsname\??constructionclass\currentconstruction\endcsname{\constructionparameter\s!handler}%
\to \everydefineconstruction
% todo: inhibit this when we have a different handle .. current we cannot do \frozen
\appendtoks
\ifconditional\c_strc_constructions_define_commands
- %% \instance\setuevalue{\e!start\currentconstruction}{\strc_constructions_start{\currentconstruction}}%
- \instance\setuevalue{\e!start\currentconstruction}{\strc_constructions_start[\currentconstruction]}%
- \instance\setuevalue{\e!stop \currentconstruction}{\strc_constructions_stop}%
+ \protected\instance\edefcsname\e!start\currentconstruction\endcsname{\startnamedconstruction[\currentconstruction]}%
+ \protected\instance \defcsname\e!stop \currentconstruction\endcsname{\stopnamedconstruction}%
\fi
\to \everydefineconstruction
%D Just a basic environment (mostly for testing). We will provide a 'setup' based
%D plugin once the rest is sorted out.
-\tolerant\protected\def\strc_constructions_start[#1]#*[#2]#*[#3]%
+\tolerant\permanent\protected\def\startnamedconstruction[#1]#*[#2]#*[#3]%
{\begingroup
\strc_constructions_initialize{#1}%
\strc_constructions_register[#3][\c!label={\constructionparameter\c!text},\c!reference=,\c!title=,\c!bookmark=,\c!list=,\c!referencetext=,#2]%
\csname\??constructionstarthandler\currentconstructionhandler\endcsname}
-\protected\def\strc_constructions_stop
+\permanent\protected\def\stopnamedconstruction
{\csname\??constructionstophandler\currentconstructionhandler\endcsname
\endgroup}
@@ -196,11 +194,11 @@
\newconditional\c_strc_constructions_number_state
\newconditional\c_strc_constructions_title_state
-\protected\setvalue{\??constructioninitializer\v!construction}%
+\protected\defcsname\??constructioninitializer\v!construction\endcsname
{\setfalse\c_strc_constructions_number_state
\setfalse\c_strc_constructions_title_state}
-\protected\setvalue{\??constructionfinalizer\v!construction}%
+\protected\defcsname\??constructionfinalizer\v!construction\endcsname
{}
%D We keep the command variant around but rather would move to the start-stop one.
@@ -261,7 +259,7 @@
\currentconstructiontext
\endgroup}
-\protected\setvalue{\??constructionmainhandler\v!construction}#1%
+\protected\defcsname\??constructionmainhandler\v!construction\endcsname#1%
{\iftrialtypesetting \else
\begingroup
\currentconstructionsynchronize % reinstated
@@ -270,7 +268,7 @@
\endgroup
\fi#1}
-\protected\setvalue{\??constructiontexthandler\v!construction}%
+\protected\defcsname\??constructiontexthandler\v!construction\endcsname
{\begingroup
\useconstructionstyleandcolor\c!headstyle\c!headcolor % move to \currentconstructiontext
\the\everyconstruction
@@ -294,20 +292,20 @@
% \def\resetconstructions % to be used in e.g. footnotes
% {\c_strc_constructions_nested_state\zerocount}
-\protected\setvalue{\??constructioncommandhandler\v!construction}%
+\protected\defcsname\??constructioncommandhandler\v!construction\endcsname
{\endgroup}
-\let\p_strc_constructions_sample \empty
-\let\p_strc_constructions_align \empty
-\let\p_strc_constructions_indenting \empty
-\let\p_strc_constructions_width \empty
-\let\p_strc_constructions_aligntitle \empty
-\let\p_strc_constructions_renderingsetup\empty
-\let\p_strc_constructions_headalign \empty
-\let\p_strc_constructions_hang \empty
-\let\p_strc_constructions_inbetween \empty
-\let\p_strc_constructions_closesymbol \empty
-\let\p_strc_constructions_distance \empty
+\lettonothing\p_strc_constructions_sample
+\lettonothing\p_strc_constructions_align
+\lettonothing\p_strc_constructions_indenting
+\lettonothing\p_strc_constructions_width
+\lettonothing\p_strc_constructions_aligntitle
+\lettonothing\p_strc_constructions_renderingsetup
+\lettonothing\p_strc_constructions_headalign
+\lettonothing\p_strc_constructions_hang
+\lettonothing\p_strc_constructions_inbetween
+\lettonothing\p_strc_constructions_closesymbol
+\lettonothing\p_strc_constructions_distance
\newconditional\c_strc_constructions_distance_none
@@ -331,7 +329,7 @@
% we also need to make sure that no stretch creeps in (new per 2015-02-02, for Alan)
\settrue\c_strc_constructions_distance_none}
-\protected\setvalue{\??constructionstarthandler\v!construction}% this will be redone (reorganized) .. too much boxing
+\protected\defcsname\??constructionstarthandler\v!construction\endcsname % this will be redone (reorganized) .. too much boxing
{\dostarttaggedchained\t!construction\currentconstruction\currentconstructionhash
% \dotagsetconstruction
\constructionparameter\c!before
@@ -400,8 +398,12 @@
%
\dostarttagged\t!constructiontag\empty % todo
\setbox\constructionheadbox\hbox
- {\forgetall
+ {\scratchskip\parindent
+ \forgetall
\dontcomplain
+ % new and under testing
+ \doif{\constructionparameter\c!headindenting}\v!yes{\hskip\scratchskip}%
+ %
\ifx\currentconstructionalternative\v!serried % brrr, hack, will change
\csname\??constructionmainhandler\currentconstructionhandler\endcsname\currentconstructiontext
\else
@@ -411,11 +413,9 @@
\ifx\p_strc_constructions_aligntitle\v!no
\leftconstructionskip \leftskip
\rightconstructionskip\rightskip
- \else
- \ifcase\c_strc_constructions_nested_state
- \leftconstructionskip \leftskip
- \rightconstructionskip\rightskip
- \fi
+ \orelse\ifcase\c_strc_constructions_nested_state
+ \leftconstructionskip \leftskip
+ \rightconstructionskip\rightskip
\fi
\edef\p_strc_constructions_align{\constructionparameter\c!align}%
\ifempty\p_strc_constructions_align \else
@@ -443,7 +443,7 @@
\updateparagraphshapes
\ignorespaces} % args not needed
-\protected\setvalue{\??constructionstophandler\v!construction}%
+\protected\defcsname\??constructionstophandler\v!construction\endcsname
{\strc_constructions_close_symbol_place
\doifnot{\constructionparameter\c!display}\v!no\par
\dostoptagged % content
@@ -552,11 +552,11 @@
[\c!renderingsetup=\??constructionrenderings:\v!label,
\c!width=]
-\newbox \constructionheadbox
-\newskip \leftconstructionskip
-\newskip \rightconstructionskip
-\newdimen \constructionsheadwidth
-\newdimen \constructionsheaddistance
+\newbox \constructionheadbox
+\newgluespec \leftconstructionskip
+\newgluespec \rightconstructionskip
+\newdimension\constructionsheadwidth
+\newdimension\constructionsheaddistance
\def\strc_constructions_set_hang_box#1% messy left/rightskip
{\setbox\constructionheadbox\vtop % \vbox gaat fout in hang
@@ -569,7 +569,7 @@
\setupalign[\p_strc_constructions_headalign]% use fast one
\fi
\ifconditional\c_strc_constructions_distance_none \else
- \advance\ifx#1\v!flushleft\rightskip\else\leftskip\fi\constructionsheaddistance % only difference and wrong anyway
+ \advanceby\ifx#1\v!flushleft\rightskip\else\leftskip\fi\constructionsheaddistance % only difference and wrong anyway
\fi
\flushconstructionheadbox}%
\setbox\constructionheadbox\hpack{\box\constructionheadbox}% needed in case of e.g. a real big head font, see descriptions-006.tex
@@ -676,7 +676,7 @@
\hskip\rightconstructionskip
}
\nobreak
- \advance\rightskip \constructionsheaddistance
+ \advanceby\rightskip \constructionsheaddistance
\useconstructionstyleandcolor\c!style\c!color
\ignorespaces
\stopsetups
@@ -722,7 +722,7 @@
\startsetups[\??constructionrenderings:\v!left:\v!hanging]%
\enforced\let\\\crlf
\dontcomplain
- \advance\constructionsheadwidth \constructionsheaddistance
+ \advanceby\constructionsheadwidth \constructionsheaddistance
\strc_constructions_set_hang_box\v!flushleft
\strc_constructions_set_hang\v!left
\noindent
@@ -739,7 +739,7 @@
\startsetups[\??constructionrenderings:\v!right:\v!hanging]%
\enforced\let\\\crlf
\dontcomplain
- \advance\constructionsheadwidth \constructionsheaddistance
+ \advanceby\constructionsheadwidth \constructionsheaddistance
\strc_constructions_set_hang_box\v!flushright
\strc_constructions_set_hang\v!right
\noindent
@@ -883,7 +883,7 @@
% tricky: leftskipadaption is somewhat unpredictable
\enforced\let\\\crlf
\noindent
- \advance\leftskip-\leftskipadaption\relax
+ \advanceby\leftskip-\leftskipadaption\relax
\ifdim\leftskipadaption=\zeropoint
\leftskipadaption1.5\emwidth\relax % just some default
\ifnum\c_strc_constructions_nested_state=\plusone
@@ -893,7 +893,7 @@
\fi
\fi
\ifnum\c_strc_constructions_nested_state>\zerocount % was \ifnum\c_strc_constructions_nested_state=\plusone
- \advance\leftskip\leftskipadaption % but we're already further on
+ \advanceby\leftskip\leftskipadaption % but we're already further on
\fi
\hskip-\leftskipadaption\relax
\ifhbox\constructionheadbox \unhbox\else\box\fi\constructionheadbox
@@ -939,10 +939,6 @@
\endgroup
\stopsetups
-\ifcase\contextlmtxmode \else
- % just an empty check so that we can grep for contextlmtxmode in mkiv files
-\fi
-
% \definedescription[whatever][alternative=right:bottom]
%
% \startwhatever{just a small\\example}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-des.mklx b/Master/texmf-dist/tex/context/base/mkxl/strc-des.mklx
index b44593a3218..6c04c9ac163 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/strc-des.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-des.mklx
@@ -58,6 +58,7 @@
%\s!catcodes=,
\c!title=\v!yes,
%\c!text=,
+ \c!define=\v!yes,
]
\appendtoks
@@ -67,14 +68,16 @@
\defineconstruction[\currentdescription][\s!handler=\v!description,\c!level=1]%
\fi
% We can combine these but in tracing (or errors) using a different caller is nicer.
- \frozen\instance\setuevalue {\currentdescription}{\strc_descriptions_command[\currentdescription]}%
- \frozen\instance\setuevalue{\e!start\currentdescription}{\strc_descriptions_start [\currentdescription]}%
- \frozen\instance\setuevalue{\e!stop \currentdescription}{\strc_descriptions_stop}%
+ \ifcstok{\descriptionparameter\c!define}\v!yes
+ \frozen\protected\instance\edefcsname \currentdescription\endcsname{\nameddescription[\currentdescription]}%
+ \frozen\protected\instance\edefcsname\e!start\currentdescription\endcsname{\startnameddescription[\currentdescription]}%
+ \frozen\protected\instance \defcsname \e!stop\currentdescription\endcsname{\stopnameddescription}%
+ \fi
\to \everydefinedescription
-\let\p_strc_constructions_title \empty
+\lettonothing\p_strc_constructions_title
-\protected\setvalue{\??constructioninitializer\v!description}%
+\protected\defcsname\??constructioninitializer\v!description\endcsname
{\let \currentdescription \currentconstruction
\enforced\let\constructionparameter \descriptionparameter
\enforced\let\constructionnamespace \??description
@@ -99,7 +102,7 @@
% A bit over the top, the optional title but mkii has it too.
-\tolerant\protected\def\strc_descriptions_start[#1]#*[#2]%
+\tolerant\permanent\protected\def\startnameddescription[#1]#*[#2]%
{\begingroup
\strc_constructions_initialize{#1}%
\ifhastok={#2}%
@@ -130,13 +133,13 @@
{\strc_constructions_register[][\c!label={\descriptionparameter\c!text},\c!reference={#1},\c!title=,\c!bookmark=,\c!list=,\c!referencetext=]%
\csname\??constructionstarthandler\currentconstructionhandler\endcsname}
-\protected\def\strc_descriptions_stop
+\permanent\protected\def\stopnameddescription
{\csname\??constructionstophandler\currentconstructionhandler\endcsname}
% \description [reference] text \par
% \description [reference] {title} text \par
-\tolerant\protected\def\strc_descriptions_command[#1]#*[#2]%
+\tolerant\permanent\protected\def\nameddescription[#1]#*[#2]%
{\begingroup
\strc_constructions_initialize{#1}%
\ifhastok={#2}%
@@ -165,16 +168,16 @@
\letcsname\??constructioncommandhandler\v!description\expandafter\endcsname\csname\??constructioncommandhandler\v!construction\endcsname
\letcsname\??constructiontexthandler \v!description\expandafter\endcsname\csname\??constructiontexthandler \v!construction\endcsname
-\protected\setvalue{\??constructioncommandhandler\v!description}%
+\protected\defcsname\??constructioncommandhandler\v!description\endcsname
{\dowithpar
{\csname\??constructionstarthandler\v!construction\endcsname}%
{\csname\??constructionstophandler \v!construction\endcsname\endgroup}}
-\protected\setvalue{\??constructionstarthandler\v!description}%
+\protected\defcsname\??constructionstarthandler\v!description\endcsname
{\dogotopar
{\csname\??constructionstarthandler\v!construction\endcsname}}
-\protected\setvalue{\??constructionstophandler\v!description}%
+\protected\defcsname\??constructionstophandler\v!description\endcsname
{\csname\??constructionstophandler\v!construction\endcsname
\endgroup}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-doc.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-doc.mkxl
index 50b71d9d2dc..11c96f9c149 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/strc-doc.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-doc.mkxl
@@ -19,45 +19,45 @@
%D This will move:
-\mutable\let\currentstructureattribute \empty
-\mutable\let\currentstructurebackreference \empty
-\mutable\let\currentstructurebookmark \empty
-\mutable\let\currentstructurecatcodes \empty
-\mutable\let\currentstructurecoding \empty
-\mutable\let\currentstructurecoupling \empty
-\mutable\let\currentstructureexpansion \empty
-\mutable\let\currentstructureincrementnumber \empty
-\mutable\let\currentstructurelabel \empty
-\mutable\let\currentstructurelevel \empty
-\mutable\let\currentstructurelist \empty
-\mutable\let\currentstructurelistattribute \empty
-\mutable\let\currentstructuremarking \empty
-\mutable\let\currentstructurename \empty
-\mutable\let\currentstructureownnumber \empty
-\mutable\let\currentstructureplaceholder \empty
-\mutable\let\currentstructurereference \empty
-\mutable\let\currentstructurereferenceattribute \empty
-\mutable\let\currentstructurereferenceprefix \empty
-\mutable\let\currentstructuresaveinlist \empty
-\mutable\let\currentstructureshownumber \empty
-\mutable\let\currentstructuretitle \empty
-\mutable\let\currentstructurexmlsetup \empty
+\mutable\lettonothing\currentstructureattribute
+\mutable\lettonothing\currentstructurebackreference
+\mutable\lettonothing\currentstructurebookmark
+\mutable\lettonothing\currentstructurecatcodes
+\mutable\lettonothing\currentstructurecoding
+\mutable\lettonothing\currentstructurecoupling
+\mutable\lettonothing\currentstructureexpansion
+\mutable\lettonothing\currentstructureincrementnumber
+\mutable\lettonothing\currentstructurelabel
+\mutable\lettonothing\currentstructurelevel
+\mutable\lettonothing\currentstructurelist
+\mutable\lettonothing\currentstructurelistattribute
+\mutable\lettonothing\currentstructuremarking
+\mutable\lettonothing\currentstructurename
+\mutable\lettonothing\currentstructureownnumber
+\mutable\lettonothing\currentstructureplaceholder
+\mutable\lettonothing\currentstructurereference
+\mutable\lettonothing\currentstructurereferenceattribute
+\mutable\lettonothing\currentstructurereferenceprefix
+\mutable\lettonothing\currentstructuresaveinlist
+\mutable\lettonothing\currentstructureshownumber
+\mutable\lettonothing\currentstructuretitle
+\mutable\lettonothing\currentstructurexmlsetup
-\mutable\let\currentstructurecomponentattribute \empty
-\mutable\let\currentstructurecomponentbookmark \empty
-\mutable\let\currentstructurecomponentcatcodes \empty
-\mutable\let\currentstructurecomponentcoding \empty
-\mutable\let\currentstructurecomponentexpansion \empty
-\mutable\let\currentstructurecomponentlabel \empty
-\mutable\let\currentstructurecomponentlevel \empty
-\mutable\let\currentstructurecomponentlist \empty
-\mutable\let\currentstructurecomponentmarking \empty
-\mutable\let\currentstructurecomponentname \empty
-\mutable\let\currentstructurecomponentreference \empty
-\mutable\let\currentstructurecomponentreferenceprefix\empty
-\mutable\let\currentstructurecomponentsynchronize \empty
-\mutable\let\currentstructurecomponenttitle \empty
-\mutable\let\currentstructurecomponentxmlsetup \empty
+\mutable\lettonothing\currentstructurecomponentattribute
+\mutable\lettonothing\currentstructurecomponentbookmark
+\mutable\lettonothing\currentstructurecomponentcatcodes
+\mutable\lettonothing\currentstructurecomponentcoding
+\mutable\lettonothing\currentstructurecomponentexpansion
+\mutable\lettonothing\currentstructurecomponentlabel
+\mutable\lettonothing\currentstructurecomponentlevel
+\mutable\lettonothing\currentstructurecomponentlist
+\mutable\lettonothing\currentstructurecomponentmarking
+\mutable\lettonothing\currentstructurecomponentname
+\mutable\lettonothing\currentstructurecomponentreference
+\mutable\lettonothing\currentstructurecomponentreferenceprefix
+\mutable\lettonothing\currentstructurecomponentsynchronize
+\mutable\lettonothing\currentstructurecomponenttitle
+\mutable\lettonothing\currentstructurecomponentxmlsetup
\permanent\protected\def\setstructuresynchronization#1% todo: use ctxcontext
{\clf_setinternalreference
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-enu.mklx b/Master/texmf-dist/tex/context/base/mkxl/strc-enu.mklx
index 4bcdb6c4f32..d3cf165dec8 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/strc-enu.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-enu.mklx
@@ -120,7 +120,8 @@
\c!number=\v!yes, % else description
\c!start=0,
\c!state=\v!start,
- \c!levels=4]
+ \c!levels=4,
+ \c!define=\v!yes]
% to be considered:
%
@@ -129,22 +130,26 @@
% with push/pop (also at definition time)
\protected\def\strc_define_commands_enumeration#tag#level#parent%
- {\doifelsenothing{#parent}
- {\normalexpanded{\defineconstruction[#tag][\s!handler=\v!enumeration,\c!level=#level]}%
- \setevalue{\??enumeration#tag:\s!parent}{\??enumeration}}%
- {\normalexpanded{\defineconstruction[#tag][#parent][\s!handler=\v!enumeration,\c!level=#level]}%
- \setevalue{\??enumeration#tag:\s!parent}{\??enumeration#parent}}%
- \frozen\instance\setuevalue{\e!next #tag}{\strc_enumerations_next {#tag}{\number#level}}% obsolete
- \frozen\instance\setuevalue{\c!reset#tag}{\strc_enumerations_reset {#tag}{\number#level}}% obsolete
- %frozen\instance\setuevalue{\c!set #tag}{\strc_enumerations_set {#tag}{\number#level}}% obsolete
- \frozen\instance\setuevalue {#tag}{\strc_enumerations_command[#tag]}% we could pass level here as well (faster)
- \frozen\instance\setuevalue{\e!start#tag}{\strc_enumerations_start [#tag]}% we could pass level here as well (faster)
- \frozen\instance\setuevalue{\e!stop #tag}{\strc_enumerations_stop }}
-
-\let\m_strc_enumeration_sub\empty
+ {\iftok{#parent}\emptytoks
+ \normalexpanded{\defineconstruction[#tag][\s!handler=\v!enumeration,\c!level=#level]}%
+ \edefcsname\??enumeration#tag:\s!parent\endcsname{\??enumeration}%
+ \else
+ \normalexpanded{\defineconstruction[#tag][#parent][\s!handler=\v!enumeration,\c!level=#level]}%
+ \edefcsname\??enumeration#tag:\s!parent\endcsname{\??enumeration#parent}%
+ \fi
+ \ifcstok{\enumerationparameter\c!define}\v!yes
+ \frozen\protected\instance\edefcsname\e!next #tag\endcsname{\strc_enumerations_next{#tag}{\number#level}}% obsolete
+ \frozen\protected\instance\edefcsname\c!reset#tag\endcsname{\strc_enumerations_reset{#tag}{\number#level}}% obsolete
+ %frozen\protected\instance\edefcsname\c!set #tag\endcsname{\strc_enumerations_set{#tag}{\number#level}}% obsolete
+ \frozen\protected\instance\edefcsname #tag\endcsname{\namedenumeration[#tag]}%
+ \frozen\protected\instance\edefcsname\e!start#tag\endcsname{\startnamedenumeration[#tag]}%
+ \frozen\protected\instance \defcsname\e!stop #tag\endcsname{\stopnamedenumeration}%
+ \fi}
+
+\lettonothing\m_strc_enumeration_sub
\appendtoks
- \let\m_strc_enumeration_sub\empty
+ \lettonothing\m_strc_enumeration_sub
\ifempty\currentenumerationparent
% clone => parent | subclone => clone | subsubclone => subclone
\strc_define_commands_enumeration
@@ -177,10 +182,10 @@
%\strc_enumerations_setup_counter\currentenumeration
\to \everydefineenumeration
-\let\p_strc_constructions_title \empty
-\let\p_strc_constructions_number\empty
+\lettonothing\p_strc_constructions_title
+\lettonothing\p_strc_constructions_number
-\protected\setvalue{\??constructioninitializer\v!enumeration}%
+\protected\defcsname\??constructioninitializer\v!enumeration\endcsname
{\let \currentenumeration \currentconstruction
\enforced\let\constructionparameter \enumerationparameter
\enforced\let\constructionnamespace \??enumeration
@@ -205,7 +210,7 @@
\setfalse\c_strc_constructions_title_state
\fi}
-\protected\setvalue{\??constructionfinalizer\v!enumeration}%
+\protected\defcsname\??constructionfinalizer\v!enumeration\endcsname
{\ifconditional\c_strc_constructions_number_state
\iftrialtypesetting
\strc_counters_restore\currentconstructionnumber
@@ -214,9 +219,9 @@
%D Interfaces:
-\let\strc_enumerations_command\strc_descriptions_command
-\let\strc_enumerations_start \strc_descriptions_start
-\let\strc_enumerations_stop \strc_descriptions_stop
+\let\namedenumeration \nameddescription
+\let\startnamedenumeration\startnameddescription
+\let\stopnamedenumeration \stopnameddescription
\protected\def\strc_enumerations_next {\strc_constructions_next_indeed \namedenumerationparameter} % #1#2
\protected\def\strc_enumerations_reset{\strc_constructions_reset_indeed\namedenumerationparameter} % #1#2
@@ -250,7 +255,7 @@
\letcsname\??constructionstarthandler \v!enumeration\expandafter\endcsname\csname\??constructionstarthandler \v!description\endcsname
\letcsname\??constructionstophandler \v!enumeration\expandafter\endcsname\csname\??constructionstophandler \v!description\endcsname
-\protected\setvalue{\??constructiontexthandler\v!enumeration}%
+\protected\defcsname\??constructiontexthandler\v!enumeration\endcsname
{\begingroup
\useconstructionstyleandcolor\c!headstyle\c!headcolor
\strc_enumerations_text
@@ -302,16 +307,22 @@
\endgroup}
\protected\def\strc_enumerations_inject_symbol % todo check
- {\constructionparameter\c!left
+ {\begingroup
+ \useconstructionstyleandcolor\c!numberstyle\c!numbercolor
+ \constructionparameter\c!left
\constructionparameter\c!symbol
- \constructionparameter\c!right}
+ \constructionparameter\c!right
+ \endgroup}
\protected\def\strc_enumerations_inject_number
- {\constructionparameter\c!left
+ {\begingroup
+ \useconstructionstyleandcolor\c!numberstyle\c!numbercolor
+ \constructionparameter\c!left
\constructionparameter\c!starter
\clf_savedlistprefixednumber{\currentconstructionmain}\currentconstructionlistentry\relax
\constructionparameter\c!stopper
- \constructionparameter\c!right}
+ \constructionparameter\c!right
+ \endgroup}
\protected\def\strc_enumerations_inject_text_and_number
{\constructionparameter\c!numbercommand
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-flt.mklx b/Master/texmf-dist/tex/context/base/mkxl/strc-flt.mklx
index 8f96701f5df..55b825fe1e9 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/strc-flt.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-flt.mklx
@@ -1,5 +1,4 @@
%D \module
-%D \module
%D [ file=strc-flt,
%D version=2008.10.20,
%D title=\CONTEXT\ Structure Macros,
@@ -188,13 +187,13 @@
\d_page_floats_compress_distance\floatparameter\c!compressdistance\relax
\to \everysetupfloat
-\mutable\let\currentfloatattribute \empty
-\mutable\let\currentfloatcounter \empty
-\mutable\let\currentfloatgroup \empty
-\mutable\let\currentfloatnumber \empty
-\mutable\let\currentfloatsynchronize\empty
+\mutable\lettonothing\currentfloatattribute
+\mutable\lettonothing\currentfloatcounter
+\mutable\lettonothing\currentfloatgroup
+\mutable\lettonothing\currentfloatnumber
+\mutable\lettonothing\currentfloatsynchronize
-\let\m_strc_floats_previous_number \empty % we can also just push/pop
+\lettonothing\m_strc_floats_previous_number % we can also just push/pop
%D We need to do it again here:
@@ -263,17 +262,17 @@
\strc_floats_define_commands{#1}{#2}}
\def\strc_floats_define_commands#1#2%
- {\frozen\instance\setuevalue{\e!place\e!listof#2}{\strc_lists_place[#1]}% call will change
- \frozen\instance\setuevalue{\e!complete\e!listof#2}{\strc_lists_complete[#1][#2]}% call will change
- \frozen\instance\setuevalue{\e!place#1}{\placefloat[#1]}%
- \frozen\instance\setuevalue{\e!start\e!place#1}{\startplacefloat[#1]}%
- \frozen\instance\setuevalue{\e!stop\e!place#1}{\stopplacefloat}%
- \frozen\instance\setuevalue{\e!start#1\e!text}{\strc_floats_start_text[#1]}%
- \frozen\instance\setuevalue{\e!stop#1\e!text}{\strc_floats_stop_text}%
+ {\frozen\protected\instance\edefcsname\e!place \e!listof#2\endcsname{\strc_lists_place[#1]}% call will change
+ \frozen\protected\instance\edefcsname\e!complete\e!listof#2\endcsname{\strc_lists_complete[#1][#2]}% call will change
+ \frozen\protected\instance\edefcsname\e!place #1\endcsname{\placefloat[#1]}%
+ \frozen\protected\instance\edefcsname\e!start \e!place#1\endcsname{\startplacefloat[#1]}%
+ \frozen\protected\instance\edefcsname\e!stop \e!place#1\endcsname{\stopplacefloat}%
+ \frozen\protected\instance\edefcsname\e!start #1\e!text\endcsname{\strc_floats_start_text[#1]}%
+ \frozen\protected\instance\edefcsname\e!stop #1\e!text\endcsname{\strc_floats_stop_text}%
% these will become obsolete:
- \frozen\instance\setuevalue{\e!reserve#1}{\strc_floats_reserve[#1]}%
- \frozen\instance\setuevalue{\e!start\e!reserve#1\e!text}{\strc_floats_start_reserve_text[#1]}%
- \frozen\instance\setuevalue{\e!stop\e!reserve#1\e!text}{\strc_floats_stop_reserve_text}}
+ \frozen\instance\protected\edefcsname\e!reserve #1\endcsname{\strc_floats_reserve[#1]}%
+ \frozen\instance\protected\edefcsname\e!start\e!reserve#1\e!text\endcsname{\strc_floats_start_reserve_text[#1]}%
+ \frozen\instance\protected\edefcsname\e!stop \e!reserve#1\e!text\endcsname{\strc_floats_stop_reserve_text}}
%D Fallback float body:
@@ -324,12 +323,12 @@
%D Captions.
-\mutable\let\floatcaptionarrangement\empty
-\mutable\let\floatcaptionattribute \empty
-\mutable\let\floatcaptiondirectives \empty
-\mutable\let\floatcaptionlocation \empty
-\mutable\let\floatcaptionnumber \empty
-\mutable\let\floatcaptionsuffix \empty
+\mutable\lettonothing\floatcaptionarrangement
+\mutable\lettonothing\floatcaptionattribute
+\mutable\lettonothing\floatcaptiondirectives
+\mutable\lettonothing\floatcaptionlocation
+\mutable\lettonothing\floatcaptionnumber
+\mutable\lettonothing\floatcaptionsuffix
% For a while these were placeholders:
%
@@ -380,7 +379,12 @@
\setupcurrentfloatcaption[#settings]%
\edef\currentfloatcounter{\namedcounterparameter\currentfloat\s!name}%
\iftrialtypesetting\strc_counters_save\currentfloatcounter\fi
- \strc_counters_increment\currentfloatcounter
+ \doifelse{\floatcaptionparameter\c!number}\v!yes
+ {\global\nofloatnumberfalse}%
+ {\global\nofloatnumbertrue}%
+ \ifnofloatnumber\else
+ \strc_counters_increment\currentfloatcounter
+ \fi
\strc_counters_register_component
\s!float
\setupcurrentfloatcaption
@@ -392,7 +396,7 @@
[\s!name=\currentfloat,
\s!counter=\currentfloatcounter,%
\s!hascaption=\v!yes,%
- \s!hasnumber=\v!yes,%
+ \s!hasnumber=\ifnofloatnumber\v!no\else\v!yes\fi,%
\s!hastitle=\v!yes]%
[#userdata]%
\glet\m_strc_floats_previous_number\m_strc_counters_last_registered_index
@@ -410,12 +414,12 @@
\egroup
\fi}
-\newbox \b_strc_floats_caption
-\newbox \b_strc_floats_content
-\newdimen\d_strc_floats_caption_height
-\newdimen\d_strc_floats_caption_depth
+\newbox \b_strc_floats_caption
+\newbox \b_strc_floats_content
+\newdimension\d_strc_floats_caption_height
+\newdimension\d_strc_floats_caption_depth
-\let\m_strc_floats_last_caption_tag\empty
+\lettonothing\m_strc_floats_last_caption_tag
\def\strc_floats_make_complete_caption
{\doifsomething{\floatcaptionparameter\c!spacebefore}{\blank[\floatcaptionparameter\c!spacebefore]}%
@@ -523,10 +527,57 @@
\fi
\fi}
+\def\strc_floats_apply_caption_command
+ {\setbox\b_strc_floats_caption\hbox\bgroup
+ %\unless\ifcstok{\floatcaptionparameter\c!command}\emptytoks
+ \floatcaptionparameter\c!command{\box\b_strc_floats_caption}%
+ %\orunless\ifcstok{\floatcaptionparameter\c!deeptextcommand}\emptytoks
+ % \floatcaptionparameter\c!deeptextcommand{\unvbox\b_strc_floats_caption}%
+ %\else
+ % \box\b_strc_floats_caption
+ %\fi
+ \egroup}
+
+%D Some trickery (example by MS):
+%D
+%D \starttyping
+%D \defineframed
+%D [MyCaptionFramed]
+%D [align={lohi,flushleft},
+%D width=fit,
+%D frame=off,
+%D strut=no,
+%D topframe=on,
+%D loffset=1em,
+%D toffset=0.25\lineheight]
+%D
+%D \starttexdefinition protected MyCaption #1
+%D \MyCaptionFramed {
+%D % we ignore #1 as we want to unpack
+%D \unvbox\floatcaptionbox
+%D }
+%D \stoptexdefinition
+%D
+%D \definefloat[pagefloat][pagefloats][graphic]
+%D
+%D \setupfloat
+%D [pagefloat]
+%D [default={page,header,footer}]
+%D
+%D \setupcaption
+%D [pagefloat]
+%D [location={top,inner},
+%D align=inner,
+%D command=\MyCaption,
+%D spaceinbetween=nowhite]
+%D \stoptyping
+
+\permanent\protected\def\floatcaptionbox{\b_strc_floats_caption}
+
%D We can do this ...
%D
%D \starttyping
-%D \newcount\c_strc_floats_n
+%D \newinteger\c_strc_floats_n
%D
%D \definedataset[\s!float][\c!delay=\v!yes]
%D
@@ -536,7 +587,7 @@
%D {\setdataset[\s!float][\number\c_strc_floats_n][]}
%D
%D \def\strc_float_load_data % precedes save !
-%D {\global\advance\c_strc_floats_n\plusone
+%D {\global\advanceby\c_strc_floats_n\plusone
%D \xdef\strc_float_realpage{\datasetvariable\s!float{\number\c_strc_floats_n}\s!page}%
%D \ifempty\strc_float_realpage
%D \glet\strc_float_realpage\realpageno % \realfolio
@@ -547,7 +598,7 @@
\definepagestate[\s!float][\c!delay=\v!yes]
-\newcount\c_strc_floats_n
+\newinteger\c_strc_floats_n
\let\strc_float_realpage\realpageno
@@ -555,7 +606,7 @@
{\setpagestate[\s!float][\number\c_strc_floats_n]}
\def\strc_float_load_data % precedes save !
- {\global\advance\c_strc_floats_n\plusone
+ {\global\advanceby\c_strc_floats_n\plusone
\xdef\strc_float_realpage{\pagestaterealpage\s!float{\number\c_strc_floats_n}}%
\ifempty\strc_float_realpage
\glet\strc_float_realpage\realpageno % \realfolio
@@ -584,7 +635,7 @@
% before we're really dealing with the float. Some day I'll root out the global
% settings.
-\aliased\let\lastplacedfloat\empty
+\aliased\lettonothing\lastplacedfloat
\def\strc_floats_set_current_tag#tag%
{\edef\currentfloat{#tag}%
@@ -596,32 +647,33 @@
{\writestatus\m!floatblocks{unknown float type '\currentfloat'}%
\let\currentfloat\v!figure}% also a hack
\enforced\glet\lastplacedfloat\currentfloat
- \let\m_strc_floats_saved_userdata\empty
+ \lettonothing\m_strc_floats_saved_userdata
\let\currentfloatcaption\currentfloat}
-\mutable\let\askedfloatmethod \empty
-\mutable\let\askedfloatoptions\empty
+\mutable\lettonothing\askedfloatmethod
+\mutable\lettonothing\askedfloatoptions
\def\strc_floats_reset_variables
{\global\emptyfloatcaptionfalse
\global\nofloatcaptionfalse
\global\nofloatnumberfalse
- \glet\askedfloatmethod \empty
- \glet\askedfloatoptions\empty}
+ \glettonothing\askedfloatmethod
+ \glettonothing\askedfloatoptions}
% place
-\mutable\let\floatlabel \empty
-\mutable\let\floatcolumn \empty
-\mutable\let\floatrow \empty
-\mutable\let\floatlocation \empty
-\mutable\let\floatlocationmethod\empty
+\mutable\lettonothing\floatlabel
+\mutable\lettonothing\floatcolumn
+\mutable\lettonothing\floatrow
+\mutable\lettonothing\floatlocation
+\mutable\lettonothing\floatlocationmethod
+\mutable\lettonothing\floatlocationdefault
\def\strc_floats_analyze_location
{% more will be moved here
- \let\floatlabel \empty
- \let\floatcolumn\empty
- \let\floatrow \empty
+ \lettonothing\floatlabel
+ \lettonothing\floatcolumn
+ \lettonothing\floatrow
%
\edef\floatcaptionlocation{\floatcaptionparameter\c!location}%
%
@@ -640,9 +692,10 @@
{\strc_floats_set_current_tag{#tag}%
\strc_floats_reset_variables
\xdef\askedfloatoptions{#location}%
+ \edef\floatlocationdefault{\floatparameter\c!default}%
\edef\floatlocation{#location}%
\ifempty\floatlocation
- \edef\floatlocation{\floatparameter\c!default}% beware of a clash between alignment locations
+ \let\floatlocation\floatlocationdefault % beware of a clash between alignment locations
\fi
\ifintable
\the\c_floats_every_table_float
@@ -668,13 +721,17 @@
\installsetuponlycommandhandler \??floatuserdata {floatuserdata}
-\let\m_strc_floats_saved_userdata\empty % todo: reset this in non start|stop cases
+\lettonothing\m_strc_floats_saved_userdata % todo: reset this in non start|stop cases
%D We abuse the settings to pick up some float parameters too which makes it
%D messy.
+%D Do we need a \setuplayout here (kind of costly) in case we mix multi page text
+%D with a side float and less height.
+
\permanent\tolerant\protected\def\startplacefloat[#tag]#spacer[#settings]#spacer[#userdata]%
{\flushnotes
+ %\setuplayout
\page_otr_command_flush_side_floats % here !
\strc_floats_begin_group
\strc_floats_set_current_tag{#tag}%
@@ -703,12 +760,13 @@
\setupcurrentfloatuserdata[#userdata]%
\def\m_strc_floats_saved_userdata{#userdata}%
\else
- \let\m_strc_floats_saved_userdata\empty
+ \lettonothing\m_strc_floats_saved_userdata
\fi
- % check
+ % check (see elsewhere
+ \edef\floatlocationdefault{\floatparameter\c!default}%
\edef\floatlocation{\floatcaptionparameter\c!location}%
\ifempty\floatlocation
- \edef\floatlocation{\floatparameter\c!default}%
+ \let\floatlocation\floatlocationdefault % beware of a clash between alignment locations
\fi
% inherit
\setexpandedfloatparameter\c!topoffset {\floatcaptionparameter\c!topoffset}%
@@ -856,8 +914,9 @@
\ifempty\forcedfloatmethod \else
\doifelsecommandhandler\??float\forcedfloatmethod
{\let\currentfloat\forcedfloatmethod
- \edef\floatlocation{\floatparameter\c!default}%
- \let\forcedfloatmethod\floatlocation}
+ \edef\floatlocationdefault{\floatparameter\c!default}%
+ \let\floatlocation\floatlocationdefault
+ \let\forcedfloatmethod\floatlocationdefault}
\donothing
\fi
\ifempty\forcedfloatmethod
@@ -880,9 +939,9 @@
% nicer is a bunch of states and one loop that sets those states
-\newdimen\d_strc_floats_top
-\newdimen\d_strc_floats_bottom
-\newdimen\d_strc_floats_overflow
+\newdimension\d_strc_floats_top
+\newdimension\d_strc_floats_bottom
+\newdimension\d_strc_floats_overflow
% \def\strc_floats_calculate_skip#target#skip%
% {\begingroup
@@ -932,6 +991,7 @@
\global\c_page_floats_n_of_top \rootfloatparameter\c!ntop
\global\c_page_floats_n_of_bottom\rootfloatparameter\c!nbottom
\global\d_strc_floats_overflow \zeropoint
+ \global\setfalse\c_page_sides_shape_down
\ifconditional\c_strc_floats_par_float
\global\d_strc_floats_top \zeropoint
\global\d_strc_floats_bottom \zeropoint
@@ -974,6 +1034,12 @@
180=>\global\c_strc_floats_rotation\commalistelement\relax,%
270=>\global\c_strc_floats_rotation\commalistelement\relax]%
\fi
+ \doifelseinset\v!force\floatlocation
+ {\global\settrue\c_page_sides_shape_down}
+ {\global\setfalse\c_page_sides_shape_down}%
+ \doifelseinset\v!keeptogether\floatlocation
+ {\global\settrue\c_page_sides_keep_together}
+ {\global\setfalse\c_page_sides_keep_together}%
\doifelseinset\v!nonumber\floatlocation
{\global\nofloatnumbertrue}%
{\doifelse{\floatcaptionparameter\c!number}\v!yes
@@ -1016,13 +1082,13 @@
\permanent\def\floatcaptionwidth {\the\floatcaptionht}
\permanent\def\floatcaptiondepth {\the\floatcaptiondp}
-\newdimen\naturalfloatwd
-\newdimen\naturalfloatht
-\newdimen\naturalfloatdp
+\newdimension\naturalfloatwd
+\newdimension\naturalfloatht
+\newdimension\naturalfloatdp
-\newdimen\floatcaptionwd
-\newdimen\floatcaptionht
-\newdimen\floatcaptiondp
+\newdimension\floatcaptionwd
+\newdimension\floatcaptionht
+\newdimension\floatcaptiondp
\def\strc_floats_set_natural_dimensions#box%
{\global\naturalfloatwd\wd#box\relax
@@ -1089,14 +1155,43 @@
\def\strc_floats_group_index
{\numexpr\clf_listgroupindex{\currentfloat}{\currentfloatgroup}\relax}
+%D A lightweight subnumber feature:
+%D
+%D \starttyping
+%D \startplacefigure [location=none]
+%D \startsubfloatnumbering
+%D \startfloatcombination [nx=3]
+%D \startplacefigure [title=Left] \externalfigure \stopplacefigure
+%D \startplacefigure [title=Middle] \externalfigure \stopplacefigure
+%D \startplacefigure [title=Right] \externalfigure \stopplacefigure
+%D \stopfloatcombination
+%D \stopsubfloatnumbering
+%D \stopplacefigure
+%D \stoptyping
+
+\glettonothing\currentsubfloatcounter
+
+\permanent\protected\def\startsubfloatnumbering
+ {\glet\currentsubfloatcounter\s!unknown}
+
+\permanent\protected\def\stopsubfloatnumbering
+ {\strc_counters_reset_sub\currentsubfloatcounter\plustwo
+ \glettonothing\currentsubfloatcounter}
+
+\defineconversionset[subfloats][number,characters]
+
+\setupcaptions
+ %[figure]
+ [\c!numberconversionset=subfloats]
+
\def\strc_floats_place_packaged_boxes
{\expandafter\strc_floats_place_packaged_boxes_indeed\expandafter{\m_strc_floats_saved_userdata}}
\def\strc_floats_place_packaged_boxes_indeed#userdata%
{\bgroup
\ifconditional\usesamefloatnumber
- \glet\currentfloatnumber \m_strc_floats_previous_number
- \glet\currentfloatattribute \empty
+ \glet\currentfloatnumber\m_strc_floats_previous_number
+ \glettonothing\currentfloatattribute
\glet\currentfloatsynchronize\relax
\else
\edef\currentfloatcounter{\namedcounterparameter\currentfloat\s!name}%
@@ -1106,7 +1201,17 @@
\orelse\ifempty\currentfloatgroup
% independent
\iftrialtypesetting\strc_counters_save\currentfloatcounter\fi
- \strc_counters_increment\currentfloatcounter
+ \ifempty\currentsubfloatcounter
+ \strc_counters_increment\currentfloatcounter
+ \strc_counters_reset_sub\currentfloatcounter\plustwo
+ \else
+ \ifcase\strc_counters_raw_sub\currentfloatcounter\plustwo\relax
+ \strc_counters_increment\currentfloatcounter
+ \strc_counters_reset_sub\currentfloatcounter\plustwo
+ \fi
+ \strc_counters_increment_sub\currentfloatcounter\plustwo
+ \glet\currentsubfloatcounter\currentfloatcounter
+ \fi
\orelse\ifcase\strc_floats_group_index
% first in group
\iftrialtypesetting\strc_counters_save\currentfloatcounter\fi
@@ -1161,8 +1266,8 @@
\strc_floats_get_box
\global\insidefloatfalse}
-\newdimen\availablefloatwidth
-\newdimen\availablefloatheight
+\newdimension\availablefloatwidth
+\newdimension\availablefloatheight
\def\strc_floats_set_local_hsize
{\ifconditional\c_page_floats_center_box_local
@@ -1235,18 +1340,18 @@
\installcorenamespace{floatmovement}
-\setvalue{\??floatmovement \v!line}{\strc_floats_move_down_line+}
-\setvalue{\??floatmovement+\v!line}{\strc_floats_move_down_line+}
-\setvalue{\??floatmovement-\v!line}{\strc_floats_move_down_line-}
-\setvalue{\??floatmovement \v!hang}{\strc_floats_move_down_hang\plusone}
-\setvalue{\??floatmovement+\v!hang}{\strc_floats_move_down_hang\plusone}
-\setvalue{\??floatmovement-\v!hang}{\strc_floats_move_down_hang\minusone}
+\defcsname\??floatmovement \v!line\endcsname{\strc_floats_move_down_line+}
+\defcsname\??floatmovement+\v!line\endcsname{\strc_floats_move_down_line+}
+\defcsname\??floatmovement-\v!line\endcsname{\strc_floats_move_down_line-}
+\defcsname\??floatmovement \v!hang\endcsname{\strc_floats_move_down_hang\plusone}
+\defcsname\??floatmovement+\v!hang\endcsname{\strc_floats_move_down_hang\plusone}
+\defcsname\??floatmovement-\v!hang\endcsname{\strc_floats_move_down_hang\minusone}
-\setvalue{\??floatmovement-2*\v!line}{\strc_floats_move_down_line{-2}}
-\setvalue{\??floatmovement+2*\v!line}{\strc_floats_move_down_line{2}}
-\setvalue{\??floatmovement 2*\v!line}{\strc_floats_move_down_line{2}}
+\defcsname\??floatmovement-2*\v!line\endcsname{\strc_floats_move_down_line{-2}}
+\defcsname\??floatmovement+2*\v!line\endcsname{\strc_floats_move_down_line{2}}
+\defcsname\??floatmovement 2*\v!line\endcsname{\strc_floats_move_down_line{2}}
-\permanent\protected\def\installfloatmovement#1#2{\setvalue{\??floatmovement#1}{#2}}
+\permanent\protected\def\installfloatmovement#1#2{\defcsname\??floatmovement#1\endcsname{#2}}
\def\strc_floats_move_down#setting%
{\begincsname\??floatmovement#setting\endcsname}
@@ -1256,14 +1361,14 @@
\global\d_page_sides_downshift\zeropoint
\scratchconditiononetrue
\fi
- \global\advance\d_page_sides_downshift#sign\lineheight}
+ \global\advanceby\d_page_sides_downshift#sign\lineheight}
\def\strc_floats_move_down_hang#lines%
{\ifscratchconditiontwo \else
\global\c_page_sides_n_of_lines\zerocount
\scratchconditiontwotrue
\fi
- \global\advance\c_page_sides_n_of_lines#lines\relax}
+ \global\advanceby\c_page_sides_n_of_lines#lines\relax}
\permanent\protected\def\movedownsidefloat[#settings]% already in core
{\unless\ifhastok:{#settings}%
@@ -1277,7 +1382,7 @@
\permanent\protected\def\hangsidefloat[#number]%
{\global\c_page_sides_n_of_lines#number\relax}
-\mutable\let\extrafloatlocation\empty
+\mutable\lettonothing\extrafloatlocation
\def\strc_floats_set_extra_action#rightpagelocation#leftpagelocation%
{\rightorleftpageaction
@@ -1287,23 +1392,23 @@
\installcorenamespace{extrafloataction}
-\setvalue{\??extrafloataction \v!inner}#1{\strc_floats_set_extra_action\v!left \v!right}
-\setvalue{\??extrafloataction \v!outer}#1{\strc_floats_set_extra_action\v!right \v!left}
-\setvalue{\??extrafloataction\v!innermargin}#1{\strc_floats_set_extra_action\v!leftmargin \v!rightmargin}
-\setvalue{\??extrafloataction\v!outermargin}#1{\strc_floats_set_extra_action\v!rightmargin\v!leftmargin}
-\setvalue{\??extrafloataction \v!inneredge}#1{\strc_floats_set_extra_action\v!leftedge \v!rightedge}
-\setvalue{\??extrafloataction \v!outeredge}#1{\strc_floats_set_extra_action\v!rightedge \v!leftedge}
-\setvalue{\??extrafloataction \v!backspace}#1{\strc_floats_set_extra_action\v!backspace \v!cutspace}
-\setvalue{\??extrafloataction \v!cutspace}#1{\strc_floats_set_extra_action\v!cutspace \v!backspace}
-%setvalue{\??extrafloataction \v!margin}#1{\strc_floats_set_extra_action\v!cutspace \v!backspace}
-\setvalue{\??extrafloataction \v!left}#1{\strc_floats_set_extra_action\v!left \v!left}
-\setvalue{\??extrafloataction \v!right}#1{\strc_floats_set_extra_action\v!right \v!right}
-\setvalue{\??extrafloataction \v!line}#1{} % only -n*line is handled (see ***)
-\setvalue{\??extrafloataction \s!unknown}#1{\movedownsidefloat[#1]}
+\defcsname\??extrafloataction \v!inner\endcsname#1{\strc_floats_set_extra_action\v!left \v!right}
+\defcsname\??extrafloataction \v!outer\endcsname#1{\strc_floats_set_extra_action\v!right \v!left}
+\defcsname\??extrafloataction\v!innermargin\endcsname#1{\strc_floats_set_extra_action\v!leftmargin \v!rightmargin}
+\defcsname\??extrafloataction\v!outermargin\endcsname#1{\strc_floats_set_extra_action\v!rightmargin\v!leftmargin}
+\defcsname\??extrafloataction \v!inneredge\endcsname#1{\strc_floats_set_extra_action\v!leftedge \v!rightedge}
+\defcsname\??extrafloataction \v!outeredge\endcsname#1{\strc_floats_set_extra_action\v!rightedge \v!leftedge}
+\defcsname\??extrafloataction \v!backspace\endcsname#1{\strc_floats_set_extra_action\v!backspace \v!cutspace}
+\defcsname\??extrafloataction \v!cutspace\endcsname#1{\strc_floats_set_extra_action\v!cutspace \v!backspace}
+%defcsname\??extrafloataction \v!margin\endcsname#1{\strc_floats_set_extra_action\v!cutspace \v!backspace}
+\defcsname\??extrafloataction \v!left\endcsname#1{\strc_floats_set_extra_action\v!left \v!left}
+\defcsname\??extrafloataction \v!right\endcsname#1{\strc_floats_set_extra_action\v!right \v!right}
+\defcsname\??extrafloataction \v!line\endcsname#1{} % only -n*line is handled (see ***)
+\defcsname\??extrafloataction \s!unknown\endcsname#1{\movedownsidefloat[#1]}
\def\strc_floats_check_extra_actions % less tracingthis way ....
{\doifnotinset\v!text\floatlocation % fuzzy, text overloads left, since then it's a directive
- {\let\extrafloatlocation\empty
+ {\lettonothing\extrafloatlocation
% \d_page_sides_downshift will be reset afterwards, and can
% already be set at this point
\processcommacommand[\floatlocation]\strc_floats_check_extra_actions_step
@@ -1488,7 +1593,7 @@
\whitespace
\blank[\rootfloatparameter\c!spacebefore]%
\doifnotinset\v!tall\floatlocation
- {\dp\floatbox\openstrutdepth}% dp\strutbox}% % toegevoegd
+ {\dp\floatbox\openstrutdepth}% \strutdp % toegevoegd
\box\floatbox
\dostoptagged
\blank[\rootfloatparameter\c!spaceafter]%
@@ -1564,16 +1669,16 @@
\let\strc_floats_align_indeed_local\firstofoneargument
-\newdimen\d_strc_floats_content
-\newdimen\d_strc_float_temp_height
-\newdimen\d_strc_float_temp_width
+\newdimension\d_strc_floats_content
+\newdimension\d_strc_float_temp_height
+\newdimension\d_strc_float_temp_width
\newconditional\c_floats_adapt_to_caption_width
\newconditional\c_floats_store_minimal_package
-\newdimen\d_strc_floats_caption_hsize
-\newdimen\d_strc_floats_caption_min_width
-\newdimen\d_strc_floats_caption_overshoot
+\newdimension\d_strc_floats_caption_hsize
+\newdimension\d_strc_floats_caption_min_width
+\newdimension\d_strc_floats_caption_overshoot
% These are expandable, for diagnostic purposes only, but might eventually go away:
@@ -1617,12 +1722,15 @@
\strc_floats_prepare_no_caption
\strc_floats_set_caption_dimensions\voidbox
%\page_backgrounds_add_local_to_box\floatbox % was \doglobal but not needed
+\ifx\forcedfloatmethod\v!local
+ % we need \ifinfloatcombination
+ \strc_floats_build_box
+\fi
\else
% todo: installable maken, variant/method=auto vs macro
\strc_floats_prepare_page_caption
%\page_backgrounds_add_local_to_box\b_strc_floats_content
- \setbox\b_strc_floats_caption\hbox % text
- {\floatcaptionparameter\c!command{\box\b_strc_floats_caption}}%
+ \strc_floats_apply_caption_command
\strc_floats_set_caption_dimensions\b_strc_floats_caption
%\moveboxontogrid\b_strc_floats_caption{\floatcaptionparameter\c!grid}\d_strc_floats_caption_height
%\page_backgrounds_add_local_to_box\b_strc_floats_caption
@@ -2021,13 +2129,13 @@
\def\strc_floats_build_box_top_stack_normal
{\doifelseinset\v!overlay{\floatcaptionparameter\c!location}
- \strc_floats_build_box_top_stack_normal_overlay
- \strc_floats_build_box_top_stack_normal_content}
+ \strc_floats_build_box_top_stack_normal_overlay
+ \strc_floats_build_box_top_stack_normal_content}
\def\strc_floats_build_box_bottom_stack_normal
{\doifinset\v!overlay{\floatcaptionparameter\c!location}
- \strc_floats_build_box_bottom_stack_normal_overlay
- \strc_floats_build_box_bottom_stack_normal_content}
+ \strc_floats_build_box_bottom_stack_normal_overlay
+ \strc_floats_build_box_bottom_stack_normal_content}
\def\strc_floats_build_box_top_stack_grid
{\dp\b_strc_floats_caption\strutdepth
@@ -2122,7 +2230,7 @@
\def\strc_floats_relocate_caption_right#1{\strc_floats_align_caption{\hbox to \d_strc_float_temp_width{\hss#1}}}
\def\strc_floats_relocate_caption_left #1{\strc_floats_align_caption{\hbox to \d_strc_float_temp_width{#1\hss}}}
-\permanent\protected\def\installfloatboxbuilder#1#2{\setvalue{\??floatbuilder#1}{#2}}
+\permanent\protected\def\installfloatboxbuilder#1#2{\defcsname\??floatbuilder#1\endcsname{#2}}
\def\strc_floats_build_box
{\strc_floats_build_box_before
@@ -2293,7 +2401,7 @@
\else
\strc_floats_check_caption_content
\strc_floats_prepare_side_caption
- \setbox\b_strc_floats_caption\hbox{\floatcaptionparameter\c!command{\box\b_strc_floats_caption}}% \hpack ?
+ \strc_floats_apply_caption_command
%\moveboxontogrid\b_strc_floats_caption{\floatcaptionparameter\c!grid}\d_strc_floats_caption_height
%\page_backgrounds_add_local_to_box\b_strc_floats_caption
\strc_floats_build_side_box
@@ -2357,13 +2465,13 @@
% \expandnamespacemacro\??floatpreparesidecaption\p_strc_floats_caption_width\s!unknown
% \dostoptagged}
%
-% \setvalue{\??floatpreparesidecaption\v!max}%
+% \defcsname\??floatpreparesidecaption\v!max\endcsname
% {\setbox\b_strc_floats_caption\vbox
% {\strc_floats_caption_set_align
% \hsize\wd\b_strc_floats_content
% \strc_floats_make_complete_caption}}
%
-% \setvalue{\??floatpreparesidecaption\v!fit}%
+% \defcsname\??floatpreparesidecaption\v!fit\endcsname
% {\ifdim\wd\b_strc_floats_caption>\wd\b_strc_floats_content\relax
% \setbox\b_strc_floats_caption\vbox
% {\forgetall % needed?
@@ -2374,7 +2482,7 @@
% {\hss\hbox{\strc_floats_make_complete_caption}\hss}%
% \fi}
%
-% \setvalue{\??floatpreparesidecaption\s!unknown}%
+% \defcsname\??floatpreparesidecaption\s!unknown\endcsname
% {\setbox\b_strc_floats_caption\vbox
% {\strc_floats_caption_set_align
% \hsize\p_strc_floats_caption_width % \wd\b_strc_floats_content
@@ -2403,7 +2511,7 @@
\strc_floats_set_page_variant
\fi
\strc_floats_set_local_dimensions
- \global\advance\totalnoffloats\plusone
+ \global\advanceby\totalnoffloats\plusone
\ifconditional\c_floats_store_minimal_package \else
\setbox\floatbox\hpack{\strc_float_save_data\box\floatbox}% still needed? we will do renumbering differently
\fi
@@ -2450,13 +2558,12 @@
\installcorenamespace{floatmethods}
-\mutable\let\floatmethod \empty % set by lua
-\mutable\let\floatlabel \empty % set by lua
-\mutable\let\floatcolumn \empty % set by lua
-\mutable\let\floatrow \empty % set by lua
-\mutable\let\floatspecification\empty
-
-\mutable\let\forcedfloatmethod \empty % set by lua and floatcombinations
+\mutable\lettonothing\floatmethod % set by lua
+\mutable\lettonothing\floatlabel % set by lua
+\mutable\lettonothing\floatcolumn % set by lua
+\mutable\lettonothing\floatrow % set by lua
+\mutable\lettonothing\floatspecification
+\mutable\lettonothing\forcedfloatmethod % set by lua and floatcombinations
\permanent\protected\def\setfloatmethodvariables#1% \floatmethod \floatlabel \floatrow \floatcolumn
{\clf_analysefloatmethod{#1}} % move definition to lua end
@@ -2467,7 +2574,10 @@
\def\strc_floats_get_box
{\ifvisible
\ifcsname\??floatmethods\currentoutputroutine:\floatmethod\endcsname \else
- \let\floatmethod\v!here
+ \let\floatmethod\floatlocationdefault
+ \ifcsname\??floatmethods\currentoutputroutine:\floatmethod\endcsname \else
+ \let\floatmethod\v!here
+ \fi
\fi
\ifempty\forcedfloatmethod \else
\let\floatmethod\forcedfloatmethod
@@ -2485,7 +2595,7 @@
\installcorenamespace{floatsettings}
\permanent\protected\def\installfloatmethod#1#2#3% routine keyword handler
- {\setvalue{\??floatmethods#1:#2}{#3}}
+ {\defcsname\??floatmethods#1:#2\endcsname{#3}}
\permanent\protected\def\handlefloatmethod#1%
{\csname\??floatmethods\currentoutputroutine:#1\endcsname}
@@ -2494,7 +2604,7 @@
% {\ifcsname\??floatsettings#1:#2\endcsname \else
% \expandafter\newtoks\csname\??floatsettings#1:#2\endcsname
% \fi
-% \setvalue{\??floatmethods#1:#2}{#3}}
+% \defcsname\??floatmethods#1:#2\endcsname{#3}}
%
% \protected\def\startfloatmethodsettings#1#2 #3\stopfloatmethodsettings
% {\csname\??floatsettings#1:#2\endcsname\expandafter{\the\csname\??floatsettings#1:#2\endcsname#3}}
@@ -2566,14 +2676,15 @@
\initializeboxstack\??localfloatstack
-\newcount\c_strc_localfloats_n \aliased\let\noflocalfloats\c_strc_localfloats_n
+%newcount \c_strc_localfloats_n \aliased\let \noflocalfloats\c_strc_localfloats_n
+\newinteger\c_strc_localfloats_n \aliasinteger\noflocalfloats\c_strc_localfloats_n
\permanent\protected\def\resetlocalfloats
{\global\c_strc_localfloats_n\zerocount
\initializeboxstack\??localfloatstack}
\permanent\protected\def\somelocalfloat
- {\global\advance\c_strc_localfloats_n\plusone
+ {\global\advanceby\c_strc_localfloats_n\plusone
\savebox\??localfloatstack{\number\c_strc_localfloats_n}{\box\floatbox}}
\permanent\protected\def\getlocalfloats
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-ind.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-ind.mkxl
index 31d7eb5755a..10bd7f468f7 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/strc-ind.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-ind.mkxl
@@ -55,9 +55,9 @@
%D
%D \typebuffer \getbuffer
-\newcount\c_strc_indentedtexts_nesting
-\newdimen\d_strc_indentedtexts_width
-\newdimen\d_strc_indentedtexts_distance
+\newinteger \c_strc_indentedtexts_nesting
+\newdimension\d_strc_indentedtexts_width
+\newdimension\d_strc_indentedtexts_distance
\appendtoks
\frozen\instance\setuevalue {\e!start\currentindentedtext}{\strc_indentedtexts_start{\currentindentedtext}\c_strc_indentedtexts_nesting}%
@@ -84,7 +84,7 @@
\indentedtextparameter\c!sample
\spr{\indentedtextparameter\c!separator}}
{\d_strc_indentedtexts_distance}%
- \advance\d_strc_indentedtexts_width \d_strc_indentedtexts_distance
+ \advanceby\d_strc_indentedtexts_width \d_strc_indentedtexts_distance
\setbox\scratchbox\hbox to \d_strc_indentedtexts_width
{\useindentedtextstyleandcolor\c!headstyle\c!headcolor
\strut
@@ -94,7 +94,7 @@
\hskip\d_strc_indentedtexts_distance}%
\parindent\zeropoint
\hskip\c_strc_indentedtexts_nesting\d_strc_indentedtexts_width
- \advance\c_strc_indentedtexts_nesting\plusone
+ \advanceby\c_strc_indentedtexts_nesting\plusone
\dontleavehmode\box\scratchbox
\hangindent\c_strc_indentedtexts_nesting\d_strc_indentedtexts_width
\useindentedtextstyleandcolor\c!style\c!color}
@@ -109,8 +109,11 @@
\permanent\let\stopindentedtext\strc_indentedtexts_stop
-\protected\def\strc_indentedtexts_direct#1#2#3\par % no longer clever grabpar trickery
- {\strc_indentedtexts_start{#1}{#2}#3\strc_indentedtexts_stop}
+% \protected\def\strc_indentedtexts_direct#1#2#3\par % no longer clever grabpar trickery
+% {\strc_indentedtexts_start{#1}{#2}#3\strc_indentedtexts_stop}
+
+\protected\def\strc_indentedtexts_direct#1#2% more modern anyway
+ {\strc_indentedtexts_start{#1}{#2}\wrapuppar{\strc_indentedtexts_stop}}
\setupindentedtext
[\c!style=\v!normal,
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-itm.mklx b/Master/texmf-dist/tex/context/base/mkxl/strc-itm.mklx
index efead3d83a7..a3a4c004076 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/strc-itm.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-itm.mklx
@@ -203,31 +203,31 @@
% 0 = before/after
% 1 = between unless before
-% 2 = between
+% 2 = between (auto)
\newconstant \c_strc_itemgroups_spacing_mode \c_strc_itemgroups_spacing_mode\plustwo
\newconditional\c_strc_itemgroups_optimize \settrue\c_strc_itemgroups_optimize
\newconditional\c_strc_itemgroups_auto_concat \settrue\c_strc_itemgroups_auto_concat
-\newsignal \d_strc_itemgroups_signal
+\newboundary \c_strc_itemgroups_boundary
\newbox \b_strc_itemgroups
-\newdimen \d_strc_itemgroups_list_width
-\newdimen \d_strc_itemgroups_asked_width
+\newdimension \d_strc_itemgroups_list_width
+\newdimension \d_strc_itemgroups_asked_width
-\newdimen \d_strc_itemgroups_max_width % multipass
-\newcount \c_strc_itemgroups_max_items % multipass
+\newdimension \d_strc_itemgroups_max_width \def\d_strc_itemgroups_max_width_reference{\d_strc_itemgroups_max_width}
+\newinteger \c_strc_itemgroups_max_items
-\newcount \c_strc_itemgroups_n_of_items
-\newcount \c_strc_itemgroups_nesting
-\newcount \c_strc_itemgroups_column_depth
+\newinteger \c_strc_itemgroups_n_of_items
+\newinteger \c_strc_itemgroups_nesting
+\newinteger \c_strc_itemgroups_column_depth
\def \v_strc_itemgroups_counter {itemgroup:\currentparentitemgroup}
-\let \m_strc_itemgroups_repeat_start \empty
+\lettonothing \m_strc_itemgroups_repeat_start
\def \v_strc_itemgroups_unknown_symbol {?}
-\let \m_strc_itemgroups_indenting \empty
-\let \m_strc_itemgroups_destination \empty
+\lettonothing \m_strc_itemgroups_indenting
+\lettonothing \m_strc_itemgroups_destination
\mutable\let \currentitemlevel \!!zerocount % public
\mutable\def \currentnofitems {\the\c_strc_itemgroups_max_items}
@@ -235,9 +235,9 @@
\newtoks \itemgroupcommands % maybe public
-\mutable\def \currentitemgroupsymbol {n} % here we cannot use a _ in the name
-\mutable\let \currentitemgroupconversionset \empty % here we cannot use a _ in the name
-\mutable\let \currentitemgroupsegments \empty
+\mutable\def \currentitemgroupsymbol {n} % here we cannot use a _ in the name
+\mutable\lettonothing \currentitemgroupconversionset % here we cannot use a _ in the name
+\mutable\lettonothing \currentitemgroupsegments
\def\strc_itemgroups_register_status
{\clf_registeritemgroup{\currentparentitemgroup}\c_strc_itemgroups_nesting\c_strc_itemgroups_n_of_items\dimexpr\itemgroupparameter\c!maxwidth\relax}
@@ -369,21 +369,28 @@
\fi
\fi}
-\def\strc_itemgroups_insert_breakallow {\strc_itemgroups_insert_break_when_needed\strc_itemgroups_insert_breakallow_indeed}
-\def\strc_itemgroups_insert_breakno {\strc_itemgroups_insert_break_when_needed\strc_itemgroups_insert_breakno_indeed }
-\def\strc_itemgroups_insert_break {\strc_itemgroups_insert_break_when_needed\strc_itemgroups_insert_break_indeed }
-\def\strc_itemgroups_insert_nobreak {\strc_itemgroups_insert_break_when_needed\strc_itemgroups_insert_nobreak_indeed }
-
-\def\strc_itemgroups_insert_breakallow_indeed{\vspacing[\v!item @0]}
-\def\strc_itemgroups_insert_breakno_indeed {\vspacing[\v!item @10000]}
-\def\strc_itemgroups_insert_break_indeed {\flushnotes
- \vspacing[\v!item @-5]}
-\def\strc_itemgroups_insert_nobreak_indeed {\flushnotes
- \ifinsidecolumns % todo
- \vspacing[\v!item @5]%
- \else
- \vspacing[\v!item @500]%
- \fi}
+\def\strc_itemgroups_insert_breakallow{\strc_itemgroups_insert_break_when_needed\strc_itemgroups_insert_breakallow_indeed}
+\def\strc_itemgroups_insert_breakno {\strc_itemgroups_insert_break_when_needed\strc_itemgroups_insert_breakno_indeed }
+\def\strc_itemgroups_insert_break {\strc_itemgroups_insert_break_when_needed\strc_itemgroups_insert_break_indeed }
+\def\strc_itemgroups_insert_nobreak {\strc_itemgroups_insert_break_when_needed\strc_itemgroups_insert_nobreak_indeed }
+
+\def\strc_itemgroups_insert_breakallow_indeed
+ {\vspacing[\v!item @0]}
+
+\def\strc_itemgroups_insert_breakno_indeed
+ {\vspacing[\v!item @10000]}
+
+\def\strc_itemgroups_insert_break_indeed
+ {\flushnotes
+ \vspacing[\v!item @-5]}
+
+\def\strc_itemgroups_insert_nobreak_indeed
+ {\flushnotes
+ \ifinsidecolumns % todo
+ \vspacing[\v!item @5]%
+ \else
+ \vspacing[\v!item @500]%
+ \fi}
\protected\def\strc_itemgroups_process_options#options%
{\processcommacommand[#options]\strc_itemgroups_process_option} % expansion of options is handy for xml
@@ -393,8 +400,8 @@
% \protected\def\strc_itemgroups_process_options#options%
% {\normalexpanded{\strc_itemgroups_process_option_list[#options]}} % expansion of options is handy for xml
-\mutable\let\itemgroupfirst \empty
-\mutable\let\itemgroupsecond\empty
+\mutable\lettonothing\itemgroupfirst
+\mutable\lettonothing\itemgroupsecond
\def\strc_itemgroups_process_option#option%
{\edef\scratchstringone{#option}%
@@ -421,65 +428,123 @@
\setfalse\c_strc_itemgroups_pack
\fi}
-\setvalue{\??itemgroupkeyword\!!zerocount }{} % ignore 0
-\setvalue{\??itemgroupkeyword\v!packed }{\strc_itemgroups_process_set_option_pack}
-\setvalue{\??itemgroupkeyword\v!unpacked }{\strc_itemgroups_process_set_option_unpack}
-\setvalue{\??itemgroupkeyword\v!intro }{\settrue\c_strc_itemgroups_intro} % here? not set to false
-\setvalue{\??itemgroupkeyword\v!autointro }{\settrue\c_strc_itemgroups_auto_intro}
-\setvalue{\??itemgroupkeyword\v!broad }{\ifempty\itemgroupfirst
- \let\itemgroupfirst\!!plusone
- \fi
- \letitemgroupparameter\c!factor\itemgroupfirst}
-\setvalue{\??itemgroupkeyword\v!text }{\settrue\c_strc_itemgroups_text
- \settrue\c_strc_itemgroups_inline
- \settrue\c_strc_itemgroups_joined
- \strc_itemgroups_process_set_option_pack}
-\setvalue{\??itemgroupkeyword\v!before }{\settrue\c_strc_itemgroups_before}
-\setvalue{\??itemgroupkeyword\v!after }{\settrue\c_strc_itemgroups_after}
-\setvalue{\??itemgroupkeyword\v!nowhite }{\settrue\c_strc_itemgroups_nowhite}
-\setvalue{\??itemgroupkeyword\v!margin }{\setitemgroupparameter\c!width{-2em}} % signal
-\setvalue{\??itemgroupkeyword\v!inmargin }{\setitemgroupparameter\c!width{-2em}} % signal
-\setvalue{\??itemgroupkeyword\v!atmargin }{\ifnum\c_strc_itemgroups_nesting>\plusone
- \setitemgroupparameter\c!width{0em}%
- \fi} % signal
-\setvalue{\??itemgroupkeyword\v!intext }{\settrue\c_strc_itemgroups_inline}
-\setvalue{\??itemgroupkeyword\v!headintext }{\settrue\c_strc_itemgroups_inline_head}
-\setvalue{\??itemgroupkeyword\v!loose }{\setfalse\c_strc_itemgroups_optimize}
-\setvalue{\??itemgroupkeyword\v!fit }{\settrue\c_strc_itemgroups_fitting}
-\setvalue{\??itemgroupkeyword\v!nofit }{\setfalse\c_strc_itemgroups_fitting}
-\setvalue{\??itemgroupkeyword\v!paragraph }{\settrue\c_strc_itemgroups_paragraph
- \strc_itemgroups_process_set_option_pack}
-\setvalue{\??itemgroupkeyword\v!joinedup }{\settrue\c_strc_itemgroups_joined
- \strc_itemgroups_process_set_option_pack}
-\setvalue{\??itemgroupkeyword\v!notjoinedup}{\setfalse\c_strc_itemgroups_joined}
-\setvalue{\??itemgroupkeyword\v!serried }{\edef\itemgroupfirst{-\ifempty\itemgroupfirst1\else\itemgroupfirst\fi}%
- \letitemgroupparameter\c!factor\itemgroupfirst}
-\setvalue{\??itemgroupkeyword\v!stopper }{\letitemgroupparameter\c!placestopper\v!yes} % keep {}
-\setvalue{\??itemgroupkeyword\v!nostopper }{\letitemgroupparameter\c!placestopper\v!no} % keep {}
-\setvalue{\??itemgroupkeyword\v!repeat }{\settrue\c_strc_itemgroups_repeat}
-\setvalue{\??itemgroupkeyword\v!norepeat }{\setfalse\c_strc_itemgroups_repeat}
-\setvalue{\??itemgroupkeyword\v!reverse }{\settrue\c_strc_itemgroups_reverse}
-\setvalue{\??itemgroupkeyword\v!columns }{\settrue\c_strc_itemgroups_columns}
-\setvalue{\??itemgroupkeyword\v!one }{\letitemgroupparameter\c!n\plusone}
-\setvalue{\??itemgroupkeyword\v!two }{\letitemgroupparameter\c!n\plustwo}
-\setvalue{\??itemgroupkeyword\v!three }{\letitemgroupparameter\c!n\plusthree}
-\setvalue{\??itemgroupkeyword\v!four }{\letitemgroupparameter\c!n\plusfour}
-\setvalue{\??itemgroupkeyword\v!five }{\letitemgroupparameter\c!n\plusfive}
-\setvalue{\??itemgroupkeyword\v!six }{\letitemgroupparameter\c!n\plussix}
-\setvalue{\??itemgroupkeyword\v!seven }{\letitemgroupparameter\c!n\plusseven}
-\setvalue{\??itemgroupkeyword\v!eight }{\letitemgroupparameter\c!n\pluseight}
-\setvalue{\??itemgroupkeyword\v!nine }{\letitemgroupparameter\c!n\plusnine}
-\setvalue{\??itemgroupkeyword\v!standard }{\setitemgroupparameter\c!width {1.5\emwidth}%
- \setitemgroupparameter\c!distance {.5\emwidth}%
- %\letitemgroupparameter\c!factor \!!zerocount
- \letitemgroupparameter\c!factor {\zerocount}%
- \setitemgroupparameter\c!packcriterium{\zerocount}%
- \letitemgroupparameter\c!inner \empty
- \letitemgroupparameter\c!beforehead \empty
- \letitemgroupparameter\c!afterhead \blank
- \letitemgroupparameter\c!before \blank
- \letitemgroupparameter\c!inbetween \blank
- \letitemgroupparameter\c!after \blank}
+\defcsname\??itemgroupkeyword\!!zerocount\endcsname
+ {} % ignore 0
+
+\defcsname\??itemgroupkeyword\v!packed\endcsname
+ {\strc_itemgroups_process_set_option_pack}
+
+\defcsname\??itemgroupkeyword\v!unpacked\endcsname
+ {\strc_itemgroups_process_set_option_unpack}
+
+\defcsname\??itemgroupkeyword\v!intro\endcsname
+ {\settrue\c_strc_itemgroups_intro} % here? not set to false
+
+\defcsname\??itemgroupkeyword\v!autointro\endcsname
+ {\settrue\c_strc_itemgroups_auto_intro}
+
+\defcsname\??itemgroupkeyword\v!broad\endcsname
+ {\ifempty\itemgroupfirst
+ \let\itemgroupfirst\!!plusone
+ \fi
+ \letitemgroupparameter\c!factor\itemgroupfirst}
+
+\defcsname\??itemgroupkeyword\v!text\endcsname
+ {\settrue\c_strc_itemgroups_text
+ \settrue\c_strc_itemgroups_inline
+ \settrue\c_strc_itemgroups_joined
+ \strc_itemgroups_process_set_option_pack}
+
+\defcsname\??itemgroupkeyword\v!before\endcsname
+ {\settrue\c_strc_itemgroups_before}
+
+\defcsname\??itemgroupkeyword\v!after\endcsname
+ {\settrue\c_strc_itemgroups_after}
+
+\defcsname\??itemgroupkeyword\v!nowhite\endcsname
+ {\settrue\c_strc_itemgroups_nowhite}
+
+\defcsname\??itemgroupkeyword\v!margin\endcsname % signal
+ {\setitemgroupparameter\c!width{-2em}}
+
+\defcsname\??itemgroupkeyword\v!inmargin\endcsname % signal
+ {\setitemgroupparameter\c!width{-2em}}
+
+\defcsname\??itemgroupkeyword\v!atmargin\endcsname% signal
+ {\ifnum\c_strc_itemgroups_nesting>\plusone
+ \setitemgroupparameter\c!width{0em}%
+ \fi}
+
+\defcsname\??itemgroupkeyword\v!intext\endcsname
+ {\settrue\c_strc_itemgroups_inline}
+
+\defcsname\??itemgroupkeyword\v!headintext\endcsname
+ {\settrue\c_strc_itemgroups_inline_head}
+
+\defcsname\??itemgroupkeyword\v!loose\endcsname
+ {\setfalse\c_strc_itemgroups_optimize}
+
+\defcsname\??itemgroupkeyword\v!fit\endcsname
+ {\settrue\c_strc_itemgroups_fitting}
+
+\defcsname\??itemgroupkeyword\v!nofit\endcsname
+ {\setfalse\c_strc_itemgroups_fitting}
+
+\defcsname\??itemgroupkeyword\v!paragraph\endcsname
+ {\settrue\c_strc_itemgroups_paragraph
+ \strc_itemgroups_process_set_option_pack}
+
+\defcsname\??itemgroupkeyword\v!joinedup\endcsname
+ {\settrue\c_strc_itemgroups_joined
+ \strc_itemgroups_process_set_option_pack}
+
+\defcsname\??itemgroupkeyword\v!notjoinedup\endcsname
+ {\setfalse\c_strc_itemgroups_joined}
+
+\defcsname\??itemgroupkeyword\v!serried\endcsname
+ {\edef\itemgroupfirst{-\ifempty\itemgroupfirst1\else\itemgroupfirst\fi}%
+ \letitemgroupparameter\c!factor\itemgroupfirst}
+
+\defcsname\??itemgroupkeyword\v!stopper\endcsname
+ {\letitemgroupparameter\c!placestopper\v!yes} % keep {}
+
+\defcsname\??itemgroupkeyword\v!nostopper\endcsname
+ {\letitemgroupparameter\c!placestopper\v!no} % keep {}
+
+\defcsname\??itemgroupkeyword\v!repeat\endcsname
+ {\settrue\c_strc_itemgroups_repeat}
+
+\defcsname\??itemgroupkeyword\v!norepeat\endcsname
+ {\setfalse\c_strc_itemgroups_repeat}
+
+\defcsname\??itemgroupkeyword\v!reverse\endcsname
+ {\settrue\c_strc_itemgroups_reverse}
+
+\defcsname\??itemgroupkeyword\v!columns\endcsname
+ {\settrue\c_strc_itemgroups_columns}
+
+\defcsname\??itemgroupkeyword\v!one \endcsname{\letitemgroupparameter\c!n\plusone}
+\defcsname\??itemgroupkeyword\v!two \endcsname{\letitemgroupparameter\c!n\plustwo}
+\defcsname\??itemgroupkeyword\v!three\endcsname{\letitemgroupparameter\c!n\plusthree}
+\defcsname\??itemgroupkeyword\v!four \endcsname{\letitemgroupparameter\c!n\plusfour}
+\defcsname\??itemgroupkeyword\v!five \endcsname{\letitemgroupparameter\c!n\plusfive}
+\defcsname\??itemgroupkeyword\v!six \endcsname{\letitemgroupparameter\c!n\plussix}
+\defcsname\??itemgroupkeyword\v!seven\endcsname{\letitemgroupparameter\c!n\plusseven}
+\defcsname\??itemgroupkeyword\v!eight\endcsname{\letitemgroupparameter\c!n\pluseight}
+\defcsname\??itemgroupkeyword\v!nine \endcsname{\letitemgroupparameter\c!n\plusnine}
+
+\defcsname\??itemgroupkeyword\v!standard\endcsname
+ {\setitemgroupparameter \c!width {1.5\emwidth}%
+ \setitemgroupparameter \c!distance {.5\emwidth}%
+ %\letitemgroupparameter \c!factor \!!zerocount
+ \letitemgroupparameter \c!factor {\zerocount}%
+ \setitemgroupparameter \c!packcriterium{\zerocount}%
+ \resetitemgroupparameter\c!inner
+ \resetitemgroupparameter\c!beforehead
+ \letitemgroupparameter \c!afterhead \blank
+ \letitemgroupparameter \c!before \blank
+ \letitemgroupparameter \c!inbetween \blank
+ \letitemgroupparameter \c!after \blank}
\def\strc_itemgroups_initialize_local
{\setfalse\c_strc_itemgroups_inline
@@ -503,23 +568,30 @@
\setfalse\c_strc_itemgroups_symbol
\setfalse\c_strc_itemgroups_columns
% to be checked
- \let\m_strc_itemgroups_destination\empty
- \let\strc_itemgroups_used_symbol \empty % ** start value
- \let\strc_itemgroups_margin_symbol\empty
- \let\strc_itemgroups_extra_symbol \empty
+ \lettonothing\m_strc_itemgroups_destination
+ \lettonothing\strc_itemgroups_used_symbol % ** start value
+ \lettonothing\strc_itemgroups_margin_symbol
+ \lettonothing\strc_itemgroups_extra_symbol
%
\global\letitemgroupparameter\c!maxwidth\!!zeropoint
}
-\setvalue{\??itemgroupfirst\v!intro }{\settrue\c_strc_itemgroups_intro}
-\setvalue{\??itemgroupfirst\v!continue }{\settrue\c_strc_itemgroups_continue}
-\setvalue{\??itemgroupfirst\v!random }{\settrue\c_strc_itemgroups_randomize
- \settrue\c_strc_itemgroups_collecting}
-\setvalue{\??itemgroupkeyword\v!horizontal}{\settrue\c_strc_itemgroups_horizontal
- \settrue\c_strc_itemgroups_collecting
- \settrue\c_strc_itemgroups_inline
- \settrue\c_strc_itemgroups_joined
- \strc_itemgroups_process_set_option_pack}
+\defcsname\??itemgroupfirst\v!intro\endcsname
+ {\settrue\c_strc_itemgroups_intro}
+
+\defcsname\??itemgroupfirst\v!continue\endcsname
+ {\settrue\c_strc_itemgroups_continue}
+
+\defcsname\??itemgroupfirst\v!random\endcsname
+ {\settrue\c_strc_itemgroups_randomize
+ \settrue\c_strc_itemgroups_collecting}
+
+\defcsname\??itemgroupkeyword\v!horizontal\endcsname
+ {\settrue\c_strc_itemgroups_horizontal
+ \settrue\c_strc_itemgroups_collecting
+ \settrue\c_strc_itemgroups_inline
+ \settrue\c_strc_itemgroups_joined
+ \strc_itemgroups_process_set_option_pack}
\def\strc_itemgroups_preset_stage_one#options%
{\processcommacommand[#options]\strc_itemgroups_preset_stage_one_indeed}
@@ -682,9 +754,18 @@
\installcorenamespace{itemstopper}
-\setvalue{\??itemstopper\v!yes }{\itemgroupparameter\c!stopper}
-\setvalue{\??itemstopper\v!display}{\ifconditional\c_strc_itemgroups_inline\else\itemgroupparameter\c!stopper\fi}
-\setvalue{\??itemstopper\v!inline }{\ifconditional\c_strc_itemgroups_inline\itemgroupparameter\c!stopper\fi}
+\defcsname\??itemstopper\v!yes\endcsname
+ {\itemgroupparameter\c!stopper}
+
+\defcsname\??itemstopper\v!display\endcsname
+ {\ifconditional\c_strc_itemgroups_inline\else
+ \itemgroupparameter\c!stopper
+ \fi}
+
+\defcsname\??itemstopper\v!inline\endcsname
+ {\ifconditional\c_strc_itemgroups_inline
+ \itemgroupparameter\c!stopper
+ \fi}
\def\strc_itemgroups_insert_item_counter_indeed % quite slow ... every time this setup .. but it
{\begingroup % can be optimized ... best move some to strc-num
@@ -741,11 +822,11 @@
% \strc_itemgroups_insert_reference
% \endgroup}
-\let\strc_itemgroups_temp_symbol \empty
-\let\strc_itemgroups_used_symbol \empty
-\let\strc_itemgroups_asked_symbol \empty
-\let\strc_itemgroups_margin_symbol\empty
-\let\strc_itemgroups_extra_symbol \empty
+\lettonothing\strc_itemgroups_temp_symbol
+\lettonothing\strc_itemgroups_used_symbol
+\lettonothing\strc_itemgroups_asked_symbol
+\lettonothing\strc_itemgroups_margin_symbol
+\lettonothing\strc_itemgroups_extra_symbol
\def\strc_itemgroups_set_symbol#symbol%
{\edef\strc_itemgroups_temp_symbol{#symbol}%
@@ -762,14 +843,14 @@
\strc_itemgroups_store_global_symbol\currentitemgroupsymbol
\strc_itemgroups_store_local_symbol\v_strc_itemgroups_unknown_symbol
\let\strc_itemgroups_used_symbol\strc_itemgroups_set_symbol_symbol_item
- \let\strc_itemgroups_asked_symbol\empty}
+ \lettonothing\strc_itemgroups_asked_symbol}
\def\strc_itemgroups_set_symbol_conversion
{\let\currentitemgroupsymbol\strc_itemgroups_temp_symbol
\strc_itemgroups_store_global_symbol\currentitemgroupsymbol
\strc_itemgroups_store_local_symbol\strc_itemgroups_insert_item_counter
\let\strc_itemgroups_used_symbol\strc_itemgroups_set_symbol_conversion_item
- \let\strc_itemgroups_asked_symbol\empty}
+ \lettonothing\strc_itemgroups_asked_symbol}
\def\strc_itemgroups_set_symbol_symbol_item
{\symbol[\currentitemgroupsymbol]}
@@ -794,29 +875,29 @@
\orelse\ifnum\itemgroupparameter\c!factor>\zerocount
\d_strc_itemgroups_list_width\itemgroupparameter\c!step\relax
\ifzeropt\d_strc_itemgroups_list_width \d_strc_itemgroups_list_width=.5em\fi
- \multiply\d_strc_itemgroups_list_width \itemgroupparameter\c!factor
- \advance\d_strc_itemgroups_list_width\itemgroupparameter\c!width\relax
+ \multiplyby\d_strc_itemgroups_list_width \itemgroupparameter\c!factor
+ \advanceby\d_strc_itemgroups_list_width\itemgroupparameter\c!width\relax
\else
\d_strc_itemgroups_list_width\itemgroupparameter\c!width\relax
\fi
- \advance\d_strc_itemgroups_list_width\itemgroupparameter\c!distance\relax
+ \advanceby\d_strc_itemgroups_list_width\itemgroupparameter\c!distance\relax
\let\currentitemgroup\m_strc_itemgroups_saved}
-\let\p_itemgroups_options \empty
-\let\p_itemgroups_extra_options\empty
+\lettonothing\p_itemgroups_options
+\lettonothing\p_itemgroups_extra_options
\permanent\tolerant\protected\def\startitemgroup[#category]#spacer[#options]#spacer[#settings]%
{\begingroup % (1)
\nofarguments\lastarguments
\def\currentitemgroup{#category}% no nested mixing of itemgroups
\let\currentparentitemgroup\currentitemgroup
- \global\advance\c_strc_itemgroups_nesting\plusone
+ \global\advanceby\c_strc_itemgroups_nesting\plusone
\def\currentitemlevel{\number\c_strc_itemgroups_nesting}%
\normalexpanded{\chaintocurrentitemgroup{\currentparentitemgroup:\currentitemlevel}}%
\edef\currentitemgroup{\currentparentitemgroup:\currentitemlevel}%
%
\edef\p_itemgroups_options{\itemgroupparameter\c!option}%
- \let\p_itemgroups_extra_options\empty
+ \lettonothing\p_itemgroups_extra_options
\ifcase\nofarguments
\strc_itemgroups_start_indeed{}%
\or
@@ -849,7 +930,7 @@
%
% \ifhmode
% \ifconditional\c_strc_itemgroups_auto_concat
-% \ifdim\lastskip=\d_strc_itemgroups_signal
+% \ifnum\lastboundary=\c_strc_itemgroups_boundary
% \settrue\c_strc_itemgroups_concat
% \fi
% \fi
@@ -883,7 +964,7 @@
%
\ifhmode
\ifconditional\c_strc_itemgroups_auto_concat
- \ifdim\lastskip=\d_strc_itemgroups_signal
+ \ifnum\lastboundary=\c_strc_itemgroups_boundary
\settrue\c_strc_itemgroups_concat
\fi
\fi
@@ -909,6 +990,15 @@
\doadaptleftskip {\itemgroupparameter\c!leftmargindistance}%
\doadaptrightskip{\itemgroupparameter\c!rightmargindistance}%
%
+ \edef\m_strc_itemgroups_spacing{\itemgroupparameter\c!spacing}%
+ \ifx\m_strc_itemgroups_spacing\v!before
+ \c_strc_itemgroups_spacing_mode\zerocount
+ \orelse\ifx\m_strc_itemgroups_spacing\v!inbetween
+ \c_strc_itemgroups_spacing_mode\plusone
+ \orelse\ifx\m_strc_itemgroups_spacing\v!auto
+ \c_strc_itemgroups_spacing_mode\plustwo
+ \fi
+ %
\usealignparameter\itemgroupparameter
\edef\m_strc_itemgroups_indenting{\itemgroupparameter\c!indenting}%
\ifnum\c_strc_itemgroups_nesting>\zerocount
@@ -928,11 +1018,11 @@
\fi\fi
\ifconditional\c_strc_itemgroups_paragraph
\ifnum\c_strc_itemgroups_nesting>\plusone
- \letitemgroupparameter\c!inbetween\empty
+ \resetitemgroupparameter\c!inbetween
\fi
\fi
\ifconditional\c_strc_itemgroups_pack
- \letitemgroupparameter\c!inbetween\empty
+ \resetitemgroupparameter\c!inbetween
\fi
\ifconditional\c_strc_itemgroups_columns
\ifinsidecolumns\orelse\ifcase\c_strc_itemgroups_column_depth
@@ -944,13 +1034,13 @@
\fi
\ifconditional\c_strc_itemgroups_fitting
\ifdim\d_strc_itemgroups_max_width>\zeropoint
- \letitemgroupparameter\c!width\d_strc_itemgroups_max_width
+ \letitemgroupparameter\c!width\d_strc_itemgroups_max_width_reference
\fi
\fi
\strc_itemgroups_calculate_list_width\c_strc_itemgroups_nesting
\ifdim\d_strc_itemgroups_list_width>\zeropoint\relax
\ifconditional\c_strc_itemgroups_inline\else
- \frozen\advance\leftskip\d_strc_itemgroups_list_width\relax
+ \frozen\advanceby\leftskip\d_strc_itemgroups_list_width\relax
\fi
\fi
\ifempty\m_strc_itemgroups_repeat_start
@@ -966,12 +1056,12 @@
\let\startcollectitems\relax
\let\stopcollectitems \relax
-\letvalue{\??itemgroupalign\v!flushleft }\relax
-\letvalue{\??itemgroupalign\v!right }\relax
-\letvalue{\??itemgroupalign\v!flushright}\hfill
-\letvalue{\??itemgroupalign\v!left }\hfill
-\letvalue{\??itemgroupalign\v!middle }\hfil
-\letvalue{\??itemgroupalign\v!center }\hfil
+\letcsname\??itemgroupalign\v!flushleft \endcsname\relax
+\letcsname\??itemgroupalign\v!right \endcsname\relax
+\letcsname\??itemgroupalign\v!flushright\endcsname\hfill
+\letcsname\??itemgroupalign\v!left \endcsname\hfill
+\letcsname\??itemgroupalign\v!middle \endcsname\hfil
+\letcsname\??itemgroupalign\v!center \endcsname\hfil
\def\strc_itemgroups_left_sym_filler
{\csname\??itemgroupalign\itemgroupparameter\c!symalign\endcsname}
@@ -979,10 +1069,10 @@
% symbols + states
\def\strc_itemgroups_store_global_symbol#symbol%
- {\letgvalue{\??itemgroupglobal\currentitemgroup:\currentitemlevel}#symbol}
+ {\gletcsname\??itemgroupglobal\currentitemgroup:\currentitemlevel\endcsname#symbol}
\def\strc_itemgroups_store_local_symbol#symbol%
- {\letgvalue{\??itemgrouplocal\currentitemgroup:\currentitemlevel}#symbol}
+ {\gletcsname\??itemgrouplocal\currentitemgroup:\currentitemlevel\endcsname#symbol}
\def\strc_itemgroups_fetch_global_symbol
{\csname\??itemgroupglobal\currentitemgroup:\currentitemlevel\endcsname}
@@ -1035,7 +1125,7 @@
\ifconditional\c_strc_itemgroups_text
\removeunwantedspaces
\space
- \ignorespaces
+ \ignorepars % \ignorespaces
\else
\par
\fi
@@ -1070,7 +1160,7 @@
\iftrialtypesetting
\strc_counters_restore\v_strc_itemgroups_counter % could happen in LUA
\fi
- \global\advance\c_strc_itemgroups_nesting\minusone
+ \global\advanceby\c_strc_itemgroups_nesting\minusone
\xdef\currentitemlevel{\number\c_strc_itemgroups_nesting}%
%\ifconditional\c_strc_itemgroups_text
\endgroup % (2)
@@ -1103,7 +1193,7 @@
\ifconditional\c_strc_itemgroups_intro\strc_itemgroups_insert_breakno\fi
\fi}
-\newcount\c_strc_itemgroups_prev_level
+\newinteger\c_strc_itemgroups_prev_level
\def\strc_itemgroups_inbetween_command
{\nameditemgroupparameter{\currentparentitemgroup:\number\c_strc_itemgroups_prev_level}\c!inbetween}
@@ -1150,7 +1240,7 @@
% \stopitemize
% \stopitemize
-\mutable\let\currentitemreference\empty
+\mutable\lettonothing\currentitemreference
\tolerant\permanent\protected\def\startitemgroupitem[#reference]% we can reuse more
{\def\currentitemreference{#reference}%
@@ -1187,7 +1277,7 @@
\begstrut % \strut
\nobreak % else problems with intext items
\seteffectivehsize % NEW !
- \hskip\d_strc_itemgroups_signal % concat
+ \boundary\c_strc_itemgroups_boundary % was signal
\itemgroupparameter\c!command}
\protected\permanent\def\stopitemgroupitem
@@ -1229,18 +1319,19 @@
{\settrue\c_strc_itemgroups_head
\dotagsetitem\s!head% % weird place
\dostarttagged\t!itemhead\empty
- \useitemgroupstyleandcolor\c!headstyle\c!headcolor\ignorespaces}
+ \useitemgroupstyleandcolor\c!headstyle\c!headcolor
+ \ignorepars} % \ignorespaces
\protected\def\strc_itemgroups_stop_head_indeed
{\removeunwantedspaces
\dostoptagged
\ifconditional\c_strc_itemgroups_inline_head
\space
- \ignorespaces
+ \ignorepars % \ignorespaces
\else
\ifconditional\c_strc_itemgroups_text
\space
- \ignorespaces
+ \ignorepars % \ignorespaces
\else
\par
\fi
@@ -1252,7 +1343,7 @@
\protected\def\strc_itemgroups_head_body_indeed
{\dostarttagged\t!itembody\empty
\noindentation
- \ignorespaces}
+ \ignorepars} % \ignorespaces
% Simple commands.
@@ -1260,12 +1351,12 @@
{\startitemgroupitem}
\protected\def\strc_itemgroups_start_no_item
- {\let\currentitemreference\empty
+ {\lettonothing\currentitemreference
\strc_itemgroups_increment_item_counter
- %\advance\c_strc_itemgroups_n_of_items\plusone
+ %\advanceby\c_strc_itemgroups_n_of_items\plusone
\setbox\b_strc_itemgroups\emptyhbox
\strc_itemgroups_check_for_repeated
- \ignorespaces}
+ \ignorepars} % \ignorespaces
\protected\def\strc_itemgroups_start_button[#destination]%
{\edef\m_strc_itemgroups_destination{#destination}%
@@ -1314,16 +1405,13 @@
\settrue\c_strc_itemgroups_txt
\startitemgroupitem}
-% \protected\def\strc_itemgroups_start_head
-% {\settrue\c_strc_itemgroups_head
-% \startitemgrouphead}
-
-\protected\def\strc_itemgroups_start_items
- {\dosingleempty\strc_itemgroups_start_items_indeed}
-
-\protected\def\strc_itemgroups_start_items_indeed[#whatever]% something got lost
+\protected\tolerant\def\strc_itemgroups_start_items[#1]%
{\strc_itemgroups_start_edge
- {\dorecurse{0\itemgroupparameter\c!items}{\strc_itemgroups_used_symbol\hss}%
+ {\localcontrolledloop
+ \plusone
+ \ifchknum#1\or#1\else0\itemgroupparameter\c!items\fi
+ \plusone
+ {\strc_itemgroups_used_symbol\hss}%
\unskip}}
\protected\permanent\def\startspecialitemgroupitem[#name]% todo: frozen
@@ -1336,13 +1424,14 @@
\protected\permanent\def\stopspecialitemgroupitem % todo: frozen
{\stopitemgroupitem}
-\letvalue{\??itemgroupstart\v!item}\strc_itemgroups_start_do_item
-\letvalue{\??itemgroupstart\v!sub }\strc_itemgroups_start_subitem
-\letvalue{\??itemgroupstart\v!sym }\strc_itemgroups_start_symbol
-\letvalue{\??itemgroupstart\v!ran }\strc_itemgroups_start_edge
-\letvalue{\??itemgroupstart\v!its }\strc_itemgroups_start_items
-\letvalue{\??itemgroupstart\v!mar }\strc_itemgroups_start_margin
-\letvalue{\??itemgroupstart\v!txt }\strc_itemgroups_start_text
+\letcsname\??itemgroupstart\v!item\endcsname\strc_itemgroups_start_do_item
+\letcsname\??itemgroupstart\v!sub \endcsname\strc_itemgroups_start_subitem
+\letcsname\??itemgroupstart\v!sym \endcsname\strc_itemgroups_start_symbol
+\letcsname\??itemgroupstart\v!ran \endcsname\strc_itemgroups_start_edge
+\letcsname\??itemgroupstart\v!its \endcsname\strc_itemgroups_start_items
+\letcsname\??itemgroupstart\v!mar \endcsname\strc_itemgroups_start_margin
+\letcsname\??itemgroupstart\v!txt \endcsname\strc_itemgroups_start_text
+\letcsname\??itemgroupstart\v!no \endcsname\strc_itemgroups_start_no_item
\def\strc_itemgroups_optimize_breaks
{\ifcase\c_strc_itemgroups_column_depth
@@ -1372,9 +1461,9 @@
\def\strc_itemgroups_handle_text_item
{\scratchdimen\wd\b_strc_itemgroups
- \advance \scratchdimen \itemgroupparameter\c!distance\relax
+ \advanceby \scratchdimen \itemgroupparameter\c!distance\relax
\ifdim\scratchdimen>\d_strc_itemgroups_list_width
- \advance\scratchdimen -\d_strc_itemgroups_list_width
+ \advanceby\scratchdimen -\d_strc_itemgroups_list_width
\else
\scratchdimen\zeropoint
\fi
@@ -1454,7 +1543,7 @@
\strc_itemgroups_used_symbol
\fi
\fi}%
- \let\strc_itemgroups_extra_symbol\empty
+ \lettonothing\strc_itemgroups_extra_symbol
\setfalse\c_strc_itemgroups_symbol}
\def\strc_itemgroups_make_fitting_box
@@ -1496,7 +1585,7 @@
\edef\m_strc_itemgroups_repeat_start{\currentitemlevel}%
\fi
\else
- \let\m_strc_itemgroups_repeat_start\empty
+ \lettonothing\m_strc_itemgroups_repeat_start
\fi}
\def\strc_itemgroups_insert_item
@@ -1505,7 +1594,7 @@
\else
\par % done twice?
\fi
- \advance\c_strc_itemgroups_n_of_items\plusone
+ \advanceby\c_strc_itemgroups_n_of_items\plusone
\strc_itemgroups_optimize_breaks
\strc_itemgroups_check_indenting
\dontleavehmode
@@ -1519,7 +1608,7 @@
\orelse\ifdim\d_strc_itemgroups_asked_width>\zeropoint
\strc_itemgroups_make_aligned_box
\fi
- \let\m_strc_itemgroups_destination\empty
+ \lettonothing\m_strc_itemgroups_destination
\ht\b_strc_itemgroups\strutheight % just in case a symbols is not yet available in
\dp\b_strc_itemgroups\strutdepth % the current run (more a mkii mp side artifact)
\strc_itemgroups_check_for_repeated
@@ -1546,25 +1635,25 @@
\ifconditional\c_strc_itemgroups_indented_first
\hskip\parindent
\fi
- \ignorespaces}
+ \ignorepars} % \ignorespaces
\def\strc_itemgroups_start_item_nop
- {\let\currentitemreference\empty
+ {\lettonothing\currentitemreference
\strc_itemgroups_increment_item_counter
- \advance\c_strc_itemgroups_n_of_items\plusone
+ \advanceby\c_strc_itemgroups_n_of_items\plusone
\setbox\b_strc_itemgroups\hbox
{\useitemgroupstyleandcolor\c!style\c!color
\strc_itemgroups_used_symbol}%
\strc_itemgroups_check_for_repeated
- \ignorespaces}
+ \ignorepars} % \ignorespaces
-\setvalue{\??itemgroupdistance\v!none}%
+\defcsname\??itemgroupdistance\v!none\endcsname
{\let\m_strc_itemgroups_text_distance\zeropoint}
-\setvalue{\??itemgroupdistance\v!space}%
+\defcsname\??itemgroupdistance\v!space\endcsname
{\def\m_strc_itemgroups_text_distance{\interwordspace\s!plus\interwordstretch\s!minus\interwordshrink}}
-\setvalue\??itemgroupdistance % catches empty value
+\defcsname\??itemgroupdistance\endcsname % catches empty value
{\let\m_strc_itemgroups_text_distance\zeropoint}
\protected\def\strc_itemgroups_set_text_item_distance
@@ -1590,7 +1679,7 @@
% \ignorespaces}
\protected\def\strc_itemgroups_default_command
- {\ignorespaces}
+ {\ignorepars} % \ignorespaces
%D Special case:
@@ -1699,17 +1788,18 @@
% better collectitems als conditional and a real plugin mechanism (some day)
-\newcount\c_strc_itemgroups_collected_stored
-\newcount\c_strc_itemgroups_collected_done
-\newcount\c_strc_itemgroups_collected_current
+\newinteger\c_strc_itemgroups_collected_stored
+\newinteger\c_strc_itemgroups_collected_done
+\newinteger\c_strc_itemgroups_collected_current
\let\strc_itemgroups_collected_store\relax
-\let\m_strc_itemgroups_collected\empty
+\lettonothing\m_strc_itemgroups_collected
\normalexpanded{\def\strc_itemgroups_collected_store#1\csname\e!stop\v!item\endcsname}%
- {\advance\c_strc_itemgroups_collected_stored\plusone
- \setvalue{\??itemgroupstack\number\c_strc_itemgroups_collected_stored}{\startitemgroupitem#1\stopitemgroupitem}}
+ {\advanceby\c_strc_itemgroups_collected_stored\plusone
+ \defcsname\??itemgroupstack\number\c_strc_itemgroups_collected_stored\endcsname
+ {\startitemgroupitem#1\stopitemgroupitem}}
\def\strc_itemgroups_collected_flush_randomize
{\m_strc_itemgroups_collected}
@@ -1736,7 +1826,7 @@
{\ifconditional\c_strc_itemgroups_randomize
\getrandomcount\c_strc_itemgroups_collected_current\plusone\c_strc_itemgroups_collected_stored
\else
- \advance\c_strc_itemgroups_collected_current\plusone
+ \advanceby\c_strc_itemgroups_collected_current\plusone
\fi
\ifcsname\??itemgroupstack\number\c_strc_itemgroups_collected_current\endcsname
\edef\m_strc_itemgroups_collected{\lastnamedcs}%
@@ -1745,7 +1835,7 @@
\else
\strc_itemgroups_collected_flush_indeed
\fi
- \advance\c_strc_itemgroups_collected_done\plusone
+ \advanceby\c_strc_itemgroups_collected_done\plusone
\fi
\ifnum\c_strc_itemgroups_collected_done<\c_strc_itemgroups_collected_stored
\expandafter\strc_itemgroups_collected_flush
@@ -1812,7 +1902,7 @@
% \setbox\scratchbox\hbox{\settrialtypesetting#text}%
% \setbox\scratchbox\hbox\ifdim\wd\scratchbox<1em to 1.5\else spread 1\fi em{#text\hfil}%
% \normalexpanded{\box\scratchbox\endgroup\hangindent\the\wd\scratchbox}%
-% \ignorespaces}
+% \ignorepars} % \ignorespaces
%D End of plugin.
@@ -1836,11 +1926,11 @@
%letitemgroupparameter\c!width\zeropoint
\strc_itemgroups_make_symbol_box
\strc_itemgroups_make_destination_box
- \let\m_strc_itemgroups_destination\empty
+ \lettonothing\m_strc_itemgroups_destination
\ht\b_strc_itemgroups\strutheight
\dp\b_strc_itemgroups\strutdepth
\box\b_strc_itemgroups
- \ignorespaces}
+ \ignorepars} % \ignorespaces
%D Done again.
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-lab.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-lab.mkxl
index 3794fdca935..327810a5198 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/strc-lab.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-lab.mkxl
@@ -71,10 +71,10 @@
% todo: \strc_labels_command for user
-\let\m_strc_labels_sub\empty
+\lettonothing\m_strc_labels_sub
\appendtoks
- \let\m_strc_labels_sub\empty
+ \lettonothing\m_strc_labels_sub
\ifempty\currentlabelparent
% clone => parent | subclone => clone | subsubclone => subclone
\strc_define_commands_label
@@ -106,12 +106,12 @@
\letlabelparameter\s!counter\p_counter
\to \everydefinelabel
-\let\p_strc_constructions_title \empty
-\let\p_strc_constructions_number\empty
+\lettonothing\p_strc_constructions_title
+\lettonothing\p_strc_constructions_number
\newconditional\c_strc_constructions_number_keep
-\setvalue{\??constructioninitializer\v!label}%
+\defcsname\??constructioninitializer\v!label\endcsname
{\let \currentlabel \currentconstruction
\enforced\let\constructionparameter \labelparameter
\enforced\let\constructionnamespace \??label
@@ -139,7 +139,7 @@
\setfalse\c_strc_constructions_title_state
\fi}
-\setvalue{\??constructionfinalizer\v!label}%
+\defcsname\??constructionfinalizer\v!label\endcsname
{\ifconditional\c_strc_constructions_number_state
\iftrialtypesetting
\strc_counters_restore\currentconstructionnumber
@@ -148,8 +148,8 @@
%D Interfaces:
-\protected\def\strc_labels_command{\setfalse\c_strc_constructions_number_keep\strc_descriptions_command}
-\protected\def\strc_labels_current{\settrue \c_strc_constructions_number_keep\strc_descriptions_command}
+\protected\def\strc_labels_command{\setfalse\c_strc_constructions_number_keep\nameddescription}
+\protected\def\strc_labels_current{\settrue \c_strc_constructions_number_keep\nameddescription}
\protected\def\strc_labels_next {\strc_constructions_next_indeed \namedlabelparameter} % #1#2
\protected\def\strc_labels_reset {\strc_constructions_reset_indeed\namedlabelparameter} % #1#2
@@ -173,12 +173,12 @@
\letcsname\??constructionmainhandler\v!label\expandafter\endcsname\csname\??constructionmainhandler\v!description\endcsname
-\protected\setevalue{\??constructioncommandhandler\v!label}%
+\protected\edefcsname\??constructioncommandhandler\v!label\endcsname
{\csname\??constructionstarthandler\v!construction\endcsname
\csname\??constructionstophandler \v!construction\endcsname
\endgroup}
-\protected\setvalue{\??constructiontexthandler\v!label}%
+\protected\defcsname\??constructiontexthandler\v!label\endcsname
{\begingroup
\useconstructionstyleandcolor\c!headstyle\c!headcolor
\strc_labels_text
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-lnt.mklx b/Master/texmf-dist/tex/context/base/mkxl/strc-lnt.mklx
index f389442d83c..331be873728 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/strc-lnt.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-lnt.mklx
@@ -23,8 +23,8 @@
\aliased\let\setuplinenote\setupnote
-\newcount\c_strc_linenotes
-\newtoks\everydefinelinenote
+\newinteger\c_strc_linenotes
+\newtoks \everydefinelinenote
\permanent\tolerant\protected\def\definelinenote[#1]#*[#2]#*[#3]%
{\ifarguments
@@ -55,13 +55,13 @@
\fi}
\protected\def\strc_linenotes_direct#1#2%
- {\global\advance\c_strc_linenotes\plusone
+ {\global\advanceby\c_strc_linenotes\plusone
\strc_linenotes_indeed{#1}{\the\c_strc_linenotes}{#2}%
\strc_linenotes_traced\empty
\normalexpanded{\someline[\the\c_strc_linenotes]}}
\protected\def\strc_linenotes_start#1[#2]#3%
- {\global\advance\c_strc_linenotes\plusone
+ {\global\advanceby\c_strc_linenotes\plusone
\keepunwantedspaces
\strc_linenotes_indeed{#1}{#2}{#3}%
\strc_linenotes_traced{#2}%
@@ -87,7 +87,7 @@
% maybe do this in lua
-\mutable\let\currentlinenotereference\empty
+\mutable\lettonothing\currentlinenotereference
\def\page_lines_in_from{\in[lr:b:\currentlinenotereference]}
\def\page_lines_in_to {\in[lr:e:\currentlinenotereference]}
@@ -136,7 +136,7 @@
\fi
\fi}
-\let\currentlinenotereference\empty
+\lettonothing\currentlinenotereference
\mutable\let\linenotelinenumber\relax
@@ -163,7 +163,7 @@
% compress=yes|no
% compressmethod=separator|stopper
-\setvalue{\??linenotescompressmethod\v!separator}%
+\defcsname\??linenotescompressmethod\v!separator\endcsname
{\edef\p_compressseparator{\noteparameter\c!compressseparator}%
\scratchskip\noteparameter\c!compressdistance\relax
\ifempty\p_compressseparator
@@ -174,7 +174,7 @@
\hskip.5\scratchskip
\fi}
-\setvalue{\??linenotescompressmethod\v!stopper}%
+\defcsname\??linenotescompressmethod\v!stopper\endcsname
{\edef\p_compressstopper{\noteparameter\c!compressstopper}%
\scratchskip\noteparameter\c!compressdistance\relax
\ifempty\p_compressstopper
@@ -184,7 +184,7 @@
\hskip.5\scratchskip
\fi}
-\setvalue{\??linenotescompressmethod\v!space}%
+\defcsname\??linenotescompressmethod\v!space\endcsname
{\hskip\noteparameter\c!compressdistance\relax}
\def\strc_linenotes_check_compression
@@ -200,7 +200,10 @@
\fi}
\def\strc_linenotes_inbetween % \ifcsname\??linenote\currentnote\expandafter\endcsname
- {\begincsname\??linenotescompressmethod\p_linenotes_compressmethod\endcsname}
+ {\begingroup
+ \strc_linenotes_check_compression
+ \begincsname\??linenotescompressmethod\p_linenotes_compressmethod\endcsname
+ \endgroup}
\def\strc_notes_compress_distance{\emwidth \s!plus .5\emwidth \s!minus .25\emwidth}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-lst.lmt b/Master/texmf-dist/tex/context/base/mkxl/strc-lst.lmt
new file mode 100644
index 00000000000..359fbd6b64c
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-lst.lmt
@@ -0,0 +1,1544 @@
+if not modules then modules = { } end modules ['strc-lst'] = {
+ version = 1.001,
+ comment = "companion to strc-lst.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- when all datastructures are stable a packer will be added which will
+-- bring down memory consumption a bit; we can use for instance a pagenumber,
+-- section, metadata cache (internal then has to move up one level) or a
+-- shared cache [we can use a fast and stupid serializer]
+
+-- todo: tag entry in list is crap
+--
+-- move more to commands
+
+local tonumber, type, next = tonumber, type, next
+local concat, insert, remove, sort = table.concat, table.insert, table.remove, table.sort
+local lpegmatch = lpeg.match
+
+local setmetatableindex = table.setmetatableindex
+local sortedkeys = table.sortedkeys
+
+local settings_to_set = utilities.parsers.settings_to_set
+local allocate = utilities.storage.allocate
+local checked = utilities.storage.checked
+
+local trace_lists = false trackers.register("structures.lists", function(v) trace_lists = v end)
+
+local report_lists = logs.reporter("structure","lists")
+
+local context = context
+local commands = commands
+local implement = interfaces.implement
+local conditionals = tex.conditionals
+
+local ctx_latelua = context.latelua
+
+local cheat = true
+
+local structures = structures
+local lists = structures.lists
+local sections = structures.sections
+local helpers = structures.helpers
+local documents = structures.documents
+local tags = structures.tags
+local counters = structures.counters
+local references = structures.references
+
+local collected = allocate()
+local tobesaved = allocate()
+local cached = allocate()
+local pushed = allocate()
+local kinds = allocate()
+local names = allocate()
+
+lists.collected = collected
+lists.tobesaved = tobesaved
+
+lists.enhancers = lists.enhancers or { }
+-----.internals = allocate(lists.internals or { }) -- to be checked
+lists.ordered = allocate(lists.ordered or { }) -- to be checked
+lists.cached = cached
+lists.pushed = pushed
+lists.kinds = kinds
+lists.names = names
+
+local sorters = sorters
+local sortstripper = sorters.strip
+local sortsplitter = sorters.splitters.utf
+local sortcomparer = sorters.comparers.basic
+
+local sectionblocks = allocate()
+lists.sectionblocks = sectionblocks
+
+references.specials = references.specials or { }
+
+local matchingtilldepth = sections.matchingtilldepth
+local numberatdepth = sections.numberatdepth
+local getsectionlevel = sections.getlevel
+local typesetnumber = sections.typesetnumber
+local autosectiondepth = sections.autodepth
+
+local variables = interfaces.variables
+
+local v_all = variables.all
+local v_reference = variables.reference
+local v_title = variables.title
+local v_command = variables.command
+local v_text = variables.text
+local v_current = variables.current
+local v_previous = variables.previous
+local v_intro = variables.intro
+local v_here = variables.here
+local v_component = variables.component
+local v_product = variables.product
+local v_local = variables["local"]
+local v_default = variables.default
+
+local cheats = {
+ [variables.fit] = true,
+ [variables.tight] = true,
+}
+
+local function zerostrippedconcat(t,separator)
+ local f = 1
+ local l = #t
+ for i=f,l do
+ if t[i] == 0 then
+ f = f + 1
+ end
+ end
+ for i=l,f,-1 do
+ if t[i] == 0 then
+ l = l - 1
+ end
+ end
+ return concat(t,separator,f,l)
+end
+
+-- -- -- -- -- --
+
+local function initializer()
+ -- create a cross reference between internal references
+ -- and list entries
+ local collected = lists.collected
+ local internals = checked(references.internals)
+ local ordered = lists.ordered
+ local usedinternals = references.usedinternals
+ local blockdone = { }
+ local lastblock = nil
+ for i=1,#collected do
+ local c = collected[i]
+ local m = c.metadata
+ local r = c.references
+ if m then
+ -- access by internal reference
+ if r then
+ local internal = r.internal
+ if internal then
+ internals[internal] = c
+ usedinternals[internal] = r.used
+ end
+ local block = r.block
+ if not block then
+ -- shouldn't happen
+ elseif lastblock == block then
+ -- we're okay
+ elseif lastblock then
+ if blockdone[block] then
+ report_lists("out of order sectionsblocks, maybe use \\setsectionblock")
+ else
+ blockdone[block] = true
+ sectionblocks[#sectionblocks+1] = block
+ end
+ lastblock = block
+ elseif not blockdone[block] then
+ blockdone[block] = true
+ sectionblocks[#sectionblocks+1] = block
+ lastblock = block
+ end
+ end
+ -- access by order in list
+ local kind = m.kind
+ local name = m.name
+ if kind and name then
+ local ok = ordered[kind]
+ if ok then
+ local on = ok[name]
+ if on then
+ on[#on+1] = c
+ else
+ ok[name] = { c }
+ end
+ else
+ ordered[kind] = { [name] = { c } }
+ end
+ kinds[kind] = true
+ names[name] = true
+ elseif kind then
+ kinds[kind] = true
+ elseif name then
+ names[name] = true
+ end
+ end
+ if r then
+ r.listindex = i -- handy to have
+ end
+ end
+end
+
+local function finalizer()
+ local flaginternals = references.flaginternals
+ local usedviews = references.usedviews
+ for i=1,#tobesaved do
+ local r = tobesaved[i].references
+ if r then
+ local i = r.internal
+ local f = flaginternals[i]
+ local v = usedviews[i]
+ if cheat and v and cheats[v] then -- cheats check added, to be tested by RKB
+ -- this permits runs=2 with interactivity
+ r.view = v
+ end
+ if f then
+ r.used = v or true
+ end
+ end
+ end
+end
+
+job.register('structures.lists.collected', tobesaved, initializer, finalizer)
+
+local groupindices = setmetatableindex("table")
+
+function lists.groupindex(name,group)
+ local groupindex = groupindices[name]
+ return groupindex and groupindex[group] or 0
+end
+
+-- we could use t (as hash key) in order to check for dup entries
+
+function lists.addto(t) -- maybe more more here (saves parsing at the tex end)
+ local metadata = t.metadata
+ local userdata = t.userdata
+ local numberdata = t.numberdata
+ if userdata and type(userdata) == "string" then
+ t.userdata = helpers.touserdata(userdata)
+ end
+ if not metadata.level then
+ metadata.level = structures.sections.currentlevel() -- this is not used so it will go away
+ end
+ --
+ -- if not conditionals.inlinelefttoright then
+ -- metadata.idir = "r2l"
+ -- end
+ -- if not conditionals.displaylefttoright then
+ -- metadata.ddir = "r2l"
+ -- end
+ --
+ if numberdata then
+ local numbers = numberdata.numbers
+ if type(numbers) == "string" then
+ counters.compact(numberdata,numbers,numberdata.level)
+ end
+ end
+ local group = numberdata and numberdata.group
+ local name = metadata.name
+ local kind = metadata.kind
+ if not group then
+ -- forget about it
+ elseif group == "" then
+ group, numberdata.group = nil, nil
+ else
+ local groupindex = groupindices[name][group]
+ if groupindex then
+ numberdata.numbers = cached[groupindex].numberdata.numbers
+ end
+ end
+ local setcomponent = references.setcomponent
+ if setcomponent then
+ setcomponent(t) -- can be inlined
+ end
+ local r = t.references
+ if r and not r.section then
+ r.section = structures.sections.currentid()
+ end
+ local b = r and t.block
+ if r and not b then
+ local s = r.section
+ if s then
+ s = structures.sections.tobesaved[s]
+ r.block = s and s.block or nil
+ end
+ end
+ local i = r and r.internal or 0 -- brrr
+ if r and kind and name then
+ local tag = tags.getid(kind,name)
+ if tag and tag ~= "?" then
+ r.tag = tag -- todo: use internal ... is unique enough
+ end
+ end
+ local p = pushed[i]
+ if not p then
+ p = #cached + 1
+ cached[p] = helpers.simplify(t)
+ pushed[i] = p
+ if r then
+ r.listindex = p
+ end
+ end
+ if group then
+ groupindices[name][group] = p
+ end
+ if trace_lists then
+ report_lists("added %a, internal %a",name,p)
+ end
+ return p
+end
+
+function lists.discard(n)
+ n = tonumber(n)
+ if not n then
+ -- maybe an error message
+ elseif n == #cached then
+ cached[n] = nil
+ n = n - 1
+ while n > 0 and cached[n] == false do
+ cached[n] = nil -- collect garbage
+ n = n - 1
+ end
+ else
+ cached[n] = false
+ end
+end
+
+function lists.iscached(n)
+ return cached[tonumber(n)]
+end
+
+-- this is the main pagenumber enhancer
+
+local enhanced = { }
+
+local synchronizepage = function(r) -- bah ... will move
+ synchronizepage = references.synchronizepage
+ return synchronizepage(r)
+end
+
+local function enhancelist(specification)
+ local n = specification.n
+ local l = cached[n]
+ if not l then
+ report_lists("enhancing %a, unknown internal",n)
+ elseif enhanced[n] then
+ if trace_lists then
+ report_lists("enhancing %a, name %a, duplicate ignored",n,name)
+ end
+ else
+ local metadata = l.metadata
+ local references = l.references
+ --
+ l.directives = nil -- might change
+ -- save in the right order (happens at shipout)
+ lists.tobesaved[#lists.tobesaved+1] = l
+ -- default enhancer (cross referencing)
+ synchronizepage(references)
+ -- tags
+ local kind = metadata.kind
+ local name = metadata.name
+ if trace_lists then
+ report_lists("enhancing %a, name %a, page %a",n,name,references.realpage or 0)
+ end
+-- if references then
+-- -- is this used ?
+-- local tag = tags.getid(kind,name)
+-- if tag and tag ~= "?" then
+-- references.tag = tag
+-- end
+-- end
+ -- specific enhancer (kind of obsolete)
+ local enhancer = kind and lists.enhancers[kind]
+ if enhancer then
+ enhancer(l)
+ end
+ --
+ enhanced[n] = true
+ return l
+ end
+end
+
+lists.enhance = enhancelist
+
+-- we can use level instead but we can also decide to remove level from the metadata
+
+local nesting = { }
+
+function lists.pushnesting(i)
+ local parent = lists.result[i]
+ local name = parent.metadata.name
+ local numberdata = parent and parent.numberdata
+ local numbers = numberdata and numberdata.numbers
+ local number = numbers and numbers[getsectionlevel(name)] or 0
+ insert(nesting, {
+ number = number,
+ name = name,
+ result = lists.result,
+ parent = parent
+ })
+end
+
+function lists.popnesting()
+ local old = remove(nesting)
+ if old then
+ lists.result = old.result
+ else
+ report_lists("nesting error")
+ end
+end
+
+-- Historically we had blocks but in the mkiv approach that could as well be a level
+-- which would simplify things a bit.
+
+local splitter = lpeg.splitat(":") -- maybe also :: or have a block parameter
+
+local listsorters = {
+ [v_command] = function(a,b)
+ if a.metadata.kind == "command" or b.metadata.kind == "command" then
+ return a.references.internal < b.references.internal
+ else
+ return a.references.order < b.references.order
+ end
+ end,
+ [v_all] = function(a,b)
+ return a.references.internal < b.references.internal
+ end,
+ [v_title] = function(a,b)
+ local da = a.titledata
+ local db = b.titledata
+ if da and db then
+ local ta = da.title
+ local tb = db.title
+ if ta and tb then
+ local sa = da.split
+ if not sa then
+ sa = sortsplitter(sortstripper(ta))
+ da.split = sa
+ end
+ local sb = db.split
+ if not sb then
+ sb = sortsplitter(sortstripper(tb))
+ db.split = sb
+ end
+ return sortcomparer(da,db) == -1
+ end
+ end
+ return a.references.internal < b.references.internal
+ end
+}
+
+-- was: names, criterium, number, collected, forced, nested, sortorder
+
+local filters = setmetatableindex(function(t,k) return t[v_default] end)
+
+local function filtercollected(specification)
+ --
+ local names = specification.names or { }
+ local criterium = specification.criterium or v_default
+ local number = 0 -- specification.number
+ local reference = specification.reference or ""
+ local collected = specification.collected or lists.collected
+ local forced = specification.forced or { }
+ local nested = specification.nested or false
+ local sortorder = specification.sortorder or specification.order
+ --
+ local numbers = documents.data.numbers
+ local depth = documents.data.depth
+ local block = false -- all
+ local wantedblock, wantedcriterium = lpegmatch(splitter,criterium) -- block:criterium
+ if wantedblock == "" or wantedblock == v_all or wantedblock == v_text then
+ criterium = wantedcriterium ~= "" and wantedcriterium or criterium
+ elseif not wantedcriterium then
+ block = documents.data.block
+ else
+ block = wantedblock
+ criterium = wantedcriterium
+ end
+ if block == "" then
+ block = false
+ end
+ if type(names) == "string" then
+ names = settings_to_set(names)
+ end
+ local all = not next(names) or names[v_all] or false
+ --
+ specification.names = names
+ specification.criterium = criterium
+ specification.number = 0 -- obsolete
+ specification.reference = reference -- new
+ specification.collected = collected
+ specification.forced = forced -- todo: also on other branched, for the moment only needed for bookmarks
+ specification.nested = nested
+ specification.sortorder = sortorder
+ specification.numbers = numbers
+ specification.depth = depth
+ specification.block = block
+ specification.all = all
+ --
+ if specification.atmost then
+ criterium = v_text
+ end
+ --
+ if trace_lists then
+ report_lists("filtering names %,t, criterium %a, block %a",sortedkeys(names), criterium, block or "*")
+ end
+ local result = filters[criterium](specification)
+ if trace_lists then
+ report_lists("criterium %a, block %a, found %a",specification.criterium, specification.block or "*", #result)
+ end
+ --
+ local levels = tonumber(specification.levels)
+ if levels then
+ local minlevel = 1000
+ local found = result
+ local nofresult = #result
+ for i=1,nofresult do
+ local v = found[i]
+ local l = v.metadata.level or 1
+ if l < minlevel then
+ minlevel = l
+ end
+ end
+ local maxlevel = minlevel + levels - 1
+ result = { }
+ nofresult = 0
+ for i=1,#found do
+ local v = found[i]
+ local l = v.metadata.level or 1
+ if l >= minlevel and l <= maxlevel then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ end
+ end
+ end
+ --
+ if sortorder then -- experiment
+ local sorter = listsorters[sortorder]
+ if sorter then
+ if trace_lists then
+ report_lists("sorting list using method %a",sortorder)
+ end
+ for i=1,#result do
+ result[i].references.order = i
+ end
+ sort(result,sorter)
+ end
+ end
+ --
+ return result
+end
+
+filters[v_intro] = function(specification)
+ local collected = specification.collected
+ local result = { }
+ local nofresult = 0
+ local all = specification.all
+ local names = specification.names
+ for i=1,#collected do
+ local v = collected[i]
+ local metadata = v.metadata
+ if metadata and (all or names[metadata.name or false]) then
+ local r = v.references
+ if r and r.section == 0 then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ end
+ end
+ end
+ return result
+end
+
+filters[v_reference] = function(specification)
+ local collected = specification.collected
+ local result = { }
+ local nofresult = 0
+ local names = specification.names
+ local sections = sections.collected
+ local reference = specification.reference
+ if reference ~= "" then
+ local prefix, rest = lpegmatch(references.prefixsplitter,reference) -- p::r
+ local r = prefix and rest and references.derived[prefix][rest] or references.derived[""][reference]
+ local s = r and r.numberdata -- table ref !
+ if s then
+ local depth = getsectionlevel(r.metadata.name)
+ local numbers = s.numbers
+ for i=1,#collected do
+ local v = collected[i]
+ local r = v.references
+ if r and (not block or not r.block or block == r.block) then
+ local metadata = v.metadata
+ if metadata and names[metadata.name or false] then
+ local sectionnumber = (r.section == 0) or sections[r.section]
+ if sectionnumber then
+ if matchingtilldepth(depth,numbers,sectionnumber.numbers) then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ end
+ end
+ end
+ end
+ end
+ else
+ report_lists("unknown reference %a specified",reference)
+ end
+ else
+ report_lists("no reference specified")
+ end
+ return result
+end
+
+-- maybe:
+--
+-- filters[v_reference] = function(specification)
+-- local collected = specification.collected
+-- local result = { }
+-- local nofresult = 0
+-- local names = specification.names
+-- local sections = sections.collected
+-- local reference = specification.reference
+-- if reference ~= "" then
+-- local split = references.splitreference(reference)
+-- if split then
+-- local prefix = split and split.outer
+-- local rest = split and split.inner
+-- if prefix and rest then
+-- local d = references.derived
+-- local r = (d[prefix] and d[prefix][rest]) or (d[""] and d[""][reference])
+-- local s = r and r.numberdata -- table ref !
+-- if s then
+-- local depth = getsectionlevel(r.metadata.name)
+-- local numbers = s.numbers
+-- for i=1,#collected do
+-- local v = collected[i]
+-- local r = v.references
+-- if r and (not block or not r.block or block == r.block) then
+-- local metadata = v.metadata
+-- if metadata and names[metadata.name or false] then
+-- local sectionnumber = (r.section == 0) or sections[r.section]
+-- if sectionnumber then
+-- if matchingtilldepth(depth,numbers,sectionnumber.numbers) then
+-- nofresult = nofresult + 1
+-- result[nofresult] = v
+-- end
+-- end
+-- end
+-- end
+-- end
+-- else
+-- report_lists("unknown reference %a specified",reference)
+-- end
+-- end
+-- end
+-- else
+-- report_lists("no reference specified")
+-- end
+-- return result
+-- end
+
+filters[v_all] = function(specification)
+ local collected = specification.collected
+ local result = { }
+ local nofresult = 0
+ local block = specification.block
+ local all = specification.all
+ local forced = specification.forced
+ local names = specification.names
+ local sections = sections.collected
+ for i=1,#collected do
+ local v = collected[i]
+ local r = v.references
+ if r and (not block or not r.block or block == r.block) then
+ local metadata = v.metadata
+ if metadata then
+ local name = metadata.name or false
+ local sectionnumber = (r.section == 0) or sections[r.section]
+ if forced[name] or (sectionnumber and not metadata.nolist and (all or names[name])) then -- and not sectionnumber.hidenumber then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ end
+ end
+ end
+ end
+ return result
+end
+
+filters[v_text] = filters[v_all]
+
+filters[v_current] = function(specification)
+ if specification.depth == 0 then
+ specification.nested = false
+ specification.criterium = v_intro
+ return filters[v_intro](specification)
+ end
+ local collected = specification.collected
+ local result = { }
+ local nofresult = 0
+ local depth = specification.depth
+ local block = specification.block
+ local all = specification.all
+ local names = specification.names
+ local numbers = specification.numbers
+ local sections = sections.collected
+ for i=1,#collected do
+ local v = collected[i]
+ local r = v.references
+ if r and (not block or not r.block or block == r.block) then
+ local sectionnumber = sections[r.section]
+ if sectionnumber then -- and not sectionnumber.hidenumber then
+ local cnumbers = sectionnumber.numbers
+ local metadata = v.metadata
+ if cnumbers then
+ if metadata and not metadata.nolist and (all or names[metadata.name or false]) and #cnumbers > depth then
+ local ok = true
+ for d=1,depth do
+ local cnd = cnumbers[d]
+ if not (cnd == 0 or cnd == numbers[d]) then
+ ok = false
+ break
+ end
+ end
+ if ok then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ end
+ end
+ end
+ end
+ end
+ end
+ return result
+end
+
+filters[v_here] = function(specification)
+ -- this is quite dirty ... as cnumbers is not sparse we can misuse #cnumbers
+ if specification.depth == 0 then
+ specification.nested = false
+ specification.criterium = v_intro
+ return filters[v_intro](specification)
+ end
+ local collected = specification.collected
+ local result = { }
+ local nofresult = 0
+ local depth = specification.depth
+ local block = specification.block
+ local all = specification.all
+ local names = specification.names
+ local numbers = specification.numbers
+ local sections = sections.collected
+ for i=1,#collected do
+ local v = collected[i]
+ local r = v.references
+ if r then -- and (not block or not r.block or block == r.block) then
+ local sectionnumber = sections[r.section]
+ if sectionnumber then -- and not sectionnumber.hidenumber then
+ local cnumbers = sectionnumber.numbers
+ local metadata = v.metadata
+ if cnumbers then
+ if metadata and not metadata.nolist and (all or names[metadata.name or false]) and #cnumbers >= depth then
+ local ok = true
+ for d=1,depth do
+ local cnd = cnumbers[d]
+ if not (cnd == 0 or cnd == numbers[d]) then
+ ok = false
+ break
+ end
+ end
+ if ok then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ end
+ end
+ end
+ end
+ end
+ end
+ return result
+end
+
+filters[v_previous] = function(specification)
+ if specification.depth == 0 then
+ specification.nested = false
+ specification.criterium = v_intro
+ return filters[v_intro](specification)
+ end
+ local collected = specification.collected
+ local result = { }
+ local nofresult = 0
+ local block = specification.block
+ local all = specification.all
+ local names = specification.names
+ local numbers = specification.numbers
+ local sections = sections.collected
+ local depth = specification.depth
+ for i=1,#collected do
+ local v = collected[i]
+ local r = v.references
+ if r and (not block or not r.block or block == r.block) then
+ local sectionnumber = sections[r.section]
+ if sectionnumber then -- and not sectionnumber.hidenumber then
+ local cnumbers = sectionnumber.numbers
+ local metadata = v.metadata
+ if cnumbers then
+ if metadata and not metadata.nolist and (all or names[metadata.name or false]) and #cnumbers >= depth then
+ local ok = true
+ for d=1,depth-1 do
+ local cnd = cnumbers[d]
+ if not (cnd == 0 or cnd == numbers[d]) then
+ ok = false
+ break
+ end
+ end
+ if ok then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ end
+ end
+ end
+ end
+ end
+ end
+ return result
+end
+
+filters[v_local] = function(specification)
+ local numbers = specification.numbers
+ local nested = nesting[#nesting]
+ if nested then
+ return filtercollected {
+ names = specification.names,
+ criterium = nested.name,
+ collected = specification.collected,
+ forced = specification.forced,
+ nested = nested,
+ sortorder = specification.sortorder,
+ }
+ else
+ specification.criterium = autosectiondepth(numbers) == 0 and v_all or v_current
+ specification.nested = false
+ return filtercollected(specification) -- rechecks, so better (for determining all)
+ end
+end
+
+filters[v_component] = function(specification)
+ -- special case, no structure yet
+ local collected = specification.collected
+ local result = { }
+ local nofresult = 0
+ local all = specification.all
+ local names = specification.names
+ local component = resolvers.jobs.currentcomponent() or ""
+ if component ~= "" then
+ for i=1,#collected do
+ local v = collected[i]
+ local r = v.references
+ local m = v.metadata
+ if r and r.component == component and (m and names[m.name] or all) then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ end
+ end
+ end
+ return result
+end
+
+-- filters[v_product] = function(specification)
+-- local reference = specification.reference
+-- if reference and reference ~= "" then
+-- -- local utilitydata = job.loadother(reference,true)
+-- local fullname = file.replacesuffix(reference,"tuc")
+-- if lfs.isfile(fullname) then
+-- local utilitydata = job.loadother(fullname)
+-- if utilitydata then
+-- local collected = utilitydata.structures.lists.collected or { }
+-- setmetatableindex(collected,{ external = reference })
+-- return collected
+-- end
+-- end
+-- end
+-- return { }
+-- end
+
+filters[v_product] = function(specification)
+ local reference = specification.reference
+ if reference and reference ~= "" then
+ local utilitydata = job.loadother(reference,true)
+-- local fullname = file.replacesuffix(reference,"tuc")
+-- if lfs.isfile(fullname) then
+-- local utilitydata = job.loadother(fullname)
+ if utilitydata then
+ local collected = utilitydata.structures.lists.collected or { }
+ local result = { }
+ local nofresult = 0
+ local all = specification.all
+ local names = specification.names
+setmetatableindex(result,{ external = reference }) -- brr
+ for i=1,#collected do
+ local v = collected[i]
+ local m = v.metadata
+ if m and names[m.name] or all then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ end
+ end
+ return result
+-- end
+ end
+ end
+ return { }
+end
+
+-- local number = tonumber(number) or numberatdepth(depth) or 0
+-- if number > 0 then
+-- ...
+-- end
+
+filters[v_default] = function(specification) -- is named
+ local collected = specification.collected
+ local result = { }
+ local nofresult = 0
+ ----- depth = specification.depth
+ local block = specification.block
+ local criterium = specification.criterium
+ local all = specification.all
+ local names = specification.names
+ local numbers = specification.numbers
+ local sections = sections.collected
+ local reference = specification.reference
+ local nested = specification.nested
+ --
+ if reference then
+ reference = tonumber(reference)
+ end
+ --
+ local depth = getsectionlevel(criterium)
+ local pnumbers = nil
+ local pblock = block
+ local parent = nested and nested.parent
+ --
+ if parent then
+ pnumbers = parent.numberdata.numbers or pnumbers -- so local as well as nested
+ pblock = parent.references.block or pblock
+ if trace_lists then
+ report_lists("filtering by block %a and section %a",pblock,criterium)
+ end
+ end
+ --
+ for i=1,#collected do
+ local v = collected[i]
+ local r = v.references
+-- inspect(v)
+ if r and (not block or not r.block or pblock == r.block) then
+ local sectionnumber = sections[r.section]
+ if sectionnumber then
+ local metadata = v.metadata
+ local cnumbers = sectionnumber.numbers
+ if cnumbers then
+ if all or names[metadata.name or false] then
+ if reference then
+ -- filter by number
+ if reference == cnumbers[depth] then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ end
+ else
+ if #cnumbers >= depth and matchingtilldepth(depth,cnumbers,pnumbers) then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ return result
+end
+
+-- names, criterium, number, collected, forced, nested, sortorder) -- names is hash or string
+
+lists.filter = filtercollected
+
+lists.result = { }
+
+function lists.getresult(r)
+ return lists.result[r]
+end
+
+function lists.process(specification)
+ local result = filtercollected(specification)
+ local total = #result
+ lists.result = result
+ if total > 0 then
+ local usedinternals = references.usedinternals
+ local usedviews = references.usedviews
+ local specials = settings_to_set(specification.extras or "")
+ specials = next(specials) and specials or nil
+ for i=1,total do
+ local listentry = result[i]
+ local metadata = listentry.metadata
+ local numberdata = listentry.numberdata
+ local references = listentry.references
+ local special = specials and numberdata and specials[zerostrippedconcat(numberdata.numbers,".")] or ""
+ local view = usedviews[i]
+ -- if cheat and references then
+ -- -- HH: I still need to test this patch:
+ if cheat and references and view and cheats[view] then
+ -- this permits runs=2 with interactivity
+ local internal = references.internal
+ usedinternals[internal] = true
+ usedviews [internal] = references.view
+ end
+ context.strclistsentryprocess(metadata.name,metadata.kind,i,special)
+ end
+ end
+end
+
+function lists.analyze(specification)
+ lists.result = filtercollected(specification)
+end
+
+function lists.userdata(name,r,tag) -- to tex (todo: xml)
+ local result = lists.result[r]
+ if result then
+ local userdata = result.userdata
+ local str = userdata and userdata[tag]
+ if str then
+ return str, result.metadata
+ end
+ end
+end
+
+function lists.uservalue(name,r,tag,default) -- to lua
+ local str = lists.result[r]
+ if str then
+ str = str.userdata
+ end
+ if str then
+ str = str[tag]
+ end
+ return str or default
+end
+
+function lists.size()
+ return #lists.result
+end
+
+function lists.external(n)
+ return lists.result.external or ""
+end
+
+function lists.location(n)
+ local l = lists.result[n]
+ return l and l.references.internal or n
+end
+
+function lists.label(n,default)
+ local l = lists.result[n]
+ local t = l.titledata
+ return t and t.label or default or ""
+end
+
+function lists.sectionnumber(name,n,spec)
+ local data = lists.result[n]
+ local sectiondata = sections.collected[data.references.section]
+ -- hm, prefixnumber?
+ typesetnumber(sectiondata,"prefix",spec,sectiondata) -- data happens to contain the spec too
+end
+
+-- some basics (todo: helpers for pages)
+
+function lists.title(name,n,tag) -- tag becomes obsolete
+ local data = lists.result[n]
+ if data then
+ local titledata = data.titledata
+ if titledata then
+ helpers.title(titledata[tag] or titledata.list or titledata.title or "",data.metadata)
+ end
+ end
+end
+
+function lists.hastitledata(name,n,tag)
+ local data = cached[tonumber(n)]
+ if data then
+ local titledata = data.titledata
+ if titledata then
+ return (titledata[tag] or titledata.title or "") ~= ""
+ end
+ end
+ return false
+end
+
+function lists.haspagedata(name,n)
+ local data = lists.result[n]
+ if data then
+ local references = data.references
+ if references and references.realpage then -- or references.pagedata
+ return true
+ end
+ end
+ return false
+end
+
+function lists.hasnumberdata(name,n)
+ local data = lists.result[n]
+ if data then
+ local numberdata = data.numberdata
+ if numberdata and not numberdata.hidenumber then -- the hide number is true
+ return true
+ end
+ end
+ return false
+end
+
+function lists.rawnumber(n,name)
+ local data = lists.result[n]
+ if data then
+ local numberdata = data.numberdata
+ if numberdata then
+ numberdata = numberdata.numbers
+ return numberdata and numberdata[getsectionlevel(name)] or numberdata[name] or 0
+ end
+ end
+ return 0
+end
+
+function lists.prefix(name,n,spec)
+ helpers.prefix(lists.result[n],spec)
+end
+
+function lists.page(name,n,pagespec)
+ helpers.page(lists.result[n],pagespec)
+end
+
+function lists.prefixedpage(name,n,prefixspec,pagespec)
+ helpers.prefixpage(lists.result[n],prefixspec,pagespec)
+end
+
+function lists.realpage(name,n)
+ local data = lists.result[n]
+ if data then
+ local references = data.references
+ return references and references.realpage or 0
+ else
+ return 0
+ end
+end
+
+-- numbers stored in entry.numberdata + entry.numberprefix
+
+function lists.number(name,n,spec)
+ local data = lists.result[n]
+ if data then
+ local numberdata = data.numberdata
+ if numberdata then
+ typesetnumber(numberdata,"number",spec or false,numberdata or false)
+ end
+ end
+end
+
+function lists.prefixednumber(name,n,prefixspec,numberspec,forceddata)
+ local data = lists.result[n]
+ if data then
+ helpers.prefix(data,prefixspec)
+ local numberdata = data.numberdata or forceddata
+ if numberdata then
+ typesetnumber(numberdata,"number",numberspec or false,numberdata or false)
+ end
+ end
+end
+
+-- todo, do this in references namespace ordered instead (this is an experiment)
+--
+-- also see lpdf-ano (maybe move this there)
+
+local splitter = lpeg.splitat(":")
+
+function references.specials.order(var,actions) -- references.specials !
+ local operation = var.operation
+ if operation then
+ local kind, name, n = lpegmatch(splitter,operation)
+ local order = lists.ordered[kind]
+ order = order and order[name]
+ local v = order[tonumber(n)]
+ local r = v and v.references.realpage
+ if r then
+ actions.realpage = r
+ var.operation = r -- brrr, but test anyway
+ return references.specials.page(var,actions)
+ end
+ end
+end
+
+-- interface (maybe strclistpush etc)
+
+if not lists.reordered then
+ function lists.reordered(data)
+ return data.numberdata
+ end
+end
+
+implement { name = "pushlist", actions = lists.pushnesting, arguments = "integer" }
+implement { name = "poplist", actions = lists.popnesting }
+
+implement {
+ name = "addtolist",
+ actions = { lists.addto, context },
+ arguments = {
+ {
+ { "references", {
+ { "internal", "integer" },
+ { "block" },
+ { "section", "integer" },
+ { "location" },
+ { "prefix" },
+ { "reference" },
+ { "view" },
+ { "order", "integer" },
+ }
+ },
+ { "metadata", {
+ { "kind" },
+ { "name" },
+ { "level", "integer" },
+ { "catcodes", "integer" },
+ { "coding" },
+ { "xmlroot" },
+ { "setup" },
+ }
+ },
+ { "userdata" },
+ { "titledata", {
+ { "label" },
+ { "title" },
+ { "bookmark" },
+ { "marking" },
+ { "list" },
+ { "reference" },
+ }
+ },
+ { "prefixdata", {
+ { "prefix" },
+ { "separatorset" },
+ { "conversionset" },
+ { "conversion" },
+ { "set" },
+ { "segments" },
+ { "connector" },
+ }
+ },
+ { "numberdata", {
+ { "level", "integer" },
+ { "numbers" },
+ { "groupsuffix" },
+ { "group" },
+ { "counter" },
+ { "separatorset" },
+ { "conversionset" },
+ { "conversion" },
+ { "starter" },
+ { "stopper" },
+ { "segments" },
+ }
+ }
+ }
+ }
+}
+
+implement {
+ name = "enhancelist",
+ arguments = "integer",
+ actions = function(n)
+ enhancelist { n = n }
+ end
+}
+
+implement {
+ name = "deferredenhancelist",
+ arguments = "integer",
+ protected = true, -- for now, pre 1.09
+ actions = function(n)
+ ctx_latelua { action = enhancelist, n = n }
+ end,
+}
+
+implement {
+ name = "processlist",
+ actions = lists.process,
+ arguments = {
+ {
+ { "names" },
+ { "criterium" },
+ { "reference" },
+ { "extras" },
+ { "order" },
+ { "levels" },
+ }
+ }
+}
+
+implement {
+ name = "analyzelist",
+ actions = lists.analyze,
+ arguments = {
+ {
+ { "names" },
+ { "criterium" },
+ { "reference" },
+ }
+ }
+}
+
+implement {
+ name = "listtitle",
+ actions = lists.title,
+ arguments = { "string", "integer" }
+}
+
+implement {
+ name = "listprefixednumber",
+ actions = lists.prefixednumber,
+ arguments = {
+ "string",
+ "integer",
+ {
+ { "prefix" },
+ { "separatorset" },
+ { "conversionset" },
+ { "starter" },
+ { "stopper" },
+ { "set" },
+ { "segments" },
+ { "connector" },
+ },
+ {
+ { "separatorset" },
+ { "conversionset" },
+ { "starter" },
+ { "stopper" },
+ { "segments" },
+ }
+ }
+}
+
+implement {
+ name = "listprefixedpage",
+ actions = lists.prefixedpage,
+ arguments = {
+ "string",
+ "integer",
+ {
+ { "separatorset" },
+ { "conversionset" },
+ { "set" },
+ { "segments" },
+ { "connector" },
+ },
+ {
+ { "prefix" },
+ { "conversionset" },
+ { "starter" },
+ { "stopper" },
+ }
+ }
+}
+
+implement { name = "listsize", actions = { lists.size, context } }
+implement { name = "listexternal", actions = { lists.external, context }, arguments = "integer" }
+implement { name = "listlocation", actions = { lists.location, context }, arguments = "integer" }
+implement { name = "listlabel", actions = { lists.label, context }, arguments = { "integer", "string" } }
+implement { name = "listrealpage", actions = { lists.realpage, context }, arguments = { "string", "integer" } }
+implement { name = "listgroupindex", actions = { lists.groupindex, context }, arguments = "2 strings", }
+
+implement {
+ name = "currentsectiontolist",
+ actions = { sections.current, lists.addto, context }
+}
+
+local function userdata(name,r,tag)
+ local str, metadata = lists.userdata(name,r,tag)
+ if str then
+ -- local catcodes = metadata and metadata.catcodes
+ -- if catcodes then
+ -- context.sprint(catcodes,str)
+ -- else
+ -- context(str)
+ -- end
+ helpers.title(str,metadata)
+ end
+end
+
+implement {
+ name = "listuserdata",
+ actions = userdata,
+ arguments = { "string", "integer", "string" }
+}
+
+-- we could also set variables .. names will change (when this module is done)
+-- maybe strc_lists_savedtitle etc
+
+implement { name = "doifelselisthastitle", actions = { lists.hastitledata, commands.doifelse }, arguments = { "string", "integer" } }
+implement { name = "doifelselisthaspage", actions = { lists.haspagedata, commands.doifelse }, arguments = { "string", "integer" } }
+implement { name = "doifelselisthasnumber", actions = { lists.hasnumberdata, commands.doifelse }, arguments = { "string", "integer" } }
+implement { name = "doifelselisthasentry", actions = { lists.iscached, commands.doifelse }, arguments = "integer" }
+
+local function savedlisttitle(name,n,tag)
+ local data = cached[tonumber(n)]
+ if data then
+ local titledata = data.titledata
+ if titledata then
+ helpers.title(titledata[tag] or titledata.title or "",data.metadata)
+ end
+ end
+end
+
+local function savedlistnumber(name,n)
+ local data = cached[tonumber(n)]
+ if data then
+ local numberdata = data.numberdata
+ if numberdata then
+ typesetnumber(numberdata,"number",numberdata or false)
+ end
+ end
+end
+
+local function savedlistprefixednumber(name,n)
+ local data = cached[tonumber(n)]
+ if data then
+ local numberdata = lists.reordered(data)
+ if numberdata then
+ helpers.prefix(data,data.prefixdata)
+ typesetnumber(numberdata,"number",numberdata or false)
+ end
+ end
+end
+
+lists.savedlisttitle = savedlisttitle
+lists.savedlistnumber = savedlistnumber
+lists.savedlistprefixednumber = savedlistprefixednumber
+
+implement {
+ name = "savedlistnumber",
+ actions = savedlistnumber,
+ arguments = { "string", "integer" }
+}
+
+implement {
+ name = "savedlisttitle",
+ actions = savedlisttitle,
+ arguments = { "string", "integer" }
+}
+
+implement {
+ name = "savedlistprefixednumber",
+ actions = savedlistprefixednumber,
+ arguments = { "string", "integer" }
+}
+
+implement {
+ name = "discardfromlist",
+ actions = lists.discard,
+ arguments = "integer"
+}
+
+implement {
+ name = "rawlistnumber",
+ actions = { lists.rawnumber, context },
+ arguments = { "integer", "string" },
+}
+
+-- new and experimental and therefore off by default
+
+lists.autoreorder = false -- true
+
+local function addlevel(t,k)
+ local v = { }
+ setmetatableindex(v,function(t,k)
+ local v = { }
+ t[k] = v
+ return v
+ end)
+ t[k] = v
+ return v
+end
+
+local internals = setmetatableindex({ }, function(t,k)
+
+ local sublists = setmetatableindex({ },addlevel)
+
+ local collected = lists.collected or { }
+
+ for i=1,#collected do
+ local entry = collected[i]
+ local numberdata = entry.numberdata
+ if numberdata then
+ local metadata = entry.metadata
+ if metadata then
+ local references = entry.references
+ if references then
+ local kind = metadata.kind
+ local name = numberdata.counter or metadata.name
+ local internal = references.internal
+ if kind and name and internal then
+ local sublist = sublists[kind][name]
+ sublist[#sublist + 1] = { internal, numberdata }
+ end
+ end
+ end
+ end
+ end
+
+ for k, v in next, sublists do
+ for k, v in next, v do
+ local tmp = { }
+ for i=1,#v do
+ tmp[i] = v[i]
+ end
+ sort(v,function(a,b) return a[1] < b[1] end)
+ for i=1,#v do
+ t[v[i][1]] = tmp[i][2]
+ end
+ end
+ end
+
+ setmetatableindex(t,nil)
+
+ return t[k]
+
+end)
+
+function lists.reordered(entry)
+ local numberdata = entry.numberdata
+ if lists.autoreorder then
+ if numberdata then
+ local metadata = entry.metadata
+ if metadata then
+ local references = entry.references
+ if references then
+ local kind = metadata.kind
+ local name = numberdata.counter or metadata.name
+ local internal = references.internal
+ if kind and name and internal then
+ return internals[internal] or numberdata
+ end
+ end
+ end
+ end
+ else
+ function lists.reordered(entry)
+ return entry.numberdata
+ end
+ end
+ return numberdata
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-lst.mklx b/Master/texmf-dist/tex/context/base/mkxl/strc-lst.mklx
index 049a0370e9f..66a801241ee 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/strc-lst.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-lst.mklx
@@ -13,7 +13,7 @@
\writestatus{loading}{ConTeXt Structure Macros / Lists}
-\registerctxluafile{strc-lst}{}
+\registerctxluafile{strc-lst}{autosuffix}
% clean up in progress ...
%
@@ -116,17 +116,6 @@
\installcorenamespace {listlocations}
-% \permanent\protected\def\doifelseinlistentry#1%
-% {\ifcsname\??listlocations#1\endcsname
-% \ifnum\lastnamedcs=\structurelistlocation\relax
-% \doubleexpandafter\firstoftwoarguments
-% \else
-% \doubleexpandafter\secondoftwoarguments
-% \fi
-% \else
-% \expandafter\secondoftwoarguments
-% \fi}
-
\permanent\protected\def\doifelseinlistentry#1%
{\unless\ifcsname\??listlocations#1\endcsname
\expandafter\secondoftwoarguments
@@ -157,7 +146,7 @@
\scratchcounter\clf_addtolist
references {
internal \locationcount
- % block {\currentsectionblock}
+ % block {\currentsectionblock} % needed for publications (can be get from section)
% section structures.sections.currentid()
% location {\p_location}
}
@@ -170,7 +159,7 @@
userdata {\detokenize\expandafter{\normalexpanded{#userdata}}}
\relax
\edef\currentlistnumber{\the\scratchcounter}%
- \setxvalue{\??listlocations\currentlist}{\the\locationcount}%
+ \xdefcsname\??listlocations\currentlist\endcsname{\the\locationcount}%
\ifx\p_location\v!here
% this branch injects nodes !
\strc_lists_inject_enhance{\currentlistnumber}%
@@ -236,6 +225,22 @@
\tolerant\def\strc_lists_write_to_nop[#settings]#:#first#second%
{\endgroup} % \strc_lists_inject_nop[][]
+% \starttyping
+% \installstructurelistprocessor{chapter:userdata}
+% {\startlinecorrection[blank]
+% \hfill \inframed{you really need to look at \structurelistuservariable{pagenumber}}%
+% \stoplinecorrection}
+%
+% \starttext
+% \placelist[chapter]
+% \chapter{one}
+% \writebetweenlist[chapter][location=here]{\blank page 4\blank}
+% \writedatatolist[chapter][location=here][pagenumber=4]
+% \writetolist[chapter]{}{It's a test}
+% \chapter{two}
+% \stoptext
+% \stoptyping
+
%D When placing a list either one or a set can be giving. This makes it possible to
%D flush for instance an nested (or merged) table of contents. Keep in mind that
%D placing a list is what we do most (think of tables of contents, figures, etc.\
@@ -253,7 +258,7 @@
% use settings of first
\else
% use settings of root
- \let\m_first\empty
+ \lettonothing\m_first
\fi
\strc_lists_place_indeed\m_first\m_list{#settings}%
\stoppacked
@@ -266,7 +271,7 @@
\def\strc_lists_place_indeed#tag#list#settings%
{\begingroup
- \the\t_lists_every_renderingcleanup % \let\currentlistentrylocation\empty
+ \the\t_lists_every_renderingcleanup % \lettonothing\currentlistentrylocation
\edef\currentlist{#tag}%
\setupcurrentlist[#settings]%
\the\everystructurelist
@@ -277,6 +282,7 @@
{\listparameter\c!reference}%
{\listparameter\c!extras}%
{\listparameter\c!order}%
+ {\listparameter\c!levels}%
% \stoplistreferences
\par % todo: only when vertical list mode
\endgroup
@@ -320,9 +326,9 @@
\permanent\tolerant\protected\def\definecombinedlist[#tag]#spacer[#list]#spacer[#settings]%
{\definelist[#tag][\c!criterium=\v!local,\c!reference=,\c!alternative=,\c!list={#list},#settings]% inherits from root
- \frozen\instance\setvalue{\e!setup#tag\e!endsetup}{\setupcombinedlist[#tag]}%
- \frozen\instance\setvalue{\e!place#tag}{\placecombinedlist[#tag]}%
- \frozen\instance\setvalue{\e!complete#tag}{\strc_lists_combined_complete[#tag]}}
+ \frozen\instance\defcsname\e!setup#tag\e!endsetup\endcsname{\setupcombinedlist[#tag]}%
+ \frozen\instance\defcsname\e!place#tag\endcsname{\placecombinedlist[#tag]}%
+ \frozen\instance\defcsname\e!complete#tag\endcsname{\strc_lists_combined_complete[#tag]}}
\permanent\tolerant\protected\def\setupcombinedlist[#tag]#spacer[#settings]%
{\ifarguments\or\or
@@ -352,16 +358,22 @@
\installcorenamespace {listpagenumber}
-\setvalue{\??listpagenumber\v!always }{\settrue\c_lists_show_page\settrue\c_lists_has_page}
-\setvalue{\??listpagenumber\v!yes }{\settrue\c_lists_show_page}
-\setvalue{\??listpagenumber\s!realpage}{\settrue\c_lists_show_page\settrue\c_lists_show_realpage}
+\defcsname\??listpagenumber\v!always \endcsname{\settrue\c_lists_show_page\settrue\c_lists_has_page}
+\defcsname\??listpagenumber\v!yes \endcsname{\settrue\c_lists_show_page}
+\defcsname\??listpagenumber\s!realpage\endcsname{\settrue\c_lists_show_page\settrue\c_lists_show_realpage}
\def\strc_lists_process_pagenumber#1%
{\begincsname\??listpagenumber#1\endcsname}
+\permanent\def\structurelistexternal
+ {\clf_listexternal\numexpr\currentlistindex\relax}
+
\permanent\def\structurelistlocation
{\clf_listlocation\numexpr\currentlistindex\relax}
+\permanent\def\structurelistrawnumber#1%
+ {\clf_rawlistnumber\numexpr\currentlistindex\relax{#1}}
+
\permanent\def\structurelistrealpagenumber
{\clf_listrealpage{\currentlist}\numexpr\currentlistindex\relax}
@@ -445,7 +457,7 @@
% TODO: pass extra tag name (contents, figures, bibliography ...)
-\protected\def\strc_lists_place_current#list#criterium#reference#extras#order% beware, not a user command
+\protected\def\strc_lists_place_current#list#criterium#reference#extras#order#levels% beware, not a user command
{\dostarttaggedchained\t!list\empty\??list
\clf_processlist
names {#list}
@@ -453,6 +465,7 @@
reference {#reference}
extras {#extras}
order {#order}
+ levels {#levels}
\relax
\dostoptagged}
@@ -493,7 +506,7 @@
{\expandafter\normaldef\csname\??structurelistprocessor#tag\endcsname{#meaning}}
\permanent\def\usestructurelistprocessor#tag%
- {\csname\??structurelistprocessor#tag\endcsname}
+ {\begincsname\??structurelistprocessor#tag\endcsname}
\aliased\let\dotaglistlocation\relax
@@ -513,7 +526,7 @@
\permanent\protected\def\strclistsentryprocess#tag#method#index#extra% This one is called at the lua end!
{\clf_pushlist#index\relax
- %\let\currentlistentrylocation\empty
+ %\lettonothing\currentlistentrylocation
\edef\currentlist {#tag}%
\edef\currentlistmethod{#method}%
\edef\currentlistindex {#index}%
@@ -549,7 +562,7 @@
% example of usage elsewhere:
%
-% \installstructcurelistprocessor{pubs:userdata}
+% \installstructurelistprocessor{pubs:userdata}
% {\clf_listuserdata{\currentlist}\currentlistindex{bibref}}
%D List symbols are used in interactive documents where no numbers are used but
@@ -617,7 +630,8 @@
\rightlabeltext\currentlistlabel}
\mutable\let\currentlistnumber\!!zerocount
-\mutable\let\currentlistlabel \empty
+
+\mutable\lettonothing\currentlistlabel
\protected\def\strc_lists_symbol_default
{\dontleavehmode
@@ -631,22 +645,22 @@
\fi
\endgroup}
-\letvalue{\??listsymbollabels\s!unknown}\strc_lists_symbol_default
+\letcsname\??listsymbollabels\s!unknown\endcsname\strc_lists_symbol_default
-\setvalue{\??listsymbollabels}% default (empty)
+\defcsname\??listsymbollabels\endcsname % default (empty)
{\listparameter\c!starter
\currentlistentrynumber
\listparameter\c!stopper}
-\setvalue{\??listsymbollabels\v!no}% also default
+\defcsname\??listsymbollabels\v!no\endcsname % also default
{\listparameter\c!starter
\currentlistentrynumber
\listparameter\c!stopper}
-\setvalue{\??listsymbollabels\v!none}% real minimal (as suggested by WS)
+\defcsname\??listsymbollabels\v!none\endcsname % real minimal (as suggested by WS)
{\currentlistentrynumber}
-\setvalue{\??listsymbollabels\v!yes}% auto (use value stored in tuc file)
+\defcsname\??listsymbollabels\v!yes\endcsname % auto (use value stored in tuc file)
{\edef\currentlistlabel{\clf_listlabel\currentlistindex{\currentlistlabel}}%
\leftlabeltext\currentlistlabel
\listparameter\c!starter
@@ -673,7 +687,7 @@
% \installcorenamespace{listfiller}
%
% \protected\def\installlistfiller#1#2%
-% {\setuvalue{\??listfiller#1}{#2}}
+% {\protected\defcsname\??listfiller#1\endcsname{#2}}
%
% \protected\def\listfiller#1%
% {\begincsname\??listfiller#1\endcsname}
@@ -842,10 +856,10 @@
\newconditional\c_lists_show_number
\newconditional\c_lists_show_page
-\mutable\let\currentlistentrylocation \empty % watch the 'entry' in the name
-\mutable\let\currentlistentrynumber \empty % watch the 'entry' in the name
-\mutable\let\currentlistentrytitle \empty % watch the 'entry' in the name
-\mutable\let\currentlistentrypagenumber\empty % watch the 'entry' in the name
+\mutable\lettonothing\currentlistentrylocation % watch the 'entry' in the name
+\mutable\lettonothing\currentlistentrynumber % watch the 'entry' in the name
+\mutable\lettonothing\currentlistentrytitle % watch the 'entry' in the name
+\mutable\lettonothing\currentlistentrypagenumber % watch the 'entry' in the name
\appendtoks
\dontcomplain
@@ -908,10 +922,10 @@
\appendtoks
% as we don't want any interference we clear some variables
% afterwards
- \let\currentlistentrylocation \empty
- \let\currentlistentrynumber \empty
- \let\currentlistentrytitle \empty
- \let\currentlistentrypagenumber\empty
+ \lettonothing\currentlistentrylocation
+ \lettonothing\currentlistentrynumber
+ \lettonothing\currentlistentrytitle
+ \lettonothing\currentlistentrypagenumber
\setfalse\c_lists_has_page
\setfalse\c_lists_has_number
\setfalse\c_lists_show_page
@@ -919,7 +933,7 @@
\setfalse\c_lists_show_number
\to \t_lists_every_renderingcleanup
-\let\m_strc_list_alternative\empty % combined
+\lettonothing\m_strc_list_alternative % combined
\protected\def\strc_lists_apply_renderingsetup
{\the\t_lists_every_renderingsetup
@@ -1022,7 +1036,7 @@
\startsetups[\??listrenderings:abc]
\endgraf % are we grouped?
\typo_injectors_check_list
- % \advance % yes or no ... \rightskip is also honored
+ % \advanceby % yes or no ... \rightskip is also honored
\leftskip\listparameter\c!margin % after \endgraf !
\listparameter\c!before
\endgraf
@@ -1167,7 +1181,7 @@
\startsetups[\??listrenderings:d]
\ifvmode
- \advance\leftskip\listparameter\c!margin
+ \advanceby\leftskip\listparameter\c!margin
\fi
\begingroup
\ifvmode
@@ -1237,8 +1251,8 @@
\noindent % otherwise annotations are mirrored up
\typo_injectors_mark_list
\hbox \strc_lists_get_reference_attribute\v!all \strc_lists_get_destination_attribute {
- \letlistparameter\c!depth\zeropoint
- \letlistparameter\c!color\empty
+ \letlistparameter \c!depth\zeropoint
+ \resettlistparameter\c!color
\inheritedlistframed {
\letinteractionparameter\c!strut\v!no % still needed?
\strc_lists_set_style_color\c!style\c!color\v!all
@@ -1418,14 +1432,14 @@
\installcorenamespace{listinteractions}
-\letvalue{\??listinteractions\v!number }\v!number
-\letvalue{\??listinteractions\v!sectionnumber}\v!number
-\letvalue{\??listinteractions\v!text }\v!text
-\letvalue{\??listinteractions\v!title }\v!text
-\letvalue{\??listinteractions\v!page }\v!pagenumber
-\letvalue{\??listinteractions\v!pagenumber }\v!pagenumber
-\letvalue{\??listinteractions\v!all }\v!all
-\letvalue{\??listinteractions\v!yes }\v!all
+\letcsname\??listinteractions\v!number \endcsname\v!number
+\letcsname\??listinteractions\v!sectionnumber\endcsname\v!number
+\letcsname\??listinteractions\v!text \endcsname\v!text
+\letcsname\??listinteractions\v!title \endcsname\v!text
+\letcsname\??listinteractions\v!page \endcsname\v!pagenumber
+\letcsname\??listinteractions\v!pagenumber \endcsname\v!pagenumber
+\letcsname\??listinteractions\v!all \endcsname\v!all
+\letcsname\??listinteractions\v!yes \endcsname\v!all
\permanent\def\listboxproperties {\strc_lists_get_reference_attribute}
\permanent\def\listrenderingsetup {\the\t_lists_every_renderingtext}
@@ -1438,12 +1452,53 @@
\strc_lists_interaction_check_nop
\fi}
+% \def\strc_lists_interaction_check_yes_yes
+% {\edef\p_interaction_forward{\listparameter\c!interaction}%
+% \ifcsname\??listinteractions\p_interaction_forward\endcsname
+% %\expandafter\let\expandafter\p_interaction_forward\csname\??listinteractions\p_interaction_forward\endcsname
+% \expandafter\let\expandafter\p_interaction_forward\lastnamedcs
+% \strc_references_get_simple_reference{internal(\currentlistentrylocation)}%
+% \a_strc_lists_reference\currentreferenceattribute
+% \else
+% \a_strc_lists_reference\attributeunsetvalue
+% \fi
+% \ifnum\a_strc_lists_reference=\attributeunsetvalue
+% \let\strc_lists_get_reference_attribute\gobbleoneargument
+% \let\strc_lists_set_reference_attribute\gobbleoneargument
+% \let\strc_lists_set_style_color \strc_lists_set_style_color_normal
+% \else
+% \let\strc_lists_get_reference_attribute\strc_lists_get_reference_attribute_indeed
+% \let\strc_lists_set_reference_attribute\strc_lists_set_reference_attribute_indeed
+% \let\strc_lists_set_style_color \strc_lists_set_style_color_special
+% \fi
+% \edef\p_interaction_backward{\namedheadparameter\currentlist\c!interaction}% \namedheadparameter !
+% \ifx\p_interaction_backward\v!list
+% \strc_references_set_simple_reference{*\currentlistentrylocation}%
+% \a_strc_lists_destination\currentdestinationattribute
+% \else
+% \a_strc_lists_destination\attributeunsetvalue
+% \fi
+% \ifnum\a_strc_lists_destination=\attributeunsetvalue
+% \lettonothing\strc_lists_get_destination_attribute
+% \lettonothing\strc_lists_set_destination_attribute
+% \else
+% \let\strc_lists_get_destination_attribute\strc_lists_get_destination_attribute_indeed
+% \let\strc_lists_set_destination_attribute\strc_lists_set_destination_attribute_indeed
+% \fi}
+
\def\strc_lists_interaction_check_yes_yes
- {\edef\p_interaction_forward{\listparameter\c!interaction}%
+ {\edef\p_interaction_forward {\listparameter\c!interaction}%
+ \edef\p_interaction_backward{\namedheadparameter\currentlist\c!interaction}% \namedheadparameter !
\ifcsname\??listinteractions\p_interaction_forward\endcsname
%\expandafter\let\expandafter\p_interaction_forward\csname\??listinteractions\p_interaction_forward\endcsname
\expandafter\let\expandafter\p_interaction_forward\lastnamedcs
- \strc_references_get_simple_reference{internal(\currentlistentrylocation)}%
+ \ifcstok{\structurelistexternal}\emptytoks % luacall
+ \strc_references_get_simple_reference{internal(\currentlistentrylocation)}%
+ \else
+ % \writestatus{FAR OUT LIST}{\structurelistexternal::page(\number\structurelistrealpagenumber)}%
+ \strc_references_get_simple_reference{\structurelistexternal::page(\number\structurelistrealpagenumber)}%
+ \let\p_interaction_backward\empty
+ \fi
\a_strc_lists_reference\currentreferenceattribute
\else
\a_strc_lists_reference\attributeunsetvalue
@@ -1457,7 +1512,6 @@
\let\strc_lists_set_reference_attribute\strc_lists_set_reference_attribute_indeed
\let\strc_lists_set_style_color \strc_lists_set_style_color_special
\fi
- \edef\p_interaction_backward{\namedheadparameter\currentlist\c!interaction}% \namedheadparameter !
\ifx\p_interaction_backward\v!list
\strc_references_set_simple_reference{*\currentlistentrylocation}%
\a_strc_lists_destination\currentdestinationattribute
@@ -1465,8 +1519,8 @@
\a_strc_lists_destination\attributeunsetvalue
\fi
\ifnum\a_strc_lists_destination=\attributeunsetvalue
- \let\strc_lists_get_destination_attribute\empty
- \let\strc_lists_set_destination_attribute\empty
+ \lettonothing\strc_lists_get_destination_attribute
+ \lettonothing\strc_lists_set_destination_attribute
\else
\let\strc_lists_get_destination_attribute\strc_lists_get_destination_attribute_indeed
\let\strc_lists_set_destination_attribute\strc_lists_set_destination_attribute_indeed
@@ -1477,8 +1531,8 @@
\a_strc_lists_destination\attributeunsetvalue
\let\strc_lists_get_reference_attribute\gobbleoneargument
\let\strc_lists_set_reference_attribute\gobbleoneargument
- \let\strc_lists_get_destination_attribute\empty
- \let\strc_lists_set_destination_attribute\empty
+ \lettonothing\strc_lists_get_destination_attribute
+ \lettonothing\strc_lists_set_destination_attribute
\let\strc_lists_set_style_color\strc_lists_set_style_color_normal}
\def\strc_lists_interaction_check_yes
@@ -1493,8 +1547,8 @@
\def\strc_lists_interaction_check_nop
{\let\strc_lists_get_reference_attribute \gobbleoneargument
\let\strc_lists_set_reference_attribute \gobbleoneargument
- \let\strc_lists_get_destination_attribute\empty
- \let\strc_lists_set_destination_attribute\empty
+ \lettonothing\strc_lists_get_destination_attribute
+ \lettonothing\strc_lists_set_destination_attribute
\let\strc_lists_set_style_color \strc_lists_set_style_color_normal}
\strc_lists_interaction_check_nop
@@ -1533,7 +1587,7 @@
%D A helper:
-\def\strc_lists_limitated_text#text%
+\protected\def\strc_lists_limitated_text#text%
{\edef\p_maxwidth{\listparameter\c!maxwidth}%
\ifempty\p_maxwidth
\listparameter\c!textcommand{#text}%
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-mar-old.lmt b/Master/texmf-dist/tex/context/base/mkxl/strc-mar-old.lmt
new file mode 100644
index 00000000000..eb94f9fc391
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-mar-old.lmt
@@ -0,0 +1,759 @@
+if not modules then modules = { } end modules ['strc-mar'] = {
+ version = 1.001,
+ comment = "companion to strc-mar.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- todo: cleanup stack (structures.marks.reset(v_all) also does the job)
+-- todo: only commands.* print to tex, native marks return values
+
+local insert, concat = table.insert, table.concat
+local tostring, next, rawget, type = tostring, next, rawget, type
+local lpegmatch = lpeg.match
+
+local context = context
+local commands = commands
+
+local implement = interfaces.implement
+
+local allocate = utilities.storage.allocate
+local setmetatableindex = table.setmetatableindex
+
+local nuts = nodes.nuts
+local tonut = nuts.tonut
+
+local getid = nuts.getid
+local getlist = nuts.getlist
+local getattr = nuts.getattr
+local getbox = nuts.getbox
+
+local nextnode = nuts.traversers.node
+
+local nodecodes = nodes.nodecodes
+local whatsitcodes = nodes.whatsitcodes
+
+local glyph_code = nodecodes.glyph
+local hlist_code = nodecodes.hlist
+local vlist_code = nodecodes.vlist
+local whatsit_code = nodecodes.whatsit
+
+local lateluawhatsit_code = whatsitcodes.latelua
+
+local texsetattribute = tex.setattribute
+
+local a_marks = attributes.private("marks")
+
+local trace_set = false trackers.register("marks.set", function(v) trace_set = v end)
+local trace_get = false trackers.register("marks.get", function(v) trace_get = v end)
+local trace_details = false trackers.register("marks.details", function(v) trace_details = v end)
+
+local report_marks = logs.reporter("structure","marks")
+
+local variables = interfaces.variables
+
+local v_first = variables.first
+local v_last = variables.last
+local v_previous = variables.previous
+local v_next = variables.next
+local v_top = variables.top
+local v_bottom = variables.bottom
+local v_current = variables.current
+local v_default = variables.default
+local v_page = variables.page
+local v_all = variables.all
+local v_keep = variables.keep
+
+local v_nocheck_suffix = ":" .. variables.nocheck
+
+local v_first_nocheck = variables.first .. v_nocheck_suffix
+local v_last_nocheck = variables.last .. v_nocheck_suffix
+local v_previous_nocheck = variables.previous .. v_nocheck_suffix
+local v_next_nocheck = variables.next .. v_nocheck_suffix
+local v_top_nocheck = variables.top .. v_nocheck_suffix
+local v_bottom_nocheck = variables.bottom .. v_nocheck_suffix
+
+local structures = structures
+local marks = structures.marks
+
+local settings_to_array = utilities.parsers.settings_to_array
+
+local boxes_too = false -- at some point we can also tag boxes or use a zero char
+
+directives.register("marks.boxestoo", function(v) boxes_too = v end)
+
+local data = marks.data or allocate()
+marks.data = data
+
+storage.register("structures/marks/data", marks.data, "structures.marks.data")
+
+local stack, topofstack = { }, 0
+
+local ranges = {
+ [v_page] = {
+ first = 0,
+ last = 0,
+ },
+}
+
+local function resolve(t,k)
+ if k then
+ if trace_set or trace_get then
+ report_marks("undefined mark, name %a",k)
+ end
+ local crap = { autodefined = true } -- maybe set = 0 and reset = 0
+ t[k] = crap
+ return crap
+ else
+ -- weird: k is nil
+ end
+end
+
+setmetatableindex(data, resolve)
+
+function marks.exists(name)
+ return rawget(data,name) ~= nil
+end
+
+-- identify range
+
+local function sweep(head,first,last)
+ for n, id, subtype in nextnode, head do
+ -- we need to handle empty heads so we test for latelua
+ if id == glyph_code or (id == whatsit_code and subtype == lateluawhatsit_code) then -- brrr
+ local a = getattr(n,a_marks)
+ if not a then
+ -- next
+ elseif first == 0 then
+ first, last = a, a
+ elseif a > last then
+ last = a
+ end
+ elseif id == hlist_code or id == vlist_code then
+ if boxes_too then
+ local a = getattr(n,a_marks)
+ if not a then
+ -- next
+ elseif first == 0 then
+ first, last = a, a
+ elseif a > last then
+ last = a
+ end
+ end
+ local list = getlist(n)
+ if list then
+ first, last = sweep(list,first,last)
+ end
+ end
+ end
+ return first, last
+end
+
+local classes = { }
+
+setmetatableindex(classes, function(t,k) local s = settings_to_array(k) t[k] = s return s end)
+
+local lasts = { }
+
+function marks.synchronize(class,n,option)
+ local box = getbox(n)
+ if box then
+ local first, last = sweep(getlist(box),0,0)
+ if option == v_keep and first == 0 and last == 0 then
+ if trace_get or trace_set then
+ report_marks("action %a, class %a, box %a","retain at synchronize",class,n)
+ end
+ -- todo: check if still valid first/last in range
+ first = lasts[class] or 0
+ last = first
+ else
+ lasts[class] = last
+ local classlist = classes[class]
+ for i=1,#classlist do
+ local class = classlist[i]
+ local range = ranges[class]
+ if range then
+ range.first = first
+ range.last = last
+ else
+ range = {
+ first = first,
+ last = last,
+ }
+ ranges[class] = range
+ end
+ if trace_get or trace_set then
+ report_marks("action %a, class %a, first %a, last %a","synchronize",class,range.first,range.last)
+ end
+ end
+ end
+ elseif trace_get or trace_set then
+ report_marks("action %s, class %a, box %a","synchronize without content",class,n)
+ end
+end
+
+-- define etc
+
+local function resolve(t,k)
+ if k == "fullchain" then
+ local fullchain = { }
+ local chain = t.chain
+ while chain and chain ~= "" do
+ insert(fullchain,1,chain)
+ chain = data[chain].chain
+ end
+ t[k] = fullchain
+ return fullchain
+ elseif k == "chain" then
+ t[k] = ""
+ return ""
+ elseif k == "reset" or k == "set" then
+ t[k] = 0
+ return 0
+ elseif k == "parent" then
+ t[k] = false
+ return false
+ end
+end
+
+function marks.define(name,settings)
+ if not settings then
+ settings = { }
+ elseif type(settings) == "string" then
+ settings = { parent = settings }
+ end
+ data[name] = settings
+ local parent = settings.parent
+ if parent == nil or parent == "" or parent == name then
+ settings.parent = false
+ else
+ local dp = data[parent]
+ if not dp then
+ settings.parent = false
+ elseif dp.parent then
+ settings.parent = dp.parent
+ end
+ end
+ setmetatableindex(settings, resolve)
+end
+
+for k, v in next, data do
+ setmetatableindex(v,resolve) -- runtime loaded table
+end
+
+local function parentname(name)
+ local dn = data[name]
+ return dn and dn.parent or name
+end
+
+function marks.relate(name,chain)
+ local dn = data[name]
+ if dn and not dn.parent then
+ if chain and chain ~= "" then
+ dn.chain = chain
+ local dc = data[chain]
+ if dc then
+ local children = dc.children
+ if not children then
+ children = { }
+ dc.children = children
+ end
+ children[#children+1] = name
+ end
+ elseif trace_set then
+ report_marks("error: invalid relation, name %a, chain %a",name,chain)
+ end
+ end
+end
+
+local function resetchildren(new,name)
+ local dn = data[name]
+ if dn and not dn.parent then
+ local children = dn.children
+ if children then
+ for i=1,#children do
+ local ci = children[i]
+ new[ci] = false
+ if trace_set then
+ report_marks("action %a, parent %a, child %a","reset",name,ci)
+ end
+ resetchildren(new,ci)
+ end
+ end
+ end
+end
+
+function marks.set(name,value)
+ local dn = data[name]
+ if dn then
+ local child = name
+ local parent = dn.parent
+ if parent then
+ name = parent
+ dn = data[name]
+ end
+ dn.set = topofstack
+ if not dn.reset then
+ dn.reset = 0 -- in case of selfdefined
+ end
+ local top = stack[topofstack]
+ local new = { }
+ if top then
+ for k, v in next, top do
+ local d = data[k]
+ local r = d.reset or 0
+ local s = d.set or 0
+ if r <= topofstack and s < r then
+ new[k] = false
+ else
+ new[k] = v
+ end
+ end
+ end
+ resetchildren(new,name)
+ new[name] = value
+ topofstack = topofstack + 1
+ stack[topofstack] = new
+ if trace_set then
+ if name == child then
+ report_marks("action %a, name %a, index %a, value %a","set",name,topofstack,value)
+ else
+ report_marks("action %a, parent %a, child %a, index %a, value %a","set",parent,child,topofstack,value)
+ end
+ end
+ texsetattribute("global",a_marks,topofstack)
+ end
+end
+
+local function reset(name)
+ if v_all then
+ if trace_set then
+ report_marks("action %a","reset all")
+ end
+ stack = { }
+ for name, dn in next, data do
+ local parent = dn.parent
+ if parent then
+ dn.reset = 0
+ dn.set = 0
+ end
+ end
+ else
+ local dn = data[name]
+ if dn then
+ local parent = dn.parent
+ if parent then
+ name = parent
+ dn = data[name]
+ end
+ if trace_set then
+ report_marks("action %a, name %a, index %a","reset",name,topofstack)
+ end
+ dn.reset = topofstack
+ local children = dn.children
+ if children then
+ for i=1,#children do
+ local ci = children[i]
+ reset(ci)
+ end
+ end
+ end
+ end
+end
+
+marks.reset = reset
+
+function marks.get(n,name,value)
+ local dn = data[name]
+ if dn then
+ name = dn.parent or name
+ local top = stack[n]
+ if top then
+ context(top[name])
+ end
+ end
+end
+
+function marks.show(first,last)
+ if first and last then
+ for k=first,last do
+ local v = stack[k]
+ if v then
+ report_marks("% 4i: %s",k,table.sequenced(v))
+ end
+ end
+ else
+ for k, v in table.sortedpairs(stack) do
+ report_marks("% 4i: %s",k,table.sequenced(v))
+ end
+ end
+end
+
+local function resolve(name,first,last,strict,quitonfalse,notrace)
+ local dn = data[name]
+ if dn then
+ local child = name
+ local parent = dn.parent
+ name = parent or child
+ dn = data[name]
+ local step, method
+ if first > last then
+ step, method = -1, "bottom-up"
+ else
+ step, method = 1, "top-down"
+ end
+ if trace_get and not notrace then
+ report_marks("action %a, strategy %a, name %a, parent %a, strict %a","request",method,child,parent,strict or false)
+ end
+ if trace_details and not notrace then
+ marks.show(first,last)
+ end
+ local r = dn.reset
+ local s = dn.set
+ if first <= last and first <= r then
+ if trace_get and not notrace then
+ report_marks("action %a, name %a, first %a, last %a, reset %a, index %a","reset first",name,first,last,r,first)
+ end
+ elseif first >= last and last <= r then
+ if trace_get and not notrace then
+ report_marks("action %a, name %a, first %a, last %a, reset %a, index %a","reset last",name,first,last,r,last)
+ end
+ elseif not stack[first] or not stack[last] then
+ if trace_get and not notrace then
+ -- a previous or next method can give an out of range, which is valid
+ report_marks("error: out of range, name %a, reset %a, index %a",name,r,first)
+ end
+ elseif strict then
+ local top = stack[first]
+ local fullchain = dn.fullchain
+ if not fullchain or #fullchain == 0 then
+ if trace_get and not notrace then
+ report_marks("warning: no full chain, trying again, name %a, first %a, last %a",name,first,last)
+ end
+ return resolve(name,first,last)
+ else
+ if trace_get and not notrace then
+ report_marks("found chain [ % => T ]",fullchain)
+ end
+ local chaindata = { }
+ local chainlength = #fullchain
+ for i=1,chainlength do
+ local cname = fullchain[i]
+ if data[cname].set > 0 then
+ local value = resolve(cname,first,last,false,false,true)
+ if value == "" then
+ if trace_get and not notrace then
+ report_marks("quitting chain, name %a, reset %a, start %a",name,r,first)
+ end
+ return ""
+ else
+ chaindata[i] = value
+ end
+ end
+ end
+ if trace_get and not notrace then
+ report_marks("using chain [ % => T ]",chaindata)
+ end
+ local value, index, found = resolve(name,first,last,false,false,true)
+ if value ~= "" then
+ if trace_get and not notrace then
+ report_marks("following chain [ % => T ]",chaindata)
+ end
+ for i=1,chainlength do
+ local cname = fullchain[i]
+ if data[cname].set > 0 and chaindata[i] ~= found[cname] then
+ if trace_get and not notrace then
+ report_marks("quiting chain, name %a, reset %a, index %a",name,r,first)
+ end
+ return ""
+ end
+ end
+ if trace_get and not notrace then
+ report_marks("found in chain, name %a, reset %a, start %a, index %a, value %a",name,r,first,index,value)
+ end
+ return value, index, found
+ elseif trace_get and not notrace then
+ report_marks("not found, name %a, reset %a",name,r)
+ end
+ end
+ else
+ for i=first,last,step do
+ local current = stack[i]
+ local value = current and current[name]
+ if value == nil then
+ -- search on
+ elseif value == false then
+ if quitonfalse then
+ return ""
+ end
+ elseif value == true then
+ if trace_get and not notrace then
+ report_marks("quitting steps, name %a, reset %a, start %a, index %a",name,r,first,i)
+ end
+ return ""
+ elseif value ~= "" then
+ if trace_get and not notrace then
+ report_marks("found in steps, name %a, reset %a, start %a, index %a, value %a",name,r,first,i,value)
+ end
+ return value, i, current
+ end
+ end
+ if trace_get and not notrace then
+ report_marks("not found in steps, name %a, reset %a",name,r)
+ end
+ end
+ end
+ return ""
+end
+
+-- todo: column:first column:last
+
+local methods = { }
+
+local function doresolve(name,rangename,swap,df,dl,strict)
+ local range = ranges[rangename] or ranges[v_page]
+ local first = range.first
+ local last = range.last
+ if trace_get then
+ report_marks("action %a, name %a, range %a, swap %a, first %a, last %a, df %a, dl %a, strict %a",
+ "resolving",name,rangename,swap or false,first,last,df,dl,strict or false)
+ end
+ if swap then
+ first, last = last + df, first + dl
+ else
+ first, last = first + df, last + dl
+ end
+ local value, index, found = resolve(name,first,last,strict)
+ -- maybe something more
+ return value, index, found
+end
+
+-- previous : last before sync
+-- next : first after sync
+
+-- top : first in sync
+-- bottom : last in sync
+
+-- first : first not top in sync
+-- last : last not bottom in sync
+
+methods[v_previous] = function(name,range) return doresolve(name,range,false,-1,0,true ) end -- strict
+methods[v_top] = function(name,range) return doresolve(name,range,false, 0,0,true ) end -- strict
+methods[v_bottom] = function(name,range) return doresolve(name,range,true , 0,0,true ) end -- strict
+methods[v_next] = function(name,range) return doresolve(name,range,true , 0,1,true ) end -- strict
+
+methods[v_previous_nocheck] = function(name,range) return doresolve(name,range,false,-1,0,false) end
+methods[v_top_nocheck] = function(name,range) return doresolve(name,range,false, 0,0,false) end
+methods[v_bottom_nocheck] = function(name,range) return doresolve(name,range,true , 0,0,false) end
+methods[v_next_nocheck] = function(name,range) return doresolve(name,range,true , 0,1,false) end
+
+local function do_first(name,range,check)
+ if trace_get then
+ report_marks("action %a, name %a, range %a","resolving first",name,range)
+ end
+ local f_value, f_index, f_found = doresolve(name,range,false,0,0,check)
+ if f_found then
+ if trace_get then
+ report_marks("action %a, name %a, range %a","resolving last",name,range)
+ end
+ local l_value, l_index, l_found = doresolve(name,range,true ,0,0,check)
+ if l_found and l_index > f_index then
+ local name = parentname(name)
+ for i=f_index,l_index,1 do
+ local si = stack[i]
+ local sn = si[name]
+ if sn and sn ~= false and sn ~= true and sn ~= "" and sn ~= f_value then
+ if trace_get then
+ report_marks("action %a, name %a, range %a, index %a, value %a","resolving",name,range,i,sn)
+ end
+ return sn, i, si
+ end
+ end
+ end
+ end
+ if trace_get then
+ report_marks("resolved, name %a, range %a, using first",name,range)
+ end
+ return f_value, f_index, f_found
+end
+
+local function do_last(name,range,check)
+ if trace_get then
+ report_marks("action %a, name %a, range %a","resolving last",name,range)
+ end
+ local l_value, l_index, l_found = doresolve(name,range,true ,0,0,check)
+ if l_found then
+ if trace_get then
+ report_marks("action %a, name %a, range %a","resolving first",name,range)
+ end
+ local f_value, f_index, f_found = doresolve(name,range,false,0,0,check)
+ if f_found and l_index > f_index then
+ local name = parentname(name)
+ for i=l_index,f_index,-1 do
+ local si = stack[i]
+ local sn = si[name]
+ if sn and sn ~= false and sn ~= true and sn ~= "" and sn ~= l_value then
+ if trace_get then
+ report_marks("action %a, name %a, range %a, index %a, value %a","resolving",name,range,i,sn)
+ end
+ return sn, i, si
+ end
+ end
+ end
+ end
+ if trace_get then
+ report_marks("resolved, name %a, range %a, using first",name,range)
+ end
+ return l_value, l_index, l_found
+end
+
+methods[v_first ] = function(name,range) return do_first(name,range,true ) end
+methods[v_last ] = function(name,range) return do_last (name,range,true ) end
+methods[v_first_nocheck] = function(name,range) return do_first(name,range,false) end
+methods[v_last_nocheck ] = function(name,range) return do_last (name,range,false) end
+
+methods[v_current] = function(name,range) -- range is ignored here
+ local top = stack[topofstack]
+ return top and top[parentname(name)] or ""
+end
+
+local function fetched(name,range,method)
+ local value = (methods[method] or methods[v_first])(name,range) or ""
+ if not trace_get then
+ -- no report
+ elseif value == "" then
+ report_marks("nothing fetched, name %a, range %a, method %a",name,range,method)
+ else
+ report_marks("marking fetched, name %a, range %a, method %a, value %a",name,range,method,value)
+ end
+ return value or ""
+end
+
+-- can be used at the lua end:
+
+marks.fetched = fetched
+
+-- this will move to a separate runtime modules
+
+marks.tracers = marks.tracers or { }
+
+function marks.tracers.showtable()
+ context.starttabulate { "|l|l|l|lp|lp|" }
+ context.tabulaterowbold("name","parent","chain","children","fullchain")
+ context.ML()
+ for k, v in table.sortedpairs(data) do
+ local parent = v.parent or ""
+ local chain = v.chain or ""
+ local children = v.children or { }
+ local fullchain = v.fullchain or { }
+ table.sort(children) -- in-place but harmless
+ context.tabulaterowtyp(k,parent,chain,concat(children," "),concat(fullchain," "))
+ end
+ context.stoptabulate()
+end
+
+-- pushing to context:
+
+-- local separator = context.nested.markingseparator
+-- local command = context.nested.markingcommand
+-- local ctxconcat = context.concat
+
+-- local function fetchonemark(name,range,method)
+-- context(command(name,fetched(name,range,method)))
+-- end
+
+-- local function fetchtwomarks(name,range)
+-- ctxconcat( {
+-- command(name,fetched(name,range,v_first)),
+-- command(name,fetched(name,range,v_last)),
+-- }, separator(name))
+-- end
+
+-- local function fetchallmarks(name,range)
+-- ctxconcat( {
+-- command(name,fetched(name,range,v_previous)),
+-- command(name,fetched(name,range,v_first)),
+-- command(name,fetched(name,range,v_last)),
+-- }, separator(name))
+-- end
+
+ local ctx_separator = context.markingseparator
+ local ctx_command = context.markingcommand
+
+ local function fetchonemark(name,range,method)
+ ctx_command(name,fetched(name,range,method))
+ end
+
+ local function fetchtwomarks(name,range)
+ ctx_command(name,fetched(name,range,v_first))
+ ctx_separator(name)
+ ctx_command(name,fetched(name,range,v_last))
+ end
+
+ local function fetchallmarks(name,range)
+ ctx_command(name,fetched(name,range,v_previous))
+ ctx_separator(name)
+ ctx_command(name,fetched(name,range,v_first))
+ ctx_separator(name)
+ ctx_command(name,fetched(name,range,v_last))
+ end
+
+function marks.fetch(name,range,method) -- chapter page first | chapter column:1 first
+ if trace_get then
+ report_marks("marking requested, name %a, range %a, method %a",name,range,method)
+ end
+ if method == "" or method == v_default then
+ fetchonemark(name,range,v_first)
+ elseif method == v_both then
+ fetchtwomarks(name,range)
+ elseif method == v_all then
+ fetchallmarks(name,range)
+ else
+ fetchonemark(name,range,method)
+ end
+end
+
+function marks.fetchonemark (name,range,method) fetchonemark (name,range,method) end
+function marks.fetchtwomarks(name,range) fetchtwomarks(name,range ) end
+function marks.fetchallmarks(name,range) fetchallmarks(name,range ) end
+
+-- here we have a few helpers .. will become commands.*
+
+local pattern = lpeg.afterprefix("li::")
+
+function marks.title(tag,n)
+ local listindex = lpegmatch(pattern,n)
+ if listindex then
+ commands.savedlisttitle(tag,listindex,"marking")
+ else
+ context(n)
+ end
+end
+
+function marks.number(tag,n) -- no spec
+ local listindex = lpegmatch(pattern,n)
+ if listindex then
+ commands.savedlistnumber(tag,listindex)
+ else
+ -- no prefix (as it is the prefix)
+ context(n)
+ end
+end
+
+-- interface
+
+implement { name = "markingtitle", actions = marks.title, arguments = "2 strings" }
+implement { name = "markingnumber", actions = marks.number, arguments = "2 strings" }
+
+implement { name = "definemarking", actions = marks.define, arguments = "2 strings" }
+implement { name = "relatemarking", actions = marks.relate, arguments = "2 strings" }
+implement { name = "setmarking", actions = marks.set, arguments = "2 strings" }
+implement { name = "resetmarking", actions = marks.reset, arguments = "string" }
+implement { name = "synchronizemarking", actions = marks.synchronize, arguments = { "string", "integer", "string" } }
+implement { name = "getmarking", actions = marks.fetch, arguments = "3 strings" }
+implement { name = "fetchonemark", actions = marks.fetchonemark, arguments = "3 strings" }
+implement { name = "fetchtwomarks", actions = marks.fetchtwomarks, arguments = "2 strings" }
+implement { name = "fetchallmarks", actions = marks.fetchallmarks, arguments = "2 strings" }
+
+implement { name = "doifelsemarking", actions = { marks.exists, commands.doifelse }, arguments = "string" }
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-mar-old.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-mar-old.mkxl
new file mode 100644
index 00000000000..b2c421dbf89
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-mar-old.mkxl
@@ -0,0 +1,142 @@
+%D \module
+%D [ file=strc-mar,
+%D version=2008.10.20,
+%D title=\CONTEXT\ Structure Macros,
+%D subtitle=Markings,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%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 Structure Macros / Markings}
+
+\registerctxluafile{strc-mar-old}{autosuffix}
+
+\unprotect
+
+%D Synchronizing marks is a rather tricky and messy business. When setting a mark, a
+%D node is added to the list in order for to \TEX\ be able to figure out the 3
+%D current marks when a page is made (last mark on previous page, first on current
+%D page, last on current page; in \LUATEX\ we might at one point have the first on
+%D the next page as well).
+%D
+%D Resetting a mark is not easy. An empty one will not erase the last one on the
+%D previous page for instance. In \LUATEX\ we can clear a marks state register with
+%D \type {\clearmarks} but since this is an immediate operation it might have
+%D unwanted side effects when \TEX\ has collected several pages of text and
+%D finishing off these pages uses marks.
+%D
+%D In \MKIV\ we provide an alternative model that permits some more control over the
+%D way marks are used. It is not entirely compatible with \MKII\ or previous \MKIV\
+%D implementations but in practice this is not a real problem. It's also easier now
+%D to extend this mechanism.
+
+% first last previous next top bottom [:nocheck]
+% current
+% default page all keep
+
+\definesystemattribute [marks] [global]
+
+\installcorenamespace{marking}
+
+\installcommandhandler \??marking {marking} \??marking
+
+\newconditional\inhibitgetmarking % will become private
+\newconditional\inhibitsetmarking % will become private
+
+\newtoks \everymarking
+
+\appendtoks
+ \clf_definemarking{\currentmarking}{\currentmarkingparent}%
+\to \everydefinemarking
+
+\permanent\protected\tolerant\def\relatemarking [#1]#*[#2]{\clf_relatemarking{#1}{#2}}
+\permanent\protected\tolerant\def\resetmarking [#1]{\clf_resetmarking{#1}}
+\permanent\protected\tolerant\def\synchronizemarking[#1]#*[#2]#*[#3]{\ifvoid#2\else\clf_synchronizemarking{#1}#2{#3}\fi}
+\permanent \def\doifelsemarking #1{\clf_doifelsemarking{#1}} % no \noexpanded
+
+\aliased\let\clearmarking\resetmarking % different in the new situation
+
+\def\strc_markings_synchronize#1#2#3{\ifvoid#2\else\clf_synchronizemarking{#1}#2{#3}\fi} % called in page-ini
+
+\permanent\protected\tolerant\def\setmarking[#1]#:#2%
+ {\ifconditional\inhibitsetmarking\else
+ \doifelse{\namedmarkingparameter{#1}\c!expansion}\v!yes
+ {\clf_setmarking{#1}{#2}}%
+ {\clf_setmarking{#1}{\detokenize{#2}}}%
+ \fi}
+
+\aliased\let\marking \setmarking
+\aliased\let\doifmarkingelse\doifelsemarking
+
+% defaults
+
+\setupmarking
+ [\c!expansion=\v!no,
+ \c!separator=\space\emdash\space,
+ \c!filtercommand=\firstofoneargument,
+ \c!state=\v!start]
+
+% fetching, regular interface
+
+\permanent\protected\def\getmarking
+ {\ifconditional\inhibitgetmarking
+ \expandafter\strc_markings_get_nop
+ \else
+ \expandafter\strc_markings_get_yes
+ \fi}
+
+\tolerant\def\strc_markings_get_nop[#-]#*[#-]#*[#-]%
+ {}
+
+\tolerant\def\strc_markings_get_yes[#1]#*[#2]#*[#3]%
+ {\ifcstok{\namedmarkingparameter{#1}\c!state}\v!start
+ \begingroup
+ \setsystemmode\v!marking
+ \the\everymarking
+ \ifparameter#3\or
+ \clf_getmarking{#1}{#2}{#3}%
+ \else
+ \clf_getmarking{#1}{\v!page}{#2}%
+ \fi
+ \endgroup
+ \fi}
+
+% the fetchers are fully expandable: [name][method]
+
+\permanent\tolerant\def\fetchonemark[#1]#*[#2]{\ifconditional\inhibitgetmarking\else\clf_fetchonemark {#1}{\v!page}{#2}\fi}
+\permanent\tolerant\def\fetchtwomarks [#1]{\ifconditional\inhibitgetmarking\else\clf_fetchtwomarks{#1}{\v!page}\fi}
+\permanent\tolerant\def\fetchallmarks [#1]{\ifconditional\inhibitgetmarking\else\clf_fetchallmarks{#1}{\v!page}\fi}
+
+\aliased\let\fetchmark\fetchonemark
+
+% also fully expandable but here we have: [name][range][method]
+
+\permanent\tolerant\def\fetchonemarking[#1]#*[#2]#*[#3]{\ifconditional\inhibitgetmarking\else\clf_fetchonemark {#1}{#2}{#3}\fi}
+\permanent\tolerant\def\fetchtwomarkings [#1]#*[#2]{\ifconditional\inhibitgetmarking\else\clf_fetchtwomarks{#1}{#2}\fi}
+\permanent\tolerant\def\fetchallmarkings [#1]#*[#2]{\ifconditional\inhibitgetmarking\else\clf_fetchallmarks{#1}{#2}\fi}
+
+\aliased\let\fetchmarking\fetchonemarking
+
+\permanent\def\markingseparator#1{\namedmarkingparameter{#1}\c!separator}
+\permanent\def\markingcommand #1{\namedmarkingparameter{#1}\c!filtercommand}
+
+%D Experimental:
+%D
+%D \starttyping
+%D \definemarking[boxmark]
+%D
+%D \setbox0\ruledvbox{
+%D \marking[boxmark]{tufte} \input tufte \par
+%D \marking[boxmark]{ward} \input ward \par
+%D }
+%D
+%D \synchronizemarking[zerobox][0] \box0
+%D
+%D marks: (\getmarking[boxmark][zerobox][first],\getmarking[boxmark][zerobox][last])
+%D \stoptyping
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-mar.lmt b/Master/texmf-dist/tex/context/base/mkxl/strc-mar.lmt
new file mode 100644
index 00000000000..e5266daf0dc
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-mar.lmt
@@ -0,0 +1,171 @@
+if not modules then modules = { } end modules ['strc-mar'] = {
+ version = 1.001,
+ comment = "companion to strc-mar.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local lpegmatch = lpeg.match
+local setmetatableindex = table.setmetatableindex
+
+local context = context
+
+local implement = interfaces.implement
+local variables = interfaces.variables
+
+local v_first = variables.first
+local v_last = variables.last
+local v_previous = variables.previous
+local v_next = variables.next
+local v_column = variables.column
+
+local nuts = nodes.nuts
+local nextmark = nuts.traversers.mark
+local getbox = nuts.getbox
+local getid = nuts.getid
+local getlist = nuts.getlist
+local getindex = nuts.getindex
+local getdata = nuts.getdata
+----- setmark_code = nodes.markcodes.set
+local flushmark_code = nodes.markcodes.flush
+local hlist_code = nodes.nodecodes.hlist
+local vlist_code = nodes.nodecodes.vlist
+
+local marks = { }
+structures.marks = marks
+
+local markdata = setmetatableindex("table")
+local pattern = lpeg.splitat(":")
+
+implement {
+ name = "synchronizemarking",
+ arguments = { "string", "integer", "integer" },
+ actions = function(category,index,boxnumber)
+ local new = setmetatableindex("table")
+ local box = getbox(boxnumber)
+ while box and getid(box) == hlist_code do
+ box = getlist(box)
+ end
+ if box and getid(box) == vlist_code then
+ local list = getlist(box)
+ if list then
+ for n, subtype in nextmark, list do
+ local class = getindex(n)
+ local entry = new[class]
+ if subtype == flushmark_code then
+ entry.first = false
+ entry.last = false
+ else
+ if not entry.first then
+ entry.first = n
+ end
+ entry.last = n
+ end
+ end
+ for class, entry in next, new do
+ local first = entry.first
+ local last = entry.last
+ if last and first ~= last then
+ entry.last = getdata(last,true)
+ end
+ if first then
+ entry.first = getdata(first,true)
+ end
+ end
+ else
+ -- wipe empty columns
+ end
+ else
+ -- wipe empty columns
+ end
+ local m = markdata[category]
+ if m then
+ local entry = m[index]
+ if entry then
+ local prev = index == 1 and m[#m] or m[index-1]
+ for class, data in next, entry do
+ local pcls = prev[class]
+ local last = pcls and pcls.last
+ if last then
+ local ncls = new[class]
+ ncls.previous = last
+ if not ncls.first then
+ ncls.first = last
+ end
+ if not ncls.last then
+ ncls.last = ncls.first
+ end
+ end
+ end
+ end
+ m[index] = new
+ else
+ new.previous = ""
+ markdata[category] = { [index] = new }
+ end
+ -- inspect(data)
+ end,
+}
+
+implement {
+ name = "getsynchronizedmarking",
+ arguments = { "integer", "string", "string" },
+ actions = function(class,category,what)
+ local category, n = lpegmatch(pattern,category)
+ local useddata = markdata[category]
+ if useddata then
+ local index = tonumber(n) or 1
+ local data = useddata[index]
+ if data then
+ local entry = data[class]
+ if entry then
+ if what == v_first then
+ context(entry.first or "")
+ elseif what == v_last then
+ context(entry.last or "")
+ elseif what == v_previous then
+ context(entry.previous or "")
+ elseif what == v_next then
+ -- context(entry.next or "") -- will be done when i need it, unreliable anyway
+ end
+ end
+ end
+ end
+ end
+}
+
+implement {
+ name = "resetsynchronizedmarking",
+ arguments = "argument",
+ actions = function(category)
+ local category, n = lpegmatch(pattern,category)
+ markdata[category] = nil
+ end
+}
+
+local pattern = lpeg.afterprefix("li::")
+
+function marks.title(tag,n)
+ local listindex = lpegmatch(pattern,n)
+ if listindex then
+ commands.savedlisttitle(tag,listindex,"marking")
+ else
+ context(n)
+ end
+end
+
+function marks.number(tag,n) -- no spec
+ local listindex = lpegmatch(pattern,n)
+ if listindex then
+ commands.savedlistnumber(tag,listindex)
+ else
+ -- no prefix (as it is the prefix)
+ context(n)
+ end
+end
+
+-- interface
+
+implement { name = "markingtitle", actions = marks.title, arguments = "2 strings" }
+implement { name = "markingnumber", actions = marks.number,arguments = "2 strings" }
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-mar.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-mar.mkxl
index eb095a2a572..4c279f6dd6e 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/strc-mar.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-mar.mkxl
@@ -13,7 +13,7 @@
\writestatus{loading}{ConTeXt Structure Macros / Markings}
-\registerctxluafile{strc-mar}{}
+\registerctxluafile{strc-mar}{autosuffix}
\unprotect
@@ -34,9 +34,31 @@
%D implementations but in practice this is not a real problem. It's also easier now
%D to extend this mechanism.
-\definesystemattribute [marks] [global]
+%D In \LUAMETATEX\ we have extended the marks mechanism with a few handy options.
+%D First of all we have automigration built in for inserts and marks (so we no
+%D longer need to do that in \LUA) and marks can be properly flushed.
+
+% \ifdefined\automigrationmode \automigrationmode0 \fi
+% \starttext
+% \dorecurse{10}{
+% \dontleavehmode\setbox0\hbox{SAMPLE #1}\box0
+% \marks\foomark{sample #1}%
+% \samplefile{tufte}\par
+% }%
+% \stoptext
+
+% current
+
+% column:n | n | column | etc ... now only column:n
+
+% default page all keep
+
+%definesystemattribute [marks] [global]
\installcorenamespace{marking}
+\installcorenamespace{markingclass}
+\installcorenamespace{markingsyncs}
+\installcorenamespace{markingfilter}
\installcommandhandler \??marking {marking} \??marking
@@ -45,22 +67,74 @@
\newtoks \everymarking
+% \clf_definemarking{\currentmarking}{\currentmarkingparent}%
+
\appendtoks
- \clf_definemarking{\currentmarking}{\currentmarkingparent}%
+ \ifcsname\??markingclass\currentmarking\endcsname\else
+ \ifempty\currentmarkingparent
+ \expandafter\newmarks\csname\??markingclass\currentmarking\endcsname
+ \expandafter\newtoks \csname\??markingsyncs\currentmarking\endcsname
+ \else
+ \expandafter\letcsname\??markingclass\currentmarking\expandafter\endcsname\csname\??markingclass\currentmarkingparent\endcsname
+ \expandafter\letcsname\??markingsyncs\currentmarking\expandafter\endcsname\csname\??markingsyncs\currentmarkingparent\endcsname
+ \fi
+ \fi
\to \everydefinemarking
-\permanent\protected\tolerant\def\relatemarking [#1]#*[#2]{\clf_relatemarking{#1}{#2}}
-\permanent\protected\tolerant\def\resetmarking [#1]{\clf_resetmarking{#1}}
-\permanent\protected\tolerant\def\synchronizemarking[#1]#*[#2]#*[#3]{\ifvoid#2\else\clf_synchronizemarking{#1}#2{#3}\fi}
-\permanent \def\doifelsemarking #1{\clf_doifelsemarking{#1}} % no \noexpanded
+\permanent\protected\tolerant\def\relatemarking[#1]#*[#2]%
+ {\ifarguments\or\else
+ \xtoksapp\csname\??markingsyncs#2\endcsname{%
+ \flushmarks\csname\??markingclass#1\endcsname
+ \noexpand\the\begincsname\??markingsyncs#1\endcsname
+ }%
+ \fi}
-\def\strc_markings_synchronize#1#2#3{\ifvoid#2\else\clf_synchronizemarking{#1}#2{#3}\fi} % called in page-ini
+\permanent\protected\tolerant\def\clearmarking[#1]%
+ {\ifarguments\else
+ \begingroup
+ \clearmarks\csname\??markingclass#1\endcsname
+ \enforced\let\flushmarks\clearmarks
+ \the\csname\??markingsyncs#1\endcsname
+ \endgroup
+ \fi}
+
+\permanent\protected\tolerant\def\resetmarking[#1]%
+ {\ifarguments\else
+ % probably best: \dontleavehmode
+ \the\csname\??markingsyncs#1\endcsname
+ \fi}
+
+\permanent\protected\tolerant\def\resetsynchronizemarking[#1]%
+ {\clf_resetsynchronizemarking{#1}}
+
+\tolerant\def\synchronizemarking[#1]#*[#2]#*[#3]% #3: options
+ {\clf_synchronizemarking{#1}\plusone\numexpr#2\relax}
+
+\def\strc_markings_synchronize#1#2#3% category n box
+ {\ifvoid#3\orelse\ifcstok{#1}\v!page\else
+ \clf_synchronizemarking{#1}\numexpr#2\relax\numexpr#3\relax
+ \fi}
+
+\permanent\def\doifelsemarking#1%
+ {\ifcondition\ifcommandhandler\??marking{#1}%
+ \expandafter\firstoftwoarguments
+ \else
+ \expandafter\secondoftwoarguments
+ \fi}
\permanent\protected\tolerant\def\setmarking[#1]#:#2%
- {\ifconditional\inhibitsetmarking\else
- \doifelse{\namedmarkingparameter{#1}\c!expansion}\v!yes
- {\clf_setmarking{#1}{#2}}%
- {\clf_setmarking{#1}{\detokenize{#2}}}%
+ {\ifarguments\orelse\ifconditional\inhibitsetmarking\else
+ % so no: \dontleavehmode
+ \the\csname\??markingsyncs#1\endcsname
+ \ifcstok{\namedmarkingparameter{#1}\c!expansion}\v!yes
+ \normalexpanded{%
+ \ifvmode\expandafter\flushatnextpar\else\expandafter\firstofoneargument\fi
+ {\marks\csname\??markingclass#1\endcsname{#2}}%
+ }%
+ \else
+ \ifvmode\expandafter\flushatnextpar\else\expandafter\firstofoneargument\fi
+ {\marks\csname\??markingclass#1\endcsname{#2}}%
+ \fi
\fi}
\aliased\let\marking \setmarking
@@ -87,31 +161,103 @@
{}
\tolerant\def\strc_markings_get_yes[#1]#*[#2]#*[#3]%
- {\ifcstok{\namedmarkingparameter{#1}\c!state}\v!start
+ {\ifarguments\orelse\ifcstok{\namedmarkingparameter{#1}\c!state}\v!start
\begingroup
\setsystemmode\v!marking
\the\everymarking
\ifparameter#3\or
- \clf_getmarking{#1}{#2}{#3}%
+ \ifcstok{#2}\v!page
+ \markingcommand{#1}{\csname\??markingfilter#3\endcsname{#1}}%
+ \else
+ \markingcommand{#1}{\clf_getsynchronizedmarking\begincsname\??markingclass#1\endcsname{#2}{#3}}%
+ \fi
+ \orelse\ifparameter#2\or
+ \markingcommand{#1}{\csname\??markingfilter#2\endcsname{#1}}%
\else
- \clf_getmarking{#1}{\v!page}{#2}%
+ \markingcommand{#1}{\csname\??markingfilter\v!default\endcsname{#1}}%
\fi
\endgroup
\fi}
+% previous : last before sync next : first after sync
+% top : first in sync bottom : last in sync
+% first|default : first not top in sync last : last not bottom in sync
+
+% current
+
+\defcsname\??markingfilter\v!previous\endcsname#1{\topmarks \csname\??markingclass#1\endcsname}
+\defcsname\??markingfilter\v!next \endcsname#1{\botmarks \csname\??markingclass#1\endcsname}
+
+%defcsname\??markingfilter\v!top \endcsname#1{\topmarks \csname\??markingclass#1\endcsname}
+\defcsname\??markingfilter\v!top \endcsname#1{\firstmarks \csname\??markingclass#1\endcsname}
+\defcsname\??markingfilter\v!bottom \endcsname#1{\botmarks \csname\??markingclass#1\endcsname}
+
+\defcsname\??markingfilter\v!first \endcsname#1{\firstmarks \csname\??markingclass#1\endcsname}
+\defcsname\??markingfilter\v!last \endcsname#1{\botmarks \csname\??markingclass#1\endcsname}
+
+\defcsname\??markingfilter\v!current \endcsname#1{\currentmarks\csname\??markingclass#1\endcsname}
+
+\letcsname\??markingfilter\v!default\expandafter\endcsname
+ \csname\??markingfilter\v!first \endcsname
+
% the fetchers are fully expandable: [name][method]
-\permanent\tolerant\def\fetchonemark[#1]#*[#2]{\ifconditional\inhibitgetmarking\else\clf_fetchonemark {#1}{\v!page}{#2}\fi}
-\permanent\tolerant\def\fetchtwomarks [#1]{\ifconditional\inhibitgetmarking\else\clf_fetchtwomarks{#1}{\v!page}\fi}
-\permanent\tolerant\def\fetchallmarks [#1]{\ifconditional\inhibitgetmarking\else\clf_fetchallmarks{#1}{\v!page}\fi}
+\def\strc_markings_fetch_one#1#2#3%
+ {\ifparameter#1\or
+ \ifconditional\inhibitgetmarking\else
+ \ifcstok{#2}\v!page
+ \markingcommand{#1}{\begincsname\??markingfilter#3\endcsname{#1}}%
+ \else
+ \markingcommand{#1}{\clf_getsynchronizedmarking{#1}{#2}}%
+ \fi
+ \fi
+ \fi}
+
+\def\strc_markings_fetch_two#1#2%
+ {\ifparameter#1\or
+ \ifconditional\inhibitgetmarking\else
+ \ifcstok{#2}\v!page
+ \markingcommand{#1}{\begincsname\??markingfilter\v!first\endcsname{#1}}%
+ \markingseparator{#1}%
+ \markingcommand{#1}{\begincsname\??markingfilter\v!last\endcsname{#1}}%
+ \else
+ \markingcommand{#1}{\clf_getsynchronizedmarking{#1}\v!first}%
+ \markingseparator{#1}%
+ \markingcommand{#1}{\clf_getsynchronizedmarking{#1}\v!last}%
+ \fi
+ \fi
+ \fi}
+
+\def\strc_markings_fetch_all#1#2%
+ {\ifparameter#1\or
+ \ifconditional\inhibitgetmarking\else
+ \ifcstok{#2}\v!page
+ \markingcommand{#1}{\begincsname\??markingfilter\v!previous\endcsname{#1}}%
+ \markingseparator{#1}%
+ \markingcommand{#1}{\begincsname\??markingfilter\v!first\endcsname{#1}}%
+ \markingseparator{#1}%
+ \markingcommand{#1}{\begincsname\??markingfilter\v!last\endcsname{#1}}%
+ \else
+ %\markingcommand{#1}{\begincsname\??markclass:\v!previous\endcsname{#1}}%
+ %\markingseparator{#1}%
+ \markingcommand{#1}{\clf_getsynchronizedmarking{#1}\v!first}%
+ \markingseparator{#1}%
+ \markingcommand{#1}{\clf_getsynchronizedmarking{#1}\v!last}%
+ \fi
+ \fi
+ \fi}
+
+\permanent\tolerant\def\fetchonemark [#1]#*[#2]{\strc_markings_fetch_one{#1}\v!page{#2}}
+\permanent\tolerant\def\fetchtwomarks [#1]{\strc_markings_fetch_two{#1}\v!page}
+\permanent\tolerant\def\fetchallmarks [#1]{\strc_markings_fetch_all{#1}\v!page}
\aliased\let\fetchmark\fetchonemark
% also fully expandable but here we have: [name][range][method]
-\permanent\tolerant\def\fetchonemarking[#1]#*[#2]#*[#3]{\ifconditional\inhibitgetmarking\else\clf_fetchonemark {#1}{#2}{#3}\fi}
-\permanent\tolerant\def\fetchtwomarkings [#1]#*[#2]{\ifconditional\inhibitgetmarking\else\clf_fetchtwomarks{#1}{#2}\fi}
-\permanent\tolerant\def\fetchallmarkings [#1]#*[#2]{\ifconditional\inhibitgetmarking\else\clf_fetchallmarks{#1}{#2}\fi}
+\permanent\tolerant\def\fetchonemarking [#1]#*[#2]#*[#3]{\strc_markings_fetch_one{#1}{#2}{#3}}
+\permanent\tolerant\def\fetchtwomarkings [#1]#*[#2]{\strc_markings_fetch_two{#1}{#2}}
+\permanent\tolerant\def\fetchallmarkings [#1]#*[#2]{\strc_markings_fetch_all{#1}{#2}}
\aliased\let\fetchmarking\fetchonemarking
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-mat.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-mat.mkxl
index 0b90eecba27..bcbe4a6f87f 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/strc-mat.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-mat.mkxl
@@ -32,6 +32,9 @@
%\c!margin=,
%\c!align=,
%\c!separator=,
+ % \c!splitmethod=\v!both, % first|last|both|<empty>
+ \c!snap=\v!no,
+ \c!snapstep=\v!medium,
\c!grid=\v!math,
\c!location=\v!right,
\c!left=(,
@@ -39,14 +42,16 @@
\c!expansion=\v!yes, % maybe automatically
\c!spacebefore=\v!big,
\c!spaceafter=\formulaparameter\c!spacebefore,
+ \c!spaceinbetween=\v!quarterline,
\c!width=\hsize,
\c!leftmargin=\zeropoint,
\c!rightmargin=\zeropoint,
\c!indentnext=\v!no,
\c!alternative=\s!default,
- \c!strut=\v!no,
+ \c!strut=\v!yes, % per 2022-04, was \v!no
\c!numberstrut=\v!yes, % \v!no \v!yes \v!always
- \c!distance=2\emwidth]
+ \c!numberthreshold=\emwidth,
+ \c!numberdistance=2\emwidth]
\setupformulaframed
[%c!location=<auto set>,
@@ -54,18 +59,7 @@
%c!align=<auto set>,
\c!offset=.5\exheight]
-\ifdefined\matheqnogapstep
- % we're ok, now we have that quad in the distance which is
- % more consistent and not depending on the text font in math
- \matheqnogapstep\zerocount
-\else
- % we will keep this for a while
- \setupformulas[\c!distance=\emwidth]
-\fi
-
-% \ifdefined\mathdisplayskipmode
-% \mathdisplayskipmode\plustwo % only when not zero / needs adapted space handler
-% \fi
+\matheqnogapstep\zerocount % we no longer need this as we don't use displaymode
% \mathdisplayskipmode\plusthree
%
@@ -144,18 +138,18 @@
\definelist[\v!formula]
-\permanent\defcsname\e!start\v!formula\endcsname{\strc_formulas_start_formula{}}
-\permanent\defcsname\e!stop \v!formula\endcsname{\strc_formulas_stop_formula}
+\permanent\protected\defcsname\e!start\v!formula\endcsname{\strc_formulas_start_formula{}}
+\permanent\protected\defcsname\e!stop \v!formula\endcsname{\strc_formulas_stop_formula}
\let\strc_formulas_start_formula\relax % defined later
\let\strc_formulas_stop_formula \relax % defined later
\permanent\tolerant\protected\def\defineformulaalternative[#1]#*[#2]#*[#3]%
- {\frozen\instance\defcsname\e!start#1\v!formula\endcsname{#2}%
- \frozen\instance\defcsname\e!stop #1\v!formula\endcsname{#3}}
+ {\frozen\instance\protected\defcsname\e!start#1\v!formula\endcsname{#2}%
+ \frozen\instance\protected\defcsname\e!stop #1\v!formula\endcsname{#3}}
-% sp = single line paragraph sd = single line display
-% mp = multi line paragraph md = multy line display
+% sp = single line paragraph sd = single line display
+% mp = multi line paragraph md = multi line display
\defineformulaalternative[\s!default][\startdisplaymath][\stopdisplaymath]
\defineformulaalternative[\s!single] [\startdisplaymath][\stopdisplaymath]
@@ -188,22 +182,25 @@
\newtoks\everyresetformulas
\appendtoks
- \let\currentformula\empty % to be checked:
+ \lettonothing\currentformula % to be checked:
\to \everyresetformulas
% implementation
-\protected\def\strc_formulas_store_number#1#2#3#4#5% ref, todo:str, \sync % todo: title etc (like float)
+\protected\def\strc_formulas_store_number#1#2#3#4#5#6% ref, todo:str, \sync % todo: title etc (like float)
{\settrue\c_strc_formulas_handle_number
\strc_counters_register_component
{formula}%
\setupcurrentformula \formulaparameter \detokenizedformulaparameter
\relax \relax \relax
[\c!name=\v!formula,\s!counter=\v!formula,%
- \s!hascaption=\v!yes,\s!hastitle=\v!yes,\s!hasnumber=\v!yes,%\s!haslevel=#6,%
- \c!reference=#1,\c!title=\namedformulaentry,\c!bookmark=]%
+ \s!hascaption=\v!yes,\s!hastitle=\v!yes,\s!hasnumber=\v!yes,\s!haslevel=#6,%
+ \c!reference=#1,%
+ \c!title=\namedformulaentry,
+ \c!list=\currentplaceformulalist,
+ \c!bookmark=\currentplaceformulabookmark]%
[#2]%
- \glet\namedformulaentry\empty % \relax
+ \glettonothing\namedformulaentry % \relax
\glet#3\m_strc_counters_last_registered_index
\glet#4\m_strc_counters_last_registered_synchronize
\glet#5\m_strc_counters_last_registered_attribute}
@@ -215,6 +212,66 @@
\newconstant\c_strc_formulas_sub_number_mode
\newconstant\c_strc_formulas_nested_number_mode
+\let\strc_formulas_show_modes \relax
+\let\strc_formulas_show_references\relax
+
+\installtextracker
+ {math.numbering}
+ {\let\strc_formulas_show_modes \strc_formulas_show_modes_indeed
+ \let\strc_formulas_show_references\strc_formulas_show_references_indeed}
+ {\let\strc_formulas_show_modes \relax
+ \let\strc_formulas_show_references\relax}
+
+\def\strc_formulas_mode_row#1#2#3#4%
+ {\NC #1%
+ \NC \ifcase#2\relax unset\or forced\or none\or reference\fi
+ \NC #3%
+ \NC #4%
+ \NC \NR}
+
+\protected\def\strc_formulas_show_modes_indeed
+ {\rlap{\enspace\vcenter to \zeropoint{\vss\ruledvcenter{%
+ \forgetall\smallinfofont\setupinterlinespace
+ \starttabulate[|l|l|l|l|]
+ \strc_formulas_mode_row{place} \c_strc_formulas_place_number_mode \currentplaceformulareference \currentplaceformulasuffix
+ \strc_formulas_mode_row{main} \c_strc_formulas_number_mode \currentformulareference \currentformulasuffix
+ \strc_formulas_mode_row{sub} \c_strc_formulas_sub_number_mode \currentsubformulareference \currentsubformulasuffix
+ \strc_formulas_mode_row{nested} \c_strc_formulas_nested_number_mode \currentnestedformulareference \currentnestedformulasuffix
+ \stoptabulate
+ \vss}}}}
+
+\protected\def\strc_formulas_show_references_indeed
+ {\llap{\vcenter to \zeropoint{\vss\ruledvcenter{%
+ \forgetall\smallinfofont\setupinterlinespace
+ \starttabulate[|l|l|l|l|]
+ \NC place\NC
+ \ifnum\c_strc_formulas_place_number_mode=\plusthree
+ \ifconditional\c_strc_formulas_referenced
+ \textminus
+ \else
+ \textplus
+ \fi
+ \else
+ \textminus
+ \fi
+ \NC \NR
+ \NC formulas\NC
+ \ifnum\c_strc_formulas_number_mode=\plusthree
+ \textplus
+ \else
+ \textminus
+ \fi
+ \NC \NR
+ \NC nested\NC
+ \ifnum\c_strc_formulas_nested_number_mode=\plusthree
+ \textplus
+ \else
+ \textminus
+ \fi
+ \NC \NR
+ \stoptabulate
+ \vss}}}\enspace}
+
\appendtoks
\c_strc_formulas_place_number_mode \zerocount
\c_strc_formulas_number_mode \zerocount
@@ -227,6 +284,8 @@
\newconditional\c_strc_formulas_inside_place_sub
\newconditional\c_strc_formulas_inside_formulas
\newconditional\c_strc_formulas_inside_formulas_sub
+\newconditional\c_strc_formulas_incremented
+\newconditional\c_strc_formulas_referenced
\appendtoks
\global\setfalse\c_strc_formulas_inside_place
@@ -257,7 +316,8 @@
\empty
\currentsubformulasnumber
\currentsubformulassynchronize
- \currentsubformulasattribute}
+ \currentsubformulasattribute
+ \plustwo}
\def\strc_formulas_handle_sub_number % sub formulas
{\iftrialtypesetting
@@ -275,8 +335,9 @@
{\begingroup
\rm % determines the distance and main font
\edef\p_location{\formulaparameter\c!location}%
+ \strc_formulas_show_references
\ifx\p_location\v!right
- \hskip\formulaparameter\c!distance
+ \strc_formulas_add_distance\plusone\v!left\formulaparameter
\fi
\begingroup
\useformulastyleandcolor\c!numberstyle\c!numbercolor
@@ -295,14 +356,17 @@
\formulaparameter\c!right}%
\endgroup
\ifx\p_location\v!left
- \hskip\formulaparameter\c!distance
+ \strc_formulas_add_distance\plusone\v!right\formulaparameter
\fi
+ \strc_formulas_show_modes
\endgroup}
\protected\def\strc_formulas_place_current_number
{\ifempty\namedformulaentry
+ \begingroup
\strc_formulas_handle_current_references
\labeltexts\currentformula{\convertedcounter[\v!formula][]}%
+ \endgroup
\else
\expandafter % hm, the next one reset \namedformulaentry
\strc_formulas_handle_current_references
@@ -325,30 +389,30 @@
\mutable\let\currentsubformulanumber \relax
\mutable\let\currentformulasnumber \relax
-\mutable\let\currentformulasreference \empty
-\mutable\let\currentformulareference \empty
-\mutable\let\currentsubformulareference \empty
-\mutable\let\currentnestedformulanumber \empty
-\mutable\let\currentnestedformulareference\empty
-\mutable\let\currentnestedformulaattribute\empty
+\mutable\lettonothing\currentformulasreference
+\mutable\lettonothing\currentformulareference
+\mutable\lettonothing\currentsubformulareference
+\mutable\lettonothing\currentnestedformulanumber
+\mutable\lettonothing\currentnestedformulareference
+\mutable\lettonothing\currentnestedformulaattribute
\appendtoks
- \glet\currentformulasreference \empty
- \glet\currentformulareference \empty
- \glet\currentsubformulareference \empty
- \glet\currentnestedformulareference\empty
+ \glettonothing\currentformulasreference
+ \glettonothing\currentformulareference
+ \glettonothing\currentsubformulareference
+ \glettonothing\currentnestedformulareference
\to \everyresetformulas
-\mutable\let\currentformulassuffix \empty
-\mutable\let\currentformulasuffix \empty
-\mutable\let\currentsubformulasuffix \empty
-\mutable\let\currentnestedformulasuffix\empty
+\mutable\lettonothing\currentformulassuffix
+\mutable\lettonothing\currentformulasuffix
+\mutable\lettonothing\currentsubformulasuffix
+\mutable\lettonothing\currentnestedformulasuffix
\appendtoks
- \glet\currentformulassuffix \empty
- \glet\currentformulasuffix \empty
- \glet\currentsubformulasuffix \empty
- \glet\currentnestedformulasuffix\empty
+ \glettonothing\currentformulassuffix
+ \glettonothing\currentformulasuffix
+ \glettonothing\currentsubformulasuffix
+ \glettonothing\currentnestedformulasuffix
\to \everyresetformulas
\mutable\let\currentplaceformulasynchronize \relax
@@ -363,25 +427,28 @@
\glet\currentnestedformulasynchronize\relax
\to \everyresetformulas
-\mutable\let\currentsubformulasattribute \empty
-\mutable\let\currentsubformulasnumber \empty
-\mutable\let\currentsubformulasreference \empty
-\mutable\let\currentsubformulassynchronize\empty
-
-% currently we do the number, some day we will do the (sub) formula
+\mutable\lettonothing\currentsubformulasattribute
+\mutable\lettonothing\currentsubformulasnumber
+\mutable\lettonothing\currentsubformulasreference
+\mutable\lettonothing\currentsubformulassynchronize
\def\strc_formulas_handle_current_references
{\strc_formulas_reference_show
\ifnum\c_strc_formulas_place_number_mode=\plusthree
- \strc_formulas_store_number
- \currentplaceformulareference
- \empty
- \currentplaceformulanumber
+ \ifconditional\c_strc_formulas_referenced
+ \else
+ \strc_formulas_store_number
+ \currentplaceformulareference
+ \empty
+ \currentplaceformulanumber
+ \currentplaceformulasynchronize
+ \currentplaceformulaattribute
+ \plusone
\currentplaceformulasynchronize
- \currentplaceformulaattribute
- \currentplaceformulasynchronize
- \glet\currentplaceformulasynchronize\relax
- \theformuladestinationattribute\currentplaceformulaattribute
+ \glet\currentplaceformulasynchronize\relax
+ \theformuladestinationattribute\currentplaceformulaattribute
+ \global\settrue\c_strc_formulas_referenced
+ \fi
\fi
\ifnum\c_strc_formulas_number_mode=\plusthree
\strc_formulas_store_number
@@ -390,6 +457,7 @@
\currentformulasnumber
\currentformulassynchronize
\currentformulasattribute
+ \plustwo
\currentformulassynchronize
\glet\currentformulassynchronize\relax
\theformuladestinationattribute\currentformulasattribute
@@ -405,18 +473,53 @@
\currentnestedformulanumber
\currentnestedformulasynchronize
\currentnestedformulaattribute
+ \plustwo
\currentnestedformulasynchronize
\glet\currentnestedformulasynchronize\relax
\theformuladestinationattribute\currentnestedformulaattribute
\fi}
-% needs checking ... too many:
+% \def\strc_formulas_handle_numbering_indeed
+% {\ifempty\namedformulaentry
+% \doifelsetext\currentnestedformulasuffix
+% {\strc_counters_increment\v!formula
+% \ifcstok{+}\currentnestedformulasuffix
+% \strc_counters_increment_sub\v!formula\plustwo
+% \else
+% \strc_counters_setown_sub\v!formula\plustwo\currentnestedformulasuffix
+% \fi}%
+% {\ifempty\currentplaceformulasuffix\else
+% \let\currentnestedformulasuffix \currentplaceformulasuffix
+% \let\currentnestedformulareference\currentplaceformulareference
+% \strc_formulas_place_number_nested_check
+% \fi
+% \strc_counters_increment\v!formula}%
+% \fi
+% \glettonothing\currentplaceformulasuffix
+% \glettonothing\currentnestedformulasuffix
+% \placecurrentformulanumber}
\def\strc_formulas_handle_numbering_indeed
{\ifempty\namedformulaentry
- \strc_counters_increment\v!formula
- \doiftext\currentplaceformulasuffix{\strc_counters_setown_sub\v!formula\plustwo\currentplaceformulasuffix}%
+ \doifelsetext\currentnestedformulasuffix
+ {\ifconditional\c_strc_formulas_incremented\else
+ \strc_counters_increment\v!formula
+ \fi
+ \global\settrue\c_strc_formulas_incremented
+ \ifcstok{+}\currentnestedformulasuffix
+ \strc_counters_increment_sub\v!formula\plustwo
+ \else
+ \strc_counters_setown_sub\v!formula\plustwo\currentnestedformulasuffix
+ \fi}%
+ {\ifempty\currentplaceformulasuffix\else
+ \let\currentnestedformulasuffix \currentplaceformulasuffix
+ \let\currentnestedformulareference\currentplaceformulareference
+ \strc_formulas_place_number_nested_check
+ \fi
+ \strc_counters_increment\v!formula}%
\fi
+ \glettonothing\currentplaceformulasuffix
+ \glettonothing\currentnestedformulasuffix
\placecurrentformulanumber}
\def\strc_formulas_handle_numbering
@@ -430,9 +533,11 @@
\def\strc_formulas_handle_sub_numbering_indeed
{\let\strc_formulas_handle_sub_numbering\relax % else error: see math/numbering-001.tex
- \doifelsetext\currentsubformulasuffix
- {\strc_counters_setown_sub\v!formula\plustwo\currentsubformulasuffix}
+ \doifelsetext\currentnestedformulasuffix
+ {\strc_counters_setown_sub\v!formula\plustwo\currentnestedformulasuffix}%
{\strc_counters_increment_sub\v!formula\plustwo}%
+ \glettonothing\currentplaceformulasuffix
+ \glettonothing\currentnestedformulasuffix
\placecurrentformulanumber}
\def\strc_formulas_handle_sub_numbering
@@ -497,27 +602,21 @@
%D
%D \starttyping
%D \displaylines
-%D \eqalignno
-%D \eqalignno
%D \stoptyping
%D
%D Otherwise we get a missing \type {$$} error reported.
\pushoverloadmode
-\aliased\let\reqno\eqno % no longer valid as we just nil it
-
-\aliased\let\math_native_leqno\leqno
-\aliased\let\math_native_reqno\reqno
-
-\permanent\protected\def\normaleqno#1{\writestatus\m!system{no native (l)eqno equation number support}}
+ \permanent\protected\def\normaleqno#1{\writestatus\m!system{no native (l/r)eqno equation number support}}
-\aliased\let\normalleqno\normaleqno
-\aliased\let\normalreqno\normaleqno
+ \aliased\let\normalleqno\normaleqno
+ \aliased\let\normalreqno\normaleqno
+ \aliased\let\normaleqno \normaleqno
-\aliased\let\leqno\normaleqno
-\aliased\let\reqno\normaleqno
-\aliased\let\eqno \normaleqno
+ \aliased\let\leqno \normaleqno
+ \aliased\let\reqno \normaleqno
+ \aliased\let\eqno \normaleqno
\popoverloadmode
@@ -553,104 +652,53 @@
% \predisplaygapfactor \zerocount % default is 2000
-\protected\def\strc_formulas_forget_display_skips
- {\mathdisplayskipmode \plusthree
- \abovedisplayskip \zeropoint
- \belowdisplayskip \zeropoint
- \abovedisplayshortskip\zeropoint
- \belowdisplayshortskip\zeropoint}
+%D We no longer need to do this every time as we don't use display mode
+%D at all, so:
-\newdimen\d_strc_formulas_display_skip_left
-\newdimen\d_strc_formulas_display_skip_right
-\newdimen\d_strc_formulas_display_margin_left
-\newdimen\d_strc_formulas_display_margin_right
-\newdimen\d_strc_formulas_display_pre_threshold
-\newdimen\d_strc_formulas_display_width
+% \protected\def\strc_formulas_forget_display_skips
+% {\mathdisplayskipmode \plusthree
+% \abovedisplayskip \zeropoint
+% \belowdisplayskip \zeropoint
+% \abovedisplayshortskip\zeropoint
+% \belowdisplayshortskip\zeropoint}
-\newconstant\c_strc_formulas_mode % this will go away
-\newconstant\c_strc_formulas_space_model
+%D Became this, where setting the mode is now also irrelevant but the engine still
+%D has it, so:
-\newconstant\c_strc_math_vertical % experiment
+\mathdisplayskipmode \plusthree
+\abovedisplayskip \zeropoint
+\belowdisplayskip \zeropoint
+\abovedisplayshortskip\zeropoint
+\belowdisplayshortskip\zeropoint
-\c_strc_formulas_mode \plustwo % 0=native 1=simple (old) 2=align (new)
-\c_strc_formulas_space_model\plusthree % replaces \plusone, we might use \plusfour in the future
+\newdimension\d_strc_formulas_display_width
-\newconditional\c_strc_formulas_tight
-
-\newbox\b_strc_formulas_number
-\newbox\b_strc_formulas_content
-
-\def\strc_formulas_flush_content_and_number
- {\noindentation
- % \dontleavehmode
- \kern\d_strc_formulas_display_margin_left
- \ifcase\wd\b_strc_formulas_number
- \hbox to \displaywidth \bgroup
- \hfill
- \box\b_strc_formulas_content
- \hfill
- \egroup
- \orelse\ifdim\dimexpr\wd\b_strc_formulas_content+\wd\b_strc_formulas_number\relax>\displaywidth
- \vbox \bgroup
- \hsize\displaywidth
- \box\b_strc_formulas_content
- \par
- \ifx\p_location\v!left
- \box\b_strc_formulas_number\hfill
- \else
- \hfill\box\b_strc_formulas_number
- \fi
- \egroup
- \else
- \hbox to \displaywidth \bgroup
- \ifx\p_location\v!left
- \rlap{\box\b_strc_formulas_number}%
- \hfill\box\b_strc_formulas_content\hfill
- \else
- \hfill\box\b_strc_formulas_content\hfill
- \llap{\box\b_strc_formulas_number}%
- \fi
- \egroup
- \fi}
-
-\installcorenamespace{mathdisplayspacemodel}
+%D In \LMTX\ we have three ways of rendering formulas:
+%D
+%D \startitemize
+%D \startitem line: a single boxed line \stopitem
+%D \startitem text: multiple boxed lines \stopitem
+%D \startitem page: multiple unboxed lines \stopitem
+%D \stopitemize
+%D
+%D So, yes has become text
-\setvalue{\??mathdisplayspacemodel\v!before:1}% old
- {\ifx\p_spacebefore\v!none
- % nothing
- \else
- \directvspacing\p_spacebefore
- \fi}
+\newconstant\c_strc_math_split_mode
-\setvalue{\??mathdisplayspacemodel\v!after:1}% old
- {\prevdepth .5\strutdp
- \edef\p_spaceafter{\formulaparameter\c!spaceafter}%
- \ifx\p_spaceafter\v!none
- % nothing
- \else
- \directvspacing\p_spaceafter
- \fi}
+\mutable\lettonothing\m_strc_math_split
-\setvalue{\??mathdisplayspacemodel\v!before:2}% old
- {\ifx\p_spacebefore\v!none
- % nothing
- \else
- \directvspacing\p_spacebefore
- \fi
- \prevdepth-\maxdimen} % texbook pagina 79-80
+\aliased\let\c_strc_math_line_mode\zerocount
+\aliased\let\c_strc_math_flow_mode\plusone
+\aliased\let\c_strc_math_wrap_mode\plusthree
-\setvalue{\??mathdisplayspacemodel\v!after:2}% old
- {\prevdepth\lineheight
- \edef\p_spaceafter{\formulaparameter\c!spaceafter}%
- \ifx\p_spaceafter\v!none
- % nothing
- \else
- \directvspacing\p_spaceafter
- \fi}
+\newconditional\c_strc_formulas_tight
+\newconditional\c_strc_formulas_packed
+\newconditional\c_strc_formulas_depth
+\newbox \b_strc_formulas_number
-\setvalue{\??mathdisplayspacemodel\v!before:3}%
+\def\strc_formulas_display_space_before_normal
{% not ok, try \stopformula\par\startformula vs \stopformula\startformula
- \let\m_spacebefore\empty
+ \lettonothing\m_spacebefore
\ifvmode
\ifdim\lastskip>\zeropoint\else
\ifdim\prevdepth<\zeropoint\else
@@ -672,7 +720,7 @@
\orelse\ifempty\p_spacebefore
\directvspacing\currentvspacing
\else
- \directvspacing{\p_spacebefore,\the\scratchdimen}%
+ \directvspacing\p_spacebefore
\fi
\else
\ifx\p_spacebefore\v!none
@@ -684,9 +732,8 @@
\fi
\fi}
-\setvalue{\??mathdisplayspacemodel\v!after:3}%
- {\prevdepth\strutdp % \directvspacing\v!depth
- \ifx\p_spaceafter\v!none
+\def\strc_formulas_display_space_after_common
+ {\ifx\p_spaceafter\v!none
% nothing
\orelse\ifempty\p_spaceafter
\directvspacing\currentvspacing
@@ -694,15 +741,17 @@
\directvspacing\p_spaceafter
\fi}
-\newconditional\c_math_model_four_indeed
+\def\strc_formulas_display_space_after_normal
+ {\prevdepth\strutdp % \directvspacing\v!depth
+ \strc_formulas_display_space_after_common}
-\setvalue{\??mathdisplayspacemodel\v!before:4}%
+\def\strc_formulas_display_space_before_depth
{% not ok, try \stopformula\par\startformula vs \stopformula\startformula
\ifvmode
\ifinner
- \csname\??mathdisplayspacemodel\v!before:3\endcsname
+ \strc_formulas_display_space_before_normal
+ \setfalse\c_strc_formulas_depth
\else
- \settrue\c_math_model_four_indeed
\forcestrutdepth
\nointerlineskip
\ifx\p_spacebefore\v!none
@@ -710,31 +759,33 @@
\orelse\ifempty\p_spacebefore
\directvspacing\currentvspacing
\else
- \directvspacing{\p_spacebefore,\the\scratchdimen}%
+ \directvspacing\p_spacebefore
\fi
\fi
- \else
- \csname\??mathdisplayspacemodel\v!before:3\endcsname
- \fi}
+ \else
+ \strc_formulas_display_space_before_normal
+ \fi}
-\setvalue{\??mathdisplayspacemodel\v!after:4}%
- {\ifconditional\c_math_model_four_indeed
- \setfalse\c_math_model_four_indeed
+\def\strc_formulas_display_space_after_depth
+ {\ifconditional\c_strc_formulas_depth
\forcestrutdepth
+ \strc_formulas_display_space_after_common
\else
- \prevdepth\strutdp % \directvspacing\v!depth
- \fi
- \ifx\p_spaceafter\v!none
- % nothing
- \orelse\ifempty\p_spaceafter
- \directvspacing\currentvspacing
+ \strc_formulas_display_space_after_depth_normal
+ \fi}
+
+\def\strc_formulas_display_space_before
+ {\ifconditional\c_strc_formulas_depth
+ \strc_formulas_display_space_before_depth
\else
- \directvspacing\p_spaceafter
+ \strc_formulas_display_space_before_normal
\fi}
-\permanent\protected\def\setdisplaymathspacemodel[#1]%
- {\ifcsname\??mathdisplayspacemodel\v!before:\number#1\endcsname
- \c_strc_formulas_space_model#1\relax
+\def\strc_formulas_display_space_after
+ {\ifconditional\c_strc_formulas_depth
+ \strc_formulas_display_space_after_depth
+ \else
+ \strc_formulas_display_space_after_normal
\fi}
% \newtoks\everybeforedisplay
@@ -745,8 +796,13 @@
\par
\fi
\ifvmode
- \edef\p_spacebefore{\formulaparameter\c!spacebefore}%
- \begincsname\??mathdisplayspacemodel\v!before:\number\c_strc_formulas_space_model\endcsname
+ \ifconditional\c_strc_formulas_packed
+ \lettonothing\p_spacebefore
+ \else
+ \edef\p_spacebefore{\formulaparameter\c!spacebefore}%
+ \fi
+ % \begincsname\??mathdisplayspacemodel\v!before:\number\c_strc_formulas_space_model\endcsname
+ \strc_formulas_display_space_before
\fi
\ifhmode
\par
@@ -758,38 +814,24 @@
\par
\fi
\ifvmode
- \edef\p_spaceafter{\formulaparameter\c!spaceafter}%
- \begincsname\??mathdisplayspacemodel\v!after:\number\c_strc_formulas_space_model\endcsname
+ \ifconditional\c_strc_formulas_packed
+ \lettonothing\p_spaceafter
+ \else
+ \edef\p_spaceafter{\formulaparameter\c!spaceafter}%
+ \fi
+ % \begincsname\??mathdisplayspacemodel\v!after:\number\c_strc_formulas_space_model\endcsname
+ \strc_formulas_display_space_after
\fi
\ifhmode
\par
\fi}
-\permanent\protected\def\setdisplaydimensions
- {\displayindent\dimexpr
- \d_strc_formulas_display_skip_left
- +\d_strc_formulas_display_margin_left
- \relax
- \displaywidth\d_strc_formulas_display_width
- %\setlocalhsize
- %\displaywidth\localhsize
- \ifdim\hangindent>\zeropoint
- \advance\displayindent\hangindent
- \else
- \advance\displaywidth\hangindent
- \fi
- \advance\displaywidth\dimexpr
- -\displayindent
- -\d_strc_formulas_display_skip_right
- -\d_strc_formulas_display_margin_right
- \relax
- \hsize\displaywidth} % new, else overfull in itemize
-
-\protected\def\strc_formulas_start_formula#1%
- {\dodoubleempty\strc_formulas_start_formula_indeed[#1]}
+\ifdefined\setdisplaydimensions \else
+ \let\setdisplaydimensions\relax % this one will be defined in math-ali
+\fi
-% \newskip\formulastrutht
-% \newskip\formulastrutdp
+% \newgluespec\formulastrutht
+% \newgluespec\formulastrutdp
%D \startbuffer
%D \startformula[9pt] x = 1 \stopformula
@@ -798,35 +840,76 @@
%D
%D \typebuffer \getbuffer
-\setvalue{\??formulaoption\v!packed}%
- {\c_strc_formulas_space_model\zerocount}
+%D Some tracing of distances and thresholds:
-\setvalue{\??formulaoption\v!tight}%
+\def\strc_formulas_add_distance_normal#1#2#3% maybe a skip with stretch/shrink
+ {\kern#3\c!numberdistance\relax}
+
+\def\strc_formulas_add_distance_traced#1#2#3%
+ {\begingroup
+ \scratchdimenone #3\c!numberdistance\relax
+ \scratchdimentwo \ifconditional\c_strc_formulas_tight\formulaparameter\c!numberthreshold\else\zeropoint\fi\relax
+ \scratchdimenthree.5\exheight
+ \ifcase\scratchdimentwo\else\ifx#2\v!left
+ \middlered
+ \kern-\scratchdimentwo
+ \vrule
+ \s!height\scratchdimenthree
+ \s!depth \scratchdimenthree
+ \s!width \scratchdimentwo
+ \fi\fi
+ \ifcase\scratchdimenone\else
+ \ifcase#1\or\middlegreen\else\middleblue\fi
+ \vrule
+ \s!height\scratchdimenthree
+ \s!depth \scratchdimenthree
+ \s!width \scratchdimenone
+ \fi
+ \ifcase\scratchdimentwo\else\ifx#2\v!right
+ \middlered
+ \vrule
+ \s!height\scratchdimenthree
+ \s!depth \scratchdimenthree
+ \s!width \scratchdimentwo
+ \kern-\scratchdimentwo
+ \fi\fi
+ \endgroup}
+
+\installtextracker
+ {math.numberdistance}
+ {\let\strc_formulas_add_distance\strc_formulas_add_distance_traced}
+ {\let\strc_formulas_add_distance\strc_formulas_add_distance_normal}
+
+\let\strc_formulas_add_distance \strc_formulas_add_distance_normal
+
+\defcsname\??formulaoption\v!packed\endcsname
+ {\settrue\c_strc_formulas_packed}
+
+\defcsname\??formulaoption\v!tight\endcsname
{\settrue\c_strc_formulas_tight}
-\setvalue{\??formulaoption\v!middle}%
- {\d_strc_formulas_display_skip_left \zeropoint
- \d_strc_formulas_display_skip_right\zeropoint}
+\defcsname\??formulaoption\v!middle\endcsname
+ {}
-\setvalue{\??formulaoption\v!depth}%
- {\c_strc_formulas_space_model\plusfour}
+\defcsname\??formulaoption\v!depth\endcsname
+ {\settrue\c_strc_formulas_depth}
-\setvalue{\??formulaoption\v!line}%
+\defcsname\??formulaoption\v!line\endcsname
{\ifgridsnapping
\setformulaparameter\c!grid{\v!math:\v!line}%
\fi}
-\setvalue{\??formulaoption\v!halfline}%
+\defcsname\??formulaoption\v!halfline\endcsname
{\ifgridsnapping
\setformulaparameter\c!grid{\v!math:\v!halfline}%
\fi}
-\setvalue{\??formulaoption-\v!line}%
+\defcsname\??formulaoption-\v!line\endcsname
{\ifgridsnapping
\setformulaparameter\c!grid{\v!math:-\v!line}%
\fi}
-\setvalue{\??formulaoption-\v!halfline}%
+\defcsname\??formulaoption-\v!halfline\endcsname
{\ifgridsnapping
\setformulaparameter\c!grid{\v!math:-\v!halfline}%
\fi}
@@ -836,92 +919,660 @@
% \prebinoppenalty -100
% \prerelpenalty -100
+% \placeformula[eq:a]
+% \startformula[split=text]
+% m(b-a)\leq\int_a^b f(x)\dd x\leq M(b-a).
+% \stopformula
+%
+% \placeformula[eq:b]
+% \startformula[split=line]
+% m(b-a)\leq\int_a^b f(x)\dd x\leq M(b-a).
+% \stopformula
+%
+% \placeformula[eq:c]
+% \startformula[split=line,numberlocation=overlay]
+% m(b-a)\leq\int_a^b f(x)\dd x\leq M(b-a).
+% \stopformula
+
\def\strc_math_set_split
- {\edef\p_split{\formulaparameter\c!split}%
- \ifx\p_split\v!yes
- \global\c_strc_math_vertical\plusone
- \orelse\ifx\p_split\v!page
- \global\c_strc_math_vertical\plustwo
+ {\edef\m_strc_math_split{\formulaparameter\c!split}%
+ \ifx\m_strc_math_split\v!line
+ \global\c_strc_math_split_mode\c_strc_math_line_mode
+ \orelse\ifx\m_strc_math_split\v!no
+ \global\c_strc_math_split_mode\c_strc_math_line_mode
+ \orelse\ifx\m_strc_math_split\v!box
+ \global\c_strc_math_split_mode\c_strc_math_wrap_mode
+ % \orelse\ifx\m_strc_math_split\v!page
+ % \global\c_strc_math_split_mode\c_strc_math_flow_mode
+ % \orelse\ifx\m_strc_math_split\v!text
+ % \global\c_strc_math_split_mode\c_strc_math_flow_mode
+ % \orelse\ifx\m_strc_math_split\v!yes
+ % \global\c_strc_math_split_mode\c_strc_math_flow_mode
+ % \orelse\ifx\m_strc_math_split\v!paragraph
+ % \global\c_strc_math_split_mode\c_strc_math_flow_mode
\else
- \global\c_strc_math_vertical\zerocount
+ \global\c_strc_math_split_mode\c_strc_math_flow_mode
\fi
- \ifcase\c_strc_math_vertical
- % \mathpenaltiesmode \zerocount
- \clf_setmathpenalties\zerocount
- \clf_resetmathhang
+ \mathpenaltiesmode\plusone
+ \ifnum\c_strc_math_split_mode=\c_strc_math_line_mode
+ \global\setfalse\c_strc_math_indent
\else
- % \mathpenaltiesmode \plusone
- \clf_setmathpenalties\plusone
- \edef\p_hang{\formulaparameter\c!hang}%
- \ifx\p_hang\v!none
- \global\setfalse\c_strc_math_indent
- \clf_resetmathhang
- \else
- \global\settrue\c_strc_math_indent
- \clf_setmathhang {%
- method {\p_hang}%
- distance \formulaparameter\c!distance
- }%
- \fi
+ \global\settrue\c_strc_math_indent % otherwise no breaks
+ \fi
+ \global\d_strc_math_indent\zeropoint}
+
+\def\strc_math_set_number_location
+ {\ifcstok{\formulaparameter\c!numberlocation}\v!overlay
+ \settrue\c_strc_formulas_overlay_number
+ \else
+ \setfalse\c_strc_formulas_overlay_number
+ \fi
+ \ifcstok{\formulaparameter\c!numbermethod}\v!down
+ \settrue\c_math_align_overflow_mode
+ \else
+ \setfalse\c_math_align_overflow_mode
\fi}
\setupformula
- [\c!split=\v!no,
- \c!distance=\zeropoint,
+% [\c!split=\v!no,
+ [\c!split=\v!text, % multi line no page breaks
+ \c!numberlocation=,
+ \c!textdistance=\zeropoint,
%\c!interlinespace=1.5\lineheight,
- \c!interlinespace=,
- \c!hang=\v!none]
+ \c!textmargin=2\emwidth,
+ \c!numbermethod=\v!down,
+ \c!interlinespace=]
% for the moment (when testing) we use a penalty 1
-\protected\def\strc_math_align_here{\ifmmode\penalty\plusone\fi}%
-\protected\def\strc_math_break_here{\ifmmode\hfill\break \fi}%
+%D Alignment in vertically rendered formulas using \type {\alignhere} and friends
+%D has been an experimental \MKIV\ features for quite a while but probably very few
+%D users were aware of it. It works quite well and little code is needed. With
+%D \LMTX\ defaulting to multiline display math it was time to add a couple of
+%D features and tracing. It can actually often replace math alignments and thereby
+%D not only save coding but also keep formulas as formulas instead of snippets.
+%D
+%D There can of course be more tricks applied but most already were rejected when I
+%D wrote the original version which is actually not that far from what we do now
+%D (like deeply burried align points). The main difference between the following
+%D variant and the \MKIV\ one is that we try to honour the new inter|-|atom spacing
+%D and adapt to the general alignment settings.
+
+\def\strc_math_pickup_again
+% {\mathatom \s!leftclass \mathendcode \s!rightclass \mathbegincode{}\noatomruling}
+ {\mathatom \s!class \mathbegincode{}\noatomruling}
+
+% maybe: \newboundary \c_strc_math_align_boundary
+
+\defineboundary[mathalign] % this one is also used at the lua end
+
+\newconditional\c_strc_math_trace_hang
+\newdimension \d_strc_math_hang_state
+
+\installtextracker
+ {math.autohang}
+ {\settrue\c_strc_math_trace_hang}
+ {\setfalse\c_strc_math_trace_hang}
+
+\newconditional\c_strc_math_aligned_here
+
+\def\strc_math_trace_okay#1#2%
+ {\mathghost{\llap{\backgroundline[#1]{\white\tttf#2}}}}
+
+\protected\def\strc_math_align_here
+ {\ifmmode
+ \global\settrue\c_strc_math_aligned_here
+ % we can have a more dedicated value, and also maybe store the class so that we can
+ % pick it up at the engine end (second pass)
+ \ifconditional\c_strc_math_trace_hang
+ \strc_math_trace_okay{darkred}{A}%
+ \fi
+ \boundary\c_bndr_mathalign
+ \fi}
+
+\tolerant\protected\def\strc_math_skip_here[#1]%
+ {% no strut as it will influence fences
+ \ifconditional\c_strc_math_trace_hang
+ \strc_math_trace_okay{darkblue}{S #1}%
+ \fi
+ \scratchdimen\dimexpr\formulaparameter\c!textmargin\relax
+ \ifchkdim#1\or
+ \d_strc_math_hang_state#1%
+ \orelse\ifchknum#1\or
+ \d_strc_math_hang_state#1\scratchdimen
+ \orelse\iftok{#1}{+}%
+ \advanceby\d_strc_math_hang_state\scratchdimen
+ \orelse\iftok{#1}{-}%
+ \advanceby\d_strc_math_hang_state-\scratchdimen
+ \else
+ \d_strc_math_hang_state\scratchdimen
+ \fi
+ \kern\d_strc_math_hang_state
+ \strc_math_pickup_again}
+
+% \blank[line] \ruledhbox{zzzz} \blank[line]
+%
+% xxxx \vadjust
+% depth check
+% depth after -\thousandpoint
+% {\blue xxxx +}
+% xxxx \vadjust
+% pre
+% {\red xxxx -}
+% xxxx
+%
+% \blank[line] \ruledhbox{zzzz} \blank[line]
+
+% \tolerant\protected\def\strc_math_text_here[#1]#:#*#=%
+% {\ifparameter#2\or
+% \ifnum\lastboundary=\c_math_begin_boundary\else
+% \ifcstok{#1}\v!right\else
+% \strc_math_break_here
+% \fi
+% \fi
+% \vadjust
+% \ifcstok{#1}\v!before
+% pre
+% \orelse\ifcstok{#1}\v!left
+% pre
+% baseline
+% depth before -\thousandpoint
+% \orelse\ifcstok{#1}\v!right
+% post
+% baseline
+% \fi
+% \bgroup
+% \hbox to \displaywidth \bgroup
+% \strut
+% \ifcstok{#1}\v!right
+% \hfill#2%
+% \else
+% #2\hss
+% \fi
+% \strut
+% \egroup
+% \egroup
+% \ifcstok{#1}\v!right
+% \strc_math_break_here
+% \else
+% % \mathatom class \mathexplicitcode{}%
+% \strc_math_pickup_again
+% \fi
+% \orelse\ifcstok{#1}\v!page
+% \strc_math_page_here
+% \orelse\ifcstok{#1}\v!samepage
+% \strc_math_same_here
+% \else
+% \strc_math_break_here
+% \fi}
+
+\definelocalboxes
+ [\v!lefttext]
+ [\c!command=\localmarginlefttext\zeropoint,
+ \c!repeat=\v!no,
+ \c!distance=\zeropoint,
+ \c!location=\v!middle]
+
+\definelocalboxes
+ [\v!righttext]
+ [\c!command=\localmarginrighttext\zeropoint,
+ \c!repeat=\v!no,
+ \c!distance=\zeropoint,
+ \c!location=\v!middle]
+
+\installcorenamespace{mathtexthere}
+\installcorenamespace{mathbreakhere}
+
+\def\strc_math_text_here_right#1%
+ {\localbox[\v!righttext]{\llap{#1}}}
+
+\def\strc_math_text_here_left#1%
+ {\localbox[\v!lefttext]{\rlap{#1}}}
+
+\def\strc_math_text_here_before#1%
+ {\vadjust pre \bgroup
+ \hbox to \displaywidth \bgroup
+ \strut
+ \hskip\leftskip
+ #1\hss
+ \hskip\rightskip
+ \strut
+ \egroup
+ \egroup}
+
+\def\strc_math_text_here_after#1%
+ {\vadjust \bgroup
+ \hbox to \displaywidth \bgroup
+ \strut
+ \hskip\leftskip
+ #1\hss
+ \hskip\rightskip
+ \strut
+ \egroup
+ \egroup}
+
+\letcsname\??mathtexthere\v!left \endcsname\strc_math_text_here_left
+\letcsname\??mathtexthere\v!right \endcsname\strc_math_text_here_right
+\letcsname\??mathtexthere\v!before\endcsname\strc_math_text_here_before
+\letcsname\??mathtexthere\v!after \endcsname\strc_math_text_here_after
+
+\defcsname\??mathbreakhere\v!left\endcsname#1%
+ {\ifnum\lastboundary=\c_math_begin_boundary\else
+ \strc_math_line_here
+ \fi
+ \strc_math_text_here_left{#1}%
+ \strc_math_pickup_again}
+
+\defcsname\??mathbreakhere\v!right\endcsname#1%
+ {\strc_math_text_here_right{#1}%
+ \strc_math_line_here
+ \strc_math_pickup_again}
+
+\defcsname\??mathbreakhere\v!before\endcsname#1%
+ {\ifnum\lastboundary=\c_math_begin_boundary\else
+ \strc_math_line_here
+ \fi
+ \strc_math_text_here_before{#1}%
+ \strc_math_pickup_again}
+
+\defcsname\??mathbreakhere\v!after\endcsname#1%
+ {\ifnum\lastboundary=\c_math_begin_boundary\else
+ \strc_math_line_here
+ \fi
+ \strc_math_text_here_after{#1}%
+ \strc_math_pickup_again}
+
+\tolerant\protected\def\strc_math_break_here[#1]#:#*#=%
+ {\ifparameter#2\or
+ \ifcsname\??mathbreakhere#1\endcsname
+ \expandafter\lastnamedcs
+ \else
+ \csname\??mathbreakhere\v!after\expandafter\endcsname
+ \fi{#2}%
+ \orelse\ifcstok{#1}\v!page
+ \strc_math_page_here
+ \orelse\ifcstok{#1}\v!samepage
+ \strc_math_same_here
+ \else
+ \strc_math_line_here
+ \fi}
+
+\tolerant\protected\def\strc_math_text_here[#1]#:#*#=%
+ {\ifparameter#2\or
+ \ifcsname\??mathtexthere#1\endcsname
+ \expandafter\lastnamedcs
+ \else
+ \csname\??mathtexthere\v!after\expandafter\endcsname
+ \fi{#2}%
+ \fi}
+
+\protected\def\strc_math_page_here
+ {\ifmmode
+ \ifconditional\c_strc_math_trace_hang
+ \strc_math_trace_okay{darkyellow}{B P}%
+ \fi
+ \break
+ \vadjust pre {\vfill\penalty-100000}%
+ \strc_math_pickup_again
+ \fi}
+
+\protected\def\strc_math_same_here
+ {\ifmmode
+ \ifconditional\c_strc_math_trace_hang
+ \strc_math_trace_okay{darkyellow}{B S}%
+ \fi
+ \break
+ \vadjust pre {\penalty\plustenthousand}%
+ \strc_math_pickup_again
+ \fi}
+
+\protected\def\strc_math_line_here
+ {\ifmmode
+ \ifconditional\c_strc_math_trace_hang
+ \strc_math_trace_okay{darkgreen}{B}%
+ \fi
+ \break
+ \strc_math_pickup_again
+ \fi}
\ifdefined\alignhere \else \aliased\let\alignhere\relax \fi
+\ifdefined\texthere \else \aliased\let\texthere \relax \fi
+\ifdefined\skiphere \else \aliased\let\skiphere \relax \fi
\ifdefined\breakhere \else \aliased\let\breakhere\relax \fi
-\appendtoks
+\appendtoks % must move to alignment
\enforced\let\alignhere\strc_math_align_here
\enforced\let\breakhere\strc_math_break_here
+ \enforced\let\skiphere \strc_math_skip_here
+ \enforced\let\texthere \strc_math_text_here
+ % \global\setfalse\c_strc_math_aligned_here
\to \everymathematics
-\protected\def\strc_formulas_start_formula_indeed[#1][#2]% setting leftskip adaption is slow !
- {\ifhmode
- \par
+\installcorenamespace{mathtextalign}
+
+\newconstant\c_strc_math_ragged_status
+\newconstant\c_strc_math_split_status
+
+\prependtoks
+ \c_strc_math_ragged_status\plustwo
+ \c_strc_math_split_status \zerocount
+\to \everymathematics
+
+\prependtoks
+ % we need to keep an eye on this
+ \mathgluemode\ifcase\raggedstatus\plusthree\else\zerocount\fi
+\to \everymathematics
+
+\defcsname\??mathtextalign\v!flushleft\endcsname
+ {\raggedright
+ \mathgluemode\plustwo
+ \c_strc_math_ragged_status\plusone
+ \updateparagraphproperties} % not needed
+
+\defcsname\??mathtextalign\v!middle\endcsname
+ {\raggedcenter
+ \mathgluemode\plustwo
+ \c_strc_math_ragged_status\plustwo
+ \updateparagraphproperties} % not needed
+
+\defcsname\??mathtextalign\v!flushright\endcsname
+ {\raggedleft
+ \mathgluemode\plustwo
+ \c_strc_math_ragged_status\plusthree
+ \updateparagraphproperties} % not needed
+
+\defcsname\??mathtextalign\v!slanted\endcsname
+ {\raggedslanted
+ %\mathgluemode\plustwo
+ \c_strc_math_ragged_status\plustwo
+ \ifcase\c_strc_math_number_location\or
+ \parinitleftskip\wd\b_strc_formulas_number % should normally fit
+ \else
+ \parfillrightskip\wd\b_strc_formulas_number % should normally fit
\fi
- \bgroup % HERE
- \iftrialtypesetting\else
- \global\advance\c_strc_formulas_n\plusone
+ \updateparagraphproperties} % not needed
+
+\def\strc_math_setup_align
+ {\ifcsname\??mathtextalign\formulaparameter\c!align\endcsname
+ \lastnamedcs\else\begincsname\??mathtextalign\v!middle\endcsname
+ \fi}
+
+\defcsname\??mathtextalign\v!flushleft:\v!auto\endcsname
+ {\raggedright
+ \mathgluemode\plustwo
+ \c_strc_math_ragged_status\plusone
+ \strc_math_analyze_box}
+
+\defcsname\??mathtextalign\v!middle:\v!auto\endcsname
+ {\raggedright
+ \mathgluemode\plustwo
+ \c_strc_math_ragged_status\plustwo
+ \strc_math_analyze_box}
+
+\defcsname\??mathtextalign\v!flushright:\v!auto\endcsname
+ {\raggedright
+ \mathgluemode\plustwo
+ \c_strc_math_ragged_status\plusthree
+ \strc_math_analyze_box}
+
+\defcsname\??mathtextalign\v!slanted:\v!auto\endcsname
+ {\raggedright
+ \mathgluemode\plustwo
+ \c_strc_math_ragged_status\plustwo
+ \strc_math_analyze_box}
+
+\def\strc_math_setup_align_auto
+ {\ifcsname\??mathtextalign\formulaparameter\c!align:\v!auto\endcsname
+ \lastnamedcs\else\begincsname\??mathtextalign\v!middle:\v!auto\endcsname
+ \fi}
+
+\letcsname\??mathtextalign\v!right \expandafter\endcsname\csname\??mathtextalign\v!flushleft \endcsname
+\letcsname\??mathtextalign\v!left \expandafter\endcsname\csname\??mathtextalign\v!flushright \endcsname
+\letcsname\??mathtextalign\v!right:\v!auto\expandafter\endcsname\csname\??mathtextalign\v!flushleft :\v!auto\endcsname
+\letcsname\??mathtextalign\v!left :\v!auto\expandafter\endcsname\csname\??mathtextalign\v!flushright:\v!auto\endcsname
+
+\startsetups[math:penalties:\v!text]
+ \interlinepenalty \plustenthousand
+ \shapingpenalty \plustenthousand
+\stopsetups
+
+% or (test):
+%
+% \startsetups[math:penalties:\v!text]
+% \shapingpenaltiesmode \zerocount
+% \interlinepenalty \plustenthousand
+% \stopsetups
+
+\startsetups[math:penalties:\v!page]
+ \shapingpenaltiesmode \zerocount
+ \widowpenalties \plusthree \plustenthousand \plustenthousand \zerocount
+ \clubpenalties \plusthree \plustenthousand \plustenthousand \zerocount
+\stopsetups
+
+\setupformula
+ [\c!penalties=math:penalties:\formulaparameter\c!split] % math:penalties:\m_strc_math_split
+
+\def\strc_math_setup_penalties
+ {\directsetup{\formulaparameter\c!penalties}}
+
+% a limitation is that this only works in a regular setting, so no shapes
+
+\appendtoks
+ \global\d_strc_math_indent \zeropoint
+ \global\c_strc_math_n_of_lines \zerocount
+ \global\d_strc_math_max_width \zeropoint
+ \global\d_strc_math_first_width \zeropoint
+ \global\d_strc_math_first_height\zeropoint
+ \global\d_strc_math_last_width \zeropoint
+ \global\d_strc_math_last_depth \zeropoint
+\to \everyresetformulas
+
+\newbox\b_strc_math_display % most code is in math-ali (for historical reasons)
+
+\newgluespec\s_strc_formulas_margin_left
+\newgluespec\s_strc_formulas_margin_right
+
+\def\strc_formulas_set_paragraph
+ {%\setlocalhsize
+ %\hsize\localhsize
+ %
+ \d_strc_formulas_display_width\formulaparameter\c!width\relax
+ \s_strc_formulas_margin_left \leftskip
+ \s_strc_formulas_margin_right\rightskip
+ \edef\p_margin{\formulaparameter\c!leftmargin}%
+ \ifempty\p_margin \else
+ \doadaptleftskip\p_margin
\fi
- \def\currentformula{#1}%
- \strc_math_set_split
- \dostarttaggedchained\t!formula\currentformula\??formula
- \setfalse\c_strc_formulas_tight
- \d_strc_formulas_display_skip_left \leftskip
- \d_strc_formulas_display_skip_right \rightskip
- \d_strc_formulas_display_width \formulaparameter\c!width\relax
- \d_strc_formulas_display_margin_left \formulaparameter\c!leftmargin\relax
- \d_strc_formulas_display_margin_right\formulaparameter\c!rightmargin\relax
- \iftok{#2}\emptytoks
+ \edef\p_margin{\formulaparameter\c!rightmargin}%
+ \ifempty\p_margin \else
+ \doadaptrightskip\p_margin
+ \fi
+ \edef\p_margin{\formulaparameter\c!margin}%
+ \ifempty\p_margin \else
+ \doadaptleftskip\p_margin
+ \doadaptrightskip\p_margin
+ \fi
+ %
+ \global\setfalse\c_strc_math_aligned_here
+ \hsize\d_strc_formulas_display_width
+ \displaywidth\hsize
+ \displayindent\zeropoint}
+
+% \def\strc_math_analyze_box
+% {\clf_handlemathhang
+% stage \plusone
+% alignstate \c_strc_math_ragged_status
+% box \b_strc_math_display
+% distance \formulaparameter\c!textdistance
+% \relax
+% %\holdingmigrations\zerocount
+% \setbox\b_strc_math_display\vbox\bgroup % \vtop
+% \ifnum\c_strc_math_split_mode=\c_strc_math_line_mode
+% % we can't end up here
+% \orelse\ifconditional\c_strc_math_aligned_here
+% \ifzeropt\d_strc_math_indent\else
+% \hangafter\plusone
+% \hangindent\d_strc_math_indent
+% \fi
+% % \strc_math_setup_align % _inner
+% \else
+% \strc_math_setup_align
+% \fi
+% % \strc_math_setup_spacing\formulaparameter
+% \strc_math_setup_penalties
+% \unhbox\b_strc_math_display
+% \egroup
+% \clf_handlemathhang
+% stage \ifconditional\c_strc_math_aligned_here \plustwo \else \plusthree \fi
+% % alignstate \c_strc_math_ragged_status
+% % box \b_strc_math_display
+% % distance \formulaparameter\c!textdistance
+% \relax
+% %
+% \begingroup
+% \edef\v_spac_whitespace_current{\formulaparameter\c!spaceinbetween}%
+% \spac_whitespace_setup
+% \clf_handlemathhang
+% stage \plusfour
+% inbetween 1\parskip
+% height \strutht
+% depth \strutdp
+% \relax
+% \endgroup}
+
+\def\strc_math_analyze_box
+ {\clf_handlemathhang
+ stage \plusone
+ alignstate \c_strc_math_ragged_status
+ box \b_strc_math_display
+ distance \formulaparameter\c!textdistance
+ \relax
+ %\holdingmigrations\zerocount
+ \setbox\b_strc_math_display\vbox\bgroup % \vtop
+ \ifnum\c_strc_math_split_mode=\c_strc_math_line_mode
+ % we can't end up here
+ \orelse\ifconditional\c_strc_math_aligned_here
+ \ifzeropt\d_strc_math_indent\else
+% \ifnum\c_page_sides_hangafter=\zerocount
+% \hangafter\plusone
+% \hangindent\d_strc_math_indent
+% \else
+ % this might become the default anyway:
+ \advanceby\leftskip\d_strc_math_indent
+ \hskip-\d_strc_math_indent
+% \fi
+ \fi
+ % \strc_math_setup_align % _inner
+ \else
+ \strc_math_setup_align
+ \fi
+ % \strc_math_setup_spacing\formulaparameter
+ \strc_math_setup_penalties
+ \unhbox\b_strc_math_display
+ \egroup
+ \clf_handlemathhang
+ stage \ifconditional\c_strc_math_aligned_here \plustwo \else \plusthree \fi
+ % alignstate \c_strc_math_ragged_status
+ % box \b_strc_math_display
+ % distance \formulaparameter\c!textdistance
+ \relax
+ %
+ \begingroup
+ \edef\v_spac_whitespace_current{\formulaparameter\c!spaceinbetween}%
+ \spac_whitespace_setup
+ \clf_handlemathhang
+ stage \plusfour
+ inbetween 1\parskip
+ height \strutht
+ depth \strutdp
+ splitmethod {\formulaparameter\c!splitmethod}%
+ \relax
+ \endgroup}
+
+\def\strc_math_show_margins_there
+ {\vadjust pre \bgroup
+ \c_attr_visual\attributeunsetvalue
+ \hbox to \hsize \bgroup
+ \setbox\scratchbox\hbox to \hsize\bgroup
+ \bgroup\darkred \vrule \s!width\leftskip \egroup\hss
+ \bgroup\darkgray\leaders\vrule\hfill \egroup\hss
+ \bgroup\white \vrule \s!width\emwidth \egroup\hss
+ \bgroup\darkgray\leaders\vrule\hfill \egroup\hss
+ \bgroup\darkblue\vrule \s!width\rightskip\egroup
+ \egroup
+ \ht\scratchbox1.2\exheight
+ \dp\scratchbox0.4\exheight
+ \strut
+ \box\scratchbox
+ \hskip-\hsize
+ \hbox to \hsize \bgroup
+ \white
+ \infofont
+ \hskip1\leftskip
+ \quad
+ \formulaparameter\c!split
+ \quad
+ \formulaparameter\c!align
+ \egroup
+ \egroup
+ \egroup}
+
+\let\strc_math_inject_show_margins_here\relax
+
+\def\strc_math_show_margins_indeed
+ {\gdef\strc_math_inject_show_margins_here
+ {\strc_math_show_margins_there
+ \glet\strc_math_inject_show_margins_here\relax}%
+ \appendtoks\strc_math_inject_show_margins_here\to\everypar}
+
+\installtextracker
+ {math.showmargins}
+ {\let\strc_math_show_margins\strc_math_show_margins_indeed}
+ {\let\strc_math_show_margins\relax}
+
+\let\strc_math_show_margins\relax
+
+\def\strc_math_set_options#1%
+ {\setfalse\c_strc_formulas_tight
+ \setfalse\c_strc_formulas_packed
+ \setfalse\c_strc_formulas_depth
+ \iftok{#1}\emptytoks
\edef\p_option{\formulaparameter\c!option}%
- \orelse\ifhastok={#2}% this is new, so that we can also set the grid
- \setupcurrentformula[#2]%
+ \orelse\ifhastok={#1}% this is new, so that we can also set the grid
+ \setupcurrentformula[#1]%
\edef\p_option{\formulaparameter\c!option}%
\else
\edef\p_option{\formulaparameter\c!option}%
- \edef\p_option{\ifempty\p_option\else\p_option,\fi#2}%
+ \edef\p_option{\ifempty\p_option\else\p_option,\fi#1}%
\fi
\ifempty\p_option \else
\rawprocesscommacommand[\p_option]\strc_formulas_option
+ \fi}
+
+\tolerant\protected\def\strc_formulas_start_formula#1#:#*[#2]% setting leftskip adaption is slow !
+ {\ifhmode
+ \par
\fi
- \edef\p_margin{\formulaparameter\c!margin}%
- \ifempty\p_margin \else
- \dosetleftskipadaption\p_margin
- \d_strc_formulas_display_margin_left\leftskipadaption
+ \bgroup % HERE
+ \iftrialtypesetting\else
+ \global\advanceby\c_strc_formulas_n\plusone
\fi
+ \def\currentformula{#1}%
+ \dostarttaggedchained\t!formula\currentformula\??formula
+ \strc_math_set_options{#2}%
+ \strc_math_set_split
+ \strc_math_set_number_location
+ \strc_formulas_set_paragraph
\let\strc_formulas_start_formula\strc_formulas_start_formula_nested
- \strc_formulas_forget_display_skips
\the\everybeforedisplayformula
+ \strc_math_setup_align
+ \ifcstok{\formulaparameter\c!strut}\v!yes
+ \let\strc_formulas_begstrut\begstrut
+ \let\strc_formulas_endstrut\endstrut
+ \else
+ \let\strc_formulas_begstrut\relax
+ \let\strc_formulas_endstrut\relax
+ \fi
\csname\e!start\formulaparameter\c!alternative\v!formula\endcsname}
\protected\def\strc_formulas_start_formula_nested#1%
@@ -933,9 +1584,11 @@
{\dostoptagged
\egroup}
+% the application of the above is in math-ali.mkxl: \strc_math_flush_aligned
+
% tagging of formulanumbers is not ok (we get two display maths blobs)
-\newcount\c_strc_formulas_n
+\newinteger\c_strc_formulas_n
\ifdefined\dotagregisterformula \else \aliased\let\dotagregisterformula\gobbleoneargument \fi
@@ -970,14 +1623,12 @@
\fi
\to \everybeforedisplayformula
-% \protected\def\switchtoformulabodyfont
-% {\switchtobodyfont}
-
-\tolerant\permanent\protected\def\formula[#1];#2% todo: tagged
+\tolerant\permanent\protected\def\formula[#1]#;#2% todo: tagged
{\begingroup
\ifparameters#1\else
\rawprocesscommacommand[#1]\strc_formulas_option
\fi
+ \useformulastyleandcolor\c!style\c!color
\mathematics{#2}%
\endgroup}
@@ -990,6 +1641,11 @@
%D \startformula x \stopformula % now has \noindent (in mkii we messed with baselineskip)
%D \stoptyping
+\let\strc_formulas_begstrut\relax
+\let\strc_formulas_endstrut\relax
+
+\newboundary\c_math_begin_boundary
+
\permanent\protected\def\startdisplaymath
{\ifhmode
\par
@@ -997,39 +1653,26 @@
\bgroup
\informulatrue
\beforedisplayspace
- \setdisplaydimensions
- \ifcase\c_strc_formulas_mode
- \noindent % prevents that tex injects empty line (when using native display mechanism)
- \Ucheckedstartdisplaymath
- \the\everydisplay % new (probably too much)
- \or
- \setbox\b_strc_formulas_content\hbox\bgroup
- \normalUstartmath
- \displaystyle
- \the\everydisplay % new (probably too much)
- \else
- \expandafter\startinnermath
+ \startinnermath
+ \ifrelax\strc_formulas_begstrut\else
+ \strc_formulas_begstrut
+ \boundary\c_math_begin_boundary
\fi
\begingroup} % less interference with upcoming a \over b
\permanent\protected\def\stopdisplaymath
{\endgroup % less interference with upcoming a \over b
- \ifcase\c_strc_formulas_mode
- \Ucheckedstopdisplaymath
- \or
- \normalUstopmath
- \egroup
- \strc_formulas_flush_content_and_number
- \else
- \expandafter\stopinnermath
- \fi
+% \ifrelax\strc_formulas_begstrut\else
+ \strc_formulas_endstrut
+% \fi
+ \stopinnermath
\afterdisplayspace
\egroup}
% already defined
%
-% \let\startinnermath\empty
-% \let\stopinnermath \empty
+% \lettonothing\startinnermath
+% \lettonothing\stopinnermath
% \defineformulaalternative[multi][\begindmath][\enddmath]
%
@@ -1052,10 +1695,7 @@
% \placeformula {f} \startspformule \fakespacingformula \stopspformule
% \fakewords{20}{40}
-\permanent\protected\def\startsubformulas
- {\dosingleempty\strc_formulas_start_sub_formulas}
-
-\def\strc_formulas_start_sub_formulas[#1]%
+\tolerant\permanent\protected\def\startsubformulas[#1]%
{\edef\currentsubformulasreference{#1}%
\global\settrue\c_strc_formulas_inside_formulas_sub
\strc_formulas_handle_sub_number}
@@ -1069,10 +1709,7 @@
%D Named subformulas (to be redone)
-\permanent\protected\def\startnamedsubformulas
- {\dosingleempty\strc_formulas_start_named_sub_formulas}
-
-\def\strc_formulas_start_named_sub_formulas[#1]#2%
+\tolerant\permanent\protected\def\startnamedsubformulas[#1]#2%
{\setformulalistentry{#2}%
\startsubformulas[#1]}
@@ -1094,21 +1731,25 @@
\permanent\letcsname\e!stop\v!formulas\endcsname\relax
-\protected\def\strc_formulas_nested_formula_start
- {\hbox to \displaywidth \bgroup
- \hsize\displaywidth
- \hss
- %\Ustartmath
+\tolerant\protected\def\strc_formulas_nested_formula_start[#1]%
+ {\begingroup
+ \ifparameter#1\or
+ \setupformula[\c!width=\d_strc_formulas_display_width,#1]%
+ \d_strc_formulas_display_width\formulaparameter\c!width\relax
+ \fi
+ \vcenter \bgroup
+ \hsize \d_strc_formulas_display_width
+ \displaywidth\d_strc_formulas_display_width
+ \raggedcenter
\dostarttagged\t!formulacontent\empty
\csname\e!start\formulaparameter\c!alternative\v!formula\endcsname}
\protected\def\strc_formulas_nested_formula_stop
{\csname\e!stop\formulaparameter\c!alternative\v!formula\endcsname
\dostoptagged
- %\Ustopmath
- \hss
\egroup
- \hss}
+ \hss
+ \endgroup}
\normalexpanded{\tolerant\def\noexpand\strc_formulas_start_formulas[#1]#:#2\csname\e!stop\v!formulas\endcsname}%
{\startformula
@@ -1116,15 +1757,17 @@
\global\settrue\c_strc_formulas_inside_formulas
\edef\currentformulasreference{#1}%
\strc_formulas_handle_number
- \let\currentformula\empty
- \strc_formulas_forget_display_skips
+ \lettonothing\currentformula
+ % \strc_formulas_forget_display_skips
\enforced\protected\def\startformula
- {\advance\scratchcounter\plusone
+ {\advanceby\scratchcounter\plusone
\expandafter\gobbleuntil\csname\e!stop\v!formula\endcsname}%
\scratchcounter\zerocount
#2% preroll
- \hbox to \displaywidth \bgroup
- \divide\displaywidth\scratchcounter
+ \hbox to \d_strc_formulas_display_width \bgroup
+ \ifcase\scratchcounter\else
+ \divideby\d_strc_formulas_display_width\scratchcounter
+ \fi
\hss
\enforced\let\startformula\strc_formulas_nested_formula_start
\enforced\let\stopformula \strc_formulas_nested_formula_stop
@@ -1155,10 +1798,7 @@
\plusthree
\fi}
-\permanent\protected\def\formulanumber
- {\strc_formulas_number} % for the moment
-
-\tolerant\protected\def\strc_formulas_number[#1]%
+\tolerant\permanent\protected\def\formulanumber[#1]%
{\def\currentformulareference{#1}%
\strc_formulas_place_number_in_box}
@@ -1166,12 +1806,16 @@
\permanent\protected\def\placesubformula{\global\settrue\c_strc_formulas_inside_place_sub\strc_formulas_place}
\tolerant\protected\def\strc_formulas_place[#1]%
- {\def\currentplaceformulareference{#1}%
- \let\currentplaceformulasuffix\empty
+ {\xdef\currentplaceformulareference{#1}%
+ \glettonothing\currentplaceformulasuffix
+ \glettonothing\currentnestedformulasuffix
+ \global\setfalse\c_strc_formulas_incremented
+ \global\setfalse\c_strc_formulas_referenced
+ \global\settrue\c_strc_formulas_inside_place
\doifelsenextbgroup\strc_formulas_place_yes\strc_formulas_place_nop} % [ref]{}
\protected\def\strc_formulas_place_yes#1%
- {\def\currentplaceformulasuffix{#1}%
+ {\xdef\currentplaceformulasuffix{#1}%
\strc_formulas_place_nop}
\protected\def\strc_formulas_place_nop
@@ -1194,12 +1838,14 @@
% \startplaceformula[title=whatever] \startformula e=mc^2 \stopformula \stopplaceformula
% \startplaceformula[suffix=x] \startformula e=mc^2 \stopformula \stopplaceformula
-\mutable\let\currentplaceformulatitle \empty
-\mutable\let\currentplaceformulareference\empty
-\mutable\let\currentplaceformulasuffix \empty
+\mutable\lettonothing\currentplaceformulatitle
+\mutable\lettonothing\currentplaceformulareference
+\mutable\lettonothing\currentplaceformulasuffix
\permanent\tolerant\protected\def\startplaceformula[#1]%
{\begingroup
+ \global\setfalse\c_strc_formulas_incremented
+ \global\setfalse\c_strc_formulas_referenced
\global\settrue\c_strc_formulas_inside_place
\ifparameter#1\or
\expandafter\strc_formulas_start_place_yes
@@ -1207,27 +1853,34 @@
\expandafter\strc_formulas_start_place_nop
\fi[#1]}
-\def\strc_formulas_start_place_yes[#1]%
+\def\strc_formulas_start_place_yes[#1]% todo
{\doifassignmentelse{#1}\strc_formulas_start_place_parameters\strc_formulas_start_place_reference[#1]}
\def\strc_formulas_start_place_nop[#1]%
- {\let\currentplaceformulareference\empty
- \let\currentplaceformulasuffix \empty
+ {\glettonothing\currentplaceformulareference
+ \glettonothing\currentplaceformulasuffix
\strc_formulas_place_nop}
\def\strc_formulas_start_place_reference[#1]%
- {\edef\currentplaceformulareference{#1}%
- \let\currentplaceformulasuffix\empty
+ {\xdef\currentplaceformulareference{#1}%
+ \glettonothing\currentplaceformulasuffix
%\doifelsenextbgroup\strc_formulas_place_yes\strc_formulas_place_nop} % [ref]{}
\strc_formulas_place_nop}
-\def\strc_formulas_start_place_parameters[#1]%
- {\letdummyparameter\c!title \empty
- \letdummyparameter\c!reference\empty
- \letdummyparameter\c!suffix \empty
+\mutable\lettonothing\currentplaceformulabookmark
+\mutable\lettonothing\currentplaceformulalist
+
+\def\strc_formulas_start_place_parameters[#1]% maybe a dedicated setup handler
+ {\resetdummyparameter\c!title
+ \resetdummyparameter\c!reference
+ \resetdummyparameter\c!bookmark
+ \resetdummyparameter\c!list
+ \resetdummyparameter\c!suffix
\getdummyparameters[#1]%
\edef\currentplaceformulatitle {\dummyparameter\c!title}%
\edef\currentplaceformulareference{\dummyparameter\c!reference}%
+ \edef\currentplaceformulabookmark {\dummyparameter\c!bookmark}%
+ \edef\currentplaceformulalist {\dummyparameter\c!list}%
\edef\currentplaceformulasuffix {\dummyparameter\c!suffix}%
\ifempty\currentplaceformulatitle\else
\normalexpanded{\setformulalistentry{\currentplaceformulatitle}}%
@@ -1244,61 +1897,131 @@
\let\strc_formulas_place_number_nested\gobbletwoarguments
\def\strc_formulas_place_number_nested_indeed#1#2%
- {\def\currentnestedformulareference{#1}%
- \def\currentnestedformulasuffix{#2}%
- \strc_formulas_check_reference\c_strc_formulas_nested_number_mode\currentnestedformulareference
+ {\ifhastok={#1}%
+ \setupcurrentmathalignment[#1]%
+ \xdef\currentnestedformulareference{\mathalignmentparameter\c!reference}%
+ \xdef\currentnestedformulasuffix {\mathalignmentparameter\c!suffix}%
+ \global\d_math_eqalign_number_threshold\mathalignmentparameter\c!numberthreshold\relax
+ \orelse\ifhastok+{#1}%
+ \glettonothing\currentnestedformulareference
+ \xdef\currentnestedformulasuffix {+}%
+ \orelse\ifempty\currentplaceformulareference
+ \xdef\currentnestedformulareference{#1}%
+ \xdef\currentnestedformulasuffix {#2}%
+ \else
+ \glettonothing\currentnestedformulareference
+ \xdef\currentnestedformulasuffix {#1}%
+ \fi
+ \strc_formulas_place_number_nested_check}
+
+\def\strc_formulas_place_number_nested_check
+ {\ifempty\currentnestedformulareference
+ \ifempty\currentnestedformulasuffix \else
+ \c_strc_formulas_nested_number_mode\plusthree
+ \fi
+ \else
+ \strc_formulas_check_reference\c_strc_formulas_nested_number_mode\currentnestedformulareference
+ \fi
\ifcase\c_strc_formulas_nested_number_mode
% nothing
\or
\glet\strc_formulas_place_number\relax
- \expandafter\strc_formulas_number % hm, looks ahead for []
+ \strc_formulas_place_number_in_box
\or
% nothing
\or
\glet\strc_formulas_place_number\relax
- \expandafter\strc_formulas_number % hm, looks ahead for []
+ \strc_formulas_place_number_in_box
\fi}
\def\strc_formulas_place_number_indeed
{\strc_formulas_place_number_in_box}
+% \startplaceformula
+% \startformula
+% \startalign
+% \NC a \NC = p \NR[eq:one]
+% \NC b \NC = q \NR
+% \NC c \NC = r \NR[eq:two]
+% \NC d \NC = s \NR[eq:three]
+% \stopalign
+% \stopformula
+% \stopplaceformula
+% \stoptext
+
\def\strc_formulas_place_number_in_box
{\dostarttagged\t!formulacaption\empty
+ % this is really needed, otherwise we get spurious numbers probably due to some
+ % interference with other local variables .. also keep an eye on eqtest in the
+ % MS tests
+ \glet\strc_formulas_place_number \relax
+ %\glet\strc_formulas_place_number_nested\gobbletwoarguments
+ %
\global\setbox\b_strc_formulas_number\naturalhbox{\strc_formulas_number_indeed}%
\dostoptagged}
-\def\strc_formulas_flush_number
- {\ifcase\c_strc_formulas_mode
- \ifzeropt\wd\b_strc_formulas_number
- % nothing to be done
- \orelse\ifx\p_location\v!left
- \math_native_leqno{\box\b_strc_formulas_number}%
- \else
- \math_native_reqno{\box\b_strc_formulas_number}%
- \fi
- \fi}
+\let\strc_formulas_flush_number\relax
% todo
\permanent\tolerant\protected\def\placenamedformula[#1]%
{\ifarguments
- \expandafter\strc_formulase_place_named_nop
+ \expandafter\strc_formulas_place_named_nop
\else
- \expandafter\strc_formulase_place_named_yes
+ \expandafter\strc_formulas_place_named_yes
\fi[#1]}
-\def\strc_formulase_place_named_yes[#1]#2%
+\def\strc_formulas_place_named_yes[#1]#2%
{\setformulalistentry{#2}%
\placeformula[#1]}
-\def\strc_formulase_place_named_nop[#1]#2%
+\def\strc_formulas_place_named_nop[#1]#2%
{\setformulalistentry{#2}%
\placeformula}
-\mutable\let\namedformulaentry\empty % \relax % this will become a key/value so that we can do bookmarks
+\def\strc_math_flush_aligned_boxed_direct_yes
+ {\dontleavehmode % NO!
+ \hskip-\leftskip % bah
+ \box\b_strc_math_display
+ \llap{\box\b_strc_formulas_number}}
+
+\def\strc_math_flush_aligned_boxed_direct_nop
+ {\dontleavehmode % NO!
+ \hskip-\leftskip % bah
+ \box\b_strc_math_display}
+
+\mutable\lettonothing\namedformulaentry % \relax % this will become a key/value so that we can do bookmarks
\permanent\protected\def\setformulalistentry#1%
- {\gdef\namedformulaentry{#1}}
+ {\xdef\namedformulaentry{#1}}
+
+%D New:
+%D
+%D \setupformula[snap=yes,snapstep=medium]
+
+\definesystemattribute[mathsnap][public]
+
+\appendtoks
+ \ifcstok{\formulaparameter\c!snap}\v!yes
+ \setmathsnapping{\formulaparameter\c!snapstep}%
+ \else
+ \setmathsnapping\v!reset
+ \fi
+\to \everysetupformula
+
+%D Also new, handy for articles and manuals:
+
+% \starttext
+% \showmakeup[line]
+% \input tufte \startformula e = mc^2 \stopformula
+% \input tufte \startformula[bodyfont=10pt] e = mc^2 \stopformula
+% \input tufte \startformula[bodyfont=24pt] e = mc^2 \stopformula
+% \input tufte
+% \stoptext
+
+\prependtoks
+ \usebodyfontparameter\formulaparameter
+\to \everymathematics
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-not.lmt b/Master/texmf-dist/tex/context/base/mkxl/strc-not.lmt
new file mode 100644
index 00000000000..e05228b2b51
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-not.lmt
@@ -0,0 +1,530 @@
+if not modules then modules = { } end modules ['strc-not'] = {
+ version = 1.001,
+ comment = "companion to strc-not.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local format = string.format
+local next = next
+
+local trace_notes = false trackers.register("structures.notes", function(v) trace_notes = v end)
+local trace_references = false trackers.register("structures.notes.references", function(v) trace_references = v end)
+
+local report_notes = logs.reporter("structure","notes")
+
+local structures = structures
+local helpers = structures.helpers
+local lists = structures.lists
+local sections = structures.sections
+local counters = structures.counters
+local notes = structures.notes
+local references = structures.references
+local counterspecials = counters.specials
+
+local texgetcount = tex.getcount
+local texgetbox = tex.getbox
+
+-- todo: allocate
+
+notes.states = notes.states or { }
+lists.enhancers = lists.enhancers or { }
+notes.numbers = notes.numbers or { }
+
+storage.register("structures/notes/states", notes.states, "structures.notes.states")
+storage.register("structures/notes/numbers", notes.numbers, "structures.notes.numbers")
+
+local notestates = notes.states
+local notedata = table.setmetatableindex("table")
+
+local variables = interfaces.variables
+local context = context
+local commands = commands
+
+local implement = interfaces.implement
+
+-- state: store, insert, postpone
+
+local function store(tag,n)
+ -- somewhat weird but this is a cheap hook spot
+ if not counterspecials[tag] then
+ counterspecials[tag] = function(tag)
+ context.doresetlinenotecompression(tag) -- maybe flag that controls it
+ end
+ end
+ --
+ local nd = notedata[tag]
+ local nnd = #nd + 1
+ nd[nnd] = n
+ local state = notestates[tag]
+ if not state then
+ report_notes("unknown state for %a",tag)
+ elseif state.kind ~= "insert" then
+ if trace_notes then
+ report_notes("storing %a with state %a as %a",tag,state.kind,nnd)
+ end
+ state.start = state.start or nnd
+ end
+ return nnd
+end
+
+notes.store = store
+
+implement {
+ name = "storenote",
+ actions = { store, context },
+ arguments = { "string", "integer" }
+}
+
+local function get(tag,n) -- tricky ... only works when defined
+ local nd = notedata[tag]
+ if not n then
+ n = #nd
+ end
+ nd = nd[n]
+ if nd then
+ if trace_notes then
+ report_notes("getting note %a of %a with listindex %a",n,tag,nd)
+ end
+ -- is this right?
+ local newdata = lists.cached[nd]
+ return newdata
+ end
+end
+
+local function getn(tag)
+ return #notedata[tag]
+end
+
+notes.get = get
+notes.getn = getn
+
+-- we could make a special enhancer
+
+local function listindex(tag,n)
+ local ndt = notedata[tag]
+ return ndt and ndt[n]
+end
+
+notes.listindex = listindex
+
+implement {
+ name = "notelistindex",
+ actions = { listindex, context },
+ arguments = { "string", "integer" }
+}
+
+local function setstate(tag,newkind)
+ local state = notestates[tag]
+ if trace_notes then
+ report_notes("setting state of %a from %s to %s",tag,(state and state.kind) or "unset",newkind)
+ end
+ if not state then
+ state = {
+ kind = newkind
+ }
+ notestates[tag] = state
+ elseif newkind == "insert" then
+ if not state.start then
+ state.kind = newkind
+ end
+ else
+-- if newkind == "postpone" and state.kind == "store" then
+-- else
+ state.kind = newkind
+-- end
+ end
+ -- state.start can already be set and will be set when an entry is added or flushed
+ return state
+end
+
+local function getstate(tag)
+ local state = notestates[tag]
+ return state and state.kind or "unknown"
+end
+
+notes.setstate = setstate
+notes.getstate = getstate
+
+
+
+implement {
+ name = "setnotestate",
+ actions = setstate,
+ arguments = "2 strings",
+}
+
+implement {
+ name = "getnotestate",
+ actions = { getstate, context },
+ arguments = "string"
+}
+
+function notes.define(tag,kind,number)
+ local state = setstate(tag,kind)
+ notes.numbers[number] = state
+ state.number = number
+end
+
+implement {
+ name = "definenote",
+ actions = notes.define,
+ arguments = { "string", "string", "integer" }
+}
+
+function notes.save(tag,newkind)
+ local state = notestates[tag]
+ if state and not state.saved then
+ if trace_notes then
+ report_notes("saving state of %a, old: %a, new %a",tag,state.kind,newkind or state.kind)
+ end
+ state.saveddata = notedata[tag]
+ state.savedkind = state.kind
+ state.kind = newkind or state.kind
+ state.saved = true
+ notedata[tag] = { }
+ end
+end
+
+function notes.restore(tag,forcedstate)
+ local state = notestates[tag]
+ if state and state.saved then
+ if trace_notes then
+ report_notes("restoring state of %a, old: %a, new: %a",tag,state.kind,state.savedkind)
+ end
+ notedata[tag] = state.saveddata
+ state.kind = forcedstate or state.savedkind
+ state.saveddata = nil
+ state.saved = false
+ end
+end
+
+implement { name = "savenote", actions = notes.save, arguments = "2 strings" }
+implement { name = "restorenote", actions = notes.restore, arguments = "2 strings" }
+
+local function hascontent(tag)
+ local ok = notestates[tag]
+ if ok then
+ if ok.kind == "insert" then
+ ok = texgetbox(ok.number)
+ if ok then
+ ok = tbs.list
+ ok = lst and lst.next
+ end
+ else
+ ok = ok.start
+ end
+ end
+ return ok and true or false
+end
+
+notes.hascontent = hascontent
+
+implement {
+ name = "doifnotecontent",
+ actions = { hascontent, commands.doif },
+ arguments = "string",
+}
+
+local function internal(tag,n)
+ local nd = get(tag,n)
+ if nd then
+ local r = nd.references
+ if r then
+ local i = r.internal
+ return i and references.internals[i] -- dependency on references
+ end
+ end
+ return nil
+end
+
+local function ordered(kind,name,n)
+ local o = lists.ordered[kind]
+ o = o and o[name]
+ return o and o[n]
+end
+
+notes.internal = internal
+notes.ordered = ordered
+
+-- local function onsamepageasprevious(tag)
+-- local same = false
+-- local n = getn(tag,n)
+-- local current = get(tag,n)
+-- local previous = get(tag,n-1)
+-- if current and previous then
+-- local cr = current.references
+-- local pr = previous.references
+-- same = cr and pr and cr.realpage == pr.realpage
+-- end
+-- return same and true or false
+-- end
+
+local function onsamepageasprevious(tag)
+ local n = getn(tag,n)
+ local current = get(tag,n)
+ if not current then
+ return false
+ end
+ local cr = current.references
+ if not cr then
+ return false
+ end
+ local previous = get(tag,n-1)
+ if not previous then
+ return false
+ end
+ local pr = previous.references
+ if not pr then
+ return false
+ end
+ return cr.realpage == pr.realpage
+end
+
+notes.doifonsamepageasprevious = onsamepageasprevious
+
+implement {
+ name = "doifnoteonsamepageasprevious",
+ actions = { onsamepageasprevious, commands.doifelse },
+ arguments = "string",
+}
+
+function notes.checkpagechange(tag) -- called before increment !
+ local nd = notedata[tag] -- can be unset at first entry
+ if nd then
+ local current = ordered("note",tag,#nd)
+ local nextone = ordered("note",tag,#nd+1)
+ if nextone then
+ -- we can use data from the previous pass
+ if nextone.pagenumber.number > current.pagenumber.number then
+ counters.reset(tag)
+ end
+ elseif current then
+ -- we need to locate the next one, best guess
+ if texgetcount("realpageno") > current.pagenumber.number then
+ counters.reset(tag)
+ end
+ end
+ end
+end
+
+function notes.postpone()
+ if trace_notes then
+ report_notes("postponing all insert notes")
+ end
+ for tag, state in next, notestates do
+ if state.kind ~= "store" then
+ setstate(tag,"postpone")
+ end
+ end
+end
+
+implement {
+ name = "postponenotes",
+ actions = notes.postpone
+}
+
+local function getinternal(tag,n)
+ local li = internal(tag,n)
+ if li then
+ local references = li.references
+ if references then
+ return references.internal or 0
+ end
+ end
+ return 0
+end
+
+local function getdeltapage(tag,n)
+ -- 0:unknown 1:textbefore, 2:textafter, 3:samepage
+ local li = internal(tag,n)
+ if li then
+ local references = li.references
+ if references then
+ -- local symb = structures.references.collected[""]["symb:"..tag..":"..n]
+ local rymb = structures.references.collected[""]
+ local symb = rymb and rymb["*"..(references.internal or 0)]
+ local notepage = references.realpage or 0
+ local symbolpage = symb and symb.references.realpage or -1
+ if trace_references then
+ report_notes("note number %a of %a points from page %a to page %a",n,tag,symbolpage,notepage)
+ end
+ if notepage < symbolpage then
+ return 3 -- after
+ elseif notepage > symbolpage then
+ return 2 -- before
+ elseif notepage > 0 then
+ return 1 -- same
+ end
+ else
+ -- might be a note that is not flushed due to to deep
+ -- nesting in a vbox
+ end
+ end
+ return 0
+end
+
+notes.getinternal = getinternal
+notes.getdeltapage = getdeltapage
+
+implement { name = "noteinternal", actions = { getinternal, context }, arguments = { "string", "integer" } }
+implement { name = "notedeltapage", actions = { getdeltapage, context }, arguments = { "string", "integer" } }
+
+local function flushnotes(tag,whatkind,how) -- store and postpone
+ local state = notestates[tag]
+ local kind = state.kind
+ if kind == whatkind then
+ local nd = notedata[tag]
+ local ns = state.start -- first index
+ if kind == "postpone" then
+ if nd and ns then
+ if trace_notes then
+ report_notes("flushing state %a of %a from %a to %a",whatkind,tag,ns,#nd)
+ end
+ for i=ns,#nd do
+ context.handlenoteinsert(tag,i)
+ end
+ end
+ state.start = nil
+ state.kind = "insert"
+ elseif kind == "store" then
+ if nd and ns then
+ if trace_notes then
+ report_notes("flushing state %a of %a from %a to %a",whatkind,tag,ns,#nd)
+ end
+ -- todo: as registers: start, stop, inbetween
+ for i=ns,#nd do
+ -- tricky : trialtypesetting
+ if how == variables.page then
+ local rp = get(tag,i)
+ rp = rp and rp.references
+ rp = rp and rp.symbolpage or 0
+ if rp > texgetcount("realpageno") then
+ state.start = i
+ return
+ end
+ end
+ if i > ns then
+ context.betweennoteitself(tag)
+ end
+ context.handlenoteitself(tag,i)
+ end
+ end
+ state.start = nil
+ elseif kind == "reset" then
+ if nd and ns then
+ if trace_notes then
+ report_notes("flushing state %a of %a from %a to %a",whatkind,tag,ns,#nd)
+ end
+ end
+ state.start = nil
+ elseif trace_notes then
+ report_notes("not flushing state %a of %a",whatkind,tag)
+ end
+ elseif trace_notes then
+ report_notes("not flushing state %a of %a",whatkind,tag)
+ end
+end
+
+local function flushpostponednotes()
+ if trace_notes then
+ report_notes("flushing all postponed notes")
+ end
+ for tag, _ in next, notestates do
+ flushnotes(tag,"postpone")
+ end
+end
+
+implement {
+ name = "flushpostponednotes",
+ actions = flushpostponednotes
+}
+
+implement {
+ name = "flushnotes",
+ actions = flushnotes,
+ arguments = "3 strings",
+}
+
+function notes.resetpostponed()
+ if trace_notes then
+ report_notes("resetting all postponed notes")
+ end
+ for tag, state in next, notestates do
+ if state.kind == "postpone" then
+ state.start = nil
+ state.kind = "insert"
+ end
+ end
+end
+
+implement {
+ name = "notetitle",
+ actions = function(tag,n) lists.savedlisttitle(tag,notedata[tag][n]) end,
+ arguments = { "string", "integer" }
+}
+
+implement {
+ name = "noteprefixednumber",
+ actions = function(tag,n) lists.savedlistprefixednumber(tag,notedata[tag][n]) end,
+ arguments = { "string", "integer" }
+}
+
+function notes.internalid(tag,n)
+ local nd = get(tag,n)
+ if nd then
+ local r = nd.references
+ return r.internal
+ end
+end
+
+-- for the moment here but better in some builder modules
+
+-- gets register "n" and location "i" (where 1 is before)
+
+-- this is an experiment, we will make a more general handler instead
+-- of the current note one
+
+local report_insert = logs.reporter("pagebuilder","insert")
+local trace_insert = false trackers.register("pagebuilder.insert",function(v) trace_insert = v end)
+
+local texgetglue = tex.getglue
+----- texsetglue = tex.setglue
+
+local tonode = nodes.nuts.tonode
+local newgluespec = nodes.nuts.pool.gluespec -- nodes.pool.gluespec
+
+-- needs to be sorted out!
+
+local function check_spacing(index,slot)
+ -- we can also check for tex.insertheights > 0 (instead of i > 1)
+ local gn, pn, mn = tex.getinsertdistance(index) -- ,true so no testing needed
+ if not pn then pn = 0 end
+ if not mn then mn = 0 end
+ local gi, pi, mi = texgetglue(slot > 1 and "s_strc_notes_inbetween" or "s_strc_notes_before")
+ if not pi then pi = 0 end
+ if not mi then mi = 0 end
+ local gt = gn + gi
+ local pt = pn + pi
+ local mt = mn + mi
+ if trace_insert then
+ report_insert("%s %i: %p plus %p minus %p","always ",index,gn,pn,mn)
+ report_insert("%s %i: %p plus %p minus %p",slot > 1 and "inbetween" or "before ",index,gi,pi,mi)
+ report_insert("%s %i: %p plus %p minus %p","effective",index,gt,pt,mt)
+ end
+ return gt, pt, mt
+end
+
+notes.check_spacing = check_spacing
+
+-- only notes, kind of hardcoded .. bah
+
+callback.register("build_page_insert", function(index,slot)
+ local state = notes.numbers[index]
+ if state then
+ return tonode(newgluespec(check_spacing(index,slot)))
+ else
+ return tonode(newgluespec())
+ end
+end)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-not.mklx b/Master/texmf-dist/tex/context/base/mkxl/strc-not.mklx
index 5ac57137422..29440f58208 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/strc-not.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-not.mklx
@@ -13,7 +13,7 @@
\writestatus{loading}{ConTeXt Structure Macros / Note Handling}
-\registerctxluafile{strc-not}{}
+\registerctxluafile{strc-not}{autosuffix}
\unprotect
@@ -24,9 +24,6 @@
\ifdefined\dotagsetnotesymbol \else \aliased\let\dotagsetnotesymbol\relax \fi
\ifdefined\dotagsetnotation \else \aliased\let\dotagsetnotation \relax \fi
-\permanent\protected\def\unvboxed {\ifvmode\unvbox \else\box \fi} % will change or used more often
-\permanent\protected\def\unvcopied{\ifvmode\unvcopy\else\copy\fi} % will change or used more often
-
%D \LMTX\ testcase:
%D
%D \starttyping
@@ -139,20 +136,20 @@
\protected\def\strc_define_commands_notation#tag#level#parent%
{\doifelsenothing{#parent}
{\normalexpanded{\defineconstruction[#tag][\s!handler=\v!notation,\c!level=#level]}%
- \setevalue{\??notation#tag:\s!parent}{\??notation}}%
+ \edefcsname\??notation#tag:\s!parent\endcsname{\??notation}}%
{\normalexpanded{\defineconstruction[#tag][#parent][\s!handler=\v!notation,\c!level=#level]}%
- \setevalue{\??note #tag:\s!parent}{\??note#parent}% see later for \s!note
- \setevalue{\??notation#tag:\s!parent}{\??notation#parent}}%
- \instance\setuevalue{\e!next #tag}{\strc_notations_next {#tag}{\number#level}}% obsolete
- \instance\setuevalue{\c!reset#tag}{\strc_notations_reset {#tag}{\number#level}}% obsolete
- \instance\setuevalue {#tag}{\strc_notations_command[#tag]}%
- \instance\setuevalue{\e!start#tag}{\strc_notations_start [#tag]}%
- \instance\setuevalue{\e!stop #tag}{\strc_notations_stop }}
+ \edefcsname\??note #tag:\s!parent\endcsname{\??note#parent}% see later for \s!note
+ \edefcsname\??notation#tag:\s!parent\endcsname{\??notation#parent}}%
+ \instance\protected\edefcsname\e!next #tag\endcsname{\strc_notations_next{#tag}{\number#level}}% obsolete
+ \instance\protected\edefcsname\c!reset#tag\endcsname{\strc_notations_reset{#tag}{\number#level}}% obsolete
+ \instance\protected\edefcsname #tag\endcsname{\strc_notations_command[#tag]}%
+ \instance\protected\edefcsname\e!start#tag\endcsname{\strc_notations_start[#tag]}%
+ \instance\protected\edefcsname\e!stop #tag\endcsname{\strc_notations_stop}}
-\let\m_strc_notation_sub\empty
+\lettonothing\m_strc_notation_sub
\appendtoks
- \let\m_strc_notation_sub\empty
+ \lettonothing\m_strc_notation_sub
\ifempty\currentnotationparent
% clone => parent | subclone => clone | subsubclone => subclone
\strc_define_commands_notation
@@ -187,10 +184,10 @@
%\strc_notes_setup_counter\currentnotation
\to \everydefinenotation
-\let\p_strc_constructions_title \empty
-\let\p_strc_constructions_number\empty
+\lettonothing\p_strc_constructions_title
+\lettonothing\p_strc_constructions_number
-\protected\setvalue{\??constructioninitializer\v!notation}%
+\protected\defcsname\??constructioninitializer\v!notation\endcsname
{\let \currentnotation \currentconstruction
\enforced\let\constructionparameter \notationparameter
\enforced\let\constructionnamespace \??notation
@@ -215,7 +212,7 @@
\setfalse\c_strc_constructions_title_state
\fi}
-\protected\setvalue{\??constructionfinalizer\v!notation}%
+\protected\defcsname\??constructionfinalizer\v!notation\endcsname
{\ifconditional\c_strc_constructions_number_state
\iftrialtypesetting
\strc_counters_restore\currentconstructionnumber
@@ -283,32 +280,45 @@
\strc_constructions_finalize
\strc_notations_finalize}
-\tolerant\protected\def\strc_notations_start[#1]#*[#2]%
+\tolerant\protected\def\strc_notations_start
+ {\strc_notations_start_indeed{\csname\e!stop\currentnotation\endcsname}}
+
+\tolerant\protected\defcsname\e!start\e!namednotation\endcsname
+ {\strc_notations_start_indeed{\csname\e!stop\e!namednotation\endcsname}}
+
+\ifdefined\startnamednotation
+ % we're in the english interface
+\else
+ \tolerant\protected\def\startnamednotation
+ {\strc_notations_start_indeed\stopnamednotation}
+\fi
+
+\tolerant\protected\def\strc_notations_start_indeed#1#*[#2]#*[#3]%
{\begingroup
- \edef\currentnote{#1}%
- \strc_constructions_initialize{#1}%
+ \edef\currentnote{#2}%
+ \strc_constructions_initialize{#2}%
\strc_notes_synchronize
\ifnotesenabled
\strc_counters_increment_sub\currentconstructionnumber\currentconstructionlevel
\fi
- \ifhastok={#2}%
+ \ifhastok={#3}%
\expandafter\strc_notations_start_setups
\else
\expandafter\strc_notations_start_reference
- \fi[#2]}
+ \fi#1[#3]}
\let\strc_notations_pickup_yes\relax
-\protected\def\strc_notations_start_setups[#1]%
- {\normalexpanded{\def\noexpand\strc_notations_pickup_yes##/\csname\e!stop\currentconstruction\endcsname{\strc_notations_start_setups_indeed[#1]{##1}}}%
+\protected\def\strc_notations_start_setups#1[#2]%
+ {\normalexpanded{\def\noexpand\strc_notations_pickup_yes##/#1{\strc_notations_start_setups_indeed[#2]{##1}}}%
\strc_notations_pickup_yes}
\protected\def\strc_notations_start_setups_indeed[#1]#*#2%
{\strc_constructions_register[][\c!label={\descriptionparameter\c!text},\c!reference=,\c!title={#2},\c!bookmark=,\c!list=,\c!referencetext=,#1]%
\strc_notations_wrapup}
-\protected\def\strc_notations_start_reference[#1]%
- {\normalexpanded{\def\noexpand\strc_notations_pickup_yes##/\csname\e!stop\currentconstruction\endcsname{\strc_notations_start_reference_indeed[#1]{##1}}}%
+\protected\def\strc_notations_start_reference#1[#2]%
+ {\normalexpanded{\def\noexpand\strc_notations_pickup_yes##/#1{\strc_notations_start_reference_indeed[#2]{##1}}}%
\strc_notations_pickup_yes}
\protected\def\strc_notations_start_reference_indeed[#1]#*#2%
@@ -323,10 +333,10 @@
%D indirectness. This way notations don't bark on undefined macros when used in
%D combination.
-\protected\setvalue{\??constructionnotehandler\v!notation}%
+\protected\defcsname\??constructionnotehandler\v!notation\endcsname
{\csname\??constructionnotehandler\currentconstructionhandler:\constructionparameter\c!type\endcsname}
-\protected\setvalue{\??constructionnotehandler\v!notation:}% empty case
+\protected\defcsname\??constructionnotehandler\v!notation:\endcsname % empty case
{[\currentconstructionhandler:\currentconstruction]}
%D Here is a simple renderer for notes
@@ -409,7 +419,8 @@
\doifelseinsertion\currentnote
\donothing
{\defineinsertion[\currentnote]% could be an option
- \normalexpanded{\t_strc_notes{\the\t_strc_notes\noexpand\strc_notes_process_list{\currentnote}}}}%
+% \normalexpanded{\t_strc_notes{\the\t_strc_notes\noexpand\strc_notes_process_list{\currentnote}}}}%
+ \xtoksapp\t_strc_notes{\noexpand\strc_notes_process_list{\currentnote}}}%
\letnoteparameter\s!insert\currentnote
\definenotation[\currentnote][\c!type=\v!note]%
\else
@@ -445,16 +456,19 @@
\letcsname\??constructioncommandhandler\v!notation\expandafter\endcsname\csname\??constructioncommandhandler\v!enumeration \endcsname
\letcsname\??constructiontexthandler \v!notation\expandafter\endcsname\csname\??constructiontexthandler \v!enumeration \endcsname
-\protected\setvalue{\??constructionmainhandler\v!notation}#following%
+\protected\defcsname\??constructionmainhandler\v!notation\endcsname#following%
{\iftrialtypesetting \else
\begingroup
\currentconstructionsynchronize
\c_attr_destination\currentconstructionattribute\relax % todo, whole text
\signalcharacter
\endgroup
- \fi#following}
+ \fi
+ \ifconditional\c_strc_notes_flushed\else
+ #following\relax
+ \fi}
-\protected\setvalue{\??constructionnotehandler\v!notation:\v!note}% in the running text
+\protected\defcsname\??constructionnotehandler\v!notation:\v!note\endcsname % in the running text
{\ifnotesenabled
% do be done elsewhere
%
@@ -484,6 +498,8 @@
\global\settrue\postponednote
\orelse\ifconditional\inlocalnotes % todo: per note class
\global\settrue\postponednote
+ \orelse\ifconditional\c_strc_notes_flushed
+ \handlenoteitself\currentnote\currentnotenumber
\orelse\ifconditional\c_strc_notes_delayed
% probably end notes
\else
@@ -495,7 +511,7 @@
\ifconditional\c_strc_notes_skip
\global\setfalse\c_strc_notes_skip
\else
- \kern\d_strc_notes_signal\relax % \relax is needed to honor spaces
+ \boundary\noteboundary
\fi}
%D Interaction in notes is somewhat complex due to the way notes get flushed. In
@@ -528,8 +544,8 @@
\newconstant\a_strc_notes_text_reference
\newconstant\a_strc_notes_text_destination
-\let\strc_notes_get_reference_attribute_symbol \empty
-\let\strc_notes_get_destination_attribute_symbol\empty
+\lettonothing\strc_notes_get_reference_attribute_symbol
+\lettonothing\strc_notes_get_destination_attribute_symbol
\def\strc_notes_interaction_check_inline
{\edef\p_interaction{\noteparameter\c!interaction}%
@@ -545,8 +561,8 @@
\mutable\let\currentnotenumber\!!zerocount
-\let\strc_notes_get_reference_attribute_symbol \empty
-\let\strc_notes_get_destination_attribute_symbol\empty
+\lettonothing\strc_notes_get_reference_attribute_symbol
+\lettonothing\strc_notes_get_destination_attribute_symbol
\let\strc_notes_set_reference_attribute_number\donothing
\let\strc_notes_set_reference_attribute_text \donothing
@@ -560,8 +576,8 @@
\let\m_strc_notes_internal\relax
\def\strc_notes_prepare_inline_references_nop
- {\let\strc_notes_get_reference_attribute_symbol\empty
- \let\strc_notes_get_destination_attribute_symbol\empty
+ {\lettonothing\strc_notes_get_reference_attribute_symbol
+ \lettonothing\strc_notes_get_destination_attribute_symbol
\let\strc_notes_set_style_color_inline\strc_notes_set_style_color_inline_nop}
\def\strc_notes_prepare_inline_references_yes
@@ -572,11 +588,11 @@
\edef\strc_notes_get_reference_attribute_symbol{attr\referenceattribute\currentreferenceattribute}%
\let\strc_notes_set_style_color_inline\strc_notes_set_style_color_inline_yes}
-\letvalue{\??noteinteractioninline\v!no }\strc_notes_prepare_inline_references_nop
-\letvalue{\??noteinteractioninline\v!all }\strc_notes_prepare_inline_references_yes
-\letvalue{\??noteinteractioninline\v!number}\strc_notes_prepare_inline_references_yes
-\letvalue{\??noteinteractioninline\v!text }\strc_notes_prepare_inline_references_yes
-\letvalue{\??noteinteractioninline\v!yes }\strc_notes_prepare_inline_references_yes
+\letcsname\??noteinteractioninline\v!no \endcsname\strc_notes_prepare_inline_references_nop
+\letcsname\??noteinteractioninline\v!all \endcsname\strc_notes_prepare_inline_references_yes
+\letcsname\??noteinteractioninline\v!number\endcsname\strc_notes_prepare_inline_references_yes
+\letcsname\??noteinteractioninline\v!text \endcsname\strc_notes_prepare_inline_references_yes
+\letcsname\??noteinteractioninline\v!yes \endcsname\strc_notes_prepare_inline_references_yes
% display (for 'all' we need unique text and number attributes so we resolve twice
% as we otherwise don't get the number one which is lapped in the margin so we need
@@ -622,11 +638,11 @@
\let\strc_notes_set_style_color_display\strc_notes_set_style_color_display_yes
\fi}
-\letvalue{\??noteinteractiondisplay\v!no }\strc_notes_prepare_display_references_nop
-\letvalue{\??noteinteractiondisplay\v!all }\strc_notes_prepare_display_references_yes_all
-\letvalue{\??noteinteractiondisplay\v!number}\strc_notes_prepare_display_references_yes_number
-\letvalue{\??noteinteractiondisplay\v!text }\strc_notes_prepare_display_references_yes_text
-\letvalue{\??noteinteractiondisplay\v!yes }\strc_notes_prepare_display_references_yes_number
+\letcsname\??noteinteractiondisplay\v!no \endcsname\strc_notes_prepare_display_references_nop
+\letcsname\??noteinteractiondisplay\v!all \endcsname\strc_notes_prepare_display_references_yes_all
+\letcsname\??noteinteractiondisplay\v!number\endcsname\strc_notes_prepare_display_references_yes_number
+\letcsname\??noteinteractiondisplay\v!text \endcsname\strc_notes_prepare_display_references_yes_text
+\letcsname\??noteinteractiondisplay\v!yes \endcsname\strc_notes_prepare_display_references_yes_number
\mutable\let\strc_notes_set_style_color_inline_nop \usenotestyleandcolor
\mutable\let\strc_notes_set_style_color_display_nop\usenotationstyleandcolor
@@ -647,7 +663,7 @@
\setlocationcolorspecified\scratchcounter
\fi}
-\setvalue{\??constructiontexthandler\v!notation}%
+\defcsname\??constructiontexthandler\v!notation\endcsname
{\begingroup
% we need to retrigger the reference as otherwise it gets lost because we don't do nested
% references with the same id ... maybe some day if we can figure out a nice heuristic ...
@@ -692,14 +708,14 @@
\removeunwantedspaces
\doifelseitalic\/\donothing % Charles IV \footnote{the fourth}
\fi
- \ifdim\lastkern=\d_strc_notes_signal
+ \ifnum\lastboundary=\noteboundary
+ \unboundary
% \kern\noteparameter\c!distance % yes or no note font? or main text
\strc_notes_inject_separator
\fi
\nobreak
\begingroup
- \strc_notes_interaction_check_inline
- \strc_notes_set_style_color_inline\c!textstyle\c!textcolor
+ \strc_notes_interaction_check_inline\strc_notes_set_style_color_inline\c!textstyle\c!textcolor
\hbox \strc_notes_get_reference_attribute_symbol \strc_notes_get_destination_attribute_symbol \bgroup
% \hbox \strc_notes_get_reference_attribute_symbol \bgroup \strc_notes_destination_hack
\strc_references_flush_destination_nodes % a bit late but ok
@@ -711,18 +727,19 @@
\dostoptagged
\egroup
\endgroup
- \glet\lastnotesymbol\empty}
+ \glettonothing\lastnotesymbol}
\protected\def\strc_notes_inject_dummy % temp hack
{\removeunwantedspaces
\doifelseitalic\/\donothing % Charles IV \footnote{the fourth}
- \ifdim\lastkern=\d_strc_notes_signal
+ \ifnum\lastboundary=\noteboundary
+ \unboundary
% \kern\noteparameter\c!distance % yes or no note font? or main text
\strc_notes_inject_separator
\fi
\nobreak
\hpack to .5\emwidth{}%
- \glet\lastnotesymbol\empty}
+ \glettonothing\lastnotesymbol}
\protected\def\strc_notes_inject_separator % patch by WS due to request on list
{\edef\p_textseparator{\noteparameter\c!textseparator}%
@@ -732,8 +749,7 @@
% skip or kern
\nobreak
\hbox\bgroup
- \strc_notes_interaction_check_inline
- \strc_notes_set_style_color_inline\c!textstyle\c!textcolor
+ \usenotestyleandcolor\c!textstyle\c!textcolor
\noteparameter\c!textcommand{\p_textseparator}%
\kern\noteparameter\c!distance
\egroup
@@ -885,16 +901,16 @@
\def\strc_notes_set_rule_autodir
{\doifelserighttoleftinbox\currentnoteinsertionnumber\righttoleft\lefttoright}
-\setvalue{\??noterule \v!command}{\letcurrentnoterulecommand\currentnoterulecommandcommand}
-\setvalue{\??noterule \v!on}{\letcurrentnoterulecommand\currentnoterulecommandnormal}
-\setvalue{\??noterule \v!normal}{\letcurrentnoterulecommand\currentnoterulecommandnormal}
-\setvalue{\??noterule \v!left}{\letcurrentnoterulecommand\currentnoterulecommandnormal
- \letcurrentnoterulealign \lefttoright}
-\setvalue{\??noterule \v!right}{\letcurrentnoterulecommand\currentnoterulecommandnormal
- \letcurrentnoterulealign \righttoleft}
-\setvalue{\??noterule\v!paragraph}{\letcurrentnoterulecommand\currentnoterulecommandnormal
- \letcurrentnoterulealign \strc_notes_set_rule_autodir}
-\setvalue{\??noterule \v!off}{\letcurrentnoterulecommand\relax}
+\defcsname\??noterule \v!command\endcsname{\letcurrentnoterulecommand\currentnoterulecommandcommand}
+\defcsname\??noterule \v!on\endcsname{\letcurrentnoterulecommand\currentnoterulecommandnormal}
+\defcsname\??noterule \v!normal\endcsname{\letcurrentnoterulecommand\currentnoterulecommandnormal}
+\defcsname\??noterule \v!left\endcsname{\letcurrentnoterulecommand\currentnoterulecommandnormal
+ \letcurrentnoterulealign \lefttoright}
+\defcsname\??noterule \v!right\endcsname{\letcurrentnoterulecommand\currentnoterulecommandnormal
+ \letcurrentnoterulealign \righttoleft}
+\defcsname\??noterule\v!paragraph\endcsname{\letcurrentnoterulecommand\currentnoterulecommandnormal
+ \letcurrentnoterulealign \strc_notes_set_rule_autodir}
+\defcsname\??noterule \v!off\endcsname{\letcurrentnoterulecommand\relax}
\appendtoks
\strc_notes_set_rule
@@ -911,10 +927,10 @@
\setnewconstant\notepenaltystrict 9999
\setnewconstant\notepenaltyverystrict\maxdimen
-\letvalue{\??notepenalty\v!tolerant }\notepenaltytolerant
-\letvalue{\??notepenalty\v!strict }\notepenaltystrict
-\letvalue{\??notepenalty\v!verystrict}\notepenaltyverystrict
-\letvalue{\??notepenalty }\notepenaltytolerant
+\letcsname\??notepenalty\v!tolerant \endcsname\notepenaltytolerant
+\letcsname\??notepenalty\v!strict \endcsname\notepenaltystrict
+\letcsname\??notepenalty\v!verystrict\endcsname\notepenaltyverystrict
+\letcsname\??notepenalty \endcsname\notepenaltytolerant
%D The following switch can be used to disable limiting the height of the footnote
%D area, something that is needed in multi column balancing. Use this switch with
@@ -927,7 +943,7 @@
\ifempty\p_factor \else
\ifnum\p_factor<\zerocount \else
% \global
- \count\currentnoteinsertionnumber\p_factor % new: global
+ \page_inserts_set_multiplier\currentnoteinsertionnumber\p_factor % new: global
\fi
\fi}
@@ -943,28 +959,49 @@
\installcorenamespace{notelocation}
\newconditional\c_strc_notes_delayed
+\newconditional\c_strc_notes_flushed
+
+\protected\def\strc_notes_set_delayed_yes{\settrue \c_strc_notes_delayed\setfalse\c_strc_notes_flushed}
+\protected\def\strc_notes_set_delayed_nop{\setfalse\c_strc_notes_delayed\setfalse\c_strc_notes_flushed}
+\protected\def\strc_notes_set_delayed_lst{\settrue \c_strc_notes_delayed\settrue \c_strc_notes_flushed}
+
+\defcsname\??notelocation\v!page\endcsname
+ {\letcsname\??notedelayedvariant \currentnote\endcsname\strc_notes_set_delayed_nop
+ \letcsname\??notelocationvariant\currentnote\endcsname\strc_notes_set_location_page}
+
+\defcsname\??notelocation\v!columns\endcsname
+ {\letcsname\??notedelayedvariant \currentnote\endcsname\strc_notes_set_delayed_nop
+ \letcsname\??notelocationvariant\currentnote\endcsname\strc_notes_set_location_columns}
+
+\defcsname\??notelocation\v!lastcolumn\endcsname
+ {\letcsname\??notedelayedvariant \currentnote\endcsname\strc_notes_set_delayed_nop
+ \letcsname\??notelocationvariant\currentnote\endcsname\strc_notes_set_location_lastcolumn}
+
+\defcsname\??notelocation\v!firstcolumn\endcsname
+ {\letcsname\??notedelayedvariant \currentnote\endcsname\strc_notes_set_delayed_nop
+ \letcsname\??notelocationvariant\currentnote\endcsname\strc_notes_set_location_firstcolumn}
+
+\defcsname\??notelocation\v!none\endcsname
+ {\letcsname\??notedelayedvariant \currentnote\endcsname\strc_notes_set_delayed_yes
+ \letcsname\??notelocationvariant\currentnote\endcsname\strc_notes_set_location_none}
+
+\defcsname\??notelocation\v!list\endcsname
+ {\letcsname\??notedelayedvariant \currentnote\endcsname\strc_notes_set_delayed_lst
+ \letcsname\??notelocationvariant\currentnote\endcsname\strc_notes_set_location_none}
+
+\defcsname\??notelocation\v!text\endcsname
+ {\letcsname\??notedelayedvariant \currentnote\endcsname\strc_notes_set_delayed_yes
+ \letcsname\??notelocationvariant\currentnote\endcsname\strc_notes_set_location_text}
-\protected\def\strc_notes_set_delayed_yes{\settrue \c_strc_notes_delayed}
-\protected\def\strc_notes_set_delayed_nop{\setfalse\c_strc_notes_delayed}
-
-\setvalue{\??notelocation\v!page }{\letcsname\??notedelayedvariant \currentnote\endcsname\strc_notes_set_delayed_nop
- \letcsname\??notelocationvariant\currentnote\endcsname\strc_notes_set_location_page}
-\setvalue{\??notelocation\v!columns }{\letcsname\??notedelayedvariant \currentnote\endcsname\strc_notes_set_delayed_nop
- \letcsname\??notelocationvariant\currentnote\endcsname\strc_notes_set_location_columns}
-\setvalue{\??notelocation\v!lastcolumn }{\letcsname\??notedelayedvariant \currentnote\endcsname\strc_notes_set_delayed_nop
- \letcsname\??notelocationvariant\currentnote\endcsname\strc_notes_set_location_lastcolumn}
-\setvalue{\??notelocation\v!firstcolumn}{\letcsname\??notedelayedvariant \currentnote\endcsname\strc_notes_set_delayed_nop
- \letcsname\??notelocationvariant\currentnote\endcsname\strc_notes_set_location_firstcolumn}
-\setvalue{\??notelocation\v!none }{\letcsname\??notedelayedvariant \currentnote\endcsname\strc_notes_set_delayed_yes
- \letcsname\??notelocationvariant\currentnote\endcsname\strc_notes_set_location_none}
-\setvalue{\??notelocation\v!text }{\letcsname\??notedelayedvariant \currentnote\endcsname\strc_notes_set_delayed_yes
- \letcsname\??notelocationvariant\currentnote\endcsname\strc_notes_set_location_text}
-\setvalue{\??notelocation\v!high }{\letcsname\??notepositionvariant\currentnote\endcsname\strc_notes_set_position_high}
-\setvalue{\??notelocation\v!bottom }{\letcsname\??notepositionvariant\currentnote\endcsname\strc_notes_set_position_bottom}
-
-\setvalue{\??notedelayedvariant \??notedelayedvariant }{\strc_notes_set_delayed_nop} % not let
-\setvalue{\??notepositionvariant\??notepositionvariant}{\strc_notes_set_position_bottom} % not let
-\setvalue{\??notelocationvariant\??notelocationvariant}{\strc_notes_set_location_page} % not let
+\defcsname\??notelocation\v!high\endcsname
+ {\letcsname\??notepositionvariant\currentnote\endcsname\strc_notes_set_position_high}
+
+\defcsname\??notelocation\v!bottom\endcsname
+ {\letcsname\??notepositionvariant\currentnote\endcsname\strc_notes_set_position_bottom}
+
+\defcsname\??notedelayedvariant \??notedelayedvariant \endcsname{\strc_notes_set_delayed_nop } % not \let
+\defcsname\??notepositionvariant\??notepositionvariant\endcsname{\strc_notes_set_position_bottom} % not \let
+\defcsname\??notelocationvariant\??notelocationvariant\endcsname{\strc_notes_set_location_page } % not \let
\protected\def\strc_notes_set_delayed
{\csname\??notedelayedvariant
@@ -1004,13 +1041,14 @@
\strc_notes_set_delayed
\to \everysynchronizenote
-\newskip \s_strc_notes_distance % we need to implement stretch
-\newcount\c_strc_notes_columns
-
-\newskip \s_strc_notes_before
-\newskip \s_strc_notes_inbetween
+\newgluespec \s_strc_notes_distance % we need to implement stretch
+\newinteger \c_strc_notes_columns
+\newgluespec \s_strc_notes_before
+\newgluespec \s_strc_notes_inbetween
\newconditional\c_strc_notes_first_flushed
+% we can store them per insert so so real need to redo it
+
\appendtoks
\edef\p_spacebefore{\rootnoteparameter\c!spacebefore}%
\ifempty\p_spacebefore
@@ -1018,7 +1056,7 @@
\else
\setbox\scratchbox\vbox{\blank[\p_spacebefore]\global\s_strc_notes_before\lastskip}%
\fi
- \edef\p_spaceinbetween{\rootnoteparameter\c!spaceinbetween}%
+ \edef\p_spaceinbetween{\noteparameter\c!spaceinbetween}%
\ifempty\p_spaceinbetween
\global\s_strc_notes_inbetween\zeropoint
\else
@@ -1055,10 +1093,10 @@
{\setfalse\c_strc_notes_delayed
\strc_notes_set_distance
\strc_notes_set_columns
- \page_inserts_set_location\currentnoteinsertion\v!page % \setupinsertion[\currentnote][\c!location=\v!page]%
- \global\count\currentnoteinsertionnumber\numexpr(\plusthousand/\c_strc_notes_columns)*\nofmulticolumns\relax
- \global\dimen\currentnoteinsertionnumber\ifnotelimit\dimexpr\noteparameter\c!height*\c_strc_notes_columns\relax\else\maxdimen\fi
- \global\skip \currentnoteinsertionnumber\s_strc_notes_distance}
+ \page_inserts_set_location \currentnoteinsertion\v!page % \setupinsertion[\currentnote][\c!location=\v!page]%
+ \page_inserts_set_multiplier\currentnoteinsertionnumber\numexpr(\plusthousand/\c_strc_notes_columns)*\nofmulticolumns\relax
+ \page_inserts_set_limit \currentnoteinsertionnumber\ifnotelimit\dimexpr\noteparameter\c!height*\c_strc_notes_columns\relax\else\maxdimen\fi
+ \page_inserts_set_distance \currentnoteinsertionnumber\s_strc_notes_distance}
\def\strc_notes_set_location_columns
{\setfalse\c_strc_notes_delayed
@@ -1068,19 +1106,19 @@
\ifnum\nofcolumns=\zerocount
\c_strc_notes_columns\plusone
\fi
- \page_inserts_set_location\currentnoteinsertion\v!columns % \setupinsertion[\currentnote][\c!location=\v!columns]%
- \global\count\currentnoteinsertionnumber\numexpr\plusthousand/\c_strc_notes_columns\relax
- \global\dimen\currentnoteinsertionnumber\ifnotelimit\dimexpr\noteparameter\c!height*\c_strc_notes_columns\relax\else\maxdimen\fi
- \global\skip \currentnoteinsertionnumber\s_strc_notes_distance}
+ \page_inserts_set_location \currentnoteinsertion\v!columns % \setupinsertion[\currentnote][\c!location=\v!columns]%
+ \page_inserts_set_multiplier\currentnoteinsertionnumber\numexpr\plusthousand/\c_strc_notes_columns\relax
+ \page_inserts_set_limit \currentnoteinsertionnumber\ifnotelimit\dimexpr\noteparameter\c!height*\c_strc_notes_columns\relax\else\maxdimen\fi
+ \page_inserts_set_distance \currentnoteinsertionnumber\s_strc_notes_distance}
\def\strc_notes_set_location_somecolumn#whatcolumn%
{\setfalse\c_strc_notes_delayed
\strc_notes_set_distance
\strc_notes_set_columns
- \page_inserts_set_location\currentnoteinsertion#whatcolumn% \setupinsertion[\currentnote][\c!location=#whatcolumn]%
- \global\count\currentnoteinsertionnumber\plusthousand
- \global\dimen\currentnoteinsertionnumber\ifnotelimit\noteparameter\c!height\else\maxdimen\fi
- \global\skip \currentnoteinsertionnumber\s_strc_notes_distance}
+ \page_inserts_set_location \currentnoteinsertion#whatcolumn% \setupinsertion[\currentnote][\c!location=#whatcolumn]%
+ \page_inserts_set_multiplier\currentnoteinsertionnumber\plusthousand
+ \page_inserts_set_limit \currentnoteinsertionnumber\ifnotelimit\noteparameter\c!height\else\maxdimen\fi
+ \page_inserts_set_distance \currentnoteinsertionnumber\s_strc_notes_distance}
\def\strc_notes_set_location_firstcolumn{\strc_notes_set_location_somecolumn\v!firstcolumn}
\def\strc_notes_set_location_lastcolumn {\strc_notes_set_location_somecolumn\v!lastcolumn }
@@ -1088,10 +1126,10 @@
\def\strc_notes_set_location_text % we don't use inserts anyway (e.g. endnotes)
{\settrue\c_strc_notes_delayed
\clf_setnotestate{\currentnote}{store}%
- \page_inserts_set_location\currentnoteinsertion\v!text % \setupinsertion[\currentnote][\c!location=\v!text]%
- \global\count\currentnoteinsertionnumber\zerocount
- \global\dimen\currentnoteinsertionnumber\maxdimen
- \global\skip \currentnoteinsertionnumber\zeropoint}
+ \page_inserts_set_location \currentnoteinsertion\v!text % \setupinsertion[\currentnote][\c!location=\v!text]%
+ \page_inserts_set_multiplier\currentnoteinsertionnumber\zerocount
+ \page_inserts_set_limit \currentnoteinsertionnumber\maxdimen
+ \page_inserts_set_distance \currentnoteinsertionnumber\zeropoint}
\let\strc_notes_set_location_none\strc_notes_set_location_text
@@ -1114,8 +1152,13 @@
\newconditional\c_notes_bottom_present
+% \def\strc_notes_check_if_bottom_present_indeed % in otr !
+% {\ifvoid\currentnoteinsertionnumber\else
+% \strc_notes_set_position
+% \fi}
+
\def\strc_notes_check_if_bottom_present_indeed % in otr !
- {\ifvoid\currentnoteinsertionnumber\else
+ {\ifzeropt\page_inserts_get_height\currentnoteinsertionnumber\else
\strc_notes_set_position
\fi}
@@ -1261,7 +1304,9 @@
\begstrut
\strc_references_flush_destination_nodes
\strc_notes_set_destination_attribute_text
- \strc_notes_inject_text\relax
+ \ifconditional\c_strc_notes_flushed\else
+ \strc_notes_inject_text\relax
+ \fi
\ifvmode\obeydepth\else\endstrut\fi % \obeydepth is new per 2015-01-10
\strc_constructions_stored_stop
%endgroup
@@ -1270,7 +1315,9 @@
\protected\def\strc_notes_inject_text % hm main?
{\clf_savedlisttitle{\currentconstructionmain}\currentconstructionlistentry\relax}
-\newsignal\d_strc_notes_signal
+\installstructurelistprocessor{construction}{\usestructurelistprocessor{section}}
+
+\newboundary\noteboundary
\newconditional\processingnote
\newconditional\postponednote
@@ -1287,8 +1334,8 @@
\fi}
\appendtoks
- \enforced\let\flushnotes \relax
- \enforced\let\postponenotes\relax
+ \enforced\lettonothing\flushnotes
+ \enforced\lettonothing\postponenotes
\forgetall
\resetallattributes % new, we don't want color bleed into notes
\inheritmaintextcolor % but we do want to obey the textcolor
@@ -1296,7 +1343,8 @@
\def\strc_notes_set_penalties
{% stored in insert node
- \floatingpenalty \currentnotepenalty
+ \floatingpenalty \currentnotepenalty % now per note
+ \page_inserts_set_penalty\currentnoteinsertionnumber\currentnotepenalty
% used when typesetting
\interlinepenalty\plushundred % plain value
% used when we need to split in columns
@@ -1311,6 +1359,7 @@
\redoconvertfont % to undo \undo calls in in headings etc
\splittopskip\strutht % not actually needed here
\splitmaxdepth\strutdp % not actually needed here
+\page_inserts_set_maxdepth \currentnoteinsertionnumber\strutdp
%
% not:
%
@@ -1337,22 +1386,33 @@
\setupnotes
[\c!width=\v!auto]
+% \permanent\protected\def\setnotehsize
+% {\ifinsidemulticolumns
+% \setnoteparameter\c!width{\makeupwidth}%
+% \else
+% \edef\p_width{\noteparameter\c!width}%
+% \ifx\p_width\v!auto
+% % \ifinsidecolumns
+% \setnoteparameter\c!width{\ifdim\hsize<\makeupwidth\hsize\else\makeupwidth\fi}%
+% % \else
+% % \setnoteparameter\c!width{\makeupwidth}%
+% % \fi
+% \orelse\ifempty\p_width
+% \setnoteparameter\c!width{\hsize}%
+% \fi
+% \fi
+% \hsize\noteparameter\c!width\relax}
+%
+% We construct immediately and migrate so:
+
\permanent\protected\def\setnotehsize
- {\ifinsidemulticolumns
+ {\edef\p_width{\noteparameter\c!width}%
+ \ifx\p_width\v!auto
+ % intercept old value
+ \let\p_width\makeupwidth
\setnoteparameter\c!width{\makeupwidth}%
- \else
- \edef\p_width{\noteparameter\c!width}%
- \ifx\p_width\v!auto
- % \ifinsidecolumns
- \setnoteparameter\c!width{\ifdim\hsize<\makeupwidth\hsize\else\makeupwidth\fi}%
- % \else
- % \setnoteparameter\c!width{\makeupwidth}%
- % \fi
- \orelse\ifempty\p_width
- \setnoteparameter\c!width{\hsize}%
- \fi
- \fi
- \hsize\noteparameter\c!width\relax}
+ \fi
+ \hsize\p_width\relax}
\appendtoks
% only needed when columns (could be three \set...)
@@ -1377,7 +1437,8 @@
\def\strc_notes_place_inserts
{\strc_notes_set_delayed % \strc_notes_synchronize % we need to know if it's delayed
\ifconditional\c_strc_notes_delayed \else
- \ifdim\ht\currentnoteinsertionnumber>\zeropoint % or a faster delayed test
+% \ifdim\ht\currentnoteinsertionnumber>\zeropoint % or a faster delayed test
+ \ifcase\page_inserts_get_height\currentnoteinsertionnumber\else
\strc_notes_place_inserts_indeed
\settrue\c_strc_notes_first_placed
\fi
@@ -1385,7 +1446,8 @@
\def\strc_notes_place_inserts_indeed
{\relax
- \ifdim\ht\currentnoteinsertionnumber>\zeropoint
+% \ifdim\ht\currentnoteinsertionnumber>\zeropoint
+ \ifcase\page_inserts_get_height\currentnoteinsertionnumber\else
\endgraf
\ifvmode
\whitespace
@@ -1395,7 +1457,7 @@
\blank[\p_spaceinbetween]%
\fi
\else
- \edef\p_spacebefore{\noteparameter\c!spacebefore}%
+ \edef\p_spacebefore{\rootnoteparameter\c!spacebefore}%
\ifempty\p_spacebefore\else
\blank[\p_spacebefore]%
\fi
@@ -1463,9 +1525,19 @@
\doifelse{\noteparameter\c!paragraph}\v!yes
{\leftorrightvbox % cf mail from ws to list
{\starthboxestohbox
- \iftrialtypesetting\unvcopy\else\unvbox\fi\currentnoteinsertionnumber
+ \iftrialtypesetting
+ \page_inserts_get_uncopied
+ \else
+ \page_inserts_get_unboxed
+ \fi
+ \currentnoteinsertionnumber
\stophboxestohbox}}
- {\iftrialtypesetting\unvcopied\else\unvboxed\fi\currentnoteinsertionnumber}%
+ {\iftrialtypesetting
+ \ifvmode\page_inserts_get_uncopied\else\page_inserts_get_copied\fi
+ \else
+ \ifvmode\page_inserts_get_unboxed \else\page_inserts_get_boxed \fi
+ \fi
+ \currentnoteinsertionnumber}%
\endgroup}
%D Supporting end notes is surprisingly easy. Even better, we can combine this
@@ -1505,7 +1577,7 @@
\fi
\fi}
-\aliased\let\flushnotes\relax
+\permanent\lettonothing\flushnotes
% also \ifcase\insertionmigrationmode here, needs testing:
@@ -1522,8 +1594,8 @@
\permanent\protected\def\doflushnotes
{\ifconditional\postponingnotes
\begingroup
- \enforced\let\flushnotes \relax
- \enforced\let\postponenotes\relax
+ \enforced\lettonothing\flushnotes
+ \enforced\lettonothing\postponenotes
\ifconditional\postponednote
\ifhmode
% needed for tagging ... otherwise we get some weird node free error
@@ -1533,7 +1605,7 @@
\clf_flushpostponednotes% this also resets the states !
\global\setfalse\postponednote
\global\setfalse\postponingnotes
- \enforced\glet\flushnotes\relax
+ \enforced\glettonothing\flushnotes
\endgroup
\fi}
@@ -1551,13 +1623,13 @@
\newtoks\everyplacelocalnotes
\appendtoks
- \enforced\let\flushnotes \relax
- \enforced\let\postponenotes\relax
+ \enforced\lettonothing\flushnotes
+ \enforced\lettonothing\postponenotes
\to \everyplacelocalnotes
\newconditional\inlocalnotes
-\mutable\let\localnoteslist\empty
+\mutable\lettonothing\localnoteslist
\permanent\tolerant\protected\def\startlocalnotes[#list]% grouping ? (we used to have a second argument ... settings)
{\settrue\inlocalnotes
@@ -1568,7 +1640,7 @@
{\processcommacommand[\localnoteslist]\strc_notes_local_stop_step
\setfalse\inlocalnotes}
-\let\p_strc_notes_continue\empty
+\lettonothing\p_strc_notes_continue
\def\strc_notes_local_start_step#tag%
{\p_strc_notes_continue{\noteparameter\c!continue}%
@@ -1658,7 +1730,7 @@
\installcorenamespace{notealternative}
\permanent\protected\def\installnotealternative#alternative#command%
- {\setvalue{\??notealternative#alternative}{#command}}
+ {\defcsname\??notealternative#alternative\endcsname{#command}}
\permanent\protected\def\doifnotescollected#tag%
{\clf_doifnotecontent{#tag}}
@@ -1672,7 +1744,7 @@
\fi
\begingroup
\strc_notes_set_bodyfont
- \csname\??notealternative\noteparameter\c!alternative\endcsname
+ \begincsname\??notealternative\noteparameter\c!alternative\endcsname
\endgroup
\ifvmode
\noteparameter\c!after
@@ -1743,7 +1815,8 @@
\strc_notes_process\strc_notes_check_presence}
\def\strc_notes_check_presence
- {\ifdim\ht\currentnoteinsertionnumber>\zeropoint
+% {\ifdim\page_inserts_get_height\currentnoteinsertionnumber>\zeropoint % not reliable
+ {\ifcase\page_inserts_get_height\currentnoteinsertionnumber\else
\notespresenttrue
\fi}
@@ -1772,29 +1845,28 @@
\permanent\protected\def\additionaltotalnoteheight#insert% temp hacks anyway
{\dimexpr
- \ifdim\ht#insert>\zeropoint
- \ifcase\count#insert %
- \zeropoint
- \else % todo: divide by count
- \ht#insert+\skip#insert% hm, no stretch but a dimen anyway
- \fi
- \else
+ \ifnum\page_inserts_get_height#insert=\zeropoint
+ \zeropoint
+ \orelse\ifnum\page_inserts_get_multiplier#insert=\zeropoint
\zeropoint
+ \else % todo: divide by count
+ \page_inserts_get_height #insert
+ +\page_inserts_get_distance#insert% hm, no stretch but a dimen anyway
\fi
\relax}
\permanent\def\docalculatetotalnoteheight
{\ifcase\c_strc_notes_page_location % tricky here ! ! ! to be sorted out ! ! !
- \advance\totalnoteheight\normalexpanded{\additionaltotalnoteheight\currentnoteinsertionnumber}%
+ \advanceby\totalnoteheight\normalexpanded{\additionaltotalnoteheight\currentnoteinsertionnumber}%
\fi}
\permanent\def\docalculatetotalclevernoteheight
{\ifcase\c_strc_notes_page_location \else % tricky here ! ! ! to be sorted out ! ! !
- \advance\totalnoteheight\normalexpanded{\additionaltotalnoteheight\currentnoteinsertionnumber}%
+ \advanceby\totalnoteheight\normalexpanded{\additionaltotalnoteheight\currentnoteinsertionnumber}%
\fi}
\permanent\def\docalculatetotalpagenoteheight
- {\advance\totalnoteheight\normalexpanded{\additionaltotalnoteheight\currentnoteinsertionnumber}}
+ {\advanceby\totalnoteheight\normalexpanded{\additionaltotalnoteheight\currentnoteinsertionnumber}}
\permanent\def\calculatetotalnoteheight {\totalnoteheight\zeropoint\strc_notes_process\docalculatetotalnoteheight}
\permanent\def\calculatetotalclevernoteheight{\totalnoteheight\zeropoint\strc_notes_process\docalculatetotalclevernoteheight}
@@ -1901,9 +1973,9 @@
\installcorenamespace{notesymbol}
-\mutable\let\lastnotesymbol\empty % todo: per class
+\mutable\lettonothing\lastnotesymbol % todo: per class
-\permanent\tolerant\protected\def\notesymbol[#tag]#spacer[#reference]%
+\permanent\tolerant\protected\def\notesymbol[#tag]#keepspacer[#reference]%
{\ifnotesenabled
\dontleavehmode
\begingroup
@@ -1918,7 +1990,7 @@
\endgroup
\fi}
-\permanent\tolerant\protected\def\note[#tag]#spacer[#reference]%
+\permanent\tolerant\protected\def\note[#tag]#keepspacer[#reference]%
{\iftok{#reference}\emptytoks
\notesymbol[\v!footnote][#tag]%
\else
@@ -1932,7 +2004,7 @@
%
% \protected\def\setnotesymbol[#1]#2#3%
% {\prewordbreak % prevent lookback
-% \setgvalue{\??notesymbol#1}{#3}
+% \gdefcsname\??notesymbol#1\endcsname{#3}
% \strc_notes_inject_symbol}
%
% \protected\def\ownnote[#1]#2#3#4%
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-num.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-num.mkxl
index 02674bce29c..3f3bd21430d 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/strc-num.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-num.mkxl
@@ -70,7 +70,7 @@
\edef\p_number{\counterparameter\c!number}%
\ifempty\p_number \else
\clf_setcounter{\counterparameter\s!name}\numexpr\p_number\relax
- \letcounterparameter\c!number\empty
+ \resetcounterparameter\c!number
\fi
\edef\p_start{\counterparameter\c!start}%
\setexpandedcounterparameter\c!start{\ifempty\p_start0\else\number\p_start\fi}%
@@ -378,8 +378,8 @@
% currentstructurecomponent => \strc_current_ or just \m_strc_
-\mutable\let\currentname \empty
-\mutable\let\currentcounter\empty
+\mutable\lettonothing\currentname
+\mutable\lettonothing\currentcounter
\protected\def\strc_counters_register_component#1#2#3#4#5#6#7[#8][#9]% maybe also nolist
{\begingroup
@@ -426,7 +426,7 @@
\let\currentstructurecomponentreferenceprefix\referenceprefix
\fi
\ifdefined\currentstructurecomponentreferenceprefix\else
- \let\currentstructurecomponentreferenceprefix\empty
+ \lettonothing\currentstructurecomponentreferenceprefix
\fi}
\def\strc_counters_register_component_page#1%
@@ -454,13 +454,17 @@
\def\strc_counters_register_component_list#1#2#3#4%
{\xdef\currentstructurecomponentname {#2\s!name}%
- \xdef\currentstructurecomponentlevel {#2\c!level}%
+ \xdef\currentstructurecomponentcounter {#2\s!counter}%
+ \xdef\currentstructurecomponentlevel {#2\s!haslevel}%
\edef\currentstructurecomponentexpansion {#2\c!expansion}%
\xdef\currentstructurecomponentxmlsetup {#2\c!xmlsetup}%
\xdef\currentstructurecomponentcatcodes {#2\s!catcodes}%
\xdef\currentstructurecomponentlabel {#2\c!label}%
\xdef\currentstructurecomponentreference {#2\c!reference}%
\xdef\currentstructurecomponentreferenceprefix{#2\c!referenceprefix}%
+ \ifempty\currentstructurecomponentcounter
+ \glet\currentstructurecomponentcounter\currentcounter
+ \fi
\strc_counters_register_component_check_prefix
\ifx\currentstructurecomponentexpansion\s!xml
\xmlstartraw
@@ -533,7 +537,7 @@
list {\detokenize\expandafter{\currentstructurecomponentlist}}
\fi
}
- \ifx\p_hasnumber\v!yes
+ \ifx\p_hasnumber\v!yes\ifempty\currentstructurecomponentcounter\else
prefixdata {
prefix {#2\c!prefix}
separatorset {#2\c!prefixseparatorset}
@@ -545,10 +549,13 @@
connector {#2\c!prefixconnector}
}
numberdata { % more helpers here, like compact elsewhere
- numbers {\currentcounter}
+ \ifempty\currentstructurecomponentlevel\else
+ level \currentstructurecomponentlevel
+ \fi
+ numbers {\currentstructurecomponentcounter}
group {#2\c!group}
groupsuffix {#2\c!groupsuffix}
- counter {\currentcounter}
+ counter {\currentstructurecomponentcounter}
separatorset {#2\c!numberseparatorset}
conversion {#2\c!numberconversion}
conversionset {#2\c!numberconversionset}
@@ -556,7 +563,7 @@
stopper {#2\c!numberstopper}
segments {#2\c!numbersegments}
}
- \fi
+ \fi\fi
userdata {\detokenize{#4}}
%}
\relax
@@ -659,7 +666,7 @@
% \ifempty#2%
% \the#5%
% \else
-% \let\currentcounter\empty
+% \lettonothing\currentcounter
% \the\everysetupcounter
% \fi
% \strc_counter_setup_pop}%
@@ -681,7 +688,7 @@
% \edef\p_number{\counterparameter\c!number}%
% \ifempty\p_number \else
% \strc_counters_set\currentcounter\p_number
-% \letcounterparameter\c!number\empty
+% \resetcounterparameter\c!number
% \fi
% \fi
% \to \everysetupcounter
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-pag.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-pag.mkxl
index c27fd942953..2da56506768 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/strc-pag.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-pag.mkxl
@@ -21,12 +21,14 @@
% Allocation:
-\ifdefined\realpageno \else \permanent\countdef\realpageno \zerocount \fi \realpageno \plusone
-\ifdefined\userpageno \else \permanent\countdef\userpageno \plusone \fi \userpageno \plusone
-\ifdefined\subpageno \else \permanent\countdef\subpageno \plustwo \fi \subpageno \plusone % was \zerocount but that doesn't work well with bytext
-\ifdefined\arrangeno \else \permanent\countdef\arrangeno \plusthree \fi \arrangeno \zerocount % !
-\ifdefined\pagenoshift \else \permanent\countdef\pagenoshift\plusfour \fi \pagenoshift\zerocount % !
-\ifdefined\lastpageno \else \permanent\countdef\lastpageno \plusfive \fi \lastpageno \zerocount % !
+\ifdefined\realpageno \else \permanent\countdef\realpageno \zerocount \fi \realpageno \plusone
+\ifdefined\userpageno \else \permanent\countdef\userpageno \plusone \fi \userpageno \plusone
+\ifdefined\subpageno \else \permanent\countdef\subpageno \plustwo \fi \subpageno \plusone % was \zerocount but that doesn't work well with bytext
+\ifdefined\arrangeno \else \permanent\countdef\arrangeno \plusthree \fi \arrangeno \zerocount % !
+\ifdefined\pagenoshift \else \permanent\countdef\pagenoshift \plusfour \fi \pagenoshift \zerocount % !
+\ifdefined\lastpageno \else \permanent\countdef\lastpageno \plusfive \fi \lastpageno \zerocount % !
+\ifdefined\lastuserpageno\else \permanent\countdef\lastuserpageno\plussix \fi \lastuserpageno\zerocount % !
+\ifdefined\lastsubpageno \else \permanent\countdef\lastsubpageno \plusseven \fi \lastsubpageno \zerocount % !
\ifdefined\pageno \else \aliased\let\pageno\userpageno \fi
@@ -101,7 +103,9 @@
\strc_counters_set\s!realpage\realpageno
\strc_counters_set\s!userpage\userpageno
\strc_counters_set\s!subpage \subpageno
- \lastpageno\lastcountervalue[\s!realpage]\relax
+ \lastpageno \lastcountervalue[\s!realpage]\relax
+ \lastuserpageno\lastcountervalue[\s!userpage]\relax
+ \lastsubpageno \lastcountervalue[\s!subpage ]\relax
\to \everyinitializepagecounters
\aliased\let\setuppagenumber\setupuserpagenumber
@@ -233,7 +237,7 @@
\strc_pagenumbers_decrement_counters
\to \everygoodbye
-\newcount\c_strc_subpage_first_real \c_strc_subpage_first_real\plusone
+\newinteger\c_strc_subpage_first_real \c_strc_subpage_first_real\plusone
\appendtoks
\ifcase\subpageno\relax
@@ -288,14 +292,14 @@
\permanent\protected\def\decrementpagenumber{\csname\??pagenumberdec\namedcounterparameter\s!userpage\c!state\endcsname}
\permanent\protected\def\incrementpagenumber{\csname\??pagenumberinc\namedcounterparameter\s!userpage\c!state\endcsname}
-\letvalue{\??pagenumberdec\v!start}\strc_pagenumbers_decrement_userpage
-\letvalue{\??pagenumberdec\v!none }\strc_pagenumbers_decrement_userpage
-\letvalue{\??pagenumberdec\v!empty}\strc_pagenumbers_decrement_userpage
+\letcsname\??pagenumberdec\v!start\endcsname\strc_pagenumbers_decrement_userpage
+\letcsname\??pagenumberdec\v!none \endcsname\strc_pagenumbers_decrement_userpage
+\letcsname\??pagenumberdec\v!empty\endcsname\strc_pagenumbers_decrement_userpage
-\letvalue{\??pagenumberinc\v!start}\strc_pagenumbers_increment_userpage
-\letvalue{\??pagenumberinc\v!none }\strc_pagenumbers_increment_userpage
-\setvalue{\??pagenumberinc\v!empty}{\strc_pagenumbers_increment_userpage\strc_pagenumbers_synchronize_userpage}
-\letvalue{\??pagenumberinc\v!keep }\strc_pagenumbers_synchronize_userpage
+\letcsname\??pagenumberinc\v!start\endcsname\strc_pagenumbers_increment_userpage
+\letcsname\??pagenumberinc\v!none \endcsname\strc_pagenumbers_increment_userpage
+\defcsname\??pagenumberinc\v!empty\endcsname{\strc_pagenumbers_increment_userpage\strc_pagenumbers_synchronize_userpage}
+\letcsname\??pagenumberinc\v!keep \endcsname\strc_pagenumbers_synchronize_userpage
% Setup general page numbering
@@ -335,12 +339,22 @@
\let\strc_pagenumbers_set_location\relax
\fi
+% \protected\def\strc_pagenumbers_flush_final_page
+% {\edef\p_strc_pagenumbers_page{\directpagenumberingparameter\c!page}%
+% \ifempty\p_strc_pagenumbers_page \else
+% \ifx\p_strc_pagenumbers_page\v!no \else
+% \page[\p_strc_pagenumbers_page]%
+% \fi
+% \fi}
+
\protected\def\strc_pagenumbers_flush_final_page
{\edef\p_strc_pagenumbers_page{\directpagenumberingparameter\c!page}%
- \ifempty\p_strc_pagenumbers_page \else
- \ifx\p_strc_pagenumbers_page\v!no \else
- \page[\p_strc_pagenumbers_page]%
- \fi
+ \ifempty\p_strc_pagenumbers_page
+ % nothing
+ \orelse\ifx\p_strc_pagenumbers_page\v!no
+ % nothing
+ \else
+ \page[\p_strc_pagenumbers_page]%
\fi}
% The numbered location handler is there because we need to be downward
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-ref.lmt b/Master/texmf-dist/tex/context/base/mkxl/strc-ref.lmt
new file mode 100644
index 00000000000..b97a1619b3f
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-ref.lmt
@@ -0,0 +1,2974 @@
+if not modules then modules = { } end modules ['strc-ref'] = {
+ version = 1.001,
+ comment = "companion to strc-ref.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- beware, this is a first step in the rewrite (just getting rid of
+-- the tuo file); later all access and parsing will also move to lua
+
+-- the useddata and pagedata names might change
+-- todo: pack exported data
+
+-- todo: autoload components when :::
+
+local format, gmatch, match, strip = string.format, string.gmatch, string.match, string.strip
+local floor = math.floor
+local rawget, tonumber, type, next = rawget, tonumber, type, next
+local lpegmatch = lpeg.match
+local insert, remove, copytable = table.insert, table.remove, table.copy
+local formatters = string.formatters
+local P, Cs, lpegmatch = lpeg.P, lpeg.Cs, lpeg.match
+
+local allocate = utilities.storage.allocate
+local mark = utilities.storage.mark
+local setmetatableindex = table.setmetatableindex
+
+local trace_referencing = false trackers.register("structures.referencing", function(v) trace_referencing = v end)
+local trace_analyzing = false trackers.register("structures.referencing.analyzing", function(v) trace_analyzing = v end)
+local trace_identifying = false trackers.register("structures.referencing.identifying", function(v) trace_identifying = v end)
+local trace_importing = false trackers.register("structures.referencing.importing", function(v) trace_importing = v end)
+local trace_empty = false trackers.register("structures.referencing.empty", function(v) trace_empty = v end)
+
+local check_duplicates = true
+
+directives.register("structures.referencing.checkduplicates", function(v) check_duplicates = v end)
+
+local report_references = logs.reporter("references")
+local report_identifying = logs.reporter("references","identifying")
+local report_importing = logs.reporter("references","importing")
+local report_empty = logs.reporter("references","empty")
+local report = report_references
+
+local variables = interfaces.variables
+local v_page = variables.page
+local v_auto = variables.auto
+local v_yes = variables.yes
+local v_name = variables.name
+
+local context = context
+local commands = commands
+local implement = interfaces.implement
+
+local ctx_latelua = context.latelua
+
+local texiscount = tex.iscount
+local texgetcount = tex.getcount
+local texsetcount = tex.setcount
+local texconditionals = tex.conditionals
+
+local getexpansion = token.getexpansion
+
+local productcomponent = resolvers.jobs.productcomponent
+local justacomponent = resolvers.jobs.justacomponent
+
+local settings_to_array = utilities.parsers.settings_to_array
+local settings_to_table = utilities.parsers.settings_to_array_obey_fences
+local process_settings = utilities.parsers.process_stripped_settings
+local unsetvalue = attributes.unsetvalue
+
+local structures = structures
+local helpers = structures.helpers
+local sections = structures.sections
+local references = structures.references
+local lists = structures.lists
+local counters = structures.counters
+
+local jobpositions = job.positions
+local getpos = jobpositions.getpos
+
+-- some might become local
+
+references.defined = references.defined or allocate()
+
+local defined = references.defined
+local derived = allocate()
+local specials = allocate()
+local functions = allocate()
+local runners = allocate()
+local internals = allocate()
+local filters = allocate()
+local executers = allocate()
+local handlers = allocate()
+local tobesaved = allocate()
+local collected = allocate()
+local tobereferred = allocate()
+local referred = allocate()
+local usedinternals = allocate()
+local flaginternals = allocate()
+local usedviews = allocate()
+
+references.derived = derived
+references.specials = specials
+references.functions = functions
+references.runners = runners
+references.internals = internals
+references.filters = filters
+references.executers = executers
+references.handlers = handlers
+references.tobesaved = tobesaved
+references.collected = collected
+references.tobereferred = tobereferred
+references.referred = referred
+references.usedinternals = usedinternals
+references.flaginternals = flaginternals
+references.usedviews = usedviews
+
+local splitreference = references.splitreference
+local splitprefix = references.splitcomponent -- replaces: references.splitprefix
+local prefixsplitter = references.prefixsplitter
+local componentsplitter = references.componentsplitter
+
+local currentreference = nil
+
+local txtcatcodes = catcodes.numbers.txtcatcodes -- or just use "txtcatcodes"
+
+local c_realpageno = texiscount("realpageno")
+local c_locationcount = texiscount("locationcount")
+local c_locationorder = texiscount("locationorder")
+local c_lastdestinationattribute = texiscount("lastdestinationattribute")
+
+local context = context
+
+local ctx_pushcatcodes = context.pushcatcodes
+local ctx_popcatcodes = context.popcatcodes
+local ctx_dofinishreference = context.dofinishreference
+local ctx_dofromurldescription = context.dofromurldescription
+local ctx_dofromurlliteral = context.dofromurlliteral
+local ctx_dofromfiledescription = context.dofromfiledescription
+local ctx_dofromfileliteral = context.dofromfileliteral
+local ctx_expandreferenceoperation = context.expandreferenceoperation
+local ctx_expandreferencearguments = context.expandreferencearguments
+local ctx_convertnumber = context.convertnumber
+local ctx_emptyreference = context.emptyreference
+
+storage.register("structures/references/defined", references.defined, "structures.references.defined")
+
+local initializers = { }
+local finalizers = { }
+local somefound = false -- so we don't report missing when we have a fresh start
+
+function references.registerinitializer(func) -- we could use a token register instead
+ initializers[#initializers+1] = func
+end
+
+function references.registerfinalizer(func) -- we could use a token register instead
+ finalizers[#finalizers+1] = func
+end
+
+local function initializer() -- can we use a tobesaved as metatable for collected?
+ tobesaved = references.tobesaved
+ collected = references.collected
+ for i=1,#initializers do
+ initializers[i](tobesaved,collected)
+ end
+ for prefix, list in next, collected do
+ for tag, data in next, list do
+ local r = data.references
+ local i = r.internal
+ if i then
+ internals[i] = data
+ usedinternals[i] = r.used
+ end
+ end
+ end
+ somefound = next(collected)
+end
+
+local function finalizer()
+ for i=1,#finalizers do
+ finalizers[i](tobesaved)
+ end
+ for prefix, list in next, tobesaved do
+ for tag, data in next, list do
+ local r = data.references
+ local i = r.internal
+ local f = flaginternals[i]
+ if f then
+ r.used = usedviews[i] or true
+ end
+ end
+ end
+end
+
+job.register('structures.references.collected', tobesaved, initializer, finalizer)
+
+local maxreferred = 1
+local nofreferred = 0
+
+local function initializer() -- can we use a tobesaved as metatable for collected?
+ tobereferred = references.tobereferred
+ referred = references.referred
+ nofreferred = #referred
+end
+
+-- no longer done this way
+
+-- references.resolvers = references.resolvers or { }
+-- local resolvers = references.resolvers
+--
+-- function resolvers.section(var)
+-- local vi = lists.collected[var.i[2]]
+-- if vi then
+-- var.i = vi
+-- var.r = (vi.references and vi.references.realpage) or (vi.pagedata and vi.pagedata.realpage) or 1
+-- else
+-- var.i = nil
+-- var.r = 1
+-- end
+-- end
+--
+-- resolvers.float = resolvers.section
+-- resolvers.description = resolvers.section
+-- resolvers.formula = resolvers.section
+-- resolvers.note = resolvers.section
+--
+-- function resolvers.reference(var)
+-- local vi = var.i[2]
+-- if vi then
+-- var.i = vi
+-- var.r = (vi.references and vi.references.realpage) or (vi.pagedata and vi.pagedata.realpage) or 1
+-- else
+-- var.i = nil
+-- var.r = 1
+-- end
+-- end
+
+-- We make the array sparse (maybe a finalizer should optionally return a table) because
+-- there can be quite some page links involved. We only store one action number per page
+-- which is normally good enough for what we want (e.g. see above/below) and we do
+-- a combination of a binary search and traverse backwards. A previous implementation
+-- always did a traverse and was pretty slow on a large number of links (given that this
+-- methods was used). It took me about a day to locate this as a bottleneck in processing
+-- a 2500 page interactive document with 60 links per page. In that case, traversing
+-- thousands of slots per link then brings processing to a grinding halt (especially when
+-- there are no slots at all, which is the case in a first run).
+
+local sparsetobereferred = { }
+
+local function finalizer()
+ local lastr, lasti
+ local n = 0
+ for i=1,maxreferred do
+ local r = tobereferred[i]
+ if not lastr then
+ lastr = r
+ lasti = i
+ elseif r ~= lastr then
+ n = n + 1
+ sparsetobereferred[n] = { lastr, lasti }
+ lastr = r
+ lasti = i
+ end
+ end
+ if lastr then
+ n = n + 1
+ sparsetobereferred[n] = { lastr, lasti }
+ end
+end
+
+job.register('structures.references.referred', sparsetobereferred, initializer, finalizer)
+
+local function referredpage(n)
+ local max = nofreferred
+ if max > 0 then
+ -- find match
+ local min = 1
+ while true do
+ local mid = floor((min+max)/2)
+ local r = referred[mid]
+ local m = r[2]
+ if n == m then
+ return r[1]
+ elseif n > m then
+ min = mid + 1
+ else
+ max = mid - 1
+ end
+ if min > max then
+ break
+ end
+ end
+ -- find first previous
+ for i=min,1,-1 do
+ local r = referred[i]
+ if r and r[2] < n then
+ return r[1]
+ end
+ end
+ end
+ -- fallback
+ return texgetcount(c_realpageno)
+end
+
+references.referredpage = referredpage
+
+function references.registerpage(n) -- called in the backend code
+ if not tobereferred[n] then
+ if n > maxreferred then
+ maxreferred = n
+ end
+ tobereferred[n] = texgetcount(c_realpageno)
+ end
+end
+
+-- todo: delay split till later as in destinations we split anyway
+
+local orders, lastorder = { }, 0
+
+local function setnextorder(kind,name)
+ lastorder = 0
+ if kind and name then
+ local ok = orders[kind]
+ if not ok then
+ ok = { }
+ orders[kind] = ok
+ end
+ lastorder = (ok[name] or 0) + 1
+ ok[name] = lastorder
+ end
+ texsetcount("global",c_locationorder,lastorder)
+end
+
+
+local function setnextinternal(kind,name)
+ setnextorder(kind,name) -- always incremented with internal
+ local n = texgetcount(c_locationcount) + 1
+ texsetcount("global",c_locationcount,n)
+ return n
+end
+
+local function currentorder(kind,name)
+ return orders[kind] and orders[kind][name] or lastorder
+end
+
+local function setcomponent(data)
+ -- we might consider doing this at the tex end, just like prefix
+ local component = productcomponent()
+ if component then
+ local references = data and data.references
+ if references then
+ references.component = component
+ if references.prefix == component then
+ references.prefix = nil
+ end
+ end
+ return component
+ end
+ -- but for the moment we do it here (experiment)
+end
+
+references.setnextorder = setnextorder
+references.setnextinternal = setnextinternal
+references.currentorder = currentorder
+references.setcomponent = setcomponent
+
+-- implement {
+-- name = "setnextreferenceorder",
+-- actions = setnextorder,
+-- arguments = "2 strings",
+-- }
+--
+-- implement {
+-- name = "currentreferenceorder",
+-- actions = { currentorder, context },
+-- arguments = "2 strings",
+-- }
+
+implement {
+ name = "setnextinternalreferences",
+ public = true,
+ protected = true,
+ actions = setnextinternal,
+ arguments = "2 arguments",
+}
+
+implement {
+ name = "getinternalorderreference",
+ public = true,
+ protected = true,
+ actions = { currentorder, context },
+ arguments = "2 arguments",
+}
+
+local reported = setmetatableindex("table")
+
+function references.set(data)
+ local references = data.references
+ local reference = references.reference
+ if not reference or reference == "" then
+ -- report_references("invalid reference") -- harmless
+ return 0
+ end
+ local prefix = references.prefix or ""
+ local pd = tobesaved[prefix] -- nicer is a metatable
+ if not pd then
+ pd = { }
+ tobesaved[prefix] = pd
+ end
+ local n = 0
+ local function action(ref)
+ if ref == "" then
+ -- skip
+ elseif check_duplicates and pd[ref] then
+ if not prefix then
+ prefix = ""
+ end
+ if not reported[prefix][ref] then
+ if prefix ~= "" then
+ report_references("redundant reference %a in namespace %a",ref,prefix)
+ else
+ report_references("redundant reference %a",ref)
+ end
+ reported[prefix][ref] = true
+ end
+ else
+ n = n + 1
+ pd[ref] = data
+ local r = data.references
+ ctx_dofinishreference(prefix or "",ref or "",r and r.internal or 0)
+ -- ctx_latelua(function() structures.references.enhance(prefix or ref,ref or "") end)
+ end
+ end
+ process_settings(reference,action)
+ return n > 0
+end
+
+-- function references.enhance(prefix,tag)
+-- local l = tobesaved[prefix][tag]
+-- if l then
+-- l.references.realpage = texgetcount(c_realpageno)
+-- end
+-- end
+
+local function synchronizepage(reference) -- non public helper
+ reference.realpage = texgetcount(c_realpageno)
+ if jobpositions.used() then
+ reference.x, reference.y = getpos()
+ end
+end
+
+references.synchronizepage = synchronizepage
+
+local function enhancereference(specification)
+ local prefix = specification.prefix
+ if prefix then
+ local entry = tobesaved[prefix]
+ if entry then
+ entry = entry[specification.tag]
+ if entry then
+ synchronizepage(entry.references)
+ else
+ -- normally a bug
+ end
+ else
+ -- normally a bug
+ end
+ else
+ -- normally a bug
+ end
+end
+
+references.enhance = enhancereference
+
+-- implement {
+-- name = "enhancereference",
+-- arguments = "2 strings",
+-- actions = function(prefix,tag)
+-- enhancereference { prefix = prefix, tag = tag }
+-- end,
+-- }
+
+implement {
+ name = "deferredenhancereference",
+ arguments = "2 strings",
+ protected = true,
+ actions = function(prefix,tag)
+ ctx_latelua { action = enhancereference, prefix = prefix, tag = tag }
+ end,
+}
+
+-- -- -- related to strc-ini.lua -- -- --
+
+-- no metatable here .. better be sparse
+
+local function register_from_list(collected,derived,pages,sections)
+ local derived_g = derived[""] -- global
+ local derived_p = nil
+ local derived_c = nil
+ local prefix = nil
+ local component = nil
+ local entry = nil
+ if not derived_g then
+ derived_g = { }
+ derived[""] = derived_g
+ end
+ local function action(s)
+ if trace_referencing then
+ report_references("list entry %a provides %a reference %a on realpage %a",i,kind,s,realpage)
+ end
+ if derived_p and not derived_p[s] then
+ derived_p[s] = entry
+ end
+ if derived_c and not derived_c[s] then
+ derived_c[s] = entry
+ end
+ if not derived_g[s] then
+ derived_g[s] = entry -- first wins
+ end
+ end
+ for i=1,#collected do
+ entry = collected[i]
+ local metadata = entry.metadata
+ if metadata then
+ local kind = metadata.kind -- why this check
+ if kind then
+ local references = entry.references
+ if references then
+ local reference = references.reference
+ if reference and reference ~= "" then
+ local realpage = references.realpage
+ if realpage then
+ prefix = references.prefix
+ component = references.component
+ if prefix and prefix ~= "" then
+ derived_p = derived[prefix]
+ if not derived_p then
+ derived_p = { }
+ derived[prefix] = derived_p
+ end
+ end
+ if component and component ~= "" and component ~= prefix then
+ derived_c = derived[component]
+ if not derived_c then
+ derived_c = { }
+ derived[component] = derived_c
+ end
+ end
+ process_settings(reference,action)
+ end
+ end
+ end
+ end
+ end
+ end
+end
+
+references.registerfromlist = function(collected,pages,sections)
+ register_from_list(collected,derived,pages,sections)
+end
+
+references.registerinitializer(function() register_from_list(lists.collected,derived) end)
+
+-- tracing
+
+local function collectbypage(tracedpages)
+ -- lists
+ do
+ local collected = structures.lists.collected
+ local data = nil
+ local function action(reference)
+ local prefix = data.prefix
+ local component = data.component
+ local realpage = data.realpage
+ if realpage then
+ local pagelist = rawget(tracedpages,realpage)
+ local internal = data.internal or 0
+ local prefix = (prefix ~= "" and prefix) or (component ~= "" and component) or ""
+ local pagedata = { prefix, reference, internal }
+ if pagelist then
+ pagelist[#pagelist+1] = pagedata
+ else
+ tracedpages[realpage] = { pagedata }
+ end
+ if internal > 0 then
+ data.usedprefix = prefix
+ end
+ end
+ end
+ for i=1,#collected do
+ local entry = collected[i]
+ local metadata = entry.metadata
+ if metadata and metadata.kind then
+ data = entry.references
+ if data then
+ local reference = data.reference
+ if reference and reference ~= "" then
+ process_settings(reference,action)
+ end
+ end
+ end
+ end
+ end
+ -- references
+ do
+ for prefix, list in next, collected do
+ for reference, entry in next, list do
+ local data = entry.references
+ if data then
+ local realpage = data.realpage
+ local internal = data.internal or 0
+ local pagelist = rawget(tracedpages,realpage)
+ local pagedata = { prefix, reference, internal }
+ if pagelist then
+ pagelist[#pagelist+1] = pagedata
+ else
+ tracedpages[realpage] = { pagedata }
+ end
+ if internal > 0 then
+ data.usedprefix = prefix
+ end
+ end
+ end
+ end
+ end
+end
+
+references.tracedpages = table.setmetatableindex(allocate(),function(t,k)
+ if collectbypage then
+ collectbypage(t)
+ collectbypage = nil
+ end
+ return rawget(t,k)
+end)
+
+-- urls
+
+local urls = references.urls or { }
+references.urls = urls
+local urldata = urls.data or { }
+urls.data = urldata
+
+local p_untexurl = Cs ( (
+ P("\\")/"" * (P("%")/"%%" + P(1))
+ + P(" ")/"%%20"
+ + P(1)
+)^1 )
+
+function urls.untex(url)
+ return lpegmatch(p_untexurl,url) or url
+end
+
+function urls.define(name,url,file,description)
+ if name and name ~= "" then
+ -- url = lpegmatch(replacer,url)
+ urldata[name] = { url or "", file or "", description or url or file or ""}
+ end
+end
+
+function urls.get(name)
+ local u = urldata[name]
+ if u then
+ local url, file = u[1], u[2]
+ if file and file ~= "" then
+ return formatters["%s/%s"](url,file)
+ else
+ return url
+ end
+ end
+end
+
+function urls.found(name)
+ return urldata[name]
+end
+
+local function geturl(name)
+ local url = urls.get(name)
+ if url and url ~= "" then
+ ctx_pushcatcodes(txtcatcodes)
+ context(url)
+ ctx_popcatcodes()
+ end
+end
+
+implement {
+ name = "doifelseurldefined",
+ actions = { urls.found, commands.doifelse },
+ arguments = "string"
+}
+
+implement {
+ name = "useurl",
+ actions = urls.define,
+ arguments = "4 strings",
+}
+
+implement {
+ name = "geturl",
+ actions = geturl,
+ arguments = "string",
+}
+
+-- files
+
+local files = references.files or { }
+references.files = files
+local filedata = files.data or { }
+files.data = filedata
+
+function files.define(name,file,description)
+ if name and name ~= "" then
+ filedata[name] = { file or "", description or file or "" }
+ end
+end
+
+function files.get(name,method,space) -- method: none, before, after, both, space: yes/no
+ local f = filedata[name]
+ if f then
+ context(f[1])
+ end
+end
+
+function files.found(name)
+ return filedata[name]
+end
+
+local function getfile(name)
+ local fil = files.get(name)
+ if fil and fil ~= "" then
+ ctx_pushcatcodes(txtcatcodes)
+ context(fil)
+ ctx_popcatcodes()
+ end
+end
+
+implement {
+ name = "doifelsefiledefined",
+ actions = { files.found, commands.doifelse },
+ arguments = "string"
+}
+
+implement {
+ name = "usefile",
+ actions = files.define,
+ arguments = "3 strings"
+}
+
+implement {
+ name = "getfile",
+ actions = getfile,
+ arguments = "string"
+}
+
+-- helpers
+
+function references.checkedfile(whatever) -- return whatever if not resolved
+ if whatever then
+ local w = filedata[whatever]
+ if w then
+ return w[1]
+ else
+ return whatever
+ end
+ end
+end
+
+function references.checkedurl(whatever) -- return whatever if not resolved
+ if whatever then
+ local w = urldata[whatever]
+ if w then
+ local u, f = w[1], w[2]
+ if f and f ~= "" then
+ return u .. "/" .. f
+ else
+ return u
+ end
+ else
+ return whatever
+ end
+ end
+end
+
+function references.checkedfileorurl(whatever,default) -- return nil, nil if not resolved
+ if whatever then
+ local w = filedata[whatever]
+ if w then
+ return w[1], nil
+ else
+ local w = urldata[whatever]
+ if w then
+ local u, f = w[1], w[2]
+ if f and f ~= "" then
+ return nil, u .. "/" .. f
+ else
+ return nil, u
+ end
+ end
+ end
+ end
+ return default
+end
+
+-- programs
+
+local programs = references.programs or { }
+references.programs = programs
+local programdata = programs.data or { }
+programs.data = programdata
+
+function programs.define(name,file,description)
+ if name and name ~= "" then
+ programdata[name] = { file or "", description or file or ""}
+ end
+end
+
+function programs.get(name)
+ local f = programdata[name]
+ return f and f[1]
+end
+
+function references.checkedprogram(whatever) -- return whatever if not resolved
+ if whatever then
+ local w = programdata[whatever]
+ if w then
+ return w[1]
+ else
+ return whatever
+ end
+ end
+end
+
+implement {
+ name = "defineprogram",
+ actions = programs.define,
+ arguments = "3 strings",
+}
+
+local function getprogram(name)
+ local p = programdata[name]
+ if p then
+ context(p[1])
+ end
+end
+
+implement {
+ name = "getprogram",
+ actions = getprogram,
+ arguments = "string"
+}
+
+-- shared by urls and files
+
+function references.from(name)
+ local u = urldata[name]
+ if u then
+ local url, file, description = u[1], u[2], u[3]
+ if description ~= "" then
+ return description
+ -- ok
+ elseif file and file ~= "" then
+ return url .. "/" .. file
+ else
+ return url
+ end
+ else
+ local f = filedata[name]
+ if f then
+ local file, description = f[1], f[2]
+ if description ~= "" then
+ return description
+ else
+ return file
+ end
+ end
+ end
+end
+
+local function from(name)
+ local u = urldata[name]
+ if u then
+ local url, file, description = u[1], u[2], u[3]
+ if description ~= "" then
+ ctx_dofromurldescription(description)
+ -- ok
+ elseif file and file ~= "" then
+ ctx_dofromurlliteral(url .. "/" .. file)
+ else
+ ctx_dofromurlliteral(url)
+ end
+ else
+ local f = filedata[name]
+ if f then
+ local file, description = f[1], f[2]
+ if description ~= "" then
+ ctx_dofromfiledescription(description)
+ else
+ ctx_dofromfileliteral(file)
+ end
+ end
+ end
+end
+
+implement {
+ name = "from",
+ actions = from,
+ arguments = "string"
+}
+
+function references.define(prefix,reference,list)
+ local d = defined[prefix] if not d then d = { } defined[prefix] = d end
+ d[reference] = list
+end
+
+function references.reset(prefix,reference)
+ local d = defined[prefix]
+ if d then
+ d[reference] = nil
+ end
+end
+
+implement {
+ name = "definereference",
+ actions = references.define,
+ arguments = "3 strings",
+}
+
+implement {
+ name = "resetreference",
+ actions = references.reset,
+ arguments = "2 strings",
+}
+
+setmetatableindex(defined,"table")
+
+local function resolve(prefix,reference,args,set) -- we start with prefix,reference
+ if reference and reference ~= "" then
+ if not set then
+ set = { prefix = prefix, reference = reference }
+ else
+ if not set.reference then set.reference = reference end
+ if not set.prefix then set.prefix = prefix end
+ end
+ -- local r = settings_to_array(reference)
+ local r = settings_to_table(reference) -- maybe option to honor () []
+ for i=1,#r do
+ local ri = r[i]
+ local d = defined[prefix][ri] or defined[""][ri]
+ if d then
+ d = getexpansion(d)
+ resolve(prefix,d,nil,set)
+ else
+ local var = splitreference(ri)
+ if var then
+ var.reference = ri
+ local vo, vi = var.outer, var.inner
+ -- we catch this here .. it's a way to pass references with commas
+ if vi == "name" then
+ local arguments = var.arguments
+ if arguments then
+ vi = arguments
+ var.inner = arguments
+ var.reference = arguments
+ var.arguments = nil
+ end
+ elseif var.special == "name" then
+ local operation = var.operation
+ if operation then
+ vi = operation
+ var.inner = operation
+ var.reference = operation
+ var.operation = nil
+ var.special = nil
+ end
+ end
+ -- end of catch
+ if not vo and vi then
+ -- to be checked
+ d = defined[prefix][vi] or defined[""][vi]
+ --
+ if d then
+ d = getexpansion(d)
+ resolve(prefix,d,var.arguments,set) -- args can be nil
+ else
+ if args then var.arguments = args end
+ set[#set+1] = var
+ end
+ else
+ if args then var.arguments = args end
+ set[#set+1] = var
+ end
+ else
+ -- report_references("funny pattern %a",ri)
+ end
+ end
+ end
+ return set
+ else
+ return { }
+ end
+end
+
+-- prefix == "" is valid prefix which saves multistep lookup
+
+references.currentset = nil
+
+local externals = { }
+
+-- we have prefixes but also components:
+--
+-- : prefix
+-- :: always external
+-- ::: internal (for products) or external (for components)
+
+local function loadexternalreferences(name,utilitydata)
+ local struc = utilitydata.structures
+ if struc then
+ local external = struc.references.collected -- direct references
+ local lists = struc.lists.collected -- indirect references (derived)
+ local pages = struc.pages.collected -- pagenumber data
+ local sections = struc.sections.collected
+ -- a bit weird one, as we don't have the externals in the collected
+ for prefix, set in next, external do
+ if prefix == "" then
+ prefix = name -- this can clash!
+ end
+ for reference, data in next, set do
+ if trace_importing then
+ report_importing("registering %a reference, kind %a, name %a, prefix %a, reference %a",
+ "external","regular",name,prefix,reference)
+ end
+ -- weird code
+ -- local section = reference.section
+ -- local realpage = reference.realpage
+ -- if section then
+ -- reference.sectiondata = lists[section]
+ -- end
+ -- if realpage then
+ -- reference.pagedata = pages[realpage]
+ -- end
+ -- better?
+ local references = data.references -- hm. plural
+ if references then
+ local section = references.section
+ local realpage = references.realpage
+ if not references.sectiondata then
+ references.sectiondata = sections[references.section or false]
+ end
+ if not references.pagedata then
+ references.pagedata = pages[references.realpage or false]
+ end
+ end
+ end
+ end
+ -- maybe store utilitydata in metatable so that we can access all
+ for i=1,#lists do
+ local entry = lists[i]
+ local metadata = entry.metadata
+ local references = entry.references
+ if metadata and references then
+ local reference = references.reference
+ if reference and reference ~= "" then
+ local kind = metadata.kind
+ local realpage = references.realpage
+ if kind and realpage then
+ -- quite likely already done so this might go
+ if pages and not references.pagedata then
+ references.pagedata = pages[references.realpage or false]
+ end
+ if sections and not references.sectiondata then
+ references.sectiondata = sections[references.section or false]
+ end
+ --
+ local prefix = references.prefix or ""
+ if prefix == "" then
+ prefix = name -- this can clash!
+ end
+ local target = external[prefix]
+ if not target then
+ target = { }
+ external[prefix] = target
+ end
+ -- for s in gmatch(reference,"%s*([^,]+)") do
+ -- if trace_importing then
+ -- report_importing("registering %s reference, kind %a, name %a, prefix %a, reference %a",
+ -- "external",kind,name,prefix,s)
+ -- end
+ -- target[s] = target[s] or entry
+ -- end
+ local function action(s)
+ if trace_importing then
+ report_importing("registering %s reference, kind %a, name %a, prefix %a, reference %a",
+ "external",kind,name,prefix,s)
+ end
+ target[s] = target[s] or entry
+ end
+ process_settings(reference,action)
+ end
+ end
+ end
+ end
+ externals[name] = external
+ return external
+ end
+end
+
+local externalfiles = { }
+
+setmetatableindex(externalfiles, function(t,k)
+ local v = filedata[k]
+ if not v then
+ v = { k, k }
+ end
+ externalfiles[k] = v
+ return v
+end)
+
+setmetatableindex(externals, function(t,k) -- either or not automatically
+ local filename = externalfiles[k][1] -- filename
+ local fullname = file.replacesuffix(filename,"tuc")
+ if lfs.isfile(fullname) then -- todo: use other locator
+ local utilitydata = job.loadother(fullname)
+ if utilitydata then
+ local external = loadexternalreferences(k,utilitydata)
+ t[k] = external or false
+ return external
+ end
+ end
+ t[k] = false
+ return false
+end)
+
+local productdata = allocate {
+ productreferences = { },
+ componentreferences = { },
+ components = { },
+}
+
+references.productdata = productdata
+
+local function loadproductreferences(productname,componentname,utilitydata)
+ local struc = utilitydata.structures
+ if struc then
+ local productreferences = struc.references.collected -- direct references
+ local lists = struc.lists.collected -- indirect references (derived)
+ local pages = struc.pages.collected -- pagenumber data
+ local sections = struc.sections.collected -- section number data
+ -- we use indirect tables to save room but as they are eventually
+ -- just references we resolve them to data here (the mechanisms
+ -- that use this data check for indirectness)
+ for prefix, set in next, productreferences do
+ for reference, data in next, set do
+ if trace_importing then
+ report_importing("registering %s reference, kind %a, name %a, prefix %a, reference %a",
+ "product","regular",productname,prefix,reference)
+ end
+ if not reference.sectiondata then
+ reference.sectiondata = sections[reference.section or false]
+ end
+ if not reference.pagedata then
+ reference.pagedata = pages[reference.realpage or false]
+ end
+ end
+ end
+ --
+ local componentreferences = { }
+ for i=1,#lists do
+ local entry = lists[i]
+ local metadata = entry.metadata
+ local references = entry.references
+ if metadata and references then
+ local reference = references.reference
+ if reference and reference ~= "" then
+ local kind = metadata.kind
+ local realpage = references.realpage
+ if kind and realpage then
+ local prefix = references.prefix or ""
+ local component = references.component
+ local ctarget, ptarget
+ if not component or component == componentname then
+ -- skip
+ else
+ -- one level up
+ local external = componentreferences[component]
+ if not external then
+ external = { }
+ componentreferences[component] = external
+ end
+ if component == prefix then
+ prefix = ""
+ end
+ ctarget = external[prefix]
+ if not ctarget then
+ ctarget = { }
+ external[prefix] = ctarget
+ end
+ end
+ ptarget = productreferences[prefix]
+ if not ptarget then
+ ptarget = { }
+ productreferences[prefix] = ptarget
+ end
+ local function action(s)
+ if ptarget then
+ if trace_importing then
+ report_importing("registering %s reference, kind %a, name %a, prefix %a, reference %a",
+ "product",kind,productname,prefix,s)
+ end
+ ptarget[s] = ptarget[s] or entry
+ end
+ if ctarget then
+ if trace_importing then
+ report_importing("registering %s reference, kind %a, name %a, prefix %a, referenc %a",
+ "component",kind,productname,prefix,s)
+ end
+ ctarget[s] = ctarget[s] or entry
+ end
+ end
+ process_settings(reference,action)
+ end
+ end
+ end
+ end
+ productdata.productreferences = productreferences -- not yet used
+ productdata.componentreferences = componentreferences
+ end
+end
+
+local function loadproductvariables(product,component,utilitydata)
+ local struc = utilitydata.structures
+ if struc then
+ local lists = struc.lists and struc.lists.collected
+ if lists then
+ local pages = struc.pages and struc.pages.collected
+ for i=1,#lists do
+ local li = lists[i]
+ if li.metadata.kind == "section" and li.references.component == component then
+ local firstsection = li
+ if firstsection.numberdata then
+ local numbers = firstsection.numberdata.numbers
+ if numbers then
+ if trace_importing then
+ report_importing("initializing section number to %:t",numbers)
+ end
+ productdata.firstsection = firstsection
+ structures.documents.preset(numbers)
+ end
+ end
+ if pages and firstsection.references then
+ local firstpage = pages[firstsection.references.realpage]
+ local number = firstpage and firstpage.number
+ if number then
+ if trace_importing then
+ report_importing("initializing page number to %a",number)
+ end
+ productdata.firstpage = firstpage
+ counters.set("userpage",1,number)
+ end
+ end
+ break
+ end
+ end
+ end
+ end
+end
+
+local function componentlist(tree,target)
+ local branches = tree and tree.branches
+ if branches then
+ for i=1,#branches do
+ local branch = branches[i]
+ local type = branch.type
+ if type == "component" then
+ if target then
+ target[#target+1] = branch.name
+ else
+ target = { branch.name }
+ end
+ elseif type == "product" or type == "component" then
+ target = componentlist(branch,target)
+ end
+ end
+ end
+ return target
+end
+
+local function loadproductcomponents(product,component,utilitydata)
+ local job = utilitydata.job
+ productdata.components = componentlist(job and job.structure and job.structure.collected) or { }
+end
+
+references.registerinitializer(function(tobesaved,collected)
+ -- not that much related to tobesaved or collected
+ productdata.components = componentlist(job.structure.collected) or { }
+end)
+
+function references.loadpresets(product,component) -- we can consider a special components hash
+ if product and component and product~= "" and component ~= "" and not productdata.product then -- maybe: productdata.filename ~= filename
+ productdata.product = product
+ productdata.component = component
+ -- todo: use other locator
+ local fullname = file.replacesuffix(product,"tuc")
+ if lfs.isfile(fullname) then
+ local utilitydata = job.loadother(fullname)
+ if utilitydata then
+ if trace_importing then
+ report_importing("loading references for component %a of product %a from %a",component,product,fullname)
+ end
+ loadproductvariables (product,component,utilitydata)
+ loadproductreferences(product,component,utilitydata)
+ loadproductcomponents(product,component,utilitydata)
+ end
+ end
+ end
+end
+
+references.productdata = productdata
+
+local useproduct = commands.useproduct
+
+if useproduct then
+
+ local function newuseproduct(product)
+ useproduct(product)
+ if texconditionals.autocrossfilereferences then
+ local component = justacomponent()
+ if component then
+ if trace_referencing or trace_importing then
+ report_references("loading presets for component %a of product %a",component,product)
+ end
+ references.loadpresets(product,component)
+ end
+ end
+ end
+
+ implement {
+ name = "useproduct",
+ actions = newuseproduct,
+ arguments = "optional",
+ overload = true,
+ }
+
+end
+
+-- productdata.firstsection.numberdata.numbers
+-- productdata.firstpage.number
+
+local function report_identify_special(set,var,i,type)
+ local reference = set.reference
+ local prefix = set.prefix or ""
+ local special = var.special
+ local error = var.error
+ local kind = var.kind
+ if error then
+ report_identifying("type %a, reference %a, index %a, prefix %a, special %a, error %a",type,reference,i,prefix,special,error)
+ else
+ report_identifying("type %a, reference %a, index %a, prefix %a, special %a, kind %a",type,reference,i,prefix,special,kind)
+ end
+end
+
+local function report_identify_arguments(set,var,i,type)
+ local reference = set.reference
+ local prefix = set.prefix or ""
+ local arguments = var.arguments
+ local error = var.error
+ local kind = var.kind
+ if error then
+ report_identifying("type %a, reference %a, index %a, prefix %a, arguments %a, error %a",type,reference,i,prefix,arguments,error)
+ else
+ report_identifying("type %a, reference %a, index %a, prefix %a, arguments %a, kind %a",type,reference,i,prefix,arguments,kind)
+ end
+end
+
+local function report_identify_outer(set,var,i,type)
+ local reference = set.reference
+ local prefix = set.prefix or ""
+ local outer = var.outer
+ local error = var.error
+ local kind = var.kind
+ if outer then
+ if error then
+ report_identifying("type %a, reference %a, index %a, prefix %a, outer %a, error %a",type,reference,i,prefix,outer,error)
+ else
+ report_identifying("type %a, reference %a, index %a, prefix %a, outer %a, kind %a",type,reference,i,prefix,outer,kind)
+ end
+ else
+ if error then
+ report_identifying("type %a, reference %a, index %a, prefix %a, error %a",type,reference,i,prefix,error)
+ else
+ report_identifying("type %a, reference %a, index %a, prefix %a, kind %a",type,reference,i,prefix,kind)
+ end
+ end
+end
+
+local function identify_special(set,var,i)
+ local special = var.special
+ local s = specials[special]
+ if s then
+ local outer = var.outer
+ local operation = var.operation
+ local arguments = var.arguments
+ if outer then
+ if operation then
+ -- special(outer::operation)
+ var.kind = "special outer with operation"
+ else
+ -- special()
+ var.kind = "special outer"
+ end
+ var.f = outer
+ elseif operation then
+ if arguments then
+ -- special(operation{argument,argument})
+ var.kind = "special operation with arguments"
+ else
+ -- special(operation)
+ var.kind = "special operation"
+ end
+ else
+ -- special()
+ var.kind = "special"
+ end
+ if trace_identifying then
+ report_identify_special(set,var,i,"1a")
+ end
+ else
+ var.error = "unknown special"
+ end
+ return var
+end
+
+local function identify_arguments(set,var,i)
+ local s = specials[var.inner]
+ if s then
+ -- inner{argument}
+ var.kind = "special operation with arguments"
+ else
+ var.error = "unknown inner or special"
+ end
+ if trace_identifying then
+ report_identify_arguments(set,var,i,"3a")
+ end
+ return var
+end
+
+-- needs checking: if we don't do too much (redundant) checking now
+-- inner ... we could move the prefix logic into the parser so that we have 'm for each entry
+-- foo:bar -> foo == prefix (first we try the global one)
+-- -:bar -> ignore prefix
+
+local function finish_inner(var,p,i)
+ var.kind = "inner"
+ var.i = i
+ var.p = p
+ var.r = (i.references and i.references.realpage) or (i.pagedata and i.pagedata.realpage) or 1
+ return var
+end
+
+local function identify_inner(set,var,prefix,collected,derived)
+ local inner = var.inner
+ -- the next test is a safeguard when references are auto loaded from outer
+ if not inner or inner == "" then
+ return false
+ end
+ local splitprefix, splitinner = lpegmatch(prefixsplitter,inner)
+ if splitprefix and splitinner then
+ -- we check for a prefix:reference instance in the regular set of collected
+ -- references; a special case is -: which forces a lookup in the global list
+ if splitprefix == "-" then
+ local i = collected[""]
+ if i then
+ i = i[splitinner]
+ if i then
+ return finish_inner(var,"",i)
+ end
+ end
+ end
+ local i = collected[splitprefix]
+ if i then
+ i = i[splitinner]
+ if i then
+ return finish_inner(var,splitprefix,i)
+ end
+ end
+ if derived then
+ -- next we look for a reference in the regular set of collected references
+ -- using the prefix that is active at this moment (so we overload the given
+ -- these are taken from other data structures (like lists)
+ if splitprefix == "-" then
+ local i = derived[""]
+ if i then
+ i = i[splitinner]
+ if i then
+ return finish_inner(var,"",i)
+ end
+ end
+ end
+ local i = derived[splitprefix]
+ if i then
+ i = i[splitinner]
+ if i then
+ return finish_inner(var,splitprefix,i)
+ end
+ end
+ end
+ end
+ -- we now ignore the split prefix and treat the whole inner as a potential
+ -- reference into the global list
+ local i = collected[prefix]
+ if i then
+ i = i[inner]
+ if i then
+ return finish_inner(var,prefix,i)
+ end
+ end
+ if not i and derived then
+ -- and if not found we look in the derived references
+ local i = derived[prefix]
+ if i then
+ i = i[inner]
+ if i then
+ return finish_inner(var,prefix,i)
+ end
+ end
+ end
+ return false
+end
+
+local function unprefixed_inner(set,var,prefix,collected,derived,tobesaved)
+ local inner = var.inner
+ local s = specials[inner]
+ if s then
+ var.kind = "special"
+ else
+ local i = (collected and collected[""] and collected[""][inner]) or
+ (derived and derived [""] and derived [""][inner]) or
+ (tobesaved and tobesaved[""] and tobesaved[""][inner])
+ if i then
+ var.kind = "inner"
+ var.p = ""
+ var.i = i
+ var.r = (i.references and i.references.realpage) or (i.pagedata and i.pagedata.realpage) or 1
+ else
+ var.error = "unknown inner or special"
+ end
+ end
+ return var
+end
+
+local function identify_outer(set,var,i)
+ local outer = var.outer
+ local inner = var.inner
+ local external = externals[outer]
+ if external then
+ local v = identify_inner(set,var,"",external)
+ if v then
+ v.kind = "outer with inner"
+ set.external = true
+ if trace_identifying then
+ report_identify_outer(set,v,i,"2a")
+ end
+ return v
+ end
+-- weird too (we really need to check how this table is build
+ local v = identify_inner(set,var,var.outer,external)
+ if v then
+ v.kind = "outer with inner"
+ set.external = true
+ if trace_identifying then
+ report_identify_outer(set,v,i,"2c")
+ end
+ return v
+ end
+--
+ -- somewhat rubish: we use outer as first step in the externals table so it makes no
+ -- sense to have it as prefix so the next could be an option
+ local external = external[""]
+ if external then
+ local v = identify_inner(set,var,var.outer,external)
+ if v then
+ v.kind = "outer with inner"
+ set.external = true
+ if trace_identifying then
+ report_identify_outer(set,v,i,"2b")
+ end
+ return v
+ end
+ end
+ end
+ local external = productdata.componentreferences[outer]
+ if external then
+ local v = identify_inner(set,var,"",external)
+ if v then
+ v.kind = "outer with inner"
+ set.external = true
+ if trace_identifying then
+ report_identify_outer(set,v,i,"2c")
+ end
+ return v
+ end
+ end
+ local external = productdata.productreferences[outer]
+ if external then
+ local vi = external[inner]
+ if vi then
+ var.kind = "outer with inner"
+ var.i = vi
+ set.external = true
+ if trace_identifying then
+ report_identify_outer(set,var,i,"2d")
+ end
+ return var
+ end
+ end
+ -- the rest
+ local special = var.special
+ local arguments = var.arguments
+ local operation = var.operation
+ if inner then
+ -- tricky: in this case we can only use views when we're sure that all inners
+ -- are flushed in the outer document so that should become an option
+ if arguments then
+ -- outer::inner{argument}
+ var.kind = "outer with inner with arguments"
+ else
+ -- outer::inner
+ var.kind = "outer with inner"
+ end
+ var.i = inner
+ var.f = outer
+ if type(inner) == "table" then
+ -- can this really happen?
+ var.r = (inner.references and inner.references.realpage) or (inner.pagedata and inner.pagedata.realpage) or 1
+ else
+ var.r = 1
+ end
+ if trace_identifying then
+ report_identify_outer(set,var,i,"2e")
+ end
+ elseif special then
+ local s = specials[special]
+ if s then
+ if operation then
+ if arguments then
+ -- outer::special(operation{argument,argument})
+ var.kind = "outer with special and operation and arguments"
+ else
+ -- outer::special(operation)
+ var.kind = "outer with special and operation"
+ end
+ else
+ -- outer::special()
+ var.kind = "outer with special"
+ end
+ var.f = outer
+ else
+ var.error = "unknown outer with special"
+ end
+ if trace_identifying then
+ report_identify_outer(set,var,i,"2f")
+ end
+ else
+ -- outer::
+ var.kind = "outer"
+ var.f = outer
+ if trace_identifying then
+ report_identify_outer(set,var,i,"2g")
+ end
+ end
+ return var
+end
+
+-- todo: avoid copy
+
+local function identify_inner_or_outer(set,var,i)
+ -- here we fall back on product data
+ local inner = var.inner
+ if inner and inner ~= "" then
+
+ -- first we look up in collected and derived using the current prefix
+
+ local prefix = set.prefix
+
+ local v = identify_inner(set,var,set.prefix,collected,derived)
+ if v then
+ if trace_identifying then
+ report_identify_outer(set,v,i,"4a")
+ end
+ return v
+ end
+
+ -- nest we look at each component (but we can omit the already consulted one
+
+ local jobstructure = job.structure
+ local components = jobstructure and jobstructure.components
+ if components then
+ for c=1,#components do
+ local component = components[c]
+ if component ~= prefix then
+ local v = identify_inner(set,var,component,collected,derived)
+ if v then
+ if trace_identifying then
+ report_identify_outer(set,var,i,"4b")
+ end
+ return v
+ end
+ end
+ end
+ end
+
+ -- as a last resort we will consult the global lists
+
+ local v = unprefixed_inner(set,var,"",collected,derived,tobesaved)
+ if v then
+ if trace_identifying then
+ report_identify_outer(set,v,i,"4c")
+ end
+ return v
+ end
+
+ -- not it gets bad ... we need to look in external files ... keep in mind that
+ -- we can best use explicit references for this ... we might issue a warning
+
+ local componentreferences = productdata.componentreferences
+ local productreferences = productdata.productreferences
+ local components = productdata.components
+ if components and componentreferences then
+ for c=1,#components do
+ local component = components[c]
+ local data = componentreferences[component]
+ if data then
+ local d = data[""]
+ local vi = d and d[inner]
+ if vi then
+ var.outer = component
+ var.i = vi
+ var.kind = "outer with inner"
+ set.external = true
+ if trace_identifying then
+ report_identify_outer(set,var,i,"4d")
+ end
+ return var
+ end
+ end
+ end
+ end
+ local component, inner = lpegmatch(componentsplitter,inner)
+ if component then
+ local data = componentreferences and componentreferences[component]
+ if data then
+ local d = data[""]
+ local vi = d and d[inner]
+ if vi then
+ var.inner = inner
+ var.outer = component
+ var.i = vi
+ var.kind = "outer with inner"
+ set.external = true
+ if trace_identifying then
+ report_identify_outer(set,var,i,"4e")
+ end
+ return var
+ end
+ end
+ local data = productreferences and productreferences[component]
+ if data then
+ local vi = data[inner]
+ if vi then
+ var.inner = inner
+ var.outer = component
+ var.i = vi
+ var.kind = "outer with inner"
+ set.external = true
+ if trace_identifying then
+ report_identify_outer(set,var,i,"4f")
+ end
+ return var
+ end
+ end
+ end
+ var.error = "unknown inner"
+ else
+ var.error = "no inner"
+ end
+ if trace_identifying then
+ report_identify_outer(set,var,i,"4g")
+ end
+ return var
+end
+
+local function identify_inner_component(set,var,i)
+ -- we're in a product (maybe ignore when same as component)
+ local component = var.component
+ local v = identify_inner(set,var,component,collected,derived)
+ if not v then
+ var.error = "unknown inner in component"
+ end
+ if trace_identifying then
+ report_identify_outer(set,var,i,"5a")
+ end
+ return var
+end
+
+local function identify_outer_component(set,var,i)
+ local component = var.component
+ local inner = var.inner
+ local data = productdata.componentreferences[component]
+ if data then
+ local d = data[""]
+ local vi = d and d[inner]
+ if vi then
+ var.inner = inner
+ var.outer = component
+ var.i = vi
+ var.kind = "outer with inner"
+ set.external = true
+ if trace_identifying then
+ report_identify_outer(set,var,i,"6a")
+ end
+ return var
+ end
+ end
+ local data = productdata.productreferences[component]
+ if data then
+ local vi = data[inner]
+ if vi then
+ var.inner = inner
+ var.outer = component
+ var.i = vi
+ var.kind = "outer with inner"
+ set.external = true
+ if trace_identifying then
+ report_identify_outer(set,var,i,"6b")
+ end
+ return var
+ end
+ end
+ var.error = "unknown component"
+ if trace_identifying then
+ report_identify_outer(set,var,i,"6c")
+ end
+ return var
+end
+
+local nofidentified = 0
+
+local function identify(prefix,reference)
+ if not reference then
+ prefix, reference = "", prefix
+ end
+ local set = resolve(prefix,reference)
+ local bug = false
+ nofidentified = nofidentified + 1
+ set.n = nofidentified
+ for i=1,#set do
+ local var = set[i]
+ local spe = var.special
+ local fnc = functions[spe]
+ if fnc then
+ var = fnc(var) or { error = "invalid special function" }
+ elseif spe then
+ var = identify_special(set,var,i)
+ elseif var.outer then
+ var = identify_outer(set,var,i)
+ elseif var.arguments then
+ var = identify_arguments(set,var,i)
+ elseif not var.component then
+ var = identify_inner_or_outer(set,var,i)
+ elseif productcomponent() then
+ var = identify_inner_component(set,var,i)
+ else
+ var = identify_outer_component(set,var,i)
+ end
+ set[i] = var
+ bug = bug or var.error
+ end
+ references.currentset = mark(set) -- mark, else in api doc
+ if trace_analyzing then
+ report_references(table.serialize(set,reference))
+ end
+ return set, bug
+end
+
+references.identify = identify
+
+local unknowns, nofunknowns, f_valid = { }, 0, formatters["[%s][%s]"]
+
+function references.valid(prefix,reference,specification,silent)
+ local set, bug = identify(prefix,reference)
+ local unknown = bug or #set == 0
+ if unknown then
+ currentreference = nil -- will go away
+ local str = f_valid(prefix,reference)
+ local u = unknowns[str]
+ if not u then
+ if somefound and not silent then
+ interfaces.showmessage("references",1,str) -- 1 = unknown, 4 = illegal
+ end
+ unknowns[str] = 1
+ nofunknowns = nofunknowns + 1
+ else
+ unknowns[str] = u + 1
+ end
+ else
+ set.highlight = specification.highlight
+ set.newwindow = specification.newwindow
+ set.layer = specification.layer
+ currentreference = set[1]
+ end
+ -- we can do the expansion here which saves a call
+ return not unknown
+end
+
+function references.checked(prefix,reference,specification)
+ return references.valid(prefix,reference,specification,true)
+end
+
+implement {
+ name = "doifelsereference",
+ actions = { references.valid, commands.doifelse },
+ arguments = {
+ "string",
+ "string",
+ {
+ { "highlight", "boolean" },
+ { "newwindow", "boolean" },
+ { "layer" },
+ }
+ }
+}
+
+implement {
+ name = "doifelsereferencechecked",
+ actions = { references.checked, commands.doifelse },
+ arguments = {
+ "string",
+ "string",
+ {
+ { "highlight", "boolean" },
+ { "newwindow", "boolean" },
+ { "layer" },
+ }
+ }
+}
+
+logs.registerfinalactions(function()
+ if nofunknowns > 0 then
+ statistics.register("cross referencing", function()
+ return format("%s identified, %s unknown",nofidentified,nofunknowns)
+ end)
+ local sortedhash = table.sortedhash
+ logs.startfilelogging(report,"missing references")
+ for k, v in table.sortedhash(unknowns) do
+ report("%4i %s",v,k)
+ end
+ logs.stopfilelogging()
+ if logs.loggingerrors() then
+ logs.starterrorlogging(report,"missing references")
+ for k, v in table.sortedhash(unknowns) do
+ report("%4i %s",v,k)
+ end
+ logs.stoperrorlogging()
+ end
+ end
+end)
+
+-- The auto method will try to avoid named internals in a clever way which
+-- can make files smaller without sacrificing external references. Some of
+-- the housekeeping happens the backend side.
+
+local innermethod = v_auto -- only page|auto now
+local outermethod = v_auto -- only page|auto now
+local defaultinnermethod = defaultinnermethod
+local defaultoutermethod = defaultoutermethod
+references.innermethod = innermethod -- don't mess with this one directly
+references.outermethod = outermethod -- don't mess with this one directly
+
+function references.setlinkmethod(inner,outer)
+ if not outer and type(inner) == "string" then
+ local m = settings_to_array(inner)
+ inner = m[1]
+ outer = m[2] or v_auto
+ end
+ if toboolean(inner) or inner == v_page or inner == v_yes then
+ innermethod = v_page
+ elseif inner == v_name then
+ innermethod = v_name
+ else
+ innermethod = v_auto
+ end
+ if toboolean(outer) or outer == v_page or outer == v_yes then
+ outermethod = v_page
+ elseif inner == v_name then
+ outermethod = v_name
+ else
+ outermethod = v_auto
+ end
+ references.innermethod = innermethod
+ references.outermethod = outermethod
+ function references.setlinkmethod()
+ report_references("link method is already set and frozen: inner %a, outer %a",innermethod,outermethod)
+ end
+end
+
+implement {
+ name = "setreferencelinkmethod",
+ actions = references.setlinkmethod,
+ arguments = "string",
+ -- onlyonce = true
+}
+
+function references.getinnermethod()
+ return innermethod or defaultinnermethod
+end
+
+function references.getoutermethod()
+ return outermethod or defaultoutermethod
+end
+
+directives.register("references.linkmethod", function(v) -- page auto
+ references.setlinkmethod(v)
+end)
+
+-- we can call setinternalreference with an already known internal or with
+-- a reference/prefix specification
+
+local destinationattributes = { }
+
+local function setinternalreference(specification)
+ local internal = specification.internal
+ local destination = unsetvalue
+ if innermethod == v_auto or innermethod == v_name then
+ local t = { } -- maybe add to current (now only used for tracing)
+ local tn = 0
+ local reference = specification.reference
+ local view = specification.view
+ if reference then
+ local prefix = specification.prefix
+ if prefix and prefix ~= "" then
+ local prefix = prefix .. ":" -- watch out, : here
+ local function action(ref)
+ tn = tn + 1
+ t[tn] = prefix .. ref
+ end
+ process_settings(reference,action)
+ else
+ local function action(ref)
+ tn = tn + 1
+ t[tn] = ref
+ end
+ process_settings(reference,action)
+ end
+ end
+ -- ugly .. later we decide to ignore it when we have a real one
+ -- but for testing we might want to see them all
+ if internal then
+ if innermethod ~= v_name then -- innermethod == v_auto
+ -- we don't want too many #1 #2 #3 etc
+ tn = tn + 1
+ t[tn] = internal -- when number it's internal
+ end
+ if not view then
+ local i = references.internals[internal]
+ if i then
+ view = i.references.view
+ end
+ end
+ end
+ destination = references.mark(t,nil,nil,view) -- returns an attribute
+ end
+ if internal then -- new
+ destinationattributes[internal] = destination
+ end
+ texsetcount(c_lastdestinationattribute,destination)
+ return destination
+end
+
+local function getinternalreference(internal)
+ return destinationattributes[internal] or 0
+end
+
+references.setinternalreference = setinternalreference
+references.getinternalreference = getinternalreference
+
+implement {
+ name = "setinternalreference",
+ actions = setinternalreference,
+ arguments = {
+ {
+ { "prefix" },
+ { "reference" },
+ { "internal", "integer" },
+ { "view" }
+ }
+ }
+}
+
+-- implement {
+-- name = "getinternalreference",
+-- actions = { getinternalreference, context },
+-- arguments = "integer",
+-- }
+
+function references.setandgetattribute(data) -- maybe do internal automatically here
+ local attr = unsetvalue
+ local mdat = data.metadata
+ local rdat = data.references
+ if mdat and rdat then
+ if not rdat.section then
+ rdat.section = structures.sections.currentid()
+ end
+ local ndat = data.numberdata
+ if ndat then
+ local numbers = ndat.numbers
+ if type(numbers) == "string" then
+ counters.compact(ndat,numbers)
+ end
+ data.numberdata = helpers.simplify(ndat)
+ end
+ local pdat = data.prefixdata
+ if pdat then
+ data.prefixdata = helpers.simplify(pdat)
+ end
+ local udat = data.userdata
+ if type(udat) == "string" then
+ data.userdata = helpers.touserdata(udat)
+ end
+ if not rdat.block then
+ rdat.block = structures.sections.currentblock()
+ end
+ local done = references.set(data) -- we had kind i.e .item -> full
+ if done then
+ attr = setinternalreference {
+ prefix = rdat.prefix,
+ reference = rdat.reference,
+ internal = rdat.internal,
+ view = rdat.view
+ } or unsetvalue
+ end
+ end
+ texsetcount(c_lastdestinationattribute,attr)
+ return attr
+end
+
+implement {
+ name = "setdestinationattribute",
+ actions = references.setandgetattribute,
+ arguments = {
+ {
+ {
+ "references", {
+ { "internal", "integer" },
+ { "block" },
+ { "view" },
+ { "prefix" },
+ { "reference" },
+ },
+ },
+ {
+ "metadata", {
+ { "kind" },
+ { "xmlroot" },
+ { "catcodes", "integer" },
+ },
+ },
+ {
+ "prefixdata", { "*" }
+ },
+ {
+ "numberdata", { "*" }
+ },
+ {
+ "entries", { "*" }
+ },
+ {
+ "userdata"
+ }
+ }
+ }
+}
+
+function references.getinternallistreference(n) -- n points into list (todo: registers)
+ local l = lists.collected[n]
+ local i = l and l.references.internal
+ return i and destinationattributes[i] or 0
+end
+
+function references.getinternalcachedlistreference(n) -- n points into list (todo: registers)
+ local l = lists.cached[n]
+ local i = l and l.references.internal
+ return i and destinationattributes[i] or 0
+end
+
+implement {
+ name = "getinternallistreference",
+ actions = { references.getinternallistreference, context },
+ arguments = "integer"
+}
+
+implement {
+ name = "getinternalcachedlistreference",
+ actions = { references.getinternalcachedlistreference, context },
+ arguments = "integer"
+}
+
+
+--
+
+function references.getcurrentmetadata(tag)
+ local data = currentreference and currentreference.i
+ return data and data.metadata and data.metadata[tag]
+end
+
+implement {
+ name = "getcurrentreferencemetadata",
+ actions = { references.getcurrentmetadata, context },
+ arguments = "string",
+}
+
+local function currentmetadata(tag)
+ local data = currentreference and currentreference.i
+ return data and data.metadata and data.metadata[tag]
+end
+
+references.currentmetadata = currentmetadata
+
+local function getcurrentprefixspec(default)
+ local data = currentreference and currentreference.i
+ local metadata = data and data.metadata
+ return
+ metadata and metadata.kind or "?",
+ metadata and metadata.name or "?",
+ default or "?"
+end
+
+references.getcurrentprefixspec = getcurrentprefixspec
+
+-- implement {
+-- name = "getcurrentprefixspec",
+-- actions = { getcurrentprefixspec, context }, -- returns 3 arguments
+-- arguments = "string",
+-- }
+
+implement {
+ name = "getcurrentprefixspec",
+ actions = function(tag)
+ context("{%s}{%s}{%s}",getcurrentprefixspec(tag))
+ end,
+ arguments = "string",
+}
+
+local genericfilters = { }
+local userfilters = { }
+local textfilters = { }
+local fullfilters = { }
+local sectionfilters = { }
+
+filters.generic = genericfilters
+filters.user = userfilters
+filters.text = textfilters
+filters.full = fullfilters
+filters.section = sectionfilters
+
+local function filterreference(name,prefixspec,numberspec) -- number page title ...
+ local data = currentreference and currentreference.i -- maybe we should take realpage from here
+ if data then
+ if name == "realpage" then
+ local cs = references.analyze() -- normally already analyzed but also sets state
+ context(tonumber(cs.realpage) or 0)
+ else -- assumes data is table
+ local kind = false
+ if type(data) == "string" then
+ -- todo
+ end
+ if type(data) == "table" then
+ kind = data.metadata and data.metadata.kind
+ end
+ if kind then
+ local filter = filters[kind] or genericfilters
+ filter = filter and (filter[name] or filter.unknown or genericfilters[name] or genericfilters.unknown)
+ if filter then
+ if trace_referencing then
+ report_references("name %a, kind %a, using dedicated filter",name,kind)
+ end
+ filter(data,name,prefixspec,numberspec)
+ elseif trace_referencing then
+ report_references("name %a, kind %a, using generic filter",name,kind)
+ end
+ elseif trace_referencing then
+ report_references("name %a, unknown kind",name)
+ end
+ end
+ elseif name == "realpage" then
+ context(0)
+ elseif trace_referencing then
+ report_references("name %a, no reference",name)
+ end
+end
+
+local function filterreferencedefault()
+ return filterreference("default",getcurrentprefixspec("default"))
+end
+
+references.filter = filterreference
+references.filterdefault = filterreferencedefault
+
+implement {
+ name = "filterreference",
+ actions = filterreference,
+ arguments = "string",
+}
+
+implement {
+ name = "filterdefaultreference",
+ actions = filterreference,
+ arguments = {
+ "string", -- 'default'
+ { { "*" } }, -- prefixspec
+ { { "*" } }, -- numberspec
+ }
+}
+
+function genericfilters.title(data)
+ if data then
+ local titledata = data.titledata or data.useddata
+ if titledata then
+ helpers.title(titledata.reference or titledata.title or "?",data.metadata)
+ end
+ end
+end
+
+function genericfilters.text(data)
+ if data then
+ local entries = data.entries or data.useddata
+ if entries then
+ helpers.title(entries.text or "?",data.metadata)
+ end
+ end
+end
+
+function genericfilters.number(data,what,prefixspec,numberspec)
+ if data then
+ numberdata = lists.reordered(data) -- data.numberdata
+ if numberdata then
+ helpers.prefix(data,prefixspec)
+ sections.typesetnumber(numberdata,"number",numberspec,numberdata)
+ else
+ local useddata = data.useddata
+ if useddata and useddata.number then
+ context(useddata.number)
+ end
+ end
+ end
+end
+
+genericfilters.default = genericfilters.text
+
+function genericfilters.page(data,prefixspec,pagespec)
+ local pagedata = data.pagedata
+ if pagedata then
+ local number = pagedata.number
+ local conversion = pagedata.conversion
+ if not number then
+ -- error
+ elseif conversion then
+ ctx_convertnumber(conversion,number)
+ else
+ context(number)
+ end
+ else
+ helpers.prefixpage(data,prefixspec,pagespec)
+ end
+end
+
+function userfilters.unknown(data,name)
+ if data then
+ local userdata = data.userdata
+ local userkind = userdata and userdata.kind
+ if userkind then
+ local filter = filters[userkind] or genericfilters
+ filter = filter and (filter[name] or filter.unknown)
+ if filter then
+ filter(data,name)
+ return
+ end
+ end
+ local namedata = userdata and userdata[name]
+ if namedata then
+ context(namedata)
+ end
+ end
+end
+
+function textfilters.title(data)
+ helpers.title(data.entries.text or "?",data.metadata)
+end
+
+-- no longer considered useful:
+--
+-- function filters.text.number(data)
+-- helpers.title(data.entries.text or "?",data.metadata)
+-- end
+
+function textfilters.page(data,prefixspec,pagespec)
+ helpers.prefixpage(data,prefixspec,pagespec)
+end
+
+fullfilters.title = textfilters.title
+fullfilters.page = textfilters.page
+
+function sectionfilters.number(data,what,prefixspec)
+ if data then
+ local numberdata = data.numberdata
+ if not numberdata then
+ local useddata = data.useddata
+ if useddata and useddata.number then
+ context(useddata.number)
+ end
+ elseif numberdata.hidenumber then
+ local references = data.references
+ if trace_empty then
+ report_empty("reference %a has a hidden number",references.reference)
+ ctx_emptyreference() -- maybe an option
+ end
+ else
+ sections.typesetnumber(numberdata,"number",prefixspec,numberdata)
+ end
+ end
+end
+
+sectionfilters.title = genericfilters.title
+sectionfilters.page = genericfilters.page
+sectionfilters.default = sectionfilters.number
+
+-- filters.note = { default = genericfilters.number }
+-- filters.formula = { default = genericfilters.number }
+-- filters.float = { default = genericfilters.number }
+-- filters.description = { default = genericfilters.number }
+-- filters.item = { default = genericfilters.number }
+
+setmetatableindex(filters, function(t,k) -- beware, test with rawget
+ local v = { default = genericfilters.number } -- not copy as it might be extended differently
+ t[k] = v
+ return v
+end)
+
+-- function references.sectiontitle(n)
+-- helpers.sectiontitle(lists.collected[tonumber(n) or 0])
+-- end
+
+-- function references.sectionnumber(n)
+-- helpers.sectionnumber(lists.collected[tonumber(n) or 0])
+-- end
+
+-- function references.sectionpage(n,prefixspec,pagespec)
+-- helpers.prefixedpage(lists.collected[tonumber(n) or 0],prefixspec,pagespec)
+-- end
+
+-- analyze
+
+references.testrunners = references.testrunners or { }
+references.testspecials = references.testspecials or { }
+
+local runners = references.testrunners
+local specials = references.testspecials
+
+-- We need to prevent ending up in the 'relative location' analyzer as it is
+-- pretty slow (progressively). In the pagebody one can best check the reference
+-- real page to determine if we need contrastlocation as that is more lightweight.
+
+local function checkedpagestate(n,page,actions,position,spread)
+ local p = tonumber(page)
+ if not p then
+ return 0
+ end
+ if position and #actions > 0 then
+ local i = actions[1].i -- brrr
+ if i then
+ local a = i.references
+ if a then
+ local x = a.x
+ local y = a.y
+ if x and y then
+ local jp = jobpositions.collected[position]
+ if jp then
+ local px = jp.x
+ local py = jp.y
+ local pp = jp.p
+ if p == pp then
+ -- same page
+ if py > y then
+ return 5 -- above
+ elseif py < y then
+ return 4 -- below
+ elseif px > x then
+ return 4 -- below
+ elseif px < x then
+ return 5 -- above
+ else
+ return 1 -- same
+ end
+ elseif spread then
+ if pp % 2 == 0 then
+ -- left page
+ if pp > p then
+ return 2 -- before
+ elseif pp + 1 == p then
+-- return 4 -- below (on right page)
+ return 5 -- above (on left page)
+ else
+ return 3 -- after
+ end
+ else
+ -- right page
+ if pp < p then
+ return 3 -- after
+ elseif pp - 1 == p then
+-- return 5 -- above (on left page)
+ return 4 -- below (on right page)
+ else
+ return 2 -- before
+ end
+ end
+ elseif pp > p then
+ return 2 -- before
+ else
+ return 3 -- after
+ end
+ end
+ end
+ end
+ end
+ end
+ local r = referredpage(n) -- sort of obsolete
+ if p > r then
+ return 3 -- after
+ elseif p < r then
+ return 2 -- before
+ else
+ return 1 -- same
+ end
+end
+
+local function setreferencerealpage(actions)
+ if not actions then
+ actions = references.currentset
+ end
+ if type(actions) == "table" then
+ local realpage = actions.realpage
+ if realpage then
+ return realpage
+ end
+ local nofactions = #actions
+ if nofactions > 0 then
+ for i=1,nofactions do
+ local a = actions[i]
+ local what = runners[a.kind]
+ if what then
+ what = what(a,actions) -- needs documentation
+ end
+ end
+ realpage = actions.realpage
+ if realpage then
+ return realpage
+ end
+ end
+ actions.realpage = 0
+ end
+ return 0
+end
+
+references.setreferencerealpage = setreferencerealpage
+
+-- we store some analysis data alongside the indexed array
+-- at this moment only the real reference page is analyzed
+-- normally such an analysis happens in the backend code
+
+function references.analyze(actions,position,spread)
+ if not actions then
+ actions = references.currentset
+ end
+ if not actions then
+ actions = { realpage = 0, pagestate = 0 }
+ elseif actions.pagestate then
+ -- already done
+ else
+ local realpage = actions.realpage or setreferencerealpage(actions)
+ if realpage == 0 then
+ actions.pagestate = 0
+ elseif actions.external then
+ actions.pagestate = 0
+ else
+ actions.pagestate = checkedpagestate(actions.n,realpage,actions,position,spread)
+ end
+ end
+ return actions
+end
+
+local function referencepagestate(position,detail,spread)
+ local actions = references.currentset
+ if not actions then
+ return 0
+ else
+ local pagestate = actions.pagestate
+ for i=1,#actions do
+ local a = actions[i]
+ if a.outer then
+ pagestate = 0
+ actions.pagestate = pagestate
+ break
+ end
+ end
+ if not pagestate then
+ references.analyze(actions,position,spread) -- delayed unless explicitly asked for
+ pagestate = actions.pagestate
+ end
+ if detail then
+ return pagestate
+ elseif pagestate == 4 then
+ return 2 -- compatible
+ elseif pagestate == 5 then
+ return 3 -- compatible
+ else
+ return pagestate
+ end
+ end
+end
+
+implement {
+ name = "referencepagestate",
+ actions = { referencepagestate, context },
+ arguments = "string"
+}
+
+implement {
+ name = "referencepagedetail",
+ actions = { referencepagestate, context },
+ arguments = { "string", "boolean", "boolean" }
+}
+
+-- local function referencerealpage()
+-- local actions = references.currentset
+-- return not actions and 0 or actions.realpage or setreferencerealpage(actions)
+-- end
+--
+-- implement {
+-- name = "referencerealpage",
+-- actions = { referencerealpage, context },
+-- -- arguments = "string" -- hm, weird
+-- }
+
+implement {
+ name = "askedreference",
+ public = true,
+ protected = true,
+ actions = function()
+ local actions = references.currentset
+ if actions then
+ context("[p=%s,r=%s]",actions.prefix or "",actions.reference)
+ end
+ end
+}
+
+implement {
+ name = "referencerealpage",
+ actions = function()
+ local actions = references.currentset
+ context(not actions and 0 or actions.realpage or setreferencerealpage(actions))
+ end
+}
+
+local function referencepos(key)
+ local actions = references.currentset
+ local i = actions[1].i -- brrr
+ local v = 0
+ if i then
+ local a = i.references
+ if a then
+ v = a[key] or 0
+ end
+ end
+ return v
+end
+
+implement { name = "referenceposx", actions = function() context("%p",referencepos("x")) end }
+implement { name = "referenceposy", actions = function() context("%p",referencepos("y")) end }
+
+implement {
+ name = "referencecolumn",
+ actions = function()
+ local actions = references.currentset
+ local column = 1
+ if actions then
+ column = jobpositions.columnofpos(actions.realpage or setreferencerealpage(actions),referencepos("x"))
+ end
+ context(column or 1)
+ end
+}
+
+local plist, nofrealpages
+
+local function realpageofpage(p) -- the last one counts !
+ if not plist then
+ local pages = structures.pages.collected
+ nofrealpages = #pages
+ plist = { }
+ for rp=1,nofrealpages do
+ local page = pages[rp]
+ if page then
+ plist[page.number] = rp
+ end
+ end
+ references.nofrealpages = nofrealpages
+ end
+ return plist[p]
+end
+
+references.realpageofpage = realpageofpage
+
+function references.checkedrealpage(r)
+ if not plist then
+ realpageofpage(r) -- just initialize
+ end
+ if not r then
+ return texgetcount(c_realpageno)
+ elseif r < 1 then
+ return 1
+ elseif r > nofrealpages then
+ return nofrealpages
+ else
+ return r
+ end
+end
+
+-- use local ?
+
+local pages = allocate {
+ [variables.firstpage] = function() return counters.record("realpage")["first"] end,
+ [variables.previouspage] = function() return counters.record("realpage")["previous"] end,
+ [variables.nextpage] = function() return counters.record("realpage")["next"] end,
+ [variables.lastpage] = function() return counters.record("realpage")["last"] end,
+
+ [variables.firstsubpage] = function() return counters.record("subpage" )["first"] end,
+ [variables.previoussubpage] = function() return counters.record("subpage" )["previous"] end,
+ [variables.nextsubpage] = function() return counters.record("subpage" )["next"] end,
+ [variables.lastsubpage] = function() return counters.record("subpage" )["last"] end,
+
+ [variables.forward] = function() return counters.record("realpage")["forward"] end,
+ [variables.backward] = function() return counters.record("realpage")["backward"] end,
+}
+
+references.pages = pages
+
+-- maybe some day i will merge this in the backend code with a testmode (so each
+-- runner then implements a branch)
+
+runners["inner"] = function(var,actions)
+ local r = var.r
+ if r then
+ actions.realpage = r
+ end
+end
+
+runners["special"] = function(var,actions)
+ local handler = specials[var.special]
+ return handler and handler(var,actions)
+end
+
+runners["special operation"] = runners["special"]
+runners["special operation with arguments"] = runners["special"]
+
+function specials.internal(var,actions)
+ local v = internals[tonumber(var.operation)]
+ local r = v and v.references
+ if r then
+ local p = r.realpage
+ if p then
+-- setmetatableindex(actions,r)
+ actions.realpage = p
+ actions.view = r.view
+ end
+ end
+end
+
+specials.i = specials.internal
+
+function specials.page(var,actions)
+ local o = var.operation
+ local p = pages[o]
+ if type(p) == "function" then
+ p = p()
+ else
+ p = tonumber(realpageofpage(tonumber(o)))
+ end
+ if p then
+ var.r = p
+ actions.realpage = actions.realpage or p -- first wins
+ end
+end
+
+function specials.realpage(var,actions)
+ local p = tonumber(var.operation)
+ if p then
+ var.r = p
+ actions.realpage = actions.realpage or p -- first wins
+ end
+end
+
+function specials.userpage(var,actions)
+ local p = tonumber(realpageofpage(var.operation))
+ if p then
+ var.r = p
+ actions.realpage = actions.realpage or p -- first wins
+ end
+end
+
+function specials.deltapage(var,actions)
+ local p = tonumber(var.operation)
+ if p then
+ p = references.checkedrealpage(p + texgetcount(c_realpageno))
+ var.r = p
+ actions.realpage = actions.realpage or p -- first wins
+ end
+end
+
+function specials.section(var,actions)
+ local sectionname = var.arguments
+ local destination = var.operation
+ local internal = structures.sections.internalreference(sectionname,destination)
+ if internal then
+ var.special = "internal"
+ var.operation = internal
+ var.arguments = nil
+ specials.internal(var,actions)
+ end
+end
+
+-- experimental:
+
+local p_splitter = lpeg.splitat(":")
+local p_lower = lpeg.patterns.utf8lower
+
+-- We can cache lowercased titles which saves a lot of time, but then
+-- we can better have a global cache with weak keys.
+
+-- local lowercache = table.setmetatableindex(function(t,k)
+-- local v = lpegmatch(p_lower,k)
+-- t[k] = v
+-- return v
+-- end)
+
+local lowercache = false
+
+local function locate(list,askedkind,askedname,pattern)
+ local kinds = lists.kinds
+ local names = lists.names
+ if askedkind and not kinds[askedkind] then
+ return false
+ end
+ if askedname and not names[askedname] then
+ return false
+ end
+ for i=1,#list do
+ local entry = list[i]
+ local metadata = entry.metadata
+ if metadata then
+ local found = false
+ if askedname then
+ local name = metadata.name
+ if name then
+ found = name == askedname
+ end
+ elseif askedkind then
+ local kind = metadata.kind
+ if kind then
+ found = kind == askedkind
+ end
+ end
+ if found then
+ local titledata = entry.titledata
+ if titledata then
+ local title = titledata.title
+ if title then
+ if lowercache then
+ found = lpegmatch(pattern,lowercache[title])
+ else
+ found = lpegmatch(pattern,lpegmatch(p_lower,title))
+ end
+ if found then
+ return {
+ inner = pattern,
+ kind = "inner",
+ reference = pattern,
+ i = entry,
+ p = "",
+ r = entry.references.realpage,
+ }
+ end
+ end
+ end
+ end
+ end
+ end
+end
+
+function functions.match(var,actions)
+ if not var.outer then
+ local operation = var.operation
+ if operation and operation ~= "" then
+ local operation = lpegmatch(p_lower,operation)
+ local list = lists.collected
+ local names = false
+ local kinds = false
+ local where, what = lpegmatch(p_splitter,operation)
+ if where and what then
+ local pattern = lpeg.finder(what)
+ return
+ locate(list,false,where,pattern)
+ or locate(list,where,false,pattern)
+ or { error = "no match" }
+ else
+ local pattern = lpeg.finder(operation)
+ -- todo: don't look at section and float in last pass
+ return
+ locate(list,"section",false,pattern)
+ or locate(list,"float",false,pattern)
+ or locate(list,false,false,pattern)
+ or { error = "no match" }
+ end
+ end
+ end
+end
+
+-- needs a better split ^^^
+
+-- done differently now:
+
+function references.export(usedname) end
+function references.import(usedname) end
+function references.load (usedname) end
+
+implement { name = "exportreferences", actions =references.export }
+
+-- better done here .... we don't insert/remove, just use a pointer
+
+local prefixstack = { "" }
+local prefixlevel = 1
+
+local function pushreferenceprefix(prefix)
+ prefixlevel = prefixlevel + 1
+ prefixstack[prefixlevel] = prefix
+ return prefix
+end
+
+local function popreferenceprefix()
+ prefixlevel = prefixlevel - 1
+ if prefixlevel > 0 then
+ return prefixstack[prefixlevel]
+ else
+ report_references("unable to pop referenceprefix")
+ return ""
+ end
+end
+
+implement {
+ name = "pushreferenceprefix",
+ actions = { pushreferenceprefix, context }, -- we can use setmacro
+ arguments = "string",
+}
+
+implement {
+ name = "popreferenceprefix",
+ actions = { popreferenceprefix, context }, -- we can use setmacro
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-ref.mklx b/Master/texmf-dist/tex/context/base/mkxl/strc-ref.mklx
index f3a90ed6764..e7073b36ded 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/strc-ref.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-ref.mklx
@@ -27,9 +27,17 @@
\writestatus{loading}{ConTeXt Structure Macros / Cross Referencing}
-\registerctxluafile{strc-rsc}{}
-\registerctxluafile{strc-ref}{}
-\registerctxluafile{node-ref}{autosuffix,optimize}
+\newif \iflocation
+\newinteger\locationcount
+\newinteger\locationorder
+\newbox \locationbox
+\newinteger\lastreferenceattribute
+\newinteger\lastdestinationattribute
+\newinteger\prefixcounter
+
+\registerctxluafile{strc-rsc}{autosuffix}
+\registerctxluafile{strc-ref}{autosuffix}
+\registerctxluafile{node-ref}{autosuffix}
\unprotect
@@ -62,29 +70,28 @@
\installdirectcommandhandler \??referencing {referencing} % \??referencing
-\mutable\let\referenceprefix \empty
-
-\mutable\let\currentdestinationattribute \empty
-
-\mutable\let\currentreferenceattribute \empty
-\mutable\let\currentreferencecoding \empty
-\mutable\let\currentreferencecontent \empty
-\mutable\let\currentreferencedata \empty
-\mutable\let\currentreferenceexpansion \empty
-\mutable\let\currentreferenceformatautocase\empty
-\mutable\let\currentreferenceformatlabel \empty
-\mutable\let\currentreferenceformatsetups \empty
-\mutable\let\currentreferenceformattype \empty
-\mutable\let\currentreferencekind \empty
-\mutable\let\currentreferencelabels \empty
-%mutable\let\currentreferencenumber \empty
-\mutable\let\currentreferenceorder \empty
-%mutable\let\currentreferencepage \empty
-%mutable\let\currentreferencerealpage \empty
-%mutable\let\currentreferencetext \empty
-%mutable\let\currentreferencetitle \empty
-\mutable\let\currentreferenceuserdata \empty
-
+\mutable\lettonothing\referenceprefix
+
+\mutable\lettonothing\currentdestinationattribute
+
+\mutable\lettonothing\currentreferenceattribute
+\mutable\lettonothing\currentreferencecoding
+\mutable\lettonothing\currentreferencecontent
+\mutable\lettonothing\currentreferencedata
+\mutable\lettonothing\currentreferenceexpansion
+\mutable\lettonothing\currentreferenceformatautocase
+\mutable\lettonothing\currentreferenceformatlabel
+\mutable\lettonothing\currentreferenceformatsetups
+\mutable\lettonothing\currentreferenceformattype
+\mutable\lettonothing\currentreferencekind
+\mutable\lettonothing\currentreferencelabels
+%mutable\lettonothing\currentreferencenumber
+%mutable\lettonothing\currentreferenceorder
+%mutable\lettonothing\currentreferencepage
+%mutable\lettonothing\currentreferencerealpage
+%mutable\lettonothing\currentreferencetext
+%mutable\lettonothing\currentreferencetitle
+\mutable\lettonothing\currentreferenceuserdata
\newif\ifreferencing \referencingtrue
@@ -138,8 +145,8 @@
%D Actually there is not much difference between a text and a full reference, but
%D it's the concept that counts. The low level implementation is:
-\newcount\lastreferenceattribute
-\newcount\lastdestinationattribute
+% sett top : \newinteger\lastreferenceattribute
+% sett top : \newinteger\lastdestinationattribute
\def\strc_references_finish#prefix#reference#internal% gets expanded anyway
{\normalexpanded{\clf_deferredenhancereference{#prefix}{#reference}}}
@@ -164,7 +171,6 @@
\prewordbreak % to be tested: \removeunwantedspaces\permithyphenation
\fi}
-
\protected\def\strc_references_set_named_reference
{\ifreferencing
\expandafter\strc_references_set_named_reference_indeed
@@ -188,7 +194,7 @@
\protected\def\strc_references_destination_point_yes
{\strc_references_inject_before % new
\dostarttagged\t!reference\empty
- \dontleavehmode\hbox attr \destinationattribute\lastdestinationattribute\bgroup
+ \dontleavehmode\hbox attr \destinationattribute\lastdestinationattribute\bgroup % \hpack
\strc_references_flush_destination_nodes
\strc_references_placeholder
\egroup
@@ -198,7 +204,7 @@
\protected\def\strc_references_destination_point_nop
{\strc_references_inject_before % new
\dostarttagged\t!reference\empty
- \dontleavehmode\hbox \bgroup
+ \dontleavehmode\hbox \bgroup % \hpack
\strc_references_flush_destination_nodes
\strc_references_placeholder
\egroup
@@ -369,7 +375,7 @@
\ifnum\lastdestinationattribute>\zerocount
\edef#cs{attr \destinationattribute\number\lastdestinationattribute}%
\else
- \let#cs\empty
+ \lettonothing#cs%
\fi}
%D It's about time to clean up references .. stable enough now.
@@ -446,8 +452,8 @@
{\referenceprefix}%
{#label}%
{%
- height \ht\strutbox
- depth \dp\strutbox
+ height \strutht
+ depth \strutdp
\extrareferencearguments
}%
\relax
@@ -536,7 +542,7 @@
%D one keeps references local, but the global ones in view. To enable this feature,
%D we explictly split the prefix from the reference.
-\let\referenceprefix\empty
+\lettonothing\referenceprefix
%D For a long time the only way to access an external file was to use the file
%D prefix (\type {somefile::}. However, when you split up a document, redefining the
@@ -574,13 +580,11 @@
%D
%D We also use the odd/even characteristic to determine the page state.
-\mutable\let\currentrealreference \empty
-\mutable\let\currentpagereference \empty
-\mutable\let\currenttextreference \empty
-\mutable\let\currentsubtextreference \empty
-\mutable\let\currentsubsubtextreference\empty
-
-\newcount\referencehastexstate % set in backend
+\mutable\lettonothing\currentrealreference
+\mutable\lettonothing\currentpagereference
+\mutable\lettonothing\currenttextreference
+\mutable\lettonothing\currentsubtextreference
+\mutable\lettonothing\currentsubsubtextreference
% referencepagestate:
%
@@ -692,19 +696,15 @@
\newconditional\gotonewwindow \setfalse\gotonewwindow
-\permanent\def\expandtexincurrentreference % will happen in lua some time
- {\ifcase\referencehastexstate\else\clf_expandcurrentreference\fi}
+\permanent\def\doifelsereferencefound#label%
+ {\clf_doifelsereference{\referenceprefix}{#label}{\extrareferencearguments}}
-\permanent\def\expandreferenceoperation#tag#content{\clf_setreferenceoperation#tag{#content}}
-\permanent\def\expandreferencearguments#tag#content{\clf_setreferencearguments#tag{#content}}
+\aliased\let\doifreferencefoundelse\doifelsereferencefound
-\permanent\def\doifelsereferencefound#label#yes#nop%
- {\clf_doifelsereference{\referenceprefix}{#label}{\extrareferencearguments}%
- {\expandtexincurrentreference
- #yes}%
- {#nop}}
+\permanent\def\doifelsereferencechecked#label%
+ {\clf_doifelsereferencechecked{\referenceprefix}{#label}{\extrareferencearguments}}
-\aliased\let\doifreferencefoundelse\doifelsereferencefound
+\aliased\let\doifcheckedreferencefoundelse\doifelsereferencechecked
%D The tester only splits the reference in components but does not look into them.
%D The following macro does a preroll and determines for instance the current real
@@ -798,8 +798,8 @@
%D
%D The flag \type {\iflocation} signals if we're in interactive mode.
-\ifdefined\buttonheight \else \newdimen\buttonheight \fi
-\ifdefined\buttonwidth \else \newdimen\buttonwidth \fi
+\ifdefined\buttonheight \else \newdimension\buttonheight \fi
+\ifdefined\buttonwidth \else \newdimension\buttonwidth \fi
%D Internal references can best be set using the next few macros. Setting such
%D references to unique values is completely up to the macros that call them.
@@ -811,22 +811,28 @@
%D
%D We could do this in \LUA\ \unknown
-\newif \iflocation
-\newcount\locationcount
-\newcount\locationorder
-\newbox \locationbox
+% seet top: \newif \iflocation
+% seet top: \newinteger\locationcount
+% seet top: \newinteger\locationorder
+% seet top: \newbox \locationbox
+
+\appendtoks
+ \locationfalse
+\to \everypreroll
\permanent\def\nextinternalreference {\the\locationcount}
\permanent\def\nextinternalorderreference{\the\locationorder}
\permanent\def\setnextinternalreference
- {\global\advance\locationcount\plusone}
-
-\permanent\def\setnextinternalreferences#kind#name% plural
- {\clf_setnextinternalreference{#kind}{#name}}
+ {\global\advanceby\locationcount\plusone}
-\permanent\def\getinternalorderreference#kind#name%
- {\clf_currentreferenceorder{#kind}{#name}}
+% defined at the lua end
+%
+% \permanent\def\setnextinternalreferences#kind#name% plural
+% {\clf_setnextinternalreference{#kind}{#name}}
+%
+% \permanent\def\getinternalorderreference#kind#name%
+% {\clf_currentreferenceorder{#kind}{#name}}
\permanent\def\thisissomeinternal#kind#name% only for old time sake, will go away
{\begingroup
@@ -838,7 +844,7 @@
\installcorenamespace{savedinternalreference}
-\letvalue{\??savedinternalreference\s!default}\!!zerocount
+\letcsname\??savedinternalreference\s!default\endcsname\!!zerocount
\permanent\protected\def\storeinternalreference#1#2%
{\xdefcsname\??savedinternalreference\currentstructurename\endcsname{\number#2}}
@@ -876,7 +882,7 @@
%D \type {\prefix} variable to \type {+}, the prefix is incremented, when set to
%D \type {-} or empty, the prefix is reset. Other values become the prefix.
-\newcount\prefixcounter
+% \see top: newinteger\prefixcounter
\newconditional\autocrossfilereferences
@@ -917,14 +923,14 @@
\permanent\protected\def\setupreferenceprefix[#prefix]%
{\edef\p_prefix{#prefix}%
\ifempty\p_prefix
- \let\referenceprefix\empty
+ \lettonothing\referenceprefix
\orelse\ifx\p_prefix\m_strc_references_prefix_yes
\letreferencingparameter\c!prefix\s!unknown
- \global\advance\prefixcounter\plusone
+ \global\advanceby\prefixcounter\plusone
\edef\referenceprefix{\the\prefixcounter}%
\orelse\ifx\p_prefix\m_strc_references_prefix_nop
\letreferencingparameter\c!prefix\s!unknown
- \let\referenceprefix\empty
+ \lettonothing\referenceprefix
\orelse\ifx\p_prefix\s!unknown
% forget about it
\else
@@ -997,6 +1003,8 @@
\permanent\def\currentreferencetext {\clf_filterreference{text}}
%permanent\def\currentreferencedefault {\clf_filterreference{default}}
\permanent\def\currentreferencerealpage{\clf_filterreference{realpage}}
+\aliased \let\currentreferenceorder \getinternalorderreference
+
%D The most straightforward way of retrieving references is using \type {\ref}.
@@ -1068,7 +1076,7 @@
% }
% }
-\newcount \nofreferencestates
+\newinteger \nofreferencestates
\newconditional\pagestatespread
\appendtoks
@@ -1117,7 +1125,7 @@
% issue warning that not stable
\else
% needs checking ... but probably never in trialmode
- \global\advance\nofreferencestates\plusone
+ \global\advanceby\nofreferencestates\plusone
\xypos{rst::\number\nofreferencestates}%
% \tracedpagestate
\fi
@@ -1130,7 +1138,7 @@
\def\strc_references_handle_page_state_yes
{\markreferencepage
- \ifcase\referencepagedetail
+ \ifcase\referencepagedetail\relax
\expandafter\sixthofsixarguments \or
\expandafter\thirdofsixarguments \or
\expandafter\firstofsixarguments \or
@@ -1209,9 +1217,9 @@
\newtoks\defaultleftreferencetoks
\newtoks\defaultrightreferencetoks
-\permanent\let\rightofreferencecontent\empty
-\permanent\let\leftofreference \empty
-\permanent\let\rightofreference \empty
+\permanent\lettonothing\rightofreferencecontent
+\permanent\lettonothing\leftofreference
+\permanent\lettonothing\rightofreference
\permanent\protected\def\leftofreferencecontent
{\removeunwantedspaces
@@ -1230,20 +1238,20 @@
\doifelsesometoks\rightreferencetoks\rightofreferencecontent\donothing
\the\rightreferencetoks}
-\letvalue{\??referencinginteraction\v!all}\strc_references_interaction_all
+\letcsname\??referencinginteraction\v!all\endcsname\strc_references_interaction_all
-\setvalue{\??referencinginteraction\v!label}%
+\defcsname\??referencinginteraction\v!label\endcsname
{\leftofreference
\the\leftreferencetoks
\the\rightreferencetoks
\rightofreference}
-\setvalue{\??referencinginteraction\v!text}%
+\defcsname\??referencinginteraction\v!text\endcsname
{\leftofreference
\currentreferencecontent
\rightofreference}
-\setvalue{\??referencinginteraction\v!symbol}%
+\defcsname\??referencinginteraction\v!symbol\endcsname
{\referencesymbol}
\permanent\def\referencesequence
@@ -1276,14 +1284,14 @@
{#1}%
\else
\defaultleftreferencetoks
- \enforced\let\leftofreferencecontent\empty
+ \enforced\lettonothing\leftofreferencecontent
\fi
\rightreferencetoks
\ifparameter#2\or
{#2}%
\else
\defaultrightreferencetoks
- \enforced\let\rightofreferencecontent\empty
+ \enforced\lettonothing\rightofreferencecontent
\fi
% inefficient: double resolve
\doifelsereferencefound{#3} % we need to resolve the text
@@ -1403,8 +1411,8 @@
\def\currentreferencecontent{\directsetup\currentreferenceformatsetups}%
\fi
%
- \enforced\let\leftofreferencecontent \empty
- \enforced\let\rightofreferencecontent\empty
+ \enforced\lettonothing\leftofreferencecontent
+ \enforced\lettonothing\rightofreferencecontent
\strc_references_pickup_goto}
\permanent\protected\def\autoreferencelabeltext
@@ -1471,7 +1479,7 @@
% The unbox trick is needed in order to permit \par inside a reference. Otherwise
% the reference attribute migrates to the outer boxes.
-\newcount\lastsavedreferenceattribute
+\newinteger\lastsavedreferenceattribute
\newbox\referencebox
@@ -1488,8 +1496,8 @@
{\referenceprefix}%
{#label}%
{%
- height \ht\strutbox
- depth \dp\strutbox
+ height \strutht
+ depth \strutdp
\extrareferencearguments
}%
\relax
@@ -1539,10 +1547,9 @@
\c_attr_reference\attributeunsetvalue
\iflocation
\clf_doifelsereference{\referenceprefix}{#label}{\extrareferencearguments}%
- {\expandtexincurrentreference
- \clf_injectcurrentreferencehtdp
- \ht\strutbox
- \dp\strutbox
+ {\clf_injectcurrentreferencehtdp
+ \strutht
+ \strutdp
\relax
\setlocationattributes
\setstrut % can be option
@@ -1588,7 +1595,7 @@
\expandafter\strc_references_start_goto_nop
\fi}
-\aliased\let\stopgoto\relax
+\permanent\protected\lettonothing\stopgoto
\permanent\protected\def\strc_references_start_goto_nop
{\enforced\let\stopgoto\strc_references_stop_goto_nop}
@@ -1597,10 +1604,9 @@
{\endgroup}
\protected\def\strc_references_start_goto_yes
- {\expandtexincurrentreference
- \clf_injectcurrentreferencehtdp
- \ht\strutbox
- \dp\strutbox
+ {\clf_injectcurrentreferencehtdp
+ \strutht
+ \strutdp
\relax
\setlocationattributes
\setstrut % can be option
@@ -1620,8 +1626,7 @@
\c_attr_reference\attributeunsetvalue
\iflocation
\clf_doifelsereference{\referenceprefix}{#label}{\extrareferencearguments}%
- {\expandtexincurrentreference
- \clf_injectcurrentreferencehtdp
+ {\clf_injectcurrentreferencehtdp
\dimexpr\interactionparameter\c!height\relax
\dimexpr\interactionparameter\c!depth \relax
\relax
@@ -1706,8 +1711,7 @@
\c_attr_reference\attributeunsetvalue
\iflocation
\clf_doifelsereference{\referenceprefix}{#label}{\extrareferencearguments}%
- {\expandtexincurrentreference
- \clf_injectcurrentreference
+ {\clf_injectcurrentreference
\setlocationattributes
\global\lastsavedreferenceattribute\lastreferenceattribute
\dostarttagged\t!link\empty
@@ -2019,8 +2023,6 @@
\definereference [\v!LastPage ] [action(last)]
\definereference [\v!NextJump ] [action(forward)]
\definereference [\v!NextPage ] [action(next)]
-\definereference [\v!PauseMovie ] [action(pausemovie)]
-\definereference [\v!PauseSound ] [action(pausesound)]
\definereference [\v!PauseRendering ] [action(pauserendering)]
\definereference [\v!PreviousJump ] [action(backward)]
\definereference [\v!PreviousPage ] [action(previous)]
@@ -2028,19 +2030,13 @@
\definereference [\v!SaveForm ] [action(exportform)]
\definereference [\v!LoadForm ] [action(importform)]
\definereference [\v!ResetForm ] [action(resetform)]
-\definereference [\v!ResumeMovie ] [action(resumemovie)]
-\definereference [\v!ResumeSound ] [action(resumesound)]
\definereference [\v!ResumeRendering ] [action(resumerendering)]
\definereference [\v!SaveDocument ] [action(save)]
\definereference [\v!SaveNamedDocument] [action(savenamed)]
\definereference [\v!OpenNamedDocument] [action(opennamed)]
\definereference [\v!SearchDocument ] [action(search)]
\definereference [\v!SearchAgain ] [action(searchagain)]
-\definereference [\v!StartMovie ] [action(startmovie)]
-\definereference [\v!StartSound ] [action(startsound)]
\definereference [\v!StartRendering ] [action(startrendering)]
-\definereference [\v!StopMovie ] [action(stopmovie)]
-\definereference [\v!StopSound ] [action(stopsound)]
\definereference [\v!StopRendering ] [action(stoprendering)]
\definereference [\v!SubmitForm ] [action(submitform)]
\definereference [\v!ToggleViewer ] [action(toggle)]
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-reg.lmt b/Master/texmf-dist/tex/context/base/mkxl/strc-reg.lmt
new file mode 100644
index 00000000000..a3a7dae6c88
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-reg.lmt
@@ -0,0 +1,1698 @@
+if not modules then modules = { } end modules ['strc-reg'] = {
+ version = 1.001,
+ comment = "companion to strc-reg.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local next, type, tonumber, rawget = next, type, tonumber, rawget
+local char, format, gmatch = string.char, string.format, string.gmatch
+local equal, concat, remove = table.are_equal, table.concat, table.remove
+local lpegmatch, lpegpatterns, P, C, Ct, Cs = lpeg.match, lpeg.patterns, lpeg.P, lpeg.C, lpeg.Ct, lpeg.Cs
+local allocate = utilities.storage.allocate
+
+local trace_registers = false trackers.register("structures.registers", function(v) trace_registers = v end)
+
+local report_registers = logs.reporter("structure","registers")
+
+local structures = structures
+local registers = structures.registers
+local helpers = structures.helpers
+local sections = structures.sections
+local documents = structures.documents
+local pages = structures.pages
+local references = structures.references
+
+local usedinternals = references.usedinternals
+
+local mappings = sorters.mappings
+local entries = sorters.entries
+local replacements = sorters.replacements
+
+local processors = typesetters.processors
+local splitprocessor = processors.split
+
+local texgetcount = tex.getcount
+local texiscount = tex.iscount
+
+local variables = interfaces.variables
+local v_forward = variables.forward
+local v_all = variables.all
+local v_no = variables.no
+local v_yes = variables.yes
+local v_packed = variables.packed
+local v_current = variables.current
+local v_previous = variables.previous
+local v_first = variables.first
+local v_last = variables.last
+local v_text = variables.text
+local v_section = variables.section
+
+local context = context
+local ctx_latelua = context.latelua
+
+local implement = interfaces.implement
+
+local matchingtilldepth = sections.matchingtilldepth
+local numberatdepth = sections.numberatdepth
+local currentlevel = sections.currentlevel
+local currentid = sections.currentid
+
+local touserdata = helpers.touserdata
+
+local internalreferences = references.internals
+local setinternalreference = references.setinternalreference
+
+local setmetatableindex = table.setmetatableindex
+
+local absmaxlevel = 5 -- \c_strc_registers_maxlevel
+
+local c_realpageno = texiscount("realpageno")
+local c_locationcount = texiscount("locationcount")
+
+local h_prefixpage = helpers.prefixpage
+local h_prefixlastpage = helpers.prefixlastpage
+local h_title = helpers.title
+local h_prefix = helpers.prefix
+
+local ctx_startregisteroutput = context.startregisteroutput
+local ctx_stopregisteroutput = context.stopregisteroutput
+local ctx_startregistersection = context.startregistersection
+local ctx_stopregistersection = context.stopregistersection
+local ctx_startregisterentries = context.startregisterentries
+local ctx_stopregisterentries = context.stopregisterentries
+local ctx_startregisterentry = context.startregisterentry
+local ctx_stopregisterentry = context.stopregisterentry
+local ctx_startregisterpages = context.startregisterpages
+local ctx_stopregisterpages = context.stopregisterpages
+local ctx_startregisterseewords = context.startregisterseewords
+local ctx_stopregisterseewords = context.stopregisterseewords
+
+local ctx_registerentry = context.registerentry
+local ctx_registerseeword = context.registerseeword
+local ctx_registerpagerange = context.registerpagerange
+local ctx_registeronepage = context.registeronepage
+local ctx_registersection = context.registersection
+local ctx_registerpacked = context.registerpacked
+
+-- possible export, but ugly code (overloads)
+--
+-- local output, section, entries, nofentries, pages, words, rawtext
+--
+-- h_title = function(a,b) rawtext = a end
+--
+-- local function ctx_startregisteroutput()
+-- output = { }
+-- section = nil
+-- entries = nil
+-- nofentries = nil
+-- pages = nil
+-- words = nil
+-- rawtext = nil
+-- end
+-- local function ctx_stopregisteroutput()
+-- inspect(output)
+-- output = nil
+-- section = nil
+-- entries = nil
+-- nofentries = nil
+-- pages = nil
+-- words = nil
+-- rawtext = nil
+-- end
+-- local function ctx_startregistersection(tag)
+-- section = { }
+-- output[#output+1] = {
+-- section = section,
+-- tag = tag,
+-- }
+-- end
+-- local function ctx_stopregistersection()
+-- end
+-- local function ctx_startregisterentries(n)
+-- entries = { }
+-- nofentries = 0
+-- section[#section+1] = entries
+-- end
+-- local function ctx_stopregisterentries()
+-- end
+-- local function ctx_startregisterentry(n) -- or subentries (nested?)
+-- nofentries = nofentries + 1
+-- entry = { }
+-- entries[nofentries] = entry
+-- end
+-- local function ctx_stopregisterentry()
+-- nofentries = nofentries - 1
+-- entry = entries[nofentries]
+-- end
+-- local function ctx_startregisterpages()
+-- pages = { }
+-- entry.pages = pages
+-- end
+-- local function ctx_stopregisterpages()
+-- end
+-- local function ctx_startregisterseewords()
+-- words = { }
+-- entry.words = words
+-- end
+-- local function ctx_stopregisterseewords()
+-- end
+-- local function ctx_registerentry(processor,internal,seeparent,text)
+-- text()
+-- entry.text = {
+-- processor = processor,
+-- internal = internal,
+-- seeparent = seeparent,
+-- text = rawtext,
+-- }
+-- end
+-- local function ctx_registerseeword(i,n,processor,internal,seeindex,seetext)
+-- seetext()
+-- entry.words[i] = {
+-- processor = processor,
+-- internal = internal,
+-- seeparent = seeparent,
+-- seetext = rawtext,
+-- }
+-- end
+-- local function ctx_registerpagerange(fprocessor,finternal,frealpage,lprocessor,linternal,lrealpage)
+-- pages[#pages+1] = {
+-- first = {
+-- processor = fprocessor,
+-- internal = finternal,
+-- realpage = frealpage,
+-- },
+-- last = {
+-- processor = lprocessor,
+-- internal = linternal,
+-- realpage = lrealpage,
+-- },
+-- }
+-- end
+-- local function ctx_registeronepage(processor,internal,realpage)
+-- pages[#pages+1] = {
+-- processor = processor,
+-- internal = internal,
+-- realpage = realpage,
+-- }
+-- end
+
+-- some day we will share registers and lists (although there are some conceptual
+-- differences in the application of keywords)
+
+local function filtercollected(names,criterium,number,collected,prevmode)
+ if not criterium or criterium == "" then
+ criterium = v_all
+ end
+ local data = documents.data
+ local numbers = data.numbers
+ local depth = data.depth
+ local hash = { }
+ local result = { }
+ local nofresult = 0
+ local all = not names or names == "" or names == v_all
+ local detail = nil
+ if not all then
+ for s in gmatch(names,"[^, ]+") do
+ hash[s] = true
+ end
+ end
+ if criterium == v_all or criterium == v_text then
+ for i=1,#collected do
+ local v = collected[i]
+ if all then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ else
+ local vmn = v.metadata and v.metadata.name
+ if hash[vmn] then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ end
+ end
+ end
+ elseif criterium == v_current then
+ local collectedsections = sections.collected
+ for i=1,#collected do
+ local v = collected[i]
+ local sectionnumber = collectedsections[v.references.section]
+ if sectionnumber then
+ local cnumbers = sectionnumber.numbers
+ if prevmode then
+ if (all or hash[v.metadata.name]) and #cnumbers >= depth then -- is the = ok for lists as well?
+ local ok = true
+ for d=1,depth do
+ if not (cnumbers[d] == numbers[d]) then -- no zero test
+ ok = false
+ break
+ end
+ end
+ if ok then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ end
+ end
+ else
+ if (all or hash[v.metadata.name]) and #cnumbers > depth then
+ local ok = true
+ for d=1,depth do
+ local cnd = cnumbers[d]
+ if not (cnd == 0 or cnd == numbers[d]) then
+ ok = false
+ break
+ end
+ end
+ if ok then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ end
+ end
+ end
+ end
+ end
+ elseif criterium == v_previous then
+ local collectedsections = sections.collected
+ for i=1,#collected do
+ local v = collected[i]
+ local sectionnumber = collectedsections[v.references.section]
+ if sectionnumber then
+ local cnumbers = sectionnumber.numbers
+ if (all or hash[v.metadata.name]) and #cnumbers >= depth then
+ local ok = true
+ if prevmode then
+ for d=1,depth do
+ if not (cnumbers[d] == numbers[d]) then
+ ok = false
+ break
+ end
+ end
+ else
+ for d=1,depth do
+ local cnd = cnumbers[d]
+ if not (cnd == 0 or cnd == numbers[d]) then
+ ok = false
+ break
+ end
+ end
+ end
+ if ok then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ end
+ end
+ end
+ end
+ elseif criterium == variables["local"] then
+ if sections.autodepth(data.numbers) == 0 then
+ return filtercollected(names,v_all,number,collected,prevmode)
+ else
+ return filtercollected(names,v_current,number,collected,prevmode)
+ end
+ else -- sectionname, number
+ -- beware, this works ok for registers
+ -- to be redone with reference instead
+ local depth = sections.getlevel(criterium)
+ local number = tonumber(number) or numberatdepth(depth) or 0
+ if trace_registers then
+ detail = format("depth: %s, number: %s, numbers: %s, startset: %s",depth,number,concat(sections.numbers(),".",1,depth),#collected)
+ end
+ if number > 0 then
+ for i=1,#collected do
+ local v = collected[i]
+ local r = v.references
+ if r then
+ local sectionnumber = sections.collected[r.section]
+ if sectionnumber then
+ local metadata = v.metadata
+ local cnumbers = sectionnumber.numbers
+ if cnumbers then
+ if (all or hash[metadata.name or false]) and #cnumbers >= depth and matchingtilldepth(depth,cnumbers) then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ if trace_registers then
+ if detail then
+ report_registers("criterium %a, detail %a, found %a",criterium,detail,#result)
+ else
+ report_registers("criterium %a, detail %a, found %a",criterium,nil,#result)
+ end
+ end
+ return result
+end
+
+local tobesaved = allocate()
+local collected = allocate()
+
+registers.collected = collected
+registers.tobesaved = tobesaved
+registers.filtercollected = filtercollected
+
+-- we follow a different strategy than by lists, where we have a global
+-- result table; we might do that here as well but since sorting code is
+-- older we delay that decision
+
+-- maybe store the specification in the format (although we predefine only
+-- saved registers)
+
+local function checker(t,k)
+ local v = {
+ metadata = {
+ language = 'en',
+ sorted = false,
+ class = class,
+ },
+ entries = { },
+ }
+ t[k] = v
+ return v
+end
+
+local function initializer()
+ tobesaved = registers.tobesaved
+ collected = registers.collected
+ setmetatableindex(tobesaved,checker)
+ setmetatableindex(collected,checker)
+ local usedinternals = references.usedinternals
+ for name, list in next, collected do
+ local entries = list.entries
+ if not list.metadata.notsaved then
+ for e=1,#entries do
+ local entry = entries[e]
+ local r = entry.references
+ if r then
+ local internal = r and r.internal
+ if internal then
+ internalreferences[internal] = entry
+ usedinternals[internal] = r.used
+ end
+ end
+ end
+ end
+ end
+ -- references.sortedinternals = sortedkeys(internalreferences) -- todo: when we need it more than once
+end
+
+local function finalizer()
+ local flaginternals = references.flaginternals
+ local usedviews = references.usedviews
+ for k, v in next, tobesaved do
+ local entries = v.entries
+ if entries then
+ for i=1,#entries do
+ local r = entries[i].references
+ if r then
+ local i = r.internal
+ local f = flaginternals[i]
+ if f then
+ r.used = usedviews[i] or true
+ end
+ end
+ end
+ end
+ end
+end
+
+job.register('structures.registers.collected', tobesaved, initializer, finalizer)
+
+setmetatableindex(tobesaved,checker)
+setmetatableindex(collected,checker)
+
+local function defineregister(class,method)
+ local d = tobesaved[class]
+ if method == v_forward then
+ d.metadata.notsaved = true
+ end
+end
+
+registers.define = defineregister -- 4 times is somewhat over the top but we want consistency
+registers.setmethod = defineregister -- and we might have a difference some day
+
+implement {
+ name = "defineregister",
+ actions = defineregister,
+ arguments = "2 strings",
+}
+
+implement {
+ name = "setregistermethod",
+ actions = defineregister, -- duplicate use
+ arguments = "2 strings",
+}
+
+local p_s = P("+") -- & obsolete in mkiv
+local p_e = P("&") * (1-P(";"))^0 * P(";")
+local p_r = C((p_e + (1-p_s))^0)
+
+local p_t = Cs ( (
+ lpegpatterns.nestedbraces
+--+ lpegpatterns.nestedbrackets
+ + lpegpatterns.nestedparents
+ + P("$") * (1-P("$"))^1 * P("$")
+ + (1-p_s)
+ )^1)
+
+local entrysplitter_xml = Ct(p_r * (p_s * p_r)^0) -- bah
+----- entrysplitter_tex = lpeg.tsplitat('+')
+local entrysplitter_tex = Ct((p_t * p_s^-1)^0)
+
+local tagged = { }
+
+-- this whole splitting is an inheritance of mkii
+
+local function preprocessentries(rawdata)
+ local entries = rawdata.entries
+ if entries then
+ local processors = rawdata.processors
+ local et = entries.entries
+ local kt = entries.keys
+ local pt = entries.processors
+ local entryproc = processors and processors.entry
+ local pageproc = processors and processors.page
+ local coding = rawdata.metadata.coding
+ if entryproc == "" then
+ entryproc = nil
+ end
+ if pageproc == "" then
+ pageproc = nil
+ end
+ if not et then
+ local p, e = splitprocessor(entries.entry or "")
+ if p then
+ entryproc = p
+ end
+ et = lpegmatch(coding == "xml" and entrysplitter_xml or entrysplitter_tex,e)
+ end
+ if not kt then
+ local p, k = splitprocessor(entries.key or "")
+ if p then
+ pageproc = p
+ end
+ kt = lpegmatch(coding == "xml" and entrysplitter_xml or entrysplitter_tex,k)
+ end
+ if not pt then
+ pt = { }
+ end
+ --
+ entries = { }
+ local ok = false
+ for k=#et,1,-1 do
+ local etk = et[k]
+ local ktk = kt[k]
+ local ptk = pt[k]
+ if not ok and etk == "" then
+ entries[k] = nil
+ else
+ if not etk then
+ etk = ""
+ end
+ -- we save some space by pruning
+ if ptk == "" then
+ ptk = nil
+ end
+ -- we save even more space by pruning
+ if ktk == "" then
+ if ptk then
+ ktk = false
+ else
+ ktk = nil
+ end
+ end
+ entries[k] = { etk, ktk, ptk }
+ ok = true
+ end
+ end
+ rawdata.list = entries
+ if pageproc or entryproc then
+ rawdata.processors = { entryproc, pageproc } -- old way: indexed .. will be keys
+ end
+ rawdata.entries = nil
+ end
+ local seeword = rawdata.seeword
+ if seeword then
+ seeword.processor, seeword.text = splitprocessor(seeword.text or "")
+ end
+end
+
+local function storeregister(rawdata) -- metadata, references, entries
+ local references = rawdata.references
+ local metadata = rawdata.metadata
+ -- checking
+ if not metadata then
+ metadata = { }
+ rawdata.metadata = metadata
+ end
+ --
+ if not metadata.kind then
+ metadata.kind = "entry"
+ end
+ --
+ --
+ if not metadata.catcodes then
+ metadata.catcodes = tex.catcodetable -- get
+ end
+ --
+ local name = metadata.name
+ local notsaved = tobesaved[name].metadata.notsaved
+ --
+ if not references then
+ references = { }
+ rawdata.references = references
+ end
+ --
+ local internal = references.internal
+ if not internal then
+ internal = texgetcount(c_locationcount) -- we assume that it has been set
+ references.internal = internal
+ end
+ --
+ if notsaved then
+ usedinternals[internal] = references.used -- todo view (we assume that forward references index entries are used)
+ end
+ --
+ if not references.realpage then
+ references.realpage = 0 -- just to be sure as it can be refered to
+ end
+ --
+ local userdata = rawdata.userdata
+ if userdata then
+ rawdata.userdata = touserdata(userdata)
+ end
+ --
+ references.section = currentid()
+ metadata.level = currentlevel()
+ --
+ local data = notsaved and collected[name] or tobesaved[name]
+ local entries = data.entries
+ --
+ internalreferences[internal] = rawdata
+ preprocessentries(rawdata)
+ entries[#entries+1] = rawdata
+ local label = references.label
+ if label and label ~= "" then
+ tagged[label] = #entries
+ else
+ references.label = nil
+ end
+ return #entries
+end
+
+local function enhanceregister(specification)
+ local name = specification.name
+ local n = specification.n
+ local saved = tobesaved[name]
+ local data = saved.metadata.notsaved and collected[name] or saved
+ local entry = data.entries[n]
+ if entry then
+ entry.references.realpage = texgetcount(c_realpageno)
+ end
+end
+
+-- This can become extendregister(specification)!
+
+local function extendregister(name,tag,rawdata) -- maybe do lastsection internally
+ if type(tag) == "string" then
+ tag = tagged[tag]
+ end
+ if tag then
+ local data = tobesaved[name].metadata.notsaved and collected[name] or tobesaved[name]
+ local entry = data.entries[tag]
+ if entry then
+ local references = entry.references
+ references.lastrealpage = texgetcount(c_realpageno)
+ references.lastsection = currentid()
+ if rawdata then
+ local userdata = rawdata.userdata
+ if userdata then
+ rawdata.userdata = touserdata(userdata)
+ end
+ if rawdata.entries then
+ preprocessentries(rawdata)
+ end
+ local metadata = rawdata.metadata
+ if metadata and not metadata.catcodes then
+ metadata.catcodes = tex.catcodetable -- get
+ end
+ for k, v in next, rawdata do
+ local rk = references[k]
+ if not rk then
+ references[k] = v
+ else
+ for kk, vv in next, v do
+ if type(vv) == "table" then
+ if next(vv) then
+ rk[kk] = vv
+ end
+ elseif vv ~= "" then
+ rk[kk] = vv
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+end
+
+registers.store = storeregister
+registers.enhance = enhanceregister
+registers.extend = extendregister
+
+function registers.get(tag,n)
+ local list = tobesaved[tag]
+ return list and list.entries[n]
+end
+
+implement {
+ name = "enhanceregister",
+ arguments = { "string", "integer" },
+ actions = function(name,n)
+ enhanceregister { name = name, n = n } -- todo: move to scanner
+ end,
+}
+
+implement {
+ name = "deferredenhanceregister",
+ arguments = { "string", "integer" },
+ protected = true,
+ actions = function(name,n)
+ ctx_latelua { action = enhanceregister, name = name, n = n }
+ end,
+}
+
+implement {
+ name = "extendregister",
+ actions = extendregister,
+ arguments = "2 strings",
+}
+
+implement {
+ name = "storeregister",
+ -- actions = function(rawdata)
+ -- local nofentries = storeregister(rawdata)
+ -- setinternalreference { internal = rawdata.references.internal }
+ -- context(nofentries)
+ -- end,
+ actions = { storeregister, context },
+ arguments = {
+ {
+ { "metadata", {
+ { "kind" },
+ { "name" },
+ { "coding" },
+ { "level", "integer" },
+ { "catcodes", "integer" },
+ { "own" },
+ { "xmlroot" },
+ { "xmlsetup" },
+ }
+ },
+ { "entries", {
+ { "entries", "list" },
+ { "keys", "list" },
+ { "processors", "list" },
+ { "entry" },
+ { "key" },
+ { "processor" },
+ }
+ },
+ { "references", {
+ { "internal", "integer" },
+ { "section", "integer" },
+ { "view" },
+ { "label" },
+ }
+ },
+ { "seeword", {
+ { "text" },
+ }
+ },
+ { "processors", {
+ { "entry" },
+ { "key" },
+ { "page" },
+ }
+ },
+ { "userdata" },
+ }
+ }
+}
+
+-- sorting and rendering
+
+local compare = sorters.comparers.basic
+
+function registers.compare(a,b)
+ local result = compare(a,b)
+ if result ~= 0 then
+ return result
+ else
+ local ka = a.metadata.kind
+ local kb = b.metadata.kind
+ if ka == kb then
+ local ra = a.references
+ local rb = b.references
+ local pa = ra.realpage
+ local pb = rb.realpage
+ if not pa or not pb then
+ return 0
+ elseif pa < pb then
+ return -1
+ elseif pa > pb then
+ return 1
+ else
+ -- new, we need to pick the right one of multiple and
+ -- we want to prevent oscillation in the tuc file so:
+ local ia = ra.internal
+ local ib = rb.internal
+ if not ia or not ib then
+ return 0
+ elseif ia < ib then
+ return -1
+ elseif ia > ib then
+ return 1
+ else
+ return 0
+ end
+ end
+ elseif ka == "see" then
+ return 1
+ elseif kb == "see" then
+ return -1
+ end
+ end
+ return 0
+end
+
+function registers.filter(data,options)
+ data.result = registers.filtercollected(nil,options.criterium,options.number,data.entries,true)
+end
+
+local seeindex = 0
+
+-- meerdere loops, seewords, dan words, anders seewords
+
+-- todo: split seeword
+
+local function crosslinkseewords(result,check) -- all words
+ -- collect all seewords
+ local seewords = { }
+ for i=1,#result do
+ local data = result[i]
+ local seeword = data.seeword
+ if seeword then
+ local seetext = seeword.text
+ if seetext and not seewords[seetext] then
+ seeindex = seeindex + 1
+ seewords[seetext] = seeindex
+ if trace_registers then
+ report_registers("see word %03i: %s",seeindex,seetext)
+ end
+ end
+ end
+ end
+
+ -- mark seeparents
+
+ -- local seeparents = { }
+ -- for i=1,#result do
+ -- local data = result[i]
+ -- local word = data.list[1]
+ -- local okay = word and word[1]
+ -- if okay then
+ -- local seeindex = seewords[okay]
+ -- if seeindex then
+ -- seeparents[okay] = data
+ -- data.references.seeparent = seeindex
+ -- if trace_registers then
+ -- report_registers("see parent %03i: %s",seeindex,okay)
+ -- end
+ -- end
+ -- end
+ -- end
+
+ local entries = { }
+ local keywords = { }
+ local seeparents = { }
+ for i=1,#result do
+ local data = result[i]
+ local word = data.list
+ local size = #word
+ if data.seeword then
+ -- beware: a seeword has an extra entry for sorting purposes
+ size = size - 1
+ end
+ for i=1,size do
+ local w = word[i]
+ local e = w[1]
+ local k = w[2] or e
+ entries [i] = e
+ keywords[i] = k
+ end
+ -- first try the keys
+ local okay, seeindex
+ for n=size,1,-1 do
+ okay = concat(keywords,"+",1,n)
+ seeindex = seewords[okay]
+ -- first try the entries
+ if seeindex then
+ break
+ end
+ okay = concat(entries,"+",1,n)
+ seeindex = seewords[okay]
+ if seeindex then
+ break
+ end
+ end
+ if seeindex then
+ seeparents[okay] = data
+ data.references.seeparent = seeindex
+ if trace_registers then
+ report_registers("see parent %03i: %s",seeindex,okay)
+ end
+ end
+ end
+
+ -- mark seewords and extend sort list
+ for i=1,#result do
+ local data = result[i]
+ local seeword = data.seeword
+ if seeword then
+ local text = seeword.text
+ if text then
+ local seeparent = seeparents[text]
+ if seeparent then
+ local seeindex = seewords[text]
+ data.references.seeindex = seeindex
+ if trace_registers then
+ report_registers("see crosslink %03i: %s",seeindex,text)
+ end
+ seeword.valid = true
+ elseif check then
+ report_registers("invalid crosslink : %s, %s",text,"ignored")
+ seeword.valid = false
+ else
+ report_registers("invalid crosslink : %s, %s",text,"passed")
+ seeword.valid = true
+ end
+ end
+ end
+ end
+end
+
+local function removeemptyentries(result)
+ local i, n, m = 1, #result, 0
+ while i <= n do
+ local entry = result[i]
+ if #entry.list == 0 or #entry.split == 0 then
+ remove(result,i)
+ n = n - 1
+ m = m + 1
+ else
+ i = i + 1
+ end
+ end
+ if m > 0 then
+ report_registers("%s empty entries removed in register",m)
+ end
+end
+
+function registers.prepare(data,options)
+ -- data has 'list' table
+ local strip = sorters.strip
+ local splitter = sorters.splitters.utf
+ local result = data.result
+ if result then
+ local seeprefix = char(0)
+ for i=1, #result do
+ local entry = result[i]
+ local split = { }
+ local list = entry.list
+ if list then
+ if entry.seeword then
+ -- we can have multiple seewords, only two levels supported
+ list[#list+1] = { seeprefix .. strip(entry.seeword.text) }
+ end
+ for l=1,#list do
+ local ll = list[l]
+ local word = ll[1]
+ local key = ll[2]
+ if not key or key == "" then
+ key = word
+ end
+ split[l] = splitter(strip(key))
+ end
+ end
+ entry.split = split
+ end
+ removeemptyentries(result)
+ crosslinkseewords(result,options.check ~= v_no)
+ end
+end
+
+function registers.sort(data,options)
+ -- if options.pagenumber == false then
+ -- sorters.sort(data.result,compare)
+ -- else
+ sorters.sort(data.result,registers.compare)
+ -- end
+end
+
+function registers.unique(data,options)
+ local result = { }
+ local nofresult = 0
+ local prev = nil
+ local dataresult = data.result
+ local bysection = options.pagemethod == v_section -- normally page
+ for k=1,#dataresult do
+ local v = dataresult[k]
+ if prev then
+ local vr = v.references
+ local pr = prev.references
+ if not equal(prev.list,v.list) then
+ -- ok
+ elseif bysection and vr.section == pr.section then
+ v = nil
+ -- ok
+ elseif pr.realpage ~= vr.realpage then
+ -- ok
+ else
+ local pl = pr.lastrealpage
+ local vl = vr.lastrealpage
+ if pl or vl then
+ if not vl then
+ -- ok
+ elseif not pl then
+ -- ok
+ elseif pl ~= vl then
+ -- ok
+ else
+ v = nil
+ end
+ else
+ v = nil
+ end
+ end
+ end
+ if v then
+ nofresult = nofresult + 1
+ result[nofresult] = v
+ prev = v
+ end
+ end
+ data.result = result
+end
+
+function registers.finalize(data,options) -- maps character to index (order)
+ local result = data.result
+ data.metadata.nofsorted = #result
+ local split = { }
+ local nofsplit = 0
+ local lasttag = nil
+ local done = nil
+ local nofdone = 0
+ local firstofsplit = sorters.firstofsplit
+ for k=1,#result do
+ local v = result[k]
+ local entry, tag = firstofsplit(v)
+ if tag ~= lasttag then
+ if trace_registers then
+ report_registers("splitting at %a",tag)
+ end
+ done = { }
+ nofdone = 0
+ nofsplit = nofsplit + 1
+ lasttag = tag
+ split[nofsplit] = { tag = tag, data = done }
+ end
+ nofdone = nofdone + 1
+ done[nofdone] = v
+ end
+ data.result = split
+end
+
+-- local function analyzeregister(class,options)
+-- local data = collected[class]
+-- if data and data.entries then
+-- options = options or { }
+-- sorters.setlanguage(options.language,options.method,options.numberorder)
+-- registers.filter(data,options) -- filter entries into results (criteria)
+-- registers.prepare(data,options) -- adds split table parallel to list table
+-- registers.sort(data,options) -- sorts results
+-- registers.unique(data,options) -- get rid of duplicates
+-- registers.finalize(data,options) -- split result in ranges
+-- data.metadata.sorted = true
+-- return data.metadata.nofsorted or 0
+-- else
+-- return 0
+-- end
+-- end
+
+local function analyzeregister(class,options)
+ local data = rawget(collected,class)
+ if not data then
+ local list = utilities.parsers.settings_to_array(class)
+ local entries = { }
+ local metadata = false
+ for i=1,#list do
+ local l = list[i]
+ local d = collected[l]
+ local e = d.entries
+ for i=1,#e do
+ entries[#entries+1] = e[i]
+ end
+ if not metadata then
+ metadata = d.metadata
+ end
+ end
+ data = {
+ metadata = metadata or { },
+ entries = entries,
+ }
+ collected[class] = data
+ end
+ if data and data.entries then
+ options = options or { }
+ sorters.setlanguage(options.language,options.method,options.numberorder)
+ registers.filter(data,options) -- filter entries into results (criteria)
+ registers.prepare(data,options) -- adds split table parallel to list table
+ registers.sort(data,options) -- sorts results
+ registers.unique(data,options) -- get rid of duplicates
+ registers.finalize(data,options) -- split result in ranges
+ data.metadata.sorted = true
+ return data.metadata.nofsorted or 0
+ else
+ return 0
+ end
+end
+
+registers.analyze = analyzeregister
+
+implement {
+ name = "analyzeregister",
+ actions = { analyzeregister, context },
+ arguments = {
+ "string",
+ {
+ { "language" },
+ { "method" },
+ { "numberorder" },
+ { "compress" },
+ { "criterium" },
+ { "pagenumber", "boolean" },
+ }
+ }
+}
+
+-- todo take conversion from index
+
+function registers.userdata(index,name)
+ local data = references.internals[tonumber(index)]
+ return data and data.userdata and data.userdata[name] or nil
+end
+
+implement {
+ name = "registeruserdata",
+ actions = { registers.userdata, context },
+ arguments = { "integer", "string" }
+}
+
+-- todo: ownnumber
+
+local function pagerange(f_entry,t_entry,is_last,prefixspec,pagespec)
+ local fer = f_entry.references
+ local ter = t_entry.references
+ ctx_registerpagerange(
+ f_entry.metadata.name or "",
+ f_entry.processors and f_entry.processors[2] or "",
+ fer.internal or 0,
+ fer.realpage or 0,
+ function()
+ h_prefixpage(f_entry,prefixspec,pagespec)
+ end,
+ ter.internal or 0,
+ ter.lastrealpage or ter.realpage or 0,
+ function()
+ if is_last then
+ h_prefixlastpage(t_entry,prefixspec,pagespec) -- swaps page and realpage keys
+ else
+ h_prefixpage (t_entry,prefixspec,pagespec)
+ end
+ end
+ )
+end
+
+local function pagenumber(entry,prefixspec,pagespec)
+ local er = entry.references
+ ctx_registeronepage(
+ entry.metadata.name or "",
+ entry.processors and entry.processors[2] or "",
+ er.internal or 0,
+ er.realpage or 0,
+ function() h_prefixpage(entry,prefixspec,pagespec) end
+ )
+end
+
+local function packed(f_entry,t_entry)
+ local fer = f_entry.references
+ local ter = t_entry.references
+ ctx_registerpacked(
+ fer.internal or 0,
+ ter.internal or 0
+ )
+end
+
+local function collapsedpage(pages)
+ for i=2,#pages do
+ local first = pages[i-1]
+ local second = pages[i]
+ local first_first = first[1]
+ local first_last = first[2]
+ local second_first = second[1]
+ local second_last = second[2]
+ local first_last_pn = first_last .references.realpage
+ local second_first_pn = second_first.references.realpage
+ local second_last_pn = second_last .references.realpage
+ local first_last_last = first_last .references.lastrealpage
+ local second_first_last = second_first.references.lastrealpage
+ if first_last_last then
+ first_last_pn = first_last_last
+ if second_first == second_last and second_first_pn <= first_last_pn then
+ -- 2=8, 5 -> 12=8
+ remove(pages,i)
+ return true
+ elseif second_first == second_last and second_first_pn > first_last_pn then
+ -- 2=8, 9 -> 2-9
+ pages[i-1] = { first_first, second_last }
+ remove(pages,i)
+ return true
+ elseif second_last_pn < first_last_pn then
+ -- 2=8, 3-4 -> 2=8
+ remove(pages,i)
+ return true
+ elseif first_last_pn < second_last_pn then
+ -- 2=8, 3-9 -> 2-9
+ pages[i-1] = { first_first, second_last }
+ remove(pages,i)
+ return true
+ elseif first_last_pn + 1 == second_first_pn and second_last_pn > first_last_pn then
+ -- 2=8, 9-11 -> 2-11
+ pages[i-1] = { first_first, second_last }
+ remove(pages,i)
+ return true
+ elseif second_first.references.lastrealpage then
+ -- 2=8, 9=11 -> 2-11
+ pages[i-1] = { first_first, second_last }
+ remove(pages,i)
+ return true
+ end
+ elseif second_first_last then
+ second_first_pn = second_first_last
+ if first_last_pn == second_first_pn then
+ -- 2-4, 5=9 -> 2-9
+ pages[i-1] = { first_first, second_last }
+ remove(pages,i)
+ return true
+ end
+ elseif first_last_pn == second_first_pn then
+ -- 2-3, 3-4 -> 2-4
+ pages[i-1] = { first_last, second_last }
+ remove(pages,i)
+ return true
+ end
+ end
+ return false
+end
+
+local function collapsepages(pages)
+ while collapsedpage(pages) do end
+ return #pages
+end
+
+-- todo: create an intermediate structure and flush that
+
+function registers.flush(data,options,prefixspec,pagespec)
+ local compress = options.compress
+ local collapse_singles = compress == v_yes
+ local collapse_ranges = compress == v_all
+ local collapse_packed = compress == v_packed
+ local show_page_number = options.pagenumber ~= false -- true or false
+ local bysection = options.pagemethod == v_section
+ local result = data.result
+ local maxlevel = 0
+ --
+ for i=1,#result do
+ local data = result[i].data
+ for d=1,#data do
+ local m = #data[d].list
+ if m > maxlevel then
+ maxlevel = m
+ end
+ end
+ end
+ if maxlevel > absmaxlevel then
+ maxlevel = absmaxlevel
+ report_registers("limiting level to %a",maxlevel)
+ end
+ --
+ ctx_startregisteroutput()
+ local done = { }
+ local started = false
+ for i=1,#result do
+ -- ranges need checking !
+ local sublist = result[i]
+ -- local done = { false, false, false, false }
+ for i=1,maxlevel do
+ done[i] = false
+ end
+ local data = sublist.data
+ local d = 0
+ local n = 0
+ ctx_startregistersection(sublist.tag)
+ for d=1,#data do
+ local entry = data[d]
+ if entry.metadata.kind == "see" then
+ local list = entry.list
+ if #list > 1 then
+ list[#list] = nil
+ else
+ -- we have an \seeindex{Foo}{Bar} without Foo being defined anywhere .. somehow this message is wrong
+ -- report_registers("invalid see entry in register %a, reference %a",entry.metadata.name,list[1][1])
+ end
+ end
+ end
+ -- ok, this is tricky: we use e[i] delayed so we need it to be local
+ -- but we don't want to allocate too many entries so there we go
+
+ while d < #data do
+ d = d + 1
+ local entry = data[d]
+-- inspect(entry)
+ local metadata = entry.metadata
+ local kind = metadata.kind
+ local list = entry.list
+ local e = { false, false, false }
+ for i=3,maxlevel do
+ e[i] = false
+ end
+ for i=1,maxlevel do
+ local li = list[i]
+ if list[i] then
+ e[i] = li[1]
+ end
+ if e[i] == done[i] then
+ -- skip
+ elseif not e[i] then
+ -- see ends up here
+ -- can't happen any more
+ done[i] = false
+ for j=i+1,maxlevel do
+ done[j] = false
+ end
+ elseif e[i] == "" then
+ done[i] = false
+ for j=i+1,maxlevel do
+ done[j] = false
+ end
+ else
+ done[i] = e[i]
+ for j=i+1,maxlevel do
+ done[j] = false
+ end
+ if started then
+ ctx_stopregisterentry()
+ started = false
+ end
+ if n == i then
+ -- ctx_stopregisterentries()
+ -- ctx_startregisterentries(n)
+ else
+ while n > i do
+ n = n - 1
+ ctx_stopregisterentries()
+ end
+ while n < i do
+ n = n + 1
+ ctx_startregisterentries(n)
+ end
+ end
+ local references = entry.references
+ local processors = entry.processors
+ local internal = references.internal or 0
+ local seeparent = references.seeparent or ""
+ local processor = (li and li[3]) or (processors and processors[1]) or ""
+ -- so, we need to keep e as is (local), or we need local title = e[i] ... which might be
+ -- more of a problem
+ ctx_startregisterentry(0) -- will become a counter
+ started = true
+ if metadata then
+ ctx_registerentry(metadata.name or "",processor,internal,seeparent,function() h_title(e[i],metadata) end)
+ else
+ -- can this happen?
+ ctx_registerentry("",processor,internal,seeindex,e[i])
+ end
+ end
+ end
+
+ local function case_1()
+ -- we collapse ranges and keep existing ranges as they are
+ -- so we get prebuilt as well as built ranges
+ local first, last, prev, pages, dd, nofpages = entry, nil, entry, { }, d, 0
+ while dd < #data do
+ dd = dd + 1
+ local next = data[dd]
+ if next and next.metadata.kind == "see" then
+ dd = dd - 1
+ break
+ else
+ local el, nl = entry.list, next.list
+ if not equal(el,nl) then
+ dd = dd - 1
+ --~ first = nil
+ break
+ elseif next.references.lastrealpage then
+ nofpages = nofpages + 1
+ pages[nofpages] = first and { first, last or first } or { entry, entry }
+ nofpages = nofpages + 1
+ pages[nofpages] = { next, next }
+ first, last, prev = nil, nil, nil
+ elseif not first then
+ first, prev = next, next
+ elseif next.references.realpage - prev.references.realpage == 1 then -- 1 ?
+ last, prev = next, next
+ else
+ nofpages = nofpages + 1
+ pages[nofpages] = { first, last or first }
+ first, last, prev = next, nil, next
+ end
+ end
+ end
+ if first then
+ nofpages = nofpages + 1
+ pages[nofpages] = { first, last or first }
+ end
+ if collapse_ranges and nofpages > 1 then
+ nofpages = collapsepages(pages)
+ end
+ if nofpages > 0 then -- or 0
+ d = dd
+ for p=1,nofpages do
+ local page = pages[p]
+ local first = page[1]
+ local last = page[2]
+ if first == last then
+ if first.references.lastrealpage then
+ pagerange(first,first,true,prefixspec,pagespec)
+ else
+ pagenumber(first,prefixspec,pagespec)
+ end
+ elseif last.references.lastrealpage then
+ pagerange(first,last,true,prefixspec,pagespec)
+ else
+ pagerange(first,last,false,prefixspec,pagespec)
+ end
+ end
+ elseif entry.references.lastrealpage then
+ pagerange(entry,entry,true,prefixspec,pagespec)
+ else
+ pagenumber(entry,prefixspec,pagespec)
+ end
+ end
+
+ local function case_2()
+ local first = nil
+ local last = nil
+ while true do
+ if not first then
+ first = entry
+ end
+ last = entry
+ if d == #data then
+ break
+ else
+ d = d + 1
+ local next = data[d]
+ if next.metadata.kind == "see" or not equal(entry.list,next.list) then
+ d = d - 1
+ break
+ else
+ entry = next
+ end
+ end
+ end
+ packed(first,last) -- returns internals
+ end
+
+ local function case_3()
+ while true do
+ if entry.references.lastrealpage then
+ pagerange(entry,entry,true,prefixspec,pagespec)
+ else
+ pagenumber(entry,prefixspec,pagespec)
+ end
+ if d == #data then
+ break
+ else
+ d = d + 1
+ local next = data[d]
+ if next.metadata.kind == "see" or not equal(entry.list,next.list) then
+ d = d - 1
+ break
+ else
+ entry = next
+ end
+ end
+ end
+ end
+
+ local function case_4()
+ local t = { }
+ local nt = 0
+ while true do
+ if entry.seeword and entry.seeword.valid then
+ nt = nt + 1
+ t[nt] = entry
+ end
+ if d == #data then
+ break
+ else
+ d = d + 1
+ local next = data[d]
+ if next.metadata.kind ~= "see" or not equal(entry.list,next.list) then
+ d = d - 1
+ break
+ else
+ entry = next
+ end
+ end
+ end
+ for i=1,nt do
+ local entry = t[i]
+ local seeword = entry.seeword
+ local seetext = seeword.text or ""
+ local processor = seeword.processor or (entry.processors and entry.processors[1]) or ""
+ local seeindex = entry.references.seeindex or ""
+ ctx_registerseeword(
+ metadata.name or "",
+ i,
+ nt,
+ processor,
+ 0,
+ seeindex,
+ function() h_title(seetext,metadata) end
+ )
+ end
+ end
+
+ local function case_5()
+ local first = d
+ while true do
+ if d == #data then
+ break
+ else
+ d = d + 1
+ local next = data[d]
+ if next.metadata.kind == "see" or not equal(entry.list,next.list) then
+ d = d - 1
+ break
+ else
+ entry = next
+ end
+ end
+ end
+ local last = d
+ local n = last - first + 1
+ local i = 0
+ local name = metadata.name or ""
+ local processor = entry.processors and entry.processors[1] or ""
+ for e=first,last do
+ local d = data[e]
+ local sectionindex = d.references.internal or 0
+ i = i + 1
+ ctx_registersection(
+ name,
+ i,
+ n,
+ processor,
+ 0,
+ sectionindex,
+ function() h_prefix(d,prefixspec,true) end
+ )
+ end
+ end
+
+ if kind == "entry" then
+ if show_page_number then
+ ctx_startregisterpages()
+ if bysection then
+ case_5()
+ elseif collapse_singles or collapse_ranges then
+ case_1()
+ elseif collapse_packed then
+ case_2()
+ else
+ case_3()
+ end
+ ctx_stopregisterpages()
+ end
+ elseif kind == "see" then
+ ctx_startregisterseewords()
+ case_4()
+ ctx_stopregisterseewords()
+ end
+
+ end
+
+ if started then
+ ctx_stopregisterentry()
+ started = false
+ end
+ while n > 0 do
+ ctx_stopregisterentries()
+ n = n - 1
+ end
+ ctx_stopregistersection()
+ end
+ ctx_stopregisteroutput()
+ -- for now, maybe at some point we will do a multipass or so
+ data.result = nil
+ data.metadata.sorted = false
+ -- temp hack for luajittex :
+ local entries = data.entries
+ for i=1,#entries do
+ entries[i].split = nil
+ end
+ -- collectgarbage("collect")
+end
+
+function registers.process(class,...)
+ if analyzeregister(class,...) > 0 then
+ local data = collected[class]
+ registers.flush(data,...)
+ end
+end
+
+implement {
+ name = "processregister",
+ actions = registers.process,
+ arguments = {
+ "string",
+ {
+ { "language" },
+ { "method" },
+ { "numberorder" },
+ { "compress" },
+ { "criterium" },
+ { "check" },
+ { "pagemethod" },
+ { "pagenumber", "boolean" },
+ },
+ {
+ { "separatorset" },
+ { "conversionset" },
+ { "starter" },
+ { "stopper" },
+ { "set" },
+ { "segments" },
+ { "connector" },
+ },
+ {
+ { "prefix" },
+ { "separatorset" },
+ { "conversionset" },
+ { "starter" },
+ { "stopper" },
+ { "segments" },
+ }
+ }
+}
+
+-- linked registers
+
+function registers.findinternal(tag,where,n)
+ -- local collected = registers.collected
+ local current = collected[tag]
+ if not current then
+ return 0
+ end
+ local entries = current.entries
+ if not entries then
+ return 0
+ end
+ local entry = entries[n]
+ if not entry then
+ return 0
+ end
+ local list = entry.list
+ local size = #list
+ --
+ local start, stop, step
+ if where == v_previous then
+ start = n - 1
+ stop = 1
+ step = -1
+ elseif where == v_first then
+ start = 1
+ stop = #entries
+ step = 1
+ elseif where == v_last then
+ start = #entries
+ stop = 1
+ step = -1
+ else
+ start = n + 1
+ stop = #entries
+ step = 1
+ end
+ --
+ for i=start,stop,step do
+ local r = entries[i]
+ local l = r.list
+ local s = #l
+ if s == size then
+ local ok = true
+ for i=1,size do
+ if list[i][1] ~= l[i][1] then
+ ok = false
+ break
+ end
+ end
+ if ok then
+ return r.references.internal or 0
+ end
+ end
+ end
+ return 0
+end
+
+interfaces.implement {
+ name = "findregisterinternal",
+ arguments = { "string", "string", "integer" },
+ actions = { registers.findinternal, context },
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-reg.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-reg.mkxl
index 22a6614b785..485b68b746c 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/strc-reg.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-reg.mkxl
@@ -13,7 +13,7 @@
\writestatus{loading}{ConTeXt Structure Macros / Registers}
-\registerctxluafile{strc-reg}{}
+\registerctxluafile{strc-reg}{autosuffix}
\unprotect
@@ -138,36 +138,37 @@
%D test \index{test+one} test \index{test+two} more \index{more}
%D \stoptyping
-\mutable\let\currentregistercharacter \empty
-\mutable\let\currentregistercoding \empty
-\mutable\let\currentregisterentries \empty
-\mutable\let\currentregisterentriesa \empty
-\mutable\let\currentregisterentriesb \empty
-\mutable\let\currentregisterentriesc \empty
-\mutable\let\currentregisterexpansion \empty
-\mutable\let\currentregisterkeys \empty
-\mutable\let\currentregisterkeysa \empty
-\mutable\let\currentregisterkeysb \empty
-\mutable\let\currentregisterkeysc \empty
-\mutable\let\currentregisterlabel \empty
-\mutable\let\currentregistermaxwidth \empty
-\mutable\let\currentregistername \empty
-\mutable\let\currentregisternumber \empty
-\mutable\let\currentregisterownnumber \empty
-\mutable\let\currentregisterpageindex \empty
-\mutable\let\currentregisterpagesymbol \empty
-\mutable\let\currentregistersectionindex\empty
-\mutable\let\currentregisterseeindex \empty
-\mutable\let\currentregisterseeword \empty
-\mutable\let\currentregistersynchronize \empty
-\mutable\let\currentregisterxmlsetup \empty
-\mutable\let\currentregisterprocessors \empty
-\mutable\let\currentregisterprocessorsa \empty
-\mutable\let\currentregisterprocessorsb \empty
-\mutable\let\currentregisterprocessorsc \empty
+\mutable\lettonothing\currentregistercharacter
+\mutable\lettonothing\currentregistercoding
+\mutable\lettonothing\currentregisterentries
+\mutable\lettonothing\currentregisterentriesa
+\mutable\lettonothing\currentregisterentriesb
+\mutable\lettonothing\currentregisterentriesc
+\mutable\lettonothing\currentregisterexpansion
+\mutable\lettonothing\currentregisterkeys
+\mutable\lettonothing\currentregisterkeysa
+\mutable\lettonothing\currentregisterkeysb
+\mutable\lettonothing\currentregisterkeysc
+\mutable\lettonothing\currentregisterlabel
+\mutable\lettonothing\currentregistermaxwidth
+\mutable\lettonothing\currentregistername
+\mutable\lettonothing\currentregisternumber
+\mutable\lettonothing\currentregisterownnumber
+\mutable\lettonothing\currentregisterpageindex
+\mutable\lettonothing\currentregisterpagesymbol
+\mutable\lettonothing\currentregistersectionindex
+\mutable\lettonothing\currentregisterseeindex
+\mutable\lettonothing\currentregisterseeword
+\mutable\lettonothing\currentregistersynchronize
+\mutable\lettonothing\currentregisterxmlsetup
+\mutable\lettonothing\currentregisterprocessors
+\mutable\lettonothing\currentregisterprocessorsa
+\mutable\lettonothing\currentregisterprocessorsb
+\mutable\lettonothing\currentregisterprocessorsc
\newconditional\c_strc_registers_defining
\setnewconstant\c_strc_registers_maxlevel \plusfive
+\newconditional\c_strc_registers_vertical \settrue\c_strc_registers_vertical
\ifdefined\Word \else \protected\def\Word#1{#1} \fi
@@ -187,8 +188,8 @@
\dorecurse\c_strc_registers_maxlevel{% weird, expanded should not be needed
\normalexpanded{\defineregister[\currentregister:\recurselevel][\currentregister]}%
%\defineregister[\currentregister:\recurselevel][\currentregister]%
- \letregisterparameter{\c!entries:\recurselevel}\empty % needed as we use detokenize (ok, we can
- \letregisterparameter{\c!keys :\recurselevel}\empty % avoid it, but it's faster too)
+ \resetregisterparameter{\c!entries:\recurselevel}% needed as we use detokenize (ok, we can
+ \resetregisterparameter{\c!keys :\recurselevel}% avoid it, but it's faster too)
}%
%
\setfalse\c_strc_registers_defining
@@ -201,12 +202,14 @@
%D Registering:
-\glet\currentregistername \empty
-\glet\currentregisternumber\!!zerocount
+\glettonothing\currentregistername
+\glet \currentregisternumber\!!zerocount
\def\strc_registers_register_page_entry
{\iftrialtypesetting
\expandafter\gobblethreearguments
+ \orelse\ifconditional\prerollrun
+ \expandafter\gobblethreearguments
\else
\expandafter\strc_registers_register_page_entry_indeed
\fi}
@@ -441,16 +444,16 @@
\fi}
\def\strc_registers_insert_entry_nop_par#1#2%
- {\flushatnextpar{\strc_registers_register_page_entry\currentregister{\c!keys={#1},\c!entries={#2}}{}}}
+ {\ifprerolling\else\flushatnextpar{\strc_registers_register_page_entry\currentregister{\c!keys={#1},\c!entries={#2}}{}}\fi}
\def\strc_registers_insert_entry_yes_par#1#2#3%
- {\flushatnextpar{\strc_registers_register_page_entry\currentregister{\c!keys={#1},\c!alternative=#2,\c!entries={#3}}{}}}
+ {\ifprerolling\else\flushatnextpar{\strc_registers_register_page_entry\currentregister{\c!keys={#1},\c!alternative=#2,\c!entries={#3}}{}}\fi}
\def\strc_registers_insert_entry_nop_txt#1#2%
- {\strc_registers_register_page_entry\currentregister{\c!keys={#1},\c!entries={#2}}{}}
+ {\ifprerolling\else\strc_registers_register_page_entry\currentregister{\c!keys={#1},\c!entries={#2}}{}\fi}
\def\strc_registers_insert_entry_yes_txt#1#2#3%
- {\strc_registers_register_page_entry\currentregister{\c!keys={#1},\c!alternative=#2,\c!entries={#3}}{}}
+ {\ifprerolling\else\strc_registers_register_page_entry\currentregister{\c!keys={#1},\c!alternative=#2,\c!entries={#3}}{}\fi}
%D This is one of the few commands where a stop has arguments.
@@ -798,7 +801,7 @@
\endgroup
\blank[\v!samepage]%
\registerparameter\c!after
- \par
+ \endgraf
\nobreak}
% b = <goodbreak> <before> <character> <after> <nobreak>
@@ -819,10 +822,10 @@
\registerparameter\c!after
\nobreak}
-\setvalue{\??registerindicator a}#1{\strc_registers_indicator_a{#1}{#1}}
-\setvalue{\??registerindicator A}#1{\strc_registers_indicator_a{#1}{\WORD{#1}}}
-\setvalue{\??registerindicator b}#1{\strc_registers_indicator_b{#1}{#1}}
-\setvalue{\??registerindicator B}#1{\strc_registers_indicator_b{#1}{\WORD{#1}}}
+\defcsname\??registerindicator a\endcsname#1{\strc_registers_indicator_a{#1}{#1}}
+\defcsname\??registerindicator A\endcsname#1{\strc_registers_indicator_a{#1}{\WORD{#1}}}
+\defcsname\??registerindicator b\endcsname#1{\strc_registers_indicator_b{#1}{#1}}
+\defcsname\??registerindicator B\endcsname#1{\strc_registers_indicator_b{#1}{\WORD{#1}}}
%D The following macros are the interface to the rendering. These are
%D generated by \LUA. This might change.
@@ -844,8 +847,19 @@
%D placeindex as then flushing takes place inside the index. Took me hours
%D to notice that.
-\newconstant\c_strc_registers_page_state % 0=nothing 1=page 2=see
-\newdimen \d_strc_registers_distance
+\newconstant \c_strc_registers_page_state % 0=nothing 1=page 2=see
+\newdimension\d_strc_registers_distance
+\newinteger \c_strc_register_level
+
+\def\strc_registers_update_text_properties
+ {\ifx\m_current_register\currentregister\else
+ \useregisterstyleandcolor\c!textstyle\c!textcolor
+ \fi}
+
+\def\strc_registers_update_page_properties
+ {\ifx\m_current_register\currentregister\else
+ \useregisterstyleandcolor\c!pagestyle\c!pagecolor
+ \fi}
\permanent\protected\def\startregisteroutput
{\endgraf
@@ -861,8 +875,70 @@
\dostoptagged
\endgroup}
-\newdimen\d_strc_registers_hangindent
-\newcount\c_strc_registers_hangafter
+\newdimension\d_strc_registers_hangindent
+\newinteger \c_strc_registers_hangafter
+
+% \permanent\protected\def\usenestedregisterstyleandcolor#1#2% will change
+% {\useregisterstyleandcolor#1#2%
+% % how about style
+% \ifconditional\c_strc_registers_text_interaction
+% \ifempty\currentcolorparameter \else
+% \resetinteractionparameter\c!color
+% \resetinteractionparameter\c!contrastcolor
+% \fi
+% \fi}
+%
+% \permanent\protected\def\startregisterentries#1% depth
+% {\endgraf
+% \begingroup
+% \c_strc_register_level\ifnum#1>\c_strc_registers_maxlevel\c_strc_registers_maxlevel\else#1\fi\relax
+% \dostarttagged\t!registerentries\empty
+% % \let\savedcurrentregister\currentregister
+% \pushmacro\currentregister
+% \edef\currentregister{\currentregister:\number\c_strc_register_level}%
+% \usenestedregisterstyleandcolor\c!textstyle\c!textcolor
+% \ifnum\c_strc_register_level>\plusone
+% \advanceby\leftskip\d_strc_registers_distance\relax
+% \fi
+% \d_strc_registers_hangindent\registerparameter\c!distance\relax
+% \c_strc_registers_hangafter \plusone
+% \blank[\v!samepage]%
+% % \let\currentregister\savedcurrentregister}
+% \popmacro\currentregister}
+%
+% \permanent\protected\def\stopregisterentries
+% {\endgraf
+% \dostoptagged
+% \endgroup}
+
+%D See test suite \type {registers/horizontal-001.tex} for a more extensive example
+%D of horizontal:
+%D
+%D \stoptyping
+%D \defineregister
+%D [demo]
+%D [n=1,
+%D pagenumber=no,
+%D textalternative=horizontal,
+%D distance=0pt]
+%D
+%D \setupregister [demo] [2] [textstyle=bold,left={, }]
+%D \setupregister [demo] [3] [textstyle=italic,left={, }]
+%D
+%D \setregisterentry [demo] [entries:1={alpha}, entries:2={one}, entries:3={first}]
+%D \setregisterentry [demo] [entries:1={beta}, entries:2={two}, entries:3={last}]
+%D
+%D \starttext
+%D \starttitle[title=Demo]
+%D \placeregister[demo]
+%D \stoptitle
+%D \stoptext
+%D \stoptyping
+
+\appendtoks
+ \doifelse{\registerparameter\c!textalternative}\v!horizontal
+ \setfalse\settrue\c_strc_registers_vertical
+\to \everysetupregister
\permanent\protected\def\usenestedregisterstyleandcolor#1#2% will change
{\useregisterstyleandcolor#1#2%
@@ -875,21 +951,24 @@
\fi}
\permanent\protected\def\startregisterentries#1% depth
- {\endgraf
+ {\ifconditional\c_strc_registers_vertical
+ \endgraf
+ \fi
\begingroup
- \scratchcounter\ifnum#1>\c_strc_registers_maxlevel\c_strc_registers_maxlevel\else#1\fi\relax
+ \c_strc_register_level\ifnum#1>\c_strc_registers_maxlevel\c_strc_registers_maxlevel\else#1\fi\relax
\dostarttagged\t!registerentries\empty
-% \let\savedcurrentregister\currentregister
- \pushmacro\currentregister
- \edef\currentregister{\currentregister:\number\scratchcounter}%
+ \pushmacro\currentregister % bah
+ \edef\currentregister{\currentregister:\number\c_strc_register_level}%
+ \let\currentnestedregister\currentregister
\usenestedregisterstyleandcolor\c!textstyle\c!textcolor
- \ifnum\scratchcounter>\plusone
- \advance\leftskip\d_strc_registers_distance\relax
+ \ifnum\c_strc_register_level>\plusone
+ \advanceby\leftskip\d_strc_registers_distance\relax
\fi
\d_strc_registers_hangindent\registerparameter\c!distance\relax
\c_strc_registers_hangafter \plusone
- \blank[\v!samepage]%
-% \let\currentregister\savedcurrentregister}
+ \ifconditional\c_strc_registers_vertical
+ \blank[\v!samepage]%
+ \fi
\popmacro\currentregister}
\permanent\protected\def\stopregisterentries
@@ -897,17 +976,40 @@
\dostoptagged
\endgroup}
+% \permanent\protected\def\startregisterentry#1% todo: level
+% {\typo_injectors_check_register
+% \begingroup
+% \dostarttagged\t!registerentry\empty
+% \global\setconstant\c_strc_registers_page_state\zerocount
+% \hangindent\d_strc_registers_hangindent
+% \hangafter \c_strc_registers_hangafter
+% \typo_injectors_mark_register}
+%
+% \permanent\protected\def\stopregisterentry
+% {\endgraf
+% \global\setconstant\c_strc_registers_page_state\zerocount
+% \dostoptagged
+% \endgroup}
+
\permanent\protected\def\startregisterentry#1% todo: level
{\typo_injectors_check_register
\begingroup
\dostarttagged\t!registerentry\empty
\global\setconstant\c_strc_registers_page_state\zerocount
- \hangindent\d_strc_registers_hangindent
- \hangafter \c_strc_registers_hangafter
+ \ifconditional\c_strc_registers_vertical
+ \hangindent\d_strc_registers_hangindent
+ \hangafter \c_strc_registers_hangafter
+ \else
+ \namedregisterparameter\currentnestedregister\c!left\relax
+ \fi
\typo_injectors_mark_register}
\permanent\protected\def\stopregisterentry
- {\endgraf
+ {\ifconditional\c_strc_registers_vertical
+ \endgraf
+ \else
+ \namedregisterparameter\currentnestedregister\c!right\relax
+ \fi
\global\setconstant\c_strc_registers_page_state\zerocount
\dostoptagged
\endgroup}
@@ -966,11 +1068,14 @@
% \applyprocessor{#1}{\registerparameter\c!pagecommand{#4}}%
% \fi}
+\let\currentregisterrealpage\!!zerocount % todo: more general accessor
+
\permanent\protected\def\withregisterpagecommand#1#2#3#4%
{\ifcase#3\relax
{\tt [entry\space not\space flushed]}%
\else
\def\currentregisterpageindex{#2}%
+ \def\currentregisterrealpage{#3}%
\iflocation
\strc_references_goto_internal{\applyprocessor{#1}{\registerparameter\c!pagecommand{#4}}}[internal(#2)]%
\else
@@ -978,6 +1083,8 @@
\fi
\fi}
+\lettonothing\m_current_register
+
\permanent\protected\def\pushcurrentregister#1%
{\let\m_current_register\currentregister
\edef\currentregister{#1}}
@@ -987,6 +1094,7 @@
\permanent\protected\def\registeronepage#1#2#3#4#5% #1:class #2:processor content
{\pushcurrentregister{#1}%
+ \strc_registers_update_page_properties
\edef\p_pagenumber{\registerparameter\c!pagenumber}%
\ifx\p_pagenumber\v!no\else
\registerpageseparator
@@ -1011,6 +1119,7 @@
\permanent\protected\def\registerpagerange#1#2#3#4#5#6#7#8% #1:class #2:processor content, content todo: -- configurable
{\pushcurrentregister{#1}%
+ \strc_registers_update_page_properties
\edef\p_pagenumber{\registerparameter\c!pagenumber}%
\ifx\p_pagenumber\v!no\else
\registerpageseparator
@@ -1037,6 +1146,7 @@
\permanent\protected\def\defaultregisterentry#1#2#3#4#5% #1:class #2:processor #3:internal #4:seeindex #5:word
{\pushcurrentregister{#1}%
+ \strc_registers_update_text_properties
\def\currentregisterpageindex{#3}%
\iflocation
\def\currentregisterseeindex{#4}%
@@ -1046,7 +1156,7 @@
\doapplyregisterentrycommand{#2}{#5}%
\fi
\else
- \let\currentregisterseeindex\empty
+ \lettonothing\currentregisterseeindex
\doapplyregisterentrycommand{#2}{#5}%
\fi
\popcurrentregister}
@@ -1081,7 +1191,7 @@
\iflocation
\def\currentregisterseeindex{#6}%
\else
- \let\currentregisterseeindex\empty
+ \lettonothing\currentregisterseeindex
\fi
\ifnum#2=\plusone
\labeltexts\v!see{\doapplyregisterseecommand{#4}{#7}}%
@@ -1114,7 +1224,7 @@
\iflocation
\def\currentregistersectionindex{#6}%
\else
- \let\currentregistersectionindex\empty
+ \lettonothing\currentregistersectionindex
\fi
\ifnum#2=\plusone\else
,\space
@@ -1174,30 +1284,30 @@
% not yet ok : new internal handler names
-\aliased\let\registerpageseparatorsymbol\empty
+\lettonothing\registerpageseparatorsymbol
\permanent\protected\def\registerpagebuttonsymbol
{\vrule\s!width\emwidth\s!height\exheight\s!depth\zeropoint\relax}
\installcorenamespace{registersymbol}
-\setvalue{\??registersymbol n}%
+\defcsname\??registersymbol n\endcsname
{\enforced\frozen\def\registerpageseparatorsymbol{,\space}}
-\setvalue{\??registersymbol a}%
+\defcsname\??registersymbol a\endcsname
{\enforced\frozen\def\registerpageseparatorsymbol{,\space}} % now done via conversion
-\setvalue{\??registersymbol\v!none}%
- {\enforced\frozen\let\registerpageseparatorsymbol\empty
+\defcsname\??registersymbol\v!none\endcsname
+ {\enforced\frozen\lettonothing\registerpageseparatorsymbol
\enforced\frozen\let\registeronepage\gobblefivearguments
\enforced\frozen\let\registerpagerange\gobbleeightarguments}
-\setvalue{\??registersymbol 1}%
+\defcsname\??registersymbol 1\endcsname
{\enforced\frozen\let\registerpageseparatorsymbol\space
\enforced\frozen\def\registeronepage{\symbol[1]\gobblefivearguments}%
\enforced\frozen\def\registerpagerange{\symbol[1]\gobbleeightarguments}}
-\setvalue{\??registersymbol 2}%
+\defcsname\??registersymbol 2\endcsname
{\enforced\frozen\let\registerpageseparatorsymbol\space
\enforced\frozen\def\registeronepage{\registerpagebuttonsymbol\gobblefivearguments}%
\enforced\frozen\def\registerpagerange{\registerpagebuttonsymbol\gobbleeightarguments}}
@@ -1274,3 +1384,190 @@
\stopcontextdefinitioncode
\protect \endinput
+
+% % maybe also more levels with [entries|keys|processors]:n
+% %
+% % \setregisterentry
+% % [index]
+% % [entries:1=one,
+% % entries:2=two,
+% % entries:3=three,
+% % entries:4=four]
+% %
+% % test \blank \placeregister[index][balance=no]
+%
+% \def\expanddetokenizedregistervalues#1#2%
+% {\edef\expandedregistervalue{\detokenizedregisterparameter{#1:#2}}%
+% \ifempty\expandedregistervalue\else
+% \letregisterparameter{#1:#2}\expandedregistervalue
+% \expandafter\expanddetokenizedregistervalues
+% \expandafter#1%
+% \expandafter{\the\numexpr#2+1}%
+% \fi}%
+%
+% \def\expandregistervalues#1#2%
+% {\edef\expandedregistervalue{\registerparameter{#1:#2}}%
+% \ifempty\expandedregistervalue\else
+% \letregisterparameter{#1:#2}\expandedregistervalue
+% \expandafter\expandregistervalues
+% \expandafter#1%
+% \expandafter{\the\numexpr#2+1}%
+% \fi}%
+%
+% % \def\injectregistervalues#1#2%
+% % {\beginlocalcontrol
+% % \edef\expandedregistervalue{\registerparameter{#1:\the\numexpr#2}}%
+% % \endlocalcontrol
+% % \ifempty\expandedregistervalue\else
+% % {\expandedregistervalue}%
+% % \injectregistervalues#1{#2+1}%
+% % \fi}%
+%
+% \def\injectregistervalues#1#2%
+% {\iftok{\registerparameter{#1:\the\numexpr#2}}\emptytoks\else
+% \expandafter{\lastnamedcs}%
+% \injectregistervalues#1{#2+1}%
+% \fi}%
+%
+% \def\strc_registers_register_page_expand_xml_entries
+% {\xmlstartraw
+% \beginlocalcontrol
+% \expandregistervalues\c!entries1%
+% \endlocalcontrol
+% \xmlstopraw
+% \glet\currentregistercoding\s!xml}
+%
+% \def\strc_registers_register_page_expand_yes_entries
+% {\beginlocalcontrol
+% \expandregistervalues\c!entries1%
+% \endlocalcontrol
+% \glet\currentregistercoding\s!tex}
+%
+% \def\strc_registers_register_page_expand_nop_entries
+% {\beginlocalcontrol
+% \expanddetokenizesregistervalues\c!entries1%
+% \endlocalcontrol
+% \glet\currentregistercoding\s!tex}
+%
+% \def\strc_registers_register_page_expand_nop_entries
+% {\beginlocalcontrol
+% \expandregistervalues\c!entries1%
+% \endlocalcontrol
+% \glet\currentregistercoding\s!tex}
+%
+% \def\strc_registers_register_page_expand_xml_keys
+% {\xmlstartraw
+% \beginlocalcontrol
+% \expandregistervalues\c!keys1%
+% \endlocalcontrol
+% \xmlstopraw}
+%
+% \def\strc_registers_register_page_expand_yes_keys
+% {\beginlocalcontrol
+% \expandregistervalues\c!keys1%
+% \endlocalcontrol}
+%
+% \def\strc_registers_register_page_expand_processors
+% {\beginlocalcontrol
+% \expandregistervalues\c!processors1%
+% \endlocalcontrol}
+%
+% \def\strc_registers_register_page_entry_indeed#1#2#3% register data userdata
+% {\begingroup
+% \edef\currentregister{#1}%
+% %\setupcurrentregister[\c!entries=,\c!label=,\c!keys=,\c!alternative=,#2]%
+% \setupcurrentregister[#2]%
+% \edef\currentregisterlabel {\registerparameter\c!label}%
+% \edef\currentregisterexpansion {\registerparameter\c!expansion}%
+% \edef\currentregisterownnumber {\registerparameter\c!ownnumber}%
+% \xdef\currentregisterkeys {\registerparameter\c!keys}%
+% \xdef\currentregisterentries {\registerparameter\c!entries}%
+% \xdef\currentregisterprocessors{\registerparameter\c!processors}%
+% \xdef\currentregisterxmlsetup {\registerparameter\c!xmlsetup}%
+% \ifempty\currentregisterentries
+% \ifx\currentregisterexpansion\s!xml
+% \strc_registers_register_page_expand_xml_entries
+% \orelse\ifx\currentregisterexpansion\v!yes
+% \strc_registers_register_page_expand_yes_entries
+% \else
+% \strc_registers_register_page_expand_nop_entries
+% \fi
+% \else
+% \ifx\currentregisterexpansion\s!xml
+% \strc_registers_register_page_expand_xml
+% \orelse\ifx\currentregisterexpansion\v!yes
+% \strc_registers_register_page_expand_yes
+% \else
+% \strc_registers_register_page_expand_nop
+% \fi
+% \fi
+% \ifempty\currentregisterkeys
+% \ifx\currentregistercoding\s!xml
+% \strc_registers_register_page_expand_xml_keys
+% \else
+% \strc_registers_register_page_expand_yes_keys
+% \fi
+% \fi
+% \strc_registers_register_page_expand_processors
+% \setnextinternalreference
+% % we could consider storing register entries in a list which we
+% % could then sort
+% \glet\currentregistername\currentregister
+% \xdef\currentregisternumber{\clf_storeregister % 'own' should not be in metadata
+% metadata {%
+% name {\currentregister}%
+% coding {\currentregistercoding}%
+% \ifx\currentregisterownnumber\v!yes
+% own {\registerparameter\c!alternative}% can be used instead of pagenumber
+% \fi
+% \ifx\currentreferencecoding\s!xml
+% xmlroot {\xmldocument} % only useful when text
+% \fi
+% \ifempty\currentregisterxmlsetup \else
+% xmlsetup {\currentregisterxmlsetup}%
+% \fi
+% }%
+% references {%
+% \ifempty\currentregisterlabel \else
+% label {\currentregisterlabel}%
+% \fi
+% % view {\interactionparameter\c!focus}%
+% }%
+% entries {%
+% % we need a special one for xml, this is just a single one
+% \ifempty\currentregisterentries
+% entries {\injectregistervalues\c!entries1}%
+% \else
+% entry {\currentregisterentries}%
+% \fi
+% \ifempty\currentregisterkeys
+% keys {\injectregistervalues\c!keys1}%
+% \else
+% key {\currentregisterkeys}%
+% \fi
+% \ifempty\currentregisterprocessors
+% processors {\injectregistervalues\c!processors1}%
+% \else
+% processor {\currentregisterprocessors}%
+% \fi
+% }%
+% userdata {\detokenize\expandafter{\normalexpanded{#3}}}
+% }%
+% \clf_setinternalreference
+% internal \locationcount
+% view {\interactionparameter\c!focus}%
+% \relax % this will change
+% \ifx\currentregisterownnumber\v!yes
+% \glet\currentregistersynchronize\relax
+% \else
+% \xdef\currentregistersynchronize{\clf_deferredenhanceregister{\currentregister}\number\currentregisternumber}%
+% \fi
+% \currentregistersynchronize % here?
+% % needs thinking ... bla\index{bla}. will break before the . but adding a
+% % penalty is also no solution
+% \dostarttagged\t!registerlocation\currentregister
+% \c_attr_destination\lastdestinationattribute
+% \signalcharacter % no \strut as it will be removed during cleanup
+% \dotagregisterlocation
+% \dostoptagged
+% \endgroup}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-ren.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-ren.mkxl
index 774f6f64049..b78155d21b9 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/strc-ren.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-ren.mkxl
@@ -15,10 +15,9 @@
\unprotect
-\newbox\b_strc_rendering_head
-
-\newdimen\d_strc_rendering_local_leftoffset
-\newdimen\d_strc_rendering_local_rightoffset
+\newbox \b_strc_rendering_head
+\newdimension\d_strc_rendering_local_leftoffset
+\newdimension\d_strc_rendering_local_rightoffset
% Martin Kolarik's problem:
%
@@ -246,12 +245,11 @@
% \subsubsection {Test\\Test} \input tufte \page
% \subsubsubsection{Test\\Test} \input tufte \page
-\newdimen\d_strc_rendering_hang_height
-\newcount\n_strc_rendering_hang_lines
-
-\newdimen\d_strc_rendering_local_height
-\newdimen\d_strc_rendering_local_depth
-\newdimen\d_strc_rendering_local_lineheight
+\newdimension\d_strc_rendering_hang_height
+\newinteger \n_strc_rendering_hang_lines
+\newdimension\d_strc_rendering_local_height
+\newdimension\d_strc_rendering_local_depth
+\newdimension\d_strc_rendering_local_lineheight
\def\strc_rendering_initialize_line_state
{\global\d_strc_rendering_local_height\strutht
@@ -272,16 +270,27 @@
\installcorenamespace{headplacementcheckhang}
-\setvalue{\??headplacementcheckhang\v!line }{\strc_rendering_check_hang
- \n_strc_rendering_hang_lines\zerocount}
-\setvalue{\??headplacementcheckhang\v!broad }{\strc_rendering_check_hang
- \getnoflines\d_strc_rendering_hang_height}
-\setvalue{\??headplacementcheckhang\v!fit }{\strc_rendering_check_hang
- \getrawnoflines\d_strc_rendering_hang_height}
-\setvalue{\??headplacementcheckhang\v!none }{\n_strc_rendering_hang_lines\zerocount}
-\setvalue{\??headplacementcheckhang }{\n_strc_rendering_hang_lines\zerocount}
-\setvalue{\??headplacementcheckhang\s!unknown}{\strc_rendering_check_hang
- \n_strc_rendering_hang_lines\numexpr\headparameter\c!hang-\plusone\relax}
+\defcsname\??headplacementcheckhang\v!line\endcsname
+ {\strc_rendering_check_hang
+ \n_strc_rendering_hang_lines\zerocount}
+
+\defcsname\??headplacementcheckhang\v!broad\endcsname
+ {\strc_rendering_check_hang
+ \getnoflines\d_strc_rendering_hang_height}
+
+\defcsname\??headplacementcheckhang\v!fit\endcsname
+ {\strc_rendering_check_hang
+ \getrawnoflines\d_strc_rendering_hang_height}
+
+\defcsname\??headplacementcheckhang\v!none\endcsname
+ {\n_strc_rendering_hang_lines\zerocount}
+
+\defcsname\??headplacementcheckhang\endcsname
+ {\n_strc_rendering_hang_lines\zerocount}
+
+\defcsname\??headplacementcheckhang\s!unknown\endcsname
+ {\strc_rendering_check_hang
+ \n_strc_rendering_hang_lines\numexpr\headparameter\c!hang-\plusone\relax}
\def\strc_rendering_initialize_line_hang
{\ifconditional\headisdisplay
@@ -384,6 +393,7 @@
\noindentation
\else
\ignoreparskip
+ \doindentation
\fi}
% nice testcase
@@ -423,9 +433,10 @@
\c!renderingsetup=\??headrenderings:\currentheadalternative]
\let\currentheadalternative \v!normal
-\let\currentheadrenderingsetup \empty
\let\currentheadrenderingalternative\v!vertical
+\lettonothing\currentheadrenderingsetup
+
\permanent\tolerant\protected\def\defineheadplacement[#1]#*[#2]%
{\doifelsenextbgroup
{\strc_rendering_define_placement_yes[#1][#2]}%
@@ -433,11 +444,11 @@
\def\strc_rendering_define_placement_yes[#1][#2]%
{\defineheadalternative[#1][\c!alternative=#2,\c!renderingsetup=\??headrenderings:\v!command]%
- \setuvalue{\??headplacementalternative#1}##1##2}
+ \protected\defcsname\??headplacementalternative#1\endcsname##1##2}
\def\strc_rendering_define_placement_nop[#1][#2]%
{\defineheadalternative[#1][\c!alternative=#2,\c!renderingsetup=\??headrenderings:\v!command]%
- \setuvalue{\??headplacementalternative#1}}
+ \protected\defcsname\??headplacementalternative#1\endcsname}
% these can be used in setups:
%
@@ -453,14 +464,14 @@
% \headshownumber
% \headisdisplay
-\let\headnumbercontent\empty
-\let\headtextcontent \empty
+\lettonothing\headnumbercontent
+\lettonothing\headtextcontent
-\newdimen\headwidth
-\newdimen\headtextwidth
-\newskip \headtextdistance
-\newdimen\headnumberdistance
-\newdimen\headnumberwidth
+\newdimension\headwidth
+\newdimension\headtextwidth
+\newgluespec \headtextdistance
+\newdimension\headnumberdistance
+\newdimension\headnumberwidth
% \newconditional\headshownumber % defined already
% \newconditional\headisdisplay % defined already
@@ -536,8 +547,7 @@
% {\hbox to \zeropoint{\let\getheadnumber\fakedheadnumber\headnumbercontent}}
\permanent\protected\def\fakeheadnumbercontent
- {\edef\p_hidenumber{\headparameter\c!hidenumber}%
- \ifx\p_hidenumber\v!yes\else
+ {\ifcstok{\headparameter\c!hidenumber}\v!yes\else
\hbox to \zeropoint{\let\getheadnumber\fakedheadnumber\headnumbercontent}%
\fi}
@@ -766,7 +776,7 @@
}
\setbox\scratchboxtwo\vbox {
\headsetupspacing
- \advance\hsize-\wd\scratchboxone\relax
+ \advanceby\hsize-\wd\scratchboxone\relax
\headtextcontent
}
\hpack {
@@ -795,7 +805,7 @@
}
\setbox\scratchboxtwo\vtop {
\headsetupspacing
- \advance\hsize-\wd\scratchboxone\relax
+ \advanceby\hsize-\wd\scratchboxone\relax
\headtextcontent
}
\hpack {
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-rsc.lmt b/Master/texmf-dist/tex/context/base/mkxl/strc-rsc.lmt
new file mode 100644
index 00000000000..e725ebf71de
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-rsc.lmt
@@ -0,0 +1,180 @@
+if not modules then modules = { } end modules ['strc-rsc'] = {
+ version = 1.001,
+ comment = "companion to strc-ref.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- The scanner is in a separate module so that we can test without too
+-- many dependencies.
+
+-- The scanner accepts nested outer, but we don't care too much, maybe
+-- some day we will have both but currently the innermost wins.
+
+local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns
+local lpegP, lpegS, lpegCs, lpegCt, lpegCf, lpegCc, lpegC, lpegCg = lpeg.P, lpeg.S, lpeg.Cs, lpeg.Ct, lpeg.Cf, lpeg.Cc, lpeg.C, lpeg.Cg
+local find = string.find
+
+local spaces = lpegP(" ")^0
+local lparent = lpegP("(")
+local rparent = lpegP(")")
+local lbrace = lpegP("{")
+local rbrace = lpegP("}")
+local tcolon = lpegP(":::") -- component or outer
+local dcolon = lpegP("::") -- outer
+local scolon = lpegP(":") -- prefix
+local backslash = lpegP("\\")
+
+ lparent = spaces * lparent * spaces
+ rparent = spaces * rparent * spaces
+ lbrace = spaces * lbrace * spaces
+ rbrace = spaces * rbrace * spaces
+ tcolon = spaces * tcolon * spaces
+ dcolon = spaces * dcolon * spaces
+
+local endofall = spaces * lpegP(-1)
+
+----- o_token = 1 - rparent - rbrace - lparent - lbrace -- can be made more efficient
+----- a_token = 1 - rbrace
+local s_token = 1 - lparent - lbrace
+local i_token = 1 - lparent - lbrace - endofall
+local f_token = 1 - lparent - lbrace - dcolon
+local c_token = 1 - lparent - lbrace - tcolon
+
+-- experimental
+
+local o_token = lpegpatterns.nestedparents
+ + (1 - rparent - lbrace)
+local a_token = lpegpatterns.nestedbraces
+ + (1 - rbrace)
+local q_token = lpegpatterns.unsingle
+ + lpegpatterns.undouble
+
+local component = lpegCg(lpegCc("component") * lpegCs(c_token^1))
+local outer = lpegCg(lpegCc("outer") * lpegCs(f_token^1))
+----- operation = lpegCg(lpegCc("operation") * lpegCs(o_token^1))
+local operation = lpegCg(lpegCc("operation") * lpegCs(q_token + o_token^1))
+local arguments = lpegCg(lpegCc("arguments") * lpegCs(q_token + a_token^0))
+local special = lpegCg(lpegCc("special") * lpegCs(s_token^1))
+local inner = lpegCg(lpegCc("inner") * lpegCs(i_token^1))
+
+ arguments = (lbrace * arguments * rbrace)^-1
+ component = component * tcolon
+ outer = outer * dcolon
+ operation = outer^-1 * operation -- special case: page(file::1) and file::page(1)
+ inner = inner * arguments
+ special = special * lparent * (operation * arguments)^-1 * rparent
+
+local referencesplitter = spaces
+ * lpegCf (lpegCt("") * (component + outer)^-1 * (special + inner)^-1 * endofall, rawset)
+
+local prefixsplitter = lpegCs(lpegP((1-scolon)^1 * scolon))
+ * #-scolon
+ * lpegCs(lpegP(1)^1)
+
+local componentsplitter = lpegCs(lpegP((1-scolon)^1))
+ * scolon * #-scolon
+ * lpegCs(lpegP(1)^1)
+
+prefixsplitter = componentsplitter
+
+local function splitreference(str)
+ if str and str ~= "" then
+ return lpegmatch(referencesplitter,str)
+ end
+end
+
+local function splitprefix(str)
+ return lpegmatch(prefixsplitter,str)
+end
+
+local function splitcomponent(str)
+ return lpegmatch(componentsplitter,str)
+end
+
+-- register in the right namespace
+
+structures = structures or { }
+structures.references = structures.references or { }
+local references = structures.references
+
+references.referencesplitter = referencesplitter
+references.splitreference = splitreference
+references.prefixsplitter = prefixsplitter
+references.splitprefix = splitprefix
+references.componentsplitter = componentsplitter
+references.splitcomponent = splitcomponent
+
+-- test code:
+
+-- inspect(splitreference([[component:::inner]]))
+-- inspect(splitprefix([[component:::inner]]))
+-- inspect(splitprefix([[component:inner]]))
+
+-- inspect(splitreference([[name(foo)]]))
+-- inspect(splitreference([[name{foo}]]))
+-- inspect(splitreference([[xx::name(foo, bar and me)]]))
+
+-- inspect(splitreference([[ ]]))
+-- inspect(splitreference([[ inner ]]))
+-- inspect(splitreference([[ special ( operation { argument, argument } ) ]]))
+-- inspect(splitreference([[ special ( operation { argument } ) ]]))
+-- inspect(splitreference([[ special ( operation { argument, \argument } ) ]]))
+-- inspect(splitreference([[ special ( operation { \argument } ) ]]))
+-- inspect(splitreference([[ special ( operation ) ]]))
+-- inspect(splitreference([[ special ( \operation ) ]]))
+-- inspect(splitreference([[ special ( o\peration ) ]]))
+-- inspect(splitreference([[ special ( ) ]]))
+-- inspect(splitreference([[ inner { argument } ]]))
+-- inspect(splitreference([[ inner { \argument } ]]))
+-- inspect(splitreference([[ inner { ar\gument } ]]))
+-- inspect(splitreference([[inner{a\rgument}]]))
+-- inspect(splitreference([[ inner { argument, argument } ]]))
+-- inspect(splitreference([[ inner { argument, \argument } ]])) -- fails: bug in lpeg?
+-- inspect(splitreference([[ inner { \argument, \argument } ]]))
+-- inspect(splitreference([[ outer :: ]]))
+-- inspect(splitreference([[ outer :: inner]]))
+-- inspect(splitreference([[ outer :: special (operation { argument,argument } ) ]]))
+-- inspect(splitreference([[ outer :: special (operation { } )]]))
+-- inspect(splitreference([[ outer :: special ( operation { argument, \argument } ) ]]))
+-- inspect(splitreference([[ outer :: special ( operation ) ]]))
+-- inspect(splitreference([[ outer :: special ( \operation ) ]]))
+-- inspect(splitreference([[ outer :: special ( ) ]]))
+-- inspect(splitreference([[ outer :: inner { argument } ]]))
+-- inspect(splitreference([[ special ( outer :: operation ) ]]))
+
+-- inspect(splitreference([[inner(foo,bar)]]))
+
+-- inspect(splitreference([[]]))
+-- inspect(splitreference([[inner]]))
+-- inspect(splitreference([[special(operation{argument,argument})]]))
+-- inspect(splitreference([[special(operation)]]))
+-- inspect(splitreference([[special(\operation)]]))
+-- inspect(splitreference([[special()]]))
+-- inspect(splitreference([[inner{argument}]]))
+-- inspect(splitreference([[inner{\argument}]]))
+-- inspect(splitreference([[outer::]]))
+-- inspect(splitreference([[outer::inner]]))
+-- inspect(splitreference([[outer::special(operation{argument,argument})]]))
+-- inspect(splitreference([[outer::special(operation{argument,\argument})]]))
+-- inspect(splitreference([[outer::special(operation)]]))
+-- inspect(splitreference([[outer::special(\operation)]]))
+-- inspect(splitreference([[outer::special()]]))
+-- inspect(splitreference([[outer::inner{argument}]]))
+-- inspect(splitreference([[special(outer::operation)]]))
+
+-- inspect(splitreference([[special(operation)]]))
+-- inspect(splitreference([[special(operation(whatever))]]))
+-- inspect(splitreference([[special(operation{argument,argument{whatever}})]]))
+-- inspect(splitreference([[special(operation{argument{whatever}})]]))
+
+-- inspect(splitreference([[special("operation(")]]))
+-- inspect(splitreference([[special("operation(whatever")]]))
+-- inspect(splitreference([[special(operation{"argument,argument{whatever"})]]))
+-- inspect(splitreference([[special(operation{"argument{whatever"})]]))
+
+-- inspect(splitreference([[url(http://a,b.c)]]))
+-- inspect(splitcomponent([[url(http://a,b.c)]]))
+-- inspect(splitcomponent([[url(http://a.b.c)]]))
+
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-sbe.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-sbe.mkxl
index d3141d28b66..ade59da0b60 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/strc-sbe.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-sbe.mkxl
@@ -44,8 +44,8 @@
{\strc_sectionblock_define_normal[#1][#3]%
%\expandafter\newif\csname if#2\endcsname % obsolete
\strc_sectionblock_set_environment{#1}\empty
- \frozen\setuvalue{\e!start#2}{\startsectionblock[#1]}%
- \frozen\setuvalue{\e!stop #2}{\stopsectionblock}}
+ \frozen\protected\defcsname\e!start#2\endcsname{\startsectionblock[#1]}%
+ \frozen\protected\defcsname\e!stop #2\endcsname{\stopsectionblock}}
\ifdefined \resetallstructuremarks \else
\let\resetallstructuremarks\relax
@@ -79,7 +79,7 @@
bookmark {\sectionblockparameter\c!bookmark}%
\relax}
-\mutable\let\currentsectionblock\empty % was \s!unknown
+\mutable\lettonothing\currentsectionblock % was \s!unknown
\permanent\tolerant\protected\def\startsectionblock[#1]#*[#2]%
{%\ctxlua{structures.counters.check(0)}% we assume sane usage of \page, as this is the only workable place (in push)
@@ -123,15 +123,14 @@
\installcorenamespace{sectionblockenvironment}
\protected\def\strc_sectionblock_set_environment#1#2%
- {\setvalue{\??sectionblockenvironment#1}{#2}}
+ {\defcsname\??sectionblockenvironment#1\endcsname{#2}}
\protected\def\strc_sectionblock_get_environment#1%
{\csname\??sectionblockenvironment#1\endcsname}
-\permanent\tolerant\protected\setvalue{\e!start\v!sectionblockenvironment}[#1]% evt \pushendofline \popendofline
+\permanent\tolerant\protected\defcsname\e!start\v!sectionblockenvironment\endcsname[#1]% evt \pushendofline \popendofline
{\grabuntil{\e!stop\v!sectionblockenvironment}{\strc_sectionblock_set_environment{#1}}}
-\aliased\letvalue{\e!stop\v!sectionblockenvironment}\relax
-
+\permanent\protected\expandafter\lettonothing\csname\e!stop\v!sectionblockenvironment\endcsname
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-sec.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-sec.mkxl
index 7c4a8fc249d..002945208f2 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/strc-sec.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-sec.mkxl
@@ -55,8 +55,8 @@
\def\m_strc_references_prefix_yes{+}
\def\m_strc_references_prefix_nop{-}
-\mutable\let\currentstructurereferenceprefix\empty
-\mutable\let\currentstructurereferencetext \empty
+\mutable\lettonothing\currentstructurereferenceprefix
+\mutable\lettonothing\currentstructurereferencetext
\installglobalmacrostack\currentstructurereferenceprefix
@@ -64,8 +64,12 @@
{\ifempty\currentstructurereferenceprefix
% nothing
\orelse\ifx\currentstructurereferenceprefix\m_strc_references_prefix_yes
- \global\advance\prefixcounter \plusone % temp here
- \setupglobalreferenceprefix[\the\prefixcounter]%
+ \ifempty\currentstructurereference
+ \global\advanceby\prefixcounter \plusone % temp here
+ \setupglobalreferenceprefix[\the\prefixcounter]%
+ \else
+ \setupglobalreferenceprefix[\currentstructurereference]%
+ \fi
\orelse\ifx\currentstructurereferenceprefix\m_strc_references_prefix_nop
\setupglobalreferenceprefix[]%
\else
@@ -101,15 +105,16 @@
\permanent\def\namedstructureheadlocation#1% expandable, maybe [#1]
{\csname\??savedinternalreference\ifcsname\??savedinternalreference#1\endcsname#1\else\s!default\fi\endcsname}
-\mutable\let\currentheadbackreference \empty
-\mutable\let\currentheaddefault \empty
-\mutable\let\currentheadincrement \empty
-\mutable\let\currentheadinteraction \empty
-\mutable\let\currentheadlabeltag \empty
-\mutable\let\currentheadnumber \!!zerocount
-\mutable\let\currentheadrenderingalternative\empty
-\mutable\let\currentheadrenderingsetup \empty
-\mutable\let\currentheadtext \empty
+\mutable\lettonothing\currentheadbackreference
+\mutable\lettonothing\currentheaddefault
+\mutable\lettonothing\currentheadincrement
+\mutable\lettonothing\currentheadinteraction
+\mutable\lettonothing\currentheadlabeltag
+\mutable\lettonothing\currentheadrenderingalternative
+\mutable\lettonothing\currentheadrenderingsetup
+\mutable\lettonothing\currentheadtext
+
+\mutable\let\currentheadnumber\!!zerocount
% zeros:
%
@@ -453,9 +458,9 @@
\setstructurelevel\currenthead{\thenamedheadlevel\currenthead}%
\to \everyredefinehead
-\mutable\let\currentsectionheadcoupling\empty
-\mutable\let\currentsectionheadsection \empty
-\mutable\let\currentsectionlevel \empty
+\mutable\lettonothing\currentsectionheadcoupling
+\mutable\lettonothing\currentsectionheadsection
+\mutable\lettonothing\currentsectionlevel
\appendtoks
% beware, this is a global register
@@ -498,22 +503,22 @@
\pop_macro_currentheadparent
\pop_macro_currenthead}
-\mutable\let\currentnamedsection\empty
+\mutable\lettonothing\currentnamedsection
\installmacrostack\currentnamedsection
% structure sections (the parents of chapter etc)
-\aliased\let\firstsectionname\empty
-\aliased\let\lastsectionname \empty
+\mutable\lettonothing\firstsectionname
+\mutable\lettonothing\lastsectionname
%aliased\let\resetallstructuremarks \relax
%aliased\let\resetcurrentstructuremarks \relax
\aliased\let\resetcurrentstructuremarkswithpage\relax
-\permanent\protected\def\resetallstructuremarks {\resetmarking[\firstsectionname]} % will become option (was \v!section-1)
-\permanent\protected\def\resetcurrentstructuremarks {\resetmarking[\lastsectionname]} % will become option
-%permanent\protected\def\resetcurrentstructuremarkswithpage{\resetmarking[\lastsectionname]} % will become option
+\permanent\protected\def\resetallstructuremarks {\clearmarking[\firstsectionname]} % will become option (was \v!section-1)
+\permanent\protected\def\resetcurrentstructuremarks {\clearmarking[\lastsectionname]} % will become option
+%permanent\protected\def\resetcurrentstructuremarkswithpage{\clearmarking[\lastsectionname]} % will become option
% We could use a commandhandler here but sections are somewhat special in the
% sense that we have two ways of chaining: the main section (levels) as well
@@ -524,7 +529,7 @@
% 0 = block
% +1 = structurelevel 1 .. n
-\newcount\maxstructuredepth
+\newinteger\maxstructuredepth
\permanent\def\sectionlevel#1%
{\csname\??headlevel\ifcsname\??headlevel#1\endcsname#1\else\v!none\fi\endcsname}
@@ -550,14 +555,14 @@
\newtoks\everydefinesection
-\mutable\let\currentsection\empty % historic alias
+\mutable\lettonothing\currentsection % historic alias
\permanent\protected\def\definesection[#1]%
{\ifcsname\??headlevel#1\endcsname \else
\edef\currenthead{#1}%
\let\currentsection\currenthead % just an alias
- \global\advance\maxstructuredepth\plusone
- \setevalue{\??headlevel#1}{\the\maxstructuredepth}%
+ \global\advanceby\maxstructuredepth\plusone
+ \edefcsname\??headlevel#1\endcsname{\the\maxstructuredepth}%
\setstructurelevel{#1}{\sectionlevel{#1}}%
\normalexpanded{\setheadparameter{\s!parent}{\??head\lastsectionname}}% TO BE CHECKED, WE HAVE A HELPER
\the\everydefinesection
@@ -815,9 +820,10 @@
\fi
\dostoptagged}
-\mutable\let\currenthead \empty
-\mutable\let\currentheadcoupling\empty
-\mutable\let\currentheadsection \empty
+\mutable\lettonothing\currenthead
+\mutable\lettonothing\currentheadcoupling
+\mutable\lettonothing\currentheadsection
+
\mutable\let\currentheadlevel \!!zerocount
\mutable\let\currentheadcounter \!!zerocount
@@ -847,7 +853,7 @@
\permanent\tolerant\protected\def\placeheadtext[#1]%
{\dontleavehmode
\begingroup
- \protected\def\\{\space}% messy here, but the default (and needs to be grouped)
+ \enforced\permanent\protected\def\\{\space}% messy here, but the default (and needs to be grouped)
\global\settrue\headisdisplay % triggers interlinespace checking
\edef\currenthead{#1}% maybe only when #1 is given
\strc_rendering_initialize_style_and_color\c!textstyle\c!textcolor
@@ -872,9 +878,9 @@
\newtoks\everybeforesectionheadhandle
\newtoks\everyaftersectionheadhandle
-\mutable\let\getheadnumber\empty
-\mutable\let\getheadtitle \empty
-\mutable\let\getheadsyncs \empty
+\mutable\lettonothing\getheadnumber
+\mutable\lettonothing\getheadtitle
+\mutable\lettonothing\getheadsyncs
\def\strc_sectioning_handle#1#2#3% name data userdata (we can move #1 to the caller)
{\xdef\currenthead {#1}%
@@ -901,9 +907,9 @@
%
% \currentstructuresynchronize % will move
%
- \let\getheadnumber\empty
- \let\getheadtitle \empty
- \let\getheadsyncs \empty
+ \lettonothing\getheadnumber
+ \lettonothing\getheadtitle
+ \lettonothing\getheadsyncs
\ifconditional\c_strc_sectioning_increment
\ifconditional\c_strc_sectioning_place
\strc_sectioning_before_yes
@@ -981,14 +987,12 @@
\setfalse\c_strc_sectioning_ignore_page
% ignorespaces prevents spaces creeping in when after=\dontleavehmode
\dostarttagged\t!sectioncontent\empty
- \ifempty\currentstructureplaceholder
- \ifconditional\headisdisplay
- \doubleexpandafter\ignorespaces
- \else
- \doubleexpandafter\ignorepars
- \fi
+ \unless\ifempty\currentstructureplaceholder
+ \expandafter\strc_sectioning_placeholder
+ \orelse\ifconditional\headisdisplay
+ \expandafter\ignorespaces
\else
- \expandafter\strc_sectioning_placeholder
+ \expandafter\ignorepars
\fi}
%D \starttyping
@@ -1030,21 +1034,46 @@
\smashedbox\b_sectioning_delayed
\fi}
-\protected\def\strc_rendering_place_head_section % see hidden below
- {\global\setbox\b_sectioning_delayed\hpack\bgroup
- \setmarking[\currentheadcoupling]{li::\currentstructurelistnumber}%
- \hpack\headreferenceattributes{}% also does the mark
- \theheadsynchronization
- \egroup}
-
-\protected\def\strc_rendering_place_head_hidden % maybe trialtypesetting check
- {\xdefcsname\??hiddenheadattr\currenthead\endcsname
- {\headreferenceattributes}% can be used when making a box
- \xdefcsname\??hiddenheadsync\currenthead\endcsname
- {\noexpand\letgvalue{\??hiddenheadsync\currenthead}\relax
- \noexpand\setmarking[\currentheadcoupling]{li::\currentstructurelistnumber}%
- \hpack\headreferenceattributes{}% otherwise no destination ... maybe tag ref as hidden and fall back on page reference
- \theheadsynchronization}} % and it's a node anyway
+\ifdefined\??markingclass % uses a node, so we need to embed / bind
+
+ \protected\def\strc_rendering_place_head_section % see hidden below
+ {\global\setbox\b_sectioning_delayed\hpack\bgroup
+ \hpack\headreferenceattributes\bgroup
+ \setmarking[\currentheadcoupling]{li::\currentstructurelistnumber}% also does the mark
+ \egroup
+ \theheadsynchronization
+ \egroup}
+
+ \protected\def\strc_rendering_place_head_hidden % maybe trialtypesetting check
+ {\xdefcsname\??hiddenheadattr\currenthead\endcsname
+ {\headreferenceattributes}% can be used when making a box
+ \xdefcsname\??hiddenheadsync\currenthead\endcsname
+ {\noexpand\gletcsname\??hiddenheadsync\currenthead\endcsname\relax
+ % {\noexpand\gletcsname\??hiddenheadsync\currenthead\endcsname\relax
+ \hpack\headreferenceattributes\bgroup
+ \noexpand\setmarking[\currentheadcoupling]{li::\currentstructurelistnumber}% otherwise no destination ... maybe tag ref as hidden and fall back on page reference
+ \egroup
+ \theheadsynchronization}} % and it's a node anyway
+
+\else % uses attributes so no interference
+
+ \protected\def\strc_rendering_place_head_section % see hidden below
+ {\global\setbox\b_sectioning_delayed\hpack\bgroup
+ \setmarking[\currentheadcoupling]{li::\currentstructurelistnumber}%
+ \hpack\headreferenceattributes{}% also does the mark
+ \theheadsynchronization
+ \egroup}
+
+ \protected\def\strc_rendering_place_head_hidden % maybe trialtypesetting check
+ {\xdefcsname\??hiddenheadattr\currenthead\endcsname
+ {\headreferenceattributes}% can be used when making a box
+ \xdefcsname\??hiddenheadsync\currenthead\endcsname
+ {\noexpand\gletcsname\??hiddenheadsync\currenthead\endcsname\relax
+ \noexpand\setmarking[\currentheadcoupling]{li::\currentstructurelistnumber}%
+ \hpack\headreferenceattributes{}% otherwise no destination ... maybe tag ref as hidden and fall back on page reference
+ \theheadsynchronization}} % and it's a node anyway
+
+\fi
\permanent\def\synchronizehead #1{\begincsname\??hiddenheadsync#1\endcsname}
\permanent\def\theheadreferenceattributes#1{\begincsname\??hiddenheadattr#1\endcsname}
@@ -1121,14 +1150,14 @@
\doifelselayouttextline\v!footer{\normalexpanded{\setuplayouttext[\v!footer][\c!state=\p_footer]}}\donothing
\fi}
-\newcount \c_strc_sectioning_preceding_level \c_strc_sectioning_preceding_level\plusone
+\newinteger \c_strc_sectioning_preceding_level \c_strc_sectioning_preceding_level\plusone
\newconditional\c_strc_sectioning_auto_break \settrue\c_strc_sectioning_auto_break
\newconditional\c_strc_sectioning_ignore_page
-\newsignal \d_strc_sectioning_continuous_signal
+\newboundary \c_strc_sectioning_boundary
\protected\def\strc_sectioning_inject_continuous_signal
{\ifhmode
- \hskip\d_strc_sectioning_continuous_signal\relax
+ \boundary\c_strc_sectioning_boundary
\fi}
% \let\dotagsectionlevel\relax
@@ -1161,7 +1190,7 @@
{\ifhmode
\scratchcounter\lastpenalty
\unpenalty % no beauty in this
- \ifdim\lastskip=\d_strc_sectioning_continuous_signal
+ \ifnum\lastboundary=\c_strc_sectioning_boundary
% no page break
\ifconditional\c_strc_sectioning_ignore_page
\setfalse\c_strc_sectioning_ignore_page
@@ -1187,7 +1216,7 @@
%permanent\def\previoussectioncountervalue{\clf_depthnumber\numexpr\thenamedheadlevel\currenthead+\minusone\relax}
\permanent\def\previoussectioncountervalue{\clf_depthnumber\numexpr\thenamedheadlevel\previoushead\relax}
-\mutable\let\previoushead\empty
+\mutable\lettonothing\previoushead
\def\strc_sectioning_handle_page_nop
{\edef\p_continue{\headparameter\c!continue}%
@@ -1217,7 +1246,7 @@
\spac_vspacing_same_page\currentheadlevel\zerocount
\fi
\headparameter\c!before\relax
- \indent
+ \indent % hm, not a clever one?
\else
\page_otr_command_flush_side_floats
\ifconditional\c_strc_sectioning_auto_break
@@ -1252,7 +1281,6 @@
\spac_vspacing_same_page\currentheadlevel\plustwo
\fi}
-
% We do support negative numbers but it can have side effects that we won't catch:
%
% \chapter{some} \setupheadnumber[chapter][3] \chapter{more}
@@ -1272,8 +1300,8 @@
\permanent\def\namedheadnumber #1{\getstructurenumber {\thenamedheadlevel{#1}}}
\permanent\def\somenamedheadnumber#1#2{\getsomestructurenumber{\thenamedheadlevel{#1}}{#2}}
-\permanent\tolerant\protected\def\headnumber[#1]#*[#2]% simple case is just a number
- {\getsomefullstructurenumber{\ifparameter#1\or\thenamedheadlevel{#1}\fi}{#2}}
+\permanent\tolerant\protected\def\headnumber[#1]#*[#2]%
+ {\getsomefullstructurenumber{\thenamedheadlevel{#1}}{#2}}
\permanent\tolerant\protected\def\someheadnumber[#1]#*[#2]%
{\dontleavehmode
@@ -1317,6 +1345,10 @@
\finalizeautostructurelevels
\to \everystoptext
+%D Defined at the \LUA\ end:
+
+% \doifelsefirstsectionpage{chapter}{do this}{or that} % in pagebody building
+
\stopcontextdefinitioncode
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-syn.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-syn.mkxl
index df573a7e995..af6d0c6e204 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/strc-syn.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-syn.mkxl
@@ -101,6 +101,31 @@
%D
%D The lists are constructions (like descriptions are) and can be set up
%D likewise.
+%D
+%D You can show the currently accessed entries as follows:
+%D
+%D \starttyping
+%D \startchapter[title=One]
+%D test \FIRST\ test test \THIRD\ test \blank
+%D \placelistofsynonyms[myabbreviation]
+%D \resetsynonymsprogress[myabbreviation] % reset state
+%D \stopchapter
+%D
+%D \startchapter[title=Two]
+%D test \FIRST\ test test \SECOND\ test \blank
+%D \placelistofsynonyms[myabbreviation][criterium=current]
+%D \resetsynonymsprogress[myabbreviation] % reset state
+%D \stopchapter
+%D
+%D \startchapter[title=Three]
+%D test test test test test test \blank
+%D \placelistofsynonyms[myabbreviation][criterium=current] % also reset state
+%D \stopchapter
+%D
+%D \startchapter[title=All]
+%D \placelistofsynonyms[myabbreviation][criterium=all]
+%D \stopchapter
+%D \stoptyping
% todo: add 'define only' option to descriptions, then add sorting (also based on key)
% and call to definition -> replaces this module
@@ -235,12 +260,12 @@
% these might become private
-\mutable\let\currentsynonymoption \empty
-\mutable\let\currentsynonymcoding \empty
-\mutable\let\currentsynonymexpansion\empty
-\mutable\let\currentsynonym \empty
-\mutable\let\currentsynonymtag \empty
-\mutable\let\currentsynonymtext \empty
+\mutable\lettonothing\currentsynonymoption
+\mutable\lettonothing\currentsynonymcoding
+\mutable\lettonothing\currentsynonymexpansion
+\mutable\lettonothing\currentsynonym
+\mutable\lettonothing\currentsynonymtag
+\mutable\lettonothing\currentsynonymtext
\permanent\tolerant\protected\def\definesynonyms[#1]#*[#2]#*[#3]#*[#4]% name plural \meaning \use
{\ifnum\lastarguments=\plusfour
@@ -274,13 +299,29 @@
\frozen\instance\protected\defcsname\e!complete\e!listof#2\endcsname{\completelistofsynonyms[#1]}%
\fi}
-\permanent\tolerant\protected\def\definesynonym[#1]#*[#2]#*[#3]%
+% \abbreviation[XXX][321]{321}{Three, Two, One} : optional sort key
+
+\permanent\tolerant\protected\def\definesynonym[#1]#*[#2]#*[#3]#*[#4]% [yes][abbreviation][FOO]{foo}{foo me}
{\begingroup
\edef\currentsynonymoption{#1}%
\edef\currentsynonym{#2}%
\edef\currentsynonymtag{#3}%
+ \edef\currentsynonymsortkey{#4}%
\strc_synonyms_define_entry}
+% \installcorenamespace {synonymentry}
+%
+% \installsetuponlycommandhandler \??synonymentry {synonymentry}
+%
+% \permanent\tolerant\protected\def\setsynonym[#1]#*[#2]%
+% {\begingroup
+% \setupsynonymentry[#2]%
+% \edef\currentsynonym {#1}%
+% \edef\currentsynonymoption {\synonymentryparameter\c!option}%
+% \edef\currentsynonymtag {\synonymentryparameter\c!tag}%
+% \edef\currentsynonymsortkey{\synonymentryparameter\c!sortkey}%
+% \strc_synonyms_define_entry{\synonymentryparameter\c!text}{\synonymentryparameter\c!meaning}}
+
\def\strc_synonyms_define_entry#1#2%
{\let\currentsimplelist\currentsynonym
\ifempty\currentsynonymtag
@@ -305,6 +346,7 @@
}%
definition {%
tag {\currentsynonymtag}%
+ sortkey {\currentsynonymsortkey}%
synonym {\m_synonyms_text}%
meaning {\m_synonyms_meaning}%
% used false
@@ -322,8 +364,11 @@
\permanent \protected\def\currentsynonymmeaning {\clf_synonymmeaning{\currentsimplelist}{\currentsynonymtag}}
\permanent \protected\def\doifelsecurrentsynonymused {\clf_doifelsesynonymused{\currentsimplelist}{\currentsynonymtag}}
\permanent \protected\def\doifelsecurrentsynonymshown{\clf_doifelsesynonymshown{\currentsimplelist}{\currentsynonymtag}}
-\permanent \protected\def\resetusedsynonyms [#1]{\clf_resetusedsynonyms{#1}}
-\permanent \protected\def\resetshownsynonyms [#1]{\clf_resetshownsynonyms{#1}}
+\permanent \protected\def\resetusedsynonyms [#1]{\clf_resetsynonyms{#1}{used}}
+\permanent \protected\def\resetshownsynonyms [#1]{\clf_resetsynonyms{#1}{shown}}
+\permanent \protected\def\resetlistsynonyms [#1]{\clf_resetsynonyms{#1}{list}}
+\permanent \protected\def\resetsynonyms [#1]{\clf_resetsynonyms{#1}{all}}
+\permanent \protected\def\resetsynonymsprogress [#1]{\clf_resetsynonyms{#1}{progress}}
\aliased\let\rawsynonymname \clf_synonymname
\aliased\let\rawsynonymmeaning\clf_synonymmeaning
@@ -453,7 +498,7 @@
{}% todo: message that invalid
\endgroup}
-\mutable\let\currentsimplelistentry\empty
+\mutable\lettonothing\currentsimplelistentry
\protected\def\strc_synonym_normal#1#2#3#4%
{\begingroup
@@ -482,12 +527,12 @@
% these might become private
-\mutable\let\currentsortingoption \empty
-\mutable\let\currentsortingcoding \empty
-\mutable\let\currentsortingexpansion\empty
-\mutable\let\currentsorting \empty
-\mutable\let\currentsortingtag \empty
-\mutable\let\currentsortingtext \empty
+\mutable\lettonothing\currentsortingoption
+\mutable\lettonothing\currentsortingcoding
+\mutable\lettonothing\currentsortingexpansion
+\mutable\lettonothing\currentsorting
+\mutable\lettonothing\currentsortingtag
+\mutable\lettonothing\currentsortingtext
\permanent\tolerant\protected\def\definesorting[#1]#*[#2]#*[#3]%
{\ifnum\lastarguments=\plusthree
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-tag.lmt b/Master/texmf-dist/tex/context/base/mkxl/strc-tag.lmt
index 96510f24eac..ec6455cc645 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/strc-tag.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-tag.lmt
@@ -182,34 +182,34 @@ local properties = allocate { -- todo: more "record = true" to improve forma
margintext = { pdf = "Span", nature = "inline" },
marginanchor = { pdf = "Span", nature = "inline" },
- math = { pdf = "Div", nature = "inline" }, -- no display
- mn = { pdf = "Span", nature = "mixed" },
- mi = { pdf = "Span", nature = "mixed" },
- mo = { pdf = "Span", nature = "mixed" },
- ms = { pdf = "Span", nature = "mixed" },
- mrow = { pdf = "Span", nature = "display" },
- msubsup = { pdf = "Span", nature = "display" },
- msub = { pdf = "Span", nature = "display" },
- msup = { pdf = "Span", nature = "display" },
- merror = { pdf = "Span", nature = "mixed" },
- munderover = { pdf = "Span", nature = "display" },
- munder = { pdf = "Span", nature = "display" },
- mover = { pdf = "Span", nature = "display" },
- mtext = { pdf = "Span", nature = "mixed" },
- mfrac = { pdf = "Span", nature = "display" },
- mroot = { pdf = "Span", nature = "display" },
- msqrt = { pdf = "Span", nature = "display" },
- mfenced = { pdf = "Span", nature = "display" },
- maction = { pdf = "Span", nature = "display" },
+ math = { pdf = "Div", nature = "inline", namespace = "mathml" }, -- no display
+ mn = { pdf = "Span", nature = "mixed", namespace = "mathml" },
+ mi = { pdf = "Span", nature = "mixed", namespace = "mathml" },
+ mo = { pdf = "Span", nature = "mixed", namespace = "mathml" },
+ ms = { pdf = "Span", nature = "mixed", namespace = "mathml" },
+ mrow = { pdf = "Span", nature = "display", namespace = "mathml" },
+ msubsup = { pdf = "Span", nature = "display", namespace = "mathml" },
+ msub = { pdf = "Span", nature = "display", namespace = "mathml" },
+ msup = { pdf = "Span", nature = "display", namespace = "mathml" },
+ merror = { pdf = "Span", nature = "mixed", namespace = "mathml" },
+ munderover = { pdf = "Span", nature = "display", namespace = "mathml" },
+ munder = { pdf = "Span", nature = "display", namespace = "mathml" },
+ mover = { pdf = "Span", nature = "display", namespace = "mathml" },
+ mtext = { pdf = "Span", nature = "mixed", namespace = "mathml" },
+ mfrac = { pdf = "Span", nature = "display", namespace = "mathml" },
+ mroot = { pdf = "Span", nature = "display", namespace = "mathml" },
+ msqrt = { pdf = "Span", nature = "display", namespace = "mathml" },
+ mfenced = { pdf = "Span", nature = "display", namespace = "mathml" },
+ maction = { pdf = "Span", nature = "display", namespace = "mathml" },
mstacker = { pdf = "Span", nature = "display" }, -- these are only internally used
mstackertop = { pdf = "Span", nature = "display" }, -- these are only internally used
mstackerbot = { pdf = "Span", nature = "display" }, -- these are only internally used
mstackermid = { pdf = "Span", nature = "display" }, -- these are only internally used
- mtable = { pdf = "Table", nature = "display" }, -- might change
- mtr = { pdf = "TR", nature = "display" }, -- might change
- mtd = { pdf = "TD", nature = "display" }, -- might change
+ mtable = { pdf = "Table", nature = "display", namespace = "mathml" }, -- might change
+ mtr = { pdf = "TR", nature = "display", namespace = "mathml" }, -- might change
+ mtd = { pdf = "TD", nature = "display", namespace = "mathml" }, -- might change
ignore = { pdf = "Span", nature = "mixed" }, -- used internally
private = { pdf = "Span", nature = "mixed" }, -- for users (like LS) when they need it
@@ -330,6 +330,10 @@ function tags.getextradata()
return extradata
end
+function tags.enabled()
+ return enabled
+end
+
function tags.start(tag,specification)
if not enabled then
codeinjections.enabletags()
@@ -572,7 +576,8 @@ implement {
public = true,
protected = true,
actions = tags.setproperty,
- arguments = { "optional", "'backend'", "optional" },
+-- arguments = { "optional", "'backend'", "optional" },
+ arguments = { "optional", "'pdf'", "optional" },
}
implement {
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-tag.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-tag.mkxl
index c2597074750..3c00acb6506 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/strc-tag.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-tag.mkxl
@@ -206,21 +206,6 @@
\installsetuponlycommandhandler \??tagging {tagging}
-\def\strc_tags_report_hyphen#1%
- {\writestatus\m!languages{setting #1 to U+00AD}}
-
-\protected\def\strc_tags_patch_hyphen
- {% for the moment here
- \ifnum\languageparameter\s!lefthyphenchar>\zerocount
- \setuplanguage[\s!default][\s!lefthyphenchar="AD]%
- \strc_tags_report_hyphen\s!lefthyphenchar
- \fi
- \ifnum\languageparameter\s!righthyphenchar>\zerocount
- \setuplanguage[\s!default][\s!righthyphenchar="AD]%
- \strc_tags_report_hyphen\s!righthyphenchar
- \fi
- \let\strc_tags_report_hyphen\gobbleoneargument}
-
% It makes no sense to have labels ... maybe some day as a last 'replace' in the export
% which might be more efficient then ... okay, we now cannot overload but who cares.
@@ -245,8 +230,7 @@
\fi}
\protected\def\strc_tags_enable_elements
- {\strc_tags_patch_hyphen
- \enforced\let\startelement \strc_tags_element_start_yes
+ {\enforced\let\startelement \strc_tags_element_start_yes
\enforced\let\stopelement \strc_tags_element_stop_yes
\enforced\let\dosettagproperty\strc_tags_set_aspect}
@@ -296,7 +280,7 @@
\newconditional\c_strc_tags_enabled
-\aliased\let\dotaggedplaceholder\empty
+\lettonothing\dotaggedplaceholder
\immutable\chardef\strc_tags_placeholder_char\zerocount % "FFFC
@@ -325,7 +309,7 @@
\enforced\let\dostoptagged \donothing
\else
% initial
- \enforced\let\dotaggedplaceholder \empty
+ \enforced\lettonothing\dotaggedplaceholder
\enforced\let\dostarttagged \gobbletwoarguments
\enforced\let\dostarttaggednodetail\gobbleoneargument
\enforced\let\dostarttaggedchained \gobblethreearguments
@@ -351,6 +335,8 @@
{\enforced\let\getelementtag \donothing
\enforced\let\setupelementuserproperties\gobbletwooptionals}
+\strc_tags_disable
+
%D The triggers:
\newtoks\everyenableelements
@@ -402,10 +388,10 @@
{\endgraf % we end before the group
\begingroup
\ifarguments
- \let\currentparagraph\empty
+ \lettonothing\currentparagraph
\or
\ifhastok={#1}%
- \let\currentparagraph\empty
+ \lettonothing\currentparagraph
\setupcurrentparagraph[#1]
\else
\edef\currentparagraph{#1}%
diff --git a/Master/texmf-dist/tex/context/base/mkxl/strc-usr.mkxl b/Master/texmf-dist/tex/context/base/mkxl/strc-usr.mkxl
index 28d398194f1..cd1f97dec0b 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/strc-usr.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/strc-usr.mkxl
@@ -91,21 +91,16 @@
\installcommandhandler \????userdata {userdata} \????userdata
\installcommandhandler \????userdataalternative {userdataalternative} \????userdataalternative
+\appendtoks
+ \frozen\protected\instance\edefcsname\e!start\currentuserdata\endcsname{\userdata_start_instance{\currentuserdata}}%
+ \frozen\protected\instance\letcsname \e!stop \currentuserdata\endcsname\userdata_stop_instance
+\to \everydefineuserdata
+
\permanent\protected\def\startuserdata
{\begingroup
- \let\currentuserdata\empty
+ \lettonothing\currentuserdata
\doifelsenextoptionalcs\userdata_start_delayed\userdata_start_indeed}
-% This variant works only when the userdata instance exists while the assignment check
-% can also be used with undefined instances which falls back to the global settings.
-%
-% \def\userdata_start_delayed[#1]%
-% {\ifcsname\nameduserdatahash{\detokenize\expandafter{\normalexpanded{#1}}}\s!parent\endcsname
-% \expandafter\userdata_start_delayed_name
-% \else
-% \expandafter\userdata_start_delayed_parameters
-% \fi[#1]}
-
\def\userdata_start_delayed[#1]%
{\doifelseassignmentcs{#1}%
\userdata_start_delayed_parameters
@@ -121,15 +116,29 @@
\checkuserdataparent
\doifelsenextoptionalcs\userdata_start_delayed_parameters\userdata_start_indeed}
+\protected\tolerant\def\userdata_start_instance#1#*[#2]%
+ {\begingroup
+ \edef\currentuserdata{#1}%
+ \setupcurrentuserdata[#2]%
+ \grabbufferdatadirect
+ % {\s!userdata:\currentuserdata}%
+ {\s!userdata}% unnested, as before
+ {\e!start\currentuserdata}%
+ {\e!stop \currentuserdata}}
+
\def\userdata_start_indeed
- {\grabbufferdatadirect\s!userdata{\csstring\startuserdata}{\csstring\stopuserdata}}
+ {\grabbufferdatadirect
+ % {\s!userdata:\currentuserdata}%
+ {\s!userdata}% unnested, as before
+ {\csstring\startuserdata}%
+ {\csstring\stopuserdata}}
\permanent\protected\def\stopuserdata
- {\userdataparameter\c!before % HH: moved, so we obey the outer spacing
- \dostarttagged\t!userdata\currentuserdata % HH: added, maybe move up ?
+ {\userdataparameter\c!before
+ \dostarttagged\t!userdata\currentuserdata
\begingroup
\useuserdatastyleandcolor\c!style\c!color
- \usealignparameter\userdataparameter % HH: added
+ \usealignparameter\userdataparameter
\edef\currentuserdataalternative{\userdataparameter\c!alternative}%
\ifcsname\currentuserdataalternativehash\s!parent\endcsname \else
\let\currentuserdataalternative\s!default
@@ -139,14 +148,20 @@
\directsetup\p_renderingsetup
\endgroup
\dostoptagged
- \userdataparameter\c!after % HH: moved
+ \userdataparameter\c!after
\endgroup}
-\permanent\protected\def\getuserdata
- {\getbufferdata[\s!userdata]}
+\aliased\let\userdata_stop_instance\stopuserdata
+
+% kind of nested, when we need it:
+%
+% \permanent\tolerant\protected\def\getuserdata [#1]{\normalexpanded{\getbufferdata[\s!userdata:\ifparameter#1\or#1\else\currentuserdata\fi]}}
+% \permanent\tolerant\protected\def\getinlineuserdata[#1]{\normalexpanded{\inlinebuffer [\s!userdata:\ifparameter#1\or#1\else\currentuserdata\fi]}}
+
+% unnested, as before:
-\permanent\protected\def\getinlineuserdata
- {\inlinebuffer[\s!userdata]}
+\permanent\tolerant\protected\def\getuserdata [#1]{\getbufferdata[\s!userdata]}
+\permanent\tolerant\protected\def\getinlineuserdata[#1]{\inlinebuffer [\s!userdata]}
\defineuserdataalternative
[\s!default]
diff --git a/Master/texmf-dist/tex/context/base/mkxl/supp-box.lmt b/Master/texmf-dist/tex/context/base/mkxl/supp-box.lmt
index 657e3addb97..a5bfe139452 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/supp-box.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/supp-box.lmt
@@ -7,8 +7,6 @@ if not modules then modules = { } end modules ['supp-box'] = {
license = "see context related readme files"
}
--- this is preliminary code, use insert_before etc
-
local report_hyphenation = logs.reporter("languages","hyphenation")
local tonumber, next, type = tonumber, next, type
@@ -32,6 +30,8 @@ local glyph_code = nodecodes.glyph
local par_code = nodecodes.par
local indent_code = nodes.listcodes.indent
+local topskip_code = nodes.gluecodes.topskip
+local line_code = nodes.listcodes.line
local hmode_code = tex.modelevels.horizontal
@@ -71,20 +71,20 @@ local setattrlist = nuts.setattrlist
local setwhd = nuts.setwhd
local setglue = nuts.setglue
-local flush_node = nuts.flush_node
-local flush_list = nuts.flush_list
+local flushnode = nuts.flushnode
+local flushlist = nuts.flushlist
local copy_node = nuts.copy
-local copy_list = nuts.copy_list
+local copylist = nuts.copylist
local find_tail = nuts.tail
local getdimensions = nuts.dimensions
local hpack = nuts.hpack
local vpack = nuts.vpack
-local traverse_id = nuts.traverse_id
+local traverseid = nuts.traverseid
local traverse = nuts.traverse
local free = nuts.free
local findtail = nuts.tail
local reverse = nuts.reverse
-local effective_glue= nuts.effective_glue
+local effectiveglue = nuts.effectiveglue
local nextdisc = nuts.traversers.disc
local nextdir = nuts.traversers.dir
@@ -101,9 +101,18 @@ local setlistcolor = nodes.tracers.colors.setlist
local texget = tex.get
local texgetbox = tex.getbox
+local texisdimen = tex.isdimen
local texsetdimen = tex.setdimen
local texgetnest = tex.getnest
+local d_lastnaturalboxwd = texisdimen("lastnaturalboxwd")
+local d_lastnaturalboxht = texisdimen("lastnaturalboxht")
+local d_lastnaturalboxdp = texisdimen("lastnaturalboxdp")
+
+local d_givenwidth = texisdimen("givenwidth")
+local d_givenheight = texisdimen("givenheight")
+local d_givendepth = texisdimen("givendepth")
+
local function hyphenatedlist(head,usecolor)
local current = head and tonut(head)
while current do
@@ -122,7 +131,7 @@ local function hyphenatedlist(head,usecolor)
setlistcolor(post,"darkyellow")
end
if replace then
- flush_list(replace)
+ flushlist(replace)
end
setdisc(current)
if pre then
@@ -164,218 +173,226 @@ implement {
arguments = "integer",
actions = function(n)
-- we just hyphenate (as we pass a hpack) .. a bit too much casting but ...
- local l = languages.hyphenators.handler(tonode(checkedlist(n)))
+ local l = languages.hyphenators.handler(checkedlist(n))
report_hyphenation("show: %s",listtoutf(l,false,true))
end
}
-local function applytochars(current,doaction,noaction,nested)
- while current do
- local id = getid(current)
- if nested and (id == hlist_code or id == vlist_code) then
- context.beginhbox()
- applytochars(getlist(current),doaction,noaction,nested)
- context.endhbox()
- elseif id ~= glyph_code then
- noaction(tonode(copy_node(current)))
- else
- doaction(tonode(copy_node(current)))
+do
+
+ local function applytochars(current,doaction,noaction,nested)
+ while current do
+ local id = getid(current)
+ if nested and (id == hlist_code or id == vlist_code) then
+ context.beginhbox()
+ applytochars(getlist(current),doaction,noaction,nested)
+ context.endhbox()
+ elseif id ~= glyph_code then
+ noaction(tonode(copy_node(current)))
+ else
+ doaction(tonode(copy_node(current)))
+ end
+ current = getnext(current)
end
- current = getnext(current)
end
-end
-local function applytowords(current,doaction,noaction,nested)
- local start
- while current do
- local id = getid(current)
- if id == glue_code then
- if start then
- doaction(tonode(copy_list(start,current)))
- start = nil
+ local function applytowords(current,doaction,noaction,nested)
+ local start
+ while current do
+ local id = getid(current)
+ if id == glue_code then
+ if start then
+ doaction(tonode(copylist(start,current)))
+ start = nil
+ end
+ noaction(tonode(copy_node(current)))
+ elseif nested and (id == hlist_code or id == vlist_code) then
+ context.beginhbox()
+ applytowords(getlist(current),doaction,noaction,nested)
+ context.egroup()
+ elseif not start then
+ start = current
end
- noaction(tonode(copy_node(current)))
- elseif nested and (id == hlist_code or id == vlist_code) then
- context.beginhbox()
- applytowords(getlist(current),doaction,noaction,nested)
- context.egroup()
- elseif not start then
- start = current
+ current = getnext(current)
+ end
+ if start then
+ doaction(tonode(copylist(start)))
end
- current = getnext(current)
- end
- if start then
- doaction(tonode(copy_list(start)))
end
-end
-local methods = {
- char = applytochars,
- characters = applytochars,
- word = applytowords,
- words = applytowords,
-}
+ local methods = {
+ char = applytochars,
+ characters = applytochars,
+ word = applytowords,
+ words = applytowords,
+ }
-implement {
- name = "applytobox",
- arguments = {
- {
- { "box", "integer" },
- { "command" },
- { "method" },
- { "nested", "boolean" },
- }
- },
- actions = function(specification)
- local list = checkedlist(specification.box)
- local action = methods[specification.method or "char"]
- if list and action then
- action(list,context[specification.command or "ruledhbox"],context,specification.nested)
- end
- end
-}
+ implement {
+ name = "applytobox",
+ arguments = {
+ {
+ { "box", "integer" },
+ { "command" },
+ { "method" },
+ { "nested", "boolean" },
+ }
+ },
+ actions = function(specification)
+ local list = checkedlist(specification.box)
+ local action = methods[specification.method or "char"]
+ if list and action then
+ action(list,context[specification.command or "ruledhbox"],context,specification.nested)
+ end
+ end
+ }
-local split_char = lpeg.Ct(lpeg.C(1)^0)
-local split_word = lpeg.tsplitat(lpeg.patterns.space)
-local split_line = lpeg.tsplitat(lpeg.patterns.eol)
-
-local function processsplit(specification)
- local str = specification.data or ""
- local command = specification.command or "ruledhbox"
- local method = specification.method or "word"
- local spaced = specification.spaced
- if command then
- command = context[command]
- end
- if method == "char" or method == "character" then
- if spaced then
- spaced = context.space
+ local split_char = lpeg.Ct(lpeg.C(1)^0)
+ local split_word = lpeg.tsplitat(lpeg.patterns.space)
+ local split_line = lpeg.tsplitat(lpeg.patterns.eol)
+
+ local function processsplit(specification)
+ local str = specification.data or ""
+ local command = specification.command or "ruledhbox"
+ local method = specification.method or "word"
+ local spaced = specification.spaced
+ if command then
+ command = context[command]
end
- local words = lpegmatch(split_char,str)
- for i=1,#words do
- local word = words[i]
- if word == " " then
- if spaced then
- spaced()
+ if method == "char" or method == "character" then
+ if spaced then
+ spaced = context.space
+ end
+ local words = lpegmatch(split_char,str)
+ for i=1,#words do
+ local word = words[i]
+ if word == " " then
+ if spaced then
+ spaced()
+ end
+ elseif command then
+ command(word)
+ else
+ context(word)
end
- elseif command then
- command(word)
- else
- context(word)
end
- end
- elseif method == "word" then
- if spaced then
- spaced = context.space
- end
- local words = lpegmatch(split_word,str)
- for i=1,#words do
- local word = words[i]
- if spaced and i > 1 then
- spaced()
+ elseif method == "word" then
+ if spaced then
+ spaced = context.space
end
- if command then
- command(word)
- else
- context(word)
+ local words = lpegmatch(split_word,str)
+ for i=1,#words do
+ local word = words[i]
+ if spaced and i > 1 then
+ spaced()
+ end
+ if command then
+ command(word)
+ else
+ context(word)
+ end
end
- end
- elseif method == "line" then
- if spaced then
- spaced = context.par
- end
- local words = lpegmatch(split_line,str)
- for i=1,#words do
- local word = words[i]
- if spaced and i > 1 then
- spaced()
+ elseif method == "line" then
+ if spaced then
+ spaced = context.par
end
- if command then
- command(word)
- else
- context(word)
+ local words = lpegmatch(split_line,str)
+ for i=1,#words do
+ local word = words[i]
+ if spaced and i > 1 then
+ spaced()
+ end
+ if command then
+ command(word)
+ else
+ context(word)
+ end
end
+ else
+ context(str)
end
- else
- context(str)
end
-end
-implement {
- name = "processsplit",
- actions = processsplit,
- arguments = {
- {
- { "data" },
- { "command" },
- { "method" },
- { "spaced", "boolean" },
+ implement {
+ name = "processsplit",
+ actions = processsplit,
+ arguments = {
+ {
+ { "data" },
+ { "command" },
+ { "method" },
+ { "spaced", "boolean" },
+ }
}
}
-}
-local a_vboxtohboxseparator = attributes.private("vboxtohboxseparator")
+end
-implement {
- name = "vboxlisttohbox",
- arguments = { "integer", "integer", "dimen" },
- actions = function(original,target,inbetween)
- local current = getlist(getbox(original))
- local head = nil
- local tail = nil
- while current do
- local id = getid(current)
- local next = getnext(current)
- if id == hlist_code then
- local list = getlist(current)
- if head then
- if inbetween > 0 then
- local n = new_glue(0,0,inbetween)
- setlink(tail,n)
- tail = n
- end
- setlink(tail,list)
- else
- head = list
- end
- tail = find_tail(list)
- -- remove last separator
- if getid(tail) == hlist_code and getattribute(tail,a_vboxtohboxseparator) == 1 then
- local temp = tail
- local prev = getprev(tail)
- if next then
- local list = getlist(tail)
- setlink(prev,list)
- setlist(tail)
- tail = find_tail(list)
+do
+
+ local a_vboxtohboxseparator = attributes.private("vboxtohboxseparator")
+
+ implement {
+ name = "vboxlisttohbox",
+ arguments = { "integer", "integer", "dimen" },
+ actions = function(original,target,inbetween)
+ local current = getlist(getbox(original))
+ local head = nil
+ local tail = nil
+ while current do
+ local id = getid(current)
+ local next = getnext(current)
+ if id == hlist_code then
+ local list = getlist(current)
+ if head then
+ if inbetween > 0 then
+ local n = new_glue(0,0,inbetween)
+ setlink(tail,n)
+ tail = n
+ end
+ setlink(tail,list)
else
- tail = prev
+ head = list
+ end
+ tail = find_tail(list)
+ -- remove last separator
+ if getid(tail) == hlist_code and getattribute(tail,a_vboxtohboxseparator) == 1 then
+ local temp = tail
+ local prev = getprev(tail)
+ if next then
+ local list = getlist(tail)
+ setlink(prev,list)
+ setlist(tail)
+ tail = find_tail(list)
+ else
+ tail = prev
+ end
+ flushnode(temp)
end
- flush_node(temp)
+ -- done
+ setnext(tail)
+ setlist(current)
end
- -- done
- setnext(tail)
- setlist(current)
+ current = next
end
- current = next
+ local result = new_hlist()
+ setlist(result,head)
+ setbox(target,result)
+ -- setbox(target,new_hlist(head))
end
- local result = new_hlist()
- setlist(result,head)
- setbox(target,result)
- -- setbox(target,new_hlist(head))
- end
-}
+ }
-implement {
- name = "hboxtovbox",
- arguments = "integer",
- actions = function(n)
- local b = getbox(n)
- local factor = texget("baselineskip",false) / texget("hsize")
- setdepth(b,0)
- setheight(b,getwidth(b) * factor)
- end
-}
+ implement {
+ name = "hboxtovbox",
+ arguments = "integer",
+ actions = function(n)
+ local b = getbox(n)
+ local factor = texget("baselineskip",false) / texget("hsize")
+ setdepth(b,0)
+ setheight(b,getwidth(b) * factor)
+ end
+ }
+
+end
implement {
name = "boxtostring",
@@ -386,39 +403,14 @@ implement {
end
}
-local function getnaturaldimensions(n)
- local w = 0
- local h = 0
- local d = 0
- local l = getlist(getbox(n))
- if l then
- w, h, d = getdimensions(l)
- end
- texsetdimen("lastnaturalboxwd",w)
- texsetdimen("lastnaturalboxht",h)
- texsetdimen("lastnaturalboxdp",d)
- return w, h, d
-end
+do
-implement {
- name = "getnaturaldimensions",
- arguments = "integer",
- actions = getnaturaldimensions
-}
+ -- we can now move this to the tex end
-implement {
- name = "naturalwd",
- arguments = "integer",
- actions = function(n)
- getnaturaldimensions(n)
- context.lastnaturalboxwd(false)
- end
-}
+ local values = tokens.values
+ local dimension_value = values.dimension
-implement {
- name = "getnaturalwd",
- arguments = "integer",
- actions = function(n)
+ local function getnaturaldimensions(n)
local w = 0
local h = 0
local d = 0
@@ -426,25 +418,64 @@ implement {
if l then
w, h, d = getdimensions(l)
end
- context("\\dimexpr%i\\scaledpoint\\relax",w)
+ texsetdimen(d_lastnaturalboxwd,w)
+ texsetdimen(d_lastnaturalboxht,h)
+ texsetdimen(d_lastnaturalboxdp,d)
+ return w, h, d
end
-}
-local function setboxtonaturalwd(n)
- local old = takebox(n)
- local new = hpack(getlist(old))
- setlist(old,nil)
- flush_node(old)
- setbox(n,new)
-end
+ local function setboxtonaturalwd(n)
+ local old = takebox(n)
+ local new = hpack(getlist(old))
+ setlist(old,nil)
+ flushnode(old)
+ setbox(n,new)
+ end
-implement {
- name = "setnaturalwd",
- arguments = "integer",
- actions = setboxtonaturalwd
-}
+ implement {
+ name = "getnaturaldimensions",
+ arguments = "integer",
+ public = true,
+ protected = true,
+ untraced = true,
+ actions = getnaturaldimensions
+ }
+
+ implement {
+ name = "naturalwd",
+ arguments = "integer",
+ usage = "value",
+ public = true,
+ protected = true,
+ actions = function(n)
+ return dimension_value, (getnaturaldimensions(n))
+ end
+ }
+
+ implement {
+ name = "getnaturalwd",
+ arguments = "integer",
+ usage = "value",
+ public = true,
+ protected = true,
+ actions = function(n)
+ local l = getlist(getbox(n))
+ return dimension_value, l and getdimensions(l) or 0
+ end
+ }
-nodes.setboxtonaturalwd = setboxtonaturalwd
+ implement {
+ name = "setnaturalwd",
+ arguments = "integer",
+ public = true,
+ protected = true,
+ untraced = true,
+ actions = setboxtonaturalwd
+ }
+
+ nodes.setboxtonaturalwd = setboxtonaturalwd
+
+end
local doifelse = commands.doifelse
@@ -488,14 +519,15 @@ do
local tonut = nodes.tonut
local takebox = nuts.takebox
- local flush_list = nuts.flush_list
- local copy_list = nuts.copy_list
+ local flushlist = nuts.flushlist
+ local copylist = nuts.copylist
local getwhd = nuts.getwhd
local setbox = nuts.setbox
local new_hlist = nuts.pool.hlist
local values = tokens.values
local dimension_value = values.dimension
+ local cardinal_value = values.cardinal
local boxes = { }
nodes.boxes = boxes
@@ -511,6 +543,9 @@ do
if trace then
report("category %a, name %a, %s (%s)",category,name,"save",b and "content" or "empty")
end
+ if name == "+" then
+ name = #cache[category] + 1
+ end
cache[category][name] = b or false
end
@@ -527,14 +562,23 @@ do
return cache[category][name] and true or false
end
+ function boxes.count(category)
+ return #cache[category]
+ end
+
function boxes.direct(category,name,copy)
name = tonumber(name) or name
local c = cache[category]
local b = c[name]
+-- if name == "+" then
+-- b = remove(c, 1)
+-- else
+-- b = c[name]
+-- end
if not b then
-- do nothing, maybe trace
elseif copy then
- b = copy_list(b)
+ b = copylist(b)
else
c[name] = false
end
@@ -551,13 +595,13 @@ do
local c = cache[category]
local b = takebox(box)
if b then
- flush_list(b)
+ flushlist(b)
end
local b = c[name]
if not b then
-- do nothing, maybe trace
elseif copy then
- b = copy_list(b)
+ b = copylist(b)
else
c[name] = false
end
@@ -567,6 +611,20 @@ do
setbox(box,b or nil)
end
+ function boxes.prune(category)
+ -- this one assumes an indexed list
+ local c = cache[category]
+ local t = { }
+ local n = 0
+ for i=1,#c do
+ local ci = c[i]
+ if ci then
+ n = n + 1 ; t[n] = ci
+ end
+ end
+ cache[category] = t
+ end
+
local function dimensions(category,name)
name = tonumber(name) or name
local b = cache[category][name]
@@ -585,7 +643,7 @@ do
if name and name ~= "" then
local b = c[name]
if b then
- flush_list(b)
+ flushlist(b)
c[name] = false
end
if trace then
@@ -594,7 +652,7 @@ do
else
for k, b in next, c do
if b then
- flush_list(b)
+ flushlist(b)
end
end
cache[category] = { }
@@ -604,6 +662,11 @@ do
end
end
+ function boxes.dispose(category)
+ boxes.reset(category)
+ cache[category] = nil -- or false (for tracing)
+ end
+
implement {
name = "putboxincache",
public = true,
@@ -662,9 +725,36 @@ do
actions = boxes.reset,
}
+ implement {
+ name = "pruneboxesincache",
+ public = true,
+ protected = true,
+ arguments = "string",
+ actions = boxes.prune,
+ }
+
+ implement {
+ name = "disposeboxesincache",
+ public = true,
+ protected = true,
+ arguments = "string",
+ actions = boxes.dispose,
+ }
+
-- we can share this ...
implement {
+ name = "getboxcountfromcache",
+ public = true,
+ protected = true,
+ usage = "value",
+ arguments = "string",
+ actions = function(category)
+ return cardinal_value, #cache[category]
+ end,
+ }
+
+ implement {
name = "getboxwdfromcache",
public = true,
protected = true,
@@ -701,6 +791,18 @@ do
}
implement {
+ name = "getboxhtdpfromcache",
+ arguments = "2 strings",
+ public = true,
+ protected = true,
+ usage = "value",
+ actions = function(category,name)
+ local w, h, d = dimensions(category,name)
+ return dimension_value, h + d
+ end,
+ }
+
+ implement {
name = "putnextboxincache",
public = true,
protected = true,
@@ -720,9 +822,9 @@ end
implement {
name = "lastlinewidth",
actions = function()
- local head = tex.lists.page_head
+ local head = tex.lists.pagehead
-- list dimensions returns 3 value but we take the first
- context(head and getdimensions(getlist(find_tail(tonut(tex.lists.page_head)))) or 0)
+ context(head and getdimensions(getlist(find_tail(tonut(tex.lists.pagehead)))) or 0)
end
}
@@ -752,9 +854,9 @@ implement {
},
},
actions = function(t)
- texsetdimen("givenwidth", t.width or 0)
- texsetdimen("givenheight",t.height or 0)
- texsetdimen("givendepth", t.depth or 0)
+ texsetdimen(d_givenwidth, t.width or 0)
+ texsetdimen(d_givenheight,t.height or 0)
+ texsetdimen(d_givendepth, t.depth or 0)
end,
}
@@ -772,7 +874,7 @@ local function stripglue(list)
if first and first ~= list then
-- we have discardables
setsplit(getprev(first),first)
- flush_list(list)
+ flushlist(list)
list = first
done = true
end
@@ -789,7 +891,7 @@ local function stripglue(list)
end
if last ~= tail then
-- we have discardables
- flush_list(getnext(last))
+ flushlist(getnext(last))
setnext(last)
done = true
end
@@ -843,7 +945,7 @@ local function limitate(t) -- don't pack the result !
else
maxleft = maxleft - swidth
end
- for n in traverse_id(glue_code,list) do
+ for n in traverseid(glue_code,list) do
local width = getdimensions(list,n)
if width > maxleft then
if not last then
@@ -855,7 +957,7 @@ local function limitate(t) -- don't pack the result !
end
end
if last and maxright > 0 then
- for n in traverse_id(glue_code,last) do
+ for n in traverseid(glue_code,last) do
local width = getdimensions(n)
if width < maxright then
first = n
@@ -884,7 +986,7 @@ local function limitate(t) -- don't pack the result !
end
setlink(last,sentinel)
setprev(rest)
- flush_list(rest)
+ flushlist(rest)
end
end
end
@@ -893,11 +995,11 @@ local function limitate(t) -- don't pack the result !
if t.freeze then
local l = hpack(list,total,"exactly")
- for n in traverse_id(glue_code,list) do
- setglue(n,(effective_glue(n,l)))
+ for n in traverseid(glue_code,list) do
+ setglue(n,(effectiveglue(n,l)))
end
setlist(l)
- flush_node(l)
+ flushnode(l)
end
return tonode(list)
@@ -1178,7 +1280,7 @@ do
else
setlink(p,temp,n)
end
- flush_node(found)
+ flushnode(found)
getprop(box,"boxlines")[line] = temp
end
end
@@ -1206,6 +1308,8 @@ do
["rh"] = function(p,l,found) return dimension_value, p.righthangskip end,
["lp"] = function(p,l,found) return dimension_value, p.parfillleftskip end,
["rp"] = function(p,l,found) return dimension_value, p.parfillrightskip end,
+ ["il"] = function(p,l,found) return dimension_value, p.parinitleftskip end,
+ ["ir"] = function(p,l,found) return dimension_value, p.parinitrightskip end,
["in"] = function(p,l,found) return dimension_value, p.indent end,
["nw"] = function(p,l,found) return dimension_value, naturaldimensions(p,l,found).naturalwidth end,
@@ -1303,6 +1407,8 @@ do
define_one("boxlinerh", "rh")
define_one("boxlinelp", "lp")
define_one("boxlinerp", "rp")
+ define_one("boxlineil", "il")
+ define_one("boxlineir", "ir")
define_one("boxlinein", "in")
define_one("boxlinenw", "nw")
define_one("boxlinenh", "nh")
@@ -1319,7 +1425,7 @@ do
local getbox = tex.getbox
local setfield = nodes.setfield
local getfield = nodes.getfield
- local flush = nodes.flush
+ local flush = nodes.flushnode
local copynode = nodes.copy
local function get(n,field,copy)
@@ -1393,3 +1499,45 @@ do
}
end
+
+do
+
+ local function setsplitlisthtdp(n,ht,dp)
+ local box = getbox(n)
+ if box then
+ local head = getlist(box)
+ if head then
+ local tail = findtail(head)
+ local id = getid(head)
+ if id == glue_code and getsubtype(head) == topskip_code then
+ head = getnext(head)
+ id = head and getid(head)
+ ht = ht - getwidth(head)
+ end
+ if id == hlist_code and getsubtype(head) == line_code and getheight(head) < ht then
+-- print("set height",ht)
+ setheight(head,ht)
+ end
+ local id = getid(tail)
+ if id == glue_code then
+ tail = getprev(tail)
+ id = tail and getid(tail)
+ dp = dp - getwidth(tail)
+ end
+ if id == hlist_code and getsubtype(tail) == line_code and getdepth(tail) < dp then
+ setdepth(dept,dp)
+-- print("set depth",dp)
+ end
+ end
+ end
+ end
+
+ implement {
+ name = "setsplitlisthtdp",
+ public = true,
+ protected = true,
+ arguments = { "integer", "dimen", "dimen" },
+ actions = setsplitlisthtdp,
+ }
+end
+
diff --git a/Master/texmf-dist/tex/context/base/mkxl/supp-box.mkxl b/Master/texmf-dist/tex/context/base/mkxl/supp-box.mkxl
index e52ea90b81c..710a4892ed1 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/supp-box.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/supp-box.mkxl
@@ -15,13 +15,26 @@
\unprotect
-\registerctxluafile{supp-box}{autosuffix,optimize}
+\permanent\integerdef\negatelistsigncode\numexpr
+ \negatexlistsigncode
+ +\negateylistsigncode
+\relax
%D And some dimensions:
-\newdimen\givenwidth
-\newdimen\givenheight
-\newdimen\givendepth
+\newdimension\strutht % see above
+\newdimension\strutdp
+\newdimension\struthtdp
+
+\newdimension\givenwidth
+\newdimension\givenheight
+\newdimension\givendepth
+
+\newdimension\lastnaturalboxwd % maybe alias !
+\newdimension\lastnaturalboxht
+\newdimension\lastnaturalboxdp
+
+\registerctxluafile{supp-box}{autosuffix}
% \fixupboxesmode\plusone % gone: is now the default
@@ -35,11 +48,14 @@
%D not, you're in trouble). These shortcuts can be used like a dimension, opposite
%D to the core macros \type {\strutdepth} and alike, which are values.
- \def\strutdp {\dp\strutbox} % overloaded in spac-ver
- \def\strutht {\ht\strutbox} % overloaded in spac-ver
-\permanent\protected\def\strutwd {\wd\strutbox}
-\permanent\protected\def\struthtdp{\dimexpr\strutht+\strutdp\relax}
-\permanent\protected\def\strutgap {\dimexpr\strutht-\strutdp\relax}
+\iffalse
+ \def\strutdp {\dp\strutbox} % overloaded in spac-ver
+ \def\strutht {\ht\strutbox} % overloaded in spac-ver
+ \def\struthtdp{\htdp\strutbox} % overloaded in spac-ver
+\fi
+
+\permanent\protected\def\strutwd {\wd\strutbox}
+\permanent\protected\def\strutgap{\dimexpr\strutht-\strutdp\relax}
%D \macros
%D {voidbox,nextbox}
@@ -57,7 +73,7 @@
%D \DIMENSION\ \type{\prevdepth} and append it later on. The name \type {\nextdepth}
%D suits this purpose well.
-\newdimen\nextdepth
+\newdimension\nextdepth
%D \macros
%D {smashbox, smashboxed, smashedbox}
@@ -91,7 +107,7 @@
%D The next implementation is less sensitive for spurious spaces.
-\newcount\c_boxes_register
+\newinteger\c_boxes_register
\permanent\protected\def\smashbox
{\afterassignment\syst_boxes_smash_boxes_register\c_boxes_register}
@@ -169,14 +185,29 @@
\permanent\protected\def\smashedhbox{\hpack\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox\hbox}
\permanent\protected\def\smashedvbox{\vpack\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox\vbox}
-%D First we define a helper. We use a \LUATEX\ feature in order to avoid
-%D mathpalettes.
+%D \starttyping
+%D \startTEXpage[offset=1dk,width=4em]
+%D \dontleavehmode \hbox {0} 0\par
+%D \dontleavehmode \vphantom{0} 0\par
+%D \dontleavehmode \hphantom{0} 0\par
+%D $\textstyle \vphantom{0}$ $\textstyle 0$\par
+%D $\scriptstyle \vphantom{0}$ $\scriptstyle 0$\par
+%D $\scriptscriptstyle\vphantom{0}$ $\scriptscriptstyle 0$\par
+%D \stopTEXpage
+%D \stoptyping
-\newcount\c_boxes_math_style
+% \newinteger\c_boxes_math_style
+%
+% \protected\def\syst_boxes_math_set_nextbox#1%
+% {\c_boxes_math_style\normalmathstyle
+% \setbox\nextbox\hbox{\normalstartimath\mathsurround\zeropoint\triggermathstyle\c_boxes_math_style{#1}\normalstopimath}}
\protected\def\syst_boxes_math_set_nextbox#1%
- {\c_boxes_math_style\normalmathstyle
- \setbox\nextbox\hbox{\normalstartimath\mathsurround\zeropoint\triggermathstyle\c_boxes_math_style{#1}\normalstopimath}}
+ {\setbox\nextbox\hbox\expandafter\bgroup
+ \expandafter\normalstartimath\expandafter\Ustyle\the\mathstackstyle
+ \mathsurround\zeropoint{#1}%
+ \normalstopimath
+ \egroup}
%D \macros
%D {smash}
@@ -224,11 +255,13 @@
\installcorenamespace {smashoptions}
-\setvalue{\??smashoptions w}{\wd\nextbox\zeropoint}
-\setvalue{\??smashoptions h}{\ht\nextbox\zeropoint}
-\setvalue{\??smashoptions d}{\dp\nextbox\zeropoint}
-\setvalue{\??smashoptions t}{\ht\nextbox\zeropoint}
-\setvalue{\??smashoptions b}{\dp\nextbox\zeropoint}
+\defcsname\??smashoptions w\endcsname{\wd\nextbox\zeropoint}
+\defcsname\??smashoptions h\endcsname{\ht\nextbox\zeropoint}
+\defcsname\??smashoptions d\endcsname{\dp\nextbox\zeropoint}
+\defcsname\??smashoptions t\endcsname{\ht\nextbox\zeropoint}
+\defcsname\??smashoptions b\endcsname{\dp\nextbox\zeropoint}
+\defcsname\??smashoptions hd\endcsname{\ht\nextbox\zeropoint\dp\nextbox\zeropoint}
+\defcsname\??smashoptions whd\endcsname{\wd\nextbox\zeropoint\ht\nextbox\zeropoint\dp\nextbox\zeropoint}
\def\syst_boxes_smash_process_option#1%
{\ifx#1\relax\else
@@ -323,7 +356,7 @@
%D We also define plain's \type {\mathstrut}.
-\permanent\protected\def\mathstrut{\vphantom(} % can be made faster by inlining
+\permanent\protected\def\mathstrut{\Ustack{\vphantom(}} % can be made faster by inlining
%D \macros
%D {getboxheight}
@@ -351,7 +384,7 @@
%D
%D \starttyping
%D \def\getboxheight#1\of#2\box#3%
-%D {#1\ht#3\advance#1\dp#3\relax}
+%D {#1\ht#3\advanceby#1\dp#3\relax}
%D \stoptyping
%D
%D The next alternative is slightly more clever, since it accepts \type {{12}} as
@@ -378,25 +411,25 @@
%D met 0~regels. The raw alternative does not round. See the \MKII\ and \MKIV\ files
%D for historic variants.
-\ifdefined\roundingeps \else \newdimen\roundingeps \roundingeps=10sp \fi
+\ifdefined\roundingeps \else \newdimension\roundingeps \roundingeps=10sp \fi
-\newcount\noflines
-\newdimen\noflinesheight
+\newinteger \noflines
+\newdimension\noflinesheight
\permanent\protected\def\getnoflines#1%
{\noflinesheight#1\relax
\ifzeropt\noflinesheight
\noflines\zerocount
\orelse\ifdim\noflinesheight>\zeropoint
- \advance\noflinesheight-\roundingeps
- \divide\noflinesheight\openlineheight
+ \advanceby\noflinesheight-\roundingeps
+ \divideby\noflinesheight\openlineheight
\noflines\noflinesheight
- \advance\noflines\plusone
+ \advanceby\noflines\plusone
\else
- \advance\noflinesheight\roundingeps
- \divide\noflinesheight\openlineheight
+ \advanceby\noflinesheight\roundingeps
+ \divideby\noflinesheight\openlineheight
\noflines\noflinesheight
- \advance\noflines\minusone
+ \advanceby\noflines\minusone
\fi}
\permanent\protected\def\getroundednoflines#1%
@@ -404,12 +437,12 @@
\ifzeropt\noflinesheight
\noflines\zerocount
\orelse\ifdim\noflinesheight>\zeropoint
- \advance\noflinesheight\roundingeps
- \divide\noflinesheight\openlineheight
+ \advanceby\noflinesheight\roundingeps
+ \divideby\noflinesheight\openlineheight
\noflines\noflinesheight
\else
- \advance\noflinesheight-\roundingeps
- \divide\noflinesheight\openlineheight
+ \advanceby\noflinesheight-\roundingeps
+ \divideby\noflinesheight\openlineheight
\noflines\noflinesheight
\fi}
@@ -418,14 +451,14 @@
\ifzeropt\noflinesheight
\noflines\zerocount
\orelse\ifdim\noflinesheight>\zeropoint
- \advance\noflinesheight\roundingeps
- \advance\noflinesheight.5\openlineheight
- \divide\noflinesheight\openlineheight
+ \advanceby\noflinesheight\roundingeps
+ \advanceby\noflinesheight.5\openlineheight
+ \divideby\noflinesheight\openlineheight
\noflines\noflinesheight
\else
- \advance\noflinesheight-\roundingeps
- \advance\noflinesheight-.5\openlineheight
- \divide\noflinesheight\openlineheight
+ \advanceby\noflinesheight-\roundingeps
+ \advanceby\noflinesheight-.5\openlineheight
+ \divideby\noflinesheight\openlineheight
\noflines\noflinesheight
\fi}
@@ -471,7 +504,7 @@
% \unvbox\nextbox
% \endofshapebox
% \globalscratchcounter\zerocount
-% \reshapebox{\global\advance\globalscratchcounter\plusone}%
+% \reshapebox{\global\advanceby\globalscratchcounter\plusone}%
% \expandafter\egroup\expandafter\noflines\the\globalscratchcounter\relax}
\def\syst_boxes_determine_noflines
@@ -484,6 +517,9 @@
\enforced\let\\\endgraf
\dowithnextboxcs\syst_boxes_determine_noflines\vbox}
+\def\determinednoflines#1%
+ {\localcontrolled{\determinenoflines{#1}}\noflines}
+
%D \macros
%D {doiftextelse, doiftext}
%D
@@ -665,20 +701,32 @@
\def\syst_boxes_do_tlap{\vpack to \zeropoint{\vss\box\nextbox}\endgroup}
\def\syst_boxes_do_blap{\vpack to \zeropoint{\box\nextbox\vss}\endgroup}
-\def\syst_boxes_rlap {\begingroup\dowithnextboxcs\syst_boxes_do_rlap\hbox}
-\def\syst_boxes_llap {\begingroup\dowithnextboxcs\syst_boxes_do_llap\hbox}
-\def\syst_boxes_clap {\begingroup\dowithnextboxcs\syst_boxes_do_clap\hbox}
-\def\syst_boxes_math_clap{\mathpalette\syst_boxes_do_math_clap}
-\def\syst_boxes_math_llap{\mathpalette\syst_boxes_do_math_llap}
-\def\syst_boxes_math_rlap{\mathpalette\syst_boxes_do_math_rlap}
+\protected\def\syst_boxes_rlap{\begingroup\dowithnextboxcs\syst_boxes_do_rlap\hbox}
+\protected\def\syst_boxes_llap{\begingroup\dowithnextboxcs\syst_boxes_do_llap\hbox}
+\protected\def\syst_boxes_clap{\begingroup\dowithnextboxcs\syst_boxes_do_clap\hbox}
-\def\syst_boxes_do_math_clap#1#2{\syst_boxes_clap{\normalstartimath\mathsurround\zeropoint#1#2\normalstopimath}}
-\def\syst_boxes_do_math_llap#1#2{\syst_boxes_llap{\normalstartimath\mathsurround\zeropoint#1#2\normalstopimath}}
-\def\syst_boxes_do_math_rlap#1#2{\syst_boxes_rlap{\normalstartimath\mathsurround\zeropoint#1#2\normalstopimath}}
+% \def\syst_boxes_do_math_clap#1#2{\syst_boxes_clap{\normalstartimath\mathsurround\zeropoint#1#2\normalstopimath}}
+% \def\syst_boxes_do_math_llap#1#2{\syst_boxes_llap{\normalstartimath\mathsurround\zeropoint#1#2\normalstopimath}}
+% \def\syst_boxes_do_math_rlap#1#2{\syst_boxes_rlap{\normalstartimath\mathsurround\zeropoint#1#2\normalstopimath}}
+%
+% \def\syst_boxes_math_clap{\mathpalette\syst_boxes_do_math_clap}
+% \def\syst_boxes_math_llap{\mathpalette\syst_boxes_do_math_llap}
+% \def\syst_boxes_math_rlap{\mathpalette\syst_boxes_do_math_rlap}
+
+\def\syst_boxes_math_xlap#1#2%
+ {\normalexpanded{#1\bgroup\normalstartimath\Ustyle\the\mathstyle}%
+ %{\expandafter#1\expandafter\bgroup\expandafter\normalstartimath\expandafter\Ustyle\the\mathstyle
+ \mathsurround\zeropoint#2%
+ \normalstopimath\egroup}
+
+\def\syst_boxes_math_clap{\syst_boxes_math_xlap\syst_boxes_clap}
+\def\syst_boxes_math_llap{\syst_boxes_math_xlap\syst_boxes_llap}
+\def\syst_boxes_math_rlap{\syst_boxes_math_xlap\syst_boxes_rlap}
\permanent\protected\def\rlap{\mathortext\syst_boxes_math_rlap\syst_boxes_rlap}
\permanent\protected\def\llap{\mathortext\syst_boxes_math_llap\syst_boxes_llap}
\permanent\protected\def\clap{\mathortext\syst_boxes_math_clap\syst_boxes_clap}
+
\permanent\protected\def\tlap{\begingroup\dowithnextboxcs\syst_boxes_do_tlap\vbox}
\permanent\protected\def\blap{\begingroup\dowithnextboxcs\syst_boxes_do_blap\vbox}
@@ -805,18 +853,15 @@
\newif \ifreshapingbox
\newif \ifreshapingfailed % may save redundant runs
-\newbox \shapebox
-\newcount \shapepenalty
-\newdimen \shapekern
-\newskip \shapeskip
-
-\newbox \newshapebox
-\newbox \oldshapebox
-\newbox \tmpshapebox
-
-\newcount \shapecounter
-
-\newevery \everyshapebox \relax
+\newbox \shapebox
+\newinteger \shapepenalty
+\newdimension\shapekern
+\newgluespec \shapeskip
+\newbox \newshapebox
+\newbox \oldshapebox
+\newbox \tmpshapebox
+\newinteger \shapecounter
+\newevery \everyshapebox \relax
\permanent\dimensiondef\shapesignal.12345678pt % or 12345sp
@@ -880,7 +925,7 @@
\restoreshapebox
\exitloop
\else
- \advance\shapecounter \plusone
+ \advanceby\shapecounter \plusone
\fi}
\permanent\protected\def\beginofshapebox
@@ -905,7 +950,7 @@
% \par before the next \vskip gives far worse results
\ifdim\parskip>\zeropoint\vskip\parskip\else\par\fi
% and take a look
- \ifdim\prevdepth=-\thousandpoint
+ \ifdim\prevdepth=-\thousandpoint % or <=
\prevdepth\zeropoint
\fi
\ifdim\prevdepth<\zeropoint\relax
@@ -1044,7 +1089,7 @@
%D This can be done in a more modern way but for nostalgic reasons we keep it.
-\mutable\let\nextprocessedtoken\empty
+\mutable\lettonothing\nextprocessedtoken
\mutable\let\before \relax % for now mutable
%mutable\let\between\relax % is a math character
@@ -1109,7 +1154,7 @@
\def\syst_boxes_boundtext#1%
{\setbox\scratchboxone\hbox{#1}%
- \advance\scratchdimen -\wd\scratchboxone
+ \advanceby\scratchdimen -\wd\scratchboxone
\ifdim\scratchdimen>\zeropoint\relax#1\fi}
\permanent\protected\def\doboundtext#1#2#3% still used?
@@ -1118,7 +1163,7 @@
\scratchdimen#2\relax
\ifdim\wd\scratchbox>\scratchdimen
\setbox\scratchbox\hbox{#3}%
- \advance\scratchdimen -\wd\scratchbox
+ \advanceby\scratchdimen -\wd\scratchbox
\handletokens#1\with\syst_boxes_boundtext
\fi
\box\scratchbox}}
@@ -1143,8 +1188,8 @@
%D See \MKIV\ file for the older implementation.
-\let\m_syst_boxes_left \empty
-\let\m_syst_boxes_right\empty
+\lettonothing\m_syst_boxes_left
+\lettonothing\m_syst_boxes_right
\permanent\protected\def\limitatetext#1#2#3%
{% we could also split in \LUA
@@ -1173,7 +1218,7 @@
\ifdim\wd\scratchbox>#2\relax
\setbox\scratchbox\hbox{#3}%
\hsize#2\relax
- \advance\hsize-\wd\scratchbox
+ \advanceby\hsize-\wd\scratchbox
\setbox\scratchbox\vbox{\forgetall\veryraggedright#1}%
\setbox\scratchbox\vsplit\scratchbox to \lineheight
\vbox
@@ -1441,8 +1486,8 @@
\dontcomplain
\forgetall
\scangivendimensions#1\relax
- \advance\vsize\givenheight
- \advance\hsize\givenwidth
+ \advanceby\vsize\givenheight
+ \advanceby\hsize\givenwidth
\dowithnextboxcs\syst_boxes_centered_finish
\hbox}
@@ -1526,19 +1571,19 @@
\mutable\let\rigidcolumnlines\!!zerocount
-\newbox \rigidcolumnbox
-\newdimen\rigidhsize
-\newcount\rigidcolumns
+\newbox \rigidcolumnbox
+\newdimension\rigidhsize
+\newinteger \rigidcolumns
\permanent\protected\def\setrigidcolumnhsize#1#2#3% todo: \dimexpr
{\global\rigidhsize\hsize
\global\rigidcolumns#3\relax
\hsize#1\relax
\scratchdimen -#2\relax
- \multiply\scratchdimen #3\relax
- \advance\scratchdimen #2\relax
- \advance\hsize \scratchdimen
- \divide\hsize #3\relax}
+ \multiplyby\scratchdimen #3\relax
+ \advanceby\scratchdimen #2\relax
+ \advanceby\hsize \scratchdimen
+ \divideby\hsize #3\relax}
% ==
%
@@ -1563,15 +1608,15 @@
% \iffalse
% % maybe some day an option
% \scratchskip\ht\rigidcolumnbox
- % \advance\scratchskip\dp\rigidcolumnbox
+ % \advanceby\scratchskip\dp\rigidcolumnbox
% \getnoflines\scratchskip
% \ifodd\noflines
- % \advance\noflines\plusone
+ % \advanceby\noflines\plusone
% \fi
- % \divide\noflines\rigidcolumns
+ % \divideby\noflines\rigidcolumns
%\else
\scratchdimen\ht\rigidcolumnbox
- \divide\scratchdimen \rigidcolumns
+ \divideby\scratchdimen \rigidcolumns
\getnoflines\scratchdimen
%\fi
\else
@@ -1582,31 +1627,33 @@
% since in practice we also use this macro for
% funny lineheights and border cases
\setbox0=\box\rigidcolumnbox
- \doloop
- {\setbox\rigidcolumnbox=\copy0
- \setbox\scratchbox\hpack to \rigidhsize
- {\dorecurse\rigidcolumns
- {\setbox\scratchbox\vsplit\rigidcolumnbox to \scratchdimen
- \dp\scratchbox\openstrutdepth
- \setbox\scratchbox\vtop
- \ifalignrigidcolumns to
- \ifstretchrigidcolumns\vsize\else\scratchdimen\fi
- \fi
- {\unvbox\scratchbox}%
- \wd\scratchbox\hsize
- \box\scratchbox
- \hfill}%
- \hfillneg}%
- \ifvoid\rigidcolumnbox\exitloop\else\advance\scratchdimen\lineheight\fi}%
- \iftightrigidcolumns
- \setbox\scratchbox\hpack{\raise\dp\scratchbox\box\scratchbox}%
- \else
- \advance\scratchdimen -\openstrutdepth
- \setbox\scratchbox\hpack{\raise\scratchdimen\box\scratchbox}%
- \dp\scratchbox\openstrutdepth
- \ht\scratchbox\scratchdimen
- \fi
- \box\scratchbox}%
+ \ifvoid0\else
+ \doloop
+ {\setbox\rigidcolumnbox=\copy0
+ \setbox\scratchbox\hpack to \rigidhsize
+ {\dorecurse\rigidcolumns
+ {\setbox\scratchbox\vsplit\rigidcolumnbox to \scratchdimen
+ \dp\scratchbox\openstrutdepth
+ \setbox\scratchbox\vtop
+ \ifalignrigidcolumns to
+ \ifstretchrigidcolumns\vsize\else\scratchdimen\fi
+ \fi
+ {\unvbox\scratchbox}%
+ \wd\scratchbox\hsize
+ \box\scratchbox
+ \hfill}%
+ \hfillneg}%
+ \ifvoid\rigidcolumnbox\exitloop\else\advanceby\scratchdimen\lineheight\fi}%
+ \iftightrigidcolumns
+ \setbox\scratchbox\hpack{\raise\dp\scratchbox\box\scratchbox}%
+ \else
+ \advanceby\scratchdimen -\openstrutdepth
+ \setbox\scratchbox\hpack{\raise\scratchdimen\box\scratchbox}%
+ \dp\scratchbox\openstrutdepth
+ \ht\scratchbox\scratchdimen
+ \fi
+ \box\scratchbox
+ \fi}%
\fi}
%D \macros
@@ -1632,8 +1679,8 @@
%D These macros are used in reformatting footnotes, so they do what they're meant
%D for.
-\newdimen\vboxtohboxslack
-\newdimen\hboxestohboxslack
+\newdimension\vboxtohboxslack
+\newdimension\hboxestohboxslack
%D Create line and fake height of paragraph by messign with heights: a nice hack by
%D DEK himself.
@@ -1642,14 +1689,14 @@
% {\bgroup
% \ifdim\baselineskip<16pt \relax
% \scratchdimen\baselineskip
-% \multiply\scratchdimen 1024
+% \multiplyby\scratchdimen 1024
% \else
% \message{cropping \baselineskip to 16pt}%
% \scratchdimen\maxdimen
% \fi
-% \divide\scratchdimen \hsize
-% \multiply\scratchdimen 64
-% \xdef\vboxtohboxfactor{\withoutpt\the\scratchdimen}%
+% \divideby\scratchdimen \hsize
+% \multiplyby\scratchdimen 64
+% \xdef\vboxtohboxfactor{\toscaled\scratchdimen}%
% \egroup}
%
% \protected\def\startvboxtohbox
@@ -1735,10 +1782,10 @@
%D The next macro is used in typesetting inline headings. Let's first look at the
%D macro and then show an example.
-\newbox \unhhedbox
-\newbox \hhbox
-\newdimen \lasthhboxwidth
-\newskip \hhboxindent
+\newbox \unhhedbox
+\newbox \hhbox
+\newdimension\lasthhboxwidth
+\newgluespec \hhboxindent
\permanent\protected\def\unhhbox#1\with#2%
{\bgroup
@@ -1787,7 +1834,7 @@
%D \unhhbox0\with{\ruledhbox{\box\hhbox}}
%D \hskip1em plus 1em minus 1em
%D \hhboxindent=\lasthhboxwidth
-%D \advance\hhboxindent by \lastskip
+%D \advanceby\hhboxindent by \lastskip
%D \unhhbox2\with{\ruledhbox{\box\hhbox}}
%D \stopbuffer
%D
@@ -1938,7 +1985,7 @@
\enforced\aliased\let\stopoverlay\egroup
\processboxes\syst_boxes_overlay_process}
-\aliased\let\stopoverlay\relax
+\permanent\protected\lettonothing\stopoverlay
%D \macros
%D {fakebox}
@@ -2017,7 +2064,7 @@
\permanent\protected\def\bbox{\hpack\bgroup\dowithnextboxcs\syst_boxes_bbox_finish\hbox}
\def\syst_boxes_tbox_finish
- {\scratchheight\ht\strutbox
+ {\scratchheight\strutht
\scratchdepth\dimexpr\htdp\nextbox-\scratchheight\relax
\ht\nextbox\scratchheight
\dp\nextbox\scratchdepth
@@ -2026,7 +2073,7 @@
\egroup}
\def\syst_boxes_bbox_finish
- {\scratchdepth\dp\strutbox
+ {\scratchdepth\strutdp
\scratchheight\dimexpr\htdp\nextbox-\scratchdepth\relax
\dp\nextbox\scratchdepth
\ht\nextbox\scratchheight
@@ -2064,14 +2111,14 @@
%D This example demonstrates that one can use positive and negative values.
%D Dimension registers are also accepted.
-\newdimen\sizeofbox
+\newdimension\sizeofbox
\permanent\protected\def\boxofsize#1%
{\bgroup
\sizeofbox\zeropoint
\scratchdimen\zeropoint
\def\docommand
- {\advance\sizeofbox\scratchdimen
+ {\advanceby\sizeofbox\scratchdimen
\futurelet\nexttoken\dodocommand}%
\def\dodocommand
{\ifx\nexttoken\bgroup
@@ -2093,7 +2140,7 @@
{\scratchdimen#1\hsize
\ifdim\wd\nextbox>\scratchdimen
\setbox\nextbox\hbox
- {\advance\scratchdimen -.1\hsize
+ {\advanceby\scratchdimen -.1\hsize
\limitatetext{\unhbox\nextbox}{\scratchdimen}{\nobreak#2}}%
\fi
\unhbox\nextbox}
@@ -2109,7 +2156,7 @@
\hpack{\box\nextbox}
\prevdepth\strutdp
\doloop
- {\advance\scratchdimen -\lineheight
+ {\advanceby\scratchdimen -\lineheight
\ifdim\scratchdimen<\zeropoint
\exitloop
\else
@@ -2148,9 +2195,9 @@
\permanent\protected\def\placedbox
{\iftraceboxplacement\ruledhbox\else\hbox\fi}
-\newdimen\boxoffset
-\newdimen\boxhdisplacement
-\newdimen\boxvdisplacement
+\newdimension\boxoffset
+\newdimension\boxhdisplacement
+\newdimension\boxvdisplacement
\permanent\protected\def\rightbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_rightbox_finish \placedbox}
\permanent\protected\def\leftbox {\hpack\bgroup\dowithnextboxcs\syst_boxes_leftbox_finish \placedbox}
@@ -2287,8 +2334,8 @@
\permanent\protected\def\lrtbbox#1#2#3#4% l r t b
{\bgroup
\dowithnextboxcontent
- {\advance\hsize-#1\advance\hsize-#2\relax
- \advance\vsize-#3\advance\vsize-#4\relax}
+ {\advanceby\hsize-#1\advanceby\hsize-#2\relax
+ \advanceby\vsize-#3\advanceby\vsize-#4\relax}
{\forgetall\vpack to \vsize{\vskip#3\hpack to \hsize{\hskip#1\box\nextbox\hss}\vss}\egroup}
\vbox}
@@ -2303,7 +2350,7 @@
\def\syst_boxes_toplinebox_finish
{\ifdim\dp\nextbox>\strutdepth
\scratchdimen\dp\nextbox
- \advance\scratchdimen-\strutdepth
+ \advanceby\scratchdimen-\strutdepth
\getnoflines\scratchdimen
\struttedbox{\box\nextbox}%
\dorecurse\noflines\verticalstrut
@@ -2393,7 +2440,7 @@
\installcorenamespace {boxstack}
-\newcount\c_syst_boxes_stack
+\newinteger\c_syst_boxes_stack
\mutable\let\b_syst_boxes_stack\relax
@@ -2402,7 +2449,7 @@
\letcsname\??boxstack\number\c_syst_boxes_stack\endcsname\b_syst_boxes_stack}
\protected\def\syst_boxes_push#1#2%
- {\global\advance\c_syst_boxes_stack\plusone
+ {\global\advanceby\c_syst_boxes_stack\plusone
\expandafter\let\expandafter\b_syst_boxes_stack\csname\??boxstack\number\c_syst_boxes_stack\endcsname
\ifrelax\b_syst_boxes_stack % cheaper then csname check as in most cases it's defined
\syst_boxes_stack_allocate
@@ -2411,7 +2458,7 @@
\protected\def\syst_boxes_pop#1#2%
{#1\setbox#2\box\csname\??boxstack\number\c_syst_boxes_stack\endcsname
- \global\advance\c_syst_boxes_stack\minusone}
+ \global\advanceby\c_syst_boxes_stack\minusone}
\permanent\protected\def\localpushbox {\syst_boxes_push\relax}
\permanent\protected\def\localpopbox {\syst_boxes_pop \relax}
@@ -2432,6 +2479,7 @@
%D \getboxfromcache{foo}{\recurselevel}\zerocount
%D \fi
%D }
+%D % \startMPcode draw rawtexbox("category","name") ; \stopMPcode
%D \resetboxesincache{foo}
%D \stoptyping
@@ -2446,6 +2494,7 @@
% \getboxwdfromcache % {category} {name}
% \getboxhtfromcache % {category} {name}
% \getboxdpfromcache % {category} {name}
+% \getboxhtdpfromcache % {category} {name}
%D \macros
%D {removedepth, obeydepth}
@@ -2475,8 +2524,11 @@
%D
%D A funny (but rather stupid) one, plus a redefinition.
+% \permanent\protected\def\removebottomthings
+% {\dorecurse\plusfive{\unskip\unkern\unpenalty}}
+
\permanent\protected\def\removebottomthings
- {\dorecurse\plusfive{\unskip\unkern\unpenalty}}
+ {\localcontrolledloop\plusone\plusfive\plusone{\unskip\unkern\unpenalty}}
\permanent\protected\def\removelastskip % \ifvmode the plain tex one \fi, overloaded to \permanent in spac-ver
{\ifvmode\ifzeropt\lastskip\else\vskip-\lastskip\fi\fi}
@@ -2606,8 +2658,8 @@
\permanent\protected\def\shownextbox % seldom used
{\dowithnextbox
{\bgroup
- \showboxbreadth\maxdimen
- \showboxdepth \maxdimen
+ \showboxbreadth\maxcount
+ \showboxdepth \maxcount
\scratchcounter\interactionmode
\batchmode
\showbox\nextbox
@@ -2636,10 +2688,8 @@
\fi
\egroup}
-% Why not ...
-
-\showboxbreadth\plusthousand
-\showboxdepth \plusthousand
+% \showboxbreadth\plusthousand
+% \showboxdepth \plusthousand
%D Moved from cont-new:
%D
@@ -2678,7 +2728,12 @@
{\beginlocalcontrol\begingroup
\dowithnextboxcs\syst_boxes_contenttostring\hbox}
-\newtoks\everypreroll
+\newtoks \everypreroll
+\newif \ifprerolling
+
+\appendtoks
+ \prerollingtrue
+\to \everypreroll
\let\prerolltostring\firstofoneargument % we need to bypass initializations
@@ -2710,17 +2765,17 @@
%D \setbox0\hbox to 10cm{foo} \the\naturalwd0
%D \stoptyping
-\newdimen\lastnaturalboxwd
-\newdimen\lastnaturalboxht
-\newdimen\lastnaturalboxdp
+% \newdimension\lastnaturalboxwd
+% \newdimension\lastnaturalboxht
+% \newdimension\lastnaturalboxdp
%D We can define these public in lua:
-\aliased\let\getnaturaldimensions\clf_getnaturaldimensions % sets three dimensions
-\aliased\let\naturalwd \clf_naturalwd % calculates and returns wd
+% \aliased\let\getnaturaldimensions\clf_getnaturaldimensions % sets three dimensions
+% \aliased\let\naturalwd \clf_naturalwd % calculates and returns wd
-\aliased\let\getnaturalwd\clf_getnaturalwd % no intermediate
-\aliased\let\setnaturalwd\clf_setnaturalwd % no intermediate
+% \aliased\let\getnaturalwd\clf_getnaturalwd % no intermediate
+% \aliased\let\setnaturalwd\clf_setnaturalwd % no intermediate
\permanent\protected\def\doifelserighttoleftinbox{\clf_doifelserighttoleftinbox}
@@ -2795,10 +2850,10 @@
\permanent\protected\def\linebox
{\hpack\bgroup\dowithnextbox
- {\scratchdimen\dimexpr\dimexpr\htdp\nextbox-\lineheight\relax/2+\dp\strutbox\relax
+ {\scratchdimen\dimexpr\dimexpr\htdp\nextbox-\lineheight\relax/2+\strutdp\relax
\setbox\nextbox\hpack{\lower\scratchdimen\box\nextbox}%
- \ht\nextbox\ht\strutbox
- \dp\nextbox\dp\strutbox
+ \ht\nextbox\strutht
+ \dp\nextbox\strutdp
\box\nextbox
\egroup}
\hbox}
@@ -2867,6 +2922,29 @@
%D \setpostlistbox <box> <hbox|vbox|vtop|somebox>
%D \stoptyping
+%D Defined in lua:
+%D
+%D setsplitlisthtdp\scratchbox\struthp\strutdp
+
+%D Handy but I'll probably forget it:
+%D
+%D \starttyping
+%D \setbox0\hbox{!!!!!}
+%D \showbox 0
+%D \showboxhere 0 % always on console, less clutter
+%D \stoptyping
+
+\untraced\permanent\protected\def\showboxhere{\showbox nolevels content online all }
+
+% % possible extra interface, currently disabled
+%
+% \permanent\tolerant\protected\def\registeranchorbox[#1]#*[#2]%
+% {\dowithnextbox
+% {\clf_registeranchorbox
+% \namedboxanchor{#1}%
+% \ifcstok{#2}\v!before\minusone\else\plusone\fi
+% \box\nextbox}}
+
\protect \endinput
% a bit of test code:
diff --git a/Master/texmf-dist/tex/context/base/mkxl/supp-mat.mkxl b/Master/texmf-dist/tex/context/base/mkxl/supp-mat.mkxl
index 5822e959dd3..c3c69593aff 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/supp-mat.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/supp-mat.mkxl
@@ -44,21 +44,21 @@
%D
%D Which is implemented (in \type{syst-ini.mkiv}) as:
-\permanent\protected\def\Ucheckedstartdisplaymath
- {\ifinner
- \ifhmode
- \normalUstartmath
- \let\Ucheckedstopdisplaymath\normalUstopmath
- \else
- \normalUstartdisplaymath
- \let\Ucheckedstopdisplaymath\normalUstopdisplaymath
- \fi
- \else
- \normalUstartdisplaymath
- \let\Ucheckedstopdisplaymath\normalUstopdisplaymath
- \fi}
-
-\aliased\let\Ucheckedstopdisplaymath\relax
+% \permanent\protected\def\Ucheckedstartdisplaymath
+% {\ifinner
+% \ifhmode
+% \normalUstartmath
+% \let\Ucheckedstopdisplaymath\normalUstopmath
+% \else
+% \normalUstartdisplaymath
+% \let\Ucheckedstopdisplaymath\normalUstopdisplaymath
+% \fi
+% \else
+% \normalUstartdisplaymath
+% \let\Ucheckedstopdisplaymath\normalUstopdisplaymath
+% \fi}
+%
+% \aliased\let\Ucheckedstopdisplaymath\relax
% \let\normalsuper\Usuperscript % obsolete
% \let\normalsuber\Usubscript % obsolete
@@ -69,8 +69,8 @@
\aliased\let\stopdmath \Ustopdisplaymath % \Ucheckedstopdisplaymath
\permanent\protected\def\mathematics#1{\relax \ifmmode#1\else\normalstartimath#1\normalstopimath\fi}
-\permanent\protected\def\displaymath#1{\noindent \ifmmode#1\else\normalstartdmath#1\normalstopdmath\fi}
-\permanent\protected\def\inlinemath #1{\dontleavehmode\ifmmode#1\else\normalstartimath#1\normalstopimath\fi}
+%permanent\protected\def\displaymath#1{\noindent \ifmmode#1\else\normalstartdmath#1\normalstopdmath\fi}
+%permanent\protected\def\inlinemath #1{\dontleavehmode\ifmmode#1\else\normalstartimath#1\normalstopimath\fi}
\permanent\protected\def\textmath #1{\dontleavehmode\ifmmode#1\else\begingroup\everymath\emptytoks\normalstartimath#1\normalstopimath\endgroup\fi} % \mathsurround\zeropoint
\aliased\let\stopmathmode\relax
@@ -93,17 +93,23 @@
%D \macros
%D {displaymathematics,inlinemathematics,automathematics}
%D
-%D An example of usage of the following can be found in the MathML module:
+%D We no longer support native displaymath, which is no big deal because already
+%D for many years we abandoned it. We therefore also default differently now. We
+%D signal \LUAMETATEX\ that the double dollar mode actually has to be inline
+%D display math anyway.
\ifdefined\strc_formulas_start_formula \else
- \def\strc_formulas_start_formula{\normalstartdmath}
- \def\strc_formulas_stop_formula {\normalstopdmath }
+ \def\strc_formulas_start_formula{\normalstartdmath}
+ \def\strc_formulas_stop_formula {\normalstopdmath }
\fi
\permanent\protected\def\displaymathematics#1{\relax\ifmmode#1\else\strc_formulas_start_formula{}#1\strc_formulas_stop_formula\fi}
\permanent\protected\def\inlinemathematics {\dontleavehmode\mathematics}
%permanent\protected\def\automathematics {\relax\ifhmode\expandafter\inlinemathematics\else\expandafter\displaymathematics\fi}
+\aliased\let\displaymath\displaymathematics % we no longer support native displaymath
+\aliased\let\inlinemath \inlinemathematics % we no longer support native displaymath
+
% better, esp when used in bTABLE ... eTABLE
\permanent\protected\def\automathematics
@@ -125,36 +131,36 @@
%D
%D REPLACED (keep commented):
-\newsignal\dimensionsignal
-
-\mutable\def\dimensiontypeface {\tf}
-\mutable\def\dimensionhalfspace {\,}
-
-\aliased\let\dodimensionsignal\relax
-
-\permanent\protected\def\dimension#1%
- {\pushmacro\dodimensionsignal
- \enforced\gdef\dodimensionsignal{\kern\dimensionsignal}%
- \ifzeropt\lastskip
- \ifzeropt\lastkern
- \ifmmode
- \mathematics{\dimensionhalfspace\dimensionhalfspace\dimensiontypeface#1}%
- \else
- \mathematics{\dimensiontypeface#1}%
- \fi
- \orelse\ifdim\lastkern=\dimensionsignal
- \mathematics{\dimensionhalfspace\dimensiontypeface#1}%
- \else
- \unkern\mathematics{\dimensionhalfspace\dimensionhalfspace\dimensiontypeface#1}%
- \fi
- \else
- \unskip\mathematics{\dimensionhalfspace\dimensionhalfspace\dimensiontypeface#1}%
- \fi
- \dodimensionsignal
- \popmacro\dodimensionsignal}
-
-\permanent\protected\def\nodimension#1%
- {\unskip#1\enforced\glet\dodimensionsignal\relax}
+% \newsignal\dimensionsignal
+%
+% \mutable\def\dimensiontypeface {\tf}
+% \mutable\def\dimensionhalfspace {\,}
+%
+% \aliased\let\dodimensionsignal\relax
+%
+% \permanent\protected\def\dimension#1%
+% {\pushmacro\dodimensionsignal
+% \enforced\gdef\dodimensionsignal{\kern\dimensionsignal}%
+% \ifzeropt\lastskip
+% \ifzeropt\lastkern
+% \ifmmode
+% \mathematics{\dimensionhalfspace\dimensionhalfspace\dimensiontypeface#1}%
+% \else
+% \mathematics{\dimensiontypeface#1}%
+% \fi
+% \orelse\ifdim\lastkern=\dimensionsignal
+% \mathematics{\dimensionhalfspace\dimensiontypeface#1}%
+% \else
+% \unkern\mathematics{\dimensionhalfspace\dimensionhalfspace\dimensiontypeface#1}%
+% \fi
+% \else
+% \unskip\mathematics{\dimensionhalfspace\dimensionhalfspace\dimensiontypeface#1}%
+% \fi
+% \dodimensionsignal
+% \popmacro\dodimensionsignal}
+%
+% \permanent\protected\def\nodimension#1%
+% {\unskip#1\enforced\glet\dodimensionsignal\relax}
% experiment, not yet to be used
@@ -170,6 +176,7 @@
\aliased\let\superscript \Usuperscript
\aliased\let\subscript \Usubscript
+\aliased\let\primescript \Uprimescript
\aliased\let\nosuperscript \Unosuperscript
\aliased\let\nosubscript \Unosubscript
\aliased\let\superprescript \Usuperprescript
diff --git a/Master/texmf-dist/tex/context/base/mkxl/supp-ran.lmt b/Master/texmf-dist/tex/context/base/mkxl/supp-ran.lmt
new file mode 100644
index 00000000000..6aee728962f
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/supp-ran.lmt
@@ -0,0 +1,245 @@
+if not modules then modules = { } end modules ['supp-ran'] = {
+ version = 1.001,
+ comment = "companion to supp-ran.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- We cannot ask for the current seed, so we need some messy hack here.
+
+local report_system = logs.reporter("system","randomizer")
+
+local trace_random = false trackers.register("system.randomizer", function(v) trace_random = v end)
+local trace_details = false trackers.register("system.randomizer.details", function(v) trace_random = v trace_details = v end)
+
+local insert, remove = table.insert, table.remove
+
+local tonumber = tonumber
+local sub = string.sub
+local math = math
+local context = context
+local implement = interfaces.implement
+
+local random = math.random
+local randomseed = math.randomseed
+local round = math.round
+local stack = { }
+local last = 1
+local maxcount = 0x3FFFFFFF -- 2^30-1
+
+math.random = function(...)
+ local n = random(...)
+ if trace_details then
+ report_system("math %s",n)
+ end
+ return n
+end
+
+local function setrandomseedi(n)
+ if n <= 1 then
+ n = n * maxcount
+ elseif n < 1000 then
+ n = n * 1000
+ end
+ n = round(n)
+ randomseed(n)
+ last = random(0,maxcount) -- we need an initial value
+ if trace_details then
+ report_system("seed %s from %s",last,n)
+ elseif trace_random then
+ report_system("setting seed %s",n)
+ end
+end
+
+math.setrandomseedi = setrandomseedi
+
+local function getrandomnumber(min,max)
+ if min > max then
+ min, max = max, min
+ end
+ last = random(min,max)
+ if trace_details then
+ report_system("number %s",last)
+ end
+ return last
+end
+
+local function setrandomseed(n)
+ last = n
+ setrandomseedi(n)
+end
+
+local function getrandomseed()
+ return last
+end
+
+-- local function getmprandomnumber()
+-- last = random(0,4095)
+-- if trace_details then
+-- report_system("mp number %s",last)
+-- end
+-- return last
+-- end
+
+-- maybe stack
+
+local function pushrandomseed()
+ -- insert(stack,last) -- doesn't work okay
+ insert(stack,randomseed(last) or last)
+ if trace_random or trace_details then
+ report_system("pushing seed %s",last)
+ end
+end
+
+local function reuserandomseed(n)
+ local seed = stack[#stack]
+ if seed then
+ if trace_random or trace_details then
+ report_system("reusing seed %s",last)
+ end
+ randomseed(seed)
+ end
+end
+
+local function poprandomseed()
+ local seed = remove(stack)
+ if seed then
+ if trace_random or trace_details then
+ report_system("popping seed %s",seed)
+ end
+ randomseed(seed)
+ end
+end
+
+local function getrandom(where,...)
+ if type(where) == "string" then
+ local n = random(...)
+ if trace_details then
+ report_system("%s %s",where,n)
+ end
+ return n
+ else
+ local n = random(where,...)
+ if trace_details then
+ report_system("utilities %s",n)
+ end
+ return n
+ end
+end
+
+-- todo: also open up in utilities.randomizer.*
+
+implement { name = "getrandomnumber", actions = { getrandomnumber, context }, arguments = { "integer", "integer" } }
+implement { name = "getrandomdimen", actions = { getrandomnumber, context }, arguments = { "dimen", "dimen" } }
+implement { name = "getrandomfloat", actions = { getrandomnumber, context }, arguments = { "number", "number" } }
+implement { name = "getrandomseed", actions = { getrandomseed, context } }
+implement { name = "setrandomseed", actions = setrandomseed, arguments = "integer" }
+implement { name = "pushrandomseed", actions = pushrandomseed, public = true, }
+implement { name = "poprandomseed", actions = poprandomseed, public = true, }
+implement { name = "reuserandomseed", actions = reuserandomseed, public = true, }
+
+-- fun stuff
+
+local newrepeatable, getrepeatable, getrepeatableseed, repeatable
+
+do
+
+ local default = environment.version or "context lmtx"
+ local hashed = md5.HEX
+ ----- hashed = sha2.HASH256
+ local list = { }
+ local saved = false
+
+ newrepeatable = function(name,seed)
+ if not name or name == "" then
+ name = "default"
+ seed = default
+ elseif not seed then
+ seed = default
+ end
+ if not saved then
+ saved = { }
+ job.variables.collected.repeatable = saved
+ end
+ saved[name] = seed
+ local hash = hashed(seed)
+ if trace_random then
+ report_system("repeatable %a with seed %a starts out as %a",name,seed,hash)
+ end
+ local func = function()
+ local n = tonumber(sub(hash,1,8),16)
+ -- local n = tonumber(sub(hash,1,15),16)
+ local r = n / 0xFFFFFFFF
+ -- local r = n / 0xFFFFFFFFFFFFFFF
+ hash = hashed(hash)
+ if trace_details then
+ report_system("repeatable %a moves on to %a giving %i and %0.9f",name,hash,n,r)
+ end
+ return r
+ end
+ list[name] = func
+ -- we need to delay this till we have job available
+ -- but we seldom call this so it's okay
+ return func
+ end
+
+ table.setmetatableindex(list,function(t,k)
+ local v = rawget(t,"default")
+ if not v then
+ v = newrepeatable("default",default)
+ end
+ t[k] = v
+ return v
+ end)
+
+ getrepeatable = function(name)
+ return list[name or "default"]
+ end
+
+ repeatable = function(name)
+ return list[name or "default"]()
+ end
+
+ getrepeatableseed = function(name)
+ local r = job.variables.collected.repeatable
+ return r and r[name or "default"] or default
+ end
+
+ implement {
+ name = "newrepeatablerandom",
+ public = true,
+ protected = true,
+ arguments = { "csnameunchecked", "argument" },
+ actions = function(c,s)
+ -- local c = tokens.scanners.csname(true)
+ -- local s = tokens.scanners.argument()
+ implement {
+ name = c,
+ public = true,
+ actions = { newrepeatable(c,s), context },
+ }
+ end
+ }
+
+end
+
+-- public
+
+utilities.randomizer = {
+ setseedi = setrandomseedi,
+ getnumber = getrandomnumber,
+ setseed = setrandomseed,
+ getseed = getrandomseed,
+ -- getmpnumber = getmprandomnumber,
+ pushseed = pushrandomseed,
+ reuseseed = reuserandomseed,
+ popseed = poprandomseed,
+ get = getrandom,
+ -- the original, only for testing
+ -- mathrandom = random,
+ newrepeatable = newrepeatable,
+ getrepeatable = getrepeatable,
+ getrepeatableseed = getrepeatableseed,
+ repeatable = repeatable,
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/supp-ran.mkxl b/Master/texmf-dist/tex/context/base/mkxl/supp-ran.mkxl
index 7d212fdfd01..4bcff6a9449 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/supp-ran.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/supp-ran.mkxl
@@ -26,7 +26,7 @@
%D \type{new}: \dorecurse{10}{\randomnumber{1}{100} }\par
%D \stoptyping
-\registerctxluafile{supp-ran}{}
+\registerctxluafile{supp-ran}{autosuffix}
\unprotect
@@ -49,4 +49,41 @@
\permanent\def\randomnumber #1#2{\clf_getrandomnumber\numexpr#1\relax\numexpr#2\relax}
\permanent\def\mprandomnumber {\clf_getrandomnumber\zerocount\mpscaledmax}
+%D \startbuffer
+%D \enabletrackers[system.randomizer.details]
+%D
+%D \newrepeatablerandom\MyRandom {Welcome 2 America}
+%D \newrepeatablerandom\MyRandomN{\randomnumber{0}{1000}}
+%D \newrepeatablerandom\MyRandomM{\randomnumber{0}{1000}}
+%D
+%D \cldcontext{utilities.randomizer.getrepeatableseed()}\par
+%D \cldcontext{utilities.randomizer.getrepeatableseed("default")}\par
+%D \cldcontext{utilities.randomizer.getrepeatableseed("MyRandom")}\par
+%D \cldcontext{utilities.randomizer.getrepeatableseed("MyRandomN")}\par
+%D \cldcontext{utilities.randomizer.getrepeatableseed("MyRandomM")}\par
+%D
+%D \dorecurse{10}{\MyRandom\par}
+%D
+%D \startMPcode
+%D randomseed := repeatablerandom("MyRandom") ;
+%D draw image (
+%D for i=1 upto 10000 :
+%D draw origin randomized 100 ;
+%D endfor ;
+%D ) withpen pencircle scaled 1 ;
+%D \stopMPcode
+%D
+%D \startluacode
+%D context(utilities.randomizer.getrepeatableseed("MyRandom"))
+%D context.par()
+%D local rep = utilities.randomizer.getrepeatable("MyRandom")
+%D for i=1,5 do
+%D context(rep())
+%D context.par()
+%D end
+%D \stopluacode
+%D \stopbuffer
+%D
+%D \typebuffer \blank \getbuffer \blank
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/symb-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/symb-ini.mkxl
index c29b073606d..cf61ddb1f79 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/symb-ini.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/symb-ini.mkxl
@@ -58,12 +58,12 @@
\setupsymbols
[\c!stylealternative=\v!text]
-\mutable\let\currentsymbol \empty
-\mutable\let\currentsymbolset\empty
+\mutable\lettonothing\currentsymbol
+\mutable\lettonothing\currentsymbolset
\newtoks\t_symb_setups
-\let\m_symb_current_set\empty
+\lettonothing\m_symb_current_set
\newconditional\c_symb_found
@@ -88,7 +88,7 @@
\aliased\let\doifinsymbolsetelse\doifelseinsymbolset
\aliased\let\doifsymbolsetelse \doifelsesymbolset
-\letvalue{\??symbolset}\empty
+\letvalue\??symbolset\empty
%def\symbolset#1{\csname\??symbolset\ifcsname\??symbolset#1\endcsname#1\fi\endcsname} % no [#1], to be used in commalists etc
@@ -143,7 +143,7 @@
\csname\??symbol#1\endcsname\relax
\endgroup}
-\letvalue{\??symbol}\firstofoneargument
+\letcsname\??symbol\endcsname\firstofoneargument
\permanent\def\directsymbol#1#2% no \relax, there can be an argument, see lists
{\begincsname\??symbol#1:#2\endcsname}
@@ -212,7 +212,7 @@
\mutable\def\defaultsymbolfactor{10}
\mutable\def\defaultsymbolheight{1.25ex}
-\permanent\tolerant\protected\def\figuresymbol[#1]#*[#2]%
+\permanent\tolerant\protected\def\figuresymbol[#1]#,[#2]%
{\externalfigure[#1][\c!reset=\v!yes,\c!symbol=\v!yes,\c!height=\defaultsymbolheight,#2]}
\permanent\tolerant\protected\def\definefiguresymbol[#1]#*[#2]#*[#3]%
diff --git a/Master/texmf-dist/tex/context/base/mkxl/syst-aux.lmt b/Master/texmf-dist/tex/context/base/mkxl/syst-aux.lmt
index 726fd4d326a..39ceae3767d 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/syst-aux.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/syst-aux.lmt
@@ -184,20 +184,21 @@ local option = (
local pattern = (
(
spaces * (
- ( P("spaces") * space / catcodes_s )
- + ( P("nospaces") * space / catcodes_n )
- + ( P("global") * space / function() global = true end)
- + ( P("protected") * space / function() protected = true end)
- + ( P("permanent") * space / function() permanent = true end)
- + ( P("expanded") * space / function() expanded = true end)
- + ( P("tolerant") * space / function() tolerant = true end)
- + ( P("instance") * space / function() instance = true end)
- + ( P("frozen") * space / function() frozen = true end)
- + ( P("mutable") * space / function() mutable = true end)
- + ( P("immutable") * space / function() immutable = true end)
- + ( P("unexpanded") * space / function() protected = true end)
- + ( option * space / function(s) tolerant = true
- optional = s end)
+ ( P("spaces") * space / catcodes_s )
+ + ( P("nospaces") * space / catcodes_n )
+ + ( P("global") * space / function() global = true end)
+ + ( P("protected") * space / function() protected = 1 end)
+ + ( P("semiprotected") * space / function() protected = 2 end)
+ + ( P("permanent") * space / function() permanent = true end)
+ + ( P("expanded") * space / function() expanded = true end)
+ + ( P("tolerant") * space / function() tolerant = true end)
+ + ( P("instance") * space / function() instance = true end)
+ + ( P("frozen") * space / function() frozen = true end)
+ + ( P("mutable") * space / function() mutable = true end)
+ + ( P("immutable") * space / function() immutable = true end)
+ + ( P("unexpanded") * space / function() protected = 1 end)
+ + ( option * space / function(s) tolerant = true
+ optional = s end)
)
)^0
* spaces * ( C((1-S(" #["))^1) )
@@ -229,7 +230,7 @@ local function texdefinition_two()
context (
(tolerant and [[\tolerant]] or "") ..
(frozen and [[\frozen]] or "") ..
- (protected and [[\protected]] or "") ..
+ (protected and (protected == 1 and [[\protected]] or [[\semiprotected]]) or "") ..
(permanent and [[\permanent]] or "") ..
(instance and [[\instance]] or "") ..
(mutable and [[\mutable]] or "") ..
@@ -648,14 +649,14 @@ implement {
-- name = "hascommonargumentcondition",
-- actions = hascommonargumentcondition,
-- arguments = "2 strings",
--- arguments = { "argument", "argument" },
+-- arguments = "2 arguments",
-- }
implement {
name = "doifelseinset",
actions = doifelseinset,
arguments = "2 strings",
--- arguments = { "argument", "argument" },
+-- arguments = "2 arguments",
}
implement {
@@ -780,3 +781,30 @@ implement {
public = true,
actions = function() getshape("widowpenalties") end,
}
+
+implement {
+ name = "loopcs",
+ public = true,
+ arguments = { "integerargument", "csname" },
+ actions = function(n,cs)
+ local c = context[cs]
+ if n < 0 then
+ for i=-n,1 do c() end
+ else
+ for i= 1,n do c() end
+ end
+ end
+}
+implement {
+ name = "loopcsn",
+ public = true,
+ arguments = { "integerargument", "csname" },
+ actions = function(n,cs)
+ local c = context[cs]
+ if n < 0 then
+ for i=-n,1 do c(i) end
+ else
+ for i= 1,n do c(i) end
+ end
+ end
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/syst-aux.mkxl b/Master/texmf-dist/tex/context/base/mkxl/syst-aux.mkxl
index e4cecfe58e2..2b87f4b3d45 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/syst-aux.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/syst-aux.mkxl
@@ -66,10 +66,10 @@
%D We're definitely in \LMTX\ mode here.
-\aliased \let\startlmtxmode\relax
-\aliased \let\stoplmtxmode \relax
-\permanent\def\startmkivmode#-\stopmkivmode{}
-\permanent\let\stopmkivmode \relax
+\permanent\protected\lettonothing\startlmtxmode
+\permanent\protected\lettonothing\stoplmtxmode
+\permanent \def\startmkivmode#-\stopmkivmode{}
+\permanent\protected\lettonothing\stopmkivmode
%D As we don't have namespace definers yet, we use a special one. Later we will
%D do a better job.
@@ -80,7 +80,7 @@
\else
- \newcount\c_syst_helpers_n_of_namespaces \c_syst_helpers_n_of_namespaces\pluseight % 1-8 reserved for catcodes
+ \newinteger\c_syst_helpers_n_of_namespaces \c_syst_helpers_n_of_namespaces\pluseight % 1-8 reserved for catcodes
\def\v_interfaces_prefix_template_system{\number \c_syst_helpers_n_of_namespaces>>}
%def\v_interfaces_prefix_template_system{\characters\c_syst_helpers_n_of_namespaces>>} % no \characters yet
@@ -91,7 +91,7 @@
{\ifcsname ??#1\endcsname
\writestatus\m!system{duplicate system namespace '#1'}\wait
\else
- \global\advance\c_syst_helpers_n_of_namespaces\plusone
+ \global\advanceby\c_syst_helpers_n_of_namespaces\plusone
\immutable\edefcsname ??#1\endcsname{\v_interfaces_prefix_template_system}%
\fi}
@@ -163,7 +163,7 @@
%D alternatives to this command. Beware, only the simple one has \type {\noexpand}
%D before its argument.
-\let\m_syst_helpers_expanded\empty
+\lettonothing\m_syst_helpers_expanded
\pushoverloadmode
@@ -175,7 +175,7 @@
\permanent\protected\def\startexpanded#1\stopexpanded
{\xdef\m_syst_helpers_expanded{#1}\m_syst_helpers_expanded}
-\aliased\let\stopexpanded\relax
+\permanent\protected\lettonothing\stopexpanded
%D Recent \TEX\ engines have a primitive \type {\expanded} and we will use that when
%D possible. After all, we can make not expandable macros now. The name clash is an
@@ -216,15 +216,25 @@
%D Reserved macros for tests:
-\aliased\let\donothing\empty
+%D A \type \type {\let} is more efficient than a \type {\def} so we often let something
+%D to relax or do nothing. However, we then loose the name in tracing. For that we now
+%D have \type {\lettonothing \foo} which is efficient but also keeps the name. Of course
+%D this is no solution for commands that take arguments but at least it helps tracing a
+%D bit. We keep of course \type {\donothing}.
-\let\m_syst_string_one \empty
-\let\m_syst_string_two \empty
-\let\m_syst_string_three\empty
-\let\m_syst_string_four \empty
+%D Maybe even nicer is a let that aliases but keeps the name.
-\let\m_syst_action_yes \empty
-\let\m_syst_action_nop \empty
+ % \lettonothing\donothing
+ \immutable\def\donothing {} % better in tracing
+%untraced\immutable\def\untraceddonothing{}
+
+\lettonothing\m_syst_string_one
+\lettonothing\m_syst_string_two
+\lettonothing\m_syst_string_three
+\lettonothing\m_syst_string_four
+
+\lettonothing\m_syst_action_yes
+\lettonothing\m_syst_action_nop
%D \macros
%D {doifnextcharelse}
@@ -474,24 +484,41 @@
%D When we were developing the scientific units module, we encountered different
%D behavior in text and math mode, which was due to this grouping subtilities. We
%D therefore decided to use \type {\begingroup} instead of \type {\bgroup}.
+%D
+%D \stoptyping
+%D \doifelsealldefined {foo,ofo} {YES}{NOP}
+%D \doifelseallundefined{foo,ofo} {YES}{NOP}
+%D \doifelsealldefined {relax,ofo}{YES}{NOP}
+%D \doifelseallundefined{foo,relax}{YES}{NOP}
+%D \stoptyping
+
+\def\syst_helpers_do_if_all_defined_else#1%
+ {\ifcsname#1\endcsname\else
+ \donefalse
+ \expandafter\quitcommalist % added
+ \fi}
-\permanent\protected\def\doifelsealldefined#1%
+\def\syst_helpers_do_if_all_undefined_else#1%
+ {\ifcsname#1\endcsname
+ \donefalse
+ \expandafter\quitcommalist
+ \fi}
+
+\permanent\protected\def\syst_helpers_do_if_all_else#1#2%
{\begingroup
\donetrue % we could use a reserved one and avoid the group
- \processcommalist[#1]\syst_helpers_do_if_all_defined_else
+ \processcommalist[#2]#1%
\ifdone
\endgroup\expandafter\firstoftwoarguments
\else
\endgroup\expandafter\secondoftwoarguments
\fi}
-\aliased\let\doifalldefinedelse\doifelsealldefined
+\permanent\protected\def\doifelsealldefined {\syst_helpers_do_if_all_else\syst_helpers_do_if_all_defined_else}
+\permanent\protected\def\doifelseallundefined{\syst_helpers_do_if_all_else\syst_helpers_do_if_all_undefined_else}
-\def\syst_helpers_do_if_all_defined_else#1%
- {\ifcsname#1\endcsname\else
- \donefalse
- \expandafter\quitcommalist % added
- \fi}
+\aliased\let\doifalldefinedelse \doifelsealldefined
+\aliased\let\doifallundefinedelse\doifelseallundefined
%D \macros
%D {doif,doifelse,doifnot}
@@ -557,6 +584,15 @@
\expandafter\secondoftwoarguments
\fi}
+% or (test this):
+%
+% \permanent\protected\def\processallactionsinset[#1]%
+% {\ifcstok{#1}\emptytoks
+% \expandafter\processaction
+% \else
+% \expandafter\syst_helpers_process_all_actions_in_set_indeed
+% \fi[#1]}
+
\aliased\let\doifemptyelse\doifelseempty
\permanent\protected\def\doifempty#1%
@@ -779,7 +815,7 @@
%D arguments state. Again it permits leaner and meaner macro definitions with a bit
%D less clutter in tracing.
-\mutable\let\commalistcommand\empty
+\mutable\lettonothing\commalistcommand
\protected\def\syst_helpers_process_comma_item#+,%
{\ifarguments
@@ -840,9 +876,9 @@
\popmacro\commalistcommand}
% \let\syst_helpers_process_comma_item_next_a \syst_helpers_process_comma_item_next
-% \def\syst_helpers_process_comma_item_next_b#0\ignorearguments{\let\syst_helpers_process_comma_item_next\syst_helpers_process_comma_item_next_a}
-% \def\syst_helpers_process_comma_item_next_c#0\ignorearguments{\let\syst_helpers_process_comma_item_next\syst_helpers_process_comma_item_next_b}
-% \def\syst_helpers_process_comma_item_gobble#0\ignorearguments{}
+% \def\syst_helpers_process_comma_item_next_b#-\ignorearguments{\let\syst_helpers_process_comma_item_next\syst_helpers_process_comma_item_next_a}
+% \def\syst_helpers_process_comma_item_next_c#-\ignorearguments{\let\syst_helpers_process_comma_item_next\syst_helpers_process_comma_item_next_b}
+% \def\syst_helpers_process_comma_item_gobble#-\ignorearguments{}
\let\syst_helpers_process_comma_item_next_a \syst_helpers_process_comma_item_next
\def\syst_helpers_process_comma_item_next_b#-\ignorearguments{\let\syst_helpers_process_comma_item_next\syst_helpers_process_comma_item_next_a}
@@ -904,7 +940,7 @@
\let\syst_helpers_comma_list_step\relax
-\mutable\let\currentcommalistitem\empty
+\mutable\lettonothing\currentcommalistitem
\permanent\protected\def\startprocesscommalist[#1]#2\stopprocesscommalist
{\def\syst_helpers_comma_list_step##1{\def\currentcommalistitem{##1}#2}%
@@ -914,8 +950,8 @@
{\def\syst_helpers_comma_list_step##1{\def\currentcommalistitem{##1}#2}%
\normalexpanded{\processcommalist[#1]}\syst_helpers_comma_list_step}
-\aliased\let\stopprocesscommalist \relax
-\aliased\let\stopprocesscommacommand\relax
+\permanent\protected\lettonothing\stopprocesscommalist
+\permanent\protected\lettonothing\stopprocesscommacommand
%D \macros
%D {processaction,
@@ -960,17 +996,17 @@
%D this more hip and a bit faster now but \unknown\ it's seldom used nowadays as we
%D have better ways now.
-\mutable\let\commalistelement\empty
+\mutable\lettonothing\commalistelement
-\let\m_syst_string_one\empty
-\let\m_syst_string_two\empty
+\lettonothing\m_syst_string_one
+\lettonothing\m_syst_string_two
\let\syst_helpers_do_compare_process_action\relax
\protected\def\syst_helpers_do_compare_process_action_a[#1=>#2][#3]%
{\edef\m_syst_string_two{#1}%
\ifx\m_syst_string_two\s!default
- \let\commalistelement\empty
+ \lettonothing\commalistelement
#2%
\fi}
@@ -1069,7 +1105,7 @@
% \expandafterspaces\syst_helpers_process_comma_item#2#3\ignorearguments\ignorearguments\ignorearguments
% \popmacro\commalistcommand}
-\permanent\protected\def\processnextcommalist#1[#2#3]%
+\permanent\protected\def\processnextcommalist#1[#2#3]% watch out: mkiv has two extra initial arguments
{\pushmacro\commalistcommand
\def\commalistcommand{#1}%
\expandafterspaces\syst_helpers_process_comma_item#2#3\ignorearguments\ignorearguments\ignorearguments
@@ -1088,8 +1124,8 @@
%D A two step expansion is used to prevent problems with complicated arguments, for
%D instance arguments that consist of two or more expandable tokens.
-\mutable\let\firstcharacter \empty
-\mutable\let\remainingcharacters\empty
+\mutable\lettonothing\firstcharacter
+\mutable\lettonothing\remainingcharacters
\permanent\protected\def\getfirstcharacter #1{\clf_getfirstcharacter{#1}}
\permanent\protected\def\doifelsefirstchar #1#2{\clf_doifelsefirstchar{#1}{#2}}
@@ -1133,7 +1169,7 @@
% \let\syst_helpers_do_do_if_in_string \relax
% \let\syst_helpers_do_do_if_not_in_string \relax
%
-% \let\m_syst_sub_string \empty
+% \lettonothing\m_syst_sub_string
%
% \protected\def\doifelseinstring#1%
% {\edef\m_syst_sub_string{#1}% expand #1 here
@@ -1201,7 +1237,7 @@
% \fi}%
% \normalexpanded{\syst_helpers_do_do_if_not_in_string#1}\s!e_o_t_token\ignorearguments\ignorearguments}
%
-% \def\syst_helpers_do_if_in_string_else_yes#0\ignorearguments\ignorearguments#2#0{#2}
+% \def\syst_helpers_do_if_in_string_else_yes#0\ignorearguments\ignorearguments#2#0{#2} % of #- and #1
% \def\syst_helpers_do_if_in_string_else_nop#0\ignorearguments#0#3{#3}
% \def\syst_helpers_do_if_in_string_yes #0\ignorearguments\ignorearguments#2{#2}
% \def\syst_helpers_do_if_in_string_nop #0\ignorearguments#0{}
@@ -1559,7 +1595,7 @@
%D funny to see that this alternative saw the light so lately --- can be used to do
%D expanded assigments.
-% \mutable\let\currentvalue\empty % only mkii
+% \mutable\lettonothing\currentvalue % only mkii
\permanent\protected\def\getparameters {\dogetparameters\dosetvalue}
\permanent\protected\def\geteparameters {\dogetparameters\dosetevalue}
@@ -1634,8 +1670,9 @@
%D trouble and tokens.
\mutable\let\currentassignmentlistcommand\gobbletwoarguments
-\mutable\let\currentassignmentlistkey \empty
-\mutable\let\currentassignmentlistvalue \empty
+
+\mutable\lettonothing\currentassignmentlistkey
+\mutable\lettonothing\currentassignmentlistvalue
\let\syst_helpers_process_assign_entry\gobbleoneargument
@@ -1650,13 +1687,13 @@
{\def\currentassignmentlistcommand##1##2{\def\currentassignmentlistkey{##1}\def\currentassignmentlistvalue{##2}#2}%
\processassignmentlist[#1]\currentassignmentlistcommand}
-\aliased\let\stopprocessassignmentlist\relax
+\permanent\protected\lettonothing\stopprocessassignmentlist
\permanent\protected\def\startprocessassignmentcommand[#1]#2\stopprocessassignmentcommand
{\def\currentassignmentlistcommand##1##2{\def\currentassignmentlistkey{##1}\def\currentassignmentlistvalue{##2}#2}%
\normalexpanded{\processassignmentlist[#1]}\currentassignmentlistcommand}
-\aliased\let\stopprocessassignmentcommand\relax
+\permanent\protected\lettonothing\stopprocessassignmentcommand
%D \macros
%D {currentvalue}
@@ -1753,13 +1790,13 @@
%D Afterwards, the length is available in the macro \type {\commalistsize}
%D (not a \COUNTER).
-\newcount\commalistcounter
+\newinteger\commalistcounter
\mutable\def\commalistsize{0}
\def\syst_helpers_get_comma_list_size#0,% no #- as we need to count
{\ifarguments\or
- \advance\commalistcounter\plusone
+ \advanceby\commalistcounter\plusone
\expandafter\syst_helpers_get_comma_list_size
\fi}
@@ -1778,6 +1815,18 @@
\permanent\protected\def\getcommacommandsize[#1]%
{\normalexpanded{\getcommalistsize[#1]}}
+\permanent\def\getcommalistcount[#1]%
+ {\beginlocalcontrol
+ \getcommalistsize[#1]%
+ \endlocalcontrol
+ \the\commalistcounter}
+
+\permanent\def\getcommacommandcount[#1]%
+ {\beginlocalcontrol
+ \getcommacommandsize[#1]%
+ \endlocalcontrol
+ \the\commalistcounter}
+
%D Filters:
% \def\syst_helpers_gobble_comma_list#0\ignorearguments{}
@@ -1786,7 +1835,7 @@
\def\syst_helpers_get_from_comma_list#1,%
{\ifarguments \or
- \advance\commalistcounter \minusone
+ \advanceby\commalistcounter \minusone
\ifcase\commalistcounter
\def\commalistelement{#1}%
\expandafter\expandafter\expandafter\syst_helpers_gobble_comma_list
@@ -1799,7 +1848,7 @@
{\expandafterspaces\syst_helpers_get_from_comma_list}
\permanent\protected\def\getfromcommalist[#1]#*[#2]%
- {\let\commalistelement\empty
+ {\lettonothing\commalistelement
\commalistcounter#2\relax
\expandafterspaces\syst_helpers_get_from_comma_list#1\ignorearguments\ignorearguments}
@@ -1905,7 +1954,7 @@
%D We use some signals for telling the calling macros if all wanted arguments are
%D indeed supplied by the user.
-\newcount\nofarguments
+\newinteger\nofarguments
\newif\iffirstargument
\newif\ifsecondargument
@@ -2780,8 +2829,8 @@
%D
%D Trivial:
-\permanent\protected\def\letempty #1{\let #1\empty}
-\permanent\protected\def\globalletempty#1{\glet#1\empty}
+\permanent\protected\def\letempty #1{\lettonothing #1}
+\permanent\protected\def\globalletempty#1{\glettonothing#1}
\permanent\protected\def\letvalueempty #1{\letcsname #1\endcsname\empty}
\permanent\protected\def\letgvalueempty#1{\gletcsname#1\endcsname\empty}
@@ -2905,7 +2954,7 @@
{\enforced\let\redoglobal\syst_helpers_redo_global
\enforced\let\dodoglobal\syst_helpers_dodo_global}
-%D Whatever (will be overtoaded):
+%D Whatever (will be overloaded):
\protected\def\define#1%
{\ifdefined#1%
@@ -2951,22 +3000,30 @@
%
% [\test]
+%D When okay the parameter hack will also go into \MKIV.
+
+\integerdef\c_syst_parameter_catcode\parametercatcode
+
\bgroup \obeylines
\permanent\protected\gdef\starttexdefinition%
- {\bgroup%
+ {\integerdef\c_syst_parameter_catcode\catcode\hashasciicode%
+ \catcode\hashasciicode\parametercatcode%
+ \bgroup%
\obeylines%
\syst_helpers_start_tex_definition}
\gdef\syst_helpers_start_tex_definition#1
- {\catcode\endoflineasciicode\ignorecatcode%
+ {%catcodetable\ctxcatcodes% can be adapted
+ \catcode\endoflineasciicode\ignorecatcode%
\clf_texdefinition_one{#1}}
-\aliased\glet\stoptexdefinition\relax
+\permanent\protected\glettonothing\stoptexdefinition
\permanent\gdef\dostarttexdefinition#1\stoptexdefinition%
{\egroup%
- \clf_texdefinition_two{#1}}
+ \clf_texdefinition_two{#1}%
+ \catcode\hashasciicode\c_syst_parameter_catcode}
\egroup
@@ -3072,11 +3129,11 @@
%D Signals old dimensions and can be used in skips, kerns and tests like \type
%D {\ifdim}.
-\newdimen\d_syst_maximum_signal % step is about 0.00025pt
+\newdimension\d_syst_maximum_signal % step is about 0.00025pt
\permanent\protected\def\newsignal#1%
{\ifdefined#1\else
- \advance\d_syst_maximum_signal2\scaledpoint % to be save in rounding
+ \advanceby\d_syst_maximum_signal2\scaledpoint % to be save in rounding
\immutable\dimensiondef#1\d_syst_maximum_signal
\fi}
@@ -3141,65 +3198,71 @@
%D We now use the macro stack which is somewhat leaner and meaner and a little
%D faster too.
-% left overs: too much \protected here
-
-\newcount\outerrecurse
-\newcount\innerrecurse
+\newinteger\outerrecurse
+\newinteger\innerrecurse
\mutable\def\recursedepth{\the\outerrecurse}
\mutable\def\recurselevel{0}
\mutable\let\recurseaction\relax
-\mutable\let\recursestring\empty
-
-% \let\syst_helpers_stepwise_next\relax
-
-% \protected\def\syst_helpers_stepwise_recurse#1#2#3% from to step
-% {\ifnum#1>#2\relax
-% \expandafter\syst_helpers_stepwise_recurse_nop
-% \else
-% \def\recurselevel{#1}%
-% \doubleexpandafter\syst_helpers_stepwise_recurse_yes\expandafter
-% \fi\expandafter{\the\numexpr\recurselevel+#3\relax}{#2}{#3}}
-
-\protected\def\syst_helpers_stepwise_recurse#1#2#3% from to step
- {\ifnum#1>#2\relax
- \expandafter\gobblefourarguments
- \else
- \def\recurselevel{#1}%
-% \doubleexpandafter\syst_helpers_stepwise_recurse_yes\expandafter
-% \fi\expandafter{\the\numexpr\recurselevel+#3\relax}{#2}{#3}}
- \doubleexpandafter\syst_helpers_stepwise_recurse_yes
- \fi\expandafter{\the\numexpr\recurselevel+#3\relax}{#2}{#3}}
-
-\protected\def\syst_helpers_stepwise_recurse_yes
- {\syst_helpers_recurse_content
- \syst_helpers_stepwise_recurse}
-
-\protected\def\syst_helpers_stepwise_reverse#1#2#3% from to step
- {\ifnum#1<#2\relax
-% \expandafter\syst_helpers_stepwise_recurse_nop
- \expandafter\gobblefourarguments
- \else
- \def\recurselevel{#1}%
- \innerrecurse#1\relax
- \advance\innerrecurse#3\relax
-% \doubleexpandafter\syst_helpers_stepwise_reverse_yes\expandafter
-% \fi\expandafter{\the\innerrecurse}{#2}{#3}}
- \doubleexpandafter\syst_helpers_stepwise_reverse_yes
- \fi\expandafter{\the\numexpr\recurselevel+#3\relax}{#2}{#3}}
-
-\protected\def\syst_helpers_stepwise_reverse_yes
- {\syst_helpers_recurse_content
- \syst_helpers_stepwise_reverse}
-% \protected\def\syst_helpers_stepwise_exit
-% {\syst_helpers_stepwise_recurse_nop\relax}
-
-\permanent\def\doexpandedrecurse#1#2% user macro (also was \doxprecurse)
- {\ifnum#1>\zerocount
- #2\expandafter\doexpandedrecurse\expandafter{\the\numexpr#1-\plusone\relax}{#2}%
- \fi}
+\mutable\lettonothing\recursestring
+
+%% \protected\def\syst_helpers_stepwise_recurse#1#2#3% from to step
+%% {\ifnum#1>#2\relax
+%% \expandafter\gobblefourarguments
+%% \else
+%% \def\recurselevel{#1}%
+%% \doubleexpandafter\syst_helpers_stepwise_recurse_yes
+%% \fi\expandafter{\the\numexpr\recurselevel+#3\relax}{#2}{#3}}
+%%
+%% \protected\def\syst_helpers_stepwise_recurse_yes
+%% {\syst_helpers_recurse_content
+%% \syst_helpers_stepwise_recurse}
+%%
+%% \protected\def\syst_helpers_stepwise_reverse#1#2#3% from to step
+%% {\ifnum#1<#2\relax
+%% \expandafter\gobblefourarguments
+%% \else
+%% \def\recurselevel{#1}%
+%% \innerrecurse#1\relax
+%% \advanceby\innerrecurse#3\relax
+%% \doubleexpandafter\syst_helpers_stepwise_reverse_yes
+%% \fi\expandafter{\the\numexpr\recurselevel+#3\relax}{#2}{#3}}
+%%
+%% \protected\def\syst_helpers_stepwise_reverse_yes
+%% {\syst_helpers_recurse_content
+%% \syst_helpers_stepwise_reverse}
+%%
+%% \permanent\def\doexpandedrecurse#1#2% user macro (also was \doxprecurse)
+%% {\ifnum#1>\zerocount
+%% #2\expandafter\doexpandedrecurse\expandafter{\the\numexpr#1-\plusone\relax}{#2}%
+%% \fi}
+
+%D The next one might replace the above and provides the current step in \type {#1}
+%D like \type {\dorecurse} do, but it comes with a tiny performance hit.
+
+%% \installsystemnamespace{expandedrecurse}
+%%
+%% \mutable\let\m_expanded_recursed\gobbleoneargument
+%%
+%% \permanent\def\doexpandedrecursed#1#2% this might replace: \doexpandedrecurse
+%% {\beginlocalcontrol
+%% \localpushmacro\m_expanded_recursed
+%% \def\m_expanded_recursed##1{#2}%
+%% \endlocalcontrol
+%% \syst_do_expanded_recursed{1}{#1}{#2}% no \plusone !
+%% \beginlocalcontrol
+%% \localpopmacro\m_expanded_recursed
+%% \endlocalcontrol}
+%%
+%% \def\syst_do_expanded_recursed#1#2#3%
+%% {\ifnum#1>#2\norelax
+%% \expandafter\gobblethreearguments
+%% \else
+%% \m_expanded_recursed{#1}\doubleexpandafter\syst_do_expanded_recursed
+%% \fi
+%% {\the\numexpr#1+\plusone\relax}{#2}{#3}}
%D As we can see here, the simple command \type{\dorecurse} is a special case of the
%D more general:
@@ -3218,31 +3281,31 @@
%D
%D Because the simple case (n=1) is used often, we implement it more efficiently:
-\permanent\protected\def\dorecurse#1%
- {\ifcase#1\relax
- \expandafter\gobbletwoarguments
- \or
- \expandafter\syst_helpers_recurse_y
- \else
- \expandafter\syst_helpers_recurse_x
- \fi{#1}}
-
-\protected\def\syst_helpers_recurse_indeed#1#2% from to
-% {\ifnum#1>#2 %
- {\ifnum#1>#2\relax
- \expandafter\syst_helpers_recurse_indeed_nop
- \else
- \def\recurselevel{#1}%
- \innerrecurse#1\advance\innerrecurse\plusone
- \doubleexpandafter\syst_helpers_recurse_indeed_yes
- \fi\expandafter{\the\innerrecurse}{#2}}
-
-\protected\def\syst_helpers_recurse_indeed_yes
- {\syst_helpers_recurse_content
- \syst_helpers_recurse_indeed}
-
-\protected\def\syst_helpers_recurse_indeed_nop#0#0#0%
- {}
+%% \permanent\protected\def\dorecurse#1%
+%% {\ifcase#1\relax
+%% \expandafter\gobbletwoarguments
+%% \or
+%% \expandafter\syst_helpers_recurse_y
+%% \else
+%% \expandafter\syst_helpers_recurse_x
+%% \fi{#1}}
+%%
+%% \protected\def\syst_helpers_recurse_indeed#1#2% from to
+%% % {\ifnum#1>#2 %
+%% {\ifnum#1>#2\relax
+%% \expandafter\syst_helpers_recurse_indeed_nop
+%% \else
+%% \def\recurselevel{#1}%
+%% \innerrecurse#1\advanceby\innerrecurse\plusone
+%% \doubleexpandafter\syst_helpers_recurse_indeed_yes
+%% \fi\expandafter{\the\innerrecurse}{#2}}
+%%
+%% \protected\def\syst_helpers_recurse_indeed_yes
+%% {\syst_helpers_recurse_content
+%% \syst_helpers_recurse_indeed}
+%%
+%% \protected\def\syst_helpers_recurse_indeed_nop#0#0#0%
+%% {}
%D \macros
%D {dowith}
@@ -3278,7 +3341,7 @@
\aliased\let\endofloop\donothing % maybe \syst_helpers_loop_end
\permanent\protected\def\doloop#1%
- {\global\advance\outerrecurse \plusone
+ {\global\advanceby\outerrecurse \plusone
\globalpushmacro\recurseaction
\globalpushmacro\recurselevel
\protected\gdef\recurseaction##1##2{#1}%
@@ -3289,20 +3352,24 @@
{\def\recurselevel{#1}%
\expandafter\syst_helpers_loop_yes\expandafter{\the\numexpr\recurselevel+\plusone\relax}}
+%% \protected\def\syst_helpers_loop_yes
+%% {\syst_helpers_recurse_content
+%% \endofloop}
+
\protected\def\syst_helpers_loop_yes
- {\syst_helpers_recurse_content
+ {\normalexpanded{\recurseaction{\recurselevel}{\the\outerrecurse}}%
\endofloop}
-\protected\def\syst_helpers_loop_nop#0%
+\protected\def\syst_helpers_loop_nop#-%
{\enforced\let\endofloop\syst_helpers_loop
\globalpopmacro\recurselevel
\globalpopmacro\recurseaction
- \global\advance\outerrecurse\minusone}
+ \global\advanceby\outerrecurse\minusone}
\permanent\protected\def\exitloop % \exitloop quits at end
{\enforced\let\endofloop\syst_helpers_loop_nop}
-\permanent\protected\def\exitloopnow#0\endofloop % \exitloopnow quits directly
+\permanent\protected\def\exitloopnow#-\endofloop % \exitloopnow quits directly
{\syst_helpers_loop_nop}
%D The loop is executed at least once, so beware of situations like:
@@ -3340,81 +3407,54 @@
%D \dorecurse{3}{\expanded{\definesymbol[test-\recurselevel][xx-\recurselevel]}}
%D \stoptyping
-\def\syst_helpers_recurse_content
- {\normalexpanded{\recurseaction{\recurselevel}{\the\outerrecurse}}}
-
-\protected\def\syst_helpers_recurse_x#1#2%
- {\global\advance\outerrecurse\plusone
- \globalpushmacro\recurseaction
- \globalpushmacro\recurselevel
- \protected\gdef\recurseaction##1##2{#2}%
- \expandafter\syst_helpers_recurse_indeed\expandafter1\expandafter{\number#1}%
- \globalpopmacro\recurselevel
- \globalpopmacro\recurseaction
- \global\advance\outerrecurse\minusone}
-
-\protected\def\syst_helpers_recurse_y#1#2%
- {\global\advance\outerrecurse\plusone
- \globalpushmacro\recurseaction
- \globalpushmacro\recurselevel
- \let\recurselevel\!!plusone
- \protected\gdef\recurseaction##1##2{#2}%
- \syst_helpers_recurse_content
- \globalpopmacro\recurselevel
- \globalpopmacro\recurseaction
- \global\advance\outerrecurse\minusone}
-
-% \protected\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4
-% {\global\advance\outerrecurse \plusone
-% \globalpushmacro\recurseaction
-% \globalpushmacro\recurselevel
-% \protected\gdef\recurseaction##1##2{#4}%
-% \normalexpanded{\ifcmpnum#3\zerocount
-% \ifnum#1<#2\relax\relax % so we catch \number\numexpr xx without \relax's
-% \syst_helpers_stepwise_exit
-% \else
-% \syst_helpers_stepwise_reverse
-% \fi
-% \or
-% \syst_helpers_stepwise_exit
-% \or
-% \ifnum#2<#1\relax\relax % so we catch \number\numexpr xx without \relax's
-% \syst_helpers_stepwise_exit
-% \else
-% \syst_helpers_stepwise_recurse
-% \fi
-% \fi{\number#1}{\number#2}{\number#3}}%
-% \globalpopmacro\recurselevel
-% \globalpopmacro\recurseaction
-% \global\advance\outerrecurse\minusone}
-
-\permanent\protected\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4 ... todo: remove unused helpers
- {\global\advance\outerrecurse \plusone
- \globalpushmacro\recurseaction
- \globalpushmacro\recurselevel
- \protected\gdef\recurseaction##1##2{#4}%
- \normalexpanded{\ifcmpnum#3\zerocount
- \ifnum#1<#2\relax\relax % so we catch \number\numexpr xx without \relax's
- \doubleexpandafter\gobbletwoarguments
- \else
- \tripleexpandafter\syst_helpers_stepwise_reverse
- \fi
- \or
- \doubleexpandafter\gobbletwoarguments
- \orelse\ifnum#2<#1\relax\relax % so we catch \number\numexpr xx without \relax's
- \doubleexpandafter\gobbletwoarguments
- \else
- \doubleexpandafter\syst_helpers_stepwise_recurse
- \fi\normalexpanded{{\number#1}{\number#2}{\number#3}}}%
- \globalpopmacro\recurselevel
- \globalpopmacro\recurseaction
- \global\advance\outerrecurse\minusone}
-
-% \protected\def\syst_helpers_stepwise_recurse_nop#0#0#0#0%
-% {}
-
-\newcount\fastloopindex
-\newcount\fastloopfinal
+%% \def\syst_helpers_recurse_content
+%% {\normalexpanded{\recurseaction{\recurselevel}{\the\outerrecurse}}}
+%%
+%% \protected\def\syst_helpers_recurse_x#1#2%
+%% {\global\advanceby\outerrecurse\plusone
+%% \globalpushmacro\recurseaction
+%% \globalpushmacro\recurselevel
+%% \protected\gdef\recurseaction##1##2{#2}%
+%% \expandafter\syst_helpers_recurse_indeed\expandafter1\expandafter{\number#1}%
+%% \globalpopmacro\recurselevel
+%% \globalpopmacro\recurseaction
+%% \global\advanceby\outerrecurse\minusone}
+%%
+%% \protected\def\syst_helpers_recurse_y#1#2%
+%% {\global\advanceby\outerrecurse\plusone
+%% \globalpushmacro\recurseaction
+%% \globalpushmacro\recurselevel
+%% \let\recurselevel\!!plusone
+%% \protected\gdef\recurseaction##1##2{#2}%
+%% \syst_helpers_recurse_content
+%% \globalpopmacro\recurselevel
+%% \globalpopmacro\recurseaction
+%% \global\advanceby\outerrecurse\minusone}
+%%
+%% \permanent\protected\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4 ... todo: remove unused helpers
+%% {\global\advanceby\outerrecurse \plusone
+%% \globalpushmacro\recurseaction
+%% \globalpushmacro\recurselevel
+%% \protected\gdef\recurseaction##1##2{#4}%
+%% \normalexpanded{\ifcmpnum#3\zerocount
+%% \ifnum#1<#2\relax\relax % so we catch \number\numexpr xx without \relax's
+%% \doubleexpandafter\gobbletwoarguments
+%% \else
+%% \tripleexpandafter\syst_helpers_stepwise_reverse
+%% \fi
+%% \or
+%% \doubleexpandafter\gobbletwoarguments
+%% \orelse\ifnum#2<#1\relax\relax % so we catch \number\numexpr xx without \relax's
+%% \doubleexpandafter\gobbletwoarguments
+%% \else
+%% \doubleexpandafter\syst_helpers_stepwise_recurse
+%% \fi\normalexpanded{{\number#1}{\number#2}{\number#3}}}%
+%% \globalpopmacro\recurselevel
+%% \globalpopmacro\recurseaction
+%% \global\advanceby\outerrecurse\minusone}
+
+\newinteger\fastloopindex
+\newinteger\fastloopfinal
\let\m_syst_helpers_fast_loop_cs\relax
@@ -3436,10 +3476,71 @@
\let\m_syst_helpers_fast_loop_cs\relax
\else
\m_syst_helpers_fast_loop_cs
- \advance\fastloopindex\plusone
+ \advanceby\fastloopindex\plusone
\expandafter\syst_helpers_fast_loop_cs_step
\fi}
+%D Here are the more modern implementations:
+
+\permanent\protected\def\installmacrostack#1%
+ {\ifdefined#1\else\mutable\lettonothing#1\fi
+ \protected\gdefcsname push_macro_\csstring#1\endcsname{\localpushmacro#1}%
+ \protected\gdefcsname pop_macro_\csstring#1\endcsname{\localpopmacro #1}}
+
+\permanent\protected\def\installglobalmacrostack#1%
+ {\ifdefined#1\else\mutable\glettonothing#1\fi
+ \protected\gdefcsname push_macro_\csstring#1\endcsname{\globalpushmacro#1}%
+ \protected\gdefcsname pop_macro_\csstring#1\endcsname{\globalpopmacro #1}}
+
+% \showmacrostack can be used to see if there are different entries
+
+\installglobalmacrostack \recurseaction
+\installglobalmacrostack \recurselevel
+\installglobalmacrostack \recursedepth
+
+\permanent\protected\def\dostepwiserecurse#1#2#3#4%
+ {\push_macro_recurseaction
+ \push_macro_recurselevel
+ \push_macro_recursedepth
+ \protected\gdef\recurseaction##1##2{#4}%
+ \localcontrolledloop=#1=#2=#3%
+ {\edef\recurselevel{\the\currentloopiterator}%
+ \edef\recursedepth{\the\currentloopnesting}%
+ \normalexpanded{\recurseaction{\recurselevel}{\recursedepth}}}%
+ \pop_macro_recursedepth
+ \pop_macro_recurselevel
+ \pop_macro_recurseaction}
+
+\permanent\protected\def\dorecurse#1#2%
+ {\push_macro_recurseaction
+ \push_macro_recurselevel
+ \push_macro_recursedepth
+ \protected\gdef\recurseaction##1##2{#2}%
+ \localcontrolledloop=\plusone=#1=\plusone
+ {\edef\recurselevel{\the\currentloopiterator}%
+ \edef\recursedepth{\the\currentloopnesting}%
+ \normalexpanded{\recurseaction{\recurselevel}{\recursedepth}}}%
+ \pop_macro_recursedepth
+ \pop_macro_recurselevel
+ \pop_macro_recurseaction}
+
+\permanent\def\doexpandedrecurse#1#2% user macro (also was \doxprecurse)
+ {\expandedloop\plusone#1\plusone{#2}}
+
+\mutable\let\m_expanded_recursed\gobbleoneargument
+
+\installmacrostack\m_expanded_recursed
+
+\permanent\def\doexpandedrecursed#1#2% this might replace: \doexpandedrecurse
+ {\beginlocalcontrol
+ \push_macro_m_expanded_recursed
+ \def\m_expanded_recursed##1{#2}%
+ \endlocalcontrol
+ \expandedloop\plusone#1\plusone{\expandafter\m_expanded_recursed\expandafter{\the\currentloopiterator}}%
+ \beginlocalcontrol
+ \pop_macro_m_expanded_recursed
+ \endlocalcontrol}
+
% Helper:
\permanent\protected\def\resetrecurselevel{\let\recurselevel\!!zerocount}
@@ -3472,14 +3573,14 @@
%D \stoptyping
\permanent\protected\def\doloopoverlist#1#2%
- {\global\advance\outerrecurse\plusone
+ {\global\advanceby\outerrecurse\plusone
\globalpushmacro\recurseaction
\globalpushmacro\recursestring
\protected\gdef\recurseaction##1{\edef\recursestring{##1}#2}%
\processcommacommand[#1]\recurseaction
\globalpopmacro\recursestring
\globalpopmacro\recurseaction
- \global\advance\outerrecurse\minusone}
+ \global\advanceby\outerrecurse\minusone}
%D This is some \LMTX\ experiment:
%D
@@ -3987,18 +4088,18 @@
\m_syst_helpers_handle_group_b}
\def\syst_helpers_handle_group_nop_b
- {\bgroup
+ {\beginsimplegroup
\aftergroup\m_syst_helpers_handle_group_a
\aftergroup\egroup
\m_syst_helpers_handle_group_b}
\protected\def\syst_helpers_handle_group_normal
- {\bgroup
+ {\beginsimplegroup
\afterassignment\m_syst_helpers_handle_group_normal_before
\let\next=}
\def\m_syst_helpers_handle_group_normal_before
- {\bgroup
+ {\beginsimplegroup
\m_syst_helpers_handle_group_b
\bgroup
\aftergroup\m_syst_helpers_handle_group_a
@@ -4006,26 +4107,26 @@
\aftergroup\egroup}
\protected\def\syst_helpers_handle_group_simple% no inner group (so no kerning interference)
- {\bgroup
+ {\beginsimplegroup
\afterassignment\m_syst_helpers_handle_group_simple_before
\let\next=}
\def\m_syst_helpers_handle_group_simple_before
- {\bgroup
+ {\beginsimplegroup
\aftergroup\m_syst_helpers_handle_group_simple_after
\m_syst_helpers_handle_group_b}
\def\m_syst_helpers_handle_group_simple_after
{\m_syst_helpers_handle_group_a
- \egroup}%
+ \egroup}
\protected\def\syst_helpers_handle_group_pickup% no inner group (so no kerning interference)
- {\bgroup
+ {\beginsimplegroup
\afterassignment\m_syst_helpers_handle_group_pickup_before
\let\next=}
\def\m_syst_helpers_handle_group_pickup_before
- {\bgroup
+ {\beginsimplegroup
\aftergroup\m_syst_helpers_handle_group_a
\aftergroup\egroup
\aftergroup\m_syst_helpers_handle_group_p
@@ -4036,20 +4137,20 @@
\begingroup
\aftergroup\endgroup
\else
- \bgroup
+ \beginsimplegroup
\aftergroup\egroup
\fi
\m_syst_helpers_handle_group_b}
\protected\def\syst_helpers_handle_group_normal_x
- {\bgroup
+ {\beginsimplegroup
\afterassignment\m_syst_helpers_handle_group_normal_before_x
\let\next=}
\def\m_syst_helpers_handle_group_normal_before_x
- {\bgroup
- \m_syst_helpers_handle_group_b
- \bgroup
+ {\beginsimplegroup
+ \expandafter\m_syst_helpers_handle_group_b
+ \ifmmode\beginsimplegroup\else\bgroup\fi % is this save enough? also the other ones?
\aftergroup\egroup
\aftergroup\egroup}
@@ -4079,12 +4180,23 @@
\def\m_syst_helpers_handle_group_a{#2}%
\futureexpandis\bgroup\syst_helpers_handle_group_simple\syst_helpers_handle_group_nop}
+\permanent\protected\def\simplegroupedcommandcs#1#2%
+ {\let\m_syst_helpers_handle_group_b#1%
+ \let\m_syst_helpers_handle_group_a#2%
+ \futureexpandis\bgroup\syst_helpers_handle_group_simple\syst_helpers_handle_group_nop}
+
\permanent\protected\def\pickupgroupedcommand#1#2#3%
{\def\m_syst_helpers_handle_group_b{#1}%
\def\m_syst_helpers_handle_group_a{#2}%
\def\m_syst_helpers_handle_group_p{#3}%
\futureexpandis\bgroup\syst_helpers_handle_group_pickup\syst_helpers_handle_group_nop}
+\permanent\protected\def\pickupgroupedcommandcs#1#2#3%
+ {\let\m_syst_helpers_handle_group_b#1%
+ \let\m_syst_helpers_handle_group_a#2%
+ \let\m_syst_helpers_handle_group_p#3%
+ \futureexpandis\bgroup\syst_helpers_handle_group_pickup\syst_helpers_handle_group_nop}
+
\permanent\protected\def\triggergroupedcommand#1%
{\def\m_syst_helpers_handle_group_b{#1}%
\futureexpandis\bgroup\syst_helpers_handle_group_normal_x\syst_helpers_handle_group_nop_x}
@@ -4103,6 +4215,21 @@
%D {\groupedcommand{\raggedcenter\bf}{\par}}
%D \stoptyping
+%D For math we use this:
+
+\permanent\protected\def\mathgroupedcommandcs#1%
+ {\let\m_syst_helpers_handle_group_b#1%
+ \futureexpandis\bgroup\syst_helpers_handle_math_group_normal\syst_helpers_handle_math_group_nop}
+
+\protected\def\syst_helpers_handle_math_group_normal#1%
+ {\beginmathgroup
+ \m_syst_helpers_handle_group_b
+ #1%
+ \endmathgroup}
+
+\protected\def\syst_helpers_handle_math_group_nop
+ {\m_syst_helpers_handle_group_b}
+
% %D \macros
% %D {checkdefined}
% %D
@@ -4176,15 +4303,21 @@
\let\syst_helpers_par_before\relax
\let\syst_helpers_par_around\relax
+% \permanent\protected\def\dowithpar#1#2%
+% {\globalpushmacro\syst_helpers_par_around
+% \def\syst_helpers_par_around##1\par{#1##1#2\globalpopmacro\syst_helpers_par_around}%
+% \expandafter\syst_helpers_par_around\ignorepars}
+
+% \permanent\protected\def\dogotopar#1%
+% {\globalpushmacro\syst_helpers_par_before
+% \def\syst_helpers_par_before{#1\globalpopmacro\syst_helpers_par_before}%
+% \expandafter\syst_helpers_par_before\ignorepars}
+
\permanent\protected\def\dowithpar#1#2%
- {\globalpushmacro\syst_helpers_par_around
- \def\syst_helpers_par_around##1\par{#1##1#2\globalpopmacro\syst_helpers_par_around}%
- \expandafter\syst_helpers_par_around\ignorepars}
+ {\begingroup\aftergrouped{#1\dontleavehmode\wrapuppar{#2}}\expandafter\endgroup\ignorepars}
\permanent\protected\def\dogotopar#1%
- {\globalpushmacro\syst_helpers_par_before
- \def\syst_helpers_par_before{#1\globalpopmacro\syst_helpers_par_before}%
- \expandafter\syst_helpers_par_before\ignorepars}
+ {\begingroup\aftergrouped{#1}\expandafter\endgroup\ignorepars}
\aliased\let\dogotoparcs\dogotopar
@@ -4371,7 +4504,8 @@
%D These macros are clones of the ones implemented in page~378 of Knuth's \TEX book.
\newtoks\t_syst_helpers_scratch
-\let \m_syst_helpers_scratch\empty
+
+\lettonothing\m_syst_helpers_scratch
\permanent\protected\def\appendtoks#1\to#2%
{\ifrelax\dodoglobal
@@ -4431,8 +4565,8 @@
\newtoks \collectingtoks
-\aliased\let\stopcollect \relax
-\aliased\let\stopexpandedcollect\relax
+\permanent\protected\lettonothing\stopcollect
+\permanent\protected\lettonothing\stopexpandedcollect
\permanent\protected\def\startcollect #1\stopcollect {\toksapp \collectingtoks{#1}}
\permanent\protected\def\startexpandedcollect#1\stopexpandedcollect{\etoksapp\collectingtoks{#1}}
@@ -4507,9 +4641,9 @@
\permanent\protected\def\beforesplitstring#1\at#2\to#3%
{\def\syst_helpers_split_string##1#2##0^^^^0004% no #- as we need to count
{\ifarguments
- \let#3\empty
+ \lettonothing#3%
\or
- \let#3\empty
+ \lettonothing#3%
\else
\def#3{##1}%
\fi}%
@@ -4518,7 +4652,7 @@
\permanent\protected\def\aftersplitstring#1\at#2\to#3%
{\def\syst_helpers_split_string##0#2##2^^^^0004% no #- as we need to count
{\ifarguments
- \let#3\empty
+ \lettonothing#3%
\or
\def#3{#1}%
\else
@@ -4534,11 +4668,11 @@
\permanent\protected\def\splitstring#1\at#2\to#3\and#4%
{\def\syst_helpers_split_string##1#2##2^^^^0004%
{\ifarguments
- \let#3\empty
- \let#4\empty
+ \lettonothing#3*
+ \lettonothing#4*
\or
\def#3{#1}%
- \let#4\empty
+ \lettonothing#4%
\else
\def#3{##1}%
\def#4{##2}%
@@ -4548,11 +4682,11 @@
\permanent\protected\def\greedysplitstring#1\at#2\to#3\and#4%
{\def\syst_helpers_split_string##1#2##2^^^^0004%
{\ifarguments
- \let#3\empty
- \let#4\empty
+ \lettonothing#3%
+ \lettonothing#4%
\or
\def#3{#1}%
- \let#4\empty
+ \lettonothing#4%
\else
\def#3{##1}%
\def#4{##2}%
@@ -4578,9 +4712,9 @@
\permanent\protected\def\aftertestandsplitstring#1\at#2\to#3%
{\def\syst_helpers_split_string##0#2##2^^^^0004% no #- as we need to count
{\ifarguments
- \let#3\empty
+ \lettonothing#3%
\or
- \let#3\empty
+ \lettonothing#3%
\else
\def#3{##2}%
\fi}%
@@ -4589,11 +4723,11 @@
\permanent\protected\def\testandsplitstring#1\at#2\to#3\and#4%
{\def\syst_helpers_split_string##1#2##2^^^^0004%
{\ifarguments
- \let#3\empty
- \let#4\empty
+ \lettonothing#3%
+ \lettonothing#4%
\or
- \let#3\empty
- \let#4\empty
+ \lettonothing#3%
+ \lettonothing#4%
\else
\def#3{##1}%
\def#4{##2}%
@@ -4627,8 +4761,8 @@
%D Which in terms of \TEX\ looks like:
\permanent\protected\def\removesubstring#1\from#2\to#3%
- {\splitstring#2\to\m_syst_string_one\and\m_syst_string_two
- \dodoglobal#3{\m_syst_string_one\m_syst_string_two}}
+ {\splitstring#2\at#1\to\m_syst_string_one\and\m_syst_string_two
+ \dodoglobal\def#3{\m_syst_string_one\m_syst_string_two}}
%D \macros
%D {appendtocommalist,prependtocommalist,
@@ -4754,7 +4888,7 @@
\permanent\protected\def\substituteincommalist#1#2#3% old, new, list (slooow)
{\edef\m_syst_string_one{#1}%
\edef\m_syst_string_two{#2}%
- \let\m_syst_string_four\empty
+ \lettonothing\m_syst_string_four
\normalexpanded{\rawprocesscommacommand[#3]}\syst_helpers_substitute_in_comma_list_step
\let#3\m_syst_string_four}
@@ -4780,10 +4914,11 @@
%D
%D This macro was used in the bibtex code (and is probably no longer needed).
-\newcount\c_syst_helpers_comma_list_index
-\let \m_syst_helpers_comma_list_target\empty
+\newinteger\c_syst_helpers_comma_list_index
+
+\lettonothing\m_syst_helpers_comma_list_target
-\mutable\let\newcommalistelement\empty
+\mutable\lettonothing\newcommalistelement
\def\syst_helpers_replace_in_comma_list_step#1% we can use #+ here too
{\ifnum\commalistcounter=\c_syst_helpers_comma_list_index\relax
@@ -4812,12 +4947,12 @@
\fi
\fi
\fi
- \advance\commalistcounter\plusone}
+ \advanceby\commalistcounter\plusone}
\permanent\protected\def\replaceincommalist#1#2% #1 = commalistelement #2 = position starts at 1
{\c_syst_helpers_comma_list_index#2\relax
- \let\m_syst_helpers_comma_list_target\empty
- \let\commalistelement\empty
+ \lettonothing\m_syst_helpers_comma_list_target
+ \lettonothing\commalistelement
\commalistcounter\plusone
\expandafter\processcommalist\expandafter[#1]\syst_helpers_replace_in_comma_list_step
\dodoglobal\let#1\m_syst_helpers_comma_list_target}
@@ -4830,7 +4965,7 @@
%D kind of useless for handling comma lists in alignments. In these situations the
%D next macro can be of use.
-\let\m_syst_helpers_comma_list_command_global\empty
+\lettonothing\m_syst_helpers_comma_list_command_global
\def\syst_helpers_comma_list_command_global_step#1,%
{\if]#1\else
@@ -4867,7 +5002,9 @@
% that \TEX\ was written, it made no sense to add a lot of that. After decades we know
% what extras we need.
-\permanent\def\withoutpt#1{\thewithoutunit\dimexpr#1} % best use the primitive directly
+% \permanent\def\withoutpt#1{\thewithoutunit\dimexpr#1}
+
+\aliased\let\withoutpt\toscaled
%D The capitals are needed because \type {p} and \type {t} have catcode~12, while
%D macronames only permit tokens with the catcode~11. As a result we cannot use the
@@ -4875,10 +5012,9 @@
%D manipulations, we advice to study the \TEX book in detail. Because this macro
%D does not do any assignment, we can use it in the following way too.
-% \def\PtToCm#1%
-% {\withoutpt\the\dimexpr0.0351459804\dimexpr#1\relax\relax cm}
+% \permanent\def\PtToCm#1{\thewithoutunit\dimexpr0.0351459804\dimexpr#1\relax\relax cm}
-\permanent\def\PtToCm#1{\thewithoutunit\dimexpr0.0351459804\dimexpr#1\relax\relax cm}
+\permanent\def\PtToCm#1{\toscaled\dimexpr0.0351459804\dimexpr#1\relax\relax cm}
%D We also support:
%D
@@ -4902,10 +5038,10 @@
%D Simple but effective are the next two macros. There name exactly states their
%D purpose.
-\newdimen\d_syst_helpers_swapped
-\newskip \s_syst_helpers_swapped
-\newcount\c_syst_helpers_swapped
-\let \m_syst_helpers_swapped\relax
+\newdimension\d_syst_helpers_swapped
+\newgluespec \s_syst_helpers_swapped
+\newinteger \c_syst_helpers_swapped
+\let \m_syst_helpers_swapped\relax
% \protected\def\swapdimens#1#2{\d_syst_helpers_swapped#1#1#2#2\d_syst_helpers_swapped}
% \protected\def\swapskips #1#2{\s_syst_helpers_swapped#1#1#2#2\s_syst_helpers_swapped}
@@ -4956,7 +5092,7 @@
%D These examples show us that an optional can be used. The value provided is added
%D to \type {\localhsize}.
-\newdimen\localhsize
+\newdimension\localhsize
\permanent\protected\def\setlocalhsize % don't change !
{\doifelsenextoptional
@@ -4968,7 +5104,7 @@
\def\syst_helpers_set_local_hsize_yes[#1]%
{\syst_helpers_set_local_hsize_nop
- \advance\localhsize#1\relax}
+ \advanceby\localhsize#1\relax}
\permanent\def\availablehsize
{\dimexpr
@@ -5238,14 +5374,15 @@
%D As we can see below, spaces following a control sequence are to enclosed in \type
%D {{}}.
-\let\syst_helpers_strip_character \relax
-\let\m_syst_helpers_strip_character\empty
+\let\syst_helpers_strip_character\relax
+
+\lettonothing\m_syst_helpers_strip_character
\permanent\protected\def\stripcharacter#1\from#2\to#3%
{\def\syst_helpers_strip_character##1#1##2\end
{\edef\m_syst_helpers_strip_character{\m_syst_helpers_strip_character##1}%
\doifnotempty{##2}{\syst_helpers_strip_character##2\end}}%
- \let\m_syst_helpers_strip_character\empty
+ \lettonothing\m_syst_helpers_strip_character
\edef\m_syst_string_one{#2}%
\expandafter\syst_helpers_strip_character\m_syst_string_one#1\end
\dodoglobal\let#3\m_syst_helpers_strip_character}
@@ -5476,7 +5613,7 @@
%D
%D They remove braces and backslashes and give us something to sort.
-\let\m_syst_helpers_untexed\empty
+\lettonothing\m_syst_helpers_untexed
\permanent\protected\def\untexsomething
{\begingroup
@@ -5523,11 +5660,9 @@
%D \PointsToReal {dimension} \target
%D \stoptyping
-% \protected\def\PointsToReal#1#2%
-% {\edef#2{\withoutpt\the\dimexpr#1}}
+% \permanent\protected\def\PointsToReal#1#2{\edef#2{\thewithoutunit\dimexpr#1}}
-\permanent\protected\def\PointsToReal#1#2%
- {\edef#2{\thewithoutunit\dimexpr#1}}
+\permanent\protected\def\PointsToReal#1#2{\edef#2{\toscaled#1}}
%D \macros
%D {dontleavehmode}
@@ -5630,7 +5765,7 @@
{\def\m_syst_string_three{#1}%
\ifx\m_syst_string_two\m_syst_string_three \else
\ifx\m_syst_string_one\m_syst_string_three
- \advance\privatescratchcounter\plusone
+ \advanceby\privatescratchcounter\plusone
\fi
\expandafter\syst_helpers_count_token
\fi}
@@ -5644,7 +5779,7 @@
\permanent\protected\def\counttokens#1\to#2%
{\privatescratchcounter\zerocount
- \def\syst_helpers_count_token##1{\advance\privatescratchcounter\plusone}%
+ \def\syst_helpers_count_token##1{\advanceby\privatescratchcounter\plusone}%
\handletokens#1\with\syst_helpers_count_token
\dodoglobal#2\privatescratchcounter}
@@ -5661,10 +5796,10 @@
\privatescratchcounter#1\relax
\def\syst_helpers_split_off_tokens##1%
{\ifnum\privatescratchcounter>\zerocount
- \advance\privatescratchcounter \minusone
+ \advanceby\privatescratchcounter \minusone
\edef#3{#3##1}%
\fi}%
- % \let#3\empty % #3 can be #2, so:
+ % \lettonothing#3% #3 can be #2, so:
\expandafter\let\expandafter#3\expandafter\empty
\expandafter\handletokens#2\with\syst_helpers_split_off_tokens
\else
@@ -5700,7 +5835,7 @@
%D assignment, this time by using \type {\futurelet}, and grabbing an argument as
%D well. That way we can handle the sentinal, a blank space and grouped tokens.
-\mutable\let\nexthandledtoken\empty % part of public interface
+\mutable\lettonothing\nexthandledtoken % part of public interface
\let\syst_helpers_handle_tokens_command\relax
@@ -5785,14 +5920,30 @@
%D {\processcontent{stophans}\test{\message{\test}\wait}}
%D \stoptyping
-\permanent\protected\def\processcontent#1%
- {\begingroup\expandafter\syst_helpers_process_content\csname#1\endcsname}
+% \starttabulate[|||]
+% \NC \type{#} \NC # \NC \NR
+% \stoptabulate
+%
+% \def\test#1%
+% {\starttabulate[|||]
+% \NC \type{#1} \NC #1 \NC \NR
+% \stoptabulate}
+%
+% \test{!}
+
+%% \permanent\protected\def\processcontent#1%
+%% {\begingroup\expandafter\syst_helpers_process_content\csname#1\endcsname}
\protected\def\syst_helpers_process_content#1#2#3%
{\protected\def\syst_helpers_process_content##1#1%
{\endgroup\def#2{##1}#3}%
\syst_helpers_process_content}
+\permanent\protected\def\processcontent#1%
+ {\begingroup
+ \catcode\hashasciicode\othercatcode
+ \expandafter\syst_helpers_process_content\csname#1\endcsname}
+
%D \macros
%D {dogobblesingleempty, dogobbledoubleempty}
%D
@@ -5814,7 +5965,7 @@
%D \setdimensionwithunit\scratchdimen{10cm}{cm}
%D \setdimensionwithunit\scratchdimen{10cm}{}
%D \freezedimensionwithunit\SomeWidth{\textwidth}
-%D \freezedimensionwithunit\SomeDepth{\dp\strutbox}
+%D \freezedimensionwithunit\SomeDepth{\strutdp}
%D \stoptyping
%D
%D As an alternative for the next macro we can use a global assignment inside a box.
@@ -5914,13 +6065,13 @@
\let\syst_helpers_serialize_comma_list_step\relax
-\mutable\let\serializedcommalist\empty
+\mutable\lettonothing\serializedcommalist
\def\syst_helpers_serialize_comma_list_step#1%
{\edef\serializedcommalist{\serializedcommalist#1}}
\permanent\protected\def\serializecommalist[#1]%
- {\let\serializedcommalist\empty
+ {\lettonothing\serializedcommalist
\processcommacommand[#1]\syst_helpers_serialize_comma_list_step}
%D \macros
@@ -5953,7 +6104,7 @@
% can be sped up with ignored arguments
\def\syst_filter_from_next_yes#1%
- {\advance\scratchcounterone\plusone
+ {\advanceby\scratchcounterone\plusone
\ifnum\scratchcounterone=\scratchcountertwo
\scratchtoks{#1}%
\fi
@@ -6039,10 +6190,10 @@
%D This one can be used inside a measure (used in m4all):
%D
%D \starttyping
-%D \definemeasure[columnwidth][\dividedsize\textwidth{1em}{3}]
+%D \definemeasure[columnwidth][\dividebydsize\textwidth{1em}{3}]
%D \stoptyping
-\permanent\def\dividedsize#1#2#3% size gap n
+\permanent\def\dividebydsize#1#2#3% size gap n
{\dimexpr
\ifnum\dimexpr#1\relax>\plusone
(\dimexpr#1\relax-\numexpr#3-\plusone\relax\dimexpr#2\relax)/#3\else#1%
@@ -6088,8 +6239,8 @@
%D
%D We no longer use the \MKIV\ dirty trick. These are obsolete anyway.
-\newdimen \roundingeps \roundingeps=10sp
-\newconstant\compresult
+\newdimension\roundingeps \roundingeps=10sp
+\newconstant \compresult
\permanent\protected\def\comparedimension#1#2%
{\compresult
@@ -6230,24 +6381,26 @@
%D Sort of obsolete:
-\newcount\c_syst_helpers_mod
+\newinteger\c_syst_helpers_mod
\permanent\protected\def\dosetmodulo#1#2#3%
- {\c_syst_helpers_mod#1\divide\c_syst_helpers_mod#2\multiply\c_syst_helpers_mod#2%
- #3#1\advance#3-\c_syst_helpers_mod}
+ {\c_syst_helpers_mod#1\divideby\c_syst_helpers_mod#2\multiplyby\c_syst_helpers_mod#2%
+ #3#1\advanceby#3-\c_syst_helpers_mod}
\permanent\protected\def\dosetdivision#1#2#3%
- {#3#1\divide#3 #2\relax}
+ {#3#1\divideby#3 #2\relax}
\permanent\protected\def\DoMod#1by#2to#3{\dosetmodulo {#1}{#2}{#3}}
\permanent\protected\def\DoDiv#1by#2to#3{\dosetdivision{#1}{#2}{#3}}
-\def\syst_helpers_unprotected#1\par
- {#1\protect}
+%D This is obsolete, just use \type {\unprotect} and \type {\protect} instead.
-\permanent\protected\def\unprotected
- {\unprotect
- \syst_helpers_unprotected}
+% \def\syst_helpers_unprotected#1\par
+% {#1\protect}
+%
+% \permanent\protected\def\unprotected
+% {\unprotect
+% \syst_helpers_unprotected}
\aliased\let\resettimer \clf_resettimer % todo: at lua end
\aliased\let\elapsedtime \clf_elapsedtime % todo: at lua end
@@ -6258,8 +6411,8 @@
\permanent\protected\def\elapsedsteptime % unexpanded ! a bit useless but who knows ...
{\clf_elapsedsteptime\elapsedsteps\relax}
-\newcount\c_syst_helpers_test_feature_n
-\newcount\c_syst_helpers_test_feature_m
+\newinteger\c_syst_helpers_test_feature_n
+\newinteger\c_syst_helpers_test_feature_m
\let\syst_helpers_test_feature_yes\relax
\let\syst_helpers_test_feature_nop\relax
@@ -6267,15 +6420,15 @@
\permanent\def\currentfeaturetest{\number\c_syst_helpers_test_feature_n}
\permanent\protected\def\testfeature#1#2%
- {\c_syst_helpers_test_feature_m#1\relax
+ {\c_syst_helpers_test_feature_m\ifparameter#1\or#1\else\maxiterator\fi\relax
\enforced\xdef\elapsedsteps{\number\c_syst_helpers_test_feature_m}%
\def\syst_helpers_test_feature_yes
- {\advance\c_syst_helpers_test_feature_n\plusone
+ {\advanceby\c_syst_helpers_test_feature_n\plusone
\ifnum\c_syst_helpers_test_feature_n>\c_syst_helpers_test_feature_m\else
#2\expandafter\syst_helpers_test_feature_yes
\fi}%
\def\syst_helpers_test_feature_nop
- {\advance\c_syst_helpers_test_feature_n\plusone
+ {\advanceby\c_syst_helpers_test_feature_n\plusone
\ifnum\c_syst_helpers_test_feature_n>\c_syst_helpers_test_feature_m\else
\expandafter\syst_helpers_test_feature_nop
\fi}%
@@ -6508,18 +6661,32 @@
\or \plusten
\else {\number#1}\fi}
-\permanent\def\constantdimen#1%
- {\ifdim#1=\zeropoint
+% \permanent\def\constantdimen#1% takes register
+% {\ifdim#1=\zeropoint
+% \zeropoint
+% \else
+% \the#1\relax
+% \fi}
+
+\permanent\def\constantdimen#1% takes register
+ {\ifzeropt#1\norelax
\zeropoint
\else
- \the#1\relax
+ \todimension#1\norelax
\fi}
+% \permanent\def\constantdimenargument#1% takes register
+% {\ifdim#1=\zeropoint
+% \zeropoint
+% \else
+% {\the#1}%
+% \fi}
+
\permanent\def\constantdimenargument#1%
- {\ifdim#1=\zeropoint
+ {\ifzeropt#1%\norelax
\zeropoint
\else
- {\the#1}%
+ {\todimension#1}%
\fi}
\permanent\def\constantemptyargument#1%
@@ -6668,4 +6835,71 @@
\permanent\protected\def\resetmacros[#1]%
{\processcommalist[#1]\syst_reset_macro}
+%D These demos are for hvdm who needs ways to manipulate arguments but
+%D in a fully expandable way (some explanation is given in the low level
+%D expansion manual).
+%D
+%D \startbuffer
+%D \edef\xxx{[\wipetokens {123}{abc123abc123abc123abc123abc}]}1 : \meaningless\xxx\par
+%D \edef\xxx{[\wipetokens {123}{abc}]} 2 : \meaningless\xxx\par
+%D \edef\xxx{[\wipetokens {123}{123}]} 3 : \meaningless\xxx\par
+%D \edef\xxx{[\wipetokens {123}{123123}]} 4 : \meaningless\xxx\par
+%D \edef\xxx{[\wipetokens {123}{}]} 5 : \meaningless\xxx\par
+%D \edef\xxx{[\wipetokens {}{123}]} 6 : \meaningless\xxx\par
+%D \edef\xxx{[\wipetokens {\relax}{1\relax2\relax3}]} 7 : \meaningless\xxx\par
+%D \edef\xxx{[\wipetokens {1}{1{2}3}]} 8 : \meaningless\xxx\par
+%D \edef\xxx{[\wipedtokens{{1}}{{1}23}]} 9 : \meaningless\xxx\par
+%D \edef\xxx{[\wipedtokens{{1}}{123}]} 0 : \meaningless\xxx\par
+%D \stopbuffer
+%D
+%D \typebuffer \startpacked \getbuffer \stoppacked
+
+\def\syst_helpers_wipe_tokens_nop#-^^04{}%
+
+\permanent\def\wipetokens#1#2%
+ {\beginlocalcontrol
+ \tolerant\def\syst_helpers_wipe_tokens_yes##1#1##2^^04%
+ {##1%
+ \ifparameter##2\or
+ \expandafter\syst_helpers_wipe_tokens_yes
+ \else
+ \expandafter\syst_helpers_wipe_tokens_nop
+ \fi
+ ##2^^04}%
+ \endlocalcontrol
+ \syst_helpers_wipe_tokens_yes#2#1^^04}
+
+\permanent\def\wipedtokens#1#2%
+ {\tokenized{\normalexpanded{\noexpand\wipetokens{\detokenize{#1}}{\detokenize{#2}}}}}
+
+%D \startbuffer
+%D \def\abc{abc}
+%D \semiprotected \def\xyz{xyz}
+%D \edef\pqr{\expandtoken\notcatcodes`p%
+%D \expandtoken\notcatcodes`q%
+%D \expandtoken\notcatcodes`r}
+%D
+%D 1: \ifcondition\similartokens{abc} {def}YES\else NOP\fi (NOP) \quad
+%D 2: \ifcondition\similartokens{abc}{\abc}YES\else NOP\fi (YES)
+%D
+%D 3: \ifcondition\similartokens{xyz} {pqr}YES\else NOP\fi (NOP) \quad
+%D 4: \ifcondition\similartokens{xyz}{\xyz}YES\else NOP\fi (YES)
+%D
+%D 5: \ifcondition\similartokens{pqr} {pqr}YES\else NOP\fi (YES) \quad
+%D 6: \ifcondition\similartokens{pqr}{\pqr}YES\else NOP\fi (YES)
+%D \stopbuffer
+%D
+%D \typebuffer \startpacked \getbuffer \stoppacked
+
+\permanent\protected\def\similartokens#1#2%
+ %{\normalexpanded{\noexpand\iftok{\noexpand\detokenize{#1}}{\noexpand\detokenize{#2}}}}
+ {\semiexpanded{\noexpand\iftok{\noexpand\detokenize{#1}}{\noexpand\detokenize{#2}}}}
+
+\permanent\protected\def\doifelsesimilartokens#1#2%
+ {\ifcondition\similartokens{#1}{#2}%
+ \expandafter\firstoftwoarguments
+ \else
+ \expandafter\secondoftwoarguments
+ \fi}
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/syst-fnt.mkxl b/Master/texmf-dist/tex/context/base/mkxl/syst-fnt.mkxl
index e6029d80511..62239917f7c 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/syst-fnt.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/syst-fnt.mkxl
@@ -23,13 +23,25 @@
\immutable\protected\def\fontemwidth {\scaledfontdimen\plussix }
\immutable\protected\def\fontextraspace {\scaledfontdimen\plusseven}
-\immutable\protected\def\slantperpoint {\scaledfontdimen\plusone \font}
-\immutable\protected\def\interwordspace {\scaledfontdimen\plustwo \font}
-\immutable\protected\def\interwordstretch {\scaledfontdimen\plusthree\font}
-\immutable\protected\def\interwordshrink {\scaledfontdimen\plusfour \font}
-\immutable\protected\def\exheight {\scaledfontdimen\plusfive \font}
-\immutable\protected\def\emwidth {\scaledfontdimen\plussix \font}
-\immutable\protected\def\extraspace {\scaledfontdimen\plusseven\font}
+%immutable\protected\def\slantperpoint {\scaledfontdimen\plusone \font}
+%immutable\protected\def\interwordspace {\scaledfontdimen\plustwo \font}
+%immutable\protected\def\interwordstretch {\scaledfontdimen\plusthree\font}
+%immutable\protected\def\interwordshrink {\scaledfontdimen\plusfour \font}
+%immutable\protected\def\exheight {\scaledfontdimen\plusfive \font}
+%immutable\protected\def\emwidth {\scaledfontdimen\plussix \font}
+%immutable\protected\def\extraspace {\scaledfontdimen\plusseven\font}
+
+%D This saves a little bit of overhead but more important, it gives less tracing,
+%D and for practical reasone we keep this indirectness because we syntax highlight
+%D these pseudo constants different than primitives.
+
+\immutable\aliased\let\slantperpoint \scaledslantperpoint
+\immutable\aliased\let\interwordspace \scaledinterwordspace
+\immutable\aliased\let\interwordstretch \scaledinterwordstretch
+\immutable\aliased\let\interwordshrink \scaledinterwordshrink
+\immutable\aliased\let\exheight \scaledexheight
+\immutable\aliased\let\emwidth \scaledemwidth
+\immutable\aliased\let\extraspace \scaledextraspace
\aliased\let\mathaxisheight\Umathaxis % takes style
diff --git a/Master/texmf-dist/tex/context/base/mkxl/syst-ini.mkxl b/Master/texmf-dist/tex/context/base/mkxl/syst-ini.mkxl
index 50304d1048a..2b37e30c622 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/syst-ini.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/syst-ini.mkxl
@@ -16,13 +16,92 @@
%D this loader is found in \type {syst-tex.tex}. Some of the comment's are Don
%D Knuths and more of it can be found in the plain \TEX\ format.
%D
+%D Successive versions will be adapted to \LUAMETATEX. That also means that we
+%D define things a bit differently than in \MKII\ and \MKIV. This is party due to
+%D the fact that in this engine we removed some side effects or added features. The
+%D original \TEX\ program is well defined and documented and is still the benchmark.
+%D The \ETEX\ extensions originally were meant as systematic follow up but that
+%D never went beyond a first upgrade. It had a dual mode: compatible or extensible.
+%D We always used the second mode. The \LUATEX\ engines don't have that.
+%D
+%D There are some hard coded properties that relate to for instance node types but
+%D we always used abstraction. There are also side effects that (probably) originate
+%D in the fact that \ETEX\ had to stay compatible with the dominant set of macros
+%D using the original \TEX\ ones (either or not wrapped). Even unwanted side effects
+%D eventually become features. In\LUATEX\ and even more in \LUAMETATEX\ we get
+%D around that by additional mode variables that you can find below.
+%D
+%D Side note: those who complain about \TEX\ as rather special language, \ETEX\
+%D extensions that should have been or be different, should really look into how
+%D \TEX\ and friends evolved, and not come to quick and wrong conclusions. There are
+%D only a very few languages that evolve this way. As a comparison one can wonder
+%D why \CCODE\ never had proper strings like \PASCAL\ bit it's just hindsight and
+%D discussing it has no use. In a similar fashion one should keep in mind that what
+%D you see here is just a logical follow up in \MKII\ where we had to bend the rules
+%D and \MKIV\ where we had a bit more available. Not many who look at the latest
+%D engines had to jump though all the hoops.
+%D
+%D This is for instance noticeable in the names of some primitvies: \CONTEXT\ has a
+%D concept of protection before \type {\protected} showed up, and similarly had
+%D expansion helpers. This is why in \MKII\ you find \type {\protected}, \type
+%D {\expanded}, and \type {\unexpanded} commands with different meanings than the
+%D later \ETEX\ primitives. In \MKIV\ we stuck to the \CONTEXT\ originals and use
+%D \type {\normal...} ones when needed (so \type {\normal...} is there for a
+%D reason!). In \LMTX\ we made the transition from \type {\unexpanded} to \type
+%D {\protected} so again this file looks different than the \MKIV\ ancestor.
+%D
+%D When primitives get initialized they come from the \TEX\ namespace (the
+%D originals), the \ETEX\ extensions (although we dropped some) and \LUATEX\ which
+%D includes the \LUAMETATEX\ ones. The most noticeable \ETEX\ extensions we kept are
+%D those that relate to expansion and the expression scanners. The last group has
+%D always been somewhat special because (we were told) it was modelled after a macro
+%D set so it had to be compatible. It is tempting to replace it (and eventually I
+%D might do that) but for now we stick to them (although with an integer divide
+%D extension (like the \LUA\ \type {//} and the source has commented binary
+%D operators but I haven't yet decided on the symbols to use because we need to
+%D avoid expansion issues). For the record: the more extensive, related to \ETEX\
+%D follow up \NTS\ never took of, probably because of the implementation language
+%D and because performance made it unuseable. This is also why \LUATEX\ took a
+%D different route: extending by an extension language. Of course in the end some
+%D core functionality got added too.
+%D
+%D The most noticeable \LUAMETATEX\ specific code here has to do with additional
+%D data types (integer and dimension constants) and macro argument extensions. We
+%D also set up some defaults in handling math, languages, etc. Elsewhere in the
+%D \CONTEXT\ source the real configuration and usage happens so don't consider this
+%D an tutorial (as the plain format is).
+%D
+%D Category codes are another areas where subtle changed happened. You might not
+%D grasp it (maybe because \CONTEXT\ is alien to you) but whenever you see something
+%D that looks weird keep in mind that there is a valid reason for it.
+%D
+%D In due time I will add some more comments here, also because some \CONTEXT\
+%D users might be interested in the hostiry. Now to the code!
+
%D Characters can have special states, that can be triggered by setting their
%D category coded. Some are preset, others are to be set as soon as possible,
%D otherwise we cannot define any useful macros.
%D
%D First we define a bunch of constants. Normally we would \type {\setconstant}
%D but we're prestine and have no macros defined yet. Abstraction also makes it
-%D possible to avoid the \type {^^} in the input.
+%D possible to avoid the \type {^^} in the input. We no longer define the \ETEX\
+%D nodes here (we have not only more, but also different numbers) so we do it
+%D elsewhere.
+
+% cheatsheet
+%
+% # : 0--9
+% * : ignore spaces
+% + : keep the braces
+% - : discard and don't count the argument
+% . : ignore pars and spaces
+% , : push back space when no match
+% / : remove leading and trailing spaces and pars
+% : : pick up scanning here
+% ; : quit scanning
+% = : braces are mandate
+% ^ : keep leading spaces
+% _ : braces are mandate and kept
\immutable\integerdef\escapecatcode 0
\immutable\integerdef\begingroupcatcode 1
@@ -63,6 +142,7 @@
\immutable\integerdef\periodasciicode 46
\immutable\integerdef\forwardslashasciicode 47 % /
\immutable\integerdef\colonasciicode 58
+\immutable\integerdef\semicolonasciicode 59
\immutable\integerdef\lessthanasciicode 60 % < used as alternative verbatim {
\immutable\integerdef\morethanasciicode 62 % > used as alternative verbatim }
\immutable\integerdef\questionmarkasciicode 63 % ? used in namespace protection
@@ -141,7 +221,7 @@
function tex.enableprimitives() end % so we kind of protect what's there
}
-\permanent\let\undefined\undefined
+\untraced\permanent\let\undefined\undefined
\immutable\def\space{ }
\immutable\def\empty{}
@@ -199,48 +279,62 @@
%D non||\type {\global} assignments with respect to registers 0, 2, 4, \unknown\ 30.
%D This will prevent \quote {save stack buildup} that might otherwise occur.
%D
-%D We reserve some registers for special (management) purposes:
+%D We reserve some registers for special (management) purposes. In the mkiv file you
+%D can see how we also (even if we don't use it) deal with families and languages
+%D and distinguish read and write ranges. There we also use a more traditional
+%D insert allocator that operates in its own range. In \MKIV\ the ranges are:
% 0 - 20 : scratch
% 21 - 127 : internal
-% 128 - 254 : inserts
+% 128 - 254 : inserts (no longer)
% 255 : page
-% 256 - : user
+% 256 - : user defined
-% use \chardef instead for min and max
-%
-% will be blocked: \newfamily \newlanguage
-
-\permanent\countdef \c_syst_min_allocated_register = 52 \c_syst_min_allocated_register = 256 % can change
-\permanent\countdef \c_syst_max_allocated_register = 53 \c_syst_max_allocated_register = 65535
-\permanent\countdef \c_syst_min_allocated_read = 54 \c_syst_min_allocated_read = 0
-\permanent\countdef \c_syst_max_allocated_read = 55 \c_syst_max_allocated_read = 1023
-\permanent\countdef \c_syst_min_allocated_language = 56 \c_syst_min_allocated_language = 0
-\permanent\countdef \c_syst_max_allocated_language = 57 \c_syst_max_allocated_language = 8191
-\permanent\countdef \c_syst_min_allocated_insert = 58 \c_syst_min_allocated_insert = 128
-\permanent\countdef \c_syst_max_allocated_insert = 59 \c_syst_max_allocated_insert = 254
-\permanent\countdef \c_syst_min_allocated_family = 60 \c_syst_min_allocated_family = 128
-\permanent\countdef \c_syst_max_allocated_family = 61 \c_syst_max_allocated_family = 255
-\permanent\countdef \c_syst_min_allocated_attribute = 62 \c_syst_min_allocated_attribute = 1024 % 0-1023 : private
-\permanent\countdef \c_syst_min_allocated_write = 63 \c_syst_min_allocated_write = 0
-\permanent\countdef \c_syst_max_allocated_write = 64 \c_syst_max_allocated_write = 1023
-
-\permanent\countdef \c_syst_last_allocated_count = 32 \c_syst_last_allocated_count = \c_syst_min_allocated_register
-\permanent\countdef \c_syst_last_allocated_dimen = 33 \c_syst_last_allocated_dimen = \c_syst_min_allocated_register
-\permanent\countdef \c_syst_last_allocated_skip = 34 \c_syst_last_allocated_skip = \c_syst_min_allocated_register
-\permanent\countdef \c_syst_last_allocated_muskip = 35 \c_syst_last_allocated_muskip = \c_syst_min_allocated_register
-\permanent\countdef \c_syst_last_allocated_box = 36 \c_syst_last_allocated_box = \c_syst_min_allocated_register
-\permanent\countdef \c_syst_last_allocated_toks = 37 \c_syst_last_allocated_toks = \c_syst_min_allocated_register
-\permanent\countdef \c_syst_last_allocated_read = 38 \c_syst_last_allocated_read = \c_syst_min_allocated_read
-\permanent\countdef \c_syst_last_allocated_write = 39 \c_syst_last_allocated_write = \c_syst_min_allocated_write
-\permanent\countdef \c_syst_last_allocated_marks = 40 \c_syst_last_allocated_marks = \c_syst_min_allocated_register
-\permanent\countdef \c_syst_last_allocated_language = 41 \c_syst_last_allocated_language = \c_syst_min_allocated_language % not used in context
-\permanent\countdef \c_syst_last_allocated_insertion = 42 \c_syst_last_allocated_insertion = \c_syst_min_allocated_insert
-\permanent\countdef \c_syst_last_allocated_family = 43 \c_syst_last_allocated_family = \c_syst_min_allocated_family % not used in context
-\permanent\countdef \c_syst_last_allocated_attribute = 44 \c_syst_last_allocated_attribute = \c_syst_min_allocated_attribute % not used in context
-
-\permanent\countdef \c_syst_min_counter_value = 125 \c_syst_min_counter_value = -"7FFFFFFF % beware, we use index 125 at the lua end
-\permanent\countdef \c_syst_max_counter_value = 126 \c_syst_max_counter_value = "7FFFFFFF % beware, we use index 126 at the lua end
+%D However, in \LMTX\ we have:
+
+% 0 - 199 : scratch
+% 200 - 254 : internal
+% 255 : page
+% 256 - : user defined
+
+%D Later on, the \type {\c_syst_max_allocated_*} variables will be halfed so that
+%D while local allocators will use the 23* range. So we have plenty of room reserved
+%D for more private ones.
+
+\directlua {tex.magicconstants = status.getconstants()} % this will be reset later on
+
+\permanent\countdef\c_syst_min_allocated_register = 201 \c_syst_min_allocated_register = 256 % can change
+
+\permanent\countdef\c_syst_min_allocated_iohandle = 203 \c_syst_min_allocated_iohandle = 0
+\permanent\countdef\c_syst_max_allocated_iohandle = 204 \c_syst_max_allocated_iohandle = 1023
+
+\permanent\countdef\c_syst_min_allocated_mark = 205 \c_syst_min_allocated_mark = 16 % a few scratch ones
+\permanent\countdef\c_syst_max_allocated_mark = 206 \c_syst_max_allocated_mark = 1024 % max 10K in luametatex anyway
+
+\permanent\countdef\c_syst_min_allocated_attribute = 207 \c_syst_min_allocated_attribute = 1024 % 0-1023 : private
+\permanent\countdef\c_syst_max_allocated_attribute = 208 \c_syst_min_allocated_attribute = \directlua{tex.write(tex.magicconstants.max_attribute_register_index)} % 65535 % no allocator, managed differently
+
+\permanent\countdef\c_syst_max_allocated_count = 211 \c_syst_max_allocated_count = \directlua{tex.write(tex.magicconstants.max_int_register_index)} % 65535 % is adapted later on
+\permanent\countdef\c_syst_max_allocated_dimen = 212 \c_syst_max_allocated_dimen = \directlua{tex.write(tex.magicconstants.max_dimen_register_index)} % idem
+\permanent\countdef\c_syst_max_allocated_skip = 213 \c_syst_max_allocated_skip = \directlua{tex.write(tex.magicconstants.max_glue_register_index)} % idem
+\permanent\countdef\c_syst_max_allocated_muskip = 214 \c_syst_max_allocated_muskip = \directlua{tex.write(tex.magicconstants.max_mu_glue_register_index)} % idem
+\permanent\countdef\c_syst_max_allocated_box = 215 \c_syst_max_allocated_box = \directlua{tex.write(tex.magicconstants.max_box_register_index)} % idem
+\permanent\countdef\c_syst_max_allocated_toks = 216 \c_syst_max_allocated_toks = \directlua{tex.write(tex.magicconstants.max_toks_register_index)} % idem
+\permanent\countdef\c_syst_max_allocated_read = 217 \c_syst_max_allocated_read = \c_syst_max_allocated_iohandle
+\permanent\countdef\c_syst_max_allocated_write = 218 \c_syst_max_allocated_write = \c_syst_max_allocated_iohandle
+
+\permanent\countdef\c_syst_last_allocated_count = 221 \c_syst_last_allocated_count = \c_syst_min_allocated_register
+\permanent\countdef\c_syst_last_allocated_dimen = 222 \c_syst_last_allocated_dimen = \c_syst_min_allocated_register
+\permanent\countdef\c_syst_last_allocated_skip = 223 \c_syst_last_allocated_skip = \c_syst_min_allocated_register
+\permanent\countdef\c_syst_last_allocated_muskip = 224 \c_syst_last_allocated_muskip = \c_syst_min_allocated_register
+\permanent\countdef\c_syst_last_allocated_box = 225 \c_syst_last_allocated_box = \c_syst_min_allocated_register
+\permanent\countdef\c_syst_last_allocated_toks = 226 \c_syst_last_allocated_toks = \c_syst_min_allocated_register
+\permanent\countdef\c_syst_last_allocated_read = 227 \c_syst_last_allocated_read = \c_syst_min_allocated_iohandle
+\permanent\countdef\c_syst_last_allocated_write = 228 \c_syst_last_allocated_write = \c_syst_min_allocated_iohandle
+\permanent\countdef\c_syst_last_allocated_marks = 229 \c_syst_last_allocated_marks = \c_syst_min_allocated_mark
+
+\permanent\countdef\c_syst_min_counter_value = 253 \c_syst_min_counter_value = -"7FFFFFFF
+\permanent\countdef\c_syst_max_counter_value = 254 \c_syst_max_counter_value = "7FFFFFFF
\immutable\integerdef\zerocount 0
\immutable\integerdef\plusone 1
@@ -250,6 +344,29 @@
\immutable\integerdef\statuswrite \minusone
+\immutable\dimensiondef\zeropoint 0pt
+
+%D These alternatives avoid the indirect references. Don't use these for generic
+%D code because one never knows what happens elsewhere.
+
+% \permanent\protected\def\newinteger #1{\ifdefined#1\else\integerdef #1\fi\zerocount} % can be relax
+% \permanent\protected\def\newdimension #1{\ifdefined#1\else\dimensiondef #1\fi\zeropoint}
+% \permanent\protected\def\newgluespec #1{\ifdefined#1\else\gluespecdef #1\fi\zeropoint}
+% \permanent\protected\def\newmugluespec#1{\ifdefined#1\else\mugluespecdef#1\fi\zeropoint}
+
+\permanent\protected\def\newinteger #1{\integerdef #1\zerocount}
+\permanent\protected\def\newdimension #1{\dimensiondef #1\zeropoint}
+\permanent\protected\def\newgluespec #1{\gluespecdef #1\zeropoint}
+\permanent\protected\def\newmugluespec#1{\mugluespecdef#1\zeropoint}
+
+%D The aliasing here is tricky: we need to make sure the alias is not let to the
+%D current value but behaves dynamic. Instead we can use just \newcount, unless of
+%D course I introduce a reference in the engine which is not more efficient so then
+%D one can as well use registers.
+
+\protected\def\aliasinteger #1#2{\untraced\protected\def#1{#2}}% name parent
+\protected\def\aliasdimension#1#2{\untraced\protected\def#1{#2}}% name parent
+
%D So, effectively we start allocating from 256 and upwards. The inserts sit in the
%D range 128 upto 254. Page numbers use the counters 0 upto 9 and the pagebox is
%D 255. Users can use the scratch registers upto 31 without problem but all others
@@ -257,27 +374,23 @@
\permanent\let\wlog\gobbleoneargument % Let's get rid of this one.
-%D The allocators share a common helper macro.
+%D The allocators share a common helper macro. Marks might be changed to work in lower
+%D regions and we always assumes allocation.
-\permanent\protected\def\newcount {\syst_basics_allocate\c_syst_last_allocated_count \count \countdef \c_syst_max_allocated_register}
-\permanent\protected\def\newdimen {\syst_basics_allocate\c_syst_last_allocated_dimen \dimen \dimendef \c_syst_max_allocated_register}
-\permanent\protected\def\newskip {\syst_basics_allocate\c_syst_last_allocated_skip \skip \skipdef \c_syst_max_allocated_register}
-\permanent\protected\def\newmuskip {\syst_basics_allocate\c_syst_last_allocated_muskip \muskip \muskipdef \c_syst_max_allocated_register}
-\permanent\protected\def\newbox {\syst_basics_allocate\c_syst_last_allocated_box \box \integerdef\c_syst_max_allocated_register}
-\permanent\protected\def\newtoks {\syst_basics_allocate\c_syst_last_allocated_toks \toks \toksdef \c_syst_max_allocated_register}
-\permanent\protected\def\newread {\syst_basics_allocate\c_syst_last_allocated_read \read \integerdef\c_syst_max_allocated_read}
-\permanent\protected\def\newwrite {\syst_basics_allocate\c_syst_last_allocated_write \write \integerdef\c_syst_max_allocated_write}
-\permanent\protected\def\newmarks {\syst_basics_allocate\c_syst_last_allocated_marks \marks \integerdef\c_syst_max_allocated_register}
-\permanent\protected\def\newinsert {\syst_basics_allocate\c_syst_last_allocated_insertion\insert \chardef \c_syst_max_allocated_insert}
-\permanent\protected\def\newlanguage{\syst_basics_allocate\c_syst_last_allocated_language \language\integerdef\c_syst_max_allocated_language} % not needed in context
-\permanent\protected\def\newfamily {\syst_basics_allocate\c_syst_last_allocated_family \fam \integerdef\c_syst_max_allocated_family} % not needed in context
-
-\aliased\let\newfam\newfamily
+\permanent\protected\def\newcount {\syst_basics_allocate\c_syst_last_allocated_count \count \countdef \c_syst_max_allocated_count}
+\permanent\protected\def\newdimen {\syst_basics_allocate\c_syst_last_allocated_dimen \dimen \dimendef \c_syst_max_allocated_dimen}
+\permanent\protected\def\newskip {\syst_basics_allocate\c_syst_last_allocated_skip \skip \skipdef \c_syst_max_allocated_skip}
+\permanent\protected\def\newmuskip{\syst_basics_allocate\c_syst_last_allocated_muskip\muskip\muskipdef \c_syst_max_allocated_muskip}
+\permanent\protected\def\newbox {\syst_basics_allocate\c_syst_last_allocated_box \box \integerdef\c_syst_max_allocated_box}
+\permanent\protected\def\newtoks {\syst_basics_allocate\c_syst_last_allocated_toks \toks \toksdef \c_syst_max_allocated_toks}
+\permanent\protected\def\newread {\syst_basics_allocate\c_syst_last_allocated_read \read \integerdef\c_syst_max_allocated_read}
+\permanent\protected\def\newwrite {\syst_basics_allocate\c_syst_last_allocated_write \write \integerdef\c_syst_max_allocated_write}
+\permanent\protected\def\newmarks {\syst_basics_allocate\c_syst_last_allocated_marks \marks \integerdef\c_syst_max_allocated_mark}
\firstvalidlanguage \plusone % so zero is ignored in hyphenation, this might become the default
-% Watch out, for the moment we disable the check for already being defined
-% later we will revert this but first all chardefs must be replaced.
+%D Watch out, for the moment we disable the check for already being defined later we
+%D will revert this but first all chardefs must be replaced.
\permanent\protected\def\setconstant {}
\permanent\protected\def\setconstantvalue#1#2{\csname#1\endcsname\numexpr#2\relax}
@@ -286,11 +399,13 @@
{\ifrelax#1%
%\writestatus{!!!!!!!!!!}{\string #1 => RELAX}%
\unletfrozen#1%
- \newcount#1%
+ % \newcount#1%
+ \newinteger#1%
\orelse\ifdefined#1%
%\writestatus{!!!!!!!!!!}{\string #1 => DEFINED}%
\else
- \newcount#1%
+ % \newcount#1%
+ \newinteger#1%
\fi}
\permanent\protected\def\setnewconstant#1{\newconstant#1#1}
@@ -303,16 +418,31 @@
%D consecutive ranges more easily, for instance if for \MPLIB\ we want to allocate a
%D continuous range of boxes. It also permits us to do a proper upward allocation
%D for inserts. The current code evolved from code that dealt with older engines but
-%D as all engines now provide many registers we removed all traces.
+%D as all engines now provide many registers we removed all traces. If you ever run
+%D into the \MKII\ \type {mptopdf} code, you'll notice that some register magic was
+%D needed to fit into existing macro packages. The same is true for \PICTEX\ that we
+%D used in (generic) \PPCHTEX.
\ifdefined\writestatus \else
%\protected\def\writestatus#1#2{\immediate\write\statuswrite{#1: #2}}
\frozen\protected\def\writestatus#1#2{\message{#1: #2}}
\fi
+%D The above command will normally hook into the interface commands and is a
+%D protected command. We also have an \type {\diagnostic} predefined which is an
+%D expandable command:
+%D
+%D \starttyping
+%D test \diagnostic {here 1} test
+%D test \diagnostic[2] {here 2} test
+%D test \diagnostic[.05]{here 3} test
+%D \stoptyping
+%D
+%D The optional argument triggers a sleep in seconds.
+
\def\syst_basics_allocate_yes#1#2#3#4#5% last class method max name
{\ifnum#1<#4\relax
- \global\advance#1\plusone
+ \global\advanceby#1\plusone
\permanent\global#3#5=#1\relax
\else
\writestatus{warning}{no room for \string#2\space \string#5\space (max: \number#4)}%
@@ -334,9 +464,6 @@
%D Since the number of chars exceed 256 now, we can use \type {\chardef} instead of
%D the more limited \type {\mathchardef}.
-% \protected\def\newbox {\syst_basics_allocate\c_syst_last_allocated_box \box \chardef\c_syst_max_allocated_register}
-% \protected\def\newmarks{\syst_basics_allocate\c_syst_last_allocated_marks\marks\chardef\c_syst_max_allocated_register}
-
%D Attributes are something very \LUATEX. In \CONTEXT\ you are not supposed to use
%D the attributes directly but always allocate then first. For instance attribute~0
%D is reserved for special purposes (this might change). Attributes in the range
@@ -344,7 +471,7 @@
\immutable\integerdef\attributeunsetvalue\c_syst_min_counter_value % used to be \minusone
-% \permanent\protected\def\newattribute{\syst_basics_allocate\c_syst_last_allocated_attribute\attribute\attributedef\c_syst_max_allocated_register}
+% \permanent\protected\def\newattribute{\syst_basics_allocate\c_syst_last_allocated_attribute\attribute\attributedef\c_syst_max_allocated_attribute}
% %D Not used by \CONTEXT\ but for instance \PICTEX\ needs it. It's a trick to force
% %D strings instead of tokens that take more memory.
@@ -361,30 +488,30 @@
%D some available. The private ones are used in cases where we don't want to
%D intrude on normal scratch ones.
-\newcount \scratchcounter \newcount \globalscratchcounter \newcount \privatescratchcounter
-\newdimen \scratchdimen \newdimen \globalscratchdimen \newdimen \privatescratchdimen
-\newskip \scratchskip \newskip \globalscratchskip \newskip \privatescratchskip
-\newmuskip\scratchmuskip \newmuskip\globalscratchmuskip \newmuskip\privatescratchmuskip
-\newtoks \scratchtoks \newtoks \globalscratchtoks \newtoks \privatescratchtoks
-\newbox \scratchbox \newbox \globalscratchbox \newbox \privatescratchbox
-
-\newcount\scratchcounterone \newcount\scratchcountertwo \newcount\scratchcounterthree
-\newdimen \scratchdimenone \newdimen \scratchdimentwo \newdimen \scratchdimenthree
-\newskip \scratchskipone \newskip \scratchskiptwo \newskip \scratchskipthree
-\newmuskip\scratchmuskipone \newmuskip\scratchmuskiptwo \newmuskip\scratchmuskipthree
-\newtoks \scratchtoksone \newtoks \scratchtokstwo \newtoks \scratchtoksthree
-\newbox \scratchboxone \newbox \scratchboxtwo \newbox \scratchboxthree
-
-\newcount\scratchcounterfour \newcount\scratchcounterfive \newcount\scratchcountersix
-\newdimen \scratchdimenfour \newdimen \scratchdimenfive \newdimen \scratchdimensix
-\newskip \scratchskipfour \newskip \scratchskipfive \newskip \scratchskipsix
-\newmuskip\scratchmuskipfour \newmuskip\scratchmuskipfive \newmuskip\scratchmuskipsix
-\newtoks \scratchtoksfour \newtoks \scratchtoksfive \newtoks \scratchtokssix
-\newbox \scratchboxfour \newbox \scratchboxfive \newbox \scratchboxsix
-
-\newcount\globalscratchcounterone
-\newcount\globalscratchcountertwo
-\newcount\globalscratchcounterthree
+\newinteger \scratchcounter \newinteger \globalscratchcounter \newinteger \privatescratchcounter
+\newdimension\scratchdimen \newdimension\globalscratchdimen \newdimension\privatescratchdimen
+\newgluespec \scratchskip \newgluespec \globalscratchskip \newgluespec \privatescratchskip
+\newmuskip \scratchmuskip \newmuskip \globalscratchmuskip \newmuskip \privatescratchmuskip
+\newtoks \scratchtoks \newtoks \globalscratchtoks \newtoks \privatescratchtoks
+\newbox \scratchbox \newbox \globalscratchbox \newbox \privatescratchbox
+
+\newinteger \scratchcounterone \newinteger \scratchcountertwo \newinteger \scratchcounterthree
+\newdimension\scratchdimenone \newdimension\scratchdimentwo \newdimension\scratchdimenthree
+\newgluespec \scratchskipone \newgluespec \scratchskiptwo \newgluespec \scratchskipthree
+\newmuskip \scratchmuskipone \newmuskip \scratchmuskiptwo \newmuskip \scratchmuskipthree
+\newtoks \scratchtoksone \newtoks \scratchtokstwo \newtoks \scratchtoksthree
+\newbox \scratchboxone \newbox \scratchboxtwo \newbox \scratchboxthree
+
+\newinteger \scratchcounterfour\newinteger \scratchcounterfive \newinteger \scratchcountersix
+\newdimension\scratchdimenfour \newdimension\scratchdimenfive \newdimension\scratchdimensix
+\newgluespec \scratchskipfour \newgluespec \scratchskipfive \newgluespec \scratchskipsix
+\newmuskip \scratchmuskipfour \newmuskip \scratchmuskipfive \newmuskip \scratchmuskipsix
+\newtoks \scratchtoksfour \newtoks \scratchtoksfive \newtoks \scratchtokssix
+\newbox \scratchboxfour \newbox \scratchboxfive \newbox \scratchboxsix
+
+\newinteger\globalscratchcounterone
+\newinteger\globalscratchcountertwo
+\newinteger\globalscratchcounterthree
\mutable\let\scratchmacro \relax
\mutable\let\scratchmacroone\relax
@@ -393,56 +520,57 @@
%D \macros
%D {tempstring, scratchstring*}
-\mutable\let\tempstring \empty
+\mutable\lettonothing\tempstring
-\mutable\let\scratchstring \empty
-\mutable\let\scratchstringone\empty
-\mutable\let\scratchstringtwo\empty
+\mutable\lettonothing\scratchstring
+\mutable\lettonothing\scratchstringone
+\mutable\lettonothing\scratchstringtwo
%D \macros
%D {scratchwidth, scratchheight, scratchdepth, scratchoffset, scratchdistance}
%D
%D A few more scratch dimensions:
-\newdimen\scratchwidth
-\newdimen\scratchheight
-\newdimen\scratchdepth
-\newdimen\scratchtotal
+\newdimension\scratchwidth
+\newdimension\scratchheight
+\newdimension\scratchdepth
+\newdimension\scratchitalic
+\newdimension\scratchtotal
-\newdimen\scratchoffset
-\newdimen\scratchleftoffset
-\newdimen\scratchrightoffset
-\newdimen\scratchtopoffset
-\newdimen\scratchbottomoffset
+\newdimension\scratchoffset
+\newdimension\scratchleftoffset
+\newdimension\scratchrightoffset
+\newdimension\scratchtopoffset
+\newdimension\scratchbottomoffset
-\newdimen\scratchdistance
+\newdimension\scratchdistance
-\newdimen\scratchhsize
-\newdimen\scratchvsize
+\newdimension\scratchhsize
+\newdimension\scratchvsize
-\newdimen\scratchxoffset
-\newdimen\scratchyoffset
-\newdimen\scratchhoffset
-\newdimen\scratchvoffset
+\newdimension\scratchxoffset
+\newdimension\scratchyoffset
+\newdimension\scratchhoffset
+\newdimension\scratchvoffset
-\newdimen\scratchxposition
-\newdimen\scratchyposition
+\newdimension\scratchxposition
+\newdimension\scratchyposition
-\newcount\scratchnx
-\newcount\scratchny
+\newinteger\scratchnx
+\newinteger\scratchny
-\newcount\scratchmx
-\newcount\scratchmy
+\newinteger\scratchmx
+\newinteger\scratchmy
-\newcount\scratchmin
-\newcount\scratchmax
+\newinteger\scratchmin
+\newinteger\scratchmax
-\newcount\scratchunicode
+\newinteger\scratchunicode
-\newdimen\scratchleftskip
-\newdimen\scratchrightskip
-\newdimen\scratchtopskip
-\newdimen\scratchbottomskip
+\newdimension\scratchleftskip
+\newdimension\scratchrightskip
+\newdimension\scratchtopskip
+\newdimension\scratchbottomskip
%D More allocations:
@@ -458,7 +586,7 @@
\immutable\integerdef \maxcount 2147483647
-\immutable\dimensiondef \zeropoint 0pt
+%immutable\dimensiondef \zeropoint 0pt
\immutable\dimensiondef \onepoint 1pt
\immutable\dimensiondef \halfapoint 0.5pt
\immutable\dimensiondef \maxdimen 16383.99999pt % 1073741823sp
@@ -466,7 +594,13 @@
\immutable\dimensiondef \scaledpoint 1sp
\immutable\dimensiondef \thousandpoint 1000pt
-\immutable\gluespecdef \zeroskip 0pt plus 0pt minus 0pt
+\immutable\gluespecdef \zeroskip \zeropoint plus \zeropoint minus \zeropoint
+\immutable\gluespecdef \centeringskip \zeropoint plus \thousandpoint minus \thousandpoint
+\immutable\gluespecdef \stretchingskip \zeropoint plus \thousandpoint
+\immutable\gluespecdef \shrinkingskip \zeropoint minus \thousandpoint
+\immutable\gluespecdef \centeringfillskip \zeropoint plus 1fill minus 1fill
+\immutable\gluespecdef \stretchingfillskip \zeropoint plus 1fill
+\immutable\gluespecdef \shrinkingfillskip \zeropoint minus 1fill
\immutable\mugluespecdef \zeromuskip 0mu
\immutable\mugluespecdef \onemuskip 1mu
@@ -512,6 +646,11 @@
\immutable\integerdef\medcard 32768
\immutable\integerdef\maxcard 65536 % pdftex has less mathchars
\immutable\integerdef\maxcardminusone 65535
+\immutable\integerdef\maxiterator "FFFFF
+
+\immutable\integerdef\binaryshiftedten 1024
+\immutable\integerdef\binaryshiftedtwenty 1048576
+\immutable\integerdef\binaryshiftedthirty 1073741824
%D \macros
%D {doubleexpandafter,tripleexpandafter,expanded,startexpanded}
@@ -535,9 +674,15 @@
\aliased\let\leavevmode\unvoidbox % we prefer to use \dontleavehmode
%D \macros
-%D {dontcomplain}
+%D {dontcomplain,lessboxtracing}
%D
-%D We need this one soon:
+%D We need this one soon. The second one shows less box details (because that actually
+%D slows down noticeably due to the more extensive details in node content.
+
+% With \showboxdepth\maxcount and \showboxbreadth\maxcount the second one is way slower:
+%
+% \testfeatureonce{10}{\setbox\scratchbox\vbox {\samplefile{tufte}}} \elapsedtime\par
+% \testfeatureonce{10}{\setbox\scratchbox\vbox to 10cm{\samplefile{tufte}}} \elapsedtime\par
\permanent\protected\def\dontcomplain
{\hbadness\plustenthousand
@@ -545,8 +690,20 @@
\hfuzz \maxdimen
\vfuzz \maxdimen}
-%D Some expected plain variants follow. We don't reuse registers because we
-%D don't want clashes.
+\permanent\protected\def\noboxtracing
+ {\showboxdepth \zerocount
+ \showboxbreadth\zerocount}
+
+\permanent\protected\def\lessboxtracing
+ {\showboxdepth \plusfive
+ \showboxbreadth\plusten}
+
+\permanent\protected\def\moreboxtracing
+ {\showboxbreadth\maxcount
+ \showboxdepth \maxcount}
+
+%D Some expected plain variants follow. We don't reuse registers because we don't
+%D want clashes. These will go away and packages that need them have to define them.
\aliased\let\p@ \onepoint
\aliased\let\m@ne \minusone
@@ -621,28 +778,20 @@
\newif\ifscratchconditionone
\newif\ifscratchconditiontwo
+%D This used to be a protected definition with a \type {dimexpr} but now we have
+%D it natively (less tracking noise).
+
\aliased\let\htdp\boxtotal
-%D A few shortcuts:
+%D A few shortcuts (gone by now):
% \permanent\protected\def\udef {\protected\def }
% \permanent\protected\def\ugdef{\protected\gdef}
% \permanent\protected\def\uedef{\protected\edef}
% \permanent\protected\def\uxdef{\protected\xdef}
-% For now:
-
-\permanent\protected\def\defUmathtopaccent #1#2#3#4{\global\immutable\protected\def#1{\Umathaccent "#2 "#3 "#4 }}
-\permanent\protected\def\defUmathbotaccent #1#2#3#4{\global\immutable\protected\def#1{\Umathbotaccent "#2 "#3 "#4 }}
-\permanent\protected\def\defUdelimiterover #1#2#3#4{\global\immutable\protected\def#1{\Udelimiterover "#2 "#3 }}
-\permanent\protected\def\defUdelimiterunder #1#2#3#4{\global\immutable\protected\def#1{\Udelimiterunder "#2 "#3 }}
-\permanent\protected\def\defUdelimiter #1#2#3#4{\global\immutable\protected\def#1{\Udelimiter "#2 "#3 "#4 }}
-\permanent\protected\def\defUradical #1#2#3{\global\immutable\protected\def#1{\Uradical "#2 "#3 }}
-\permanent\protected\def\defUroot #1#2#3{\global\immutable\protected\def#1{\Uroot "#2 "#3 }}
-\permanent\protected\def\defUmathchar #1#2#3#4{\global\immutable\Umathchardef #1 "#2 "#3 "#4 }
-
%D For a while we keep the following, as systems like tikz need it. Best not use
-%D that one \CONTEXT.
+%D that one \CONTEXT. It will probably move to the tikz loader.
\aliased\let\active\activecatcode
@@ -672,29 +821,36 @@
% no longer \errorstopmode cf. plain tex 3.141592653
\permanent\protected\def\tracingall
- {\tracingonline \plusone
- \tracingcommands \plusthree
- \tracingmacros \plustwo
+ {\tracingcommands \plusfour % > 3: show mode change independent
+ \tracingmacros \plusthree % > 2: obey \untraced
\tracingoutput \plusone
\tracingpages \plusone
- \tracingparagraphs\plusone
+ \tracingparagraphs\plustwo
\tracingrestores \plusone
\tracinggroups \plusone
\tracingifs \plusone
- \tracingnesting \plustwo
+ \tracingnesting \plusthree
\tracingassigns \plustwo
\tracingmath \plusone
- \tracingalignments\plusone
+ \tracingalignments\plustwo % > 1: also show preamble
+ \showboxbreadth \maxcount
+ \showboxdepth \maxcount
+ \tracingonline \plusone}
+
+\permanent\protected\def\tracingless
+ {\tracingall
+ \tracingoutput \zerocount
\showboxbreadth \maxcount
- \showboxdepth \maxcount}
+ \showboxdepth \plusten}
\permanent\protected\def\loggingall
{\tracingall
\tracingonline \zerocount}
\permanent\protected\def\tracingnone
- {\showboxdepth \plusthree
- \showboxbreadth \plusfive
+ {\tracingonline \zerocount
+ \showboxdepth \plusfive % lessboxtracing
+ \showboxbreadth \plusten
\tracingalignments\zerocount
\tracingmath \zerocount
\tracingassigns \zerocount
@@ -711,8 +867,10 @@
%D When we want to see a box we can as well show all of it.
-\showboxdepth \maxdimen
-\showboxbreadth\maxdimen
+% \showboxdepth \maxcount
+% \showboxbreadth\maxcount
+
+\lessboxtracing
%D Just for tracing purposes we set:
@@ -806,7 +964,7 @@
\aliased\let\newconditional\setfalse
\aliased\let\ifconditional \ifcase
-\aliased\let\then\relax % so that we can say: \ifnum1>2\then -)
+\permanent\protected\lettonothing\then % so that we can say: \ifnum1>2\then -)
\permanent\def\truecondition {\iftrue}
\permanent\def\falsecondition{\iffalse}
@@ -824,7 +982,7 @@
%D {\let} (the only advantage is that we often give them names with some
%D prefix.
-\permanent\protected\def\newmacro #1{\mutable\let#1\empty}
+\permanent\protected\def\newmacro #1{\mutable\lettonothing#1}
\permanent\protected\def\setnewmacro#1{\mutable\let#1}
\permanent\protected\def\newfraction#1{\mutable\let#1\!!plusone}
@@ -846,7 +1004,8 @@
%D \ifzeropt \somedimen ... \else ... \fi
%D \stoptyping
-\aliased\let\ifzeropt\ifcase
+\aliased\let\ifzeropt\ifzerodim % was \let\ifzeropt\ifcase
+\aliased\let\ifzero \ifzeronum % was \let\ifzeropt\ifcase
% these token list helpers might move to syst-aux.mkiv
%
@@ -992,16 +1151,15 @@
%D The following registers are kind of standard and (for the moment) we define
%D them here. This might change.
-\newskip \bigskipamount \bigskipamount = 12pt plus 4pt minus 4pt
-\newskip \medskipamount \medskipamount = 6pt plus 2pt minus 2pt
-\newskip \smallskipamount \smallskipamount = 3pt plus 1pt minus 1pt
+\newgluespec \bigskipamount \bigskipamount = 12pt plus 4pt minus 4pt
+\newgluespec \medskipamount \medskipamount = 6pt plus 2pt minus 2pt
+\newgluespec \smallskipamount \smallskipamount = 3pt plus 1pt minus 1pt
\baselineskip = 12pt
\lineskip = 1pt
\lineskiplimit = 0pt
-%D Sometimes kerns make more sense than glue but we need to be in the
-%D right mode:
+%D Sometimes kerns make more sense than glue but we need to be in the right mode:
\permanent\protected\def\vkern {\ifhmode\par \fi\kern}
\permanent\protected\def\hkern {\ifvmode\dontleavehmode\fi\kern}
@@ -1009,19 +1167,19 @@
\permanent\protected\def\vpenalty{\ifhmode\par \fi\penalty}
\permanent\protected\def\hpenalty{\ifvmode\dontleavehmode\fi\penalty}
-%D Again a few kind-of-extensions the core. These come from plain \TEX\ but
-%D are probably not used in \CONTEXT.
+%D Again a few kind-of-extensions the core. These come from plain \TEX\ but are
+%D probably not used in \CONTEXT.
-\newskip \hideskip \hideskip = -1000pt plus 1fill
-\newskip \centering \centering = 0pt plus 1000pt minus 1000pt
+\newgluespec \hideskip \hideskip = -1000pt plus 1fill % obsolete
+\newgluespec \centering \centering = 0pt plus 1000pt minus 1000pt % obsolete
-\permanent\def\hidewidth % for alignment entries that can stick out
- {\hskip\hideskip}
-
-\permanent\def\ialign % initialized \halign
- {\everycr\emptytoks
- \tabskip\zeroskip
- \halign}
+% \permanent\def\hidewidth % for alignment entries that can stick out
+% {\hskip\hideskip}
+%
+% \permanent\def\ialign % initialized \halign, to be used grouped!
+% {\everycr\emptytoks
+% \tabskip\zeroskip
+% \halign}
\newcount \mscount
@@ -1032,7 +1190,7 @@
\mscount#1\relax
\loop
\ifnum\mscount>\plusone
- \spanomit \advance\mscount\minusone
+ \spanomit \advanceby\mscount\minusone
\repeat}
\let\nopdfcompression \relax % later
@@ -1089,14 +1247,15 @@
{\ifcsname ??#1\endcsname
\immediate\write\statuswrite{fatal error: duplicate system namespace '#1'}%
\else
- \global\advance\c_syst_helpers_n_of_namespaces\plusone
- \immutable\edefcsname ??#1\endcsname{\v_interfaces_prefix_template_system}%
+ \global\advanceby\c_syst_helpers_n_of_namespaces\plusone
+ \immutable\cdefcsname ??#1\endcsname{\v_interfaces_prefix_template_system}%
\fi}
%D It makes more sense to have these here:
\aliased\let\normalsuperscript \Usuperscript
\aliased\let\normalsubscript \Usubscript
+\aliased\let\normalprimescript \Uprimescript
\aliased\let\normalnosuperscript\Unosuperscript
\aliased\let\normalnosubscript \Unosubscript
\aliased\let\normalstartimath \Ustartmath
@@ -1110,19 +1269,14 @@
%D For a while we will keep these useless numbers as for instance tikz checks for them:
-\immutable\integerdef\eTeXversion 2
-\immutable\def \eTeXrevision {2}
-
-%D Experiment:
+\immutable\integerdef\eTeXversion 2
+\immutable\def \eTeXrevision {.2} % there is a funny period here
-\glyphoptions"80 % replaces \glyphdimensionsmode=1
+% %D Just in case users use this (or some styles still have it):
-%D Just in case users use this:
-
-\aliased\let\immediateassign \immediate
\aliased\let\immediateassigned\localcontrolled
-%D Needed:
+%D Needed (maybe no longer the multiple next ones):
\mutable\let\nexttoken \relax
\mutable\let\next \relax
@@ -1135,18 +1289,15 @@
% \mutable\let\par\par
% \popoverloadmode
-%D Also here:
-
-\listcallbackmode\plusone
-
%D Often used as cs key:
-\mutable\let\on \empty
-\mutable\let\of \empty
-\mutable\let\and \empty
-\mutable\let\with\empty
-\mutable\let\nop \empty % used often
-\mutable\let\yes \empty % used often
+\mutable\let\on \relax % \empty
+\mutable\let\of \relax % \empty
+\mutable\let\and \relax % \empty
+\mutable\let\with\relax % \empty
+
+\mutable\lettonothing\nop % used often
+\mutable\lettonothing\yes % used often
%D Another experiment:
@@ -1161,7 +1312,7 @@
{\ifflags#2\permanent\permanent\fi % the rest is taken with the copy
\def#1{\syst_suggested_alias#1#2}}
-% A few traditional allocations (these might go):
+% A few traditional allocations (these might go too):
% \countdef \count@ 255 % hm, used in \newif .. todo: replace it there
% \dimendef \dimen@ 0
@@ -1199,53 +1350,49 @@
%D \stoptyping
%D
%D There is a little extra overhead in the overload protection but not that much.
-%D Instead of:
-
-% \newcount\c_syst_local_count \c_syst_local_count \c_syst_max_allocated_register
-% \newcount\c_syst_local_dimen \c_syst_local_dimen \c_syst_local_count
-% \newcount\c_syst_local_skip \c_syst_local_skip \c_syst_local_count
-% \newcount\c_syst_local_muskip\c_syst_local_muskip\c_syst_local_count
-% \newcount\c_syst_local_box \c_syst_local_box \c_syst_local_count
-% \newcount\c_syst_local_toks \c_syst_local_toks \c_syst_local_count
-
-%D We do this:
-
-\permanent\countdef\c_syst_local_count = 72 \c_syst_local_count = \c_syst_max_allocated_register
-\permanent\countdef\c_syst_local_dimen = 73 \c_syst_local_dimen = \c_syst_local_count
-\permanent\countdef\c_syst_local_skip = 74 \c_syst_local_skip = \c_syst_local_count
-\permanent\countdef\c_syst_local_muskip = 75 \c_syst_local_muskip = \c_syst_local_count
-\permanent\countdef\c_syst_local_box = 76 \c_syst_local_box = \c_syst_local_count
-\permanent\countdef\c_syst_local_toks = 77 \c_syst_local_toks = \c_syst_local_count
-\permanent\countdef\c_syst_local_read = 78 \c_syst_local_read = \c_syst_local_count
-\permanent\countdef\c_syst_local_write = 79 \c_syst_local_write = \c_syst_local_count
-% We should have used \c_syst_local_dimen = \numexpr \c_syst_max_allocated_register +
-% 1\relax, but we do this instead (it's no problem loosing a few registers).
-
-\c_syst_max_allocated_register \numexpr\c_syst_max_allocated_register:2\relax % floor
+% integerdef is local
+
+\permanent\countdef\c_syst_local_count = 231 \c_syst_local_count = \c_syst_max_allocated_count
+\permanent\countdef\c_syst_local_dimen = 232 \c_syst_local_dimen = \c_syst_max_allocated_dimen
+\permanent\countdef\c_syst_local_skip = 233 \c_syst_local_skip = \c_syst_max_allocated_skip
+\permanent\countdef\c_syst_local_muskip = 234 \c_syst_local_muskip = \c_syst_max_allocated_muskip
+\permanent\countdef\c_syst_local_box = 235 \c_syst_local_box = \c_syst_max_allocated_box
+\permanent\countdef\c_syst_local_toks = 236 \c_syst_local_toks = \c_syst_max_allocated_toks
+\permanent\countdef\c_syst_local_read = 237 \c_syst_local_read = \c_syst_max_allocated_read
+\permanent\countdef\c_syst_local_write = 238 \c_syst_local_write = \c_syst_max_allocated_write
+
+\c_syst_max_allocated_count \numexpr\c_syst_max_allocated_count :2\relax % floor
+\c_syst_max_allocated_dimen \numexpr\c_syst_max_allocated_dimen :2\relax % floor
+\c_syst_max_allocated_skip \numexpr\c_syst_max_allocated_skip :2\relax % floor
+\c_syst_max_allocated_muskip \numexpr\c_syst_max_allocated_muskip :2\relax % floor
+\c_syst_max_allocated_toks \numexpr\c_syst_max_allocated_toks :2\relax % floor
+\c_syst_max_allocated_box \numexpr\c_syst_max_allocated_box :2\relax % floor
+\c_syst_max_allocated_read \numexpr\c_syst_max_allocated_read :2\relax % floor
+\c_syst_max_allocated_write \numexpr\c_syst_max_allocated_write :2\relax % floor
\permanent\protected\def\syst_local_overflow#1#2{\writestatus\m!system{no room for local #1 \string#2}\wait}
-\permanent\protected\def\setnewlocaldimen#1%
- {\ifnum\c_syst_local_dimen>\c_syst_max_allocated_register
- \advance\c_syst_local_dimen\minusone\dimendef#1\c_syst_local_dimen
+\permanent\protected\def\setnewlocalcount#1%
+ {\ifnum\c_syst_local_count>\c_syst_max_allocated_count
+ \advanceby\c_syst_local_count\minusone
+ \overloaded\frozen\countdef#1\c_syst_local_count
\else
- \syst_local_overflow_dimen#1%
+ \syst_local_overflow_count#1%
\fi
#1}
-\permanent\protected\def\setnewlocalcount#1%
- {\ifnum\c_syst_local_count>\c_syst_max_allocated_register
- \advance\c_syst_local_count\minusone
- \overloaded\frozen\countdef#1\c_syst_local_count
+\permanent\protected\def\setnewlocaldimen#1%
+ {\ifnum\c_syst_local_dimen>\c_syst_max_allocated_dimen
+ \advanceby\c_syst_local_dimen\minusone\dimendef#1\c_syst_local_dimen
\else
- \syst_local_overflow_count#1%
+ \syst_local_overflow_dimen#1%
\fi
#1}
\permanent\protected\def\setnewlocalskip#1%
- {\ifnum\c_syst_local_skip>\c_syst_max_allocated_register
- \advance\c_syst_local_skip\minusone
+ {\ifnum\c_syst_local_skip>\c_syst_max_allocated_skip
+ \advanceby\c_syst_local_skip\minusone
\overloaded\frozen\skipdef#1\c_syst_local_skip
\else
\syst_local_overflow_skip#1%
@@ -1253,8 +1400,8 @@
#1}
\permanent\protected\def\setnewlocalmuskip#1%
- {\ifnum\c_syst_local_muskip>\c_syst_max_allocated_register
- \advance\c_syst_local_muskip\minusone
+ {\ifnum\c_syst_local_muskip>\c_syst_max_allocated_muskip
+ \advanceby\c_syst_local_muskip\minusone
\overloaded\frozen\muskipdef#1\c_syst_local_muskip
\else
\syst_local_overflow_muskip#1%
@@ -1262,8 +1409,8 @@
#1}
\permanent\protected\def\setnewlocaltoks#1%
- {\ifnum\c_syst_local_toks>\c_syst_max_allocated_register
- \advance\c_syst_local_toks\minusone
+ {\ifnum\c_syst_local_toks>\c_syst_max_allocated_toks
+ \advanceby\c_syst_local_toks\minusone
\overloaded\frozen\toksdef#1\c_syst_local_toks
\else
\syst_local_overflow_toks#1%
@@ -1271,8 +1418,8 @@
#1}
\permanent\protected\def\setnewlocalbox#1%
- {\ifnum\c_syst_local_box>\c_syst_max_allocated_register
- \advance\c_syst_local_box\minusone
+ {\ifnum\c_syst_local_box>\c_syst_max_allocated_box
+ \advanceby\c_syst_local_box\minusone
\overloaded\frozen\integerdef#1\c_syst_local_box
\else
\syst_local_overflow_box#1%
@@ -1280,16 +1427,16 @@
\setbox#1}
\permanent\protected\def\newlocalread#1% so no set
- {\ifnum\c_syst_local_read>\c_syst_max_allocated_register
- \advance\c_syst_local_read\minusone
+ {\ifnum\c_syst_local_read>\c_syst_max_allocated_read
+ \advanceby\c_syst_local_read\minusone
\overloaded\frozen\integerdef#1\c_syst_local_read
\else
\syst_local_overflow_read#1%
\fi}
\permanent\protected\def\newlocalwrite#1% so no set
- {\ifnum\c_syst_local_write>\c_syst_max_allocated_register
- \advance\c_syst_local_write\minusone
+ {\ifnum\c_syst_local_write>\c_syst_max_allocated_write
+ \advanceby\c_syst_local_write\minusone
\overloaded\frozen\integerdef#1\c_syst_local_write
\else
\syst_local_overflow_write#1%
@@ -1306,7 +1453,7 @@
\permanent\protected\def\syst_local_overflow_read {\syst_local_overflow {read}}
\permanent\protected\def\syst_local_overflow_write {\syst_local_overflow {write}}
-%D We sacrifice a little performance but save some tokens by not defineing these
+%D We sacrifice a little performance but save some tokens by not defining these
%D completely:
\permanent\protected\def\newlocalcount #1{\setnewlocalcount #1\zerocount }
@@ -1316,4 +1463,36 @@
\permanent\protected\def\newlocaltoks #1{\setnewlocaltoks #1\emptytoks }
\permanent\protected\def\newlocalbox #1{\setnewlocalbox #1\emptybox }
+%D Let's be detailed: grouplevel:inputlevel:catcodetable (bits 1 2 4)
+
+\tracinglevels\plusthree
+
+\permanent\protected\def\tracingcatcodes{\tracinglevels\plusseven}
+
+%D We just report duplicate patterns being ignored:
+
+\tracinghyphenation\plusone
+
+%D Sometimes nicer:
+
+\let\ifexpression\ifnumexpression
+
+%D This will be default:
+
+\autoparagraphmode\plusone % we need at least 1 in order to be able to switch to 2
+%autoparagraphmode\plustwo % because we define two \par delimited macros
+
+%D The same values apply as \type {\shownodedetails}. When set the box is shown in
+%D the the log file but that is pretty slow when we have much detail.
+
+\tracingfullboxes\zerocount
+
+%D We don't do this:
+
+% \setdefaultmathcodes % initializes traditional codes
+
+%D Catch
+
+\ifdefined\mathpunctuation \else \let\mathpunctuation\mathpunct \fi % fixed in 2.10.06
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/syst-lua.lmt b/Master/texmf-dist/tex/context/base/mkxl/syst-lua.lmt
index a89cea852bf..d8e06d4fd2f 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/syst-lua.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/syst-lua.lmt
@@ -15,13 +15,10 @@ local S, C, P, lpegmatch, lpegtsplitat = lpeg.S, lpeg.C, lpeg.P, lpeg.match, lpe
local xmath = xmath or math
local xcomplex = xcomplex or { }
-local scan_next = token.scan_next or token.get_next
-local scan_cmdchr = token.scan_cmdchr_expanded
-local scan_token = token.scan_token
-
-local get_csname = token.get_csname
------ get_macro = token.get_macro
------ put_next = token.put_next
+----- scannext = token.scannext
+local scancmdchr = token.scancmdchrexpanded
+local scantoken = token.scantoken
+local getcsname = token.getcsname
local cmd = tokens.commands
local letter_code = cmd.letter
@@ -224,7 +221,7 @@ do
local w = 0
local r = 1
while true do
- local n, i = scan_cmdchr()
+ local n, i = scancmdchr()
if n == letter_code then
w = w + 1 ; word[w] = utfchar(i)
else
@@ -262,7 +259,7 @@ do
elseif n == char_given_code or n == math_given_code or n == xmath_given_code then
r = r + 1 ; result[r] = i
elseif n == some_item_code then
- local n = get_csname(t)
+ local n = getcsname(t)
if n then
local s = gettex(n)
if s then
@@ -274,7 +271,7 @@ do
unexpected(c)
end
-- elseif n == call_code then
- -- local n = get_csname(t)
+ -- local n = getcsname(t)
-- if n then
-- local s = get_macro(n)
-- if s then
@@ -287,7 +284,7 @@ do
-- end
-- elseif n == the_code or n == convert_code or n == lua_expandable_call_code then
-- put_next(t)
- -- scan_token() -- expands
+ -- scantoken() -- expands
else
unexpected(c)
end
@@ -345,10 +342,10 @@ do
local l = 0
implement {
- name = "openin",
- public = true,
- usage = "value",
- actions = function()
+ name = "openin",
+ public = true,
+ usage = "value",
+ actions = function()
local n = scaninteger()
scankeyword("=")
local s = scanstring(true)
@@ -368,10 +365,10 @@ do
}
implement {
- name = "closein",
- public = true,
- usage = "value",
- actions = function()
+ name = "closein",
+ public = true,
+ usage = "value",
+ actions = function()
local n = scaninteger()
local c = channels[n]
if c then
@@ -391,10 +388,10 @@ do
end
interfaces.implement {
- name = "read",
- public = true,
- usage = "value",
- actions = function(prefix)
+ name = "read",
+ public = true,
+ usage = "value",
+ actions = function(prefix)
local n = scaninteger()
local c = channels[n]
if scankeyword("line") and c then
diff --git a/Master/texmf-dist/tex/context/base/mkxl/syst-lua.mkxl b/Master/texmf-dist/tex/context/base/mkxl/syst-lua.mkxl
index 158682399a8..4b60ee59f53 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/syst-lua.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/syst-lua.mkxl
@@ -52,18 +52,21 @@
\popoverloadmode
%D We can omit the tex.ctxcatcodes here as nowadays we seldom change the regime at
-%D the \TEX\ end:
+%D the \TEX\ end. Beware: the expression is compiled each time so it is not that
+%D efficient.
-%def\luaexpr#1{\ctxlua{context (tostring(#1))}} % more efficient:
-\permanent\def\luaexpr#1{\ctxlua{tex.print(tostring(#1))}} % no use is shortcutting has to be compiled
+% \def\luaexpr #1{\ctxlua {context (tostring(#1))}} % more efficient:
+% \permanent\def\luaexpr #1{\ctxlua {tex.print(tostring(#1))}} % no use is shortcutting has to be compiled
+\tolerant\permanent\edef\luaexpr[#1]#:#2{\noexpand\cldcontext{\noexpand\iftok{#1}\noexpand\emptytoks\noexpand\else"\letterpercent #1",\noexpand\fi#2}}
%D But as we only use write 16 we could as well do all in \LUA\ and ignore the rest.
%D Okay, we still can do writes here but only when not blocked.
\aliased\let\syst_write_execute\clf_execute % always {...}
-%D There is a probably rather useless \type {\expression} command that can mix \LUA\ numeric
-%D expressions with \TEX\ commands (for as far that makes sense) that works like this:
+%D There is a probably rather useless \type {\expression} command that can mix \LUA\
+%D numeric expressions with \TEX\ commands (for as far that makes sense) that works
+%D like this:
%D
%D \starttyping
%D \mathchardef\foooo 1234
diff --git a/Master/texmf-dist/tex/context/base/mkxl/syst-mac.lmt b/Master/texmf-dist/tex/context/base/mkxl/syst-mac.lmt
index 410a49f8b11..bd1d8476ff6 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/syst-mac.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/syst-mac.lmt
@@ -17,21 +17,21 @@ if not modules then modules = { } end modules ['syst-mac'] = {
local insert, remove = table.insert, table.remove
-local push_macro = token.push_macro
-local pop_macro = token.pop_macro
-local scan_csname = token.scan_csname
-local create_token = token.create
-local gobble_token = token.gobble
+local pushmacrotoken = token.pushmacro
+local popmacrotoken = token.popmacro
+local scancsname = token.scancsname
+local createtoken = token.create
+local gobbletoken = token.gobble
-local context = context
-local implement = interfaces.implement
+local context = context
+local implement = interfaces.implement
-local report = logs.reporter("system","macrostack")
+local report = logs.reporter("system","macrostack")
-local stack = table.setmetatableindex("table")
+local stack = table.setmetatableindex("table")
local function pushmacro(name,global)
- local s = push_macro(name,global)
+ local s = pushmacrotoken(name,global)
if s then
insert(stack[name],s)
else
@@ -43,7 +43,7 @@ end
local function popmacro(name)
local s = remove(stack[name])
if s then
- pop_macro(s)
+ popmacrotoken(s)
else
report("no macro %a to pop",name)
end
@@ -57,7 +57,7 @@ implement {
public = true,
protected = true,
actions = function()
- pushmacro(scan_csname())
+ pushmacro(scancsname())
end
}
@@ -66,7 +66,7 @@ implement {
public = true,
protected = true,
actions = function()
- pushmacro(scan_csname(),true)
+ pushmacro(scancsname(),true)
end
}
@@ -75,7 +75,7 @@ implement {
public = true,
protected = true,
actions = function()
- popmacro(scan_csname())
+ popmacro(scancsname())
end
}
@@ -84,7 +84,7 @@ implement {
public = true,
protected = true,
actions = function()
- popmacro(scan_csname())
+ popmacro(scancsname())
end
}
@@ -93,7 +93,7 @@ implement {
public = true,
protected = true,
actions = function()
- local n = scan_csname()
+ local n = scancsname()
local s = stack[n]
local m = #s
report("%s : %i stack slots used",n,m)
@@ -109,8 +109,8 @@ implement {
protected = true,
arguments = "3 strings",
actions = function(start,stop,command)
- gobble_token(create_token(start),create_token(stop))
- if command then
+ gobbletoken(createtoken(start),createtoken(stop))
+ if command and command ~= "" then
context[command]()
end
end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/syst-pln.mkxl b/Master/texmf-dist/tex/context/base/mkxl/syst-pln.mkxl
index 38ec9c4c1c5..f6c0f6556b9 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/syst-pln.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/syst-pln.mkxl
@@ -57,8 +57,8 @@
\pretolerance = 100
\relpenalty = 500
\righthyphenmin = 3
-\showboxbreadth = 5
-\showboxdepth = 3
+%showboxbreadth = 5
+%showboxdepth = 3
%time = 0
\tolerance = 200
%tracingcommands = 0
diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-com.mkxl b/Master/texmf-dist/tex/context/base/mkxl/tabl-com.mkxl
index bdae8711bb9..d8eb7ada7eb 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/tabl-com.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-com.mkxl
@@ -17,72 +17,98 @@
\pushoverloadmode
+\registerctxluafile{node-ali}{autosuffix}
+
+\definesystemattribute[aligncharacter][public]
+
+\permanent\protected\def\setalignmentcharacter#1%
+ {\enablealignmentcharacter
+ \global\settrue\c_tabl_use_size
+ \global\settrue\c_tabl_sparse_skips
+ \enforced\permanent\protected\gdef\setalignmentcharacter##1%
+ {\attribute\aligncharacterattribute`##1\relax}%
+ \attribute\aligncharacterattribute`#1\relax}
+
+\permanent\protected\def\resetalignmentcharacter
+ {\attribute\aligncharacterattribute\attributeunsetvalue}
+
+\permanent\def\alignmentcharactertrigger
+ {\s!callback\space\s!attr\aligncharacterattribute\plusone}
+
+\noaligned\permanent\protected\def\aligncontentleft {\ignorespaces\aligncontent\unskip\hss}
+\noaligned\permanent\protected\def\aligncontentmiddle{\hss\ignorespaces\aligncontent\unskip\hss}
+\noaligned\permanent\protected\def\aligncontentright {\hss\ignorespaces\aligncontent\unskip}
+
+% \enablealignmentcharacter % defined at the lua end
+
% maybe frozen instead
-\permanent\let\AR\relax
-\permanent\let\BA\relax
-\permanent\let\BC\relax
-\permanent\let\BH\relax
-\permanent\let\BL\relax
-\permanent\let\BR\relax
-\permanent\let\CC\relax
-\permanent\let\CL\relax
-\permanent\let\CM\relax
-\permanent\let\CR\relax
-\permanent\let\DB\relax
-\permanent\let\DC\relax
-\permanent\let\DL\relax
-\permanent\let\DR\relax
-\permanent\let\DV\relax
-\permanent\let\EH\relax
-\permanent\let\EQ\relax
-\permanent\let\ER\relax
-\permanent\let\FB\relax
-\permanent\let\FL\relax
-\permanent\let\FR\relax
-\permanent\let\HC\relax
-\permanent\let\HL\relax
-\permanent\let\HQ\relax
-\permanent\let\HR\relax
-\permanent\let\LB\relax
-\permanent\let\LC\relax
-\permanent\let\LT\relax
-\permanent\let\LL\relax
-\permanent\let\LR\relax
-\permanent\let\MC\relax
-\permanent\let\ML\relax
-\permanent\let\MR\relax
-\permanent\let\NA\relax
-\permanent\let\NB\relax
-\permanent\let\NC\relax
-\permanent\let\ND\relax
-\permanent\let\NF\relax
-\permanent\let\NG\relax
-\permanent\let\NI\relax
-\permanent\let\NL\relax
-\permanent\let\NN\relax
-\permanent\let\NP\relax
-\permanent\let\NR\relax
-\permanent\let\PB\relax
-\permanent\let\RC\relax
-\permanent\let\RQ\relax
-\permanent\let\SL\relax
-\permanent\let\SM\relax
-\permanent\let\SR\relax
-\permanent\let\TB\relax
-\permanent\let\TL\relax
-\permanent\let\TR\relax
-\permanent\let\VL\relax
-\permanent\let\VC\relax
-\permanent\let\VD\relax
-\permanent\let\VN\relax
-\permanent\let\VS\relax
-\permanent\let\VT\relax
-\permanent\let\XC\relax
-
-\permanent\let\FC\relax
-\permanent\let\RB\relax
-\permanent\let\RT\relax
+\permanent\protected\lettonothing\AR
+\permanent\protected\lettonothing\BA
+\permanent\protected\lettonothing\BC
+\permanent\protected\lettonothing\BH
+\permanent\protected\lettonothing\BL
+\permanent\protected\lettonothing\BR
+\permanent\protected\lettonothing\CC
+\permanent\protected\lettonothing\CL
+\permanent\protected\lettonothing\CM
+\permanent\protected\lettonothing\CR
+\permanent\protected\lettonothing\DB
+\permanent\protected\lettonothing\DC
+\permanent\protected\lettonothing\DL
+\permanent\protected\lettonothing\DR
+\permanent\protected\lettonothing\DV
+\permanent\protected\lettonothing\EH
+\permanent\protected\lettonothing\EQ
+\permanent\protected\lettonothing\ER
+\permanent\protected\lettonothing\FB
+\permanent\protected\lettonothing\FL
+\permanent\protected\lettonothing\FR
+\permanent\protected\lettonothing\HC
+\permanent\protected\lettonothing\HL
+\permanent\protected\lettonothing\HQ
+\permanent\protected\lettonothing\HR
+\permanent\protected\lettonothing\LB
+\permanent\protected\lettonothing\LC
+\permanent\protected\lettonothing\LT
+\permanent\protected\lettonothing\LL
+\permanent\protected\lettonothing\LR
+\permanent\protected\lettonothing\MC
+\permanent\protected\lettonothing\ML
+\permanent\protected\lettonothing\MR
+\permanent\protected\lettonothing\NA
+\permanent\protected\lettonothing\NB
+\permanent\protected\lettonothing\NC
+\permanent\protected\lettonothing\ND
+\permanent\protected\lettonothing\NF
+\permanent\protected\lettonothing\NG
+\permanent\protected\lettonothing\NI
+\permanent\protected\lettonothing\NL
+\permanent\protected\lettonothing\NN
+\permanent\protected\lettonothing\NP
+\permanent\protected\lettonothing\NR
+\permanent\protected\lettonothing\PB
+\permanent\protected\lettonothing\RC
+\permanent\protected\lettonothing\RQ
+\permanent\protected\lettonothing\SL
+\permanent\protected\lettonothing\SM
+\permanent\protected\lettonothing\SR
+\permanent\protected\lettonothing\TB
+\permanent\protected\lettonothing\TL
+\permanent\protected\lettonothing\TR
+\permanent\protected\lettonothing\VL
+\permanent\protected\lettonothing\VC
+\permanent\protected\lettonothing\VD
+\permanent\protected\lettonothing\VN
+\permanent\protected\lettonothing\VS
+\permanent\protected\lettonothing\VT
+\permanent\protected\lettonothing\XC
+
+\permanent\protected\lettonothing\FC
+\permanent\protected\lettonothing\RB
+\permanent\protected\lettonothing\RT
+
+\permanent\protected\lettonothing\NS % span
\popoverloadmode
diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-frm.mkxl b/Master/texmf-dist/tex/context/base/mkxl/tabl-frm.mkxl
index ec530e7a4a5..e19ea34fee3 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/tabl-frm.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-frm.mkxl
@@ -21,11 +21,11 @@
\installcorenamespace{framedtablerow}
\installcorenamespace{framedtablecolumn}
-\newcount\c_tabl_framed_c
-\newcount\c_tabl_framed_r
-\newdimen\d_tabl_framed_h
-\newdimen\d_tabl_framed_d
-\newdimen\b_tabl_framed
+\newinteger \c_tabl_framed_c
+\newinteger \c_tabl_framed_r
+\newdimension\d_tabl_framed_h \def\d_tabl_framed_h_reference{\d_tabl_framed_h}%
+\newdimension\d_tabl_framed_d
+\newdimension\b_tabl_framed
\initializeboxstack\??framedtable
@@ -102,19 +102,20 @@
\setupframed[\??framedtablecolumn#1:#2][#3]%
\fi}
-\mutable\let\currentframedtable\empty
+\mutable\lettonothing\currentframedtable
\permanent\tolerant\protected\def\startframedtable[#1]#*[#2]%
{\begingroup
\forgetall
\ifhastok={#1}%
- \let\currentframedtable\empty
+ \lettonothing\currentframedtable
\setupframed[\??framedtable][#1]%
\else
\edef\currentframedtable{#1}%
\setupframed[\??framedtable][#2]%
\fi
\edef\currentframed{\??framedtable\currentframedtable}%
+ \pack_framed_initialize
\c_tabl_framed_r\zerocount
\d_tabl_framed_d\framedparameter\c!distance
\framedparameter\c!before}
@@ -126,7 +127,7 @@
% a two pass variant that deals with the height .. so no catcode changes here
\tolerant\protected\def\pack_framed_start_framed_whatever[#1]%
- {\pack_framed_initialize
+ {\pack_framed_initialize % moved up
\bgroup
\setupcurrentframed[#1]% here !
\pack_framed_process_indeed
@@ -134,7 +135,7 @@
\ignorespaces}
% \permanent\protected\def\startframedrow
-% {\advance\c_tabl_framed_r\plusone
+% {\advanceby\c_tabl_framed_r\plusone
% \c_tabl_framed_c\zerocount
% \d_tabl_framed_h\zeropoint
% \bgroup
@@ -159,12 +160,12 @@
{\vpack to \d_tabl_framed_h{\flushbox\??framedtable{\number\fastloopindex}\vfill}%
\ifzeropt\d_tabl_framed_d\else\kern\d_tabl_framed_d\fi}
-\newcount\c_tabl_framed_pass
+\newinteger\c_tabl_framed_pass
\permanent\let\stopframedrow\relax
\permanent\protected\def\startframedrow#1\stopframedrow
- {\advance\c_tabl_framed_r\plusone
+ {\advanceby\c_tabl_framed_r\plusone
\startframedrow_one#1\stopframedrow_one
\startframedrow_two#1\stopframedrow_two}
@@ -204,7 +205,7 @@
\ifzeropt\d_tabl_framed_d\else\kern\d_tabl_framed_d\fi}
\permanent\protected\def\startframedcell
- {\advance\c_tabl_framed_c\plusone
+ {\advanceby\c_tabl_framed_c\plusone
\setbox\b_tabl_framed\hpack\bgroup
%\bgroup
\edef\currentframed{\number\c_tabl_framed_c}%
@@ -217,10 +218,10 @@
\fi}%
\ifcase\c_tabl_framed_pass
\or
- \letframedparameter\c!background\empty
+ \resetframedparameter\c!background
\letframedparameter\c!frame\v!off
\or
- \letframedparameter\c!height\d_tabl_framed_h
+ \letframedparameter\c!height\d_tabl_framed_h_reference
\fi
\pack_framed_start_framed_whatever}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-ltb.mkxl b/Master/texmf-dist/tex/context/base/mkxl/tabl-ltb.mkxl
index ec4a373603b..7fcdba6f2ad 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/tabl-ltb.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-ltb.mkxl
@@ -70,23 +70,23 @@
\newconditional \c_tabl_lines_preroll
\newconditional \c_tabl_lines_in_table
-\newdimen \d_tabl_lines_width
-\newdimen \d_tabl_lines_height
-%newdimen \d_tabl_lines_depth
+\newdimension \d_tabl_lines_width
+\newdimension \d_tabl_lines_height
+%newdimension \d_tabl_lines_depth
\newbox \b_tabl_lines_cell
-\newcount \c_tabl_lines_n_of_columns
-\newcount \c_tabl_lines_n_of_rows
-\newcount \c_tabl_lines_n_of_lines
-\newcount \c_tabl_lines_n_of_parts
-\newcount \c_tabl_lines_part \c_tabl_lines_part\plusone
-\newcount \c_tabl_lines_step \c_tabl_lines_step\plusone
-\newcount \c_tabl_lines_line
-\newcount \c_tabl_lines_row
-\newcount \c_tabl_lines_rows
-\newcount \c_tabl_lines_column
-\newcount \c_tabl_lines_subcol
+\newinteger \c_tabl_lines_n_of_columns
+\newinteger \c_tabl_lines_n_of_rows
+\newinteger \c_tabl_lines_n_of_lines
+\newinteger \c_tabl_lines_n_of_parts
+\newinteger \c_tabl_lines_part \c_tabl_lines_part\plusone
+\newinteger \c_tabl_lines_step \c_tabl_lines_step\plusone
+\newinteger \c_tabl_lines_line
+\newinteger \c_tabl_lines_row
+\newinteger \c_tabl_lines_rows
+\newinteger \c_tabl_lines_column
+\newinteger \c_tabl_lines_subcol
\newconstant \c_tabl_lines_hmode
\newconstant \c_tabl_lines_page
@@ -140,7 +140,8 @@
\permanent\def\linetablerparameter#1% faster, leaner and meaner
{\begincsname
\??linetable
- \ifnum\c_tabl_lines_row=\zerocount % geen ifcase
+ % \ifnum\c_tabl_lines_row=\zerocount % geen ifcase
+ \ifzero\c_tabl_lines_row
\ifcsname\??linetable r:\v!header#1\endcsname
r:\v!header
\orelse\ifcsname\??linetable r:0#1\endcsname
@@ -181,9 +182,9 @@
\fi}
\def\tabl_lines_step_cell
- {\advance\scratchdimen\linetablecparameter\c!width
- \global\advance \c_tabl_lines_column\plusone
- \advance\scratchskip \linetablecparameter\c!distance}
+ {\advanceby\scratchdimen\linetablecparameter\c!width
+ \global\advanceby \c_tabl_lines_column\plusone
+ \advanceby\scratchskip \linetablecparameter\c!distance}
\permanent\tolerant\protected\def\startlinetablecell[#1]%
{\global\setbox\b_tabl_lines_cell\hbox\bgroup
@@ -226,8 +227,8 @@
% 1 = width, fixed height
% 2 = no width, auto hsize
\ifnum\c_tabl_lines_mode<\plustwo
- \advance\scratchdimen-\linetablecparameter\c!leftoffset
- \advance\scratchdimen-\linetablecparameter\c!rightoffset
+ \advanceby\scratchdimen-\linetablecparameter\c!leftoffset
+ \advanceby\scratchdimen-\linetablecparameter\c!rightoffset
\fi
\ifcase\c_tabl_lines_mode
\dosetraggedcommand{\linetablecparameter\c!align}%
@@ -261,8 +262,7 @@
\egroup}
\def\tabl_lines_wrap_up
- {\edef\p_background{\linetablecparameter\c!background}%
- \ifx\p_background\v!color
+ {\ifcstok{\linetablecparameter\c!background}\v!color
\ifconditional\linetableautoheight
\tabl_lines_wrap_up_auto
\else
@@ -325,23 +325,19 @@
\else
\vbox
{\ifvoid\b_tabl_lines_current\c_tabl_lines_part\else\unvbox\b_tabl_lines_current\c_tabl_lines_part\fi
- \edef\p_background{\linetablerparameter\c!background}%
- \ifx\p_background\v!color
+ \ifcstok{\linetablerparameter\c!background}\v!color
\backgroundline[\linetablerparameter\c!backgroundcolor]{\box\scratchbox}%
+ \orelse\iftok{\linetablerparameter\c!type}\emptytoks
+ \box\scratchbox
\else
- \edef\p_type{\linetablerparameter\c!type}%
- \ifempty\p_type
- \box\scratchbox
- \else
- \tabl_lines_wrap_up_auto_r
- \fi
+ \tabl_lines_wrap_up_auto_r
\fi
\endgraf
\linetablerparameter\c!after}%
\fi}
\def\tabl_lines_flush_parts
- {\global\advance\c_tabl_lines_line\plusone
+ {\global\advanceby\c_tabl_lines_line\plusone
\ifnum\c_tabl_lines_line<\c_tabl_lines_n_of_lines
% keep collecting
\else
@@ -353,7 +349,7 @@
\dp\b_tabl_lines_current\c_tabl_lines_part\strutdepth
% noindent en endgraf needed else whitespace mess-up!
\whitespace % here not after verticalstrut
- \ifdim\topskipgap=\zeropoint\else
+ \ifzeropt\topskipgap\else
\verticalstrut
\nobreak
\kern-\struttotal
@@ -396,44 +392,39 @@
\unskip \unskip % remove last intercolumn skip (distance+fill)
\fi
\egroup
- \ifconditional\c_tabl_lines_preroll \else
- \ifcase\c_tabl_lines_part
- % we're collecting the repeater
- \else
- \ifdim\dimexpr\hsize-\wd\scratchbox\relax>\linetableparameter\c!stretch\else
- \setbox\scratchbox\hpack to \hsize{\unhbox\scratchbox}%
- \fi
- \fi
+ \ifconditional\c_tabl_lines_preroll
+ \orelse\ifcase\c_tabl_lines_part
+ % we're collecting the repeater
+ \orelse\ifdim\dimexpr\hsize-\wd\scratchbox\relax>\linetableparameter\c!stretch
+ \else
+ \setbox\scratchbox\hpack to \hsize{\unhbox\scratchbox}%
\fi}
\def\tabl_lines_check_part
- {\global\advance\d_tabl_lines_width\wd\b_tabl_lines_cell
- \global\advance\c_tabl_lines_column\c_tabl_lines_step
- \global\advance\c_tabl_lines_subcol\c_tabl_lines_step
+ {\global\advanceby\d_tabl_lines_width\wd\b_tabl_lines_cell
+ \global\advanceby\c_tabl_lines_column\c_tabl_lines_step
+ \global\advanceby\c_tabl_lines_subcol\c_tabl_lines_step
\relax
%\message{\the\c_tabl_lines_column,\the\c_tabl_lines_subcol}\wait
% from now on the column counter is already incremented
\ifcase\c_tabl_lines_split_state
- \ifconditional\c_tabl_lines_preroll \else
+ \ifconditional\c_tabl_lines_preroll
+ \else
\box\b_tabl_lines_cell
% the columncounter is one ahead !
\hskip\scratchskip
\fi
%%%
\donefalse
- \ifcase\c_tabl_lines_repeat\else
- % calculate ahead
- \ifnum\c_tabl_lines_repeat=\numexpr\c_tabl_lines_column-\plustwo\relax
- \donetrue % collecting repeater
- \fi
+ \ifcase\c_tabl_lines_repeat
+ \orelse\ifnum\c_tabl_lines_repeat=\numexpr\c_tabl_lines_column-\plustwo\relax % calculate ahead
+ \donetrue % collecting repeater
\fi
%%%%
\ifdone
% collecting repeater
- \else
- \ifnum\c_tabl_lines_column>\csname\??linetablepart\number\c_tabl_lines_part\endcsname\relax
- \donetrue
- \fi
+ \orelse\ifnum\c_tabl_lines_column>\csname\??linetablepart\number\c_tabl_lines_part\endcsname\relax
+ \donetrue
\fi
\ifdone
\tabl_lines_stop_part
@@ -445,7 +436,7 @@
\else
\global\c_tabl_lines_page \plusone
\fi
- \global\advance\c_tabl_lines_part\plusone
+ \global\advanceby\c_tabl_lines_part\plusone
\global\d_tabl_lines_width\wd\b_tabl_lines_current\zerocount
\tabl_lines_start_part
\fi
@@ -464,7 +455,7 @@
\orelse\ifdim\d_tabl_lines_width>\hsize
\donetrue
\else
- \global\advance\d_tabl_lines_width\scratchskip
+ \global\advanceby\d_tabl_lines_width\scratchskip
\ifdim\d_tabl_lines_width>\hsize % ?
\donetrue
\fi
@@ -477,7 +468,7 @@
\else
\global\c_tabl_lines_page \plusone
\fi
- \global\advance\c_tabl_lines_part\plusone
+ \global\advanceby\c_tabl_lines_part\plusone
\ifnum\c_tabl_lines_part>\c_tabl_lines_n_of_parts
\global\c_tabl_lines_n_of_parts\c_tabl_lines_part
\tabl_lines_initialize_box\c_tabl_lines_part
@@ -486,9 +477,10 @@
\tabl_lines_start_part
\ifscratchconditionone \orelse \ifcase\c_tabl_lines_repeat \else
% check for left/right page
- \ifcase\c_tabl_lines_page\donetrue\or\donetrue\or\donefalse\fi\ifdone
+ \ifcase\c_tabl_lines_page\donetrue\or\donetrue\or\donefalse\fi
+ \ifdone
% insert repeater
- \global\advance\d_tabl_lines_width\wd\b_tabl_lines_current\zerocount
+ \global\advanceby\d_tabl_lines_width\wd\b_tabl_lines_current\zerocount
\ifconditional\c_tabl_lines_preroll\kern\wd\else\unhcopy\fi\b_tabl_lines_current\zerocount
\fi
\fi
@@ -529,8 +521,8 @@
\global\c_tabl_lines_n_of_parts\zerocount
\scratchcounter\zerocount
\def\docommand##1%
- {\global\advance\c_tabl_lines_n_of_parts\plusone
- \advance\scratchcounter##1%
+ {\global\advanceby\c_tabl_lines_n_of_parts\plusone
+ \advanceby\scratchcounter##1%
\xdefcsname\??linetablepart\number\c_tabl_lines_n_of_parts\endcsname{\the\scratchcounter}}%
\processcommacommand[\linetableparameter\c!n]\docommand
\tabl_lines_initialize_boxes\c_tabl_lines_n_of_parts
@@ -583,8 +575,8 @@
\permanent\tolerant\protected\def\tabl_lines_BR[#1]% #1 not yet implemented
{\ifnum\c_tabl_lines_head_state=1\else
- \global\advance\c_tabl_lines_row\plusone
- \global\advance\c_tabl_lines_rows\plusone
+ \global\advanceby\c_tabl_lines_row\plusone
+ \global\advanceby\c_tabl_lines_rows\plusone
\fi
\global\c_tabl_lines_column\plusone
\global\c_tabl_lines_subcol\plusone
@@ -618,7 +610,7 @@
% no \box\b_tabl_lines_cell, i.e. dummy columnn, last \NC \NR
\tabl_lines_stop_part
\tabl_lines_save_part
- \advance\c_tabl_lines_column \minusone
+ \advanceby\c_tabl_lines_column \minusone
\ifnum\c_tabl_lines_column>\c_tabl_lines_n_of_columns
\global\c_tabl_lines_n_of_columns\c_tabl_lines_column
\fi
@@ -636,8 +628,9 @@
\def\tabl_lines_check_page
{\global\c_tabl_lines_page\zerocount
\ifcase\c_tabl_lines_repeat\orelse\ifcase\c_tabl_lines_page
- \doif{\linetableparameter\c!repeat}\v!no
- {\global\c_tabl_lines_page\doifelseoddpage\plusone\plustwo}%
+ \iftok{\linetableparameter\c!repeat}\v!no
+ \global\c_tabl_lines_page\doifelseoddpage\plusone\plustwo
+ \fi
\fi}
\def\tabl_lines_flush_head
@@ -694,7 +687,7 @@
% todo: store in box instead of macro
-\aliased\let\stoplinetablehead\relax
+\permanent\protected\lettonothing\stoplinetablehead
\permanent\protected\def\startlinetablehead#1\stoplinetablehead
{\ifconditional\c_tabl_lines_in_table
diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-mis.mkxl b/Master/texmf-dist/tex/context/base/mkxl/tabl-mis.mkxl
index 7b6f0ffac1f..e65c97e0de1 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/tabl-mis.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-mis.mkxl
@@ -153,10 +153,10 @@
\typo_paragraphs_setup_saved[\currentparagraphs:1][\c!distance=\zeropoint]%
\to \everydefineparagraphs
-\newcount\c_typo_paragraphs_n
-\newcount\c_typo_paragraphs_max
-\newdimen\d_typo_paragraphs_width
-\newdimen\d_typo_paragraphs_auto
+\newinteger \c_typo_paragraphs_n
+\newinteger \c_typo_paragraphs_max
+\newdimension\d_typo_paragraphs_width
+\newdimension\d_typo_paragraphs_auto
\let\typo_paragraphs_start_cell\relax
\let\typo_paragraphs_stop_cell \relax
@@ -171,22 +171,22 @@
\else
\d_typo_paragraphs_width\p_width\relax
\fi
- \advance\d_typo_paragraphs_width-2\dimexpr\paragraphsparameter\c!offset\relax
+ \advanceby\d_typo_paragraphs_width-2\dimexpr\paragraphsparameter\c!offset\relax
\c_typo_paragraphs_max\paragraphsparameter\c!n\relax
\d_typo_paragraphs_auto\d_typo_paragraphs_width\relax
\scratchcounter\zerocount
\dorecurse\c_typo_paragraphs_max
{\edef\p_width{\namedparagraphsparameter{\currentparagraphs:\recurselevel}\c!width}%
\ifempty\p_width
- \advance\scratchcounter\plusone
+ \advanceby\scratchcounter\plusone
\else
- \advance\d_typo_paragraphs_auto-\p_width\relax
+ \advanceby\d_typo_paragraphs_auto-\p_width\relax
\fi
\ifnum\recurselevel>\plusone
- \advance\d_typo_paragraphs_auto-\namedparagraphsparameter{\currentparagraphs:\recurselevel}\c!distance\relax
+ \advanceby\d_typo_paragraphs_auto-\namedparagraphsparameter{\currentparagraphs:\recurselevel}\c!distance\relax
\fi}%
\ifnum\scratchcounter>\zerocount
- \divide\d_typo_paragraphs_auto\scratchcounter
+ \divideby\d_typo_paragraphs_auto\scratchcounter
\else
\d_typo_paragraphs_auto\zeropoint
\fi
@@ -200,7 +200,7 @@
\setbox\scratchbox\hpack
\bgroup % (2)
\forgetall
- \advance\hsize-2\scratchoffset
+ \advanceby\hsize-2\scratchoffset
\let\typo_paragraphs_start_cell\typo_paragraphs_start_cell_indeed
\let\typo_paragraphs_stop_cell \typo_paragraphs_stop_cell_indeed
\typo_paragraphs_start_cell_indeed}
@@ -223,7 +223,7 @@
\def\typo_paragraphs_start_cell_indeed
{\removeunwantedspaces
- \advance\c_typo_paragraphs_n\plusone
+ \advanceby\c_typo_paragraphs_n\plusone
\ifnum\c_typo_paragraphs_n>\c_typo_paragraphs_max
\expandafter\typo_paragraphs_start_cell_nop
\else
diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-ntb.mkxl b/Master/texmf-dist/tex/context/base/mkxl/tabl-ntb.mkxl
index 5b30c449ca4..6eb926b09e4 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/tabl-ntb.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-ntb.mkxl
@@ -105,7 +105,7 @@
\dotagTABLEcell
%\tabl_ntb_next_level
\font_styles_math_reset
- \usenaturaltablelocalstyleandcolor\c!style\c!color
+ \usenaturaltablelocalstyleandcolor\c!style\c!color % done twice ? needed for style (test onbly style)
\everypar\t_tabl_ntb_cell_start
\font_styles_math_start}
@@ -139,64 +139,64 @@
% \fi
% \fi}
-\newcount\c_tabl_ntb_row
-\newcount\c_tabl_ntb_col
-\newcount\c_tabl_ntb_spn
+\newinteger \c_tabl_ntb_row
+\newinteger \c_tabl_ntb_col
+\newinteger \c_tabl_ntb_spn
-\newcount\c_tabl_ntb_nx
-\newcount\c_tabl_ntb_ny
+\newinteger \c_tabl_ntb_nx
+\newinteger \c_tabl_ntb_ny
\setnewconstant\c_tabl_ntb_cell \plusone
\setnewconstant\c_tabl_ntb_none \plustwo
-\newcount\c_tabl_ntb_current_row
-\newcount\c_tabl_ntb_current_col
-\newcount\c_tabl_ntb_current_row_one
-\newcount\c_tabl_ntb_current_col_one
-\newcount\c_tabl_ntb_current_row_two
-\newcount\c_tabl_ntb_current_col_two
-\newcount\c_tabl_ntb_current_row_three
-\newcount\c_tabl_ntb_current_col_three
-\newcount\c_tabl_ntb_current_row_four
-\newcount\c_tabl_ntb_current_col_four
+\newinteger \c_tabl_ntb_current_row
+\newinteger \c_tabl_ntb_current_col
+\newinteger \c_tabl_ntb_current_row_one
+\newinteger \c_tabl_ntb_current_col_one
+\newinteger \c_tabl_ntb_current_row_two
+\newinteger \c_tabl_ntb_current_col_two
+\newinteger \c_tabl_ntb_current_row_three
+\newinteger \c_tabl_ntb_current_col_three
+\newinteger \c_tabl_ntb_current_row_four
+\newinteger \c_tabl_ntb_current_col_four
-\newcount\c_tabl_ntb_running_col
-\newcount\c_tabl_ntb_maximum_row
-\newcount\c_tabl_ntb_maximum_col
-\newcount\c_tabl_ntb_maximum_row_span
-\newcount\c_tabl_ntb_maximum_col_span
+\newinteger \c_tabl_ntb_running_col \def\c_tabl_ntb_running_col_reference{\c_tabl_ntb_running_col}
+\newinteger \c_tabl_ntb_maximum_row
+\newinteger \c_tabl_ntb_maximum_col
+\newinteger \c_tabl_ntb_maximum_row_span
+\newinteger \c_tabl_ntb_maximum_col_span
-\newcount\c_tabl_ntb_encountered_col
-\newcount\c_tabl_ntb_encountered_max
+\newinteger \c_tabl_ntb_encountered_col
+\newinteger \c_tabl_ntb_encountered_max
-\newtoks\t_tabl_ntb
-\newtoks\t_tabl_ntb_row
+\newtoks \t_tabl_ntb
+\newtoks \t_tabl_ntb_row
-\newconstant\c_tabl_tbl_pass
+\newconstant \c_tabl_tbl_pass
-\newtoks\t_tabl_ntb_head
-\newtoks\t_tabl_ntb_next
-\newtoks\t_tabl_ntb_body
-\newtoks\t_tabl_ntb_foot
+\newtoks \t_tabl_ntb_head
+\newtoks \t_tabl_ntb_next
+\newtoks \t_tabl_ntb_body
+\newtoks \t_tabl_ntb_foot
-\newcount\c_tabl_ntb_n_of_head_lines
-\newcount\c_tabl_ntb_n_of_next_lines
-\newcount\c_tabl_ntb_n_of_hdnx_lines
+\newinteger \c_tabl_ntb_n_of_head_lines
+\newinteger \c_tabl_ntb_n_of_next_lines
+\newinteger \c_tabl_ntb_n_of_hdnx_lines
-\newdimen\d_tabl_ntb_height
-\newdimen\d_tabl_ntb_width
+\newdimension \d_tabl_ntb_height
+\newdimension \d_tabl_ntb_width
-\newdimen\d_tabl_ntb_leftmargindistance
-\newdimen\d_tabl_ntb_rightmargindistance
-\newdimen\d_tabl_ntb_columndistance
-\newdimen\d_tabl_ntb_maxwidth
+\newdimension \d_tabl_ntb_leftmargindistance
+\newdimension \d_tabl_ntb_rightmargindistance
+\newdimension \d_tabl_ntb_columndistance
+\newdimension \d_tabl_ntb_maxwidth
-\newtoks\everyTABLEpass % public
+\newtoks \everyTABLEpass % public
-\newcount\tablecellrows % public (needs checking)
-\newcount\tablecellcolumns % public (needs checking)
+\newinteger \tablecellrows % public (needs checking)
+\newinteger \tablecellcolumns % public (needs checking)
-\newbox\b_tabl_ntb_final
+\newbox \b_tabl_ntb_final
%D For tagging and export:
@@ -205,10 +205,58 @@
\newconstant \c_tabl_ntb_foot
\newconditional \c_tabl_ntb_okay
+%D For local anchoring:
+
+\installcorenamespace{naturaltableanchor}
+
+\let\tabl_ntb_anchor_start \gobbletwoarguments
+\let\tabl_ntb_anchor_stop \relax
+\let\tabl_ntb_anchor_process\gobbleoneargument
+
+\lettonothing\m_tabl_ntb_anchor_background
+
+\let\xanchor\!!zerocount
+\let\yanchor\!!zerocount
+
+\def\tabl_ntb_anchor_start_indeed#1#2%
+ {\hpack\bgroup
+ \edef\xanchor{\number#2}%
+ \edef\yanchor{\number#1}%
+ \markanchor{matrix}{#1}{#2}}
+
+\let\tabl_ntb_anchor_stop_indeed\egroup
+
+\def\tabl_ntb_anchor_process_indeed#1%
+ {\localframed[\??naturaltableanchor]{\box#1}}
+
+\definesimplifiedframed
+ [\??naturaltableanchor]
+
+\setupframed
+ [\??naturaltableanchor]
+ [\c!synchronize=\v!background,
+ \c!background=\m_tabl_ntb_anchor_background]
+
+\def\tabl_ntb_anchor_setup
+ {\ifcstok{\naturaltablelocalparameter\c!synchronize}\v!background
+ \let\tabl_ntb_anchor_start\tabl_ntb_anchor_start_indeed
+ \let\tabl_ntb_anchor_stop\tabl_ntb_anchor_stop_indeed
+ \let\tabl_ntb_anchor_process\tabl_ntb_anchor_process_indeed
+ \edef\m_tabl_ntb_anchor_background{\naturaltablelocalparameter\c!background}%
+ \resetnaturaltablelocalparameter\c!background
+ \setlocalanchoring
+ \else
+ \lettonothing\m_tabl_ntb_anchor_background
+ \let\tabl_ntb_anchor_start\gobbletwoarguments
+ \let\tabl_ntb_anchor_stop\relax
+ \let\tabl_ntb_anchor_process\gobbleoneargument
+ \fi
+ \resetnaturaltablelocalparameter\c!synchronize}
+
%D We have already prepared the previous macros for nesting, so we only have to pop
%D in the right ones:
-\newcount\c_tabl_level
+\newinteger\c_tabl_level
\installglobalmacrostack\m_tabl_ntb_saved_row
\installglobalmacrostack\m_tabl_ntb_saved_col
@@ -232,11 +280,11 @@
\fi}
\protected\def\tabl_ntb_next_level
- {\advance\c_tabl_level\plusone
+ {\advanceby\c_tabl_level\plusone
\edef\m_tabl_tbl_level{\the\c_tabl_level}}
\protected\def\tabl_ntb_prev_level
- {\advance\c_tabl_level\minusone
+ {\advanceby\c_tabl_level\minusone
\edef\m_tabl_tbl_level{\the\c_tabl_level}}
\tabl_ntb_next_level % go to level 1
@@ -273,35 +321,43 @@
\installcorenamespace{naturaltablesqueeze}
\installcorenamespace{naturaltabletok}
-\letvalue{\??naturaltablesqueeze }\donefalse
-\letvalue{\??naturaltablesqueeze\v!fit }\donetrue
-\letvalue{\??naturaltablesqueeze\v!fixed}\donetrue
-\letvalue{\??naturaltablesqueeze\v!broad}\donetrue
-\letvalue{\??naturaltablesqueeze\v!local}\donetrue
+% \integerdefcsname
+% \dimensiondefcsname
+
+\letcsname\??naturaltablesqueeze \endcsname\donefalse
+\letcsname\??naturaltablesqueeze\v!fit \endcsname\donetrue
+\letcsname\??naturaltablesqueeze\v!fixed\endcsname\donetrue
+\letcsname\??naturaltablesqueeze\v!broad\endcsname\donetrue
+\letcsname\??naturaltablesqueeze\v!local\endcsname\donetrue
\def\tabl_ntb_let_gal{\gletcsname\??naturaltablegal\m_tabl_tbl_level\endcsname}
-\def\tabl_ntb_get_gal{\csname\??naturaltablegal\m_tabl_tbl_level\endcsname}
+\def\tabl_ntb_get_gal{\csname \??naturaltablegal\m_tabl_tbl_level\endcsname}
\def\tabl_ntb_let_tal#1{\gletcsname\??naturaltabletal\m_tabl_tbl_level:\number#1\endcsname}
-\def\tabl_ntb_get_tal#1{\csname\??naturaltabletal\m_tabl_tbl_level:\number#1\endcsname}
+\def\tabl_ntb_get_tal#1{\csname \??naturaltabletal\m_tabl_tbl_level:\number#1\endcsname}
\def\tabl_ntb_set_nob#1{\letcsname\??naturaltablenob\m_tabl_tbl_level:\number#1\endcsname\plusone}
-\def\tabl_ntb_get_nob#1{\ifcsname\??naturaltablenob\m_tabl_tbl_level:\number#1\endcsname\plusone\else\zerocount\fi}
+\def\tabl_ntb_get_nob#1{\ifcsname \??naturaltablenob\m_tabl_tbl_level:\number#1\endcsname\plusone\else\zerocount\fi}
-%def\tabl_ntb_set_tag#1#2{\edefcsname\??naturaltabletag\m_tabl_tbl_level:\number#1:\number#2\endcsname}
-\def\tabl_ntb_set_col#1#2{\edefcsname\??naturaltablecol\m_tabl_tbl_level:\number#1:\number#2\endcsname}
-\def\tabl_ntb_set_row#1#2{\edefcsname\??naturaltablerow\m_tabl_tbl_level:\number#1:\number#2\endcsname}
+%def\tabl_ntb_set_tag#1#2{\expandafter\integerdef\csname\??naturaltabletag\m_tabl_tbl_level:\number#1:\number#2\endcsname}
+\def\tabl_ntb_set_col#1#2{\expandafter\integerdef\csname\??naturaltablecol\m_tabl_tbl_level:\number#1:\number#2\endcsname}
+\def\tabl_ntb_set_row#1#2{\expandafter\integerdef\csname\??naturaltablerow\m_tabl_tbl_level:\number#1:\number#2\endcsname}
\def\tabl_ntb_let_tag#1#2{\letcsname\??naturaltabletag\m_tabl_tbl_level:\number#1:\number#2\endcsname}
\def\tabl_ntb_let_col#1#2{\letcsname\??naturaltablecol\m_tabl_tbl_level:\number#1:\number#2\endcsname}
\def\tabl_ntb_let_row#1#2{\letcsname\??naturaltablerow\m_tabl_tbl_level:\number#1:\number#2\endcsname}
-%def\tabl_ntb_set_wd#1#2{\xdefcsname\??naturaltablewd\m_tabl_tbl_level:\number#1:\number#2\endcsname} % global !
-\def\tabl_ntb_set_ht#1#2{\xdefcsname\??naturaltableht\m_tabl_tbl_level:\number#1:\number#2\endcsname} % global !
+% \let\tabl_ntb_let_col\tabl_ntb_set_col
+% \let\tabl_ntb_let_row\tabl_ntb_set_row
+
+%def\tabl_ntb_set_wd#1#2{\global\expandafter\dimensiondef\csname\??naturaltablewd\m_tabl_tbl_level:\number#1:\number#2\endcsname} % global !
+\def\tabl_ntb_set_ht#1#2{\global\expandafter\dimensiondef\csname\??naturaltableht\m_tabl_tbl_level:\number#1:\number#2\endcsname} % global !
%def\tabl_ntb_let_wd#1#2{\letcsname\??naturaltablewd\m_tabl_tbl_level:\number#1:\number#2\endcsname} % global !
\def\tabl_ntb_let_ht#1#2{\letcsname\??naturaltableht\m_tabl_tbl_level:\number#1:\number#2\endcsname} % global !
+% \let\tabl_ntb_let_ht\tabl_ntb_set_ht
+
\def\tabl_ntb_get_tag#1#2{\csname\??naturaltabletag\m_tabl_tbl_level:\number#1:\number#2\endcsname}
\def\tabl_ntb_get_col#1#2{\csname\??naturaltablecol\m_tabl_tbl_level:\number#1:\number#2\endcsname}
\def\tabl_ntb_get_row#1#2{\csname\??naturaltablerow\m_tabl_tbl_level:\number#1:\number#2\endcsname}
@@ -309,22 +365,27 @@
%def\tabl_ntb_get_wd#1#2{\csname\??naturaltablewd\m_tabl_tbl_level:\number#1:\number#2\endcsname}
\def\tabl_ntb_get_ht#1#2{\csname\??naturaltableht\m_tabl_tbl_level:\number#1:\number#2\endcsname}
-\def\tabl_ntb_set_wid#1{\xdefcsname\??naturaltablewid\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
-\def\tabl_ntb_set_hei#1{\xdefcsname\??naturaltablehei\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
-\def\tabl_ntb_set_dis#1{\xdefcsname\??naturaltabledis\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
-\def\tabl_ntb_set_aut#1{\xdefcsname\??naturaltableaut\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
+\def\tabl_ntb_set_wid#1{\global\expandafter\dimensiondef\csname\??naturaltablewid\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
+\def\tabl_ntb_set_hei#1{\global\expandafter\dimensiondef\csname\??naturaltablehei\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
+\def\tabl_ntb_set_dis#1{\global\expandafter\dimensiondef\csname\??naturaltabledis\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
+\def\tabl_ntb_set_aut#1{\global\expandafter\dimensiondef\csname\??naturaltableaut\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
\def\tabl_ntb_let_wid#1{\gletcsname\??naturaltablewid\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
\def\tabl_ntb_let_hei#1{\gletcsname\??naturaltablehei\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
\def\tabl_ntb_let_dis#1{\gletcsname\??naturaltabledis\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
\def\tabl_ntb_let_aut#1{\gletcsname\??naturaltableaut\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
+% \let\tabl_ntb_let_wid\tabl_ntb_set_wid
+% \let\tabl_ntb_let_hei\tabl_ntb_set_hei
+% \let\tabl_ntb_let_dis\tabl_ntb_set_dis
+% \let\tabl_ntb_let_aut\tabl_ntb_set_aut
+
\def\tabl_ntb_get_wid#1{\ifcsname\??naturaltablewid\m_tabl_tbl_level:\number#1\endcsname\lastnamedcs\else\zeropoint\fi}
\def\tabl_ntb_get_hei#1{\ifcsname\??naturaltablehei\m_tabl_tbl_level:\number#1\endcsname\lastnamedcs\else\zeropoint\fi}
\def\tabl_ntb_get_dis#1{\ifcsname\??naturaltabledis\m_tabl_tbl_level:\number#1\endcsname\lastnamedcs\else\zeropoint\fi}
\def\tabl_ntb_get_aut#1{\csname \??naturaltableaut\m_tabl_tbl_level:\number#1\endcsname}
-\def\tabl_ntb_let_bck#1#2{\global\expandafter\chardef\csname\??naturaltablebck\m_tabl_tbl_level:\number#1:\number#2\endcsname}
+\def\tabl_ntb_let_bck#1#2{\global\expandafter\integerdef\csname\??naturaltablebck\m_tabl_tbl_level:\number#1:\number#2\endcsname}
\def\tabl_ntb_get_bck#1#2{\csname\??naturaltablebck\m_tabl_tbl_level:\number#1:\number#2\endcsname}
@@ -358,11 +419,18 @@
%def\tabl_ntb_get_ref #1#2{\ifcsname\??naturaltableref\m_tabl_tbl_level:\number#1:\number#2\endcsname\csname\??naturaltableref\m_tabl_tbl_level:\number#1:\number#2\endcsname\fi}
\def\tabl_ntb_get_ref #1#2{\begincsname\??naturaltableref\m_tabl_tbl_level:\number#1:\number#2\endcsname}
-\def\tabl_ntb_set_spn #1{\letcsname\??naturaltablespn\m_tabl_tbl_level:\number#1\endcsname \!!plusone}
-\def\tabl_ntb_spn_doifelse#1{\ifcase0\csname\??naturaltablespn\m_tabl_tbl_level:\number#1\endcsname\relax % could be inlined
- \expandafter\secondoftwoarguments % unset
- \else
+% \def\tabl_ntb_set_spn #1{\letcsname\??naturaltablespn\m_tabl_tbl_level:\number#1\endcsname \!!plusone}
+% \def\tabl_ntb_spn_doifelse#1{\ifcase0\csname\??naturaltablespn\m_tabl_tbl_level:\number#1\endcsname\relax % could be inlined
+% \expandafter\secondoftwoarguments % unset
+% \else
+% \expandafter\firstoftwoarguments % a span
+% \fi}
+
+\def\tabl_ntb_set_spn #1{\letcsname\??naturaltablespn\m_tabl_tbl_level:\number#1\endcsname\plusone}
+\def\tabl_ntb_spn_doifelse#1{\ifcsname\??naturaltablespn\m_tabl_tbl_level:\number#1\endcsname
\expandafter\firstoftwoarguments % a span
+ \else
+ \expandafter\secondoftwoarguments % unset
\fi}
\protected\def\tabl_ntb_set_txt_process#1#2#3#4#5#6%
@@ -383,6 +451,7 @@
\newif\ifautoTBLcheckwidth \autoTBLcheckwidthtrue
\newif\ifappendTBLsetups \appendTBLsetupstrue
\newif\ifenableTBLbreak \enableTBLbreakfalse
+\newif\ifforceTBLpageflow \forceTBLpageflowfalse
\newif\ifmultipleTBLheads \multipleTBLheadsfalse
\newif\iftightTBLrowspan \tightTBLrowspantrue
\newif\iftightTBLcolspan \tightTBLcolspanfalse
@@ -398,9 +467,9 @@
\protected\def\tabl_ntb_cell_process#1#2[#3]{}
-\permanent\protected\def\bTC#1\eTC{\bTD#1\eTD} \aliased\let\eTC\relax
-\permanent\protected\def\bTX#1\eTX{\bTD#1\eTD} \aliased\let\eTX\relax
-\permanent\protected\def\bTY#1\eTY{\bTR#1\eTR} \aliased\let\eTY\relax
+\permanent\protected\def\bTC#1\eTC{\bTD#1\eTD} \permanent\protected\lettonothing\eTC
+\permanent\protected\def\bTX#1\eTX{\bTD#1\eTD} \permanent\protected\lettonothing\eTX
+\permanent\protected\def\bTY#1\eTY{\bTR#1\eTR} \permanent\protected\lettonothing\eTY
\let\tabl_ntb_parameters_get\setupcurrentnaturaltablelocal
@@ -444,28 +513,38 @@
\def\tabl_ntb_setup_three[#1]{\ifcsname\??naturaltablesetupthree#1\endcsname\expandafter\lastnamedcs\else\expandafter\tabl_ntb_setup_un\fi[#1]}
\def\tabl_ntb_setup_two [#1]{\ifcsname\??naturaltablesetuptwo #1\endcsname\expandafter\lastnamedcs\else\expandafter\tabl_ntb_setup_ux\fi[#1]}
-\setvalue{\??naturaltablesetupthree \v!row}[#1]{\tabl_ntb_setup_xy [\c!y]}
-\setvalue{\??naturaltablesetupthree \v!column}[#1]{\tabl_ntb_setup_xy [\c!x]}
-\setvalue{\??naturaltablesetupthree \v!start}[#1]{\tabl_ntb_setup_xy [\v!start]}
-\setvalue{\??naturaltablesetupthree \v!header}[#1]{\tabl_ntb_setup_xy [\v!header]}
+\defcsname\??naturaltablesetupthree \v!row\endcsname[#1]{\tabl_ntb_setup_xy [\c!y]}
+\defcsname\??naturaltablesetupthree \v!column\endcsname[#1]{\tabl_ntb_setup_xy [\c!x]}
+\defcsname\??naturaltablesetupthree \v!start\endcsname[#1]{\tabl_ntb_setup_xy [\v!start]}
+\defcsname\??naturaltablesetupthree \v!header\endcsname[#1]{\tabl_ntb_setup_xy [\v!header]}
+
+\defcsname\??naturaltablesetuptwo \v!row\endcsname[#1]{\tabl_ntb_setup_each[\c!y]}
+\defcsname\??naturaltablesetuptwo \v!column\endcsname[#1]{\tabl_ntb_setup_each[\c!x]}
+\defcsname\??naturaltablesetuptwo \v!start\endcsname[#1]{\tabl_ntb_setup_each[\v!start]}
+\defcsname\??naturaltablesetuptwo \v!header\endcsname[#1]{\tabl_ntb_setup_each[\v!header]}
+
+\letcsname\??naturaltablesetupthree\s!unknown\endcsname\tabl_ntb_setup_un
+\letcsname\??naturaltablesetuptwo \s!unknown\endcsname\tabl_ntb_setup_ux
-\setvalue{\??naturaltablesetuptwo \v!row}[#1]{\tabl_ntb_setup_each[\c!y]}
-\setvalue{\??naturaltablesetuptwo \v!column}[#1]{\tabl_ntb_setup_each[\c!x]}
-\setvalue{\??naturaltablesetuptwo \v!start}[#1]{\tabl_ntb_setup_each[\v!start]}
-\setvalue{\??naturaltablesetuptwo \v!header}[#1]{\tabl_ntb_setup_each[\v!header]}
+% \letcsnamecsname\csname\??naturaltablesetupthree r\endcsname\csname\??naturaltablesetupthree \v!row\endcsname
+% \letcsnamecsname\csname\??naturaltablesetupthree c\endcsname\csname\??naturaltablesetupthree\v!column\endcsname
+% \letcsnamecsname\csname\??naturaltablesetupthree y\endcsname\csname\??naturaltablesetupthree \v!row\endcsname
+% \letcsnamecsname\csname\??naturaltablesetupthree x\endcsname\csname\??naturaltablesetupthree\v!column\endcsname
-\letvalue{\??naturaltablesetupthree\s!unknown}\tabl_ntb_setup_un
-\letvalue{\??naturaltablesetuptwo \s!unknown}\tabl_ntb_setup_ux
+% \letcsnamecsname\csname\??naturaltablesetuptwo r\endcsname\csname\??naturaltablesetuptwo \v!row\endcsname
+% \letcsnamecsname\csname\??naturaltablesetuptwo c\endcsname\csname\??naturaltablesetuptwo \v!column\endcsname
+% \letcsnamecsname\csname\??naturaltablesetuptwo y\endcsname\csname\??naturaltablesetuptwo \v!row\endcsname
+% \letcsnamecsname\csname\??naturaltablesetuptwo x\endcsname\csname\??naturaltablesetuptwo \v!column\endcsname
-\letcsnamecsname\csname\??naturaltablesetupthree r\endcsname\csname\??naturaltablesetupthree \v!row\endcsname
-\letcsnamecsname\csname\??naturaltablesetupthree c\endcsname\csname\??naturaltablesetupthree\v!column\endcsname
-\letcsnamecsname\csname\??naturaltablesetupthree y\endcsname\csname\??naturaltablesetupthree \v!row\endcsname
-\letcsnamecsname\csname\??naturaltablesetupthree x\endcsname\csname\??naturaltablesetupthree\v!column\endcsname
+\letcsname\??naturaltablesetupthree r\expandafter\endcsname\csname\??naturaltablesetupthree \v!row\endcsname
+\letcsname\??naturaltablesetupthree c\expandafter\endcsname\csname\??naturaltablesetupthree\v!column\endcsname
+\letcsname\??naturaltablesetupthree y\expandafter\endcsname\csname\??naturaltablesetupthree \v!row\endcsname
+\letcsname\??naturaltablesetupthree x\expandafter\endcsname\csname\??naturaltablesetupthree\v!column\endcsname
-\letcsnamecsname\csname\??naturaltablesetuptwo r\endcsname\csname\??naturaltablesetuptwo \v!row\endcsname
-\letcsnamecsname\csname\??naturaltablesetuptwo c\endcsname\csname\??naturaltablesetuptwo \v!column\endcsname
-\letcsnamecsname\csname\??naturaltablesetuptwo y\endcsname\csname\??naturaltablesetuptwo \v!row\endcsname
-\letcsnamecsname\csname\??naturaltablesetuptwo x\endcsname\csname\??naturaltablesetuptwo \v!column\endcsname
+\letcsname\??naturaltablesetuptwo r\expandafter\endcsname\csname\??naturaltablesetuptwo \v!row\endcsname
+\letcsname\??naturaltablesetuptwo c\expandafter\endcsname\csname\??naturaltablesetuptwo \v!column\endcsname
+\letcsname\??naturaltablesetuptwo y\expandafter\endcsname\csname\??naturaltablesetuptwo \v!row\endcsname
+\letcsname\??naturaltablesetuptwo x\expandafter\endcsname\csname\??naturaltablesetuptwo \v!column\endcsname
\def\tabl_ntb_parameters_set[#1][#2]%
{\ifappendTBLsetups
@@ -547,10 +626,12 @@
{\tabl_ntb_setup_section % already forgotten
\edef\m_tabl_ntb_positive_row{\number#1}%
\edef\m_tabl_ntb_positive_col{\number#2}%
- \edef\m_tabl_ntb_negative_row{\the\numexpr-\c_tabl_ntb_maximum_row+#1+\minusone\relax}%
- \edef\m_tabl_ntb_negative_col{\the\numexpr-\c_tabl_ntb_maximum_col+#2+\minusone\relax}%
+% \edef\m_tabl_ntb_negative_row{\the\numexpr-\c_tabl_ntb_maximum_row+#1+\minusone\relax}%
+% \edef\m_tabl_ntb_negative_col{\the\numexpr-\c_tabl_ntb_maximum_col+#2+\minusone\relax}%
+ \edef\m_tabl_ntb_negative_row{\number\numexpr-\c_tabl_ntb_maximum_row+#1+\minusone}%
+ \edef\m_tabl_ntb_negative_col{\number\numexpr-\c_tabl_ntb_maximum_col+#2+\minusone}%
% saves tokens (no speed gain)
- \edef\m_tabl_ntb_prefix{\??naturaltableset\m_tabl_tbl_level:}%
+ \edef\m_tabl_ntb_prefix{\??naturaltableset\m_tabl_tbl_level:}% can move to \tabl_ntb_next_level etc
% each each
\begincsname\m_tabl_ntb_prefix\c!x\v!each\c!y\v!each\endcsname
\begincsname\m_tabl_ntb_prefix\c!y\v!each\endcsname
@@ -640,9 +721,9 @@
% \dorecurse{10}{\bTR \dorecurse{6}{\bTD xxx \eTD} \eTR}
% \eTABLE
-\let\m_tabl_ntb_before_split\empty
-\let\m_tabl_ntb_after_split \empty
-\let\m_tabl_ntb_same_page \empty
+\lettonothing\m_tabl_ntb_before_split
+\lettonothing\m_tabl_ntb_after_split
+\lettonothing\m_tabl_ntb_same_page
% split + page:
%
@@ -652,10 +733,24 @@
% \bTR \bTD left \eTD\bTD right \eTD\eTR
% \eTABLE
+% plugin
+
+\let\tabl_ntb_section_mark \relax
+\let\tabl_ntb_section_checkup\relax
+\let\tabl_ntb_section_split \relax
+\let\tabl_ntb_section_install\relax
+\let\tabl_ntb_section_setup \relax
+\let\tabl_ntb_section_wrapup \relax
+
+% till here
+
\tolerant\protected\def\tabl_ntb_tr[#1]%
{\c_tabl_ntb_running_col\zerocount
\c_tabl_ntb_encountered_col\zerocount
- \advance\c_tabl_ntb_maximum_row\plusone
+ %
+ \tabl_ntb_section_mark
+ %
+ \advanceby\c_tabl_ntb_maximum_row\plusone
\ifparameter#1\or
\expandafter\tabl_ntb_tr_yes
\else
@@ -669,7 +764,7 @@
\def\m_tabl_ntb_default_nc{\naturaltableparameter\c!nc}
\tolerant\protected\def\tabl_ntb_td[#1]%
- {\advance\c_tabl_ntb_encountered_col\plusone
+ {\advanceby\c_tabl_ntb_encountered_col\plusone
\ifparameter#1\or
\expandafter\tabl_ntb_td_yes
\else
@@ -677,13 +772,13 @@
\fi[#1]}
\def\tabl_ntb_td_yes[#1]#2\eTD
- {\letnaturaltableparameter\c!ny \m_tabl_ntb_default_nr
- \letnaturaltableparameter\c!nx \m_tabl_ntb_default_nc
- \letnaturaltableparameter\c!nc \plusone
- \letnaturaltableparameter\c!nr \plusone
- \letnaturaltableparameter\c!n \c_tabl_ntb_running_col
- \letnaturaltableparameter\c!m \empty
- \letnaturaltableparameter\c!action\empty % not that important
+ {\letnaturaltableparameter \c!ny\m_tabl_ntb_default_nr
+ \letnaturaltableparameter \c!nx\m_tabl_ntb_default_nc
+ \letnaturaltableparameter \c!nc\plusone
+ \letnaturaltableparameter \c!nr\plusone
+ \letnaturaltableparameter \c!n \c_tabl_ntb_running_col_reference
+ \resetnaturaltableparameter\c!m
+ \resetnaturaltableparameter\c!action% not that important
\setupcurrentnaturaltable[#1]%
%
\c_tabl_ntb_nx\naturaltableparameter\c!nx\relax
@@ -693,19 +788,20 @@
\edef\m_tabl_ntb_m{\naturaltableparameter\c!m}%
%
\ifempty\m_tabl_ntb_n
- \global\advance\c_tabl_ntb_spn\c_tabl_ntb_nx\relax
- \orelse\ifnum\m_tabl_ntb_n=\c_tabl_ntb_running_col\else
+ \global\advanceby\c_tabl_ntb_spn\c_tabl_ntb_nx\relax
+ \orelse\ifnum\m_tabl_ntb_n=\c_tabl_ntb_running_col
+ \else
\tabl_ntb_td_pass_n{#1}%
\fi
- \ifempty\m_tabl_ntb_m \else
- \ifnum\m_tabl_ntb_m=\c_tabl_ntb_running_col\else
- \tabl_ntb_td_pass_m{#1}%
- \fi
+ \ifempty\m_tabl_ntb_m
+ \orelse\ifnum\m_tabl_ntb_m=\c_tabl_ntb_running_col
+ \else
+ \tabl_ntb_td_pass_m{#1}%
\fi
- \doloop % skip over columns that result from earlier span
- {\advance\c_tabl_ntb_running_col\plusone
+ \localcontrolledloop\plusone\maxcard\plusone % skip over columns that result from earlier span
+ {\advanceby\c_tabl_ntb_running_col\plusone
\ifcsname\tabl_ntb_tag_pattern\c_tabl_ntb_maximum_row\c_tabl_ntb_running_col\endcsname \else
- \exitloop
+ \quitloop
\fi}%
% fill r*c cells and set span
\c_tabl_ntb_nx\naturaltableparameter\c!nx\relax
@@ -723,8 +819,8 @@
\fi
% set values
\tabl_ntb_let_tag\c_tabl_ntb_maximum_row\c_tabl_ntb_running_col\c_tabl_ntb_cell
- \tabl_ntb_set_col\c_tabl_ntb_maximum_row\c_tabl_ntb_running_col{\the\c_tabl_ntb_nx}%
- \tabl_ntb_set_row\c_tabl_ntb_maximum_row\c_tabl_ntb_running_col{\the\c_tabl_ntb_ny}%
+ \tabl_ntb_set_col\c_tabl_ntb_maximum_row\c_tabl_ntb_running_col\c_tabl_ntb_nx
+ \tabl_ntb_set_row\c_tabl_ntb_maximum_row\c_tabl_ntb_running_col\c_tabl_ntb_ny
% the action key will change!
\tabl_ntb_set_ref\c_tabl_ntb_maximum_row\c_tabl_ntb_running_col{\naturaltableparameter\c!action}%
% save text
@@ -736,11 +832,11 @@
\fi}
\def\tabl_ntb_td_nop[#1]#2\eTD
- {\global\advance\c_tabl_ntb_spn\plusone\relax
- \doloop
- {\advance\c_tabl_ntb_running_col\plusone
+ {\global\advanceby\c_tabl_ntb_spn\plusone\relax
+ \localcontrolledloop\plusone\maxcard\plusone
+ {\advanceby\c_tabl_ntb_running_col\plusone
\ifcsname\tabl_ntb_tag_pattern\c_tabl_ntb_maximum_row\c_tabl_ntb_running_col\endcsname \else
- \exitloop
+ \quitloop
\fi}%
\c_tabl_ntb_nx\plusone
\c_tabl_ntb_ny\plusone
@@ -748,8 +844,8 @@
\c_tabl_ntb_maximum_col\c_tabl_ntb_running_col
\fi
\tabl_ntb_let_tag\c_tabl_ntb_maximum_row\c_tabl_ntb_running_col\c_tabl_ntb_cell
- \tabl_ntb_set_col\c_tabl_ntb_maximum_row\c_tabl_ntb_running_col{\the\c_tabl_ntb_nx}%
- \tabl_ntb_set_row\c_tabl_ntb_maximum_row\c_tabl_ntb_running_col{\the\c_tabl_ntb_ny}%
+ \tabl_ntb_set_col\c_tabl_ntb_maximum_row\c_tabl_ntb_running_col\c_tabl_ntb_nx
+ \tabl_ntb_set_row\c_tabl_ntb_maximum_row\c_tabl_ntb_running_col\c_tabl_ntb_ny
\tabl_ntb_let_ref\c_tabl_ntb_maximum_row\c_tabl_ntb_running_col\empty
\normalexpanded
{\tabl_ntb_set_txt_process\c_tabl_ntb_maximum_row\c_tabl_ntb_running_col{\the\c_tabl_ntb_maximum_row}{\the\c_tabl_ntb_running_col}}%
@@ -768,43 +864,43 @@
\letnaturaltableparameter\c!nc\plusone
\letnaturaltableparameter\c!nr\plusone
\setupcurrentnaturaltable[#1]%
- \letnaturaltableparameter\c!n \empty
- \letnaturaltableparameter\c!m \empty}
+ \resetnaturaltableparameter\c!n
+ \resetnaturaltableparameter\c!m}
\def\tabl_ntb_td_pass_m#1%
{\scratchcounter\numexpr\m_tabl_ntb_m-\c_tabl_ntb_running_col+\minusone-\c_tabl_ntb_spn\relax
- \dorecurse\scratchcounter{\normalexpanded{\tabl_ntb_td[\c!n=,\c!m=]}\eTD}%
+ \localcontrolledloop\plusone\scratchcounter\plusone{\normalexpanded{\tabl_ntb_td[\c!n=,\c!m=]}\eTD}%
% can be sped up
\letnaturaltableparameter\c!ny\m_tabl_ntb_default_nr
\letnaturaltableparameter\c!nx\m_tabl_ntb_default_nc
\letnaturaltableparameter\c!nc\plusone
\letnaturaltableparameter\c!nr\plusone
\setupcurrentnaturaltable[#1]%
- \letnaturaltableparameter\c!n \empty
- \letnaturaltableparameter\c!m \empty}
+ \resetnaturaltableparameter\c!n
+ \resetnaturaltableparameter\c!m}
\def\tabl_ntb_cell_preset
{\c_tabl_ntb_current_row\c_tabl_ntb_maximum_row
\c_tabl_ntb_current_col\c_tabl_ntb_running_col
- \dorecurse\c_tabl_ntb_ny\tabl_ntb_cell_preset_rows
+ \localcontrolledloop\plusone\c_tabl_ntb_ny\plusone{\tabl_ntb_cell_preset_rows}%
% check max column
- \advance\c_tabl_ntb_current_col\minusone
+ \advanceby\c_tabl_ntb_current_col\minusone
\ifnum\c_tabl_ntb_current_col>\c_tabl_ntb_maximum_col\relax
\c_tabl_ntb_maximum_col\c_tabl_ntb_current_col
\fi}
\def\tabl_ntb_cell_preset_rows
{\c_tabl_ntb_current_col\c_tabl_ntb_running_col
- \tabl_ntb_set_col\c_tabl_ntb_current_row\c_tabl_ntb_current_col{\the\c_tabl_ntb_nx}%
+ \tabl_ntb_set_col\c_tabl_ntb_current_row\c_tabl_ntb_current_col\c_tabl_ntb_nx
\ifnum\c_tabl_ntb_nx>\c_tabl_ntb_maximum_row_span\relax
\c_tabl_ntb_maximum_row_span\c_tabl_ntb_nx
\fi
- \dorecurse\c_tabl_ntb_nx\tabl_ntb_cell_preset_cells
- \advance\c_tabl_ntb_current_row\plusone}
+ \localcontrolledloop\plusone\c_tabl_ntb_nx\plusone{\tabl_ntb_cell_preset_cells}%
+ \advanceby\c_tabl_ntb_current_row\plusone}
\def\tabl_ntb_cell_preset_cells
{\tabl_ntb_let_tag\c_tabl_ntb_current_row\c_tabl_ntb_current_col\c_tabl_ntb_none
- \advance\c_tabl_ntb_current_col\plusone}
+ \advanceby\c_tabl_ntb_current_col\plusone}
%D The usage of n and m:
%D
@@ -893,10 +989,10 @@
% to be done: head <raw> foot, dus state var
-\aliased\let\eTABLEhead\relax
-\aliased\let\eTABLEnext\relax
-\aliased\let\eTABLEbody\relax
-\aliased\let\eTABLEfoot\relax
+\permanent\protected\lettonothing\eTABLEhead
+\permanent\protected\lettonothing\eTABLEnext
+\permanent\protected\lettonothing\eTABLEbody
+\permanent\protected\lettonothing\eTABLEfoot
\permanent\tolerant\protected\def\bTABLEhead[#1]#:#2\eTABLEhead{\appendtoks\tabl_ntb_section[#1]{#2}\to\t_tabl_ntb_head}
\permanent\tolerant\protected\def\bTABLEnext[#1]#:#2\eTABLEnext{\appendtoks\tabl_ntb_section[#1]{#2}\to\t_tabl_ntb_next}
@@ -926,26 +1022,35 @@
\resetcharacteralign % new
\setupcurrentnaturaltablelocal[\c!align={\v!right,\v!broad,\v!high},#1]%
%
+ \tabl_ntb_anchor_setup
+ \tabl_ntb_section_setup
+ %
\d_tabl_ntb_leftmargindistance \naturaltablelocalparameter\c!leftmargindistance\relax
\d_tabl_ntb_rightmargindistance\naturaltablelocalparameter\c!rightmargindistance\relax
\d_tabl_ntb_columndistance \naturaltablelocalparameter\c!columndistance\relax
\d_tabl_ntb_maxwidth \naturaltablelocalparameter\c!maxwidth\relax
%
\usesetupsparameter\naturaltablelocalparameter
- \doifelse{\naturaltablelocalparameter\c!textwidth}\v!local
- {\hsize\availablehsize}
- {\hsize\naturaltablelocalparameter\c!textwidth}%
+ \hsize
+ \ifcstok{\naturaltablelocalparameter\c!textwidth}\v!local
+ \availablehsize
+ \else
+ \naturaltablelocalparameter\c!textwidth
+ \fi
+ \relax
\enableTBLbreakfalse
\multipleTBLheadsfalse
+ \forceTBLpageflowfalse
\autoTBLspreadfalse
\tightTBLcolspanfalse
\processaction
- [\naturaltablelocalparameter\c!split]
+ [\naturaltablelocalparameter\c!split]%
[ \v!yes=>\enableTBLbreaktrue,
\v!repeat=>\enableTBLbreaktrue\multipleTBLheadstrue,
- \v!auto=>\ifinsidesplitfloat\enableTBLbreaktrue\fi]
+ \v!page=>\enableTBLbreaktrue\forceTBLpageflowtrue,
+ \v!auto=>\ifinsidesplitfloat\enableTBLbreaktrue\fi]%
\processaction
- [\naturaltablelocalparameter\c!header]
+ [\naturaltablelocalparameter\c!header]%
[\v!repeat=>\multipleTBLheadstrue]%
\tabl_ntb_preset_parameters
\processallactionsinset
@@ -962,6 +1067,7 @@
\let\currentTABLEcolumn\tabl_ntb_current_column
\let\nofTABLErows \tabl_ntb_n_of_rows
\let\nofTABLEcolumns \tabl_ntb_n_of_columns
+ %
\enforced\let\bTR\tabl_ntb_bTR
\enforced\let\bTD\tabl_ntb_bTD
\enforced\let\bTH\tabl_ntb_bTH
@@ -997,7 +1103,7 @@
{% tricky and dirty order -)
\setfalse\c_tabl_ntb_okay
% head
- \doifelsesometoks\t_tabl_ntb_head % slow, better a flag
+ \doifelsesometoks\t_tabl_ntb_head % slow, better a flag \iftok
{\c_tabl_ntb_head\numexpr\c_tabl_ntb_maximum_row+\plusone\relax
\the\t_tabl_ntb_head
\c_tabl_ntb_n_of_head_lines\c_tabl_ntb_maximum_row\relax
@@ -1028,11 +1134,11 @@
\ifcase\c_tabl_ntb_maximum_col\else
\startTBLprocessing
\tabl_ntb_table_start
- \dorecurse\c_tabl_ntb_maximum_row
+ \localcontrolledloop\plusone\c_tabl_ntb_maximum_row\plusone
{\tabl_ntb_row_start
- \c_tabl_ntb_current_row\recurselevel\relax
- \dorecurse\c_tabl_ntb_maximum_col
- {\c_tabl_ntb_current_col\recurselevel\relax
+ \c_tabl_ntb_current_row\currentloopiterator\relax
+ \localcontrolledloop\plusone\c_tabl_ntb_maximum_col\plusone
+ {\c_tabl_ntb_current_col\currentloopiterator\relax
\normalexpanded{\tabl_ntb_cell{\the\c_tabl_ntb_current_row}{\the\c_tabl_ntb_current_col}}}%
\tabl_ntb_row_stop}%
\removeunwantedspaces % only if hmode
@@ -1043,13 +1149,14 @@
% \vskip-\strutdp
% \fi
\fi
+ \tabl_ntb_section_wrapup
% tracing
% \iftrue
% \blank \tttf
- % \dorecurse\c_tabl_ntb_maximum_row
- % {\c_tabl_ntb_current_row\recurselevel\relax
- % \dorecurse\c_tabl_ntb_maximum_col
- % {\c_tabl_ntb_current_col\recurselevel\relax
+ % \localcontrolledloop\plusone\c_tabl_ntb_maximum_row\plusone
+ % {\c_tabl_ntb_current_row\currentloopiterator\relax
+ % \localcontrolledloop\plusone\c_tabl_ntb_maximum_col\plusone
+ % {\c_tabl_ntb_current_col\currentloopiterator\relax
% [r=\the\c_tabl_ntb_current_row,c=\the\c_tabl_ntb_current_col,h=\the\dimexpr\tabl_ntb_get_ht\c_tabl_ntb_current_row\c_tabl_ntb_current_col,w=\the\dimexpr\tabl_ntb_get_wd\c_tabl_ntb_current_row\c_tabl_ntb_current_col]}%
% \par}%
% \blank
@@ -1059,14 +1166,14 @@
\tabl_ntb_table_pop}
\def\tabl_ntb_loop_one
- {\dorecurse\c_tabl_ntb_maximum_row{\tabl_ntb_loop_one_rows}}
+ {\localcontrolledloop\plusone\c_tabl_ntb_maximum_row\plusone{\tabl_ntb_loop_one_rows}}
\def\tabl_ntb_loop_one_rows
- {\c_tabl_ntb_current_row\recurselevel\relax
- \dorecurse\c_tabl_ntb_maximum_col\tabl_ntb_loop_one_cells}
+ {\c_tabl_ntb_current_row\currentloopiterator\relax
+ \localcontrolledloop\plusone\c_tabl_ntb_maximum_col\plusone{\tabl_ntb_loop_one_cells}}
\def\tabl_ntb_loop_one_cells
- {\c_tabl_ntb_current_col\recurselevel\relax
+ {\c_tabl_ntb_current_col\currentloopiterator\relax
\ifcsname\tabl_ntb_tag_pattern\c_tabl_ntb_current_row\c_tabl_ntb_current_col\endcsname \else
\tabl_ntb_loop_one_cells_indeed
\fi}
@@ -1075,25 +1182,25 @@
{\c_tabl_ntb_current_col_two\c_tabl_ntb_current_col
\c_tabl_ntb_current_row_two\c_tabl_ntb_current_row
\c_tabl_ntb_current_row_one\c_tabl_ntb_current_row
- \doloop
+ \localcontrolledloop\plusone\maxcard\plusone
{\c_tabl_ntb_current_col_one\c_tabl_ntb_current_col
- \doloop
+ \localcontrolledloop\plusone\maxcard\plusone
{\ifcsname\tabl_ntb_tag_pattern\c_tabl_ntb_current_row_one\c_tabl_ntb_current_col_one\endcsname
- \exitloop
+ \quitloop
\else
- \advance\c_tabl_ntb_current_col_one\plusone
+ \advanceby\c_tabl_ntb_current_col_one\plusone
\ifnum\c_tabl_ntb_current_col_one>\c_tabl_ntb_maximum_col\relax
- \exitloop
+ \quitloop
\fi
\fi}%
\ifcsname\tabl_ntb_tag_pattern\c_tabl_ntb_current_row_one\c_tabl_ntb_current_col_one\endcsname
- \exitloop
+ \quitloop
\else
\c_tabl_ntb_current_row_two\c_tabl_ntb_current_row_one
\c_tabl_ntb_current_col_two\c_tabl_ntb_current_col_one
- \advance\c_tabl_ntb_current_row_one\plusone
+ \advanceby\c_tabl_ntb_current_row_one\plusone
\ifnum\c_tabl_ntb_current_row_one>\c_tabl_ntb_maximum_row
- \exitloop
+ \quitloop
\fi
\fi}%
\ifnum\c_tabl_ntb_current_row_two>\c_tabl_ntb_maximum_row\c_tabl_ntb_current_row_two\c_tabl_ntb_maximum_row\fi
@@ -1101,16 +1208,16 @@
\c_tabl_ntb_current_row_two\numexpr\c_tabl_ntb_current_row_two-\c_tabl_ntb_current_row+\plusone\relax
\c_tabl_ntb_current_col_two\numexpr\c_tabl_ntb_current_col_two-\c_tabl_ntb_current_col+\plusone\relax
\c_tabl_ntb_current_row_one\c_tabl_ntb_current_row
- \dorecurse\c_tabl_ntb_current_row_two
+ \localcontrolledloop\plusone\c_tabl_ntb_current_row_two\plusone
{\c_tabl_ntb_current_col_one\c_tabl_ntb_current_col
- \tabl_ntb_set_col\c_tabl_ntb_current_row_one\c_tabl_ntb_current_col_one{\the\c_tabl_ntb_current_col_two}%
- \dorecurse\c_tabl_ntb_current_col_two
+ \tabl_ntb_set_col\c_tabl_ntb_current_row_one\c_tabl_ntb_current_col_one\c_tabl_ntb_current_col_two
+ \localcontrolledloop\plusone\c_tabl_ntb_current_col_two\plusone
{\tabl_ntb_let_tag\c_tabl_ntb_current_row_one\c_tabl_ntb_current_col_one\c_tabl_ntb_none
- \advance\c_tabl_ntb_current_col_one\plusone}%
- \advance\c_tabl_ntb_current_row_one\plusone}%
+ \advanceby\c_tabl_ntb_current_col_one\plusone}%
+ \advanceby\c_tabl_ntb_current_row_one\plusone}%
\tabl_ntb_let_tag\c_tabl_ntb_current_row\c_tabl_ntb_current_col\c_tabl_ntb_cell
- \tabl_ntb_set_col\c_tabl_ntb_current_row\c_tabl_ntb_current_col{\the\c_tabl_ntb_current_col_two}%
- \tabl_ntb_set_row\c_tabl_ntb_current_row\c_tabl_ntb_current_col{\the\c_tabl_ntb_current_row_two}%
+ \tabl_ntb_set_col\c_tabl_ntb_current_row\c_tabl_ntb_current_col\c_tabl_ntb_current_col_two
+ \tabl_ntb_set_row\c_tabl_ntb_current_row\c_tabl_ntb_current_col\c_tabl_ntb_current_row_two%
\ifautoTBLemptycell
\normalexpanded
{\tabl_ntb_set_txt_process\c_tabl_ntb_current_row\c_tabl_ntb_current_col{\the\c_tabl_ntb_current_row}{\the\c_tabl_ntb_current_col}}%
@@ -1118,18 +1225,19 @@
\fi}
\def\tabl_ntb_loop_two
- {\dorecurse\c_tabl_ntb_maximum_row\tabl_ntb_loop_two_rows}
+ {\localcontrolledloop\plusone\c_tabl_ntb_maximum_row\plusone{\tabl_ntb_loop_two_rows}}
\def\tabl_ntb_loop_two_rows
- {\c_tabl_ntb_current_row\recurselevel\relax
- \dorecurse\c_tabl_ntb_maximum_col\tabl_ntb_loop_two_cells}
+ {\c_tabl_ntb_current_row\currentloopiterator\relax
+ \localcontrolledloop\plusone\c_tabl_ntb_maximum_col\plusone{\tabl_ntb_loop_two_cells}}
\def\tabl_ntb_loop_two_cells
- {\c_tabl_ntb_current_col\recurselevel\relax
+ {\c_tabl_ntb_current_col\currentloopiterator\relax
\ifcsname\tabl_ntb_row_pattern\c_tabl_ntb_current_row\c_tabl_ntb_current_col\endcsname
\scratchcounter\numexpr\c_tabl_ntb_maximum_row-\c_tabl_ntb_current_row+\plusone\relax
\ifnum\tabl_ntb_get_row\c_tabl_ntb_current_row\c_tabl_ntb_current_col>\scratchcounter
- \tabl_ntb_set_row\c_tabl_ntb_current_row\c_tabl_ntb_current_col{\the\scratchcounter}%
+% \tabl_ntb_set_row\c_tabl_ntb_current_row\c_tabl_ntb_current_col{\the\scratchcounter}%
+ \tabl_ntb_set_row\c_tabl_ntb_current_row\c_tabl_ntb_current_col\scratchcounter
\fi
\fi
\tabl_ntb_let_ht\c_tabl_ntb_current_row\c_tabl_ntb_current_col\zeropoint
@@ -1144,7 +1252,7 @@
\mutable\let\startTBLprocessing\relax % public
\mutable\let\stopTBLprocessing \relax % public
-\newcount\c_tabl_prelocated_rows % \prelocateTBLrows{1000} may speed up large tables
+\newinteger\c_tabl_prelocated_rows % \prelocateTBLrows{1000} may speed up large tables
% \def\tabl_ntb_row_start{\t_tabl_ntb_row\emptytoks}
% \def\tabl_ntb_row_stop {\normalexpanded{\t_tabl_ntb{\the\t_tabl_ntb\noexpand\tabl_ntb_row_align_start\the\t_tabl_ntb_row\tabl_ntb_row_align_stop}}}
@@ -1200,9 +1308,9 @@
\xdef\m_tabl_ntb_same_page {#3}}
\protected\def\tabl_ntb_row_align_reset
- {\glet\m_tabl_ntb_before_split\empty
- \glet\m_tabl_ntb_after_split \empty
- \glet\m_tabl_ntb_same_page \empty}
+ {\glettonothing\m_tabl_ntb_before_split
+ \glettonothing\m_tabl_ntb_after_split
+ \glettonothing\m_tabl_ntb_same_page }
\def\tabl_ntb_prelocate_error
{\writestatus\m!TABLE{fatal error: use \string\prelocateTBLrows\space to increase table memory (now: \the\c_tabl_prelocated_rows)}}
@@ -1210,8 +1318,8 @@
% \prelocateTBLrows{1000} % may speed up large tables
\permanent\protected\def\prelocateTBLrows#1% we start at zero so we have one to much, better play safe anyway
- {\dostepwiserecurse\c_tabl_prelocated_rows{#1}\plusone
- {\expandafter\newtoks\csname\??naturaltabletok\recurselevel\endcsname}%
+ {\localcontrolledloop\c_tabl_prelocated_rows#1\plusone
+ {\expandafter\newtoks\csname\??naturaltabletok\the\currentloopiterator\endcsname}%
\def\tabl_ntb_row_start
{\ifnum\c_tabl_ntb_row<\c_tabl_prelocated_rows\relax
\tabl_ntb_prelocate_okay
@@ -1277,13 +1385,14 @@
\fi}
\protected\def\tabl_ntb_row_align_start
- {\global\advance\c_tabl_ntb_row\plusone
+ {\global\advanceby\c_tabl_ntb_row\plusone
\global\c_tabl_ntb_col\plusone
\global\c_tabl_ntb_spn\zerocount
\tabl_ntb_row_align_start_inject
\ifconditional\c_strc_tags_enabled
\tabl_ntb_start_tagged
\fi
+ \tabl_ntb_section_checkup
\hbox\bgroup
\kern\dimexpr\d_tabl_ntb_leftmargindistance\relax}
@@ -1298,18 +1407,15 @@
\protected\def\tabl_ntb_before_page
{\ifx\m_tabl_ntb_same_page\v!before
% \blank[\v!samepage,\v!strong]%
- \unpenalty
\nobreak
\orelse\ifx\m_tabl_ntb_same_page\v!both
% \blank[\v!samepage,\v!strong]%
- \unpenalty
\nobreak
\fi}
\protected\def\tabl_ntb_after_page
{\ifnum\c_tabl_ntb_row>\c_tabl_ntb_n_of_head_lines
- \ifnum\tabl_ntb_get_nob\c_tabl_ntb_row=\zerocount
- \unpenalty
+ \ifnum\tabl_ntb_get_nob\c_tabl_ntb_row=\zerocount % no \ifzero
\ifx\m_tabl_ntb_same_page\v!after
% \blank[\v!samepage,\v!strong]%
\nobreak
@@ -1363,7 +1469,7 @@
\global\c_tabl_ntb_spn\zerocount
\global\c_tabl_ntb_col\zerocount
\global\c_tabl_ntb_row\zerocount
- \global\advance\c_tabl_ntb_row\minusone
+ \global\advanceby\c_tabl_ntb_row\minusone
\dostarttaggedchained\t!table\empty\??naturaltable
%\registerparoptions % (*) triggers max hsize
\the\t_tabl_ntb
@@ -1371,25 +1477,25 @@
\protected\def\tabl_ntb_span#1%
{\hskip\tabl_ntb_get_dis\c_tabl_ntb_col
- \dorecurse{#1}
+ \localcontrolledloop\plusone#1\plusone
{\hskip\tabl_ntb_get_wid\c_tabl_ntb_col\relax
- \global\advance\c_tabl_ntb_col\plusone}}
+ \global\advanceby\c_tabl_ntb_col\plusone}}
\protected\def\tabl_ntb_skip#1%
- {\global\advance\c_tabl_ntb_col#1\relax}
+ {\global\advanceby\c_tabl_ntb_col#1\relax}
\protected\def\tabl_ntb_plus
- {\global\advance\c_tabl_ntb_col\plusone
+ {\global\advanceby\c_tabl_ntb_col\plusone
\kern\d_tabl_ntb_columndistance}
-\setvalue{\??naturaltablecell\the\c_tabl_ntb_none}#1#2%
+\defcsname\??naturaltablecell\the\c_tabl_ntb_none\endcsname#1#2%
{\scratchcounter\tabl_ntb_get_col{#1}{#2}\relax
\ifnum\scratchcounter>\zerocount
\etoksapp\t_tabl_ntb_row
{\tabl_ntb_span{\the\scratchcounter}}%
\fi}
-\setvalue{\??naturaltablecell\the\c_tabl_ntb_cell}#1#2%
+\defcsname\??naturaltablecell\the\c_tabl_ntb_cell\endcsname#1#2%
{\toksapp\t_tabl_ntb_row{\tabl_ntb_pass #1 #2 }% space delimited -> less tokens
\scratchcounter\tabl_ntb_get_col{#1}{#2}\relax
\ifnum\scratchcounter>\zerocount
@@ -1419,27 +1525,27 @@
\scratchcounter\c_tabl_ntb_col
\scratchcounterone\tabl_ntb_get_col{#1}{#2}\relax
\ifcase\scratchcounterone\or
- \advance\d_tabl_ntb_width\dimexpr
+ \advanceby\d_tabl_ntb_width\dimexpr % no need for dimexpr
\tabl_ntb_get_wid\scratchcounter
\relax
- \advance\scratchcounter\plusone
+ \advanceby\scratchcounter\plusone
\else
- \dorecurse\scratchcounterone
- {\advance\d_tabl_ntb_width\dimexpr
+ \localcontrolledloop\plusone\scratchcounterone\plusone
+ {\advanceby\d_tabl_ntb_width\dimexpr
\tabl_ntb_get_wid\scratchcounter
- \ifnum\recurselevel<\scratchcounterone
+ \ifnum\currentloopiterator<\scratchcounterone
+\d_tabl_ntb_columndistance
+\tabl_ntb_get_dis\scratchcounter
\fi
\relax
- \advance\scratchcounter\plusone}%
+ \advanceby\scratchcounter\plusone}%
\fi
\setbox\scratchbox\hbox{\tabl_ntb_get_txt{#1}{#2}}%
- \tabl_ntb_set_ht{#1}{#2}{\the\ht\scratchbox}%
- %tabl_ntb_set_wd{#1}{#2}{\the\wd\scratchbox}%
+ \tabl_ntb_set_ht{#1}{#2}\ht\scratchbox
+ %tabl_ntb_set_wd{#1}{#2}\wd\scratchbox
\ifdim\ht\scratchbox>\tabl_ntb_get_hei{#1}\relax
- \tabl_ntb_set_hei{#1}{\the\ht\scratchbox}%
- \fi}%
+ \tabl_ntb_set_hei{#1}\ht\scratchbox
+ \fi}
\def\tabl_ntb_pass_three#1 #2 %
{% height
@@ -1454,9 +1560,9 @@
% case: nc=maxcolumns
\else
\scratchcounter#1\relax
- \dorecurse\scratchcountertwo
- {\advance\d_tabl_ntb_height\tabl_ntb_get_hei\scratchcounter
- \advance\scratchcounter\plusone}%
+ \localcontrolledloop\plusone\scratchcountertwo\plusone
+ {\advanceby\d_tabl_ntb_height\tabl_ntb_get_hei\scratchcounter
+ \advanceby\scratchcounter\plusone}%
\ifdim\d_tabl_ntb_height<\scratchheight\relax
\d_tabl_ntb_height\scratchheight
\fi
@@ -1465,20 +1571,20 @@
\d_tabl_ntb_width\zeropoint
\scratchcounter\c_tabl_ntb_col
\ifcase\scratchcounterone\or
- \advance\d_tabl_ntb_width\dimexpr
+ \advanceby\d_tabl_ntb_width\dimexpr
\tabl_ntb_get_wid\scratchcounter
\relax
- \advance\scratchcounter\plusone
+ \advanceby\scratchcounter\plusone
\else
- \dorecurse\scratchcounterone
- {\advance\d_tabl_ntb_width\dimexpr
+ \localcontrolledloop\plusone\scratchcounterone\plusone
+ {\advanceby\d_tabl_ntb_width\dimexpr
\tabl_ntb_get_wid\scratchcounter
- \ifnum\recurselevel<\scratchcounterone
+ \ifnum\currentloopiterator<\scratchcounterone
+\d_tabl_ntb_columndistance
+\tabl_ntb_get_dis\scratchcounter
\fi
\relax
- \advance\scratchcounter\plusone}%
+ \advanceby\scratchcounter\plusone}%
\fi
% cell
\setbox\scratchbox\hbox attr \taggedattribute \c_attr_tagged \bgroup
@@ -1516,7 +1622,7 @@
\def\tabl_ntb_cell_finalize_indeed
{\scratchdimen\tabl_ntb_get_aut\c_tabl_ntb_col\relax
\ifdim\localwidth>\scratchdimen
- \tabl_ntb_set_aut\c_tabl_ntb_col{\the\dimexpr\localwidth}%
+ \tabl_ntb_set_aut\c_tabl_ntb_col\localwidth\relax
\fi}
\let\tabl_ntb_preroll\relax
@@ -1524,11 +1630,11 @@
\def\tabl_ntb_table_get_max_width
{\scratchdimen\wd\scratchbox\relax}
-% enable dper 2018-02-22
+% enabled per 2018-02-22
\def\tabl_ntb_table_get_max_width_step
- {\advance\scratchdimen\tabl_ntb_get_wid\fastloopindex
- \advance\scratchdimen\tabl_ntb_get_dis\fastloopindex}
+ {\advanceby\scratchdimen\tabl_ntb_get_wid\fastloopindex
+ \advanceby\scratchdimen\tabl_ntb_get_dis\fastloopindex}
\def\tabl_ntb_table_get_max_width
{\scratchdimen\zeropoint
@@ -1537,31 +1643,31 @@
\scratchdimen\wd\scratchbox\relax
\fi}
-\newdimen\d_tabl_ntb_saved_hsize
+\newdimension\d_tabl_ntb_saved_hsize
\let\tabl_ntb_pass\relax
\def\tabl_ntb_table_stop
{\forgetall % new, here see narrower-004.tex
%\setbox\scratchbox\hbox
- % {\letnaturaltablelocalparameter\c!frame\v!off
- % \letnaturaltablelocalparameter\c!background\empty
- % \letnaturaltablelocalparameter\c!align\v!no
+ % {\letnaturaltablelocalparameter \c!frame \v!off
+ % \resetnaturaltablelocalparameter\c!background
+ % \letnaturaltablelocalparameter \c!align \v!no
% \inheritednaturaltablelocalframed{\strut}}%
%\edef\minimalcellheight{\the\ht\scratchbox}% not used
- \dorecurse\c_tabl_ntb_maximum_col
- {\tabl_ntb_let_aut\recurselevel\zeropoint
+ \localcontrolledloop\plusone\c_tabl_ntb_maximum_col\plusone
+ {\tabl_ntb_let_aut\currentloopiterator\zeropoint
% new
- \c_tabl_ntb_current_col_one\recurselevel\relax
- \dorecurse\c_tabl_ntb_maximum_row
- {%tabl_ntb_let_wd\recurselevel\c_tabl_ntb_current_col_one\zeropoint
- \tabl_ntb_let_ht\recurselevel\c_tabl_ntb_current_col_one\zeropoint}%
+ \c_tabl_ntb_current_col_one\currentloopiterator\relax
+ \localcontrolledloop\plusone\c_tabl_ntb_maximum_row\plusone
+ {%tabl_ntb_let_wd\currentloopiterator\c_tabl_ntb_current_col_one\zeropoint
+ \tabl_ntb_let_ht\currentloopiterator\c_tabl_ntb_current_col_one\zeropoint}%
% till here
- \tabl_ntb_let_tal\recurselevel\zerocount
- \tabl_ntb_let_wid\recurselevel\zeropoint
- \tabl_ntb_let_dis\recurselevel\zeropoint}%
- \dorecurse\c_tabl_ntb_maximum_row
- {\tabl_ntb_let_hei\recurselevel\maxdimen}%
+ \tabl_ntb_let_tal\currentloopiterator\zerocount
+ \tabl_ntb_let_wid\currentloopiterator\zeropoint
+ \tabl_ntb_let_dis\currentloopiterator\zeropoint}%
+ \localcontrolledloop\plusone\c_tabl_ntb_maximum_row\plusone
+ {\tabl_ntb_let_hei\currentloopiterator\maxdimen}%
\tabl_ntb_let_gal\zerocount
\tabl_ntb_preroll\relax
\c_tabl_tbl_pass\plusone
@@ -1636,27 +1742,29 @@
-\d_tabl_ntb_rightmargindistance
+\d_tabl_ntb_columndistance
\relax
- \dorecurse\c_tabl_ntb_maximum_col
- {\advance\scratchdimenfour\dimexpr
- \tabl_ntb_get_wid\recurselevel
+ \localcontrolledloop\plusone\c_tabl_ntb_maximum_col\plusone
+ {\advanceby\scratchdimenfour\dimexpr
+ \tabl_ntb_get_wid\currentloopiterator
\relax
- \advance\scratchdimenfive\dimexpr
- -\tabl_ntb_get_dis\recurselevel
+ \advanceby\scratchdimenfive\dimexpr
+ -\tabl_ntb_get_dis\currentloopiterator
-\d_tabl_ntb_columndistance
\relax}%
\relax
% distribute width (stretch)
\ifdim\scratchdimenfour<\scratchdimenfive
- \advance\scratchdimenfour-\scratchdimenfive
- \divide\scratchdimenfour\c_tabl_ntb_maximum_col
- \dorecurse\c_tabl_ntb_maximum_col
- {\tabl_ntb_set_wid\recurselevel{\the\dimexpr\tabl_ntb_get_wid\recurselevel-\scratchdimenfour\relax}}%
+ \advanceby\scratchdimenfour-\scratchdimenfive
+ \divideby\scratchdimenfour\c_tabl_ntb_maximum_col
+ \localcontrolledloop\plusone\c_tabl_ntb_maximum_col\plusone
+ {\scratchdimen\dimexpr\tabl_ntb_get_wid\currentloopiterator-\scratchdimenfour\relax
+ \tabl_ntb_set_wid\currentloopiterator\scratchdimen}%
\fi
\fi}
\def\tabl_ntb_split_nop
{\setbox\b_tabl_ntb_final\vbox{\tabl_ntb_flush_content}%
\postprocessTABLEbox\b_tabl_ntb_final
+ \tabl_ntb_anchor_process\b_tabl_ntb_final
\beforeTABLEbox
% packaging prevents max hsized box
% \hbox{\registerparoptions\box\b_tabl_ntb_final}% (*) better here
@@ -1670,18 +1778,29 @@
\box\b_tabl_ntb_final
\afterTABLEbox}
+\def\tabl_ntb_split_page
+ {%\postprocessTABLEbox\b_tabl_ntb_final
+ %\tabl_ntb_anchor_process\b_tabl_ntb_final
+ \beforeTABLEbox
+ \registerparoptions % (*) better here (also does a \dontleavehmode)
+ \ifhmode\else\dontleavehmode\fi
+ \tabl_ntb_flush_content
+ \afterTABLEbox}
+
\def\tabl_ntb_split_yes
{\ifinsidesplitfloat
- \donetrue
- \orelse\ifinsidefloat
\donefalse
- \else
+ \orelse\ifinsidefloat
\donetrue
+ \else
+ \donefalse
\fi
\ifdone
- \expandafter\tabl_ntb_split_box
- \else
\expandafter\tabl_ntb_split_nop
+ \orelse\ifforceTBLpageflow
+ \expandafter\tabl_ntb_split_page
+ \else
+ \expandafter\tabl_ntb_split_box
\fi}
\newbox\TABLEsplitbox % public, don't change
@@ -1697,11 +1816,12 @@
\t_split_after{\m_tabl_ntb_after_split}%
\t_split_before{\m_tabl_ntb_before_split}% not used (yet)
\setbox\b_split_content\vbox{\tabl_ntb_flush_content}%
+ \tabl_ntb_section_install % we need content to be set
\ifmultipleTBLheads
- \dorecurse\c_tabl_ntb_n_of_head_lines
+ \localcontrolledloop\plusone\c_tabl_ntb_n_of_head_lines\plusone
{\setbox\scratchbox\vsplit\b_split_content to \lineheight
\setbox\b_split_head\vbox{\unvcopy\b_split_head\unvcopy\scratchbox}}% \vpack ?
- \dorecurse\c_tabl_ntb_n_of_next_lines
+ \localcontrolledloop\plusone\c_tabl_ntb_n_of_next_lines\plusone
{\setbox\scratchbox\vsplit\b_split_content to \lineheight
\setbox\b_split_next\vbox{\unvcopy\b_split_next\unvcopy\scratchbox}}% \vpack ?
\fi
@@ -1734,110 +1854,105 @@
-\d_tabl_ntb_rightmargindistance
-\d_tabl_ntb_columndistance
\relax
- \dorecurse\c_tabl_ntb_maximum_col
- {\scratchdimen\tabl_ntb_get_aut\recurselevel\relax
- \advance\scratchdimenone\dimexpr
- -\tabl_ntb_get_dis\recurselevel
+ \localcontrolledloop\plusone\c_tabl_ntb_maximum_col\plusone
+ {\scratchdimen\tabl_ntb_get_aut\currentloopiterator
+ \advanceby\scratchdimenone\dimexpr
+ -\tabl_ntb_get_dis\currentloopiterator
-\d_tabl_ntb_columndistance
\relax
\ifdim\scratchdimen>\zeropoint\relax
- \advance\scratchdimenone -\scratchdimen
+ \advanceby\scratchdimenone -\scratchdimen
\else
- \scratchdimen\tabl_ntb_get_wid\recurselevel\relax
+ \scratchdimen\tabl_ntb_get_wid\currentloopiterator\relax
\ifdim\scratchdimen>\d_tabl_ntb_maxwidth\relax
- \ifcase#1\else\tabl_ntb_let_wid\recurselevel\zeropoint\fi
- \advance\scratchcounterone \plusone
+ \ifcase#1\else\tabl_ntb_let_wid\currentloopiterator\zeropoint\fi
+ \advanceby\scratchcounterone \plusone
\orelse\ifdim\scratchdimen>\zeropoint\relax
- \advance\scratchdimenone -\scratchdimen
- \else
+ \advanceby\scratchdimenone -\scratchdimen
+ \orelse\ifnum\c_tabl_ntb_encountered_max=\c_tabl_ntb_maximum_col % *nx* bah
% eigenlijk moet dit alleen als de kolom wordt overspannen door een
% vorige, maw extra dubbele loop en status var
- \ifnum\c_tabl_ntb_encountered_max=\c_tabl_ntb_maximum_col % *nx* bah
- \advance\scratchcounterone \plusone % setting maxwidth to a large value also works
- \fi
+ \advanceby\scratchcounterone \plusone % setting maxwidth to a large value also works
\fi
\fi}%
\ifconditional\c_tabl_ntb_trace_widths\tabl_ntb_show_widths M#1\fi
- \ifcase\scratchcounterone \else \divide\scratchdimenone \scratchcounterone \fi
- \dorecurse\c_tabl_ntb_maximum_col
- {\scratchdimen\tabl_ntb_get_wid\recurselevel\relax
+ \ifcase\scratchcounterone \else \divideby\scratchdimenone \scratchcounterone \fi
+ \localcontrolledloop\plusone\c_tabl_ntb_maximum_col\plusone
+ {\scratchdimen\tabl_ntb_get_wid\currentloopiterator
\ifcase#1\relax
\ifdim\scratchdimen<\scratchdimenone % take natural width
- \tabl_ntb_set_aut\recurselevel{\the\scratchdimen}%
+ \tabl_ntb_set_aut\currentloopiterator\scratchdimen
\fi
\else
\ifzeropt\scratchdimen % auto set width
- \tabl_ntb_set_wid\recurselevel{\the\scratchdimenone}%
+ \tabl_ntb_set_wid\currentloopiterator\scratchdimenone
\fi
\fi}%
\ifconditional\c_tabl_ntb_trace_widths\tabl_ntb_show_widths E#1\fi}
-% todo: use scratchcounters, not !! ones
-
\def\tabl_ntb_check_heights_one_indeed
{\scratchcountertwo\tabl_ntb_get_row\c_tabl_ntb_current_row_three\c_tabl_ntb_current_col_three\relax
% check row span
\ifnum\scratchcountertwo>\plusone
% current height in row
- \dimen0=\tabl_ntb_get_ht\c_tabl_ntb_current_row_three\c_tabl_ntb_current_col_three
+ \scratchdimenone\tabl_ntb_get_ht\c_tabl_ntb_current_row_three\c_tabl_ntb_current_col_three
% find nearest height in row
- \dimen2=\zeropoint
- \dorecurse\c_tabl_ntb_maximum_col
- {\ifnum\recurselevel=\c_tabl_ntb_current_col_three\else
- \ifcsname\tabl_ntb_row_pattern\c_tabl_ntb_current_row_three\recurselevel\endcsname
- \scratchcounterthree\tabl_ntb_get_row\c_tabl_ntb_current_row_three\recurselevel\relax
- \ifnum\scratchcounterthree=\plusone
- \dimen4=\tabl_ntb_get_ht\c_tabl_ntb_current_row_three\recurselevel\relax
- \ifdim\dimen2<\dimen4
- \dimen2=\dimen4
- \fi
+ \scratchdimentwo\zeropoint
+ \localcontrolledloop\plusone\c_tabl_ntb_maximum_col\plusone
+ {\ifnum\currentloopiterator=\c_tabl_ntb_current_col_three
+ \orelse\ifcsname\tabl_ntb_row_pattern\c_tabl_ntb_current_row_three\the\currentloopiterator\endcsname
+ \scratchcounterthree\tabl_ntb_get_row\c_tabl_ntb_current_row_three\currentloopiterator\relax
+ \ifnum\scratchcounterthree=\plusone
+ \scratchdimenthree\tabl_ntb_get_ht\c_tabl_ntb_current_row_three\currentloopiterator\relax
+ \ifdim\scratchdimentwo<\scratchdimenthree
+ \scratchdimentwo\scratchdimenthree
\fi
\fi
\fi}%
\c_tabl_ntb_current_row_four\c_tabl_ntb_current_row_three
% calculate cummulative height
- \dimen4=\dimen2
+ \scratchdimenthree\scratchdimentwo
\scratchcounterthree\c_tabl_ntb_current_row_three
- \advance\scratchcounterthree\minusone
- \dorecurse\scratchcountertwo
+ \advanceby\scratchcounterthree\minusone
+ \localcontrolledloop\plusone\scratchcountertwo\plusone
{\ifnum\c_tabl_ntb_current_row_four=\c_tabl_ntb_current_row_three\else
- \advance\dimen4 \tabl_ntb_get_hei\c_tabl_ntb_current_row_four
+ \advanceby\scratchdimenthree\tabl_ntb_get_hei\c_tabl_ntb_current_row_four
\fi
- \ifnum\recurselevel=\scratchcountertwo\else
+ \ifnum\currentloopiterator=\scratchcountertwo\else
\tabl_ntb_set_nob\scratchcounterthree
- \advance\scratchcounterthree\plusone
- \fi
- \advance\c_tabl_ntb_current_row_four\plusone}%
+ \advanceby\scratchcounterthree\plusone
+ \fi
+ \advanceby\c_tabl_ntb_current_row_four\plusone}%
% distribute overshoot equally
- \ifdim\dimen2>\zeropoint % new: test on natural-003
- \ifdim\dimen4<\dimen0
- \advance\dimen0 -\dimen4
- \divide\dimen0 \scratchcountertwo
+ \ifdim\scratchdimentwo>\zeropoint % new: test on natural-003
+ \ifdim\scratchdimenthree<\scratchdimenone
+ \advanceby\scratchdimenone -\scratchdimenthree
+ \divideby\scratchdimenone \scratchcountertwo
\c_tabl_ntb_current_row_four\c_tabl_ntb_current_row_three
- \tabl_ntb_set_hei\c_tabl_ntb_current_row_three{\the\dimen2}%
- \dorecurse\scratchcountertwo
- {\dorecurse\c_tabl_ntb_maximum_col
- {\ifnum\recurselevel=\c_tabl_ntb_current_col_three\else
- \scratchdimen\dimexpr\tabl_ntb_get_ht\c_tabl_ntb_current_row_four\recurselevel+\dimen0\relax
- \tabl_ntb_set_ht\c_tabl_ntb_current_row_four\recurselevel{\the\scratchdimen}%
+ \tabl_ntb_set_hei\c_tabl_ntb_current_row_three\scratchdimentwo\relax
+ \localcontrolledloop\plusone\scratchcountertwo\plusone
+ {\localcontrolledloop\plusone\c_tabl_ntb_maximum_col\plusone
+ {\ifnum\currentloopiterator=\c_tabl_ntb_current_col_three\else
+ \scratchdimen\dimexpr\tabl_ntb_get_ht\c_tabl_ntb_current_row_four\currentloopiterator+\scratchdimenone\relax
+ \tabl_ntb_set_ht\c_tabl_ntb_current_row_four\currentloopiterator\scratchdimen
\ifdim\tabl_ntb_get_hei\c_tabl_ntb_current_row_four<\scratchdimen
- \tabl_ntb_set_hei\c_tabl_ntb_current_row_four{\the\scratchdimen}%
+ \tabl_ntb_set_hei\c_tabl_ntb_current_row_four\scratchdimen
\fi
\fi}%
- \advance\c_tabl_ntb_current_row_four\plusone}%
- \orelse\ifdim\dimen4>\dimen0
+ \advanceby\c_tabl_ntb_current_row_four\plusone}%
+ \orelse\ifdim\scratchdimenthree>\scratchdimenone
\iftightTBLrowspan
- \tabl_ntb_set_hei\c_tabl_ntb_current_row_three{\the\dimen2}%
+ \tabl_ntb_set_hei\c_tabl_ntb_current_row_three\scratchdimentwo\relax
\fi
\fi
\fi
\fi}
\def\tabl_ntb_check_heights_one
- {\dorecurse\c_tabl_ntb_maximum_row
- {\c_tabl_ntb_current_row_three\recurselevel\relax
- \dorecurse\c_tabl_ntb_maximum_col
- {\c_tabl_ntb_current_col_three\recurselevel\relax
+ {\localcontrolledloop\plusone\c_tabl_ntb_maximum_row\plusone
+ {\c_tabl_ntb_current_row_three\currentloopiterator\relax
+ \localcontrolledloop\plusone\c_tabl_ntb_maximum_col\plusone
+ {\c_tabl_ntb_current_col_three\currentloopiterator\relax
\ifcsname\tabl_ntb_row_pattern\c_tabl_ntb_current_row_three\c_tabl_ntb_current_col_three\endcsname
\tabl_ntb_check_heights_one_indeed
\fi}}}
@@ -1848,16 +1963,15 @@
\def\tabl_ntb_show_widths#1#2%
{\begingroup
\scratchdimen\zeropoint
- \dorecurse\c_tabl_ntb_maximum_col
- {\advance\scratchdimen\tabl_ntb_get_wid\recurselevel\relax}%
+ \localcontrolledloop\plusone\c_tabl_ntb_maximum_col\plusone
+ {\advanceby\scratchdimen\tabl_ntb_get_wid\currentloopiterator\relax}%
\writestatus\m!TABLE{#1 \ifcase#2trial\else real\fi: hsize: \the\hsize, total: \the\scratchdimen}%
- \dorecurse\c_tabl_ntb_maximum_col
- {\writestatus\m!TABLE{\space\space\recurselevel: \the\dimexpr\tabl_ntb_get_wid\recurselevel}}%
+ \localcontrolledloop\plusone\c_tabl_ntb_maximum_col\plusone
+ {\writestatus\m!TABLE{\space\space\the\currentloopiterator: \the\dimexpr\tabl_ntb_get_wid\currentloopiterator}}%
\endgroup}
\def\tabl_ntb_char_align % called often
- {\edef\p_characteralign{\naturaltablelocalparameter\c!aligncharacter}%
- \ifx\p_characteralign\v!yes
+ {\ifcstok{\naturaltablelocalparameter\c!aligncharacter}\v!yes
\ifcase\c_tabl_tbl_pass\or
\tabl_ntb_let_tal\currentTABLEcolumn\plusone
\tabl_ntb_let_gal\plusone
@@ -1907,21 +2021,21 @@
\def\tabl_ntb_cell_process_a_check_span_two_nop
{\ifdim\tabl_ntb_get_wid\c_tabl_ntb_col<\wd\scratchbox
- \tabl_ntb_set_wid\c_tabl_ntb_col{\the\wd\scratchbox}%
+ \tabl_ntb_set_wid\c_tabl_ntb_col\wd\scratchbox
\fi}
\protected\def\tabl_ntb_cell_process_a#1#2[#3]#4% grouping added ! ! !
- {\bgroup
- \letnaturaltablelocalparameter\c!option\empty
+ {\begingroup
+ \resetnaturaltablelocalparameter\c!option\empty
\tabl_ntb_setup_cell{#1}{#2}%
\setupcurrentnaturaltablelocal[#3]%
- \letnaturaltablelocalparameter\c!background\empty
+ \resetnaturaltablelocalparameter\c!background
\letnaturaltablelocalparameter\c!frame\v!off
\scratchcounter\tabl_ntb_get_col{#1}{#2}\relax
\setbox\scratchbox\hbox
{\scratchdimen\naturaltablelocalparameter\c!distance\relax
\ifdim\scratchdimen>\tabl_ntb_get_dis{#2}\relax
- \tabl_ntb_set_dis{#2}{\the\scratchdimen}%
+ \tabl_ntb_set_dis{#2}\scratchdimen
\fi
\anch_backgrounds_text_level_start
\inheritednaturaltablelocalframed{\tabl_ntb_cell_start\tabl_ntb_char_align{#1}{#2}#4\tabl_ntb_cell_stop\tabl_ntb_cell_finalize}%
@@ -1942,10 +2056,10 @@
\scratchcounter\numexpr\c_tabl_ntb_row+\plusone\relax
\scratchdimen\tabl_ntb_get_hei\scratchcounter\relax
\ifdim\ht\scratchbox<\scratchdimen
- \tabl_ntb_set_hei\scratchcounter{\the\ht\scratchbox}% auto set
+ \tabl_ntb_set_hei\scratchcounter\ht\scratchbox% auto set
\fi
- \tabl_ntb_set_ht{#1}{#2}{\the\ht\scratchbox}%
- %tabl_ntb_set_wd{#1}{#2}{\the\wd\scratchbox}%
+ \tabl_ntb_set_ht{#1}{#2}\ht\scratchbox
+ %tabl_ntb_set_wd{#1}{#2}\wd\scratchbox
\ifautoTBLcheckwidth
\ifdim\wd\scratchbox<.75\hsize % fuzzy guess
\ifdim\ht\scratchbox>2\openlineheight % honor width since this
@@ -1953,10 +2067,10 @@
\ifzeropt\scratchdimen
% side effect: when width is set to 0pt,
% we can force a span that fits the sum of spans widths
- \tabl_ntb_set_aut\c_tabl_ntb_col{\the\scratchdimen}%
+ \tabl_ntb_set_aut\c_tabl_ntb_col\scratchdimen
\orelse\ifdim\wd\scratchbox>\scratchdimen
% unless span
- \tabl_ntb_set_aut\c_tabl_ntb_col{\the\wd\scratchbox}%
+ \tabl_ntb_set_aut\c_tabl_ntb_col\wd\scratchbox
% to be translated
\writestatus\m!TABLE{no auto width in (\number#1,\number#2)\space\the\wd\scratchbox/\the\hsize}%
\fi
@@ -1968,31 +2082,33 @@
\ht\scratchboxone\ht\scratchbox
\dp\scratchboxone\dp\scratchbox
\box\scratchboxone
- \egroup}
+ \endgroup}
\protected\def\tabl_ntb_cell_process_b_c#1#2#3[#4]#5%
- {\setbox\scratchbox\hbox
+ {\begingroup
+ \setbox\scratchbox\hbox
{\tabl_ntb_setup_cell{#2}{#3}%
\setupcurrentnaturaltablelocal[#4,#1]%
- \letnaturaltablelocalparameter\c!background\empty
+ \resetnaturaltablelocalparameter\c!background
\letnaturaltablelocalparameter\c!frame\v!off
\inheritednaturaltablelocalframed{\tabl_ntb_cell_start#5\tabl_ntb_cell_stop}}%
- \setbox2\emptyhbox % todo: \scratchboxtwo
- \wd2\wd\scratchbox
- \ht2\ht\scratchbox
- \dp2\dp\scratchbox
+ \setbox\scratchboxone\emptyhbox
+ \wd\scratchboxone\wd\scratchbox
+ \ht\scratchboxone\ht\scratchbox
+ \dp\scratchboxone\dp\scratchbox
\ifautoTBLrowspan
\scratchcounter\numexpr\c_tabl_ntb_row+\plusone\relax
\ifcsname\tabl_ntb_row_pattern\scratchcounter\c_tabl_ntb_col\endcsname
\scratchdimen\tabl_ntb_get_hei\scratchcounter\relax
\ifnum\tabl_ntb_get_row\scratchcounter\c_tabl_ntb_col>\plusone
\ifdim\ht\scratchbox>\scratchdimen
- \ht2\dimexpr-\scratchdimen-\ht\scratchbox\relax
+ \ht\scratchboxone\dimexpr-\scratchdimen-\ht\scratchbox\relax
\fi
\fi
\fi
\fi
- \box2 }
+ \box\scratchboxone
+ \endgroup}
\protected\def\tabl_ntb_cell_process_b#1#2[#3]#4%
{\scratchdimen\tabl_ntb_get_aut\c_tabl_ntb_col\relax
@@ -2015,35 +2131,40 @@
{\tabl_ntb_setup_cell{#1}{#2}%
\bgroup
\setupcurrentnaturaltablelocal[#3]%
- \letnaturaltablelocalparameter\c!background\empty
- \letnaturaltablelocalparameter\c!frame\v!off
- \setnaturaltablelocalparameter\c!width{\d_tabl_ntb_width}%
+ \resetnaturaltablelocalparameter\c!background
+ \letnaturaltablelocalparameter \c!frame \v!off
+ \setnaturaltablelocalparameter \c!width {\d_tabl_ntb_width}%
\inheritednaturaltablelocalframed{\tabl_ntb_cell_start\tabl_ntb_char_align{#1}{#2}#4\tabl_ntb_cell_stop}%
\egroup}
\protected\def\tabl_ntb_cell_process_e#1#2[#3]#4%
- {\tabl_ntb_setup_cell{#1}{#2}%
+ {\begingroup
+ \tabl_ntb_setup_cell{#1}{#2}%
\setupcurrentnaturaltablelocal[#3]% to get the color right, the way we
- \color % handle color here prevents interference due to whatsit nodes
- [\naturaltablelocalparameter\c!color] % as well as permits local colors to take precedence
- {\letnaturaltablelocalparameter\c!color\empty
- \setnaturaltablelocalparameter\c!width{\d_tabl_ntb_width}%
- \ifzeropt\d_tabl_ntb_height % case: nc=maxcolumns
- \else
- \setnaturaltablelocalparameter\c!height{\d_tabl_ntb_height}%
- \fi
- \ifcase\c_anch_backgrounds_text_count\else
- \edef\p_region{\naturaltablelocalparameter\c!region}%
- \ifempty\p_region\ifnum\tabl_ntb_get_bck{#1}{#2}>\zerocount
- \letnaturaltablelocalparameter\c!region\v!yes
- \fi\fi
- \fi
- \inheritednaturaltablelocalframed{\tabl_ntb_cell_start\tabl_ntb_char_align{#1}{#2}#4\tabl_ntb_cell_stop}}%
- \hskip\tabl_ntb_get_dis{#2}}
+ \directcolor[\naturaltablelocalparameter\c!color]%
+ \resetnaturaltablelocalparameter\c!color
+ \setnaturaltablelocalparameter \c!width{\d_tabl_ntb_width}%
+ \ifzeropt\d_tabl_ntb_height % case: nc=maxcolumns
+ \else
+ \setnaturaltablelocalparameter\c!height{\d_tabl_ntb_height}%
+ \fi
+ \ifcase\c_anch_backgrounds_text_count\else
+ \edef\p_region{\naturaltablelocalparameter\c!region}%
+ \ifempty\p_region\ifnum\tabl_ntb_get_bck{#1}{#2}>\zerocount
+ \letnaturaltablelocalparameter\c!region\v!yes
+ \fi\fi
+ \fi
+ \tabl_ntb_anchor_start{#1}{#2}%
+ \inheritednaturaltablelocalframed{\tabl_ntb_cell_start\tabl_ntb_char_align{#1}{#2}#4\tabl_ntb_cell_stop}%
+ \tabl_ntb_anchor_stop
+ \hskip\tabl_ntb_get_dis{#2}%
+ \endgroup}
\newtoks\everyresetTABLEyes
\newtoks\everyresetTABLEnop
+% todo : use \letTABLEparameter\c!width\v!fit ...
+
\appendtoks
\setupTABLE [%
%
diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-tab.mkxl b/Master/texmf-dist/tex/context/base/mkxl/tabl-tab.mkxl
index 547ff93ff5d..8c872cd477b 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/tabl-tab.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-tab.mkxl
@@ -34,11 +34,11 @@
\newconditional\c_tabl_table_spacing_left
\newconditional\c_tabl_table_spacing_right
-\newdimen \d_tabl_table_line_thickness_unit
-\newdimen \d_tabl_table_strut_unit
-\newskip \s_tabl_table_inter_column_space_unit
-\newdimen \d_tabl_table_column_width_unit
-\newdimen \d_tabl_table_kern_unit
+\newdimension \d_tabl_table_line_thickness_unit
+\newdimension \d_tabl_table_strut_unit
+\newgluespec \s_tabl_table_inter_column_space_unit
+\newdimension \d_tabl_table_column_width_unit
+\newdimension \d_tabl_table_kern_unit
\mutable\def\tablestrutheightfactor {8}
\mutable\def\tablestrutdepthfactor {3}
@@ -57,7 +57,8 @@
\dontcomplain
\tabl_table_restore_lineskips
\normalbaselines
- \enforced\let~\fixedspace
+ % \enforced\let~\fixedspace
+` \enforced\letcharcode\tildeasciicode\fixedspace % why
\inhibitblank % \blank[\v!disable]% % added
\the\everytableparbox}
@@ -84,26 +85,26 @@
\rightskip\zeropoint \s!plus 4em \relax
\to \everytableparbox
-\newskip \tablelefttabskip
-\newskip \tablerighttabskip
+\newgluespec \tablelefttabskip
+\newgluespec \tablerighttabskip
-\newcount\!taColumnNumber
-\newcount\!taRecursionLevel % (Initially 0)
+\newinteger \!taColumnNumber
+\newinteger \!taRecursionLevel % (Initially 0)
-\newdimen\!taDimenA % used by \Enlarge
-\newdimen\!taDimenB % used by \Enlarge
-\newdimen\!taDimenC % used by numeric.tex
-\newdimen\!taMinimumColumnWidth
+\newdimension\!taDimenA % used by \Enlarge
+\newdimension\!taDimenB % used by \Enlarge
+\newdimension\!taDimenC % used by numeric.tex
+\newdimension\!taMinimumColumnWidth
-\newtoks \!taTableSpread
-\newtoks \!taPreamble
-\newtoks \!taDataColumnTemplate
-\newtoks \!taRuleColumnTemplate
-\newtoks \!taOldRuleColumnTemplate
-\newtoks \!taLeftGlue
-\newtoks \!taRightGlue
+\newtoks \!taTableSpread
+\newtoks \!taPreamble
+\newtoks \!taDataColumnTemplate
+\newtoks \!taRuleColumnTemplate
+\newtoks \!taOldRuleColumnTemplate
+\newtoks \!taLeftGlue
+\newtoks \!taRightGlue
-\newskip \!taLastRegularTabskip
+\newgluespec \!taLastRegularTabskip
\newif \if!taBeginFormat
\newif \if!taOnceOnlyTabskip
@@ -122,13 +123,13 @@
{\!taPreamble\emptytoks
\!taColumnNumber\zerocount
\scratchskip\s_tabl_table_inter_column_space_unit
- \multiply\scratchskip\tableintercolumnspacefactor
- \divide\scratchskip\plustwo
+ \multiplyby\scratchskip\tableintercolumnspacefactor
+ \divideby\scratchskip\plustwo
\!taRuleColumnTemplate\expandafter{\expandafter\tabskip\the\scratchskip}%
\!taLastRegularTabskip\scratchskip
\!taOnceOnlyTabskipfalse
\!taBeginFormattrue
- \let\!tfRowOfWidths\empty
+ \lettonothing\!tfRowOfWidths
\doreadtableformatkeys}
\def\!tfSetWidth
@@ -143,7 +144,7 @@
\aftergroup\omit
\!thLoop
\ifnum \scratchcounter<\!taColumnNumber
- \advance\scratchcounter\plusone
+ \advanceby\scratchcounter\plusone
\aftergroup\!tfAOAO
\repeat
\aftergroup}%
@@ -169,18 +170,18 @@
\else
\!tgValue
\fi
- \let\!tfWidthText\empty % Override possible prior `w[sample entry]'
+ \lettonothing\!tfWidthText % Override possible prior `w[sample entry]'
\doreadtableformatkeys}
\def\!tfSetTabskip
{\ifnum\!tgCode=\plusone
\scratchskip\s_tabl_table_inter_column_space_unit
- \multiply\scratchskip \ifempty\!tgValue\tableintercolumnspacefactor\else\!tgValue\fi
+ \multiplyby\scratchskip \ifempty\!tgValue\tableintercolumnspacefactor\else\!tgValue\fi
\else
\scratchskip\!tgValue
\fi
- \divide\scratchskip\plustwo
- \ifnum\!taColumnNumber=\zerocount
+ \divideby\scratchskip\plustwo
+ \ifzero\!taColumnNumber
%\!thToksEdef\!taRuleColumnTemplate{\the\!taRuleColumnTemplate\tabskip\the\scratchskip}%
\normalexpanded{\!taRuleColumnTemplate{\the\!taRuleColumnTemplate\tabskip\the\scratchskip}}%
\else
@@ -207,7 +208,7 @@
\else
\!tgValue
\fi
- \alignmark\alignmark\alignmark\alignmark
+ \aligncontent
\hfil
\the\!taRuleColumnTemplate}%
\!tfAdjoinPriorColumn}
@@ -220,7 +221,7 @@
\!tfAdjoinPriorColumn}
\def\!tfAdjoinPriorColumn
- {\ifnum\!taColumnNumber=\zerocount
+ {\ifzero\!taColumnNumber
\!taPreamble=\!taRuleColumnTemplate % New \tabskip may have been added
\else
\ifempty\!tfRowOfWidths\else % no "w" keys specified yet, not even this col
@@ -229,17 +230,17 @@
\!thToksEdef\!taDataColumnTemplate{\the\!taLeftGlue\the\!taDataColumnTemplate\the\!taRightGlue}%
\!thToksEdef\!taPreamble{\the\!taPreamble\aligntab\the\!taDataColumnTemplate\aligntab\the\!taRuleColumnTemplate}%
\fi
- \advance\!taColumnNumber\plusone
+ \advanceby\!taColumnNumber\plusone
\if!taOnceOnlyTabskip
- \!thToksEdef\!taDataColumnTemplate{\alignmark\alignmark\alignmark\alignmark\tabskip\the\!taLastRegularTabskip}%
+ \!thToksEdef\!taDataColumnTemplate{\aligncontent\tabskip\the\!taLastRegularTabskip}%
\else
- \!taDataColumnTemplate{\alignmark\alignmark}%
+ \!taDataColumnTemplate{\aligncontent}%
\fi
\!taRuleColumnTemplate\emptytoks
\!taLeftGlue{\hfil}%
\!taRightGlue{\hfil}%
\!taMinimumColumnWidth\zeropoint
- \let\!tfWidthText\empty
+ \lettonothing\!tfWidthText
\!taOnceOnlyTabskipfalse
\doreadtableformatkeys}
@@ -259,24 +260,24 @@
\def\!tfComputeMinColWidth
{\setbox\scratchbox\vbox
- {\ialign{% Plain's initialized \halign; \tabskip=0pt \everycr={}
- \span\the\!taDataColumnTemplate\cr
- \!tfWidthText\cr}}%
+ {\everycr\emptytoks
+ \tabskip\zeroskip
+ \halign{\span\the\!taDataColumnTemplate\cr\!tfWidthText\cr}}%
\!taMinimumColumnWidth\wd\scratchbox}
\def\!tfFinishFormat
{\!thToksEdef\!taPreamble{%
- \alignmark\alignmark\alignmark\alignmark\tabskip\tablelefttabskip
+ \aligncontent\tabskip\tablelefttabskip
\aligntab
\the\!taPreamble\tabskip\tablerighttabskip
\aligntab
- \alignmark\alignmark\alignmark\alignmark\tabskip\zeropoint\cr}
+ \aligncontent\tabskip\zeropoint\cr}
\!taBeginFormatfalse
\!ttDoHalign}
\def\tabl_table_reformat[#1]% will become local
{\omit
- \!taDataColumnTemplate{\alignmark\alignmark}%
+ \!taDataColumnTemplate{\aligncontent}%
\!taLeftGlue\emptytoks
\!taRightGlue\emptytoks
\begingroup
@@ -298,7 +299,11 @@
\def\!tfReFormat#1%
{\the \!taLeftGlue
- \vbox{\forgetall\ialign{\span\the\!taDataColumnTemplate\cr#1\cr}}%
+ \vbox
+ {\forgetall
+ \everycr\emptytoks
+ \tabskip\zeroskip
+ \halign{\span\the\!taDataColumnTemplate\cr#1\cr}}%
\the \!taRightGlue
\kern\zeropoint} % prevents \unskip / really needed
@@ -320,7 +325,7 @@
\def\!tgCheckForSpace
{\def\!tgCode{1}%
- \let\!tgValue\empty
+ \lettonothing\!tgValue
\ifx\tempstring\!thSpaceToken
\expandafter\!tgReturn
\else
@@ -421,7 +426,7 @@
\!thLoop
\ifnum\scratchcounter>\zerocount
\toksapp\scratchtoks{#2}%
- \advance\scratchcounter\minusone
+ \advanceby\scratchcounter\minusone
\repeat
\expandafter\doreadtableformatkeys\the\scratchtoks}
@@ -626,7 +631,7 @@
\scratchcounter#1\relax
\!thLoop
\ifnum \scratchcounter>\zerocount
- \advance\scratchcounter\minusone
+ \advanceby\scratchcounter\minusone
\aftergroup0
\repeat
\def\tempstring{#3}%
@@ -635,7 +640,7 @@
\scratchcounter#2\relax
\!thLoop
\ifnum \scratchcounter>\zerocount
- \advance\scratchcounter\minusone
+ \advanceby\scratchcounter\minusone
\aftergroup0
\repeat
\fi
@@ -677,7 +682,7 @@
% extensions
\newtableformatkey q%
- {\let\!tqStyle\empty
+ {\lettonothing\!tqStyle
\futurelet\!tnext\!tqTestForBracket}
\newtableformatkey Q%
@@ -703,7 +708,7 @@
\scratchcounter#1\relax
\!thLoop
\ifnum \scratchcounter>\zerocount
- \advance\scratchcounter\minusone
+ \advanceby\scratchcounter\minusone
\aftergroup0
\repeat
\def\tempstring{#3}%
@@ -712,7 +717,7 @@
\scratchcounter#2\relax
\!thLoop
\ifnum\scratchcounter>\zerocount
- \advance\scratchcounter\minusone
+ \advanceby\scratchcounter\minusone
\aftergroup0
\repeat
\fi
@@ -754,9 +759,9 @@
% #2=extra depth
\!taDimenA=#1\relax
\!taDimenB=#2\relax
- \let\!TsSpaceFactor\empty
+ \lettonothing\!TsSpaceFactor
\ifmmode
- \expandafter\mathpalette
+ \expandafter\mathpalette % (*) the only place where still use this
\expandafter\!TsEnlargeMath
\else
\expandafter\!TsEnlargeOther
@@ -821,7 +826,7 @@
\fi
\bgroup % for the \vtop, \vbox, or \vcenter
\fi
- \advance\!taRecursionLevel\plusone
+ \advanceby\!taRecursionLevel\plusone
\let\!ttRightGlue\relax
\everycr\emptytoks
\ifnum\!taRecursionLevel=\plusone
@@ -831,7 +836,7 @@
\bgroup \catcode\tildeasciicode\activecatcode
\appendtoks
- \catcode\barasciicode\activecatcode
+% \catcode\barasciicode\activecatcode
\enforced\protected\def ~{\kern.5em}%
\enforced\protected\def\\{\ifhmode\space\else\par\fi}%
\to \everytable
@@ -889,10 +894,10 @@
% INSERT VRULE
-\newcount\c_tabl_table_n_of_vrules \c_tabl_table_n_of_vrules\plusone
+\newinteger\c_tabl_table_n_of_vrules \c_tabl_table_n_of_vrules\plusone
-\let\m_tabl_table_vrule_color\empty
-\let\m_tabl_table_hrule_color\empty
+\lettonothing\m_tabl_table_vrule_color
+\lettonothing\m_tabl_table_hrule_color
\def\tabl_table_insert_vrule
{\vrule\s!width
@@ -925,7 +930,7 @@
\global\c_tabl_table_n_of_vrules\plusone
\unskip
\fi
- \glet\m_tabl_table_vrule_color\empty
+ \glettonothing\m_tabl_table_vrule_color
\hfil
\aligntab}
@@ -945,22 +950,22 @@
\omit
\global\setfalse\c_tabl_table_is_division % added
\scratchcounter\currenttablecolumn % added
- \advance\scratchcounter #1% % added
- \advance\scratchcounter \minusone % added
+ \advanceby\scratchcounter #1% % added
+ \advanceby\scratchcounter \minusone % added
\def\next % added
- {\global\advance\currenttablecolumn #1% % added
- \global\advance\currenttablecolumn \minusone % added
+ {\global\advanceby\currenttablecolumn #1% % added
+ \global\advanceby\currenttablecolumn \minusone % added
\scratchcounter#1%
- \advance\scratchcounter \minusone
- \advance\scratchcounter \scratchcounter
+ \advanceby\scratchcounter \minusone
+ \advanceby\scratchcounter \scratchcounter
\!thLoop
\ifnum\scratchcounter>\plusone
- \spanomit \advance\scratchcounter\minusone
+ \spanomit \advanceby\scratchcounter\minusone
\repeat
\span}%
\else % added
\def\next % conflicts with possible next \omit % added
- {\global\advance\currenttablecolumn \plusone}%% added
+ {\global\advanceby\currenttablecolumn \plusone}%% added
\fi
\next} % added
@@ -1014,7 +1019,7 @@
\else
\!tgValue % user-specified dimension
\fi
- \divide\scratchdimen\plustwo}
+ \divideby\scratchdimen\plustwo}
% \emptyhbox prevents \unskip
@@ -1023,8 +1028,8 @@
\def\tabl_table_Right #1{\hfill#1}
\def\tabl_table_OpenUp#1#2%
- {\edef\tablestrutheightfactor{\withoutpt\the\dimexpr\tablestrutheightfactor\points+#1\points}%
- \edef\tablestrutdepthfactor {\withoutpt\the\dimexpr\tablestrutdepthfactor \points+#2\points}}
+ {\edef\tablestrutheightfactor{\toscaled\dimexpr\tablestrutheightfactor\points+#1\points}%
+ \edef\tablestrutdepthfactor {\toscaled\dimexpr\tablestrutdepthfactor \points+#2\points}}
% SetTableToWidth -> textwidth=dimension [to dimension]
% Expand -> textwidth=max [to \hsize]
@@ -1040,7 +1045,7 @@
\def\tabl_table_Smash
{\relax
\ifmmode
- \expandafter\mathpalette
+ \expandafter\mathpalette % (*)
\expandafter\!thDoMathVCS
\else
\expandafter\!thDoVCS
@@ -1069,8 +1074,8 @@
{\ifnum\!tgCode=\plusone
\ifempty\!tgValue
\!taDimenA\tablestrutheightfactor\d_tabl_table_strut_unit
- \advance\!taDimenA\tablestrutdepthfactor\d_tabl_table_strut_unit
- \divide\!taDimenA\plustwo
+ \advanceby\!taDimenA\tablestrutdepthfactor\d_tabl_table_strut_unit
+ \divideby\!taDimenA\plustwo
\else
\!taDimenA\!tgValue\d_tabl_table_strut_unit
\fi
@@ -1079,7 +1084,7 @@
\fi
\!taDimenA\!thSign\!taDimenA\relax
\ifmmode
- \expandafter\mathpalette
+ \expandafter\mathpalette % (*)
\expandafter\!thDoMathRaise
\else
\expandafter\!thDoSimpleRaise
@@ -1376,8 +1381,8 @@
{\tabl_tables_chuck_auto_row % before the tail, else noalign problem
\tabl_table_insert_tail
\noalign\bgroup
- \glet\tabl_table_head\empty
- \glet\tabl_table_tail\empty
+ \glettonothing\tabl_table_head
+ \glettonothing\tabl_table_tail
\egroup
\tabl_table_finish
\ifempty\p_tabl_table_frame
@@ -1429,7 +1434,7 @@
\tolerant\def\tabl_table_define_template[#1]#*[#2]#*[#3]#*[#4]%
{\ifarguments\or\else
- \setgvalue{\??tabletemplate#1}{\tabl_table_use_template{#2}{#3}{#4}}%
+ \gdefcsname\??tabletemplate#1\endcsname{\tabl_table_use_template{#2}{#3}{#4}}%
\fi
\egroup}
@@ -1488,26 +1493,42 @@
% \noalign{\globalpopmacro\simpletableHL}%
}
-\bgroup \catcode\barasciicode\othercatcode
+% \bgroup \catcode\barasciicode\othercatcode
+%
+% \gdef\tabl_table_second_stage[#1]% brr nested mess
+% {\bgroup
+% \tabl_table_use_bar
+% \global\setfalse\tableactionstatepermitted
+% \global\setfalse\hassometablehead
+% \global\setfalse\hassometabletail
+% \expanded{\doifelseinstring{|}{#1}}
+% {\xdef\tabl_table_restart{\noexpand\tabl_table_restart_indeed{\noexpand\tabl_table_third_stage{#1}}}}
+% {\ifcsname\??tabletemplate#1\endcsname
+% \gdef\tabl_table_restart{\csname\??tabletemplate#1\endcsname}%
+% \else
+% \gdef\tabl_table_restart{\tabl_table_restart_indeed{\begincsname#1\endcsname}}%
+% \fi}%
+% \egroup
+% \tabl_table_restart}
+%
+% \egroup
-\gdef\tabl_table_second_stage[#1]% brr nested mess
+\def\tabl_table_second_stage[#1]% brr nested mess
{\bgroup
\tabl_table_use_bar
\global\setfalse\tableactionstatepermitted
\global\setfalse\hassometablehead
\global\setfalse\hassometabletail
- \expanded{\doifelseinstring{|}{#1}}
- {\xdef\tabl_table_restart{\noexpand\tabl_table_restart_indeed{\noexpand\tabl_table_third_stage{#1}}}}
- {\ifcsname\??tabletemplate#1\endcsname
- \gdef\tabl_table_restart{\csname\??tabletemplate#1\endcsname}%
- \else
- \gdef\tabl_table_restart{\tabl_table_restart_indeed{\begincsname#1\endcsname}}%
- \fi}%
+ \normalexpanded{\noexpand\ifhastoks{|}{#1}}%
+ \xdef\tabl_table_restart{\noexpand\tabl_table_restart_indeed{\noexpand\tabl_table_third_stage{#1}}}%
+ \orelse\ifcsname\??tabletemplate#1\endcsname
+ \gdef\tabl_table_restart{\csname\??tabletemplate#1\endcsname}%
+ \else
+ \gdef\tabl_table_restart{\tabl_table_restart_indeed{\begincsname#1\endcsname}}%
+ \fi
\egroup
\tabl_table_restart}
-\egroup
-
%D The third stage involves a lot of (re)sets, which we will explain later.
\appendtoks
@@ -1519,7 +1540,7 @@
\newtoks\localtabledefinitions
-\mutable\let\currenttableformat\empty
+\mutable\lettonothing\currenttableformat
\def\tabl_table_third_stage#1%
{\global\settrue\tableactionstatepermitted
@@ -1591,8 +1612,8 @@
\egroup
\dontcomplain
\tabl_table_split_box\tablecontentbox
- \glet\tabl_table_head\empty % new here
- \glet\tabl_table_tail\empty % new here
+ \glettonothing\tabl_table_head % new here
+ \glettonothing\tabl_table_tail % new here
\flushnotes
\egroup}
@@ -1640,13 +1661,15 @@
%D (grouped) if needed. The rather complicated definition below is due to the fact
%D that the stopcondition is interface language dependant.
-\let\tabl_table_head\empty % needs checking
-\let\tabl_table_tail\empty % needs checking
+%D This is so old ... adapting it to use tolerant might break something:
-\letvalue{\e!start\v!tablehead}\relax % todo: frozen, but we use a grabber
-\letvalue{\e!stop \v!tablehead}\relax % todo: frozen, but we use a grabber
-\letvalue{\e!start\v!tabletail}\relax % todo: frozen, but we use a grabber
-\letvalue{\e!stop \v!tabletail}\relax % todo: frozen, but we use a grabber
+\lettonothing\tabl_table_head % needs checking
+\lettonothing\tabl_table_tail % needs checking
+
+\letcsname\e!start\v!tablehead\endcsname\relax % todo: frozen, but we use a grabber
+\letcsname\e!stop \v!tablehead\endcsname\relax % todo: frozen, but we use a grabber
+\letcsname\e!start\v!tabletail\endcsname\relax % todo: frozen, but we use a grabber
+\letcsname\e!stop \v!tabletail\endcsname\relax % todo: frozen, but we use a grabber
%D The second argument is a dummy one, by scanning for it, we get rid of
%D interfering spaces.
@@ -1655,9 +1678,6 @@
\newconditional\hassometablehead
\newconditional\hassometabletail
-% \def\tabl_table_set_head[#1][#2]#3\end{\setvalue{\??tablehead#1}{\noalign{\global\settrue\hassometablehead}#3}}
-% \def\tabl_table_set_tail[#1][#2]#3\end{\setvalue{\??tabletail#1}{\noalign{\global\settrue\hassometabletail}#3}}
-
\permanent\protected\def\settablehead{\dodoubleempty\tabl_table_set_head} % todo: use pickup
\permanent\protected\def\settabletail{\dodoubleempty\tabl_table_set_tail} % todo: use pickup
@@ -1691,8 +1711,8 @@
\noalign\bgroup
\nobreak
\tabl_table_set_action\tableunknownstate
- \glet\tabl_tables_check_auto_row\empty
- \glet\tabl_tables_chuck_auto_row\empty
+ \glettonothing\tabl_tables_check_auto_row
+ \glettonothing\tabl_tables_chuck_auto_row
\global\currenttablecolumn\zerocount
\egroup}
@@ -1821,18 +1841,18 @@
{\glet\tabl_tables_check_auto_row\tabl_tables_check_auto_row_indeed
\glet\tabl_tables_chuck_auto_row\tabl_tables_chuck_auto_row_indeed}
-\let\tabl_tables_check_auto_row\empty
-\let\tabl_tables_chuck_auto_row\empty
+\lettonothing\tabl_tables_check_auto_row
+\lettonothing\tabl_tables_chuck_auto_row
\def\tabl_tables_check_auto_row_indeed
- {\glet\tabl_tables_check_auto_row\empty
+ {\glettonothing\tabl_tables_check_auto_row
\ifnum\tableactionstate=\tablerulestate \FR\orelse
\ifnum\tableactionstate=\tableunknownstate\FR\else
\MR\fi}
\def\tabl_tables_chuck_auto_row_indeed
- {\glet\tabl_tables_check_auto_row\empty
- \glet\tabl_tables_chuck_auto_row\empty
+ {\glettonothing\tabl_tables_check_auto_row
+ \glettonothing\tabl_tables_chuck_auto_row
\ifnum\tableactionstate=\tablerulestate \SR\orelse
\ifnum\tableactionstate=\tableunknownstate\SR\else
\LR\fi}
@@ -1854,16 +1874,17 @@
%D the number of \type{|}'s and \type{\VL}'s or alike is always one more than the
%D number of columns.
-\newcount\currenttablecolumn
+\newinteger\currenttablecolumn
-% DWhile defining this macro we change the \CATCODE\ of \type{|}. When counting the
-% Dbars, we use a non active representation of the bar, simply because we cannot be
-% Dsure if the bar is active or not.\footnote{Normally it is, but \TABLE\ changes
-% Dthe catcode when needed.}
+%D While defining this macro we change the \CATCODE\ of \type{|}. When counting the
+%D bars, we use a non active representation of the bar, simply because we cannot be
+%D sure if the bar is active or not.\footnote{Normally it is, but \TABLE\ changes
+%D the catcode when needed.}
\bgroup
- \catcode\barasciicode\othercatcode \permanent\gdef\tabl_table_bar{|}
- \catcode\barasciicode\activecatcode\gdef\tabl_table_use_bar{\enforced\let|\tabl_table_bar}
+% \catcode\barasciicode\othercatcode \permanent\gdef\tabl_table_bar{|}
+% \catcode\barasciicode\activecatcode\gdef\tabl_table_use_bar{\enforced\let|\tabl_table_bar}
+\glet\tabl_table_use_bar\relax
\egroup
\bgroup \catcode\barasciicode\othercatcode
@@ -1871,7 +1892,7 @@
\gdef\tabl_tables_get_nofcolumns#1% todo: also divert this to lua as with tabulate
{\bgroup
\cleanupfeatures % needed !
- \tabl_table_use_bar
+ \tabl_table_use_bar % doesn't do anything as we don't treat #1
\egroup}
\egroup
@@ -1883,12 +1904,12 @@
%D \sym{\type{\HC}} a horizontal colored line
%D \stopitemize
-\newcount\c_tabl_table_vrule_thickness_factor
-\newcount\c_tabl_table_hrule_thickness_factor
-\newcount\c_tabl_table_drule_span
+\newinteger\c_tabl_table_vrule_thickness_factor
+\newinteger\c_tabl_table_hrule_thickness_factor
+\newinteger\c_tabl_table_drule_span
-\let\m_tabl_table_vrule_color\empty
-\let\m_tabl_table_hrule_color\empty
+\lettonothing\m_tabl_table_vrule_color
+\lettonothing\m_tabl_table_hrule_color
\appendtoks
\enforced\let\VL\tabl_table_VL
@@ -1907,13 +1928,13 @@
\def\tabl_table_vrulecommand#1% global assignments
{\doifelsenumber{#1}
{\global\c_tabl_table_vrule_thickness_factor#1\relax
- \global\multiply\c_tabl_table_vrule_thickness_factor\m_tabl_table_VLwidth\relax}
+ \global\multiplyby\c_tabl_table_vrule_thickness_factor\m_tabl_table_VLwidth\relax}
{\xdef\m_tabl_table_vrule_color{#1}}}
\permanent\tolerant\protected\def\tabl_table_VL[#1]%
{\tabl_tables_check_auto_row
- \global\advance\currenttablecolumn\plusone
- \glet\m_tabl_table_vrule_color\empty
+ \global\advanceby\currenttablecolumn\plusone
+ \glettonothing\m_tabl_table_vrule_color
\global\c_tabl_table_vrule_thickness_factor\m_tabl_table_VLwidth\relax
\iftok{#1}\emptytoks\else
\rawprocesscommalist[#1]\tabl_table_vrulecommand
@@ -1938,7 +1959,7 @@
\def\tabl_table_hrulecommand#1% global assignments
{\doifelsenumber{#1}
{\global\c_tabl_table_hrule_thickness_factor#1\relax
- \global\multiply\c_tabl_table_hrule_thickness_factor\m_tabl_table_HLheight\relax}
+ \global\multiplyby\c_tabl_table_hrule_thickness_factor\m_tabl_table_HLheight\relax}
{\xdef\m_tabl_table_hrule_color{#1}}}
\permanent\tolerant\protected\def\tabl_table_HL[#1]%
@@ -1957,7 +1978,7 @@
\bgroup
\global\c_tabl_table_hrule_thickness_factor\m_tabl_table_HLheight\relax
\ifparameter#1\or
- \glet\m_tabl_table_hrule_color\empty
+ \glettonothing\m_tabl_table_hrule_color
\rawprocesscommalist[#1]\tabl_table_hrulecommand
\ifempty\m_tabl_table_hrule_color\else
\switchtocolor[\m_tabl_table_hrule_color]%
@@ -2022,7 +2043,7 @@
\protected\def\tabl_table_NC
{\tabl_tables_check_auto_row
- \global\advance\currenttablecolumn \plusone
+ \global\advanceby\currenttablecolumn \plusone
\tabl_table_normal_no_bar}
%D \startitemize[3*broad]
@@ -2055,7 +2076,7 @@
\global\c_tabl_table_drule_span#1\relax
\else
\global\c_tabl_table_hrule_thickness_factor#1\relax
- \global\multiply\c_tabl_table_hrule_thickness_factor\m_tabl_table_VLwidth\relax
+ \global\multiplyby\c_tabl_table_hrule_thickness_factor\m_tabl_table_VLwidth\relax
\fi}
{\xdef\m_tabl_table_hrule_color{#1}}}
@@ -2073,20 +2094,20 @@
\global\c_tabl_table_hrule_thickness_factor\m_tabl_table_HLheight\relax
\global\c_tabl_table_drule_span\zerocount
\iftok{#1}\emptytoks\else
- \glet\m_tabl_table_hrule_color\empty
+ \glettonothing\m_tabl_table_hrule_color
\rawprocesscommalist[#1]\tabl_table_drulecommand
% \ifempty\m_tabl_table_hrule_color\else
% \switchtocolor[\m_tabl_table_hrule_color]% see *DL*
% \fi
\fi
\ifcase\c_tabl_table_drule_span
- \global\advance\currenttablecolumn \plusone
+ \global\advanceby\currenttablecolumn \plusone
\tabl_table_normal_single_rule
\or
- \global\advance\currenttablecolumn \plustwo
+ \global\advanceby\currenttablecolumn \plustwo
\tabl_table_normal_single_rule
\else
- \global\advance\currenttablecolumn \plusone
+ \global\advanceby\currenttablecolumn \plusone
\tabl_table_normal_multi_rule
\fi
\fi}
@@ -2100,7 +2121,7 @@
\permanent\protected\def\tabl_table_DCV#1%
{\tabl_table_check_division
\tabl_tables_check_auto_row
- \global\advance\currenttablecolumn \plusone
+ \global\advanceby\currenttablecolumn \plusone
#1}
\permanent\protected\def\tabl_table_DR
@@ -2189,8 +2210,8 @@
\else
\let\tablestrutdepthfactor\p_tabl_table_depth
\fi
- \edef\tablestrutheightfactor{\withoutpt\the\dimexpr10\dimexpr\tablestrutheightfactor\points}%
- \edef\tablestrutdepthfactor {\withoutpt\the\dimexpr10\dimexpr\tablestrutdepthfactor \points}%
+ \edef\tablestrutheightfactor{\toscaled\dimexpr10\dimexpr\tablestrutheightfactor\points}%
+ \edef\tablestrutdepthfactor {\toscaled\dimexpr10\dimexpr\tablestrutdepthfactor \points}%
\d_tabl_table_strut_unit \dimexpr\normalbaselineskip/12\relax % 12 is default bodyfont
\d_tabl_table_kern_unit .5em\relax
\s_tabl_table_inter_column_space_unit.5em plus 1fil minus .25em\relax
diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-tbl.lmt b/Master/texmf-dist/tex/context/base/mkxl/tabl-tbl.lmt
new file mode 100644
index 00000000000..50d8719055b
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-tbl.lmt
@@ -0,0 +1,60 @@
+if not modules then modules = { } end modules ['tabl-tbl'] = {
+ version = 1.001,
+ comment = "companion to tabl-tbl.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- A couple of hacks ... easier to do in Lua than in regular TeX. More will
+-- follow.
+
+local tonumber = tonumber
+local gsub, rep, sub, find = string.gsub, string.rep, string.sub, string.find
+local P, C, Cc, Ct, lpegmatch = lpeg.P, lpeg.C, lpeg.Cc, lpeg.Ct, lpeg.match
+
+local context = context
+local commands = commands
+
+local texsetcount = tex.setcount
+local texiscount = tex.iscount
+
+local separator = P("|") -- keep { }
+----- nested = C(lpeg.patterns.nested) -- remove { }
+local nested = lpeg.patterns.argument
+local pattern = Ct((separator * (nested + Cc("")) * C((1-separator)^0))^0)
+
+local ctx_settabulatelastentry = context.settabulatelastentry
+local ctx_settabulateentry = context.settabulateentry
+
+local c_tabl_tabulate_nofcolumns = texiscount("c_tabl_tabulate_nofcolumns")
+local c_tabl_tabulate_has_rule_spec_first = texiscount("c_tabl_tabulate_has_rule_spec_first")
+local c_tabl_tabulate_has_rule_spec_last = texiscount("c_tabl_tabulate_has_rule_spec_last")
+
+-- the lmtx raw processor handles {} like the normal one so we need to prune
+
+local function presettabulate(preamble)
+ preamble = gsub(preamble,"~","d") -- let's get rid of ~ mess here
+ if find(preamble,"*",1,true) then
+ -- todo: lpeg but not now
+ preamble = gsub(preamble, "%*(%b{})(%b{})", function(n,p)
+ return rep(sub(p,2,-2),tonumber(sub(n,2,-2)) or 1)
+ end)
+ end
+ local t = lpegmatch(pattern,preamble)
+ local m = #t - 2
+ texsetcount("global",c_tabl_tabulate_nofcolumns, m/2)
+ texsetcount("global",c_tabl_tabulate_has_rule_spec_first, t[1] == "" and 0 or 1)
+ texsetcount("global",c_tabl_tabulate_has_rule_spec_last, t[m+1] == "" and 0 or 1)
+ for i=1,m,2 do
+ ctx_settabulateentry(t[i],t[i+1])
+ end
+ ctx_settabulatelastentry(t[m+1])
+end
+
+interfaces.implement {
+ name = "presettabulate",
+ actions = presettabulate,
+ arguments = "string",
+ scope = "private",
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-tbl.mkxl b/Master/texmf-dist/tex/context/base/mkxl/tabl-tbl.mkxl
index 88cd791e488..b3b4b4c886c 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/tabl-tbl.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-tbl.mkxl
@@ -15,7 +15,13 @@
\unprotect
-\registerctxluafile{tabl-tbl}{} % experiment
+% These are set at the lua end by parser:
+
+\newinteger\c_tabl_tabulate_nofcolumns
+\newinteger\c_tabl_tabulate_has_rule_spec_first
+\newinteger\c_tabl_tabulate_has_rule_spec_last
+
+\registerctxluafile{tabl-tbl}{autosuffix} % experiment
%D I can probably reimplement this using a \LUATEX\ combination but it does not pay
%D of in development time. If I need something else I will write it from scratch
@@ -161,58 +167,61 @@
\newtoks \t_tabl_tabulate_initializers_first
\newtoks \t_tabl_tabulate_initializers_second
-\newcount \c_tabl_tabulate_nofauto
-\newcount \c_tabl_tabulate_columns
-\newcount \c_tabl_tabulate_column
-\newcount \c_tabl_tabulate_plines_min
-\newcount \c_tabl_tabulate_plines_max
-\newcount \c_tabl_tabulate_max_colorcolumn
-\newcount \c_tabl_tabulate_max_vrulecolumn
-\newcount \c_tabl_tabulate_repeathead
-\newcount \c_tabl_tabulate_noflines
-\newcount \c_tabl_tabulate_totalnoflines
-\newcount \c_tabl_tabulate_minusnoflines
-\newcount \c_tabl_tabulate_align
-\newcount \c_tabl_tabulate_nofrealrows
-\newcount \c_tabl_tabulate_autocolor
-
-\newcount \c_tabl_tabulate_nofcolumns % set at the lua end by parser
-\newcount \c_tabl_tabulate_has_rule_spec_first % set at the lua end by parser (for the moment a count)
-\newcount \c_tabl_tabulate_has_rule_spec_last % set at the lua end by parser (for the moment a count)
+\newinteger \c_tabl_tabulate_nofauto
+\newinteger \c_tabl_tabulate_columns
+\newinteger \c_tabl_tabulate_column
+\newinteger \c_tabl_tabulate_plines_min
+\newinteger \c_tabl_tabulate_plines_max
+\newinteger \c_tabl_tabulate_max_colorcolumn
+\newinteger \c_tabl_tabulate_max_vrulecolumn
+\newinteger \c_tabl_tabulate_repeathead
+\newinteger \c_tabl_tabulate_noflines
+\newinteger \c_tabl_tabulate_totalnoflines
+\newinteger \c_tabl_tabulate_minusnoflines
+\newinteger \c_tabl_tabulate_align
+\newinteger \c_tabl_tabulate_nofrealrows
+\newinteger \c_tabl_tabulate_autocolor
\newconditional \c_tabl_tabulate_nopbreak
\newconditional \c_tabl_tabulate_firstflushed
\newconditional \c_tabl_tabulate_equal
-\newconditional \c_tabl_tabulate_split \settrue\c_tabl_tabulate_split
+\newconditional \c_tabl_tabulate_split
\newconditional \c_tabl_tabulate_automode
-\newconditional \c_tabl_tabulate_handlepbreak \settrue\c_tabl_tabulate_handlepbreak
-\newconditional \c_tabl_tabulate_autorulespacing \settrue\c_tabl_tabulate_autorulespacing
+\newconditional \c_tabl_tabulate_handlepbreak
+\newconditional \c_tabl_tabulate_autorulespacing
\newconditional \c_tabl_tabulate_someamble
\newconditional \c_tabl_tabulate_tolerant_break
\newconditional \c_tabl_tabulate_splitoff_whitespace
\newconditional \c_tabl_tabulate_pwidth_set
\newconditional \c_tabl_tabulate_reshape
-
-\newdimen \d_tabl_tabulate_width_p
-\newdimen \d_tabl_tabulate_width_w
-\newdimen \d_tabl_tabulate_width
-\newdimen \d_tabl_tabulate_unit
-\newdimen \d_tabl_tabulate_height_p_max
-\newdimen \d_tabl_tabulate_vrulethickness_default
-\newdimen \d_tabl_tabulate_hrulethickness_default
-\newdimen \d_tabl_tabulate_vrulethickness
-\newdimen \d_tabl_tabulate_hrulethickness % not used
-\newdimen \d_tabl_tabulate_vrulethickness_local
-\newdimen \d_tabl_tabulate_hrulethickness_local
-\newdimen \d_tabl_tabulate_indent
-\newdimen \d_tabl_tabulate_splitoff_betweenskip
-\newdimen \d_tabl_tabulate_margin
-
-\newskip \s_tabl_tabulate_pre
-\newskip \s_tabl_tabulate_post
-\newskip \s_tabl_tabulate_first
-\newskip \s_tabl_tabulate_last
-\newskip \s_tabl_tabulate_separator
+\newconditional \c_tabl_tabulate_no_blank_in_paragraphs % can become always on
+\newconditional \c_tabl_tabulate_no_interline_space
+
+\settrue \c_tabl_tabulate_split
+\settrue \c_tabl_tabulate_handlepbreak
+\settrue \c_tabl_tabulate_autorulespacing
+\settrue \c_tabl_tabulate_no_blank_in_paragraphs
+
+\newdimension \d_tabl_tabulate_width_p
+\newdimension \d_tabl_tabulate_width_w
+\newdimension \d_tabl_tabulate_width
+\newdimension \d_tabl_tabulate_unit
+\newdimension \d_tabl_tabulate_height_p_max
+\newdimension \d_tabl_tabulate_vrulethickness_default
+\newdimension \d_tabl_tabulate_hrulethickness_default
+\newdimension \d_tabl_tabulate_vrulethickness
+\newdimension \d_tabl_tabulate_hrulethickness % not used
+\newdimension \d_tabl_tabulate_vrulethickness_local
+\newdimension \d_tabl_tabulate_hrulethickness_local
+\newdimension \d_tabl_tabulate_indent
+\newdimension \d_tabl_tabulate_splitoff_betweenskip
+\newdimension \d_tabl_tabulate_margin
+
+\newgluespec \s_tabl_tabulate_pre
+\newgluespec \s_tabl_tabulate_post
+\newgluespec \s_tabl_tabulate_first
+\newgluespec \s_tabl_tabulate_last
+\newgluespec \s_tabl_tabulate_separator
\newbox \b_tabl_tabulate
@@ -227,7 +236,7 @@
%newconditional \c_tabl_pre_is_set
\newconditional \c_tabl_post_is_set
-\let \m_tabl_tabulate_separator_factor \empty % fraction
+\lettonothing \m_tabl_tabulate_separator_factor % fraction
\aliased\let\tabulatesplitlinemode\c_tabl_tabulate_splitlinemode % temp hack, we need an interface
@@ -262,7 +271,7 @@
\to \t_tabl_tabulate_initializers_second
\prependtoks
- \global\advance\c_tabl_tabulate_nofrealrows\plusone
+ \global\advanceby\c_tabl_tabulate_nofrealrows\plusone
\to \t_tabl_tabulate_every_real_row
\permanent\def\b_tabl_tabulate_current#1%
@@ -275,7 +284,7 @@
\def\tabl_tabulate_initialize_boxes_step
{\ifnum\scratchcounter>\zerocount
\tabl_tabulate_initialize_box\scratchcounter
- \advance\scratchcounter\minusone
+ \advanceby\scratchcounter\minusone
\expandafter\tabl_tabulate_initialize_boxes_step
\fi}
@@ -286,7 +295,7 @@
\tabl_tabulate_initialize_box_nop#1%
\fi}
-\def\tabl_tabulate_initialize_box_yes {\global \setbox\lastnamedcs\emptybox}
+\def\tabl_tabulate_initialize_box_yes {\global\setbox\lastnamedcs\emptybox}
\def\tabl_tabulate_initialize_box_nop#1{\expandafter\newbox\csname\??tabulatebox\number#1\endcsname}
\tabl_tabulate_initialize_boxes{16} % not really needed
@@ -295,7 +304,8 @@
% 1 = RC column raw RQ equal column raw
% 2 = HC column hook HQ equal column hook
-% [|lg{.}|] => \NG 12.34 \NC
+% [|lg{.}|] => \NG 12.34 \NC % old
+% [|lG{.}|] => \NG 12.34 \NC % new
\def\tabl_tabulate_nobreak_inject_tracer
{\red % maybe use the fast color switcher here
@@ -328,8 +338,10 @@
\protected\def\tabl_tabulate_setups_check
{\begincsname\??tabulatesetup\the\c_tabl_tabulate_column\endcsname}
+\let\tabl_tabulate_kooh\relax
+
\protected\def\tabl_tabulate_entry_before{\ignorespaces\tabl_tabulate_hook}
-\protected\def\tabl_tabulate_entry_after {\unskip\unskip\ifmmode\else\endgraf\fi}
+\protected\def\tabl_tabulate_entry_after {\unskip\unskip\ifmmode\else\endgraf\fi\tabl_tabulate_kooh}
\protected\def\tabl_tabulate_shaped_par_begin
{\dowithnextboxcs\tabl_tabulate_shaped_par_finish\vbox\bgroup}
@@ -352,7 +364,7 @@
\xdef\m_tabl_tabulate_color{#1}%
\else
\glet\m_tabl_tabulate_color\m_tabl_tabulate_color_local
- \glet\m_tabl_tabulate_color_local\empty
+ \glettonothing\m_tabl_tabulate_color_local
\fi
\ifcase\c_tabl_tabulate_localcolorspan
\global\c_tabl_tabulate_colorspan#2\relax
@@ -379,7 +391,7 @@
\xdef\m_tabl_tabulate_vrule_color{#1}%
\else
\glet\m_tabl_tabulate_vrule_color\m_tabl_tabulate_vrule_color_local
- \glet\m_tabl_tabulate_vrule_color_local\empty
+ \glettonothing\m_tabl_tabulate_vrule_color_local
\fi}
\let\tabl_tabulate_check_local_color \gobbletwoarguments
@@ -398,11 +410,11 @@
% \protected % we can expand this one
\def\tabl_tabulate_inject_pre_skip#1%
{\ifdim#1>\zeropoint
- \kern#1\relax % was \hskip
- \orelse\ifnum\c_tabl_tabulate_column=\zerocount
+ \kern#1\relax % hskip
+ \orelse\ifzero\c_tabl_tabulate_column
\ifconditional\c_tabl_tabulate_autorulespacing
\ifcase\c_tabl_tabulate_has_rule_spec_first\else
- \kern\s_tabl_tabulate_first\relax % was \hskip
+ \kern\s_tabl_tabulate_first\relax % hskip
\fi
\fi
\fi}
@@ -414,32 +426,50 @@
\orelse\ifnum\c_tabl_tabulate_columns=\c_tabl_tabulate_nofcolumns
\ifconditional\c_tabl_tabulate_autorulespacing
\ifcase\c_tabl_tabulate_has_rule_spec_last\else
- \kern\s_tabl_tabulate_last\relax % was \hskip
+ \kern\s_tabl_tabulate_last\relax % hskip
\fi
\fi
\fi}
\let\tabl_tabulate_hook_b\donothing
\let\tabl_tabulate_hook_e\donothing
-
\let\tabl_tabulate_hook_g\donothing
+\let\tabl_tabulate_hook_G\donothing
+
+\newconditional\c_tabl_use_size
+\newconditional\c_tabl_sparse_skips
+
+\settrue\c_tabl_use_size % default per 2022-08-25
+\settrue\c_tabl_sparse_skips % default per 2022-08-25
+
+\installtexdirective {tabulateusesize} {\settrue\c_tabl_use_size} {\setfalse\c_tabl_use_size}
+\installtexdirective {tabulatesparseskips} {\settrue\c_tabl_sparse_skips} {\setfalse\c_tabl_sparse_skips}
\def\tabl_tabulate_set_preamble_step#1#2% only makes sense for many tabulates
{\etoksapp\t_tabl_tabulate_preamble{%
+ % begin of between/initial part
\tabl_tabulate_check_local_vrule_thickness\constantdimenargument\d_tabl_tabulate_vrulethickness
\tabl_tabulate_check_local_vrule_color\constantemptyargument\m_tabl_tabulate_vrule_color
\tabl_tabulate_check_local_color\constantemptyargument\m_tabl_tabulate_color\constantnumberargument\c_tabl_tabulate_colorspan
\tabl_tabulate_color_side_right
+ % end of between/initial part
\aligntab
+ % begin of left part
\tabl_tabulate_column_vrule_inject
\tabl_tabulate_color_side_left
\tabl_tabulate_inject_pre_skip{\the\dimexpr\s_tabl_tabulate_pre}% get rid of plus
- \alignmark\alignmark
+ \aligncontent % \alignmark\alignmark
+ % end of left part
+ \ifconditional\c_tabl_use_size
+ \tabsize\zeropoint
+ \fi
\aligntab
+ % begin of main cell
\tabl_tabulate_color_side_both
\global\c_tabl_tabulate_colorspan\zerocount
\global\c_tabl_tabulate_column\constantnumber\c_tabl_tabulate_columns
\tabl_tabulate_hook_g
+ \tabl_tabulate_anchor % new
\tabl_tabulate_setups_check % unexpandable
\tabl_tabulate_hook_check % unexpandable
\ifzeropt\d_tabl_tabulate_width
@@ -448,7 +478,11 @@
\fi
\else
\ifcase\c_tabl_tabulate_modus
- \hbox to
+ \ifconditional\c_tabl_use_size
+ \tabsize % we could remove one level of grouping
+ \else
+ \hbox to
+ \fi
\else
\hsize
\fi
@@ -483,8 +517,11 @@
% grouping needs to be outside macros (or expandable), nice test
% example \NC \string \aligntab \NC which will fail otherwise (mk)
\bgroup
+ \tabl_tabulate_hook_G
\tabl_tabulate_entry_before
- \alignmark\alignmark
+\tabl_tabulate_hook_box_begin % might move
+ \aligncontent
+\tabl_tabulate_hook_box_end % might move
\tabl_tabulate_entry_after
\egroup
\noexpand\ifnum\noexpand\c_tabl_tabulate_type=\plusone\noexpand\else
@@ -493,17 +530,24 @@
\noexpand\fi
\ifconditional\c_tabl_tabulate_reshape
\tabl_tabulate_shaped_par_end
+ \else
\fi
\noexpand#2%
\tabl_tabulate_hook_e
\egroup
\egroup
+ % end of main cell
\aligntab
+ \ifconditional\c_tabl_use_size
+ \tabsize\zeropoint
+ \fi
+ % begin of right part
\noexpand\dostoptagged
\tabl_tabulate_inject_post_skip
{\the\ifconditional\c_tabl_post_is_set\s_tabl_tabulate_post\else\s_tabl_tabulate_last\fi}%
{\the\s_tabl_tabulate_post}%
- \alignmark\alignmark
+ \aligncontent % \alignmark\alignmark
+ % end of right part
}%
\toksapp\t_tabl_tabulate_dummy{\NC}%
\s_tabl_tabulate_pre.5\d_tabl_tabulate_unit\relax
@@ -557,6 +601,7 @@
\installtabulatepreambleoption{e}{\toksapp\t_tabl_tabulate_settings{\global\settrue\c_tabl_tabulate_equal}%
\tabl_tabulate_set_preamble}
\installtabulatepreambleoption{g}{\tabl_tabulate_set_align}
+\installtabulatepreambleoption{G}{\tabl_tabulate_set_align_new}
\installtabulatepreambleoption{.}{\tabl_tabulate_set_align.}
\installtabulatepreambleoption{,}{\tabl_tabulate_set_align,}
\installtabulatepreambleoption{C}{\tabl_tabulate_set_color_span}
@@ -623,7 +668,8 @@
% begin of character align plugin
-\newconditional\c_tabl_auto_align_mode % reset later
+\newconditional\c_tabl_auto_align_mode % reset later
+\newconditional\c_tabl_auto_align_mode_new % reset later
\def\tabl_tabulate_hook_g % partly expanded
{\ifconditional\c_tabl_auto_align_mode
@@ -631,11 +677,24 @@
\typo_charalign_adapt_font
\fi}
+\def\tabl_tabulate_hook_G % partly expanded
+ {\ifconditional\c_tabl_auto_align_mode_new
+ \typo_charalign_adapt_font
+ \attribute\aligncharacterattribute\the\attribute\aligncharacterattribute\relax
+ \else
+ \attribute\aligncharacterattribute\attributeunsetvalue
+ \fi}
+
\def\tabl_tabulate_set_align#1%
{\global\settrue\c_tabl_auto_align_mode
\setcharacteralign\c_tabl_tabulate_columns{#1}%
\tabl_tabulate_set_preamble}
+\def\tabl_tabulate_set_align_new#1%
+ {\global\settrue\c_tabl_auto_align_mode_new
+ \iftok{#1}\emptytoks\else\setalignmentcharacter{#1}\fi% todo: check for number or char or ... in lua
+ \tabl_tabulate_set_preamble}
+
% end of character align plugin
\def\tabl_tabulate_set_before#1%
@@ -682,41 +741,82 @@
% \dorecurse{100}{\NC \getbuffer \NC test \par test \par \NC \NR}
% \stoptabulate
+% \starttabulate[|w(top,3cm)|w(top,3cm)|]
+% \NC test \NC test \par test \NC \NR
+% \NC test \NC test \par test \NC \NR
+% \stoptabulate
+%
+% \starttabulate[|w(top,packed,3cm)|w(top,packed,3cm)|]
+% \NC test \NC test \par test \NC \NR
+% \NC test \NC test \par test \NC \NR
+% \stoptabulate
+%
+% \starttabulate[interlinespace=no,format={|w(bottom,3cm)|w(bottom,3cm)|}]
+% \NC test \NC test \par test \NC \NR
+% \NC test \NC test \par test \NC \NR
+% \stoptabulate
+%
+% \starttabulate[format={|w(3cm)|w(3cm)|}]
+% \NC \vtop{\strut test} \NC \vtop{\strut test\par \strut test} \NC \NR
+% \NC \vtop{\strut test} \NC \vtop{\strut test\par \strut test} \NC \NR
+% \stoptabulate
+%
+% \starttabulate[interlinespace=no,format={|w(3cm)|w(3cm)|}]
+% \NC \vtop{\strut test} \NC \vtop{\strut test\par \strut test} \NC \NR
+% \NC \vtop{\strut test} \NC \vtop{\strut test\par \strut test} \NC \NR
+% \stoptabulate
+%
+% \starttabulate[interlinespace=no,format={|w(3cm)|w(3cm)|}]
+% \NC \vbox{\strut test} \NC \vbox{\strut test\par \strut test} \NC \NR
+% \NC \vbox{\strut test} \NC \vbox{\strut test\par \strut test} \NC \NR
+% \stoptabulate
+%
+% \starttabulate[interlinespace=no,format={|w(3cm)|w(3cm)|}]
+% \NC \vtop{\strut test} \NC \vbox{\strut test\par \strut test} \NC \NR
+% \NC \vbox{\strut test} \NC \vtop{\strut test\par \strut test} \NC \NR
+% \stoptabulate
+
+\installcorenamespace{tabulatewidth}
+
+\defcsname\??tabulatewidth\v!fit\endcsname
+ {\c_tabl_tabulate_modus\plusthree}
+
+\defcsname\??tabulatewidth\v!fixed\endcsname
+ {\c_tabl_tabulate_modus\plusthree
+ \settrue\c_tabl_tabulate_nopbreak}
+
+\defcsname\??tabulatewidth\v!packed\endcsname
+ {\settrue\c_tabl_tabulate_no_interline_space}
+
+\defcsname\??tabulatewidth\v!auto\endcsname
+ {\c_tabl_tabulate_modus\plusthree\settrue\c_tabl_tabulate_reshape}
+
+\lettonothing\tabl_tabulate_hook_box_begin
+\lettonothing\tabl_tabulate_hook_box_end
+
+\defcsname\??tabulatewidth\v!top\endcsname
+ {\def\tabl_tabulate_hook_box_begin{\vtop\bgroup\begstrut}%
+ \def\tabl_tabulate_hook_box_end {\endstrut\egroup}}
+
+\defcsname\??tabulatewidth\v!bottom\endcsname
+ {\def\tabl_tabulate_hook_box_begin{\vbox\bgroup\begstrut}%
+ \def\tabl_tabulate_hook_box_end {\endstrut\egroup}}
+
+\def\tabl_tabulate_set_width_step#1%
+ {\ifcsname\??tabulatewidth#1\endcsname
+ \lastnamedcs
+ \else
+ \d_tabl_tabulate_width#1\relax
+ \fi}
+
\def\tabl_tabulate_set_width_indeed(#1)%
- {\processallactionsinset % can be made faster
- [#1]%
- [ \v!fit=>\c_tabl_tabulate_modus\plusthree,
- \v!fixed=>\c_tabl_tabulate_modus\plusthree
- \settrue\c_tabl_tabulate_nopbreak,
- \v!auto=>\c_tabl_tabulate_modus\plusthree
- \settrue\c_tabl_tabulate_reshape,
- \s!unknown=>\d_tabl_tabulate_width#1\relax]%
+ {\rawprocesscommacommand[#1]\tabl_tabulate_set_width_step
\ifconditional\c_tabl_tabulate_pwidth_set
- \global\advance\d_tabl_tabulate_width_p\d_tabl_tabulate_width % accumulated parwidth
+ \global\advanceby\d_tabl_tabulate_width_p\d_tabl_tabulate_width % accumulated parwidth
\fi
\tabl_tabulate_set_preamble}
-% faster but seldom used
-%
-% \installcorenamespace{tabulatewidth}
-%
-% \setvalue{\??tabulatewidth\v!fit }{\c_tabl_tabulate_modus\plusthree}
-% \setvalue{\??tabulatewidth\v!fixed}{\c_tabl_tabulate_modus\plusthree\settrue\c_tabl_tabulate_nopbreak}
-% \setvalue{\??tabulatewidth\v!auto }{\c_tabl_tabulate_modus\plusthree\settrue\c_tabl_tabulate_reshape}
-%
-% \def\tabl_tabulate_set_width_step#1%
-% {\ifcsname\??tabulatewidth#1\endcsname
-% \lastnamedcs
-% \else
-% \d_tabl_tabulate_width#1\relax
-% \fi}
-%
-% \def\tabl_tabulate_set_width_indeed(#1)%
-% {\rawprocesscommacommand[#1]\tabl_tabulate_set_width_step
-% \ifconditional\c_tabl_tabulate_pwidth_set
-% \global\advance\d_tabl_tabulate_width_p\d_tabl_tabulate_width % accumulated parwidth
-% \fi
-% \tabl_tabulate_set_preamble}
+% done
\def\tabl_tabulate_set_raggedright {\ifnum\c_tabl_tabulate_type=\plusone \else\raggedright \fi}
\def\tabl_tabulate_set_raggedcenter{\ifnum\c_tabl_tabulate_type=\plusone \else\raggedcenter\fi}
@@ -743,7 +843,7 @@
\tabl_tabulate_set_preamble_step\tabl_tabulate_bskip_raggedcenter\tabl_tabulate_eskip \fi}
\def\tabl_tabulate_set_width_auto
- {\global\advance\c_tabl_tabulate_nofauto\plusone
+ {\global\advanceby\c_tabl_tabulate_nofauto\plusone
\ifcase\c_tabl_tabulate_align\relax
\tabl_tabulate_set_preamble_step\tabl_tabulate_bskip \tabl_tabulate_eskip \or
\tabl_tabulate_set_preamble_step\tabl_tabulate_bskip_raggedright \tabl_tabulate_eskip \or
@@ -788,13 +888,17 @@
\t_tabl_tabulate_emath\emptytoks
\t_tabl_tabulate_font\emptytoks
\t_tabl_tabulate_settings\emptytoks
- \glet\m_tabl_tabulate_alignment\empty
- \glet\m_tabl_tabulate_color\empty
- \glet\m_tabl_tabulate_text_color\empty
- \glet\m_tabl_tabulate_vrule_color\empty
+ \glettonothing\m_tabl_tabulate_alignment
+ \glettonothing\m_tabl_tabulate_color
+ \glettonothing\m_tabl_tabulate_text_color
+ \glettonothing\m_tabl_tabulate_vrule_color
+ \glettonothing\tabl_tabulate_hook_box
\global\c_tabl_tabulate_colorspan\zerocount
\global\setfalse\c_tabl_auto_align_mode
- \global\advance\c_tabl_tabulate_columns\plusone
+ \global\setfalse\c_tabl_auto_align_mode_new
+ \resetalignmentcharacter
+ % \attribute\aligncharacterattribute\attributeunsetvalue
+ \global\advanceby\c_tabl_tabulate_columns\plusone
\letcsname\??tabulatesetup\the\c_tabl_tabulate_columns\endcsname\donothing % here ?
\iftok{#1}\emptytoks
\global\d_tabl_tabulate_vrulethickness\zeropoint
@@ -803,7 +907,7 @@
% the lmtx raw processor handles {} like the normal one so we need to prune
\rawprocesscommalist[#1]\tabl_tabulate_set_vrule_command
\fi
- \tabl_tabulate_set_preamble#2\relax\relax % permits i without n
+ \tabl_tabulate_set_preamble#2\relax\relax % permits i without n
\ifcase\c_tabl_tabulate_modus\relax
\tabl_tabulate_set_width_normal
\or % fixed width
@@ -815,8 +919,8 @@
\fi}
\permanent\protected\def\tabl_tabulate_set_last_entry#1% rulespec
- {\glet\m_tabl_tabulate_color\empty
- \glet\m_tabl_tabulate_vrule_color\empty
+ {\glettonothing\m_tabl_tabulate_color
+ \glettonothing\m_tabl_tabulate_vrule_color
\iftok{#1}\emptytoks
\global\d_tabl_tabulate_vrulethickness\zeropoint
\else
@@ -867,7 +971,7 @@
\let\tabl_tabulate_check_linenumbers\relax
-\def\tabl_tabulate_splitoff_box
+\def\tabl_tabulate_splitoff_box % maybe use the modern splitter
{\dontcomplain
\global\setbox\b_tabl_tabulate\vsplit\b_tabl_tabulate_current\c_tabl_tabulate_column to \lineheight % % % global ? % % %
\setbox\b_tabl_tabulate\vbox
@@ -913,7 +1017,7 @@
\ifnum\c_tabl_tabulate_plines_min=\plusone
\tabl_tabulate_nobreak_inject
\fi
- \global\advance\c_tabl_tabulate_plines_min\plusone
+ \global\advanceby\c_tabl_tabulate_plines_min\plusone
\ifnum\c_tabl_tabulate_plines_min=\c_tabl_tabulate_plines_max\relax
\tabl_tabulate_nobreak_inject
\fi
@@ -1050,8 +1154,8 @@
\appendtoks
\enforced\permanent\protected\edefcsname\e!start \currenttabulation\endcsname{\tabl_start_defined[\currenttabulation]}%
\enforced\aliased \letcsname \e!stop \currenttabulation\endcsname\relax
- \enforced\aliased \letcsname \??tabulatehead\currenttabulation\endcsname\empty
- \enforced\aliased \letcsname \??tabulatefoot\currenttabulation\endcsname\empty
+ \mutable \letcsname \??tabulatehead\currenttabulation\endcsname\empty
+ \mutable \letcsname \??tabulatefoot\currenttabulation\endcsname\empty
\to \everydefinetabulation
\aliased \let\tabulateparameter\tabulationparameter % will stay for a while
@@ -1059,9 +1163,9 @@
% Here begins the implementation.
-\let\tabl_tabulate_insert_head\empty
-\let\tabl_tabulate_insert_body\empty
-\let\tabl_tabulate_insert_foot\empty
+\lettonothing\tabl_tabulate_insert_head
+\lettonothing\tabl_tabulate_insert_body
+\lettonothing\tabl_tabulate_insert_foot
\def\tabl_tabulate_insert_head_content
{\noalign{\global\settrue\c_tabl_tabulate_someamble}%
@@ -1078,23 +1182,23 @@
%\expandafter\ifempty\csname\??tabulatehead\currenttabulation\endcsname
%\expandafter\ifempty\lastnamedcs
\ifempty\lastnamedcs
- \let\tabl_tabulate_insert_head\empty
+ \lettonothing\tabl_tabulate_insert_head
\else
\let\tabl_tabulate_insert_head\tabl_tabulate_insert_head_content
\fi
\else
- \let\tabl_tabulate_insert_head\empty
+ \lettonothing\tabl_tabulate_insert_head
\fi
\ifcsname\??tabulatefoot\currenttabulation\endcsname
%\expandafter\ifempty\csname\??tabulatefoot\currenttabulation\endcsname
%\expandafter\ifempty\lastnamedcs
\ifempty\lastnamedcs
- \let\tabl_tabulate_insert_foot\empty
+ \lettonothing\tabl_tabulate_insert_foot
\else
\let\tabl_tabulate_insert_foot\tabl_tabulate_insert_foot_content
\fi
\else
- \let\tabl_tabulate_insert_foot\empty
+ \lettonothing\tabl_tabulate_insert_foot
\fi}
\def\tabl_tabulate_insert_content
@@ -1117,22 +1221,25 @@
\permanent\protected\defcsname\e!start\v!tabulatehead\endcsname{\doifelsenextoptionalcs\tabl_tabulate_start_head_yes\tabl_tabulate_start_head_nop}
\permanent\protected\defcsname\e!start\v!tabulatetail\endcsname{\doifelsenextoptionalcs\tabl_tabulate_start_foot_yes\tabl_tabulate_start_foot_nop}
-\let\m_tabl_tabulate_data\empty
+\lettonothing\m_tabl_tabulate_data
\def\tabl_tabulate_start_head_yes[#1]%
- {\processcontent{\e!stop\v!tabulatehead}\m_tabl_tabulate_data{\letvalue{\??tabulatehead#1}\m_tabl_tabulate_data}}
+ {\processcontent{\e!stop\v!tabulatehead}\m_tabl_tabulate_data{\letcsname\??tabulatehead#1\endcsname\m_tabl_tabulate_data}}
\def\tabl_tabulate_start_foot_yes[#1]%
- {\processcontent{\e!stop\v!tabulatetail}\m_tabl_tabulate_data{\letvalue{\??tabulatefoot#1}\m_tabl_tabulate_data}}
+ {\processcontent{\e!stop\v!tabulatetail}\m_tabl_tabulate_data{\letcsname\??tabulatefoot#1\endcsname\m_tabl_tabulate_data}}
+
+% \def\tabl_tabulate_start_head_nop{\tabl_tabulate_start_head_yes[\v!tabulate]}
+% \def\tabl_tabulate_start_foot_nop{\tabl_tabulate_start_foot_yes[\v!tabulate]}
-\def\tabl_tabulate_start_head_nop{\tabl_tabulate_start_head_yes[\v!tabulate]}
-\def\tabl_tabulate_start_foot_nop{\tabl_tabulate_start_foot_yes[\v!tabulate]}
+\def\tabl_tabulate_start_head_nop{\tabl_tabulate_start_head_yes[]}
+\def\tabl_tabulate_start_foot_nop{\tabl_tabulate_start_foot_yes[]}
\protected\def\tabl_start_defined[#1]%
{\bgroup
\edef\currenttabulationparent{#1}%
\let\currenttabulation\currenttabulationparent
- \iftok{\tabulationparameter\c!format}{\v!none}%
+ \ifcstok{\tabulationparameter\c!format}\v!none
% this is special case: we need to define the generic english
% \starttabulate in other interfaces as well
\lettabulationparameter\c!format\tabl_default_format
@@ -1158,37 +1265,18 @@
\def\tabl_default_format{|l|p|} % actually format is always set
-\permanent\protected\setuvalue{\e!start\v!tabulate}%
+\permanent\protected\defcsname\e!start\v!tabulate\endcsname
{\bgroup % whole thing
- \let\currenttabulationparent\empty
+ \lettonothing\currenttabulationparent
\tabl_start_regular}
-% \tolerant\protected\def\tabl_start_regular[#1]#*[#2]% [format] | [settings] | [format] [settings] | [settings] [format]
-% {\let\currenttabulation\currenttabulationparent
-% \iftok{#1}\emptytoks
-% \ifhastok={#2}\relax
-% \setupcurrenttabulation[#2]%
-% \fi
-% \orelse\ifhastok={#1}\relax
-% \iftok{#2}\emptytoks\else
-% \settabulationparameter\c!format{#2}%
-% \fi
-% \setupcurrenttabulation[#1]%
-% \else
-% \settabulationparameter\c!format{#1}%
-% \ifhastok={#2}\relax
-% \setupcurrenttabulation[#2]%
-% \fi
-% \fi
-% \tabl_tabulate_start_building}
-
\tolerant\protected\def\tabl_start_regular[#1]#*[#2]% [format] | [settings] | [format] [settings] | [settings] [format]
{\let\currenttabulation\currenttabulationparent
\iftok{#1}\emptytoks
- \ifhastok={#2}\relax
+ \ifhaschar={#2}\relax
\setupcurrenttabulation[#2]%
\fi
- \orelse\ifhastok={#1}\relax
+ \orelse\ifhaschar={#1}\relax
\iftok{#2}\emptytoks\else
\settabulationparameter\c!format{#2}%
\fi
@@ -1197,7 +1285,7 @@
\iftok{#1}\emptytoks\else
\settabulationparameter\c!format{#1}%
\fi
- \ifhastok={#2}\relax
+ \ifhaschar={#2}\relax
\setupcurrenttabulation[#2]%
\fi
\fi
@@ -1212,7 +1300,7 @@
\expandafter\gobbleuntil\csname\ifconditional\c_tabl_generic stoptabulate\else\e!stop\v!tabulate\fi\endcsname}
\appendtoks
- \enforced\letvalue{\e!start\v!tabulate}\tabl_tabulate_start_ignore % only the main one
+ \enforced\letcsname\e!start\v!tabulate\endcsname\tabl_tabulate_start_ignore % only the main one
\to \everytabulate
\defcsname\??tabulatesplit\v!yes \endcsname{\settrue\c_tabl_tabulate_split}
@@ -1289,16 +1377,18 @@
{\tabulationparameter\c!after}
\def\tabl_tabulate_outside_inbetween_indeed
- {\doifempty{\tabulationparameter\c!after}
- {\vskip\strutdp
- \verticalstrut
- \vskip-\struttotal}}
+ {\ifcstok{\tabulationparameter\c!after}\emptytoks\else
+ \vskip\strutdp
+ \verticalstrut
+ \vskip-\struttotal
+ \fi}
\def\tabl_tabulate_inside_inbetween % needs checking
- {\doifempty{\tabulationparameter\c!after}
- {\vskip\strutdp
- \verticalstrut
- \vskip-\struttotal}}
+ {\ifcstok{\tabulationparameter\c!after}\emptytoks\else
+ \vskip\strutdp
+ \verticalstrut
+ \vskip-\struttotal
+ \fi}
\protected\def\tabl_tabulate_start_building
{\ifinsidefloat
@@ -1313,15 +1403,16 @@
%
\resetcharacteralign
%
- \edef\p_distance {\tabulationparameter\c!distance}%
- \edef\p_align {\tabulationparameter\c!align}%
- \edef\p_line {\tabulationparameter\c!rule}%
- \edef\p_rulecolor {\tabulationparameter\c!rulecolor}%
- \edef\p_rulethickness{\tabulationparameter\c!rulethickness}%
- \edef\p_bodyfont {\tabulationparameter\c!bodyfont}%
- \edef\p_indenting {\tabulationparameter\c!indenting}%
- \edef\p_keeptogether {\tabulationparameter\c!keeptogether}%
- \edef\p_blank {\tabulationparameter\c!blank}%
+ \edef\p_distance {\tabulationparameter\c!distance}%
+ \edef\p_align {\tabulationparameter\c!align}%
+ \edef\p_line {\tabulationparameter\c!rule}%
+ \edef\p_rulecolor {\tabulationparameter\c!rulecolor}%
+ \edef\p_rulethickness {\tabulationparameter\c!rulethickness}%
+ \edef\p_bodyfont {\tabulationparameter\c!bodyfont}%
+ \edef\p_indenting {\tabulationparameter\c!indenting}%
+ \edef\p_keeptogether {\tabulationparameter\c!keeptogether}%
+ \edef\p_blank {\tabulationparameter\c!blank}%
+ \edef\p_interlinespace{\tabulationparameter\c!interlinespace}%
%
\ifx\p_keeptogether\v!no
\settrue \c_tabl_tabulate_tolerant_break
@@ -1331,6 +1422,12 @@
%\settrue \c_tabl_tabulate_handlepbreak
\fi
%
+ \ifx\p_interlinespace\v!no
+ \settrue\c_tabl_tabulate_no_interline_space
+ \else
+ \setfalse\c_tabl_tabulate_no_interline_space
+ \fi
+ %
\settrue\c_tabl_tabulate_split
\begincsname\??tabulatesplit\tabulationparameter\c!split\endcsname
%
@@ -1374,30 +1471,30 @@
% color columns
-\let\m_tabl_tabulate_color_previous \empty
-\let\m_tabl_tabulate_color \empty
-\let\m_tabl_tabulate_text_color \empty
-\let\m_tabl_tabulate_color_local \empty
-\let\m_tabl_tabulate_vrule_color \empty
-\let\m_tabl_tabulate_vrule_color_local \empty
-\let\m_tabl_tabulate_vrule_color_default\empty % used local
-\let\m_tabl_tabulate_hrule_color_default\empty % used local
-\let\m_tabl_tabulate_blank_default \empty
+\lettonothing\m_tabl_tabulate_color_previous
+\lettonothing\m_tabl_tabulate_color
+\lettonothing\m_tabl_tabulate_text_color
+\lettonothing\m_tabl_tabulate_color_local
+\lettonothing\m_tabl_tabulate_vrule_color
+\lettonothing\m_tabl_tabulate_vrule_color_local
+\lettonothing\m_tabl_tabulate_vrule_color_default % used local
+\lettonothing\m_tabl_tabulate_hrule_color_default % used local
+\lettonothing\m_tabl_tabulate_blank_default
\appendtoks
- \glet \m_tabl_tabulate_color_previous \empty
- \glet \m_tabl_tabulate_color \empty
- \glet \m_tabl_tabulate_text_color \empty
- \glet \m_tabl_tabulate_color_local \empty
- \glet \m_tabl_tabulate_vrule_color \empty
- \glet \m_tabl_tabulate_vrule_color_local \empty
+ \glettonothing\m_tabl_tabulate_color_previous
+ \glettonothing\m_tabl_tabulate_color
+ \glettonothing\m_tabl_tabulate_text_color
+ \glettonothing\m_tabl_tabulate_color_local
+ \glettonothing\m_tabl_tabulate_vrule_color
+ \glettonothing\m_tabl_tabulate_vrule_color_local
\global\d_tabl_tabulate_vrulethickness_local\zeropoint
\to \t_tabl_tabulate_every_row
\protected\def\tabl_tabulate_color_side_right_second
{\ifempty\m_tabl_tabulate_color_previous \else
\tabl_tabulate_color_set\m_tabl_tabulate_color_previous
- \glet\m_tabl_tabulate_color_previous\empty
+ \glettonothing\m_tabl_tabulate_color_previous
\fi}
\protected\def\tabl_tabulate_color_side_left_second
@@ -1414,9 +1511,9 @@
{\ifempty\m_tabl_tabulate_color \else
\tabl_tabulate_color_set\m_tabl_tabulate_color
\ifcase\c_tabl_tabulate_colorspan
- %\glet\m_tabl_tabulate_color_previous\empty
+ %\glettonothing\m_tabl_tabulate_color_previous
\or
- \glet\m_tabl_tabulate_color_previous\empty
+ \glettonothing\m_tabl_tabulate_color_previous
\or
\glet\m_tabl_tabulate_color_previous\m_tabl_tabulate_color
\or
@@ -1536,12 +1633,11 @@
\global\d_tabl_tabulate_vrulethickness\zeropoint} % nils second one
\protected\def\tabl_tabulate_column_vrule_inject_second
- {\ifcase\d_tabl_tabulate_vrulethickness\else
- \ifempty\m_tabl_tabulate_vrule_color
- \tabl_tabulate_column_vruled_normal
- \else
- \tabl_tabulate_column_vruled_colored
- \fi
+ {\ifcase\d_tabl_tabulate_vrulethickness
+ \orelse\ifempty\m_tabl_tabulate_vrule_color
+ \tabl_tabulate_column_vruled_normal
+ \else
+ \tabl_tabulate_column_vruled_colored
\fi
\global\d_tabl_tabulate_vrulethickness\zeropoint} % nils second one
@@ -1562,7 +1658,7 @@
\ifnum\c_tabl_tabulate_column>\c_tabl_tabulate_columns\relax
\expandafter\NR
\else
- \expandafter\ignorespaces % interferes with the more tricky hooks
+ \expandafter\ignorepars % \ignorespaces % interferes with the more tricky hooks
\fi}
\protected\def\tabl_tabulate_set_quick#1% see \startlegend \startgiven (for the moment still public)
@@ -1599,7 +1695,7 @@
\directvskip\s_tabl_tabulate_separator
\egroup}
-\let\m_tabl_tabulate_hrule_color\empty
+\lettonothing\m_tabl_tabulate_hrule_color
\def\tabl_tabulate_hrule_preset_step#1%
{\doifelsenumber{#1}%
@@ -1702,9 +1798,6 @@
\tabl_tabulate_color_reset_indeed
\fi}
-% \def\tabl_tabulate_color_reset_indeed
-% {\dorecurse\c_tabl_tabulate_max_colorcolumn{\letgvalue{\??tabulatecolor\recurselevel}\undefined}} % slow
-
\def\tabl_tabulate_color_reset_indeed
{\dofastloopcs\c_tabl_tabulate_max_colorcolumn\tabl_tabulate_color_reset_step}
@@ -1720,10 +1813,10 @@
% \registerparoptions
% \ifinsidefloat
% % that is, an unbreakable one
-% \glet\tabl_tabulate_register_par_options\empty
+% \glettonothing\tabl_tabulate_register_par_options
% \else
% % unsafe in crossing pages, at each b...
-% % \glet\tabl_tabulate_register_par_options\empty
+% % \glettonothing\tabl_tabulate_register_par_options
% \fi
% \fi}
%
@@ -1738,10 +1831,10 @@
{\registerparoptions
\ifinsidefloat
% that is, an unbreakable one
- \glet\tabl_tabulate_register_par_options\empty
+ \glettonothing\tabl_tabulate_register_par_options
\else
% unsafe in crossing pages, at each b...
- % \glet\tabl_tabulate_register_par_options\empty
+ % \glettonothing\tabl_tabulate_register_par_options
\fi}
\let\tabl_tabulate_register_par_options\relax
@@ -1763,14 +1856,14 @@
{% we now have a local hsize, and since we want to
% register positional info (i.e. real hsizes) we
% need to reconstitute the original hsize
- \advance\hsize\d_tabl_tabulate_indent
+ \advanceby\hsize\d_tabl_tabulate_indent
% this is indeed rather messy and took a few hours
% to dis/uncover
\the\t_tabl_tabulate_every_row
\hss}}
\def\tabl_tabulate_flush_indent
- {\ifnum\c_tabl_tabulate_column=\zerocount
+ {\ifzero\c_tabl_tabulate_column
\tabl_tabulate_flush_indent_indeed
\fi}
@@ -1778,6 +1871,7 @@
%D Beware, we cannot use \type {\protected} on \type {\HL} cum suis, since \TEX's
%D hard coded noalign lookahead fails on it! I mistakenly added this for a while.
+%D Well, this is no longer true in \LMTX.
\defcsname\??tabulatealigning\v!normal\endcsname{0}
\defcsname\??tabulatealigning\v!right \endcsname{1}
@@ -1851,6 +1945,84 @@
\permanent\protected\def\tabl_tabulate_CM_first{\global\c_tabl_tabulate_localcolorspan\plustwo \tabl_tabulate_set_color_column\zerocount}
\permanent\protected\def\tabl_tabulate_CR_first{\global\c_tabl_tabulate_localcolorspan\plusthree\tabl_tabulate_set_color_column\zerocount}
+%D New per 27/12/2022:
+
+% \defineorientation[test][orientation=down,vertical=top]
+%
+% \definetabulatemove[a][xoffset=40pt]
+% \definetabulatemove[b][orientation=test,yoffset=depth]
+%
+% \startbuffer[b]
+% \starttabulate[|c|c|]
+% \TM[a] \NC \darkred cell one \NC \darkgray cell one \NC \NR
+% \TM[b] \NC \darkgreen cell one \NC \darkblue cell one \NC \NR
+% \TM[a] \NC \darkred cell two \NC \darkgray cell two \NC \NR
+% \TM[b] \NC \darkgreen cell two \NC \darkblue cell two \NC \NR
+% \TM[a] \NC \darkred cell three \NC \darkgray cell three \NC \NR
+% \TM[b] \NC \darkgreen cell three \NC \darkblue cell three \NC \NR
+% \TM[a] \NC \darkred cell four \NC \darkgray cell four \NC \NR
+% \TM[b] \NC \darkgreen cell four \NC \darkblue cell four \NC \NR
+% \stoptabulate
+% \stopbuffer
+%
+% \start \showmakeup[line] \showstruts \ruledvbox{\getbuffer[b]} \stop
+% \start \showstruts \ruledvbox{\getbuffer[b]} \stop
+% \start \ruledvbox{\getbuffer[b]} \stop
+%
+% \startbuffer[b]
+% \starttabulate[|p|p|]
+% \TM[a] \NC \darkred \samplefile{tufte} \NC \darkgray \samplefile{ward} \NC \NR
+% \NC \darkgreen \samplefile{tufte} \NC \darkblue \samplefile{ward} \NC \NR
+% \TM[a] \NC \darkred \samplefile{tufte} \NC \darkgray \samplefile{ward} \NC \NR
+% \NC \darkgreen \samplefile{tufte} \NC \darkblue \samplefile{ward} \NC \NR
+% \stoptabulate
+% \stopbuffer
+%
+% \start \showmakeup[line] \showstruts \getbuffer[b] \stop
+
+\installcorenamespace{tabulatemove}
+
+\installcommandhandler \??tabulatemove {tabulatemove} \??tabulatemove
+
+\setuptabulatemove
+ [\c!xoffset=\zeropoint,
+ \c!yoffset=\zeropoint,
+ \c!orientation=]
+
+\noaligned\permanent\tolerant\protected\def\tabl_tabulate_TM_yes[#1]#*[#2]%
+ {\beginlocalcontrol
+ \ifhastok={#1}%
+ \setupcurrenttabulatemove[#1]%
+ \else
+ \edef\currenttabulatemove{#1}%
+ \setupcurrenttabulatemove[#2]%
+ \fi
+ \edef\m_orientation{\theorientation{\tabulatemoveparameter\c!orientation}}%
+ \edef\m_xoffset {\tabulatemoveparameter\c!xoffset}%
+ \edef\m_yoffset {\tabulatemoveparameter\c!yoffset}%
+ \scratchyoffset
+ \ifx\m_yoffset\v!depth
+ -\strutdp
+ \orelse\ifx\m_yoffset\v!height
+ -\strutht
+ \else
+ \m_yoffset
+ \fi
+ \relax
+ \scratchxoffset\m_xoffset\relax
+ \xdef\tabl_tabulate_tm
+ {\ifzeropt\scratchxoffset\else\s!xmove \the\scratchxoffset\fi % or move
+ \ifzeropt\scratchyoffset\else\s!ymove \the\scratchyoffset\fi % or move
+ \ifzero \m_orientation \else\s!orientation\m_orientation \fi
+ }%
+ \endlocalcontrol
+ \noalign\tabl_tabulate_tm{}}
+
+\noaligned\permanent\tolerant\protected\def\tabl_tabulate_TM_nop[#1]#*[#2]%
+ {}
+
+\lettonothing\tabl_tabulate_tm % new 27/12/2022
+
%D Sort of special:
%D
%D \startbuffer
@@ -1908,6 +2080,7 @@
\appendtoks
\enforced\let\NR\tabl_tabulate_NR_second
\enforced\let\NB\tabl_tabulate_NB_second
+ \enforced\let\TM\tabl_tabulate_TM_yes
\to \t_tabl_tabulate_initializers_second
\appendtoks
@@ -1916,10 +2089,33 @@
\enforced\let\MR\NR
\enforced\let\LR\NR
\enforced\let\AR\NR
+ \enforced\let\TM\tabl_tabulate_TM_nop
\to \t_tabl_tabulate_initializers_first
-\permanent\protected\def\tabl_tabulate_NR_common#1#2%
- {\global\advance\c_tabl_tabulate_noflines\plusone
+% \permanent\protected\def\tabl_tabulate_NR_common#1#2%
+% {\global\advanceby\c_tabl_tabulate_noflines\plusone
+% \global\setfalse\c_tabl_tabulate_firstflushed
+% \global\setfalse\c_tabl_tabulate_equal
+% \global\c_tabl_tabulate_column\zerocount
+% \ifconditional#1\relax
+% \tabl_tabulate_break_state_reset
+% \fi
+% \tabl_tabulate_pheight_reset
+% \unskip\unskip\crcr\tabl_tabulate_flush_collected
+% % can we omit the next one in the first run? probably
+% \noalign{\the\t_tabl_tabulate_every_after_row#2}}
+
+% test case for ignorepar error
+%
+% \starttabulatehead
+% \NC A \NC B \NC \NR
+% \stoptabulatehead
+% \starttabulate[|l|l|]
+% \NC 1 \NC 2 \NC \NR
+% \stoptabulate
+
+\permanent\tolerant\protected\def\tabl_tabulate_NR_common#1#2% #. gobbles pars and spaces
+ {\global\advanceby\c_tabl_tabulate_noflines\plusone
\global\setfalse\c_tabl_tabulate_firstflushed
\global\setfalse\c_tabl_tabulate_equal
\global\c_tabl_tabulate_column\zerocount
@@ -1929,7 +2125,8 @@
\tabl_tabulate_pheight_reset
\unskip\unskip\crcr\tabl_tabulate_flush_collected
% can we omit the next one in the first run? probably
- \noalign{\the\t_tabl_tabulate_every_after_row#2}}
+ % todo: move \ignorepars ourside so no alignment error then
+ \noalign{\the\t_tabl_tabulate_every_after_row#2\ignorepars}}
\def\tabl_tabulate_check_penalties
{\ifconditional\c_tabl_tabulate_tolerant_break\else
@@ -1952,7 +2149,11 @@
\fi
\fi
\fi
- \global\setfalse\c_tabl_tabulate_firstflushed}
+ \global\setfalse\c_tabl_tabulate_firstflushed
+ \ifconditional\c_tabl_tabulate_no_interline_space
+ \nointerlineskip
+ \injectzerobaselineskip
+ \fi}
\protected\def\tabl_tabulate_bbskip_second_split_yes
{\ifvoid\b_tabl_tabulate_current\c_tabl_tabulate_column
@@ -1962,7 +2163,11 @@
\fi}
\protected\def\tabl_tabulate_eskip_second
- {\par\egroup
+ {\par
+ \ifconditional\c_tabl_tabulate_no_blank_in_paragraphs
+ \removelastskip
+ \fi
+ \egroup
\tabl_tabulate_pheight_set
\glet\tabl_tabulate_hook\tabl_tabulate_hook_yes
\tabl_tabulate_splitoff_box}
@@ -1972,15 +2177,18 @@
% first line
\global\setbox\b_tabl_tabulate_current\c_tabl_tabulate_column\vbox
\bgroup
+ \ifconditional\c_tabl_tabulate_no_blank_in_paragraphs
+ \inhibitblank
+ \fi
\glet\tabl_tabulate_hook\tabl_tabulate_hook_nop
\ifconditional\c_tabl_tabulate_automode\hsize\d_tabl_tabulate_width\fi
% \begstrut % interferes with pre-\pars
% evt: \appendtoks\begstrut\to\everypar
- \ignorespaces
\let\tabl_tabulate_eskip\tabl_tabulate_eskip_second
+ \expandafter\ignorepars % \ignorespaces
\else
% successive lines
- \let\tabl_tabulate_eskip\empty
+ \lettonothing\tabl_tabulate_eskip
\dontcomplain
\glet\tabl_tabulate_hook\tabl_tabulate_hook_yes
\expandafter\tabl_tabulate_splitoff_box
@@ -1989,20 +2197,45 @@
\protected\def\tabl_tabulate_xbskip_second{\tabl_tabulate_bskip}
\protected\def\tabl_tabulate_xeskip_second{\tabl_tabulate_eskip}
+% \protected\def\tabl_tabulate_flush_second_indeed
+% {\glettonothing\tabl_tabulate_flush_collected_indeed
+% \global\c_tabl_tabulate_column\zerocount
+% \tabl_tabulate_pbreak_check
+% \dofastloopcs\c_tabl_tabulate_columns\tabl_tabulate_flush_second_step
+% \global\settrue\c_tabl_tabulate_firstflushed}
+%
+% \protected\def\tabl_tabulate_flush_second_step
+% {\ifvoid\b_tabl_tabulate_current\fastloopindex\else
+% \gdef\tabl_tabulate_flush_collected_indeed{\the\t_tabl_tabulate_dummy}%
+% \fi}
+%
+% \def\tabl_tabulate_flush_second
+% {\noalign{\tabl_tabulate_flush_second_indeed}%
+% \tabl_tabulate_flush_collected_indeed}
+
\protected\def\tabl_tabulate_flush_second_indeed
- {\glet\tabl_tabulate_flush_collected_indeed\empty
+ {\glettonothing\tabl_tabulate_flush_collected_indeed
\global\c_tabl_tabulate_column\zerocount
\tabl_tabulate_pbreak_check
+ \global\setfalse\c_tabl_tabulate_split_done % new 27/12/2022
\dofastloopcs\c_tabl_tabulate_columns\tabl_tabulate_flush_second_step
+ \ifconditional\c_tabl_tabulate_split_done\else
+ \glet\tabl_tabulate_tm\s!reset % new 27/12/2022
+ \fi
\global\settrue\c_tabl_tabulate_firstflushed}
\protected\def\tabl_tabulate_flush_second_step
- {\ifvoid\b_tabl_tabulate_current\fastloopindex\else
+ {\ifvoid\b_tabl_tabulate_current\fastloopindex
+ \else
\gdef\tabl_tabulate_flush_collected_indeed{\the\t_tabl_tabulate_dummy}%
+ \ifvoid\b_tabl_tabulate_current\fastloopindex \else
+ \global\settrue\c_tabl_tabulate_split_done % new 27/12/2022
+ \fi
\fi}
\def\tabl_tabulate_flush_second
{\noalign{\tabl_tabulate_flush_second_indeed}%
+ \noalign\tabl_tabulate_tm{\ifx\tabl_tabulate_tm\s!reset\glettonothing\tabl_tabulate_tm\fi}% new 27/12/2022
\tabl_tabulate_flush_collected_indeed}
\protected\def\tabl_tabulate_bskip_second_split_nop
@@ -2010,7 +2243,7 @@
\ifconditional\c_tabl_tabulate_automode\hsize\d_tabl_tabulate_width\fi
% \begstrut % interferes with pre-\pars
% evt: \appendtoks\begstrut\to\everypar
- \ignorespaces}
+ \ignorepars} % \ignorespaces
\protected\def\tabl_tabulate_eskip_second_split_nop % vertical strut added august 2003
{\par\verticalstrut
@@ -2048,8 +2281,8 @@
\permanent\tolerant\noaligned\protected\def\tabl_tabulate_BL_second[#1]{\noalign{\tabl_tabulate_hrule_preset[#1]\tabl_tabulate_BL_second_indeed}}
\protected\def\tabl_tabulate_FL_second_indeed
- {\ifinsidefloat\else
- \doifempty{\tabulationparameter\c!before}\tabl_tabulate_baselinecorrection % no expansion
+ {\ifinsidefloat\orelse\ifcstok{\tabulationparameter\c!before}\emptytoks
+ \tabl_tabulate_baselinecorrection
\fi
\tabl_tabulate_hrule_inject
\tabl_tabulate_nobreak_inject
@@ -2099,6 +2332,7 @@
\permanent\def\tabl_tabulate_HL_second
{\csname
\ifnum\c_tabl_tabulate_noflines=\zerocount F\orelse
+ % \ifzeroc_tabl_tabulate_noflines F\orelse
\ifnum\c_tabl_tabulate_noflines=\c_tabl_tabulate_totalnoflines L\else
M\fi
L\endcsname}
@@ -2156,8 +2390,8 @@
%D places where we can use \LUA\ code (for instance in alignment of numbers. The
%D repeat parser is replace at the \LUA\ end as well.
-\let\tabl_tabulate_flush_collected \empty
-\let\tabl_tabulate_flush_collected_indeed\empty
+\lettonothing\tabl_tabulate_flush_collected
+\lettonothing\tabl_tabulate_flush_collected_indeed
\let\v_tabl_tabulate_align\!!zerocount
@@ -2165,7 +2399,7 @@
{\ifdefined\page_sides_check_floats_indeed
\page_sides_check_floats_indeed
\ifdim\hangindent>\zeropoint
- \advance\d_tabl_tabulate_indent\hangindent
+ \advanceby\d_tabl_tabulate_indent\hangindent
\fi
\fi}
@@ -2182,6 +2416,45 @@
% \ruledvbox{\starttabulate[|k8|] \NC xxx \NC \NR \stoptabulate}
% \ruledvbox{\starttabulate[|l|l|] \NC xxx \NC xxx \NC \NR \stoptabulate}
+% \enabletrackers[localanchor]
+%
+% \startoverlayMPgraphic{mp:whatever-6}
+% draw anchorcell (1,1) withpen pencircle scaled 1pt withcolor "blue" ;
+% fill anchorspan (2,2) (3,5) withpen pencircle scaled 1pt withcolor "yellow" ;
+% draw anchorcell (2,2) withpen pencircle scaled 1pt withcolor "green" ;
+% draw anchorcell (3,3) withpen pencircle scaled 1pt withcolor "red" ;
+% \stopoverlayMPgraphic
+%
+% \starttabulate[synchronize=background,background=mp:whatever-6,format={|l|c|r|}]
+% \NC test \NC test \NC test \NC \NR
+% \NC test \NC test test \NC test \NC \NR
+% \NC test test \NC test \NC test \NC \NR
+% \NC test \NC test \NC test \NC \NR
+% \NC test \NC test \NC test test \NC \NR
+% \stoptabulate
+
+\protected\def\tabl_tabulate_anchor_indeed
+ {\edef\xanchor{\number\c_tabl_tabulate_column}%
+ \edef\yanchor{\number\c_tabl_tabulate_nofrealrows}%
+ \markanchor{matrix}{\c_tabl_tabulate_column}{\c_tabl_tabulate_nofrealrows}}
+
+\def\tabl_tabulate_anchor_setup % a bit of a cheat but good enough for a lightweight experiment
+ {\edef\p_synchronize{\tabulationparameter\c!synchronize}%
+ \ifx\p_synchronize\v!background
+ \edef\currentframedcontent{\tabulationparameter\c!frame}%
+ \ifx\currentframedcontent\v!off
+ \resettabulationparameter\c!frame
+ \lettonothing\currentframedcontent
+ \letframedcontentparameter\c!frame\v!off
+ \fi
+ \letframedcontentparameter\c!synchronize\p_synchronize
+ \setframedcontentparameter\c!background {\tabulationparameter\c!background}%
+ \enforced\let\tabl_tabulate_anchor\tabl_tabulate_anchor_indeed
+ \setlocalanchoring
+ \fi}
+
+\permanent\protected\lettonothing\tabl_tabulate_anchor
+
\def\tabl_tabulate_process
{\c_tabl_tabulate_pass\plusone
\tabl_tabulate_check_full_content
@@ -2222,28 +2495,28 @@
%
\the\t_tabl_tabulate_initializers_first % collect more here
%
- \glet\tabl_tabulate_flush_collected\empty
+ \glettonothing\tabl_tabulate_flush_collected
\ifdim\d_tabl_tabulate_margin>\zeropoint
\t_tabl_tabulate_preamble
{\aligntab
\tabl_tabulate_flush_indent
-% \global\advance\c_tabl_tabulate_noflines\plusone
+% \global\advanceby\c_tabl_tabulate_noflines\plusone
\strut
- \alignmark\alignmark
+ \aligncontent % \alignmark\alignmark
\tabskip\d_tabl_tabulate_margin
\strut
\aligntab
- \alignmark\alignmark
+ \aligncontent % \alignmark\alignmark
\tabskip\zeropoint}%
\else
\t_tabl_tabulate_preamble
{\aligntab
\tabl_tabulate_flush_indent
-% \global\advance\c_tabl_tabulate_noflines\plusone
+% \global\advanceby\c_tabl_tabulate_noflines\plusone
\strut
- \alignmark\alignmark
+ \aligncontent % \alignmark\alignmark
\aligntab
- \alignmark\alignmark
+ \aligncontent % \alignmark\alignmark
\tabskip\zeropoint}%
\fi
\d_tabl_tabulate_width\zeropoint
@@ -2257,8 +2530,9 @@
\d_tabl_tabulate_width\zeropoint
\tabl_tabulate_initialize_boxes\c_tabl_tabulate_columns
\toksapp\t_tabl_tabulate_preamble{%
- \aligntab\alignmark\alignmark
- \global\advance\c_tabl_tabulate_column\plusone % maybe just set it already
+ \aligntab
+ \aligncontent % \alignmark\alignmark
+ \global\advanceby\c_tabl_tabulate_column\plusone % maybe just set it already
}%
\toksapp\t_tabl_tabulate_dummy{%
\NC\unskip\unskip\crcr\tabl_tabulate_flush_collected % no count
@@ -2283,7 +2557,10 @@
\d_tabl_tabulate_indent\zeropoint
\settrialtypesetting % very important
\anch_backgrounds_text_level_start
- \expandafter\halign\expandafter{\the\t_tabl_tabulate_preamble\crcr\tabl_tabulate_insert_content\crcr}}%
+ \halign
+ \ifconditional\c_tabl_sparse_skips \s!noskips\fi
+ \ifconditional\c_tabl_auto_align_mode_new \alignmentcharactertrigger\fi
+ \expandafter{\the\t_tabl_tabulate_preamble\crcr\tabl_tabulate_insert_content\crcr}}%
\anch_backgrounds_text_level_stop
\ifcase\c_anch_backgrounds_text_state\else
\global\settrue\tablehaspositions
@@ -2292,13 +2569,13 @@
% so, even if the natural size is larger, in the final run, we force the calculated width
\d_tabl_tabulate_width\dimexpr\hsize-\wd\scratchbox-\d_tabl_tabulate_width_p-\d_tabl_tabulate_width_w\relax
\ifnum\c_tabl_tabulate_nofauto>\zerocount
- \divide\d_tabl_tabulate_width \c_tabl_tabulate_nofauto\relax
+ \divideby\d_tabl_tabulate_width \c_tabl_tabulate_nofauto\relax
\fi
\fi
\setbox\scratchbox\emptybox % free memory
\ifconditional\c_tabl_tabulate_split
\splittopskip\strutht
- \glet\tabl_tabulate_flush_collected_indeed\empty
+ \glettonothing\tabl_tabulate_flush_collected_indeed
\glet\tabl_tabulate_flush_collected\tabl_tabulate_flush_second
\fi
\c_tabl_tabulate_totalnoflines\c_tabl_tabulate_noflines
@@ -2318,6 +2595,7 @@
\ifinsidesplitfloat
\global\setbox\b_tabl_tabulate\vbox \bgroup
\else
+ \tabl_tabulate_anchor_setup
\startframedcontent[\tabulationparameter\c!frame]%
\fi
\else
@@ -2329,7 +2607,10 @@
\setfalse\inhibitmargindata % new per 2012.06.13 ... really needed
% % \everycr\expandafter{\the\everycr\noalign{\the\t_tabl_tabulate_every_real_row}\dostoptagged\dostarttagged\t!tabulaterow\empty}%
\toksapp\everycr{\noalign{\the\t_tabl_tabulate_every_real_row\dostoptagged\dostarttagged\t!tabulaterow\empty}}%
- \expandafter\halign\expandafter{\the\t_tabl_tabulate_preamble\crcr\tabl_tabulate_insert_content\crcr}%
+ \halign
+ \ifconditional\c_tabl_sparse_skips \s!noskips\fi
+ \ifconditional\c_tabl_auto_align_mode_new \alignmentcharactertrigger\fi
+ \expandafter{\the\t_tabl_tabulate_preamble\crcr\tabl_tabulate_insert_content\crcr}%
\dostoptagged
\dostoptagged
\ifhmode\par\prevdepth\strutdp\fi % nog eens beter, temporary hack
@@ -2376,6 +2657,8 @@
% \NC test \NC \input tufte \relax \NC \NR
% \stoptabulate
+% todo: use the more modern line getter
+
\def\tabl_split_box#1% #1 <> 0/2 / derived from the one in core-ntb.tex
{\ifinsidesplitfloat
\tabl_split_box_indeed#1%
@@ -2421,7 +2704,7 @@
% \NC text \NC text \NC \NR
% \stoptabulate
-\permanent\tolerant\noaligned\protected\def\tabl_tabulate_TB[#1]%
+\permanent\tolerant\noaligned\protected\def\tabl_tabulate_TB_yes[#1]%
{\noalign\bgroup
\unless\iftok{#1}\emptytoks
\blank[#1]
@@ -2432,9 +2715,16 @@
\fi
\egroup}
+\permanent\tolerant\noaligned\protected\def\tabl_tabulate_TB_nop[#1]%
+ {}
+
\appendtoks
- \enforced\let\TB\tabl_tabulate_TB
-\to \everytabulate
+ \enforced\let\TB\tabl_tabulate_TB_nop
+\to \t_tabl_tabulate_initializers_first
+
+\appendtoks
+ \enforced\let\TB\tabl_tabulate_TB_yes
+\to \t_tabl_tabulate_initializers_second
% %D Between alignment lines certain rules apply, and even a simple test can mess
% %D up a table, which is why we have a special test facilityL
@@ -2608,7 +2898,7 @@
\permanent\protected\defcsname starttabulate\endcsname
{\bgroup % whole thing
\settrue\c_tabl_generic
- \let\currenttabulationparent\empty
+ \lettonothing\currenttabulationparent
\tabl_start_regular}
\permanent\letcsname stoptabulate\endcsname\relax % testcase cvs-002.tex
@@ -2723,11 +3013,11 @@
% \c!foregroundcolor=,
% \c!foregroundstyle=]
-\let\m_table_current_row_background \empty
-\let\m_table_current_row_background_default \empty
-\let\m_table_current_row_background_filler \empty
-\let\m_table_current_row_background_defaultfiller\empty
-\let\m_table_current_row_background_auto \empty
+\lettonothing\m_table_current_row_background
+\lettonothing\m_table_current_row_background_default
+\lettonothing\m_table_current_row_background_filler
+\lettonothing\m_table_current_row_background_defaultfiller
+\lettonothing\m_table_current_row_background_auto
\protected\def\tabl_register_row_background#1%
{\xdef\m_table_current_row_background{#1}}
@@ -2780,16 +3070,16 @@
\fi}
\appendtoks
- \glet\m_table_current_row_background\empty
- \glet\m_table_current_row_background_filler\empty
+ \glettonothing\m_table_current_row_background
+ \glettonothing\m_table_current_row_background_filler
\global\c_tabl_tabulate_nofrealrows\zerocount
\global\c_tabl_tabulate_autocolor\zerocount
\clf_resetbackgroundrowdata
\to \t_tabl_tabulate_initializers_first
\appendtoks
- \glet\m_table_current_row_background\empty
- \glet\m_table_current_row_background_filler\empty
+ \glettonothing\m_table_current_row_background
+ \glettonothing\m_table_current_row_background_filler
\global\c_tabl_tabulate_nofrealrows\zerocount
\global\c_tabl_tabulate_autocolor\zerocount
\clf_resetbackgroundrowdata
@@ -2800,8 +3090,8 @@
\to \t_tabl_tabulate_every_real_row
\appendtoks
- \glet\m_table_current_row_background\empty
- \glet\m_table_current_row_background_filler\empty
+ \glettonothing\m_table_current_row_background
+ \glettonothing\m_table_current_row_background_filler
\to \t_tabl_tabulate_every_after_row
\permanent\protected\def\tabl_tabulate_NL_first[#1]%
@@ -2809,7 +3099,7 @@
\ifcase\c_tabl_tabulate_column\or
\tabl_register_row_background{#1}%
\fi
- \ignorespaces}
+ \ignorepars} % \ignorespaces
\pushoverloadmode
@@ -2820,7 +3110,7 @@
\ifcase\c_tabl_tabulate_column\or
\tabl_register_row_background\m_table_current_row_background_default
\fi
- \ignorespaces}
+ \ignorepars} % \ignorespaces
\popoverloadmode
@@ -2830,7 +3120,7 @@
\tabl_register_row_background{#1}%
\fi
\usetabulationstyleandcolor\c!foregroundstyle\c!foregroundcolor
- \ignorespaces}
+ \ignorepars} % \ignorespaces
\permanent\protected\def\tabl_tabulate_DB_first
{\tabl_tabulate_column_normal\plusone\zerocount\relax
@@ -2839,21 +3129,21 @@
\fi
\enforced\let\fontstyle\globalfontstyle
\usetabulationstyleandcolor\c!foregroundstyle\c!foregroundcolor
- \ignorespaces}
+ \ignorepars} % \ignorespaces
\permanent\protected\def\tabl_tabulate_NF_first[#1]%
{\tabl_tabulate_column_normal\zerocount\zerocount\relax
\ifcase\c_tabl_tabulate_column\or
\tabl_register_row_background_filler{#1}%
\fi
- \ignorespaces}
+ \ignorepars} % \ignorespaces
\permanent\protected\def\tabl_tabulate_NP_first
{\tabl_tabulate_column_normal\zerocount\zerocount\relax
\ifcase\c_tabl_tabulate_column\or
\tabl_register_row_background_filler\m_table_current_row_background_default_filler
\fi
- \ignorespaces}
+ \ignorepars} % \ignorespaces
\permanent\protected\def\tabl_tabulate_FB_first[#1]%
{\tabl_tabulate_column_normal\plusone\zerocount\relax
@@ -2861,7 +3151,7 @@
\tabl_register_row_background_filler{#1}%
\fi
\usetabulationstyleandcolor\c!foregroundstyle\c!foregroundcolor
- \ignorespaces}
+ \ignorepars} % \ignorespaces
\permanent\protected\def\tabl_tabulate_PB_first
{\tabl_tabulate_column_normal\plusone\zerocount\relax
@@ -2870,7 +3160,7 @@
\fi
\enforced\let\fontstyle\globalfontstyle
\usetabulationstyleandcolor\c!foregroundstyle\c!foregroundcolor
- \ignorespaces}
+ \ignorepars} % \ignorespaces
\pushoverloadmode
@@ -2890,35 +3180,31 @@
\popoverloadmode
\permanent\protected\def\tabl_tabulate_A_first
- {\global\advance\c_tabl_tabulate_autocolor\plusone
+ {\global\advanceby\c_tabl_tabulate_autocolor\plusone
\edef\m_table_current_row_background_auto{\tabulateparameter{\c!backgroundcolor:\number\c_tabl_tabulate_autocolor}}%
\ifempty\m_table_current_row_background_auto
\global\c_tabl_tabulate_autocolor\plusone
\edef\m_table_current_row_background_auto{\tabulateparameter{\c!backgroundcolor:\number\c_tabl_tabulate_autocolor}}%
\fi
\ifempty\m_table_current_row_background_auto
- \let\m_table_current_row_background_auto\empty % \m_table_current_row_background_default
+ \lettonothing\m_table_current_row_background_auto % \m_table_current_row_background_default
\fi
\tabl_register_row_background{\m_table_current_row_background_auto}}
\permanent\protected\def\tabl_tabulate_NA_first
{\tabl_tabulate_column_normal\zerocount\zerocount\relax
- \iftrialtypesetting\else
- \ifcase\c_tabl_tabulate_column\or
- \tabl_tabulate_A_first
- \fi
+ \iftrialtypesetting\orelse\ifcase\c_tabl_tabulate_column\or
+ \tabl_tabulate_A_first
\fi
- \ignorespaces}
+ \ignorepars} % \ignorespaces
\permanent\protected\def\tabl_tabulate_BA_first
{\tabl_tabulate_column_normal\plusone\zerocount\relax
- \iftrialtypesetting\else
- \ifcase\c_tabl_tabulate_column\or
- \tabl_tabulate_A_first
- \fi
+ \iftrialtypesetting\orelse\ifcase\c_tabl_tabulate_column\or
+ \tabl_tabulate_A_first
\fi
\usetabulationstyleandcolor\c!foregroundstyle\c!foregroundcolor
- \ignorespaces}
+ \ignorepars} % \ignorespaces
\appendtoks
\enforced\let\NL\tabl_tabulate_NL_first % NC with Line
@@ -2934,9 +3220,9 @@
\to \t_tabl_tabulate_initializers_first
\appendtoks
- \edef\m_table_current_row_background_default {\tabulateparameter\c!backgroundcolor}%
+ \edef\m_table_current_row_background_default{\tabulateparameter\c!backgroundcolor}%
\edef\m_table_current_row_background_default_filler{\tabulateparameter\c!background}%
- \let \m_table_current_row_background_auto \empty
+ \lettonothing\m_table_current_row_background_auto
\to \everytabulate
\setuptabulate
@@ -2946,4 +3232,49 @@
\c!foregroundcolor=,
\c!foregroundstyle=\tabulationparameter\c!headstyle]
+%D Only for simple cases (read:myself):
+%D
+%D \starttyping
+%D \starttabulate[|c|c|c|]
+%D \NC 1 \NC second column \NC third column \NC \NR
+%D \NC 2 \NC second \NC third \NC \NR
+%D \NC 3 r \NS[1][r]second & third \NC \NR
+%D \NC 3 c \NS[1][c]second & third \NC \NR
+%D \NC 3 l \NS[1][l]second & third \NC \NR
+%D \stoptabulate
+%D \stoptyping
+
+% Not okay yet as we loose alignment in later columns .. weird .. do
+% we miss a tab?
+
+\installcorenamespace{tabulatespanb}
+\installcorenamespace{tabulatespana}
+
+\noaligned\def\tabl_tabulate_span{\omit\span\omit\span\omit\span}
+
+%\letcsname\??tabulatespanb l\endcsname\relax
+\letcsname\??tabulatespana l\endcsname\hfill
+\letcsname\??tabulatespanb c\endcsname\hfill
+\letcsname\??tabulatespana c\endcsname\hfill
+\letcsname\??tabulatespanb m\endcsname\hfill
+\letcsname\??tabulatespana m\endcsname\hfill
+\letcsname\??tabulatespanb r\endcsname\hfill
+%\letcsname\??tabulatespana r\endcsname\relax
+
+\noaligned\tolerant\def\tabl_tabulate_NS[#1]#*[#2]%
+ {\NC\loopcs{#1}\tabl_tabulate_span
+ \gdef\tabl_tabulate_kooh
+ {\begincsname\??tabulatespana#2\endcsname
+ \glet\tabl_tabulate_kooh\relax}%
+ \begincsname\??tabulatespanb#2\endcsname
+ \ignorepars} % \ignorespaces
+
+\appendtoks
+ \enforced\let\NS\tabl_tabulate_NS
+\to \t_tabl_tabulate_initializers_first
+
+% \appendtoks
+% \let\NS\tabl_tabulate_NS
+% \to \t_tabl_tabulate_initializers_second
+
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-tsp.mkxl b/Master/texmf-dist/tex/context/base/mkxl/tabl-tsp.mkxl
index 5f01e7eb4ae..6facbfcae00 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/tabl-tsp.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-tsp.mkxl
@@ -69,16 +69,15 @@
\newconditional\splitfloatdone
\newconditional\onlyonesplitofffloat \settrue\onlyonesplitofffloat
-\newif \ifinsidesplitfloat % will become conditional
+\newif \ifinsidesplitfloat % will become conditional
+\newcount\noffloatssplits
+\newtoks \everysplitfloatsetup
-\newcount \noffloatssplits
-\newtoks \everysplitfloatsetup
+\mutable\let\extrasplitfloatlines \!!zerocount
+\mutable\let\splitfloatfinalizer \relax
-\mutable\let \extrasplitfloatlines \!!zerocount
-\mutable\let \splitfloatfinalizer \relax
-\mutable\let \splitfloatcommand \empty
-
-\mutable\let \floatcaptionsuffix \empty
+\mutable\lettonothing\splitfloatcommand
+\mutable\lettonothing\floatcaptionsuffix
\permanent\tolerant\protected\def\splitfloat[#1]#:#2% nog dubbele refs
{\bgroup
@@ -131,10 +130,10 @@
\dontcomplain
\global\settrue\splitfloatdone
% \nodelocationmode\zerocount % bypass auto-renumbering
- \global\advance\noffloatssplits\plusone
+ \global\advanceby\noffloatssplits\plusone
\ifcase\noffloatssplits\relax \or
\ifconditional\onlyonesplitofffloat
- \let\floatcaptionsuffix\empty
+ \lettonothing\floatcaptionsuffix
\fi
\fi
\bgroup
@@ -191,7 +190,7 @@
\setbox\scratchbox\vbox{\flushlocalfloats}% \vpack ?
\getnoflines{\ht\scratchbox}%
\resetlocalfloats
- \advance\noflines\minusone % compensate dummy line
+ \advanceby\noflines\minusone % compensate dummy line
\normalexpanded{\egroup\noexpand\edef\noexpand\extrasplitfloatlines{\the\noflines}}%
\global\settrue\usesamefloatnumber
\else
@@ -207,25 +206,25 @@
% todo: keep tail to rest, so we need a lookahead
-\newbox\b_split_content
-\newbox\b_split_result
-\newbox\b_split_head
-\newbox\b_split_next
-\newbox\b_split_tail
-
-\newtoks\t_split_before_result
-\newtoks\t_split_after_result
-\newtoks\t_split_before
-\newtoks\t_split_inbetween
-\newtoks\t_split_after
+\newbox \b_split_content
+\newbox \b_split_result % watch out, semi public, accessed in cs-*
+\newbox \b_split_head
+\newbox \b_split_next
+\newbox \b_split_tail
-\newtoks\everyresettsplit
+\newtoks \t_split_before_result
+\newtoks \t_split_after_result
+\newtoks \t_split_before
+\newtoks \t_split_inbetween
+\newtoks \t_split_after
+\newtoks \t_split_section
+\newtoks \everyresettsplit
-\newcount\c_split_minimum_free_lines
+\newinteger \c_split_minimum_free_lines
-\newdimen\d_split_minimum_free_space
-\newdimen\d_split_available_height
-\newdimen\d_split_inbetween_height
+\newdimension \d_split_minimum_free_space
+\newdimension \d_split_available_height
+\newdimension \d_split_inbetween_height
\newconditional\c_tabl_split_done
\newconditional\c_tabl_split_head
@@ -233,6 +232,8 @@
\newconditional\tabl_split_forced_page
+% \permanent\protected\def\lastsplithtdp{\htdp\b_split_result}
+
\appendtoks
\c_split_minimum_free_lines\zerocount
\d_split_minimum_free_space\zeropoint
@@ -246,6 +247,7 @@
\t_split_inbetween \emptytoks
\t_split_before \emptytoks
\t_split_after \emptytoks
+ \t_split_section \emptytoks
\let\postprocesstsplit \donothing
\to \everyresettsplit
@@ -296,11 +298,12 @@
-\extrasplitfloatlines\lineheight
\relax
\ifdim\htdp\b_split_tail>\zeropoint
- \advance\d_split_available_height-\htdp\b_split_tail
+ \advanceby\d_split_available_height-\htdp\b_split_tail
\fi
\setbox\b_split_result\vbox
{\ifdim\ht\b_split_head>\zeropoint
\unvcopy\b_split_head
+ \the\t_split_section
\the\t_split_inbetween
\fi}%
\ifconditional\c_tabl_split_done \else
diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-xtb.lmt b/Master/texmf-dist/tex/context/base/mkxl/tabl-xtb.lmt
new file mode 100644
index 00000000000..b69bfd87346
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-xtb.lmt
@@ -0,0 +1,1325 @@
+if not modules then modules = { } end modules ['tabl-xtb'] = {
+ version = 1.001,
+ comment = "companion to tabl-xtb.mkvi",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+--[[
+
+This table mechanism is a combination between TeX and Lua. We do process
+cells at the TeX end and inspect them at the Lua end. After some analysis
+we have a second pass using the calculated widths, and if needed cells
+will go through a third pass to get the heights right. This last pass is
+avoided when possible which is why some code below looks a bit more
+complex than needed. The reason for such optimizations is that each cells
+is actually a framed instance and because tables like this can be hundreds
+of pages we want to keep processing time reasonable.
+
+To a large extend the behaviour is comparable with the way bTABLE/eTABLE
+works and there is a module that maps that one onto this one. Eventually
+this mechamism will be improved so that it can replace its older cousin.
+
+]]--
+
+-- todo: use linked list instead of r/c array
+-- todo: we can use the sum of previously forced widths for column spans
+
+local tonumber, next = tonumber, next
+
+local commands = commands
+local context = context
+local ctxnode = context.nodes.flush
+
+local implement = interfaces.implement
+
+local tex = tex
+local texgetcount = tex.getcount
+local texsetcount = tex.setcount
+local texiscount = tex.iscount
+local texgetdimen = tex.getdimen
+local texsetdimen = tex.setdimen
+local texisdimen = tex.isdimen
+local texget = tex.get
+
+local format = string.format
+local concat = table.concat
+local points = number.points
+
+local todimen = string.todimen
+
+local ctx_beginvbox = context.beginvbox
+local ctx_endvbox = context.endvbox
+local ctx_blank = context.blank
+local ctx_nointerlineskip = context.nointerlineskip
+local ctx_dummyxcell = context.dummyxcell
+
+local variables = interfaces.variables
+
+local setmetatableindex = table.setmetatableindex
+local settings_to_hash = utilities.parsers.settings_to_hash
+
+local nuts = nodes.nuts -- here nuts gain hardly nothing
+local tonut = nuts.tonut
+local tonode = nuts.tonode
+
+local getnext = nuts.getnext
+local getprev = nuts.getprev
+local getlist = nuts.getlist
+local getwidth = nuts.getwidth
+local getbox = nuts.getbox
+local getwhd = nuts.getwhd
+
+local setlink = nuts.setlink
+local setdirection = nuts.setdirection
+local setshift = nuts.setshift
+
+local copynodelist = nuts.copylist
+local hpacknodelist = nuts.hpack
+local flushnodelist = nuts.flushlist
+local takebox = nuts.takebox
+
+local nodepool = nuts.pool
+
+local new_glue = nodepool.glue
+local new_kern = nodepool.kern
+local new_hlist = nodepool.hlist
+
+local lefttoright_code = nodes.dirvalues.lefttoright
+
+local v_stretch = variables.stretch
+local v_normal = variables.normal
+local v_width = variables.width
+local v_height = variables.height
+local v_repeat = variables["repeat"]
+local v_max = variables.max
+local v_fixed = variables.fixed
+----- v_auto = variables.auto
+local v_before = variables.before
+local v_after = variables.after
+local v_both = variables.both
+local v_samepage = variables.samepage
+local v_tight = variables.tight
+
+local xtables = { }
+typesetters.xtables = xtables
+
+local trace_xtable = false
+local report_xtable = logs.reporter("xtable")
+
+trackers.register("xtable.construct", function(v) trace_xtable = v end)
+
+local c_tabl_x_nx = texiscount("c_tabl_x_nx")
+local c_tabl_x_ny = texiscount("c_tabl_x_ny")
+local c_tabl_x_state = texiscount("c_tabl_x_state")
+local c_tabl_x_mode = texiscount("c_tabl_x_mode")
+local c_tabl_x_skip_mode = texiscount("c_tabl_x_skip_mode")
+local d_tabl_x_final_width = texisdimen("d_tabl_x_final_width")
+local d_tabl_x_distance = texisdimen("d_tabl_x_distance")
+local d_tabl_x_width = texisdimen("d_tabl_x_width")
+local d_tabl_x_height = texisdimen("d_tabl_x_height")
+local d_tabl_x_depth = texisdimen("d_tabl_x_depth")
+local d_lineheight = texisdimen("lineheight")
+
+local c_frameddimensionstate = texiscount("frameddimensionstate")
+
+local head_mode = 1
+local foot_mode = 2
+local more_mode = 3
+local body_mode = 4
+
+local namedmodes = { [0] =
+ "null",
+ "head",
+ "foot",
+ "next",
+ "body",
+}
+
+local stack, data = { }, nil
+
+function xtables.create(settings)
+ table.insert(stack,data)
+ local rows = { }
+ local widths = { }
+ local heights = { }
+ local depths = { }
+ -- local spans = { }
+ local distances = { }
+ local autowidths = { }
+ local modes = { }
+ local fixedrows = { }
+ local fixedcolumns = { }
+ -- local fixedcspans = { }
+ local frozencolumns = { }
+ local options = { }
+ local rowproperties = { }
+ data = {
+ rows = rows,
+ widths = widths,
+ heights = heights,
+ depths = depths,
+ -- spans = spans,
+ distances = distances,
+ modes = modes,
+ autowidths = autowidths,
+ fixedrows = fixedrows,
+ fixedcolumns = fixedcolumns,
+ -- fixedcspans = fixedcspans,
+ frozencolumns = frozencolumns,
+ options = options,
+ nofrows = 0,
+ nofcolumns = 0,
+ currentrow = 0,
+ currentcolumn = 0,
+ settings = settings or { },
+ rowproperties = rowproperties,
+ }
+ local function add_zero(t,k)
+ t[k] = 0
+ return 0
+ end
+ local function add_table(t,k)
+ local v = { }
+ t[k] = v
+ return v
+ end
+ local function add_cell(row,c)
+ local cell = {
+ nx = 0,
+ ny = 0,
+ list = false,
+ wd = 0,
+ ht = 0,
+ dp = 0,
+ }
+ row[c] = cell
+ if c > data.nofcolumns then
+ data.nofcolumns = c
+ end
+ return cell
+ end
+ local function add_row(rows,r)
+ local row = { }
+ setmetatableindex(row,add_cell)
+ rows[r] = row
+ if r > data.nofrows then
+ data.nofrows = r
+ end
+ return row
+ end
+ setmetatableindex(rows,add_row)
+ setmetatableindex(widths,add_zero)
+ setmetatableindex(heights,add_zero)
+ setmetatableindex(depths,add_zero)
+ setmetatableindex(distances,add_zero)
+ setmetatableindex(modes,add_zero)
+ setmetatableindex(fixedrows,add_zero)
+ setmetatableindex(fixedcolumns,add_zero)
+ setmetatableindex(options,add_table)
+ -- setmetatableindex(fixedcspans,add_table)
+ --
+ local globaloptions = settings_to_hash(settings.option)
+ --
+ settings.columndistance = tonumber(settings.columndistance) or 0
+ settings.rowdistance = tonumber(settings.rowdistance) or 0
+ settings.leftmargindistance = tonumber(settings.leftmargindistance) or 0
+ settings.rightmargindistance = tonumber(settings.rightmargindistance) or 0
+ settings.options = globaloptions
+ settings.textwidth = tonumber(settings.textwidth) or texget("hsize")
+ settings.lineheight = tonumber(settings.lineheight) or texgetdimen(d_lineheight)
+ settings.maxwidth = tonumber(settings.maxwidth) or settings.textwidth/8
+ -- if #stack > 0 then
+ -- settings.textwidth = texget("hsize")
+ -- end
+ data.criterium_v = 2 * data.settings.lineheight
+ data.criterium_h = .75 * data.settings.textwidth
+ --
+ data.tight = globaloptions[v_tight] and true or false
+end
+
+function xtables.initialize_reflow_width(option,width)
+ local r = data.currentrow
+ local c = data.currentcolumn + 1
+ local drc = data.rows[r][c]
+ drc.nx = texgetcount(c_tabl_x_nx)
+ drc.ny = texgetcount(c_tabl_x_ny)
+ local distances = data.distances
+ local distance = texgetdimen(d_tabl_x_distance)
+ if distance > distances[c] then
+ distances[c] = distance
+ end
+ if option and option ~= "" then
+ local options = settings_to_hash(option)
+ data.options[r][c] = options
+ if options[v_fixed] then
+ data.frozencolumns[c] = true
+ end
+ end
+ data.currentcolumn = c
+end
+
+-- todo: we can better set the cell values in one go
+
+function xtables.set_reflow_width()
+ local r = data.currentrow
+ local c = data.currentcolumn
+ local rows = data.rows
+ local row = rows[r]
+ local cold = c
+ while row[c].span do -- can also be previous row ones
+ c = c + 1
+ end
+ -- bah, we can have a span already
+ if c > cold then
+ local ro = row[cold]
+ local rx = ro.nx
+ local ry = ro.ny
+ if rx > 1 or ry > 1 then
+ local rn = row[c]
+ rn.nx = rx
+ rn.ny = ry
+ ro.nx = 1 -- or 0
+ ro.ny = 1 -- or 0
+ -- do we also need to set ro.span and rn.span
+ end
+ end
+ local tb = getbox("b_tabl_x")
+ local drc = row[c]
+ --
+ drc.list = true -- we don't need to keep the content around as we're in trial mode (no: copynodelist(tb))
+ --
+ local width, height, depth = getwhd(tb)
+ --
+ local widths = data.widths
+ local heights = data.heights
+ local depths = data.depths
+ local cspan = drc.nx
+ if cspan < 2 then
+ if width > widths[c] then
+ widths[c] = width
+ end
+ else
+ local options = data.options[r][c]
+ if data.tight then
+ -- no check
+ elseif not options then
+ if width > widths[c] then
+ widths[c] = width
+ end
+ elseif not options[v_tight] then
+ if width > widths[c] then
+ widths[c] = width
+ end
+ end
+ end
+ -- if cspan > 1 then
+ -- local f = data.fixedcspans[c]
+ -- local w = f[cspan] or 0
+ -- if width > w then
+ -- f[cspan] = width -- maybe some day a solution for autospanmax and so
+ -- end
+ -- end
+ if drc.ny < 2 then
+ -- report_xtable("set width, old: ht=%p, dp=%p",heights[r],depths[r])
+ -- report_xtable("set width, new: ht=%p, dp=%p",height,depth)
+ if height > heights[r] then
+ heights[r] = height
+ end
+ if depth > depths[r] then
+ depths[r] = depth
+ end
+ end
+ --
+ drc.wd = width
+ drc.ht = height
+ drc.dp = depth
+ --
+ local dimensionstate = texgetcount(c_frameddimensionstate)
+ local fixedcolumns = data.fixedcolumns
+ local fixedrows = data.fixedrows
+ if dimensionstate == 1 then
+ if cspan > 1 then
+ -- ignore width
+ elseif width > fixedcolumns[c] then -- how about a span here?
+ fixedcolumns[c] = width
+ end
+ elseif dimensionstate == 2 then
+ fixedrows[r] = height
+ elseif dimensionstate == 3 then
+ fixedrows[r] = height -- width
+ fixedcolumns[c] = width -- height
+ elseif width <= data.criterium_h and height >= data.criterium_v then
+ -- somewhat tricky branch
+ if width > fixedcolumns[c] then -- how about a span here?
+ -- maybe an image, so let's fix
+ fixedcolumns[c] = width
+ end
+ end
+--
+-- -- this fails so not good enough predictor
+--
+-- -- \startxtable
+-- -- \startxrow
+-- -- \startxcell knuth \stopxcell
+-- -- \startxcell \input knuth \stopxcell
+-- -- \stopxrow
+--
+-- else
+-- local o = data.options[r][c]
+-- if o and o[v_auto] then -- new per 5/5/2014 - removed per 15/07/2014
+-- data.autowidths[c] = true
+-- else
+-- -- no dimensions are set in the cell
+-- if width <= data.criterium_h and height >= data.criterium_v then
+-- -- somewhat tricky branch
+-- if width > fixedcolumns[c] then -- how about a span here?
+-- -- maybe an image, so let's fix
+-- fixedcolumns[c] = width
+-- end
+-- else
+-- -- safeguard as it could be text that can be recalculated
+-- -- and the previous branch could have happened in a previous
+-- -- row and then forces a wrong one-liner in a multiliner
+-- if width > fixedcolumns[c] then
+-- data.autowidths[c] = true -- new per 5/5/2014 - removed per 15/07/2014
+-- end
+-- end
+-- end
+-- end
+--
+ --
+ drc.dimensionstate = dimensionstate
+ --
+ local nx = drc.nx
+ local ny = drc.ny
+ if nx > 1 or ny > 1 then
+ -- local spans = data.spans -- not used
+ local self = true
+ for y=1,ny do
+ for x=1,nx do
+ if self then
+ self = false
+ else
+ local ry = r + y - 1
+ local cx = c + x - 1
+ -- if y > 1 then
+ -- spans[ry] = true -- not used
+ -- end
+ rows[ry][cx].span = true
+ end
+ end
+ end
+ c = c + nx - 1
+ end
+ if c > data.nofcolumns then
+ data.nofcolumns = c
+ end
+ data.currentcolumn = c
+end
+
+function xtables.initialize_reflow_height()
+ local r = data.currentrow
+ local c = data.currentcolumn + 1
+ local rows = data.rows
+ local row = rows[r]
+ while row[c].span do -- can also be previous row ones
+ c = c + 1
+ end
+ data.currentcolumn = c
+ local widths = data.widths
+ local w = widths[c]
+ local drc = row[c]
+ for x=1,drc.nx-1 do
+ w = w + widths[c+x]
+ end
+ texsetdimen(d_tabl_x_width,w)
+ local dimensionstate = drc.dimensionstate or 0
+ if dimensionstate == 1 or dimensionstate == 3 then
+ -- width was fixed so height is known
+ texsetcount(c_tabl_x_skip_mode,1)
+ elseif dimensionstate == 2 then
+ -- height is enforced
+ texsetcount(c_tabl_x_skip_mode,1)
+ elseif data.autowidths[c] then
+ -- width has changed so we need to recalculate the height
+ texsetcount(c_tabl_x_skip_mode,0)
+ elseif data.fixedcolumns[c] then
+ texsetcount(c_tabl_x_skip_mode,0) -- new
+ else
+ texsetcount(c_tabl_x_skip_mode,1)
+ end
+end
+
+function xtables.set_reflow_height()
+ local r = data.currentrow
+ local c = data.currentcolumn
+ local rows = data.rows
+ local row = rows[r]
+ -- while row[c].span do -- we could adapt drc.nx instead
+ -- c = c + 1
+ -- end
+ local tb = getbox("b_tabl_x")
+ local drc = row[c]
+ --
+ local width, height, depth = getwhd(tb)
+ --
+ if drc.ny < 2 then
+ if data.fixedrows[r] == 0 then -- and drc.dimensionstate < 2
+ if drc.ht + drc.dp <= height + depth then -- new per 2017-12-15
+ local heights = data.heights
+ local depths = data.depths
+ -- report_xtable("set height, old: ht=%p, dp=%p",heights[r],depths[r])
+ -- report_xtable("set height, new: ht=%p, dp=%p",height,depth)
+ if height > heights[r] then
+ heights[r] = height
+ end
+ if depth > depths[r] then
+ depths[r] = depth
+ end
+ end
+ end
+ end
+ --
+ drc.wd = width
+ drc.ht = height
+ drc.dp = depth
+ --
+ -- c = c + drc.nx - 1
+ -- data.currentcolumn = c
+end
+
+function xtables.initialize_construct()
+ local r = data.currentrow
+ local c = data.currentcolumn + 1
+ local settings = data.settings
+ local rows = data.rows
+ local row = rows[r]
+ while row[c].span do -- can also be previous row ones
+ c = c + 1
+ end
+ data.currentcolumn = c
+ local widths = data.widths
+ local heights = data.heights
+ local depths = data.depths
+ local distances = data.distances
+ --
+ local drc = row[c]
+ local wd = drc.wd
+ local ht = drc.ht
+ local dp = drc.dp
+ local nx = drc.nx - 1
+ local ny = drc.ny - 1
+ --
+ local width = widths[c]
+ local height = heights[r]
+ local depth = depths[r] -- problem: can be the depth of a one liner
+ --
+ local total = height + depth
+ --
+ if nx > 0 then
+ for x=1,nx do
+ width = width + widths[c+x] + distances[c+x-1]
+ end
+ local distance = settings.columndistance
+ if distance ~= 0 then
+ width = width + nx * distance
+ end
+ end
+ --
+ if ny > 0 then
+ for y=1,ny do
+ local nxt = r + y
+ total = total + heights[nxt] + depths[nxt]
+ end
+ local distance = settings.rowdistance
+ if distance ~= 0 then
+ total = total + ny * distance
+ end
+ end
+ --
+ texsetdimen(d_tabl_x_width,width)
+ texsetdimen(d_tabl_x_height,total)
+ texsetdimen(d_tabl_x_depth,0) -- for now
+end
+
+function xtables.set_construct()
+ local r = data.currentrow
+ local c = data.currentcolumn
+ local rows = data.rows
+ local row = rows[r]
+ -- while row[c].span do -- can also be previous row ones
+ -- c = c + 1
+ -- end
+ local drc = row[c]
+ -- this will change as soon as in luatex we can reset a box list without freeing
+ drc.list = takebox("b_tabl_x")
+ -- c = c + drc.nx - 1
+ -- data.currentcolumn = c
+end
+
+local function showwidths(where,widths,autowidths)
+ local result = { }
+ for i=1,#widths do
+ result[#result+1] = format("%12s%s",points(widths[i]),autowidths[i] and "*" or " ")
+ end
+ return report_xtable("%s widths: %s",where,concat(result," "))
+end
+
+function xtables.reflow_width()
+ local nofrows = data.nofrows
+ local nofcolumns = data.nofcolumns
+ local rows = data.rows
+ for r=1,nofrows do
+ local row = rows[r]
+ for c=1,nofcolumns do
+ local drc = row[c]
+ if drc.list then
+ -- flushnodelist(drc.list)
+ drc.list = false
+ end
+ end
+ end
+ -- spread
+ local settings = data.settings
+ local options = settings.options
+ local maxwidth = settings.maxwidth
+ -- calculate width
+ local widths = data.widths
+ local heights = data.heights
+ local depths = data.depths
+ local distances = data.distances
+ local autowidths = data.autowidths
+ local fixedcolumns = data.fixedcolumns
+ local frozencolumns = data.frozencolumns
+ local width = 0
+ local distance = 0
+ local nofwide = 0
+ local widetotal = 0
+ local available = settings.textwidth - settings.leftmargindistance - settings.rightmargindistance
+ if trace_xtable then
+ showwidths("stage 1",widths,autowidths)
+ end
+ local noffrozen = 0
+ -- here we can also check spans
+ if options[v_max] then
+ for c=1,nofcolumns do
+ width = width + widths[c]
+ if width > maxwidth then
+ autowidths[c] = true
+ nofwide = nofwide + 1
+ widetotal = widetotal + widths[c]
+ end
+ if c < nofcolumns then
+ distance = distance + distances[c]
+ end
+ if frozencolumns[c] then
+ noffrozen = noffrozen + 1 -- brr, should be nx or so
+ end
+ end
+ else
+ for c=1,nofcolumns do -- also keep track of forced
+ local fixedwidth = fixedcolumns[c]
+ if fixedwidth > 0 then
+ widths[c] = fixedwidth
+ width = width + fixedwidth
+ else
+ local wc = widths[c]
+ width = width + wc
+ -- if width > maxwidth then
+ if wc > maxwidth then -- per 2015-08-09
+ autowidths[c] = true
+ nofwide = nofwide + 1
+ widetotal = widetotal + wc
+ end
+ end
+ if c < nofcolumns then
+ distance = distance + distances[c]
+ end
+ if frozencolumns[c] then
+ noffrozen = noffrozen + 1 -- brr, should be nx or so
+ end
+ end
+ end
+ if trace_xtable then
+ showwidths("stage 2",widths,autowidths)
+ end
+ local delta = available - width - distance - (nofcolumns-1) * settings.columndistance
+ if delta == 0 then
+ -- nothing to be done
+ if trace_xtable then
+ report_xtable("perfect fit")
+ end
+ elseif delta > 0 then
+ -- we can distribute some
+ if not options[v_stretch] then
+ -- not needed
+ if trace_xtable then
+ report_xtable("too wide but no stretch, delta %p",delta)
+ end
+ elseif options[v_width] then
+ local factor = delta / width
+ if trace_xtable then
+ report_xtable("proportional stretch, delta %p, width %p, factor %a",delta,width,factor)
+ end
+ for c=1,nofcolumns do
+ widths[c] = widths[c] + factor * widths[c]
+ end
+ else
+ -- frozen -> a column with option=fixed will not stretch
+ local extra = delta / (nofcolumns - noffrozen)
+ if trace_xtable then
+ report_xtable("normal stretch, delta %p, extra %p",delta,extra)
+ end
+ for c=1,nofcolumns do
+ if not frozencolumns[c] then
+ widths[c] = widths[c] + extra
+ end
+ end
+ end
+ elseif nofwide > 0 then
+ while true do
+ done = false
+ local available = (widetotal + delta) / nofwide
+ if trace_xtable then
+ report_xtable("shrink check, total %p, delta %p, columns %s, fixed %p",widetotal,delta,nofwide,available)
+ end
+ for c=1,nofcolumns do
+ if autowidths[c] and available >= widths[c] then
+ autowidths[c] = nil
+ nofwide = nofwide - 1
+ widetotal = widetotal - widths[c]
+ done = true
+ end
+ end
+ if not done then
+ break
+ end
+ end
+ -- maybe also options[v_width] here but tricky as width does not say
+ -- much about amount
+ if options[v_width] then -- not that much (we could have a clever vpack loop balancing .. no fun)
+ local factor = (widetotal + delta) / width
+ if trace_xtable then
+ report_xtable("proportional shrink used, total %p, delta %p, columns %s, factor %s",widetotal,delta,nofwide,factor)
+ end
+ for c=1,nofcolumns do
+ if autowidths[c] then
+ widths[c] = factor * widths[c]
+ end
+ end
+ else
+ local available = (widetotal + delta) / nofwide
+ if trace_xtable then
+ report_xtable("normal shrink used, total %p, delta %p, columns %s, fixed %p",widetotal,delta,nofwide,available)
+ end
+ for c=1,nofcolumns do
+ if autowidths[c] then
+ widths[c] = available
+ end
+ end
+ end
+ end
+ if trace_xtable then
+ showwidths("stage 3",widths,autowidths)
+ end
+ --
+ data.currentrow = 0
+ data.currentcolumn = 0
+end
+
+function xtables.reflow_height()
+ data.currentrow = 0
+ data.currentcolumn = 0
+ local settings = data.settings
+ --
+ -- analyze ny
+ --
+ local nofrows = data.nofrows
+ local nofcolumns = data.nofcolumns
+ local widths = data.widths
+ local heights = data.heights
+ local depths = data.depths
+ --
+ for r=1,nofrows do
+ for c=1,nofcolumns do
+ local drc = data.rows[r][c]
+ if drc then
+ local ny = drc.ny
+ if ny > 1 then
+ local height = heights[r]
+ local depth = depths[r]
+ local total = height + depth
+ local htdp = drc.ht + drc.dp
+ for y=1,ny-1 do
+ local nxt = r + y
+ total = total + heights[nxt] + depths[nxt]
+ end
+ local delta = htdp - total
+ if delta > 0 then
+ delta = delta / ny
+ for y=0,ny-1 do
+ local nxt = r + y
+ heights[nxt] = heights[nxt] + delta
+ end
+ end
+ end
+ end
+ end
+ end
+ --
+ if settings.options[v_height] then
+ local totalheight = 0
+ local totaldepth = 0
+ for i=1,nofrows do
+ totalheight = totalheight + heights[i]
+ totalheight = totalheight + depths [i]
+ end
+ local total = totalheight + totaldepth
+ local leftover = settings.textheight - total
+ if leftover > 0 then
+ local leftheight = (totalheight / total) * leftover / #heights
+ local leftdepth = (totaldepth / total) * leftover / #depths
+ for i=1,nofrows do
+ heights[i] = heights[i] + leftheight
+ depths [i] = depths [i] + leftdepth
+ end
+ end
+ end
+end
+
+local function showspans(data)
+ local rows = data.rows
+ local modes = data.modes
+ local nofcolumns = data.nofcolumns
+ local nofrows = data.nofrows
+ for r=1,nofrows do
+ local line = { }
+ local row = rows[r]
+ for c=1,nofcolumns do
+ local cell =row[c]
+ if cell.list then
+ line[#line+1] = "list"
+ elseif cell.span then
+ line[#line+1] = "span"
+ else
+ line[#line+1] = "none"
+ end
+ end
+ report_xtable("%3d : %s : % t",r,namedmodes[modes[r]] or "----",line)
+ end
+end
+
+function xtables.construct()
+ local rows = data.rows
+ local heights = data.heights
+ local depths = data.depths
+ local widths = data.widths
+ -- local spans = data.spans
+ local distances = data.distances
+ local modes = data.modes
+ local settings = data.settings
+ local nofcolumns = data.nofcolumns
+ local nofrows = data.nofrows
+ local columndistance = settings.columndistance
+ local rowdistance = settings.rowdistance
+ local leftmargindistance = settings.leftmargindistance
+ local rightmargindistance = settings.rightmargindistance
+ local rowproperties = data.rowproperties
+ -- ranges can be mixes so we collect
+
+ if trace_xtable then
+ showspans(data)
+ end
+
+ local ranges = {
+ [head_mode] = { },
+ [foot_mode] = { },
+ [more_mode] = { },
+ [body_mode] = { },
+ }
+ for r=1,nofrows do
+ local m = modes[r]
+ if m == 0 then
+ m = body_mode
+ end
+ local range = ranges[m]
+ range[#range+1] = r
+ end
+ -- todo: hook in the splitter ... the splitter can ask for a chunk of
+ -- a certain size ... no longer a split memory issue then and header
+ -- footer then has to happen here too .. target height
+ local function packaged_column(r)
+ local row = rows[r]
+ local start = nil
+ local stop = nil
+ if leftmargindistance > 0 then
+ start = new_kern(leftmargindistance)
+ stop = start
+ end
+ local hasspan = false
+ for c=1,nofcolumns do
+ local drc = row[c]
+ if not hasspan then
+ hasspan = drc.span
+ end
+ local list = drc.list
+ if list then
+ local w, h, d = getwhd(list)
+ setshift(list,h+d)
+ -- list = hpacknodelist(list) -- is somehow needed
+ -- setwhd(list,0,0,0)
+ -- faster:
+ local h = new_hlist(list)
+ list = h
+ --
+ if start then
+ setlink(stop,list)
+ else
+ start = list
+ end
+ stop = list
+ end
+ local step = widths[c]
+ if c < nofcolumns then
+ step = step + columndistance + distances[c]
+ end
+ local kern = new_kern(step)
+ if stop then
+ setlink(stop,kern)
+ else -- can be first spanning next row (ny=...)
+ start = kern
+ end
+ stop = kern
+ end
+ if start then
+ if rightmargindistance > 0 then
+ local kern = new_kern(rightmargindistance)
+ setlink(stop,kern)
+ -- stop = kern
+ end
+ return start, heights[r] + depths[r], hasspan
+ end
+ end
+ local function collect_range(range)
+ local result, nofr = { }, 0
+ local nofrange = #range
+ for i=1,#range do
+ local r = range[i]
+ -- local row = rows[r]
+ local list, size, hasspan = packaged_column(r)
+ if list then
+ if hasspan and nofr > 0 then
+ result[nofr][4] = true
+ end
+ nofr = nofr + 1
+ local rp = rowproperties[r]
+ -- we have a direction issue here but hpacknodelist(list,0,"exactly") cannot be used
+ -- due to the fact that we need the width
+ local hbox = hpacknodelist(list)
+ setdirection(hbox,lefttoright_code)
+ result[nofr] = {
+ hbox,
+ size,
+ i < nofrange and rowdistance > 0 and rowdistance or false, -- might move
+ false,
+ rp or false,
+ }
+ end
+ end
+ if nofr > 0 then
+ -- the [5] slot gets the after break
+ result[1] [5] = false
+ result[nofr][5] = false
+ for i=2,nofr-1 do
+ local r = result[i][5]
+ if r == v_both or r == v_before then
+ result[i-1][5] = true
+ elseif r == v_after then
+ result[i][5] = true
+ end
+ end
+ end
+ return result
+ end
+ local body = collect_range(ranges[body_mode])
+ data.results = {
+ [head_mode] = collect_range(ranges[head_mode]),
+ [foot_mode] = collect_range(ranges[foot_mode]),
+ [more_mode] = collect_range(ranges[more_mode]),
+ [body_mode] = body,
+ }
+ if #body == 0 then
+ texsetcount("global",c_tabl_x_state,0)
+ texsetdimen("global",d_tabl_x_final_width,0)
+ else
+ texsetcount("global",c_tabl_x_state,1)
+ texsetdimen("global",d_tabl_x_final_width,getwidth(body[1][1]))
+ end
+end
+
+-- todo: join as that is as efficient as fushing multiple
+
+local function inject(row,copy,package)
+ local list = row[1]
+ if copy then
+ row[1] = copynodelist(list)
+ end
+ if package then
+ ctx_beginvbox()
+ ctxnode(tonode(list))
+ ctxnode(tonode(new_kern(row[2])))
+ ctx_endvbox()
+ ctx_nointerlineskip() -- figure out a better way
+ if row[4] then
+ -- nothing as we have a span
+ elseif row[5] then
+ if row[3] then
+ ctx_blank { v_samepage, row[3] .. "sp" }
+ else
+ ctx_blank { v_samepage }
+ end
+ elseif row[3] then
+ ctx_blank { row[3] .. "sp" } -- why blank ?
+ else
+ ctxnode(tonode(new_glue(0)))
+ end
+ else
+ ctxnode(tonode(list))
+ ctxnode(tonode(new_kern(row[2])))
+ if row[3] then
+ ctxnode(tonode(new_glue(row[3])))
+ end
+ end
+end
+
+local function total(row,distance)
+ local n = #row > 0 and rowdistance or 0
+ for i=1,#row do
+ local ri = row[i]
+ n = n + ri[2] + (ri[3] or 0)
+ end
+ return n
+end
+
+-- local function append(list,what)
+-- for i=1,#what do
+-- local l = what[i]
+-- list[#list+1] = l[1]
+-- local k = l[2] + (l[3] or 0)
+-- if k ~= 0 then
+-- list[#list+1] = new_kern(k)
+-- end
+-- end
+-- end
+
+local function spanheight(body,i)
+ local height, n = 0, 1
+ while true do
+ local bi = body[i]
+ if bi then
+ height = height + bi[2] + (bi[3] or 0)
+ if bi[4] then
+ n = n + 1
+ i = i + 1
+ else
+ break
+ end
+ else
+ break
+ end
+ end
+ return height, n
+end
+
+function xtables.flush(directives) -- todo split by size / no inbetween then .. glue list kern blank
+ local height = directives.height
+ local method = directives.method or v_normal
+ local settings = data.settings
+ local results = data.results
+ local rowdistance = settings.rowdistance
+ local head = results[head_mode]
+ local foot = results[foot_mode]
+ local more = results[more_mode]
+ local body = results[body_mode]
+ local repeatheader = settings.header == v_repeat
+ local repeatfooter = settings.footer == v_repeat
+ if height and height > 0 then
+ ctx_beginvbox()
+ local bodystart = data.bodystart or 1
+ local bodystop = data.bodystop or #body
+ if bodystart > 0 and bodystart <= bodystop then
+ local bodysize = height
+ local footsize = total(foot,rowdistance)
+ local headsize = total(head,rowdistance)
+ local moresize = total(more,rowdistance)
+ local firstsize, firstspans = spanheight(body,bodystart)
+ if bodystart == 1 then -- first chunk gets head
+ bodysize = bodysize - headsize - footsize
+ if headsize > 0 and bodysize >= firstsize then
+ for i=1,#head do
+ inject(head[i],repeatheader)
+ end
+ if rowdistance > 0 then
+ ctxnode(tonode(new_glue(rowdistance)))
+ end
+ if not repeatheader then
+ results[head_mode] = { }
+ end
+ end
+ elseif moresize > 0 then -- following chunk gets next
+ bodysize = bodysize - footsize - moresize
+ if bodysize >= firstsize then
+ for i=1,#more do
+ inject(more[i],true)
+ end
+ if rowdistance > 0 then
+ ctxnode(tonode(new_glue(rowdistance)))
+ end
+ end
+ elseif headsize > 0 and repeatheader then -- following chunk gets head
+ bodysize = bodysize - footsize - headsize
+ if bodysize >= firstsize then
+ for i=1,#head do
+ inject(head[i],true)
+ end
+ if rowdistance > 0 then
+ ctxnode(tonode(new_glue(rowdistance)))
+ end
+ end
+ else -- following chunk gets nothing
+ bodysize = bodysize - footsize
+ end
+ if bodysize >= firstsize then
+ local i = bodystart
+ while i <= bodystop do -- room for improvement
+ local total, spans = spanheight(body,i)
+ local bs = bodysize - total
+ if bs > 0 then
+ bodysize = bs
+ for s=1,spans do
+ inject(body[i])
+ body[i] = nil
+ i = i + 1
+ end
+ bodystart = i
+ else
+ break
+ end
+ end
+ if bodystart > bodystop then
+ -- all is flushed and footer fits
+ if footsize > 0 then
+ if rowdistance > 0 then
+ ctxnode(tonode(new_glue(rowdistance)))
+ end
+ for i=1,#foot do
+ inject(foot[i])
+ end
+ results[foot_mode] = { }
+ end
+ results[body_mode] = { }
+ texsetcount("global",c_tabl_x_state,0)
+ else
+ -- some is left so footer is delayed
+ -- todo: try to flush a few more lines
+ if repeatfooter and footsize > 0 then
+ if rowdistance > 0 then
+ ctxnode(tonode(new_glue(rowdistance)))
+ end
+ for i=1,#foot do
+ inject(foot[i],true)
+ end
+ else
+ -- todo: try to fit more of body
+ end
+ texsetcount("global",c_tabl_x_state,2)
+ end
+ else
+ if firstsize > height then
+ -- get rid of the too large cell
+ for s=1,firstspans do
+ inject(body[bodystart])
+ body[bodystart] = nil
+ bodystart = bodystart + 1
+ end
+ end
+ texsetcount("global",c_tabl_x_state,2) -- 1
+ end
+ else
+ texsetcount("global",c_tabl_x_state,0)
+ end
+ data.bodystart = bodystart
+ data.bodystop = bodystop
+ ctx_endvbox()
+ else
+ if method == variables.split then
+ -- maybe also a non float mode with header/footer repeat although
+ -- we can also use a float without caption
+ for i=1,#head do
+ inject(head[i],false,true)
+ end
+ if #head > 0 and rowdistance > 0 then
+ ctx_blank { rowdistance .. "sp" }
+ end
+ for i=1,#body do
+ inject(body[i],false,true)
+ end
+ if #foot > 0 and rowdistance > 0 then
+ ctx_blank { rowdistance .. "sp" }
+ end
+ for i=1,#foot do
+ inject(foot[i],false,true)
+ end
+ else -- normal
+ ctx_beginvbox()
+ for i=1,#head do
+ inject(head[i])
+ end
+ if #head > 0 and rowdistance > 0 then
+ ctxnode(tonode(new_glue(rowdistance)))
+ end
+ for i=1,#body do
+ inject(body[i])
+ end
+ if #foot > 0 and rowdistance > 0 then
+ ctxnode(tonode(new_glue(rowdistance)))
+ end
+ for i=1,#foot do
+ inject(foot[i])
+ end
+ ctx_endvbox()
+ end
+ results[head_mode] = { }
+ results[body_mode] = { }
+ results[foot_mode] = { }
+ texsetcount("global",c_tabl_x_state,0)
+ end
+end
+
+function xtables.cleanup()
+ for mode, result in next, data.results do
+ for _, r in next, result do
+ flushnodelist(r[1])
+ end
+ end
+
+ -- local rows = data.rows
+ -- for i=1,#rows do
+ -- local row = rows[i]
+ -- for i=1,#row do
+ -- local cell = row[i]
+ -- local list = cell.list
+ -- if list then
+ -- cell.width, cell.height, cell.depth = getwhd(list)
+ -- cell.list = true
+ -- end
+ -- end
+ -- end
+ -- data.result = nil
+
+ data = table.remove(stack)
+end
+
+function xtables.next_row(specification)
+ local r = data.currentrow + 1
+ data.modes[r] = texgetcount(c_tabl_x_mode)
+ data.currentrow = r
+ data.currentcolumn = 0
+ data.rowproperties[r] = specification
+end
+
+function xtables.finish_row()
+ local c = data.currentcolumn
+ local r = data.currentrow
+ local d = data.rows[r][c]
+ local n = data.nofcolumns - c
+ if d then
+ local nx = d.nx
+ if nx > 0 then
+ n = n - nx + 1
+ end
+ end
+ if n > 0 then
+ for i=1,n do
+ ctx_dummyxcell()
+ end
+ end
+end
+
+-- eventually we might only have commands
+
+implement {
+ name = "x_table_create",
+ actions = xtables.create,
+ arguments = {
+ {
+ { "option" },
+ { "textwidth", "dimen" },
+ { "textheight", "dimen" },
+ { "maxwidth", "dimen" },
+ { "lineheight", "dimen" },
+ { "columndistance", "dimen" },
+ { "leftmargindistance", "dimen" },
+ { "rightmargindistance", "dimen" },
+ { "rowdistance", "dimen" },
+ { "header" },
+ { "footer" },
+ }
+ }
+}
+
+implement {
+ name = "x_table_flush",
+ actions = xtables.flush,
+ arguments = {
+ {
+ { "method" },
+ { "height", "dimen" }
+ }
+ }
+}
+
+implement { name = "x_table_reflow_width", actions = xtables.reflow_width }
+implement { name = "x_table_reflow_height", actions = xtables.reflow_height }
+implement { name = "x_table_construct", actions = xtables.construct }
+implement { name = "x_table_cleanup", actions = xtables.cleanup }
+implement { name = "x_table_next_row", actions = xtables.next_row }
+implement { name = "x_table_next_row_option", actions = xtables.next_row, arguments = "string" }
+implement { name = "x_table_finish_row", actions = xtables.finish_row }
+implement { name = "x_table_init_reflow_width", actions = xtables.initialize_reflow_width }
+implement { name = "x_table_init_reflow_height", actions = xtables.initialize_reflow_height }
+implement { name = "x_table_init_reflow_width_option", actions = xtables.initialize_reflow_width, arguments = "string" }
+implement { name = "x_table_init_reflow_height_option", actions = xtables.initialize_reflow_height, arguments = "string" }
+implement { name = "x_table_init_construct", actions = xtables.initialize_construct }
+implement { name = "x_table_set_reflow_width", actions = xtables.set_reflow_width }
+implement { name = "x_table_set_reflow_height", actions = xtables.set_reflow_height }
+implement { name = "x_table_set_construct", actions = xtables.set_construct }
+implement { name = "x_table_r", actions = function() context(data.currentrow or 0) end }
+implement { name = "x_table_c", actions = function() context(data.currentcolumn or 0) end }
+
+-- experiment:
+
+do
+
+ local context = context
+ local ctxcore = context.core
+
+ local startxtable = ctxcore.startxtable
+ local stopxtable = ctxcore.stopxtable
+
+ local startcollecting = context.startcollecting
+ local stopcollecting = context.stopcollecting
+
+ function ctxcore.startxtable(...)
+ startcollecting()
+ startxtable(...)
+ end
+
+ function ctxcore.stopxtable()
+ stopxtable()
+ stopcollecting()
+ end
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/tabl-xtb.mklx b/Master/texmf-dist/tex/context/base/mkxl/tabl-xtb.mklx
index b15d99c1221..f7121dc5840 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/tabl-xtb.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/tabl-xtb.mklx
@@ -15,7 +15,27 @@
\writestatus{loading}{ConTeXt Table Macros / Xtreme}
-\registerctxluafile{tabl-xtb}{}
+\unprotect
+
+\newdimension\d_tabl_x_width \def\d_tabl_x_width_reference {\d_tabl_x_width }
+\newdimension\d_tabl_x_height \def\d_tabl_x_height_reference{\d_tabl_x_height}
+\newdimension\d_tabl_x_depth % not used
+\newdimension\d_tabl_x_distance
+\newdimension\d_tabl_x_final_width \def\d_tabl_x_final_width_reference{\d_tabl_x_final_width}
+\newinteger \c_tabl_x_nx
+\newinteger \c_tabl_x_ny
+\newinteger \c_tabl_x_mode
+\newbox \b_tabl_x
+\newinteger \c_tabl_x_state % 0=empty 1=content 3=splitleft
+\newinteger \c_tabl_x_nesting
+\newinteger \c_tabl_x_skip_mode % 1 = skip
+\newdimension\d_tabl_x_textwidth
+\newinteger \c_tabl_x_swapped
+\newinteger \c_tabl_x_swapped_max
+
+\protect
+
+\registerctxluafile{tabl-xtb}{autosuffix}
% todo:
%
@@ -82,23 +102,7 @@
{\signalcharacter}% not used
\to \everyenableelements
-\newdimen\d_tabl_x_width
-\newdimen\d_tabl_x_height
-\newdimen\d_tabl_x_depth % not used
-\newdimen\d_tabl_x_distance
-\newcount\c_tabl_x_nx
-\newcount\c_tabl_x_ny
-\newcount\c_tabl_x_mode
-\newbox \b_tabl_x
-\newcount\c_tabl_x_state % 0=empty 1=content 3=splitleft
-\newdimen\d_tabl_x_final_width
-\newcount\c_tabl_x_nesting
-\newcount\c_tabl_x_skip_mode % 1 = skip
-\newdimen\d_tabl_x_textwidth
-\newcount\c_tabl_x_swapped
-\newcount\c_tabl_x_swapped_max
-
-\let\m_tabl_x_swapped_settings\empty
+\lettonothing\m_tabl_x_swapped_settings
\aliased\let\currentxtablerow \clf_x_table_r
\aliased\let\currentxtablecolumn\clf_x_table_c
@@ -156,8 +160,8 @@
\c!rightmargindistance=\zeropoint,% whole table
]
-\def\tabl_x_default_buffer{x_table_\number\c_tabl_x_nesting}
-\let\tabl_x_current_buffer\empty
+\def \tabl_x_default_buffer{x_table_\number\c_tabl_x_nesting}
+\lettonothing\tabl_x_current_buffer
\permanent\protected\def\startxtable{\tabl_x_start_table}
@@ -169,7 +173,7 @@
% \permanent\protected\aliased\startxtable\tabl_x_start_table
-\aliased\permanent\let\stopxtable\relax
+\permanent\protected\lettonothing\stopxtable
% These direct buffers can be somewhat faster but it's probably neglectable.
% Anyway, no nesting is supported as we then need to catch (e.g.) rows and keep
@@ -204,19 +208,19 @@
\edef\tabl_x_current_buffer{embedded_x_table}%
\tabl_x_process}
-\aliased\permanent\let\stopembeddedxtable\relax
+\permanent\protected\lettonothing\stopembeddedxtable
%D We can also define xtables.
\appendtoks
- \permanent\setuevalue{\e!start\currentxtable}{\tabl_x_start_named[\currentxtable]}%
- \permanent\setuevalue{\e!stop \currentxtable}{\tabl_x_stop_named}%
+ \permanent\protected\edefcsname\e!start\currentxtable\endcsname{\tabl_x_start_named[\currentxtable]}%
+ \permanent\protected\edefcsname\e!stop \currentxtable\endcsname{\tabl_x_stop_named}%
\to \everydefinextable
\protected\def\tabl_x_start_named[#tag]#spacer[#settings]%
{\bgroup
\edef\currentxtable{#tag}%
- \advance\c_tabl_x_nesting\plusone
+ \advanceby\c_tabl_x_nesting\plusone
\dostarttaggedchained\t!table\empty\??xtable
\setupcurrentxtable[#settings]%
\tabl_x_check_textwidth
@@ -240,7 +244,7 @@
\newtoks\everypreparextable
\protected\def\tabl_x_prepare#settings%
- {\advance\c_tabl_x_nesting\plusone
+ {\advanceby\c_tabl_x_nesting\plusone
\dostarttaggedchained\t!table\empty\??xtable
\tabl_x_set_checked{#settings}%
\tabl_x_check_textwidth
@@ -248,7 +252,7 @@
}% else whitespace mess
\def\tabl_x_get_buffer
- {\clf_gettexbuffer{\tabl_x_current_buffer}}
+ {\clf_getbuffertex{\tabl_x_current_buffer}}
\let\tabl_x_start_row_yes \relax
\let\tabl_x_start_row_nop \relax
@@ -280,7 +284,7 @@
footer {\xtableparameter\c!footer}%
\relax
%
- \letxtableparameter\c!option\empty
+ \resetxtableparameter\c!option
% not so nice but needed as we use this in the setup
\linewidth\xtableparameter\c!rulethickness\relax
% so we freeze it
@@ -353,14 +357,14 @@
% in text flow: headers and footers only once
-\setvalue{\??xtableflushsplit\v!yes}%
+\defcsname\??xtableflushsplit\v!yes\endcsname
{\clf_x_table_flush
method {\v!split}%
\relax}
% in text flow: headers and footers only once
-\setvalue{\??xtableflushsplit\v!no}%
+\defcsname\??xtableflushsplit\v!no\endcsname
{% \noindent % gives extra line after table
% \noindentation % messes up the next indentation
% \dontleavehmode % no leftskip
@@ -373,11 +377,24 @@
% in text flow: headers and footers get repeated
-\setvalue{\??xtableflushsplit\v!repeat}%
+% \defcsname\??xtableflushsplit\v!repeat\endcsname
+% {\doloop
+% {\clf_x_table_flush
+% method {\v!split}%
+% height \ifdim\pagegoal=\maxdimen\textheight\else\pagegoal\fi
+% \relax
+% \ifcase\c_tabl_x_state
+% \exitloop
+% \else
+% \page
+% \fi}}
+
+\defcsname\??xtableflushsplit\v!repeat\endcsname
{\doloop
- {\clf_x_table_flush
+ {\testpage[5]% for now hard coded, just as the \lineheight below, see mail end of april 2021
+ \clf_x_table_flush
method {\v!split}%
- height \ifdim\pagegoal=\maxdimen\textheight\else\pagegoal\fi
+ height \ifdim\pagegoal=\maxdimen\textheight\else\dimexpr\pagegoal-\pagetotal-\lineheight\relax\fi
\relax
\ifcase\c_tabl_x_state
\exitloop
@@ -385,7 +402,7 @@
\page
\fi}}
-% \setvalue{\??xtableflushsplit\v!setups}%
+% \defcsname\??xtableflushsplit\v!setups\endcsname
% {\directsetup{xtable:split:user}}
%
% \startsetups[xtable:split:user]
@@ -423,7 +440,7 @@
\d_split_minimum_free_space\dimexpr\extraxtablesplitheight+\xtableparameter\c!splitoffset\relax
%\c_split_minimum_free_lines\plustwo % not needed here as we're precise enough
\let\tsplitdirectsplitter\tabl_x_split_splitter
- \let\tsplitdirectwidth \d_tabl_x_final_width
+ \let\tsplitdirectwidth \d_tabl_x_final_width_reference
\handledirecttsplit}
\protected\def\tabl_x_split_splitter#height%
@@ -614,7 +631,7 @@
\fi
\setupcurrentxtable[#settings]%
\relax
- \letxtableparameter\c!width\d_tabl_x_width % overloads given width
+ \letxtableparameter\c!width\d_tabl_x_width_reference % overloads given width
\inheritedxtableframed\bgroup
\tabl_x_begin_of_cell
\fi}
@@ -627,7 +644,7 @@
\letxtableparameter\c!height\v!fit % overloads given height
\fi
\relax
- \letxtableparameter\c!width\d_tabl_x_width % overloads given width
+ \letxtableparameter\c!width\d_tabl_x_width_reference % overloads given width
\inheritedxtableframed\bgroup
\tabl_x_begin_of_cell
\fi}
@@ -644,8 +661,8 @@
{\dostarttagged\t!tablecell\empty % can't we just tag the box
\setbox\b_tabl_x\hpack\bgroup
\setupcurrentxtable[#settings]%
- \letxtableparameter\c!width \d_tabl_x_width % overloads given width
- \letxtableparameter\c!height\d_tabl_x_height % overloads given height
+ \letxtableparameter\c!width \d_tabl_x_width_reference % overloads given width
+ \letxtableparameter\c!height\d_tabl_x_height_reference % overloads given height
\clf_x_table_init_construct
\inheritedxtableframed\bgroup
\tabl_x_begin_of_cell
@@ -654,8 +671,8 @@
\protected\def\tabl_x_start_cell_construct_nop
{\dostarttagged\t!tablecell\empty % can't we just tag the box
\setbox\b_tabl_x\hpack\bgroup
- \letxtableparameter\c!width \d_tabl_x_width % overloads given width
- \letxtableparameter\c!height\d_tabl_x_height % overloads given height (commenting it ... nice option)
+ \letxtableparameter\c!width \d_tabl_x_width_reference % overloads given width
+ \letxtableparameter\c!height\d_tabl_x_height_reference % overloads given height (commenting it ... nice option)
\clf_x_table_init_construct
\inheritedxtableframed\bgroup
\tabl_x_begin_of_cell
@@ -886,7 +903,7 @@
\expandafter\let\expandafter\t_tabl_x_swapped\csname\??xtableswap\number\c_tabl_x_swapped\endcsname}
\def\tabl_x_collect_advance
- {\global\advance\c_tabl_x_swapped\plusone
+ {\global\advanceby\c_tabl_x_swapped\plusone
\ifnum\c_tabl_x_swapped>\c_tabl_x_swapped_max
\global\c_tabl_x_swapped_max\c_tabl_x_swapped
\fi
diff --git a/Master/texmf-dist/tex/context/base/mkxl/task-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/task-ini.lmt
new file mode 100644
index 00000000000..6d4ebfcc2d4
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/task-ini.lmt
@@ -0,0 +1,228 @@
+if not modules then modules = { } end modules ['task-ini'] = {
+ version = 1.001,
+ comment = "companion to task-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- this is a temporary solution, we need to isolate some modules and then
+-- the load order can determine the trickery to be applied to node lists
+--
+-- we can disable more handlers and enable then when really used (*)
+--
+-- todo: two finalizers: real shipout (can be imposed page) and page shipout (individual page)
+--
+-- todo: consider moving the kernel kerning/ligaturing functions in the main font loop because
+-- there we know if they are needed; doesn't save time but; if we overload unh* commands to
+-- not apply the font handler, we can remove all checks for subtypes 255
+
+local tasks = nodes.tasks
+local appendaction = tasks.appendaction
+local disableaction = tasks.disableaction
+local enableaction = tasks.enableaction
+local freezegroup = tasks.freezegroup
+local freezecallbacks = callbacks.freeze
+
+------------("processors", "before", "nodes.properties.attach", nil, "nut", "enabled" )
+
+appendaction("processors", "normalizers", "builders.kernel.collapsing", nil, "nut", "enabled" )
+appendaction("processors", "normalizers", "typesetters.periodkerns.handler", nil, "nut", "disabled" )
+appendaction("processors", "normalizers", "languages.replacements.handler", nil, "nut", "disabled" )
+appendaction("processors", "normalizers", "typesetters.wrappers.handler", nil, "nut", "disabled" )
+appendaction("processors", "normalizers", "typesetters.characters.handler", nil, "nut", "enabled" )
+appendaction("processors", "normalizers", "fonts.collections.process", nil, "nut", "disabled" )
+appendaction("processors", "normalizers", "fonts.checkers.missing", nil, "nut", "disabled" )
+
+appendaction("processors", "characters", "scripts.autofontfeature.handler", nil, "nut", "disabled" )
+appendaction("processors", "characters", "scripts.splitters.handler", nil, "nut", "disabled" )
+appendaction("processors", "characters", "typesetters.cleaners.handler", nil, "nut", "disabled" )
+appendaction("processors", "characters", "typesetters.directions.handler", nil, "nut", "disabled" )
+appendaction("processors", "characters", "typesetters.cases.handler", nil, "nut", "disabled" )
+appendaction("processors", "characters", "typesetters.breakpoints.handler", nil, "nut", "disabled" )
+appendaction("processors", "characters", "scripts.injectors.handler", nil, "nut", "disabled" )
+
+appendaction("processors", "words", "languages.words.check", nil, "nut", "disabled" )
+appendaction("processors", "words", "languages.hyphenators.handler", nil, "nut", "enabled" )
+appendaction("processors", "words", "typesetters.initials.handler", nil, "nut", "disabled" )
+appendaction("processors", "words", "typesetters.firstlines.handler", nil, "nut", "disabled" )
+
+appendaction("processors", "fonts", "builders.paragraphs.solutions.splitters.split", nil, "nut", "disabled" )
+appendaction("processors", "fonts", "nodes.handlers.characters", nil, "nut", "enabled" )
+appendaction("processors", "fonts", "nodes.injections.handler", nil, "nut", "enabled" )
+appendaction("processors", "fonts", "typesetters.fontkerns.handler", nil, "nut", "disabled" )
+appendaction("processors", "fonts", "nodes.handlers.protectglyphs", nil, "nonut", "enabled" )
+appendaction("processors", "fonts", "builders.kernel.ligaturing", nil, "nut", "disabled" )
+appendaction("processors", "fonts", "builders.kernel.kerning", nil, "nut", "disabled" )
+appendaction("processors", "fonts", "nodes.handlers.show", nil, "nut", "disabled" )
+appendaction("processors", "fonts", "nodes.handlers.stripping", nil, "nut", "disabled" )
+appendaction("processors", "fonts", "nodes.handlers.flatten", nil, "nut", "disabled" )
+appendaction("processors", "fonts", "fonts.goodies.colorschemes.coloring", nil, "nut", "disabled" )
+
+appendaction("processors", "lists", "typesetters.rubies.check", nil, "nut", "disabled" )
+appendaction("processors", "lists", "typesetters.characteralign.handler", nil, "nut", "disabled" )
+appendaction("processors", "lists", "typesetters.spacings.handler", nil, "nut", "disabled" )
+appendaction("processors", "lists", "typesetters.kerns.handler", nil, "nut", "disabled" )
+appendaction("processors", "lists", "typesetters.digits.handler", nil, "nut", "disabled" )
+appendaction("processors", "lists", "typesetters.italics.handler", nil, "nut", "disabled" )
+appendaction("processors", "lists", "languages.visualizediscretionaries", nil, "nut", "disabled" )
+
+appendaction("processors", "after", "typesetters.marksuspects", nil, "nut", "disabled" )
+
+appendaction("shipouts", "normalizers", "nodes.handlers.cleanuppage", nil, "nut", "production")
+appendaction("shipouts", "normalizers", "typesetters.showsuspects", nil, "nut", "disabled" )
+appendaction("shipouts", "normalizers", "typesetters.margins.finalhandler", nil, "nut", "disabled" )
+appendaction("shipouts", "normalizers", "builders.paragraphs.expansion.trace", nil, "nut", "disabled" )
+appendaction("shipouts", "normalizers", "typesetters.alignments.handler", nil, "nut", "disabled" )
+appendaction("shipouts", "normalizers", "nodes.references.handler", nil, "nut", "production")
+appendaction("shipouts", "normalizers", "nodes.destinations.handler", nil, "nut", "production")
+appendaction("shipouts", "normalizers", "nodes.rules.handler", nil, "nut", "disabled" )
+appendaction("shipouts", "normalizers", "nodes.shifts.handler", nil, "nut", "disabled" )
+appendaction("shipouts", "normalizers", "structures.tags.handler", nil, "nut", "disabled" )
+appendaction("shipouts", "normalizers", "nodes.handlers.accessibility", nil, "nut", "disabled" )
+appendaction("shipouts", "normalizers", "nodes.handlers.backgrounds", nil, "nut", "disabled" )
+appendaction("shipouts", "normalizers", "typesetters.rubies.attach", nil, "nut", "disabled" )
+------------("shipouts", "normalizers", "nodes.properties.delayed", nil, "nut", "production")
+appendaction("shipouts", "normalizers", "nodes.tracers.directions", nil, "nut", "disabled" )
+
+appendaction("shipouts", "finishers", "nodes.visualizers.handler", nil, "nut", "disabled" )
+appendaction("shipouts", "finishers", "attributes.colors.handler", nil, "nut", "disabled" )
+appendaction("shipouts", "finishers", "attributes.transparencies.handler", nil, "nut", "disabled" )
+appendaction("shipouts", "finishers", "attributes.colorintents.handler", nil, "nut", "disabled" )
+appendaction("shipouts", "finishers", "attributes.negatives.handler", nil, "nut", "disabled" )
+appendaction("shipouts", "finishers", "attributes.effects.handler", nil, "nut", "disabled" )
+appendaction("shipouts", "finishers", "attributes.alternates.handler", nil, "nut", "disabled" )
+appendaction("shipouts", "finishers", "attributes.viewerlayers.handler", nil, "nut", "disabled" )
+
+appendaction("shipouts", "wrapup", "nodes.handlers.export", nil, "nut", "disabled" ) -- always last
+appendaction("shipouts", "wrapup", "luatex.synctex.collect", nil, "nut", "disabled" )
+
+appendaction("math", "normalizers", "noads.handlers.showtree", nil, "nonut", "disabled" )
+appendaction("math", "normalizers", "noads.handlers.collapse", nil, "nonut", "disabled" ) -- first time
+appendaction("math", "normalizers", "noads.handlers.numbers", nil, "nonut", "disabled" )
+appendaction("math", "normalizers", "noads.handlers.spacing", nil, "nonut", "disabled" )
+appendaction("math", "normalizers", "noads.handlers.fencing", nil, "nonut", "disabled" )
+appendaction("math", "normalizers", "noads.handlers.unscript", nil, "nonut", "enabled" )
+appendaction("math", "normalizers", "noads.handlers.unstack", nil, "nonut", "disabled" )
+appendaction("math", "normalizers", "noads.handlers.relocate", nil, "nonut", "enabled" )
+appendaction("math", "normalizers", "noads.handlers.variants", nil, "nonut", "enabled" )
+appendaction("math", "normalizers", "noads.handlers.families", nil, "nonut", "enabled" )
+appendaction("math", "normalizers", "noads.handlers.render", nil, "nonut", "enabled" )
+appendaction("math", "normalizers", "noads.handlers.collapse", nil, "nonut", "disabled" ) -- second time
+appendaction("math", "normalizers", "noads.handlers.fixscripts", nil, "nonut", "enabled" )
+------------("math", "normalizers", "noads.handlers.domains", nil, "nonut", "disabled" )
+appendaction("math", "normalizers", "noads.handlers.autofences", nil, "nonut", "disabled" )
+appendaction("math", "normalizers", "noads.handlers.resize", nil, "nonut", "enabled" )
+------------("math", "normalizers", "noads.handlers.respace", nil, "nonut", "enabled" )
+appendaction("math", "normalizers", "noads.handlers.alternates", nil, "nonut", "enabled" )
+appendaction("math", "normalizers", "noads.handlers.tags", nil, "nonut", "disabled" )
+------------("math", "normalizers", "noads.handlers.italics", nil, "nonut", "disabled" ) -- replaced
+appendaction("math", "normalizers", "noads.handlers.kernpairs", nil, "nonut", "disabled" )
+appendaction("math", "normalizers", "noads.handlers.classes", nil, "nonut", "disabled" )
+appendaction("math", "normalizers", "noads.handlers.dictionaries", nil, "nonut", "enabled" )
+appendaction("math", "normalizers", "noads.handlers.suspicious", nil, "nonut", "enabled" )
+
+appendaction("math", "builders", "builders.kernel.mlisttohlist", nil, "nut", "enabled" ) -- mandate
+------------("math", "builders", "typesetters.directions.processmath", nil, "nut", "disabled" )
+appendaction("math", "builders", "noads.handlers.makeup", nil, "nonut", "disabled" )
+------------("math", "builders", "noads.handlers.align", nil, "nonut", "enabled" )
+
+appendaction("math", "finalizers", "noads.handlers.normalize", nil, "nonut", "enabled" )
+appendaction("math", "finalizers", "noads.handlers.snap", nil, "nonut", "disabled" )
+
+appendaction("finalizers", "lists", "nodes.handlers.showhyphenation", nil, "nut", "disabled" )
+appendaction("finalizers", "lists", "nodes.handlers.visualizehyphenation", nil, "nut", "disabled" )
+
+appendaction("finalizers", "lists", "typesetters.margins.localhandler", nil, "nut", "disabled" )
+appendaction("finalizers", "lists", "builders.paragraphs.keeptogether", nil, "nut", "disabled" )
+appendaction("finalizers", "fonts", "builders.paragraphs.solutions.splitters.optimize", nil, "nonut", "disabled" )
+appendaction("finalizers", "lists", "builders.paragraphs.tag", nil, "nut", "disabled" )
+appendaction("finalizers", "lists", "nodes.linefillers.handler", nil, "nut", "disabled" )
+
+appendaction("contributers", "normalizers", "nodes.handlers.flattenline", nil, "nut", "disabled" )
+appendaction("contributers", "normalizers", "nodes.handlers.textbackgrounds", nil, "nut", "disabled" )
+appendaction("contributers", "normalizers", "nodes.handlers.wipe", nil, "nut", "disabled" )
+
+appendaction("adjusters", "normalizers", "nodes.handlers.adjusters", nil, "nut", "enabled" )
+
+appendaction("vboxbuilders", "normalizers", "nodes.adaptive.handlehorizontal", nil, "nut", "disabled" )
+appendaction("vboxbuilders", "normalizers", "nodes.handlers.backgroundsvbox", nil, "nut", "disabled" )
+------------("vboxbuilders", "normalizers", "typesetters.margins.localhandler", nil, "nut", "disabled" )
+appendaction("vboxbuilders", "normalizers", "builders.vspacing.vboxhandler", nil, "nut", "enabled" )
+appendaction("vboxbuilders", "normalizers", "builders.profiling.vboxhandler", nil, "nut", "disabled" )
+appendaction("vboxbuilders", "normalizers", "builders.profiling.boxlinehandler", nil, "nut", "disabled" )
+appendaction("vboxbuilders", "normalizers", "typesetters.checkers.handler", nil, "nut", "disabled" )
+appendaction("vboxbuilders", "normalizers", "typesetters.synchronize.handler", nil, "nut", "disabled" )
+
+appendaction("mvlbuilders", "normalizers", "nodes.handlers.backgroundspage", nil, "nut", "disabled" )
+appendaction("mvlbuilders", "normalizers", "typesetters.margins.globalhandler", nil, "nut", "disabled" )
+appendaction("mvlbuilders", "normalizers", "nodes.handlers.migrate", nil, "nut", "disabled" )
+appendaction("mvlbuilders", "normalizers", "builders.vspacing.pagehandler", nil, "nut", "enabled" )
+appendaction("mvlbuilders", "normalizers", "builders.profiling.pagehandler", nil, "nut", "disabled" )
+appendaction("mvlbuilders", "normalizers", "builders.profiling.pagelinehandler", nil, "nut", "disabled" )
+appendaction("mvlbuilders", "normalizers", "typesetters.checkers.handler", nil, "nut", "disabled" )
+appendaction("mvlbuilders", "normalizers", "typesetters.synchronize.handler", nil, "nut", "disabled" )
+
+appendaction("vboxhandlers", "normalizers", "nodes.adaptive.handlevertical", nil, "nut", "disabled" )
+
+appendaction("everypar", "normalizers", "nodes.handlers.checkparcounter", nil, "nut", "disabled" )
+
+appendaction("alignments", "normalizers", "nodes.handlers.showpreamble", nil, "nut", "enabled" )
+appendaction("alignments", "normalizers", "nodes.handlers.aligncharacter", nil, "nut", "disabled" )
+appendaction("alignments", "normalizers", "nodes.handlers.fixmathalign", nil, "nut", "disabled" )
+appendaction("alignments", "normalizers", "nodes.handlers.mathmatrixornaments", nil, "nut", "disabled" )
+appendaction("alignments", "normalizers", "nodes.handlers.mathmatrixrules", nil, "nut", "disabled" )
+
+appendaction("localboxes", "lists", "typesetters.localboxes.handler", nil, "nut", "enabled" )
+
+-- some protection
+
+freezecallbacks("find_.*_file", "find file using resolver")
+freezecallbacks("read_.*_file", "read file at once")
+freezecallbacks("open_.*_file", "open file for reading")
+
+-- experimental (needs to be updated):
+
+freezegroup("processors", "normalizers")
+freezegroup("processors", "characters")
+freezegroup("processors", "words")
+freezegroup("processors", "fonts")
+freezegroup("processors", "lists")
+
+freezegroup("finalizers", "normalizers")
+freezegroup("finalizers", "fonts")
+freezegroup("finalizers", "lists")
+
+freezegroup("math", "normalizers")
+freezegroup("math", "builders")
+
+freezegroup("shipouts", "normalizers")
+freezegroup("shipouts", "finishers")
+freezegroup("shipouts", "wrapup")
+
+freezegroup("mvlbuilders", "normalizers")
+freezegroup("vboxbuilders", "normalizers")
+
+-----------("parbuilders", "lists")
+-----------("pagebuilders", "lists")
+
+freezegroup("math", "normalizers")
+freezegroup("math", "builders")
+
+freezegroup("everypar", "normalizers")
+
+freezegroup("alignments", "normalizers")
+
+-----------("localboxes", "lists")
+
+-- new: disabled here
+
+directives.register("nodes.basepass", function(v)
+ if v then
+ enableaction("processors", "builders.kernel.ligaturing")
+ enableaction("processors", "builders.kernel.kerning")
+ else
+ disableaction("processors", "builders.kernel.ligaturing")
+ disableaction("processors", "builders.kernel.kerning")
+ end
+end)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/toks-aux.lmt b/Master/texmf-dist/tex/context/base/mkxl/toks-aux.lmt
index 03f4dc2c106..83e714d7738 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/toks-aux.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/toks-aux.lmt
@@ -5,11 +5,31 @@ if not modules then modules = { } end modules ['toks-aux'] = {
license = "see context related readme files"
}
-local type, tostring = type, tostring
+local type, tostring, next = type, tostring, next
local max = math.max
-local formatters, gsub, char = string.formatters, string.gsub, string.char
+local formatters, gsub, char, gmatch = string.formatters, string.gsub, string.char, string.gmatch
local concat = table.concat
+do
+
+ -- tex.magicconstants = { -- we use tex.constants for something else
+ -- running = -1073741824, -- null_flag
+ -- maxdimen = 1073741823, -- max_dimen
+ -- -- trueinch = 4736286, -- obsolete
+ -- }
+
+ local c = status.getconstants()
+ local t = { }
+ for k, v in next, c do
+ t[gsub(k,"_","")] = v
+ end
+
+ tex.magicconstants = table.setmetatableindex(t,c)
+
+end
+
+-- todo : locals from scanners
+
local function flags(t)
if type(t) == "string" then
t = token.create(t)
@@ -24,6 +44,7 @@ local function flags(t)
if t.instance then r[#r+1] = "instance" end
if t.tolerant then r[#r+1] = "tolerant" end
if t.protected then r[#r+1] = "protected" end
+ if t.constant then r[#r+1] = "constant" end
return r
end
@@ -37,27 +58,27 @@ interfaces.implement {
local f0 = formatters["%s: %s"]
local nl = logs.newline
local wr = logs.writer
- local t = token.peek_next() -- local t = token.scan_next() token.put_back(t)
+ local t = token.peeknext() -- local t = token.scannext() token.putback(t)
local n = ""
local w = ""
local c = t.cmdname
if c == "left_brace" then
w = "given token list"
- t = token.scan_toks(false)
+ t = token.scantoks(false)
elseif c == "register_toks" then
- token.scan_next()
+ token.scannext()
w = "token register"
n = t.csname or t.index
t = tex.gettoks(n,true)
elseif c == "internal_toks" then
- token.scan_next()
+ token.scannext()
w = "internal token variable"
n = t.csname or t.index
t = tex.gettoks(n,true)
else
- n = token.scan_csname()
+ n = token.scancsname()
local r = flags(t)
- local m = token.get_meaning(n,true)
+ local m = token.getmeaning(n,true)
r[#r+1] = "control sequence"
if type(m) == "table" then
t = m
@@ -99,6 +120,7 @@ interfaces.implement {
elseif cn == "letter" or cn == "other char" then
wr(f3(id,cd,ix,cn,ix))
elseif cn == "match" then
+ -- needs checking for additions
local s
if ix == 32 then s = "optional spacer" -- space
elseif ix == 42 then s = "skip spaces" -- *
@@ -128,56 +150,74 @@ interfaces.implement {
-- For the moment here, will move to initex only (also see node-ini.lua); we need
-- to actually store these.
-local groupcodes = { }
-local glyphoptioncodes = { }
-local hyphenationcodes = { }
-local frozenparcodes = { }
-local flagcodes = { }
-local normalizecodes = { }
+local context = context
-for k, v in next, tex.getgroupvalues() do
- groupcodes[k] = gsub(v,"[_ ]","")
-end
-for k, v in next, tex.gethyphenationvalues() do
- hyphenationcodes[k] = gsub(v,"[_ ]","")
-end
-for k, v in next, tex.getglyphoptionvalues() do
- glyphoptioncodes[k] = gsub(v,"[_ ]","")
-end
-for k, v in next, tex.getfrozenparvalues() do
- frozenparcodes[k] = gsub(v,"[_ ]","")
-end
-for k, v in next, tex.getflagvalues() do
- flagcodes[k] = gsub(v,"[_ ]","")
-end
-for k, v in next, tex.getnormalizevalues() do
- normalizecodes[k] = gsub(v,"[_ ]","")
+local function getthem(getter,post)
+ local codes = { }
+ if getter then
+ local texintegerdef = tex.integerdef
+ for k, v in next, getter() do
+ codes[k] = gsub(v,"[_ ]","")
+ end
+ if post and post ~= "" then
+ if environment.initex then
+ for k, v in next, codes do
+ texintegerdef(v .. post,k,"immutable")
+ end
+ end
+ interfaces.implement {
+ name = post .. "string",
+ public = true,
+ arguments = "integer",
+ actions = function(i)
+ context(codes[i] or "unknown")
+ end
+ }
+ end
+ end
+ return utilities.storage.allocate(table.swapped(codes,codes))
end
+tex.discoptioncodes = getthem(tex.getdiscoptionvalues, "discoptioncode")
+tex.flagcodes = getthem(tex.getflagvalues, "flagcode" )
+tex.frozenparcodes = getthem(tex.getfrozenparvalues, "frozenparcode")
+tex.glyphoptioncodes = getthem(tex.getglyphoptionvalues, "glyphoptioncode")
+tex.groupcodes = getthem(tex.getgroupvalues, "groupcode")
+tex.hyphenationcodes = getthem(tex.gethyphenationvalues, "hyphenationcode")
+tex.mathcontrolcodes = getthem(tex.getmathcontrolvalues, "mathcontrolcode")
+---.mathflattencodes = getthem(tex.getmathflattenvalues, "mathflattencode")
+tex.noadoptioncodes = getthem(tex.getnoadoptionvalues ) -- only at lua end
+tex.normalizelinecodes = getthem(tex.getnormalizelinevalues, "normalizecode") -- we keep the short name
+tex.normalizeparcodes = getthem(tex.getnormalizeparvalues, "normalizeparcode")
+tex.automigrationcodes = getthem(tex.getautomigrationvalues, "automigrationcode")
+tex.parcontextcodes = getthem(tex.getparcontextvalues, "parcontextcode")
+tex.textcontrolcodes = getthem(tex.gettextcontrolvalues ) -- only at lua end
+tex.listanchorcodes = getthem(tex.getlistanchorvalues, "listanchorcode")
+tex.listsigncodes = getthem(tex.getlistsignvalues, "listsigncode")
+tex.classoptioncodes = getthem(tex.getmathclassoptionvalues, "classoptioncode")
+---.alignmentcontextcodes = getthem(tex.getalignmentcontextvalues ) -- only at lua end
+tex.specialmathclasscodes = getthem(tex.getspecialmathclassvalues ) -- only at lua end
-if environment.initex then
-
- local texintegerdef = tex.integerdef
-
- for k, v in next, groupcodes do texintegerdef(v .. "groupcode", k,"immutable") end
- for k, v in next, glyphoptioncodes do texintegerdef(v .. "code", k,"immutable") end
- for k, v in next, hyphenationcodes do texintegerdef(v .. "hyphenationmodecode",k,"immutable") end
- for k, v in next, frozenparcodes do texintegerdef("frozen" .. v .. "code", k,"immutable") end
- for k, v in next, flagcodes do texintegerdef(v .. "flagcode", k,"immutable") end
- for k, v in next, normalizecodes do texintegerdef(v .. "code", k,"immutable") end
-
+function tex.stringtocodesbitmap(str,codes)
+ local bitmap = 0
+ if codes then
+ if not str or str == "" then
+ -- zero
+ elseif str == "all" then
+ for k in next, codes do
+ if type(k) == "number" then
+ bitmap = bitmap | k
+ end
+ end
+ else
+ str = gsub(str,"[_ ]","")
+ for s in gmatch(str,"[^%,]+") do
+ local b = codes[s]
+ if b then
+ bitmap = bitmap | b
+ end
+ end
+ end
+ end
+ return bitmap
end
-
-groupcodes = utilities.storage.allocate(table.swapped(groupcodes, groupcodes))
-glyphoptioncodes = utilities.storage.allocate(table.swapped(glyphoptioncodes,glyphoptioncodes))
-hyphenationcodes = utilities.storage.allocate(table.swapped(hyphenationcodes,hyphenationcodes))
-frozenparcodes = utilities.storage.allocate(table.swapped(frozenparcodes, frozenparcodes))
-flagcodes = utilities.storage.allocate(table.swapped(flagcodes, flagcodes))
-normalizecodes = utilities.storage.allocate(table.swapped(normalizecodes, normalizecodes))
-
-tex.groupcodes = groupcodes
-tex.glyphoptioncodes = glyphoptioncodes
-tex.hyphenationcodes = hyphenationcodes
-tex.frozenparcodes = frozenparcodes
-tex.flagcodes = flagcodes
-tex.normalizecodes = normalizecodes
diff --git a/Master/texmf-dist/tex/context/base/mkxl/toks-aux.mkxl b/Master/texmf-dist/tex/context/base/mkxl/toks-aux.mkxl
index 4563014ecfc..ed063f8db11 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/toks-aux.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/toks-aux.mkxl
@@ -47,7 +47,7 @@
\fi
\toksapp\lastnamedcs{#2}}
-\aliased\let\stoptokenlist\relax
+\permanent\protected\lettonothing\stoptokenlist
\permanent\def\gettokenlist[#1]%
{\ifcsname\??tokenlist#1\endcsname
diff --git a/Master/texmf-dist/tex/context/base/mkxl/toks-ini.lmt b/Master/texmf-dist/tex/context/base/mkxl/toks-ini.lmt
index 4b2d1faccf5..e4bf7626f19 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/toks-ini.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/toks-ini.lmt
@@ -25,58 +25,59 @@ values.count = values.integer
tokens.values = utilities.storage.allocate(table.swapped(values, values))
tokens.commands = utilities.storage.allocate(table.swapped(commands,commands))
-local scan_toks = token.scan_toks
-local scan_string = token.scan_string
-local scan_argument = token.scan_argument
-local scan_delimited = token.scan_delimited
-local scan_tokenlist = token.scan_tokenlist or scan_string
-local scan_integer = token.scan_integer or token.scan_int
-local scan_cardinal = token.scan_cardinal
-local scan_code = token.scan_code
-local scan_token_code = token.scan_token_code
-local scan_dimen = token.scan_dimen
-local scan_glue = token.scan_glue
-local scan_skip = token.scan_skip
-local scan_keyword = token.scan_keyword
-local scan_keyword_cs = token.scan_keyword_cs or scan_keyword
-local scan_token = token.scan_token
-local scan_box = token.scan_box
-local scan_word = token.scan_word
-local scan_letters = token.scan_letters or scan_word -- lmtx
-local scan_key = token.scan_key
-local scan_value = token.scan_value
-local scan_char = token.scan_char
-local scan_number = token.scan_number -- not defined
-local scan_csname = token.scan_csname
-local scan_real = token.scan_real
-local scan_float = token.scan_float
-local scan_luanumber = token.scan_luanumber or scan_float -- only lmtx
-local scan_luainteger = token.scan_luainteger or scan_integer -- only lmtx
-local scan_luacardinal = token.scan_luacardinal or scan_cardinal -- only lmtx
-
-local scan_integer_argument = token.scan_integer_argument
-local scan_dimen_argument = token.scan_dimen_argument
-
--- todo: gobble_integer -- might go away
--- todo: gobble_dimension -- might go away
-
-local set_macro = token.set_macro
-local set_char = token.set_char
-local set_lua = token.set_lua
-
-local create_token = token.create
-local new_token = token.new
-local is_defined = token.is_defined
-local is_token = token.is_token
-
-tokens.new = new_token
-tokens.create = create_token
-tokens.istoken = is_token
-tokens.isdefined = is_defined
-tokens.defined = is_defined
-
-tokens.getinteger = token.get_integer
-tokens.setinteger = token.set_integer
+local scantoks = token.scantoks
+local scanstring = token.scanstring
+local scanargument = token.scanargument
+local scandelimited = token.scandelimited
+local scantokenlist = token.scantokenlist
+local scaninteger = token.scaninteger
+local scancardinal = token.scancardinal
+local scancode = token.scancode
+local scantokencode = token.scantokencode
+local scandimen = token.scandimen
+local scanglue = token.scanglue
+local scanskip = token.scanskip
+local scankeyword = token.scankeyword
+local scankeywordcs = token.scankeywordcs
+local scantoken = token.scantoken
+local scanbox = token.scanbox
+local scanword = token.scanword
+local scanletters = token.scanletters
+local scankey = token.scankey
+local scanvalue = token.scanvalue
+local scanchar = token.scanchar
+local scancsname = token.scancsname
+local scannextchar = token.scannextchar
+local scanreal = token.scanreal
+local scanfloat = token.scanfloat
+local scanluanumber = token.scanluanumber
+local scanluainteger = token.scanluainteger
+local scanluacardinal = token.scanluacardinal
+local scanintegerargument = token.scanintegerargument
+local scandimenargument = token.scandimenargument
+
+local scannumber = token.scannumber
+local scanboolean = token.scanboolean
+
+local setmacro = token.setmacro
+local setchar = token.setchar
+local setlua = token.setlua
+
+local createtoken = token.create
+local newtoken = token.new
+local isdefined = token.isdefined
+local istoken = token.istoken
+
+tokens.new = newtoken
+tokens.create = createtoken
+tokens.istoken = istoken
+tokens.isdefined = isdefined
+tokens.defined = isdefined
+
+tokens.gobble = token.gobble
+
+tokens.getinteger = token.getinteger
+tokens.setinteger = token.setinteger
local bits = {
escape = 0x00000001, -- 2^00
@@ -110,10 +111,10 @@ tokens.bits = bits
-- words are space or \relax terminated and the trailing space is gobbled; a word
-- can contain any non-space letter/other (see archive for implementation in lua)
-if not scan_number then
+if not scannumber then -- we do have float and real .. this is actually scanluanumber
- scan_number = function(base)
- local s = scan_word()
+ scannumber = function(base)
+ local s = scanword()
if not s then
return nil
elseif base then
@@ -125,100 +126,89 @@ if not scan_number then
end
-local function scan_boolean()
- local kw = scan_word()
- if kw == "true" then
- return true
- elseif kw == "false" then
- return false
- else
- return nil
- end
-end
-
-local function scan_verbatim()
- return scan_argument(false)
-end
-
-if not scan_box then
+if not scanboolean then
- local scan_list = token.scan_list
- local put_next = token.put_next
-
- scan_box = function(s)
- if s == "hbox" or s == "vbox" or s == "vtop" then
- put_next(create_token(s))
+ scanboolean = function()
+ local kw = scanword()
+ if kw == "true" then
+ return true
+ elseif kw == "false" then
+ return false
+ else
+ return nil
end
- return scan_list()
end
- token.scan_box = scan_box
+end
+local function scanverbatim() -- check
+ return scanargument(false)
end
tokens.scanners = { -- these expand
- token = scan_token,
- toks = scan_toks,
- tokens = scan_toks,
- box = scan_box,
- hbox = function() return scan_box("hbox") end,
- vbox = function() return scan_box("vbox") end,
- vtop = function() return scan_box("vtop") end,
- dimen = scan_dimen,
- dimension = scan_dimen,
- glue = scan_glue,
- gluevalues = function() return scan_glue(false,false,true) end,
- gluespec = scan_skip,
- integer = scan_integer,
- cardinal = scan_cardinal,
- real = scan_real,
- float = scan_float,
- luanumber = scan_luanumber,
- luainteger = scan_luainteger,
- luacardinal = scan_luacardinal,
- count = scan_integer,
- string = scan_string,
- argument = scan_argument,
- delimited = scan_delimited,
- tokenlist = scan_tokenlist,
- verbatim = scan_verbatim, -- detokenize
- code = scan_code,
- tokencode = scan_token_code,
- word = scan_word,
- letters = scan_letters,
- key = scan_key,
- value = scan_value,
- char = scan_char,
- number = scan_number,
- boolean = scan_boolean,
- keyword = scan_keyword,
- keywordcs = scan_keyword_cs,
- csname = scan_csname,
-
- next = token.scan_next,
- nextexpanded = token.scan_next_expanded,
-
- peek = token.peek_next,
- peekexpanded = token.peek_next_expanded,
- peekchar = token.peek_next_char,
-
- skip = token.skip_next,
- skipexpanded = token.skip_next_expanded,
-
- cmdchr = token.scan_cmdchr,
- cmdchrexpanded = token.scan_cmdchr_expanded,
-
- ischar = token.is_next_char,
-
- integerargument = scan_integer_argument,
- dimenargument = scan_dimen_argument,
+ token = scantoken,
+ toks = scantoks,
+ tokens = scantoks,
+ box = scanbox,
+ hbox = function() return scanbox("hbox") end,
+ vbox = function() return scanbox("vbox") end,
+ vtop = function() return scanbox("vtop") end,
+ dimen = scandimen,
+ dimension = scandimen,
+ glue = scanglue,
+ gluevalues = function() return scanglue(false,false,true) end,
+ gluespec = scanskip,
+ integer = scaninteger,
+ cardinal = scancardinal,
+ real = scanreal,
+ float = scanfloat,
+ luanumber = scanluanumber,
+ luainteger = scanluainteger,
+ luacardinal = scanluacardinal,
+ count = scaninteger,
+ string = scanstring,
+ argument = scanargument,
+ delimited = scandelimited,
+ tokenlist = scantokenlist,
+ verbatim = scanverbatim, -- detokenize
+ code = scancode,
+ tokencode = scantokencode,
+ word = scanword,
+ letters = scanletters,
+ key = scankey,
+ value = scanvalue,
+ char = scanchar,
+ number = scannumber,
+ boolean = scanboolean,
+ keyword = scankeyword,
+ keywordcs = scankeywordcs,
+ csname = scancsname,
+ nextchar = scannextchar,
+
+ next = token.scannext,
+ nextexpanded = token.scannextexpanded,
+
+ peek = token.peeknext,
+ peekexpanded = token.peeknextexpanded,
+ peekchar = token.peeknextchar,
+
+ skip = token.skipnext,
+ skipexpanded = token.skipnextexpanded,
+
+ cmdchr = token.scancmdchr,
+ cmdchrexpanded = token.scancmdchrexpanded,
+
+ ischar = token.isnextchar,
+
+ integerargument = scanintegerargument,
+ dimenargument = scandimenargument,
}
tokens.getters = { -- these don't expand
- meaning = token.get_meaning,
- macro = token.get_macro,
- token = token.scan_next or token.get_next, -- not here, use scanners.next or token
- cstoken = token.get_cstoken,
+ meaning = token.getmeaning,
+ macro = token.getmacro,
+ token = token.scannext,
+ cstoken = token.getcstoken,
count = tex.getcount,
dimen = tex.getdimen,
skip = tex.getglue,
@@ -229,9 +219,9 @@ tokens.getters = { -- these don't expand
}
tokens.setters = {
- macro = set_macro,
- char = set_char,
- lua = set_lua,
+ macro = setmacro,
+ char = setchar,
+ lua = setlua,
count = tex.setcount,
dimen = tex.setdimen,
skip = tex.setglue,
@@ -241,50 +231,29 @@ tokens.setters = {
box = tex.setbox,
}
-token.accessors = {
- command = token.get_command,
- cmd = token.get_command,
- cmdname = token.get_cmdname,
- name = token.get_cmdname,
- csname = token.get_csname,
- index = token.get_index,
- active = token.get_active,
- frozen = token.get_frozen,
- protected = token.get_protected,
- expandable = token.get_protected,
- user = token.get_user,
- cmdchrcs = token.get_cmdchrcs,
- active = token.get_active,
- range = token.get_range,
+tokens.accessors = {
+ command = token.getcommand,
+ cmd = token.getcommand,
+ cmdname = token.getcmdname,
+ name = token.getcmdname,
+ csname = token.getcsname,
+ index = token.getindex,
+ active = token.getactive,
+ frozen = token.getfrozen,
+ protected = token.getprotected,
+ expandable = token.getprotected,
+ user = token.getuser,
+ cmdchrcs = token.getcmdchrcs,
+ active = token.getactive,
+ range = token.getrange,
}
--- static int run_scan_token(lua_State * L)
--- {
--- saved_tex_scanner texstate;
--- save_tex_scanner(texstate);
--- get_x_token();
--- make_new_token(L, cur_cmd, cur_chr, cur_cs);
--- unsave_tex_scanner(texstate);
--- return 1;
--- }
---
--- static int run_get_future(lua_State * L)
--- {
--- /* saved_tex_scanner texstate; */
--- /* save_tex_scanner(texstate); */
--- get_token();
--- make_new_token(L, cur_cmd, cur_chr, cur_cs);
--- back_input();
--- /* unsave_tex_scanner(texstate); */
--- return 1;
--- }
-
-if setinspector then
+if setinspector then -- can best be true
local simple = { letter = "letter", other_char = "other" }
local astable = function(t)
- if t and is_token(t) then
+ if t and istoken(t) then
local cmdname = t.cmdname
local simple = simple[cmdname]
if simple then
@@ -323,10 +292,98 @@ if setinspector then
end
tokens.cache = table.setmetatableindex(function(t,k)
- if not is_defined(k) then
- set_macro(k,"","global")
+ if not isdefined(k) then
+ setmacro(k,"","global") -- So we default to nothing! Maybe some message as option?
end
- local v = create_token(k)
+ local v = createtoken(k)
t[k] = v
return v
end)
+
+-- This will go, although ... we use some old names in styles. Check what we
+-- actually use.
+
+token.is_token = token.istoken
+token.is_defined = token.isdefined
+token.scan_next = token.scannext
+token.scan_next_expanded = token.scannextexpanded
+token.scan_next_char = token.scannextchar
+token.skip_next = token.skipnext
+token.skip_next_expanded = token.skipnextexpanded
+token.peek_next = token.peeknext
+token.peek_next_expanded = token.peeknextexpanded
+token.peek_next_char = token.peeknextchar
+token.scan_cmdchr = token.scancmdchr
+token.scan_cmdchr_expanded = token.scancmdchrexpanded
+token.scan_keyword = token.scankeyword
+token.scan_keyword_cs = token.scankeywordcs
+token.scan_integer = token.scaninteger
+token.scan_integer_argument = token.scanintegerargument
+token.scan_dimen_argument = token.scandimenargument
+token.scan_cardinal = token.scancardinal
+token.scan_float = token.scanfloat
+token.scan_real = token.scanreal
+token.scan_luanumber = token.scanluanumber
+token.scan_luainteger = token.scanluainteger
+token.scan_luacardinal = token.scanluacardinal
+token.scan_scale = token.scanscale
+token.scan_dimen = token.scandimen
+token.scan_skip = token.scanskip
+token.scan_glue = token.scanglue
+token.scan_toks = token.scantoks
+token.scan_tokenlist = token.scantokenlist
+token.scan_code = token.scancode
+token.scan_token_code = token.scantokencode
+token.scan_string = token.scanstring
+token.scan_argument = token.scanargument
+token.scan_delimited = token.scandelimited
+token.scan_word = token.scanword
+token.scan_letters = token.scanletters
+token.scan_key = token.scankey
+token.scan_value = token.scanvalue
+token.scan_char = token.scanchar
+token.scan_csname = token.scancsname
+token.scan_token = token.scantoken
+token.scan_box = token.scanbox
+token.is_next_char = token.isnextchar
+token.put_next = token.putnext
+token.put_back = token.putback
+token.get_command = token.getcommand
+token.get_index = token.getindex
+token.get_range = token.getrange
+token.get_cmdname = token.getcmdname
+token.get_csname = token.getcsname
+token.get_id = token.getid
+token.get_tok = token.gettok
+token.get_active = token.getactive
+token.get_expandable = token.getexpandable
+token.get_protected = token.getprotected
+token.get_frozen = token.getfrozen
+token.get_tolerant = token.gettolerant
+token.get_noaligned = token.getnoaligned
+token.get_primitive = token.getprimitive
+token.get_permanent = token.getpermanent
+token.get_immutable = token.getimmutable
+token.get_instance = token.getinstance
+token.get_flags = token.getflags
+token.get_parameters = token.getparameters
+token.get_macro = token.getmacro
+token.get_meaning = token.getmeaning
+token.get_cmdchrcs = token.getcmdchrcs
+token.get_cstoken = token.getcstoken
+token.get_fields = token.getfields
+token.set_macro = token.setmacro
+token.undefine_macro = token.undefinemacro
+token.expand_macro = token.expandmacro
+token.set_char = token.setchar
+token.set_lua = token.setlua
+token.set_integer = token.setinteger
+token.get_integer = token.getinteger
+token.set_dimension = token.setdimension
+token.get_dimension = token.getdimension
+token.gobble_integer = token.gobbleinteger
+token.gobble_dimen = token.gobbledimen
+token.future_expand = token.futureexpand
+token.push_macro = token.pushmacro
+token.pop_macro = token.popmacro
+token.save_lua = token.savelua
diff --git a/Master/texmf-dist/tex/context/base/mkxl/toks-scn.lmt b/Master/texmf-dist/tex/context/base/mkxl/toks-scn.lmt
index 73eedbba789..5af351939f1 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/toks-scn.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/toks-scn.lmt
@@ -60,7 +60,7 @@ local close = tokenbits.close
local function scanopen()
while true do
local c = scancode(open)
- if c == 123 then
+ if c == 123 then -- {
return true
-- elseif c ~= 32 then
elseif not c then
@@ -72,7 +72,7 @@ end
local function scanclose()
while true do
local c = scancode(close)
- if c == 125 then
+ if c == 125 then -- }
return true
-- elseif c ~= 32 then
elseif not c then
@@ -202,10 +202,15 @@ local function scanargumentasis()
return scanargument(false)
end
-scanners.bracketed = scanbracketed
-scanners.optional = scanoptional
-scanners.bracketedasis = scanbracketedasis
-scanners.argumentasis = scanargumentasis
+local function scancsnameunchecked()
+ return scancsname(true)
+end
+
+scanners.bracketed = scanbracketed
+scanners.optional = scanoptional
+scanners.bracketedasis = scanbracketedasis
+scanners.argumentasis = scanargumentasis
+scanners.csnameunchecked = scancsnameunchecked
local shortcuts = {
tokens = tokens,
@@ -243,6 +248,7 @@ local shortcuts = {
scanclose = scanclose,
scanlist = scanlist,
scancsname = scancsname,
+ scancsnameunchecked = scancsnameunchecked,
scandelimited = scandelimited, -- not directly useable
scanbracketed = scanbracketed,
scanoptional = scanoptional,
@@ -287,43 +293,43 @@ tokens.converters = {
-- the gain is only some 10 percent but if we don't have keywords with numbers it might
-- make sense in the end, some day.
-local f_if = formatters[ " if scankeywordcs('%s') then data['%s'] = scan%s()"]
-local f_elseif = formatters[" elseif scankeywordcs('%s') then data['%s'] = scan%s()"]
+local f_if = formatters[ " if scankeywordcs('%s') then data['%s'] = scan%s()"]
+local f_elseif = formatters[" elseif scankeywordcs('%s') then data['%s'] = scan%s()"]
------ f_if_x = formatters[ " if not data['%s'] and scankeywordcs('%s') then data['%s'] = scan%s()"]
------ f_elseif_x = formatters[" elseif not data['%s'] and scankeywordcs('%s') then data['%s'] = scan%s()"]
+----- f_if_x = formatters[ " if not data['%s'] and scankeywordcs('%s') then data['%s'] = scan%s()"]
+----- f_elseif_x = formatters[" elseif not data['%s'] and scankeywordcs('%s') then data['%s'] = scan%s()"]
------ f_if = formatters[" local key = scanletters() if key == '' then break elseif key == '%s' then data['%s'] = scan%s()"]
------ f_elseif = formatters[" elseif key == '%s' then data['%s'] = scan%s()"]
+----- f_if = formatters[" local key = scanletters() if key == '' then break elseif key == '%s' then data['%s'] = scan%s()"]
+----- f_elseif = formatters[" elseif key == '%s' then data['%s'] = scan%s()"]
-local f_local = formatters["local scan%s = scanners.%s"]
-local f_scan = formatters["scan%s()"]
-local f_shortcut = formatters["local %s = scanners.converters.%s"]
+local f_local = formatters["local scan%s = scanners.%s"]
+local f_scan = formatters["scan%s()"]
+local f_shortcut = formatters["local %s = scanners.converters.%s"]
-local f_if_c = formatters[ " if scankeywordcs('%s') then data['%s'] = %s(scan%s())"]
-local f_elseif_c = formatters[" elseif scankeywordcs('%s') then data['%s'] = %s(scan%s())"]
-local f_scan_c = formatters["%s(scan%s())"]
+local f_if_c = formatters[ " if scankeywordcs('%s') then data['%s'] = %s(scan%s())"]
+local f_elseif_c = formatters[" elseif scankeywordcs('%s') then data['%s'] = %s(scan%s())"]
+local f_scan_c = formatters["%s(scan%s())"]
-- see above
------ f_if_c = formatters[" local key = scanletters() if key == '' then break elseif key == '%s' then data['%s'] = %s(scan%s())"]
------ f_elseif_c = formatters[" elseif k == '%s' then data['%s'] = %s(scan%s())"]
+----- f_if_c = formatters[" local key = scanletters() if key == '' then break elseif key == '%s' then data['%s'] = %s(scan%s())"]
+----- f_elseif_c = formatters[" elseif k == '%s' then data['%s'] = %s(scan%s())"]
-local f_any = formatters[" else local key = scanword(true) if key then data[key] = scan%s() else break end end"]
-local f_any_c = formatters[" else local key = scanword(true) if key then data[key] = %s(scan%s()) else break end end"]
-local s_done = " else break end"
+local f_any = formatters[" else local key = scanword(true) if key then data[key] = scan%s() else break end end"]
+local f_any_c = formatters[" else local key = scanword(true) if key then data[key] = %s(scan%s()) else break end end"]
+local s_done <const> = " else break end"
-local f_any_all = formatters[" local key = scanword(true) if key then data[key] = scan%s() else break end"]
-local f_any_all_c= formatters[" local key = scanword(true) if key then data[key] = %s(scan%s()) else break end"]
+local f_any_all = formatters[" local key = scanword(true) if key then data[key] = scan%s() else break end"]
+local f_any_all_c = formatters[" local key = scanword(true) if key then data[key] = %s(scan%s()) else break end"]
-local f_table = formatters["%\nt\nreturn function()\n local data = { }\n%s\n return %s\nend\n"]
-local f_sequence = formatters["%\nt\n%\nt\n%\nt\nreturn function()\n return %s\nend\n"]
-local f_singular = formatters["%\nt\n%\nt\n\nreturn function(%s)\n return %s\nend\n"]
-local f_simple = formatters["%\nt\nreturn function()\n return %s\nend\n"]
-local f_string = formatters["%q"]
-local f_action_f = formatters["action%s(%s)"]
-local f_action_s = formatters["local action%s = tokens._action[%s]"]
-local f_nested = formatters["local function scan%s()\n local data = { }\n%s\n return data\nend\n"]
+local f_table = formatters["%\nt\nreturn function()\n local data = { }\n%s\n return %s\nend\n"]
+local f_sequence = formatters["%\nt\n%\nt\n%\nt\nreturn function()\n return %s\nend\n"]
+local f_singular = formatters["%\nt\n%\nt\n\nreturn function(%s)\n return %s\nend\n"]
+local f_simple = formatters["%\nt\nreturn function()\n return %s\nend\n"]
+local f_string = formatters["%q"]
+local f_action_f = formatters["action%s(%s)"]
+local f_action_s = formatters["local action%s = tokens._action[%s]"]
+local f_nested = formatters["local function scan%s()\n local data = { }\n%s\n return data\nend\n"]
local f_check = formatters[ [[
local wrapped = scanopen()
diff --git a/Master/texmf-dist/tex/context/base/mkxl/trac-ctx.mkxl b/Master/texmf-dist/tex/context/base/mkxl/trac-ctx.mkxl
index 656a7a9aa9b..5d760598b7f 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/trac-ctx.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/trac-ctx.mkxl
@@ -27,6 +27,20 @@
\clf_initializetexexperiments
\to \everyjob
+% \pushoverloadmode
+%
+% \let\syst_beginsimplegroup_yes\beginsimplegroup
+% \let\syst_beginsimplegroup_nop\bgroup
+%
+% \let\beginsimplegroup\syst_beginsimplegroup_nop
+%
+% \installtexexperiment
+% {simplegroups}
+% {\enforced\let\beginsimplegroup\syst_beginsimplegroup_yes}
+% {\enforced\let\beginsimplegroup\syst_beginsimplegroup_nop}
+%
+% \popoverloadmode
+
\protect \endinput
% this is one option:
diff --git a/Master/texmf-dist/tex/context/base/mkxl/trac-deb.lmt b/Master/texmf-dist/tex/context/base/mkxl/trac-deb.lmt
index 8ff12410528..caa5464f8d4 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/trac-deb.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/trac-deb.lmt
@@ -24,7 +24,9 @@ local implement = interfaces.implement
local ioflush = io.flush
local ioread = io.read
-local writenl = texio.write_nl
+local ossleep = os.sleep
+local osexit = os.exit
+local writenl = texio.writenl
local write = texio.write
local runlocal = tex.runlocal
@@ -135,7 +137,7 @@ local nop = function() end
local resetmessages = status.resetmessages or nop
local function processerror(offset,errortype)
- local readstate = status.readstate
+ local readstate = status.getreadstate()
local filename = readstate.filename
local linenumber = readstate.linenumber
local skiplinenumber = readstate.skiplinenumber
@@ -163,6 +165,7 @@ local function processerror(offset,errortype)
if job and type(job.disablesave) == "function" then
job.disablesave()
end
+ lua.setexitcode(1)
end
directives.register("system.quitonerror",function(v)
@@ -248,9 +251,11 @@ function tracers.printerror(specification)
report_str(tracers.showlines(filename,linenumber,offset,tonumber(luaerrorline)))
report_nl()
end
- local errname = file.addsuffix(tex.jobname .. "-error","log")
if quitonerror then
- table.save(errname,specification)
+ local name = tex.jobname or ""
+ if name ~= "" then
+ table.save(name .. "-error.log",specification)
+ end
local help = specification.lasttexhelp
if help and #help > 0 then
report_nl()
@@ -264,7 +269,7 @@ function tracers.printerror(specification)
end
end
-luatex.wrapup(function() os.remove(file.addsuffix(tex.jobname .. "-error","log")) end)
+luatex.wrapup(function() os.remove(tex.jobname .. "-error.log") end)
local function processwarning(offset)
local warningstate = status.warningstate
@@ -315,7 +320,7 @@ local function reportback(lmxname,default,variables)
end
local function showerror(lmxname)
- local readstate = status.readstate()
+ local readstate = status.getreadstate()
local filename = readstate.filename
local linenumber = tonumber(readstate.linenumber) or 0
local errorcontext = ""
@@ -327,7 +332,7 @@ local function showerror(lmxname)
end
local variables = {
['title'] = 'ConTeXt Error Information',
- ['errormessage'] = status.errorstatus.error or "?",
+ ['errormessage'] = status.geterrorstate().error or "?",
['linenumber'] = linenumber,
['color-background-one'] = lmx.get('color-background-yellow'),
['color-background-two'] = lmx.get('color-background-purple'),
@@ -345,8 +350,8 @@ function lmx.overloaderror(v)
usescitelexer = true
end
callback.register('show_error_message', function() showerror() end)
- callback.register('intercept_lua_error', function() showerror() end)
- callback.register('intercept_tex_error', function() showerror() end)
+-- callback.register('intercept_lua_error', function() showerror() end)
+-- callback.register('intercept_tex_error', function() showerror() end)
end
directives.register("system.showerror", lmx.overloaderror)
@@ -415,3 +420,28 @@ directives.register("system.profile",function(n)
logs.report("system","profiler started")
debugger.enable()
end)
+
+local report = logs.reporter("[[diagnostic]]")
+
+implement {
+ name = "diagnostic",
+ public = true,
+ -- protected = false, -- expandable
+ arguments = { "optional", "string" },
+ actions = function(t,s)
+ if t == "quit" then
+ report(s)
+ osexit()
+ else
+ t = tonumber(t)
+ if t then
+ report("%s (sleep: %.3N)",s,t)
+ ioflush()
+ ossleep(t)
+ else
+ report(s)
+ ioflush()
+ end
+ end
+ end
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/trac-inf.lmt b/Master/texmf-dist/tex/context/base/mkxl/trac-inf.lmt
index ebcd21e07af..feef3714fe7 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/trac-inf.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/trac-inf.lmt
@@ -210,8 +210,8 @@ function statistics.memused() -- no math.round yet -)
local luastate = status.getluastate()
return format("%s MB, ctx: %s MB, max: %s MB",
round(collectgarbage("count")//1024),
- round(luastate.state_bytes//1048576),
- luastate.state_bytes_max and round(luastate.state_bytes_max//1048576) or "unknown"
+ round(luastate.statebytes//1048576),
+ luastate.statebytesmax and round(luastate.statebytesmax//1048576) or "unknown"
)
end
@@ -264,7 +264,52 @@ status.iocodes = setmetatableindex(tex.getiovalues(), function() return "unknown
local report = logs.reporter("system")
+local list = {
+ "string", "pool", "hash", "lookup", "node", "token",
+ "buffer", "input", "file", "nest", "parameter", "save", "font", "language", "mark", "insert",
+ -- "extra", "sparse",
+}
+
+local function show(data,fields)
+ local line = rep("-",3+11*#list)
+ local columns = rep("%11s",#list)
+ report("")
+ report("%w%s",2,line)
+ report("%w"..columns,5,unpack(list))
+ report("%w%s",2,line)
+ for i=1,#fields do
+ local f = fields[i]
+ if f then
+ local t = { }
+ for i=1,#list do
+ local n = data[list[i].."state"][f]
+ t[i] = n < 0 and formatters["%w"](11) or formatters["%11i"](n)
+ end
+ report(" %3s"..columns,f,unpack(t))
+ else
+ report("")
+ end
+ end
+ report("%w%s",2,line)
+ report("")
+end
+
+function statistics.showmemory(when)
+ report("")
+ report("memory configuration")
+ show(status.list(), { "max", "min", "set", "stp" })
+end
+
+local registered = false
+local enabled = false
+local finished = false
+
function statistics.showusage(when)
+ if finished and when == "finish" then
+ return
+ else
+ finished = true
+ end
local s = status.list()
local c = status.getcallbackstate() -- status.callbacks
local m = mplib.getcallbackstate()
@@ -287,40 +332,7 @@ function statistics.showusage(when)
else
report("status after shipping out page %s",tex.getcount("realpageno"))
end
- report("")
- local list = {
- "stringstate", "poolstate", "hashstate", "lookupstate",
- "nodestate", "extrastate", "tokenstate",
- "bufferstate", "inputstate", "filestate",
- "neststate", "parameterstate", "savestate",
- "fontstate", "languagestate", "markstate", "sparsestate",
- }
- local fields = { "max", "min", "set", "stp", false, "mem", "all", false, "ini", "ptr", "top" }
- local line = rep("-",190)
- do
- local t = { }
- for i=1,#list do
- t[i] = gsub(list[i],"state","")
- end
- report("%w%s",2,line)
- report("%w%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s",5,unpack(t))
- report("%w%s",2,line)
- end
- for i=1,#fields do
- local f = fields[i]
- if f then
- local t = { }
- for i=1,#list do
- local n = s[list[i]][f]
- t[i] = n < 0 and formatters["%w"](11) or formatters["%11i"](n)
- end
- report(" %3s%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s",f,unpack(t))
- else
- report("")
- end
- end
- report("%w%s",2,line)
- report("")
+ show(s, { "max", "min", "set", "stp", false, "mem", "all", false, "ini", "ptr", "top" })
report(" current input type : %s", iocode)
if iocode == "file" then
report(" current file name : %s", rstatus.filename or "")
@@ -332,9 +344,9 @@ function statistics.showusage(when)
report(" expansion depth : min: %s, max: %s, set: %s, top: %s", estatus.min, estatus.max, estatus.set, estatus.top)
report("")
report(" luabytecode registers : %s", lstatus.bytecodes)
- report(" luabytecode bytes : %s (%s MB)", lstatus.bytecode_bytes, lstatus.bytecode_bytes // 1048576)
- report(" luastate bytes now : %s (%s MB)", lstatus.state_bytes, lstatus.state_bytes // 1048576)
- report(" luastate bytes max : %s (%s MB)", lstatus.state_bytes_max, lstatus.state_bytes_max // 1048576)
+ report(" luabytecode bytes : %s (%s MB)", lstatus.bytecodebytes, lstatus.bytecodebytes // 1048576)
+ report(" luastate bytes now : %s (%s MB)", lstatus.statebytes, lstatus.statebytes // 1048576)
+ report(" luastate bytes max : %s (%s MB)", lstatus.statebytesmax, lstatus.statebytesmax // 1048576)
report("")
report(" file callbacks : %s", c.file)
report(" saved callbacks : %s", c.saved)
@@ -355,55 +367,13 @@ function statistics.showusage(when)
report(" mp total callbacks : %s", m.count)
report(" backend callbacks : %s", b.count)
report("")
- report(" page numbers : realpage %s, userpage %s, subpage %s",pstatus.page.real,pstatus.page.user,pstatus.page.sub)
- report(" page timing : total %0.03f, page %0.03f, average %0.03f",pstatus.time.elapsed,pstatus.time.page,pstatus.time.average)
- report("")
-end
-
-function statistics.showmemory(when)
- local s = status.list()
- --
- report("")
- report("memory configuration")
- report("")
- local list = {
- "stringstate", "poolstate", "hashstate", "lookupstate",
- "nodestate", "tokenstate",
- "bufferstate", "inputstate", "filestate",
- "neststate", "parameterstate", "savestate",
- "fontstate", "languagestate", "markstate",
- }
- local fields = { "max", "min", "set", "stp" }
- local line = rep("-",168)
- do
- local t = { }
- for i=1,#list do
- t[i] = gsub(list[i],"state","")
- end
- report("%w%s",2,line)
- report("%w%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s",5,unpack(t))
- report("%w%s",2,line)
- end
- for i=1,#fields do
- local f = fields[i]
- if f then
- local t = { }
- for i=1,#list do
- local n = s[list[i]][f]
- t[i] = n < 0 and formatters["%w"](11) or formatters["%11i"](n)
- end
- report(" %3s%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s%11s",f,unpack(t))
- else
- report("")
- end
+ if pstatus then
+ report(" page numbers : realpage %s, userpage %s, subpage %s",pstatus.page.real,pstatus.page.user,pstatus.page.sub)
+ report(" page timing : total %0.03f, page %0.03f, average %0.03f",pstatus.time.elapsed,pstatus.time.page,pstatus.time.average)
+ report("")
end
- report("%w%s",2,line)
- report("")
end
-local registered = false
-local enabled = false
-
trackers.register("system.usage", function(v)
if v and not registered then
logs.private.enablepagetiming()
@@ -423,3 +393,13 @@ trackers.register("system.usage", function(v)
end
enabled = v
end)
+
+-- can't be done here:
+--
+-- luatex.registerstopactions(function()
+-- if not enabled then
+-- logs.push("logfile")
+-- statistics.showusage("finish")
+-- logs.pop()
+-- end
+-- end)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/trac-jus.lmt b/Master/texmf-dist/tex/context/base/mkxl/trac-jus.lmt
new file mode 100644
index 00000000000..e9c8fac2844
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/trac-jus.lmt
@@ -0,0 +1,122 @@
+if not modules then modules = { } end modules ['trac-jus'] = {
+ version = 1.001,
+ comment = "companion to trac-jus.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local checkers = typesetters.checkers or { }
+typesetters.checkers = checkers
+
+----- report_justification = logs.reporter("visualize","justification")
+
+local a_alignstate = attributes.private("alignstate")
+local a_justification = attributes.private("justification")
+
+local nuts = nodes.nuts
+
+local getfield = nuts.getfield
+local getlist = nuts.getlist
+local getattr = nuts.getattr
+local setattr = nuts.setattr
+local setlist = nuts.setlist
+local setlink = nuts.setlink
+local getwidth = nuts.getwidth
+local findtail = nuts.tail
+
+local nexthlist = nuts.traversers.hlist
+
+local getdimensions = nuts.dimensions
+local copylist = nuts.copylist
+
+local tracedrule = nodes.tracers.pool.nuts.rule
+
+local nodepool = nuts.pool
+
+local new_hlist = nodepool.hlist
+local new_kern = nodepool.kern
+
+local hlist_code = nodes.nodecodes.hlist
+
+local texsetattribute = tex.setattribute
+local unsetvalue = attributes.unsetvalue
+
+local enableaction = nodes.tasks.enableaction
+
+local min_threshold = 0
+local max_threshold = 0
+
+local function set(n)
+ enableaction("mvlbuilders", "typesetters.checkers.handler")
+ enableaction("vboxbuilders","typesetters.checkers.handler")
+ texsetattribute(a_justification,n or 1)
+ function typesetters.checkers.set(n)
+ texsetattribute(a_justification,n or 1)
+ end
+end
+
+local function reset()
+ texsetattribute(a_justification,unsetvalue)
+end
+
+checkers.set = set
+checkers.reset = reset
+
+interfaces.implement {
+ name = "showjustification",
+ actions = set
+}
+
+trackers.register("visualizers.justification", function(v)
+ if v then
+ set(1)
+ else
+ reset()
+ end
+end)
+
+function checkers.handler(head)
+ for current in nexthlist, head do
+ if getattr(current,a_justification) == 1 then
+ setattr(current,a_justification,0) -- kind of reset
+ local width = getwidth(current)
+ if width > 0 then
+ local list = getlist(current)
+ if list then
+ local naturalwidth, naturalheight, naturaldepth = getdimensions(list)
+ local delta = naturalwidth - width
+ if naturalwidth == 0 or delta == 0 then
+ -- special box
+ elseif delta >= max_threshold then
+ local rule = new_hlist(tracedrule(delta,naturalheight,naturaldepth,getfield(list,"glueset") == 1 and "trace:dr" or "trace:db"))
+ setlink(findtail(list),rule)
+ setlist(current,list)
+ elseif delta <= min_threshold then
+ local alignstate = getattr(list,a_alignstate)
+ if alignstate == 1 then
+ local rule = new_hlist(tracedrule(-delta,naturalheight,naturaldepth,"trace:dc"))
+ setlink(rule,list)
+ setlist(current,rule)
+ elseif alignstate == 2 then
+ local lrule = new_hlist(tracedrule(-delta/2,naturalheight,naturaldepth,"trace:dy"))
+ local rrule = copylist(lrule)
+ setlink(lrule,list)
+ setlink(findtail(list),new_kern(delta/2),rrule)
+ setlist(current,lrule)
+ elseif alignstate == 3 then
+ local rule = new_hlist(tracedrule(-delta,naturalheight,naturaldepth,"trace:dm"))
+ setlink(findtail(list),new_kern(delta),rule)
+ setlist(current,list)
+ else
+ local rule = new_hlist(tracedrule(-delta,naturalheight,naturaldepth,"trace:dg"))
+ setlink(findtail(list),new_kern(delta),rule)
+ setlist(current,list)
+ end
+ end
+ end
+ end
+ end
+ end
+ return head
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/trac-jus.mkxl b/Master/texmf-dist/tex/context/base/mkxl/trac-jus.mkxl
index 3375e5ee76f..387478cb123 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/trac-jus.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/trac-jus.mkxl
@@ -13,7 +13,7 @@
\writestatus{loading}{ConTeXt Tracing Macros / Justification}
-\registerctxluafile{trac-jus}{}
+\registerctxluafile{trac-jus}{autosuffix}
\unprotect
diff --git a/Master/texmf-dist/tex/context/base/mkxl/trac-set.lmt b/Master/texmf-dist/tex/context/base/mkxl/trac-set.lmt
new file mode 100644
index 00000000000..5c21f65250b
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/trac-set.lmt
@@ -0,0 +1,453 @@
+if not modules then modules = { } end modules ['trac-set'] = { -- might become util-set.lua
+ version = 1.001,
+ comment = "companion to luat-lib.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- maybe this should be util-set.lua
+
+local type, next, tostring, tonumber = type, next, tostring, tonumber
+local print = print
+local concat, sortedhash = table.concat, table.sortedhash
+local formatters, find, lower, gsub, topattern = string.formatters, string.find, string.lower, string.gsub, string.topattern
+local is_boolean = string.is_boolean
+local settings_to_hash = utilities.parsers.settings_to_hash
+local allocate = utilities.storage.allocate
+
+utilities = utilities or { }
+local utilities = utilities
+
+local setters = utilities.setters or { }
+utilities.setters = setters
+
+local data = { }
+
+-- We can initialize from the cnf file. This is sort of tricky as
+-- later defined setters also need to be initialized then. If set
+-- this way, we need to ensure that they are not reset later on.
+--
+-- The sorting is needed to get a predictable setters in case of *.
+
+local trace_initialize = false -- only for testing during development
+local frozen = true -- this needs checking
+
+local function initialize_setter(filename,name,values) -- filename only for diagnostics
+ local setter = data[name]
+ if setter then
+ -- trace_initialize = true
+ local data = setter.data
+ if data then
+ for key, newvalue in sortedhash(values) do
+ local newvalue = is_boolean(newvalue,newvalue,true) -- strict
+ local functions = data[key]
+ if functions then
+ local oldvalue = functions.value
+ if functions.frozen then
+ if trace_initialize then
+ setter.report("%s: %a is %s to %a",filename,key,"frozen",oldvalue)
+ end
+ elseif #functions > 0 and not oldvalue then
+-- elseif #functions > 0 and oldvalue == nil then
+ if trace_initialize then
+ setter.report("%s: %a is %s to %a",filename,key,"set",newvalue)
+ end
+ for i=1,#functions do
+ functions[i](newvalue)
+ end
+ functions.value = newvalue
+ functions.frozen = functions.frozen or frozen
+ else
+ if trace_initialize then
+ setter.report("%s: %a is %s as %a",filename,key,"kept",oldvalue)
+ end
+ end
+ else
+ -- we do a simple preregistration i.e. not in the
+ -- list as it might be an obsolete entry
+ functions = { default = newvalue, frozen = frozen }
+ data[key] = functions
+ if trace_initialize then
+ setter.report("%s: %a is %s to %a",filename,key,"defaulted",newvalue)
+ end
+ end
+ end
+ return true
+ end
+ end
+end
+
+-- user interface code
+
+local function set(t,what,newvalue)
+ local data = t.data -- somehow this can be nil
+ if data and not data.frozen then
+ local done = t.done
+ if type(what) == "string" then
+ what = settings_to_hash(what) -- inefficient but ok
+ end
+ if type(what) ~= "table" then
+ return
+ end
+ if not done then -- catch ... why not set?
+ done = { }
+ t.done = done
+ end
+ for w, value in sortedhash(what) do
+ if value == "" then
+ value = newvalue
+ elseif not value then
+ value = false -- catch nil
+ else
+ value = is_boolean(value,value,true) -- strict
+ end
+ w = topattern(w,true,true)
+ for name, functions in sortedhash(data) do
+ if done[name] then
+ -- prevent recursion due to wildcards
+ elseif find(name,w) then
+ done[name] = true
+ for i=1,#functions do
+ functions[i](value)
+ end
+ functions.value = value
+ end
+ end
+ end
+ end
+end
+
+local function reset(t)
+ local data = t.data
+ if data and not data.frozen then
+ for name, functions in sortedthash(data) do
+ for i=1,#functions do
+ functions[i](false)
+ end
+ functions.value = false
+ end
+ end
+end
+
+local function enable(t,what)
+ set(t,what,true)
+end
+
+local function disable(t,what)
+ local data = t.data
+ if not what or what == "" then
+ t.done = { }
+ reset(t)
+ else
+ set(t,what,false)
+ end
+end
+
+local function register_setter(t,what,...)
+ local data = t.data
+ what = lower(what)
+ local functions = data[what]
+ if not functions then
+ functions = { }
+ data[what] = functions
+ if trace_initialize then
+ t.report("defining %a",what)
+ end
+ end
+ local default = functions.default -- can be set from cnf file
+ for i=1,select("#",...) do
+ local fnc = select(i,...)
+ local typ = type(fnc)
+ if typ == "string" then
+ if trace_initialize then
+ t.report("coupling %a to %a",what,fnc)
+ end
+ local s = fnc -- else wrong reference
+ fnc = function(value) set(t,s,value) end
+ elseif typ == "table" then
+ functions.values = fnc
+ fnc = nil
+ elseif typ ~= "function" then
+ fnc = nil
+ end
+ if fnc then
+ functions[#functions+1] = fnc
+ -- default: set at command line or in cnf file
+ -- value : set in tex run (needed when loading runtime)
+ local value = functions.value or default
+ if value ~= nil then
+ fnc(value)
+ functions.value = value
+ end
+ end
+ end
+ return false -- so we can use it in an assignment
+end
+
+local function enable_setter(t,what)
+ local e = t.enable
+ t.enable, t.done = enable, { }
+ set(t,what,true)
+ enable(t,what)
+ t.enable, t.done = e, { }
+end
+
+local function disable_setter(t,what)
+ local e = t.disable
+ t.disable, t.done = disable, { }
+ disable(t,what)
+ t.disable, t.done = e, { }
+end
+
+local function reset_setter(t)
+ t.done = { }
+ reset(t)
+end
+
+local function list_setter(t) -- pattern
+ local list = table.sortedkeys(t.data)
+ local user, system = { }, { }
+ for l=1,#list do
+ local what = list[l]
+ if find(what,"^%*") then
+ system[#system+1] = what
+ else
+ user[#user+1] = what
+ end
+ end
+ return user, system
+end
+
+local function show_setter(t,pattern)
+ local list = list_setter(t)
+ t.report()
+ for k=1,#list do
+ local name = list[k]
+ if not pattern or find(name,pattern) then
+ local functions = t.data[name]
+ if functions then
+ local value = functions.value
+ local default = functions.default
+ local values = functions.values
+ local modules = #functions
+ if default == nil then
+ default = "unset"
+ elseif type(default) == "table" then
+ default = concat(default,"|")
+ else
+ default = tostring(default)
+ end
+ if value == nil then
+ value = "unset"
+ elseif type(value) == "table" then
+ value = concat(value,"|")
+ else
+ value = tostring(value)
+ end
+ t.report(name)
+ t.report(" modules : %i",modules)
+ t.report(" default : %s",default)
+ t.report(" value : %s",value)
+ if values then
+ local v = { } for i=1,#values do v[i] = tostring(values[i]) end
+ t.report(" values : % t",v)
+ end
+ t.report()
+ end
+ end
+ end
+end
+
+-- we could have used a bit of oo and the trackers:enable syntax but
+-- there is already a lot of code around using the singular tracker
+
+-- we could make this into a module but we also want the rest avaliable
+
+function setters.report(setter,fmt,...)
+ if fmt then
+ print(formatters["%-15s : %s"](setter.name,formatters[fmt](...)))
+ else
+ print("")
+ end
+end
+
+local function setter_default(setter,name)
+ local d = setter.data[name]
+ return d and d.default
+end
+
+local function setter_value(setter,name)
+ local d = setter.data[name]
+ return d and (d.value or d.default)
+end
+
+local function setter_values(setter,name)
+ local d = setter.data[name]
+ return d and d.values
+end
+
+local function new_setter(name) -- we could use foo:bar syntax (but not used that often)
+ local setter -- we need to access it in setter itself
+ setter = {
+ data = allocate(), -- indexed, but also default and value fields
+ name = name,
+ report = function(...) setters.report (setter,...) end, -- setters.report gets implemented later
+ enable = function(...) enable_setter (setter,...) end,
+ disable = function(...) disable_setter (setter,...) end,
+ reset = function(...) reset_setter (setter,...) end, -- can be dangerous
+ register = function(...) register_setter(setter,...) end,
+ list = function(...) return list_setter (setter,...) end,
+ show = function(...) show_setter (setter,...) end,
+ default = function(...) return setter_default (setter,...) end,
+ value = function(...) return setter_value (setter,...) end,
+ values = function(...) return setter_values (setter,...) end,
+ }
+ data[name] = setter
+ return setter
+end
+
+setters.enable = enable_setter
+setters.disable = disable_setter
+-------.report = report_setter -- todo: adapt after call (defaults to print)
+setters.register = register_setter
+setters.list = list_setter
+setters.show = show_setter
+setters.reset = reset_setter
+setters.new = new_setter
+setters.initialize = initialize_setter
+
+trackers = new_setter("trackers")
+directives = new_setter("directives")
+experiments = new_setter("experiments")
+
+local t_enable, t_disable = trackers .enable, trackers .disable
+local d_enable, d_disable = directives .enable, directives .disable
+local e_enable, e_disable = experiments.enable, experiments.disable
+
+-- nice trick: we overload two of the directives related functions with variants that
+-- do tracing (itself using a tracker) .. proof of concept
+
+local trace_directives = false local trace_directives = false trackers.register("system.directives", function(v) trace_directives = v end)
+local trace_experiments = false local trace_experiments = false trackers.register("system.experiments", function(v) trace_experiments = v end)
+
+function directives.enable(...)
+ if trace_directives then
+ directives.report("enabling: % t",{...})
+ end
+ d_enable(...)
+end
+
+function directives.disable(...)
+ if trace_directives then
+ directives.report("disabling: % t",{...})
+ end
+ d_disable(...)
+end
+
+function experiments.enable(...)
+ if trace_experiments then
+ experiments.report("enabling: % t",{...})
+ end
+ e_enable(...)
+end
+
+function experiments.disable(...)
+ if trace_experiments then
+ experiments.report("disabling: % t",{...})
+ end
+ e_disable(...)
+end
+
+-- a useful example
+
+directives.register("system.nostatistics", function(v)
+ if statistics then
+ statistics.enable = not v
+ else
+ -- forget about it
+ end
+end)
+
+directives.register("system.nolibraries", function(v)
+ if libraries then
+ libraries = nil -- we discard this tracing for security
+ else
+ -- no libraries defined
+ end
+end)
+
+-- experiment
+
+if environment then
+
+ -- The engineflags are known earlier than environment.arguments but maybe we
+ -- need to handle them both as the later are parsed differently. The c: prefix
+ -- is used by mtx-context to isolate the flags from those that concern luatex.
+
+ local engineflags = environment.engineflags
+
+ if engineflags then
+ local list = engineflags["c:trackers"] or engineflags["trackers"]
+ if type(list) == "string" then
+ initialize_setter("commandline flags","trackers",settings_to_hash(list))
+ -- t_enable(list)
+ end
+ local list = engineflags["c:directives"] or engineflags["directives"]
+ if type(list) == "string" then
+ initialize_setter("commandline flags","directives", settings_to_hash(list))
+ -- d_enable(list)
+ end
+ end
+
+end
+
+-- here
+
+if texconfig then
+
+ -- this happens too late in ini mode but that is no problem
+
+ local function set(k,v)
+ if v then
+ texconfig[k] = v
+ end
+ end
+
+ directives.register("luametatex.memory.expand", function(v) set("expand_depth",v) end)
+ directives.register("luametatex.memory.hash", function(v) set("hash_extra",v) end)
+ directives.register("luametatex.memory.nest", function(v) set("nest_size",v) end)
+ directives.register("luametatex.memory.file", function(v) set("max_in_open",v) end)
+ directives.register("luametatex.memory.string", function(v) set("max_strings",v) end)
+ directives.register("luametatex.memory.parameter", function(v) set("param_size",v) end)
+ directives.register("luametatex.memory.save", function(v) set("save_size",v) end)
+ directives.register("luametatex.memory.stack", function(v) set("stack_size",v) end)
+
+ -- poolstate
+ -- lookupstate
+ -- nodestate
+ -- tokenstate
+ -- bufferstate
+ -- fontstate
+ -- languagestate
+ -- markstate
+ -- sparsestate
+
+end
+
+-- for now here:
+
+local data = table.setmetatableindex("table")
+
+updaters = {
+ register = function(what,f)
+ local d = data[what]
+ d[#d+1] = f
+ end,
+ apply = function(what,...)
+ local d = data[what]
+ for i=1,#d do
+ d[i](...)
+ end
+ end,
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/trac-tex.mkxl b/Master/texmf-dist/tex/context/base/mkxl/trac-tex.mkxl
index 13c1a047f76..cf46bed26e5 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/trac-tex.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/trac-tex.mkxl
@@ -24,7 +24,7 @@
% \def\enabletextracerwhatever {...}
% \def\disabletextracerwhatever{...}
-\mutable\let\alltextracers\empty % so that we can report available tracers
+\mutable\lettonothing\alltextracers % so that we can report available tracers
\permanent\protected\def\installtextracer#1%
{\addtocommalist{#1}\alltextracers}
@@ -56,14 +56,14 @@
\permanent\protected\def\profilemacro#1% an oldie, but modernized a bit
{\edef\p_name{\csstring#1}%
\ifcsname\??profilemacrocount\p_name\endcsname \else
- \expandafter\newcount\csname\??profilemacrocount\p_name\endcsname
+ \expandafter\newinteger\csname\??profilemacrocount\p_name\endcsname
\letcsname\??profilemacromacro\p_name\endcsname#1%
\xtoksapp\t_syst_profile
{\writestatus
{profile}%
{\string#1: \noexpand\the\csname\??profilemacrocount\p_name\endcsname}}%
\enforced\protected\xdef#1%
- {\global\advance\csname\??profilemacrocount\p_name\endcsname\plusone
+ {\global\advanceby\csname\??profilemacrocount\p_name\endcsname\plusone
\expandafter\noexpand\csname\??profilemacromacro\p_name\endcsname}%
\fi}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/trac-vis.lmt b/Master/texmf-dist/tex/context/base/mkxl/trac-vis.lmt
index 44723e38fad..dddb4799deb 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/trac-vis.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/trac-vis.lmt
@@ -9,7 +9,7 @@ if not modules then modules = { } end modules ['trac-vis'] = {
local node, nodes, attributes, tex = node, nodes, attributes, tex
local type, tonumber, next, rawget = type, tonumber, next, rawget
-local gmatch = string.gmatch
+local gmatch, gsub = string.gmatch, string.gsub
local formatters = string.formatters
local round = math.round
@@ -30,8 +30,6 @@ local round = math.round
-- todo: tags can also be numbers (just add to hash)
-- todo: make a lmtx variant (a few more efficient fetchers)
-local nodecodes = nodes.nodecodes
-
local nuts = nodes.nuts
local tonut = nuts.tonut
@@ -42,6 +40,8 @@ local setsubtype = nuts.setsubtype
local setattr = nuts.setattr
local setwidth = nuts.setwidth
local setshift = nuts.setshift
+local setoffsets = nuts.setoffsets
+local getglyphdimensions = nuts.getglyphdimensions
local getid = nuts.getid
local getfont = nuts.getfont
@@ -49,26 +49,30 @@ local getattr = nuts.getattr
local getsubtype = nuts.getsubtype
local getbox = nuts.getbox
local getlist = nuts.getlist
+local getprev = nuts.getprev
local getnext = nuts.getnext
local getboth = nuts.getboth
local getwhd = nuts.getwhd
local getkern = nuts.getkern
+local getpenalty = nuts.getpenalty
local getwidth = nuts.getwidth
local getdepth = nuts.getdepth
local getexpansion = nuts.getexpansion
local getstate = nuts.getstate
local getoffsets = nuts.getoffsets
+local getindex = nuts.getindex
+local getprop = nuts.getprop
local isglyph = nuts.isglyph
local hpack_nodes = nuts.hpack
local vpack_nodes = nuts.vpack
-local copy_list = nuts.copy_list
-local copy_node = nuts.copy_node
-local flush_node_list = nuts.flush_list
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local copylist = nuts.copylist
+local copy_node = nuts.copy
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local apply_to_nodes = nuts.apply
+local flushnodelist = nuts.flushlist
local hpack_string = nuts.typesetters.tohpack
@@ -89,6 +93,7 @@ local pt_factor = number.dimenfactors.pt
local nodepool = nuts.pool
local new_rule = nodepool.rule
+local new_virtual_rule = nodepool.virtualrule
local new_kern = nodepool.kern
local new_glue = nodepool.glue
local new_hlist = nodepool.hlist
@@ -108,74 +113,60 @@ local stoptiming = statistics.stoptiming
local a_visual = attributes.private("visual")
local a_layer = attributes.private("viewerlayer")
-local band = bit32.band
-local bor = bit32.bor
-
local enableaction = nodes.tasks.enableaction
--- local trace_hbox
--- local trace_vbox
--- local trace_vtop
--- local trace_kern
--- local trace_glue
--- local trace_penalty
--- local trace_fontkern
--- local trace_strut
--- local trace_whatsit
--- local trace_user
--- local trace_math
--- local trace_italic
--- local trace_discretionary
--- local trace_expansion
--- local trace_line
--- local trace_space
-
local report_visualize = logs.reporter("visualize")
local modes = {
- hbox = 0x000001,
- vbox = 0x000002,
- vtop = 0x000004,
- kern = 0x000008,
- glue = 0x000010,
- penalty = 0x000020,
- fontkern = 0x000040,
- strut = 0x000080,
- whatsit = 0x000100,
- glyph = 0x000200,
- simple = 0x000400,
- simplehbox = 0x000401,
- simplevbox = 0x000402,
- simplevtop = 0x000404,
- user = 0x000800,
- math = 0x001000,
- italic = 0x002000,
- origin = 0x004000,
- discretionary = 0x008000,
- expansion = 0x010000,
- line = 0x020000,
- space = 0x040000,
- depth = 0x080000,
- marginkern = 0x100000,
- mathlistkern = 0x200000,
- dir = 0x400000,
- par = 0x800000,
+ hbox = 0x0000001,
+ vbox = 0x0000002,
+ vtop = 0x0000004,
+ kern = 0x0000008,
+ glue = 0x0000010,
+ penalty = 0x0000020,
+ fontkern = 0x0000040,
+ strut = 0x0000080,
+ whatsit = 0x0000100,
+ glyph = 0x0000200,
+ simple = 0x0000400,
+ simplehbox = 0x0000401,
+ simplevbox = 0x0000402,
+ simplevtop = 0x0000404,
+ user = 0x0000800,
+ math = 0x0001000,
+ italic = 0x0002000,
+ origin = 0x0004000,
+ discretionary = 0x0008000,
+ expansion = 0x0010000,
+ line = 0x0020000,
+ space = 0x0040000,
+ depth = 0x0080000,
+ marginkern = 0x0100000,
+ mathkern = 0x0200000, --
+ dir = 0x0400000,
+ par = 0x0800000,
+ mathglue = 0x1000000, --
+ mark = 0x2000000,
+ insert = 0x4000000,
+ boundary = 0x8000000,
}
+visualizers.modes = modes
+
local usedfont, exheight, emwidth
-local l_penalty, l_glue, l_kern, l_fontkern, l_hbox, l_vbox, l_vtop, l_strut, l_whatsit, l_glyph, l_user, l_math, l_marginkern, l_mathlistkern, l_italic, l_origin, l_discretionary, l_expansion, l_line, l_space, l_depth,
- l_dir, l_whatsit
+local l_penalty, l_glue, l_kern, l_fontkern, l_hbox, l_vbox, l_vtop, l_strut, l_whatsit, l_glyph, l_user, l_math, l_marginkern, l_mathkern, l_mathshape, l_italic, l_origin, l_discretionary, l_expansion, l_line, l_space, l_depth,
+ l_dir, l_whatsit, l_mark, l_insert, l_boundary
local enabled = false
local layers = { }
local preset_boxes = modes.hbox + modes.vbox + modes.vtop + modes.origin
local preset_makeup = preset_boxes
- + modes.kern + modes.glue + modes.penalty
+ + modes.kern + modes.glue + modes.penalty + modes.boundary
local preset_all = preset_makeup
- + modes.fontkern + modes.marginkern + modes.mathlistkern
+ + modes.fontkern + modes.marginkern + modes.mathkern
+ modes.whatsit + modes.glyph + modes.user + modes.math
- + modes.dir + modes.whatsit
+ + modes.dir + modes.mathglue + modes.mark + modes.insert
function visualizers.setfont(id)
usedfont = id or current_font()
@@ -221,7 +212,8 @@ local function initialize()
l_math = layers.math
l_italic = layers.italic
l_marginkern = layers.marginkern
- l_mathlistkern = layers.mathlistkern
+ l_mathkern = layers.mathkern
+ l_mathshapekern = layers.mathshapekern
l_origin = layers.origin
l_discretionary = layers.discretionary
l_expansion = layers.expansion
@@ -230,6 +222,9 @@ local function initialize()
l_depth = layers.depth
l_dir = layers.dir
l_par = layers.par
+ l_mark = layers.mark
+ l_insert = layers.insert
+ l_boundary = layers.boundary
--
if not userrule then
userrule = nuts.rules.userrule
@@ -255,6 +250,12 @@ local function enable()
tex.setcount("global","c_syst_visualizers_state",1) -- so that we can optimize at the tex end
end
+function visualizers.enable()
+ if not enabled then
+ enable()
+ end
+end
+
local function setvisual(n,a,what,list) -- this will become more efficient when we have the bit lib linked in
if not n or n == "reset" then
return unsetvalue
@@ -262,13 +263,13 @@ local function setvisual(n,a,what,list) -- this will become more efficient when
if not a or a == 0 or a == unsetvalue then
a = preset_makeup
else
- a = bor(a,preset_makeup)
+ a = a | preset_makeup
end
elseif n == "boxes" then
if not a or a == 0 or a == unsetvalue then
a = preset_boxes
else
- a = bor(a,preset_boxes)
+ a = a | preset_boxes
end
elseif n == "all" then
if what == false then
@@ -276,9 +277,9 @@ local function setvisual(n,a,what,list) -- this will become more efficient when
elseif not a or a == 0 or a == unsetvalue then
a = preset_all
else
- a = bor(a,preset_all)
+ a = a | preset_all
end
- else
+ elseif type(n) == "string" then
for s in gmatch(n,"[a-z]+") do
local m = modes[s]
if not m then
@@ -286,9 +287,15 @@ local function setvisual(n,a,what,list) -- this will become more efficient when
elseif not a or a == 0 or a == unsetvalue then
a = m
else
- a = bor(a,m)
+ a = a | m
end
end
+ elseif type(n) == "number" then
+ if not a or a == 0 or a == unsetvalue then
+ a = n
+ else
+ a = a | n
+ end
end
if not a or a == 0 or a == unsetvalue then
return unsetvalue
@@ -299,7 +306,14 @@ local function setvisual(n,a,what,list) -- this will become more efficient when
end
function nuts.setvisual(n,mode)
- setattr(n,a_visual,setvisual(mode,getattr(n,a_visual),true))
+ if mode then
+ setattr(n,a_visual,setvisual(mode,getattr(n,a_visual),true))
+ else
+ local a = texgetattribute(a_visual)
+ if a ~= unsetvalue then
+ setattr(n,a_visual,a)
+ end
+ end
end
function nuts.setvisuals(n,mode) -- currently the same
@@ -372,7 +386,6 @@ for mode, value in next, modes do
end
local fraction = 10
-local normalize = true
trackers .register("visualizers.reset", function(v) set("reset", v) end)
trackers .register("visualizers.all", function(v) set("all", v) end)
@@ -380,71 +393,102 @@ trackers .register("visualizers.makeup", function(v) set("makeup",v) end)
trackers .register("visualizers.boxes", function(v) set("boxes", v) end)
directives.register("visualizers.fraction", function(v) fraction = (v and tonumber(v)) or (v == "more" and 5) or 10 end)
-local c_positive = "trace:b"
-local c_negative = "trace:r"
-local c_zero = "trace:g"
-local c_text = "trace:s"
-local c_space = "trace:y"
-local c_space_x = "trace:m"
-local c_skip_a = "trace:c"
-local c_skip_b = "trace:m"
-local c_glyph = "trace:o"
-local c_ligature = "trace:s"
-local c_white = "trace:w"
------ c_math = "trace:s"
------ c_origin = "trace:o"
------ c_discretionary = "trace:d"
------ c_expansion = "trace:o"
-local c_depth = "trace:o"
-local c_indent = "trace:s"
-
-local c_positive_d = "trace:db"
-local c_negative_d = "trace:dr"
-local c_zero_d = "trace:dg"
-local c_text_d = "trace:ds"
-local c_space_d = "trace:dy"
-local c_space_x_d = "trace:dm"
-local c_skip_a_d = "trace:dc"
-local c_skip_b_d = "trace:dm"
-local c_glyph_d = "trace:do"
-local c_ligature_d = "trace:ds"
-local c_white_d = "trace:dw"
-local c_math_d = "trace:dr"
-local c_origin_d = "trace:do"
-local c_discretionary_d = "trace:dd"
------ c_expansion_d = "trace:do"
------ c_depth_d = "trace:do"
------ c_indent_d = "trace:ds"
-
-- we can just paste verbatim together .. no typesetting needed
+-- experiment ... we can move the font definition away too
+
+ local expandmacro = token.expand_macro
+ local takebox = tex.takebox
+
+ local function hpack_string(str)
+ expandmacro("syst_v_p",true,str)
+ return tonut(takebox("scratchbox"))
+ end
+
+-- ... if okay it will replace the current hpack_string in node_typ
+
+-- local function sometext(str,layer,color,textcolor,lap,variant)
+-- local text = hpack_string(str,usedfont)
+-- local size = getwidth(text)
+-- local rule = new_rule(size,2*exheight,exheight/2)
+-- local kern = new_kern(-size)
+-- if color then
+-- setcolor(rule,color)
+-- end
+-- if textcolor then
+-- setlistcolor(getlist(text),textcolor)
+-- end
+-- local info = setlink(rule,kern,text)
+-- setlisttransparency(info,"trace:g")
+-- info = hpack_nodes(info)
+-- local width = getwidth(info)
+-- if variant then
+-- setoffsets(info,0,variant*exheight)
+-- end
+-- if lap then
+-- info = new_hlist(setlink(new_kern(-width),info)) -- use xoffset and set info wd to 0
+-- else
+-- info = new_hlist(info) -- a bit overkill: double wrapped
+-- end
+-- if layer then
+-- setattr(info,a_layer,layer)
+-- end
+-- return info, width
+-- end
+
+-- local function sometext(str,layer,color,textcolor,lap,variant)
+-- local text = hpack_string(str,usedfont)
+-- local size = getwidth(text)
+-- local rule = new_virtual_rule(size,2*exheight,exheight/2)
+-- if color then
+-- setcolor(rule,color)
+-- end
+-- if textcolor then
+-- setlistcolor(getlist(text),textcolor)
+-- end
+-- local info = setlink(rule,text)
+-- setlisttransparency(info,"trace:g")
+-- info = hpack_nodes(info)
+-- if variant then
+-- setoffsets(info,0,variant*exheight)
+-- end
+-- info = new_hlist(info) -- a bit overkill: double wrapped
+-- if lap then
+-- setoffsets(info,-size)
+-- end
+-- if layer then
+-- setattr(info,a_layer,layer)
+-- end
+-- return info, size
+-- end
+
local function sometext(str,layer,color,textcolor,lap,variant)
local text = hpack_string(str,usedfont)
local size = getwidth(text)
- local rule = new_rule(size,2*exheight,exheight/2)
- local kern = new_kern(-size)
+ local rule = new_virtual_rule(size,2*exheight,exheight/2)
if color then
setcolor(rule,color)
end
if textcolor then
setlistcolor(getlist(text),textcolor)
end
- local info = setlink(rule,kern,text)
- setlisttransparency(info,c_zero)
- info = hpack_nodes(info)
- local width = getwidth(info)
+ local info = setlink(rule,text)
+ setlisttransparency(info,"trace:g")
+ info = new_hlist(info)
+ local x, y
+ if lap then
+ x = -size
+ end
if variant then
- nuts.setoffsets(info,0,variant*exheight)
+ y = variant * exheight
end
- if lap then
- info = new_hlist(setlink(new_kern(-width),info))
- else
- info = new_hlist(info) -- a bit overkill: double wrapped
+ if x or y then
+ setoffsets(info,x,y)
end
if layer then
setattr(info,a_layer,layer)
end
- return info, width
+ return info, size
end
local function someblob(str,layer,color,textcolor,width)
@@ -459,7 +503,7 @@ local function someblob(str,layer,color,textcolor,width)
setlistcolor(getlist(text),textcolor)
end
local info = setlink(rule,kern,text)
- setlisttransparency(info,c_zero)
+ setlisttransparency(info,"trace:g")
info = hpack_nodes(info)
local width = getwidth(info)
info = new_hlist(info)
@@ -471,12 +515,13 @@ end
local caches = setmetatableindex("table")
-local fontkern, italickern, marginkern, mathlistkern do
+local fontkern, italickern, marginkern, mathkern do
local f_cache = caches["fontkern"]
local i_cache = caches["italickern"]
+ local s_cache = caches["shapekern"]
local m_cache = caches["marginkern"]
- local l_cache = caches["mathlistkern"]
+ local l_cache = caches["mathkern"]
local function somekern(head,current,cache,color,layer)
local width = getkern(current)
@@ -488,11 +533,11 @@ local fontkern, italickern, marginkern, mathlistkern do
local rule = new_rule(emwidth/fraction,6*exheight,2*exheight)
local list = getlist(text)
if kern > 0 then
- setlistcolor(list,c_positive_d)
+ setlistcolor(list,"trace:db")
elseif kern < 0 then
- setlistcolor(list,c_negative_d)
+ setlistcolor(list,"trace:dr")
else
- setlistcolor(list,c_zero_d)
+ setlistcolor(list,"trace:dg")
end
setlisttransparency(list,color)
setcolor(rule,color)
@@ -500,58 +545,61 @@ local fontkern, italickern, marginkern, mathlistkern do
setshift(text,-5 * exheight)
info = new_hlist(setlink(rule,text))
setattr(info,a_layer,layer)
- f_cache[kern] = info
+ cache[kern] = info
end
- head = insert_node_before(head,current,copy_list(info))
+ head = insertnodebefore(head,current,copylist(info))
return head, current
end
fontkern = function(head,current)
- return somekern(head,current,f_cache,c_text_d,l_fontkern)
+ return somekern(head,current,f_cache,"trace:ds",l_fontkern)
end
italickern = function(head,current)
- return somekern(head,current,i_cache,c_glyph_d,l_italic)
+ return somekern(head,current,i_cache,"trace:do",l_italic)
+ end
+
+ mathshapekern = function(head,current)
+ return somekern(head,current,s_cache,"trace:do",l_mathshapekern)
end
marginkern = function(head,current)
- return somekern(head,current,m_cache,c_glyph_d,l_marginkern)
+ return somekern(head,current,m_cache,"trace:do",l_marginkern)
end
- mathlistkern = function(head,current)
- return somekern(head,current,l_cache,c_glyph_d,l_mathlistkern)
+ mathkern = function(head,current)
+ return somekern(head,current,l_cache,"trace:do",l_mathkern)
end
end
-local glyphexpansion do
+local ruledglyphexpansion do
local f_cache = caches["glyphexpansion"]
- glyphexpansion = function(head,current)
+ ruledglyphexpansion = function(head,current)
local extra = getexpansion(current)
if extra and extra ~= 0 then
extra = extra / 1000
local info = f_cache[extra]
if not info then
- local text = hpack_string(round(extra),usedfont)
+ local text = hpack_string(tostring(round(extra)),usedfont)
local rule = new_rule(emwidth/fraction,exheight,2*exheight)
local list = getlist(text)
if extra > 0 then
- setlistcolor(list,c_positive_d)
+ setlistcolor(list,"trace:db")
elseif extra < 0 then
- setlistcolor(list,c_negative_d)
+ setlistcolor(list,"trace:dr")
end
- setlisttransparency(list,c_text_d)
- setcolor(rule,c_text_d)
- settransparency(rule,c_text_d)
- setshift(text,1.5 * exheight)
+ setlisttransparency(list,"trace:ds")
+ setcolor(rule,"trace:ds")
+ settransparency(rule,"trace:ds")
+ setshift(text,1.75 * exheight)
info = new_hlist(setlink(rule,text))
setattr(info,a_layer,l_expansion)
f_cache[extra] = info
end
- head = insert_node_before(head,current,copy_list(info))
- return head, current
+ head = insertnodebefore(head,current,copylist(info))
end
return head, current
end
@@ -570,31 +618,73 @@ local kernexpansion do
extra = extra / 1000
local info = f_cache[extra]
if not info then
- local text = hpack_string(round(extra),usedfont)
+ local text = hpack_string(tostring(round(extra)),usedfont)
local rule = new_rule(emwidth/fraction,exheight,4*exheight)
local list = getlist(text)
if extra > 0 then
- setlistcolor(list,c_positive_d)
+ setlistcolor(list,"trace:db")
elseif extra < 0 then
- setlistcolor(list,c_negative_d)
+ setlistcolor(list,"trace:dr")
end
- setlisttransparency(list,c_text_d)
- setcolor(rule,c_text_d)
- settransparency(rule,c_text_d)
+ setlisttransparency(list,"trace:ds")
+ setcolor(rule,"trace:ds")
+ settransparency(rule,"trace:ds")
setshift(text,3.5 * exheight)
info = new_hlist(setlink(rule,text))
setattr(info,a_layer,l_expansion)
f_cache[extra] = info
end
- head = insert_node_before(head,current,copy_list(info))
- return head, current
+ head = insertnodebefore(head,current,copylist(info))
end
return head, current
end
end
-local whatsit do
+local ruledmark do
+
+ local set_code = nodes.markcodes.set
+
+ local sm_cache = setmetatableindex(caches["setmark"], function(t,index)
+ local info = sometext(formatters["SM:%i"](index),usedfont,nil,"trace:w") -- whatsit
+ setattr(info,a_layer,l_mark)
+ t[index] = info
+ return info
+ end)
+
+ local rm_cache = setmetatableindex(caches["resetmark"], function(t,index)
+ local info = sometext(formatters["RM:%i"](index),usedfont,nil,"trace:w") -- whatsit
+ setattr(info,a_layer,l_mark)
+ t[index] = info
+ return info
+ end)
+
+ ruledmark = function(head,current)
+ local index = getindex(current)
+ local info = getsubtype(current) == set_code and sm_cache[index] or rm_cache[index]
+ head, current = insertnodeafter(head,current,copylist(info))
+ return head, current
+ end
+
+end
+
+local ruledinsert do
+
+ local si_cache = setmetatableindex(caches["insert"], function(f,index)
+ local info = sometext(formatters["SI:%i"](index),usedfont,nil,"trace:w") -- whatsit
+ setattr(info,a_layer,l_insert)
+ si_cache[index] = info
+ end)
+
+ ruledinsert = function(head,current)
+ local info = si_cache[getindex(current)]
+ head, current = insertnodeafter(head,current,copylist(info))
+ return head, current
+ end
+
+end
+
+local ruledwhatsit do
local whatsitcodes = nodes.whatsitcodes
local w_cache = caches["whatsit"]
@@ -624,23 +714,51 @@ local whatsit do
[whatsitcodes.setstate] = "SET", -- can't happen because these are added after visualizing
}
- whatsit = function(head,current)
+ ruledwhatsit = function(head,current)
local what = getsubtype(current)
local info = w_cache[what]
if info then
-- print("hit whatsit")
else
- info = sometext(formatters["W:%s"](tags[what] or what),usedfont,nil,c_white)
+ info = sometext(formatters["W:%s"](tags[what] or what),usedfont,nil,"trace:w")
setattr(info,a_layer,l_whatsit)
w_cache[what] = info
end
- head, current = insert_node_after(head,current,copy_list(info))
+ head, current = insertnodeafter(head,current,copylist(info))
return head, current
end
end
-local dir, par do
+local ruledboundary do
+
+ local boundarycodes = nodes.boundarycodes
+ local b_cache = caches["boundary"]
+
+ local tags = {
+ [boundarycodes.cancel] = "CAN",
+ [boundarycodes.user] = "USR",
+ [boundarycodes.protrusion] = "PRO",
+ [boundarycodes.word] = "WRD",
+ }
+
+ ruledboundary = function(head,current)
+ local what = getsubtype(current)
+ local info = b_cache[what]
+ if info then
+ -- print("hit whatsit")
+ else
+ info = sometext(formatters["B:%s"](tags[what] or what),usedfont,nil,"trace:w")
+ setattr(info,a_layer,l_boundary)
+ b_cache[what] = info
+ end
+ head, current = insertnodeafter(head,current,copylist(info))
+ return head, current
+ end
+
+end
+
+local ruleddir, ruledpar do
local dircodes = nodes.dircodes
local dirvalues = nodes.dirvalues
@@ -660,22 +778,23 @@ local dir, par do
par = "PAR",
}
- par = function(head,current)
+ ruledpar = function(head,current)
local what = "par" -- getsubtype(current)
local info = d_cache[what]
if info then
-- print("hit par")
else
- info = sometext(formatters["L:%s"](what),usedfont,nil,c_white)
+ info = sometext(formatters["L:%s"](what),usedfont,nil,"trace:w")
setattr(info,a_layer,l_dir)
d_cache[what] = info
end
+ head, current = insertnodeafter(head,current,copylist(info))
return head, current
end
- dir = function(head,current)
+ ruleddir = function(head,current)
local what = getsubtype(current)
- if what == cancelcode then
+ if what == cancel_code then
what = "cancel"
elseif getdirection(current) == r2l_code then
what = "r2l"
@@ -686,20 +805,21 @@ local dir, par do
if info then
-- print("hit dir")
else
- info = sometext(formatters["D:%s"](what),usedfont,nil,c_white)
+ info = sometext(formatters["D:%s"](what),usedfont,nil,"trace:w")
setattr(info,a_layer,l_dir)
d_cache[what] = info
end
+ head, current = insertnodeafter(head,current,copylist(info))
return head, current
end
end
-local user do
+local ruleduser do
local u_cache = caches["user"]
- user = function(head,current)
+ ruleduser = function(head,current)
local what = getsubtype(current)
local info = u_cache[what]
if info then
@@ -709,46 +829,7 @@ local user do
setattr(info,a_layer,l_user)
u_cache[what] = info
end
- head, current = insert_node_after(head,current,copy_list(info))
- return head, current
- end
-
-end
-
-local math do
-
- local mathcodes = nodes.mathcodes
- local m_cache = {
- beginmath = caches["bmath"],
- endmath = caches["emath"],
- }
- local tags = {
- beginmath = "B",
- endmath = "E",
- }
-
- math = function(head,current)
- local what = getsubtype(current)
- local tag = mathcodes[what]
- local skip = getkern(current) + getwidth(current) -- surround
- local info = m_cache[tag][skip]
- if info then
- -- print("hit math")
- else
- local text, width = sometext(formatters["M:%s"](tag and tags[tag] or what),usedfont,nil,c_math_d)
- local rule = new_rule(skip,-655360/fraction,2*655360/fraction)
- setcolor(rule,c_math_d)
- settransparency(rule,c_math_d)
- setattr(rule,a_layer,l_math)
- if tag == "beginmath" then
- info = new_hlist(setlink(new_glue(-skip),rule,new_glue(-width),text))
- else
- info = new_hlist(setlink(new_glue(-skip),rule,new_glue(-skip),text))
- end
- setattr(info,a_layer,l_math)
- m_cache[tag][skip] = info
- end
- head, current = insert_node_after(head,current,copy_list(info))
+ head, current = insertnodeafter(head,current,copylist(info))
return head, current
end
@@ -760,8 +841,8 @@ local ruleddepth do
local wd, ht, dp = getwhd(current)
if dp ~= 0 then
local rule = new_rule(wd,0,dp)
- setcolor(rule,c_depth)
- settransparency(rule,c_zero)
+ setcolor(rule,"trace:o")
+ settransparency(rule,"trace:g")
setattr(rule,a_layer,l_depth)
setlist(current,setlink(rule,new_kern(-wd),getlist(current)))
end
@@ -774,13 +855,16 @@ local ruledbox do
local b_cache = caches["box"]
local o_cache = caches["origin"]
- local getshift = nuts.getshift
+ local getshift = nuts.getshift
+ local getorientation = nuts.getorientation
+ local setorientation = nuts.setorientation
+ local getheight = nuts.getheight
setmetatableindex(o_cache,function(t,size)
local rule = new_rule(2*size,size,size)
local origin = hpack_nodes(rule)
- setcolor(rule,c_origin_d)
- settransparency(rule,c_origin_d)
+ setcolor(rule,"trace:do")
+ settransparency(rule,"trace:do")
setattr(rule,a_layer,l_origin)
t[size] = origin
return origin
@@ -788,97 +872,131 @@ local ruledbox do
ruledbox = function(head,current,vertical,layer,what,simple,previous,trace_origin,parent)
local wd, ht, dp = getwhd(current)
+-- local wd, ht, dh, shift = nuts.getlistdimensions(current) -- MAYBE
local force_origin = wd == 0 or (dp + ht) == 0
- local shift = getshift(current)
- local next = getnext(current)
- local prev = previous
- setboth(current)
- local linewidth = emwidth/fraction
- local size = 2*linewidth
- local this
- if not simple then
- this = b_cache[what]
- if not this then
- local text = hpack_string(what,usedfont)
- this = setlink(new_kern(-getwidth(text)),text)
- setlisttransparency(this,c_text)
- this = new_hlist(this)
- b_cache[what] = this
- end
+ local shift = getshift(current)
+-- print(getorientation(current,true))
+ local orientation, xoffset, yoffset, w, h, d = getorientation(current) -- TODO
+if orientation and orientation ~= 0 and (h ~= 0 or d ~= 0) then
+-- wd = w
+ ht = h
+ dp = d
+end
+ local next = getnext(current)
+ local prev = previous
+ setboth(current)
+ local linewidth = emwidth/fraction
+ local size = 2*linewidth
+ local this
+ if not simple then
+ this = b_cache[what]
+ if not this then
+ local text = hpack_string(what,usedfont)
+ this = setlink(new_kern(-getwidth(text)),text)
+ setlisttransparency(this,"trace:s")
+ this = new_hlist(this)
+ b_cache[what] = this
end
- -- we need to trigger the right mode (else sometimes no whatits)
- local info = setlink(
- this and copy_list(this) or nil,
- (force_origin and emptyrule(wd,ht,dp)) -- we accept some overhead
- or (dp == 0 and outlinerule and outlinerule(wd,ht,dp,linewidth))
- or userrule {
- width = wd,
- height = ht,
- depth = dp,
- line = linewidth,
- type = "box",
- dashed = 3*size,
- }
- )
- --
- setlisttransparency(info,c_text)
- info = new_hlist(info) -- important
- --
- setattr(info,a_layer,layer)
- if vertical then
- if not force_origin and shift == 0 then
- info = setlink(current,dp ~= 0 and new_kern(-dp) or nil,info)
- elseif trace_origin or force_origin then
- local size = 2*size
- local origin = o_cache[size]
- origin = copy_list(origin)
- if getid(parent) == vlist_code then
- setshift(origin,-shift)
- info = setlink(current,new_kern(-size),origin,new_kern(-size-dp),info)
- else
- -- todo .. i need an example
- info = setlink(current,dp ~= 0 and new_kern(-dp) or nil,info)
- end
- setshift(current,0)
+ end
+ local rest, more
+ if force_origin then
+ rest = emptyrule(wd,ht,dp) -- we accept some overhead
+ elseif what == "_D_" then
+ -- also the other line
+ local up = nil
+ local list = getlist(current)
+ if list then
+ up = getheight(list)
+ end
+ rest = userrule {
+ width = wd,
+ height = ht,
+ depth = dp,
+ line = linewidth,
+ type = "box",
+ dashed = 3*size,
+ double = ht - up,
+ }
+ elseif dp == 0 then
+ rest = userrule {
+ width = wd,
+ height = ht,
+ line = linewidth,
+ type = "box",
+ baseline = false,
+ }
+ else
+ rest = userrule {
+ width = wd,
+ height = ht,
+ depth = dp,
+ line = linewidth,
+ type = "box",
+ dashed = 3*size,
+ }
+ end
+ --
+ local info = setlink(this and copylist(this) or nil,rest,more)
+ --
+ setlisttransparency(info,"trace:s")
+ info = new_hlist(info) -- important
+ --
+ setattr(info,a_layer,layer)
+ if vertical then
+ if not force_origin and shift == 0 then
+ info = setlink(current,dp ~= 0 and new_kern(-dp) or nil,info)
+ elseif trace_origin or force_origin then
+ local size = 2*size
+ local origin = o_cache[size]
+ origin = copylist(origin)
+ if getid(parent) == vlist_code then
+ setshift(origin,-shift)
+ info = setlink(current,new_kern(-size),origin,new_kern(-size-dp),info)
else
- info = setlink(current,new_dp ~= 0 and new_kern(-dp) or nil,info)
- setshift(current,0)
+ -- todo .. i need an example
+ info = setlink(current,dp ~= 0 and new_kern(-dp) or nil,info)
end
- info = new_vlist(info,wd,ht,dp,shift)
+ setshift(current,0)
else
- if not force_origin and shift == 0 then
- info = setlink(current,new_kern(-wd),info)
- elseif trace_origin or force_origin then
- local size = 2*size
- local origin = o_cache[size]
- origin = copy_list(origin)
- if getid(parent) == vlist_code then
- info = setlink(current,new_kern(-wd-size-shift),origin,new_kern(-size+shift),info)
- else
- setshift(origin,-shift)
- info = setlink(current,new_kern(-wd-size),origin,new_kern(-size),info)
- end
- setshift(current,0)
+ info = setlink(current,new_dp ~= 0 and new_kern(-dp) or nil,info)
+ setshift(current,0)
+ end
+ info = new_vlist(info,wd,ht,dp,shift)
+ else
+ if not force_origin and shift == 0 then
+ info = setlink(current,new_kern(-wd),info)
+ elseif trace_origin or force_origin then
+ local size = 2*size
+ local origin = o_cache[size]
+ origin = copylist(origin)
+ if getid(parent) == vlist_code then
+ info = setlink(current,new_kern(-wd-size-shift),origin,new_kern(-size+shift),info)
else
- info = setlink(current,new_kern(-wd),info)
- setshift(current,0)
+ setshift(origin,-shift)
+ info = setlink(current,new_kern(-wd-size),origin,new_kern(-size),info)
end
- info = new_hlist(info,wd,ht,dp,shift)
- end
- if next then
- setlink(info,next)
- end
- if prev and prev > 0 then
- setlink(prev,info)
- end
- if head == current then
- return info, info
+ setshift(current,0)
else
- return head, info
+ info = setlink(current,new_kern(-wd),info)
+ setshift(current,0)
end
- -- else
- -- return head, current
- -- end
+ info = new_hlist(info,wd,ht,dp,shift)
+ end
+-- if orientation then
+-- setorientation(current,0,0)
+-- setorientation(info,orientation,xoffset,yoffset)
+-- end
+ if next then
+ setlink(info,next)
+ end
+ if prev and prev > 0 then
+ setlink(prev,info)
+ end
+ if head == current then
+ return info, info
+ else
+ return head, info
+ end
end
end
@@ -889,30 +1007,42 @@ local ruledglyph do
-- have a frozen color anyway or i need a more detailed cache .. below is a more
-- texie approach
+ -- local ligature_code = 0x8000 + nodes.glyphcodes.ligature
+
ruledglyph = function(head,current,previous) -- wrong for vertical glyphs
- local wd = getwidth(current)
+ local wd, ht, dp = getglyphdimensions(current)
if wd ~= 0 then
- local wd, ht, dp = getwhd(current)
local next = getnext(current)
local prev = previous
setboth(current)
local linewidth = emwidth/(2*fraction)
local x_offset, y_offset, l_margin, r_margin, raise = getoffsets(current)
- local info = setlink((dp == 0 and outlinerule and outlinerule(wd,ht,dp,linewidth)) or userrule {
+-- local info = setlink((dp == 0 and outlinerule and outlinerule(wd,ht,dp,linewidth)) or userrule {
+-- width = wd,
+-- height = ht,
+-- depth = dp,
+-- line = linewidth,
+-- type = "box",
+-- },new_kern(-wd))
+-- if ht == 0 and dp == 0 then
+-- ht = linewidth/2
+-- dp = ht
+-- end
+ local info = (dp == 0 and outlinerule and outlinerule(wd,ht,dp,linewidth)) or userrule {
width = wd,
height = ht,
depth = dp,
line = linewidth,
type = "box",
- },new_kern(-wd))
+ }
local c, f = isglyph(current)
local char = chardata[f][c]
if char and type(char.unicode) == "table" then -- hackery test
- setlistcolor(info,c_ligature)
- setlisttransparency(info,c_ligature_d)
+ setlistcolor(info,"trace:s")
+ setlisttransparency(info,"trace:ds")
else
- setlistcolor(info,c_glyph)
- setlisttransparency(info,c_glyph_d)
+ setlistcolor(info,"trace:o")
+ setlisttransparency(info,"trace:do")
end
info = new_hlist(info)
setattr(info,a_layer,l_glyph)
@@ -941,9 +1071,10 @@ local ruledglyph do
end
-local ruledglue do
+local ruledglue, ruledmathglue do
- local effectiveglue = nuts.effective_glue
+ local effectiveglue = nuts.effectiveglue
+ local iszeroglue = nuts.iszeroglue
local gluecodes = nodes.gluecodes
@@ -958,19 +1089,19 @@ local ruledglue do
local righthangskip_code = gluecodes.righthangskip
local parfillleftskip_code = gluecodes.parfillleftskip or parfillskip_code
local parfillrightskip_code = gluecodes.parfillrightskip or parfillskip_code
+ local parinitleftskip_code = gluecodes.parinitleftskip
+ local parinitrightskip_code = gluecodes.parinitrightskip
local indentskip_code = gluecodes.indentskip
+ local intermathskip_code = gluecodes.intermathskip
local correctionskip_code = gluecodes.correctionskip
+ local tabskip_code = gluecodes.tabskip
local g_cache_v = caches["vglue"]
local g_cache_h = caches["hglue"]
- local g_cache_ls = caches["leftskip"]
- local g_cache_rs = caches["rightskip"]
- local g_cache_lh = caches["lefthang"]
- local g_cache_rh = caches["righthang"]
- local g_cache_lp = caches["parfillleftskip"]
- local g_cache_rp = caches["parfillrightskip"]
- local g_cache_is = caches["indentskip"]
- local g_cache_cs = caches["correctionskip"]
+
+ local g_cache_gn = caches["gluename"]
+ local g_cache_gz = caches["gluezero"]
+ local g_cache_gf = caches["gluefixed"]
local tags = {
-- [userskip_code] = "US",
@@ -983,11 +1114,11 @@ local ruledglue do
[gluecodes.belowdisplayshortskip] = "SB",
[gluecodes.topskip] = "TS",
[gluecodes.splittopskip] = "ST",
- [gluecodes.tabskip] = "AS",
+ [tabskip_code] = "TB",
[gluecodes.thinmuskip] = "MS",
[gluecodes.medmuskip] = "MM",
[gluecodes.thickmuskip] = "ML",
- [gluecodes.intermathskip] = "IM",
+ [intermathskip_code] = "IM",
[gluecodes.keepskip or 99] = "KS",
[gluecodes.mathskip] = "MT",
[gluecodes.leaders] = "NL",
@@ -1005,6 +1136,8 @@ local ruledglue do
[zerospaceskip_code] = "ZS",
[parfillleftskip_code] = "PL",
[parfillrightskip_code] = "PR",
+ [parinitleftskip_code] = "IL",
+ [parinitrightskip_code] = "IR",
[indentskip_code] = "IN",
[correctionskip_code] = "CS",
}
@@ -1014,140 +1147,313 @@ local ruledglue do
[righthangskip_code] = 0.5,
[leftskip_code] = -2,
[rightskip_code] = -2,
+ [parinitleftskip_code] = -1.3775,
+ [parinitrightskip_code] = -1.3775,
[parfillleftskip_code] = -0.75,
[parfillrightskip_code] = -0.75,
}
- -- we sometimes pass previous as we can have issues in math (not watertight for all)
+ local f_amount = formatters["%s:%0.3f"]
+
+-- ruledglue = function(head,current,vertical,parent)
+-- local subtype = getsubtype(current)
+-- local width = effectiveglue(current,parent)
+-- local stag = stags[subtype]
+-- local amount = f_amount(tags[subtype] or (vertical and "VS") or "HS",width*pt_factor) -- can be sped up
+-- local info = (vertical and g_cache_v or g_cache_h)[amount]
+-- if subtype == intermathskip_code then
+-- head = ruledmathglue(head, current)
+-- end
+-- if info then
+-- -- print("glue hit")
+-- else
+-- if subtype == spaceskip_code or subtype == xspaceskip_code or subtype == zerospaceskip_code then
+-- info = sometext(amount,l_glue,"trace:y")
+-- elseif subtype == userskip_code then
+-- if width > 0 then
+-- info = sometext(amount,l_glue,"trace:b")
+-- elseif width < 0 then
+-- info = sometext(amount,l_glue,"trace:r")
+-- else
+-- info = sometext(amount,l_glue,"trace:g")
+-- end
+-- elseif subtype == tabskip_code then
+-- info = sometext(amount,l_glue,"trace:s")
+-- elseif subtype == indentskip_code or subtype == correctionskip_code then
+-- info = sometext(amount,l_glue,"trace:s")
+-- elseif subtype == leftskip_code then
+-- info = sometext(amount,l_glue,"trace:y",false,true,stag)
+-- elseif subtype == rightskip_code then
+-- info = sometext(amount,l_glue,"trace:y",false,false,stag)
+-- elseif subtype == lefthangskip_code then
+-- info = sometext(amount,l_glue,"trace:y",false,true,stag)
+-- elseif subtype == righthangskip_code then
+-- info = sometext(amount,l_glue,"trace:y",false,false,stag)
+-- elseif subtype == parfillleftskip_code then
+-- info = sometext(amount,l_glue,"trace:s",false,true,stag)
+-- elseif subtype == parfillrightskip_code then
+-- info = sometext(amount,l_glue,"trace:s",false,false,stag)
+-- elseif subtype == parinitleftskip_code then
+-- info = sometext(amount,l_glue,"trace:s",false,true,stag)
+-- elseif subtype == parinitrightskip_code then
+-- info = sometext(amount,l_glue,"trace:s",false,false,stag)
+-- else
+-- info = sometext(amount,l_glue,"trace:m")
+-- end
+-- (vertical and g_cache_v or g_cache_h)[amount] = info
+-- end
+-- info = copylist(info)
+-- if vertical then
+-- info = vpack_nodes(info)
+-- end
+-- head, current = insertnodebefore(head,current,info)
+-- return head, getnext(current)
+-- end
+
+ local g_caches = { } for k, v in next, tags do g_caches[k] = caches[v] end
ruledglue = function(head,current,vertical,parent)
local subtype = getsubtype(current)
local width = effectiveglue(current,parent)
- local stag = normalize and stags[subtype]
- local amount = formatters["%s:%0.3f"](tags[subtype] or (vertical and "VS") or "HS",width*pt_factor)
- local info = (vertical and g_cache_v or g_cache_h)[amount]
+ local stag = stags[subtype]
+ local cache = g_caches[subtype] or (vertical and g_cache_v) or g_cache_h
+ local info = cache[amount]
+ if subtype == intermathskip_code then
+ head = ruledmathglue(head, current)
+ end
if info then
-- print("glue hit")
else
+ local amount = f_amount(tags[subtype] or (vertical and "VS") or "HS",width*pt_factor)
if subtype == spaceskip_code or subtype == xspaceskip_code or subtype == zerospaceskip_code then
- info = sometext(amount,l_glue,c_space)
+ info = sometext(amount,l_glue,"trace:y")
elseif subtype == userskip_code then
if width > 0 then
- info = sometext(amount,l_glue,c_positive)
+ info = sometext(amount,l_glue,"trace:b")
elseif width < 0 then
- info = sometext(amount,l_glue,c_negative)
+ info = sometext(amount,l_glue,"trace:r")
else
- info = sometext(amount,l_glue,c_zero)
+ info = sometext(amount,l_glue,"trace:g")
end
+ elseif subtype == tabskip_code then
+ info = sometext(amount,l_glue,"trace:s")
elseif subtype == indentskip_code or subtype == correctionskip_code then
- info = sometext(amount,l_glue,c_indent)
+ info = sometext(amount,l_glue,"trace:s")
elseif subtype == leftskip_code then
- info = sometext(amount,l_glue,normalize and c_space or c_skip_a,false,true,stag)
+ info = sometext(amount,l_glue,"trace:y",false,true,stag)
elseif subtype == rightskip_code then
- info = sometext(amount,l_glue,normalize and c_space or c_skip_a,false,false,stag)
+ info = sometext(amount,l_glue,"trace:y",false,false,stag)
elseif subtype == lefthangskip_code then
- info = sometext(amount,l_glue,normalize and c_space or c_skip_b,false,true,stag)
+ info = sometext(amount,l_glue,"trace:y",false,true,stag)
elseif subtype == righthangskip_code then
- info = sometext(amount,l_glue,normalize and c_space or c_skip_b,false,false,stag)
+ info = sometext(amount,l_glue,"trace:y",false,false,stag)
elseif subtype == parfillleftskip_code then
- info = sometext(amount,l_glue,c_indent,false,true,stag)
+ info = sometext(amount,l_glue,"trace:s",false,true,stag)
elseif subtype == parfillrightskip_code then
- info = sometext(amount,l_glue,c_indent,false,false,stag)
+ info = sometext(amount,l_glue,"trace:s",false,false,stag)
+ elseif subtype == parinitleftskip_code then
+ info = sometext(amount,l_glue,"trace:s",false,true,stag)
+ elseif subtype == parinitrightskip_code then
+ info = sometext(amount,l_glue,"trace:s",false,false,stag)
else
- info = sometext(amount,l_glue,c_skip_b)
+ info = sometext(amount,l_glue,"trace:m")
end
- (vertical and g_cache_v or g_cache_h)[amount] = info
+ cache[amount] = info
end
- ::PICKIP::
- info = copy_list(info)
+ info = copylist(info)
if vertical then
info = vpack_nodes(info)
end
- head, current = insert_node_before(head,current,info)
+ head, current = insertnodebefore(head,current,info)
return head, getnext(current)
end
- -- ruledspace = function(head,current,parent)
- -- local subtype = getsubtype(current)
- -- if subtype == spaceskip_code or subtype == xspaceskip_code or subtype == zerospaceskip_code then
- -- local width = effectiveglue(current,parent)
- -- local amount = formatters["%s:%0.3f"](tags[subtype] or "HS",width*pt_factor)
- -- local info = g_cache_h[amount]
- -- if info then
- -- -- print("space hit")
- -- else
- -- info = sometext(amount,l_glue,c_space)
- -- g_cache_h[amount] = info
- -- end
- -- info = copy_list(info)
- -- head, current = insert_node_before(head,current,info)
- -- return head, getnext(current)
- -- else
- -- return head, current
- -- end
- -- end
-
local g_cache_s = caches["space"]
local g_cache_x = caches["xspace"]
ruledspace = function(head,current,parent)
local subtype = getsubtype(current)
- if subtype == spaceskip_code or subtype == xspaceskip_code or subtype == zerospaceskip_code then -- not yet all space
- local width = effectiveglue(current,parent)
- local info
- if subtype == spaceskip_code then
- info = g_cache_s[width]
- if not info then
- info = someblob("SP",l_glue,c_space,nil,width)
- g_cache_s[width] = info
- end
- else
- info = g_cache_x[width]
- if not info then
- info = someblob("XS",l_glue,c_space_x,nil,width)
- g_cache_x[width] = info
- end
+ local width = effectiveglue(current,parent)
+ local info
+ if subtype == spaceskip_code then
+ info = g_cache_s[width]
+ if not info then
+ info = someblob("SP",l_glue,"trace:y",nil,width)
+ g_cache_s[width] = info
end
- info = copy_list(info)
- head, current = insert_node_before(head,current,info)
- return head, getnext(current)
else
- return head, current
+ info = g_cache_x[width]
+ if not info then
+ info = someblob("XS",l_glue,"trace:m",nil,width)
+ g_cache_x[width] = info
+ end
+ end
+ info = copylist(info)
+ head, current = insertnodebefore(head,current,info)
+ return head, getnext(current)
+ end
+
+ -- we sometimes pass previous as we can have issues in math (not watertight for all)
+
+ local mathvalues = nodes.mathvalues
+
+ mathvalues[-1] = "left"
+ mathvalues[-2] = "right"
+
+ local morehack = setmetatableindex(function(t,k)
+ local v = mathematics.classnames[k] -- yet unknown
+ v = v and string.sub(v,1,3) or string.formatters["x%02x"](k)
+ t[k] = v
+ return v
+ end)
+
+ local temphack = setmetatableindex(function(t,k)
+ local v = mathvalues[k]
+ if v then
+ v = gsub(v,"spacing","") -- old, quads and so
+ else
+ v = k - 256
+ v = morehack[v//64] .. morehack[v%64]
end
+ t[k] = v
+ return v
+ end)
+
+ local g_cache_qd = caches["mathquad"]
+
+ ruledmathglue = function(head,current,parent)
+ local name = getfont(current)
+ local zero = iszeroglue(current)
+ local fixed = getprop(current,"fixedmathalign")
+ local color = false
+ local info = zero and g_cache_gz[name]
+ local quad = name == 0
+ local width = quad and effectiveglue(current,parent)
+ if not info then
+ if quad then
+ info = g_cache_qd[width]
+ color = "trace:z"
+ elseif fixed then
+ info = g_cache_gf[name]
+ color = "trace:dr"
+ else
+ info = g_cache_gn[name]
+ color = "trace:z"
+ end
+ end
+ if not info then
+ local amount = quad and f_amount("QUAD",width*pt_factor) or temphack[name]
+ -- local amount = quad and f_amount("QD",width*pt_factor) or temphack[name]
+ local text = hpack_string(amount,usedfont)
+ local rule = new_rule(emwidth/fraction,2*exheight,(zero and 4.25 or 2.75)*exheight)
+ local list = getlist(text)
+ setlistcolor(list,color)
+ setcolor(rule,color)
+ setlisttransparency(list,color)
+ settransparency(rule,color)
+ setshift(text,(zero and 3.5 or 2)*exheight)
+ info = new_hlist(setlink(rule,text))
+ setattr(info,a_layer,l_glue)
+ if quad then
+ g_cache_qd[width] = info
+ elseif fixed then
+ g_cache_gf[name] = info
+ else
+ g_cache_gn[name] = info
+ end
+ end
+ return insertnodebefore(head,current,copylist(info))
end
end
local ruledkern do
- local k_cache_v = caches["vkern"]
- local k_cache_h = caches["hkern"]
+ local v_cache = caches["vkern"]
+ local h_cache = caches["hkern"]
- ruledkern = function(head,current,vertical,mk)
+ ruledkern = function(head,current,vertical)
local kern = getkern(current)
- local cache = vertical and k_cache_v or k_cache_h
+ local cache = vertical and v_cache or h_cache
local info = cache[kern]
if not info then
- local amount = formatters["%s:%0.3f"](vertical and "VK" or (mk and "MK") or "HK",kern*pt_factor)
+ local amount = formatters["%s:%0.3f"](vertical and "VK" or "HK",kern*pt_factor)
if kern > 0 then
- info = sometext(amount,l_kern,c_positive)
+ info = sometext(amount,l_kern,"trace:b")
elseif kern < 0 then
- info = sometext(amount,l_kern,c_negative)
+ info = sometext(amount,l_kern,"trace:r")
else
- info = sometext(amount,l_kern,c_zero)
+ info = sometext(amount,l_kern,"trace:g")
end
cache[kern] = info
end
- info = copy_list(info)
+ info = copylist(info)
if vertical then
info = vpack_nodes(info)
end
- head, current = insert_node_before(head,current,info)
+ head, current = insertnodebefore(head,current,info)
return head, getnext(current)
end
end
+local ruledstrut do
+
+ local strut_size = 65536 * 8 / 10
+ local strut_code = nodes.rulecodes.strut
+ local math_code = nodes.nodecodes.math
+ local traverseid = nuts.traverseid
+ local rangedimensions = nuts.rangedimensions
+ local a_mathaxis = attributes.private("mathaxis")
+
+ ruledstrut = function(head,current,parent)
+ if getwidth(current) == 0 then
+ if getsubtype(current) == strut_code then
+ local w = strut_size
+ local a = getattr(current,a_mathaxis)
+ setattr(current,a_layer,l_strut)
+ if a then
+ local p = getprev(current)
+ local b, e
+ for n in traverseid(math_code,current) do
+ e = n
+ break
+ end
+ for n in traverseid(math_code,current,true) do
+ b = n
+ break
+ end
+ if not b then
+ b = head
+ end
+ if not e then
+ e = nuts.tail(b)
+ end
+ w = rangedimensions(parent,b,e)
+ setwidth(current,w)
+ setcolor(current,"trace:ds")
+ settransparency(current,"trace:ds")
+ head, current, rule = nuts.remove(head,current)
+ local kern = new_kern(-w)
+ if a == 2 then
+ head = insertnodebefore(head,e,kern)
+ head = insertnodebefore(head,e,rule)
+ else
+ insertnodeafter(head,b,kern)
+ insertnodeafter(head,b,rule)
+ end
+ current = p
+ else
+ setwidth(current,w)
+ head, current = insertnodeafter(head,current,new_kern(-w))
+ end
+ end
+ end
+ return head, current
+ end
+
+end
+
local ruleditalic do
local i_cache = caches["italic"]
@@ -1158,16 +1464,16 @@ local ruleditalic do
if not info then
local amount = formatters["%s:%0.3f"]("IC",kern*pt_factor)
if kern > 0 then
- info = sometext(amount,l_kern,c_positive)
+ info = sometext(amount,l_kern,"trace:b")
elseif kern < 0 then
- info = sometext(amount,l_kern,c_negative)
+ info = sometext(amount,l_kern,"trace:r")
else
- info = sometext(amount,l_kern,c_zero)
+ info = sometext(amount,l_kern,"trace:g")
end
i_cache[kern] = info
end
- info = copy_list(info)
- head, current = insert_node_before(head,current,info)
+ info = copylist(info)
+ head, current = insertnodebefore(head,current,info)
return head, getnext(current)
end
@@ -1175,49 +1481,54 @@ end
local ruledmarginkern do
- local m_cache = caches["marginkern"]
+ local l_cache = caches["leftmarginkern"]
+ local r_cache = caches["rightmarginkern"]
- ruledmarginkern = function(head,current)
- local kern = getkern(current)
- local info = m_cache[kern]
+ ruledmarginkern = function(head,current,subtype)
+ local kern = getkern(current)
+ local left = subtype == leftmarginkern_code
+ local cache = left and l_cache or r_cache
+ local info = cache[kern]
if not info then
- local amount = formatters["%s:%0.3f"]("MK",kern*pt_factor)
+ local amount = formatters["%s:%0.3f"](left and "ML" or "MR",kern*pt_factor)
if kern > 0 then
- info = sometext(amount,l_marginkern,c_positive)
+ info = sometext(amount,l_marginkern,"trace:b")
elseif kern < 0 then
- info = sometext(amount,l_marginkern,c_negative)
+ info = sometext(amount,l_marginkern,"trace:r")
else
- info = sometext(amount,l_marginkern,c_zero)
+ info = sometext(amount,l_marginkern,"trace:g")
end
- m_cache[kern] = info
+ cache[kern] = info
end
- info = copy_list(info)
- head, current = insert_node_before(head,current,info)
+ info = copylist(info)
+ head, current = insertnodebefore(head,current,info)
return head, getnext(current)
end
end
-local ruledmathlistkern do
+local ruledmathkern do
- local l_cache = caches["mathlistkern"]
+ local h_cache = caches["horizontalmathkern"]
+ local v_cache = caches["verticalmathkern"]
- ruledmathlistkern = function(head,current)
- local kern = getkern(current)
- local info = l_cache[kern]
+ ruledmathkern = function(head,current,vertical)
+ local kern = getkern(current)
+ local cache = vertical and v_cache or h_cache
+ local info = cache[kern]
if not info then
- local amount = formatters["%s:%0.3f"]("LK",kern*pt_factor)
+ local amount = formatters["%s:%0.3f"](vertical and "MV" or "MH",kern*pt_factor)
if kern > 0 then
- info = sometext(amount,l_mathlistkern,c_positive)
+ info = sometext(amount,l_mathkern,"trace:b")
elseif kern < 0 then
- info = sometext(amount,l_mathlistkern,c_negative)
+ info = sometext(amount,l_mathkern,"trace:r")
else
- info = sometext(amount,l_mathlistkern,c_zero)
+ info = sometext(amount,l_mathkern,"trace:g")
end
- l_cache[kern] = info
+ cache[kern] = info
end
- info = copy_list(info)
- head, current = insert_node_before(head,current,info)
+ info = copylist(info)
+ head, current = insertnodebefore(head,current,info)
return head, getnext(current)
end
@@ -1233,13 +1544,13 @@ local ruleddiscretionary do
local rule = new_rule(4*emwidth/fraction,4*exheight,exheight)
local kern = new_kern(-2*emwidth/fraction)
setlink(kern,rule)
- setcolor(rule,c_discretionary_d)
- settransparency(rule,c_discretionary_d)
+ setcolor(rule,"trace:dd")
+ settransparency(rule,"trace:dd")
setattr(rule,a_layer,l_discretionary)
d = new_hlist(kern)
d_cache[true] = d
end
- insert_node_after(head,current,copy_list(d))
+ insertnodeafter(head,current,copylist(d))
return head, current
end
@@ -1249,78 +1560,141 @@ local ruledpenalty do
local p_cache_v = caches["vpenalty"]
local p_cache_h = caches["hpenalty"]
+ local p_cache_m = caches["mpenalty"]
local raisepenalties = false
- local getpenalty = nuts.getpenalty
+ ----- getpenalty = nuts.getpenalty
+ local pre_penalty_code = nodes.penaltycodes.mathprepenalty
+ local post_penalty_code = nodes.penaltycodes.mathpostpenalty
directives.register("visualizers.raisepenalties",function(v) raisepenalties = v end)
- ruledpenalty = function(head,current,vertical)
+ ruledpenalty = function(head,current,vertical,subtype)
local penalty = getpenalty(current)
- local info = (vertical and p_cache_v or p_cache_h)[penalty]
+ local ismath = subtype == pre_penalty_code or subtype == post_penalty_code or subtype == true
+ local cache = (ismath and p_cache_m) or (vertical and p_cache_v) or p_cache_h
+ local info = cache[penalty]
if info then
-- print("penalty hit")
else
- local amount = formatters["%s:%s"](vertical and "VP" or "HP",penalty)
- if penalty > 0 then
- info = sometext(amount,l_penalty,c_positive)
+ local amount = formatters["%s:%s"]((ismath and "MP") or (vertical and "VP") or "HP",penalty)
+ if ismath then
+ info = sometext(amount,l_penalty,"trace:s")
+ elseif penalty > 0 then
+ info = sometext(amount,l_penalty,"trace:b")
elseif penalty < 0 then
- info = sometext(amount,l_penalty,c_negative)
+ info = sometext(amount,l_penalty,"trace:r")
else
- info = sometext(amount,l_penalty,c_zero)
+ info = sometext(amount,l_penalty,"trace:g")
end
- (vertical and p_cache_v or p_cache_h)[penalty] = info
+ cache[penalty] = info
end
- info = copy_list(info)
+ info = copylist(info)
if vertical then
info = vpack_nodes(info)
+ elseif ismath then
+ setshift(info, 65536*4)
elseif raisepenalties then
setshift(info,-65536*4)
end
- head, current = insert_node_before(head,current,info)
+ head, current = insertnodebefore(head,current,info)
return head, getnext(current)
end
end
+local ruledmath do
+
+ local mathcodes = nodes.mathcodes
+ local m_cache = {
+ beginmath = caches["bmath"],
+ endmath = caches["emath"],
+ }
+ local tags = {
+ beginmath = "B",
+ endmath = "E",
+ }
+
+ ruledmath = function(head,current)
+ local what = getsubtype(current)
+ local tag = mathcodes[what]
+ local skip = getkern(current) + getwidth(current) -- surround
+ local info = m_cache[tag][skip]
+ if info then
+ -- print("hit math")
+ else
+ local text, width = sometext(formatters["M:%s"](tag and tags[tag] or what),usedfont,nil,"trace:dr")
+ local rule = new_rule(skip,-655360/fraction,2*655360/fraction)
+ local dist = tag == "beginmath" and width or skip
+ setcolor(rule,"trace:dr")
+ settransparency(rule,"trace:dr")
+ setattr(rule,a_layer,l_math)
+ info = new_hlist(setlink(new_glue(-skip),rule,new_glue(-dist),text))
+ setattr(info,a_layer,l_math)
+ m_cache[tag][skip] = info
+ end
+ local saved = current
+ head, current = insertnodeafter(head,current,copylist(info))
+ if getpenalty(saved) ~= 0 then
+ head, current = ruledpenalty(head,saved,false,true)
+ end
+ return head, current
+ end
+
+end
+
do
- local disc_code = nodecodes.disc
- local kern_code = nodecodes.kern
- local glyph_code = nodecodes.glyph
- local glue_code = nodecodes.glue
- local penalty_code = nodecodes.penalty
- local whatsit_code = nodecodes.whatsit
- local user_code = nodecodes.user
- local math_code = nodecodes.math
- local hlist_code = nodecodes.hlist
- local vlist_code = nodecodes.vlist
- local marginkern_code = nodecodes.marginkern
- local mathlistkern_code = nodecodes.mathlistkern
- local dir_code = nodecodes.dir
- local par_code = nodecodes.par
-
- local kerncodes = nodes.kerncodes
- local fontkern_code = kerncodes.fontkern
- local italickern_code = kerncodes.italiccorrection
- local leftmarginkern_code = kerncodes.leftmarginkern
- local rightmarginkern_code = kerncodes.rightmarginkern
- local mathlistkern_code = kerncodes.mathlistkern
- ----- userkern_code = kerncodes.userkern
-
- local listcodes = nodes.listcodes
- local linelist_code = listcodes.line
-
- local vtop_package_state = 3 -- todo: symbolic
-
- local getleader = nuts.getleader
- local getdisc = nuts.getdisc
-
- local setleader = nuts.setleader
- local setdisc = nuts.setdisc
-
- local cache
+ local nodecodes = nodes.nodecodes
+ local disc_code = nodecodes.disc
+ local kern_code = nodecodes.kern
+ local glyph_code = nodecodes.glyph
+ local glue_code = nodecodes.glue
+ local penalty_code = nodecodes.penalty
+ local whatsit_code = nodecodes.whatsit
+ local user_code = nodecodes.user
+ local math_code = nodecodes.math
+ local hlist_code = nodecodes.hlist
+ local vlist_code = nodecodes.vlist
+ local dir_code = nodecodes.dir
+ local par_code = nodecodes.par
+ local mark_code = nodecodes.mark
+ local insert_code = nodecodes.insert
+ local rule_code = nodecodes.rule
+ local boundary_code = nodecodes.boundary
+
+ local kerncodes = nodes.kerncodes
+ local fontkern_code = kerncodes.fontkern
+ local italickern_code = kerncodes.italiccorrection
+ local leftmarginkern_code = kerncodes.leftmarginkern
+ local rightmarginkern_code = kerncodes.rightmarginkern
+ local mathshapekern_code = kerncodes.mathshapekern
+ local horizontalmathkern_code = kerncodes.horizontalmathkern
+ local verticalmathkern_code = kerncodes.verticalmathkern
+ ----- userkern_code = kerncodes.userkern
+
+ local skipcodes = nodes.skipcodes
+ local spaceskip_code = skipcodes.spaceskip
+ local xspaceskip_code = skipcodes.xspaceskip
+ local zerospaceskip_code = skipcodes.zerospaceskip
+ local intermathskip_code = skipcodes.intermathskip
+
+ local listcodes = nodes.listcodes
+ local linelist_code = listcodes.line
+ local rowlist_code = listcodes.alignment
+
+ local vtop_package_state = 3 -- todo: symbolic
+ local dbox_package_state = 4 -- todo: symbolic
+
+ local getleader = nuts.getleader
+ local getdisc = nuts.getdisc
+
+ local setleader = nuts.setleader
+ local setdisc = nuts.setdisc
+ local hpack = nuts.hpack
+
+ -- local cache
local function visualize(head,vertical,forced,parent)
local trace_hbox = false
@@ -1336,6 +1710,8 @@ do
local trace_simple = false
local trace_user = false
local trace_math = false
+ local trace_mathkern = false
+ local trace_marginkern = false
local trace_italic = false
local trace_origin = false
local trace_discretionary = false
@@ -1345,25 +1721,25 @@ do
local trace_depth = false
local trace_dir = false
local trace_par = false
+ local trace_mathglue = false
+ local trace_mark = false
+ local trace_insert = false
+ local trace_boundary = false
local current = head
local previous = nil
local attr = unsetvalue
local prev_trace_fontkern = nil
local prev_trace_italic = nil
- local prev_trace_marginkern = nil
--- local prev_trace_mathlist = nil
local prev_trace_expansion = nil
while current do
local id = getid(current)
local a = forced or getattr(current,a_visual) or unsetvalue
- local subtype
+ local subtype, content
if a ~= attr then
- prev_trace_fontkern = trace_fontkern
- prev_trace_italic = trace_italic
- prev_trace_marginkern = trace_marginkern
--- prev_trace_mathlistkern = trace_mathlistkern
- prev_trace_expansion = trace_expansion
+ prev_trace_fontkern = trace_fontkern
+ prev_trace_italic = trace_italic
+ prev_trace_expansion = trace_expansion
attr = a
if a == unsetvalue then
trace_hbox = false
@@ -1387,52 +1763,61 @@ do
trace_space = false
trace_depth = false
trace_marginkern = false
- trace_mathlistkern = false
+ trace_mathkern = false
trace_dir = false
trace_par = false
+ trace_mathglue = false
+ trace_mark = false
+ trace_insert = false
+ trace_boundary = false
if id == kern_code then
goto kern
else
goto list
end
- else -- dead slow:
+ else -- we need them to be booleans
-- cache[a]()
- trace_hbox = band(a,0x000001) ~= 0
- trace_vbox = band(a,0x000002) ~= 0
- trace_vtop = band(a,0x000004) ~= 0
- trace_kern = band(a,0x000008) ~= 0
- trace_glue = band(a,0x000010) ~= 0
- trace_penalty = band(a,0x000020) ~= 0
- trace_fontkern = band(a,0x000040) ~= 0
- trace_strut = band(a,0x000080) ~= 0
- trace_whatsit = band(a,0x000100) ~= 0
- trace_glyph = band(a,0x000200) ~= 0
- trace_simple = band(a,0x000400) ~= 0
- trace_user = band(a,0x000800) ~= 0
- trace_math = band(a,0x001000) ~= 0
- trace_italic = band(a,0x002000) ~= 0
- trace_origin = band(a,0x004000) ~= 0
- trace_discretionary = band(a,0x008000) ~= 0
- trace_expansion = band(a,0x010000) ~= 0
- trace_line = band(a,0x020000) ~= 0
- trace_space = band(a,0x040000) ~= 0
- trace_depth = band(a,0x080000) ~= 0
- trace_marginkern = band(a,0x100000) ~= 0
- trace_mathlistkern = band(a,0x200000) ~= 0
- trace_dir = band(a,0x400000) ~= 0
- trace_par = band(a,0x800000) ~= 0
+ trace_hbox = a & 0x0000001 ~= 0
+ trace_vbox = a & 0x0000002 ~= 0
+ trace_vtop = a & 0x0000004 ~= 0
+ trace_kern = a & 0x0000008 ~= 0
+ trace_glue = a & 0x0000010 ~= 0
+ trace_penalty = a & 0x0000020 ~= 0
+ trace_fontkern = a & 0x0000040 ~= 0
+ trace_strut = a & 0x0000080 ~= 0
+ trace_whatsit = a & 0x0000100 ~= 0
+ trace_glyph = a & 0x0000200 ~= 0
+ trace_simple = a & 0x0000400 ~= 0
+ trace_user = a & 0x0000800 ~= 0
+ trace_math = a & 0x0001000 ~= 0
+ trace_italic = a & 0x0002000 ~= 0
+ trace_origin = a & 0x0004000 ~= 0
+ trace_discretionary = a & 0x0008000 ~= 0
+ trace_expansion = a & 0x0010000 ~= 0
+ trace_line = a & 0x0020000 ~= 0
+ trace_space = a & 0x0040000 ~= 0
+ trace_depth = a & 0x0080000 ~= 0
+ trace_marginkern = a & 0x0100000 ~= 0
+ trace_mathkern = a & 0x0200000 ~= 0
+ trace_dir = a & 0x0400000 ~= 0
+ trace_par = a & 0x0800000 ~= 0
+ trace_mathglue = a & 0x1000000 ~= 0
+ trace_mark = a & 0x2000000 ~= 0
+ trace_insert = a & 0x4000000 ~= 0
+ trace_boundary = a & 0x8000000 ~= 0
end
elseif a == unsetvalue then
goto list
end
- if trace_strut then
- setattr(current,a_layer,l_strut)
- elseif id == glyph_code then
+ -- if trace_strut then
+ -- setattr(current,a_layer,l_strut)
+ -- else
+ if id == glyph_code then
if trace_glyph then
head, current = ruledglyph(head,current,previous)
end
if trace_expansion then
- head, current = glyphexpansion(head,current)
+ head, current = ruledglyphexpansion(head,current)
end
elseif id == disc_code then
if trace_discretionary then
@@ -1452,43 +1837,70 @@ do
elseif id == kern_code then
goto kern
elseif id == glue_code then
- local content = getleader(current)
- if content then
- setleader(current,visualize(content,false,nil,parent))
- elseif trace_glue then
- head, current = ruledglue(head,current,vertical,parent)
- elseif trace_space then
- head, current = ruledspace(head,current,parent)
- end
+ goto glue
elseif id == penalty_code then
if trace_penalty then
- head, current = ruledpenalty(head,current,vertical)
+ subtype = getsubtype(current)
+ head, current = ruledpenalty(head,current,vertical,subtype)
end
elseif id == hlist_code or id == vlist_code then
goto list
+ elseif id == rule_code then
+ if trace_strut then
+ head, current = ruledstrut(head,current,parent)
+ end
elseif id == whatsit_code then
if trace_whatsit then
- head, current = whatsit(head,current)
+ head, current = ruledwhatsit(head,current)
end
elseif id == user_code then
if trace_user then
- head, current = user(head,current)
+ head, current = ruleduser(head,current)
end
elseif id == math_code then
+ local saved = current
if trace_math then
- head, current = math(head,current)
- end
- elseif id == marginkern_code then
- if trace_kern then
- head, current = ruledkern(head,current,vertical,true)
+ head, current = ruledmath(head,current)
end
elseif id == dir_code then
if trace_dir then
- head, current = dir(head,current)
+ head, current = ruleddir(head,current)
end
elseif id == par_code then
if trace_par then
- head, current = par(head,current)
+ head, current = ruledpar(head,current)
+ end
+ elseif id == mark_code then
+ if trace_mark then
+ head, current = ruledmark(head,current)
+ end
+ elseif id == insert_code then
+ if trace_insert then
+ head, current = ruledinsert(head,current)
+ end
+ elseif id == boundary_code then
+ if trace_boundary then
+ head, current = ruledboundary(head,current)
+ end
+ end
+ goto next
+ ::glue::
+ content = getleader(current)
+ if content then
+ -- setleader(current,hpack(visualize(content,false,nil,parent)))
+ setleader(current,visualize(content,false,nil,parent))
+ elseif trace_glue then
+ head, current = ruledglue(head,current,vertical,parent)
+ else
+ subtype = getsubtype(current)
+ if subtype == spaceskip_code or subtype == xspaceskip_code or subtype == zerospaceskip_code then -- not yet all space
+ if trace_space then
+ head, current = ruledspace(head,current,parent)
+ end
+ elseif subtype == intermathskip_code then
+ if trace_math or trace_mathglue then
+ head = ruledmathglue(head,current,parent)
+ end
end
end
goto next
@@ -1508,16 +1920,26 @@ do
head, current = ruleditalic(head,current)
end
elseif subtype == leftmarginkern_code or subtype == rightmarginkern_code then
- if trace_marginkern or prev_trace_marginkern then
+ if trace_marginkern then
head, current = marginkern(head,current)
elseif trace_kern then
- head, current = ruledmarginkern(head,current)
+ head, current = ruledmarginkern(head,current,subtype)
+ end
+ elseif subtype == verticalmathkern_code then
+ if trace_mathkern or trace_kern then
+ head, current = ruledmathkern(head,current,true)
+ end
+ elseif subtype == horizontalmathkern_code then
+ if trace_mathkern then
+ head, current = mathkern(head,current)
+ elseif trace_kern then
+ head, current = ruledmathkern(head,current,false)
end
- elseif subtype == mathlistkern_code then
- if trace_mathlist then -- or prev_trace_mathlist then
- head, current = mathlistkern(head,current)
+ elseif subtype == mathshapekern_code then
+ if trace_mathkern or trace_italic then
+ head, current = mathshapekern(head,current)
elseif trace_kern then
- head, current = ruledmathlistkern(head,current)
+ head, current = ruledmathkern(head,current,false)
end
else
if trace_kern then
@@ -1534,21 +1956,26 @@ do
if trace_depth then
ruleddepth(current)
end
- if trace_line and getsubtype(current) == linelist_code then
+ if trace_line and (getsubtype(current) == linelist_code or getsubtype(current) == rowlist_code) then
head, current = ruledbox(head,current,false,l_line,"L__",trace_simple,previous,trace_origin,parent)
elseif trace_hbox then
head, current = ruledbox(head,current,false,l_hbox,"H__",trace_simple,previous,trace_origin,parent)
end
elseif id == vlist_code then
local content = getlist(current)
- local isvtop = getstate(current) == vtop_package_state
+ local state = getstate(current)
+ local isvtop = state == vtop_package_state
+ local isdbox = state == dbox_package_state
local tag = nil
local layer = nil
if content then
setlist(current,visualize(content,true,nil,current))
end
if trace_vtop then
- if isvtop then
+ if isdbox then
+ tag = "_D_"
+ layer = l_vtop
+ elseif isvtop then
tag = "_T_"
layer = l_vtop
elseif trace_vbox then
@@ -1556,7 +1983,10 @@ do
layer = l_vbox
end
elseif trace_vbox then
- if not isvtop then
+ if isdbox then
+ tag = "_D_"
+ layer = l_vtop
+ elseif not isvtop then
tag = "__V"
layer = l_vbox
end
@@ -1575,7 +2005,7 @@ do
local function cleanup()
for tag, cache in next, caches do
for k, v in next, cache do
- flush_node_list(v)
+ flushnodelist(v)
end
end
cleanup = function()
@@ -1614,6 +2044,7 @@ end
do
+ local nodecodes = nodes.nodecodes
local hlist_code = nodecodes.hlist
local vlist_code = nodecodes.vlist
local nextnode = nuts.traversers.node
@@ -1682,7 +2113,7 @@ do
actions = { setvisual, context }
}
- implement {
+ implement {
name = "setvisuallayer",
arguments = "string",
actions = visualizers.setlayer
@@ -1736,10 +2167,10 @@ do
local cache = caches[name]
local layer = layers[name]
if not textcolor then
- textcolor = c_text_d
+ textcolor = "trace:ds"
end
if not rulecolor then
- rulecolor = c_origin_d
+ rulecolor = "trace:do"
end
return function(str)
if not str then
diff --git a/Master/texmf-dist/tex/context/base/mkxl/trac-vis.mkxl b/Master/texmf-dist/tex/context/base/mkxl/trac-vis.mkxl
index dd69e0bb8d3..ec51ad4b059 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/trac-vis.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/trac-vis.mkxl
@@ -32,13 +32,13 @@
\writestatus{loading}{ConTeXt Tracing Macros / Visualization}
-\registerctxluafile{trac-vis}{autosuffix,optimize}
-
\unprotect
\newconstant\c_syst_visualizers_state
\newtoks \t_syst_visualizers_optimize
+\registerctxluafile{trac-vis}{autosuffix}
+
% \definesystemattribute[visual][public,global] % already defined
% no, but can become an option:
@@ -53,20 +53,37 @@
\aliased\let\syst_visualizers_hbox \hbox
\aliased\let\syst_visualizers_vbox \vbox
\aliased\let\syst_visualizers_vtop \vtop
+\aliased\let\syst_visualizers_dbox \dbox
\aliased\let\syst_visualizers_vcenter\vcenter
\aliased\let\syst_visualizers_hpack \hpack
\aliased\let\syst_visualizers_vpack \vpack
\aliased\let\syst_visualizers_tpack \tpack
-
-\permanent\protected\def\ruledhbox {\syst_visualizers_hbox attr \visualattribute \clf_getvisual{simplehbox} }
-\permanent\protected\def\ruledhpack {\syst_visualizers_hpack attr \visualattribute \clf_getvisual{simplehbox} }
-\permanent\protected\def\ruledvbox {\syst_visualizers_vbox attr \visualattribute \clf_getvisual{simplevbox} }
-\permanent\protected\def\ruledvpack {\syst_visualizers_vpack attr \visualattribute \clf_getvisual{simplevbox} }
-\permanent\protected\def\ruledvtop {\syst_visualizers_vtop attr \visualattribute \clf_getvisual{simplevtop} }
-\permanent\protected\def\ruledtpack {\syst_visualizers_tpack attr \visualattribute \clf_getvisual{simplevtop} }
-\permanent\protected\def\ruledvcenter{\syst_visualizers_vcenter attr \visualattribute \clf_getvisual{simplevbox} }
+\aliased\let\syst_visualizers_dpack \dpack
+\aliased\let\syst_visualizers_vsplit \vsplit
+\aliased\let\syst_visualizers_tsplit \tsplit
+\aliased\let\syst_visualizers_dsplit \dsplit
+
+\permanent\protected\def\ruledhbox {\syst_visualizers_hbox \s!attr \visualattribute \clf_getvisual{simplehbox} }
+\permanent\protected\def\ruledhpack {\syst_visualizers_hpack \s!attr \visualattribute \clf_getvisual{simplehbox} }
+\permanent\protected\def\ruledvbox {\syst_visualizers_vbox \s!attr \visualattribute \clf_getvisual{simplevbox} }
+\permanent\protected\def\ruledvpack {\syst_visualizers_vpack \s!attr \visualattribute \clf_getvisual{simplevbox} }
+\permanent\protected\def\ruledvtop {\syst_visualizers_vtop \s!attr \visualattribute \clf_getvisual{simplevtop} }
+\permanent\protected\def\ruledtpack {\syst_visualizers_tpack \s!attr \visualattribute \clf_getvisual{simplevtop} }
+\permanent\protected\def\ruleddbox {\syst_visualizers_dbox \s!attr \visualattribute \clf_getvisual{simplevtop} }
+\permanent\protected\def\ruleddpack {\syst_visualizers_dpack \s!attr \visualattribute \clf_getvisual{simplevtop} }
+\permanent\protected\def\ruledvcenter{\syst_visualizers_vcenter \s!attr \visualattribute \clf_getvisual{simplevbox} }
\permanent\protected\def\ruledmbox #1{\ruledhbox{\startimath#1\stopimath}}
+\mutable\integerdef\c_syst_visualizer\zerocount
+
+\permanent\protected\def\ruledvsplit{\afterassignment\syst_visualizers_v_split\integerdef\c_syst_visualizer}
+\permanent\protected\def\ruledtsplit{\afterassignment\syst_visualizers_t_split\integerdef\c_syst_visualizer}
+\permanent\protected\def\ruleddsplit{\afterassignment\syst_visualizers_d_split\integerdef\c_syst_visualizer}
+
+\permanent\protected\def\syst_visualizers_v_split{\syst_visualizers_vsplit\c_syst_visualizer \s!attr \visualattribute \clf_getvisual {simplevbox}}
+\permanent\protected\def\syst_visualizers_t_split{\syst_visualizers_tsplit\c_syst_visualizer \s!attr \visualattribute \clf_getvisual {simplevtop}}
+\permanent\protected\def\syst_visualizers_d_split{\syst_visualizers_dsplit\c_syst_visualizer \s!attr \visualattribute \clf_getvisual {simplevtop}}
+
\appendtoks
\ifcase\c_syst_visualizers_state\else
\syst_visualizers_speedup
@@ -80,7 +97,7 @@
\def\syst_visualizers_speedup{\the\t_syst_visualizers_optimize}
-\appendtoks
+% \appendtoks
% \enforced\global\protected\edef\ruledhbox {\syst_visualizers_hbox attr \visualattribute \number\clf_getvisual{simplehbox} }
% \enforced\global\protected\edef\ruledhpack {\syst_visualizers_hpack attr \visualattribute \number\clf_getvisual{simplehbox} }
% \enforced\global\protected\edef\ruledvbox {\syst_visualizers_vbox attr \visualattribute \number\clf_getvisual{simplevbox} }
@@ -88,7 +105,7 @@
% \enforced\global\protected\edef\ruledvtop {\syst_visualizers_vtop attr \visualattribute \number\clf_getvisual{simplevtop} }
% \enforced\global\protected\edef\ruledtpack {\syst_visualizers_tpack attr \visualattribute \number\clf_getvisual{simplevtop} }
% \enforced\global\protected\edef\ruledvcenter{\syst_visualizers_vcenter attr \visualattribute \number\clf_getvisual{simplevbox} }
-\to \t_syst_visualizers_optimize
+% \to \t_syst_visualizers_optimize
\permanent\tolerant\protected\def\showmakeup[#1]%
{\ifarguments
@@ -105,6 +122,8 @@
\permanent\protected\def\showglyphdata {\showglyphs\showfontkerns\showfontitalics}
\permanent\protected\def\showfontexpansion{\clf_setvisual{expansion}}
+% lmmonoltcond10regular 4pt
+
\permanent\tolerant\protected\def\setvisualizerfont[#1]% somename at 4pt
{\begingroup
\iftok{#1}\emptytoks
@@ -115,6 +134,14 @@
\clf_setvisualfont\fontid\font
\endgroup}
+\def\syst_v_p_indeed#1%
+ {\setbox\scratchbox\hpack{\visualizerfont#1}}
+
+\def\syst_v_p
+ {\definefrozenfont[visualizerfont][lmmonoltcond10regular @ 4pt]%
+ \let\syst_v_p\syst_v_p_indeed
+ \syst_v_p_indeed}
+
\permanent\protected\def\resetvisualizers
{\c_attr_visual\attributeunsetvalue}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/type-imp-bengali.mkxl b/Master/texmf-dist/tex/context/base/mkxl/type-imp-bengali.mkxl
new file mode 100644
index 00000000000..84a0b6402f0
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/type-imp-bengali.mkxl
@@ -0,0 +1,73 @@
+%D \module
+%D [ file=type-imp-bengali,
+%D version=2022.02.02,
+%D title=\CONTEXT\ Typescript Macros,
+%D subtitle=Bengali,
+%D author=Å›rÄ«rÄma (Sreeram),
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%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[bengali]
+
+ \doifunknownfontfeature {bengali-bold-30} {\definefontfeature[bengali-bold-30][boldened-30]}
+
+ % Symbolic names for fonts:
+
+ \starttypescript [\s!serif] [murty-bangla]
+ \definefontsynonym [MurtyBengali-Regular] [\s!name:murtybanglaregular] [\s!features=bengali-two]
+ \definefontsynonym [MurtyBengali-Bold] [\s!name:murtybanglaregular] [\s!features={bengali-two,bengali-bold-30}]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [baloo-da, baloo-da-extrabold]
+ \definefontsynonym [BalooDa2-Regular] [\s!name:balooda2regular] [\s!features=bengali-two]
+ \definefontsynonym [BalooDa2-Medium] [\s!name:balooda2medium] [\s!features=bengali-two]
+ \definefontsynonym [BalooDa2-Semibold] [\s!name:balooda2semibold] [\s!features=bengali-two]
+ \definefontsynonym [BalooDa2-Bold] [\s!name:balooda2bold] [\s!features=bengali-two]
+ \definefontsynonym [BalooDa2-Extrabold] [\s!name:balooda2extrabold] [\s!features=bengali-two]
+ \stoptypescript
+
+ % Grouping of styles:
+
+ \starttypescript [\s!sans] [baloo-da] [\s!name]
+ \setups[\s!font:\s!fallback:\s!serif]
+ \definefontsynonym [\s!Sans] [BalooDa2-Regular]
+ \definefontsynonym [\s!SansSlanted] [BalooDa2-Medium]
+ \definefontsynonym [\s!SansBold] [BalooDa2-Bold]
+ \definefontsynonym [\s!SansBoldSlanted] [BalooDa2-Semibold]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [baloo-da-extrabold] [\s!name]
+ \setups[\s!font:\s!fallback:\s!serif]
+ \definefontsynonym [\s!Sans] [BalooDa2-Medium]
+ \definefontsynonym [\s!SansSlanted] [BalooDa2-Semibold]
+ \definefontsynonym [\s!SansBold] [BalooDa2-Extrabold]
+ \definefontsynonym [\s!SansBoldSlanted] [BalooDa2-Bold]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [murty-bangla] [\s!name]
+ \setups[\s!font:\s!fallback:\s!serif]
+ \definefontsynonym [\s!Serif] [MurtyBengali-Regular]
+ \definefontsynonym [\s!SerifBold] [MurtyBengali-Bold]
+ \stoptypescript
+
+ % Typefaces:
+
+ \starttypescript [baloo-da, baloo-da-extrabold]
+ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [\typescriptone] [\s!default] [\s!rscale=1.1]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default]
+ \stoptypescript
+
+ \starttypescript [murty-bangla]
+ \definetypeface [murty-bangla] [\s!rm] [\s!serif] [murty-bangla] [\s!default] [\s!rscale=1.1]
+ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default]
+ \stoptypescript
+
+\stoptypescriptcollection
diff --git a/Master/texmf-dist/tex/context/base/mkxl/type-imp-braille.mkxl b/Master/texmf-dist/tex/context/base/mkxl/type-imp-braille.mkxl
new file mode 100644
index 00000000000..17209d50c17
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/type-imp-braille.mkxl
@@ -0,0 +1,88 @@
+%D \module
+%D [ file=type-imp-vraille,
+%D version=2021.11.17,
+%D title=\CONTEXT\ Typescript Macros,
+%D subtitle=Braille (using Dejavu fonts),
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\continuewhenlmtxmode
+
+%D There is no need to waste money on a commercial braille font if we have dejavu. After
+%D all it's just dots. We also don't need features.
+
+\registerctxluafile{font-imp-braille}{autosuffix}
+
+% todo : not fallback, just replace directly .. special case anyway .. now inefficient and slow
+
+\starttypescriptcollection[braille]
+
+ \doifunknownfontfeature {dejavu-math-bold} {\definefontfeature[dejavu-math-bold][boldened]}
+
+ \definefontfeature[brailletext] [braille=text] % no ligatures, no kerning etc
+ \definefontfeature[braillemath] [braille=math] % no ligatures, no kerning etc
+ \definefontfeature[serifbraille] [features=none] % no ligatures, no kerning etc
+ \definefontfeature[sansbraille] [features=none] % no ligatures, no kerning etc
+ \definefontfeature[monobraille] [features=none] % no ligatures, no kerning etc
+ \definefontfeature[mathbraille] [features=none] % [compactmath=yes] % no ssty so compact anyway
+
+ % Maybe some day sans and mono will also have braille but it doesn't really matter because we
+ % don't really need sans and for mono we only need the fixed spacing.
+
+ \definefontfallback[BrailleMono] [\s!name:dejavuserif*brailletext][0x0000-0x1FFFF][force=yes]
+ \definefontfallback[BrailleSerif][\s!name:dejavuserif*brailletext][0x0000-0x1FFFF][force=yes]
+ \definefontfallback[BrailleSans] [\s!name:dejavuserif*brailletext][0x0000-0x1FFFF][force=yes]
+ %\definefontfallback[BrailleMath] [\s!name:dejavuserif*braillemath][0x0000-0x1FFFF][force=yes]
+
+ \definefontfallback[BrailleMonoBold] [\s!name:dejavuserifbold*brailletext][0x0000-0x1FFFF][force=yes]
+ \definefontfallback[BrailleSerifBold][\s!name:dejavuserifbold*brailletext][0x0000-0x1FFFF][force=yes]
+ \definefontfallback[BrailleSansBold] [\s!name:dejavuserifbold*brailletext][0x0000-0x1FFFF][force=yes]
+
+ \starttypescript [\s!serif] [braille] [\s!name]
+ \definefontsynonym [\s!Serif] [\s!name:dejavuserif] [\s!features=serifbraille,\s!fallbacks=BrailleSerif]
+ \definefontsynonym [\s!SerifBold] [\s!name:dejavuserifbold][\s!features=serifbraille,\s!fallbacks=BrailleSerifBold]
+ \definefontsynonym [\s!SerifItalic] [\s!Serif]
+ \definefontsynonym [\s!SerifBoldItalic] [\s!SerifBold]
+ \definefontsynonym [\s!SerifSlanted] [\s!Serif]
+ \definefontsynonym [\s!SerifBoldSlanted][\s!SerifBold]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [braille] [\s!name]
+ \definefontsynonym [\s!Sans] [\s!name:dejavusans] [\s!features=sansbraille,\s!fallbacks=BrailleSans]
+ \definefontsynonym [\s!SansBold] [\s!name:dejavusansbold][\s!features=sansbraille,\s!fallbacks=BrailleSansBold]
+ \definefontsynonym [\s!SansItalic] [\s!Sans]
+ \definefontsynonym [\s!SansBoldItalic] [\s!SansBold]
+ \definefontsynonym [\s!SansSlanted] [\s!Sans]
+ \definefontsynonym [\s!SansBoldSlanted][\s!SansBold]
+ \stoptypescript
+
+ \starttypescript [\s!mono] [braille] [\s!name]
+ \definefontsynonym [\s!Mono] [\s!name:dejavusansmono] [\s!features=monobraille,\s!fallbacks=BrailleMono]
+ \definefontsynonym [\s!MonoBold] [\s!name:dejavusansmonobold][\s!features=monobraille,\s!fallbacks=BrailleMonoBold]
+ \definefontsynonym [\s!MonoItalic] [\s!Mono]
+ \definefontsynonym [\s!MonoBoldItalic] [\s!MonoBold]
+ \definefontsynonym [\s!MonoSlanted] [\s!Mono]
+ \definefontsynonym [\s!MonoBoldSlanted][\s!MonoBold]
+ \stoptypescript
+
+ \starttypescript [\s!math][braille] [\s!name]
+ \loadfontgoodies[dejavu-math]
+ %\definefontsynonym[\s!MathRoman] [\s!file:texgyredejavu-math][\s!features={mathbraille,\s!math\mathsizesuffix},\s!fallbacks=BrailleMath]
+ %\definefontsynonym[\s!MathRomanBold][\s!file:texgyredejavu-math][\s!features={mathbraille,\s!math\mathsizesuffix,dejavu-math-bold},\s!fallbacks=BrailleMath]
+ \definefontsynonym[\s!MathRoman] [\s!file:texgyredejavu-math][\s!features={braillemath,\s!math\mathsizesuffix},\s!goodies=dejavu-math]
+ \definefontsynonym[\s!MathRomanBold][\s!file:texgyredejavu-math][\s!features={braillemath,\s!math\mathsizesuffix,dejavu-math-bold},\s!goodies=dejavu-math]
+ \stoptypescript
+
+ \starttypescript[braille]
+ \definetypeface [braille] [\s!rm] [\s!serif] [braille] [\s!default]
+ \definetypeface [braille] [\s!ss] [\s!sans] [braille] [\s!default]
+ \definetypeface [braille] [\s!tt] [\s!mono] [braille] [\s!default]
+ \definetypeface [braille] [\s!mm] [\s!math] [braille] [\s!default]
+ \stoptypescript
+
+\stoptypescriptcollection
diff --git a/Master/texmf-dist/tex/context/base/mkxl/type-imp-devanagari.mkxl b/Master/texmf-dist/tex/context/base/mkxl/type-imp-devanagari.mkxl
new file mode 100644
index 00000000000..4fb082094eb
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/type-imp-devanagari.mkxl
@@ -0,0 +1,244 @@
+%D \module
+%D [ file=type-imp-devanagari,
+%D version=2022.02.02,
+%D title=\CONTEXT\ Typescript Macros,
+%D subtitle=Devanagari,
+%D author=Å›rÄ«rÄma (Sreeram),
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%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 collection uses rscaling so that the fonts can be used alongside.
+
+\starttypescriptcollection[devanagari]
+
+ \definefontfeature
+ [shobhikafeatures]
+ [devanagari-two]
+ [goodies=shobhika.lfg,
+ indic={movematra=auto,conjuncts=quit},
+ sanitizer=dev2rkrf]
+
+ \definefontfeature
+ [baloofeatures]
+ [shobhikafeatures]
+
+ \definefontfeature
+ [amitafeatures]
+ [devanagari-two]
+ [goodies=shobhika.lfg,
+ sanitizer=dev2rkrf]
+
+ \definefontfeature
+ [jainifeatures]
+ [shobhikafeatures]
+ [\s!ss01=yes,ss05=yes]
+
+ \definefontfeature
+ [adishilafeatures]
+ [devanagari-one]
+ [indic={movematra=auto,conjuncts=quit}]
+
+ % Symbolic names for fonts:
+
+ \starttypescript [\s!serif] [adishila]
+ \definefontsynonym [Adishila-Regular] [\s!name:adishilaregular] [\s!features=adishilafeatures]
+ \definefontsynonym [Adishila-Bold] [\s!name:adishilabold] [\s!features=adishilafeatures]
+ \definefontsynonym [Adishila-Italic] [\s!name:adishilaitalic] [\s!features=adishilafeatures]
+ \definefontsynonym [Adishila-BoldItalic] [\s!name:adishilabolditalic] [\s!features=adishilafeatures]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [adishila-semibold]
+ \definefontsynonym [AdishilaSemibold-Regular] [\s!name:adishilasemiboldregular] [\s!features=adishilafeatures]
+ \definefontsynonym [AdishilaSemibold-Italic] [\s!name:adishilasemibolditalic] [\s!features=adishilafeatures]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [adishila-heavy]
+ \definefontsynonym [AdishilaHeavy-Regular] [\s!name:adishilaheavyregular] [\s!features=adishilafeatures]
+ \definefontsynonym [AdishilaHeavy-Italic] [\s!name:adishilaheavyitalic] [\s!features=adishilafeatures]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [adishila-dev]
+ \definefontsynonym [AdishilaDev-Regular] [\s!name:adishiladevregular] [\s!features=adishilafeatures]
+ \definefontsynonym [AdishilaDev-Bold] [\s!name:adishiladevbold] [\s!features=adishilafeatures]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [adishila-dev-guru]
+ \definefontsynonym [AdishilaDev-Guru] [\s!name:adishiladevguru] [\s!features=adishilafeatures]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [adishila-san]
+ \definefontsynonym [AdishilaSan-Regular] [\s!name:adishilasanregular] [\s!features=adishilafeatures]
+ \definefontsynonym [AdishilaSan-Bold] [\s!name:adishilasanbold] [\s!features=adishilafeatures]
+ \definefontsynonym [AdishilaSan-Italic] [\s!name:adishilasanitalic] [\s!features=adishilafeatures]
+ \definefontsynonym [AdishilaSan-BoldItalic] [\s!name:adishilasanbolditalic] [\s!features=adishilafeatures]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [adishila-san-letterpress]
+ \definefontsynonym [AdishilaSanLetterpress-Regular] [\s!name:adishilasanletterpressregular] [\s!features=adishilafeatures]
+ \definefontsynonym [AdishilaSanLetterpress-Bold] [\s!name:adishilasanletterpressbold] [\s!features=adishilafeatures]
+ \definefontsynonym [AdishilaSanLetterpress-Italic] [\s!name:adishilasanletterpressitalic] [\s!features=adishilafeatures]
+ \definefontsynonym [AdishilaSanLetterpress-BoldItalic] [\s!name:adishilasanletterpressbolditalic] [\s!features=adishilafeatures]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [shobhika]
+ \definefontsynonym [Shobhika-Regular] [\s!name:shobhikaregular] [\s!features=shobhikafeatures]
+ \definefontsynonym [Shobhika-Bold] [\s!name:shobhikabold] [\s!features=shobhikafeatures]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [baloo,baloo-extrabold]
+ \definefontsynonym [Baloo2-Regular] [\s!name:baloo2regular] [\s!features=baloofeatures]
+ \definefontsynonym [Baloo2-Medium] [\s!name:baloo2medium] [\s!features=baloofeatures]
+ \definefontsynonym [Baloo2-Semibold] [\s!name:baloo2semibold] [\s!features=baloofeatures]
+ \definefontsynonym [Baloo2-Bold] [\s!name:baloo2bold] [\s!features=baloofeatures]
+ \definefontsynonym [Baloo2-Extrabold] [\s!name:baloo2extrabold] [\s!features=baloofeatures]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [jaini]
+ \definefontsynonym [Jaini-Regular] [\s!name:jainiregular] [\s!features=jainifeatures]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [jaini-purva]
+ \definefontsynonym [JainiPurva-Regular] [\s!name:jainipurvaregular] [\s!features=jainifeatures]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [amita]
+ \definefontsynonym [Amita-Regular] [\s!name:amitaregular] [\s!features=amitafeatures]
+ \definefontsynonym [Amita-Bold] [\s!name:amitabold] [\s!features=amitafeatures]
+ \stoptypescript
+
+ % Grouping of styles:
+
+ \starttypescript [\s!serif] [adishila] [\s!name]
+ \definefontsynonym [\s!Serif] [Adishila-Regular]
+ \definefontsynonym [\s!SerifBold] [Adishila-Bold]
+ \definefontsynonym [\s!SerifItalic] [Adishila-Italic]
+ \definefontsynonym [\s!SerifBoldItalic] [Adishila-BoldItalic]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [adishila-semibold] [\s!name]
+ \definefontsynonym [\s!Serif] [AdishilaSemibold-Regular]
+ \definefontsynonym [\s!SerifItalic] [AdishilaSemibold-Italic]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [adishila-heavy] [\s!name]
+ \definefontsynonym [\s!Serif] [AdishilaHeavy-Regular]
+ \definefontsynonym [\s!SerifItalic] [AdishilaHeavy-Italic]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [adishila-dev] [\s!name]
+ \definefontsynonym [\s!Serif] [AdishilaDev-Regular]
+ \definefontsynonym [\s!SerifBold] [AdishilaDev-Bold]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [adishila-dev-guru] [\s!name]
+ \definefontsynonym [\s!Serif] [AdishilaDev-Guru]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [adishila-san] [\s!name]
+ \definefontsynonym [\s!Serif] [AdishilaSan-Regular]
+ \definefontsynonym [\s!SerifBold] [AdishilaSan-Bold]
+ \definefontsynonym [\s!SerifItalic] [AdishilaSan-Italic]
+ \definefontsynonym [\s!SerifBoldItalic] [AdishilaSan-BoldItalic]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [adishila-san-letterpress] [\s!name]
+ \definefontsynonym [\s!Serif] [AdishilaSanLetterpress-Regular]
+ \definefontsynonym [\s!SerifBold] [AdishilaSanLetterpress-Bold]
+ \definefontsynonym [\s!SerifItalic] [AdishilaSanLetterpress-Italic]
+ \definefontsynonym [\s!SerifBoldItalic] [AdishilaSanLetterpress-BoldItalic]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [shobhika] [\s!name]
+ \definefontsynonym [\s!Serif] [Shobhika-Regular]
+ \definefontsynonym [\s!SerifBold] [Shobhika-Bold]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [baloo] [\s!name]
+ \definefontsynonym [\s!Sans] [Baloo2-Regular]
+ \definefontsynonym [\s!SansBold] [Baloo2-Bold]
+ \definefontsynonym [\s!SansItalic] [Baloo2-Medium]
+ \definefontsynonym [\s!SansBoldItalic] [Baloo2-Semibold]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [baloo-extrabold] [\s!name]
+ \definefontsynonym [\s!Sans] [Baloo2-Medium]
+ \definefontsynonym [\s!SansItalic] [Baloo2-Semibold]
+ \definefontsynonym [\s!SansBoldItalic] [Baloo2-Bold]
+ \definefontsynonym [\s!SansBold] [Baloo2-Extrabold]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [jaini] [\s!name]
+ \definefontsynonym [\s!Serif] [Jaini-Regular]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [jaini-purva] [\s!name]
+ \definefontsynonym [\s!Serif] [JainiPurva-Regular]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [amita] [\s!name]
+ \definefontsynonym [\s!Serif] [Amita-Regular]
+ \definefontsynonym [\s!SerifBold] [Amita-Bold]
+ \stoptypescript
+
+ % Typefaces:
+
+ \starttypescript [adishila]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default] [\s!rscale=1.42]
+ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default]
+ \stoptypescript
+ \starttypescript [adishila-semibold,adishila-heavy]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default] [\s!rscale=1.46]
+ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default]
+ \stoptypescript
+
+ \starttypescript [adishila-dev]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default] [\s!rscale=1.65]
+ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default]
+ \stoptypescript
+
+ \starttypescript [adishila-dev-guru,adishila-san,adishila-san-letterpress]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default] [\s!rscale=1.62]
+ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default]
+ \stoptypescript
+
+ \starttypescript [shobhika]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default]
+ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default]
+ \stoptypescript
+
+ \starttypescript [baloo,baloo-extrabold]
+ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [\typescriptone] [\s!default]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default]
+ \stoptypescript
+
+ \starttypescript [jaini,jaini-purva]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default] [\s!rscale=1.5]
+ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default]
+ \stoptypescript
+
+ \starttypescript [amita]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default] [\s!rscale=1.2]
+ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default]
+ \stoptypescript
+
+\stoptypescriptcollection
diff --git a/Master/texmf-dist/tex/context/base/mkxl/type-imp-euler.mkxl b/Master/texmf-dist/tex/context/base/mkxl/type-imp-euler.mkxl
new file mode 100644
index 00000000000..a2e066f6b36
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/type-imp-euler.mkxl
@@ -0,0 +1,71 @@
+%D \module
+%D [ file=type-otf,
+%D version=2007.07.30,
+%D title=\CONTEXT\ Typescript Macros,
+%D subtitle=Euler,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+% Instead of euler.otf we now use euler-math.otf which is a copy of the version
+% that Daniel Flipo maintains now. We will also make an euler-regular.otf for
+% text usage (which might have slighty different metrics then).
+
+\loadtypescriptfile[texgyre]
+\loadtypescriptfile[dejavu]
+
+\definefontfeature[pagellaovereuler][pagellaovereuler=yes]
+\definefontfeature[euleroverpagella][euleroverpagella=yes]
+
+\starttypescriptcollection[pagella-eulernova]
+
+ \starttypescript [\s!serif] [eulernova] [\s!name]
+ \setups[\s!font:\s!fallback:\s!serif]
+ \definefontsynonym [\s!Serif] [\s!file:euler-math.otf] [\s!features=\s!default]
+ \stoptypescript
+
+ \starttypescript [\s!math] [eulernova] [\s!name]
+ \definefontsynonym [\s!MathRoman] [\s!file:euler-math.otf] [\s!features={\s!math\mathsizesuffix,mathextra},\s!goodies=euler-math]
+ \stoptypescript
+
+ \starttypescript [pagella-eulernova]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [pagella] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default] [\s!rscale=0.9]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [eulernova] [\s!default]
+ \quittypescriptscanning
+ \stoptypescript
+
+ \starttypescript [eulernova]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [eulernova] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default] [\s!rscale=0.9]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [eulernova] [\s!default]
+ \quittypescriptscanning
+ \stoptypescript
+
+ \starttypescript [\s!math] [euleroverpagella] [\s!name]
+ \definefontsynonym [\s!MathRoman] [texgyrepagella-math] [\s!features={\s!math\mathsizesuffix,euleroverpagella,mathextra},\s!fallbacks=euleroverpagella,\s!goodies=pagella-math]
+ \stoptypescript
+
+ \starttypescript [\s!math] [pagellaovereuler] [\s!name]
+ \definefontsynonym [\s!MathRoman] [\s!file:euler-math.otf] [\s!features={\s!math\mathsizesuffix,pagellaovereuler,mathextra},\s!fallbacks=pagellaovereuler,\s!goodies=euler-math]
+ \stoptypescript
+
+ \starttypescript [pagella-with-euler,euleroverpagella]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [pagella] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default] [\s!rscale=0.9]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [euleroverpagella] [\s!default]
+ \quittypescriptscanning
+ \stoptypescript
+
+ \starttypescript [euler-with-pagella,pagellaovereuler]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [eulernova] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default] [\s!rscale=0.9]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [pagellaovereuler] [\s!default]
+ \quittypescriptscanning
+ \stoptypescript
+
+\stoptypescriptcollection
diff --git a/Master/texmf-dist/tex/context/base/mkxl/type-imp-gujarati.mkxl b/Master/texmf-dist/tex/context/base/mkxl/type-imp-gujarati.mkxl
new file mode 100644
index 00000000000..d7f3f707284
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/type-imp-gujarati.mkxl
@@ -0,0 +1,77 @@
+%D \module
+%D [ file=type-imp-gujarati,
+%D version=2022.02.02,
+%D title=\CONTEXT\ Typescript Macros,
+%D subtitle=Gujarati,
+%D author=Å›rÄ«rÄma (Sreeram),
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%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[gujarati]
+
+ \definefontfeature
+ [baloobhaifeatures]
+ [gujarati-two]
+ [goodies=bhai.lfg,
+ indic={movematra=auto,conjuncts=quit},
+ sanitizer=gjr2rkrf]
+
+ % Symbolic names for fonts:
+ \starttypescript [\s!serif] [noto-serif-gujarati]
+ \definefontsynonym [NotoSerifGujarati-Regular] [\s!name:notoserifgujaratiregular] [\s!features=baloobhaifeatures]
+ \definefontsynonym [NotoSerifGujarati-Bold] [\s!name:notoserifgujaratibold] [\s!features=baloobhaifeatures]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [baloo-bhai, baloo-bhai-extrabold]
+ \definefontsynonym [BalooBhai2-Regular] [\s!name:baloobhai2regular] [\s!features=baloobhaifeatures]
+ \definefontsynonym [BalooBhai2-Medium] [\s!name:baloobhai2medium] [\s!features=baloobhaifeatures]
+ \definefontsynonym [BalooBhai2-Semibold] [\s!name:baloobhai2semibold] [\s!features=baloobhaifeatures]
+ \definefontsynonym [BalooBhai2-Bold] [\s!name:baloobhai2bold] [\s!features=baloobhaifeatures]
+ \definefontsynonym [BalooBhai2-Extrabold] [\s!name:baloobhai2extrabold] [\s!features=baloobhaifeatures]
+ \stoptypescript
+
+ % Grouping of styles:
+
+ \starttypescript [\s!serif] [noto-serif-gujarati] [\s!name]
+ \setups[\s!font:\s!fallback:\s!serif]
+ \definefontsynonym [\s!Serif] [NotoSerifGujarati-Regular]
+ \definefontsynonym [\s!SerifBold] [NotoSerifGujarati-Bold]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [baloo-bhai] [\s!name]
+ \setups[\s!font:\s!fallback:\s!serif]
+ \definefontsynonym [\s!Sans] [BalooBhai2-Regular]
+ \definefontsynonym [\s!SansSlanted] [BalooBhai2-Medium]
+ \definefontsynonym [\s!SansBold] [BalooBhai2-Bold]
+ \definefontsynonym [\s!SansBoldSlanted] [BalooBhai2-Semibold]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [baloo-bhai-extrabold] [\s!name]
+ \setups[\s!font:\s!fallback:\s!serif]
+ \definefontsynonym [\s!Sans] [BalooBhai2-Medium]
+ \definefontsynonym [\s!SansSlanted] [BalooBhai2-Semibold]
+ \definefontsynonym [\s!SansBold] [BalooBhai2-Extrabold]
+ \definefontsynonym [\s!SansBoldSlanted] [BalooBhai2-Bold]
+ \stoptypescript
+
+ % Typefaces:
+
+ \starttypescript [baloo-bhai, baloo-bhai-extrabold]
+ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [\typescriptone] [\s!default] [\s!rscale=1.1]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default]
+ \stoptypescript
+
+ \starttypescript [noto-serif-gujarati]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default] [\s!rscale=1.1]
+ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default]
+ \stoptypescript
+
+\stoptypescriptcollection
diff --git a/Master/texmf-dist/tex/context/base/mkxl/type-imp-indic.mkxl b/Master/texmf-dist/tex/context/base/mkxl/type-imp-indic.mkxl
new file mode 100644
index 00000000000..aeda0833768
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/type-imp-indic.mkxl
@@ -0,0 +1,800 @@
+%D \module
+%D [ file=type-imp-indic,
+%D version=2022.02.02,
+%D title=\CONTEXT\ Typescript Macros,
+%D subtitle=A Collection of Indic Fonts,
+%D author=Sreeram & Hans,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%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 file is a compation to the other indic typescript that evolved out
+%D of a series of experiments with fonts and extensive research by Sreeram
+%D with respect to them either or not supporting level one and level two
+%D features. When there are issues, just ask on the mailing list.
+
+\definefilesynonym [type-imp-adishila.mkxl] [type-imp-devanagari.mkxl]
+\definefilesynonym [type-imp-adishila-semibold.mkxl] [type-imp-devanagari.mkxl]
+\definefilesynonym [type-imp-adishila-heavy.mkxl] [type-imp-devanagari.mkxl]
+\definefilesynonym [type-imp-adishila-dev.mkxl] [type-imp-devanagari.mkxl]
+\definefilesynonym [type-imp-adishila-dev-guru.mkxl] [type-imp-devanagari.mkxl]
+\definefilesynonym [type-imp-adishila-san.mkxl] [type-imp-devanagari.mkxl]
+\definefilesynonym [type-imp-adishila-san-letterpress.mkxl] [type-imp-devanagari.mkxl]
+\definefilesynonym [type-imp-shobhika.mkxl] [type-imp-devanagari.mkxl]
+\definefilesynonym [type-imp-baloo-extrabold.mkxl] [type-imp-devanagari.mkxl]
+\definefilesynonym [type-imp-baloo.mkxl] [type-imp-devanagari.mkxl]
+\definefilesynonym [type-imp-jaini.mkxl] [type-imp-devanagari.mkxl]
+\definefilesynonym [type-imp-jaini-purva.mkxl] [type-imp-devanagari.mkxl]
+\definefilesynonym [type-imp-amita.mkxl] [type-imp-devanagari.mkxl]
+
+\definefilesynonym [type-imp-rit-rachana.mkxl] [type-imp-malayalam.mkxl]
+\definefilesynonym [type-imp-panmana.mkxl] [type-imp-malayalam.mkxl]
+\definefilesynonym [type-imp-ezhuthu.mkxl] [type-imp-malayalam.mkxl]
+\definefilesynonym [type-imp-karumbi.mkxl] [type-imp-malayalam.mkxl]
+\definefilesynonym [type-imp-chilanka.mkxl] [type-imp-malayalam.mkxl]
+\definefilesynonym [type-imp-anjali-oldlipi.mkxl] [type-imp-malayalam.mkxl]
+\definefilesynonym [type-imp-dyuthi.mkxl] [type-imp-malayalam.mkxl]
+\definefilesynonym [type-imp-tn-joy.mkxl] [type-imp-malayalam.mkxl]
+\definefilesynonym [type-imp-tn-joy-extrabold.mkxl] [type-imp-malayalam.mkxl]
+\definefilesynonym [type-imp-gayathri.mkxl] [type-imp-malayalam.mkxl]
+\definefilesynonym [type-imp-gayathri-thin.mkxl] [type-imp-malayalam.mkxl]
+\definefilesynonym [type-imp-manjari.mkxl] [type-imp-malayalam.mkxl]
+\definefilesynonym [type-imp-manjari-thin.mkxl] [type-imp-malayalam.mkxl]
+\definefilesynonym [type-imp-baloo-chettan.mkxl] [type-imp-malayalam.mkxl]
+\definefilesynonym [type-imp-baloo-chettan-extrabold.mkxl] [type-imp-malayalam.mkxl]
+\definefilesynonym [type-imp-rit-sundar.mkxl] [type-imp-malayalam.mkxl]
+
+\definefilesynonym [type-imp-baloo-tammudu.mkxl] [type-imp-telugu.mkxl]
+\definefilesynonym [type-imp-baloo-tammudu-extrabold.mkxl] [type-imp-telugu.mkxl]
+\definefilesynonym [type-imp-murty-telugu.mkxl] [type-imp-telugu.mkxl]
+
+\definefilesynonym [type-imp-murty-kannada.mkxl] [type-imp-kannada.mkxl]
+
+\definefilesynonym [type-imp-baloo-thambi.mkxl] [type-imp-tamil.mkxl]
+\definefilesynonym [type-imp-baloo-thambi-extrabold.mkxl] [type-imp-tamil.mkxl]
+
+\definefilesynonym [type-imp-baloo-bhai.mkxl] [type-imp-gujarati.mkxl]
+\definefilesynonym [type-imp-baloo-bhai-extrabold.mkxl] [type-imp-gujarati.mkxl]
+\definefilesynonym [type-imp-noto-serif-gujarati.mkxl] [type-imp-gujarati.mkxl]
+
+\definefilesynonym [type-imp-baloo-da.mkxl] [type-imp-bengali.mkxl]
+\definefilesynonym [type-imp-baloo-da-extrabold.mkxl] [type-imp-bengali.mkxl]
+\definefilesynonym [type-imp-murty-bangla.mkxl] [type-imp-bengali.mkxl]
+
+\continueifinputfile{type-imp-indic.mkxl}
+
+% \usetypescriptfile[type-imp-indic]
+
+\usemodule[article-basics]
+
+\setupbodyfont
+ [pagella]
+
+\setuphead
+ [title]
+ [alternative=middle,
+ hidenumber=yes,
+ after={\blank[halfline]},
+ before={\blank[line]},
+ page=no,
+ style=\bfb]
+
+\definedescription
+ [fs]
+ [alternative=left,
+ title=yes,
+ width=3cm,
+ distance=0cm,
+ before=,
+ after=,
+ headstyle={\switchtobodyfont[pagella]}]
+
+\usetransliteration
+ [indic]
+
+\definetransliteration
+ [devatoiast]
+ [color=blue,
+ vector={deva to iast},
+ before=]
+
+\definetransliteration
+ [devatomlym]
+ [vector={deva to mlym}]
+
+\definetransliteration
+ [devatotlgu]
+ [vector={deva to tlgu}]
+
+\definetransliteration
+ [devatoknda]
+ [vector={deva to knda}]
+
+\definetransliteration
+ [devatogujr]
+ [vector={deva to gujr}]
+
+\definetransliteration
+ [devatobngl]
+ [vector={deva to bngl}]
+
+\definebuffer[words]
+\definebuffer[iastbuffer]
+
+\language[sa]
+
+\starttext
+
+\startbuffer[words]
+दंषà¥à¤Ÿà¥à¤°à¤¾ शà¥à¤°à¥‡à¤¯à¤¸à¥à¤•à¤°à¥€ तà¥à¤°à¥‡à¤¤à¤¾ विकà¥à¤°à¥‡à¤¤à¤¾ तचà¥à¤›à¥à¤°à¥€ अङà¥à¤•à¤¿à¤¤ शृङà¥à¤—ार कà¥à¤µà¥à¤¯ शारà¥à¤™à¥à¤— निरृति
+कà¥à¤°à¤¤à¥à¤µà¤¿à¤¤à¥à¤¤ बरà¥à¤¹à¤¿à¤¸à¥ पà¥à¤°à¥‡à¤ªà¥à¤¸à¤¿à¤¤ अङà¥à¤˜à¥à¤°à¤¿ पङà¥à¤•à¥à¤¤à¤¿ करà¥à¤¤à¥à¤¤à¤µà¥à¤¯ करà¥à¤¤à¤µà¥à¤¯ शà¥à¤²à¤¾à¤˜à¥à¤¯à¤®à¥
+अवपà¥à¤²à¥à¤¤à¤®à¥ यà¥à¤™à¥à¤•à¥à¤·à¥à¤µà¤¾ कà¥à¤·à¥‡à¤¤à¥à¤°à¤œà¥à¤ž अगà¥à¤¨à¤¿à¤®à¥€à¤³à¥‡ चà¤à¤¦à¥à¤° हरà¥à¤¤à¥à¤°à¥‡ शà¥à¤°à¥€ आरà¥à¤¦à¥à¤°à¤‚
+\stopbuffer
+
+\startbuffer
+\getbuffer[words]
+\stopbuffer
+
+
+% \startbuffer[iastbuffer]
+% \startdevatoiast[before=\blank,after=\blank]
+% \getbuffer
+% \stopdevatoiast
+% \stopbuffer
+%
+% \getbuffer[iastbuffer]
+
+%
+%
+% Devanagari
+%
+%
+\starttitle[title={Adishila}]
+ \start
+ \switchtobodyfont[adishila]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{Bold}
+ {\bf\getbuffer}
+ \stopfs
+ \startfs{Italic}
+ {\it\getbuffer}
+ \stopfs
+ \startfs{Bold Italic}
+ {\bi\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Adishila Semibold}]
+ \start
+ \switchtobodyfont[adishila-semibold]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{Italic}
+ {\it\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Adishila Heavy}]
+ \start
+ \switchtobodyfont[adishila-heavy]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{Italic}
+ {\it\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Adishila Dev}]
+ \start
+ \switchtobodyfont[adishila-dev]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{Bold}
+ {\bf\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Adishila Dev}]
+ \start
+ \switchtobodyfont[adishila-dev-guru]
+ \startfs{Guru}
+ \getbuffer
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Adishila San}]
+ \start
+ \switchtobodyfont[adishila-san]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{Bold}
+ {\bf\getbuffer}
+ \stopfs
+ \startfs{Italic}
+ {\it\getbuffer}
+ \stopfs
+ \startfs{Bold Italic}
+ {\bi\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Adishila San Letterpress}]
+ \start
+ \switchtobodyfont[adishila-san-letterpress]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{Bold}
+ {\bf\getbuffer}
+ \stopfs
+ \startfs{Italic}
+ {\it\getbuffer}
+ \stopfs
+ \startfs{Bold Italic}
+ {\bi\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Shobhika}]
+ \start
+ \switchtobodyfont[shobhika]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{Bold}
+ {\bf\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Baloo 2 Extra Bold}]
+ \start
+ \switchtobodyfont[baloo-extrabold]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{Bold}
+ {\bf\getbuffer}
+ \stopfs
+ \startfs{Italic}
+ {\it\getbuffer}
+ \stopfs
+ \startfs{Bold Italic}
+ {\bi\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Baloo 2}]
+ \start
+ \switchtobodyfont[baloo]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{Bold}
+ {\bf\getbuffer}
+ \stopfs
+ \startfs{Italic}
+ {\it\getbuffer}
+ \stopfs
+ \startfs{Bold Italic}
+ {\bi\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Jaini}]
+ \start
+ \switchtobodyfont[jaini]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Jaini Purva}]
+ \start
+ \switchtobodyfont[jaini-purva]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Amita}]
+ \start
+ \switchtobodyfont[amita]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{Bold}
+ {\bf\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+%
+%
+% Malayalam
+%
+%
+\startbuffer
+\startdevatomlym
+\getbuffer[words]
+\stopdevatomlym
+\stopbuffer
+
+\starttitle[title={RIT Rachana}]
+ \start
+ \switchtobodyfont[rit-rachana]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{Bold}
+ {\bf\getbuffer}
+ \stopfs
+ \startfs{Italic}
+ {\it\getbuffer}
+ \stopfs
+ \startfs{Bold Italic}
+ {\bi\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Panmana}]
+ \start
+ \switchtobodyfont[panmana]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{Bold}
+ {\bf\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Ezhuthu}]
+ \start
+ \switchtobodyfont[ezhuthu]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{Bold}
+ {\bf\getbuffer}
+ \stopfs
+ \startfs{Slanted}
+ {\sl\getbuffer}
+ \stopfs
+ \startfs{Bold Slanted}
+ {\bs\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Karumbi}]
+ \start
+ \switchtobodyfont[karumbi]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Chilanka}]
+ \start
+ \switchtobodyfont[chilanka]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Anjali Old Lipi}]
+ \start
+ \switchtobodyfont[anjali-oldlipi]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Dyuthi}]
+ \start
+ \switchtobodyfont[dyuthi]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={TN Joy}]
+ \start
+ \switchtobodyfont[tn-joy]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{Bold}
+ {\bf\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={TN Joy Extrabold}]
+ \start
+ \switchtobodyfont[tn-joy-extrabold]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{Bold}
+ {\bf\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Gayathri}]
+ \start
+ \switchtobodyfont[gayathri]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{Bold}
+ {\sl\getbuffer}
+ \stopfs
+ \startfs{Bold}
+ {\bf\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Gayathri Thin}]
+ \start
+ \switchtobodyfont[gayathri-thin]
+ \startfs{Thin (R)}
+ \getbuffer
+ \stopfs
+ \startfs{Bold*}
+ {\bf\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Manjari}]
+ \start
+ \switchtobodyfont[manjari]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{Bold}
+ {\bf\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Manjari Thin}]
+ \start
+ \switchtobodyfont[manjari-thin]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{Bold}
+ {\bf\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Baloo Chettan 2}]
+ \start
+ \switchtobodyfont[baloo-chettan]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{Bold}
+ {\bf\getbuffer}
+ \stopfs
+ \startfs{Medium \type{\sl}}
+ {\sl\getbuffer}
+ \stopfs
+ \startfs{Semibold \type{\bs}}
+ {\bs\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Baloo Chettan 2 Extrabold}]
+ \start
+ \switchtobodyfont[baloo-chettan-extrabold]
+ \startfs{Medium \type{\tf}}
+ \getbuffer
+ \stopfs
+ \startfs{Extrabold \type{\bf}}
+ {\bf\getbuffer}
+ \stopfs
+ \startfs{Semibold \type{\sl}}
+ {\sl\getbuffer}
+ \stopfs
+ \startfs{Bold \type{\bs}}
+ {\bs\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={RIT Sundar}]
+ \start
+ \switchtobodyfont[rit-sundar]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{Bold}
+ {\bf\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+%
+%
+% Telugu
+%
+%
+\startbuffer
+\startdevatotlgu
+\getbuffer[words]
+\stopdevatotlgu
+\stopbuffer
+
+\starttitle[title={Baloo Tammudu 2}]
+ \start
+ \switchtobodyfont[baloo-tammudu]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{Bold}
+ {\bf\getbuffer}
+ \stopfs
+ \startfs{Slanted}
+ {\sl\getbuffer}
+ \stopfs
+ \startfs{Bold Slanted}
+ {\bs\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Baloo Tammudu 2 Extrabold}]
+ \start
+ \switchtobodyfont[baloo-tammudu-extrabold]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{Bold}
+ {\bf\getbuffer}
+ \stopfs
+ \startfs{Italic}
+ {\sl\getbuffer}
+ \stopfs
+ \startfs{Bold Italic}
+ {\bs\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Murty Telugu}]
+ \start
+ \switchtobodyfont[murty-telugu]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{Regular}
+ {\sl\getbuffer}
+ \stopfs
+ \startfs{Regular}
+ {\bf\getbuffer}
+ \stopfs
+ \startfs{Regular}
+ {\bs\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+%
+%
+% Kannada
+%
+%
+\startbuffer
+\startdevatoknda
+\getbuffer[words]
+\stopdevatoknda
+\stopbuffer
+
+\starttitle[title={Murty Kannada}]
+ \start
+ \switchtobodyfont[murty-kannada]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{Regular}
+ {\bf\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+%
+%
+% Tamil
+%
+%
+\start
+\language[ta]
+\startbuffer
+சிறà¯à®±à®®à®ªà®²à®®à¯ பà¯à®¯à®²à¯ காறà¯à®±à¯ à®®à¯à®©à¯à®©à®°à¯ அதே எதெ அதை ஔவையாரà¯
+தொடரà¯à®•à®¤à¯ˆ கிழாலà¯à®²à®¿ அழைபà¯à®ªà¯ வாயிலாக இயறà¯à®•à¯ˆ நà¯à®´à¯ˆà®µà®¾à®¯à®¿à®²à¯
+இளமை காஞà¯à®šà®¿ கசà¯à®šà®¿ இலà¯à®•à¯à®•à®¿à®¯à®®à¯ ஸà¯à®°à¯€
+\stopbuffer
+
+\starttitle[title={Baloo Thambi 2}]
+ \start
+ \switchtobodyfont[baloo-thambi]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{ஂMedium \type{\sl}}
+ {\sl\getbuffer}
+ \stopfs
+ \startfs{Semibold \type{\bs}}
+ {\bs\getbuffer}
+ \stopfs
+ \startfs{Bold}
+ {\bf\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Baloo Thambi 2 Extrabold}]
+ \start
+ \switchtobodyfont[baloo-thambi-extrabold]
+ \startfs{Medium}
+ \getbuffer
+ \stopfs
+ \startfs{Semibold \type{\sl}}
+ {\sl\getbuffer}
+ \stopfs
+ \startfs{Bold \type{\bs}}
+ {\bs\getbuffer}
+ \stopfs
+ \startfs{Extrabold}
+ {\bf\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+\stop
+%
+%
+% Gujarati
+%
+%
+\startbuffer
+\startdevatogujr
+\getbuffer[words]
+\stopdevatogujr
+\stopbuffer
+
+\starttitle[title={Baloo Bhai 2}]
+ \start
+ \switchtobodyfont[baloo-bhai]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{ஂMedium \type{\sl}}
+ {\sl\getbuffer}
+ \stopfs
+ \startfs{Semibold \type{\bs}}
+ {\bs\getbuffer}
+ \stopfs
+ \startfs{Bold}
+ {\bf\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Baloo Bhai 2 Extrabold}]
+ \start
+ \switchtobodyfont[baloo-bhai-extrabold]
+ \startfs{Medium}
+ \getbuffer
+ \stopfs
+ \startfs{Semibold \type{\sl}}
+ {\sl\getbuffer}
+ \stopfs
+ \startfs{Bold \type{\bs}}
+ {\bs\getbuffer}
+ \stopfs
+ \startfs{Extrabold}
+ {\bf\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Noto Serif Gujarati}]
+ \start
+ \switchtobodyfont[noto-serif-gujarati]
+ \startfs{Medium}
+ \getbuffer
+ \stopfs
+ \startfs{Extrabold}
+ {\bf\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+%
+%
+% Bengali
+%
+%
+\startbuffer
+\startdevatobngl
+\getbuffer[words]
+\stopdevatobngl
+\stopbuffer
+
+\starttitle[title={Baloo Da 2}]
+ \start
+ \switchtobodyfont[baloo-da]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{Medium \type{\sl}}
+ {\sl\getbuffer}
+ \stopfs
+ \startfs{Semibold \type{\bs}}
+ {\bs\getbuffer}
+ \stopfs
+ \startfs{Bold}
+ {\bf\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Baloo Da 2 Extrabold}]
+ \start
+ \switchtobodyfont[baloo-da-extrabold]
+ \startfs{Medium}
+ \getbuffer
+ \stopfs
+ \startfs{Semibold \type{\sl}}
+ {\sl\getbuffer}
+ \stopfs
+ \startfs{Bold \type{\bs}}
+ {\bs\getbuffer}
+ \stopfs
+ \startfs{Extrabold}
+ {\bf\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\starttitle[title={Murty Bengali}]
+ \start
+ \switchtobodyfont[murty-bangla]
+ \startfs{Regular}
+ \getbuffer
+ \stopfs
+ \startfs{Regular}
+ {\bf\getbuffer}
+ \stopfs
+ \stop
+\stoptitle
+
+\stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkxl/type-imp-kannada.mkxl b/Master/texmf-dist/tex/context/base/mkxl/type-imp-kannada.mkxl
new file mode 100644
index 00000000000..4838075b2e6
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/type-imp-kannada.mkxl
@@ -0,0 +1,73 @@
+%D \module
+%D [ file=type-imp-kannada,
+%D version=2022.01.27,
+%D title=\CONTEXT\ Typescript Macros,
+%D subtitle=Dekannada,
+%D author=Å›rÄ«rÄma (Sreeram),
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%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[kannada]
+
+ \doifunknownfontfeature {kannada-bold-30} {\definefontfeature[kannada-bold-30][boldened-30]}
+
+ % Symbolic names for fonts:
+
+ \starttypescript [\s!serif] [murty-kannada]
+ \definefontsynonym [MurtyKannada-Regular] [\s!name:murtykannadaregular] [\s!features=kannada-two]
+ \definefontsynonym [MurtyKannada-Bold] [\s!name:murtykannadaregular] [\s!features={kannada-two,kannada-bold-30}]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [baloo-tamma, baloo-tamma-extrabold]
+ \definefontsynonym [BalooTamma2-Regular] [\s!name:balootamma2regular] [\s!features=kannada-two]
+ \definefontsynonym [BalooTamma2-Medium] [\s!name:balootamma2medium] [\s!features=kannada-two]
+ \definefontsynonym [BalooTamma2-Semibold] [\s!name:balootamma2semibold] [\s!features=kannada-two]
+ \definefontsynonym [BalooTamma2-Bold] [\s!name:balootamma2bold] [\s!features=kannada-two]
+ \definefontsynonym [BalooTamma2-Extrabold] [\s!name:balootamma2extrabold] [\s!features=kannada-two]
+ \stoptypescript
+
+ % Grouping of styles:
+
+ \starttypescript [\s!sans] [baloo-tamma] [\s!name]
+ \setups[\s!font:\s!fallback:\s!serif]
+ \definefontsynonym [\s!Sans] [BalooTamma2-Regular]
+ \definefontsynonym [\s!SansSlanted] [BalooTamma2-Medium]
+ \definefontsynonym [\s!SansBold] [BalooTamma2-Bold]
+ \definefontsynonym [\s!SansBoldSlanted] [BalooTamma2-Semibold]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [baloo-tamma-extrabold] [\s!name]
+ \setups[\s!font:\s!fallback:\s!serif]
+ \definefontsynonym [\s!Sans] [BalooTamma2-Medium]
+ \definefontsynonym [\s!SansSlanted] [BalooTamma2-Semibold]
+ \definefontsynonym [\s!SansBold] [BalooTamma2-Extrabold]
+ \definefontsynonym [\s!SansBoldSlanted] [BalooTamma2-Bold]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [murty-kannada] [\s!name]
+ \setups[\s!font:\s!fallback:\s!serif]
+ \definefontsynonym [\s!Serif] [MurtyKannada-Regular]
+ \definefontsynonym [\s!SerifBold] [MurtyKannada-Bold]
+ \stoptypescript
+
+ % Typefaces:
+
+ \starttypescript [baloo-tamma, baloo-tamma-extrabold]
+ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [\typescriptone] [\s!default]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default]
+ \stoptypescript
+
+ \starttypescript [murty-kannada]
+ \definetypeface [murty-kannada] [\s!rm] [\s!serif] [murty-kannada] [\s!default]
+ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default]
+ \stoptypescript
+
+\stoptypescriptcollection
diff --git a/Master/texmf-dist/tex/context/base/mkxl/type-imp-malayalam.mkxl b/Master/texmf-dist/tex/context/base/mkxl/type-imp-malayalam.mkxl
new file mode 100644
index 00000000000..67a35d47258
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/type-imp-malayalam.mkxl
@@ -0,0 +1,224 @@
+%D \module
+%D [ file=type-imp-malayam,
+%D version=2022.01.27,
+%D title=\CONTEXT\ Typescript Macros,
+%D subtitle=Demalayalam,
+%D author=Å›rÄ«rÄma (Sreeram),
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%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 collection uses rscaling so that the fonts can be used alongside.
+
+\starttypescriptcollection[malayalam]
+
+ \doifunknownfontfeature {malayalam-bold-30} {\definefontfeature[malayalam-bold-30][boldened-30]}
+
+ % Symbolic names for fonts:
+
+ \starttypescript [\s!serif] [rit-rachana]
+ \definefontsynonym [RITRachana-Regular] [\s!name:ritrachanaregular] [\s!features=malayalam-two]
+ \definefontsynonym [RITRachana-Bold] [\s!name:ritrachanabold] [\s!features=malayalam-two]
+ \definefontsynonym [RITRachana-Italic] [\s!name:ritrachanaitalic] [\s!features=malayalam-two]
+ \definefontsynonym [RITRachana-BoldItalic] [\s!name:ritrachanabolditalic] [\s!features=malayalam-two]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [panmana]
+ \definefontsynonym [Panmana-Regular] [\s!name:panmanaregular] [\s!features=malayalam-two]
+ \definefontsynonym [Panmana-Bold] [\s!name:panmanaregular] [\s!features={malayalam-two,malayalam-bold-30}]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [rit-sundar]
+ \definefontsynonym [RITSundar-Regular] [\s!name:ritsundarbold] [\s!features=malayalam-two]
+ \definefontsynonym [RITSundar-Bold] [\s!name:ritsundarbold] [\s!features={malayalam-two,malayalam-bold-30}]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [tn-joy, tn-joy-extrabold]
+ \definefontsynonym [TNJoy-Regular] [\s!name:tnjoyregular] [\s!features=malayalam-two]
+ \definefontsynonym [TNJoy-Bold] [\s!name:tnjoybold] [\s!features=malayalam-two]
+ \definefontsynonym [TNJoy-Extrabold] [\s!name:tnjoyextrabold] [\s!features=malayalam-two]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [ezhuthu]
+ \definefontsynonym [Ezhuthu-Regular] [\s!name:ezhuthuregular] [\s!features=malayalam-two]
+ \definefontsynonym [Ezhuthu-Bold] [\s!name:ezhuthuregular] [\s!features={malayalam-two,malayalam-bold-30}]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [baloo-chettan,baloo-chettan-extrabold]
+ \definefontsynonym [BalooChettan2-Regular] [\s!name:baloochettan2regular] [\s!features=malayalam-two]
+ \definefontsynonym [BalooChettan2-Medium] [\s!name:baloochettan2medium] [\s!features=malayalam-two]
+ \definefontsynonym [BalooChettan2-Semibold] [\s!name:baloochettan2semibold] [\s!features=malayalam-two]
+ \definefontsynonym [BalooChettan2-Bold] [\s!name:baloochettan2bold] [\s!features=malayalam-two]
+ \definefontsynonym [BalooChettan2-Extrabold] [\s!name:baloochettan2extrabold] [\s!features=malayalam-two]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [gayathri, gayathri-thin]
+ \definefontsynonym [Gayathri-Regular] [\s!name:gayathriregular] [\s!features=malayalam-two]
+ \definefontsynonym [Gayathri-Bold] [\s!name:gayathribold] [\s!features=malayalam-two]
+ \definefontsynonym [Gayathri-Thin] [\s!name:gayathrithin] [\s!features=malayalam-two]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [manjari,manjari-thin]
+ \definefontsynonym [Manjari-Regular] [\s!name:manjariregular] [\s!features=malayalam-two]
+ \definefontsynonym [Manjari-Bold] [\s!name:manjaribold] [\s!features=malayalam-two]
+ \definefontsynonym [Manjari-Thin] [\s!name:manjarithin] [\s!features=malayalam-two]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [karumbi]
+ \definefontsynonym [Karumbi-Regular] [\s!name:karumbiregular] [\s!features=malayalam-two]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [chilanka]
+ \definefontsynonym [Chilanka-Regular] [\s!name:chilankaregular] [\s!features=malayalam-two]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [anjali-oldlipi]
+ \definefontsynonym [Anjali-Oldlipi-Regular] [\s!name:anjalioldlipiregular] [\s!features=malayalam-two]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [dyuthi]
+ \definefontsynonym [Dyuthi-Regular] [\s!name:dyuthiregular] [\s!features=malayalam-two]
+ \stoptypescript
+
+ % Grouping of styles:
+
+ \starttypescript [\s!serif] [rit-rachana] [\s!name]
+ \setups[\s!font:\s!fallback:\s!serif]
+ \definefontsynonym [\s!Serif] [RITRachana-Regular]
+ \definefontsynonym [\s!SerifBold] [RITRachana-Bold]
+ \definefontsynonym [\s!SerifItalic] [RITRachana-Italic]
+ \definefontsynonym [\s!SerifBoldItalic] [RITRachana-BoldItalic]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [panmana] [\s!name]
+ \setups[\s!font:\s!fallback:\s!serif]
+ \definefontsynonym [\s!Serif] [Panmana-Regular]
+ \definefontsynonym [\s!SerifBold] [Panmana-Bold]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [rit-sundar] [\s!name]
+ \setups[\s!font:\s!fallback:\s!serif]
+ \definefontsynonym [\s!Serif] [RITSundar-Regular]
+ \definefontsynonym [\s!SerifBold] [RITSundar-Bold]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [tn-joy] [\s!name]
+ \setups[\s!font:\s!fallback:\s!sans]
+ \definefontsynonym [\s!Sans] [TNJoy-Regular]
+ \definefontsynonym [\s!SansBold] [TNJoy-Bold]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [tn-joy-extrabold] [\s!name]
+ \setups[\s!font:\s!fallback:\s!sans]
+ \definefontsynonym [\s!Sans] [TNJoy-Bold]
+ \definefontsynonym [\s!SansBold] [TNJoy-Extrabold]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [ezhuthu] [\s!name]
+ \setups[\s!font:\s!fallback:\s!sans]
+ \definefontsynonym [\s!Sans] [Ezhuthu-Regular]
+ \definefontsynonym [\s!SansBold] [Ezhuthu-Bold]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [karumbi] [\s!name]
+ \setups[\s!font:\s!fallback:\s!sans]
+ \definefontsynonym [\s!Sans] [Karumbi-Regular]
+ \definefontsynonym [\s!SansBold] [Karumbi-Bold]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [chilanka] [\s!name]
+ \setups[\s!font:\s!fallback:\s!sans]
+ \definefontsynonym [\s!Sans] [Chilanka-Regular]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [anjali-oldlipi] [\s!name]
+ \setups[\s!font:\s!fallback:\s!sans]
+ \definefontsynonym [\s!Sans] [Anjali-Oldlipi-Regular]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [dyuthi] [\s!name]
+ \setups[\s!font:\s!fallback:\s!sans]
+ \definefontsynonym [\s!Sans] [Dyuthi-Regular]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [gayathri] [\s!name]
+ \setups[\s!font:\s!fallback:\s!sans]
+ \definefontsynonym [\s!Sans] [Gayathri-Regular]
+ \definefontsynonym [\s!SansBold] [Gayathri-Bold]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [gayathri-thin] [\s!name]
+ \setups[\s!font:\s!fallback:\s!sans]
+ \definefontsynonym [\s!Sans] [Gayathri-Thin]
+ \definefontsynonym [\s!SansBold] [Gayathri-Regular]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [manjari] [\s!name]
+ \setups[\s!font:\s!fallback:\s!sans]
+ \definefontsynonym [\s!Sans ] [Manjari-Regular]
+ \definefontsynonym [\s!SansBold] [Manjari-Bold]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [manjari-thin] [\s!name]
+ \setups[\s!font:\s!fallback:\s!sans]
+ \definefontsynonym [\s!Sans] [Manjari-Thin]
+ \definefontsynonym [\s!SansBold] [Manjari-Regular]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [baloo-chettan] [\s!name]
+ \setups[\s!font:\s!fallback:\s!sans]
+ \definefontsynonym [\s!Sans] [BalooChettan2-Regular]
+ \definefontsynonym [\s!SansBold] [BalooChettan2-Bold]
+ \definefontsynonym [\s!SansSlanted] [BalooChettan2-Medium]
+ \definefontsynonym [\s!SansBoldSlanted] [BalooChettan2-Semibold]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [baloo-chettan-extrabold] [name]
+ \setups[\s!font:\s!fallback:\s!sans]
+ \definefontsynonym [\s!Sans] [BalooChettan2-Medium]
+ \definefontsynonym [\s!SansSlanted] [BalooChettan2-Semibold]
+ \definefontsynonym [\s!SansBoldSlanted] [BalooChettan2-Bold]
+ \definefontsynonym [\s!SansBold] [BalooChettan2-Extrabold]
+ \stoptypescript
+
+ % Typefaces:
+
+ \starttypescript [rit-rachana,rit-sundar,panmana]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [\typescriptone] [\s!default] [\s!rscale=1.25]
+ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default]
+ \stoptypescript
+
+ \starttypescript [ezhuthu,karumbi,tn-joy,tn-joy-extrabold]
+ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [\typescriptone] [\s!default] [\s!rscale=1.25]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default]
+ \stoptypescript
+
+ \starttypescript [chilanka,anjali-oldlipi]
+ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [\typescriptone] [\s!default]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default]
+ \stoptypescript
+
+ \starttypescript [dyuthi,gayathri,gayathri-thin,manjari,manjari-thin]
+ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [\typescriptone] [\s!default] [\s!rscale=1.1]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default]
+ \stoptypescript
+
+ \starttypescript [baloo-chettan,baloo-chettan-extrabold]
+ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [baloo-chettan] [\s!default]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default]
+ \stoptypescript
+
+\stoptypescriptcollection
diff --git a/Master/texmf-dist/tex/context/base/mkxl/type-imp-tamil.mkxl b/Master/texmf-dist/tex/context/base/mkxl/type-imp-tamil.mkxl
new file mode 100644
index 00000000000..90516365efa
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/type-imp-tamil.mkxl
@@ -0,0 +1,53 @@
+%D \module
+%D [ file=type-imp-tamil,
+%D version=2022.02.02,
+%D title=\CONTEXT\ Typescript Macros,
+%D subtitle=Tamil,
+%D author=Å›rÄ«rÄma (Sreeram),
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%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[tamil]
+
+ % Symbolic names for fonts:
+
+ \starttypescript [\s!sans] [baloo-thambi, baloo-thambi-extrabold]
+ \definefontsynonym [BalooThambi2-Regular] [\s!name:baloothambi2regular] [\s!features=tamil-two]
+ \definefontsynonym [BalooThambi2-Medium] [\s!name:baloothambi2medium] [\s!features=tamil-two]
+ \definefontsynonym [BalooThambi2-Semibold] [\s!name:baloothambi2semibold] [\s!features=tamil-two]
+ \definefontsynonym [BalooThambi2-Bold] [\s!name:baloothambi2bold] [\s!features=tamil-two]
+ \definefontsynonym [BalooThambi2-Extrabold] [\s!name:baloothambi2extrabold] [\s!features=tamil-two]
+ \stoptypescript
+
+ % Grouping of styles:
+
+ \starttypescript [\s!sans] [baloo-thambi] [\s!name]
+ \setups[\s!font:\s!fallback:\s!serif]
+ \definefontsynonym [\s!Sans] [BalooThambi2-Regular]
+ \definefontsynonym [\s!SansSlanted] [BalooThambi2-Medium]
+ \definefontsynonym [\s!SansBold] [BalooThambi2-Bold]
+ \definefontsynonym [\s!SansBoldSlanted] [BalooThambi2-Semibold]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [baloo-thambi-extrabold] [\s!name]
+ \setups[\s!font:\s!fallback:\s!serif]
+ \definefontsynonym [\s!Sans] [BalooThambi2-Medium]
+ \definefontsynonym [\s!SansSlanted] [BalooThambi2-Semibold]
+ \definefontsynonym [\s!SansBold] [BalooThambi2-Extrabold]
+ \definefontsynonym [\s!SansBoldSlanted] [BalooThambi2-Bold]
+ \stoptypescript
+
+ % Typefaces:
+
+ \starttypescript [baloo-thambi, baloo-thambi-extrabold]
+ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [\typescriptone] [\s!default]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default]
+ \stoptypescript
+
+\stoptypescriptcollection
diff --git a/Master/texmf-dist/tex/context/base/mkxl/type-imp-telugu.mkxl b/Master/texmf-dist/tex/context/base/mkxl/type-imp-telugu.mkxl
new file mode 100644
index 00000000000..33d07664c75
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/type-imp-telugu.mkxl
@@ -0,0 +1,74 @@
+%D \module
+%D [ file=type-imp-telugu,
+%D version=2022.01.27,
+%D title=\CONTEXT\ Typescript Macros,
+%D subtitle=Telugu,
+%D author=Å›rÄ«rÄma (Sreeram),
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%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[telugu]
+
+ \doifunknownfontfeature {telugu-bold-30} {\definefontfeature[telugu-bold-30][boldened-30]}
+ \doifunknownfontfeature {telugu-slant} {\definefontfeature[telugu-slant][slant=0.25]}
+
+ % Symbolic names for fonts:
+
+ \starttypescript [\s!serif] [murty-telugu]
+ \definefontsynonym [MurtyTelugu-Regular] [\s!name:murtyteluguregular] [\s!features=telugu-two]
+ \definefontsynonym [MurtyTelugu-Bold] [\s!name:murtyteluguregular] [\s!features={telugu-two,telugu-bold-30}]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [baloo-tammudu, baloo-tammudu-extrabold]
+ \definefontsynonym [BalooTammudu2-Regular] [\s!name:balootammudu2regular] [\s!features=telugu-two]
+ \definefontsynonym [BalooTammudu2-Medium] [\s!name:balootammudu2medium] [\s!features=telugu-two]
+ \definefontsynonym [BalooTammudu2-Semibold] [\s!name:balootammudu2semibold] [\s!features=telugu-two]
+ \definefontsynonym [BalooTammudu2-Bold] [\s!name:balootammudu2bold] [\s!features=telugu-two]
+ \definefontsynonym [BalooTammudu2-Extrabold] [\s!name:balootammudu2extrabold] [\s!features=telugu-two]
+ \stoptypescript
+
+ % Grouping of styles:
+
+ \starttypescript [\s!sans] [baloo-tammudu] [\s!name]
+ \setups[\s!font:\s!fallback:\s!serif]
+ \definefontsynonym [\s!Sans] [BalooTammudu2-Regular]
+ \definefontsynonym [\s!SansSlanted] [BalooTammudu2-Medium]
+ \definefontsynonym [\s!SansBold] [BalooTammudu2-Bold]
+ \definefontsynonym [\s!SansBoldSlanted] [BalooTammudu2-Semibold]
+ \stoptypescript
+
+ \starttypescript [\s!sans] [baloo-tammudu-extrabold] [\s!name]
+ \setups[\s!font:\s!fallback:\s!serif]
+ \definefontsynonym [\s!Sans] [BalooTammudu2-Medium]
+ \definefontsynonym [\s!SansSlanted] [BalooTammudu2-Semibold]
+ \definefontsynonym [\s!SansBold] [BalooTammudu2-Extrabold]
+ \definefontsynonym [\s!SansBoldSlanted] [BalooTammudu2-Bold]
+ \stoptypescript
+
+ \starttypescript [\s!serif] [murty-telugu] [\s!name]
+ \setups[\s!font:\s!fallback:\s!serif]
+ \definefontsynonym [\s!Serif] [MurtyTelugu-Regular]
+ \definefontsynonym [\s!SerifBold] [MurtyTelugu-Bold]
+ \stoptypescript
+
+ % Typefaces:
+
+ \starttypescript [baloo-tammudu, baloo-tammudu-extrabold]
+ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [\typescriptone] [\s!default]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default]
+ \stoptypescript
+
+ \starttypescript [murty-telugu]
+ \definetypeface [\typescriptone] [\s!rm] [\s!serif] [murty-telugu] [\s!default]
+ \definetypeface [\typescriptone] [\s!ss] [\s!sans] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!mm] [\s!math] [dejavu] [\s!default]
+ \definetypeface [\typescriptone] [\s!tt] [\s!mono] [dejavu] [\s!default]
+ \stoptypescript
+
+\stoptypescriptcollection
diff --git a/Master/texmf-dist/tex/context/base/mkxl/type-ini.mklx b/Master/texmf-dist/tex/context/base/mkxl/type-ini.mklx
index bba2d433b20..4842451e7e9 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/type-ini.mklx
+++ b/Master/texmf-dist/tex/context/base/mkxl/type-ini.mklx
@@ -27,7 +27,7 @@
\unprotect
-\newcount \c_font_typescripts_n_of_preloaded
+\newinteger \c_font_typescripts_n_of_preloaded
\newconditional\c_font_typescripts_quit
\newtoks \c_font_typescripts_document
\newconditional\c_font_typescripts_preload
@@ -39,29 +39,29 @@
\newtoks \everybeforedefinetypeface
\newtoks \everyafterdefinetypeface
-\mutable\let\typescriptfiles \empty
-\mutable\let\currenttypescripts\empty
-\mutable\let\currenttypefile \empty
+\mutable\lettonothing\typescriptfiles
+\mutable\lettonothing\currenttypescripts
+\mutable\lettonothing\currenttypefile
\installmacrostack\currenttypefile
-\mutable\let\typescriptone \empty % public, used in typescripts
-\mutable\let\typescripttwo \empty % public, used in typescripts
-\mutable\let\typescriptthree\empty % public, used in typescripts
+\mutable\lettonothing\typescriptone % public, used in typescripts
+\mutable\lettonothing\typescripttwo % public, used in typescripts
+\mutable\lettonothing\typescriptthree % public, used in typescripts
\installmacrostack\typescriptone
\installmacrostack\typescripttwo
\installmacrostack\typescriptthree
-\mutable\let\fontclassstyle \empty
+\mutable\lettonothing\fontclassstyle
\installmacrostack\fontclassstyle
-\let\m_font_typescripts_one \empty
-\let\m_font_typescripts_two \empty
-\let\m_font_typescripts_three\empty
-\let\m_font_typescripts_check\empty
-\let\m_font_typescripts_match\empty
+\lettonothing\m_font_typescripts_one
+\lettonothing\m_font_typescripts_two
+\lettonothing\m_font_typescripts_three
+\lettonothing\m_font_typescripts_check
+\lettonothing\m_font_typescripts_match
\installmacrostack\m_font_typescripts_one
\installmacrostack\m_font_typescripts_two
@@ -105,7 +105,7 @@
\permanent\protected\def\usetypescriptfile[#filename]%
{\ifcstok{#filename}\v!reset
- \let\typescriptfiles\empty
+ \lettonothing\typescriptfiles
\else
\splitfilename{#filename}%
\addtocommalist\splitoffbase\typescriptfiles
@@ -195,14 +195,14 @@
{\settrue\c_font_typescripts_quit} % public
\permanent\protected\def\font_typescripts_start_store#definitions\stoptypescript
- {\global\advance\c_font_typescripts_n_of_preloaded\plusone
+ {\global\advanceby\c_font_typescripts_n_of_preloaded\plusone
\gdefcsname\??typescriptcache\the\c_font_typescripts_n_of_preloaded\endcsname
{\starttypescript#definitions\stoptypescript}%
\gtoksapp\t_font_typescripts\expandafter
{\csname\??typescriptcache\the\c_font_typescripts_n_of_preloaded\endcsname}}
\permanent\protected\def\font_typescripts_collection_start_store#definitions\stoptypescriptcollection
- {\global\advance\c_font_typescripts_n_of_preloaded\plusone
+ {\global\advanceby\c_font_typescripts_n_of_preloaded\plusone
\gdefcsname\??typescriptcache\the\c_font_typescripts_n_of_preloaded\endcsname
{\starttypescriptcollection#definitions\stoptypescriptcollection}%
\gtoksapp\t_font_typescripts\expandafter
@@ -296,7 +296,7 @@
{\let\typescriptone \m_font_typescripts_one
\let\typescripttwo \m_font_typescripts_two
\let\typescriptthree\m_font_typescripts_three
- \let\m_font_typescripts_match\empty
+ \lettonothing\m_font_typescripts_match
\doifelsenextoptionalcs\font_typescripts_start_process_one\font_typescripts_start_process_all}
\def\font_typescripts_start_process_all % could be a \let
@@ -496,11 +496,11 @@
\def\font_typefaces_defining_start#name#style#settings%
{\let\m_ts_rscale \!!plusone % as we push/pop
- \let\m_ts_features \empty
- \let\m_ts_fallbacks \empty
- \let\m_ts_goodies \empty
- \let\m_ts_direction \empty
- \let\m_ts_designsize\empty
+ \lettonothing\m_ts_features
+ \lettonothing\m_ts_fallbacks
+ \lettonothing\m_ts_goodies
+ \lettonothing\m_ts_direction
+ \lettonothing\m_ts_designsize
\geteparameters[m_ts_][#settings]% todo raw ... no need for key interpretation
\push_macro_fontclass
\push_macro_fontclassstyle
diff --git a/Master/texmf-dist/tex/context/base/mkxl/type-set.mkxl b/Master/texmf-dist/tex/context/base/mkxl/type-set.mkxl
index 4a22b59a50a..5b83f287e48 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/type-set.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/type-set.mkxl
@@ -31,7 +31,7 @@
\loadfoundtypescriptfile\empty{type-lua.mkxl}
\loadfoundtypescriptfile\empty{type-siz.mkxl}
\loadfoundtypescriptfile\empty{type-fbk.mkxl}
- \loadfoundtypescriptfile\empty{type-imp-latinmodern.mkiv}
+ \loadfoundtypescriptfile\empty{type-imp-latinmodern.mkiv} % maybe no longer
% and not:
@@ -54,86 +54,130 @@
\usetypescriptfile[fbk]
\usetypescriptfile[lua]
\usetypescriptfile[siz]
- \usetypescriptfile[latinmodern]
+ \usetypescriptfile[latinmodern] % maybe no longer
\usetypescriptfile[loc]
\fi
-\definefilesynonym [type-imp-latin-modern.mkiv] [type-imp-latinmodern.mkiv]
-\definefilesynonym [type-imp-modern-latin.mkiv] [type-imp-modernlatin.mkiv]
-
-\definefilesynonym [type-imp-lucida.mkiv] [type-imp-lucida-typeone.mkiv]
-\definefilesynonym [type-imp-lucidaot.mkiv] [type-imp-lucida-opentype.mkiv]
-\definefilesynonym [type-imp-lucidadk.mkiv] [type-imp-lucida-opentype.mkiv]
-
-\definefilesynonym [type-imp-dejavu-condensed.mkiv] [type-imp-dejavu.mkiv]
-
-\definefilesynonym [type-imp-palatino.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-courier.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-avantgarde.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-helvetica.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-chancery.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-bookman.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-schoolbook.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-times.mkiv] [type-imp-texgyre.mkiv]
-
-\definefilesynonym [type-imp-cursor.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-adventor.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-heros.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-chorus.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-bonum.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-schola.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-pagella.mkiv] [type-imp-texgyre.mkiv]
-\definefilesynonym [type-imp-termes.mkiv] [type-imp-texgyre.mkiv]
-
-\definefilesynonym [type-imp-mscoretimes.mkiv] [type-imp-mscore.mkiv]
-\definefilesynonym [type-imp-mscorearial.mkiv] [type-imp-mscore.mkiv]
-\definefilesynonym [type-imp-mscorecourier.mkiv] [type-imp-mscore.mkiv]
-\definefilesynonym [type-imp-mscoreverdana.mkiv] [type-imp-mscore.mkiv]
-
-\definefilesynonym [type-imp-candara.mkiv] [type-imp-cleartype.mkiv]
-\definefilesynonym [type-imp-consolas.mkiv] [type-imp-cleartype.mkiv]
-\definefilesynonym [type-imp-constantia.mkiv] [type-imp-cleartype.mkiv]
-\definefilesynonym [type-imp-corbel.mkiv] [type-imp-cleartype.mkiv]
-\definefilesynonym [type-imp-calibri.mkiv] [type-imp-cleartype.mkiv]
-
-\definefilesynonym [type-imp-antykwa-poltawskiego.mkiv] [type-imp-antykwapoltawskiego.mkiv]
-
-%definefilesynonym [type-imp-mac.mkiv] [type-imp-osx.mkiv]
-%definefilesynonym [type-imp-win.mkiv] [type-imp-mscore.mkiv]
-
-\definefilesynonym [type-imp-eulernovum.mkiv] [type-imp-euler.mkiv]
-\definefilesynonym [type-imp-eulernova.mkiv] [type-imp-euler.mkiv]
-
-\definefilesynonym [type-imp-euler-with-pagella.mkiv] [type-imp-euler.mkiv]
-\definefilesynonym [type-imp-pagella-with-euler.mkiv] [type-imp-euler.mkiv]
-
-\definefilesynonym [type-imp-mdbch.mkiv] [type-imp-mathdesign.mkiv]
-\definefilesynonym [type-imp-mdugm.mkiv] [type-imp-mathdesign.mkiv]
-\definefilesynonym [type-imp-mdput.mkiv] [type-imp-mathdesign.mkiv]
-\definefilesynonym [type-imp-mdici.mkiv] [type-imp-mathdesign.mkiv]
-\definefilesynonym [type-imp-mdpgd.mkiv] [type-imp-mathdesign.mkiv]
-\definefilesynonym [type-imp-mdpus.mkiv] [type-imp-mathdesign.mkiv]
-
-\definefilesynonym [type-imp-mathdesignch.mkiv] [type-imp-mathdesign.mkiv]
-\definefilesynonym [type-imp-mathdesigngm.mkiv] [type-imp-mathdesign.mkiv]
-\definefilesynonym [type-imp-mathdesignut.mkiv] [type-imp-mathdesign.mkiv]
-\definefilesynonym [type-imp-mathdesignci.mkiv] [type-imp-mathdesign.mkiv]
-\definefilesynonym [type-imp-mathdesigngd.mkiv] [type-imp-mathdesign.mkiv]
-\definefilesynonym [type-imp-mathdesignus.mkiv] [type-imp-mathdesign.mkiv]
-
-\definefilesynonym [type-imp-mathdesigncharter.mkiv] [type-imp-mathdesign.mkiv]
-\definefilesynonym [type-imp-mathdesigngaramond.mkiv] [type-imp-mathdesign.mkiv]
-\definefilesynonym [type-imp-mathdesignutopia.mkiv] [type-imp-mathdesign.mkiv]
-
-\definefilesynonym [type-imp-cows.mkiv] [type-imp-koeielettersot.mkiv]
-\definefilesynonym [type-imp-sheep.mkiv] [type-imp-koeielettersot.mkiv]
-\definefilesynonym [type-imp-coloredcows.mkiv] [type-imp-koeielettersot.mkiv]
-\definefilesynonym [type-imp-coloredsheep.mkiv] [type-imp-koeielettersot.mkiv]
-\definefilesynonym [type-imp-koeieletters.mkiv] [type-imp-koeielettersot.mkiv]
-
-\definefilesynonym [type-imp-stixtwo.mkiv] [type-imp-stix.mkiv]
-
-\definefilesynonym [type-imp-ibmplex.mkiv] [type-imp-plex.mkiv]
+\definefilesynonym [type-imp-modern.mkiv] [type-imp-latinmodern.mkiv]
+\definefilesynonym [type-imp-latin-modern.mkiv] [type-imp-latinmodern.mkiv]
+\definefilesynonym [type-imp-modern-latin.mkiv] [type-imp-modernlatin.mkiv]
+\definefilesynonym [type-imp-less-modern-latin.mkiv] [type-imp-modernlatin.mkiv]
+
+\definefilesynonym [type-imp-lucida-opentype.mkiv] [type-imp-lucida.mkiv]
+\definefilesynonym [type-imp-lucidaot.mkiv] [type-imp-lucida.mkiv]
+\definefilesynonym [type-imp-lucidadk.mkiv] [type-imp-lucida.mkiv]
+
+\definefilesynonym [type-imp-dejavu-condensed.mkiv] [type-imp-dejavu.mkiv]
+
+\definefilesynonym [type-imp-palatino.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-courier.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-avantgarde.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-helvetica.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-chancery.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-bookman.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-schoolbook.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-times.mkiv] [type-imp-texgyre.mkiv]
+
+\definefilesynonym [type-imp-cursor.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-adventor.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-heros.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-chorus.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-bonum.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-schola.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-pagella.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-termes.mkiv] [type-imp-texgyre.mkiv]
+
+\definefilesynonym [type-imp-mscoretimes.mkiv] [type-imp-mscore.mkiv]
+\definefilesynonym [type-imp-mscorearial.mkiv] [type-imp-mscore.mkiv]
+\definefilesynonym [type-imp-mscorecourier.mkiv] [type-imp-mscore.mkiv]
+\definefilesynonym [type-imp-mscoreverdana.mkiv] [type-imp-mscore.mkiv]
+
+\definefilesynonym [type-imp-candara.mkiv] [type-imp-cleartype.mkiv]
+\definefilesynonym [type-imp-consolas.mkiv] [type-imp-cleartype.mkiv]
+\definefilesynonym [type-imp-constantia.mkiv] [type-imp-cleartype.mkiv]
+\definefilesynonym [type-imp-corbel.mkiv] [type-imp-cleartype.mkiv]
+\definefilesynonym [type-imp-calibri.mkiv] [type-imp-cleartype.mkiv]
+
+%definefilesynonym [type-imp-mac.mkiv] [type-imp-osx.mkiv]
+%definefilesynonym [type-imp-win.mkiv] [type-imp-mscore.mkiv]
+
+\definefilesynonym [type-imp-eulernovum.mkiv] [type-imp-euler.mkiv]
+\definefilesynonym [type-imp-eulernova.mkiv] [type-imp-euler.mkiv]
+
+\definefilesynonym [type-imp-euler-with-pagella.mkiv] [type-imp-euler.mkiv]
+\definefilesynonym [type-imp-pagella-with-euler.mkiv] [type-imp-euler.mkiv]
+
+\definefilesynonym [type-imp-mdbch.mkiv] [type-imp-mathdesign.mkiv]
+\definefilesynonym [type-imp-mdugm.mkiv] [type-imp-mathdesign.mkiv]
+\definefilesynonym [type-imp-mdput.mkiv] [type-imp-mathdesign.mkiv]
+\definefilesynonym [type-imp-mdici.mkiv] [type-imp-mathdesign.mkiv]
+\definefilesynonym [type-imp-mdpgd.mkiv] [type-imp-mathdesign.mkiv]
+\definefilesynonym [type-imp-mdpus.mkiv] [type-imp-mathdesign.mkiv]
+
+\definefilesynonym [type-imp-mathdesignch.mkiv] [type-imp-mathdesign.mkiv]
+\definefilesynonym [type-imp-mathdesigngm.mkiv] [type-imp-mathdesign.mkiv]
+\definefilesynonym [type-imp-mathdesignut.mkiv] [type-imp-mathdesign.mkiv]
+\definefilesynonym [type-imp-mathdesignci.mkiv] [type-imp-mathdesign.mkiv]
+\definefilesynonym [type-imp-mathdesigngd.mkiv] [type-imp-mathdesign.mkiv]
+\definefilesynonym [type-imp-mathdesignus.mkiv] [type-imp-mathdesign.mkiv]
+
+\definefilesynonym [type-imp-mathdesigncharter.mkiv] [type-imp-mathdesign.mkiv]
+\definefilesynonym [type-imp-mathdesigngaramond.mkiv] [type-imp-mathdesign.mkiv]
+\definefilesynonym [type-imp-mathdesignutopia.mkiv] [type-imp-mathdesign.mkiv]
+
+\definefilesynonym [type-imp-cows.mkiv] [type-imp-koeielettersot.mkiv]
+\definefilesynonym [type-imp-sheep.mkiv] [type-imp-koeielettersot.mkiv]
+\definefilesynonym [type-imp-coloredcows.mkiv] [type-imp-koeielettersot.mkiv]
+\definefilesynonym [type-imp-coloredsheep.mkiv] [type-imp-koeielettersot.mkiv]
+\definefilesynonym [type-imp-koeieletters.mkiv] [type-imp-koeielettersot.mkiv]
+
+\definefilesynonym [type-imp-xits.mkiv] [type-imp-stix.mkiv]
+\definefilesynonym [type-imp-stixtwo.mkiv] [type-imp-stix.mkiv]
+
+\definefilesynonym [type-imp-ibmplex.mkiv] [type-imp-plex.mkiv]
+
+\definefilesynonym [type-imp-newcomputermodern-book.mkiv] [type-imp-newcomputermodern.mkiv]
+
+\definefilesynonym [type-imp-kpfonts-light.mkiv] [type-imp-kpfonts.mkiv]
+\definefilesynonym [type-imp-kpfonts-bold.mkiv] [type-imp-kpfonts.mkiv]
+\definefilesynonym [type-imp-kpfonts-sans.mkiv] [type-imp-kpfonts.mkiv]
+
+\definefilesynonym [type-imp-gentiumplus.mkiv] [type-imp-gentium.mkiv]
+\definefilesynonym [type-imp-gentiumbook.mkiv] [type-imp-gentium.mkiv]
+
+%D These \type {*-nt} variants come in handy when we want top compare with non-tweaked math.
+
+\definefilesynonym [type-imp-bonum-nt.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-schola-nt.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-pagella-nt.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-termes-nt.mkiv] [type-imp-texgyre.mkiv]
+\definefilesynonym [type-imp-dejavu-nt.mkiv] [type-imp-dejavu.mkiv]
+\definefilesynonym [type-imp-cambria-nt.mkiv] [type-imp-cambria.mkiv]
+\definefilesynonym [type-imp-lucidaot-nt.mkiv] [type-imp-lucida-opentype.mkiv]
+\definefilesynonym [type-imp-lucida-nt.mkiv] [type-imp-lucida-opentype.mkiv]
+\definefilesynonym [type-imp-modern-nt.mkiv] [type-imp-latinmodern.mkiv]
+\definefilesynonym [type-imp-stix-nt.mkiv] [type-imp-stix.mkiv]
+\definefilesynonym [type-imp-stixtwo-nt.mkiv] [type-imp-stix.mkiv]
+\definefilesynonym [type-imp-libertinus-nt.mkiv] [type-imp-libertinus.mkiv]
+\definefilesynonym [type-imp-ebgaramond-nt.mkiv] [type-imp-ebgaramond.mkiv]
+\definefilesynonym [type-imp-erewhon-nt.mkiv] [type-imp-erewhon.mkiv]
+\definefilesynonym [type-imp-kpfonts-nt.mkiv] [type-imp-kpfonts.mkiv]
+\definefilesynonym [type-imp-concrete-nt.mkiv] [type-imp-concrete.mkiv]
+\definefilesynonym [type-imp-xcharter-nt.mkiv] [type-imp-xcharter.mkiv]
+
+\definefilesynonym [type-imp-antykwa-poltawskiego.mkiv] [type-imp-antykwapoltawskiego.mkiv]
+
+\definefilesynonym [type-imp-iwona-light.mkiv] [type-imp-iwona.mkiv]
+\definefilesynonym [type-imp-iwona-medium.mkiv] [type-imp-iwona.mkiv]
+\definefilesynonym [type-imp-iwona-heavy.mkiv] [type-imp-iwona.mkiv]
+
+\definefilesynonym [type-imp-kurier-light.mkiv] [type-imp-kurier.mkiv]
+\definefilesynonym [type-imp-kurier-medium.mkiv] [type-imp-kurier.mkiv]
+\definefilesynonym [type-imp-kurier-heavy.mkiv] [type-imp-kurier.mkiv]
+
+\definefilesynonym [type-imp-antykwa-light.mkiv] [type-imp-antykwa.mkiv]
+\definefilesynonym [type-imp-antykwa-cond.mkiv] [type-imp-antykwa.mkiv]
+\definefilesynonym [type-imp-antykwa-lightcond.mkiv] [type-imp-antykwa.mkiv]
\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-ada.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-ada.lmt
new file mode 100644
index 00000000000..37393ca77f7
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-ada.lmt
@@ -0,0 +1,172 @@
+if not modules then modules = { } end modules ['typo-adj'] = {
+ version = 1.001,
+ optimize = true,
+ comment = "companion to typo-adj.mkxl",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local setdimen = tex.setdimen
+local isdimen = tex.isdimen
+local setmacro = tokens.setters.macro
+local expandmacro = token.expandmacro
+
+local nuts = nodes.nuts
+local getid = nuts.getid
+local getlist = nuts.getlist
+local getwhd = nuts.getwhd
+local getattr = nuts.getattr
+local getwidth = nuts.getwidth
+local setlist = nuts.setlist
+local setlink = nuts.setlink
+local setstate = nuts.setstate
+local setattr = nuts.setattr
+
+local hlist_code = nodes.nodecodes.hlist
+local vlist_code = nodes.nodecodes.vlist
+
+local getbox = nuts.getbox
+local takebox = nuts.takebox
+
+local new_kern = nuts.pool.kern
+
+local flattenleaders = nuts.flattenleaders
+local traverselist = nuts.traverselist
+local traverseleader = nuts.traverseleader
+
+local a_adaptive = attributes.private("adaptive")
+
+local registervalue = attributes.registervalue
+local getvalue = attributes.getvalue
+local hasvalues = attributes.hasvalues
+local texsetattribute = tex.setattribute
+
+local adaptive = nodes.adaptive or { }
+nodes.adaptive = adaptive
+local enabled = false
+
+local enableaction = nodes.tasks.enableaction
+
+local d_adaptive_width = isdimen("d_adaptive_width")
+local d_adaptive_height = isdimen("d_adaptive_height")
+local d_adaptive_depth = isdimen("d_adaptive_depth")
+local d_adaptive_line = isdimen("d_adaptive_line")
+
+function adaptive.set(settings)
+ if not enabled then
+ enableaction("vboxbuilders","nodes.adaptive.handlehorizontal")
+ enableaction("vboxhandlers","nodes.adaptive.handlevertical")
+ enabled = true
+ end
+ texsetattribute(a_adaptive,registervalue(a_adaptive,settings))
+end
+
+local function setadaptive(w,h,d,l,c)
+ setdimen(d_adaptive_width,w)
+ setdimen(d_adaptive_height,h)
+ setdimen(d_adaptive_depth,d)
+ setdimen(d_adaptive_line,l)
+ setmacro("m_adaptive_color",c)
+end
+
+local methods = {
+ -- overlay
+ [1] = function(settings,parent,list)
+ local setups = settings.setups
+ if setups and setups ~= "" then
+ local w, h, d = getwhd(parent)
+ setadaptive(w,h,d,settings.rulethickness,settings.color)
+ expandmacro("setup",true,setups)
+ local l = takebox("b_adaptive_box")
+ if l then
+ setlist(parent, setlink(l,new_kern(-getwidth(l)),list))
+ end
+ end
+ end
+}
+
+-- The hlist leaders get done before we enter vpacking, so that is where the
+-- first call kicks in. Then we do a vpack (so one can indeed also adapt the
+-- ht/dp). After packing we know the glue and do the vlist leaders.
+
+local function handlehorizontal(n)
+ if hasvalues(a_adaptive) then
+ for _, t, _, l in traverselist(n) do
+ if t == hlist_code then
+ for m, _, _, ll in traverseleader(l) do
+ local a = getattr(m,a_adaptive)
+ if a then
+ local settings = getvalue(a_adaptive,a)
+ if settings then
+ setstate(m,0)
+ local action = methods[settings.method or 1]
+ if action then
+ action(settings,m,ll)
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ return n
+end
+
+local function handlevertical(n)
+ if hasvalues(a_adaptive) then
+ -- not a list just a node
+ for nn, t, _, l in traverselist(n) do
+ if t == vlist_code then
+ for m, _, _, ll in traverseleader(l) do
+ local a = getattr(m,a_adaptive)
+ if a then
+ local settings = getvalue(a_adaptive,a)
+ if settings then
+ setstate(m,0)
+ local action = methods[settings.method or 1]
+ if action then
+ action(settings,m,ll)
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ return n
+end
+
+adaptive.handlehorizontal = handlehorizontal
+adaptive.handlevertical = handlevertical
+
+interfaces.implement {
+ name = "setadaptive",
+ actions = adaptive.set,
+ arguments = {
+ {
+ { "setups", "string" },
+ { "method", "integer" },
+ { "mp", "string" },
+ { "color", "string" },
+ { "rulethickness", "dimension" },
+ }
+ }
+}
+
+interfaces.implement {
+ name = "adaptivecheckbox",
+ arguments = "integer",
+ public = true,
+ protected = true,
+ actions = function(n)
+ local b = getbox(n)
+ if b and flattenleaders(b) > 0 then
+ if getid(b) == hlist_code then
+ handlehorizontal(b)
+ else
+ handlevertical(b)
+ end
+ end
+ end,
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-ada.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-ada.mkxl
new file mode 100644
index 00000000000..733b2ca5be0
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-ada.mkxl
@@ -0,0 +1,218 @@
+%D \module
+%D [ file=typo-ada,
+%D version=2022.04.04,
+%D title=\CONTEXT\ Typesetting Macros,
+%D subtitle=Adaptive,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%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 Typesetting Macros / Adaptive}
+
+% Musical timestamp: the postponed by COVID concert of Gazpacho in Zwolle NL: a joy
+% to see dedicated and talented musicians perform their work in perfection and as a
+% well balanced and equiped team.
+
+\unprotect
+
+\ifdefined\d_adaptive_width \else
+ \newdimension\d_adaptive_width
+ \newdimension\d_adaptive_height
+ \newdimension\d_adaptive_depth
+ \newdimension\d_adaptive_line
+ \newdimension\d_adaptive_hsize
+ \newbox \b_adaptive_box
+\fi
+
+\aliasdimension\usedadaptivewidth \d_adaptive_width
+\aliasdimension\usedadaptiveheight\d_adaptive_height
+\aliasdimension\usedadaptivedepth \d_adaptive_depth
+\aliasdimension\usedadaptiveline \d_adaptive_line
+\aliasdimension\usedadaptivehsize \d_adaptive_hsize
+
+\registerctxluafile{typo-ada}{autosuffix}
+
+\aliased\let\usedadaptivebox\b_adaptive_box
+
+\mutable\lettonothing\m_adaptive_color
+
+\protected\untraced\def\usedadaptivetotal{\dimexpr\usedadaptiveheight+\usedadaptivedepth\relax}
+
+\definesystemattribute[adaptive][public]
+
+\installcorenamespace{adaptive}
+
+\installcommandhandler \??adaptive {adaptive} \??adaptive
+
+% \appendtoks
+% %
+% \to \everydefineadaptive
+
+\setupadaptive
+ [\c!foregroundstyle=,
+ \c!foregroundcolor=,
+ \c!color=gray,
+ \c!rulethickness=\linewidth,
+ \c!method=1,
+ \c!stretch=,
+ \c!shrink=,
+ %\c!strut=\v!no,
+ \c!margin=2\emwidth]
+
+\permanent\protected\def\adaptivehbox{\typo_adaptive_box\zerocount}
+\permanent\protected\def\adaptivevbox{\typo_adaptive_box\plusone }
+
+\aliased\let\adaptivebox\adaptivehbox
+
+\tolerant\def\typo_adaptive_box#1#*[#2]#*[#3]%
+ {\ifcase#1\dontleavehmode\fi
+ \begingroup
+ \ifhastok={#2}%
+ \lettonothing\currentadaptive
+ \setupcurrentadaptive[#2]%
+ \else
+ \edef\currentadaptive{#2}%
+ \setupcurrentadaptive[#3]%
+ \fi
+ \edef\p_setups{\adaptiveparameter\c!setups}%
+ \dowithnextboxcontent
+ {\useadaptivestyleandcolor\c!foregroundstyle\c!foregroundcolor
+ \ifcstok{\adaptiveparameter\c!strut}\v!yes
+ \ifcase#1%
+ \strut
+ \else
+ % maybe \begstrut .. \endstrut
+ \fi
+ \fi}
+ {\ifempty\p_setups
+ % there is no need for postprocessing
+ \else
+ \clf_setadaptive {
+ method \adaptiveparameter\c!method
+ setups {\p_setups}%
+ color {\adaptiveparameter\c!color}%
+ rulethickness \adaptiveparameter\c!rulethickness
+ }%
+ \fi
+ \scratchdimen\adaptiveparameter\c!margin\relax
+ \edef\p_stretch{\adaptiveparameter\c!stretch}%
+ \edef\p_shrink {\adaptiveparameter\c!shrink}%
+ \uleaders
+ \ifcase#1%
+ \hbox
+ \s!spread \scratchdimen
+ \bgroup
+ \hss\box\nextbox\hss
+ \egroup
+ \hskip
+ \else
+ \vbox
+ \s!spread \scratchdimen
+ \bgroup
+ \vss\box\nextbox\vss
+ \egroup
+ \vskip
+ \fi
+ \zeropoint
+ \s!plus \ifempty\p_stretch\scratchdimen\else\p_stretch\fi
+ \s!minus \ifempty\p_shrink \scratchdimen\else\p_shrink \fi
+ \endgroup}%
+ \ifcase#1\hbox\else\vbox\fi}
+
+%D Here is a test case, expect more:
+%D
+%D \starttyping
+%D \startMPdefinitions
+%D def TickTock =
+%D interim linecap := squared;
+%D save p ; path p ; p := fullsquare xysized(AdaptiveWidth,.9(AdaptiveHeight+AdaptiveDepth)) ;
+%D fill p withcolor AdaptiveColor ;
+%D draw bottomboundary (p enlarged (-AdaptiveThickness) )
+%D withdashes (3*AdaptiveThickness)
+%D withpen pencircle scaled AdaptiveThickness
+%D withcolor white ;
+%D enddef ;
+%D \stopMPdefinitions
+%D
+%D \startsetups adaptive:test
+%D \setbox\usedadaptivebox\hbox to \usedadaptivewidth yoffset -.9\usedadaptivedepth \bgroup
+%D \hss
+%D \startMPcode
+%D TickTock ;
+%D \stopMPcode
+%D \hss
+%D \egroup
+%D \stopsetups
+%D
+%D \definecolor[adaptive:tick][.25(blue,green)]
+%D \definecolor[adaptive:tock][.75(blue,green)]
+%D
+%D \defineadaptive
+%D [tick]
+%D [setups=adaptive:test,
+%D color=adaptive:tick,
+%D foregroundcolor=white,
+%D foregroundstyle=\infofont,
+%D strut=yes]
+%D
+%D \defineadaptive
+%D [tock]
+%D [tick]
+%D [color=adaptive:tock]
+%D
+%D \dorecurse{5}{
+%D \dostepwiserecurse{1}{150}{1}{%
+%D this~#1.##1 is~#1.##1 test~#1.##1
+%D \ifodd##1\relax
+%D \adaptivebox[tick]{\hss tick #1.##1\hss}
+%D \else
+%D \adaptivebox[tock]{\hss tock #1.##1\hss}
+%D \fi
+%D }
+%D \blank
+%D }
+%D
+%D \setupexternalfigures
+%D [location={default,global}]
+%D
+%D \startsetups adaptive:test
+%D \setbox\usedadaptivebox\hbox to \usedadaptivewidth yoffset -\usedadaptivedepth \bgroup
+%D \externalfigure
+%D [cow.pdf]
+%D [width=\usedadaptivewidth,
+%D height=\dimexpr\usedadaptiveheight+\usedadaptivedepth\relax]%
+%D \egroup
+%D \stopsetups
+%D
+%D \dorecurse{5}{
+%D \dostepwiserecurse{1}{150}{1}{%
+%D this~#1.##1 is~#1.##1 test~#1.##1
+%D {\adaptivebox[strut=yes,setups=adaptive:test]{}}
+%D }
+%D \blank
+%D }
+%D
+%D \page
+%D
+%D \startsetups adaptive:test
+%D \setbox\usedadaptivebox\vbox to \usedadaptivetotal \bgroup
+%D \externalfigure
+%D [cow.pdf]
+%D [width=\usedadaptivewidth,
+%D height=\usedadaptivetotal]%
+%D \egroup
+%D \stopsetups
+%D
+%D \ruledvbox to \textheight {
+%D \par \begstrut \samplefile{tufte} \endstrut \par
+%D \adaptivevbox[strut=yes,setups=adaptive:test]{\hsize\textwidth\hss}
+%D \par \begstrut \samplefile{tufte} \endstrut
+%D }
+%D
+%D \stoptyping
+
+\protect
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-adj.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-adj.lmt
new file mode 100644
index 00000000000..d902187e3d4
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-adj.lmt
@@ -0,0 +1,93 @@
+if not modules then modules = { } end modules ['typo-adj'] = {
+ version = 1.001,
+ optimize = true,
+ comment = "companion to typo-adj.mkxl",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local nodecodes = nodes.nodecodes
+local hlist_code = nodecodes.hlist
+local penalty_code = nodecodes.penalty
+
+local nuts = nodes.nuts
+local getprev = nuts.getprev
+local getid = nuts.getid
+----- getattr = nuts.getattribute
+local getdepth = nuts.getdepth
+local newglue = nuts.pool.glue
+local insertafter = nuts.insertafter
+
+local texgetdimen = tex.getdimen
+
+----- a_adjuster = attributes.system("adjuster")
+
+local function correct_depth(head,tail)
+ local prev = getprev(tail)
+ if getid(prev) == penalty_code then -- linebreakpenalty
+ prev = getprev(prev)
+ end
+ if getid(prev) == hlist_code then -- line
+ local delta = getdepth(tail) - getdepth(prev)
+ if delta > 0 then
+ head = insertafter(head,prev,newglue(delta))
+ end
+ tex.prevdepth = getdepth(tail)
+ end
+ return head
+end
+
+local function block_baselineskip(head,tail)
+ -- tex.prevdepth = -1000 * 65536 -- ignoredepth
+ tex.prevdepth = texgetdimen("ignoredepthcriterium")
+ return head
+end
+
+local preactions = {
+ [1] = correct_depth,
+ [2] = block_baselineskip,
+}
+
+local postactions = {
+ [1] = correct_depth,
+ [2] = block_baselineskip,
+}
+
+-- function nodes.handlers.adjusters(head,where,tail)
+-- if where == "preadjust" then
+-- local a = getattr(tail,a_adjuster)
+-- if a then
+-- a = preactions[a]
+-- if a then
+-- head = a(head,tail)
+-- end
+-- end
+-- elseif where == "postadjust" then
+-- local a = getattr(tail,a_adjuster)
+-- if a then
+-- a = postactions[a]
+-- if a then
+-- head = a(head,tail)
+-- end
+-- end
+-- else
+-- -- can't happen
+-- end
+-- return head
+-- end
+
+function nodes.handlers.adjusters(head,where,tail,index)
+ if where == "preadjust" then
+ local a = preactions[index]
+ if a then
+ head = a(head,tail)
+ end
+ else -- if where == "postadjust" then
+ local a = postactions[index]
+ if a then
+ head = a(head,tail)
+ end
+ end
+ return head
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-adj.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-adj.mkxl
new file mode 100644
index 00000000000..5c129f07e35
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-adj.mkxl
@@ -0,0 +1,65 @@
+%D \module
+%D [ file=typo-adj,
+%D version=2021.11.02,
+%D title=\CONTEXT\ Typesetting Macros,
+%D subtitle=Adjusters,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+% This is preliminary (mostly test) code ... for it to be useful we also need to
+% add some spacing options as well as penalty control. So far I never needed this
+% but who knows.
+
+\writestatus{loading}{ConTeXt Typesetting Macros / Adjusters}
+
+\registerctxluafile{typo-adj}{autosuffix}
+
+% \definesystemattribute[adjuster][public]
+
+% Musical timestamp: the announcement of the new Porcupine Tree album: Closure /
+% Continuation and the related upcoming tour. They're back!
+
+\unprotect
+
+%D \starttyping
+%D \start \showboxes
+%D \dorecurse{20}{test #1 }
+%D \insertlinebefore{BEFORE 1}
+%D \insertlineafter {AFTER 1}
+%D \dorecurse{20}{test #1 }
+%D \dorecurse{20}{test #1 }
+%D \insertlinebefore{BEFORE 2}
+%D \insertlineafter {AFTER 2}
+%D \dorecurse{20}{test #1 }
+%D \stop
+%D \stoptyping
+
+\def\typo_adjusters_line#1% no need for speed
+ {\begingroup
+ \dowithnextbox
+ {\ht\nextbox\strutht
+ \dp\nextbox\strutdp
+ %\boxattribute\nextbox \adjusterattribute \plusone
+ \vadjust #1 index \plusone {\box\nextbox}%
+ \endgroup}%
+ \hbox}
+
+\tolerant\def\typo_adjusters_blank#1[#2]% no need for speed
+ {\begingroup
+ % \setbox\scratchbox\vbox{\ifcstok{#2}\emptytoks\blank\else\blank[#2]\fi}%
+ \setbox\scratchbox\vbox{\blank[#2]}%
+ \vadjust #1 index \plustwo {\vskip\htdp\scratchbox}%
+ \endgroup}
+
+\permanent\protected\def\insertlinebefore{\typo_adjusters_line{pre}}
+\permanent\protected\def\insertlineafter {\typo_adjusters_line{post}}
+
+\permanent\protected\def\insertblankbefore{\typo_adjusters_blank{pre}}
+\permanent\protected\def\insertblankafter {\typo_adjusters_blank{post}}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-bld.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-bld.lmt
index 599106ccd61..00ff9f26796 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-bld.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-bld.lmt
@@ -34,25 +34,23 @@ constructors.attribute = a_parbuilder
local unsetvalue = attributes.unsetvalue
local texsetattribute = tex.setattribute
local texnest = tex.nest
-local texlists = tex.lists
-
local texget = tex.get
local texset = tex.set
-local texgetdimen = tex.getdimen
+local getspeciallist = nodes.nuts.getspeciallist
+local setspeciallist = nodes.nuts.setspeciallist
local nodes = nodes
local nodeidstostring = nodes.idstostring
local nodepool = nodes.pool
local new_baselineskip = nodepool.baselineskip
local new_lineskip = nodepool.lineskip
-local insert_node_before = nodes.insert_before
+local insertnodebefore = nodes.insertbefore
local hpack_node = nodes.hpack
local nuts = nodes.nuts
local tonode = nodes.tonode
local tonut = nodes.tonut
-local count_nodes = nuts.countall
local getattr = nuts.getattr
local starttiming = statistics.starttiming
@@ -157,9 +155,9 @@ function parbuilders.constructors.methods.oneline(head,followed_by_display)
t.prevdepth = h.depth
t.prevgraf = 1
if d < texget("lineskiplimit") then
- return insert_node_before(h,h,new_lineskip(texget("lineskip",false))) -- no stretch etc
+ return insertnodebefore(h,h,new_lineskip(texget("lineskip",false))) -- no stretch etc
else
- return insert_node_before(h,h,new_baselineskip(d))
+ return insertnodebefore(h,h,new_baselineskip(d))
end
end
@@ -177,9 +175,7 @@ local function processor(head,followed_by_display)
-- todo: not again in otr so we need to flag
if enabled then
starttiming(parbuilders)
- head = tonut(head)
- head = actions(head,followed_by_display)
- head = tonode(head)
+ head = tonode(actions(tonut(head),followed_by_display))
stoptiming(parbuilders)
return head
else
@@ -190,7 +186,7 @@ end
function constructors.enable () enabled = true end
function constructors.disable() enabled = false end
-registercallback('linebreak_filter', processor, "breaking paragraps into lines")
+registercallback("linebreak_filter", processor, "breaking paragraps into lines")
statistics.register("linebreak processing time", function()
return statistics.elapsedseconds(parbuilders)
@@ -201,22 +197,13 @@ end)
nodes.builders = nodes.builder or { }
local builders = nodes.builders
-local vboxactions = nodes.tasks.actions("vboxbuilders")
+local vpackactions = nodes.tasks.actions("vboxbuilders")
function builders.vpack_filter(head,groupcode,size,packtype,maxdepth,direction)
local done = false
if head then
starttiming(builders)
- head = tonut(head)
- if trace_vbox_builder then
- local before = count_nodes(head)
- head, done = vboxactions(head,groupcode,size,packtype,maxdepth,direction)
- local after = count_nodes(head)
- nodes.processors.tracer("vpack",head,groupcode,before,after,done)
- else
- head, done = vboxactions(head,groupcode)
- end
- head = tonode(head)
+ head, done = vpackactions(head,groupcode)
stoptiming(builders)
end
return head, done
@@ -228,51 +215,50 @@ end
local pageactions = nodes.tasks.actions("mvlbuilders")
----- lineactions = nodes.tasks.actions("linebuilders")
-local function report(groupcode,head)
- report_page_builder("trigger: %s",groupcode)
+local function report(pagecontext,head)
+ report_page_builder("trigger: %s at level %i",pagecontext,texnest.ptr)
report_page_builder(" vsize : %p",texget("vsize"))
report_page_builder(" pagegoal : %p",texget("pagegoal"))
report_page_builder(" pagetotal: %p",texget("pagetotal"))
report_page_builder(" list : %s",head and nodeidstostring(head) or "<empty>")
end
--- check why box is called before after_linebreak .. maybe make categories and
--- call 'm less
-
--- this will be split into contribute_filter for these 4 so at some point
--- the check can go away
+-- Watch out: contributehead can be any head (kind of) not per se the page one
+-- but that needs to be intercepted when needed by groupcode and level. At some
+-- point this one might be split by group.
--- Todo: contrib_head can be any head (kind of) not per se the page one so maybe I will
--- intercept that in the engine with page_contribute_head or so.
-
-function builders.buildpage_filter(groupcode)
- local head = texlists.contribute_head
+function builders.buildpage_filter(pagecontext)
+ local head, tail = getspeciallist("contributehead")
if head then
- local done = false
- -- called quite often ... maybe time to remove timing
- starttiming(builders)
if trace_page_builder then
- report(groupcode,head)
+ report(pagecontext,head)
end
- head, done = pageactions(head,groupcode)
+ starttiming(builders)
+ head = pageactions(head,pagecontext) -- todo: tail
stoptiming(builders)
- -- -- doesn't work here (not passed on?)
- -- texset("pagegoal,texget("vsize") - texgetdimen("d_page_floats_inserted_top") - texgetdimen("d_page_floats_inserted_bottom")
- texlists.contribute_head = head or nil -- needs checking
- -- tex.setlist("contribute_head",head,head and nodes.tail(head))
- return done and head or true -- no return value needed
+ setspeciallist("contributehead", head)
else
- -- happens quite often
if trace_page_builder then
- report(groupcode)
+ report(pagecontext)
end
--- return nil, false -- no return value needed
- return nil
end
end
-registercallback('vpack_filter', builders.vpack_filter, "vertical spacing etc")
-registercallback('buildpage_filter', builders.buildpage_filter, "vertical spacing etc (mvl)")
+registercallback('vpack_filter', builders.vpack_filter, "vertical spacing etc")
+registercallback('buildpage_filter', builders.buildpage_filter, "vertical spacing etc (mvl)")
+
+local vboxactions = nodes.tasks.actions("vboxhandlers")
+
+function builders.vbox_filter(head,groupcode)
+ if head then
+ starttiming(builders)
+ head = vboxactions(head,groupcode)
+ stoptiming(builders)
+ end
+ return head
+end
+
+registercallback('packed_vbox_filter', builders.vbox_filter, "packed vbox treatments")
statistics.register("v-node processing time", function()
return statistics.elapsedseconds(builders)
@@ -368,7 +354,7 @@ local function hpack_quality(how,detail,n,first,last,filename)
setcolor(rule,"cyan")
end
rule = hpack(rule)
- setwidth(rule,0)
+ setwidth(rule,0) -- maybe better whd all zero
setdirection(rule,direction)
return tonode(rule) -- can be a nut
end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-bld.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-bld.mkxl
index ff1f569cb86..a84b0ef2cca 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-bld.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-bld.mkxl
@@ -33,6 +33,28 @@
% \dorecurse{100}{\input ward \par}
% \stopparbuilder
+% \startluacode
+% function builders.paragraphs.constructors.methods.preroll_a(head)
+% local result, info = tex.linebreak(head)
+% tex.prevdepth = info.prevdepth
+% tex.prevgraf = info.prevgraf
+% return result
+% end
+% function builders.paragraphs.constructors.methods.preroll_b(head)
+% local result, info = tex.linebreak(nodes.nuts.copylist(head))
+% return true
+% end
+% \stopluacode
+%
+% \defineparbuilder[preroll_a]
+% \defineparbuilder[preroll_b]
+%
+% \starttext
+% \setmainparbuilder[default] \input tufte \par \input tufte \page
+% \setmainparbuilder[preroll_a] \input tufte \par \input tufte \page
+% \setmainparbuilder[preroll_b] \input tufte \par \input tufte \page
+% \stoptext
+
\unprotect
\registerctxluafile{typo-bld}{autosuffix}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-brk.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-brk.lmt
index 8d2fcd147b7..3a7b69db9bc 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-brk.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-brk.lmt
@@ -45,15 +45,15 @@ local setprev = nuts.setprev
local setboth = nuts.setboth
local setsubtype = nuts.setsubtype
-local copy_node = nuts.copy_node
-local copy_node_list = nuts.copy_list
-local flush_node = nuts.flush_node
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local copy_node = nuts.copy
+local copy_node_list = nuts.copylist
+local flushnode = nuts.flushnode
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local remove_node = nuts.remove
-local end_of_math = nuts.end_of_math
-local find_attribute = nuts.find_attribute
-local unset_attributes = nuts.unset_attributes
+local endofmath = nuts.endofmath
+local findattribute = nuts.findattribute
+local unsetattributes = nuts.unsetattributes
local tonodes = nuts.tonodes
@@ -117,15 +117,15 @@ local function insert_break(head,start,stop,before,after,kern)
local g = new_glue()
setattrlist(p,start)
setattrlist(g,start)
- insert_node_before(head,start,p)
- insert_node_before(head,start,g)
+ insertnodebefore(head,start,p)
+ insertnodebefore(head,start,g)
end
local p = new_penalty(after)
local g = new_glue()
setattrlist(p,start)
setattrlist(g,start)
- insert_node_after(head,stop,g)
- insert_node_after(head,stop,p)
+ insertnodeafter(head,stop,g)
+ insertnodeafter(head,stop,p)
end
methods[1] = function(head,start,stop,settings,kern)
@@ -143,6 +143,7 @@ methods[6] = function(head,start,stop,settings,kern)
if kern then
insert_break(head,start,stop,10000,0,kern)
else
+ -- replace this
local l = new_wordboundary()
local d = new_disc()
local r = new_wordboundary()
@@ -171,7 +172,7 @@ methods[2] = function(head,start) -- ( => (-
local hyphen = copy_node(post)
setchar(hyphen,languages.prehyphenchar(getlanguage(post)))
setlink(post,hyphen)
- head, start = insert_node_before(head,start,new_disc(nil,post,replace))
+ head, start = insertnodebefore(head,start,new_disc(nil,post,replace))
setattrlist(start,replace)
insert_break(head,start,start,10000,10000)
end
@@ -187,7 +188,7 @@ methods[3] = function(head,start) -- ) => -)
local hyphen = copy_node(pre)
setchar(hyphen,languages.prehyphenchar(getlanguage(pre)))
setlink(hyphen,pre)
- head, start = insert_node_before(head,start,new_disc(hyphen,nil,replace)) -- so not pre !
+ head, start = insertnodebefore(head,start,new_disc(hyphen,nil,replace)) -- so not pre !
setattrlist(start,tmp)
insert_break(head,start,start,10000,10000)
end
@@ -199,7 +200,7 @@ methods[4] = function(head,start) -- - => - - -
if p and n then
local tmp
head, start, tmp = remove_node(head,start)
- head, start = insert_node_before(head,start,new_disc())
+ head, start = insertnodebefore(head,start,new_disc())
setattrlist(start,tmp)
setdisc(start,copy_node(tmp),copy_node(tmp),tmp)
insert_break(head,start,start,10000,10000)
@@ -212,7 +213,7 @@ methods[5] = function(head,start,stop,settings) -- x => p q r
if p and n then
local tmp
head, start, tmp = remove_node(head,start)
- head, start = insert_node_before(head,start,new_disc())
+ head, start = insertnodebefore(head,start,new_disc())
local attr = getattrlist(tmp)
local font = getfont(tmp)
local left = settings.left
@@ -229,7 +230,7 @@ methods[5] = function(head,start,stop,settings) -- x => p q r
end
setdisc(start,left,right,middle)
setattrlist(start,attr)
- flush_node(tmp)
+ flushnode(tmp)
insert_break(head,start,start,10000,10000)
end
return head, start
@@ -240,7 +241,7 @@ end
-- do we need to go into disc nodes (or do it as first step but then we need a pre/post font handler)
function breakpoints.handler(head)
- local _, current = find_attribute(head, a_breakpoints)
+ local _, current = findattribute(head, a_breakpoints)
if current then
local done = false
local attr = nil
@@ -303,7 +304,7 @@ function breakpoints.handler(head)
end
elseif id == math_code then
attr = nil
- current = end_of_math(current)
+ current = endofmath(current)
if current then
current = getnext(current)
end
@@ -396,9 +397,6 @@ function breakpoints.handler(head)
-- end
end
end
- if done then
--- unset_attributes(a_breakpoints, head)
- end
end
return head
end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-brk.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-brk.mkxl
index 47e5da886e2..0988e3a6b75 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-brk.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-brk.mkxl
@@ -53,11 +53,11 @@
\endgroup}
\permanent\protected\def\setbreakpoints[#1]%
- {\exhyphenchar\minusone % we use a different order than base tex, so we really need this
+ {%\exhyphenchar\minusone % we now use collapsing so ...
\clf_setbreakpoints{#1}}
\permanent\protected\def\resetbreakpoints
- {\exhyphenchar\hyphenasciicode % 2020.03.05
+ {%\exhyphenchar\hyphenasciicode % 2020.03.05 / we now use collapsing so ...
\c_attr_breakpoint\attributeunsetvalue}
\definebreakpoints[compound]
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-cap.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-cap.lmt
index 67acb2535c3..c0e19757647 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-cap.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-cap.lmt
@@ -19,96 +19,81 @@ local report_casing = logs.reporter("typesetting","casing")
local nodes, node = nodes, node
-local nuts = nodes.nuts
+local nuts = nodes.nuts
-local getnext = nuts.getnext
-local getid = nuts.getid
-local getattr = nuts.getattr
-local getfont = nuts.getfont
-local getsubtype = nuts.getsubtype
-local getchar = nuts.getchar
-local isglyph = nuts.isglyph
-local getdisc = nuts.getdisc
+local getnext = nuts.getnext
+local getid = nuts.getid
+local getattr = nuts.getattr
+local getcharspec = nuts.getcharspec
+local getsubtype = nuts.getsubtype
+local getchar = nuts.getchar
+local isglyph = nuts.isglyph
+local getdisc = nuts.getdisc
-local setchar = nuts.setchar
-local setfont = nuts.setfont
-local setscales = nuts.setscales
+local setchar = nuts.setchar
+local setfont = nuts.setfont
+local setscales = nuts.setscales
-local copy_node = nuts.copy
-local end_of_math = nuts.end_of_math
-local insert_after = nuts.insert_after
-local find_attribute = nuts.find_attribute
-local unset_attributes = nuts.unset_attributes
+local copy_node = nuts.copy
+local endofmath = nuts.endofmath
+local insertafter = nuts.insertafter
+local findattribute = nuts.findattribute
+----- unsetattributes = nuts.unsetattributes
-local nextglyph = nuts.traversers.glyph
+local nextglyph = nuts.traversers.glyph
-local nodecodes = nodes.nodecodes
-local kerncodes = nodes.kerncodes
+local nodecodes = nodes.nodecodes
+local kerncodes = nodes.kerncodes
-local glyph_code = nodecodes.glyph
-local kern_code = nodecodes.kern
-local disc_code = nodecodes.disc
-local math_code = nodecodes.math
+local glyph_code = nodecodes.glyph
+local kern_code = nodecodes.kern
+local disc_code = nodecodes.disc
+local math_code = nodecodes.math
-local fontkern_code = kerncodes.fontkern
+local fontkern_code = kerncodes.fontkern
-local enableaction = nodes.tasks.enableaction
+local enableaction = nodes.tasks.enableaction
-local newkern = nuts.pool.kern
+local newkern = nuts.pool.kern
-local fonthashes = fonts.hashes
-local fontdata = fonthashes.identifiers
-local fontchar = fonthashes.characters
+local fonthashes = fonts.hashes
+local fontdata = fonthashes.identifiers
+local fontchar = fonthashes.characters
-local currentfont = font.current
+local currentfont = font.current
-local variables = interfaces.variables
-local v_reset = variables.reset
+local variables = interfaces.variables
+local v_reset = variables.reset
-local texsetattribute = tex.setattribute
-local unsetvalue = attributes.unsetvalue
-local texgetcount = tex.getcount
+local texsetattribute = tex.setattribute
+local texgetscales = tex.getglyphscales
-typesetters = typesetters or { }
-local typesetters = typesetters
+typesetters = typesetters or { }
+local typesetters = typesetters
-typesetters.cases = typesetters.cases or { }
-local cases = typesetters.cases
+typesetters.cases = typesetters.cases or { }
+local cases = typesetters.cases
-cases.actions = { }
-local actions = cases.actions
-local a_cases = attributes.private("case")
+cases.actions = { }
+local actions = cases.actions
+local a_cases = attributes.private("case")
-local run = 0 -- a trick to make neighbouring ranges work
-local blocked = { }
+local run = 0 -- a trick to make neighbouring ranges work
-local fontstate = { } -- this will become something generic
+local registervalue = attributes.registervalue
+local getvalue = attributes.getvalue
+local texsetattribute = tex.setattribute
local function set(tag,font)
- if run < 0x7F then
- run = run + 1
- else
- run = 1
- end
- local a = (font << 16)
- + (tag << 8)
- + (run << 0)
- blocked[a] = false
- -- it makes sense to fetch them all at once
- fontstate[a] = {
- texgetcount("glyphscale"),
- texgetcount("glyphxscale"),
- texgetcount("glyphyscale"),
- texgetcount("glyphdatafield")
+ run = run + 1
+ local settings = {
+ font = font,
+ tag = tag,
+ run = run, -- still needed ?
+ -- blocked = false
+ scales = { texgetscales() },
}
- return a
-end
-
-local function get(a)
- return
- (a >> 8) & 0x00FF, -- tag
- (a >> 16) & 0xFFFF, -- font
- (a >> 0) & 0x00FF -- run
+ texsetattribute(a_cases,registervalue(a_cases,settings))
end
-- a previous implementation used char(0) as placeholder for the larger font, so we needed
@@ -145,7 +130,7 @@ local function replacer(start,codes)
else
local g = copy_node(start)
setchar(g,chr)
- insert_after(start,start,g)
+ insertafter(start,start,g)
end
end
elseif ifc[dc] then
@@ -172,17 +157,17 @@ end
cases.register = register
-local function WORD(start,attr,lastfont,n,count,where,first)
+local function WORD(start,data,lastfont,n,count,where,first)
lastfont[n] = false
return replacer(first or start,uccodes)
end
-local function word(start,attr,lastfont,n,count,where,first)
+local function word(start,data,lastfont,n,count,where,first)
lastfont[n] = false
return replacer(first or start,lccodes)
end
-local function Words(start,attr,lastfont,n,count,where,first) -- looks quite complex
+local function Words(start,data,lastfont,n,count,where,first) -- looks quite complex
if where == "post" then
return
end
@@ -194,18 +179,18 @@ local function Words(start,attr,lastfont,n,count,where,first) -- looks quite com
end
end
-local function Word(start,attr,lastfont,n,count,where,first)
- blocked[attr] = true
- return Words(start,attr,lastfont,n,count,where,first)
+local function Word(start,data,lastfont,n,count,where,first)
+ data.blocked = true
+ return Words(start,data,lastfont,n,count,where,first)
end
-local function camel(start,attr,lastfont,n,count,where,first)
- word(start,attr,lastfont,n,count,where,first)
- Words(start,attr,lastfont,n,count,where,first)
+local function camel(start,data,lastfont,n,count,where,first)
+ word(start,data,lastfont,n,count,where,first)
+ Words(start,data,lastfont,n,count,where,first)
return start, true
end
-local function mixed(start,attr,lastfont,n,count,where,first)
+local function mixed(start,data,lastfont,n,count,where,first)
if where == "post" then
return
end
@@ -217,10 +202,10 @@ local function mixed(start,attr,lastfont,n,count,where,first)
elseif dc == char then
local lfa = lastfont[n]
if lfa then
- local s = fontstate[attr]
+ local s = data.scales
setfont(used,lfa)
if s then
- setscales(used, s[1], s[2], s[3])
+ setscales(used,s[1],s[2],s[3])
end
end
else
@@ -229,17 +214,17 @@ local function mixed(start,attr,lastfont,n,count,where,first)
return start, true
end
-local function Capital(start,attr,lastfont,n,count,where,first,once) -- 3
+local function Capital(start,data,lastfont,n,count,where,first,once) -- 3
local used = first or start
if count == 1 and where ~= "post" then
local lfa = lastfont[n]
if lfa then
local dc = uccodes[getchar(used)]
if dc then
- local s = fontstate[attr]
+ local s = data.scales
setfont(used,lfa)
if s then
- setscales(used, s[1], s[2], s[3])
+ setscales(used,s[1],s[2],s[3])
end
end
end
@@ -251,18 +236,18 @@ local function Capital(start,attr,lastfont,n,count,where,first,once) -- 3
return start, c
end
-local function capital(start,attr,lastfont,n,where,count,first,count) -- 4
- return Capital(start,attr,lastfont,n,where,count,first,true)
+local function capital(start,data,lastfont,n,where,count,first,count) -- 4
+ return Capital(start,data,lastfont,n,where,count,first,true)
end
-local function none(start,attr,lastfont,n,count,where,first)
+local function none(start,data,lastfont,n,count,where,first)
return start, true
end
-local function randomized(start,attr,lastfont,n,count,where,first)
+local function randomized(start,data,lastfont,n,count,where,first)
local used = first or start
- local char = getchar(used)
- local font = getfont(used)
+ local char,
+ font = getcharfont(used)
local tfm = fontchar[font]
lastfont[n] = false
local kind = categories[char]
@@ -301,93 +286,96 @@ register(variables.cap, variables.capital) -- clone
register(variables.Cap, variables.Capital) -- clone
function cases.handler(head)
- local _, start = find_attribute(head, a_cases)
+ local _, start = findattribute(head,a_cases)
if start then
local lastfont = { }
local lastattr = nil
local count = 0
- local done = false
while start do -- while because start can jump ahead
local id = getid(start)
if id == glyph_code then
local attr = getattr(start,a_cases)
- if attr and attr > 0 and not blocked[attr] then
- if attr ~= lastattr then
- lastattr = attr
- count = 1
- else
- count = count + 1
- end
- local n, id, m = get(attr)
- if lastfont[n] == nil then
- lastfont[n] = id
- end
- local action = actions[n] -- map back to low number
- if action then
- local quit
- start, quit = action(start,attr,lastfont,n,count)
- if trace_casing then
- report_casing("case trigger %a, instance %a, fontid %a, result %a",n,m,id,quit and "-" or "+")
+ if attr and attr > 0 then
+ local data = getvalue(a_cases,attr)
+ if data and not data.blocked then
+ if attr ~= lastattr then
+ lastattr = attr
+ count = 1
+ else
+ count = count + 1
+ end
+ local tag = data.tag
+ local font = data.font
+ local run = data.run
+ local action = actions[tag] -- map back to low number
+ lastfont[tag] = font
+ if action then
+ local quit
+ start, quit = action(start,data,lastfont,tag,count)
+ if trace_casing then
+ report_casing("case trigger %a, instance %a, fontid %a, result %a",
+ tag,run,font,quit and "-" or "+")
+ end
+ elseif trace_casing then
+ report_casing("unknown case trigger %a",tag)
end
- elseif trace_casing then
- report_casing("unknown case trigger %a",n)
end
- done = true
end
elseif id == disc_code then
local attr = getattr(start,a_cases)
- if attr and attr > 0 and not blocked[attr] then
- if attr ~= lastattr then
- lastattr = attr
- count = 0
- end
- local n, id, m = get(attr)
- if lastfont[n] == nil then
- lastfont[n] = id
- end
- local action = actions[n] -- map back to low number
- if action then
- local pre, post, replace = getdisc(start)
- if replace then
- local cnt = count
- for g in nextglyph, replace do
- cnt = cnt + 1
- getattr(g,a_cases)
- local h, quit = action(start,attr,lastfont,n,cnt,"replace",g)
- if quit then
- break
+ if attr and attr > 0 then
+ local data = getvalue(a_cases,attr)
+ if data and not data.blocked then
+ if attr ~= lastattr then
+ lastattr = attr
+ count = 0
+ end
+ local tag = data.tag
+ local font = data.font
+ local action = actions[tag] -- map back to low number
+ lastfont[tag] = font
+ if action then
+ local pre, post, replace = getdisc(start)
+ if replace then
+ local cnt = count
+ for g in nextglyph, replace do
+ cnt = cnt + 1
+ getattr(g,a_cases)
+ local h, quit = action(start,data,lastfont,tag,cnt,"replace",g)
+ if quit then
+ break
+ end
end
end
- end
- if pre then
- local cnt = count
- for g in nextglyph, pre do
- cnt = cnt + 1
- getattr(g,a_cases)
- local h, quit = action(start,attr,lastfont,n,cnt,"pre",g)
- if quit then
- break
+ if pre then
+ local cnt = count
+ for g in nextglyph, pre do
+ cnt = cnt + 1
+ getattr(g,a_cases)
+ local h, quit = action(start,data,lastfont,tag,cnt,"pre",g)
+ if quit then
+ break
+ end
end
end
- end
- if post then
- local cnt = count
- for g in nextglyph, post do
- cnt = cnt + 1
- getattr(g,a_cases)
- local h, quit = action(start,attr,lastfont,n,cnt,"post",g)
- if quit then
- break
+ if post then
+ local cnt = count
+ for g in nextglyph, post do
+ cnt = cnt + 1
+ getattr(g,a_cases)
+ local h, quit = action(start,data,lastfont,tag,cnt,"post",g)
+ if quit then
+ break
+ end
end
end
end
+ count = count + 1
end
- count = count + 1
- done = true
end
else
if id == math_code then
- start = end_of_math(start)
+ start = endofmath(start)
end
count = 0
end
@@ -395,9 +383,6 @@ function cases.handler(head)
start = getnext(start)
end
end
- if done then
- -- unset_attributes(a_cases,head)
- end
end
return head
end
@@ -405,9 +390,7 @@ end
local enabled = false
function cases.set(n,id)
- if n == v_reset then
- n = unsetvalue
- else
+ if n ~= v_reset then
n = registered[n] or tonumber(n)
if n then
if not enabled then
@@ -417,13 +400,11 @@ function cases.set(n,id)
end
enabled = true
end
- n = set(n,id or currentfont())
- else
- n = unsetvalue
+ set(n,id or currentfont())
+ return
end
end
- texsetattribute(a_cases,n)
- -- return n -- bonus
+ texsetattribute(a_cases)
end
-- interface
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-cap.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-cap.mkxl
index bab69e130e7..0a6867a4365 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-cap.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-cap.mkxl
@@ -18,7 +18,6 @@
%D Maybe we need a more clever system: either command or style mode etc. so
%D that we can avoid the grouped mess in a simple style switch.
-% \registerctxluafile{typo-cap}{autosuffix,optimize}
\registerctxluafile{typo-cap}{autosuffix}
% \definesystemattribute[case][public] % already predefined
@@ -74,7 +73,10 @@
% test \word{test TEST \TeX} test
% test \Word{test TEST \TeX} test
-\permanent\protected\def\setcharactercasing[#1]{\clf_setcharactercasing{#1}} % can be public implementor
+\permanent\tolerant\protected\def\setcharactercasing[#1]{\clf_setcharactercasing{#1}} % can be public implementor
+
+\protected\def\casing[#1]{\groupedcommand{\clf_setcharactercasing{#1}}{}}
+\protected\def\nocasing {\groupedcommand{\clf_setcharactercasing {}}{}}
\protected\def\typo_capitale_WORD {\clf_setcharactercasing\v!WORD }
\protected\def\typo_capitale_word {\clf_setcharactercasing\v!word }
@@ -163,7 +165,7 @@
\def\typo_capitals_set_real#1%
{\edef\currentcapitals{#1}%
- \sc
+ \sc % \smallcaps
\clf_setcharactercasing\currentcapitals}
\permanent\protected\def\pseudosmallcapped{\triggergroupedcommandcs\font_style_pseudosmallcapped}
@@ -251,6 +253,8 @@
\definefont
[MixedCaps]
[CurrentFont*default cp 1.2\exheight]
+% [CurrentFont*default at 1.5\exheight] % better adaptation to slanted but still not nice
+% [CurrentFont*default ht 1.2\exheight] % maybe this is better indeed
\setupcapitals
[\v!mixed]
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-chr.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-chr.lmt
index bb11f54a64c..56218440fd2 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-chr.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-chr.lmt
@@ -27,11 +27,11 @@ local wordboundary_code = boundarycodes.word
local texgetnest = tex.getnest -- to be used
local texsetcount = tex.setcount
-local flush_node = nodes.flush_node
-local flush_list = nodes.flush_list
+local flushnode = nodes.flushnode
+local flushlist = nodes.flushlist
local settexattribute = tex.setattribute
-local punctuation = characters.is_punctuation
+local ispunctuation = characters.is_punctuation
local variables = interfaces.variables
local v_all = variables.all
@@ -51,7 +51,7 @@ local function pickup()
local list = texgetnest()
if list then
local tail = list.tail
- if tail and tail.id == glyph_code and punctuation[tail.char] then
+ if tail and tail.id == glyph_code and ispunctuation[tail.char] then
local prev = tail.prev
list.tail = prev
if prev then
@@ -68,7 +68,7 @@ local actions = {
remove = function(specification)
local n = pickup()
if n then
- flush_node(n)
+ flushnode(n)
end
end,
push = function(specification)
@@ -103,7 +103,7 @@ local function pickup(head,tail,str)
while true do
local prev = first.prev
if prev and prev[a_marked] == attr then
- if prev.id == par_code then -- and start_of_par(prev)
+ if prev.id == par_code then -- and startofpar(prev)
break
else
first = prev
@@ -140,7 +140,7 @@ local actions = {
list.tail = prev
prev.next = nil
end
- flush_list(first)
+ flushlist(first)
end
end
end,
@@ -228,6 +228,8 @@ interfaces.implement {
-- not needed in lmtx ...
+local c_syst_last_node_id = tex.iscount("c_syst_last_node_id")
+
interfaces.implement {
name = "lastnodeid",
actions = function()
@@ -239,7 +241,7 @@ interfaces.implement {
okay = tail.id
end
end
- texsetcount("c_syst_last_node_id",okay)
+ texsetcount(c_syst_last_node_id,okay)
end,
}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-chr.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-chr.mkxl
index 1c459cfcf35..ad531480122 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-chr.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-chr.mkxl
@@ -33,6 +33,8 @@
%D for instance when combining bit and pieces where keeping a state is complex compared
%D to cleaning up unwanted stuff.
+\newinteger\c_syst_last_node_id
+
\registerctxluafile{typo-chr}{autosuffix}
\definesystemattribute[marked][public]
@@ -78,8 +80,6 @@
%D test test\number\lastnodeid test
%D \stoptyping
-\newcount\c_syst_last_node_id
-
\permanent\protected\def\doifelselastnode {\clf_lastnodeequals} % can be public implementors
\permanent\protected\def\doifelseatwordboundary{\clf_atwordboundary} % can be public implementors
\permanent\protected\def\lastnodeid {\clf_lastnodeid\c_syst_last_node_id} % can be public implementors
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-del.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-del.mkxl
index 8e17ea82b3f..08d0a9b09a1 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-del.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-del.mkxl
@@ -28,11 +28,11 @@
{\getdummyparameters[#1]%
\expandnamespaceparameter\??hyphenmarksign\dummyparameter\c!sign\v!normal}
-\setvalue{\??hyphenmarksign\v!normal}%
+\defcsname\??hyphenmarksign\v!normal\endcsname
{\enforced\let\textmodehyphen\normalhyphen
\enforced\let\textmodehyphendiscretionary\normalhyphendiscretionary}
-\setvalue{\??hyphenmarksign\v!wide}%
+\defcsname\??hyphenmarksign\v!wide\endcsname
{\enforced\let\textmodehyphen\composedhyphen
\enforced\let\textmodehyphendiscretionary\composedhyphendiscretionary}
@@ -142,8 +142,7 @@
[\c!rightsubsentence]
[\rightboundarycharacter\c!rightsubsentence{sentence}]
-\newsignal\d_typo_subsentence_signal
-\newcount \c_typo_subsentence_nesting
+\newinteger\c_typo_subsentence_nesting
\mutable\let\beforesubsentence\donothing % maybe just a parameter
\mutable\let\aftersubsentence \donothing % maybe just a parameter
@@ -171,13 +170,15 @@
\symbol[\c!midsentence]%
\dostoptagged}
+\newboundary\c_typo_subsentence_boundary
+
\permanent\protected\def\beginofsubsentence
{\beforesubsentence
- \ifdim\lastkern=\d_typo_subsentence_signal
- \unskip
+ \ifnum\lastboundary=\c_typo_subsentence_boundary
+ \unboundary
\kern\hspaceamount\currentusedlanguage{intersentence}%
\fi
- \global\advance\c_typo_subsentence_nesting\plusone
+ \global\advanceby\c_typo_subsentence_nesting\plusone
\ifnum\c_typo_subsentence_nesting=\plusone
\dontleavehmode
\fi
@@ -197,17 +198,17 @@
\symbol[\ifodd\c_typo_subsentence_nesting\c!rightsentence\else\c!rightsubsentence\fi]%
\dostoptagged
\dostoptagged
- \global\advance\c_typo_subsentence_nesting\minusone
+ \global\advanceby\c_typo_subsentence_nesting\minusone
\unskip
- \kern\d_typo_subsentence_signal\relax
+ \boundary\c_typo_subsentence_boundary
\aftersubsentence}
\permanent\protected\def\beginofsubsentencespacing % relax prevents space gobbling
- {\kern\d_typo_subsentence_signal\relax}% \ignorespaces}
+ {\boundary\c_typo_subsentence_boundary}% \ignorespaces}
\permanent\protected\def\endofsubsentencespacing
- {\ifdim\lastkern=\d_typo_subsentence_signal
- \unskip
+ {\ifnum\lastboundary=\c_typo_subsentence_boundary
+ \unboundary
\hskip\hspaceamount\currentusedlanguage{intersentence}%
% no good, actually language dependent:
% \ignorespaces
@@ -286,8 +287,6 @@
%D could be build on top of it. The speech opening and closing symbols are defined
%D per language. Italian is an example of a language that has them set.
-\newsignal\d_typo_delimited_signal
-
\mutable\let\currentdelimitedtext \s!unknown
\mutable\let\currentparentdelimitedtext\currentdelimitedtext
@@ -315,9 +314,9 @@
%D \NC [fr:en] \NC {\tttf fr} \quotation[fr:en]{{\tttf <en=\currentlanguage>} something french} \NC \NR
%D \stoptabulate
-\mutable\let\currentdelimitedlanguage\empty
-\mutable\let\innerdelimitedlanguage \empty
-\mutable\let\outerdelimitedlanguage \empty
+\mutable\lettonothing\currentdelimitedlanguage
+\mutable\lettonothing\innerdelimitedlanguage
+\mutable\lettonothing\outerdelimitedlanguage
\installglobalmacrostack\currentdelimitedlanguage
@@ -345,11 +344,11 @@
{\let\currentdelimitedlanguage\innerdelimitedlanguage}%
\donothing
\fi
- \let\m_delimited_argument\empty}
+ \lettonothing\m_delimited_argument}
\def\typo_delimited_set_language_yes_a
{\let\currentdelimitedlanguage\m_delimited_argument
- \let\m_delimited_argument\empty}
+ \lettonothing\m_delimited_argument}
\def\typo_delimited_push#1#2%
{\push_macro_currentdelimitedtext % can we combine these two
@@ -362,13 +361,13 @@
\typo_delimited_set_language_yes
\fi
\let\currentparentdelimitedtext\currentdelimitedtext
- \global\advance\c_typo_delimited_nesting\plusone
+ \global\advanceby\c_typo_delimited_nesting\plusone
\edef\delimitedtextlevel{\number\c_typo_delimited_nesting}%
\normalexpanded{\chaintocurrentdelimitedtext{\currentparentdelimitedtext:\delimitedtextlevel}}%
\edef\currentdelimitedtext{\currentparentdelimitedtext:\delimitedtextlevel}}
\def\typo_delimited_pop
- {\global\advance\c_typo_delimited_nesting\minusone
+ {\global\advanceby\c_typo_delimited_nesting\minusone
\pop_macro_currentdelimitedlanguage
\pop_macro_currentdelimitedtext}
@@ -378,10 +377,10 @@
\installcommandhandler \??delimitedtext {delimitedtext} \??delimitedtext
\appendtoks
- \expandafter\newcount\csname\??delimitedtextlevel\currentdelimitedtext\endcsname
- \frozen\instance\setuevalue{\currentdelimitedtext }{\delimitedtext[\currentdelimitedtext]}%
- \frozen\instance\setuevalue{\e!start\currentdelimitedtext}{\startdelimitedtext[\currentdelimitedtext]}%
- \frozen\instance\setuevalue{\e!stop \currentdelimitedtext}{\stopdelimitedtext}%
+ \expandafter\newinteger\csname\??delimitedtextlevel\currentdelimitedtext\endcsname
+ \frozen\instance\protected\edefcsname\currentdelimitedtext \endcsname{\delimitedtext[\currentdelimitedtext]}%
+ \frozen\instance\protected\edefcsname\e!start\currentdelimitedtext\endcsname{\startdelimitedtext[\currentdelimitedtext]}%
+ \frozen\instance\protected\edefcsname\e!stop \currentdelimitedtext\endcsname{\stopdelimitedtext}%
\to \everydefinedelimitedtext
\setupdelimitedtext
@@ -407,7 +406,7 @@
\typo_delimited_handle_middle\c!middle
\fi}
-\let\typo_delimited_repeat\relax
+\lettonothing\typo_delimited_repeat
\permanent\tolerant\protected\def\startdelimitedtext[#1]#*[#2]%
{\begingroup
@@ -416,6 +415,8 @@
\edef\p_delimited_method{\delimitedtextparameter\c!method}%
\ifx\p_delimited_method\v!font
\expandafter\typo_delimited_start_font
+ \orelse\ifx\p_delimited_method\v!paragraph
+ \expandafter\typo_delimited_start_font
\else
\expandafter\typo_delimited_start_other
\fi}
@@ -437,7 +438,7 @@
\ifx\p_delimited_repeat\v!yes
\let\typo_delimited_repeat\typo_delimited_repeat_indeed
\else
- \let\typo_delimited_repeat\relax
+ \lettonothing\typo_delimited_repeat
\fi
\setfalse\c_typo_delimited_repeating
\edef\p_delimited_location{\delimitedtextparameter\c!location}%
@@ -512,10 +513,11 @@
\usedelimitedtextstyleandcolor\c!style\c!color
%
\begingroup
- \edef\p_delimited_left {\delimitedtextparameter{\c!left}}%
- \edef\p_delimited_right {\delimitedtextparameter{\c!right}}%
- \edef\p_delimited_nextleft {\delimitedtextparameter{\c!nextleft}}%
- \edef\p_delimited_nextright{\delimitedtextparameter{\c!nextright}}%
+ \usealignparameter\delimitedtextparameter
+ \edef\p_delimited_left {\delimitedtextparameter\c!left}%
+ \edef\p_delimited_right {\delimitedtextparameter\c!right}%
+ \edef\p_delimited_nextleft {\delimitedtextparameter\c!nextleft}%
+ \edef\p_delimited_nextright{\delimitedtextparameter\c!nextright}%
%
\leftdelimitedtextmark
%
@@ -567,6 +569,8 @@
\edef\p_delimited_method{\delimitedtextparameter\c!method}%
\ifx\p_delimited_method\v!font
\expandafter\typo_delimited_fontdriven
+ \orelse\ifx\p_delimited_method\v!text
+ \expandafter\typo_delimited_fontdriven
\else
\expandafter\typo_delimited_other
\fi}
@@ -706,14 +710,16 @@
% even in \MKII. Maybe we should to this in \LUA. Only Italian has the
% middlespeech parameter set.
+\newboundary\c_typo_delimited_boundary
+
\def\typo_delimited_handle_middle#1% special case
{\ifconditional\c_typo_delimited_repeating
\begingroup
\usedelimitedtextstyleandcolor\c!symstyle\c!symcolor
\setbox\scratchbox\hbox{\delimitedtextparameter#1}%
\ifdim\wd\scratchbox>\zeropoint
- \ifdim\lastkern=\d_typo_delimited_signal
- \unkern
+ \ifnum\lastboundary=\c_typo_delimited_boundary
+ \unboundary
\hskip\hspaceamount\currentusedlanguage{interquotation}%
\else % maybe an option:
%\edef\p_delimited_margin{\delimitedtextparameter\c!location}%
@@ -727,7 +733,7 @@
\delimitedtextparameter#1% unhbox\scratchbox
\dostoptagged
% \penalty\plustenthousand % else overfull boxes, but that's better than dangling periods
- \kern\d_typo_delimited_signal % +- \prewordbreak
+ \boundary\c_typo_delimited_boundary
\fi
\endgroup
\else
@@ -739,11 +745,8 @@
\usedelimitedtextstyleandcolor\c!symstyle\c!symcolor
\setbox\scratchbox\hbox{\delimitedtextparameter#1}%
\ifdim\wd\scratchbox>\zeropoint
- \ifdim\lastkern=\d_typo_delimited_signal
- \unkern
- \hskip\hspaceamount\currentusedlanguage{interquotation}%
- \orelse\ifdim\lastskip=\d_typo_delimited_signal
- \unskip
+ \ifnum\lastboundary=\c_typo_delimited_boundary
+ \unboundary
\hskip\hspaceamount\currentusedlanguage{interquotation}%
\fi
% \strut % new, needed below
@@ -757,7 +760,7 @@
\delimitedtextparameter#1% unhbox\scratchbox
\dostoptagged
\penalty\plustenthousand % new per 2013-03-09 WS mailing list
- \hskip\d_typo_delimited_signal % +- \prewordbreak
+ \boundary\c_typo_delimited_boundary
\fi
\endgroup}
@@ -766,12 +769,8 @@
\usedelimitedtextstyleandcolor\c!symstyle\c!symcolor
\setbox\scratchbox\hbox{\delimitedtextparameter#1}%
\ifdim\wd\scratchbox>\zeropoint
- \ifdim\lastkern=\d_typo_delimited_signal
- \unkern
- \penalty\plustenthousand
- \hskip\hspaceamount\currentusedlanguage{interquotation}%
- \orelse\ifdim\lastskip=\d_typo_delimited_signal
- \unskip
+ \ifnum\lastboundary=\c_typo_delimited_boundary
+ \unboundary
\penalty\plustenthousand
\hskip\hspaceamount\currentusedlanguage{interquotation}%
\fi
@@ -784,7 +783,7 @@
\dotagsetdelimitedsymbol\s!right
\delimitedtextparameter#1% unhbox\scratchbox
\dostoptagged
- \kern\d_typo_delimited_signal % +- \prewordbreak
+ \boundary\c_typo_delimited_boundary
\fi
\endgroup}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-dig.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-dig.lmt
index 7f6663db98a..9e72d25c299 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-dig.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-dig.lmt
@@ -33,12 +33,11 @@ local setlink = nuts.setlink
local setnext = nuts.setnext
local setprev = nuts.setprev
-local hpack_node = nuts.hpack
-local traverse_id = nuts.traverse_id
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
-local find_attribute = nuts.find_attribute
-local unset_attributes = nuts.unset_attributes
+local hpacknode = nuts.hpack
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
+local findattribute = nuts.findattribute
+local unsetattributes = nuts.unsetattributes
local texsetattribute = tex.setattribute
local unsetvalue = attributes.unsetvalue
@@ -75,16 +74,16 @@ local a_digits = attributes.private("digits")
function nodes.aligned(head,start,stop,width,how)
if how == "flushright" or how == "middle" then
- head, start = insert_node_before(head,start,new_glue(0,65536,65536))
+ head, start = insertnodebefore(head,start,new_glue(0,65536,65536))
end
if how == "flushleft" or how == "middle" then
- head, stop = insert_node_after(head,stop,new_glue(0,65536,65536))
+ head, stop = insertnodeafter(head,stop,new_glue(0,65536,65536))
end
local prv = getprev(start)
local nxt = getnext(stop)
setprev(start)
setnext(stop)
- local packed = hpack_node(start,width,"exactly") -- no directional mess here, just lr
+ local packed = hpacknode(start,width,"exactly") -- no directional mess here, just lr
if prv then
setlink(prv,packed)
end
@@ -117,7 +116,7 @@ actions[1] = function(head,start,attr)
end
function digits.handler(head)
- local _, start = find_attribute(head, a_digits)
+ local _, start = findattribute(head, a_digits)
if start then
local current = head
while current do
@@ -138,7 +137,7 @@ function digits.handler(head)
end
end
if done then
- unset_attributes(a_digits, head)
+ unsetattributes(a_digits, head)
end
end
return head
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-dir.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-dir.lmt
new file mode 100644
index 00000000000..c1d2a8601a0
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-dir.lmt
@@ -0,0 +1,212 @@
+if not modules then modules = { } end modules ['typo-dir'] = {
+ version = 1.001,
+ comment = "companion to typo-dir.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- When we started with this, there were some issues in luatex so we needed to take care of
+-- intereferences. Some has been improved but we stil might end up with each node having a
+-- dir property. Now, the biggest problem is that there is an official bidi algorithm but
+-- some searching on the web shows that there are many confusing aspects and therefore
+-- proposals circulate about (sometimes imcompatible ?) improvements. In the end it all boils
+-- down to the lack of willingness to tag an input source. Of course tagging of each number
+-- and fenced strip is somewhat over the top, but now it has to be captured in logic. Texies
+-- normally have no problem with tagging but we need to handle any input. So, what we have
+-- done here (over the years) is starting from what we expect to see happen, especially with
+-- respect to punctation, numbers and fences. Eventually alternative algorithms will be provides
+-- so that users can choose (the reason why suggestion sfor improvements circulate on the web
+-- is that it is non trivial to predict the expected behaviour so one hopes that the ditor
+-- and the rest of the machinery match somehow. Anyway, the fun of tex is that it has no hard
+-- coded behavior. And ... we also want to have more debugging and extras and ... so we want
+-- a flexible approach. In the end we will have:
+--
+-- = full tagging (mechanism turned off)
+-- = half tagging (the current implementation)
+-- = unicode version x interpretation (several depending on the evolution)
+
+local next, type = next, type
+local format, insert, sub, find, match = string.format, table.insert, string.sub, string.find, string.match
+
+local nodes, node = nodes, node
+
+local trace_textdirections = false trackers.register("typesetters.directions.text", function(v) trace_textdirections = v end)
+local trace_mathdirections = false trackers.register("typesetters.directions.math", function(v) trace_mathdirections = v end)
+local trace_directions = false trackers.register("typesetters.directions", function(v) trace_textdirections = v trace_mathdirections = v end)
+
+local one_too = false directives.register("typesetters.directions.onetoo", function(v) one_too = v end)
+
+local report_textdirections = logs.reporter("typesetting","text directions")
+----- report_mathdirections = logs.reporter("typesetting","math directions")
+
+local texsetattribute = tex.setattribute
+local unsetvalue = attributes.unsetvalue
+
+local nuts = nodes.nuts
+local getnext = nuts.getnext
+local getattr = nuts.getattr
+
+local enableaction = nodes.tasks.enableaction
+local tracers = nodes.tracers
+local setcolor = tracers.colors.set
+local resetcolor = tracers.colors.reset
+
+local implement = interfaces.implement
+
+local directions = typesetters.directions or { }
+typesetters.directions = directions
+
+local a_directions = attributes.private('directions')
+
+local variables = interfaces.variables
+local v_global = variables["global"]
+local v_local = variables["local"]
+local v_on = variables.on
+local v_yes = variables.yes
+
+local m_enabled = 0x00000040 -- 2^6 64
+local m_global = 0x00000080 -- 2^7
+local m_fences = 0x00000100 -- 2^8
+
+local handlers = { }
+local methods = { }
+local lastmethod = 0
+
+local function installhandler(name,handler)
+ local method = methods[name]
+ if not method then
+ lastmethod = lastmethod + 1
+ method = lastmethod
+ methods[name] = method
+ end
+ handlers[method] = handler
+ return method
+end
+
+directions.handlers = handlers
+directions.installhandler = installhandler
+
+local function tomode(specification)
+ local scope = specification.scope
+ local mode
+ if scope == v_global or scope == v_on then
+ mode = m_enabled + m_global
+ elseif scope == v_local then
+ mode = m_enabled
+ else
+ return 0
+ end
+ local method = methods[specification.method]
+ if method then
+ mode = mode + method
+ else
+ return 0
+ end
+ if specification.fences == v_yes then
+ mode = mode + m_fences
+ end
+ return mode
+end
+
+local function getglobal(a)
+ return a and a > 0 and (a & m_global) ~= 0
+end
+
+local function getfences(a)
+ return a and a > 0 and (a & m_fences) ~= 0
+end
+
+local function getmethod(a)
+ return a and a > 0 and a % m_enabled or 0
+end
+
+directions.tomode = tomode
+directions.getglobal = getglobal
+directions.getfences = getfences
+directions.getmethod = getmethod
+directions.installhandler = installhandler
+
+-- beware: in dha we have character properties and in dua|b we have direction properties
+
+function directions.setcolor(current,direction,reversed,mirror)
+ if mirror then
+ setcolor(current,"bidi:mirrored")
+ elseif direction == "l" then
+ setcolor(current,reversed and "bidi:left:reversed" or "bidi:left:original")
+ elseif direction == "r" then
+ setcolor(current,reversed and "bidi:right:reversed" or "bidi:right:original")
+ else
+ resetcolor(current)
+ end
+end
+
+implement {
+ name = "getbidimode",
+ actions = { tomode, context },
+ arguments = {
+ {
+ { "scope" },
+ { "method" },
+ { "fences" },
+ }
+ }
+}
+
+local enabled = false
+
+local starttiming = statistics.starttiming
+local stoptiming = statistics.stoptiming
+
+-- If we have hbox{!} then the hbox determines the direction but we can consider
+-- a fast analysis, not that it matters much because there's nothing to swap in
+-- the list unless one glyphs becomes multiple (can that really happen?).
+--
+-- \enabledirectives[typesetters.directions.onetoo]
+
+function directions.handler(head,where,direction)
+ local only_one = not getnext(head)
+ if only_one and not one_too then
+ return head
+ end
+ local attr = getattr(head,a_directions)
+ if not attr or attr == 0 then
+ return head
+ end
+ local method = getmethod(attr)
+ local handler = handlers[method]
+ if not handler then
+ return head
+ end
+ starttiming(directions)
+ head = handler(head,direction,only_one,where)
+ stoptiming(directions)
+ return head
+end
+
+statistics.register("text directions", function()
+ if enabled then
+ return statistics.elapsedseconds(directions)
+ end
+end)
+
+function directions.set(n) -- todo: names and numbers
+ if not enabled then
+ if trace_textdirections then
+ report_textdirections("enabling directions handler")
+ end
+ enableaction("processors","typesetters.directions.handler")
+ enabled = true
+ end
+ if not n or n == 0 then
+ n = unsetvalue
+ -- maybe tracing
+ end
+ texsetattribute(a_directions,n)
+end
+
+implement {
+ name = "setdirection",
+ arguments = "integer",
+ actions = directions.set
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-dir.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-dir.mkxl
index 8439ed342d0..a5a4bc5686d 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-dir.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-dir.mkxl
@@ -18,7 +18,7 @@
\unprotect
-\registerctxluafile{typo-dir}{optimize}
+\registerctxluafile{typo-dir}{autosuffix}
\registerctxluafile{typo-dha}{}
%registerctxluafile{typo-dua}{}
%registerctxluafile{typo-dub}{}
@@ -51,8 +51,8 @@
% maybe use chardefs
-\mutable\let\currentbidimode\empty
-\mutable\let\currentbidistamp\empty
+\mutable\lettonothing\currentbidimode
+\mutable\lettonothing\currentbidistamp
\def\typo_dir_get_mode
{\def\currentbidimode{\clf_getbidimode % test edef
@@ -87,7 +87,7 @@
\appendtoks
\edef\p_option{\directionsparameter\c!break}% name can change
- \bitwiseflip\normalizelinemode\ifx\p_option\v!both\else-\fi\breakafterdircode
+ \bitwiseflip\normalizelinemode\ifx\p_option\v!both\else-\fi\breakafterdirnormalizecode
\to \everysetupdirections
% bidi: local=obey grouping, global=ignore grouping (unicode has no grouping)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-drp.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-drp.lmt
index 2c53cc111a9..1ea4f47154b 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-drp.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-drp.lmt
@@ -18,7 +18,7 @@ local settings_to_hash = utilities.parsers.settings_to_hash
local trace_initials = false trackers.register("typesetters.initials", function(v) trace_initials = v end)
local report_initials = logs.reporter("nodes","initials")
-local initials = typesetters.paragraphs or { }
+local initials = typesetters.initials or { }
typesetters.initials = initials or { }
local nodes = nodes
@@ -44,7 +44,7 @@ local setlink = nuts.setlink
local setprev = nuts.setprev
local setnext = nuts.setnext
local setfont = nuts.setfont
-local setchar = nuts.setchar
+local setscale = nuts.setscale
local setwhd = nuts.setwhd
local setkern = nuts.setkern
local setoffsets = nuts.setoffsets
@@ -57,10 +57,11 @@ local nodecodes = nodes.nodecodes
local nodepool = nuts.pool
local new_kern = nodepool.kern
-local insert_before = nuts.insert_before
-local insert_after = nuts.insert_after
+local insertbefore = nuts.insertbefore
+local insertafter = nuts.insertafter
local remove_node = nuts.remove
-local start_of_par = nuts.start_of_par
+
+local startofpar = nuts.startofpar
local nextnode = nuts.traversers.node
local nextglyph = nuts.traversers.glyph
@@ -72,6 +73,7 @@ local v_default = variables.default
local v_margin = variables.margin
local v_auto = variables.auto
local v_first = variables.first
+local v_keep = variables.keep
local v_last = variables.last
local texget = tex.get
@@ -115,6 +117,7 @@ interfaces.implement {
{ "hoffset" ,"dimen" },
{ "voffset" ,"dimen" },
{ "font", "integer" },
+ { "glyphscale", "integer" },
{ "dynamic", "integer" },
{ "ca", "integer" },
{ "ma", "integer" },
@@ -129,6 +132,7 @@ interfaces.implement {
-- a page so this has a low priority
actions[v_default] = function(head,setting)
+ local skip = false
-- begin of par
local first = getnext(head)
local indent = false
@@ -154,6 +158,7 @@ actions[v_default] = function(head,setting)
local lines = tonumber(setting.n) or 0
local dynamic = setting.dynamic
local font = setting.font
+ local scale = setting.glyphscale
local method = settings_to_hash(setting.method)
local length = tonumber(setting.m) or 1
--
@@ -192,6 +197,9 @@ actions[v_default] = function(head,setting)
else
-- keep quote etc with initial
local next = getnext(first)
+ if next and method[v_keep] then
+ skip = first
+ end
if not next then
-- don't start with a quote or so
return head
@@ -241,15 +249,18 @@ actions[v_default] = function(head,setting)
local id = getid(current)
if id == kern_code then
setkern(current,0)
- elseif id == glyph_code then
+ elseif id == glyph_code and skip ~= current then
local next = getnext(current)
if font then
setfont(current,font)
end
+ if scale then
+ setscale(current,scale)
+ end
if dynamic > 0 then
setglyphdata(current,dynamic)
end
- setcoloring(ma,ca,ta)
+ setcoloring(current,ma,ca,ta)
end
if current == last then
break
@@ -269,8 +280,7 @@ actions[v_default] = function(head,setting)
local width, height, depth = getwhd(dropper)
setwhd(dropper,0,0,0)
--
- setlink(prev,dropper)
- setlink(dropper,next)
+ setlink(prev,dropper,next)
--
if next then
local current = next
@@ -289,7 +299,11 @@ actions[v_default] = function(head,setting)
--
local hoffset = width + hoffset + distance + (indent and parindent or 0)
for current in nextglyph, first do
- setoffsets(current,-hoffset,-voffset) -- no longer - height here
+ if skip == current then
+ setoffsets(current,-hoffset,0)
+ else
+ setoffsets(current,-hoffset,-voffset) -- no longer - height here
+ end
if current == last then
break
end
@@ -312,9 +326,18 @@ actions[v_default] = function(head,setting)
end
texset("hangafter",hangafter,true)
texset("hangindent",hangindent,true)
+-- local hsize = texget("hsize",false)
+-- local step = { hangindent, hsize - hangindent }
+-- local shape = { ["shift"] = true }
+-- for i=1,-hangafter do
+-- shape[#shape+1] = step
+-- end
+-- shape[#shape+1] = { 0, hsize }
+-- texset("parshape",shape)
+-- tex.snapshotpar(0x20000)
end
if indent then
- insert_after(first,first,new_kern(-parindent))
+ insertafter(first,first,new_kern(-parindent))
end
end
return head
@@ -322,8 +345,8 @@ end
-- we can count ... when all done, we can disable ...
-function initials.handler(head)
- if getid(head) == par_code and start_of_par(head) then
+function initials.handler(head,groupcode)
+ if getid(head) == par_code and startofpar(head) then
local settings = getprop(head,a_initial)
if settings then
disableaction("processors","typesetters.initials.handler")
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-drp.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-drp.mkxl
index 94e08c9b013..0a128b0d639 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-drp.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-drp.mkxl
@@ -71,10 +71,33 @@
\permanent\tolerant\protected\def\placeinitial[#1]% old command
{\par
\namedinitialparameter{#1}\c!before
- \edef\typo_initial_handle{\typo_initial_handle_indeed{#1}{}}}
+ \enforced\edef\typo_initial_handle{\typo_initial_handle_indeed{#1}{}}}
\permanent\tolerant\protected\def\setinitial[#1]#*[#2]%
- {\edef\typo_initial_handle{\typo_initial_handle_indeed{#1}{#2}}}
+ {\enforced\edef\typo_initial_handle{\typo_initial_handle_indeed{#1}{#2}}}
+
+\permanent\tolerant\protected\def\flushinitial % when used inside a mechanism that forgets
+ {\typo_initial_handle}
+
+\newconstant \c_initial_lines
+\newconditional\c_initial_synchronize
+
+% First experiment:
+%
+% \startluacode
+% function nodes.handlers.forgetinitial(mode,indented,context)
+% token.expandmacro("forgetinitial")
+% return indented
+% end
+% utilities.sequencers.prependaction("paragraph","system","nodes.handlers.forgetinitial")
+% utilities.sequencers.enableaction("paragraph","nodes.handlers.forgetinitial")
+% \stopluacode
+%
+% Second experiment:
+%
+% \appendtoks
+% \forgetinitial
+% \to \everybeforepar
\protected\def\typo_initial_handle_indeed#1#2%
{\dontleavehmode
@@ -90,26 +113,66 @@
\scratchcounter \initialparameter\c!n\relax
\scratchvoffset\dimexpr\ifx\p_voffset\v!line\scratchcounter\lineheight-\lineheight\else\p_voffset\fi\relax
\clf_setinitial
- location {\initialparameter\c!location}%
- enabled true\space
- n \scratchcounter
- m \numexpr\initialparameter\c!m\relax
- method {\initialparameter\c!method}%
- distance \dimexpr\initialparameter\c!distance\relax
- hoffset \dimexpr\initialparameter\c!hoffset\relax
- voffset \scratchvoffset
- ma \c_attr_colormodel
- ca \c_attr_color
- ta \c_attr_transparency
- font \fontid\font
- dynamic \font_dynamic_value % it's a bit over the top to support this here
+ location {\initialparameter\c!location}%
+ enabled true\space
+ n \scratchcounter
+ m \numexpr\initialparameter\c!m\relax
+ method {\initialparameter\c!method}%
+ distance \dimexpr\initialparameter\c!distance\relax
+ hoffset \dimexpr\initialparameter\c!hoffset\relax
+ voffset \scratchvoffset
+ ma \c_attr_colormodel
+ ca \c_attr_color
+ ta \c_attr_transparency
+ font \fontid\font
+ glyphscale \glyphscale
+ dynamic \font_dynamic_value % it's a bit over the top to support this here
\relax
\c_attr_initial\plusone
\initialparameter\c!text
- \endgroup
- \glet\typo_initial_handle\relax}
+ \normalexpanded{\endgroup\c_initial_lines\the\scratchcounter}%
+ \enforced\glettonothing\typo_initial_handle
+ \ifconditional\c_initial_synchronize
+ \appendtoks \forgetinitial \to \everybeforepar
+ \fi}
+
+\lettonothing\typo_initial_handle % hook into everypar
+
+\permanent\protected\def\forgetinitial
+ {\ifcase\c_initial_lines\else
+ \begingroup
+ \advanceby\c_initial_lines-\prevgraf\relax
+ \ifcase\c_initial_lines\else
+ \obeydepth
+ \forgetall
+ \testpage[\the\c_initial_lines]%
+ \dorecurse\c_initial_lines{\nointerlineskip\hpack to \hsize{\strut}\par}%
+ \fi
+ \endgroup
+ \c_initial_lines\zerocount
+ \ifconditional\c_initial_synchronize
+ \removetoks \forgetinitial \from \everybeforepar
+ \fi
+ \fi}
+
+%D \starttyping
+%D \setupinitial[n=2,style=\tfd,location=text]
+%D \setuphead[chapter][after=\placeinitial]
+%D \enableexperiments[autoforgetinitials]
+%D
+%D \starttext
+%D \chapter{Test me} Hello world!
+%D %\forgetinitial \input tufte
+%D \input tufte
+%D \stoptext
+%D \stoptyping
+
+% \enableexperiments[autoforgetinitials]
-\let\typo_initial_handle\relax
+\installtexexperiment
+ {autoforgetinitials}
+ {\settrue \c_initial_synchronize}
+ {\setfalse\c_initial_synchronize}
% \setupbodyfont[dejavu,9pt]
%
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-duc.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-duc.lmt
index 07ae140e867..2e36389466d 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-duc.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-duc.lmt
@@ -31,7 +31,7 @@ if not modules then modules = { } end modules ['typo-duc'] = {
-- todo: no need for a max check
-- todo: collapse bound similar ranges (not ok yet)
-- todo: combine some sweeps
--- todo: removing is not needed when we inject at the same spot (only chnage the dir property)
+-- todo: removing is not needed when we inject at the same spot (only change the dir property)
-- todo: isolated runs (isolating runs are similar to bidi=local in the basic analyzer)
-- todo: check unicode addenda (from the draft):
@@ -76,9 +76,10 @@ local setattrlist = nuts.setattrlist
local properties = nodes.properties.data
local remove_node = nuts.remove
-local insert_node_after = nuts.insert_after
-local insert_node_before = nuts.insert_before
-local start_of_par = nuts.start_of_par
+local insertnodeafter = nuts.insertafter
+local insertnodebefore = nuts.insertbefore
+
+local startofpar = nuts.startofpar
local nodepool = nuts.pool
local new_direction = nodepool.direction
@@ -426,7 +427,7 @@ end
local function get_baselevel(head,list,size,direction)
if direction == lefttoright_code or direction == righttoleft_code then
return direction, true
- elseif getid(head) == par_code and start_of_par(head) then
+ elseif getid(head) == par_code and startofpar(head) then
direction = getdirection(head)
if direction == lefttoright_code or direction == righttoleft_code then
return direction, true
@@ -957,30 +958,46 @@ local function apply_to_list(list,size,head,pardir)
setdirection(current,pardir) -- is this really needed?
elseif id == glue_code then
-- Maybe I should also fix dua and dub but on the other hand ... why?
- if enddir and getsubtype(current) == parfillskip_code then
- -- insert the last enddir before \parfillskip glue
- local c = current
- local p = getprev(c)
- if p and getid(p) == glue_code and getsubtype(p) == parfillleftskip_code then
- c = p
- p = getprev(c)
- end
- if p and getid(p) == penalty_code then -- linepenalty
- c = p
- end
- -- there is always a par nodes so head will stay
- head = insert_node_before(head,c,new_direction(enddir,true))
+-- if enddir and getsubtype(current) == parfillskip_code then
+-- -- insert the last enddir before \parfillskip glue
+-- local c = current
+-- local p = getprev(c)
+-- if p and getid(p) == glue_code and getsubtype(p) == parfillleftskip_code then
+-- c = p
+-- p = getprev(c)
+-- end
+-- while p and getid(p) == glue_code do
+-- c = p
+-- p = getprev(c)
+-- end
+-- if p and getid(p) == penalty_code then -- linepenalty
+-- c = p
+-- end
+-- -- there is always a par nodes so head will stay
+-- local d = new_direction(enddir,true)
+-- setattrlist(d,current)
+-- head = insertnodebefore(head,c,d)
+-- enddir = false
+-- end
+ if enddir then
+ local d = new_direction(enddir,true)
+ setattrlist(d,current)
+ head = insertnodebefore(head,current,d)
enddir = false
end
elseif begindir then
- if id == par_code and start_of_par(current) then
+ if id == par_code and startofpar(current) then
-- par should always be the 1st node
- head, current = insert_node_after(head,current,new_direction(begindir))
+ local d = new_direction(begindir)
+ setattrlist(d,current)
+ head, current = insertnodeafter(head,current,d)
begindir = nil
end
end
if begindir then
- head = insert_node_before(head,current,new_direction(begindir))
+ local d = new_direction(begindir)
+ setattrlist(d,current)
+ head = insertnodebefore(head,current,d)
end
local skip = entry.skip
if skip and skip > 0 then
@@ -995,7 +1012,9 @@ local function apply_to_list(list,size,head,pardir)
end
end
if enddir then
- head, current = insert_node_after(head,current,new_direction(enddir,true))
+ local d = new_direction(enddir,true)
+ setattrlist(d,current)
+ head, current = insertnodeafter(head,current,d)
end
if not entry.remove then
current = getnext(current)
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-fln.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-fln.lmt
index fa507df4b1a..10d802cf3c7 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-fln.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-fln.lmt
@@ -62,15 +62,15 @@ local spaceskip_code = nodes.gluecodes.spaceskip
local nextglyph = nuts.traversers.glyph
local nextdisc = nuts.traversers.disc
-local flush_node_list = nuts.flush_list
-local flush_node = nuts.flush_node
-local copy_node_list = nuts.copy_list
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local flushnodelist = nuts.flushlist
+local flushnode = nuts.flushnode
+local copy_node_list = nuts.copylist
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local remove_node = nuts.remove
local getdimensions = nuts.dimensions
local hpack_node_list = nuts.hpack
-local start_of_par = nuts.start_of_par
+local startofpar = nuts.startofpar
local setcoloring = nuts.colors.set
@@ -180,7 +180,7 @@ actions[v_line] = function(head,setting)
-- temp = typesetters.kerns.handler(temp) -- maybe when enabled
-- temp = typesetters.cases.handler(temp) -- maybe when enabled
local width = getdimensions(temp)
- flush_node_list(temp)
+ flushnodelist(temp)
return width
end
@@ -228,7 +228,7 @@ actions[v_line] = function(head,setting)
end
end
- flush_node_list(temp)
+ flushnodelist(temp)
local start = head
local n = 0
@@ -238,7 +238,7 @@ actions[v_line] = function(head,setting)
setglyphdata(start,dynamic)
end
setfont(start,font)
- setcoloring(ma,ca,ta)
+ setcoloring(start,ma,ca,ta)
end
for i=1,noflines do
@@ -288,11 +288,11 @@ actions[v_line] = function(head,setting)
end
end
setdisc(disc,pre,post,replace)
- flush_node(disc)
+ flushnode(disc)
elseif id == glue_code then
n = n + 1
if linebreak ~= n then
- head = insert_node_before(head,start,newpenalty(10000)) -- nobreak
+ head = insertnodebefore(head,start,newpenalty(10000)) -- nobreak
end
end
local next = getnext(start)
@@ -300,11 +300,11 @@ actions[v_line] = function(head,setting)
if start ~= head then
local where = id == glue_code and getprev(start) or start
if trace_firstlines then
- head, where = insert_node_after(head,where,newpenalty(10000)) -- nobreak
- head, where = insert_node_after(head,where,newkern(-65536))
- head, where = insert_node_after(head,where,tracerrule(65536,4*65536,2*65536,"darkblue"))
+ head, where = insertnodeafter(head,where,newpenalty(10000)) -- nobreak
+ head, where = insertnodeafter(head,where,newkern(-65536))
+ head, where = insertnodeafter(head,where,tracerrule(65536,4*65536,2*65536,"darkblue"))
end
- head, where = insert_node_after(head,where,newpenalty(-10000)) -- break
+ head, where = insertnodeafter(head,where,newpenalty(-10000)) -- break
end
start = next
break
@@ -335,7 +335,7 @@ actions[v_word] = function(head,setting)
words = words + 1
ok = true
end
- setcoloring(ma,ca,ta)
+ setcoloring(start,ma,ca,ta)
if dynamic > 0 then
setglyphdata(start,dynamic)
end
@@ -358,7 +358,7 @@ end
actions[v_default] = actions[v_line]
function firstlines.handler(head)
- if getid(head) == par_code and start_of_par(head) then
+ if getid(head) == par_code and startofpar(head) then
local settings = getprop(head,a_firstline)
if settings then
disableaction("processors","typesetters.firstlines.handler")
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-fln.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-fln.mkxl
index 3ef688bb55a..a62646ffff9 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-fln.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-fln.mkxl
@@ -88,9 +88,9 @@
% \kern\zeropoint % we need a node
% \hskip\zeropoint\s!plus\emwidth\relax % can be an option
\endgroup
- \glet\typo_firstline_handle\relax}
+ \glettonothing\typo_firstline_handle}
-\let\typo_firstline_handle\relax
+\lettonothing\typo_firstline_handle
% goodie, question on list
%
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-hid.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-hid.lmt
new file mode 100644
index 00000000000..45dde497934
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-hid.lmt
@@ -0,0 +1,74 @@
+if not modules then modules = { } end modules ['typo-hid'] = {
+ version = 1.001,
+ comment = "companion to typo-hid.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local a_hidecontent = attributes.system("hidecontent")
+local specialskips = nodes.specialskipcodes
+local glue_code = nodes.nodecodes.glue
+local nuts = nodes.nuts
+local getattr = nuts.getattr
+local getnext = nuts.getnext
+local setnext = nuts.setnext
+local getprev = nuts.getprev
+local setlist = nuts.setlist
+local setlink = nuts.setlink
+local nextnode = nuts.traversers.node
+local flushlist = nuts.flushlist
+local dimensions = nuts.rangedimensions
+local hpack = nuts.hpack
+local setwhd = nuts.setwhd
+local setattrlist = nuts.setattrlist
+local enableaction = nodes.tasks.enableaction
+
+function nodes.handlers.wipe(head,groupcode,line)
+ if getattr(line,a_hidecontent) then
+ flushlist(head)
+ setlist(line)
+ else
+ -- we have normalized lines so always some skip to start with
+ local b, e = nil, nil
+ local function wipe()
+ local h = hpack()
+ local n = getnext(e)
+ setwhd(h,dimensions(line,b,n))
+ setlink(getprev(b),h,n)
+ setattrlist(h,b)
+ setnext(b)
+ flushlist(b)
+ b = nil
+ e = nil
+ end
+ for n, id, subtype in nextnode, head do
+ if id == glue_code and specialskips[subtype] then
+ if b then
+ wipe()
+ end
+ elseif getattr(n,a_hidecontent) then
+ if not b then
+ b = n
+ end
+ e = n
+ elseif b then
+ wipe()
+ end
+ end
+ if b then
+ -- can't happen because we had a skip
+ wipe()
+ end
+ setlist(line,head)
+ end
+ return nil
+end
+
+interfaces.implement {
+ name = "enablehidecontent",
+ onlyonce = true,
+ actions = function()
+ enableaction("contributers","nodes.handlers.wipe")
+ end,
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-hid.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-hid.mkxl
new file mode 100644
index 00000000000..13d8f14ca6f
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-hid.mkxl
@@ -0,0 +1,38 @@
+%D \module
+%D [ file=typo-hid,
+%D version=2021.03.15, % based on old code lying around
+%D title=\CONTEXT\ Typesetting Macros,
+%D subtitle=Hiding,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%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 Typesetting Macros / Hiding}
+
+\registerctxluafile{typo-hid}{autosuffix}
+
+\definesystemattribute[hidecontent][public]
+
+\unprotect
+
+\newinteger\c_typo_hidden_level
+
+\permanent\protected\def\starthiddencontent
+ {\ifcase\c_typo_hidden_level
+ \clf_enablehidecontent
+ \let\clf_enablehidecontent\relax
+ \attribute\hidecontentattribute\plusone
+ \fi
+ \advanceby\c_typo_hidden_level\plusone}
+
+\permanent\protected\def\stophiddencontent
+ {\advanceby\c_typo_hidden_level\minusone
+ \ifcase\c_typo_hidden_level
+ \attribute\hidecontentattribute\attributeunsetvalue
+ \fi}
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-inj.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-inj.mkxl
index f615014b04f..bf329482ed2 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-inj.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-inj.mkxl
@@ -61,12 +61,12 @@
% use \v!list instead of \s!list
\permanent\protected\def\doinstallinjector#1%
- {\letcsname typo_injectors_mark_#1\endcsname\donothing
- \letcsname typo_injectors_check_#1\endcsname\donothing}
+ {\gletcsname typo_injectors_mark_#1\endcsname\donothing
+ \gletcsname typo_injectors_check_#1\endcsname\donothing}
\permanent\protected\def\doactivateinjector#1% used at lua end
- {\protected\defcsname typo_injectors_mark_#1\endcsname{\dontleavehmode\noexpand\clf_markinjector{#1}}%
- \protected\defcsname typo_injectors_check_#1\endcsname{\noexpand\clf_checkinjector{#1}}}
+ {\protected\xdefcsname typo_injectors_mark_#1\endcsname{\dontleavehmode\noexpand\clf_markinjector{#1}}%
+ \protected\xdefcsname typo_injectors_check_#1\endcsname{\noexpand\clf_checkinjector{#1}}}
\permanent\protected\def\dotestinjector#1% only for testing outside unprotect
{\begincsname typo_injectors_check_#1\endcsname
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-itc.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-itc.lmt
index 4350053b367..c26d4a824a0 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-itc.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-itc.lmt
@@ -6,17 +6,22 @@ if not modules then modules = { } end modules ['typo-itc'] = {
license = "see context related readme files"
}
+-- very old code ...
+
local tonumber = tonumber
local trace_italics = false trackers.register("typesetters.italics", function(v) trace_italics = v end)
local report_italics = logs.reporter("nodes","italics")
-local threshold = 0.5 trackers.register("typesetters.threshold", function(v) threshold = v == true and 0.5 or tonumber(v) end)
+local threshold = 0.5 directives.register("typesetters.italics.threshold", function(v) threshold = v == true and 0.5 or tonumber(v) end)
typesetters.italics = typesetters.italics or { }
local italics = typesetters.italics
+local variables = interfaces.variables
+local settings_to_hash = utilities.parsers.settings_to_hash
+
local nodecodes = nodes.nodecodes
local glyph_code = nodecodes.glyph
local kern_code = nodecodes.kern
@@ -43,10 +48,11 @@ local isglyph = nuts.isglyph
local setkern = nuts.setkern
local getkern = nuts.getkern
local getheight = nuts.getheight
+local getoptions = nuts.getoptions
-local insert_node_after = nuts.insert_after
+local insertnodeafter = nuts.insertafter
local remove_node = nuts.remove
-local end_of_math = nuts.end_of_math
+local endofmath = nuts.endofmath
local texgetattribute = tex.getattribute
local texsetattribute = tex.setattribute
@@ -58,13 +64,15 @@ local unsetvalue = attributes.unsetvalue
local new_correction_kern = nodepool.italickern
local new_correction_glue = nodepool.glue
+local no_correction_code = tex.glyphoptioncodes.noitaliccorrection
+
local fonthashes = fonts.hashes
local fontdata = fonthashes.identifiers
local italicsdata = fonthashes.italics
local exheights = fonthashes.exheights
local chardata = fonthashes.characters
-local is_punctuation = characters.is_punctuation
+local ispunctuation = characters.is_punctuation
local implement = interfaces.implement
@@ -74,7 +82,7 @@ function typesetters.italics.forcevariant(variant)
forcedvariant = variant
end
--- We use the same key as the tex font handler. So, if a valua has already be set, we
+-- We use the same key as the tex font handler. So, if a value has already be set, we
-- use that one.
local function setitalicinfont(font,char)
@@ -100,6 +108,7 @@ local function setitalicinfont(font,char)
end
end
end
+ -- we don't want to do this each time so we also set zero here
if trace_italics then
report_italics("setting italic correction of %C of font %a to %p",char,font,italic)
end
@@ -116,36 +125,46 @@ end
-- todo: clear attribute
+local function correction_okay(n)
+ return not (getoptions(n) & no_correction_code == no_correction_code)
+end
+
local function okay(data,current,font,prevchar,previtalic,char,what)
- if data then
+ if getoptions(current) & no_correction_code == no_correction_code then
if trace_italics then
- report_italics("ignoring %p between %s italic %C and italic %C",previtalic,what,prevchar,char)
+ report_italics("ignoring %p between %s italic %C and italic %C, %s",previtalic,what,prevchar,char,"disabled")
end
return false
- end
- if threshold then
- -- if getid(current) == glyph_code then
- while current and getid(current) ~= glyph_code do
- current = getprev(current)
+ elseif data then
+ if trace_italics then
+ report_italics("ignoring %p between %s italic %C and italic %C, %s",previtalic,what,prevchar,char,"no data")
end
- if current then
- local ht = getheight(current)
- local ex = exheights[font]
- local th = threshold * ex
- if ht <= th then
- if trace_italics then
- report_italics("ignoring correction between %s italic %C and regular %C, height %p less than threshold %p",prevchar,what,char,ht,th)
+ return false
+ else
+ if threshold then
+ -- if getid(current) == glyph_code then
+ while current and getid(current) ~= glyph_code do
+ current = getprev(current)
+ end
+ if current then
+ local ht = getheight(current)
+ local ex = exheights[font]
+ local th = threshold * ex
+ if ht <= th then
+ if trace_italics then
+ report_italics("ignoring correction between %s italic %C and regular %C, height %p less than threshold %p",prevchar,what,char,ht,th)
+ end
+ return false
end
- return false
+ else
+ -- maybe backtrack to glyph
end
- else
- -- maybe backtrack to glyph
end
+ if trace_italics then
+ report_italics("inserting %p between %s italic %C and regular %C",previtalic,what,prevchar,char)
+ end
+ return true
end
- if trace_italics then
- report_italics("inserting %p between %s italic %C and regular %C",previtalic,what,prevchar,char)
- end
- return true
end
-- maybe: with_attributes(current,n) :
@@ -184,27 +203,23 @@ local enablemath = false
local enabletext = false
local function domath(head,current)
- current = end_of_math(current)
+ current = endofmath(current)
local next = getnext(current)
if next then
local char, id = isglyph(next)
- if char then
+ if char and correction_okay(next) then
-- we can have an old font where italic correction has been applied
- -- or a new one where it hasn't been done
+ -- or a new one where it hasn't been done ... actually, we now always
+ -- have one under detailed engine control
local kern = getprev(current)
if kern and getid(kern) == kern_code then
local glyph = getprev(kern)
if glyph and getid(glyph) == glyph_code then
-- [math: <glyph><kern>]<glyph> : we remove the correction when we have
-- punctuation
- if is_punctuation[char] then
+ if ispunctuation[char] then
local a = getattr(glyph,a_mathitalics)
- if a and (a < 100 or a > 100) then
- if a > 100 then
- a = a - 100
- else
- a = a + 100
- end
+ if a then
local i = getkern(kern)
local c, f = isglyph(glyph)
if getheight(next) < 1.25*exheights[f] then
@@ -218,45 +233,45 @@ local function domath(head,current)
end
setkern(kern,0) -- or maybe a small value or half the ic
end
- elseif i == 0 then
- local d = chardata[f][c]
- local i = d.italic
- if i == 0 then
- if trace_italics then
- report_italics("%s italic %p between math %C and punctuation %C","ignoring",i,c,char)
- end
- else
- setkern(kern,i)
- if trace_italics then
- report_italics("%s italic %p between math %C and punctuation %C","setting",i,c,char)
- end
- end
+ -- elseif i == 0 then
+ -- local d = chardata[f][c]
+ -- local i = d.italic
+ -- if i == 0 then
+ -- if trace_italics then
+ -- report_italics("%s italic %p between math %C and punctuation %C","ignoring",i,c,char)
+ -- end
+ -- else
+ -- setkern(kern,i)
+ -- if trace_italics then
+ -- report_italics("%s italic %p between math %C and punctuation %C","setting",i,c,char)
+ -- end
+ -- end
elseif trace_italics then
report_italics("%s italic %p between math %C and punctuation %C","keeping",k,c,char)
end
end
end
end
- else
- local glyph = kern
- if glyph and getid(glyph) == glyph_code then
- -- [math: <glyph>]<glyph> : we add the correction when we have
- -- no punctuation
- if not is_punctuation[char] then
- local a = getattr(glyph,a_mathitalics)
- if a and (a < 100 or a > 100) then
- if a > 100 then
- a = a - 100
- else
- a = a + 100
- end
- if trace_italics then
- report_italics("%s italic %p between math %C and non punctuation %C","adding",a,getchar(glyph),char)
- end
- insert_node_after(head,glyph,correction_kern(a,glyph))
- end
- end
- end
+ -- else
+ -- local glyph = kern
+ -- if glyph and getid(glyph) == glyph_code then
+ -- -- [math: <glyph>]<glyph> : we add the correction when we have
+ -- -- no punctuation
+ -- if not ispunctuation[char] then
+ -- local a = getattr(glyph,a_mathitalics)
+ -- if a and (a < 100 or a > 100) then
+ -- if a > 100 then
+ -- a = a - 100
+ -- else
+ -- a = a + 100
+ -- end
+ -- if trace_italics then
+ -- report_italics("%s italic %p between math %C and non punctuation %C","adding",a,getchar(glyph),char)
+ -- end
+ -- insertnodeafter(head,glyph,correction_kern(a,glyph))
+ -- end
+ -- end
+ -- end
end
end
end
@@ -311,7 +326,7 @@ local function texthandler(head)
if font ~= lastfont then
if previtalic ~= 0 then
if okay(data,current,font,prevchar,previtalic,char,"glyph") then
- insert_node_after(prevhead,prev,correction_kern(previtalic,current))
+ insertnodeafter(prevhead,prev,correction_kern(previtalic,current))
end
elseif previnserted and data then
if trace_italics then
@@ -322,7 +337,7 @@ local function texthandler(head)
--
if replaceitalic ~= 0 then
if okay(data,replace,font,replacechar,replaceitalic,char,"replace") then
- insert_node_after(replacehead,replace,correction_kern(replaceitalic,current))
+ insertnodeafter(replacehead,replace,correction_kern(replaceitalic,current))
end
replaceitalic = 0
elseif replaceinserted and data then
@@ -334,7 +349,7 @@ local function texthandler(head)
--
if postitalic ~= 0 then
if okay(data,post,font,postchar,postitalic,char,"post") then
- insert_node_after(posthead,post,correction_kern(postitalic,current))
+ insertnodeafter(posthead,post,correction_kern(postitalic,current))
end
postitalic = 0
elseif postinserted and data then
@@ -393,35 +408,39 @@ local function texthandler(head)
while current do
local char, id = isglyph(current)
if char then
- local font = id
- if font ~= lastfont then
- local data = italicsdata[font]
- if data then
- local attr = forcedvariant or getattr(current,a_italics)
- if attr and attr > 0 then
- local cd = data[char]
- if not cd then
- -- this really can happen
- replaceitalic = 0
- else
- replaceitalic = cd.italic
- if not replaceitalic then
- replaceitalic = setitalicinfont(font,char) -- calculated once
- -- replaceitalic = 0
- end
- if replaceitalic ~= 0 then
- lastfont = font
- lastattr = attr
- replacechar = char
- replacehead = replace
- updated = true
+ if correction_okay(current) then
+ local font = id
+ if font ~= lastfont then
+ local data = italicsdata[font]
+ if data then
+ local attr = forcedvariant or getattr(current,a_italics)
+ if attr and attr > 0 then
+ local cd = data[char]
+ if not cd then
+ -- this really can happen
+ replaceitalic = 0
+ else
+ replaceitalic = cd.italic
+ if not replaceitalic then
+ replaceitalic = setitalicinfont(font,char) -- calculated once
+ -- replaceitalic = 0
+ end
+ if replaceitalic ~= 0 then
+ lastfont = font
+ lastattr = attr
+ replacechar = char
+ replacehead = replace
+ updated = true
+ end
end
end
end
+ replacefont = font
end
- replacefont = font
+ break
+ else
+ current = getprev(current)
end
- break
else
current = getprev(current)
end
@@ -432,35 +451,39 @@ local function texthandler(head)
while current do
local char, id = isglyph(current)
if char then
- local font = id
- if font ~= lastfont then
- local data = italicsdata[font]
- if data then
- local attr = forcedvariant or getattr(current,a_italics)
- if attr and attr > 0 then
- local cd = data[char]
- if not cd then
- -- this really can happen
- -- postitalic = 0
- else
- postitalic = cd.italic
- if not postitalic then
- postitalic = setitalicinfont(font,char) -- calculated once
- -- postitalic = 0
- end
- if postitalic ~= 0 then
- lastfont = font
- lastattr = attr
- postchar = char
- posthead = post
- updated = true
+ if correction_okay(current) then
+ local font = id
+ if font ~= lastfont then
+ local data = italicsdata[font]
+ if data then
+ local attr = forcedvariant or getattr(current,a_italics)
+ if attr and attr > 0 then
+ local cd = data[char]
+ if not cd then
+ -- this really can happen
+ -- postitalic = 0
+ else
+ postitalic = cd.italic
+ if not postitalic then
+ postitalic = setitalicinfont(font,char) -- calculated once
+ -- postitalic = 0
+ end
+ if postitalic ~= 0 then
+ lastfont = font
+ lastattr = attr
+ postchar = char
+ posthead = post
+ updated = true
+ end
end
end
end
+ postfont = font
end
- postfont = font
+ break
+ else
+ current = getprev(current)
end
- break
else
current = getprev(current)
end
@@ -486,7 +509,7 @@ local function texthandler(head)
end
previnserted = correction_glue(previtalic,current) -- maybe just add ? else problem with penalties
previtalic = 0
- insert_node_after(prevhead,prev,previnserted)
+ insertnodeafter(prevhead,prev,previnserted)
else
if replaceitalic ~= 0 then
if trace_italics then
@@ -494,7 +517,7 @@ local function texthandler(head)
end
replaceinserted = correction_kern(replaceitalic,current) -- needs to be a kern
replaceitalic = 0
- insert_node_after(replacehead,replace,replaceinserted)
+ insertnodeafter(replacehead,replace,replaceinserted)
end
if postitalic ~= 0 then
if trace_italics then
@@ -502,7 +525,7 @@ local function texthandler(head)
end
postinserted = correction_kern(postitalic,current) -- needs to be a kern
postitalic = 0
- insert_node_after(posthead,post,postinserted)
+ insertnodeafter(posthead,post,postinserted)
end
end
elseif id == math_code then
@@ -516,45 +539,43 @@ local function texthandler(head)
if mathokay then
current = domath(head,current)
else
- current = end_of_math(current)
+ current = endofmath(current)
end
+ elseif previtalic ~= 0 then
+ if trace_italics then
+ report_italics("inserting %p between %s italic %C and whatever",previtalic,"glyph",prevchar)
+ end
+ insertnodeafter(prevhead,prev,correction_kern(previtalic,current))
+ previnserted = nil
+ previtalic = 0
+ replaceinserted = nil
+ replaceitalic = 0
+ postinserted = nil
+ postitalic = 0
else
- if previtalic ~= 0 then
+ if replaceitalic ~= 0 then
if trace_italics then
- report_italics("inserting %p between %s italic %C and whatever",previtalic,"glyph",prevchar)
+ report_italics("inserting %p between %s italic %C and whatever",replaceitalic,"replace",replacechar)
end
- insert_node_after(prevhead,prev,correction_kern(previtalic,current))
+ insertnodeafter(replacehead,replace,correction_kern(replaceitalic,current))
previnserted = nil
previtalic = 0
replaceinserted = nil
replaceitalic = 0
postinserted = nil
postitalic = 0
- else
- if replaceitalic ~= 0 then
- if trace_italics then
- report_italics("inserting %p between %s italic %C and whatever",replaceitalic,"replace",replacechar)
- end
- insert_node_after(replacehead,replace,correction_kern(replaceitalic,current))
- previnserted = nil
- previtalic = 0
- replaceinserted = nil
- replaceitalic = 0
- postinserted = nil
- postitalic = 0
- end
- if postitalic ~= 0 then
- if trace_italics then
- report_italics("inserting %p between %s italic %C and whatever",postitalic,"post",postchar)
- end
- insert_node_after(posthead,post,correction_kern(postitalic,current))
- previnserted = nil
- previtalic = 0
- replaceinserted = nil
- replaceitalic = 0
- postinserted = nil
- postitalic = 0
+ end
+ if postitalic ~= 0 then
+ if trace_italics then
+ report_italics("inserting %p between %s italic %C and whatever",postitalic,"post",postchar)
end
+ insertnodeafter(posthead,post,correction_kern(postitalic,current))
+ previnserted = nil
+ previtalic = 0
+ replaceinserted = nil
+ replaceitalic = 0
+ postinserted = nil
+ postitalic = 0
end
end
current = getnext(current)
@@ -564,19 +585,19 @@ local function texthandler(head)
if trace_italics then
report_italics("inserting %p between %s italic %C and end of list",previtalic,"glyph",prevchar)
end
- insert_node_after(prevhead,prev,correction_kern(previtalic,current))
+ insertnodeafter(prevhead,prev,correction_kern(previtalic,current))
else
if replaceitalic ~= 0 then
if trace_italics then
report_italics("inserting %p between %s italic %C and end of list",replaceitalic,"replace",replacechar)
end
- insert_node_after(replacehead,replace,correction_kern(replaceitalic,current))
+ insertnodeafter(replacehead,replace,correction_kern(replaceitalic,current))
end
if postitalic ~= 0 then
if trace_italics then
report_italics("inserting %p between %s italic %C and end of list",postitalic,"post",postchar)
end
- insert_node_after(posthead,post,correction_kern(postitalic,current))
+ insertnodeafter(posthead,post,correction_kern(postitalic,current))
end
end
end
@@ -649,9 +670,6 @@ implement {
actions = italics.reset,
}
-local variables = interfaces.variables
-local settings_to_hash = utilities.parsers.settings_to_hash
-
local function setupitaliccorrection(option) -- no grouping !
if enabletext then
enabletext()
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-itm.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-itm.mkxl
index 7ae1b732f42..5a10cfc9d82 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-itm.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-itm.mkxl
@@ -60,13 +60,13 @@
\c!inbetween={\blank[\v!medium]},
\c!after=\blank]
-\newcount\c_typo_items_n
-\newcount\c_typo_items_m
-\newdimen\d_typo_items_text_width
-\newdimen\d_typo_items_symbol_width
-\newdimen\d_typo_items_distance
-\newbox \b_typo_items_symbols
-\newbox \b_typo_items_texts
+\newinteger \c_typo_items_n
+\newinteger \c_typo_items_m
+\newdimension\d_typo_items_text_width
+\newdimension\d_typo_items_symbol_width
+\newdimension\d_typo_items_distance
+\newbox \b_typo_items_symbols
+\newbox \b_typo_items_texts
\permanent\tolerant\protected\def\items[#1]#:#2%
{\bgroup
@@ -103,7 +103,7 @@
\ifempty\p_typo_items_symbol
\let\m_typo_items_symbol\firstofoneargument
\orelse\ifx\p_typo_items_symbol\v!none
- \let\p_typo_items_symbol\empty
+ \lettonothing\p_typo_items_symbol
\let\m_typo_items_symbol\firstofoneargument
\else
\doifelseconversiondefined\p_typo_items_symbol
@@ -138,7 +138,7 @@
\let\typo_items_make\relax
\def\typo_items_item_horizontal
- {\advance\c_typo_items_m\plusone
+ {\advanceby\c_typo_items_m\plusone
\csname\??itemshorizontal
\ifcsname\??itemshorizontal\p_typo_items_align\endcsname
\p_typo_items_align
@@ -148,7 +148,7 @@
\endcsname}
\def\typo_items_item_vertical
- {\advance\c_typo_items_m\plusone
+ {\advanceby\c_typo_items_m\plusone
\csname\??itemsvertical
\ifcsname\??itemsvertical\p_typo_items_align\endcsname
\p_typo_items_align
@@ -169,7 +169,7 @@
{\simplealignedbox\scratchwidth\m_typo_items_align}
\def\typo_items_make_horizontal#1%
- {\divide\scratchwidth\c_typo_items_n
+ {\divideby\scratchwidth\c_typo_items_n
\hbox{#1}}
\def\typo_items_make_vertical#1%
@@ -197,7 +197,7 @@
\defineitems[\v!top][\c!width=\d_typo_items_text_width,\c!textalign=\itemsparameter\c!align]
-\setvalue{\??itemsalternatives\v!top}#1%
+\defcsname\??itemsalternatives\v!top\endcsname#1%
{\let\typo_items_make\typo_items_make_horizontal
\let\typo_items_item\typo_items_item_horizontal
\typo_items_construct_items_boxes{#1}%
@@ -213,7 +213,7 @@
\defineitems[\v!bottom][\c!width=\d_typo_items_text_width,\c!textalign=\itemsparameter\c!align]
-\setvalue{\??itemsalternatives\v!bottom}#1%
+\defcsname\??itemsalternatives\v!bottom\endcsname#1%
{\let\typo_items_make\typo_items_make_horizontal
\let\typo_items_item\typo_items_item_horizontal
\typo_items_construct_items_boxes{#1}%
@@ -229,7 +229,7 @@
\defineitems[\v!inmargin][\c!width=1.5\emwidth,\c!align=\v!flushright,\c!distance=\leftmargindistance]
-\setvalue{\??itemsalternatives\v!inmargin}#1%
+\defcsname\??itemsalternatives\v!inmargin\endcsname#1%
{\let\typo_items_make\typo_items_make_vertical
\let\typo_items_item\typo_items_item_vertical
\typo_items_construct_items_boxes{#1}%
@@ -242,10 +242,10 @@
\defineitems[\v!left][\c!width=1.5\emwidth,\c!align=\v!flushleft]
-\setvalue{\??itemsalternatives\v!left}#1%
+\defcsname\??itemsalternatives\v!left\endcsname#1%
{\let\typo_items_make\typo_items_make_vertical
\let\typo_items_item\typo_items_item_vertical
- \advance\d_typo_items_text_width-\dimexpr\d_typo_items_symbol_width+\d_typo_items_distance\relax
+ \advanceby\d_typo_items_text_width-\dimexpr\d_typo_items_symbol_width+\d_typo_items_distance\relax
\typo_items_construct_items_boxes{#1}%
\noindent\hbox\bgroup
\ifvoid\b_typo_items_symbols \else
@@ -257,10 +257,10 @@
\defineitems[\v!right][\c!width=1.5\emwidth,\c!align=\v!flushright]
-\setvalue{\??itemsalternatives\v!right}#1%
+\defcsname\??itemsalternatives\v!right\endcsname#1%
{\let\typo_items_make\typo_items_make_vertical
\let\typo_items_item\typo_items_item_vertical
- \advance\d_typo_items_text_width-\dimexpr\d_typo_items_symbol_width+\d_typo_items_distance\relax
+ \advanceby\d_typo_items_text_width-\dimexpr\d_typo_items_symbol_width+\d_typo_items_distance\relax
\typo_items_construct_items_boxes{#1}%
\noindent\hbox\bgroup
\box\b_typo_items_texts
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-krn.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-krn.lmt
index a8ccedccf44..65068d89733 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-krn.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-krn.lmt
@@ -24,13 +24,12 @@ local nodepool = nuts.pool
-- check what is used
local find_node_tail = nuts.tail
-local flush_node = nuts.flush_node
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
-local end_of_math = nuts.end_of_math
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
+local endofmath = nuts.endofmath
local copy_node = nuts.copy
-local find_attribute = nuts.find_attribute
-local unset_attributes = nuts.unset_attributes
+local findattribute = nuts.findattribute
+local unsetattributes = nuts.unsetattributes
local getnext = nuts.getnext
local getprev = nuts.getprev
@@ -130,7 +129,7 @@ local factors = kerns.factors
-- make sure it runs after all others
-- there will be a width adaptor field in nodes so this will change
-- todo: interchar kerns / disc nodes / can be made faster
--- todo: use insert_before etc
+-- todo: use insertbefore etc
local gluefactor = 4 -- assumes quad = .5 enspace
@@ -208,7 +207,7 @@ local function kern_injector(fillup,kern)
if fillup then
local g = new_glue(kern)
setfield(g,"stretch",kern)
- setfield(g,"stretch_order",1)
+ setfield(g,"stretchorder",1)
return g
else
return new_kern(kern)
@@ -221,22 +220,7 @@ end
local function inject_begin(boundary,prev,keeptogether,krn,ok) -- prev is a glyph
local char, id = isglyph(boundary)
- if id == kern_code then
- if getsubtype(boundary) == fontkern_code then
- local inject = true
- if keeptogether then
- local next = getnext(boundary)
- if not next or (getid(next) == glyph_code and keeptogether(prev,next)) then
- inject = false
- end
- end
- if inject then
- -- not yet ok, as injected kerns can be overlays (from node-inj.lua)
- setkern(boundary,getkern(boundary) + quaddata[getfont(prev)]*krn,userkern_code)
- return boundary, true
- end
- end
- elseif char then
+ if char then
if keeptogether and keeptogether(boundary,prev) then
-- keep 'm
else
@@ -250,29 +234,29 @@ local function inject_begin(boundary,prev,keeptogether,krn,ok) -- prev is a glyp
return kern, true
end
end
- end
- return boundary, ok
-end
-
-local function inject_end(boundary,next,keeptogether,krn,ok)
- local tail = find_node_tail(boundary)
- local char, id = isglyph(tail)
- if id == kern_code then
- if getsubtype(tail) == fontkern_code then
+ elseif id == kern_code then
+ if getsubtype(boundary) == fontkern_code then
local inject = true
if keeptogether then
- local prev = getprev(tail)
- if getid(prev) == glyph_code and keeptogether(prev,two) then
+ local next = getnext(boundary)
+ if not next or (getid(next) == glyph_code and keeptogether(prev,next)) then
inject = false
end
end
if inject then
-- not yet ok, as injected kerns can be overlays (from node-inj.lua)
- setkern(tail,getkern(tail) + quaddata[getfont(next)]*krn,userkern_code)
+ setkern(boundary,getkern(boundary) + quaddata[getfont(prev)]*krn,userkern_code)
return boundary, true
end
end
- elseif char then
+ end
+ return boundary, ok
+end
+
+local function inject_end(boundary,next,keeptogether,krn,ok)
+ local tail = find_node_tail(boundary)
+ local char, id = isglyph(tail)
+ if char then
if keeptogether and keeptogether(tail,two) then
-- keep 'm
else
@@ -286,6 +270,21 @@ local function inject_end(boundary,next,keeptogether,krn,ok)
return boundary, true
end
end
+ elseif id == kern_code then
+ if getsubtype(tail) == fontkern_code then
+ local inject = true
+ if keeptogether then
+ local prev = getprev(tail)
+ if getid(prev) == glyph_code and keeptogether(prev,two) then
+ inject = false
+ end
+ end
+ if inject then
+ -- not yet ok, as injected kerns can be overlays (from node-inj.lua)
+ setkern(tail,getkern(tail) + quaddata[getfont(next)]*krn,userkern_code)
+ return boundary, true
+ end
+ end
end
return boundary, ok
end
@@ -332,7 +331,7 @@ local function process_list(head,keeptogether,krn,font,okay)
-- if kerns then
-- print("it happens indeed, basemode kerns not yet injected")
-- end
- insert_node_before(head,start,new_kern((kerns and kerns[char] or 0) + kern))
+ insertnodebefore(head,start,new_kern((kerns and kerns[char] or 0) + kern))
okay = true
end
end
@@ -366,7 +365,7 @@ local function closest_bound(b,get)
end
function kerns.handler(head)
- local _, start = find_attribute(head, a_kerns)
+ local _, start = findattribute(head, a_kerns)
if start then
local lastfont = nil
local keepligature = kerns.keepligature
@@ -415,7 +414,7 @@ function kerns.handler(head)
setattr(n,a_kerns,attr) -- we took away the attr
end
setchar(n,unicode[i])
- insert_node_after(head,s,n)
+ insertnodeafter(head,s,n)
s = n
end
end
@@ -447,10 +446,10 @@ function kerns.handler(head)
local data = chardata[font][prevchar]
local kerns = data and data.kerns
local kern = (kerns and kerns[char] or 0) + quaddata[font]*krn
- insert_node_before(head,start,kern_injector(fillup,kern))
+ insertnodebefore(head,start,kern_injector(fillup,kern))
end
else
- insert_node_before(head,start,kern_injector(fillup,quaddata[font]*krn))
+ insertnodebefore(head,start,kern_injector(fillup,quaddata[font]*krn))
end
end
prev = start
@@ -539,7 +538,7 @@ function kerns.handler(head)
elseif id == glue_code then
local subtype = getsubtype(start)
if subtype == userskip_code or subtype == xspaceskip_code or subtype == spaceskip_code then
- local width, stretch, shrink, stretch_order, shrink_order = getglue(start)
+ local width, stretch, shrink, stretchorder, shrinkorder = getglue(start)
if width > 0 then
local w = width + gluefactor * width * krn
stretch = stretch * w / width
@@ -547,10 +546,10 @@ function kerns.handler(head)
if fillup then
stretch = 2 * stretch
shrink = 2 * shrink
- stretch_order = 1
- -- shrink_order = 1 ?
+ stretchorder = 1
+ -- shrinkorder = 1 ?
end
- setglue(start,w,stretch,shrink,stretch_order,shrink_order)
+ setglue(start,w,stretch,shrink,stretchorder,shrinkorder)
end
end
bound = false
@@ -560,16 +559,16 @@ function kerns.handler(head)
-- special case
local b, f = closest_bound(start,getprev)
if b then
- insert_node_before(head,start,kern_injector(fillup,quaddata[f]*krn))
+ insertnodebefore(head,start,kern_injector(fillup,quaddata[f]*krn))
end
local b, f = closest_bound(start,getnext)
if b then
- insert_node_after(head,start,kern_injector(fillup,quaddata[f]*krn))
+ insertnodeafter(head,start,kern_injector(fillup,quaddata[f]*krn))
end
end
bound = false
elseif id == math_code then
- start = end_of_math(start)
+ start = endofmath(start)
bound = false
end
if start then
@@ -590,7 +589,7 @@ function kerns.handler(head)
end
end
if done then
- -- unset_attributes(a_kerns, head)
+ -- unsetattributes(a_kerns, head)
end
end
return head
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-lan.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-lan.lmt
new file mode 100644
index 00000000000..21aead80c3f
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-lan.lmt
@@ -0,0 +1,89 @@
+if not modules then modules = { } end modules ['typo-lan'] = {
+ version = 1.001,
+ comment = "companion to typo-lan.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local type, next = type, next
+
+local currentfont = font.current
+local setmetatableindex = table.setmetatableindex
+local utfbyte = utf.byte
+
+local hashes = fonts.hashes
+local fontdata = hashes.characters
+local emwidths = hashes.emwidths
+
+local frequencies = languages.frequencies or { }
+languages.frequencies = frequencies
+
+local frequencydata = { }
+local frequencyfile = string.formatters["lang-frq-%s.lua"]
+local frequencycache = { }
+
+setmetatableindex(frequencydata, function(t,language)
+ local fullname = resolvers.findfile(frequencyfile(language))
+ local v = fullname ~= "" and dofile(fullname)
+ if not v or not v.frequencies then
+ v = t.en
+ end
+ t[language] = v
+ return v
+end)
+
+setmetatableindex(frequencycache, function(t,language)
+ local dataset = frequencydata[language]
+ local frequencies = dataset.frequencies
+ if not frequencies then
+ return t.en
+ end
+ local v = { }
+ setmetatableindex(v, function(t,font)
+ local average = emwidths[font] / 2
+ if frequencies then
+ local characters = fontdata[font]
+ local sum, tot = 0, 0
+ for k, v in next, frequencies do
+ local character = characters[k] -- characters[type(k) == "number" and k or utfbyte(k)]
+ tot = tot + v
+ sum = sum + v * (character and character.width or average)
+ end
+ average = sum / tot -- widths
+ end
+ t[font] = average
+ return average
+ end)
+ t[language] = v
+ return v
+end)
+
+function frequencies.getdata(language)
+ return frequencydata[language]
+end
+
+function frequencies.averagecharwidth(language,font)
+ return frequencycache[language or "en"][font or currentfont()]
+end
+
+-- Just because we can, we also have a setter ...
+
+local dimension_value = tokens.values.dimension
+local scanstring = tokens.scanners.string
+local scandimension = tokens.scanners.dimension
+
+interfaces.implement {
+ name = "languagecharwidth",
+ public = true,
+ usage = "value",
+ actions = function(what)
+ local language = scanstring()
+ local font = currentfont()
+ if what == "value" then
+ return dimension_value, frequencycache[language][font] or 0
+ else
+ frequencycache[language][font] = scandimension(false,false,true)
+ end
+ end,
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-lan.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-lan.mkxl
index 9d137f5a561..7fc2a7b46a8 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-lan.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-lan.mkxl
@@ -15,10 +15,10 @@
\unprotect
-\registerctxluafile{typo-lan}{}
+\registerctxluafile{typo-lan}{autosuffix}
%D \macros
-%D {averagecharwidth, charwidthlanguage}
+%D {languagecharwidth, averagecharwidth, charwidthlanguage}
%D
%D This is a more \MKIV-ish variant of lang-frq.mkiv. The methods are gone as one
%D doesn't need the tables for them. The main macro is \type {\averagecharwidth}
@@ -26,39 +26,41 @@
%D
%D I finally decided to reimplement this as I needed it for a manual (which is often
%D a reason for such a rewrite). With some inspiring Porcupine Tree in the
-%D background it's not the worst thing to do.
+%D background it's not the worst thing to do. The \LMTX\ variant is a bit more
+%D flexible as it can also set, not that someone will notice.
\mutable\def\charwidthlanguage{\currentmainlanguage}
-\permanent\def\averagecharwidth {\dimexpr\clf_averagecharwidth{\charwidthlanguage}\scaledpoint\relax}
-\permanent\def\languagecharwidth#1{\dimexpr\clf_averagecharwidth{#1}\scaledpoint\relax}
-
-\protect
-
-\continueifinputfile{typo-lan.mkiv}
-
-\setuplayout[backspace=4cm]
-
-\showframe
-
-\starttext
-
-\startbuffer
-
-\mainlanguage[en] \hsize65\averagecharwidth \normalexpanded{\inleft{\the\hsize}} \input ward \par
-\mainlanguage[de] \hsize65\averagecharwidth \normalexpanded{\inleft{\the\hsize}} \input ward \par
-\mainlanguage[nl] \hsize65\averagecharwidth \normalexpanded{\inleft{\the\hsize}} \input ward \par
-
-\stopbuffer
-
-\getbuffer \blank
-
-\switchtobodyfont[pagella]
-
-\getbuffer \blank
-
-\switchtobodyfont[tt,8pt]
-
-\getbuffer
-
-\stoptext
+% \languagecharwidth{language} is defined at the lua end
+
+\permanent\def\averagecharwidth{\languagecharwidth{\charwidthlanguage}}
+
+\protect \endinput
+
+% \setuplayout[backspace=4cm]
+%
+% \showframe
+%
+% \starttext
+%
+% \startbuffer
+%
+% \mainlanguage[en] \hsize65\averagecharwidth \normalexpanded{\inleft{\the\hsize}} \input ward \par
+% \mainlanguage[de] \hsize65\averagecharwidth \normalexpanded{\inleft{\the\hsize}} \input ward \par
+% \mainlanguage[nl] \hsize65\averagecharwidth \normalexpanded{\inleft{\the\hsize}} \input ward \par
+%
+% \languagecharwidth{de}=\languagecharwidth{en}
+%
+% \stopbuffer
+%
+% \getbuffer \blank
+%
+% \switchtobodyfont[pagella]
+%
+% \getbuffer \blank
+%
+% \switchtobodyfont[tt,8pt]
+%
+% \getbuffer
+%
+% \stoptext
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-lbx.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-lbx.lmt
new file mode 100644
index 00000000000..55b9a9ca732
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-lbx.lmt
@@ -0,0 +1,251 @@
+if not modules then modules = { } end modules ['typo-lbx'] = {
+ version = 1.001,
+ optimize = true,
+ comment = "companion to typo-lbx.mkxl",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local context = context
+
+local tostring = tostring
+
+local nuts = nodes.nuts
+local tonut = nodes.tonut
+local tonode = nodes.tonode
+
+local left_box_code = nodes.listcodes.left
+local right_box_code = nodes.listcodes.right
+local local_box_code = nodes.listcodes["local"]
+local hlist_code = nodes.nodecodes.hlist
+
+-- some can go:
+
+local getlist = nuts.getlist
+local getprev = nuts.getprev
+local getnext = nuts.getnext
+local getattribute = nuts.getattribute
+local gettail = nuts.tail
+local getwidth = nuts.getwidth
+local getboth = nuts.getboth
+local getindex = nuts.getindex
+local setlist = nuts.setlist
+local flushlist = nuts.flushlist
+local takebox = nuts.takebox
+local setbox = nuts.setbox
+local copynode = nuts.copynode
+local rangedimensions = nuts.rangedimensions
+local traverse_list = nuts.traversers.list
+
+----- setlocalbox = tex.setlocalbox -- todo: also in node.direct namespace
+----- getlocalbox = tex.getlocalbox -- todo: also in node.direct namespace
+
+local expandmacro = token.expandmacro
+
+local dimension_value = tokens.values.dimension
+local integer_value = tokens.values.integer
+
+local implement = interfaces.implement
+
+typesetters = typesetters or { }
+local typesetters = typesetters
+
+typesetters.localboxes = typesetters.localboxes or { }
+local localboxes = typesetters.localboxes
+
+local a_localboxesmark = attributes.private("localboxesmark")
+
+local starttiming = statistics.starttiming
+local stoptiming = statistics.stoptiming
+
+do
+ local lb_found = nil
+ local lb_index = 0
+ local lb_linenumber = 0
+ local lb_linewidth = 0
+ local lb_localwidth = 0
+ local lb_progress = 0
+ local lb_leftoffset = 0
+ local lb_rightoffset = 0
+ local lb_leftskip = 0
+ local lb_rightskip = 0
+ local lb_lefthang = 0
+ local lb_righthang = 0
+ local lb_indent = 0
+ local lb_parfillleftskip = 0
+ local lb_parfillrightskip = 0
+ local lb_parinitleftskip = 0
+ local lb_parinitrightskip = 0
+ local lb_overshoot = 0
+
+ implement { name = "localboxindex", public = true, usage = "value", actions = function() return integer_value, lb_index end }
+ implement { name = "localboxlinenumber", public = true, usage = "value", actions = function() return integer_value, lb_linenumber end }
+ implement { name = "localboxlinewidth", public = true, usage = "value", actions = function() return dimension_value, lb_linewidth end }
+ implement { name = "localboxlocalwidth", public = true, usage = "value", actions = function() return dimension_value, lb_localwidth end }
+ implement { name = "localboxprogress", public = true, usage = "value", actions = function() return dimension_value, lb_progress end }
+ implement { name = "localboxleftoffset", public = true, usage = "value", actions = function() return dimension_value, lb_leftoffset end }
+ implement { name = "localboxrightoffset", public = true, usage = "value", actions = function() return dimension_value, lb_rightoffset end }
+ implement { name = "localboxleftskip", public = true, usage = "value", actions = function() return dimension_value, lb_leftskip end }
+ implement { name = "localboxrightskip", public = true, usage = "value", actions = function() return dimension_value, lb_rightskip end }
+ implement { name = "localboxlefthang", public = true, usage = "value", actions = function() return dimension_value, lb_lefthang end }
+ implement { name = "localboxrighthang", public = true, usage = "value", actions = function() return dimension_value, lb_righthang end }
+ implement { name = "localboxindent", public = true, usage = "value", actions = function() return dimension_value, lb_indent end }
+ implement { name = "localboxparfillleftskip", public = true, usage = "value", actions = function() return dimension_value, lb_parfillleftskip end }
+ implement { name = "localboxparfillrightskip", public = true, usage = "value", actions = function() return dimension_value, lb_parfillrightskip end }
+ implement { name = "localboxparinitleftskip", public = true, usage = "value", actions = function() return dimension_value, lb_parinitleftskip end }
+ implement { name = "localboxparinitrightskip", public = true, usage = "value", actions = function() return dimension_value, lb_parinitrightskip end }
+ implement { name = "localboxovershoot", public = true, usage = "value", actions = function() return dimension_value, lb_overshoot end }
+
+ local cache = table.setmetatableindex(function(t,k)
+ local v = { n = 0, m = 0 }
+ t[k] = v
+ return v
+ end)
+
+ -- todo: use a simple usernode that refers to a cache so that we don't need to
+ -- make copies
+
+ implement {
+ name = "localboxmarkonce",
+ public = true,
+ arguments = "integer",
+ actions = function(attr)
+ local c = cache[attr]
+ local n = c.n
+-- first test this:
+-- if n == c.m then
+-- print("all false",attr,n)
+-- -- all false
+-- n = 1
+-- c.m = 0
+-- else
+ n = n + 1
+-- end
+ c[n] = true
+ c.n = n
+ context(n)
+ end
+ }
+
+ local function action(current)
+ local list = getlist(current)
+ if list then
+ local attr = getattribute(list,a_localboxesmark) or 0
+ local cach = attr and cache[lb_index]
+ local once = cach and cach[attr]
+ if once == false then
+ setlist(current)
+ flushlist(list)
+ else
+ setlist(current)
+ local head = copynode(current)
+ setlist(head,list)
+ setbox("localboxcontentbox",head)
+ expandmacro("localboxcommand") -- no longer pass arguments
+ local box = takebox("localboxcontentbox")
+ setlist(current,box)
+ if once and cach[attr] == true then
+ cach[attr] = false
+ cach.m = cach.m + 1
+ end
+ end
+ end
+ end
+
+ -- these two are now more or less the same so ... todo: add
+ -- warning about non zero width
+
+ local function processleftbox(box)
+ local list = getlist(box)
+ for current, id, subtype in traverse_list, list do
+ if subtype == local_box_code and getwidth(current) == 0 then
+ local index = getindex(current)
+ if index then
+ lb_found = current
+ lb_index = index
+ lb_progress = rangedimensions(box,list,current)
+ action(current)
+ end
+ end
+ end
+ end
+
+ local function processrightbox(box)
+ local list = getlist(box)
+ for current, id, subtype in traverse_list, list do
+ if subtype == local_box_code and getwidth(current) == 0 then
+ local index = getindex(current)
+ if index then
+ lb_found = current
+ lb_index = index
+ lb_progress = rangedimensions(box,list,current)
+ action(current)
+ end
+ end
+ end
+ end
+
+ local function processmiddlebox(box,line)
+ local list = getlist(box)
+ for current, id, subtype in traverse_list, list do
+ if subtype == local_box_code and getwidth(current) == 0 then
+ local index = getindex(current)
+ if index then
+ lb_found = current
+ lb_index = index
+ lb_progress = rangedimensions(line,getlist(line),box)
+ action(current)
+ end
+ end
+ end
+ end
+
+ local function processlocalboxes(line,leftbox,rightbox,middlebox,linenumber,leftskip,rightskip,lefthang,righthang,indent,parinitleftskip,parinitrightskip,parfillleftskip,parfillrightskip,overshoot)
+ --
+ lb_found = nil
+ lb_index = 0
+ lb_linenumber = linenumber
+ lb_progress = 0
+ lb_leftskip = leftskip
+ lb_rightskip = rightskip
+ lb_lefthang = lefthang
+ lb_righthang = righthang
+ lb_indent = indent
+ lb_parfillleftskip = parfillleftskip
+ lb_parfillrightskip = parfillrightskip
+ lb_parinitleftskip = parinitleftskip
+ lb_parinitrightskip = parinitrightskip
+ lb_overshoot = overshoot
+ lb_linewidth = getwidth(line)
+ -- only true for some cases
+ lb_leftoffset = leftskip + lefthang + parfillleftskip + parinitleftskip + indent
+ lb_rightoffset = rightskip + righthang + parfillrightskip + parinitrightskip - overshoot
+ --
+ if leftbox then
+ lb_localwidth = getwidth(leftbox)
+ processleftbox(leftbox)
+ end
+ if middlebox then
+ lb_localwidth = getwidth(middlebox)
+ processmiddlebox(middlebox,line)
+ end
+ if rightbox then
+ lb_localwidth = getwidth(rightbox)
+ processrightbox(rightbox)
+ end
+ end
+
+ typesetters.localboxes.handler = processlocalboxes
+
+end
+
+local localboxactions = nodes.tasks.actions("localboxes")
+
+function builders.local_box_filter(...)
+ starttiming(builders)
+ localboxactions(...)
+ stoptiming(builders)
+end
+
+callbacks.register("local_box_filter", builders.local_box_filter, "process local boxes")
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-lbx.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-lbx.mkxl
new file mode 100644
index 00000000000..93a2fc86fa8
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-lbx.mkxl
@@ -0,0 +1,378 @@
+%D \module
+%D [ file=typo-lbx,
+%D version=2021.10.10,
+%D title=\CONTEXT\ Typesetting Macros,
+%D subtitle=Local Boxes,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%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 Typesetting Macros / Local Boxes}
+
+% This time the usual musical timestamp is: New Scary Goldings ft. John Scofield
+% MonoNeon & Louis Cole (late October 2021) (plus the playlist in loop mode) and
+% further improved after watching Cory Wong's LIVE IN MPLS (9 FEB 2019) concert.
+
+% maybe: \iflocalbox 0/1/2
+
+\registerctxluafile{typo-lbx}{autosuffix}
+
+%D The advantage is that it's deal with in the par builder which has some advantages
+%D but when used in complex situation there can be side effects. Therefore is should
+%D be considered a somewhat low level mechanism on top of which one can write more
+%D mechanisms that provide more rendering control. Also, keep in mind that combining
+%D many instances at the same time add some complizity. Therefore, for the moment it's
+%D a playground.
+
+\unprotect
+
+\def\typo_localboxes_reset
+ {\localleftbox {}% no index here, works grouped
+ \localrightbox {}%
+ \localmiddlebox{}}
+
+\appendtoks
+ \typo_localboxes_reset
+\to\everyforgetall
+
+\definesystemattribute[localboxesmark][public]
+
+%D We used to pass arguments but there might be many so ...
+
+\newbox\localboxcontentbox
+
+\installcorenamespace{localboxes}
+\installcorenamespace{localboxesattribute}
+\installcorenamespace{localboxesnamespace}
+\installcorenamespace{localboxeslocations}
+\installcorenamespace{localboxesresetters}
+
+\installcommandhandler \??localboxes {localboxes} \??localboxes
+
+\setuplocalboxes
+ [\c!command=\localboxcontent,
+ \c!width=\zeropoint,
+ \c!location=\v!left,
+ \c!distance=\zeropoint]
+
+\newinteger\c_typo_localboxes
+\newinteger\c_typo_localboxes_index
+
+\appendtoks
+ \global\advanceby\c_typo_localboxes\plusone
+ \global\expandafter\integerdef\csname\??localboxesattribute\currentlocalboxes\endcsname\c_typo_localboxes
+ \gletcsname\??localboxesnamespace\number\c_typo_localboxes\endcsname\currentlocalboxes
+\to \everydefinelocalboxes
+
+%D The optional argument forces setting the \quote {whole} paragraph properties (which is needed
+%D when the assignment happens after e.g.\ \type {\everypar} but is also meant for the first
+%D line.
+
+%D Todo: reserve index 1 for this:
+
+\def\typo_paragraphs_l#1{\localleftbox \ifcstok{#1}\v!global par\fi}
+\def\typo_paragraphs_r#1{\localrightbox \ifcstok{#1}\v!global par\fi}
+\def\typo_paragraphs_m#1{\localmiddlebox\ifcstok{#1}\v!global par\fi}
+
+\permanent\tolerant\protected\def\leftparbox [#1]{\typo_paragraphs_l{#1}\bgroup\enforced\let\leftparbox \relax\let\next}
+\permanent\tolerant\protected\def\rightparbox [#1]{\typo_paragraphs_r{#1}\bgroup\enforced\let\rightparbox\relax\let\next}
+\permanent\tolerant\protected\def\middleparbox[#1]{\typo_paragraphs_m{#1}\bgroup\enforced\let\rightparbox\relax\let\next}
+
+% called back:
+
+\permanent\protected\def\localboxcontent
+ {\box\localboxcontentbox}
+
+\permanent\protected\def\localboxcommand
+ {\ifcsname\??localboxesnamespace\number\localboxindex\endcsname
+ %\edef\currentlocalboxes{\lastnamedcs}%
+ \expandafter\let\expandafter\currentlocalboxes\lastnamedcs
+ \setbox\localboxcontentbox\hbox
+ {\uselocalboxesstyleandcolor\c!style\c!color % sometimes redundant
+ \localboxesparameter\c!command}%
+ \fi}
+
+%D We don't group because we set the local boxes. Also, watch out: by injecting the
+%D existing local box we create nested ones. This is handled in the callback but if
+%D really needed one can do something like (do we need a primitive?):
+
+\def\typo_localboxes_localbox
+ {\ifx\currentlocalboxeslocation\v!right
+ \localrightbox
+ \orelse\ifx\currentlocalboxeslocation\v!left
+ \localleftbox
+ \else
+ \localmiddlebox
+ \fi}
+
+\def\typo_localboxes_zero#1#2#3%
+ {\ifcsname\??localboxesattribute#2\endcsname
+ \c_typo_localboxes_index\lastnamedcs
+ \edef\currentlocalboxes{#2}%
+ \edef\currentlocalboxeslocation{#1}%
+ \typo_localboxes_localbox
+ index \c_typo_localboxes_index
+ \bgroup
+ \hpack
+ \ifcstok{\localboxesparameter\c!repeat}\v!no
+ attr \localboxesmarkattribute \localboxmarkonce\c_typo_localboxes_index\relax
+ \fi
+ to \zeropoint
+ \bgroup
+ \uselocalboxesstyleandcolor\c!style\c!color
+ \hbox{#3}%
+ \hss
+ \egroup
+ \egroup
+ \fi}
+
+\def\typo_localboxes_asis#1#2#3%
+ {\ifcsname\??localboxesattribute#2\endcsname
+ \c_typo_localboxes_index\lastnamedcs
+ \edef\currentlocalboxes{#2}%
+ \edef\currentlocalboxeslocation{#1}%
+ \typo_localboxes_localbox
+ index \c_typo_localboxes_index
+ \bgroup
+ \hpack
+ \ifcstok{\localboxesparameter\c!repeat}\v!no
+ attr \localboxesmarkattribute \localboxmarkonce\c_typo_localboxes_index\relax
+ \fi
+ % todo: use width if dimension, use distance if given
+ \bgroup
+ \uselocalboxesstyleandcolor\c!style\c!color
+ \hbox{#3}% no \hss
+ \egroup
+ \egroup
+ \fi}
+
+\defcsname\??localboxeslocations\v!left \endcsname{\typo_localboxes_zero\v!left }
+\defcsname\??localboxeslocations\v!right \endcsname{\typo_localboxes_zero\v!right }
+\defcsname\??localboxeslocations\v!lefttext \endcsname{\typo_localboxes_asis\v!left }
+\defcsname\??localboxeslocations\v!righttext\endcsname{\typo_localboxes_asis\v!right }
+\defcsname\??localboxeslocations\v!middle \endcsname{\typo_localboxes_asis\v!middle}
+
+\letcsname\??localboxesresetters\v!left \endcsname\v!left
+\letcsname\??localboxesresetters\v!right \endcsname\v!right
+\letcsname\??localboxesresetters\v!lefttext \endcsname\v!left
+\letcsname\??localboxesresetters\v!righttext\endcsname\v!right
+\letcsname\??localboxesresetters\v!middle \endcsname\v!middle
+
+\permanent\tolerant\protected\def\resetlocalbox[#1]%
+ {\ifcsname\??localboxesattribute#1\endcsname
+ \c_typo_localboxes_index\lastnamedcs
+ \edef\currentlocalboxes{#1}%
+ \ifcsname\??localboxesresetters\localboxesparameter\c!location\endcsname
+ \edef\currentlocalboxeslocation{\lastnamedcs}%
+ \typo_localboxes_localbox index \c_typo_localboxes_index {}%
+ \fi
+ \fi}
+
+\def\typo_localboxes_box#1%
+ {\dowithnextboxcontent
+ {\edef\currentlocalboxes{#1}%
+ \uselocalboxesstyleandcolor\c!style\c!color}
+ {\ifcsname\??localboxeslocations\namedlocalboxesparameter{#1}\c!location\endcsname
+ \expandafter\lastnamedcs
+ \else
+ \csname\??localboxeslocations\v!left\expandafter\endcsname
+ \fi{#1}{\unhbox\nextbox}}}
+
+
+\permanent\tolerant\protected\def\localbox[#1]%
+ {\typo_localboxes_box{#1}\hbox}
+
+\permanent\tolerant\protected\def\startlocalbox[#1]%
+ {\dowithnextbox
+ {\ifcsname\??localboxeslocations\namedlocalboxesparameter{#1}\c!location\endcsname
+ \expandafter\lastnamedcs
+ \else
+ \csname\??localboxeslocations\v!left\expandafter\endcsname
+ \fi{#1}{\unhbox\nextbox}}%
+ \hbox\bgroup
+ \edef\currentlocalboxes{#1}%
+ \uselocalboxesstyleandcolor\c!style\c!color
+ \enforced\def\stoplocalbox{\removeunwantedspaces\egroup}%
+ \ignorespaces}
+
+\aliased\let\stoplocalbox\donothing
+
+\permanent\tolerant\protected\def\startlocalboxrange[#1]%
+ {\globalpushmacro\stoplocalboxrange
+ \ifcsname\??localboxeslocations\namedlocalboxesparameter{#1}\c!location\endcsname
+ \lastnamedcs{#1}{}%
+ \fi}
+
+\permanent\protected\def\stoplocalboxrange
+ {\globalpopmacro\stoplocalboxrange}%
+
+% using left and right with left lagging behind:
+%
+% \permanent\protected\def\localmarginlefttext#1%
+% {\setbox\localboxcontentbox\hpack
+% {\unhbox\localboxcontentbox
+% \setbox\localboxcontentbox\lastbox
+% \unhbox\localboxcontentbox}%
+% \hpack xoffset -\dimexpr
+% #1
+% +\localboxprogress
+% +\localboxleftoffset
+% +\wd\localboxcontentbox
+% +\localboxesparameter\c!distance
+% \relax{\box\localboxcontentbox}}
+%
+% \permanent\protected\def\localmarginrighttext#1%
+% {\hpack xoffset \dimexpr
+% #1
+% +\localboxrightoffset
+% +\localboxlocalwidth
+% -\localboxprogress
+% +\localboxesparameter\c!distance
+% \relax{\box\localboxcontentbox}}
+
+% using middle:
+
+\permanent\protected\def\localmarginlefttext#1%
+ {\ifzeropt\localboxesparameter\c!width\relax
+ % a but ugly hack ... for now
+ \setbox\localboxcontentbox\hpack
+ {\unhbox\localboxcontentbox
+ \setbox\localboxcontentbox\lastbox
+ \unhbox\localboxcontentbox}%
+ \fi
+ \hpack xoffset \dimexpr
+ -#1
+ -\localboxprogress
+ -\wd\localboxcontentbox
+ -\localboxesparameter\c!distance
+ \relax{\box\localboxcontentbox}}
+
+\permanent\protected\def\localmarginrighttext#1%
+ {\hpack xoffset \dimexpr
+ #1
+ +\localboxlinewidth
+ -\localboxprogress
+ +\localboxesparameter\c!distance
+ \relax{\box\localboxcontentbox}}
+
+% todo: use generic one above
+
+\permanent\protected\def\localmargintext[#1]#2%
+ {\dontleavehmode
+ \ifcsname\??localboxesattribute#1\endcsname
+ \c_typo_localboxes_index\lastnamedcs
+ \edef\currentlocalboxes{#1}%
+ \edef\currentlocalboxeslocation{\localboxesparameter\c!location}%
+ \ifx\currentlocalboxeslocation\v!right\localrightbox\orelse\ifx\currentlocalboxeslocation\v!left\localleftbox\else\localmiddlebox\fi
+ index \c_typo_localboxes_index
+ \bgroup
+ \hpack
+ \ifcstok{\localboxesparameter\c!repeat}\v!no
+ attr \localboxesmarkattribute \localboxmarkonce\c_typo_localboxes_index\relax
+ \fi
+ to \zeropoint
+ \bgroup
+ \uselocalboxesstyleandcolor\c!style\c!color
+ \hbox{#2}%
+ \hss
+ \egroup
+ \egroup
+ \fi}
+
+\definelocalboxes
+ [\v!leftmargin]
+ [\c!command=\localmarginlefttext\zeropoint,
+ \c!repeat=\v!no,
+ \c!distance=\leftmargindistance,
+ % \c!location=\v!left]
+ \c!location=\v!middle]
+
+\definelocalboxes
+ [\v!rightmargin]
+ [\c!command=\localmarginrighttext\zeropoint,
+ \c!repeat=\v!no,
+ \c!distance=\rightmargindistance,
+ % \c!location=\v!right]
+ \c!location=\v!middle]
+
+\definelocalboxes
+ [\v!leftedge]
+ [\c!command=\localmarginlefttext\leftmargintotal,
+ \c!repeat=\v!no,
+ \c!distance=\leftedgedistance,
+ % \c!location=\v!left]
+ \c!location=\v!middle]
+
+\definelocalboxes
+ [\v!rightedge]
+ [\c!command=\localmarginrighttext\rightmargintotal,
+ \c!repeat=\v!no,
+ \c!distance=\rightedgedistance,
+ % \c!location=\v!right]
+ \c!location=\v!middle]
+
+%D Here is an example of usage:
+
+%D \starttyping
+%D \definelocalboxes
+%D [linenumber]
+%D [command=\LeftNumber,location=left,width=3em,style=\bs,color=darkred]
+%D
+%D \definelocalboxes
+%D [linenumbertwo] [linenumber]
+%D [command=\RightNumber,location=right,width=6em,style=\bf,color=darkgreen]
+%D
+%D \definelocalboxes
+%D [linetext]
+%D [command=\LeftText,location=lefttext,style=\bs,color=darkblue]
+%D
+%D \definelocalboxes
+%D [linetexttwo] [linetext]
+%D [command=\RightText,location=righttext,style=\bf,color=darkgray]
+%D
+%D % \def\LineNumberL{\the\localboxlinenumber}
+%D % \def\LineNumberR{\the\localboxlinenumber}
+%D
+%D % \newinteger\MyLineNumberL
+%D % \newinteger\MyLineNumberR
+%D % \def\LineNumberL{\global\advanceby\MyLineNumberL\plusone\the\MyLineNumberL}
+%D % \def\LineNumberR{\global\advanceby\MyLineNumberR\plusone\the\MyLineNumberR}
+%D
+%D \definecounter[MyLineNumberL]
+%D \definecounter[MyLineNumberR]
+%D
+%D \setupcounter[MyLineNumberL][numberconversion=characters]
+%D \setupcounter[MyLineNumberR][numberconversion=romannumerals]
+%D
+%D \def\LineNumberL{\incrementcounter[MyLineNumberL]\convertedcounter[MyLineNumberL]}
+%D \def\LineNumberR{\incrementcounter[MyLineNumberR]\convertedcounter[MyLineNumberR]}
+%D
+%D \protected\def\LeftNumber {\hbox to \localboxesparameter{width}{\strut(\LineNumberL\hss)}}
+%D \protected\def\RightNumber{\hbox to \localboxesparameter{width}{\strut(\hss\LineNumberR)}}
+%D
+%D % \protected\def\LeftNumber {\hbox to \localboxesparameter{width}{\strut\box\localboxcontentbox\hss)}}
+%D % \protected\def\RightNumber{\hbox to \localboxesparameter{width}{\strut(\hss\box\localboxcontentbox)}}
+%D
+%D \protected\def\LeftText {\localboxcontentbox\quad}
+%D \protected\def\RightText{\quad\localboxcontentbox}
+%D
+%D \start
+%D \localbox[linenumber]{}%
+%D \localbox[linenumbertwo]{}%
+%D \localbox[linetext]{L}%
+%D \startlocalbox[linetexttwo]
+%D R
+%D \stoplocalbox
+%D \dorecurse{100}{
+%D \samplefile{tufte}
+%D \par
+%D }
+%D \stop
+%D \stoptyping
+
+\protect \endinput
+
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-lin.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-lin.lmt
index 86365c3ba03..42ee5a9576f 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-lin.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-lin.lmt
@@ -68,8 +68,8 @@ local tonut = nodes.tonut
local tonode = nodes.tonode
local nexthlist = nuts.traversers.hlist
-local insert_before = nuts.insert_before
-local insert_after = nuts.insert_after
+local insertbefore = nuts.insertbefore
+local insertafter = nuts.insertafter
local getlist = nuts.getlist
local setlist = nuts.setlist
@@ -89,7 +89,7 @@ local getnormalizedline = nuts.getnormalizedline
local setprop = nuts.setprop
local getprop = nuts.rawprop -- getprop
-local effectiveglue = nuts.effective_glue
+local effectiveglue = nuts.effectiveglue
local nodepool = nuts.pool
local new_kern = nodepool.kern
@@ -99,7 +99,6 @@ local new_glue = nodepool.glue
local righttoleft_code = nodes.dirvalues.righttoleft
-local texgetcount = tex.getcount
local setmetatableindex = table.setmetatableindex
local jobpositions = job.positions
@@ -127,9 +126,9 @@ local function finalize(prop,key) -- delayed calculations
end
local kern1 = new_kern(delta)
local kern2 = new_kern(-delta)
- head = insert_before(head,head,kern1) -- setlink
- head = insert_before(head,head,pack)
- head = insert_before(head,head,kern2)
+ head = insertbefore(head,head,kern1) -- setlink
+ head = insertbefore(head,head,pack)
+ head = insertbefore(head,head,kern2)
setlist(line,head)
local where = {
pack = pack,
@@ -144,7 +143,7 @@ local function finalize(prop,key) -- delayed calculations
end
local function normalize(line,islocal) -- assumes prestine lines, nothing pre/appended
- local prop = getnormalizedline(line) -- we also can have "lineproperties" set but for a different porpose
+ local prop = getnormalizedline(line) -- we also can have "lineproperties" set but for a different purpose
local width = getwidth(line)
local hsize = islocal and width or tex.hsize
noflines = noflines + 1
@@ -193,10 +192,10 @@ local function addtoline(n,list,option)
if trace_anchors and not line.traced then
line.traced = true
local rule = new_rule(2*65536,2*65536,1*65536)
- local list = insert_before(rule,rule,new_kern(-1*65536))
+ local list = insertbefore(rule,rule,new_kern(-1*65536))
addtoline(n,list)
local rule = new_rule(2*65536,6*65536,-3*65536)
- local list = insert_before(rule,rule,new_kern(-1*65536))
+ local list = insertbefore(rule,rule,new_kern(-1*65536))
addtoline(n,list,"internal")
else
line.traced = true
@@ -214,19 +213,25 @@ local function addtoline(n,list,option)
delta = line.lefthangskip + line.leftskip
end
end
+
+ -- this is a quick hack for line numbering in aligned math but maybe we need
+ -- a signal in the properties: if getprops(n,"repositioned")
+ local xoffset = nuts.getoffsets(n)
+ delta = delta - xoffset
+
-- always kerns, also when 0 so that we can adapt but we can optimize if needed
-- by keeping a hash as long as we use the shiftinline helper .. no need to
-- optimize now .. we can also decide to put each blob in a hlist
local kern = new_kern(delta)
if tail then
- head, tail = insert_after(head,tail,kern)
+ head, tail = insertafter(head,tail,kern)
else
head, tail = kern, kern
setlist(where.pack,head)
end
- head, tail = insert_after(head,tail,blob)
+ head, tail = insertafter(head,tail,blob)
local kern = new_kern(-delta)
- head, tail = insert_after(head,tail,kern)
+ head, tail = insertafter(head,tail,kern)
--
where.head = head
where.tail = tail
@@ -256,7 +261,7 @@ local function addanchortoline(n,anchor)
end
if where.tail then
local head = where.head
- insert_before(head,head,anchor)
+ insertbefore(head,head,anchor)
else
where.tail = anchor
end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-mar.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-mar.lmt
index 7e69162a900..cf0ef39b23a 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-mar.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-mar.lmt
@@ -61,9 +61,9 @@ local v_line = variables.line
local nuts = nodes.nuts
local tonode = nuts.tonode
-local hpack_nodes = nuts.hpack
-local traverse_id = nuts.traverse_id
-local flush_node_list = nuts.flush_list
+local hpacknodes = nuts.hpack
+local traverseid = nuts.traverseid
+local flushnodelist = nuts.flushlist
local getnext = nuts.getnext
local getprev = nuts.getprev
@@ -82,8 +82,6 @@ local setwidth = nuts.setwidth
local getheight = nuts.getheight
local setattrlist = nuts.setattrlist
-
-local getbox = nuts.getbox
local takebox = nuts.takebox
local setprop = nuts.setprop
@@ -105,6 +103,7 @@ local new_usernode = nodepool.usernode
local latelua = nodepool.latelua
local texgetdimen = tex.getdimen
+
local texgetcount = tex.getcount
local texget = tex.get
@@ -251,7 +250,7 @@ function margins.save(t)
local si = store[i]
if si.name == name then
local s = remove(store,i)
- flush_node_list(s.box)
+ flushnodelist(s.box)
end
end
else
@@ -259,7 +258,7 @@ function margins.save(t)
local si = store[i]
if si.name == name then
local s = remove(store,i)
- flush_node_list(s.box)
+ flushnodelist(s.box)
end
end
end
@@ -270,8 +269,8 @@ function margins.save(t)
if t.number then
local leftmargindistance = texgetdimen("naturalleftmargindistance")
local rightmargindistance = texgetdimen("naturalrightmargindistance")
- local strutbox = getbox("strutbox")
- local _, strutht, strutdp = getwhd(strutbox)
+ local strutht = texgetdimen("strutht")
+ local strutdp = texgetdimen("strutdp")
-- better make a new table and make t entry in t
t.box = content
t.n = nofsaved
@@ -285,11 +284,11 @@ function margins.save(t)
--
t.leftmargindistance = leftmargindistance -- todo:layoutstatus table
t.rightmargindistance = rightmargindistance
- t.leftedgedistance = texgetdimen("naturalleftedgedistance")
- + texgetdimen("leftmarginwidth")
+ t.leftedgedistance = texgetdimen("naturalleftedgedistance") -- can be swapped
+ + texgetdimen("leftmarginwidth") -- can be swapped
+ leftmargindistance
- t.rightedgedistance = texgetdimen("naturalrightedgedistance")
- + texgetdimen("rightmarginwidth")
+ t.rightedgedistance = texgetdimen("naturalrightedgedistance") -- can be swapped
+ + texgetdimen("rightmarginwidth") -- can be swapped
+ rightmargindistance
t.lineheight = texgetdimen("lineheight")
--
@@ -492,9 +491,9 @@ local function markovershoot(current) -- todo: alleen als offset > line
v_anchors = v_anchors + 1
cache[v_anchors] = fastcopy(stacked)
local anchor = setanchor(v_anchors)
- -- local list = hpack_nodes(setlink(anchor,getlist(current))) -- not ok, we need to retain width
+ -- local list = hpacknodes(setlink(anchor,getlist(current))) -- not ok, we need to retain width
-- local list = setlink(anchor,getlist(current)) -- why not this ... better play safe
- local list = hpack_nodes(setlink(anchor,getlist(current)),getwidth(current),"exactly")--
+ local list = hpacknodes(setlink(anchor,getlist(current)),getwidth(current),"exactly")--
if trace_marginstack then
report_margindata("marking anchor %a",v_anchors)
end
@@ -790,7 +789,7 @@ local function flushed(scope,parent) -- current is hlist
if done then
local a = getattr(head,a_linenumber) -- hack .. we need a more decent critical attribute inheritance mechanism
if false then
- local l = hpack_nodes(head,getwidth(parent),"exactly")
+ local l = hpacknodes(head,getwidth(parent),"exactly")
setlist(parent,l)
if a then
setattr(l,a_linenumber,a)
@@ -806,7 +805,7 @@ local function flushed(scope,parent) -- current is hlist
return done, continue
end
--- only when group : vbox|vmode_par
+-- only when group : vbox|vmodepar
-- only when subtype : line, box (no indent alignment cell)
local function handler(scope,head,group)
@@ -884,9 +883,9 @@ function margins.globalhandler(head,group) -- check group
report_margindata("ignored 1, group %a, stored %s, inhibit %a",group,nofstored,inhibit)
end
return head
- elseif group == "hmode_par" then
+ elseif group == "hmodepar" then
return handler(v_global,head,group)
- elseif group == "vmode_par" then -- experiment (for alignments)
+ elseif group == "vmodepar" then -- experiment (for alignments)
return handler(v_global,head,group)
-- this needs checking as we then get quite some one liners to process and
-- we cannot look ahead then:
@@ -905,7 +904,7 @@ end
local function finalhandler(head)
if nofdelayed > 0 then
local current = head
- while current and nofdelayed > 0 do -- traverse_list
+ while current and nofdelayed > 0 do
local id = getid(current)
if id == hlist_code then -- only lines?
local a = getprop(current,"margindata")
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-mar.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-mar.mkxl
index 4862ee671ba..85161c942ef 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-mar.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-mar.mkxl
@@ -142,10 +142,10 @@
\newconditional\inhibitmargindata % This one is used at the Lua end!
\newtoks \everymargindatacontent % Later on we will set this one.
-\mutable\let\currentmargindatastrut \empty
-\mutable\let\currentmargindatawidth \empty
-\mutable\let\currentmarginfirstheight\empty
-\mutable\let\currentmarginreference \empty
+\mutable\lettonothing\currentmargindatastrut
+\mutable\lettonothing\currentmargindatawidth
+\mutable\lettonothing\currentmarginfirstheight
+\mutable\lettonothing\currentmarginreference
\appendtoks
\settrue\inhibitmargindata
@@ -161,8 +161,8 @@
% trialtypesetting: no need for margin stuff while trialing as
% is has no dimensions
-\newcount\nofmargintexts
-\newcount\c_typo_margins_n
+\newinteger\nofmargintexts
+\newinteger\c_typo_margins_n
\ifdefined\dotagmarginanchor \else \aliased\let\dotagmarginanchor\gobbleoneargument \fi
\ifdefined\dotagmargintext \else \aliased\let\dotagmargintext \gobbleoneargument \fi
@@ -174,7 +174,7 @@
\docheckpagestate\s!margintext\nofmargintexts
%\doifelserightpagestate\s!margintext\nofmargintexts\relax\relax
\realpageno\realpagestateno
- \page_layouts_swap_margins}
+ \page_layouts_swap_margins\v!margin}
\permanent\protected\def\margindata
{\iftrialtypesetting
@@ -198,7 +198,7 @@
% \doifelsenothing{#content}\donefalse\donetrue
% \doifelsetext{#content}\donetrue\donefalse
\ifparameter#content\donefalse\or\donetrue\else\donefalse\fi
- \global\advance\c_typo_margins_n\plusone
+ \global\advanceby\c_typo_margins_n\plusone
\ifdone
\edef\currentmarginreference{\margindataparameter\c!reference}%
\ifempty\currentmarginreference \else
@@ -239,7 +239,7 @@
\margindataparameter\c!command{#content}%
\endstrut
\egroup
- \let\currentmarginfirstheight\empty
+ \lettonothing\currentmarginfirstheight
\else
\setbox\nextbox\naturalhbox \currentmarginreference \bgroup
\typo_margins_data_synchronize
@@ -328,11 +328,11 @@
% \installcorenamespace{oppositemargin}
%
-% \letvalue{\??oppositemargin\v!left }\v!right
-% \letvalue{\??oppositemargin\v!right }\v!left
-% \letvalue{\??oppositemargin\v!inner }\v!outer
-% \letvalue{\??oppositemargin\v!outer }\v!inner
-% \letvalue{\??oppositemargin\v!normal}\v!normal
+% \letcsname\??oppositemargin\v!left \endcsname\v!right
+% \letcsname\??oppositemargin\v!right \endcsname\v!left
+% \letcsname\??oppositemargin\v!inner \endcsname\v!outer
+% \letcsname\??oppositemargin\v!outer \endcsname\v!inner
+% \letcsname\??oppositemargin\v!normal\endcsname\v!normal
%
% \def\oppositemargin#1%
% {\csname\??oppositemargin\ifcsname\??oppositemargin#1\endcsname#1\else\v!normal\fi\endcsname}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-ovl.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-ovl.mkxl
index b3ba2e78388..d4a0db0f16a 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-ovl.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-ovl.mkxl
@@ -30,7 +30,7 @@
%D Watch how we abuse highlights.
-\newcount\c_typo_overload_font_id
+\newinteger\c_typo_overload_font_id
\protected\def\typo_overloads_define#1%
{\begingroup
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-pag.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-pag.lmt
index 9f8a3a1f418..f8ba6822253 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-pag.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-pag.lmt
@@ -39,7 +39,7 @@ local setpenalty = nuts.setpenalty
local getwidth = nuts.getwidth
local getdepth = nuts.getdepth
-local insert_node_after = nuts.insert_after
+local insertnodeafter = nuts.insertafter
local new_penalty = nuts.pool.penalty
local trace_keeptogether = false
@@ -129,7 +129,7 @@ local function keeptogether(start,a,specification)
if getid(previous) == penalty_code then
setpenalty(previous,10000)
else
- insert_node_after(head,previous,new_penalty(10000))
+ insertnodeafter(head,previous,new_penalty(10000))
end
else
break
@@ -144,7 +144,7 @@ local function keeptogether(start,a,specification)
if getid(previous) == penalty_code then
setpenalty(previous,10000)
else
- insert_node_after(head,previous,new_penalty(10000))
+ insertnodeafter(head,previous,new_penalty(10000))
end
else
break
@@ -158,7 +158,7 @@ local function keeptogether(start,a,specification)
if getid(previous) == penalty_code then
setpenalty(previous,10000)
else
- insert_node_after(head,previous,new_penalty(10000))
+ insertnodeafter(head,previous,new_penalty(10000))
end
else
break
@@ -180,7 +180,7 @@ end
-- also look at first non glue/kern node e.g for a dropped caps
--- todo: find_attribute and unset_attributes instead of takeattr
+-- todo: findattribute and unsetattributes instead of takeattr
function parbuilders.keeptogether(head)
local done = false -- can go
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-par.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-par.lmt
index 005d1b32ecb..271a5894ac4 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-par.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-par.lmt
@@ -66,7 +66,7 @@ implement {
}
function builders.checkparcontext(where)
- if top and where == "normal" then
+ if top and (where == "normal" or where == "vmode") then -- vmode added, needs checking
if top == "cycle" then
local s = texget("parshape",true)
if s then
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-par.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-par.mkxl
index 22450e76edb..077d3566c3f 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-par.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-par.mkxl
@@ -24,7 +24,7 @@
\unprotect
%registerctxluafile{node-ltp}{optimize}
-\registerctxluafile{node-ltp}{}
+\registerctxluafile{node-ltp}{autosuffix} % this one has to be updated!
\registerctxluafile{trac-par}{}
\registerctxluafile{typo-par}{}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-pnc.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-pnc.lmt
new file mode 100644
index 00000000000..090cbb5b622
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-pnc.lmt
@@ -0,0 +1,170 @@
+if not modules then modules = { } end modules ['typo-pnc'] = {
+ version = 1.001,
+ comment = "companion to typo-pnc.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local nodes = nodes
+local fonts = fonts
+
+local enableaction = nodes.tasks.enableaction
+
+local nuts = nodes.nuts
+local tonut = nodes.tonut
+
+local nodecodes = nodes.nodecodes
+local gluecodes = nodes.gluecodes
+local glyph_code = nodecodes.glyph
+local glue_code = nodecodes.glue
+local spaceskip_code = gluecodes.spaceskip
+
+local new_kern = nuts.pool.kern
+local insertafter = nuts.insertafter
+
+local nextglyph = nuts.traversers.glyph
+
+local getchar = nuts.getchar
+local getfont = nuts.getfont
+local getboth = nuts.getboth
+local getnext = nuts.getnext
+local getattr = nuts.getattr
+local getid = nuts.getid
+local getsubtype = nuts.getsubtype
+local getwidth = nuts.getwidth
+local setwidth = nuts.setwidth
+local findattribute = nuts.findattribute
+
+local glyph_code = nodes.nodecodes.glyph
+
+local parameters = fonts.hashes.parameters
+local categories = characters.categories
+
+local texsetattribute = tex.setattribute
+local unsetvalue = attributes.unsetvalue
+
+local period = 0x2E
+local factor = 0.5
+
+-- alternative: tex.getlccode and tex.getuccode
+
+typesetters = typesetters or { }
+local typesetters = typesetters
+
+local periodkerns = typesetters.periodkerns or { }
+typesetters.periodkerns = periodkerns
+
+local report = logs.reporter("period kerns")
+local trace = false
+
+trackers.register("typesetters.periodkerns",function(v) trace = v end)
+
+periodkerns.mapping = periodkerns.mapping or { }
+periodkerns.factors = periodkerns.factors or { }
+local a_periodkern = attributes.private("periodkern")
+
+storage.register("typesetters/periodkerns/mapping", periodkerns.mapping, "typesetters.periodkerns.mapping")
+storage.register("typesetters/periodkerns/factors", periodkerns.factors, "typesetters.periodkerns.factors")
+
+local mapping = periodkerns.mapping
+local factors = periodkerns.factors
+
+function periodkerns.handler(head)
+ local _, start = findattribute(head,a_periodkern,glyph_code)
+ if start then
+ for current, char, font in nextglyph, start do
+ if char == period then
+ local a = getattr(current,a_periodkern)
+ if a then
+ local factor = mapping[a]
+ if factor then
+ local prev, next = getboth(current)
+ if prev and next and getid(prev) == glyph_code and getid(next) == glyph_code then
+ local pchar = getchar(prev)
+ local pcode = categories[pchar]
+ if pcode == "lu" or pcode == "ll" then
+ local nchar = getchar(next)
+ local ncode = categories[nchar]
+ if ncode == "lu" or ncode == "ll" then
+ local next2 = getnext(next)
+ if next2 and getid(next2) == glyph_code and getchar(next2) == period then
+ -- A.B.
+ local fontspace, inserted
+ if factor ~= 0 then
+ fontspace = parameters[getfont(current)].space -- can be sped up
+ inserted = factor * fontspace
+ insertafter(head,current,new_kern(inserted))
+ if trace then
+ report("inserting space at %C . [%p] %C .",pchar,inserted,nchar)
+ end
+ end
+ local next3 = getnext(next2)
+ if next3 and getid(next3) == glue_code and getsubtype(next3) == spaceskip_code then
+ local width = getwidth(next3)
+ local space = fontspace or parameters[getfont(current)].space -- can be sped up
+ if width > space then -- space + extraspace
+ local next4 = getnext(next3)
+ if next4 and getid(next4) == glyph_code then
+ local fchar = getchar(next4)
+ if categories[fchar] ~= "lu" then
+ -- A.B.<glue>X
+ if trace then
+ if inserted then
+ report("reverting space at %C . [%p] %C . [%p->%p] %C",pchar,inserted,nchar,width,space,fchar)
+ else
+ report("reverting space at %C . %C . [%p->%p] %C",pchar,nchar,width,space,fchar)
+ end
+ end
+ setwidth(next3,space)
+ else
+ if trace then
+ if inserted then
+ report("keeping space at %C . [%p] %C . [%p] %C",pchar,inserted,nchar,width,fchar)
+ else
+ report("keeping space at %C . %C . [%p] %C",pchar,nchar,width,fchar)
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ return head
+end
+
+local enabled = false
+
+function periodkerns.set(factor)
+ factor = tonumber(factor) or 0
+ if not enabled then
+ enableaction("processors","typesetters.periodkerns.handler")
+ enabled = true
+ end
+ local a = factors[factor]
+ if not a then
+ a = #mapping + 1
+ factors[factors], mapping[a] = a, factor
+ end
+ factor = a
+ texsetattribute(a_periodkern,factor)
+ return factor
+end
+
+-- interface
+
+interfaces.implement {
+ name = "setperiodkerning",
+ actions = periodkerns.set,
+ arguments = "string"
+}
+
+
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-pnc.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-pnc.mkxl
index b5b1a17d676..aceab268523 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-pnc.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-pnc.mkxl
@@ -19,7 +19,7 @@
% with "foo e.g.\ bar" so let's see if we can automate that and at the same time
% inject spaces between the snippets. It gets boring writing this kind of code.
-\registerctxluafile{typo-pnc}{}
+\registerctxluafile{typo-pnc}{autosuffix}
\definesystemattribute[periodkern][public,global]
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-rub.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-rub.lmt
index 82aa3c269df..0de0221ef83 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-rub.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-rub.lmt
@@ -49,7 +49,6 @@ local getwidth = nuts.getwidth
local setwidth = nuts.setwidth
local hpack = nuts.hpack
-local insert_after = nuts.insert_after
local takebox = nuts.takebox
local nextlist = nuts.traversers.list
@@ -74,6 +73,8 @@ local new_kern = nodepool.kern
local setprop = nuts.setprop
local getprop = nuts.getprop
+local findattribute = nuts.findattribute
+
local enableaction = nodes.tasks.enableaction
local nofrubies = 0
@@ -87,6 +88,12 @@ typesetters.rubies = rubies
local trace_rubies = false trackers.register("typesetters.rubies",function(v) trace_rubies = v end)
local report_rubies = logs.reporter("rubies")
+-- todo: use the more modern lmtx storage model
+
+local registervalue = attributes.registervalue
+local getvalue = attributes.getvalue
+local texsetattribute = tex.setattribute
+
do
local shared = nil
@@ -171,14 +178,16 @@ do
local function setruby(n,m)
nofrubies = nofrubies + 1
local r = takebox(n)
- rubylist[nofrubies] = setmetatableindex({
+ local t = {
text = r,
width = getwidth(r),
basewidth = 0,
start = false,
stop = false,
- }, shared)
- texsetattribute(a_ruby,nofrubies)
+ }
+ -- rubylist[nofrubies] = setmetatableindex(t,shared)
+ -- texsetattribute(a_ruby,nofrubies)
+ texsetattribute(a_ruby,registervalue(a_ruby,setmetatableindex(t,shared)))
end
implement {
@@ -189,51 +198,156 @@ do
end
+-- function rubies.check(head)
+-- local current = head
+-- local start = nil
+-- local stop = nil
+-- local found = nil
+--
+-- local function flush(where)
+-- local r = rubylist[found]
+-- if r then
+-- local prev = getprev(start)
+-- local next = getnext(stop)
+-- setprev(start)
+-- setnext(stop)
+-- local h = hpack(start)
+-- if start == head then
+-- head = h
+-- else
+-- setlink(prev,h)
+-- end
+-- setlink(h,next)
+-- local bwidth = getwidth(h)
+-- local rwidth = r.width
+-- r.basewidth = bwidth
+-- r.start = start
+-- r.stop = stop
+-- setprop(h,"ruby",found)
+-- if rwidth > bwidth then
+-- -- ruby is wider
+-- setwidth(h,rwidth)
+-- end
+-- end
+-- end
+--
+-- while current do
+-- local nx = getnext(current)
+-- local id = getid(current)
+-- if id == glyph_code then
+-- local a = getattr(current,a_ruby)
+-- if not a then
+-- if found then
+-- flush("flush 1")
+-- found = nil
+-- end
+-- elseif a == found then
+-- stop = current
+-- else
+-- if found then
+-- flush("flush 2")
+-- end
+-- found = a
+-- start = current
+-- stop = current
+-- end
+-- -- go on
+-- elseif id == kern_code and getsubtype(current,fontkern_code) then
+-- -- go on
+-- elseif found and id == disc_code then
+-- -- go on (todo: look into disc)
+-- elseif found then
+-- flush("flush 3")
+-- found = nil
+-- end
+-- current = nx
+-- end
+--
+-- if found then
+-- flush("flush 4")
+-- end
+-- return head, true -- no need for true
+-- end
+
function rubies.check(head)
- local current = head
- local start = nil
- local stop = nil
- local found = nil
-
- local function flush(where)
- local r = rubylist[found]
- if r then
- local prev = getprev(start)
- local next = getnext(stop)
- setprev(start)
- setnext(stop)
- local h = hpack(start)
- if start == head then
- head = h
- else
- setlink(prev,h)
- end
- setlink(h,next)
- local bwidth = getwidth(h)
- local rwidth = r.width
- r.basewidth = bwidth
- r.start = start
- r.stop = stop
- setprop(h,"ruby",found)
- if rwidth > bwidth then
- -- ruby is wider
- setwidth(h,rwidth)
+ local _, current = findattribute(head,a_ruby)
+ if current then
+
+ local start = nil
+ local stop = nil
+ local found = nil
+
+ local function flush(where)
+-- local r = rubylist[found]
+local r = getvalue(a_ruby,found)
+ if r then
+ -- can be an option
+ while start ~= stop and getid(start) == glue_code do
+ start = getnext(start)
+ end
+ while stop ~= start and getid(stop) == glue_code do
+ stop = getprev(stop)
+ end
+ --
+ local prev = getprev(start)
+ local next = getnext(stop)
+ setprev(start)
+ setnext(stop)
+ local h = hpack(start)
+ if start == head then
+ head = h
+ else
+ setlink(prev,h)
+ end
+ setlink(h,next)
+ local bwidth = getwidth(h)
+ local rwidth = r.width
+ r.basewidth = bwidth
+ r.start = start
+ r.stop = stop
+ setprop(h,"ruby",found)
+ if rwidth > bwidth then
+ -- ruby is wider
+ setwidth(h,rwidth)
+ end
end
end
- end
- while current do
- local nx = getnext(current)
- local id = getid(current)
- if id == glyph_code then
+-- while current do
+-- local nx = getnext(current)
+-- local a = getattr(current,a_ruby)
+-- if not a then
+-- if found then
+-- flush("flush 1")
+-- found = nil
+-- end
+-- elseif a == found then
+-- stop = current
+-- else
+-- if found then
+-- flush("flush 2")
+-- end
+-- found = a
+-- start = current
+-- stop = current
+-- end
+-- current = nx
+-- end
+
+ -- todo: we can avoid a lookup
+
+ while current do
+ local nx = getnext(current)
local a = getattr(current,a_ruby)
if not a then
if found then
flush("flush 1")
found = nil
end
+_, current = findattribute(nx,a_ruby)
elseif a == found then
stop = current
+current = nx
else
if found then
flush("flush 2")
@@ -241,30 +355,26 @@ function rubies.check(head)
found = a
start = current
stop = current
+current = nx
end
- -- go on
- elseif id == kern_code and getsubtype(current,fontkern_code) then
- -- go on
- elseif found and id == disc_code then
- -- go on (todo: look into disc)
- elseif found then
- flush("flush 3")
- found = nil
end
- current = nx
+
end
+
if found then
flush("flush 4")
end
return head, true -- no need for true
end
+
local attach
local function whatever(current,list)
local a = getprop(current,"ruby")
if a then
- local ruby = rubylist[a]
+-- local ruby = rubylist[a]
+local ruby = getvalue(a_ruby,a)
local align = ruby.align or v_middle
local stretch = ruby.stretch or v_no
local hoffset = ruby.hoffset or 0
@@ -358,7 +468,7 @@ local function whatever(current,list)
setlist(current,text)
end
setprop(current,"ruby",false)
- rubylist[a] = nil
+-- rubylist[a] = nil
elseif list then
attach(list)
end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-rub.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-rub.mkxl
index b4b0cbc5ee8..79760c32880 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-rub.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-rub.mkxl
@@ -45,7 +45,8 @@
\enforced\let\ruby\noruby
\edef\currentruby{#1}%
\edef\p_location{\rubyparameter\c!location}%
- \enforced\let|\relax
+ % \enforced\let|\relax
+ \enforced\letcharcode\barasciicode\relax
\ifcsname\??rubyanalyze\p_location\endcsname
\expandafter\lastnamedcs\else\expandafter\typo_ruby_analyze
\fi{#2}{#3}%
@@ -60,7 +61,7 @@
comment {#2}
\relax}
-\setvalue{\??rubyanalyze\v!top}#1#2%
+\defcsname\??rubyanalyze\v!top\endcsname#1#2%
{\clf_ruby
align {\rubyparameter\c!align}%
stretch {\rubyparameter\c!stretch}%
@@ -70,7 +71,7 @@
comment {#2}
\relax}
-\setvalue{\??rubyplacement\v!top}#1#2%
+\defcsname\??rubyplacement\v!top\endcsname#1#2%
{\setbox\scratchbox\hbox\bgroup
\userubystyleandcolor\c!style\c!color
#2%
@@ -79,7 +80,7 @@
\relax
#1}
-\setvalue{\??rubyplacement\v!right}#1#2%
+\defcsname\??rubyplacement\v!right\endcsname#1#2%
{#1%
\edef\p_distance{\rubyparameter\c!distance}%
\ifempty\p_distance\orelse\ifx\p_distance\v!none\else\hskip\p_distance\fi
@@ -88,7 +89,7 @@
\rubyparameter\c!left#2\rubyparameter\c!right
\endgroup}
-\setvalue{\??rubyplacement\v!left}#1#2%
+\defcsname\??rubyplacement\v!left\endcsname#1#2%
{\begingroup
\userubystyleandcolor\c!style\c!color
\rubyparameter\c!left#2\rubyparameter\c!right
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-shp.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-shp.lmt
index 30719c40e28..139468a1929 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-shp.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-shp.lmt
@@ -14,7 +14,7 @@ local texset = tex.set
local texgetcount = tex.getcount
local texgetglue = tex.getglue
-local expandmacro = token.expand_macro
+local expandmacro = token.expandmacro or token.expand_macro -- todo
local implement = interfaces.implement
@@ -217,6 +217,8 @@ do
a = l + r
goto AGAIN
end
+ elseif key == "inspect" then
+ inspect(t)
else
logs.report("system","bad key %a in paragraphshape",key)
break
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-shp.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-shp.mkxl
index b74003068fa..12d3c0115a8 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-shp.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-shp.mkxl
@@ -45,8 +45,21 @@
%D But we wrap this in a more abstract interface:
\installcorenamespace {parshapes}
+\installcorenamespace {shapedparagraph}
-\aliased\let\stopparagraphshape\relax
+\installbasicnativeautosetuphandler \??shapedparagraph {shapedparagraph}
+
+\setupshapedparagraph
+ [\c!method=,
+ \c!list=,
+ \c!lines=\zerocount,
+ \c!mp=,
+ \c!repeat=,
+ \c!hoffset=\zeropoint,
+ \c!voffset=\zeropoint,
+ \c!distance=\zeropoint]
+
+\permanent\protected\lettonothing\stopparagraphshape
\permanent\protected\def\startparagraphshape[#1]#2\stopparagraphshape
{\gdefcsname\??parshapes#1\endcsname{#2}} % global
@@ -62,28 +75,111 @@
\def\spac_shapes_calculate#1% called locally in \LUA
{\startMPcalculation \includeMPgraphic{#1} \stopMPcalculation}
-\permanent\protected\tolerant\def\startshapedparagraph[#1]% no grouping
- {\begingroup
- \getdummyparameters[\c!method=,\c!list=,\c!mp=,\c!repeat=,#1]%
- \edef\p_mp {\dummyparameter\c!mp}%
- \edef\p_repeat{\dummyparameter\c!repeat}%
- \setlocalhsize
+% \permanent\protected\tolerant\def\startshapedparagraph[#1]% no grouping
+% {\begingroup
+% \lettonothing\currentshapedparagraph
+% \setupshapedparagraph[#1]%
+% \edef\p_mp {\shapedparagraphparameter\c!mp}%
+% \edef\p_repeat{\shapedparagraphparameter\c!repeat}%
+% \setlocalhsize
+% \normalexpanded
+% {\endgroup
+% \ifempty\p_mp
+% \setparagraphshape[\shapedparagraphparameter\c!list]%
+% \else
+% \setparagraphmetashape[\shapedparagraphparameter\c!mp][\ifx\p_repeat\v!yes repeat\fi]%
+% \fi
+% \pushparagraphtweak{\shapedparagraphparameter\c!method}\relax}}
+
+\newbox\b_spac_shapes
+
+\def\spac_shapes_list
+ {\edef\p_mp {\shapedparagraphparameter\c!mp}%
+ \edef\p_repeat{\shapedparagraphparameter\c!repeat}%
\normalexpanded
{\endgroup
\ifempty\p_mp
- \setparagraphshape[\dummyparameter\c!list]%
+ \setparagraphshape[\shapedparagraphparameter\c!list]%
\else
- \setparagraphmetashape[\dummyparameter\c!mp][\ifx\p_repeat\v!yes repeat\fi]%
+ \setparagraphmetashape[\p_mp][\ifx\p_repeat\v!yes repeat\fi]%
\fi
- \pushparagraphtweak{\dummyparameter\c!method}\relax}}
+ \pushparagraphtweak{\shapedparagraphparameter\c!method}\relax}}
+
+\def\spac_shapes_text
+ {\getnoflines{\dimexpr\htdp\b_spac_shapes+\shapedparagraphparameter\c!voffset}%
+ \normalexpanded
+ {\endgroup
+ \clf_setparagraphshape
+ left \the\dimexpr
+ \wd\b_spac_shapes+\shapedparagraphparameter\c!distance
+ +\shapedparagraphparameter\c!hoffset
+ \relax
+ right \zeropoint
+ copy \the\numexpr
+ \noflines
+ +\shapedparagraphparameter\c!lines
+ \relax
+ left \zeropoint
+ right \zeropoint
+ % inspect
+ done
+ \relax
+ \pushparagraphtweak{shift}%
+ \dontleavehmode
+ \vtop
+ xoffset \the\dimexpr
+ -\shapedparagraphparameter\c!distance
+ -\wd\b_spac_shapes
+ \relax
+ yoffset \the\dimexpr
+ \shapedparagraphparameter\c!voffset
+ +\strutht
+ \relax
+ {\smashbox\b_spac_shapes
+ \box\b_spac_shapes}}}
+
+\def\spac_shapes_lines
+ {\normalexpanded
+ {\endgroup
+ \clf_setparagraphshape
+ left \shapedparagraphparameter\c!width
+ right \zeropoint
+ copy \shapedparagraphparameter\c!lines
+ left \zeropoint
+ right \zeropoint
+ % inspect
+ done
+ \relax
+ \pushparagraphtweak{shift}}}
+
+\permanent\protected\tolerant\def\startshapedparagraph[#1]% no grouping
+ {\begingroup
+ \lettonothing\currentshapedparagraph
+ \setupshapedparagraph[#1]%
+ \setlocalhsize
+ \doifsomething{\shapedparagraphparameter\c!text}
+ {\global\setbox\b_spac_shapes\vpack\bgroup
+ \forgetall
+ \shapedparagraphparameter\c!text
+ \egroup}%
+ \ifvoid\b_spac_shapes
+ \ifnum\shapedparagraphparameter\c!lines>\zerocount
+ \spac_shapes_lines
+ \else
+ \spac_shapes_list
+ \fi
+ \else
+ \spac_shapes_text
+ \fi
+ \ignorespaces}
\permanent\protected\def\stopshapedparagraph
{\popparagraphtweak}
%D As it is not much code we now put it here:
-\newbox \shapetextbox
-\newcount\shapetextindex
+\newbox \shapetextbox
+\newinteger\shapetextindex
\permanent\protected\def\startshapetext[#1]%
{\begingroup
@@ -94,33 +190,61 @@
\dontcomplain
\setuptolerance[\v!verytolerant,\v!stretch]% default
% \setuplayout[\c!grid=\v!yes]% goes wrong, we need a local one
- \pushparagraphtweak {shift}}
+ \pushparagraphtweak{shift}}
\permanent\protected\def\stopshapetext
{\popparagraphtweak
\egroup
\endgroup}
+% \permanent\protected\def\getshapetext
+% {\vbox\bgroup
+% \forgetall
+% \dontcomplain
+% \global\advanceby\shapetextindex\plusone
+% \scratchcounter\getshapeparameter{lines}\relax
+% \ifnum\scratchcounter>\zerocount
+% \scratchwidth \getshapeparameter{width}\scaledpoint\relax
+% \scratchheight \getshapeparameter{height}\scaledpoint\relax
+% \setbox\scratchbox\vpack to \scratchheight
+% {\splittopskip\strutheight
+% \vskip\dimexpr\getshapeparameter{voffset}\scaledpoint\relax
+% \ifcase\numexpr\getshapeparameter{first}\relax\else
+% \vskip\lineheight
+% \fi
+% \hskip\dimexpr\getshapeparameter{hoffset}\scaledpoint\relax
+% \hpack{\vsplit\shapetextbox to \scratchcounter\lineheight}}%
+% \wd\scratchbox\scratchwidth
+% \ht\scratchbox\scratchheight
+% \dp\scratchbox\zeropoint
+% \box\scratchbox
+% \else
+% % what now
+% \fi
+% \egroup}
+
\permanent\protected\def\getshapetext
{\vbox\bgroup
\forgetall
\dontcomplain
- \global\advance\shapetextindex\plusone
+ \global\advanceby\shapetextindex\plusone
\scratchcounter\getshapeparameter{lines}\relax
\ifnum\scratchcounter>\zerocount
\scratchwidth \getshapeparameter{width}\scaledpoint\relax
\scratchheight \getshapeparameter{height}\scaledpoint\relax
+ \scratchhoffset\dimexpr\getshapeparameter{hoffset}\scaledpoint\relax
+ \scratchvoffset\dimexpr\getshapeparameter{voffset}\scaledpoint\relax
\setbox\scratchbox\vpack to \scratchheight
{\splittopskip\strutheight
- \vskip\dimexpr\getshapeparameter{voffset}\scaledpoint\relax
+ \vskip\scratchvoffset
\ifcase\numexpr\getshapeparameter{first}\relax\else
\vskip\lineheight
\fi
- \hskip\dimexpr\getshapeparameter{hoffset}\scaledpoint\relax
+ \hskip\scratchhoffset
\hpack{\vsplit\shapetextbox to \scratchcounter\lineheight}}%
- \wd\scratchbox\scratchwidth
- \ht\scratchbox\scratchheight
- \dp\scratchbox\zeropoint
+ \wd\scratchbox\dimexpr\scratchwidth +\scratchhoffset\relax
+ \ht\scratchbox\dimexpr\scratchheight+\scratchvoffset\relax
+ \dp\scratchbox\strutdp % zeropoint
\box\scratchbox
\else
% what now
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-spa.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-spa.lmt
index 84dd0696d6c..88ade876ed7 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-spa.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-spa.lmt
@@ -29,12 +29,12 @@ local getprev = nuts.getprev
local getattr = nuts.getattr
local isglyph = nuts.isglyph
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local remove_node = nuts.remove
-local end_of_math = nuts.end_of_math
-local unset_attributes = nuts.unset_attributes
-local find_attribute = nuts.find_attribute
+local endofmath = nuts.endofmath
+local unsetattributes = nuts.unsetattributes
+local findattribute = nuts.findattribute
local nodepool = nuts.pool
local new_penalty = nodepool.penalty
@@ -72,7 +72,7 @@ end
-- todo cache lastattr
function spacings.handler(head)
- local _, start = find_attribute(head, a_spacings)
+ local _, start = findattribute(head, a_spacings)
if start then
local done = false
-- head is always begin of par (whatsit), so we have at least two prev nodes
@@ -96,10 +96,8 @@ function spacings.handler(head)
local ok = false
local prevprev = getprev(prev)
if alternative == 1 then
- local somespace = somespace(prev,true)
- if somespace then
- local somepenalty = somepenalty(prevprev,10000)
- if somepenalty then
+ if somespace(prev,true) then
+ if somepenalty(prevprev,10000) then
if trace_spacing then
report_spacing("removing penalty and space before %C (left)",char)
end
@@ -120,8 +118,8 @@ function spacings.handler(head)
if trace_spacing then
report_spacing("inserting penalty and space before %C (left)",char)
end
- insert_node_before(head,start,new_penalty(10000))
- insert_node_before(head,start,new_glue(left*quad))
+ insertnodebefore(head,start,new_penalty(10000))
+ insertnodebefore(head,start,new_glue(left*quad))
end
end
local next = getnext(start)
@@ -129,24 +127,19 @@ function spacings.handler(head)
local ok = false
local nextnext = getnext(next)
if alternative == 1 then
- local somepenalty = somepenalty(next,10000)
- if somepenalty then
- local somespace = somespace(nextnext,true)
- if somespace then
+ if somepenalty(next,10000) then
+ if somespace(nextnext,true) then
if trace_spacing then
report_spacing("removing penalty and space after %C right",char)
end
head = remove_node(head,next,true)
head = remove_node(head,nextnext,true)
end
- else
- local somespace = somespace(next,true)
- if somespace then
- if trace_spacing then
- report_spacing("removing space after %C (right)", char)
- end
- head = remove_node(head,next,true)
+ elseif somespace(next,true) then
+ if trace_spacing then
+ report_spacing("removing space after %C (right)", char)
end
+ head = remove_node(head,next,true)
end
ok = true
else
@@ -156,8 +149,8 @@ function spacings.handler(head)
if trace_spacing then
report_spacing("inserting penalty and space after %C (right)",char)
end
- insert_node_after(head,start,new_glue(right*quad))
- insert_node_after(head,start,new_penalty(10000))
+ insertnodeafter(head,start,new_glue(right*quad))
+ insertnodeafter(head,start,new_penalty(10000))
end
end
end
@@ -165,14 +158,14 @@ function spacings.handler(head)
done = true
end
elseif id == math_code then
- start = end_of_math(start) -- weird, can return nil .. no math end?
+ start = endofmath(start) -- weird, can return nil .. no math end?
end
if start then
start = getnext(start)
end
end
if done then
- -- unset_attributes(a_spacings,head)
+ -- unsetattributes(a_spacings,head)
end
end
return head
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-sus.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-sus.lmt
index 2c6d9ea69c9..b8d0d1cd97e 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-sus.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-sus.lmt
@@ -59,9 +59,9 @@ local setattr = nuts.setattr
local setlist = nuts.setlist
local setcolor = nodes.tracers.colors.set
-local insert_before = nuts.insert_before
-local insert_after = nuts.insert_after
-local end_of_math = nuts.end_of_math
+local insertbefore = nuts.insertbefore
+local insertafter = nuts.insertafter
+local endofmath = nuts.endofmath
local nodepool = nuts.pool
@@ -127,22 +127,22 @@ local function mark(head,current,id,color)
local width = getwidth(current)
local rule = new_rule(width)
local kern = new_kern(-width)
- head = insert_before(head,current,rule)
- head = insert_before(head,current,kern)
+ head = insertbefore(head,current,rule)
+ head = insertbefore(head,current,kern)
setcolor(rule,color)
-- elseif id == kern_code then
-- local width = getkern(current)
-- local rule = new_rule(width)
-- local kern = new_kern(-width)
- -- head = insert_before(head,current,rule)
- -- head = insert_before(head,current,kern)
+ -- head = insertbefore(head,current,rule)
+ -- head = insertbefore(head,current,kern)
-- setcolor(rule,color)
else
local width, height, depth = getwhd(current)
local extra = fonts.hashes.xheights[getfont(current)] / 2
local rule = new_rule(width,height+extra,depth+extra)
local hlist = new_hlist(rule)
- head = insert_before(head,current,hlist)
+ head = insertbefore(head,current,hlist)
setcolor(rule,color)
setcolor(current,"white")
end
@@ -230,7 +230,7 @@ function typesetters.marksuspects(head)
end
current = getnext(current)
elseif id == math_code then
- current = getnext(end_of_math(current))
+ current = getnext(endofmath(current))
elseif id == glue_code then
local a = getattr(current,a_characters)
if a then
@@ -273,7 +273,7 @@ local function showsuspects(head)
head, current = mark(head,current,id,colors[a])
end
elseif id == math_code then
- current = end_of_math(current)
+ current = endofmath(current)
elseif id == hlist_code or id == vlist_code then
local list = getlist(current)
if list then
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-syn.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-syn.lmt
new file mode 100644
index 00000000000..53e5763919a
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-syn.lmt
@@ -0,0 +1,668 @@
+if not modules then modules = { } end modules ['typo-syn'] = {
+ version = 1.000,
+ optimize = true,
+ comment = "companion to typo-syn.mkxl",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- For the moment we have the splitter here but it actually belongs
+-- in the builders namespace.
+
+local nodes = nodes
+
+local tasks = nodes.tasks
+local enableaction = tasks.enableaction
+----- disableaction = tasks.disableaction
+
+local nuts = nodes.nuts
+local tonut = nodes.tonut
+
+local getattr = nuts.getattr
+local getattrlist = nuts.getattrlist
+local getdepth = nuts.getdepth
+local getdirection = nuts.getdirection
+local getdisc = nuts.getdisc
+local getglue = nuts.getglue
+local getheight = nuts.getheight
+local getid = nuts.getid
+local getlist = nuts.getlist
+local getnext = nuts.getnext
+local getprev = nuts.getprev
+local getprop = nuts.getprop
+local getsubtype = nuts.getsubtype
+local gettotal = nuts.gettotal
+local getwhd = nuts.getwhd
+local getwidth = nuts.getwidth
+local setattrlist = nuts.setattrlist
+local setdepth = nuts.setdepth
+local setdisc = nuts.setdisc
+local setheight = nuts.setheight
+local setlink = nuts.setlink
+local setlist = nuts.setlist
+local setnext = nuts.setnext
+local setoffsets = nuts.setoffsets
+local setprev = nuts.setprev
+local setprop = nuts.setprop
+local setwidth = nuts.setwidth
+
+local hpack = nuts.hpack
+local rangedimensions = nuts.rangedimensions
+local insertbefore = nuts.insertbefore
+local insertafter = nuts.insertafter
+local removenode = nuts.remove
+local flushnode = nuts.flush
+
+local traverselist = nuts.traverselist
+
+local nodecodes = nodes.nodecodes
+local glyph_code = nodecodes.glyph
+local rule_code = nodecodes.rule
+local dir_code = nodecodes.dir
+local disc_code = nodecodes.disc
+local hlist_code = nodecodes.hlist
+local vlist_code = nodecodes.vlist
+local math_code = nodecodes.math
+local glue_code = nodecodes.glue
+local kern_code = nodecodes.kern
+local penalty_code = nodecodes.penalty
+
+local line_code = nodes.listcodes.line
+local fontkern_code = nodes.kerncodes.fontkern
+local parfillskip_code = nodes.gluecodes.parfillrightskip
+local baselineskip_code = nodes.gluecodes.baselineskip
+
+local new_direction = nuts.pool.direction
+
+local runningrule = tex.magicconstants.runningrule
+
+-----------------
+
+local synchronize = typesetters.synchronize or { }
+typesetters.synchronize = synchronize or { }
+
+local a_synchronize = attributes.private("synchronize")
+local registervalue = attributes.registervalue
+local getvalue = attributes.getvalue
+local hasvalues = attributes.hasvalues
+
+local trace = false
+-- local trace = true
+local report = logs.reporter("parallel")
+
+local pushsavelevel = tex.pushsavelevel -- token.expandmacro("bgroup")
+local popsavelevel = tex.popsavelevel -- token.expandmacro("egroup")
+local dontcomplain = tex.dontcomplain
+
+local index = 0
+local lastattr = nil
+local lastline = nil
+
+interfaces.implement {
+ name = "registersynchronize",
+ arguments = { "dimen", "dimen", "dimen", "box" },
+ actions = function(ht,dp,slack,box)
+ index = index + 1
+ box = tonut(box)
+ local t = {
+ index = index,
+ lineheight = ht,
+ linedepth = dp,
+ slack = slack,
+ height = getheight(height),
+ depth = getheight(depth),
+ box = box,
+ }
+ local v = registervalue(a_synchronize,t)
+ tex.setattribute(a_synchronize,v)
+ if index > 0 then
+ enableaction("vboxbuilders", "typesetters.synchronize.handler")
+ enableaction("mvlbuilders", "typesetters.synchronize.handler")
+ end
+ end,
+}
+
+-- When this is stable it can become a proper helper and primitive.
+
+local function hsplit(box,targetwidth,targetheight,targetdepth,mcriterium,pcriterium,upto)
+ local first = getlist(box)
+ local last = first
+ local current = first
+ local previous = current
+ local lastdisc = nil
+ local lastglyph = nil
+ -- local stretch = 0
+ -- local shrink = 0
+ local width = 0
+ local height = 0
+ local depth = 0
+ local dirstack = { } -- can move to outer
+ local dirtop = 0
+ local minwidth = targetwidth
+ local maxwidth = targetwidth
+ local usedwidth = targetwidth
+ while true do
+ previous = current
+ local id = getid(current)
+ if id == glyph_code then
+ local wd, ht, dp = getwhd(current)
+ -- find next break first
+ local newwidth = width + wd
+ if newwidth >= usedwidth then
+ if not lastdisc and lastglyph then
+ last = getprev(lastglyph)
+ end
+ break
+ else
+ width = newwidth
+ if ht > height then
+ height = ht
+ end
+ if dp > depth then
+ depth = dp
+ end
+ end
+ if not lastglyph then
+ lastglyph = current
+ end
+ elseif id == kern_code then
+ local wd = getwidth(current)
+ local newwidth = width + wd
+ if getsubtype(current) == fontkern_code then
+ -- assume sane kerns
+ width = newwidth
+ else
+ last = previous
+ if newwidth >= usedwidth then
+ break
+ else
+ width = newwidth
+ end
+ lastdisc = nil
+ lastglyph = nil
+ end
+ elseif id == disc_code then
+ local pre, post, replace = getdisc(current)
+ local wd = replace and rangedimensions(box,replace) or 0
+ local newwidth = width + wd
+ if newwidth >= usedwidth then
+ break
+ end
+ local wd = pre and rangedimensions(box,pre) or 0
+ local prewidth = width + wd
+ if prewidth >= usedwidth then
+ break
+ end
+ width = newwidth
+ lastdisc = current
+ else
+ -- common code at the end
+ if id == glue_code or id == math_code then -- refactor : common code
+ -- leaders
+ last = previous
+ local wd, more, less = getglue(current)
+ local newwidth = width + wd
+ if newwidth >= usedwidth then
+ break
+ else
+ width = newwidth
+ -- stretch = stretch + more
+ -- shrink = shrink + less
+ -- also for statistics
+ maxwidth = maxwidth + more
+ minwidth = minwidth + less
+ -- can become an option:
+ usedwidth = minwidth
+ end
+ elseif id == hlist_code or id == vlist_code then
+ last = previous
+ local wd, ht, dp = getwhd(current)
+ local newwidth = width + wd
+ if newwidth >= usedwidth then
+ break
+ else
+ width = newwidth
+ if ht > height then
+ height = ht
+ end
+ if dp > depth then
+ depth = dp
+ end
+ end
+ elseif id == rule_code then
+ last = previous
+ local wd, ht, dp = getwhd(current)
+ local newwidth = width + wd
+ if newwidth >= usedwidth then
+ break
+ else
+ width = newwidth
+ if ht ~= runningrule and ht > height then
+ height = ht
+ end
+ if dp ~= runningrule and dp > depth then
+ depth = dp
+ end
+ end
+ elseif id == dir_code then
+ local dir, cancel = getdirection(current)
+ if cancel then
+ if dirtop > 0 then
+ dirtop = dirtop - 1
+ end
+ else
+ dirtop = dirtop + 1
+ dirstack[dirtop] = dir
+ end
+ end
+ lastdisc = nil
+ lastglyph = nil
+ end
+ local next = getnext(current)
+ if next then
+ current = next
+ else
+ last = previous
+ break
+ end
+ end
+ local next
+ if lastdisc then
+ local pre, post, replace, pretail, posttail, replacetail = getdisc(lastdisc,true)
+ last = getprev(lastdisc)
+ --
+ next = getnext(lastdisc)
+ if next then
+ setprev(next)
+ end
+ --
+ setlink(last,pre)
+ last = pretail
+ if post then
+ setlink(posttail,next)
+ next = post
+ end
+ setdisc(lastdisc,nil,nil,replace)
+ flushnode(lastdisc)
+ else
+ next = getnext(last)
+ if next then
+ setprev(next)
+ end
+ setnext(last)
+ end
+ while last do
+ local id = getid(last)
+ if id == glue_code or id == penalty_code then
+ -- if id == glue_code then
+ -- local wd, more, less = getglue(last)
+ -- -- stretch = stretch - more
+ -- -- shrink = shrink - less
+ -- width = width - wd
+ -- -- also for statistics
+ -- maxwidth = maxwidth - more
+ -- minwidth = minwidth - less
+ -- -- can become an option:
+ -- usedwidth = minwidth
+ -- end
+ first, last = removenode(first,last,true)
+ else
+ break
+ end
+ end
+ if dirtop > 0 then
+ for i=dirtop,1,-1 do
+ local d = new_direction(dirstack[i],true)
+ first, last = insertafter(first,last,d)
+ end
+ for i=1,dirtop do
+ local d = new_direction(dirstack[i],false)
+ next = insertbefore(next,next,d)
+ end
+ end
+ if first then
+ -- pushsavelevel()
+ -- dontcomplain()
+ local result
+ if upto then
+ result = hpack(first)
+ else
+ local badness, overshoot
+ result, badness, overshoot = hpack(first,targetwidth,"exactly")
+ local pdone = pcriterium and badness > pcriterium
+ local mdone = mcriterium and badness > mcriterium
+ if overshoot > 0 then
+ if pdone then
+ result = hpack(first)
+ end
+ elseif overshoot < 0 then
+ if mdone then
+ result = hpack(first)
+ end
+ else
+ if pdone or mdone then
+ result = hpack(first)
+ end
+ end
+ end
+ -- popsavelevel()
+ setattrlist(result,getattrlist(box)) -- useattrlist(result,box)
+ setheight(result,targetheight or height)
+ setdepth(result,targetdepth or depth)
+ setlist(box,next)
+ setwidth(box,rangedimensions(box,next))
+ return result
+ end
+end
+
+do
+
+ local scanners = tokens.scanners
+ local scanword = scanners.word
+ local scaninteger = scanners.integer
+ local scandimen = scanners.dimen
+
+ local tonode = nuts.tonode
+ local getbox = nuts.getbox
+ local setbox = nuts.setbox
+
+ local direct_value = tokens.values.direct
+ local none_value = tokens.values.none
+
+ interfaces.implement {
+ name = "hsplit",
+ protected = true,
+ public = true,
+ usage = "value",
+ actions = function(what)
+ local n = scaninteger()
+ local w = 0
+ local h = false
+ local d = false
+ local pcriterium = false
+ local mcriterium = false
+ local upto = false
+ while true do
+ local key = scanword()
+ if key == "to" then
+ upto = false
+ w = scandimen()
+ elseif key == "upto" then
+ upto = true
+ w = scandimen()
+ elseif key == "width" then
+ w = scandimen()
+ elseif key == "height" then
+ h = scandimen()
+ elseif key == "depth" then
+ d = scandimen()
+ elseif key == "criterium" then
+ pcriterium = scaninteger()
+ mcriterium = scaninteger()
+ elseif key == "shrinkcriterium" then
+ mcriterium = scaninteger()
+ elseif key == "stretchcriterium" then
+ pcriterium = scaninteger()
+ else
+ break
+ end
+ end
+ pushsavelevel()
+ dontcomplain()
+ local r = hsplit(getbox(n),w,h,d,mcriterium,pcriterium,upto)
+ popsavelevel()
+ if r then
+ if what == "value" then
+ return direct_value, r
+ else
+ context(tonode(r))
+ end
+ else
+ setbox(n)
+ if what == "value" then
+ return none_value, nil
+ end
+ end
+ end,
+ }
+
+end
+
+local function getproperties(parent)
+ local props = getprop(parent,"parallel")
+ if not props then
+ local w, h, d = getwhd(parent)
+ props = {
+ width = w,
+ height = h,
+ depth = d,
+ }
+ setprop(parent,"parallel",props)
+ end
+ return props
+end
+
+local function setproperties(parent,data,result,level,ctotal)
+ local props = getproperties(parent)
+ local depth = props.depth
+ local height = props.height
+ local delta = data.linedepth - depth
+ if delta > 0 then
+ depth = data.linedepth
+ setdepth(parent,depth)
+ props.depth = depth
+ local n = getnext(parent)
+ if n and getid(n) == glue_code and getsubtype(n) == baselineskip_code then
+ setwidth(n,getwidth(n) - delta)
+ end
+ end
+-- if height < data.lineheight then
+-- height = data.lineheight
+-- setheight(parent,height)
+-- props.height = height
+-- end
+ local offset = level * ctotal
+ if props.depth + offset > depth then
+ setdepth(parent,props.depth+offset)
+ end
+ setoffsets(result,0,-offset)
+ setwidth(result,0)
+end
+
+local function flush(head,first,last,a,parent,nesting)
+ if first and nesting == 0 then
+ local data = getvalue(a_synchronize,a)
+ local upto = getnext(last)
+ if upto and getid(upto) == penalty_code then
+ upto = getnext(upto)
+ end
+ if upto and getid(upto) == glue_code and getsubtype(upto) == parfillskip_code then
+ upto = getnext(upto)
+ end
+ local props = getproperties(parent)
+ local width = rangedimensions(parent,first,upto)
+ if width > props.width then
+ width = props.width
+ end
+ local content = data.box
+ local index = data.index
+ if not content then
+ if trace then
+ report("index %i, verdict %a",index,"done")
+ end
+ else
+ local result = nil
+ local cwidth = getwidth(content)
+ local ctotal = gettotal(content)
+ if cwidth <= width then
+ if trace then
+ report("index %i, available %p, content %p, verdict %a",index,width,cwidth,"fit")
+ end
+ result = content
+ data.box = nil
+ elseif cwidth > width then
+ if trace then
+ report("index %i, available %p, content %p, verdict %a",index,width,cwidth,"overflow")
+ end
+ result = hsplit(content,width-(data.slack or 0),nil,nil,200)
+ lastattr = a
+ lastline = parent
+ else
+ report("index %i, verdict %a",index,"weird")
+ end
+ if result then
+ setproperties(parent,data,result,1,ctotal)
+ head = insertbefore(head,first,result)
+ end
+ end
+ end
+ return head
+end
+
+local function lastflush(lastline,lastattr)
+ local data = getvalue(a_synchronize,lastattr)
+ if not data then
+ return
+ end
+ local content = data.box
+ if not content or getwidth(content) == 0 then
+ return
+ end
+ local head = getlist(lastline)
+ if not head then
+ return
+ end
+ local first = head
+ local last = nil
+ local props = getproperties(lastline)
+ local width = props.width
+ local height = props.height
+ local depth = props.depth
+ local level = 1
+ if depth < data.linedepth then
+ depth = data.linedepth
+ setdepth(lastline,depth)
+ end
+ if height < data.lineheight then
+ height = data.lineheight
+ setheight(lastline,height)
+ end
+ while true do
+ local content = data.box
+ local index = data.index
+ if content then
+ local result = nil
+ local total = 0
+ local cwidth = getwidth(content)
+ local ctotal = gettotal(content)
+ if cwidth <= width then
+ if trace then
+ report("index %i, available %p, content %p, verdict %a",index,width,cwidth,"fit")
+ end
+ result = content
+ data.box = nil
+ elseif cwidth > width then
+ if trace then
+ report("index %i, available %p, content %p, verdict %a",index,width,cwidth,"overflow")
+ end
+ result = hsplit(content,width-(data.slack or 0),nil,nil,200)
+ else
+ report("index %i, verdict %a",index,"weird")
+ end
+ if result then
+ level = level + 1
+ setproperties(lastline,data,result,level,ctotal)
+ head = insertbefore(head,first,result)
+ setlist(lastline,head)
+ else
+ break
+ end
+ else
+ break
+ end
+ end
+end
+
+local processranges = nuts.processranges
+
+function synchronize.handler(head,where)
+ if where == "hmodepar" and hasvalues(a_synchronize) then
+ lastattr = nil
+ lastline = nil
+ for n, id, subtype in traverselist(head) do
+ if subtype == line_code then
+ lastattr = nil
+ local list = getlist(n)
+ local head = processranges(a_synchronize,flush,list,n)
+ if head ~= list then
+ setlist(n,head)
+ end
+ end
+ end
+ if lastattr and lastline then
+ lastflush(lastline,lastattr)
+ end
+ end
+ return head
+end
+
+--
+
+local settings_to_array = utilities.parsers.settings_to_array
+local get_buffer_content = buffers.getcontent
+local splitlines = string.splitlines
+
+interfaces.implement {
+ name = "synchronizesteps",
+ arguments = { {
+ { "list" },
+ { "split" },
+ { "buffer" },
+ { "text" },
+ } },
+ actions = function(t)
+ local split = t.split -- not used yet
+ local list = t.list
+ local buffer = t.buffer
+ local text = t.text
+ local data = false
+ if buffer and buffer ~= "" then
+ data = settings_to_array(buffer)
+ if #data == 2 then
+ for i=1,#data do
+ data[i] = splitlines(get_buffer_content(data[i]) or "")
+ end
+ else
+ return
+ end
+ elseif text and text ~= "" then
+ data = settings_to_array(text)
+ if #data == 2 then
+ for i=1,#data do
+ data[i] = settings_to_array(data[i])
+ end
+ else
+ return
+ end
+ else
+ return
+ end
+ if list and list ~= "" then
+ list = settings_to_array(list)
+ else
+ list = { }
+ end
+ local done = data[1]
+ local dtwo = data[2]
+ if #done == #dtwo then
+ local lone = list[1] or ""
+ local ltwo = list[2] or ""
+ for i=1,#done do
+ context.dosplitsynchronize(lone,ltwo,done[i],dtwo[i])
+ end
+ else
+ context.type("[different sizes in synchronize]")
+ end
+ end,
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-syn.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-syn.mkxl
new file mode 100644
index 00000000000..3f71fa43d62
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-syn.mkxl
@@ -0,0 +1,261 @@
+%D \module
+%D [ file=typo-syn,
+%D version=2022.01.06,
+%D title=\CONTEXT\ Typesetting Macros,
+%D subtitle=synchronizers,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+% Musical timestamp: this code was written when I start relistening my whole
+% digitized cd collection with the (new) r2r soekris dac in my setup.
+
+\writestatus{loading}{ConTeXt Typesetting Macros / Synchronizers}
+
+\registerctxluafile{typo-syn}{autosuffix}
+
+%D Yet another experiment (triggered by a question / demand from Ton Otten.)
+%D
+%D \starttyping
+%D \setupsynchronize [paralleltext] [color=darkblue]
+%D % \setupsynchronize [paralleltext] [style=\tx,color=darkred]
+%D % \setupsynchronize [paralleltext] [style=\txx,color=darkgreen]
+%D
+%D \dorecurse{10}{%
+%D \paralleltext
+%D {[een allereerste zinnetje]}
+%D {[een tweede zinnetje]}%
+%D \space
+%D \paralleltext
+%D {[een derde zin]}
+%D {[een vierde zinnetje]}
+%D \space
+%D } \removeunwantedspaces
+%D \par test line \page
+%D
+%D \paralleltext
+%D {[\ignorespaces\samplefile{tufte}\removeunwantedspaces]}
+%D {[\samplefile{ward}\removeunwantedspaces]}%
+%D \par test line \page
+%D
+%D \paralleltext
+%D {[\ignorespaces\samplefile{tufte}\removeunwantedspaces]}
+%D {[\ignorespaces\samplefile{tufte}\removeunwantedspaces]}%
+%D \par test line \page
+%D
+%D \paralleltext
+%D {[\ignorespaces\samplefile{ward}\removeunwantedspaces]}%
+%D {[\ignorespaces\samplefile{tufte}\removeunwantedspaces]}
+%D \par test line \page
+%D
+%D \startbuffer[en]
+%D This is an english text and
+%D this is also something english;
+%D as is this.
+%D Not that there is much meaning in it.
+%D \stopbuffer
+%D
+%D \startbuffer[nl]
+%D Dit is een nederlandse tekst
+%D en dit is ook wat nederlands;
+%D net als dit.
+%D Niet dat het veel te betekenen heeft.
+%D \stopbuffer
+%D
+%D \definesynchronizecontent
+%D [nl]
+%D [language=nl,
+%D color=darkred]
+%D
+%D \definesynchronizecontent
+%D [en]
+%D [language=en,
+%D color=darkgreen]
+%D
+%D \definesynchronize
+%D [parallel-en-nl]
+%D [list={en,nl}]
+%D
+%D \placesynchronize
+%D [parallel-en-nl]
+%D [buffer={en,nl}]
+%D
+%D \blank
+%D
+%D \placesynchronize
+%D [parallel-en-nl]
+%D [split={.},
+%D text={
+%D {This is an english text and this is also something english; as is this. Not that there is much meaning in it.},
+%D {Dit is een nederlandse tekst en dit is ook wat nederlands; net als dit. Niet dat het veel te betekenen heeft.}
+%D }]
+%D
+%D \blank
+%D
+%D \placesynchronize
+%D [parallel-en-nl]
+%D [split={.},
+%D text={
+%D {
+%D {This is an english text and this is also something english;},
+%D {as is this.},
+%D {Not that there is much meaning in it.}
+%D },
+%D {
+%D {Dit is een nederlandse tekst en dit is ook wat nederlands;},
+%D {net als dit.},
+%D {Niet dat het veel te betekenen heeft.}
+%D }
+%D }]
+%D
+%D \setupsynchronizecontent
+%D [nl]
+%D [language=nl,
+%D style=\tx,
+%D left={[},
+%D right={]},
+%D color=darkblue]
+%D
+%D \placesynchronize
+%D [parallel-en-nl]
+%D [distance=1pt,
+%D buffer={en,nl}]
+%D \stoptyping
+
+\unprotect
+
+\definesystemattribute[synchronize][public]
+
+\installcorenamespace {synchronize}
+\installcorenamespace {synchronizecontent}
+
+\installcommandhandler \??synchronize {synchronize} \??synchronize
+\installcommandhandler \??synchronizecontent {synchronizecontent} \??synchronizecontent
+
+\setupsynchronize
+ [\c!buffer=,
+ \c!text=,
+ \c!list=,
+ \c!split=,
+ \c!distance=\zeropoint]
+
+\let\typo_sync_rule\novrule
+
+\installtextracker
+ {synchronize}
+ {\let\typo_sync_rule\vrule}
+ {\let\typo_sync_rule\novrule}
+
+\tolerant\protected\def\typo_synchronize#1#*[#2]#:#3#4%
+ {\dontleavehmode
+ \begingroup
+ \def\currentsynchronize{#1}%
+ \setupcurrentsynchronize[#2]%
+ \scratchdistance\synchronizeparameter\c!distance
+ \dontcomplain
+ \setbox\scratchboxtwo\hbox\bgroup
+ \usesynchronizestyleandcolor\c!style\c!color
+ \begstrut
+ \ignorespaces#4\removeunwantedspaces
+ \endstrut
+ \egroup
+ \scratchdimentwo\wd\scratchboxtwo
+ \advanceby\scratchdimentwo\scratchdistance
+ \clf_registersynchronize
+ \strutht
+ \strutdp
+ .1\onepoint
+ \box\scratchboxtwo
+ \relax
+ \setbox\scratchboxone\hbox\bgroup
+ \ignorespaces#3\removeunwantedspaces
+ \egroup
+ \scratchdimenone\wd\scratchboxone
+ \unhbox\scratchboxone
+ \advanceby\scratchdimentwo-\scratchdimenone
+ \ifdim\scratchdimentwo>\zeropoint
+ \wordboundary
+ \typo_sync_rule
+ \s!width \scratchdimentwo
+ \s!height \exheight
+ \s!depth \zeropoint
+ \relax
+ \fi
+ \endgroup}
+
+\protected\def\dosplitsynchronize#1#2#3#4%
+ {\begingroup
+ \dontcomplain
+ \setbox\scratchboxtwo\hbox\bgroup
+ \def\currentsynchronizecontent{#2}%
+ \usesynchronizecontentstyleandcolor\c!style\c!color
+ \uselanguageparameter\synchronizecontentparameter
+ \synchronizecontentparameter\c!left
+ \begstrut
+ \ignorespaces
+ #4\removeunwantedspaces
+ \endstrut
+ \synchronizecontentparameter\c!right
+ \egroup
+ \scratchdimentwo\wd\scratchboxtwo
+ \advanceby\scratchdimentwo\scratchdistance
+ \clf_registersynchronize
+ \strutht
+ \strutdp
+ .1\onepoint
+ \box\scratchboxtwo
+ \relax
+ \setbox\scratchboxone\hbox\bgroup
+ \def\currentsynchronizecontent{#1}%
+ \usesynchronizecontentstyleandcolor\c!style\c!color
+ \uselanguageparameter\synchronizecontentparameter
+ \synchronizecontentparameter\c!left
+ \ignorespaces#3\removeunwantedspaces
+ \synchronizecontentparameter\c!right
+ \egroup
+ \scratchdimenone\wd\scratchboxone
+ \unhbox\scratchboxone
+ \advanceby\scratchdimentwo-\scratchdimenone
+ \ifdim\scratchdimentwo>\zeropoint
+ \wordboundary
+ \typo_sync_rule
+ \s!width \scratchdimentwo
+ \s!height \exheight
+ \s!depth \zeropoint
+ \relax
+ \fi
+ \endgroup
+ \space}
+
+\tolerant\protected\def\placesynchronize[#1]#*[#2]%
+ {\dontleavehmode
+ \begingroup
+ \def\currentsynchronize{#1}%
+ \setupcurrentsynchronize[#2]%
+ \scratchdistance\synchronizeparameter\c!distance
+ \clf_synchronizesteps
+ list {\synchronizeparameter\c!list}%
+ split {\synchronizeparameter\c!split}%
+ buffer {\synchronizeparameter\c!buffer}%
+ text {\synchronizeparameter\c!text}%
+ \relax
+ \removeunwantedspaces
+ \endgroup}
+
+\appendtoks
+ \protected\instance\edefcsname\currentsynchronize\endcsname{\typo_synchronize{\currentsynchronize}}%
+\to \everydefinesynchronize
+
+% \setupsynchronize
+% [\c!alternative=\v!horizontal]
+
+\definesynchronize
+ [paralleltext]
+
+% defined in lua: \hsplit to upto width height depth criterium shrinkcriterium stretchcriterium
+
+\protect \endinput
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-tal.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-tal.lmt
index 5c32e9ef9fc..e5431cffc6e 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-tal.lmt
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-tal.lmt
@@ -47,8 +47,8 @@ local isglyph = nuts.isglyph
local setattr = nuts.setattr
local setchar = nuts.setchar
-local insert_node_before = nuts.insert_before
-local insert_node_after = nuts.insert_after
+local insertnodebefore = nuts.insertbefore
+local insertnodeafter = nuts.insertafter
local nextglyph = nuts.traversers.glyph
local getdimensions = nuts.dimensions
@@ -393,46 +393,46 @@ function characteralign.handler(head,where)
local new_kern = trace_split and traced_kern or new_kern
if b_start then
if before < maxbefore then
- head = insert_node_before(head,b_start,new_kern(maxbefore-before))
+ head = insertnodebefore(head,b_start,new_kern(maxbefore-before))
end
if not c then
-- print("[before]")
if dataset.hasseparator then
local width = fontcharacters[getfont(b_start)][separator].width
- insert_node_after(head,b_stop,new_kern(maxafter+width))
+ insertnodeafter(head,b_stop,new_kern(maxafter+width))
end
elseif a_start then
-- print("[before] [separator] [after]")
if after < maxafter then
- insert_node_after(head,a_stop,new_kern(maxafter-after))
+ insertnodeafter(head,a_stop,new_kern(maxafter-after))
end
else
-- print("[before] [separator]")
if maxafter > 0 then
- insert_node_after(head,c,new_kern(maxafter))
+ insertnodeafter(head,c,new_kern(maxafter))
end
end
elseif a_start then
if c then
-- print("[separator] [after]")
if maxbefore > 0 then
- head = insert_node_before(head,c,new_kern(maxbefore))
+ head = insertnodebefore(head,c,new_kern(maxbefore))
end
else
-- print("[after]")
local width = fontcharacters[getfont(b_stop)][separator].width
- head = insert_node_before(head,a_start,new_kern(maxbefore+width))
+ head = insertnodebefore(head,a_start,new_kern(maxbefore+width))
end
if after < maxafter then
- insert_node_after(head,a_stop,new_kern(maxafter-after))
+ insertnodeafter(head,a_stop,new_kern(maxafter-after))
end
elseif c then
-- print("[separator]")
if maxbefore > 0 then
- head = insert_node_before(head,c,new_kern(maxbefore))
+ head = insertnodebefore(head,c,new_kern(maxbefore))
end
if maxafter > 0 then
- insert_node_after(head,c,new_kern(maxafter))
+ insertnodeafter(head,c,new_kern(maxafter))
end
end
return head
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-tal.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-tal.mkxl
index d96d1348bb8..f3d9e54e0d3 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-tal.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-tal.mkxl
@@ -123,11 +123,11 @@
\c!character =\alignmentcharacter]
\permanent\protected\def\typo_charalign_pass_one
- {\advance\scratchcounter\plusone
+ {\advanceby\scratchcounter\plusone
\setbox\scratchbox\typo_charalign_pass}
\permanent\protected\def\typo_charalign_pass_two
- {\advance\scratchcounter\plusone
+ {\advanceby\scratchcounter\plusone
\typo_charalign_pass}
\def\typo_charalign_pass
@@ -212,7 +212,8 @@
\resetcharacteralign
\egroup}
-\aliased\let\stopcharacteralign \relax
+\permanent\protected\lettonothing\stopcharacteralign
+
\aliased\let\checkcharacteralign\gobbleoneargument
\permanent\protected\def\setfirstpasscharacteralign {\enforced\let\checkcharacteralign\gobbleoneargument}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-wrp.lmt b/Master/texmf-dist/tex/context/base/mkxl/typo-wrp.lmt
new file mode 100644
index 00000000000..5b31c401591
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-wrp.lmt
@@ -0,0 +1,81 @@
+if not modules then modules = { } end modules ['typo-wrp'] = {
+ version = 1.001,
+ comment = "companion to typo-wrp.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- begin/end par wrapping stuff ... more to come
+
+local boundary_code = nodes.nodecodes.boundary
+local wordboundary_code = nodes.boundarycodes.word
+
+local nuts = nodes.nuts
+
+local findtail = nuts.tail
+local getprev = nuts.getprev
+local setnext = nuts.setnext
+local getid = nuts.getid
+local getsubtype = nuts.getsubtype
+local getattr = nuts.getattr
+local flushnodelist = nuts.flushlist
+
+local enableaction = nodes.tasks.enableaction
+
+local wrappers = { }
+typesetters.wrappers = wrappers
+
+local trace_wrappers = trackers.register("typesetters.wrappers",function(v) trace_wrappers = v end)
+local report = logs.reporter("paragraphs","wrappers")
+
+-- In luametatex we don't have the parfilskip attached yet but we can have final glue
+-- anyway. This check is very bound to the \crlf definition where we get:
+--
+-- ... boundary [strut: hlist] [break: glue penalty] boundary
+
+local a_crlf = attributes.private("crlf")
+
+local function remove_dangling_crlf(head,tail)
+ if head and tail then
+ if getid(tail) == boundary_code and getsubtype(tail) == wordboundary_code then
+ -- findnode could run backwards
+ if getattr(tail,a_crlf) then
+ local t = tail
+ while t do
+ t = getprev(t)
+ if not t then
+ break
+ elseif getid(t) == boundary_code and getsubtype(t) == wordboundary_code then
+ if t ~= head then
+ if trace_wrappers then
+ report("removing a probably unwanted end-of-par break in line %s (guess)",tex.inputlineno)
+ end
+ tail = getprev(t)
+ setnext(tail)
+ flushnodelist(t)
+ end
+ break
+ end
+ end
+ end
+ end
+ end
+ return head, tail
+end
+
+function wrappers.handler(head)
+ if head then
+ local tail = findtail(head)
+ head, tail = remove_dangling_crlf(head,tail) -- will be action chain
+ end
+ return head
+end
+
+interfaces.implement {
+ name = "enablecrlf",
+ onlyonce = true,
+ actions = function()
+ enableaction("processors","typesetters.wrappers.handler")
+ end
+}
diff --git a/Master/texmf-dist/tex/context/base/mkxl/typo-wrp.mkxl b/Master/texmf-dist/tex/context/base/mkxl/typo-wrp.mkxl
index b552c151aa7..71559a8a3a5 100644
--- a/Master/texmf-dist/tex/context/base/mkxl/typo-wrp.mkxl
+++ b/Master/texmf-dist/tex/context/base/mkxl/typo-wrp.mkxl
@@ -15,7 +15,9 @@
\unprotect
-\registerctxluafile{typo-wrp}{}
+\registerctxluafile{typo-wrp}{autosuffix}
+
+\definesystemattribute[crlf]
\permanent\protected\def\crlf
{\ifhmode
@@ -25,30 +27,32 @@
\protected\def\spac_crlf
{\clf_enablecrlf % once
\unskip
- \spac_crlf_placeholder
+ \wordboundary
+ \spac_crlf_placeholder % box
\ifcase\raggedstatus\hfil\or\or\or\hfil\fi
- % in bad usage this can lead to: [break -10000] [wordboundary] [line(break)penalty] [parfillskip]
+ % in bad usage this can lead to: [break -10000] [wordboundary] [line(break)penalty] [glue (filler)]
\break
+ \begingroup
+ \c_attr_crlf\plusone
\wordboundary
+ \endgroup
% which we then remove (maybe we should flag the wordboundary with an attribute but not now
\ignorespaces}
\protected\def\spac_crlf_placeholder
- {\strut}
+ {\strut} % or \endstrut
\protected\def\spac_crlf_placeholder_show
- {\wordboundary
- %\nobreak
- \hpack to \zeropoint{\strut{\infofont\kern.25\emwidth}\lohi{\infofont CR}{\infofont LF}\hss}}
+ {\hpack to \zeropoint{\strut{\infofont\kern.25\emwidth}\lohi{\infofont CR}{\infofont LF}\hss}}
\permanent\protected\def\settestcrlf
{\let\spac_crlf_placeholder\spac_crlf_placeholder_show}
\permanent\protected\def\crlfplaceholder % for old times sake
- {\spac_crlf_placeholder}
+ {\wordboundary\strut}
\appendtoks
- \let\spac_crlf_placeholder\empty
+ \lettonothing\spac_crlf_placeholder
\to \everysetnostrut
\appendtoks
diff --git a/Master/texmf-dist/tex/context/base/mkxl/util-deb.lmt b/Master/texmf-dist/tex/context/base/mkxl/util-deb.lmt
new file mode 100644
index 00000000000..73846f2b61c
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/util-deb.lmt
@@ -0,0 +1,391 @@
+if not modules then modules = { } end modules ['util-deb'] = {
+ version = 1.001,
+ comment = "companion to luat-lib.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- the <anonymous> tag is kind of generic and used for functions that are not
+-- bound to a variable, like node.new, node.copy etc (contrary to for instance
+-- node.hasattribute which is bound to a hasattribute local variable in mkiv)
+
+local type, next, tostring, tonumber, xpcall, print = type, next, tostring, tonumber, xpcall, print
+local format, find, sub, gsub = string.format, string.find, string.sub, string.gsub
+local insert, remove, sort = table.insert, table.remove, table.sort
+local setmetatableindex = table.setmetatableindex
+
+utilities = utilities or { }
+local debugger = utilities.debugger or { }
+utilities.debugger = debugger
+
+local report = logs.reporter("debugger")
+
+local ticks = os.gettimeofday or os.clock
+local seconds = function(n) return n or 0 end
+local overhead = 0
+local dummycalls = 10*1000
+local nesting = 0
+local names = { }
+
+local function initialize()
+ ticks = lua.getpreciseticks
+ seconds = lua.getpreciseseconds
+ initialize = false
+end
+
+setmetatableindex(names,function(t,name)
+ local v = setmetatableindex(function(t,source)
+ local v = setmetatableindex(function(t,line)
+ -- local v = { total = 0, count = 0, nesting = 0, ticks = 0 }
+ local v = { 0, 0, 0, 0 }
+ t[line] = v
+ return v
+ end)
+ t[source] = v
+ return v
+ end)
+ t[name] = v
+ return v
+end)
+
+local getinfo = nil
+local sethook = nil
+
+-- local function hook(where)
+-- local f = getinfo(2,"nS")
+-- if f then
+-- local source = f.short_src
+-- if not source then
+-- return
+-- end
+-- local line = f.linedefined or 0
+-- local name = f.name
+-- if not name then
+-- local what = f.what
+-- if what == "C" then
+-- name = "<anonymous>"
+-- else
+-- name = f.namewhat or what or "<unknown>"
+-- end
+-- end
+-- local data = names[name][source][line]
+-- if where == "call" then
+-- local nesting = data.nesting
+-- if nesting == 0 then
+-- data.count = data.count + 1
+-- insert(data,ticks())
+-- data.nesting = 1
+-- else
+-- data.nesting = nesting + 1
+-- end
+-- elseif where == "return" then
+-- local nesting = data.nesting
+-- if nesting == 1 then
+-- local t = remove(data)
+-- if t then
+-- data.total = data.total + ticks() - t
+-- end
+-- data.nesting = 0
+-- else
+-- data.nesting = nesting - 1
+-- end
+-- end
+-- end
+-- end
+
+local getdebuginfo = lua.getdebuginfo
+
+-- local function hook(where) -- make two hooks
+-- local name, source, line = getdebuginfo()
+-- if name then
+-- local data = names[name][source][line]
+-- if where == "call" then
+-- local nesting = data.nesting
+-- if nesting == 0 then
+-- data.count = data.count + 1
+-- -- insert(data,ticks())
+-- data.nesting = 1
+-- data.ticks = ticks()
+-- else
+-- data.nesting = nesting + 1
+-- end
+-- elseif where == "return" then
+-- local nesting = data.nesting
+-- if nesting == 1 then
+-- -- local t = remove(data)
+-- local t = data.ticks
+-- if t then
+-- data.total = data.total + ticks() - t
+-- end
+-- data.nesting = 0
+-- elseif nesting > 0 then
+-- data.nesting = nesting - 1
+-- end
+-- elseif where == "tail call" then
+-- local nesting = data.nesting
+-- if nesting == 1 then
+-- -- local t = remove(data)
+-- local t = data.ticks
+-- if t then
+-- data.total = data.total + ticks() - t
+-- end
+-- data.nesting = 0
+-- elseif nesting > 0 then
+-- data.nesting = nesting - 1
+-- end
+-- end
+-- end
+-- end
+
+local function hook(where) -- make two hooks
+ local name, source, line = getdebuginfo()
+ if name then
+ local data = names[name][source][line]
+ if where == "call" then
+ local nesting = data[3]
+ if nesting == 0 then
+ data[2] = data[2] + 1
+ data[3] = 1
+ data[4] = ticks()
+ else
+ data[3] = nesting + 1
+ end
+ -- elseif where == "return" then
+ else
+ local nesting = data[3]
+ if nesting == 1 then
+ local t = data[4]
+ if t then
+ data[1] = data[1] + ticks() - t
+ end
+ data[3] = 0
+ elseif nesting > 0 then
+ data[3] = nesting - 1
+ end
+ -- elseif where == "tail call" then
+ -- local nesting = data[3]
+ -- if nesting == 1 then
+ -- local t = data[4]
+ -- if t then
+ -- data[4] = data[4] + ticks() - t
+ -- end
+ -- data[3] = 0
+ -- elseif nesting > 0 then
+ -- data[3] = nesting - 1
+ -- end
+ end
+ end
+end
+
+function debugger.showstats(printer,threshold)
+ local printer = printer or report
+ local calls = 0
+ local functions = 0
+ local dataset = { }
+ local length = 0
+ local realtime = 0
+ local totaltime = 0
+ local threshold = threshold or 0
+ for name, sources in next, names do
+ for source, lines in next, sources do
+ for line, data in next, lines do
+ -- local count = data.count
+ local count = data[2]
+ if count > threshold then
+ if #name > length then
+ length = #name
+ end
+ -- local total = data.total
+ local total = data[1]
+ local real = total
+ if real > 0 then
+ real = total - (count * overhead / dummycalls)
+ if real < 0 then
+ real = 0
+ end
+ realtime = realtime + real
+ end
+ totaltime = totaltime + total
+ if line < 0 then
+ line = 0
+ end
+ -- if name = "a" then
+ -- -- weird name
+ -- end
+ dataset[#dataset+1] = { real, total, count, name, source, line }
+ end
+ end
+ end
+ end
+ sort(dataset,function(a,b)
+ if a[1] == b[1] then
+ if a[2] == b[2] then
+ if a[3] == b[3] then
+ if a[4] == b[4] then
+ if a[5] == b[5] then
+ return a[6] < b[6]
+ else
+ return a[5] < b[5]
+ end
+ else
+ return a[4] < b[4]
+ end
+ else
+ return b[3] < a[3]
+ end
+ else
+ return b[2] < a[2]
+ end
+ else
+ return b[1] < a[1]
+ end
+ end)
+ if length > 50 then
+ length = 50
+ end
+ local fmt = string.formatters["%4.9k s %3.3k %% %4.9k s %3.3k %% %8i # %-" .. length .. "s %4i %s"]
+ for i=1,#dataset do
+ local data = dataset[i]
+ local real = data[1]
+ local total = data[2]
+ local count = data[3]
+ local name = data[4]
+ local source = data[5]
+ local line = data[6]
+ calls = calls + count
+ functions = functions + 1
+ name = gsub(name,"%s+"," ")
+ if #name > length then
+ name = sub(name,1,length)
+ end
+ printer(fmt(seconds(total),100*total/totaltime,seconds(real),100*real/realtime,count,name,line,source))
+ end
+ printer("")
+ printer(format("functions : %i", functions))
+ printer(format("calls : %i", calls))
+ printer(format("overhead : %f", seconds(overhead/1000)))
+
+ -- table.save("luatex-profile.lua",names)
+end
+
+local function getdebug()
+ if sethook and getinfo then
+ return
+ end
+ if not debug then
+ local okay
+ okay, debug = pcall(require,"debug")
+ end
+ if type(debug) ~= "table" then
+ return
+ end
+ getinfo = debug.getinfo
+ sethook = debug.sethook
+ if type(getinfo) ~= "function" then
+ getinfo = nil
+ end
+ if type(sethook) ~= "function" then
+ sethook = nil
+ end
+end
+
+function debugger.savestats(filename,threshold)
+ local f = io.open(filename,'w')
+ if f then
+ debugger.showstats(function(str) f:write(str,"\n") end,threshold)
+ f:close()
+ end
+end
+
+function debugger.enable()
+ getdebug()
+ if sethook and getinfo and nesting == 0 then
+ running = true
+ if initialize then
+ initialize()
+ end
+ sethook(hook,"cr")
+-- sethook(hook_c,"c")
+-- sethook(hook_r,"r")
+ local function dummy() end
+ local t = ticks()
+ for i=1,dummycalls do
+ dummy()
+ end
+ overhead = ticks() - t
+ end
+ if nesting > 0 then
+ nesting = nesting + 1
+ end
+end
+
+function debugger.disable()
+ if nesting > 0 then
+ nesting = nesting - 1
+ end
+ if sethook and getinfo and nesting == 0 then
+ sethook()
+ end
+end
+
+-- debugger.enable()
+--
+-- print(math.sin(1*.5))
+-- print(math.sin(1*.5))
+-- print(math.sin(1*.5))
+-- print(math.sin(1*.5))
+-- print(math.sin(1*.5))
+--
+-- debugger.disable()
+--
+-- print("")
+-- debugger.showstats()
+-- print("")
+-- debugger.showstats(print,3)
+--
+-- from the lua book:
+
+local function showtraceback(rep) -- from lua site / adapted
+ getdebug()
+ if getinfo then
+ local level = 2 -- we don't want this function to be reported
+ local reporter = rep or report
+ while true do
+ local info = getinfo(level, "Sl")
+ if not info then
+ break
+ elseif info.what == "C" then
+ reporter("%2i : %s",level-1,"C function")
+ else
+ reporter("%2i : %s : %s",level-1,info.short_src,info.currentline)
+ end
+ level = level + 1
+ end
+ end
+end
+
+debugger.showtraceback = showtraceback
+-- debug.showtraceback = showtraceback
+
+-- showtraceback()
+
+if luac then
+
+ local show, dump = luac.print, string.dump
+
+ function luac.inspect(v)
+ if type(v) == "function" then
+ local ok, str = xpcall(dump,function() end,v)
+ if ok then
+ v = str
+ end
+ end
+ if type(v) == "string" then
+ show(v,true)
+ else
+ print(v)
+ end
+ end
+
+end
diff --git a/Master/texmf-dist/tex/context/base/mkxl/util-fil.lmt b/Master/texmf-dist/tex/context/base/mkxl/util-fil.lmt
new file mode 100644
index 00000000000..b8d3747559c
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/util-fil.lmt
@@ -0,0 +1,172 @@
+if not modules then modules = { } end modules ['util-fil'] = {
+ version = 1.001,
+ optimize = true,
+ comment = "companion to luat-lib.mkxl",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- For the old ones, see util-fil.lua.
+
+local byte = string.byte
+local char = string.char
+
+utilities = utilities or { }
+local files = { }
+utilities.files = files
+
+local zerobased = { }
+
+function files.open(filename,zb)
+ local f = io.open(filename,"rb")
+ if f then
+ zerobased[f] = zb or false
+ end
+ return f
+end
+
+function files.close(f)
+ if f then
+ zerobased[f] = nil
+ f:close()
+ end
+end
+
+function files.size(f)
+ if f then
+ local current = f:seek()
+ local size = f:seek("end")
+ f:seek("set",current)
+ return size
+ else
+ return 0
+ end
+end
+
+files.getsize = files.size
+
+function files.setposition(f,n)
+ if zerobased[f] then
+ f:seek("set",n)
+ else
+ f:seek("set",n - 1)
+ end
+end
+
+function files.getposition(f)
+ if zerobased[f] then
+ return f:seek()
+ else
+ return f:seek() + 1
+ end
+end
+
+function files.look(f,n,chars)
+ local p = f:seek()
+ local s = f:read(n)
+ f:seek("set",p)
+ if chars then
+ return s
+ else
+ return byte(s,1,#s)
+ end
+end
+
+function files.skip(f,n)
+ if n == 1 then
+ f:read(n)
+ else
+ f:seek("set",f:seek()+n)
+ end
+end
+
+-- readers:
+
+files.readcardinal1 = fio.readcardinal1
+files.readcardinal2 = fio.readcardinal2
+files.readcardinal3 = fio.readcardinal3
+files.readcardinal4 = fio.readcardinal4
+
+files.readcardinal1le = fio.readcardinal1le or files.readcardinal1le
+files.readcardinal2le = fio.readcardinal2le or files.readcardinal2le
+files.readcardinal3le = fio.readcardinal3le or files.readcardinal3le
+files.readcardinal4le = fio.readcardinal4le or files.readcardinal4le
+
+files.readinteger1 = fio.readinteger1
+files.readinteger2 = fio.readinteger2
+files.readinteger3 = fio.readinteger3
+files.readinteger4 = fio.readinteger4
+
+files.readinteger1le = fio.readinteger1le or files.readinteger1le
+files.readinteger2le = fio.readinteger2le or files.readinteger2le
+files.readinteger3le = fio.readinteger3le or files.readinteger3le
+files.readinteger4le = fio.readinteger4le or files.readinteger4le
+
+files.readfixed2 = fio.readfixed2
+files.readfixed4 = fio.readfixed4
+files.read2dot14 = fio.read2dot14
+files.setposition = fio.setposition
+files.getposition = fio.getposition
+
+files.readbyte = files.readcardinal1
+files.readsignedbyte = files.readinteger1
+files.readcardinal = files.readcardinal1
+files.readinteger = files.readinteger1
+
+local skipposition = fio.skipposition
+files.skipposition = skipposition
+
+files.readbytes = fio.readbytes
+files.readbytetable = fio.readbytetable
+files.readcardinaltable = fio.readcardinaltable
+files.readintegertable = fio.readintegertable
+
+files.readcstring = fio.readcstring
+files.readcline = fio.readcline
+
+function files.readchar(f)
+ return f:read(1)
+end
+
+function files.readstring(f,n)
+ return f:read(n or 1)
+end
+
+function files.skipshort(f,n)
+ skipposition(f,2*(n or 1))
+end
+
+function files.skiplong(f,n)
+ skipposition(f,4*(n or 1))
+end
+
+-- writers
+
+function files.writestring(f,s)
+ f:write(char(byte(s,1,#s)))
+end
+
+function files.writebyte(f,b)
+ f:write(char(b))
+end
+
+files.writecardinal1 = fio.writecardinal1
+files.writecardinal2 = fio.writecardinal2
+files.writecardinal3 = fio.writecardinal3
+files.writecardinal4 = fio.writecardinal4
+
+files.writecardinal1le = fio.writecardinal1le
+files.writecardinal2le = fio.writecardinal2le
+files.writecardinal3le = fio.writecardinal3le
+files.writecardinal4le = fio.writecardinal4le
+
+files.writeinteger1 = fio.writeinteger1 or fio.writecardinal1
+files.writeinteger2 = fio.writeinteger2 or fio.writecardinal2
+files.writeinteger3 = fio.writeinteger3 or fio.writecardinal3
+files.writeinteger4 = fio.writeinteger4 or fio.writecardinal4
+
+files.writeinteger1le = files.writeinteger1le or fio.writecardinal1le
+files.writeinteger2le = files.writeinteger2le or fio.writecardinal2le
+files.writeinteger3le = files.writeinteger3le or fio.writecardinal3le
+files.writeinteger4le = files.writeinteger4le or fio.writecardinal4le
diff --git a/Master/texmf-dist/tex/context/base/mkxl/util-pck.lmt b/Master/texmf-dist/tex/context/base/mkxl/util-pck.lmt
new file mode 100644
index 00000000000..fff2d280a53
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/util-pck.lmt
@@ -0,0 +1,176 @@
+if not modules then modules = { } end modules ['util-pck'] = {
+ version = 1.001,
+ comment = "companion to luat-lib.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- moved from core-uti
+
+local next, tostring, type = next, tostring, type
+local sort, concat = table.sort, table.concat
+local format = string.format
+local sortedhashkeys, sortedkeys, tohash = table.sortedhashkeys, table.sortedkeys, table.tohash
+
+utilities = utilities or { }
+utilities.packers = utilities.packers or { }
+local packers = utilities.packers
+packers.version = 1.01
+
+-- local fmt_kv <const> = "%s=%q"
+-- local fmt_kt <const> = "%s={%q}"
+
+-- local function hashed(t)
+-- local s, ns = { }, 0
+-- for k, v in next, t do
+-- ns = ns + 1
+-- if type(v) == "table" then
+-- s[ns] = format(fmt_kt,k,hashed(v))
+-- else
+-- s[ns] = format(fmt_kv,k,v)
+-- end
+-- end
+-- sort(s)
+-- return concat(s,",")
+-- end
+
+local function hashed(t) --local function tabstr_normal(t)
+ local s = { }
+ local n = 0
+ for k, v in next, t do
+ n = n + 1
+ if type(v) == "table" then
+ s[n] = k .. ">" .. hashed(v)
+ elseif v == true then
+ s[n] = k .. "+" -- "=true"
+ elseif v then
+ s[n] = k .. "=" .. v
+ else
+ s[n] = k .. "-" -- "=false"
+ end
+ end
+ if n == 0 then
+ return ""
+ elseif n == 1 then
+ return s[1]
+ else
+ sort(s) -- costly but needed (occasional wrong hit otherwise)
+ return concat(s,",")
+ end
+end
+
+local function simplehashed(t)
+ local s = { }
+ local n = 0
+ for k, v in next, t do
+ n = n + 1
+ -- s[n] = format(fmt_kv,k,v)
+ s[n] = k .. "=" .. v
+ end
+ sort(s)
+ return concat(s,",")
+end
+
+packers.hashed = hashed
+packers.simplehashed = simplehashed
+
+-- In luatex < 0.74 (lua 5.1) a next chain was the same for each run so no sort was needed,
+-- but in the latest greatest versions (lua 5.2) we really need to sort the keys in order
+-- not to get endless runs due to a difference in tuc files.
+
+local function pack(t,keys,skip,hash,index)
+ if t then
+ local sk = #t > 0 and sortedkeys(t) or sortedhashkeys(t)
+ for i=1,#sk do
+ local k = sk[i]
+ if not skip or not skip[k] then
+ local v = t[k]
+ if type(v) == "table" then
+ pack(v,keys,skip,hash,index)
+ if keys[k] then
+ local h = hashed(v)
+ local i = hash[h]
+ if not i then
+ i = #index + 1
+ index[i] = v
+ hash[h] = i
+ end
+ t[k] = i
+ end
+ end
+ end
+ end
+ end
+end
+
+local function unpack(t,keys,skip,index)
+ if t then
+ for k, v in next, t do
+ if keys[k] and type(v) == "number" then
+ local iv = index[v]
+ if iv then
+ v = iv
+ t[k] = v
+ end
+ end
+ if type(v) == "table" and (not skip or not skip[k]) then
+ unpack(v,keys,skip,index)
+ end
+ end
+ end
+end
+
+function packers.new(keys,version,skip)
+ return {
+ version = version or packers.version,
+ keys = tohash(keys),
+ skip = tohash(skip),
+ hash = { },
+ index = { },
+ }
+end
+
+function packers.pack(t,p,shared)
+ if shared then
+ pack(t,p.keys,p.skip,p.hash,p.index)
+ elseif not t.packer then
+ pack(t,p.keys,p.skip,p.hash,p.index)
+ if #p.index > 0 then
+ t.packer = {
+ version = p.version or packers.version,
+ keys = p.keys,
+ skip = p.skip,
+ index = p.index,
+ }
+ end
+ p.hash = { }
+ p.index = { }
+ end
+end
+
+function packers.unpack(t,p,shared)
+ if shared then
+ if p then
+ unpack(t,p.keys,p.skip,p.index)
+ end
+ else
+ local tp = t.packer
+ if tp then
+ if tp.version == (p and p.version or packers.version) then
+ unpack(t,tp.keys,tp.skip,tp.index)
+ else
+ return false
+ end
+ t.packer = nil
+ end
+ end
+ return true
+end
+
+function packers.strip(p)
+ p.hash = nil
+end
+
+-- We could have a packer.serialize where we first flush the shared table
+-- and then use inline a reference . This saves an unpack.
diff --git a/Master/texmf-dist/tex/context/base/mkxl/util-sac.lmt b/Master/texmf-dist/tex/context/base/mkxl/util-sac.lmt
new file mode 100644
index 00000000000..f64602d54f6
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/mkxl/util-sac.lmt
@@ -0,0 +1,312 @@
+if not modules then modules = { } end modules ['util-sac'] = {
+ version = 1.001,
+ optimize = true,
+ comment = "companion to luat-lib.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+
+local byte, sub = string.byte, string.sub
+local tonumber = tonumber
+
+utilities = utilities or { }
+local streams = { }
+utilities.streams = streams
+
+function streams.open(filename,zerobased)
+ local f = filename and io.loaddata(filename)
+ if f then
+ return { f, 1, #f, zerobased or false }
+ end
+end
+
+function streams.openstring(f,zerobased)
+ if f then
+ return { f, 1, #f, zerobased or false }
+ end
+end
+
+function streams.getstring(f)
+ if f then
+ return f[1]
+ end
+end
+
+function streams.close()
+ -- dummy
+end
+
+function streams.size(f)
+ return f and f[3] or 0
+end
+
+streams.getsize = streams.size
+
+function streams.setposition(f,i)
+ if f[4] then
+ -- zerobased
+ if i <= 0 then
+ f[2] = 1
+ else
+ f[2] = i + 1
+ end
+ else
+ if i <= 1 then
+ f[2] = 1
+ else
+ f[2] = i
+ end
+ end
+end
+
+function streams.getposition(f)
+ if f[4] then
+ -- zerobased
+ return f[2] - 1
+ else
+ return f[2]
+ end
+end
+
+function streams.look(f,n,chars)
+ local b = f[2]
+ local e = b + n - 1
+ if chars then
+ return sub(f[1],b,e)
+ else
+ return byte(f[1],b,e)
+ end
+end
+
+function streams.skip(f,n)
+ f[2] = f[2] + n
+end
+
+--
+
+function streams.readbyte(f)
+ local i = f[2]
+ f[2] = i + 1
+ return byte(f[1],i)
+end
+
+function streams.readbytes(f,n)
+ local i = f[2]
+ local j = i + n
+ f[2] = j
+ return byte(f[1],i,j-1)
+end
+
+function streams.readbytetable(f,n)
+ local i = f[2]
+ local j = i + n
+ f[2] = j
+ return { byte(f[1],i,j-1) }
+end
+
+function streams.skipbytes(f,n)
+ f[2] = f[2] + n
+end
+
+function streams.readchar(f)
+ local i = f[2]
+ f[2] = i + 1
+ return sub(f[1],i,i)
+end
+
+function streams.readstring(f,n)
+ local i = f[2]
+ local j = i + n
+ f[2] = j
+ return sub(f[1],i,j-1)
+end
+
+function streams.skipshort(f,n) f[2] = f[2] + 2*(n or 1) end
+function streams.skiplong (f,n) f[2] = f[2] + 4*(n or 1) end
+
+local readcardinal1 = sio.readcardinal1
+local readcardinal2 = sio.readcardinal2
+local readcardinal3 = sio.readcardinal3
+local readcardinal4 = sio.readcardinal4
+
+function streams.readcardinal1(f) local i = f[2] f[2] = i + 1 return readcardinal1(f[1],i) end
+function streams.readcardinal2(f) local i = f[2] f[2] = i + 2 return readcardinal2(f[1],i) end
+function streams.readcardinal3(f) local i = f[2] f[2] = i + 3 return readcardinal3(f[1],i) end
+function streams.readcardinal4(f) local i = f[2] f[2] = i + 4 return readcardinal4(f[1],i) end
+
+local readcardinal1le = sio.readcardinal1le
+local readcardinal2le = sio.readcardinal2le
+local readcardinal3le = sio.readcardinal3le
+local readcardinal4le = sio.readcardinal4le
+
+function streams.readcardinal1le(f) local i = f[2] f[2] = i + 1 return readcardinal1le(f[1],i) end
+function streams.readcardinal2le(f) local i = f[2] f[2] = i + 2 return readcardinal2le(f[1],i) end
+function streams.readcardinal3le(f) local i = f[2] f[2] = i + 3 return readcardinal3le(f[1],i) end
+function streams.readcardinal4le(f) local i = f[2] f[2] = i + 4 return readcardinal4le(f[1],i) end
+
+local readinteger1 = sio.readinteger1
+local readinteger2 = sio.readinteger2
+local readinteger3 = sio.readinteger3
+local readinteger4 = sio.readinteger4
+
+function streams.readinteger1(f) local i = f[2] f[2] = i + 1 return readinteger1(f[1],i) end
+function streams.readinteger2(f) local i = f[2] f[2] = i + 2 return readinteger2(f[1],i) end
+function streams.readinteger3(f) local i = f[2] f[2] = i + 3 return readinteger3(f[1],i) end
+function streams.readinteger4(f) local i = f[2] f[2] = i + 4 return readinteger4(f[1],i) end
+
+local readinteger1le = sio.readinteger1le
+local readinteger2le = sio.readinteger2le
+local readinteger3le = sio.readinteger3le
+local readinteger4le = sio.readinteger4le
+
+function streams.readinteger1le(f) local i = f[2] f[2] = i + 1 return readinteger1le(f[1],i) end
+function streams.readinteger2le(f) local i = f[2] f[2] = i + 2 return readinteger2le(f[1],i) end
+function streams.readinteger3le(f) local i = f[2] f[2] = i + 3 return readinteger3le(f[1],i) end
+function streams.readinteger4le(f) local i = f[2] f[2] = i + 4 return readinteger4le(f[1],i) end
+
+local readfixed2 = sio.readfixed2
+local readfixed4 = sio.readfixed4
+local read2dot14 = sio.read2dot14
+
+function streams.readfixed2(f) local i = f[2] f[2] = i + 2 return readfixed2(f[1],i) end
+function streams.readfixed4(f) local i = f[2] f[2] = i + 4 return readfixed4(f[1],i) end
+function streams.read2dot14(f) local i = f[2] f[2] = i + 2 return read2dot14(f[1],i) end
+
+local readcstring = sio.readcstring
+local readcline = sio.readcline
+
+function streams.readcstring(f)
+ local s, p = readcstring(f[1],f[2])
+ f[2] = p
+ return s
+end
+
+function streams.readcline(f,n)
+ local s, p = readcline(f[1],f[2])
+ f[2] = p
+ return s
+end
+
+local readbytes = sio.readbytes
+local readbytetable = sio.readbytetable
+
+function streams.readbytes(f,n)
+ local i = f[2]
+ local s = f[3]
+ local p = i + n
+ if p > s then
+ f[2] = s + 1
+ else
+ f[2] = p
+ end
+ return readbytes(f[1],i,n)
+end
+
+function streams.readbytetable(f,n)
+ local i = f[2]
+ local s = f[3]
+ local p = i + n
+ if p > s then
+ f[2] = s + 1
+ else
+ f[2] = p
+ end
+ return readbytetable(f[1],i,n)
+end
+
+streams.readbyte = streams.readcardinal1
+streams.readsignedbyte = streams.readinteger1
+streams.readcardinal1 = streams.readcardinal1
+streams.readcardinal = streams.readcardinal1
+streams.readinteger = streams.readinteger1
+streams.readinteger1 = streams.readinteger1
+
+local readcardinaltable = sio.readcardinaltable
+local readintegertable = sio.readintegertable
+
+function utilities.streams.readcardinaltable(f,n,b)
+ local i = f[2]
+ local s = f[3]
+ local p = i + n * b
+ if p > s then
+ f[2] = s + 1
+ else
+ f[2] = p
+ end
+ return readcardinaltable(f[1],i,n,b)
+end
+
+function utilities.streams.readintegertable(f,n,b)
+ local i = f[2]
+ local s = f[3]
+ local p = i + n * b
+ if p > s then
+ f[2] = s + 1
+ else
+ f[2] = p
+ end
+ return readintegertable(f[1],i,n,b)
+end
+
+-- For practical reasons we put this here. It's less efficient but ok when we don't
+-- have much access.
+
+local files = utilities.files
+
+if files then
+
+ local openfile = files.open
+ local openstream = streams.open
+ local openstring = streams.openstring
+
+ local setmetatable = setmetatable
+
+ function io.newreader(str,method)
+ local f, m
+ if method == "string" then
+ f = openstring(str,true)
+ m = streams
+ elseif method == "stream" then
+ f = openstream(str,true)
+ m = streams
+ else
+ f = openfile(str,"rb")
+ m = files
+ end
+ if f then
+ local t = { }
+ setmetatable(t, {
+ __index = function(t,k)
+ local r = m[k]
+ if k == "close" then
+ if f then
+ m.close(f)
+ f = nil
+ end
+ return function() end
+ elseif r then
+ local v = function(_,a,b) return r(f,a,b) end
+ t[k] = v
+ return v
+ else
+ print("unknown key",k)
+ end
+ end
+ } )
+ return t
+ end
+ end
+
+end
+
+streams.tocardinal1 = sio.tocardinal1
+streams.tocardinal2 = sio.tocardinal2
+streams.tocardinal3 = sio.tocardinal3
+streams.tocardinal4 = sio.tocardinal4
+
+streams.tocardinal1le = sio.tocardinal1le
+streams.tocardinal2le = sio.tocardinal2le
+streams.tocardinal3le = sio.tocardinal3le
+streams.tocardinal4le = sio.tocardinal4le